]> git.proxmox.com Git - ceph.git/commitdiff
import ceph 16.2.7
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Dec 2021 12:07:09 +0000 (13:07 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Dec 2021 12:07:09 +0000 (13:07 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
1381 files changed:
ceph/.github/labeler.yml
ceph/.github/workflows/pr-triage.yml
ceph/CMakeLists.txt
ceph/PendingReleaseNotes
ceph/admin/build-doc
ceph/admin/doc-requirements.txt
ceph/ceph.spec
ceph/ceph.spec.in
ceph/changelog.upstream
ceph/cmake/modules/Buildpmem.cmake
ceph/cmake/modules/Findpmem.cmake
ceph/debian/ceph-base.install
ceph/debian/ceph-osd.install
ceph/debian/control
ceph/debian/rules
ceph/doc/ceph-volume/lvm/activate.rst
ceph/doc/cephadm/adoption.rst
ceph/doc/cephadm/custom-container.rst [deleted file]
ceph/doc/cephadm/host-management.rst
ceph/doc/cephadm/index.rst
ceph/doc/cephadm/install.rst
ceph/doc/cephadm/iscsi.rst [deleted file]
ceph/doc/cephadm/mds.rst [deleted file]
ceph/doc/cephadm/mon.rst [deleted file]
ceph/doc/cephadm/monitoring.rst [deleted file]
ceph/doc/cephadm/nfs.rst [deleted file]
ceph/doc/cephadm/operations.rst
ceph/doc/cephadm/osd.rst [deleted file]
ceph/doc/cephadm/rgw.rst [deleted file]
ceph/doc/cephadm/service-management.rst [deleted file]
ceph/doc/cephadm/services/custom-container.rst [new file with mode: 0644]
ceph/doc/cephadm/services/index.rst [new file with mode: 0644]
ceph/doc/cephadm/services/iscsi.rst [new file with mode: 0644]
ceph/doc/cephadm/services/mds.rst [new file with mode: 0644]
ceph/doc/cephadm/services/mgr.rst [new file with mode: 0644]
ceph/doc/cephadm/services/mon.rst [new file with mode: 0644]
ceph/doc/cephadm/services/monitoring.rst [new file with mode: 0644]
ceph/doc/cephadm/services/nfs.rst [new file with mode: 0644]
ceph/doc/cephadm/services/osd.rst [new file with mode: 0644]
ceph/doc/cephadm/services/rgw.rst [new file with mode: 0644]
ceph/doc/cephadm/troubleshooting.rst
ceph/doc/cephadm/upgrade.rst
ceph/doc/cephfs/cephfs-mirroring.rst
ceph/doc/cephfs/cephfs-shell.rst
ceph/doc/cephfs/fs-nfs-exports.rst [deleted file]
ceph/doc/cephfs/fs-volumes.rst
ceph/doc/cephfs/index.rst
ceph/doc/cephfs/multimds.rst
ceph/doc/cephfs/nfs.rst
ceph/doc/dev/cephfs-mirroring.rst
ceph/doc/dev/developer_guide/dash-devel.rst
ceph/doc/dev/developer_guide/tests-unit-tests.rst
ceph/doc/dev/vstart-ganesha.rst [new file with mode: 0644]
ceph/doc/man/8/cephfs-top.rst
ceph/doc/mgr/dashboard.rst
ceph/doc/mgr/index.rst
ceph/doc/mgr/nfs.rst [new file with mode: 0644]
ceph/doc/mgr/orchestrator_modules.rst
ceph/doc/mgr/prometheus.rst
ceph/doc/mgr/rook.rst
ceph/doc/rados/configuration/mclock-config-ref.rst
ceph/doc/rados/index.rst
ceph/doc/rados/operations/control.rst
ceph/doc/rados/operations/index.rst
ceph/doc/rados/operations/placement-groups.rst
ceph/doc/rados/operations/stretch-mode.rst
ceph/doc/rados/troubleshooting/troubleshooting-mon.rst
ceph/doc/radosgw/config-ref.rst
ceph/doc/radosgw/nfs.rst
ceph/doc/radosgw/notifications.rst
ceph/doc/radosgw/s3-notification-compatibility.rst
ceph/doc/start/documenting-ceph.rst
ceph/doc_deps.deb.txt
ceph/examples/boto3/README.md
ceph/install-deps.sh
ceph/make-dist
ceph/monitoring/grafana/dashboards/ceph-cluster.json
ceph/monitoring/grafana/dashboards/cephfs-overview.json
ceph/monitoring/grafana/dashboards/host-details.json
ceph/monitoring/grafana/dashboards/hosts-overview.json
ceph/monitoring/grafana/dashboards/jsonnet/grafana_dashboards.jsonnet
ceph/monitoring/grafana/dashboards/osd-device-details.json
ceph/monitoring/grafana/dashboards/osds-overview.json
ceph/monitoring/grafana/dashboards/pool-detail.json
ceph/monitoring/grafana/dashboards/pool-overview.json
ceph/monitoring/grafana/dashboards/radosgw-detail.json
ceph/monitoring/grafana/dashboards/radosgw-overview.json
ceph/monitoring/grafana/dashboards/radosgw-sync-overview.json
ceph/monitoring/grafana/dashboards/rbd-details.json
ceph/monitoring/grafana/dashboards/rbd-overview.json
ceph/monitoring/prometheus/alerts/ceph_default_alerts.yml
ceph/monitoring/prometheus/alerts/test_alerts.yml
ceph/qa/cephfs/overrides/frag.yaml [new file with mode: 0644]
ceph/qa/cephfs/overrides/frag_enable.yaml [deleted file]
ceph/qa/distros/podman/centos_8.stream_container_tools.yaml [new file with mode: 0644]
ceph/qa/distros/podman/rhel_8.3_kubic_stable.yaml [deleted file]
ceph/qa/distros/podman/rhel_8.4_container_tools_3.0.yaml [new file with mode: 0644]
ceph/qa/distros/podman/rhel_8.4_container_tools_rhel8.yaml [new file with mode: 0644]
ceph/qa/distros/podman/ubuntu_18.04_kubic_stable.yaml [deleted file]
ceph/qa/distros/podman/ubuntu_20.04_kubic_stable.yaml [deleted file]
ceph/qa/distros/podman/ubuntu_20.04_kubic_testing.yaml [deleted file]
ceph/qa/standalone/scrub/osd-scrub-repair.sh
ceph/qa/suites/fs/32bits/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/bugs/client_trim_caps/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/full/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/functional/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/libcephfs/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/libcephfs/tasks/libcephfs.yaml [deleted file]
ceph/qa/suites/fs/libcephfs/tasks/libcephfs/+ [new file with mode: 0644]
ceph/qa/suites/fs/libcephfs/tasks/libcephfs/.qa [new symlink]
ceph/qa/suites/fs/libcephfs/tasks/libcephfs/frag.yaml [new symlink]
ceph/qa/suites/fs/libcephfs/tasks/libcephfs/test.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/% [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/.qa [new symlink]
ceph/qa/suites/fs/mirror-ha/begin.yaml [new symlink]
ceph/qa/suites/fs/mirror-ha/cephfs-mirror/three-per-cluster.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/clients/+ [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/clients/.qa [new symlink]
ceph/qa/suites/fs/mirror-ha/clients/mirror.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/cluster/+ [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/cluster/1-node.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/objectstore/.qa [new symlink]
ceph/qa/suites/fs/mirror-ha/objectstore/bluestore-bitmap.yaml [new symlink]
ceph/qa/suites/fs/mirror-ha/overrides/+ [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/overrides/.qa [new symlink]
ceph/qa/suites/fs/mirror-ha/overrides/whitelist_health.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror-ha/supported-random-distro$ [new symlink]
ceph/qa/suites/fs/mirror-ha/workloads/.qa [new symlink]
ceph/qa/suites/fs/mirror-ha/workloads/cephfs-mirror-ha-workunit.yaml [new file with mode: 0644]
ceph/qa/suites/fs/mirror/tasks/mirror.yaml
ceph/qa/suites/fs/mixed-clients/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/multiclient/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/multifs/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/multifs/tasks/failover.yaml
ceph/qa/suites/fs/permission/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/shell/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/snaps/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/thrash/multifs/overrides/frag.yaml [new symlink]
ceph/qa/suites/fs/thrash/multifs/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/thrash/workloads/overrides/frag.yaml [new symlink]
ceph/qa/suites/fs/thrash/workloads/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/traceless/overrides/frag.yaml [new symlink]
ceph/qa/suites/fs/traceless/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/upgrade/featureful_client/old_client/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/upgrade/featureful_client/upgraded_client/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/% [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/bluestore-bitmap.yaml [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/centos_8.stream_container_tools.yaml [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/conf [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/% [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/pg-warn.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_health.yaml [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_wrongly_marked_down.yaml [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/roles.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/% [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/v16.2.4.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/% [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/0-create.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/1.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/2.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/.qa [new symlink]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/no.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/yes.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/3-verify.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/2-client.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/3-upgrade-with-workload.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/4-verify.yaml [new file with mode: 0644]
ceph/qa/suites/fs/upgrade/volumes/import-legacy/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/valgrind/mirror/tasks/mirror.yaml
ceph/qa/suites/fs/verify/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/volumes/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/fs/workload/overrides/frag.yaml [new symlink]
ceph/qa/suites/fs/workload/overrides/frag_enable.yaml [deleted symlink]
ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.2_container_tools_3.0.yaml [deleted symlink]
ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.3_container_tools_3.0.yaml [new symlink]
ceph/qa/suites/orch/cephadm/mds_upgrade_sequence [new symlink]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/% [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/.qa [new symlink]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/.qa [new symlink]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.3_container_tools_3.0.yaml [new symlink]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.stream_container_tools.yaml [new symlink]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.4.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.5.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/octopus.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-start.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/2-nfs.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/3-upgrade-with-workload.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/4-final.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/osds/2-ops/rm-zap-flag.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-bucket.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-user.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress.yaml
ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress2.yaml
ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.2_container_tools_3.0.yaml [new symlink]
ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.stream_container_tools.yaml [new symlink]
ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_3.0.yaml [new symlink]
ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_rhel8.yaml [new symlink]
ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.3-octopus.yaml [deleted file]
ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.stream_container-tools.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/upgrade/5-upgrade-ls.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/workunits/0-distro/centos_8.stream_container_tools.yaml [new symlink]
ceph/qa/suites/orch/cephadm/workunits/task/test_nfs.yaml [new file with mode: 0644]
ceph/qa/suites/orch/cephadm/workunits/task/test_orch_cli.yaml
ceph/qa/suites/perf-basic/ubuntu_18.04.yaml [deleted symlink]
ceph/qa/suites/perf-basic/ubuntu_latest.yaml [new symlink]
ceph/qa/suites/perf-basic/workloads/cosbench_64K_write.yaml [deleted file]
ceph/qa/suites/rados/dashboard/tasks/dashboard.yaml
ceph/qa/suites/rados/mgr/tasks/module_selftest.yaml
ceph/qa/suites/rados/mgr/tasks/progress.yaml
ceph/qa/suites/rados/perf/ceph.yaml
ceph/qa/suites/rados/perf/ubuntu_18.04.yaml [deleted symlink]
ceph/qa/suites/rados/perf/ubuntu_latest.yaml [new symlink]
ceph/qa/suites/rados/perf/workloads/cosbench_64K_read_write.yaml [deleted file]
ceph/qa/suites/rados/perf/workloads/cosbench_64K_write.yaml [deleted file]
ceph/qa/suites/rados/singleton/all/backfill-toofull.yaml [new file with mode: 0644]
ceph/qa/suites/rados/singleton/all/ec-inconsistent-hinfo.yaml [new file with mode: 0644]
ceph/qa/suites/rados/singleton/all/rebuild-mondb.yaml
ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-bootstrap-workunit.yaml [deleted file]
ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-journal-bootstrap-workunit.yaml [new file with mode: 0644]
ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-snapshot-bootstrap-workunit.yaml [new file with mode: 0644]
ceph/qa/suites/rbd/persistent-writeback-cache/4-pool/big-cache.yaml [new file with mode: 0644]
ceph/qa/suites/rgw/verify/tasks/s3tests-java.yaml
ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-parallel/point-to-point-upgrade.yaml
ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific..yaml [deleted file]
ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific.yaml [new file with mode: 0644]
ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/6-final-workload/rbd-python.yaml
ceph/qa/tasks/backfill_toofull.py [new file with mode: 0644]
ceph/qa/tasks/barbican.py
ceph/qa/tasks/ceph.py
ceph/qa/tasks/ceph_manager.py
ceph/qa/tasks/ceph_test_case.py
ceph/qa/tasks/cephfs/filesystem.py
ceph/qa/tasks/cephfs/mount.py
ceph/qa/tasks/cephfs/test_failover.py
ceph/qa/tasks/cephfs/test_mirroring.py
ceph/qa/tasks/cephfs/test_nfs.py
ceph/qa/tasks/cephfs/test_snapshots.py
ceph/qa/tasks/cephfs/test_volumes.py
ceph/qa/tasks/cephfs_mirror.py
ceph/qa/tasks/cephfs_mirror_thrash.py [new file with mode: 0644]
ceph/qa/tasks/cram.py
ceph/qa/tasks/ec_inconsistent_hinfo.py [new file with mode: 0644]
ceph/qa/tasks/fs.py
ceph/qa/tasks/kubeadm.py
ceph/qa/tasks/mgr/dashboard/__init__.py
ceph/qa/tasks/mgr/dashboard/helper.py
ceph/qa/tasks/mgr/dashboard/test_api.py
ceph/qa/tasks/mgr/dashboard/test_auth.py
ceph/qa/tasks/mgr/dashboard/test_cluster.py [new file with mode: 0644]
ceph/qa/tasks/mgr/dashboard/test_ganesha.py [deleted file]
ceph/qa/tasks/mgr/dashboard/test_host.py
ceph/qa/tasks/mgr/dashboard/test_pool.py
ceph/qa/tasks/mgr/dashboard/test_requests.py
ceph/qa/tasks/mgr/dashboard/test_rgw.py
ceph/qa/tasks/mgr/dashboard/test_user.py
ceph/qa/tasks/mgr/test_module_selftest.py
ceph/qa/tasks/mgr/test_orchestrator_cli.py
ceph/qa/tasks/mgr/test_progress.py
ceph/qa/tasks/pykmip.py
ceph/qa/tasks/python.py [new file with mode: 0644]
ceph/qa/tasks/s3a_hadoop.py
ceph/qa/tasks/tox.py
ceph/qa/tasks/vip.py
ceph/qa/tasks/vstart_runner.py
ceph/qa/workunits/cephadm/test_dashboard_e2e.sh
ceph/qa/workunits/fs/cephfs_mirror_ha_gen.sh [new file with mode: 0755]
ceph/qa/workunits/fs/cephfs_mirror_ha_verify.sh [new file with mode: 0755]
ceph/qa/workunits/fs/cephfs_mirror_helpers.sh [new file with mode: 0644]
ceph/qa/workunits/mon/pg_autoscaler.sh
ceph/qa/workunits/rbd/rbd_mirror_bootstrap.sh
ceph/qa/workunits/rbd/rbd_mirror_helpers.sh
ceph/qa/workunits/rbd/rbd_mirror_journal.sh
ceph/qa/workunits/rbd/rbd_mirror_snapshot.sh
ceph/qa/workunits/rbd/rbd_mirror_stress.sh
ceph/src/.git_version
ceph/src/CMakeLists.txt
ceph/src/auth/cephx/CephxKeyServer.cc
ceph/src/auth/cephx/CephxKeyServer.h
ceph/src/ceph-volume/CMakeLists.txt
ceph/src/ceph-volume/ceph_volume/api/lvm.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/activate.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/batch.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/common.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/migrate.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/prepare.py
ceph/src/ceph-volume/ceph_volume/devices/lvm/zap.py
ceph/src/ceph-volume/ceph_volume/devices/simple/scan.py
ceph/src/ceph-volume/ceph_volume/tests/api/test_lvm.py
ceph/src/ceph-volume/ceph_volume/tests/conftest.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_activate.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_batch.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_migrate.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_prepare.py
ceph/src/ceph-volume/ceph_volume/tests/devices/lvm/test_zap.py
ceph/src/ceph-volume/ceph_volume/tests/functional/Vagrantfile
ceph/src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/setup_mixed_type.yml
ceph/src/ceph-volume/ceph_volume/tests/util/test_prepare.py
ceph/src/ceph-volume/ceph_volume/util/device.py
ceph/src/ceph-volume/ceph_volume/util/prepare.py
ceph/src/cephadm/cephadm
ceph/src/cephadm/tests/test_cephadm.py
ceph/src/client/Client.cc
ceph/src/client/Client.h
ceph/src/cls/rbd/cls_rbd.cc
ceph/src/cls/rbd/cls_rbd_client.cc
ceph/src/cls/rbd/cls_rbd_client.h
ceph/src/common/Timer.cc
ceph/src/common/Timer.h
ceph/src/common/config.cc
ceph/src/common/config.h
ceph/src/common/config_proxy.h
ceph/src/common/fair_mutex.h [new file with mode: 0644]
ceph/src/common/legacy_config_opts.h
ceph/src/common/options.cc
ceph/src/include/CompatSet.h
ceph/src/include/cephfs/metrics/Types.h
ceph/src/journal/JournalMetadata.h
ceph/src/journal/JournalPlayer.h
ceph/src/journal/JournalRecorder.h
ceph/src/journal/Journaler.h
ceph/src/journal/ObjectPlayer.h
ceph/src/journal/ObjectRecorder.h
ceph/src/librbd/ImageCtx.cc
ceph/src/librbd/ImageCtx.h
ceph/src/librbd/Journal.h
ceph/src/librbd/api/Pool.cc
ceph/src/librbd/cache/pwl/AbstractWriteLog.cc
ceph/src/librbd/cache/pwl/AbstractWriteLog.h
ceph/src/librbd/cache/pwl/InitRequest.cc
ceph/src/librbd/cache/pwl/LogEntry.cc
ceph/src/librbd/cache/pwl/LogEntry.h
ceph/src/librbd/cache/pwl/LogOperation.cc
ceph/src/librbd/cache/pwl/LogOperation.h
ceph/src/librbd/cache/pwl/Request.h
ceph/src/librbd/cache/pwl/Types.h
ceph/src/librbd/cache/pwl/rwl/LogEntry.cc
ceph/src/librbd/cache/pwl/rwl/LogEntry.h
ceph/src/librbd/cache/pwl/rwl/Request.cc
ceph/src/librbd/cache/pwl/rwl/WriteLog.cc
ceph/src/librbd/cache/pwl/rwl/WriteLog.h
ceph/src/librbd/cache/pwl/ssd/LogEntry.cc
ceph/src/librbd/cache/pwl/ssd/LogEntry.h
ceph/src/librbd/cache/pwl/ssd/Request.cc
ceph/src/librbd/cache/pwl/ssd/WriteLog.cc
ceph/src/librbd/cache/pwl/ssd/WriteLog.h
ceph/src/librbd/image/CreateRequest.cc
ceph/src/librbd/image/RemoveRequest.h
ceph/src/librbd/image/ValidatePoolRequest.cc
ceph/src/librbd/image/ValidatePoolRequest.h
ceph/src/librbd/io/TypeTraits.h
ceph/src/librbd/journal/CreateRequest.h
ceph/src/librbd/journal/RemoveRequest.h
ceph/src/librbd/journal/ResetRequest.h
ceph/src/librbd/mirror/snapshot/PromoteRequest.h
ceph/src/librbd/object_map/DiffRequest.cc
ceph/src/librbd/plugin/Api.h
ceph/src/mds/FSMap.cc
ceph/src/mds/FSMap.h
ceph/src/mds/MDCache.cc
ceph/src/mds/MDSDaemon.h
ceph/src/mds/MDSMap.cc
ceph/src/mds/MDSMap.h
ceph/src/mds/MDSPerfMetricTypes.h
ceph/src/mds/MDSRank.cc
ceph/src/mds/MDSRank.h
ceph/src/mds/MetricAggregator.cc
ceph/src/mds/MetricsHandler.cc
ceph/src/mds/MetricsHandler.h
ceph/src/mds/Server.cc
ceph/src/mds/cephfs_features.h
ceph/src/messages/MClientSession.h
ceph/src/mgr/ActivePyModules.cc
ceph/src/mgr/BaseMgrModule.cc
ceph/src/mgr/MDSPerfMetricTypes.cc
ceph/src/mgr/MDSPerfMetricTypes.h
ceph/src/mgr/MetricCollector.h
ceph/src/mon/AuthMonitor.cc
ceph/src/mon/AuthMonitor.h
ceph/src/mon/KVMonitor.cc
ceph/src/mon/MDSMonitor.cc
ceph/src/mon/MonCap.cc
ceph/src/mon/MonCommands.h
ceph/src/mon/MonMap.cc
ceph/src/mon/MonmapMonitor.cc
ceph/src/msg/async/AsyncMessenger.cc
ceph/src/msg/async/AsyncMessenger.h
ceph/src/msg/async/ProtocolV2.cc
ceph/src/mypy.ini
ceph/src/os/bluestore/BlueFS.cc
ceph/src/os/bluestore/BlueStore.cc
ceph/src/os/bluestore/BlueStore.h
ceph/src/osd/ECBackend.cc
ceph/src/osd/ECBackend.h
ceph/src/osd/OSD.cc
ceph/src/osd/OSD.h
ceph/src/osd/OSDMap.cc
ceph/src/osd/PGLog.cc
ceph/src/osd/PeeringState.cc
ceph/src/osd/PrimaryLogPG.cc
ceph/src/osd/scheduler/OpScheduler.h
ceph/src/osd/scheduler/mClockScheduler.cc
ceph/src/osd/scheduler/mClockScheduler.h
ceph/src/pmdk/.cirrus.yml [new file with mode: 0644]
ceph/src/pmdk/.codecov.yml [new file with mode: 0644]
ceph/src/pmdk/.gitattributes [new file with mode: 0644]
ceph/src/pmdk/.github/ISSUE_TEMPLATE.md [new file with mode: 0644]
ceph/src/pmdk/.github/ISSUE_TEMPLATE/bug_report.md [new file with mode: 0644]
ceph/src/pmdk/.github/ISSUE_TEMPLATE/feature.md [new file with mode: 0644]
ceph/src/pmdk/.github/ISSUE_TEMPLATE/question.md [new file with mode: 0644]
ceph/src/pmdk/.github/workflows/coverity.yml [new file with mode: 0644]
ceph/src/pmdk/.github/workflows/gha.yml [new file with mode: 0644]
ceph/src/pmdk/.mailmap [new file with mode: 0644]
ceph/src/pmdk/.skip-doc [new file with mode: 0644]
ceph/src/pmdk/.travis.yml [new file with mode: 0644]
ceph/src/pmdk/CODING_STYLE.md [new file with mode: 0644]
ceph/src/pmdk/CONTRIBUTING.md [new file with mode: 0644]
ceph/src/pmdk/ChangeLog [new file with mode: 0644]
ceph/src/pmdk/LICENSE [new file with mode: 0644]
ceph/src/pmdk/Makefile [new file with mode: 0644]
ceph/src/pmdk/README.md [new file with mode: 0644]
ceph/src/pmdk/VERSION [new file with mode: 0644]
ceph/src/pmdk/appveyor.yml [new file with mode: 0644]
ceph/src/pmdk/res/PMDK.ico [new file with mode: 0644]
ceph/src/pmdk/src/.clang-format [new file with mode: 0644]
ceph/src/pmdk/src/LongPath.manifest [new file with mode: 0644]
ceph/src/pmdk/src/LongPathSupport.props [new file with mode: 0644]
ceph/src/pmdk/src/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/Makefile.inc [new file with mode: 0644]
ceph/src/pmdk/src/PMDK.sln [new file with mode: 0644]
ceph/src/pmdk/src/README [new file with mode: 0644]
ceph/src/pmdk/src/common.inc [new file with mode: 0644]
ceph/src/pmdk/src/common/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/common/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/common/bad_blocks.c [new file with mode: 0644]
ceph/src/pmdk/src/common/badblocks.h [new file with mode: 0644]
ceph/src/pmdk/src/common/common.rc [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl.c [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl.h [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl_cow.c [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl_fallocate.c [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl_global.h [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl_prefault.c [new file with mode: 0644]
ceph/src/pmdk/src/common/ctl_sds.c [new file with mode: 0644]
ceph/src/pmdk/src/common/dlsym.h [new file with mode: 0644]
ceph/src/pmdk/src/common/file.c [new file with mode: 0644]
ceph/src/pmdk/src/common/file.h [new file with mode: 0644]
ceph/src/pmdk/src/common/file_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/common/file_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/common/libpmemcommon.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/common/libpmemcommon.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/common/mmap.c [new file with mode: 0644]
ceph/src/pmdk/src/common/mmap.h [new file with mode: 0644]
ceph/src/pmdk/src/common/mmap_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/common/mmap_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/common/os_deep.h [new file with mode: 0644]
ceph/src/pmdk/src/common/os_deep_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/common/os_deep_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/common/page_size.h [new file with mode: 0644]
ceph/src/pmdk/src/common/pmemcommon.h [new file with mode: 0644]
ceph/src/pmdk/src/common/pmemcommon.inc [new file with mode: 0644]
ceph/src/pmdk/src/common/pool_hdr.c [new file with mode: 0644]
ceph/src/pmdk/src/common/pool_hdr.h [new file with mode: 0644]
ceph/src/pmdk/src/common/queue.h [new file with mode: 0644]
ceph/src/pmdk/src/common/rand.c [new file with mode: 0644]
ceph/src/pmdk/src/common/rand.h [new file with mode: 0644]
ceph/src/pmdk/src/common/ravl.c [new file with mode: 0644]
ceph/src/pmdk/src/common/ravl.h [new file with mode: 0644]
ceph/src/pmdk/src/common/set.c [new file with mode: 0644]
ceph/src/pmdk/src/common/set.h [new file with mode: 0644]
ceph/src/pmdk/src/common/set_badblocks.c [new file with mode: 0644]
ceph/src/pmdk/src/common/set_badblocks.h [new file with mode: 0644]
ceph/src/pmdk/src/common/shutdown_state.c [new file with mode: 0644]
ceph/src/pmdk/src/common/shutdown_state.h [new file with mode: 0644]
ceph/src/pmdk/src/common/sys_util.h [new file with mode: 0644]
ceph/src/pmdk/src/common/util_pmem.h [new file with mode: 0644]
ceph/src/pmdk/src/common/uuid.c [new file with mode: 0644]
ceph/src/pmdk/src/common/uuid.h [new file with mode: 0644]
ceph/src/pmdk/src/common/uuid_freebsd.c [new file with mode: 0644]
ceph/src/pmdk/src/common/uuid_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/common/uuid_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/common/vec.h [new file with mode: 0644]
ceph/src/pmdk/src/common/vecq.h [new file with mode: 0644]
ceph/src/pmdk/src/core/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/core/alloc.c [new file with mode: 0644]
ceph/src/pmdk/src/core/alloc.h [new file with mode: 0644]
ceph/src/pmdk/src/core/errno_freebsd.h [new file with mode: 0644]
ceph/src/pmdk/src/core/fault_injection.h [new file with mode: 0644]
ceph/src/pmdk/src/core/fs.h [new file with mode: 0644]
ceph/src/pmdk/src/core/fs_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/core/fs_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/core/libpmemcore.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/core/libpmemcore.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/core/os.h [new file with mode: 0644]
ceph/src/pmdk/src/core/os_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/core/os_thread.h [new file with mode: 0644]
ceph/src/pmdk/src/core/os_thread_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/core/os_thread_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/core/os_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/core/out.c [new file with mode: 0644]
ceph/src/pmdk/src/core/out.h [new file with mode: 0644]
ceph/src/pmdk/src/core/pmemcore.h [new file with mode: 0644]
ceph/src/pmdk/src/core/pmemcore.inc [new file with mode: 0644]
ceph/src/pmdk/src/core/util.c [new file with mode: 0644]
ceph/src/pmdk/src/core/util.h [new file with mode: 0644]
ceph/src/pmdk/src/core/util_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/core/util_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/README [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/drd.h [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/helgrind.h [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/memcheck.h [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/pmemcheck.h [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind/valgrind.h [new file with mode: 0644]
ceph/src/pmdk/src/core/valgrind_internal.h [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/README [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/include/endian.h [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/include/features.h [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/include/linux/kdev_t.h [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/include/linux/limits.h [new file with mode: 0644]
ceph/src/pmdk/src/freebsd/include/sys/sysmacros.h [new file with mode: 0644]
ceph/src/pmdk/src/include/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/include/README [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmem.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmem2.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemblk.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemlog.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj++/README.md [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj++/detail/README.md [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/action.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/action_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/atomic.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/atomic_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/ctl.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/iterator.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/iterator_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/lists_atomic.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/lists_atomic_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/pool.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/pool_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/thread.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/tx.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/tx_base.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmemobj/types.h [new file with mode: 0644]
ceph/src/pmdk/src/include/libpmempool.h [new file with mode: 0644]
ceph/src/pmdk/src/include/librpmem.h [new file with mode: 0644]
ceph/src/pmdk/src/include/pmemcompat.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/libpmem_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/pmem.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/pmem.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/pmem_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem/pmem_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/aarch64/arm_cacheops.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/aarch64/flags.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/aarch64/flush.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/aarch64/init.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/aarch64/sources.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/auto_flush.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/auto_flush_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/auto_flush_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/auto_flush_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/auto_flush_windows.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/badblocks.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/badblocks_ndctl.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/badblocks_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/config.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/config.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/deep_flush.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/deep_flush.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/deep_flush_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/deep_flush_other.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/deep_flush_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/errormsg.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/extent.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/extent_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/extent_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/libpmem2_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/map.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/map.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/map_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/map_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/memops_generic.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/persist.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/persist.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/persist_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/persist_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_arch.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils_linux.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils_ndctl.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/pmem2_utils_other.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ppc64/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ppc64/flags.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ppc64/init.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ppc64/sources.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ravl_interval.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/ravl_interval.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/region_namespace.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/region_namespace_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/source.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/source.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/source_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/source_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/usc_ndctl.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/usc_none.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/usc_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/vm_reservation.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/vm_reservation.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/vm_reservation_posix.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/vm_reservation_windows.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/avx.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/cpu.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/cpu.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/flags.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/flush.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/init.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx512f.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx512f.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_sse2.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_sse2.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx512f.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_sse2.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memcpy_memset.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx512f.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx512f.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_sse2.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_sse2.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx512f.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_sse2.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmem2/x86_64/sources.inc [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/blk.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/blk.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/btt.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/btt.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/btt_layout.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmemblk/libpmemblk_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/libpmemlog_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/log.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemlog/log.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/alloc_class.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/alloc_class.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/bucket.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/bucket.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/container.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/container_ravl.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/container_ravl.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/container_seglists.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/container_seglists.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/critnib.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/critnib.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/ctl_debug.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/ctl_debug.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/heap.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/heap.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/heap_layout.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/lane.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/lane.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/libpmemobj_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/list.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/list.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/memblock.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/memblock.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/memops.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/memops.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/obj.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/obj.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/palloc.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/palloc.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/pmalloc.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/pmalloc.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/pmemops.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/recycler.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/recycler.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/stats.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/stats.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/sync.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/sync.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/tx.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/tx.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/ulog.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmemobj/ulog.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_backup.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_bad_blocks.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_blk.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_btt_info.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_btt_map_flog.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_log.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_pool_hdr.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_sds.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_util.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_util.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/check_write.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/feature.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.def [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.link.in [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.rc [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/libpmempool_main.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/pmempool.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/pool.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/pool.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/replica.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/replica.h [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/rm.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/sync.c [new file with mode: 0644]
ceph/src/pmdk/src/libpmempool/transform.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/README [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/librpmem.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/librpmem.link.in [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem.h [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_cmd.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_cmd.h [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_fip.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_fip.h [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_obc.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_obc.h [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_ssh.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_ssh.h [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_util.c [new file with mode: 0644]
ceph/src/pmdk/src/librpmem/rpmem_util.h [new file with mode: 0644]
ceph/src/pmdk/src/libvmem/README.md [new file with mode: 0644]
ceph/src/pmdk/src/libvmmalloc/README.md [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_common.c [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_common.h [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_common_log.h [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.c [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.h [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_fip_lane.h [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_fip_msg.h [new file with mode: 0644]
ceph/src/pmdk/src/rpmem_common/rpmem_proto.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/tools/Makefile.inc [new file with mode: 0644]
ceph/src/pmdk/src/tools/daxio/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/tools/daxio/README [new file with mode: 0644]
ceph/src/pmdk/src/tools/daxio/daxio.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/README [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/bash_completion/pmempool [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/check.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/check.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/common.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/common.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/convert.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/convert.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/create.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/create.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/dump.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/dump.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/feature.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/feature.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/info.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/info.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/info_blk.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/info_log.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/info_obj.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/output.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/output.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/pmempool.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/pmempool.rc [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/rm.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/rm.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/synchronize.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/synchronize.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/transform.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmempool/transform.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/binaryoutputhandler.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/consistencycheckwrap.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/loggingfacility.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/markerparser.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/memoryoperations.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/operationfactory.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/opscontext.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/pmreorder.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/reorderengines.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/reorderexceptions.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/statemachine.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/pmreorder/utils.py [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/Makefile [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/README [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.h [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.c [new file with mode: 0644]
ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/README [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/LICENSE.txt [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/README [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/getopt.c [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/getopt.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/getopt.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/windows/getopt/getopt.vcxproj.filters [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/.cstyleignore [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/dirent.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/endian.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/err.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/features.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/libgen.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/linux/limits.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/platform.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sched.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/strings.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/file.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/mman.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/mount.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/param.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/resource.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/statvfs.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/uio.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/sys/wait.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/unistd.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/include/win_mmap.h [new file with mode: 0644]
ceph/src/pmdk/src/windows/libs_debug.props [new file with mode: 0644]
ceph/src/pmdk/src/windows/libs_release.props [new file with mode: 0644]
ceph/src/pmdk/src/windows/srcversion/srcversion.vcxproj [new file with mode: 0644]
ceph/src/pmdk/src/windows/win_mmap.c [new file with mode: 0644]
ceph/src/pmdk/utils/CHECK_WHITESPACE.PS1 [new file with mode: 0644]
ceph/src/pmdk/utils/CREATE-ZIP.PS1 [new file with mode: 0644]
ceph/src/pmdk/utils/CSTYLE.ps1 [new file with mode: 0644]
ceph/src/pmdk/utils/Makefile [new file with mode: 0644]
ceph/src/pmdk/utils/README [new file with mode: 0644]
ceph/src/pmdk/utils/SRCVERSION.ps1 [new file with mode: 0644]
ceph/src/pmdk/utils/build-dpkg.sh [new file with mode: 0755]
ceph/src/pmdk/utils/build-rpm.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check-area.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check-commit.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check-commits.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check-manpage [new file with mode: 0755]
ceph/src/pmdk/utils/check-manpages [new file with mode: 0755]
ceph/src/pmdk/utils/check-os.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check-shebang.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check_license/check-headers.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check_license/check-ms-license.pl [new file with mode: 0755]
ceph/src/pmdk/utils/check_license/file-exceptions.sh [new file with mode: 0755]
ceph/src/pmdk/utils/check_sdk_version.py [new file with mode: 0755]
ceph/src/pmdk/utils/check_whitespace [new file with mode: 0755]
ceph/src/pmdk/utils/copy-source.sh [new file with mode: 0755]
ceph/src/pmdk/utils/cstyle [new file with mode: 0755]
ceph/src/pmdk/utils/docker/0001-travis-fix-travisci_build_coverity_scan.sh.patch [new file with mode: 0644]
ceph/src/pmdk/utils/docker/README [new file with mode: 0644]
ceph/src/pmdk/utils/docker/build-CI.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/build-local.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/configure-tests.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch [new file with mode: 0644]
ceph/src/pmdk/utils/docker/images/Dockerfile.fedora-31 [new file with mode: 0644]
ceph/src/pmdk/utils/docker/images/Dockerfile.ubuntu-19.10 [new file with mode: 0644]
ceph/src/pmdk/utils/docker/images/README [new file with mode: 0644]
ceph/src/pmdk/utils/docker/images/build-image.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/download-scripts.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/install-libfabric.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/install-libndctl.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/install-valgrind.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/images/push-image.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/ppc64le.blacklist [new file with mode: 0644]
ceph/src/pmdk/utils/docker/prepare-for-build.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/pull-or-rebuild-image.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/run-build-package.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/run-build.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/run-coverage.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/run-coverity.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/run-doc-update.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/set-ci-vars.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/set-vars.sh [new file with mode: 0755]
ceph/src/pmdk/utils/docker/test_package/Makefile [new file with mode: 0644]
ceph/src/pmdk/utils/docker/test_package/README [new file with mode: 0644]
ceph/src/pmdk/utils/docker/test_package/test_package.c [new file with mode: 0644]
ceph/src/pmdk/utils/docker/valid-branches.sh [new file with mode: 0755]
ceph/src/pmdk/utils/get_aliases.sh [new file with mode: 0755]
ceph/src/pmdk/utils/git-years [new file with mode: 0755]
ceph/src/pmdk/utils/libpmem.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/libpmem2.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/libpmemblk.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/libpmemlog.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/libpmemobj.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/libpmempool.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/librpmem.pc.in [new file with mode: 0644]
ceph/src/pmdk/utils/magic-install.sh [new file with mode: 0644]
ceph/src/pmdk/utils/magic-uninstall.sh [new file with mode: 0644]
ceph/src/pmdk/utils/md2man.sh [new file with mode: 0755]
ceph/src/pmdk/utils/os-banned [new file with mode: 0644]
ceph/src/pmdk/utils/pkg-common.sh [new file with mode: 0644]
ceph/src/pmdk/utils/pkg-config.sh [new file with mode: 0644]
ceph/src/pmdk/utils/pmdk.magic [new file with mode: 0644]
ceph/src/pmdk/utils/pmdk.spec.in [new file with mode: 0644]
ceph/src/pmdk/utils/ps_analyze.ps1 [new file with mode: 0644]
ceph/src/pmdk/utils/sort_solution [new file with mode: 0755]
ceph/src/pmdk/utils/style_check.sh [new file with mode: 0755]
ceph/src/pmdk/utils/version.sh [new file with mode: 0755]
ceph/src/pybind/ceph_argparse.py
ceph/src/pybind/mgr/CMakeLists.txt
ceph/src/pybind/mgr/cephadm/inventory.py
ceph/src/pybind/mgr/cephadm/migrations.py
ceph/src/pybind/mgr/cephadm/module.py
ceph/src/pybind/mgr/cephadm/registry.py [new file with mode: 0644]
ceph/src/pybind/mgr/cephadm/schedule.py
ceph/src/pybind/mgr/cephadm/serve.py
ceph/src/pybind/mgr/cephadm/services/cephadmservice.py
ceph/src/pybind/mgr/cephadm/services/ingress.py
ceph/src/pybind/mgr/cephadm/services/iscsi.py
ceph/src/pybind/mgr/cephadm/services/monitoring.py
ceph/src/pybind/mgr/cephadm/services/nfs.py
ceph/src/pybind/mgr/cephadm/services/osd.py
ceph/src/pybind/mgr/cephadm/templates/services/alertmanager/alertmanager.yml.j2
ceph/src/pybind/mgr/cephadm/templates/services/grafana/ceph-dashboard.yml.j2
ceph/src/pybind/mgr/cephadm/templates/services/iscsi/iscsi-gateway.cfg.j2
ceph/src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2
ceph/src/pybind/mgr/cephadm/tests/fixtures.py
ceph/src/pybind/mgr/cephadm/tests/test_cephadm.py
ceph/src/pybind/mgr/cephadm/tests/test_facts.py [new file with mode: 0644]
ceph/src/pybind/mgr/cephadm/tests/test_migration.py
ceph/src/pybind/mgr/cephadm/tests/test_osd_removal.py
ceph/src/pybind/mgr/cephadm/tests/test_scheduling.py
ceph/src/pybind/mgr/cephadm/tests/test_services.py
ceph/src/pybind/mgr/cephadm/tests/test_spec.py
ceph/src/pybind/mgr/cephadm/upgrade.py
ceph/src/pybind/mgr/cephadm/utils.py
ceph/src/pybind/mgr/dashboard/CMakeLists.txt
ceph/src/pybind/mgr/dashboard/__init__.py
ceph/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh
ceph/src/pybind/mgr/dashboard/controllers/__init__.py
ceph/src/pybind/mgr/dashboard/controllers/_api_router.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_auth.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_base_controller.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_docs.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_endpoint.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_helpers.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_permissions.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_rest_controller.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_router.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_task.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_ui_router.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/_version.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/auth.py
ceph/src/pybind/mgr/dashboard/controllers/cephfs.py
ceph/src/pybind/mgr/dashboard/controllers/cluster.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/cluster_configuration.py
ceph/src/pybind/mgr/dashboard/controllers/crush_rule.py
ceph/src/pybind/mgr/dashboard/controllers/docs.py
ceph/src/pybind/mgr/dashboard/controllers/erasure_code_profile.py
ceph/src/pybind/mgr/dashboard/controllers/frontend_logging.py
ceph/src/pybind/mgr/dashboard/controllers/grafana.py
ceph/src/pybind/mgr/dashboard/controllers/health.py
ceph/src/pybind/mgr/dashboard/controllers/home.py
ceph/src/pybind/mgr/dashboard/controllers/host.py
ceph/src/pybind/mgr/dashboard/controllers/iscsi.py
ceph/src/pybind/mgr/dashboard/controllers/logs.py
ceph/src/pybind/mgr/dashboard/controllers/mgr_modules.py
ceph/src/pybind/mgr/dashboard/controllers/monitor.py
ceph/src/pybind/mgr/dashboard/controllers/nfs.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/controllers/nfsganesha.py [deleted file]
ceph/src/pybind/mgr/dashboard/controllers/orchestrator.py
ceph/src/pybind/mgr/dashboard/controllers/osd.py
ceph/src/pybind/mgr/dashboard/controllers/perf_counters.py
ceph/src/pybind/mgr/dashboard/controllers/pool.py
ceph/src/pybind/mgr/dashboard/controllers/prometheus.py
ceph/src/pybind/mgr/dashboard/controllers/rbd.py
ceph/src/pybind/mgr/dashboard/controllers/rbd_mirroring.py
ceph/src/pybind/mgr/dashboard/controllers/rgw.py
ceph/src/pybind/mgr/dashboard/controllers/role.py
ceph/src/pybind/mgr/dashboard/controllers/saml2.py
ceph/src/pybind/mgr/dashboard/controllers/service.py
ceph/src/pybind/mgr/dashboard/controllers/settings.py
ceph/src/pybind/mgr/dashboard/controllers/summary.py
ceph/src/pybind/mgr/dashboard/controllers/task.py
ceph/src/pybind/mgr/dashboard/controllers/telemetry.py
ceph/src/pybind/mgr/dashboard/controllers/user.py
ceph/src/pybind/mgr/dashboard/frontend/angular.json
ceph/src/pybind/mgr/dashboard/frontend/applitools.config.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/block/mirroring.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/configuration.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/create-cluster.po.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/hosts.po.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/logs.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/services.po.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts-force-maintenance.e2e-spec.ts [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/02-hosts-inventory.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/03-inventory.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/05-services.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-create-cluster-welcome-page.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-hosts.e2e-spec.ts [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/nfs/nfs-export.po.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/page-helper.po.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/pools/pools.e2e-spec.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/pools/pools.po.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/users.po.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/dashboard.vrt-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/login.vrt-spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/plugins/index.js
ceph/src/pybind/mgr/dashboard/frontend/cypress/support/commands.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/support/eyes-index.d.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/cypress/support/index.ts
ceph/src/pybind/mgr/dashboard/frontend/cypress/tsconfig.json
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.6da7b376fa1a8a3df154.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.e0a29c1d4fcf893cf11d.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/3rdpartylicenses.txt
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.0a363eda73eafe0c0332.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.f6931a7617fe7f8fd244.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.115992dc55f8e1abedbc.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.e0fafffe422f8212d682.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/index.html
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.b78c1bf5c30e15315e18.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.d269a7c492a93e2ebedb.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.69188bf73a1e0d939338.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.b66d1515aae6fe3887b1.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fc090c2eb8af922526a6.js [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fcd694c3eff5ef104b53.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/scripts.6bda3fa7e09a87cd4228.js
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.0520b6222fe6dab25bab.css [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.7918cb8dc788b3eedc95.css [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui-bundle.js [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui.css [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/package-lock.json
ceph/src/pybind/mgr/dashboard/frontend/package.json
ceph/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-setting/iscsi-setting.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.scss [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.scss [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-indiv-modal/osd-flags-indiv-modal.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/rules-list/rules-list.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.scss
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/services.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/models/nfs.fsal.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-cluster-type.enum.ts [deleted file]
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.scss
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/models/rgw-daemon.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nfs.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-daemon.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-site.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/cd-helper.class.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/components.module.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/modal/modal.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/modal/modal.component.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/modal/modal.component.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.html
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.html [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.scss [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/app.constants.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-builder.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/inventory-device-type.model.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/orchestrator.enum.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/service.interface.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/wizard-steps.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.spec.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.spec.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.ts [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/frontend/src/styles/ceph-custom/_forms.scss
ceph/src/pybind/mgr/dashboard/module.py
ceph/src/pybind/mgr/dashboard/openapi.yaml
ceph/src/pybind/mgr/dashboard/plugins/feature_toggles.py
ceph/src/pybind/mgr/dashboard/plugins/motd.py
ceph/src/pybind/mgr/dashboard/requirements-lint.txt
ceph/src/pybind/mgr/dashboard/requirements-test.txt
ceph/src/pybind/mgr/dashboard/run-backend-api-tests.sh
ceph/src/pybind/mgr/dashboard/services/ceph_service.py
ceph/src/pybind/mgr/dashboard/services/cephx.py [deleted file]
ceph/src/pybind/mgr/dashboard/services/cluster.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/services/ganesha.py [deleted file]
ceph/src/pybind/mgr/dashboard/services/orchestrator.py
ceph/src/pybind/mgr/dashboard/services/rgw_client.py
ceph/src/pybind/mgr/dashboard/tests/__init__.py
ceph/src/pybind/mgr/dashboard/tests/test_access_control.py
ceph/src/pybind/mgr/dashboard/tests/test_api_auditing.py
ceph/src/pybind/mgr/dashboard/tests/test_auth.py
ceph/src/pybind/mgr/dashboard/tests/test_ceph_service.py
ceph/src/pybind/mgr/dashboard/tests/test_cephfs.py
ceph/src/pybind/mgr/dashboard/tests/test_controllers.py
ceph/src/pybind/mgr/dashboard/tests/test_docs.py
ceph/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
ceph/src/pybind/mgr/dashboard/tests/test_exceptions.py
ceph/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
ceph/src/pybind/mgr/dashboard/tests/test_ganesha.py [deleted file]
ceph/src/pybind/mgr/dashboard/tests/test_grafana.py
ceph/src/pybind/mgr/dashboard/tests/test_home.py
ceph/src/pybind/mgr/dashboard/tests/test_host.py
ceph/src/pybind/mgr/dashboard/tests/test_iscsi.py
ceph/src/pybind/mgr/dashboard/tests/test_nfs.py [new file with mode: 0644]
ceph/src/pybind/mgr/dashboard/tests/test_orchestrator.py
ceph/src/pybind/mgr/dashboard/tests/test_osd.py
ceph/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
ceph/src/pybind/mgr/dashboard/tests/test_pool.py
ceph/src/pybind/mgr/dashboard/tests/test_prometheus.py
ceph/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
ceph/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
ceph/src/pybind/mgr/dashboard/tests/test_rgw.py
ceph/src/pybind/mgr/dashboard/tests/test_rgw_client.py
ceph/src/pybind/mgr/dashboard/tests/test_settings.py
ceph/src/pybind/mgr/dashboard/tests/test_sso.py
ceph/src/pybind/mgr/dashboard/tests/test_tools.py
ceph/src/pybind/mgr/dashboard/tests/test_versioning.py
ceph/src/pybind/mgr/dashboard/tools.py
ceph/src/pybind/mgr/influx/module.py
ceph/src/pybind/mgr/k8sevents/module.py
ceph/src/pybind/mgr/mgr_module.py
ceph/src/pybind/mgr/mirroring/fs/dir_map/policy.py
ceph/src/pybind/mgr/mirroring/fs/snapshot_mirror.py
ceph/src/pybind/mgr/mirroring/module.py
ceph/src/pybind/mgr/nfs/__init__.py
ceph/src/pybind/mgr/nfs/cluster.py
ceph/src/pybind/mgr/nfs/exception.py
ceph/src/pybind/mgr/nfs/export.py
ceph/src/pybind/mgr/nfs/export_utils.py
ceph/src/pybind/mgr/nfs/module.py
ceph/src/pybind/mgr/nfs/tests/__init__.py [new file with mode: 0644]
ceph/src/pybind/mgr/nfs/tests/test_nfs.py [new file with mode: 0644]
ceph/src/pybind/mgr/nfs/utils.py
ceph/src/pybind/mgr/orchestrator/_interface.py
ceph/src/pybind/mgr/orchestrator/module.py
ceph/src/pybind/mgr/orchestrator/tests/test_orchestrator.py
ceph/src/pybind/mgr/pg_autoscaler/module.py
ceph/src/pybind/mgr/progress/module.py
ceph/src/pybind/mgr/progress/test_progress.py
ceph/src/pybind/mgr/prometheus/module.py
ceph/src/pybind/mgr/rook/module.py
ceph/src/pybind/mgr/rook/rook_cluster.py
ceph/src/pybind/mgr/selftest/module.py
ceph/src/pybind/mgr/snap_schedule/fs/schedule_client.py
ceph/src/pybind/mgr/snap_schedule/tests/fs/test_schedule_client.py
ceph/src/pybind/mgr/stats/fs/perf_stats.py
ceph/src/pybind/mgr/test_orchestrator/dummy_data.json
ceph/src/pybind/mgr/test_orchestrator/module.py
ceph/src/pybind/mgr/tests/__init__.py
ceph/src/pybind/mgr/tox.ini
ceph/src/pybind/mgr/volumes/fs/fs_util.py
ceph/src/pybind/mgr/volumes/fs/operations/group.py
ceph/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py
ceph/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py
ceph/src/pybind/mgr/volumes/fs/vol_spec.py
ceph/src/python-common/ceph/deployment/service_spec.py
ceph/src/python-common/ceph/tests/test_service_spec.py
ceph/src/python-common/ceph/utils.py
ceph/src/rgw/librgw.cc
ceph/src/rgw/rgw_bucket.cc
ceph/src/rgw/rgw_common.cc
ceph/src/rgw/rgw_dencoder.cc
ceph/src/rgw/rgw_lib.h
ceph/src/rgw/rgw_log.cc
ceph/src/rgw/rgw_log.h
ceph/src/rgw/rgw_lua_request.cc
ceph/src/rgw/rgw_lua_request.h
ceph/src/rgw/rgw_main.cc
ceph/src/rgw/rgw_multi.cc
ceph/src/rgw/rgw_multi.h
ceph/src/rgw/rgw_notify.cc
ceph/src/rgw/rgw_notify_event_type.cc
ceph/src/rgw/rgw_notify_event_type.h
ceph/src/rgw/rgw_op.cc
ceph/src/rgw/rgw_process.cc
ceph/src/rgw/rgw_process.h
ceph/src/rgw/rgw_pubsub.cc
ceph/src/rgw/rgw_pubsub.h
ceph/src/rgw/rgw_rados.h
ceph/src/rgw/rgw_rest_bucket.cc
ceph/src/rgw/rgw_rest_s3.cc
ceph/src/rgw/rgw_sal.h
ceph/src/rgw/rgw_sal_rados.cc
ceph/src/rgw/rgw_sal_rados.h
ceph/src/rgw/rgw_sts.cc
ceph/src/rgw/rgw_sync_module_pubsub.cc
ceph/src/rgw/rgw_user.cc
ceph/src/script/ceph-release-notes
ceph/src/script/run_tox.sh
ceph/src/test/cls_rbd/test_cls_rbd.cc
ceph/src/test/common/CMakeLists.txt
ceph/src/test/common/test_fair_mutex.cc [new file with mode: 0644]
ceph/src/test/fio/fio_librgw.cc
ceph/src/test/libcephfs/test.cc
ceph/src/test/librados/tier_cxx.cc
ceph/src/test/librbd/image/test_mock_ValidatePoolRequest.cc
ceph/src/test/librbd/object_map/test_mock_DiffRequest.cc
ceph/src/test/librbd/test_librbd.cc
ceph/src/test/objectstore/store_test.cc
ceph/src/test/objectstore/test_bluestore_types.cc
ceph/src/test/osd/TestOSDMap.cc
ceph/src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
ceph/src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc
ceph/src/test/rbd_mirror/test_ImageReplayer.cc
ceph/src/test/rbd_mirror/test_mock_ImageReplayer.cc
ceph/src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc
ceph/src/test/rgw/rgw_multi/tests_ps.py
ceph/src/test/rgw/rgw_multi/zone_ps.py
ceph/src/test/run-cli-tests
ceph/src/tools/CMakeLists.txt
ceph/src/tools/ceph_monstore_tool.cc
ceph/src/tools/cephfs/top/cephfs-top
ceph/src/tools/cephfs_mirror/ClusterWatcher.cc
ceph/src/tools/cephfs_mirror/ClusterWatcher.h
ceph/src/tools/cephfs_mirror/Mirror.cc
ceph/src/tools/cephfs_mirror/ServiceDaemon.h
ceph/src/tools/immutable_object_cache/ObjectCacheStore.cc
ceph/src/tools/immutable_object_cache/ObjectCacheStore.h
ceph/src/tools/rbd_mirror/ImageDeleter.h
ceph/src/tools/rbd_mirror/ImageMap.cc
ceph/src/tools/rbd_mirror/ImageReplayer.cc
ceph/src/tools/rbd_mirror/ImageReplayer.h
ceph/src/tools/rbd_mirror/MirrorStatusUpdater.cc
ceph/src/tools/rbd_mirror/MirrorStatusUpdater.h
ceph/src/tools/rbd_mirror/RemotePoolPoller.cc
ceph/src/tools/rbd_mirror/Threads.h
ceph/src/tools/rbd_mirror/Types.cc
ceph/src/tools/rbd_mirror/image_deleter/TrashMoveRequest.cc
ceph/src/tools/rbd_mirror/image_map/LoadRequest.cc
ceph/src/tools/rbd_mirror/image_map/LoadRequest.h
ceph/src/tools/rbd_mirror/image_map/Policy.cc
ceph/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
ceph/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h
ceph/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.cc
ceph/src/tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.h
ceph/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc
ceph/src/tools/rbd_mirror/image_replayer/StateBuilder.h
ceph/src/tools/setup-virtualenv.sh
ceph/src/tracing/CMakeLists.txt
ceph/src/vstart.sh
ceph/sudoers.d/ceph-osd-smartctl [deleted file]
ceph/sudoers.d/ceph-smartctl [new file with mode: 0644]

index 5719e113f1564df8bf438c088ae0a4e8cf7759a6..a9c6a1179da7c8024be5cdfd8af14bfc306ea55e 100644 (file)
@@ -225,3 +225,28 @@ tests:
   - qa/tasks/**
   - qa/workunits/**
   - src/test/**
+
+nfs:
+  - src/pybind/mgr/nfs/**
+  - src/pybind/mgr/cephadm/services/nfs.py
+  - src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2
+  - src/pybind/mgr/dashboard/services/ganesha.py
+  - src/pybind/mgr/dashboard/tests/test_ganesha.py
+  - qa/tasks/cephfs/test_nfs.py
+  - qa/tasks/mgr/dashboard/test_ganesha.py
+  - doc/mgr/nfs.rst
+  - doc/cephfs/nfs.rst
+  - doc/cephadm/nfs.rst
+  - doc/radosgw/nfs.rst
+  - doc/dev/vstart-ganesha.rst
+
+monitoring:
+  - doc/cephadm/monitoring.rst
+  - src/pybind/mgr/cephadm/services/monitoring.py
+  - src/pybind/mgr/cephadm/templates/services/alertmanager/**
+  - src/pybind/mgr/cephadm/templates/services/grafana/**
+  - src/pybind/mgr/cephadm/templates/services/prometheus/**
+  - src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py
+  - src/pybind/mgr/prometheus/**
+  - monitoring/**  
+  
index 31791d4aef5755edbe83986d41c5b31d21a87f56..77fcff462e382caf4a9ee79b349195a7eb79cdfa 100644 (file)
@@ -1,15 +1,24 @@
 ---
 name: "Pull Request Triage"
 on: pull_request_target
+env:
+  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 jobs:
   pr-triage:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/labeler@9794b1493b6f1fa7b006c5f8635a19c76c98be95
+      - name: Assign labels based on modified files
+        uses: actions/labeler@9794b1493b6f1fa7b006c5f8635a19c76c98be95
         with:
           sync-labels: ''
           repo-token: "${{ secrets.GITHUB_TOKEN }}"
-      - uses: iyu/actions-milestone@dbf7e5348844c9ddc6b803a5721b85fa70fe3bb9
+      - name: Assign milestone based on target brach name
+        uses: iyu/actions-milestone@dbf7e5348844c9ddc6b803a5721b85fa70fe3bb9
         with:
           configuration-path: .github/milestone.yml
           repo-token: "${{ secrets.GITHUB_TOKEN }}"
+      - name: Assign to Dashboard project
+        uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1
+        if: contains(github.event.pull_request.labels.*.name, 'dashboard')
+        with:
+          project: https://github.com/ceph/ceph/projects/6
index f7056c209eb643213ffb226983213cdb0959ac69..5253399df5c584c0044f041930a5679243dce175 100644 (file)
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.2)
 # remove cmake/modules/FindPython* once 3.12 is required
 
 project(ceph
-  VERSION 16.2.6
+  VERSION 16.2.7
   LANGUAGES CXX C ASM)
 
 foreach(policy
index f5ac346a449fc874803320dab424b6da41277866..12b47c132c4391b2d3016401f0e0c4c560622fa9 100644 (file)
@@ -20,6 +20,9 @@
 * MDS upgrades no longer require stopping all standby MDS daemons before
   upgrading the sole active MDS for a file system.
 
+* CephFS: Failure to replay the journal by a standby-replay daemon will now
+  cause the rank to be marked damaged.
+
 * RGW: It is possible to specify ssl options and ciphers for beast frontend now.
   The default ssl options setting is "no_sslv2:no_sslv3:no_tlsv1:no_tlsv1_1".
   If you want to return back the old behavior add 'ssl_options=' (empty) to
   in certain recovery scenarios, e.g., monitor database lost and rebuilt, and
   the restored file system is expected to have the same ID as before.
 
+>=16.2.7
+--------
+
+* Critical bug in OMAP format upgrade is fixed. This could cause data corruption
+  (improperly formatted OMAP keys) after pre-Pacific cluster upgrade if
+  bluestore-quick-fix-on-mount parameter is set to true or ceph-bluestore-tool's
+  quick-fix/repair commands are invoked.
+  Relevant tracker: https://tracker.ceph.com/issues/53062
+
+* MGR: The pg_autoscaler will use the 'scale-up' profile as the default profile.
+  16.2.6 changed the default profile to 'scale-down' but we ran into issues
+  with the device_health_metrics pool consuming too many PGs, which is not ideal
+  for performance. So we will continue to use the 'scale-up' profile by default,
+  until we implement a limit on the number of PGs default pools should consume,
+  in combination with the 'scale-down' profile.
+
 >=16.2.6
 --------
 
@@ -42,6 +61,9 @@
 >=16.0.0
 --------
 
+* RGW: S3 bucket notification events now contain an `eTag` key instead of `etag`,
+  and eventName values no longer carry the `s3:` prefix, fixing deviations from
+  the message format observed on AWS.
 * `ceph-mgr-modules-core` debian package does not recommend `ceph-mgr-rook`
   anymore. As the latter depends on `python3-numpy` which cannot be imported in
   different Python sub-interpreters multi-times if the version of
   deprecated and will be removed in a future release.  Please use
   ``nfs cluster rm`` and ``nfs export rm`` instead.
 
+* The ``nfs export create`` CLI arguments have changed, with the
+  *fsname* or *bucket-name* argument position moving to the right of
+  *the *cluster-id* and *pseudo-path*.  Consider transitioning to
+  *using named arguments instead of positional arguments (e.g., ``ceph
+  *nfs export create cephfs --cluster-id mycluster --pseudo-path /foo
+  *--fsname myfs`` instead of ``ceph nfs export create cephfs
+  *mycluster /foo myfs`` to ensure correct behavior with any
+  *version.
+
+* mgr-pg_autoscaler: Autoscaler will now start out by scaling each
+  pool to have a full complements of pgs from the start and will only
+  decrease it when other pools need more pgs due to increased usage.
+  This improves out of the box performance of Ceph by allowing more PGs 
+  to be created for a given pool.
+
 * CephFS: Disabling allow_standby_replay on a file system will also stop all
   standby-replay daemons for that file system.
 
   zone are provided, the user is now responsible for setting up the
   multisite configuration beforehand--cephadm no longer attempts to
   create missing realms or zones.
+
+* The cephadm NFS support has been simplified to no longer allow the
+  pool and namespace where configuration is stored to be customized.
+  As a result, the ``ceph orch apply nfs`` command no longer has
+  ``--pool`` or ``--namespace`` arguments.
+
+  Existing cephadm NFS deployments (from earlier version of Pacific or
+  from Octopus) will be automatically migrated when the cluster is
+  upgraded.  Note that the NFS ganesha daemons will be redeployed and
+  it is possible that their IPs will change.
index bb2a46282c8b31c628a3a1dd71f7b270e8b99adf..345324a140971e19c9b1f511828ecabad48301f0 100755 (executable)
@@ -20,7 +20,7 @@ if command -v dpkg >/dev/null; then
         exit 1
     fi
 elif command -v yum >/dev/null; then
-    for package in ant ditaa doxygen libxslt-devel libxml2-devel graphviz python3-devel python3-pip python3-virtualenv python3-Cython; do
+    for package in ant ditaa doxygen libxslt-devel libxml2-devel graphviz python3-devel python3-pip python3-Cython; do
        if ! rpm -q --whatprovides $package >/dev/null ; then
                missing="${missing:+$missing }$package"
        fi
@@ -31,7 +31,7 @@ elif command -v yum >/dev/null; then
         exit 1
     fi
 else
-    for command in dot virtualenv doxygen ant ditaa cython; do
+    for command in dot doxygen ant ditaa cython; do
         if ! command -v "$command" > /dev/null; then
             # add a space after old values
             missing="${missing:+$missing }$command"
@@ -51,9 +51,10 @@ set -e
 [ -z "$vdir" ] && vdir="$TOPDIR/build-doc/virtualenv"
 
 if [ ! -e $vdir ]; then
-    virtualenv --python=python3 $vdir
+    python3 -m venv $vdir
 fi
 
+$vdir/bin/pip install --quiet wheel
 $vdir/bin/pip install --quiet \
               -r $TOPDIR/admin/doc-requirements.txt \
               -r $TOPDIR/admin/doc-python-common-requirements.txt
index 3ad2f6edbfcce7a2d54b2edeb81b8a27b2e07ddc..4a9090436e4df46215e2701d5f7f3b8b7786d21a 100644 (file)
@@ -1,4 +1,4 @@
-Sphinx == 3.2.1
+Sphinx == 3.5.4
 git+https://github.com/ceph/sphinx-ditaa.git@py3#egg=sphinx-ditaa
 breathe >= 4.20.0
 Jinja2
index e456f9b13665743d454d56020069619c5974e10e..c4ac0356ddb671ad9ec5d9f682c63ece36e7d3ed 100644 (file)
 %else
 %bcond_without tcmalloc
 %endif
+%bcond_with system_pmdk
 %if 0%{?fedora} || 0%{?rhel}
 %bcond_without selinux
 %ifarch x86_64 ppc64le
 %bcond_without rbd_rwl_cache
 %bcond_without rbd_ssd_cache
-%global _system_pmdk 1
 %else
 %bcond_with rbd_rwl_cache
 %bcond_with rbd_ssd_cache
 %bcond_with libradosstriper
 %ifarch x86_64 aarch64 ppc64le
 %bcond_without lttng
-%global _system_pmdk 1
 %bcond_without rbd_rwl_cache
 %bcond_without rbd_ssd_cache
 %else
 %bcond_with lttng
-%global _system_pmdk 0
 %bcond_with rbd_rwl_cache
 %bcond_with rbd_ssd_cache
 %endif
 # main package definition
 #################################################################################
 Name:          ceph
-Version:       16.2.6
+Version:       16.2.7
 Release:       0%{?dist}
 %if 0%{?fedora} || 0%{?rhel}
 Epoch:         2
@@ -142,7 +140,7 @@ License:    LGPL-2.1 and LGPL-3.0 and CC-BY-SA-3.0 and GPL-2.0 and BSL-1.0 and BSD-
 Group:         System/Filesystems
 %endif
 URL:           http://ceph.com/
-Source0:       %{?_remote_tarball_prefix}ceph-16.2.6.tar.bz2
+Source0:       %{?_remote_tarball_prefix}ceph-16.2.7.tar.bz2
 %if 0%{?suse_version}
 # _insert_obs_source_lines_here
 ExclusiveArch:  x86_64 aarch64 ppc64le s390x
@@ -235,7 +233,6 @@ BuildRequires:      python%{python3_pkgversion}-nose
 BuildRequires: python%{python3_pkgversion}-pecan
 BuildRequires: python%{python3_pkgversion}-requests
 BuildRequires: python%{python3_pkgversion}-dateutil
-BuildRequires: python%{python3_pkgversion}-virtualenv
 BuildRequires: python%{python3_pkgversion}-coverage
 BuildRequires: python%{python3_pkgversion}-pyOpenSSL
 BuildRequires: socat
@@ -255,7 +252,7 @@ BuildRequires:  nlohmann_json-devel
 BuildRequires:  libevent-devel
 BuildRequires:  yaml-cpp-devel
 %endif
-%if 0%{?_system_pmdk}
+%if 0%{with system_pmdk}
 BuildRequires:  libpmem-devel
 BuildRequires:  libpmemobj-devel
 %endif
@@ -439,6 +436,12 @@ Requires:      gperftools-libs >= 2.6.1
 %endif
 %if 0%{?weak_deps}
 Recommends:    chrony
+Recommends:    nvme-cli
+%if 0%{?suse_version}
+Requires:      smartmontools
+%else
+Recommends:    smartmontools
+%endif
 %endif
 %description base
 Base is the package that includes all the files shared amongst ceph servers
@@ -507,14 +510,6 @@ Group:             System/Filesystems
 %endif
 Provides:      ceph-test:/usr/bin/ceph-monstore-tool
 Requires:      ceph-base = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
 %if 0%{with jaeger}
 Requires:      libjaeger = %{_epoch_prefix}%{version}-%{release}
 %endif
@@ -785,14 +780,6 @@ Requires:  lvm2
 Requires:      sudo
 Requires:      libstoragemgmt
 Requires:      python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
 %description osd
 ceph-osd is the object storage daemon for the Ceph distributed file
 system.  It is responsible for storing objects on a local file system
@@ -1208,7 +1195,7 @@ This package provides Ceph default alerts for Prometheus.
 # common
 #################################################################################
 %prep
-%autosetup -p1 -n ceph-16.2.6
+%autosetup -p1 -n ceph-16.2.7
 
 %build
 # LTO can be enabled as soon as the following GCC bug is fixed:
@@ -1334,7 +1321,7 @@ ${CMAKE} .. \
 %if 0%{with rbd_ssd_cache}
     -DWITH_RBD_SSD_CACHE=ON \
 %endif
-%if 0%{?_system_pmdk}
+%if 0%{with system_pmdk}
     -DWITH_SYSTEM_PMDK:BOOL=ON \
 %endif
     -DBOOST_J=$CEPH_SMP_NCPUS \
@@ -1405,7 +1392,7 @@ ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
 install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
 
 # sudoers.d
-install -m 0440 -D sudoers.d/ceph-osd-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
+install -m 0440 -D sudoers.d/ceph-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %if 0%{?rhel} >= 8
 pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{_bindir}/*
@@ -1506,6 +1493,7 @@ rm -rf %{buildroot}
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd-mirror
+%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %post base
 /sbin/ldconfig
@@ -2087,7 +2075,6 @@ fi
 %{_unitdir}/ceph-volume@.service
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
-%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
 
 %post osd
 %if 0%{?suse_version}
@@ -2388,13 +2375,21 @@ if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
    exit 0
 fi
 
+# Stop ceph.target while relabeling if CEPH_AUTO_RESTART_ON_UPGRADE=yes
+SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
+if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
+    source $SYSCONF_CEPH
+fi
+
 # Check whether the daemons are running
 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
 STATUS=$?
 
 # Stop the daemons if they were running
 if test $STATUS -eq 0; then
-    /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+    if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+        /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+    fi
 fi
 
 # Relabel the files fix for first package install
@@ -2406,7 +2401,9 @@ rm -f ${FILE_CONTEXT}.pre
 
 # Start the daemons iff they were running before
 if test $STATUS -eq 0; then
-    /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+    if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+        /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+    fi
 fi
 exit 0
 
@@ -2426,13 +2423,21 @@ if [ $1 -eq 0 ]; then
         exit 0
     fi
 
+    # Stop ceph.target while relabeling if CEPH_AUTO_RESTART_ON_UPGRADE=yes
+    SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
+    if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
+        source $SYSCONF_CEPH
+    fi
+
     # Check whether the daemons are running
     /usr/bin/systemctl status ceph.target > /dev/null 2>&1
     STATUS=$?
 
     # Stop the daemons if they were running
     if test $STATUS -eq 0; then
-        /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+        if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+            /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+        fi
     fi
 
     /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
@@ -2442,7 +2447,9 @@ if [ $1 -eq 0 ]; then
 
     # Start the daemons if they were running before
     if test $STATUS -eq 0; then
-       /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+        if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+           /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+        fi
     fi
 fi
 exit 0
index 14fdadaed72ca68ad9b2dee4c95e40434d21b344..ebc2893cbd62743b8503ad4f16cada042a194754 100644 (file)
 %else
 %bcond_without tcmalloc
 %endif
+%bcond_with system_pmdk
 %if 0%{?fedora} || 0%{?rhel}
 %bcond_without selinux
 %ifarch x86_64 ppc64le
 %bcond_without rbd_rwl_cache
 %bcond_without rbd_ssd_cache
-%global _system_pmdk 1
 %else
 %bcond_with rbd_rwl_cache
 %bcond_with rbd_ssd_cache
 %bcond_with libradosstriper
 %ifarch x86_64 aarch64 ppc64le
 %bcond_without lttng
-%global _system_pmdk 1
 %bcond_without rbd_rwl_cache
 %bcond_without rbd_ssd_cache
 %else
 %bcond_with lttng
-%global _system_pmdk 0
 %bcond_with rbd_rwl_cache
 %bcond_with rbd_ssd_cache
 %endif
@@ -235,7 +233,6 @@ BuildRequires:      python%{python3_pkgversion}-nose
 BuildRequires: python%{python3_pkgversion}-pecan
 BuildRequires: python%{python3_pkgversion}-requests
 BuildRequires: python%{python3_pkgversion}-dateutil
-BuildRequires: python%{python3_pkgversion}-virtualenv
 BuildRequires: python%{python3_pkgversion}-coverage
 BuildRequires: python%{python3_pkgversion}-pyOpenSSL
 BuildRequires: socat
@@ -255,7 +252,7 @@ BuildRequires:  nlohmann_json-devel
 BuildRequires:  libevent-devel
 BuildRequires:  yaml-cpp-devel
 %endif
-%if 0%{?_system_pmdk}
+%if 0%{with system_pmdk}
 BuildRequires:  libpmem-devel
 BuildRequires:  libpmemobj-devel
 %endif
@@ -439,6 +436,12 @@ Requires:      gperftools-libs >= 2.6.1
 %endif
 %if 0%{?weak_deps}
 Recommends:    chrony
+Recommends:    nvme-cli
+%if 0%{?suse_version}
+Requires:      smartmontools
+%else
+Recommends:    smartmontools
+%endif
 %endif
 %description base
 Base is the package that includes all the files shared amongst ceph servers
@@ -507,14 +510,6 @@ Group:             System/Filesystems
 %endif
 Provides:      ceph-test:/usr/bin/ceph-monstore-tool
 Requires:      ceph-base = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
 %if 0%{with jaeger}
 Requires:      libjaeger = %{_epoch_prefix}%{version}-%{release}
 %endif
@@ -785,14 +780,6 @@ Requires:  lvm2
 Requires:      sudo
 Requires:      libstoragemgmt
 Requires:      python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
 %description osd
 ceph-osd is the object storage daemon for the Ceph distributed file
 system.  It is responsible for storing objects on a local file system
@@ -1334,7 +1321,7 @@ ${CMAKE} .. \
 %if 0%{with rbd_ssd_cache}
     -DWITH_RBD_SSD_CACHE=ON \
 %endif
-%if 0%{?_system_pmdk}
+%if 0%{with system_pmdk}
     -DWITH_SYSTEM_PMDK:BOOL=ON \
 %endif
     -DBOOST_J=$CEPH_SMP_NCPUS \
@@ -1405,7 +1392,7 @@ ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
 install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
 
 # sudoers.d
-install -m 0440 -D sudoers.d/ceph-osd-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
+install -m 0440 -D sudoers.d/ceph-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %if 0%{?rhel} >= 8
 pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{_bindir}/*
@@ -1506,6 +1493,7 @@ rm -rf %{buildroot}
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd-mirror
+%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %post base
 /sbin/ldconfig
@@ -2087,7 +2075,6 @@ fi
 %{_unitdir}/ceph-volume@.service
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
-%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
 
 %post osd
 %if 0%{?suse_version}
@@ -2388,13 +2375,21 @@ if diff ${FILE_CONTEXT} ${FILE_CONTEXT}.pre > /dev/null 2>&1; then
    exit 0
 fi
 
+# Stop ceph.target while relabeling if CEPH_AUTO_RESTART_ON_UPGRADE=yes
+SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
+if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
+    source $SYSCONF_CEPH
+fi
+
 # Check whether the daemons are running
 /usr/bin/systemctl status ceph.target > /dev/null 2>&1
 STATUS=$?
 
 # Stop the daemons if they were running
 if test $STATUS -eq 0; then
-    /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+    if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+        /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+    fi
 fi
 
 # Relabel the files fix for first package install
@@ -2406,7 +2401,9 @@ rm -f ${FILE_CONTEXT}.pre
 
 # Start the daemons iff they were running before
 if test $STATUS -eq 0; then
-    /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+    if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+        /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+    fi
 fi
 exit 0
 
@@ -2426,13 +2423,21 @@ if [ $1 -eq 0 ]; then
         exit 0
     fi
 
+    # Stop ceph.target while relabeling if CEPH_AUTO_RESTART_ON_UPGRADE=yes
+    SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
+    if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
+        source $SYSCONF_CEPH
+    fi
+
     # Check whether the daemons are running
     /usr/bin/systemctl status ceph.target > /dev/null 2>&1
     STATUS=$?
 
     # Stop the daemons if they were running
     if test $STATUS -eq 0; then
-        /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+        if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+            /usr/bin/systemctl stop ceph.target > /dev/null 2>&1
+        fi
     fi
 
     /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
@@ -2442,7 +2447,9 @@ if [ $1 -eq 0 ]; then
 
     # Start the daemons if they were running before
     if test $STATUS -eq 0; then
-       /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+        if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
+           /usr/bin/systemctl start ceph.target > /dev/null 2>&1 || :
+        fi
     fi
 fi
 exit 0
index 51595d76d57518eb982d4c2dca8ef294ae6d5c99..e886fd13e70f3dc858dc5231af4fcda3664a27fe 100644 (file)
@@ -1,3 +1,9 @@
+ceph (16.2.7-1) stable; urgency=medium
+
+  * New upstream release
+
+ -- Ceph Release Team <ceph-maintainers@ceph.com>  Tue, 07 Dec 2021 16:15:46 +0000
+
 ceph (16.2.6-1) stable; urgency=medium
 
   * New upstream release
index 2439ac0fd2d3f90121caedbf0af73f68f6e0e018..ead5c80ae90f56062ec5743ad64d88c3b80085a1 100644 (file)
@@ -1,7 +1,18 @@
 function(build_pmem)
-  include(ExternalProject)
-  set(PMDK_SRC "${CMAKE_BINARY_DIR}/src/pmdk/src")
-  set(PMDK_INCLUDE "${PMDK_SRC}/include")
+  include(FindMake)
+  find_make("MAKE_EXECUTABLE" "make_cmd")
+
+  if(EXISTS "${PROJECT_SOURCE_DIR}/src/pmdk/Makefile")
+    set(source_dir_args
+      SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/pmdk")
+  else()
+    set(source_dir_args
+      SOURCE_DIR ${CMAKE_BINARY_DIR}/src/pmdk
+      GIT_REPOSITORY https://github.com/ceph/pmdk.git
+      GIT_TAG "1.10"
+      GIT_SHALLOW TRUE
+      GIT_CONFIG advice.detachedHead=false)
+  endif()
 
   # Use debug PMDK libs in debug lib/rbd builds
   if(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -9,37 +20,38 @@ function(build_pmem)
   else()
     set(PMDK_LIB_DIR "nondebug")
   endif()
-  set(PMDK_LIB "${PMDK_SRC}/${PMDK_LIB_DIR}")
-
-  include(FindMake)
-  find_make("MAKE_EXECUTABLE" "make_cmd")
 
+  include(ExternalProject)
   ExternalProject_Add(pmdk_ext
-      GIT_REPOSITORY "https://github.com/ceph/pmdk.git"
-      GIT_TAG "1.7"
-      GIT_SHALLOW TRUE
-      SOURCE_DIR ${CMAKE_BINARY_DIR}/src/pmdk
+      ${source_dir_args}
       CONFIGURE_COMMAND ""
       # Explicitly built w/o NDCTL, otherwise if ndtcl is present on the
       # build system tests statically linking to librbd (which uses
       # libpmemobj) will not link (because we don't build the ndctl
       # static library here).
-      BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} NDCTL_ENABLE=n
+      BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} NDCTL_ENABLE=n BUILD_EXAMPLES=n BUILD_BENCHMARKS=n DOC=n
       BUILD_IN_SOURCE 1
-      BUILD_BYPRODUCTS "${PMDK_LIB}/libpmem.a" "${PMDK_LIB}/libpmemobj.a"
-      INSTALL_COMMAND "true")
+      BUILD_BYPRODUCTS "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmem.a" "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmemobj.a"
+      INSTALL_COMMAND "")
+  unset(make_cmd)
+
+  ExternalProject_Get_Property(pmdk_ext source_dir)
+  set(PMDK_SRC "${source_dir}/src")
+  set(PMDK_INCLUDE "${source_dir}/src/include")
+  set(PMDK_LIB "${source_dir}/src/${PMDK_LIB_DIR}")
 
   # libpmem
-  add_library(pmem::pmem STATIC IMPORTED)
+  add_library(pmem::pmem STATIC IMPORTED GLOBAL)
   add_dependencies(pmem::pmem pmdk_ext)
   file(MAKE_DIRECTORY ${PMDK_INCLUDE})
+  find_package(Threads)
   set_target_properties(pmem::pmem PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES ${PMDK_INCLUDE}
     IMPORTED_LOCATION "${PMDK_LIB}/libpmem.a"
-    INTERFACE_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+    INTERFACE_LINK_LIBRARIES Threads::Threads)
 
   # libpmemobj
-  add_library(pmem::pmemobj STATIC IMPORTED)
+  add_library(pmem::pmemobj STATIC IMPORTED GLOBAL)
   add_dependencies(pmem::pmemobj pmdk_ext)
   set_target_properties(pmem::pmemobj PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES ${PMDK_INCLUDE}
index b30d9ae6bbbb15fb9e273ae1e1d7c519a3b31200..9c8e21b918877ca88e39a6fbe208bf6754ea09e7 100644 (file)
@@ -14,6 +14,16 @@ foreach(component pmem ${pmem_FIND_COMPONENTS})
   else()
     message(FATAL_ERROR "unknown libpmem component: ${component}")
   endif()
+  pkg_check_modules(PKG_${component} QUIET "lib${component}")
+  if(NOT pmem_VERSION_STRING OR PKG_${component}_VERSION VERSION_LESS pmem_VERSION_STRING)
+    set(pmem_VERSION_STRING ${PKG_${component}_VERSION})
+  endif()
+  find_path(pmem_${component}_INCLUDE_DIR
+    NAMES lib${component}.h
+    HINTS ${PKG_${component}_INCLUDE_DIRS})
+  find_library(pmem_${component}_LIBRARY
+    NAMES ${component}
+    HINTS ${PKG_${component}_LIBRARY_DIRS})
   mark_as_advanced(
     pmem_${component}_INCLUDE_DIR
     pmem_${component}_LIBRARY)
index 8ee22ebe5bf9a5dfe754ea26dd13a84c55368fde..3c31951269f44ab52c503b6d678d6588f26f3b62 100644 (file)
@@ -20,3 +20,4 @@ usr/share/man/man8/crushtool.8
 usr/share/man/man8/monmaptool.8
 usr/share/man/man8/osdmaptool.8
 usr/share/man/man8/ceph-kvstore-tool.8
+etc/sudoers.d/ceph-smartctl
index 3a72447a82c24c9f85b1a706965a2ec0c7a4ee92..0db4460da8ab7d7beaf52e40c32fdc850181133c 100755 (executable)
@@ -23,4 +23,3 @@ usr/share/man/man8/ceph-volume-systemd.8
 usr/share/man/man8/ceph-osd.8
 usr/share/man/man8/ceph-bluestore-tool.8
 etc/sysctl.d/30-ceph-osd.conf
-etc/sudoers.d/ceph-osd-smartctl
index 753c5266defd1da729a567dcbf2419e3c50bdc22..cb31919afa7cb5a715d5be4565b42d193df61fa7 100644 (file)
@@ -96,13 +96,13 @@ Build-Depends: automake,
                python3-sphinx,
 # Make-Check   python3-werkzeug,
                python3-setuptools,
+               python3-venv,
 # Crimson      ragel,
 # Make-Check   socat,
 # Crimson      systemtap-sdt-dev,
 # Make-Check   uuid-dev,
                uuid-runtime,
                valgrind,
-               virtualenv,
                xfslibs-dev,
 # Make-Check   xfsprogs,
 # Make-Check   xmlstarlet,
@@ -144,6 +144,8 @@ Recommends: btrfs-tools,
             libradosstriper1 (= ${binary:Version}),
             librbd1 (= ${binary:Version}),
             ntp | time-daemon,
+            nvme-cli,
+            smartmontools,
 Replaces: ceph (<< 10),
           ceph-common (<< 0.78-500),
           ceph-test (<< 12.2.2-14),
@@ -376,8 +378,6 @@ Depends: ceph-base (= ${binary:Version}),
          ${shlibs:Depends},
 Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14)
 Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14)
-Recommends: nvme-cli,
-            smartmontools,
 Description: monitor server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,
@@ -411,8 +411,6 @@ Depends: ceph-base (= ${binary:Version}),
          ${shlibs:Depends},
 Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14)
 Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14)
-Recommends: nvme-cli,
-            smartmontools,
 Description: OSD server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,
index c8c6f3e80f63dba74a5309aaedec6041f65d2590..1c215a76e5020057102dfd265293025211919ba7 100755 (executable)
@@ -56,7 +56,7 @@ override_dh_auto_install:
        install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
        install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap
        install -D -m 644 etc/sysctl/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf
-       install -D -m 440 sudoers.d/ceph-osd-smartctl $(DESTDIR)/etc/sudoers.d/ceph-osd-smartctl
+       install -D -m 440 sudoers.d/ceph-smartctl $(DESTDIR)/etc/sudoers.d/ceph-smartctl
        install -D -m 755 src/tools/rbd_nbd/rbd-nbd_quiesce $(DESTDIR)/usr/libexec/rbd-nbd/rbd-nbd_quiesce
 
        install -m 755 src/cephadm/cephadm $(DESTDIR)/usr/sbin/cephadm
index 5e43d4cb5f566ea711bda78bfeec951922a851c9..eef5a0101fdbfd832bd41a574152e4a9612a37db 100644 (file)
@@ -2,6 +2,7 @@
 
 ``activate``
 ============
+          
 Once :ref:`ceph-volume-lvm-prepare` is completed, and all the various steps
 that entails are done, the volume is ready to get "activated".
 
@@ -12,6 +13,9 @@ understand what OSD is enabled and needs to be mounted.
 .. note:: The execution of this call is fully idempotent, and there is no
           side-effects when running multiple times
 
+For OSDs deployed by cephadm, please refer to :ref:cephadm-osd-activate: 
+instead.
+
 New OSDs
 --------
 To activate newly prepared OSDs both the :term:`OSD id` and :term:`OSD uuid`
@@ -24,6 +28,10 @@ need to be supplied. For example::
 
 Activating all OSDs
 -------------------
+
+.. note:: For OSDs deployed by cephadm, please refer to :ref:cephadm-osd-activate: 
+          instead.
+
 It is possible to activate all existing OSDs at once by using the ``--all``
 flag. For example::
 
index db4fded39816aa8e1595ef59a7073c209cde33a0..e06422a716cc22928354f45bb043698e70e68b98 100644 (file)
@@ -118,6 +118,12 @@ Adoption process
      document for instructions that describe how to import existing
      ssh keys.
 
+   .. note::
+     It is also possible to have cephadm use a non-root user to ssh
+     into cluster hosts. This user needs to have passwordless sudo access.
+     Use ``ceph cephadm set-user <user>`` and copy the ssh key to that user.
+     See :ref:`cephadm-ssh-user`
+
 #. Tell cephadm which hosts to manage:
 
    .. prompt:: bash #
diff --git a/ceph/doc/cephadm/custom-container.rst b/ceph/doc/cephadm/custom-container.rst
deleted file mode 100644 (file)
index 542fcf1..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-========================
-Custom Container Service
-========================
-
-The orchestrator enables custom containers to be deployed using a YAML file.
-A corresponding :ref:`orchestrator-cli-service-spec` must look like:
-
-.. code-block:: yaml
-
-    service_type: container
-    service_id: foo
-    placement:
-        ...
-    image: docker.io/library/foo:latest
-    entrypoint: /usr/bin/foo
-    uid: 1000
-    gid: 1000
-    args:
-        - "--net=host"
-        - "--cpus=2"
-    ports:
-        - 8080
-        - 8443
-    envs:
-        - SECRET=mypassword
-        - PORT=8080
-        - PUID=1000
-        - PGID=1000
-    volume_mounts:
-        CONFIG_DIR: /etc/foo
-    bind_mounts:
-      - ['type=bind', 'source=lib/modules', 'destination=/lib/modules', 'ro=true']
-    dirs:
-      - CONFIG_DIR
-    files:
-      CONFIG_DIR/foo.conf:
-        - refresh=true
-        - username=xyz
-        - "port: 1234"
-
-where the properties of a service specification are:
-
-* ``service_id``
-    A unique name of the service.
-* ``image``
-    The name of the Docker image.
-* ``uid``
-    The UID to use when creating directories and files in the host system.
-* ``gid``
-    The GID to use when creating directories and files in the host system.
-* ``entrypoint``
-    Overwrite the default ENTRYPOINT of the image.
-* ``args``
-    A list of additional Podman/Docker command line arguments.
-* ``ports``
-    A list of TCP ports to open in the host firewall.
-* ``envs``
-    A list of environment variables.
-* ``bind_mounts``
-    When you use a bind mount, a file or directory on the host machine
-    is mounted into the container. Relative `source=...` paths will be
-    located below `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
-* ``volume_mounts``
-    When you use a volume mount, a new directory is created within
-    Docker’s storage directory on the host machine, and Docker manages
-    that directory’s contents. Relative source paths will be located below
-    `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
-* ``dirs``
-    A list of directories that are created below
-    `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
-* ``files``
-    A dictionary, where the key is the relative path of the file and the
-    value the file content. The content must be double quoted when using
-    a string. Use '\\n' for line breaks in that case. Otherwise define
-    multi-line content as list of strings. The given files will be created
-    below the directory `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
-    The absolute path of the directory where the file will be created must
-    exist. Use the `dirs` property to create them if necessary.
index 621f2a753b1ed90b99adebb5f6ceaaa450e4113b..c109e2dc73b322d49ca110c727ed9789a6ca2544 100644 (file)
@@ -169,13 +169,14 @@ Where the force flag when entering maintenance allows the user to bypass warning
 
 See also :ref:`cephadm-fqdn`
 
-Host Specification
-==================
+Creating many hosts at once
+===========================
 
 Many hosts can be added at once using
-``ceph orch apply -i`` by submitting a multi-document YAML file::
+``ceph orch apply -i`` by submitting a multi-document YAML file:
+
+.. code-block:: yaml
 
-    ---
     service_type: host
     hostname: node-00
     addr: 192.168.0.10
@@ -197,6 +198,26 @@ This can be combined with service specifications (below) to create a cluster spe
 file to deploy a whole cluster in one command.  see ``cephadm bootstrap --apply-spec``
 also to do this during bootstrap. Cluster SSH Keys must be copied to hosts prior to adding them.
 
+Setting the initial CRUSH location of host
+==========================================
+
+Hosts can contain a ``location`` identifier which will instruct cephadm to 
+create a new CRUSH host located in the specified hierachy.
+
+.. code-block:: yaml
+
+    service_type: host
+    hostname: node-00
+    addr: 192.168.0.10
+    location:
+      rack: rack1
+
+.. note:: 
+
+  The ``location`` attribute will be only affect the initial CRUSH location. Subsequent
+  changes of the ``location`` property will be ignored. Also, removing a host will no remove
+  any CRUSH buckets.
+
 SSH Configuration
 =================
 
@@ -233,6 +254,8 @@ You will then need to restart the mgr daemon to reload the configuration with::
 
   ceph mgr fail
 
+.. _cephadm-ssh-user:
+
 Configuring a different SSH user
 ----------------------------------
 
index 394f7b1cc579c01724bf79ca89598b15713eb859..d57fe288a01d6a8be810b926bca600f4a168b010 100644 (file)
@@ -21,21 +21,13 @@ either via the Ceph command-line interface (CLI) or via the dashboard (GUI).
 versions of Ceph.
 
 .. toctree::
-    :maxdepth: 1
+    :maxdepth: 2
 
     compatibility
     install
     adoption
     host-management
-    mon
-    osd
-    rgw
-    mds
-    nfs
-    iscsi
-    custom-container
-    monitoring
-    service-management
+    Service Management <services/index>
     upgrade
     Cephadm operations <operations>
     Client Setup <client-setup>
index 25907296c5455863be8614d92043ad7f06bfe65a..269bdfbcad53240734bcd33039c99156276d06e9 100644 (file)
@@ -176,7 +176,7 @@ available options.
 * By default, Ceph daemons send their log output to stdout/stderr, which is picked
   up by the container runtime (docker or podman) and (on most systems) sent to
   journald.  If you want Ceph to write traditional log files to ``/var/log/ceph/$fsid``,
-  use ``--log-to-file`` option during bootstrap.
+  use the ``--log-to-file`` option during bootstrap.
 
 * Larger Ceph clusters perform better when (external to the Ceph cluster)
   public network traffic is separated from (internal to the Ceph cluster)
diff --git a/ceph/doc/cephadm/iscsi.rst b/ceph/doc/cephadm/iscsi.rst
deleted file mode 100644 (file)
index d34ff6a..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-=============
-iSCSI Service
-=============
-
-.. _cephadm-iscsi:
-
-Deploying iSCSI
-===============
-
-To deploy an iSCSI gateway, create a yaml file containing a
-service specification for iscsi:
-
-.. code-block:: yaml
-
-    service_type: iscsi
-    service_id: iscsi
-    placement:
-      hosts:
-        - host1
-        - host2
-    spec:
-      pool: mypool  # RADOS pool where ceph-iscsi config data is stored.
-      trusted_ip_list: "IP_ADDRESS_1,IP_ADDRESS_2"
-      api_port: ... # optional
-      api_user: ... # optional
-      api_password: ... # optional
-      api_secure: true/false # optional
-      ssl_cert: | # optional
-        ...
-      ssl_key: | # optional
-        ...
-
-For example:
-
-.. code-block:: yaml
-
-    service_type: iscsi
-    service_id: iscsi
-    placement:
-      hosts:
-      - [...]
-    spec:
-      pool: iscsi_pool
-      trusted_ip_list: "IP_ADDRESS_1,IP_ADDRESS_2,IP_ADDRESS_3,..."
-      api_user: API_USERNAME
-      api_password: API_PASSWORD
-      api_secure: true
-      ssl_cert: |
-        -----BEGIN CERTIFICATE-----
-        MIIDtTCCAp2gAwIBAgIYMC4xNzc1NDQxNjEzMzc2MjMyXzxvQ7EcMA0GCSqGSIb3
-        DQEBCwUAMG0xCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARVdGFoMRcwFQYDVQQHDA5T
-        [...]
-        -----END CERTIFICATE-----
-      ssl_key: |
-        -----BEGIN PRIVATE KEY-----
-        MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5jdYbjtNTAKW4
-        /CwQr/7wOiLGzVxChn3mmCIF3DwbL/qvTFTX2d8bDf6LjGwLYloXHscRfxszX/4h
-        [...]
-        -----END PRIVATE KEY-----
-
-
-The specification can then be applied using:
-
-.. prompt:: bash #
-
-   ceph orch apply -i iscsi.yaml
-
-
-See :ref:`orchestrator-cli-placement-spec` for details of the placement specification.
diff --git a/ceph/doc/cephadm/mds.rst b/ceph/doc/cephadm/mds.rst
deleted file mode 100644 (file)
index fbee8d6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-===========
-MDS Service
-===========
-
-
-.. _orchestrator-cli-cephfs:
-
-Deploy CephFS
-=============
-
-One or more MDS daemons is required to use the :term:`CephFS` file system.
-These are created automatically if the newer ``ceph fs volume``
-interface is used to create a new file system. For more information,
-see :ref:`fs-volumes-and-subvolumes`.
-
-For example:
-
-.. prompt:: bash #
-
-  ceph fs volume create <fs_name> --placement="<placement spec>"
-
-where ``fs_name`` is the name of the CephFS and ``placement`` is a
-:ref:`orchestrator-cli-placement-spec`.
-
-For manually deploying MDS daemons, use this specification:
-
-.. code-block:: yaml
-
-    service_type: mds
-    service_id: fs_name
-    placement:
-      count: 3
-
-
-The specification can then be applied using:
-
-.. prompt:: bash #
-
-   ceph orch apply -i mds.yaml
-
-See :ref:`orchestrator-cli-stateless-services` for manually deploying
-MDS daemons on the CLI.
-
-
-
-
diff --git a/ceph/doc/cephadm/mon.rst b/ceph/doc/cephadm/mon.rst
deleted file mode 100644 (file)
index e66df61..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-===========
-MON Service
-===========
-
-.. _deploy_additional_monitors:
-
-Deploying additional monitors 
------------------------------
-
-A typical Ceph cluster has three or five monitor daemons that are spread
-across different hosts.  We recommend deploying five monitors if there are
-five or more nodes in your cluster.
-
-.. _CIDR: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation
-
-Ceph deploys monitor daemons automatically as the cluster grows and Ceph
-scales back monitor daemons automatically as the cluster shrinks. The
-smooth execution of this automatic growing and shrinking depends upon
-proper subnet configuration.
-
-The cephadm bootstrap procedure assigns the first monitor daemon in the
-cluster to a particular subnet. ``cephadm`` designates that subnet as the
-default subnet of the cluster. New monitor daemons will be assigned by
-default to that subnet unless cephadm is instructed to do otherwise. 
-
-If all of the ceph monitor daemons in your cluster are in the same subnet,
-manual administration of the ceph monitor daemons is not necessary.
-``cephadm`` will automatically add up to five monitors to the subnet, as
-needed, as new hosts are added to the cluster.
-
-By default, cephadm will deploy 5 daemons on arbitrary hosts. See
-:ref:`orchestrator-cli-placement-spec` for details of specifying
-the placement of daemons.
-
-Designating a Particular Subnet for Monitors
---------------------------------------------
-
-To designate a particular IP subnet for use by ceph monitor daemons, use a
-command of the following form, including the subnet's address in `CIDR`_
-format (e.g., ``10.1.2.0/24``):
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network *<mon-cidr-network>*
-
-  For example:
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network 10.1.2.0/24
-
-Cephadm deploys new monitor daemons only on hosts that have IP addresses in
-the designated subnet.
-
-You can also specify two public networks by using a list of networks:
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network *<mon-cidr-network1>,<mon-cidr-network2>*
-
-  For example:
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network 10.1.2.0/24,192.168.0.1/24
-
-
-Deploying Monitors on a Particular Network 
-------------------------------------------
-
-You can explicitly specify the IP address or CIDR network for each monitor and
-control where each monitor is placed.  To disable automated monitor deployment,
-run this command:
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --unmanaged
-
-  To deploy each additional monitor:
-
-  .. prompt:: bash #
-
-    ceph orch daemon add mon *<host1:ip-or-network1>
-
-  For example, to deploy a second monitor on ``newhost1`` using an IP
-  address ``10.1.2.123`` and a third monitor on ``newhost2`` in
-  network ``10.1.2.0/24``, run the following commands:
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --unmanaged
-    ceph orch daemon add mon newhost1:10.1.2.123
-    ceph orch daemon add mon newhost2:10.1.2.0/24
-
-  Now, enable automatic placement of Daemons
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --placement="newhost1,newhost2,newhost3" --dry-run
-
-  See :ref:`orchestrator-cli-placement-spec` for details of specifying
-  the placement of daemons.
-
-  Finally apply this new placement by dropping ``--dry-run``
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --placement="newhost1,newhost2,newhost3"
-
-
-Moving Monitors to a Different Network
---------------------------------------
-
-To move Monitors to a new network, deploy new monitors on the new network and
-subsequently remove monitors from the old network. It is not advised to
-modify and inject the ``monmap`` manually.
-
-First, disable the automated placement of daemons:
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --unmanaged
-
-To deploy each additional monitor:
-
-  .. prompt:: bash #
-
-    ceph orch daemon add mon *<newhost1:ip-or-network1>*
-
-For example, to deploy a second monitor on ``newhost1`` using an IP
-address ``10.1.2.123`` and a third monitor on ``newhost2`` in
-network ``10.1.2.0/24``, run the following commands:
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --unmanaged
-    ceph orch daemon add mon newhost1:10.1.2.123
-    ceph orch daemon add mon newhost2:10.1.2.0/24
-
-  Subsequently remove monitors from the old network:
-
-  .. prompt:: bash #
-
-    ceph orch daemon rm *mon.<oldhost1>*
-
-  Update the ``public_network``:
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network *<mon-cidr-network>*
-
-  For example:
-
-  .. prompt:: bash #
-
-     ceph config set mon public_network 10.1.2.0/24
-
-  Now, enable automatic placement of Daemons
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --placement="newhost1,newhost2,newhost3" --dry-run
-
-  See :ref:`orchestrator-cli-placement-spec` for details of specifying
-  the placement of daemons.
-
-  Finally apply this new placement by dropping ``--dry-run``
-
-  .. prompt:: bash #
-
-    ceph orch apply mon --placement="newhost1,newhost2,newhost3" 
diff --git a/ceph/doc/cephadm/monitoring.rst b/ceph/doc/cephadm/monitoring.rst
deleted file mode 100644 (file)
index 38f4b4b..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-.. _mgr-cephadm-monitoring:
-
-Monitoring Services
-===================
-
-Ceph Dashboard uses `Prometheus <https://prometheus.io/>`_, `Grafana
-<https://grafana.com/>`_, and related tools to store and visualize detailed
-metrics on cluster utilization and performance.  Ceph users have three options:
-
-#. Have cephadm deploy and configure these services.  This is the default
-   when bootstrapping a new cluster unless the ``--skip-monitoring-stack``
-   option is used.
-#. Deploy and configure these services manually.  This is recommended for users
-   with existing prometheus services in their environment (and in cases where
-   Ceph is running in Kubernetes with Rook).
-#. Skip the monitoring stack completely.  Some Ceph dashboard graphs will
-   not be available.
-
-The monitoring stack consists of `Prometheus <https://prometheus.io/>`_,
-Prometheus exporters (:ref:`mgr-prometheus`, `Node exporter
-<https://prometheus.io/docs/guides/node-exporter/>`_), `Prometheus Alert
-Manager <https://prometheus.io/docs/alerting/alertmanager/>`_ and `Grafana
-<https://grafana.com/>`_.
-
-.. note::
-
-  Prometheus' security model presumes that untrusted users have access to the
-  Prometheus HTTP endpoint and logs. Untrusted users have access to all the
-  (meta)data Prometheus collects that is contained in the database, plus a
-  variety of operational and debugging information.
-
-  However, Prometheus' HTTP API is limited to read-only operations.
-  Configurations can *not* be changed using the API and secrets are not
-  exposed. Moreover, Prometheus has some built-in measures to mitigate the
-  impact of denial of service attacks.
-
-  Please see `Prometheus' Security model
-  <https://prometheus.io/docs/operating/security/>` for more detailed
-  information.
-
-Deploying monitoring with cephadm
----------------------------------
-
-The default behavior of ``cephadm`` is to deploy a basic monitoring stack.  It
-is however possible that you have a Ceph cluster without a monitoring stack,
-and you would like to add a monitoring stack to it. (Here are some ways that
-you might have come to have a Ceph cluster without a monitoring stack: You
-might have passed the ``--skip-monitoring stack`` option to ``cephadm`` during
-the installation of the cluster, or you might have converted an existing
-cluster (which had no monitoring stack) to cephadm management.)
-
-To set up monitoring on a Ceph cluster that has no monitoring, follow the
-steps below:
-
-#. Deploy a node-exporter service on every node of the cluster.  The node-exporter provides host-level metrics like CPU and memory utilization:
-
-   .. prompt:: bash #
-
-     ceph orch apply node-exporter '*'
-
-#. Deploy alertmanager:
-
-   .. prompt:: bash #
-
-     ceph orch apply alertmanager 1
-
-#. Deploy Prometheus. A single Prometheus instance is sufficient, but
-   for high availablility (HA) you might want to deploy two:
-
-   .. prompt:: bash #
-
-     ceph orch apply prometheus 1 
-
-   or 
-
-   .. prompt:: bash #
-     
-     ceph orch apply prometheus 2    
-
-#. Deploy grafana:
-
-   .. prompt:: bash #
-
-     ceph orch apply grafana 1
-
-Manually setting the Grafana URL
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Cephadm automatically configures Prometheus, Grafana, and Alertmanager in
-all cases except one.
-
-In a some setups, the Dashboard user's browser might not be able to access the
-Grafana URL that is configured in Ceph Dashboard. This can happen when the
-cluster and the accessing user are in different DNS zones.
-
-If this is the case, you can use a configuration option for Ceph Dashboard
-to set the URL that the user's browser will use to access Grafana. This
-value will never be altered by cephadm. To set this configuration option,
-issue the following command:
-
-   .. prompt:: bash $
-
-     ceph dashboard set-grafana-frontend-api-url <grafana-server-api>
-
-It might take a minute or two for services to be deployed. After the
-services have been deployed, you should see something like this when you issue the command ``ceph orch ls``:
-
-.. code-block:: console
-
-  $ ceph orch ls
-  NAME           RUNNING  REFRESHED  IMAGE NAME                                      IMAGE ID        SPEC
-  alertmanager       1/1  6s ago     docker.io/prom/alertmanager:latest              0881eb8f169f  present
-  crash              2/2  6s ago     docker.io/ceph/daemon-base:latest-master-devel  mix           present
-  grafana            1/1  0s ago     docker.io/pcuzner/ceph-grafana-el8:latest       f77afcf0bcf6   absent
-  node-exporter      2/2  6s ago     docker.io/prom/node-exporter:latest             e5a616e4b9cf  present
-  prometheus         1/1  6s ago     docker.io/prom/prometheus:latest                e935122ab143  present
-
-Configuring SSL/TLS for Grafana
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-``cephadm`` deploys Grafana using the certificate defined in the ceph
-key/value store. If no certificate is specified, ``cephadm`` generates a
-self-signed certificate during the deployment of the Grafana service.
-
-A custom certificate can be configured using the following commands:
-
-.. prompt:: bash #
-
-  ceph config-key set mgr/cephadm/grafana_key -i $PWD/key.pem
-  ceph config-key set mgr/cephadm/grafana_crt -i $PWD/certificate.pem
-
-If you have already deployed Grafana, run ``reconfig`` on the service to
-update its configuration:
-
-.. prompt:: bash #
-
-  ceph orch reconfig grafana
-
-The ``reconfig`` command also sets the proper URL for Ceph Dashboard.
-
-Networks and Ports
-~~~~~~~~~~~~~~~~~~
-
-All monitoring services can have the network and port they bind to configured with a yaml service specification
-
-example spec file:
-
-.. code-block:: yaml
-
-    service_type: grafana
-    service_name: grafana
-    placement:
-      count: 1
-    networks:
-    - 192.169.142.0/24
-    spec:
-      port: 4200
-
-Using custom images
-~~~~~~~~~~~~~~~~~~~
-
-It is possible to install or upgrade monitoring components based on other
-images.  To do so, the name of the image to be used needs to be stored in the
-configuration first.  The following configuration options are available.
-
-- ``container_image_prometheus``
-- ``container_image_grafana``
-- ``container_image_alertmanager``
-- ``container_image_node_exporter``
-
-Custom images can be set with the ``ceph config`` command
-
-.. code-block:: bash
-
-     ceph config set mgr mgr/cephadm/<option_name> <value>
-
-For example
-
-.. code-block:: bash
-
-     ceph config set mgr mgr/cephadm/container_image_prometheus prom/prometheus:v1.4.1
-
-If there were already running monitoring stack daemon(s) of the type whose
-image you've changed, you must redeploy the daemon(s) in order to have them
-actually use the new image.
-
-For example, if you had changed the prometheus image
-
-.. prompt:: bash #
-
-     ceph orch redeploy prometheus
-
-
-.. note::
-
-     By setting a custom image, the default value will be overridden (but not
-     overwritten).  The default value changes when updates become available.
-     By setting a custom image, you will not be able to update the component
-     you have set the custom image for automatically.  You will need to
-     manually update the configuration (image name and tag) to be able to
-     install updates.
-
-     If you choose to go with the recommendations instead, you can reset the
-     custom image you have set before.  After that, the default value will be
-     used again.  Use ``ceph config rm`` to reset the configuration option
-
-     .. code-block:: bash
-
-          ceph config rm mgr mgr/cephadm/<option_name>
-
-     For example
-
-     .. code-block:: bash
-
-          ceph config rm mgr mgr/cephadm/container_image_prometheus
-
-Using custom configuration files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-By overriding cephadm templates, it is possible to completely customize the
-configuration files for monitoring services.
-
-Internally, cephadm already uses `Jinja2
-<https://jinja.palletsprojects.com/en/2.11.x/>`_ templates to generate the
-configuration files for all monitoring components. To be able to customize the
-configuration of Prometheus, Grafana or the Alertmanager it is possible to store
-a Jinja2 template for each service that will be used for configuration
-generation instead. This template will be evaluated every time a service of that
-kind is deployed or reconfigured. That way, the custom configuration is
-preserved and automatically applied on future deployments of these services.
-
-.. note::
-
-  The configuration of the custom template is also preserved when the default
-  configuration of cephadm changes. If the updated configuration is to be used,
-  the custom template needs to be migrated *manually*.
-
-Option names
-""""""""""""
-
-The following templates for files that will be generated by cephadm can be
-overridden. These are the names to be used when storing with ``ceph config-key
-set``:
-
-- ``services/alertmanager/alertmanager.yml``
-- ``services/grafana/ceph-dashboard.yml``
-- ``services/grafana/grafana.ini``
-- ``services/prometheus/prometheus.yml``
-
-You can look up the file templates that are currently used by cephadm in
-``src/pybind/mgr/cephadm/templates``:
-
-- ``services/alertmanager/alertmanager.yml.j2``
-- ``services/grafana/ceph-dashboard.yml.j2``
-- ``services/grafana/grafana.ini.j2``
-- ``services/prometheus/prometheus.yml.j2``
-
-Usage
-"""""
-
-The following command applies a single line value:
-
-.. code-block:: bash
-
-  ceph config-key set mgr/cephadm/<option_name> <value>
-
-To set contents of files as template use the ``-i`` argument:
-
-.. code-block:: bash
-
-  ceph config-key set mgr/cephadm/<option_name> -i $PWD/<filename>
-
-.. note::
-
-  When using files as input to ``config-key`` an absolute path to the file must
-  be used.
-
-
-Then the configuration file for the service needs to be recreated.
-This is done using `reconfig`. For more details see the following example.
-
-Example
-"""""""
-
-.. code-block:: bash
-
-  # set the contents of ./prometheus.yml.j2 as template
-  ceph config-key set mgr/cephadm/services/prometheus/prometheus.yml \
-    -i $PWD/prometheus.yml.j2
-
-  # reconfig the prometheus service
-  ceph orch reconfig prometheus
-
-Disabling monitoring
---------------------
-
-To disable monitoring and remove the software that supports it, run the following commands:
-
-.. code-block:: console
-
-  $ ceph orch rm grafana
-  $ ceph orch rm prometheus --force   # this will delete metrics data collected so far
-  $ ceph orch rm node-exporter
-  $ ceph orch rm alertmanager
-  $ ceph mgr module disable prometheus
-
-
-Deploying monitoring manually
------------------------------
-
-If you have an existing prometheus monitoring infrastructure, or would like
-to manage it yourself, you need to configure it to integrate with your Ceph
-cluster.
-
-* Enable the prometheus module in the ceph-mgr daemon
-
-  .. code-block:: bash
-
-     ceph mgr module enable prometheus
-
-  By default, ceph-mgr presents prometheus metrics on port 9283 on each host
-  running a ceph-mgr daemon.  Configure prometheus to scrape these.
-
-* To enable the dashboard's prometheus-based alerting, see :ref:`dashboard-alerting`.
-
-* To enable dashboard integration with Grafana, see :ref:`dashboard-grafana`.
-
-Enabling RBD-Image monitoring
----------------------------------
-
-Due to performance reasons, monitoring of RBD images is disabled by default. For more information please see
-:ref:`prometheus-rbd-io-statistics`. If disabled, the overview and details dashboards will stay empty in Grafana
-and the metrics will not be visible in Prometheus.
diff --git a/ceph/doc/cephadm/nfs.rst b/ceph/doc/cephadm/nfs.rst
deleted file mode 100644 (file)
index 631fe51..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-.. _deploy-cephadm-nfs-ganesha:
-
-===========
-NFS Service
-===========
-
-.. note:: Only the NFSv4 protocol is supported.
-
-The simplest way to manage NFS is via the ``ceph nfs cluster ...``
-commands; see :ref:`cephfs-nfs`.  This document covers how to manage the
-cephadm services directly, which should only be necessary for unusual NFS
-configurations.
-
-Deploying NFS ganesha
-=====================
-
-Cephadm deploys NFS Ganesha daemon (or set of daemons).  The configuration for
-NFS is stored in the ``nfs-ganesha`` pool and exports are managed via the
-``ceph nfs export ...`` commands and via the dashboard.
-
-To deploy a NFS Ganesha gateway, run the following command:
-
-.. prompt:: bash #
-
-    ceph orch apply nfs *<svc_id>* [--port *<port>*] [--placement ...]
-
-For example, to deploy NFS with a service id of *foo* on the default
-port 2049 with the default placement of a single daemon:
-
-.. prompt:: bash #
-
-   ceph orch apply nfs foo
-
-See :ref:`orchestrator-cli-placement-spec` for the details of the placement
-specification.
-
-Service Specification
-=====================
-
-Alternatively, an NFS service can be applied using a YAML specification. 
-
-.. code-block:: yaml
-
-    service_type: nfs
-    service_id: mynfs
-    placement:
-      hosts:
-        - host1
-        - host2
-    spec:
-      port: 12345
-
-In this example, we run the server on the non-default ``port`` of
-12345 (instead of the default 2049) on ``host1`` and ``host2``.
-
-The specification can then be applied by running the following command:
-
-.. prompt:: bash #
-
-   ceph orch apply -i nfs.yaml
-
-
-High-availability NFS
-=====================
-
-Deploying an *ingress* service for an existing *nfs* service will provide:
-
-* a stable, virtual IP that can be used to access the NFS server
-* fail-over between hosts if there is a host failure
-* load distribution across multiple NFS gateways (although this is rarely necessary)
-
-Ingress for NFS can be deployed for an existing NFS service
-(``nfs.mynfs`` in this example) with the following specification:
-
-.. code-block:: yaml
-
-    service_type: ingress
-    service_id: nfs.mynfs
-    placement:
-      count: 2
-    spec:
-      backend_service: nfs.mynfs
-      frontend_port: 2049
-      monitor_port: 9000
-      virtual_ip: 10.0.0.123/24
-
-A few notes:
-
-  * The *virtual_ip* must include a CIDR prefix length, as in the
-    example above.  The virtual IP will normally be configured on the
-    first identified network interface that has an existing IP in the
-    same subnet.  You can also specify a *virtual_interface_networks*
-    property to match against IPs in other networks; see
-    :ref:`ingress-virtual-ip` for more information.
-  * The *monitor_port* is used to access the haproxy load status
-    page.  The user is ``admin`` by default, but can be modified by
-    via an *admin* property in the spec.  If a password is not
-    specified via a *password* property in the spec, the auto-generated password
-    can be found with:
-
-    .. prompt:: bash #
-
-       ceph config-key get mgr/cephadm/ingress.*{svc_id}*/monitor_password
-
-    For example:
-
-    .. prompt:: bash #
-
-       ceph config-key get mgr/cephadm/ingress.nfs.myfoo/monitor_password
-       
-  * The backend service (``nfs.mynfs`` in this example) should include
-    a *port* property that is not 2049 to avoid conflicting with the
-    ingress service, which could be placed on the same host(s).
index 45ae1575b75408e38a4aca892e62522575a99c8a..08e493bd73a50d88a713ecc15b813bf9fb88915e 100644 (file)
@@ -178,30 +178,30 @@ running, but are not registered as hosts managed by *cephadm*.  This
 means that those services cannot currently be managed by cephadm
 (e.g., restarted, upgraded, included in `ceph orch ps`).
 
-You can manage the host(s) by running the following command:
+You can manage the host(s) by running the following command:
 
-.. prompt:: bash #
+  .. prompt:: bash #
 
-  ceph orch host add *<hostname>*
+    ceph orch host add *<hostname>*
 
-.. note::
+  .. note::
 
-  You might need to configure SSH access to the remote host
-  before this will work.
+    You might need to configure SSH access to the remote host
+    before this will work.
 
-Alternatively, you can manually connect to the host and ensure that
-services on that host are removed or migrated to a host that is
-managed by *cephadm*.
+* See :ref:`cephadm-fqdn` for more information about host names and
+  domain names.
 
-This warning can be disabled entirely by running the following
-command:
+* Alternatively, you can manually connect to the host and ensure that
+  services on that host are removed or migrated to a host that is
+  managed by *cephadm*.
 
-.. prompt:: bash #
+* This warning can be disabled entirely by running the following
+  command:
 
-  ceph config set mgr mgr/cephadm/warn_on_stray_hosts false
+  .. prompt:: bash #
 
-See :ref:`cephadm-fqdn` for more information about host names and
-domain names.
+    ceph config set mgr mgr/cephadm/warn_on_stray_hosts false
 
 CEPHADM_STRAY_DAEMON
 ~~~~~~~~~~~~~~~~~~~~
@@ -212,16 +212,30 @@ tool, or because they were started manually.  Those
 services cannot currently be managed by cephadm (e.g., restarted,
 upgraded, or included in `ceph orch ps`).
 
-If the daemon is a stateful one (monitor or OSD), it should be adopted
-by cephadm; see :ref:`cephadm-adoption`.  For stateless daemons, it is
-usually easiest to provision a new daemon with the ``ceph orch apply``
-command and then stop the unmanaged daemon.
+If the daemon is a stateful one (monitor or OSD), it should be adopted
+  by cephadm; see :ref:`cephadm-adoption`.  For stateless daemons, it is
+  usually easiest to provision a new daemon with the ``ceph orch apply``
+  command and then stop the unmanaged daemon.
 
-This warning can be disabled entirely by running the following command:
+* If the stray daemon(s) are running on hosts not managed by cephadm, you can manage the host(s) by running the following command:
 
-.. prompt:: bash #
+  .. prompt:: bash #
+
+    ceph orch host add *<hostname>*
+
+  .. note::
 
-  ceph config set mgr mgr/cephadm/warn_on_stray_daemons false
+    You might need to configure SSH access to the remote host
+    before this will work.
+
+* See :ref:`cephadm-fqdn` for more information about host names and
+  domain names.
+
+* This warning can be disabled entirely by running the following command:
+
+  .. prompt:: bash #
+
+    ceph config set mgr mgr/cephadm/warn_on_stray_daemons false
 
 CEPHADM_HOST_CHECK_FAILED
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -504,3 +518,28 @@ For example, to distribute configs to hosts with the ``bare_config`` label, run
   ceph config set mgr mgr/cephadm/manage_etc_ceph_ceph_conf_hosts label:bare_config
 
 (See :ref:`orchestrator-cli-placement-spec` for more information about placement specs.)
+
+Purging a cluster
+=================
+
+.. danger:: THIS OPERATION WILL DESTROY ALL DATA STORED IN THIS CLUSTER
+
+In order to destory a cluster and delete all data stored in this cluster, pause 
+cephadm to avoid deploying new daemons.
+
+.. prompt:: bash #
+
+  ceph orch pause
+
+Then verify the FSID of the cluster:
+
+.. prompt:: bash #
+
+  ceph fsid 
+
+Purge ceph daemons from all hosts in the cluster
+
+.. prompt:: bash #
+
+  # For each host:
+  cephadm rm-cluster --force --zap-osds --fsid <fsid>
diff --git a/ceph/doc/cephadm/osd.rst b/ceph/doc/cephadm/osd.rst
deleted file mode 100644 (file)
index f0bf47c..0000000
+++ /dev/null
@@ -1,882 +0,0 @@
-***********
-OSD Service
-***********
-.. _device management: ../rados/operations/devices
-.. _libstoragemgmt: https://github.com/libstorage/libstoragemgmt
-
-List Devices
-============
-
-``ceph-volume`` scans each host in the cluster from time to time in order
-to determine which devices are present and whether they are eligible to be
-used as OSDs.
-
-To print a list of devices discovered by ``cephadm``, run this command:
-
-.. prompt:: bash #
-
-    ceph orch device ls [--hostname=...] [--wide] [--refresh]
-
-Example
-::
-
-  Hostname  Path      Type  Serial              Size   Health   Ident  Fault  Available
-  srv-01    /dev/sdb  hdd   15P0A0YFFRD6         300G  Unknown  N/A    N/A    No
-  srv-01    /dev/sdc  hdd   15R0A08WFRD6         300G  Unknown  N/A    N/A    No
-  srv-01    /dev/sdd  hdd   15R0A07DFRD6         300G  Unknown  N/A    N/A    No
-  srv-01    /dev/sde  hdd   15P0A0QDFRD6         300G  Unknown  N/A    N/A    No
-  srv-02    /dev/sdb  hdd   15R0A033FRD6         300G  Unknown  N/A    N/A    No
-  srv-02    /dev/sdc  hdd   15R0A05XFRD6         300G  Unknown  N/A    N/A    No
-  srv-02    /dev/sde  hdd   15R0A0ANFRD6         300G  Unknown  N/A    N/A    No
-  srv-02    /dev/sdf  hdd   15R0A06EFRD6         300G  Unknown  N/A    N/A    No
-  srv-03    /dev/sdb  hdd   15R0A0OGFRD6         300G  Unknown  N/A    N/A    No
-  srv-03    /dev/sdc  hdd   15R0A0P7FRD6         300G  Unknown  N/A    N/A    No
-  srv-03    /dev/sdd  hdd   15R0A0O7FRD6         300G  Unknown  N/A    N/A    No
-
-Using the ``--wide`` option provides all details relating to the device,
-including any reasons that the device might not be eligible for use as an OSD.
-
-In the above example you can see fields named "Health", "Ident", and "Fault".
-This information is provided by integration with `libstoragemgmt`_. By default,
-this integration is disabled (because `libstoragemgmt`_ may not be 100%
-compatible with your hardware).  To make ``cephadm`` include these fields,
-enable cephadm's "enhanced device scan" option as follows;
-
-.. prompt:: bash #
-
-    ceph config set mgr mgr/cephadm/device_enhanced_scan true
-
-.. warning::
-    Although the libstoragemgmt library performs standard SCSI inquiry calls,
-    there is no guarantee that your firmware fully implements these standards.
-    This can lead to erratic behaviour and even bus resets on some older
-    hardware. It is therefore recommended that, before enabling this feature,
-    you test your hardware's compatibility with libstoragemgmt first to avoid
-    unplanned interruptions to services.
-
-    There are a number of ways to test compatibility, but the simplest may be
-    to use the cephadm shell to call libstoragemgmt directly - ``cephadm shell
-    lsmcli ldl``. If your hardware is supported you should see something like
-    this: 
-
-    ::
-
-      Path     | SCSI VPD 0x83    | Link Type | Serial Number      | Health Status
-      ----------------------------------------------------------------------------
-      /dev/sda | 50000396082ba631 | SAS       | 15P0A0R0FRD6       | Good
-      /dev/sdb | 50000396082bbbf9 | SAS       | 15P0A0YFFRD6       | Good
-
-
-After you have enabled libstoragemgmt support, the output will look something
-like this:
-
-::
-
-  # ceph orch device ls
-  Hostname   Path      Type  Serial              Size   Health   Ident  Fault  Available
-  srv-01     /dev/sdb  hdd   15P0A0YFFRD6         300G  Good     Off    Off    No
-  srv-01     /dev/sdc  hdd   15R0A08WFRD6         300G  Good     Off    Off    No
-  :
-
-In this example, libstoragemgmt has confirmed the health of the drives and the ability to
-interact with the Identification and Fault LEDs on the drive enclosures. For further
-information about interacting with these LEDs, refer to `device management`_.
-
-.. note::
-    The current release of `libstoragemgmt`_ (1.8.8) supports SCSI, SAS, and SATA based
-    local disks only. There is no official support for NVMe devices (PCIe)
-
-.. _cephadm-deploy-osds:
-
-Deploy OSDs
-===========
-
-Listing Storage Devices
------------------------
-
-In order to deploy an OSD, there must be a storage device that is *available* on
-which the OSD will be deployed.
-
-Run this command to display an inventory of storage devices on all cluster hosts:
-
-.. prompt:: bash #
-
-  ceph orch device ls
-
-A storage device is considered *available* if all of the following
-conditions are met:
-
-* The device must have no partitions.
-* The device must not have any LVM state.
-* The device must not be mounted.
-* The device must not contain a file system.
-* The device must not contain a Ceph BlueStore OSD.
-* The device must be larger than 5 GB.
-
-Ceph will not provision an OSD on a device that is not available.
-
-Creating New OSDs
------------------
-
-There are a few ways to create new OSDs:
-
-* Tell Ceph to consume any available and unused storage device:
-
-  .. prompt:: bash #
-
-    ceph orch apply osd --all-available-devices
-
-* Create an OSD from a specific device on a specific host:
-
-  .. prompt:: bash #
-
-    ceph orch daemon add osd *<host>*:*<device-path>*
-
-  For example:
-
-  .. prompt:: bash #
-
-    ceph orch daemon add osd host1:/dev/sdb
-
-* You can use :ref:`drivegroups` to categorize device(s) based on their
-  properties. This might be useful in forming a clearer picture of which
-  devices are available to consume. Properties include device type (SSD or
-  HDD), device model names, size, and the hosts on which the devices exist:
-
-  .. prompt:: bash #
-
-    ceph orch apply -i spec.yml
-
-Dry Run
--------
-
-The ``--dry-run`` flag causes the orchestrator to present a preview of what
-will happen without actually creating the OSDs.
-
-For example:
-
-   .. prompt:: bash #
-
-     ceph orch apply osd --all-available-devices --dry-run
-
-   ::
-
-     NAME                  HOST  DATA      DB  WAL
-     all-available-devices node1 /dev/vdb  -   -
-     all-available-devices node2 /dev/vdc  -   -
-     all-available-devices node3 /dev/vdd  -   -
-
-.. _cephadm-osd-declarative:
-
-Declarative State
------------------
-
-The effect of ``ceph orch apply`` is persistent. This means that drives that
-are added to the system after the ``ceph orch apply`` command completes will be
-automatically found and added to the cluster.  It also means that drives that
-become available (by zapping, for example) after the ``ceph orch apply``
-command completes will be automatically found and added to the cluster.
-
-We will examine the effects of the following command:
-
-   .. prompt:: bash #
-
-     ceph orch apply osd --all-available-devices
-
-After running the above command: 
-
-* If you add new disks to the cluster, they will automatically be used to
-  create new OSDs.
-* If you remove an OSD and clean the LVM physical volume, a new OSD will be
-  created automatically.
-
-To disable the automatic creation of OSD on available devices, use the
-``unmanaged`` parameter:
-
-If you want to avoid this behavior (disable automatic creation of OSD on available devices), use the ``unmanaged`` parameter:
-
-.. prompt:: bash #
-
-   ceph orch apply osd --all-available-devices --unmanaged=true
-
-.. note::
-
-  Keep these three facts in mind:
-
-  - The default behavior of ``ceph orch apply`` causes cephadm constantly to reconcile. This means that cephadm creates OSDs as soon as new drives are detected.
-
-  - Setting ``unmanaged: True`` disables the creation of OSDs. If ``unmanaged: True`` is set, nothing will happen even if you apply a new OSD service.
-
-  - ``ceph orch daemon add`` creates OSDs, but does not add an OSD service.
-
-* For cephadm, see also :ref:`cephadm-spec-unmanaged`.
-
-.. _cephadm-osd-removal:
-
-Remove an OSD
-=============
-
-Removing an OSD from a cluster involves two steps:
-
-#. evacuating all placement groups (PGs) from the cluster
-#. removing the PG-free OSD from the cluster
-
-The following command performs these two steps:
-
-.. prompt:: bash #
-
-  ceph orch osd rm <osd_id(s)> [--replace] [--force]
-
-Example:
-
-.. prompt:: bash #
-
-  ceph orch osd rm 0
-
-Expected output::
-
-   Scheduled OSD(s) for removal
-
-OSDs that are not safe to destroy will be rejected.
-
-Monitoring OSD State
---------------------
-
-You can query the state of OSD operation with the following command:
-
-.. prompt:: bash #
-
-   ceph orch osd rm status
-
-Expected output::
-
-    OSD_ID  HOST         STATE                    PG_COUNT  REPLACE  FORCE  STARTED_AT
-    2       cephadm-dev  done, waiting for purge  0         True     False  2020-07-17 13:01:43.147684
-    3       cephadm-dev  draining                 17        False    True   2020-07-17 13:01:45.162158
-    4       cephadm-dev  started                  42        False    True   2020-07-17 13:01:45.162158
-
-
-When no PGs are left on the OSD, it will be decommissioned and removed from the cluster.
-
-.. note::
-    After removing an OSD, if you wipe the LVM physical volume in the device used by the removed OSD, a new OSD will be created.
-    For more information on this, read about the ``unmanaged`` parameter in :ref:`cephadm-osd-declarative`.
-
-Stopping OSD Removal
---------------------
-
-It is possible to stop queued OSD removals by using the following command:
-
-.. prompt:: bash #
-
-  ceph orch osd rm stop <osd_id(s)>
-
-Example:
-
-.. prompt:: bash #
-
-    ceph orch osd rm stop 4
-
-Expected output::
-
-    Stopped OSD(s) removal
-
-This resets the initial state of the OSD and takes it off the removal queue.
-
-
-Replacing an OSD
-----------------
-
-.. prompt:: bash #
-
-  orch osd rm <osd_id(s)> --replace [--force]
-
-Example:
-
-.. prompt:: bash #
-
-  ceph orch osd rm 4 --replace
-
-Expected output::
-
-   Scheduled OSD(s) for replacement
-
-This follows the same procedure as the procedure in the "Remove OSD" section, with
-one exception: the OSD is not permanently removed from the CRUSH hierarchy, but is
-instead assigned a 'destroyed' flag.
-
-**Preserving the OSD ID**
-
-The 'destroyed' flag is used to determine which OSD ids will be reused in the
-next OSD deployment.
-
-If you use OSDSpecs for OSD deployment, your newly added disks will be assigned
-the OSD ids of their replaced counterparts. This assumes that the new disks
-still match the OSDSpecs.
-
-Use the ``--dry-run`` flag to make certain that the ``ceph orch apply osd`` 
-command does what you want it to. The ``--dry-run`` flag shows you what the
-outcome of the command will be without making the changes you specify. When
-you are satisfied that the command will do what you want, run the command
-without the ``--dry-run`` flag.
-
-.. tip::
-
-  The name of your OSDSpec can be retrieved with the command ``ceph orch ls``
-
-Alternatively, you can use your OSDSpec file:
-
-.. prompt:: bash #
-
-  ceph orch apply osd -i <osd_spec_file> --dry-run
-
-Expected output::
-
-  NAME                  HOST  DATA     DB WAL
-  <name_of_osd_spec>    node1 /dev/vdb -  -
-
-
-When this output reflects your intention, omit the ``--dry-run`` flag to
-execute the deployment.
-
-
-Erasing Devices (Zapping Devices)
----------------------------------
-
-Erase (zap) a device so that it can be reused. ``zap`` calls ``ceph-volume
-zap`` on the remote host.
-
-.. prompt:: bash #
-
-  ceph orch device zap <hostname> <path>
-
-Example command:
-
-.. prompt:: bash #
-
-  ceph orch device zap my_hostname /dev/sdx
-
-.. note::
-    If the unmanaged flag is unset, cephadm automatically deploys drives that
-    match the DriveGroup in your OSDSpec.  For example, if you use the
-    ``all-available-devices`` option when creating OSDs, when you ``zap`` a
-    device the cephadm orchestrator automatically creates a new OSD in the
-    device.  To disable this behavior, see :ref:`cephadm-osd-declarative`.
-
-
-.. _osd_autotune:
-
-Automatically tuning OSD memory
-===============================
-
-OSD daemons will adjust their memory consumption based on the
-``osd_memory_target`` config option (several gigabytes, by
-default).  If Ceph is deployed on dedicated nodes that are not sharing
-memory with other services, cephadm can automatically adjust the per-OSD
-memory consumption based on the total amount of RAM and the number of deployed
-OSDs.
-
-This option is enabled globally with::
-
-  ceph config set osd osd_memory_target_autotune true
-
-Cephadm will start with a fraction
-(``mgr/cephadm/autotune_memory_target_ratio``, which defaults to
-``.7``) of the total RAM in the system, subtract off any memory
-consumed by non-autotuned daemons (non-OSDs, for OSDs for which
-``osd_memory_target_autotune`` is false), and then divide by the
-remaining OSDs.
-
-The final targets are reflected in the config database with options like::
-
-  WHO   MASK      LEVEL   OPTION              VALUE
-  osd   host:foo  basic   osd_memory_target   126092301926
-  osd   host:bar  basic   osd_memory_target   6442450944
-
-Both the limits and the current memory consumed by each daemon are visible from
-the ``ceph orch ps`` output in the ``MEM LIMIT`` column::
-
-  NAME        HOST  PORTS  STATUS         REFRESHED  AGE  MEM USED  MEM LIMIT  VERSION                IMAGE ID      CONTAINER ID  
-  osd.1       dael         running (3h)     10s ago   3h    72857k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  9e183363d39c  
-  osd.2       dael         running (81m)    10s ago  81m    63989k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  1f0cc479b051  
-  osd.3       dael         running (62m)    10s ago  62m    64071k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  ac5537492f27  
-
-To exclude an OSD from memory autotuning, disable the autotune option
-for that OSD and also set a specific memory target.  For example,
-
-  .. prompt:: bash #
-
-    ceph config set osd.123 osd_memory_target_autotune false
-    ceph config set osd.123 osd_memory_target 16G
-
-
-.. _drivegroups:
-
-Advanced OSD Service Specifications
-===================================
-
-:ref:`orchestrator-cli-service-spec`\s of type ``osd`` are a way to describe a
-cluster layout, using the properties of disks. Service specifications give the
-user an abstract way to tell Ceph which disks should turn into OSDs with which
-configurations, without knowing the specifics of device names and paths.
-
-Service specifications make it possible to define a yaml or json file that can
-be used to reduce the amount of manual work involved in creating OSDs.
-
-For example, instead of running the following command:
-
-.. prompt:: bash [monitor.1]#
-
-  ceph orch daemon add osd *<host>*:*<path-to-device>*
-
-for each device and each host, we can define a yaml or json file that allows us
-to describe the layout. Here's the most basic example.
-
-Create a file called (for example) ``osd_spec.yml``:
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: default_drive_group  <- name of the drive_group (name can be custom)
-    placement:
-      host_pattern: '*'              <- which hosts to target, currently only supports globs
-    data_devices:                    <- the type of devices you are applying specs to
-      all: true                      <- a filter, check below for a full list
-
-This means :
-
-#. Turn any available device (ceph-volume decides what 'available' is) into an
-   OSD on all hosts that match the glob pattern '*'. (The glob pattern matches
-   against the registered hosts from `host ls`) A more detailed section on
-   host_pattern is available below.
-
-#. Then pass it to `osd create` like this:
-
-   .. prompt:: bash [monitor.1]#
-
-     ceph orch apply osd -i /path/to/osd_spec.yml
-
-   This instruction will be issued to all the matching hosts, and will deploy
-   these OSDs.
-
-   Setups more complex than the one specified by the ``all`` filter are
-   possible. See :ref:`osd_filters` for details.
-
-   A ``--dry-run`` flag can be passed to the ``apply osd`` command to display a
-   synopsis of the proposed layout.
-
-Example
-
-.. prompt:: bash [monitor.1]#
-
-   ceph orch apply osd -i /path/to/osd_spec.yml --dry-run
-
-
-
-.. _osd_filters:
-
-Filters
--------
-
-.. note::
-   Filters are applied using an `AND` gate by default. This means that a drive
-   must fulfill all filter criteria in order to get selected. This behavior can
-   be adjusted by setting ``filter_logic: OR`` in the OSD specification. 
-
-Filters are used to assign disks to groups, using their attributes to group
-them. 
-
-The attributes are based off of ceph-volume's disk query. You can retrieve
-information about the attributes with this command:
-
-.. code-block:: bash
-
-  ceph-volume inventory </path/to/disk>
-
-Vendor or Model
-^^^^^^^^^^^^^^^
-
-Specific disks can be targeted by vendor or model:
-
-.. code-block:: yaml
-
-    model: disk_model_name
-
-or
-
-.. code-block:: yaml
-
-    vendor: disk_vendor_name
-
-
-Size
-^^^^
-
-Specific disks can be targeted by `Size`:
-
-.. code-block:: yaml
-
-    size: size_spec
-
-Size specs
-__________
-
-Size specifications can be of the following forms:
-
-* LOW:HIGH
-* :HIGH
-* LOW:
-* EXACT
-
-Concrete examples:
-
-To include disks of an exact size
-
-.. code-block:: yaml
-
-    size: '10G'
-
-To include disks within a given range of size: 
-
-.. code-block:: yaml
-
-    size: '10G:40G'
-
-To include disks that are less than or equal to 10G in size:
-
-.. code-block:: yaml
-
-    size: ':10G'
-
-To include disks equal to or greater than 40G in size:
-
-.. code-block:: yaml
-
-    size: '40G:'
-
-Sizes don't have to be specified exclusively in Gigabytes(G).
-
-Other units of size are supported: Megabyte(M), Gigabyte(G) and Terrabyte(T).
-Appending the (B) for byte is also supported: ``MB``, ``GB``, ``TB``.
-
-
-Rotational
-^^^^^^^^^^
-
-This operates on the 'rotational' attribute of the disk.
-
-.. code-block:: yaml
-
-    rotational: 0 | 1
-
-`1` to match all disks that are rotational
-
-`0` to match all disks that are non-rotational (SSD, NVME etc)
-
-
-All
-^^^
-
-This will take all disks that are 'available'
-
-Note: This is exclusive for the data_devices section.
-
-.. code-block:: yaml
-
-    all: true
-
-
-Limiter
-^^^^^^^
-
-If you have specified some valid filters but want to limit the number of disks that they match, use the ``limit`` directive:
-
-.. code-block:: yaml
-
-    limit: 2
-
-For example, if you used `vendor` to match all disks that are from `VendorA`
-but want to use only the first two, you could use `limit`:
-
-.. code-block:: yaml
-
-  data_devices:
-    vendor: VendorA
-    limit: 2
-
-Note: `limit` is a last resort and shouldn't be used if it can be avoided.
-
-
-Additional Options
-------------------
-
-There are multiple optional settings you can use to change the way OSDs are deployed.
-You can add these options to the base level of a DriveGroup for it to take effect.
-
-This example would deploy all OSDs with encryption enabled.
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: example_osd_spec
-    placement:
-      host_pattern: '*'
-    data_devices:
-      all: true
-    encrypted: true
-
-See a full list in the DriveGroupSpecs
-
-.. py:currentmodule:: ceph.deployment.drive_group
-
-.. autoclass:: DriveGroupSpec
-   :members:
-   :exclude-members: from_json
-
-Examples
---------
-
-The simple case
-^^^^^^^^^^^^^^^
-
-All nodes with the same setup
-
-.. code-block:: none
-
-    20 HDDs
-    Vendor: VendorA
-    Model: HDD-123-foo
-    Size: 4TB
-
-    2 SSDs
-    Vendor: VendorB
-    Model: MC-55-44-ZX
-    Size: 512GB
-
-This is a common setup and can be described quite easily:
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_default
-    placement:
-      host_pattern: '*'
-    data_devices:
-      model: HDD-123-foo <- note that HDD-123 would also be valid
-    db_devices:
-      model: MC-55-44-XZ <- same here, MC-55-44 is valid
-
-However, we can improve it by reducing the filters on core properties of the drives:
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_default
-    placement:
-      host_pattern: '*'
-    data_devices:
-      rotational: 1
-    db_devices:
-      rotational: 0
-
-Now, we enforce all rotating devices to be declared as 'data devices' and all non-rotating devices will be used as shared_devices (wal, db)
-
-If you know that drives with more than 2TB will always be the slower data devices, you can also filter by size:
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_default
-    placement:
-      host_pattern: '*'
-    data_devices:
-      size: '2TB:'
-    db_devices:
-      size: ':2TB'
-
-Note: All of the above DriveGroups are equally valid. Which of those you want to use depends on taste and on how much you expect your node layout to change.
-
-
-The advanced case
-^^^^^^^^^^^^^^^^^
-
-Here we have two distinct setups
-
-.. code-block:: none
-
-    20 HDDs
-    Vendor: VendorA
-    Model: HDD-123-foo
-    Size: 4TB
-
-    12 SSDs
-    Vendor: VendorB
-    Model: MC-55-44-ZX
-    Size: 512GB
-
-    2 NVMEs
-    Vendor: VendorC
-    Model: NVME-QQQQ-987
-    Size: 256GB
-
-
-* 20 HDDs should share 2 SSDs
-* 10 SSDs should share 2 NVMes
-
-This can be described with two layouts.
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_hdd
-    placement:
-      host_pattern: '*'
-    data_devices:
-      rotational: 0
-    db_devices:
-      model: MC-55-44-XZ
-      limit: 2 (db_slots is actually to be favoured here, but it's not implemented yet)
-    ---
-    service_type: osd
-    service_id: osd_spec_ssd
-    placement:
-      host_pattern: '*'
-    data_devices:
-      model: MC-55-44-XZ
-    db_devices:
-      vendor: VendorC
-
-This would create the desired layout by using all HDDs as data_devices with two SSD assigned as dedicated db/wal devices.
-The remaining SSDs(8) will be data_devices that have the 'VendorC' NVMEs assigned as dedicated db/wal devices.
-
-The advanced case (with non-uniform nodes)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The examples above assumed that all nodes have the same drives. That's however not always the case.
-
-Node1-5
-
-.. code-block:: none
-
-    20 HDDs
-    Vendor: Intel
-    Model: SSD-123-foo
-    Size: 4TB
-    2 SSDs
-    Vendor: VendorA
-    Model: MC-55-44-ZX
-    Size: 512GB
-
-Node6-10
-
-.. code-block:: none
-
-    5 NVMEs
-    Vendor: Intel
-    Model: SSD-123-foo
-    Size: 4TB
-    20 SSDs
-    Vendor: VendorA
-    Model: MC-55-44-ZX
-    Size: 512GB
-
-You can use the 'host_pattern' key in the layout to target certain nodes. Salt target notation helps to keep things easy.
-
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_node_one_to_five
-    placement:
-      host_pattern: 'node[1-5]'
-    data_devices:
-      rotational: 1
-    db_devices:
-      rotational: 0
-    ---
-    service_type: osd
-    service_id: osd_spec_six_to_ten
-    placement:
-      host_pattern: 'node[6-10]'
-    data_devices:
-      model: MC-55-44-XZ
-    db_devices:
-      model: SSD-123-foo
-
-This applies different OSD specs to different hosts depending on the `host_pattern` key.
-
-Dedicated wal + db
-^^^^^^^^^^^^^^^^^^
-
-All previous cases co-located the WALs with the DBs.
-It's however possible to deploy the WAL on a dedicated device as well, if it makes sense.
-
-.. code-block:: none
-
-    20 HDDs
-    Vendor: VendorA
-    Model: SSD-123-foo
-    Size: 4TB
-
-    2 SSDs
-    Vendor: VendorB
-    Model: MC-55-44-ZX
-    Size: 512GB
-
-    2 NVMEs
-    Vendor: VendorC
-    Model: NVME-QQQQ-987
-    Size: 256GB
-
-
-The OSD spec for this case would look like the following (using the `model` filter):
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_spec_default
-    placement:
-      host_pattern: '*'
-    data_devices:
-      model: MC-55-44-XZ
-    db_devices:
-      model: SSD-123-foo
-    wal_devices:
-      model: NVME-QQQQ-987
-
-
-It is also possible to specify directly device paths in specific hosts like the following:
-
-.. code-block:: yaml
-
-    service_type: osd
-    service_id: osd_using_paths
-    placement:
-      hosts:
-        - Node01
-        - Node02
-    data_devices:
-      paths:
-        - /dev/sdb
-    db_devices:
-      paths:
-        - /dev/sdc
-    wal_devices:
-      paths:
-        - /dev/sdd
-
-
-This can easily be done with other filters, like `size` or `vendor` as well.
-
-Activate existing OSDs
-======================
-
-In case the OS of a host was reinstalled, existing OSDs need to be activated
-again. For this use case, cephadm provides a wrapper for :ref:`ceph-volume-lvm-activate` that
-activates all existing OSDs on a host.
-
-.. prompt:: bash #
-
-   ceph cephadm osd activate <host>...
-
-This will scan all existing disks for OSDs and deploy corresponding daemons.
diff --git a/ceph/doc/cephadm/rgw.rst b/ceph/doc/cephadm/rgw.rst
deleted file mode 100644 (file)
index 3283fdb..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-===========
-RGW Service
-===========
-
-.. _cephadm-deploy-rgw:
-
-Deploy RGWs
-===========
-
-Cephadm deploys radosgw as a collection of daemons that manage a
-single-cluster deployment or a particular *realm* and *zone* in a
-multisite deployment.  (For more information about realms and zones,
-see :ref:`multisite`.)
-
-Note that with cephadm, radosgw daemons are configured via the monitor
-configuration database instead of via a `ceph.conf` or the command line.  If
-that configuration isn't already in place (usually in the
-``client.rgw.<something>`` section), then the radosgw
-daemons will start up with default settings (e.g., binding to port
-80).
-
-To deploy a set of radosgw daemons, with an arbitrary service name
-*name*, run the following command:
-
-.. prompt:: bash #
-
-  ceph orch apply rgw *<name>* [--realm=*<realm-name>*] [--zone=*<zone-name>*] --placement="*<num-daemons>* [*<host1>* ...]"
-
-Trivial setup
--------------
-
-For example, to deploy 2 RGW daemons (the default) for a single-cluster RGW deployment
-under the arbitrary service id *foo*:
-
-.. prompt:: bash #
-
-   ceph orch apply rgw foo
-
-Designated gateways
--------------------
-
-A common scenario is to have a labeled set of hosts that will act
-as gateways, with multiple instances of radosgw running on consecutive
-ports 8000 and 8001:
-
-.. prompt:: bash #
-
-   ceph orch host label add gwhost1 rgw  # the 'rgw' label can be anything
-   ceph orch host label add gwhost2 rgw
-   ceph orch apply rgw foo '--placement=label:rgw count-per-host:2' --port=8000
-
-Multisite zones
----------------
-
-To deploy RGWs serving the multisite *myorg* realm and the *us-east-1* zone on
-*myhost1* and *myhost2*:
-
-.. prompt:: bash #
-
-   ceph orch apply rgw east --realm=myorg --zone=us-east-1 --placement="2 myhost1 myhost2"
-
-Note that in a multisite situation, cephadm only deploys the daemons.  It does not create
-or update the realm or zone configurations.  To create a new realm and zone, you need to do
-something like:
-
-.. prompt:: bash #
-
-  radosgw-admin realm create --rgw-realm=<realm-name> --default
-  
-.. prompt:: bash #
-
-  radosgw-admin zonegroup create --rgw-zonegroup=<zonegroup-name>  --master --default
-
-.. prompt:: bash #
-
-  radosgw-admin zone create --rgw-zonegroup=<zonegroup-name> --rgw-zone=<zone-name> --master --default
-
-.. prompt:: bash #
-
-  radosgw-admin period update --rgw-realm=<realm-name> --commit
-
-See :ref:`orchestrator-cli-placement-spec` for details of the placement
-specification.  See :ref:`multisite` for more information of setting up multisite RGW.
-
-Setting up HTTPS
-----------------
-
-In order to enable HTTPS for RGW services, apply a spec file following this scheme:
-
-.. code-block:: yaml
-
-  service_type: rgw
-  service_id: myrgw
-  spec:
-    rgw_frontend_ssl_certificate: | 
-      -----BEGIN PRIVATE KEY-----
-      V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt
-      ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15
-      IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu
-      YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg
-      ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=
-      -----END PRIVATE KEY-----
-      -----BEGIN CERTIFICATE-----
-      V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt
-      ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15
-      IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu
-      YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg
-      ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=
-      -----END CERTIFICATE-----
-    ssl: true
-
-Then apply this yaml document:
-
-.. prompt:: bash #
-
-  ceph orch apply -i myrgw.yaml
-
-Note the value of ``rgw_frontend_ssl_certificate`` is a literal string as
-indicated by a ``|`` character preserving newline characters. 
-
-.. _orchestrator-haproxy-service-spec:
-
-High availability service for RGW
-=================================
-
-The *ingress* service allows you to create a high availability endpoint
-for RGW with a minumum set of configuration options.  The orchestrator will
-deploy and manage a combination of haproxy and keepalived to provide load
-balancing on a floating virtual IP.
-
-If SSL is used, then SSL must be configured and terminated by the ingress service
-and not RGW itself.
-
-.. image:: ../images/HAProxy_for_RGW.svg
-
-There are N hosts where the ingress service is deployed.  Each host
-has a haproxy daemon and a keepalived daemon.  A virtual IP is
-automatically configured on only one of these hosts at a time.
-
-Each keepalived daemon checks every few seconds whether the haproxy
-daemon on the same host is responding.  Keepalived will also check
-that the master keepalived daemon is running without problems.  If the
-"master" keepalived daemon or the active haproxy is not responding,
-one of the remaining keepalived daemons running in backup mode will be
-elected as master, and the virtual IP will be moved to that node.
-
-The active haproxy acts like a load balancer, distributing all RGW requests
-between all the RGW daemons available.
-
-Prerequisites
--------------
-
-* An existing RGW service, without SSL.  (If you want SSL service, the certificate
-  should be configured on the ingress service, not the RGW service.)
-
-Deploying
----------
-
-Use the command::
-
-    ceph orch apply -i <ingress_spec_file>
-
-Service specification
----------------------
-
-It is a yaml format file with the following properties:
-
-.. code-block:: yaml
-
-    service_type: ingress
-    service_id: rgw.something    # adjust to match your existing RGW service
-    placement:
-      hosts:
-        - host1
-        - host2
-        - host3
-    spec:
-      backend_service: rgw.something      # adjust to match your existing RGW service
-      virtual_ip: <string>/<string>       # ex: 192.168.20.1/24
-      frontend_port: <integer>            # ex: 8080
-      monitor_port: <integer>             # ex: 1967, used by haproxy for load balancer status
-      virtual_interface_networks: [ ... ] # optional: list of CIDR networks
-      ssl_cert: |                         # optional: SSL certificate and key
-        -----BEGIN CERTIFICATE-----
-        ...
-        -----END CERTIFICATE-----
-        -----BEGIN PRIVATE KEY-----
-        ...
-        -----END PRIVATE KEY-----
-
-where the properties of this service specification are:
-
-* ``service_type``
-    Mandatory and set to "ingress"
-* ``service_id``
-    The name of the service.  We suggest naming this after the service you are
-    controlling ingress for (e.g., ``rgw.foo``).
-* ``placement hosts``
-    The hosts where it is desired to run the HA daemons. An haproxy and a
-    keepalived container will be deployed on these hosts.  These hosts do not need
-    to match the nodes where RGW is deployed.
-* ``virtual_ip``
-    The virtual IP (and network) in CIDR format where the ingress service will be available.
-* ``virtual_interface_networks``
-    A list of networks to identify which ethernet interface to use for the virtual IP.
-* ``frontend_port``
-    The port used to access the ingress service.
-* ``ssl_cert``:
-    SSL certificate, if SSL is to be enabled. This must contain the both the certificate and
-    private key blocks in .pem format.
-
-.. _ingress-virtual-ip:
-
-Selecting ethernet interfaces for the virtual IP
-------------------------------------------------
-
-You cannot simply provide the name of the network interface on which
-to configure the virtual IP because interface names tend to vary
-across hosts (and/or reboots).  Instead, cephadm will select
-interfaces based on other existing IP addresses that are already
-configured.
-
-Normally, the virtual IP will be configured on the first network
-interface that has an existing IP in the same subnet.  For example, if
-the virtual IP is 192.168.0.80/24 and eth2 has the static IP
-192.168.0.40/24, cephadm will use eth2.
-
-In some cases, the virtual IP may not belong to the same subnet as an existing static
-IP.  In such cases, you can provide a list of subnets to match against existing IPs,
-and cephadm will put the virtual IP on the first network interface to match.  For example,
-if the virtual IP is 192.168.0.80/24 and we want it on the same interface as the machine's
-static IP in 10.10.0.0/16, you can use a spec like::
-
-  service_type: ingress
-  service_id: rgw.something
-  spec:
-    virtual_ip: 192.168.0.80/24
-    virtual_interface_networks:
-      - 10.10.0.0/16
-    ...
-
-A consequence of this strategy is that you cannot currently configure the virtual IP
-on an interface that has no existing IP address.  In this situation, we suggest
-configuring a "dummy" IP address is an unroutable network on the correct interface
-and reference that dummy network in the networks list (see above).
-
-
-Useful hints for ingress
-------------------------
-
-* It is good to have at least 3 RGW daemons.
-* We recommend at least 3 hosts for the ingress service.
diff --git a/ceph/doc/cephadm/service-management.rst b/ceph/doc/cephadm/service-management.rst
deleted file mode 100644 (file)
index c8f47d9..0000000
+++ /dev/null
@@ -1,538 +0,0 @@
-==================
-Service Management
-==================
-
-Service Status
-==============
-
-A service is a group of daemons configured together. To see the status of one
-of the services running in the Ceph cluster, do the following:
-
-#. Use the command line to print a list of services. 
-#. Locate the service whose status you want to check. 
-#. Print the status of the service.
-
-The following command prints a list of services known to the orchestrator. To
-limit the output to services only on a specified host, use the optional
-``--host`` parameter. To limit the output to services of only a particular
-type, use the optional ``--type`` parameter (mon, osd, mgr, mds, rgw):
-
-   .. prompt:: bash #
-
-     ceph orch ls [--service_type type] [--service_name name] [--export] [--format f] [--refresh]
-
-Discover the status of a particular service or daemon:
-
-   .. prompt:: bash #
-
-     ceph orch ls --service_type type --service_name <name> [--refresh]
-
-To export the service specifications knows to the orchestrator, run the following command.
-
-   .. prompt:: bash #
-
-     ceph orch ls --export
-
-The service specifications exported with this command will be exported as yaml
-and that yaml can be used with the ``ceph orch apply -i`` command.
-
-For information about retrieving the specifications of single services (including examples of commands), see :ref:`orchestrator-cli-service-spec-retrieve`.
-
-Daemon Status
-=============
-
-A daemon is a systemd unit that is running and part of a service.
-
-To see the status of a daemon, do the following:
-
-#. Print a list of all daemons known to the orchestrator.
-#. Query the status of the target daemon.
-
-First, print a list of all daemons known to the orchestrator:
-
-   .. prompt:: bash #
-
-    ceph orch ps [--hostname host] [--daemon_type type] [--service_name name] [--daemon_id id] [--format f] [--refresh]
-
-Then query the status of a particular service instance (mon, osd, mds, rgw).
-For OSDs the id is the numeric OSD ID. For MDS services the id is the file
-system name:
-
-   .. prompt:: bash #
-
-    ceph orch ps --daemon_type osd --daemon_id 0
-    
-.. _orchestrator-cli-service-spec:
-
-Service Specification
-=====================
-
-A *Service Specification* is a data structure that is used to specify the
-deployment of services.  Here is an example of a service specification in YAML:
-
-.. code-block:: yaml
-
-    service_type: rgw
-    service_id: realm.zone
-    placement:
-      hosts:
-        - host1
-        - host2
-        - host3
-    unmanaged: false
-    ...
-
-In this example, the properties of this service specification are:
-
-* ``service_type``
-    The type of the service. Needs to be either a Ceph
-    service (``mon``, ``crash``, ``mds``, ``mgr``, ``osd`` or
-    ``rbd-mirror``), a gateway (``nfs`` or ``rgw``), part of the
-    monitoring stack (``alertmanager``, ``grafana``, ``node-exporter`` or
-    ``prometheus``) or (``container``) for custom containers.
-* ``service_id``
-    The name of the service.
-* ``placement``
-    See :ref:`orchestrator-cli-placement-spec`.
-* ``unmanaged`` If set to ``true``, the orchestrator will not deploy nor remove
-    any daemon associated with this service. Placement and all other properties
-    will be ignored. This is useful, if you do not want this service to be
-    managed temporarily. For cephadm, See :ref:`cephadm-spec-unmanaged`
-
-Each service type can have additional service-specific properties.
-
-Service specifications of type ``mon``, ``mgr``, and the monitoring
-types do not require a ``service_id``.
-
-A service of type ``osd`` is described in :ref:`drivegroups`
-
-Many service specifications can be applied at once using ``ceph orch apply -i``
-by submitting a multi-document YAML file::
-
-    cat <<EOF | ceph orch apply -i -
-    service_type: mon
-    placement:
-      host_pattern: "mon*"
-    ---
-    service_type: mgr
-    placement:
-      host_pattern: "mgr*"
-    ---
-    service_type: osd
-    service_id: default_drive_group
-    placement:
-      host_pattern: "osd*"
-    data_devices:
-      all: true
-    EOF
-
-.. _orchestrator-cli-service-spec-retrieve:
-
-Retrieving the running Service Specification
---------------------------------------------
-
-If the services have been started via ``ceph orch apply...``, then directly changing
-the Services Specification is complicated. Instead of attempting to directly change
-the Services Specification, we suggest exporting the running Service Specification by
-following these instructions:
-
-   .. prompt:: bash #
-    
-    ceph orch ls --service-name rgw.<realm>.<zone> --export > rgw.<realm>.<zone>.yaml
-    ceph orch ls --service-type mgr --export > mgr.yaml
-    ceph orch ls --export > cluster.yaml
-
-The Specification can then be changed and re-applied as above.
-
-.. _orchestrator-cli-placement-spec:
-
-Placement Specification
-=======================
-
-For the orchestrator to deploy a *service*, it needs to know where to deploy
-*daemons*, and how many to deploy.  This is the role of a placement
-specification.  Placement specifications can either be passed as command line arguments
-or in a YAML files.
-
-.. note::
-
-   cephadm will not deploy daemons on hosts with the ``_no_schedule`` label; see :ref:`cephadm-special-host-labels`.
-
-  .. note::
-     The **apply** command can be confusing. For this reason, we recommend using
-     YAML specifications.
-
-     Each ``ceph orch apply <service-name>`` command supersedes the one before it.
-     If you do not use the proper syntax, you will clobber your work
-     as you go.
-
-     For example:
-
-     .. prompt:: bash #
-
-          ceph orch apply mon host1
-          ceph orch apply mon host2
-          ceph orch apply mon host3
-
-     This results in only one host having a monitor applied to it: host 3.
-
-     (The first command creates a monitor on host1. Then the second command
-     clobbers the monitor on host1 and creates a monitor on host2. Then the
-     third command clobbers the monitor on host2 and creates a monitor on
-     host3. In this scenario, at this point, there is a monitor ONLY on
-     host3.)
-
-     To make certain that a monitor is applied to each of these three hosts,
-     run a command like this:
-
-     .. prompt:: bash #
-
-       ceph orch apply mon "host1,host2,host3"
-
-     There is another way to apply monitors to multiple hosts: a ``yaml`` file
-     can be used. Instead of using the "ceph orch apply mon" commands, run a
-     command of this form:
-
-     .. prompt:: bash #
-
-        ceph orch apply -i file.yaml
-
-     Here is a sample **file.yaml** file::
-
-          service_type: mon
-          placement:
-            hosts:
-             - host1
-             - host2
-             - host3
-
-Explicit placements
--------------------
-
-Daemons can be explicitly placed on hosts by simply specifying them:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement="host1 host2 host3"
-
-Or in YAML:
-
-.. code-block:: yaml
-
-    service_type: prometheus
-    placement:
-      hosts:
-        - host1
-        - host2
-        - host3
-
-MONs and other services may require some enhanced network specifications:
-
-   .. prompt:: bash #
-
-    orch daemon add mon --placement="myhost:[v2:1.2.3.4:3300,v1:1.2.3.4:6789]=name"
-
-where ``[v2:1.2.3.4:3300,v1:1.2.3.4:6789]`` is the network address of the monitor
-and ``=name`` specifies the name of the new monitor.
-
-.. _orch-placement-by-labels:
-
-Placement by labels
--------------------
-
-Daemon placement can be limited to hosts that match a specific label. To set
-a label ``mylabel`` to the appropriate hosts, run this command:
-
-  .. prompt:: bash #
-
-    ceph orch host label add *<hostname>* mylabel
-
-  To view the current hosts and labels, run this command:
-
-  .. prompt:: bash #
-
-    ceph orch host ls
-
-  For example:
-
-  .. prompt:: bash #
-
-    ceph orch host label add host1 mylabel
-    ceph orch host label add host2 mylabel
-    ceph orch host label add host3 mylabel
-    ceph orch host ls
-
-  .. code-block:: bash
-
-    HOST   ADDR   LABELS  STATUS
-    host1         mylabel
-    host2         mylabel
-    host3         mylabel
-    host4
-    host5
-
-Now, Tell cephadm to deploy daemons based on the label by running
-this command:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement="label:mylabel"
-
-Or in YAML:
-
-.. code-block:: yaml
-
-    service_type: prometheus
-    placement:
-      label: "mylabel"
-
-* See :ref:`orchestrator-host-labels`
-
-Placement by pattern matching
------------------------------
-
-Daemons can be placed on hosts as well:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement='myhost[1-3]'
-
-Or in YAML:
-
-.. code-block:: yaml
-
-    service_type: prometheus
-    placement:
-      host_pattern: "myhost[1-3]"
-
-To place a service on *all* hosts, use ``"*"``:
-
-   .. prompt:: bash #
-
-    orch apply node-exporter --placement='*'
-
-Or in YAML:
-
-.. code-block:: yaml
-
-    service_type: node-exporter
-    placement:
-      host_pattern: "*"
-
-
-Changing the number of monitors
--------------------------------
-
-By specifying ``count``, only the number of daemons specified will be created:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement=3
-
-To deploy *daemons* on a subset of hosts, specify the count:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement="2 host1 host2 host3"
-
-If the count is bigger than the amount of hosts, cephadm deploys one per host:
-
-   .. prompt:: bash #
-
-    orch apply prometheus --placement="3 host1 host2"
-
-The command immediately above results in two Prometheus daemons.
-
-YAML can also be used to specify limits, in the following way:
-
-.. code-block:: yaml
-
-    service_type: prometheus
-    placement:
-      count: 3
-
-YAML can also be used to specify limits on hosts:
-
-.. code-block:: yaml
-
-    service_type: prometheus
-    placement:
-      count: 2
-      hosts:
-        - host1
-        - host2
-        - host3
-
-Updating Service Specifications
-===============================
-
-The Ceph Orchestrator maintains a declarative state of each
-service in a ``ServiceSpec``. For certain operations, like updating
-the RGW HTTP port, we need to update the existing
-specification.
-
-1. List the current ``ServiceSpec``:
-
-   .. prompt:: bash #
-
-    ceph orch ls --service_name=<service-name> --export > myservice.yaml
-
-2. Update the yaml file:
-
-   .. prompt:: bash #
-
-    vi myservice.yaml
-
-3. Apply the new ``ServiceSpec``:
-   
-   .. prompt:: bash #
-
-    ceph orch apply -i myservice.yaml [--dry-run]
-    
-Deployment of Daemons
-=====================
-
-Cephadm uses a declarative state to define the layout of the cluster. This
-state consists of a list of service specifications containing placement
-specifications (See :ref:`orchestrator-cli-service-spec` ). 
-
-Cephadm continually compares a list of daemons actually running in the cluster
-against the list in the service specifications. Cephadm adds new daemons and
-removes old daemons as necessary in order to conform to the service
-specifications.
-
-Cephadm does the following to maintain compliance with the service
-specifications.
-
-Cephadm first selects a list of candidate hosts. Cephadm seeks explicit host
-names and selects them. If cephadm finds no explicit host names, it looks for
-label specifications. If no label is defined in the specification, cephadm
-selects hosts based on a host pattern. If no host pattern is defined, as a last
-resort, cephadm selects all known hosts as candidates.
-
-Cephadm is aware of existing daemons running services and tries to avoid moving
-them.
-
-Cephadm supports the deployment of a specific amount of services.
-Consider the following service specification:
-
-.. code-block:: yaml
-
-    service_type: mds
-    service_name: myfs
-    placement:
-      count: 3
-      label: myfs
-
-This service specifcation instructs cephadm to deploy three daemons on hosts
-labeled ``myfs`` across the cluster.
-
-If there are fewer than three daemons deployed on the candidate hosts, cephadm
-randomly chooses hosts on which to deploy new daemons.
-
-If there are more than three daemons deployed on the candidate hosts, cephadm
-removes existing daemons.
-
-Finally, cephadm removes daemons on hosts that are outside of the list of
-candidate hosts.
-
-.. note::
-    
-   There is a special case that cephadm must consider.
-
-   If there are fewer hosts selected by the placement specification than 
-   demanded by ``count``, cephadm will deploy only on the selected hosts.
-
-
-.. _cephadm-spec-unmanaged:
-
-Disabling automatic deployment of daemons
-=========================================
-
-Cephadm supports disabling the automated deployment and removal of daemons on a
-per service basis. The CLI supports two commands for this.
-
-Disabling automatic management of daemons
------------------------------------------
-
-To disable the automatic management of dameons, set ``unmanaged=True`` in the
-:ref:`orchestrator-cli-service-spec` (``mgr.yaml``).
-
-``mgr.yaml``:
-
-.. code-block:: yaml
-
-  service_type: mgr
-  unmanaged: true
-  placement:
-    label: mgr
-
-
-.. prompt:: bash #
-
-   ceph orch apply -i mgr.yaml
-
-
-.. note::
-
-  After you apply this change in the Service Specification, cephadm will no
-  longer deploy any new daemons (even if the placement specification matches
-  additional hosts).
-
-Deploying a daemon on a host manually
--------------------------------------
-
-.. note::
-
-  This workflow has a very limited use case and should only be used
-  in rare circumstances. 
-
-To manually deploy a daemon on a host, follow these steps:
-
-Modify the service spec for a service by getting the 
-existing spec, adding ``unmanaged: true``, and applying the modified spec. 
-
-Then manually deploy the daemon using the following:
-
-   .. prompt:: bash #
-
-     ceph orch daemon add <daemon-type>  --placement=<placement spec>
-
-For example :
-
-   .. prompt:: bash #
-
-     ceph orch daemon add mgr --placement=my_host
-
-.. note:: 
-
-  Removing ``unmanaged: true`` from the service spec will 
-  enable the reconciliation loop for this service and will
-  potentially lead to the removal of the daemon, depending
-  on the placement spec. 
-
-Removing a daemon from a host manually
---------------------------------------
-
-To manually remove a daemon, run a command of the following form:
-
-   .. prompt:: bash #
-
-     ceph orch daemon rm <daemon name>... [--force]
-
-For example:
-
-   .. prompt:: bash #
-
-     ceph orch daemon rm mgr.my_host.xyzxyz
-
-.. note:: 
-
-  For managed services (``unmanaged=False``), cephadm will automatically
-  deploy a new daemon a few seconds later.
-
-See also
---------
-    
-* See :ref:`cephadm-osd-declarative` for special handling of unmanaged OSDs. 
-* See also :ref:`cephadm-pause`
diff --git a/ceph/doc/cephadm/services/custom-container.rst b/ceph/doc/cephadm/services/custom-container.rst
new file mode 100644 (file)
index 0000000..3ece248
--- /dev/null
@@ -0,0 +1,79 @@
+========================
+Custom Container Service
+========================
+
+The orchestrator enables custom containers to be deployed using a YAML file.
+A corresponding :ref:`orchestrator-cli-service-spec` must look like:
+
+.. code-block:: yaml
+
+    service_type: container
+    service_id: foo
+    placement:
+        ...
+    spec:
+      image: docker.io/library/foo:latest
+      entrypoint: /usr/bin/foo
+      uid: 1000
+      gid: 1000
+      args:
+        - "--net=host"
+        - "--cpus=2"
+      ports:
+        - 8080
+        - 8443
+      envs:
+        - SECRET=mypassword
+        - PORT=8080
+        - PUID=1000
+        - PGID=1000
+      volume_mounts:
+        CONFIG_DIR: /etc/foo
+      bind_mounts:
+        - ['type=bind', 'source=lib/modules', 'destination=/lib/modules', 'ro=true']
+      dirs:
+        - CONFIG_DIR
+      files:
+        CONFIG_DIR/foo.conf:
+          - refresh=true
+          - username=xyz
+          - "port: 1234"
+
+where the properties of a service specification are:
+
+* ``service_id``
+    A unique name of the service.
+* ``image``
+    The name of the Docker image.
+* ``uid``
+    The UID to use when creating directories and files in the host system.
+* ``gid``
+    The GID to use when creating directories and files in the host system.
+* ``entrypoint``
+    Overwrite the default ENTRYPOINT of the image.
+* ``args``
+    A list of additional Podman/Docker command line arguments.
+* ``ports``
+    A list of TCP ports to open in the host firewall.
+* ``envs``
+    A list of environment variables.
+* ``bind_mounts``
+    When you use a bind mount, a file or directory on the host machine
+    is mounted into the container. Relative `source=...` paths will be
+    located below `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
+* ``volume_mounts``
+    When you use a volume mount, a new directory is created within
+    Docker’s storage directory on the host machine, and Docker manages
+    that directory’s contents. Relative source paths will be located below
+    `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
+* ``dirs``
+    A list of directories that are created below
+    `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
+* ``files``
+    A dictionary, where the key is the relative path of the file and the
+    value the file content. The content must be double quoted when using
+    a string. Use '\\n' for line breaks in that case. Otherwise define
+    multi-line content as list of strings. The given files will be created
+    below the directory `/var/lib/ceph/<cluster-fsid>/<daemon-name>`.
+    The absolute path of the directory where the file will be created must
+    exist. Use the `dirs` property to create them if necessary.
diff --git a/ceph/doc/cephadm/services/index.rst b/ceph/doc/cephadm/services/index.rst
new file mode 100644 (file)
index 0000000..f34180e
--- /dev/null
@@ -0,0 +1,568 @@
+==================
+Service Management
+==================
+
+A service is a group of daemons configured together. See these chapters
+for details on individual services:
+
+.. toctree::
+    :maxdepth: 1
+
+    mon
+    mgr
+    osd
+    rgw
+    mds
+    nfs
+    iscsi
+    custom-container
+    monitoring
+
+Service Status
+==============
+
+
+To see the status of one
+of the services running in the Ceph cluster, do the following:
+
+#. Use the command line to print a list of services. 
+#. Locate the service whose status you want to check. 
+#. Print the status of the service.
+
+The following command prints a list of services known to the orchestrator. To
+limit the output to services only on a specified host, use the optional
+``--host`` parameter. To limit the output to services of only a particular
+type, use the optional ``--type`` parameter (mon, osd, mgr, mds, rgw):
+
+   .. prompt:: bash #
+
+     ceph orch ls [--service_type type] [--service_name name] [--export] [--format f] [--refresh]
+
+Discover the status of a particular service or daemon:
+
+   .. prompt:: bash #
+
+     ceph orch ls --service_type type --service_name <name> [--refresh]
+
+To export the service specifications knows to the orchestrator, run the following command.
+
+   .. prompt:: bash #
+
+     ceph orch ls --export
+
+The service specifications exported with this command will be exported as yaml
+and that yaml can be used with the ``ceph orch apply -i`` command.
+
+For information about retrieving the specifications of single services (including examples of commands), see :ref:`orchestrator-cli-service-spec-retrieve`.
+
+Daemon Status
+=============
+
+A daemon is a systemd unit that is running and part of a service.
+
+To see the status of a daemon, do the following:
+
+#. Print a list of all daemons known to the orchestrator.
+#. Query the status of the target daemon.
+
+First, print a list of all daemons known to the orchestrator:
+
+   .. prompt:: bash #
+
+    ceph orch ps [--hostname host] [--daemon_type type] [--service_name name] [--daemon_id id] [--format f] [--refresh]
+
+Then query the status of a particular service instance (mon, osd, mds, rgw).
+For OSDs the id is the numeric OSD ID. For MDS services the id is the file
+system name:
+
+   .. prompt:: bash #
+
+    ceph orch ps --daemon_type osd --daemon_id 0
+    
+.. _orchestrator-cli-service-spec:
+
+Service Specification
+=====================
+
+A *Service Specification* is a data structure that is used to specify the
+deployment of services.  Here is an example of a service specification in YAML:
+
+.. code-block:: yaml
+
+    service_type: rgw
+    service_id: realm.zone
+    placement:
+      hosts:
+        - host1
+        - host2
+        - host3
+    unmanaged: false
+    networks:
+    - 192.169.142.0/24
+    spec:
+      # Additional service specific attributes.
+
+In this example, the properties of this service specification are:
+
+.. py:currentmodule:: ceph.deployment.service_spec
+
+.. autoclass:: ServiceSpec
+   :members:
+
+Each service type can have additional service-specific properties.
+
+Service specifications of type ``mon``, ``mgr``, and the monitoring
+types do not require a ``service_id``.
+
+A service of type ``osd`` is described in :ref:`drivegroups`
+
+Many service specifications can be applied at once using ``ceph orch apply -i``
+by submitting a multi-document YAML file::
+
+    cat <<EOF | ceph orch apply -i -
+    service_type: mon
+    placement:
+      host_pattern: "mon*"
+    ---
+    service_type: mgr
+    placement:
+      host_pattern: "mgr*"
+    ---
+    service_type: osd
+    service_id: default_drive_group
+    placement:
+      host_pattern: "osd*"
+    data_devices:
+      all: true
+    EOF
+
+.. _orchestrator-cli-service-spec-retrieve:
+
+Retrieving the running Service Specification
+--------------------------------------------
+
+If the services have been started via ``ceph orch apply...``, then directly changing
+the Services Specification is complicated. Instead of attempting to directly change
+the Services Specification, we suggest exporting the running Service Specification by
+following these instructions:
+
+   .. prompt:: bash #
+    
+    ceph orch ls --service-name rgw.<realm>.<zone> --export > rgw.<realm>.<zone>.yaml
+    ceph orch ls --service-type mgr --export > mgr.yaml
+    ceph orch ls --export > cluster.yaml
+
+The Specification can then be changed and re-applied as above.
+
+Updating Service Specifications
+-------------------------------
+
+The Ceph Orchestrator maintains a declarative state of each
+service in a ``ServiceSpec``. For certain operations, like updating
+the RGW HTTP port, we need to update the existing
+specification.
+
+1. List the current ``ServiceSpec``:
+
+   .. prompt:: bash #
+
+    ceph orch ls --service_name=<service-name> --export > myservice.yaml
+
+2. Update the yaml file:
+
+   .. prompt:: bash #
+
+    vi myservice.yaml
+
+3. Apply the new ``ServiceSpec``:
+
+   .. prompt:: bash #
+
+    ceph orch apply -i myservice.yaml [--dry-run]
+
+.. _orchestrator-cli-placement-spec:
+
+Daemon Placement
+================
+
+For the orchestrator to deploy a *service*, it needs to know where to deploy
+*daemons*, and how many to deploy.  This is the role of a placement
+specification.  Placement specifications can either be passed as command line arguments
+or in a YAML files.
+
+.. note::
+
+   cephadm will not deploy daemons on hosts with the ``_no_schedule`` label; see :ref:`cephadm-special-host-labels`.
+
+.. note::
+   The **apply** command can be confusing. For this reason, we recommend using
+   YAML specifications.
+
+   Each ``ceph orch apply <service-name>`` command supersedes the one before it.
+   If you do not use the proper syntax, you will clobber your work
+   as you go.
+
+   For example:
+
+   .. prompt:: bash #
+
+        ceph orch apply mon host1
+        ceph orch apply mon host2
+        ceph orch apply mon host3
+
+   This results in only one host having a monitor applied to it: host 3.
+
+   (The first command creates a monitor on host1. Then the second command
+   clobbers the monitor on host1 and creates a monitor on host2. Then the
+   third command clobbers the monitor on host2 and creates a monitor on
+   host3. In this scenario, at this point, there is a monitor ONLY on
+   host3.)
+
+   To make certain that a monitor is applied to each of these three hosts,
+   run a command like this:
+
+   .. prompt:: bash #
+
+     ceph orch apply mon "host1,host2,host3"
+
+   There is another way to apply monitors to multiple hosts: a ``yaml`` file
+   can be used. Instead of using the "ceph orch apply mon" commands, run a
+   command of this form:
+
+   .. prompt:: bash #
+
+      ceph orch apply -i file.yaml
+
+   Here is a sample **file.yaml** file
+
+   .. code-block:: yaml
+
+        service_type: mon
+        placement:
+          hosts:
+           - host1
+           - host2
+           - host3
+
+Explicit placements
+-------------------
+
+Daemons can be explicitly placed on hosts by simply specifying them:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement="host1 host2 host3"
+
+Or in YAML:
+
+.. code-block:: yaml
+
+    service_type: prometheus
+    placement:
+      hosts:
+        - host1
+        - host2
+        - host3
+
+MONs and other services may require some enhanced network specifications:
+
+   .. prompt:: bash #
+
+    orch daemon add mon --placement="myhost:[v2:1.2.3.4:3300,v1:1.2.3.4:6789]=name"
+
+where ``[v2:1.2.3.4:3300,v1:1.2.3.4:6789]`` is the network address of the monitor
+and ``=name`` specifies the name of the new monitor.
+
+.. _orch-placement-by-labels:
+
+Placement by labels
+-------------------
+
+Daemon placement can be limited to hosts that match a specific label. To set
+a label ``mylabel`` to the appropriate hosts, run this command:
+
+  .. prompt:: bash #
+
+    ceph orch host label add *<hostname>* mylabel
+
+  To view the current hosts and labels, run this command:
+
+  .. prompt:: bash #
+
+    ceph orch host ls
+
+  For example:
+
+  .. prompt:: bash #
+
+    ceph orch host label add host1 mylabel
+    ceph orch host label add host2 mylabel
+    ceph orch host label add host3 mylabel
+    ceph orch host ls
+
+  .. code-block:: bash
+
+    HOST   ADDR   LABELS  STATUS
+    host1         mylabel
+    host2         mylabel
+    host3         mylabel
+    host4
+    host5
+
+Now, Tell cephadm to deploy daemons based on the label by running
+this command:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement="label:mylabel"
+
+Or in YAML:
+
+.. code-block:: yaml
+
+    service_type: prometheus
+    placement:
+      label: "mylabel"
+
+* See :ref:`orchestrator-host-labels`
+
+Placement by pattern matching
+-----------------------------
+
+Daemons can be placed on hosts as well:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement='myhost[1-3]'
+
+Or in YAML:
+
+.. code-block:: yaml
+
+    service_type: prometheus
+    placement:
+      host_pattern: "myhost[1-3]"
+
+To place a service on *all* hosts, use ``"*"``:
+
+   .. prompt:: bash #
+
+    orch apply node-exporter --placement='*'
+
+Or in YAML:
+
+.. code-block:: yaml
+
+    service_type: node-exporter
+    placement:
+      host_pattern: "*"
+
+
+Changing the number of daemons
+------------------------------
+
+By specifying ``count``, only the number of daemons specified will be created:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement=3
+
+To deploy *daemons* on a subset of hosts, specify the count:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement="2 host1 host2 host3"
+
+If the count is bigger than the amount of hosts, cephadm deploys one per host:
+
+   .. prompt:: bash #
+
+    orch apply prometheus --placement="3 host1 host2"
+
+The command immediately above results in two Prometheus daemons.
+
+YAML can also be used to specify limits, in the following way:
+
+.. code-block:: yaml
+
+    service_type: prometheus
+    placement:
+      count: 3
+
+YAML can also be used to specify limits on hosts:
+
+.. code-block:: yaml
+
+    service_type: prometheus
+    placement:
+      count: 2
+      hosts:
+        - host1
+        - host2
+        - host3
+
+Algorithm description
+---------------------
+
+Cephadm's declarative state consists of a list of service specifications
+containing placement specifications.
+
+Cephadm continually compares a list of daemons actually running in the cluster
+against the list in the service specifications. Cephadm adds new daemons and
+removes old daemons as necessary in order to conform to the service
+specifications.
+
+Cephadm does the following to maintain compliance with the service
+specifications.
+
+Cephadm first selects a list of candidate hosts. Cephadm seeks explicit host
+names and selects them. If cephadm finds no explicit host names, it looks for
+label specifications. If no label is defined in the specification, cephadm
+selects hosts based on a host pattern. If no host pattern is defined, as a last
+resort, cephadm selects all known hosts as candidates.
+
+Cephadm is aware of existing daemons running services and tries to avoid moving
+them.
+
+Cephadm supports the deployment of a specific amount of services.
+Consider the following service specification:
+
+.. code-block:: yaml
+
+    service_type: mds
+    service_name: myfs
+    placement:
+      count: 3
+      label: myfs
+
+This service specifcation instructs cephadm to deploy three daemons on hosts
+labeled ``myfs`` across the cluster.
+
+If there are fewer than three daemons deployed on the candidate hosts, cephadm
+randomly chooses hosts on which to deploy new daemons.
+
+If there are more than three daemons deployed on the candidate hosts, cephadm
+removes existing daemons.
+
+Finally, cephadm removes daemons on hosts that are outside of the list of
+candidate hosts.
+
+.. note::
+
+   There is a special case that cephadm must consider.
+
+   If there are fewer hosts selected by the placement specification than
+   demanded by ``count``, cephadm will deploy only on the selected hosts.
+
+.. _orch-rm:
+
+Removing a Service
+==================
+
+In order to remove a service including the removal
+of all daemons of that service, run
+
+.. prompt:: bash
+
+  ceph orch rm <service-name>
+
+For example:
+
+.. prompt:: bash
+
+  ceph orch rm rgw.myrgw
+
+.. _cephadm-spec-unmanaged:
+
+Disabling automatic deployment of daemons
+=========================================
+
+Cephadm supports disabling the automated deployment and removal of daemons on a
+per service basis. The CLI supports two commands for this.
+
+In order to fully remove a service, see :ref:`orch-rm`.
+
+Disabling automatic management of daemons
+-----------------------------------------
+
+To disable the automatic management of dameons, set ``unmanaged=True`` in the
+:ref:`orchestrator-cli-service-spec` (``mgr.yaml``).
+
+``mgr.yaml``:
+
+.. code-block:: yaml
+
+  service_type: mgr
+  unmanaged: true
+  placement:
+    label: mgr
+
+
+.. prompt:: bash #
+
+   ceph orch apply -i mgr.yaml
+
+
+.. note::
+
+  After you apply this change in the Service Specification, cephadm will no
+  longer deploy any new daemons (even if the placement specification matches
+  additional hosts).
+
+Deploying a daemon on a host manually
+-------------------------------------
+
+.. note::
+
+  This workflow has a very limited use case and should only be used
+  in rare circumstances. 
+
+To manually deploy a daemon on a host, follow these steps:
+
+Modify the service spec for a service by getting the 
+existing spec, adding ``unmanaged: true``, and applying the modified spec. 
+
+Then manually deploy the daemon using the following:
+
+   .. prompt:: bash #
+
+     ceph orch daemon add <daemon-type>  --placement=<placement spec>
+
+For example :
+
+   .. prompt:: bash #
+
+     ceph orch daemon add mgr --placement=my_host
+
+.. note:: 
+
+  Removing ``unmanaged: true`` from the service spec will 
+  enable the reconciliation loop for this service and will
+  potentially lead to the removal of the daemon, depending
+  on the placement spec. 
+
+Removing a daemon from a host manually
+--------------------------------------
+
+To manually remove a daemon, run a command of the following form:
+
+   .. prompt:: bash #
+
+     ceph orch daemon rm <daemon name>... [--force]
+
+For example:
+
+   .. prompt:: bash #
+
+     ceph orch daemon rm mgr.my_host.xyzxyz
+
+.. note:: 
+
+  For managed services (``unmanaged=False``), cephadm will automatically
+  deploy a new daemon a few seconds later.
+
+See also
+--------
+    
+* See :ref:`cephadm-osd-declarative` for special handling of unmanaged OSDs. 
+* See also :ref:`cephadm-pause`
diff --git a/ceph/doc/cephadm/services/iscsi.rst b/ceph/doc/cephadm/services/iscsi.rst
new file mode 100644 (file)
index 0000000..e039e8d
--- /dev/null
@@ -0,0 +1,80 @@
+=============
+iSCSI Service
+=============
+
+.. _cephadm-iscsi:
+
+Deploying iSCSI
+===============
+
+To deploy an iSCSI gateway, create a yaml file containing a
+service specification for iscsi:
+
+.. code-block:: yaml
+
+    service_type: iscsi
+    service_id: iscsi
+    placement:
+      hosts:
+        - host1
+        - host2
+    spec:
+      pool: mypool  # RADOS pool where ceph-iscsi config data is stored.
+      trusted_ip_list: "IP_ADDRESS_1,IP_ADDRESS_2"
+      api_port: ... # optional
+      api_user: ... # optional
+      api_password: ... # optional
+      api_secure: true/false # optional
+      ssl_cert: | # optional
+        ...
+      ssl_key: | # optional
+        ...
+
+For example:
+
+.. code-block:: yaml
+
+    service_type: iscsi
+    service_id: iscsi
+    placement:
+      hosts:
+      - [...]
+    spec:
+      pool: iscsi_pool
+      trusted_ip_list: "IP_ADDRESS_1,IP_ADDRESS_2,IP_ADDRESS_3,..."
+      api_user: API_USERNAME
+      api_password: API_PASSWORD
+      ssl_cert: |
+        -----BEGIN CERTIFICATE-----
+        MIIDtTCCAp2gAwIBAgIYMC4xNzc1NDQxNjEzMzc2MjMyXzxvQ7EcMA0GCSqGSIb3
+        DQEBCwUAMG0xCzAJBgNVBAYTAlVTMQ0wCwYDVQQIDARVdGFoMRcwFQYDVQQHDA5T
+        [...]
+        -----END CERTIFICATE-----
+      ssl_key: |
+        -----BEGIN PRIVATE KEY-----
+        MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5jdYbjtNTAKW4
+        /CwQr/7wOiLGzVxChn3mmCIF3DwbL/qvTFTX2d8bDf6LjGwLYloXHscRfxszX/4h
+        [...]
+        -----END PRIVATE KEY-----
+
+.. py:currentmodule:: ceph.deployment.service_spec
+
+.. autoclass:: IscsiServiceSpec
+   :members:
+
+
+The specification can then be applied using:
+
+.. prompt:: bash #
+
+   ceph orch apply -i iscsi.yaml
+
+
+See :ref:`orchestrator-cli-placement-spec` for details of the placement specification.
+
+See also: :ref:`orchestrator-cli-service-spec`.
+
+Further Reading
+===============
+
+* RBD: :ref:`ceph-iscsi`
diff --git a/ceph/doc/cephadm/services/mds.rst b/ceph/doc/cephadm/services/mds.rst
new file mode 100644 (file)
index 0000000..949a0fa
--- /dev/null
@@ -0,0 +1,49 @@
+===========
+MDS Service
+===========
+
+
+.. _orchestrator-cli-cephfs:
+
+Deploy CephFS
+=============
+
+One or more MDS daemons is required to use the :term:`CephFS` file system.
+These are created automatically if the newer ``ceph fs volume``
+interface is used to create a new file system. For more information,
+see :ref:`fs-volumes-and-subvolumes`.
+
+For example:
+
+.. prompt:: bash #
+
+  ceph fs volume create <fs_name> --placement="<placement spec>"
+
+where ``fs_name`` is the name of the CephFS and ``placement`` is a
+:ref:`orchestrator-cli-placement-spec`.
+
+For manually deploying MDS daemons, use this specification:
+
+.. code-block:: yaml
+
+    service_type: mds
+    service_id: fs_name
+    placement:
+      count: 3
+
+
+The specification can then be applied using:
+
+.. prompt:: bash #
+
+   ceph orch apply -i mds.yaml
+
+See :ref:`orchestrator-cli-stateless-services` for manually deploying
+MDS daemons on the CLI.
+
+Further Reading
+===============
+
+* :ref:`ceph-file-system`
+
+
diff --git a/ceph/doc/cephadm/services/mgr.rst b/ceph/doc/cephadm/services/mgr.rst
new file mode 100644 (file)
index 0000000..98a5439
--- /dev/null
@@ -0,0 +1,37 @@
+.. _mgr-cephadm-mgr:
+
+===========
+MGR Service
+===========
+
+The cephadm MGR service is hosting different modules, like the :ref:`mgr-dashboard`
+and the cephadm manager module.
+
+.. _cephadm-mgr-networks:
+
+Specifying Networks
+-------------------
+
+The MGR service supports binding only to a specific IP within a network.
+
+example spec file (leveraging a default placement):
+
+.. code-block:: yaml
+
+    service_type: mgr
+    networks:
+    - 192.169.142.0/24
+
+Allow co-location of MGR daemons
+================================
+
+In deployment scenarios with just a single host, cephadm still needs
+to deploy at least two MGR daemons. See ``mgr_standby_modules`` in
+the :ref:`mgr-administrator-guide` for further details.
+
+Further Reading
+===============
+
+* :ref:`ceph-manager-daemon`
+* :ref:`cephadm-manually-deploy-mgr`
+
diff --git a/ceph/doc/cephadm/services/mon.rst b/ceph/doc/cephadm/services/mon.rst
new file mode 100644 (file)
index 0000000..6326b73
--- /dev/null
@@ -0,0 +1,179 @@
+===========
+MON Service
+===========
+
+.. _deploy_additional_monitors:
+
+Deploying additional monitors 
+=============================
+
+A typical Ceph cluster has three or five monitor daemons that are spread
+across different hosts.  We recommend deploying five monitors if there are
+five or more nodes in your cluster.
+
+.. _CIDR: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation
+
+Ceph deploys monitor daemons automatically as the cluster grows and Ceph
+scales back monitor daemons automatically as the cluster shrinks. The
+smooth execution of this automatic growing and shrinking depends upon
+proper subnet configuration.
+
+The cephadm bootstrap procedure assigns the first monitor daemon in the
+cluster to a particular subnet. ``cephadm`` designates that subnet as the
+default subnet of the cluster. New monitor daemons will be assigned by
+default to that subnet unless cephadm is instructed to do otherwise. 
+
+If all of the ceph monitor daemons in your cluster are in the same subnet,
+manual administration of the ceph monitor daemons is not necessary.
+``cephadm`` will automatically add up to five monitors to the subnet, as
+needed, as new hosts are added to the cluster.
+
+By default, cephadm will deploy 5 daemons on arbitrary hosts. See
+:ref:`orchestrator-cli-placement-spec` for details of specifying
+the placement of daemons.
+
+Designating a Particular Subnet for Monitors
+--------------------------------------------
+
+To designate a particular IP subnet for use by ceph monitor daemons, use a
+command of the following form, including the subnet's address in `CIDR`_
+format (e.g., ``10.1.2.0/24``):
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network *<mon-cidr-network>*
+
+  For example:
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network 10.1.2.0/24
+
+Cephadm deploys new monitor daemons only on hosts that have IP addresses in
+the designated subnet.
+
+You can also specify two public networks by using a list of networks:
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network *<mon-cidr-network1>,<mon-cidr-network2>*
+
+  For example:
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network 10.1.2.0/24,192.168.0.1/24
+
+
+Deploying Monitors on a Particular Network 
+------------------------------------------
+
+You can explicitly specify the IP address or CIDR network for each monitor and
+control where each monitor is placed.  To disable automated monitor deployment,
+run this command:
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --unmanaged
+
+  To deploy each additional monitor:
+
+  .. prompt:: bash #
+
+    ceph orch daemon add mon *<host1:ip-or-network1>
+
+  For example, to deploy a second monitor on ``newhost1`` using an IP
+  address ``10.1.2.123`` and a third monitor on ``newhost2`` in
+  network ``10.1.2.0/24``, run the following commands:
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --unmanaged
+    ceph orch daemon add mon newhost1:10.1.2.123
+    ceph orch daemon add mon newhost2:10.1.2.0/24
+
+  Now, enable automatic placement of Daemons
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --placement="newhost1,newhost2,newhost3" --dry-run
+
+  See :ref:`orchestrator-cli-placement-spec` for details of specifying
+  the placement of daemons.
+
+  Finally apply this new placement by dropping ``--dry-run``
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --placement="newhost1,newhost2,newhost3"
+
+
+Moving Monitors to a Different Network
+--------------------------------------
+
+To move Monitors to a new network, deploy new monitors on the new network and
+subsequently remove monitors from the old network. It is not advised to
+modify and inject the ``monmap`` manually.
+
+First, disable the automated placement of daemons:
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --unmanaged
+
+To deploy each additional monitor:
+
+  .. prompt:: bash #
+
+    ceph orch daemon add mon *<newhost1:ip-or-network1>*
+
+For example, to deploy a second monitor on ``newhost1`` using an IP
+address ``10.1.2.123`` and a third monitor on ``newhost2`` in
+network ``10.1.2.0/24``, run the following commands:
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --unmanaged
+    ceph orch daemon add mon newhost1:10.1.2.123
+    ceph orch daemon add mon newhost2:10.1.2.0/24
+
+  Subsequently remove monitors from the old network:
+
+  .. prompt:: bash #
+
+    ceph orch daemon rm *mon.<oldhost1>*
+
+  Update the ``public_network``:
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network *<mon-cidr-network>*
+
+  For example:
+
+  .. prompt:: bash #
+
+     ceph config set mon public_network 10.1.2.0/24
+
+  Now, enable automatic placement of Daemons
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --placement="newhost1,newhost2,newhost3" --dry-run
+
+  See :ref:`orchestrator-cli-placement-spec` for details of specifying
+  the placement of daemons.
+
+  Finally apply this new placement by dropping ``--dry-run``
+
+  .. prompt:: bash #
+
+    ceph orch apply mon --placement="newhost1,newhost2,newhost3" 
+
+Futher Reading
+==============
+
+* :ref:`rados-operations`
+* :ref:`rados-troubleshooting-mon`
+* :ref:`cephadm-restore-quorum`
+
diff --git a/ceph/doc/cephadm/services/monitoring.rst b/ceph/doc/cephadm/services/monitoring.rst
new file mode 100644 (file)
index 0000000..91b8742
--- /dev/null
@@ -0,0 +1,371 @@
+.. _mgr-cephadm-monitoring:
+
+Monitoring Services
+===================
+
+Ceph Dashboard uses `Prometheus <https://prometheus.io/>`_, `Grafana
+<https://grafana.com/>`_, and related tools to store and visualize detailed
+metrics on cluster utilization and performance.  Ceph users have three options:
+
+#. Have cephadm deploy and configure these services.  This is the default
+   when bootstrapping a new cluster unless the ``--skip-monitoring-stack``
+   option is used.
+#. Deploy and configure these services manually.  This is recommended for users
+   with existing prometheus services in their environment (and in cases where
+   Ceph is running in Kubernetes with Rook).
+#. Skip the monitoring stack completely.  Some Ceph dashboard graphs will
+   not be available.
+
+The monitoring stack consists of `Prometheus <https://prometheus.io/>`_,
+Prometheus exporters (:ref:`mgr-prometheus`, `Node exporter
+<https://prometheus.io/docs/guides/node-exporter/>`_), `Prometheus Alert
+Manager <https://prometheus.io/docs/alerting/alertmanager/>`_ and `Grafana
+<https://grafana.com/>`_.
+
+.. note::
+
+  Prometheus' security model presumes that untrusted users have access to the
+  Prometheus HTTP endpoint and logs. Untrusted users have access to all the
+  (meta)data Prometheus collects that is contained in the database, plus a
+  variety of operational and debugging information.
+
+  However, Prometheus' HTTP API is limited to read-only operations.
+  Configurations can *not* be changed using the API and secrets are not
+  exposed. Moreover, Prometheus has some built-in measures to mitigate the
+  impact of denial of service attacks.
+
+  Please see `Prometheus' Security model
+  <https://prometheus.io/docs/operating/security/>` for more detailed
+  information.
+
+Deploying monitoring with cephadm
+---------------------------------
+
+The default behavior of ``cephadm`` is to deploy a basic monitoring stack.  It
+is however possible that you have a Ceph cluster without a monitoring stack,
+and you would like to add a monitoring stack to it. (Here are some ways that
+you might have come to have a Ceph cluster without a monitoring stack: You
+might have passed the ``--skip-monitoring stack`` option to ``cephadm`` during
+the installation of the cluster, or you might have converted an existing
+cluster (which had no monitoring stack) to cephadm management.)
+
+To set up monitoring on a Ceph cluster that has no monitoring, follow the
+steps below:
+
+#. Deploy a node-exporter service on every node of the cluster.  The node-exporter provides host-level metrics like CPU and memory utilization:
+
+   .. prompt:: bash #
+
+     ceph orch apply node-exporter
+
+#. Deploy alertmanager:
+
+   .. prompt:: bash #
+
+     ceph orch apply alertmanager
+
+#. Deploy Prometheus. A single Prometheus instance is sufficient, but
+   for high availablility (HA) you might want to deploy two:
+
+   .. prompt:: bash #
+
+     ceph orch apply prometheus
+
+   or 
+
+   .. prompt:: bash #
+     
+     ceph orch apply prometheus --placement 'count:2'
+
+#. Deploy grafana:
+
+   .. prompt:: bash #
+
+     ceph orch apply grafana
+
+.. _cephadm-monitoring-networks-ports:
+
+Networks and Ports
+~~~~~~~~~~~~~~~~~~
+
+All monitoring services can have the network and port they bind to configured with a yaml service specification
+
+example spec file:
+
+.. code-block:: yaml
+
+    service_type: grafana
+    service_name: grafana
+    placement:
+      count: 1
+    networks:
+    - 192.169.142.0/24
+    spec:
+      port: 4200
+
+Using custom images
+~~~~~~~~~~~~~~~~~~~
+
+It is possible to install or upgrade monitoring components based on other
+images.  To do so, the name of the image to be used needs to be stored in the
+configuration first.  The following configuration options are available.
+
+- ``container_image_prometheus``
+- ``container_image_grafana``
+- ``container_image_alertmanager``
+- ``container_image_node_exporter``
+
+Custom images can be set with the ``ceph config`` command
+
+.. code-block:: bash
+
+     ceph config set mgr mgr/cephadm/<option_name> <value>
+
+For example
+
+.. code-block:: bash
+
+     ceph config set mgr mgr/cephadm/container_image_prometheus prom/prometheus:v1.4.1
+
+If there were already running monitoring stack daemon(s) of the type whose
+image you've changed, you must redeploy the daemon(s) in order to have them
+actually use the new image.
+
+For example, if you had changed the prometheus image
+
+.. prompt:: bash #
+
+     ceph orch redeploy prometheus
+
+
+.. note::
+
+     By setting a custom image, the default value will be overridden (but not
+     overwritten).  The default value changes when updates become available.
+     By setting a custom image, you will not be able to update the component
+     you have set the custom image for automatically.  You will need to
+     manually update the configuration (image name and tag) to be able to
+     install updates.
+
+     If you choose to go with the recommendations instead, you can reset the
+     custom image you have set before.  After that, the default value will be
+     used again.  Use ``ceph config rm`` to reset the configuration option
+
+     .. code-block:: bash
+
+          ceph config rm mgr mgr/cephadm/<option_name>
+
+     For example
+
+     .. code-block:: bash
+
+          ceph config rm mgr mgr/cephadm/container_image_prometheus
+
+Using custom configuration files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By overriding cephadm templates, it is possible to completely customize the
+configuration files for monitoring services.
+
+Internally, cephadm already uses `Jinja2
+<https://jinja.palletsprojects.com/en/2.11.x/>`_ templates to generate the
+configuration files for all monitoring components. To be able to customize the
+configuration of Prometheus, Grafana or the Alertmanager it is possible to store
+a Jinja2 template for each service that will be used for configuration
+generation instead. This template will be evaluated every time a service of that
+kind is deployed or reconfigured. That way, the custom configuration is
+preserved and automatically applied on future deployments of these services.
+
+.. note::
+
+  The configuration of the custom template is also preserved when the default
+  configuration of cephadm changes. If the updated configuration is to be used,
+  the custom template needs to be migrated *manually*.
+
+Option names
+""""""""""""
+
+The following templates for files that will be generated by cephadm can be
+overridden. These are the names to be used when storing with ``ceph config-key
+set``:
+
+- ``services/alertmanager/alertmanager.yml``
+- ``services/grafana/ceph-dashboard.yml``
+- ``services/grafana/grafana.ini``
+- ``services/prometheus/prometheus.yml``
+
+You can look up the file templates that are currently used by cephadm in
+``src/pybind/mgr/cephadm/templates``:
+
+- ``services/alertmanager/alertmanager.yml.j2``
+- ``services/grafana/ceph-dashboard.yml.j2``
+- ``services/grafana/grafana.ini.j2``
+- ``services/prometheus/prometheus.yml.j2``
+
+Usage
+"""""
+
+The following command applies a single line value:
+
+.. code-block:: bash
+
+  ceph config-key set mgr/cephadm/<option_name> <value>
+
+To set contents of files as template use the ``-i`` argument:
+
+.. code-block:: bash
+
+  ceph config-key set mgr/cephadm/<option_name> -i $PWD/<filename>
+
+.. note::
+
+  When using files as input to ``config-key`` an absolute path to the file must
+  be used.
+
+
+Then the configuration file for the service needs to be recreated.
+This is done using `reconfig`. For more details see the following example.
+
+Example
+"""""""
+
+.. code-block:: bash
+
+  # set the contents of ./prometheus.yml.j2 as template
+  ceph config-key set mgr/cephadm/services/prometheus/prometheus.yml \
+    -i $PWD/prometheus.yml.j2
+
+  # reconfig the prometheus service
+  ceph orch reconfig prometheus
+
+Deploying monitoring without cephadm
+------------------------------------
+
+If you have an existing prometheus monitoring infrastructure, or would like
+to manage it yourself, you need to configure it to integrate with your Ceph
+cluster.
+
+* Enable the prometheus module in the ceph-mgr daemon
+
+  .. code-block:: bash
+
+     ceph mgr module enable prometheus
+
+  By default, ceph-mgr presents prometheus metrics on port 9283 on each host
+  running a ceph-mgr daemon.  Configure prometheus to scrape these.
+
+* To enable the dashboard's prometheus-based alerting, see :ref:`dashboard-alerting`.
+
+* To enable dashboard integration with Grafana, see :ref:`dashboard-grafana`.
+
+Disabling monitoring
+--------------------
+
+To disable monitoring and remove the software that supports it, run the following commands:
+
+.. code-block:: console
+
+  $ ceph orch rm grafana
+  $ ceph orch rm prometheus --force   # this will delete metrics data collected so far
+  $ ceph orch rm node-exporter
+  $ ceph orch rm alertmanager
+  $ ceph mgr module disable prometheus
+
+See also :ref:`orch-rm`.
+
+Setting up RBD-Image monitoring
+-------------------------------
+
+Due to performance reasons, monitoring of RBD images is disabled by default. For more information please see
+:ref:`prometheus-rbd-io-statistics`. If disabled, the overview and details dashboards will stay empty in Grafana
+and the metrics will not be visible in Prometheus.
+
+Setting up Grafana
+------------------
+
+Manually setting the Grafana URL
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Cephadm automatically configures Prometheus, Grafana, and Alertmanager in
+all cases except one.
+
+In a some setups, the Dashboard user's browser might not be able to access the
+Grafana URL that is configured in Ceph Dashboard. This can happen when the
+cluster and the accessing user are in different DNS zones.
+
+If this is the case, you can use a configuration option for Ceph Dashboard
+to set the URL that the user's browser will use to access Grafana. This
+value will never be altered by cephadm. To set this configuration option,
+issue the following command:
+
+   .. prompt:: bash $
+
+     ceph dashboard set-grafana-frontend-api-url <grafana-server-api>
+
+It might take a minute or two for services to be deployed. After the
+services have been deployed, you should see something like this when you issue the command ``ceph orch ls``:
+
+.. code-block:: console
+
+  $ ceph orch ls
+  NAME           RUNNING  REFRESHED  IMAGE NAME                                      IMAGE ID        SPEC
+  alertmanager       1/1  6s ago     docker.io/prom/alertmanager:latest              0881eb8f169f  present
+  crash              2/2  6s ago     docker.io/ceph/daemon-base:latest-master-devel  mix           present
+  grafana            1/1  0s ago     docker.io/pcuzner/ceph-grafana-el8:latest       f77afcf0bcf6   absent
+  node-exporter      2/2  6s ago     docker.io/prom/node-exporter:latest             e5a616e4b9cf  present
+  prometheus         1/1  6s ago     docker.io/prom/prometheus:latest                e935122ab143  present
+
+Configuring SSL/TLS for Grafana
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``cephadm`` deploys Grafana using the certificate defined in the ceph
+key/value store. If no certificate is specified, ``cephadm`` generates a
+self-signed certificate during the deployment of the Grafana service.
+
+A custom certificate can be configured using the following commands:
+
+.. prompt:: bash #
+
+  ceph config-key set mgr/cephadm/grafana_key -i $PWD/key.pem
+  ceph config-key set mgr/cephadm/grafana_crt -i $PWD/certificate.pem
+
+If you have already deployed Grafana, run ``reconfig`` on the service to
+update its configuration:
+
+.. prompt:: bash #
+
+  ceph orch reconfig grafana
+
+The ``reconfig`` command also sets the proper URL for Ceph Dashboard.
+
+Setting up Alertmanager
+-----------------------
+
+Adding Alertmanager webhooks
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To add new webhooks to the Alertmanager configuration, add additional
+webhook urls like so:
+
+.. code-block:: yaml
+
+    service_type: alertmanager
+    spec:
+      user_data:
+        default_webhook_urls:
+        - "https://foo"
+        - "https://bar"
+
+Where ``default_webhook_urls`` is a list of additional URLs that are
+added to the default receivers' ``<webhook_configs>`` configuration.
+
+Run ``reconfig`` on the service to update its configuration:
+
+.. prompt:: bash #
+
+  ceph orch reconfig alertmanager
+
+Further Reading
+---------------
+
+* :ref:`mgr-prometheus`
diff --git a/ceph/doc/cephadm/services/nfs.rst b/ceph/doc/cephadm/services/nfs.rst
new file mode 100644 (file)
index 0000000..c48d0f7
--- /dev/null
@@ -0,0 +1,120 @@
+.. _deploy-cephadm-nfs-ganesha:
+
+===========
+NFS Service
+===========
+
+.. note:: Only the NFSv4 protocol is supported.
+
+The simplest way to manage NFS is via the ``ceph nfs cluster ...``
+commands; see :ref:`mgr-nfs`.  This document covers how to manage the
+cephadm services directly, which should only be necessary for unusual NFS
+configurations.
+
+Deploying NFS ganesha
+=====================
+
+Cephadm deploys NFS Ganesha daemon (or set of daemons).  The configuration for
+NFS is stored in the ``nfs-ganesha`` pool and exports are managed via the
+``ceph nfs export ...`` commands and via the dashboard.
+
+To deploy a NFS Ganesha gateway, run the following command:
+
+.. prompt:: bash #
+
+    ceph orch apply nfs *<svc_id>* [--port *<port>*] [--placement ...]
+
+For example, to deploy NFS with a service id of *foo* on the default
+port 2049 with the default placement of a single daemon:
+
+.. prompt:: bash #
+
+   ceph orch apply nfs foo
+
+See :ref:`orchestrator-cli-placement-spec` for the details of the placement
+specification.
+
+Service Specification
+=====================
+
+Alternatively, an NFS service can be applied using a YAML specification. 
+
+.. code-block:: yaml
+
+    service_type: nfs
+    service_id: mynfs
+    placement:
+      hosts:
+        - host1
+        - host2
+    spec:
+      port: 12345
+
+In this example, we run the server on the non-default ``port`` of
+12345 (instead of the default 2049) on ``host1`` and ``host2``.
+
+The specification can then be applied by running the following command:
+
+.. prompt:: bash #
+
+   ceph orch apply -i nfs.yaml
+
+.. _cephadm-ha-nfs:
+
+High-availability NFS
+=====================
+
+Deploying an *ingress* service for an existing *nfs* service will provide:
+
+* a stable, virtual IP that can be used to access the NFS server
+* fail-over between hosts if there is a host failure
+* load distribution across multiple NFS gateways (although this is rarely necessary)
+
+Ingress for NFS can be deployed for an existing NFS service
+(``nfs.mynfs`` in this example) with the following specification:
+
+.. code-block:: yaml
+
+    service_type: ingress
+    service_id: nfs.mynfs
+    placement:
+      count: 2
+    spec:
+      backend_service: nfs.mynfs
+      frontend_port: 2049
+      monitor_port: 9000
+      virtual_ip: 10.0.0.123/24
+
+A few notes:
+
+  * The *virtual_ip* must include a CIDR prefix length, as in the
+    example above.  The virtual IP will normally be configured on the
+    first identified network interface that has an existing IP in the
+    same subnet.  You can also specify a *virtual_interface_networks*
+    property to match against IPs in other networks; see
+    :ref:`ingress-virtual-ip` for more information.
+  * The *monitor_port* is used to access the haproxy load status
+    page.  The user is ``admin`` by default, but can be modified by
+    via an *admin* property in the spec.  If a password is not
+    specified via a *password* property in the spec, the auto-generated password
+    can be found with:
+
+    .. prompt:: bash #
+
+       ceph config-key get mgr/cephadm/ingress.*{svc_id}*/monitor_password
+
+    For example:
+
+    .. prompt:: bash #
+
+       ceph config-key get mgr/cephadm/ingress.nfs.myfoo/monitor_password
+       
+  * The backend service (``nfs.mynfs`` in this example) should include
+    a *port* property that is not 2049 to avoid conflicting with the
+    ingress service, which could be placed on the same host(s).
+
+Further Reading
+===============
+
+* CephFS: :ref:`cephfs-nfs`
+* MGR: :ref:`mgr-nfs`
diff --git a/ceph/doc/cephadm/services/osd.rst b/ceph/doc/cephadm/services/osd.rst
new file mode 100644 (file)
index 0000000..08cf766
--- /dev/null
@@ -0,0 +1,919 @@
+***********
+OSD Service
+***********
+.. _device management: ../rados/operations/devices
+.. _libstoragemgmt: https://github.com/libstorage/libstoragemgmt
+
+List Devices
+============
+
+``ceph-volume`` scans each host in the cluster from time to time in order
+to determine which devices are present and whether they are eligible to be
+used as OSDs.
+
+To print a list of devices discovered by ``cephadm``, run this command:
+
+.. prompt:: bash #
+
+    ceph orch device ls [--hostname=...] [--wide] [--refresh]
+
+Example
+::
+
+  Hostname  Path      Type  Serial              Size   Health   Ident  Fault  Available
+  srv-01    /dev/sdb  hdd   15P0A0YFFRD6         300G  Unknown  N/A    N/A    No
+  srv-01    /dev/sdc  hdd   15R0A08WFRD6         300G  Unknown  N/A    N/A    No
+  srv-01    /dev/sdd  hdd   15R0A07DFRD6         300G  Unknown  N/A    N/A    No
+  srv-01    /dev/sde  hdd   15P0A0QDFRD6         300G  Unknown  N/A    N/A    No
+  srv-02    /dev/sdb  hdd   15R0A033FRD6         300G  Unknown  N/A    N/A    No
+  srv-02    /dev/sdc  hdd   15R0A05XFRD6         300G  Unknown  N/A    N/A    No
+  srv-02    /dev/sde  hdd   15R0A0ANFRD6         300G  Unknown  N/A    N/A    No
+  srv-02    /dev/sdf  hdd   15R0A06EFRD6         300G  Unknown  N/A    N/A    No
+  srv-03    /dev/sdb  hdd   15R0A0OGFRD6         300G  Unknown  N/A    N/A    No
+  srv-03    /dev/sdc  hdd   15R0A0P7FRD6         300G  Unknown  N/A    N/A    No
+  srv-03    /dev/sdd  hdd   15R0A0O7FRD6         300G  Unknown  N/A    N/A    No
+
+Using the ``--wide`` option provides all details relating to the device,
+including any reasons that the device might not be eligible for use as an OSD.
+
+In the above example you can see fields named "Health", "Ident", and "Fault".
+This information is provided by integration with `libstoragemgmt`_. By default,
+this integration is disabled (because `libstoragemgmt`_ may not be 100%
+compatible with your hardware).  To make ``cephadm`` include these fields,
+enable cephadm's "enhanced device scan" option as follows;
+
+.. prompt:: bash #
+
+    ceph config set mgr mgr/cephadm/device_enhanced_scan true
+
+.. warning::
+    Although the libstoragemgmt library performs standard SCSI inquiry calls,
+    there is no guarantee that your firmware fully implements these standards.
+    This can lead to erratic behaviour and even bus resets on some older
+    hardware. It is therefore recommended that, before enabling this feature,
+    you test your hardware's compatibility with libstoragemgmt first to avoid
+    unplanned interruptions to services.
+
+    There are a number of ways to test compatibility, but the simplest may be
+    to use the cephadm shell to call libstoragemgmt directly - ``cephadm shell
+    lsmcli ldl``. If your hardware is supported you should see something like
+    this: 
+
+    ::
+
+      Path     | SCSI VPD 0x83    | Link Type | Serial Number      | Health Status
+      ----------------------------------------------------------------------------
+      /dev/sda | 50000396082ba631 | SAS       | 15P0A0R0FRD6       | Good
+      /dev/sdb | 50000396082bbbf9 | SAS       | 15P0A0YFFRD6       | Good
+
+
+After you have enabled libstoragemgmt support, the output will look something
+like this:
+
+::
+
+  # ceph orch device ls
+  Hostname   Path      Type  Serial              Size   Health   Ident  Fault  Available
+  srv-01     /dev/sdb  hdd   15P0A0YFFRD6         300G  Good     Off    Off    No
+  srv-01     /dev/sdc  hdd   15R0A08WFRD6         300G  Good     Off    Off    No
+  :
+
+In this example, libstoragemgmt has confirmed the health of the drives and the ability to
+interact with the Identification and Fault LEDs on the drive enclosures. For further
+information about interacting with these LEDs, refer to `device management`_.
+
+.. note::
+    The current release of `libstoragemgmt`_ (1.8.8) supports SCSI, SAS, and SATA based
+    local disks only. There is no official support for NVMe devices (PCIe)
+
+.. _cephadm-deploy-osds:
+
+Deploy OSDs
+===========
+
+Listing Storage Devices
+-----------------------
+
+In order to deploy an OSD, there must be a storage device that is *available* on
+which the OSD will be deployed.
+
+Run this command to display an inventory of storage devices on all cluster hosts:
+
+.. prompt:: bash #
+
+  ceph orch device ls
+
+A storage device is considered *available* if all of the following
+conditions are met:
+
+* The device must have no partitions.
+* The device must not have any LVM state.
+* The device must not be mounted.
+* The device must not contain a file system.
+* The device must not contain a Ceph BlueStore OSD.
+* The device must be larger than 5 GB.
+
+Ceph will not provision an OSD on a device that is not available.
+
+Creating New OSDs
+-----------------
+
+There are a few ways to create new OSDs:
+
+* Tell Ceph to consume any available and unused storage device:
+
+  .. prompt:: bash #
+
+    ceph orch apply osd --all-available-devices
+
+* Create an OSD from a specific device on a specific host:
+
+  .. prompt:: bash #
+
+    ceph orch daemon add osd *<host>*:*<device-path>*
+
+  For example:
+
+  .. prompt:: bash #
+
+    ceph orch daemon add osd host1:/dev/sdb
+
+* You can use :ref:`drivegroups` to categorize device(s) based on their
+  properties. This might be useful in forming a clearer picture of which
+  devices are available to consume. Properties include device type (SSD or
+  HDD), device model names, size, and the hosts on which the devices exist:
+
+  .. prompt:: bash #
+
+    ceph orch apply -i spec.yml
+
+Dry Run
+-------
+
+The ``--dry-run`` flag causes the orchestrator to present a preview of what
+will happen without actually creating the OSDs.
+
+For example:
+
+   .. prompt:: bash #
+
+     ceph orch apply osd --all-available-devices --dry-run
+
+   ::
+
+     NAME                  HOST  DATA      DB  WAL
+     all-available-devices node1 /dev/vdb  -   -
+     all-available-devices node2 /dev/vdc  -   -
+     all-available-devices node3 /dev/vdd  -   -
+
+.. _cephadm-osd-declarative:
+
+Declarative State
+-----------------
+
+The effect of ``ceph orch apply`` is persistent. This means that drives that
+are added to the system after the ``ceph orch apply`` command completes will be
+automatically found and added to the cluster.  It also means that drives that
+become available (by zapping, for example) after the ``ceph orch apply``
+command completes will be automatically found and added to the cluster.
+
+We will examine the effects of the following command:
+
+   .. prompt:: bash #
+
+     ceph orch apply osd --all-available-devices
+
+After running the above command: 
+
+* If you add new disks to the cluster, they will automatically be used to
+  create new OSDs.
+* If you remove an OSD and clean the LVM physical volume, a new OSD will be
+  created automatically.
+
+To disable the automatic creation of OSD on available devices, use the
+``unmanaged`` parameter:
+
+If you want to avoid this behavior (disable automatic creation of OSD on available devices), use the ``unmanaged`` parameter:
+
+.. prompt:: bash #
+
+   ceph orch apply osd --all-available-devices --unmanaged=true
+
+.. note::
+
+  Keep these three facts in mind:
+
+  - The default behavior of ``ceph orch apply`` causes cephadm constantly to reconcile. This means that cephadm creates OSDs as soon as new drives are detected.
+
+  - Setting ``unmanaged: True`` disables the creation of OSDs. If ``unmanaged: True`` is set, nothing will happen even if you apply a new OSD service.
+
+  - ``ceph orch daemon add`` creates OSDs, but does not add an OSD service.
+
+* For cephadm, see also :ref:`cephadm-spec-unmanaged`.
+
+.. _cephadm-osd-removal:
+
+Remove an OSD
+=============
+
+Removing an OSD from a cluster involves two steps:
+
+#. evacuating all placement groups (PGs) from the cluster
+#. removing the PG-free OSD from the cluster
+
+The following command performs these two steps:
+
+.. prompt:: bash #
+
+  ceph orch osd rm <osd_id(s)> [--replace] [--force]
+
+Example:
+
+.. prompt:: bash #
+
+  ceph orch osd rm 0
+
+Expected output::
+
+   Scheduled OSD(s) for removal
+
+OSDs that are not safe to destroy will be rejected.
+
+Monitoring OSD State
+--------------------
+
+You can query the state of OSD operation with the following command:
+
+.. prompt:: bash #
+
+   ceph orch osd rm status
+
+Expected output::
+
+    OSD_ID  HOST         STATE                    PG_COUNT  REPLACE  FORCE  STARTED_AT
+    2       cephadm-dev  done, waiting for purge  0         True     False  2020-07-17 13:01:43.147684
+    3       cephadm-dev  draining                 17        False    True   2020-07-17 13:01:45.162158
+    4       cephadm-dev  started                  42        False    True   2020-07-17 13:01:45.162158
+
+
+When no PGs are left on the OSD, it will be decommissioned and removed from the cluster.
+
+.. note::
+    After removing an OSD, if you wipe the LVM physical volume in the device used by the removed OSD, a new OSD will be created.
+    For more information on this, read about the ``unmanaged`` parameter in :ref:`cephadm-osd-declarative`.
+
+Stopping OSD Removal
+--------------------
+
+It is possible to stop queued OSD removals by using the following command:
+
+.. prompt:: bash #
+
+  ceph orch osd rm stop <osd_id(s)>
+
+Example:
+
+.. prompt:: bash #
+
+    ceph orch osd rm stop 4
+
+Expected output::
+
+    Stopped OSD(s) removal
+
+This resets the initial state of the OSD and takes it off the removal queue.
+
+
+Replacing an OSD
+----------------
+
+.. prompt:: bash #
+
+  orch osd rm <osd_id(s)> --replace [--force]
+
+Example:
+
+.. prompt:: bash #
+
+  ceph orch osd rm 4 --replace
+
+Expected output::
+
+   Scheduled OSD(s) for replacement
+
+This follows the same procedure as the procedure in the "Remove OSD" section, with
+one exception: the OSD is not permanently removed from the CRUSH hierarchy, but is
+instead assigned a 'destroyed' flag.
+
+.. note::
+    The new OSD that will replace the removed OSD must be created on the same host 
+    as the OSD that was removed.
+
+**Preserving the OSD ID**
+
+The 'destroyed' flag is used to determine which OSD ids will be reused in the
+next OSD deployment.
+
+If you use OSDSpecs for OSD deployment, your newly added disks will be assigned
+the OSD ids of their replaced counterparts. This assumes that the new disks
+still match the OSDSpecs.
+
+Use the ``--dry-run`` flag to make certain that the ``ceph orch apply osd`` 
+command does what you want it to. The ``--dry-run`` flag shows you what the
+outcome of the command will be without making the changes you specify. When
+you are satisfied that the command will do what you want, run the command
+without the ``--dry-run`` flag.
+
+.. tip::
+
+  The name of your OSDSpec can be retrieved with the command ``ceph orch ls``
+
+Alternatively, you can use your OSDSpec file:
+
+.. prompt:: bash #
+
+  ceph orch apply osd -i <osd_spec_file> --dry-run
+
+Expected output::
+
+  NAME                  HOST  DATA     DB WAL
+  <name_of_osd_spec>    node1 /dev/vdb -  -
+
+
+When this output reflects your intention, omit the ``--dry-run`` flag to
+execute the deployment.
+
+
+Erasing Devices (Zapping Devices)
+---------------------------------
+
+Erase (zap) a device so that it can be reused. ``zap`` calls ``ceph-volume
+zap`` on the remote host.
+
+.. prompt:: bash #
+
+  ceph orch device zap <hostname> <path>
+
+Example command:
+
+.. prompt:: bash #
+
+  ceph orch device zap my_hostname /dev/sdx
+
+.. note::
+    If the unmanaged flag is unset, cephadm automatically deploys drives that
+    match the OSDSpec.  For example, if you use the
+    ``all-available-devices`` option when creating OSDs, when you ``zap`` a
+    device the cephadm orchestrator automatically creates a new OSD in the
+    device.  To disable this behavior, see :ref:`cephadm-osd-declarative`.
+
+
+.. _osd_autotune:
+
+Automatically tuning OSD memory
+===============================
+
+OSD daemons will adjust their memory consumption based on the
+``osd_memory_target`` config option (several gigabytes, by
+default).  If Ceph is deployed on dedicated nodes that are not sharing
+memory with other services, cephadm can automatically adjust the per-OSD
+memory consumption based on the total amount of RAM and the number of deployed
+OSDs.
+
+This option is enabled globally with::
+
+  ceph config set osd osd_memory_target_autotune true
+
+Cephadm will start with a fraction
+(``mgr/cephadm/autotune_memory_target_ratio``, which defaults to
+``.7``) of the total RAM in the system, subtract off any memory
+consumed by non-autotuned daemons (non-OSDs, for OSDs for which
+``osd_memory_target_autotune`` is false), and then divide by the
+remaining OSDs.
+
+The final targets are reflected in the config database with options like::
+
+  WHO   MASK      LEVEL   OPTION              VALUE
+  osd   host:foo  basic   osd_memory_target   126092301926
+  osd   host:bar  basic   osd_memory_target   6442450944
+
+Both the limits and the current memory consumed by each daemon are visible from
+the ``ceph orch ps`` output in the ``MEM LIMIT`` column::
+
+  NAME        HOST  PORTS  STATUS         REFRESHED  AGE  MEM USED  MEM LIMIT  VERSION                IMAGE ID      CONTAINER ID  
+  osd.1       dael         running (3h)     10s ago   3h    72857k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  9e183363d39c  
+  osd.2       dael         running (81m)    10s ago  81m    63989k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  1f0cc479b051  
+  osd.3       dael         running (62m)    10s ago  62m    64071k     117.4G  17.0.0-3781-gafaed750  7015fda3cd67  ac5537492f27  
+
+To exclude an OSD from memory autotuning, disable the autotune option
+for that OSD and also set a specific memory target.  For example,
+
+  .. prompt:: bash #
+
+    ceph config set osd.123 osd_memory_target_autotune false
+    ceph config set osd.123 osd_memory_target 16G
+
+
+.. _drivegroups:
+
+Advanced OSD Service Specifications
+===================================
+
+:ref:`orchestrator-cli-service-spec`\s of type ``osd`` are a way to describe a
+cluster layout, using the properties of disks. Service specifications give the
+user an abstract way to tell Ceph which disks should turn into OSDs with which
+configurations, without knowing the specifics of device names and paths.
+
+Service specifications make it possible to define a yaml or json file that can
+be used to reduce the amount of manual work involved in creating OSDs.
+
+For example, instead of running the following command:
+
+.. prompt:: bash [monitor.1]#
+
+  ceph orch daemon add osd *<host>*:*<path-to-device>*
+
+for each device and each host, we can define a yaml or json file that allows us
+to describe the layout. Here's the most basic example.
+
+Create a file called (for example) ``osd_spec.yml``:
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: default_drive_group  # custom name of the osd spec
+    placement:
+      host_pattern: '*'              # which hosts to target
+    spec:
+      data_devices:                  # the type of devices you are applying specs to
+        all: true                    # a filter, check below for a full list
+
+This means :
+
+#. Turn any available device (ceph-volume decides what 'available' is) into an
+   OSD on all hosts that match the glob pattern '*'. (The glob pattern matches
+   against the registered hosts from `host ls`) A more detailed section on
+   host_pattern is available below.
+
+#. Then pass it to `osd create` like this:
+
+   .. prompt:: bash [monitor.1]#
+
+     ceph orch apply osd -i /path/to/osd_spec.yml
+
+   This instruction will be issued to all the matching hosts, and will deploy
+   these OSDs.
+
+   Setups more complex than the one specified by the ``all`` filter are
+   possible. See :ref:`osd_filters` for details.
+
+   A ``--dry-run`` flag can be passed to the ``apply osd`` command to display a
+   synopsis of the proposed layout.
+
+Example
+
+.. prompt:: bash [monitor.1]#
+
+   ceph orch apply osd -i /path/to/osd_spec.yml --dry-run
+
+
+
+.. _osd_filters:
+
+Filters
+-------
+
+.. note::
+   Filters are applied using an `AND` gate by default. This means that a drive
+   must fulfill all filter criteria in order to get selected. This behavior can
+   be adjusted by setting ``filter_logic: OR`` in the OSD specification. 
+
+Filters are used to assign disks to groups, using their attributes to group
+them. 
+
+The attributes are based off of ceph-volume's disk query. You can retrieve
+information about the attributes with this command:
+
+.. code-block:: bash
+
+  ceph-volume inventory </path/to/disk>
+
+Vendor or Model
+^^^^^^^^^^^^^^^
+
+Specific disks can be targeted by vendor or model:
+
+.. code-block:: yaml
+
+    model: disk_model_name
+
+or
+
+.. code-block:: yaml
+
+    vendor: disk_vendor_name
+
+
+Size
+^^^^
+
+Specific disks can be targeted by `Size`:
+
+.. code-block:: yaml
+
+    size: size_spec
+
+Size specs
+__________
+
+Size specifications can be of the following forms:
+
+* LOW:HIGH
+* :HIGH
+* LOW:
+* EXACT
+
+Concrete examples:
+
+To include disks of an exact size
+
+.. code-block:: yaml
+
+    size: '10G'
+
+To include disks within a given range of size: 
+
+.. code-block:: yaml
+
+    size: '10G:40G'
+
+To include disks that are less than or equal to 10G in size:
+
+.. code-block:: yaml
+
+    size: ':10G'
+
+To include disks equal to or greater than 40G in size:
+
+.. code-block:: yaml
+
+    size: '40G:'
+
+Sizes don't have to be specified exclusively in Gigabytes(G).
+
+Other units of size are supported: Megabyte(M), Gigabyte(G) and Terrabyte(T).
+Appending the (B) for byte is also supported: ``MB``, ``GB``, ``TB``.
+
+
+Rotational
+^^^^^^^^^^
+
+This operates on the 'rotational' attribute of the disk.
+
+.. code-block:: yaml
+
+    rotational: 0 | 1
+
+`1` to match all disks that are rotational
+
+`0` to match all disks that are non-rotational (SSD, NVME etc)
+
+
+All
+^^^
+
+This will take all disks that are 'available'
+
+.. note:: This is exclusive for the data_devices section.
+
+.. code-block:: yaml
+
+    all: true
+
+
+Limiter
+^^^^^^^
+
+If you have specified some valid filters but want to limit the number of disks that they match, use the ``limit`` directive:
+
+.. code-block:: yaml
+
+    limit: 2
+
+For example, if you used `vendor` to match all disks that are from `VendorA`
+but want to use only the first two, you could use `limit`:
+
+.. code-block:: yaml
+
+  data_devices:
+    vendor: VendorA
+    limit: 2
+
+.. note:: `limit` is a last resort and shouldn't be used if it can be avoided.
+
+
+Additional Options
+------------------
+
+There are multiple optional settings you can use to change the way OSDs are deployed.
+You can add these options to the base level of an OSD spec for it to take effect.
+
+This example would deploy all OSDs with encryption enabled.
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: example_osd_spec
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        all: true
+      encrypted: true
+
+See a full list in the DriveGroupSpecs
+
+.. py:currentmodule:: ceph.deployment.drive_group
+
+.. autoclass:: DriveGroupSpec
+   :members:
+   :exclude-members: from_json
+
+Examples
+========
+
+The simple case
+---------------
+
+All nodes with the same setup
+
+.. code-block:: none
+
+    20 HDDs
+    Vendor: VendorA
+    Model: HDD-123-foo
+    Size: 4TB
+
+    2 SSDs
+    Vendor: VendorB
+    Model: MC-55-44-ZX
+    Size: 512GB
+
+This is a common setup and can be described quite easily:
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_spec_default
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        model: HDD-123-foo # Note, HDD-123 would also be valid
+      db_devices:
+        model: MC-55-44-XZ # Same here, MC-55-44 is valid
+
+However, we can improve it by reducing the filters on core properties of the drives:
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_spec_default
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        rotational: 1
+      db_devices:
+        rotational: 0
+
+Now, we enforce all rotating devices to be declared as 'data devices' and all non-rotating devices will be used as shared_devices (wal, db)
+
+If you know that drives with more than 2TB will always be the slower data devices, you can also filter by size:
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_spec_default
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        size: '2TB:'
+      db_devices:
+        size: ':2TB'
+
+.. note:: All of the above OSD specs  are equally valid. Which of those you want to use depends on taste and on how much you expect your node layout to change.
+
+
+Multiple OSD specs for a single host
+------------------------------------
+
+Here we have two distinct setups
+
+.. code-block:: none
+
+    20 HDDs
+    Vendor: VendorA
+    Model: HDD-123-foo
+    Size: 4TB
+
+    12 SSDs
+    Vendor: VendorB
+    Model: MC-55-44-ZX
+    Size: 512GB
+
+    2 NVMEs
+    Vendor: VendorC
+    Model: NVME-QQQQ-987
+    Size: 256GB
+
+
+* 20 HDDs should share 2 SSDs
+* 10 SSDs should share 2 NVMes
+
+This can be described with two layouts.
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_spec_hdd
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        rotational: 0
+      db_devices:
+        model: MC-55-44-XZ
+        limit: 2 # db_slots is actually to be favoured here, but it's not implemented yet
+    ---
+    service_type: osd
+    service_id: osd_spec_ssd
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        model: MC-55-44-XZ
+      db_devices:
+        vendor: VendorC
+
+This would create the desired layout by using all HDDs as data_devices with two SSD assigned as dedicated db/wal devices.
+The remaining SSDs(8) will be data_devices that have the 'VendorC' NVMEs assigned as dedicated db/wal devices.
+
+Multiple hosts with the same disk layout
+----------------------------------------
+
+Assuming the cluster has different kinds of hosts each with similar disk 
+layout, it is recommended to apply different OSD specs matching only one
+set of hosts. Typically you will have a spec for multiple hosts with the 
+same layout. 
+
+The sevice id as the unique key: In case a new OSD spec with an already
+applied service id is applied, the existing OSD spec will be superseeded.
+cephadm will now create new OSD daemons based on the new spec
+definition. Existing OSD daemons will not be affected. See :ref:`cephadm-osd-declarative`.
+
+Node1-5
+
+.. code-block:: none
+
+    20 HDDs
+    Vendor: Intel
+    Model: SSD-123-foo
+    Size: 4TB
+    2 SSDs
+    Vendor: VendorA
+    Model: MC-55-44-ZX
+    Size: 512GB
+
+Node6-10
+
+.. code-block:: none
+
+    5 NVMEs
+    Vendor: Intel
+    Model: SSD-123-foo
+    Size: 4TB
+    20 SSDs
+    Vendor: VendorA
+    Model: MC-55-44-ZX
+    Size: 512GB
+
+You can use the 'placement' key in the layout to target certain nodes.
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: disk_layout_a
+    placement:
+      label: disk_layout_a
+    spec:
+      data_devices:
+        rotational: 1
+      db_devices:
+        rotational: 0
+    ---
+    service_type: osd
+    service_id: disk_layout_b
+    placement:
+      label: disk_layout_b
+    spec:
+      data_devices:
+        model: MC-55-44-XZ
+      db_devices:
+        model: SSD-123-foo
+
+This applies different OSD specs to different hosts depending on the `placement` key.
+See :ref:`orchestrator-cli-placement-spec`
+
+.. note::
+
+   Assuming each host has a unique disk layout, each OSD 
+   spec needs to have a different service id
+
+
+Dedicated wal + db
+------------------
+
+All previous cases co-located the WALs with the DBs.
+It's however possible to deploy the WAL on a dedicated device as well, if it makes sense.
+
+.. code-block:: none
+
+    20 HDDs
+    Vendor: VendorA
+    Model: SSD-123-foo
+    Size: 4TB
+
+    2 SSDs
+    Vendor: VendorB
+    Model: MC-55-44-ZX
+    Size: 512GB
+
+    2 NVMEs
+    Vendor: VendorC
+    Model: NVME-QQQQ-987
+    Size: 256GB
+
+
+The OSD spec for this case would look like the following (using the `model` filter):
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_spec_default
+    placement:
+      host_pattern: '*'
+    spec:
+      data_devices:
+        model: MC-55-44-XZ
+      db_devices:
+        model: SSD-123-foo
+      wal_devices:
+        model: NVME-QQQQ-987
+
+
+It is also possible to specify directly device paths in specific hosts like the following:
+
+.. code-block:: yaml
+
+    service_type: osd
+    service_id: osd_using_paths
+    placement:
+      hosts:
+        - Node01
+        - Node02
+    spec:
+      data_devices:
+        paths:
+        - /dev/sdb
+      db_devices:
+        paths:
+        - /dev/sdc
+      wal_devices:
+        paths:
+        - /dev/sdd
+
+
+This can easily be done with other filters, like `size` or `vendor` as well.
+
+.. _cephadm-osd-activate:
+
+Activate existing OSDs
+======================
+
+In case the OS of a host was reinstalled, existing OSDs need to be activated
+again. For this use case, cephadm provides a wrapper for :ref:`ceph-volume-lvm-activate` that
+activates all existing OSDs on a host.
+
+.. prompt:: bash #
+
+   ceph cephadm osd activate <host>...
+
+This will scan all existing disks for OSDs and deploy corresponding daemons.
+
+Futher Reading
+==============
+
+* :ref:`ceph-volume`
+* :ref:`rados-index`
diff --git a/ceph/doc/cephadm/services/rgw.rst b/ceph/doc/cephadm/services/rgw.rst
new file mode 100644 (file)
index 0000000..4701713
--- /dev/null
@@ -0,0 +1,289 @@
+===========
+RGW Service
+===========
+
+.. _cephadm-deploy-rgw:
+
+Deploy RGWs
+===========
+
+Cephadm deploys radosgw as a collection of daemons that manage a
+single-cluster deployment or a particular *realm* and *zone* in a
+multisite deployment.  (For more information about realms and zones,
+see :ref:`multisite`.)
+
+Note that with cephadm, radosgw daemons are configured via the monitor
+configuration database instead of via a `ceph.conf` or the command line.  If
+that configuration isn't already in place (usually in the
+``client.rgw.<something>`` section), then the radosgw
+daemons will start up with default settings (e.g., binding to port
+80).
+
+To deploy a set of radosgw daemons, with an arbitrary service name
+*name*, run the following command:
+
+.. prompt:: bash #
+
+  ceph orch apply rgw *<name>* [--realm=*<realm-name>*] [--zone=*<zone-name>*] --placement="*<num-daemons>* [*<host1>* ...]"
+
+Trivial setup
+-------------
+
+For example, to deploy 2 RGW daemons (the default) for a single-cluster RGW deployment
+under the arbitrary service id *foo*:
+
+.. prompt:: bash #
+
+   ceph orch apply rgw foo
+
+Designated gateways
+-------------------
+
+A common scenario is to have a labeled set of hosts that will act
+as gateways, with multiple instances of radosgw running on consecutive
+ports 8000 and 8001:
+
+.. prompt:: bash #
+
+   ceph orch host label add gwhost1 rgw  # the 'rgw' label can be anything
+   ceph orch host label add gwhost2 rgw
+   ceph orch apply rgw foo '--placement=label:rgw count-per-host:2' --port=8000
+
+.. _cephadm-rgw-networks:
+
+Specifying Networks
+-------------------
+
+The RGW service can have the network they bind to configured with a yaml service specification.
+
+example spec file:
+
+.. code-block:: yaml
+
+    service_type: rgw
+    service_name: foo
+    placement:
+      label: rgw
+      count-per-host: 2
+    networks:
+    - 192.169.142.0/24
+    spec:
+      port: 8000
+
+
+Multisite zones
+---------------
+
+To deploy RGWs serving the multisite *myorg* realm and the *us-east-1* zone on
+*myhost1* and *myhost2*:
+
+.. prompt:: bash #
+
+   ceph orch apply rgw east --realm=myorg --zone=us-east-1 --placement="2 myhost1 myhost2"
+
+Note that in a multisite situation, cephadm only deploys the daemons.  It does not create
+or update the realm or zone configurations.  To create a new realm and zone, you need to do
+something like:
+
+.. prompt:: bash #
+
+  radosgw-admin realm create --rgw-realm=<realm-name> --default
+  
+.. prompt:: bash #
+
+  radosgw-admin zonegroup create --rgw-zonegroup=<zonegroup-name>  --master --default
+
+.. prompt:: bash #
+
+  radosgw-admin zone create --rgw-zonegroup=<zonegroup-name> --rgw-zone=<zone-name> --master --default
+
+.. prompt:: bash #
+
+  radosgw-admin period update --rgw-realm=<realm-name> --commit
+
+See :ref:`orchestrator-cli-placement-spec` for details of the placement
+specification.  See :ref:`multisite` for more information of setting up multisite RGW.
+
+See also :ref:`multisite`.
+
+Setting up HTTPS
+----------------
+
+In order to enable HTTPS for RGW services, apply a spec file following this scheme:
+
+.. code-block:: yaml
+
+  service_type: rgw
+  service_id: myrgw
+  spec:
+    rgw_frontend_ssl_certificate: | 
+      -----BEGIN PRIVATE KEY-----
+      V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt
+      ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15
+      IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu
+      YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg
+      ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=
+      -----END PRIVATE KEY-----
+      -----BEGIN CERTIFICATE-----
+      V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt
+      ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15
+      IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu
+      YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg
+      ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=
+      -----END CERTIFICATE-----
+    ssl: true
+
+Then apply this yaml document:
+
+.. prompt:: bash #
+
+  ceph orch apply -i myrgw.yaml
+
+Note the value of ``rgw_frontend_ssl_certificate`` is a literal string as
+indicated by a ``|`` character preserving newline characters.
+
+Service specification
+---------------------
+
+.. py:currentmodule:: ceph.deployment.service_spec
+
+.. autoclass:: RGWSpec
+   :members:
+
+.. _orchestrator-haproxy-service-spec:
+
+High availability service for RGW
+=================================
+
+The *ingress* service allows you to create a high availability endpoint
+for RGW with a minumum set of configuration options.  The orchestrator will
+deploy and manage a combination of haproxy and keepalived to provide load
+balancing on a floating virtual IP.
+
+If SSL is used, then SSL must be configured and terminated by the ingress service
+and not RGW itself.
+
+.. image:: ../../images/HAProxy_for_RGW.svg
+
+There are N hosts where the ingress service is deployed.  Each host
+has a haproxy daemon and a keepalived daemon.  A virtual IP is
+automatically configured on only one of these hosts at a time.
+
+Each keepalived daemon checks every few seconds whether the haproxy
+daemon on the same host is responding.  Keepalived will also check
+that the master keepalived daemon is running without problems.  If the
+"master" keepalived daemon or the active haproxy is not responding,
+one of the remaining keepalived daemons running in backup mode will be
+elected as master, and the virtual IP will be moved to that node.
+
+The active haproxy acts like a load balancer, distributing all RGW requests
+between all the RGW daemons available.
+
+Prerequisites
+-------------
+
+* An existing RGW service, without SSL.  (If you want SSL service, the certificate
+  should be configured on the ingress service, not the RGW service.)
+
+Deploying
+---------
+
+Use the command::
+
+    ceph orch apply -i <ingress_spec_file>
+
+Service specification
+---------------------
+
+It is a yaml format file with the following properties:
+
+.. code-block:: yaml
+
+    service_type: ingress
+    service_id: rgw.something    # adjust to match your existing RGW service
+    placement:
+      hosts:
+        - host1
+        - host2
+        - host3
+    spec:
+      backend_service: rgw.something      # adjust to match your existing RGW service
+      virtual_ip: <string>/<string>       # ex: 192.168.20.1/24
+      frontend_port: <integer>            # ex: 8080
+      monitor_port: <integer>             # ex: 1967, used by haproxy for load balancer status
+      virtual_interface_networks: [ ... ] # optional: list of CIDR networks
+      ssl_cert: |                         # optional: SSL certificate and key
+        -----BEGIN CERTIFICATE-----
+        ...
+        -----END CERTIFICATE-----
+        -----BEGIN PRIVATE KEY-----
+        ...
+        -----END PRIVATE KEY-----
+
+where the properties of this service specification are:
+
+* ``service_type``
+    Mandatory and set to "ingress"
+* ``service_id``
+    The name of the service.  We suggest naming this after the service you are
+    controlling ingress for (e.g., ``rgw.foo``).
+* ``placement hosts``
+    The hosts where it is desired to run the HA daemons. An haproxy and a
+    keepalived container will be deployed on these hosts.  These hosts do not need
+    to match the nodes where RGW is deployed.
+* ``virtual_ip``
+    The virtual IP (and network) in CIDR format where the ingress service will be available.
+* ``virtual_interface_networks``
+    A list of networks to identify which ethernet interface to use for the virtual IP.
+* ``frontend_port``
+    The port used to access the ingress service.
+* ``ssl_cert``:
+    SSL certificate, if SSL is to be enabled. This must contain the both the certificate and
+    private key blocks in .pem format.
+
+.. _ingress-virtual-ip:
+
+Selecting ethernet interfaces for the virtual IP
+------------------------------------------------
+
+You cannot simply provide the name of the network interface on which
+to configure the virtual IP because interface names tend to vary
+across hosts (and/or reboots).  Instead, cephadm will select
+interfaces based on other existing IP addresses that are already
+configured.
+
+Normally, the virtual IP will be configured on the first network
+interface that has an existing IP in the same subnet.  For example, if
+the virtual IP is 192.168.0.80/24 and eth2 has the static IP
+192.168.0.40/24, cephadm will use eth2.
+
+In some cases, the virtual IP may not belong to the same subnet as an existing static
+IP.  In such cases, you can provide a list of subnets to match against existing IPs,
+and cephadm will put the virtual IP on the first network interface to match.  For example,
+if the virtual IP is 192.168.0.80/24 and we want it on the same interface as the machine's
+static IP in 10.10.0.0/16, you can use a spec like::
+
+  service_type: ingress
+  service_id: rgw.something
+  spec:
+    virtual_ip: 192.168.0.80/24
+    virtual_interface_networks:
+      - 10.10.0.0/16
+    ...
+
+A consequence of this strategy is that you cannot currently configure the virtual IP
+on an interface that has no existing IP address.  In this situation, we suggest
+configuring a "dummy" IP address is an unroutable network on the correct interface
+and reference that dummy network in the networks list (see above).
+
+
+Useful hints for ingress
+------------------------
+
+* It is good to have at least 3 RGW daemons.
+* We recommend at least 3 hosts for the ingress service.
+
+Further Reading
+===============
+
+* :ref:`object-gateway`
index 1b6764dd7628fab9be54c68ab80e00edb1fed35d..4ce76ee8166af1d458886275add75b884e3aab9d 100644 (file)
@@ -252,6 +252,30 @@ To access the admin socket, first enter the daemon container on the host::
     [root@mon1 ~]# cephadm enter --name <daemon-name>
     [ceph: root@mon1 /]# ceph --admin-daemon /var/run/ceph/ceph-<daemon-name>.asok config show
 
+Calling miscellaneous ceph tools
+--------------------------------
+
+To call miscellaneous like ``ceph-objectstore-tool`` or 
+``ceph-monstore-tool``, you can run them by calling 
+``cephadm shell --name <daemon-name>`` like so::
+
+    root@myhostname # cephadm unit --name mon.myhostname stop
+    root@myhostname # cephadm shell --name mon.myhostname
+    [ceph: root@myhostname /]# ceph-monstore-tool /var/lib/ceph/mon/ceph-myhostname get monmap > monmap         
+    [ceph: root@myhostname /]# monmaptool --print monmap
+    monmaptool: monmap file monmap
+    epoch 1
+    fsid 28596f44-3b56-11ec-9034-482ae35a5fbb
+    last_changed 2021-11-01T20:57:19.755111+0000
+    created 2021-11-01T20:57:19.755111+0000
+    min_mon_release 17 (quincy)
+    election_strategy: 1
+    0: [v2:127.0.0.1:3300/0,v1:127.0.0.1:6789/0] mon.myhostname
+
+This command sets up the environment in a way that is suitable
+for extended daemon maintenance and running the deamon interactively. 
+
+.. _cephadm-restore-quorum:
 
 Restoring the MON quorum
 ------------------------
@@ -275,6 +299,7 @@ form the monmap by following these steps:
 
 3. Follow the steps in :ref:`rados-mon-remove-from-unhealthy`
 
+.. _cephadm-manually-deploy-mgr:
 
 Manually deploying a MGR daemon
 -------------------------------
index dd6bd875977dd6d6196075fdddd6fd6fe1c27b7b..429f4f2803e04650677e0a4fcc858aad4db0235f 100644 (file)
@@ -37,12 +37,20 @@ To upgrade (or downgrade) to a specific release, run the following command:
 
   ceph orch upgrade start --ceph-version <version>
 
-For example, to upgrade to v15.2.1, run the following command:
+For example, to upgrade to v16.2.6, run the following command:
 
 .. prompt:: bash #
 
   ceph orch upgrade start --ceph-version 15.2.1
 
+.. note::
+
+    From version v16.2.6 the Docker Hub registry is no longer used, so if you use Docker you have to point it to the image in the quay.io registry:
+
+.. prompt:: bash #
+
+  ceph orch upgrade start --image quay.io/ceph/ceph:v16.2.6
+
 
 Monitoring the upgrade
 ======================
index e485ea3fef51028edfa310b01275b28f519999b5..3dbaa5d1aa855cd71915f2605baa7e5a6c658dde 100644 (file)
@@ -165,7 +165,7 @@ Mirroring Status
 
 CephFS mirroring module provides `mirror daemon status` interface to check mirror daemon status::
 
-  $ ceph fs snapshot mirror daemon status <fs_name>
+  $ ceph fs snapshot mirror daemon status
   [
     {
       "daemon_id": 284167,
index 244d78bda12a54e1bff2d470e8df42fb110a3fa9..a24fc56b0dc2a75835f7cb73fedcbc5a535fd937 100644 (file)
@@ -36,7 +36,7 @@ Options :
 
 .. code:: bash
 
-    [build]$ virtualenv -p python3 venv && source venv/bin/activate && pip3 install cmd2
+    [build]$ python3 -m venv venv && source venv/bin/activate && pip3 install cmd2
     [build]$ source vstart_environment.sh && source venv/bin/activate && python3 ../src/tools/cephfs/cephfs-shell
 
 Commands
diff --git a/ceph/doc/cephfs/fs-nfs-exports.rst b/ceph/doc/cephfs/fs-nfs-exports.rst
deleted file mode 100644 (file)
index 1a95a1c..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-.. _cephfs-nfs:
-
-=======================
-CephFS Exports over NFS
-=======================
-
-CephFS namespaces can be exported over NFS protocol using the `NFS-Ganesha NFS server`_
-
-Requirements
-============
-
--  Latest Ceph file system with mgr enabled
--  ``nfs-ganesha``, ``nfs-ganesha-ceph``, ``nfs-ganesha-rados-grace`` and
-   ``nfs-ganesha-rados-urls`` packages (version 3.3 and above)
-
-.. note:: From Pacific, the nfs mgr module must be enabled prior to use.
-
-Ganesha Configuration Hierarchy
-===============================
-
-Cephadm and rook starts nfs-ganesha daemon with `bootstrap configuration`
-containing minimal ganesha configuration, creates empty rados `common config`
-object in `nfs-ganesha` pool and watches this config object. The `mgr/nfs`
-module adds rados export object urls to the common config object. If cluster
-config is set, it creates `user config` object containing custom ganesha
-configuration and adds it url to common config object.
-
-.. ditaa::
-
-
-                             rados://$pool/$namespace/export-$i        rados://$pool/$namespace/userconf-nfs.$cluster_id
-                                      (export config)                          (user config)
-
-                        +----------+    +----------+    +----------+      +---------------------------+
-                        |          |    |          |    |          |      |                           |
-                        | export-1 |    | export-2 |    | export-3 |      | userconf-nfs.$cluster_id  |
-                        |          |    |          |    |          |      |                           |
-                        +----+-----+    +----+-----+    +-----+----+      +-------------+-------------+
-                             ^               ^                ^                         ^
-                             |               |                |                         |
-                             +--------------------------------+-------------------------+
-                                        %url |
-                                             |
-                                    +--------+--------+
-                                    |                 |  rados://$pool/$namespace/conf-nfs.$svc
-                                    |  conf+nfs.$svc  |  (common config)
-                                    |                 |
-                                    +--------+--------+
-                                             ^
-                                             |
-                                   watch_url |
-                     +----------------------------------------------+
-                     |                       |                      |
-                     |                       |                      |            RADOS
-             +----------------------------------------------------------------------------------+
-                     |                       |                      |            CONTAINER
-           watch_url |             watch_url |            watch_url |
-                     |                       |                      |
-            +--------+-------+      +--------+-------+      +-------+--------+
-            |                |      |                |      |                |  /etc/ganesha/ganesha.conf
-            |   nfs.$svc.a   |      |   nfs.$svc.b   |      |   nfs.$svc.c   |  (bootstrap config)
-            |                |      |                |      |                |
-            +----------------+      +----------------+      +----------------+
-
-Create NFS Ganesha Cluster
-==========================
-
-.. code:: bash
-
-    $ ceph nfs cluster create <clusterid> [<placement>] [--ingress --virtual-ip <ip>]
-
-This creates a common recovery pool for all NFS Ganesha daemons, new user based on
-``clusterid``, and a common NFS Ganesha config RADOS object.
-
-.. note:: Since this command also brings up NFS Ganesha daemons using a ceph-mgr
-   orchestrator module (see :doc:`/mgr/orchestrator`) such as "mgr/cephadm", at
-   least one such module must be enabled for it to work.
-
-   Currently, NFS Ganesha daemon deployed by cephadm listens on the standard
-   port. So only one daemon will be deployed on a host.
-
-``<clusterid>`` is an arbitrary string by which this NFS Ganesha cluster will be
-known.
-
-``<placement>`` is an optional string signifying which hosts should have NFS Ganesha
-daemon containers running on them and, optionally, the total number of NFS
-Ganesha daemons on the cluster (should you want to have more than one NFS Ganesha
-daemon running per node). For example, the following placement string means
-"deploy NFS Ganesha daemons on nodes host1 and host2 (one daemon per host)::
-
-    "host1,host2"
-
-and this placement specification says to deploy single NFS Ganesha daemon each
-on nodes host1 and host2 (for a total of two NFS Ganesha daemons in the
-cluster)::
-
-    "2 host1,host2"
-
-To deploy NFS with an HA front-end (virtual IP and load balancer), add the
-``--ingress`` flag and specify a virtual IP address. This will deploy a combination
-of keepalived and haproxy to provide an high-availability NFS frontend for the NFS
-service.
-
-For more details, refer :ref:`orchestrator-cli-placement-spec` but keep
-in mind that specifying the placement via a YAML file is not supported.
-
-Delete NFS Ganesha Cluster
-==========================
-
-.. code:: bash
-
-    $ ceph nfs cluster rm <clusterid>
-
-This deletes the deployed cluster.
-
-List NFS Ganesha Cluster
-========================
-
-.. code:: bash
-
-    $ ceph nfs cluster ls
-
-This lists deployed clusters.
-
-Show NFS Ganesha Cluster Information
-====================================
-
-.. code:: bash
-
-    $ ceph nfs cluster info [<clusterid>]
-
-This displays ip and port of deployed cluster.
-
-.. note:: This will not work with rook backend. Instead expose port with
-   kubectl patch command and fetch the port details with kubectl get services
-   command::
-
-   $ kubectl patch service -n rook-ceph -p '{"spec":{"type": "NodePort"}}' rook-ceph-nfs-<cluster-name>-<node-id>
-   $ kubectl get services -n rook-ceph rook-ceph-nfs-<cluster-name>-<node-id>
-
-Set Customized NFS Ganesha Configuration
-========================================
-
-.. code:: bash
-
-    $ ceph nfs cluster config set <clusterid> -i <config_file>
-
-With this the nfs cluster will use the specified config and it will have
-precedence over default config blocks.
-
-Example use cases
-
-1) Changing log level
-
-  It can be done by adding LOG block in the following way::
-
-   LOG {
-    COMPONENTS {
-        ALL = FULL_DEBUG;
-    }
-   }
-
-2) Adding custom export block
-
-  The following sample block creates a single export. This export will not be
-  managed by `ceph nfs export` interface::
-
-   EXPORT {
-     Export_Id = 100;
-     Transports = TCP;
-     Path = /;
-     Pseudo = /ceph/;
-     Protocols = 4;
-     Access_Type = RW;
-     Attr_Expiration_Time = 0;
-     Squash = None;
-     FSAL {
-       Name = CEPH;
-       Filesystem = "filesystem name";
-       User_Id = "user id";
-       Secret_Access_Key = "secret key";
-     }
-   }
-
-.. note:: User specified in FSAL block should have proper caps for NFS-Ganesha
-   daemons to access ceph cluster. User can be created in following way using
-   `auth get-or-create`::
-
-         # ceph auth get-or-create client.<user_id> mon 'allow r' osd 'allow rw pool=nfs-ganesha namespace=<nfs_cluster_name>, allow rw tag cephfs data=<fs_name>' mds 'allow rw path=<export_path>'
-
-Reset NFS Ganesha Configuration
-===============================
-
-.. code:: bash
-
-    $ ceph nfs cluster config reset <clusterid>
-
-This removes the user defined configuration.
-
-.. note:: With a rook deployment, ganesha pods must be explicitly restarted
-   for the new config blocks to be effective.
-
-Create CephFS Export
-====================
-
-.. warning:: Currently, the nfs interface is not integrated with dashboard. Both
-   dashboard and nfs interface have different export requirements and
-   create exports differently. Management of dashboard created exports is not
-   supported.
-
-.. code:: bash
-
-    $ ceph nfs export create cephfs <fsname> <clusterid> <binding> [--readonly] [--path=/path/in/cephfs]
-
-This creates export RADOS objects containing the export block, where
-
-``<fsname>`` is the name of the FS volume used by the NFS Ganesha cluster
-that will serve this export.
-
-``<clusterid>`` is the NFS Ganesha cluster ID.
-
-``<binding>`` is the pseudo root path (must be an absolute path and unique).
-It specifies the export position within the NFS v4 Pseudo Filesystem.
-
-``<path>`` is the path within cephfs. Valid path should be given and default
-path is '/'. It need not be unique. Subvolume path can be fetched using:
-
-.. code::
-
-   $ ceph fs subvolume getpath <vol_name> <subvol_name> [--group_name <subvol_group_name>]
-
-.. note:: Export creation is supported only for NFS Ganesha clusters deployed using nfs interface.
-
-Delete CephFS Export
-====================
-
-.. code:: bash
-
-    $ ceph nfs export rm <clusterid> <binding>
-
-This deletes an export in an NFS Ganesha cluster, where:
-
-``<clusterid>`` is the NFS Ganesha cluster ID.
-
-``<binding>`` is the pseudo root path (must be an absolute path).
-
-List CephFS Exports
-===================
-
-.. code:: bash
-
-    $ ceph nfs export ls <clusterid> [--detailed]
-
-It lists exports for a cluster, where:
-
-``<clusterid>`` is the NFS Ganesha cluster ID.
-
-With the ``--detailed`` option enabled it shows entire export block.
-
-Get CephFS Export
-=================
-
-.. code:: bash
-
-    $ ceph nfs export get <clusterid> <binding>
-
-This displays export block for a cluster based on pseudo root name (binding),
-where:
-
-``<clusterid>`` is the NFS Ganesha cluster ID.
-
-``<binding>`` is the pseudo root path (must be an absolute path).
-
-
-Update CephFS Export
-====================
-
-.. code:: bash
-
-    $ ceph nfs export update -i <json_file>
-
-This updates the cephfs export specified in the json file. Export in json
-format can be fetched with above get command. For example::
-
-   $ ceph nfs export get vstart /cephfs > update_cephfs_export.json
-   $ cat update_cephfs_export.json
-   {
-     "export_id": 1,
-     "path": "/",
-     "cluster_id": "vstart",
-     "pseudo": "/cephfs",
-     "access_type": "RW",
-     "squash": "no_root_squash",
-     "security_label": true,
-     "protocols": [
-       4
-     ],
-     "transports": [
-       "TCP"
-     ],
-     "fsal": {
-       "name": "CEPH",
-       "user_id": "vstart1",
-       "fs_name": "a",
-       "sec_label_xattr": ""
-     },
-     "clients": []
-   }
-   # Here in the fetched export, pseudo and access_type is modified. Then the modified file is passed to update interface
-   $ ceph nfs export update -i update_cephfs_export.json
-   $ cat update_cephfs_export.json
-   {
-     "export_id": 1,
-     "path": "/",
-     "cluster_id": "vstart",
-     "pseudo": "/cephfs_testing",
-     "access_type": "RO",
-     "squash": "no_root_squash",
-     "security_label": true,
-     "protocols": [
-       4
-     ],
-     "transports": [
-       "TCP"
-     ],
-     "fsal": {
-       "name": "CEPH",
-       "user_id": "vstart1",
-       "fs_name": "a",
-       "sec_label_xattr": ""
-     },
-     "clients": []
-   }
-
-
-Configuring NFS Ganesha to export CephFS with vstart
-====================================================
-
-1) Using ``cephadm``
-
-    .. code:: bash
-
-        $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d --cephadm
-
-    This will deploy a single NFS Ganesha daemon using ``vstart.sh``, where
-    the daemon will listen on the default NFS Ganesha port.
-
-2) Using test orchestrator
-
-    .. code:: bash
-
-       $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d
-
-    Environment variable ``NFS`` is the number of NFS Ganesha daemons to be
-    deployed, each listening on a random port.
-
-    .. note:: NFS Ganesha packages must be pre-installed for this to work.
-
-Mount
-=====
-
-After the exports are successfully created and NFS Ganesha daemons are no longer in
-grace period. The exports can be mounted by
-
-.. code:: bash
-
-    $ mount -t nfs -o port=<ganesha-port> <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
-
-.. note:: Only NFS v4.0+ is supported.
-
-Troubleshooting
-===============
-
-Checking NFS-Ganesha logs with
-
-1) ``cephadm``
-
-   .. code:: bash
-
-      $ cephadm logs --fsid <fsid> --name nfs.<cluster_id>.hostname
-
-2) ``rook``
-
-   .. code:: bash
-
-      $ kubectl logs -n rook-ceph rook-ceph-nfs-<cluster_id>-<node_id> nfs-ganesha
-
-Log level can be changed using `nfs cluster config set` command.
-
-.. _NFS-Ganesha NFS Server: https://github.com/nfs-ganesha/nfs-ganesha/wiki
index 203509f83c005325ec360c39e0acf02d757cbb62..6d59ab119b715b0c7d3b34ff8a6a9e3ba826fb0b 100644 (file)
@@ -384,5 +384,39 @@ On successful cancelation, the cloned subvolume is moved to `canceled` state::
 
 .. note:: The canceled cloned can be deleted by using --force option in `fs subvolume rm` command.
 
+
+.. _subvol-pinning:
+
+Pinning Subvolumes and Subvolume Groups
+---------------------------------------
+
+
+Subvolumes and subvolume groups can be automatically pinned to ranks according
+to policies. This can help distribute load across MDS ranks in predictable and
+stable ways.  Review :ref:`cephfs-pinning` and :ref:`cephfs-ephemeral-pinning`
+for details on how pinning works.
+
+Pinning is configured by::
+
+  $ ceph fs subvolumegroup pin <vol_name> <group_name> <pin_type> <pin_setting>
+
+or for subvolumes::
+
+  $ ceph fs subvolume pin <vol_name> <group_name> <pin_type> <pin_setting>
+
+Typically you will want to set subvolume group pins. The ``pin_type`` may be
+one of ``export``, ``distributed``, or ``random``. The ``pin_setting``
+corresponds to the extended attributed "value" as in the pinning documentation
+referenced above.
+
+So, for example, setting a distributed pinning strategy on a subvolume group::
+
+  $ ceph fs subvolumegroup pin cephfilesystem-a csi distributed 1
+
+Will enable distributed subtree partitioning policy for the "csi" subvolume
+group.  This will cause every subvolume within the group to be automatically
+pinned to one of the available ranks on the file system.
+
+
 .. _manila: https://github.com/openstack/manila
 .. _CSI: https://github.com/ceph/ceph-csi
index 02ae3e9b2934696a0d88872e89f9f0b122e9c920..1726b2f5f74b541ae8ffbb39a025efd6829f4fee 100644 (file)
@@ -84,7 +84,6 @@ Administration
     MDS Configuration Settings <mds-config-ref>
     Manual: ceph-mds <../../man/8/ceph-mds>
     Export over NFS <nfs>
-    Export over NFS with volume nfs interface <fs-nfs-exports>
     Application best practices <app-best-practices>
     FS volume and subvolumes <fs-volumes>
     CephFS Quotas <quota>
index dcbbfc51e094d1ebb1a20fcc1cbe103fdf5ff55e..db9b52f3a55763634a90bbe841e7b64178014ad0 100644 (file)
@@ -100,6 +100,8 @@ When a daemon finishes stopping, it will respawn itself and go back to being a
 standby.
 
 
+.. _cephfs-pinning:
+
 Manually pinning directory trees to a particular rank
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -136,6 +138,8 @@ directory's export pin. For example:
     # a/b is now pinned to rank 0 and a/ and the rest of its children are still pinned to rank 1
 
 
+.. _cephfs-ephemeral-pinning:
+
 Setting subtree partitioning policies
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
index 17bf4303eb13294465b7f7650ecf36ff2f093f0f..6c44b86504226c64752fae97fa44a4e10c9f8a2f 100644 (file)
@@ -1,9 +1,15 @@
+.. _cephfs-nfs:
+
 ===
 NFS
 ===
 
-CephFS namespaces can be exported over NFS protocol using the
-`NFS-Ganesha NFS server <https://github.com/nfs-ganesha/nfs-ganesha/wiki>`_.
+CephFS namespaces can be exported over NFS protocol using the NFS-Ganesha NFS
+server.  This document provides information on configuring NFS-Ganesha
+clusters manually.  The simplest and preferred way of managing NFS-Ganesha
+clusters and CephFS exports is using ``ceph nfs ...`` commands. See
+:doc:`/mgr/nfs` for more details. As the deployment is done using cephadm or
+rook.
 
 Requirements
 ============
@@ -14,6 +20,10 @@ Requirements
    ganesha v2.5 stable or higher versions)
 -  NFS-Ganesha server host connected to the Ceph public network
 
+.. note::
+   It is recommended to use 3.5 or later stable version of NFS-Ganesha
+   packages with pacific (16.2.x) or later stable version of Ceph packages.
+
 Configuring NFS-Ganesha to export CephFS
 ========================================
 
@@ -70,12 +80,8 @@ to get the benefit of sessions.
 Conventions for mounting NFS resources are platform-specific. The
 following conventions work on Linux and some Unix platforms:
 
-From the command line::
+.. code:: bash
 
-  mount -t nfs -o nfsvers=4.1,proto=tcp <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
+    mount -t nfs -o nfsvers=4.1,proto=tcp <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
 
-Current limitations
-===================
 
-- Per running ganesha daemon, FSAL_CEPH can only export one Ceph file system
-  although multiple directories in a Ceph file system may be exported.
index 7ce6874db535e2c6d4997e5c4eefaf2f157abb05..3ca487c0332ccb4c9ddc23a52efbd903a32aa5dc 100644 (file)
@@ -215,11 +215,11 @@ and/or peer updates.
 CephFS mirroring module provides `mirror daemon status` interface to check mirror daemon
 status::
 
-  $ ceph fs snapshot mirror daemon status <fs_name>
+  $ ceph fs snapshot mirror daemon status
 
 E.g::
 
-  $ ceph fs snapshot mirror daemon status | jq
+  $ ceph fs snapshot mirror daemon status | jq
   [
     {
       "daemon_id": 284167,
index f892d29da075ad4ca3c12234866803019b3c1f0f..5b449e099b9640f07034295f73215d3b7cdb9fe4 100644 (file)
@@ -1148,7 +1148,7 @@ Unit tests based on tox
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
 We included a ``tox`` configuration file that will run the unit tests under
-Python 2 or 3, as well as linting tools to guarantee the uniformity of code.
+Python 3, as well as linting tools to guarantee the uniformity of code.
 
 You need to install ``tox`` and ``coverage`` before running it. To install the
 packages in your system, either install it via your operating system's package
@@ -1163,9 +1163,6 @@ Alternatively, you can use Python's native package installation method::
 To run the tests, run ``src/script/run_tox.sh`` in the dashboard directory (where
 ``tox.ini`` is located)::
 
-  ## Run Python 2+3 tests+lint commands:
-  $ ../../../script/run_tox.sh --tox-env py27,py3,lint,check
-
   ## Run Python 3 tests+lint commands:
   $ ../../../script/run_tox.sh --tox-env py3,lint,check
 
@@ -1662,8 +1659,8 @@ If we want to write a unit test for the above ``Ping`` controller, create a
   class PingTest(ControllerTestCase):
       @classmethod
       def setup_test(cls):
-          Ping._cp_config['tools.authenticate.on'] = False
-          cls.setup_controllers([Ping])
+          cp_config = {'tools.authenticate.on': True}
+          cls.setup_controllers([Ping], cp_config=cp_config)
 
       def test_ping(self):
           self._get("/api/ping")
@@ -1673,8 +1670,8 @@ If we want to write a unit test for the above ``Ping`` controller, create a
 The ``ControllerTestCase`` class starts by initializing a CherryPy webserver.
 Then it will call the ``setup_test()`` class method where we can explicitly
 load the controllers that we want to test. In the above example we are only
-loading the ``Ping`` controller. We can also disable authentication of a
-controller at this stage, as depicted in the example.
+loading the ``Ping`` controller. We can also provide ``cp_config`` in order to
+update the controller's cherrypy config (e.g. enable authentication as shown in the example).
 
 How to update or create new dashboards in grafana?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index de9d6de6fcd101413d120e5396d6a549fd0794e0..21db9bf9f4cba33f4b353189b0bd205f37526f81 100644 (file)
@@ -145,7 +145,6 @@ environments and run options::
   $ tox -e py3,lint,check
 
   ## To run it as Jenkins would:  
-  $ ../../../script/run_tox.sh --tox-env py27,py3,lint,check
   $ ../../../script/run_tox.sh --tox-env py3,lint,check
 
 Manager core unit tests
diff --git a/ceph/doc/dev/vstart-ganesha.rst b/ceph/doc/dev/vstart-ganesha.rst
new file mode 100644 (file)
index 0000000..4e77deb
--- /dev/null
@@ -0,0 +1,45 @@
+==============================
+NFS CephFS-RGW Developer Guide
+==============================
+
+CephFS exports are supported since Octopus and RGW exports are supported since
+Quincy.
+
+Configuring NFS Ganesha to export CephFS with vstart
+====================================================
+
+1) Using ``cephadm``
+
+    .. code:: bash
+
+        $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d --cephadm
+
+    This will deploy a single NFS Ganesha daemon using ``vstart.sh``, where the
+    daemon will listen on the default NFS Ganesha port. Also cephfs export is
+    created.
+
+2) Using test orchestrator
+
+    .. code:: bash
+
+       $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d
+
+    Environment variable ``NFS`` is the number of NFS Ganesha daemons to be
+    deployed, each listening on a random port.
+
+    .. note:: NFS Ganesha packages must be pre-installed for this to work.
+
+Configuring NFS Ganesha to export RGW with vstart
+=================================================
+
+1) Using ``cephadm``
+
+    .. code:: bash
+
+        $ MON=1 OSD=3 RGW=1 NFS=1 ../src/vstart.sh -n -d --cephadm
+
+    This will deploy a single NFS Ganesha daemon using ``vstart.sh``, where the
+    daemon will listen on the default NFS Ganesha port. Also rgw export is
+    created.
+
+    .. note:: boto python module must be pre-installed for this to work.
index bad687f9aa61fb02d1bbb7e10b3360078d69f567..654633c7568038565dd750694cb33acf4409cfeb 100644 (file)
@@ -71,6 +71,30 @@ Descriptions of fields
 
    number of opened inodes
 
+.. describe:: rtio
+
+   total size of read IOs
+
+.. describe:: wtio
+
+   total size of write IOs
+
+.. describe:: raio
+
+   average size of read IOs
+
+.. describe:: waio
+
+   average size of write IOs
+
+.. describe:: rsp
+
+   speed of read IOs compared with the last refresh
+
+.. describe:: wsp
+
+   speed of write IOs compared with the last refresh
+
 
 Availability
 ============
index 3ac0e0333b0a98661a142ebaccbfb31b9ac64fe1..7acd0695e9737cabff32526888d0faad3999e1bf 100644 (file)
@@ -1179,97 +1179,8 @@ A log entry may look like this::
 NFS-Ganesha Management
 ----------------------
 
-Support for NFS-Ganesha Clusters Deployed by the Orchestrator
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The Ceph Dashboard can be used to manage NFS-Ganesha clusters deployed by the
-Orchestrator and will detect them automatically. For more details
-on deploying NFS-Ganesha clusters with the Orchestrator, please see:
-
-- Cephadm backend: :ref:`orchestrator-cli-stateless-services`. Or particularly, see
-  :ref:`deploy-cephadm-nfs-ganesha`.
-- Rook backend: `Ceph NFS Gateway CRD <https://rook.github.io/docs/rook/master/ceph-nfs-crd.html>`_.
-
-Support for NFS-Ganesha Clusters Defined by the User
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. note::
-
-    This configuration only applies for user-defined clusters,
-    NOT for Orchestrator-deployed clusters.
-
-The Ceph Dashboard can manage `NFS Ganesha <https://nfs-ganesha.github.io/>`_ exports that use
-CephFS or RGW as their backstore.
-
-To enable this feature in Ceph Dashboard there are some assumptions that need
-to be met regarding the way NFS-Ganesha services are configured.
-
-The dashboard manages NFS-Ganesha config files stored in RADOS objects on the Ceph Cluster.
-NFS-Ganesha must store part of their configuration in the Ceph cluster.
-
-These configuration files follow the below conventions.
-Each export block must be stored in its own RADOS object named
-``export-<id>``, where ``<id>`` must match the ``Export_ID`` attribute of the
-export configuration. Then, for each NFS-Ganesha service daemon there should
-exist a RADOS object named ``conf-<daemon_id>``, where ``<daemon_id>`` is an
-arbitrary string that should uniquely identify the daemon instance (e.g., the
-hostname where the daemon is running).
-Each ``conf-<daemon_id>`` object contains the RADOS URLs to the exports that
-the NFS-Ganesha daemon should serve. These URLs are of the form::
-
-  %url rados://<pool_name>[/<namespace>]/export-<id>
-
-Both the ``conf-<daemon_id>`` and ``export-<id>`` objects must be stored in the
-same RADOS pool/namespace.
-
-
-Configuring NFS-Ganesha in the Dashboard
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-To enable management of NFS-Ganesha exports in the Ceph Dashboard, we
-need to tell the Dashboard the RADOS pool and namespace in which
-configuration objects are stored. The Ceph Dashboard can then access them
-by following the naming convention described above.
-
-The Dashboard command to configure the NFS-Ganesha configuration objects
-location is::
-
-  $ ceph dashboard set-ganesha-clusters-rados-pool-namespace <pool_name>[/<namespace>]
-
-After running the above command, the Ceph Dashboard is able to find the NFS-Ganesha
-configuration objects and we can manage exports through the Web UI.
-
-.. note::
-
-    A dedicated pool for the NFS shares should be used. Otherwise it can cause the
-    `known issue <https://tracker.ceph.com/issues/46176>`_ with listing of shares
-    if the NFS objects are stored together with a lot of other objects in a single
-    pool.
-
-
-Support for Multiple NFS-Ganesha Clusters
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The Ceph Dashboard also supports management of NFS-Ganesha exports belonging
-to other NFS-Ganesha clusters. An NFS-Ganesha cluster is a group of
-NFS-Ganesha service daemons sharing the same exports. NFS-Ganesha
-clusters are independent and don't share the exports configuration among each
-other.
-
-Each NFS-Ganesha cluster should store its configuration objects in a
-unique RADOS pool/namespace to isolate the configuration.
-
-To specify the the configuration location of each NFS-Ganesha cluster we
-can use the same command as above but with a different value pattern::
-
-  $ ceph dashboard set-ganesha-clusters-rados-pool-namespace <cluster_id>:<pool_name>[/<namespace>](,<cluster_id>:<pool_name>[/<namespace>])*
-
-The ``<cluster_id>`` is an arbitrary string that should uniquely identify the
-NFS-Ganesha cluster.
-
-When configuring the Ceph Dashboard with multiple NFS-Ganesha clusters, the
-Web UI will allow you to choose to which cluster an export belongs.
-
+The dashboard requires enabling the NFS module which will be used to manage
+NFS clusters and NFS exports. For more information check :ref:`mgr-nfs`.
 
 Plug-ins
 --------
index 0b03acfb9385a156e37bd9f415dab0332cf91f8a..50754a5e2b54c40ef7fbf5fdf5724e4fd8a9e88c 100644 (file)
@@ -46,3 +46,4 @@ sensible.
     Orchestrator module <orchestrator>
     Rook module <rook>
     MDS Autoscaler module <mds_autoscaler>
+    NFS module <nfs>
diff --git a/ceph/doc/mgr/nfs.rst b/ceph/doc/mgr/nfs.rst
new file mode 100644 (file)
index 0000000..79e6c29
--- /dev/null
@@ -0,0 +1,606 @@
+.. _mgr-nfs:
+
+=============================
+CephFS & RGW Exports over NFS
+=============================
+
+CephFS namespaces and RGW buckets can be exported over NFS protocol
+using the `NFS-Ganesha NFS server`_.
+
+The ``nfs`` manager module provides a general interface for managing
+NFS exports of either CephFS directories or RGW buckets.  Exports can
+be managed either via the CLI ``ceph nfs export ...`` commands
+or via the dashboard.
+
+The deployment of the nfs-ganesha daemons can also be managed
+automatically if either the :ref:`cephadm` or :ref:`mgr-rook`
+orchestrators are enabled.  If neither are in use (e.g., Ceph is
+deployed via an external orchestrator like Ansible or Puppet), the
+nfs-ganesha daemons must be manually deployed; for more information,
+see :ref:`nfs-ganesha-config`.
+
+.. note:: Starting with Ceph Pacific, the ``nfs`` mgr module must be enabled.
+
+NFS Cluster management
+======================
+
+Create NFS Ganesha Cluster
+--------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster create <cluster_id> [<placement>] [--port <port>] [--ingress --virtual-ip <ip>]
+
+This creates a common recovery pool for all NFS Ganesha daemons, new user based on
+``cluster_id``, and a common NFS Ganesha config RADOS object.
+
+.. note:: Since this command also brings up NFS Ganesha daemons using a ceph-mgr
+   orchestrator module (see :doc:`/mgr/orchestrator`) such as cephadm or rook, at
+   least one such module must be enabled for it to work.
+
+   Currently, NFS Ganesha daemon deployed by cephadm listens on the standard
+   port. So only one daemon will be deployed on a host.
+
+``<cluster_id>`` is an arbitrary string by which this NFS Ganesha cluster will be
+known (e.g., ``mynfs``).
+
+``<placement>`` is an optional string signifying which hosts should have NFS Ganesha
+daemon containers running on them and, optionally, the total number of NFS
+Ganesha daemons on the cluster (should you want to have more than one NFS Ganesha
+daemon running per node). For example, the following placement string means
+"deploy NFS Ganesha daemons on nodes host1 and host2 (one daemon per host)::
+
+    "host1,host2"
+
+and this placement specification says to deploy single NFS Ganesha daemon each
+on nodes host1 and host2 (for a total of two NFS Ganesha daemons in the
+cluster)::
+
+    "2 host1,host2"
+
+NFS can be deployed on a port other than 2049 (the default) with ``--port <port>``.
+
+To deploy NFS with a high-availability front-end (virtual IP and load balancer), add the
+``--ingress`` flag and specify a virtual IP address. This will deploy a combination
+of keepalived and haproxy to provide an high-availability NFS frontend for the NFS
+service.
+
+.. note:: The ingress implementation is not yet complete.  Enabling
+         ingress will deploy multiple ganesha instances and balance
+         load across them, but a host failure will not immediately
+         cause cephadm to deploy a replacement daemon before the NFS
+         grace period expires.  This high-availability functionality
+         is expected to be completed by the Quincy release (March
+         2022).
+
+For more details, refer :ref:`orchestrator-cli-placement-spec` but keep
+in mind that specifying the placement via a YAML file is not supported.
+
+Ingress
+-------
+
+The core *nfs* service will deploy one or more nfs-ganesha daemons,
+each of which will provide a working NFS endpoint.  The IP for each
+NFS endpoint will depend on which host the nfs-ganesha daemons are
+deployed.  By default, daemons are placed semi-randomly, but users can
+also explicitly control where daemons are placed; see
+:ref:`orchestrator-cli-placement-spec`.
+
+When a cluster is created with ``--ingress``, an *ingress* service is
+additionally deployed to provide load balancing and high-availability
+for the NFS servers.  A virtual IP is used to provide a known, stable
+NFS endpoint that all clients can use to mount.  Ceph will take care
+of the details of NFS redirecting traffic on the virtual IP to the
+appropriate backend NFS servers, and redeploying NFS servers when they
+fail.
+
+Enabling ingress via the ``ceph nfs cluster create`` command deploys a
+simple ingress configuration with the most common configuration
+options.  Ingress can also be added to an existing NFS service (e.g.,
+one created without the ``--ingress`` flag), and the basic NFS service can
+also be modified after the fact to include non-default options, by modifying
+the services directly.  For more information, see :ref:`cephadm-ha-nfs`.
+
+Show NFS Cluster IP(s)
+----------------------
+
+To examine an NFS cluster's IP endpoints, including the IPs for the individual NFS
+daemons, and the virtual IP (if any) for the ingress service,
+
+.. code:: bash
+
+    $ ceph nfs cluster info [<cluster_id>]
+
+.. note:: This will not work with the rook backend. Instead, expose the port with
+   the kubectl patch command and fetch the port details with kubectl get services
+   command::
+
+    $ kubectl patch service -n rook-ceph -p '{"spec":{"type": "NodePort"}}' rook-ceph-nfs-<cluster-name>-<node-id>
+    $ kubectl get services -n rook-ceph rook-ceph-nfs-<cluster-name>-<node-id>
+
+
+Delete NFS Ganesha Cluster
+--------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster rm <cluster_id>
+
+This deletes the deployed cluster.
+
+Updating an NFS Cluster
+-----------------------
+
+In order to modify cluster parameters (like the port or placement), you need to
+use the orchestrator interface to update the NFS service spec.  The safest way to do
+that is to export the current spec, modify it, and then re-apply it.  For example,
+to modify the ``nfs.foo`` service,
+
+.. code:: bash
+
+    $ ceph orch ls --service-name nfs.foo --export > nfs.foo.yaml
+    $ vi nfs.foo.yaml
+    $ ceph orch apply -i nfs.foo.yaml
+
+For more information about the NFS service spec, see :ref:`deploy-cephadm-nfs-ganesha`.
+
+List NFS Ganesha Clusters
+-------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster ls
+
+This lists deployed clusters.
+
+.. _nfs-cluster-set:
+
+Set Customized NFS Ganesha Configuration
+----------------------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster config set <cluster_id> -i <config_file>
+
+With this the nfs cluster will use the specified config and it will have
+precedence over default config blocks.
+
+Example use cases include:
+
+#. Changing log level.  The logging level can be adjusted with the following config
+   fragment::
+
+     LOG {
+         COMPONENTS {
+             ALL = FULL_DEBUG;
+         }
+     }
+
+#. Adding custom export block.
+
+   The following sample block creates a single export. This export will not be
+   managed by `ceph nfs export` interface::
+
+    EXPORT {
+      Export_Id = 100;
+      Transports = TCP;
+      Path = /;
+      Pseudo = /ceph/;
+      Protocols = 4;
+      Access_Type = RW;
+      Attr_Expiration_Time = 0;
+      Squash = None;
+      FSAL {
+        Name = CEPH;
+        Filesystem = "filesystem name";
+        User_Id = "user id";
+        Secret_Access_Key = "secret key";
+      }
+    }
+
+.. note:: User specified in FSAL block should have proper caps for NFS-Ganesha
+   daemons to access ceph cluster. User can be created in following way using
+   `auth get-or-create`::
+
+         # ceph auth get-or-create client.<user_id> mon 'allow r' osd 'allow rw pool=.nfs namespace=<nfs_cluster_name>, allow rw tag cephfs data=<fs_name>' mds 'allow rw path=<export_path>'
+
+View Customized NFS Ganesha Configuration
+-----------------------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster config get <cluster_id>
+
+This will output the user defined configuration (if any).
+
+Reset NFS Ganesha Configuration
+-------------------------------
+
+.. code:: bash
+
+    $ ceph nfs cluster config reset <cluster_id>
+
+This removes the user defined configuration.
+
+.. note:: With a rook deployment, ganesha pods must be explicitly restarted
+   for the new config blocks to be effective.
+
+
+Export Management
+=================
+
+.. warning:: Currently, the nfs interface is not integrated with dashboard. Both
+   dashboard and nfs interface have different export requirements and
+   create exports differently. Management of dashboard created exports is not
+   supported.
+
+Create CephFS Export
+--------------------
+
+.. code:: bash
+
+    $ ceph nfs export create cephfs --cluster-id <cluster_id> --pseudo-path <pseudo_path> --fsname <fsname> [--readonly] [--path=/path/in/cephfs] [--client_addr <value>...] [--squash <value>]
+
+This creates export RADOS objects containing the export block, where
+
+``<cluster_id>`` is the NFS Ganesha cluster ID.
+
+``<pseudo_path>`` is the export position within the NFS v4 Pseudo Filesystem where the export will be available on the server. It must be an absolute path and unique.
+
+``<fsname>`` is the name of the FS volume used by the NFS Ganesha cluster
+that will serve this export.
+
+``<path>`` is the path within cephfs. Valid path should be given and default
+path is '/'. It need not be unique. Subvolume path can be fetched using:
+
+.. code::
+
+   $ ceph fs subvolume getpath <vol_name> <subvol_name> [--group_name <subvol_group_name>]
+
+``<client_addr>`` is the list of client address for which these export
+permissions will be applicable. By default all clients can access the export
+according to specified export permissions. See the `NFS-Ganesha Export Sample`_
+for permissible values.
+
+``<squash>`` defines the kind of user id squashing to be performed. The default
+value is `no_root_squash`. See the `NFS-Ganesha Export Sample`_ for
+permissible values.
+
+.. note:: Export creation is supported only for NFS Ganesha clusters deployed using nfs interface.
+
+Create RGW Export
+-----------------
+
+There are two kinds of RGW exports:
+
+- a *user* export will export all buckets owned by an
+  RGW user, where the top-level directory of the export is a list of buckets.
+- a *bucket* export will export a single bucket, where the top-level directory contains
+  the objects in the bucket.
+
+RGW bucket export
+^^^^^^^^^^^^^^^^^
+  
+To export a *bucket*:
+
+.. code::
+
+   $ ceph nfs export create rgw --cluster-id <cluster_id> --pseudo-path <pseudo_path> --bucket <bucket_name> [--user-id <user-id>] [--readonly] [--client_addr <value>...] [--squash <value>]
+
+For example, to export *mybucket* via NFS cluster *mynfs* at the pseudo-path */bucketdata* to any host in the ``192.168.10.0/24`` network
+
+.. code::
+
+   $ ceph nfs export create rgw --cluster-id mynfs --pseudo-path /bucketdata --bucket mybucket --client_addr 192.168.10.0/24
+
+.. note:: Export creation is supported only for NFS Ganesha clusters deployed using nfs interface.
+
+``<cluster_id>`` is the NFS Ganesha cluster ID.
+
+``<pseudo_path>`` is the export position within the NFS v4 Pseudo Filesystem where the export will be available on the server. It must be an absolute path and unique.
+
+``<bucket_name>`` is the name of the bucket that will be exported.
+
+``<user_id>`` is optional, and specifies which RGW user will be used for read and write
+operations to the bucket.  If it is not specified, the user who owns the bucket will be
+used.
+
+.. note:: Currently, if multi-site RGW is enabled, Ceph can only export RGW buckets in the default realm.
+
+``<client_addr>`` is the list of client address for which these export
+permissions will be applicable. By default all clients can access the export
+according to specified export permissions. See the `NFS-Ganesha Export Sample`_
+for permissible values.
+
+``<squash>`` defines the kind of user id squashing to be performed. The default
+value is `no_root_squash`. See the `NFS-Ganesha Export Sample`_ for
+permissible values.
+
+RGW user export
+^^^^^^^^^^^^^^^
+
+To export an RGW *user*:
+
+.. code::
+
+   $ ceph nfs export create rgw --cluster-id <cluster_id> --pseudo-path <pseudo_path> --user-id <user-id> [--readonly] [--client_addr <value>...] [--squash <value>]
+
+For example, to export *myuser* via NFS cluster *mynfs* at the pseudo-path */myuser* to any host in the ``192.168.10.0/24`` network
+
+.. code::
+
+   $ ceph nfs export create rgw --cluster-id mynfs --pseudo-path /bucketdata --user-id myuser --client_addr 192.168.10.0/24
+
+
+Delete Export
+-------------
+
+.. code:: bash
+
+    $ ceph nfs export rm <cluster_id> <pseudo_path>
+
+This deletes an export in an NFS Ganesha cluster, where:
+
+``<cluster_id>`` is the NFS Ganesha cluster ID.
+
+``<pseudo_path>`` is the pseudo root path (must be an absolute path).
+
+List Exports
+------------
+
+.. code:: bash
+
+    $ ceph nfs export ls <cluster_id> [--detailed]
+
+It lists exports for a cluster, where:
+
+``<cluster_id>`` is the NFS Ganesha cluster ID.
+
+With the ``--detailed`` option enabled it shows entire export block.
+
+Get Export
+----------
+
+.. code:: bash
+
+    $ ceph nfs export info <cluster_id> <pseudo_path>
+
+This displays export block for a cluster based on pseudo root name,
+where:
+
+``<cluster_id>`` is the NFS Ganesha cluster ID.
+
+``<pseudo_path>`` is the pseudo root path (must be an absolute path).
+
+
+Create or update export via JSON specification
+----------------------------------------------
+
+An existing export can be dumped in JSON format with:
+
+.. prompt:: bash #
+
+    ceph nfs export info *<cluster_id>* *<pseudo_path>*
+
+An export can be created or modified by importing a JSON description in the
+same format:
+
+.. prompt:: bash #
+
+    ceph nfs export apply *<cluster_id>* -i <json_file>
+
+For example,::
+
+   $ ceph nfs export info mynfs /cephfs > update_cephfs_export.json
+   $ cat update_cephfs_export.json
+   {
+     "export_id": 1,
+     "path": "/",
+     "cluster_id": "mynfs",
+     "pseudo": "/cephfs",
+     "access_type": "RW",
+     "squash": "no_root_squash",
+     "security_label": true,
+     "protocols": [
+       4
+     ],
+     "transports": [
+       "TCP"
+     ],
+     "fsal": {
+       "name": "CEPH",
+       "user_id": "nfs.mynfs.1",
+       "fs_name": "a",
+       "sec_label_xattr": ""
+     },
+     "clients": []
+   }
+
+The imported JSON can be a single dict describing a single export, or a JSON list
+containing multiple export dicts.
+
+The exported JSON can be modified and then reapplied.  Below, *pseudo*
+and *access_type* are modified.  When modifying an export, the
+provided JSON should fully describe the new state of the export (just
+as when creating a new export), with the exception of the
+authentication credentials, which will be carried over from the
+previous state of the export where possible.
+
+::
+
+   $ ceph nfs export apply mynfs -i update_cephfs_export.json
+   $ cat update_cephfs_export.json
+   {
+     "export_id": 1,
+     "path": "/",
+     "cluster_id": "mynfs",
+     "pseudo": "/cephfs_testing",
+     "access_type": "RO",
+     "squash": "no_root_squash",
+     "security_label": true,
+     "protocols": [
+       4
+     ],
+     "transports": [
+       "TCP"
+     ],
+     "fsal": {
+       "name": "CEPH",
+       "user_id": "nfs.mynfs.1",
+       "fs_name": "a",
+       "sec_label_xattr": ""
+     },
+     "clients": []
+   }
+
+An export can also be created or updated by injecting a Ganesha NFS EXPORT config
+fragment.  For example,::
+
+   $ ceph nfs export apply mynfs -i update_cephfs_export.conf
+   $ cat update_cephfs_export.conf
+   EXPORT {
+       FSAL {
+           name = "CEPH";
+           filesystem = "a";
+       }
+       export_id = 1;
+       path = "/";
+       pseudo = "/a";
+       access_type = "RW";
+       squash = "none";
+       attr_expiration_time = 0;
+       security_label = true;
+       protocols = 4;
+       transports = "TCP";
+   }
+
+
+Mounting
+========
+
+After the exports are successfully created and NFS Ganesha daemons are
+deployed, exports can be mounted with:
+
+.. code:: bash
+
+    $ mount -t nfs <ganesha-host-name>:<pseudo_path> <mount-point>
+
+For example, if the NFS cluster was created with ``--ingress --virtual-ip 192.168.10.10``
+and the export's pseudo-path was ``/foo``, the export can be mounted at ``/mnt`` with:
+
+.. code:: bash
+
+    $ mount -t nfs 192.168.10.10:/foo /mnt
+
+If the NFS service is running on a non-standard port number:
+
+.. code:: bash
+
+    $ mount -t nfs -o port=<ganesha-port> <ganesha-host-name>:<ganesha-pseudo_path> <mount-point>
+
+.. note:: Only NFS v4.0+ is supported.
+
+Troubleshooting
+===============
+
+Checking NFS-Ganesha logs with
+
+1) ``cephadm``: The NFS daemons can be listed with:
+
+   .. code:: bash
+
+           $ ceph orch ps --daemon-type nfs
+
+   You can via the logs for a specific daemon (e.g., ``nfs.mynfs.0.0.myhost.xkfzal``) on
+   the relevant host with:
+
+   .. code:: bash
+
+      # cephadm logs --fsid <fsid> --name nfs.mynfs.0.0.myhost.xkfzal
+
+2) ``rook``:
+
+   .. code:: bash
+
+      $ kubectl logs -n rook-ceph rook-ceph-nfs-<cluster_id>-<node_id> nfs-ganesha
+
+The NFS log level can be adjusted using `nfs cluster config set` command (see :ref:`nfs-cluster-set`).
+
+
+.. _nfs-ganesha-config:
+
+
+Manual Ganesha deployment
+=========================
+
+It may be possible to deploy and manage the NFS ganesha daemons manually
+instead of allowing cephadm or rook to do so.
+
+.. note:: Manual configuration is not tested or fully documented; your
+          mileage may vary. If you make this work, please help us by
+          updating this documentation.
+
+Known issues
+------------
+
+* The ``mgr/nfs`` module enumerates NFS clusters via the orchestrator API; if NFS is
+  not managed by the orchestrator (e.g., cephadm or rook) then this will not work.  It
+  may be possible to create the cluster, mark the cephadm service as 'unmanaged', but this
+  is awkward and not ideal.
+
+Requirements
+------------
+
+The following packages are required to enable CephFS and RGW exports with nfs-ganesha:
+
+-  ``nfs-ganesha``, ``nfs-ganesha-ceph``, ``nfs-ganesha-rados-grace`` and
+   ``nfs-ganesha-rados-urls`` packages (version 3.3 and above)
+
+Ganesha Configuration Hierarchy
+-------------------------------
+
+Cephadm and rook start each nfs-ganesha daemon with a minimal
+`bootstrap` configuration file that pulls from a shared `common`
+configuration stored in the ``.nfs`` RADOS pool and watches the common
+config for changes.  Each export is written to a separate RADOS object
+that is referenced by URL from the common config.
+
+.. ditaa::
+
+                             rados://$pool/$namespace/export-$i        rados://$pool/$namespace/userconf-nfs.$cluster_id
+                                      (export config)                          (user config)
+
+                        +----------+    +----------+    +----------+      +---------------------------+
+                        |          |    |          |    |          |      |                           |
+                        | export-1 |    | export-2 |    | export-3 |      | userconf-nfs.$cluster_id  |
+                        |          |    |          |    |          |      |                           |
+                        +----+-----+    +----+-----+    +-----+----+      +-------------+-------------+
+                             ^               ^                ^                         ^
+                             |               |                |                         |
+                             +--------------------------------+-------------------------+
+                                        %url |
+                                             |
+                                    +--------+--------+
+                                    |                 |  rados://$pool/$namespace/conf-nfs.$svc
+                                    |  conf+nfs.$svc  |  (common config)
+                                    |                 |
+                                    +--------+--------+
+                                             ^
+                                             |
+                                   watch_url |
+                     +----------------------------------------------+
+                     |                       |                      |
+                     |                       |                      |            RADOS
+             +----------------------------------------------------------------------------------+
+                     |                       |                      |            CONTAINER
+           watch_url |             watch_url |            watch_url |
+                     |                       |                      |
+            +--------+-------+      +--------+-------+      +-------+--------+
+            |                |      |                |      |                |  /etc/ganesha/ganesha.conf
+            |   nfs.$svc.a   |      |   nfs.$svc.b   |      |   nfs.$svc.c   |  (bootstrap config)
+            |                |      |                |      |                |
+            +----------------+      +----------------+      +----------------+
+
+
+.. _NFS-Ganesha NFS Server: https://github.com/nfs-ganesha/nfs-ganesha/wiki
+.. _NFS-Ganesha Export Sample: https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/export.txt
index 65e2e4981d1337c55531fa20788a31d52c08dac5..5991afe6136568c6aa197d449e585b516256c8e4 100644 (file)
@@ -233,6 +233,9 @@ Services
 .. py:currentmodule:: ceph.deployment.service_spec
 
 .. autoclass:: ServiceSpec
+  :members:
+  :private-members:
+  :noindex:
 
 .. py:currentmodule:: orchestrator
 
@@ -291,6 +294,7 @@ Services
 .. py:currentmodule:: ceph.deployment.service_spec
 
 .. autoclass:: RGWSpec
+  :noindex:
 
 .. py:currentmodule:: orchestrator
 
index 2c0fff5dcf7d87ed964943ae6db96b6b2c7c668e..0f1caff2353ffba1fd4fe6f30b72084eb5b0c925 100644 (file)
@@ -60,13 +60,12 @@ To set a different scrape interval in the Prometheus module, set
     ceph config set mgr mgr/prometheus/scrape_interval 20
 
 On large clusters (>1000 OSDs), the time to fetch the metrics may become
-significant.  Without the cache, the Prometheus manager module could,
-especially in conjunction with multiple Prometheus instances, overload the
-manager and lead to unresponsive or crashing Ceph manager instances.  Hence,
-the cache is enabled by default and cannot be disabled.  This means that there
-is a possibility that the cache becomes stale.  The cache is considered stale
-when the time to fetch the metrics from Ceph exceeds the configured
-``scrape_interval``.
+significant.  Without the cache, the Prometheus manager module could, especially
+in conjunction with multiple Prometheus instances, overload the manager and lead
+to unresponsive or crashing Ceph manager instances.  Hence, the cache is enabled
+by default.  This means that there is a possibility that the cache becomes
+stale.  The cache is considered stale when the time to fetch the metrics from
+Ceph exceeds the configured :confval:``mgr/prometheus/scrape_interval``.
 
 If that is the case, **a warning will be logged** and the module will either
 
@@ -85,6 +84,10 @@ To tell the module to respond with "service unavailable", set it to ``fail``::
 
     ceph config set mgr mgr/prometheus/stale_cache_strategy fail
 
+If you are confident that you don't require the cache, you can disable it::
+
+    ceph config set mgr mgr/prometheus/cache false
+
 .. _prometheus-rbd-io-statistics:
 
 RBD IO statistics
index 483772e4911107bc2ba2dcc97f29a604e8edb34a..1ae369623197baaa82458e33555bf8bdeb30f07d 100644 (file)
@@ -1,7 +1,9 @@
 
-=============================
-Rook orchestrator integration
-=============================
+.. _mgr-rook:
+
+====
+Rook
+====
 
 Rook (https://rook.io/) is an orchestration tool that can run Ceph inside
 a Kubernetes cluster.
index 0f773698f38242afa8c526ac0c9d82f83b4fa873..57905689538bf9097146ff5323d26c3523c4bb83 100644 (file)
@@ -7,11 +7,12 @@
 Mclock profiles mask the low level details from users, making it
 easier for them to configure mclock.
 
-To use mclock, you must provide the following input parameters:
+The following input parameters are required for a mclock profile to configure
+the QoS related parameters:
 
-* total capacity of each OSD
+* total capacity (IOPS) of each OSD (determined automatically)
 
-* an mclock profile to enable
+* an mclock profile type to enable
 
 Using the settings in the specified profile, the OSD determines and applies the
 lower-level mclock and Ceph parameters. The parameters applied by the mclock
@@ -31,11 +32,11 @@ Ceph cluster enables the throttling of the operations(IOPS) belonging to
 different client classes (background recovery, scrub, snaptrim, client op,
 osd subop)”*.
 
-The mclock profile uses the capacity limits and the mclock profile selected by
-the user to determine the low-level mclock resource control parameters.
+The mclock profile uses the capacity limits and the mclock profile type selected
+by the user to determine the low-level mclock resource control parameters.
 
-Depending on the profile, lower-level mclock resource-control parameters and
-some Ceph-configuration parameters are transparently applied.
+Depending on the profile type, lower-level mclock resource-control parameters
+and some Ceph-configuration parameters are transparently applied.
 
 The low-level mclock resource control parameters are the *reservation*,
 *limit*, and *weight* that provide control of the resource shares, as
@@ -56,7 +57,7 @@ mclock profiles can be broadly classified into two types,
     as compared to background recoveries and other internal clients within
     Ceph. This profile is enabled by default.
   - **high_recovery_ops**:
-    This profile allocates more reservation to background recoveries as 
+    This profile allocates more reservation to background recoveries as
     compared to external clients and other internal clients within Ceph. For
     example, an admin may enable this profile temporarily to speed-up background
     recoveries during non-peak hours.
@@ -109,7 +110,8 @@ chunk of the bandwidth allocation goes to client ops. Background recovery ops
 are given lower allocation (and therefore take a longer time to complete). But
 there might be instances that necessitate giving higher allocations to either
 client ops or recovery ops. In order to deal with such a situation, you can
-enable one of the alternate built-in profiles mentioned above.
+enable one of the alternate built-in profiles by following the steps mentioned
+in the next section.
 
 If any mClock profile (including "custom") is active, the following Ceph config
 sleep options will be disabled,
@@ -139,20 +141,69 @@ all its clients.
 Steps to Enable mClock Profile
 ==============================
 
-The following sections outline the steps required to enable a mclock profile.
+As already mentioned, the default mclock profile is set to *high_client_ops*.
+The other values for the built-in profiles include *balanced* and
+*high_recovery_ops*.
+
+If there is a requirement to change the default profile, then the option
+``osd_mclock_profile`` may be set during runtime by using the following
+command:
+
+  .. prompt:: bash #
+
+    ceph config set osd.N osd_mclock_profile <value>
+
+For example, to change the profile to allow faster recoveries on "osd.0", the
+following command can be used to switch to the *high_recovery_ops* profile:
+
+  .. prompt:: bash #
+
+    ceph config set osd.0 osd_mclock_profile high_recovery_ops
+
+.. note:: The *custom* profile is not recommended unless you are an advanced
+          user.
+
+And that's it! You are ready to run workloads on the cluster and check if the
+QoS requirements are being met.
+
+
+OSD Capacity Determination (Automated)
+======================================
+
+The OSD capacity in terms of total IOPS is determined automatically during OSD
+initialization. This is achieved by running the OSD bench tool and overriding
+the default value of ``osd_mclock_max_capacity_iops_[hdd, ssd]`` option
+depending on the device type. No other action/input is expected from the user
+to set the OSD capacity. You may verify the capacity of an OSD after the
+cluster is brought up by using the following command:
+
+  .. prompt:: bash #
+
+    ceph config show osd.N osd_mclock_max_capacity_iops_[hdd, ssd]
+
+For example, the following command shows the max capacity for "osd.0" on a Ceph
+node whose underlying device type is SSD:
+
+  .. prompt:: bash #
+
+    ceph config show osd.0 osd_mclock_max_capacity_iops_ssd
 
-Determining OSD Capacity Using Benchmark Tests
-----------------------------------------------
 
-To allow mclock to fulfill its QoS goals across its clients, it is most
-important to have a good understanding of each OSD's capacity in terms of its
-baseline throughputs (IOPS) across the Ceph nodes. To determine this capacity,
-you must perform appropriate benchmarking tests. The steps for performing these
-benchmarking tests are broadly outlined below.
+Steps to Manually Benchmark an OSD (Optional)
+=============================================
 
-Any existing benchmarking tool can be used for this purpose. The following
-steps use the *Ceph Benchmarking Tool* (cbt_). Regardless of the tool
-used, the steps described below remain the same.
+.. note:: These steps are only necessary if you want to override the OSD
+          capacity already determined automatically during OSD initialization.
+          Otherwise, you may skip this section entirely.
+
+.. tip:: If you have already determined the benchmark data and wish to manually
+         override the max osd capacity for an OSD, you may skip to section
+         `Specifying  Max OSD Capacity`_.
+
+
+Any existing benchmarking tool can be used for this purpose. In this case, the
+steps use the *Ceph OSD Bench* command described in the next section. Regardless
+of the tool/command used, the steps outlined further below remain the same.
 
 As already described in the :ref:`dmclock-qos` section, the number of
 shards and the bluestore's throttle parameters have an impact on the mclock op
@@ -171,108 +222,93 @@ maximize the impact of the mclock scheduler.
   these parameters may also be determined during the benchmarking phase as
   described below.
 
-Benchmarking Test Steps Using CBT
-`````````````````````````````````
-
-The steps below use the default shards and detail the steps used to determine the
-correct bluestore throttle values.
-
-.. note:: These steps, although manual in April 2021, will be automated in the future.
-
-1. On the Ceph node hosting the OSDs, download cbt_ from git.
-2. Install cbt and all the dependencies mentioned on the cbt github page.
-3. Construct the Ceph configuration file and the cbt yaml file.
-4. Ensure that the bluestore throttle options ( i.e.
-   ``bluestore_throttle_bytes`` and ``bluestore_throttle_deferred_bytes``) are
-   set to the default values.
-5. Ensure that the test is performed on similar device types to get reliable
-   OSD capacity data.
-6. The OSDs can be grouped together with the desired replication factor for the
-   test to ensure reliability of OSD capacity data.
-7. After ensuring that the OSDs nodes are in the desired configuration, run a
-   simple 4KiB random write workload on the OSD(s) for 300 secs.
-8. Note the overall throughput(IOPS) obtained from the cbt output file. This
-   value is the baseline throughput(IOPS) when the default bluestore
-   throttle options are in effect.
-9. If the intent is to determine the bluestore throttle values for your
-   environment, then set the two options, ``bluestore_throttle_bytes`` and
-   ``bluestore_throttle_deferred_bytes`` to 32 KiB(32768 Bytes) each to begin
-   with. Otherwise, you may skip to the next section.
-10. Run the 4KiB random write workload as before on the OSD(s) for 300 secs.
-11. Note the overall throughput from the cbt log files and compare the value
-    against the baseline throughput in step 8.
-12. If the throughput doesn't match with the baseline, increment the bluestore
-    throttle options by 2x and repeat steps 9 through 11 until the obtained
-    throughput is very close to the baseline value.
-
-For example, during benchmarking on a machine with NVMe SSDs, a value of 256 KiB for
-both bluestore throttle and deferred bytes was determined to maximize the impact
-of mclock. For HDDs, the corresponding value was 40 MiB, where the overall
-throughput was roughly equal to the baseline throughput. Note that in general
-for HDDs, the bluestore throttle values are expected to be higher when compared
-to SSDs.
-
-.. _cbt: https://github.com/ceph/cbt
 
+OSD Bench Command Syntax
+````````````````````````
 
-Specifying  Max OSD Capacity
-----------------------------
+The :ref:`osd-subsystem` section describes the OSD bench command. The syntax
+used for benchmarking is shown below :
 
-The steps in this section may be performed only if the max osd capacity is
-different from the default values (SSDs: 21500 IOPS and HDDs: 315 IOPS). The
-option ``osd_mclock_max_capacity_iops_[hdd, ssd]`` can be set by specifying it
-in either the **[global]** section or in a specific OSD section (**[osd.x]** of
-your Ceph configuration file).
+.. prompt:: bash #
 
-Alternatively, commands of the following form may be used:
+  ceph tell osd.N bench [TOTAL_BYTES] [BYTES_PER_WRITE] [OBJ_SIZE] [NUM_OBJS]
 
-  .. prompt:: bash #
+where,
 
-     ceph config set [global, osd] osd_mclock_max_capacity_iops_[hdd,ssd] <value>
+* ``TOTAL_BYTES``: Total number of bytes to write
+* ``BYTES_PER_WRITE``: Block size per write
+* ``OBJ_SIZE``: Bytes per object
+* ``NUM_OBJS``: Number of objects to write
 
-For example, the following command sets the max capacity for all the OSDs in a
-Ceph node whose underlying device type is SSDs:
+Benchmarking Test Steps Using OSD Bench
+```````````````````````````````````````
 
-  .. prompt:: bash #
+The steps below use the default shards and detail the steps used to determine
+the correct bluestore throttle values (optional).
 
-    ceph config set osd osd_mclock_max_capacity_iops_ssd 25000
+#. Bring up your Ceph cluster and login to the Ceph node hosting the OSDs that
+   you wish to benchmark.
+#. Run a simple 4KiB random write workload on an OSD using the following
+   commands:
 
-To set the capacity for a specific OSD (for example "osd.0") whose underlying
-device type is HDD, use a command like this:
+   .. note:: Note that before running the test, caches must be cleared to get an
+             accurate measurement.
 
-  .. prompt:: bash #
+   For example, if you are running the benchmark test on osd.0, run the following
+   commands:
 
-    ceph config set osd.0 osd_mclock_max_capacity_iops_hdd 350
+   .. prompt:: bash #
 
+     ceph tell osd.0 cache drop
 
-Specifying Which mClock Profile to Enable
------------------------------------------
+   .. prompt:: bash #
 
-As already mentioned, the default mclock profile is set to *high_client_ops*.
-The other values for the built-in profiles include *balanced* and
-*high_recovery_ops*.
+     ceph tell osd.0 bench 12288000 4096 4194304 100
 
-If there is a requirement to change the default profile, then the option
-``osd_mclock_profile`` may be set in the **[global]** or **[osd]** section of
-your Ceph configuration file before bringing up your cluster.
+#. Note the overall throughput(IOPS) obtained from the output of the osd bench
+   command. This value is the baseline throughput(IOPS) when the default
+   bluestore throttle options are in effect.
+#. If the intent is to determine the bluestore throttle values for your
+   environment, then set the two options, ``bluestore_throttle_bytes``
+   and ``bluestore_throttle_deferred_bytes`` to 32 KiB(32768 Bytes) each
+   to begin with. Otherwise, you may skip to the next section.
+#. Run the 4KiB random write test as before using OSD bench.
+#. Note the overall throughput from the output and compare the value
+   against the baseline throughput recorded in step 3.
+#. If the throughput doesn't match with the baseline, increment the bluestore
+   throttle options by 2x and repeat steps 5 through 7 until the obtained
+   throughput is very close to the baseline value.
 
-Alternatively, to change the profile during runtime, use the following command:
+For example, during benchmarking on a machine with NVMe SSDs, a value of 256 KiB
+for both bluestore throttle and deferred bytes was determined to maximize the
+impact of mclock. For HDDs, the corresponding value was 40 MiB, where the
+overall throughput was roughly equal to the baseline throughput. Note that in
+general for HDDs, the bluestore throttle values are expected to be higher when
+compared to SSDs.
 
-  .. prompt:: bash #
 
-    ceph config set [global,osd] osd_mclock_profile <value>
+Specifying  Max OSD Capacity
+````````````````````````````
 
-For example, to change the profile to allow faster recoveries, the following
-command can be used to switch to the *high_recovery_ops* profile:
+The steps in this section may be performed only if you want to override the
+max osd capacity automatically set during OSD initialization. The option
+``osd_mclock_max_capacity_iops_[hdd, ssd]`` for an OSD can be set by running the
+following command:
 
   .. prompt:: bash #
 
-    ceph config set osd osd_mclock_profile high_recovery_ops
+     ceph config set osd.N osd_mclock_max_capacity_iops_[hdd,ssd] <value>
 
-.. note:: The *custom* profile is not recommended unless you are an advanced user.
+For example, the following command sets the max capacity for a specific OSD
+(say "osd.0") whose underlying device type is HDD to 350 IOPS:
 
-And that's it! You are ready to run workloads on the cluster and check if the
-QoS requirements are being met.
+  .. prompt:: bash #
+
+    ceph config set osd.0 osd_mclock_max_capacity_iops_hdd 350
+
+Alternatively, you may specify the max capacity for OSDs within the Ceph
+configuration file under the respective [osd.N] section. See
+:ref:`ceph-conf-settings` for more details.
 
 
 .. index:: mclock; config settings
@@ -294,14 +330,6 @@ mClock Config Options
 :Valid Choices: high_client_ops, high_recovery_ops, balanced, custom
 :Default: ``high_client_ops``
 
-``osd_mclock_max_capacity_iops``
-
-:Description: Max IOPS capacity (at 4KiB block size) to consider per OSD
-              (overrides _ssd and _hdd if non-zero)
-
-:Type: Float
-:Default: ``0.0``
-
 ``osd_mclock_max_capacity_iops_hdd``
 
 :Description: Max IOPS capacity (at 4KiB block size) to consider per OSD (for
@@ -365,4 +393,3 @@ mClock Config Options
 
 :Type: Float
 :Default: ``0.011``
-
index 27d1daad14e4d6b2fe7f0f9cd14541ea3406bf63..5f3f112e8544bab7711f6099dbe1bdaf3b5fb0fe 100644 (file)
@@ -1,3 +1,5 @@
+.. _rados-index:
+
 ======================
  Ceph Storage Cluster
 ======================
index 126f72bc66eb6140659a309d2c187f5e9add9b41..c5f911f81ca5b9c5e726b5932ed750c02d93c450 100644 (file)
@@ -95,6 +95,8 @@ or delete them if they were just created. ::
        ceph pg {pgid} mark_unfound_lost revert|delete
 
 
+.. _osd-subsystem:
+
 OSD Subsystem
 =============
 
index c8dff51a1fbc682e3aa29ba814e866a51f76f83c..2136918c724cf631ce789558d9ed9222a782b181 100644 (file)
@@ -1,3 +1,5 @@
+.. _rados-operations:
+
 ====================
  Cluster Operations
 ====================
index 947fdb1568cb43ff7d621aa0c7e7837211ad93fd..d494f430034a41c82623a939065908fd4cbb2a0b 100644 (file)
@@ -121,24 +121,24 @@ example, a pool that maps to OSDs of class `ssd` and a pool that maps
 to OSDs of class `hdd` will each have optimal PG counts that depend on
 the number of those respective device types.
 
-The autoscaler uses the `scale-down` profile by default, 
-where each pool starts out with a full complements of PGs and only scales 
-down when the usage ratio across the pools is not even. However, it also has 
-a `scale-up` profile, where it starts out each pool with minimal PGs and scales
-up PGs when there is more usage in each pool.
+The autoscaler uses the `scale-up` profile by default,
+where it starts out each pool with minimal PGs and scales
+up PGs when there is more usage in each pool. However, it also has
+a `scale-down` profile, where each pool starts out with a full complements 
+of PGs and only scales down when the usage ratio across the pools is not even.
 
 With only the `scale-down` profile, the autoscaler identifies
 any overlapping roots and prevents the pools with such roots
 from scaling because overlapping roots can cause problems
 with the scaling process.
 
-To use the `scale-up` profile::
+To use the `scale-down` profile::
 
-  ceph osd pool set autoscale-profile scale-up
+  ceph osd pool set autoscale-profile scale-down
 
-To switch back to the default `scale-down` profile::
+To switch back to the default `scale-up` profile::
 
-  ceph osd pool set autoscale-profile scale-down
+  ceph osd pool set autoscale-profile scale-up
 
 Existing clusters will continue to use the `scale-up` profile.
 To use the `scale-down` profile, users will need to set autoscale-profile `scale-down`,
index 5c12070357824722404b2226da7126fe7a553443..eaeaa403f42d51a4e745b0b475c9042ba64c69dd 100644 (file)
@@ -112,7 +112,8 @@ When stretch mode is enabled, the OSDs wlll only take PGs active when
 they peer across data centers (or whatever other CRUSH bucket type
 you specified), assuming both are alive. Pools will increase in size
 from the default 3 to 4, expecting 2 copies in each site. OSDs will only
-be allowed to connect to monitors in the same data center.
+be allowed to connect to monitors in the same data center. New monitors
+will not be allowed to join the cluster if they do not specify a location.
 
 If all the OSDs and monitors from a data center become inaccessible
 at once, the surviving data center will enter a degraded stretch mode. This
@@ -158,6 +159,22 @@ running with more than 2 full sites.
 
 Other commands
 ==============
+Starting in Pacific v16.2.8, if your tiebreaker monitor fails for some reason,
+you can replace it. Turn on a new monitor and run ::
+
+  $ ceph mon set_new_tiebreaker mon.<new_mon_name>
+
+This command will protest if the new monitor is in the same location as existing
+non-tiebreaker monitors. This command WILL NOT remove the previous tiebreaker
+monitor; you should do so yourself.
+
+Also in 16.2.7, if you are writing your own tooling for deploying Ceph, you can use a new
+``--set-crush-location`` option when booting monitors, instead of running
+``ceph mon set_location``. This option accepts only a single "bucket=loc" pair, eg
+``ceph-mon --set-crush-location 'datacenter=a'``, which must match the
+bucket type you specified when running ``enable_stretch_mode``.
+
+
 When in stretch degraded mode, the cluster will go into "recovery" mode automatically
 when the disconnected data center comes back. If that doesn't work, or you want to
 enable recovery mode early, you can invoke ::
index 48e3483916c07b1c09b28e29b3e74c82b5443d0f..7bbc72e13660d34f4d9d6a285b9329e45456d722 100644 (file)
@@ -1,3 +1,5 @@
+.. _rados-troubleshooting-mon:
+
 =================================
  Troubleshooting Monitors
 =================================
index e9d419fd3c064795f080a38962b6f9694ea3e457..1ed6085a6c76791379964ac3655c32f63a4b3ed4 100644 (file)
@@ -804,6 +804,13 @@ Logging Settings
 :Default: None
 
 
+``rgw_ops_log_file_path``
+
+:Description: The file for writing operations logs.
+:Type: String
+:Default: None
+
+
 ``rgw_ops_log_data_backlog``
 
 :Description: The maximum data backlog data size for operations logs written
index 853d0ec6e79877daec584c4e2288bc2082d48aeb..0a506599ae71e41f6efcfb5375e7bac29c4eb7b7 100644 (file)
@@ -4,13 +4,18 @@ NFS
 
 .. versionadded:: Jewel
 
-Ceph Object Gateway namespaces can now be exported over file-based
-access protocols such as NFSv3 and NFSv4, alongside traditional HTTP access
+.. note:: Only the NFSv4 protocol is supported when using a cephadm or rook based deployment.
+
+Ceph Object Gateway namespaces can be exported over the file-based
+NFSv4 protocols, alongside traditional HTTP access
 protocols (S3 and Swift).
 
 In particular, the Ceph Object Gateway can now be configured to
 provide file-based access when embedded in the NFS-Ganesha NFS server.
 
+The simplest and preferred way of managing nfs-ganesha clusters and rgw exports
+is using ``ceph nfs ...`` commands. See :doc:`/mgr/nfs` for more details.
+
 librgw
 ======
 
@@ -61,22 +66,22 @@ Supported Operations
 The RGW NFS interface supports most operations on files and
 directories, with the following restrictions:
 
-- Links, including symlinks, are not supported
-- NFS ACLs are not supported
+- Links, including symlinks, are not supported.
+- NFS ACLs are not supported.
 
-  + Unix user and group ownership and permissions *are* supported
+  + Unix user and group ownership and permissions *are* supported.
 
-- Directories may not be moved/renamed
+- Directories may not be moved/renamed.
 
-  + files may be moved between directories
+  + Files may be moved between directories.
 
-- Only full, sequential *write* i/o is supported
+- Only full, sequential *write* I/O is supported
 
-  + i.e., write operations are constrained to be **uploads**
-  + many typical i/o operations such as editing files in place will necessarily fail as they perform non-sequential stores
-  + some file utilities *apparently* writing sequentially (e.g., some versions of GNU tar) may fail due to infrequent non-sequential stores
-  + When mounting via NFS, sequential application i/o can generally be constrained to be written sequentially to the NFS server via a synchronous mount option (e.g. -osync in Linux)
-  + NFS clients which cannot mount synchronously (e.g., MS Windows) will not be able to upload files
+  + i.e., write operations are constrained to be **uploads**.
+  + Many typical I/O operations such as editing files in place will necessarily fail as they perform non-sequential stores.
+  + Some file utilities *apparently* writing sequentially (e.g., some versions of GNU tar) may fail due to infrequent non-sequential stores.
+  + When mounting via NFS, sequential application I/O can generally be constrained to be written sequentially to the NFS server via a synchronous mount option (e.g. -osync in Linux).
+  + NFS clients which cannot mount synchronously (e.g., MS Windows) will not be able to upload files.
 
 Security
 ========
@@ -98,8 +103,8 @@ following characteristics:
 
     * additional RGW authentication types such as Keystone are not currently supported
 
-Configuring an NFS-Ganesha Instance
-===================================
+Manually configuring an NFS-Ganesha Instance
+============================================
 
 Each NFS RGW instance is an NFS-Ganesha server instance *embeddding*
 a full Ceph RGW instance.
index d4b5069a8afba833cda48a5aa61ae9de3e52fb2a..dc7520a1b3ce2a52ad5b51cf61d2dbee6da69cb9 100644 (file)
@@ -385,7 +385,7 @@ pushed or pulled using the pubsub sync module. For example:
            "eventSource":"ceph:s3",
            "awsRegion":"us-east-1",
            "eventTime":"2019-11-22T13:47:35.124724Z",
-           "eventName":"s3:ObjectCreated:Put",
+           "eventName":"ObjectCreated:Put",
            "userIdentity":{
                "principalId":"tester"
            },
@@ -424,7 +424,7 @@ pushed or pulled using the pubsub sync module. For example:
 
 - awsRegion: zonegroup
 - eventTime: timestamp indicating when the event was triggered
-- eventName: for list of supported events see: `S3 Notification Compatibility`_
+- eventName: for list of supported events see: `S3 Notification Compatibility`_. Note that the eventName values do not start with the `s3:` prefix.
 - userIdentity.principalId: user that triggered the change
 - requestParameters.sourceIPAddress: not supported
 - responseElements.x-amz-request-id: request ID of the original change
index 6a6538aec402419c86674a2132b9b33e77701fdc..008c33a59bd8a64490734ac6df26152d46a802e0 100644 (file)
@@ -105,6 +105,10 @@ Event Types
 | ``s3:ReducedRedundancyLostObject``           | Not applicable to Ceph                                      |
 +----------------------------------------------+-----------------+-------------------------------------------+
 
+.. note:: 
+
+   The ``s3:ObjectRemoved:DeleteMarkerCreated`` event presents information on the latest version of the object
+
 Topic Configuration
 -------------------
 In the case of bucket notifications, the topics management API will be derived from `AWS Simple Notification Service API`_. 
index fa528a647375bf20699da49db611f90715643954..735a20df35242d1ff26c915fd2eb55824fd8909a 100644 (file)
@@ -271,10 +271,10 @@ the following packages are required:
        <table cellpadding="10"><colgroup><col width="30%"><col width="30%"><col width="30%"></colgroup><tbody valign="top"><tr><td><h3>Debian/Ubuntu</h3>
 
 - gcc
-- python-dev
-- python-pip
-- python-virtualenv
-- python-sphinx
+- python3-dev
+- python3-pip
+- python3-sphinx
+- pytnon3-venv
 - libxml2-dev
 - libxslt1-dev
 - doxygen
@@ -289,7 +289,6 @@ the following packages are required:
 - gcc
 - python-devel
 - python-pip
-- python-virtualenv
 - python-docutils
 - python-jinja2
 - python-pygments
@@ -308,7 +307,6 @@ the following packages are required:
 - gcc
 - python-devel
 - python-pip
-- python-virtualenv
 - python-docutils
 - python-jinja2
 - python-pygments
@@ -329,14 +327,14 @@ distributions, execute the following:
 
 .. prompt:: bash $
 
-       sudo apt-get install gcc python-dev python-pip python-virtualenv libxml2-dev libxslt-dev doxygen graphviz ant ditaa
+       sudo apt-get install gcc python-dev python-pip libxml2-dev libxslt-dev doxygen graphviz ant ditaa
        sudo apt-get install python-sphinx
 
 For Fedora distributions, execute the following:
 
 .. prompt:: bash $
 
-   sudo yum install gcc python-devel python-pip python-virtualenv libxml2-devel libxslt-devel doxygen graphviz ant
+   sudo yum install gcc python-devel python-pip libxml2-devel libxslt-devel doxygen graphviz ant
    sudo pip install html2text
    sudo yum install python-jinja2 python-pygments python-docutils python-sphinx
    sudo yum install jericho-html ditaa
@@ -354,7 +352,7 @@ For CentOS/RHEL distributions, execute the following:
 
 .. prompt:: bash $
 
-       sudo yum install gcc python-devel python-pip python-virtualenv libxml2-devel libxslt-devel doxygen graphviz ant
+       sudo yum install gcc python-devel python-pip libxml2-devel libxslt-devel doxygen graphviz ant
        sudo pip install html2text
 
 For CentOS/RHEL distributions, the remaining python packages are not available
index 4bfff0f205be30e249db2b968e9cac9ebe0da6eb..e2eb80a2f4047468fc064d917a1901e9aa924ec8 100644 (file)
@@ -2,8 +2,7 @@ git
 gcc
 python3-dev
 python3-pip
-python3-virtualenv
-virtualenv
+python3-venv
 doxygen
 ditaa
 libxml2-dev
index be6799da9c2aad547a5efc8da4b794df31da62b2..52f43746d980fb80a0e4e818da055410c87970a1 100644 (file)
@@ -14,11 +14,6 @@ The standard [AWS CLI](https://docs.aws.amazon.com/cli/latest/) may also be used
 aws --endpoint-url http://localhost:8000 s3api list-objects --bucket=mybucket --allow-unordered
 ```
 
-- Use the following command to set SNS signature to s3v2:
-```
-aws configure set default.sns.signature_version s3
-```
-
 - Topic creation with endpoint:
 ```
 aws --endpoint-url http://localhost:8000 sns create-topic --name=mytopic --attributes='{"push-endpoint": "amqp://localhost:5672", "amqp-exchange": "ex1", "amqp-ack-level": "broker"}'
index 73242df8fb8ba4b11b8be114dbdd076fd648f0b1..3ba5e47ff585cb2ae1a3241cb976730827081e52 100755 (executable)
@@ -256,7 +256,6 @@ if [ x$(uname)x = xFreeBSDx ]; then
         devel/libtool \
         devel/google-perftools \
         lang/cython \
-        devel/py-virtualenv \
         databases/leveldb \
         net/openldap24-client \
         archivers/snappy \
@@ -406,7 +405,7 @@ function activate_virtualenv() {
     local env_dir=$top_srcdir/install-deps-python3
 
     if ! test -d $env_dir ; then
-        virtualenv --python=python3 ${env_dir}
+        python3 -m venv ${env_dir}
         . $env_dir/bin/activate
         if ! populate_wheelhouse install ; then
             rm -rf $env_dir
index ff6a4a27efd8bbc4191f9da28da4808032f7697a..75528c1b8608abfdb13e20ba7c44fee2b71d274a 100755 (executable)
@@ -109,6 +109,23 @@ download_liburing() {
     rm -rf src/liburing
 }
 
+download_pmdk() {
+    pmdk_version=$1
+    shift
+    pmdk_sha256=$1
+    shift
+    pmdk_fname=pmdk-${pmdk_version}.tar.gz
+    download_from $pmdk_fname $pmdk_sha256 $*
+    tar xzf $pmdk_fname -C src \
+        --exclude="pmdk-${pmdk_version}/doc" \
+        --exclude="pmdk-${pmdk_version}/src/test" \
+        --exclude="pmdk-${pmdk_version}/src/examples" \
+        --exclude="pmdk-${pmdk_version}/src/benchmarks"
+    mv src/pmdk-${pmdk_version} src/pmdk
+    tar cf ${outfile}.pmdk.tar ${outfile}/src/pmdk
+    rm -rf src/pmdk
+}
+
 build_dashboard_frontend() {
   CURR_DIR=`pwd`
   TEMP_DIR=`mktemp -d`
@@ -169,11 +186,15 @@ download_boost $boost_version 4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8
 download_liburing 0.7 8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543 \
                   https://github.com/axboe/liburing/archive \
                   https://git.kernel.dk/cgit/liburing/snapshot
+pmdk_version=1.10
+download_pmdk $pmdk_version 08dafcf94db5ac13fac9139c92225d9aa5f3724ea74beee4e6ca19a01a2eb20c \
+               https://github.com/pmem/pmdk/releases/download/$pmdk_version
 build_dashboard_frontend
 generate_rook_ceph_client
 for tarball in $outfile.version   \
                $outfile.boost     \
                $outfile.liburing  \
+               $outfile.pmdk  \
                dashboard_frontend \
                rook_ceph_client   \
                $outfile; do
index e4e367efdd8b3772b7dee8645398d1c7de3c2bd9..1b91bfe418512c83d9f8024e8724291a0731555b 100644 (file)
       "type": "vonage-status-panel"
     },
     {
-      "colorMode": "Disabled",
+      "colorMode": "Panel",
       "colors": {
         "crit": "rgba(245, 54, 54, 0.9)",
         "disable": "rgba(128, 128, 128, 0.9)",
       "targets": [
         {
           "aggregation": "Last",
-          "alias": "Clients",
+          "alias": "Active",
           "decimals": 2,
           "displayAliasType": "Always",
           "displayType": "Regular",
           "displayValueWithAlias": "When Alias Displayed",
-          "expr": "ceph_mds_server_handle_client_session",
+          "expr": "count(ceph_mgr_status == 1) or vector(0)",
           "format": "time_series",
           "intervalFactor": 1,
-          "legendFormat": "Clients",
+          "legendFormat": "Active",
           "refId": "A",
           "units": "none",
           "valueHandler": "Number Threshold"
+        },
+        {
+          "aggregation": "Last",
+          "alias": "Standby",
+          "decimals": 2,
+          "displayAliasType": "Always",
+          "displayType": "Regular",
+          "displayValueWithAlias": "When Alias Displayed",
+          "expr": "count(ceph_mgr_status == 0) or vector(0)",
+          "format": "time_series",
+          "intervalFactor": 1,
+          "legendFormat": "Standby",
+          "refId": "B",
+          "units": "none",
+          "valueHandler": "Number Threshold"
         }
       ],
-      "title": "Client connections",
+      "title": "MGRs",
       "type": "vonage-status-panel"
     },
     {
index 57922f55155a9f429ee5557d651d1fd1ee6cd5ad..91a37f0807be32e1bdf7bf8bffa17f46baa86e9b 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1557392920097,
-  "links": [],
-  "panels": [
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 0
-      },
-      "id": 10,
-      "panels": [],
-      "title": "MDS Performance",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 12,
-        "x": 0,
-        "y": 1
-      },
-      "id": 2,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.2"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*Reads/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum(ceph_objecter_op_r{ceph_daemon=~\"($mds_servers).*\"})",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Read Ops",
-          "refId": "A"
-        },
-        {
-          "expr": "sum(ceph_objecter_op_w{ceph_daemon=~\"($mds_servers).*\"})",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write Ops",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "MDS Workload - $mds_servers",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "none",
-          "label": "Reads(-) / Writes (+)",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 12,
-        "x": 12,
-        "y": 1
-      },
-      "id": 4,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "ceph_mds_server_handle_client_request{ceph_daemon=~\"($mds_servers).*\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{ceph_daemon}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Client Request Load - $mds_servers",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "MDS Performance",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "yaxes": [
-        {
-          "format": "none",
-          "label": "Client Requests",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "refresh": "15s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "default",
-          "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 12,
+            "x": 0,
+            "y": 1
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*Reads/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum(rate(ceph_objecter_op_r{ceph_daemon=~\"($mds_servers).*\"}[1m]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read Ops",
+               "refId": "A"
+            },
+            {
+               "expr": "sum(rate(ceph_objecter_op_w{ceph_daemon=~\"($mds_servers).*\"}[1m]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write Ops",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "MDS Workload - $mds_servers",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "none",
+               "label": "Reads(-) / Writes (+)",
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 0,
-        "includeAll": true,
-        "label": "MDS Server",
-        "multi": false,
-        "name": "mds_servers",
-        "options": [],
-        "query": "label_values(ceph_mds_inodes, ceph_daemon)",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 12,
+            "x": 12,
+            "y": 1
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "ceph_mds_server_handle_client_request{ceph_daemon=~\"($mds_servers).*\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{ceph_daemon}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Client Request Load - $mds_servers",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "none",
+               "label": "Client Requests",
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "MDS Performance",
-  "uid": "tbO9LAiZz",
-  "version": 2
+   ],
+   "refresh": "15s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": "MDS Server",
+            "multi": false,
+            "name": "mds_servers",
+            "options": [ ],
+            "query": "label_values(ceph_mds_inodes, ceph_daemon)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "MDS Performance",
+   "uid": "tbO9LAiZz",
+   "version": 0
 }
index 71ac36f3709a6465e1127a2663f1fcb30bb5c37a..1d071d4ec336df2d31c784b3e92f372cb3caaaa4 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "singlestat",
-      "name": "Singlestat",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1615564911000,
-  "links": [],
-  "panels": [
-    {
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 0
-      },
-      "id": 16,
-      "title": "$ceph_hosts System Overview",
-      "type": "row"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "rgba(245, 54, 54, 0.9)",
-        "rgba(237, 129, 40, 0.89)",
-        "rgba(50, 172, 45, 0.97)"
-      ],
-      "datasource": "$datasource",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 3,
-        "x": 0,
-        "y": 1
-      },
-      "height": "160",
-      "id": 1,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": "",
-      "minSpan": 4,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "count(sum by (ceph_daemon) (ceph_osd_metadata{hostname='$ceph_hosts'}))",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "refId": "A",
-          "step": 40,
-          "textEditor": true
-        }
-      ],
-      "thresholds": "",
-      "title": "OSDs",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {
-        "interrupt": "#447EBC",
-        "steal": "#6D1F62",
-        "system": "#890F02",
-        "user": "#3F6833",
-        "wait": "#C15C17"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Shows the CPU breakdown. When multiple servers are selected, only the first host's cpu data is shown",
-      "fill": 1,
-      "gridPos": {
-        "h": 10,
-        "w": 6,
-        "x": 3,
-        "y": 1
-      },
-      "id": 9,
-      "legend": {
-        "alignAsTable": false,
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "repeat": null,
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum by (mode) (\n  irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m]) or\n  irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m])\n) / scalar(\n  sum(irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]) or\n      irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]))\n) * 100",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "{{mode}}",
-          "refId": "A",
-          "step": 10,
-          "textEditor": true
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "CPU Utilization",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "percent",
-          "label": "% Utilization",
-          "logBase": 1,
-          "max": "100",
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {
-        "Available": "#508642",
-        "Free": "#508642",
-        "Total": "#bf1b00",
-        "Used": "#bf1b00",
-        "total": "#bf1b00",
-        "used": "#0a50a1"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 10,
-        "w": 6,
-        "x": 9,
-        "y": 1
-      },
-      "id": 14,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "total",
-          "color": "#bf1b00",
-          "fill": 0,
-          "linewidth": 2,
-          "stack": false
-        }
-      ],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "(node_memory_MemTotal{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"})- (\n  (node_memory_MemFree{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"})  + \n  (node_memory_Cached{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}) + \n  (node_memory_Buffers{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}) +\n  (node_memory_Slab{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"})\n  )\n  \n",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "used",
-          "refId": "D"
-        },
-        {
-          "expr": "node_memory_MemFree{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} ",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "Free",
-          "refId": "A"
-        },
-        {
-          "expr": "(node_memory_Cached{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}) + \n(node_memory_Buffers{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}) +\n(node_memory_Slab{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}) \n",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "buffers/cache",
-          "refId": "C"
-        },
-        {
-          "expr": "node_memory_MemTotal{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"} ",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "total",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "RAM Usage",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.2"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "bytes",
-          "label": "RAM used",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Show the network load (rx,tx) across all interfaces (excluding loopback 'lo')",
-      "fill": 0,
-      "gridPos": {
-        "h": 10,
-        "w": 6,
-        "x": 15,
-        "y": 1
-      },
-      "id": 10,
-      "legend": {
-        "alignAsTable": false,
-        "avg": false,
-        "current": false,
-        "hideZero": true,
-        "max": false,
-        "min": false,
-        "rightSide": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*tx/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum by (device) (\n  irate(node_network_receive_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or \n  irate(node_network_receive_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.rx",
-          "refId": "A",
-          "step": 10,
-          "textEditor": true
-        },
-        {
-          "expr": "sum by (device) (\n  irate(node_network_transmit_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or\n  irate(node_network_transmit_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.tx",
-          "refId": "B",
-          "step": 10
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Network Load",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "decbytes",
-          "label": "Send (-) / Receive (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 5,
-        "w": 3,
-        "x": 21,
-        "y": 1
-      },
-      "hideTimeOverride": true,
-      "id": 18,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": false,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*tx/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(node_network_receive_drop{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_drop_total{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m])",
-          "format": "time_series",
-          "instant": false,
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.rx",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(node_network_transmit_drop{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_drop_total{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.tx",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Network drop rate",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "pps",
-          "label": "Send (-) / Receive (+)",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "rgba(245, 54, 54, 0.9)",
-        "rgba(237, 129, 40, 0.89)",
-        "rgba(50, 172, 45, 0.97)"
-      ],
-      "datasource": "$datasource",
-      "decimals": 0,
-      "description": "Each OSD consists of a Journal/WAL partition and a data partition. The RAW Capacity shown is the sum of the data partitions across all OSDs on the selected OSD hosts.",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 3,
-        "x": 0,
-        "y": 6
-      },
-      "height": "160",
-      "id": 2,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": "",
-      "minSpan": 4,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_osd_stat_bytes and on (ceph_daemon) ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"})",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "refId": "A",
-          "step": 40,
-          "textEditor": true
-        }
-      ],
-      "thresholds": "",
-      "title": "Raw Capacity",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 5,
-        "w": 3,
-        "x": 21,
-        "y": 6
-      },
-      "hideTimeOverride": true,
-      "id": 19,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": false,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*tx/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(node_network_receive_errs{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_errs_total{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m])",
-          "format": "time_series",
-          "instant": false,
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.rx",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(node_network_transmit_errs{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_errs_total{instance=~\"[[ceph_hosts]]([\\\\.:].*)?\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}.tx",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Network error rate",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "pps",
-          "label": "Send (-) / Receive (+)",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 11
-      },
-      "id": 12,
-      "panels": [],
-      "repeat": null,
-      "title": "OSD Disk Performance Statistics",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "For any OSD devices on the host, this chart shows the iops per physical device. Each device is shown by it's name and corresponding OSD id value",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 11,
-        "x": 0,
-        "y": 12
-      },
-      "id": 6,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "connected",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*reads/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(\n  (\n    irate(node_disk_writes_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or\n    irate(node_disk_writes_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])\n  ),\n  \"instance\",\n  \"$1\",\n  \"instance\",\n  \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}}) writes",
-          "refId": "A",
-          "step": 10,
-          "textEditor": true
-        },
-        {
-          "expr": "label_replace(\n    (irate(node_disk_reads_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}}) reads",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$ceph_hosts Disk IOPS",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       },
-      "yaxes": [
-        {
-          "format": "ops",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "singlestat",
+         "name": "Singlestat",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "For OSD hosts, this chart shows the disk bandwidth (read bytes/sec + write bytes/sec) of the physical OSD device. Each device is shown by device name, and corresponding OSD id",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 11,
-        "x": 12,
-        "y": 12
-      },
-      "id": 8,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "connected",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*read/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace((irate(node_disk_bytes_written{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_written_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}}) write",
-          "refId": "B"
-        },
-        {
-          "expr": "label_replace((irate(node_disk_bytes_read{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_read_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}}) read",
-          "refId": "C"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$ceph_hosts Throughput by Disk",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "$ceph_hosts System Overview",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 3,
+            "x": 0,
+            "y": 1
+         },
+         "id": 3,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "count(sum by (ceph_daemon) (ceph_osd_metadata{hostname='$ceph_hosts'}))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "OSDs",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "For OSD hosts, this chart shows the latency at the physical drive. Each drive is shown by device name, with it's corresponding OSD id",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 11,
-        "x": 0,
-        "y": 21
+      {
+         "aliasColors": {
+            "interrupt": "#447EBC",
+            "steal": "#6D1F62",
+            "system": "#890F02",
+            "user": "#3F6833",
+            "wait": "#C15C17"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Shows the CPU breakdown. When multiple servers are selected, only the first host's cpu data is shown",
+         "fill": 1,
+         "gridPos": {
+            "h": 10,
+            "w": 6,
+            "x": 3,
+            "y": 1
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum by (mode) (\n  irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m]) or\n  irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m])\n) / scalar(\n  sum(irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]) or\n      irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]))\n) * 100",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{mode}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "CPU Utilization",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "percent",
+               "label": "% Utilization",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "id": 7,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "aliasColors": {
+            "Available": "#508642",
+            "Free": "#508642",
+            "Total": "#bf1b00",
+            "Used": "#bf1b00",
+            "total": "#bf1b00",
+            "used": "#0a50a1"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 10,
+            "w": 6,
+            "x": 9,
+            "y": 1
+         },
+         "id": 5,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "total",
+               "color": "#bf1b00",
+               "fill": 0,
+               "linewidth": 2,
+               "stack": false
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "node_memory_MemFree{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"} ",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Free",
+               "refId": "A"
+            },
+            {
+               "expr": "node_memory_MemTotal{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"} ",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "total",
+               "refId": "B"
+            },
+            {
+               "expr": "(node_memory_Cached{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) + \n(node_memory_Buffers{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) +\n(node_memory_Slab{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) \n",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "buffers/cache",
+               "refId": "C"
+            },
+            {
+               "expr": "(node_memory_MemTotal{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})- (\n  (node_memory_MemFree{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})  + \n  (node_memory_Cached{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) + \n  (node_memory_Buffers{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) +\n  (node_memory_Slab{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})\n  )\n  \n",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "used",
+               "refId": "D"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "RAM Usage",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": "RAM used",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "max by(instance,device) (label_replace((irate(node_disk_write_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_writes_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001) or   (irate(node_disk_read_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_reads_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")) *  on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}})",
-          "refId": "D"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$ceph_hosts Disk Latency",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Show the network load (rx,tx) across all interfaces (excluding loopback 'lo')",
+         "fill": 1,
+         "gridPos": {
+            "h": 10,
+            "w": 6,
+            "x": 15,
+            "y": 1
+         },
+         "id": 6,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*tx/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum by (device) (\n  irate(node_network_receive_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or \n  irate(node_network_receive_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.rx",
+               "refId": "A"
+            },
+            {
+               "expr": "sum by (device) (\n  irate(node_network_transmit_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or\n  irate(node_network_transmit_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.tx",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Network Load",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "decbytes",
+               "label": "Send (-) / Receive (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 5,
+            "w": 3,
+            "x": 21,
+            "y": 1
+         },
+         "id": 7,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*tx/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(node_network_receive_drop{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_drop_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.rx",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(node_network_transmit_drop{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_drop_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.tx",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Network drop rate",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "pps",
+               "label": "Send (-) / Receive (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "format": "s",
-          "label": "",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Show disk utilization % (util) of any OSD devices on the host by the physical device name and associated OSD id.",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 11,
-        "x": 12,
-        "y": 21
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Each OSD consists of a Journal/WAL partition and a data partition. The RAW Capacity shown is the sum of the data partitions across all OSDs on the selected OSD hosts.",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 3,
+            "x": 0,
+            "y": 6
+         },
+         "id": 8,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_osd_stat_bytes and on (ceph_daemon) ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"})",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Raw Capacity",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "id": 5,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 5,
+            "w": 3,
+            "x": 21,
+            "y": 6
+         },
+         "id": 9,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*tx/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(node_network_receive_errs{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_errs_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.rx",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(node_network_transmit_errs{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_errs_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}.tx",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Network error rate",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "pps",
+               "label": "Send (-) / Receive (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "maxPerRow": 2,
-      "nullPointMode": "connected",
-      "options": {
-        "dataLinks": []
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 11
+         },
+         "id": 10,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "OSD Disk Performance Statistics",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(((irate(node_disk_io_time_ms{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) / 10 ) or  irate(node_disk_io_time_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "hide": false,
-          "intervalFactor": 1,
-          "legendFormat": "{{device}}({{ceph_daemon}})",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "$ceph_hosts Disk utilization",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "For any OSD devices on the host, this chart shows the iops per physical device. Each device is shown by it's name and corresponding OSD id value",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 11,
+            "x": 0,
+            "y": 12
+         },
+         "id": 11,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "connected",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*reads/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(\n  (\n    irate(node_disk_writes_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or\n    irate(node_disk_writes_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])\n  ),\n  \"instance\",\n  \"$1\",\n  \"instance\",\n  \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}}) writes",
+               "refId": "A"
+            },
+            {
+               "expr": "label_replace(\n    (irate(node_disk_reads_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}}) reads",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$ceph_hosts Disk IOPS",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ops",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "For OSD hosts, this chart shows the disk bandwidth (read bytes/sec + write bytes/sec) of the physical OSD device. Each device is shown by device name, and corresponding OSD id",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 11,
+            "x": 12,
+            "y": 12
+         },
+         "id": 12,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "connected",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*read/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace((irate(node_disk_bytes_written{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_written_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}}) write",
+               "refId": "A"
+            },
+            {
+               "expr": "label_replace((irate(node_disk_bytes_read{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_read_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}}) read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$ceph_hosts Throughput by Disk",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "format": "percent",
-          "label": "%Util",
-          "logBase": 1,
-          "max": "100",
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "refresh": "10s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [
-    "overview"
-  ],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "default",
-          "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "For OSD hosts, this chart shows the latency at the physical drive. Each drive is shown by device name, with it's corresponding OSD id",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 11,
+            "x": 0,
+            "y": 21
+         },
+         "id": 13,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "max by(instance,device) (label_replace((irate(node_disk_write_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_writes_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001) or   (irate(node_disk_read_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_reads_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")) *  on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}})",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$ceph_hosts Disk Latency",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": "",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 0,
-        "includeAll": false,
-        "label": "Hostname",
-        "multi": false,
-        "name": "ceph_hosts",
-        "options": [],
-        "query": "label_values(node_scrape_collector_success, instance) ",
-        "refresh": 1,
-        "regex": "([^.:]*).*",
-        "skipUrlSync": false,
-        "sort": 3,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Show disk utilization % (util) of any OSD devices on the host by the physical device name and associated OSD id.",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 11,
+            "x": 12,
+            "y": 21
+         },
+         "id": 14,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "connected",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(((irate(node_disk_io_time_ms{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) / 10 ) or  irate(node_disk_io_time_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}}({{ceph_daemon}})",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$ceph_hosts Disk utilization",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "percent",
+               "label": "%Util",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "Host Details",
-  "uid": "rtOg0AiWz",
-  "version": 4
+   ],
+   "refresh": "10s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [
+      "overview"
+   ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": false,
+            "label": "Hostname",
+            "multi": false,
+            "name": "ceph_hosts",
+            "options": [ ],
+            "query": "label_values(node_scrape_collector_success, instance) ",
+            "refresh": 1,
+            "regex": "([^.:]*).*",
+            "sort": 3,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "Host Details",
+   "uid": "rtOg0AiWz",
+   "version": 0
 }
index b179d5717d536c37c37a3d67f96cab130a05fbd9..115c1824974fe4cfc97cfd823b05d37d36a84bfe 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "singlestat",
-      "name": "Singlestat",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1557393917915,
-  "links": [],
-  "panels": [
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 0,
-        "y": 0
-      },
-      "id": 5,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "count(sum by (hostname) (ceph_osd_metadata))",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "OSD Hosts",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Average CPU busy across all hosts (OSD, RGW, MON etc) within the cluster",
-      "decimals": 2,
-      "format": "percentunit",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 4,
-        "y": 0
-      },
-      "id": 6,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "avg(\n  1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "AVG CPU Busy",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Average Memory Usage across all hosts in the cluster (excludes buffer/cache usage)",
-      "decimals": 2,
-      "format": "percentunit",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 8,
-        "y": 0
-      },
-      "id": 9,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "avg (((node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})- (\n  (node_memory_MemFree{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemFree_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})  + \n  (node_memory_Cached{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Cached_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n  (node_memory_Buffers{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Buffers_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) +\n  (node_memory_Slab{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Slab_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})\n  )) /\n (node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$rgw_hosts|$mon_hosts|$mds_hosts).*\"} ))",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "AVG RAM Utilization",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "IOPS Load at the device as reported by the OS on all OSD hosts",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 12,
-        "y": 0
-      },
-      "id": 2,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum ((irate(node_disk_reads_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($osd_hosts).*\"}[5m]) )  + \n(irate(node_disk_writes_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_writes_completed_total{instance=~\"($osd_hosts).*\"}[5m])))",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "Physical IOPS",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Average Disk utilization for all OSD data devices (i.e. excludes journal/WAL)",
-      "format": "percent",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 16,
-        "y": 0
-      },
-      "id": 20,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr" : "avg (\n  label_replace((irate(node_disk_io_time_ms[5m]) / 10 ) or\n   (irate(node_disk_io_time_seconds_total[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\"\n  ) *\n  on(instance, device, ceph_daemon) label_replace(label_replace(ceph_disk_occupation{instance=~\"($osd_hosts).*\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\")\n)",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "AVG Disk Utilization",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "decimals": 0,
-      "description": "Total send/receive network load across all hosts in the ceph cluster",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 5,
-        "w": 4,
-        "x": 20,
-        "y": 0
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.2"
       },
-      "id": 18,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum (\n  irate(node_network_receive_bytes{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m]) or\n  irate(node_network_receive_bytes_total{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m])\n  ) +\nsum (\n  irate(node_network_transmit_bytes{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m]) or\n  irate(node_network_transmit_bytes_total{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m])\n  )",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "Network Load",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Show the top 10 busiest hosts by cpu",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 12,
-        "x": 0,
-        "y": 5
-      },
-      "id": 13,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": false,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "topk(10,100 * ( 1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "CPU Busy - Top 10 Hosts",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       },
-      "yaxes": [
-        {
-          "decimals": 1,
-          "format": "percent",
-          "label": null,
-          "logBase": 1,
-          "max": "100",
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "singlestat",
+         "name": "Singlestat",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Top 10 hosts by network load",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 12,
-        "x": 12,
-        "y": 5
-      },
-      "id": 19,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": false,
-        "total": false,
-        "values": false
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "count(sum by (hostname) (ceph_osd_metadata))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "OSD Hosts",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "topk(10, (sum by(instance) (\n  (\n  irate(node_network_receive_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]) or\n  irate(node_network_receive_bytes_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n  ) +\n  (\n  irate(node_network_transmit_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]) or\n  irate(node_network_transmit_bytes_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n  ))\n  )\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Network Load - Top 10 Hosts",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Average CPU busy across all hosts (OSD, RGW, MON etc) within the cluster",
+         "format": "percentunit",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 4,
+            "y": 0
+         },
+         "id": 3,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "avg(\n  1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "AVG CPU Busy",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Average Memory Usage across all hosts in the cluster (excludes buffer/cache usage)",
+         "format": "percentunit",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 8,
+            "y": 0
+         },
+         "id": 4,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "avg (((node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})- (\n  (node_memory_MemFree{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemFree_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})  + \n  (node_memory_Cached{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Cached_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n  (node_memory_Buffers{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Buffers_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) +\n  (node_memory_Slab{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Slab_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})\n  )) /\n (node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$rgw_hosts|$mon_hosts|$mds_hosts).*\"} ))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "AVG RAM Utilization",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "yaxes": [
-        {
-          "decimals": 1,
-          "format": "Bps",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "refresh": "10s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "default",
-          "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "IOPS Load at the device as reported by the OS on all OSD hosts",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 12,
+            "y": 0
+         },
+         "id": 5,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum ((irate(node_disk_reads_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($osd_hosts).*\"}[5m]) )  + \n(irate(node_disk_writes_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_writes_completed_total{instance=~\"($osd_hosts).*\"}[5m])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Physical IOPS",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
       {
-        "allValue": "",
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 2,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "osd_hosts",
-        "options": [],
-        "query": "label_values(ceph_disk_occupation, exported_instance)",
-        "refresh": 1,
-        "regex": "([^.]*).*",
-        "skipUrlSync": false,
-        "sort": 1,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "ceph",
-        "type": "query",
-        "useTags": false
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Average Disk utilization for all OSD data devices (i.e. excludes journal/WAL)",
+         "format": "percent",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 16,
+            "y": 0
+         },
+         "id": 6,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "avg (\n  label_replace((irate(node_disk_io_time_ms[5m]) / 10 ) or\n   (irate(node_disk_io_time_seconds_total[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\"\n  ) *\n  on(instance, device, ceph_daemon) label_replace(label_replace(ceph_disk_occupation{instance=~\"($osd_hosts).*\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\")\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "AVG Disk Utilization",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 2,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "mon_hosts",
-        "options": [],
-        "query": "label_values(ceph_mon_metadata, ceph_daemon)",
-        "refresh": 1,
-        "regex": "mon.(.*)",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Total send/receive network load across all hosts in the ceph cluster",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 5,
+            "w": 4,
+            "x": 20,
+            "y": 0
+         },
+         "id": 7,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum (\n\t(\n\t\tirate(node_network_receive_bytes{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m]) or\n\t\tirate(node_network_receive_bytes_total{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m])\n\t) unless on (device, instance)\n\tlabel_replace((bonding_slaves > 0), \"device\", \"$1\", \"master\", \"(.+)\")\n) +\nsum (\n\t(\n\t\tirate(node_network_transmit_bytes{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m]) or\n\t\tirate(node_network_transmit_bytes_total{instance=~\"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*\",device!=\"lo\"}[1m])\n\t) unless on (device, instance)\n\tlabel_replace((bonding_slaves > 0), \"device\", \"$1\", \"master\", \"(.+)\")\n\t)\n",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Network Load",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 2,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "mds_hosts",
-        "options": [],
-        "query": "label_values(ceph_mds_inodes, ceph_daemon)",
-        "refresh": 1,
-        "regex": "mds.(.*)",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Show the top 10 busiest hosts by cpu",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 12,
+            "x": 0,
+            "y": 5
+         },
+         "id": 8,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "topk(10,100 * ( 1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode='idle',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "CPU Busy - Top 10 Hosts",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "percent",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 2,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "rgw_hosts",
-        "options": [],
-        "query": "label_values(ceph_rgw_qlen, ceph_daemon)",
-        "refresh": 1,
-        "regex": "rgw.(.*)",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Top 10 hosts by network load",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 12,
+            "x": 12,
+            "y": 5
+         },
+         "id": 9,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "topk(10, (sum by(instance) (\n(\n\tirate(node_network_receive_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]) or\n\tirate(node_network_receive_bytes_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n) +\n(\n\tirate(node_network_transmit_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m]) or\n\tirate(node_network_transmit_bytes_total{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\",device!=\"lo\"}[1m])\n) unless on (device, instance)\n\tlabel_replace((bonding_slaves > 0), \"device\", \"$1\", \"master\", \"(.+)\"))\n))\n",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Network Load - Top 10 Hosts",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "Host Overview",
-  "uid": "y0KGL0iZz",
-  "version": 3
+   ],
+   "refresh": "10s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": null,
+            "multi": false,
+            "name": "osd_hosts",
+            "options": [ ],
+            "query": "label_values(ceph_disk_occupation, exported_instance)",
+            "refresh": 1,
+            "regex": "([^.]*).*",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": null,
+            "multi": false,
+            "name": "mon_hosts",
+            "options": [ ],
+            "query": "label_values(ceph_mon_metadata, ceph_daemon)",
+            "refresh": 1,
+            "regex": "mon.(.*)",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": null,
+            "multi": false,
+            "name": "mds_hosts",
+            "options": [ ],
+            "query": "label_values(ceph_mds_inodes, ceph_daemon)",
+            "refresh": 1,
+            "regex": "mds.(.*)",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": null,
+            "multi": false,
+            "name": "rgw_hosts",
+            "options": [ ],
+            "query": "label_values(ceph_rgw_qlen, ceph_daemon)",
+            "refresh": 1,
+            "regex": "rgw.(.*)",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "Host Overview",
+   "uid": "y0KGL0iZz",
+   "version": 0
 }
index 11c89b212552fc2bafa056218a86c3c7e0a8da08..b9f5bffaa808ac7c9b957781a6866dc61b9751a2 100644 (file)
 local g = import 'grafana.libsonnet';
 
-local dashboardSchema(title, uid, time_from, refresh, schemaVersion, tags,timezone, timepicker) =
-  g.dashboard.new(title=title, uid=uid, time_from=time_from, refresh=refresh, schemaVersion=schemaVersion, tags=tags, timezone=timezone, timepicker=timepicker);
+local dashboardSchema(title, description, uid, time_from, refresh, schemaVersion, tags, timezone, timepicker) =
+  g.dashboard.new(title=title, description=description, uid=uid, time_from=time_from, refresh=refresh, schemaVersion=schemaVersion, tags=tags, timezone=timezone, timepicker=timepicker);
 
-local graphPanelSchema(title, nullPointMode, stack, formatY1, formatY2, labelY1, labelY2, min, fill, datasource) =
-  g.graphPanel.new(title=title, nullPointMode=nullPointMode, stack=stack, formatY1=formatY1, formatY2=formatY2, labelY1=labelY1, labelY2=labelY2, min=min, fill=fill, datasource=datasource);
+local graphPanelSchema(aliasColors, title, description, nullPointMode, stack, formatY1, formatY2, labelY1, labelY2, min, fill, datasource) =
+  g.graphPanel.new(aliasColors=aliasColors, title=title, description=description, nullPointMode=nullPointMode, stack=stack, formatY1=formatY1, formatY2=formatY2, labelY1=labelY1, labelY2=labelY2, min=min, fill=fill, datasource=datasource);
 
 local addTargetSchema(expr, intervalFactor, format, legendFormat) =
   g.prometheus.target(expr=expr, intervalFactor=intervalFactor, format=format, legendFormat=legendFormat);
 
-local addTemplateSchema(name, datasource, query, refresh, hide, includeAll, sort) =
-  g.template.new(name=name, datasource=datasource, query=query, refresh=refresh, hide=hide, includeAll=includeAll, sort=sort);
+local addTemplateSchema(name, datasource, query, refresh, includeAll, sort, label, regex) =
+  g.template.new(name=name, datasource=datasource, query=query, refresh=refresh, includeAll=includeAll, sort=sort, label=label, regex=regex);
 
 local addAnnotationSchema(builtIn, datasource, enable, hide, iconColor, name, type) =
   g.annotation.datasource(builtIn=builtIn, datasource=datasource, enable=enable, hide=hide, iconColor=iconColor, name=name, type=type);
 
+local addRowSchema(collapse, showTitle, title) =
+  g.row.new(collapse=collapse, showTitle=showTitle, title=title);
+
+local addSingelStatSchema(datasource, format, title, description, valueName, colorValue, gaugeMaxValue, gaugeShow, sparklineShow, thresholds) =
+  g.singlestat.new(datasource=datasource, format=format, title=title, description=description, valueName=valueName, colorValue=colorValue, gaugeMaxValue=gaugeMaxValue, gaugeShow=gaugeShow, sparklineShow=sparklineShow, thresholds=thresholds);
+
+local addPieChartSchema(aliasColors, datasource, description, legendType, pieType, title, valueName) =
+  g.pieChartPanel.new(aliasColors=aliasColors, datasource=datasource, description=description, legendType=legendType, pieType=pieType, title=title, valueName=valueName);
+
+local addTableSchema(datasource, description, sort, styles, title, transform) =
+  g.tablePanel.new(datasource=datasource, description=description, sort=sort, styles=styles, title=title, transform=transform);
+
+local addStyle(alias, colorMode, colors, dateFormat, decimals, mappingType, pattern, thresholds, type, unit, valueMaps) =
+  {'alias': alias, 'colorMode': colorMode, 'colors':colors, 'dateFormat':dateFormat, 'decimals':decimals, 'mappingType':mappingType, 'pattern':pattern, 'thresholds':thresholds, 'type':type, 'unit':unit, 'valueMaps':valueMaps};
+
+{
+  "hosts-overview.json":
+    local HostsOverviewSingleStatPanel(format, title, description, valueName, expr, targetFormat, x, y, w, h) =
+      addSingelStatSchema('$datasource', format, title, description, valueName, false, 100, false, false, '')
+      .addTarget(addTargetSchema(expr, 1, targetFormat, '')) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    local HostsOverviewGraphPanel(title, description, formatY1, expr, legendFormat, x, y, w, h) =
+      graphPanelSchema({}, title, description, 'null', false, formatY1, 'short', null, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'Host Overview', '', 'y0KGL0iZz', 'now-1h', '10s', 16, [], '', {refresh_intervals:['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='singlestat', name='Singlestat', version='5.0.0'
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('osd_hosts', '$datasource', 'label_values(ceph_disk_occupation, exported_instance)', 1, true, 1, null, '([^.]*).*')
+    )
+    .addTemplate(
+       addTemplateSchema('mon_hosts', '$datasource', 'label_values(ceph_mon_metadata, ceph_daemon)', 1, true, 1, null, 'mon.(.*)')
+    )
+    .addTemplate(
+       addTemplateSchema('mds_hosts', '$datasource', 'label_values(ceph_mds_inodes, ceph_daemon)', 1, true, 1, null, 'mds.(.*)')
+    )
+    .addTemplate(
+       addTemplateSchema('rgw_hosts', '$datasource', 'label_values(ceph_rgw_qlen, ceph_daemon)', 1, true, 1, null, 'rgw.(.*)')
+    )
+    .addPanels([
+      HostsOverviewSingleStatPanel(
+        'none', 'OSD Hosts', '', 'current', 'count(sum by (hostname) (ceph_osd_metadata))', 'time_series', 0, 0, 4, 5),
+      HostsOverviewSingleStatPanel(
+        'percentunit', 'AVG CPU Busy', 'Average CPU busy across all hosts (OSD, RGW, MON etc) within the cluster', 'current', 'avg(\n  1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode=\'idle\',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode=\'idle\',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )', 'time_series', 4, 0, 4, 5),
+      HostsOverviewSingleStatPanel(
+        'percentunit', 'AVG RAM Utilization', 'Average Memory Usage across all hosts in the cluster (excludes buffer/cache usage)', 'current', 'avg (((node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})- (\n  (node_memory_MemFree{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemFree_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})  + \n  (node_memory_Cached{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Cached_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) + \n  (node_memory_Buffers{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Buffers_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}) +\n  (node_memory_Slab{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_Slab_bytes{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"})\n  )) /\n (node_memory_MemTotal{instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"} or node_memory_MemTotal_bytes{instance=~\"($osd_hosts|$rgw_hosts|$mon_hosts|$mds_hosts).*\"} ))', 'time_series', 8, 0, 4, 5),
+      HostsOverviewSingleStatPanel(
+        'none', 'Physical IOPS', 'IOPS Load at the device as reported by the OS on all OSD hosts', 'current', 'sum ((irate(node_disk_reads_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($osd_hosts).*\"}[5m]) )  + \n(irate(node_disk_writes_completed{instance=~\"($osd_hosts).*\"}[5m]) or irate(node_disk_writes_completed_total{instance=~\"($osd_hosts).*\"}[5m])))', 'time_series', 12, 0, 4, 5),
+      HostsOverviewSingleStatPanel(
+        'percent', 'AVG Disk Utilization', 'Average Disk utilization for all OSD data devices (i.e. excludes journal/WAL)', 'current', 'avg (\n  label_replace((irate(node_disk_io_time_ms[5m]) / 10 ) or\n   (irate(node_disk_io_time_seconds_total[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\"\n  ) *\n  on(instance, device, ceph_daemon) label_replace(label_replace(ceph_disk_occupation{instance=~\"($osd_hosts).*\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^.:]*).*\")\n)', 'time_series', 16, 0, 4, 5),
+      HostsOverviewSingleStatPanel(
+        'bytes', 'Network Load', 'Total send/receive network load across all hosts in the ceph cluster', 'current', |||
+               sum (
+                       (
+                               irate(node_network_receive_bytes{instance=~"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*",device!="lo"}[1m]) or
+                               irate(node_network_receive_bytes_total{instance=~"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*",device!="lo"}[1m])
+                       ) unless on (device, instance)
+                       label_replace((bonding_slaves > 0), "device", "$1", "master", "(.+)")
+               ) +
+               sum (
+                       (
+                               irate(node_network_transmit_bytes{instance=~"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*",device!="lo"}[1m]) or
+                               irate(node_network_transmit_bytes_total{instance=~"($osd_hosts|mon_hosts|mds_hosts|rgw_hosts).*",device!="lo"}[1m])
+                       ) unless on (device, instance)
+                       label_replace((bonding_slaves > 0), "device", "$1", "master", "(.+)")
+                       )
+       |||
+       , 'time_series', 20, 0, 4, 5),
+      HostsOverviewGraphPanel(
+        'CPU Busy - Top 10 Hosts', 'Show the top 10 busiest hosts by cpu', 'percent', 'topk(10,100 * ( 1 - (\n    avg by(instance) \n      (irate(node_cpu_seconds_total{mode=\'idle\',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]) or\n       irate(node_cpu{mode=\'idle\',instance=~\"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*\"}[1m]))\n    )\n  )\n)', '{{instance}}', 0, 5, 12, 9),
+      HostsOverviewGraphPanel(
+        'Network Load - Top 10 Hosts', 'Top 10 hosts by network load', 'Bps', |||
+               topk(10, (sum by(instance) (
+               (
+                       irate(node_network_receive_bytes{instance=~"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*",device!="lo"}[1m]) or
+                       irate(node_network_receive_bytes_total{instance=~"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*",device!="lo"}[1m])
+               ) +
+               (
+                       irate(node_network_transmit_bytes{instance=~"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*",device!="lo"}[1m]) or
+                       irate(node_network_transmit_bytes_total{instance=~"($osd_hosts|$mon_hosts|$mds_hosts|$rgw_hosts).*",device!="lo"}[1m])
+               ) unless on (device, instance)
+                       label_replace((bonding_slaves > 0), "device", "$1", "master", "(.+)"))
+               ))
+       |||
+       , '{{instance}}', 12, 5, 12, 9),
+    ])
+}
+{
+  "host-details.json":
+    local HostDetailsSingleStatPanel(format, title, description, valueName, expr, targetFormat, x, y, w, h) =
+      addSingelStatSchema('$datasource', format, title, description, valueName, false, 100, false, false, '')
+      .addTarget(addTargetSchema(expr, 1, targetFormat, '')) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    local HostDetailsGraphPanel(alias, title, description, nullPointMode, formatY1, labelY1, expr, legendFormat, x, y, w, h) =
+      graphPanelSchema(alias, title, description, nullPointMode, false, formatY1, 'short', labelY1, null, null, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'Host Details', '', 'rtOg0AiWz', 'now-1h', '10s', 16, ['overview'], '', {refresh_intervals:['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='singlestat', name='Singlestat', version='5.0.0'
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('ceph_hosts', '$datasource', 'label_values(node_scrape_collector_success, instance) ', 1, false, 3, 'Hostname', '([^.:]*).*')
+    )
+    .addPanels([
+      addRowSchema(false, true, '$ceph_hosts System Overview') + {gridPos: {x: 0, y: 0, w: 24, h: 1}},
+      HostDetailsSingleStatPanel(
+        'none', 'OSDs', '', 'current', 'count(sum by (ceph_daemon) (ceph_osd_metadata{hostname=\'$ceph_hosts\'}))', 'time_series', 0, 1, 3, 5
+      ),
+      HostDetailsGraphPanel(
+        {"interrupt": "#447EBC","steal": "#6D1F62","system": "#890F02","user": "#3F6833","wait": "#C15C17"},'CPU Utilization', 'Shows the CPU breakdown. When multiple servers are selected, only the first host\'s cpu data is shown', 'null', 'percent', '% Utilization', 'sum by (mode) (\n  irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m]) or\n  irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\", mode=~\"(irq|nice|softirq|steal|system|user|iowait)\"}[1m])\n) / scalar(\n  sum(irate(node_cpu{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]) or\n      irate(node_cpu_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[1m]))\n) * 100', '{{mode}}', 3, 1, 6, 10
+      ),
+      HostDetailsGraphPanel(
+        {"Available": "#508642","Free": "#508642","Total": "#bf1b00","Used": "#bf1b00","total": "#bf1b00","used": "#0a50a1"},'RAM Usage', '', 'null', 'bytes', 'RAM used', 'node_memory_MemFree{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"} ', 'Free', 9, 1, 6, 10)
+      .addTargets(
+        [addTargetSchema('node_memory_MemTotal{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"} ', 1, 'time_series', 'total'),
+        addTargetSchema('(node_memory_Cached{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) + \n(node_memory_Buffers{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) +\n(node_memory_Slab{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) \n', 1, 'time_series', 'buffers/cache'),
+        addTargetSchema('(node_memory_MemTotal{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemTotal_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})- (\n  (node_memory_MemFree{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_MemFree_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})  + \n  (node_memory_Cached{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Cached_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) + \n  (node_memory_Buffers{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Buffers_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"}) +\n  (node_memory_Slab{instance=~\"$ceph_hosts([\\\\.:].*)?\"} or node_memory_Slab_bytes{instance=~\"$ceph_hosts([\\\\.:].*)?\"})\n  )\n  \n', 1, 'time_series', 'used')])
+      .addSeriesOverride({"alias": "total","color": "#bf1b00","fill": 0,"linewidth": 2,"stack": false}
+      ),
+      HostDetailsGraphPanel(
+        {},'Network Load', 'Show the network load (rx,tx) across all interfaces (excluding loopback \'lo\')', 'null', 'decbytes', 'Send (-) / Receive (+)', 'sum by (device) (\n  irate(node_network_receive_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or \n  irate(node_network_receive_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)', '{{device}}.rx', 15, 1, 6, 10)
+      .addTargets(
+        [addTargetSchema('sum by (device) (\n  irate(node_network_transmit_bytes{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m]) or\n  irate(node_network_transmit_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\",device!=\"lo\"}[1m])\n)', 1, 'time_series', '{{device}}.tx')])
+      .addSeriesOverride({"alias": "/.*tx/","transform": "negative-Y"}
+      ),
+      HostDetailsGraphPanel(
+        {},'Network drop rate', '', 'null', 'pps', 'Send (-) / Receive (+)', 'irate(node_network_receive_drop{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_drop_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])', '{{device}}.rx', 21, 1, 3, 5)
+      .addTargets(
+        [addTargetSchema('irate(node_network_transmit_drop{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_drop_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])', 1, 'time_series', '{{device}}.tx')])
+      .addSeriesOverride({"alias": "/.*tx/","transform": "negative-Y"}
+      ),
+      HostDetailsSingleStatPanel(
+        'bytes', 'Raw Capacity', 'Each OSD consists of a Journal/WAL partition and a data partition. The RAW Capacity shown is the sum of the data partitions across all OSDs on the selected OSD hosts.', 'current', 'sum(ceph_osd_stat_bytes and on (ceph_daemon) ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"})', 'time_series', 0, 6, 3, 5
+      ),
+      HostDetailsGraphPanel(
+        {},'Network error rate', '', 'null', 'pps', 'Send (-) / Receive (+)', 'irate(node_network_receive_errs{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_receive_errs_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])', '{{device}}.rx', 21, 6, 3, 5)
+      .addTargets(
+        [addTargetSchema('irate(node_network_transmit_errs{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m]) or irate(node_network_transmit_errs_total{instance=~\"$ceph_hosts([\\\\.:].*)?\"}[1m])', 1, 'time_series', '{{device}}.tx')])
+      .addSeriesOverride({"alias": "/.*tx/","transform": "negative-Y"}
+      ),
+      addRowSchema(false, true, 'OSD Disk Performance Statistics') + {gridPos: {x: 0, y: 11, w: 24, h: 1}},
+      HostDetailsGraphPanel(
+        {},'$ceph_hosts Disk IOPS', 'For any OSD devices on the host, this chart shows the iops per physical device. Each device is shown by it\'s name and corresponding OSD id value', 'connected', 'ops', 'Read (-) / Write (+)', 'label_replace(\n  (\n    irate(node_disk_writes_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or\n    irate(node_disk_writes_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])\n  ),\n  \"instance\",\n  \"$1\",\n  \"instance\",\n  \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )', '{{device}}({{ceph_daemon}}) writes', 0, 12, 11, 9)
+      .addTargets(
+        [addTargetSchema('label_replace(\n    (irate(node_disk_reads_completed{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_reads_completed_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n)\n* on(instance, device, ceph_daemon) group_left\n  label_replace(\n    label_replace(\n      ceph_disk_occupation,\n      \"device\",\n      \"$1\",\n      \"device\",\n      \"/dev/(.*)\"\n    ),\n    \"instance\",\n    \"$1\",\n    \"instance\",\n    \"([^:.]*).*\"\n  )', 1, 'time_series', '{{device}}({{ceph_daemon}}) reads')])
+      .addSeriesOverride({"alias": "/.*reads/","transform": "negative-Y"}
+      ),
+      HostDetailsGraphPanel(
+        {},'$ceph_hosts Throughput by Disk', 'For OSD hosts, this chart shows the disk bandwidth (read bytes/sec + write bytes/sec) of the physical OSD device. Each device is shown by device name, and corresponding OSD id', 'connected', 'Bps', 'Read (-) / Write (+)', 'label_replace((irate(node_disk_bytes_written{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_written_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', '{{device}}({{ceph_daemon}}) write', 12, 12, 11, 9)
+      .addTargets(
+        [addTargetSchema('label_replace((irate(node_disk_bytes_read{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) or irate(node_disk_read_bytes_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m])), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', 1, 'time_series', '{{device}}({{ceph_daemon}}) read')])
+      .addSeriesOverride({"alias": "/.*read/","transform": "negative-Y"}
+      ),
+      HostDetailsGraphPanel(
+        {},'$ceph_hosts Disk Latency', 'For OSD hosts, this chart shows the latency at the physical drive. Each drive is shown by device name, with it\'s corresponding OSD id', 'null as zero', 's', '', 'max by(instance,device) (label_replace((irate(node_disk_write_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_writes_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001) or   (irate(node_disk_read_time_seconds_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) )  / clamp_min(irate(node_disk_reads_completed_total{ instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]), 0.001), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")) *  on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', '{{device}}({{ceph_daemon}})', 0, 21, 11, 9
+      ),
+      HostDetailsGraphPanel(
+        {},'$ceph_hosts Disk utilization', 'Show disk utilization % (util) of any OSD devices on the host by the physical device name and associated OSD id.', 'connected', 'percent', '%Util', 'label_replace(((irate(node_disk_io_time_ms{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) / 10 ) or  irate(node_disk_io_time_seconds_total{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}[5m]) * 100), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") * on(instance, device, ceph_daemon) group_left label_replace(label_replace(ceph_disk_occupation{instance=~\"($ceph_hosts)([\\\\.:].*)?\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', '{{device}}({{ceph_daemon}})', 12, 21, 11, 9
+      )
+    ])
+}
 {
   "radosgw-sync-overview.json":
     local RgwSyncOverviewPanel(title, formatY1, labelY1, rgwMetric, x, y, w, h) =
-      graphPanelSchema(title, 'null as zero', true, formatY1, 'short', labelY1, null, 0, 1, '$datasource')
+      graphPanelSchema({}, title, '', 'null as zero', true, formatY1, 'short', labelY1, null, 0, 1, '$datasource')
       .addTargets(
         [addTargetSchema('sum by (source_zone) (rate(%s[30s]))' % rgwMetric, 1, 'time_series', '{{source_zone}}')]) + {gridPos: {x: x, y: y, w: w, h: h}};
 
     dashboardSchema(
-      'RGW Sync Overview', 'rgw-sync-overview', 'now-1h', '15s', 16, ["overview"], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+      'RGW Sync Overview', '', 'rgw-sync-overview', 'now-1h', '15s', 16, ["overview"], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
     )
     .addAnnotation(
       addAnnotationSchema(
@@ -36,7 +232,7 @@ local addAnnotationSchema(builtIn, datasource, enable, hide, iconColor, name, ty
        type='panel', id='graph', name='Graph', version='5.0.0'
     )
     .addTemplate(
-       addTemplateSchema('rgw_servers', '$datasource', 'prometehus', 1, 2, true, 1)
+       addTemplateSchema('rgw_servers', '$datasource', 'prometehus', 1, true, 1, '', '')
     )
     .addTemplate(
        g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
@@ -52,3 +248,507 @@ local addAnnotationSchema(builtIn, datasource, enable, hide, iconColor, name, ty
         'Unsuccessful Object Replications from Source Zone', 'short', 'Count/s', 'ceph_data_sync_from_zone_fetch_errors', 0, 7, 8, 7)
     ])
 }
+{
+  "radosgw-overview.json":
+    local RgwOverviewPanel(title, description, formatY1, formatY2, expr1, legendFormat1, x, y, w, h) =
+      graphPanelSchema({}, title, description, 'null', false, formatY1, formatY2, null, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr1, 1, 'time_series', legendFormat1)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'RGW Overview', '', 'WAkugZpiz', 'now-1h', '15s', 16, ['overview'], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addTemplate(
+       addTemplateSchema('rgw_servers', '$datasource', 'label_values(ceph_rgw_req, ceph_daemon)', 1, true, 1, '', '')
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addPanels([
+      addRowSchema(false, true, 'RGW Overview - All Gateways') + {gridPos: {x: 0, y: 0, w: 24, h: 1}},
+      RgwOverviewPanel(
+        'Average GET/PUT Latencies', '', 's', 'short', 'rate(ceph_rgw_get_initial_lat_sum[30s]) / rate(ceph_rgw_get_initial_lat_count[30s])', 'GET AVG', 0, 1, 8, 7).addTargets(
+        [addTargetSchema('rate(ceph_rgw_put_initial_lat_sum[30s]) / rate(ceph_rgw_put_initial_lat_count[30s])', 1, 'time_series', 'PUT AVG')]),
+      RgwOverviewPanel(
+        'Total Requests/sec by RGW Instance', '', 'none', 'short', 'sum by(rgw_host) (label_replace(rate(ceph_rgw_req[30s]), \"rgw_host\", \"$1\", \"ceph_daemon\", \"rgw.(.*)\"))', '{{rgw_host}}', 8, 1, 7, 7),
+      RgwOverviewPanel(
+        'GET Latencies by RGW Instance', 'Latencies are shown stacked, without a yaxis to provide a visual indication of GET latency imbalance across RGW hosts', 's', 'short', 'label_replace(rate(ceph_rgw_get_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_get_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")', '{{rgw_host}}', 15, 1, 6, 7),
+      RgwOverviewPanel(
+        'Bandwidth Consumed by Type', 'Total bytes transferred in/out of all radosgw instances within the cluster', 'bytes', 'short', 'sum(rate(ceph_rgw_get_b[30s]))', 'GETs', 0, 8, 8, 6).addTargets(
+        [addTargetSchema('sum(rate(ceph_rgw_put_b[30s]))', 1, 'time_series', 'PUTs')]),
+      RgwOverviewPanel(
+        'Bandwidth by RGW Instance', 'Total bytes transferred in/out through get/put operations, by radosgw instance', 'bytes', 'short', 'sum by(rgw_host) (\n  (label_replace(rate(ceph_rgw_get_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")) + \n  (label_replace(rate(ceph_rgw_put_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\"))\n)', '{{rgw_host}}', 8, 8, 7, 6),
+      RgwOverviewPanel(
+        'PUT Latencies by RGW Instance', 'Latencies are shown stacked, without a yaxis to provide a visual indication of PUT latency imbalance across RGW hosts', 's', 'short', 'label_replace(rate(ceph_rgw_put_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_put_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")', '{{rgw_host}}', 15, 8, 6, 6)
+    ])
+}
+{
+  "radosgw-detail.json":
+    local RgwDetailsPanel(aliasColors, title, description, formatY1, formatY2, expr1, expr2, legendFormat1, legendFormat2, x, y, w, h) =
+      graphPanelSchema(aliasColors, title, description, 'null', false, formatY1, formatY2, null, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr1, 1, 'time_series', legendFormat1),addTargetSchema(expr2, 1, 'time_series', legendFormat2)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'RGW Instance Detail', '', 'x5ARzZtmk', 'now-1h', '15s', 16, ['overview'], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='grafana-piechart-panel', name='Pie Chart', version='1.3.3'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('rgw_servers', '$datasource', 'label_values(ceph_rgw_req, ceph_daemon)', 1, true, 1, '', '')
+    )
+    .addPanels([
+      addRowSchema(false, true, 'RGW Host Detail : $rgw_servers') + {gridPos: {x: 0, y: 0, w: 24, h: 1}},
+      RgwDetailsPanel(
+        {}, '$rgw_servers GET/PUT Latencies', '', 's', 'short', 'sum by (ceph_daemon) (rate(ceph_rgw_get_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_get_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))', 'sum by (ceph_daemon)(rate(ceph_rgw_put_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_put_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))', 'GET {{ceph_daemon}}', 'PUT {{ceph_daemon}}', 0, 1, 6, 8),
+      RgwDetailsPanel(
+        {}, 'Bandwidth by HTTP Operation', '', 'bytes', 'short', 'rate(ceph_rgw_get_b{ceph_daemon=~\"$rgw_servers\"}[30s])', 'rate(ceph_rgw_put_b{ceph_daemon=~\"$rgw_servers\"}[30s])', 'GETs {{ceph_daemon}}', 'PUTs {{ceph_daemon}}', 6, 1, 7, 8),
+      RgwDetailsPanel(
+        {"GETs": "#7eb26d","Other": "#447ebc","PUTs": "#eab839","Requests": "#3f2b5b","Requests Failed": "#bf1b00"},'HTTP Request Breakdown', '', 'short', 'short', 'rate(ceph_rgw_failed_req{ceph_daemon=~\"$rgw_servers\"}[30s])', 'rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s])', 'Requests Failed {{ceph_daemon}}', 'GETs {{ceph_daemon}}', 13, 1, 7, 8)
+      .addTargets(
+        [addTargetSchema('rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s])', 1, 'time_series', 'PUTs {{ceph_daemon}}'),addTargetSchema('rate(ceph_rgw_req{ceph_daemon=~\"$rgw_servers\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s]))', 1, 'time_series', 'Other {{ceph_daemon}}')]),
+      addPieChartSchema(
+        {"GETs": "#7eb26d","Other (HEAD,POST,DELETE)": "#447ebc","PUTs": "#eab839","Requests": "#3f2b5b","Failures": "#bf1b00"},'$datasource', '', 'Under graph', 'pie', 'Workload Breakdown', 'current')
+      .addTarget(addTargetSchema('rate(ceph_rgw_failed_req{ceph_daemon=~\"$rgw_servers\"}[30s])', 1, 'time_series', 'Failures {{ceph_daemon}}'))
+      .addTarget(addTargetSchema('rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s])', 1, 'time_series', 'GETs {{ceph_daemon}}'))
+      .addTarget(addTargetSchema('rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s])', 1, 'time_series', 'PUTs {{ceph_daemon}}'))
+      .addTarget(addTargetSchema('rate(ceph_rgw_req{ceph_daemon=~\"$rgw_servers\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s]))', 1, 'time_series', 'Other (DELETE,LIST) {{ceph_daemon}}')) + {gridPos: {x: 20, y: 1, w: 4, h: 8}}
+    ])
+}
+{
+  "rbd-details.json":
+    local RbdDetailsPanel(title, formatY1, expr1, expr2, x, y, w, h) =
+      graphPanelSchema({}, title, '', 'null as zero', false, formatY1, formatY1, null, null, 0, 1, '$Datasource')
+      .addTargets(
+        [addTargetSchema(expr1, 1, 'time_series', 'Write'),addTargetSchema(expr2, 1, 'time_series', 'Read')]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'RBD Details', 'Detailed Performance of RBD Images (IOPS/Throughput/Latency)', 'YhCYGcuZz', 'now-1h', false, 16, [], '', {refresh_intervals:['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.3'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('Datasource', 'prometheus', 'default', label=null)
+    )
+    .addTemplate(
+       addTemplateSchema('Pool', '$Datasource', 'label_values(pool)', 1, false, 0, '', '')
+    )
+    .addTemplate(
+       addTemplateSchema('Image', '$Datasource', 'label_values(image)', 1, false, 0, '', '')
+    )
+    .addPanels([
+      RbdDetailsPanel(
+        'IOPS', 'iops', 'irate(ceph_rbd_write_ops{pool=\"$Pool\", image=\"$Image\"}[30s])','irate(ceph_rbd_read_ops{pool=\"$Pool\", image=\"$Image\"}[30s])', 0, 0, 8, 9),
+      RbdDetailsPanel(
+        'Throughput', 'Bps', 'irate(ceph_rbd_write_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])', 'irate(ceph_rbd_read_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])', 8, 0, 8, 9),
+      RbdDetailsPanel(
+        'Average Latency', 'ns', 'irate(ceph_rbd_write_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_write_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])', 'irate(ceph_rbd_read_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_read_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])', 16, 0, 8, 9)
+    ])
+}
+{
+  "rbd-overview.json":
+    local RgwOverviewStyle(alias, pattern, type, unit) =
+      addStyle(alias, null, ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"], 'YYYY-MM-DD HH:mm:ss', 2, 1, pattern, [], type, unit, []);
+    local RbdOverviewPanel(title, formatY1, expr1, expr2, legendFormat1, legendFormat2, x, y, w, h) =
+      graphPanelSchema({}, title, '', 'null', false, formatY1, 'short', null, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr1, 1, 'time_series', legendFormat1),addTargetSchema(expr2, 1, 'time_series', legendFormat2)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'RBD Overview', '', '41FrpeUiz', 'now-1h', '30s', 16, ["overview"], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.4.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addRequired(
+       type='datasource', id='prometheus', name='Prometheus', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='table', name='Table', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addPanels([
+      RbdOverviewPanel(
+        'IOPS', 'short', 'round(sum(irate(ceph_rbd_write_ops[30s])))','round(sum(irate(ceph_rbd_read_ops[30s])))', 'Writes', 'Reads', 0, 0, 8, 7),
+      RbdOverviewPanel(
+        'Throughput', 'Bps', 'round(sum(irate(ceph_rbd_write_bytes[30s])))','round(sum(irate(ceph_rbd_read_bytes[30s])))', 'Write', 'Read', 8, 0, 8, 7),
+      RbdOverviewPanel(
+        'Average Latency', 'ns', 'round(sum(irate(ceph_rbd_write_latency_sum[30s])) / sum(irate(ceph_rbd_write_latency_count[30s])))','round(sum(irate(ceph_rbd_read_latency_sum[30s])) / sum(irate(ceph_rbd_read_latency_count[30s])))', 'Write', 'Read', 16, 0, 8, 7),
+      addTableSchema(
+        '$datasource', '', {"col": 3,"desc": true}, [RgwOverviewStyle('Pool', 'pool', 'string', 'short'),RgwOverviewStyle('Image', 'image', 'string', 'short'),RgwOverviewStyle('IOPS', 'Value', 'number', 'iops'), RgwOverviewStyle('', '/.*/', 'hidden', 'short')], 'Highest IOPS', 'table'
+      )
+      .addTarget(
+        addTargetSchema('topk(10, (sort((irate(ceph_rbd_write_ops[30s]) + on (image, pool, namespace) irate(ceph_rbd_read_ops[30s])))))', 1, 'table', '')
+      ) + {gridPos: {x: 0, y: 7, w: 8, h: 7}},
+      addTableSchema(
+        '$datasource', '', {"col": 3,"desc": true}, [RgwOverviewStyle('Pool', 'pool', 'string', 'short'),RgwOverviewStyle('Image', 'image', 'string', 'short'),RgwOverviewStyle('Throughput', 'Value', 'number', 'Bps'), RgwOverviewStyle('', '/.*/', 'hidden', 'short')], 'Highest Throughput', 'table'
+      )
+      .addTarget(
+        addTargetSchema('topk(10, sort(sum(irate(ceph_rbd_read_bytes[30s]) + irate(ceph_rbd_write_bytes[30s])) by (pool, image, namespace)))', 1, 'table', '')
+      ) + {gridPos: {x: 8, y: 7, w: 8, h: 7}},
+      addTableSchema(
+        '$datasource', '', {"col": 3,"desc": true}, [RgwOverviewStyle('Pool', 'pool', 'string', 'short'),RgwOverviewStyle('Image', 'image', 'string', 'short'),RgwOverviewStyle('Latency', 'Value', 'number', 'ns'), RgwOverviewStyle('', '/.*/', 'hidden', 'short')], 'Highest Latency', 'table'
+      )
+      .addTarget(
+        addTargetSchema('topk(10,\n  sum(\n    irate(ceph_rbd_write_latency_sum[30s]) / clamp_min(irate(ceph_rbd_write_latency_count[30s]), 1) +\n    irate(ceph_rbd_read_latency_sum[30s]) / clamp_min(irate(ceph_rbd_read_latency_count[30s]), 1)\n  ) by (pool, image, namespace)\n)', 1, 'table', '')
+      ) + {gridPos: {x: 16, y: 7, w: 8, h: 7}}
+    ])
+}
+{
+  "pool-overview.json":
+    local PoolOverviewSingleStatPanel(format, title, description, valueName, expr, targetFormat, x, y, w, h) =
+      addSingelStatSchema('$datasource', format, title, description, valueName, false, 100, false, false, '')
+      .addTarget(addTargetSchema(expr, 1, targetFormat, '')) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    local PoolOverviewStyle(alias, pattern, type, unit, colorMode, thresholds, valueMaps) =
+      addStyle(alias, colorMode, ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"], 'YYYY-MM-DD HH:mm:ss', 2, 1, pattern, thresholds, type, unit, valueMaps);
+
+    local PoolOverviewGraphPanel(title, description, formatY1, labelY1, expr, targetFormat, legendFormat, x, y, w, h) =
+      graphPanelSchema({}, title, description, 'null as zero', false, formatY1, 'short', labelY1, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'Ceph Pools Overview', '', 'z99hzWtmk', 'now-1h', '15s', 22, [], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'Dashboard1', label='Data Source')
+    )
+    .addTemplate(
+       g.template.custom(label='TopK', name='topk', current='15', query='15')
+    )
+    .addPanels([
+      PoolOverviewSingleStatPanel(
+        'none', 'Pools', '', 'avg', 'count(ceph_pool_metadata)', 'table', 0, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'none', 'Pools with Compression', 'Count of the pools that have compression enabled', 'current', 'count(ceph_pool_metadata{compression_mode!=\"none\"})', '', 3, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'bytes', 'Total Raw Capacity', 'Total raw capacity available to the cluster', 'current', 'sum(ceph_osd_stat_bytes)', '', 6, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'bytes', 'Raw Capacity Consumed', 'Total raw capacity consumed by user data and associated overheads (metadata + redundancy)', 'current', 'sum(ceph_pool_bytes_used)', '', 9, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'bytes', 'Logical Stored ', 'Total of client data stored in the cluster', 'current', 'sum(ceph_pool_stored)', '', 12, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'bytes', 'Compression Savings', 'A compression saving is determined as the data eligible to be compressed minus the capacity used to store the data after compression', 'current', 'sum(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used)', '', 15, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'percent', 'Compression Eligibility', 'Indicates how suitable the data is within the pools that are/have been enabled for compression - averaged across all pools holding compressed data\n', 'current', '(sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_stored_raw and ceph_pool_compress_under_bytes > 0)) * 100', 'table', 18, 0, 3, 3),
+      PoolOverviewSingleStatPanel(
+        'none', 'Compression Factor', 'This factor describes the average ratio of data eligible to be compressed divided by the data actually stored. It does not account for data written that was ineligible for compression (too small, or compression yield too low)', 'current', 'sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_compress_bytes_used > 0)', '', 21, 0, 3, 3),
+      addTableSchema(
+        '$datasource', '', {"col": 5,"desc": true}, [PoolOverviewStyle('', 'Time', 'hidden', 'short', null, [], []),PoolOverviewStyle('', 'instance', 'hidden', 'short', null, [], []),PoolOverviewStyle('', 'job', 'hidden', 'short', null, [], []),PoolOverviewStyle('Pool Name', 'name', 'string', 'short', null, [], []),PoolOverviewStyle('Pool ID', 'pool_id', 'hidden', 'none', null, [], []),PoolOverviewStyle('Compression Factor', 'Value #A', 'number', 'none', null, [], []),PoolOverviewStyle('% Used', 'Value #D', 'number', 'percentunit', 'value', ['70','85'], []),PoolOverviewStyle('Usable Free', 'Value #B', 'number', 'bytes', null, [], []),PoolOverviewStyle('Compression Eligibility', 'Value #C', 'number', 'percent', null, [], []),PoolOverviewStyle('Compression Savings', 'Value #E', 'number', 'bytes', null, [], []),PoolOverviewStyle('Growth (5d)', 'Value #F', 'number', 'bytes', 'value', ['0', '0'], []),PoolOverviewStyle('IOPS', 'Value #G', 'number', 'none', null, [], []),PoolOverviewStyle('Bandwidth', 'Value #H', 'number', 'Bps', null, [], []),PoolOverviewStyle('', '__name__', 'hidden', 'short', null, [], []),PoolOverviewStyle('', 'type', 'hidden', 'short', null, [], []),PoolOverviewStyle('', 'compression_mode', 'hidden', 'short', null, [], []),PoolOverviewStyle('Type', 'description', 'string', 'short', null, [], []),PoolOverviewStyle('Stored', 'Value #J', 'number', 'bytes', null, [], []),PoolOverviewStyle('', 'Value #I', 'hidden', 'short', null, [], []),PoolOverviewStyle('Compression', 'Value #K', 'string', 'short', null, [], [{"text": "ON","value": "1"}])], 'Pool Overview', 'table'
+      )
+      .addTargets(
+        [addTargetSchema('(ceph_pool_compress_under_bytes / ceph_pool_compress_bytes_used > 0) and on(pool_id) (((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100 > 0.5)', 1, 'table', ''),
+        addTargetSchema('ceph_pool_max_avail * on(pool_id) group_left(name) ceph_pool_metadata', 1, 'table', ''),
+        addTargetSchema('((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100', 1, 'table', ''),
+        addTargetSchema('(ceph_pool_percent_used * on(pool_id) group_left(name) ceph_pool_metadata)', 1, 'table', ''),
+        addTargetSchema('(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used > 0)', 1, 'table', ''),
+        addTargetSchema('delta(ceph_pool_stored[5d])', 1, 'table', ''),
+        addTargetSchema('rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])', 1, 'table', ''),
+        addTargetSchema('rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])', 1, 'table', ''),
+        addTargetSchema('ceph_pool_metadata', 1, 'table', ''),
+        addTargetSchema('ceph_pool_stored * on(pool_id) group_left ceph_pool_metadata', 1, 'table', ''),
+        addTargetSchema('ceph_pool_metadata{compression_mode!=\"none\"}', 1, 'table', ''),
+        addTargetSchema('', '', '', '')]
+      ) + {gridPos: {x: 0, y: 3, w: 24, h: 6}},
+      PoolOverviewGraphPanel(
+        'Top $topk Client IOPS by Pool', 'This chart shows the sum of read and write IOPS from all clients by pool', 'short', 'IOPS', 'topk($topk,round((rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])),1) * on(pool_id) group_left(instance,name) ceph_pool_metadata) ', 'time_series', '{{name}} ', 0, 9, 12, 8
+      )
+      .addTarget(
+        addTargetSchema('topk($topk,rate(ceph_pool_wr[30s]) + on(pool_id) group_left(instance,name) ceph_pool_metadata) ', 1, 'time_series', '{{name}} - write')
+      ),
+      PoolOverviewGraphPanel(
+        'Top $topk Client Bandwidth by Pool', 'The chart shows the sum of read and write bytes from all clients, by pool', 'Bps', 'Throughput', 'topk($topk,(rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])) * on(pool_id) group_left(instance,name) ceph_pool_metadata)', 'time_series', '{{name}}', 12, 9, 12, 8
+      ),
+      PoolOverviewGraphPanel(
+        'Pool Capacity Usage (RAW)', 'Historical view of capacity usage, to help identify growth and trends in pool consumption', 'bytes', 'Capacity Used', 'ceph_pool_bytes_used * on(pool_id) group_right ceph_pool_metadata', '', '{{name}}', 0, 17, 24, 7
+      )
+    ])
+}
+{
+  "pool-detail.json":
+    local PoolDetailSingleStatPanel(format, title, description, valueName, colorValue, gaugeMaxValue, gaugeShow, sparkLineShow, thresholds, expr, targetFormat, x, y, w, h) =
+      addSingelStatSchema('$datasource', format, title, description, valueName, colorValue, gaugeMaxValue, gaugeShow, sparkLineShow, thresholds)
+      .addTarget(addTargetSchema(expr, 1, targetFormat, '')) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    local PoolDetailGraphPanel(alias, title, description, formatY1, labelY1, expr, targetFormat, legendFormat, x, y, w, h) =
+      graphPanelSchema(alias, title, description, 'null as zero', false, formatY1, 'short', labelY1, null, null, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'Ceph Pool Details', '', '-xyV8KCiz', 'now-1h', '15s', 22, [], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='singlestat', name='Singlestat', version='5.0.0'
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'Prometheus admin.virt1.home.fajerski.name:9090', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('pool_name', '$datasource', 'label_values(ceph_pool_metadata,name)', 1, false, 1, 'Pool Name', '')
+    )
+    .addPanels([
+      PoolDetailSingleStatPanel(
+        'percentunit', 'Capacity used', '', 'current', true, 1, true, true, '.7,.8', '(ceph_pool_stored / (ceph_pool_stored + ceph_pool_max_avail)) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 'time_series', 0, 0, 7, 7),
+      PoolDetailSingleStatPanel(
+        's', 'Time till full', 'Time till pool is full assuming the average fill rate of the last 6 hours', false, 100, false, false, '', 'current', '(ceph_pool_max_avail / deriv(ceph_pool_stored[6h])) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"} > 0', 'time_series', 7, 0, 5, 7),
+      PoolDetailGraphPanel(
+        {"read_op_per_sec": "#3F6833","write_op_per_sec": "#E5AC0E"},'$pool_name Object Ingress/Egress', '', 'ops', 'Objects out(-) / in(+) ', 'deriv(ceph_pool_objects[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 'time_series', 'Objects per second', 12, 0, 12, 7
+      ),
+      PoolDetailGraphPanel(
+        {"read_op_per_sec": "#3F6833","write_op_per_sec": "#E5AC0E"},'$pool_name Client IOPS', '', 'iops', 'Read (-) / Write (+)', 'irate(ceph_pool_rd[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 'time_series', 'reads', 0, 7, 12, 7
+      )
+      .addSeriesOverride({"alias": "reads","transform": "negative-Y"})
+      .addTarget(
+        addTargetSchema('irate(ceph_pool_wr[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 1, 'time_series', 'writes')
+      ),
+      PoolDetailGraphPanel(
+        {"read_op_per_sec": "#3F6833","write_op_per_sec": "#E5AC0E"},'$pool_name Client Throughput', '', 'Bps', 'Read (-) / Write (+)', 'irate(ceph_pool_rd_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 'time_series', 'reads', 12, 7, 12, 7
+      )
+      .addSeriesOverride({"alias": "reads","transform": "negative-Y"})
+      .addTarget(
+        addTargetSchema('irate(ceph_pool_wr_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 1, 'time_series', 'writes')
+      ),
+      PoolDetailGraphPanel(
+        {"read_op_per_sec": "#3F6833","write_op_per_sec": "#E5AC0E"},'$pool_name Objects', '', 'short', 'Objects', 'ceph_pool_objects * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}', 'time_series', 'Number of Objects', 0, 14, 12, 7
+      )
+    ])
+}
+{
+  "osds-overview.json":
+    local OsdOverviewStyle(alias, pattern, type, unit) =
+      addStyle(alias, null, ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"], 'YYYY-MM-DD HH:mm:ss', 2, 1, pattern, [], type, unit, []);
+    local OsdOverviewGraphPanel(alias, title, description, formatY1, labelY1, min, expr, legendFormat1, x, y, w, h) =
+      graphPanelSchema(alias, title, description, 'null', false, formatY1, 'short', labelY1, null, min, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat1)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+    local OsdOverviewPieChartPanel(alias, description, title) =
+      addPieChartSchema(alias, '$datasource', description, 'Under graph', 'pie', title, 'current');
+
+    dashboardSchema(
+      'OSD Overview', '', 'lo02I1Aiz', 'now-1h', '10s', 16, [], '', {refresh_intervals:['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='grafana-piechart-panel', name='Pie Chart', version='1.3.3'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addRequired(
+       type='panel', id='table', name='Table', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addPanels([
+      OsdOverviewGraphPanel(
+        {"@95%ile": "#e0752d"},'OSD Read Latencies', '', 'ms', null, '0', 'avg (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)', 'AVG read', 0, 0, 8, 8)
+      .addTargets(
+        [addTargetSchema('max (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)', 1, 'time_series', 'MAX read'),addTargetSchema('quantile(0.95,\n  (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n)', 1, 'time_series', '@95%ile')],
+      ),
+      addTableSchema(
+        '$datasource', 'This table shows the osd\'s that are delivering the 10 highest read latencies within the cluster', {"col": 2,"desc": true}, [OsdOverviewStyle('OSD ID', 'ceph_daemon', 'string', 'short'),OsdOverviewStyle('Latency (ms)', 'Value', 'number', 'none'),OsdOverviewStyle('', '/.*/', 'hidden', 'short')], 'Highest READ Latencies', 'table'
+      )
+      .addTarget(
+        addTargetSchema('topk(10,\n  (sort(\n    (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n  ))\n)\n\n', 1, 'table', '')
+      ) + {gridPos: {x: 8, y: 0, w: 4, h: 8}},
+      OsdOverviewGraphPanel(
+        {"@95%ile write": "#e0752d"},'OSD Write Latencies', '', 'ms', null, '0', 'avg (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)', 'AVG write', 12, 0, 8, 8)
+      .addTargets(
+        [addTargetSchema('max (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)', 1, 'time_series', 'MAX write'),addTargetSchema('quantile(0.95,\n (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n)', 1, 'time_series', '@95%ile write')],
+      ),
+      addTableSchema(
+        '$datasource', 'This table shows the osd\'s that are delivering the 10 highest write latencies within the cluster', {"col": 2,"desc": true}, [OsdOverviewStyle('OSD ID', 'ceph_daemon', 'string', 'short'),OsdOverviewStyle('Latency (ms)', 'Value', 'number', 'none'),OsdOverviewStyle('', '/.*/', 'hidden', 'short')], 'Highest WRITE Latencies', 'table'
+      )
+      .addTarget(
+        addTargetSchema('topk(10,\n  (sort(\n    (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n  ))\n)\n\n', 1, 'table', '')
+      ) + {gridPos: {x: 20, y: 0, w: 4, h: 8}},
+      OsdOverviewPieChartPanel(
+        {}, '', 'OSD Types Summary'
+      )
+      .addTarget(addTargetSchema('count by (device_class) (ceph_osd_metadata)', 1, 'time_series', '{{device_class}}')) + {gridPos: {x: 0, y: 8, w: 4, h: 8}},
+      OsdOverviewPieChartPanel(
+        {"Non-Encrypted": "#E5AC0E"}, '', 'OSD Objectstore Types'
+      )
+      .addTarget(addTargetSchema('count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'bluestore'))
+      .addTarget(addTargetSchema('count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)', 1, 'time_series', 'filestore'))
+      .addTarget(addTargetSchema('absent(ceph_bluefs_wal_total_bytes)*count(ceph_osd_metadata)', 1, 'time_series', 'filestore')) + {gridPos: {x: 4, y: 8, w: 4, h: 8}},
+      OsdOverviewPieChartPanel(
+        {}, 'The pie chart shows the various OSD sizes used within the cluster', 'OSD Size Summary'
+      )
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes < 1099511627776)', 1, 'time_series', '<1TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 1099511627776 < 2199023255552)', 1, 'time_series', '<2TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 2199023255552 < 3298534883328)', 1, 'time_series', '<3TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 3298534883328 < 4398046511104)', 1, 'time_series', '<4TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 4398046511104 < 6597069766656)', 1, 'time_series', '<6TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 6597069766656 < 8796093022208)', 1, 'time_series', '<8TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 8796093022208 < 10995116277760)', 1, 'time_series', '<10TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 10995116277760 < 13194139533312)', 1, 'time_series', '<12TB'))
+      .addTarget(addTargetSchema('count(ceph_osd_stat_bytes >= 13194139533312)', 1, 'time_series', '<12TB+')) + {gridPos: {x: 8, y: 8, w: 4, h: 8}},
+      g.graphPanel.new(bars=true, datasource='$datasource', title='Distribution of PGs per OSD', x_axis_buckets=20, x_axis_mode='histogram', x_axis_values=['total'], formatY1='short', formatY2='short', labelY1='# of OSDs', min='0', nullPointMode='null')
+      .addTarget(addTargetSchema('ceph_osd_numpg\n', 1, 'time_series', 'PGs per OSD')) + {gridPos: {x: 12, y: 8, w: 12, h: 8}},
+      addRowSchema(false, true, 'R/W Profile') + {gridPos: {x: 0, y: 16, w: 24, h: 1}},
+      OsdOverviewGraphPanel(
+        {},'Read/Write Profile', 'Show the read/write workload profile overtime', 'short', null, null, 'round(sum(irate(ceph_pool_rd[30s])))', 'Reads', 0, 17, 24, 8)
+      .addTargets([addTargetSchema('round(sum(irate(ceph_pool_wr[30s])))', 1, 'time_series', 'Writes')])
+      ])
+}
+{
+  "osd-device-details.json":
+    local OsdDeviceDetailsPanel(title, description, formatY1, labelY1, expr1, expr2, legendFormat1, legendFormat2, x, y, w, h) =
+      graphPanelSchema({}, title, description, 'null', false, formatY1, 'short', labelY1, null, null, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr1, 1, 'time_series', legendFormat1),addTargetSchema(expr2, 1, 'time_series', legendFormat2)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'OSD device details', '', 'CrAHE0iZz', 'now-3h', '', 16, [], '', {refresh_intervals:['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('osd', '$datasource', 'label_values(ceph_osd_metadata,ceph_daemon)', 1, false, 1, 'OSD', '(.*)')
+    )
+    .addPanels([
+      addRowSchema(false, true, 'OSD Performance') + {gridPos: {x: 0, y: 0, w: 24, h: 1}},
+      OsdDeviceDetailsPanel(
+        '$osd Latency', '', 's', 'Read (-) / Write (+)', 'irate(ceph_osd_op_r_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m])', 'irate(ceph_osd_op_w_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m])', 'read', 'write', 0, 1, 6, 9)
+      .addSeriesOverride({"alias": "read","transform": "negative-Y"}
+      ),
+      OsdDeviceDetailsPanel(
+        '$osd R/W IOPS', '', 'short', 'Read (-) / Write (+)', 'irate(ceph_osd_op_r{ceph_daemon=~\"$osd\"}[1m])', 'irate(ceph_osd_op_w{ceph_daemon=~\"$osd\"}[1m])', 'Reads', 'Writes', 6, 1, 6, 9)
+      .addSeriesOverride({"alias": "Reads","transform": "negative-Y"}
+      ),
+      OsdDeviceDetailsPanel(
+        '$osd R/W Bytes', '', 'bytes', 'Read (-) / Write (+)', 'irate(ceph_osd_op_r_out_bytes{ceph_daemon=~\"$osd\"}[1m])', 'irate(ceph_osd_op_w_in_bytes{ceph_daemon=~\"$osd\"}[1m])', 'Read Bytes', 'Write Bytes', 12, 1, 6, 9)
+      .addSeriesOverride({"alias": "Read Bytes","transform": "negative-Y"}),
+      addRowSchema(false, true, 'Physical Device Performance') + {gridPos: {x: 0, y: 10, w: 24, h: 1}},
+      OsdDeviceDetailsPanel(
+        'Physical Device Latency for $osd', '', 's', 'Read (-) / Write (+)', '(label_replace(irate(node_disk_read_time_seconds_total[1m]) / irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))', '(label_replace(irate(node_disk_write_time_seconds_total[1m]) / irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))', '{{instance}}/{{device}} Reads', '{{instance}}/{{device}} Writes', 0, 11, 6, 9)
+      .addSeriesOverride({"alias": "/.*Reads/","transform": "negative-Y"}
+      ),
+      OsdDeviceDetailsPanel(
+        'Physical Device R/W IOPS for $osd', '', 'short', 'Read (-) / Write (+)', 'label_replace(irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', 'label_replace(irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', '{{device}} on {{instance}} Writes', '{{device}} on {{instance}} Reads', 6, 11, 6, 9)
+      .addSeriesOverride({"alias": "/.*Reads/","transform": "negative-Y"}
+      ),
+      OsdDeviceDetailsPanel(
+        'Physical Device R/W Bytes for $osd', '', 'Bps', 'Read (-) / Write (+)', 'label_replace(irate(node_disk_read_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', 'label_replace(irate(node_disk_written_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', '{{instance}} {{device}} Reads', '{{instance}} {{device}} Writes', 12, 11, 6, 9)
+      .addSeriesOverride({"alias": "/.*Reads/","transform": "negative-Y"}
+      ),
+      graphPanelSchema(
+        {}, 'Physical Device Util% for $osd', '', 'null', false, 'percentunit', 'short', null, null, null, 1, '$datasource'
+      )
+      .addTarget(addTargetSchema('label_replace(irate(node_disk_io_time_seconds_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")', 1, 'time_series', '{{device}} on {{instance}}')) + {gridPos: {x: 18, y: 11, w: 6, h: 9}},
+    ])
+}
+{
+  "cephfs-overview.json":
+    local CephfsOverviewGraphPanel(title, formatY1, labelY1, expr, legendFormat, x, y, w, h) =
+      graphPanelSchema({}, title, '', 'null', false, formatY1, 'short', labelY1, null, 0, 1, '$datasource')
+      .addTargets(
+        [addTargetSchema(expr, 1, 'time_series', legendFormat)]) + {gridPos: {x: x, y: y, w: w, h: h}};
+
+    dashboardSchema(
+      'MDS Performance', '', 'tbO9LAiZz', 'now-1h', '15s', 16, [], '', {refresh_intervals:['5s','10s','15s','30s','1m','5m','15m','30m','1h','2h','1d'],time_options:['5m','15m','1h','6h','12h','24h','2d','7d','30d']}
+    )
+    .addAnnotation(
+      addAnnotationSchema(
+        1, '-- Grafana --', true, true, 'rgba(0, 211, 255, 1)', 'Annotations & Alerts', 'dashboard')
+    )
+    .addRequired(
+       type='grafana', id='grafana', name='Grafana', version='5.3.2'
+    )
+    .addRequired(
+       type='panel', id='graph', name='Graph', version='5.0.0'
+    )
+    .addTemplate(
+       g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
+    )
+    .addTemplate(
+       addTemplateSchema('mds_servers', '$datasource', 'label_values(ceph_mds_inodes, ceph_daemon)', 1, true, 1, 'MDS Server', '')
+    )
+    .addPanels([
+      addRowSchema(false, true, 'MDS Performance') + {gridPos: {x: 0, y: 0, w: 24, h: 1}},
+      CephfsOverviewGraphPanel(
+        'MDS Workload - $mds_servers', 'none', 'Reads(-) / Writes (+)', 'sum(rate(ceph_objecter_op_r{ceph_daemon=~\"($mds_servers).*\"}[1m]))', 'Read Ops', 0, 1, 12, 9)
+      .addTarget(addTargetSchema('sum(rate(ceph_objecter_op_w{ceph_daemon=~\"($mds_servers).*\"}[1m]))', 1, 'time_series', 'Write Ops'))
+      .addSeriesOverride({"alias": "/.*Reads/","transform": "negative-Y"}
+      ),
+      CephfsOverviewGraphPanel(
+        'Client Request Load - $mds_servers', 'none', 'Client Requests', 'ceph_mds_server_handle_client_request{ceph_daemon=~\"($mds_servers).*\"}', '{{ceph_daemon}}', 12, 1, 12, 9
+      )
+    ])
+}
index eefb5912579172530cf7fe93f8acf98107939d0f..6d59f3be40122c9712ae13a57c5a41d2ccdca743 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1557395861896,
-  "links": [],
-  "panels": [
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 0
-      },
-      "id": 14,
-      "panels": [],
-      "title": "OSD Performance",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 0,
-        "y": 1
-      },
-      "id": 2,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "read",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_osd_op_r_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "read",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_osd_op_w_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "write",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$osd Latency",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "s",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 6,
-        "y": 1
-      },
-      "id": 8,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "Reads",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_osd_op_r{ceph_daemon=~\"$osd\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Reads",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_osd_op_w{ceph_daemon=~\"$osd\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Writes",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$osd R/W IOPS",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 12,
-        "y": 1
-      },
-      "id": 7,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "Read Bytes",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_osd_op_r_out_bytes{ceph_daemon=~\"$osd\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Read Bytes",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_osd_op_w_in_bytes{ceph_daemon=~\"$osd\"}[1m])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write Bytes",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$osd R/W Bytes",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "bytes",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 10
-      },
-      "id": 12,
-      "panels": [],
-      "title": "Physical Device Performance",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 0,
-        "y": 11
-      },
-      "id": 9,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*Reads/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "(label_replace(irate(node_disk_read_time_seconds_total[1m]) / irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}}/{{device}} Reads",
-          "refId": "A"
-        },
-        {
-          "expr": "(label_replace(irate(node_disk_write_time_seconds_total[1m]) / irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}}/{{device}} Writes",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Physical Device Latency for $osd",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "s",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 6,
-        "y": 11
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.2"
       },
-      "id": 5,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*Reads/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}} on {{instance}} Writes",
-          "refId": "A"
-        },
-        {
-          "expr": "label_replace(irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}} on {{instance}} Reads",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Physical Device R/W IOPS for $osd",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 12,
-        "y": 11
-      },
-      "id": 10,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "OSD Performance",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "/.*Reads/",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(irate(node_disk_read_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}} {{device}} Reads",
-          "refId": "A"
-        },
-        {
-          "expr": "label_replace(irate(node_disk_written_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{instance}} {{device}} Writes",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Physical Device R/W Bytes for $osd",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 0,
+            "y": 1
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "read",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_osd_op_r_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "read",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_osd_op_w_latency_sum{ceph_daemon=~\"$osd\"}[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "write",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$osd Latency",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 6,
+            "y": 1
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "Reads",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_osd_op_r{ceph_daemon=~\"$osd\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Reads",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_osd_op_w{ceph_daemon=~\"$osd\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$osd R/W IOPS",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 6,
-        "x": 18,
-        "y": 11
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 12,
+            "y": 1
+         },
+         "id": 5,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "Read Bytes",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_osd_op_r_out_bytes{ceph_daemon=~\"$osd\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read Bytes",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_osd_op_w_in_bytes{ceph_daemon=~\"$osd\"}[1m])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write Bytes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$osd R/W Bytes",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "id": 4,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 10
+         },
+         "id": 6,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "Physical Device Performance",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(irate(node_disk_io_time_seconds_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device}} on {{instance}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Physical Device Util% for $osd",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 0,
+            "y": 11
+         },
+         "id": 7,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*Reads/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "(label_replace(irate(node_disk_read_time_seconds_total[1m]) / irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}}/{{device}} Reads",
+               "refId": "A"
+            },
+            {
+               "expr": "(label_replace(irate(node_disk_write_time_seconds_total[1m]) / irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\"))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}}/{{device}} Writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Physical Device Latency for $osd",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 6,
+            "y": 11
+         },
+         "id": 8,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*Reads/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(irate(node_disk_writes_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}} on {{instance}} Writes",
+               "refId": "A"
+            },
+            {
+               "expr": "label_replace(irate(node_disk_reads_completed_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}} on {{instance}} Reads",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Physical Device R/W IOPS for $osd",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "format": "percentunit",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "default",
-          "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 12,
+            "y": 11
+         },
+         "id": 9,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "/.*Reads/",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(irate(node_disk_read_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}} {{device}} Reads",
+               "refId": "A"
+            },
+            {
+               "expr": "label_replace(irate(node_disk_written_bytes_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{instance}} {{device}} Writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Physical Device R/W Bytes for $osd",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 0,
-        "includeAll": false,
-        "label": "OSD",
-        "multi": false,
-        "name": "osd",
-        "options": [],
-        "query": "label_values(ceph_osd_metadata,ceph_daemon)",
-        "refresh": 1,
-        "regex": "(.*)",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 6,
+            "x": 18,
+            "y": 11
+         },
+         "id": 10,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(irate(node_disk_io_time_seconds_total[1m]), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\") and on (instance, device) label_replace(label_replace(ceph_disk_occupation{ceph_daemon=~\"$osd\"}, \"device\", \"$1\", \"device\", \"/dev/(.*)\"), \"instance\", \"$1\", \"instance\", \"([^:.]*).*\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device}} on {{instance}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Physical Device Util% for $osd",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "percentunit",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-3h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "OSD device details",
-  "uid": "CrAHE0iZz",
-  "version": 3
+   ],
+   "refresh": "",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": false,
+            "label": "OSD",
+            "multi": false,
+            "name": "osd",
+            "options": [ ],
+            "query": "label_values(ceph_osd_metadata,ceph_daemon)",
+            "refresh": 1,
+            "regex": "(.*)",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-3h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "OSD device details",
+   "uid": "CrAHE0iZz",
+   "version": 0
 }
index 4b91df9ebce544456901a5f210e637d27db4adc9..8a873090ad720dbef686d4b3e699ee2e4c092563 100644 (file)
 {
-
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "grafana-piechart-panel",
-      "name": "Pie Chart",
-      "version": "1.3.3"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "table",
-      "name": "Table",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1538083987689,
-  "links": [],
-  "panels": [
-    {
-      "aliasColors": {
-        "@95%ile": "#e0752d"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 8,
-        "w": 8,
-        "x": 0,
-        "y": 0
-      },
-      "id": 12,
-      "legend": {
-        "avg": false,
-        "current": true,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": true
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "avg (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "AVG read",
-          "refId": "A"
-        },
-        {
-          "expr": "max (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "MAX read",
-          "refId": "B"
-        },
-        {
-          "expr": "quantile(0.95,\n  (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "@95%ile",
-          "refId": "C"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "OSD Read Latencies",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "ms",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "description": "This table shows the osd's that are delivering the 10 highest read latencies within the cluster",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 8,
-        "y": 0
-      },
-      "id": 15,
-      "links": [],
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 2,
-        "desc": true
-      },
-      "styles": [
-        {
-          "alias": "OSD ID",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "ceph_daemon",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Latency (ms)",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "pattern": "Value",
-          "thresholds": [],
-          "type": "number",
-          "unit": "none"
-        },
-        {
-          "alias": "",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "/.*/",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        }
-      ],
-      "targets": [
-        {
-          "expr": "topk(10,\n  (sort(\n    (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n  ))\n)\n\n",
-          "format": "table",
-          "instant": true,
-          "intervalFactor": 1,
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "title": "Highest READ Latencies",
-      "transform": "table",
-      "type": "table"
-    },
-    {
-      "aliasColors": {
-        "@95%ile write": "#e0752d"
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.0.0"
       },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 8,
-        "w": 8,
-        "x": 12,
-        "y": 0
-      },
-      "id": 13,
-      "legend": {
-        "avg": false,
-        "current": true,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": true
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "avg (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "AVG write",
-          "refId": "A"
-        },
-        {
-          "expr": "max (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "MAX write",
-          "refId": "B"
-        },
-        {
-          "expr": "quantile(0.95,\n (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "@95%ile write",
-          "refId": "C"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "OSD Write Latencies",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "id": "grafana-piechart-panel",
+         "name": "Pie Chart",
+         "type": "panel",
+         "version": "1.3.3"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       },
-      "yaxes": [
-        {
-          "format": "ms",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
+      {
+         "id": "table",
+         "name": "Table",
+         "type": "panel",
+         "version": "5.0.0"
+      }
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
       ]
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "description": "This table shows the osd's that are delivering the 10 highest write latencies within the cluster",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 20,
-        "y": 0
-      },
-      "id": 16,
-      "links": [],
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 2,
-        "desc": true
-      },
-      "styles": [
-        {
-          "alias": "OSD ID",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "ceph_daemon",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Latency (ms)",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "pattern": "Value",
-          "thresholds": [],
-          "type": "number",
-          "unit": "none"
-        },
-        {
-          "alias": "",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "/.*/",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        }
-      ],
-      "targets": [
-        {
-          "expr": "topk(10,\n  (sort(\n    (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n  ))\n)\n\n",
-          "format": "table",
-          "instant": true,
-          "intervalFactor": 1,
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "title": "Highest WRITE Latencies",
-      "transform": "table",
-      "type": "table"
-    },
-    {
-      "aliasColors": {},
-      "breakPoint": "50%",
-      "cacheTimeout": null,
-      "combine": {
-        "label": "Others",
-        "threshold": 0
-      },
-      "datasource": "$datasource",
-      "fontSize": "80%",
-      "format": "none",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 0,
-        "y": 8
-      },
-      "id": 2,
-      "interval": null,
-      "legend": {
-        "show": true,
-        "values": true
-      },
-      "legendType": "Under graph",
-      "links": [],
-      "maxDataPoints": 3,
-      "nullPointMode": "connected",
-      "pieType": "pie",
-      "strokeWidth": 1,
-      "targets": [
-        {
-          "expr": "count by (device_class) (ceph_osd_metadata)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{device_class}}",
-          "refId": "A"
-        }
-      ],
-      "title": "OSD Types Summary",
-      "type": "grafana-piechart-panel",
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {
-        "Non-Encrypted": "#E5AC0E"
-      },
-      "breakPoint": "50%",
-      "cacheTimeout": null,
-      "combine": {
-        "label": "Others",
-        "threshold": 0
-      },
-      "datasource": "$datasource",
-      "fontSize": "80%",
-      "format": "none",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 4,
-        "y": 8
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "aliasColors": {
+            "@95%ile": "#e0752d"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 8,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "avg (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "AVG read",
+               "refId": "A"
+            },
+            {
+               "expr": "max (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "MAX read",
+               "refId": "B"
+            },
+            {
+               "expr": "quantile(0.95,\n  (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "@95%ile",
+               "refId": "C"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "OSD Read Latencies",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ms",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            }
+         ]
       },
-      "height": "200px",
-      "hideTimeOverride": true,
-      "id": 4,
-      "interval": null,
-      "legend": {
-        "percentage": false,
-        "show": true,
-        "values": true
+      {
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "This table shows the osd's that are delivering the 10 highest read latencies within the cluster",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 8,
+            "y": 0
+         },
+         "id": 3,
+         "sort": {
+            "col": 2,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "OSD ID",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "ceph_daemon",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Latency (ms)",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "none",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "/.*/",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "topk(10,\n  (sort(\n    (irate(ceph_osd_op_r_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_r_latency_count[1m]) * 1000)\n  ))\n)\n\n",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Highest READ Latencies",
+         "transform": "table",
+         "type": "table"
       },
-      "legendType": "Under graph",
-      "links": [],
-      "maxDataPoints": "1",
-      "minSpan": 4,
-      "nullPointMode": "connected",
-      "pieType": "pie",
-      "strokeWidth": 1,
-      "targets": [
-        {
-          "expr": "count(ceph_bluefs_wal_total_bytes)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "bluestore",
-          "refId": "A",
-          "step": 240
-        },
-        {
-          "expr": "count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "filestore",
-          "refId": "B",
-          "step": 240
-        },
-        {
-          "expr": "absent(ceph_bluefs_wal_total_bytes)*count(ceph_osd_metadata)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "filestore",
-          "refId": "C",
-          "step": 240
-        }
-      ],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "OSD Objectstore Types",
-      "type": "grafana-piechart-panel",
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {},
-      "breakPoint": "50%",
-      "cacheTimeout": null,
-      "combine": {
-        "label": "Others",
-        "threshold": "0.05"
+      {
+         "aliasColors": {
+            "@95%ile write": "#e0752d"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 8,
+            "x": 12,
+            "y": 0
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "avg (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "AVG write",
+               "refId": "A"
+            },
+            {
+               "expr": "max (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "MAX write",
+               "refId": "B"
+            },
+            {
+               "expr": "quantile(0.95,\n (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "@95%ile write",
+               "refId": "C"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "OSD Write Latencies",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ms",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            }
+         ]
       },
-      "datasource": "$datasource",
-      "description": "The pie chart shows the various OSD sizes used within the cluster",
-      "fontSize": "80%",
-      "format": "none",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 8,
-        "y": 8
+      {
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "This table shows the osd's that are delivering the 10 highest write latencies within the cluster",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 20,
+            "y": 0
+         },
+         "id": 5,
+         "sort": {
+            "col": 2,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "OSD ID",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "ceph_daemon",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Latency (ms)",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "none",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "/.*/",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "topk(10,\n  (sort(\n    (irate(ceph_osd_op_w_latency_sum[1m]) / on (ceph_daemon) irate(ceph_osd_op_w_latency_count[1m]) * 1000)\n  ))\n)\n\n",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Highest WRITE Latencies",
+         "transform": "table",
+         "type": "table"
       },
-      "height": "220",
-      "hideTimeOverride": true,
-      "id": 8,
-      "interval": null,
-      "legend": {
-        "header": "",
-        "percentage": false,
-        "show": true,
-        "sideWidth": null,
-        "sortDesc": true,
-        "values": true
+      {
+         "aliasColors": { },
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 0,
+            "y": 8
+         },
+         "id": 6,
+         "legend": {
+            "percentage": true,
+            "show": true,
+            "values": true
+         },
+         "legendType": "Under graph",
+         "pieType": "pie",
+         "targets": [
+            {
+               "expr": "count by (device_class) (ceph_osd_metadata)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{device_class}}",
+               "refId": "A"
+            }
+         ],
+         "title": "OSD Types Summary",
+         "type": "grafana-piechart-panel",
+         "valueName": "current"
       },
-      "legendType": "Under graph",
-      "links": [],
-      "maxDataPoints": "",
-      "minSpan": 6,
-      "nullPointMode": "connected",
-      "pieType": "pie",
-      "strokeWidth": "1",
-      "targets": [
-        {
-          "expr": "count(ceph_osd_stat_bytes < 1099511627776)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<1 TB",
-          "refId": "A",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 1099511627776 < 2199023255552)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<2 TB",
-          "refId": "B",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 2199023255552 < 3298534883328)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<3TB",
-          "refId": "C",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 3298534883328 < 4398046511104)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<4TB",
-          "refId": "D",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 4398046511104 < 6597069766656)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<6TB",
-          "refId": "E",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 6597069766656 < 8796093022208)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<8TB",
-          "refId": "F",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 8796093022208 < 10995116277760)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<10TB",
-          "refId": "G",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 10995116277760 < 13194139533312)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "<12TB",
-          "refId": "H",
-          "step": 2
-        },
-        {
-          "expr": "count(ceph_osd_stat_bytes >= 13194139533312)",
-          "format": "time_series",
-          "intervalFactor": 2,
-          "legendFormat": "12TB+",
-          "refId": "I",
-          "step": 2
-        }
-      ],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "OSD Size Summary",
-      "type": "grafana-piechart-panel",
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {},
-      "bars": true,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Each bar indicates the number of OSD's that have a PG count in a specific range as shown on the x axis.",
-      "fill": 1,
-      "gridPos": {
-        "h": 8,
-        "w": 12,
-        "x": 12,
-        "y": 8
+      {
+         "aliasColors": {
+            "Non-Encrypted": "#E5AC0E"
+         },
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 4,
+            "y": 8
+         },
+         "id": 7,
+         "legend": {
+            "percentage": true,
+            "show": true,
+            "values": true
+         },
+         "legendType": "Under graph",
+         "pieType": "pie",
+         "targets": [
+            {
+               "expr": "count(ceph_bluefs_wal_total_bytes)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "bluestore",
+               "refId": "A"
+            },
+            {
+               "expr": "count(ceph_osd_metadata) - count(ceph_bluefs_wal_total_bytes)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "filestore",
+               "refId": "B"
+            },
+            {
+               "expr": "absent(ceph_bluefs_wal_total_bytes)*count(ceph_osd_metadata)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "filestore",
+               "refId": "C"
+            }
+         ],
+         "title": "OSD Objectstore Types",
+         "type": "grafana-piechart-panel",
+         "valueName": "current"
       },
-      "id": 6,
-      "legend": {
-        "alignAsTable": false,
-        "avg": false,
-        "current": false,
-        "hideEmpty": false,
-        "hideZero": false,
-        "max": false,
-        "min": false,
-        "rightSide": false,
-        "show": false,
-        "total": false,
-        "values": false
+      {
+         "aliasColors": { },
+         "datasource": "$datasource",
+         "description": "The pie chart shows the various OSD sizes used within the cluster",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 8,
+            "y": 8
+         },
+         "id": 8,
+         "legend": {
+            "percentage": true,
+            "show": true,
+            "values": true
+         },
+         "legendType": "Under graph",
+         "pieType": "pie",
+         "targets": [
+            {
+               "expr": "count(ceph_osd_stat_bytes < 1099511627776)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<1TB",
+               "refId": "A"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 1099511627776 < 2199023255552)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<2TB",
+               "refId": "B"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 2199023255552 < 3298534883328)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<3TB",
+               "refId": "C"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 3298534883328 < 4398046511104)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<4TB",
+               "refId": "D"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 4398046511104 < 6597069766656)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<6TB",
+               "refId": "E"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 6597069766656 < 8796093022208)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<8TB",
+               "refId": "F"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 8796093022208 < 10995116277760)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<10TB",
+               "refId": "G"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 10995116277760 < 13194139533312)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<12TB",
+               "refId": "H"
+            },
+            {
+               "expr": "count(ceph_osd_stat_bytes >= 13194139533312)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "<12TB+",
+               "refId": "I"
+            }
+         ],
+         "title": "OSD Size Summary",
+         "type": "grafana-piechart-panel",
+         "valueName": "current"
       },
-      "lines": false,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "ceph_osd_numpg\n",
-          "format": "time_series",
-          "instant": true,
-          "intervalFactor": 1,
-          "legendFormat": "PGs per OSD",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Distribution of PGs per OSD",
-      "tooltip": {
-        "shared": false,
-        "sort": 0,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": true,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 12,
+            "x": 12,
+            "y": 8
+         },
+         "id": 9,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "ceph_osd_numpg\n",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PGs per OSD",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Distribution of PGs per OSD",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": 20,
+            "mode": "histogram",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": "# of OSDs",
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": "0",
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": 20,
-        "mode": "histogram",
-        "name": null,
-        "show": true,
-        "values": [
-          "total"
-        ]
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 16
+         },
+         "id": 10,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "R/W Profile",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "yaxes": [
-        {
-          "decimals": 0,
-          "format": "short",
-          "label": "# of OSDs",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Show the read/write workload profile overtime",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 24,
+            "x": 0,
+            "y": 17
+         },
+         "id": 11,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "round(sum(irate(ceph_pool_rd[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Reads",
+               "refId": "A"
+            },
+            {
+               "expr": "round(sum(irate(ceph_pool_wr[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Read/Write Profile",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
+      }
+   ],
+   "refresh": "10s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         }
       ]
-    },
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 16
-      },
-      "id": 20,
-      "panels": [],
-      "title": "R/W Profile",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Show the read/write workload profile overtime",
-      "fill": 1,
-      "gridPos": {
-        "h": 8,
-        "w": 24,
-        "x": 0,
-        "y": 17
-      },
-      "id": 10,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "round(sum(irate(ceph_pool_rd[30s])))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Reads",
-          "refId": "A"
-        },
-        {
-          "expr": "round(sum(irate(ceph_pool_wr[30s])))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Writes",
-          "refId": "B"
-        }
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
       ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Read/Write Profile",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
       ]
-    }
-  ],
-  "refresh": "10s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
-        {
-          "current": {
-          "tags": [],
-          "text": "default",
-          "value": "default"
-          },
-          "hide": 0,
-          "label": "Data Source",
-          "name": "datasource",
-          "options": [],
-          "query": "prometheus",
-          "refresh": 1,
-          "regex": "",
-          "type": "datasource"
-        }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "OSD Overview",
-  "uid": "lo02I1Aiz",
-  "version": 3
+   },
+   "timezone": "",
+   "title": "OSD Overview",
+   "uid": "lo02I1Aiz",
+   "version": 0
 }
index dd6bc3927fafcfdfd21107308bad2a774f6e58bb..e64cc3d82b69bc469c7da38f41e869f1395c3fc3 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "singlestat",
-      "name": "Singlestat",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1551858875941,
-  "links": [],
-  "panels": [
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": true,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "decimals": 2,
-      "format": "percentunit",
-      "gauge": {
-        "maxValue": 1,
-        "minValue": 0,
-        "show": true,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 7,
-        "w": 7,
-        "x": 0,
-        "y": 0
-      },
-      "id": 12,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": true
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "(ceph_pool_stored / (ceph_pool_stored + ceph_pool_max_avail)) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": ".7,.8",
-      "title": "Capacity used",
-      "type": "singlestat",
-      "valueFontSize": "50%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Time till pool is full assuming the average fill rate of the last 6 hours",
-      "format": "s",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 7,
-        "w": 5,
-        "x": 7,
-        "y": 0
-      },
-      "id": 14,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "(ceph_pool_max_avail / deriv(ceph_pool_stored[6h])) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"} > 0",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "title": "Time till full",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "inf",
-          "value": "null"
-        },
-        {
-          "op": "=",
-          "text": "inf",
-          "value": "N/A"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "aliasColors": {
-        "read_op_per_sec": "#3F6833",
-        "write_op_per_sec": "#E5AC0E"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 12,
-        "x": 12,
-        "y": 0
-      },
-      "id": 10,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "deriv(ceph_pool_objects[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Objects per second",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$pool_name Object Ingress/Egress",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "ops",
-          "label": "Objects out(-) / in(+) ",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {
-        "read_op_per_sec": "#3F6833",
-        "write_op_per_sec": "#E5AC0E"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 12,
-        "x": 0,
-        "y": 7
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.2"
       },
-      "id": 6,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "reads",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_pool_rd[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "reads",
-          "refId": "B"
-        },
-        {
-          "expr": "irate(ceph_pool_wr[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "writes",
-          "refId": "C"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$pool_name Client IOPS",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "iops",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {
-        "read_op_per_sec": "#3F6833",
-        "write_op_per_sec": "#E5AC0E"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 12,
-        "x": 12,
-        "y": 7
-      },
-      "id": 7,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [
-        {
-          "alias": "reads",
-          "transform": "negative-Y"
-        }
-      ],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_pool_rd_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "reads",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_pool_wr_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "writes",
-          "refId": "C"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$pool_name Client Throughput",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": "Read (-) / Write (+)",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "singlestat",
+         "name": "Singlestat",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "aliasColors": {
-        "read_op_per_sec": "#3F6833",
-        "write_op_per_sec": "#E5AC0E"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 0,
-      "gridPos": {
-        "h": 7,
-        "w": 12,
-        "x": 0,
-        "y": 14
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": true,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "format": "percentunit",
+         "gauge": {
+            "maxValue": 1,
+            "minValue": 0,
+            "show": true,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 7,
+            "w": 7,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": true
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "(ceph_pool_stored / (ceph_pool_stored + ceph_pool_max_avail)) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": ".7,.8",
+         "title": "Capacity used",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "id": 8,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": 100,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Time till pool is full assuming the average fill rate of the last 6 hours",
+         "format": "s",
+         "gauge": {
+            "maxValue": false,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 7,
+            "w": 5,
+            "x": 7,
+            "y": 0
+         },
+         "id": 3,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": ""
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "(ceph_pool_max_avail / deriv(ceph_pool_stored[6h])) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"} > 0",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "current",
+         "title": "Time till full",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": false
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "minSpan": 12,
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "ceph_pool_objects * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Number of Objects",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "$pool_name Objects",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
+      {
+         "aliasColors": {
+            "read_op_per_sec": "#3F6833",
+            "write_op_per_sec": "#E5AC0E"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 12,
+            "x": 12,
+            "y": 0
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "deriv(ceph_pool_objects[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Objects per second",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$pool_name Object Ingress/Egress",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ops",
+               "label": "Objects out(-) / in(+) ",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": {
+            "read_op_per_sec": "#3F6833",
+            "write_op_per_sec": "#E5AC0E"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 12,
+            "x": 0,
+            "y": 7
+         },
+         "id": 5,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "reads",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_pool_rd[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "reads",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_pool_wr[1m]) * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$pool_name Client IOPS",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "iops",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": "Objects",
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "refresh": "15s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "Prometheus admin.virt1.home.fajerski.name:9090",
-          "value": "Prometheus admin.virt1.home.fajerski.name:9090"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": {
+            "read_op_per_sec": "#3F6833",
+            "write_op_per_sec": "#E5AC0E"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 12,
+            "x": 12,
+            "y": 7
+         },
+         "id": 6,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [
+            {
+               "alias": "reads",
+               "transform": "negative-Y"
+            }
+         ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_pool_rd_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "reads",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_pool_wr_bytes[1m]) + on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "writes",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$pool_name Client Throughput",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": "Read (-) / Write (+)",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 0,
-        "includeAll": false,
-        "label": "Pool Name",
-        "multi": false,
-        "name": "pool_name",
-        "options": [],
-        "query": "label_values(ceph_pool_metadata,name)",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "sort": 1,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": {
+            "read_op_per_sec": "#3F6833",
+            "write_op_per_sec": "#E5AC0E"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 12,
+            "x": 0,
+            "y": 14
+         },
+         "id": 7,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "ceph_pool_objects * on(pool_id) group_left(instance,name) ceph_pool_metadata{name=~\"$pool_name\"}",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Number of Objects",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$pool_name Objects",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": "Objects",
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": null,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "Ceph Pool Details",
-  "uid": "-xyV8KCiz",
-  "version": 1
+   ],
+   "refresh": "15s",
+   "rows": [ ],
+   "schemaVersion": 22,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "Prometheus admin.virt1.home.fajerski.name:9090",
+               "value": "Prometheus admin.virt1.home.fajerski.name:9090"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": false,
+            "label": "Pool Name",
+            "multi": false,
+            "name": "pool_name",
+            "options": [ ],
+            "query": "label_values(ceph_pool_metadata,name)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "Ceph Pool Details",
+   "uid": "-xyV8KCiz",
+   "version": 0
 }
index c405f6075e1774877e71c5e84cace057a3fe20f3..d6c62e6e54db45912389d671d4e75d1285476da8 100644 (file)
 {
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [ ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1617656284287,
-  "links": [],
-  "panels": [
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 0,
-        "y": 0
-      },
-      "id": 21,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "count(ceph_pool_metadata)",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Pools",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "avg"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Count of the pools that have compression enabled",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 3,
-        "y": 0
-      },
-      "id": 7,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "pluginVersion": "6.7.4",
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "count(ceph_pool_metadata{compression_mode!=\"none\"})",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Pools with Compression",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "decimals": 1,
-      "description": "Total raw capacity available to the cluster",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 6,
-        "y": 0
-      },
-      "id": 27,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_osd_stat_bytes)",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Total Raw Capacity",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Total raw capacity consumed by user data and associated overheads (metadata + redundancy)",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 9,
-        "y": 0
-      },
-      "id": 25,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_pool_bytes_used)",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Raw Capacity Consumed",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current",
-      "decimals": 2
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "decimals": 1,
-      "description": "Total of client data stored in the cluster",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 12,
-        "y": 0
-      },
-      "id": 23,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_pool_stored)",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Logical Stored ",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "decimals": 1,
-      "description": "A compression saving is determined as the data eligible to be compressed minus the capacity used to store the data after compression",
-      "format": "bytes",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 15,
-        "y": 0
-      },
-      "id": 9,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used)",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Compression Savings",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "Indicates how suitable the data is within the pools that are/have been enabled for compression - averaged across all pools holding compressed data\n",
-      "format": "percent",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 18,
-        "y": 0
-      },
-      "id": 17,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "50%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "(sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_stored_raw and ceph_pool_compress_under_bytes > 0)) * 100",
-          "format": "table",
-          "hide": false,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Compression Eligibility",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "cacheTimeout": null,
-      "colorBackground": false,
-      "colorValue": false,
-      "colors": [
-        "#299c46",
-        "rgba(237, 129, 40, 0.89)",
-        "#d44a3a"
-      ],
-      "datasource": "$datasource",
-      "description": "This factor describes the average ratio of data eligible to be compressed divided by the data actually stored. It does not account for data written that was ineligible for compression (too small, or compression yield too low)",
-      "format": "none",
-      "gauge": {
-        "maxValue": 100,
-        "minValue": 0,
-        "show": false,
-        "thresholdLabels": false,
-        "thresholdMarkers": true
-      },
-      "gridPos": {
-        "h": 3,
-        "w": 3,
-        "x": 21,
-        "y": 0
-      },
-      "id": 15,
-      "interval": null,
-      "links": [],
-      "mappingType": 1,
-      "mappingTypes": [
-        {
-          "name": "value to text",
-          "value": 1
-        },
-        {
-          "name": "range to text",
-          "value": 2
-        }
-      ],
-      "maxDataPoints": 100,
-      "nullPointMode": "connected",
-      "nullText": null,
-      "postfix": "",
-      "postfixFontSize": "80%",
-      "prefix": "",
-      "prefixFontSize": "50%",
-      "rangeMaps": [
-        {
-          "from": "null",
-          "text": "N/A",
-          "to": "null"
-        }
-      ],
-      "sparkline": {
-        "fillColor": "rgba(31, 118, 189, 0.18)",
-        "full": false,
-        "lineColor": "rgb(31, 120, 193)",
-        "show": false,
-        "ymax": null,
-        "ymin": null
-      },
-      "tableColumn": "",
-      "targets": [
-        {
-          "expr": "sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_compress_bytes_used > 0)",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "thresholds": "",
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Compression Factor",
-      "type": "singlestat",
-      "valueFontSize": "80%",
-      "valueMaps": [
-        {
-          "op": "=",
-          "text": "N/A",
-          "value": "null"
-        }
-      ],
-      "valueName": "current"
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 6,
-        "w": 24,
-        "x": 0,
-        "y": 3
-      },
-      "id": 5,
-      "links": [],
-      "maxPerRow": 3,
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 5,
-        "desc": true
-      },
-      "styles": [
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "Time",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "instance",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "job",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "Pool Name",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "pattern": "name",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Pool ID",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "pattern": "pool_id",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "none"
-        },
-        {
-          "alias": "Compression Factor",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 1,
-          "mappingType": 1,
-          "pattern": "Value #A",
-          "thresholds": [],
-          "type": "number",
-          "unit": "none"
-        },
-        {
-          "alias": "% Used",
-          "align": "auto",
-          "colorMode": "value",
-          "colors": [
-            "rgb(0, 0, 0)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(245, 54, 54, 0.9)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value #D",
-          "thresholds": [
-            "70",
-            "85"
-          ],
-          "type": "number",
-          "unit": "percentunit"
-        },
-        {
-          "alias": "Usable Free",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value #B",
-          "thresholds": [],
-          "type": "number",
-          "unit": "bytes"
-        },
-        {
-          "alias": "Compression Eligibility",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "mappingType": 1,
-          "pattern": "Value #C",
-          "thresholds": [],
-          "type": "number",
-          "unit": "percent"
-        },
-        {
-          "alias": "Compression Savings",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
             "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 1,
-          "mappingType": 1,
-          "pattern": "Value #E",
-          "thresholds": [],
-          "type": "number",
-          "unit": "bytes"
-        },
-        {
-          "alias": "Growth (5d)",
-          "align": "auto",
-          "colorMode": "value",
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value #F",
-          "thresholds": [
-            "0",
-            "0"
-          ],
-          "type": "number",
-          "unit": "bytes"
-        },
-        {
-          "alias": "IOPS",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "mappingType": 1,
-          "pattern": "Value #G",
-          "thresholds": [],
-          "type": "number",
-          "unit": "none"
-        },
-        {
-          "alias": "Bandwidth",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 0,
-          "mappingType": 1,
-          "pattern": "Value #H",
-          "thresholds": [],
-          "type": "number",
-          "unit": "Bps"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "__name__",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "type",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "compression_mode",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "Type",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "description",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Stored",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 1,
-          "mappingType": 1,
-          "pattern": "Value #J",
-          "thresholds": [],
-          "type": "number",
-          "unit": "bytes"
-        },
-        {
-          "alias": "",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value #I",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        },
-        {
-          "alias": "Compression",
-          "align": "auto",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value #K",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short",
-          "valueMaps": [
-            {
-              "text": "ON",
-              "value": "1"
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
             }
-          ]
-        }
-      ],
-      "targets": [
-        {
-          "expr": "(ceph_pool_percent_used * on(pool_id) group_left(name) ceph_pool_metadata)",
-          "format": "table",
-          "hide": false,
-          "instant": true,
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "",
-          "refId": "D"
-        },
-        {
-          "expr": "ceph_pool_stored * on(pool_id) group_left ceph_pool_metadata",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "J"
-        },
-        {
-          "expr": "ceph_pool_max_avail * on(pool_id) group_left(name) ceph_pool_metadata",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "B"
-        },
-        {
-          "expr": "delta(ceph_pool_stored[5d])",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "F"
-        },
-        {
-          "expr": "ceph_pool_metadata",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "I"
-        },
-        {
-          "expr": "ceph_pool_metadata{compression_mode!=\"none\"}",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "K"
-        },
-        {
-          "expr": "(ceph_pool_compress_under_bytes / ceph_pool_compress_bytes_used > 0) and on(pool_id) (((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100 > 0.5)",
-          "format": "table",
-          "hide": false,
-          "instant": true,
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "",
-          "refId": "A"
-        },
-        {
-          "expr": "((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "C"
-        },
-        {
-          "expr": "(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used > 0)",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "E"
-        },
-        {
-          "expr": "rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "G"
-        },
-        {
-          "expr": "rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])",
-          "format": "table",
-          "instant": true,
-          "interval": "",
-          "legendFormat": "",
-          "refId": "H"
-        },
-        {
-          "expr": "",
-          "interval": "",
-          "legendFormat": "",
-          "refId": "L"
-        }
-      ],
-      "title": "Pool Overview",
-      "transform": "table",
-      "type": "table"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "This chart shows the sum of read and write IOPS from all clients by pool",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 8,
-        "w": 12,
-        "x": 0,
-        "y": 9
-      },
-      "hiddenSeries": false,
-      "id": 1,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "maxPerRow": 2,
-      "nullPointMode": "null as zero",
-      "options": {
-        "dataLinks": []
-      },
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "topk($topk,round((rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])),1) * on(pool_id) group_left(instance,name) ceph_pool_metadata) ",
-          "format": "time_series",
-          "hide": false,
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "{{name}} ",
-          "refId": "F"
-        },
-        {
-          "expr": "topk($topk,rate(ceph_pool_wr[30s]) + on(pool_id) group_left(instance,name) ceph_pool_metadata) ",
-          "format": "time_series",
-          "hide": true,
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "{{name}} - write",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Top $topk Client IOPS by Pool",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "decimals": 0,
-          "format": "short",
-          "label": "IOPS",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "The chart shows the sum of read and write bytes from all clients, by pool",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 8,
-        "w": 12,
-        "x": 12,
-        "y": 9
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "count(ceph_pool_metadata)",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Pools",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "avg"
       },
-      "hiddenSeries": false,
-      "id": 2,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Count of the pools that have compression enabled",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 3,
+            "y": 0
+         },
+         "id": 3,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "count(ceph_pool_metadata{compression_mode!=\"none\"})",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Pools with Compression",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "lines": true,
-      "linewidth": 2,
-      "links": [],
-      "maxPerRow": 2,
-      "nullPointMode": "null as zero",
-      "options": {
-        "dataLinks": []
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Total raw capacity available to the cluster",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 6,
+            "y": 0
+         },
+         "id": 4,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_osd_stat_bytes)",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Total Raw Capacity",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "topk($topk,(rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])) * on(pool_id) group_left(instance,name) ceph_pool_metadata)",
-          "format": "time_series",
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "{{name}}",
-          "refId": "A",
-          "textEditor": true
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Top $topk Client Bandwidth by Pool",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Total raw capacity consumed by user data and associated overheads (metadata + redundancy)",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 9,
+            "y": 0
+         },
+         "id": 5,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_pool_bytes_used)",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Raw Capacity Consumed",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Total of client data stored in the cluster",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 12,
+            "y": 0
+         },
+         "id": 6,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_pool_stored)",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Logical Stored ",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": "Throughput",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Historical view of capacity usage, to help identify growth and trends in pool consumption",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 7,
-        "w": 24,
-        "x": 0,
-        "y": 17
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "A compression saving is determined as the data eligible to be compressed minus the capacity used to store the data after compression",
+         "format": "bytes",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 15,
+            "y": 0
+         },
+         "id": 7,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used)",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Compression Savings",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "hiddenSeries": false,
-      "id": 19,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "Indicates how suitable the data is within the pools that are/have been enabled for compression - averaged across all pools holding compressed data\n",
+         "format": "percent",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 18,
+            "y": 0
+         },
+         "id": 8,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "(sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_stored_raw and ceph_pool_compress_under_bytes > 0)) * 100",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Compression Eligibility",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "lines": true,
-      "linewidth": 1,
-      "nullPointMode": "null",
-      "options": {
-        "dataLinks": []
+      {
+         "cacheTimeout": null,
+         "colorBackground": false,
+         "colorValue": false,
+         "colors": [
+            "#299c46",
+            "rgba(237, 129, 40, 0.89)",
+            "#d44a3a"
+         ],
+         "datasource": "$datasource",
+         "description": "This factor describes the average ratio of data eligible to be compressed divided by the data actually stored. It does not account for data written that was ineligible for compression (too small, or compression yield too low)",
+         "format": "none",
+         "gauge": {
+            "maxValue": 100,
+            "minValue": 0,
+            "show": false,
+            "thresholdLabels": false,
+            "thresholdMarkers": true
+         },
+         "gridPos": {
+            "h": 3,
+            "w": 3,
+            "x": 21,
+            "y": 0
+         },
+         "id": 9,
+         "interval": null,
+         "links": [ ],
+         "mappingType": 1,
+         "mappingTypes": [
+            {
+               "name": "value to text",
+               "value": 1
+            },
+            {
+               "name": "range to text",
+               "value": 2
+            }
+         ],
+         "maxDataPoints": 100,
+         "nullPointMode": "connected",
+         "nullText": null,
+         "postfix": "",
+         "postfixFontSize": "50%",
+         "prefix": "",
+         "prefixFontSize": "50%",
+         "rangeMaps": [
+            {
+               "from": "null",
+               "text": "N/A",
+               "to": "null"
+            }
+         ],
+         "sparkline": {
+            "fillColor": "rgba(31, 118, 189, 0.18)",
+            "full": false,
+            "lineColor": "rgb(31, 120, 193)",
+            "show": false
+         },
+         "tableColumn": "",
+         "targets": [
+            {
+               "expr": "sum(ceph_pool_compress_under_bytes > 0) / sum(ceph_pool_compress_bytes_used > 0)",
+               "format": "",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "thresholds": "",
+         "title": "Compression Factor",
+         "type": "singlestat",
+         "valueFontSize": "80%",
+         "valueMaps": [
+            {
+               "op": "=",
+               "text": "N/A",
+               "value": "null"
+            }
+         ],
+         "valueName": "current"
       },
-      "percentage": false,
-      "pointradius": 2,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "ceph_pool_bytes_used * on(pool_id) group_right ceph_pool_metadata",
-          "interval": "",
-          "legendFormat": "{{name}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": "14d",
-      "timeRegions": [
-        {
-          "colorMode": "background6",
-          "fill": true,
-          "fillColor": "rgba(234, 112, 112, 0.12)",
-          "line": false,
-          "lineColor": "rgba(237, 46, 24, 0.60)",
-          "op": "time"
-        }
-      ],
-      "timeShift": null,
-      "title": "Pool Capacity Usage (RAW)",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
+      {
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 6,
+            "w": 24,
+            "x": 0,
+            "y": 3
+         },
+         "id": 10,
+         "sort": {
+            "col": 5,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Time",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "instance",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "job",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Pool Name",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "name",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Pool ID",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "pool_id",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "none",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Compression Factor",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #A",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "none",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "% Used",
+               "colorMode": "value",
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #D",
+               "thresholds": [
+                  "70",
+                  "85"
+               ],
+               "type": "number",
+               "unit": "percentunit",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Usable Free",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #B",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "bytes",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Compression Eligibility",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #C",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "percent",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Compression Savings",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #E",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "bytes",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Growth (5d)",
+               "colorMode": "value",
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #F",
+               "thresholds": [
+                  "0",
+                  "0"
+               ],
+               "type": "number",
+               "unit": "bytes",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "IOPS",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #G",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "none",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Bandwidth",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #H",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "Bps",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "__name__",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "type",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "compression_mode",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Type",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "description",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Stored",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #J",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "bytes",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #I",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Compression",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value #K",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [
+                  {
+                     "text": "ON",
+                     "value": "1"
+                  }
+               ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "(ceph_pool_compress_under_bytes / ceph_pool_compress_bytes_used > 0) and on(pool_id) (((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100 > 0.5)",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            },
+            {
+               "expr": "ceph_pool_max_avail * on(pool_id) group_left(name) ceph_pool_metadata",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "B"
+            },
+            {
+               "expr": "((ceph_pool_compress_under_bytes > 0) / ceph_pool_stored_raw) * 100",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "C"
+            },
+            {
+               "expr": "(ceph_pool_percent_used * on(pool_id) group_left(name) ceph_pool_metadata)",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "D"
+            },
+            {
+               "expr": "(ceph_pool_compress_under_bytes - ceph_pool_compress_bytes_used > 0)",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "E"
+            },
+            {
+               "expr": "delta(ceph_pool_stored[5d])",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "F"
+            },
+            {
+               "expr": "rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "G"
+            },
+            {
+               "expr": "rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "H"
+            },
+            {
+               "expr": "ceph_pool_metadata",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "I"
+            },
+            {
+               "expr": "ceph_pool_stored * on(pool_id) group_left ceph_pool_metadata",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "J"
+            },
+            {
+               "expr": "ceph_pool_metadata{compression_mode!=\"none\"}",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "K"
+            },
+            {
+               "expr": "",
+               "format": "",
+               "intervalFactor": "",
+               "legendFormat": "",
+               "refId": "L"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Pool Overview",
+         "transform": "table",
+         "type": "table"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "This chart shows the sum of read and write IOPS from all clients by pool",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 12,
+            "x": 0,
+            "y": 9
+         },
+         "id": 11,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "topk($topk,round((rate(ceph_pool_rd[30s]) + rate(ceph_pool_wr[30s])),1) * on(pool_id) group_left(instance,name) ceph_pool_metadata) ",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{name}} ",
+               "refId": "A"
+            },
+            {
+               "expr": "topk($topk,rate(ceph_pool_wr[30s]) + on(pool_id) group_left(instance,name) ceph_pool_metadata) ",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{name}} - write",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Top $topk Client IOPS by Pool",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": "IOPS",
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "decimals": 1,
-          "format": "bytes",
-          "label": "Capacity Used",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    }
-  ],
-  "refresh": "15s",
-  "schemaVersion": 22,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "selected": false,
-          "text": "Dashboard1",
-          "value": "Dashboard1"
-        },
-        "hide": 0,
-        "includeAll": false,
-        "label": "Data Source",
-        "multi": false,
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "The chart shows the sum of read and write bytes from all clients, by pool",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 12,
+            "x": 12,
+            "y": 9
+         },
+         "id": 12,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "topk($topk,(rate(ceph_pool_rd_bytes[30s]) + rate(ceph_pool_wr_bytes[30s])) * on(pool_id) group_left(instance,name) ceph_pool_metadata)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{name}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Top $topk Client Bandwidth by Pool",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": "Throughput",
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "current": {
-          "text": "15",
-          "value": "15"
-        },
-        "hide": 0,
-        "label": "Top K",
-        "name": "topk",
-        "options": [
-          {
-            "text": "15",
-            "value": "15"
-          }
-        ],
-        "query": "15",
-        "skipUrlSync": false,
-        "type": "textbox"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Historical view of capacity usage, to help identify growth and trends in pool consumption",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 24,
+            "x": 0,
+            "y": 17
+         },
+         "id": 13,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "ceph_pool_bytes_used * on(pool_id) group_right ceph_pool_metadata",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{name}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Pool Capacity Usage (RAW)",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": "Capacity Used",
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "Ceph Pools Overview",
-  "uid": "z99hzWtmk",
-  "variables": {
-    "list": []
-  },
-  "version": 10
+   ],
+   "refresh": "15s",
+   "rows": [ ],
+   "schemaVersion": 22,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "Dashboard1",
+               "value": "Dashboard1"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": {
+               "text": "15",
+               "value": "15"
+            },
+            "hide": 0,
+            "includeAll": false,
+            "label": "TopK",
+            "multi": false,
+            "name": "topk",
+            "options": [
+               {
+                  "text": "15",
+                  "value": "15"
+               }
+            ],
+            "query": "15",
+            "refresh": 0,
+            "type": "custom"
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "Ceph Pools Overview",
+   "uid": "z99hzWtmk",
+   "version": 0
 }
index 648abab89ce962844ac794d7b37d3bfc17b4bff4..432eecc837ca489073849e0495ac6e8d1dd279b0 100644 (file)
 {
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "grafana-piechart-panel",
-      "name": "Pie Chart",
-      "version": "1.3.3"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1534386250869,
-  "links": [],
-  "panels": [
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 0
-      },
-      "id": 12,
-      "panels": [],
-      "repeat": null,
-      "title": "RGW Host Detail : $rgw_servers",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 8,
-        "w": 6,
-        "x": 0,
-        "y": 1
-      },
-      "id": 34,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum by (ceph_daemon) (rate(ceph_rgw_get_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_get_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GET {{ceph_daemon}}",
-          "refId": "A"
-        },
-        {
-          "expr": "sum by (ceph_daemon)(rate(ceph_rgw_put_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_put_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUT {{ceph_daemon}}",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "$rgw_servers GET/PUT Latencies",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "s",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 8,
-        "w": 7,
-        "x": 6,
-        "y": 1
-      },
-      "id": 18,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "rate(ceph_rgw_get_b{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GETs {{ceph_daemon}}",
-          "refId": "B"
-        },
-        {
-          "expr": "rate(ceph_rgw_put_b{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUTs {{ceph_daemon}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Bandwidth by HTTP Operation",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "decimals": 0,
-          "format": "bytes",
-          "label": "",
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    },
-    {
-      "aliasColors": {
-        "GETs": "#7eb26d",
-        "Other": "#447ebc",
-        "PUTs": "#eab839",
-        "Requests": "#3f2b5b",
-        "Requests Failed": "#bf1b00"
-      },
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "fillGradient": 0,
-      "gridPos": {
-        "h": 8,
-        "w": 7,
-        "x": 13,
-        "y": 1
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.0.0"
       },
-      "id": 14,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "rate(ceph_rgw_failed_req{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Requests Failed {{ceph_daemon}}",
-          "refId": "B"
-        },
-        {
-          "expr": "rate(ceph_rgw_get{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GETs {{ceph_daemon}}",
-          "refId": "C"
-        },
-        {
-          "expr": "rate(ceph_rgw_put{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUTs {{ceph_daemon}}",
-          "refId": "D"
-        },
-        {
-          "expr": "rate(ceph_rgw_req{ceph_daemon=~\"[[rgw_servers]]\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"[[rgw_servers]]\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"[[rgw_servers]]\"}[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Other {{ceph_daemon}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "HTTP Request Breakdown",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "grafana-piechart-panel",
+         "name": "Pie Chart",
+         "type": "panel",
+         "version": "1.3.3"
       },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
+      }
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
       ]
-    },
-    {
-      "aliasColors": {
-        "Failures": "#bf1b00",
-        "GETs": "#7eb26d",
-        "Other (HEAD,POST,DELETE)": "#447ebc",
-        "PUTs": "#eab839"
-      },
-      "breakPoint": "50%",
-      "cacheTimeout": null,
-      "combine": {
-        "label": "Others",
-        "threshold": 0
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "RGW Host Detail : $rgw_servers",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "datasource": "$datasource",
-      "fontSize": "80%",
-      "format": "none",
-      "gridPos": {
-        "h": 8,
-        "w": 4,
-        "x": 20,
-        "y": 1
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 6,
+            "x": 0,
+            "y": 1
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum by (ceph_daemon) (rate(ceph_rgw_get_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_get_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GET {{ceph_daemon}}",
+               "refId": "A"
+            },
+            {
+               "expr": "sum by (ceph_daemon)(rate(ceph_rgw_put_initial_lat_sum{ceph_daemon=~\"($rgw_servers)\"}[30s]) / rate(ceph_rgw_put_initial_lat_count{ceph_daemon=~\"($rgw_servers)\"}[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUT {{ceph_daemon}}",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "$rgw_servers GET/PUT Latencies",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "id": 23,
-      "interval": null,
-      "legend": {
-        "show": true,
-        "values": true
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 7,
+            "x": 6,
+            "y": 1
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "rate(ceph_rgw_get_b{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GETs {{ceph_daemon}}",
+               "refId": "A"
+            },
+            {
+               "expr": "rate(ceph_rgw_put_b{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUTs {{ceph_daemon}}",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Bandwidth by HTTP Operation",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "legendType": "Under graph",
-      "links": [],
-      "maxDataPoints": 3,
-      "nullPointMode": "connected",
-      "pieType": "pie",
-      "strokeWidth": 1,
-      "targets": [
-        {
-          "expr": "rate(ceph_rgw_failed_req{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Failures {{ceph_daemon}}",
-          "refId": "A"
-        },
-        {
-          "expr": "rate(ceph_rgw_get{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GETs {{ceph_daemon}}",
-          "refId": "B"
-        },
-        {
-          "expr": "rate(ceph_rgw_put{ceph_daemon=~\"[[rgw_servers]]\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUTs {{ceph_daemon}}",
-          "refId": "C"
-        },
-        {
-          "expr": "rate(ceph_rgw_req{ceph_daemon=~\"[[rgw_servers]]\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"[[rgw_servers]]\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"[[rgw_servers]]\"}[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Other (DELETE,LIST) {{ceph_daemon}}",
-          "refId": "D"
-        }
-      ],
-      "title": "Workload Breakdown",
-      "type": "grafana-piechart-panel",
-      "valueName": "current"
-    }
-  ],
-  "refresh": "15s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [
-    "overview"
-  ],
-  "templating": {
-    "list": [
       {
-        "current": {
-        "tags": [],
-        "text": "default",
-        "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "type": "datasource"
+         "aliasColors": {
+            "GETs": "#7eb26d",
+            "Other": "#447ebc",
+            "PUTs": "#eab839",
+            "Requests": "#3f2b5b",
+            "Requests Failed": "#bf1b00"
+         },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 8,
+            "w": 7,
+            "x": 13,
+            "y": 1
+         },
+         "id": 5,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "rate(ceph_rgw_failed_req{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Requests Failed {{ceph_daemon}}",
+               "refId": "A"
+            },
+            {
+               "expr": "rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GETs {{ceph_daemon}}",
+               "refId": "B"
+            },
+            {
+               "expr": "rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUTs {{ceph_daemon}}",
+               "refId": "C"
+            },
+            {
+               "expr": "rate(ceph_rgw_req{ceph_daemon=~\"$rgw_servers\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Other {{ceph_daemon}}",
+               "refId": "D"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "HTTP Request Breakdown",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 0,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "rgw_servers",
-        "options": [],
-        "query": "label_values(ceph_rgw_req, ceph_daemon)",
-        "refresh": 1,
-        "regex": "",
-        "sort": 1,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": {
+            "Failures": "#bf1b00",
+            "GETs": "#7eb26d",
+            "Other (HEAD,POST,DELETE)": "#447ebc",
+            "PUTs": "#eab839",
+            "Requests": "#3f2b5b"
+         },
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 8,
+            "w": 4,
+            "x": 20,
+            "y": 1
+         },
+         "id": 6,
+         "legend": {
+            "percentage": true,
+            "show": true,
+            "values": true
+         },
+         "legendType": "Under graph",
+         "pieType": "pie",
+         "targets": [
+            {
+               "expr": "rate(ceph_rgw_failed_req{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Failures {{ceph_daemon}}",
+               "refId": "A"
+            },
+            {
+               "expr": "rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GETs {{ceph_daemon}}",
+               "refId": "B"
+            },
+            {
+               "expr": "rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUTs {{ceph_daemon}}",
+               "refId": "C"
+            },
+            {
+               "expr": "rate(ceph_rgw_req{ceph_daemon=~\"$rgw_servers\"}[30s]) -\n  (rate(ceph_rgw_get{ceph_daemon=~\"$rgw_servers\"}[30s]) +\n   rate(ceph_rgw_put{ceph_daemon=~\"$rgw_servers\"}[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Other (DELETE,LIST) {{ceph_daemon}}",
+               "refId": "D"
+            }
+         ],
+         "title": "Workload Breakdown",
+         "type": "grafana-piechart-panel",
+         "valueName": "current"
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "RGW Instance Detail",
-  "uid": "x5ARzZtmk",
-  "version": 2
+   ],
+   "refresh": "15s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [
+      "overview"
+   ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": "",
+            "multi": false,
+            "name": "rgw_servers",
+            "options": [ ],
+            "query": "label_values(ceph_rgw_req, ceph_daemon)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "RGW Instance Detail",
+   "uid": "x5ARzZtmk",
+   "version": 0
 }
index 487d736b3d4e169cdab34d3b757d1196c6ff1d08..f996fed95e6e6a31a0f53598af5a9c196d1b66fd 100644 (file)
 {
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1534386107523,
-  "links": [],
-  "panels": [
-    {
-      "collapsed": false,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 0
-      },
-      "id": 2,
-      "panels": [],
-      "title": "RGW Overview - All Gateways",
-      "type": "row"
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 0,
-        "y": 1
-      },
-      "id": 29,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "rate(ceph_rgw_get_initial_lat_sum[30s]) / rate(ceph_rgw_get_initial_lat_count[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GET AVG",
-          "refId": "A"
-        },
-        {
-          "expr": "rate(ceph_rgw_put_initial_lat_sum[30s]) / rate(ceph_rgw_put_initial_lat_count[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUT AVG",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Average GET/PUT Latencies",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "s",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 7,
-        "x": 8,
-        "y": 1
-      },
-      "id": 4,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum by(rgw_host) (label_replace(rate(ceph_rgw_req[30s]), \"rgw_host\", \"$1\", \"ceph_daemon\", \"rgw.(.*)\"))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{rgw_host}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Total Requests/sec by RGW Instance",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "decimals": 0,
-          "format": "none",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Latencies are shown stacked, without a yaxis to provide a visual indication of GET latency imbalance across RGW hosts",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 6,
-        "x": 15,
-        "y": 1
-      },
-      "id": 31,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(rate(ceph_rgw_get_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_get_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{rgw_host}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "GET Latencies by RGW Instance",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "decimals": null,
-          "format": "s",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": false
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Total bytes transferred in/out of all radosgw instances within the cluster",
-      "fill": 1,
-      "gridPos": {
-        "h": 6,
-        "w": 8,
-        "x": 0,
-        "y": 8
-      },
-      "id": 6,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.0.0"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum(rate(ceph_rgw_get_b[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "GETs",
-          "refId": "A"
-        },
-        {
-          "expr": "sum(rate(ceph_rgw_put_b[30s]))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "PUTs",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Bandwidth Consumed by Type",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "bytes",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
+      }
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
       ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Total bytes transferred in/out through get/put operations, by radosgw instance",
-      "fill": 1,
-      "gridPos": {
-        "h": 6,
-        "w": 7,
-        "x": 8,
-        "y": 8
-      },
-      "id": 9,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "sum by(rgw_host) (\n  (label_replace(rate(ceph_rgw_get_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")) + \n  (label_replace(rate(ceph_rgw_put_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\"))\n)",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{rgw_host}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Bandwidth by RGW Instance",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "collapse": false,
+         "collapsed": false,
+         "gridPos": {
+            "h": 1,
+            "w": 24,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "panels": [ ],
+         "repeat": null,
+         "repeatIteration": null,
+         "repeatRowId": null,
+         "showTitle": true,
+         "title": "RGW Overview - All Gateways",
+         "titleSize": "h6",
+         "type": "row"
       },
-      "yaxes": [
-        {
-          "format": "bytes",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ]
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "description": "Latencies are shown stacked, without a yaxis to provide a visual indication of PUT latency imbalance across RGW hosts",
-      "fill": 1,
-      "gridPos": {
-        "h": 6,
-        "w": 6,
-        "x": 15,
-        "y": 8
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 0,
+            "y": 1
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "rate(ceph_rgw_get_initial_lat_sum[30s]) / rate(ceph_rgw_get_initial_lat_count[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GET AVG",
+               "refId": "A"
+            },
+            {
+               "expr": "rate(ceph_rgw_put_initial_lat_sum[30s]) / rate(ceph_rgw_put_initial_lat_count[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUT AVG",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Average GET/PUT Latencies",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "id": 32,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 7,
+            "x": 8,
+            "y": 1
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum by(rgw_host) (label_replace(rate(ceph_rgw_req[30s]), \"rgw_host\", \"$1\", \"ceph_daemon\", \"rgw.(.*)\"))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{rgw_host}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Total Requests/sec by RGW Instance",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "none",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": true,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "label_replace(rate(ceph_rgw_put_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_put_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "{{rgw_host}}",
-          "refId": "A"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "PUT Latencies by RGW Instance",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Latencies are shown stacked, without a yaxis to provide a visual indication of GET latency imbalance across RGW hosts",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 6,
+            "x": 15,
+            "y": 1
+         },
+         "id": 5,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(rate(ceph_rgw_get_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_get_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{rgw_host}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "GET Latencies by RGW Instance",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Total bytes transferred in/out of all radosgw instances within the cluster",
+         "fill": 1,
+         "gridPos": {
+            "h": 6,
+            "w": 8,
+            "x": 0,
+            "y": 8
+         },
+         "id": 6,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum(rate(ceph_rgw_get_b[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "GETs",
+               "refId": "A"
+            },
+            {
+               "expr": "sum(rate(ceph_rgw_put_b[30s]))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "PUTs",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Bandwidth Consumed by Type",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "yaxes": [
-        {
-          "decimals": null,
-          "format": "s",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": false
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": false
-        }
-      ]
-    }
-  ],
-  "refresh": "15s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [
-    "overview"
-  ],
-  "templating": {
-    "list": [
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$datasource",
-        "hide": 2,
-        "includeAll": true,
-        "label": null,
-        "multi": false,
-        "name": "rgw_servers",
-        "options": [],
-        "query": "label_values(ceph_rgw_req, ceph_daemon)",
-        "refresh": 1,
-        "regex": "",
-        "sort": 1,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Total bytes transferred in/out through get/put operations, by radosgw instance",
+         "fill": 1,
+         "gridPos": {
+            "h": 6,
+            "w": 7,
+            "x": 8,
+            "y": 8
+         },
+         "id": 7,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "sum by(rgw_host) (\n  (label_replace(rate(ceph_rgw_get_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")) + \n  (label_replace(rate(ceph_rgw_put_b[30s]), \"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\"))\n)",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{rgw_host}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Bandwidth by RGW Instance",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "bytes",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "current": {
-        "tags": [],
-        "text": "default",
-        "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "Latencies are shown stacked, without a yaxis to provide a visual indication of PUT latency imbalance across RGW hosts",
+         "fill": 1,
+         "gridPos": {
+            "h": 6,
+            "w": 6,
+            "x": 15,
+            "y": 8
+         },
+         "id": 8,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "label_replace(rate(ceph_rgw_put_initial_lat_sum[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\") / \nlabel_replace(rate(ceph_rgw_put_initial_lat_count[30s]),\"rgw_host\",\"$1\",\"ceph_daemon\",\"rgw.(.*)\")",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "{{rgw_host}}",
+               "refId": "A"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "PUT Latencies by RGW Instance",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "s",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "RGW Overview",
-  "uid": "WAkugZpiz",
-  "version": 2
+   ],
+   "refresh": "15s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [
+      "overview"
+   ],
+   "templating": {
+      "list": [
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$datasource",
+            "hide": 0,
+            "includeAll": true,
+            "label": "",
+            "multi": false,
+            "name": "rgw_servers",
+            "options": [ ],
+            "query": "label_values(ceph_rgw_req, ceph_daemon)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 1,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         },
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "RGW Overview",
+   "uid": "WAkugZpiz",
+   "version": 0
 }
index d6cd5e98a5e3c1e9771a455f6924c23326225761..442da57590652d040a264578e584330793f0ae46 100644 (file)
@@ -29,6 +29,7 @@
          }
       ]
    },
+   "description": "",
    "editable": false,
    "gnetId": null,
    "graphTooltip": 0,
@@ -42,6 +43,7 @@
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
+         "description": "",
          "fill": 1,
          "gridPos": {
             "h": 7,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
+         "description": "",
          "fill": 1,
          "gridPos": {
             "h": 7,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
+         "description": "",
          "fill": 1,
          "gridPos": {
             "h": 7,
          "dashLength": 10,
          "dashes": false,
          "datasource": "$datasource",
+         "description": "",
          "fill": 1,
          "gridPos": {
             "h": 7,
             "allValue": null,
             "current": { },
             "datasource": "$datasource",
-            "hide": 2,
+            "hide": 0,
             "includeAll": true,
-            "label": null,
+            "label": "",
             "multi": false,
             "name": "rgw_servers",
             "options": [ ],
index 59932a5ee05fccfb0e0bffd67b5e257c011626d0..d943b16a64e0a31a659104168542722e64ef41ef 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.3.3"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "description": "Detailed Performance of RBD Images (IOPS/Throughput/Latency)",
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1584428820779,
-  "links": [],
-  "panels": [
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$Datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 8,
-        "x": 0,
-        "y": 0
-      },
-      "id": 6,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "hideEmpty": false,
-        "hideZero": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_rbd_write_ops{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_rbd_read_ops{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Read",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "IOPS",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "iops",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "iops",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": true,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$Datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 8,
-        "x": 8,
-        "y": 0
-      },
-      "id": 4,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_rbd_write_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_rbd_read_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Read",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Throughput",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.3.3"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "Bps",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": true,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$Datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 9,
-        "w": 8,
-        "x": 16,
-        "y": 0
-      },
-      "id": 2,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null as zero",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "irate(ceph_rbd_write_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_write_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write",
-          "refId": "A"
-        },
-        {
-          "expr": "irate(ceph_rbd_read_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_read_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Read",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeShift": null,
-      "title": "Average Latency",
-      "tooltip": {
-        "shared": true,
-        "sort": 0,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "ns",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": "0",
-          "show": true
-        },
-        {
-          "format": "ns",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": true,
-        "alignLevel": null
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    }
-  ],
-  "refresh": false,
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [],
-  "templating": {
-    "list": [
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "Detailed Performance of RBD Images (IOPS/Throughput/Latency)",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
       {
-        "current": {},
-        "hide": 0,
-        "label": null,
-        "name": "Datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$Datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 8,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_rbd_write_ops{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_rbd_read_ops{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "IOPS",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "iops",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "iops",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$Datasource",
-        "hide": 0,
-        "includeAll": false,
-        "label": null,
-        "multi": false,
-        "name": "Pool",
-        "options": [],
-        "query": "label_values(pool)",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$Datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 8,
+            "x": 8,
+            "y": 0
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_rbd_write_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_rbd_read_bytes{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Throughput",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "Bps",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
       {
-        "allValue": null,
-        "current": {},
-        "datasource": "$Datasource",
-        "hide": 0,
-        "includeAll": false,
-        "label": null,
-        "multi": false,
-        "name": "Image",
-        "options": [],
-        "query": "label_values(image)",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "sort": 0,
-        "tagValuesQuery": "",
-        "tags": [],
-        "tagsQuery": "",
-        "type": "query",
-        "useTags": false
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$Datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 9,
+            "w": 8,
+            "x": 16,
+            "y": 0
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null as zero",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "irate(ceph_rbd_write_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_write_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write",
+               "refId": "A"
+            },
+            {
+               "expr": "irate(ceph_rbd_read_latency_sum{pool=\"$Pool\", image=\"$Image\"}[30s]) / irate(ceph_rbd_read_latency_count{pool=\"$Pool\", image=\"$Image\"}[30s])",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Average Latency",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ns",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "ns",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "RBD Details",
-  "uid": "YhCYGcuZz",
-  "version": 7
+   ],
+   "refresh": false,
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [ ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": null,
+            "name": "Datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$Datasource",
+            "hide": 0,
+            "includeAll": false,
+            "label": "",
+            "multi": false,
+            "name": "Pool",
+            "options": [ ],
+            "query": "label_values(pool)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 0,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         },
+         {
+            "allValue": null,
+            "current": { },
+            "datasource": "$Datasource",
+            "hide": 0,
+            "includeAll": false,
+            "label": "",
+            "multi": false,
+            "name": "Image",
+            "options": [ ],
+            "query": "label_values(image)",
+            "refresh": 1,
+            "regex": "",
+            "sort": 0,
+            "tagValuesQuery": "",
+            "tags": [ ],
+            "tagsQuery": "",
+            "type": "query",
+            "useTags": false
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "RBD Details",
+   "uid": "YhCYGcuZz",
+   "version": 0
 }
index eb15fbcb8ef4a5ed6fa876b606c345c7f5d2b4f1..5f0ade741e971a4d0bd1e10049b3f151fe50a03a 100644 (file)
 {
-  "__inputs": [],
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "5.4.2"
-    },
-    {
-      "type": "panel",
-      "id": "graph",
-      "name": "Graph",
-      "version": "5.0.0"
-    },
-    {
-      "type": "datasource",
-      "id": "prometheus",
-      "name": "Prometheus",
-      "version": "5.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "table",
-      "name": "Table",
-      "version": "5.0.0"
-    }
-  ],
-  "annotations": {
-    "list": [
+   "__inputs": [ ],
+   "__requires": [
       {
-        "builtIn": 1,
-        "datasource": "-- Grafana --",
-        "enable": true,
-        "hide": true,
-        "iconColor": "rgba(0, 211, 255, 1)",
-        "name": "Annotations & Alerts",
-        "type": "dashboard"
-      }
-    ]
-  },
-  "editable": false,
-  "gnetId": null,
-  "graphTooltip": 0,
-  "id": null,
-  "iteration": 1547242766440,
-  "links": [],
-  "panels": [
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 0,
-        "y": 0
-      },
-      "id": 2,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "round(sum(irate(ceph_rbd_write_ops[30s])))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Writes",
-          "refId": "A"
-        },
-        {
-          "expr": "round(sum(irate(ceph_rbd_read_ops[30s])))",
-          "format": "time_series",
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "Reads",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "IOPS",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 8,
-        "y": 0
-      },
-      "id": 4,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
+         "id": "grafana",
+         "name": "Grafana",
+         "type": "grafana",
+         "version": "5.4.2"
       },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "round(sum(irate(ceph_rbd_write_bytes[30s])))",
-          "format": "time_series",
-          "instant": false,
-          "intervalFactor": 1,
-          "legendFormat": "Write",
-          "refId": "A"
-        },
-        {
-          "expr": "round(sum(irate(ceph_rbd_read_bytes[30s])))",
-          "format": "time_series",
-          "instant": false,
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "Read",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Throughput",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
-      },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
-      },
-      "yaxes": [
-        {
-          "format": "Bps",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
-      }
-    },
-    {
-      "aliasColors": {},
-      "bars": false,
-      "dashLength": 10,
-      "dashes": false,
-      "datasource": "$datasource",
-      "fill": 1,
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 16,
-        "y": 0
-      },
-      "id": 6,
-      "legend": {
-        "avg": false,
-        "current": false,
-        "max": false,
-        "min": false,
-        "show": true,
-        "total": false,
-        "values": false
-      },
-      "lines": true,
-      "linewidth": 1,
-      "links": [],
-      "nullPointMode": "null",
-      "percentage": false,
-      "pointradius": 5,
-      "points": false,
-      "renderer": "flot",
-      "seriesOverrides": [],
-      "spaceLength": 10,
-      "stack": false,
-      "steppedLine": false,
-      "targets": [
-        {
-          "expr": "round(sum(irate(ceph_rbd_write_latency_sum[30s])) / sum(irate(ceph_rbd_write_latency_count[30s])))",
-          "format": "time_series",
-          "intervalFactor": 1,
-          "legendFormat": "Write",
-          "refId": "A"
-        },
-        {
-          "expr": "round(sum(irate(ceph_rbd_read_latency_sum[30s])) / sum(irate(ceph_rbd_read_latency_count[30s])))",
-          "format": "time_series",
-          "interval": "",
-          "intervalFactor": 1,
-          "legendFormat": "Read",
-          "refId": "B"
-        }
-      ],
-      "thresholds": [],
-      "timeFrom": null,
-      "timeRegions": [],
-      "timeShift": null,
-      "title": "Average Latency",
-      "tooltip": {
-        "shared": true,
-        "sort": 2,
-        "value_type": "individual"
+      {
+         "id": "graph",
+         "name": "Graph",
+         "type": "panel",
+         "version": "5.0.0"
       },
-      "type": "graph",
-      "xaxis": {
-        "buckets": null,
-        "mode": "time",
-        "name": null,
-        "show": true,
-        "values": []
+      {
+         "id": "prometheus",
+         "name": "Prometheus",
+         "type": "datasource",
+         "version": "5.0.0"
       },
-      "yaxes": [
-        {
-          "format": "ns",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        },
-        {
-          "format": "short",
-          "label": null,
-          "logBase": 1,
-          "max": null,
-          "min": null,
-          "show": true
-        }
-      ],
-      "yaxis": {
-        "align": false,
-        "alignLevel": null
+      {
+         "id": "table",
+         "name": "Table",
+         "type": "panel",
+         "version": "5.0.0"
       }
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 0,
-        "y": 7
-      },
-      "hideTimeOverride": false,
-      "id": 12,
-      "links": [],
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 3,
-        "desc": true
+   ],
+   "annotations": {
+      "list": [
+         {
+            "builtIn": 1,
+            "datasource": "-- Grafana --",
+            "enable": true,
+            "hide": true,
+            "iconColor": "rgba(0, 211, 255, 1)",
+            "name": "Annotations & Alerts",
+            "showIn": 0,
+            "tags": [ ],
+            "type": "dashboard"
+         }
+      ]
+   },
+   "description": "",
+   "editable": false,
+   "gnetId": null,
+   "graphTooltip": 0,
+   "hideControls": false,
+   "id": null,
+   "links": [ ],
+   "panels": [
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 0,
+            "y": 0
+         },
+         "id": 2,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "round(sum(irate(ceph_rbd_write_ops[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Writes",
+               "refId": "A"
+            },
+            {
+               "expr": "round(sum(irate(ceph_rbd_read_ops[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Reads",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "IOPS",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "styles": [
-        {
-          "alias": "Pool",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "pool",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short",
-          "valueMaps": []
-        },
-        {
-          "alias": "Image",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "image",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "IOPS",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value",
-          "thresholds": [],
-          "type": "number",
-          "unit": "iops"
-        },
-        {
-          "alias": "",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "/.*/",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        }
-      ],
-      "targets": [
-        {
-          "expr": "topk(10, (sort((irate(ceph_rbd_write_ops[30s]) + on (image, pool, namespace) irate(ceph_rbd_read_ops[30s])))))",
-          "format": "table",
-          "instant": true,
-          "intervalFactor": 1,
-          "legendFormat": "",
-          "refId": "A"
-        }
-      ],
-      "title": "Highest IOPS",
-      "transform": "table",
-      "type": "table"
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 8,
-        "y": 7
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 8,
+            "y": 0
+         },
+         "id": 3,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "round(sum(irate(ceph_rbd_write_bytes[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write",
+               "refId": "A"
+            },
+            {
+               "expr": "round(sum(irate(ceph_rbd_read_bytes[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Throughput",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "Bps",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "id": 10,
-      "links": [],
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 3,
-        "desc": true
+      {
+         "aliasColors": { },
+         "bars": false,
+         "dashLength": 10,
+         "dashes": false,
+         "datasource": "$datasource",
+         "description": "",
+         "fill": 1,
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 16,
+            "y": 0
+         },
+         "id": 4,
+         "legend": {
+            "alignAsTable": false,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": false,
+            "show": true,
+            "sideWidth": null,
+            "total": false,
+            "values": false
+         },
+         "lines": true,
+         "linewidth": 1,
+         "links": [ ],
+         "nullPointMode": "null",
+         "percentage": false,
+         "pointradius": 5,
+         "points": false,
+         "renderer": "flot",
+         "repeat": null,
+         "seriesOverrides": [ ],
+         "spaceLength": 10,
+         "stack": false,
+         "steppedLine": false,
+         "targets": [
+            {
+               "expr": "round(sum(irate(ceph_rbd_write_latency_sum[30s])) / sum(irate(ceph_rbd_write_latency_count[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Write",
+               "refId": "A"
+            },
+            {
+               "expr": "round(sum(irate(ceph_rbd_read_latency_sum[30s])) / sum(irate(ceph_rbd_read_latency_count[30s])))",
+               "format": "time_series",
+               "intervalFactor": 1,
+               "legendFormat": "Read",
+               "refId": "B"
+            }
+         ],
+         "thresholds": [ ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Average Latency",
+         "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+         },
+         "type": "graph",
+         "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": [ ]
+         },
+         "yaxes": [
+            {
+               "format": "ns",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            },
+            {
+               "format": "short",
+               "label": null,
+               "logBase": 1,
+               "max": null,
+               "min": 0,
+               "show": true
+            }
+         ]
       },
-      "styles": [
-        {
-          "alias": "Pool",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "pool",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Image",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "image",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Throughput",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value",
-          "thresholds": [],
-          "type": "number",
-          "unit": "Bps"
-        },
-        {
-          "alias": "",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "decimals": 2,
-          "pattern": "/.*/",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        }
-      ],
-      "targets": [
-        {
-          "expr": "topk(10, sort(sum(irate(ceph_rbd_read_bytes[30s]) + irate(ceph_rbd_write_bytes[30s])) by (pool, image, namespace)))",
-          "format": "table",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "title": "Highest Throughput",
-      "transform": "table",
-      "type": "table"
-    },
-    {
-      "columns": [],
-      "datasource": "$datasource",
-      "fontSize": "100%",
-      "gridPos": {
-        "h": 7,
-        "w": 8,
-        "x": 16,
-        "y": 7
+      {
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 0,
+            "y": 7
+         },
+         "id": 5,
+         "sort": {
+            "col": 3,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "Pool",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "pool",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Image",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "image",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "IOPS",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "iops",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "/.*/",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "topk(10, (sort((irate(ceph_rbd_write_ops[30s]) + on (image, pool, namespace) irate(ceph_rbd_read_ops[30s])))))",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Highest IOPS",
+         "transform": "table",
+         "type": "table"
       },
-      "id": 14,
-      "links": [],
-      "pageSize": null,
-      "scroll": true,
-      "showHeader": true,
-      "sort": {
-        "col": 3,
-        "desc": true
+      {
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 8,
+            "y": 7
+         },
+         "id": 6,
+         "sort": {
+            "col": 3,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "Pool",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "pool",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Image",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "image",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Throughput",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "Bps",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "/.*/",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "topk(10, sort(sum(irate(ceph_rbd_read_bytes[30s]) + irate(ceph_rbd_write_bytes[30s])) by (pool, image, namespace)))",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Highest Throughput",
+         "transform": "table",
+         "type": "table"
       },
-      "styles": [
-        {
-          "alias": "Pool",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "pool",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Image",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "image",
-          "thresholds": [],
-          "type": "string",
-          "unit": "short"
-        },
-        {
-          "alias": "Latency",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "Value",
-          "thresholds": [],
-          "type": "number",
-          "unit": "ns"
-        },
-        {
-          "alias": "",
-          "colorMode": null,
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "dateFormat": "YYYY-MM-DD HH:mm:ss",
-          "decimals": 2,
-          "mappingType": 1,
-          "pattern": "/.*/",
-          "thresholds": [],
-          "type": "hidden",
-          "unit": "short"
-        }
-      ],
-      "targets": [
-        {
-          "expr": "topk(10,\n  sum(\n    irate(ceph_rbd_write_latency_sum[30s]) / clamp_min(irate(ceph_rbd_write_latency_count[30s]), 1) +\n    irate(ceph_rbd_read_latency_sum[30s]) / clamp_min(irate(ceph_rbd_read_latency_count[30s]), 1)\n  ) by (pool, image, namespace)\n)",
-          "format": "table",
-          "instant": true,
-          "intervalFactor": 1,
-          "refId": "A"
-        }
-      ],
-      "title": "Highest Latency",
-      "transform": "table",
-      "type": "table"
-    }
-  ],
-  "refresh": "30s",
-  "schemaVersion": 16,
-  "style": "dark",
-  "tags": [
-    "overview"
-  ],
-  "templating": {
-    "list": [
       {
-        "current": {
-          "text": "default",
-          "value": "default"
-        },
-        "hide": 0,
-        "label": "Data Source",
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
+         "columns": [ ],
+         "datasource": "$datasource",
+         "description": "",
+         "gridPos": {
+            "h": 7,
+            "w": 8,
+            "x": 16,
+            "y": 7
+         },
+         "id": 7,
+         "sort": {
+            "col": 3,
+            "desc": true
+         },
+         "styles": [
+            {
+               "alias": "Pool",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "pool",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Image",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "image",
+               "thresholds": [ ],
+               "type": "string",
+               "unit": "short",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "Latency",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "Value",
+               "thresholds": [ ],
+               "type": "number",
+               "unit": "ns",
+               "valueMaps": [ ]
+            },
+            {
+               "alias": "",
+               "colorMode": null,
+               "colors": [
+                  "rgba(245, 54, 54, 0.9)",
+                  "rgba(237, 129, 40, 0.89)",
+                  "rgba(50, 172, 45, 0.97)"
+               ],
+               "dateFormat": "YYYY-MM-DD HH:mm:ss",
+               "decimals": 2,
+               "mappingType": 1,
+               "pattern": "/.*/",
+               "thresholds": [ ],
+               "type": "hidden",
+               "unit": "short",
+               "valueMaps": [ ]
+            }
+         ],
+         "targets": [
+            {
+               "expr": "topk(10,\n  sum(\n    irate(ceph_rbd_write_latency_sum[30s]) / clamp_min(irate(ceph_rbd_write_latency_count[30s]), 1) +\n    irate(ceph_rbd_read_latency_sum[30s]) / clamp_min(irate(ceph_rbd_read_latency_count[30s]), 1)\n  ) by (pool, image, namespace)\n)",
+               "format": "table",
+               "intervalFactor": 1,
+               "legendFormat": "",
+               "refId": "A"
+            }
+         ],
+         "timeFrom": null,
+         "timeShift": null,
+         "title": "Highest Latency",
+         "transform": "table",
+         "type": "table"
       }
-    ]
-  },
-  "time": {
-    "from": "now-1h",
-    "to": "now"
-  },
-  "timepicker": {
-    "refresh_intervals": [
-      "5s",
-      "10s",
-      "15s",
-      "30s",
-      "1m",
-      "5m",
-      "15m",
-      "30m",
-      "1h",
-      "2h",
-      "1d"
-    ],
-    "time_options": [
-      "5m",
-      "15m",
-      "1h",
-      "6h",
-      "12h",
-      "24h",
-      "2d",
-      "7d",
-      "30d"
-    ]
-  },
-  "timezone": "",
-  "title": "RBD Overview",
-  "uid": "41FrpeUiz",
-  "version": 8
+   ],
+   "refresh": "30s",
+   "rows": [ ],
+   "schemaVersion": 16,
+   "style": "dark",
+   "tags": [
+      "overview"
+   ],
+   "templating": {
+      "list": [
+         {
+            "current": {
+               "text": "default",
+               "value": "default"
+            },
+            "hide": 0,
+            "label": "Data Source",
+            "name": "datasource",
+            "options": [ ],
+            "query": "prometheus",
+            "refresh": 1,
+            "regex": "",
+            "type": "datasource"
+         }
+      ]
+   },
+   "time": {
+      "from": "now-1h",
+      "to": "now"
+   },
+   "timepicker": {
+      "refresh_intervals": [
+         "5s",
+         "10s",
+         "15s",
+         "30s",
+         "1m",
+         "5m",
+         "15m",
+         "30m",
+         "1h",
+         "2h",
+         "1d"
+      ],
+      "time_options": [
+         "5m",
+         "15m",
+         "1h",
+         "6h",
+         "12h",
+         "24h",
+         "2d",
+         "7d",
+         "30d"
+      ]
+   },
+   "timezone": "",
+   "title": "RBD Overview",
+   "uid": "41FrpeUiz",
+   "version": 0
 }
index d4a0b8209e8aa5c21782008983d31da5b202b4b1..71fc864cddf7db4db38327eb199cf22fcb13eb5c 100644 (file)
@@ -233,7 +233,7 @@ groups:
             rate of the past 48 hours.
 
       - alert: MTU Mismatch
-        expr: node_network_mtu_bytes{device!="lo"} != on() group_left() (quantile(0.5, node_network_mtu_bytes{device!="lo"}))
+        expr: node_network_mtu_bytes{device!="lo"} * (node_network_up{device!="lo"} > 0) != on() group_left() (quantile(0.5, node_network_mtu_bytes{device!="lo"}))
         labels:
           severity: warning
           type: ceph_default
index 8bc35aa2643aeb2277852aa525764feff184bb8e..913c207339b1c7d73d250efd61617dae096310ca 100644 (file)
@@ -680,13 +680,27 @@ tests:
     - series: 'node_network_mtu_bytes{device="eth4",instance="node-exporter",
       job="node-exporter"}'
       values: '9000 9000 9000 9000 9000'
+    - series: 'node_network_up{device="eth0",instance="node-exporter",
+      job="node-exporter"}'
+      values: '0 0 0 0 0'
+    - series: 'node_network_up{device="eth1",instance="node-exporter",
+      job="node-exporter"}'
+      values: '0 0 0 0 0'
+    - series: 'node_network_up{device="eth2",instance="node-exporter",
+      job="node-exporter"}'
+      values: '1 1 1 1 1'
+    - series: 'node_network_up{device="eth3",instance="node-exporter",
+      job="node-exporter"}'
+      values: '0 0 0 0 0'
+    - series: 'node_network_up{device="eth4",instance="node-exporter",
+      job="node-exporter"}'
+      values: '1 1 1 1 1'  
    promql_expr_test:
-     - expr: node_network_mtu_bytes{device!="lo"} != on() group_left()
+     - expr: node_network_mtu_bytes{device!="lo"} * (node_network_up{device!="lo"} > 0) != on() group_left()
              (quantile(0.5, node_network_mtu_bytes{device!="lo"}))
        eval_time: 1m
        exp_samples:
-         - labels: '{__name__="node_network_mtu_bytes", device="eth4",
-           instance="node-exporter", job="node-exporter"}'
+         - labels: '{device="eth4", instance="node-exporter", job="node-exporter"}'
            value: 9000
    alert_rule_test:
      - eval_time: 1m
diff --git a/ceph/qa/cephfs/overrides/frag.yaml b/ceph/qa/cephfs/overrides/frag.yaml
new file mode 100644 (file)
index 0000000..f05b3f4
--- /dev/null
@@ -0,0 +1,9 @@
+overrides:
+  ceph:
+    conf:
+      mds:
+        mds bal fragment size max: 10000
+        mds bal merge size: 5
+        mds bal split bits: 3
+        mds bal split size: 100
+
diff --git a/ceph/qa/cephfs/overrides/frag_enable.yaml b/ceph/qa/cephfs/overrides/frag_enable.yaml
deleted file mode 100644 (file)
index f1ccc1c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-overrides:
-  ceph:
-    conf:
-      mds:
-        mds bal frag: true
-        mds bal fragment size max: 10000
-        mds bal split size: 100
-        mds bal merge size: 5
-        mds bal split bits: 3
diff --git a/ceph/qa/distros/podman/centos_8.stream_container_tools.yaml b/ceph/qa/distros/podman/centos_8.stream_container_tools.yaml
new file mode 100644 (file)
index 0000000..4a9578e
--- /dev/null
@@ -0,0 +1,14 @@
+os_type: centos
+os_version: "8.stream"
+overrides:
+  selinux:
+    whitelist:
+      - scontext=system_u:system_r:logrotate_t:s0
+
+tasks:
+- pexec:
+    all:
+    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
+    - sudo dnf -y  module reset container-tools
+    - sudo dnf -y  module install container-tools
+    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/rhel_8.3_kubic_stable.yaml b/ceph/qa/distros/podman/rhel_8.3_kubic_stable.yaml
deleted file mode 100644 (file)
index 4e50abc..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-os_type: rhel
-os_version: "8.3"
-overrides:
-  selinux:
-    whitelist:
-      - scontext=system_u:system_r:logrotate_t:s0
-
-tasks:
-- pexec:
-    all:
-    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
-    - sudo dnf -y module disable container-tools
-    - sudo dnf -y install 'dnf-command(copr)'
-    - sudo dnf -y copr enable rhcontainerbot/container-selinux
-    - sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_8/devel:kubic:libcontainers:stable.repo
-    - sudo dnf remove -y podman
-    - sudo dnf -y install podman
-    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/rhel_8.4_container_tools_3.0.yaml b/ceph/qa/distros/podman/rhel_8.4_container_tools_3.0.yaml
new file mode 100644 (file)
index 0000000..a01eec9
--- /dev/null
@@ -0,0 +1,13 @@
+os_type: rhel
+os_version: "8.4"
+overrides:
+  selinux:
+    whitelist:
+      - scontext=system_u:system_r:logrotate_t:s0
+tasks:
+- pexec:
+    all:
+    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
+    - sudo dnf -y  module reset container-tools
+    - sudo dnf -y  module install container-tools:3.0
+    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/rhel_8.4_container_tools_rhel8.yaml b/ceph/qa/distros/podman/rhel_8.4_container_tools_rhel8.yaml
new file mode 100644 (file)
index 0000000..fdce9e8
--- /dev/null
@@ -0,0 +1,13 @@
+os_type: rhel
+os_version: "8.4"
+overrides:
+  selinux:
+    whitelist:
+      - scontext=system_u:system_r:logrotate_t:s0
+tasks:
+- pexec:
+    all:
+    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
+    - sudo dnf -y  module reset container-tools
+    - sudo dnf -y  module install container-tools:rhel8
+    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/ubuntu_18.04_kubic_stable.yaml b/ceph/qa/distros/podman/ubuntu_18.04_kubic_stable.yaml
deleted file mode 100644 (file)
index 1055bcc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-os_type: ubuntu
-os_version: "18.04"
-
-# feel free to remove this test, if Kubic project is no longer maintained.
-tasks:
-- pexec:
-    all:
-    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
-    - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/Release.key | sudo apt-key add -
-    - echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
-    - sudo apt update
-    - sudo apt -y install podman
-    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/ubuntu_20.04_kubic_stable.yaml b/ceph/qa/distros/podman/ubuntu_20.04_kubic_stable.yaml
deleted file mode 100644 (file)
index 3a04f50..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-os_type: ubuntu
-os_version: "20.04"
-
-# feel free to remove this test, if Kubic project is no longer maintained.
-tasks:
-- pexec:
-    all:
-    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
-    - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key | sudo apt-key add -
-    - echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
-    - sudo apt update
-    - sudo apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install podman containernetworking-plugins
-    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
diff --git a/ceph/qa/distros/podman/ubuntu_20.04_kubic_testing.yaml b/ceph/qa/distros/podman/ubuntu_20.04_kubic_testing.yaml
deleted file mode 100644 (file)
index 56b4d1e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-os_type: ubuntu
-os_version: "20.04"
-
-# feel free to remove this test, if Kubic project is no longer maintained.
-tasks:
-- pexec:
-    all:
-    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
-    - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/testing/xUbuntu_20.04/Release.key | sudo apt-key add -
-    - echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/testing/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:testing.list
-    - sudo apt update
-    - sudo apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install podman containernetworking-plugins
-    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
index e000134a8c5287ca3ba2d3645e9c9615f53b4a0b..63400a1d0a7356167170a0721bfb144f77d6bb24 100755 (executable)
@@ -4673,8 +4673,6 @@ EOF
           "primary": false
         },
         {
-          "data_digest": "0x00000000",
-          "omap_digest": "0xffffffff",
           "object_info": {
             "oid": {
               "oid": "EOBJ5",
@@ -4711,6 +4709,7 @@ EOF
           },
           "size": 4096,
           "errors": [
+            "read_error",
             "size_mismatch_info",
             "obj_size_info_mismatch"
           ],
@@ -4763,6 +4762,7 @@ EOF
         "watchers": {}
       },
       "union_shard_errors": [
+        "read_error",
         "size_mismatch_info",
         "obj_size_info_mismatch"
       ],
@@ -5441,8 +5441,8 @@ EOF
           "size": 4096,
           "shard": 0,
           "errors": [
+            "read_error",
             "size_mismatch_info",
-            "ec_size_error",
             "obj_size_info_mismatch"
           ],
           "osd": 1,
@@ -5493,8 +5493,8 @@ EOF
         "watchers": {}
       },
       "union_shard_errors": [
+        "read_error",
         "size_mismatch_info",
-        "ec_size_error",
         "obj_size_info_mismatch"
       ],
       "errors": [
diff --git a/ceph/qa/suites/fs/32bits/overrides/frag_enable.yaml b/ceph/qa/suites/fs/32bits/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/bugs/client_trim_caps/overrides/frag_enable.yaml b/ceph/qa/suites/fs/bugs/client_trim_caps/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/full/overrides/frag_enable.yaml b/ceph/qa/suites/fs/full/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/functional/overrides/frag_enable.yaml b/ceph/qa/suites/fs/functional/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/libcephfs/overrides/frag_enable.yaml b/ceph/qa/suites/fs/libcephfs/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/libcephfs/tasks/libcephfs.yaml b/ceph/qa/suites/fs/libcephfs/tasks/libcephfs.yaml
deleted file mode 100644 (file)
index 70afa2d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-overrides:
-  ceph:
-    conf:
-      client:
-        debug ms: 1
-        debug client: 20
-      mds:
-        debug ms: 1
-        debug mds: 20
-tasks:
-- check-counter:
-    counters:
-      mds:
-        - "mds.dir_split"
-- workunit:
-    clients:
-      client.0:
-        - libcephfs/test.sh
diff --git a/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/+ b/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/.qa b/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/frag.yaml b/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/frag.yaml
new file mode 120000 (symlink)
index 0000000..5e5cdae
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/frag.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/test.yaml b/ceph/qa/suites/fs/libcephfs/tasks/libcephfs/test.yaml
new file mode 100644 (file)
index 0000000..70afa2d
--- /dev/null
@@ -0,0 +1,18 @@
+overrides:
+  ceph:
+    conf:
+      client:
+        debug ms: 1
+        debug client: 20
+      mds:
+        debug ms: 1
+        debug mds: 20
+tasks:
+- check-counter:
+    counters:
+      mds:
+        - "mds.dir_split"
+- workunit:
+    clients:
+      client.0:
+        - libcephfs/test.sh
diff --git a/ceph/qa/suites/fs/mirror-ha/% b/ceph/qa/suites/fs/mirror-ha/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/mirror-ha/.qa b/ceph/qa/suites/fs/mirror-ha/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/begin.yaml b/ceph/qa/suites/fs/mirror-ha/begin.yaml
new file mode 120000 (symlink)
index 0000000..311d404
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/begin.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/cephfs-mirror/three-per-cluster.yaml b/ceph/qa/suites/fs/mirror-ha/cephfs-mirror/three-per-cluster.yaml
new file mode 100644 (file)
index 0000000..095f089
--- /dev/null
@@ -0,0 +1,12 @@
+meta:
+- desc: run one cephfs-mirror daemon on primary cluster
+tasks:
+- cephfs-mirror:
+    client: client.mirror1
+    run_in_foreground: True
+- cephfs-mirror:
+    client: client.mirror2
+    run_in_foreground: True
+- cephfs-mirror:
+    client: client.mirror3
+    run_in_foreground: True
diff --git a/ceph/qa/suites/fs/mirror-ha/clients/+ b/ceph/qa/suites/fs/mirror-ha/clients/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/mirror-ha/clients/.qa b/ceph/qa/suites/fs/mirror-ha/clients/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/clients/mirror.yaml b/ceph/qa/suites/fs/mirror-ha/clients/mirror.yaml
new file mode 100644 (file)
index 0000000..620c821
--- /dev/null
@@ -0,0 +1,32 @@
+meta:
+- desc: configure the permissions for client.mirror
+overrides:
+  ceph:
+    conf:
+      client:
+        debug cephfs_mirror: 20
+        log to stderr: false
+      # make these predictable
+      client.mirror1:
+        admin socket: /var/run/ceph/cephfs-mirror1.asok
+        pid file: /var/run/ceph/cephfs-mirror1.pid
+      client.mirror2:
+        admin socket: /var/run/ceph/cephfs-mirror2.asok
+        pid file: /var/run/ceph/cephfs-mirror2.pid
+      client.mirror3:
+        admin socket: /var/run/ceph/cephfs-mirror3.asok
+        pid file: /var/run/ceph/cephfs-mirror3.pid
+tasks:
+- exec:
+    client.mirror1:
+      - "sudo ceph auth caps client.mirror1 mon 'profile cephfs-mirror' mds 'allow r' osd 'allow rw tag cephfs metadata=*, allow r tag cephfs data=*' mgr 'allow r'"
+    client.mirror2:
+      - "sudo ceph auth caps client.mirror2 mon 'profile cephfs-mirror' mds 'allow r' osd 'allow rw tag cephfs metadata=*, allow r tag cephfs data=*' mgr 'allow r'"
+    client.mirror3:
+      - "sudo ceph auth caps client.mirror3 mon 'profile cephfs-mirror' mds 'allow r' osd 'allow rw tag cephfs metadata=*, allow r tag cephfs data=*' mgr 'allow r'"
+    client.mirror_remote:
+      - "sudo ceph auth caps client.mirror_remote mon 'allow r' mds 'allow rwps' osd 'allow rw tag cephfs *=*' mgr 'allow r'"
+    client.1:
+      - "sudo ceph auth caps client.0 mon 'allow r' mds 'allow rwps' osd 'allow rw tag cephfs *=*' mgr 'allow r'"
+    client.2:
+      - "sudo ceph auth caps client.1 mon 'allow r' mds 'allow rwps' osd 'allow rw tag cephfs *=*' mgr 'allow r'"
diff --git a/ceph/qa/suites/fs/mirror-ha/cluster/+ b/ceph/qa/suites/fs/mirror-ha/cluster/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/mirror-ha/cluster/1-node.yaml b/ceph/qa/suites/fs/mirror-ha/cluster/1-node.yaml
new file mode 100644 (file)
index 0000000..cc70c10
--- /dev/null
@@ -0,0 +1,20 @@
+meta:
+- desc: 1 ceph cluster with 1 mon, 1 mgr, 3 osds, 5 mdss
+roles:
+- - mon.a
+  - mgr.x
+  - mds.a
+  - mds.b
+  - mds.c
+  - mds.d
+  - mds.e
+  - osd.0
+  - osd.1
+  - osd.2
+  - client.0
+  - client.1
+  - client.2
+  - client.mirror1
+  - client.mirror2
+  - client.mirror3
+  - client.mirror_remote
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/objectstore/.qa b/ceph/qa/suites/fs/mirror-ha/objectstore/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/objectstore/bluestore-bitmap.yaml b/ceph/qa/suites/fs/mirror-ha/objectstore/bluestore-bitmap.yaml
new file mode 120000 (symlink)
index 0000000..a59cf51
--- /dev/null
@@ -0,0 +1 @@
+.qa/objectstore/bluestore-bitmap.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/overrides/+ b/ceph/qa/suites/fs/mirror-ha/overrides/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/mirror-ha/overrides/.qa b/ceph/qa/suites/fs/mirror-ha/overrides/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/overrides/whitelist_health.yaml b/ceph/qa/suites/fs/mirror-ha/overrides/whitelist_health.yaml
new file mode 100644 (file)
index 0000000..d40fa4c
--- /dev/null
@@ -0,0 +1,14 @@
+overrides:
+  ceph:
+    log-ignorelist:
+      - overall HEALTH_
+      - \(FS_DEGRADED\)
+      - \(MDS_FAILED\)
+      - \(MDS_DEGRADED\)
+      - \(FS_WITH_FAILED_MDS\)
+      - \(MDS_DAMAGE\)
+      - \(MDS_ALL_DOWN\)
+      - \(MDS_UP_LESS_THAN_MAX\)
+      - \(FS_INLINE_DATA_DEPRECATED\)
+      - Reduced data availability
+      - Degraded data redundancy
diff --git a/ceph/qa/suites/fs/mirror-ha/supported-random-distro$ b/ceph/qa/suites/fs/mirror-ha/supported-random-distro$
new file mode 120000 (symlink)
index 0000000..0862b44
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/supported-random-distro$
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/workloads/.qa b/ceph/qa/suites/fs/mirror-ha/workloads/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/mirror-ha/workloads/cephfs-mirror-ha-workunit.yaml b/ceph/qa/suites/fs/mirror-ha/workloads/cephfs-mirror-ha-workunit.yaml
new file mode 100644 (file)
index 0000000..18eb46d
--- /dev/null
@@ -0,0 +1,37 @@
+meta:
+- desc: run the cephfs_mirror_ha.sh workunit to test cephfs-mirror daemon in HA active/active mode
+
+overrides:
+  ceph:
+    conf:
+      mgr:
+        debug client: 10
+
+tasks:
+  - exec:
+      client.1:
+        - "ceph fs volume create dc"
+        - "ceph fs volume create dc-backup"
+  - ceph-fuse:
+      client.1:
+        cephfs_name: dc
+      client.2:
+        cephfs_name: dc-backup
+  - cephfs_mirror_thrash:
+      randomize: False
+      max_thrash_delay: 10
+  - workunit:
+      subdir: mirror
+      cleanup: False
+      clients:
+        client.1: [fs/cephfs_mirror_ha_gen.sh]
+      timeout: 1h
+  - exec:
+      client.2:
+        - "echo verifying synchronized snapshots..."
+  - workunit:
+      subdir: mirror
+      cleanup: False
+      clients:
+        client.2: [fs/cephfs_mirror_ha_verify.sh]
+      timeout: 3h
\ No newline at end of file
index af60495e53f8b9b05cc1efe1eafe969b3b23aaa7..07c1e24efbf8e766d5f4b5a809fafd1c8f17ad2c 100644 (file)
@@ -7,4 +7,4 @@ overrides:
 tasks:
   - cephfs_test_runner:
       modules:
-        - tasks.cephfs.test_mirroring
+        - tasks.cephfs.test_mirroring.TestMirroring
diff --git a/ceph/qa/suites/fs/mixed-clients/overrides/frag_enable.yaml b/ceph/qa/suites/fs/mixed-clients/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/multiclient/overrides/frag_enable.yaml b/ceph/qa/suites/fs/multiclient/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/multifs/overrides/frag_enable.yaml b/ceph/qa/suites/fs/multifs/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
index 4a95f01da9c73f02629d54b8493c8cdf506f5262..9c403c76db6c8b48f49e8977bbd7f52285b72c10 100644 (file)
@@ -5,6 +5,8 @@ overrides:
       - \(MDS_INSUFFICIENT_STANDBY\)
       - \(MDS_ALL_DOWN\)
       - \(MDS_UP_LESS_THAN_MAX\)
+      - \(MDS_DAMAGE\)
+      - \(FS_DEGRADED\)
   ceph-fuse:
     disabled: true
 tasks:
diff --git a/ceph/qa/suites/fs/permission/overrides/frag_enable.yaml b/ceph/qa/suites/fs/permission/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/shell/overrides/frag_enable.yaml b/ceph/qa/suites/fs/shell/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/snaps/overrides/frag_enable.yaml b/ceph/qa/suites/fs/snaps/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/thrash/multifs/overrides/frag.yaml b/ceph/qa/suites/fs/thrash/multifs/overrides/frag.yaml
new file mode 120000 (symlink)
index 0000000..5e5cdae
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/frag.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/thrash/multifs/overrides/frag_enable.yaml b/ceph/qa/suites/fs/thrash/multifs/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/thrash/workloads/overrides/frag.yaml b/ceph/qa/suites/fs/thrash/workloads/overrides/frag.yaml
new file mode 120000 (symlink)
index 0000000..5e5cdae
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/frag.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/thrash/workloads/overrides/frag_enable.yaml b/ceph/qa/suites/fs/thrash/workloads/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/traceless/overrides/frag.yaml b/ceph/qa/suites/fs/traceless/overrides/frag.yaml
new file mode 120000 (symlink)
index 0000000..5e5cdae
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/frag.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/traceless/overrides/frag_enable.yaml b/ceph/qa/suites/fs/traceless/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/featureful_client/old_client/overrides/frag_enable.yaml b/ceph/qa/suites/fs/upgrade/featureful_client/old_client/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/featureful_client/upgraded_client/overrides/frag_enable.yaml b/ceph/qa/suites/fs/upgrade/featureful_client/upgraded_client/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/% b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/bluestore-bitmap.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/bluestore-bitmap.yaml
new file mode 120000 (symlink)
index 0000000..fb603bc
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/objectstore-ec/bluestore-bitmap.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/centos_8.stream_container_tools.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/centos_8.stream_container_tools.yaml
new file mode 120000 (symlink)
index 0000000..7a86f96
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/conf b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/conf
new file mode 120000 (symlink)
index 0000000..6d47129
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/conf/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/% b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/pg-warn.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/pg-warn.yaml
new file mode 100644 (file)
index 0000000..4ae54a4
--- /dev/null
@@ -0,0 +1,5 @@
+overrides:
+  ceph:
+    conf:
+      global:
+        mon pg warn min per osd: 0
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_health.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_health.yaml
new file mode 120000 (symlink)
index 0000000..74f39a4
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/whitelist_health.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_wrongly_marked_down.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/overrides/whitelist_wrongly_marked_down.yaml
new file mode 120000 (symlink)
index 0000000..b4528c0
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/whitelist_wrongly_marked_down.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/roles.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/roles.yaml
new file mode 100644 (file)
index 0000000..bce4ecd
--- /dev/null
@@ -0,0 +1,11 @@
+roles:
+- - host.a
+  - client.0
+  - osd.0
+  - osd.1
+  - osd.2
+- - host.b
+  - client.1
+  - osd.3
+  - osd.4
+  - osd.5
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/% b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/v16.2.4.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/0-from/v16.2.4.yaml
new file mode 100644 (file)
index 0000000..47166a9
--- /dev/null
@@ -0,0 +1,30 @@
+meta:
+- desc: |
+   setup ceph/pacific v16.2.4
+
+tasks:
+# Disable metrics sending by kclient as it may crash (assert) a v16.2.4 MDS
+- pexec:
+    clients:
+      - sudo modprobe -r ceph
+      - sudo modprobe ceph disable_send_metrics=on
+- install:
+    tag: v16.2.4
+    exclude_packages:
+      - ceph-volume
+- print: "**** done install task..."
+- cephadm:
+    roleless: true
+    image: docker.io/ceph/ceph:v16.2.4
+    cephadm_branch: v16.2.4
+    cephadm_git_url: https://github.com/ceph/ceph
+    # needed for v16.2.4 due to --skip-admin-label
+    avoid_pacific_features: true
+- print: "**** done starting v16.2.4"
+- cephadm.shell:
+    host.a:
+      - ceph orch status
+      - ceph orch ps
+      - ceph orch ls
+      - ceph orch host ls
+      - ceph orch device ls
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/% b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/0-create.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/0-create.yaml
new file mode 100644 (file)
index 0000000..5ee0022
--- /dev/null
@@ -0,0 +1,5 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs volume create cephfs --placement=4
+      - ceph fs dump
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/1.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/1.yaml
new file mode 100644 (file)
index 0000000..8c1cd2f
--- /dev/null
@@ -0,0 +1,4 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs set cephfs max_mds 1
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/2.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/1-ranks/2.yaml
new file mode 100644 (file)
index 0000000..fcd3b1e
--- /dev/null
@@ -0,0 +1,4 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs set cephfs max_mds 2
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/.qa b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/.qa
new file mode 120000 (symlink)
index 0000000..a602a03
--- /dev/null
@@ -0,0 +1 @@
+../.qa/
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/no.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/no.yaml
new file mode 100644 (file)
index 0000000..3dbc810
--- /dev/null
@@ -0,0 +1,4 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs set cephfs allow_standby_replay false
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/yes.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/2-allow_standby_replay/yes.yaml
new file mode 100644 (file)
index 0000000..fb89442
--- /dev/null
@@ -0,0 +1,4 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs set cephfs allow_standby_replay true
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/3-verify.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/1-volume/3-verify.yaml
new file mode 100644 (file)
index 0000000..ec2a2a5
--- /dev/null
@@ -0,0 +1,7 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs dump
+      - ceph --format=json fs dump | jq -e ".filesystems | length == 1"
+      - ceph --format=json mds versions | jq -e ". | add == 4"
+- fs.pre_upgrade_save:
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/2-client.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/2-client.yaml
new file mode 100644 (file)
index 0000000..92b9dda
--- /dev/null
@@ -0,0 +1,3 @@
+tasks:
+- kclient:
+- print: "**** done client"
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/3-upgrade-with-workload.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/3-upgrade-with-workload.yaml
new file mode 100644 (file)
index 0000000..200c4dc
--- /dev/null
@@ -0,0 +1,33 @@
+tasks:
+- parallel:
+  - upgrade-tasks
+  - workload-tasks
+
+upgrade-tasks:
+  sequential:
+  - cephadm.shell:
+      env: [sha1]
+      host.a:
+        - ceph config set mon mon_warn_on_insecure_global_id_reclaim false --force
+        - ceph config set mon mon_warn_on_insecure_global_id_reclaim_allowed false --force
+        - ceph config set global log_to_journald false --force
+        - ceph orch upgrade start --image quay.ceph.io/ceph-ci/ceph:$sha1
+  - cephadm.shell:
+      env: [sha1]
+      host.a:
+        - while ceph orch upgrade status | jq '.in_progress' | grep true ; do ceph orch ps ; ceph versions ; ceph fs dump; sleep 30 ; done
+        - ceph orch ps
+        - ceph versions
+        - echo "wait for servicemap items w/ changing names to refresh"
+        - sleep 60
+        - ceph orch ps
+        - ceph versions
+        - ceph versions | jq -e '.overall | length == 1'
+        - ceph versions | jq -e '.overall | keys' | grep $sha1
+
+workload-tasks:
+  sequential:
+  - workunit:
+      clients:
+        all:
+          - suites/fsstress.sh
diff --git a/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/4-verify.yaml b/ceph/qa/suites/fs/upgrade/mds_upgrade_sequence/tasks/4-verify.yaml
new file mode 100644 (file)
index 0000000..c2b657e
--- /dev/null
@@ -0,0 +1,5 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph fs dump
+- fs.post_upgrade_checks:
diff --git a/ceph/qa/suites/fs/upgrade/volumes/import-legacy/overrides/frag_enable.yaml b/ceph/qa/suites/fs/upgrade/volumes/import-legacy/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
index af60495e53f8b9b05cc1efe1eafe969b3b23aaa7..07c1e24efbf8e766d5f4b5a809fafd1c8f17ad2c 100644 (file)
@@ -7,4 +7,4 @@ overrides:
 tasks:
   - cephfs_test_runner:
       modules:
-        - tasks.cephfs.test_mirroring
+        - tasks.cephfs.test_mirroring.TestMirroring
diff --git a/ceph/qa/suites/fs/verify/overrides/frag_enable.yaml b/ceph/qa/suites/fs/verify/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/volumes/overrides/frag_enable.yaml b/ceph/qa/suites/fs/volumes/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/workload/overrides/frag.yaml b/ceph/qa/suites/fs/workload/overrides/frag.yaml
new file mode 120000 (symlink)
index 0000000..5e5cdae
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/overrides/frag.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/fs/workload/overrides/frag_enable.yaml b/ceph/qa/suites/fs/workload/overrides/frag_enable.yaml
deleted file mode 120000 (symlink)
index 34a39a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/cephfs/overrides/frag_enable.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.2_container_tools_3.0.yaml b/ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.2_container_tools_3.0.yaml
deleted file mode 120000 (symlink)
index d1965f3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/distros/podman/centos_8.2_container_tools_3.0.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.3_container_tools_3.0.yaml b/ceph/qa/suites/orch/cephadm/dashboard/0-distro/centos_8.3_container_tools_3.0.yaml
new file mode 120000 (symlink)
index 0000000..479a5c2
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.3_container_tools_3.0.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mds_upgrade_sequence b/ceph/qa/suites/orch/cephadm/mds_upgrade_sequence
new file mode 120000 (symlink)
index 0000000..24aa41c
--- /dev/null
@@ -0,0 +1 @@
+.qa/suites/fs/upgrade/mds_upgrade_sequence/
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/% b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/.qa b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/.qa b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.3_container_tools_3.0.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.3_container_tools_3.0.yaml
new file mode 120000 (symlink)
index 0000000..479a5c2
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.3_container_tools_3.0.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.stream_container_tools.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/0-distro/centos_8.stream_container_tools.yaml
new file mode 120000 (symlink)
index 0000000..7a86f96
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.4.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.4.yaml
new file mode 100644 (file)
index 0000000..991562b
--- /dev/null
@@ -0,0 +1,8 @@
+tasks:
+- cephadm:
+    roleless: true
+    image: docker.io/ceph/ceph:v16.2.4
+    cephadm_branch: v16.2.4
+    cephadm_git_url: https://github.com/ceph/ceph
+    # needed for v16.2.4 due to --skip-admin-label
+    avoid_pacific_features: true
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.5.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/16.2.5.yaml
new file mode 100644 (file)
index 0000000..2568f23
--- /dev/null
@@ -0,0 +1,6 @@
+tasks:
+- cephadm:
+    roleless: true
+    image: docker.io/ceph/ceph:v16.2.5
+    cephadm_branch: v16.2.5
+    cephadm_git_url: https://github.com/ceph/ceph
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/octopus.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-bootstrap/octopus.yaml
new file mode 100644 (file)
index 0000000..16670e7
--- /dev/null
@@ -0,0 +1,8 @@
+tasks:
+- cephadm:
+    roleless: true
+    image: docker.io/ceph/ceph:v15
+    cephadm_branch: octopus
+    cephadm_git_url: https://github.com/ceph/ceph
+    avoid_pacific_features: true
+    add_mons_via_daemon_add: true
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-start.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/1-start.yaml
new file mode 100644 (file)
index 0000000..2d9f09a
--- /dev/null
@@ -0,0 +1,29 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - ceph orch status
+      - ceph orch ps
+      - ceph orch ls
+      - ceph orch host ls
+      - ceph orch device ls
+roles:
+- - host.a
+  - osd.0
+  - osd.1
+  - osd.2
+  - osd.3
+  - client.0
+- - host.b
+  - osd.4
+  - osd.5
+  - osd.6
+  - osd.7
+openstack:
+- volumes: # attached to each instance
+    count: 4
+    size: 10 # GB
+overrides:
+  ceph:
+    conf:
+      osd:
+        osd shutdown pgref assert: true
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/2-nfs.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/2-nfs.yaml
new file mode 100644 (file)
index 0000000..34680fc
--- /dev/null
@@ -0,0 +1,29 @@
+tasks:
+
+# stop kernel nfs server, if running
+- vip.exec:
+    all-hosts:
+      - systemctl stop nfs-server
+
+- cephadm.shell:
+    host.a:
+      - ceph fs volume create foofs
+
+- cephadm.wait_for_service:
+    service: mds.foofs
+
+- cephadm.shell:
+    host.a:
+      - ceph nfs cluster create foo --placement=2 || ceph nfs cluster create cephfs foo --placement=2
+      - ceph nfs export create cephfs --fsname foofs --clusterid foo --binding /fake || ceph nfs export create cephfs --fsname foofs --cluster-id foo --pseudo-path /fake 
+
+      # we can't do wait_for_service here because with octopus it's nfs.ganesha-foo not nfs.foo
+      - while ! ceph orch ls | grep nfs | grep 2/2 ; do sleep 1 ; done
+
+- vip.exec:
+    host.a:
+      - mkdir /mnt/foo
+      - while ! mount -t nfs $(hostname):/fake /mnt/foo -o sync ; do sleep 5 ; done
+      - echo test > /mnt/foo/testfile
+      - sync
+
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/3-upgrade-with-workload.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/3-upgrade-with-workload.yaml
new file mode 100644 (file)
index 0000000..6d10b35
--- /dev/null
@@ -0,0 +1,41 @@
+tasks:
+- parallel:
+  - upgrade-tasks
+  - workload-tasks
+
+upgrade-tasks:
+  sequential:
+  - cephadm.shell:
+      env: [sha1]
+      host.a:
+        - ceph config set mon mon_warn_on_insecure_global_id_reclaim false --force
+        - ceph config set mon mon_warn_on_insecure_global_id_reclaim_allowed false --force
+        - ceph config set global log_to_journald false --force
+        - ceph mgr module enable nfs --force
+        - ceph orch upgrade start --image quay.ceph.io/ceph-ci/ceph:$sha1
+  - cephadm.shell:
+      env: [sha1]
+      host.a:
+        - while ceph orch upgrade status | jq '.in_progress' | grep true ; do ceph orch ps ; ceph versions ; sleep 30 ; done
+        - ceph orch ps
+        - ceph versions
+        - echo "wait for servicemap items w/ changing names to refresh"
+        - sleep 60
+        - ceph orch ps
+        - ceph versions
+        - ceph versions | jq -e '.overall | length == 1'
+        - ceph versions | jq -e '.overall | keys' | grep $sha1
+
+  # this should be a no-op, but confirms nfs.ganesha-foo was remapped to nfs.foo
+  - cephadm.wait_for_service:
+      service: nfs.foo
+
+workload-tasks:
+  sequential:
+  - exec:
+      host.a:
+      - cd /mnt/foo && dbench 5 -t 600 || true   # might fail with ESTALE
+      # make sure mount works
+      - umount /mnt/foo
+      - while ! mount -t nfs $(hostname):/fake /mnt/foo ; do sleep 5 ; done
+      - cd /mnt/foo && dbench 5 -t 5
diff --git a/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/4-final.yaml b/ceph/qa/suites/orch/cephadm/mgr-nfs-upgrade/4-final.yaml
new file mode 100644 (file)
index 0000000..11e8bb3
--- /dev/null
@@ -0,0 +1,10 @@
+tasks:
+- vip.exec:
+    host.a:
+      - umount /mnt/foo
+- cephadm.shell:
+    host.a:
+      - ceph nfs cluster ls | grep foo
+      - ceph nfs export ls foo --detailed
+      - rados -p .nfs --all ls -
+      - ceph config get mgr mgr/cephadm/migration_current | grep 3
diff --git a/ceph/qa/suites/orch/cephadm/osds/2-ops/rm-zap-flag.yaml b/ceph/qa/suites/orch/cephadm/osds/2-ops/rm-zap-flag.yaml
new file mode 100644 (file)
index 0000000..8f07f6d
--- /dev/null
@@ -0,0 +1,15 @@
+tasks:
+- cephadm.shell:
+    host.a:
+      - |
+        set -e
+        set -x
+        ceph orch ps
+        ceph orch device ls
+        DEVID=$(ceph device ls | grep osd.1 | awk '{print $1}')
+        HOST=$(ceph orch device ls | grep "$DEVID" | awk '{print $1}')
+        DEV=$(ceph orch device ls | grep "$DEVID" | awk '{print $2}')
+        echo "host $HOST, dev $DEV, devid $DEVID"
+        ceph orch osd rm --zap --replace 1
+        while ceph orch osd rm status | grep ^1 ; do sleep 5 ; done
+        while ! ceph osd dump | grep osd.1 | grep "up\s*in" ; do sleep 5 ; done
diff --git a/ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-bucket.yaml b/ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-bucket.yaml
new file mode 100644 (file)
index 0000000..3f49649
--- /dev/null
@@ -0,0 +1,89 @@
+tasks:
+- vip:
+
+# make sure cephadm notices the new IP
+- cephadm.shell:
+    host.a:
+      - ceph orch device ls --refresh
+
+# stop kernel nfs server, if running
+- vip.exec:
+    all-hosts:
+      - systemctl stop nfs-server
+
+- cephadm.shell:
+    host.a:
+      - ceph orch apply rgw foorgw --port 8800
+      - ceph nfs cluster create foo --ingress --virtual-ip {{VIP0}}/{{VIPPREFIXLEN}}
+
+- vip.exec:
+    host.a:
+      - dnf install -y python3-boto3 || apt install -y python3-boto3
+      - /home/ubuntu/cephtest/cephadm shell radosgw-admin user create --uid foouser --display-name foo > /tmp/user.json
+
+- python:
+    host.a: |
+      import boto3
+      import json
+
+      with open('/tmp/user.json', 'rt') as f:
+          info = json.loads(f.read())
+      s3 = boto3.resource(
+          's3',
+          aws_access_key_id=info['keys'][0]['access_key'],
+          aws_secret_access_key=info['keys'][0]['secret_key'],
+          endpoint_url='http://localhost:8800',
+      )
+      bucket = s3.Bucket('foobucket')
+      bucket.create()
+      bucket.put_object(Key='myobject', Body='thebody')
+
+- cephadm.shell:
+    host.a:
+      - ceph nfs export create rgw --bucket foobucket --cluster-id foo --pseudo-path /foobucket 
+
+- cephadm.wait_for_service:
+    service: nfs.foo
+- cephadm.wait_for_service:
+    service: ingress.nfs.foo
+
+## export and mount
+
+- vip.exec:
+    host.a:
+      - mkdir /mnt/foo
+      - sleep 5
+      - mount -t nfs {{VIP0}}:/foobucket /mnt/foo
+      - find /mnt/foo -ls
+      - grep thebody /mnt/foo/myobject
+      - echo test > /mnt/foo/newobject
+      - sync
+
+- python:
+    host.a: |
+      import boto3
+      import json
+      from io import BytesIO
+
+      with open('/tmp/user.json', 'rt') as f:
+          info = json.loads(f.read())
+      s3 = boto3.resource(
+          's3',
+          aws_access_key_id=info['keys'][0]['access_key'],
+          aws_secret_access_key=info['keys'][0]['secret_key'],
+          endpoint_url='http://localhost:8800',
+      )
+      bucket = s3.Bucket('foobucket')
+      data = BytesIO()
+      bucket.download_fileobj(Fileobj=data, Key='newobject')
+      print(data.getvalue())
+      assert data.getvalue().decode() == 'test\n'
+
+- vip.exec:
+    host.a:
+      - umount /mnt/foo
+
+- cephadm.shell:
+    host.a:
+      - ceph nfs export rm foo /foobucket
+      - ceph nfs cluster rm foo
diff --git a/ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-user.yaml b/ceph/qa/suites/orch/cephadm/smoke-roleless/2-services/nfs-ingress-rgw-user.yaml
new file mode 100644 (file)
index 0000000..721aecf
--- /dev/null
@@ -0,0 +1,90 @@
+tasks:
+- vip:
+
+# make sure cephadm notices the new IP
+- cephadm.shell:
+    host.a:
+      - ceph orch device ls --refresh
+
+# stop kernel nfs server, if running
+- vip.exec:
+    all-hosts:
+      - systemctl stop nfs-server
+
+- cephadm.shell:
+    host.a:
+      - ceph orch apply rgw foorgw --port 8800
+      - ceph nfs cluster create foo --ingress --virtual-ip {{VIP0}}/{{VIPPREFIXLEN}}
+
+- vip.exec:
+    host.a:
+      - dnf install -y python3-boto3 || apt install -y python3-boto3
+      - /home/ubuntu/cephtest/cephadm shell radosgw-admin user create --uid foouser --display-name foo > /tmp/user.json
+
+- python:
+    host.a: |
+      import boto3
+      import json
+
+      with open('/tmp/user.json', 'rt') as f:
+          info = json.loads(f.read())
+      s3 = boto3.resource(
+          's3',
+          aws_access_key_id=info['keys'][0]['access_key'],
+          aws_secret_access_key=info['keys'][0]['secret_key'],
+          endpoint_url='http://localhost:8800',
+      )
+      bucket = s3.Bucket('foobucket')
+      bucket.create()
+      bucket.put_object(Key='myobject', Body='thebody')
+
+- cephadm.shell:
+    host.a:
+      - ceph nfs export create rgw --cluster-id foo --pseudo-path /foouser --user-id foouser
+
+- cephadm.wait_for_service:
+    service: nfs.foo
+- cephadm.wait_for_service:
+    service: ingress.nfs.foo
+
+## export and mount
+
+- vip.exec:
+    host.a:
+      - mkdir /mnt/foo
+      - sleep 5
+      - mount -t nfs {{VIP0}}:/foouser /mnt/foo
+      - test -d /mnt/foo/foobucket
+      - find /mnt/foo -ls
+      - grep thebody /mnt/foo/foobucket/myobject
+      - echo test > /mnt/foo/foobucket/newobject
+      - sync
+
+- python:
+    host.a: |
+      import boto3
+      import json
+      from io import BytesIO
+
+      with open('/tmp/user.json', 'rt') as f:
+          info = json.loads(f.read())
+      s3 = boto3.resource(
+          's3',
+          aws_access_key_id=info['keys'][0]['access_key'],
+          aws_secret_access_key=info['keys'][0]['secret_key'],
+          endpoint_url='http://localhost:8800',
+      )
+      bucket = s3.Bucket('foobucket')
+      data = BytesIO()
+      bucket.download_fileobj(Fileobj=data, Key='newobject')
+      print(data.getvalue())
+      assert data.getvalue().decode() == 'test\n'
+
+- vip.exec:
+    host.a:
+      - umount /mnt/foo
+
+- cephadm.shell:
+    host.a:
+      - ceph nfs export rm foo /foouser
+      - ceph nfs cluster rm foo
index 3e5ad1a2ecbdbccaf397875af80b0e912acf0875..b4e843df2611623ed7a13e52abb6a9f4e79fa703 100644 (file)
@@ -40,7 +40,7 @@ tasks:
 
 - cephadm.shell:
     host.a:
-      - ceph nfs export create cephfs foofs foo --binding /fake
+      - ceph nfs export create cephfs --fsname foofs --cluster-id foo --pseudo-path /fake
 
 - vip.exec:
     host.a:
index 09fb3c7684bf476306efabb2ee108c45ac7cf33b..a47dd9d7646bd54775d713b916381c425c30971f 100644 (file)
@@ -14,8 +14,8 @@ tasks:
 - cephadm.shell:
     host.a:
       - ceph fs volume create foofs
-      - ceph nfs cluster create foo --ingress --virtual-ip {{VIP0}}/{{VIPPREFIXLEN}}
-      - ceph nfs export create cephfs foofs foo --binding /fake
+      - ceph nfs cluster create foo --ingress --virtual-ip {{VIP0}}/{{VIPPREFIXLEN}} --port 2999
+      - ceph nfs export create cephfs --fsname foofs --cluster-id foo --pseudo-path /fake
 
 - cephadm.wait_for_service:
     service: nfs.foo
@@ -28,7 +28,7 @@ tasks:
     host.a:
       - mkdir /mnt/foo
       - sleep 5
-      - mount -t nfs {{VIP0}}:/fake /mnt/foo
+      - mount -t nfs {{VIP0}}:/fake /mnt/foo -o port=2999
       - echo test > /mnt/foo/testfile
       - sync
 
@@ -48,3 +48,23 @@ tasks:
           ceph orch daemon start $haproxy
           while ! ceph orch ps | grep $haproxy | grep running; do sleep 1 ; done
         done
+
+# take each ganesha down in turn.
+# simulate "failure" by deleting the container
+- vip.exec:
+    all-hosts:
+      - |
+        echo "Check with $(hostname) ganesha(s) down..."
+        for c in `systemctl | grep ceph- | grep @nfs | awk '{print $1}'`; do
+            cid=`echo $c | sed 's/@/-/'`
+            id=`echo $c | cut -d @ -f 2 | sed 's/.service$//'`
+            fsid=`echo $c | cut -d @ -f 1 | cut -d - -f 2-`
+            echo "Removing daemon $id fsid $fsid..."
+            sudo $TESTDIR/cephadm rm-daemon --fsid $fsid --name $id
+
+            echo "Waking up cephadm..."
+            sudo $TESTDIR/cephadm shell -- ceph orch ps --refresh
+
+            while ! timeout 1 cat /mnt/foo/testfile ; do true ; done
+            echo "Mount is back!"
+        done
diff --git a/ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.2_container_tools_3.0.yaml b/ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.2_container_tools_3.0.yaml
new file mode 120000 (symlink)
index 0000000..d1965f3
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.2_container_tools_3.0.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.stream_container_tools.yaml b/ceph/qa/suites/orch/cephadm/smoke/distro/centos_8.stream_container_tools.yaml
new file mode 120000 (symlink)
index 0000000..7a86f96
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_3.0.yaml b/ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_3.0.yaml
new file mode 120000 (symlink)
index 0000000..9e1ab9a
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/rhel_8.4_container_tools_3.0.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_rhel8.yaml b/ceph/qa/suites/orch/cephadm/smoke/distro/rhel_8.4_container_tools_rhel8.yaml
new file mode 120000 (symlink)
index 0000000..b4b0a78
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/rhel_8.4_container_tools_rhel8.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.3-octopus.yaml b/ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.3-octopus.yaml
deleted file mode 100644 (file)
index 2e551dd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-os_type: centos
-os_version: "8.3"
-overrides:
-  selinux:
-    whitelist:
-      - scontext=system_u:system_r:logrotate_t:s0
-
-tasks:
-- cephadm:
-    image: quay.ceph.io/ceph-ci/ceph:octopus
-    cephadm_branch: octopus
-    cephadm_git_url: https://github.com/ceph/ceph
-    # avoid --cap-add=PTRACE + --privileged for older cephadm versions
-    allow_ptrace: false
-    # deploy additional mons the "old" (octopus) way
-    add_mons_via_daemon_add: true
-    avoid_pacific_features: true
-
-
-roles:
-- - mon.a
-  - mon.c
-  - mgr.y
-  - osd.0
-  - osd.1
-  - osd.2
-  - osd.3
-  - client.0
-#  - ceph.rgw.realm.zone.a  # CLI change in v16 pacific
-  - node-exporter.a
-  - alertmanager.a
-- - mon.b
-  - mgr.x
-  - osd.4
-  - osd.5
-  - osd.6
-  - osd.7
-  - client.1
-  - prometheus.a
-  - grafana.a
-  - node-exporter.b
-  - ceph.iscsi.iscsi.a
diff --git a/ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.stream_container-tools.yaml b/ceph/qa/suites/orch/cephadm/upgrade/1-start-distro/1-start-centos_8.stream_container-tools.yaml
new file mode 100644 (file)
index 0000000..a1a9cb5
--- /dev/null
@@ -0,0 +1,43 @@
+os_type: centos
+os_version: "8.stream"
+
+tasks:
+- pexec:
+    all:
+    - sudo cp /etc/containers/registries.conf /etc/containers/registries.conf.backup
+    - sudo dnf -y  module reset container-tools
+    - sudo dnf -y  module install container-tools
+    - sudo cp /etc/containers/registries.conf.backup /etc/containers/registries.conf
+- cephadm:
+    image: docker.io/ceph/ceph:v15.2.0
+    cephadm_branch: v15.2.0
+    cephadm_git_url: https://github.com/ceph/ceph
+    # avoid --cap-add=PTRACE + --privileged for older cephadm versions
+    allow_ptrace: false
+    # deploy additional mons the "old" (octopus) way
+    add_mons_via_daemon_add: true
+    avoid_pacific_features: true
+
+roles:
+- - mon.a
+  - mon.c
+  - mgr.y
+  - osd.0
+  - osd.1
+  - osd.2
+  - osd.3
+  - client.0
+#   - ceph.rgw.realm.zone.a # Disabled, needs 15.2.4 as an upgrade start
+  - node-exporter.a
+  - alertmanager.a
+- - mon.b
+  - mgr.x
+  - osd.4
+  - osd.5
+  - osd.6
+  - osd.7
+  - client.1
+  - prometheus.a
+  - grafana.a
+  - node-exporter.b
+#  - ceph.iscsi.iscsi.a  # needs later start point
diff --git a/ceph/qa/suites/orch/cephadm/upgrade/5-upgrade-ls.yaml b/ceph/qa/suites/orch/cephadm/upgrade/5-upgrade-ls.yaml
new file mode 100644 (file)
index 0000000..236ea6c
--- /dev/null
@@ -0,0 +1,6 @@
+tasks:
+- cephadm.shell:
+    mon.a:
+      - ceph orch upgrade ls
+      - ceph orch upgrade ls --image quay.io/ceph/ceph | grep 16.2.0
+      - ceph orch upgrade ls --image quay.io/ceph/ceph --tags | grep v16.2.2
diff --git a/ceph/qa/suites/orch/cephadm/workunits/0-distro/centos_8.stream_container_tools.yaml b/ceph/qa/suites/orch/cephadm/workunits/0-distro/centos_8.stream_container_tools.yaml
new file mode 120000 (symlink)
index 0000000..7a86f96
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/podman/centos_8.stream_container_tools.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/orch/cephadm/workunits/task/test_nfs.yaml b/ceph/qa/suites/orch/cephadm/workunits/task/test_nfs.yaml
new file mode 100644 (file)
index 0000000..8448c1a
--- /dev/null
@@ -0,0 +1,17 @@
+roles:
+- - host.a
+  - osd.0
+  - osd.1
+  - osd.2
+  - mon.a
+  - mgr.a
+  - client.0
+tasks:
+- install:
+- cephadm:
+- cephadm.shell:
+    host.a:
+      - ceph orch apply mds a
+- cephfs_test_runner:
+    modules:
+      - tasks.cephfs.test_nfs
index b62872123425b974df3aa2839cf789cdf9e3b0a2..ec65fb116f718cef1039b392ccecc32624013b3c 100644 (file)
@@ -14,5 +14,4 @@ tasks:
       - ceph orch apply mds a
 - cephfs_test_runner:
     modules:
-      - tasks.cephfs.test_nfs
       - tasks.cephadm_cases.test_cli
diff --git a/ceph/qa/suites/perf-basic/ubuntu_18.04.yaml b/ceph/qa/suites/perf-basic/ubuntu_18.04.yaml
deleted file mode 120000 (symlink)
index cfb85f1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/distros/all/ubuntu_18.04.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/perf-basic/ubuntu_latest.yaml b/ceph/qa/suites/perf-basic/ubuntu_latest.yaml
new file mode 120000 (symlink)
index 0000000..3a09f9a
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/supported/ubuntu_latest.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/perf-basic/workloads/cosbench_64K_write.yaml b/ceph/qa/suites/perf-basic/workloads/cosbench_64K_write.yaml
deleted file mode 100644 (file)
index 1dbeef4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-meta:
-- desc: |
-   Run cosbench benchmark using cbt.
-   64K write workload.
-
-overrides:
-  rgw:
-    data_pool_pg_size: 64
-    index_pool_pg_size: 64
-tasks:
-- cbt:
-    benchmarks:
-      cosbench:
-        obj_size: [64KB]
-        osd_ra: [4096]
-        workers: 1
-        containers_max: 1000
-        objects_max: 100
-        mode: [write]
-        template: [default]
-        rampup: 30
-        runtime: 300
-        rampdown: 30
-        containers: ["u(1,100)"]
-        objects: ["u(1,100)"]
-        ratio: [100]
-    cluster:
-      user: 'ubuntu'
-      osds_per_node: 1
-      iterations: 1
index 5ca0c662146f6bddf97d5a276cf38c4709d81a3e..0a6076cabe9105a079fe801ead55fcc3619eb5dc 100644 (file)
@@ -36,6 +36,7 @@ tasks:
         - tasks.mgr.dashboard.test_auth
         - tasks.mgr.dashboard.test_cephfs
         - tasks.mgr.dashboard.test_cluster_configuration
+        - tasks.mgr.dashboard.test_cluster
         - tasks.mgr.dashboard.test_crush_rule
         - tasks.mgr.dashboard.test_erasure_code_profile
         - tasks.mgr.dashboard.test_ganesha
index deab01adb05ddc0d848b2fc3fc5dd213e8c097ed..905e6f783008e7e6bb2c8c34eb241f2538c7095c 100644 (file)
@@ -23,3 +23,4 @@ tasks:
   - cephfs_test_runner:
       modules:
         - tasks.mgr.test_module_selftest
+      fail_on_skip: false
index 4a0e802b28968ff731380cffb5c0cd19ec885552..73bbe3c995646641fbe67c70f5587de652e9c1d6 100644 (file)
@@ -17,6 +17,7 @@ tasks:
         - \(FS_WITH_FAILED_MDS\)
         - \(FS_DEGRADED\)
         - \(PG_
+        - \(OSDMAP_FLAGS\)
         - replacing it with standby
         - No standby daemons available
   - cephfs_test_runner:
index 59e8029b17b4683468b343ff9513fbb849eb70fb..f7f1c855624342c2169fff94bf2df13e0ce25cda 100644 (file)
@@ -10,5 +10,4 @@ tasks:
       - \(OSD_
       - \(OBJECT_
       - overall HEALTH
-- rgw: [client.0]
 - ssh_keys:
diff --git a/ceph/qa/suites/rados/perf/ubuntu_18.04.yaml b/ceph/qa/suites/rados/perf/ubuntu_18.04.yaml
deleted file mode 120000 (symlink)
index cfb85f1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.qa/distros/all/ubuntu_18.04.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/rados/perf/ubuntu_latest.yaml b/ceph/qa/suites/rados/perf/ubuntu_latest.yaml
new file mode 120000 (symlink)
index 0000000..3a09f9a
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/supported/ubuntu_latest.yaml
\ No newline at end of file
diff --git a/ceph/qa/suites/rados/perf/workloads/cosbench_64K_read_write.yaml b/ceph/qa/suites/rados/perf/workloads/cosbench_64K_read_write.yaml
deleted file mode 100644 (file)
index ff06626..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-overrides:
-  rgw:
-    data_pool_pg_size: 64
-    index_pool_pg_size: 64
-tasks:
-- cbt:
-    benchmarks:
-      cosbench:
-        obj_size: [64KB]
-        osd_ra: [4096]
-        workers: 1
-        containers_max: 1000
-        objects_max: 100
-        mode: [mix]
-        template: [default]
-        rampup: 30
-        runtime: 300
-        rampdown: 30
-        containers: ["u(1,100)"]
-        objects: ["u(1,100)"]
-        ratio: [60]
-    cluster:
-      user: 'ubuntu'
-      osds_per_node: 1
-      iterations: 1
diff --git a/ceph/qa/suites/rados/perf/workloads/cosbench_64K_write.yaml b/ceph/qa/suites/rados/perf/workloads/cosbench_64K_write.yaml
deleted file mode 100644 (file)
index 39034a0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-overrides:
-  rgw:
-    data_pool_pg_size: 64
-    index_pool_pg_size: 64
-tasks:
-- cbt:
-    benchmarks:
-      cosbench:
-        obj_size: [64KB]
-        osd_ra: [4096]
-        workers: 1
-        containers_max: 1000
-        objects_max: 100
-        mode: [write]
-        template: [default]
-        rampup: 30
-        runtime: 300
-        rampdown: 30
-        containers: ["u(1,100)"]
-        objects: ["u(1,100)"]
-        ratio: [100]
-    cluster:
-      user: 'ubuntu'
-      osds_per_node: 1
-      iterations: 1
diff --git a/ceph/qa/suites/rados/singleton/all/backfill-toofull.yaml b/ceph/qa/suites/rados/singleton/all/backfill-toofull.yaml
new file mode 100644 (file)
index 0000000..fcc3d0e
--- /dev/null
@@ -0,0 +1,37 @@
+roles:
+- - mon.a
+  - mon.b
+  - mon.c
+  - mgr.x
+  - osd.0
+  - osd.1
+  - osd.2
+  - osd.3
+openstack:
+  - volumes: # attached to each instance
+      count: 4
+      size: 10 # GB
+tasks:
+- install:
+- ceph:
+    create_rbd_pool: false
+    pre-mgr-commands:
+      - sudo ceph config set mgr mgr/devicehealth/enable_monitoring false --force
+    log-ignorelist:
+      - Error
+      - overall HEALTH_
+      - \(OBJECT_
+      - \(OSDMAP_FLAGS\)
+      - \(OSD_
+      - \(PG_
+      - \(POOL_BACKFILLFULL\)
+      - \(POOL_NEARFULL\)
+      - \(SLOW_OPS\)
+      - \(TOO_FEW_PGS\)
+      - Monitor daemon marked osd\.[[:digit:]]+ down, but it is still running
+      - slow request
+    conf:
+      osd:
+        osd min pg log entries: 5
+        osd max pg log entries: 5
+- backfill_toofull:
diff --git a/ceph/qa/suites/rados/singleton/all/ec-inconsistent-hinfo.yaml b/ceph/qa/suites/rados/singleton/all/ec-inconsistent-hinfo.yaml
new file mode 100644 (file)
index 0000000..d71eab1
--- /dev/null
@@ -0,0 +1,36 @@
+roles:
+- - mon.a
+  - mon.b
+  - mon.c
+  - mgr.x
+  - osd.0
+  - osd.1
+  - osd.2
+  - osd.3
+openstack:
+  - volumes: # attached to each instance
+      count: 4
+      size: 10 # GB
+tasks:
+- install:
+- ceph:
+    create_rbd_pool: false
+    pre-mgr-commands:
+      - sudo ceph config set mgr mgr/devicehealth/enable_monitoring false --force
+    log-ignorelist:
+      - \(OBJECT_
+      - \(OSDMAP_FLAGS\)
+      - \(OSD_
+      - \(PG_
+      - \(SLOW_OPS\)
+      - deep-scrub
+      - missing
+      - overall HEALTH_
+      - repair
+      - slow request
+      - unfound
+    conf:
+      osd:
+        osd min pg log entries: 5
+        osd max pg log entries: 5
+- ec_inconsistent_hinfo:
index f678d08ce98c1b1b2fbf0179aed7089e7d177581..3f1c748311c5b6676f4b67f8718806668ff771af 100644 (file)
@@ -24,6 +24,9 @@ tasks:
       - \(OSDMAP_FLAGS\)
       - \(OSD_
       - \(PG_
+    conf:
+      mon:
+        debug auth: 30
 - full_sequential:
   - radosbench:
       clients: [client.0]
diff --git a/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-bootstrap-workunit.yaml b/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-bootstrap-workunit.yaml
deleted file mode 100644 (file)
index 585f582..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-meta:
-- desc: run the rbd_mirror_bootstrap.sh workunit to test the rbd-mirror daemon
-tasks:
-- workunit:
-    clients:
-      cluster1.client.mirror: [rbd/rbd_mirror_bootstrap.sh]
-    env:
-      # override workunit setting of CEPH_ARGS='--cluster'
-      CEPH_ARGS: ''
-      RBD_MIRROR_INSTANCES: '1'
-      RBD_MIRROR_USE_EXISTING_CLUSTER: '1'
diff --git a/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-journal-bootstrap-workunit.yaml b/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-journal-bootstrap-workunit.yaml
new file mode 100644 (file)
index 0000000..b9c5562
--- /dev/null
@@ -0,0 +1,13 @@
+meta:
+- desc: run the rbd_mirror_bootstrap.sh workunit to test the rbd-mirror daemon
+tasks:
+- workunit:
+    clients:
+      cluster1.client.mirror: [rbd/rbd_mirror_bootstrap.sh]
+    env:
+      # override workunit setting of CEPH_ARGS='--cluster'
+      CEPH_ARGS: ''
+      RBD_MIRROR_INSTANCES: '1'
+      RBD_MIRROR_USE_EXISTING_CLUSTER: '1'
+      MIRROR_POOL_MODE: 'pool'
+      MIRROR_IMAGE_MODE: 'journal'
diff --git a/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-snapshot-bootstrap-workunit.yaml b/ceph/qa/suites/rbd/mirror/workloads/rbd-mirror-snapshot-bootstrap-workunit.yaml
new file mode 100644 (file)
index 0000000..5ad7847
--- /dev/null
@@ -0,0 +1,13 @@
+meta:
+- desc: run the rbd_mirror_bootstrap.sh workunit to test the rbd-mirror daemon
+tasks:
+- workunit:
+    clients:
+      cluster1.client.mirror: [rbd/rbd_mirror_bootstrap.sh]
+    env:
+      # override workunit setting of CEPH_ARGS='--cluster'
+      CEPH_ARGS: ''
+      RBD_MIRROR_INSTANCES: '1'
+      RBD_MIRROR_USE_EXISTING_CLUSTER: '1'
+      MIRROR_POOL_MODE: 'image'
+      MIRROR_IMAGE_MODE: 'snapshot'
diff --git a/ceph/qa/suites/rbd/persistent-writeback-cache/4-pool/big-cache.yaml b/ceph/qa/suites/rbd/persistent-writeback-cache/4-pool/big-cache.yaml
new file mode 100644 (file)
index 0000000..7ac3f31
--- /dev/null
@@ -0,0 +1,15 @@
+overrides:
+  ceph:
+    conf:
+      client:
+        rbd_persistent_cache_path: /home/ubuntu/cephtest/write_back_cache
+        rbd_persistent_cache_size: 8589934592
+        rbd_plugins: pwl_cache
+        rbd_default_features: 61
+tasks:
+- exec:
+    client.0:
+      - "mkdir -m 777 /home/ubuntu/cephtest/write_back_cache"
+- exec_on_cleanup:
+    client.0:
+      - "rm -rf /home/ubuntu/cephtest/write_back_cache"
index 06c134c37544fa211873a10027a1fdfd448d9fc0..455f86485a6818e1efb833e9521fccd3d01693d2 100644 (file)
@@ -1,6 +1,6 @@
 tasks:
 - s3tests-java:
     client.0:
-        force-branch: master
+        force-branch: ceph-pacific
         force-repo: https://github.com/ceph/java_s3tests.git 
 
index 9a2d9d8c87a4ca0bd8f02f5cc21c67939e6a5a37..061f6ddc56ee8c2b355c646e2872c94755db60a6 100644 (file)
@@ -3,7 +3,7 @@ meta:
    Run ceph on two nodes, using one of them as a client,
    with a separate client-only node.
    Use xfs beneath the osds.
-   install ceph/pacific v16.2.4 and the v16.2.x point versions
+   install ceph/pacific v16.2.5 and the v16.2.x point versions
    run workload and upgrade-sequence in parallel
    (every point release should be tested)
    run workload and upgrade-sequence in parallel
@@ -69,28 +69,28 @@ openstack:
     count: 3
     size: 30 # GB
 tasks:
-- print: "****  done pacific about to install v16.2.4 "
+- print: "****  done pacific about to install v16.2.5 "
 - install:
-    tag: v16.2.4
+    tag: v16.2.5
     # line below can be removed its from jewel test
     #exclude_packages: ['ceph-mgr','libcephfs2','libcephfs-devel','libcephfs-dev', 'librgw2']
-- print: "**** done v16.2.4 install"
+- print: "**** done v16.2.5 install"
 - ceph:
    fs: xfs
    add_osds_to_crush: true
 - print: "**** done ceph xfs"
 - sequential:
    - workload
-- print: "**** done workload v16.2.4"
+- print: "**** done workload v16.2.5"
 
 
-#######  upgrade to v16.2.5
+#######  upgrade to v16.2.6
 - install.upgrade:
     #exclude_packages: ['ceph-mgr','libcephfs2','libcephfs-devel','libcephfs-dev']
     mon.a:
-      tag: v16.2.5
+      tag: v16.2.6
     mon.b:
-      tag: v16.2.5
+      tag: v16.2.6
 - parallel:
    - workload_pacific
    - upgrade-sequence_pacific
diff --git a/ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific..yaml b/ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific..yaml
deleted file mode 100644 (file)
index 537ed59..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-meta:
-- desc: |
-   install ceph/pacific v16.2.4
-   Overall upgrade path is - pacific-latest.point => pacific-latest
-tasks:
-- install:
-    tag: v16.2.4
-    exclude_packages: ['librados3']
-    extra_packages: ['librados2']
-- print: "**** done install pacific v16.2.4"
-- ceph:
-- exec:
-    osd.0:
-      - ceph osd require-osd-release pacific
-      - ceph osd set-require-min-compat-client pacific
-- print: "**** done ceph"
-overrides:
-  ceph:
-    conf:
-      mon:
-        mon warn on osd down out interval zero: false
diff --git a/ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific.yaml b/ceph/qa/suites/upgrade/pacific-p2p/pacific-p2p-stress-split/1-ceph-install/pacific.yaml
new file mode 100644 (file)
index 0000000..ff3c468
--- /dev/null
@@ -0,0 +1,21 @@
+meta:
+- desc: |
+   install ceph/pacific v16.2.6
+   Overall upgrade path is - pacific-latest.point => pacific-latest
+tasks:
+- install:
+    tag: v16.2.6
+    exclude_packages: ['librados3']
+    extra_packages: ['librados2']
+- print: "**** done install pacific v16.2.6"
+- ceph:
+- exec:
+    osd.0:
+      - ceph osd require-osd-release pacific
+      - ceph osd set-require-min-compat-client pacific
+- print: "**** done ceph"
+overrides:
+  ceph:
+    conf:
+      mon:
+        mon warn on osd down out interval zero: false
index 6436757c58e77cefa5bfbe2f872cf69f28ed098d..edf6d205c1ef60e8421fc9c1c529668686082849 100644 (file)
@@ -3,7 +3,7 @@ meta:
    librbd python api tests
 tasks:
 - workunit:
-    tag: v16.2.4
+    tag: v16.2.6
     clients:
       client.0:
         - rbd/test_librbd_python.sh
diff --git a/ceph/qa/tasks/backfill_toofull.py b/ceph/qa/tasks/backfill_toofull.py
new file mode 100644 (file)
index 0000000..1a86659
--- /dev/null
@@ -0,0 +1,193 @@
+"""
+Backfill_toofull
+"""
+import logging
+import time
+from tasks import ceph_manager
+from tasks.util.rados import rados
+from teuthology import misc as teuthology
+
+log = logging.getLogger(__name__)
+
+def wait_for_pg_state(manager, pgid, state, to_osd):
+    log.debug("waiting for pg %s state is %s" % (pgid, state))
+    for i in range(300):
+        time.sleep(5)
+        manager.flush_pg_stats([0, 1, 2, 3])
+        pgs = manager.get_pg_stats()
+        pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+        log.info('pg=%s' % pg);
+        assert pg
+        status = pg['state'].split('+')
+        if 'active' not in status:
+            log.debug('not active')
+            continue
+        if state not in status:
+            log.debug('not %s' % state)
+            continue
+        assert to_osd in pg['up']
+        return
+    assert False, '%s not in %s' % (pgid, state)
+
+
+def task(ctx, config):
+    """
+    Test backfill reservation calculates "toofull" condition correctly.
+
+    A pretty rigid cluster is brought up and tested by this task
+    """
+    if config is None:
+        config = {}
+    assert isinstance(config, dict), \
+        'backfill_toofull task only accepts a dict for configuration'
+    first_mon = teuthology.get_first_mon(ctx, config)
+    (mon,) = ctx.cluster.only(first_mon).remotes.keys()
+
+    manager = ceph_manager.CephManager(
+        mon,
+        ctx=ctx,
+        logger=log.getChild('ceph_manager'),
+        )
+
+    profile = config.get('erasure_code_profile', {
+        'k': '2',
+        'm': '1',
+        'crush-failure-domain': 'osd'
+    })
+    profile_name = profile.get('name', 'backfill_toofull')
+    manager.create_erasure_code_profile(profile_name, profile)
+    pool = manager.create_pool_with_unique_name(
+        pg_num=1,
+        erasure_code_profile_name=profile_name,
+        min_size=2)
+    manager.raw_cluster_cmd('osd', 'pool', 'set', pool,
+                            'pg_autoscale_mode', 'off')
+
+    manager.flush_pg_stats([0, 1, 2, 3])
+    manager.wait_for_clean()
+
+    pool_id = manager.get_pool_num(pool)
+    pgid = '%d.0' % pool_id
+    pgs = manager.get_pg_stats()
+    acting = next((pg['acting'] for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug("acting=%s" % acting)
+    assert acting
+    primary = acting[0]
+    target = acting[1]
+
+    log.debug("write some data")
+    rados(ctx, mon, ['-p', pool, 'bench', '60', 'write', '--no-cleanup'])
+    df = manager.get_osd_df(target)
+    log.debug("target osd df: %s" % df)
+
+    total_kb = df['kb']
+    used_kb = df['kb_used']
+
+    log.debug("pause recovery")
+    manager.raw_cluster_cmd('osd', 'set', 'noout')
+    manager.raw_cluster_cmd('osd', 'set', 'nobackfill')
+    manager.raw_cluster_cmd('osd', 'set', 'norecover')
+
+    log.debug("stop tartget osd %s" % target)
+    manager.kill_osd(target)
+    manager.wait_till_active()
+
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug('pg=%s' % pg)
+    assert pg
+
+    log.debug("re-write data")
+    rados(ctx, mon, ['-p', pool, 'cleanup'])
+    time.sleep(10)
+    rados(ctx, mon, ['-p', pool, 'bench', '60', 'write', '--no-cleanup'])
+
+    df = manager.get_osd_df(primary)
+    log.debug("primary osd df: %s" % df)
+
+    primary_used_kb = df['kb_used']
+
+    log.info("test backfill reservation rejected with toofull")
+
+    # We set backfillfull ratio less than new data size and expect the pg
+    # entering backfill_toofull state.
+    #
+    # We also need to update nearfull ratio to prevent "full ratio(s) out of order".
+
+    backfillfull = 0.9 * primary_used_kb / total_kb
+    nearfull = backfillfull * 0.9
+
+    log.debug("update nearfull ratio to %s and backfillfull ratio to %s" %
+              (nearfull, backfillfull))
+    manager.raw_cluster_cmd('osd', 'set-nearfull-ratio',
+                            '{:.3f}'.format(nearfull))
+    manager.raw_cluster_cmd('osd', 'set-backfillfull-ratio',
+                            '{:.3f}'.format(backfillfull))
+
+    log.debug("start tartget osd %s" % target)
+
+    manager.revive_osd(target)
+    manager.wait_for_active()
+    manager.wait_till_osd_is_up(target)
+
+    wait_for_pg_state(manager, pgid, 'backfill_toofull', target)
+
+    log.info("test pg not enter backfill_toofull after restarting backfill")
+
+    # We want to set backfillfull ratio to be big enough for the target to
+    # successfully backfill new data but smaller than the sum of old and new
+    # data, so if the osd backfill reservation incorrectly calculates "toofull"
+    # the test will detect this (fail).
+    #
+    # Note, we need to operate with "uncompressed" bytes because currently
+    # osd backfill reservation does not take compression into account.
+    #
+    # We also need to update nearfull ratio to prevent "full ratio(s) out of order".
+
+    pdf = manager.get_pool_df(pool)
+    log.debug("pool %s df: %s" % (pool, df))
+    assert pdf
+    compress_ratio = 1.0 * pdf['compress_under_bytes'] / pdf['compress_bytes_used'] \
+        if pdf['compress_bytes_used'] > 0 else 1.0
+    log.debug("compress_ratio: %s" % compress_ratio)
+
+    backfillfull = (used_kb + primary_used_kb) * compress_ratio / total_kb
+    assert backfillfull < 0.9
+    nearfull_min = max(used_kb, primary_used_kb) * compress_ratio / total_kb
+    assert nearfull_min < backfillfull
+    delta = backfillfull - nearfull_min
+    nearfull = nearfull_min + delta * 0.1
+    backfillfull = nearfull_min + delta * 0.2
+
+    log.debug("update nearfull ratio to %s and backfillfull ratio to %s" %
+              (nearfull, backfillfull))
+    manager.raw_cluster_cmd('osd', 'set-nearfull-ratio',
+                            '{:.3f}'.format(nearfull))
+    manager.raw_cluster_cmd('osd', 'set-backfillfull-ratio',
+                            '{:.3f}'.format(backfillfull))
+
+    wait_for_pg_state(manager, pgid, 'backfilling', target)
+
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug('pg=%s' % pg)
+    assert pg
+
+    log.debug("interrupt %s backfill" % target)
+    manager.mark_down_osd(target)
+    # after marking the target osd down it will automatically be
+    # up soon again
+
+    log.debug("resume recovery")
+    manager.raw_cluster_cmd('osd', 'unset', 'noout')
+    manager.raw_cluster_cmd('osd', 'unset', 'nobackfill')
+    manager.raw_cluster_cmd('osd', 'unset', 'norecover')
+
+    # wait for everything to peer, backfill and recover
+    manager.wait_for_clean()
+
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.info('pg=%s' % pg)
+    assert pg
+    assert 'clean' in pg['state'].split('+')
index cfa85e1ddd6ea9236915ed9813ed458b9b753c81..4d1354903df823a50d7cb1270c029d4c502ccf95 100644 (file)
@@ -96,8 +96,11 @@ def setup_venv(ctx, config):
     assert isinstance(config, dict)
     log.info('Setting up virtualenv for barbican...')
     for (client, _) in config.items():
-        run_in_barbican_dir(ctx, client, ['virtualenv', '.barbicanenv'])
-        run_in_barbican_venv(ctx, client, ['pip', 'install', 'pytz', '-e', get_barbican_dir(ctx)])
+        run_in_barbican_dir(ctx, client,
+                            ['python3', '-m', 'venv', '.barbicanenv'])
+        run_in_barbican_venv(ctx, client,
+                             ['pip', 'install', 'pytz',
+                              '-e', get_barbican_dir(ctx)])
     yield
 
 def assign_ports(ctx, config, initial_port):
index 9894addd7f1449acb1f10441bee77a1af3100ce3..a6eab9be808a2fd7fab4619f56bf99470045a027 100644 (file)
@@ -46,8 +46,8 @@ def generate_caps(type_):
     """
     defaults = dict(
         osd=dict(
-            mon='allow *',
-            mgr='allow *',
+            mon='allow profile osd',
+            mgr='allow profile osd',
             osd='allow *',
         ),
         mgr=dict(
@@ -376,6 +376,20 @@ def crush_setup(ctx, config):
     yield
 
 
+@contextlib.contextmanager
+def setup_manager(ctx, config):
+    first_mon = teuthology.get_first_mon(ctx, config, config['cluster'])
+    (mon,) = ctx.cluster.only(first_mon).remotes.keys()
+    if not hasattr(ctx, 'managers'):
+        ctx.managers = {}
+    ctx.managers[config['cluster']] = CephManager(
+        mon,
+        ctx=ctx,
+        logger=log.getChild('ceph_manager.' + config['cluster']),
+        cluster=config['cluster'],
+    )
+    yield
+
 @contextlib.contextmanager
 def create_rbd_pool(ctx, config):
     cluster_name = config['cluster']
@@ -1870,6 +1884,7 @@ def task(ctx, config):
         lambda: run_daemon(ctx=ctx, config=config, type_='mgr'),
         lambda: crush_setup(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='osd'),
+        lambda: setup_manager(ctx=ctx, config=config),
         lambda: create_rbd_pool(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='mds'),
         lambda: cephfs_setup(ctx=ctx, config=config),
@@ -1877,17 +1892,6 @@ def task(ctx, config):
     ]
 
     with contextutil.nested(*subtasks):
-        first_mon = teuthology.get_first_mon(ctx, config, config['cluster'])
-        (mon,) = ctx.cluster.only(first_mon).remotes.keys()
-        if not hasattr(ctx, 'managers'):
-            ctx.managers = {}
-        ctx.managers[config['cluster']] = CephManager(
-            mon,
-            ctx=ctx,
-            logger=log.getChild('ceph_manager.' + config['cluster']),
-            cluster=config['cluster'],
-        )
-
         try:
             if config.get('wait-for-healthy', True):
                 healthy(ctx=ctx, config=dict(cluster=config['cluster']))
index 28f28f54f492c5690388af30c2714c144dc54715..a274b8f29254a713bcd90f84a5e7a526127e0df0 100644 (file)
@@ -1438,7 +1438,7 @@ class ObjectStoreTool:
             if self.osd == "primary":
                 self.osd = self.manager.get_object_primary(self.pool,
                                                            self.object_name)
-        assert self.osd
+        assert self.osd is not None
         if self.object_name:
             self.pgid = self.manager.get_object_pg_with_shard(self.pool,
                                                               self.object_name,
@@ -2324,6 +2324,24 @@ class CephManager:
         except KeyError:
             return j['pg_stats']
 
+    def get_osd_df(self, osdid):
+        """
+        Get the osd df stats
+        """
+        out = self.raw_cluster_cmd('osd', 'df', 'name', 'osd.{}'.format(osdid),
+                                   '--format=json')
+        j = json.loads('\n'.join(out.split('\n')[1:]))
+        return j['nodes'][0]
+
+    def get_pool_df(self, name):
+        """
+        Get the pool df stats
+        """
+        out = self.raw_cluster_cmd('df', 'detail', '--format=json')
+        j = json.loads('\n'.join(out.split('\n')[1:]))
+        return next((p['stats'] for p in j['pools'] if p['name'] == name),
+                    None)
+
     def get_pgids_to_force(self, backfill):
         """
         Return the randomized list of PGs that can have their recovery/backfill forced
index 0f207c6409bd0163aa9296754f5be9fc9d05c51d..7040853dfb437ff54ccb53031e46b67662d76132 100644 (file)
@@ -189,16 +189,22 @@ class CephTestCase(unittest.TestCase):
         log.debug("wait_until_equal: success")
 
     @classmethod
-    def wait_until_true(cls, condition, timeout, period=5):
+    def wait_until_true(cls, condition, timeout, check_fn=None, period=5):
         elapsed = 0
+        retry_count = 0
         while True:
             if condition():
-                log.debug("wait_until_true: success in {0}s".format(elapsed))
+                log.debug("wait_until_true: success in {0}s and {1} retries".format(elapsed, retry_count))
                 return
             else:
                 if elapsed >= timeout:
-                    raise TestTimeoutError("Timed out after {0}s".format(elapsed))
+                    if check_fn and check_fn() and retry_count < 5:
+                        elapsed = 0
+                        retry_count += 1
+                        log.debug("wait_until_true: making progress, waiting (timeout={0} retry_count={1})...".format(timeout, retry_count))
+                    else:
+                        raise TestTimeoutError("Timed out after {0}s and {1} retries".format(elapsed, retry_count))
                 else:
-                    log.debug("wait_until_true: waiting (timeout={0})...".format(timeout))
+                    log.debug("wait_until_true: waiting (timeout={0} retry_count={1})...".format(timeout, retry_count))
                 time.sleep(period)
                 elapsed += period
index e66185c42753f47d24577a95403753d0c36ea39e..881ce7d8097984be6f74aa982351a431474f7662 100644 (file)
@@ -148,6 +148,13 @@ class FSStatus(object):
             if info['rank'] >= 0 and info['state'] != 'up:standby-replay':
                 yield info
 
+    def get_damaged(self, fscid):
+        """
+        Get the damaged ranks for the given FSCID.
+        """
+        fs = self.get_fsmap(fscid)
+        return fs['mdsmap']['damaged']
+
     def get_rank(self, fscid, rank):
         """
         Get the rank for the given FSCID.
@@ -1045,6 +1052,11 @@ class Filesystem(MDSCluster):
             status = self.getinfo()
         return status.get_ranks(self.id)
 
+    def get_damaged(self, status=None):
+        if status is None:
+            status = self.getinfo()
+        return status.get_damaged(self.id)
+
     def get_replays(self, status=None):
         if status is None:
             status = self.getinfo()
index 883acb4d8f246beaa3695d83622d0af6d8a0d725..9c12d5272b2f947207e5fccfe83ddd0dc82bc5a3 100644 (file)
@@ -530,6 +530,7 @@ class CephFSMount(object):
         raise NotImplementedError()
 
     def get_keyring_path(self):
+        # N.B.: default keyring is /etc/ceph/ceph.keyring; see ceph.py and generate_caps
         return '/etc/ceph/ceph.client.{id}.keyring'.format(id=self.client_id)
 
     def get_key_from_keyfile(self):
index 304d27c2c8cff731e7b2bf006d268c9477a6ae31..f2032b23741086e331a7ad1e0be3f99e40fce9d4 100644 (file)
@@ -518,6 +518,22 @@ class TestStandbyReplay(CephFSTestCase):
         time.sleep(30)
         self._confirm_single_replay()
 
+    def test_standby_replay_damaged(self):
+        """
+        That a standby-replay daemon can cause the rank to go damaged correctly.
+        """
+
+        self._confirm_no_replay()
+        self.config_set("mds", "mds_standby_replay_damaged", True)
+        self.fs.set_allow_standby_replay(True)
+        self.wait_until_true(
+            lambda: len(self.fs.get_damaged()) > 0,
+            timeout=30
+        )
+        status = self.fs.status()
+        self.assertListEqual([], list(self.fs.get_ranks(status=status)))
+        self.assertListEqual([0], self.fs.get_damaged(status=status))
+
     def test_standby_replay_disable(self):
         """
         That turning off allow_standby_replay fails all standby-replay daemons.
index c3c746a1dff3ee9f5f79b12561f3d67c83d02754..91f07fdf401128427683c286c5520032cc53ba88 100644 (file)
@@ -237,8 +237,8 @@ class TestMirroring(CephFSTestCase):
         log.debug(f'command returned={res}')
         return json.loads(res)
 
-    def get_mirror_daemon_status(self, fs_name, fs_id):
-        daemon_status = json.loads(self.mgr_cluster.mon_manager.raw_cluster_cmd("fs", "snapshot", "mirror", "daemon", "status", fs_name))
+    def get_mirror_daemon_status(self):
+        daemon_status = json.loads(self.mgr_cluster.mon_manager.raw_cluster_cmd("fs", "snapshot", "mirror", "daemon", "status"))
         log.debug(f'daemon_status: {daemon_status}')
         # running a single mirror daemon is supported
         status = daemon_status[0]
@@ -657,7 +657,7 @@ class TestMirroring(CephFSTestCase):
         self.peer_add(self.primary_fs_name, self.primary_fs_id, "client.mirror_remote@ceph", self.secondary_fs_name)
 
         time.sleep(30)
-        status = self.get_mirror_daemon_status(self.primary_fs_name, self.primary_fs_id)
+        status = self.get_mirror_daemon_status()
 
         # assumption for this test: mirroring enabled for a single filesystem w/ single
         # peer
@@ -673,7 +673,7 @@ class TestMirroring(CephFSTestCase):
         self.add_directory(self.primary_fs_name, self.primary_fs_id, '/d0')
 
         time.sleep(120)
-        status = self.get_mirror_daemon_status(self.primary_fs_name, self.primary_fs_id)
+        status = self.get_mirror_daemon_status()
         # we added one
         peer = status['filesystems'][0]['peers'][0]
         self.assertEquals(status['filesystems'][0]['directory_count'], 1)
@@ -685,7 +685,7 @@ class TestMirroring(CephFSTestCase):
         self.mount_a.run_shell(["mkdir", "d0"])
 
         time.sleep(120)
-        status = self.get_mirror_daemon_status(self.primary_fs_name, self.primary_fs_id)
+        status = self.get_mirror_daemon_status()
         peer = status['filesystems'][0]['peers'][0]
         self.assertEquals(status['filesystems'][0]['directory_count'], 1)
         # failure and recovery count should be reflected
index c3feb1604c9251562825b7b694d027dcf12d554b..97269a32c55bb4667491930366f188ca875eb52c 100644 (file)
@@ -6,10 +6,12 @@ import logging
 from io import BytesIO
 
 from tasks.mgr.mgr_test_case import MgrTestCase
+from teuthology import contextutil
 from teuthology.exceptions import CommandFailedError
 
 log = logging.getLogger(__name__)
 
+NFS_POOL_NAME = '.nfs'  # should match mgr_module.py
 
 # TODO Add test for cluster update when ganesha can be deployed on multiple ports.
 class TestNFS(MgrTestCase):
@@ -23,7 +25,6 @@ class TestNFS(MgrTestCase):
         return self._cmd("orch", *args)
 
     def _sys_cmd(self, cmd):
-        cmd[0:0] = ['sudo']
         ret = self.ctx.cluster.run(args=cmd, check_status=False, stdout=BytesIO(), stderr=BytesIO())
         stdout = ret[0].stdout
         if stdout:
@@ -44,7 +45,7 @@ class TestNFS(MgrTestCase):
          "cluster_id": self.cluster_id,
          "pseudo": self.pseudo_path,
          "access_type": "RW",
-         "squash": "no_root_squash",
+         "squash": "none",
          "security_label": True,
          "protocols": [
            4
@@ -54,21 +55,20 @@ class TestNFS(MgrTestCase):
          ],
          "fsal": {
            "name": "CEPH",
-           "user_id": "test1",
+           "user_id": "nfs.test.1",
            "fs_name": self.fs_name,
-           "sec_label_xattr": ''
          },
          "clients": []
         }
 
     def _check_nfs_server_status(self):
-        res = self._sys_cmd(['systemctl', 'status', 'nfs-server'])
+        res = self._sys_cmd(['sudo', 'systemctl', 'status', 'nfs-server'])
         if isinstance(res, bytes) and b'Active: active' in res:
             self._disable_nfs()
 
     def _disable_nfs(self):
         log.info("Disabling NFS")
-        self._sys_cmd(['systemctl', 'disable', 'nfs-server', '--now'])
+        self._sys_cmd(['sudo', 'systemctl', 'disable', 'nfs-server', '--now'])
 
     def _fetch_nfs_status(self):
         return self._orch_cmd('ps', f'--service_name={self.expected_name}')
@@ -95,10 +95,11 @@ class TestNFS(MgrTestCase):
         :param check_in: Check specified export id
         '''
         output = self._cmd('auth', 'ls')
+        client_id = f'client.nfs.{self.cluster_id}'
         if check_in:
-            self.assertIn(f'client.{self.cluster_id}{export_id}', output)
+            self.assertIn(f'{client_id}.{export_id}', output)
         else:
-            self.assertNotIn(f'client-{self.cluster_id}', output)
+            self.assertNotIn(f'{client_id}.{export_id}', output)
 
     def _test_idempotency(self, cmd_func, cmd_args):
         '''
@@ -153,16 +154,26 @@ class TestNFS(MgrTestCase):
         '''
         if create_fs:
             self._cmd('fs', 'volume', 'create', self.fs_name)
-        export_cmd = ['nfs', 'export', 'create', 'cephfs', self.fs_name, self.cluster_id]
+            with contextutil.safe_while(sleep=5, tries=30) as proceed:
+                while proceed():
+                    output = self._cmd(
+                        'orch', 'ls', '-f', 'json',
+                        '--service-name', f'mds.{self.fs_name}'
+                    )
+                    j = json.loads(output)
+                    if j[0]['status']['running']:
+                        break
+        export_cmd = ['nfs', 'export', 'create', 'cephfs',
+                      '--fsname', self.fs_name, '--cluster-id', self.cluster_id]
         if isinstance(extra_cmd, list):
             export_cmd.extend(extra_cmd)
         else:
-            export_cmd.append(self.pseudo_path)
+            export_cmd.extend(['--pseudo-path', self.pseudo_path])
         # Runs the nfs export create command
         self._cmd(*export_cmd)
         # Check if user id for export is created
         self._check_auth_ls(export_id, check_in=True)
-        res = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'get',
+        res = self._sys_cmd(['rados', '-p', NFS_POOL_NAME, '-N', self.cluster_id, 'get',
                              f'export-{export_id}', '-'])
         # Check if export object is created
         if res == b'':
@@ -201,26 +212,26 @@ class TestNFS(MgrTestCase):
         self.sample_export['export_id'] = 2
         self.sample_export['pseudo'] = self.pseudo_path + '1'
         self.sample_export['access_type'] = 'RO'
-        self.sample_export['fsal']['user_id'] = self.cluster_id + '2'
+        self.sample_export['fsal']['user_id'] = f'{self.expected_name}.2'
         self.assertDictEqual(self.sample_export, nfs_output[1])
         # Export-3 for subvolume with r only
         self.sample_export['export_id'] = 3
         self.sample_export['path'] = sub_vol_path
         self.sample_export['pseudo'] = self.pseudo_path + '2'
-        self.sample_export['fsal']['user_id'] = self.cluster_id + '3'
+        self.sample_export['fsal']['user_id'] = f'{self.expected_name}.3'
         self.assertDictEqual(self.sample_export, nfs_output[2])
         # Export-4 for subvolume
         self.sample_export['export_id'] = 4
         self.sample_export['pseudo'] = self.pseudo_path + '3'
         self.sample_export['access_type'] = 'RW'
-        self.sample_export['fsal']['user_id'] = self.cluster_id + '4'
+        self.sample_export['fsal']['user_id'] = f'{self.expected_name}.4'
         self.assertDictEqual(self.sample_export, nfs_output[3])
 
     def _get_export(self):
         '''
         Returns export block in json format
         '''
-        return json.loads(self._nfs_cmd('export', 'get', self.cluster_id, self.pseudo_path))
+        return json.loads(self._nfs_cmd('export', 'info', self.cluster_id, self.pseudo_path))
 
     def _test_get_export(self):
         '''
@@ -234,7 +245,7 @@ class TestNFS(MgrTestCase):
         Test if export or config object are deleted successfully.
         :param conf_obj: It denotes config object needs to be checked
         '''
-        rados_obj_ls = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'ls'])
+        rados_obj_ls = self._sys_cmd(['rados', '-p', NFS_POOL_NAME, '-N', self.cluster_id, 'ls'])
 
         if b'export-' in rados_obj_ls or (conf_obj and b'conf-nfs' in rados_obj_ls):
             self.fail("Delete export failed")
@@ -255,14 +266,22 @@ class TestNFS(MgrTestCase):
         :param ip: IP of deployed nfs cluster
         :param check: It denotes if i/o testing needs to be done
         '''
-        try:
-            self.ctx.cluster.run(args=['sudo', 'mount', '-t', 'nfs', '-o', f'port={port}',
-                                       f'{ip}:{pseudo_path}', '/mnt'])
-        except CommandFailedError as e:
-            # Check if mount failed only when non existing pseudo path is passed
-            if not check and e.exitstatus == 32:
-                return
-            raise
+        tries = 3
+        while True:
+            try:
+                self.ctx.cluster.run(
+                    args=['sudo', 'mount', '-t', 'nfs', '-o', f'port={port}',
+                          f'{ip}:{pseudo_path}', '/mnt'])
+                break
+            except CommandFailedError as e:
+                if tries:
+                    tries -= 1
+                    time.sleep(2)
+                    continue
+                # Check if mount failed only when non existing pseudo path is passed
+                if not check and e.exitstatus == 32:
+                    return
+                raise
 
         self.ctx.cluster.run(args=['sudo', 'chmod', '1777', '/mnt'])
 
@@ -332,9 +351,10 @@ class TestNFS(MgrTestCase):
         '''
         Test idempotency of export create and delete commands.
         '''
-        self._test_idempotency(self._create_default_export, ['nfs', 'export', 'create', 'cephfs',
-                                                             self.fs_name, self.cluster_id,
-                                                             self.pseudo_path])
+        self._test_idempotency(self._create_default_export, [
+            'nfs', 'export', 'create', 'cephfs',
+            '--fsname', self.fs_name, '--cluster-id', self.cluster_id,
+            '--pseudo-path', self.pseudo_path])
         self._test_idempotency(self._delete_export, ['nfs', 'export', 'rm', self.cluster_id,
                                                      self.pseudo_path])
         self._test_delete_cluster()
@@ -346,13 +366,18 @@ class TestNFS(MgrTestCase):
         # Export-1 with default values (access type = rw and path = '\')
         self._create_default_export()
         # Export-2 with r only
-        self._create_export(export_id='2', extra_cmd=[self.pseudo_path+'1', '--readonly'])
+        self._create_export(export_id='2',
+                            extra_cmd=['--pseudo-path', self.pseudo_path+'1', '--readonly'])
         # Export-3 for subvolume with r only
         self._cmd('fs', 'subvolume', 'create', self.fs_name, 'sub_vol')
         fs_path = self._cmd('fs', 'subvolume', 'getpath', self.fs_name, 'sub_vol').strip()
-        self._create_export(export_id='3', extra_cmd=[self.pseudo_path+'2', '--readonly', fs_path])
+        self._create_export(export_id='3',
+                            extra_cmd=['--pseudo-path', self.pseudo_path+'2', '--readonly',
+                                       '--path', fs_path])
         # Export-4 for subvolume
-        self._create_export(export_id='4', extra_cmd=[self.pseudo_path+'3', fs_path])
+        self._create_export(export_id='4',
+                            extra_cmd=['--pseudo-path', self.pseudo_path+'3',
+                                       '--path', fs_path])
         # Check if exports gets listed
         self._test_list_detailed(fs_path)
         self._test_delete_cluster()
@@ -385,7 +410,9 @@ class TestNFS(MgrTestCase):
         try:
             fs_name = 'nfs-test'
             self._test_create_cluster()
-            self._nfs_cmd('export', 'create', 'cephfs', fs_name, self.cluster_id, self.pseudo_path)
+            self._nfs_cmd('export', 'create', 'cephfs',
+                          '--fsname', fs_name, '--cluster-id', self.cluster_id,
+                          '--pseudo-path', self.pseudo_path)
             self.fail(f"Export created with non-existing filesystem {fs_name}")
         except CommandFailedError as e:
             # Command should fail for test to pass
@@ -400,7 +427,8 @@ class TestNFS(MgrTestCase):
         '''
         try:
             cluster_id = 'invalidtest'
-            self._nfs_cmd('export', 'create', 'cephfs', self.fs_name, cluster_id, self.pseudo_path)
+            self._nfs_cmd('export', 'create', 'cephfs', '--fsname', self.fs_name,
+                          '--cluster-id', cluster_id, '--pseudo-path', self.pseudo_path)
             self.fail(f"Export created with non-existing cluster id {cluster_id}")
         except CommandFailedError as e:
             # Command should fail for test to pass
@@ -413,8 +441,9 @@ class TestNFS(MgrTestCase):
         '''
         def check_pseudo_path(pseudo_path):
             try:
-                self._nfs_cmd('export', 'create', 'cephfs', self.fs_name, self.cluster_id,
-                              pseudo_path)
+                self._nfs_cmd('export', 'create', 'cephfs', '--fsname', self.fs_name,
+                              '--cluster-id', self.cluster_id,
+                              '--pseudo-path', pseudo_path)
                 self.fail(f"Export created for {pseudo_path}")
             except CommandFailedError as e:
                 # Command should fail for test to pass
@@ -434,8 +463,10 @@ class TestNFS(MgrTestCase):
         Test write to readonly export.
         '''
         self._test_create_cluster()
-        self._create_export(export_id='1', create_fs=True, extra_cmd=[self.pseudo_path, '--readonly'])
+        self._create_export(export_id='1', create_fs=True,
+                            extra_cmd=['--pseudo-path', self.pseudo_path, '--readonly'])
         port, ip = self._get_port_ip_info()
+        self._check_nfs_cluster_status('running', 'NFS Ganesha cluster restart failed')
         self._write_to_read_only_export(self.pseudo_path, port, ip)
         self._test_delete_cluster()
 
@@ -471,7 +502,7 @@ class TestNFS(MgrTestCase):
         '''
         self._test_create_cluster()
 
-        pool = 'nfs-ganesha'
+        pool = NFS_POOL_NAME
         user_id = 'test'
         fs_name = 'user_test_fs'
         pseudo_path = '/ceph'
@@ -502,7 +533,7 @@ class TestNFS(MgrTestCase):
                }}
         }}"""
         port, ip = self._get_port_ip_info()
-        self.ctx.cluster.run(args=['sudo', 'ceph', 'nfs', 'cluster', 'config',
+        self.ctx.cluster.run(args=['ceph', 'nfs', 'cluster', 'config',
             'set', self.cluster_id, '-i', '-'], stdin=config)
         time.sleep(30)
         res = self._sys_cmd(['rados', '-p', pool, '-N', self.cluster_id, 'get',
@@ -510,7 +541,7 @@ class TestNFS(MgrTestCase):
         self.assertEqual(config, res.decode('utf-8'))
         self._test_mnt(pseudo_path, port, ip)
         self._nfs_cmd('cluster', 'config', 'reset', self.cluster_id)
-        rados_obj_ls = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'ls'])
+        rados_obj_ls = self._sys_cmd(['rados', '-p', NFS_POOL_NAME, '-N', self.cluster_id, 'ls'])
         if b'conf-nfs' not in rados_obj_ls and b'userconf-nfs' in rados_obj_ls:
             self.fail("User config not deleted")
         time.sleep(30)
@@ -524,7 +555,7 @@ class TestNFS(MgrTestCase):
         '''
         try:
             cluster_id = 'invalidtest'
-            self.ctx.cluster.run(args=['sudo', 'ceph', 'nfs', 'cluster',
+            self.ctx.cluster.run(args=['ceph', 'nfs', 'cluster',
                 'config', 'set', self.cluster_id, '-i', '-'], stdin='testing')
             self.fail(f"User config set for non-existing cluster {cluster_id}")
         except CommandFailedError as e:
@@ -545,6 +576,29 @@ class TestNFS(MgrTestCase):
             if e.exitstatus != errno.ENOENT:
                 raise
 
+    def test_create_export_via_apply(self):
+        '''
+        Test creation of export via apply
+        '''
+        self._test_create_cluster()
+        self.ctx.cluster.run(args=['ceph', 'nfs', 'export', 'apply',
+                                   self.cluster_id, '-i', '-'],
+                             stdin=json.dumps({
+                                 "path": "/",
+                                 "pseudo": "/cephfs",
+                                 "squash": "none",
+                                 "access_type": "rw",
+                                 "protocols": [4],
+                                 "fsal": {
+                                     "name": "CEPH",
+                                     "fs_name": self.fs_name
+                                 }
+                             }))
+        port, ip = self._get_port_ip_info()
+        self._test_mnt(self.pseudo_path, port, ip)
+        self._check_nfs_cluster_status('running', 'NFS Ganesha cluster restart failed')
+        self._test_delete_cluster()
+
     def test_update_export(self):
         '''
         Test update of exports
@@ -556,8 +610,9 @@ class TestNFS(MgrTestCase):
         new_pseudo_path = '/testing'
         export_block['pseudo'] = new_pseudo_path
         export_block['access_type'] = 'RO'
-        self.ctx.cluster.run(args=['sudo', 'ceph', 'nfs', 'export', 'update', '-i', '-'],
-                stdin=json.dumps(export_block))
+        self.ctx.cluster.run(args=['ceph', 'nfs', 'export', 'apply',
+                                   self.cluster_id, '-i', '-'],
+                             stdin=json.dumps(export_block))
         self._check_nfs_cluster_status('running', 'NFS Ganesha cluster restart failed')
         self._write_to_read_only_export(new_pseudo_path, port, ip)
         self._test_delete_cluster()
@@ -577,7 +632,8 @@ class TestNFS(MgrTestCase):
             else:
                 export_block_new[key] = value
             try:
-                self.ctx.cluster.run(args=['sudo', 'ceph', 'nfs', 'export', 'update', '-i', '-'],
+                self.ctx.cluster.run(args=['ceph', 'nfs', 'export', 'apply',
+                                           self.cluster_id, '-i', '-'],
                         stdin=json.dumps(export_block_new))
             except CommandFailedError:
                 pass
@@ -613,10 +669,11 @@ class TestNFS(MgrTestCase):
         exec_cmd_invalid('cluster', 'config', 'set')
         exec_cmd_invalid('cluster', 'config', 'reset')
         exec_cmd_invalid('export', 'create', 'cephfs')
-        exec_cmd_invalid('export', 'create', 'cephfs', 'a_fs')
-        exec_cmd_invalid('export', 'create', 'cephfs', 'a_fs', 'clusterid')
+        exec_cmd_invalid('export', 'create', 'cephfs', 'clusterid')
+        exec_cmd_invalid('export', 'create', 'cephfs', 'clusterid', 'a_fs')
         exec_cmd_invalid('export', 'ls')
         exec_cmd_invalid('export', 'delete')
         exec_cmd_invalid('export', 'delete', 'clusterid')
-        exec_cmd_invalid('export', 'get')
-        exec_cmd_invalid('export', 'get', 'clusterid')
+        exec_cmd_invalid('export', 'info')
+        exec_cmd_invalid('export', 'info', 'clusterid')
+        exec_cmd_invalid('export', 'apply')
index fa4d9431fefdfab4a3dfe03898439874d3bf95d9..306c80ce39e7aa71733eb6ad797e9541d57ac2de 100644 (file)
@@ -119,7 +119,7 @@ class TestSnapshots(CephFSTestCase):
             self.fs.rank_freeze(True, rank=1) # prevent failover...
             self.fs.rank_asok(['config', 'set', "mds_kill_mdstable_at", "{0}".format(i)], rank=0, status=status)
             proc = self.mount_a.run_shell(["mkdir", "d1/dir/.snap/s2{0}".format(i)], wait=False)
-            self.wait_until_true(lambda: "laggy_since" in self.fs.get_rank(rank=0), timeout=grace*2);
+            self.wait_until_true(lambda: "laggy_since" in self.fs.get_rank(rank=0), timeout=grace*3);
             self.delete_mds_coredump(rank0['name']);
 
             self.fs.rank_signal(signal.SIGKILL, rank=1)
index f5dc9fa5588fb094a8aeb2f6d396cd2b5583da6e..383c7d54e6f9ba8d6ea097000bb32a3413ed1fdc 100644 (file)
@@ -610,17 +610,20 @@ class TestSubvolumeGroups(TestVolumesHelper):
         expected_mode2 = "777"
 
         # create group
-        self._fs_cmd("subvolumegroup", "create", self.volname, group1)
         self._fs_cmd("subvolumegroup", "create", self.volname, group2, f"--mode={expected_mode2}")
+        self._fs_cmd("subvolumegroup", "create", self.volname, group1)
 
         group1_path = self._get_subvolume_group_path(self.volname, group1)
         group2_path = self._get_subvolume_group_path(self.volname, group2)
+        volumes_path = os.path.dirname(group1_path)
 
         # check group's mode
         actual_mode1 = self.mount_a.run_shell(['stat', '-c' '%a', group1_path]).stdout.getvalue().strip()
         actual_mode2 = self.mount_a.run_shell(['stat', '-c' '%a', group2_path]).stdout.getvalue().strip()
+        actual_mode3 = self.mount_a.run_shell(['stat', '-c' '%a', volumes_path]).stdout.getvalue().strip()
         self.assertEqual(actual_mode1, expected_mode1)
         self.assertEqual(actual_mode2, expected_mode2)
+        self.assertEqual(actual_mode3, expected_mode1)
 
         self._fs_cmd("subvolumegroup", "rm", self.volname, group1)
         self._fs_cmd("subvolumegroup", "rm", self.volname, group2)
@@ -921,6 +924,36 @@ class TestSubvolumes(TestVolumesHelper):
         # verify trash dir is clean
         self._wait_for_trash_empty()
 
+    def test_subvolume_create_with_desired_mode(self):
+        subvol1 = self._generate_random_subvolume_name()
+
+        # default mode
+        default_mode = "755"
+        # desired mode
+        desired_mode = "777"
+
+        self._fs_cmd("subvolume", "create", self.volname, subvol1,  "--mode", "777")
+
+        subvol1_path = self._get_subvolume_path(self.volname, subvol1)
+
+        # check subvolumegroup's mode
+        subvol_par_path = os.path.dirname(subvol1_path)
+        group_path = os.path.dirname(subvol_par_path)
+        actual_mode1 = self.mount_a.run_shell(['stat', '-c' '%a', group_path]).stdout.getvalue().strip()
+        self.assertEqual(actual_mode1, default_mode)
+        # check /volumes mode
+        volumes_path = os.path.dirname(group_path)
+        actual_mode2 = self.mount_a.run_shell(['stat', '-c' '%a', volumes_path]).stdout.getvalue().strip()
+        self.assertEqual(actual_mode2, default_mode)
+        # check subvolume's  mode
+        actual_mode3 = self.mount_a.run_shell(['stat', '-c' '%a', subvol1_path]).stdout.getvalue().strip()
+        self.assertEqual(actual_mode3, desired_mode)
+
+        self._fs_cmd("subvolume", "rm", self.volname, subvol1)
+
+        # verify trash dir is clean
+        self._wait_for_trash_empty()
+
     def test_subvolume_create_with_desired_mode_in_group(self):
         subvol1, subvol2, subvol3 = self._generate_random_subvolume_name(3)
 
index 42c01aaea0342e92d8d2020b5470c2ac89bf64e9..9602a5a7f9711ea93a1dac9030668c9419743512 100644 (file)
@@ -54,6 +54,8 @@ class CephFSMirror(Task):
             '--id',
             self.client_id,
             ])
+        if 'run_in_foreground' in self.config:
+            args.extend(['--foreground'])
 
         self.ctx.daemons.add_daemon(
             self.remote, 'cephfs-mirror', self.client,
diff --git a/ceph/qa/tasks/cephfs_mirror_thrash.py b/ceph/qa/tasks/cephfs_mirror_thrash.py
new file mode 100644 (file)
index 0000000..91f60ac
--- /dev/null
@@ -0,0 +1,219 @@
+"""
+Task for thrashing cephfs-mirror daemons
+"""
+
+import contextlib
+import logging
+import random
+import signal
+import socket
+import time
+
+from gevent import sleep
+from gevent.greenlet import Greenlet
+from gevent.event import Event
+
+from teuthology.exceptions import CommandFailedError
+from teuthology.orchestra import run
+from tasks.thrasher import Thrasher
+
+log = logging.getLogger(__name__)
+
+
+class CephFSMirrorThrasher(Thrasher, Greenlet):
+    """
+    CephFSMirrorThrasher::
+
+    The CephFSMirrorThrasher thrashes cephfs-mirror daemons during execution of other
+    tasks (workunits, etc).
+
+    The config is optional.  Many of the config parameters are a maximum value
+    to use when selecting a random value from a range.  The config is a dict
+    containing some or all of:
+
+    cluster: [default: ceph] cluster to thrash
+
+    max_thrash: [default: 1] the maximum number of active cephfs-mirror daemons per
+      cluster will be thrashed at any given time.
+
+    min_thrash_delay: [default: 60] minimum number of seconds to delay before
+      thrashing again.
+
+    max_thrash_delay: [default: 120] maximum number of seconds to delay before
+      thrashing again.
+
+    max_revive_delay: [default: 10] maximum number of seconds to delay before
+      bringing back a thrashed cephfs-mirror daemon.
+
+    randomize: [default: true] enables randomization and use the max/min values
+
+    seed: [no default] seed the random number generator
+
+    Examples::
+
+      The following example disables randomization, and uses the max delay
+      values:
+
+      tasks:
+      - ceph:
+      - cephfs_mirror_thrash:
+          randomize: False
+          max_thrash_delay: 10
+    """
+
+    def __init__(self, ctx, config, cluster, daemons):
+        super(CephFSMirrorThrasher, self).__init__()
+
+        self.ctx = ctx
+        self.config = config
+        self.cluster = cluster
+        self.daemons = daemons
+
+        self.logger = log
+        self.name = 'thrasher.cephfs_mirror.[{cluster}]'.format(cluster = cluster)
+        self.stopping = Event()
+
+        self.randomize = bool(self.config.get('randomize', True))
+        self.max_thrash = int(self.config.get('max_thrash', 1))
+        self.min_thrash_delay = float(self.config.get('min_thrash_delay', 5.0))
+        self.max_thrash_delay = float(self.config.get('max_thrash_delay', 10))
+        self.max_revive_delay = float(self.config.get('max_revive_delay', 15.0))
+
+    def _run(self):
+        try:
+            self.do_thrash()
+        except Exception as e:
+            # See _run exception comment for MDSThrasher
+            self.set_thrasher_exception(e)
+            self.logger.exception("exception:")
+            # Allow successful completion so gevent doesn't see an exception.
+            # The DaemonWatchdog will observe the error and tear down the test.
+
+    def log(self, x):
+        """Write data to logger assigned to this CephFSMirrorThrasher"""
+        self.logger.info(x)
+
+    def stop(self):
+        self.stopping.set()
+
+    def do_thrash(self):
+        """
+        Perform the random thrashing action
+        """
+
+        self.log('starting thrash for cluster {cluster}'.format(cluster=self.cluster))
+        stats = {
+            "kill": 0,
+        }
+
+        while not self.stopping.is_set():
+            delay = self.max_thrash_delay
+            if self.randomize:
+                delay = random.randrange(self.min_thrash_delay, self.max_thrash_delay)
+
+            if delay > 0.0:
+                self.log('waiting for {delay} secs before thrashing'.format(delay=delay))
+                self.stopping.wait(delay)
+                if self.stopping.is_set():
+                    continue
+
+            killed_daemons = []
+
+            weight = 1.0 / len(self.daemons)
+            count = 0
+            for daemon in self.daemons:
+                skip = random.uniform(0.0, 1.0)
+                if weight <= skip:
+                    self.log('skipping daemon {label} with skip ({skip}) > weight ({weight})'.format(
+                        label=daemon.id_, skip=skip, weight=weight))
+                    continue
+
+                self.log('kill {label}'.format(label=daemon.id_))
+                try:
+                    daemon.signal(signal.SIGTERM)
+                except Exception as e:
+                    self.log(f'exception when stopping mirror daemon: {e}')
+                else:
+                    killed_daemons.append(daemon)
+                    stats['kill'] += 1
+
+                # if we've reached max_thrash, we're done
+                count += 1
+                if count >= self.max_thrash:
+                    break
+
+            if killed_daemons:
+                # wait for a while before restarting
+                delay = self.max_revive_delay
+                if self.randomize:
+                    delay = random.randrange(0.0, self.max_revive_delay)
+
+                self.log('waiting for {delay} secs before reviving daemons'.format(delay=delay))
+                sleep(delay)
+
+                for daemon in killed_daemons:
+                    self.log('waiting for {label}'.format(label=daemon.id_))
+                    try:
+                        run.wait([daemon.proc], timeout=600)
+                    except CommandFailedError:
+                        pass
+                    except:
+                        self.log('Failed to stop {label}'.format(label=daemon.id_))
+
+                        try:
+                            # try to capture a core dump
+                            daemon.signal(signal.SIGABRT)
+                        except socket.error:
+                            pass
+                        raise
+                    finally:
+                        daemon.reset()
+
+                for daemon in killed_daemons:
+                    self.log('reviving {label}'.format(label=daemon.id_))
+                    daemon.start()
+
+        for stat in stats:
+            self.log("stat['{key}'] = {value}".format(key = stat, value = stats[stat]))
+
+@contextlib.contextmanager
+def task(ctx, config):
+    """
+    Stress test the cephfs-mirror by thrashing while another task/workunit
+    is running.
+
+    Please refer to CephFSMirrorThrasher class for further information on the
+    available options.
+    """
+    if config is None:
+        config = {}
+    assert isinstance(config, dict), \
+        'cephfs_mirror_thrash task only accepts a dict for configuration'
+
+    cluster = config.get('cluster', 'ceph')
+    daemons = list(ctx.daemons.iter_daemons_of_role('cephfs-mirror', cluster))
+    assert len(daemons) > 0, \
+        'cephfs_mirror_thrash task requires at least 1 cephfs-mirror daemon'
+
+    # choose random seed
+    if 'seed' in config:
+        seed = int(config['seed'])
+    else:
+        seed = int(time.time())
+    log.info('cephfs_mirror_thrash using random seed: {seed}'.format(seed=seed))
+    random.seed(seed)
+
+    thrasher = CephFSMirrorThrasher(ctx, config, cluster, daemons)
+    thrasher.start()
+    ctx.ceph[cluster].thrashers.append(thrasher)
+
+    try:
+        log.debug('Yielding')
+        yield
+    finally:
+        log.info('joining cephfs_mirror_thrash')
+        thrasher.stop()
+        if thrasher.exception is not None:
+            raise RuntimeError('error during thrashing')
+        thrasher.join()
+        log.info('done joining')
index fd17f4832b71aaff01ac7393ec7ac6251f4bfe0b..a445a146fe2e02ea28b9a36bec28e0c0cd27c682 100644 (file)
@@ -71,7 +71,7 @@ def task(ctx, config):
                 args=[
                     'mkdir', '--', client_dir,
                     run.Raw('&&'),
-                    'virtualenv', '{tdir}/virtualenv'.format(tdir=testdir),
+                    'python3', '-m', 'venv', '{tdir}/virtualenv'.format(tdir=testdir),
                     run.Raw('&&'),
                     '{tdir}/virtualenv/bin/pip'.format(tdir=testdir),
                     'install', 'cram==0.6',
diff --git a/ceph/qa/tasks/ec_inconsistent_hinfo.py b/ceph/qa/tasks/ec_inconsistent_hinfo.py
new file mode 100644 (file)
index 0000000..fa10f2c
--- /dev/null
@@ -0,0 +1,225 @@
+"""
+Inconsistent_hinfo
+"""
+import logging
+import time
+from dateutil.parser import parse
+from tasks import ceph_manager
+from tasks.util.rados import rados
+from teuthology import misc as teuthology
+
+log = logging.getLogger(__name__)
+
+def wait_for_deep_scrub_complete(manager, pgid, check_time_now, inconsistent):
+    log.debug("waiting for pg %s deep-scrub complete (check_time_now=%s)" %
+              (pgid, check_time_now))
+    for i in range(300):
+        time.sleep(5)
+        manager.flush_pg_stats([0, 1, 2, 3])
+        pgs = manager.get_pg_stats()
+        pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+        log.debug('pg=%s' % pg);
+        assert pg
+
+        last_deep_scrub_time = parse(pg['last_deep_scrub_stamp']).strftime('%s')
+        if last_deep_scrub_time < check_time_now:
+            log.debug('not scrubbed')
+            continue
+
+        status = pg['state'].split('+')
+        if inconsistent:
+            assert 'inconsistent' in status
+        else:
+            assert 'inconsistent' not in status
+        return
+
+    assert False, 'not scrubbed'
+
+
+def wait_for_backfilling_complete(manager, pgid, from_osd, to_osd):
+    log.debug("waiting for pg %s backfill from osd.%s to osd.%s complete" %
+              (pgid, from_osd, to_osd))
+    for i in range(300):
+        time.sleep(5)
+        manager.flush_pg_stats([0, 1, 2, 3])
+        pgs = manager.get_pg_stats()
+        pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+        log.info('pg=%s' % pg);
+        assert pg
+        status = pg['state'].split('+')
+        if 'active' not in status:
+            log.debug('not active')
+            continue
+        if 'backfilling' in status:
+            assert from_osd in pg['acting'] and to_osd in pg['up']
+            log.debug('backfilling')
+            continue
+        if to_osd not in pg['up']:
+            log.debug('backfill not started yet')
+            continue
+        log.debug('backfilled!')
+        break
+
+def task(ctx, config):
+    """
+    Test handling of objects with inconsistent hash info during backfill and deep-scrub.
+
+    A pretty rigid cluster is brought up and tested by this task
+    """
+    if config is None:
+        config = {}
+    assert isinstance(config, dict), \
+        'ec_inconsistent_hinfo task only accepts a dict for configuration'
+    first_mon = teuthology.get_first_mon(ctx, config)
+    (mon,) = ctx.cluster.only(first_mon).remotes.keys()
+
+    manager = ceph_manager.CephManager(
+        mon,
+        ctx=ctx,
+        logger=log.getChild('ceph_manager'),
+        )
+
+    profile = config.get('erasure_code_profile', {
+        'k': '2',
+        'm': '1',
+        'crush-failure-domain': 'osd'
+    })
+    profile_name = profile.get('name', 'backfill_unfound')
+    manager.create_erasure_code_profile(profile_name, profile)
+    pool = manager.create_pool_with_unique_name(
+        pg_num=1,
+        erasure_code_profile_name=profile_name,
+        min_size=2)
+    manager.raw_cluster_cmd('osd', 'pool', 'set', pool,
+                            'pg_autoscale_mode', 'off')
+
+    manager.flush_pg_stats([0, 1, 2, 3])
+    manager.wait_for_clean()
+
+    pool_id = manager.get_pool_num(pool)
+    pgid = '%d.0' % pool_id
+    pgs = manager.get_pg_stats()
+    acting = next((pg['acting'] for pg in pgs if pg['pgid'] == pgid), None)
+    log.info("acting=%s" % acting)
+    assert acting
+    primary = acting[0]
+
+    # something that is always there, readable and never empty
+    dummyfile = '/etc/group'
+
+    # kludge to make sure they get a map
+    rados(ctx, mon, ['-p', pool, 'put', 'dummy', dummyfile])
+
+    manager.flush_pg_stats([0, 1])
+    manager.wait_for_recovery()
+
+    log.debug("create test object")
+    obj = 'test'
+    rados(ctx, mon, ['-p', pool, 'put', obj, dummyfile])
+
+    victim = acting[1]
+
+    log.info("remove test object hash info from osd.%s shard and test deep-scrub and repair"
+             % victim)
+
+    manager.objectstore_tool(pool, options='', args='rm-attr hinfo_key',
+                             object_name=obj, osd=victim)
+    check_time_now = time.strftime('%s')
+    manager.raw_cluster_cmd('pg', 'deep-scrub', pgid)
+    wait_for_deep_scrub_complete(manager, pgid, check_time_now, True)
+
+    check_time_now = time.strftime('%s')
+    manager.raw_cluster_cmd('pg', 'repair', pgid)
+    wait_for_deep_scrub_complete(manager, pgid, check_time_now, False)
+
+    log.info("remove test object hash info from primary osd.%s shard and test backfill"
+             % primary)
+
+    log.debug("write some data")
+    rados(ctx, mon, ['-p', pool, 'bench', '30', 'write', '-b', '4096',
+                     '--no-cleanup'])
+
+    manager.objectstore_tool(pool, options='', args='rm-attr hinfo_key',
+                             object_name=obj, osd=primary)
+
+    # mark the osd out to trigger a rebalance/backfill
+    source = acting[1]
+    target = [x for x in [0, 1, 2, 3] if x not in acting][0]
+    manager.mark_out_osd(source)
+
+    # wait for everything to peer, backfill and recover
+    wait_for_backfilling_complete(manager, pgid, source, target)
+    manager.wait_for_clean()
+
+    manager.flush_pg_stats([0, 1, 2, 3])
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug('pg=%s' % pg)
+    assert pg
+    assert 'clean' in pg['state'].split('+')
+    assert 'inconsistent' not in pg['state'].split('+')
+    unfound = manager.get_num_unfound_objects()
+    log.debug("there are %d unfound objects" % unfound)
+    assert unfound == 0
+
+    source, target = target, source
+    log.info("remove test object hash info from non-primary osd.%s shard and test backfill"
+             % source)
+
+    manager.objectstore_tool(pool, options='', args='rm-attr hinfo_key',
+                             object_name=obj, osd=source)
+
+    # mark the osd in to trigger a rebalance/backfill
+    manager.mark_in_osd(target)
+
+    # wait for everything to peer, backfill and recover
+    wait_for_backfilling_complete(manager, pgid, source, target)
+    manager.wait_for_clean()
+
+    manager.flush_pg_stats([0, 1, 2, 3])
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug('pg=%s' % pg)
+    assert pg
+    assert 'clean' in pg['state'].split('+')
+    assert 'inconsistent' not in pg['state'].split('+')
+    unfound = manager.get_num_unfound_objects()
+    log.debug("there are %d unfound objects" % unfound)
+    assert unfound == 0
+
+    log.info("remove hash info from two shards and test backfill")
+
+    source = acting[2]
+    target = [x for x in [0, 1, 2, 3] if x not in acting][0]
+    manager.objectstore_tool(pool, options='', args='rm-attr hinfo_key',
+                             object_name=obj, osd=primary)
+    manager.objectstore_tool(pool, options='', args='rm-attr hinfo_key',
+                             object_name=obj, osd=source)
+
+    # mark the osd out to trigger a rebalance/backfill
+    manager.mark_out_osd(source)
+
+    # wait for everything to peer, backfill and detect unfound object
+    wait_for_backfilling_complete(manager, pgid, source, target)
+
+    # verify that there is unfound object
+    manager.flush_pg_stats([0, 1, 2, 3])
+    pgs = manager.get_pg_stats()
+    pg = next((pg for pg in pgs if pg['pgid'] == pgid), None)
+    log.debug('pg=%s' % pg)
+    assert pg
+    assert 'backfill_unfound' in pg['state'].split('+')
+    unfound = manager.get_num_unfound_objects()
+    log.debug("there are %d unfound objects" % unfound)
+    assert unfound == 1
+    m = manager.list_pg_unfound(pgid)
+    log.debug('list_pg_unfound=%s' % m)
+    assert m['num_unfound'] == pg['stat_sum']['num_objects_unfound']
+
+    # mark stuff lost
+    pgs = manager.get_pg_stats()
+    manager.raw_cluster_cmd('pg', pgid, 'mark_unfound_lost', 'delete')
+
+    # wait for everything to peer and be happy...
+    manager.flush_pg_stats([0, 1, 2, 3])
+    manager.wait_for_recovery()
index 71d7b22e814620e168dcb0e04d6bd9beb0871d12..f7a9330e29b50541e97bac6ff3aea3601ba2c9f8 100644 (file)
@@ -9,6 +9,74 @@ from tasks.cephfs.filesystem import Filesystem, MDSCluster
 
 log = logging.getLogger(__name__)
 
+# Everything up to CEPH_MDSMAP_ALLOW_STANDBY_REPLAY
+CEPH_MDSMAP_ALLOW_STANDBY_REPLAY = (1<<5)
+CEPH_MDSMAP_LAST = CEPH_MDSMAP_ALLOW_STANDBY_REPLAY
+UPGRADE_FLAGS_MASK = ((CEPH_MDSMAP_LAST<<1) - 1)
+def pre_upgrade_save(ctx, config):
+    """
+    That the upgrade procedure doesn't clobber state: save state.
+    """
+
+    mdsc = MDSCluster(ctx)
+    status = mdsc.status()
+
+    state = {}
+    ctx['mds-upgrade-state'] = state
+
+    for fs in list(status.get_filesystems()):
+        fscid = fs['id']
+        mdsmap = fs['mdsmap']
+        fs_state = {}
+        fs_state['epoch'] = mdsmap['epoch']
+        fs_state['max_mds'] = mdsmap['max_mds']
+        fs_state['flags'] = mdsmap['flags'] & UPGRADE_FLAGS_MASK
+        state[fscid] = fs_state
+        log.debug(f"fs fscid={fscid},name={mdsmap['fs_name']} state = {fs_state}")
+
+
+def post_upgrade_checks(ctx, config):
+    """
+    That the upgrade procedure doesn't clobber state.
+    """
+
+    state = ctx['mds-upgrade-state']
+
+    mdsc = MDSCluster(ctx)
+    status = mdsc.status()
+
+    for fs in list(status.get_filesystems()):
+        fscid = fs['id']
+        mdsmap = fs['mdsmap']
+        fs_state = state[fscid]
+        log.debug(f"checking fs fscid={fscid},name={mdsmap['fs_name']} state = {fs_state}")
+
+        # check state was restored to previous values
+        assert fs_state['max_mds'] == mdsmap['max_mds']
+        assert fs_state['flags'] == (mdsmap['flags'] & UPGRADE_FLAGS_MASK)
+
+        # now confirm that the upgrade procedure was followed
+        epoch = mdsmap['epoch']
+        pre_upgrade_epoch = fs_state['epoch']
+        assert pre_upgrade_epoch < epoch
+        should_decrease_max_mds = fs_state['max_mds'] > 1
+        did_decrease_max_mds = False
+        should_disable_allow_standby_replay = fs_state['flags'] & CEPH_MDSMAP_ALLOW_STANDBY_REPLAY
+        did_disable_allow_standby_replay = False
+        for i in range(pre_upgrade_epoch+1, mdsmap['epoch']):
+            old_status = mdsc.status(epoch=i)
+            old_fs = old_status.get_fsmap(fscid)
+            old_mdsmap = old_fs['mdsmap']
+            if should_decrease_max_mds and old_mdsmap['max_mds'] == 1:
+                log.debug(f"max_mds reduced in epoch {i}")
+                did_decrease_max_mds = True
+            if should_disable_allow_standby_replay and not (old_mdsmap['flags'] & CEPH_MDSMAP_ALLOW_STANDBY_REPLAY):
+                log.debug(f"allow_standby_replay disabled in epoch {i}")
+                did_disable_allow_standby_replay = True
+        assert not should_decrease_max_mds or did_decrease_max_mds
+        assert not should_disable_allow_standby_replay or did_disable_allow_standby_replay
+
+
 def ready(ctx, config):
     """
     That the file system is ready for clients.
index c870bbae86f00f9bdb9ce1914b11113c334097cd..2b967f5569f5f380f3edf3e0a9bde6061e4cd944 100644 (file)
@@ -54,6 +54,32 @@ def preflight(ctx, config):
             wait=False,
         )
     )
+
+    # set docker cgroup driver = systemd
+    #  see https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker
+    #  see https://github.com/kubernetes/kubeadm/issues/2066
+    daemon_json = """
+{
+  "exec-opts": ["native.cgroupdriver=systemd"],
+  "log-driver": "json-file",
+  "log-opts": {
+    "max-size": "100m"
+  },
+  "storage-driver": "overlay2"
+}
+"""
+    for remote in ctx.cluster.remotes.keys():
+        remote.write_file('/etc/docker/daemon.json', daemon_json, sudo=True)
+    run.wait(
+        ctx.cluster.run(
+            args=[
+                'sudo', 'systemctl', 'restart', 'docker',
+                run.Raw('||'),
+                'true',
+            ],
+            wait=False,
+        )
+    )
     yield
 
 
index c066be5f49e36971c9488f03d3042a0bda257e97..2b022e02495e6d0eac4bdb3ba16fa0d7c71cc5cd 100644 (file)
@@ -1 +1 @@
-DEFAULT_VERSION = '1.0'
+DEFAULT_API_VERSION = '1.0'
index 2b6bedc948a37cf8c4d831f97a3e1137bc317073..2c6efa9015aaa175926a819146877a489eccbc24 100644 (file)
@@ -16,7 +16,7 @@ from tasks.mgr.mgr_test_case import MgrTestCase
 from teuthology.exceptions import \
     CommandFailedError  # pylint: disable=import-error
 
-from . import DEFAULT_VERSION
+from . import DEFAULT_API_VERSION
 
 log = logging.getLogger(__name__)
 
@@ -276,7 +276,7 @@ class DashboardTestCase(MgrTestCase):
 
     # pylint: disable=inconsistent-return-statements, too-many-arguments, too-many-branches
     @classmethod
-    def _request(cls, url, method, data=None, params=None, version=DEFAULT_VERSION,
+    def _request(cls, url, method, data=None, params=None, version=DEFAULT_API_VERSION,
                  set_cookies=False):
         url = "{}{}".format(cls._base_uri, url)
         log.debug("Request %s to %s", method, url)
@@ -336,7 +336,7 @@ class DashboardTestCase(MgrTestCase):
             raise ex
 
     @classmethod
-    def _get(cls, url, params=None, version=DEFAULT_VERSION, set_cookies=False):
+    def _get(cls, url, params=None, version=DEFAULT_API_VERSION, set_cookies=False):
         return cls._request(url, 'GET', params=params, version=version, set_cookies=set_cookies)
 
     @classmethod
@@ -344,7 +344,7 @@ class DashboardTestCase(MgrTestCase):
         retry = True
         while retry and retries > 0:
             retry = False
-            res = cls._get(url, version=DEFAULT_VERSION)
+            res = cls._get(url, version=DEFAULT_API_VERSION)
             if isinstance(res, dict):
                 res = [res]
             for view in res:
@@ -358,15 +358,15 @@ class DashboardTestCase(MgrTestCase):
         return res
 
     @classmethod
-    def _post(cls, url, data=None, params=None, version=DEFAULT_VERSION, set_cookies=False):
+    def _post(cls, url, data=None, params=None, version=DEFAULT_API_VERSION, set_cookies=False):
         cls._request(url, 'POST', data, params, version=version, set_cookies=set_cookies)
 
     @classmethod
-    def _delete(cls, url, data=None, params=None, version=DEFAULT_VERSION, set_cookies=False):
+    def _delete(cls, url, data=None, params=None, version=DEFAULT_API_VERSION, set_cookies=False):
         cls._request(url, 'DELETE', data, params, version=version, set_cookies=set_cookies)
 
     @classmethod
-    def _put(cls, url, data=None, params=None, version=DEFAULT_VERSION, set_cookies=False):
+    def _put(cls, url, data=None, params=None, version=DEFAULT_API_VERSION, set_cookies=False):
         cls._request(url, 'PUT', data, params, version=version, set_cookies=set_cookies)
 
     @classmethod
@@ -386,7 +386,8 @@ class DashboardTestCase(MgrTestCase):
 
     # pylint: disable=too-many-arguments
     @classmethod
-    def _task_request(cls, method, url, data, timeout, version=DEFAULT_VERSION, set_cookies=False):
+    def _task_request(cls, method, url, data, timeout, version=DEFAULT_API_VERSION,
+                      set_cookies=False):
         res = cls._request(url, method, data, version=version, set_cookies=set_cookies)
         cls._assertIn(cls._resp.status_code, [200, 201, 202, 204, 400, 403, 404])
 
@@ -438,17 +439,17 @@ class DashboardTestCase(MgrTestCase):
         return res_task['exception']
 
     @classmethod
-    def _task_post(cls, url, data=None, timeout=60, version=DEFAULT_VERSION, set_cookies=False):
+    def _task_post(cls, url, data=None, timeout=60, version=DEFAULT_API_VERSION, set_cookies=False):
         return cls._task_request('POST', url, data, timeout, version=version,
                                  set_cookies=set_cookies)
 
     @classmethod
-    def _task_delete(cls, url, timeout=60, version=DEFAULT_VERSION, set_cookies=False):
+    def _task_delete(cls, url, timeout=60, version=DEFAULT_API_VERSION, set_cookies=False):
         return cls._task_request('DELETE', url, None, timeout, version=version,
                                  set_cookies=set_cookies)
 
     @classmethod
-    def _task_put(cls, url, data=None, timeout=60, version=DEFAULT_VERSION, set_cookies=False):
+    def _task_put(cls, url, data=None, timeout=60, version=DEFAULT_API_VERSION, set_cookies=False):
         return cls._task_request('PUT', url, data, timeout, version=version,
                                  set_cookies=set_cookies)
 
index 2fe1a78be54843aac167dd9f897cf1fbc4f55e63..22f23569874d54eb4590616ddf0085b62709e1e1 100644 (file)
@@ -4,14 +4,14 @@ from __future__ import absolute_import
 
 import unittest
 
-from . import DEFAULT_VERSION
+from . import DEFAULT_API_VERSION
 from .helper import DashboardTestCase
 
 
 class VersionReqTest(DashboardTestCase, unittest.TestCase):
     def test_version(self):
         for (version, expected_status) in [
-                (DEFAULT_VERSION, 200),
+                (DEFAULT_API_VERSION, 200),
                 (None, 415),
                 ("99.99", 415)
         ]:
index 8fc7cd1992e6dce79511411b91d1b6f9fafb479f..a2266229bef7fd0055d89320c1b9aae14057b291 100644 (file)
@@ -154,7 +154,7 @@ class AuthTest(DashboardTestCase):
         self.assertJsonBody({
             "redirect_url": "#/login"
         })
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
         self.set_jwt_token(None)
 
@@ -169,7 +169,7 @@ class AuthTest(DashboardTestCase):
         self.assertJsonBody({
             "redirect_url": "#/login"
         })
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
         self.set_jwt_token(None)
 
@@ -179,10 +179,10 @@ class AuthTest(DashboardTestCase):
         self._post("/api/auth", {'username': 'admin', 'password': 'admin'})
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(200)
         time.sleep(6)
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
         self._ceph_cmd(['dashboard', 'set-jwt-token-ttl', '28800'])
         self.set_jwt_token(None)
@@ -192,10 +192,10 @@ class AuthTest(DashboardTestCase):
         self._post("/api/auth", {'username': 'admin', 'password': 'admin'}, set_cookies=True)
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(200)
         time.sleep(6)
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
         self._ceph_cmd(['dashboard', 'set-jwt-token-ttl', '28800'])
         self.set_jwt_token(None)
@@ -209,7 +209,7 @@ class AuthTest(DashboardTestCase):
         # the following call adds the token to the blocklist
         self._post("/api/auth/logout")
         self.assertStatus(200)
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
         time.sleep(6)
         self._ceph_cmd(['dashboard', 'set-jwt-token-ttl', '28800'])
@@ -229,7 +229,7 @@ class AuthTest(DashboardTestCase):
         # the following call adds the token to the blocklist
         self._post("/api/auth/logout", set_cookies=True)
         self.assertStatus(200)
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
         time.sleep(6)
         self._ceph_cmd(['dashboard', 'set-jwt-token-ttl', '28800'])
@@ -243,61 +243,61 @@ class AuthTest(DashboardTestCase):
 
     def test_unauthorized(self):
         # test with Authorization header
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
 
         # test with Cookies set
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
 
     def test_invalidate_token_by_admin(self):
         # test with Authorization header
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
         self.create_user('user', 'user', ['read-only'])
         time.sleep(1)
         self._post("/api/auth", {'username': 'user', 'password': 'user'})
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(200)
         time.sleep(1)
         self._ceph_cmd_with_secret(['dashboard', 'ac-user-set-password', '--force-password',
                                     'user'],
                                    'user2')
         time.sleep(1)
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(401)
         self.set_jwt_token(None)
         self._post("/api/auth", {'username': 'user', 'password': 'user2'})
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host")
+        self._get("/api/host", version='1.1')
         self.assertStatus(200)
         self.delete_user("user")
 
         # test with Cookies set
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
         self.create_user('user', 'user', ['read-only'])
         time.sleep(1)
         self._post("/api/auth", {'username': 'user', 'password': 'user'}, set_cookies=True)
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(200)
         time.sleep(1)
         self._ceph_cmd_with_secret(['dashboard', 'ac-user-set-password', '--force-password',
                                     'user'],
                                    'user2')
         time.sleep(1)
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(401)
         self.set_jwt_token(None)
         self._post("/api/auth", {'username': 'user', 'password': 'user2'}, set_cookies=True)
         self.assertStatus(201)
         self.set_jwt_token(self.jsonBody()['token'])
-        self._get("/api/host", set_cookies=True)
+        self._get("/api/host", set_cookies=True, version='1.1')
         self.assertStatus(200)
         self.delete_user("user")
 
@@ -335,7 +335,8 @@ class AuthTest(DashboardTestCase):
         self.assertStatus(200)
         data = self.jsonBody()
         self.assertSchema(data, JObj(sub_elems={
-            "login_url": JLeaf(str)
+            "login_url": JLeaf(str),
+            "cluster_status": JLeaf(str)
         }, allow_unknown=False))
         self.logout()
 
@@ -345,6 +346,7 @@ class AuthTest(DashboardTestCase):
         self.assertStatus(200)
         data = self.jsonBody()
         self.assertSchema(data, JObj(sub_elems={
-            "login_url": JLeaf(str)
+            "login_url": JLeaf(str),
+            "cluster_status": JLeaf(str)
         }, allow_unknown=False))
         self.logout(set_cookies=True)
diff --git a/ceph/qa/tasks/mgr/dashboard/test_cluster.py b/ceph/qa/tasks/mgr/dashboard/test_cluster.py
new file mode 100644 (file)
index 0000000..14f8542
--- /dev/null
@@ -0,0 +1,23 @@
+from .helper import DashboardTestCase, JLeaf, JObj
+
+
+class ClusterTest(DashboardTestCase):
+
+    def setUp(self):
+        super().setUp()
+        self.reset_session()
+
+    def test_get_status(self):
+        data = self._get('/api/cluster', version='0.1')
+        self.assertStatus(200)
+        self.assertSchema(data, JObj(sub_elems={
+            "status": JLeaf(str)
+        }, allow_unknown=False))
+
+    def test_update_status(self):
+        req = {'status': 'POST_INSTALLED'}
+        self._put('/api/cluster', req, version='0.1')
+        self.assertStatus(200)
+        data = self._get('/api/cluster', version='0.1')
+        self.assertStatus(200)
+        self.assertEqual(data, req)
diff --git a/ceph/qa/tasks/mgr/dashboard/test_ganesha.py b/ceph/qa/tasks/mgr/dashboard/test_ganesha.py
deleted file mode 100644 (file)
index 6868e0c..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-# -*- coding: utf-8 -*-
-# pylint: disable=too-many-public-methods
-
-from __future__ import absolute_import
-
-from .helper import DashboardTestCase, JList, JObj
-
-
-class GaneshaTest(DashboardTestCase):
-    CEPHFS = True
-    AUTH_ROLES = ['pool-manager', 'ganesha-manager']
-
-    @classmethod
-    def setUpClass(cls):
-        super(GaneshaTest, cls).setUpClass()
-        cls.create_pool('ganesha', 2**2, 'replicated')
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha1', 'create', 'conf-node1'])
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha1', 'create', 'conf-node2'])
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha1', 'create', 'conf-node3'])
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha2', 'create', 'conf-node1'])
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha2', 'create', 'conf-node2'])
-        cls._rados_cmd(['-p', 'ganesha', '-N', 'ganesha2', 'create', 'conf-node3'])
-        cls._ceph_cmd(['dashboard', 'set-ganesha-clusters-rados-pool-namespace',
-                       'cluster1:ganesha/ganesha1,cluster2:ganesha/ganesha2'])
-
-        # RGW setup
-        cls._radosgw_admin_cmd([
-            'user', 'create', '--uid', 'admin', '--display-name', 'admin',
-            '--system', '--access-key', 'admin', '--secret', 'admin'
-        ])
-        cls._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-secret-key'], 'admin')
-        cls._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-access-key'], 'admin')
-
-    @classmethod
-    def tearDownClass(cls):
-        super(GaneshaTest, cls).tearDownClass()
-        cls._radosgw_admin_cmd(['user', 'rm', '--uid', 'admin', '--purge-data'])
-        cls._ceph_cmd(['osd', 'pool', 'delete', 'ganesha', 'ganesha',
-                       '--yes-i-really-really-mean-it'])
-
-    @DashboardTestCase.RunAs('test', 'test', [{'rbd-image': ['create', 'update', 'delete']}])
-    def test_read_access_permissions(self):
-        self._get('/api/nfs-ganesha/export')
-        self.assertStatus(403)
-
-    def test_list_daemons(self):
-        daemons = self._get("/api/nfs-ganesha/daemon")
-        self.assertEqual(len(daemons), 6)
-        daemons = [(d['daemon_id'], d['cluster_id']) for d in daemons]
-        self.assertIn(('node1', 'cluster1'), daemons)
-        self.assertIn(('node2', 'cluster1'), daemons)
-        self.assertIn(('node3', 'cluster1'), daemons)
-        self.assertIn(('node1', 'cluster2'), daemons)
-        self.assertIn(('node2', 'cluster2'), daemons)
-        self.assertIn(('node3', 'cluster2'), daemons)
-
-    @classmethod
-    def create_export(cls, path, cluster_id, daemons, fsal, sec_label_xattr=None):
-        if fsal == 'CEPH':
-            fsal = {"name": "CEPH", "user_id": "admin", "fs_name": None,
-                    "sec_label_xattr": sec_label_xattr}
-            pseudo = "/cephfs{}".format(path)
-        else:
-            fsal = {"name": "RGW", "rgw_user_id": "admin"}
-            pseudo = "/rgw/{}".format(path if path[0] != '/' else "")
-        ex_json = {
-            "path": path,
-            "fsal": fsal,
-            "cluster_id": cluster_id,
-            "daemons": daemons,
-            "pseudo": pseudo,
-            "tag": None,
-            "access_type": "RW",
-            "squash": "no_root_squash",
-            "security_label": sec_label_xattr is not None,
-            "protocols": [4],
-            "transports": ["TCP"],
-            "clients": [{
-                "addresses": ["10.0.0.0/8"],
-                "access_type": "RO",
-                "squash": "root"
-            }]
-        }
-        return cls._task_post('/api/nfs-ganesha/export', ex_json)
-
-    def tearDown(self):
-        super(GaneshaTest, self).tearDown()
-        exports = self._get("/api/nfs-ganesha/export")
-        if self._resp.status_code != 200:
-            return
-        self.assertIsInstance(exports, list)
-        for exp in exports:
-            self._task_delete("/api/nfs-ganesha/export/{}/{}"
-                              .format(exp['cluster_id'], exp['export_id']))
-
-    def _test_create_export(self, cephfs_path):
-        exports = self._get("/api/nfs-ganesha/export")
-        self.assertEqual(len(exports), 0)
-
-        data = self.create_export(cephfs_path, 'cluster1', ['node1', 'node2'], 'CEPH',
-                                  "security.selinux")
-
-        exports = self._get("/api/nfs-ganesha/export")
-        self.assertEqual(len(exports), 1)
-        self.assertDictEqual(exports[0], data)
-        return data
-
-    def test_create_export(self):
-        self._test_create_export('/foo')
-
-    def test_create_export_for_cephfs_root(self):
-        self._test_create_export('/')
-
-    def test_update_export(self):
-        export = self._test_create_export('/foo')
-        export['access_type'] = 'RO'
-        export['daemons'] = ['node1', 'node3']
-        export['security_label'] = True
-        data = self._task_put('/api/nfs-ganesha/export/{}/{}'
-                              .format(export['cluster_id'], export['export_id']),
-                              export)
-        exports = self._get("/api/nfs-ganesha/export")
-        self.assertEqual(len(exports), 1)
-        self.assertDictEqual(exports[0], data)
-        self.assertEqual(exports[0]['daemons'], ['node1', 'node3'])
-        self.assertEqual(exports[0]['security_label'], True)
-
-    def test_delete_export(self):
-        export = self._test_create_export('/foo')
-        self._task_delete("/api/nfs-ganesha/export/{}/{}"
-                          .format(export['cluster_id'], export['export_id']))
-        self.assertStatus(204)
-
-    def test_get_export(self):
-        exports = self._get("/api/nfs-ganesha/export")
-        self.assertEqual(len(exports), 0)
-
-        data1 = self.create_export("/foo", 'cluster2', ['node1', 'node2'], 'CEPH')
-        data2 = self.create_export("mybucket", 'cluster2', ['node2', 'node3'], 'RGW')
-
-        export1 = self._get("/api/nfs-ganesha/export/cluster2/1")
-        self.assertDictEqual(export1, data1)
-
-        export2 = self._get("/api/nfs-ganesha/export/cluster2/2")
-        self.assertDictEqual(export2, data2)
-
-    def test_invalid_status(self):
-        self._ceph_cmd(['dashboard', 'set-ganesha-clusters-rados-pool-namespace', ''])
-
-        data = self._get('/api/nfs-ganesha/status')
-        self.assertStatus(200)
-        self.assertIn('available', data)
-        self.assertIn('message', data)
-        self.assertFalse(data['available'])
-        self.assertIn(("NFS-Ganesha cluster is not detected. "
-                       "Please set the GANESHA_RADOS_POOL_NAMESPACE "
-                       "setting or deploy an NFS-Ganesha cluster with the Orchestrator."),
-                      data['message'])
-
-        self._ceph_cmd(['dashboard', 'set-ganesha-clusters-rados-pool-namespace',
-                        'cluster1:ganesha/ganesha1,cluster2:ganesha/ganesha2'])
-
-    def test_valid_status(self):
-        data = self._get('/api/nfs-ganesha/status')
-        self.assertStatus(200)
-        self.assertIn('available', data)
-        self.assertIn('message', data)
-        self.assertTrue(data['available'])
-
-    def test_ganesha_fsals(self):
-        data = self._get('/ui-api/nfs-ganesha/fsals')
-        self.assertStatus(200)
-        self.assertIn('CEPH', data)
-
-    def test_ganesha_filesystems(self):
-        data = self._get('/ui-api/nfs-ganesha/cephfs/filesystems')
-        self.assertStatus(200)
-        self.assertSchema(data, JList(JObj({
-            'id': int,
-            'name': str
-        })))
-
-    def test_ganesha_lsdir(self):
-        fss = self._get('/ui-api/nfs-ganesha/cephfs/filesystems')
-        self.assertStatus(200)
-        for fs in fss:
-            data = self._get('/ui-api/nfs-ganesha/lsdir/{}'.format(fs['name']))
-            self.assertStatus(200)
-            self.assertSchema(data, JObj({'paths': JList(str)}))
-            self.assertEqual(data['paths'][0], '/')
-
-    def test_ganesha_buckets(self):
-        data = self._get('/ui-api/nfs-ganesha/rgw/buckets')
-        self.assertStatus(200)
-        schema = JList(str)
-        self.assertSchema(data, schema)
-
-    def test_ganesha_clusters(self):
-        data = self._get('/ui-api/nfs-ganesha/clusters')
-        self.assertStatus(200)
-        schema = JList(str)
-        self.assertSchema(data, schema)
-
-    def test_ganesha_cephx_clients(self):
-        data = self._get('/ui-api/nfs-ganesha/cephx/clients')
-        self.assertStatus(200)
-        schema = JList(str)
-        self.assertSchema(data, schema)
index 124fff8d1544f9d5b672af75b6115d09f2f3658c..78d784473f3caa79ac8f5d3d023a4544e0a64b83 100644 (file)
@@ -32,11 +32,11 @@ class HostControllerTest(DashboardTestCase):
 
     @DashboardTestCase.RunAs('test', 'test', ['block-manager'])
     def test_access_permissions(self):
-        self._get(self.URL_HOST)
+        self._get(self.URL_HOST, version='1.1')
         self.assertStatus(403)
 
     def test_host_list(self):
-        data = self._get(self.URL_HOST)
+        data = self._get(self.URL_HOST, version='1.1')
         self.assertStatus(200)
 
         orch_hostnames = {inventory_node['name'] for inventory_node in
@@ -65,14 +65,14 @@ class HostControllerTest(DashboardTestCase):
                 self.assertIn(server['hostname'], orch_hostnames)
 
     def test_host_list_with_sources(self):
-        data = self._get('{}?sources=orchestrator'.format(self.URL_HOST))
+        data = self._get('{}?sources=orchestrator'.format(self.URL_HOST), version='1.1')
         self.assertStatus(200)
         test_hostnames = {inventory_node['name'] for inventory_node in
                           self.ORCHESTRATOR_TEST_DATA['inventory']}
         resp_hostnames = {host['hostname'] for host in data}
         self.assertEqual(test_hostnames, resp_hostnames)
 
-        data = self._get('{}?sources=ceph'.format(self.URL_HOST))
+        data = self._get('{}?sources=ceph'.format(self.URL_HOST), version='1.1')
         self.assertStatus(200)
         test_hostnames = {inventory_node['name'] for inventory_node in
                           self.ORCHESTRATOR_TEST_DATA['inventory']}
@@ -80,7 +80,7 @@ class HostControllerTest(DashboardTestCase):
         self.assertEqual(len(test_hostnames.intersection(resp_hostnames)), 0)
 
     def test_host_devices(self):
-        hosts = self._get('{}'.format(self.URL_HOST))
+        hosts = self._get('{}'.format(self.URL_HOST), version='1.1')
         hosts = [host['hostname'] for host in hosts if host['hostname'] != '']
         assert hosts[0]
         data = self._get('{}/devices'.format('{}/{}'.format(self.URL_HOST, hosts[0])))
@@ -88,7 +88,7 @@ class HostControllerTest(DashboardTestCase):
         self.assertSchema(data, devices_schema)
 
     def test_host_daemons(self):
-        hosts = self._get('{}'.format(self.URL_HOST))
+        hosts = self._get('{}'.format(self.URL_HOST), version='1.1')
         hosts = [host['hostname'] for host in hosts if host['hostname'] != '']
         assert hosts[0]
         data = self._get('{}/daemons'.format('{}/{}'.format(self.URL_HOST, hosts[0])))
@@ -100,7 +100,7 @@ class HostControllerTest(DashboardTestCase):
         })))
 
     def test_host_smart(self):
-        hosts = self._get('{}'.format(self.URL_HOST))
+        hosts = self._get('{}'.format(self.URL_HOST), version='1.1')
         hosts = [host['hostname'] for host in hosts if host['hostname'] != '']
         assert hosts[0]
         self._get('{}/smart'.format('{}/{}'.format(self.URL_HOST, hosts[0])))
index cbf920b91897ba87601dd5621999ab2833b44cb7..055ba2b005ab269dc2fee2f4af4a72aab85e4b1d 100644 (file)
@@ -92,7 +92,7 @@ class PoolTest(DashboardTestCase):
                 self.assertEqual(pool[prop], int(value),
                                  '{}: {} != {}'.format(prop, pool[prop], value))
             elif prop == 'pg_num':
-                self._check_pg_num(value, pool)
+                self._check_pg_num(pool['pool_name'], int(value))
             elif prop == 'application_metadata':
                 self.assertIsInstance(pool[prop], list)
                 self.assertEqual(value, pool[prop])
@@ -117,10 +117,7 @@ class PoolTest(DashboardTestCase):
             else:
                 self.assertEqual(pool[prop], value, '{}: {} != {}'.format(prop, pool[prop], value))
 
-        self.wait_until_equal(self._get_health_status, 'HEALTH_OK', timeout)
-
-    def _get_health_status(self):
-        return self._get('/api/health/minimal')['health']['status']
+        self.wait_for_health_clear(timeout)
 
     def _get_pool(self, pool_name):
         pool = self._get("/api/pool/" + pool_name)
@@ -128,22 +125,24 @@ class PoolTest(DashboardTestCase):
         self.assertSchemaBody(self.pool_schema)
         return pool
 
-    def _check_pg_num(self, value, pool):
+    def _check_pg_num(self, pool_name, pg_num):
         """
         If both properties have not the same value, the cluster goes into a warning state, which
         will only happen during a pg update on an existing pool. The test that does that is
         currently commented out because our QA systems can't deal with the change. Feel free to test
         it locally.
         """
-        pgp_prop = 'pg_placement_num'
-        t = 0
-        while (int(value) != pool[pgp_prop] or self._get_health_status() != 'HEALTH_OK') \
-                and t < 180:
-            time.sleep(2)
-            t += 2
-            pool = self._get_pool(pool['pool_name'])
-        for p in ['pg_num', pgp_prop]:  # Should have the same values
-            self.assertEqual(pool[p], int(value), '{}: {} != {}'.format(p, pool[p], value))
+        self.wait_until_equal(
+            lambda: self._get_pool(pool_name)['pg_placement_num'],
+            expect_val=pg_num,
+            timeout=180
+        )
+
+        pool = self._get_pool(pool_name)
+
+        for prop in ['pg_num', 'pg_placement_num']:
+            self.assertEqual(pool[prop], int(pg_num),
+                             '{}: {} != {}'.format(prop, pool[prop], pg_num))
 
     @DashboardTestCase.RunAs('test', 'test', [{'pool': ['create', 'update', 'delete']}])
     def test_read_access_permissions(self):
index 93b175bfda0ea635248d1a3f921fdc2dc7144684..0d7fb75adc8edfbcc34ec3029b93e26614d8c27a 100644 (file)
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 
-from . import DEFAULT_VERSION
+from . import DEFAULT_API_VERSION
 from .helper import DashboardTestCase
 
 
@@ -11,7 +11,7 @@ class RequestsTest(DashboardTestCase):
         self._get('/api/summary')
         self.assertHeaders({
             'Content-Encoding': 'gzip',
-            'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION)
+            'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_API_VERSION)
         })
 
     def test_force_no_gzip(self):
@@ -27,7 +27,7 @@ class RequestsTest(DashboardTestCase):
         self._get('/api/summary')
         self.assertHeaders({
             'server': 'Ceph-Dashboard',
-            'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION),
+            'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_API_VERSION),
             'Content-Security-Policy': "frame-ancestors 'self';",
             'X-Content-Type-Options': 'nosniff',
             'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload'
index 1bfb995065968c866d06f3b94bf09d59f530ef3d..dc972d3ed0a4158f508c757fa68d179d5066f5a2 100644 (file)
@@ -183,13 +183,13 @@ class RgwBucketTest(RgwTestCase):
         self.assertEqual(data['tenant'], '')
 
         # List all buckets.
-        data = self._get('/api/rgw/bucket')
+        data = self._get('/api/rgw/bucket', version='1.1')
         self.assertStatus(200)
         self.assertEqual(len(data), 1)
         self.assertIn('teuth-test-bucket', data)
 
         # List all buckets with stats.
-        data = self._get('/api/rgw/bucket?stats=true')
+        data = self._get('/api/rgw/bucket?stats=true', version='1.1')
         self.assertStatus(200)
         self.assertEqual(len(data), 1)
         self.assertSchema(data[0], JObj(sub_elems={
@@ -203,7 +203,7 @@ class RgwBucketTest(RgwTestCase):
         }, allow_unknown=True))
 
         # List all buckets names without stats.
-        data = self._get('/api/rgw/bucket?stats=false')
+        data = self._get('/api/rgw/bucket?stats=false', version='1.1')
         self.assertStatus(200)
         self.assertEqual(data, ['teuth-test-bucket'])
 
@@ -283,7 +283,7 @@ class RgwBucketTest(RgwTestCase):
         # Delete the bucket.
         self._delete('/api/rgw/bucket/teuth-test-bucket')
         self.assertStatus(204)
-        data = self._get('/api/rgw/bucket')
+        data = self._get('/api/rgw/bucket', version='1.1')
         self.assertStatus(200)
         self.assertEqual(len(data), 0)
 
@@ -306,7 +306,7 @@ class RgwBucketTest(RgwTestCase):
         self.assertIsNone(data)
 
         # List all buckets.
-        data = self._get('/api/rgw/bucket')
+        data = self._get('/api/rgw/bucket', version='1.1')
         self.assertStatus(200)
         self.assertEqual(len(data), 1)
         self.assertIn('testx/teuth-test-bucket', data)
@@ -379,7 +379,7 @@ class RgwBucketTest(RgwTestCase):
         self._delete('/api/rgw/bucket/{}'.format(
             parse.quote_plus('testx/teuth-test-bucket')))
         self.assertStatus(204)
-        data = self._get('/api/rgw/bucket')
+        data = self._get('/api/rgw/bucket', version='1.1')
         self.assertStatus(200)
         self.assertEqual(len(data), 0)
 
index 73ead662d6bec778ddc0c15aa19edeb429bcf5f7..3a6464f5a5b7f7eeed890bf1cc8987da8b7a3be8 100644 (file)
@@ -412,6 +412,9 @@ class UserTest(DashboardTestCase):
         user_1 = self._get('/api/user/user1')
         self.assertStatus(200)
 
+        # Let's wait 1 s to ensure pwd expiration date is not the same
+        time.sleep(1)
+
         self.login('user1', 'mypassword10#')
         self._post('/api/user/user1/change_password', {
             'old_password': 'mypassword10#',
index 8abfe51abe8ff36940ca6f5ca0fafadcf8df4850..b054642dbd48e8e7ead6d01ac73d021de98aafe4 100644 (file)
@@ -3,7 +3,6 @@ import time
 import requests
 import errno
 import logging
-import sys
 
 from teuthology.exceptions import CommandFailedError
 
@@ -52,10 +51,13 @@ class TestModuleSelftest(MgrTestCase):
         self._selftest_plugin("influx")
 
     def test_diskprediction_local(self):
-        if sys.version_info >= (3, 8):
+        self._load_module("selftest")
+        python_version = self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            "mgr", "self-test", "python-version")
+        if tuple(int(v) for v in python_version.split('.')) >= (3, 8):
             # https://tracker.ceph.com/issues/45147
-            python_version = f'python {sys.version_info.major}.{sys.version_info.minor}'
-            self.skipTest(f'{python_version} not compatible with diskprediction_local')
+            self.skipTest(f'python {python_version} not compatible with '
+                          'diskprediction_local')
         self._selftest_plugin("diskprediction_local")
 
     def test_telegraf(self):
index 49be3d8ab0a907bf167f35eb0777a2d9e7673ad3..3fccef9a618151647edc2ae3ea8798b9e2da8c71 100644 (file)
@@ -123,8 +123,7 @@ data_devices:
         self._orch_cmd('daemon', 'add', 'rgw', 'realm', 'zone')
 
     def test_nfs_add(self):
-        self._orch_cmd('daemon', 'add', "nfs", "service_name", "pool", "--namespace", "ns")
-        self._orch_cmd('daemon', 'add', "nfs", "service_name", "pool")
+        self._orch_cmd('daemon', 'add', "nfs", "service_name")
 
     def test_osd_rm(self):
         self._orch_cmd('daemon', "rm", "osd.0", '--force')
index 69e91875313b654906aaf45fcc2a81a83b7bd87f..082653f625294c5620dcd27b421d4ffaddd51745 100644 (file)
@@ -2,9 +2,8 @@
 import json
 import logging
 import time
-
 from .mgr_test_case import MgrTestCase
-
+from contextlib import contextmanager
 
 log = logging.getLogger(__name__)
 
@@ -14,7 +13,7 @@ class TestProgress(MgrTestCase):
 
     # How long we expect to wait at most between taking an OSD out
     # and seeing the progress event pop up.
-    EVENT_CREATION_PERIOD = 15
+    EVENT_CREATION_PERIOD = 60
 
     WRITE_PERIOD = 30
 
@@ -149,6 +148,18 @@ class TestProgress(MgrTestCase):
         osd_map = self.mgr_cluster.mon_manager.get_osd_dump_json()
         return len(osd_map['osds'])
 
+    @contextmanager    
+    def recovery_backfill_disabled(self):
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'set', 'nobackfill')
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'set', 'norecover')
+        yield
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'unset', 'nobackfill')
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'unset', 'norecover')
+           
     def setUp(self):
         super(TestProgress, self).setUp()
         # Ensure we have at least four OSDs
@@ -181,15 +192,16 @@ class TestProgress(MgrTestCase):
 
         self._setup_pool()
         self._write_some_data(self.WRITE_PERIOD)
+        with self.recovery_backfill_disabled():
+            for osd_id in osd_ids:
+                self.mgr_cluster.mon_manager.raw_cluster_cmd(
+                    'osd', 'out', str(osd_id))
 
-        for osd_id in osd_ids:
-            self.mgr_cluster.mon_manager.raw_cluster_cmd(
-                'osd', 'out', str(osd_id))
+            # Wait for a progress event to pop up
+            self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
+                                  timeout=self.EVENT_CREATION_PERIOD,
+                                  period=1)
 
-        # Wait for a progress event to pop up
-        self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
-                              timeout=self.EVENT_CREATION_PERIOD*2,
-                              period=1)
         ev = self._get_osd_in_out_events('out')[0]
         log.info(json.dumps(ev, indent=1))
         self.assertIn("Rebalancing after osd.0 marked out", ev['message'])
@@ -202,20 +214,23 @@ class TestProgress(MgrTestCase):
 
         # First Event should complete promptly
         self.wait_until_true(lambda: self._is_complete(initial_event['id']),
-                             timeout=self.EVENT_CREATION_PERIOD)
-        try:
-            # Wait for progress event marked in to pop up
-            self.wait_until_equal(lambda: self._osd_in_out_events_count('in'), 1,
-                                  timeout=self.EVENT_CREATION_PERIOD*2,
-                                  period=1)
-        except RuntimeError as ex:
-            if not "Timed out after" in str(ex):
-                raise ex
+                             timeout=self.RECOVERY_PERIOD)
+
+        with self.recovery_backfill_disabled():
+
+            try:
+                # Wait for progress event marked in to pop up
+                self.wait_until_equal(lambda: self._osd_in_out_events_count('in'), 1,
+                                      timeout=self.EVENT_CREATION_PERIOD,
+                                      period=1)
+            except RuntimeError as ex:
+                if not "Timed out after" in str(ex):
+                    raise ex
 
-            log.info("There was no PGs affected by osd being marked in")
-            return None
+                log.info("There was no PGs affected by osd being marked in")
+                return None
 
-        new_event = self._get_osd_in_out_events('in')[0]
+            new_event = self._get_osd_in_out_events('in')[0]
         return new_event
 
     def _no_events_anywhere(self):
@@ -243,10 +258,22 @@ class TestProgress(MgrTestCase):
             assert ev_id in live_ids
             return False
 
+    def _is_inprogress_or_complete(self, ev_id):
+        for ev in self._events_in_progress():
+            if ev['id'] == ev_id:
+                return ev['progress'] > 0
+        # check if the event completed
+        return self._is_complete(ev_id)
+
     def tearDown(self):
         if self.POOL in self.mgr_cluster.mon_manager.pools:
             self.mgr_cluster.mon_manager.remove_pool(self.POOL)
 
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'unset', 'nobackfill')
+        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            'osd', 'unset', 'norecover')
+
         osd_map = self.mgr_cluster.mon_manager.get_osd_dump_json()
         for osd in osd_map['osds']:
             if osd['weight'] == 0.0:
@@ -280,7 +307,7 @@ class TestProgress(MgrTestCase):
 
         # Event should complete promptly
         self.wait_until_true(lambda: self._is_complete(ev['id']),
-                             timeout=self.EVENT_CREATION_PERIOD)
+                             timeout=self.RECOVERY_PERIOD)
         self.assertEqual(self._osd_in_out_events_count(), 0)
 
     def test_osd_came_back(self):
@@ -301,57 +328,6 @@ class TestProgress(MgrTestCase):
 
         self.assertEqual(self._osd_in_out_events_count(), 0)
 
-    def test_osd_cannot_recover(self):
-        """
-        When the cluster cannot recover from a lost OSD, e.g.
-        because there is no suitable new placement for it.
-        (a size=3 pool when there are only 2 OSDs left)
-        (a size=3 pool when the remaining osds are only on 2 hosts)
-
-        Progress event should not be created.
-        """
-
-        pool_size = 3
-
-        self._setup_pool(size=pool_size)
-        self._write_some_data(self.WRITE_PERIOD)
-
-        # Fail enough OSDs so there are less than N_replicas OSDs
-        # available.
-        osd_count = self._osd_count()
-
-        # First do some failures that will result in a normal rebalance
-        # (Assumption: we're in a test environment that is configured
-        #  not to require replicas be on different hosts, like teuthology)
-        for osd_id in range(0, osd_count - pool_size):
-            self.mgr_cluster.mon_manager.raw_cluster_cmd(
-                'osd', 'out', str(osd_id))
-
-        # We should see an event for each of the OSDs we took out
-        self.wait_until_equal(
-            lambda: self._osd_in_out_events_count('out'),
-            osd_count - pool_size,
-            timeout=self.EVENT_CREATION_PERIOD*(osd_count - pool_size))
-
-        # Those should complete cleanly
-        self.wait_until_equal(
-            lambda: self._osd_in_out_completed_events_count('out'),
-            osd_count - pool_size,
-            timeout=self.RECOVERY_PERIOD*(osd_count - pool_size)
-        )
-
-        # Fail one last OSD, at the point the PGs have nowhere to go
-        victim_osd = osd_count - pool_size
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
-                'osd', 'out', str(victim_osd))
-
-        # Check that no event is created
-        time.sleep(self.EVENT_CREATION_PERIOD)
-
-        self.assertEqual(
-            self._osd_in_out_completed_events_count('out'),
-            osd_count - pool_size)
-
     def test_turn_off_module(self):
         """
         When the the module is turned off, there should not
@@ -364,18 +340,19 @@ class TestProgress(MgrTestCase):
         pool_size = 3
         self._setup_pool(size=pool_size)
         self._write_some_data(self.WRITE_PERIOD)
-
         self.mgr_cluster.mon_manager.raw_cluster_cmd("progress", "off")
 
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
-                'osd', 'out', '0')
+        with self.recovery_backfill_disabled():
+            self.mgr_cluster.mon_manager.raw_cluster_cmd(
+                    'osd', 'out', '0')
 
-        time.sleep(self.EVENT_CREATION_PERIOD)
+        time.sleep(self.EVENT_CREATION_PERIOD/2)
 
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
+        with self.recovery_backfill_disabled():
+            self.mgr_cluster.mon_manager.raw_cluster_cmd(
                     'osd', 'in', '0')
 
-        time.sleep(self.EVENT_CREATION_PERIOD)
+        time.sleep(self.EVENT_CREATION_PERIOD/2)
 
         self.assertTrue(self._no_events_anywhere())
 
@@ -383,18 +360,21 @@ class TestProgress(MgrTestCase):
 
         self._write_some_data(self.WRITE_PERIOD)
 
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
-                'osd', 'out', '0')
+        with self.recovery_backfill_disabled():
 
-        # Wait for a progress event to pop up
-        self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
-                              timeout=self.EVENT_CREATION_PERIOD*2,
-                              period=1)
+            self.mgr_cluster.mon_manager.raw_cluster_cmd(
+                    'osd', 'out', '0')
+
+            # Wait for a progress event to pop up
+            self.wait_until_equal(lambda: self._osd_in_out_events_count('out'), 1,
+                                  timeout=self.EVENT_CREATION_PERIOD,
+                                  period=1)
 
         ev1 = self._get_osd_in_out_events('out')[0]
 
         log.info(json.dumps(ev1, indent=1))
 
         self.wait_until_true(lambda: self._is_complete(ev1['id']),
+                             check_fn=lambda: self._is_inprogress_or_complete(ev1['id']),
                              timeout=self.RECOVERY_PERIOD)
         self.assertTrue(self._is_quiet())
index d0b72f69ecc0a5bd4e86c3aa5e500a2de3772e6b..3491babc517cc2ccb06626f9c70f808761bb0be2 100644 (file)
@@ -147,7 +147,7 @@ def setup_venv(ctx, config):
     assert isinstance(config, dict)
     log.info('Setting up virtualenv for pykmip...')
     for (client, _) in config.items():
-        run_in_pykmip_dir(ctx, client, ['virtualenv', '.pykmipenv'])
+        run_in_pykmip_dir(ctx, client, ['python3', '-m', 'venv', '.pykmipenv'])
         run_in_pykmip_venv(ctx, client, ['pip', 'install', 'pytz', '-e', get_pykmip_dir(ctx)])
     yield
 
diff --git a/ceph/qa/tasks/python.py b/ceph/qa/tasks/python.py
new file mode 100644 (file)
index 0000000..4ddb14f
--- /dev/null
@@ -0,0 +1,45 @@
+import logging
+from teuthology import misc as teuthology
+from tasks.vip import subst_vip
+
+log = logging.getLogger(__name__)
+
+
+def task(ctx, config):
+    """
+    Execute some python code.
+      tasks:
+      - python:
+          host.a: |
+            import boto3
+            c = boto3.resource(...)
+
+    The provided dict is normally indexed by role.  You can also include a 
+    'sudo: false' key to run the code without sudo.
+
+      tasks:
+      - python:
+          sudo: false
+          host.b: |
+            import boto3
+            c = boto3.resource(...)
+    """
+    assert isinstance(config, dict), "task python got invalid config"
+
+    testdir = teuthology.get_testdir(ctx)
+
+    sudo = config.pop('sudo', True)
+
+    for role, code in config.items():
+        (remote,) = ctx.cluster.only(role).remotes.keys()
+        log.info('Running python on role %s host %s', role, remote.name)
+        log.info(code)
+        args=[
+            'TESTDIR={tdir}'.format(tdir=testdir),
+            'python3',
+        ]
+        if sudo:
+            args = ['sudo'] + args
+        remote.run(args=args, stdin=subst_vip(ctx, code))
+
index f06c9acfe9d5981fe9ab9ec96c5fc5e930020d93..cfccf65e3b9e559406d6ca0db00963e006ac6fee 100644 (file)
@@ -144,7 +144,9 @@ def setup_user_bucket(client, dns_name, access_key, secret_key, bucket_name, tes
     )
     client.run(
         args=[
-            'virtualenv',
+            'python3',
+            '-m',
+            'venv',
             '{testdir}/venv'.format(testdir=testdir),
             run.Raw('&&'),
             run.Raw('{testdir}/venv/bin/pip'.format(testdir=testdir)),
index 36c226d0b2e6e4555e6347fa1ce3db645bbc7c2d..61c5b7411b45df32f40d5254a7a629fb9af322e4 100644 (file)
@@ -29,14 +29,14 @@ def task(ctx, config):
     log.info('Deploying tox from pip...')
     for (client, _) in config.items():
         # yup, we have to deploy tox first. The packaged one, available
-       # on Sepia's Ubuntu machines, is outdated for Keystone/Tempest.
+        # on Sepia's Ubuntu machines, is outdated for Keystone/Tempest.
         tvdir = get_toxvenv_dir(ctx)
-        ctx.cluster.only(client).run(args=[ 'virtualenv', '-p', 'python3', tvdir ])
-        ctx.cluster.only(client).run(args=
-            [   'source', '{tvdir}/bin/activate'.format(tvdir=tvdir),
-                run.Raw('&&'),
-                'pip', 'install', 'tox==3.15.0'
-            ])
+        ctx.cluster.only(client).run(args=['python3', '-m', 'venv', tvdir])
+        ctx.cluster.only(client).run(args=[
+            'source', '{tvdir}/bin/activate'.format(tvdir=tvdir),
+            run.Raw('&&'),
+            'pip', 'install', 'tox==3.15.0'
+        ])
 
     # export the path Keystone and Tempest
     ctx.tox = argparse.Namespace()
index d4d27b85e49529b3dba95d5d7372ac24fd76a54f..52114b1042285268782a05f932b112bf8e1df14c 100644 (file)
@@ -62,6 +62,7 @@ def exec(ctx, config):
                     'sudo',
                     'TESTDIR={tdir}'.format(tdir=testdir),
                     'bash',
+                    '-ex',
                     '-c',
                     subst_vip(ctx, c)],
                 )
index 61ca076151add3169c30c07e1b0d88e84481bbf7..db0cb41cf15c32177eeec5566a8fc90cf453dfd8 100644 (file)
@@ -1233,6 +1233,12 @@ class LocalCluster(object):
     def only(self, requested):
         return self.__class__(rolename=requested)
 
+    def run(self, *args, **kwargs):
+        r = []
+        for remote in self.remotes.keys():
+            r.append(remote.run(*args, **kwargs))
+        return r
+
 
 class LocalContext(object):
     def __init__(self):
index bd37154d9b879e298669a4ae907085cfea63ad46..e0f542e0f07e71df5aaedbacb95a337e107f8a2b 100755 (executable)
@@ -93,23 +93,10 @@ find cypress # List all specs
 
 cypress_run "orchestrator/01-hosts.e2e-spec.ts"
 
-ceph orch apply rgw foo --placement=3
-sleep 15
-ceph orch device ls --refresh
-ceph orch ps --refresh
-sleep 10  # the previous call is asynchronous
-ceph orch device ls --format=json | tee cypress/fixtures/orchestrator/inventory.json
-ceph orch ps --format=json | tee cypress/fixtures/orchestrator/services.json
-
-cypress_run "orchestrator/01-hosts-force-maintenance.e2e-spec.ts"
-
 # Hosts are removed and added in the previous step. Do a refresh again.
-ceph orch rm rgw.foo
 ceph orch device ls --refresh
-ceph orch ps --refresh
 sleep 10
 ceph orch device ls --format=json | tee cypress/fixtures/orchestrator/inventory.json
-ceph orch ps --format=json | tee cypress/fixtures/orchestrator/services.json
 
 cypress_run "orchestrator/02-hosts-inventory.e2e-spec.ts"
 cypress_run "orchestrator/03-inventory.e2e-spec.ts"
diff --git a/ceph/qa/workunits/fs/cephfs_mirror_ha_gen.sh b/ceph/qa/workunits/fs/cephfs_mirror_ha_gen.sh
new file mode 100755 (executable)
index 0000000..35ee9d4
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/bash -ex
+#
+# cephfs_mirror_ha_gen.sh - generate workload to synchronize
+#
+
+. $(dirname $0)/cephfs_mirror_helpers.sh
+
+cleanup()
+{
+    for i in `seq 1 $NR_DIRECTORIES`
+    do
+        local repo_name="${REPO_PATH_PFX}_$i"
+        for j in `seq 1 $NR_SNAPSHOTS`
+        do
+            snap_name=$repo_name/.snap/snap_$j
+            if test -d $snap_name; then
+                rmdir $snap_name
+            fi
+        done
+    done
+    exit 1
+}
+trap cleanup EXIT
+
+configure_peer()
+{
+    ceph mgr module enable mirroring
+    ceph fs snapshot mirror enable $PRIMARY_FS
+    ceph fs snapshot mirror peer_add $PRIMARY_FS client.mirror_remote@ceph $BACKUP_FS
+
+    for i in `seq 1 $NR_DIRECTORIES`
+    do
+        local repo_name="${REPO_PATH_PFX}_$i"
+        ceph fs snapshot mirror add $PRIMARY_FS "$MIRROR_SUBDIR/$repo_name"
+    done
+}
+
+create_snaps()
+{
+    for i in `seq 1 $NR_DIRECTORIES`
+    do
+        local repo_name="${REPO_PATH_PFX}_$i"
+        for j in `seq 1 $NR_SNAPSHOTS`
+        do
+            snap_name=$repo_name/.snap/snap_$j
+            r=$(( $RANDOM % 100 + 5 ))
+            arr=($repo_name "reset" "--hard" "HEAD~$r")
+            exec_git_cmd "${arr[@]}"
+            mkdir $snap_name
+            store_checksum $snap_name
+        done
+    done
+}
+
+unset CEPH_CLI_TEST_DUP_COMMAND
+
+echo "running generator on prmary file system..."
+
+# setup git repos to be used as data set
+setup_repos
+
+# turn on mirroring, add peers...
+configure_peer
+
+# snapshots on primary
+create_snaps
+
+# do not cleanup when exiting on success..
+trap - EXIT
diff --git a/ceph/qa/workunits/fs/cephfs_mirror_ha_verify.sh b/ceph/qa/workunits/fs/cephfs_mirror_ha_verify.sh
new file mode 100755 (executable)
index 0000000..8d8b385
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash -ex
+#
+# cephfs_mirror_ha_verify.sh - verify synchronized snapshots
+#
+
+. $(dirname $0)/cephfs_mirror_helpers.sh
+
+echo "running verifier on secondary file system..."
+
+for i in `seq 1 $NR_DIRECTORIES`
+do
+    repo_name="${REPO_PATH_PFX}_$i"
+    for j in `seq 1 $NR_SNAPSHOTS`
+    do
+        for s in 1 1 2 4 4 4 4 4 8 8 8 8 16 16 32 64 64 128 128
+        do
+            sleep $s
+            snap_name=$repo_name/.snap/snap_$j
+            if test -d $repo_name; then
+                echo "checking snapshot [$snap_name] in $repo_name"
+                if test -d $snap_name; then
+                    echo "generating hash for $snap_name"
+                    cksum=''
+                    calc_checksum $snap_name cksum
+                    ret=$(compare_checksum $cksum $snap_name)
+                    if [ $ret -ne 0 ]; then
+                        echo "checksum failed $snap_name ($cksum)"
+                        return $ret
+                    else
+                        echo "checksum matched $snap_name ($cksum)"
+                        break
+                    fi
+                fi
+            fi
+        done
+        echo "couldn't complete verification for: $snap_name"
+    done
+done
+
+echo "verify done!"
diff --git a/ceph/qa/workunits/fs/cephfs_mirror_helpers.sh b/ceph/qa/workunits/fs/cephfs_mirror_helpers.sh
new file mode 100644 (file)
index 0000000..69f1c6f
--- /dev/null
@@ -0,0 +1,66 @@
+PRIMARY_FS='dc'
+BACKUP_FS='dc-backup'
+
+REPO=ceph-qa-suite
+REPO_DIR=ceph_repo
+REPO_PATH_PFX="$REPO_DIR/$REPO"
+
+NR_DIRECTORIES=4
+NR_SNAPSHOTS=4
+MIRROR_SUBDIR='/mirror'
+
+calc_checksum()
+{
+    local path=$1
+    local -n ref=$2
+    ref=`find -L $path -type f -exec md5sum {} +  | awk '{ print $1 }' | md5sum | awk '{ print $1 }'`
+}
+
+store_checksum()
+{
+    local path=$1
+    local cksum='' #something invalid
+    local fhash=`echo -n $path | md5sum | awk '{ print $1 }'`
+    calc_checksum $path cksum
+    echo -n $cksum > "/tmp/primary-$fhash"
+}
+
+compare_checksum()
+{
+    local ret=0
+    local cksum=$1
+    local path=$2
+    local fhash=`echo -n $path | md5sum | awk '{ print $1 }'`
+    local cksum_ondisk=`cat /tmp/primary-$fhash`
+    if [ $cksum != $cksum_ondisk ]; then
+        echo "$cksum <> $cksum_ondisk"
+        ret=1
+    fi
+    echo $ret
+}
+
+exec_git_cmd()
+{
+    local arg=("$@")
+    local repo_name=${arg[0]}
+    local cmd=${arg[@]:1}
+    git --git-dir "$repo_name/.git" $cmd
+}
+
+clone_repo()
+{
+    local repo_name=$1
+    git clone --branch giant "http://github.com/ceph/$REPO" $repo_name
+}
+
+setup_repos()
+{
+    mkdir "$REPO_DIR"
+
+    for i in `seq 1 $NR_DIRECTORIES`
+    do
+        local repo_name="${REPO_PATH_PFX}_$i"
+        mkdir $repo_name
+        clone_repo $repo_name
+    done
+}
index 3d24b1a6c50c2444379dc600a389a49d3139111f..215b587078f0ca47c7662a9ea4ebd71fc012bb3e 100755 (executable)
@@ -45,6 +45,56 @@ ceph osd pool set b pg_autoscale_mode on
 # get num pools again since we created more pools
 NUM_POOLS=$(ceph osd pool ls | wc -l)
 
+# get profiles of pool a and b
+PROFILE1=$(ceph osd pool autoscale-status | grep 'a' | grep -o -m 1 'scale-up\|scale-down' || true)
+PROFILE2=$(ceph osd pool autoscale-status | grep 'b' | grep -o -m 1 'scale-up\|scale-down' || true)
+
+# evaluate the default profile a
+if [[ $PROFILE1 = "scale-up" ]]
+then
+  echo "Success: pool a PROFILE is scale-up"
+else
+  echo "Error: a PROFILE is scale-down"
+  exit 1
+fi
+
+# evaluate the default profile of pool b
+if [[ $PROFILE2 = "scale-up" ]]
+then
+  echo "Success: pool b PROFILE is scale-up"
+else
+  echo "Error: b PROFILE is scale-down"
+  exit 1
+fi
+
+# This part of this code will now evaluate the accuracy of
+# scale-down profile
+
+# change to scale-down profile
+ceph osd pool set autoscale-profile scale-down 
+
+# get profiles of pool a and b
+PROFILE1=$(ceph osd pool autoscale-status | grep 'a' | grep -o -m 1 'scale-up\|scale-down' || true)
+PROFILE2=$(ceph osd pool autoscale-status | grep 'b' | grep -o -m 1 'scale-up\|scale-down' || true)
+
+# evaluate that profile a is now scale-down
+if [[ $PROFILE1 = "scale-down" ]]
+then
+  echo "Success: pool a PROFILE is scale-down"
+else
+  echo "Error: a PROFILE is scale-up"
+  exit 1
+fi
+
+# evaluate the profile of b is now scale-down
+if [[ $PROFILE2 = "scale-down" ]]
+then
+  echo "Success: pool b PROFILE is scale-down"
+else
+  echo "Error: b PROFILE is scale-up"
+  exit 1
+fi
+
 # get pool size
 POOL_SIZE_A=$(ceph osd pool get a size| grep -Eo '[0-9]{1,4}')
 POOL_SIZE_B=$(ceph osd pool get b size| grep -Eo '[0-9]{1,4}')
index e0a096ee8a370a2a3d9992886563df814ad83663..fb77c0d9bf869f5665042c4666e5ce30446296dd 100755 (executable)
@@ -27,7 +27,7 @@ testlog "TEST: verify rx-only direction"
 [ "$(rbd --cluster ${CLUSTER1} --pool ${POOL} mirror pool info --format xml |
        ${XMLSTARLET} sel -t -v  '//mirror/peers/peer[1]/uuid')" = "" ]
 
-create_image ${CLUSTER1} ${POOL} image1
+create_image_and_enable_mirror ${CLUSTER1} ${POOL} image1
 
 wait_for_image_replay_started ${CLUSTER2} ${POOL} image1
 write_image ${CLUSTER1} ${POOL} image1 100
index 82299715e231e1e5d2110e5825eda8c4eafd4c80..ca715d854c17669b09c463fa83a0580ec300e04b 100755 (executable)
@@ -549,6 +549,8 @@ status()
 
                 echo "${cluster} ${image_pool} ${image_ns} rbd_mirroring omap vals"
                 rados --cluster ${cluster} -p ${image_pool} --namespace "${image_ns}" listomapvals rbd_mirroring
+                echo "${cluster} ${image_pool} ${image_ns} rbd_mirror_leader omap vals"
+                rados --cluster ${cluster} -p ${image_pool} --namespace "${image_ns}" listomapvals rbd_mirror_leader
                 echo
             done
         done
@@ -1096,6 +1098,20 @@ unprotect_snapshot()
     rbd --cluster ${cluster} snap unprotect ${pool}/${image}@${snap}
 }
 
+unprotect_snapshot_retry()
+{
+    local cluster=$1
+    local pool=$2
+    local image=$3
+    local snap=$4
+
+    for s in 0 1 2 4 8 16 32; do
+        sleep ${s}
+        unprotect_snapshot ${cluster} ${pool} ${image} ${snap} && return 0
+    done
+    return 1
+}
+
 wait_for_snap_present()
 {
     local cluster=$1
@@ -1292,6 +1308,8 @@ enable_mirror()
     local mode=${4:-${MIRROR_IMAGE_MODE}}
 
     rbd --cluster=${cluster} mirror image enable ${pool}/${image} ${mode}
+    # Display image info including the global image id for debugging purpose
+    rbd --cluster=${cluster} info ${pool}/${image}
 }
 
 test_image_present()
@@ -1389,6 +1407,58 @@ get_clone_format()
              }'
 }
 
+list_omap_keys()
+{
+    local cluster=$1
+    local pool=$2
+    local obj_name=$3
+
+    rados --cluster ${cluster} -p ${pool} listomapkeys ${obj_name}
+}
+
+count_omap_keys_with_filter()
+{
+    local cluster=$1
+    local pool=$2
+    local obj_name=$3
+    local filter=$4
+
+    list_omap_keys ${cluster} ${pool} ${obj_name} | grep -c ${filter}
+}
+
+wait_for_omap_keys()
+{
+    local cluster=$1
+    local pool=$2
+    local obj_name=$3
+    local filter=$4
+
+    for s in 0 1 2 2 4 4 8 8 8 16 16 32; do
+        sleep $s
+
+        set +e
+        test "$(count_omap_keys_with_filter ${cluster} ${pool} ${obj_name} ${filter})" = 0
+        error_code=$?
+        set -e
+
+        if [ $error_code -eq 0 ]; then
+            return 0
+        fi
+    done
+
+    return 1
+}
+
+wait_for_image_in_omap()
+{
+    local cluster=$1
+    local pool=$2
+
+    wait_for_omap_keys ${cluster} ${pool} rbd_mirroring status_global
+    wait_for_omap_keys ${cluster} ${pool} rbd_mirroring image_
+    wait_for_omap_keys ${cluster} ${pool} rbd_mirror_leader image_map
+}
+
 #
 # Main
 #
index 84fd2424f4ba83f2dd590b691b9d47a21b5c4f09..56a8b13a9a777a4ba226a4e445fab48fd38d084c 100755 (executable)
@@ -119,6 +119,8 @@ if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
   all_admin_daemons ${CLUSTER1} rbd mirror status
 fi
 
+remove_image_retry ${CLUSTER2} ${POOL} ${image1}
+
 testlog "TEST: test image rename"
 new_name="${image}_RENAMED"
 rename_image ${CLUSTER2} ${POOL} ${image} ${new_name}
@@ -138,6 +140,18 @@ wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted'
 trash_restore ${CLUSTER2} ${POOL} ${image_id}
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
 
+testlog "TEST: check if removed images' OMAP are removed (with rbd-mirror on one cluster)"
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
+
+wait_for_image_in_omap ${CLUSTER1} ${POOL}
+wait_for_image_in_omap ${CLUSTER2} ${POOL}
+
+create_image_and_enable_mirror ${CLUSTER2} ${POOL} ${image}
+wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
+write_image ${CLUSTER2} ${POOL} ${image} 100
+wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
+wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
+
 testlog "TEST: failover and failback"
 start_mirrors ${CLUSTER2}
 
@@ -216,6 +230,8 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${force_promote_image} 'up+stopp
 wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${force_promote_image} 'up+stopped'
 write_image ${CLUSTER1} ${POOL} ${force_promote_image} 100
 write_image ${CLUSTER2} ${POOL} ${force_promote_image} 100
+remove_image_retry ${CLUSTER1} ${POOL} ${force_promote_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${force_promote_image}
 
 testlog "TEST: cloned images"
 testlog " - default"
@@ -240,6 +256,7 @@ wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}
 wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${clone_image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${clone_image} 'up+replaying' 'primary_position'
 compare_images ${POOL} ${clone_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${clone_image}
 
 testlog " - clone v1"
 clone_image ${CLUSTER1} ${PARENT_POOL} ${parent_image} ${parent_snap} ${POOL} ${clone_image}1
@@ -249,6 +266,10 @@ clone_image ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap} ${POOL} \
 test $(get_clone_format ${CLUSTER2} ${POOL} ${clone_image}_v1) = 1
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}_v1
 test $(get_clone_format ${CLUSTER1} ${POOL} ${clone_image}_v1) = 1
+remove_image_retry ${CLUSTER2} ${POOL} ${clone_image}_v1
+remove_image_retry ${CLUSTER1} ${POOL} ${clone_image}1
+unprotect_snapshot_retry ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
+remove_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
 
 testlog " - clone v2"
 parent_snap=snap_v2
@@ -277,6 +298,7 @@ test_snap_removed_from_trash ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent
 wait_for_snap_moved_to_trash ${CLUSTER1} ${PARENT_POOL} ${parent_image} ${parent_snap}
 remove_image_retry ${CLUSTER1} ${POOL} ${clone_image}_v2
 wait_for_snap_removed_from_trash ${CLUSTER1} ${PARENT_POOL} ${parent_image} ${parent_snap}
+remove_image_retry ${CLUSTER2} ${PARENT_POOL} ${parent_image}
 
 testlog "TEST: data pool"
 dp_image=test_data_pool
@@ -295,6 +317,7 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${dp_image} 'up+replaying' 'prim
 compare_images ${POOL} ${dp_image}@snap1
 compare_images ${POOL} ${dp_image}@snap2
 compare_images ${POOL} ${dp_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${dp_image}
 
 testlog "TEST: disable mirroring / delete non-primary image"
 image2=test2
@@ -379,6 +402,12 @@ for i in `seq 1 20`; do
 done
 wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}"
 
+unprotect_snapshot ${CLUSTER2} ${POOL} ${image4} 'snap1'
+unprotect_snapshot ${CLUSTER2} ${POOL} ${image4} 'snap2'
+for i in ${image2} ${image4}; do
+    remove_image_retry ${CLUSTER2} ${POOL} ${i}
+done
+
 testlog "TEST: disable mirror while daemon is stopped"
 stop_mirrors ${CLUSTER1}
 stop_mirrors ${CLUSTER2}
@@ -415,6 +444,7 @@ remove_image_retry ${CLUSTER2} ${POOL}/${NS1} ${image}
 disable_mirror ${CLUSTER2} ${POOL}/${NS2} ${image}
 wait_for_image_present ${CLUSTER1} ${POOL}/${NS1} ${image} 'deleted'
 wait_for_image_present ${CLUSTER1} ${POOL}/${NS2} ${image} 'deleted'
+remove_image_retry ${CLUSTER2} ${POOL}/${NS2} ${image}
 
 testlog " - data pool"
 dp_image=test_data_pool
@@ -428,6 +458,7 @@ write_image ${CLUSTER2} ${POOL}/${NS1} ${dp_image} 100
 wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL}/${NS1} ${dp_image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL}/${NS1} ${dp_image} 'up+replaying' 'primary_position'
 compare_images ${POOL}/${NS1} ${dp_image}
+remove_image_retry ${CLUSTER2} ${POOL}/${NS1} ${dp_image}
 
 testlog "TEST: simple image resync"
 request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
@@ -460,6 +491,7 @@ wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'present'
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'primary_position'
 compare_images ${POOL} ${image}
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
 
 testlog "TEST: client disconnect"
 image=laggy
@@ -531,6 +563,7 @@ disconnect_image ${CLUSTER2} ${POOL} ${image}
 test -z "$(get_mirror_journal_position ${CLUSTER2} ${POOL} ${image})"
 wait_for_image_replay_stopped ${CLUSTER1} ${POOL} ${image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'disconnected'
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
 
 testlog "TEST: split-brain"
 image=split-brain
@@ -544,6 +577,12 @@ demote_image ${CLUSTER1} ${POOL} ${image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'split-brain'
 request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying' 'primary_position'
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
+
+testlog "TEST: check if removed images' OMAP are removed"
+start_mirrors ${CLUSTER2}
+wait_for_image_in_omap ${CLUSTER1} ${POOL}
+wait_for_image_in_omap ${CLUSTER2} ${POOL}
 
 if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
   # teuthology will trash the daemon
index 6452739026638d80988c577fb2773fdd777ec565..0060440fb8d0d2409d0627d0f4147c0c9cd32102 100755 (executable)
@@ -122,6 +122,8 @@ if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
   all_admin_daemons ${CLUSTER1} rbd mirror status
 fi
 
+remove_image_retry ${CLUSTER2} ${POOL} ${image1}
+
 testlog "TEST: test image rename"
 new_name="${image}_RENAMED"
 rename_image ${CLUSTER2} ${POOL} ${image} ${new_name}
@@ -144,6 +146,18 @@ trash_restore ${CLUSTER2} ${POOL} ${image_id}
 enable_mirror ${CLUSTER2} ${POOL} ${image} snapshot
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
 
+testlog "TEST: check if removed images' OMAP are removed (with rbd-mirror on one cluster)"
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
+
+wait_for_image_in_omap ${CLUSTER1} ${POOL}
+wait_for_image_in_omap ${CLUSTER2} ${POOL}
+
+create_image_and_enable_mirror ${CLUSTER2} ${POOL} ${image}
+wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
+write_image ${CLUSTER2} ${POOL} ${image} 100
+wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${image}
+wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
+
 testlog "TEST: failover and failback"
 start_mirrors ${CLUSTER2}
 
@@ -222,6 +236,8 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${force_promote_image} 'up+stopp
 wait_for_status_in_pool_dir ${CLUSTER2} ${POOL} ${force_promote_image} 'up+stopped'
 write_image ${CLUSTER1} ${POOL} ${force_promote_image} 100
 write_image ${CLUSTER2} ${POOL} ${force_promote_image} 100
+remove_image_retry ${CLUSTER1} ${POOL} ${force_promote_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${force_promote_image}
 
 testlog "TEST: cloned images"
 testlog " - default"
@@ -246,6 +262,7 @@ wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}
 wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL} ${clone_image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${clone_image} 'up+replaying'
 compare_images ${POOL} ${clone_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${clone_image}
 
 testlog " - clone v1"
 clone_image_and_enable_mirror ${CLUSTER1} ${PARENT_POOL} ${parent_image} \
@@ -256,6 +273,10 @@ clone_image_and_enable_mirror ${CLUSTER2} ${PARENT_POOL} ${parent_image} \
 test $(get_clone_format ${CLUSTER2} ${POOL} ${clone_image}_v1) = 1
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${clone_image}_v1
 test $(get_clone_format ${CLUSTER1} ${POOL} ${clone_image}_v1) = 1
+remove_image_retry ${CLUSTER2} ${POOL} ${clone_image}_v1
+remove_image_retry ${CLUSTER1} ${POOL} ${clone_image}1
+unprotect_snapshot_retry ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
+remove_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image} ${parent_snap}
 
 testlog " - clone v2"
 parent_snap=snap_v2
@@ -288,6 +309,7 @@ mirror_image_snapshot ${CLUSTER2} ${PARENT_POOL} ${parent_image}
 wait_for_snap_moved_to_trash ${CLUSTER1} ${PARENT_POOL} ${parent_image} ${parent_snap}
 remove_image_retry ${CLUSTER1} ${POOL} ${clone_image}_v2
 wait_for_snap_removed_from_trash ${CLUSTER1} ${PARENT_POOL} ${parent_image} ${parent_snap}
+remove_image_retry ${CLUSTER2} ${PARENT_POOL} ${parent_image}
 
 testlog "TEST: data pool"
 dp_image=test_data_pool
@@ -306,6 +328,7 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${dp_image} 'up+replaying'
 compare_images ${POOL} ${dp_image}@snap1
 compare_images ${POOL} ${dp_image}@snap2
 compare_images ${POOL} ${dp_image}
+remove_image_retry ${CLUSTER2} ${POOL} ${dp_image}
 
 testlog "TEST: disable mirroring / delete non-primary image"
 image2=test2
@@ -354,6 +377,12 @@ done
 mirror_image_snapshot ${CLUSTER2} ${POOL} ${image2}
 wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}"
 
+unprotect_snapshot ${CLUSTER2} ${POOL} ${image4} 'snap1'
+unprotect_snapshot ${CLUSTER2} ${POOL} ${image4} 'snap2'
+for i in ${image2} ${image4}; do
+    remove_image_retry ${CLUSTER2} ${POOL} ${i}
+done
+
 testlog "TEST: disable mirror while daemon is stopped"
 stop_mirrors ${CLUSTER1}
 stop_mirrors ${CLUSTER2}
@@ -387,6 +416,7 @@ remove_image_retry ${CLUSTER2} ${POOL}/${NS1} ${image}
 disable_mirror ${CLUSTER2} ${POOL}/${NS2} ${image}
 wait_for_image_present ${CLUSTER1} ${POOL}/${NS1} ${image} 'deleted'
 wait_for_image_present ${CLUSTER1} ${POOL}/${NS2} ${image} 'deleted'
+remove_image_retry ${CLUSTER2} ${POOL}/${NS2} ${image}
 
 testlog " - data pool"
 dp_image=test_data_pool
@@ -400,6 +430,7 @@ write_image ${CLUSTER2} ${POOL}/${NS1} ${dp_image} 100
 wait_for_replay_complete ${CLUSTER1} ${CLUSTER2} ${POOL}/${NS1} ${dp_image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL}/${NS1} ${dp_image} 'up+replaying'
 compare_images ${POOL}/${NS1} ${dp_image}
+remove_image_retry ${CLUSTER2} ${POOL}/${NS1} ${dp_image}
 
 testlog "TEST: simple image resync"
 request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
@@ -432,6 +463,7 @@ wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'present'
 wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
 compare_images ${POOL} ${image}
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
 
 testlog "TEST: split-brain"
 image=split-brain
@@ -445,6 +477,12 @@ demote_image ${CLUSTER1} ${POOL} ${image}
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+error' 'split-brain'
 request_resync_image ${CLUSTER1} ${POOL} ${image} image_id
 wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${image} 'up+replaying'
+remove_image_retry ${CLUSTER2} ${POOL} ${image}
+
+testlog "TEST: check if removed images' OMAP are removed"
+start_mirrors ${CLUSTER2}
+wait_for_image_in_omap ${CLUSTER1} ${POOL}
+wait_for_image_in_omap ${CLUSTER2} ${POOL}
 
 if [ -z "${RBD_MIRROR_USE_RBD_MIRROR}" ]; then
   # teuthology will trash the daemon
index a17ad75e1b58e98f301fbfbd9944319b03ce84fe..cb79aba7ebc9c79126e10bf3188904914df2c51f 100755 (executable)
@@ -214,3 +214,8 @@ do
   purge_snapshots ${CLUSTER2} ${POOL} ${image}
   remove_image_retry ${CLUSTER2} ${POOL} ${image}
 done
+
+testlog "TEST: check if removed images' OMAP are removed"
+
+wait_for_image_in_omap ${CLUSTER1} ${POOL}
+wait_for_image_in_omap ${CLUSTER2} ${POOL}
index 43145fdd5b83ddff699f2c4c278aae2ea51e0ae8..1d4b77a74a80dcb5273cfeb2c5121c042c7d18be 100644 (file)
@@ -1,2 +1,2 @@
-ee28fb57e47e9f88813e24bbf4c14496ca299d31
-16.2.6
+dd0603118f56ab514f133c8d2e3adfc983942503
+16.2.7
index b6fa633667786419f254afc2489b59d05c11038a..cc53f9a725cdcdb4b37a0bb343fc7d8e2430b59f 100644 (file)
@@ -526,6 +526,7 @@ if(WITH_BLUESTORE_PMEM OR WITH_RBD_RWL)
     if(WITH_RBD_RWL)
       find_package(pmem REQUIRED COMPONENTS pmemobj)
     endif()
+    find_package(pmem 1.10 REQUIRED COMPONENTS ${pmem_COMPONENTS})
   else()
     include(Buildpmem)
     build_pmem()
index adfe74d2baba681b5fcdb88a67bbe16e76d81c2f..ac83b7f3ee8f6e7512b35a0ff85b25e906c5812d 100644 (file)
@@ -72,8 +72,11 @@ bool KeyServerData::get_service_secret(CephContext *cct, uint32_t service_id,
                                uint64_t secret_id, CryptoKey& secret) const
 {
   auto iter = rotating_secrets.find(service_id);
-  if (iter == rotating_secrets.end())
+  if (iter == rotating_secrets.end()) {
+    ldout(cct, 10) << __func__ << " no rotating_secrets for service " << service_id
+                  << " " << ceph_entity_type_name(service_id) << dendl;
     return false;
+  }
 
   const RotatingSecrets& secrets = iter->second;
   auto riter = secrets.secrets.find(secret_id);
@@ -146,31 +149,13 @@ int KeyServer::start_server()
 {
   std::scoped_lock l{lock};
 
-  _check_rotating_secrets();
   _dump_rotating_secrets();
   return 0;
 }
 
-bool KeyServer::_check_rotating_secrets()
+void KeyServer::dump()
 {
-  ldout(cct, 10) << "_check_rotating_secrets" << dendl;
-
-  int added = 0;
-  added += _rotate_secret(CEPH_ENTITY_TYPE_AUTH);
-  added += _rotate_secret(CEPH_ENTITY_TYPE_MON);
-  added += _rotate_secret(CEPH_ENTITY_TYPE_OSD);
-  added += _rotate_secret(CEPH_ENTITY_TYPE_MDS);
-  added += _rotate_secret(CEPH_ENTITY_TYPE_MGR);
-
-  if (added) {
-    ldout(cct, 10) << __func__ << " added " << added << dendl;
-    data.rotating_ver++;
-    //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += std::min(cct->_conf->auth_mon_ticket_ttl, cct->_conf->auth_service_ticket_ttl);
-    _dump_rotating_secrets();
-    return true;
-  }
-  return false;
+  _dump_rotating_secrets();
 }
 
 void KeyServer::_dump_rotating_secrets()
@@ -189,9 +174,9 @@ void KeyServer::_dump_rotating_secrets()
   }
 }
 
-int KeyServer::_rotate_secret(uint32_t service_id)
+int KeyServer::_rotate_secret(uint32_t service_id, KeyServerData &pending_data)
 {
-  RotatingSecrets& r = data.rotating_secrets[service_id];
+  RotatingSecrets& r = pending_data.rotating_secrets[service_id];
   int added = 0;
   utime_t now = ceph_clock_now();
   double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;
@@ -356,19 +341,30 @@ void KeyServer::encode_plaintext(bufferlist &bl)
   bl.append(os.str());
 }
 
-bool KeyServer::updated_rotating(bufferlist& rotating_bl, version_t& rotating_ver)
+bool KeyServer::prepare_rotating_update(bufferlist& rotating_bl)
 {
   std::scoped_lock l{lock};
+  ldout(cct, 20) << __func__ << " before: data.rotating_ver=" << data.rotating_ver
+                << dendl;
 
-  _check_rotating_secrets(); 
+  KeyServerData pending_data(nullptr);
+  pending_data.rotating_ver = data.rotating_ver + 1;
+  pending_data.rotating_secrets = data.rotating_secrets;
 
-  if (data.rotating_ver <= rotating_ver)
+  int added = 0;
+  added += _rotate_secret(CEPH_ENTITY_TYPE_AUTH, pending_data);
+  added += _rotate_secret(CEPH_ENTITY_TYPE_MON, pending_data);
+  added += _rotate_secret(CEPH_ENTITY_TYPE_OSD, pending_data);
+  added += _rotate_secret(CEPH_ENTITY_TYPE_MDS, pending_data);
+  added += _rotate_secret(CEPH_ENTITY_TYPE_MGR, pending_data);
+  if (!added) {
     return false;
-  data.encode_rotating(rotating_bl);
-
-  rotating_ver = data.rotating_ver;
+  }
 
+  ldout(cct, 20) << __func__ << " after: pending_data.rotating_ver="
+                << pending_data.rotating_ver
+                << dendl;
+  pending_data.encode_rotating(rotating_bl);
   return true;
 }
 
index 3576c42c2357adad37bc1ce804d45558240c51ba..945a7f4dcd8979f64643e6924173c22104c5d687 100644 (file)
@@ -195,8 +195,7 @@ class KeyServer : public KeyStore {
   KeyServerData data;
   mutable ceph::mutex lock;
 
-  int _rotate_secret(uint32_t service_id);
-  bool _check_rotating_secrets();
+  int _rotate_secret(uint32_t service_id, KeyServerData &pending_data);
   void _dump_rotating_secrets();
   int _build_session_auth_info(uint32_t service_id, 
                               const AuthTicket& parent_ticket,
@@ -215,6 +214,8 @@ public:
   int start_server();
   void rotate_timeout(double timeout);
 
+  void dump();
+  
   int build_session_auth_info(uint32_t service_id,
                              const AuthTicket& parent_ticket,
                              CephXSessionAuthInfo& info);
@@ -297,7 +298,7 @@ public:
     }
   }
 
-  bool updated_rotating(ceph::buffer::list& rotating_bl, version_t& rotating_ver);
+  bool prepare_rotating_update(ceph::buffer::list& rotating_bl);
 
   bool get_rotating_encrypted(const EntityName& name, ceph::buffer::list& enc_bl) const;
 
index 4224499c4749840311b2e5a1a8c0decc015788c1..9166553dc7354a1896e7046f0b472581457541e0 100644 (file)
@@ -13,7 +13,7 @@ set(CEPH_VOLUME_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-volume-virtualenv)
 
 add_custom_command(
   OUTPUT ${CEPH_VOLUME_VIRTUALENV}/bin/python
-  COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${Python_EXECUTABLE} ${CEPH_VOLUME_VIRTUALENV}
+  COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${Python3_EXECUTABLE} ${CEPH_VOLUME_VIRTUALENV}
   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-volume
   COMMENT "ceph-volume venv is being created")
 
index 0f38249e1474ffc82f30e666cb1f0818e2dda40a..e5551206e16b66a11ae3cec1c4749e63f26866a1 100644 (file)
@@ -376,8 +376,12 @@ class PVolume(object):
             self.set_tag(k, v)
         # after setting all the tags, refresh them for the current object, use the
         # pv_* identifiers to filter because those shouldn't change
-        pv_object = self.get_first_pv(filter={'pv_name': self.pv_name,
-                                              'pv_uuid': self.pv_uuid})
+        pv_object = self.get_single_pv(filter={'pv_name': self.pv_name,
+                                               'pv_uuid': self.pv_uuid})
+
+        if not pv_object:
+            raise RuntimeError('No PV was found.')
+
         self.tags = pv_object.tags
 
     def set_tag(self, key, value):
@@ -471,15 +475,21 @@ def get_pvs(fields=PV_FIELDS, filters='', tags=None):
     return [PVolume(**pv_report) for pv_report in pvs_report]
 
 
-def get_first_pv(fields=PV_FIELDS, filters=None, tags=None):
+def get_single_pv(fields=PV_FIELDS, filters=None, tags=None):
     """
-    Wrapper of get_pv meant to be a convenience method to avoid the phrase::
+    Wrapper of get_pvs() meant to be a convenience method to avoid the phrase::
         pvs = get_pvs()
         if len(pvs) >= 1:
             pv = pvs[0]
     """
     pvs = get_pvs(fields=fields, filters=filters, tags=tags)
-    return pvs[0] if len(pvs) > 0 else []
+
+    if len(pvs) == 0:
+        return None
+    if len(pvs) > 1:
+        raise RuntimeError('Filters {} matched more than 1 PV present on this host.'.format(str(filters)))
+
+    return pvs[0]
 
 
 ################################
@@ -650,7 +660,7 @@ def create_vg(devices, name=None, name_prefix=None):
         name] + devices
     )
 
-    return get_first_vg(filters={'vg_name': name})
+    return get_single_vg(filters={'vg_name': name})
 
 
 def extend_vg(vg, devices):
@@ -674,7 +684,7 @@ def extend_vg(vg, devices):
         vg.name] + devices
     )
 
-    return get_first_vg(filters={'vg_name': vg.name})
+    return get_single_vg(filters={'vg_name': vg.name})
 
 
 def reduce_vg(vg, devices):
@@ -696,7 +706,7 @@ def reduce_vg(vg, devices):
         vg.name] + devices
     )
 
-    return get_first_vg(filter={'vg_name': vg.name})
+    return get_single_vg(filter={'vg_name': vg.name})
 
 
 def remove_vg(vg_name):
@@ -742,15 +752,21 @@ def get_vgs(fields=VG_FIELDS, filters='', tags=None):
     return [VolumeGroup(**vg_report) for vg_report in vgs_report]
 
 
-def get_first_vg(fields=VG_FIELDS, filters=None, tags=None):
+def get_single_vg(fields=VG_FIELDS, filters=None, tags=None):
     """
-    Wrapper of get_vg meant to be a convenience method to avoid the phrase::
+    Wrapper of get_vgs() meant to be a convenience method to avoid the phrase::
         vgs = get_vgs()
         if len(vgs) >= 1:
             vg = vgs[0]
     """
     vgs = get_vgs(fields=fields, filters=filters, tags=tags)
-    return vgs[0] if len(vgs) > 0 else []
+
+    if len(vgs) == 0:
+        return None
+    if len(vgs) > 1:
+        raise RuntimeError('Filters {} matched more than 1 VG present on this host.'.format(str(filters)))
+
+    return vgs[0]
 
 
 def get_device_vgs(device, name_prefix=''):
@@ -970,7 +986,7 @@ def create_lv(name_prefix,
         ]
     process.run(command)
 
-    lv = get_first_lv(filters={'lv_name': name, 'vg_name': vg.vg_name})
+    lv = get_single_lv(filters={'lv_name': name, 'vg_name': vg.vg_name})
 
     if tags is None:
         tags = {
@@ -1095,15 +1111,21 @@ def get_lvs(fields=LV_FIELDS, filters='', tags=None):
     return [Volume(**lv_report) for lv_report in lvs_report]
 
 
-def get_first_lv(fields=LV_FIELDS, filters=None, tags=None):
+def get_single_lv(fields=LV_FIELDS, filters=None, tags=None):
     """
-    Wrapper of get_lv meant to be a convenience method to avoid the phrase::
+    Wrapper of get_lvs() meant to be a convenience method to avoid the phrase::
         lvs = get_lvs()
         if len(lvs) >= 1:
             lv = lvs[0]
     """
     lvs = get_lvs(fields=fields, filters=filters, tags=tags)
-    return lvs[0] if len(lvs) > 0 else []
+
+    if len(lvs) == 0:
+        return None
+    if len(lvs) > 1:
+        raise RuntimeError('Filters {} matched more than 1 LV present on this host.'.format(str(filters)))
+
+    return lvs[0]
 
 
 def get_lv_by_name(name):
index c864b0e9f05289eaf3fa64101ae598691ac09c47..70fceeab6457257416b3368044f41c359ec9249d 100644 (file)
@@ -245,7 +245,7 @@ class Activate(object):
             terminal.warning('Verify OSDs are present with "ceph-volume lvm list"')
             return
         for osd_fsid, osd_id in osds.items():
-            if systemctl.osd_is_active(osd_id):
+            if not args.no_systemd and systemctl.osd_is_active(osd_id):
                 terminal.warning(
                     'OSD ID %s FSID %s process is active. Skipping activation' % (osd_id, osd_fsid)
                 )
index e64e4b64e40f8347ed6017fc00bc4de32501a731..c1b23b448eff3e0631439ad23e2e895c8d10911f 100644 (file)
@@ -112,35 +112,55 @@ def get_physical_fast_allocs(devices, type_, fast_slots_per_device, new_osds, ar
         requested_size = get_size_fct(lv_format=False)
 
     ret = []
-    for dev in devices:
-        if not dev.available_lvm:
-            continue
-        # any LV present is considered a taken slot
-        occupied_slots = len(dev.lvs)
-        # this only looks at the first vg on device, unsure if there is a better
-        # way
-        dev_size = dev.vg_size[0]
-        abs_size = disk.Size(b=int(dev_size / requested_slots))
-        free_size = dev.vg_free[0]
-        relative_size = int(abs_size) / dev_size
-        if requested_size:
-            if requested_size <= abs_size:
-                abs_size = requested_size
-                relative_size = int(abs_size) / dev_size
-            else:
-                mlogger.error(
-                    '{} was requested for {}, but only {} can be fulfilled'.format(
-                        requested_size,
-                        '{}_size'.format(type_),
-                        abs_size,
-                    ))
-                exit(1)
-        while abs_size <= free_size and len(ret) < new_osds and occupied_slots < fast_slots_per_device:
-            free_size -= abs_size.b
-            occupied_slots += 1
-            ret.append((dev.path, relative_size, abs_size, requested_slots))
+    vg_device_map = group_devices_by_vg(devices)
+    for vg_devices in vg_device_map.values():
+        for dev in vg_devices:
+            if not dev.available_lvm:
+                continue
+            # any LV present is considered a taken slot
+            occupied_slots = len(dev.lvs)
+            # prior to v15.2.8, db/wal deployments were grouping multiple fast devices into single VGs - we need to
+            # multiply requested_slots (per device) by the number of devices in the VG in order to ensure that
+            # abs_size is calculated correctly from vg_size
+            slots_for_vg = len(vg_devices) * requested_slots
+            dev_size = dev.vg_size[0]
+            # this only looks at the first vg on device, unsure if there is a better
+            # way
+            abs_size = disk.Size(b=int(dev_size / slots_for_vg))
+            free_size = dev.vg_free[0]
+            relative_size = int(abs_size) / dev_size
+            if requested_size:
+                if requested_size <= abs_size:
+                    abs_size = requested_size
+                    relative_size = int(abs_size) / dev_size
+                else:
+                    mlogger.error(
+                        '{} was requested for {}, but only {} can be fulfilled'.format(
+                            requested_size,
+                            '{}_size'.format(type_),
+                            abs_size,
+                        ))
+                    exit(1)
+            while abs_size <= free_size and len(ret) < new_osds and occupied_slots < fast_slots_per_device:
+                free_size -= abs_size.b
+                occupied_slots += 1
+                ret.append((dev.path, relative_size, abs_size, requested_slots))
     return ret
 
+def group_devices_by_vg(devices):
+    result = dict()
+    result['unused_devices'] = []
+    for dev in devices:
+        if len(dev.vgs) > 0:
+            # already using assumption that a PV only belongs to single VG in other places
+            vg_name = dev.vgs[0].name
+            if vg_name in result:
+                result[vg_name].append(dev)
+            else:
+                result[vg_name] = [dev]
+        else:
+            result['unused_devices'].append(dev)
+    return result
 
 def get_lvm_fast_allocs(lvs):
     return [("{}/{}".format(d.vg_name, d.lv_name), 100.0,
@@ -319,6 +339,7 @@ class Batch(object):
             nargs='*',
             default=[],
             help='Reuse existing OSD ids',
+            type=common.valid_osd_id
         )
         self.args = parser.parse_args(argv)
         self.parser = parser
index 06369e479d4c72a8731ef63c74f7d406bbec8dd8..752f354f35aacfab6aa63165ef589f6c1d1edd9f 100644 (file)
@@ -3,6 +3,8 @@ from ceph_volume import process, conf
 from ceph_volume import terminal
 import argparse
 
+def valid_osd_id(val):
+    return str(int(val))
 
 def rollback_osd(args, osd_id=None):
     """
@@ -56,6 +58,7 @@ common_args = {
     '--osd-id': {
         'help': 'Reuse an existing OSD id',
         'default': None,
+        'type': valid_osd_id,
     },
     '--osd-fsid': {
         'help': 'Reuse an existing OSD fsid',
index 886b9f7b4fd6b1a6e54a6b71be50358d33482f15..dc982f153b4ed25a02626bfed8bd3d1c630edd82 100644 (file)
@@ -8,6 +8,7 @@ from ceph_volume.util.device import Device
 from ceph_volume import decorators, terminal, process
 from ceph_volume.api import lvm as api
 from ceph_volume.systemd import systemctl
+from ceph_volume.devices.lvm.common import valid_osd_id
 
 
 logger = logging.getLogger(__name__)
@@ -275,7 +276,7 @@ class Migrate(object):
     # (in the order of precedence, stop on the first match)
     # if source list has DB volume - target device replaces it.
     # if source list has WAL volume - target device replace it.
-    # if source list has slow volume only - operation isn\92t permitted,
+    # if source list has slow volume only - operation isn't permitted,
     #  requires explicit allocation via new-db/new-wal command.detects which
     def get_target_type_by_source(self, devices):
         ret = None
@@ -413,7 +414,7 @@ class Migrate(object):
         target_lv = api.get_lv_by_fullname(self.args.target)
         if not target_lv:
             mlogger.error(
-                'Target path "{}" is not a Logical Volume'.formaat(
+                'Target path "{}" is not a Logical Volume'.format(
                     self.args.target))
             raise SystemExit(
                 'Unable to migrate to : {}'.format(self.args.target))
@@ -447,6 +448,7 @@ class Migrate(object):
             '--osd-id',
             required=True,
             help='Specify an OSD ID to detect associated devices for zapping',
+            type=valid_osd_id
         )
 
         parser.add_argument(
@@ -545,6 +547,7 @@ class NewVolume(object):
             '--osd-id',
             required=True,
             help='Specify an OSD ID to attach new volume to',
+            type=valid_osd_id,
         )
 
         parser.add_argument(
index f0c3959a6272485bdf0cf5e598aff94e6c09141c..2f715fdba122c8a87fc2a097a34df4c66c0766a1 100644 (file)
@@ -151,8 +151,8 @@ class Prepare(object):
 
         try:
             vg_name, lv_name = device_name.split('/')
-            lv = api.get_first_lv(filters={'lv_name': lv_name,
-                                           'vg_name': vg_name})
+            lv = api.get_single_lv(filters={'lv_name': lv_name,
+                                            'vg_name': vg_name})
         except ValueError:
             lv = None
 
@@ -240,8 +240,8 @@ class Prepare(object):
 
         try:
             vgname, lvname = self.args.data.split('/')
-            lv = api.get_first_lv(filters={'lv_name': lvname,
-                                           'vg_name': vgname})
+            lv = api.get_single_lv(filters={'lv_name': lvname,
+                                            'vg_name': vgname})
         except ValueError:
             lv = None
 
@@ -325,7 +325,7 @@ class Prepare(object):
 
             try:
                 vg_name, lv_name = self.args.data.split('/')
-                data_lv = api.get_first_lv(filters={'lv_name': lv_name,
+                data_lv = api.get_single_lv(filters={'lv_name': lv_name,
                                                     'vg_name': vg_name})
             except ValueError:
                 data_lv = None
@@ -340,8 +340,8 @@ class Prepare(object):
             data_lv.set_tags(tags)
             if not journal_device.startswith('/'):
                 # we got a journal lv, set rest of the tags
-                api.get_first_lv(filters={'lv_name': lv_name,
-                                          'vg_name': vg_name}).set_tags(tags)
+                api.get_single_lv(filters={'lv_name': lv_name,
+                                           'vg_name': vg_name}).set_tags(tags)
 
             prepare_filestore(
                 data_lv.lv_path,
@@ -354,8 +354,8 @@ class Prepare(object):
         elif self.args.bluestore:
             try:
                 vg_name, lv_name = self.args.data.split('/')
-                block_lv = api.get_first_lv(filters={'lv_name': lv_name,
-                                                 'vg_name': vg_name})
+                block_lv = api.get_single_lv(filters={'lv_name': lv_name,
+                                                      'vg_name': vg_name})
             except ValueError:
                 block_lv = None
 
index 21b54b6c0c419978bc5a9cfd6f8b3fbb41bb6087..20023a27c901143213b15e2231279b58963d4a4e 100644 (file)
@@ -10,6 +10,7 @@ from ceph_volume.api import lvm as api
 from ceph_volume.util import system, encryption, disk, arg_validators, str_to_int, merge_dict
 from ceph_volume.util.device import Device
 from ceph_volume.systemd import systemctl
+from ceph_volume.devices.lvm.common import valid_osd_id
 
 logger = logging.getLogger(__name__)
 mlogger = terminal.MultiLogger(__name__)
@@ -166,8 +167,8 @@ class Zap(object):
         Device examples: vg-name/lv-name, /dev/vg-name/lv-name
         Requirements: Must be a logical volume (LV)
         """
-        lv = api.get_first_lv(filters={'lv_name': device.lv_name, 'vg_name':
-                                       device.vg_name})
+        lv = api.get_single_lv(filters={'lv_name': device.lv_name, 'vg_name':
+                                        device.vg_name})
         self.unmount_lv(lv)
 
         wipefs(device.abspath)
@@ -231,7 +232,7 @@ class Zap(object):
                 mlogger.info('Zapping lvm member {}. lv_path is {}'.format(device.abspath, lv.lv_path))
                 self.zap_lv(Device(lv.lv_path))
             else:
-                vg = api.get_first_vg(filters={'vg_name': lv.vg_name})
+                vg = api.get_single_vg(filters={'vg_name': lv.vg_name})
                 if vg:
                     mlogger.info('Found empty VG {}, removing'.format(vg.vg_name))
                     api.remove_vg(vg.vg_name)
@@ -376,6 +377,7 @@ class Zap(object):
 
         parser.add_argument(
             '--osd-id',
+            type=valid_osd_id,
             help='Specify an OSD ID to detect associated devices for zapping',
         )
 
index 34da0962b0fc8639cc6bc095c8e29f169ffe1e35..70e5256d27317f97c6705733d4d8679f739960a1 100644 (file)
@@ -80,7 +80,7 @@ class Scan(object):
             device = os.readlink(path)
         else:
             device = path
-        lvm_device = lvm.get_first_lv(filters={'lv_path': device})
+        lvm_device = lvm.get_single_lv(filters={'lv_path': device})
         if lvm_device:
             device_uuid = lvm_device.lv_uuid
         else:
index f01ceb4f337a5a4590a744e27097150535df4194..16e586e02b22a86aedbe4cfe21fd5b48930d99da 100644 (file)
@@ -191,23 +191,23 @@ class TestCreateLV(object):
 
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_size(self, m_get_first_lv, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_size(self, m_get_single_lv, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group, size=419430400, tags={'ceph.type': 'data'})
         expected = ['lvcreate', '--yes', '-l', '100', '-n', 'foo-0', 'foo_group']
         m_run.assert_called_with(expected)
 
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_size_adjust_if_1percent_over(self, m_get_first_lv, m_call, m_run, monkeypatch):
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_size_adjust_if_1percent_over(self, m_get_single_lv, m_call, m_run, monkeypatch):
         foo_volume = api.Volume(lv_name='foo', lv_path='/path', vg_name='foo_group', lv_tags='')
         foo_group = api.VolumeGroup(vg_name='foo_group',
                                     vg_extent_size="4194304",
                                     vg_extent_count="1000",
                                     vg_free_count="1000")
-        m_get_first_lv.return_value = foo_volume
+        m_get_single_lv.return_value = foo_volume
         # 423624704 should be just under 1% off of the available size 419430400
         api.create_lv('foo', 0, vg=foo_group, size=4232052736, tags={'ceph.type': 'data'})
         expected = ['lvcreate', '--yes', '-l', '1000', '-n', 'foo-0', 'foo_group']
@@ -215,17 +215,17 @@ class TestCreateLV(object):
 
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_size_too_large(self, m_get_first_lv, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_size_too_large(self, m_get_single_lv, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         with pytest.raises(RuntimeError):
             api.create_lv('foo', 0, vg=self.foo_group, size=5368709120, tags={'ceph.type': 'data'})
 
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_extents(self, m_get_first_lv, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_extents(self, m_get_single_lv, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group, extents='50', tags={'ceph.type': 'data'})
         expected = ['lvcreate', '--yes', '-l', '50', '-n', 'foo-0', 'foo_group']
         m_run.assert_called_with(expected)
@@ -235,18 +235,18 @@ class TestCreateLV(object):
                               (3, 33),])
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_slots(self, m_get_first_lv, m_call, m_run, monkeypatch, test_input, expected):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_slots(self, m_get_single_lv, m_call, m_run, monkeypatch, test_input, expected):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group, slots=test_input, tags={'ceph.type': 'data'})
         expected = ['lvcreate', '--yes', '-l', str(expected), '-n', 'foo-0', 'foo_group']
         m_run.assert_called_with(expected)
 
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_uses_all(self, m_get_first_lv, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_uses_all(self, m_get_single_lv, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group, tags={'ceph.type': 'data'})
         expected = ['lvcreate', '--yes', '-l', '100%FREE', '-n', 'foo-0', 'foo_group']
         m_run.assert_called_with(expected)
@@ -254,9 +254,9 @@ class TestCreateLV(object):
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
     @patch('ceph_volume.api.lvm.Volume.set_tags')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_calls_to_set_tags_default(self, m_get_first_lv, m_set_tags, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_calls_to_set_tags_default(self, m_get_single_lv, m_set_tags, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group)
         tags = {
             "ceph.osd_id": "null",
@@ -269,9 +269,9 @@ class TestCreateLV(object):
     @patch('ceph_volume.api.lvm.process.run')
     @patch('ceph_volume.api.lvm.process.call')
     @patch('ceph_volume.api.lvm.Volume.set_tags')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_calls_to_set_tags_arg(self, m_get_first_lv, m_set_tags, m_call, m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_calls_to_set_tags_arg(self, m_get_single_lv, m_set_tags, m_call, m_run, monkeypatch):
+        m_get_single_lv.return_value = self.foo_volume
         api.create_lv('foo', 0, vg=self.foo_group, tags={'ceph.type': 'data'})
         tags = {
             "ceph.type": "data",
@@ -283,10 +283,10 @@ class TestCreateLV(object):
     @patch('ceph_volume.api.lvm.process.call')
     @patch('ceph_volume.api.lvm.get_device_vgs')
     @patch('ceph_volume.api.lvm.create_vg')
-    @patch('ceph_volume.api.lvm.get_first_lv')
-    def test_create_vg(self, m_get_first_lv, m_create_vg, m_get_device_vgs, m_call,
+    @patch('ceph_volume.api.lvm.get_single_lv')
+    def test_create_vg(self, m_get_single_lv, m_create_vg, m_get_device_vgs, m_call,
                        m_run, monkeypatch):
-        m_get_first_lv.return_value = self.foo_volume
+        m_get_single_lv.return_value = self.foo_volume
         m_get_device_vgs.return_value = []
         api.create_lv('foo', 0, device='dev/foo', size='5G', tags={'ceph.type': 'data'})
         m_create_vg.assert_called_with('dev/foo', name_prefix='ceph')
@@ -377,19 +377,19 @@ class TestExtendVG(object):
         self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
 
     def test_uses_single_device_in_list(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.extend_vg(self.foo_volume, ['/dev/sda'])
         expected = ['vgextend', '--force', '--yes', 'foo', '/dev/sda']
         assert fake_run.calls[0]['args'][0] == expected
 
     def test_uses_single_device(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.extend_vg(self.foo_volume, '/dev/sda')
         expected = ['vgextend', '--force', '--yes', 'foo', '/dev/sda']
         assert fake_run.calls[0]['args'][0] == expected
 
     def test_uses_multiple_devices(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.extend_vg(self.foo_volume, ['/dev/sda', '/dev/sdb'])
         expected = ['vgextend', '--force', '--yes', 'foo', '/dev/sda', '/dev/sdb']
         assert fake_run.calls[0]['args'][0] == expected
@@ -401,19 +401,19 @@ class TestReduceVG(object):
         self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
 
     def test_uses_single_device_in_list(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.reduce_vg(self.foo_volume, ['/dev/sda'])
         expected = ['vgreduce', '--force', '--yes', 'foo', '/dev/sda']
         assert fake_run.calls[0]['args'][0] == expected
 
     def test_uses_single_device(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.reduce_vg(self.foo_volume, '/dev/sda')
         expected = ['vgreduce', '--force', '--yes', 'foo', '/dev/sda']
         assert fake_run.calls[0]['args'][0] == expected
 
     def test_uses_multiple_devices(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.reduce_vg(self.foo_volume, ['/dev/sda', '/dev/sdb'])
         expected = ['vgreduce', '--force', '--yes', 'foo', '/dev/sda', '/dev/sdb']
         assert fake_run.calls[0]['args'][0] == expected
@@ -425,28 +425,28 @@ class TestCreateVG(object):
         self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
 
     def test_no_name(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.create_vg('/dev/sda')
         result = fake_run.calls[0]['args'][0]
         assert '/dev/sda' in result
         assert result[-2].startswith('ceph-')
 
     def test_devices_list(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.create_vg(['/dev/sda', '/dev/sdb'], name='ceph')
         result = fake_run.calls[0]['args'][0]
         expected = ['vgcreate', '--force', '--yes', 'ceph', '/dev/sda', '/dev/sdb']
         assert result == expected
 
     def test_name_prefix(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.create_vg('/dev/sda', name_prefix='master')
         result = fake_run.calls[0]['args'][0]
         assert '/dev/sda' in result
         assert result[-2].startswith('master-')
 
     def test_specific_name(self, monkeypatch, fake_run):
-        monkeypatch.setattr(api, 'get_first_vg', lambda **kw: True)
+        monkeypatch.setattr(api, 'get_single_vg', lambda **kw: True)
         api.create_vg('/dev/sda', name='master')
         result = fake_run.calls[0]['args'][0]
         assert '/dev/sda' in result
@@ -780,91 +780,106 @@ class TestGetLVs(object):
         assert api.get_lvs() == []
 
 
-class TestGetFirstPV(object):
+class TestGetSinglePV(object):
 
-    def test_get_first_pv(self, monkeypatch):
-        pv1 = api.PVolume(pv_name='/dev/sda', pv_uuid='0000', pv_tags={},
-                          vg_name='vg1')
-        pv2 = api.PVolume(pv_name='/dev/sdb', pv_uuid='0001', pv_tags={},
-                          vg_name='vg2')
-        stdout = ['{};{};{};{};;'.format(pv1.pv_name, pv1.pv_tags, pv1.pv_uuid, pv1.vg_name),
-                  '{};{};{};{};;'.format(pv2.pv_name, pv2.pv_tags, pv2.pv_uuid, pv2.vg_name)]
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
+    @patch('ceph_volume.devices.lvm.prepare.api.get_pvs')
+    def test_get_single_pv_multiple_matches_raises_runtimeerror(self, m_get_pvs):
+        fake_pvs = []
+        fake_pvs.append(api.PVolume(pv_name='/dev/sda', pv_tags={}))
+        fake_pvs.append(api.PVolume(pv_name='/dev/sdb', pv_tags={}))
 
-        pv_ = api.get_first_pv()
-        assert isinstance(pv_, api.PVolume)
-        assert pv_.pv_name == pv1.pv_name
+        m_get_pvs.return_value = fake_pvs
 
-    def test_get_first_pv_single_pv(self, monkeypatch):
-        pv = api.PVolume(pv_name='/dev/sda', pv_uuid='0000', pv_tags={},
-                         vg_name='vg1')
-        stdout = ['{};;;;;;'.format(pv.pv_name)]
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
+        with pytest.raises(RuntimeError) as e:
+            api.get_single_pv()
+        assert "matched more than 1 PV present on this host." in str(e.value)
 
-        pv_ = api.get_first_pv()
-        assert isinstance(pv_, api.PVolume)
-        assert pv_.pv_name == pv.pv_name
+    @patch('ceph_volume.devices.lvm.prepare.api.get_pvs')
+    def test_get_single_pv_no_match_returns_none(self, m_get_pvs):
+        m_get_pvs.return_value = []
 
-    def test_get_first_pv_empty(self, monkeypatch):
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: ('', '', 0))
-        assert api.get_first_pv() == []
+        pv = api.get_single_pv()
+        assert pv == None
 
+    @patch('ceph_volume.devices.lvm.prepare.api.get_pvs')
+    def test_get_single_pv_one_match(self, m_get_pvs):
+        fake_pvs = []
+        fake_pvs.append(api.PVolume(pv_name='/dev/sda', pv_tags={}))
+        m_get_pvs.return_value = fake_pvs
 
-class TestGetFirstVG(object):
+        pv = api.get_single_pv()
 
-    def test_get_first_vg(self, monkeypatch):
-        vg1 = api.VolumeGroup(vg_name='vg1')
-        vg2 = api.VolumeGroup(vg_name='vg2')
-        stdout = ['{};;;;;;'.format(vg1.vg_name), '{};;;;;;'.format(vg2.vg_name)]
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
+        assert isinstance(pv, api.PVolume)
+        assert pv.name == '/dev/sda'
 
-        vg_ = api.get_first_vg()
-        assert isinstance(vg_, api.VolumeGroup)
-        assert vg_.vg_name == vg1.vg_name
 
-    def test_get_first_vg_single_vg(self, monkeypatch):
-        vg = api.VolumeGroup(vg_name='vg')
-        stdout = ['{};;;;;;'.format(vg.vg_name)]
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
+class TestGetSingleVG(object):
 
-        vg_ = api.get_first_vg()
-        assert isinstance(vg_, api.VolumeGroup)
-        assert vg_.vg_name == vg.vg_name
+    @patch('ceph_volume.devices.lvm.prepare.api.get_vgs')
+    def test_get_single_vg_multiple_matches_raises_runtimeerror(self, m_get_vgs):
+        fake_vgs = []
+        fake_vgs.append(api.VolumeGroup(vg_name='vg1'))
+        fake_vgs.append(api.VolumeGroup(vg_name='vg2'))
 
-    def test_get_first_vg_empty(self, monkeypatch):
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: ('', '', 0))
-        vg_ = api.get_first_vg()
-        assert vg_ == []
+        m_get_vgs.return_value = fake_vgs
 
+        with pytest.raises(RuntimeError) as e:
+            api.get_single_vg()
+        assert "matched more than 1 VG present on this host." in str(e.value)
 
-class TestGetFirstLV(object):
+    @patch('ceph_volume.devices.lvm.prepare.api.get_vgs')
+    def test_get_single_vg_no_match_returns_none(self, m_get_vgs):
+        m_get_vgs.return_value = []
 
-    def test_get_first_lv(self, monkeypatch):
-        lv1 = api.Volume(lv_tags='ceph.type=data', lv_path='/dev/vg1/lv1',
-                         lv_name='lv1', vg_name='vg1')
-        lv2 = api.Volume(lv_tags='ceph.type=data', lv_path='/dev/vg2/lv2',
-                         lv_name='lv2', vg_name='vg2')
-        stdout = ['{};{};{};{}'.format(lv1.lv_tags, lv1.lv_path, lv1.lv_name,
-                                       lv1.vg_name),
-                  '{};{};{};{}'.format(lv2.lv_tags, lv2.lv_path, lv2.lv_name,
-                                       lv2.vg_name)]
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
+        vg = api.get_single_vg()
+        assert vg == None
 
-        lv_ = api.get_first_lv()
-        assert isinstance(lv_, api.Volume)
-        assert lv_.lv_name == lv1.lv_name
+    @patch('ceph_volume.devices.lvm.prepare.api.get_vgs')
+    def test_get_single_vg_one_match(self, m_get_vgs):
+        fake_vgs = []
+        fake_vgs.append(api.VolumeGroup(vg_name='vg1'))
+        m_get_vgs.return_value = fake_vgs
 
-    def test_get_first_lv_single_lv(self, monkeypatch):
-        stdout = ['ceph.type=data;/dev/vg/lv;lv;vg']
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: (stdout, '', 0))
-        lv = api.Volume(lv_tags='ceph.type=data',
-                           lv_path='/dev/vg/lv',
-                           lv_name='lv', vg_name='vg')
+        vg = api.get_single_vg()
 
-        lv_ = api.get_first_lv()
-        assert isinstance(lv_, api.Volume)
-        assert lv_.lv_name == lv.lv_name
+        assert isinstance(vg, api.VolumeGroup)
+        assert vg.name == 'vg1'
 
-    def test_get_first_lv_empty(self, monkeypatch):
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: ('', '', 0))
-        assert api.get_lvs() == []
+class TestGetSingleLV(object):
+
+    @patch('ceph_volume.devices.lvm.prepare.api.get_lvs')
+    def test_get_single_lv_multiple_matches_raises_runtimeerror(self, m_get_lvs):
+        fake_lvs = []
+        fake_lvs.append(api.Volume(lv_name='lv1',
+                                   lv_path='/dev/vg1/lv1',
+                                   vg_name='vg1',
+                                   lv_tags='',
+                                   lv_uuid='fake-uuid'))
+        fake_lvs.append(api.Volume(lv_name='lv1',
+                                   lv_path='/dev/vg2/lv1',
+                                   vg_name='vg2',
+                                   lv_tags='',
+                                   lv_uuid='fake-uuid'))
+        m_get_lvs.return_value = fake_lvs
+
+        with pytest.raises(RuntimeError) as e:
+            api.get_single_lv()
+        assert "matched more than 1 LV present on this host" in str(e.value)
+
+    @patch('ceph_volume.devices.lvm.prepare.api.get_lvs')
+    def test_get_single_lv_no_match_returns_none(self, m_get_lvs):
+        m_get_lvs.return_value = []
+
+        lv = api.get_single_lv()
+        assert lv == None
+
+    @patch('ceph_volume.devices.lvm.prepare.api.get_lvs')
+    def test_get_single_lv_one_match(self, m_get_lvs):
+        fake_lvs = []
+        fake_lvs.append(api.Volume(lv_name='lv1', lv_path='/dev/vg1/lv1', vg_name='vg1', lv_tags='', lv_uuid='fake-uuid'))
+        m_get_lvs.return_value = fake_lvs
+
+        lv_ = api.get_single_lv()
+
+        assert isinstance(lv_, api.Volume)
+        assert lv_.name == 'lv1'
index 149afbbc6523568f2559f0337afa96fc81a9c34c..8a7d5326db78b2003a9c810bb6283fb6b8930089 100644 (file)
@@ -63,6 +63,9 @@ def mock_lv_device_generator():
 def mock_devices_available():
     dev = create_autospec(device.Device)
     dev.path = '/dev/foo'
+    dev.vg_name = 'vg_foo'
+    dev.lv_name = 'lv_foo'
+    dev.vgs = [lvm.VolumeGroup(vg_name=dev.vg_name, lv_name=dev.lv_name)]
     dev.available_lvm = True
     dev.vg_size = [21474836480]
     dev.vg_free = dev.vg_size
@@ -73,6 +76,9 @@ def mock_device_generator():
     def mock_device():
         dev = create_autospec(device.Device)
         dev.path = '/dev/foo'
+        dev.vg_name = 'vg_foo'
+        dev.lv_name = 'lv_foo'
+        dev.vgs = [lvm.VolumeGroup(vg_name=dev.vg_name, lv_name=dev.lv_name)]
         dev.available_lvm = True
         dev.vg_size = [21474836480]
         dev.vg_free = dev.vg_size
@@ -287,7 +293,7 @@ def device_info(monkeypatch, patch_bluestore_label):
         monkeypatch.setattr("ceph_volume.sys_info.devices", {})
         monkeypatch.setattr("ceph_volume.util.device.disk.get_devices", lambda: devices)
         if not devices:
-            monkeypatch.setattr("ceph_volume.util.device.lvm.get_first_lv", lambda filters: lv)
+            monkeypatch.setattr("ceph_volume.util.device.lvm.get_single_lv", lambda filters: lv)
         else:
             monkeypatch.setattr("ceph_volume.util.device.lvm.get_device_lvs",
                                 lambda path: [lv])
index 46d7c3c83578e5be9201624deb65bf68405a1117..9b8fcbebeaef93fdc7eeb695db66196a3dfc3722 100644 (file)
@@ -51,7 +51,7 @@ class TestActivate(object):
         volumes = []
         volumes.append(FooVolume)
         monkeypatch.setattr(api, 'get_lvs', lambda **kwargs: [])
-        monkeypatch.setattr(api, 'get_first_lv', lambda **kwargs: [])
+        monkeypatch.setattr(api, 'get_single_lv', lambda **kwargs: [])
         monkeypatch.setattr(activate, 'activate_filestore', capture)
 
         args = Args(osd_id=None, osd_fsid='2222')
@@ -357,7 +357,7 @@ class TestActivateAll(object):
         assert 'a8789a96ce8b process is active. Skipping activation' in err
         assert 'b8218eaa1634 process is active. Skipping activation' in err
 
-    def test_detects_osds_to_activate(self, is_root, capture, monkeypatch):
+    def test_detects_osds_to_activate_systemd(self, is_root, capture, monkeypatch):
         monkeypatch.setattr('ceph_volume.devices.lvm.activate.direct_report', lambda: direct_report)
         monkeypatch.setattr('ceph_volume.devices.lvm.activate.systemctl.osd_is_active', lambda x: False)
         args = ['--all']
@@ -370,6 +370,18 @@ class TestActivateAll(object):
         assert calls[1]['kwargs']['osd_id'] == '1'
         assert calls[1]['kwargs']['osd_fsid'] == 'd0f3e4ad-e52a-4520-afc0-a8789a96ce8b'
 
+    def test_detects_osds_to_activate_no_systemd(self, is_root, capture, monkeypatch):
+        monkeypatch.setattr('ceph_volume.devices.lvm.activate.direct_report', lambda: direct_report)
+        args = ['--all', '--no-systemd']
+        activation = activate.Activate(args)
+        activation.activate = capture
+        activation.main()
+        calls = sorted(capture.calls, key=lambda x: x['kwargs']['osd_id'])
+        assert calls[0]['kwargs']['osd_id'] == '0'
+        assert calls[0]['kwargs']['osd_fsid'] == '957d22b7-24ce-466a-9883-b8218eaa1634'
+        assert calls[1]['kwargs']['osd_id'] == '1'
+        assert calls[1]['kwargs']['osd_fsid'] == 'd0f3e4ad-e52a-4520-afc0-a8789a96ce8b'
+
 #
 # Activate All fixture
 #
index 4bf026ae1f22fd42f542b4247a5590a6a28de8d1..2a334dad95d078a61a23984527025be729632759 100644 (file)
@@ -15,6 +15,10 @@ class TestBatch(object):
         b = batch.Batch([])
         b.main()
 
+    def test_invalid_osd_ids_passed(self):
+        with pytest.raises(SystemExit):
+            batch.Batch(argv=['--osd-ids', '1', 'foo']).main()
+
     def test_disjoint_device_lists(self, factory):
         device1 = factory(used_by_ceph=False, available=True, abspath="/dev/sda")
         device2 = factory(used_by_ceph=False, available=True, abspath="/dev/sdb")
index cf4b68c7143783cf990b9a01b3434f4019e01a1e..30d91b20f68b90f047a06de0459d85ef1f96c17f 100644 (file)
@@ -106,7 +106,7 @@ class TestFullReport(object):
                          lv_path='/dev/VolGroup/lv', vg_name='VolGroup')
         volumes = []
         volumes.append(osd)
-        monkeypatch.setattr(lvm.listing.api, 'get_first_pv', lambda **kwargs: pv)
+        monkeypatch.setattr(lvm.listing.api, 'get_single_pv', lambda **kwargs: pv)
         monkeypatch.setattr(lvm.listing.api, 'get_lvs', lambda **kwargs:
                             volumes)
 
@@ -126,7 +126,7 @@ class TestFullReport(object):
         volumes = []
         volumes.append(osd)
         volumes.append(journal)
-        monkeypatch.setattr(lvm.listing.api,'get_first_pv',lambda **kwargs:pv)
+        monkeypatch.setattr(lvm.listing.api,'get_single_pv',lambda **kwargs:pv)
         monkeypatch.setattr(lvm.listing.api, 'get_lvs', lambda **kwargs:
                             volumes)
 
index 6c20273507a4a782d296183abeda60fe97faddf3..74d6589502b6f56dfbd1a730ebda9a9155f02efd 100644 (file)
@@ -992,13 +992,17 @@ class TestNew(object):
 
 class TestMigrate(object):
 
+    def test_invalid_osd_id_passed(self, is_root):
+        with pytest.raises(SystemExit):
+            migrate.Migrate(argv=['--osd-fsid', '123', '--from', 'data', '--target', 'foo', '--osd-id', 'foo']).main()
+
     mock_volume = None
     def mock_get_lv_by_fullname(self, *args, **kwargs):
         return self.mock_volume
 
     mock_process_input = []
     def mock_process(self, *args, **kwargs):
-        self.mock_process_input.append(args[0]);
+        self.mock_process_input.append(args[0])
         return ('', '', 0)
 
     mock_single_volumes = {}
index 70915a0fe03af9a57b0bd2a7fbd80c7601df7d42..fcbc276f0de1b6f4b3d25cc0f11a865881cb2da4 100644 (file)
@@ -121,10 +121,10 @@ class TestPrepare(object):
         assert result == ('', '', {'ceph.type': 'data'})
 
     @patch('ceph_volume.api.lvm.Volume.set_tags')
-    @patch('ceph_volume.devices.lvm.prepare.api.get_first_lv')
-    def test_setup_device_lv_passed(self, m_get_first_lv, m_set_tags):
+    @patch('ceph_volume.devices.lvm.prepare.api.get_single_lv')
+    def test_setup_device_lv_passed(self, m_get_single_lv, m_set_tags):
         fake_volume = api.Volume(lv_name='lv_foo', lv_path='/fake-path', vg_name='vg_foo', lv_tags='', lv_uuid='fake-uuid')
-        m_get_first_lv.return_value = fake_volume
+        m_get_single_lv.return_value = fake_volume
         result = lvm.prepare.Prepare([]).setup_device(device_type='data', device_name='vg_foo/lv_foo', tags={'ceph.type': 'data'}, size=0, slots=None)
 
         assert result == ('/fake-path', 'fake-uuid', {'ceph.type': 'data',
@@ -147,9 +147,9 @@ class TestPrepare(object):
                                                     'ceph.data_device': '/fake-path'})
 
     @patch('ceph_volume.devices.lvm.prepare.Prepare.get_ptuuid')
-    @patch('ceph_volume.devices.lvm.prepare.api.get_first_lv')
-    def test_setup_device_partition_passed(self, m_get_first_lv, m_get_ptuuid):
-        m_get_first_lv.side_effect = ValueError()
+    @patch('ceph_volume.devices.lvm.prepare.api.get_single_lv')
+    def test_setup_device_partition_passed(self, m_get_single_lv, m_get_ptuuid):
+        m_get_single_lv.side_effect = ValueError()
         m_get_ptuuid.return_value = 'fake-uuid'
         result = lvm.prepare.Prepare([]).setup_device(device_type='data', device_name='/dev/sdx', tags={'ceph.type': 'data'}, size=0, slots=None)
 
@@ -158,6 +158,10 @@ class TestPrepare(object):
                                                     'ceph.data_uuid': 'fake-uuid',
                                                     'ceph.data_device': '/dev/sdx'})
 
+    def test_invalid_osd_id_passed(self):
+        with pytest.raises(SystemExit):
+            lvm.prepare.Prepare(argv=['--osd-id', 'foo']).main()
+
 
 class TestActivate(object):
 
index 1fa22e5b681552b43d1981492aa324374891107e..eff187228fc2b7b08072c44410f48f1045a85120 100644 (file)
@@ -7,6 +7,11 @@ from ceph_volume.api import lvm as api
 from ceph_volume.devices.lvm import zap
 
 
+class TestZap(object):
+    def test_invalid_osd_id_passed(self):
+        with pytest.raises(SystemExit):
+            zap.Zap(argv=['--osd-id', 'foo']).main()
+
 class TestFindAssociatedDevices(object):
 
     def test_no_lvs_found_that_match_id(self, monkeypatch, device_info):
index 8f8b31b7ecfcceb1fc15bff1d58e02c134bdba61..f5425165a8d66038256ec7f7635eb0263a3b954f 100644 (file)
@@ -390,7 +390,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
         # always make /dev/sd{a/b/c/d} so that CI can ensure that
         # virtualbox and libvirt will have the same devices to use for OSDs
         (0..3).each do |d|
-          lv.storage :file, :device => "sd#{driverletters[d]}", :size => '12G'
+          lv.storage :file, :device => "sd#{driverletters[d]}", :size => '100G'
         end
         lv.memory = MEMORY
         lv.random_hostname = true
index 8b155d97d8c3ff822396f041ad29b40d883e0218..5460fdd0db98c338c4d1d23bb6de6d618f45cc9d 100644 (file)
@@ -1,4 +1,4 @@
-
+---
 - hosts: osds
   become: yes
   tasks:
         - /opt/vdd/loop0_nvme0
         - /opt/vde/loop1_nvme1
 
-    - name: create 11GB sparse files for NVMe
-      command: "fallocate -l 11G {{ item }}"
+    - name: create 20GB sparse files for NVMe
+      command: "fallocate -l 20G {{ item }}"
       loop:
         - /opt/vdd/loop0_nvme0
         - /opt/vde/loop1_nvme1
index ced5d49e76c9cb155baf83409c17bf556db56c68..080823307d383ab04eb52b876813e57923e0aa80 100644 (file)
@@ -33,16 +33,7 @@ class TestOSDIDAvailable(object):
         stdout = ['', json.dumps(stdout)]
         monkeypatch.setattr('ceph_volume.process.call', lambda *a, **kw: (stdout, '', 0))
         result = prepare.osd_id_available(1)
-        assert not result
-
-    def test_invalid_osd_id(self, monkeypatch):
-        stdout = dict(nodes=[
-            dict(id=0),
-        ])
-        stdout = ['', json.dumps(stdout)]
-        monkeypatch.setattr('ceph_volume.process.call', lambda *a, **kw: (stdout, '', 0))
-        result = prepare.osd_id_available("foo")
-        assert not result
+        assert result
 
     def test_returns_true_when_id_is_destroyed(self, monkeypatch):
         stdout = dict(nodes=[
index 9a455883ed7bab7633601512ca6ef76b851e5405..010aad65d2a0d0d570df0b1983e2b0428b388f02 100644 (file)
@@ -162,11 +162,11 @@ class Device(object):
         # if the path is not absolute, we have 'vg/lv', let's use LV name
         # to get the LV.
         if self.path[0] == '/':
-            lv = lvm.get_first_lv(filters={'lv_path': self.path})
+            lv = lvm.get_single_lv(filters={'lv_path': self.path})
         else:
             vgname, lvname = self.path.split('/')
-            lv = lvm.get_first_lv(filters={'lv_name': lvname,
-                                           'vg_name': vgname})
+            lv = lvm.get_single_lv(filters={'lv_name': lvname,
+                                            'vg_name': vgname})
         if lv:
             self.lv_api = lv
             self.lvs = [lv]
index 85b7033c212a883af51bd71e8e1f06111d9f15ee..2c0bdc0495770624e90af945cd321cb2b1d8f51e 100644 (file)
@@ -183,6 +183,7 @@ def osd_id_available(osd_id):
     """
     if osd_id is None:
         return False
+
     bootstrap_keyring = '/var/lib/ceph/bootstrap-osd/%s.keyring' % conf.cluster
     stdout, stderr, returncode = process.call(
         [
@@ -202,7 +203,7 @@ def osd_id_available(osd_id):
     output = json.loads(''.join(stdout).strip())
     osds = output['nodes']
     osd = [osd for osd in osds if str(osd['id']) == str(osd_id)]
-    if osd and osd[0].get('status') == "destroyed":
+    if not osd or (osd and osd[0].get('status') == "destroyed"):
         return True
     return False
 
index 13f0f6e6a59ae8147d997d148e73224f7c90bf63..9fe5fb3763b382935b509e31a04712884b56c338 100755 (executable)
@@ -31,7 +31,7 @@ from contextlib import redirect_stdout
 import ssl
 from enum import Enum
 
-from typing import Dict, List, Tuple, Optional, Union, Any, NoReturn, Callable, IO, Sequence, TypeVar, cast, Set
+from typing import Dict, List, Tuple, Optional, Union, Any, NoReturn, Callable, IO, Sequence, TypeVar, cast, Set, Iterable
 
 import re
 import uuid
@@ -175,6 +175,9 @@ class ContainerEngine:
     def EXE(cls) -> str:
         raise NotImplementedError()
 
+    def __str__(self) -> str:
+        return f'{self.EXE} ({self.path})'
+
 
 class Podman(ContainerEngine):
     EXE = 'podman'
@@ -193,6 +196,10 @@ class Podman(ContainerEngine):
         out, _, _ = call_throws(ctx, [self.path, 'version', '--format', '{{.Client.Version}}'])
         self._version = _parse_podman_version(out)
 
+    def __str__(self) -> str:
+        version = '.'.join(map(str, self.version))
+        return f'{self.EXE} ({self.path}) version {version}'
+
 
 class Docker(ContainerEngine):
     EXE = 'docker'
@@ -207,7 +214,7 @@ logging_config = {
     'disable_existing_loggers': True,
     'formatters': {
         'cephadm': {
-            'format': '%(asctime)s %(levelname)s %(message)s'
+            'format': '%(asctime)s %(thread)x %(levelname)s %(message)s'
         },
     },
     'handlers': {
@@ -549,7 +556,7 @@ class CephIscsi(object):
         mounts[os.path.join(data_dir, 'keyring')] = '/etc/ceph/keyring:z'
         mounts[os.path.join(data_dir, 'iscsi-gateway.cfg')] = '/etc/ceph/iscsi-gateway.cfg:z'
         mounts[os.path.join(data_dir, 'configfs')] = '/sys/kernel/config'
-        mounts[log_dir] = '/var/log/rbd-target-api:z'
+        mounts[log_dir] = '/var/log:z'
         mounts['/dev'] = '/dev'
         return mounts
 
@@ -1286,28 +1293,28 @@ if sys.version_info < (3, 8):
 
         def __init__(self) -> None:
             self._pid_counter = itertools.count(0)
-            self._threads = {}
+            self._threads: Dict[Any, Any] = {}
 
-        def is_active(self):
+        def is_active(self) -> bool:
             return True
 
-        def close(self):
+        def close(self) -> None:
             self._join_threads()
 
-        def _join_threads(self):
+        def _join_threads(self) -> None:
             """Internal: Join all non-daemon threads"""
             threads = [thread for thread in list(self._threads.values())
                        if thread.is_alive() and not thread.daemon]
             for thread in threads:
                 thread.join()
 
-        def __enter__(self):
+        def __enter__(self) -> Any:
             return self
 
-        def __exit__(self, exc_type, exc_val, exc_tb):
+        def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
             pass
 
-        def __del__(self, _warn=warnings.warn):
+        def __del__(self, _warn: Any = warnings.warn) -> None:
             threads = [thread for thread in list(self._threads.values())
                        if thread.is_alive()]
             if threads:
@@ -1315,7 +1322,7 @@ if sys.version_info < (3, 8):
                       ResourceWarning,
                       source=self)
 
-        def add_child_handler(self, pid, callback, *args):
+        def add_child_handler(self, pid: Any, callback: Any, *args: Any) -> None:
             loop = events.get_event_loop()
             thread = threading.Thread(target=self._do_waitpid,
                                       name=f'waitpid-{next(self._pid_counter)}',
@@ -1324,16 +1331,16 @@ if sys.version_info < (3, 8):
             self._threads[pid] = thread
             thread.start()
 
-        def remove_child_handler(self, pid):
+        def remove_child_handler(self, pid: Any) -> bool:
             # asyncio never calls remove_child_handler() !!!
             # The method is no-op but is implemented because
             # abstract base classe requires it
             return True
 
-        def attach_loop(self, loop):
+        def attach_loop(self, loop: Any) -> None:
             pass
 
-        def _do_waitpid(self, loop, expected_pid, callback, args):
+        def _do_waitpid(self, loop: Any, expected_pid: Any, callback: Any, args: Any) -> None:
             assert expected_pid > 0
 
             try:
@@ -1408,8 +1415,6 @@ def call(ctx: CephadmContext,
         prefix += ': '
     timeout = timeout or ctx.timeout
 
-    logger.debug('Running command: %s' % ' '.join(command))
-
     async def tee(reader: asyncio.StreamReader) -> str:
         collected = StringIO()
         async for line in reader:
@@ -1994,13 +1999,12 @@ def find_container_engine(ctx: CephadmContext) -> Optional[ContainerEngine]:
         for i in CONTAINER_PREFERENCE:
             try:
                 return i()
-            except Exception as e:
-                logger.debug('Could not locate %s: %s' % (i.EXE, e))
+            except Exception:
+                pass
     return None
 
 
-def check_container_engine(ctx):
-    # type: (CephadmContext) -> None
+def check_container_engine(ctx: CephadmContext) -> ContainerEngine:
     engine = ctx.container_engine
     if not isinstance(engine, CONTAINER_PREFERENCE):
         # See https://github.com/python/mypy/issues/8993
@@ -2010,6 +2014,7 @@ def check_container_engine(ctx):
         engine.get_version(ctx)
         if engine.version < MIN_PODMAN_VERSION:
             raise Error('podman version %d.%d.%d or later is required' % MIN_PODMAN_VERSION)
+    return engine
 
 
 def get_unit_name(fsid, daemon_type, daemon_id=None):
@@ -2310,6 +2315,8 @@ def get_config_and_keyring(ctx):
         d = get_parm(ctx.config_json)
         config = d.get('config')
         keyring = d.get('keyring')
+        if config and keyring:
+            return config, keyring
 
     if 'config' in ctx and ctx.config:
         try:
@@ -2806,7 +2813,7 @@ def deploy_daemon_units(
             f.write(' '.join(CephIscsi.configfs_mount_umount(data_dir, mount=True)) + '\n')
             ceph_iscsi = CephIscsi.init(ctx, fsid, daemon_id)
             tcmu_container = ceph_iscsi.get_tcmu_runner_container()
-            _write_container_cmd_to_bash(ctx, f, tcmu_container, 'iscsi tcmu-runnter container', background=True)
+            _write_container_cmd_to_bash(ctx, f, tcmu_container, 'iscsi tcmu-runner container', background=True)
 
         _write_container_cmd_to_bash(ctx, f, c, '%s.%s' % (daemon_type, str(daemon_id)))
 
@@ -3433,12 +3440,12 @@ def command_version(ctx):
 def command_pull(ctx):
     # type: (CephadmContext) -> int
 
-    _pull_image(ctx, ctx.image)
+    _pull_image(ctx, ctx.image, ctx.insecure)
     return command_inspect_image(ctx)
 
 
-def _pull_image(ctx, image):
-    # type: (CephadmContext, str) -> None
+def _pull_image(ctx, image, insecure=False):
+    # type: (CephadmContext, str, bool) -> None
     logger.info('Pulling container image %s...' % image)
 
     ignorelist = [
@@ -3448,8 +3455,12 @@ def _pull_image(ctx, image):
     ]
 
     cmd = [ctx.container_engine.path, 'pull', image]
-    if isinstance(ctx.container_engine, Podman) and os.path.exists('/etc/ceph/podman-auth.json'):
-        cmd.append('--authfile=/etc/ceph/podman-auth.json')
+    if isinstance(ctx.container_engine, Podman):
+        if insecure:
+            cmd.append('--tls-verify=false')
+
+        if os.path.exists('/etc/ceph/podman-auth.json'):
+            cmd.append('--authfile=/etc/ceph/podman-auth.json')
     cmd_str = ' '.join(cmd)
 
     for sleep_secs in [1, 4, 25]:
@@ -3458,12 +3469,12 @@ def _pull_image(ctx, image):
             return
 
         if not any(pattern in err for pattern in ignorelist):
-            raise RuntimeError('Failed command: %s' % cmd_str)
+            raise Error('Failed command: %s' % cmd_str)
 
         logger.info('`%s` failed transiently. Retrying. waiting %s seconds...' % (cmd_str, sleep_secs))
         time.sleep(sleep_secs)
 
-    raise RuntimeError('Failed command: %s: maximum retries reached' % cmd_str)
+    raise Error('Failed command: %s: maximum retries reached' % cmd_str)
 
 ##################################
 
@@ -4036,10 +4047,10 @@ def prepare_bootstrap_config(
         logger.info('Adjusting default settings to suit single-host cluster...')
         # replicate across osds, not hosts
         if (
-                not cp.has_option('global', 'osd_crush_choose_leaf_type')
-                and not cp.has_option('global', 'osd crush choose leaf type')
+                not cp.has_option('global', 'osd_crush_chooseleaf_type')
+                and not cp.has_option('global', 'osd crush chooseleaf type')
         ):
-            cp.set('global', 'osd_crush_choose_leaf_type', '0')
+            cp.set('global', 'osd_crush_chooseleaf_type', '0')
         # replica 2x
         if (
                 not cp.has_option('global', 'osd_pool_default_size')
@@ -4125,6 +4136,65 @@ def finish_bootstrap_config(
     pass
 
 
+# funcs to process spec file for apply spec
+def _parse_yaml_docs(f: Iterable[str]) -> List[List[str]]:
+    docs = []
+    current_doc = []  # type: List[str]
+    for line in f:
+        if '---' in line:
+            if current_doc:
+                docs.append(current_doc)
+            current_doc = []
+        else:
+            current_doc.append(line.rstrip())
+    if current_doc:
+        docs.append(current_doc)
+    return docs
+
+
+def _parse_yaml_obj(doc: List[str]) -> Dict[str, str]:
+    # note: this only parses the first layer of yaml
+    obj = {}  # type: Dict[str, str]
+    current_key = ''
+    for line in doc:
+        if line.startswith(' '):
+            obj[current_key] += line.strip()
+        elif line.endswith(':'):
+            current_key = line.strip(':')
+            obj[current_key] = ''
+        else:
+            current_key, val = line.split(':')
+            obj[current_key] = val.strip()
+    return obj
+
+
+def parse_yaml_objs(f: Iterable[str]) -> List[Dict[str, str]]:
+    objs = []
+    for d in _parse_yaml_docs(f):
+        objs.append(_parse_yaml_obj(d))
+    return objs
+
+
+def _distribute_ssh_keys(ctx: CephadmContext, host_spec: Dict[str, str], bootstrap_hostname: str) -> int:
+    # copy ssh key to hosts in host spec (used for apply spec)
+    ssh_key = '/etc/ceph/ceph.pub'
+    if ctx.ssh_public_key:
+        ssh_key = ctx.ssh_public_key.name
+
+    if bootstrap_hostname != host_spec['hostname']:
+        if 'addr' in host_spec:
+            addr = host_spec['addr']
+        else:
+            addr = host_spec['hostname']
+        out, err, code = call(ctx, ['sudo', '-u', ctx.ssh_user, 'ssh-copy-id', '-f', '-i', ssh_key, '-o StrictHostKeyChecking=no', '%s@%s' % (ctx.ssh_user, addr)])
+        if code:
+            logger.info('\nCopying ssh key to host %s at address %s failed!\n' % (host_spec['hostname'], addr))
+            return 1
+        else:
+            logger.info('Added ssh key to host %s at address %s\n' % (host_spec['hostname'], addr))
+    return 0
+
+
 @default_image
 def command_bootstrap(ctx):
     # type: (CephadmContext) -> int
@@ -4339,25 +4409,22 @@ def command_bootstrap(ctx):
 
     if ctx.apply_spec:
         logger.info('Applying %s to cluster' % ctx.apply_spec)
-
+        # copy ssh key to hosts in spec file
         with open(ctx.apply_spec) as f:
-            for line in f:
-                if 'hostname:' in line:
-                    line = line.replace('\n', '')
-                    split = line.split(': ')
-                    if split[1] != hostname:
-                        logger.info('Adding ssh key to %s' % split[1])
-
-                        ssh_key = '/etc/ceph/ceph.pub'
-                        if ctx.ssh_public_key:
-                            ssh_key = ctx.ssh_public_key.name
-                        out, err, code = call_throws(ctx, ['sudo', '-u', ctx.ssh_user, 'ssh-copy-id', '-f', '-i', ssh_key, '-o StrictHostKeyChecking=no', '%s@%s' % (ctx.ssh_user, split[1])])
+            try:
+                for spec in parse_yaml_objs(f):
+                    if spec.get('service_type') == 'host':
+                        _distribute_ssh_keys(ctx, spec, hostname)
+            except ValueError:
+                logger.info('Unable to parse %s succesfully' % ctx.apply_spec)
 
         mounts = {}
-        mounts[pathify(ctx.apply_spec)] = '/tmp/spec.yml:z'
-
-        out = cli(['orch', 'apply', '-i', '/tmp/spec.yml'], extra_mounts=mounts)
-        logger.info(out)
+        mounts[pathify(ctx.apply_spec)] = '/tmp/spec.yml:ro'
+        try:
+            out = cli(['orch', 'apply', '-i', '/tmp/spec.yml'], extra_mounts=mounts)
+            logger.info(out)
+        except Exception:
+            logger.info('\nApplying %s to cluster failed!\n' % ctx.apply_spec)
 
     logger.info('You can access the Ceph CLI with:\n\n'
                 '\tsudo %s shell --fsid %s -c %s -k %s\n' % (
@@ -4631,10 +4698,12 @@ def command_shell(ctx):
             mount = pathify(split_src_dst[0])
             filename = os.path.basename(split_src_dst[0])
             if len(split_src_dst) > 1:
-                dst = split_src_dst[1] + ':z' if len(split_src_dst) == 3 else split_src_dst[1]
+                dst = split_src_dst[1]
+                if len(split_src_dst) == 3:
+                    dst = '{}:{}'.format(dst, split_src_dst[2])
                 mounts[mount] = dst
             else:
-                mounts[mount] = '/mnt/{}:z'.format(filename)
+                mounts[mount] = '/mnt/{}'.format(filename)
     if ctx.command:
         command = ctx.command
     else:
@@ -5770,14 +5839,12 @@ def check_time_sync(ctx, enabler=None):
 
 
 def command_check_host(ctx: CephadmContext) -> None:
-    container_path = ctx.container_engine.path
-
     errors = []
     commands = ['systemctl', 'lvcreate']
 
     try:
-        check_container_engine(ctx)
-        logger.info('podman|docker (%s) is present' % container_path)
+        engine = check_container_engine(ctx)
+        logger.info(f'{engine} is present')
     except Error as e:
         errors.append(str(e))
 
@@ -6104,6 +6171,7 @@ class YumDnf(Packager):
         'rocky': ('centos', 'el'),
         'almalinux': ('centos', 'el'),
         'fedora': ('fedora', 'fc'),
+        'mariner': ('mariner', 'cm'),
     }
 
     def __init__(self, ctx: CephadmContext,
@@ -6120,6 +6188,8 @@ class YumDnf(Packager):
         if (self.distro_code == 'fc' and self.major >= 30) or \
            (self.distro_code == 'el' and self.major >= 8):
             self.tool = 'dnf'
+        elif (self.distro_code == 'cm'):
+            self.tool = 'tdnf'
         else:
             self.tool = 'yum'
 
@@ -6494,6 +6564,7 @@ class HostFacts():
     _disk_vendor_workarounds = {
         '0x1af4': 'Virtio Block Device'
     }
+    _excluded_block_devices = ('sr', 'zram', 'dm-')
 
     def __init__(self, ctx: CephadmContext):
         self.ctx: CephadmContext = ctx
@@ -6533,7 +6604,7 @@ class HostFacts():
         # type: () -> List[str]
         """Determine the list of block devices by looking at /sys/block"""
         return [dev for dev in os.listdir('/sys/block')
-                if not dev.startswith('dm')]
+                if not dev.startswith(HostFacts._excluded_block_devices)]
 
     def _get_devs_by_type(self, rota='0'):
         # type: (str) -> List[str]
@@ -7680,27 +7751,31 @@ def command_exporter(ctx: CephadmContext) -> None:
 ##################################
 
 
-def systemd_target_state(target_name: str, subsystem: str = 'ceph') -> bool:
+def systemd_target_state(ctx: CephadmContext, target_name: str, subsystem: str = 'ceph') -> bool:
     # TODO: UNITTEST
     return os.path.exists(
         os.path.join(
-            UNIT_DIR,
+            ctx.unit_dir,
             f'{subsystem}.target.wants',
             target_name
         )
     )
 
 
+def target_exists(ctx: CephadmContext) -> bool:
+    return os.path.exists(ctx.unit_dir + '/ceph.target')
+
+
 @infer_fsid
 def command_maintenance(ctx: CephadmContext) -> str:
     if not ctx.fsid:
-        raise Error('must pass --fsid to specify cluster')
+        raise Error('failed - must pass --fsid to specify cluster')
 
     target = f'ceph-{ctx.fsid}.target'
 
     if ctx.maintenance_action.lower() == 'enter':
         logger.info('Requested to place host into maintenance')
-        if systemd_target_state(target):
+        if systemd_target_state(ctx, target):
             _out, _err, code = call(ctx,
                                     ['systemctl', 'disable', target],
                                     verbosity=CallVerbosity.DEBUG)
@@ -7723,8 +7798,14 @@ def command_maintenance(ctx: CephadmContext) -> str:
 
     else:
         logger.info('Requested to exit maintenance state')
+        # if we've never deployed a daemon on this host there will be no systemd
+        # target to disable so attempting a disable will fail. We still need to
+        # return success here or host will be permanently stuck in maintenance mode
+        # as no daemons can be deployed so no systemd target will ever exist to disable.
+        if not target_exists(ctx):
+            return 'skipped - systemd target not present on this host. Host removed from maintenance mode.'
         # exit maintenance request
-        if not systemd_target_state(target):
+        if not systemd_target_state(ctx, target):
             _out, _err, code = call(ctx,
                                     ['systemctl', 'enable', target],
                                     verbosity=CallVerbosity.DEBUG)
@@ -7813,6 +7894,11 @@ def _get_parser():
     parser_pull = subparsers.add_parser(
         'pull', help='pull latest image version')
     parser_pull.set_defaults(func=command_pull)
+    parser_pull.add_argument(
+        '--insecure',
+        action='store_true',
+        help=argparse.SUPPRESS,
+    )
 
     parser_inspect_image = subparsers.add_parser(
         'inspect-image', help='inspect local container image')
@@ -8438,7 +8524,7 @@ def cephadm_init(args: List[str]) -> CephadmContext:
         for handler in logger.handlers:
             if handler.name == 'console':
                 handler.setLevel(logging.DEBUG)
-
+    logger.debug('%s\ncephadm %s' % ('-' * 80, args))
     return ctx
 
 
@@ -8461,7 +8547,13 @@ def main() -> None:
         # podman or docker?
         ctx.container_engine = find_container_engine(ctx)
         if ctx.func not in \
-                [command_check_host, command_prepare_host, command_add_repo, command_install]:
+                [
+                    command_check_host,
+                    command_prepare_host,
+                    command_add_repo,
+                    command_rm_repo,
+                    command_install
+                ]:
             check_container_engine(ctx)
         # command handler
         r = ctx.func(ctx)
index 40afdd42212ea1eb73c093a93850cd9b0e1e9712..5d45fdb40df43993b82eb7f845905a60b02be0d0 100644 (file)
@@ -12,6 +12,7 @@ import threading
 import unittest
 
 from http.server import HTTPServer
+from textwrap import dedent
 from urllib.request import Request, urlopen
 from urllib.error import HTTPError
 
@@ -25,7 +26,6 @@ from .fixtures import (
     with_cephadm_ctx,
 )
 
-
 with mock.patch('builtins.open', create=True):
     from importlib.machinery import SourceFileLoader
     cd = SourceFileLoader('cephadm', 'cephadm').load_module()
@@ -893,6 +893,7 @@ iMN28C2bKGao5UHvdER1rGy7
 
 class TestMaintenance:
     systemd_target = "ceph.00000000-0000-0000-0000-000000c0ffee.target"
+    fsid = '0ea8cdd0-1bbf-11ec-a9c7-5254002763fa'
 
     def test_systemd_target_OK(self, tmp_path):
         base = tmp_path 
@@ -900,14 +901,16 @@ class TestMaintenance:
         wants.mkdir()
         target = wants / TestMaintenance.systemd_target
         target.touch()
-        cd.UNIT_DIR = str(base)
+        ctx = cd.CephadmContext()
+        ctx.unit_dir = str(base)
 
-        assert cd.systemd_target_state(target.name)
+        assert cd.systemd_target_state(ctx, target.name)
 
     def test_systemd_target_NOTOK(self, tmp_path):
         base = tmp_path 
-        cd.UNIT_DIR = str(base)
-        assert not cd.systemd_target_state(TestMaintenance.systemd_target)
+        ctx = cd.CephadmContext()
+        ctx.unit_dir = str(base)
+        assert not cd.systemd_target_state(ctx, TestMaintenance.systemd_target)
 
     def test_parser_OK(self):
         args = cd._parse_args(['host-maintenance', 'enter'])
@@ -917,6 +920,58 @@ class TestMaintenance:
         with pytest.raises(SystemExit):
             cd._parse_args(['host-maintenance', 'wah'])
 
+    @mock.patch('os.listdir', return_value=[])
+    @mock.patch('cephadm.call')
+    @mock.patch('cephadm.systemd_target_state')
+    def test_enter_failure_1(self, _target_state, _call, _listdir):
+        _call.return_value = '', '', 999
+        _target_state.return_value = True
+        ctx: cd.CephadmContext = cd.cephadm_init_ctx(
+            ['host-maintenance', 'enter', '--fsid', TestMaintenance.fsid])
+        ctx.container_engine = mock_podman()
+        retval = cd.command_maintenance(ctx)
+        assert retval.startswith('failed')
+
+    @mock.patch('os.listdir', return_value=[])
+    @mock.patch('cephadm.call')
+    @mock.patch('cephadm.systemd_target_state')
+    def test_enter_failure_2(self, _target_state, _call, _listdir):
+        _call.side_effect = [('', '', 0), ('', '', 999)]
+        _target_state.return_value = True
+        ctx: cd.CephadmContext = cd.cephadm_init_ctx(
+            ['host-maintenance', 'enter', '--fsid', TestMaintenance.fsid])
+        ctx.container_engine = mock_podman()
+        retval = cd.command_maintenance(ctx)
+        assert retval.startswith('failed')
+
+    @mock.patch('os.listdir', return_value=[])
+    @mock.patch('cephadm.call')
+    @mock.patch('cephadm.systemd_target_state')
+    @mock.patch('cephadm.target_exists')
+    def test_exit_failure_1(self, _target_exists, _target_state, _call, _listdir):
+        _call.return_value = '', '', 999
+        _target_state.return_value = False
+        _target_exists.return_value = True
+        ctx: cd.CephadmContext = cd.cephadm_init_ctx(
+            ['host-maintenance', 'exit', '--fsid', TestMaintenance.fsid])
+        ctx.container_engine = mock_podman()
+        retval = cd.command_maintenance(ctx)
+        assert retval.startswith('failed')
+
+    @mock.patch('os.listdir', return_value=[])
+    @mock.patch('cephadm.call')
+    @mock.patch('cephadm.systemd_target_state')
+    @mock.patch('cephadm.target_exists')
+    def test_exit_failure_2(self, _target_exists, _target_state, _call, _listdir):
+        _call.side_effect = [('', '', 0), ('', '', 999)]
+        _target_state.return_value = False
+        _target_exists.return_value = True
+        ctx: cd.CephadmContext = cd.cephadm_init_ctx(
+            ['host-maintenance', 'exit', '--fsid', TestMaintenance.fsid])
+        ctx.container_engine = mock_podman()
+        retval = cd.command_maintenance(ctx)
+        assert retval.startswith('failed')
+
 
 class TestMonitoring(object):
     @mock.patch('cephadm.call')
@@ -1016,6 +1071,9 @@ class TestBootstrap(object):
             *args,
         ]
 
+
+###############################################3
+
     def test_config(self, cephadm_fs):
         conf_file = 'foo'
         cmd = self._get_cmd(
@@ -1329,6 +1387,29 @@ class TestShell(object):
             assert retval == 0
             assert ctx.keyring == 'foo'
 
+    @mock.patch('cephadm.CephContainer')
+    def test_mount_no_dst(self, m_ceph_container, cephadm_fs):
+        cmd = ['shell', '--mount', '/etc/foo']
+        with with_cephadm_ctx(cmd) as ctx:
+            retval = cd.command_shell(ctx)
+            assert retval == 0
+            assert m_ceph_container.call_args.kwargs['volume_mounts']['/etc/foo'] == '/mnt/foo'
+
+    @mock.patch('cephadm.CephContainer')
+    def test_mount_with_dst_no_opt(self, m_ceph_container, cephadm_fs):
+        cmd = ['shell', '--mount', '/etc/foo:/opt/foo/bar']
+        with with_cephadm_ctx(cmd) as ctx:
+            retval = cd.command_shell(ctx)
+            assert retval == 0
+            assert m_ceph_container.call_args.kwargs['volume_mounts']['/etc/foo'] == '/opt/foo/bar'
+
+    @mock.patch('cephadm.CephContainer')
+    def test_mount_with_dst_and_opt(self, m_ceph_container, cephadm_fs):
+        cmd = ['shell', '--mount', '/etc/foo:/opt/foo/bar:Z']
+        with with_cephadm_ctx(cmd) as ctx:
+            retval = cd.command_shell(ctx)
+            assert retval == 0
+            assert m_ceph_container.call_args.kwargs['volume_mounts']['/etc/foo'] == '/opt/foo/bar:Z'
 
 class TestCephVolume(object):
 
@@ -1418,8 +1499,7 @@ class TestIscsi:
             ctx.config_json = json.dumps(config_json)
             ctx.fsid = fsid
             cd.get_parm.return_value = config_json
-            iscsi = cd.CephIscsi(ctx, '9b9d7609-f4d5-4aba-94c8-effa764d96c9', 'daemon_id', config_json)
-            c = iscsi.get_tcmu_runner_container()
+            c = cd.get_container(ctx, fsid, 'iscsi', 'daemon_id')
 
             cd.make_data_dir(ctx, fsid, 'iscsi', 'daemon_id')
             cd.deploy_daemon_units(
@@ -1435,14 +1515,14 @@ class TestIscsi:
             with open('/var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/unit.run') as f:
                 assert f.read() == """set -e
 if ! grep -qs /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs /proc/mounts; then mount -t configfs none /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs; fi
-# iscsi tcmu-runnter container
+# iscsi tcmu-runner container
 ! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi.daemon_id-tcmu 2> /dev/null
 ! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id-tcmu 2> /dev/null
-/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/tcmu-runner --privileged --group-add=disk --init --name ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id-tcmu -e CONTAINER_IMAGE=ceph/ceph -e NODE_NAME=host1 -e CEPH_USE_RANDOM_NONCE=1 -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/config:/etc/ceph/ceph.conf:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/keyring:/etc/ceph/keyring:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/iscsi-gateway.cfg:/etc/ceph/iscsi-gateway.cfg:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs:/sys/kernel/config -v /var/log/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9:/var/log/rbd-target-api:z -v /dev:/dev --mount type=bind,source=/lib/modules,destination=/lib/modules,ro=true ceph/ceph &
+/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/tcmu-runner --privileged --group-add=disk --init --name ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id-tcmu -e CONTAINER_IMAGE=ceph/ceph -e NODE_NAME=host1 -e CEPH_USE_RANDOM_NONCE=1 -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/config:/etc/ceph/ceph.conf:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/keyring:/etc/ceph/keyring:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/iscsi-gateway.cfg:/etc/ceph/iscsi-gateway.cfg:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs:/sys/kernel/config -v /var/log/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9:/var/log:z -v /dev:/dev --mount type=bind,source=/lib/modules,destination=/lib/modules,ro=true ceph/ceph &
 # iscsi.daemon_id
-! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi.daemon_id-tcmu 2> /dev/null
-! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id-tcmu 2> /dev/null
-/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/tcmu-runner --privileged --group-add=disk --init --name ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id-tcmu -e CONTAINER_IMAGE=ceph/ceph -e NODE_NAME=host1 -e CEPH_USE_RANDOM_NONCE=1 -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/config:/etc/ceph/ceph.conf:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/keyring:/etc/ceph/keyring:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/iscsi-gateway.cfg:/etc/ceph/iscsi-gateway.cfg:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs:/sys/kernel/config -v /var/log/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9:/var/log/rbd-target-api:z -v /dev:/dev --mount type=bind,source=/lib/modules,destination=/lib/modules,ro=true ceph/ceph
+! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi.daemon_id 2> /dev/null
+! /usr/bin/podman rm -f ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id 2> /dev/null
+/usr/bin/podman run --rm --ipc=host --stop-signal=SIGTERM --net=host --entrypoint /usr/bin/rbd-target-api --privileged --group-add=disk --init --name ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi-daemon_id -e CONTAINER_IMAGE=ceph/ceph -e NODE_NAME=host1 -e CEPH_USE_RANDOM_NONCE=1 -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/config:/etc/ceph/ceph.conf:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/keyring:/etc/ceph/keyring:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/iscsi-gateway.cfg:/etc/ceph/iscsi-gateway.cfg:z -v /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id/configfs:/sys/kernel/config -v /var/log/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9:/var/log:z -v /dev:/dev --mount type=bind,source=/lib/modules,destination=/lib/modules,ro=true ceph/ceph
 """
 
     def test_get_container(self):
@@ -1460,4 +1540,177 @@ if ! grep -qs /var/lib/ceph/9b9d7609-f4d5-4aba-94c8-effa764d96c9/iscsi.daemon_id
             assert c.old_cname == 'ceph-9b9d7609-f4d5-4aba-94c8-effa764d96c9-iscsi.something'
 
 
+class TestCheckHost:
+
+    @mock.patch('cephadm.find_executable', return_value='foo')
+    @mock.patch('cephadm.check_time_sync', return_value=True)
+    def test_container_engine(self, find_executable, check_time_sync):
+        ctx = cd.CephadmContext()
+
+        ctx.container_engine = None
+        err = r'No container engine binary found'
+        with pytest.raises(cd.Error, match=err):
+            cd.command_check_host(ctx)
+
+        ctx.container_engine = mock_podman()
+        cd.command_check_host(ctx)
+
+        ctx.container_engine = mock_docker()
+        cd.command_check_host(ctx)
+
+
+class TestRmRepo:
+
+    @pytest.mark.parametrize('os_release',
+        [
+            # Apt
+            dedent("""
+            NAME="Ubuntu"
+            VERSION="20.04 LTS (Focal Fossa)"
+            ID=ubuntu
+            ID_LIKE=debian
+            PRETTY_NAME="Ubuntu 20.04 LTS"
+            VERSION_ID="20.04"
+            HOME_URL="https://www.ubuntu.com/"
+            SUPPORT_URL="https://help.ubuntu.com/"
+            BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
+            PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
+            VERSION_CODENAME=focal
+            UBUNTU_CODENAME=focal
+            """),
+
+            # YumDnf
+            dedent("""
+            NAME="CentOS Linux"
+            VERSION="8 (Core)"
+            ID="centos"
+            ID_LIKE="rhel fedora"
+            VERSION_ID="8"
+            PLATFORM_ID="platform:el8"
+            PRETTY_NAME="CentOS Linux 8 (Core)"
+            ANSI_COLOR="0;31"
+            CPE_NAME="cpe:/o:centos:centos:8"
+            HOME_URL="https://www.centos.org/"
+            BUG_REPORT_URL="https://bugs.centos.org/"
+
+            CENTOS_MANTISBT_PROJECT="CentOS-8"
+            CENTOS_MANTISBT_PROJECT_VERSION="8"
+            REDHAT_SUPPORT_PRODUCT="centos"
+            REDHAT_SUPPORT_PRODUCT_VERSION="8"
+            """),
+
+            # Zypper
+            dedent("""
+            NAME="openSUSE Tumbleweed"
+            # VERSION="20210810"
+            ID="opensuse-tumbleweed"
+            ID_LIKE="opensuse suse"
+            VERSION_ID="20210810"
+            PRETTY_NAME="openSUSE Tumbleweed"
+            ANSI_COLOR="0;32"
+            CPE_NAME="cpe:/o:opensuse:tumbleweed:20210810"
+            BUG_REPORT_URL="https://bugs.opensuse.org"
+            HOME_URL="https://www.opensuse.org/"
+            DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
+            LOGO="distributor-logo"
+            """),
+        ])
+    @mock.patch('cephadm.find_executable', return_value='foo')
+    def test_container_engine(self, find_executable, os_release, cephadm_fs):
+        cephadm_fs.create_file('/etc/os-release', contents=os_release)
+        ctx = cd.CephadmContext()
+
+        ctx.container_engine = None
+        cd.command_rm_repo(ctx)
+
+        ctx.container_engine = mock_podman()
+        cd.command_rm_repo(ctx)
+
+        ctx.container_engine = mock_docker()
+        cd.command_rm_repo(ctx)
+
+
+class TestPull:
+
+    @mock.patch('time.sleep')
+    @mock.patch('cephadm.call', return_value=('', '', 0))
+    @mock.patch('cephadm.get_image_info_from_inspect', return_value={})
+    def test_error(self, get_image_info_from_inspect, call, sleep):
+        ctx = cd.CephadmContext()
+        ctx.container_engine = mock_podman()
+        ctx.insecure = False
+
+        call.return_value = ('', '', 0)
+        retval = cd.command_pull(ctx)
+        assert retval == 0
+
+        err = 'maximum retries reached'
+
+        call.return_value = ('', 'foobar', 1)
+        with pytest.raises(cd.Error) as e:
+            cd.command_pull(ctx)
+        assert err not in str(e.value)
+
+        call.return_value = ('', 'net/http: TLS handshake timeout', 1)
+        with pytest.raises(cd.Error) as e:
+            cd.command_pull(ctx)
+        assert err in str(e.value)
+
+
+class TestApplySpec:
+    def test_parse_yaml(self, cephadm_fs):
+        yaml = '''service_type: host
+hostname: vm-00
+addr: 192.168.122.44
+labels:
+ - example1
+ - example2
+---
+service_type: host
+hostname: vm-01
+addr: 192.168.122.247
+labels:
+ - grafana
+---
+service_type: host
+hostname: vm-02
+addr: 192.168.122.165'''
+
+        cephadm_fs.create_file('spec.yml', contents=yaml)
+
+        retdic = [{'service_type': 'host', 'hostname': 'vm-00', 'addr': '192.168.122.44', 'labels': '- example1- example2'},
+                  {'service_type': 'host', 'hostname': 'vm-01', 'addr': '192.168.122.247', 'labels': '- grafana'},
+                  {'service_type': 'host', 'hostname': 'vm-02', 'addr': '192.168.122.165'}]
+      
+        with open('spec.yml') as f:
+            dic = cd.parse_yaml_objs(f)
+            assert dic == retdic
+
+    @mock.patch('cephadm.call', return_value=('', '', 0))
+    def test_distribute_ssh_keys(self, call):
+        ctx = cd.CephadmContext()
+        ctx.ssh_public_key = None
+        ctx.ssh_user = 'root'
+
+        host_spec = {'service_type': 'host', 'hostname': 'vm-02', 'addr': '192.168.122.165'}
+
+        retval = cd._distribute_ssh_keys(ctx, host_spec, 'bootstrap_hostname')
+
+        assert retval == 0
+
+        call.return_value = ('', '', 1)
+
+        retval = cd._distribute_ssh_keys(ctx, host_spec, 'bootstrap_hostname')
+
+        assert retval == 1
+
+
+
+
+
+
+
+
 
+  
index 3f344c3fa378ea33eb43e3426b90b650239925b5..86936de67bcb0b6915b5bba839786ec801c2d671 100644 (file)
@@ -5456,6 +5456,7 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, const M
   mds_rank_t mds = session->mds_num;
   int used = get_caps_used(in);
   int wanted = in->caps_wanted();
+  int flags = 0;
 
   const unsigned new_caps = m->get_caps();
   const bool was_stale = session->cap_gen > cap->gen;
@@ -5569,11 +5570,14 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, const M
        !_flush(in, new C_Client_FlushComplete(this, in))) {
       // waitin' for flush
     } else if (used & revoked & (CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO)) {
-      if (_release(in))
-       check = true;
+      if (_release(in)) {
+        check = true;
+        flags = CHECK_CAPS_NODELAY;
+      }
     } else {
       cap->wanted = 0; // don't let check_caps skip sending a response to MDS
       check = true;
+      flags = CHECK_CAPS_NODELAY;
     }
   } else if (cap->issued == new_caps) {
     ldout(cct, 10) << "  caps unchanged at " << ccap_string(cap->issued) << dendl;
@@ -5596,7 +5600,7 @@ void Client::handle_cap_grant(MetaSession *session, Inode *in, Cap *cap, const M
   }
 
   if (check)
-    check_caps(in, 0);
+    check_caps(in, flags);
 
   // wake up waiters
   if (new_caps)
@@ -6735,6 +6739,16 @@ void Client::collect_and_send_global_metrics() {
   }
   message.push_back(metric);
 
+  // read io sizes
+  metric = ClientMetricMessage(ReadIoSizesPayload(total_read_ops,
+                                                  total_read_size));
+  message.push_back(metric);
+
+  // write io sizes
+  metric = ClientMetricMessage(WriteIoSizesPayload(total_write_ops,
+                                                   total_write_size));
+  message.push_back(metric);
+
   session->con->send_message2(make_message<MClientMetrics>(std::move(message)));
 }
 
@@ -9967,6 +9981,7 @@ retry:
 
 success:
   ceph_assert(rc >= 0);
+  update_read_io_size(bl->length());
   if (movepos) {
     // adjust fd pos
     f->pos = start_pos + rc;
@@ -10014,6 +10029,9 @@ Client::C_Readahead::~C_Readahead() {
 void Client::C_Readahead::finish(int r) {
   lgeneric_subdout(client->cct, client, 20) << "client." << client->get_nodeid() << " " << "C_Readahead on " << f->inode << dendl;
   client->put_cap_ref(f->inode.get(), CEPH_CAP_FILE_RD | CEPH_CAP_FILE_CACHE);
+  if (r > 0) {
+    client->update_read_io_size(r);
+  }
 }
 
 int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl)
@@ -10049,6 +10067,7 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl)
     r = onfinish.wait();
     client_lock.lock();
     put_cap_ref(in, CEPH_CAP_FILE_CACHE);
+    update_read_io_size(bl->length());
   }
 
   if(f->readahead.get_min_readahead_size() > 0) {
@@ -10424,6 +10443,7 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
 
   // if we get here, write was successful, update client metadata
 success:
+  update_write_io_size(size);
   // time
   lat = ceph_clock_now();
   lat -= start;
index 2884cee557b95343ebb7982d7a710c992585790e..4a30c1ba772c8324a6104e67d5b181f806ff0721 100644 (file)
@@ -808,6 +808,16 @@ public:
   void tick();
   void start_tick_thread();
 
+  void update_read_io_size(size_t size) {
+    total_read_ops++;
+    total_read_size += size;
+  }
+
+  void update_write_io_size(size_t size) {
+    total_write_ops++;
+    total_write_size += size;
+  }
+
   void inc_dentry_nr() {
     ++dentry_nr;
   }
@@ -1553,6 +1563,12 @@ private:
   uint64_t pinned_icaps = 0;
   uint64_t opened_inodes = 0;
 
+  uint64_t total_read_ops = 0;
+  uint64_t total_read_size = 0;
+
+  uint64_t total_write_ops = 0;
+  uint64_t total_write_size = 0;
+
   ceph::spinlock delay_i_lock;
   std::map<Inode*,int> delay_i_release;
 };
index 33910b7df518282f603cb1ad5ff7e65c90e0a3df..870383d3d185f1d4efd67a54791e249d45100111 100644 (file)
@@ -5059,7 +5059,22 @@ int image_status_set(cls_method_context_t hctx, const string &global_image_id,
   ondisk_status.up = false;
   ondisk_status.last_update = ceph_clock_now();
 
-  int r = cls_get_request_origin(hctx, &ondisk_status.origin);
+  std::string global_id_key = global_key(global_image_id);
+  std::string image_id;
+  int r = read_key(hctx, global_id_key, &image_id);
+  if (r < 0) {
+    return 0;
+  }
+  cls::rbd::MirrorImage mirror_image;
+  r = image_get(hctx, image_id, &mirror_image);
+  if (r < 0) {
+    return 0;
+  }
+  if (mirror_image.state != cls::rbd::MIRROR_IMAGE_STATE_ENABLED) {
+    return 0;
+  }
+
+  r = cls_get_request_origin(hctx, &ondisk_status.origin);
   ceph_assert(r == 0);
 
   bufferlist bl;
@@ -6366,7 +6381,6 @@ int mirror_image_status_set(cls_method_context_t hctx, bufferlist *in,
  * Output:
  * @returns 0 on success, negative error code on failure
  *
- * NOTE: deprecated - remove this method after Octopus is unsupported
  */
 int mirror_image_status_remove(cls_method_context_t hctx, bufferlist *in,
                               bufferlist *out) {
index cefa1fed79391c3fbbc0196a976ba8a6d04760e9..535de35ef7a246a5cbc4ba96ee5eb4acb4986234 100644 (file)
@@ -2310,6 +2310,20 @@ int mirror_image_status_get_summary_finish(
   return 0;
 }
 
+int mirror_image_status_remove(librados::IoCtx *ioctx,
+                               const std::string &global_image_id) {
+  librados::ObjectWriteOperation op;
+  mirror_image_status_remove(&op, global_image_id);
+  return ioctx->operate(RBD_MIRRORING, &op);
+}
+
+void mirror_image_status_remove(librados::ObjectWriteOperation *op,
+                                const std::string &global_image_id) {
+  bufferlist bl;
+  encode(global_image_id, bl);
+  op->exec("rbd", "mirror_image_status_remove", bl);
+}
+
 int mirror_image_status_remove_down(librados::IoCtx *ioctx) {
   librados::ObjectWriteOperation op;
   mirror_image_status_remove_down(&op);
index 12b34c48327087e9d2531d6c4227a349ad93c862..9bb5a41d82d5e0d12c081fb690117a6a5bc77ed2 100644 (file)
@@ -478,6 +478,10 @@ void mirror_image_status_get_summary_start(
 int mirror_image_status_get_summary_finish(
     ceph::buffer::list::const_iterator *iter,
     std::map<cls::rbd::MirrorImageStatusState, int32_t> *states);
+int mirror_image_status_remove(librados::IoCtx *ioctx,
+                               const std::string &global_image_id);
+void mirror_image_status_remove(librados::ObjectWriteOperation *op,
+                                const std::string &global_image_id);
 int mirror_image_status_remove_down(librados::IoCtx *ioctx);
 void mirror_image_status_remove_down(librados::ObjectWriteOperation *op);
 
index eab46661c99e10a65d6e5f9173bd83a31cf06efd..b96d9d2ff7197ff570107974b702e62ff0a419c6 100644 (file)
@@ -24,18 +24,19 @@ using std::pair;
 
 using ceph::operator <<;
 
-class SafeTimerThread : public Thread {
-  SafeTimer *parent;
+template <class Mutex>
+class CommonSafeTimerThread : public Thread {
+  CommonSafeTimer<Mutex> *parent;
 public:
-  explicit SafeTimerThread(SafeTimer *s) : parent(s) {}
+  explicit CommonSafeTimerThread(CommonSafeTimer<Mutex> *s) : parent(s) {}
   void *entry() override {
     parent->timer_thread();
     return NULL;
   }
 };
 
-
-SafeTimer::SafeTimer(CephContext *cct_, ceph::mutex &l, bool safe_callbacks)
+template <class Mutex>
+CommonSafeTimer<Mutex>::CommonSafeTimer(CephContext *cct_, Mutex &l, bool safe_callbacks)
   : cct(cct_), lock(l),
     safe_callbacks(safe_callbacks),
     thread(NULL),
@@ -43,19 +44,22 @@ SafeTimer::SafeTimer(CephContext *cct_, ceph::mutex &l, bool safe_callbacks)
 {
 }
 
-SafeTimer::~SafeTimer()
+template <class Mutex>
+CommonSafeTimer<Mutex>::~CommonSafeTimer()
 {
   ceph_assert(thread == NULL);
 }
 
-void SafeTimer::init()
+template <class Mutex>
+void CommonSafeTimer<Mutex>::init()
 {
   ldout(cct,10) << "init" << dendl;
-  thread = new SafeTimerThread(this);
+  thread = new CommonSafeTimerThread<Mutex>(this);
   thread->create("safe_timer");
 }
 
-void SafeTimer::shutdown()
+template <class Mutex>
+void CommonSafeTimer<Mutex>::shutdown()
 {
   ldout(cct,10) << "shutdown" << dendl;
   if (thread) {
@@ -71,7 +75,8 @@ void SafeTimer::shutdown()
   }
 }
 
-void SafeTimer::timer_thread()
+template <class Mutex>
+void CommonSafeTimer<Mutex>::timer_thread()
 {
   std::unique_lock l{lock};
   ldout(cct,10) << "timer_thread starting" << dendl;
@@ -115,12 +120,14 @@ void SafeTimer::timer_thread()
   ldout(cct,10) << "timer_thread exiting" << dendl;
 }
 
-Context* SafeTimer::add_event_after(double seconds, Context *callback)
+template <class Mutex>
+Context* CommonSafeTimer<Mutex>::add_event_after(double seconds, Context *callback)
 {
   return add_event_after(ceph::make_timespan(seconds), callback);
 }
 
-Context* SafeTimer::add_event_after(ceph::timespan duration, Context *callback)
+template <class Mutex>
+Context* CommonSafeTimer<Mutex>::add_event_after(ceph::timespan duration, Context *callback)
 {
   ceph_assert(ceph_mutex_is_locked(lock));
 
@@ -128,7 +135,8 @@ Context* SafeTimer::add_event_after(ceph::timespan duration, Context *callback)
   return add_event_at(when, callback);
 }
 
-Context* SafeTimer::add_event_at(SafeTimer::clock_t::time_point when, Context *callback)
+template <class Mutex>
+Context* CommonSafeTimer<Mutex>::add_event_at(CommonSafeTimer<Mutex>::clock_t::time_point when, Context *callback)
 {
   ceph_assert(ceph_mutex_is_locked(lock));
   ldout(cct,10) << __func__ << " " << when << " -> " << callback << dendl;
@@ -153,10 +161,11 @@ Context* SafeTimer::add_event_at(SafeTimer::clock_t::time_point when, Context *c
   return callback;
 }
 
-bool SafeTimer::cancel_event(Context *callback)
+template <class Mutex>
+bool CommonSafeTimer<Mutex>::cancel_event(Context *callback)
 {
   ceph_assert(ceph_mutex_is_locked(lock));
-  
+
   auto p = events.find(callback);
   if (p == events.end()) {
     ldout(cct,10) << "cancel_event " << callback << " not found" << dendl;
@@ -171,7 +180,8 @@ bool SafeTimer::cancel_event(Context *callback)
   return true;
 }
 
-void SafeTimer::cancel_all_events()
+template <class Mutex>
+void CommonSafeTimer<Mutex>::cancel_all_events()
 {
   ldout(cct,10) << "cancel_all_events" << dendl;
   ceph_assert(ceph_mutex_is_locked(lock));
@@ -185,7 +195,8 @@ void SafeTimer::cancel_all_events()
   }
 }
 
-void SafeTimer::dump(const char *caller) const
+template <class Mutex>
+void CommonSafeTimer<Mutex>::dump(const char *caller) const
 {
   if (!caller)
     caller = "";
@@ -196,3 +207,6 @@ void SafeTimer::dump(const char *caller) const
        ++s)
     ldout(cct,10) << " " << s->first << "->" << s->second << dendl;
 }
+
+template class CommonSafeTimer<ceph::mutex>;
+template class CommonSafeTimer<ceph::fair_mutex>;
index f543be68a766402836556145c5d057d999e0efa2..f22956a347615eabffe30317e6d5464e7fb63bad 100644 (file)
 #include "include/common_fwd.h"
 #include "ceph_time.h"
 #include "ceph_mutex.h"
+#include "fair_mutex.h"
+#include <condition_variable>
 
 class Context;
-class SafeTimerThread;
 
-class SafeTimer
+template <class Mutex> class CommonSafeTimerThread;
+
+template <class Mutex>
+class CommonSafeTimer
 {
   CephContext *cct;
-  ceph::mutex& lock;
-  ceph::condition_variable cond;
+  Mutex& lock;
+  std::condition_variable_any cond;
   bool safe_callbacks;
 
-  friend class SafeTimerThread;
-  SafeTimerThread *thread;
+  friend class CommonSafeTimerThread<Mutex>;
+  class CommonSafeTimerThread<Mutex> *thread;
 
   void timer_thread();
   void _shutdown();
@@ -47,8 +51,8 @@ class SafeTimer
 
 public:
   // This class isn't supposed to be copied
-  SafeTimer(const SafeTimer&) = delete;
-  SafeTimer& operator=(const SafeTimer&) = delete;
+  CommonSafeTimer(const CommonSafeTimer&) = delete;
+  CommonSafeTimer& operator=(const CommonSafeTimer&) = delete;
 
   /* Safe callbacks determines whether callbacks are called with the lock
    * held.
@@ -60,8 +64,8 @@ public:
    * If you are able to relax requirements on cancelled callbacks, then
    * setting safe_callbacks = false eliminates the lock cycle issue.
    * */
-  SafeTimer(CephContext *cct, ceph::mutex &l, bool safe_callbacks=true);
-  virtual ~SafeTimer();
+  CommonSafeTimer(CephContext *cct, Mutex &l, bool safe_callbacks=true);
+  virtual ~CommonSafeTimer();
 
   /* Call with the event_lock UNLOCKED.
    *
@@ -96,4 +100,8 @@ public:
 
 };
 
+extern template class CommonSafeTimer<ceph::mutex>;
+extern template class CommonSafeTimer<ceph::fair_mutex>;
+using SafeTimer = class CommonSafeTimer<ceph::mutex>;
+
 #endif
index 4916858676675c3122323e7e3091f034999bcfe9..e15c99e7d09e67fed19cfc1e3ed9b3f6b640473b 100644 (file)
@@ -1029,6 +1029,16 @@ void md_config_t::get_config_bl(
   }
 }
 
+std::optional<std::string> md_config_t::get_val_default(std::string_view key)
+{
+  std::string val;
+  const Option *opt = find_option(key);
+  if (opt && (conf_stringify(_get_val_default(*opt), &val) == 0)) {
+    return std::make_optional(std::move(val));
+  }
+  return std::nullopt;
+}
+
 int md_config_t::get_val(const ConfigValues& values,
                         const std::string_view key, char **buf, int len) const
 {
index ef7d5b34fdc6b3f19dd82c913d766620a6cdc14b..989f5029e1270493ddf680d372d35219cac53185 100644 (file)
@@ -191,6 +191,9 @@ public:
   /// get encoded map<string,string> of compiled-in defaults
   void get_defaults_bl(const ConfigValues& values, ceph::buffer::list *bl);
 
+  /// Get the default value of a configuration option
+  std::optional<std::string> get_val_default(std::string_view key);
+
   // Get a configuration value.
   // No metavariables will be returned (they will have already been expanded)
   int get_val(const ConfigValues& values, const std::string_view key, char **buf, int len) const;
index cb30a2d7f1fa26ed54486561ac92550e94695327..e43a7c6dd67c8ddd13a750824c8acf5f623849fe 100644 (file)
@@ -344,6 +344,9 @@ public:
   const std::string& get_conf_path() const {
     return config.get_conf_path();
   }
+  std::optional<std::string> get_val_default(std::string_view key) {
+    return config.get_val_default(key);
+  }
 };
 
 }
diff --git a/ceph/src/common/fair_mutex.h b/ceph/src/common/fair_mutex.h
new file mode 100644 (file)
index 0000000..9baa044
--- /dev/null
@@ -0,0 +1,80 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
+
+#pragma once
+
+#include "common/ceph_mutex.h"
+
+#include <thread>
+#include <string>
+
+namespace ceph {
+/// a FIFO mutex
+class fair_mutex {
+public:
+  fair_mutex(const std::string& name)
+    : mutex{ceph::make_mutex(name)}
+  {}
+  ~fair_mutex() = default;
+  fair_mutex(const fair_mutex&) = delete;
+  fair_mutex& operator=(const fair_mutex&) = delete;
+
+  void lock()
+  {
+    std::unique_lock lock(mutex);
+    const unsigned my_id = next_id++;
+    cond.wait(lock, [&] {
+      return my_id == unblock_id;
+    });
+    _set_locked_by();
+  }
+
+  bool try_lock()
+  {
+    std::lock_guard lock(mutex);
+    if (is_locked()) {
+      return false;
+    }
+    ++next_id;
+    _set_locked_by();
+    return true;
+  }
+
+  void unlock()
+  {
+    std::lock_guard lock(mutex);
+    ++unblock_id;
+    _reset_locked_by();
+    cond.notify_all();
+  }
+
+  bool is_locked() const
+  {
+    return next_id != unblock_id;
+  }
+
+#ifdef CEPH_DEBUG_MUTEX
+  bool is_locked_by_me() const {
+    return is_locked() && locked_by == std::this_thread::get_id();
+  }
+private:
+  void _set_locked_by() {
+    locked_by = std::this_thread::get_id();
+  }
+  void _reset_locked_by() {
+    locked_by = {};
+  }
+#else
+  void _set_locked_by() {}
+  void _reset_locked_by() {}
+#endif
+
+private:
+  unsigned next_id = 0;
+  unsigned unblock_id = 0;
+  ceph::condition_variable cond;
+  ceph::mutex mutex;
+#ifdef CEPH_DEBUG_MUTEX
+  std::thread::id locked_by = {};
+#endif
+};
+} // namespace ceph
index f2610f33a709793f290f0b5974894777d756667c..d22061f8a7d5374fda363662ddc4162249988bb4 100644 (file)
@@ -1036,6 +1036,7 @@ OPTION(bluestore_debug_fsck_abort, OPT_BOOL)
 OPTION(bluestore_debug_omit_kv_commit, OPT_BOOL)
 OPTION(bluestore_debug_permit_any_bdev_label, OPT_BOOL)
 OPTION(bluestore_debug_random_read_err, OPT_DOUBLE)
+OPTION(bluestore_debug_legacy_omap, OPT_BOOL)
 OPTION(bluestore_debug_inject_bug21040, OPT_BOOL)
 OPTION(bluestore_debug_inject_csum_err_probability, OPT_FLOAT)
 OPTION(bluestore_fsck_error_on_no_per_pool_stats, OPT_BOOL)
@@ -1405,6 +1406,7 @@ OPTION(rgw_usage_max_user_shards, OPT_INT)
 OPTION(rgw_enable_ops_log, OPT_BOOL) // enable logging every rgw operation
 OPTION(rgw_enable_usage_log, OPT_BOOL) // enable logging bandwidth usage
 OPTION(rgw_ops_log_rados, OPT_BOOL) // whether ops log should go to rados
+OPTION(rgw_ops_log_file_path, OPT_STR) // path to file where ops log can go
 OPTION(rgw_ops_log_socket_path, OPT_STR) // path to unix domain socket where ops log can go
 OPTION(rgw_ops_log_data_backlog, OPT_INT) // max data backlog for ops log
 OPTION(rgw_fcgi_socket_backlog, OPT_INT) // socket  backlog for fcgi
index bdec3edafcdbcbb88e60ed754d39614fe3573f5a..2f28123ba5bb2b1df90f4d03803e58105daaf40d 100644 (file)
@@ -3123,12 +3123,6 @@ std::vector<Option> get_global_options() {
     .set_long_description("This option specifies the cost per byte to consider in microseconds per OSD for solid state device type. This is considered by the mclock_scheduler to set an additional cost factor in QoS calculations. Only considered for osd_op_queue = mclock_scheduler")
     .set_flag(Option::FLAG_RUNTIME),
 
-    Option("osd_mclock_max_capacity_iops", Option::TYPE_FLOAT, Option::LEVEL_BASIC)
-    .set_default(0.0)
-    .set_description("Max IOPs capacity (at 4KiB block size) to consider per OSD (overrides _ssd and _hdd if non-zero)")
-    .set_long_description("This option specifies the max osd capacity in iops per OSD. Helps in QoS calculations when enabling a dmclock profile. Only considered for osd_op_queue = mclock_scheduler")
-    .set_flag(Option::FLAG_RUNTIME),
-
     Option("osd_mclock_max_capacity_iops_hdd", Option::TYPE_FLOAT, Option::LEVEL_BASIC)
     .set_default(315.0)
     .set_description("Max IOPs capacity (at 4KiB block size) to consider per OSD (for rotational media)")
@@ -3141,6 +3135,22 @@ std::vector<Option> get_global_options() {
     .set_long_description("This option specifies the max OSD capacity in iops per OSD. Helps in QoS calculations when enabling a dmclock profile. Only considered for osd_op_queue = mclock_scheduler")
     .set_flag(Option::FLAG_RUNTIME),
 
+    Option("osd_mclock_force_run_benchmark_on_init", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(false)
+    .set_description("Force run the OSD benchmark on OSD initialization/boot-up")
+    .set_long_description("This option specifies whether the OSD benchmark must be run during the OSD boot-up sequence even if historical data about the OSD iops capacity is available in the MON config store. Enable this to refresh the OSD iops capacity if the underlying device's performance characteristics have changed significantly. Only considered for osd_op_queue = mclock_scheduler.")
+    .set_flag(Option::FLAG_STARTUP)
+    .add_see_also("osd_mclock_max_capacity_iops_hdd")
+    .add_see_also("osd_mclock_max_capacity_iops_ssd"),
+
+    Option("osd_mclock_skip_benchmark", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_description("Skip the OSD benchmark on OSD initialization/boot-up")
+    .set_long_description("This option specifies whether the OSD benchmark must be skipped during the OSD boot-up sequence. Only considered for osd_op_queue = mclock_scheduler.")
+    .set_flag(Option::FLAG_RUNTIME)
+    .add_see_also("osd_mclock_max_capacity_iops_hdd")
+    .add_see_also("osd_mclock_max_capacity_iops_ssd"),
+
     Option("osd_mclock_profile", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("high_client_ops")
     .set_enum_allowed( { "balanced", "high_recovery_ops", "high_client_ops", "custom" } )
@@ -4847,6 +4857,10 @@ std::vector<Option> get_global_options() {
     .set_default(0)
     .set_description(""),
 
+    Option("bluestore_debug_legacy_omap", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_description(""),
+
     Option("bluestore_debug_inject_bug21040", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description(""),
@@ -6499,6 +6513,12 @@ std::vector<Option> get_rgw_options() {
         "RGW will send ops log data through it.")
     .add_see_also({"rgw_enable_ops_log", "rgw_ops_log_data_backlog"}),
 
+    Option("rgw_ops_log_file_path", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+    .set_default("")
+    .set_description("File-system path for ops log.")
+    .set_long_description("Path to file that RGW will log ops logs to.")
+    .add_see_also({"rgw_enable_ops_log", "rgw_ops_log_data_backlog"}),
+
     Option("rgw_ops_log_data_backlog", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(5 << 20)
     .set_description("Ops log socket backlog")
@@ -6507,7 +6527,7 @@ std::vector<Option> get_rgw_options() {
         "send info through unix domain socket. When data backlog is higher than this, "
         "ops log entries will be lost. In order to avoid ops log information loss, the "
         "listener needs to clear data (by reading it) quickly enough.")
-    .add_see_also({"rgw_enable_ops_log", "rgw_ops_log_socket_path"}),
+    .add_see_also({"rgw_enable_ops_log", "rgw_ops_log_socket_path", "rgw_ops_log_file_path"}),
 
     Option("rgw_fcgi_socket_backlog", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(1024)
@@ -8187,6 +8207,11 @@ std::vector<Option> get_mds_options() {
     .set_default(false)
     .set_flag(Option::FLAG_RUNTIME),
 
+    Option("mds_standby_replay_damaged", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_description(""),
+
     Option("mds_numa_node", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(-1)
     .set_flag(Option::FLAG_STARTUP)
index b63e573d3d535f2a9e7db32f9e9a8653d72395a9..35c7a77381dc2c15c98975eac7fc5b2cb2bcb1b7 100644 (file)
@@ -226,6 +226,7 @@ struct CompatSet {
     o << "{c=[" << std::hex << compat.mask << "]";
     o << ",r=[" << std::hex << ro_compat.mask << "]";
     o << ",i=[" << std::hex << incompat.mask << "]}";
+    o << std::dec;
     return o;
   }
 
index a004823c6a00a540d4dc2f2f7c6b3b6ee65d4551..8cec205e25f2ae3a7b0a7c9ab5a2290077dbaeb8 100644 (file)
@@ -25,6 +25,8 @@ enum ClientMetricType {
   CLIENT_METRIC_TYPE_OPENED_FILES,
   CLIENT_METRIC_TYPE_PINNED_ICAPS,
   CLIENT_METRIC_TYPE_OPENED_INODES,
+  CLIENT_METRIC_TYPE_READ_IO_SIZES,
+  CLIENT_METRIC_TYPE_WRITE_IO_SIZES,
 };
 inline std::ostream &operator<<(std::ostream &os, const ClientMetricType &type) {
   switch(type) {
@@ -52,6 +54,12 @@ inline std::ostream &operator<<(std::ostream &os, const ClientMetricType &type)
   case ClientMetricType::CLIENT_METRIC_TYPE_OPENED_INODES:
     os << "OPENED_INODES";
     break;
+  case ClientMetricType::CLIENT_METRIC_TYPE_READ_IO_SIZES:
+    os << "READ_IO_SIZES";
+    break;
+  case ClientMetricType::CLIENT_METRIC_TYPE_WRITE_IO_SIZES:
+    os << "WRITE_IO_SIZES";
+    break;
   default:
     os << "(UNKNOWN:" << static_cast<std::underlying_type<ClientMetricType>::type>(type) << ")";
     break;
@@ -367,6 +375,79 @@ struct OpenedInodesPayload : public ClientMetricPayloadBase {
   }
 };
 
+struct ReadIoSizesPayload : public ClientMetricPayloadBase {
+  uint64_t total_ops = 0;
+  uint64_t total_size = 0;
+
+  ReadIoSizesPayload()
+    : ClientMetricPayloadBase(ClientMetricType::CLIENT_METRIC_TYPE_READ_IO_SIZES) { }
+  ReadIoSizesPayload(uint64_t total_ops, uint64_t total_size)
+    : ClientMetricPayloadBase(ClientMetricType::CLIENT_METRIC_TYPE_READ_IO_SIZES),
+    total_ops(total_ops), total_size(total_size) {  }
+
+  void encode(bufferlist &bl) const {
+    using ceph::encode;
+    ENCODE_START(1, 1, bl);
+    encode(total_ops, bl);
+    encode(total_size, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::const_iterator &iter) {
+    using ceph::decode;
+    DECODE_START(1, iter);
+    decode(total_ops, iter);
+    decode(total_size, iter);
+    DECODE_FINISH(iter);
+  }
+
+  void dump(Formatter *f) const {
+    f->dump_int("total_ops", total_ops);
+    f->dump_int("total_size", total_size);
+  }
+
+  void print(std::ostream *out) const {
+    *out << "total_ops: " << total_ops << " total_size: " << total_size;
+  }
+};
+
+struct WriteIoSizesPayload : public ClientMetricPayloadBase {
+  uint64_t total_ops = 0;
+  uint64_t total_size = 0;
+
+  WriteIoSizesPayload()
+    : ClientMetricPayloadBase(ClientMetricType::CLIENT_METRIC_TYPE_WRITE_IO_SIZES) { }
+  WriteIoSizesPayload(uint64_t total_ops, uint64_t total_size)
+    : ClientMetricPayloadBase(ClientMetricType::CLIENT_METRIC_TYPE_WRITE_IO_SIZES),
+    total_ops(total_ops), total_size(total_size) {
+  }
+
+  void encode(bufferlist &bl) const {
+    using ceph::encode;
+    ENCODE_START(1, 1, bl);
+    encode(total_ops, bl);
+    encode(total_size, bl);
+    ENCODE_FINISH(bl);
+  }
+
+  void decode(bufferlist::const_iterator &iter) {
+    using ceph::decode;
+    DECODE_START(1, iter);
+    decode(total_ops, iter);
+    decode(total_size, iter);
+    DECODE_FINISH(iter);
+  }
+
+  void dump(Formatter *f) const {
+    f->dump_int("total_ops", total_ops);
+    f->dump_int("total_size", total_size);
+  }
+
+  void print(std::ostream *out) const {
+    *out << "total_ops: " << total_ops << " total_size: " << total_size;
+  }
+};
+
 struct UnknownPayload : public ClientMetricPayloadBase {
   UnknownPayload()
     : ClientMetricPayloadBase(static_cast<ClientMetricType>(-1)) { }
@@ -394,10 +475,12 @@ typedef boost::variant<CapInfoPayload,
                        ReadLatencyPayload,
                        WriteLatencyPayload,
                        MetadataLatencyPayload,
-                      DentryLeasePayload,
-                      OpenedFilesPayload,
-                      PinnedIcapsPayload,
-                      OpenedInodesPayload,
+                       DentryLeasePayload,
+                       OpenedFilesPayload,
+                       PinnedIcapsPayload,
+                       OpenedInodesPayload,
+                       ReadIoSizesPayload,
+                       WriteIoSizesPayload,
                        UnknownPayload> ClientMetricPayload;
 
 // metric update message sent by clients
@@ -506,6 +589,12 @@ public:
     case ClientMetricType::CLIENT_METRIC_TYPE_OPENED_INODES:
       payload = OpenedInodesPayload();
       break;
+    case ClientMetricType::CLIENT_METRIC_TYPE_READ_IO_SIZES:
+      payload = ReadIoSizesPayload();
+      break;
+    case ClientMetricType::CLIENT_METRIC_TYPE_WRITE_IO_SIZES:
+      payload = WriteIoSizesPayload();
+      break;
     default:
       payload = UnknownPayload(static_cast<ClientMetricType>(metric_type));
       break;
index 1b6911daecbad689f9126649b9d0e7e07e50f12d..071456f56ecc02a4b64d4e129eb378785c11f1fa 100644 (file)
@@ -9,6 +9,7 @@
 #include "include/rados/librados.hpp"
 #include "common/AsyncOpTracker.h"
 #include "common/Cond.h"
+#include "common/Timer.h"
 #include "common/ceph_mutex.h"
 #include "common/RefCountedObj.h"
 #include "common/WorkQueue.h"
@@ -23,8 +24,6 @@
 #include <string>
 #include "include/ceph_assert.h"
 
-class SafeTimer;
-
 namespace journal {
 
 class JournalMetadata : public RefCountedObject, boost::noncopyable {
index f2ab14d7b43c87805e2abccc34b49794de60dd14..a71117a836a19e3d79ac4cdf9e4b11da88646447 100644 (file)
@@ -8,6 +8,7 @@
 #include "include/Context.h"
 #include "include/rados/librados.hpp"
 #include "common/AsyncOpTracker.h"
+#include "common/Timer.h"
 #include "journal/JournalMetadata.h"
 #include "journal/ObjectPlayer.h"
 #include "journal/Types.h"
@@ -16,8 +17,6 @@
 #include <boost/optional.hpp>
 #include <map>
 
-class SafeTimer;
-
 namespace journal {
 
 class CacheManagerHandler;
index 680dbcdfead58a2fb4017ad01325bbe80eed2878..9d8ea6c10f3d924a73dc78a72b6d7b82ace440b7 100644 (file)
@@ -9,6 +9,7 @@
 #include "include/rados/librados.hpp"
 #include "common/ceph_mutex.h"
 #include "common/containers.h"
+#include "common/Timer.h"
 #include "journal/Future.h"
 #include "journal/FutureImpl.h"
 #include "journal/JournalMetadata.h"
@@ -16,8 +17,6 @@
 #include <map>
 #include <string>
 
-class SafeTimer;
-
 namespace journal {
 
 class JournalRecorder {
index fe44401848aca931297f2561cf292221cc43105b..f42513c5d67fe5fe40e0214e17f5c2e41d438500 100644 (file)
 #include "journal/Future.h"
 #include "journal/JournalMetadataListener.h"
 #include "cls/journal/cls_journal_types.h"
+#include "common/Timer.h"
 #include <list>
 #include <map>
 #include <string>
 #include "include/ceph_assert.h"
 
 class ContextWQ;
-class SafeTimer;
 class ThreadPool;
 
 namespace journal {
index 41641dd150ac90ca3d2be7b65d8792b98815ab4a..b9446252a2744e40feae44ea80bf88c028c07586 100644 (file)
@@ -8,6 +8,7 @@
 #include "include/interval_set.h"
 #include "include/rados/librados.hpp"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "common/RefCountedObj.h"
 #include "journal/Entry.h"
 #include <list>
@@ -16,8 +17,6 @@
 #include <boost/unordered_map.hpp>
 #include "include/ceph_assert.h"
 
-class SafeTimer;
-
 namespace journal {
 
 class ObjectPlayer : public RefCountedObject {
index 7281879fcf722027fae6857cd7e805de482e74ce..5c5f88c86db96f130ccb979620c587310adb5c62 100644 (file)
@@ -10,6 +10,7 @@
 #include "common/ceph_mutex.h"
 #include "common/RefCountedObj.h"
 #include "common/WorkQueue.h"
+#include "common/Timer.h"
 #include "journal/FutureImpl.h"
 #include <list>
 #include <map>
@@ -17,8 +18,6 @@
 #include <boost/noncopyable.hpp>
 #include "include/ceph_assert.h"
 
-class SafeTimer;
-
 namespace journal {
 
 class ObjectRecorder;
index ed836ed8e4e41dd40665d48097aa34060f22cd05..2051ebef9bda1381449136c15471d4d65e11e38b 100644 (file)
@@ -58,7 +58,7 @@ namespace librbd {
 
 namespace {
 
-class SafeTimerSingleton : public SafeTimer {
+class SafeTimerSingleton : public CommonSafeTimer<ceph::mutex> {
 public:
   ceph::mutex lock = ceph::make_mutex("librbd::SafeTimerSingleton::lock");
 
index 31d9a67547d62998e98da6feb18fc3043e254aba..043b26efe300d97f7e4a6341c64490a1c3b4bb5f 100644 (file)
@@ -14,6 +14,7 @@
 #include <vector>
 
 #include "common/allocator.h"
+#include "common/Timer.h"
 #include "common/ceph_mutex.h"
 #include "common/config_proxy.h"
 #include "common/event_socket.h"
@@ -36,8 +37,6 @@
 #include <boost/lockfree/policies.hpp>
 #include <boost/lockfree/queue.hpp>
 
-class SafeTimer;
-
 namespace neorados {
 class IOContext;
 class RADOS;
index 64ea13fe23ac9f8c811d38cad34c92156703c5c4..406c0e34cbf0eccc65d302a11bdcac32502a613f 100644 (file)
@@ -10,6 +10,7 @@
 #include "include/rados/librados_fwd.hpp"
 #include "common/AsyncOpTracker.h"
 #include "common/Cond.h"
+#include "common/Timer.h"
 #include "common/RefCountedObj.h"
 #include "journal/Future.h"
 #include "journal/JournalMetadataListener.h"
@@ -27,7 +28,6 @@
 #include <unordered_map>
 
 class ContextWQ;
-class SafeTimer;
 namespace journal { class Journaler; }
 
 namespace librbd {
index 890341e015c1720425d5172e50cbf2c3581ede53..65d55328fbb890ab930ef0f3dd96c082a31e5864 100644 (file)
@@ -252,11 +252,8 @@ int Pool<I>::init(librados::IoCtx& io_ctx, bool force) {
     return 0;
   }
 
-  AsioEngine asio_engine(io_ctx);
-
   C_SaferCond ctx;
-  auto req = image::ValidatePoolRequest<I>::create(
-    io_ctx, asio_engine.get_work_queue(), &ctx);
+  auto req = image::ValidatePoolRequest<I>::create(io_ctx, &ctx);
   req->send();
 
   return ctx.wait();
index 76e8e478e2bf7487907ba7e680b871133a1f9f2a..1352884932e8b5ee925264a6940617968689ce2f 100644 (file)
@@ -52,7 +52,7 @@ AbstractWriteLog<I>::AbstractWriteLog(
         "tp_pwl", 4, ""),
     m_cache_state(cache_state),
     m_image_ctx(image_ctx),
-    m_log_pool_config_size(DEFAULT_POOL_SIZE),
+    m_log_pool_size(DEFAULT_POOL_SIZE),
     m_image_writeback(image_writeback),
     m_plugin_api(plugin_api),
     m_log_retire_lock(ceph::make_mutex(pwl::unique_lock_name(
@@ -158,13 +158,13 @@ void AbstractWriteLog<I>::perf_start(std::string name) {
     "Histogram of syncpoint's logentry numbers vs bytes number");
 
   plb.add_u64_counter(l_librbd_pwl_wr_req, "wr", "Writes");
+  plb.add_u64_counter(l_librbd_pwl_wr_bytes, "wr_bytes", "Data size in writes");
   plb.add_u64_counter(l_librbd_pwl_wr_req_def, "wr_def", "Writes deferred for resources");
   plb.add_u64_counter(l_librbd_pwl_wr_req_def_lanes, "wr_def_lanes", "Writes deferred for lanes");
   plb.add_u64_counter(l_librbd_pwl_wr_req_def_log, "wr_def_log", "Writes deferred for log entries");
   plb.add_u64_counter(l_librbd_pwl_wr_req_def_buf, "wr_def_buf", "Writes deferred for buffers");
   plb.add_u64_counter(l_librbd_pwl_wr_req_overlap, "wr_overlap", "Writes overlapping with prior in-progress writes");
   plb.add_u64_counter(l_librbd_pwl_wr_req_queued, "wr_q_barrier", "Writes queued for prior barriers (aio_flush)");
-  plb.add_u64_counter(l_librbd_pwl_wr_bytes, "wr_bytes", "Data size in writes");
 
   plb.add_u64_counter(l_librbd_pwl_log_ops, "log_ops", "Log appends");
   plb.add_u64_avg(l_librbd_pwl_log_op_bytes, "log_op_bytes", "Average log append bytes");
@@ -258,7 +258,8 @@ void AbstractWriteLog<I>::perf_start(std::string name) {
   plb.add_time_avg(l_librbd_pwl_cmp_latency, "cmp_lat", "Compare and Write latecy");
   plb.add_u64_counter(l_librbd_pwl_cmp_fails, "cmp_fails", "Compare and Write compare fails");
 
-  plb.add_u64_counter(l_librbd_pwl_flush, "flush", "Flush (flush RWL)");
+  plb.add_u64_counter(l_librbd_pwl_internal_flush, "internal_flush", "Flush RWL (write back to OSD)");
+  plb.add_time_avg(l_librbd_pwl_writeback_latency, "writeback_lat", "write back to OSD latency");
   plb.add_u64_counter(l_librbd_pwl_invalidate_cache, "invalidate", "Invalidate RWL");
   plb.add_u64_counter(l_librbd_pwl_invalidate_discard_cache, "discard", "Discard and invalidate RWL");
 
@@ -310,16 +311,17 @@ void AbstractWriteLog<I>::log_perf() {
 template <typename I>
 void AbstractWriteLog<I>::periodic_stats() {
   std::lock_guard locker(m_lock);
-  ldout(m_image_ctx.cct, 1) << "STATS: "
-                            << "m_free_log_entries=" << m_free_log_entries << ", "
-                            << "m_log_entries=" << m_log_entries.size() << ", "
-                            << "m_dirty_log_entries=" << m_dirty_log_entries.size() << ", "
-                            << "m_bytes_allocated=" << m_bytes_allocated << ", "
-                            << "m_bytes_cached=" << m_bytes_cached << ", "
-                            << "m_bytes_dirty=" << m_bytes_dirty << ", "
-                            << "bytes available=" << m_bytes_allocated_cap - m_bytes_allocated << ", "
-                            << "m_current_sync_gen=" << m_current_sync_gen << ", "
-                            << "m_flushed_sync_gen=" << m_flushed_sync_gen << ", "
+  ldout(m_image_ctx.cct, 1) << "STATS: m_log_entries=" << m_log_entries.size()
+                            << ", m_dirty_log_entries=" << m_dirty_log_entries.size()
+                            << ", m_free_log_entries=" << m_free_log_entries
+                            << ", m_bytes_allocated=" << m_bytes_allocated
+                            << ", m_bytes_cached=" << m_bytes_cached
+                            << ", m_bytes_dirty=" << m_bytes_dirty
+                            << ", bytes available=" << m_bytes_allocated_cap - m_bytes_allocated
+                            << ", m_first_valid_entry=" << m_first_valid_entry
+                            << ", m_first_free_entry=" << m_first_free_entry
+                            << ", m_current_sync_gen=" << m_current_sync_gen
+                            << ", m_flushed_sync_gen=" << m_flushed_sync_gen
                             << dendl;
 }
 
@@ -341,7 +343,7 @@ template <typename I>
 void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> *log_entry,
     WriteLogCacheEntry *cache_entry, std::map<uint64_t, bool> &missing_sync_points,
     std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> &sync_point_entries,
-    int entry_index) {
+    uint64_t entry_index) {
     bool writer = cache_entry->is_writer();
     if (cache_entry->is_sync_point()) {
       ldout(m_image_ctx.cct, 20) << "Entry " << entry_index
@@ -390,7 +392,7 @@ void AbstractWriteLog<I>::update_entries(std::shared_ptr<GenericLogEntry> *log_e
 template <typename I>
 void AbstractWriteLog<I>::update_sync_points(std::map<uint64_t, bool> &missing_sync_points,
     std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> &sync_point_entries,
-    DeferredContexts &later, uint32_t alloc_size ) {
+    DeferredContexts &later) {
   /* Create missing sync points. These must not be appended until the
    * entry reload is complete and the write map is up to
    * date. Currently this is handled by the deferred contexts object
@@ -441,15 +443,9 @@ void AbstractWriteLog<I>::update_sync_points(std::map<uint64_t, bool> &missing_s
             gen_write_entry->set_flushed(true);
             sync_point_entry->writes_flushed++;
           }
-          if (log_entry->write_bytes() == log_entry->bytes_dirty()) {
-            /* This entry is a basic write */
-            uint64_t bytes_allocated = alloc_size;
-            if (gen_write_entry->ram_entry.write_bytes > bytes_allocated) {
-              bytes_allocated = gen_write_entry->ram_entry.write_bytes;
-            }
-            m_bytes_allocated += bytes_allocated;
-            m_bytes_cached += gen_write_entry->ram_entry.write_bytes;
-          }
+
+          /* calc m_bytes_allocated & m_bytes_cached */
+          inc_allocated_cached_bytes(log_entry);
         }
       }
     } else {
@@ -509,7 +505,10 @@ void AbstractWriteLog<I>::pwl_init(Context *on_finish, DeferredContexts &later)
   ldout(cct,5) << "pwl_path: " << m_cache_state->path << dendl;
 
   m_log_pool_name = m_cache_state->path;
-  m_log_pool_config_size = max(m_cache_state->size, MIN_POOL_SIZE);
+  m_log_pool_size = max(m_cache_state->size, MIN_POOL_SIZE);
+  m_log_pool_size = p2align(m_log_pool_size, POOL_SIZE_ALIGN);
+  ldout(cct, 5) << "pool " << m_log_pool_name << " size " << m_log_pool_size
+                << " (adjusted from " << m_cache_state->size << ")" << dendl;
 
   if ((!m_cache_state->present) &&
       (access(m_log_pool_name.c_str(), F_OK) == 0)) {
@@ -527,9 +526,13 @@ void AbstractWriteLog<I>::pwl_init(Context *on_finish, DeferredContexts &later)
              (access(m_log_pool_name.c_str(), F_OK) != 0)) {
     ldout(cct, 5) << "Can't find the existed pool file " << m_log_pool_name << dendl;
     on_finish->complete(-errno);
+    return;
   }
 
-  initialize_pool(on_finish, later);
+  bool succeeded = initialize_pool(on_finish, later);
+  if (!succeeded) {
+    return ;
+  }
 
   ldout(cct,1) << "pool " << m_log_pool_name << " has " << m_total_log_entries
                << " log entries, " << m_free_log_entries << " of which are free."
@@ -575,7 +578,10 @@ template <typename I>
 void AbstractWriteLog<I>::init(Context *on_finish) {
   CephContext *cct = m_image_ctx.cct;
   ldout(cct, 20) << dendl;
-  perf_start(m_image_ctx.id);
+  auto pname = std::string("librbd-pwl-") + m_image_ctx.id +
+      std::string("-") + m_image_ctx.md_ctx.get_pool_name() +
+      std::string("-") + m_image_ctx.name;
+  perf_start(pname);
 
   ceph_assert(!m_initialized);
 
@@ -617,7 +623,7 @@ void AbstractWriteLog<I>::shut_down(Context *on_finish) {
       }
       {
         std::lock_guard locker(m_lock);
-        ceph_assert(m_dirty_log_entries.size() == 0);
+        check_image_cache_state_clean();
         m_wake_up_enabled = false;
         m_cache_state->clean = true;
         m_log_entries.clear();
@@ -630,6 +636,14 @@ void AbstractWriteLog<I>::shut_down(Context *on_finish) {
       }
       update_image_cache_state(next_ctx);
     });
+  ctx = new LambdaContext(
+    [this, ctx](int r) {
+      Context *next_ctx = override_ctx(r, ctx);
+      ldout(m_image_ctx.cct, 6) << "waiting for in flight operations" << dendl;
+      // Wait for in progress IOs to complete
+      next_ctx = util::create_async_context_callback(&m_work_queue, next_ctx);
+      m_async_op_tracker.wait_for_ops(next_ctx);
+    });
   ctx = new LambdaContext(
     [this, ctx](int r) {
       Context *next_ctx = override_ctx(r, ctx);
@@ -646,14 +660,6 @@ void AbstractWriteLog<I>::shut_down(Context *on_finish) {
       }
       flush_dirty_entries(next_ctx);
     });
-  ctx = new LambdaContext(
-    [this, ctx](int r) {
-      Context *next_ctx = override_ctx(r, ctx);
-      ldout(m_image_ctx.cct, 6) << "waiting for in flight operations" << dendl;
-      // Wait for in progress IOs to complete
-      next_ctx = util::create_async_context_callback(m_image_ctx, next_ctx);
-      m_async_op_tracker.wait_for_ops(next_ctx);
-    });
   ctx = new LambdaContext(
     [this, ctx](int r) {
       ldout(m_image_ctx.cct, 6) << "Done internal_flush in shutdown" << dendl;
@@ -687,7 +693,7 @@ void AbstractWriteLog<I>::read(Extents&& image_extents,
   bl->clear();
   m_perfcounter->inc(l_librbd_pwl_rd_req, 1);
 
-  std::vector<WriteLogCacheEntry*> log_entries_to_read;
+  std::vector<std::shared_ptr<GenericWriteLogEntry>> log_entries_to_read;
   std::vector<bufferlist*> bls_to_read;
 
   m_async_op_tracker.start_op();
@@ -1252,19 +1258,19 @@ void AbstractWriteLog<I>::append_scheduled(GenericLogOperations &ops, bool &ops_
 }
 
 template <typename I>
-void AbstractWriteLog<I>::schedule_append(GenericLogOperationsVector &ops)
+void AbstractWriteLog<I>::schedule_append(GenericLogOperationsVector &ops, C_BlockIORequestT *req)
 {
   GenericLogOperations to_append(ops.begin(), ops.end());
 
-  schedule_append_ops(to_append);
+  schedule_append_ops(to_append, req);
 }
 
 template <typename I>
-void AbstractWriteLog<I>::schedule_append(GenericLogOperationSharedPtr op)
+void AbstractWriteLog<I>::schedule_append(GenericLogOperationSharedPtr op, C_BlockIORequestT *req)
 {
   GenericLogOperations to_append { op };
 
-  schedule_append_ops(to_append);
+  schedule_append_ops(to_append, req);
 }
 
 /*
@@ -1298,16 +1304,16 @@ void AbstractWriteLog<I>::complete_op_log_entries(GenericLogOperations &&ops,
     }
     op->complete(result);
     m_perfcounter->tinc(l_librbd_pwl_log_op_dis_to_app_t,
-                        op->log_append_time - op->dispatch_time);
+                        op->log_append_start_time - op->dispatch_time);
     m_perfcounter->tinc(l_librbd_pwl_log_op_dis_to_cmp_t, now - op->dispatch_time);
     m_perfcounter->hinc(l_librbd_pwl_log_op_dis_to_cmp_t_hist,
                         utime_t(now - op->dispatch_time).to_nsec(),
                         log_entry->ram_entry.write_bytes);
-    utime_t app_lat = op->log_append_comp_time - op->log_append_time;
+    utime_t app_lat = op->log_append_comp_time - op->log_append_start_time;
     m_perfcounter->tinc(l_librbd_pwl_log_op_app_to_appc_t, app_lat);
     m_perfcounter->hinc(l_librbd_pwl_log_op_app_to_appc_t_hist, app_lat.to_nsec(),
                       log_entry->ram_entry.write_bytes);
-    m_perfcounter->tinc(l_librbd_pwl_log_op_app_to_cmp_t, now - op->log_append_time);
+    m_perfcounter->tinc(l_librbd_pwl_log_op_app_to_cmp_t, now - op->log_append_start_time);
   }
   // New entries may be flushable
   {
@@ -1433,8 +1439,9 @@ void AbstractWriteLog<I>::alloc_and_dispatch_io_req(C_BlockIORequestT *req)
       std::lock_guard locker(m_lock);
       dispatch_here = m_deferred_ios.empty();
       // Only flush req's total_bytes is the max uint64
-      if ((req->image_extents_summary.total_bytes ==
-          std::numeric_limits<uint64_t>::max())) {
+      if (req->image_extents_summary.total_bytes ==
+          std::numeric_limits<uint64_t>::max() &&
+          static_cast<C_FlushRequestT *>(req)->internal == true) {
         dispatch_here = true;
       }
     }
@@ -1457,10 +1464,10 @@ void AbstractWriteLog<I>::alloc_and_dispatch_io_req(C_BlockIORequestT *req)
 }
 
 template <typename I>
-bool AbstractWriteLog<I>::check_allocation(C_BlockIORequestT *req,
-      uint64_t &bytes_cached, uint64_t &bytes_dirtied, uint64_t &bytes_allocated,
-      uint64_t &num_lanes, uint64_t &num_log_entries,
-      uint64_t &num_unpublished_reserves, uint64_t bytes_allocated_cap){
+bool AbstractWriteLog<I>::check_allocation(
+    C_BlockIORequestT *req, uint64_t bytes_cached, uint64_t bytes_dirtied,
+    uint64_t bytes_allocated, uint32_t num_lanes, uint32_t num_log_entries,
+    uint32_t num_unpublished_reserves) {
   bool alloc_succeeds = true;
   bool no_space = false;
   {
@@ -1484,11 +1491,11 @@ bool AbstractWriteLog<I>::check_allocation(C_BlockIORequestT *req,
       no_space = true; /* Entries must be retired */
     }
     /* Don't attempt buffer allocate if we've exceeded the "full" threshold */
-    if (m_bytes_allocated + bytes_allocated > bytes_allocated_cap) {
+    if (m_bytes_allocated + bytes_allocated > m_bytes_allocated_cap) {
       if (!req->has_io_waited_for_buffers()) {
         req->set_io_waited_for_buffers(true);
-        ldout(m_image_ctx.cct, 1) << "Waiting for allocation cap (cap="
-                                  << bytes_allocated_cap
+        ldout(m_image_ctx.cct, 5) << "Waiting for allocation cap (cap="
+                                  << m_bytes_allocated_cap
                                   << ", allocated=" << m_bytes_allocated
                                   << ") in write [" << *req << "]" << dendl;
       }
@@ -1506,7 +1513,8 @@ bool AbstractWriteLog<I>::check_allocation(C_BlockIORequestT *req,
     /* We need one free log entry per extent (each is a separate entry), and
      * one free "lane" for remote replication. */
     if ((m_free_lanes >= num_lanes) &&
-        (m_free_log_entries >= num_log_entries)) {
+        (m_free_log_entries >= num_log_entries) &&
+        (m_bytes_allocated_cap >= m_bytes_allocated + bytes_allocated)) {
       m_free_lanes -= num_lanes;
       m_free_log_entries -= num_log_entries;
       m_unpublished_reserves += num_unpublished_reserves;
@@ -1516,7 +1524,6 @@ bool AbstractWriteLog<I>::check_allocation(C_BlockIORequestT *req,
       if (req->has_io_waited_for_buffers()) {
         req->set_io_waited_for_buffers(false);
       }
-
     } else {
       alloc_succeeds = false;
     }
@@ -1631,12 +1638,17 @@ Context* AbstractWriteLog<I>::construct_flush_entry(std::shared_ptr<GenericLogEn
     m_lowest_flushing_sync_gen = log_entry->ram_entry.sync_gen_number;
   }
   m_flush_ops_in_flight += 1;
+  m_flush_ops_will_send += 1;
   /* For write same this is the bytes affected by the flush op, not the bytes transferred */
   m_flush_bytes_in_flight += log_entry->ram_entry.write_bytes;
 
   /* Flush write completion action */
+  utime_t writeback_start_time = ceph_clock_now();
   Context *ctx = new LambdaContext(
-    [this, log_entry, invalidating](int r) {
+    [this, log_entry, writeback_start_time, invalidating](int r) {
+      utime_t writeback_comp_time = ceph_clock_now();
+      m_perfcounter->tinc(l_librbd_pwl_writeback_latency,
+                          writeback_comp_time - writeback_start_time);
       {
         std::lock_guard locker(m_lock);
         if (r < 0) {
@@ -1676,13 +1688,16 @@ void AbstractWriteLog<I>::process_writeback_dirty_entries() {
   CephContext *cct = m_image_ctx.cct;
   bool all_clean = false;
   int flushed = 0;
+  bool has_write_entry = false;
 
   ldout(cct, 20) << "Look for dirty entries" << dendl;
   {
     DeferredContexts post_unlock;
+    GenericLogEntries entries_to_flush;
+
     std::shared_lock entry_reader_locker(m_entry_reader_lock);
+    std::lock_guard locker(m_lock);
     while (flushed < IN_FLIGHT_FLUSH_WRITE_LIMIT) {
-      std::lock_guard locker(m_lock);
       if (m_shutting_down) {
         ldout(cct, 5) << "Flush during shutdown supressed" << dendl;
         /* Do flush complete only when all flush ops are finished */
@@ -1695,17 +1710,26 @@ void AbstractWriteLog<I>::process_writeback_dirty_entries() {
         all_clean = !m_flush_ops_in_flight;
         break;
       }
+
+      if (m_flush_ops_will_send) {
+       ldout(cct, 20) << "Previous flush-ops is still not sent" << dendl;
+       break;
+      }
       auto candidate = m_dirty_log_entries.front();
       bool flushable = can_flush_entry(candidate);
       if (flushable) {
-        post_unlock.add(construct_flush_entry_ctx(candidate));
+        entries_to_flush.push_back(candidate);
         flushed++;
+        if (!has_write_entry)
+          has_write_entry = candidate->is_write_entry();
         m_dirty_log_entries.pop_front();
       } else {
         ldout(cct, 20) << "Next dirty entry isn't flushable yet" << dendl;
         break;
       }
     }
+
+    construct_flush_entries(entries_to_flush, post_unlock, has_write_entry);
   }
 
   if (all_clean) {
@@ -1739,11 +1763,11 @@ bool AbstractWriteLog<I>::handle_flushed_sync_point(std::shared_ptr<SyncPointLog
     }
     m_async_op_tracker.start_op();
     m_work_queue.queue(new LambdaContext(
-      [this, log_entry](int r) {
+      [this, next = std::move(log_entry->next_sync_point_entry)](int r) {
         bool handled_by_next;
         {
           std::lock_guard locker(m_lock);
-          handled_by_next = handle_flushed_sync_point(log_entry->next_sync_point_entry);
+          handled_by_next = handle_flushed_sync_point(std::move(next));
         }
         if (!handled_by_next) {
           persist_last_flushed_sync_gen();
@@ -1961,7 +1985,7 @@ void AbstractWriteLog<I>::internal_flush(bool invalidate, Context *on_finish) {
     if (invalidate) {
       m_perfcounter->inc(l_librbd_pwl_invalidate_cache, 1);
     } else {
-      m_perfcounter->inc(l_librbd_pwl_flush, 1);
+      m_perfcounter->inc(l_librbd_pwl_internal_flush, 1);
     }
   }
 
@@ -2067,6 +2091,20 @@ bool AbstractWriteLog<I>::can_retire_entry(std::shared_ptr<GenericLogEntry> log_
   return log_entry->can_retire();
 }
 
+template <typename I>
+void AbstractWriteLog<I>::check_image_cache_state_clean() {
+  ceph_assert(m_deferred_ios.empty());
+  ceph_assert(m_ops_to_append.empty());;
+  ceph_assert(m_async_flush_ops == 0);
+  ceph_assert(m_async_append_ops == 0);
+  ceph_assert(m_dirty_log_entries.empty());
+  ceph_assert(m_ops_to_flush.empty());
+  ceph_assert(m_flush_ops_in_flight == 0);
+  ceph_assert(m_flush_bytes_in_flight == 0);
+  ceph_assert(m_bytes_dirty == 0);
+  ceph_assert(m_work_queue.empty());
+}
+
 } // namespace pwl
 } // namespace cache
 } // namespace librbd
index 56ecd6c1c209111beee6bb702af15195a5dfe439..864f1e8e6313b0e89237cc736bd6094466dd9300 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef CEPH_LIBRBD_CACHE_PARENT_WRITE_LOG
 #define CEPH_LIBRBD_CACHE_PARENT_WRITE_LOG
 
+#include "common/Timer.h"
 #include "common/RWLock.h"
 #include "common/WorkQueue.h"
 #include "common/AsyncOpTracker.h"
@@ -20,7 +21,6 @@
 #include <list>
 
 class Context;
-class SafeTimer;
 
 namespace librbd {
 
@@ -125,8 +125,8 @@ public:
   virtual void setup_schedule_append(
       pwl::GenericLogOperationsVector &ops, bool do_early_flush,
       C_BlockIORequestT *req) = 0;
-  void schedule_append(pwl::GenericLogOperationsVector &ops);
-  void schedule_append(pwl::GenericLogOperationSharedPtr op);
+  void schedule_append(pwl::GenericLogOperationsVector &ops, C_BlockIORequestT *req = nullptr);
+  void schedule_append(pwl::GenericLogOperationSharedPtr op, C_BlockIORequestT *req = nullptr);
   void flush_new_sync_point(C_FlushRequestT *flush_req,
                             pwl::DeferredContexts &later);
 
@@ -234,6 +234,7 @@ private:
 
   void pwl_init(Context *on_finish, pwl::DeferredContexts &later);
   void update_image_cache_state(Context *on_finish);
+  void check_image_cache_state_clean();
 
   void flush_dirty_entries(Context *on_finish);
   bool can_flush_entry(const std::shared_ptr<pwl::GenericLogEntry> log_entry);
@@ -263,8 +264,7 @@ protected:
   ImageCtxT &m_image_ctx;
 
   std::string m_log_pool_name;
-  uint64_t m_log_pool_config_size; /* Configured size of RWL */
-  uint64_t m_log_pool_actual_size = 0; /* Actual size of RWL pool */
+  uint64_t m_log_pool_size;
 
   uint32_t m_total_log_entries = 0;
   uint32_t m_free_log_entries = 0;
@@ -294,6 +294,7 @@ protected:
   std::atomic<int> m_async_flush_ops = {0};
   std::atomic<int> m_async_append_ops = {0};
 
+  std::atomic<int> m_flush_ops_will_send = {0};
   /* Acquire locks in order declared here */
 
   mutable ceph::mutex m_log_retire_lock;
@@ -337,12 +338,14 @@ protected:
       std::map<uint64_t, bool> &missing_sync_points,
       std::map<uint64_t,
       std::shared_ptr<pwl::SyncPointLogEntry>> &sync_point_entries,
-      int entry_index);
+      uint64_t entry_index);
   void update_sync_points(
       std::map<uint64_t, bool> &missing_sync_points,
       std::map<uint64_t,
       std::shared_ptr<pwl::SyncPointLogEntry>> &sync_point_entries,
-      pwl::DeferredContexts &later, uint32_t alloc_size);
+      pwl::DeferredContexts &later);
+  virtual void inc_allocated_cached_bytes(
+      std::shared_ptr<pwl::GenericLogEntry> log_entry) = 0;
   Context *construct_flush_entry(
       const std::shared_ptr<pwl::GenericLogEntry> log_entry, bool invalidating);
   void process_writeback_dirty_entries();
@@ -352,28 +355,26 @@ protected:
   void complete_op_log_entries(pwl::GenericLogOperations &&ops, const int r);
 
   bool check_allocation(
-      C_BlockIORequestT *req,
-      uint64_t &bytes_cached, uint64_t &bytes_dirtied,
-      uint64_t &bytes_allocated,
-      uint64_t &num_lanes, uint64_t &num_log_entries,
-      uint64_t &num_unpublished_reserves, uint64_t bytes_allocated_cap);
+      C_BlockIORequestT *req, uint64_t bytes_cached, uint64_t bytes_dirtied,
+      uint64_t bytes_allocated, uint32_t num_lanes, uint32_t num_log_entries,
+      uint32_t num_unpublished_reserves);
   void append_scheduled(
       pwl::GenericLogOperations &ops, bool &ops_remain, bool &appending,
       bool isRWL=false);
 
   virtual void process_work() = 0;
   virtual void append_scheduled_ops(void) = 0;
-  virtual void schedule_append_ops(pwl::GenericLogOperations &ops) = 0;
+  virtual void schedule_append_ops(pwl::GenericLogOperations &ops, C_BlockIORequestT *req) = 0;
   virtual void remove_pool_file() = 0;
-  virtual void initialize_pool(Context *on_finish,
+  virtual bool initialize_pool(Context *on_finish,
                                pwl::DeferredContexts &later) = 0;
   virtual void collect_read_extents(
       uint64_t read_buffer_offset, LogMapEntry<GenericWriteLogEntry> map_entry,
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, uint64_t entry_hit_length,
       Extent hit_extent, pwl::C_ReadRequest *read_ctx) = 0;
   virtual void complete_read(
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, Context *ctx) = 0;
   virtual void write_data_to_buffer(
       std::shared_ptr<pwl::WriteLogEntry> ws_entry,
@@ -389,10 +390,9 @@ protected:
   virtual void persist_last_flushed_sync_gen() {}
   virtual void reserve_cache(C_BlockIORequestT *req, bool &alloc_succeeds,
                              bool &no_space) {}
-  virtual Context *construct_flush_entry_ctx(
-      const std::shared_ptr<pwl::GenericLogEntry> log_entry) {
-    return nullptr;
-  }
+  virtual void construct_flush_entries(pwl::GenericLogEntries entries_to_flush,
+                                       DeferredContexts &post_unlock,
+                                       bool has_write_entry) = 0;
   virtual uint64_t get_max_extent() {
     return 0;
   }
index ea00d4fbc7664410a19b0f276c90a24d9030cd52..a6d0fb44a1de1b138da5a9a80ac11172ff72a3da 100644 (file)
@@ -122,8 +122,8 @@ void InitRequest<I>::init_image_cache() {
   ldout(cct, 10) << dendl;
 
   using klass = InitRequest<I>;
-  Context *ctx = create_context_callback<
-    klass, &klass::handle_init_image_cache>(this);
+  Context *ctx = create_async_context_callback(m_image_ctx,
+    create_context_callback<klass, &klass::handle_init_image_cache>(this));
   m_image_cache->init(ctx);
 }
 
index 98224241b557e384e48da8e63ef4c507fec8786c..63873f748d9080ba91a51741bbcbcdf2b5a7ecbc 100644 (file)
@@ -88,14 +88,6 @@ void WriteLogEntry::init(bool has_data,
   ram_entry.discard = 0;
 }
 
-unsigned int WriteLogEntry::reader_count() const {
-  if (cache_bp.have_raw()) {
-    return (cache_bp.raw_nref() - bl_refs - 1);
-  } else {
-    return 0;
-  }
-}
-
 std::ostream& WriteLogEntry::format(std::ostream &os) const {
   os << "(Write) ";
   GenericWriteLogEntry::format(os);
index b29d7fb88bcb3439fd2da04f53d90ef19c3055b7..a5889a13bc79d9463d2e5918d1c27707215fcd8b 100644 (file)
@@ -25,7 +25,7 @@ class GenericLogEntry {
 public:
   WriteLogCacheEntry ram_entry;
   WriteLogCacheEntry *cache_entry = nullptr;
-  uint32_t log_entry_index = 0;
+  uint64_t log_entry_index = 0;
   bool completed = false;
   GenericLogEntry(uint64_t image_offset_bytes = 0, uint64_t write_bytes = 0)
     : ram_entry(image_offset_bytes, write_bytes) {
@@ -217,9 +217,8 @@ public:
   virtual buffer::list &get_cache_bl() = 0;
 
   BlockExtent block_extent();
-  unsigned int reader_count() const;
+  virtual unsigned int reader_count() const = 0;
   /* Constructs a new bl containing copies of cache_bp */
-  void copy_cache_bl(bufferlist *out_bl) override {};
   bool can_retire() const override {
     return (this->completed && this->get_flushed() && (0 == reader_count()));
   }
index 701fe14b1a60289ded1a382d8a9ce77ba0dd5659..4fc13a91a23f2d8debe40bb05e234c813db3740e 100644 (file)
@@ -21,9 +21,9 @@ GenericLogOperation::GenericLogOperation(utime_t dispatch_time,
 
 std::ostream& GenericLogOperation::format(std::ostream &os) const {
   os << "dispatch_time=[" << dispatch_time << "], "
-     << "buf_persist_time=[" << buf_persist_time << "], "
+     << "buf_persist_start_time=[" << buf_persist_start_time << "], "
      << "buf_persist_comp_time=[" << buf_persist_comp_time << "], "
-     << "log_append_time=[" << log_append_time << "], "
+     << "log_append_start_time=[" << log_append_start_time << "], "
      << "log_append_comp_time=[" << log_append_comp_time << "], ";
   return os;
 }
@@ -70,9 +70,9 @@ std::vector<Context*> SyncPointLogOperation::append_sync_point() {
 void SyncPointLogOperation::clear_earlier_sync_point() {
   std::lock_guard locker(m_lock);
   ceph_assert(sync_point->later_sync_point);
-  ceph_assert(sync_point->later_sync_point->earlier_sync_point ==
-              sync_point);
+  ceph_assert(sync_point->later_sync_point->earlier_sync_point == sync_point);
   sync_point->later_sync_point->earlier_sync_point = nullptr;
+  sync_point->later_sync_point = nullptr;
 }
 
 std::vector<Context*> SyncPointLogOperation::swap_on_sync_point_persisted() {
@@ -226,12 +226,15 @@ std::ostream &operator<<(std::ostream &os,
 
 void WriteLogOperation::complete(int result) {
   GenericWriteLogOperation::complete(result);
-  m_perfcounter->tinc(l_librbd_pwl_log_op_dis_to_buf_t, buf_persist_time - dispatch_time);
-  utime_t buf_lat = buf_persist_comp_time - buf_persist_time;
-  m_perfcounter->tinc(l_librbd_pwl_log_op_buf_to_bufc_t, buf_lat);
-  m_perfcounter->hinc(l_librbd_pwl_log_op_buf_to_bufc_t_hist, buf_lat.to_nsec(),
+  m_perfcounter->tinc(l_librbd_pwl_log_op_dis_to_buf_t,
+                      buf_persist_start_time - dispatch_time);
+  utime_t buf_persist_lat = buf_persist_comp_time - buf_persist_start_time;
+  m_perfcounter->tinc(l_librbd_pwl_log_op_buf_to_bufc_t, buf_persist_lat);
+  m_perfcounter->hinc(l_librbd_pwl_log_op_buf_to_bufc_t_hist,
+                      buf_persist_lat.to_nsec(),
                       log_entry->ram_entry.write_bytes);
-  m_perfcounter->tinc(l_librbd_pwl_log_op_buf_to_app_t, log_append_time - buf_persist_time);
+  m_perfcounter->tinc(l_librbd_pwl_log_op_buf_to_app_t,
+                      log_append_start_time - buf_persist_start_time);
 }
 
 WriteLogOperationSet::WriteLogOperationSet(utime_t dispatched, PerfCounters *perfcounter, std::shared_ptr<SyncPoint> sync_point,
index 52f8591b6a656833d1f26373906e583008165116..15befe05f255d2a91977e8a26ef8da7563f70338 100644 (file)
@@ -35,11 +35,11 @@ class GenericLogOperation {
 protected:
   PerfCounters *m_perfcounter = nullptr;
 public:
-  utime_t dispatch_time;         // When op created
-  utime_t buf_persist_time;      // When buffer persist begins
-  utime_t buf_persist_comp_time; // When buffer persist completes
-  utime_t log_append_time;       // When log append begins
-  utime_t log_append_comp_time;  // When log append completes
+  utime_t dispatch_time;          // When op created
+  utime_t buf_persist_start_time; // When buffer persist begins
+  utime_t buf_persist_comp_time;  // When buffer persist completes
+  utime_t log_append_start_time;  // When log append begins
+  utime_t log_append_comp_time;   // When log append completes
   GenericLogOperation(utime_t dispatch_time, PerfCounters *perfcounter);
   virtual ~GenericLogOperation() { };
   GenericLogOperation(const GenericLogOperation&) = delete;
index 8d5a0b4742a722d55ac56d8dbaaa592c8dc49290..7953c2887fca724ecb36c8f0083c1202863405cb 100644 (file)
@@ -101,7 +101,7 @@ public:
   virtual void setup_buffer_resources(
       uint64_t *bytes_cached, uint64_t *bytes_dirtied, uint64_t *bytes_allocated,
       uint64_t *number_lanes, uint64_t *number_log_entries,
-      uint64_t *number_unpublished_reserves) {};
+      uint64_t *number_unpublished_reserves) = 0;
 
 protected:
   utime_t m_arrived_time;
index 5d438b2f11d0631e4eac219306b65ce525c9d822..06d5b52bdb0c72d3c03d6760823cbe5ece4047a1 100644 (file)
@@ -41,13 +41,13 @@ enum {
 
   // All write requests
   l_librbd_pwl_wr_req,             // write requests
+  l_librbd_pwl_wr_bytes,           // bytes written
   l_librbd_pwl_wr_req_def,         // write requests deferred for resources
   l_librbd_pwl_wr_req_def_lanes,   // write requests deferred for lanes
   l_librbd_pwl_wr_req_def_log,     // write requests deferred for log entries
   l_librbd_pwl_wr_req_def_buf,     // write requests deferred for buffer space
   l_librbd_pwl_wr_req_overlap,     // write requests detained for overlap
   l_librbd_pwl_wr_req_queued,      // write requests queued for prior barrier
-  l_librbd_pwl_wr_bytes,           // bytes written
 
   // Write log operations (1 .. n per request that appends to the log)
   l_librbd_pwl_log_ops,            // log append ops
@@ -137,7 +137,8 @@ enum {
   l_librbd_pwl_cmp_latency,
   l_librbd_pwl_cmp_fails,
 
-  l_librbd_pwl_flush,
+  l_librbd_pwl_internal_flush,
+  l_librbd_pwl_writeback_latency,
   l_librbd_pwl_invalidate_cache,
   l_librbd_pwl_invalidate_discard_cache,
 
@@ -173,9 +174,11 @@ const unsigned int MAX_CONCURRENT_WRITES = (1024 * 1024);
 
 const uint64_t DEFAULT_POOL_SIZE = 1u<<30;
 const uint64_t MIN_POOL_SIZE = DEFAULT_POOL_SIZE;
+const uint64_t POOL_SIZE_ALIGN = 1 << 20;
 constexpr double USABLE_SIZE = (7.0 / 10);
 const uint64_t BLOCK_ALLOC_OVERHEAD_BYTES = 16;
-const uint8_t RWL_POOL_VERSION = 1;
+const uint8_t RWL_LAYOUT_VERSION = 1;
+const uint8_t SSD_LAYOUT_VERSION = 1;
 const uint64_t MAX_LOG_ENTRIES = (1024 * 1024);
 const double AGGRESSIVE_RETIRE_HIGH_WATER = 0.75;
 const double RETIRE_HIGH_WATER = 0.50;
@@ -280,7 +283,7 @@ struct WriteLogPoolRoot {
   #ifdef WITH_RBD_RWL
   union {
     struct {
-      uint8_t layout_version;    /* Version of this structure (RWL_POOL_VERSION) */
+      uint8_t layout_version;    /* Version of this structure (RWL_LAYOUT_VERSION) */
     };
     uint64_t _u64;
   } header;
@@ -295,8 +298,8 @@ struct WriteLogPoolRoot {
                                   * sync gen number are flushed. */
   uint32_t block_size;           /* block size */
   uint32_t num_log_entries;
-  uint32_t first_free_entry;     /* Entry following the newest valid entry */
-  uint32_t first_valid_entry;    /* Index of the oldest valid entry in the log */
+  uint64_t first_free_entry;     /* Entry following the newest valid entry */
+  uint64_t first_valid_entry;    /* Index of the oldest valid entry in the log */
 
   #ifdef WITH_RBD_SSD_CACHE
   DENC(WriteLogPoolRoot, v, p) {
index 7325bef78a95892eb8839aad5668769133a8a1cc..056701fb514880d1902034eb72a30dc54d432e1e 100644 (file)
@@ -80,6 +80,14 @@ void WriteLogEntry::copy_cache_bl(bufferlist *out_bl) {
   this->init_bl(cloned_bp, *out_bl);
 }
 
+unsigned int WriteLogEntry::reader_count() const {
+  if (cache_bp.have_raw()) {
+    return (cache_bp.raw_nref() - bl_refs - 1);
+  } else {
+    return 0;
+  }
+}
+
 void WriteSameLogEntry::writeback(
     librbd::cache::ImageWritebackInterface &image_writeback, Context *ctx) {
   bufferlist entry_bl;
index 0eacb5aeec9ab6ce21411bcccc4985375e2bb791..a4675c5fbd824983357c6f153605206bf8c040ab 100644 (file)
@@ -39,6 +39,7 @@ public:
       std::vector<WriteBufferAllocation>::iterator allocation) override;
   buffer::list &get_cache_bl() override;
   void copy_cache_bl(bufferlist *out_bl) override;
+  unsigned int reader_count() const override;
 };
 
 class WriteSameLogEntry : public WriteLogEntry {
index 2fe1318a33c39c6d5ad4190b8dc6ac60b9a5ddb2..09158127241a33ded3d6b6460e167277e4faf86b 100644 (file)
@@ -62,6 +62,7 @@ void C_WriteSameRequest<T>::setup_buffer_resources(
     uint64_t *number_lanes, uint64_t *number_log_entries,
     uint64_t *number_unpublished_reserves) {
   ceph_assert(this->image_extents.size() == 1);
+  *number_log_entries = 1;
   *bytes_dirtied += this->image_extents[0].second;
   auto pattern_length = this->bl.length();
   this->m_resources.buffers.emplace_back();
index 0dba120f9310720a01978f9a04f1cd3728ddcb47..f5cc9747ae5dd97b5f9ad3a522d30eb07c0ea37d 100644 (file)
@@ -60,7 +60,7 @@ WriteLog<I>::~WriteLog() {
 template <typename I>
 void WriteLog<I>::collect_read_extents(
       uint64_t read_buffer_offset, LogMapEntry<GenericWriteLogEntry> map_entry,
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, uint64_t entry_hit_length,
       Extent hit_extent, pwl::C_ReadRequest *read_ctx) {
   /* Make a bl for this hit extent. This will add references to the
@@ -82,7 +82,7 @@ void WriteLog<I>::collect_read_extents(
 
 template <typename I>
 void WriteLog<I>::complete_read(
-    std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+    std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
     std::vector<bufferlist*> &bls_to_read, Context *ctx) {
   ctx->complete(0);
 }
@@ -162,7 +162,7 @@ int WriteLog<I>::append_op_log_entries(GenericLogOperations &ops)
     ldout(m_image_ctx.cct, 05) << "APPENDING: index="
                                << operation->get_log_entry()->log_entry_index << " "
                                << "operation=[" << *operation << "]" << dendl;
-    operation->log_append_time = now;
+    operation->log_append_start_time = now;
     *operation->get_log_entry()->cache_entry = operation->get_log_entry()->ram_entry;
     ldout(m_image_ctx.cct, 20) << "APPENDING: index="
                                << operation->get_log_entry()->log_entry_index << " "
@@ -258,7 +258,7 @@ void WriteLog<I>::remove_pool_file() {
 }
 
 template <typename I>
-void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &later) {
+bool WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &later) {
   CephContext *cct = m_image_ctx.cct;
   TOID(struct WriteLogPoolRoot) pool_root;
   ceph_assert(ceph_mutex_is_locked_by_me(m_lock));
@@ -266,7 +266,7 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
     if ((m_log_pool =
          pmemobj_create(this->m_log_pool_name.c_str(),
                         this->m_pwl_pool_layout_name,
-                        this->m_log_pool_config_size,
+                        this->m_log_pool_size,
                         (S_IWUSR | S_IRUSR))) == NULL) {
       lderr(cct) << "failed to create pool (" << this->m_log_pool_name << ")"
                  << pmemobj_errormsg() << dendl;
@@ -275,7 +275,7 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
       m_cache_state->empty = true;
       /* TODO: filter/replace errnos that are meaningless to the caller */
       on_finish->complete(-errno);
-      return;
+      return false;
     }
     m_cache_state->present = true;
     m_cache_state->clean = true;
@@ -283,7 +283,7 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
     pool_root = POBJ_ROOT(m_log_pool, struct WriteLogPoolRoot);
 
     /* new pool, calculate and store metadata */
-    size_t effective_pool_size = (size_t)(this->m_log_pool_config_size * USABLE_SIZE);
+    size_t effective_pool_size = (size_t)(this->m_log_pool_size * USABLE_SIZE);
     size_t small_write_size = MIN_WRITE_ALLOC_SIZE + BLOCK_ALLOC_OVERHEAD_BYTES + sizeof(struct WriteLogCacheEntry);
     uint64_t num_small_writes = (uint64_t)(effective_pool_size / small_write_size);
     if (num_small_writes > MAX_LOG_ENTRIES) {
@@ -292,20 +292,19 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
     if (num_small_writes <= 2) {
       lderr(cct) << "num_small_writes needs to > 2" << dendl;
       on_finish->complete(-EINVAL);
-      return;
+      return false;
     }
-    this->m_log_pool_actual_size = this->m_log_pool_config_size;
     this->m_bytes_allocated_cap = effective_pool_size;
     /* Log ring empty */
     m_first_free_entry = 0;
     m_first_valid_entry = 0;
     TX_BEGIN(m_log_pool) {
       TX_ADD(pool_root);
-      D_RW(pool_root)->header.layout_version = RWL_POOL_VERSION;
+      D_RW(pool_root)->header.layout_version = RWL_LAYOUT_VERSION;
       D_RW(pool_root)->log_entries =
         TX_ZALLOC(struct WriteLogCacheEntry,
                   sizeof(struct WriteLogCacheEntry) * num_small_writes);
-      D_RW(pool_root)->pool_size = this->m_log_pool_actual_size;
+      D_RW(pool_root)->pool_size = this->m_log_pool_size;
       D_RW(pool_root)->flushed_sync_gen = this->m_flushed_sync_gen;
       D_RW(pool_root)->block_size = MIN_WRITE_ALLOC_SIZE;
       D_RW(pool_root)->num_log_entries = num_small_writes;
@@ -319,7 +318,7 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
       this->m_free_log_entries = 0;
       lderr(cct) << "failed to initialize pool (" << this->m_log_pool_name << ")" << dendl;
       on_finish->complete(-pmemobj_tx_errno());
-      return;
+      return false;
     } TX_FINALLY {
     } TX_END;
   } else {
@@ -331,24 +330,24 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
       lderr(cct) << "failed to open pool (" << this->m_log_pool_name << "): "
                  << pmemobj_errormsg() << dendl;
       on_finish->complete(-errno);
-      return;
+      return false;
     }
     pool_root = POBJ_ROOT(m_log_pool, struct WriteLogPoolRoot);
-    if (D_RO(pool_root)->header.layout_version != RWL_POOL_VERSION) {
+    if (D_RO(pool_root)->header.layout_version != RWL_LAYOUT_VERSION) {
       // TODO: will handle upgrading version in the future
       lderr(cct) << "Pool layout version is "
                  << D_RO(pool_root)->header.layout_version
-                 << " expected " << RWL_POOL_VERSION << dendl;
+                 << " expected " << RWL_LAYOUT_VERSION << dendl;
       on_finish->complete(-EINVAL);
-      return;
+      return false;
     }
     if (D_RO(pool_root)->block_size != MIN_WRITE_ALLOC_SIZE) {
       lderr(cct) << "Pool block size is " << D_RO(pool_root)->block_size
                  << " expected " << MIN_WRITE_ALLOC_SIZE << dendl;
       on_finish->complete(-EINVAL);
-      return;
+      return false;
     }
-    this->m_log_pool_actual_size = D_RO(pool_root)->pool_size;
+    this->m_log_pool_size = D_RO(pool_root)->pool_size;
     this->m_flushed_sync_gen = D_RO(pool_root)->flushed_sync_gen;
     this->m_total_log_entries = D_RO(pool_root)->num_log_entries;
     m_first_free_entry = D_RO(pool_root)->first_free_entry;
@@ -364,12 +363,13 @@ void WriteLog<I>::initialize_pool(Context *on_finish, pwl::DeferredContexts &lat
        * entries, and n-1 free log entries */
       this->m_free_log_entries = this->m_total_log_entries - (m_first_free_entry - m_first_valid_entry) -1;
     }
-    size_t effective_pool_size = (size_t)(this->m_log_pool_config_size * USABLE_SIZE);
+    size_t effective_pool_size = (size_t)(this->m_log_pool_size * USABLE_SIZE);
     this->m_bytes_allocated_cap = effective_pool_size;
     load_existing_entries(later);
     m_cache_state->clean = this->m_dirty_log_entries.empty();
     m_cache_state->empty = m_log_entries.empty();
   }
+  return true;
 }
 
 /*
@@ -435,7 +435,16 @@ void WriteLog<I>::load_existing_entries(DeferredContexts &later) {
     entry_index = (entry_index + 1) % this->m_total_log_entries;
   }
 
-  this->update_sync_points(missing_sync_points, sync_point_entries, later, MIN_WRITE_ALLOC_SIZE);
+  this->update_sync_points(missing_sync_points, sync_point_entries, later);
+}
+
+template <typename I>
+void WriteLog<I>::inc_allocated_cached_bytes(
+    std::shared_ptr<pwl::GenericLogEntry> log_entry) {
+  if (log_entry->is_write_entry()) {
+    this->m_bytes_allocated += std::max(log_entry->write_bytes(), MIN_WRITE_ALLOC_SIZE);
+    this->m_bytes_cached += log_entry->write_bytes();
+  }
 }
 
 template <typename I>
@@ -566,23 +575,28 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
 }
 
 template <typename I>
-Context* WriteLog<I>::construct_flush_entry_ctx(
-    std::shared_ptr<GenericLogEntry> log_entry) {
+void WriteLog<I>::construct_flush_entries(pwl::GenericLogEntries entries_to_flush,
+                                         DeferredContexts &post_unlock,
+                                         bool has_write_entry) {
   bool invalidating = this->m_invalidating; // snapshot so we behave consistently
-  Context *ctx = this->construct_flush_entry(log_entry, invalidating);
 
-  if (invalidating) {
-    return ctx;
-  }
-  return new LambdaContext(
-    [this, log_entry, ctx](int r) {
-      m_image_ctx.op_work_queue->queue(new LambdaContext(
+  for (auto &log_entry : entries_to_flush) {
+    Context *ctx = this->construct_flush_entry(log_entry, invalidating);
+
+    if (!invalidating) {
+      ctx = new LambdaContext(
         [this, log_entry, ctx](int r) {
-          ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
-                                     << " " << *log_entry << dendl;
-          log_entry->writeback(this->m_image_writeback, ctx);
-        }), 0);
-    });
+         m_image_ctx.op_work_queue->queue(new LambdaContext(
+           [this, log_entry, ctx](int r) {
+             ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
+                                        << " " << *log_entry << dendl;
+             log_entry->writeback(this->m_image_writeback, ctx);
+             this->m_flush_ops_will_send -= 1;
+           }), 0);
+        });
+   }
+   post_unlock.add(ctx);
+  }
 }
 
 const unsigned long int ops_flushed_together = 4;
@@ -625,7 +639,7 @@ void WriteLog<I>::flush_then_append_scheduled_ops(void)
      * get to the log message append step. */
     if (ops.size()) {
       flush_pmem_buffer(ops);
-      schedule_append_ops(ops);
+      schedule_append_ops(ops, nullptr);
     }
   } while (ops_remain);
   append_scheduled_ops();
@@ -695,7 +709,7 @@ void WriteLog<I>::setup_schedule_append(
  * all prior log entries are persisted everywhere.
  */
 template <typename I>
-void WriteLog<I>::schedule_append_ops(GenericLogOperations &ops)
+void WriteLog<I>::schedule_append_ops(GenericLogOperations &ops, C_BlockIORequestT *req)
 {
   bool need_finisher;
   GenericLogOperationsVector appending;
@@ -825,6 +839,16 @@ template <typename I>
 template <typename V>
 void WriteLog<I>::flush_pmem_buffer(V& ops)
 {
+  utime_t now = ceph_clock_now();
+  for (auto &operation : ops) {
+    if (operation->reserved_allocated()) {
+      operation->buf_persist_start_time = now;
+    } else {
+      ldout(m_image_ctx.cct, 20) << "skipping non-write op: "
+                                 << *operation << dendl;
+    }
+  }
+
   for (auto &operation : ops) {
     if(operation->is_writing_op()) {
       auto log_entry = static_pointer_cast<WriteLogEntry>(operation->get_log_entry());
@@ -835,12 +859,13 @@ void WriteLog<I>::flush_pmem_buffer(V& ops)
   /* Drain once for all */
   pmemobj_drain(m_log_pool);
 
-  utime_t now = ceph_clock_now();
+  now = ceph_clock_now();
   for (auto &operation : ops) {
     if (operation->reserved_allocated()) {
       operation->buf_persist_comp_time = now;
     } else {
-      ldout(m_image_ctx.cct, 20) << "skipping non-write op: " << *operation << dendl;
+      ldout(m_image_ctx.cct, 20) << "skipping non-write op: "
+                                 << *operation << dendl;
     }
   }
 }
@@ -896,6 +921,12 @@ void WriteLog<I>::reserve_cache(C_BlockIORequestT *req,
                                 << *req << dendl;
       alloc_succeeds = false;
       no_space = true; /* Entries need to be retired */
+
+      if (this->m_free_log_entries == this->m_total_log_entries - 1) {
+        /* When the cache is empty, there is still no space to allocate.
+         * Defragment. */
+        pmemobj_defrag(m_log_pool, NULL, 0, NULL);
+      }
       break;
     } else {
       buffer.allocated = true;
@@ -931,9 +962,9 @@ bool WriteLog<I>::alloc_resources(C_BlockIORequestT *req) {
   req->setup_buffer_resources(&bytes_cached, &bytes_dirtied, &bytes_allocated,
                               &num_lanes, &num_log_entries, &num_unpublished_reserves);
 
-  alloc_succeeds = this->check_allocation(req, bytes_cached, bytes_dirtied, bytes_allocated,
-                              num_lanes, num_log_entries, num_unpublished_reserves,
-                              this->m_bytes_allocated_cap);
+  alloc_succeeds = this->check_allocation(req, bytes_cached, bytes_dirtied,
+                                          bytes_allocated, num_lanes, num_log_entries,
+                                          num_unpublished_reserves);
 
   std::vector<WriteBufferAllocation>& buffers = req->get_resources_buffers();
   if (!alloc_succeeds) {
index 7aea8573c917323b1e5a8aee4b13a0fbe9cfe370..5083a2568d497b7dc61168bd25a6b7e6effdecf3 100644 (file)
@@ -7,6 +7,7 @@
 #include <functional>
 #include <libpmemobj.h>
 #include <list>
+#include "common/Timer.h"
 #include "common/RWLock.h"
 #include "common/WorkQueue.h"
 #include "common/AsyncOpTracker.h"
@@ -21,7 +22,6 @@
 #include "librbd/cache/pwl/rwl/Builder.h"
 
 class Context;
-class SafeTimer;
 
 namespace librbd {
 
@@ -70,7 +70,8 @@ private:
   void flush_op_log_entries(pwl::GenericLogOperationsVector &ops);
   template <typename V>
   void flush_pmem_buffer(V& ops);
-
+  void inc_allocated_cached_bytes(
+      std::shared_ptr<pwl::GenericLogEntry> log_entry) override;
 protected:
   using AbstractWriteLog<ImageCtxT>::m_lock;
   using AbstractWriteLog<ImageCtxT>::m_log_entries;
@@ -82,17 +83,17 @@ protected:
   using AbstractWriteLog<ImageCtxT>::m_first_valid_entry;
 
   void process_work() override;
-  void schedule_append_ops(pwl::GenericLogOperations &ops) override;
+  void schedule_append_ops(pwl::GenericLogOperations &ops, C_BlockIORequestT *req) override;
   void append_scheduled_ops(void) override;
   void reserve_cache(C_BlockIORequestT *req,
                      bool &alloc_succeeds, bool &no_space) override;
   void collect_read_extents(
       uint64_t read_buffer_offset, LogMapEntry<GenericWriteLogEntry> map_entry,
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, uint64_t entry_hit_length,
       Extent hit_extent, pwl::C_ReadRequest *read_ctx) override;
   void complete_read(
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, Context *ctx) override;
   bool retire_entries(const unsigned long int frees_per_tx) override;
   void persist_last_flushed_sync_gen() override;
@@ -101,9 +102,10 @@ protected:
   void setup_schedule_append(
       pwl::GenericLogOperationsVector &ops, bool do_early_flush,
       C_BlockIORequestT *req) override;
-  Context *construct_flush_entry_ctx(
-        const std::shared_ptr<pwl::GenericLogEntry> log_entry) override;
-  void initialize_pool(Context *on_finish, pwl::DeferredContexts &later) override;
+  void construct_flush_entries(pwl::GenericLogEntries entries_to_flush,
+                               DeferredContexts &post_unlock,
+                               bool has_write_entry) override;
+  bool initialize_pool(Context *on_finish, pwl::DeferredContexts &later) override;
   void write_data_to_buffer(
       std::shared_ptr<pwl::WriteLogEntry> ws_entry,
       pwl::WriteLogCacheEntry *pmem_entry) override;
index 02bc2bee6325d00b8040e2802212f178214327b8..0e6edd87b35c6877fa58525d87f836967f30acb6 100644 (file)
@@ -21,10 +21,14 @@ void WriteLogEntry::init_cache_bl(
 }
 
 buffer::list& WriteLogEntry::get_cache_bl() {
-  std::lock_guard locker(m_entry_bl_lock);
   return cache_bl;
 }
 
+void  WriteLogEntry::copy_cache_bl(bufferlist *out) {
+  std::lock_guard locker(m_entry_bl_lock);
+  *out = cache_bl;
+}
+
 void WriteLogEntry::remove_cache_bl() {
     std::lock_guard locker(m_entry_bl_lock);
     cache_bl.clear();
index 666398440a22155ffbe57dfc68d2a54ef0452095..8e26f661ff8caa6b81e7cea898eaa52100480ec5 100644 (file)
@@ -38,8 +38,14 @@ public:
                  Context *ctx, ceph::bufferlist &&bl) override;
   void init_cache_bl(bufferlist &src_bl, uint64_t off, uint64_t len) override;
   buffer::list &get_cache_bl() override;
+  void copy_cache_bl(bufferlist *out) override;
   void remove_cache_bl() override;
   unsigned int get_aligned_data_size() const override;
+  void inc_bl_refs() { bl_refs++; };
+  void dec_bl_refs() { bl_refs--; };
+  unsigned int reader_count() const override {
+    return bl_refs;
+  }
 };
 
 class WriteSameLogEntry : public WriteLogEntry {
index 69951e7601fbd2b1941844040c6c86003b2c996f..e92e547c8e60782ccbda78acad8de4a140a6b43f 100644 (file)
@@ -19,11 +19,9 @@ void C_WriteRequest<T>::setup_buffer_resources(
     uint64_t *number_lanes, uint64_t *number_log_entries,
     uint64_t *number_unpublished_reserves) {
 
-  auto image_extents_size = this->image_extents.size();
   *bytes_cached = 0;
   *bytes_allocated = 0;
-  *number_lanes = image_extents_size;
-  *number_log_entries = image_extents_size;
+  *number_log_entries = this->image_extents.size();
 
   for (auto &extent : this->image_extents) {
     *bytes_cached += extent.second;
@@ -49,6 +47,7 @@ void C_WriteSameRequest<T>::setup_buffer_resources(
     uint64_t *number_lanes, uint64_t *number_log_entries,
     uint64_t *number_unpublished_reserves) {
   ceph_assert(this->image_extents.size() == 1);
+  *number_log_entries = 1;
   *bytes_dirtied = this->image_extents[0].second;
   *bytes_cached = this->bl.length();
   *bytes_allocated = round_up_to(*bytes_cached, MIN_WRITE_ALLOC_SSD_SIZE);
index 725039a81f659aba0492631666555ec4dd8c8fd8..c2042a239c0e9d6008ea6b89b3e3b23f427dd820 100644 (file)
@@ -32,8 +32,15 @@ namespace ssd {
 
 using namespace librbd::cache::pwl;
 
-// SSD: this number can be updated later
-const unsigned long int ops_appended_together = MAX_WRITES_PER_SYNC_POINT;
+static bool is_valid_pool_root(const WriteLogPoolRoot& root) {
+  return root.pool_size % MIN_WRITE_ALLOC_SSD_SIZE == 0 &&
+         root.first_valid_entry >= DATA_RING_BUFFER_OFFSET &&
+         root.first_valid_entry < root.pool_size &&
+         root.first_valid_entry % MIN_WRITE_ALLOC_SSD_SIZE == 0 &&
+         root.first_free_entry >= DATA_RING_BUFFER_OFFSET &&
+         root.first_free_entry < root.pool_size &&
+         root.first_free_entry % MIN_WRITE_ALLOC_SSD_SIZE == 0;
+}
 
 template <typename I>
 Builder<AbstractWriteLog<I>>* WriteLog<I>::create_builder() {
@@ -59,52 +66,81 @@ WriteLog<I>::~WriteLog() {
 template <typename I>
 void WriteLog<I>::collect_read_extents(
     uint64_t read_buffer_offset, LogMapEntry<GenericWriteLogEntry> map_entry,
-    std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+    std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
     std::vector<bufferlist*> &bls_to_read,
     uint64_t entry_hit_length, Extent hit_extent,
     pwl::C_ReadRequest *read_ctx) {
-    // Make a bl for this hit extent. This will add references to the
-    // write_entry->cache_bl */
-    ldout(m_image_ctx.cct, 5) << dendl;
-    auto write_entry = static_pointer_cast<WriteLogEntry>(map_entry.log_entry);
-    buffer::list hit_bl;
-    hit_bl = write_entry->get_cache_bl();
-    bool writesame = write_entry->is_writesame_entry();
-    auto hit_extent_buf = std::make_shared<ImageExtentBuf>(
-        hit_extent, hit_bl, true, read_buffer_offset, writesame);
-    read_ctx->read_extents.push_back(hit_extent_buf);
-
-    if(!hit_bl.length()) {
-      ldout(m_image_ctx.cct, 5) << "didn't hit RAM" << dendl;
-      auto read_extent = read_ctx->read_extents.back();
-      log_entries_to_read.push_back(&write_entry->ram_entry);
-      bls_to_read.push_back(&read_extent->m_bl);
-    }
+  // Make a bl for this hit extent. This will add references to the
+  // write_entry->cache_bl */
+  ldout(m_image_ctx.cct, 5) << dendl;
+  auto write_entry = static_pointer_cast<WriteLogEntry>(map_entry.log_entry);
+  buffer::list hit_bl;
+  write_entry->copy_cache_bl(&hit_bl);
+  bool writesame = write_entry->is_writesame_entry();
+  auto hit_extent_buf = std::make_shared<ImageExtentBuf>(
+      hit_extent, hit_bl, true, read_buffer_offset, writesame);
+  read_ctx->read_extents.push_back(hit_extent_buf);
+
+  if (!hit_bl.length()) {
+    ldout(m_image_ctx.cct, 5) << "didn't hit RAM" << dendl;
+    auto read_extent = read_ctx->read_extents.back();
+    write_entry->inc_bl_refs();
+    log_entries_to_read.push_back(std::move(write_entry));
+    bls_to_read.push_back(&read_extent->m_bl);
+  }
 }
 
 template <typename I>
 void WriteLog<I>::complete_read(
-    std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+    std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
     std::vector<bufferlist*> &bls_to_read,
     Context *ctx) {
   if (!log_entries_to_read.empty()) {
-    aio_read_data_block(log_entries_to_read, bls_to_read, ctx);
+    aio_read_data_blocks(log_entries_to_read, bls_to_read, ctx);
   } else {
     ctx->complete(0);
   }
 }
 
 template <typename I>
-void WriteLog<I>::initialize_pool(Context *on_finish,
+int WriteLog<I>::create_and_open_bdev() {
+  CephContext *cct = m_image_ctx.cct;
+
+  bdev = BlockDevice::create(cct, this->m_log_pool_name, aio_cache_cb,
+                             nullptr, nullptr, nullptr);
+  int r = bdev->open(this->m_log_pool_name);
+  if (r < 0) {
+    lderr(cct) << "failed to open bdev" << dendl;
+    delete bdev;
+    return r;
+  }
+
+  ceph_assert(this->m_log_pool_size % MIN_WRITE_ALLOC_SSD_SIZE == 0);
+  if (bdev->get_size() != this->m_log_pool_size) {
+    lderr(cct) << "size mismatch: bdev size " << bdev->get_size()
+               << " (block size " << bdev->get_block_size()
+               << ") != pool size " << this->m_log_pool_size << dendl;
+    bdev->close();
+    delete bdev;
+    return -EINVAL;
+  }
+
+  return 0;
+}
+
+template <typename I>
+bool WriteLog<I>::initialize_pool(Context *on_finish,
                                   pwl::DeferredContexts &later) {
+  int r;
   CephContext *cct = m_image_ctx.cct;
+
   ceph_assert(ceph_mutex_is_locked_by_me(m_lock));
   if (access(this->m_log_pool_name.c_str(), F_OK) != 0) {
     int fd = ::open(this->m_log_pool_name.c_str(), O_RDWR|O_CREAT, 0644);
     bool succeed = true;
     if (fd >= 0) {
       if (truncate(this->m_log_pool_name.c_str(),
-                   this->m_log_pool_config_size) != 0) {
+                   this->m_log_pool_size) != 0) {
         succeed = false;
       }
       ::close(fd);
@@ -117,81 +153,106 @@ void WriteLog<I>::initialize_pool(Context *on_finish,
       m_cache_state->empty = true;
       /* TODO: filter/replace errnos that are meaningless to the caller */
       on_finish->complete(-errno);
-      return;
+      return false;
     }
 
-    bdev = BlockDevice::create(cct, this->m_log_pool_name, aio_cache_cb,
-                               nullptr, nullptr, nullptr);
-    int r = bdev->open(this->m_log_pool_name);
+    r = create_and_open_bdev();
     if (r < 0) {
-      delete bdev;
-      on_finish->complete(-1);
-      return;
+      on_finish->complete(r);
+      return false;
     }
     m_cache_state->present = true;
     m_cache_state->clean = true;
     m_cache_state->empty = true;
     /* new pool, calculate and store metadata */
-    size_t small_write_size = MIN_WRITE_ALLOC_SSD_SIZE + sizeof(struct WriteLogCacheEntry);
 
-    uint64_t num_small_writes = (uint64_t)(this->m_log_pool_config_size / small_write_size);
-    if (num_small_writes > MAX_LOG_ENTRIES) {
-      num_small_writes = MAX_LOG_ENTRIES;
-    }
-    assert(num_small_writes > 2);
-    m_log_pool_ring_buffer_size = this->m_log_pool_config_size - DATA_RING_BUFFER_OFFSET;
+    /* Keep ring buffer at least MIN_WRITE_ALLOC_SSD_SIZE bytes free.
+     * In this way, when all ring buffer spaces are allocated,
+     * m_first_free_entry and m_first_valid_entry will not be equal.
+     * Equal only means the cache is empty. */
+    this->m_bytes_allocated_cap = this->m_log_pool_size -
+        DATA_RING_BUFFER_OFFSET - MIN_WRITE_ALLOC_SSD_SIZE;
     /* Log ring empty */
     m_first_free_entry = DATA_RING_BUFFER_OFFSET;
     m_first_valid_entry = DATA_RING_BUFFER_OFFSET;
 
-    pool_size = this->m_log_pool_config_size;
     auto new_root = std::make_shared<WriteLogPoolRoot>(pool_root);
-    new_root->pool_size = this->m_log_pool_config_size;
+    new_root->layout_version = SSD_LAYOUT_VERSION;
+    new_root->pool_size = this->m_log_pool_size;
     new_root->flushed_sync_gen = this->m_flushed_sync_gen;
     new_root->block_size = MIN_WRITE_ALLOC_SSD_SIZE;
     new_root->first_free_entry = m_first_free_entry;
     new_root->first_valid_entry = m_first_valid_entry;
-    new_root->num_log_entries = num_small_writes;
+    new_root->num_log_entries = 0;
     pool_root = *new_root;
 
     r = update_pool_root_sync(new_root);
     if (r != 0) {
-      this->m_total_log_entries = 0;
-      this->m_free_log_entries = 0;
-      lderr(m_image_ctx.cct) << "failed to initialize pool ("
-                             << this->m_log_pool_name << ")" << dendl;
+      lderr(cct) << "failed to initialize pool ("
+                 << this->m_log_pool_name << ")" << dendl;
+      bdev->close();
+      delete bdev;
       on_finish->complete(r);
+      return false;
     }
-    this->m_total_log_entries = new_root->num_log_entries;
-    this->m_free_log_entries = new_root->num_log_entries - 1;
-   } else {
-     m_cache_state->present = true;
-     bdev = BlockDevice::create(
-         cct, this->m_log_pool_name, aio_cache_cb,
-         static_cast<void*>(this), nullptr, static_cast<void*>(this));
-     int r = bdev->open(this->m_log_pool_name);
-     if (r < 0) {
-       delete bdev;
-       on_finish->complete(r);
-       return;
-     }
-     load_existing_entries(later);
-     if (m_first_free_entry < m_first_valid_entry) {
-      /* Valid entries wrap around the end of the ring, so first_free is lower
-       * than first_valid.  If first_valid was == first_free+1, the entry at
-       * first_free would be empty. The last entry is never used, so in
-       * that case there would be zero free log entries. */
-       this->m_free_log_entries = this->m_total_log_entries -
-         (m_first_valid_entry - m_first_free_entry) - 1;
-     } else {
-      /* first_valid is <= first_free. If they are == we have zero valid log
-       * entries, and n-1 free log entries */
-       this->m_free_log_entries = this->m_total_log_entries -
-         (m_first_free_entry - m_first_valid_entry) - 1;
-     }
-     m_cache_state->clean = this->m_dirty_log_entries.empty();
-     m_cache_state->empty = m_log_entries.empty();
+  } else {
+    m_cache_state->present = true;
+    r = create_and_open_bdev();
+    if (r < 0) {
+      on_finish->complete(r);
+      return false;
+    }
+
+    bufferlist bl;
+    SuperBlock superblock;
+    ::IOContext ioctx(cct, nullptr);
+    r = bdev->read(0, MIN_WRITE_ALLOC_SSD_SIZE, &bl, &ioctx, false);
+    if (r < 0) {
+      lderr(cct) << "Read ssd cache superblock failed " << dendl;
+      goto error_handle;
+    }
+    auto p = bl.cbegin();
+    decode(superblock, p);
+    pool_root = superblock.root;
+    ldout(cct, 1) << "Decoded root: pool_size=" << pool_root.pool_size
+                  << " first_valid_entry=" << pool_root.first_valid_entry
+                  << " first_free_entry=" << pool_root.first_free_entry
+                  << " flushed_sync_gen=" << pool_root.flushed_sync_gen
+                  << dendl;
+    ceph_assert(is_valid_pool_root(pool_root));
+    if (pool_root.layout_version != SSD_LAYOUT_VERSION) {
+      lderr(cct) << "Pool layout version is "
+                 << pool_root.layout_version
+                 << " expected " << SSD_LAYOUT_VERSION
+                 << dendl;
+      goto error_handle;
+    }
+    if (pool_root.block_size != MIN_WRITE_ALLOC_SSD_SIZE) {
+      lderr(cct) << "Pool block size is " << pool_root.block_size
+                 << " expected " << MIN_WRITE_ALLOC_SSD_SIZE
+                 << dendl;
+      goto error_handle;
+    }
+
+    this->m_log_pool_size = pool_root.pool_size;
+    this->m_flushed_sync_gen = pool_root.flushed_sync_gen;
+    this->m_first_valid_entry = pool_root.first_valid_entry;
+    this->m_first_free_entry = pool_root.first_free_entry;
+    this->m_bytes_allocated_cap = this->m_log_pool_size -
+                                  DATA_RING_BUFFER_OFFSET -
+                                  MIN_WRITE_ALLOC_SSD_SIZE;
+
+    load_existing_entries(later);
+    m_cache_state->clean = this->m_dirty_log_entries.empty();
+    m_cache_state->empty = m_log_entries.empty();
   }
+  return true;
+
+error_handle:
+  bdev->close();
+  delete bdev;
+  on_finish->complete(-EINVAL);
+  return false;
 }
 
 template <typename I>
@@ -221,36 +282,15 @@ void WriteLog<I>::remove_pool_file() {
 
 template <typename I>
 void WriteLog<I>::load_existing_entries(pwl::DeferredContexts &later) {
-  bufferlist bl;
   CephContext *cct = m_image_ctx.cct;
-  ::IOContext ioctx(cct, nullptr);
-  bdev->read(0, MIN_WRITE_ALLOC_SSD_SIZE, &bl, &ioctx, false);
-  SuperBlock superblock;
-
-  auto p = bl.cbegin();
-  decode(superblock, p);
-  ldout(cct,5) << "Decoded superblock" << dendl;
-
-  WriteLogPoolRoot current_pool_root = superblock.root;
-  uint64_t next_log_pos = pool_root.first_valid_entry;
-  uint64_t first_free_entry =  pool_root.first_free_entry;
-  uint64_t curr_log_pos;
-
-  pool_root = current_pool_root;
-  m_first_free_entry = first_free_entry;
-  m_first_valid_entry = next_log_pos;
-  this->m_total_log_entries = current_pool_root.num_log_entries;
-  this->m_flushed_sync_gen = current_pool_root.flushed_sync_gen;
-  this->m_log_pool_actual_size = current_pool_root.pool_size;
-
   std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> sync_point_entries;
-
   std::map<uint64_t, bool> missing_sync_points;
 
   // Iterate through the log_entries and append all the write_bytes
   // of each entry to fetch the pos of next 4k of log_entries. Iterate
   // through the log entries and append them to the in-memory vector
-  while (next_log_pos != first_free_entry) {
+  for (uint64_t next_log_pos = this->m_first_valid_entry;
+       next_log_pos != this->m_first_free_entry; ) {
     // read the entries from SSD cache and decode
     bufferlist bl_entries;
     ::IOContext ioctx_entry(cct, nullptr);
@@ -260,7 +300,7 @@ void WriteLog<I>::load_existing_entries(pwl::DeferredContexts &later) {
     auto pl = bl_entries.cbegin();
     decode(ssd_log_entries, pl);
     ldout(cct, 5) << "decoded ssd log entries" << dendl;
-    curr_log_pos = next_log_pos;
+    uint64_t curr_log_pos = next_log_pos;
     std::shared_ptr<GenericLogEntry> log_entry = nullptr;
 
     for (auto it = ssd_log_entries.begin(); it != ssd_log_entries.end(); ++it) {
@@ -274,12 +314,26 @@ void WriteLog<I>::load_existing_entries(pwl::DeferredContexts &later) {
     }
     // along with the write_bytes, add control block size too
     next_log_pos += MIN_WRITE_ALLOC_SSD_SIZE;
-    if (next_log_pos >= this->m_log_pool_actual_size) {
-      next_log_pos = next_log_pos % this->m_log_pool_actual_size + DATA_RING_BUFFER_OFFSET;
+    if (next_log_pos >= this->m_log_pool_size) {
+      next_log_pos = next_log_pos % this->m_log_pool_size + DATA_RING_BUFFER_OFFSET;
     }
- }
-  this->update_sync_points(missing_sync_points, sync_point_entries, later,
-                           MIN_WRITE_ALLOC_SSD_SIZE);
+  }
+  this->update_sync_points(missing_sync_points, sync_point_entries, later);
+  if (m_first_valid_entry > m_first_free_entry) {
+    m_bytes_allocated = this->m_log_pool_size - m_first_valid_entry +
+                         m_first_free_entry - DATA_RING_BUFFER_OFFSET;
+  } else {
+    m_bytes_allocated = m_first_free_entry - m_first_valid_entry;
+  }
+}
+
+// For SSD we don't calc m_bytes_allocated in this
+template <typename I>
+void WriteLog<I>::inc_allocated_cached_bytes(
+    std::shared_ptr<pwl::GenericLogEntry> log_entry) {
+  if (log_entry->is_write_entry()) {
+    this->m_bytes_cached += log_entry->write_bytes();
+  }
 }
 
 template <typename I>
@@ -297,13 +351,17 @@ bool WriteLog<I>::alloc_resources(C_BlockIORequestT *req) {
                               &num_lanes, &num_log_entries,
                               &num_unpublished_reserves);
 
-  bytes_allocated += num_log_entries * MIN_WRITE_ALLOC_SSD_SIZE;
+  ceph_assert(!num_lanes);
+  if (num_log_entries) {
+    bytes_allocated += num_log_entries * MIN_WRITE_ALLOC_SSD_SIZE;
+    num_log_entries = 0;
+  }
+  ceph_assert(!num_unpublished_reserves);
 
   alloc_succeeds = this->check_allocation(req, bytes_cached, bytes_dirtied,
                                           bytes_allocated, num_lanes,
                                           num_log_entries,
-                                          num_unpublished_reserves,
-                                          m_log_pool_ring_buffer_size);
+                                          num_unpublished_reserves);
   req->set_allocated(alloc_succeeds);
   return alloc_succeeds;
 }
@@ -334,7 +392,7 @@ void WriteLog<I>::enlist_op_appender() {
  * all prior log entries are persisted everywhere.
  */
 template<typename I>
-void WriteLog<I>::schedule_append_ops(GenericLogOperations &ops) {
+void WriteLog<I>::schedule_append_ops(GenericLogOperations &ops, C_BlockIORequestT *req) {
   bool need_finisher = false;
   GenericLogOperationsVector appending;
 
@@ -352,6 +410,17 @@ void WriteLog<I>::schedule_append_ops(GenericLogOperations &ops) {
       need_finisher = has_sync_point_logs(ops);
     }
     this->m_ops_to_append.splice(this->m_ops_to_append.end(), ops);
+
+    // To preserve the order of overlapping IOs, release_cell() may be
+    // called only after the ops are added to m_ops_to_append.
+    // As soon as m_lock is released, the appended ops can be picked up
+    // by append_scheduled_ops() in another thread and req can be freed.
+    if (req != nullptr) {
+      if (persist_on_flush) {
+        req->complete_user_request(0);
+      }
+      req->release_cell();
+    }
   }
 
   if (need_finisher) {
@@ -367,11 +436,7 @@ template <typename I>
 void WriteLog<I>::setup_schedule_append(pwl::GenericLogOperationsVector &ops,
                                         bool do_early_flush,
                                         C_BlockIORequestT *req) {
-  this->schedule_append(ops);
-  if (this->get_persist_on_flush()) {
-    req->complete_user_request(0);
-  }
-  req->release_cell();
+  this->schedule_append(ops, req);
 }
 
 template <typename I>
@@ -404,8 +469,6 @@ void WriteLog<I>::append_op_log_entries(GenericLogOperations &ops) {
   Context *ctx = new LambdaContext([this, ops](int r) {
     assert(r == 0);
     ldout(m_image_ctx.cct, 20) << "Finished root update " << dendl;
-    this->m_async_update_superblock--;
-    this->m_async_op_tracker.finish_op();
 
     auto captured_ops = std::move(ops);
     this->complete_op_log_entries(std::move(captured_ops), r);
@@ -425,6 +488,8 @@ void WriteLog<I>::append_op_log_entries(GenericLogOperations &ops) {
     if (need_finisher) {
       this->enlist_op_appender();
     }
+    this->m_async_update_superblock--;
+    this->m_async_op_tracker.finish_op();
   });
   uint64_t *new_first_free_entry = new(uint64_t);
   Context *append_ctx = new LambdaContext(
@@ -437,8 +502,6 @@ void WriteLog<I>::append_op_log_entries(GenericLogOperations &ops) {
         for (auto &operation : ops) {
           operation->log_append_comp_time = now;
         }
-        this->m_async_append_ops--;
-        this->m_async_op_tracker.finish_op();
 
         std::lock_guard locker(this->m_log_append_lock);
         std::lock_guard locker1(m_lock);
@@ -450,16 +513,11 @@ void WriteLog<I>::append_op_log_entries(GenericLogOperations &ops) {
         delete new_first_free_entry;
         schedule_update_root(new_root, ctx);
       }
-  });
+      this->m_async_append_ops--;
+      this->m_async_op_tracker.finish_op();
+    });
   // Append logs and update first_free_update
-  uint64_t bytes_allocated_updated;
-  append_ops(ops, append_ctx, new_first_free_entry, bytes_allocated_updated);
-
-  {
-    std::lock_guard locker1(m_lock);
-    m_first_free_entry = *new_first_free_entry;
-    m_bytes_allocated -= bytes_allocated_updated;
-  }
+  append_ops(ops, append_ctx, new_first_free_entry);
 
   if (ops.size()) {
     this->dispatch_deferred_writes();
@@ -484,47 +542,90 @@ void WriteLog<I>::alloc_op_log_entries(GenericLogOperations &ops) {
 }
 
 template <typename I>
-Context* WriteLog<I>::construct_flush_entry_ctx(
-    std::shared_ptr<GenericLogEntry> log_entry) {
+void WriteLog<I>::construct_flush_entries(pwl::GenericLogEntries entries_to_flush,
+                                         DeferredContexts &post_unlock,
+                                         bool has_write_entry) {
   // snapshot so we behave consistently
   bool invalidating = this->m_invalidating;
 
-  Context *ctx = this->construct_flush_entry(log_entry, invalidating);
-
-  if (invalidating) {
-    return ctx;
-  }
-  if(log_entry->is_write_entry()) {
-      bufferlist *read_bl_ptr = new bufferlist;
-      ctx = new LambdaContext(
-          [this, log_entry, read_bl_ptr, ctx](int r) {
-            bufferlist captured_entry_bl;
-            captured_entry_bl.claim_append(*read_bl_ptr);
-            free(read_bl_ptr);
-            m_image_ctx.op_work_queue->queue(new LambdaContext(
-              [this, log_entry, entry_bl=move(captured_entry_bl), ctx](int r) {
-               auto captured_entry_bl = std::move(entry_bl);
-               ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
-                                          << " " << *log_entry << dendl;
-               log_entry->writeback_bl(this->m_image_writeback, ctx,
-                                       std::move(captured_entry_bl));
-              }), 0);
-      });
-      ctx = new LambdaContext(
-        [this, log_entry, read_bl_ptr, ctx](int r) {
-          aio_read_data_block(&log_entry->ram_entry, read_bl_ptr, ctx);
-      });
-    return ctx;
+  if (invalidating || !has_write_entry) {
+    for (auto &log_entry : entries_to_flush) {
+      Context *ctx = this->construct_flush_entry(log_entry, invalidating);
+
+      if (!invalidating) {
+        ctx = new LambdaContext(
+        [this, log_entry, ctx](int r) {
+          m_image_ctx.op_work_queue->queue(new LambdaContext(
+           [this, log_entry, ctx](int r) {
+             ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
+                                         << " " << *log_entry << dendl;
+             log_entry->writeback(this->m_image_writeback, ctx);
+             this->m_flush_ops_will_send -= 1;
+           }), 0);
+       });
+      }
+      post_unlock.add(ctx);
+    }
   } else {
-    return new LambdaContext(
-      [this, log_entry, ctx](int r) {
-        m_image_ctx.op_work_queue->queue(new LambdaContext(
-          [this, log_entry, ctx](int r) {
-            ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
-                                       << " " << *log_entry << dendl;
-            log_entry->writeback(this->m_image_writeback, ctx);
-          }), 0);
+    int count = entries_to_flush.size();
+    std::vector<std::shared_ptr<GenericWriteLogEntry>> log_entries;
+    std::vector<bufferlist *> read_bls;
+    std::vector<Context *> contexts;
+
+    log_entries.reserve(count);
+    read_bls.reserve(count);
+    contexts.reserve(count);
+
+    for (auto &log_entry : entries_to_flush) {
+      // log_entry already removed from m_dirty_log_entries and
+      // in construct_flush_entry() it will inc(m_flush_ops_in_flight).
+      // We call this func here to make ops can track.
+      Context *ctx = this->construct_flush_entry(log_entry, invalidating);
+      if (log_entry->is_write_entry()) {
+       bufferlist *bl = new bufferlist;
+       auto write_entry = static_pointer_cast<WriteLogEntry>(log_entry);
+       write_entry->inc_bl_refs();
+       log_entries.push_back(write_entry);
+       read_bls.push_back(bl);
+      }
+      contexts.push_back(ctx);
+    }
+
+    Context *ctx = new LambdaContext(
+      [this, entries_to_flush, read_bls, contexts](int r) {
+        int i = 0, j = 0;
+
+       for (auto &log_entry : entries_to_flush) {
+          Context *ctx = contexts[j++];
+
+         if (log_entry->is_write_entry()) {
+           bufferlist captured_entry_bl;
+
+           captured_entry_bl.claim_append(*read_bls[i]);
+           delete read_bls[i++];
+
+           m_image_ctx.op_work_queue->queue(new LambdaContext(
+             [this, log_entry, entry_bl=std::move(captured_entry_bl), ctx](int r) {
+               auto captured_entry_bl = std::move(entry_bl);
+               ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
+                                          << " " << *log_entry << dendl;
+               log_entry->writeback_bl(this->m_image_writeback, ctx,
+                                       std::move(captured_entry_bl));
+               this->m_flush_ops_will_send -= 1;
+             }), 0);
+         } else {
+             m_image_ctx.op_work_queue->queue(new LambdaContext(
+               [this, log_entry, ctx](int r) {
+                 ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
+                                             << " " << *log_entry << dendl;
+                 log_entry->writeback(this->m_image_writeback, ctx);
+                 this->m_flush_ops_will_send -= 1;
+               }), 0);
+         }
+       }
       });
+
+    aio_read_data_blocks(log_entries, read_bls, ctx);
   }
 }
 
@@ -533,10 +634,9 @@ void WriteLog<I>::process_work() {
   CephContext *cct = m_image_ctx.cct;
   int max_iterations = 4;
   bool wake_up_requested = false;
-  uint64_t aggressive_high_water_bytes = m_log_pool_ring_buffer_size * AGGRESSIVE_RETIRE_HIGH_WATER;
-  uint64_t aggressive_high_water_entries = this->m_total_log_entries * AGGRESSIVE_RETIRE_HIGH_WATER;
-  uint64_t high_water_bytes = m_log_pool_ring_buffer_size * RETIRE_HIGH_WATER;
-  uint64_t high_water_entries = this->m_total_log_entries * RETIRE_HIGH_WATER;
+  uint64_t aggressive_high_water_bytes =
+      this->m_bytes_allocated_cap * AGGRESSIVE_RETIRE_HIGH_WATER;
+  uint64_t high_water_bytes = this->m_bytes_allocated_cap * RETIRE_HIGH_WATER;
 
   ldout(cct, 20) << dendl;
 
@@ -546,17 +646,13 @@ void WriteLog<I>::process_work() {
       this->m_wake_up_requested = false;
     }
     if (this->m_alloc_failed_since_retire || (this->m_shutting_down) ||
-        this->m_invalidating || m_bytes_allocated > high_water_bytes ||
-        (m_log_entries.size() > high_water_entries)) {
+        this->m_invalidating || m_bytes_allocated > high_water_bytes) {
       ldout(m_image_ctx.cct, 10) << "alloc_fail=" << this->m_alloc_failed_since_retire
                                  << ", allocated > high_water="
                                  << (m_bytes_allocated > high_water_bytes)
-                                 << ", allocated_entries > high_water="
-                                 << (m_log_entries.size() > high_water_entries)
                                  << dendl;
       retire_entries((this->m_shutting_down || this->m_invalidating ||
-                    (m_bytes_allocated > aggressive_high_water_bytes) ||
-                    (m_log_entries.size() > aggressive_high_water_entries))
+                      m_bytes_allocated > aggressive_high_water_bytes)
                     ? MAX_ALLOC_PER_TRANSACTION : MAX_FREE_PER_TRANSACTION);
     }
     this->dispatch_deferred_writes();
@@ -587,8 +683,8 @@ template <typename I>
 bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
   CephContext *cct = m_image_ctx.cct;
   GenericLogEntriesVector retiring_entries;
-  uint32_t initial_first_valid_entry;
-  uint32_t first_valid_entry;
+  uint64_t initial_first_valid_entry;
+  uint64_t first_valid_entry;
 
   std::lock_guard retire_locker(this->m_log_retire_lock);
   ldout(cct, 20) << "Look for entries to retire" << dendl;
@@ -600,8 +696,7 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
     first_valid_entry = m_first_valid_entry;
     while (retiring_entries.size() < frees_per_tx && !m_log_entries.empty()) {
       GenericLogEntriesVector retiring_subentries;
-      auto entry = m_log_entries.front();
-      uint64_t control_block_pos = entry->log_entry_index;
+      uint64_t control_block_pos = m_log_entries.front()->log_entry_index;
       uint64_t data_length = 0;
       for (auto it = m_log_entries.begin(); it != m_log_entries.end(); ++it) {
         if (this->can_retire_entry(*it)) {
@@ -614,8 +709,8 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
             ldout(cct, 20) << "The log entry is " << *(*it) << dendl;
             if ((*it)->log_entry_index < control_block_pos) {
               ceph_assert((*it)->log_entry_index ==
-                (control_block_pos + data_length + MIN_WRITE_ALLOC_SSD_SIZE)
-                % this->m_log_pool_config_size + DATA_RING_BUFFER_OFFSET);
+                  (control_block_pos + data_length + MIN_WRITE_ALLOC_SSD_SIZE) %
+                  this->m_log_pool_size + DATA_RING_BUFFER_OFFSET);
             } else {
               ceph_assert((*it)->log_entry_index == control_block_pos +
                   data_length + MIN_WRITE_ALLOC_SSD_SIZE);
@@ -638,22 +733,36 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
             it != retiring_subentries.end(); it++) {
           ceph_assert(m_log_entries.front() == *it);
           m_log_entries.pop_front();
-          if (entry->is_write_entry()) {
-            auto write_entry = static_pointer_cast<WriteLogEntry>(entry);
-            this->m_blocks_to_log_entries.remove_log_entry(write_entry);
+          if ((*it)->write_bytes() > 0 || (*it)->bytes_dirty() > 0) {
+            auto gen_write_entry = static_pointer_cast<GenericWriteLogEntry>(*it);
+            if (gen_write_entry) {
+                this->m_blocks_to_log_entries.remove_log_entry(gen_write_entry);
+            }
           }
         }
+
+        ldout(cct, 20) << "span with " << retiring_subentries.size()
+                       << " entries: control_block_pos=" << control_block_pos
+                       << " data_length=" << data_length
+                       << dendl;
         retiring_entries.insert(
             retiring_entries.end(), retiring_subentries.begin(),
             retiring_subentries.end());
+
+        first_valid_entry = control_block_pos + data_length +
+            MIN_WRITE_ALLOC_SSD_SIZE;
+        if (first_valid_entry >= this->m_log_pool_size) {
+          first_valid_entry = first_valid_entry % this->m_log_pool_size +
+              DATA_RING_BUFFER_OFFSET;
+        }
       } else {
         break;
       }
     }
   }
   if (retiring_entries.size()) {
-    ldout(cct, 1) << "Retiring " << retiring_entries.size()
-                  << " entries" << dendl;
+    ldout(cct, 20) << "Retiring " << retiring_entries.size() << " entries"
+                   << dendl;
 
     // Advance first valid entry and release buffers
     uint64_t flushed_sync_gen;
@@ -663,18 +772,6 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
       flushed_sync_gen = this->m_flushed_sync_gen;
     }
 
-    //calculate new first_valid_entry based on last entry to retire
-    auto entry = retiring_entries.back();
-    if (entry->is_write_entry() || entry->is_writesame_entry()) {
-      first_valid_entry = entry->ram_entry.write_data_pos +
-        entry->get_aligned_data_size();
-    } else {
-      first_valid_entry = entry->log_entry_index + MIN_WRITE_ALLOC_SSD_SIZE;
-    }
-    if (first_valid_entry >= this->m_log_pool_config_size) {
-        first_valid_entry = first_valid_entry % this->m_log_pool_config_size +
-          DATA_RING_BUFFER_OFFSET;
-    }
     ceph_assert(first_valid_entry != initial_first_valid_entry);
     auto new_root = std::make_shared<WriteLogPoolRoot>(pool_root);
     new_root->flushed_sync_gen = flushed_sync_gen;
@@ -683,53 +780,54 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
     pool_root.first_valid_entry = first_valid_entry;
 
     Context *ctx = new LambdaContext(
-          [this, flushed_sync_gen, first_valid_entry,
-          initial_first_valid_entry, retiring_entries](int r) {
-          uint64_t allocated_bytes = 0;
-          uint64_t cached_bytes = 0;
-          uint64_t former_log_pos = 0;
-          for (auto &entry : retiring_entries) {
-            ceph_assert(entry->log_entry_index != 0);
-            if (entry->log_entry_index != former_log_pos ) {
-              // Space for control blocks
-              allocated_bytes  += MIN_WRITE_ALLOC_SSD_SIZE;
-              former_log_pos = entry->log_entry_index;
-            }
-            if (entry->is_write_entry()) {
-              cached_bytes += entry->write_bytes();
-              //space for userdata
-              allocated_bytes += entry->get_aligned_data_size();
-            }
+      [this, first_valid_entry, initial_first_valid_entry,
+       retiring_entries](int r) {
+        uint64_t allocated_bytes = 0;
+        uint64_t cached_bytes = 0;
+        uint64_t former_log_pos = 0;
+        for (auto &entry : retiring_entries) {
+          ceph_assert(entry->log_entry_index != 0);
+          if (entry->log_entry_index != former_log_pos ) {
+            // Space for control blocks
+            allocated_bytes += MIN_WRITE_ALLOC_SSD_SIZE;
+            former_log_pos = entry->log_entry_index;
           }
-          {
-            std::lock_guard locker(m_lock);
-            m_first_valid_entry = first_valid_entry;
-            ceph_assert(m_first_valid_entry % MIN_WRITE_ALLOC_SSD_SIZE == 0);
-            this->m_free_log_entries += retiring_entries.size();
-            ceph_assert(this->m_bytes_cached >= cached_bytes);
-            this->m_bytes_cached -= cached_bytes;
-
-            ldout(m_image_ctx.cct, 20)
-              << "Finished root update: " << "initial_first_valid_entry="
-              << initial_first_valid_entry << ", " << "m_first_valid_entry="
-              << m_first_valid_entry << "," << "release space = "
-              << allocated_bytes << "," << "m_bytes_allocated="
-              << m_bytes_allocated << "," << "release cached space="
-              << allocated_bytes << "," << "m_bytes_cached="
-              << this->m_bytes_cached << dendl;
-
-            this->m_alloc_failed_since_retire = false;
-            this->wake_up();
-            m_async_update_superblock--;
-            this->m_async_op_tracker.finish_op();
+          if (entry->is_write_entry()) {
+            cached_bytes += entry->write_bytes();
+            // space for userdata
+            allocated_bytes += entry->get_aligned_data_size();
           }
+        }
+        {
+          std::lock_guard locker(m_lock);
+          m_first_valid_entry = first_valid_entry;
+          ceph_assert(m_first_valid_entry % MIN_WRITE_ALLOC_SSD_SIZE == 0);
+          ceph_assert(this->m_bytes_allocated >= allocated_bytes);
+          this->m_bytes_allocated -= allocated_bytes;
+          ceph_assert(this->m_bytes_cached >= cached_bytes);
+          this->m_bytes_cached -= cached_bytes;
+
+          ldout(m_image_ctx.cct, 20)
+            << "Finished root update: " << "initial_first_valid_entry="
+            << initial_first_valid_entry << ", " << "m_first_valid_entry="
+            << m_first_valid_entry << "," << "release space = "
+            << allocated_bytes << "," << "m_bytes_allocated="
+            << m_bytes_allocated << "," << "release cached space="
+            << cached_bytes << "," << "m_bytes_cached="
+            << this->m_bytes_cached << dendl;
+
+          this->m_alloc_failed_since_retire = false;
+          this->wake_up();
+        }
 
-          this->dispatch_deferred_writes();
-          this->process_writeback_dirty_entries();
-        });
+        this->dispatch_deferred_writes();
+        this->process_writeback_dirty_entries();
+        m_async_update_superblock--;
+        this->m_async_op_tracker.finish_op();
+      });
 
-      std::lock_guard locker(m_lock);
-      schedule_update_root(new_root, ctx);
+    std::lock_guard locker(m_lock);
+    schedule_update_root(new_root, ctx);
   } else {
     ldout(cct, 20) << "Nothing to retire" << dendl;
     return false;
@@ -739,27 +837,27 @@ bool WriteLog<I>::retire_entries(const unsigned long int frees_per_tx) {
 
 template <typename I>
 void WriteLog<I>::append_ops(GenericLogOperations &ops, Context *ctx,
-                             uint64_t* new_first_free_entry,
-                             uint64_t &bytes_allocated) {
+                             uint64_t* new_first_free_entry) {
   GenericLogEntriesVector log_entries;
   CephContext *cct = m_image_ctx.cct;
   uint64_t span_payload_len = 0;
-  bytes_allocated = 0;
+  uint64_t bytes_to_free = 0;
   ldout(cct, 20) << "Appending " << ops.size() << " log entries." << dendl;
 
+  *new_first_free_entry = pool_root.first_free_entry;
   AioTransContext* aio = new AioTransContext(cct, ctx);
 
   utime_t now = ceph_clock_now();
   for (auto &operation : ops) {
-    operation->log_append_time = now;
+    operation->log_append_start_time = now;
     auto log_entry = operation->get_log_entry();
 
     if (log_entries.size() == CONTROL_BLOCK_MAX_LOG_ENTRIES ||
         span_payload_len >= SPAN_MAX_DATA_LEN) {
       if (log_entries.size() > 1) {
-        bytes_allocated += (log_entries.size() - 1) * MIN_WRITE_ALLOC_SSD_SIZE;
+        bytes_to_free += (log_entries.size() - 1) * MIN_WRITE_ALLOC_SSD_SIZE;
       }
-      write_log_entries(log_entries, aio);
+      write_log_entries(log_entries, aio, new_first_free_entry);
       log_entries.clear();
       span_payload_len = 0;
     }
@@ -768,32 +866,41 @@ void WriteLog<I>::append_ops(GenericLogOperations &ops, Context *ctx,
   }
   if (!span_payload_len || !log_entries.empty()) {
     if (log_entries.size() > 1) {
-      bytes_allocated += (log_entries.size() - 1) * MIN_WRITE_ALLOC_SSD_SIZE;
+      bytes_to_free += (log_entries.size() - 1) * MIN_WRITE_ALLOC_SSD_SIZE;
     }
-    write_log_entries(log_entries, aio);
+    write_log_entries(log_entries, aio, new_first_free_entry);
   }
+
+  {
+    std::lock_guard locker1(m_lock);
+    m_first_free_entry = *new_first_free_entry;
+    m_bytes_allocated -= bytes_to_free;
+  }
+
   bdev->aio_submit(&aio->ioc);
-  *new_first_free_entry = pool_root.first_free_entry;
 }
 
 template <typename I>
 void WriteLog<I>::write_log_entries(GenericLogEntriesVector log_entries,
-                                    AioTransContext *aio) {
+                                    AioTransContext *aio, uint64_t *pos) {
   CephContext *cct = m_image_ctx.cct;
-  ldout(m_image_ctx.cct, 20) << dendl;
-  bufferlist data_bl;
+  ldout(m_image_ctx.cct, 20) << "pos=" << *pos << dendl;
+  ceph_assert(*pos >= DATA_RING_BUFFER_OFFSET &&
+              *pos < this->m_log_pool_size &&
+              *pos % MIN_WRITE_ALLOC_SSD_SIZE == 0);
+
   // The first block is for log entries
-  uint64_t data_pos = pool_root.first_free_entry + MIN_WRITE_ALLOC_SSD_SIZE;
-  ldout(m_image_ctx.cct, 20) << "data_pos: " << data_pos << dendl;
-  if (data_pos == pool_root.pool_size ) {
-    data_pos = data_pos % pool_root.pool_size + DATA_RING_BUFFER_OFFSET;
+  uint64_t control_block_pos = *pos;
+  *pos += MIN_WRITE_ALLOC_SSD_SIZE;
+  if (*pos == this->m_log_pool_size) {
+    *pos = DATA_RING_BUFFER_OFFSET;
   }
 
   std::vector<WriteLogCacheEntry> persist_log_entries;
+  bufferlist data_bl;
   for (auto &log_entry : log_entries) {
-    log_entry->log_entry_index = pool_root.first_free_entry;
+    log_entry->log_entry_index = control_block_pos;
     // Append data buffer for write operations
-    persist_log_entries.push_back(log_entry->ram_entry);
     if (log_entry->is_write_entry()) {
       auto write_entry = static_pointer_cast<WriteLogEntry>(log_entry);
       auto cache_bl = write_entry->get_cache_bl();
@@ -801,12 +908,14 @@ void WriteLog<I>::write_log_entries(GenericLogEntriesVector log_entries,
       data_bl.append(cache_bl);
       data_bl.append_zero(align_size - cache_bl.length());
 
-      write_entry->ram_entry.write_data_pos = data_pos;
-      data_pos += align_size;
-      if (data_pos >= pool_root.pool_size) {
-        data_pos = data_pos % pool_root.pool_size + DATA_RING_BUFFER_OFFSET;
+      write_entry->ram_entry.write_data_pos = *pos;
+      *pos += align_size;
+      if (*pos >= this->m_log_pool_size) {
+        *pos = *pos % this->m_log_pool_size + DATA_RING_BUFFER_OFFSET;
       }
     }
+    // push_back _after_ setting write_data_pos
+    persist_log_entries.push_back(log_entry->ram_entry);
   }
 
   //aio write
@@ -816,38 +925,41 @@ void WriteLog<I>::write_log_entries(GenericLogEntriesVector log_entries,
   bl.append_zero(MIN_WRITE_ALLOC_SSD_SIZE - bl.length());
   bl.append(data_bl);
   ceph_assert(bl.length() % MIN_WRITE_ALLOC_SSD_SIZE == 0);
-  if (pool_root.first_free_entry + bl.length() > pool_root.pool_size) {
+  if (control_block_pos + bl.length() > this->m_log_pool_size) {
     //exceeds border, need to split
     uint64_t size = bl.length();
-    auto end = pool_root.pool_size - pool_root.first_free_entry;
     bufferlist bl1;
-    bl.splice(0, end, &bl1);
+    bl.splice(0, this->m_log_pool_size - control_block_pos, &bl1);
     ceph_assert(bl.length() == (size - bl1.length()));
-    ldout(cct, 20) << "The write on " << pool_root.first_free_entry
-                   << " with length " << size << " is split into two: "
-                   << "pos=" << pool_root.first_free_entry << ", "
-                   << "length=" << bl1.length() << "; "
-                   << "pos=" << DATA_RING_BUFFER_OFFSET << ", "
-                   << "length=" << bl.length() << dendl;
-
-    bdev->aio_write(pool_root.first_free_entry, bl1, &aio->ioc, false,
+
+    ldout(cct, 20) << "write " << control_block_pos << "~"
+                  << size << " spans boundary, split into "
+                  << control_block_pos << "~" << bl1.length()
+                  << " and " << DATA_RING_BUFFER_OFFSET << "~"
+                  << bl.length() << dendl;
+    bdev->aio_write(control_block_pos, bl1, &aio->ioc, false,
                     WRITE_LIFE_NOT_SET);
     bdev->aio_write(DATA_RING_BUFFER_OFFSET, bl, &aio->ioc, false,
                     WRITE_LIFE_NOT_SET);
   } else {
-    ldout(cct, 20) << "first_free_entry: " << pool_root.first_free_entry
-                   << " bl length: " << bl.length() << dendl;
-    bdev->aio_write(pool_root.first_free_entry, bl, &aio->ioc, false,
+    ldout(cct, 20) << "write " << control_block_pos << "~"
+                   << bl.length() << dendl;
+    bdev->aio_write(control_block_pos, bl, &aio->ioc, false,
                     WRITE_LIFE_NOT_SET);
-    ldout(cct, 20) << "finished aio_write log entries" << dendl;
   }
-  // New first free entry
-  pool_root.first_free_entry = data_pos;
 }
 
 template <typename I>
 void WriteLog<I>::schedule_update_root(
     std::shared_ptr<WriteLogPoolRoot> root, Context *ctx) {
+  CephContext *cct = m_image_ctx.cct;
+  ldout(cct, 15) << "New root: pool_size=" << root->pool_size
+                 << " first_valid_entry=" << root->first_valid_entry
+                 << " first_free_entry=" << root->first_free_entry
+                 << " flushed_sync_gen=" << root->flushed_sync_gen
+                 << dendl;
+  ceph_assert(is_valid_pool_root(*root));
+
   bool need_finisher;
   {
     ceph_assert(ceph_mutex_is_locked_by_me(m_lock));
@@ -949,41 +1061,32 @@ int WriteLog<I>::update_pool_root_sync(
 }
 
 template <typename I>
-void WriteLog<I>::pre_io_check(WriteLogCacheEntry *log_entry,
-                               uint64_t &length) {
-  assert(log_entry->is_write() || log_entry->is_writesame());
-  ceph_assert(log_entry->write_data_pos <= pool_size);
-
-  length = log_entry->is_write() ? log_entry->write_bytes :
-                                   log_entry->ws_datalen;
-  length = round_up_to(length, MIN_WRITE_ALLOC_SSD_SIZE);
-  ceph_assert(length != 0 && log_entry->write_data_pos + length <= pool_size);
-}
-
-template <typename I>
-void WriteLog<I>::aio_read_data_block(
-  WriteLogCacheEntry *log_entry, bufferlist *bl, Context *ctx) {
-  std::vector<WriteLogCacheEntry*> log_entries {log_entry};
+void WriteLog<I>::aio_read_data_block(std::shared_ptr<GenericWriteLogEntry> log_entry,
+                                      bufferlist *bl, Context *ctx) {
+  std::vector<std::shared_ptr<GenericWriteLogEntry>> log_entries = {std::move(log_entry)};
   std::vector<bufferlist *> bls {bl};
-  aio_read_data_block(log_entries, bls, ctx);
+  aio_read_data_blocks(log_entries, bls, ctx);
 }
 
 template <typename I>
-void WriteLog<I>::aio_read_data_block(
-    std::vector<WriteLogCacheEntry*> &log_entries,
+void WriteLog<I>::aio_read_data_blocks(
+    std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries,
     std::vector<bufferlist *> &bls, Context *ctx) {
   ceph_assert(log_entries.size() == bls.size());
 
   //get the valid part
   Context *read_ctx = new LambdaContext(
-    [this, log_entries, bls, ctx](int r) {
+    [log_entries, bls, ctx](int r) {
       for (unsigned int i = 0; i < log_entries.size(); i++) {
         bufferlist valid_data_bl;
-        auto length = log_entries[i]->is_write() ? log_entries[i]->write_bytes :
-                                                   log_entries[i]->ws_datalen;
+        auto write_entry = static_pointer_cast<WriteLogEntry>(log_entries[i]);
+        auto length = write_entry->ram_entry.is_write() ? write_entry->ram_entry.write_bytes
+                                                        : write_entry->ram_entry.ws_datalen;
+
         valid_data_bl.substr_of(*bls[i], 0, length);
         bls[i]->clear();
         bls[i]->append(valid_data_bl);
+        write_entry->dec_bl_refs();
       }
      ctx->complete(r);
     });
@@ -991,14 +1094,35 @@ void WriteLog<I>::aio_read_data_block(
   CephContext *cct = m_image_ctx.cct;
   AioTransContext *aio = new AioTransContext(cct, read_ctx);
   for (unsigned int i = 0; i < log_entries.size(); i++) {
-    auto log_entry = log_entries[i];
-
-    uint64_t length;
-    pre_io_check(log_entry, length);
-    ldout(cct, 20) << "Read at " << log_entry->write_data_pos
-                   << ", length " << length << dendl;
-
-    bdev->aio_read(log_entry->write_data_pos, length, bls[i], &aio->ioc);
+    WriteLogCacheEntry *log_entry = &log_entries[i]->ram_entry;
+
+    ceph_assert(log_entry->is_write() || log_entry->is_writesame());
+    uint64_t len = log_entry->is_write() ? log_entry->write_bytes :
+                                           log_entry->ws_datalen;
+    uint64_t align_len = round_up_to(len, MIN_WRITE_ALLOC_SSD_SIZE);
+
+    ldout(cct, 20) << "entry i=" << i << " " << log_entry->write_data_pos
+                   << "~" << len << dendl;
+    ceph_assert(log_entry->write_data_pos >= DATA_RING_BUFFER_OFFSET &&
+                log_entry->write_data_pos < pool_root.pool_size);
+    ceph_assert(align_len);
+    if (log_entry->write_data_pos + align_len > pool_root.pool_size) {
+      // spans boundary, need to split
+      uint64_t len1 = pool_root.pool_size - log_entry->write_data_pos;
+      uint64_t len2 = align_len - len1;
+
+      ldout(cct, 20) << "read " << log_entry->write_data_pos << "~"
+                     << align_len << " spans boundary, split into "
+                     << log_entry->write_data_pos << "~" << len1
+                     << " and " << DATA_RING_BUFFER_OFFSET << "~"
+                     << len2 << dendl;
+      bdev->aio_read(log_entry->write_data_pos, len1, bls[i], &aio->ioc);
+      bdev->aio_read(DATA_RING_BUFFER_OFFSET, len2, bls[i], &aio->ioc);
+    } else {
+      ldout(cct, 20) << "read " << log_entry->write_data_pos << "~"
+                     << align_len << dendl;
+      bdev->aio_read(log_entry->write_data_pos, align_len, bls[i], &aio->ioc);
+    }
   }
   bdev->aio_submit(&aio->ioc);
 }
index 64b4baa38bcdde49b1d1c768898f6af9540f1bde..69cc366628f24333f7f173eb9a9192f9703ab063 100644 (file)
@@ -63,11 +63,11 @@ protected:
   using AbstractWriteLog<ImageCtxT>::m_first_valid_entry;
   using AbstractWriteLog<ImageCtxT>::m_bytes_allocated;
 
-  void initialize_pool(Context *on_finish,
+  bool initialize_pool(Context *on_finish,
                        pwl::DeferredContexts &later) override;
   void process_work() override;
   void append_scheduled_ops(void) override;
-  void schedule_append_ops(pwl::GenericLogOperations &ops) override;
+  void schedule_append_ops(pwl::GenericLogOperations &ops, C_BlockIORequestT *req) override;
   void remove_pool_file() override;
   void release_ram(std::shared_ptr<GenericLogEntry> log_entry) override;
 
@@ -99,35 +99,36 @@ private:
   WriteLogPoolRootUpdateList m_poolroot_to_update; /* pool root list to update to SSD */
   bool m_updating_pool_root = false;
 
-  uint64_t m_log_pool_ring_buffer_size; /* Size of ring buffer */
   std::atomic<int> m_async_update_superblock = {0};
   BlockDevice *bdev = nullptr;
-  uint64_t pool_size;
   pwl::WriteLogPoolRoot pool_root;
   Builder<This> *m_builderobj;
 
   Builder<This>* create_builder();
+  int create_and_open_bdev();
   void load_existing_entries(pwl::DeferredContexts &later);
+  void inc_allocated_cached_bytes(
+      std::shared_ptr<pwl::GenericLogEntry> log_entry) override;
   void collect_read_extents(
       uint64_t read_buffer_offset, LogMapEntry<GenericWriteLogEntry> map_entry,
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, uint64_t entry_hit_length,
       Extent hit_extent, pwl::C_ReadRequest *read_ctx) override;
   void complete_read(
-      std::vector<WriteLogCacheEntry*> &log_entries_to_read,
+      std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries_to_read,
       std::vector<bufferlist*> &bls_to_read, Context *ctx) override;
   void enlist_op_appender();
   bool retire_entries(const unsigned long int frees_per_tx);
   bool has_sync_point_logs(GenericLogOperations &ops);
   void append_op_log_entries(GenericLogOperations &ops);
   void alloc_op_log_entries(GenericLogOperations &ops);
-  Context* construct_flush_entry_ctx(
-      std::shared_ptr<GenericLogEntry> log_entry);
+  void construct_flush_entries(pwl::GenericLogEntries entires_to_flush,
+                               DeferredContexts &post_unlock,
+                               bool has_write_entry) override;
   void append_ops(GenericLogOperations &ops, Context *ctx,
-                  uint64_t* new_first_free_entry,
-                  uint64_t &bytes_allocated);
+                  uint64_t* new_first_free_entry);
   void write_log_entries(GenericLogEntriesVector log_entries,
-                         AioTransContext *aio);
+                         AioTransContext *aio, uint64_t *pos);
   void schedule_update_root(std::shared_ptr<WriteLogPoolRoot> root,
                             Context *ctx);
   void enlist_op_update_root();
@@ -135,11 +136,10 @@ private:
   int update_pool_root_sync(std::shared_ptr<pwl::WriteLogPoolRoot> root);
   void update_pool_root(std::shared_ptr<WriteLogPoolRoot> root,
                                           AioTransContext *aio);
-  void pre_io_check(WriteLogCacheEntry *log_entry, uint64_t &length);
-  void aio_read_data_block(WriteLogCacheEntry *log_entry, bufferlist *bl,
-                           Context *ctx);
-  void aio_read_data_block(std::vector<WriteLogCacheEntry*> &log_entries,
-                           std::vector<bufferlist *> &bls, Context *ctx);
+  void aio_read_data_block(std::shared_ptr<GenericWriteLogEntry> log_entry,
+                           bufferlist *bl, Context *ctx);
+  void aio_read_data_blocks(std::vector<std::shared_ptr<GenericWriteLogEntry>> &log_entries,
+                            std::vector<bufferlist *> &bls, Context *ctx);
   static void aio_cache_cb(void *priv, void *priv2) {
     AioTransContext *c = static_cast<AioTransContext*>(priv2);
     c->aio_finish();
index 3d7c905a2c020027490b55904918c9f4b18c970a..3fc1aa6136df20796e71d664cacba52491ca162d 100644 (file)
@@ -283,8 +283,7 @@ void CreateRequest<I>::validate_data_pool() {
 
   auto ctx = create_context_callback<
     CreateRequest<I>, &CreateRequest<I>::handle_validate_data_pool>(this);
-  auto req = ValidatePoolRequest<I>::create(m_data_io_ctx, m_op_work_queue,
-                                            ctx);
+  auto req = ValidatePoolRequest<I>::create(m_data_io_ctx, ctx);
   req->send();
 }
 
index 79512c932ce2ab7006aab11a1932add8b0f3023b..b03f8fc7c21cb48c4d4bd4b4585c9120fa39fd79 100644 (file)
@@ -7,11 +7,11 @@
 #include "include/rados/librados.hpp"
 #include "librbd/ImageCtx.h"
 #include "librbd/image/TypeTraits.h"
+#include "common/Timer.h"
 
 #include <list>
 
 class Context;
-class SafeTimer;
 
 namespace librbd {
 
index 9e685dc477c7551ee6efba1f6ada7633e5fbe8fd..6f2872e256291422f14eac639dd272f0da49429b 100644 (file)
@@ -31,10 +31,9 @@ using util::create_async_context_callback;
 
 template <typename I>
 ValidatePoolRequest<I>::ValidatePoolRequest(librados::IoCtx& io_ctx,
-                                            asio::ContextWQ *op_work_queue,
                                             Context *on_finish)
     : m_cct(reinterpret_cast<CephContext*>(io_ctx.cct())),
-      m_op_work_queue(op_work_queue), m_on_finish(on_finish) {
+      m_on_finish(on_finish) {
     // validatation should occur in default namespace
     m_io_ctx.dup(io_ctx);
     m_io_ctx.set_namespace("");
@@ -97,11 +96,11 @@ void ValidatePoolRequest<I>::create_snapshot() {
 
   // allocate a self-managed snapshot id if this a new pool to force
   // self-managed snapshot mode
-  auto ctx = new LambdaContext([this](int r) {
-      r = m_io_ctx.selfmanaged_snap_create(&m_snap_id);
-      handle_create_snapshot(r);
-    });
-  m_op_work_queue->queue(ctx, 0);
+  auto comp = create_rados_callback<
+    ValidatePoolRequest<I>,
+    &ValidatePoolRequest<I>::handle_create_snapshot>(this);
+  m_io_ctx.aio_selfmanaged_snap_create(&m_snap_id, comp);
+  comp->release();
 }
 
 template <typename I>
@@ -161,11 +160,11 @@ template <typename I>
 void ValidatePoolRequest<I>::remove_snapshot() {
   ldout(m_cct, 5) << dendl;
 
-  auto ctx = new LambdaContext([this](int r) {
-      r = m_io_ctx.selfmanaged_snap_remove(m_snap_id);
-      handle_remove_snapshot(r);
-    });
-  m_op_work_queue->queue(ctx, 0);
+  auto comp = create_rados_callback<
+    ValidatePoolRequest<I>,
+    &ValidatePoolRequest<I>::handle_remove_snapshot>(this);
+  m_io_ctx.aio_selfmanaged_snap_remove(m_snap_id, comp);
+  comp->release();
 }
 
 template <typename I>
index 859bf4e13e3ee23de354177e66506f23ea4cc896..74f38441749068723f0f1bc675858d993a3a1a2c 100644 (file)
@@ -21,13 +21,11 @@ template <typename ImageCtxT>
 class ValidatePoolRequest {
 public:
   static ValidatePoolRequest* create(librados::IoCtx& io_ctx,
-                                     asio::ContextWQ *op_work_queue,
                                      Context *on_finish) {
-    return new ValidatePoolRequest(io_ctx, op_work_queue, on_finish);
+    return new ValidatePoolRequest(io_ctx, on_finish);
   }
 
-  ValidatePoolRequest(librados::IoCtx& io_ctx, asio::ContextWQ *op_work_queue,
-                      Context *on_finish);
+  ValidatePoolRequest(librados::IoCtx& io_ctx, Context *on_finish);
 
   void send();
 
@@ -62,7 +60,6 @@ private:
 
   librados::IoCtx m_io_ctx;
   CephContext* m_cct;
-  asio::ContextWQ* m_op_work_queue;
   Context* m_on_finish;
 
   int m_ret_val = 0;
index 34703158a3e68abf20b298fd336bc2de1b3292cb..2f3a6b7efcf2959e6eaea41eab9a3f2e51b4c305 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef CEPH_LIBRBD_IO_TYPE_TRAITS_H
 #define CEPH_LIBRBD_IO_TYPE_TRAITS_H
 
-class SafeTimer;
+#include "common/Timer.h"
 
 namespace librbd {
 namespace io {
index 8a4e40f88c442d37bdfae5653f87df37f8e987ba..6fab409c43021792ce49acc8e8753104853b5b35 100644 (file)
@@ -9,6 +9,7 @@
 #include "include/rados/librados.hpp"
 #include "include/rbd/librbd.hpp"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "librbd/ImageCtx.h"
 #include "journal/Journaler.h"
 #include "librbd/journal/Types.h"
@@ -20,7 +21,6 @@ using journal::Journaler;
 
 class Context;
 class ContextWQ;
-class SafeTimer;
 
 namespace journal {
   class Journaler;
index 13dff87a08e7e548675eb2ad7781e6564d7ef2e7..14b1c4dc59e6db8c19d7bd3c9fd9ebb50eec2b86 100644 (file)
 #include "librbd/ImageCtx.h"
 #include "journal/Journaler.h"
 #include "librbd/journal/TypeTraits.h"
+#include "common/Timer.h"
 
 using librados::IoCtx;
 using journal::Journaler;
 
 class Context;
 class ContextWQ;
-class SafeTimer;
 
 namespace journal {
   class Journaler;
index 44f5ac8a6bd7e07545b565eec8b56f10217f33aa..f9331f6446490ff3884ba4decd45a3dfe74b983f 100644 (file)
@@ -9,11 +9,11 @@
 #include "include/rados/librados.hpp"
 #include "include/rbd/librbd.hpp"
 #include "librbd/journal/TypeTraits.h"
+#include "common/Timer.h"
 #include <string>
 
 class Context;
 class ContextWQ;
-class SafeTimer;
 
 namespace journal { class Journaler; }
 
index 9fdd5ed71a5d9c1d893c9d3f8dc9dc80e27b9a65..1d9a862a0afb3ef53390ab6f88f4b3d27d434743 100644 (file)
@@ -7,12 +7,12 @@
 #include "include/buffer.h"
 #include "include/rbd/librbd.hpp"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "librbd/internal.h"
 
 #include <string>
 #include <set>
 
-class SafeTimer;
 struct Context;
 
 namespace librbd {
index a8331bc5afc47490be536917cebdac7f18c55832..566e98ac0f0fa2ccbe846e5a34ddf15895db1699 100644 (file)
@@ -222,7 +222,9 @@ void DiffRequest<I>::handle_load_object_map(int r) {
       uint8_t object_map_state = *it;
       if (object_map_state == OBJECT_NONEXISTENT) {
         *diff_it = DIFF_STATE_HOLE;
-      } else if (diff_from_start || object_map_state != OBJECT_EXISTS_CLEAN) {
+      } else if (diff_from_start ||
+                 (m_object_diff_state_valid &&
+                  object_map_state != OBJECT_EXISTS_CLEAN)) {
         *diff_it = DIFF_STATE_DATA_UPDATED;
       } else {
         *diff_it = DIFF_STATE_DATA;
index 2d55c17c19fe06128bbdd1a46e57d62a42f61bef..04f77e5c3e76d6ff34e93c0ea9f298ccffd70cc8 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef CEPH_LIBRBD_PLUGIN_API_H
 #define CEPH_LIBRBD_PLUGIN_API_H
 
+#include "common/Timer.h"
 #include "common/ceph_mutex.h"
 #include "include/common_fwd.h"
 #include "include/int_types.h"
@@ -13,8 +14,6 @@
 
 namespace ZTracer { struct Trace; }
 
-class SafeTimer;
-
 namespace librbd {
 
 namespace io {
index 7fa5ca9904b5e3d09ffe864e58f7478fb0daea45..1fd993dcadd23d06839a10b85cda8323394d0027 100644 (file)
@@ -641,6 +641,7 @@ void FSMap::encode(bufferlist& bl, uint64_t features) const
 
 void FSMap::decode(bufferlist::const_iterator& p)
 {
+  struct_version = 0;
   DECODE_START(STRUCT_VERSION, p);
   DECODE_OLDEST(7);
   struct_version = struct_v;
@@ -840,8 +841,12 @@ const MDSMap::mds_info_t* FSMap::find_replacement_for(mds_role_t role) const
   return get_available_standby(*fs);
 }
 
-void FSMap::sanity() const
+void FSMap::sanity(bool pending) const
 {
+  /* Only do some sanity checks on **new** FSMaps. Older versions may not be
+   * compliant.
+   */
+
   if (legacy_client_fscid != FS_CLUSTER_ID_NONE) {
     ceph_assert(filesystems.count(legacy_client_fscid) == 1);
   }
@@ -858,7 +863,7 @@ void FSMap::sanity() const
         ceph_assert(fs->mds_map.failed.count(info.rank) == 0);
         ceph_assert(fs->mds_map.damaged.count(info.rank) == 0);
       } else {
-        ceph_assert(fs->mds_map.allows_standby_replay());
+        ceph_assert(!pending || fs->mds_map.allows_standby_replay());
       }
       ceph_assert(info.compat.writeable(fs->mds_map.compat));
     }
@@ -918,6 +923,11 @@ void FSMap::promote(
   }
   auto& info = mds_map.mds_info.at(standby_gid);
 
+  if (!filesystem.mds_map.compat.writeable(info.compat)) {
+    ceph_assert(filesystem.is_upgradeable());
+    filesystem.mds_map.compat.merge(info.compat);
+  }
+
   if (mds_map.stopped.erase(assigned_rank)) {
     // The cluster is being expanded with a stopped rank
     info.state = MDSMap::STATE_STARTING;
@@ -943,11 +953,6 @@ void FSMap::promote(
     standby_epochs.erase(standby_gid);
   }
 
-  if (!filesystem.mds_map.compat.writeable(info.compat)) {
-    ceph_assert(filesystem.is_upgradeable());
-    filesystem.mds_map.compat.merge(info.compat);
-  }
-
   // Indicate that Filesystem has been modified
   mds_map.epoch = epoch;
 }
@@ -1011,7 +1016,7 @@ void FSMap::damaged(mds_gid_t who, epoch_t blocklist_epoch)
 {
   ceph_assert(mds_roles.at(who) != FS_CLUSTER_ID_NONE);
   auto fs = filesystems.at(mds_roles.at(who));
-  mds_rank_t rank = fs->mds_map.mds_info[who].rank;
+  mds_rank_t rank = fs->mds_map.mds_info.at(who).rank;
 
   erase(who, blocklist_epoch);
   fs->mds_map.failed.erase(rank);
@@ -1039,10 +1044,18 @@ bool FSMap::undamaged(const fs_cluster_id_t fscid, const mds_rank_t rank)
 
 void FSMap::insert(const MDSMap::mds_info_t &new_info)
 {
+  static const CompatSet empty;
+
   ceph_assert(new_info.state == MDSMap::STATE_STANDBY);
   ceph_assert(new_info.rank == MDS_RANK_NONE);
   mds_roles[new_info.global_id] = FS_CLUSTER_ID_NONE;
-  standby_daemons[new_info.global_id] = new_info;
+  auto& info = standby_daemons[new_info.global_id];
+  info = new_info;
+  if (empty.compare(info.compat) == 0) {
+    // bootstrap old compat: boot beacon contains empty compat on old (v16.2.4
+    // or older) MDS.
+    info.compat = MDSMap::get_compat_set_v16_2_4();
+  }
   standby_epochs[new_info.global_id] = epoch;
 }
 
index 7deee53bef747bab17a2dcaa304435860b76f705..f985da39b64f9f278bf2912c7284b03f455809a5 100644 (file)
@@ -189,7 +189,8 @@ public:
   void print(std::ostream& out) const;
 
   bool is_upgradeable() const {
-    return !mds_map.allows_standby_replay() && mds_map.get_num_in_mds() <= 1;
+    return (mds_map.allows_standby_replay() && mds_map.get_num_in_mds() == 0)
+       || (!mds_map.allows_standby_replay() && mds_map.get_num_in_mds() <= 1);
   }
 
   /**
@@ -523,8 +524,14 @@ public:
   bool filesystem_exists(fs_cluster_id_t fscid) const {return filesystems.count(fscid) > 0;}
   Filesystem::const_ref get_filesystem(fs_cluster_id_t fscid) const {return std::const_pointer_cast<const Filesystem>(filesystems.at(fscid));}
   Filesystem::ref get_filesystem(fs_cluster_id_t fscid) {return filesystems.at(fscid);}
+  Filesystem::ref get_filesystem(mds_gid_t gid) {
+    return filesystems.at(mds_roles.at(gid));
+  }
   Filesystem::const_ref get_filesystem(void) const {return std::const_pointer_cast<const Filesystem>(filesystems.begin()->second);}
   Filesystem::const_ref get_filesystem(std::string_view name) const;
+  Filesystem::const_ref get_filesystem(mds_gid_t gid) const {
+    return filesystems.at(mds_roles.at(gid));
+  }
 
   std::vector<Filesystem::const_ref> get_filesystems(void) const;
 
@@ -562,7 +569,7 @@ public:
    * Assert that the FSMap, Filesystem, MDSMap, mds_info_t relations are
    * all self-consistent.
    */
-  void sanity() const;
+  void sanity(bool pending=false) const;
 
   void encode(ceph::buffer::list& bl, uint64_t features) const;
   void decode(ceph::buffer::list::const_iterator& p);
index e9cbf7141c4c3b1f9cd3ce276078a8fd68e79108..1b61aadad7fb1fcf64c8e9d660da08e86299bc19 100644 (file)
@@ -254,9 +254,9 @@ bool MDCache::shutdown()
 // ====================================================================
 // some inode functions
 
-void MDCache::add_inode(CInode *in) 
+void MDCache::add_inode(CInode *in)
 {
-  // add to lru, inode map
+  // add to inode map
   if (in->last == CEPH_NOSNAP) {
     auto &p = inode_map[in->ino()];
     ceph_assert(!p); // should be no dup inos!
@@ -13242,7 +13242,9 @@ void MDCache::upkeep_main(void)
         if (active_with_clients) {
           trim_client_leases();
         }
-        trim();
+        if (is_open()) {
+          trim();
+        }
         if (active_with_clients) {
           auto recall_flags = Server::RecallFlags::ENFORCE_MAX|Server::RecallFlags::ENFORCE_LIVENESS;
           if (cache_toofull()) {
index d92658934bd85227c525a75dafcd8d25f5871dca..97162cc88559cca87cefbb58f20ea0f5520b700e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "common/LogClient.h"
 #include "common/ceph_mutex.h"
+#include "common/fair_mutex.h"
 #include "common/Timer.h"
 #include "include/Context.h"
 #include "include/types.h"
@@ -72,10 +73,10 @@ class MDSDaemon : public Dispatcher {
    * also check the `stopping` flag.  If stopping is true, you
    * must either do nothing and immediately drop the lock, or
    * never drop the lock again (i.e. call respawn()) */
-  ceph::mutex mds_lock = ceph::make_mutex("MDSDaemon::mds_lock");
+  ceph::fair_mutex mds_lock{"MDSDaemon::mds_lock"};
   bool stopping = false;
 
-  SafeTimer    timer;
+  class CommonSafeTimer<ceph::fair_mutex> timer;
   std::string gss_ktfile_client{};
 
   int orig_argc;
index 17741ec2b797fc7600aa530888be775b58e210af..9de050e3e811dedd8ce0ee40ad17f7f179a7f625 100644 (file)
@@ -82,6 +82,23 @@ CompatSet MDSMap::get_compat_set_base() {
   return CompatSet(feature_compat_base, feature_ro_compat_base, feature_incompat_base);
 }
 
+// pre-v16.2.5 CompatSet in MDS beacon
+CompatSet MDSMap::get_compat_set_v16_2_4() {
+  CompatSet::FeatureSet feature_compat;
+  CompatSet::FeatureSet feature_ro_compat;
+  CompatSet::FeatureSet feature_incompat;
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_BASE);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_CLIENTRANGES);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_FILELAYOUT);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_DIRINODE);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_ENCODING);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_OMAPDIRFRAG);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_NOANCHOR);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_FILE_LAYOUT_V2);
+  feature_incompat.insert(MDS_FEATURE_INCOMPAT_SNAPREALM_V2);
+  return CompatSet(feature_compat, feature_ro_compat, feature_incompat);
+}
+
 void MDSMap::mds_info_t::dump(Formatter *f) const
 {
   f->dump_unsigned("gid", global_id);
@@ -613,6 +630,8 @@ void MDSMap::mds_info_t::decode(bufferlist::const_iterator& bl)
   }
   if (struct_v >= 10) {
     decode(compat, bl);
+  } else {
+    compat = MDSMap::get_compat_set_v16_2_4();
   }
   DECODE_FINISH(bl);
 }
index bb5899c2d0721ca4d46017340520f06ae20d0e14..f583e22ea88af9466fc3124bc9441b21b463ff9f 100644 (file)
@@ -168,6 +168,7 @@ public:
   static CompatSet get_compat_set_all();
   static CompatSet get_compat_set_default();
   static CompatSet get_compat_set_base(); // pre v0.20
+  static CompatSet get_compat_set_v16_2_4(); // pre-v16.2.5 CompatSet in MDS beacon
 
   static MDSMap create_null_mdsmap() {
     MDSMap null_map;
@@ -444,6 +445,9 @@ public:
     return get_state_gid(it->second);
   }
 
+  auto get_gid(mds_rank_t r) const {
+    return up.at(r);
+  }
   const auto& get_info(mds_rank_t m) const {
     return mds_info.at(up.at(m));
   }
@@ -547,10 +551,10 @@ public:
    * Get MDS rank incarnation if the rank is up, else -1
    */
   mds_gid_t get_incarnation(mds_rank_t m) const {
-    std::map<mds_rank_t, mds_gid_t>::const_iterator u = up.find(m);
-    if (u == up.end())
+    auto it = up.find(m);
+    if (it == up.end())
       return MDS_GID_NONE;
-    return (mds_gid_t)get_inc_gid(u->second);
+    return (mds_gid_t)get_inc_gid(it->second);
   }
 
   int get_inc_gid(mds_gid_t gid) const {
index de69a4277b4aa958f40239df893f6444f1f12c24..6bf64e91809fafcaf9038d51acd586bb4e551ec1 100644 (file)
@@ -202,6 +202,54 @@ struct OpenedInodesMetric {
   }
 };
 
+struct ReadIoSizesMetric {
+  uint64_t total_ops = 0;
+  uint64_t total_size = 0;
+  bool updated = false;
+
+  DENC(ReadIoSizesMetric, v, p) {
+    DENC_START(1, 1, p);
+    denc(v.total_ops, p);
+    denc(v.total_size, p);
+    denc(v.updated, p);
+    DENC_FINISH(p);
+  }
+
+  void dump(Formatter *f) const {
+    f->dump_unsigned("total_ops", total_ops);
+    f->dump_unsigned("total_size", total_size);
+  }
+
+  friend std::ostream& operator<<(std::ostream& os, const ReadIoSizesMetric &metric) {
+    os << "{total_ops=" << metric.total_ops << ", total_size=" << metric.total_size <<"}";
+    return os;
+  }
+};
+
+struct WriteIoSizesMetric {
+  uint64_t total_ops = 0;
+  uint64_t total_size = 0;
+  bool updated = false;
+
+  DENC(WriteIoSizesMetric, v, p) {
+    DENC_START(1, 1, p);
+    denc(v.total_ops, p);
+    denc(v.total_size, p);
+    denc(v.updated, p);
+    DENC_FINISH(p);
+  }
+
+  void dump(Formatter *f) const {
+    f->dump_unsigned("total_ops", total_ops);
+    f->dump_unsigned("total_size", total_size);
+  }
+
+  friend std::ostream& operator<<(std::ostream& os, const WriteIoSizesMetric &metric) {
+    os << "{total_ops=" << metric.total_ops << ", total_size=" << metric.total_size <<"}";
+    return os;
+  }
+};
+
 WRITE_CLASS_DENC(CapHitMetric)
 WRITE_CLASS_DENC(ReadLatencyMetric)
 WRITE_CLASS_DENC(WriteLatencyMetric)
@@ -210,6 +258,8 @@ WRITE_CLASS_DENC(DentryLeaseHitMetric)
 WRITE_CLASS_DENC(OpenedFilesMetric)
 WRITE_CLASS_DENC(PinnedIcapsMetric)
 WRITE_CLASS_DENC(OpenedInodesMetric)
+WRITE_CLASS_DENC(ReadIoSizesMetric)
+WRITE_CLASS_DENC(WriteIoSizesMetric)
 
 // metrics that are forwarded to the MDS by client(s).
 struct Metrics {
@@ -222,12 +272,14 @@ struct Metrics {
   OpenedFilesMetric opened_files_metric;
   PinnedIcapsMetric pinned_icaps_metric;
   OpenedInodesMetric opened_inodes_metric;
+  ReadIoSizesMetric read_io_sizes_metric;
+  WriteIoSizesMetric write_io_sizes_metric;
 
   // metric update type
   uint32_t update_type = UpdateType::UPDATE_TYPE_REFRESH;
 
   DENC(Metrics, v, p) {
-    DENC_START(3, 1, p);
+    DENC_START(4, 1, p);
     denc(v.update_type, p);
     denc(v.cap_hit_metric, p);
     denc(v.read_latency_metric, p);
@@ -241,6 +293,10 @@ struct Metrics {
       denc(v.pinned_icaps_metric, p);
       denc(v.opened_inodes_metric, p);
     }
+    if (struct_v >= 4) {
+      denc(v.read_io_sizes_metric, p);
+      denc(v.write_io_sizes_metric, p);
+    }
     DENC_FINISH(p);
   }
 
@@ -254,6 +310,8 @@ struct Metrics {
     f->dump_object("opened_files_metric", opened_files_metric);
     f->dump_object("pinned_icaps_metric", pinned_icaps_metric);
     f->dump_object("opened_inodes_metric", opened_inodes_metric);
+    f->dump_object("read_io_sizes_metric", read_io_sizes_metric);
+    f->dump_object("write_io_sizes_metric", write_io_sizes_metric);
   }
 
   friend std::ostream& operator<<(std::ostream& os, const Metrics& metrics) {
@@ -262,10 +320,12 @@ struct Metrics {
        << ", read_latency=" << metrics.read_latency_metric
        << ", write_latency=" << metrics.write_latency_metric
        << ", metadata_latency=" << metrics.metadata_latency_metric
-       << ", dentry_lease =" << metrics.dentry_lease_metric
-       << ", opened_files_metric =" << metrics.opened_files_metric
-       << ", pinned_icaps_metric =" << metrics.pinned_icaps_metric
-       << ", opened_inodes_metric =" << metrics.opened_inodes_metric
+       << ", dentry_lease=" << metrics.dentry_lease_metric
+       << ", opened_files_metric=" << metrics.opened_files_metric
+       << ", pinned_icaps_metric=" << metrics.pinned_icaps_metric
+       << ", opened_inodes_metric=" << metrics.opened_inodes_metric
+       << ", read_io_sizes_metric=" << metrics.read_io_sizes_metric
+       << ", write_io_sizes_metric=" << metrics.write_io_sizes_metric
        << "}]";
     return os;
   }
index f085e266979c0ed25abce20050606fa9a4e3bdf4..3d5ed6e2c59b18e94d1a11209895b28aac671d1a 100644 (file)
@@ -16,6 +16,7 @@
 #include <typeinfo>
 #include "common/debug.h"
 #include "common/errno.h"
+#include "common/likely.h"
 #include "common/async/blocked_completion.h"
 
 #include "messages/MClientRequestForward.h"
@@ -477,9 +478,9 @@ private:
 MDSRank::MDSRank(
     mds_rank_t whoami_,
     std::string fs_name_,
-    ceph::mutex &mds_lock_,
+    ceph::fair_mutex &mds_lock_,
     LogChannelRef &clog_,
-    SafeTimer &timer_,
+    CommonSafeTimer<ceph::fair_mutex> &timer_,
     Beacon &beacon_,
     std::unique_ptr<MDSMap>& mdsmap_,
     Messenger *msgr,
@@ -1729,8 +1730,12 @@ void MDSRank::replay_start()
 {
   dout(1) << "replay_start" << dendl;
 
-  if (is_standby_replay())
+  if (is_standby_replay()) {
     standby_replaying = true;
+    if (unlikely(g_conf().get_val<bool>("mds_standby_replay_damaged"))) {
+      damaged();
+    }
+  }
 
   // Check if we need to wait for a newer OSD map before starting
   bool const ready = objecter->with_osdmap(
@@ -1921,6 +1926,17 @@ void MDSRank::resolve_done()
   snapclient->sync(new C_MDSInternalNoop);
 }
 
+void MDSRank::apply_blocklist(const std::set<entity_addr_t> &addrs, epoch_t epoch) {
+  auto victims = server->apply_blocklist(addrs);
+  dout(4) << __func__ << ": killed " << victims << " blocklisted sessions ("
+          << addrs.size() << " blocklist entries, "
+          << sessionmap.get_sessions().size() << ")" << dendl;
+  if (victims) {
+    set_osd_epoch_barrier(epoch);
+  }
+}
+
+
 void MDSRank::reconnect_start()
 {
   dout(1) << "reconnect_start" << dendl;
@@ -1938,13 +1954,8 @@ void MDSRank::reconnect_start()
       o.get_blocklist(&blocklist);
       epoch = o.get_epoch();
   });
-  auto killed = server->apply_blocklist(blocklist);
-  dout(4) << "reconnect_start: killed " << killed << " blocklisted sessions ("
-          << blocklist.size() << " blocklist entries, "
-          << sessionmap.get_sessions().size() << ")" << dendl;
-  if (killed) {
-    set_osd_epoch_barrier(epoch);
-  }
+
+  apply_blocklist(blocklist, epoch);
 
   server->reconnect_clients(new C_MDS_VoidFn(this, &MDSRank::reconnect_done));
   finish_contexts(g_ceph_context, waiting_for_reconnect);
@@ -3439,17 +3450,17 @@ void MDSRankDispatcher::handle_osd_map()
 
   purge_queue.update_op_limit(*mdsmap);
 
-  std::set<entity_addr_t> newly_blocklisted;
-  objecter->consume_blocklist_events(&newly_blocklisted);
-  auto epoch = objecter->with_osdmap([](const OSDMap &o){return o.get_epoch();});
-  dout(4) << "handle_osd_map epoch " << epoch << ", "
-          << newly_blocklisted.size() << " new blocklist entries" << dendl;
-  auto victims = server->apply_blocklist(newly_blocklisted);
-  if (victims) {
-    set_osd_epoch_barrier(epoch);
+  // it's ok if replay state is reached via standby-replay, the
+  // reconnect state will journal blocklisted clients (journal
+  // is opened for writing in `replay_done` before moving to
+  // up:resolve).
+  if (!is_replay()) {
+    std::set<entity_addr_t> newly_blocklisted;
+    objecter->consume_blocklist_events(&newly_blocklisted);
+    auto epoch = objecter->with_osdmap([](const OSDMap &o){return o.get_epoch();});
+    apply_blocklist(newly_blocklisted, epoch);
   }
 
-
   // By default the objecter only requests OSDMap updates on use,
   // we would like to always receive the latest maps in order to
   // apply policy based on the FULL flag.
@@ -3612,9 +3623,9 @@ bool MDSRank::evict_client(int64_t session_id,
 MDSRankDispatcher::MDSRankDispatcher(
     mds_rank_t whoami_,
     std::string fs_name_,
-    ceph::mutex &mds_lock_,
+    ceph::fair_mutex &mds_lock_,
     LogChannelRef &clog_,
-    SafeTimer &timer_,
+    CommonSafeTimer<ceph::fair_mutex> &timer_,
     Beacon &beacon_,
     std::unique_ptr<MDSMap> &mdsmap_,
     Messenger *msgr,
index 7ec785c14ffccddaed7c1e7a0a974408d0ca6e4b..2e3a9ee63520dec0c548fe764a8acde3db027184 100644 (file)
@@ -22,7 +22,9 @@
 #include "common/DecayCounter.h"
 #include "common/LogClient.h"
 #include "common/Timer.h"
+#include "common/fair_mutex.h"
 #include "common/TrackedOp.h"
+#include "common/ceph_mutex.h"
 
 #include "include/common_fwd.h"
 
@@ -165,9 +167,9 @@ class MDSRank {
     MDSRank(
         mds_rank_t whoami_,
        std::string fs_name_,
-        ceph::mutex &mds_lock_,
+        ceph::fair_mutex &mds_lock_,
         LogChannelRef &clog_,
-        SafeTimer &timer_,
+        CommonSafeTimer<ceph::fair_mutex> &timer_,
         Beacon &beacon_,
         std::unique_ptr<MDSMap> & mdsmap_,
         Messenger *msgr,
@@ -369,7 +371,7 @@ class MDSRank {
     // Reference to global MDS::mds_lock, so that users of MDSRank don't
     // carry around references to the outer MDS, and we can substitute
     // a separate lock here in future potentially.
-    ceph::mutex &mds_lock;
+    ceph::fair_mutex &mds_lock;
 
     // Reference to global cluster log client, just to avoid initialising
     // a separate one here.
@@ -378,7 +380,7 @@ class MDSRank {
     // Reference to global timer utility, because MDSRank and MDSDaemon
     // currently both use the same mds_lock, so it makes sense for them
     // to share a timer.
-    SafeTimer &timer;
+    CommonSafeTimer<ceph::fair_mutex> &timer;
 
     std::unique_ptr<MDSMap> &mdsmap; /* MDSDaemon::mdsmap */
 
@@ -431,7 +433,7 @@ class MDSRank {
       void signal() {cond.notify_all();}
       private:
       MDSRank *mds;
-      ceph::condition_variable cond;
+      std::condition_variable_any cond;
     } progress_thread;
 
     class C_MDS_StandbyReplayRestart;
@@ -547,6 +549,10 @@ class MDSRank {
 
     Context *create_async_exec_context(C_ExecAndReply *ctx);
 
+    // blocklist the provided addrs and set OSD epoch barrier
+    // with the provided epoch.
+    void apply_blocklist(const std::set<entity_addr_t> &addrs, epoch_t epoch);
+
     // Incarnation as seen in MDSMap at the point where a rank is
     // assigned.
     int incarnation = 0;
@@ -661,9 +667,9 @@ public:
   MDSRankDispatcher(
       mds_rank_t whoami_,
       std::string fs_name,
-      ceph::mutex &mds_lock_,
+      ceph::fair_mutex &mds_lock_,
       LogChannelRef &clog_,
-      SafeTimer &timer_,
+      CommonSafeTimer<ceph::fair_mutex> &timer_,
       Beacon &beacon_,
       std::unique_ptr<MDSMap> &mdsmap_,
       Messenger *msgr,
index 8d98db5fd49d09586ff06d1bf730c851bdc14e96..046e79269868e2b34791e1d1232eaec9e2ebc929 100644 (file)
@@ -156,6 +156,18 @@ void MetricAggregator::refresh_metrics_for_rank(const entity_inst_t &client,
         c->second = metrics.opened_inodes_metric.total_inodes;
       }
       break;
+    case MDSPerformanceCounterType::READ_IO_SIZES_METRIC:
+      if (metrics.read_io_sizes_metric.updated) {
+        c->first = metrics.read_io_sizes_metric.total_ops;
+        c->second = metrics.read_io_sizes_metric.total_size;
+      }
+      break;
+    case MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC:
+      if (metrics.write_io_sizes_metric.updated) {
+        c->first = metrics.write_io_sizes_metric.total_ops;
+        c->second = metrics.write_io_sizes_metric.total_size;
+      }
+      break;
     default:
       ceph_abort_msg("unknown counter type");
     }
index 6695441b63c2964244f2f8cac80acf3bfb392458..3fcaaaec1fab667dd22862962802f697311e0f6c 100644 (file)
@@ -127,6 +127,8 @@ void MetricsHandler::remove_session(Session *session) {
   metrics.opened_files_metric = { };
   metrics.pinned_icaps_metric = { };
   metrics.opened_inodes_metric = { };
+  metrics.read_io_sizes_metric = { };
+  metrics.write_io_sizes_metric = { };
   metrics.update_type = UPDATE_TYPE_REMOVE;
 }
 
@@ -275,6 +277,40 @@ void MetricsHandler::handle_payload(Session *session, const OpenedInodesPayload
   metrics.opened_inodes_metric.updated = true;
 }
 
+void MetricsHandler::handle_payload(Session *session, const ReadIoSizesPayload &payload) {
+  dout(20) << ": type=" << payload.get_type()
+           << ", session=" << session << ", total_ops=" << payload.total_ops
+           << ", total_size=" << payload.total_size << dendl;
+
+  auto it = client_metrics_map.find(session->info.inst);
+  if (it == client_metrics_map.end()) {
+    return;
+  }
+
+  auto &metrics = it->second.second;
+  metrics.update_type = UPDATE_TYPE_REFRESH;
+  metrics.read_io_sizes_metric.total_ops = payload.total_ops;
+  metrics.read_io_sizes_metric.total_size = payload.total_size;
+  metrics.read_io_sizes_metric.updated = true;
+}
+
+void MetricsHandler::handle_payload(Session *session, const WriteIoSizesPayload &payload) {
+  dout(20) << ": type=" << payload.get_type()
+           << ", session=" << session << ", total_ops=" << payload.total_ops
+           << ", total_size=" << payload.total_size << dendl;
+
+  auto it = client_metrics_map.find(session->info.inst);
+  if (it == client_metrics_map.end()) {
+    return;
+  }
+
+  auto &metrics = it->second.second;
+  metrics.update_type = UPDATE_TYPE_REFRESH;
+  metrics.write_io_sizes_metric.total_ops = payload.total_ops;
+  metrics.write_io_sizes_metric.total_size = payload.total_size;
+  metrics.write_io_sizes_metric.updated = true;
+}
+
 void MetricsHandler::handle_payload(Session *session, const UnknownPayload &payload) {
   dout(5) << ": type=Unknown, session=" << session << ", ignoring unknown payload" << dendl;
 }
index 65bcf488b5f064fb7c958155e43fef28700c0538..0b75b0248607703bdb92d0e5bf17e9b352436525 100644 (file)
@@ -98,6 +98,8 @@ private:
   void handle_payload(Session *session, const OpenedFilesPayload &payload);
   void handle_payload(Session *session, const PinnedIcapsPayload &payload);
   void handle_payload(Session *session, const OpenedInodesPayload &payload);
+  void handle_payload(Session *session, const ReadIoSizesPayload &payload);
+  void handle_payload(Session *session, const WriteIoSizesPayload &payload);
   void handle_payload(Session *session, const UnknownPayload &payload);
 
   void set_next_seq(version_t seq);
index 2123aace1ec1ef68c0e4be8471f1fc8547a290e1..618f1160de56982b888810482c6c89104851e82d 100644 (file)
@@ -613,8 +613,8 @@ void Server::handle_client_session(const cref_t<MClientSession> &m)
         dout(2) << css->strv() << dendl;
       };
 
-      auto send_reject_message = [this, &session, &log_session_status](std::string_view err_str) {
-       auto m = make_message<MClientSession>(CEPH_SESSION_REJECT);
+      auto send_reject_message = [this, &session, &log_session_status](std::string_view err_str, unsigned flags=0) {
+       auto m = make_message<MClientSession>(CEPH_SESSION_REJECT, 0, flags);
        if (session->info.has_feature(CEPHFS_FEATURE_MIMIC))
          m->metadata["error_string"] = err_str;
        mds->send_message_client(m, session);
@@ -633,7 +633,9 @@ void Server::handle_client_session(const cref_t<MClientSession> &m)
        // has been blocklisted.  If mounted with recover_session=clean
        // (since 5.4), it tries to automatically recover itself from
        // blocklisting.
-       send_reject_message("blocklisted (blacklisted)");
+        unsigned flags = 0;
+       flags |= MClientSession::SESSION_BLOCKLISTED;
+       send_reject_message("blocklisted (blacklisted)", flags);
        session->clear();
        break;
       }
index 3ab0f5344bd0778f3379a52acc08e1ddb126fd13..a3d45d5c9ca44a12854b73867979d054b7948725 100644 (file)
@@ -71,6 +71,8 @@ namespace ceph {
     CLIENT_METRIC_TYPE_OPENED_FILES,           \
     CLIENT_METRIC_TYPE_PINNED_ICAPS,           \
     CLIENT_METRIC_TYPE_OPENED_INODES,          \
+    CLIENT_METRIC_TYPE_READ_IO_SIZES,          \
+    CLIENT_METRIC_TYPE_WRITE_IO_SIZES,         \
 }
 
 #define CEPHFS_FEATURES_MDS_SUPPORTED CEPHFS_FEATURES_ALL
index 19dc30f256a1445e114d744fc2799cd98643b5ca..f6927a49c6cc4458f81f47284dbdedf9c91b8bab 100644 (file)
 
 class MClientSession final : public SafeMessage {
 private:
-  static constexpr int HEAD_VERSION = 4;
+  static constexpr int HEAD_VERSION = 5;
   static constexpr int COMPAT_VERSION = 1;
 
 public:
   ceph_mds_session_head head;
+  static constexpr unsigned SESSION_BLOCKLISTED = (1<<0);
 
+  unsigned flags = 0;
   std::map<std::string, std::string> metadata;
   feature_bitset_t supported_features;
   metric_spec_t metric_spec;
@@ -38,8 +40,9 @@ public:
 
 protected:
   MClientSession() : SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} { }
-  MClientSession(int o, version_t s=0) : 
-    SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} {
+  MClientSession(int o, version_t s=0, unsigned msg_flags=0) :
+    SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION},
+    flags(msg_flags) {
     memset(&head, 0, sizeof(head));
     head.op = o;
     head.seq = s;
@@ -75,6 +78,9 @@ public:
     if (header.version >= 4) {
       decode(metric_spec, p);
     }
+    if (header.version >= 5) {
+      decode(flags, p);
+    }
   }
   void encode_payload(uint64_t features) override { 
     using ceph::encode;
@@ -89,6 +95,7 @@ public:
       encode(metadata, payload);
       encode(supported_features, payload);
       encode(metric_spec, payload);
+      encode(flags, payload);
     }
   }
 private:
index 2e3897ad707056e827bcba91b7b8ad7c07744a25..8622c60386ff54407a350d54951984a23f983641 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "osd/OSDMap.h"
 #include "mon/MonMap.h"
-
+#include "osd/osd_types.h"
 #include "mgr/MgrContext.h"
 
 // For ::mgr_store_prefix
@@ -442,6 +442,29 @@ PyObject *ActivePyModules::get_python(const std::string &what)
     with_gil_t with_gil{no_gil};
     f.dump_bool("have_local_config_map", have_local_config_map);
     return f.get();
+  } else if (what == "active_clean_pgs"){
+    cluster_state.with_pgmap(
+        [&](const PGMap &pg_map) {
+      with_gil_t with_gil{no_gil};
+      f.open_array_section("pg_stats");
+      for (auto &i : pg_map.pg_stat) {
+        const auto state = i.second.state;
+       const auto pgid_raw = i.first;
+       const auto pgid = stringify(pgid_raw.m_pool) + "." + stringify(pgid_raw.m_seed);
+       const auto reported_epoch = i.second.reported_epoch;
+       if (state & PG_STATE_ACTIVE && state & PG_STATE_CLEAN) {
+         f.open_object_section("pg_stat");
+         f.dump_string("pgid", pgid);
+         f.dump_string("state", pg_state_string(state));
+         f.dump_unsigned("reported_epoch", reported_epoch);
+         f.close_section();
+       }
+      }
+      f.close_section();
+      const auto num_pg = pg_map.num_pg;
+      f.dump_unsigned("total_num_pgs", num_pg);
+    });
+    return f.get();
   } else {
     derr << "Python module requested unknown data '" << what << "'" << dendl;
     with_gil_t with_gil{no_gil};
index da8785eaa97d3f00e380ddd661f607158b318bd7..7dce2266ddc8ec2c47e778db2390c666a41b1e61 100644 (file)
@@ -1104,6 +1104,8 @@ ceph_add_mds_perf_query(BaseMgrModule *self, PyObject *args)
     {"opened_files", MDSPerformanceCounterType::OPENED_FILES_METRIC},
     {"pinned_icaps", MDSPerformanceCounterType::PINNED_ICAPS_METRIC},
     {"opened_inodes", MDSPerformanceCounterType::OPENED_INODES_METRIC},
+    {"read_io_sizes", MDSPerformanceCounterType::READ_IO_SIZES_METRIC},
+    {"write_io_sizes", MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC},
   };
 
   PyObject *py_query = nullptr;
index bbba88a76bb509d3f101d5bc3b04a889c8edf33a..5568cbe5d7a319e8c9fea36e80ccc922567f19b1 100644 (file)
@@ -33,6 +33,8 @@ void MDSPerformanceCounterDescriptor::pack_counter(
   case MDSPerformanceCounterType::OPENED_FILES_METRIC:
   case MDSPerformanceCounterType::PINNED_ICAPS_METRIC:
   case MDSPerformanceCounterType::OPENED_INODES_METRIC:
+  case MDSPerformanceCounterType::READ_IO_SIZES_METRIC:
+  case MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC:
     break;
   default:
     ceph_abort_msg("unknown counter type");
@@ -53,6 +55,8 @@ void MDSPerformanceCounterDescriptor::unpack_counter(
   case MDSPerformanceCounterType::OPENED_FILES_METRIC:
   case MDSPerformanceCounterType::PINNED_ICAPS_METRIC:
   case MDSPerformanceCounterType::OPENED_INODES_METRIC:
+  case MDSPerformanceCounterType::READ_IO_SIZES_METRIC:
+  case MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC:
     break;
   default:
     ceph_abort_msg("unknown counter type");
@@ -85,6 +89,12 @@ std::ostream& operator<<(std::ostream &os, const MDSPerformanceCounterDescriptor
    case MDSPerformanceCounterType::OPENED_INODES_METRIC:
      os << "opened_inodes_metric";
      break;
+   case MDSPerformanceCounterType::READ_IO_SIZES_METRIC:
+     os << "read_io_sizes_metric";
+     break;
+   case MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC:
+     os << "write_io_sizes_metric";
+     break;
    }
 
    return os;
index 41b183b05e297e9c4a1f468a320cb03dc2d2b9d2..b778b0347431a1a0eda267c41dcadfc86ea28277 100644 (file)
@@ -124,6 +124,8 @@ enum class MDSPerformanceCounterType : uint8_t {
   OPENED_FILES_METRIC = 5,
   PINNED_ICAPS_METRIC = 6,
   OPENED_INODES_METRIC = 7,
+  READ_IO_SIZES_METRIC = 8,
+  WRITE_IO_SIZES_METRIC = 9,
 };
 
 struct MDSPerformanceCounterDescriptor {
@@ -139,6 +141,8 @@ struct MDSPerformanceCounterDescriptor {
     case MDSPerformanceCounterType::OPENED_FILES_METRIC:
     case MDSPerformanceCounterType::PINNED_ICAPS_METRIC:
     case MDSPerformanceCounterType::OPENED_INODES_METRIC:
+    case MDSPerformanceCounterType::READ_IO_SIZES_METRIC:
+    case MDSPerformanceCounterType::WRITE_IO_SIZES_METRIC:
       return true;
     default:
       return false;
index 19a3eed9b0aba5b4053f2c7017580329b17b262e..65e71e276e4326ee537d576d3783018f52a8d5a4 100644 (file)
@@ -42,7 +42,9 @@ public:
       auto result_it = result.insert({query, {}}).first;
       if (is_limited(limits)) {
         for (auto& limit : limits) {
-          result_it->second.insert(*limit.second);
+          if (limit.second) {
+            result_it->second.insert(*limit.second);
+          }
         }
       }
     }
index 1ffa80a0d053ff51939b9794f7a681372b3784e1..f08608c6133d6e44d2306792587dd10d2aa37fdd 100644 (file)
@@ -83,11 +83,12 @@ bool AuthMonitor::check_rotate()
 {
   KeyServerData::Incremental rot_inc;
   rot_inc.op = KeyServerData::AUTH_INC_SET_ROTATING;
-  if (!mon.key_server.updated_rotating(rot_inc.rotating_bl, last_rotating_ver))
-    return false;
-  dout(10) << __func__ << " updated rotating" << dendl;
-  push_cephx_inc(rot_inc);
-  return true;
+  if (mon.key_server.prepare_rotating_update(rot_inc.rotating_bl)) {
+    dout(10) << __func__ << " updating rotating" << dendl;
+    push_cephx_inc(rot_inc);
+    return true;
+  }
+  return false;
 }
 
 /*
@@ -139,16 +140,26 @@ void AuthMonitor::on_active()
 
   if (!mon.is_leader())
     return;
+
   mon.key_server.start_server();
 
-  bool increase;
-  {
-    std::lock_guard l(mon.auth_lock);
-    increase = _should_increase_max_global_id();
-  }
-  if (is_writeable() && increase) {
-    increase_max_global_id();
-    propose_pending();
+  if (is_writeable()) {
+    bool propose = false;
+    if (check_rotate()) {
+      propose = true;
+    }
+    bool increase;
+    {
+      std::lock_guard l(mon.auth_lock);
+      increase = _should_increase_max_global_id();
+    }
+    if (increase) {
+      increase_max_global_id();
+      propose = true;
+    }
+    if (propose) {
+      propose_pending();
+    }
   }
 }
 
@@ -241,7 +252,6 @@ void AuthMonitor::create_initial()
 
   // initialize rotating keys
   mon.key_server.clear_secrets();
-  last_rotating_ver = 0;
   check_rotate();
   ceph_assert(pending_auth.size() == 1);
 
@@ -359,6 +369,8 @@ void AuthMonitor::update_from_paxos(bool *need_bootstrap)
   dout(10) << __func__ << " max_global_id=" << max_global_id
           << " format_version " << format_version
           << dendl;
+
+  mon.key_server.dump();
 }
 
 bool AuthMonitor::_should_increase_max_global_id()
index 048fc0c08ef4d3ec9015bfce0cab890c51752bdd..4312b56071f4b7503ddee6468c58a9a616efbdf7 100644 (file)
@@ -97,7 +97,6 @@ public:
 
 private:
   std::vector<Incremental> pending_auth;
-  version_t last_rotating_ver;
   uint64_t max_global_id;
   uint64_t last_allocated_id;
 
@@ -186,7 +185,6 @@ private:
  public:
   AuthMonitor(Monitor &mn, Paxos &p, const std::string& service_name)
     : PaxosService(mn, p, service_name),
-      last_rotating_ver(0),
       max_global_id(0),
       last_allocated_id(0)
   {}
index 4d24d727bbe0a25ad78d48ae6dc5a249d2f7e253..defa0e82a7839918bd57bb03ccf70a9f55c8d941 100644 (file)
@@ -48,7 +48,7 @@ void KVMonitor::create_initial()
   version = 0;
   pending.clear();
   bufferlist bl;
-  bl.append("scale-down");
+  bl.append("scale-up");
   pending["config/mgr/mgr/pg_autoscaler/autoscale_profile"] = bl;
 }
 
index 437393808251ae465b7b7d7e299e88fe043a33e1..0e30a14613ea37fb261f09b246e2c8c6f61c0e01 100644 (file)
@@ -190,7 +190,7 @@ void MDSMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // print map iff 'debug mon = 30' or higher
   print_map<30>(pending);
   if (!g_conf()->mon_mds_skip_sanity) {
-    pending.sanity();
+    pending.sanity(true);
   }
 
   // Set 'modified' on maps modified this epoch
@@ -473,23 +473,6 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op)
 
   // is there a state change here?
   if (info.state != state) {
-    // legal state change?
-    if ((info.state == MDSMap::STATE_STANDBY ||
-        info.state == MDSMap::STATE_STANDBY_REPLAY) && state > 0) {
-      dout(10) << "mds_beacon mds can't activate itself (" << ceph_mds_state_name(info.state)
-              << " -> " << ceph_mds_state_name(state) << ")" << dendl;
-      goto reply;
-    }
-
-    if ((state == MDSMap::STATE_STANDBY || state == MDSMap::STATE_STANDBY_REPLAY)
-        && info.rank != MDS_RANK_NONE)
-    {
-      dout(4) << "mds_beacon MDS can't go back into standby after taking rank: "
-                 "held rank " << info.rank << " while requesting state "
-              << ceph_mds_state_name(state) << dendl;
-      goto reply;
-    }
-    
     _note_beacon(m);
     return false;
   }
@@ -691,15 +674,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
        * know which FS it was part of. Nor does this matter. Sending an empty
        * MDSMap is sufficient for getting the MDS to respawn.
        */
-      wait_for_finished_proposal(op, new LambdaContext([op, this](int r){
-        if (r >= 0) {
-          auto m = make_message<MMDSMap>(mon.monmap->fsid, MDSMap::create_null_mdsmap());
-          mon.send_reply(op, m.detach());
-        } else {
-          dispatch(op);        // try again
-        }
-      }));
-      return true;
+      goto null;
     }
 
     const auto& info = pending.get_info_gid(gid);
@@ -716,14 +691,27 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       return true;
     }
 
-    if (info.state == MDSMap::STATE_STOPPING &&
+    // legal state change?
+    if ((info.state == MDSMap::STATE_STANDBY && state > 0) ||
+        (info.state == MDSMap::STATE_STANDBY_REPLAY && state > 0 && state != MDSMap::STATE_DAMAGED)) {
+      /* N.B.: standby-replay can indicate the rank is damaged due to failure to replay */
+      dout(10) << "mds_beacon mds can't activate itself (" << ceph_mds_state_name(info.state)
+              << " -> " << ceph_mds_state_name(state) << ")" << dendl;
+      goto evict;
+    } else if ((state == MDSMap::STATE_STANDBY || state == MDSMap::STATE_STANDBY_REPLAY)
+        && info.rank != MDS_RANK_NONE)
+    {
+      dout(4) << "mds_beacon MDS can't go back into standby after taking rank: "
+                 "held rank " << info.rank << " while requesting state "
+              << ceph_mds_state_name(state) << dendl;
+      goto evict;
+    } else if (info.state == MDSMap::STATE_STOPPING &&
         state != MDSMap::STATE_STOPPING &&
         state != MDSMap::STATE_STOPPED) {
       // we can't transition to any other states from STOPPING
       dout(0) << "got beacon for MDS in STATE_STOPPING, ignoring requested state change"
               << dendl;
-      _note_beacon(m);
-      return true;
+      goto evict;
     }
 
     if (info.laggy()) {
@@ -770,8 +758,6 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
           pending_daemon_health_rm.insert(erased_gid);
         }
       }
-
-
     } else if (state == MDSMap::STATE_DAMAGED) {
       if (!mon.osdmon()->is_writeable()) {
         dout(1) << __func__ << ": DAMAGED from rank " << info.rank
@@ -780,47 +766,40 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
         return false;
       }
 
+      auto rank = info.rank;
+
       // Record this MDS rank as damaged, so that other daemons
       // won't try to run it.
-      dout(0) << __func__ << ": marking rank "
-              << info.rank << " damaged" << dendl;
+      dout(0) << __func__ << ": marking rank " << rank << " damaged" << dendl;
+
+      auto fs = pending.get_filesystem(gid);
+      auto rankgid = fs->mds_map.get_gid(rank);
+      auto rankinfo = pending.get_info_gid(rankgid);
+      auto followergid = fs->mds_map.get_standby_replay(rank);
+
+      ceph_assert(gid == rankgid || gid == followergid);
 
       utime_t until = ceph_clock_now();
       until += g_conf().get_val<double>("mon_mds_blocklist_interval");
-      const auto blocklist_epoch = mon.osdmon()->blocklist(info.addrs, until);
-      request_proposal(mon.osdmon());
-      pending.damaged(gid, blocklist_epoch);
-      last_beacon.erase(gid);
-
-      // Respond to MDS, so that it knows it can continue to shut down
-      auto beacon = make_message<MMDSBeacon>(
-                       mon.monmap->fsid, m->get_global_id(),
-                       m->get_name(), pending.get_epoch(), state, seq,
-                       CEPH_FEATURES_SUPPORTED_DEFAULT);
-      mon.send_reply(op, beacon.detach());
-    } else if (state == MDSMap::STATE_DNE) {
-      if (!mon.osdmon()->is_writeable()) {
-        dout(1) << __func__ << ": DNE from rank " << info.rank
-                << " waiting for osdmon writeable to blocklist it" << dendl;
-        mon.osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
-        return false;
+      const auto blocklist_epoch = mon.osdmon()->blocklist(rankinfo.addrs, until);
+      if (followergid != MDS_GID_NONE) {
+        fail_mds_gid(pending, followergid);
+        last_beacon.erase(followergid);
       }
-
-      fail_mds_gid(pending, gid);
-      ceph_assert(mon.osdmon()->is_writeable());
       request_proposal(mon.osdmon());
+      pending.damaged(rankgid, blocklist_epoch);
+      last_beacon.erase(rankgid);
 
-      // Respond to MDS, so that it knows it can continue to shut down
-      auto beacon = make_message<MMDSBeacon>(mon.monmap->fsid,
-          m->get_global_id(), m->get_name(), pending.get_epoch(), state, seq,
-          CEPH_FEATURES_SUPPORTED_DEFAULT);
-      mon.send_reply(op, beacon.detach());
+      /* MDS expects beacon reply back */
+    } else if (state == MDSMap::STATE_DNE) {
+      dout(1) << __func__ << ": DNE from " << info << dendl;
+      goto evict;
     } else if (info.state == MDSMap::STATE_STANDBY && state != info.state) {
       // Standby daemons should never modify their own
       // state.  Reject any attempts to do so.
       derr << "standby " << gid << " attempted to change state to "
            << ceph_mds_state_name(state) << ", rejecting" << dendl;
-      return true;
+      goto evict;
     } else if (info.state != MDSMap::STATE_STANDBY && state != info.state &&
                !MDSMap::state_transition_valid(info.state, state)) {
       // Validate state transitions for daemons that hold a rank
@@ -828,7 +807,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
            << "reported invalid state transition "
            << ceph_mds_state_name(info.state) << " -> "
            << ceph_mds_state_name(state) << dendl;
-      return true;
+      goto evict;
     } else {
       if (info.state != MDSMap::STATE_ACTIVE && state == MDSMap::STATE_ACTIVE) {
         const auto &fscid = pending.mds_roles.at(gid);
@@ -860,6 +839,32 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
     }
   }));
 
+  return true;
+
+evict:
+  if (!mon.osdmon()->is_writeable()) {
+    dout(1) << __func__ << ": waiting for writeable OSDMap to evict" << dendl;
+    mon.osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op));
+    return false;
+  }
+
+  fail_mds_gid(pending, gid);
+  request_proposal(mon.osdmon());
+  dout(5) << __func__ << ": pending map now:" << dendl;
+  print_map(pending);
+
+  goto null;
+
+null:
+  wait_for_finished_proposal(op, new LambdaContext([op, this](int r){
+    if (r >= 0) {
+      auto m = make_message<MMDSMap>(mon.monmap->fsid, MDSMap::create_null_mdsmap());
+      mon.send_reply(op, m.detach());
+    } else {
+      dispatch(op);        // try again
+    }
+  }));
+
   return true;
 }
 
@@ -2301,7 +2306,12 @@ void MDSMonitor::tick()
         derr << "could not get version " << v << dendl;
         ceph_abort();
       }
-      fsmap.decode(bl);
+      try {
+        fsmap.decode(bl);
+      } catch (const ceph::buffer::malformed_input& e) {
+        dout(5) << "flushing old fsmap struct because unable to decode FSMap: " << e.what() << dendl;
+      }
+      /* N.B. FSMap::is_struct_old is also true for undecoded (failed to decode) FSMap */
       if (fsmap.is_struct_old()) {
         dout(5) << "fsmap struct is too old; proposing to flush out old versions" << dendl;
         do_propose = true;
index f96deacd8e51964769372026dcff1b1fcbc8f6d4..e1dc3723965916f5cd0d364ab9b35cf59723727d 100644 (file)
@@ -183,6 +183,9 @@ void MonCapGrant::expand_profile(const EntityName& name) const
     profile_grants.push_back(MonCapGrant("mon", MON_CAP_R));
     profile_grants.push_back(MonCapGrant("pg", MON_CAP_R | MON_CAP_W));
     profile_grants.push_back(MonCapGrant("log", MON_CAP_W));
+    StringConstraint constraint(StringConstraint::MATCH_TYPE_REGEX,
+                                string("osd_mclock_max_capacity_iops_(hdd|ssd)"));
+    profile_grants.push_back(MonCapGrant("config set", "name", constraint));
   }
   if (profile == "mds") {
     profile_grants.push_back(MonCapGrant("mds", MON_CAP_ALL));
index 463419b0685dd5b8918e23fd88acafd361cd9024..3bc99c52e6c75460247306173048b49534b93688 100644 (file)
@@ -534,6 +534,11 @@ COMMAND("mon enable_stretch_mode " \
        "as the tiebreaker and setting <dividing_bucket> locations "
        "as the units for stretching across",
        "mon", "rw")
+COMMAND("mon set_new_tiebreaker " \
+       "name=name,type=CephString "
+       "name=yes_i_really_mean_it,type=CephBool,req=false",
+       "switch the stretch tiebreaker to be the named mon", \
+       "mon", "rw")
 
 /*
  * OSD commands
index 8676443f247cad5ea306fe7208cb08f6d016bbbe..f102e9dd9ba43b327a88b37dff4fde7e70567a39 100644 (file)
@@ -42,10 +42,10 @@ void mon_info_t::encode(ceph::buffer::list& bl, uint64_t features) const
   uint8_t min_v = 1;
   if (!crush_loc.empty()) {
     // we added crush_loc in version 5, but need to let old clients decode it
-    // so just leave the min_v at version 4. Monitors are protected
+    // so just leave the min_v at version 1. Monitors are protected
     // from misunderstandings about location because setting it is blocked
     // on FEATURE_PINGING
-    min_v = 4;
+    min_v = 1;
   }
   if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
     v = 2;
@@ -369,7 +369,12 @@ void MonMap::print(ostream& out) const
   out << "min_mon_release " << to_integer<unsigned>(min_mon_release)
       << " (" << min_mon_release << ")\n";
   out << "election_strategy: " << strategy << "\n";
-  if (disallowed_leaders.size()) {
+  if (stretch_mode_enabled) {
+    out << "stretch_mode_enabled " << stretch_mode_enabled << "\n";
+    out << "tiebreaker_mon " << tiebreaker_mon << "\n";
+  }
+  if (stretch_mode_enabled ||
+      !disallowed_leaders.empty()) {
     out << "disallowed_leaders " << disallowed_leaders << "\n";
   }
   unsigned i = 0;
@@ -395,6 +400,7 @@ void MonMap::dump(Formatter *f) const
   f->dump_int ("election_strategy", strategy);
   f->dump_stream("disallowed_leaders: ") << disallowed_leaders;
   f->dump_bool("stretch_mode", stretch_mode_enabled);
+  f->dump_string("tiebreaker_mon", tiebreaker_mon);
   f->open_object_section("features");
   persistent_features.dump(f, "persistent");
   optional_features.dump(f, "optional");
index ec72f410d1fcf230384748abc1a367052a446799..c9dfa3af499b15bf49eca86d0dd74f89a93e6e6f 100644 (file)
@@ -720,6 +720,12 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
       goto reply;
     }
 
+    if (pending_map.stretch_mode_enabled &&
+       name == pending_map.tiebreaker_mon) {
+      err = -EINVAL;
+      ss << "you cannot remove stretch mode's tiebreaker monitor";
+      goto reply;
+    }
     /* At the time of writing, there is no risk of races when multiple clients
      * attempt to use the same name. The reason is simple but may not be
      * obvious.
@@ -751,6 +757,7 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
 
     entity_addrvec_t addrs = pending_map.get_addrs(name);
     pending_map.remove(name);
+    pending_map.disallowed_leaders.erase(name);
     pending_map.last_changed = ceph_clock_now();
     ss << "removing mon." << name << " at " << addrs
        << ", there will be " << pending_map.size() << " monitors" ;
@@ -940,6 +947,7 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
     }
     err = 0;
     pending_map.strategy = strategy;
+    pending_map.last_changed = ceph_clock_now();
     propose = true;
   } else if (prefix == "mon add disallowed_leader") {
     if (!mon.get_quorum_mon_features().contains_all(
@@ -975,6 +983,7 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
       goto reply;
     }
     pending_map.disallowed_leaders.insert(name);
+    pending_map.last_changed = ceph_clock_now();
     err = 0;
     propose = true;
   } else if (prefix == "mon rm disallowed_leader") {
@@ -1006,6 +1015,7 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
       goto reply;
     }
     pending_map.disallowed_leaders.erase(name);
+    pending_map.last_changed = ceph_clock_now();
     err = 0;
     propose = true;
   } else if (prefix == "mon set_location") {
@@ -1026,9 +1036,6 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
       goto reply;
     }
 
-    if (!mon.osdmon()->is_readable()) {
-      mon.osdmon()->wait_for_readable(op, new Monitor::C_RetryMessage(&mon, op));
-    }
     vector<string> argvec;
     map<string, string> loc;
     cmd_getval(cmdmap, "args", argvec);
@@ -1045,11 +1052,88 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op)
     }
     // TODO: validate location against any existing stretch config
     pending_map.mon_info[name].crush_loc = loc;
+    pending_map.last_changed = ceph_clock_now();
+    err = 0;
+    propose = true;
+  } else if (prefix == "mon set_new_tiebreaker") {
+    if (!pending_map.stretch_mode_enabled) {
+      err = -EINVAL;
+      ss << "Stretch mode is not enabled, so there is no tiebreaker";
+      goto reply;
+    }
+    string name;
+    if (!cmd_getval(cmdmap, "name", name)) {
+      err = -EINVAL;
+      goto reply;
+    }
+    bool sure = false;
+    cmd_getval(cmdmap, "yes_i_really_mean_it", sure);
+
+    const auto &existing_tiebreaker_info_i = pending_map.mon_info.find(pending_map.tiebreaker_mon);
+    const auto &new_tiebreaker_info_i = pending_map.mon_info.find(name);
+    if (new_tiebreaker_info_i == pending_map.mon_info.end()) {
+      ss << "mon." << name << " does not exist";
+      err = -ENOENT;
+      goto reply;
+    }
+    const auto& new_info = new_tiebreaker_info_i->second;
+    if (new_info.crush_loc.empty()) {
+      ss << "mon." << name << " does not have a location specified";
+      err = -EINVAL;
+      goto reply;
+    }
+
+    if (!mon.osdmon()->is_readable()) {
+      dout(10) << __func__
+              << ": waiting for osdmon readable to inspect crush barrier"
+              << dendl;
+      mon.osdmon()->wait_for_readable(op, new Monitor::C_RetryMessage(&mon, op));
+      return false;
+    }
+    int32_t stretch_divider_id = mon.osdmon()->osdmap.stretch_mode_bucket;
+    string stretch_bucket_divider = mon.osdmon()->osdmap.crush->
+      get_type_name(stretch_divider_id);
+
+    const auto& new_loc_i = new_info.crush_loc.find(stretch_bucket_divider);
+    if (new_loc_i == new_info.crush_loc.end()) {
+      ss << "mon." << name << " has a specificed location, but not a "
+        << stretch_bucket_divider << ", which is the stretch divider";
+      err = -EINVAL;
+      goto reply;
+    }
+    const string& new_loc = new_loc_i->second;
+    set<string> matching_mons;
+    for (const auto& mii : pending_map.mon_info) {
+      const auto& other_loc_i = mii.second.crush_loc.find(stretch_bucket_divider);
+      if (mii.first == name) {
+       continue;
+      }
+      if (other_loc_i == mii.second.crush_loc.end()) { // huh
+       continue;
+      }
+      const string& other_loc = other_loc_i->second;
+      if (other_loc == new_loc &&
+         mii.first != existing_tiebreaker_info_i->first) {
+       matching_mons.insert(mii.first);
+      }
+    }
+    if (!matching_mons.empty()) {
+      ss << "mon." << name << " has location " << new_loc_i->second
+        << ", which matches mons " << matching_mons << " on the "
+        << stretch_bucket_divider << " dividing bucket for stretch mode. "
+       "Pass --yes-i-really-mean-it if you're sure you want to do this."
+       "(You really don't.)";
+      err = -EINVAL;
+      goto reply;
+    }
+    pending_map.tiebreaker_mon = name;
+    pending_map.disallowed_leaders.insert(name);
+    pending_map.last_changed = ceph_clock_now();
     err = 0;
     propose = true;
   } else if (prefix == "mon enable_stretch_mode") {
     if (!mon.osdmon()->is_writeable()) {
-      dout(1) << __func__
+      dout(10) << __func__
              << ":  waiting for osdmon writeable for stretch mode" << dendl;
       mon.osdmon()->wait_for_writeable(op, new Monitor::C_RetryMessage(&mon, op));
       return false;
index 8e98ef49313ef9e3dd4d4fddb3463027d17d394c..f5dd03295e92add48cf3dd88e199c33e9589ce2b 100644 (file)
@@ -788,24 +788,21 @@ void AsyncMessenger::shutdown_connections(bool queue_reset)
 
   for (const auto& [e, c] : conns) {
     ldout(cct, 5) << __func__ << " mark down " << e << " " << c << dendl;
-    c->get_perf_counter()->dec(l_msgr_active_connections);
     c->stop(queue_reset);
   }
   conns.clear();
 
   for (const auto& c : anon_conns) {
     ldout(cct, 5) << __func__ << " mark down " << c << dendl;
-    c->get_perf_counter()->dec(l_msgr_active_connections);
     c->stop(queue_reset);
   }
   anon_conns.clear();
 
   {
     std::lock_guard l{deleted_lock};
-    if (cct->_conf->subsys.should_gather<ceph_subsys_ms, 5>()) {
-      for (const auto& c : deleted_conns) {
-        ldout(cct, 5) << __func__ << " delete " << c << dendl;
-      }
+    for (const auto& c : deleted_conns) {
+      ldout(cct, 5) << __func__ << " delete " << c << dendl;
+      c->get_perf_counter()->dec(l_msgr_active_connections);
     }
     deleted_conns.clear();
   }
@@ -860,6 +857,7 @@ int AsyncMessenger::accept_conn(const AsyncConnectionRef& conn)
     // If conn already in, we will return 0
     std::lock_guard l{deleted_lock};
     if (deleted_conns.erase(existing)) {
+      it->second->get_perf_counter()->dec(l_msgr_active_connections);
       conns.erase(it);
     } else if (conn != existing) {
       return -1;
@@ -939,6 +937,7 @@ void AsyncMessenger::reap_dead()
         conns.erase(conns_it);
       accepting_conns.erase(c);
       anon_conns.erase(c);
+      c->get_perf_counter()->dec(l_msgr_active_connections);
     }
     deleted_conns.clear();
   }
index e35d02dc42b2d3b6b67aece792cd3f31f17dd306..f1333307dbf25b5fb5aa8eadd9760e0793795834 100644 (file)
@@ -309,6 +309,7 @@ private:
     if (p->second->is_unregistered()) {
       std::lock_guard l{deleted_lock};
       if (deleted_conns.erase(p->second)) {
+       p->second->get_perf_counter()->dec(l_msgr_active_connections);
        conns.erase(p);
        return nullref;
       }
@@ -397,8 +398,6 @@ public:
    */
   void unregister_conn(const AsyncConnectionRef& conn) {
     std::lock_guard l{deleted_lock};
-    if (!accepting_conns.count(conn) || anon_conns.count(conn))
-      conn->get_perf_counter()->dec(l_msgr_active_connections);
     deleted_conns.emplace(std::move(conn));
     conn->unregister();
 
index c9b2d55e1d825c5f3116ae574c1b2d92a2c4cc0f..d2f879954c65df2d736552611a7328ac774e4028 100644 (file)
@@ -1104,6 +1104,7 @@ CtPtr ProtocolV2::handle_read_frame_preamble_main(rx_buffer_t &&buffer, int r) {
       lderr(cct) << __func__ << " not in ready state!" << dendl;
       return _fault();
     }
+    recv_stamp = ceph_clock_now();
     state = THROTTLE_MESSAGE;
     return CONTINUE(throttle_message);
   } else {
@@ -1332,11 +1333,6 @@ CtPtr ProtocolV2::handle_message() {
   ldout(cct, 20) << __func__ << dendl;
   ceph_assert(state == THROTTLE_DONE);
 
-#if defined(WITH_EVENTTRACE)
-  utime_t ltt_recv_stamp = ceph_clock_now();
-#endif
-  recv_stamp = ceph_clock_now();
-
   const size_t cur_msg_size = get_current_msg_size();
   auto msg_frame = MessageFrame::Decode(rx_segments_data);
 
@@ -1425,7 +1421,7 @@ CtPtr ProtocolV2::handle_message() {
       message->get_type() == CEPH_MSG_OSD_OPREPLY) {
     utime_t ltt_processed_stamp = ceph_clock_now();
     double usecs_elapsed =
-        (ltt_processed_stamp.to_nsec() - ltt_recv_stamp.to_nsec()) / 1000;
+        (ltt_processed_stamp.to_nsec() - recv_stamp.to_nsec()) / 1000;
     ostringstream buf;
     if (message->get_type() == CEPH_MSG_OSD_OP)
       OID_ELAPSED_WITH_MSG(message, usecs_elapsed, "TIME_TO_DECODE_OSD_OP",
index 817891bc6f6f45f900c2a9d5b238d3103909c251..4f51b45bcc72ee15c6985aeb760ed7a79802e04a 100755 (executable)
@@ -34,6 +34,9 @@ disallow_untyped_defs = True
 [mypy-devicehealth.*]
 disallow_untyped_defs = True
 
+[mypy-nfs.*]
+disallow_untyped_defs = True
+
 [mypy-orchestrator.*]
 disallow_untyped_defs = True
 
index 16b64636b891e48abfc9c202d352f0c4b60d0628..37a000ac6ef6c96f24c46705137ef9b165ceff43 100644 (file)
@@ -3819,10 +3819,9 @@ void* OriginalVolumeSelector::get_hint_by_dir(std::string_view dirname) const {
     // match up with bluestore.  the slow device is always the second
     // one (when a dedicated block.db device is present and used at
     // bdev 0).  the wal device is always last.
-    if (boost::algorithm::ends_with(dirname, ".slow")) {
+    if (boost::algorithm::ends_with(dirname, ".slow") && slow_total) {
       res = BlueFS::BDEV_SLOW;
-    }
-    else if (boost::algorithm::ends_with(dirname, ".wal")) {
+    } else if (boost::algorithm::ends_with(dirname, ".wal") && wal_total) {
       res = BlueFS::BDEV_WAL;
     }
   }
index ba52666a011df68e89055e552921dd045a9ee488..8b893be79d18f36113ab14fcfe5660f467564b5b 100644 (file)
@@ -275,9 +275,13 @@ static const char *_key_decode_shard(const char *key, shard_id_t *pshard)
 
 static void get_coll_range(const coll_t& cid, int bits,
   ghobject_t *temp_start, ghobject_t *temp_end,
-  ghobject_t *start, ghobject_t *end)
+  ghobject_t *start, ghobject_t *end, bool legacy)
 {
   spg_t pgid;
+  constexpr uint32_t MAX_HASH = std::numeric_limits<uint32_t>::max();
+  // use different nspaces due to we use different schemes when encoding
+  // keys for listing objects
+  const std::string_view MAX_NSPACE = legacy ? "\x7f" : "\xff";
   if (cid.is_pg(&pgid)) {
     start->shard_id = pgid.shard;
     *temp_start = *start;
@@ -293,19 +297,23 @@ static void get_coll_range(const coll_t& cid, int bits,
     temp_start->hobj.set_bitwise_key_u32(reverse_hash);
 
     uint64_t end_hash = reverse_hash  + (1ull << (32 - bits));
-    if (end_hash > 0xffffffffull)
-      end_hash = 0xffffffffull;
-
-    end->hobj.set_bitwise_key_u32(end_hash);
-    temp_end->hobj.set_bitwise_key_u32(end_hash);
+    if (end_hash > MAX_HASH) {
+      // make sure end hobj is even greater than the maximum possible hobj
+      end->hobj.set_bitwise_key_u32(MAX_HASH);
+      temp_end->hobj.set_bitwise_key_u32(MAX_HASH);
+      end->hobj.nspace = MAX_NSPACE;
+    } else {
+      end->hobj.set_bitwise_key_u32(end_hash);
+      temp_end->hobj.set_bitwise_key_u32(end_hash);
+    }
   } else {
     start->shard_id = shard_id_t::NO_SHARD;
     start->hobj.pool = -1ull;
 
     *end = *start;
     start->hobj.set_bitwise_key_u32(0);
-    end->hobj.set_bitwise_key_u32(0xffffffff);
-
+    end->hobj.set_bitwise_key_u32(MAX_HASH);
+    end->hobj.nspace = MAX_NSPACE;
     // no separate temp section
     *temp_start = *end;
     *temp_end = *end;
@@ -6247,9 +6255,10 @@ void BlueStore::_set_per_pool_omap()
     auto s = bl.to_str();
     if (s == stringify(OMAP_PER_POOL)) {
       per_pool_omap = OMAP_PER_POOL;
-    } else {
-      ceph_assert(s == stringify(OMAP_PER_PG));
+    } else if (s == stringify(OMAP_PER_PG)) {
       per_pool_omap = OMAP_PER_PG;
+    } else {
+      ceph_assert(s == stringify(OMAP_BULK));
     }
     dout(10) << __func__ << " per_pool_omap = " << per_pool_omap << dendl;
   } else {
@@ -6552,7 +6561,11 @@ int BlueStore::mkfs()
     }
     {
       bufferlist bl;
-      bl.append(stringify(OMAP_PER_PG));
+      if (cct->_conf.get_val<bool>("bluestore_debug_legacy_omap")) {
+       bl.append(stringify(OMAP_BULK));
+      } else {
+       bl.append(stringify(OMAP_PER_PG));
+      }
       t->set(PREFIX_SUPER, "per_pool_omap", bl);
     }
     ondisk_format = latest_ondisk_format;
@@ -7850,6 +7863,7 @@ void BlueStore::_fsck_check_object_omap(FSCKDepth depth,
          txn->set(new_omap_prefix, new_head, header);
          txn_cost += new_head.length() + header.length();
        }
+       it->next();
       }
       // tail
       {
@@ -7870,7 +7884,7 @@ void BlueStore::_fsck_check_object_omap(FSCKDepth depth,
          << " -> " << user_key << dendl;
 
        final_key.resize(base_key_len);
-       final_key += it->key();
+       final_key += user_key;
        auto v = it->value();
        txn->set(new_omap_prefix, final_key, v);
        txn_cost += final_key.length() + v.length();
@@ -8453,9 +8467,9 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
          expected_statfs = &expected_pool_statfs[sbi.pool_id];
        }
        errors += _fsck_check_extents(sbi.cid,
-                                     p->second.oids.front(),
+                                     sbi.oids.front(),
                                      extents,
-                                     p->second.compressed,
+                                     sbi.compressed,
                                      used_blocks,
                                      fm->get_alloc_size(),
                                      repair ? &repairer : nullptr,
@@ -8561,7 +8575,9 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
          pext_to_release.reserve(pextents.size());
          // rewriting all valid pextents
          for (auto e = pextents.begin(); e != pextents.end();
-                b_off += e->length, e++) {
+                e++) {
+           auto b_off_cur = b_off;
+           b_off += e->length;
            if (!e->is_valid()) {
              continue;
            }
@@ -8599,7 +8615,8 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
            e = pextents.erase(e);
            e = pextents.insert(e, exts.begin(), exts.end());
            b->get_blob().map_bl(
-             b_off, bl,
+             b_off_cur,
+             bl,
              [&](uint64_t offset, bufferlist& t) {
                int r = bdev->write(offset, t, false);
                ceph_assert(r == 0);
@@ -8681,9 +8698,32 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
          bluestore_shared_blob_t persistent(sbid, std::move(sbi.ref_map));
          encode(persistent, bl);
          dout(20) << __func__ << " " << *sbi.sb
-                  << " is " << bl.length() << " bytes, updating" << dendl;
+                  << " is " << bl.length() << " bytes, updating"
+                  << dendl;
 
          repairer.fix_shared_blob(db, sbid, &bl);
+         // we need to account for shared blob pextents at both
+         // stats and used blocks to avoid related errors.
+         PExtentVector extents;
+         for (auto& r : persistent.ref_map.ref_map) {
+           extents.emplace_back(bluestore_pextent_t(r.first, r.second.length));
+         }
+         auto* expected_statfs = &expected_pool_statfs[sbi.pool_id];
+         int errors = _fsck_check_extents(sbi.cid,
+           ghobject_t(), // doesn't matter
+           extents,
+           sbi.compressed,
+           used_blocks,
+           fm->get_alloc_size(),
+           nullptr,
+           *expected_statfs,
+           depth);
+         if (errors) {
+           derr << __func__ << " " << errors
+                << "  unexpected error(s) after missed shared blob repair,"
+                << " perhaps worth one more repair attempt"
+                << dendl;
+         }
         }
       }
     }
@@ -8937,6 +8977,23 @@ void BlueStore::inject_broken_shared_blob_key(const string& key,
   db->submit_transaction_sync(txn);
 };
 
+void BlueStore::inject_no_shared_blob_key()
+{
+  KeyValueDB::Transaction txn;
+  txn = db->get_transaction();
+  ceph_assert(blobid_last > 0);
+  // kill the last used sbid, this can be broken due to blobid preallocation
+  // in rare cases, leaving as-is for the sake of simplicity
+  uint64_t sbid = blobid_last;
+
+  string key;
+  dout(5) << __func__<< " " << sbid << dendl;
+  get_shared_blob_key(sbid, &key);
+  txn->rmkey(PREFIX_SHARED_BLOB, key);
+  db->submit_transaction_sync(txn);
+};
+
+
 void BlueStore::inject_leaked(uint64_t len)
 {
   KeyValueDB::Transaction txn;
@@ -9119,6 +9176,23 @@ void BlueStore::inject_zombie_spanning_blob(coll_t cid, ghobject_t oid,
   db->submit_transaction_sync(txn);
 }
 
+void BlueStore::inject_bluefs_file(std::string_view dir, std::string_view name, size_t new_size)
+{
+  ceph_assert(bluefs);
+
+  BlueFS::FileWriter* p_handle = nullptr;
+  auto ret = bluefs->open_for_write(dir, name, &p_handle, false);
+  ceph_assert(ret == 0);
+
+  std::string s('0', new_size);
+  bufferlist bl;
+  bl.append(s);
+  p_handle->append(bl);
+
+  bluefs->fsync(p_handle);
+  bluefs->close_writer(p_handle);
+}
+
 void BlueStore::collect_metadata(map<string,string> *pm)
 {
   dout(10) << __func__ << dendl;
@@ -10545,24 +10619,39 @@ int BlueStore::_collection_list(
   if (!c->exists)
     return -ENOENT;
 
-  auto start_time = mono_clock::now();
-  int r = 0;
   ghobject_t static_next;
   std::unique_ptr<CollectionListIterator> it;
   ghobject_t coll_range_temp_start, coll_range_temp_end;
   ghobject_t coll_range_start, coll_range_end;
-  bool set_next = false;
   ghobject_t pend;
   bool temp;
 
   if (!pnext)
     pnext = &static_next;
 
+  auto log_latency = make_scope_guard(
+    [&, start_time = mono_clock::now(), func_name = __func__] {
+    log_latency_fn(
+      func_name,
+      l_bluestore_remove_lat,
+      mono_clock::now() - start_time,
+      cct->_conf->bluestore_log_collection_list_age,
+      [&](const ceph::timespan& lat) {
+       ostringstream ostr;
+       ostr << ", lat = " << timespan_str(lat)
+            << " cid =" << c->cid
+            << " start " << start << " end " << end
+            << " max " << max;
+       return ostr.str();
+      });
+  });
+
   if (start.is_max() || start.hobj.is_max()) {
-    goto out;
+    *pnext = ghobject_t::get_max();
+    return 0;
   }
   get_coll_range(c->cid, c->cnode.bits, &coll_range_temp_start,
-                 &coll_range_temp_end, &coll_range_start, &coll_range_end);
+                 &coll_range_temp_end, &coll_range_start, &coll_range_end, legacy);
   dout(20) << __func__
     << " range " << coll_range_temp_start
     << " to " << coll_range_temp_end
@@ -10596,10 +10685,12 @@ int BlueStore::_collection_list(
     pend = temp ? coll_range_temp_end : coll_range_end;
   } else {
     if (end.hobj.is_temp()) {
-      if (temp)
+      if (temp) {
         pend = end;
-      else
-        goto out;
+      } else {
+        *pnext = ghobject_t::get_max();
+        return 0;
+      }
     } else {
       pend = temp ? coll_range_temp_end : end;
     }
@@ -10615,7 +10706,7 @@ int BlueStore::_collection_list(
        if (end.hobj.is_temp()) {
           if (it->valid() && it->is_lt(coll_range_temp_end)) {
             *pnext = it->oid();
-            set_next = true;
+            return 0;
           }
          break;
        }
@@ -10631,7 +10722,7 @@ int BlueStore::_collection_list(
       }
       if (it->valid() && it->is_lt(coll_range_end)) {
         *pnext = it->oid();
-        set_next = true;
+        return 0;
       }
       break;
     }
@@ -10639,31 +10730,13 @@ int BlueStore::_collection_list(
     if (ls->size() >= (unsigned)max) {
       dout(20) << __func__ << " reached max " << max << dendl;
       *pnext = it->oid();
-      set_next = true;
-      break;
+      return 0;
     }
     ls->push_back(it->oid());
     it->next();
   }
-out:
-  if (!set_next) {
-    *pnext = ghobject_t::get_max();
-  }
-  log_latency_fn(
-    __func__,
-    l_bluestore_clist_lat,
-    mono_clock::now() - start_time,
-    cct->_conf->bluestore_log_collection_list_age,
-    [&] (const ceph::timespan& lat) {
-      ostringstream ostr;
-      ostr << ", lat = " << timespan_str(lat)
-           << " cid =" << c->cid
-           << " start " << start << " end " << end
-           << " max " << max;
-      return ostr.str();
-    }
-  );
-  return r;
+  *pnext = ghobject_t::get_max();
+  return 0;
 }
 
 int BlueStore::omap_get(
@@ -13359,7 +13432,7 @@ void BlueStore::_do_write_small(
                                    end_offs - offset + head_pad + tail_pad);
        }
        if (head_pad &&
-           o->extent_map.has_any_lextents(offset - head_pad, chunk_size)) {
+           o->extent_map.has_any_lextents(offset - head_pad, head_pad)) {
          head_pad = 0;
        }
        if (tail_pad && o->extent_map.has_any_lextents(end_offs, tail_pad)) {
@@ -16478,8 +16551,13 @@ uint8_t RocksDBBlueFSVolumeSelector::select_prefer_bdev(void* h) {
 
 void RocksDBBlueFSVolumeSelector::get_paths(const std::string& base, paths& res) const
 {
-  res.emplace_back(base, l_totals[LEVEL_DB - LEVEL_FIRST]);
-  res.emplace_back(base + ".slow", l_totals[LEVEL_SLOW - LEVEL_FIRST]);
+  auto db_size = l_totals[LEVEL_DB - LEVEL_FIRST];
+  res.emplace_back(base, db_size);
+  auto slow_size = l_totals[LEVEL_SLOW - LEVEL_FIRST];
+  if (slow_size == 0) {
+    slow_size = db_size;
+  }
+  res.emplace_back(base + ".slow", slow_size);
 }
 
 void* RocksDBBlueFSVolumeSelector::get_hint_by_dir(std::string_view dirname) const {
index 0690717c8b4b48b9c86eb13c937eae573f8381bd..0a5c451e5602662c3571760b8f3ce180ab5083c2 100644 (file)
@@ -3009,6 +3009,8 @@ public:
   /// methods to inject various errors fsck can repair
   void inject_broken_shared_blob_key(const std::string& key,
                         const ceph::buffer::list& bl);
+  void inject_no_shared_blob_key();
+
   void inject_leaked(uint64_t len);
   void inject_false_free(coll_t cid, ghobject_t oid);
   void inject_statfs(const std::string& key, const store_statfs_t& new_statfs);
@@ -3022,6 +3024,10 @@ public:
   // resets per_pool_omap | pgmeta_omap for onode
   void inject_legacy_omap(coll_t cid, ghobject_t oid);
 
+  void inject_bluefs_file(std::string_view dir,
+                         std::string_view name,
+                         size_t new_size);
+
   void compact() override {
     ceph_assert(db);
     db->compact();
index 70b6d734f4ba413a916c3feaa21e9264477e5c27..b13a99fbc9c575e8613e08213efbcdc5bbe469b8 100644 (file)
@@ -604,7 +604,16 @@ void ECBackend::continue_recovery_op(
       if (op.recovery_progress.first && op.obc) {
        /* We've got the attrs and the hinfo, might as well use them */
        op.hinfo = get_hash_info(op.hoid);
-       ceph_assert(op.hinfo);
+       if (!op.hinfo) {
+          derr << __func__ << ": " << op.hoid << " has inconsistent hinfo"
+               << dendl;
+          ceph_assert(recovery_ops.count(op.hoid));
+          eversion_t v = recovery_ops[op.hoid].v;
+          recovery_ops.erase(op.hoid);
+          get_parent()->on_failed_pull({get_parent()->whoami_shard()},
+                                       op.hoid, v);
+          return;
+        }
        op.xattrs = op.obc->attr_cache;
        encode(*(op.hinfo), op.xattrs[ECUtil::get_hinfo_key()]);
       }
@@ -1817,7 +1826,7 @@ void ECBackend::do_read_op(ReadOp &op)
 }
 
 ECUtil::HashInfoRef ECBackend::get_hash_info(
-  const hobject_t &hoid, bool checks, const map<string,bufferptr> *attrs)
+  const hobject_t &hoid, bool create, const map<string,bufferptr> *attrs)
 {
   dout(10) << __func__ << ": Getting attr on " << hoid << dendl;
   ECUtil::HashInfoRef ref = unstable_hashinfo_registry.lookup(hoid);
@@ -1829,7 +1838,6 @@ ECUtil::HashInfoRef ECBackend::get_hash_info(
       ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard),
       &st);
     ECUtil::HashInfo hinfo(ec_impl->get_chunk_count());
-    // XXX: What does it mean if there is no object on disk?
     if (r >= 0) {
       dout(10) << __func__ << ": found on disk, size " << st.st_size << dendl;
       bufferlist bl;
@@ -1859,7 +1867,7 @@ ECUtil::HashInfoRef ECBackend::get_hash_info(
          dout(0) << __func__ << ": Can't decode hinfo for " << hoid << dendl;
          return ECUtil::HashInfoRef();
         }
-       if (checks && hinfo.get_total_chunk_size() != (uint64_t)st.st_size) {
+       if (hinfo.get_total_chunk_size() != (uint64_t)st.st_size) {
          dout(0) << __func__ << ": Mismatch of total_chunk_size "
                               << hinfo.get_total_chunk_size() << dendl;
          return ECUtil::HashInfoRef();
@@ -1867,6 +1875,10 @@ ECUtil::HashInfoRef ECBackend::get_hash_info(
       } else if (st.st_size > 0) { // If empty object and no hinfo, create it
        return ECUtil::HashInfoRef();
       }
+    } else if (r != -ENOENT || !create) {
+      derr << __func__ << ": stat " << hoid << " failed: " << cpp_strerror(r)
+           << dendl;
+      return ECUtil::HashInfoRef();
     }
     ref = unstable_hashinfo_registry.lookup_or_create(hoid, hinfo);
   }
@@ -1881,7 +1893,7 @@ void ECBackend::start_rmw(Op *op, PGTransactionUPtr &&t)
     sinfo,
     std::move(t),
     [&](const hobject_t &i) {
-      ECUtil::HashInfoRef ref = get_hash_info(i, false);
+      ECUtil::HashInfoRef ref = get_hash_info(i, true);
       if (!ref) {
        derr << __func__ << ": get_hash_info(" << i << ")"
             << " returned a null pointer and there is no "
@@ -2578,7 +2590,11 @@ int ECBackend::be_deep_scrub(
     return 0;
   } else {
     if (!get_parent()->get_pool().allows_ecoverwrites()) {
-      ceph_assert(hinfo->has_chunk_hash());
+      if (!hinfo->has_chunk_hash()) {
+        dout(0) << "_scan_list  " << poid << " got invalid hash info" << dendl;
+        o.ec_size_mismatch = true;
+        return 0;
+      }
       if (hinfo->get_total_chunk_size() != (unsigned)pos.data_pos) {
        dout(0) << "_scan_list  " << poid << " got incorrect size on read 0x"
                << std::hex << pos
index c39de1bfeeb87b311da1d41d7607c9da75567d3b..45495376a2914fb07bb0d156deb46fa33a28ae63 100644 (file)
@@ -629,7 +629,7 @@ public:
   const ECUtil::stripe_info_t sinfo;
   /// If modified, ensure that the ref is held until the update is applied
   SharedPtrRegistry<hobject_t, ECUtil::HashInfo> unstable_hashinfo_registry;
-  ECUtil::HashInfoRef get_hash_info(const hobject_t &hoid, bool checks = true,
+  ECUtil::HashInfoRef get_hash_info(const hobject_t &hoid, bool create = false,
                                    const std::map<std::string, ceph::buffer::ptr> *attr = NULL);
 
 public:
index f580fb6f5645280c7357ade9585e2e64677f1340..8dceddae384c4614adeccdb83057f7ce3c9070f6 100644 (file)
@@ -2101,6 +2101,7 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, uuid_d fsid, int whoami, str
           << "queue_transaction returned " << cpp_strerror(ret) << dendl;
       goto umount_store;
     }
+    ch->flush();
   }
 
   ret = write_meta(cct, store, sb.cluster_fsid, sb.osd_fsid, whoami, osdspec_affinity);
@@ -2323,9 +2324,6 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
       this);
     shards.push_back(one_shard);
   }
-
-  // override some config options if mclock is enabled on all the shards
-  maybe_override_options_for_qos();
 }
 
 OSD::~OSD()
@@ -2833,137 +2831,13 @@ will start to track new ops received afterwards.";
     cmd_getval(cmdmap, "size", bsize, (int64_t)4 << 20);
     cmd_getval(cmdmap, "object_size", osize, (int64_t)0);
     cmd_getval(cmdmap, "object_num", onum, (int64_t)0);
+    double elapsed = 0.0;
 
-    uint32_t duration = cct->_conf->osd_bench_duration;
-
-    if (bsize > (int64_t) cct->_conf->osd_bench_max_block_size) {
-      // let us limit the block size because the next checks rely on it
-      // having a sane value.  If we allow any block size to be set things
-      // can still go sideways.
-      ss << "block 'size' values are capped at "
-         << byte_u_t(cct->_conf->osd_bench_max_block_size) << ". If you wish to use"
-         << " a higher value, please adjust 'osd_bench_max_block_size'";
-      ret = -EINVAL;
+    ret = run_osd_bench_test(count, bsize, osize, onum, &elapsed, ss);
+    if (ret != 0) {
       goto out;
-    } else if (bsize < (int64_t) (1 << 20)) {
-      // entering the realm of small block sizes.
-      // limit the count to a sane value, assuming a configurable amount of
-      // IOPS and duration, so that the OSD doesn't get hung up on this,
-      // preventing timeouts from going off
-      int64_t max_count =
-        bsize * duration * cct->_conf->osd_bench_small_size_max_iops;
-      if (count > max_count) {
-        ss << "'count' values greater than " << max_count
-           << " for a block size of " << byte_u_t(bsize) << ", assuming "
-           << cct->_conf->osd_bench_small_size_max_iops << " IOPS,"
-           << " for " << duration << " seconds,"
-           << " can cause ill effects on osd. "
-           << " Please adjust 'osd_bench_small_size_max_iops' with a higher"
-           << " value if you wish to use a higher 'count'.";
-        ret = -EINVAL;
-        goto out;
-      }
-    } else {
-      // 1MB block sizes are big enough so that we get more stuff done.
-      // However, to avoid the osd from getting hung on this and having
-      // timers being triggered, we are going to limit the count assuming
-      // a configurable throughput and duration.
-      // NOTE: max_count is the total amount of bytes that we believe we
-      //       will be able to write during 'duration' for the given
-      //       throughput.  The block size hardly impacts this unless it's
-      //       way too big.  Given we already check how big the block size
-      //       is, it's safe to assume everything will check out.
-      int64_t max_count =
-        cct->_conf->osd_bench_large_size_max_throughput * duration;
-      if (count > max_count) {
-        ss << "'count' values greater than " << max_count
-           << " for a block size of " << byte_u_t(bsize) << ", assuming "
-           << byte_u_t(cct->_conf->osd_bench_large_size_max_throughput) << "/s,"
-           << " for " << duration << " seconds,"
-           << " can cause ill effects on osd. "
-           << " Please adjust 'osd_bench_large_size_max_throughput'"
-           << " with a higher value if you wish to use a higher 'count'.";
-        ret = -EINVAL;
-        goto out;
-      }
-    }
-
-    if (osize && bsize > osize)
-      bsize = osize;
-
-    dout(1) << " bench count " << count
-            << " bsize " << byte_u_t(bsize) << dendl;
-
-    ObjectStore::Transaction cleanupt;
-
-    if (osize && onum) {
-      bufferlist bl;
-      bufferptr bp(osize);
-      bp.zero();
-      bl.push_back(std::move(bp));
-      bl.rebuild_page_aligned();
-      for (int i=0; i<onum; ++i) {
-       char nm[30];
-       snprintf(nm, sizeof(nm), "disk_bw_test_%d", i);
-       object_t oid(nm);
-       hobject_t soid(sobject_t(oid, 0));
-       ObjectStore::Transaction t;
-       t.write(coll_t(), ghobject_t(soid), 0, osize, bl);
-       store->queue_transaction(service.meta_ch, std::move(t), NULL);
-       cleanupt.remove(coll_t(), ghobject_t(soid));
-      }
-    }
-
-    bufferlist bl;
-    bufferptr bp(bsize);
-    bp.zero();
-    bl.push_back(std::move(bp));
-    bl.rebuild_page_aligned();
-
-    {
-      C_SaferCond waiter;
-      if (!service.meta_ch->flush_commit(&waiter)) {
-       waiter.wait();
-      }
-    }
-
-    utime_t start = ceph_clock_now();
-    for (int64_t pos = 0; pos < count; pos += bsize) {
-      char nm[30];
-      unsigned offset = 0;
-      if (onum && osize) {
-       snprintf(nm, sizeof(nm), "disk_bw_test_%d", (int)(rand() % onum));
-       offset = rand() % (osize / bsize) * bsize;
-      } else {
-       snprintf(nm, sizeof(nm), "disk_bw_test_%lld", (long long)pos);
-      }
-      object_t oid(nm);
-      hobject_t soid(sobject_t(oid, 0));
-      ObjectStore::Transaction t;
-      t.write(coll_t::meta(), ghobject_t(soid), offset, bsize, bl);
-      store->queue_transaction(service.meta_ch, std::move(t), NULL);
-      if (!onum || !osize)
-       cleanupt.remove(coll_t::meta(), ghobject_t(soid));
-    }
-
-    {
-      C_SaferCond waiter;
-      if (!service.meta_ch->flush_commit(&waiter)) {
-       waiter.wait();
-      }
-    }
-    utime_t end = ceph_clock_now();
-
-    // clean up
-    store->queue_transaction(service.meta_ch, std::move(cleanupt), NULL);
-    {
-      C_SaferCond waiter;
-      if (!service.meta_ch->flush_commit(&waiter)) {
-       waiter.wait();
-      }
     }
 
-    double elapsed = end - start;
     double rate = count / elapsed;
     double iops = rate / bsize;
     f->open_object_section("osd_bench_results");
@@ -3218,6 +3092,150 @@ will start to track new ops received afterwards.";
   on_finish(ret, ss.str(), outbl);
 }
 
+int OSD::run_osd_bench_test(
+  int64_t count,
+  int64_t bsize,
+  int64_t osize,
+  int64_t onum,
+  double *elapsed,
+  ostream &ss)
+{
+  int ret = 0;
+  uint32_t duration = cct->_conf->osd_bench_duration;
+
+  if (bsize > (int64_t) cct->_conf->osd_bench_max_block_size) {
+    // let us limit the block size because the next checks rely on it
+    // having a sane value.  If we allow any block size to be set things
+    // can still go sideways.
+    ss << "block 'size' values are capped at "
+       << byte_u_t(cct->_conf->osd_bench_max_block_size) << ". If you wish to use"
+       << " a higher value, please adjust 'osd_bench_max_block_size'";
+    ret = -EINVAL;
+    return ret;
+  } else if (bsize < (int64_t) (1 << 20)) {
+    // entering the realm of small block sizes.
+    // limit the count to a sane value, assuming a configurable amount of
+    // IOPS and duration, so that the OSD doesn't get hung up on this,
+    // preventing timeouts from going off
+    int64_t max_count =
+      bsize * duration * cct->_conf->osd_bench_small_size_max_iops;
+    if (count > max_count) {
+      ss << "'count' values greater than " << max_count
+         << " for a block size of " << byte_u_t(bsize) << ", assuming "
+         << cct->_conf->osd_bench_small_size_max_iops << " IOPS,"
+         << " for " << duration << " seconds,"
+         << " can cause ill effects on osd. "
+         << " Please adjust 'osd_bench_small_size_max_iops' with a higher"
+         << " value if you wish to use a higher 'count'.";
+      ret = -EINVAL;
+      return ret;
+    }
+  } else {
+    // 1MB block sizes are big enough so that we get more stuff done.
+    // However, to avoid the osd from getting hung on this and having
+    // timers being triggered, we are going to limit the count assuming
+    // a configurable throughput and duration.
+    // NOTE: max_count is the total amount of bytes that we believe we
+    //       will be able to write during 'duration' for the given
+    //       throughput.  The block size hardly impacts this unless it's
+    //       way too big.  Given we already check how big the block size
+    //       is, it's safe to assume everything will check out.
+    int64_t max_count =
+      cct->_conf->osd_bench_large_size_max_throughput * duration;
+    if (count > max_count) {
+      ss << "'count' values greater than " << max_count
+         << " for a block size of " << byte_u_t(bsize) << ", assuming "
+         << byte_u_t(cct->_conf->osd_bench_large_size_max_throughput) << "/s,"
+         << " for " << duration << " seconds,"
+         << " can cause ill effects on osd. "
+         << " Please adjust 'osd_bench_large_size_max_throughput'"
+         << " with a higher value if you wish to use a higher 'count'.";
+      ret = -EINVAL;
+      return ret;
+    }
+  }
+
+  if (osize && bsize > osize) {
+    bsize = osize;
+  }
+
+  dout(1) << " bench count " << count
+          << " bsize " << byte_u_t(bsize) << dendl;
+
+  ObjectStore::Transaction cleanupt;
+
+  if (osize && onum) {
+    bufferlist bl;
+    bufferptr bp(osize);
+    bp.zero();
+    bl.push_back(std::move(bp));
+    bl.rebuild_page_aligned();
+    for (int i=0; i<onum; ++i) {
+      char nm[30];
+      snprintf(nm, sizeof(nm), "disk_bw_test_%d", i);
+      object_t oid(nm);
+      hobject_t soid(sobject_t(oid, 0));
+      ObjectStore::Transaction t;
+      t.write(coll_t(), ghobject_t(soid), 0, osize, bl);
+      store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+      cleanupt.remove(coll_t(), ghobject_t(soid));
+    }
+  }
+
+  bufferlist bl;
+  bufferptr bp(bsize);
+  bp.zero();
+  bl.push_back(std::move(bp));
+  bl.rebuild_page_aligned();
+
+  {
+    C_SaferCond waiter;
+    if (!service.meta_ch->flush_commit(&waiter)) {
+      waiter.wait();
+    }
+  }
+
+  utime_t start = ceph_clock_now();
+  for (int64_t pos = 0; pos < count; pos += bsize) {
+    char nm[30];
+    unsigned offset = 0;
+    if (onum && osize) {
+      snprintf(nm, sizeof(nm), "disk_bw_test_%d", (int)(rand() % onum));
+      offset = rand() % (osize / bsize) * bsize;
+    } else {
+      snprintf(nm, sizeof(nm), "disk_bw_test_%lld", (long long)pos);
+    }
+    object_t oid(nm);
+    hobject_t soid(sobject_t(oid, 0));
+    ObjectStore::Transaction t;
+    t.write(coll_t::meta(), ghobject_t(soid), offset, bsize, bl);
+    store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+    if (!onum || !osize) {
+      cleanupt.remove(coll_t::meta(), ghobject_t(soid));
+    }
+  }
+
+  {
+    C_SaferCond waiter;
+    if (!service.meta_ch->flush_commit(&waiter)) {
+      waiter.wait();
+    }
+  }
+  utime_t end = ceph_clock_now();
+  *elapsed = end - start;
+
+  // clean up
+  store->queue_transaction(service.meta_ch, std::move(cleanupt), nullptr);
+  {
+    C_SaferCond waiter;
+    if (!service.meta_ch->flush_commit(&waiter)) {
+      waiter.wait();
+    }
+  }
+
+ return ret;
+}
+
 class TestOpsSocketHook : public AdminSocketHook {
   OSDService *service;
   ObjectStore *store;
@@ -3767,6 +3785,10 @@ int OSD::init()
 
   start_boot();
 
+  // Override a few options if mclock scheduler is enabled.
+  maybe_override_max_osd_capacity_for_qos();
+  maybe_override_options_for_qos();
+
   return 0;
 
 out:
@@ -10084,6 +10106,92 @@ void OSD::handle_conf_change(const ConfigProxy& conf,
   }
 }
 
+void OSD::maybe_override_max_osd_capacity_for_qos()
+{
+  // If the scheduler enabled is mclock, override the default
+  // osd capacity with the value obtained from running the
+  // osd bench test. This is later used to setup mclock.
+  if ((cct->_conf.get_val<std::string>("osd_op_queue") == "mclock_scheduler") &&
+      (cct->_conf.get_val<bool>("osd_mclock_skip_benchmark") == false)) {
+    std::string max_capacity_iops_config;
+    bool force_run_benchmark =
+      cct->_conf.get_val<bool>("osd_mclock_force_run_benchmark_on_init");
+
+    if (store_is_rotational) {
+      max_capacity_iops_config = "osd_mclock_max_capacity_iops_hdd";
+    } else {
+      max_capacity_iops_config = "osd_mclock_max_capacity_iops_ssd";
+    }
+
+    if (!force_run_benchmark) {
+      double default_iops = 0.0;
+
+      // Get the current osd iops capacity
+      double cur_iops = cct->_conf.get_val<double>(max_capacity_iops_config);
+
+      // Get the default max iops capacity
+      auto val = cct->_conf.get_val_default(max_capacity_iops_config);
+      if (!val.has_value()) {
+        derr << __func__ << " Unable to determine default value of "
+            << max_capacity_iops_config << dendl;
+        // Cannot determine default iops. Force a run of the OSD benchmark.
+        force_run_benchmark = true;
+      } else {
+        // Default iops
+        default_iops = std::stod(val.value());
+      }
+
+      // Determine if we really need to run the osd benchmark
+      if (!force_run_benchmark && (default_iops != cur_iops)) {
+        dout(1) << __func__ << std::fixed << std::setprecision(2)
+                << " default_iops: " << default_iops
+                << " cur_iops: " << cur_iops
+                << ". Skip OSD benchmark test." << dendl;
+        return;
+      }
+    }
+
+    // Run osd bench: write 100 4MiB objects with blocksize 4KiB
+    int64_t count = 12288000; // Count of bytes to write
+    int64_t bsize = 4096;     // Block size
+    int64_t osize = 4194304;  // Object size
+    int64_t onum = 100;       // Count of objects to write
+    double elapsed = 0.0;     // Time taken to complete the test
+    double iops = 0.0;
+    stringstream ss;
+    int ret = run_osd_bench_test(count, bsize, osize, onum, &elapsed, ss);
+    if (ret != 0) {
+      derr << __func__
+           << " osd bench err: " << ret
+           << " osd bench errstr: " << ss.str()
+           << dendl;
+      return;
+    }
+
+    double rate = count / elapsed;
+    iops = rate / bsize;
+    dout(1) << __func__
+            << " osd bench result -"
+            << std::fixed << std::setprecision(3)
+            << " bandwidth (MiB/sec): " << rate / (1024 * 1024)
+            << " iops: " << iops
+            << " elapsed_sec: " << elapsed
+            << dendl;
+
+    // Persist iops to the MON store
+    ret = mon_cmd_set_config(max_capacity_iops_config, std::to_string(iops));
+    if (ret < 0) {
+      // Fallback to setting the config within the in-memory "values" map.
+      cct->_conf.set_val(max_capacity_iops_config, std::to_string(iops));
+    }
+
+    // Override the max osd capacity for all shards
+    for (auto& shard : shards) {
+      shard->update_scheduler_config();
+    }
+  }
+}
+
 bool OSD::maybe_override_options_for_qos()
 {
   // If the scheduler enabled is mclock, override the recovery, backfill
@@ -10132,6 +10240,32 @@ bool OSD::maybe_override_options_for_qos()
   return false;
 }
 
+int OSD::mon_cmd_set_config(const std::string &key, const std::string &val)
+{
+  std::string cmd =
+    "{"
+      "\"prefix\": \"config set\", "
+      "\"who\": \"osd." + std::to_string(whoami) + "\", "
+      "\"name\": \"" + key + "\", "
+      "\"value\": \"" + val + "\""
+    "}";
+
+  vector<std::string> vcmd{cmd};
+  bufferlist inbl;
+  std::string outs;
+  C_SaferCond cond;
+  monc->start_mon_command(vcmd, inbl, nullptr, &outs, &cond);
+  int r = cond.wait();
+  if (r < 0) {
+    derr << __func__ << " Failed to set config key " << key
+         << " err: " << cpp_strerror(r)
+         << " errstr: " << outs << dendl;
+    return r;
+  }
+
+  return 0;
+}
+
 void OSD::update_log_config()
 {
   map<string,string> log_to_monitors;
@@ -10632,6 +10766,12 @@ void OSDShard::unprime_split_children(spg_t parent, unsigned old_pg_num)
   }
 }
 
+void OSDShard::update_scheduler_config()
+{
+  std::lock_guard l(shard_lock);
+  scheduler->update_configuration();
+}
+
 OSDShard::OSDShard(
   int id,
   CephContext *cct,
@@ -10768,12 +10908,17 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
       std::unique_lock wait_lock{sdata->sdata_wait_lock};
       auto future_time = ceph::real_clock::from_double(*when_ready);
       dout(10) << __func__ << " dequeue future request at " << future_time << dendl;
+      // Disable heartbeat timeout until we find a non-future work item to process.
+      osd->cct->get_heartbeat_map()->clear_timeout(hb);
       sdata->shard_lock.unlock();
       ++sdata->waiting_threads;
       sdata->sdata_cond.wait_until(wait_lock, future_time);
       --sdata->waiting_threads;
       wait_lock.unlock();
       sdata->shard_lock.lock();
+      // Reapply default wq timeouts
+      osd->cct->get_heartbeat_map()->reset_timeout(hb,
+        timeout_interval, suicide_interval);
     }
   } // while
 
index ed1fbcff1d4b9bcf41f3683a76e325b26962731b..a39800fa0cb3d86a197cbdf4ad5400dae2f4a50c 100644 (file)
@@ -1079,6 +1079,7 @@ struct OSDShard {
                    std::set<std::pair<spg_t,epoch_t>> *merge_pgs);
   void register_and_wake_split_child(PG *pg);
   void unprime_split_children(spg_t parent, unsigned old_pg_num);
+  void update_scheduler_config();
 
   OSDShard(
     int id,
@@ -2062,7 +2063,15 @@ private:
   float get_osd_snap_trim_sleep();
 
   int get_recovery_max_active();
+  void maybe_override_max_osd_capacity_for_qos();
   bool maybe_override_options_for_qos();
+  int run_osd_bench_test(int64_t count,
+                         int64_t bsize,
+                         int64_t osize,
+                         int64_t onum,
+                         double *elapsed,
+                         std::ostream& ss);
+  int mon_cmd_set_config(const std::string &key, const std::string &val);
 
   void scrub_purged_snaps();
   void probe_smart(const std::string& devid, std::ostream& ss);
index 98b4c3e1821b8f6a48a341f33b5a7ca7b72a63f3..433ad3b41314d62cfecd9b376899137fb4695200 100644 (file)
@@ -1959,12 +1959,20 @@ bool OSDMap::check_pg_upmaps(
     // okay, upmap is valid
     // continue to check if it is still necessary
     auto i = pg_upmap.find(pg);
-    if (i != pg_upmap.end() && raw == i->second) {
-      ldout(cct, 10) << " removing redundant pg_upmap "
-                     << i->first << " " << i->second
-                     << dendl;
-      to_cancel->push_back(pg);
-      continue;
+    if (i != pg_upmap.end()) {
+      if (i->second == raw) {
+        ldout(cct, 10) << "removing redundant pg_upmap " << i->first << " "
+                       << i->second << dendl;
+        to_cancel->push_back(pg);
+        continue;
+      }
+      if ((int)i->second.size() != get_pg_pool_size(pg)) {
+        ldout(cct, 10) << "removing pg_upmap " << i->first << " "
+                       << i->second << " != pool size " << get_pg_pool_size(pg)
+                       << dendl;
+        to_cancel->push_back(pg);
+        continue;
+      }
     }
     auto j = pg_upmap_items.find(pg);
     if (j != pg_upmap_items.end()) {
index be3f7414d69242ebc21ab01c6adb1cfe2f1803d6..2c322b3d8f38c2938bb76070907688c52e055f6a 100644 (file)
@@ -938,8 +938,7 @@ void PGLog::_write_log_and_missing(
       if (!missing.is_missing(obj, &item)) {
        to_remove.insert(key);
       } else {
-       uint64_t features = missing.may_include_deletes ? CEPH_FEATURE_OSD_RECOVERY_DELETES : 0;
-       encode(make_pair(obj, item), (*km)[key], features);
+       encode(make_pair(obj, item), (*km)[key], CEPH_FEATUREMASK_SERVER_OCTOPUS);
       }
     });
   if (require_rollback) {
index 355ba78ed6ca2c534cdcff40592e17204bb71529..ac951a4a9f391f672dad6964c7bbaf9e8377f685 100644 (file)
@@ -2802,6 +2802,9 @@ void PeeringState::activate(
 
       bool needs_past_intervals = pi.dne();
 
+      // Save num_bytes for backfill reservation request, can't be negative
+      peer_bytes[peer] = std::max<int64_t>(0, pi.stats.stats.sum.num_bytes);
+
       if (pi.last_update == info.last_update) {
         // empty log
        if (!pi.last_backfill.is_max())
@@ -2852,8 +2855,6 @@ void PeeringState::activate(
        pi.last_interval_started = info.last_interval_started;
        pi.history = info.history;
        pi.hit_set = info.hit_set;
-        // Save num_bytes for reservation request, can't be negative
-        peer_bytes[peer] = std::max<int64_t>(0, pi.stats.stats.sum.num_bytes);
         pi.stats.stats.clear();
         pi.stats.stats.sum.num_bytes = peer_bytes[peer];
 
index 69893d1c40c1b52ddd023102cd298cdb90c2a6d2..339b262b60b04942ad0ec441ccc2bda9ade132cd 100644 (file)
@@ -3383,7 +3383,17 @@ int PrimaryLogPG::get_manifest_ref_count(ObjectContextRef obc, std::string& fp_o
 
 bool PrimaryLogPG::recover_adjacent_clones(ObjectContextRef obc, OpRequestRef op)
 {
-  if (!obc->obs.oi.manifest.is_chunked() || !obc->ssc || !obc->ssc->snapset.clones.size()) {
+  if (!obc->ssc || !obc->ssc->snapset.clones.size()) {
+    return false;
+  }
+  MOSDOp *m = static_cast<MOSDOp*>(op->get_nonconst_req());
+  bool has_manifest_op = std::any_of(
+    begin(m->ops),
+    end(m->ops),
+    [](const auto& osd_op) {
+       return osd_op.op.op == CEPH_OSD_OP_SET_CHUNK;
+    });
+  if (!obc->obs.oi.manifest.is_chunked() && !has_manifest_op) {
     return false;
   }
 
index 0c647c95114bd56df8b44651ff892f947040b1d1..6e2bb5abd829f1cec2e65f319ca62fce2f4620ab 100644 (file)
@@ -50,6 +50,9 @@ public:
   // Print human readable brief description with relevant parameters
   virtual void print(std::ostream &out) const = 0;
 
+  // Apply config changes to the scheduler (if any)
+  virtual void update_configuration() = 0;
+
   // Destructor
   virtual ~OpScheduler() {};
 };
@@ -134,6 +137,10 @@ public:
     out << ", cutoff=" << cutoff << ")";
   }
 
+  void update_configuration() final {
+    // no-op
+  }
+
   ~ClassedOpQueueScheduler() final {};
 };
 
index 470c943f4dfa2a19f19da410e77972e1f11766c3..f2f0ffc3dbd4635430f213ed1b12912fcfc2113e 100644 (file)
@@ -99,22 +99,19 @@ const dmc::ClientInfo *mClockScheduler::ClientRegistry::get_info(
 
 void mClockScheduler::set_max_osd_capacity()
 {
-  if (cct->_conf.get_val<double>("osd_mclock_max_capacity_iops")) {
+  if (is_rotational) {
     max_osd_capacity =
-      cct->_conf.get_val<double>("osd_mclock_max_capacity_iops");
+      cct->_conf.get_val<double>("osd_mclock_max_capacity_iops_hdd");
   } else {
-    if (is_rotational) {
-      max_osd_capacity =
-        cct->_conf.get_val<double>("osd_mclock_max_capacity_iops_hdd");
-    } else {
-      max_osd_capacity =
-        cct->_conf.get_val<double>("osd_mclock_max_capacity_iops_ssd");
-    }
+    max_osd_capacity =
+      cct->_conf.get_val<double>("osd_mclock_max_capacity_iops_ssd");
   }
   // Set per op-shard iops limit
   max_osd_capacity /= num_shards;
   dout(1) << __func__ << " #op shards: " << num_shards
-          << " max osd capacity(iops) per shard: " << max_osd_capacity << dendl;
+          << std::fixed << std::setprecision(2)
+          << " max osd capacity(iops) per shard: " << max_osd_capacity
+          << dendl;
 }
 
 void mClockScheduler::set_osd_mclock_cost_per_io()
@@ -137,7 +134,8 @@ void mClockScheduler::set_osd_mclock_cost_per_io()
     }
   }
   dout(1) << __func__ << " osd_mclock_cost_per_io: "
-          << std::fixed << osd_mclock_cost_per_io << dendl;
+          << std::fixed << std::setprecision(7) << osd_mclock_cost_per_io
+          << dendl;
 }
 
 void mClockScheduler::set_osd_mclock_cost_per_byte()
@@ -160,7 +158,8 @@ void mClockScheduler::set_osd_mclock_cost_per_byte()
     }
   }
   dout(1) << __func__ << " osd_mclock_cost_per_byte: "
-          << std::fixed << osd_mclock_cost_per_byte << dendl;
+          << std::fixed << std::setprecision(7) << osd_mclock_cost_per_byte
+          << dendl;
 }
 
 void mClockScheduler::set_mclock_profile()
@@ -378,6 +377,14 @@ int mClockScheduler::calc_scaled_cost(int item_cost)
   return std::max(scaled_cost, 1);
 }
 
+void mClockScheduler::update_configuration()
+{
+  // Apply configuration change. The expectation is that
+  // at least one of the tracked mclock config option keys
+  // is modified before calling this method.
+  cct->_conf.apply_changes(nullptr);
+}
+
 void mClockScheduler::dump(ceph::Formatter &f) const
 {
 }
@@ -447,7 +454,6 @@ const char** mClockScheduler::get_tracked_conf_keys() const
     "osd_mclock_cost_per_byte_usec",
     "osd_mclock_cost_per_byte_usec_hdd",
     "osd_mclock_cost_per_byte_usec_ssd",
-    "osd_mclock_max_capacity_iops",
     "osd_mclock_max_capacity_iops_hdd",
     "osd_mclock_max_capacity_iops_ssd",
     "osd_mclock_profile",
@@ -470,8 +476,7 @@ void mClockScheduler::handle_conf_change(
       changed.count("osd_mclock_cost_per_byte_usec_ssd")) {
     set_osd_mclock_cost_per_byte();
   }
-  if (changed.count("osd_mclock_max_capacity_iops") ||
-      changed.count("osd_mclock_max_capacity_iops_hdd") ||
+  if (changed.count("osd_mclock_max_capacity_iops_hdd") ||
       changed.count("osd_mclock_max_capacity_iops_ssd")) {
     set_max_osd_capacity();
     if (mclock_profile != "custom") {
index faee092f665d2bccf59dad4a9476e530c752d901..32f3851ec0558cf218c17e7b212811390b307070 100644 (file)
@@ -193,6 +193,9 @@ public:
     ostream << "mClockScheduler";
   }
 
+  // Update data associated with the modified mclock config key(s)
+  void update_configuration() final;
+
   const char** get_tracked_conf_keys() const final;
   void handle_conf_change(const ConfigProxy& conf,
                          const std::set<std::string> &changed) final;
diff --git a/ceph/src/pmdk/.cirrus.yml b/ceph/src/pmdk/.cirrus.yml
new file mode 100644 (file)
index 0000000..caabe83
--- /dev/null
@@ -0,0 +1,10 @@
+freebsd_instance:
+  image: freebsd-12-1-release-amd64
+
+task:
+  install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f;
+    pkg install -y
+    autoconf bash binutils coreutils e2fsprogs-libuuid
+    git gmake libunwind ncurses pkgconf hs-pandoc
+
+  script: CFLAGS="-Wno-unused-value" gmake
\ No newline at end of file
diff --git a/ceph/src/pmdk/.codecov.yml b/ceph/src/pmdk/.codecov.yml
new file mode 100644 (file)
index 0000000..48ec0af
--- /dev/null
@@ -0,0 +1,18 @@
+ignore:
+  - src/windows/
+  - src/test/
+  - src/common/valgrind/
+  - src/benchmarks/
+
+comment:
+  layout: "diff"
+  behavior: default
+  require_changes: yes
+
+parsers:
+  gcov:
+    branch_detection:
+      conditional: false
+      loop: false
+      method: false
+      macro: false
diff --git a/ceph/src/pmdk/.gitattributes b/ceph/src/pmdk/.gitattributes
new file mode 100644 (file)
index 0000000..5a466f7
--- /dev/null
@@ -0,0 +1,7 @@
+* text=auto eol=lf
+*.jpg binary
+*.png binary
+*.gif binary
+*.ico binary
+*.match text -whitespace
+GIT_VERSION export-subst
diff --git a/ceph/src/pmdk/.github/ISSUE_TEMPLATE.md b/ceph/src/pmdk/.github/ISSUE_TEMPLATE.md
new file mode 100644 (file)
index 0000000..ecf4d61
--- /dev/null
@@ -0,0 +1,28 @@
+# GENERAL ISSUE: <!-- fill the title of regular issue -->
+
+## Bug Report
+
+- PMDK package version(s):                                           <!-- fill this out -->
+- OS(es) version(s):                                                 <!-- fill this out -->
+- ndctl version(s):                                                  <!-- fill this out -->
+- kernel version(s):                                                 <!-- fill this out -->
+- compiler, libraries, packaging and other related tools version(s): <!-- fill this out -->
+<!-- fill in also other useful environment data -->
+
+## Describe the issue:
+
+<!-- fill this out -->
+
+## Actual behavior:
+
+<!-- fill this out -->
+
+## Expected behavior:
+
+<!-- fill this out -->
+
+## Additional information about Priority and Help Requested:
+
+Are you willing to submit a pull request with a proposed change? (Yes, No)  <!-- check one if possible -->
+
+Requested priority: (Showstopper, High, Medium, Low)                        <!-- check one if possible -->
diff --git a/ceph/src/pmdk/.github/ISSUE_TEMPLATE/bug_report.md b/ceph/src/pmdk/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644 (file)
index 0000000..528efca
--- /dev/null
@@ -0,0 +1,49 @@
+---
+name: Bug report
+about: Did you find a bug in PMDK? Please let us know.
+labels: "Type: Bug"
+---
+<!--
+Before creating new issue, ensure that similar issue wasn't already created
+  * Search: https://github.com/pmem/pmdk/issues
+
+Note that if you do not provide enough information to reproduce the issue, we may not be able to take action on your report.
+Remember this is just a minimal template. You can extend it with data you think may be useful.
+-->
+
+# ISSUE: <!-- fill the title of issue -->
+
+## Environment Information
+
+- PMDK package version(s):                                           <!-- fill this out -->
+- OS(es) version(s):                                                 <!-- fill this out -->
+- ndctl version(s):                                                  <!-- fill this out -->
+- kernel version(s):                                                 <!-- fill this out -->
+- compiler, libraries, packaging and other related tools version(s): <!-- fill this out -->
+<!-- fill in also other useful environment data -->
+
+## Please provide a reproduction of the bug:
+
+<!-- fill this out -->
+
+## How often bug is revealed: (always, often, rare):  <!-- check one if possible -->
+
+<!-- describe special circumstances in section above -->
+
+## Actual behavior:
+
+<!-- fill this out -->
+
+## Expected behavior:
+
+<!-- fill this out -->
+
+## Details
+
+<!-- fill this out -->
+
+## Additional information about Priority and Help Requested:
+
+Are you willing to submit a pull request with a proposed change? (Yes, No)  <!-- check one if possible -->
+
+Requested priority: (Showstopper, High, Medium, Low)                        <!-- check one if possible -->
diff --git a/ceph/src/pmdk/.github/ISSUE_TEMPLATE/feature.md b/ceph/src/pmdk/.github/ISSUE_TEMPLATE/feature.md
new file mode 100644 (file)
index 0000000..12d6e40
--- /dev/null
@@ -0,0 +1,26 @@
+---
+name: Feature
+about: Feature your request
+labels: "Type: Feature"
+---
+# FEAT: <!-- fill the title of feature -->
+
+## Rationale
+
+<!-- fill this out -->
+
+## Description
+
+<!-- fill this out -->
+
+## API Changes
+
+<!-- fill this out -->
+
+## Implementation details
+
+<!-- fill this out if possible -->
+
+## Meta
+
+<!-- fill this out -->
diff --git a/ceph/src/pmdk/.github/ISSUE_TEMPLATE/question.md b/ceph/src/pmdk/.github/ISSUE_TEMPLATE/question.md
new file mode 100644 (file)
index 0000000..3e4e452
--- /dev/null
@@ -0,0 +1,15 @@
+---
+name: Question
+about: Do you have question regarding PMDK? Don't hesitate to ask.
+labels: "Type: Question"
+---
+# QUESTION: <!-- fill the title of question -->
+
+## Details
+
+<!-- fill this out -->
+
+<!--
+For questions and other non-bugs, you could use http://groups.google.com/group/pmem
+You could also chat with members of the PMDK team real-time on the #pmem IRC channel on OFTC
+-->
diff --git a/ceph/src/pmdk/.github/workflows/coverity.yml b/ceph/src/pmdk/.github/workflows/coverity.yml
new file mode 100644 (file)
index 0000000..f69783b
--- /dev/null
@@ -0,0 +1,41 @@
+
+name: Coverity
+
+on:
+  schedule:
+    # run this job at 00:00 UTC every day
+    - cron:  '0 0 * * *'
+
+env:
+  GITHUB_REPO:    pmem/pmdk
+  DOCKERHUB_REPO: pmem/pmdk
+
+jobs:
+  linux:
+    name: Linux
+    runs-on: ubuntu-latest
+    env:
+      COVERITY_SCAN_NOTIFICATION_EMAIL:  ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
+      COVERITY_SCAN_TOKEN:               ${{ secrets.COVERITY_SCAN_TOKEN }}
+      HOST_WORKDIR:   /home/runner/work/pmdk/pmdk
+      WORKDIR:        utils/docker
+      PMDK_CC:        gcc
+      PMDK_CXX:       g++
+      MAKE_PKG:       0
+      REMOTE_TESTS:   1
+      VALGRIND:       1
+    strategy:
+      matrix:
+        CONFIG: ["COVERITY=1 OS=ubuntu OS_VER=19.10"]
+    steps:
+       - name: Print out the current date and time
+         run: date
+
+       - name: Clone the git repo
+         uses: actions/checkout@v2
+
+       - name: Pull or rebuild the image
+         run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh
+
+       - name: Run the build
+         run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build-CI.sh
diff --git a/ceph/src/pmdk/.github/workflows/gha.yml b/ceph/src/pmdk/.github/workflows/gha.yml
new file mode 100644 (file)
index 0000000..402d4f8
--- /dev/null
@@ -0,0 +1,155 @@
+
+name: PMDK
+on: [push, pull_request]
+
+env:
+    GITHUB_REPO:    pmem/pmdk
+    DOCKERHUB_REPO: pmem/pmdk
+
+jobs:
+  linux:
+    name: Linux
+    runs-on: ubuntu-latest
+    env:
+      DOCKERHUB_USER:          ${{ secrets.DOCKERHUB_USER }}
+      DOCKERHUB_PASSWORD:      ${{ secrets.DOCKERHUB_PASSWORD }}
+      DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
+      HOST_WORKDIR:   /home/runner/work/pmdk/pmdk
+      WORKDIR:        utils/docker
+      PMDK_CC:        gcc
+      PMDK_CXX:       g++
+      MAKE_PKG:       0
+      REMOTE_TESTS:   1
+      VALGRIND:       1
+      SRC_CHECKERS:   0
+    strategy:
+      matrix:
+        CONFIG: ["N=1 OS=ubuntu OS_VER=19.10 FAULT_INJECTION=1 TEST_BUILD=debug",
+                 "N=2 OS=ubuntu OS_VER=19.10 FAULT_INJECTION=1 TEST_BUILD=nondebug UBSAN=1",
+                 "N=3 OS=ubuntu OS_VER=19.10 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=debug SRC_CHECKERS=1",
+                 "N=4 OS=ubuntu OS_VER=19.10 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=nondebug",
+                 "N=5 OS=fedora OS_VER=31    PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=debug",
+                 "N=6 OS=fedora OS_VER=31    PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=nondebug AUTO_DOC_UPDATE=1",
+                 "N=7 OS=fedora OS_VER=31    MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 PUSH_IMAGE=1",
+                 "N=8 OS=ubuntu OS_VER=19.10 MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 NDCTL_ENABLE=n PUSH_IMAGE=1",
+                 "N=9 OS=ubuntu OS_VER=19.10 MAKE_PKG=1 EXPERIMENTAL=y REMOTE_TESTS=0 VALGRIND=0 NDCTL_ENABLE=n PMDK_CC=clang PMDK_CXX=clang++",
+                "N=10 OS=ubuntu OS_VER=19.10 COVERAGE=1 FAULT_INJECTION=1 TEST_BUILD=debug"]
+    steps:
+       - name: Clone the git repo
+         uses: actions/checkout@v2
+         with:
+            fetch-depth: 50
+
+       - name: Pull or rebuild the image
+         run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh
+
+       - name: Run the build
+         run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build-CI.sh
+
+       - name: Push the image
+         run: cd $WORKDIR && source ./set-vars.sh && ${{ matrix.CONFIG }} /bin/bash -c "if [[ -f ${CI_FILE_PUSH_IMAGE_TO_REPO} ]]; then images/push-image.sh; fi"
+
+  windows:
+    name: Windows
+    runs-on: windows-latest
+    env:
+      platform: x64
+      solutionname: PMDK.sln
+      ex_solutionname: Examples.sln
+      msbuild: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin"
+      # Platform Toolset for Visual Studio 2019
+      platform_toolset: "v142"
+      perl: "C:\\Strawberry\\perl\\bin"
+    strategy:
+      matrix:
+        CONFIG: [Debug, Release]
+    steps:
+       - name: Update Path
+         run: |
+           echo "::add-path::$Env:msbuild"
+           echo "::add-path::$Env:perl"
+
+       - name: Clone the git repo
+         uses: actions/checkout@v2
+
+       - name: Unshallow it
+         run: git fetch --prune --unshallow
+
+       - name: Various debug checks (cstyle, whitespace etc.)
+         run: |
+           if ("${{ matrix.CONFIG }}" -eq "Release")
+           {
+              Install-Module PsScriptAnalyzer -Force
+              utils/CSTYLE.ps1
+              if ($LASTEXITCODE -ne 0) {
+                 exit 1
+              }
+              utils/CHECK_WHITESPACE.ps1
+              if ($LASTEXITCODE -ne 0) {
+                 exit 1
+              }
+              utils/ps_analyze.ps1
+              if ($LASTEXITCODE -ne 0) {
+                 exit 1
+              }
+              perl utils/sort_solution check
+              if ($LASTEXITCODE -ne 0) {
+                 exit 1
+              }
+              ./utils/check_sdk_version.py -d .
+              if ($LASTEXITCODE -ne 0) {
+                 exit 1
+              }
+           }
+
+       - name: Build
+         run: |
+           msbuild src\$Env:solutionname -property:Configuration=${{ matrix.CONFIG }},PlatformToolset=$Env:platform_toolset -m -v:m
+           msbuild src\examples\$Env:ex_solutionname -property:Configuration=${{ matrix.CONFIG }},PlatformToolset=$Env:platform_toolset -m -v:m
+
+       - name: Create ZIP archive
+         run: utils/CREATE-ZIP.ps1 -b ${{ matrix.CONFIG }}
+
+       - name: Run tests
+         shell: powershell
+         run: |
+           if ($true) {
+               cd src\test
+               echo "`$Env:NON_PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1
+               echo "`$Env:PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1
+               echo "`$Env:PMEM_FS_DIR_FORCE_PMEM = `"1`"" >> testconfig.ps1
+               echo "`$Env:PMDK_NO_ABORT_MSG = `"1`"" >> testconfig.ps1
+               echo "`$Env:TM = `"1`"" >> testconfig.ps1
+               write-output "config = {
+                                       'unittest_log_level': 1,
+                                       'cacheline_fs_dir': 'C:\\temp',
+                                       'force_cacheline': True,
+                                       'page_fs_dir': 'C:\\temp',
+                                       'force_page': False,
+                                       'byte_fs_dir': 'C:\\temp',
+                                       'force_byte': True,
+                                       'tm': True,
+                                       'test_type': 'check',
+                                       'granularity': 'all',
+                                       'fs_dir_force_pmem': 1,
+                                       'keep_going': False,
+                                       'timeout': '4m',
+                                       'build': 'debug',
+                                       'force_enable': None,
+                                       'fail_on_skip': False,
+                                       'enable_admin_tests': False,
+                                        }" | out-file "testconfig.py" -encoding utf8
+
+               if ("${{ matrix.CONFIG }}" -eq "Debug") {
+                   ./RUNTESTS.ps1 -b debug -o 4m
+                   if ($?) {
+                       python ./RUNTESTS.py -b debug
+                   }
+               }
+               if ("${{ matrix.CONFIG }}" -eq "Release") {
+                   ./RUNTESTS.ps1 -b nondebug -o 4m
+                   if ($?) {
+                       python ./RUNTESTS.py -b release
+                   }
+               }
+           }
diff --git a/ceph/src/pmdk/.mailmap b/ceph/src/pmdk/.mailmap
new file mode 100644 (file)
index 0000000..50848d5
--- /dev/null
@@ -0,0 +1,29 @@
+Daria Lewandowska <darialewandowska@g.pl>
+Gábor Buella <gabor.buella@intel.com>
+Grzegorz Brzeziński <grzegorz.brzezinski@intel.com>
+Hu Wan <wanhu@cnu.edu.cn>
+Igor Chorążewicz <igor.chorazewicz@intel.com>
+Jacob Chang <jacobc@hpe.com>
+Jan M Michalski <jan.m.michalski@intel.com>
+Kamil Diedrich <kamilek@gklab-123-254.igk.intel.com>
+Kamil Diedrich <kamil.diedrich@intel.com>
+Krzysztof Czuryło <krzysztof.czurylo@intel.com>
+Lukasz Dorau <ldorau@users.noreply.github.com>
+Lukasz Dorau <lukasz.dorau@intel.com>
+Łukasz Godlewski <lukasz.godlewski90@gmail.com>
+Łukasz Godlewski <lukaszx.godlewski@intel.com>
+Łukasz Plewa <lukasz.plewa@intel.com>
+Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
+Łukasz Stolarczuk <mr.harrylp@gmail.com>
+Maciej Ramotowski <maciej.ramotowski@intel.com>
+Michał Biesek <michalbiesek@gmail.com>
+Oksana Sałyk <oksana.salyk@intel.com>
+Oksana Sałyk <oksana@localhost.localdomain>
+Paul Luse <paul.e.luse@intel.com>
+Paweł Lebioda <pawel.lebioda@intel.com>
+Piotr Balcer <piotr.balcer@intel.com>
+Sławomir Pawłowski <slawomir.pawlowski@intel.com>
+Tomasz Kapela <tomasz.kapela@intel.com>
+Weronika Lewandowska <weronika.lewandowska@intel.com>
+Weronika Lewandowska <weronika.lemkowska@intel.com>
+Wojciech Uss <wojciech.uss@intel.com>
diff --git a/ceph/src/pmdk/.skip-doc b/ceph/src/pmdk/.skip-doc
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/src/pmdk/.travis.yml b/ceph/src/pmdk/.travis.yml
new file mode 100644 (file)
index 0000000..caa2313
--- /dev/null
@@ -0,0 +1,42 @@
+os: linux
+dist: bionic
+arch:
+  - ppc64le
+
+language: c
+
+services:
+  - docker
+
+env:
+  global:
+    - GITHUB_REPO=pmem/pmdk
+    - DOCKERHUB_REPO=pmem/pmdk
+    - OS=ubuntu
+    - OS_VER=19.10
+    - MAKE_PKG=0
+    - PMDK_CC=gcc
+    - PMDK_CXX=g++
+    - REMOTE_TESTS=1
+    - VALGRIND=1
+    - SRC_CHECKERS=0
+    - EXPERIMENTAL=n
+  jobs:
+    - FAULT_INJECTION=1 TEST_BUILD=debug PUSH_IMAGE=1
+    - OS=fedora OS_VER=31 PMDK_CC=clang PMDK_CXX=clang++ TEST_BUILD=nondebug PUSH_IMAGE=1
+    - MAKE_PKG=1 REMOTE_TESTS=0 VALGRIND=0
+    - MAKE_PKG=1 REMOTE_TESTS=0 VALGRIND=0 OS=fedora OS_VER=31
+    - COVERAGE=1 FAULT_INJECTION=1 TEST_BUILD=debug
+
+before_install:
+  - echo $TRAVIS_COMMIT_RANGE
+  - export HOST_WORKDIR=`pwd`
+  - cd utils/docker
+  - ./pull-or-rebuild-image.sh
+
+script:
+  - ./build-CI.sh
+
+after_success:
+  - source ./set-vars.sh
+  - if [[ -f $CI_FILE_PUSH_IMAGE_TO_REPO ]]; then ./images/push-image.sh; fi
diff --git a/ceph/src/pmdk/CODING_STYLE.md b/ceph/src/pmdk/CODING_STYLE.md
new file mode 100644 (file)
index 0000000..9b0cfa7
--- /dev/null
@@ -0,0 +1,140 @@
+# C Style and Coding Standards for Persistent Memory Development Kit
+
+This document defines the coding standards and conventions for writing
+PMDK code. To ensure readability and consistency within the code,
+the contributed code must adhere to the rules below.
+
+### Introduction
+The Persistent Memory Development Kit coding style is quite similar to the style
+used for the SunOS product.
+A full description of that standard can be found
+[here.](https://www.cis.upenn.edu/~lee/06cse480/data/cstyle.ms.pdf)
+
+This document does not cover the entire set of recommendations and formatting rules
+used in writing PMDK code, but rather focuses on some PMDK-specific conventions,
+not described in the document mentioned above, as well as the ones the violation
+of which is most frequently observed during the code review.
+Also, keep in mind that more important than the particular style is **consistency**
+of coding style. So, when modifying the existing code, the changes should be
+coded in the same style as the file being modified.
+
+### Code formatting
+Most of the common stylistic errors can be detected by the
+[style checker program](https://github.com/pmem/pmdk/blob/master/utils/cstyle)
+included in the repo.
+Simply run `make cstyle` or `CSTYLE.ps1` to verify if your code is well-formatted.
+
+Here is the list of the most important rules:
+- The limit of line length is 80 characters.
+- Indent the code with TABs, not spaces. Tab width is 8 characters.
+- Do not break user-visible strings (even when they are longer than 80 characters)
+- Put each variable declaration in a separate line.
+- Do not use C++ comments (`//`).
+- Spaces around operators are mandatory.
+- No whitespace is allowed at the end of line.
+- For multi-line macros, do not put whitespace before `\` character.
+- Precede definition of each function with a brief, non-trivial description.
+(Usually a single line is enough.)
+- Use `XXX` tag to indicate a hack, problematic code, or something to be done.
+- For pointer variables, place the `*` close to the variable name not pointer type.
+- Avoid unnecessary variable initialization.
+- Never type `unsigned int` - just use `unsigned` in such case.
+Same with `long int` and `long`, etc.
+- Sized types like `uint32_t`, `int64_t` should be used when there is an on-media format.
+Otherwise, just use `unsigned`, `long`, etc.
+- Functions with local scope must be declared as `static`.
+
+### License & copyright
+- Make sure you have the right to submit your contribution under the BSD license,
+especially if it is based upon previous work.
+See [CONTRIBUTING.md](https://github.com/pmem/pmdk/blob/master/CONTRIBUTING.md) for details.
+- A copy of the [BSD-style License](https://github.com/pmem/pmdk/blob/master/LICENSE)
+must be placed at the beginning of each source file, script or man page
+(Obviously, it does not apply to README's, Visual Studio projects and \*.match files.)
+- When adding a new file to the repo, or when making a contribution to an existing
+file, feel free to put your copyright string on top of it.
+
+### Naming convention
+- Keep identifier names short, but meaningful. One-letter variables are discouraged.
+- Use proper prefix for function name, depending on the module it belongs to.
+- Use *under_score* pattern for function/variable names. Please, do not use
+CamelCase or Hungarian notation.
+- UPPERCASE constant/macro/enum names.
+- Capitalize first letter for variables with global or module-level scope.
+- Avoid using `l` as a variable name, because it is hard to distinguish `l` from `1`
+on some displays.
+
+### Multi-OS support (Linux/FreeBSD/Windows)
+- Do not add `#ifdef <OS>` sections lightly. They should be treated as technical
+debt and avoided when possible.
+- Use `_WIN32` macro for conditional directives when including code using
+Windows-specific API.
+- Use `__FreeBSD__` macro for conditional directives for FreeBSD-specific code.
+- Use `_MSC_VER` macro for conditional directives when including code using VC++
+or gcc specific extensions.
+- In case of large portions of code (i.e. a whole function) that have different
+implementation for each OS, consider moving them to separate files.
+(i.e. *xxx_linux.c*, *xxx_freebsd.c* and *xxx_windows.c*)
+- Keep in mind that `long int` is always 32-bit in VC++, even when building for
+64-bit platforms. Remember to use `long long` types whenever it applies, as well
+as proper formatting strings and type suffixes (i.. `%llu`, `ULL`).
+- Standard compliant solutions should be used in preference of compiler-specific ones.
+(i.e. static inline functions versus statement expressions)
+- Do not use formatting strings that are not supported by Windows implementations
+of printf()/scanf() family. (like `%m`)
+- It is recommended to use `PRI*` and `SCN*` macros in printf()/scanf() functions
+for width-based integral types (`uint32_t`, `int64_t`, etc.).
+
+### Debug traces and assertions
+- Put `LOG(3, ...)` at the beginning of each function. Consider using higher
+log level for most frequently called routines.
+- Make use of `COMPILE_ERROR_ON` and `ASSERT*` macros.
+- Use `ERR()` macro to log error messages.
+
+### Unit tests
+- There **must** be unit tests provided for each new function/module added.
+- Test scripts **must** start with `#!/usr/bin/env <shell>` for portability between Linux and FreeBSD.
+- Please, see [this](https://github.com/pmem/pmdk/blob/master/src/test/README)
+and [that](https://github.com/pmem/pmdk/blob/master/src/test/unittest/README)
+document to get familiar with
+our test framework and the guidelines on how to write and run unit tests.
+
+### Commit messages
+All commit lines (entered when you run `git commit`) must follow the common
+conventions for git commit messages:
+- The first line is a short summary, no longer than **50 characters,** starting
+  with an area name and then a colon.  There should be no period after
+  the short summary.
+- Valid area names are: **pmem, pmem2, obj, blk, log,
+  test, doc, daxio, pmreorder, pool** (for *libpmempool* and *pmempool*), **rpmem**
+  (for *librpmem* and *rpmemd*), **benchmark, examples, core** and **common** (for everything else).
+- It is acceptable for the short summary to be the only thing in the commit
+  message if it is a trivial change.  Otherwise, the second line must be
+  a blank line.
+- Starting at the third line, additional information is given in complete
+  English sentences and, optionally, bulleted points.  This content must not
+  extend beyond **column 72.**
+- The English sentences should be written in the imperative, so you say
+  "Fix bug X" instead of "Fixed bug X" or "Fixes bug X".
+- Bullet points should use hanging indents when they take up more than
+  one line (see example below).
+- There can be any number of paragraphs, separated by a blank line, as many
+  as it takes to describe the change.
+- Any references to GitHub issues are at the end of the commit message.
+
+For example, here is a properly-formatted commit message:
+```
+doc: fix code formatting in man pages
+
+This section contains paragraph style text with complete English
+sentences.  There can be as many paragraphs as necessary.
+
+- Bullet points are typically sentence fragments
+
+- The first word of the bullet point is usually capitalized and
+  if the point is long, it is continued with a hanging indent
+
+- The sentence fragments don't typically end with a period
+
+Ref: pmem/issues#1
+```
diff --git a/ceph/src/pmdk/CONTRIBUTING.md b/ceph/src/pmdk/CONTRIBUTING.md
new file mode 100644 (file)
index 0000000..420411d
--- /dev/null
@@ -0,0 +1,153 @@
+# Contributing to the Persistent Memory Development Kit
+
+Down below you'll find instructions on how to contribute to the
+Persistent Memory Development Kit.
+
+Your contributions are most welcome!  You'll find it is best to begin
+with a conversation about your changes, rather than just writing a bunch
+of code and contributing it out of the blue.
+There are several good ways to suggest new features, offer to add a feature,
+or just begin a dialog about the Persistent Memory Development Kit:
+
+* Open an issue in our [GitHub Issues Database](https://github.com/pmem/pmdk/issues)
+* Suggest a feature, ask a question, start a discussion, etc. in our [pmem Google group](https://groups.google.com/group/pmem)
+* Chat with members of the PMDK team real-time on the **#pmem** IRC channel on [OFTC](https://www.oftc.net)
+
+**NOTE: If you do decide to implement code changes and contribute them,
+please make sure you agree your contribution can be made available
+under the [BSD-style License used for the Persistent Memory Development Kit](https://github.com/pmem/pmdk/blob/master/LICENSE).**
+
+**NOTE: Submitting your changes also means that you certify the following:**
+
+```
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+    have the right to submit it under the open source license
+    indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+    of my knowledge, is covered under an appropriate open source
+    license and I have the right under that license to submit that
+    work with modifications, whether created in whole or in part
+    by me, under the same open source license (unless I am
+    permitted to submit under a different license), as indicated
+    in the file; or
+
+(c) The contribution was provided directly to me by some other
+    person who certified (a), (b) or (c) and I have not modified
+    it.
+
+(d) I understand and agree that this project and the contribution
+    are public and that a record of the contribution (including all
+    personal information I submit with it, including my sign-off) is
+    maintained indefinitely and may be redistributed consistent with
+    this project or the open source license(s) involved.
+```
+
+In case of any doubt, the gatekeeper may ask you to certify the above in writing,
+i.e. via email or by including a `Signed-off-by:` line at the bottom
+of your commit comments.
+
+To improve tracking of who is the author of the contribution, we kindly ask you
+to use your real name (not an alias) when committing your changes to the
+Persistent Memory Development Kit:
+```
+Author: Random J Developer <random@developer.example.org>
+```
+
+### Code Contributions
+
+Please feel free to use the forums mentioned above to ask
+for comments & questions on your code before submitting
+a pull request.  The Persistent Memory Development Kit project uses the common
+*fork and merge* workflow used by most GitHub-hosted projects.
+The [Git Workflow blog article](https://pmem.io/2014/09/09/git-workflow.html)
+describes our workflow in more detail.
+
+#### Linux/FreeBSD
+
+Before contributing please remember to run:
+```
+       $ make cstyle
+```
+
+This will check all C/C++ files in the tree for style issues. To check C++
+files you have to have clang-format version 6.0, otherwise they will be
+skipped. If you want to run this target automatically at build time, you can
+pass CSTYLEON=1 to make. If you want cstyle to be run, but not fail the build,
+pass CSTYLEON=2 to make.
+There is also a target for automatic C++ code formatting, to do this run:
+```
+       $ make format
+```
+
+There are cases, when you might have several clang-format-X.Y binaries and either
+no clang-format or it pointing to an older version. In such case run:
+```
+       $ make CLANG_FORMAT=/path/to/clang-format cstyle|format
+```
+
+#### Windows
+
+On Windows to check the code for style issues, please run:
+```
+       $ pmdk\utils\CSTYLE.ps1
+```
+
+To check or format C++ files, you may use a standalone Visual Studio plugin
+for clang-format.  The plugin installer can be downloaded from
+[LLVM Builds](https://llvm.org/builds) page.
+
+If you are actively working on an PMDK feature, please let other
+developers know by [creating an issue](https://github.com/pmem/pmdk/issues).
+Use the template `Feature` and assign it to yourself (due to the way
+GitHub permissions work, you may have to ask a team member to assign it to you).
+
+### Bug Reports
+
+Bugs for the PMDK project are tracked in our
+[GitHub Issues Database](https://github.com/pmem/pmdk/issues).
+
+When reporting a new bug, please use `New issue` button, pick proper template and fill
+in all fields. Provide as much information as possible, including the product version:
+
+#### PMDK version
+
+Put the release name of the version of PMDK running when the
+bug was discovered in a bug comment.  If you saw this bug in multiple PMDK
+versions, please put at least the most recent version and list the others
+if necessary.
+- Stable release names are in the form `#.#` (where `#` represents
+  an integer); for example `0.3`.
+- Release names from working versions look like `#.#+b#` (adding a build #)
+  or `#.#-rc#` (adding a release candidate number)
+If PMDK was built from source, the version number can be retrieved
+from git using this command: `git describe`
+
+For binary PMDK releases, use the entire package name.
+For RPMs, use `rpm -q pmdk` to display the name.
+For Deb packages, run `dpkg-query -W pmdk` and use the
+second (version) string.
+
+#### Priority
+
+Requested priority describes the urgency to resolve a defect and establishes
+the time frame for providing a verified resolution. Priorities are defined as:
+
+* **P1**: Showstopper bug, requiring a resolution before the next release of the
+library.
+* **P2**: High-priority bug, requiring a resolution although it may be decided
+that the bug does not prevent the next release of the library.
+* **P3**: Medium-priority bug.  The expectation is that the bug will be
+evaluated and a plan will be made for when the bug will be resolved.
+* **P4**: Low-priority bug, the least urgent.  Fixed when the resources are available.
+
+### Other issues
+
+On our issues page we also gather feature requests and questions. Templates to use
+are `Feature` and `Question`, respectively.  They should help deliver a meaningful
+description of a feature or ask a question to us (remember though we have
+different means of communication, as described at the top of the page).
diff --git a/ceph/src/pmdk/ChangeLog b/ceph/src/pmdk/ChangeLog
new file mode 100644 (file)
index 0000000..a566484
--- /dev/null
@@ -0,0 +1,866 @@
+Wed Oct 28 2020 Piotr Balcer <piotr.balcer@intel.com>
+
+       * Version 1.10
+
+       This release introduces a new stable PMDK library, libpmem2, which
+       is the next major release of libpmem.
+       This library has an entirely new, but familiar, API that addresses many
+       shortcomings of the previous version, while retaining all of its
+       functionality. To learn more, see https://pmem.io/pmdk/libpmem2/ or
+       libpmem2(7).
+       The old library, libpmem, is still going to be maintained for the
+       foreseeable future, but we'd like to encourage any new applications to
+       leverage libpmem2.
+
+Wed Sep 16 2020 Piotr Balcer <piotr.balcer@intel.com>
+
+       * Version 1.9.1
+
+       Detailed list of bug fixes:
+       - common: fix LIBFABRIC flags
+       - common: Add runtime SDS check and disable
+       - pool: disable SDS check if not supported
+       - obj: fix failure atomicity bug in huge allocs
+       - obj: add missing drain after ulog processing
+
+Fri Jul 3 2020 Piotr Balcer <piotr.balcer@intel.com>
+
+       * Version 1.9
+
+       This release:
+       - Switches the default instruction set for memcpy, memmove and memset
+       implementations on x86 to AVX512, and introduces numerous performance
+       improvements for those operations on AVX and SSE2 fallback paths.
+       - Optimizes transactional allocations in libpmemobj by avoiding one
+       extraneous cache miss and reducing the amount of work required to perform
+       a reservation.
+       - Introduces a new API in libpmemobj, pmemobj_tx_set_failure_behavior,
+       that enables the application to control the behavior of aborting
+       transactions.
+       - Improves performance of pool creation on Windows by avoiding expensive
+       physical page allocation during file allocation.
+       - Stabilizes support for ppc64.
+
+       Other changes:
+       - pmem: mem[cpy|set] optimization when eADR is available
+       - obj: detect msync failures in non-pmem variants of mem[cpy|move|set]
+
+       Notable bug fixes:
+       - core: fix Last_errormsg_get when NO_LIBPTHREAD is defined
+       - pmem: read Unsafe Shutdown Count from region instead of interleave set
+       - common: fix deep_flushes failing on platforms that don't need them
+       - pmem: fix data cache flush on ppc64
+       - obj: fix run allocated recalculation
+
+Fri Jan 31 2020 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.8
+
+       This release:
+       - Introduces new API in libpmemobj for user-assisted defragmentation
+         (see pmemobj_defrag man page for details).
+       - Introduces experimental support for PPC64LE architecture.
+       - Introduces new flag in libpmemobj for opting-out of transaction aborts
+         on failure (POBJ_TX_NO_ABORT), along with new variants of existing APIs
+         that didn't accept flags (pmemobj_tx_xfree, pmemobj_tx_xpublish,
+         pmemobj_tx_xlock, pmemobj_tx_xlog_append_buffer, pmemobj_tx_xstrdup,
+         pmemobj_tx_xwcsdup).
+       - Moves out libvmem and libvmmalloc to the new repository
+         (https://github.com/pmem/vmem).
+
+       Other changes:
+       - obj: introduce new statistics useful for defrag
+       - obj: introduce transient/persistent statistics enabling
+       - obj: introduce pmemobj_tx_(set/get)_user_data funcs
+       - obj: introduce pmemobj_(set/get)_user_data funcs
+       - obj: disable workaround for offsetof() since VS 15.5 in public header
+       - common: drop support for libndctl < 63 on Linux
+       - pool: rename -N --no-exec to -d --dry-run
+
+       Notable bug fixes:
+       - obj: fix zone size calculations
+       - obj: fix potential NULL-dereference in ulog_store
+       - obj: fix unintended recursive locking during palloc
+       - obj: fix lock release order in palloc publish
+       - obj: fix transient redo log of more than 64 entries
+       - obj: fix capacity ulog calculation
+       - obj: fix check of unaligned capacity size
+       - rpmem: add a missing case for GPSPM + FLUSH_STRICT
+       - pmem: fix pmemcheck support on platforms with eADR
+       - pool: fix possible memory leak
+       - rpmem: fix possible memory leak in rpmemd_config_read
+       - rpmem: fix possible memory leak in rpmemd_log_init
+       - rpmem: fix possible use-after-free
+
+Mon Sep 30 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.7
+
+       This release:
+       - Introduces new APIs in libpmemobj for managing space used by transactions.
+         (see pmemobj_tx_log_append_buffer man page for details)
+       - Introduces new APIs in librpmem, splitting rpmem_persist into rpmem_flush
+         and rpmem_drain, allowing applications to use the flush + drain model
+         already known from libpmem. (libpmemobj does not use this feature yet)
+       - Optimizes large libpmemobj transactions by significantly reducing
+         the amount of memory modified at the commit phase.
+       - Optimizes tracking of libpmemobj reservations.
+       - Adds new flags for libpmemobj's pmemobj_tx_xadd_range[_direct] API:
+         POBJ_XADD_NO_SNAPSHOT and POBJ_XADD_ASSUME_INITIALIZED, allowing
+         applications to optimize how memory is tracked by the library.
+
+       To support some of the above changes the libpmemobj on-media layout had
+       to be changed, which means that old pools have to be converted using
+       pmdk-convert >= 1.7.
+
+       Other changes:
+       - obj: fix merging of ranges when NOFLUSH flag is used (pmem/issues#1100)
+       - rpmem: fix closing of ssh connection (pmem/issues#995, pmem/issues#1060)
+       - obj: abort transaction on pmemobj_tx_publish failure
+
+       Internal changes:
+       - test: fault injection tests for pmemblk, pmemlog, and pmemobj
+       - test: improved Python testing framework
+       - test: support real pmem in bad blocks tests
+       - common: allow not building examples and benchmarks
+
+Tue Aug 27 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.6.1
+
+       This release fixes possible pool corruptions on Windows
+       (see https://github.com/pmem/pmdk/pull/3728 for details),
+       improves compatibility with newer Linux kernels with
+       respect to Device DAX detection, fixes pmemobj space management
+       for large pools, improves compatibility with newer toolchains,
+       incorporates build fixes for FreeBSD and fixes a number of
+       smaller bugs.
+
+       Detailed list of bug fixes:
+       - common: (win) fix possible pool file coruption (pmem/issues#972,
+         pmem/issues#715, pmem/issues#603)
+       - common: implement correct / robust device_dax_alignment
+         (pmem/issues#1071)
+       - obj: fix recycler not locating unused chunks
+       - doc: update pmemobj_tx_lock documentation wrt behavior on fail
+       - common: fix persistent domain detection (pmem/issues#1093)
+       - common: vecq: fix a pointer-to-struct aliasing violation
+         (crash on arm64)
+       - common: fix minor issues related to ndctl linking
+       - obj: drop recursion from pmemobj_next
+       - common: fix bug in badblock file error handling
+       - obj: fix handling of malloc failures
+       - common: fix handling of malloc failures (ctl)
+       - jemalloc: fix build with gcc 9
+       - obj: don't overwrite errno when palloc_heap_check_remote fails
+       - doc: fix pmreorder emit log macro
+       - rpmem: change order of rpmem init (pmem/issues#1043)
+       - common: Fix build failure due to unused macro PAGE_SIZE
+       - common: support older versions of pkg-config
+       - tools: link with release variant of pmemcommon
+       - common: add PMDK prefix to local copy of queue.h (pmem/issues#990)
+       - rpmem: switch to using an open coded basename (FreeBSD)
+       - common: posix_fallocate: guard against integer underflow in
+         check (FreeBSD)
+       - test: support Valgrind 3.15
+       - test: skip if fi_info is missing
+       - test: (win) fix sparsefile error handling
+       - test: fix libpmempool_feature tests that match logs
+       - test: remove vmem_delete test (pmem/issues#1074)
+       - test: adjust matchfiles in vmem_valgrind_region test (pmem/issues#1087)
+       - test: remove old log files for windows (pmem/issues#1013)
+       - test: remove invalid expect_normal_exit (pmem/issues#1092)
+       - test: suppress ld leak (pmem/issues#1098)
+       - test: Expose necessary symbols in libvmmalloc_dummy_funcs
+         (FreeBSD)
+       - test: fix tests failing because `tput` fails (FreeBSD)
+       - test: avoid obj_critnib_mt taking very long on many-core machines
+       - test: deal with libndctl's path without build system
+       - test: overwrite old log in pmempool_create/TEST14.PS1
+       - test: fix match files in tests which use dax devices
+       - test: fix match file in rpmem_addr_ext test
+       - test: fix pmempool_check test
+
+Wed Aug 28 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.5.2
+
+       This release fixes possible pool corruptions on Windows
+       (see https://github.com/pmem/pmdk/pull/3728 for details),
+       improves compatibility with newer Linux kernels with
+       respect to Device DAX detection, fixes pmemobj space management
+       for large pools, improves compatibility with newer toolchains
+       and fixes a number of smaller bugs.
+
+       Detailed list of bug fixes:
+       - common: (win) fix possible pool file coruption (pmem/issues#972,
+         pmem/issues#715, pmem/issues#603)
+       - common: implement correct / robust device_dax_alignment
+         (pmem/issues#1071)
+       - obj: fix crash after large undo log recovery
+       - obj: fix recycler not locating unused chunks
+       - doc: update pmemobj_tx_lock documentation wrt behavior on fail
+       - common: fix build of rpm packages on suse (pmem/issues#1023)
+       - common: fix persistent domain detection (pmem/issues#1093)
+       - common: vecq: fix a pointer-to-struct aliasing violation
+         (crash on arm64)
+       - rpmem: lock file prior to unlink (pmem/issues#833)
+       - common: fix for pool_set error handling (pmem/issues#1036)
+       - pmreorder: fix handling of store drain flush drain pattern
+       - obj: fix possible memory leak in tx_add_lock
+       - pool: free bad_block vector
+       - common: fix bug in badblock file error handling
+       - obj: fix handling of malloc failures
+       - common: fix handling of malloc failures (ctl)
+       - jemalloc: fix build with gcc 9
+       - obj: don't overwrite errno when palloc_heap_check_remote fails
+       - doc: fix typos in pmreorder configuration
+       - doc: fix pmreorder emit log macro
+       - tools: link with release variant of pmemcommon
+       - test: support Valgrind 3.15
+       - test: skip if fi_info is missing
+       - test: split test obj_tx_lock into two test cases (pmem/issues#1027)
+       - test: (win) fix sparsefile error handling
+       - test: fix libpmempool_feature tests that match logs
+       - test: remove vmem_delete test (pmem/issues#1074)
+       - test: adjust matchfiles in vmem_valgrind_region test (pmem/issues#1087)
+       - test: remove old log files for windows (pmem/issues#1013)
+       - test: remove invalid expect_normal_exit (pmem/issues#1092)
+       - test: suppress ld leak (pmem/issues#1098)
+       - test: fix failing pmemdetect on Windows
+       - test: fix match files in tests which use dax devices
+       - test: fix pmempool_check test
+
+Fri Aug 30 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.4.3
+
+       This release fixes possible pool corruptions on Windows
+       (see https://github.com/pmem/pmdk/pull/3728 for details)
+       and improves compatibility with newer Linux kernels with
+       respect to Device DAX detection.
+
+       Bug fixes:
+       - common: (win) fix possible pool file coruption (pmem/issues#972,
+         pmem/issues#715, pmem/issues#603)
+       - common: implement correct / robust device_dax_alignment
+         (pmem/issues#1071)
+       - common: fix device dax detection
+       - obj: fix pmemobj_check for pools with some sizes (pmem/issues#975)
+       - obj: fix type numbers for pmemobj_list_insert_new
+       - obj: fix pmemobj_tx_lock error handling
+       - obj: fix possible memory leak in tx_add_lock
+       - common: fix ctl_load_config during libpmemobj initialization
+         (pmem/issues#917)
+       - common: win: fix getopt returning "option is ambiguous"
+       - common: fix persistent domain detection (pmem/issues#1093)
+       - pool: do not copy same regions in update_uuids
+       - test: split test obj_tx_lock into two test cases
+       - test: remove checking errno in obj_tx_add_range_direct
+       - test: remove invalid expect_normal_exit
+       - test: fix int overflow in pmem_deep_persist test
+       - test: fix pmempool_check test
+       - test: (win) fix a few issues related to long paths
+
+Tue Aug 27 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.3.3
+       Bug fixes:
+       - pmem: fix clflush bit position
+       - common: implement correct / robust device_dax_alignment
+       - common: fix device dax detection
+       - common: fix library dependencies (pmem/issues#767)
+       - common: use rpm-config CFLAGS/LDFLAGS when building packages
+         (pmem/issues#768)
+       - test: fix vmmalloc_malloc_hooks (pmem/issues#773)
+       - test: fix compilation with clang-5.0 (pmem/issues#783)
+       - pool: fix set convert of v3 -> v4
+       - common: generate pkg-config files on make install
+         (pmem/issues#610)
+       - common: fix dependencies for Debian's dev packages
+       - test: add missing include in unittest.h
+       - common: (win) fix timed locks
+       - common: provide src version in GitHub tarballs
+       - common: fix free function in tls
+
+Tue Aug 27 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.2.4
+       Bug fixes:
+       - common: fix device dax detection (compatibility with newer kernels)
+
+Tue Mar 26 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.6
+
+       This release:
+       - Enables unsafe shutdown and bad block detection on Linux
+         on systems with libndctl >= 63. It is expected that systems with
+         libndctl >= 63 has necessary kernel support (Linux >= 4.20).
+         However, due to bugs in libndctl = 63 and Linux = 4.20, it is
+         recommended to use libndctl >= 64.1 and Linux >= 5.0.4.
+         On systems with libndctl < 63, PMDK uses old superuser-only
+         interfaces. Support for old or new interfaces is chosen at BUILD
+         time.
+       - Introduces arena control interface in pmemobj, allowing applications
+         to tweak performance and scalability of heap operations. See
+         pmemobj_ctl_get man page ("heap" namespace) for details.
+       - Introduces copy_on_write mode, which allows testing applications
+         using pmemobj with pmreorder. See pmemobj_ctl_get man page
+         ("copy_on_write" namespace) for details.
+
+       Other changes:
+       - allocate file space when creating a pool on existing file
+         (pmem/issues#167)
+       - initial support for testing using fault injection
+       - initial Python test framework
+       - improve performance of pmemobj_pool_by_ptr
+
+       Bug fixes:
+       - common: work around tmpfs bug during pool creation
+         (pmem/issues#1018)
+       - pool: race-free pmempool create --max-size
+       - obj: don't modify remote pools in pmemobj_check
+
+Tue Feb 19 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.5.1
+
+       This release fixes minor bugs and improves compatibility with newer
+       tool chains.
+
+       Notable bug fixes:
+       - common: make detection of device-dax instances more robust
+       - obj: fix pmemobj_check for pools with some sizes
+       - obj: don't use anon struct in an union (public header)
+       - obj: fix pmemobj_tx_lock error handling
+       - obj: don't use braces in an expression with clang (public header)
+       - obj: suppress pmemcheck warnings for statistics
+       - pmreorder: fix markers nontype issue
+
+Fri Oct 26 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.5
+
+       This release has had two major focus areas - performance and RAS
+       (Reliability, Availability and Serviceability). Beyond that, it introduces
+       new APIs, new tools and many other improvements. As a side effect
+       of performance optimizations, the libpmemobj on-media layout had to be
+       changed, which means that old pools have to be converted using pmdk-convert.
+       libpmemcto experiment has been finished and removed from the tree.
+
+       For more details, please see https://pmem.io/2018/10/22/release-1-5.html.
+
+       New features:
+       - common: unsafe shutdown detection (SDS)
+       - common: detection and repair of uncorrectable memory errors (bad blocks)
+       - pool: new "feature" subcommand for enabling and disabling detection of
+         unsafe shutdown and uncorrectable memory errors
+       - common: auto flush detection on Windows (on Linux since 1.4)
+       - pmreorder: new tool for verification of persistent memory algorithms
+       - obj: new on media layout
+       - pmem/obj: new flexible memcpy|memmove|memset API
+       - obj: new flushing APIs: pmemobj_xpersist, pmemobj_xflush
+         (PMEMOBJ_F_RELAXED)
+       - rpmem: new flag RPMEM_PERSIST_RELAXED for rpmem_persist
+       - obj: lazily initialized volatile variables (pmemobj_volatile)
+         (EXPERIMENTAL)
+       - obj: allocation classes with alignment
+       - obj: new action APIs: pmemobj_defer_free, POBJ_XRESERVE_NEW,
+         POBJ_XRESERVE_ALLOC
+       - blk/log: new "ctl" API
+
+       Optimizations:
+       - obj: major performance improvements for AEP NVDIMMs
+       - obj: better space utilization for small allocations
+       - common: call msync only on one page for deep drain
+
+       Other changes:
+       - cto: removed
+       - obj: remove actions limit
+       - common: new dependency on libndctl on Linux
+       - pmempool: "convert" subcommand is now a wrapper around pmdk-convert
+         (please see https://github.com/pmem/pmdk-convert)
+       - obj: C++ bindings have been moved to a new repository
+         (please see https://github.com/pmem/libpmemobj-cpp)
+
+       Bug fixes:
+       - obj: fix type numbers for pmemobj_list_insert_new
+       - pmem: fix inconsistency in pmem_is_pmem
+       - common: fix windows mmap destruction
+       - daxio: fix checking and adjusting length
+       - common: fix long paths support on Windows
+
+Thu Aug 16 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.4.2
+
+       This release fixes the way PMDK reports its version via
+       pkg-config files.
+
+       Bug fixes:
+       - common: fix reported version
+       - doc: use single "-" in NAME section (pmem/issues#914)
+
+Fri Jun 29 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
+
+       * Version 1.4.1
+
+       In 1.4 development cycle, we created new daxio utility
+       (command line tool for performing I/O on Device-DAX), but due
+       to some complications we had to disable it just before
+       the 1.4 release.
+       In 1.4.1 we finally enable it. Daxio depends on ndctl v60.1.
+
+       Bug fixes:
+       - pmem: fix clflush bit position
+       - obj: fix invalid OOMs when zones are fully packed
+       - obj: don't register undo logs twice in memcheck
+       - pool: fix bash completion script
+       - pool: fix incorrect errno after transform
+       - obj: fix clang-7 compilation
+       - obj: test for msync failures in non-pmem path
+       - doc: add missing field to alloc class entry point
+       - common: (win) fix timed locks
+       - common: provide src version in GitHub tarballs
+       - common: fix free function in tls
+       - common: fix double close
+       - test: allow testing installed libraries
+       - test: fix Valgrind vs stripped libraries issue
+       - test: fix dependencies between tests and tools
+       - test: fix races on make pcheck -jN
+       - test: use libvmmalloc.so.1
+       - test: fix incorrect number of required dax devices
+       - test: add suppression for leak in ld.so
+       - test: fail if memcheck detects overlapping chunks
+       - test: simplify time measurements in obj_sync
+       - benchmark: check lseek() return value
+       - examples: catch exceptions in map_cli
+
+Thu Mar 29 2018 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.4
+       This is the first release of PMDK under a new name.
+       The NVML project has been renamed to PMDK (Persistent Memory
+       Development Kit).  This is only the project/repo name change
+       and it does not affect the names of the PMDK packages.
+       See this blog article for more details on the reasons and
+       impact of the name change:
+       https://pmem.io/2017/12/11/NVML-is-now-PMDK.html
+
+       New features:
+       - common: support for concatenated Device-DAX devices
+         with 2M/1G alignment
+       - common: add support for MAP_SYNC flag
+       - common: always enable Valgrind instrumentation (pmem/issues#292)
+       - common: pool set options / headerless pools
+       - pmem: add support for "deep flush" operation
+       - rpmem: add rpmem_deep_persist
+       - doc: split man pages and add per-function aliases (pmem/issues#385)
+
+       Optimizations:
+       - pmem: skip CPU cache flushing when eADR is available
+         (no Windows support yet)
+       - pmem: add AVX512F support in pmem_memcpy/memset (pmem/issues#656)
+
+       Bug fixes:
+       - common: fix library dependencies (pmem/issues#767, RHBZ #1539564)
+       - common: use rpm-config CFLAGS/LDFLAGS when building packages
+         (pmem/issues#768, RHBZ #1539564)
+       - common: do not unload librpmem on close (pmem/issues#776)
+       - common: fix NULL check in os_fopen (pmem/issues#813)
+       - common: fix missing version in .pc files
+       - obj: fix cancel of huge allocations (pmem/issues#726)
+       - obj: fix error handling in pmemobj_open (pmem/issues#750)
+       - obj: validate pe_offset in pmemobj_list_* APIs (pmem/issues#772)
+       - obj: fix add_range with size == 0 (pmem/issues#781)
+       - log: add check for negative iovcnt (pmem/issues#690)
+       - rpmem: limit maximum number of lanes (pmem/issues#609)
+       - rpmem: change order of memory registration (pmem/issues#655)
+       - rpmem: fix removing remote pools (pmem/issues#721)
+       - pool: fix error handling (pmem/issues#643)
+       - pool: fix sync with switched parts (pmem/issues#730)
+       - pool: fix sync with missing replica (pmem/issues#731)
+       - pool: fix detection of Device DAX size (pmem/issues#805)
+       - pool: fail pmempool_sync if there are no replicas (pmem/issues#816)
+       - benchmark: fix calculating standard deviation (pmem/issues#318)
+       - doc: clarify pmem_is_pmem behavior (pmem/issues#719)
+       - doc: clarify pmemobj_root behavior (pmem/issues#733)
+
+       Experimental features:
+       - common: port PMDK to FreeBSD
+       - common: add experimental support for aarch64
+       - obj: introduce allocation classes
+       - obj: introduce two-phase heap ops (reserve/publish)
+         (pmem/issues#380, pmem/issues#415)
+       - obj: provide basic heap statistics (pmem/issues#676)
+       - obj: implement run-time pool extending (pmem/issues#382)
+       - cto: add close-to-open persistence library (pmem/issues#192)
+
+       The following features are disabled by default, until
+       ndctl v60.0 is available:
+       - daxio: add utility to perform I/O on Device-DAX
+       - RAS: unsafe shutdown detection/handling
+
+Wed Dec 20 2017 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.3.1
+       Bug fixes:
+       - rpmem: fix issues reported by Coverity
+       - rpmem: fix read error handling
+       - rpmem: add fip monitor (pmem/issues#597)
+       - test: add rpmemd termination handling test
+       - cpp: fix pop.persist function in obj_cpp_ptr
+       - rpmem: return failure for a failed allocation
+       - rpmem: fix potential memory leak
+       - common: fix available rm options msg (pmem/issues#651)
+       - pool: fix pmempool_get_max_size
+       - obj: fix potential deadlock during realloc
+         (pmem/issues#635, pmem/issues#636, pmem/issues#637)
+       - obj: initialize TLS data
+       - rpmem: fix cleanup if fork() failed (pmem/issues#634)
+       - obj: fix bogus OOM after exhausting first zone
+
+Thu Jul 13 2017 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.3
+       This release introduces some useful features and optimizations
+       in libpmemobj.  Most of them are experimental and controlled by
+       the new pmemobj_ctl APIs.  For details, please check the feature
+       requests identified by the issue numbers listed next to the items below.
+
+       Other important changes are related to performance tuning and
+       stabilization of librpmem library, which is used by libpmemobj to get
+       remote access to persistent memory and to provide basic data replication
+       over RDMA.  The librpmem is still considered experimental.
+
+       NVML for Windows is feature complete (except for libvmmalloc).
+       This release includes the support for Unicode, long paths and
+       the NVML installer.
+
+       New features:
+       - common: add support for concatenated DAX Devices
+       - common: add Unicode support on Windows
+       - common: add long path support on Windows
+       - common: add NVML installer for Windows
+       - pmem: make pmem_is_pmem() true for Device DAX only
+       - obj: add pmemobj_wcsdup()/pmemobj_tx_wcsdup() APIs
+       - obj: export non-inlined pmemobj_direct()
+       - obj: add PMEMOBJ_NLANES env variable
+       - cpp: introduce the allocator
+       - cpp: add wstring version of C++ entry points
+       - vmem: add vmem_wcsdup() API entry
+       - pool: add pmempool_rm() function (pmem/issues#307)
+       - pool: add --force flag for create command (pmem/issues#529)
+       - benchmark: add a minimal execution time option
+       - benchmark: add thread affinity option
+       - benchmark: print 99% and 99.9% percentiles
+       - doc: separate Linux/Windows version of web-based man pages
+
+       Optimizations:
+       - obj: cache _pobj_cached_pool in pmemobj_direct()
+       - obj: optimize thread utilization of buckets
+       - obj: stop grabbing a lock when querying pool ptr
+       - rpmem: use multiple endpoints
+
+       Bug fixes:
+       - common: fix issues reported by static code analyzers
+       - pmem: fix mmap() implementation on Windows
+       - pmem: fix mapping addr/length alignment on Windows
+       - pmem: fix PMEM_MMAP_HINT implementation on Windows
+       - pmem: fix pmem_is_pmem() on invalid memory ranges
+       - pmem: fix wrong is_pmem returned by pmem_map_file()
+       - pmem: fix mprotect() for private mappings on Windows
+       - pmem: modify pmem_is_pmem() behavior for len==0
+       - obj: add failsafe to prevent allocs in constructor
+       - cpp: fix swap implementation
+       - cpp: fix sync primitives' constructors
+       - cpp: fix wrong pointer type in the allocator
+       - cpp: return persistent_ptr::swap to being public
+       - pool: treat invalid answer as 'n'
+       - pool: unify flags value for dry run
+       - pool: transform for remote replicas
+       - rpmem: persistency method detection
+       - benchmark: fix time measurement
+
+       Experimental features/optimizations:
+       - obj: pmemobjctl - statistics and control submodule
+         (pmem/issues#194, pmem/issues#211)
+       - obj: zero-overhead allocations - customizable alloc header
+         (pmem/issues#347)
+       - obj: flexible run size index (pmem/issues#377)
+       - obj: dynamic range cache (pmem/issues#378)
+       - obj: asynchronous post-commit (pmem/issues#381)
+       - obj: configurable object cache (pmem/issues#515)
+       - obj: add cache size and threshold tx params
+       - obj: add CTL var for suppressing expensive checks
+       - rpmem: add rpmem_set_attr() API entry
+       - rpmem: switch to libfabric v1.4.2
+
+Thu May 18 2017 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.2.3
+       Bug fixes:
+       - test: extend timeout for selected tests
+       - test: reduce number of operations in obj_tx_mt
+       - test: define cfree() as free() in vmmalloc_calloc
+
+       Other changes:
+       - common: move Docker images to new repo
+
+Sat Apr 15 2017 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.2.2
+       Bug fixes:
+       - pmempool: fix mapping type in pool_params_parse
+       - test: limit number of arenas in vmem_stats
+       - test: do not run pool_lock test as root
+       - common: fix pkg-config files
+       - common: fix building packages for Debian
+
+Tue Feb 21 2017 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.2.1
+       This NVML release changes the behavior of pmem_is_pmem() on Linux.
+       The pmem_is_pmem() function will now return true only if the entire
+       range is mapped directly from Device DAX (/dev/daxX.Y) without an
+       intervening file system, and only if the corresponding file mapping
+       was created with pmem_map_file().  See libpmem(7) for details.
+
+       Bug fixes:
+       - jemalloc: fix test compilation on Fedora 26 (rawhide)
+       - test: fix cpp test compilation on Fedora 26 (rawhide)
+       - common: use same queue.h on linux and windows
+       - common: queue.h clang static analyzer fix
+       - common: fix path handling in build-dpkg.sh
+       - test: fix match files in pmempool_transform/TEST8
+
+Fri Dec 30 2016 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.2 - Windows Technical Preview #1
+       This is the first Technical Preview release of NVML for Windows.
+       It is based on NVML 1.2 version, but not all the 1.2 features
+       are ported to Windows. In particular, Device DAX and remote access
+       to persistent memory (librpmem) are not supported by design.
+
+       NOTE: This release has not gone through the full validation cycle,
+       but only through some basic tests on Travis and AppVeyor.
+       Thus, it cannot be assumed "Production quality" and should not
+       be used in production environments.
+
+       Besides several minor improvements and bug fixes, all the other
+       changes since NVML 1.2 release were related to Windows support:
+       - win: port libvmem (and jemalloc)
+       - win: benchmarks Windows port
+       - win: fix mapping files of unaligned length
+       - win: clean up possible race condition in mmap_init()
+       - win: enable QueryVirtualMemoryInformation() in pmem_is_pmem()
+       - test: check open handles at START/DONE
+       - test: port all the remaining unit tests
+         (scope, pmem_map, obj_debug, util_poolset, pmempool_*)
+       - win: add resource files for versioning
+
+       Known issues and limitations of Windows version of NVML:
+       - Unicode support is missing.  The UTF/USC-encoded file paths
+         or pool set files may not be handled correctly.
+       - The libvmmalloc library is not ported yet.
+       - The on-media format of pmem pools is not portable at the moment.
+         The pmem pools created using Windows version of NVM libraries
+         cannot be open on Linux and vice versa.
+       - Despite the fact the current version of NVML would work
+         with any recent version of Windows OS, to take full
+         advantage of PMEM and NVML features and to benefit from
+         the PMEM performance, the recommended platforms needs be
+         equipped with the real NVDIMMs hardware and should support
+         the native, Microsoft's implementation of DAX-enabled file
+         system (i.e. Windows Server 2016 or later).
+         In case of using NVML with older versions of Windows or with
+         the custom implementation of PMEM/DAX drivers, the performance
+         might not be satisfactory.  Please, contact the provider
+         of PMEM/DAX drivers for your platform to get the customized
+         version of NVML in such case.
+
+Thu Dec 15 2016 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.2
+       This NVML release causes a "flag day" for libpmemobj.
+       The pmemobj pools built under NVML 1.1 are incompatible with pools built
+       under NVML 1.2 and later.  This is because an issue was discovered with
+       the alignment of locks (pmem/issues#358) and, although rare, the issue potentially
+       impacts program correctness, making the fix mandatory.
+       The major version number of the pmemobj pool layout and the version
+       of the libpmemobj API is changed to prevent the use of the potentially
+       incorrect layout.
+
+       Other key changes introduced in this release:
+       - Add Device DAX support, providing that "optimized flush" mechanism
+         defined in SNIA NVM Programming Model can safely be used, even
+         if PMEM-aware file system supporting that model is not available,
+         or if the user does not want to use the file system for some reason.
+       - Add a package for libpmemobj C++ bindings.
+         C++ API is no longer considered experimental.
+         Web-based documentation for C++ API is available on https://pmem.io.
+       - Add "sync" and "transform" commands to pmempool utility.
+         The "sync" command allows one to recover missing or corrupted part(s)
+         of a pool set from a healthy replica, while the "transform" command
+         is a convenient way for modifying the structure of an existing
+         pool set, i.e. by adding or removing replicas.
+       - Add experimental support for remote access to persistent memory and
+         basic remote data replication over RDMA (librpmem).  Experimental
+         support for remote replicas is also provided by libpmemobj library.
+
+       New features:
+       - common: add Device DAX support (pmem/issues#197)
+       - obj: add C++ bindings package (libpmemobj++-devel)
+       - obj: add TOID_OFFSETOF macro
+       - pmempool: add "sync" and "transform" commands
+         (pmem/issues#172, pmem/issues#196)
+
+       Bug fixes:
+       - obj: force alignment of pmem lock structures (pmem/issues#358)
+       - blk: cast translation entry to uint64_t when calculating data offset
+       - obj: fix Valgrind instrumentation of chunk headers and cancelled
+         allocations
+       - obj: set error message when user called pmemobj_tx_abort()
+       - obj: fix status returned by pmemobj_list_insert() (pmem/issues#226)
+       - obj: defer allocation of global structures
+
+       Optimizations:
+       - obj: fast path for pmemobj_pool_by_ptr() when inside a transaction
+       - obj: simplify and optimize allocation class generation
+
+       Experimental features:
+       - rpmem: add support for remote access to persistent memory and basic
+         remote data replication over RDMA
+       - libpmempool: add pmempool_sync() and pmempool_transform() (pmem/issues#196)
+       - obj: introduce pmemobj_oid()
+       - obj: add pmemobj_tx_xalloc()/pmemobj_tx_xadd_range() APIs and
+         the corresponding macros
+       - obj: add transaction stage transition callbacks
+
+Thu Jun 23 2016 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.1
+       This NVML release introduces a new version of libpmemobj pool layout.
+       Internal undo log structure has been modified to improve performance
+       of pmemobj transactions.  Memory pools created with older versions
+       of the libpmemobj library must be converted to the new format using
+       "pmempool convert" command.  See pmempool-convert(1) for details.
+
+       A new "libpmempool" library is available, providing support for
+       off-line pool management and diagnostics.  Initially it provides only
+       "check" and "repair" operations for log and blk memory pools, and for
+       BTT devices.
+
+       Other changes:
+       - pmem: deprecate PCOMMIT
+       - blk: match BTT Flog initialization with Linux NVDIMM BTT
+       - pmem: defer pmem_is_pmem() initialization (pmem/issues#158)
+       - obj: add TOID_TYPEOF macro
+
+       Bug fixes:
+       - doc: update description of valid file size units (pmem/issues#133)
+       - pmempool: fix --version short option in man page (pmem/issues#135)
+       - pmempool: print usage when running rm without arg (pmem/issues#136)
+       - cpp: clarify polymorphism in persistent_ptr (pmem/issues#150)
+       - obj: let the before flag be any non-zero value (pmem/issues#151)
+       - obj: fix compare array pptr to nullptr (pmem/issues#152)
+       - obj: cpp pool.get_root() fix (pmem/issues#156)
+       - log/blk: set errno if replica section is specified (pmem/issues#161)
+       - cpp: change exception message (pmem/issues#163)
+       - doc: remove duplicated words in man page (pmem/issues#164)
+       - common: always append EXTRA_CFLAGS after our CFLAGS
+
+       Experimental features:
+       - Implementation of C++ bindings for libpmempobj is complete.
+         Web-based documentation for C++ API is available on https://pmem.io.
+         Note that C++ API is still considered experimental.  Do not use it
+         in production environments.
+       - Porting NVML to Windows is in progress.  There are MS Visual Studio
+         solution/projects available, allowing to compile libpmem, libpmemlog,
+         libpmemblk and libpmemobj on Windows, but the libraries are not fully
+         functional and most of the test are not enabled yet.
+
+Thu Apr 07 2016 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 1.0
+       The API of six libraries (libpmem, libpmemblk, libpmemlog,
+       libpmemobj, libvmem, libvmmalloc) is complete and stable.
+       The on-media layout of persistent memory pools will be maintained
+       from this point, and if changed it will be backward compatible.
+       Man pages are all complete.
+       This release has been validated to "Production quality".
+
+       For the purpose of new features planned for next releases of NVML
+       there have been some API modifications made:
+               - pmem: pmem_map replaced with pmem_map_file
+               - log/blk: 'off_t' substituted with 'long long'
+               - obj: type numbers extended to 64-bit
+               - obj: new entry points and macros added:
+                 pmemobj_tx_errno, pmemobj_tx_lock, pmemobj_mutex_timedlock,
+                 TX_ADD_DIRECT, TX_ADD_FIELD_DIRECT, TX_SET_DIRECT
+
+       Other key changes since version 0.4 include:
+               - common: updated/fixed installation scripts
+               - common: eliminated dependency on libuuid
+               - pmem: CPU features/ISA detection using CPUID
+               - obj: improved error handling
+               - obj: atomic allocation fails if constructor returns error
+               - obj: multiple performance optimizations
+               - obj: object store refactoring
+               - obj: additional examples and benchmarks
+
+       This release also introduces a prototype implementation
+       of C++ bindings for libpmemobj.  Note that C++ API is still
+       experimental and should not be used in production environments.
+
+Fri Dec 04 2015 Krzysztof Czurylo <krzysztof.czurylo@intel.com>
+
+       * Version 0.4
+       This NVML version primarily focuses on improving code quality
+       and reliability.  In addition to a couple of bug fixes,
+       the changes include:
+               - benchmarks for libpmemobj, libpmemblk and libvmem
+               - additional pmemobj tests and examples
+               - pool mapping address randomization
+               - added pmempool "rm" command
+               - eliminated libpmem dependency on libpthread
+               - enabled extra warnings
+               - minor performance improvements
+       Man pages are all complete.
+       This release is considered "Beta quality" by the team, having
+       been thoroughly validated, including significant performance analysis.
+       The pmempool command does not yet support "check" and "repair"
+       operations for pmemobj type pools.
+
+Sun Sep 13 2015 Andy Rudoff <andy.rudoff@intel.com>
+
+       * Version 0.3
+       NVML is now feature complete, adding support for:
+               - pool sets
+               - pmemobj local replication (active/passive)
+               - experimental valgrind support
+               - pmempool support for all pool types
+       Man pages are all complete.
+       This release is considered "Alpha quality" by the team, having
+       gone through significant validation but only some performance
+       analysis at this point.
+
+Tue Jun 30 2015 Andy Rudoff <andy.rudoff@intel.com>
+
+       * Version 0.2
+       NVML now consists of six libraries:
+               - libpmem                            (basic flushing, etc)
+               - libpmemblk, libpmemlog, libpmemobj (transactions)
+               - libvmem, libvmmalloc               (volatile use of pmem)
+       The "pmempool" command is available for managing pmem files.
+       Man pages for all the above are complete.
+       The only things documented in man pages but not implemented are:
+               - pmem sets (ability to spread a pool over a set of files)
+               - replication (coming for libpmemobj)
+       The pmempool command does not yet support pmemobj type pools.
+
+Thu Sep 11 2014 Andy Rudoff <andy.rudoff@intel.com>
+
+       * Version 0.1
+       Initial development done in 0.1 builds
diff --git a/ceph/src/pmdk/LICENSE b/ceph/src/pmdk/LICENSE
new file mode 100644 (file)
index 0000000..c80f5df
--- /dev/null
@@ -0,0 +1,39 @@
+SPDX-License-Identifier: BSD-3-Clause
+Copyright 2014-2020, Intel Corporation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    * Neither the name of the copyright holder nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Everything in this source tree is covered by the previous license
+with the following exceptions:
+
+* src/core/valgrind/valgrind.h, src/core/valgrind/memcheck.h,
+  src/core/valgrind/helgrind.h, src/core/valgrind/drd.h are covered by
+  another similar BSD license variant, contained in those files.
+
+* utils/cstyle (used only during development) licensed under CDDL.
diff --git a/ceph/src/pmdk/Makefile b/ceph/src/pmdk/Makefile
new file mode 100644 (file)
index 0000000..a44fe08
--- /dev/null
@@ -0,0 +1,136 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# Makefile -- top-level Makefile for PMDK
+#
+# Use "make" to build the library.
+#
+# Use "make doc" to build documentation.
+#
+# Use "make test" to build unit tests. Add "SKIP_SYNC_REMOTES=y" to skip
+# or "FORCE_SYNC_REMOTES=y" to force syncing remote nodes if any is defined.
+#
+# Use "make check" to run unit tests.
+#
+# Use "make check-remote" to run only remote unit tests.
+#
+# Use "make clean" to delete all intermediate files (*.o, etc).
+#
+# Use "make clobber" to delete everything re-buildable (binaries, etc.).
+#
+# Use "make cstyle" to run cstyle on all C source files
+#
+# Use "make check-license" to check copyright and license in all source files
+#
+# Use "make rpm" to build rpm packages
+#
+# Use "make dpkg" to build dpkg packages
+#
+# Use "make source DESTDIR=path_to_dir" to copy source files
+# from HEAD to 'path_to_dir/pmdk' directory.
+#
+# As root, use "make install" to install the library in the usual
+# locations (/usr/local/lib, /usr/local/include, and /usr/local/share/man).
+# You can provide custom directory prefix for installation using
+# DESTDIR variable e.g.: "make install DESTDIR=/opt"
+# You can override the prefix within DESTDIR using prefix variable
+# e.g.: "make install prefix=/usr"
+
+include src/common.inc
+
+RPM_BUILDDIR=rpmbuild
+DPKG_BUILDDIR=dpkgbuild
+EXPERIMENTAL ?= n
+BUILD_PACKAGE_CHECK ?= y
+BUILD_RPMEM ?= y
+TEST_CONFIG_FILE ?= "$(CURDIR)"/src/test/testconfig.sh
+DOC ?= y
+
+rpm : override DESTDIR="$(CURDIR)/$(RPM_BUILDDIR)"
+dpkg: override DESTDIR="$(CURDIR)/$(DPKG_BUILDDIR)"
+rpm dpkg: override prefix=/usr
+
+all: doc
+       $(MAKE) -C src $@
+
+doc:
+ifeq ($(DOC),y)
+       test -f .skip-doc || $(MAKE) -C doc all
+endif
+
+clean:
+       $(MAKE) -C src $@
+ifeq ($(DOC),y)
+       test -f .skip-doc || $(MAKE) -C doc $@
+endif
+       $(RM) -r $(RPM_BUILDDIR) $(DPKG_BUILDDIR)
+       $(RM) -f $(GIT_VERSION)
+
+clobber:
+       $(MAKE) -C src $@
+ifeq ($(DOC),y)
+       test -f .skip-doc || $(MAKE) -C doc $@
+endif
+       $(RM) -r $(RPM_BUILDDIR) $(DPKG_BUILDDIR) rpm dpkg
+       $(RM) -f $(GIT_VERSION)
+
+require-rpmem:
+ifneq ($(BUILD_RPMEM),y)
+       $(error ERROR: cannot run remote tests because $(BUILD_RPMEM_INFO))
+endif
+
+check-remote: require-rpmem all
+       $(MAKE) -C src $@
+
+test check pcheck pycheck: all
+       $(MAKE) -C src $@
+
+check pcheck pycheck: check-doc
+
+cstyle:
+       test -d .git && utils/check-commits.sh
+       $(MAKE) -C src $@
+       $(MAKE) -C utils $@
+       @echo Checking files for whitespace issues...
+       @utils/check_whitespace -g
+       @echo Done.
+
+format:
+       $(MAKE) -C src $@
+       @echo Done.
+
+check-license:
+       @utils/check_license/check-headers.sh $(TOP) BSD-3-Clause
+       @echo Done.
+
+check-doc: doc
+       BUILD_RPMEM="$(BUILD_RPMEM)" utils/check-manpages
+
+sparse:
+       $(MAKE) -C src sparse
+
+source: clobber
+       $(if "$(DESTDIR)", , $(error Please provide DESTDIR variable))
+       +utils/copy-source.sh "$(DESTDIR)" $(SRCVERSION)
+
+pkg-clean:
+       $(RM) -r "$(DESTDIR)"
+
+rpm dpkg: pkg-clean
+       $(MAKE) source DESTDIR="$(DESTDIR)"
+       +utils/build-$@.sh -t $(SRCVERSION) -s "$(DESTDIR)"/pmdk -w "$(DESTDIR)" -o $(CURDIR)/$@\
+                       -e $(EXPERIMENTAL) -c $(BUILD_PACKAGE_CHECK) -r $(BUILD_RPMEM)\
+                       -f $(TEST_CONFIG_FILE) -n $(NDCTL_ENABLE)
+
+install: all
+
+install uninstall:
+       $(MAKE) -C src $@
+ifeq ($(DOC),y)
+       $(MAKE) -C doc $@
+endif
+
+.PHONY: all clean clobber test check cstyle check-license install uninstall\
+       source rpm dpkg pkg-clean pcheck check-remote format doc require-rpmem\
+       $(SUBDIRS)
diff --git a/ceph/src/pmdk/README.md b/ceph/src/pmdk/README.md
new file mode 100644 (file)
index 0000000..fcbaea8
--- /dev/null
@@ -0,0 +1,386 @@
+# **PMDK: Persistent Memory Development Kit**
+
+[![Travis build status](https://travis-ci.org/pmem/pmdk.svg?branch=master)](https://travis-ci.org/pmem/pmdk)
+[![GHA build status](https://github.com/pmem/pmdk/workflows/PMDK/badge.svg?branch=master)](https://github.com/pmem/pmdk/actions)
+[![Appveyor build status](https://ci.appveyor.com/api/projects/status/u2l1db7ucl5ktq10/branch/master?svg=true&pr=false)](https://ci.appveyor.com/project/pmem/pmdk/branch/master)
+[![Cirrus build status](https://api.cirrus-ci.com/github/pmem/pmdk.svg)](https://cirrus-ci.com/github/pmem/pmdk/master)
+[![Coverity Scan Build Status](https://img.shields.io/coverity/scan/3015.svg)](https://scan.coverity.com/projects/pmem-pmdk)
+[![Coverage Status](https://codecov.io/github/pmem/pmdk/coverage.svg?branch=master)](https://codecov.io/gh/pmem/pmdk/branch/master)
+[![PMDK release version](https://img.shields.io/github/release/pmem/pmdk.svg?sort=semver)](https://github.com/pmem/pmdk/releases/latest)
+[![Packaging status](https://repology.org/badge/tiny-repos/pmdk.svg)](https://repology.org/project/pmdk/versions)
+
+The **Persistent Memory Development Kit (PMDK)** is a collection of libraries and tools for System Administrators and Application Developers to simplify managing and accessing persistent memory devices. For more information, see https://pmem.io.
+
+To install PMDK libraries, either install pre-built packages, which we build for every stable release, or clone the tree and build it yourself. **Pre-built** packages can be found in popular Linux distribution package repositories, or you can check out our recent stable releases on our [github release page](https://github.com/pmem/pmdk/releases). Specific installation instructions are outlined below.
+
+Bugs and feature requests for this repo are tracked in our [GitHub Issues Database](https://github.com/pmem/pmdk/issues).
+
+## Contents
+1. [Libraries and Utilities](#libraries-and-utilities)
+2. [Getting Started](#getting-started)
+3. [Version Conventions](#version-conventions)
+4. [Pre-Built Packages for Windows](#pre-built-packages-for-windows)
+5. [Dependencies](#dependencies)
+       * [Linux](#linux)
+       * [Windows](#windows)
+       * [FreeBSD](#freebsd)
+6. [Building PMDK on Linux or FreeBSD](#building-pmdk-on-linux-or-freebsd)
+       * [Make Options](#make-options)
+       * [Testing Libraries](#testing-libraries-on-linux-and-freebsd)
+       * [Memory Management Tools](#memory-management-tools)
+7. [Building PMDK on Windows](#building-pmdk-on-windows)
+       * [Testing Libraries](#testing-libraries-on-windows)
+8. [Experimental Packages](#experimental-packages)
+       * [librpmem and rpmemd packages](#the-librpmem-and-rpmemd-packages)
+       * [Experimental support for 64-bit ARM](#experimental-support-for-64-bit-arm)
+9. [Contact Us](#contact-us)
+
+## Libraries and Utilities
+Available Libraries:
+- [libpmem](https://pmem.io/pmdk/libpmem/):  provides low level persistent memory support
+
+- [libpmemobj](https://pmem.io/pmdk/libpmemobj/):  provides a transactional object store, providing memory allocation, transactions, and general facilities for persistent memory programming.
+
+- [libpmemblk](https://pmem.io/pmdk/libpmemblk/):  supports arrays of pmem-resident blocks, all the same size, that are atomically updated.
+
+- [libpmemlog](https://pmem.io/pmdk/libpmemlog/):  provides a pmem-resident log file.
+
+- [libpmempool](https://pmem.io/pmdk/libpmempool/):  provides support for off-line pool management and diagnostics.
+
+- [librpmem](https://pmem.io/pmdk/librpmem/)<sup>1</sup>:  provides low-level support for remote access to persistent memory utilizing RDMA-capable RNICs.
+
+If you're looking for *libvmem* and *libvmmalloc*, they have been moved to a
+[separate repository](https://github.com/pmem/vmem).
+
+Available Utilities:
+
+- [pmempool](https://pmem.io/pmdk/pmempool/): Manage and analyze persistent memory pools with this stand-alone utility
+
+- [pmemcheck](https://pmem.io/2015/07/17/pmemcheck-basic.html): Use dynamic runtime analysis with an enhanced version of Valgrind for use with persistent memory.
+
+Currently these libraries only work on 64-bit Linux, Windows<sup>2</sup>, and 64-bit FreeBSD 11+<sup>3</sup>.
+For information on how these libraries are licensed, see our [LICENSE](LICENSE) file.
+
+><sup>1</sup> Not supported on Windows.
+>
+><sup>2</sup> PMDK for Windows is feature complete, but not yet considered production quality.
+>
+><sup>3</sup> DAX and **libfabric** are not yet supported in FreeBSD, so at this time PMDK is available as a technical preview release for development purposes.
+
+## Getting Started
+
+Getting Started with Persistent Memory Programming is a tutorial series created by Intel Architect, Andy Rudoff. In this tutorial, you will be introduced to persistent memory programming and learn how to apply it to your applications.
+- Part 1: [What is Persistent Memory?](https://software.intel.com/en-us/persistent-memory/get-started/series)
+- Part 2: [Describing The SNIA Programming Model](https://software.intel.com/en-us/videos/the-nvm-programming-model-persistent-memory-programming-series)
+- Part 3: [Introduction to PMDK Libraries](https://software.intel.com/en-us/videos/intro-to-the-nvm-libraries-persistent-memory-programming-series)
+- Part 4: [Thinking Transactionally](https://software.intel.com/en-us/videos/thinking-transactionally-persistent-memory-programming-series)
+- Part 5: [A C++ Example](https://software.intel.com/en-us/videos/a-c-example-persistent-memory-programming-series)
+
+Additionally, we recommend reading [Introduction to Programming with Persistent Memory from Intel](https://software.intel.com/en-us/articles/introduction-to-programming-with-persistent-memory-from-intel)
+
+## Version Conventions
+
+- **Builds** are tagged something like `0.2+b1`, which means _Build 1 on top of version 0.2_
+- **Release Candidates** have a '-rc{version}' tag, e.g. `0.2-rc3, meaning _Release Candidate 3 for version 0.2_
+- **Stable Releases** use a _major.minor_ tag like `0.2`
+
+## Pre-Built Packages for Windows
+
+The recommended and easiest way to install PMDK on Windows is to use Microsoft vcpkg. Vcpkg is an open source tool and ecosystem created for library management.
+
+To install the latest PMDK release and link it to your Visual Studio solution you first need to clone and set up vcpkg on your machine as described on the [vcpkg github page](https://github.com/Microsoft/vcpkg) in **Quick Start** section.
+
+In brief:
+
+```
+       > git clone https://github.com/Microsoft/vcpkg
+       > cd vcpkg
+       > .\bootstrap-vcpkg.bat
+       > .\vcpkg integrate install
+       > .\vcpkg install pmdk:x64-windows
+```
+
+The last command can take a while - it is PMDK building and installation time.
+
+After a successful completion of all of the above steps, the libraries are ready
+to be used in Visual Studio and no additional configuration is required.
+Just open VS with your already existing project or create a new one
+(remember to use platform **x64**) and then include headers to project as you always do.
+
+## Dependencies
+
+Required packages for each supported OS are listed below. It is important to note that some tests and example applications require additional packages, but they do not interrupt building if they are missing. An appropriate message is displayed instead. For details please read the DEPENDENCIES section in the appropriate README file.
+
+See our **[Dockerfiles](utils/docker/images)**
+to get an idea what packages are required to build the entire PMDK,
+with all the tests and examples on the _Travis-CI_ system.
+
+### Linux
+
+You will need to install the following required packages on the build system:
+
+* **autoconf**
+* **pkg-config**
+* **libndctl-devel** (v63 or later)<sup>1</sup>
+* **libdaxctl-devel** (v63 or later)
+
+The following packages are required only by selected PMDK components
+or features:
+
+* **libfabric** (v1.4.2 or later) -- required by **librpmem**
+
+><sup>1</sup> PMDK depends on libndctl to support RAS features. It is possible
+to disable this support by passing NDCTL_ENABLE=n to "make", but we strongly
+discourage users from doing that. Disabling NDCTL strips PMDK from ability to
+detect hardware failures, which may lead to silent data corruption.
+For information how to disable RAS at runtime for kernels prior to 5.0.4 please
+see https://github.com/pmem/pmdk/issues/4207.
+
+### Windows
+
+* **MS Visual Studio 2015**
+* [Windows SDK 10.0.17134.12](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)
+* **Windows, version >= 1803**
+* **perl** (i.e. [StrawberryPerl](http://strawberryperl.com/))
+* **PowerShell 5**
+
+### FreeBSD
+
+* **autoconf**
+* **bash**
+* **binutils**
+* **coreutils**
+* **e2fsprogs-libuuid**
+* **gmake**
+* **libunwind**
+* **ncurses**<sup>4</sup>
+* **pkgconf**
+
+><sup>4</sup> The pkg version of ncurses is required for proper operation; the base version included in FreeBSD is not sufficient.
+
+## Building PMDK on Linux or FreeBSD
+
+To build from source, clone this tree:
+```
+       $ git clone https://github.com/pmem/pmdk
+       $ cd pmdk
+```
+
+For a stable version, checkout a [release tag](https://github.com/pmem/pmdk/releases) as follows. Otherwise skip this step to build the latest development release.
+```
+       $ git checkout tags/1.10
+```
+
+Once the build system is setup, the Persistent Memory Development Kit is built using the `make` command at the top level:
+```
+       $ make
+```
+For FreeBSD, use `gmake` rather than `make`.
+
+By default, all code is built with the `-Werror` flag, which fails
+the whole build when the compiler emits any warning. This is very useful during
+development, but can be annoying in deployment. If you want to **disable -Werror**,
+use the EXTRA_CFLAGS variable:
+```
+       $ make EXTRA_CFLAGS="-Wno-error"
+```
+>or
+```
+       $ make EXTRA_CFLAGS="-Wno-error=$(type-of-warning)"
+```
+
+### Make Options
+
+There are many options that follow `make`. If you want to invoke make with the same variables multiple times, you can create a user.mk file in the top level directory and put all variables there.
+For example:
+```
+       $ cat user.mk
+       EXTRA_CFLAGS_RELEASE = -ggdb -fno-omit-frame-pointer
+       PATH += :$HOME/valgrind/bin
+```
+This feature is intended to be used only by developers and it may not work for all variables. Please do not file bug reports about it. Just fix it and make a PR.
+
+**Built-in tests:** can be compiled and ran with different compiler. To do this, you must provide the `CC` and `CXX` variables. These variables are independent and setting `CC=clang` does not set `CXX=clang++`.
+For example:
+```
+       $ make CC=clang CXX=clang++
+```
+Once make completes, all the libraries and examples are built. You can play with the library within the build tree, or install it locally on your machine. For information about running different types of tests, please refer to the [src/test/README](src/test/README).
+
+**Installing the library** is convenient since it installs man pages and libraries in the standard system locations:
+```
+       (as root...)
+       # make install
+```
+
+To install this library into **other locations**, you can use the `prefix` variable, e.g.:
+```
+       $ make install prefix=/usr/local
+```
+This will install files to /usr/local/lib, /usr/local/include /usr/local/share/man.
+
+**Prepare library for packaging** can be done using the DESTDIR variable, e.g.:
+```
+       $ make install DESTDIR=/tmp
+```
+This will install files to /tmp/usr/lib, /tmp/usr/include /tmp/usr/share/man.
+
+**Man pages** (groff files) are generated as part of the `install` rule. To generate the documentation separately, run:
+```
+       $ make doc
+```
+This call requires the following dependencies: **pandoc**. Pandoc is provided by the hs-pandoc package on FreeBSD.
+
+**Install copy of source tree** can be done by specifying the path where you want it installed.
+```
+       $ make source DESTDIR=some_path
+```
+For this example, it will be installed at $(DESTDIR)/pmdk.
+
+**Build rpm packages** on rpm-based distributions is done by:
+```
+       $ make rpm
+```
+
+To build rpm packages without running tests:
+```
+       $ make BUILD_PACKAGE_CHECK=n rpm
+```
+This requires **rpmbuild** to be installed.
+
+**Build dpkg packages** on Debian-based distributions is done by:
+```
+       $ make dpkg
+```
+
+To build dpkg packages without running tests:
+```
+       $ make BUILD_PACKAGE_CHECK=n dpkg
+```
+This requires **devscripts** to be installed.
+
+### Testing Libraries on Linux and FreeBSD
+
+Before running the tests, you may need to prepare a test configuration file (src/test/testconfig.sh). Please see the available configuration settings in the example file [src/test/testconfig.sh.example](src/test/testconfig.sh.example).
+
+To build and run the **unit tests**:
+```
+       $ make check
+```
+
+To run a specific **subset of tests**, run for example:
+```
+       $ make check TEST_TYPE=short TEST_BUILD=debug TEST_FS=pmem
+```
+
+To **modify the timeout** which is available for **check** type tests, run:
+```
+       $ make check TEST_TIME=1m
+```
+This will set the timeout to 1 minute.
+
+Please refer to the **src/test/README** for more details on how to
+run different types of tests.
+
+### Memory Management Tools
+
+The PMDK libraries support standard Valgrind DRD, Helgrind and Memcheck, as well as a PM-aware version of [Valgrind](https://github.com/pmem/valgrind) (not yet available for FreeBSD). By default, support for all tools is enabled. If you wish to disable it, supply the compiler with **VG_\<TOOL\>_ENABLED** flag set to 0, for example:
+```
+       $ make EXTRA_CFLAGS=-DVG_MEMCHECK_ENABLED=0
+```
+
+**VALGRIND_ENABLED** flag, when set to 0, disables all Valgrind tools
+(drd, helgrind, memcheck and pmemcheck).
+
+The **SANITIZE** flag allows the libraries to be tested with various
+sanitizers. For example, to test the libraries with AddressSanitizer
+and UndefinedBehaviorSanitizer, run:
+```
+       $ make SANITIZE=address,undefined clobber check
+```
+
+## Building PMDK on Windows
+
+Clone the PMDK tree and open the solution:
+```
+       > git clone https://github.com/pmem/pmdk
+       > cd pmdk/src
+       > devenv PMDK.sln
+```
+
+Select the desired configuration (Debug or Release) and build the solution
+(i.e. by pressing Ctrl-Shift-B).
+
+### Testing Libraries on Windows
+
+Before running the tests, you may need to prepare a test configuration file (src/test/testconfig.ps1). Please see the available configuration settings in the example file [src/test/testconfig.ps1.example](src/test/testconfig.ps1.example).
+
+To **run the unit tests**, open the PowerShell console and type:
+```
+       > cd pmdk/src/test
+       > RUNTESTS.ps1
+```
+
+To run a specific **subset of tests**, run for example:
+```
+       > RUNTESTS.ps1 -b debug -t short
+```
+
+To run **just one test**, run for example:
+```
+       > RUNTESTS.ps1 -b debug -i pmem_is_pmem
+```
+
+To **modify the timeout**, run:
+```
+       > RUNTESTS.ps1 -o 3m
+```
+This will set the timeout to 3 minutes.
+
+To **display all the possible options**, run:
+```
+       > RUNTESTS.ps1 -h
+```
+
+Please refer to the **[src/test/README](src/test/README)** for more details on how to run different types of tests.
+
+## Experimental Packages
+
+Some components in the source tree are treated as experimental. By default,
+those components are built but not installed (and thus not included in
+packages).
+
+If you want to build/install experimental packages run:
+```
+       $ make EXPERIMENTAL=y [install,rpm,dpkg]
+```
+
+### The librpmem and rpmemd packages
+
+**NOTE:**
+The **libfabric** package required to build the **librpmem** and **rpmemd** is
+not yet available on stable Debian-based distributions. This makes it
+impossible to create Debian packages.
+
+If you want to build Debian packages of **librpmem** and **rpmemd** run:
+```
+       $ make RPMEM_DPKG=y dpkg
+```
+
+### Experimental Support for 64-bit ARM
+
+There is an initial support for 64-bit ARM processors provided,
+currently only for aarch64.  All the PMDK libraries except **librpmem**
+can be built for 64-bit ARM.  The examples, tools and benchmarks
+are not ported yet and may not get built on ARM cores.
+
+**NOTE:**
+The support for ARM processors is highly experimental. The libraries
+are only validated to "early access" quality with Cortex-A53 processor.
+
+## Contact Us
+
+For more information on this library, contact
+Piotr Balcer (piotr.balcer@intel.com),
+Andy Rudoff (andy.rudoff@intel.com), or post to our
+[Google group](https://groups.google.com/group/pmem).
diff --git a/ceph/src/pmdk/VERSION b/ceph/src/pmdk/VERSION
new file mode 100644 (file)
index 0000000..c044b1a
--- /dev/null
@@ -0,0 +1 @@
+1.10
diff --git a/ceph/src/pmdk/appveyor.yml b/ceph/src/pmdk/appveyor.yml
new file mode 100644 (file)
index 0000000..c9e9a29
--- /dev/null
@@ -0,0 +1,95 @@
+version: 1.4.{build}
+os: Visual Studio 2019
+platform: x64
+
+install:
+- ps: Install-PackageProvider -Name NuGet -Force
+- ps: Install-Module PsScriptAnalyzer -Force
+
+configuration:
+- Debug
+- Release
+
+environment:
+  solutionname: PMDK.sln
+  ex_solutionname: Examples.sln
+
+matrix:
+  fast_finish: true
+
+before_build:
+- ps: >-
+    if ($Env:CONFIGURATION -eq "Release") {
+        utils/CSTYLE.ps1
+        if ($LASTEXITCODE -ne 0) {
+                exit 1
+        }
+        utils/CHECK_WHITESPACE.ps1
+        if ($LASTEXITCODE -ne 0) {
+                exit 1
+        }
+        utils/ps_analyze.ps1
+        if ($LASTEXITCODE -ne 0) {
+                exit 1
+        }
+        ./utils/check_sdk_version.py -d .
+        if ($LASTEXITCODE -ne 0) {
+                exit 1
+        }
+    }
+
+build_script:
+- ps: msbuild src\$Env:solutionname /property:Configuration=$Env:CONFIGURATION /m /v:m
+- ps: msbuild src\examples\$Env:ex_solutionname /property:Configuration=$Env:CONFIGURATION /m /v:m
+
+after_build:
+- ps: utils/CREATE-ZIP.ps1 -b $Env:CONFIGURATION
+
+test_script:
+- ps: >-
+    if ($true) {
+        cd src\test
+        md C:\temp
+        echo "`$Env:NON_PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1
+        echo "`$Env:PMEM_FS_DIR = `"C:\temp`"" >> testconfig.ps1
+        echo "`$Env:PMEM_FS_DIR_FORCE_PMEM = `"1`"" >> testconfig.ps1
+        echo "`$Env:PMDK_NO_ABORT_MSG = `"1`"" >> testconfig.ps1
+        echo "`$Env:TM = `"1`"" >> testconfig.ps1
+
+        write-output "config = {
+    'unittest_log_level': 1,
+    'cacheline_fs_dir': 'C:\\temp',
+    'force_cacheline': True,
+    'page_fs_dir': 'C:\\temp',
+    'force_page': False,
+    'byte_fs_dir': 'C:\\temp',
+    'force_byte': True,
+    'tm': True,
+    'test_type': 'check',
+    'granularity': 'all',
+    'fs_dir_force_pmem': 1,
+    'keep_going': False,
+    'timeout': '4m',
+    'build': 'debug',
+    'force_enable': None,
+    'fail_on_skip': False,
+    'enable_admin_tests': False,
+    }" | out-file "testconfig.py" -encoding utf8
+
+        if ($Env:CONFIGURATION -eq "Debug") {
+            ./RUNTESTS.ps1 -b debug -o 4m
+            if ($?) {
+                ./RUNTESTS.py -b debug
+            }
+        }
+        if ($Env:CONFIGURATION -eq "Release") {
+            ./RUNTESTS.ps1 -b nondebug -o 4m
+            if ($?) {
+                ./RUNTESTS.py -b release
+            }
+        }
+    }
+
+artifacts:
+- path: 'src\x64\*.zip'
+  name: PMDK
diff --git a/ceph/src/pmdk/res/PMDK.ico b/ceph/src/pmdk/res/PMDK.ico
new file mode 100644 (file)
index 0000000..8c17621
Binary files /dev/null and b/ceph/src/pmdk/res/PMDK.ico differ
diff --git a/ceph/src/pmdk/src/.clang-format b/ceph/src/pmdk/src/.clang-format
new file mode 100644 (file)
index 0000000..331f7db
--- /dev/null
@@ -0,0 +1,33 @@
+BasedOnStyle: LLVM
+IndentWidth: 8
+UseTab: Always
+BreakBeforeBraces: Custom
+BraceWrapping:
+  AfterClass:                  false
+  AfterControlStatement:       false
+  AfterEnum:                   false
+  AfterFunction:               true
+  AfterNamespace:              true
+  AfterObjCDeclaration:                false
+  AfterStruct:                 false
+  AfterUnion:                  false
+  BeforeCatch:                 false
+  BeforeElse:                  false
+  IndentBraces:                        false
+AllowShortIfStatementsOnASingleLine: false
+IndentCaseLabels: false
+AlwaysBreakAfterDefinitionReturnType: true
+SpaceBeforeParens: ControlStatements
+SpacesBeforeTrailingComments: 1
+SpacesInCStyleCastParentheses: false
+SpacesInContainerLiterals: false
+PointerAlignment: Right
+ContinuationIndentWidth: 8
+AlignOperands: false
+IndentCaseLabels: true
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+AlwaysBreakTemplateDeclarations: true
+AccessModifierOffset: -8
+AllowShortBlocksOnASingleLine: false
+AllowShortFunctionsOnASingleLine: false
+BreakStringLiterals: false
diff --git a/ceph/src/pmdk/src/LongPath.manifest b/ceph/src/pmdk/src/LongPath.manifest
new file mode 100644 (file)
index 0000000..bc1b925
--- /dev/null
@@ -0,0 +1,7 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
+  <asmv3:application>
+    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
+      <longPathAware>true</longPathAware>
+    </asmv3:windowsSettings>
+  </asmv3:application>
+</assembly>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/LongPathSupport.props b/ceph/src/pmdk/src/LongPathSupport.props
new file mode 100644 (file)
index 0000000..821a1b8
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <ItemDefinitionGroup>
+    <Manifest>
+      <AdditionalManifestFiles>$(SolutionDir)LongPath.manifest</AdditionalManifestFiles>
+    </Manifest>
+  </ItemDefinitionGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/Makefile b/ceph/src/pmdk/src/Makefile
new file mode 100644 (file)
index 0000000..7e20804
--- /dev/null
@@ -0,0 +1,216 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# src/Makefile -- Makefile for PMDK
+#
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))..
+include $(TOP)/src/common.inc
+
+# core targets
+TARGETS = libpmem libpmemblk libpmemlog libpmemobj libpmempool tools libpmem2
+# make all targets
+ALL_TARGETS = $(TARGETS) common core librpmem
+# all available targets
+POSSIBLE_TARGETS = $(TARGETS) common core librpmem rpmem_common test\
+       examples benchmarks
+
+SCOPE_DIRS = $(TARGETS) common core librpmem rpmem_common
+
+DEBUG_RELEASE_TARGETS = common core libpmem libpmemblk libpmemlog libpmemobj\
+       libpmempool librpmem libpmem2
+RELEASE_TARGETS = tools
+
+ifneq ($(BUILD_EXAMPLES),n)
+       ALL_TARGETS += examples
+       RELEASE_TARGETS += examples
+endif
+
+ifneq ($(BUILD_BENCHMARKS),n)
+       ALL_TARGETS += benchmarks
+       RELEASE_TARGETS += benchmarks
+endif
+
+CLEAN_TARGETS = $(POSSIBLE_TARGETS)
+CLOBBER_TARGETS = $(POSSIBLE_TARGETS)
+CSTYLE_TARGETS = $(POSSIBLE_TARGETS)
+INSTALL_TARGETS = $(TARGETS)
+SPARSE_TARGETS = $(POSSIBLE_TARGETS)
+EXAMPLES_TARGETS = $(TARGETS) librpmem
+
+HEADERS_DESTDIR = $(DESTDIR)$(includedir)
+HEADERS_INSTALL = include/libpmem.h\
+               include/libpmemobj.h include/libpmempool.h\
+               include/libpmemblk.h include/libpmemlog.h\
+               include/libpmem2.h
+
+OBJ_HEADERS_INSTALL = include/libpmemobj/*.h
+
+PKG_CONFIG_DESTDIR = $(DESTDIR)$(pkgconfigdir)
+PKG_CONFIG_COMMON = common.pc
+PKG_CONFIG_FILES = libpmem.pc libpmemobj.pc libpmemlog.pc libpmemblk.pc\
+               libpmempool.pc libpmem2.pc
+PMREORDER_BIN = $(DESTDIR)$(bindir)
+PMREORDER_SRC = tools/pmreorder
+PMREORDER_FILES = $(PMREORDER_SRC)/*.py
+PMREORDER_DESTDIR = $(DESTDIR)$(datarootdir)/pmreorder
+PMREORDER_ROOTDIR = $(datarootdir)/pmreorder
+
+ifeq ($(BUILD_RPMEM),y)
+       PKG_CONFIG_FILES += librpmem.pc
+       HEADERS_INSTALL += include/librpmem.h
+       INSTALL_TARGETS += librpmem
+endif
+
+rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)\
+       $(filter $(subst *,%,$2),$d)))
+
+SCOPE_SRC_DIRS = $(SCOPE_DIRS) include
+SCOPE_HDR_DIRS = $(SCOPE_DIRS) include
+
+SCOPE_SRC_FILES = $(foreach d, $(SCOPE_SRC_DIRS), $(wildcard $(d)/*.c))
+SCOPE_HDR_FILES = $(foreach d, $(SCOPE_HDR_DIRS), $(wildcard $(D)/*.h))
+SCOPEFILES = $(SCOPE_SRC_FILES) $(SCOPE_HDR_FILES)
+
+# include/lib*.h - skip include/pmemcompat.h
+HEADERS =\
+       $(foreach f, $(wildcard\
+               freebsd/include/*.h\
+               freebsd/include/*/*.h\
+               include/lib*.h\
+               include/libpmemobj/*.h\
+               windows/include/*.h\
+               windows/include/*/*.h\
+               ), $(f))
+
+ifneq ($(filter 1 2, $(CSTYLEON)),)
+TMP_HEADERS := $(addprefix debug/, $(addsuffix tmp, $(HEADERS)))
+endif
+
+SCRIPTS = $(call rwildcard,,*.sh)
+
+debug/%.htmp: %.h
+       $(call check-cstyle, $<, $@)
+
+debug/%.hpptmp: %.hpp
+       $(call check-cstyle, $<, $@)
+
+all: $(TMP_HEADERS) $(ALL_TARGETS)
+install: $(INSTALL_TARGETS:=-install)
+uninstall: $(INSTALL_TARGETS:=-uninstall)
+clean: $(CLEAN_TARGETS:=-clean)
+clobber: $(CLOBBER_TARGETS:=-clobber)
+cstyle: $(CSTYLE_TARGETS:=-cstyle)
+format: $(CSTYLE_TARGETS:=-format)
+examples benchmarks: $(EXAMPLES_TARGETS)
+benchmarks: examples
+sparse: $(SPARSE_TARGETS:=-sparse)
+
+custom_build = $(DEBUG)$(OBJDIR)
+
+tools: libpmem libpmemblk libpmemlog libpmemobj libpmempool
+libpmemblk libpmemlog libpmemobj: libpmem
+libpmempool: libpmemblk
+benchmarks test tools: common core
+
+pkg-cfg-common:
+       @printf "version=%s\nlibdir=%s\nprefix=%s\nrasdeps=%s\n" "$(SRCVERSION)" "$(libdir)" "$(prefix)" "$(LIBNDCTL_PKG_CONFIG_DEPS_VAR)" > $(PKG_CONFIG_COMMON)
+
+$(PKG_CONFIG_COMMON): pkg-cfg-common
+
+%.pc: $(PKG_CONFIG_COMMON) $(TOP)/utils/%.pc.in
+       @echo Generating $@
+       @cat $(PKG_CONFIG_COMMON) > $@
+       @cat $(TOP)/utils/$@.in  >> $@
+
+pkg-config: $(PKG_CONFIG_FILES)
+
+%-install: %
+       $(MAKE) -C $^ install
+       $(MAKE) -C $^ install DEBUG=1
+
+$(eval $(call sub-target,$(INSTALL_TARGETS),uninstall,y))
+$(eval $(call sub-target,$(CLEAN_TARGETS),clean,y))
+$(eval $(call sub-target,$(CLOBBER_TARGETS),clobber,y))
+$(eval $(call sub-target,$(CSTYLE_TARGETS),cstyle,n))
+$(eval $(call sub-target,$(CSTYLE_TARGETS),format,n))
+$(eval $(call sub-target,$(SPARSE_TARGETS),sparse,n))
+
+$(DEBUG_RELEASE_TARGETS):
+       $(MAKE) -C $@
+ifeq ($(custom_build),)
+       $(MAKE) -C $@ DEBUG=1
+endif
+
+$(RELEASE_TARGETS):
+       $(MAKE) -C $@
+
+df:
+       @echo ====================================================================================
+       @if [ -e test/testconfig.sh ]; then \
+               bash -c '. test/testconfig.sh; \
+               if [ -n "$$PMEM_FS_DIR" ]; then df -h "$$PMEM_FS_DIR"; stat -f "$$PMEM_FS_DIR"; fi; \
+               if [ -n "$$NON_PMEM_FS_DIR" ]; then df -h "$$NON_PMEM_FS_DIR"; stat -f "$$NON_PMEM_FS_DIR";fi'; \
+       fi
+       @echo ====================================================================================
+
+test: all
+       $(MAKE) -C test test
+
+check pcheck pycheck: test df
+       $(MAKE) -C test $@
+
+require-rpmem:
+ifneq ($(BUILD_RPMEM),y)
+       $(error ERROR: cannot run remote tests because $(BUILD_RPMEM_INFO))
+endif
+
+check-remote: require-rpmem test
+       $(MAKE) -C test $@
+
+# Re-generate pkg-config files on 'make install' (not on 'make all'),
+# to handle the case when prefix is specified only for 'install'.
+# Clean up generated files when done.
+install: all pkg-config
+       install -d $(HEADERS_DESTDIR)
+       install -p -m 0644 $(HEADERS_INSTALL) $(HEADERS_DESTDIR)
+       install -d $(HEADERS_DESTDIR)/libpmemobj
+       install -p -m 0644 $(OBJ_HEADERS_INSTALL) $(HEADERS_DESTDIR)/libpmemobj
+       install -d $(PKG_CONFIG_DESTDIR)
+       install -p -m 0644 $(PKG_CONFIG_FILES) $(PKG_CONFIG_DESTDIR)
+       install -d $(PMREORDER_DESTDIR)
+       install -p -m 0644 $(PMREORDER_FILES) $(PMREORDER_DESTDIR)
+       @echo "#!/bin/sh" > $(PMREORDER_SRC)/pmreorder
+       @echo "exec python3 $(PMREORDER_ROOTDIR)/pmreorder.py $(SRCVERSION) \$$*" >> $(PMREORDER_SRC)/pmreorder
+       install -d $(PMREORDER_BIN)
+       install -p $(PMREORDER_SRC)/pmreorder $(PMREORDER_BIN)
+       $(RM) $(PKG_CONFIG_FILES)
+
+uninstall:
+       $(foreach f, $(HEADERS_INSTALL), $(RM) $(HEADERS_DESTDIR)/$(notdir $(f)))
+       $(foreach f, $(OBJ_HEADERS_INSTALL), $(RM) $(HEADERS_DESTDIR)/libpmemobj/$(notdir $(f)))
+       $(foreach f, $(PKG_CONFIG_FILES), $(RM) $(PKG_CONFIG_DESTDIR)/$(notdir $(f)))
+       $(foreach f, $(PMREORDER_FILES), $(RM) $(PMREORDER_DESTDIR)/$(notdir $(f)))
+       $(RM) $(PMREORDER_BIN)/pmreorder
+
+cstyle:
+       $(STYLE_CHECK) check $(HEADERS)
+       $(CHECK_SHEBANG) $(SCRIPTS)
+
+format:
+       $(STYLE_CHECK) format $(HEADERS)
+
+cscope:
+       cscope -q -b $(SCOPEFILES)
+       ctags -e $(SCOPEFILES)
+
+clean-here:
+       $(RM) tags cscope.in.out cscope.out cscope.po.out *.pc $(TMP_HEADERS)
+
+clean: clean-here
+
+clobber: clean-here
+
+.PHONY: all install uninstall clean clobber cstyle format test check pcheck\
+       cscope $(ALL_TARGETS)\
+       pkg-config check-remote clean-here pkg-cfg-common require-rpmem
diff --git a/ceph/src/pmdk/src/Makefile.inc b/ceph/src/pmdk/src/Makefile.inc
new file mode 100644 (file)
index 0000000..04ab019
--- /dev/null
@@ -0,0 +1,318 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+#
+# src/Makefile.inc -- common Makefile rules for PMDK
+#
+
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))..
+
+include $(TOP)/src/common.inc
+
+INCLUDE = $(TOP)/src/include
+
+RPMEM_COMMON = $(TOP)/src/rpmem_common
+vpath %.c $(RPMEM_COMMON)
+
+COMMON = $(TOP)/src/common
+vpath %.c $(COMMON)
+
+CORE = $(TOP)/src/core
+vpath %.c $(CORE)
+
+PMEM2 = $(TOP)/src/libpmem2
+vpath %.c $(PMEM2)
+
+INCS += -I../include -I../common/ -I../core/ $(OS_INCS)
+
+# default CFLAGS
+DEFAULT_CFLAGS += -std=gnu99
+DEFAULT_CFLAGS += -Wall
+DEFAULT_CFLAGS += -Werror
+DEFAULT_CFLAGS += -Wmissing-prototypes
+DEFAULT_CFLAGS += -Wpointer-arith
+DEFAULT_CFLAGS += -Wsign-conversion
+DEFAULT_CFLAGS += -Wsign-compare
+
+ifeq ($(WCONVERSION_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wconversion
+endif
+
+ifeq ($(IS_ICC), n)
+DEFAULT_CFLAGS += -Wunused-macros
+DEFAULT_CFLAGS += -Wmissing-field-initializers
+endif
+
+ifeq ($(WUNREACHABLE_CODE_RETURN_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wunreachable-code-return
+endif
+
+ifeq ($(WMISSING_VARIABLE_DECLARATIONS_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wmissing-variable-declarations
+endif
+
+ifeq ($(WFLOAT_EQUAL_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wfloat-equal
+endif
+
+ifeq ($(WSWITCH_DEFAULT_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wswitch-default
+endif
+
+ifeq ($(WCAST_FUNCTION_TYPE_AVAILABLE), y)
+DEFAULT_CFLAGS += -Wcast-function-type
+endif
+
+ifeq ($(WSTRINGOP_TRUNCATION_AVAILABLE), y)
+DEFAULT_CFLAGS += -DSTRINGOP_TRUNCATION_SUPPORTED
+endif
+
+ifeq ($(DEBUG),1)
+# Undefine _FORTIFY_SOURCE in case it's set in system-default or
+# user-defined CFLAGS as it conflicts with -O0.
+DEBUG_CFLAGS += -Wp,-U_FORTIFY_SOURCE
+DEBUG_CFLAGS += -O0 -ggdb -DDEBUG
+LIB_SUBDIR = /pmdk_debug
+OBJDIR = debug
+else
+DEFAULT_CFLAGS += -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+LIB_SUBDIR =
+OBJDIR = nondebug
+endif
+
+# use defaults, if system or user-defined CFLAGS are not specified
+CFLAGS ?= $(DEFAULT_CFLAGS)
+
+CFLAGS += -std=gnu99
+CFLAGS += -fno-common
+CFLAGS += -pthread
+CFLAGS += -DSRCVERSION=\"$(SRCVERSION)\"
+
+ifeq ($(OS_DIMM),ndctl)
+CFLAGS += -DSDS_ENABLED
+CFLAGS += $(OS_DIMM_CFLAG)
+endif
+
+ifeq ($(COVERAGE),1)
+CFLAGS += $(GCOV_CFLAGS)
+LDFLAGS += $(GCOV_LDFLAGS)
+LIBS += $(GCOV_LIBS)
+endif
+
+ifeq ($(VALGRIND),0)
+CFLAGS += -DVALGRIND_ENABLED=0
+CXXFLAGS += -DVALGRIND_ENABLED=0
+endif
+
+ifeq ($(FAULT_INJECTION),1)
+CFLAGS += -DFAULT_INJECTION=1
+CXXFLAGS += -DFAULT_INJECTION=1
+endif
+
+ifneq ($(SANITIZE),)
+CFLAGS += -fsanitize=$(tsanitize)
+LDFLAGS += -fsanitize=$(tsanitize)
+endif
+
+CFLAGS += $(EXTRA_CFLAGS)
+
+ifeq ($(DEBUG),1)
+CFLAGS += $(EXTRA_CFLAGS_DEBUG) $(DEBUG_CFLAGS)
+else
+CFLAGS += $(EXTRA_CFLAGS_RELEASE)
+endif
+
+LDFLAGS += -Wl,-z,relro -Wl,--fatal-warnings -Wl,--warn-common $(EXTRA_LDFLAGS)
+
+ifneq ($(NORPATH),1)
+LDFLAGS += -Wl,-rpath=$(libdir)$(LIB_SUBDIR):$(LIBFABRIC_LD_LIBRARY_PATHS):$(LIBNDCTL_LD_LIBRARY_PATHS)
+endif
+
+ifeq ($(LIBRT_NEEDED), y)
+LIBS += -lrt
+endif
+
+define arch32_error_msg
+
+##################################################
+###  32-bit builds of PMDK are not supported!  ###
+###  Please, use 64-bit platform/compiler.     ###
+##################################################
+
+endef
+
+TESTCMD := $(CC) $(CFLAGS) -dM -E -x c /dev/null -o /dev/null
+TESTBUILD := $(shell $(TESTCMD) && echo 1 || echo 0)
+ifneq ($(TESTBUILD), 1)
+$(error "$(TESTCMD)" failed)
+endif
+
+ifeq ($(filter $(ARCH), x86_64 aarch64 ppc64),)
+$(error unsupported architecture: $(ARCH))
+endif
+
+LP64 := $(shell $(CC) $(CFLAGS) -dM -E -x c /dev/null | grep -Ec "__SIZEOF_LONG__.+8|__SIZEOF_POINTER__.+8" )
+ifneq ($(LP64), 2)
+$(error $(arch32_error_msg))
+endif
+
+LIBS_DESTDIR = $(DESTDIR)$(libdir)$(LIB_SUBDIR)
+
+DIRNAME = $(shell basename $(CURDIR))
+
+ifeq ($(OBJDIR),$(abspath $(OBJDIR)))
+objdir = $(OBJDIR)/$(DIRNAME)
+else
+objdir = ../$(OBJDIR)/$(DIRNAME)
+endif
+
+LIB_OUTDIR ?= $(objdir)/..
+
+ifneq ($(LIB_OUTDIR),)
+LDFLAGS += -L$(LIB_OUTDIR)
+endif
+
+ifneq ($(SOURCE),)
+_OBJS = $(SOURCE:.c=.o)
+_OBJS_COMMON = $(patsubst $(COMMON)/%, %, $(_OBJS))
+_OBJS_CORE = $(patsubst $(CORE)/%, %, $(_OBJS_COMMON))
+_OBJS_PMEM2 = $(patsubst $(PMEM2)/%, %, $(_OBJS_CORE))
+_OBJS_RPMEM_COMMON = $(patsubst $(RPMEM_COMMON)/%, %, $(_OBJS_PMEM2))
+OBJS += $(addprefix $(objdir)/, $(_OBJS_RPMEM_COMMON))
+endif
+
+ifneq ($(HEADERS),)
+ifneq ($(filter 1 2, $(CSTYLEON)),)
+TMP_HEADERS := $(addsuffix tmp, $(HEADERS))
+TMP_HEADERS := $(addprefix $(objdir)/, $(TMP_HEADERS))
+endif
+endif
+
+ifneq ($(LIBRARY_NAME),)
+LIB_NAME = lib$(LIBRARY_NAME)
+endif
+
+ifneq ($(LIBRARY_SO_VERSION),)
+LIB_LINK = $(LIB_NAME).link
+LIB_SONAME = $(LIB_NAME).so.$(LIBRARY_SO_VERSION)
+LIB_SO = $(LIB_OUTDIR)/$(LIB_NAME).so
+
+LIB_SO_SONAME = $(LIB_SO).$(LIBRARY_SO_VERSION)
+
+ifneq ($(LIBRARY_VERSION),)
+LIB_SO_REAL = $(LIB_SO_SONAME).$(LIBRARY_VERSION)
+else
+$(error LIBRARY_VERSION not set)
+endif
+
+TARGET_LIBS = $(LIB_SO_REAL)
+TARGET_LINKS = $(LIB_SO_SONAME) $(LIB_SO)
+endif
+
+ifneq ($(LIB_NAME),)
+LIB_AR = $(LIB_OUTDIR)/$(LIB_NAME).a
+LIB_AR_UNSCOPED = $(objdir)/$(LIB_NAME)_unscoped.o
+LIB_AR_ALL = $(objdir)/$(LIB_NAME)_all.o
+TARGET_LIBS += $(LIB_AR)
+endif
+
+ifneq ($(EXTRA_TARGETS),)
+EXTRA_TARGETS_CLEAN = $(EXTRA_TARGETS:=-clean)
+EXTRA_TARGETS_CLOBBER = $(EXTRA_TARGETS:=-clobber)
+endif
+
+PMEMLOG_PRIV_OBJ=$(LIB_OUTDIR)/libpmemlog/libpmemlog_unscoped.o
+PMEMBLK_PRIV_OBJ=$(LIB_OUTDIR)/libpmemblk/libpmemblk_unscoped.o
+
+ifneq ($(LIBPMEMLOG_PRIV_FUNCS),)
+OBJS += pmemlog_priv_funcs.o
+endif
+
+ifneq ($(LIBPMEMBLK_PRIV_FUNCS),)
+OBJS += pmemblk_priv_funcs.o
+endif
+
+MAKEFILE_DEPS=../Makefile.inc Makefile $(TOP)/src/common.inc
+
+all: $(objdir) $(LIB_OUTDIR) $(EXTRA_TARGETS) $(LIB_AR) $(LIB_SO_SONAME) $(LIB_SO_REAL) $(LIB_SO) $(TMP_HEADERS)
+
+$(objdir) $(LIB_OUTDIR):
+       $(MKDIR) -p $@
+
+$(LIB_SO_REAL): $(OBJS) $(EXTRA_OBJS) $(LIB_LINK) $(MAKEFILE_DEPS)
+       $(CC) $(LDFLAGS) -shared -Wl,--version-script=$(LIB_LINK),-soname,$(LIB_SONAME) -o $@ $(OBJS) $(EXTRA_OBJS) $(LIBS)
+
+$(LIB_SO_SONAME): $(LIB_SO_REAL) $(MAKEFILE_DEPS)
+       $(LN) -sf $(shell basename $<) $@
+
+$(LIB_SO): $(LIB_SO_SONAME) $(MAKEFILE_DEPS)
+       $(LN) -sf $(shell basename $<) $@
+
+$(LIB_AR_UNSCOPED): $(OBJS) $(EXTRA_OBJS) $(MAKEFILE_DEPS)
+       $(LD) -o $@ -r $(OBJS) $(EXTRA_OBJS)
+
+ifeq ($(LIB_LINK),)
+$(LIB_AR_ALL): $(LIB_AR_UNSCOPED) $(MAKEFILE_DEPS)
+       $(OBJCOPY) $< $@
+else
+$(LIB_AR_ALL): $(LIB_AR_UNSCOPED) $(LIB_LINK) $(MAKEFILE_DEPS)
+       $(OBJCOPY) --localize-hidden `sed -n 's/^       *\([a-zA-Z0-9_]*\);$$/-G \1/p' $(LIB_LINK)` $< $@
+endif
+
+$(LIB_AR): $(LIB_AR_ALL) $(MAKEFILE_DEPS)
+       $(AR) rv $@ $(LIB_AR_ALL)
+
+$(PMEMBLK_PRIV_OBJ):
+       $(MAKE) -C $(LIBSDIR) libpmemblk
+
+install: all
+ifneq ($(LIBRARY_NAME),)
+       $(INSTALL) -d $(LIBS_DESTDIR)
+       $(INSTALL) -p -m 0755 $(TARGET_LIBS) $(LIBS_DESTDIR)
+       $(CP) -d $(TARGET_LINKS) $(LIBS_DESTDIR)
+endif
+
+uninstall:
+ifneq ($(LIBRARY_NAME),)
+       $(foreach f, $(TARGET_LIBS), $(RM) $(LIBS_DESTDIR)/$(notdir $(f)))
+       $(foreach f, $(TARGET_LINKS), $(RM) $(LIBS_DESTDIR)/$(notdir $(f)))
+endif
+
+clean: $(EXTRA_TARGETS_CLEAN)
+ifneq ($(LIBRARY_NAME),)
+       $(RM) $(OBJS) $(TMP_HEADERS)
+       $(RM) $(LIB_AR_ALL) $(LIB_AR_UNSCOPED)
+endif
+
+clobber: clean $(EXTRA_TARGETS_CLOBBER)
+ifneq ($(LIBRARY_NAME),)
+       $(RM) $(LIB_AR) $(LIB_SO_SONAME) $(LIB_SO_REAL) $(LIB_SO)
+       $(RM) -r $(objdir)/.deps
+       $(RM) -f *.link
+endif
+
+$(eval $(cstyle-rule))
+
+$(objdir)/%.o: %.c $(MAKEFILE_DEPS)
+       $(call check-cstyle, $<)
+       @mkdir -p $(objdir)/.deps
+       $(CC) -MD -c -o $@ $(CFLAGS) $(INCS) -fPIC $(call coverage-path, $<)
+       $(call check-os, $@, $<)
+       $(create-deps)
+
+sparse:
+       $(if $(SOURCE), $(sparse-c))
+
+$(objdir)/%.htmp: %.h
+       $(call check-cstyle, $<, $@)
+
+.PHONY: all clean clobber install uninstall cstyle
+
+-include $(objdir)/.deps/*.P
+
+%.link: %.link.in
+ifeq ($(FAULT_INJECTION),1)
+       @sed 's/fault_injection;/$(LIBRARY_NAME)_inject_fault_at;\n\t\t$(LIBRARY_NAME)_fault_injection_enabled;/g' $< > $@_temp
+else
+       @sed '/fault_injection;/d' $< > $@_temp
+endif
+       @mv $@_temp $@
diff --git a/ceph/src/pmdk/src/PMDK.sln b/ceph/src/pmdk/src/PMDK.sln
new file mode 100644 (file)
index 0000000..eb8d486
--- /dev/null
@@ -0,0 +1,2240 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.15
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmemlog_minimal", "examples\libpmemobj\pmemlog\obj_pmemlog_minimal.vcxproj", "{0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_arenas", "test\obj_ctl_arenas\obj_ctl_arenas.vcxproj", "{019F5586-5558-4C87-B319-85906D4AE407}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_movnt_align", "test\pmem_movnt_align\pmem_movnt_align.vcxproj", "{025E7D51-41F2-4CBA-956E-C37A4443DB1B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "full_copy", "examples\libpmem\full_copy.vcxproj", "{0287C3DC-AE03-4714-AAFF-C52F062ECA6F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traces_custom_function", "test\traces_custom_function\traces_custom_function.vcxproj", "{02BC3B44-C7F1-4793-86C1-6F36CA8A7F53}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_stats", "test\obj_ctl_stats\obj_ctl_stats.vcxproj", "{03228F84-4F41-4BCC-8C2D-F329DC87B289}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_memblock", "test\obj_memblock\obj_memblock.vcxproj", "{0388E945-A655-41A7-AF27-8981CEE0E49A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_direct_volatile", "test\obj_direct_volatile\obj_direct_volatile.vcxproj", "{03B54A12-7793-4827-B820-C07491F7F45E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_callbacks", "test\obj_tx_callbacks\obj_tx_callbacks.vcxproj", "{0529575C-F6E8-44FD-BB82-82A29948D0F2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "out_err_mt", "test\out_err_mt\out_err_mt.vcxproj", "{063037B2-CA35-4520-811C-19D9C4ED891E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmemlog_macros", "examples\libpmemobj\pmemlog\obj_pmemlog_macros.vcxproj", "{06877FED-15BA-421F-85C9-1A964FB97446}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_mt", "test\obj_tx_mt\obj_tx_mt.vcxproj", "{0703E813-9CC8-4DEA-AA33-42B099CD172D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_heap_interrupt", "test\obj_heap_interrupt\obj_heap_interrupt.vcxproj", "{07A153D9-DF17-4DE8-A3C2-EBF171B961AE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_parse_size", "test\util_parse_size\util_parse_size.vcxproj", "{08B62E36-63D2-4FF1-A605-4BBABAEE73FB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_include", "test\log_include\log_include.vcxproj", "{0A049EAD-652F-4E20-8026-90FD99AEE77A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemlog", "libpmemlog\libpmemlog.vcxproj", "{0B1818EB-BDC8-4865-964F-DB8BF05CFD86}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reader", "examples\libpmemobj\string_store\reader.vcxproj", "{0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{0CC6D525-806E-433F-AB4A-6CFD546418B1}"
+       ProjectSection(SolutionItems) = preProject
+               examples\ex_common.h = examples\ex_common.h
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_critnib", "test\obj_critnib\obj_critnib.vcxproj", "{0CDCEB97-3270-4939-A290-EA2D3BE34B0C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_deep_persist", "test\pmem_deep_persist\pmem_deep_persist.vcxproj", "{0D4E38EF-A9D5-4797-8994-5DBB1125C9EA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_perror", "test\pmem2_perror\pmem2_perror.vcxproj", "{0DF30DE0-7F7D-43D3-940A-809EC27D3061}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "btree", "examples\libpmemobj\btree.vcxproj", "{0FB8F0FD-276C-413B-97A8-67ABE0C9043B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_direct", "test\obj_direct\obj_direct.vcxproj", "{10469175-EEF7-44A0-9961-AC4E45EFD800}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_movnt", "test\pmem2_movnt\pmem2_movnt.vcxproj", "{10B732EF-1783-4B61-B431-36BA5A2A3C9C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pi", "examples\libpmemobj\pi.vcxproj", "{11D76FBC-DFAA-4B31-9DB0-206E171E3F94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemspoil", "test\tools\pmemspoil\pmemspoil.vcxproj", "{11E158AE-C85A-4A6E-B66A-ED2994709276}"
+       ProjectSection(ProjectDependencies) = postProject
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_map_file", "test\pmem_map_file\pmem_map_file.vcxproj", "{12A1A3EF-202C-4DD0-9B5A-F5126CAB078F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmem", "libpmem", "{1434B17C-6165-4D42-BEA1-5A7730D5A6BB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_recreate", "test\obj_recreate\obj_recreate.vcxproj", "{1464398A-100F-4518-BDB9-939A6362B6CF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dllview", "test\tools\dllview\dllview.vcxproj", "{179BEB5A-2C90-44F5-A734-FA756A5E668C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rbtree_map", "examples\libpmemobj\tree_map\rbtree_map.vcxproj", "{17A4B817-68B1-4719-A9EF-BD8FAB747DE6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pmempool", "pmempool", "{181A4234-282C-41F0-85C2-2B7697B3CB1A}"
+       ProjectSection(SolutionItems) = preProject
+               ..\doc\pmempool\pmempool-check.1.md = ..\doc\pmempool\pmempool-check.1.md
+               ..\doc\pmempool\pmempool-convert.1.md = ..\doc\pmempool\pmempool-convert.1.md
+               ..\doc\pmempool\pmempool-create.1.md = ..\doc\pmempool\pmempool-create.1.md
+               ..\doc\pmempool\pmempool-dump.1.md = ..\doc\pmempool\pmempool-dump.1.md
+               ..\doc\pmempool\pmempool-info.1.md = ..\doc\pmempool\pmempool-info.1.md
+               ..\doc\pmempool\pmempool-rm.1.md = ..\doc\pmempool\pmempool-rm.1.md
+               ..\doc\pmempool\pmempool-sync.1.md = ..\doc\pmempool\pmempool-sync.1.md
+               ..\doc\pmempool\pmempool-transform.1.md = ..\doc\pmempool\pmempool-transform.1.md
+               ..\doc\pmempool\pmempool.1.md = ..\doc\pmempool\pmempool.1.md
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_non_zero", "test\blk_non_zero\blk_non_zero.vcxproj", "{18E90E1A-F2E0-40DF-9900-A14E560C9EB4}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {F7C6C6B6-4142-4C82-8699-4A9D8183181B}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemlog", "libpmemlog", "{1A36B57B-2E88-4D81-89C0-F575C9895E36}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmpmap", "test\tools\cmpmap\cmpmap.vcxproj", "{1B871BA2-3F70-4BC9-9DF4-725EB07F6628}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_libpmemblk", "test\ex_libpmemblk\ex_libpmemblk.vcxproj", "{1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemobj", "libpmemobj\libpmemobj.vcxproj", "{1BAA1617-93AE-4196-8A1A-BD492FB18AEF}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map_multiple_files", "examples\libpmem2\map_multiple_files\map_multiple_files.vcxproj", "{1BFBAFED-A9CE-49AF-AB2C-84199E391EE6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_persist", "test\pmem2_persist\pmem2_persist.vcxproj", "{1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "writer", "examples\libpmemobj\string_store_tx_type\writer.vcxproj", "{1EB3DE5B-6357-498D-8CAC-EEC0209EA454}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_lists", "test\win_lists\win_lists.vcxproj", "{1F2E1C51-2B14-4047-BE6D-52E00FC3C780}"
+       ProjectSection(ProjectDependencies) = postProject
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_recovery", "test\obj_recovery\obj_recovery.vcxproj", "{2498FCDA-E2CC-43EF-9A35-8CD63F253171}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bttdevice", "test\bttdevice\bttdevice.vcxproj", "{25758581-DD46-4AE4-99D9-11E736F72AD1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_transform", "test\pmempool_transform\pmempool_transform.vcxproj", "{26166DF1-3C94-44AF-9075-BA31DCD2F6BB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_test_win", "test\libpmempool_api_win\libpmempool_test_win.vcxproj", "{27FA11C6-431D-41D1-A417-FAB7C4F93DCA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_toid", "test\obj_toid\obj_toid.vcxproj", "{296F3C5D-3951-423E-8E2F-FD4A37958C72}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_include", "test\blk_include\blk_include.vcxproj", "{29D9376B-DC36-4940-83F1-A7CBE38A2103}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_dump", "test\pmempool_dump\pmempool_dump.vcxproj", "{2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "out_err_mt_win", "test\out_err_mt_win\out_err_mt_win.vcxproj", "{2B1A5104-A324-4D02-B5C7-D021FB8F880C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_fragmentation2", "test\obj_fragmentation2\obj_fragmentation2.vcxproj", "{2B2DE575-1422-4FBF-97BE-35AEDA0AB465}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_include", "test\pmem_include\pmem_include.vcxproj", "{2B7772E6-9DAA-4F38-B0BC-7B2399366325}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "poolset", "poolset", "{2C24CC4F-B340-467D-908F-1BF2C69BC79F}"
+       ProjectSection(SolutionItems) = preProject
+               ..\doc\poolset\poolset.5.md = ..\doc\poolset\poolset.5.md
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lists", "examples\libpmemobj\lists.vcxproj", "{2CD7408E-2F60-43C3-ACEB-C7D58CDD8462}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_locks", "test\obj_locks\obj_locks.vcxproj", "{2DE6B085-3C19-49B1-894A-AD9376000E09}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_action", "test\obj_action\obj_action.vcxproj", "{2ED26FDA-3C4E-4514-B387-5E77C302FF71}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemdetect", "test\tools\pmemdetect\pmemdetect.vcxproj", "{2EFFC590-BF5E-46A2-AF04-E67E1D571D2E}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmempool", "libpmempool", "{2F543422-4B8A-4898-BE6B-590F52B4E9D1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemcore", "core\libpmemcore.vcxproj", "{2FA3155B-6F26-4D15-AC03-9D82D48DBC42}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bttcreate", "test\tools\bttcreate\bttcreate.vcxproj", "{3142CB13-CADA-48D3-9A25-E6ACB243760A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_map_file_trunc", "test\pmem_map_file_trunc\pmem_map_file_trunc.vcxproj", "{34DB4951-DA08-45F1-938D-B08E5FF5AB46}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_source", "test\pmem2_source\pmem2_source.vcxproj", "{34F31D9D-3D33-4C09-85A3-4749A8AB8EBB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "list_map", "examples\libpmemobj\list_map\list_map.vcxproj", "{3799BA67-3C4F-4AE0-85DC-5BAAEA01A180}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traces_pmem", "test\traces_pmem\traces_pmem.vcxproj", "{3B23831B-E5DE-4A62-9D0B-27D0D9F293F4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_source_alignment", "test\pmem2_source_alignment\pmem2_source_alignment.vcxproj", "{3B44D717-EEDE-470A-B631-C9D6BFE4ADF2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_pool", "test\log_pool\log_pool.vcxproj", "{3CF270CD-0F56-48E3-AD84-82F369C568BF}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86} = {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log", "examples\libpmem2\log\log.vcxproj", "{3EC20BDD-2E48-4291-A9EE-D0675AF77C7F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sparsefile", "test\tools\sparsefile\sparsefile.vcxproj", "{3EC30D6A-BDA4-4971-879A-8814204EAE31}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pool", "test\obj_pool\obj_pool.vcxproj", "{3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtree_map", "examples\libpmemobj\tree_map\rtree_map.vcxproj", "{3ED56E55-84A6-422C-A8D4-A8439FB8F245}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_alloc", "test\obj_alloc\obj_alloc.vcxproj", "{42B97D47-F800-4100-BFA2-B3AC357E8B6B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_info", "test\pmempool_info\pmempool_info.vcxproj", "{42CCEF95-5ADD-460C-967E-DD5B2C744943}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "test\getopt\getopt.vcxproj", "{433F7840-C597-4950-84C9-E4FF7DF6A298}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sys", "sys", "{45027FC5-4A32-47BD-AC5B-66CC7616B1D2}"
+       ProjectSection(SolutionItems) = preProject
+               windows\include\sys\file.h = windows\include\sys\file.h
+               windows\include\sys\mman.h = windows\include\sys\mman.h
+               windows\include\sys\mount.h = windows\include\sys\mount.h
+               windows\include\sys\param.h = windows\include\sys\param.h
+               windows\include\sys\resource.h = windows\include\sys\resource.h
+               windows\include\sys\statvfs.h = windows\include\sys\statvfs.h
+               windows\include\sys\uio.h = windows\include\sys\uio.h
+               windows\include\sys\wait.h = windows\include\sys\wait.h
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_vm_reservation", "test\pmem2_vm_reservation\pmem2_vm_reservation.vcxproj", "{46629F21-089C-4205-B2F8-E01748ECE517}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctl_cow", "test\ctl_cow\ctl_cow.vcxproj", "{46B82069-10BE-432A-8D93-F4D995148555}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pool_lookup", "test\obj_pool_lookup\obj_pool_lookup.vcxproj", "{4850F425-9128-4E91-973C-5AE7BD97395B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemcommon", "common\libpmemcommon.vcxproj", "{492BAA3D-0D5D-478E-9765-500463AE69AA}"
+       ProjectSection(ProjectDependencies) = postProject
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmap", "examples\libpmemobj\map\libmap.vcxproj", "{49A7CC5A-D5E7-4A07-917F-C6918B982BE8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "util", "util", "{4C291EEB-3874-4724-9CC2-1335D13FF0EE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_alloc", "test\obj_tx_alloc\obj_tx_alloc.vcxproj", "{4C429783-0B01-449F-A36F-C2019233890B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemalloc", "test\tools\pmemalloc\pmemalloc.vcxproj", "{4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}"
+       ProjectSection(ProjectDependencies) = postProject
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_include", "test\libpmempool_include\libpmempool_include.vcxproj", "{4E334022-7A71-4197-9E15-878F7EFC877E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_memmove", "test\pmem2_memmove\pmem2_memmove.vcxproj", "{4EE3C4D6-F707-4A05-8032-8FC2A44D29E8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_walker", "test\log_walker\log_walker.vcxproj", "{4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_poolset_parse", "test\util_poolset_parse\util_poolset_parse.vcxproj", "{50FD1E47-2131-48D2-9435-5CB28DF6B15A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asset_checkout", "examples\libpmemblk\assetdb\asset_checkout.vcxproj", "{513C4CFA-BD5B-4470-BA93-F6D43778A754}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arch_flags", "test\arch_flags\arch_flags.vcxproj", "{53115A01-460C-4339-A2C8-AE1323A6E7EA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmap", "test\mmap\mmap.vcxproj", "{5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1}"
+       ProjectSection(ProjectDependencies) = postProject
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_mem_ext", "test\pmem2_mem_ext\pmem2_mem_ext.vcxproj", "{5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asset_checkin", "examples\libpmemblk\assetdb\asset_checkin.vcxproj", "{581B3A58-F3F0-4765-91E5-D0C82816A528}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_basic_integration", "test\obj_basic_integration\obj_basic_integration.vcxproj", "{58386481-30B7-40FC-96AF-0723A4A7B228}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pmempool", "pmempool", "{59AB6976-D16B-48D0-8D16-94360D3FE51D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reader", "examples\libpmemobj\string_store_tx\reader.vcxproj", "{59D7A9CD-9912-40E4-96E1-8A873F777F62}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_map_prot", "test\pmem2_map_prot\pmem2_map_prot.vcxproj", "{59D9E21C-57D7-4D18-B792-24738BD26DE4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_memmove", "test\pmem_memmove\pmem_memmove.vcxproj", "{5A391A14-8E29-4788-93FC-EDADED31D32F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_map_file_win", "test\pmem_map_file_win\pmem_map_file_win.vcxproj", "{5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "data_store", "examples\libpmemobj\map\data_store.vcxproj", "{5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_many_size_allocs", "test\obj_many_size_allocs\obj_many_size_allocs.vcxproj", "{5D362DB7-D2BD-4907-AAD8-4B8627E72282}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmemlog_simple", "examples\libpmemobj\pmemlog\obj_pmemlog_simple.vcxproj", "{5DB2E259-0D19-4A89-B8EC-B2912F39924D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unsafe_shutdown", "examples\libpmem2\unsafe_shutdown\unsafe_shutdown.vcxproj", "{5E005D50-1C73-4E52-B295-864BB9AF7AC6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_user_data", "test\obj_tx_user_data\obj_tx_user_data.vcxproj", "{5E7305DB-93E6-448B-AE44-90EAF916A776}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_sds", "test\util_sds\util_sds.vcxproj", "{5EC35099-9777-45E8-9520-EB2EE75BDF88}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_rm", "test\libpmempool_rm\libpmempool_rm.vcxproj", "{5F2B687A-1B42-439C-AEEC-135DD22FB851}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_is_pmem_windows", "test\pmem_is_pmem_windows\pmem_is_pmem_windows.vcxproj", "{5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmemlog", "examples\libpmemobj\pmemlog\obj_pmemlog.vcxproj", "{60206D22-E132-4695-8486-10BECA32C5CC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_backup", "test\libpmempool_backup\libpmempool_backup.vcxproj", "{60B463D4-8CD5-4BF6-A25B-01BE13B87590}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_fragmentation", "test\obj_fragmentation\obj_fragmentation.vcxproj", "{60EF55C7-8399-4543-B5B2-3AE2C532C67E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_rw_mt", "test\blk_rw_mt\blk_rw_mt.vcxproj", "{628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pool_lock", "test\obj_pool_lock\obj_pool_lock.vcxproj", "{63B8184D-85E0-4E6A-9729-558C567D1D1D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemobj", "libpmemobj", "{63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_strdup", "test\obj_tx_strdup\obj_tx_strdup.vcxproj", "{643B82A1-D009-46A9-92A0-2883399B05C2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_sync", "test\obj_sync\obj_sync.vcxproj", "{6516D6CF-8000-4341-9487-312BC83EE370}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmalloc_basic", "test\obj_pmalloc_basic\obj_pmalloc_basic.vcxproj", "{65D92D98-97E1-48F7-AEF6-75221CF48EA4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_memcpy", "test\pmem_memcpy\pmem_memcpy.vcxproj", "{673277EC-D26B-414D-92E3-84EE873316A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_memset", "test\pmem2_memset\pmem2_memset.vcxproj", "{6770917C-5B8E-49F1-9297-163FAB76DAFB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_rm_win", "test\libpmempool_rm_win\libpmempool_rm_win.vcxproj", "{67AC1343-98FD-4143-92C0-559C55F749F5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_rw", "test\blk_rw\blk_rw.vcxproj", "{6851356E-A5D9-46A6-8262-A7E208729F18}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {F7C6C6B6-4142-4C82-8699-4A9D8183181B}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_common", "test\win_common\win_common.vcxproj", "{6AE1B8BE-D46A-4E99-87A2-F160FB950DCA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_poolset_size", "test\util_poolset_size\util_poolset_size.vcxproj", "{6B492754-9F80-44B3-A2A7-1D98AF06F3B2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list_macro", "test\obj_list_macro\obj_list_macro.vcxproj", "{6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "string_store_tx", "string_store_tx", "{6D63CDF1-F62C-4614-AD8A-95B0A63AA070}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "set_funcs", "test\set_funcs\set_funcs.vcxproj", "{6D7C1169-3246-465F-B630-ECFEF4F3179A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_alignment", "test\obj_ctl_alignment\obj_ctl_alignment.vcxproj", "{6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_unmap", "test\pmem_unmap\pmem_unmap.vcxproj", "{6EC93484-AAF3-487E-84E4-5ABFBA0AFC53}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_poolset", "test\util_poolset\util_poolset.vcxproj", "{6F06A19B-0921-4B71-A3A5-B350B5FFEADB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_locks_abort", "test\obj_tx_locks_abort\obj_tx_locks_abort.vcxproj", "{6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_feature", "test\libpmempool_feature\libpmempool_feature.vcxproj", "{6F776280-B383-4DCE-8F42-9670164D038D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_out_of_memory", "test\obj_out_of_memory\obj_out_of_memory.vcxproj", "{70EE1D40-0C65-4985-8EFC-BD40EE3A89B2}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_file_open", "test\util_file_open\util_file_open.vcxproj", "{715EADD7-0FFE-4F1F-94E7-49302968DF79}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_check", "test\obj_check\obj_check.vcxproj", "{71D182E0-345A-4375-B0FA-3536821B0EE3}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "array", "examples\libpmemobj\array\array.vcxproj", "{7264C8F6-73FB-4830-9306-1558D3EAC71B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list", "test\obj_list\obj_list.vcxproj", "{729E3905-FF7D-49C5-9871-6D35D839183E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_ravl", "test\util_ravl\util_ravl.vcxproj", "{72C9DB46-C665-48AD-B805-BA885B40CA3E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "writer", "examples\libpmemobj\string_store_tx\writer.vcxproj", "{7337E34A-97B0-44FC-988B-7E6AE7E0FBBF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_memops", "test\obj_memops\obj_memops.vcxproj", "{740ED97D-005F-4F58-98B2-4EF5EF5776E8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{746BA101-5C93-42A5-AC7A-64DCEB186572}"
+       ProjectSection(SolutionItems) = preProject
+               test\match = test\match
+               test\RUNTESTLIB.PS1 = test\RUNTESTLIB.PS1
+               test\RUNTESTS.ps1 = test\RUNTESTS.ps1
+               test\unittest\unittest.ps1 = test\unittest\unittest.ps1
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reader", "examples\libpmemobj\string_store_tx_type\reader.vcxproj", "{74D655D5-F661-4887-A1EB-5A6222AF5FCA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_critnib_mt", "test\obj_critnib_mt\obj_critnib_mt.vcxproj", "{7701627C-CFD9-48F6-942E-EAACC8D057FA}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "linux", "linux", "{774627B7-6532-4464-AEE4-02F72CA44F95}"
+       ProjectSection(SolutionItems) = preProject
+               windows\include\linux\limits.h = windows\include\linux\limits.h
+       EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemblk", "libpmemblk", "{7783BC49-A25B-468B-A6F8-AB6B39A91C65}"
+       ProjectSection(SolutionItems) = preProject
+               ..\doc\libpmemblk\libpmemblk.7.md = ..\doc\libpmemblk\libpmemblk.7.md
+               ..\doc\libpmemblk\pmemblk_bsize.3.md = ..\doc\libpmemblk\pmemblk_bsize.3.md
+               ..\doc\libpmemblk\pmemblk_create.3.md = ..\doc\libpmemblk\pmemblk_create.3.md
+               ..\doc\libpmemblk\pmemblk_read.3.md = ..\doc\libpmemblk\pmemblk_read.3.md
+               ..\doc\libpmemblk\pmemblk_set_zero.3.md = ..\doc\libpmemblk\pmemblk_set_zero.3.md
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_pool_lock", "test\blk_pool_lock\blk_pool_lock.vcxproj", "{779425B1-2211-499B-A7CC-4F9EC6CB0D25}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {F7C6C6B6-4142-4C82-8699-4A9D8183181B}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "btree_map", "examples\libpmemobj\tree_map\btree_map.vcxproj", "{79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_extend", "test\obj_extend\obj_extend.vcxproj", "{7ABF755C-821B-49CD-8EDE-83C16594FF7F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool", "tools\pmempool\pmempool.vcxproj", "{7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}"
+       ProjectSection(ProjectDependencies) = postProject
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_libpmem", "test\ex_libpmem\ex_libpmem.vcxproj", "{7DFEB4A5-8B04-4302-9D09-8144918FCF81}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_free", "test\obj_tx_free\obj_tx_free.vcxproj", "{7F51CD29-3BCD-4DD8-B327-F384B5A616D1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asset_list", "examples\libpmemblk\assetdb\asset_list.vcxproj", "{8008010F-8718-4C5F-86B2-195AEBF73422}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manpage", "examples\libpmemblk\manpage.vcxproj", "{8010BBB0-C71B-4EFF-95EB-65C01E5EC197}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_pool_win", "test\blk_pool_win\blk_pool_win.vcxproj", "{80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_poolset_unmap", "test\win_poolset_unmap\win_poolset_unmap.vcxproj", "{810DB909-6581-42D8-9616-906888F12149}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{853D45D8-980C-4991-B62A-DAC6FD245402}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_heap", "test\obj_heap\obj_heap.vcxproj", "{85D4076B-896B-4EBB-8F3A-8B44C24CD452}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_debug", "test\obj_debug\obj_debug.vcxproj", "{85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_heap_state", "test\obj_heap_state\obj_heap_state.vcxproj", "{86EE22CC-6D3C-4F81-ADC8-394946F0DA81}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{877E7D1D-8150-4FE5-A139-B6FBCEAEC393}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemobj", "libpmemobj", "{87A32959-E477-4CD5-8A1C-C85646D806B2}"
+       ProjectSection(SolutionItems) = preProject
+               ..\doc\libpmemobj\libpmemobj.7.md = ..\doc\libpmemobj\libpmemobj.7.md
+               ..\doc\libpmemobj\oid_is_null.3.md = ..\doc\libpmemobj\oid_is_null.3.md
+               ..\doc\libpmemobj\pmemobj_action.3.md = ..\doc\libpmemobj\pmemobj_action.3.md
+               ..\doc\libpmemobj\pmemobj_alloc.3.md = ..\doc\libpmemobj\pmemobj_alloc.3.md
+               ..\doc\libpmemobj\pmemobj_ctl_get.3.md = ..\doc\libpmemobj\pmemobj_ctl_get.3.md
+               ..\doc\libpmemobj\pmemobj_first.3.md = ..\doc\libpmemobj\pmemobj_first.3.md
+               ..\doc\libpmemobj\pmemobj_list_insert.3.md = ..\doc\libpmemobj\pmemobj_list_insert.3.md
+               ..\doc\libpmemobj\pmemobj_memcpy_persist.3.md = ..\doc\libpmemobj\pmemobj_memcpy_persist.3.md
+               ..\doc\libpmemobj\pmemobj_mutex_zero.3.md = ..\doc\libpmemobj\pmemobj_mutex_zero.3.md
+               ..\doc\libpmemobj\pmemobj_open.3.md = ..\doc\libpmemobj\pmemobj_open.3.md
+               ..\doc\libpmemobj\pmemobj_root.3.md = ..\doc\libpmemobj\pmemobj_root.3.md
+               ..\doc\libpmemobj\pmemobj_tx_add_range.3.md = ..\doc\libpmemobj\pmemobj_tx_add_range.3.md
+               ..\doc\libpmemobj\pmemobj_tx_alloc.3.md = ..\doc\libpmemobj\pmemobj_tx_alloc.3.md
+               ..\doc\libpmemobj\pmemobj_tx_begin.3.md = ..\doc\libpmemobj\pmemobj_tx_begin.3.md
+               ..\doc\libpmemobj\pobj_layout_begin.3.md = ..\doc\libpmemobj\pobj_layout_begin.3.md
+               ..\doc\libpmemobj\pobj_list_head.3.md = ..\doc\libpmemobj\pobj_list_head.3.md
+               ..\doc\libpmemobj\toid_declare.3.md = ..\doc\libpmemobj\toid_declare.3.md
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmalloc_oom_mt", "test\obj_pmalloc_oom_mt\obj_pmalloc_oom_mt.vcxproj", "{88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_add_range_direct", "test\obj_tx_add_range_direct\obj_tx_add_range_direct.vcxproj", "{89F947CA-DDEF-4131-8AFB-584ABA4A1302}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "out_err", "test\out_err\out_err.vcxproj", "{8A0FA780-068A-4534-AA2F-4FF4CF977AF2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_bucket", "test\obj_bucket\obj_bucket.vcxproj", "{8A4872D7-A234-4B9B-8215-82C6BB15F3A2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmemblk", "examples\libpmemobj\pmemblk\obj_pmemblk.vcxproj", "{8C42CA7C-1543-4F1B-A55F-28CD419C7D35}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_oid_thread", "test\obj_oid_thread\obj_oid_thread.vcxproj", "{8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_persist_count", "test\obj_persist_count\obj_persist_count.vcxproj", "{8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_flow", "test\obj_tx_flow\obj_tx_flow.vcxproj", "{8E374371-30E1-4623-8755-2A2F3742170B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "srcversion", "windows\srcversion\srcversion.vcxproj", "{901F04DB-E1A5-4A41-8B81-9D31C19ACD59}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "windows\getopt\getopt.vcxproj", "{9186EAC4-2F34-4F17-B940-6585D7869BCD}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemlog", "libpmemlog", "{91C30620-70CA-46C7-AC71-71F3C602690E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_realloc", "test\obj_realloc\obj_realloc.vcxproj", "{91E19AEB-7B75-43E0-B8B4-D2BB60D839EA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_movnt_align", "test\pmem2_movnt_align\pmem2_movnt_align.vcxproj", "{9233FC80-B51C-4A89-AF58-5AE86C068F6A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_create", "test\pmempool_create\pmempool_create.vcxproj", "{92388A20-50FC-45F8-89E3-71F1618EFABB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat_incompat_features", "test\compat_incompat_features\compat_incompat_features.vcxproj", "{924B2937-0B53-4DC6-B7E1-5F3102728F89}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_pool", "test\blk_pool\blk_pool.vcxproj", "{95B683BD-B9DC-400F-9BC0-8F1505F08BF5}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {F7C6C6B6-4142-4C82-8699-4A9D8183181B}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windows", "Windows", "{95FAF291-03D1-42FC-9C10-424D551D475D}"
+       ProjectSection(SolutionItems) = preProject
+               common\common.rc = common\common.rc
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_movnt", "test\pmem_movnt\pmem_movnt.vcxproj", "{96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_cpuid", "test\util_cpuid\util_cpuid.vcxproj", "{98ACBE5D-1A92-46F9-AA81-533412172952}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_rm", "test\pmempool_rm\pmempool_rm.vcxproj", "{99F7F00F-1DE5-45EA-992B-64BA282FAC76}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_uuid_generate", "test\util_uuid_generate\util_uuid_generate.vcxproj", "{9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "include", "include", "{9A8482A7-BF0C-423D-8266-189456ED41F6}"
+       ProjectSection(SolutionItems) = preProject
+               windows\include\dirent.h = windows\include\dirent.h
+               windows\include\endian.h = windows\include\endian.h
+               windows\include\err.h = windows\include\err.h
+               windows\include\features.h = windows\include\features.h
+               windows\include\libgen.h = windows\include\libgen.h
+               windows\include\platform.h = windows\include\platform.h
+               include\pmemcompat.h = include\pmemcompat.h
+               windows\include\sched.h = windows\include\sched.h
+               windows\include\srcversion.h = windows\include\srcversion.h
+               windows\include\strings.h = windows\include\strings.h
+               windows\include\unistd.h = windows\include\unistd.h
+               windows\include\win_mmap.h = windows\include\win_mmap.h
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_realloc", "test\obj_tx_realloc\obj_tx_realloc.vcxproj", "{9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{9C37B8CC-F810-4787-924D-65BC227091A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_invalid", "test\obj_tx_invalid\obj_tx_invalid.vcxproj", "{9D9E33EB-4C24-4646-A3FB-35DA17247917}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmem", "libpmem\libpmem.vcxproj", "{9E9E3D25-2139-4A5D-9200-18148DDEAD45}"
+       ProjectSection(ProjectDependencies) = postProject
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manpage", "examples\libpmemlog\manpage.vcxproj", "{9FF51F3E-AF36-4F45-A797-C5F03A090298}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmalloc_mt", "test\obj_pmalloc_mt\obj_pmalloc_mt.vcxproj", "{9FF62356-30B4-42A1-8DC7-45262A18DD44}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmem2", "libpmem2", "{A14A4556-9092-430D-B9CA-B2B1223D56CB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gran_detecto", "test\tools\gran_detecto\gran_detecto.vcxproj", "{A18B076A-CE8C-49A6-8B80-F02843E4BF0A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ddmap", "test\tools\ddmap\ddmap.vcxproj", "{A216BF23-FC5C-4426-BF20-8568A2AA5FA0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_test", "test\libpmempool_api\libpmempool_test.vcxproj", "{A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_nblock", "test\blk_nblock\blk_nblock.vcxproj", "{A38EFCDB-53D6-4474-97F3-0DDC6CE70D76}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {F7C6C6B6-4142-4C82-8699-4A9D8183181B}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_check_version", "test\libpmempool_check_version\libpmempool_check_version.vcxproj", "{A39D1640-8DBA-450D-9103-2533C248991A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "out_err_win", "test\out_err_win\out_err_win.vcxproj", "{A57D9365-172E-4782-ADC6-82A594E30943}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_alloc_class_config", "test\obj_ctl_alloc_class_config\obj_ctl_alloc_class_config.vcxproj", "{A79E3093-B157-4B09-BABD-29266EA16407}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "addlog", "examples\libpmemlog\logfile\addlog.vcxproj", "{A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic", "examples\libpmem2\basic\basic.vcxproj", "{A9ADD224-1755-407F-906D-C13EC37FF7B0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_include", "test\obj_include\obj_include.vcxproj", "{AB15A115-E429-4123-BEBF-206FBA4CF615}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_sync", "test\libpmempool_sync\libpmempool_sync.vcxproj", "{AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_defrag_advanced", "test\obj_defrag_advanced\obj_defrag_advanced.vcxproj", "{AE952763-5C84-43FC-B344-CACC950F056C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_handle", "test\signal_handle\signal_handle.vcxproj", "{AE9E908D-BAEC-491F-9914-436B3CE35E94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_config", "test\obj_ctl_config\obj_ctl_config.vcxproj", "{AEAA72CD-E060-417C-9CA1-49B4738384E0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_feature", "test\pmempool_feature\pmempool_feature.vcxproj", "{AF038868-2432-4159-A62F-941F11D12C5D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checksum", "test\checksum\checksum.vcxproj", "{AF0B7480-EBE3-486B-B0C8-134910BC9324}"
+       ProjectSection(ProjectDependencies) = postProject
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_transform_win", "test\libpmempool_transform_win\libpmempool_transform_win.vcxproj", "{B30C6212-A160-405A-8FE7-340E721738A2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemwrite", "test\tools\pmemwrite\pmemwrite.vcxproj", "{B35BFA09-DE68-483B-AB61-8790E8F060A8}"
+       ProjectSection(ProjectDependencies) = postProject
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_memset", "test\pmem_memset\pmem_memset.vcxproj", "{B36F115C-8139-4C35-A3E7-E6BF9F3DA793}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_heap_size", "test\obj_ctl_heap_size\obj_ctl_heap_size.vcxproj", "{B379539C-E130-460D-AE82-4EBDD1A97845}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_mem", "test\obj_mem\obj_mem.vcxproj", "{B3AF8A19-5802-4A34-9157-27BBE4E53C0A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_linkedlist", "test\ex_linkedlist\ex_linkedlist.vcxproj", "{B440BB05-37A8-42EA-98D3-D83EB113E497}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_compat", "test\pmem2_compat\pmem2_compat.vcxproj", "{B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_include", "test\pmem2_include\pmem2_include.vcxproj", "{B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_sync_win", "test\libpmempool_sync_win\libpmempool_sync_win.vcxproj", "{B6DA6617-D98F-4A4D-A7C4-A317212924BF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tools_pmemspoil", "test\pmemspoil\pmemspoil.vcxproj", "{B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pool_win", "test\obj_pool_win\obj_pool_win.vcxproj", "{B775480C-5B32-4F64-B026-47367280EC56}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windows", "windows", "{B870D8A6-12CD-4DD0-B843-833695C2310A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list_recovery", "test\obj_list_recovery\obj_list_recovery.vcxproj", "{B887EA26-846C-4D6A-B0E4-432487506BC7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemlog", "libpmemlog", "{B8A4320D-E9A3-4F89-A8AA-B16D746C158A}"
+       ProjectSection(SolutionItems) = preProject
+               ..\doc\libpmemlog\libpmemlog.7.md = ..\doc\libpmemlog\libpmemlog.7.md
+               ..\doc\libpmemlog\pmemlog_append.3.md = ..\doc\libpmemlog\pmemlog_append.3.md
+               ..\doc\libpmemlog\pmemlog_create.3.md = ..\doc\libpmemlog\pmemlog_create.3.md
+               ..\doc\libpmemlog\pmemlog_nbyte.3.md = ..\doc\libpmemlog\pmemlog_nbyte.3.md
+               ..\doc\libpmemlog\pmemlog_tell.3.md = ..\doc\libpmemlog\pmemlog_tell.3.md
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buffons_needle_problem", "examples\libpmemobj\buffons_needle_problem.vcxproj", "{BA0EF7F5-BE6C-4B61-9D5F-1480462EE001}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_first_next", "test\obj_first_next\obj_first_next.vcxproj", "{BABC6427-E533-4DCF-91E3-B5B2ED253F46}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list_move", "test\obj_list_move\obj_list_move.vcxproj", "{BAE107BA-7618-4972-8188-2D3CDAAE0453}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_layout", "test\obj_layout\obj_layout.vcxproj", "{BB1120CF-B721-4EF9-8735-58F76AE51D2F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapcli", "examples\libpmemobj\map\mapcli.vcxproj", "{BB248BAC-6E1B-433C-A254-75140A273AB5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "map", "map", "{BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctree_map", "examples\libpmemobj\tree_map\ctree_map.vcxproj", "{BE18F227-A9F0-4B38-B689-4E2F9F09CA5F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmem2", "libpmem2", "{BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemblk", "libpmemblk", "{BFBAB433-860E-4A28-96E3-A4B7AFE3B297}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "string_store", "string_store", "{BFEDF709-A700-4769-9056-ACA934D828A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scope", "test\scope\scope.vcxproj", "{C0E811E0-8942-4CFD-A817-74D99E9E6577}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list_insert", "test\obj_list_insert\obj_list_insert.vcxproj", "{C2C36D03-26EE-4BD8-8FFC-86CFE16C1218}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_libpmem2", "test\ex_libpmem2\ex_libpmem2.vcxproj", "{C2D5E690-748B-4138-B572-1774B99A8572}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_strdup", "test\obj_strdup\obj_strdup.vcxproj", "{C2F94489-A483-4C44-B8A7-11A75F6AEC66}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ulog_size", "test\obj_ulog_size\obj_ulog_size.vcxproj", "{C35052AF-2383-4F9C-B18B-55A01829F2BF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "printlog", "examples\libpmemlog\logfile\printlog.vcxproj", "{C3CEE34C-29E0-4A22-B258-3FBAF662AA19}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_sync", "test\pmempool_sync\pmempool_sync.vcxproj", "{C5E8B8DB-2507-4904-847F-A52196B075F0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_integration", "test\pmem2_integration\pmem2_integration.vcxproj", "{C7025EE1-57E5-44B9-A4F5-3CB059601FC3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_pool_win", "test\log_pool_win\log_pool_win.vcxproj", "{C71DAF3E-9361-4723-93E2-C475D1D0C0D0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemblk", "libpmemblk", "{C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asset_load", "examples\libpmemblk\assetdb\asset_load.vcxproj", "{C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_is_absolute", "test\util_is_absolute\util_is_absolute.vcxproj", "{C973CD39-D63B-4F5C-BE1D-DED17388B5A4}"
+       ProjectSection(ProjectDependencies) = postProject
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traces", "test\traces\traces.vcxproj", "{CA4BBB24-D33E-42E2-A495-F10D80DE8C1D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmembench", "benchmarks\pmembench.vcxproj", "{CB906E89-1313-4929-AFF7-86FBF1CC301F}"
+       ProjectSection(ProjectDependencies) = postProject
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76} = {99F7F00F-1DE5-45EA-992B-64BA282FAC76}
+               {67AC1343-98FD-4143-92C0-559C55F749F5} = {67AC1343-98FD-4143-92C0-559C55F749F5}
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851} = {5F2B687A-1B42-439C-AEEC-135DD22FB851}
+               {CF9A0883-6334-44C7-AC29-349468C78E27} = {CF9A0883-6334-44C7-AC29-349468C78E27}
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA} = {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_lane", "test\obj_lane\obj_lane.vcxproj", "{CCA9B681-D10B-45E4-98CC-531503D2EDE8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_check", "test\pmempool_check\pmempool_check.vcxproj", "{CDD9DFC6-5C3D-42F7-B822-FE29A1C21752}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libut", "test\unittest\libut.vcxproj", "{CE3F2DFB-8470-4802-AD37-21CAF6CB2681}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool", "libpmempool\libpmempool.vcxproj", "{CF9A0883-6334-44C7-AC29-349468C78E27}"
+       ProjectSection(ProjectDependencies) = postProject
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_zones", "test\obj_zones\obj_zones.vcxproj", "{CF9F4CEA-EC66-4E78-A086-107EB29E0637}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_copy", "examples\libpmem\simple_copy.vcxproj", "{D062166F-0EC7-4C13-A772-0C7157EEFE41}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_pmalloc_rand_mt", "test\obj_pmalloc_rand_mt\obj_pmalloc_rand_mt.vcxproj", "{D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tools_pmemobjcli", "test\pmemobjcli\pmemobjcli.vcxproj", "{D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "advanced", "examples\libpmem2\advanced\advanced.vcxproj", "{D2964B88-EB05-4EBF-ACDA-44596FBFECB6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmemobjcli", "test\tools\pmemobjcli\pmemobjcli.vcxproj", "{D2C30C7E-A7D3-487A-956E-418CECAFFE8E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fifo", "examples\libpmemobj\linkedlist\fifo.vcxproj", "{D3A99F36-4B72-4766-ABCD-CCEDC26DD139}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmempool_help", "test\pmempool_help\pmempool_help.vcxproj", "{D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_memcpy", "test\pmem2_memcpy\pmem2_memcpy.vcxproj", "{D43FCFB6-97D2-44B2-8577-94B43B97D7CA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "redo", "examples\libpmem2\redo\redo.vcxproj", "{D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_file_create", "test\util_file_create\util_file_create.vcxproj", "{D829DB63-E046-474D-8EA3-43A6659294D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_libpmemlog", "test\ex_libpmemlog\ex_libpmemlog.vcxproj", "{D8317F1D-7A70-4A39-977A-EAB05A04A87B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_lock", "test\obj_tx_lock\obj_tx_lock.vcxproj", "{D88187D2-1977-4C5F-B0CD-83C69BD6C1BC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hashmap_tx", "examples\libpmemobj\hashmap\hashmap_tx.vcxproj", "{D93A2683-6D99-4F18-B378-91195D23E007}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_map", "test\pmem2_map\pmem2_map.vcxproj", "{D9A70E35-0C85-4A09-ACA8-B15B21B66F50}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_recovery", "test\blk_recovery\blk_recovery.vcxproj", "{DB68AB21-510B-4BA1-9E6F-E5731D8647BC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_config", "test\pmem2_config\pmem2_config.vcxproj", "{DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_source_size", "test\pmem2_source_size\pmem2_source_size.vcxproj", "{DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_has_auto_flush_win", "test\pmem_has_auto_flush_win\pmem_has_auto_flush_win.vcxproj", "{DEA3CD0A-8781-4ABE-9A7D-00B91132FED0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_ctl_alloc_class", "test\obj_ctl_alloc_class\obj_ctl_alloc_class.vcxproj", "{E07C9A5F-B2E4-44FB-AA87-FBC885AC955D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{E23BB160-006E-44F2-8FB4-3A2240BBC20C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "string_store_tx_type", "string_store_tx_type", "{E3229AF7-1FA2-4632-BB0B-B74F709F1A33}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_is_pmem", "test\pmem_is_pmem\pmem_is_pmem.vcxproj", "{E4E2EC33-7902-45D0-9C3C-ADBAFA46874A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_poolset_foreach", "test\util_poolset_foreach\util_poolset_foreach.vcxproj", "{E648732D-78FA-427A-928C-9A59222D37B7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_map_from_existing", "test\pmem2_map_from_existing\pmem2_map_from_existing.vcxproj", "{E660218B-3B2D-4378-A2CD-78B865764CF1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_pool_lock", "test\log_pool_lock\log_pool_lock.vcxproj", "{E68DEB59-C709-4945-AF80-EEBCADDED944}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_constructor", "test\obj_constructor\obj_constructor.vcxproj", "{E7691F81-86EF-467D-82E1-F5B9416386F9}"
+       ProjectSection(ProjectDependencies) = postProject
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_ctl", "test\util_ctl\util_ctl.vcxproj", "{E796AA20-D664-4D05-ABD9-C93A4FBE3E5C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_bttdev", "test\libpmempool_bttdev\libpmempool_bttdev.vcxproj", "{E85E017F-04C0-4716-BF21-949C82C68912}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_recovery", "test\log_recovery\log_recovery.vcxproj", "{E901B756-EA72-4B8D-967F-85F109D0D1DE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_locks", "test\obj_tx_locks\obj_tx_locks.vcxproj", "{E9E079D6-25BF-46E3-8075-7D733303DD59}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_map_flog", "test\libpmempool_map_flog\libpmempool_map_flog.vcxproj", "{ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manpage", "examples\libpmemobj\manpage.vcxproj", "{EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_sds", "test\obj_sds\obj_sds.vcxproj", "{EDD5FA29-69AF-445F-842A-132E65D3C92B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_granularity", "test\pmem2_granularity\pmem2_granularity.vcxproj", "{EF951090-8938-4F7D-8674-7F6FB1F2C25E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_mmap_dtor", "test\win_mmap_dtor\win_mmap_dtor.vcxproj", "{F03DABEE-A03E-4437-BFD3-D012836F2D94}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{F09A0864-9221-47AD-872F-D4538104D747}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_is_poolset", "test\util_is_poolset\util_is_poolset.vcxproj", "{F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win_signal", "test\win_signal\win_signal.vcxproj", "{F13108C4-4C86-4D56-A317-A4E5892A8AF7}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{F18C84B3-7898-4324-9D75-99A6048F442D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_tx_add_range", "test\obj_tx_add_range\obj_tx_add_range.vcxproj", "{F3E5650D-834E-45E6-90C7-3FC2AA954929}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmemobj", "libpmemobj", "{F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmem2", "libpmem2\libpmem2.vcxproj", "{F596C36C-5C96-4F08-B420-8908AF500954}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "writer", "examples\libpmemobj\string_store\writer.vcxproj", "{F5D850C9-D353-4B84-99BC-E336C231018C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hashmap_rp", "examples\libpmemobj\hashmap\hashmap_rp.vcxproj", "{F5E2F6C4-19BA-497A-B754-232E4666E647}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hashmap_atomic", "examples\libpmemobj\hashmap\hashmap_atomic.vcxproj", "{F5E2F6C4-19BA-497A-B754-232E469BE647}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ex_libpmemobj", "test\ex_libpmemobj\ex_libpmemobj.vcxproj", "{F63FB47F-1DCE-48E5-9CBD-F3E0A354472B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem2_deep_flush", "test\pmem2_deep_flush\pmem2_deep_flush.vcxproj", "{F7508935-C65A-4521-88E3-76AB24F2978D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmemblk", "libpmemblk\libpmemblk.vcxproj", "{F7C6C6B6-4142-4C82-8699-4A9D8183181B}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {492BAA3D-0D5D-478E-9765-500463AE69AA}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}
+       EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libpmem", "libpmem", "{F8373EDD-1B9E-462D-BF23-55638E23E98B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{F8CCA5AE-2D75-4C79-BEAB-2588CD5956C8}"
+       ProjectSection(SolutionItems) = preProject
+               ..\appveyor.yml = ..\appveyor.yml
+               ..\utils\CHECK_WHITESPACE.PS1 = ..\utils\CHECK_WHITESPACE.PS1
+               ..\utils\CREATE-ZIP.PS1 = ..\utils\CREATE-ZIP.PS1
+               ..\utils\cstyle = ..\utils\cstyle
+               ..\utils\CSTYLE.ps1 = ..\utils\CSTYLE.ps1
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpmempool_transform", "test\libpmempool_transform\libpmempool_transform.vcxproj", "{FB2D2B18-E616-4639-8593-0E1AF2DA01A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log_basic", "test\log_basic\log_basic.vcxproj", "{FBB77433-639E-42DC-9355-EA94CAE294D2}"
+       ProjectSection(ProjectDependencies) = postProject
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {9E9E3D25-2139-4A5D-9200-18148DDEAD45}
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86} = {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_root", "test\obj_root\obj_root.vcxproj", "{FC2248F5-3E9E-495B-9767-87F59614047C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpufd", "test\tools\cpufd\cpufd.vcxproj", "{FC998FE5-C843-42BA-9731-F46DB02F1853}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "manpage", "examples\libpmem\manpage.vcxproj", "{FCD0587A-4504-4F5E-8E9C-468CC03D250A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_vec", "test\util_vec\util_vec.vcxproj", "{FD726AA3-D4FA-4597-B435-08CC7752888C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_is_zeroed", "test\util_is_zeroed\util_is_zeroed.vcxproj", "{FD726AA3-D4FA-4597-B435-08CC7752888D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util_vecq", "test\util_vecq\util_vecq.vcxproj", "{FD726AA3-D4FA-4597-B435-08CC7752888E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmap_fixed", "test\mmap_fixed\mmap_fixed.vcxproj", "{FEA09B48-34C2-4963-8A5A-F97BDA136D72}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_list_remove", "test\obj_list_remove\obj_list_remove.vcxproj", "{FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_defrag", "test\obj_defrag\obj_defrag.vcxproj", "{FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|x64 = Debug|x64
+               Release|x64 = Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235}.Debug|x64.ActiveCfg = Debug|x64
+               {0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235}.Debug|x64.Build.0 = Debug|x64
+               {0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235}.Release|x64.ActiveCfg = Release|x64
+               {0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235}.Release|x64.Build.0 = Release|x64
+               {019F5586-5558-4C87-B319-85906D4AE407}.Debug|x64.ActiveCfg = Debug|x64
+               {019F5586-5558-4C87-B319-85906D4AE407}.Debug|x64.Build.0 = Debug|x64
+               {019F5586-5558-4C87-B319-85906D4AE407}.Release|x64.ActiveCfg = Release|x64
+               {019F5586-5558-4C87-B319-85906D4AE407}.Release|x64.Build.0 = Release|x64
+               {025E7D51-41F2-4CBA-956E-C37A4443DB1B}.Debug|x64.ActiveCfg = Debug|x64
+               {025E7D51-41F2-4CBA-956E-C37A4443DB1B}.Debug|x64.Build.0 = Debug|x64
+               {025E7D51-41F2-4CBA-956E-C37A4443DB1B}.Release|x64.ActiveCfg = Release|x64
+               {025E7D51-41F2-4CBA-956E-C37A4443DB1B}.Release|x64.Build.0 = Release|x64
+               {0287C3DC-AE03-4714-AAFF-C52F062ECA6F}.Debug|x64.ActiveCfg = Debug|x64
+               {0287C3DC-AE03-4714-AAFF-C52F062ECA6F}.Debug|x64.Build.0 = Debug|x64
+               {0287C3DC-AE03-4714-AAFF-C52F062ECA6F}.Release|x64.ActiveCfg = Release|x64
+               {0287C3DC-AE03-4714-AAFF-C52F062ECA6F}.Release|x64.Build.0 = Release|x64
+               {02BC3B44-C7F1-4793-86C1-6F36CA8A7F53}.Debug|x64.ActiveCfg = Debug|x64
+               {02BC3B44-C7F1-4793-86C1-6F36CA8A7F53}.Debug|x64.Build.0 = Debug|x64
+               {02BC3B44-C7F1-4793-86C1-6F36CA8A7F53}.Release|x64.ActiveCfg = Release|x64
+               {03228F84-4F41-4BCC-8C2D-F329DC87B289}.Debug|x64.ActiveCfg = Debug|x64
+               {03228F84-4F41-4BCC-8C2D-F329DC87B289}.Debug|x64.Build.0 = Debug|x64
+               {03228F84-4F41-4BCC-8C2D-F329DC87B289}.Release|x64.ActiveCfg = Release|x64
+               {03228F84-4F41-4BCC-8C2D-F329DC87B289}.Release|x64.Build.0 = Release|x64
+               {0388E945-A655-41A7-AF27-8981CEE0E49A}.Debug|x64.ActiveCfg = Debug|x64
+               {0388E945-A655-41A7-AF27-8981CEE0E49A}.Debug|x64.Build.0 = Debug|x64
+               {0388E945-A655-41A7-AF27-8981CEE0E49A}.Release|x64.ActiveCfg = Release|x64
+               {0388E945-A655-41A7-AF27-8981CEE0E49A}.Release|x64.Build.0 = Release|x64
+               {03B54A12-7793-4827-B820-C07491F7F45E}.Debug|x64.ActiveCfg = Debug|x64
+               {03B54A12-7793-4827-B820-C07491F7F45E}.Debug|x64.Build.0 = Debug|x64
+               {03B54A12-7793-4827-B820-C07491F7F45E}.Release|x64.ActiveCfg = Release|x64
+               {03B54A12-7793-4827-B820-C07491F7F45E}.Release|x64.Build.0 = Release|x64
+               {0529575C-F6E8-44FD-BB82-82A29948D0F2}.Debug|x64.ActiveCfg = Debug|x64
+               {0529575C-F6E8-44FD-BB82-82A29948D0F2}.Debug|x64.Build.0 = Debug|x64
+               {0529575C-F6E8-44FD-BB82-82A29948D0F2}.Release|x64.ActiveCfg = Release|x64
+               {0529575C-F6E8-44FD-BB82-82A29948D0F2}.Release|x64.Build.0 = Release|x64
+               {063037B2-CA35-4520-811C-19D9C4ED891E}.Debug|x64.ActiveCfg = Debug|x64
+               {063037B2-CA35-4520-811C-19D9C4ED891E}.Debug|x64.Build.0 = Debug|x64
+               {063037B2-CA35-4520-811C-19D9C4ED891E}.Release|x64.ActiveCfg = Release|x64
+               {063037B2-CA35-4520-811C-19D9C4ED891E}.Release|x64.Build.0 = Release|x64
+               {06877FED-15BA-421F-85C9-1A964FB97446}.Debug|x64.ActiveCfg = Debug|x64
+               {06877FED-15BA-421F-85C9-1A964FB97446}.Debug|x64.Build.0 = Debug|x64
+               {06877FED-15BA-421F-85C9-1A964FB97446}.Release|x64.ActiveCfg = Release|x64
+               {06877FED-15BA-421F-85C9-1A964FB97446}.Release|x64.Build.0 = Release|x64
+               {0703E813-9CC8-4DEA-AA33-42B099CD172D}.Debug|x64.ActiveCfg = Debug|x64
+               {0703E813-9CC8-4DEA-AA33-42B099CD172D}.Debug|x64.Build.0 = Debug|x64
+               {0703E813-9CC8-4DEA-AA33-42B099CD172D}.Release|x64.ActiveCfg = Release|x64
+               {0703E813-9CC8-4DEA-AA33-42B099CD172D}.Release|x64.Build.0 = Release|x64
+               {07A153D9-DF17-4DE8-A3C2-EBF171B961AE}.Debug|x64.ActiveCfg = Debug|x64
+               {07A153D9-DF17-4DE8-A3C2-EBF171B961AE}.Debug|x64.Build.0 = Debug|x64
+               {07A153D9-DF17-4DE8-A3C2-EBF171B961AE}.Release|x64.ActiveCfg = Release|x64
+               {07A153D9-DF17-4DE8-A3C2-EBF171B961AE}.Release|x64.Build.0 = Release|x64
+               {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Debug|x64.ActiveCfg = Debug|x64
+               {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Debug|x64.Build.0 = Debug|x64
+               {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Release|x64.ActiveCfg = Release|x64
+               {08B62E36-63D2-4FF1-A605-4BBABAEE73FB}.Release|x64.Build.0 = Release|x64
+               {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Debug|x64.ActiveCfg = Debug|x64
+               {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Debug|x64.Build.0 = Debug|x64
+               {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Release|x64.ActiveCfg = Release|x64
+               {0A049EAD-652F-4E20-8026-90FD99AEE77A}.Release|x64.Build.0 = Release|x64
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Debug|x64.ActiveCfg = Debug|x64
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Debug|x64.Build.0 = Debug|x64
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Release|x64.ActiveCfg = Release|x64
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86}.Release|x64.Build.0 = Release|x64
+               {0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03}.Debug|x64.ActiveCfg = Debug|x64
+               {0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03}.Debug|x64.Build.0 = Debug|x64
+               {0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03}.Release|x64.ActiveCfg = Release|x64
+               {0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03}.Release|x64.Build.0 = Release|x64
+               {0CDCEB97-3270-4939-A290-EA2D3BE34B0C}.Debug|x64.ActiveCfg = Debug|x64
+               {0CDCEB97-3270-4939-A290-EA2D3BE34B0C}.Debug|x64.Build.0 = Debug|x64
+               {0CDCEB97-3270-4939-A290-EA2D3BE34B0C}.Release|x64.ActiveCfg = Release|x64
+               {0CDCEB97-3270-4939-A290-EA2D3BE34B0C}.Release|x64.Build.0 = Release|x64
+               {0D4E38EF-A9D5-4797-8994-5DBB1125C9EA}.Debug|x64.ActiveCfg = Debug|x64
+               {0D4E38EF-A9D5-4797-8994-5DBB1125C9EA}.Debug|x64.Build.0 = Debug|x64
+               {0D4E38EF-A9D5-4797-8994-5DBB1125C9EA}.Release|x64.ActiveCfg = Release|x64
+               {0D4E38EF-A9D5-4797-8994-5DBB1125C9EA}.Release|x64.Build.0 = Release|x64
+               {0DF30DE0-7F7D-43D3-940A-809EC27D3061}.Debug|x64.ActiveCfg = Debug|x64
+               {0DF30DE0-7F7D-43D3-940A-809EC27D3061}.Debug|x64.Build.0 = Debug|x64
+               {0DF30DE0-7F7D-43D3-940A-809EC27D3061}.Release|x64.ActiveCfg = Release|x64
+               {0DF30DE0-7F7D-43D3-940A-809EC27D3061}.Release|x64.Build.0 = Release|x64
+               {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Debug|x64.ActiveCfg = Debug|x64
+               {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Debug|x64.Build.0 = Debug|x64
+               {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Release|x64.ActiveCfg = Release|x64
+               {0FB8F0FD-276C-413B-97A8-67ABE0C9043B}.Release|x64.Build.0 = Release|x64
+               {10469175-EEF7-44A0-9961-AC4E45EFD800}.Debug|x64.ActiveCfg = Debug|x64
+               {10469175-EEF7-44A0-9961-AC4E45EFD800}.Debug|x64.Build.0 = Debug|x64
+               {10469175-EEF7-44A0-9961-AC4E45EFD800}.Release|x64.ActiveCfg = Release|x64
+               {10469175-EEF7-44A0-9961-AC4E45EFD800}.Release|x64.Build.0 = Release|x64
+               {10B732EF-1783-4B61-B431-36BA5A2A3C9C}.Debug|x64.ActiveCfg = Debug|x64
+               {10B732EF-1783-4B61-B431-36BA5A2A3C9C}.Debug|x64.Build.0 = Debug|x64
+               {10B732EF-1783-4B61-B431-36BA5A2A3C9C}.Release|x64.ActiveCfg = Release|x64
+               {10B732EF-1783-4B61-B431-36BA5A2A3C9C}.Release|x64.Build.0 = Release|x64
+               {11D76FBC-DFAA-4B31-9DB0-206E171E3F94}.Debug|x64.ActiveCfg = Debug|x64
+               {11D76FBC-DFAA-4B31-9DB0-206E171E3F94}.Debug|x64.Build.0 = Debug|x64
+               {11D76FBC-DFAA-4B31-9DB0-206E171E3F94}.Release|x64.ActiveCfg = Release|x64
+               {11D76FBC-DFAA-4B31-9DB0-206E171E3F94}.Release|x64.Build.0 = Release|x64
+               {11E158AE-C85A-4A6E-B66A-ED2994709276}.Debug|x64.ActiveCfg = Debug|x64
+               {11E158AE-C85A-4A6E-B66A-ED2994709276}.Debug|x64.Build.0 = Debug|x64
+               {11E158AE-C85A-4A6E-B66A-ED2994709276}.Release|x64.ActiveCfg = Release|x64
+               {11E158AE-C85A-4A6E-B66A-ED2994709276}.Release|x64.Build.0 = Release|x64
+               {12A1A3EF-202C-4DD0-9B5A-F5126CAB078F}.Debug|x64.ActiveCfg = Debug|x64
+               {12A1A3EF-202C-4DD0-9B5A-F5126CAB078F}.Debug|x64.Build.0 = Debug|x64
+               {12A1A3EF-202C-4DD0-9B5A-F5126CAB078F}.Release|x64.ActiveCfg = Release|x64
+               {12A1A3EF-202C-4DD0-9B5A-F5126CAB078F}.Release|x64.Build.0 = Release|x64
+               {1464398A-100F-4518-BDB9-939A6362B6CF}.Debug|x64.ActiveCfg = Debug|x64
+               {1464398A-100F-4518-BDB9-939A6362B6CF}.Debug|x64.Build.0 = Debug|x64
+               {1464398A-100F-4518-BDB9-939A6362B6CF}.Release|x64.ActiveCfg = Release|x64
+               {1464398A-100F-4518-BDB9-939A6362B6CF}.Release|x64.Build.0 = Release|x64
+               {179BEB5A-2C90-44F5-A734-FA756A5E668C}.Debug|x64.ActiveCfg = Debug|x64
+               {179BEB5A-2C90-44F5-A734-FA756A5E668C}.Debug|x64.Build.0 = Debug|x64
+               {179BEB5A-2C90-44F5-A734-FA756A5E668C}.Release|x64.ActiveCfg = Release|x64
+               {179BEB5A-2C90-44F5-A734-FA756A5E668C}.Release|x64.Build.0 = Release|x64
+               {17A4B817-68B1-4719-A9EF-BD8FAB747DE6}.Debug|x64.ActiveCfg = Debug|x64
+               {17A4B817-68B1-4719-A9EF-BD8FAB747DE6}.Debug|x64.Build.0 = Debug|x64
+               {17A4B817-68B1-4719-A9EF-BD8FAB747DE6}.Release|x64.ActiveCfg = Release|x64
+               {17A4B817-68B1-4719-A9EF-BD8FAB747DE6}.Release|x64.Build.0 = Release|x64
+               {18E90E1A-F2E0-40DF-9900-A14E560C9EB4}.Debug|x64.ActiveCfg = Debug|x64
+               {18E90E1A-F2E0-40DF-9900-A14E560C9EB4}.Debug|x64.Build.0 = Debug|x64
+               {18E90E1A-F2E0-40DF-9900-A14E560C9EB4}.Release|x64.ActiveCfg = Release|x64
+               {18E90E1A-F2E0-40DF-9900-A14E560C9EB4}.Release|x64.Build.0 = Release|x64
+               {1B871BA2-3F70-4BC9-9DF4-725EB07F6628}.Debug|x64.ActiveCfg = Debug|x64
+               {1B871BA2-3F70-4BC9-9DF4-725EB07F6628}.Debug|x64.Build.0 = Debug|x64
+               {1B871BA2-3F70-4BC9-9DF4-725EB07F6628}.Release|x64.ActiveCfg = Release|x64
+               {1B871BA2-3F70-4BC9-9DF4-725EB07F6628}.Release|x64.Build.0 = Release|x64
+               {1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE}.Debug|x64.ActiveCfg = Debug|x64
+               {1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE}.Debug|x64.Build.0 = Debug|x64
+               {1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE}.Release|x64.ActiveCfg = Release|x64
+               {1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE}.Release|x64.Build.0 = Release|x64
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}.Debug|x64.ActiveCfg = Debug|x64
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}.Debug|x64.Build.0 = Debug|x64
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}.Release|x64.ActiveCfg = Release|x64
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF}.Release|x64.Build.0 = Release|x64
+               {1BFBAFED-A9CE-49AF-AB2C-84199E391EE6}.Debug|x64.ActiveCfg = Debug|x64
+               {1BFBAFED-A9CE-49AF-AB2C-84199E391EE6}.Debug|x64.Build.0 = Debug|x64
+               {1BFBAFED-A9CE-49AF-AB2C-84199E391EE6}.Release|x64.ActiveCfg = Release|x64
+               {1BFBAFED-A9CE-49AF-AB2C-84199E391EE6}.Release|x64.Build.0 = Release|x64
+               {1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437}.Debug|x64.ActiveCfg = Debug|x64
+               {1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437}.Debug|x64.Build.0 = Debug|x64
+               {1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437}.Release|x64.ActiveCfg = Release|x64
+               {1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437}.Release|x64.Build.0 = Release|x64
+               {1EB3DE5B-6357-498D-8CAC-EEC0209EA454}.Debug|x64.ActiveCfg = Debug|x64
+               {1EB3DE5B-6357-498D-8CAC-EEC0209EA454}.Debug|x64.Build.0 = Debug|x64
+               {1EB3DE5B-6357-498D-8CAC-EEC0209EA454}.Release|x64.ActiveCfg = Release|x64
+               {1EB3DE5B-6357-498D-8CAC-EEC0209EA454}.Release|x64.Build.0 = Release|x64
+               {1F2E1C51-2B14-4047-BE6D-52E00FC3C780}.Debug|x64.ActiveCfg = Debug|x64
+               {1F2E1C51-2B14-4047-BE6D-52E00FC3C780}.Debug|x64.Build.0 = Debug|x64
+               {1F2E1C51-2B14-4047-BE6D-52E00FC3C780}.Release|x64.ActiveCfg = Release|x64
+               {1F2E1C51-2B14-4047-BE6D-52E00FC3C780}.Release|x64.Build.0 = Release|x64
+               {2498FCDA-E2CC-43EF-9A35-8CD63F253171}.Debug|x64.ActiveCfg = Debug|x64
+               {2498FCDA-E2CC-43EF-9A35-8CD63F253171}.Debug|x64.Build.0 = Debug|x64
+               {2498FCDA-E2CC-43EF-9A35-8CD63F253171}.Release|x64.ActiveCfg = Release|x64
+               {2498FCDA-E2CC-43EF-9A35-8CD63F253171}.Release|x64.Build.0 = Release|x64
+               {25758581-DD46-4AE4-99D9-11E736F72AD1}.Debug|x64.ActiveCfg = Debug|x64
+               {25758581-DD46-4AE4-99D9-11E736F72AD1}.Debug|x64.Build.0 = Debug|x64
+               {25758581-DD46-4AE4-99D9-11E736F72AD1}.Release|x64.ActiveCfg = Release|x64
+               {25758581-DD46-4AE4-99D9-11E736F72AD1}.Release|x64.Build.0 = Release|x64
+               {26166DF1-3C94-44AF-9075-BA31DCD2F6BB}.Debug|x64.ActiveCfg = Debug|x64
+               {26166DF1-3C94-44AF-9075-BA31DCD2F6BB}.Debug|x64.Build.0 = Debug|x64
+               {26166DF1-3C94-44AF-9075-BA31DCD2F6BB}.Release|x64.ActiveCfg = Release|x64
+               {26166DF1-3C94-44AF-9075-BA31DCD2F6BB}.Release|x64.Build.0 = Release|x64
+               {27FA11C6-431D-41D1-A417-FAB7C4F93DCA}.Debug|x64.ActiveCfg = Debug|x64
+               {27FA11C6-431D-41D1-A417-FAB7C4F93DCA}.Debug|x64.Build.0 = Debug|x64
+               {27FA11C6-431D-41D1-A417-FAB7C4F93DCA}.Release|x64.ActiveCfg = Release|x64
+               {27FA11C6-431D-41D1-A417-FAB7C4F93DCA}.Release|x64.Build.0 = Release|x64
+               {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Debug|x64.ActiveCfg = Debug|x64
+               {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Debug|x64.Build.0 = Debug|x64
+               {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Release|x64.ActiveCfg = Release|x64
+               {296F3C5D-3951-423E-8E2F-FD4A37958C72}.Release|x64.Build.0 = Release|x64
+               {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Debug|x64.ActiveCfg = Debug|x64
+               {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Debug|x64.Build.0 = Debug|x64
+               {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Release|x64.ActiveCfg = Release|x64
+               {29D9376B-DC36-4940-83F1-A7CBE38A2103}.Release|x64.Build.0 = Release|x64
+               {2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00}.Debug|x64.ActiveCfg = Debug|x64
+               {2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00}.Debug|x64.Build.0 = Debug|x64
+               {2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00}.Release|x64.ActiveCfg = Release|x64
+               {2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00}.Release|x64.Build.0 = Release|x64
+               {2B1A5104-A324-4D02-B5C7-D021FB8F880C}.Debug|x64.ActiveCfg = Debug|x64
+               {2B1A5104-A324-4D02-B5C7-D021FB8F880C}.Debug|x64.Build.0 = Debug|x64
+               {2B1A5104-A324-4D02-B5C7-D021FB8F880C}.Release|x64.ActiveCfg = Release|x64
+               {2B1A5104-A324-4D02-B5C7-D021FB8F880C}.Release|x64.Build.0 = Release|x64
+               {2B2DE575-1422-4FBF-97BE-35AEDA0AB465}.Debug|x64.ActiveCfg = Debug|x64
+               {2B2DE575-1422-4FBF-97BE-35AEDA0AB465}.Debug|x64.Build.0 = Debug|x64
+               {2B2DE575-1422-4FBF-97BE-35AEDA0AB465}.Release|x64.ActiveCfg = Release|x64
+               {2B2DE575-1422-4FBF-97BE-35AEDA0AB465}.Release|x64.Build.0 = Release|x64
+               {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Debug|x64.ActiveCfg = Debug|x64
+               {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Debug|x64.Build.0 = Debug|x64
+               {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Release|x64.ActiveCfg = Release|x64
+               {2B7772E6-9DAA-4F38-B0BC-7B2399366325}.Release|x64.Build.0 = Release|x64
+               {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462}.Debug|x64.ActiveCfg = Debug|x64
+               {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462}.Debug|x64.Build.0 = Debug|x64
+               {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462}.Release|x64.ActiveCfg = Release|x64
+               {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462}.Release|x64.Build.0 = Release|x64
+               {2DE6B085-3C19-49B1-894A-AD9376000E09}.Debug|x64.ActiveCfg = Debug|x64
+               {2DE6B085-3C19-49B1-894A-AD9376000E09}.Debug|x64.Build.0 = Debug|x64
+               {2DE6B085-3C19-49B1-894A-AD9376000E09}.Release|x64.ActiveCfg = Release|x64
+               {2DE6B085-3C19-49B1-894A-AD9376000E09}.Release|x64.Build.0 = Release|x64
+               {2ED26FDA-3C4E-4514-B387-5E77C302FF71}.Debug|x64.ActiveCfg = Debug|x64
+               {2ED26FDA-3C4E-4514-B387-5E77C302FF71}.Debug|x64.Build.0 = Debug|x64
+               {2ED26FDA-3C4E-4514-B387-5E77C302FF71}.Release|x64.ActiveCfg = Release|x64
+               {2ED26FDA-3C4E-4514-B387-5E77C302FF71}.Release|x64.Build.0 = Release|x64
+               {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E}.Debug|x64.ActiveCfg = Debug|x64
+               {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E}.Debug|x64.Build.0 = Debug|x64
+               {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E}.Release|x64.ActiveCfg = Release|x64
+               {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E}.Release|x64.Build.0 = Release|x64
+               {2FA3155B-6F26-4D15-AC03-9D82D48DBC42}.Debug|x64.ActiveCfg = Debug|x64
+               {2FA3155B-6F26-4D15-AC03-9D82D48DBC42}.Debug|x64.Build.0 = Debug|x64
+               {2FA3155B-6F26-4D15-AC03-9D82D48DBC42}.Release|x64.ActiveCfg = Release|x64
+               {2FA3155B-6F26-4D15-AC03-9D82D48DBC42}.Release|x64.Build.0 = Release|x64
+               {3142CB13-CADA-48D3-9A25-E6ACB243760A}.Debug|x64.ActiveCfg = Debug|x64
+               {3142CB13-CADA-48D3-9A25-E6ACB243760A}.Debug|x64.Build.0 = Debug|x64
+               {3142CB13-CADA-48D3-9A25-E6ACB243760A}.Release|x64.ActiveCfg = Release|x64
+               {3142CB13-CADA-48D3-9A25-E6ACB243760A}.Release|x64.Build.0 = Release|x64
+               {34DB4951-DA08-45F1-938D-B08E5FF5AB46}.Debug|x64.ActiveCfg = Debug|x64
+               {34DB4951-DA08-45F1-938D-B08E5FF5AB46}.Debug|x64.Build.0 = Debug|x64
+               {34DB4951-DA08-45F1-938D-B08E5FF5AB46}.Release|x64.ActiveCfg = Release|x64
+               {34DB4951-DA08-45F1-938D-B08E5FF5AB46}.Release|x64.Build.0 = Release|x64
+               {34F31D9D-3D33-4C09-85A3-4749A8AB8EBB}.Debug|x64.ActiveCfg = Debug|x64
+               {34F31D9D-3D33-4C09-85A3-4749A8AB8EBB}.Debug|x64.Build.0 = Debug|x64
+               {34F31D9D-3D33-4C09-85A3-4749A8AB8EBB}.Release|x64.ActiveCfg = Release|x64
+               {34F31D9D-3D33-4C09-85A3-4749A8AB8EBB}.Release|x64.Build.0 = Release|x64
+               {3799BA67-3C4F-4AE0-85DC-5BAAEA01A180}.Debug|x64.ActiveCfg = Debug|x64
+               {3799BA67-3C4F-4AE0-85DC-5BAAEA01A180}.Debug|x64.Build.0 = Debug|x64
+               {3799BA67-3C4F-4AE0-85DC-5BAAEA01A180}.Release|x64.ActiveCfg = Release|x64
+               {3799BA67-3C4F-4AE0-85DC-5BAAEA01A180}.Release|x64.Build.0 = Release|x64
+               {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4}.Debug|x64.ActiveCfg = Debug|x64
+               {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4}.Debug|x64.Build.0 = Debug|x64
+               {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4}.Release|x64.ActiveCfg = Release|x64
+               {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4}.Release|x64.Build.0 = Release|x64
+               {3B44D717-EEDE-470A-B631-C9D6BFE4ADF2}.Debug|x64.ActiveCfg = Debug|x64
+               {3B44D717-EEDE-470A-B631-C9D6BFE4ADF2}.Debug|x64.Build.0 = Debug|x64
+               {3B44D717-EEDE-470A-B631-C9D6BFE4ADF2}.Release|x64.ActiveCfg = Release|x64
+               {3B44D717-EEDE-470A-B631-C9D6BFE4ADF2}.Release|x64.Build.0 = Release|x64
+               {3CF270CD-0F56-48E3-AD84-82F369C568BF}.Debug|x64.ActiveCfg = Debug|x64
+               {3CF270CD-0F56-48E3-AD84-82F369C568BF}.Debug|x64.Build.0 = Debug|x64
+               {3CF270CD-0F56-48E3-AD84-82F369C568BF}.Release|x64.ActiveCfg = Release|x64
+               {3CF270CD-0F56-48E3-AD84-82F369C568BF}.Release|x64.Build.0 = Release|x64
+               {3EC20BDD-2E48-4291-A9EE-D0675AF77C7F}.Debug|x64.ActiveCfg = Debug|x64
+               {3EC20BDD-2E48-4291-A9EE-D0675AF77C7F}.Debug|x64.Build.0 = Debug|x64
+               {3EC20BDD-2E48-4291-A9EE-D0675AF77C7F}.Release|x64.ActiveCfg = Release|x64
+               {3EC20BDD-2E48-4291-A9EE-D0675AF77C7F}.Release|x64.Build.0 = Release|x64
+               {3EC30D6A-BDA4-4971-879A-8814204EAE31}.Debug|x64.ActiveCfg = Debug|x64
+               {3EC30D6A-BDA4-4971-879A-8814204EAE31}.Debug|x64.Build.0 = Debug|x64
+               {3EC30D6A-BDA4-4971-879A-8814204EAE31}.Release|x64.ActiveCfg = Release|x64
+               {3EC30D6A-BDA4-4971-879A-8814204EAE31}.Release|x64.Build.0 = Release|x64
+               {3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78}.Debug|x64.ActiveCfg = Debug|x64
+               {3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78}.Debug|x64.Build.0 = Debug|x64
+               {3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78}.Release|x64.ActiveCfg = Release|x64
+               {3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78}.Release|x64.Build.0 = Release|x64
+               {3ED56E55-84A6-422C-A8D4-A8439FB8F245}.Debug|x64.ActiveCfg = Debug|x64
+               {3ED56E55-84A6-422C-A8D4-A8439FB8F245}.Debug|x64.Build.0 = Debug|x64
+               {3ED56E55-84A6-422C-A8D4-A8439FB8F245}.Release|x64.ActiveCfg = Release|x64
+               {3ED56E55-84A6-422C-A8D4-A8439FB8F245}.Release|x64.Build.0 = Release|x64
+               {42B97D47-F800-4100-BFA2-B3AC357E8B6B}.Debug|x64.ActiveCfg = Debug|x64
+               {42B97D47-F800-4100-BFA2-B3AC357E8B6B}.Debug|x64.Build.0 = Debug|x64
+               {42B97D47-F800-4100-BFA2-B3AC357E8B6B}.Release|x64.ActiveCfg = Release|x64
+               {42B97D47-F800-4100-BFA2-B3AC357E8B6B}.Release|x64.Build.0 = Release|x64
+               {42CCEF95-5ADD-460C-967E-DD5B2C744943}.Debug|x64.ActiveCfg = Debug|x64
+               {42CCEF95-5ADD-460C-967E-DD5B2C744943}.Debug|x64.Build.0 = Debug|x64
+               {42CCEF95-5ADD-460C-967E-DD5B2C744943}.Release|x64.ActiveCfg = Release|x64
+               {42CCEF95-5ADD-460C-967E-DD5B2C744943}.Release|x64.Build.0 = Release|x64
+               {433F7840-C597-4950-84C9-E4FF7DF6A298}.Debug|x64.ActiveCfg = Debug|x64
+               {433F7840-C597-4950-84C9-E4FF7DF6A298}.Debug|x64.Build.0 = Debug|x64
+               {433F7840-C597-4950-84C9-E4FF7DF6A298}.Release|x64.ActiveCfg = Release|x64
+               {433F7840-C597-4950-84C9-E4FF7DF6A298}.Release|x64.Build.0 = Release|x64
+               {46629F21-089C-4205-B2F8-E01748ECE517}.Debug|x64.ActiveCfg = Debug|x64
+               {46629F21-089C-4205-B2F8-E01748ECE517}.Debug|x64.Build.0 = Debug|x64
+               {46629F21-089C-4205-B2F8-E01748ECE517}.Release|x64.ActiveCfg = Release|x64
+               {46629F21-089C-4205-B2F8-E01748ECE517}.Release|x64.Build.0 = Release|x64
+               {46B82069-10BE-432A-8D93-F4D995148555}.Debug|x64.ActiveCfg = Debug|x64
+               {46B82069-10BE-432A-8D93-F4D995148555}.Debug|x64.Build.0 = Debug|x64
+               {46B82069-10BE-432A-8D93-F4D995148555}.Release|x64.ActiveCfg = Release|x64
+               {46B82069-10BE-432A-8D93-F4D995148555}.Release|x64.Build.0 = Release|x64
+               {4850F425-9128-4E91-973C-5AE7BD97395B}.Debug|x64.ActiveCfg = Debug|x64
+               {4850F425-9128-4E91-973C-5AE7BD97395B}.Debug|x64.Build.0 = Debug|x64
+               {4850F425-9128-4E91-973C-5AE7BD97395B}.Release|x64.ActiveCfg = Release|x64
+               {4850F425-9128-4E91-973C-5AE7BD97395B}.Release|x64.Build.0 = Release|x64
+               {492BAA3D-0D5D-478E-9765-500463AE69AA}.Debug|x64.ActiveCfg = Debug|x64
+               {492BAA3D-0D5D-478E-9765-500463AE69AA}.Debug|x64.Build.0 = Debug|x64
+               {492BAA3D-0D5D-478E-9765-500463AE69AA}.Release|x64.ActiveCfg = Release|x64
+               {492BAA3D-0D5D-478E-9765-500463AE69AA}.Release|x64.Build.0 = Release|x64
+               {49A7CC5A-D5E7-4A07-917F-C6918B982BE8}.Debug|x64.ActiveCfg = Debug|x64
+               {49A7CC5A-D5E7-4A07-917F-C6918B982BE8}.Debug|x64.Build.0 = Debug|x64
+               {49A7CC5A-D5E7-4A07-917F-C6918B982BE8}.Release|x64.ActiveCfg = Release|x64
+               {49A7CC5A-D5E7-4A07-917F-C6918B982BE8}.Release|x64.Build.0 = Release|x64
+               {4C429783-0B01-449F-A36F-C2019233890B}.Debug|x64.ActiveCfg = Debug|x64
+               {4C429783-0B01-449F-A36F-C2019233890B}.Debug|x64.Build.0 = Debug|x64
+               {4C429783-0B01-449F-A36F-C2019233890B}.Release|x64.ActiveCfg = Release|x64
+               {4C429783-0B01-449F-A36F-C2019233890B}.Release|x64.Build.0 = Release|x64
+               {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Debug|x64.ActiveCfg = Debug|x64
+               {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Debug|x64.Build.0 = Debug|x64
+               {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Release|x64.ActiveCfg = Release|x64
+               {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF}.Release|x64.Build.0 = Release|x64
+               {4E334022-7A71-4197-9E15-878F7EFC877E}.Debug|x64.ActiveCfg = Debug|x64
+               {4E334022-7A71-4197-9E15-878F7EFC877E}.Debug|x64.Build.0 = Debug|x64
+               {4E334022-7A71-4197-9E15-878F7EFC877E}.Release|x64.ActiveCfg = Release|x64
+               {4E334022-7A71-4197-9E15-878F7EFC877E}.Release|x64.Build.0 = Release|x64
+               {4EE3C4D6-F707-4A05-8032-8FC2A44D29E8}.Debug|x64.ActiveCfg = Debug|x64
+               {4EE3C4D6-F707-4A05-8032-8FC2A44D29E8}.Debug|x64.Build.0 = Debug|x64
+               {4EE3C4D6-F707-4A05-8032-8FC2A44D29E8}.Release|x64.ActiveCfg = Release|x64
+               {4EE3C4D6-F707-4A05-8032-8FC2A44D29E8}.Release|x64.Build.0 = Release|x64
+               {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Debug|x64.ActiveCfg = Debug|x64
+               {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Debug|x64.Build.0 = Debug|x64
+               {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Release|x64.ActiveCfg = Release|x64
+               {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03}.Release|x64.Build.0 = Release|x64
+               {50FD1E47-2131-48D2-9435-5CB28DF6B15A}.Debug|x64.ActiveCfg = Debug|x64
+               {50FD1E47-2131-48D2-9435-5CB28DF6B15A}.Debug|x64.Build.0 = Debug|x64
+               {50FD1E47-2131-48D2-9435-5CB28DF6B15A}.Release|x64.ActiveCfg = Release|x64
+               {50FD1E47-2131-48D2-9435-5CB28DF6B15A}.Release|x64.Build.0 = Release|x64
+               {513C4CFA-BD5B-4470-BA93-F6D43778A754}.Debug|x64.ActiveCfg = Debug|x64
+               {513C4CFA-BD5B-4470-BA93-F6D43778A754}.Debug|x64.Build.0 = Debug|x64
+               {513C4CFA-BD5B-4470-BA93-F6D43778A754}.Release|x64.ActiveCfg = Release|x64
+               {513C4CFA-BD5B-4470-BA93-F6D43778A754}.Release|x64.Build.0 = Release|x64
+               {53115A01-460C-4339-A2C8-AE1323A6E7EA}.Debug|x64.ActiveCfg = Debug|x64
+               {53115A01-460C-4339-A2C8-AE1323A6E7EA}.Debug|x64.Build.0 = Debug|x64
+               {53115A01-460C-4339-A2C8-AE1323A6E7EA}.Release|x64.ActiveCfg = Release|x64
+               {53115A01-460C-4339-A2C8-AE1323A6E7EA}.Release|x64.Build.0 = Release|x64
+               {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1}.Debug|x64.ActiveCfg = Debug|x64
+               {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1}.Debug|x64.Build.0 = Debug|x64
+               {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1}.Release|x64.ActiveCfg = Release|x64
+               {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1}.Release|x64.Build.0 = Release|x64
+               {5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A}.Debug|x64.ActiveCfg = Debug|x64
+               {5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A}.Debug|x64.Build.0 = Debug|x64
+               {5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A}.Release|x64.ActiveCfg = Release|x64
+               {5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A}.Release|x64.Build.0 = Release|x64
+               {581B3A58-F3F0-4765-91E5-D0C82816A528}.Debug|x64.ActiveCfg = Debug|x64
+               {581B3A58-F3F0-4765-91E5-D0C82816A528}.Debug|x64.Build.0 = Debug|x64
+               {581B3A58-F3F0-4765-91E5-D0C82816A528}.Release|x64.ActiveCfg = Release|x64
+               {581B3A58-F3F0-4765-91E5-D0C82816A528}.Release|x64.Build.0 = Release|x64
+               {58386481-30B7-40FC-96AF-0723A4A7B228}.Debug|x64.ActiveCfg = Debug|x64
+               {58386481-30B7-40FC-96AF-0723A4A7B228}.Debug|x64.Build.0 = Debug|x64
+               {58386481-30B7-40FC-96AF-0723A4A7B228}.Release|x64.ActiveCfg = Release|x64
+               {58386481-30B7-40FC-96AF-0723A4A7B228}.Release|x64.Build.0 = Release|x64
+               {59D7A9CD-9912-40E4-96E1-8A873F777F62}.Debug|x64.ActiveCfg = Debug|x64
+               {59D7A9CD-9912-40E4-96E1-8A873F777F62}.Debug|x64.Build.0 = Debug|x64
+               {59D7A9CD-9912-40E4-96E1-8A873F777F62}.Release|x64.ActiveCfg = Release|x64
+               {59D7A9CD-9912-40E4-96E1-8A873F777F62}.Release|x64.Build.0 = Release|x64
+               {59D9E21C-57D7-4D18-B792-24738BD26DE4}.Debug|x64.ActiveCfg = Debug|x64
+               {59D9E21C-57D7-4D18-B792-24738BD26DE4}.Debug|x64.Build.0 = Debug|x64
+               {59D9E21C-57D7-4D18-B792-24738BD26DE4}.Release|x64.ActiveCfg = Release|x64
+               {59D9E21C-57D7-4D18-B792-24738BD26DE4}.Release|x64.Build.0 = Release|x64
+               {5A391A14-8E29-4788-93FC-EDADED31D32F}.Debug|x64.ActiveCfg = Debug|x64
+               {5A391A14-8E29-4788-93FC-EDADED31D32F}.Debug|x64.Build.0 = Debug|x64
+               {5A391A14-8E29-4788-93FC-EDADED31D32F}.Release|x64.ActiveCfg = Release|x64
+               {5A391A14-8E29-4788-93FC-EDADED31D32F}.Release|x64.Build.0 = Release|x64
+               {5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF}.Debug|x64.ActiveCfg = Debug|x64
+               {5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF}.Debug|x64.Build.0 = Debug|x64
+               {5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF}.Release|x64.ActiveCfg = Release|x64
+               {5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF}.Release|x64.Build.0 = Release|x64
+               {5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3}.Debug|x64.ActiveCfg = Debug|x64
+               {5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3}.Debug|x64.Build.0 = Debug|x64
+               {5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3}.Release|x64.ActiveCfg = Release|x64
+               {5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3}.Release|x64.Build.0 = Release|x64
+               {5D362DB7-D2BD-4907-AAD8-4B8627E72282}.Debug|x64.ActiveCfg = Debug|x64
+               {5D362DB7-D2BD-4907-AAD8-4B8627E72282}.Debug|x64.Build.0 = Debug|x64
+               {5D362DB7-D2BD-4907-AAD8-4B8627E72282}.Release|x64.ActiveCfg = Release|x64
+               {5D362DB7-D2BD-4907-AAD8-4B8627E72282}.Release|x64.Build.0 = Release|x64
+               {5DB2E259-0D19-4A89-B8EC-B2912F39924D}.Debug|x64.ActiveCfg = Debug|x64
+               {5DB2E259-0D19-4A89-B8EC-B2912F39924D}.Debug|x64.Build.0 = Debug|x64
+               {5DB2E259-0D19-4A89-B8EC-B2912F39924D}.Release|x64.ActiveCfg = Release|x64
+               {5DB2E259-0D19-4A89-B8EC-B2912F39924D}.Release|x64.Build.0 = Release|x64
+               {5E005D50-1C73-4E52-B295-864BB9AF7AC6}.Debug|x64.ActiveCfg = Debug|x64
+               {5E005D50-1C73-4E52-B295-864BB9AF7AC6}.Debug|x64.Build.0 = Debug|x64
+               {5E005D50-1C73-4E52-B295-864BB9AF7AC6}.Release|x64.ActiveCfg = Release|x64
+               {5E005D50-1C73-4E52-B295-864BB9AF7AC6}.Release|x64.Build.0 = Release|x64
+               {5E7305DB-93E6-448B-AE44-90EAF916A776}.Debug|x64.ActiveCfg = Debug|x64
+               {5E7305DB-93E6-448B-AE44-90EAF916A776}.Debug|x64.Build.0 = Debug|x64
+               {5E7305DB-93E6-448B-AE44-90EAF916A776}.Release|x64.ActiveCfg = Release|x64
+               {5E7305DB-93E6-448B-AE44-90EAF916A776}.Release|x64.Build.0 = Release|x64
+               {5EC35099-9777-45E8-9520-EB2EE75BDF88}.Debug|x64.ActiveCfg = Debug|x64
+               {5EC35099-9777-45E8-9520-EB2EE75BDF88}.Debug|x64.Build.0 = Debug|x64
+               {5EC35099-9777-45E8-9520-EB2EE75BDF88}.Release|x64.ActiveCfg = Release|x64
+               {5EC35099-9777-45E8-9520-EB2EE75BDF88}.Release|x64.Build.0 = Release|x64
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851}.Debug|x64.ActiveCfg = Debug|x64
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851}.Debug|x64.Build.0 = Debug|x64
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851}.Release|x64.ActiveCfg = Release|x64
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851}.Release|x64.Build.0 = Release|x64
+               {5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C}.Debug|x64.ActiveCfg = Debug|x64
+               {5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C}.Debug|x64.Build.0 = Debug|x64
+               {5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C}.Release|x64.ActiveCfg = Release|x64
+               {5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C}.Release|x64.Build.0 = Release|x64
+               {60206D22-E132-4695-8486-10BECA32C5CC}.Debug|x64.ActiveCfg = Debug|x64
+               {60206D22-E132-4695-8486-10BECA32C5CC}.Debug|x64.Build.0 = Debug|x64
+               {60206D22-E132-4695-8486-10BECA32C5CC}.Release|x64.ActiveCfg = Release|x64
+               {60206D22-E132-4695-8486-10BECA32C5CC}.Release|x64.Build.0 = Release|x64
+               {60B463D4-8CD5-4BF6-A25B-01BE13B87590}.Debug|x64.ActiveCfg = Debug|x64
+               {60B463D4-8CD5-4BF6-A25B-01BE13B87590}.Debug|x64.Build.0 = Debug|x64
+               {60B463D4-8CD5-4BF6-A25B-01BE13B87590}.Release|x64.ActiveCfg = Release|x64
+               {60B463D4-8CD5-4BF6-A25B-01BE13B87590}.Release|x64.Build.0 = Release|x64
+               {60EF55C7-8399-4543-B5B2-3AE2C532C67E}.Debug|x64.ActiveCfg = Debug|x64
+               {60EF55C7-8399-4543-B5B2-3AE2C532C67E}.Debug|x64.Build.0 = Debug|x64
+               {60EF55C7-8399-4543-B5B2-3AE2C532C67E}.Release|x64.ActiveCfg = Release|x64
+               {60EF55C7-8399-4543-B5B2-3AE2C532C67E}.Release|x64.Build.0 = Release|x64
+               {628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0}.Debug|x64.ActiveCfg = Debug|x64
+               {628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0}.Debug|x64.Build.0 = Debug|x64
+               {628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0}.Release|x64.ActiveCfg = Release|x64
+               {628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0}.Release|x64.Build.0 = Release|x64
+               {63B8184D-85E0-4E6A-9729-558C567D1D1D}.Debug|x64.ActiveCfg = Debug|x64
+               {63B8184D-85E0-4E6A-9729-558C567D1D1D}.Debug|x64.Build.0 = Debug|x64
+               {63B8184D-85E0-4E6A-9729-558C567D1D1D}.Release|x64.ActiveCfg = Release|x64
+               {63B8184D-85E0-4E6A-9729-558C567D1D1D}.Release|x64.Build.0 = Release|x64
+               {643B82A1-D009-46A9-92A0-2883399B05C2}.Debug|x64.ActiveCfg = Debug|x64
+               {643B82A1-D009-46A9-92A0-2883399B05C2}.Debug|x64.Build.0 = Debug|x64
+               {643B82A1-D009-46A9-92A0-2883399B05C2}.Release|x64.ActiveCfg = Release|x64
+               {643B82A1-D009-46A9-92A0-2883399B05C2}.Release|x64.Build.0 = Release|x64
+               {6516D6CF-8000-4341-9487-312BC83EE370}.Debug|x64.ActiveCfg = Debug|x64
+               {6516D6CF-8000-4341-9487-312BC83EE370}.Debug|x64.Build.0 = Debug|x64
+               {6516D6CF-8000-4341-9487-312BC83EE370}.Release|x64.ActiveCfg = Release|x64
+               {6516D6CF-8000-4341-9487-312BC83EE370}.Release|x64.Build.0 = Release|x64
+               {65D92D98-97E1-48F7-AEF6-75221CF48EA4}.Debug|x64.ActiveCfg = Debug|x64
+               {65D92D98-97E1-48F7-AEF6-75221CF48EA4}.Debug|x64.Build.0 = Debug|x64
+               {65D92D98-97E1-48F7-AEF6-75221CF48EA4}.Release|x64.ActiveCfg = Release|x64
+               {65D92D98-97E1-48F7-AEF6-75221CF48EA4}.Release|x64.Build.0 = Release|x64
+               {673277EC-D26B-414D-92E3-84EE873316A8}.Debug|x64.ActiveCfg = Debug|x64
+               {673277EC-D26B-414D-92E3-84EE873316A8}.Debug|x64.Build.0 = Debug|x64
+               {673277EC-D26B-414D-92E3-84EE873316A8}.Release|x64.ActiveCfg = Release|x64
+               {673277EC-D26B-414D-92E3-84EE873316A8}.Release|x64.Build.0 = Release|x64
+               {6770917C-5B8E-49F1-9297-163FAB76DAFB}.Debug|x64.ActiveCfg = Debug|x64
+               {6770917C-5B8E-49F1-9297-163FAB76DAFB}.Debug|x64.Build.0 = Debug|x64
+               {6770917C-5B8E-49F1-9297-163FAB76DAFB}.Release|x64.ActiveCfg = Release|x64
+               {6770917C-5B8E-49F1-9297-163FAB76DAFB}.Release|x64.Build.0 = Release|x64
+               {67AC1343-98FD-4143-92C0-559C55F749F5}.Debug|x64.ActiveCfg = Debug|x64
+               {67AC1343-98FD-4143-92C0-559C55F749F5}.Debug|x64.Build.0 = Debug|x64
+               {67AC1343-98FD-4143-92C0-559C55F749F5}.Release|x64.ActiveCfg = Release|x64
+               {67AC1343-98FD-4143-92C0-559C55F749F5}.Release|x64.Build.0 = Release|x64
+               {6851356E-A5D9-46A6-8262-A7E208729F18}.Debug|x64.ActiveCfg = Debug|x64
+               {6851356E-A5D9-46A6-8262-A7E208729F18}.Debug|x64.Build.0 = Debug|x64
+               {6851356E-A5D9-46A6-8262-A7E208729F18}.Release|x64.ActiveCfg = Release|x64
+               {6851356E-A5D9-46A6-8262-A7E208729F18}.Release|x64.Build.0 = Release|x64
+               {6AE1B8BE-D46A-4E99-87A2-F160FB950DCA}.Debug|x64.ActiveCfg = Debug|x64
+               {6AE1B8BE-D46A-4E99-87A2-F160FB950DCA}.Debug|x64.Build.0 = Debug|x64
+               {6AE1B8BE-D46A-4E99-87A2-F160FB950DCA}.Release|x64.ActiveCfg = Release|x64
+               {6AE1B8BE-D46A-4E99-87A2-F160FB950DCA}.Release|x64.Build.0 = Release|x64
+               {6B492754-9F80-44B3-A2A7-1D98AF06F3B2}.Debug|x64.ActiveCfg = Debug|x64
+               {6B492754-9F80-44B3-A2A7-1D98AF06F3B2}.Debug|x64.Build.0 = Debug|x64
+               {6B492754-9F80-44B3-A2A7-1D98AF06F3B2}.Release|x64.ActiveCfg = Release|x64
+               {6B492754-9F80-44B3-A2A7-1D98AF06F3B2}.Release|x64.Build.0 = Release|x64
+               {6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408}.Debug|x64.ActiveCfg = Debug|x64
+               {6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408}.Debug|x64.Build.0 = Debug|x64
+               {6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408}.Release|x64.ActiveCfg = Release|x64
+               {6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408}.Release|x64.Build.0 = Release|x64
+               {6D7C1169-3246-465F-B630-ECFEF4F3179A}.Debug|x64.ActiveCfg = Debug|x64
+               {6D7C1169-3246-465F-B630-ECFEF4F3179A}.Debug|x64.Build.0 = Debug|x64
+               {6D7C1169-3246-465F-B630-ECFEF4F3179A}.Release|x64.ActiveCfg = Release|x64
+               {6D7C1169-3246-465F-B630-ECFEF4F3179A}.Release|x64.Build.0 = Release|x64
+               {6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89}.Debug|x64.ActiveCfg = Debug|x64
+               {6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89}.Debug|x64.Build.0 = Debug|x64
+               {6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89}.Release|x64.ActiveCfg = Release|x64
+               {6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89}.Release|x64.Build.0 = Release|x64
+               {6EC93484-AAF3-487E-84E4-5ABFBA0AFC53}.Debug|x64.ActiveCfg = Debug|x64
+               {6EC93484-AAF3-487E-84E4-5ABFBA0AFC53}.Debug|x64.Build.0 = Debug|x64
+               {6EC93484-AAF3-487E-84E4-5ABFBA0AFC53}.Release|x64.ActiveCfg = Release|x64
+               {6EC93484-AAF3-487E-84E4-5ABFBA0AFC53}.Release|x64.Build.0 = Release|x64
+               {6F06A19B-0921-4B71-A3A5-B350B5FFEADB}.Debug|x64.ActiveCfg = Debug|x64
+               {6F06A19B-0921-4B71-A3A5-B350B5FFEADB}.Debug|x64.Build.0 = Debug|x64
+               {6F06A19B-0921-4B71-A3A5-B350B5FFEADB}.Release|x64.ActiveCfg = Release|x64
+               {6F06A19B-0921-4B71-A3A5-B350B5FFEADB}.Release|x64.Build.0 = Release|x64
+               {6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB}.Debug|x64.ActiveCfg = Debug|x64
+               {6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB}.Debug|x64.Build.0 = Debug|x64
+               {6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB}.Release|x64.ActiveCfg = Release|x64
+               {6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB}.Release|x64.Build.0 = Release|x64
+               {6F776280-B383-4DCE-8F42-9670164D038D}.Debug|x64.ActiveCfg = Debug|x64
+               {6F776280-B383-4DCE-8F42-9670164D038D}.Debug|x64.Build.0 = Debug|x64
+               {6F776280-B383-4DCE-8F42-9670164D038D}.Release|x64.ActiveCfg = Release|x64
+               {6F776280-B383-4DCE-8F42-9670164D038D}.Release|x64.Build.0 = Release|x64
+               {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2}.Debug|x64.ActiveCfg = Debug|x64
+               {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2}.Debug|x64.Build.0 = Debug|x64
+               {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2}.Release|x64.ActiveCfg = Release|x64
+               {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2}.Release|x64.Build.0 = Release|x64
+               {715EADD7-0FFE-4F1F-94E7-49302968DF79}.Debug|x64.ActiveCfg = Debug|x64
+               {715EADD7-0FFE-4F1F-94E7-49302968DF79}.Debug|x64.Build.0 = Debug|x64
+               {715EADD7-0FFE-4F1F-94E7-49302968DF79}.Release|x64.ActiveCfg = Release|x64
+               {715EADD7-0FFE-4F1F-94E7-49302968DF79}.Release|x64.Build.0 = Release|x64
+               {71D182E0-345A-4375-B0FA-3536821B0EE3}.Debug|x64.ActiveCfg = Debug|x64
+               {71D182E0-345A-4375-B0FA-3536821B0EE3}.Debug|x64.Build.0 = Debug|x64
+               {71D182E0-345A-4375-B0FA-3536821B0EE3}.Release|x64.ActiveCfg = Release|x64
+               {71D182E0-345A-4375-B0FA-3536821B0EE3}.Release|x64.Build.0 = Release|x64
+               {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.ActiveCfg = Debug|x64
+               {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Debug|x64.Build.0 = Debug|x64
+               {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.ActiveCfg = Release|x64
+               {7264C8F6-73FB-4830-9306-1558D3EAC71B}.Release|x64.Build.0 = Release|x64
+               {729E3905-FF7D-49C5-9871-6D35D839183E}.Debug|x64.ActiveCfg = Debug|x64
+               {729E3905-FF7D-49C5-9871-6D35D839183E}.Debug|x64.Build.0 = Debug|x64
+               {729E3905-FF7D-49C5-9871-6D35D839183E}.Release|x64.ActiveCfg = Release|x64
+               {729E3905-FF7D-49C5-9871-6D35D839183E}.Release|x64.Build.0 = Release|x64
+               {72C9DB46-C665-48AD-B805-BA885B40CA3E}.Debug|x64.ActiveCfg = Debug|x64
+               {72C9DB46-C665-48AD-B805-BA885B40CA3E}.Debug|x64.Build.0 = Debug|x64
+               {72C9DB46-C665-48AD-B805-BA885B40CA3E}.Release|x64.ActiveCfg = Release|x64
+               {72C9DB46-C665-48AD-B805-BA885B40CA3E}.Release|x64.Build.0 = Release|x64
+               {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF}.Debug|x64.ActiveCfg = Debug|x64
+               {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF}.Debug|x64.Build.0 = Debug|x64
+               {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF}.Release|x64.ActiveCfg = Release|x64
+               {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF}.Release|x64.Build.0 = Release|x64
+               {740ED97D-005F-4F58-98B2-4EF5EF5776E8}.Debug|x64.ActiveCfg = Debug|x64
+               {740ED97D-005F-4F58-98B2-4EF5EF5776E8}.Debug|x64.Build.0 = Debug|x64
+               {740ED97D-005F-4F58-98B2-4EF5EF5776E8}.Release|x64.ActiveCfg = Release|x64
+               {740ED97D-005F-4F58-98B2-4EF5EF5776E8}.Release|x64.Build.0 = Release|x64
+               {74D655D5-F661-4887-A1EB-5A6222AF5FCA}.Debug|x64.ActiveCfg = Debug|x64
+               {74D655D5-F661-4887-A1EB-5A6222AF5FCA}.Debug|x64.Build.0 = Debug|x64
+               {74D655D5-F661-4887-A1EB-5A6222AF5FCA}.Release|x64.ActiveCfg = Release|x64
+               {74D655D5-F661-4887-A1EB-5A6222AF5FCA}.Release|x64.Build.0 = Release|x64
+               {7701627C-CFD9-48F6-942E-EAACC8D057FA}.Debug|x64.ActiveCfg = Debug|x64
+               {7701627C-CFD9-48F6-942E-EAACC8D057FA}.Debug|x64.Build.0 = Debug|x64
+               {7701627C-CFD9-48F6-942E-EAACC8D057FA}.Release|x64.ActiveCfg = Release|x64
+               {7701627C-CFD9-48F6-942E-EAACC8D057FA}.Release|x64.Build.0 = Release|x64
+               {779425B1-2211-499B-A7CC-4F9EC6CB0D25}.Debug|x64.ActiveCfg = Debug|x64
+               {779425B1-2211-499B-A7CC-4F9EC6CB0D25}.Debug|x64.Build.0 = Debug|x64
+               {779425B1-2211-499B-A7CC-4F9EC6CB0D25}.Release|x64.ActiveCfg = Release|x64
+               {779425B1-2211-499B-A7CC-4F9EC6CB0D25}.Release|x64.Build.0 = Release|x64
+               {79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9}.Debug|x64.ActiveCfg = Debug|x64
+               {79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9}.Debug|x64.Build.0 = Debug|x64
+               {79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9}.Release|x64.ActiveCfg = Release|x64
+               {79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9}.Release|x64.Build.0 = Release|x64
+               {7ABF755C-821B-49CD-8EDE-83C16594FF7F}.Debug|x64.ActiveCfg = Debug|x64
+               {7ABF755C-821B-49CD-8EDE-83C16594FF7F}.Debug|x64.Build.0 = Debug|x64
+               {7ABF755C-821B-49CD-8EDE-83C16594FF7F}.Release|x64.ActiveCfg = Release|x64
+               {7ABF755C-821B-49CD-8EDE-83C16594FF7F}.Release|x64.Build.0 = Release|x64
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}.Debug|x64.ActiveCfg = Debug|x64
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}.Debug|x64.Build.0 = Debug|x64
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}.Release|x64.ActiveCfg = Release|x64
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}.Release|x64.Build.0 = Release|x64
+               {7DFEB4A5-8B04-4302-9D09-8144918FCF81}.Debug|x64.ActiveCfg = Debug|x64
+               {7DFEB4A5-8B04-4302-9D09-8144918FCF81}.Debug|x64.Build.0 = Debug|x64
+               {7DFEB4A5-8B04-4302-9D09-8144918FCF81}.Release|x64.ActiveCfg = Release|x64
+               {7DFEB4A5-8B04-4302-9D09-8144918FCF81}.Release|x64.Build.0 = Release|x64
+               {7F51CD29-3BCD-4DD8-B327-F384B5A616D1}.Debug|x64.ActiveCfg = Debug|x64
+               {7F51CD29-3BCD-4DD8-B327-F384B5A616D1}.Debug|x64.Build.0 = Debug|x64
+               {7F51CD29-3BCD-4DD8-B327-F384B5A616D1}.Release|x64.ActiveCfg = Release|x64
+               {7F51CD29-3BCD-4DD8-B327-F384B5A616D1}.Release|x64.Build.0 = Release|x64
+               {8008010F-8718-4C5F-86B2-195AEBF73422}.Debug|x64.ActiveCfg = Debug|x64
+               {8008010F-8718-4C5F-86B2-195AEBF73422}.Debug|x64.Build.0 = Debug|x64
+               {8008010F-8718-4C5F-86B2-195AEBF73422}.Release|x64.ActiveCfg = Release|x64
+               {8008010F-8718-4C5F-86B2-195AEBF73422}.Release|x64.Build.0 = Release|x64
+               {8010BBB0-C71B-4EFF-95EB-65C01E5EC197}.Debug|x64.ActiveCfg = Debug|x64
+               {8010BBB0-C71B-4EFF-95EB-65C01E5EC197}.Debug|x64.Build.0 = Debug|x64
+               {8010BBB0-C71B-4EFF-95EB-65C01E5EC197}.Release|x64.ActiveCfg = Release|x64
+               {8010BBB0-C71B-4EFF-95EB-65C01E5EC197}.Release|x64.Build.0 = Release|x64
+               {80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7}.Debug|x64.ActiveCfg = Debug|x64
+               {80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7}.Debug|x64.Build.0 = Debug|x64
+               {80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7}.Release|x64.ActiveCfg = Release|x64
+               {80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7}.Release|x64.Build.0 = Release|x64
+               {810DB909-6581-42D8-9616-906888F12149}.Debug|x64.ActiveCfg = Debug|x64
+               {810DB909-6581-42D8-9616-906888F12149}.Debug|x64.Build.0 = Debug|x64
+               {810DB909-6581-42D8-9616-906888F12149}.Release|x64.ActiveCfg = Release|x64
+               {810DB909-6581-42D8-9616-906888F12149}.Release|x64.Build.0 = Release|x64
+               {85D4076B-896B-4EBB-8F3A-8B44C24CD452}.Debug|x64.ActiveCfg = Debug|x64
+               {85D4076B-896B-4EBB-8F3A-8B44C24CD452}.Debug|x64.Build.0 = Debug|x64
+               {85D4076B-896B-4EBB-8F3A-8B44C24CD452}.Release|x64.ActiveCfg = Release|x64
+               {85D4076B-896B-4EBB-8F3A-8B44C24CD452}.Release|x64.Build.0 = Release|x64
+               {85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3}.Debug|x64.ActiveCfg = Debug|x64
+               {85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3}.Debug|x64.Build.0 = Debug|x64
+               {85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3}.Release|x64.ActiveCfg = Release|x64
+               {85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3}.Release|x64.Build.0 = Release|x64
+               {86EE22CC-6D3C-4F81-ADC8-394946F0DA81}.Debug|x64.ActiveCfg = Debug|x64
+               {86EE22CC-6D3C-4F81-ADC8-394946F0DA81}.Debug|x64.Build.0 = Debug|x64
+               {86EE22CC-6D3C-4F81-ADC8-394946F0DA81}.Release|x64.ActiveCfg = Release|x64
+               {86EE22CC-6D3C-4F81-ADC8-394946F0DA81}.Release|x64.Build.0 = Release|x64
+               {88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC}.Debug|x64.ActiveCfg = Debug|x64
+               {88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC}.Debug|x64.Build.0 = Debug|x64
+               {88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC}.Release|x64.ActiveCfg = Release|x64
+               {88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC}.Release|x64.Build.0 = Release|x64
+               {89F947CA-DDEF-4131-8AFB-584ABA4A1302}.Debug|x64.ActiveCfg = Debug|x64
+               {89F947CA-DDEF-4131-8AFB-584ABA4A1302}.Debug|x64.Build.0 = Debug|x64
+               {89F947CA-DDEF-4131-8AFB-584ABA4A1302}.Release|x64.ActiveCfg = Release|x64
+               {89F947CA-DDEF-4131-8AFB-584ABA4A1302}.Release|x64.Build.0 = Release|x64
+               {8A0FA780-068A-4534-AA2F-4FF4CF977AF2}.Debug|x64.ActiveCfg = Debug|x64
+               {8A0FA780-068A-4534-AA2F-4FF4CF977AF2}.Debug|x64.Build.0 = Debug|x64
+               {8A0FA780-068A-4534-AA2F-4FF4CF977AF2}.Release|x64.ActiveCfg = Release|x64
+               {8A4872D7-A234-4B9B-8215-82C6BB15F3A2}.Debug|x64.ActiveCfg = Debug|x64
+               {8A4872D7-A234-4B9B-8215-82C6BB15F3A2}.Debug|x64.Build.0 = Debug|x64
+               {8A4872D7-A234-4B9B-8215-82C6BB15F3A2}.Release|x64.ActiveCfg = Release|x64
+               {8A4872D7-A234-4B9B-8215-82C6BB15F3A2}.Release|x64.Build.0 = Release|x64
+               {8C42CA7C-1543-4F1B-A55F-28CD419C7D35}.Debug|x64.ActiveCfg = Debug|x64
+               {8C42CA7C-1543-4F1B-A55F-28CD419C7D35}.Debug|x64.Build.0 = Debug|x64
+               {8C42CA7C-1543-4F1B-A55F-28CD419C7D35}.Release|x64.ActiveCfg = Release|x64
+               {8C42CA7C-1543-4F1B-A55F-28CD419C7D35}.Release|x64.Build.0 = Release|x64
+               {8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}.Debug|x64.ActiveCfg = Debug|x64
+               {8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}.Debug|x64.Build.0 = Debug|x64
+               {8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}.Release|x64.ActiveCfg = Release|x64
+               {8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A}.Release|x64.Build.0 = Release|x64
+               {8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828}.Debug|x64.ActiveCfg = Debug|x64
+               {8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828}.Debug|x64.Build.0 = Debug|x64
+               {8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828}.Release|x64.ActiveCfg = Release|x64
+               {8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828}.Release|x64.Build.0 = Release|x64
+               {8E374371-30E1-4623-8755-2A2F3742170B}.Debug|x64.ActiveCfg = Debug|x64
+               {8E374371-30E1-4623-8755-2A2F3742170B}.Debug|x64.Build.0 = Debug|x64
+               {8E374371-30E1-4623-8755-2A2F3742170B}.Release|x64.ActiveCfg = Release|x64
+               {8E374371-30E1-4623-8755-2A2F3742170B}.Release|x64.Build.0 = Release|x64
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}.Debug|x64.ActiveCfg = Debug|x64
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}.Debug|x64.Build.0 = Debug|x64
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}.Release|x64.ActiveCfg = Release|x64
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59}.Release|x64.Build.0 = Release|x64
+               {9186EAC4-2F34-4F17-B940-6585D7869BCD}.Debug|x64.ActiveCfg = Debug|x64
+               {9186EAC4-2F34-4F17-B940-6585D7869BCD}.Debug|x64.Build.0 = Debug|x64
+               {9186EAC4-2F34-4F17-B940-6585D7869BCD}.Release|x64.ActiveCfg = Release|x64
+               {9186EAC4-2F34-4F17-B940-6585D7869BCD}.Release|x64.Build.0 = Release|x64
+               {91E19AEB-7B75-43E0-B8B4-D2BB60D839EA}.Debug|x64.ActiveCfg = Debug|x64
+               {91E19AEB-7B75-43E0-B8B4-D2BB60D839EA}.Debug|x64.Build.0 = Debug|x64
+               {91E19AEB-7B75-43E0-B8B4-D2BB60D839EA}.Release|x64.ActiveCfg = Release|x64
+               {91E19AEB-7B75-43E0-B8B4-D2BB60D839EA}.Release|x64.Build.0 = Release|x64
+               {9233FC80-B51C-4A89-AF58-5AE86C068F6A}.Debug|x64.ActiveCfg = Debug|x64
+               {9233FC80-B51C-4A89-AF58-5AE86C068F6A}.Debug|x64.Build.0 = Debug|x64
+               {9233FC80-B51C-4A89-AF58-5AE86C068F6A}.Release|x64.ActiveCfg = Release|x64
+               {9233FC80-B51C-4A89-AF58-5AE86C068F6A}.Release|x64.Build.0 = Release|x64
+               {92388A20-50FC-45F8-89E3-71F1618EFABB}.Debug|x64.ActiveCfg = Debug|x64
+               {92388A20-50FC-45F8-89E3-71F1618EFABB}.Debug|x64.Build.0 = Debug|x64
+               {92388A20-50FC-45F8-89E3-71F1618EFABB}.Release|x64.ActiveCfg = Release|x64
+               {92388A20-50FC-45F8-89E3-71F1618EFABB}.Release|x64.Build.0 = Release|x64
+               {924B2937-0B53-4DC6-B7E1-5F3102728F89}.Debug|x64.ActiveCfg = Debug|x64
+               {924B2937-0B53-4DC6-B7E1-5F3102728F89}.Debug|x64.Build.0 = Debug|x64
+               {924B2937-0B53-4DC6-B7E1-5F3102728F89}.Release|x64.ActiveCfg = Release|x64
+               {924B2937-0B53-4DC6-B7E1-5F3102728F89}.Release|x64.Build.0 = Release|x64
+               {95B683BD-B9DC-400F-9BC0-8F1505F08BF5}.Debug|x64.ActiveCfg = Debug|x64
+               {95B683BD-B9DC-400F-9BC0-8F1505F08BF5}.Debug|x64.Build.0 = Debug|x64
+               {95B683BD-B9DC-400F-9BC0-8F1505F08BF5}.Release|x64.ActiveCfg = Release|x64
+               {95B683BD-B9DC-400F-9BC0-8F1505F08BF5}.Release|x64.Build.0 = Release|x64
+               {96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}.Debug|x64.ActiveCfg = Debug|x64
+               {96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}.Debug|x64.Build.0 = Debug|x64
+               {96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}.Release|x64.ActiveCfg = Release|x64
+               {96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}.Release|x64.Build.0 = Release|x64
+               {98ACBE5D-1A92-46F9-AA81-533412172952}.Debug|x64.ActiveCfg = Debug|x64
+               {98ACBE5D-1A92-46F9-AA81-533412172952}.Debug|x64.Build.0 = Debug|x64
+               {98ACBE5D-1A92-46F9-AA81-533412172952}.Release|x64.ActiveCfg = Release|x64
+               {98ACBE5D-1A92-46F9-AA81-533412172952}.Release|x64.Build.0 = Release|x64
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76}.Debug|x64.ActiveCfg = Debug|x64
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76}.Debug|x64.Build.0 = Debug|x64
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76}.Release|x64.ActiveCfg = Release|x64
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76}.Release|x64.Build.0 = Release|x64
+               {9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48}.Debug|x64.ActiveCfg = Debug|x64
+               {9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48}.Debug|x64.Build.0 = Debug|x64
+               {9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48}.Release|x64.ActiveCfg = Release|x64
+               {9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48}.Release|x64.Build.0 = Release|x64
+               {9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55}.Debug|x64.ActiveCfg = Debug|x64
+               {9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55}.Debug|x64.Build.0 = Debug|x64
+               {9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55}.Release|x64.ActiveCfg = Release|x64
+               {9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55}.Release|x64.Build.0 = Release|x64
+               {9D9E33EB-4C24-4646-A3FB-35DA17247917}.Debug|x64.ActiveCfg = Debug|x64
+               {9D9E33EB-4C24-4646-A3FB-35DA17247917}.Debug|x64.Build.0 = Debug|x64
+               {9D9E33EB-4C24-4646-A3FB-35DA17247917}.Release|x64.ActiveCfg = Release|x64
+               {9D9E33EB-4C24-4646-A3FB-35DA17247917}.Release|x64.Build.0 = Release|x64
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45}.Debug|x64.ActiveCfg = Debug|x64
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45}.Debug|x64.Build.0 = Debug|x64
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45}.Release|x64.ActiveCfg = Release|x64
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45}.Release|x64.Build.0 = Release|x64
+               {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Debug|x64.ActiveCfg = Debug|x64
+               {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Debug|x64.Build.0 = Debug|x64
+               {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Release|x64.ActiveCfg = Release|x64
+               {9FF51F3E-AF36-4F45-A797-C5F03A090298}.Release|x64.Build.0 = Release|x64
+               {9FF62356-30B4-42A1-8DC7-45262A18DD44}.Debug|x64.ActiveCfg = Debug|x64
+               {9FF62356-30B4-42A1-8DC7-45262A18DD44}.Debug|x64.Build.0 = Debug|x64
+               {9FF62356-30B4-42A1-8DC7-45262A18DD44}.Release|x64.ActiveCfg = Release|x64
+               {9FF62356-30B4-42A1-8DC7-45262A18DD44}.Release|x64.Build.0 = Release|x64
+               {A18B076A-CE8C-49A6-8B80-F02843E4BF0A}.Debug|x64.ActiveCfg = Debug|x64
+               {A18B076A-CE8C-49A6-8B80-F02843E4BF0A}.Debug|x64.Build.0 = Debug|x64
+               {A18B076A-CE8C-49A6-8B80-F02843E4BF0A}.Release|x64.ActiveCfg = Release|x64
+               {A18B076A-CE8C-49A6-8B80-F02843E4BF0A}.Release|x64.Build.0 = Release|x64
+               {A216BF23-FC5C-4426-BF20-8568A2AA5FA0}.Debug|x64.ActiveCfg = Debug|x64
+               {A216BF23-FC5C-4426-BF20-8568A2AA5FA0}.Debug|x64.Build.0 = Debug|x64
+               {A216BF23-FC5C-4426-BF20-8568A2AA5FA0}.Release|x64.ActiveCfg = Release|x64
+               {A216BF23-FC5C-4426-BF20-8568A2AA5FA0}.Release|x64.Build.0 = Release|x64
+               {A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D}.Debug|x64.ActiveCfg = Debug|x64
+               {A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D}.Debug|x64.Build.0 = Debug|x64
+               {A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D}.Release|x64.ActiveCfg = Release|x64
+               {A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D}.Release|x64.Build.0 = Release|x64
+               {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76}.Debug|x64.ActiveCfg = Debug|x64
+               {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76}.Debug|x64.Build.0 = Debug|x64
+               {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76}.Release|x64.ActiveCfg = Release|x64
+               {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76}.Release|x64.Build.0 = Release|x64
+               {A39D1640-8DBA-450D-9103-2533C248991A}.Debug|x64.ActiveCfg = Debug|x64
+               {A39D1640-8DBA-450D-9103-2533C248991A}.Debug|x64.Build.0 = Debug|x64
+               {A39D1640-8DBA-450D-9103-2533C248991A}.Release|x64.ActiveCfg = Release|x64
+               {A39D1640-8DBA-450D-9103-2533C248991A}.Release|x64.Build.0 = Release|x64
+               {A57D9365-172E-4782-ADC6-82A594E30943}.Debug|x64.ActiveCfg = Debug|x64
+               {A57D9365-172E-4782-ADC6-82A594E30943}.Debug|x64.Build.0 = Debug|x64
+               {A57D9365-172E-4782-ADC6-82A594E30943}.Release|x64.ActiveCfg = Release|x64
+               {A57D9365-172E-4782-ADC6-82A594E30943}.Release|x64.Build.0 = Release|x64
+               {A79E3093-B157-4B09-BABD-29266EA16407}.Debug|x64.ActiveCfg = Debug|x64
+               {A79E3093-B157-4B09-BABD-29266EA16407}.Debug|x64.Build.0 = Debug|x64
+               {A79E3093-B157-4B09-BABD-29266EA16407}.Release|x64.ActiveCfg = Release|x64
+               {A79E3093-B157-4B09-BABD-29266EA16407}.Release|x64.Build.0 = Release|x64
+               {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2}.Debug|x64.ActiveCfg = Debug|x64
+               {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2}.Debug|x64.Build.0 = Debug|x64
+               {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2}.Release|x64.ActiveCfg = Release|x64
+               {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2}.Release|x64.Build.0 = Release|x64
+               {A9ADD224-1755-407F-906D-C13EC37FF7B0}.Debug|x64.ActiveCfg = Debug|x64
+               {A9ADD224-1755-407F-906D-C13EC37FF7B0}.Debug|x64.Build.0 = Debug|x64
+               {A9ADD224-1755-407F-906D-C13EC37FF7B0}.Release|x64.ActiveCfg = Release|x64
+               {A9ADD224-1755-407F-906D-C13EC37FF7B0}.Release|x64.Build.0 = Release|x64
+               {AB15A115-E429-4123-BEBF-206FBA4CF615}.Debug|x64.ActiveCfg = Debug|x64
+               {AB15A115-E429-4123-BEBF-206FBA4CF615}.Debug|x64.Build.0 = Debug|x64
+               {AB15A115-E429-4123-BEBF-206FBA4CF615}.Release|x64.ActiveCfg = Release|x64
+               {AB15A115-E429-4123-BEBF-206FBA4CF615}.Release|x64.Build.0 = Release|x64
+               {AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8}.Debug|x64.ActiveCfg = Debug|x64
+               {AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8}.Debug|x64.Build.0 = Debug|x64
+               {AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8}.Release|x64.ActiveCfg = Release|x64
+               {AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8}.Release|x64.Build.0 = Release|x64
+               {AE952763-5C84-43FC-B344-CACC950F056C}.Debug|x64.ActiveCfg = Debug|x64
+               {AE952763-5C84-43FC-B344-CACC950F056C}.Debug|x64.Build.0 = Debug|x64
+               {AE952763-5C84-43FC-B344-CACC950F056C}.Release|x64.ActiveCfg = Release|x64
+               {AE952763-5C84-43FC-B344-CACC950F056C}.Release|x64.Build.0 = Release|x64
+               {AE9E908D-BAEC-491F-9914-436B3CE35E94}.Debug|x64.ActiveCfg = Debug|x64
+               {AE9E908D-BAEC-491F-9914-436B3CE35E94}.Debug|x64.Build.0 = Debug|x64
+               {AE9E908D-BAEC-491F-9914-436B3CE35E94}.Release|x64.ActiveCfg = Release|x64
+               {AE9E908D-BAEC-491F-9914-436B3CE35E94}.Release|x64.Build.0 = Release|x64
+               {AEAA72CD-E060-417C-9CA1-49B4738384E0}.Debug|x64.ActiveCfg = Debug|x64
+               {AEAA72CD-E060-417C-9CA1-49B4738384E0}.Debug|x64.Build.0 = Debug|x64
+               {AEAA72CD-E060-417C-9CA1-49B4738384E0}.Release|x64.ActiveCfg = Release|x64
+               {AEAA72CD-E060-417C-9CA1-49B4738384E0}.Release|x64.Build.0 = Release|x64
+               {AF038868-2432-4159-A62F-941F11D12C5D}.Debug|x64.ActiveCfg = Debug|x64
+               {AF038868-2432-4159-A62F-941F11D12C5D}.Debug|x64.Build.0 = Debug|x64
+               {AF038868-2432-4159-A62F-941F11D12C5D}.Release|x64.ActiveCfg = Release|x64
+               {AF038868-2432-4159-A62F-941F11D12C5D}.Release|x64.Build.0 = Release|x64
+               {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Debug|x64.ActiveCfg = Debug|x64
+               {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Debug|x64.Build.0 = Debug|x64
+               {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Release|x64.ActiveCfg = Release|x64
+               {AF0B7480-EBE3-486B-B0C8-134910BC9324}.Release|x64.Build.0 = Release|x64
+               {B30C6212-A160-405A-8FE7-340E721738A2}.Debug|x64.ActiveCfg = Debug|x64
+               {B30C6212-A160-405A-8FE7-340E721738A2}.Debug|x64.Build.0 = Debug|x64
+               {B30C6212-A160-405A-8FE7-340E721738A2}.Release|x64.ActiveCfg = Release|x64
+               {B30C6212-A160-405A-8FE7-340E721738A2}.Release|x64.Build.0 = Release|x64
+               {B35BFA09-DE68-483B-AB61-8790E8F060A8}.Debug|x64.ActiveCfg = Debug|x64
+               {B35BFA09-DE68-483B-AB61-8790E8F060A8}.Debug|x64.Build.0 = Debug|x64
+               {B35BFA09-DE68-483B-AB61-8790E8F060A8}.Release|x64.ActiveCfg = Release|x64
+               {B35BFA09-DE68-483B-AB61-8790E8F060A8}.Release|x64.Build.0 = Release|x64
+               {B36F115C-8139-4C35-A3E7-E6BF9F3DA793}.Debug|x64.ActiveCfg = Debug|x64
+               {B36F115C-8139-4C35-A3E7-E6BF9F3DA793}.Debug|x64.Build.0 = Debug|x64
+               {B36F115C-8139-4C35-A3E7-E6BF9F3DA793}.Release|x64.ActiveCfg = Release|x64
+               {B36F115C-8139-4C35-A3E7-E6BF9F3DA793}.Release|x64.Build.0 = Release|x64
+               {B379539C-E130-460D-AE82-4EBDD1A97845}.Debug|x64.ActiveCfg = Debug|x64
+               {B379539C-E130-460D-AE82-4EBDD1A97845}.Debug|x64.Build.0 = Debug|x64
+               {B379539C-E130-460D-AE82-4EBDD1A97845}.Release|x64.ActiveCfg = Release|x64
+               {B379539C-E130-460D-AE82-4EBDD1A97845}.Release|x64.Build.0 = Release|x64
+               {B3AF8A19-5802-4A34-9157-27BBE4E53C0A}.Debug|x64.ActiveCfg = Debug|x64
+               {B3AF8A19-5802-4A34-9157-27BBE4E53C0A}.Debug|x64.Build.0 = Debug|x64
+               {B3AF8A19-5802-4A34-9157-27BBE4E53C0A}.Release|x64.ActiveCfg = Release|x64
+               {B3AF8A19-5802-4A34-9157-27BBE4E53C0A}.Release|x64.Build.0 = Release|x64
+               {B440BB05-37A8-42EA-98D3-D83EB113E497}.Debug|x64.ActiveCfg = Debug|x64
+               {B440BB05-37A8-42EA-98D3-D83EB113E497}.Debug|x64.Build.0 = Debug|x64
+               {B440BB05-37A8-42EA-98D3-D83EB113E497}.Release|x64.ActiveCfg = Release|x64
+               {B440BB05-37A8-42EA-98D3-D83EB113E497}.Release|x64.Build.0 = Release|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE}.Debug|x64.ActiveCfg = Debug|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE}.Debug|x64.Build.0 = Debug|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE}.Release|x64.ActiveCfg = Release|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE}.Release|x64.Build.0 = Release|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF}.Debug|x64.ActiveCfg = Debug|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF}.Debug|x64.Build.0 = Debug|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF}.Release|x64.ActiveCfg = Release|x64
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF}.Release|x64.Build.0 = Release|x64
+               {B6DA6617-D98F-4A4D-A7C4-A317212924BF}.Debug|x64.ActiveCfg = Debug|x64
+               {B6DA6617-D98F-4A4D-A7C4-A317212924BF}.Debug|x64.Build.0 = Debug|x64
+               {B6DA6617-D98F-4A4D-A7C4-A317212924BF}.Release|x64.ActiveCfg = Release|x64
+               {B6DA6617-D98F-4A4D-A7C4-A317212924BF}.Release|x64.Build.0 = Release|x64
+               {B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F}.Debug|x64.ActiveCfg = Debug|x64
+               {B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F}.Debug|x64.Build.0 = Debug|x64
+               {B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F}.Release|x64.ActiveCfg = Release|x64
+               {B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F}.Release|x64.Build.0 = Release|x64
+               {B775480C-5B32-4F64-B026-47367280EC56}.Debug|x64.ActiveCfg = Debug|x64
+               {B775480C-5B32-4F64-B026-47367280EC56}.Debug|x64.Build.0 = Debug|x64
+               {B775480C-5B32-4F64-B026-47367280EC56}.Release|x64.ActiveCfg = Release|x64
+               {B775480C-5B32-4F64-B026-47367280EC56}.Release|x64.Build.0 = Release|x64
+               {B887EA26-846C-4D6A-B0E4-432487506BC7}.Debug|x64.ActiveCfg = Debug|x64
+               {B887EA26-846C-4D6A-B0E4-432487506BC7}.Debug|x64.Build.0 = Debug|x64
+               {B887EA26-846C-4D6A-B0E4-432487506BC7}.Release|x64.ActiveCfg = Release|x64
+               {B887EA26-846C-4D6A-B0E4-432487506BC7}.Release|x64.Build.0 = Release|x64
+               {BA0EF7F5-BE6C-4B61-9D5F-1480462EE001}.Debug|x64.ActiveCfg = Debug|x64
+               {BA0EF7F5-BE6C-4B61-9D5F-1480462EE001}.Debug|x64.Build.0 = Debug|x64
+               {BA0EF7F5-BE6C-4B61-9D5F-1480462EE001}.Release|x64.ActiveCfg = Release|x64
+               {BA0EF7F5-BE6C-4B61-9D5F-1480462EE001}.Release|x64.Build.0 = Release|x64
+               {BABC6427-E533-4DCF-91E3-B5B2ED253F46}.Debug|x64.ActiveCfg = Debug|x64
+               {BABC6427-E533-4DCF-91E3-B5B2ED253F46}.Debug|x64.Build.0 = Debug|x64
+               {BABC6427-E533-4DCF-91E3-B5B2ED253F46}.Release|x64.ActiveCfg = Release|x64
+               {BABC6427-E533-4DCF-91E3-B5B2ED253F46}.Release|x64.Build.0 = Release|x64
+               {BAE107BA-7618-4972-8188-2D3CDAAE0453}.Debug|x64.ActiveCfg = Debug|x64
+               {BAE107BA-7618-4972-8188-2D3CDAAE0453}.Debug|x64.Build.0 = Debug|x64
+               {BAE107BA-7618-4972-8188-2D3CDAAE0453}.Release|x64.ActiveCfg = Release|x64
+               {BAE107BA-7618-4972-8188-2D3CDAAE0453}.Release|x64.Build.0 = Release|x64
+               {BB1120CF-B721-4EF9-8735-58F76AE51D2F}.Debug|x64.ActiveCfg = Debug|x64
+               {BB1120CF-B721-4EF9-8735-58F76AE51D2F}.Debug|x64.Build.0 = Debug|x64
+               {BB1120CF-B721-4EF9-8735-58F76AE51D2F}.Release|x64.ActiveCfg = Release|x64
+               {BB1120CF-B721-4EF9-8735-58F76AE51D2F}.Release|x64.Build.0 = Release|x64
+               {BB248BAC-6E1B-433C-A254-75140A273AB5}.Debug|x64.ActiveCfg = Debug|x64
+               {BB248BAC-6E1B-433C-A254-75140A273AB5}.Debug|x64.Build.0 = Debug|x64
+               {BB248BAC-6E1B-433C-A254-75140A273AB5}.Release|x64.ActiveCfg = Release|x64
+               {BB248BAC-6E1B-433C-A254-75140A273AB5}.Release|x64.Build.0 = Release|x64
+               {BE18F227-A9F0-4B38-B689-4E2F9F09CA5F}.Debug|x64.ActiveCfg = Debug|x64
+               {BE18F227-A9F0-4B38-B689-4E2F9F09CA5F}.Debug|x64.Build.0 = Debug|x64
+               {BE18F227-A9F0-4B38-B689-4E2F9F09CA5F}.Release|x64.ActiveCfg = Release|x64
+               {BE18F227-A9F0-4B38-B689-4E2F9F09CA5F}.Release|x64.Build.0 = Release|x64
+               {C0E811E0-8942-4CFD-A817-74D99E9E6577}.Debug|x64.ActiveCfg = Debug|x64
+               {C0E811E0-8942-4CFD-A817-74D99E9E6577}.Debug|x64.Build.0 = Debug|x64
+               {C0E811E0-8942-4CFD-A817-74D99E9E6577}.Release|x64.ActiveCfg = Release|x64
+               {C0E811E0-8942-4CFD-A817-74D99E9E6577}.Release|x64.Build.0 = Release|x64
+               {C2C36D03-26EE-4BD8-8FFC-86CFE16C1218}.Debug|x64.ActiveCfg = Debug|x64
+               {C2C36D03-26EE-4BD8-8FFC-86CFE16C1218}.Debug|x64.Build.0 = Debug|x64
+               {C2C36D03-26EE-4BD8-8FFC-86CFE16C1218}.Release|x64.ActiveCfg = Release|x64
+               {C2C36D03-26EE-4BD8-8FFC-86CFE16C1218}.Release|x64.Build.0 = Release|x64
+               {C2D5E690-748B-4138-B572-1774B99A8572}.Debug|x64.ActiveCfg = Debug|x64
+               {C2D5E690-748B-4138-B572-1774B99A8572}.Debug|x64.Build.0 = Debug|x64
+               {C2D5E690-748B-4138-B572-1774B99A8572}.Release|x64.ActiveCfg = Release|x64
+               {C2D5E690-748B-4138-B572-1774B99A8572}.Release|x64.Build.0 = Release|x64
+               {C2F94489-A483-4C44-B8A7-11A75F6AEC66}.Debug|x64.ActiveCfg = Debug|x64
+               {C2F94489-A483-4C44-B8A7-11A75F6AEC66}.Debug|x64.Build.0 = Debug|x64
+               {C2F94489-A483-4C44-B8A7-11A75F6AEC66}.Release|x64.ActiveCfg = Release|x64
+               {C2F94489-A483-4C44-B8A7-11A75F6AEC66}.Release|x64.Build.0 = Release|x64
+               {C35052AF-2383-4F9C-B18B-55A01829F2BF}.Debug|x64.ActiveCfg = Debug|x64
+               {C35052AF-2383-4F9C-B18B-55A01829F2BF}.Debug|x64.Build.0 = Debug|x64
+               {C35052AF-2383-4F9C-B18B-55A01829F2BF}.Release|x64.ActiveCfg = Release|x64
+               {C35052AF-2383-4F9C-B18B-55A01829F2BF}.Release|x64.Build.0 = Release|x64
+               {C3CEE34C-29E0-4A22-B258-3FBAF662AA19}.Debug|x64.ActiveCfg = Debug|x64
+               {C3CEE34C-29E0-4A22-B258-3FBAF662AA19}.Debug|x64.Build.0 = Debug|x64
+               {C3CEE34C-29E0-4A22-B258-3FBAF662AA19}.Release|x64.ActiveCfg = Release|x64
+               {C3CEE34C-29E0-4A22-B258-3FBAF662AA19}.Release|x64.Build.0 = Release|x64
+               {C5E8B8DB-2507-4904-847F-A52196B075F0}.Debug|x64.ActiveCfg = Debug|x64
+               {C5E8B8DB-2507-4904-847F-A52196B075F0}.Debug|x64.Build.0 = Debug|x64
+               {C5E8B8DB-2507-4904-847F-A52196B075F0}.Release|x64.ActiveCfg = Release|x64
+               {C5E8B8DB-2507-4904-847F-A52196B075F0}.Release|x64.Build.0 = Release|x64
+               {C7025EE1-57E5-44B9-A4F5-3CB059601FC3}.Debug|x64.ActiveCfg = Debug|x64
+               {C7025EE1-57E5-44B9-A4F5-3CB059601FC3}.Debug|x64.Build.0 = Debug|x64
+               {C7025EE1-57E5-44B9-A4F5-3CB059601FC3}.Release|x64.ActiveCfg = Release|x64
+               {C7025EE1-57E5-44B9-A4F5-3CB059601FC3}.Release|x64.Build.0 = Release|x64
+               {C71DAF3E-9361-4723-93E2-C475D1D0C0D0}.Debug|x64.ActiveCfg = Debug|x64
+               {C71DAF3E-9361-4723-93E2-C475D1D0C0D0}.Debug|x64.Build.0 = Debug|x64
+               {C71DAF3E-9361-4723-93E2-C475D1D0C0D0}.Release|x64.ActiveCfg = Release|x64
+               {C71DAF3E-9361-4723-93E2-C475D1D0C0D0}.Release|x64.Build.0 = Release|x64
+               {C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC}.Debug|x64.ActiveCfg = Debug|x64
+               {C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC}.Debug|x64.Build.0 = Debug|x64
+               {C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC}.Release|x64.ActiveCfg = Release|x64
+               {C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC}.Release|x64.Build.0 = Release|x64
+               {C973CD39-D63B-4F5C-BE1D-DED17388B5A4}.Debug|x64.ActiveCfg = Debug|x64
+               {C973CD39-D63B-4F5C-BE1D-DED17388B5A4}.Debug|x64.Build.0 = Debug|x64
+               {C973CD39-D63B-4F5C-BE1D-DED17388B5A4}.Release|x64.ActiveCfg = Release|x64
+               {C973CD39-D63B-4F5C-BE1D-DED17388B5A4}.Release|x64.Build.0 = Release|x64
+               {CA4BBB24-D33E-42E2-A495-F10D80DE8C1D}.Debug|x64.ActiveCfg = Debug|x64
+               {CA4BBB24-D33E-42E2-A495-F10D80DE8C1D}.Debug|x64.Build.0 = Debug|x64
+               {CA4BBB24-D33E-42E2-A495-F10D80DE8C1D}.Release|x64.ActiveCfg = Release|x64
+               {CB906E89-1313-4929-AFF7-86FBF1CC301F}.Debug|x64.ActiveCfg = Debug|x64
+               {CB906E89-1313-4929-AFF7-86FBF1CC301F}.Debug|x64.Build.0 = Debug|x64
+               {CB906E89-1313-4929-AFF7-86FBF1CC301F}.Release|x64.ActiveCfg = Release|x64
+               {CB906E89-1313-4929-AFF7-86FBF1CC301F}.Release|x64.Build.0 = Release|x64
+               {CCA9B681-D10B-45E4-98CC-531503D2EDE8}.Debug|x64.ActiveCfg = Debug|x64
+               {CCA9B681-D10B-45E4-98CC-531503D2EDE8}.Debug|x64.Build.0 = Debug|x64
+               {CCA9B681-D10B-45E4-98CC-531503D2EDE8}.Release|x64.ActiveCfg = Release|x64
+               {CCA9B681-D10B-45E4-98CC-531503D2EDE8}.Release|x64.Build.0 = Release|x64
+               {CDD9DFC6-5C3D-42F7-B822-FE29A1C21752}.Debug|x64.ActiveCfg = Debug|x64
+               {CDD9DFC6-5C3D-42F7-B822-FE29A1C21752}.Debug|x64.Build.0 = Debug|x64
+               {CDD9DFC6-5C3D-42F7-B822-FE29A1C21752}.Release|x64.ActiveCfg = Release|x64
+               {CDD9DFC6-5C3D-42F7-B822-FE29A1C21752}.Release|x64.Build.0 = Release|x64
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}.Debug|x64.ActiveCfg = Debug|x64
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}.Debug|x64.Build.0 = Debug|x64
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}.Release|x64.ActiveCfg = Release|x64
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681}.Release|x64.Build.0 = Release|x64
+               {CF9A0883-6334-44C7-AC29-349468C78E27}.Debug|x64.ActiveCfg = Debug|x64
+               {CF9A0883-6334-44C7-AC29-349468C78E27}.Debug|x64.Build.0 = Debug|x64
+               {CF9A0883-6334-44C7-AC29-349468C78E27}.Release|x64.ActiveCfg = Release|x64
+               {CF9A0883-6334-44C7-AC29-349468C78E27}.Release|x64.Build.0 = Release|x64
+               {CF9F4CEA-EC66-4E78-A086-107EB29E0637}.Debug|x64.ActiveCfg = Debug|x64
+               {CF9F4CEA-EC66-4E78-A086-107EB29E0637}.Debug|x64.Build.0 = Debug|x64
+               {CF9F4CEA-EC66-4E78-A086-107EB29E0637}.Release|x64.ActiveCfg = Release|x64
+               {CF9F4CEA-EC66-4E78-A086-107EB29E0637}.Release|x64.Build.0 = Release|x64
+               {D062166F-0EC7-4C13-A772-0C7157EEFE41}.Debug|x64.ActiveCfg = Debug|x64
+               {D062166F-0EC7-4C13-A772-0C7157EEFE41}.Debug|x64.Build.0 = Debug|x64
+               {D062166F-0EC7-4C13-A772-0C7157EEFE41}.Release|x64.ActiveCfg = Release|x64
+               {D062166F-0EC7-4C13-A772-0C7157EEFE41}.Release|x64.Build.0 = Release|x64
+               {D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1}.Debug|x64.ActiveCfg = Debug|x64
+               {D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1}.Debug|x64.Build.0 = Debug|x64
+               {D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1}.Release|x64.ActiveCfg = Release|x64
+               {D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1}.Release|x64.Build.0 = Release|x64
+               {D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3}.Debug|x64.ActiveCfg = Debug|x64
+               {D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3}.Debug|x64.Build.0 = Debug|x64
+               {D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3}.Release|x64.ActiveCfg = Release|x64
+               {D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3}.Release|x64.Build.0 = Release|x64
+               {D2964B88-EB05-4EBF-ACDA-44596FBFECB6}.Debug|x64.ActiveCfg = Debug|x64
+               {D2964B88-EB05-4EBF-ACDA-44596FBFECB6}.Debug|x64.Build.0 = Debug|x64
+               {D2964B88-EB05-4EBF-ACDA-44596FBFECB6}.Release|x64.ActiveCfg = Release|x64
+               {D2964B88-EB05-4EBF-ACDA-44596FBFECB6}.Release|x64.Build.0 = Release|x64
+               {D2C30C7E-A7D3-487A-956E-418CECAFFE8E}.Debug|x64.ActiveCfg = Debug|x64
+               {D2C30C7E-A7D3-487A-956E-418CECAFFE8E}.Debug|x64.Build.0 = Debug|x64
+               {D2C30C7E-A7D3-487A-956E-418CECAFFE8E}.Release|x64.ActiveCfg = Release|x64
+               {D2C30C7E-A7D3-487A-956E-418CECAFFE8E}.Release|x64.Build.0 = Release|x64
+               {D3A99F36-4B72-4766-ABCD-CCEDC26DD139}.Debug|x64.ActiveCfg = Debug|x64
+               {D3A99F36-4B72-4766-ABCD-CCEDC26DD139}.Debug|x64.Build.0 = Debug|x64
+               {D3A99F36-4B72-4766-ABCD-CCEDC26DD139}.Release|x64.ActiveCfg = Release|x64
+               {D3A99F36-4B72-4766-ABCD-CCEDC26DD139}.Release|x64.Build.0 = Release|x64
+               {D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7}.Debug|x64.ActiveCfg = Debug|x64
+               {D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7}.Debug|x64.Build.0 = Debug|x64
+               {D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7}.Release|x64.ActiveCfg = Release|x64
+               {D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7}.Release|x64.Build.0 = Release|x64
+               {D43FCFB6-97D2-44B2-8577-94B43B97D7CA}.Debug|x64.ActiveCfg = Debug|x64
+               {D43FCFB6-97D2-44B2-8577-94B43B97D7CA}.Debug|x64.Build.0 = Debug|x64
+               {D43FCFB6-97D2-44B2-8577-94B43B97D7CA}.Release|x64.ActiveCfg = Release|x64
+               {D43FCFB6-97D2-44B2-8577-94B43B97D7CA}.Release|x64.Build.0 = Release|x64
+               {D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D}.Debug|x64.ActiveCfg = Debug|x64
+               {D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D}.Debug|x64.Build.0 = Debug|x64
+               {D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D}.Release|x64.ActiveCfg = Release|x64
+               {D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D}.Release|x64.Build.0 = Release|x64
+               {D829DB63-E046-474D-8EA3-43A6659294D8}.Debug|x64.ActiveCfg = Debug|x64
+               {D829DB63-E046-474D-8EA3-43A6659294D8}.Debug|x64.Build.0 = Debug|x64
+               {D829DB63-E046-474D-8EA3-43A6659294D8}.Release|x64.ActiveCfg = Release|x64
+               {D829DB63-E046-474D-8EA3-43A6659294D8}.Release|x64.Build.0 = Release|x64
+               {D8317F1D-7A70-4A39-977A-EAB05A04A87B}.Debug|x64.ActiveCfg = Debug|x64
+               {D8317F1D-7A70-4A39-977A-EAB05A04A87B}.Debug|x64.Build.0 = Debug|x64
+               {D8317F1D-7A70-4A39-977A-EAB05A04A87B}.Release|x64.ActiveCfg = Release|x64
+               {D8317F1D-7A70-4A39-977A-EAB05A04A87B}.Release|x64.Build.0 = Release|x64
+               {D88187D2-1977-4C5F-B0CD-83C69BD6C1BC}.Debug|x64.ActiveCfg = Debug|x64
+               {D88187D2-1977-4C5F-B0CD-83C69BD6C1BC}.Debug|x64.Build.0 = Debug|x64
+               {D88187D2-1977-4C5F-B0CD-83C69BD6C1BC}.Release|x64.ActiveCfg = Release|x64
+               {D88187D2-1977-4C5F-B0CD-83C69BD6C1BC}.Release|x64.Build.0 = Release|x64
+               {D93A2683-6D99-4F18-B378-91195D23E007}.Debug|x64.ActiveCfg = Debug|x64
+               {D93A2683-6D99-4F18-B378-91195D23E007}.Debug|x64.Build.0 = Debug|x64
+               {D93A2683-6D99-4F18-B378-91195D23E007}.Release|x64.ActiveCfg = Release|x64
+               {D93A2683-6D99-4F18-B378-91195D23E007}.Release|x64.Build.0 = Release|x64
+               {D9A70E35-0C85-4A09-ACA8-B15B21B66F50}.Debug|x64.ActiveCfg = Debug|x64
+               {D9A70E35-0C85-4A09-ACA8-B15B21B66F50}.Debug|x64.Build.0 = Debug|x64
+               {D9A70E35-0C85-4A09-ACA8-B15B21B66F50}.Release|x64.ActiveCfg = Release|x64
+               {D9A70E35-0C85-4A09-ACA8-B15B21B66F50}.Release|x64.Build.0 = Release|x64
+               {DB68AB21-510B-4BA1-9E6F-E5731D8647BC}.Debug|x64.ActiveCfg = Debug|x64
+               {DB68AB21-510B-4BA1-9E6F-E5731D8647BC}.Debug|x64.Build.0 = Debug|x64
+               {DB68AB21-510B-4BA1-9E6F-E5731D8647BC}.Release|x64.ActiveCfg = Release|x64
+               {DB68AB21-510B-4BA1-9E6F-E5731D8647BC}.Release|x64.Build.0 = Release|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE}.Debug|x64.ActiveCfg = Debug|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE}.Debug|x64.Build.0 = Debug|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE}.Release|x64.ActiveCfg = Release|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE}.Release|x64.Build.0 = Release|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF}.Debug|x64.ActiveCfg = Debug|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF}.Debug|x64.Build.0 = Debug|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF}.Release|x64.ActiveCfg = Release|x64
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF}.Release|x64.Build.0 = Release|x64
+               {DEA3CD0A-8781-4ABE-9A7D-00B91132FED0}.Debug|x64.ActiveCfg = Debug|x64
+               {DEA3CD0A-8781-4ABE-9A7D-00B91132FED0}.Debug|x64.Build.0 = Debug|x64
+               {DEA3CD0A-8781-4ABE-9A7D-00B91132FED0}.Release|x64.ActiveCfg = Release|x64
+               {DEA3CD0A-8781-4ABE-9A7D-00B91132FED0}.Release|x64.Build.0 = Release|x64
+               {E07C9A5F-B2E4-44FB-AA87-FBC885AC955D}.Debug|x64.ActiveCfg = Debug|x64
+               {E07C9A5F-B2E4-44FB-AA87-FBC885AC955D}.Debug|x64.Build.0 = Debug|x64
+               {E07C9A5F-B2E4-44FB-AA87-FBC885AC955D}.Release|x64.ActiveCfg = Release|x64
+               {E07C9A5F-B2E4-44FB-AA87-FBC885AC955D}.Release|x64.Build.0 = Release|x64
+               {E4E2EC33-7902-45D0-9C3C-ADBAFA46874A}.Debug|x64.ActiveCfg = Debug|x64
+               {E4E2EC33-7902-45D0-9C3C-ADBAFA46874A}.Debug|x64.Build.0 = Debug|x64
+               {E4E2EC33-7902-45D0-9C3C-ADBAFA46874A}.Release|x64.ActiveCfg = Release|x64
+               {E4E2EC33-7902-45D0-9C3C-ADBAFA46874A}.Release|x64.Build.0 = Release|x64
+               {E648732D-78FA-427A-928C-9A59222D37B7}.Debug|x64.ActiveCfg = Debug|x64
+               {E648732D-78FA-427A-928C-9A59222D37B7}.Debug|x64.Build.0 = Debug|x64
+               {E648732D-78FA-427A-928C-9A59222D37B7}.Release|x64.ActiveCfg = Release|x64
+               {E648732D-78FA-427A-928C-9A59222D37B7}.Release|x64.Build.0 = Release|x64
+               {E660218B-3B2D-4378-A2CD-78B865764CF1}.Debug|x64.ActiveCfg = Debug|x64
+               {E660218B-3B2D-4378-A2CD-78B865764CF1}.Debug|x64.Build.0 = Debug|x64
+               {E660218B-3B2D-4378-A2CD-78B865764CF1}.Release|x64.ActiveCfg = Release|x64
+               {E660218B-3B2D-4378-A2CD-78B865764CF1}.Release|x64.Build.0 = Release|x64
+               {E68DEB59-C709-4945-AF80-EEBCADDED944}.Debug|x64.ActiveCfg = Debug|x64
+               {E68DEB59-C709-4945-AF80-EEBCADDED944}.Debug|x64.Build.0 = Debug|x64
+               {E68DEB59-C709-4945-AF80-EEBCADDED944}.Release|x64.ActiveCfg = Release|x64
+               {E68DEB59-C709-4945-AF80-EEBCADDED944}.Release|x64.Build.0 = Release|x64
+               {E7691F81-86EF-467D-82E1-F5B9416386F9}.Debug|x64.ActiveCfg = Debug|x64
+               {E7691F81-86EF-467D-82E1-F5B9416386F9}.Debug|x64.Build.0 = Debug|x64
+               {E7691F81-86EF-467D-82E1-F5B9416386F9}.Release|x64.ActiveCfg = Release|x64
+               {E7691F81-86EF-467D-82E1-F5B9416386F9}.Release|x64.Build.0 = Release|x64
+               {E796AA20-D664-4D05-ABD9-C93A4FBE3E5C}.Debug|x64.ActiveCfg = Debug|x64
+               {E796AA20-D664-4D05-ABD9-C93A4FBE3E5C}.Debug|x64.Build.0 = Debug|x64
+               {E796AA20-D664-4D05-ABD9-C93A4FBE3E5C}.Release|x64.ActiveCfg = Release|x64
+               {E796AA20-D664-4D05-ABD9-C93A4FBE3E5C}.Release|x64.Build.0 = Release|x64
+               {E85E017F-04C0-4716-BF21-949C82C68912}.Debug|x64.ActiveCfg = Debug|x64
+               {E85E017F-04C0-4716-BF21-949C82C68912}.Debug|x64.Build.0 = Debug|x64
+               {E85E017F-04C0-4716-BF21-949C82C68912}.Release|x64.ActiveCfg = Release|x64
+               {E85E017F-04C0-4716-BF21-949C82C68912}.Release|x64.Build.0 = Release|x64
+               {E901B756-EA72-4B8D-967F-85F109D0D1DE}.Debug|x64.ActiveCfg = Debug|x64
+               {E901B756-EA72-4B8D-967F-85F109D0D1DE}.Debug|x64.Build.0 = Debug|x64
+               {E901B756-EA72-4B8D-967F-85F109D0D1DE}.Release|x64.ActiveCfg = Release|x64
+               {E901B756-EA72-4B8D-967F-85F109D0D1DE}.Release|x64.Build.0 = Release|x64
+               {E9E079D6-25BF-46E3-8075-7D733303DD59}.Debug|x64.ActiveCfg = Debug|x64
+               {E9E079D6-25BF-46E3-8075-7D733303DD59}.Debug|x64.Build.0 = Debug|x64
+               {E9E079D6-25BF-46E3-8075-7D733303DD59}.Release|x64.ActiveCfg = Release|x64
+               {E9E079D6-25BF-46E3-8075-7D733303DD59}.Release|x64.Build.0 = Release|x64
+               {ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6}.Debug|x64.ActiveCfg = Debug|x64
+               {ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6}.Debug|x64.Build.0 = Debug|x64
+               {ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6}.Release|x64.ActiveCfg = Release|x64
+               {ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6}.Release|x64.Build.0 = Release|x64
+               {EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB}.Debug|x64.ActiveCfg = Debug|x64
+               {EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB}.Debug|x64.Build.0 = Debug|x64
+               {EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB}.Release|x64.ActiveCfg = Release|x64
+               {EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB}.Release|x64.Build.0 = Release|x64
+               {EDD5FA29-69AF-445F-842A-132E65D3C92B}.Debug|x64.ActiveCfg = Debug|x64
+               {EDD5FA29-69AF-445F-842A-132E65D3C92B}.Debug|x64.Build.0 = Debug|x64
+               {EDD5FA29-69AF-445F-842A-132E65D3C92B}.Release|x64.ActiveCfg = Release|x64
+               {EDD5FA29-69AF-445F-842A-132E65D3C92B}.Release|x64.Build.0 = Release|x64
+               {EF951090-8938-4F7D-8674-7F6FB1F2C25E}.Debug|x64.ActiveCfg = Debug|x64
+               {EF951090-8938-4F7D-8674-7F6FB1F2C25E}.Debug|x64.Build.0 = Debug|x64
+               {EF951090-8938-4F7D-8674-7F6FB1F2C25E}.Release|x64.ActiveCfg = Release|x64
+               {EF951090-8938-4F7D-8674-7F6FB1F2C25E}.Release|x64.Build.0 = Release|x64
+               {F03DABEE-A03E-4437-BFD3-D012836F2D94}.Debug|x64.ActiveCfg = Debug|x64
+               {F03DABEE-A03E-4437-BFD3-D012836F2D94}.Debug|x64.Build.0 = Debug|x64
+               {F03DABEE-A03E-4437-BFD3-D012836F2D94}.Release|x64.ActiveCfg = Release|x64
+               {F03DABEE-A03E-4437-BFD3-D012836F2D94}.Release|x64.Build.0 = Release|x64
+               {F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0}.Debug|x64.ActiveCfg = Debug|x64
+               {F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0}.Debug|x64.Build.0 = Debug|x64
+               {F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0}.Release|x64.ActiveCfg = Release|x64
+               {F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0}.Release|x64.Build.0 = Release|x64
+               {F13108C4-4C86-4D56-A317-A4E5892A8AF7}.Debug|x64.ActiveCfg = Debug|x64
+               {F13108C4-4C86-4D56-A317-A4E5892A8AF7}.Debug|x64.Build.0 = Debug|x64
+               {F13108C4-4C86-4D56-A317-A4E5892A8AF7}.Release|x64.ActiveCfg = Release|x64
+               {F13108C4-4C86-4D56-A317-A4E5892A8AF7}.Release|x64.Build.0 = Release|x64
+               {F3E5650D-834E-45E6-90C7-3FC2AA954929}.Debug|x64.ActiveCfg = Debug|x64
+               {F3E5650D-834E-45E6-90C7-3FC2AA954929}.Debug|x64.Build.0 = Debug|x64
+               {F3E5650D-834E-45E6-90C7-3FC2AA954929}.Release|x64.ActiveCfg = Release|x64
+               {F3E5650D-834E-45E6-90C7-3FC2AA954929}.Release|x64.Build.0 = Release|x64
+               {F596C36C-5C96-4F08-B420-8908AF500954}.Debug|x64.ActiveCfg = Debug|x64
+               {F596C36C-5C96-4F08-B420-8908AF500954}.Debug|x64.Build.0 = Debug|x64
+               {F596C36C-5C96-4F08-B420-8908AF500954}.Release|x64.ActiveCfg = Release|x64
+               {F596C36C-5C96-4F08-B420-8908AF500954}.Release|x64.Build.0 = Release|x64
+               {F5D850C9-D353-4B84-99BC-E336C231018C}.Debug|x64.ActiveCfg = Debug|x64
+               {F5D850C9-D353-4B84-99BC-E336C231018C}.Debug|x64.Build.0 = Debug|x64
+               {F5D850C9-D353-4B84-99BC-E336C231018C}.Release|x64.ActiveCfg = Release|x64
+               {F5D850C9-D353-4B84-99BC-E336C231018C}.Release|x64.Build.0 = Release|x64
+               {F5E2F6C4-19BA-497A-B754-232E4666E647}.Debug|x64.ActiveCfg = Debug|x64
+               {F5E2F6C4-19BA-497A-B754-232E4666E647}.Debug|x64.Build.0 = Debug|x64
+               {F5E2F6C4-19BA-497A-B754-232E4666E647}.Release|x64.ActiveCfg = Release|x64
+               {F5E2F6C4-19BA-497A-B754-232E4666E647}.Release|x64.Build.0 = Release|x64
+               {F5E2F6C4-19BA-497A-B754-232E469BE647}.Debug|x64.ActiveCfg = Debug|x64
+               {F5E2F6C4-19BA-497A-B754-232E469BE647}.Debug|x64.Build.0 = Debug|x64
+               {F5E2F6C4-19BA-497A-B754-232E469BE647}.Release|x64.ActiveCfg = Release|x64
+               {F5E2F6C4-19BA-497A-B754-232E469BE647}.Release|x64.Build.0 = Release|x64
+               {F63FB47F-1DCE-48E5-9CBD-F3E0A354472B}.Debug|x64.ActiveCfg = Debug|x64
+               {F63FB47F-1DCE-48E5-9CBD-F3E0A354472B}.Debug|x64.Build.0 = Debug|x64
+               {F63FB47F-1DCE-48E5-9CBD-F3E0A354472B}.Release|x64.ActiveCfg = Release|x64
+               {F63FB47F-1DCE-48E5-9CBD-F3E0A354472B}.Release|x64.Build.0 = Release|x64
+               {F7508935-C65A-4521-88E3-76AB24F2978D}.Debug|x64.ActiveCfg = Debug|x64
+               {F7508935-C65A-4521-88E3-76AB24F2978D}.Debug|x64.Build.0 = Debug|x64
+               {F7508935-C65A-4521-88E3-76AB24F2978D}.Release|x64.ActiveCfg = Release|x64
+               {F7508935-C65A-4521-88E3-76AB24F2978D}.Release|x64.Build.0 = Release|x64
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B}.Debug|x64.ActiveCfg = Debug|x64
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B}.Debug|x64.Build.0 = Debug|x64
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B}.Release|x64.ActiveCfg = Release|x64
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B}.Release|x64.Build.0 = Release|x64
+               {FB2D2B18-E616-4639-8593-0E1AF2DA01A8}.Debug|x64.ActiveCfg = Debug|x64
+               {FB2D2B18-E616-4639-8593-0E1AF2DA01A8}.Debug|x64.Build.0 = Debug|x64
+               {FB2D2B18-E616-4639-8593-0E1AF2DA01A8}.Release|x64.ActiveCfg = Release|x64
+               {FB2D2B18-E616-4639-8593-0E1AF2DA01A8}.Release|x64.Build.0 = Release|x64
+               {FBB77433-639E-42DC-9355-EA94CAE294D2}.Debug|x64.ActiveCfg = Debug|x64
+               {FBB77433-639E-42DC-9355-EA94CAE294D2}.Debug|x64.Build.0 = Debug|x64
+               {FBB77433-639E-42DC-9355-EA94CAE294D2}.Release|x64.ActiveCfg = Release|x64
+               {FBB77433-639E-42DC-9355-EA94CAE294D2}.Release|x64.Build.0 = Release|x64
+               {FC2248F5-3E9E-495B-9767-87F59614047C}.Debug|x64.ActiveCfg = Debug|x64
+               {FC2248F5-3E9E-495B-9767-87F59614047C}.Debug|x64.Build.0 = Debug|x64
+               {FC2248F5-3E9E-495B-9767-87F59614047C}.Release|x64.ActiveCfg = Release|x64
+               {FC2248F5-3E9E-495B-9767-87F59614047C}.Release|x64.Build.0 = Release|x64
+               {FC998FE5-C843-42BA-9731-F46DB02F1853}.Debug|x64.ActiveCfg = Debug|x64
+               {FC998FE5-C843-42BA-9731-F46DB02F1853}.Debug|x64.Build.0 = Debug|x64
+               {FC998FE5-C843-42BA-9731-F46DB02F1853}.Release|x64.ActiveCfg = Release|x64
+               {FC998FE5-C843-42BA-9731-F46DB02F1853}.Release|x64.Build.0 = Release|x64
+               {FCD0587A-4504-4F5E-8E9C-468CC03D250A}.Debug|x64.ActiveCfg = Debug|x64
+               {FCD0587A-4504-4F5E-8E9C-468CC03D250A}.Debug|x64.Build.0 = Debug|x64
+               {FCD0587A-4504-4F5E-8E9C-468CC03D250A}.Release|x64.ActiveCfg = Release|x64
+               {FCD0587A-4504-4F5E-8E9C-468CC03D250A}.Release|x64.Build.0 = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888C}.Debug|x64.ActiveCfg = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888C}.Debug|x64.Build.0 = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888C}.Release|x64.ActiveCfg = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888C}.Release|x64.Build.0 = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888D}.Debug|x64.ActiveCfg = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888D}.Debug|x64.Build.0 = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888D}.Release|x64.ActiveCfg = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888D}.Release|x64.Build.0 = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888E}.Debug|x64.ActiveCfg = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888E}.Debug|x64.Build.0 = Debug|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888E}.Release|x64.ActiveCfg = Release|x64
+               {FD726AA3-D4FA-4597-B435-08CC7752888E}.Release|x64.Build.0 = Release|x64
+               {FEA09B48-34C2-4963-8A5A-F97BDA136D72}.Debug|x64.ActiveCfg = Debug|x64
+               {FEA09B48-34C2-4963-8A5A-F97BDA136D72}.Debug|x64.Build.0 = Debug|x64
+               {FEA09B48-34C2-4963-8A5A-F97BDA136D72}.Release|x64.ActiveCfg = Release|x64
+               {FEA09B48-34C2-4963-8A5A-F97BDA136D72}.Release|x64.Build.0 = Release|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79}.Debug|x64.ActiveCfg = Debug|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79}.Debug|x64.Build.0 = Debug|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79}.Release|x64.ActiveCfg = Release|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79}.Release|x64.Build.0 = Release|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80}.Debug|x64.ActiveCfg = Debug|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80}.Debug|x64.Build.0 = Debug|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80}.Release|x64.ActiveCfg = Release|x64
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80}.Release|x64.Build.0 = Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(NestedProjects) = preSolution
+               {0056B0B6-CB3E-4F0E-B6DC-48D59CB8E235} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {019F5586-5558-4C87-B319-85906D4AE407} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {025E7D51-41F2-4CBA-956E-C37A4443DB1B} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {0287C3DC-AE03-4714-AAFF-C52F062ECA6F} = {1434B17C-6165-4D42-BEA1-5A7730D5A6BB}
+               {02BC3B44-C7F1-4793-86C1-6F36CA8A7F53} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {03228F84-4F41-4BCC-8C2D-F329DC87B289} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {0388E945-A655-41A7-AF27-8981CEE0E49A} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {03B54A12-7793-4827-B820-C07491F7F45E} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {0529575C-F6E8-44FD-BB82-82A29948D0F2} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {063037B2-CA35-4520-811C-19D9C4ED891E} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {06877FED-15BA-421F-85C9-1A964FB97446} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {0703E813-9CC8-4DEA-AA33-42B099CD172D} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {07A153D9-DF17-4DE8-A3C2-EBF171B961AE} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {08B62E36-63D2-4FF1-A605-4BBABAEE73FB} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {0A049EAD-652F-4E20-8026-90FD99AEE77A} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {0B1818EB-BDC8-4865-964F-DB8BF05CFD86} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {0BFD78AA-FD94-4DB1-8495-8F5CC06D8F03} = {BFEDF709-A700-4769-9056-ACA934D828A8}
+               {0CC6D525-806E-433F-AB4A-6CFD546418B1} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {0CDCEB97-3270-4939-A290-EA2D3BE34B0C} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {0D4E38EF-A9D5-4797-8994-5DBB1125C9EA} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {0DF30DE0-7F7D-43D3-940A-809EC27D3061} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {0FB8F0FD-276C-413B-97A8-67ABE0C9043B} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {10469175-EEF7-44A0-9961-AC4E45EFD800} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {10B732EF-1783-4B61-B431-36BA5A2A3C9C} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {11D76FBC-DFAA-4B31-9DB0-206E171E3F94} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {11E158AE-C85A-4A6E-B66A-ED2994709276} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {12A1A3EF-202C-4DD0-9B5A-F5126CAB078F} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {1434B17C-6165-4D42-BEA1-5A7730D5A6BB} = {0CC6D525-806E-433F-AB4A-6CFD546418B1}
+               {1464398A-100F-4518-BDB9-939A6362B6CF} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {179BEB5A-2C90-44F5-A734-FA756A5E668C} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {17A4B817-68B1-4719-A9EF-BD8FAB747DE6} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {181A4234-282C-41F0-85C2-2B7697B3CB1A} = {F18C84B3-7898-4324-9D75-99A6048F442D}
+               {18E90E1A-F2E0-40DF-9900-A14E560C9EB4} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {1A36B57B-2E88-4D81-89C0-F575C9895E36} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {1B871BA2-3F70-4BC9-9DF4-725EB07F6628} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {1B9B0D6D-E530-44A6-ADAE-09EA2BDC47DE} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {1BAA1617-93AE-4196-8A1A-BD492FB18AEF} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {1BFBAFED-A9CE-49AF-AB2C-84199E391EE6} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {1C986F2C-9AF1-45E0-9E9B-8CABE9CAF437} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {1EB3DE5B-6357-498D-8CAC-EEC0209EA454} = {E3229AF7-1FA2-4632-BB0B-B74F709F1A33}
+               {1F2E1C51-2B14-4047-BE6D-52E00FC3C780} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {2498FCDA-E2CC-43EF-9A35-8CD63F253171} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {25758581-DD46-4AE4-99D9-11E736F72AD1} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {26166DF1-3C94-44AF-9075-BA31DCD2F6BB} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {27FA11C6-431D-41D1-A417-FAB7C4F93DCA} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {296F3C5D-3951-423E-8E2F-FD4A37958C72} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {29D9376B-DC36-4940-83F1-A7CBE38A2103} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {2A1D6AF2-7336-4966-A4B3-0BE9A24BAE00} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {2B1A5104-A324-4D02-B5C7-D021FB8F880C} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {2B2DE575-1422-4FBF-97BE-35AEDA0AB465} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {2B7772E6-9DAA-4F38-B0BC-7B2399366325} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {2C24CC4F-B340-467D-908F-1BF2C69BC79F} = {F18C84B3-7898-4324-9D75-99A6048F442D}
+               {2CD7408E-2F60-43C3-ACEB-C7D58CDD8462} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {2DE6B085-3C19-49B1-894A-AD9376000E09} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {2ED26FDA-3C4E-4514-B387-5E77C302FF71} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {2EFFC590-BF5E-46A2-AF04-E67E1D571D2E} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {2F543422-4B8A-4898-BE6B-590F52B4E9D1} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {2FA3155B-6F26-4D15-AC03-9D82D48DBC42} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {3142CB13-CADA-48D3-9A25-E6ACB243760A} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {34DB4951-DA08-45F1-938D-B08E5FF5AB46} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {34F31D9D-3D33-4C09-85A3-4749A8AB8EBB} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {3799BA67-3C4F-4AE0-85DC-5BAAEA01A180} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {3B23831B-E5DE-4A62-9D0B-27D0D9F293F4} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {3B44D717-EEDE-470A-B631-C9D6BFE4ADF2} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {3CF270CD-0F56-48E3-AD84-82F369C568BF} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {3EC20BDD-2E48-4291-A9EE-D0675AF77C7F} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {3EC30D6A-BDA4-4971-879A-8814204EAE31} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {3ECCB0F1-3ADF-486A-91C5-79DF0FC22F78} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {3ED56E55-84A6-422C-A8D4-A8439FB8F245} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {42B97D47-F800-4100-BFA2-B3AC357E8B6B} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {42CCEF95-5ADD-460C-967E-DD5B2C744943} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {433F7840-C597-4950-84C9-E4FF7DF6A298} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {45027FC5-4A32-47BD-AC5B-66CC7616B1D2} = {9A8482A7-BF0C-423D-8266-189456ED41F6}
+               {46629F21-089C-4205-B2F8-E01748ECE517} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {46B82069-10BE-432A-8D93-F4D995148555} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {4850F425-9128-4E91-973C-5AE7BD97395B} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {492BAA3D-0D5D-478E-9765-500463AE69AA} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {49A7CC5A-D5E7-4A07-917F-C6918B982BE8} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {4C291EEB-3874-4724-9CC2-1335D13FF0EE} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {4C429783-0B01-449F-A36F-C2019233890B} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {4C6E7F0A-7E6A-4713-B1D2-B7B4ADC992AF} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {4E334022-7A71-4197-9E15-878F7EFC877E} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {4EE3C4D6-F707-4A05-8032-8FC2A44D29E8} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {4FB4FF90-4E92-4CFB-A01F-C73D6861CA03} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {50FD1E47-2131-48D2-9435-5CB28DF6B15A} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {513C4CFA-BD5B-4470-BA93-F6D43778A754} = {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}
+               {53115A01-460C-4339-A2C8-AE1323A6E7EA} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {5580D11C-FDA6-4CF2-A0E8-1C2D3FBC11F1} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {5632B41F-19DD-4BA7-A6EB-74F9E8A7EF8A} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {581B3A58-F3F0-4765-91E5-D0C82816A528} = {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}
+               {58386481-30B7-40FC-96AF-0723A4A7B228} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {59AB6976-D16B-48D0-8D16-94360D3FE51D} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {59D7A9CD-9912-40E4-96E1-8A873F777F62} = {6D63CDF1-F62C-4614-AD8A-95B0A63AA070}
+               {59D9E21C-57D7-4D18-B792-24738BD26DE4} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {5A391A14-8E29-4788-93FC-EDADED31D32F} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {5AD07646-5E16-4CEF-B80A-BE5EE4D54FEF} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {5B2B9C0D-1B6D-4357-8307-6DE1EE0A41A3} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {5D362DB7-D2BD-4907-AAD8-4B8627E72282} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {5DB2E259-0D19-4A89-B8EC-B2912F39924D} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {5E005D50-1C73-4E52-B295-864BB9AF7AC6} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {5E7305DB-93E6-448B-AE44-90EAF916A776} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {5EC35099-9777-45E8-9520-EB2EE75BDF88} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {5F2B687A-1B42-439C-AEEC-135DD22FB851} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {5F8A56F8-2C5B-48B6-9654-DD642D3E5F5C} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {60206D22-E132-4695-8486-10BECA32C5CC} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {60B463D4-8CD5-4BF6-A25B-01BE13B87590} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {60EF55C7-8399-4543-B5B2-3AE2C532C67E} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {628FADA9-7047-4DD9-BD17-9FE4B5A1ADB0} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {63B8184D-85E0-4E6A-9729-558C567D1D1D} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {643B82A1-D009-46A9-92A0-2883399B05C2} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {6516D6CF-8000-4341-9487-312BC83EE370} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {65D92D98-97E1-48F7-AEF6-75221CF48EA4} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {673277EC-D26B-414D-92E3-84EE873316A8} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {6770917C-5B8E-49F1-9297-163FAB76DAFB} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {67AC1343-98FD-4143-92C0-559C55F749F5} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {6851356E-A5D9-46A6-8262-A7E208729F18} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {6AE1B8BE-D46A-4E99-87A2-F160FB950DCA} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {6B492754-9F80-44B3-A2A7-1D98AF06F3B2} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {6BCEF2A5-0CEC-4CC6-9CB0-D3FBF871A408} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {6D63CDF1-F62C-4614-AD8A-95B0A63AA070} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {6D7C1169-3246-465F-B630-ECFEF4F3179A} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {6DBD8C02-0C75-4DB0-BFDA-CD053B1B2D89} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {6EC93484-AAF3-487E-84E4-5ABFBA0AFC53} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {6F06A19B-0921-4B71-A3A5-B350B5FFEADB} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {6F4953DA-FDC3-46CF-BF24-3752CCF2E1CB} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {6F776280-B383-4DCE-8F42-9670164D038D} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {70EE1D40-0C65-4985-8EFC-BD40EE3A89B2} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {715EADD7-0FFE-4F1F-94E7-49302968DF79} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {71D182E0-345A-4375-B0FA-3536821B0EE3} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {7264C8F6-73FB-4830-9306-1558D3EAC71B} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {729E3905-FF7D-49C5-9871-6D35D839183E} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {72C9DB46-C665-48AD-B805-BA885B40CA3E} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {7337E34A-97B0-44FC-988B-7E6AE7E0FBBF} = {6D63CDF1-F62C-4614-AD8A-95B0A63AA070}
+               {740ED97D-005F-4F58-98B2-4EF5EF5776E8} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {746BA101-5C93-42A5-AC7A-64DCEB186572} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {74D655D5-F661-4887-A1EB-5A6222AF5FCA} = {E3229AF7-1FA2-4632-BB0B-B74F709F1A33}
+               {7701627C-CFD9-48F6-942E-EAACC8D057FA} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {774627B7-6532-4464-AEE4-02F72CA44F95} = {9A8482A7-BF0C-423D-8266-189456ED41F6}
+               {7783BC49-A25B-468B-A6F8-AB6B39A91C65} = {F18C84B3-7898-4324-9D75-99A6048F442D}
+               {779425B1-2211-499B-A7CC-4F9EC6CB0D25} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {79D37FFE-FF76-44B3-BB27-3DCAEFF2EBE9} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {7ABF755C-821B-49CD-8EDE-83C16594FF7F} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {7DC3B3DD-73ED-4602-9AF3-8D7053620DEA} = {877E7D1D-8150-4FE5-A139-B6FBCEAEC393}
+               {7DFEB4A5-8B04-4302-9D09-8144918FCF81} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {7F51CD29-3BCD-4DD8-B327-F384B5A616D1} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {8008010F-8718-4C5F-86B2-195AEBF73422} = {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}
+               {8010BBB0-C71B-4EFF-95EB-65C01E5EC197} = {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}
+               {80AF1B7D-B8CE-4AF0-AE3B-1DABED1B57E7} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {810DB909-6581-42D8-9616-906888F12149} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {85D4076B-896B-4EBB-8F3A-8B44C24CD452} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {85DBDA9B-AEF6-43E7-B8B5-05FF2BEC61A3} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {86EE22CC-6D3C-4F81-ADC8-394946F0DA81} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {877E7D1D-8150-4FE5-A139-B6FBCEAEC393} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {87A32959-E477-4CD5-8A1C-C85646D806B2} = {F18C84B3-7898-4324-9D75-99A6048F442D}
+               {88D239E4-EB7D-4E0A-BE3A-AD78B9F408FC} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {89F947CA-DDEF-4131-8AFB-584ABA4A1302} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {8A0FA780-068A-4534-AA2F-4FF4CF977AF2} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {8A4872D7-A234-4B9B-8215-82C6BB15F3A2} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {8C42CA7C-1543-4F1B-A55F-28CD419C7D35} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {8C6D73E0-0A6F-4487-A040-0EC78D7D6D9A} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {8D75FA1A-EC74-4F88-8AC1-CE3F98E4D828} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {8E374371-30E1-4623-8755-2A2F3742170B} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {901F04DB-E1A5-4A41-8B81-9D31C19ACD59} = {95FAF291-03D1-42FC-9C10-424D551D475D}
+               {9186EAC4-2F34-4F17-B940-6585D7869BCD} = {95FAF291-03D1-42FC-9C10-424D551D475D}
+               {91C30620-70CA-46C7-AC71-71F3C602690E} = {0CC6D525-806E-433F-AB4A-6CFD546418B1}
+               {91E19AEB-7B75-43E0-B8B4-D2BB60D839EA} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {9233FC80-B51C-4A89-AF58-5AE86C068F6A} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {92388A20-50FC-45F8-89E3-71F1618EFABB} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {924B2937-0B53-4DC6-B7E1-5F3102728F89} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {95B683BD-B9DC-400F-9BC0-8F1505F08BF5} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {95FAF291-03D1-42FC-9C10-424D551D475D} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {98ACBE5D-1A92-46F9-AA81-533412172952} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {99F7F00F-1DE5-45EA-992B-64BA282FAC76} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {9A4078F8-B8E4-4EC6-A6FF-4F29DAD9CE48} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {9A8482A7-BF0C-423D-8266-189456ED41F6} = {95FAF291-03D1-42FC-9C10-424D551D475D}
+               {9AE2DAF9-10C4-4EC3-AE52-AD5EE9C77C55} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {9C37B8CC-F810-4787-924D-65BC227091A3} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {9D9E33EB-4C24-4646-A3FB-35DA17247917} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {9E9E3D25-2139-4A5D-9200-18148DDEAD45} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {9FF51F3E-AF36-4F45-A797-C5F03A090298} = {91C30620-70CA-46C7-AC71-71F3C602690E}
+               {9FF62356-30B4-42A1-8DC7-45262A18DD44} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {A14A4556-9092-430D-B9CA-B2B1223D56CB} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {A18B076A-CE8C-49A6-8B80-F02843E4BF0A} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {A216BF23-FC5C-4426-BF20-8568A2AA5FA0} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {A2A0FAEA-2B7C-4FC3-B904-1DB4DEACF88D} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {A38EFCDB-53D6-4474-97F3-0DDC6CE70D76} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {A39D1640-8DBA-450D-9103-2533C248991A} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {A57D9365-172E-4782-ADC6-82A594E30943} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {A79E3093-B157-4B09-BABD-29266EA16407} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {A7CA7975-CEDB-48E6-9AEB-1209DCBD07F2} = {91C30620-70CA-46C7-AC71-71F3C602690E}
+               {A9ADD224-1755-407F-906D-C13EC37FF7B0} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {AB15A115-E429-4123-BEBF-206FBA4CF615} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {AE1C32FB-9B52-4760-ABFC-0D2FA2C7A6C8} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {AE952763-5C84-43FC-B344-CACC950F056C} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {AE9E908D-BAEC-491F-9914-436B3CE35E94} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {AEAA72CD-E060-417C-9CA1-49B4738384E0} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {AF038868-2432-4159-A62F-941F11D12C5D} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {AF0B7480-EBE3-486B-B0C8-134910BC9324} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {B30C6212-A160-405A-8FE7-340E721738A2} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {B35BFA09-DE68-483B-AB61-8790E8F060A8} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {B36F115C-8139-4C35-A3E7-E6BF9F3DA793} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {B379539C-E130-460D-AE82-4EBDD1A97845} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {B3AF8A19-5802-4A34-9157-27BBE4E53C0A} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {B440BB05-37A8-42EA-98D3-D83EB113E497} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFE} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {B6C0521B-EECA-47EF-BFA8-147F9C3F6DFF} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {B6DA6617-D98F-4A4D-A7C4-A317212924BF} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {B6F4B85D-FE55-4A1B-AE97-D4A9ECFE195F} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {B775480C-5B32-4F64-B026-47367280EC56} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {B870D8A6-12CD-4DD0-B843-833695C2310A} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {B887EA26-846C-4D6A-B0E4-432487506BC7} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {B8A4320D-E9A3-4F89-A8AA-B16D746C158A} = {F18C84B3-7898-4324-9D75-99A6048F442D}
+               {BA0EF7F5-BE6C-4B61-9D5F-1480462EE001} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {BABC6427-E533-4DCF-91E3-B5B2ED253F46} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {BAE107BA-7618-4972-8188-2D3CDAAE0453} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {BB1120CF-B721-4EF9-8735-58F76AE51D2F} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {BB248BAC-6E1B-433C-A254-75140A273AB5} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {BE18F227-A9F0-4B38-B689-4E2F9F09CA5F} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B} = {0CC6D525-806E-433F-AB4A-6CFD546418B1}
+               {BFBAB433-860E-4A28-96E3-A4B7AFE3B297} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {BFEDF709-A700-4769-9056-ACA934D828A8} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {C0E811E0-8942-4CFD-A817-74D99E9E6577} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {C2C36D03-26EE-4BD8-8FFC-86CFE16C1218} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {C2D5E690-748B-4138-B572-1774B99A8572} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {C2F94489-A483-4C44-B8A7-11A75F6AEC66} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {C35052AF-2383-4F9C-B18B-55A01829F2BF} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {C3CEE34C-29E0-4A22-B258-3FBAF662AA19} = {91C30620-70CA-46C7-AC71-71F3C602690E}
+               {C5E8B8DB-2507-4904-847F-A52196B075F0} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {C7025EE1-57E5-44B9-A4F5-3CB059601FC3} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {C71DAF3E-9361-4723-93E2-C475D1D0C0D0} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5} = {0CC6D525-806E-433F-AB4A-6CFD546418B1}
+               {C7E42AE1-052F-4024-B8BA-DE5DCE6BBEEC} = {C721EFBD-45DC-479E-9B99-E62FCC1FC6E5}
+               {C973CD39-D63B-4F5C-BE1D-DED17388B5A4} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {CA4BBB24-D33E-42E2-A495-F10D80DE8C1D} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {CB906E89-1313-4929-AFF7-86FBF1CC301F} = {9C37B8CC-F810-4787-924D-65BC227091A3}
+               {CCA9B681-D10B-45E4-98CC-531503D2EDE8} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {CDD9DFC6-5C3D-42F7-B822-FE29A1C21752} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {CE3F2DFB-8470-4802-AD37-21CAF6CB2681} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {CF9A0883-6334-44C7-AC29-349468C78E27} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {CF9F4CEA-EC66-4E78-A086-107EB29E0637} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {D062166F-0EC7-4C13-A772-0C7157EEFE41} = {1434B17C-6165-4D42-BEA1-5A7730D5A6BB}
+               {D140560D-FDEC-4D3D-8F58-BF5FD5E4DAA1} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {D28F5FF6-8401-4E0D-94F9-3A1FD7ED64E3} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {D2964B88-EB05-4EBF-ACDA-44596FBFECB6} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {D2C30C7E-A7D3-487A-956E-418CECAFFE8E} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {D3A99F36-4B72-4766-ABCD-CCEDC26DD139} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {D4035736-1AD6-4100-9FA9-A8A0C1DAE0C7} = {59AB6976-D16B-48D0-8D16-94360D3FE51D}
+               {D43FCFB6-97D2-44B2-8577-94B43B97D7CA} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {D6A1F30D-C9E5-4F5C-9A16-50430AB1F26D} = {BEA6AC7C-831D-44EF-AD61-DA65A448CC9B}
+               {D829DB63-E046-474D-8EA3-43A6659294D8} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {D8317F1D-7A70-4A39-977A-EAB05A04A87B} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {D88187D2-1977-4C5F-B0CD-83C69BD6C1BC} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {D93A2683-6D99-4F18-B378-91195D23E007} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {D9A70E35-0C85-4A09-ACA8-B15B21B66F50} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {DB68AB21-510B-4BA1-9E6F-E5731D8647BC} = {BFBAB433-860E-4A28-96E3-A4B7AFE3B297}
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CE} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {DE068BE1-A8E9-48A2-B216-92A7CE5EA4CF} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {DEA3CD0A-8781-4ABE-9A7D-00B91132FED0} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {E07C9A5F-B2E4-44FB-AA87-FBC885AC955D} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {E23BB160-006E-44F2-8FB4-3A2240BBC20C} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {E3229AF7-1FA2-4632-BB0B-B74F709F1A33} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {E4E2EC33-7902-45D0-9C3C-ADBAFA46874A} = {F8373EDD-1B9E-462D-BF23-55638E23E98B}
+               {E648732D-78FA-427A-928C-9A59222D37B7} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {E660218B-3B2D-4378-A2CD-78B865764CF1} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {E68DEB59-C709-4945-AF80-EEBCADDED944} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {E7691F81-86EF-467D-82E1-F5B9416386F9} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {E796AA20-D664-4D05-ABD9-C93A4FBE3E5C} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {E85E017F-04C0-4716-BF21-949C82C68912} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {E901B756-EA72-4B8D-967F-85F109D0D1DE} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {E9E079D6-25BF-46E3-8075-7D733303DD59} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {ED2A831F-4AAF-4CF7-A953-3C45B0EC1BE6} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {EDA88BAB-9FA7-4A2D-8974-EFCFA24B3FEB} = {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763}
+               {EDD5FA29-69AF-445F-842A-132E65D3C92B} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {EF951090-8938-4F7D-8674-7F6FB1F2C25E} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {F03DABEE-A03E-4437-BFD3-D012836F2D94} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {F09A0864-9221-47AD-872F-D4538104D747} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {F0B613C4-1D9A-4259-BD0E-C1B9FF2AA3A0} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {F13108C4-4C86-4D56-A317-A4E5892A8AF7} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {F3E5650D-834E-45E6-90C7-3FC2AA954929} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {F42C09CD-ABA5-4DA9-8383-5EA40FA4D763} = {0CC6D525-806E-433F-AB4A-6CFD546418B1}
+               {F596C36C-5C96-4F08-B420-8908AF500954} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {F5D850C9-D353-4B84-99BC-E336C231018C} = {BFEDF709-A700-4769-9056-ACA934D828A8}
+               {F5E2F6C4-19BA-497A-B754-232E4666E647} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {F5E2F6C4-19BA-497A-B754-232E469BE647} = {BD6CC700-B36B-435B-BAF9-FC5AFCD766C9}
+               {F63FB47F-1DCE-48E5-9CBD-F3E0A354472B} = {E23BB160-006E-44F2-8FB4-3A2240BBC20C}
+               {F7508935-C65A-4521-88E3-76AB24F2978D} = {A14A4556-9092-430D-B9CA-B2B1223D56CB}
+               {F7C6C6B6-4142-4C82-8699-4A9D8183181B} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {F8373EDD-1B9E-462D-BF23-55638E23E98B} = {746BA101-5C93-42A5-AC7A-64DCEB186572}
+               {F8CCA5AE-2D75-4C79-BEAB-2588CD5956C8} = {853D45D8-980C-4991-B62A-DAC6FD245402}
+               {FB2D2B18-E616-4639-8593-0E1AF2DA01A8} = {2F543422-4B8A-4898-BE6B-590F52B4E9D1}
+               {FBB77433-639E-42DC-9355-EA94CAE294D2} = {1A36B57B-2E88-4D81-89C0-F575C9895E36}
+               {FC2248F5-3E9E-495B-9767-87F59614047C} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {FC998FE5-C843-42BA-9731-F46DB02F1853} = {F09A0864-9221-47AD-872F-D4538104D747}
+               {FCD0587A-4504-4F5E-8E9C-468CC03D250A} = {1434B17C-6165-4D42-BEA1-5A7730D5A6BB}
+               {FD726AA3-D4FA-4597-B435-08CC7752888C} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {FD726AA3-D4FA-4597-B435-08CC7752888D} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {FD726AA3-D4FA-4597-B435-08CC7752888E} = {4C291EEB-3874-4724-9CC2-1335D13FF0EE}
+               {FEA09B48-34C2-4963-8A5A-F97BDA136D72} = {B870D8A6-12CD-4DD0-B843-833695C2310A}
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA79} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+               {FF6E5B0C-DC00-4C93-B9C2-63D1E858BA80} = {63C9B3F8-437D-4AD9-B32D-D04AE38C35B6}
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {5E690324-2D48-486A-8D3C-DCB520D3F693}
+       EndGlobalSection
+EndGlobal
diff --git a/ceph/src/pmdk/src/README b/ceph/src/pmdk/src/README
new file mode 100644 (file)
index 0000000..2a0ca46
--- /dev/null
@@ -0,0 +1,16 @@
+Persistent Memory Development Kit
+
+This is src/README.
+
+This directory contains the source for the Persistent Memory Development Kit.
+
+The subdirectory "include" contains header files that get delivered
+along with the libraries.  Everything else is internal to the libraries
+and lives in this directory.
+
+Two versions of the libraries are built, a debug version and a nondebug
+version.  The object files and the libraries themselves end up in the
+subdirectories "debug" and "nondebug".
+
+See the top-level README for build, test, and installation instructions.
+The basic "make" and "make test" targets also work from this directory.
diff --git a/ceph/src/pmdk/src/common.inc b/ceph/src/pmdk/src/common.inc
new file mode 100644 (file)
index 0000000..8112512
--- /dev/null
@@ -0,0 +1,400 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+#
+# src/common.inc -- common Makefile rules for PMDK
+#
+
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))..
+
+# import user variables
+ifneq ($(wildcard $(TOP)/user.mk),)
+include $(TOP)/user.mk
+endif
+
+LN = ln
+OBJCOPY ?= objcopy
+MKDIR = mkdir
+INSTALL = install
+CP = cp
+CSTYLE = $(TOP)/utils/cstyle
+CSTYLEON ?= 0
+STYLE_CHECK = $(TOP)/utils/style_check.sh
+CHECK_SHEBANG = $(TOP)/utils/check-shebang.sh
+CHECK_OS = $(TOP)/utils/check-os.sh
+OS_BANNED = $(TOP)/utils/os-banned
+COVERAGE = 0
+FAULT_INJECTION ?= 0
+
+PKG_CONFIG ?= pkg-config
+HEADERS = $(wildcard *.h) $(wildcard *.hpp)
+
+ifeq ($(SRCVERSION),)
+export SRCVERSION := $(shell $(TOP)/utils/version.sh $(TOP))
+else
+export SRCVERSION
+endif
+
+ifeq ($(SRCVERSION),)
+$(error Cannot evaluate version)
+endif
+
+ifeq ($(CLANG_FORMAT),)
+ifeq ($(shell command -v clang-format-9 > /dev/null && echo y || echo n), y)
+export CLANG_FORMAT ?= clang-format-9
+else
+export CLANG_FORMAT ?= clang-format
+endif
+endif
+
+ifeq ($(FLAKE8),)
+export FLAKE8 ?= flake8
+endif
+
+GCOV_CFLAGS=-fprofile-arcs -ftest-coverage --coverage
+GCOV_LDFLAGS=-fprofile-arcs -ftest-coverage
+GCOV_LIBS=-lgcov
+
+LIBS += $(EXTRA_LIBS)
+
+ifeq ($(OS_KERNEL_NAME),)
+export OS_KERNEL_NAME := $(shell uname -s)
+endif
+
+osdep = $(1)_$(shell echo $(OS_KERNEL_NAME) | tr "[:upper:]" "[:lower:]")$(2)
+
+get_arch = $(shell $(CC) -dumpmachine | awk -F'[/-]' '{print $$1}')
+ifeq ($(ARCH),)
+export ARCH := $(call get_arch)
+endif
+ifeq ($(ARCH),amd64)
+override ARCH := x86_64
+endif
+ifeq ($(ARCH),arm64)
+override ARCH := aarch64
+endif
+ifneq ($(filter $(ARCH), powerpc64 powerpc64le ppc64 ppc64le ppc64el powerpc),)
+override ARCH := ppc64
+endif
+
+ifeq ($(PKG_CONFIG_CHECKED),)
+ifeq ($(shell command -v $(PKG_CONFIG) && echo y || echo n), n)
+$(error $(PKG_CONFIG) not found)
+endif
+endif
+export PKG_CONFIG_CHECKED := y
+
+check_package = $(shell $(PKG_CONFIG) $(1) && echo y || echo n)
+
+check_flag = $(shell echo "int main(){return 0;}" |\
+       $(CC) $(CFLAGS) -Werror $(1) -x c -o /dev/null - 2>/dev/null && echo y || echo n)
+
+check_compiler = $(shell $(CC) --version | grep $(1) && echo y || echo n)
+
+check_Wconversion = $(shell echo "long random(void); char test(void); char test(void){char a = 0; char b = 'a'; char ret = random() == 1 ? a : b; return ret;}" |\
+       $(CC) -c $(CFLAGS) -Wconversion -x c -o /dev/null - 2>/dev/null && echo y || echo n)
+
+check_librt = $(shell echo "int main() { struct timespec t; return clock_gettime(CLOCK_MONOTONIC, &t); }" |\
+       $(CC) $(CFLAGS) -x c -include time.h -o /dev/null - 2>/dev/null && echo n || echo y)
+
+# XXX: required by clock_gettime(), if glibc version < 2.17
+# The os_clock_gettime() function is now in OS abstraction layer,
+# linked to all the librariess, unit tests and benchmarks.
+ifeq ($(LIBRT_NEEDED),)
+export LIBRT_NEEDED := $(call check_librt)
+else
+export LIBRT_NEEDED
+endif
+
+ifeq ($(IS_ICC),)
+export IS_ICC := $(call check_compiler, icc)
+else
+export IS_ICC
+endif
+
+ifeq ($(WCONVERSION_AVAILABLE),)
+export WCONVERSION_AVAILABLE := $(call check_Wconversion)
+else
+export WCONVERSION_AVAILABLE
+endif
+
+ifeq ($(WUNREACHABLE_CODE_RETURN_AVAILABLE),)
+ifeq ($(IS_ICC), n)
+export WUNREACHABLE_CODE_RETURN_AVAILABLE := $(call check_flag, -Wunreachable-code-return)
+else
+export WUNREACHABLE_CODE_RETURN_AVAILABLE := n
+endif
+else
+export WUNREACHABLE_CODE_RETURN_AVAILABLE
+endif
+
+ifeq ($(WMISSING_VARIABLE_DECLARATIONS_AVAILABLE),)
+ifeq ($(IS_ICC), n)
+export WMISSING_VARIABLE_DECLARATIONS_AVAILABLE := $(call check_flag, -Wmissing-variable-declarations)
+else
+export WMISSING_VARIABLE_DECLARATIONS_AVAILABLE := n
+endif
+else
+export WMISSING_VARIABLE_DECLARATIONS_AVAILABLE
+endif
+
+ifeq ($(WFLOAT_EQUAL_AVAILABLE),)
+ifeq ($(IS_ICC), n)
+export WFLOAT_EQUAL_AVAILABLE := $(call check_flag, -Wfloat-equal)
+else
+export WFLOAT_EQUAL_AVAILABLE := n
+endif
+else
+export WFLOAT_EQUAL_AVAILABLE
+endif
+
+ifeq ($(WSWITCH_DEFAULT_AVAILABLE),)
+ifeq ($(IS_ICC), n)
+export WSWITCH_DEFAULT_AVAILABLE := $(call check_flag, -Wswitch-default)
+else
+export WSWITCH_DEFAULT_AVAILABLE := n
+endif
+else
+export WSWITCH_DEFAULT_AVAILABLE
+endif
+
+ifeq ($(WCAST_FUNCTION_TYPE_AVAILABLE),)
+ifeq ($(IS_ICC), n)
+export WCAST_FUNCTION_TYPE_AVAILABLE := $(call check_flag, -Wcast-function-type)
+else
+export WCAST_FUNCTION_TYPE_AVAILABLE := n
+endif
+else
+export WCAST_FUNCTION_TYPE_AVAILABLE
+endif
+
+ifeq ($(WSTRINGOP_TRUNCATION_AVAILABLE),)
+export WSTRINGOP_TRUNCATION_AVAILABLE := $(call check_flag, -Wstringop-truncation)
+else
+export WSTRINGOP_TRUNCATION_AVAILABLE
+endif
+
+ifeq ($(OG_AVAILABLE),)
+export OG_AVAILABLE := $(call check_flag, -Og)
+else
+export OG_AVAILABLE
+endif
+
+install_recursive = $(shell cd $(1) && find . -type f -exec install -m $(2) -D {} $(3)/{} \;)
+
+install_recursive_filter = $(shell cd $(1) && find . -type f -name "$(2)" -exec install -m $(3) -D {} $(4)/{} \;)
+
+define create-deps
+       @cp $(objdir)/$*.d $(objdir)/.deps/$*.P; \
+       sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
+           -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/.deps/$*.P; \
+       $(RM) -f $(objdir)/$*.d
+endef
+
+check_defined = \
+    $(strip $(foreach 1,$1, \
+        $(call __check_defined,$1,$(strip $(value 2)))))
+
+__check_defined = \
+    $(if $(value $1),, \
+      $(error Undefined $1$(if $2, ($2))))
+
+export prefix = /usr/local
+export exec_prefix := $(prefix)
+export sysconfdir := $(prefix)/etc
+export datarootdir := $(prefix)/share
+export mandir := $(datarootdir)/man
+export docdir := $(datarootdir)/doc
+export man1dir := $(mandir)/man1
+export man3dir := $(mandir)/man3
+export man5dir := $(mandir)/man5
+export man7dir := $(mandir)/man7
+export cstyle_bin := $(CSTYLE)
+export clang_format_bin := $(CLANG_FORMAT)
+export flake8_bin := $(FLAKE8)
+
+ifneq ($(wildcard $(exec_prefix)/x86_64-linux-gnu),)
+LIB_PREFIX ?= x86_64-linux-gnu/lib
+endif
+
+ifneq ($(wildcard $(exec_prefix)/lib64),)
+LIB_PREFIX ?= lib64
+endif
+
+LIB_PREFIX ?= lib
+
+all:
+
+cstyle-%:
+       $(STYLE_CHECK) $* $(wildcard *.[ch]) $(wildcard *.[ch]pp) $(wildcard *.py)
+
+cstyle: cstyle-check
+
+format: cstyle-format
+
+ifeq ($(CSTYLEON),1)
+define check-cstyle
+       @$(STYLE_CHECK) check $1 && if [ "$2" != "" ]; then mkdir -p `dirname $2` && touch $2; fi
+endef
+else ifeq ($(CSTYLEON),2)
+define check-cstyle
+       @$(STYLE_CHECK) check $1 && if [ "$2" != "" ]; then mkdir -p `dirname $2` && touch $2; fi || true
+endef
+else
+define check-cstyle
+endef
+endif
+
+define check-os
+$(CHECK_OS) $(OS_BANNED) $(1) $(2)
+endef
+
+# XXX: to allow gcov tool to connect coverage with source code, we have to
+# use absolute path to source files
+ifeq ($(COVERAGE),1)
+define coverage-path
+`readlink -f $(1)`
+endef
+else
+define coverage-path
+$(1)
+endef
+endif
+
+define sub-target-foreach
+$(1)-$(2):
+       $$(MAKE) -C $1 $2
+ifeq ($(3),y)
+ifeq ($(custom_build),)
+       $$(MAKE) -C $1 $2 DEBUG=1
+endif
+endif
+endef
+
+define sub-target
+$(foreach f, $(1), $(eval $(call sub-target-foreach, $f,$(2),$(3))))
+endef
+
+ifneq ($(wildcard $(prefix)/x86_64-linux-gnu),)
+INC_PREFIX ?= x86_64-linux-gnu/include
+endif
+
+INC_PREFIX ?= include
+
+test_build=$(addprefix "-b ", $(TEST_BUILD))
+test_type=$(addprefix " -t ", $(TEST_TYPE))
+test_fs=$(addprefix " -f ", $(TEST_FS))
+test_time=$(addprefix " -o ", $(TEST_TIME))
+test_memcheck=$(addprefix " -m ", $(MEMCHECK))
+test_pmemcheck=$(addprefix " -p ", $(PMEMCHECK))
+test_helgrind=$(addprefix " -e ", $(HELGRIND))
+test_drd=$(addprefix " -d ", $(DRD))
+test_providers=$(addprefix " -q ", $(TEST_PROVIDERS))
+test_pmethods=$(addprefix " -r ", $(TEST_PMETHODS))
+
+ifeq ($(CHECK_POOL),y)
+test_check_pool=" -c "
+endif
+
+RUNTEST_OPTIONS := "$(test_build)$(test_type)$(test_fs)$(test_time)"
+RUNTEST_OPTIONS += "$(test_memcheck)$(test_pmemcheck)$(test_helgrind)$(test_drd)"
+RUNTEST_OPTIONS += "$(test_providers)$(test_pmethods)$(test_check_pool)"
+
+export libdir := $(exec_prefix)/$(LIB_PREFIX)
+export includedir := $(prefix)/$(INC_PREFIX)
+export pkgconfigdir := $(libdir)/pkgconfig
+export bindir := $(exec_prefix)/bin
+export bashcompdir := $(sysconfdir)/bash_completion.d
+
+LIBFABRIC_MIN_VERSION := 1.4.2
+
+# Keep in sync with requirements in src/test/unittest/unittest.sh and
+# utils/docker/images/install-libfabric.sh.
+ifeq ($(BUILD_RPMEM),)
+BUILD_RPMEM := $(call check_package, libfabric --atleast-version=$(LIBFABRIC_MIN_VERSION))
+endif
+ifneq ($(BUILD_RPMEM),y)
+export BUILD_RPMEM_INFO := libfabric (version >= $(LIBFABRIC_MIN_VERSION)) is missing -- \
+see src/librpmem/README for details
+else
+LIBFABRIC_CFLAGS := $(shell $(PKG_CONFIG) --cflags libfabric)
+LIBFABRIC_LD_LIBRARY_PATHS := $(shell $(PKG_CONFIG) --variable=libdir libfabric)
+LIBFABRIC_LIBS := $(shell $(PKG_CONFIG) --libs libfabric)
+LIBFABRIC_PATH := $(shell $(PKG_CONFIG) --variable=exec_prefix libfabric)/bin
+endif
+export BUILD_RPMEM
+export LIBFABRIC_CFLAGS
+export LIBFABRIC_LD_LIBRARY_PATHS
+export LIBFABRIC_LIBS
+export LIBFABRIC_PATH
+
+# unsafe shutdown count and badblock access without root (depends on kernel 4.20)
+NDCTL_MIN_VERSION := 63
+
+sparse-c = $(shell for c in *.c; do sparse -Wsparse-all -Wno-declaration-after-statement $(CFLAGS) $(INCS) $$c || true; done)
+
+ifeq ($(USE_LIBUNWIND),)
+export USE_LIBUNWIND := $(call check_package, libunwind)
+ifeq ($(USE_LIBUNWIND),y)
+export LIBUNWIND_LIBS := $(shell $(PKG_CONFIG) --libs libunwind)
+endif
+else
+export USE_LIBUNWIND
+export LIBUNWIND_LIBS
+endif
+
+ifeq ($(OS_KERNEL_NAME),FreeBSD)
+
+GLIBC_CXXFLAGS=-D_GLIBCXX_USE_C99
+UNIX98_CFLAGS=
+OS_INCS=-I$(TOP)/src/freebsd/include -I/usr/local/include
+OS_LIBS=-L/usr/local/lib
+LIBDL=
+LIBUTIL=-lutil
+LIBUUID=-luuid
+LIBNDCTL=
+OS_DIMM=none
+
+else
+
+GLIBC_CXXFLAGS=
+UNIX98_CFLAGS=-D__USE_UNIX98
+OS_INCS=
+OS_LIBS=
+LIBDL=-ldl
+LIBUTIL=
+LIBUUID=
+
+NDCTL_ENABLE ?= y
+
+# Detect libndctl if not disabled.
+ifeq ($(NDCTL_ENABLE),y)
+    ifeq ($(LIBNDCTL_LIBS),)
+        HAS_NDCTL :=  $(call check_package, libndctl --atleast-version $(NDCTL_MIN_VERSION))
+        ifeq ($(HAS_NDCTL),y)
+            OS_DIMM_CFLAG=-DNDCTL_ENABLED=1
+        else
+            $(error Please install libndctl-dev/libndctl-devel >= $(NDCTL_MIN_VERSION))
+        endif
+        HAS_DAXCTL := $(call check_package, libdaxctl --atleast-version $(NDCTL_MIN_VERSION))
+        ifeq ($(HAS_DAXCTL),n)
+            $(error Please install libdaxctl-dev/libdaxctl-devel >= $(NDCTL_MIN_VERSION))
+        endif
+        LIBNDCTL_PKG_CONFIG_DEPS := libndctl libdaxctl
+        LIBNDCTL_PKG_CONFIG_DEPS_VAR := ,libndctl,libdaxctl
+        LIBNDCTL_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(LIBNDCTL_PKG_CONFIG_DEPS))
+        LIBNDCTL_LD_LIBRARY_PATHS := $(shell $(PKG_CONFIG) --variable=libdir $(LIBNDCTL_PKG_CONFIG_DEPS) | sed "s/ /:/")
+        LIBNDCTL_LIBS := $(shell $(PKG_CONFIG) --libs $(LIBNDCTL_PKG_CONFIG_DEPS))
+    endif
+    OS_DIMM := ndctl
+else
+    OS_DIMM := none
+endif
+export OS_DIMM
+export LIBNDCTL_PKG_CONFIG_DEPS
+export LIBNDCTL_PKG_CONFIG_DEPS_VAR
+export LIBNDCTL_CFLAGS
+export LIBNDCTL_LD_LIBRARY_PATHS
+export LIBNDCTL_LIBS
+export OS_DIMM_CFLAG
+
+endif
diff --git a/ceph/src/pmdk/src/common/.cstyleignore b/ceph/src/pmdk/src/common/.cstyleignore
new file mode 100644 (file)
index 0000000..ff1e081
--- /dev/null
@@ -0,0 +1 @@
+queue.h
diff --git a/ceph/src/pmdk/src/common/Makefile b/ceph/src/pmdk/src/common/Makefile
new file mode 100644 (file)
index 0000000..535b108
--- /dev/null
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2019, Intel Corporation
+
+#
+# src/common/Makefile -- Makefile for common
+#
+
+LIBRARY_NAME = pmemcommon
+
+include pmemcommon.inc
+
+include ../Makefile.inc
+
+CFLAGS += $(LIBNDCTL_CFLAGS)
+CFLAGS += -DUSE_LIBDL
diff --git a/ceph/src/pmdk/src/common/bad_blocks.c b/ceph/src/pmdk/src/common/bad_blocks.c
new file mode 100644 (file)
index 0000000..28bf284
--- /dev/null
@@ -0,0 +1,264 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * bad_blocks.c - implementation of the bad block API using libpmem2 library
+ */
+
+#include <fcntl.h>
+#include <errno.h>
+
+#include "libpmem2.h"
+#include "badblocks.h"
+#include "out.h"
+#include "vec.h"
+#include "os.h"
+
+/*
+ * badblocks_count -- returns number of bad blocks in the file
+ *                    or -1 in case of an error
+ */
+long
+badblocks_count(const char *file)
+{
+       LOG(3, "file %s", file);
+
+       struct badblocks *bbs = badblocks_new();
+       if (bbs == NULL)
+               return -1;
+
+       int ret = badblocks_get(file, bbs);
+
+       long count = (ret == 0) ? (long)bbs->bb_cnt : -1;
+
+       badblocks_delete(bbs);
+
+       return count;
+}
+
+/*
+ * badblocks_get -- returns 0 and bad blocks in the 'bbs' array
+ *                  (that has to be pre-allocated)
+ *                  or -1 in case of an error
+ */
+int
+badblocks_get(const char *file, struct badblocks *bbs)
+{
+       LOG(3, "file %s badblocks %p", file, bbs);
+
+       ASSERTne(bbs, NULL);
+
+       struct pmem2_source *src;
+       struct pmem2_badblock_context *bbctx;
+       struct pmem2_badblock bb;
+       int bb_found = -1; /* -1 means an error */
+       int ret;
+
+       VEC(bbsvec, struct bad_block) bbv = VEC_INITIALIZER;
+       memset(bbs, 0, sizeof(*bbs));
+
+       int fd = os_open(file, O_RDONLY);
+       if (fd == -1) {
+               ERR("!open %s", file);
+               return -1;
+       }
+
+       ret = pmem2_source_from_fd(&src, fd);
+       if (ret)
+               goto exit_close;
+
+       ret = pmem2_badblock_context_new(&bbctx, src);
+       if (ret)
+               goto exit_delete_source;
+
+       bb_found = 0;
+       while ((pmem2_badblock_next(bbctx, &bb)) == 0) {
+               bb_found++;
+               /*
+                * Form a new bad block structure with offset and length
+                * expressed in bytes and offset relative
+                * to the beginning of the file.
+                */
+               struct bad_block bbn;
+               bbn.offset = bb.offset;
+               bbn.length = bb.length;
+               /* unknown healthy replica */
+               bbn.nhealthy = NO_HEALTHY_REPLICA;
+
+               /* add the new bad block to the vector */
+               if (VEC_PUSH_BACK(&bbv, bbn)) {
+                       VEC_DELETE(&bbv);
+                       bb_found = -1;
+                       Free(bbs->bbv);
+                       bbs->bbv = NULL;
+                       bbs->bb_cnt = 0;
+               }
+       }
+
+       if (bb_found > 0) {
+               bbs->bbv = VEC_ARR(&bbv);
+               bbs->bb_cnt = (unsigned)VEC_SIZE(&bbv);
+
+               LOG(10, "number of bad blocks detected: %u", bbs->bb_cnt);
+
+               /* sanity check */
+               ASSERTeq((unsigned)bb_found, bbs->bb_cnt);
+       }
+
+       pmem2_badblock_context_delete(&bbctx);
+
+exit_delete_source:
+       pmem2_source_delete(&src);
+
+exit_close:
+       if (fd != -1)
+               os_close(fd);
+
+       if (ret && bb_found == -1)
+               errno = pmem2_err_to_errno(ret);
+
+       return (bb_found >= 0) ? 0 : -1;
+}
+
+/*
+ * badblocks_clear -- clears the given bad blocks in a file
+ *                    (regular file or dax device)
+ */
+int
+badblocks_clear(const char *file, struct badblocks *bbs)
+{
+       LOG(3, "file %s badblocks %p", file, bbs);
+
+       ASSERTne(bbs, NULL);
+
+       struct pmem2_source *src;
+       struct pmem2_badblock_context *bbctx;
+       struct pmem2_badblock bb;
+       int ret = -1;
+
+       int fd = os_open(file, O_RDWR);
+       if (fd == -1) {
+               ERR("!open %s", file);
+               return -1;
+       }
+
+       ret = pmem2_source_from_fd(&src, fd);
+       if (ret)
+               goto exit_close;
+
+       ret = pmem2_badblock_context_new(&bbctx, src);
+       if (ret) {
+               LOG(1, "pmem2_badblock_context_new failed -- %s", file);
+               goto exit_delete_source;
+       }
+
+       for (unsigned b = 0; b < bbs->bb_cnt; b++) {
+               bb.offset = bbs->bbv[b].offset;
+               bb.length = bbs->bbv[b].length;
+               ret = pmem2_badblock_clear(bbctx, &bb);
+               if (ret) {
+                       LOG(1, "pmem2_badblock_clear -- %s", file);
+                       goto exit_delete_ctx;
+               }
+       }
+
+exit_delete_ctx:
+       pmem2_badblock_context_delete(&bbctx);
+
+exit_delete_source:
+       pmem2_source_delete(&src);
+
+exit_close:
+       if (fd != -1)
+               os_close(fd);
+
+       if (ret) {
+               errno = pmem2_err_to_errno(ret);
+               ret = -1;
+       }
+
+       return ret;
+}
+
+/*
+ * badblocks_clear_all -- clears all bad blocks in a file
+ *                        (regular file or dax device)
+ */
+int
+badblocks_clear_all(const char *file)
+{
+       LOG(3, "file %s", file);
+
+       struct pmem2_source *src;
+       struct pmem2_badblock_context *bbctx;
+       struct pmem2_badblock bb;
+       int ret = -1;
+
+       int fd = os_open(file, O_RDWR);
+       if (fd == -1) {
+               ERR("!open %s", file);
+               return -1;
+       }
+
+       ret = pmem2_source_from_fd(&src, fd);
+       if (ret)
+               goto exit_close;
+
+       ret = pmem2_badblock_context_new(&bbctx, src);
+       if (ret) {
+               LOG(1, "pmem2_badblock_context_new failed -- %s", file);
+               goto exit_delete_source;
+       }
+
+       while ((pmem2_badblock_next(bbctx, &bb)) == 0) {
+               ret = pmem2_badblock_clear(bbctx, &bb);
+               if (ret) {
+                       LOG(1, "pmem2_badblock_clear -- %s", file);
+                       goto exit_delete_ctx;
+               }
+       };
+
+exit_delete_ctx:
+       pmem2_badblock_context_delete(&bbctx);
+
+exit_delete_source:
+       pmem2_source_delete(&src);
+
+exit_close:
+       if (fd != -1)
+               os_close(fd);
+
+       if (ret) {
+               errno = pmem2_err_to_errno(ret);
+               ret = -1;
+       }
+
+       return ret;
+}
+
+/*
+ * badblocks_check_file -- check if the file contains bad blocks
+ *
+ * Return value:
+ * -1 : an error
+ *  0 : no bad blocks
+ *  1 : bad blocks detected
+ */
+int
+badblocks_check_file(const char *file)
+{
+       LOG(3, "file %s", file);
+
+       long bbsc = badblocks_count(file);
+       if (bbsc < 0) {
+               LOG(1, "counting bad blocks failed -- '%s'", file);
+               return -1;
+       }
+
+       if (bbsc > 0) {
+               LOG(1, "pool file '%s' contains %li bad block(s)", file, bbsc);
+               return 1;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/badblocks.h b/ceph/src/pmdk/src/common/badblocks.h
new file mode 100644 (file)
index 0000000..d06e81a
--- /dev/null
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * badblocks.h -- bad blocks API based on the libpmem2 library
+ */
+
+#ifndef PMDK_BADBLOCKS_H
+#define PMDK_BADBLOCKS_H 1
+
+#include <string.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define B2SEC(n) ((n) >> 9)    /* convert bytes to sectors */
+#define SEC2B(n) ((n) << 9)    /* convert sectors to bytes */
+
+#define NO_HEALTHY_REPLICA ((int)(-1))
+
+#define BB_NOT_SUPP \
+       "checking bad blocks is not supported on this OS, please switch off the CHECK_BAD_BLOCKS compat feature using 'pmempool-feature'"
+
+/*
+ * 'struct badblock' is already defined in ndctl/libndctl.h,
+ * so we cannot use this name.
+ *
+ * libndctl returns offset relative to the beginning of the region,
+ * but in this structure we save offset relative to the beginning of:
+ * - namespace (before badblocks_get())
+ * and
+ * - file (before sync_recalc_badblocks())
+ * and
+ * - pool (after sync_recalc_badblocks())
+ */
+struct bad_block {
+       /*
+        * offset in bytes relative to the beginning of
+        *  - namespace (before badblocks_get())
+        * and
+        *  - file (before sync_recalc_badblocks())
+        * and
+        *  - pool (after sync_recalc_badblocks())
+        */
+       size_t offset;
+
+       /* length in bytes */
+       size_t length;
+
+       /* number of healthy replica to fix this bad block */
+       int nhealthy;
+};
+
+struct badblocks {
+       unsigned bb_cnt;                /* number of bad blocks */
+       struct bad_block *bbv;  /* array of bad blocks */
+};
+
+struct badblocks *badblocks_new(void);
+void badblocks_delete(struct badblocks *bbs);
+
+long badblocks_count(const char *path);
+int badblocks_get(const char *file, struct badblocks *bbs);
+
+int badblocks_clear(const char *path, struct badblocks *bbs);
+int badblocks_clear_all(const char *file);
+
+int badblocks_check_file(const char *path);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_BADBLOCKS_H */
diff --git a/ceph/src/pmdk/src/common/common.rc b/ceph/src/pmdk/src/common/common.rc
new file mode 100644 (file)
index 0000000..96d0e09
--- /dev/null
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2017, Intel Corporation */
+
+/*
+ * common.rc -- common part of PMDK rc files
+ */
+
+#include <windows.h>
+#include "srcversion.h"
+
+#define VERSION(major, minor, build, revision) major, minor, build, revision
+
+#ifdef _DEBUG
+#define VERSION_DEBUG VS_FF_DEBUG
+#else
+#define VERSION_DEBUG 0
+#endif
+
+#ifdef PRERELEASE
+#define VERSION_PRERELEASE VS_FF_PRERELEASE
+#else
+#define VERSION_PRERELEASE 0
+#endif
+
+#ifdef BUGFIX
+#define VERSION_PATCHED VS_FF_PATCHED
+#else
+#define VERSION_PATCHED 0
+#endif
+
+#ifdef PRIVATE
+#define VERSION_PRIVATE VS_FF_PRIVATE
+#else
+#define VERSION_PRIVATE 0
+#endif
+
+#ifdef CUSTOM
+#define VERSION_SPECIAL VS_FF_SPECIALBUILD
+#else
+#define VERSION_SPECIAL 0
+#endif
+
+#define VERSION_PRIVATEBUILD VS_FF_PRIVATEBUILD
+#define VER_PATCHED VS_FF_PATCHED
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION    VERSION(MAJOR, MINOR, BUILD, REVISION)
+PRODUCTVERSION VERSION(MAJOR, MINOR, BUILD, REVISION)
+FILEFLAGSMASK  VS_FFI_FILEFLAGSMASK
+FILEFLAGS      (VERSION_PRIVATEBUILD | VERSION_PRERELEASE | VERSION_DEBUG | VERSION_SPECIAL | VERSION_PATCHED)
+FILEOS         VOS__WINDOWS32
+FILETYPE       TYPE
+FILESUBTYPE    VFT2_UNKNOWN
+BEGIN
+       BLOCK "StringFileInfo"
+       BEGIN
+                BLOCK "040904b0"
+                BEGIN
+                       VALUE "CompanyName", "Intel"
+                       VALUE "FileDescription", DESCRIPTION
+                       VALUE "FileVersion", SRCVERSION
+                       VALUE "InternalName", "PMDK"
+                       VALUE "LegalCopyright", "Copyright 2014-2017, Intel Corporation"
+                       VALUE "OriginalFilename", FILE_NAME
+                       VALUE "ProductName", "Persistent Memory Development Kit"
+                       VALUE "ProductVersion", SRCVERSION
+#if VERSION_SPECIAL == VS_FF_SPECIALBUILD
+                       VALUE "SpecialBuild", VERSION_CUSTOM_MSG
+#endif
+#if VERSION_PRIVATEBUILD == VS_FF_SPECIALBUILD
+                       VALUE "PrivateBuild", "Not a release build"
+#endif
+                END
+       END
+       BLOCK "VarFileInfo"
+       BEGIN
+                       /* XXX: Update to UNICODE */
+                       VALUE "Translation", 0x409, 0
+       END
+END
diff --git a/ceph/src/pmdk/src/common/ctl.c b/ceph/src/pmdk/src/common/ctl.c
new file mode 100644 (file)
index 0000000..d6afba8
--- /dev/null
@@ -0,0 +1,578 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * ctl.c -- implementation of the interface for examination and modification of
+ *     the library's internal state
+ */
+#include "ctl.h"
+#include "os.h"
+#include "alloc.h"
+
+#define CTL_MAX_ENTRIES 100
+
+#define MAX_CONFIG_FILE_LEN (1 << 20) /* 1 megabyte */
+
+#define CTL_STRING_QUERY_SEPARATOR ";"
+#define CTL_NAME_VALUE_SEPARATOR "="
+#define CTL_QUERY_NODE_SEPARATOR "."
+#define CTL_VALUE_ARG_SEPARATOR ","
+
+static int ctl_global_first_free = 0;
+static struct ctl_node CTL_NODE(global)[CTL_MAX_ENTRIES];
+
+/*
+ * This is the top level node of the ctl tree structure. Each node can contain
+ * children and leaf nodes.
+ *
+ * Internal nodes simply create a new path in the tree whereas child nodes are
+ * the ones providing the read/write functionality by the means of callbacks.
+ *
+ * Each tree node must be NULL-terminated, CTL_NODE_END macro is provided for
+ * convenience.
+ */
+struct ctl {
+       struct ctl_node root[CTL_MAX_ENTRIES];
+       int first_free;
+};
+
+/*
+ * ctl_find_node -- (internal) searches for a matching entry point in the
+ *     provided nodes
+ *
+ * The caller is responsible for freeing all of the allocated indexes,
+ * regardless of the return value.
+ */
+static const struct ctl_node *
+ctl_find_node(const struct ctl_node *nodes, const char *name,
+       struct ctl_indexes *indexes)
+{
+       LOG(3, "nodes %p name %s indexes %p", nodes, name, indexes);
+
+       const struct ctl_node *n = NULL;
+       char *sptr = NULL;
+       char *parse_str = Strdup(name);
+       if (parse_str == NULL)
+               return NULL;
+
+       char *node_name = strtok_r(parse_str, CTL_QUERY_NODE_SEPARATOR, &sptr);
+
+       /*
+        * Go through the string and separate tokens that correspond to nodes
+        * in the main ctl tree.
+        */
+       while (node_name != NULL) {
+               char *endptr;
+               /*
+                * Ignore errno from strtol: FreeBSD returns EINVAL if no
+                * conversion is performed. Linux does not, but endptr
+                * check is valid in both cases.
+                */
+               int tmp_errno = errno;
+               long index_value = strtol(node_name, &endptr, 0);
+               errno = tmp_errno;
+               struct ctl_index *index_entry = NULL;
+               if (endptr != node_name) { /* a valid index */
+                       index_entry = Malloc(sizeof(*index_entry));
+                       if (index_entry == NULL)
+                               goto error;
+                       index_entry->value = index_value;
+                       PMDK_SLIST_INSERT_HEAD(indexes, index_entry, entry);
+               }
+
+               for (n = &nodes[0]; n->name != NULL; ++n) {
+                       if (index_entry && n->type == CTL_NODE_INDEXED)
+                               break;
+                       else if (strcmp(n->name, node_name) == 0)
+                               break;
+               }
+               if (n->name == NULL)
+                       goto error;
+
+               if (index_entry)
+                       index_entry->name = n->name;
+
+               nodes = n->children;
+               node_name = strtok_r(NULL, CTL_QUERY_NODE_SEPARATOR, &sptr);
+       }
+
+       Free(parse_str);
+       return n;
+
+error:
+       Free(parse_str);
+       return NULL;
+}
+
+/*
+ * ctl_delete_indexes --
+ *     (internal) removes and frees all entries on the index list
+ */
+static void
+ctl_delete_indexes(struct ctl_indexes *indexes)
+{
+       while (!PMDK_SLIST_EMPTY(indexes)) {
+               struct ctl_index *index = PMDK_SLIST_FIRST(indexes);
+               PMDK_SLIST_REMOVE_HEAD(indexes, entry);
+               Free(index);
+       }
+}
+
+/*
+ * ctl_parse_args -- (internal) parses a string argument based on the node
+ *     structure
+ */
+static void *
+ctl_parse_args(const struct ctl_argument *arg_proto, char *arg)
+{
+       ASSERTne(arg, NULL);
+
+       char *dest_arg = Malloc(arg_proto->dest_size);
+       if (dest_arg == NULL) {
+               ERR("!Malloc");
+               return NULL;
+       }
+
+       char *sptr = NULL;
+       char *arg_sep = strtok_r(arg, CTL_VALUE_ARG_SEPARATOR, &sptr);
+       for (const struct ctl_argument_parser *p = arg_proto->parsers;
+                       p->parser != NULL; ++p) {
+               ASSERT(p->dest_offset + p->dest_size <= arg_proto->dest_size);
+               if (arg_sep == NULL) {
+                       ERR("!strtok_r");
+                       goto error_parsing;
+               }
+
+               if (p->parser(arg_sep, dest_arg + p->dest_offset,
+                       p->dest_size) != 0)
+                       goto error_parsing;
+
+               arg_sep = strtok_r(NULL, CTL_VALUE_ARG_SEPARATOR, &sptr);
+       }
+
+       return dest_arg;
+
+error_parsing:
+       Free(dest_arg);
+       return NULL;
+}
+
+/*
+ * ctl_query_get_real_args -- (internal) returns a pointer with actual argument
+ *     structure as required by the node callback
+ */
+static void *
+ctl_query_get_real_args(const struct ctl_node *n, void *write_arg,
+       enum ctl_query_source source)
+{
+       void *real_arg = NULL;
+       switch (source) {
+               case CTL_QUERY_CONFIG_INPUT:
+                       real_arg = ctl_parse_args(n->arg, write_arg);
+                       break;
+               case CTL_QUERY_PROGRAMMATIC:
+                       real_arg = write_arg;
+                       break;
+               default:
+                       ASSERT(0);
+                       break;
+       }
+
+       return real_arg;
+}
+
+/*
+ * ctl_query_cleanup_real_args -- (internal) cleanups relevant argument
+ *     structures allocated as a result of the get_real_args call
+ */
+static void
+ctl_query_cleanup_real_args(const struct ctl_node *n, void *real_arg,
+       enum ctl_query_source source)
+{
+       switch (source) {
+               case CTL_QUERY_CONFIG_INPUT:
+                       Free(real_arg);
+                       break;
+               case CTL_QUERY_PROGRAMMATIC:
+                       break;
+               default:
+                       ASSERT(0);
+                       break;
+       }
+}
+
+/*
+ * ctl_exec_query_read -- (internal) calls the read callback of a node
+ */
+static int
+ctl_exec_query_read(void *ctx, const struct ctl_node *n,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       if (arg == NULL) {
+               ERR("read queries require non-NULL argument");
+               errno = EINVAL;
+               return -1;
+       }
+
+       return n->cb[CTL_QUERY_READ](ctx, source, arg, indexes);
+}
+
+/*
+ * ctl_exec_query_write -- (internal) calls the write callback of a node
+ */
+static int
+ctl_exec_query_write(void *ctx, const struct ctl_node *n,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       if (arg == NULL) {
+               ERR("write queries require non-NULL argument");
+               errno = EINVAL;
+               return -1;
+       }
+
+       void *real_arg = ctl_query_get_real_args(n, arg, source);
+       if (real_arg == NULL) {
+               LOG(1, "Invalid arguments");
+               return -1;
+       }
+
+       int ret = n->cb[CTL_QUERY_WRITE](ctx, source, real_arg, indexes);
+       ctl_query_cleanup_real_args(n, real_arg, source);
+
+       return ret;
+}
+
+/*
+ * ctl_exec_query_runnable -- (internal) calls the run callback of a node
+ */
+static int
+ctl_exec_query_runnable(void *ctx, const struct ctl_node *n,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       return n->cb[CTL_QUERY_RUNNABLE](ctx, source, arg, indexes);
+}
+
+static int (*ctl_exec_query[MAX_CTL_QUERY_TYPE])(void *ctx,
+       const struct ctl_node *n, enum ctl_query_source source, void *arg,
+       struct ctl_indexes *indexes) = {
+       ctl_exec_query_read,
+       ctl_exec_query_write,
+       ctl_exec_query_runnable,
+};
+
+/*
+ * ctl_query -- (internal) parses the name and calls the appropriate methods
+ *     from the ctl tree
+ */
+int
+ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
+       const char *name, enum ctl_query_type type, void *arg)
+{
+       LOG(3, "ctl %p ctx %p source %d name %s type %d arg %p",
+                       ctl, ctx, source, name, type, arg);
+
+       if (name == NULL) {
+               ERR("invalid query");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * All of the indexes are put on this list so that the handlers can
+        * easily retrieve the index values. The list is cleared once the ctl
+        * query has been handled.
+        */
+       struct ctl_indexes indexes;
+       PMDK_SLIST_INIT(&indexes);
+
+       int ret = -1;
+
+       const struct ctl_node *n = ctl_find_node(CTL_NODE(global),
+               name, &indexes);
+
+       if (n == NULL && ctl) {
+               ctl_delete_indexes(&indexes);
+               n = ctl_find_node(ctl->root, name, &indexes);
+       }
+
+       if (n == NULL || n->type != CTL_NODE_LEAF || n->cb[type] == NULL) {
+               ERR("invalid query entry point %s", name);
+               errno = EINVAL;
+               goto out;
+       }
+
+       ret = ctl_exec_query[type](ctx, n, source, arg, &indexes);
+
+out:
+       ctl_delete_indexes(&indexes);
+
+       return ret;
+}
+
+/*
+ * ctl_register_module_node -- adds a new node to the CTL tree root.
+ */
+void
+ctl_register_module_node(struct ctl *c, const char *name, struct ctl_node *n)
+{
+       struct ctl_node *nnode = c == NULL ?
+               &CTL_NODE(global)[ctl_global_first_free++] :
+               &c->root[c->first_free++];
+
+       nnode->children = n;
+       nnode->type = CTL_NODE_NAMED;
+       nnode->name = name;
+}
+
+/*
+ * ctl_parse_query -- (internal) splits an entire query string
+ *     into name and value
+ */
+static int
+ctl_parse_query(char *qbuf, char **name, char **value)
+{
+       if (qbuf == NULL)
+               return -1;
+
+       char *sptr;
+       *name = strtok_r(qbuf, CTL_NAME_VALUE_SEPARATOR, &sptr);
+       if (*name == NULL)
+               return -1;
+
+       *value = strtok_r(NULL, CTL_NAME_VALUE_SEPARATOR, &sptr);
+       if (*value == NULL)
+               return -1;
+
+       /* the value itself mustn't include CTL_NAME_VALUE_SEPARATOR */
+       char *extra = strtok_r(NULL, CTL_NAME_VALUE_SEPARATOR, &sptr);
+       if (extra != NULL)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * ctl_load_config -- executes the entire query collection from a provider
+ */
+static int
+ctl_load_config(struct ctl *ctl, void *ctx, char *buf)
+{
+       int r = 0;
+       char *sptr = NULL; /* for internal use of strtok */
+       char *name;
+       char *value;
+
+       ASSERTne(buf, NULL);
+
+       char *qbuf = strtok_r(buf, CTL_STRING_QUERY_SEPARATOR, &sptr);
+       while (qbuf != NULL) {
+               r = ctl_parse_query(qbuf, &name, &value);
+               if (r != 0) {
+                       ERR("failed to parse query %s", qbuf);
+                       return -1;
+               }
+
+               r = ctl_query(ctl, ctx, CTL_QUERY_CONFIG_INPUT,
+                               name, CTL_QUERY_WRITE, value);
+
+               if (r < 0 && ctx != NULL)
+                       return -1;
+
+               qbuf = strtok_r(NULL, CTL_STRING_QUERY_SEPARATOR, &sptr);
+       }
+
+       return 0;
+}
+
+/*
+ * ctl_load_config_from_string -- loads obj configuration from string
+ */
+int
+ctl_load_config_from_string(struct ctl *ctl, void *ctx, const char *cfg_string)
+{
+       LOG(3, "ctl %p ctx %p cfg_string \"%s\"", ctl, ctx, cfg_string);
+
+       char *buf = Strdup(cfg_string);
+       if (buf == NULL) {
+               ERR("!Strdup");
+               return -1;
+       }
+
+       int ret = ctl_load_config(ctl, ctx, buf);
+
+       Free(buf);
+       return ret;
+}
+
+/*
+ * ctl_load_config_from_file -- loads obj configuration from file
+ *
+ * This function opens up the config file, allocates a buffer of size equal to
+ * the size of the file, reads its content and sanitizes it for ctl_load_config.
+ */
+int
+ctl_load_config_from_file(struct ctl *ctl, void *ctx, const char *cfg_file)
+{
+       LOG(3, "ctl %p ctx %p cfg_file \"%s\"", ctl, ctx, cfg_file);
+
+       int ret = -1;
+
+       FILE *fp = os_fopen(cfg_file, "r");
+       if (fp == NULL)
+               return ret;
+
+       int err;
+       if ((err = fseek(fp, 0, SEEK_END)) != 0)
+               goto error_file_parse;
+
+       long fsize = ftell(fp);
+       if (fsize == -1)
+               goto error_file_parse;
+
+       if (fsize > MAX_CONFIG_FILE_LEN) {
+               ERR("Config file too large");
+               goto error_file_parse;
+       }
+
+       if ((err = fseek(fp, 0, SEEK_SET)) != 0)
+               goto error_file_parse;
+
+       char *buf = Zalloc((size_t)fsize + 1); /* +1 for NULL-termination */
+       if (buf == NULL) {
+               ERR("!Zalloc");
+               goto error_file_parse;
+       }
+
+       size_t bufpos = 0;
+
+       int c;
+       int is_comment_section = 0;
+       while ((c = fgetc(fp)) != EOF) {
+               if (c == '#')
+                       is_comment_section = 1;
+               else if (c == '\n')
+                       is_comment_section = 0;
+               else if (!is_comment_section && !isspace(c))
+                       buf[bufpos++] = (char)c;
+       }
+
+       ret = ctl_load_config(ctl, ctx, buf);
+
+       Free(buf);
+
+error_file_parse:
+       (void) fclose(fp);
+       return ret;
+}
+
+/*
+ * ctl_new -- allocates and initializes ctl data structures
+ */
+struct ctl *
+ctl_new(void)
+{
+       struct ctl *c = Zalloc(sizeof(struct ctl));
+       if (c == NULL) {
+               ERR("!Zalloc");
+               return NULL;
+       }
+
+       c->first_free = 0;
+       return c;
+}
+
+/*
+ * ctl_delete -- deletes ctl
+ */
+void
+ctl_delete(struct ctl *c)
+{
+       Free(c);
+}
+
+/*
+ * ctl_parse_ll -- (internal) parses and returns a long long signed integer
+ */
+static long long
+ctl_parse_ll(const char *str)
+{
+       char *endptr;
+       int olderrno = errno;
+       errno = 0;
+       long long val = strtoll(str, &endptr, 0);
+       if (endptr == str || errno != 0)
+               return LLONG_MIN;
+       errno = olderrno;
+
+       return val;
+}
+
+/*
+ * ctl_arg_boolean -- checks whether the provided argument contains
+ *     either a 1 or y or Y.
+ */
+int
+ctl_arg_boolean(const void *arg, void *dest, size_t dest_size)
+{
+       int *intp = dest;
+       char in = ((char *)arg)[0];
+
+       if (tolower(in) == 'y' || in == '1') {
+               *intp = 1;
+               return 0;
+       } else if (tolower(in) == 'n' || in == '0') {
+               *intp = 0;
+               return 0;
+       }
+
+       return -1;
+}
+
+/*
+ * ctl_arg_integer -- parses signed integer argument
+ */
+int
+ctl_arg_integer(const void *arg, void *dest, size_t dest_size)
+{
+       long long val = ctl_parse_ll(arg);
+       if (val == LLONG_MIN)
+               return -1;
+
+       switch (dest_size) {
+               case sizeof(int):
+                       if (val > INT_MAX || val < INT_MIN)
+                               return -1;
+                       *(int *)dest = (int)val;
+                       break;
+               case sizeof(long long):
+                       *(long long *)dest = val;
+                       break;
+               case sizeof(uint8_t):
+                       if (val > UINT8_MAX || val < 0)
+                               return -1;
+                       *(uint8_t *)dest = (uint8_t)val;
+                       break;
+               default:
+                       ERR("invalid destination size %zu", dest_size);
+                       errno = EINVAL;
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * ctl_arg_string -- verifies length and copies a string argument into a zeroed
+ *     buffer
+ */
+int
+ctl_arg_string(const void *arg, void *dest, size_t dest_size)
+{
+       /* check if the incoming string is longer or equal to dest_size */
+       if (strnlen(arg, dest_size) == dest_size)
+               return -1;
+
+       strncpy(dest, arg, dest_size);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/ctl.h b/ceph/src/pmdk/src/common/ctl.h
new file mode 100644 (file)
index 0000000..f70322a
--- /dev/null
@@ -0,0 +1,202 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * ctl.h -- internal declaration of statistics and control related structures
+ */
+
+#ifndef PMDK_CTL_H
+#define PMDK_CTL_H 1
+
+#include "queue.h"
+#include "errno.h"
+#include "out.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ctl;
+
+struct ctl_index {
+       const char *name;
+       long value;
+       PMDK_SLIST_ENTRY(ctl_index) entry;
+};
+
+PMDK_SLIST_HEAD(ctl_indexes, ctl_index);
+
+enum ctl_query_source {
+       CTL_UNKNOWN_QUERY_SOURCE,
+       /* query executed directly from the program */
+       CTL_QUERY_PROGRAMMATIC,
+       /* query executed from the config file */
+       CTL_QUERY_CONFIG_INPUT,
+
+       MAX_CTL_QUERY_SOURCE
+};
+
+enum ctl_query_type {
+       CTL_QUERY_READ,
+       CTL_QUERY_WRITE,
+       CTL_QUERY_RUNNABLE,
+
+       MAX_CTL_QUERY_TYPE
+};
+
+typedef int (*node_callback)(void *ctx, enum ctl_query_source type,
+       void *arg, struct ctl_indexes *indexes);
+
+enum ctl_node_type {
+       CTL_NODE_UNKNOWN,
+       CTL_NODE_NAMED,
+       CTL_NODE_LEAF,
+       CTL_NODE_INDEXED,
+
+       MAX_CTL_NODE
+};
+
+typedef int (*ctl_arg_parser)(const void *arg, void *dest, size_t dest_size);
+
+struct ctl_argument_parser {
+       size_t dest_offset; /* offset of the field inside of the argument */
+       size_t dest_size; /* size of the field inside of the argument */
+       ctl_arg_parser parser;
+};
+
+struct ctl_argument {
+       size_t dest_size; /* sizeof the entire argument */
+       struct ctl_argument_parser parsers[]; /* array of 'fields' in arg */
+};
+
+#define sizeof_member(t, m) sizeof(((t *)0)->m)
+
+#define CTL_ARG_PARSER(t, p)\
+{0, sizeof(t), p}
+
+#define CTL_ARG_PARSER_STRUCT(t, m, p)\
+{offsetof(t, m), sizeof_member(t, m), p}
+
+#define CTL_ARG_PARSER_END {0, 0, NULL}
+
+/*
+ * CTL Tree node structure, do not use directly. All the necessary functionality
+ * is provided by the included macros.
+ */
+struct ctl_node {
+       const char *name;
+       enum ctl_node_type type;
+
+       node_callback cb[MAX_CTL_QUERY_TYPE];
+       const struct ctl_argument *arg;
+
+       const struct ctl_node *children;
+};
+
+struct ctl *ctl_new(void);
+void ctl_delete(struct ctl *stats);
+
+int ctl_load_config_from_string(struct ctl *ctl, void *ctx,
+       const char *cfg_string);
+int ctl_load_config_from_file(struct ctl *ctl, void *ctx,
+       const char *cfg_file);
+
+/* Use through CTL_REGISTER_MODULE, never directly */
+void ctl_register_module_node(struct ctl *c,
+       const char *name, struct ctl_node *n);
+
+int ctl_arg_boolean(const void *arg, void *dest, size_t dest_size);
+#define CTL_ARG_BOOLEAN {sizeof(int),\
+       {{0, sizeof(int), ctl_arg_boolean},\
+       CTL_ARG_PARSER_END}};
+
+int ctl_arg_integer(const void *arg, void *dest, size_t dest_size);
+#define CTL_ARG_INT {sizeof(int),\
+       {{0, sizeof(int), ctl_arg_integer},\
+       CTL_ARG_PARSER_END}};
+
+#define CTL_ARG_LONG_LONG {sizeof(long long),\
+       {{0, sizeof(long long), ctl_arg_integer},\
+       CTL_ARG_PARSER_END}};
+
+int ctl_arg_string(const void *arg, void *dest, size_t dest_size);
+#define CTL_ARG_STRING(len) {len,\
+       {{0, len, ctl_arg_string},\
+       CTL_ARG_PARSER_END}};
+
+#define CTL_STR(name) #name
+
+#define CTL_NODE_END {NULL, CTL_NODE_UNKNOWN, {NULL, NULL, NULL}, NULL, NULL}
+
+#define CTL_NODE(name, ...)\
+ctl_node_##__VA_ARGS__##_##name
+
+int ctl_query(struct ctl *ctl, void *ctx, enum ctl_query_source source,
+               const char *name, enum ctl_query_type type, void *arg);
+
+/* Declaration of a new child node */
+#define CTL_CHILD(name, ...)\
+{CTL_STR(name), CTL_NODE_NAMED, {NULL, NULL, NULL}, NULL,\
+       (struct ctl_node *)CTL_NODE(name, __VA_ARGS__)}
+
+/* Declaration of a new indexed node */
+#define CTL_INDEXED(name, ...)\
+{CTL_STR(name), CTL_NODE_INDEXED, {NULL, NULL, NULL}, NULL,\
+       (struct ctl_node *)CTL_NODE(name, __VA_ARGS__)}
+
+#define CTL_READ_HANDLER(name, ...)\
+ctl_##__VA_ARGS__##_##name##_read
+
+#define CTL_WRITE_HANDLER(name, ...)\
+ctl_##__VA_ARGS__##_##name##_write
+
+#define CTL_RUNNABLE_HANDLER(name, ...)\
+ctl_##__VA_ARGS__##_##name##_runnable
+
+#define CTL_ARG(name)\
+ctl_arg_##name
+
+/*
+ * Declaration of a new read-only leaf. If used the corresponding read function
+ * must be declared by CTL_READ_HANDLER macro.
+ */
+#define CTL_LEAF_RO(name, ...)\
+{CTL_STR(name), CTL_NODE_LEAF, \
+       {CTL_READ_HANDLER(name, __VA_ARGS__), NULL, NULL}, NULL, NULL}
+
+/*
+ * Declaration of a new write-only leaf. If used the corresponding write
+ * function must be declared by CTL_WRITE_HANDLER macro.
+ */
+#define CTL_LEAF_WO(name, ...)\
+{CTL_STR(name), CTL_NODE_LEAF, \
+       {NULL, CTL_WRITE_HANDLER(name, __VA_ARGS__), NULL},\
+       &CTL_ARG(name), NULL}
+
+/*
+ * Declaration of a new runnable leaf. If used the corresponding run
+ * function must be declared by CTL_RUNNABLE_HANDLER macro.
+ */
+#define CTL_LEAF_RUNNABLE(name, ...)\
+{CTL_STR(name), CTL_NODE_LEAF, \
+       {NULL, NULL, CTL_RUNNABLE_HANDLER(name, __VA_ARGS__)},\
+       NULL, NULL}
+
+/*
+ * Declaration of a new read-write leaf. If used both read and write function
+ * must be declared by CTL_READ_HANDLER and CTL_WRITE_HANDLER macros.
+ */
+#define CTL_LEAF_RW(name)\
+{CTL_STR(name), CTL_NODE_LEAF,\
+       {CTL_READ_HANDLER(name), CTL_WRITE_HANDLER(name), NULL},\
+       &CTL_ARG(name), NULL}
+
+#define CTL_REGISTER_MODULE(_ctl, name)\
+ctl_register_module_node((_ctl), CTL_STR(name),\
+(struct ctl_node *)CTL_NODE(name))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/ctl_cow.c b/ceph/src/pmdk/src/common/ctl_cow.c
new file mode 100644 (file)
index 0000000..1ce38e5
--- /dev/null
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, Intel Corporation */
+
+/*
+ * ctl_cow.c -- implementation of the CTL copy on write namespace
+ */
+
+#include "ctl.h"
+#include "set.h"
+#include "out.h"
+#include "ctl_global.h"
+
+/*
+ * CTL_READ_HANDLER(at_open) -- returns at_open field
+ */
+static int
+CTL_READ_HANDLER(at_open)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       int *arg_out = arg;
+       *arg_out = COW_at_open;
+       return 0;
+}
+/*
+ * CTL_WRITE_HANDLER(at_open) -- sets the at_open field in copy_on_write
+ */
+static int
+CTL_WRITE_HANDLER(at_open)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       int arg_in = *(int *)arg;
+       COW_at_open = arg_in;
+       return 0;
+}
+
+static struct ctl_argument CTL_ARG(at_open) = CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(copy_on_write)[] = {
+       CTL_LEAF_RW(at_open),
+
+       CTL_NODE_END
+};
+
+/*
+ * cow_ctl_register -- registers ctl nodes for "copy_on_write" module
+ */
+void
+ctl_cow_register(void)
+{
+       CTL_REGISTER_MODULE(NULL, copy_on_write);
+}
diff --git a/ceph/src/pmdk/src/common/ctl_fallocate.c b/ceph/src/pmdk/src/common/ctl_fallocate.c
new file mode 100644 (file)
index 0000000..ac0af6e
--- /dev/null
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * ctl_fallocate.c -- implementation of the fallocate CTL namespace
+ */
+
+#include "ctl.h"
+#include "set.h"
+#include "out.h"
+#include "ctl_global.h"
+#include "file.h"
+
+static int
+CTL_READ_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int *arg_out = arg;
+       *arg_out = Fallocate_at_create;
+
+       return 0;
+}
+
+static int
+CTL_WRITE_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int arg_in = *(int *)arg;
+       Fallocate_at_create = arg_in;
+
+       return 0;
+}
+
+static struct ctl_argument CTL_ARG(at_create) = CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(fallocate)[] = {
+       CTL_LEAF_RW(at_create),
+
+       CTL_NODE_END
+};
+
+void
+ctl_fallocate_register(void)
+{
+       CTL_REGISTER_MODULE(NULL, fallocate);
+}
diff --git a/ceph/src/pmdk/src/common/ctl_global.h b/ceph/src/pmdk/src/common/ctl_global.h
new file mode 100644 (file)
index 0000000..b70859a
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * ctl_global.h -- definitions for the global CTL namespace
+ */
+
+#ifndef PMDK_CTL_GLOBAL_H
+#define PMDK_CTL_GLOBAL_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void ctl_prefault_register(void);
+extern void ctl_sds_register(void);
+extern void ctl_fallocate_register(void);
+extern void ctl_cow_register(void);
+
+static inline void
+ctl_global_register(void)
+{
+       ctl_prefault_register();
+       ctl_sds_register();
+       ctl_fallocate_register();
+       ctl_cow_register();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/ctl_prefault.c b/ceph/src/pmdk/src/common/ctl_prefault.c
new file mode 100644 (file)
index 0000000..bfb9abe
--- /dev/null
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * ctl_prefault.c -- implementation of the prefault CTL namespace
+ */
+
+#include "ctl.h"
+#include "set.h"
+#include "out.h"
+#include "ctl_global.h"
+
+static int
+CTL_READ_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int *arg_out = arg;
+       *arg_out = Prefault_at_create;
+
+       return 0;
+}
+
+static int
+CTL_WRITE_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int arg_in = *(int *)arg;
+
+       Prefault_at_create = arg_in;
+
+       return 0;
+}
+
+static int
+CTL_READ_HANDLER(at_open)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int *arg_out = arg;
+       *arg_out = Prefault_at_open;
+
+       return 0;
+}
+
+static int
+CTL_WRITE_HANDLER(at_open)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int arg_in = *(int *)arg;
+
+       Prefault_at_open = arg_in;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(at_create) = CTL_ARG_BOOLEAN;
+static const struct ctl_argument CTL_ARG(at_open) = CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(prefault)[] = {
+       CTL_LEAF_RW(at_create),
+       CTL_LEAF_RW(at_open),
+
+       CTL_NODE_END
+};
+
+void
+ctl_prefault_register(void)
+{
+       CTL_REGISTER_MODULE(NULL, prefault);
+}
diff --git a/ceph/src/pmdk/src/common/ctl_sds.c b/ceph/src/pmdk/src/common/ctl_sds.c
new file mode 100644 (file)
index 0000000..255c5b7
--- /dev/null
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * ctl_sds.c -- implementation of the sds CTL namespace
+ */
+
+#include "ctl.h"
+#include "set.h"
+#include "out.h"
+#include "ctl_global.h"
+
+static int
+CTL_READ_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int *arg_out = arg;
+       *arg_out = SDS_at_create;
+
+       return 0;
+}
+
+static int
+CTL_WRITE_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       int arg_in = *(int *)arg;
+
+       SDS_at_create = arg_in;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(at_create) = CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(sds)[] = {
+       CTL_LEAF_RW(at_create),
+
+       CTL_NODE_END
+};
+
+void
+ctl_sds_register(void)
+{
+       CTL_REGISTER_MODULE(NULL, sds);
+}
diff --git a/ceph/src/pmdk/src/common/dlsym.h b/ceph/src/pmdk/src/common/dlsym.h
new file mode 100644 (file)
index 0000000..dd4f58b
--- /dev/null
@@ -0,0 +1,103 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * dlsym.h -- dynamic linking utilities with library-specific implementation
+ */
+
+#ifndef PMDK_DLSYM_H
+#define PMDK_DLSYM_H 1
+
+#include "out.h"
+
+#if defined(USE_LIBDL) && !defined(_WIN32)
+
+#include <dlfcn.h>
+
+/*
+ * util_dlopen -- calls real dlopen()
+ */
+static inline void *
+util_dlopen(const char *filename)
+{
+       LOG(3, "filename %s", filename);
+
+       return dlopen(filename, RTLD_NOW);
+}
+
+/*
+ * util_dlerror -- calls real dlerror()
+ */
+static inline char *
+util_dlerror(void)
+{
+       return dlerror();
+}
+
+/*
+ * util_dlsym -- calls real dlsym()
+ */
+static inline void *
+util_dlsym(void *handle, const char *symbol)
+{
+       LOG(3, "handle %p symbol %s", handle, symbol);
+
+       return dlsym(handle, symbol);
+}
+
+/*
+ * util_dlclose -- calls real dlclose()
+ */
+static inline int
+util_dlclose(void *handle)
+{
+       LOG(3, "handle %p", handle);
+
+       return dlclose(handle);
+}
+
+#else /* empty functions */
+
+/*
+ * util_dlopen -- empty function
+ */
+static inline void *
+util_dlopen(const char *filename)
+{
+       errno = ENOSYS;
+       return NULL;
+}
+
+/*
+ * util_dlerror -- empty function
+ */
+static inline char *
+util_dlerror(void)
+{
+       errno = ENOSYS;
+       return NULL;
+}
+
+/*
+ * util_dlsym -- empty function
+ */
+static inline void *
+util_dlsym(void *handle, const char *symbol)
+{
+       errno = ENOSYS;
+       return NULL;
+}
+
+/*
+ * util_dlclose -- empty function
+ */
+static inline int
+util_dlclose(void *handle)
+{
+       errno = ENOSYS;
+       return 0;
+}
+
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/file.c b/ceph/src/pmdk/src/common/file.c
new file mode 100644 (file)
index 0000000..e64e97b
--- /dev/null
@@ -0,0 +1,618 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * file.c -- file utilities
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <limits.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+
+#if !defined(_WIN32) && !defined(__FreeBSD__)
+#include <sys/sysmacros.h>
+#endif
+
+#include "../libpmem2/config.h"
+#include "../libpmem2/pmem2_utils.h"
+#include "file.h"
+#include "os.h"
+#include "out.h"
+#include "mmap.h"
+
+#define DEVICE_DAX_ZERO_LEN (2 * MEGABYTE)
+
+/*
+ * util_file_exists -- checks whether file exists
+ */
+int
+util_file_exists(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       if (os_access(path, F_OK) == 0)
+               return 1;
+
+       if (errno != ENOENT) {
+               ERR("!os_access \"%s\"", path);
+               return -1;
+       }
+
+       /*
+        * ENOENT means that some component of a pathname does not exists.
+        *
+        * XXX - we should also call os_access on parent directory and
+        * if this also results in ENOENT -1 should be returned.
+        *
+        * The problem is that we would need to use realpath, which fails
+        * if file does not exist.
+        */
+
+       return 0;
+}
+
+/*
+ * util_stat_get_type -- checks whether stat structure describes
+ *                      device dax or a normal file
+ */
+enum file_type
+util_stat_get_type(const os_stat_t *st)
+{
+       enum pmem2_file_type type;
+
+       int ret = pmem2_get_type_from_stat(st, &type);
+       if (ret) {
+               errno = pmem2_err_to_errno(ret);
+               return OTHER_ERROR;
+       }
+
+       if (type == PMEM2_FTYPE_REG || type == PMEM2_FTYPE_DIR)
+               return TYPE_NORMAL;
+
+       if (type == PMEM2_FTYPE_DEVDAX)
+               return TYPE_DEVDAX;
+
+       ASSERTinfo(0, "unhandled file type in util_stat_get_type");
+       return OTHER_ERROR;
+}
+
+/*
+ * util_fd_get_type -- checks whether a file descriptor is associated
+ *                    with a device dax or a normal file
+ */
+enum file_type
+util_fd_get_type(int fd)
+{
+       LOG(3, "fd %d", fd);
+
+#ifdef _WIN32
+       return TYPE_NORMAL;
+#else
+       os_stat_t st;
+
+       if (os_fstat(fd, &st) < 0) {
+               ERR("!fstat");
+               return OTHER_ERROR;
+       }
+
+       return util_stat_get_type(&st);
+#endif
+}
+
+/*
+ * util_file_get_type -- checks whether the path points to a device dax,
+ *                      normal file or non-existent file
+ */
+enum file_type
+util_file_get_type(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       if (path == NULL) {
+               ERR("invalid (NULL) path");
+               errno = EINVAL;
+               return OTHER_ERROR;
+       }
+
+       int exists = util_file_exists(path);
+       if (exists < 0)
+               return OTHER_ERROR;
+
+       if (!exists)
+               return NOT_EXISTS;
+
+#ifdef _WIN32
+       return TYPE_NORMAL;
+#else
+       os_stat_t st;
+
+       if (os_stat(path, &st) < 0) {
+               ERR("!stat");
+               return OTHER_ERROR;
+       }
+
+       return util_stat_get_type(&st);
+#endif
+}
+
+/*
+ * util_file_get_size -- returns size of a file
+ */
+ssize_t
+util_file_get_size(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       int fd = os_open(path, O_RDONLY);
+       if (fd < 0) {
+               ERR("!open");
+               return -1;
+       }
+
+       ssize_t size = util_fd_get_size(fd);
+       (void) close(fd);
+
+       return size;
+}
+
+/*
+ * util_fd_get_size -- returns size of a file behind a given file descriptor
+ */
+ssize_t
+util_fd_get_size(int fd)
+{
+       LOG(3, "fd %d", fd);
+
+       struct pmem2_source *src;
+       size_t size;
+       int ret;
+
+       if ((ret = pmem2_source_from_fd(&src, fd)) != 0) {
+               errno = pmem2_err_to_errno(ret);
+               return -1;
+       }
+
+       ret = pmem2_source_size(src, &size);
+
+       pmem2_source_delete(&src);
+
+       if (ret) {
+               errno = pmem2_err_to_errno(ret);
+               return -1;
+       }
+
+       /* size is unsigned, this function returns signed */
+       if (size >= INT64_MAX) {
+               errno = ERANGE;
+               ERR(
+                       "file size (%ld) too big to be represented in 64-bit signed integer",
+                       size);
+               return -1;
+       }
+
+       LOG(4, "file length %zu", size);
+       return (ssize_t)size;
+}
+
+/*
+ * util_file_map_whole -- maps the entire file into memory
+ */
+void *
+util_file_map_whole(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       int fd;
+       int olderrno;
+       void *addr = NULL;
+       int flags = O_RDWR;
+#ifdef _WIN32
+       flags |= O_BINARY;
+#endif
+
+       if ((fd = os_open(path, flags)) < 0) {
+               ERR("!open \"%s\"", path);
+               return NULL;
+       }
+
+       ssize_t size = util_fd_get_size(fd);
+       if (size < 0) {
+               LOG(2, "cannot determine file length \"%s\"", path);
+               goto out;
+       }
+
+       addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
+       if (addr == NULL) {
+               LOG(2, "failed to map entire file \"%s\"", path);
+               goto out;
+       }
+
+out:
+       olderrno = errno;
+       (void) os_close(fd);
+       errno = olderrno;
+
+       return addr;
+}
+
+/*
+ * util_file_zero -- zeroes the specified region of the file
+ */
+int
+util_file_zero(const char *path, os_off_t off, size_t len)
+{
+       LOG(3, "path \"%s\" off %ju len %zu", path, off, len);
+
+       int fd;
+       int olderrno;
+       int ret = 0;
+       int flags = O_RDWR;
+#ifdef _WIN32
+       flags |= O_BINARY;
+#endif
+
+       if ((fd = os_open(path, flags)) < 0) {
+               ERR("!open \"%s\"", path);
+               return -1;
+       }
+
+       ssize_t size = util_fd_get_size(fd);
+       if (size < 0) {
+               LOG(2, "cannot determine file length \"%s\"", path);
+               ret = -1;
+               goto out;
+       }
+
+       if (off > size) {
+               LOG(2, "offset beyond file length, %ju > %ju", off, size);
+               ret = -1;
+               goto out;
+       }
+
+       if ((size_t)off + len > (size_t)size) {
+               LOG(2, "requested size of write goes beyond the file length, "
+                                       "%zu > %zu", (size_t)off + len, size);
+               LOG(4, "adjusting len to %zu", size - off);
+               len = (size_t)(size - off);
+       }
+
+       void *addr = util_map(fd, 0, (size_t)size, MAP_SHARED, 0, 0, NULL);
+       if (addr == NULL) {
+               LOG(2, "failed to map entire file \"%s\"", path);
+               ret = -1;
+               goto out;
+       }
+
+       /* zero initialize the specified region */
+       memset((char *)addr + off, 0, len);
+
+       util_unmap(addr, (size_t)size);
+
+out:
+       olderrno = errno;
+       (void) os_close(fd);
+       errno = olderrno;
+
+       return ret;
+}
+
+/*
+ * util_file_pwrite -- writes to a file with an offset
+ */
+ssize_t
+util_file_pwrite(const char *path, const void *buffer, size_t size,
+       os_off_t offset)
+{
+       LOG(3, "path \"%s\" buffer %p size %zu offset %ju",
+                       path, buffer, size, offset);
+
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       if (type == TYPE_NORMAL) {
+               int fd = util_file_open(path, NULL, 0, O_RDWR);
+               if (fd < 0) {
+                       LOG(2, "failed to open file \"%s\"", path);
+                       return -1;
+               }
+
+               ssize_t write_len = pwrite(fd, buffer, size, offset);
+               int olderrno = errno;
+               (void) os_close(fd);
+               errno = olderrno;
+               return write_len;
+       }
+
+       ssize_t file_size = util_file_get_size(path);
+       if (file_size < 0) {
+               LOG(2, "cannot determine file length \"%s\"", path);
+               return -1;
+       }
+
+       size_t max_size = (size_t)(file_size - offset);
+       if (size > max_size) {
+               LOG(2, "requested size of write goes beyond the file length, "
+                       "%zu > %zu", size, max_size);
+               LOG(4, "adjusting size to %zu", max_size);
+               size = max_size;
+       }
+
+       void *addr = util_file_map_whole(path);
+       if (addr == NULL) {
+               LOG(2, "failed to map entire file \"%s\"", path);
+               return -1;
+       }
+
+       memcpy(ADDR_SUM(addr, offset), buffer, size);
+       util_unmap(addr, (size_t)file_size);
+       return (ssize_t)size;
+}
+
+/*
+ * util_file_pread -- reads from a file with an offset
+ */
+ssize_t
+util_file_pread(const char *path, void *buffer, size_t size,
+       os_off_t offset)
+{
+       LOG(3, "path \"%s\" buffer %p size %zu offset %ju",
+                       path, buffer, size, offset);
+
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       if (type == TYPE_NORMAL) {
+               int fd = util_file_open(path, NULL, 0, O_RDONLY);
+               if (fd < 0) {
+                       LOG(2, "failed to open file \"%s\"", path);
+                       return -1;
+               }
+
+               ssize_t read_len = pread(fd, buffer, size, offset);
+               int olderrno = errno;
+               (void) os_close(fd);
+               errno = olderrno;
+               return read_len;
+       }
+
+       ssize_t file_size = util_file_get_size(path);
+       if (file_size < 0) {
+               LOG(2, "cannot determine file length \"%s\"", path);
+               return -1;
+       }
+
+       size_t max_size = (size_t)(file_size - offset);
+       if (size > max_size) {
+               LOG(2, "requested size of read goes beyond the file length, "
+                       "%zu > %zu", size, max_size);
+               LOG(4, "adjusting size to %zu", max_size);
+               size = max_size;
+       }
+
+       void *addr = util_file_map_whole(path);
+       if (addr == NULL) {
+               LOG(2, "failed to map entire file \"%s\"", path);
+               return -1;
+       }
+
+       memcpy(buffer, ADDR_SUM(addr, offset), size);
+       util_unmap(addr, (size_t)file_size);
+       return (ssize_t)size;
+}
+
+/*
+ * util_file_create -- create a new memory pool file
+ */
+int
+util_file_create(const char *path, size_t size, size_t minsize)
+{
+       LOG(3, "path \"%s\" size %zu minsize %zu", path, size, minsize);
+
+       ASSERTne(size, 0);
+
+       if (size < minsize) {
+               ERR("size %zu smaller than %zu", size, minsize);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (((os_off_t)size) < 0) {
+               ERR("invalid size (%zu) for os_off_t", size);
+               errno = EFBIG;
+               return -1;
+       }
+
+       int fd;
+       int mode;
+       int flags = O_RDWR | O_CREAT | O_EXCL;
+#ifndef _WIN32
+       mode = 0;
+#else
+       mode = S_IWRITE | S_IREAD;
+       flags |= O_BINARY;
+#endif
+
+       /*
+        * Create file without any permission. It will be granted once
+        * initialization completes.
+        */
+       if ((fd = os_open(path, flags, mode)) < 0) {
+               ERR("!open \"%s\"", path);
+               return -1;
+       }
+
+       if ((errno = os_posix_fallocate(fd, 0, (os_off_t)size)) != 0) {
+               ERR("!posix_fallocate \"%s\", %zu", path, size);
+               goto err;
+       }
+
+       /* for windows we can't flock until after we fallocate */
+       if (os_flock(fd, OS_LOCK_EX | OS_LOCK_NB) < 0) {
+               ERR("!flock \"%s\"", path);
+               goto err;
+       }
+
+       return fd;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (fd != -1)
+               (void) os_close(fd);
+       os_unlink(path);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_file_open -- open a memory pool file
+ */
+int
+util_file_open(const char *path, size_t *size, size_t minsize, int flags)
+{
+       LOG(3, "path \"%s\" size %p minsize %zu flags %d", path, size, minsize,
+                       flags);
+
+       int oerrno;
+       int fd;
+
+#ifdef _WIN32
+       flags |= O_BINARY;
+#endif
+
+       if ((fd = os_open(path, flags)) < 0) {
+               ERR("!open \"%s\"", path);
+               return -1;
+       }
+
+       if (os_flock(fd, OS_LOCK_EX | OS_LOCK_NB) < 0) {
+               ERR("!flock \"%s\"", path);
+               (void) os_close(fd);
+               return -1;
+       }
+
+       if (size || minsize) {
+               if (size)
+                       ASSERTeq(*size, 0);
+
+               ssize_t actual_size = util_fd_get_size(fd);
+               if (actual_size < 0) {
+                       ERR("stat \"%s\": negative size", path);
+                       errno = EINVAL;
+                       goto err;
+               }
+
+               if ((size_t)actual_size < minsize) {
+                       ERR("size %zu smaller than %zu",
+                                       (size_t)actual_size, minsize);
+                       errno = EINVAL;
+                       goto err;
+               }
+
+               if (size) {
+                       *size = (size_t)actual_size;
+                       LOG(4, "actual file size %zu", *size);
+               }
+       }
+
+       return fd;
+err:
+       oerrno = errno;
+       if (os_flock(fd, OS_LOCK_UN))
+               ERR("!flock unlock");
+       (void) os_close(fd);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_unlink -- unlinks a file or zeroes a device dax
+ */
+int
+util_unlink(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       if (type == TYPE_DEVDAX) {
+               return util_file_zero(path, 0, DEVICE_DAX_ZERO_LEN);
+       } else {
+#ifdef _WIN32
+               /* on Windows we can not unlink Read-Only files */
+               if (os_chmod(path, S_IREAD | S_IWRITE) == -1) {
+                       ERR("!chmod \"%s\"", path);
+                       return -1;
+               }
+#endif
+               return os_unlink(path);
+       }
+}
+
+/*
+ * util_unlink_flock -- flocks the file and unlinks it
+ *
+ * The unlink(2) call on a file which is opened and locked using flock(2)
+ * by different process works on linux. Thus in order to forbid removing a
+ * pool when in use by different process we need to flock(2) the pool files
+ * first before unlinking.
+ */
+int
+util_unlink_flock(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+#ifdef WIN32
+       /*
+        * On Windows it is not possible to unlink the
+        * file if it is flocked.
+        */
+       return util_unlink(path);
+#else
+       int fd = util_file_open(path, NULL, 0, O_RDONLY);
+       if (fd < 0) {
+               LOG(2, "failed to open file \"%s\"", path);
+               return -1;
+       }
+
+       int ret = util_unlink(path);
+
+       (void) os_close(fd);
+
+       return ret;
+#endif
+}
+
+/*
+ * util_write_all -- a wrapper for util_write
+ *
+ * writes exactly count bytes from buf to file referred to by fd
+ * returns -1 on error, 0 otherwise
+ */
+int
+util_write_all(int fd, const char *buf, size_t count)
+{
+       ssize_t n_wrote = 0;
+       size_t total = 0;
+
+       while (count > total) {
+               n_wrote = util_write(fd, buf, count - total);
+               if (n_wrote <= 0)
+                       return -1;
+
+               buf += (size_t)n_wrote;
+               total += (size_t)n_wrote;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/file.h b/ceph/src/pmdk/src/common/file.h
new file mode 100644 (file)
index 0000000..a54144e
--- /dev/null
@@ -0,0 +1,115 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * file.h -- internal definitions for file module
+ */
+
+#ifndef PMDK_FILE_H
+#define PMDK_FILE_H 1
+
+#include <stddef.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <limits.h>
+#include "os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _WIN32
+#define NAME_MAX _MAX_FNAME
+#endif
+
+struct file_info {
+       char filename[NAME_MAX + 1];
+       int is_dir;
+};
+
+struct dir_handle {
+       const char *path;
+#ifdef _WIN32
+       HANDLE handle;
+       char *_file;
+#else
+       DIR *dirp;
+#endif
+};
+
+enum file_type {
+       OTHER_ERROR = -2,
+       NOT_EXISTS = -1,
+       TYPE_NORMAL = 1,
+       TYPE_DEVDAX = 2
+};
+
+int util_file_dir_open(struct dir_handle *a, const char *path);
+int util_file_dir_next(struct dir_handle *a, struct file_info *info);
+int util_file_dir_close(struct dir_handle *a);
+int util_file_dir_remove(const char *path);
+int util_file_exists(const char *path);
+enum file_type util_stat_get_type(const os_stat_t *st);
+enum file_type util_fd_get_type(int fd);
+enum file_type util_file_get_type(const char *path);
+int util_ddax_region_find(const char *path, unsigned *region_id);
+ssize_t util_file_get_size(const char *path);
+ssize_t util_fd_get_size(int fd);
+size_t util_file_device_dax_alignment(const char *path);
+void *util_file_map_whole(const char *path);
+int util_file_zero(const char *path, os_off_t off, size_t len);
+ssize_t util_file_pread(const char *path, void *buffer, size_t size,
+       os_off_t offset);
+ssize_t util_file_pwrite(const char *path, const void *buffer, size_t size,
+       os_off_t offset);
+
+int util_tmpfile(const char *dir, const char *templ, int flags);
+int util_is_absolute_path(const char *path);
+
+int util_file_create(const char *path, size_t size, size_t minsize);
+int util_file_open(const char *path, size_t *size, size_t minsize, int flags);
+int util_unlink(const char *path);
+int util_unlink_flock(const char *path);
+int util_file_mkdir(const char *path, mode_t mode);
+
+int util_write_all(int fd, const char *buf, size_t count);
+
+#ifndef _WIN32
+#define util_read      read
+#define util_write     write
+#else
+static inline ssize_t
+util_read(int fd, void *buf, size_t count)
+{
+       /*
+        * Simulate short read, because Windows' _read uses "unsigned" as
+        * a type of the last argument and "int" as a return type.
+        * We have to limit "count" to what _read can return as a success,
+        * not what it can accept.
+        */
+       if (count > INT_MAX)
+               count = INT_MAX;
+       return _read(fd, buf, (unsigned)count);
+}
+
+static inline ssize_t
+util_write(int fd, const void *buf, size_t count)
+{
+       /*
+        * Simulate short write, because Windows' _write uses "unsigned" as
+        * a type of the last argument and "int" as a return type.
+        * We have to limit "count" to what _write can return as a success,
+        * not what it can accept.
+        */
+       if (count > INT_MAX)
+               count = INT_MAX;
+       return _write(fd, buf, (unsigned)count);
+}
+#define S_ISCHR(m)     (((m) & S_IFMT) == S_IFCHR)
+#define S_ISDIR(m)     (((m) & S_IFMT) == S_IFDIR)
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/ceph/src/pmdk/src/common/file_posix.c b/ceph/src/pmdk/src/common/file_posix.c
new file mode 100644 (file)
index 0000000..f887244
--- /dev/null
@@ -0,0 +1,264 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * file_posix.c -- Posix versions of file APIs
+ */
+
+/* for O_TMPFILE */
+#define _GNU_SOURCE
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <sys/types.h>
+
+#include "os.h"
+#include "file.h"
+#include "out.h"
+#include "libpmem2.h"
+#include "../libpmem2/pmem2_utils.h"
+#include "../libpmem2/region_namespace.h"
+
+/*
+ * util_tmpfile_mkstemp --  (internal) create temporary file
+ *                          if O_TMPFILE not supported
+ */
+static int
+util_tmpfile_mkstemp(const char *dir, const char *templ)
+{
+       /* the templ must start with a path separator */
+       ASSERTeq(templ[0], '/');
+
+       int oerrno;
+       int fd = -1;
+
+       char *fullname = alloca(strlen(dir) + strlen(templ) + 1);
+
+       (void) strcpy(fullname, dir);
+       (void) strcat(fullname, templ);
+
+       sigset_t set, oldset;
+       sigfillset(&set);
+       (void) sigprocmask(SIG_BLOCK, &set, &oldset);
+
+       mode_t prev_umask = umask(S_IRWXG | S_IRWXO);
+
+       fd = os_mkstemp(fullname);
+
+       umask(prev_umask);
+
+       if (fd < 0) {
+               ERR("!mkstemp");
+               goto err;
+       }
+
+       (void) os_unlink(fullname);
+       (void) sigprocmask(SIG_SETMASK, &oldset, NULL);
+       LOG(3, "unlinked file is \"%s\"", fullname);
+
+       return fd;
+
+err:
+       oerrno = errno;
+       (void) sigprocmask(SIG_SETMASK, &oldset, NULL);
+       if (fd != -1)
+               (void) os_close(fd);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_tmpfile -- create temporary file
+ */
+int
+util_tmpfile(const char *dir, const char *templ, int flags)
+{
+       LOG(3, "dir \"%s\" template \"%s\" flags %x", dir, templ, flags);
+
+       /* only O_EXCL is allowed here */
+       ASSERT(flags == 0 || flags == O_EXCL);
+
+#ifdef O_TMPFILE
+       int fd = os_open(dir, O_TMPFILE | O_RDWR | flags, S_IRUSR | S_IWUSR);
+       /*
+        * Open can fail if underlying file system does not support O_TMPFILE
+        * flag.
+        */
+       if (fd >= 0)
+               return fd;
+       if (errno != EOPNOTSUPP) {
+               ERR("!open");
+               return -1;
+       }
+#endif
+
+       return util_tmpfile_mkstemp(dir, templ);
+}
+
+/*
+ * util_is_absolute_path -- check if the path is an absolute one
+ */
+int
+util_is_absolute_path(const char *path)
+{
+       LOG(3, "path: %s", path);
+
+       if (path[0] == OS_DIR_SEPARATOR)
+               return 1;
+       else
+               return 0;
+}
+
+/*
+ * util_create_mkdir -- creates new dir
+ */
+int
+util_file_mkdir(const char *path, mode_t mode)
+{
+       LOG(3, "path: %s mode: %o", path, mode);
+       return mkdir(path, mode);
+}
+
+/*
+ * util_file_dir_open -- open a directory
+ */
+int
+util_file_dir_open(struct dir_handle *handle, const char *path)
+{
+       LOG(3, "handle: %p path: %s", handle, path);
+       handle->dirp = opendir(path);
+       return handle->dirp == NULL;
+}
+
+/*
+ * util_file_dir_next -- read next file in directory
+ */
+int
+util_file_dir_next(struct dir_handle *handle, struct file_info *info)
+{
+       LOG(3, "handle: %p info: %p", handle, info);
+       struct dirent *d = readdir(handle->dirp);
+       if (d == NULL)
+               return 1; /* break */
+       info->filename[NAME_MAX] = '\0';
+       strncpy(info->filename, d->d_name, NAME_MAX + 1);
+       if (info->filename[NAME_MAX] != '\0')
+               return -1; /* filename truncated */
+       info->is_dir = d->d_type == DT_DIR;
+       return 0; /* continue */
+}
+
+/*
+ * util_file_dir_close -- close a directory
+ */
+int
+util_file_dir_close(struct dir_handle *handle)
+{
+       LOG(3, "path: %p", handle);
+       return closedir(handle->dirp);
+}
+
+/*
+ * util_file_dir_remove -- remove directory
+ */
+int
+util_file_dir_remove(const char *path)
+{
+       LOG(3, "path: %s", path);
+       return rmdir(path);
+}
+
+/*
+ * device_dax_alignment -- (internal) checks the alignment of given Device DAX
+ */
+static size_t
+device_dax_alignment(const char *path)
+{
+       size_t size = 0;
+
+       LOG(3, "path \"%s\"", path);
+
+       struct pmem2_source *src;
+
+       int fd = os_open(path, O_RDONLY);
+       if (fd == -1) {
+               LOG(1, "Cannot open file %s", path);
+               return size;
+       }
+
+       int ret = pmem2_source_from_fd(&src, fd);
+       if (ret)
+               goto end;
+
+       ret = pmem2_device_dax_alignment(src, &size);
+       if (ret) {
+               size = 0;
+               goto end;
+       }
+
+end:
+       pmem2_source_delete(&src);
+       os_close(fd);
+       return size;
+}
+
+/*
+ * util_file_device_dax_alignment -- returns internal Device DAX alignment
+ */
+size_t
+util_file_device_dax_alignment(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       return device_dax_alignment(path);
+}
+
+/*
+ * util_ddax_region_find -- returns Device DAX region id
+ */
+int
+util_ddax_region_find(const char *path, unsigned *region_id)
+{
+       LOG(3, "path \"%s\"", path);
+
+       os_stat_t st;
+       int ret;
+
+       if (os_stat(path, &st) < 0) {
+               ERR("!stat \"%s\"", path);
+               return -1;
+       }
+
+       enum pmem2_file_type ftype;
+       if ((ret = pmem2_get_type_from_stat(&st, &ftype)) < 0) {
+               errno = pmem2_err_to_errno(ret);
+               return -1;
+       }
+
+       /*
+        * XXX: this is a hack to workaround the fact that common is using
+        * non-public APIs of libpmem2, and there's often no way to properly
+        * create the required structures...
+        * This needs to go away together with refactoring that untangles
+        * these internal dependencies.
+        */
+       struct pmem2_source src;
+       src.type = PMEM2_SOURCE_FD;
+       src.value.ftype = ftype;
+       src.value.st_rdev = st.st_rdev;
+       src.value.st_dev = st.st_dev;
+
+       ret = pmem2_get_region_id(&src, region_id);
+       if (ret < 0) {
+               errno = pmem2_err_to_errno(ret);
+               return -1;
+       }
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/common/file_windows.c b/ceph/src/pmdk/src/common/file_windows.c
new file mode 100644 (file)
index 0000000..f67c11a
--- /dev/null
@@ -0,0 +1,196 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * file_windows.c -- Windows emulation of Linux-specific system calls
+ */
+
+/*
+ * XXX - The initial approach to PMDK for Windows port was to minimize the
+ * amount of changes required in the core part of the library, and to avoid
+ * preprocessor conditionals, if possible.  For that reason, some of the
+ * Linux system calls that have no equivalents on Windows have been emulated
+ * using Windows API.
+ * Note that it was not a goal to fully emulate POSIX-compliant behavior
+ * of mentioned functions.  They are used only internally, so current
+ * implementation is just good enough to satisfy PMDK needs and to make it
+ * work on Windows.
+ */
+
+#include <windows.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+
+#include "alloc.h"
+#include "file.h"
+#include "out.h"
+#include "os.h"
+
+/*
+ * util_tmpfile -- create a temporary file
+ */
+int
+util_tmpfile(const char *dir, const char *templ, int flags)
+{
+       LOG(3, "dir \"%s\" template \"%s\" flags %x", dir, templ, flags);
+
+       /* only O_EXCL is allowed here */
+       ASSERT(flags == 0 || flags == O_EXCL);
+
+       int oerrno;
+       int fd = -1;
+
+       size_t len = strlen(dir) + strlen(templ) + 1;
+       char *fullname = Malloc(sizeof(*fullname) * len);
+       if (fullname == NULL) {
+               ERR("!Malloc");
+               return -1;
+       }
+
+       int ret = _snprintf(fullname, len, "%s%s", dir, templ);
+       if (ret < 0 || ret >= len) {
+               ERR("snprintf: %d", ret);
+               goto err;
+       }
+
+       LOG(4, "fullname \"%s\"", fullname);
+
+       /*
+        * XXX - block signals and modify file creation mask for the time
+        * of mkstmep() execution.  Restore previous settings once the file
+        * is created.
+        */
+
+       fd = os_mkstemp(fullname);
+       if (fd < 0) {
+               ERR("!os_mkstemp");
+               goto err;
+       }
+
+       /*
+        * There is no point to use unlink() here.  First, because it does not
+        * work on open files.  Second, because the file is created with
+        * O_TEMPORARY flag, and it looks like such temp files cannot be open
+        * from another process, even though they are visible on
+        * the filesystem.
+        */
+
+       Free(fullname);
+       return fd;
+
+err:
+       Free(fullname);
+       oerrno = errno;
+       if (fd != -1)
+               (void) os_close(fd);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_is_absolute_path -- check if the path is absolute
+ */
+int
+util_is_absolute_path(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       if (path == NULL || path[0] == '\0')
+               return 0;
+
+       if (path[0] == '\\' || path[1] == ':')
+               return 1;
+
+       return 0;
+}
+
+/*
+ * util_file_mkdir -- creates new dir
+ */
+int
+util_file_mkdir(const char *path, mode_t mode)
+{
+       /*
+        * On windows we cannot create read only dir so mode
+        * parameter is useless.
+        */
+       UNREFERENCED_PARAMETER(mode);
+       LOG(3, "path: %s mode: %d", path, mode);
+       return _mkdir(path);
+}
+
+/*
+ * util_file_dir_open -- open a directory
+ */
+int
+util_file_dir_open(struct dir_handle *handle, const char *path)
+{
+       /* init handle */
+       handle->handle = NULL;
+       handle->path = path;
+       return 0;
+}
+
+/*
+ * util_file_dir_next - read next file in directory
+ */
+int
+util_file_dir_next(struct dir_handle *handle, struct file_info *info)
+{
+       WIN32_FIND_DATAA data;
+       if (handle->handle == NULL) {
+               handle->handle = FindFirstFileA(handle->path, &data);
+               if (handle->handle == NULL)
+                       return 1;
+       } else {
+               if (FindNextFileA(handle->handle, &data) == 0)
+                       return 1;
+       }
+       info->filename[NAME_MAX] = '\0';
+       strncpy(info->filename, data.cFileName, NAME_MAX + 1);
+       if (info->filename[NAME_MAX] != '\0')
+               return -1; /* filename truncated */
+       info->is_dir = data.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY;
+
+       return 0;
+}
+
+/*
+ * util_file_dir_close -- close a directory
+ */
+int
+util_file_dir_close(struct dir_handle *handle)
+{
+       return FindClose(handle->handle);
+}
+
+/*
+ * util_file_dir_remove -- remove directory
+ */
+int
+util_file_dir_remove(const char *path)
+{
+       return RemoveDirectoryA(path) == 0 ? -1 : 0;
+}
+
+/*
+ * util_file_device_dax_alignment -- returns internal Device DAX alignment
+ */
+size_t
+util_file_device_dax_alignment(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       return 0;
+}
+
+/*
+ * util_ddax_region_find -- returns DEV dax region id that contains file
+ */
+int
+util_ddax_region_find(const char *path, unsigned *region_id)
+{
+       LOG(3, "path \"%s\"", path);
+
+       return -1;
+}
diff --git a/ceph/src/pmdk/src/common/libpmemcommon.vcxproj b/ceph/src/pmdk/src/common/libpmemcommon.vcxproj
new file mode 100644 (file)
index 0000000..1fc1b7a
--- /dev/null
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem2\usc_windows.c" />
+    <ClCompile Include="bad_blocks.c" />
+    <ClCompile Include="set_badblocks.c" />
+    <ClCompile Include="ctl.c" />
+    <ClCompile Include="ctl_cow.c" />
+    <ClCompile Include="ctl_prefault.c" />
+    <ClCompile Include="ctl_sds.c" />
+    <ClCompile Include="ctl_fallocate.c" />
+    <ClCompile Include="file.c" />
+    <ClCompile Include="file_windows.c" />
+    <ClCompile Include="mmap.c" />
+    <ClCompile Include="mmap_windows.c" />
+    <ClCompile Include="os_deep_windows.c" />
+    <ClCompile Include="pool_hdr.c" />
+    <ClCompile Include="rand.c" />
+    <ClCompile Include="set.c" />
+    <ClCompile Include="shutdown_state.c" />
+    <ClCompile Include="uuid.c" />
+    <ClCompile Include="uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\badblocks.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="ctl.h" />
+    <ClInclude Include="ctl_global.h" />
+    <ClInclude Include="badblocks.h" />
+    <ClInclude Include="set_badblocks.h" />
+    <ClInclude Include="dlsym.h" />
+    <ClInclude Include="file.h" />
+    <ClInclude Include="mmap.h" />
+    <ClInclude Include="os_deep.h" />
+    <ClInclude Include="pmemcommon.h" />
+    <ClInclude Include="pool_hdr.h" />
+    <ClInclude Include="set.h" />
+    <ClInclude Include="sys_util.h" />
+    <ClInclude Include="uuid.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\core\libpmemcore.vcxproj">
+      <Project>{2fa3155b-6f26-4d15-ac03-9d82d48dbc42}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{492BAA3D-0D5D-478E-9765-500463AE69AA}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libpmemcommon</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.lib</TargetExt>
+    <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);.;</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.lib</TargetExt>
+    <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);.;</IncludePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>PMDK_UTF8_API;NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsC</CompileAs>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <ExceptionHandling>false</ExceptionHandling>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(VcpkgRoot)include;$(SolutionDir)\core</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>PMDK_UTF8_API;NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsC</CompileAs>
+      <Optimization>MaxSpeed</Optimization>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <ExceptionHandling>false</ExceptionHandling>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(VcpkgRoot)include;$(SolutionDir)\core</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/common/libpmemcommon.vcxproj.filters b/ceph/src/pmdk/src/common/libpmemcommon.vcxproj.filters
new file mode 100644 (file)
index 0000000..4b2ec85
--- /dev/null
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="set_badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="set.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="uuid.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="shutdown_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ctl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ctl_cow.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ctl_prefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ctl_fallocate.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ctl_sds.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="rand.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="ctl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ctl_global.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="set_badblocks.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="badblocks.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pmemcommon.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/common/mmap.c b/ceph/src/pmdk/src/common/mmap.c
new file mode 100644 (file)
index 0000000..b118b08
--- /dev/null
@@ -0,0 +1,504 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * mmap.c -- mmap utilities
+ */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#include "file.h"
+#include "queue.h"
+#include "mmap.h"
+#include "sys_util.h"
+#include "os.h"
+#include "alloc.h"
+#include "libpmem2.h"
+
+int Mmap_no_random;
+void *Mmap_hint;
+static os_rwlock_t Mmap_list_lock;
+
+static PMDK_SORTEDQ_HEAD(map_list_head, map_tracker) Mmap_list =
+               PMDK_SORTEDQ_HEAD_INITIALIZER(Mmap_list);
+
+/*
+ * util_mmap_init -- initialize the mmap utils
+ *
+ * This is called from the library initialization code.
+ */
+void
+util_mmap_init(void)
+{
+       LOG(3, NULL);
+
+       util_rwlock_init(&Mmap_list_lock);
+
+       /*
+        * For testing, allow overriding the default mmap() hint address.
+        * If hint address is defined, it also disables address randomization.
+        */
+       char *e = os_getenv("PMEM_MMAP_HINT");
+       if (e) {
+               char *endp;
+               errno = 0;
+               unsigned long long val = strtoull(e, &endp, 16);
+
+               if (errno || endp == e) {
+                       LOG(2, "Invalid PMEM_MMAP_HINT");
+               } else if (os_access(OS_MAPFILE, R_OK)) {
+                       LOG(2, "No /proc, PMEM_MMAP_HINT ignored");
+               } else {
+                       Mmap_hint = (void *)val;
+                       Mmap_no_random = 1;
+                       LOG(3, "PMEM_MMAP_HINT set to %p", Mmap_hint);
+               }
+       }
+}
+
+/*
+ * util_mmap_fini -- clean up the mmap utils
+ *
+ * This is called before process stop.
+ */
+void
+util_mmap_fini(void)
+{
+       LOG(3, NULL);
+
+       util_rwlock_destroy(&Mmap_list_lock);
+}
+
+/*
+ * util_map -- memory map a file
+ *
+ * This is just a convenience function that calls mmap() with the
+ * appropriate arguments and includes our trace points.
+ */
+void *
+util_map(int fd, os_off_t off, size_t len, int flags, int rdonly,
+       size_t req_align, int *map_sync)
+{
+       LOG(3, "fd %d len %zu flags %d rdonly %d req_align %zu map_sync %p",
+                       fd, len, flags, rdonly, req_align, map_sync);
+
+       void *base;
+       void *addr = util_map_hint(len, req_align);
+       if (addr == MAP_FAILED) {
+               LOG(1, "cannot find a contiguous region of given size");
+               return NULL;
+       }
+
+       if (req_align)
+               ASSERTeq((uintptr_t)addr % req_align, 0);
+
+       int proto = rdonly ? PROT_READ : PROT_READ|PROT_WRITE;
+       base = util_map_sync(addr, len, proto, flags, fd, off, map_sync);
+       if (base == MAP_FAILED) {
+               ERR("!mmap %zu bytes", len);
+               return NULL;
+       }
+
+       LOG(3, "mapped at %p", base);
+
+       return base;
+}
+
+/*
+ * util_unmap -- unmap a file
+ *
+ * This is just a convenience function that calls munmap() with the
+ * appropriate arguments and includes our trace points.
+ */
+int
+util_unmap(void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+/*
+ * XXX Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=169608
+ */
+#ifdef __FreeBSD__
+       if (!IS_PAGE_ALIGNED((uintptr_t)addr)) {
+               errno = EINVAL;
+               ERR("!munmap");
+               return -1;
+       }
+#endif
+       int retval = munmap(addr, len);
+       if (retval < 0)
+               ERR("!munmap");
+
+       return retval;
+}
+
+/*
+ * util_range_ro -- set a memory range read-only
+ */
+int
+util_range_ro(void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       uintptr_t uptr;
+       int retval;
+
+       /*
+        * mprotect requires addr to be a multiple of pagesize, so
+        * adjust addr and len to represent the full 4k chunks
+        * covering the given range.
+        */
+
+       /* increase len by the amount we gain when we round addr down */
+       len += (uintptr_t)addr & (Pagesize - 1);
+
+       /* round addr down to page boundary */
+       uptr = (uintptr_t)addr & ~(Pagesize - 1);
+
+       if ((retval = mprotect((void *)uptr, len, PROT_READ)) < 0)
+               ERR("!mprotect: PROT_READ");
+
+       return retval;
+}
+
+/*
+ * util_range_rw -- set a memory range read-write
+ */
+int
+util_range_rw(void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       uintptr_t uptr;
+       int retval;
+
+       /*
+        * mprotect requires addr to be a multiple of pagesize, so
+        * adjust addr and len to represent the full 4k chunks
+        * covering the given range.
+        */
+
+       /* increase len by the amount we gain when we round addr down */
+       len += (uintptr_t)addr & (Pagesize - 1);
+
+       /* round addr down to page boundary */
+       uptr = (uintptr_t)addr & ~(Pagesize - 1);
+
+       if ((retval = mprotect((void *)uptr, len, PROT_READ|PROT_WRITE)) < 0)
+               ERR("!mprotect: PROT_READ|PROT_WRITE");
+
+       return retval;
+}
+
+/*
+ * util_range_none -- set a memory range for no access allowed
+ */
+int
+util_range_none(void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       uintptr_t uptr;
+       int retval;
+
+       /*
+        * mprotect requires addr to be a multiple of pagesize, so
+        * adjust addr and len to represent the full 4k chunks
+        * covering the given range.
+        */
+
+       /* increase len by the amount we gain when we round addr down */
+       len += (uintptr_t)addr & (Pagesize - 1);
+
+       /* round addr down to page boundary */
+       uptr = (uintptr_t)addr & ~(Pagesize - 1);
+
+       if ((retval = mprotect((void *)uptr, len, PROT_NONE)) < 0)
+               ERR("!mprotect: PROT_NONE");
+
+       return retval;
+}
+
+/*
+ * util_range_comparer -- (internal) compares the two mapping trackers
+ */
+static intptr_t
+util_range_comparer(struct map_tracker *a, struct map_tracker *b)
+{
+       return ((intptr_t)a->base_addr - (intptr_t)b->base_addr);
+}
+
+/*
+ * util_range_find_unlocked -- (internal) find the map tracker
+ * for given address range
+ *
+ * Returns the first entry at least partially overlapping given range.
+ * It's up to the caller to check whether the entry exactly matches the range,
+ * or if the range spans multiple entries.
+ */
+static struct map_tracker *
+util_range_find_unlocked(uintptr_t addr, size_t len)
+{
+       LOG(10, "addr 0x%016" PRIxPTR " len %zu", addr, len);
+
+       uintptr_t end = addr + len;
+
+       struct map_tracker *mt;
+
+       PMDK_SORTEDQ_FOREACH(mt, &Mmap_list, entry) {
+               if (addr < mt->end_addr &&
+                   (addr >= mt->base_addr || end > mt->base_addr))
+                       goto out;
+
+               /* break if there is no chance to find matching entry */
+               if (addr < mt->base_addr)
+                       break;
+       }
+       mt = NULL;
+
+out:
+       return mt;
+}
+
+/*
+ * util_range_find -- find the map tracker for given address range
+ * the same as util_range_find_unlocked but locked
+ */
+struct map_tracker *
+util_range_find(uintptr_t addr, size_t len)
+{
+       LOG(10, "addr 0x%016" PRIxPTR " len %zu", addr, len);
+
+       util_rwlock_rdlock(&Mmap_list_lock);
+
+       struct map_tracker *mt = util_range_find_unlocked(addr, len);
+
+       util_rwlock_unlock(&Mmap_list_lock);
+       return mt;
+}
+
+/*
+ * util_range_register -- add a memory range into a map tracking list
+ */
+int
+util_range_register(const void *addr, size_t len, const char *path,
+       enum pmem_map_type type)
+{
+       LOG(3, "addr %p len %zu path %s type %d", addr, len, path, type);
+
+       /* check if not tracked already */
+       if (util_range_find((uintptr_t)addr, len) != NULL) {
+               ERR(
+               "duplicated persistent memory range; presumably unmapped with munmap() instead of pmem_unmap(): addr %p len %zu",
+                       addr, len);
+               errno = ENOMEM;
+               return -1;
+       }
+
+       struct map_tracker *mt;
+       mt  = Malloc(sizeof(struct map_tracker));
+       if (mt == NULL) {
+               ERR("!Malloc");
+               return -1;
+       }
+
+       mt->base_addr = (uintptr_t)addr;
+       mt->end_addr = mt->base_addr + len;
+       mt->type = type;
+       if (type == PMEM_DEV_DAX) {
+               unsigned region_id;
+               int ret = util_ddax_region_find(path, &region_id);
+               if (ret < 0) {
+                       ERR("Cannot find DAX device region id");
+                       return -1;
+               }
+               mt->region_id = region_id;
+       }
+
+       util_rwlock_wrlock(&Mmap_list_lock);
+
+       PMDK_SORTEDQ_INSERT(&Mmap_list, mt, entry, struct map_tracker,
+                       util_range_comparer);
+
+       util_rwlock_unlock(&Mmap_list_lock);
+
+       return 0;
+}
+
+/*
+ * util_range_split -- (internal) remove or split a map tracking entry
+ */
+static int
+util_range_split(struct map_tracker *mt, const void *addrp, const void *endp)
+{
+       LOG(3, "begin %p end %p", addrp, endp);
+
+       uintptr_t addr = (uintptr_t)addrp;
+       uintptr_t end = (uintptr_t)endp;
+       ASSERTne(mt, NULL);
+       if (addr == end || addr % Mmap_align != 0 || end % Mmap_align != 0) {
+               ERR(
+               "invalid munmap length, must be non-zero and page aligned");
+               return -1;
+       }
+
+       struct map_tracker *mtb = NULL;
+       struct map_tracker *mte = NULL;
+
+       /*
+        * 1)    b    e           b     e
+        *    xxxxxxxxxxxxx => xxx.......xxxx  -  mtb+mte
+        * 2)       b     e           b     e
+        *    xxxxxxxxxxxxx => xxxxxxx.......  -  mtb
+        * 3) b     e          b      e
+        *    xxxxxxxxxxxxx => ........xxxxxx  -  mte
+        * 4) b           e    b            e
+        *    xxxxxxxxxxxxx => ..............  -  <none>
+        */
+
+       if (addr > mt->base_addr) {
+               /* case #1/2 */
+               /* new mapping at the beginning */
+               mtb = Malloc(sizeof(struct map_tracker));
+               if (mtb == NULL) {
+                       ERR("!Malloc");
+                       goto err;
+               }
+
+               mtb->base_addr = mt->base_addr;
+               mtb->end_addr = addr;
+               mtb->region_id = mt->region_id;
+               mtb->type = mt->type;
+       }
+
+       if (end < mt->end_addr) {
+               /* case #1/3 */
+               /* new mapping at the end */
+               mte = Malloc(sizeof(struct map_tracker));
+               if (mte == NULL) {
+                       ERR("!Malloc");
+                       goto err;
+               }
+
+               mte->base_addr = end;
+               mte->end_addr = mt->end_addr;
+               mte->region_id = mt->region_id;
+               mte->type = mt->type;
+       }
+
+       PMDK_SORTEDQ_REMOVE(&Mmap_list, mt, entry);
+
+       if (mtb) {
+               PMDK_SORTEDQ_INSERT(&Mmap_list, mtb, entry,
+                               struct map_tracker, util_range_comparer);
+       }
+
+       if (mte) {
+               PMDK_SORTEDQ_INSERT(&Mmap_list, mte, entry,
+                               struct map_tracker, util_range_comparer);
+       }
+
+       /* free entry for the original mapping */
+       Free(mt);
+       return 0;
+
+err:
+       Free(mtb);
+       Free(mte);
+       return -1;
+}
+
+/*
+ * util_range_unregister -- remove a memory range
+ * from map tracking list
+ *
+ * Remove the region between [begin,end].  If it's in a middle of the existing
+ * mapping, it results in two new map trackers.
+ */
+int
+util_range_unregister(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       int ret = 0;
+
+       util_rwlock_wrlock(&Mmap_list_lock);
+
+       /*
+        * Changes in the map tracker list must match the underlying behavior.
+        *
+        * $ man 2 mmap:
+        *      The address addr must be a multiple of the page size (but length
+        *      need not be). All pages containing a part of the indicated range
+        *      are unmapped.
+        *
+        * This means that we must align the length to the page size.
+        */
+       len = PAGE_ALIGNED_UP_SIZE(len);
+
+       void *end = (char *)addr + len;
+
+       /* XXX optimize the loop */
+       struct map_tracker *mt;
+       while ((mt = util_range_find_unlocked((uintptr_t)addr, len)) != NULL) {
+               if (util_range_split(mt, addr, end) != 0) {
+                       ret = -1;
+                       break;
+               }
+       }
+
+       util_rwlock_unlock(&Mmap_list_lock);
+       return ret;
+}
+
+/*
+ * util_range_is_pmem -- return true if entire range
+ * is persistent memory
+ */
+int
+util_range_is_pmem(const void *addrp, size_t len)
+{
+       LOG(10, "addr %p len %zu", addrp, len);
+
+       uintptr_t addr = (uintptr_t)addrp;
+       int retval = 1;
+
+       util_rwlock_rdlock(&Mmap_list_lock);
+
+       do {
+               struct map_tracker *mt = util_range_find(addr, len);
+               if (mt == NULL) {
+                       LOG(4, "address not found 0x%016" PRIxPTR, addr);
+                       retval = 0;
+                       break;
+               }
+
+               LOG(10, "range found - begin 0x%016" PRIxPTR
+                               " end 0x%016" PRIxPTR,
+                               mt->base_addr, mt->end_addr);
+
+               if (mt->base_addr > addr) {
+                       LOG(10, "base address doesn't match: "
+                               "0x%" PRIxPTR " > 0x%" PRIxPTR,
+                                       mt->base_addr, addr);
+                       retval = 0;
+                       break;
+               }
+
+               uintptr_t map_len = mt->end_addr - addr;
+               if (map_len > len)
+                       map_len = len;
+               len -= map_len;
+               addr += map_len;
+       } while (len > 0);
+
+       util_rwlock_unlock(&Mmap_list_lock);
+
+       return retval;
+}
diff --git a/ceph/src/pmdk/src/common/mmap.h b/ceph/src/pmdk/src/common/mmap.h
new file mode 100644 (file)
index 0000000..5fff60e
--- /dev/null
@@ -0,0 +1,142 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * mmap.h -- internal definitions for mmap module
+ */
+
+#ifndef PMDK_MMAP_H
+#define PMDK_MMAP_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "out.h"
+#include "queue.h"
+#include "os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int Mmap_no_random;
+extern void *Mmap_hint;
+extern char *Mmap_mapfile;
+
+void *util_map_sync(void *addr, size_t len, int proto, int flags, int fd,
+       os_off_t offset, int *map_sync);
+void *util_map(int fd, os_off_t off, size_t len, int flags, int rdonly,
+               size_t req_align, int *map_sync);
+int util_unmap(void *addr, size_t len);
+
+#ifdef __FreeBSD__
+#define MAP_NORESERVE 0
+#define OS_MAPFILE "/proc/curproc/map"
+#else
+#define OS_MAPFILE "/proc/self/maps"
+#endif
+
+#ifndef MAP_SYNC
+#define MAP_SYNC 0x80000
+#endif
+
+#ifndef MAP_SHARED_VALIDATE
+#define MAP_SHARED_VALIDATE 0x03
+#endif
+
+/*
+ * macros for micromanaging range protections for the debug version
+ */
+#ifdef DEBUG
+
+#define RANGE(addr, len, is_dev_dax, type) do {\
+       if (!is_dev_dax) ASSERT(util_range_##type(addr, len) >= 0);\
+} while (0)
+
+#else
+
+#define RANGE(addr, len, is_dev_dax, type) do {} while (0)
+
+#endif
+
+#define RANGE_RO(addr, len, is_dev_dax) RANGE(addr, len, is_dev_dax, ro)
+#define RANGE_RW(addr, len, is_dev_dax) RANGE(addr, len, is_dev_dax, rw)
+#define RANGE_NONE(addr, len, is_dev_dax) RANGE(addr, len, is_dev_dax, none)
+
+/* pmem mapping type */
+enum pmem_map_type {
+       PMEM_DEV_DAX,   /* device dax */
+       PMEM_MAP_SYNC,  /* mapping with MAP_SYNC flag on dax fs */
+
+       MAX_PMEM_TYPE
+};
+
+/*
+ * this structure tracks the file mappings outstanding per file handle
+ */
+struct map_tracker {
+       PMDK_SORTEDQ_ENTRY(map_tracker) entry;
+       uintptr_t base_addr;
+       uintptr_t end_addr;
+       unsigned region_id;
+       enum pmem_map_type type;
+#ifdef _WIN32
+       /* Windows-specific data */
+       HANDLE FileHandle;
+       HANDLE FileMappingHandle;
+       DWORD Access;
+       os_off_t Offset;
+       size_t FileLen;
+#endif
+};
+
+void util_mmap_init(void);
+void util_mmap_fini(void);
+
+int util_range_ro(void *addr, size_t len);
+int util_range_rw(void *addr, size_t len);
+int util_range_none(void *addr, size_t len);
+
+char *util_map_hint_unused(void *minaddr, size_t len, size_t align);
+char *util_map_hint(size_t len, size_t req_align);
+
+#define KILOBYTE ((uintptr_t)1 << 10)
+#define MEGABYTE ((uintptr_t)1 << 20)
+#define GIGABYTE ((uintptr_t)1 << 30)
+
+/*
+ * util_map_hint_align -- choose the desired mapping alignment
+ *
+ * The smallest supported alignment is 2 megabytes because of the object
+ * alignment requirements. Changing this value to 4 kilobytes constitues a
+ * layout change.
+ *
+ * Use 1GB page alignment only if the mapping length is at least
+ * twice as big as the page size.
+ */
+static inline size_t
+util_map_hint_align(size_t len, size_t req_align)
+{
+       size_t align = 2 * MEGABYTE;
+       if (req_align)
+               align = req_align;
+       else if (len >= 2 * GIGABYTE)
+               align = GIGABYTE;
+
+       return align;
+}
+
+int util_range_register(const void *addr, size_t len, const char *path,
+               enum pmem_map_type type);
+int util_range_unregister(const void *addr, size_t len);
+struct map_tracker *util_range_find(uintptr_t addr, size_t len);
+int util_range_is_pmem(const void *addr, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/ceph/src/pmdk/src/common/mmap_posix.c b/ceph/src/pmdk/src/common/mmap_posix.c
new file mode 100644 (file)
index 0000000..94c875c
--- /dev/null
@@ -0,0 +1,193 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * mmap_posix.c -- memory-mapped files for Posix
+ */
+
+#include <stdio.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+#include "mmap.h"
+#include "out.h"
+#include "os.h"
+
+#define PROCMAXLEN 2048 /* maximum expected line length in /proc files */
+
+char *Mmap_mapfile = OS_MAPFILE; /* Should be modified only for testing */
+
+#ifdef __FreeBSD__
+static const char * const sscanf_os = "%p %p";
+#else
+static const char * const sscanf_os = "%p-%p";
+#endif
+
+/*
+ * util_map_hint_unused -- use /proc to determine a hint address for mmap()
+ *
+ * This is a helper function for util_map_hint().
+ * It opens up /proc/self/maps and looks for the first unused address
+ * in the process address space that is:
+ * - greater or equal 'minaddr' argument,
+ * - large enough to hold range of given length,
+ * - aligned to the specified unit.
+ *
+ * Asking for aligned address like this will allow the DAX code to use large
+ * mappings.  It is not an error if mmap() ignores the hint and chooses
+ * different address.
+ */
+char *
+util_map_hint_unused(void *minaddr, size_t len, size_t align)
+{
+       LOG(3, "minaddr %p len %zu align %zu", minaddr, len, align);
+       ASSERT(align > 0);
+
+       FILE *fp;
+       if ((fp = os_fopen(Mmap_mapfile, "r")) == NULL) {
+               ERR("!%s", Mmap_mapfile);
+               return MAP_FAILED;
+       }
+
+       char line[PROCMAXLEN];  /* for fgets() */
+       char *lo = NULL;        /* beginning of current range in maps file */
+       char *hi = NULL;        /* end of current range in maps file */
+       char *raddr = minaddr;  /* ignore regions below 'minaddr' */
+
+       if (raddr == NULL)
+               raddr += Pagesize;
+
+       raddr = (char *)roundup((uintptr_t)raddr, align);
+
+       while (fgets(line, PROCMAXLEN, fp) != NULL) {
+               /* check for range line */
+               if (sscanf(line, sscanf_os, &lo, &hi) == 2) {
+                       LOG(4, "%p-%p", lo, hi);
+                       if (lo > raddr) {
+                               if ((uintptr_t)(lo - raddr) >= len) {
+                                       LOG(4, "unused region of size %zu "
+                                                       "found at %p",
+                                                       lo - raddr, raddr);
+                                       break;
+                               } else {
+                                       LOG(4, "region is too small: %zu < %zu",
+                                                       lo - raddr, len);
+                               }
+                       }
+
+                       if (hi > raddr) {
+                               raddr = (char *)roundup((uintptr_t)hi, align);
+                               LOG(4, "nearest aligned addr %p", raddr);
+                       }
+
+                       if (raddr == NULL) {
+                               LOG(4, "end of address space reached");
+                               break;
+                       }
+               }
+       }
+
+       /*
+        * Check for a case when this is the last unused range in the address
+        * space, but is not large enough. (very unlikely)
+        */
+       if ((raddr != NULL) && (UINTPTR_MAX - (uintptr_t)raddr < len)) {
+               ERR("end of address space reached");
+               raddr = MAP_FAILED;
+       }
+
+       fclose(fp);
+
+       LOG(3, "returning %p", raddr);
+       return raddr;
+}
+
+/*
+ * util_map_hint -- determine hint address for mmap()
+ *
+ * If PMEM_MMAP_HINT environment variable is not set, we let the system to pick
+ * the randomized mapping address.  Otherwise, a user-defined hint address
+ * is used.
+ *
+ * ALSR in 64-bit Linux kernel uses 28-bit of randomness for mmap
+ * (bit positions 12-39), which means the base mapping address is randomized
+ * within [0..1024GB] range, with 4KB granularity.  Assuming additional
+ * 1GB alignment, it results in 1024 possible locations.
+ *
+ * Configuring the hint address via PMEM_MMAP_HINT environment variable
+ * disables address randomization.  In such case, the function will search for
+ * the first unused, properly aligned region of given size, above the specified
+ * address.
+ */
+char *
+util_map_hint(size_t len, size_t req_align)
+{
+       LOG(3, "len %zu req_align %zu", len, req_align);
+
+       char *hint_addr = MAP_FAILED;
+
+       /* choose the desired alignment based on the requested length */
+       size_t align = util_map_hint_align(len, req_align);
+
+       if (Mmap_no_random) {
+               LOG(4, "user-defined hint %p", Mmap_hint);
+               hint_addr = util_map_hint_unused(Mmap_hint, len, align);
+       } else {
+               /*
+                * Create dummy mapping to find an unused region of given size.
+                * Request for increased size for later address alignment.
+                * Use MAP_PRIVATE with read-only access to simulate
+                * zero cost for overcommit accounting.  Note: MAP_NORESERVE
+                * flag is ignored if overcommit is disabled (mode 2).
+                */
+               char *addr = mmap(NULL, len + align, PROT_READ,
+                                       MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+               if (addr == MAP_FAILED) {
+                       ERR("!mmap MAP_ANONYMOUS");
+               } else {
+                       LOG(4, "system choice %p", addr);
+                       hint_addr = (char *)roundup((uintptr_t)addr, align);
+                       munmap(addr, len + align);
+               }
+       }
+       LOG(4, "hint %p", hint_addr);
+
+       return hint_addr;
+}
+
+/*
+ * util_map_sync -- memory map given file into memory, if MAP_SHARED flag is
+ * provided it attempts to use MAP_SYNC flag. Otherwise it fallbacks to
+ * mmap(2).
+ */
+void *
+util_map_sync(void *addr, size_t len, int proto, int flags, int fd,
+       os_off_t offset, int *map_sync)
+{
+       LOG(15, "addr %p len %zu proto %x flags %x fd %d offset %ld "
+               "map_sync %p", addr, len, proto, flags, fd, offset, map_sync);
+
+       if (map_sync)
+               *map_sync = 0;
+
+       /* if map_sync is NULL do not even try to mmap with MAP_SYNC flag */
+       if (!map_sync || flags & MAP_PRIVATE)
+               return mmap(addr, len, proto, flags, fd, offset);
+
+       /* MAP_SHARED */
+       void *ret = mmap(addr, len, proto,
+                       flags | MAP_SHARED_VALIDATE | MAP_SYNC,
+                       fd, offset);
+       if (ret != MAP_FAILED) {
+               LOG(4, "mmap with MAP_SYNC succeeded");
+               *map_sync = 1;
+               return ret;
+       }
+
+       if (errno == EINVAL || errno == ENOTSUP) {
+               LOG(4, "mmap with MAP_SYNC not supported");
+               return mmap(addr, len, proto, flags, fd, offset);
+       }
+
+       /* other error */
+       return MAP_FAILED;
+}
diff --git a/ceph/src/pmdk/src/common/mmap_windows.c b/ceph/src/pmdk/src/common/mmap_windows.c
new file mode 100644 (file)
index 0000000..f88a2e1
--- /dev/null
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2018, Intel Corporation */
+/*
+ * Copyright (c) 2015-2017, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * mmap_windows.c -- memory-mapped files for Windows
+ */
+
+#include <sys/mman.h>
+#include "mmap.h"
+#include "out.h"
+
+/*
+ * util_map_hint_unused -- use VirtualQuery to determine hint address
+ *
+ * This is a helper function for util_map_hint().
+ * It iterates through memory regions and looks for the first unused address
+ * in the process address space that is:
+ * - greater or equal 'minaddr' argument,
+ * - large enough to hold range of given length,
+ * - aligned to the specified unit.
+ */
+char *
+util_map_hint_unused(void *minaddr, size_t len, size_t align)
+{
+       LOG(3, "minaddr %p len %zu align %zu", minaddr, len, align);
+
+       ASSERT(align > 0);
+
+       MEMORY_BASIC_INFORMATION mi;
+       char *lo = NULL;        /* beginning of current range in maps file */
+       char *hi = NULL;        /* end of current range in maps file */
+       char *raddr = minaddr;  /* ignore regions below 'minaddr' */
+
+       if (raddr == NULL)
+               raddr += Pagesize;
+
+       raddr = (char *)roundup((uintptr_t)raddr, align);
+
+       while ((uintptr_t)raddr < UINTPTR_MAX - len) {
+               size_t ret = VirtualQuery(raddr, &mi, sizeof(mi));
+               if (ret == 0) {
+                       ERR("VirtualQuery %p", raddr);
+                       return MAP_FAILED;
+               }
+               LOG(4, "addr %p len %zu state %d",
+                       mi.BaseAddress, mi.RegionSize, mi.State);
+
+               if ((mi.State != MEM_FREE) || (mi.RegionSize < len)) {
+                       raddr = (char *)mi.BaseAddress + mi.RegionSize;
+                       raddr = (char *)roundup((uintptr_t)raddr, align);
+                       LOG(4, "nearest aligned addr %p", raddr);
+               } else {
+                       LOG(4, "unused region of size %zu found at %p",
+                               mi.RegionSize, mi.BaseAddress);
+                       return mi.BaseAddress;
+               }
+       }
+
+       LOG(4, "end of address space reached");
+       return MAP_FAILED;
+}
+
+/*
+ * util_map_hint -- determine hint address for mmap()
+ *
+ * XXX - Windows doesn't support large DAX pages yet, so there is
+ * no point in aligning for the same.
+ */
+char *
+util_map_hint(size_t len, size_t req_align)
+{
+       LOG(3, "len %zu req_align %zu", len, req_align);
+
+       char *hint_addr = MAP_FAILED;
+
+       /* choose the desired alignment based on the requested length */
+       size_t align = util_map_hint_align(len, req_align);
+
+       if (Mmap_no_random) {
+               LOG(4, "user-defined hint %p", Mmap_hint);
+               hint_addr = util_map_hint_unused(Mmap_hint, len, align);
+       } else {
+               /*
+                * Create dummy mapping to find an unused region of given size.
+                * Request for increased size for later address alignment.
+                *
+                * Use MAP_NORESERVE flag to only reserve the range of pages
+                * rather than commit.  We don't want the pages to be actually
+                * backed by the operating system paging file, as the swap
+                * file is usually too small to handle terabyte pools.
+                */
+               char *addr = mmap(NULL, len + align, PROT_READ,
+                               MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0);
+               if (addr != MAP_FAILED) {
+                       LOG(4, "system choice %p", addr);
+                       hint_addr = (char *)roundup((uintptr_t)addr, align);
+                       munmap(addr, len + align);
+               }
+       }
+
+       LOG(4, "hint %p", hint_addr);
+       return hint_addr;
+}
+
+/*
+ * util_map_sync -- memory map given file into memory
+ */
+void *
+util_map_sync(void *addr, size_t len, int proto, int flags, int fd,
+       os_off_t offset, int *map_sync)
+{
+       LOG(15, "addr %p len %zu proto %x flags %x fd %d offset %ld",
+               addr, len, proto, flags, fd, offset);
+
+       if (map_sync)
+               *map_sync = 0;
+
+       return mmap(addr, len, proto, flags, fd, offset);
+}
diff --git a/ceph/src/pmdk/src/common/os_deep.h b/ceph/src/pmdk/src/common/os_deep.h
new file mode 100644 (file)
index 0000000..31f4965
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * os_deep.h -- abstraction layer for common usage of deep_* functions
+ */
+
+#ifndef PMDK_OS_DEEP_PERSIST_H
+#define PMDK_OS_DEEP_PERSIST_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+#include "set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int os_range_deep_common(uintptr_t addr, size_t len);
+int os_part_deep_common(struct pool_replica *rep, unsigned partidx, void *addr,
+                       size_t len, int flush);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/os_deep_linux.c b/ceph/src/pmdk/src/common/os_deep_linux.c
new file mode 100644 (file)
index 0000000..03599e5
--- /dev/null
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * os_deep_linux.c -- Linux abstraction layer
+ */
+
+#define _GNU_SOURCE
+
+#include <inttypes.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include "out.h"
+#include "os.h"
+#include "mmap.h"
+#include "file.h"
+#include "libpmem.h"
+#include "os_deep.h"
+#include "../libpmem2/deep_flush.h"
+
+/*
+ * os_deep_type -- (internal) perform deep operation based on a pmem
+ * mapping type
+ */
+static int
+os_deep_type(const struct map_tracker *mt, void *addr, size_t len)
+{
+       LOG(15, "mt %p addr %p len %zu", mt, addr, len);
+
+       switch (mt->type) {
+       case PMEM_DEV_DAX:
+               pmem_drain();
+
+               int ret = pmem2_deep_flush_write(mt->region_id);
+               if (ret < 0) {
+                       if (ret == PMEM2_E_NOSUPP) {
+                               errno = ENOTSUP;
+                               LOG(1, "!deep_flush not supported");
+                       } else {
+                               errno = pmem2_err_to_errno(ret);
+                               LOG(2, "cannot write to deep_flush"
+                                       "in region %u", mt->region_id);
+                       }
+                       return -1;
+               }
+               return 0;
+       case PMEM_MAP_SYNC:
+               return pmem_msync(addr, len);
+       default:
+               ASSERT(0);
+               return -1;
+       }
+}
+
+/*
+ * os_range_deep_common -- perform deep action of given address range
+ */
+int
+os_range_deep_common(uintptr_t addr, size_t len)
+{
+       LOG(3, "addr 0x%016" PRIxPTR " len %zu", addr, len);
+
+       while (len != 0) {
+               const struct map_tracker *mt = util_range_find(addr, len);
+
+               /* no more overlapping track regions or NOT a device DAX */
+               if (mt == NULL) {
+                       LOG(15, "pmem_msync addr %p, len %lu",
+                               (void *)addr, len);
+                       return pmem_msync((void *)addr, len);
+               }
+               /*
+                * For range that intersects with the found mapping
+                * write to (Device DAX) deep_flush file.
+                * Call msync for the non-intersecting part.
+                */
+               if (mt->base_addr > addr) {
+                       size_t curr_len = mt->base_addr - addr;
+                       if (curr_len > len)
+                               curr_len = len;
+                       if (pmem_msync((void *)addr, curr_len) != 0)
+                               return -1;
+                       len -= curr_len;
+                       if (len == 0)
+                               return 0;
+                       addr = mt->base_addr;
+               }
+               size_t mt_in_len = mt->end_addr - addr;
+               size_t persist_len = MIN(len, mt_in_len);
+
+               if (os_deep_type(mt, (void *)addr, persist_len))
+                       return -1;
+
+               if (mt->end_addr >= addr + len)
+                       return 0;
+
+               len -= mt_in_len;
+               addr = mt->end_addr;
+       }
+       return 0;
+}
+
+/*
+ * os_part_deep_common -- common function to handle both
+ * deep_persist and deep_drain part flush cases.
+ */
+int
+os_part_deep_common(struct pool_replica *rep, unsigned partidx, void *addr,
+                       size_t len, int flush)
+{
+       LOG(3, "part %p part %d addr %p len %lu flush %d",
+               rep, partidx, addr, len, flush);
+
+       if (!rep->is_pmem) {
+               /*
+                * In case of part on non-pmem call msync on the range
+                * to deep flush the data. Deep drain is empty as all
+                * data is msynced to persistence.
+                */
+
+               if (!flush)
+                       return 0;
+
+               if (pmem_msync(addr, len)) {
+                       LOG(1, "pmem_msync(%p, %lu)", addr, len);
+                       return -1;
+               }
+               return 0;
+       }
+       struct pool_set_part part = rep->part[partidx];
+       /* Call deep flush if it was requested */
+       if (flush) {
+               LOG(15, "pmem_deep_flush addr %p, len %lu", addr, len);
+               pmem_deep_flush(addr, len);
+       }
+       /*
+        * Before deep drain call normal drain to ensure that data
+        * is at least in WPQ.
+        */
+       pmem_drain();
+
+       if (part.is_dev_dax) {
+               /*
+                * During deep_drain for part on device DAX search for
+                * device region id, and perform WPQ flush on found
+                * device DAX region.
+                */
+               unsigned region_id;
+               int ret = util_ddax_region_find(part.path, &region_id);
+
+               if (ret < 0) {
+                       if (errno == ENOENT) {
+                               errno = ENOTSUP;
+                               LOG(1, "!deep_flush not supported");
+                       } else {
+                               LOG(1, "invalid dax_region id %u", region_id);
+                       }
+                       return -1;
+               }
+
+               if (pmem2_deep_flush_write(region_id)) {
+                       LOG(1, "pmem2_deep_flush_write(%u)",
+                               region_id);
+                       return -1;
+               }
+       } else {
+               /*
+                * For deep_drain on normal pmem it is enough to
+                * call msync on one page.
+                */
+               if (pmem_msync(addr, MIN(Pagesize, len))) {
+                       LOG(1, "pmem_msync(%p, %lu)", addr, len);
+                       return -1;
+               }
+       }
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/os_deep_windows.c b/ceph/src/pmdk/src/common/os_deep_windows.c
new file mode 100644 (file)
index 0000000..90994e8
--- /dev/null
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2018, Intel Corporation */
+
+/*
+ * os_deep_windows.c -- Windows abstraction layer for deep_* functions
+ */
+
+#include <windows.h>
+#include "out.h"
+#include "os.h"
+#include "set.h"
+#include "libpmem.h"
+
+/*
+ * os_range_deep_common -- call msnyc for non DEV dax
+ */
+int
+os_range_deep_common(uintptr_t addr, size_t len)
+{
+       LOG(3, "os_range_deep_common addr %p len %lu", addr, len);
+
+       if (len == 0)
+               return 0;
+       return pmem_msync((void *)addr, len);
+}
+
+/*
+ * os_part_deep_common -- common function to handle both
+ * deep_persist and deep_drain part flush cases.
+ */
+int
+os_part_deep_common(struct pool_replica *rep, unsigned partidx, void *addr,
+                       size_t len, int flush)
+{
+       LOG(3, "part %p part %d addr %p len %lu flush %d",
+               rep, partidx, addr, len, flush);
+
+       if (!rep->is_pmem) {
+               /*
+                * In case of part on non-pmem call msync on the range
+                * to deep flush the data. Deep drain is empty as all
+                * data is msynced to persistence.
+                */
+
+               if (!flush)
+                       return 0;
+
+               if (pmem_msync(addr, len)) {
+                       LOG(1, "pmem_msync(%p, %lu)", addr, len);
+                       return -1;
+               }
+               return 0;
+       }
+
+       /* Call deep flush if it was requested */
+       if (flush) {
+               LOG(15, "pmem_deep_flush addr %p, len %lu", addr, len);
+               pmem_deep_flush(addr, len);
+       }
+       /*
+        * Before deep drain call normal drain to ensure that data
+        * is at least in WPQ.
+        */
+       pmem_drain();
+
+       /*
+        * For deep_drain on normal pmem it is enough to
+        * call msync on one page.
+        */
+       if (pmem_msync(addr, MIN(Pagesize, len))) {
+               LOG(1, "pmem_msync(%p, %lu)", addr, len);
+               return -1;
+       }
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/page_size.h b/ceph/src/pmdk/src/common/page_size.h
new file mode 100644 (file)
index 0000000..978eb33
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+/* Copyright 2019, IBM Corporation */
+
+#ifndef PMDK_PAGE_SIZE_H
+#define PMDK_PAGE_SIZE_H
+
+#if defined(__x86_64) || defined(_M_X64) || defined(__aarch64__)
+
+#define PMEM_PAGESIZE 4096
+
+#elif defined(__PPC64__)
+
+#define PMEM_PAGESIZE 65536
+
+#else
+
+#error unable to recognize ISA at compile time
+
+#endif
+
+#endif  /* PMDK_PAGE_SIZE_H */
diff --git a/ceph/src/pmdk/src/common/pmemcommon.h b/ceph/src/pmdk/src/common/pmemcommon.h
new file mode 100644 (file)
index 0000000..8647363
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * pmemcommon.h -- definitions for "common" module
+ */
+
+#ifndef PMEMCOMMON_H
+#define PMEMCOMMON_H 1
+
+#include "mmap.h"
+#include "pmemcore.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline void
+common_init(const char *log_prefix, const char *log_level_var,
+               const char *log_file_var, int major_version,
+               int minor_version)
+{
+       core_init(log_prefix, log_level_var, log_file_var, major_version,
+               minor_version);
+       util_mmap_init();
+}
+
+static inline void
+common_fini(void)
+{
+       util_mmap_fini();
+       core_fini();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/pmemcommon.inc b/ceph/src/pmdk/src/common/pmemcommon.inc
new file mode 100644 (file)
index 0000000..7b2d433
--- /dev/null
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2019, Intel Corporation
+#
+# src/pmemcommon.inc -- common SOURCE definitions for PMDK libraries
+#
+
+SOURCE +=\
+       $(COMMON)/bad_blocks.c\
+       $(COMMON)/set_badblocks.c\
+       $(COMMON)/ctl.c\
+       $(COMMON)/ctl_prefault.c\
+       $(COMMON)/ctl_sds.c\
+       $(COMMON)/ctl_fallocate.c\
+       $(COMMON)/ctl_cow.c\
+       $(COMMON)/file.c\
+       $(COMMON)/file_posix.c\
+       $(COMMON)/mmap.c\
+       $(COMMON)/mmap_posix.c\
+       $(COMMON)/os_deep_linux.c\
+       $(COMMON)/pool_hdr.c\
+       $(COMMON)/rand.c\
+       $(COMMON)/ravl.c\
+       $(COMMON)/set.c\
+       $(COMMON)/shutdown_state.c\
+       $(COMMON)/uuid.c\
+       $(call osdep, $(COMMON)/uuid,.c)\
+       $(PMEM2)/pmem2_utils.c\
+       $(PMEM2)/config.c\
+       $(PMEM2)/persist_posix.c\
+       $(PMEM2)/badblocks.c\
+       $(PMEM2)/badblocks_$(OS_DIMM).c\
+       $(PMEM2)/usc_$(OS_DIMM).c\
+       $(PMEM2)/source.c\
+       $(PMEM2)/source_posix.c
+
+ifeq ($(OS_KERNEL_NAME),Linux)
+SOURCE +=\
+       $(PMEM2)/auto_flush_linux.c\
+       $(PMEM2)/deep_flush_linux.c\
+       $(PMEM2)/extent_linux.c\
+       $(PMEM2)/pmem2_utils_linux.c\
+       $(PMEM2)/pmem2_utils_$(OS_DIMM).c
+else
+SOURCE +=\
+       $(PMEM2)/auto_flush_none.c\
+       $(PMEM2)/deep_flush_other.c\
+       $(PMEM2)/extent_none.c\
+       $(PMEM2)/pmem2_utils_other.c
+endif
+
+ifeq ($(OS_DIMM),ndctl)
+SOURCE += $(PMEM2)/region_namespace_ndctl.c
+else
+SOURCE += $(PMEM2)/region_namespace_none.c
+endif
diff --git a/ceph/src/pmdk/src/common/pool_hdr.c b/ceph/src/pmdk/src/common/pool_hdr.c
new file mode 100644 (file)
index 0000000..dc6985f
--- /dev/null
@@ -0,0 +1,345 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * pool_hdr.c -- pool header utilities
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <endian.h>
+
+#include "out.h"
+#include "pool_hdr.h"
+
+/* Determine ISA for which PMDK is currently compiled */
+#if defined(__x86_64) || defined(_M_X64)
+/* x86 -- 64 bit */
+#define PMDK_MACHINE PMDK_MACHINE_X86_64
+#define PMDK_MACHINE_CLASS PMDK_MACHINE_CLASS_64
+
+#elif defined(__aarch64__)
+/* 64 bit ARM not supported yet */
+#define PMDK_MACHINE PMDK_MACHINE_AARCH64
+#define PMDK_MACHINE_CLASS PMDK_MACHINE_CLASS_64
+
+#elif defined(__PPC64__)
+#define PMDK_MACHINE PMDK_MACHINE_PPC64
+#define PMDK_MACHINE_CLASS PMDK_MACHINE_CLASS_64
+
+#else
+/* add appropriate definitions here when porting PMDK to another ISA */
+#error unable to recognize ISA at compile time
+
+#endif
+
+/*
+ * arch_machine -- (internal) determine endianness
+ */
+static uint8_t
+arch_data(void)
+{
+       uint16_t word = (PMDK_DATA_BE << 8) + PMDK_DATA_LE;
+       return ((uint8_t *)&word)[0];
+}
+
+/*
+ * util_get_arch_flags -- get architecture identification flags
+ */
+void
+util_get_arch_flags(struct arch_flags *arch_flags)
+{
+       memset(arch_flags, 0, sizeof(*arch_flags));
+       arch_flags->machine = PMDK_MACHINE;
+       arch_flags->machine_class = PMDK_MACHINE_CLASS;
+       arch_flags->data = arch_data();
+       arch_flags->alignment_desc = alignment_desc();
+}
+
+/*
+ * util_convert2le_hdr -- convert pool_hdr into little-endian byte order
+ */
+void
+util_convert2le_hdr(struct pool_hdr *hdrp)
+{
+       hdrp->major = htole32(hdrp->major);
+       hdrp->features.compat = htole32(hdrp->features.compat);
+       hdrp->features.incompat = htole32(hdrp->features.incompat);
+       hdrp->features.ro_compat = htole32(hdrp->features.ro_compat);
+       hdrp->arch_flags.alignment_desc =
+               htole64(hdrp->arch_flags.alignment_desc);
+       hdrp->arch_flags.machine = htole16(hdrp->arch_flags.machine);
+       hdrp->crtime = htole64(hdrp->crtime);
+       hdrp->checksum = htole64(hdrp->checksum);
+}
+
+/*
+ * util_convert2h_hdr_nocheck -- convert pool_hdr into host byte order
+ */
+void
+util_convert2h_hdr_nocheck(struct pool_hdr *hdrp)
+{
+       hdrp->major = le32toh(hdrp->major);
+       hdrp->features.compat = le32toh(hdrp->features.compat);
+       hdrp->features.incompat = le32toh(hdrp->features.incompat);
+       hdrp->features.ro_compat = le32toh(hdrp->features.ro_compat);
+       hdrp->crtime = le64toh(hdrp->crtime);
+       hdrp->arch_flags.machine = le16toh(hdrp->arch_flags.machine);
+       hdrp->arch_flags.alignment_desc =
+               le64toh(hdrp->arch_flags.alignment_desc);
+       hdrp->checksum = le64toh(hdrp->checksum);
+}
+
+/*
+ * util_arch_flags_check -- validates arch_flags
+ */
+int
+util_check_arch_flags(const struct arch_flags *arch_flags)
+{
+       struct arch_flags cur_af;
+       int ret = 0;
+
+       util_get_arch_flags(&cur_af);
+
+       if (!util_is_zeroed(&arch_flags->reserved,
+                               sizeof(arch_flags->reserved))) {
+               ERR("invalid reserved values");
+               ret = -1;
+       }
+
+       if (arch_flags->machine != cur_af.machine) {
+               ERR("invalid machine value");
+               ret = -1;
+       }
+
+       if (arch_flags->data != cur_af.data) {
+               ERR("invalid data value");
+               ret = -1;
+       }
+
+       if (arch_flags->machine_class != cur_af.machine_class) {
+               ERR("invalid machine_class value");
+               ret = -1;
+       }
+
+       if (arch_flags->alignment_desc != cur_af.alignment_desc) {
+               ERR("invalid alignment_desc value");
+               ret = -1;
+       }
+
+       return ret;
+}
+
+/*
+ * util_get_unknown_features -- filter out unknown features flags
+ */
+features_t
+util_get_unknown_features(features_t features, features_t known)
+{
+       features_t unknown;
+       unknown.compat = util_get_not_masked_bits(
+                       features.compat, known.compat);
+       unknown.incompat = util_get_not_masked_bits(
+                       features.incompat, known.incompat);
+       unknown.ro_compat = util_get_not_masked_bits(
+                       features.ro_compat, known.ro_compat);
+       return unknown;
+}
+
+/*
+ * util_feature_check -- check features masks
+ */
+int
+util_feature_check(struct pool_hdr *hdrp, features_t known)
+{
+       LOG(3, "hdrp %p features {incompat %#x ro_compat %#x compat %#x}",
+                       hdrp,
+                       known.incompat, known.ro_compat, known.compat);
+
+       features_t unknown = util_get_unknown_features(hdrp->features, known);
+
+       /* check incompatible ("must support") features */
+       if (unknown.incompat) {
+               ERR("unsafe to continue due to unknown incompat "\
+                               "features: %#x", unknown.incompat);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check RO-compatible features (force RO if unsupported) */
+       if (unknown.ro_compat) {
+               ERR("switching to read-only mode due to unknown ro_compat "\
+                               "features: %#x", unknown.ro_compat);
+               return 0;
+       }
+
+       /* check compatible ("may") features */
+       if (unknown.compat) {
+               LOG(3, "ignoring unknown compat features: %#x", unknown.compat);
+       }
+
+       return 1;
+}
+
+/*
+ * util_feature_cmp -- compares features with reference
+ *
+ * returns 1 if features and reference match and 0 otherwise
+ */
+int
+util_feature_cmp(features_t features, features_t ref)
+{
+       LOG(3, "features {incompat %#x ro_compat %#x compat %#x} "
+                       "ref {incompat %#x ro_compat %#x compat %#x}",
+                       features.incompat, features.ro_compat, features.compat,
+                       ref.incompat, ref.ro_compat, ref.compat);
+
+       return features.compat == ref.compat &&
+                       features.incompat == ref.incompat &&
+                       features.ro_compat == ref.ro_compat;
+}
+
+/*
+ * util_feature_is_zero -- check if features flags are zeroed
+ *
+ * returns 1 if features is zeroed and 0 otherwise
+ */
+int
+util_feature_is_zero(features_t features)
+{
+       const uint32_t bits =
+                       features.compat | features.incompat |
+                       features.ro_compat;
+       return bits ? 0 : 1;
+}
+
+/*
+ * util_feature_is_set -- check if feature flag is set in features
+ *
+ * returns 1 if feature flag is set and 0 otherwise
+ */
+int
+util_feature_is_set(features_t features, features_t flag)
+{
+       uint32_t bits = 0;
+       bits |= features.compat & flag.compat;
+       bits |= features.incompat & flag.incompat;
+       bits |= features.ro_compat & flag.ro_compat;
+       return bits ? 1 : 0;
+}
+
+/*
+ * util_feature_enable -- enable feature
+ */
+void
+util_feature_enable(features_t *features, features_t new_feature)
+{
+#define FEATURE_ENABLE(flags, X) \
+       (flags) |= (X)
+
+       FEATURE_ENABLE(features->compat, new_feature.compat);
+       FEATURE_ENABLE(features->incompat, new_feature.incompat);
+       FEATURE_ENABLE(features->ro_compat, new_feature.ro_compat);
+
+#undef FEATURE_ENABLE
+}
+
+/*
+ * util_feature_disable -- (internal) disable feature
+ */
+void
+util_feature_disable(features_t *features, features_t old_feature)
+{
+#define FEATURE_DISABLE(flags, X) \
+       (flags) &= ~(X)
+
+       FEATURE_DISABLE(features->compat, old_feature.compat);
+       FEATURE_DISABLE(features->incompat, old_feature.incompat);
+       FEATURE_DISABLE(features->ro_compat, old_feature.ro_compat);
+
+#undef FEATURE_DISABLE
+}
+
+static const features_t feature_2_pmempool_feature_map[] = {
+       FEAT_INCOMPAT(SINGLEHDR),       /* PMEMPOOL_FEAT_SINGLEHDR */
+       FEAT_INCOMPAT(CKSUM_2K),        /* PMEMPOOL_FEAT_CKSUM_2K */
+       FEAT_INCOMPAT(SDS),             /* PMEMPOOL_FEAT_SHUTDOWN_STATE */
+       FEAT_COMPAT(CHECK_BAD_BLOCKS),  /* PMEMPOOL_FEAT_CHECK_BAD_BLOCKS */
+};
+
+#define FEAT_2_PMEMPOOL_FEATURE_MAP_SIZE \
+       ARRAY_SIZE(feature_2_pmempool_feature_map)
+
+static const char *str_2_pmempool_feature_map[] = {
+       "SINGLEHDR",
+       "CKSUM_2K",
+       "SHUTDOWN_STATE",
+       "CHECK_BAD_BLOCKS",
+};
+
+#define PMEMPOOL_FEATURE_2_STR_MAP_SIZE ARRAY_SIZE(str_2_pmempool_feature_map)
+
+/*
+ * util_str2feature -- convert string to feat_flags value
+ */
+features_t
+util_str2feature(const char *str)
+{
+       /* all features have to be named in incompat_features_str array */
+       COMPILE_ERROR_ON(FEAT_2_PMEMPOOL_FEATURE_MAP_SIZE !=
+                       PMEMPOOL_FEATURE_2_STR_MAP_SIZE);
+
+       for (uint32_t f = 0; f < PMEMPOOL_FEATURE_2_STR_MAP_SIZE; ++f) {
+               if (strcmp(str, str_2_pmempool_feature_map[f]) == 0) {
+                       return feature_2_pmempool_feature_map[f];
+               }
+       }
+       return features_zero;
+}
+
+/*
+ * util_feature2pmempool_feature -- convert feature to pmempool_feature
+ */
+uint32_t
+util_feature2pmempool_feature(features_t feat)
+{
+       for (uint32_t pf = 0; pf < FEAT_2_PMEMPOOL_FEATURE_MAP_SIZE; ++pf) {
+               const features_t *record =
+                               &feature_2_pmempool_feature_map[pf];
+               if (util_feature_cmp(feat, *record)) {
+                       return pf;
+               }
+       }
+       return UINT32_MAX;
+}
+
+/*
+ * util_str2pmempool_feature -- convert string to uint32_t enum pmempool_feature
+ * equivalent
+ */
+uint32_t
+util_str2pmempool_feature(const char *str)
+{
+       features_t fval = util_str2feature(str);
+       if (util_feature_is_zero(fval))
+               return UINT32_MAX;
+       return util_feature2pmempool_feature(fval);
+}
+
+/*
+ * util_feature2str -- convert uint32_t feature to string
+ */
+const char *
+util_feature2str(features_t features, features_t *found)
+{
+       for (uint32_t i = 0; i < FEAT_2_PMEMPOOL_FEATURE_MAP_SIZE; ++i) {
+               const features_t *record = &feature_2_pmempool_feature_map[i];
+               if (util_feature_is_set(features, *record)) {
+                       if (found)
+                               memcpy(found, record, sizeof(features_t));
+                       return str_2_pmempool_feature_map[i];
+               }
+       }
+       return NULL;
+}
diff --git a/ceph/src/pmdk/src/common/pool_hdr.h b/ceph/src/pmdk/src/common/pool_hdr.h
new file mode 100644 (file)
index 0000000..eb7e907
--- /dev/null
@@ -0,0 +1,259 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * pool_hdr.h -- internal definitions for pool header module
+ */
+
+#ifndef PMDK_POOL_HDR_H
+#define PMDK_POOL_HDR_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include <unistd.h>
+#include "uuid.h"
+#include "shutdown_state.h"
+#include "util.h"
+#include "page_size.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Number of bits per type in alignment descriptor
+ */
+#define ALIGNMENT_DESC_BITS            4
+
+/*
+ * architecture identification flags
+ *
+ * These flags allow to unambiguously determine the architecture
+ * on which the pool was created.
+ *
+ * The alignment_desc field contains information about alignment
+ * of the following basic types:
+ * - char
+ * - short
+ * - int
+ * - long
+ * - long long
+ * - size_t
+ * - os_off_t
+ * - float
+ * - double
+ * - long double
+ * - void *
+ *
+ * The alignment of each type is computed as an offset of field
+ * of specific type in the following structure:
+ * struct {
+ *     char byte;
+ *     type field;
+ * };
+ *
+ * The value is decremented by 1 and masked by 4 bits.
+ * Multiple alignments are stored on consecutive 4 bits of each
+ * type in the order specified above.
+ *
+ * The values used in the machine, and machine_class fields are in
+ * principle independent of operating systems, and object formats.
+ * In practice they happen to match constants used in ELF object headers.
+ */
+struct arch_flags {
+       uint64_t alignment_desc;        /* alignment descriptor */
+       uint8_t machine_class;          /* address size -- 64 bit or 32 bit */
+       uint8_t data;                   /* data encoding -- LE or BE */
+       uint8_t reserved[4];
+       uint16_t machine;               /* required architecture */
+};
+
+#define POOL_HDR_ARCH_LEN sizeof(struct arch_flags)
+
+/* possible values of the machine class field in the above struct */
+#define PMDK_MACHINE_CLASS_64 2 /* 64 bit pointers, 64 bit size_t */
+
+/* possible values of the machine field in the above struct */
+#define PMDK_MACHINE_X86_64 62
+#define PMDK_MACHINE_AARCH64 183
+#define PMDK_MACHINE_PPC64 21
+
+/* possible values of the data field in the above struct */
+#define PMDK_DATA_LE 1 /* 2's complement, little endian */
+#define PMDK_DATA_BE 2 /* 2's complement, big endian */
+
+/*
+ * features flags
+ */
+typedef struct {
+       uint32_t compat;        /* mask: compatible "may" features */
+       uint32_t incompat;      /* mask: "must support" features */
+       uint32_t ro_compat;     /* mask: force RO if unsupported */
+} features_t;
+
+/*
+ * header used at the beginning of all types of memory pools
+ *
+ * for pools build on persistent memory, the integer types
+ * below are stored in little-endian byte order.
+ */
+#define POOL_HDR_SIG_LEN 8
+#define POOL_HDR_UNUSED_SIZE 1904
+#define POOL_HDR_UNUSED2_SIZE 1976
+#define POOL_HDR_ALIGN_PAD (PMEM_PAGESIZE - 4096)
+struct pool_hdr {
+       char signature[POOL_HDR_SIG_LEN];
+       uint32_t major;                 /* format major version number */
+       features_t features;            /* features flags */
+       uuid_t poolset_uuid;            /* pool set UUID */
+       uuid_t uuid;                    /* UUID of this file */
+       uuid_t prev_part_uuid;          /* prev part */
+       uuid_t next_part_uuid;          /* next part */
+       uuid_t prev_repl_uuid;          /* prev replica */
+       uuid_t next_repl_uuid;          /* next replica */
+       uint64_t crtime;                /* when created (seconds since epoch) */
+       struct arch_flags arch_flags;   /* architecture identification flags */
+       unsigned char unused[POOL_HDR_UNUSED_SIZE];     /* must be zero */
+       /* not checksumed */
+       unsigned char unused2[POOL_HDR_UNUSED2_SIZE];   /* must be zero */
+       struct shutdown_state sds;      /* shutdown status */
+       uint64_t checksum;              /* checksum of above fields */
+
+#if PMEM_PAGESIZE > 4096 /* prevent zero size array */
+       unsigned char align_pad[POOL_HDR_ALIGN_PAD];    /* alignment pad */
+#endif
+};
+
+#define POOL_HDR_SIZE  (sizeof(struct pool_hdr))
+
+#define POOL_DESC_SIZE PMEM_PAGESIZE
+
+void util_convert2le_hdr(struct pool_hdr *hdrp);
+void util_convert2h_hdr_nocheck(struct pool_hdr *hdrp);
+
+void util_get_arch_flags(struct arch_flags *arch_flags);
+int util_check_arch_flags(const struct arch_flags *arch_flags);
+
+features_t util_get_unknown_features(features_t features, features_t known);
+int util_feature_check(struct pool_hdr *hdrp, features_t features);
+int util_feature_cmp(features_t features, features_t ref);
+int util_feature_is_zero(features_t features);
+int util_feature_is_set(features_t features, features_t flag);
+void util_feature_enable(features_t *features, features_t new_feature);
+void util_feature_disable(features_t *features, features_t new_feature);
+
+const char *util_feature2str(features_t feature, features_t *found);
+features_t util_str2feature(const char *str);
+uint32_t util_str2pmempool_feature(const char *str);
+uint32_t util_feature2pmempool_feature(features_t feat);
+
+/*
+ * set of macros for determining the alignment descriptor
+ */
+#define DESC_MASK              ((1 << ALIGNMENT_DESC_BITS) - 1)
+#define alignment_of(t)                offsetof(struct { char c; t x; }, x)
+#define alignment_desc_of(t)   (((uint64_t)alignment_of(t) - 1) & DESC_MASK)
+#define alignment_desc()\
+(alignment_desc_of(char)       <<  0 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(short)      <<  1 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(int)                <<  2 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(long)       <<  3 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(long long)  <<  4 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(size_t)     <<  5 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(off_t)      <<  6 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(float)      <<  7 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(double)     <<  8 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(long double)        <<  9 * ALIGNMENT_DESC_BITS) |\
+(alignment_desc_of(void *)     << 10 * ALIGNMENT_DESC_BITS)
+
+#define POOL_FEAT_ZERO         0x0000U
+
+static const features_t features_zero =
+       {POOL_FEAT_ZERO, POOL_FEAT_ZERO, POOL_FEAT_ZERO};
+
+/*
+ * compat features
+ */
+#define POOL_FEAT_CHECK_BAD_BLOCKS     0x0001U /* check bad blocks in a pool */
+
+#define POOL_FEAT_COMPAT_ALL \
+       (POOL_FEAT_CHECK_BAD_BLOCKS)
+
+#define FEAT_COMPAT(X) \
+       {POOL_FEAT_##X, POOL_FEAT_ZERO, POOL_FEAT_ZERO}
+
+/*
+ * incompat features
+ */
+#define POOL_FEAT_SINGLEHDR    0x0001U /* pool header only in the first part */
+#define POOL_FEAT_CKSUM_2K     0x0002U /* only first 2K of hdr checksummed */
+#define POOL_FEAT_SDS          0x0004U /* check shutdown state */
+
+#define POOL_FEAT_INCOMPAT_ALL \
+       (POOL_FEAT_SINGLEHDR | POOL_FEAT_CKSUM_2K | POOL_FEAT_SDS)
+
+/*
+ * incompat features effective values (if applicable)
+ */
+#ifdef SDS_ENABLED
+#define POOL_E_FEAT_SDS                POOL_FEAT_SDS
+#else
+#define POOL_E_FEAT_SDS                0x0000U /* empty */
+#endif
+
+#define POOL_FEAT_COMPAT_VALID \
+       (POOL_FEAT_CHECK_BAD_BLOCKS)
+
+#define POOL_FEAT_INCOMPAT_VALID \
+       (POOL_FEAT_SINGLEHDR | POOL_FEAT_CKSUM_2K | POOL_E_FEAT_SDS)
+
+#if defined(_WIN32) || NDCTL_ENABLED
+#define POOL_FEAT_INCOMPAT_DEFAULT \
+       (POOL_FEAT_CKSUM_2K | POOL_E_FEAT_SDS)
+#else
+/*
+ * shutdown state support on Linux requires root access on kernel < 4.20 with
+ * ndctl < 63 so it is disabled by default
+ */
+#define POOL_FEAT_INCOMPAT_DEFAULT \
+       (POOL_FEAT_CKSUM_2K)
+#endif
+
+#if NDCTL_ENABLED
+#define POOL_FEAT_COMPAT_DEFAULT \
+       (POOL_FEAT_CHECK_BAD_BLOCKS)
+#else
+#define POOL_FEAT_COMPAT_DEFAULT \
+       (POOL_FEAT_ZERO)
+#endif
+
+#define FEAT_INCOMPAT(X) \
+       {POOL_FEAT_ZERO, POOL_FEAT_##X, POOL_FEAT_ZERO}
+
+#define POOL_FEAT_VALID \
+       {POOL_FEAT_COMPAT_VALID, POOL_FEAT_INCOMPAT_VALID, POOL_FEAT_ZERO}
+
+/*
+ * defines the first not checksummed field - all fields after this will be
+ * ignored during checksum calculations.
+ */
+#define POOL_HDR_CSUM_2K_END_OFF offsetof(struct pool_hdr, unused2)
+#define POOL_HDR_CSUM_4K_END_OFF offsetof(struct pool_hdr, checksum)
+
+/*
+ * pick the first not checksummed field. 2K variant is used if
+ * POOL_FEAT_CKSUM_2K incompat feature is set.
+ */
+#define POOL_HDR_CSUM_END_OFF(hdrp) \
+       ((hdrp)->features.incompat & POOL_FEAT_CKSUM_2K) \
+               ? POOL_HDR_CSUM_2K_END_OFF : POOL_HDR_CSUM_4K_END_OFF
+
+/* ignore shutdown state if incompat feature is disabled */
+#define IGNORE_SDS(hdrp) \
+       (((hdrp) != NULL) && (((hdrp)->features.incompat & POOL_FEAT_SDS) == 0))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/queue.h b/ceph/src/pmdk/src/common/queue.h
new file mode 100644 (file)
index 0000000..ea874e3
--- /dev/null
@@ -0,0 +1,634 @@
+/*
+ * Source: glibc 2.24 (git://sourceware.org/glibc.git /misc/sys/queue.h)
+ *
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)queue.h     8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef        _PMDK_QUEUE_H_
+#define        _PMDK_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list.  Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction.  Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * XXX This is a workaround for a bug in the llvm's static analyzer. For more
+ * info see https://github.com/pmem/issues/issues/309.
+ */
+#ifdef __clang_analyzer__
+
+static void custom_assert(void)
+{
+       abort();
+}
+
+#define ANALYZER_ASSERT(x) (__builtin_expect(!(x), 0) ? (void)0 : custom_assert())
+#else
+#define ANALYZER_ASSERT(x) do {} while (0)
+#endif
+
+/*
+ * List definitions.
+ */
+#define        PMDK_LIST_HEAD(name, type)                                              \
+struct name {                                                          \
+       struct type *lh_first;  /* first element */                     \
+}
+
+#define        PMDK_LIST_HEAD_INITIALIZER(head)                                        \
+       { NULL }
+
+#ifdef __cplusplus
+ #define PMDK__CAST_AND_ASSIGN(x, y) x = (__typeof__(x))y;
+#else
+ #define PMDK__CAST_AND_ASSIGN(x, y) x = (void *)(y);
+#endif
+
+#define        PMDK_LIST_ENTRY(type)                                           \
+struct {                                                               \
+       struct type *le_next;   /* next element */                      \
+       struct type **le_prev;  /* address of previous next element */  \
+}
+
+/*
+ * List functions.
+ */
+#define        PMDK_LIST_INIT(head) do {                                               \
+       (head)->lh_first = NULL;                                        \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_LIST_INSERT_AFTER(listelm, elm, field) do {                        \
+       if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
+               (listelm)->field.le_next->field.le_prev =               \
+                   &(elm)->field.le_next;                              \
+       (listelm)->field.le_next = (elm);                               \
+       (elm)->field.le_prev = &(listelm)->field.le_next;               \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_LIST_INSERT_BEFORE(listelm, elm, field) do {                       \
+       (elm)->field.le_prev = (listelm)->field.le_prev;                \
+       (elm)->field.le_next = (listelm);                               \
+       *(listelm)->field.le_prev = (elm);                              \
+       (listelm)->field.le_prev = &(elm)->field.le_next;               \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_LIST_INSERT_HEAD(head, elm, field) do {                            \
+       if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
+               (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+       (head)->lh_first = (elm);                                       \
+       (elm)->field.le_prev = &(head)->lh_first;                       \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_LIST_REMOVE(elm, field) do {                                       \
+       ANALYZER_ASSERT((elm) != NULL);                                 \
+       if ((elm)->field.le_next != NULL)                               \
+               (elm)->field.le_next->field.le_prev =                   \
+                   (elm)->field.le_prev;                               \
+       *(elm)->field.le_prev = (elm)->field.le_next;                   \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_LIST_FOREACH(var, head, field)                                     \
+       for ((var) = ((head)->lh_first);                                \
+               (var);                                                  \
+               (var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define        PMDK_LIST_EMPTY(head)           ((head)->lh_first == NULL)
+#define        PMDK_LIST_FIRST(head)           ((head)->lh_first)
+#define        PMDK_LIST_NEXT(elm, field)              ((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define        PMDK_SLIST_HEAD(name, type)                                             \
+struct name {                                                          \
+       struct type *slh_first; /* first element */                     \
+}
+
+#define        PMDK_SLIST_HEAD_INITIALIZER(head)                                       \
+       { NULL }
+
+#define        PMDK_SLIST_ENTRY(type)                                          \
+struct {                                                               \
+       struct type *sle_next;  /* next element */                      \
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define        PMDK_SLIST_INIT(head) do {                                              \
+       (head)->slh_first = NULL;                                       \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SLIST_INSERT_AFTER(slistelm, elm, field) do {                      \
+       (elm)->field.sle_next = (slistelm)->field.sle_next;             \
+       (slistelm)->field.sle_next = (elm);                             \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SLIST_INSERT_HEAD(head, elm, field) do {                   \
+       (elm)->field.sle_next = (head)->slh_first;                      \
+       (head)->slh_first = (elm);                                      \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SLIST_REMOVE_HEAD(head, field) do {                                \
+       (head)->slh_first = (head)->slh_first->field.sle_next;          \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SLIST_REMOVE(head, elm, type, field) do {                  \
+       if ((head)->slh_first == (elm)) {                               \
+               PMDK_SLIST_REMOVE_HEAD((head), field);                  \
+       }                                                               \
+       else {                                                          \
+               struct type *curelm = (head)->slh_first;                \
+               while(curelm->field.sle_next != (elm))                  \
+                       curelm = curelm->field.sle_next;                \
+               curelm->field.sle_next =                                \
+                   curelm->field.sle_next->field.sle_next;             \
+       }                                                               \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SLIST_FOREACH(var, head, field)                                    \
+       for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define        PMDK_SLIST_EMPTY(head)  ((head)->slh_first == NULL)
+#define        PMDK_SLIST_FIRST(head)  ((head)->slh_first)
+#define        PMDK_SLIST_NEXT(elm, field)     ((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define        PMDK_STAILQ_HEAD(name, type)                                    \
+struct name {                                                          \
+       struct type *stqh_first;        /* first element */                     \
+       struct type **stqh_last;        /* addr of last next element */         \
+}
+
+#define        PMDK_STAILQ_HEAD_INITIALIZER(head)                                      \
+       { NULL, &(head).stqh_first }
+
+#define        PMDK_STAILQ_ENTRY(type)                                         \
+struct {                                                               \
+       struct type *stqe_next; /* next element */                      \
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define        PMDK_STAILQ_INIT(head) do {                                             \
+       (head)->stqh_first = NULL;                                      \
+       (head)->stqh_last = &(head)->stqh_first;                                \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_INSERT_HEAD(head, elm, field) do {                  \
+       if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)      \
+               (head)->stqh_last = &(elm)->field.stqe_next;            \
+       (head)->stqh_first = (elm);                                     \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_INSERT_TAIL(head, elm, field) do {                  \
+       (elm)->field.stqe_next = NULL;                                  \
+       *(head)->stqh_last = (elm);                                     \
+       (head)->stqh_last = &(elm)->field.stqe_next;                    \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_INSERT_AFTER(head, listelm, elm, field) do {                \
+       if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+               (head)->stqh_last = &(elm)->field.stqe_next;            \
+       (listelm)->field.stqe_next = (elm);                             \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_REMOVE_HEAD(head, field) do {                               \
+       if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+               (head)->stqh_last = &(head)->stqh_first;                        \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_REMOVE(head, elm, type, field) do {                 \
+       if ((head)->stqh_first == (elm)) {                              \
+               PMDK_STAILQ_REMOVE_HEAD((head), field);                 \
+       } else {                                                        \
+               struct type *curelm = (head)->stqh_first;               \
+               while (curelm->field.stqe_next != (elm))                        \
+                       curelm = curelm->field.stqe_next;               \
+               if ((curelm->field.stqe_next =                          \
+                       curelm->field.stqe_next->field.stqe_next) == NULL) \
+                           (head)->stqh_last = &(curelm)->field.stqe_next; \
+       }                                                               \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_STAILQ_FOREACH(var, head, field)                           \
+       for ((var) = ((head)->stqh_first);                              \
+               (var);                                                  \
+               (var) = ((var)->field.stqe_next))
+
+#define        PMDK_STAILQ_CONCAT(head1, head2) do {                           \
+       if (!PMDK_STAILQ_EMPTY((head2))) {                                      \
+               *(head1)->stqh_last = (head2)->stqh_first;              \
+               (head1)->stqh_last = (head2)->stqh_last;                \
+               PMDK_STAILQ_INIT((head2));                                      \
+       }                                                               \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define        PMDK_STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+#define        PMDK_STAILQ_FIRST(head) ((head)->stqh_first)
+#define        PMDK_STAILQ_NEXT(elm, field)    ((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define        PMDK_SIMPLEQ_HEAD(name, type)                                   \
+struct name {                                                          \
+       struct type *sqh_first; /* first element */                     \
+       struct type **sqh_last; /* addr of last next element */         \
+}
+
+#define        PMDK_SIMPLEQ_HEAD_INITIALIZER(head)                                     \
+       { NULL, &(head).sqh_first }
+
+#define        PMDK_SIMPLEQ_ENTRY(type)                                                \
+struct {                                                               \
+       struct type *sqe_next;  /* next element */                      \
+}
+
+/*
+ * Simple queue functions.
+ */
+#define        PMDK_SIMPLEQ_INIT(head) do {                                            \
+       (head)->sqh_first = NULL;                                       \
+       (head)->sqh_last = &(head)->sqh_first;                          \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_INSERT_HEAD(head, elm, field) do {                 \
+       if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
+               (head)->sqh_last = &(elm)->field.sqe_next;              \
+       (head)->sqh_first = (elm);                                      \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_INSERT_TAIL(head, elm, field) do {                 \
+       (elm)->field.sqe_next = NULL;                                   \
+       *(head)->sqh_last = (elm);                                      \
+       (head)->sqh_last = &(elm)->field.sqe_next;                      \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {               \
+       if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+               (head)->sqh_last = &(elm)->field.sqe_next;              \
+       (listelm)->field.sqe_next = (elm);                              \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_REMOVE_HEAD(head, field) do {                              \
+       if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+               (head)->sqh_last = &(head)->sqh_first;                  \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_REMOVE(head, elm, type, field) do {                        \
+       if ((head)->sqh_first == (elm)) {                               \
+               PMDK_SIMPLEQ_REMOVE_HEAD((head), field);                        \
+       } else {                                                        \
+               struct type *curelm = (head)->sqh_first;                \
+               while (curelm->field.sqe_next != (elm))                 \
+                       curelm = curelm->field.sqe_next;                \
+               if ((curelm->field.sqe_next =                           \
+                       curelm->field.sqe_next->field.sqe_next) == NULL) \
+                           (head)->sqh_last = &(curelm)->field.sqe_next; \
+       }                                                               \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_SIMPLEQ_FOREACH(var, head, field)                          \
+       for ((var) = ((head)->sqh_first);                               \
+               (var);                                                  \
+               (var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define        PMDK_SIMPLEQ_EMPTY(head)                ((head)->sqh_first == NULL)
+#define        PMDK_SIMPLEQ_FIRST(head)                ((head)->sqh_first)
+#define        PMDK_SIMPLEQ_NEXT(elm, field)   ((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define        PMDK__TAILQ_HEAD(name, type, qual)                                      \
+struct name {                                                          \
+       qual type *tqh_first;           /* first element */             \
+       qual type *qual *tqh_last;      /* addr of last next element */ \
+}
+#define PMDK_TAILQ_HEAD(name, type)    PMDK__TAILQ_HEAD(name, struct type,)
+
+#define        PMDK_TAILQ_HEAD_INITIALIZER(head)                                       \
+       { NULL, &(head).tqh_first }
+
+#define        PMDK__TAILQ_ENTRY(type, qual)                                   \
+struct {                                                               \
+       qual type *tqe_next;            /* next element */              \
+       qual type *qual *tqe_prev;      /* address of previous next element */\
+}
+#define PMDK_TAILQ_ENTRY(type) PMDK__TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define        PMDK_TAILQ_INIT(head) do {                                              \
+       (head)->tqh_first = NULL;                                       \
+       (head)->tqh_last = &(head)->tqh_first;                          \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_INSERT_HEAD(head, elm, field) do {                   \
+       if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
+               (head)->tqh_first->field.tqe_prev =                     \
+                   &(elm)->field.tqe_next;                             \
+       else                                                            \
+               (head)->tqh_last = &(elm)->field.tqe_next;              \
+       (head)->tqh_first = (elm);                                      \
+       (elm)->field.tqe_prev = &(head)->tqh_first;                     \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_INSERT_TAIL(head, elm, field) do {                   \
+       (elm)->field.tqe_next = NULL;                                   \
+       (elm)->field.tqe_prev = (head)->tqh_last;                       \
+       *(head)->tqh_last = (elm);                                      \
+       (head)->tqh_last = &(elm)->field.tqe_next;                      \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_INSERT_AFTER(head, listelm, elm, field) do {         \
+       if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+               (elm)->field.tqe_next->field.tqe_prev =                 \
+                   &(elm)->field.tqe_next;                             \
+       else                                                            \
+               (head)->tqh_last = &(elm)->field.tqe_next;              \
+       (listelm)->field.tqe_next = (elm);                              \
+       (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_INSERT_BEFORE(listelm, elm, field) do {                      \
+       (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
+       (elm)->field.tqe_next = (listelm);                              \
+       *(listelm)->field.tqe_prev = (elm);                             \
+       (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_REMOVE(head, elm, field) do {                                \
+       ANALYZER_ASSERT((elm) != NULL);                                 \
+       if (((elm)->field.tqe_next) != NULL)                            \
+               (elm)->field.tqe_next->field.tqe_prev =                 \
+                   (elm)->field.tqe_prev;                              \
+       else                                                            \
+               (head)->tqh_last = (elm)->field.tqe_prev;               \
+       *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_TAILQ_FOREACH(var, head, field)                                    \
+       for ((var) = ((head)->tqh_first);                               \
+               (var);                                                  \
+               (var) = ((var)->field.tqe_next))
+
+#define        PMDK_TAILQ_FOREACH_REVERSE(var, head, headname, field)          \
+       for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));    \
+               (var);                                                  \
+               (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+#define        PMDK_TAILQ_CONCAT(head1, head2, field) do {                             \
+       if (!PMDK_TAILQ_EMPTY(head2)) {                                 \
+               *(head1)->tqh_last = (head2)->tqh_first;                \
+               (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+               (head1)->tqh_last = (head2)->tqh_last;                  \
+               PMDK_TAILQ_INIT((head2));                                       \
+       }                                                               \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Tail queue access methods.
+ */
+#define        PMDK_TAILQ_EMPTY(head)          ((head)->tqh_first == NULL)
+#define        PMDK_TAILQ_FIRST(head)          ((head)->tqh_first)
+#define        PMDK_TAILQ_NEXT(elm, field)             ((elm)->field.tqe_next)
+
+#define        PMDK_TAILQ_LAST(head, headname) \
+       (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define        PMDK_TAILQ_PREV(elm, headname, field) \
+       (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define        PMDK_CIRCLEQ_HEAD(name, type)                                   \
+struct name {                                                          \
+       struct type *cqh_first;         /* first element */             \
+       struct type *cqh_last;          /* last element */              \
+}
+
+#define        PMDK_CIRCLEQ_HEAD_INITIALIZER(head)                                     \
+       { (void *)&(head), (void *)&(head) }
+
+#define        PMDK_CIRCLEQ_ENTRY(type)                                                \
+struct {                                                               \
+       struct type *cqe_next;          /* next element */              \
+       struct type *cqe_prev;          /* previous element */          \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define        PMDK_CIRCLEQ_INIT(head) do {                                            \
+       PMDK__CAST_AND_ASSIGN((head)->cqh_first, (head));                       \
+       PMDK__CAST_AND_ASSIGN((head)->cqh_last, (head));                        \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {               \
+       (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
+       (elm)->field.cqe_prev = (listelm);                              \
+       if ((listelm)->field.cqe_next == (void *)(head))                \
+               (head)->cqh_last = (elm);                               \
+       else                                                            \
+               (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
+       (listelm)->field.cqe_next = (elm);                              \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {              \
+       (elm)->field.cqe_next = (listelm);                              \
+       (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
+       if ((listelm)->field.cqe_prev == (void *)(head))                \
+               (head)->cqh_first = (elm);                              \
+       else                                                            \
+               (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
+       (listelm)->field.cqe_prev = (elm);                              \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_INSERT_HEAD(head, elm, field) do {                 \
+       (elm)->field.cqe_next = (head)->cqh_first;                      \
+       (elm)->field.cqe_prev = (void *)(head);                         \
+       if ((head)->cqh_last == (void *)(head))                         \
+               (head)->cqh_last = (elm);                               \
+       else                                                            \
+               (head)->cqh_first->field.cqe_prev = (elm);              \
+       (head)->cqh_first = (elm);                                      \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_INSERT_TAIL(head, elm, field) do {                 \
+       PMDK__CAST_AND_ASSIGN((elm)->field.cqe_next, (head));           \
+       (elm)->field.cqe_prev = (head)->cqh_last;                       \
+       if ((head)->cqh_first == (void *)(head))                        \
+               (head)->cqh_first = (elm);                              \
+       else                                                            \
+               (head)->cqh_last->field.cqe_next = (elm);               \
+       (head)->cqh_last = (elm);                                       \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_REMOVE(head, elm, field) do {                              \
+       if ((elm)->field.cqe_next == (void *)(head))                    \
+               (head)->cqh_last = (elm)->field.cqe_prev;               \
+       else                                                            \
+               (elm)->field.cqe_next->field.cqe_prev =                 \
+                   (elm)->field.cqe_prev;                              \
+       if ((elm)->field.cqe_prev == (void *)(head))                    \
+               (head)->cqh_first = (elm)->field.cqe_next;              \
+       else                                                            \
+               (elm)->field.cqe_prev->field.cqe_next =                 \
+                   (elm)->field.cqe_next;                              \
+} while (/*CONSTCOND*/0)
+
+#define        PMDK_CIRCLEQ_FOREACH(var, head, field)                          \
+       for ((var) = ((head)->cqh_first);                               \
+               (var) != (const void *)(head);                          \
+               (var) = ((var)->field.cqe_next))
+
+#define        PMDK_CIRCLEQ_FOREACH_REVERSE(var, head, field)                  \
+       for ((var) = ((head)->cqh_last);                                \
+               (var) != (const void *)(head);                          \
+               (var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define        PMDK_CIRCLEQ_EMPTY(head)                ((head)->cqh_first == (void *)(head))
+#define        PMDK_CIRCLEQ_FIRST(head)                ((head)->cqh_first)
+#define        PMDK_CIRCLEQ_LAST(head)         ((head)->cqh_last)
+#define        PMDK_CIRCLEQ_NEXT(elm, field)   ((elm)->field.cqe_next)
+#define        PMDK_CIRCLEQ_PREV(elm, field)   ((elm)->field.cqe_prev)
+
+#define PMDK_CIRCLEQ_LOOP_NEXT(head, elm, field)                               \
+       (((elm)->field.cqe_next == (void *)(head))                      \
+           ? ((head)->cqh_first)                                       \
+           : ((elm)->field.cqe_next))
+#define PMDK_CIRCLEQ_LOOP_PREV(head, elm, field)                               \
+       (((elm)->field.cqe_prev == (void *)(head))                      \
+           ? ((head)->cqh_last)                                        \
+           : ((elm)->field.cqe_prev))
+
+/*
+ * Sorted queue functions.
+ */
+#define PMDK_SORTEDQ_HEAD(name, type)          PMDK_CIRCLEQ_HEAD(name, type)
+#define PMDK_SORTEDQ_HEAD_INITIALIZER(head)            PMDK_CIRCLEQ_HEAD_INITIALIZER(head)
+#define PMDK_SORTEDQ_ENTRY(type)                       PMDK_CIRCLEQ_ENTRY(type)
+#define PMDK_SORTEDQ_INIT(head)                        PMDK_CIRCLEQ_INIT(head)
+#define PMDK_SORTEDQ_INSERT(head, elm, field, type, comparer) {                \
+       type *_elm_it;                                                  \
+       for (_elm_it = (head)->cqh_first;                               \
+               ((_elm_it != (void *)(head)) &&                         \
+                       (comparer(_elm_it, (elm)) < 0));                \
+               _elm_it = _elm_it->field.cqe_next)                      \
+               /*NOTHING*/;                                            \
+       if (_elm_it == (void *)(head))                                  \
+               PMDK_CIRCLEQ_INSERT_TAIL(head, elm, field);                     \
+       else                                                            \
+               PMDK_CIRCLEQ_INSERT_BEFORE(head, _elm_it, elm, field);  \
+}
+#define PMDK_SORTEDQ_REMOVE(head, elm, field)  PMDK_CIRCLEQ_REMOVE(head, elm, field)
+#define PMDK_SORTEDQ_FOREACH(var, head, field) PMDK_CIRCLEQ_FOREACH(var, head, field)
+#define PMDK_SORTEDQ_FOREACH_REVERSE(var, head, field)                 \
+       PMDK_CIRCLEQ_FOREACH_REVERSE(var, head, field)
+
+/*
+ * Sorted queue access methods.
+ */
+#define        PMDK_SORTEDQ_EMPTY(head)                        PMDK_CIRCLEQ_EMPTY(head)
+#define        PMDK_SORTEDQ_FIRST(head)                        PMDK_CIRCLEQ_FIRST(head)
+#define        PMDK_SORTEDQ_LAST(head)                 PMDK_CIRCLEQ_LAST(head)
+#define        PMDK_SORTEDQ_NEXT(elm, field)           PMDK_CIRCLEQ_NEXT(elm, field)
+#define        PMDK_SORTEDQ_PREV(elm, field)           PMDK_CIRCLEQ_PREV(elm, field)
+
+#endif /* sys/queue.h */
diff --git a/ceph/src/pmdk/src/common/rand.c b/ceph/src/pmdk/src/common/rand.c
new file mode 100644 (file)
index 0000000..e7fa5eb
--- /dev/null
@@ -0,0 +1,124 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, Intel Corporation */
+
+/*
+ * rand.c -- random utils
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <unistd.h>
+
+#include "rand.h"
+
+#ifdef _WIN32
+#include <bcrypt.h>
+#include <process.h>
+#else
+#include <sys/syscall.h>
+#endif
+
+/*
+ * hash64 -- a u64 -> u64 hash
+ */
+uint64_t
+hash64(uint64_t x)
+{
+       x += 0x9e3779b97f4a7c15;
+       x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
+       x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
+       return x ^ (x >> 31);
+}
+
+/*
+ * xoshiro256** random generator
+ *
+ * Fastest available good PRNG as of 2018 (sub-nanosecond per entry), produces
+ * much better output than old stuff like rand() or Mersenne's Twister.
+ *
+ * By David Blackman and Sebastiano Vigna; PD/CC0 2018.
+ *
+ * It has a period of 2²⁵⁶-1, excluding all-zero state; it must always get
+ * initialized to avoid that zero.
+ */
+
+static inline uint64_t rotl(const uint64_t x, int k)
+{
+       /* optimized to a single instruction on x86 */
+       return (x << k) | (x >> (64 - k));
+}
+
+/*
+ * rnd64_r -- return 64-bits of randomness
+ */
+uint64_t
+rnd64_r(rng_t *state)
+{
+       uint64_t *s = (void *)state;
+
+       const uint64_t result = rotl(s[1] * 5, 7) * 9;
+       const uint64_t t = s[1] << 17;
+
+       s[2] ^= s[0];
+       s[3] ^= s[1];
+       s[1] ^= s[2];
+       s[0] ^= s[3];
+
+       s[2] ^= t;
+
+       s[3] = rotl(s[3], 45);
+
+       return result;
+}
+
+/*
+ * randomize_r -- initialize random generator
+ *
+ * Seed of 0 means random.
+ */
+void
+randomize_r(rng_t *state, uint64_t seed)
+{
+       if (!seed) {
+#ifdef SYS_getrandom
+               /* We want getentropy() but ancient Red Hat lacks it. */
+               if (!syscall(SYS_getrandom, state, sizeof(rng_t), 0))
+                       return; /* nofail, but ENOSYS on kernel < 3.16 */
+#elif _WIN32
+#pragma comment(lib, "Bcrypt.lib")
+               if (BCryptGenRandom(NULL, (PUCHAR)state, sizeof(rng_t),
+                       BCRYPT_USE_SYSTEM_PREFERRED_RNG)) {
+                       return;
+               }
+#endif
+               seed = (uint64_t)getpid();
+       }
+
+       uint64_t *s = (void *)state;
+       s[0] = hash64(seed);
+       s[1] = hash64(s[0]);
+       s[2] = hash64(s[1]);
+       s[3] = hash64(s[2]);
+}
+
+static rng_t global_rng;
+
+/*
+ * rnd64 -- global state version of rnd64_t
+ */
+uint64_t
+rnd64(void)
+{
+       return rnd64_r(&global_rng);
+}
+
+/*
+ * randomize -- initialize global RNG
+ */
+void
+randomize(uint64_t seed)
+{
+       randomize_r(&global_rng, seed);
+}
diff --git a/ceph/src/pmdk/src/common/rand.h b/ceph/src/pmdk/src/common/rand.h
new file mode 100644 (file)
index 0000000..8009c66
--- /dev/null
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * rand.h -- random utils
+ */
+
+#ifndef RAND_H
+#define RAND_H 1
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uint64_t rng_t[4];
+
+uint64_t hash64(uint64_t x);
+uint64_t rnd64_r(rng_t *rng);
+void randomize_r(rng_t *rng, uint64_t seed);
+uint64_t rnd64(void);
+void randomize(uint64_t seed);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/ravl.c b/ceph/src/pmdk/src/common/ravl.c
new file mode 100644 (file)
index 0000000..d00ee7b
--- /dev/null
@@ -0,0 +1,577 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * ravl.c -- implementation of a RAVL tree
+ * https://sidsen.azurewebsites.net//papers/ravl-trees-journal.pdf
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include "out.h"
+#include "ravl.h"
+#include "alloc.h"
+
+#define RAVL_DEFAULT_DATA_SIZE (sizeof(void *))
+
+enum ravl_slot_type {
+       RAVL_LEFT,
+       RAVL_RIGHT,
+
+       MAX_SLOTS,
+
+       RAVL_ROOT
+};
+
+struct ravl_node {
+       struct ravl_node *parent;
+       struct ravl_node *slots[MAX_SLOTS];
+       int32_t rank; /* cannot be greater than height of the subtree */
+       int32_t pointer_based;
+       char data[];
+};
+
+struct ravl {
+       struct ravl_node *root;
+       ravl_compare *compare;
+       size_t data_size;
+};
+
+/*
+ * ravl_new -- creates a new ravl tree instance
+ */
+struct ravl *
+ravl_new_sized(ravl_compare *compare, size_t data_size)
+{
+       struct ravl *r = Malloc(sizeof(*r));
+       if (r == NULL) {
+               ERR("!Malloc");
+               return r;
+       }
+
+       r->compare = compare;
+       r->root = NULL;
+       r->data_size = data_size;
+
+       return r;
+}
+
+/*
+ * ravl_new -- creates a new tree that stores data pointers
+ */
+struct ravl *
+ravl_new(ravl_compare *compare)
+{
+       return ravl_new_sized(compare, RAVL_DEFAULT_DATA_SIZE);
+}
+
+/*
+ * ravl_clear_node -- (internal) recursively clears the given subtree,
+ *     calls callback in an in-order fashion. Optionally frees the given node.
+ */
+static void
+ravl_foreach_node(struct ravl_node *n, ravl_cb cb, void *arg, int free_node)
+{
+       if (n == NULL)
+               return;
+
+       ravl_foreach_node(n->slots[RAVL_LEFT], cb, arg, free_node);
+       if (cb)
+               cb((void *)n->data, arg);
+       ravl_foreach_node(n->slots[RAVL_RIGHT], cb, arg, free_node);
+
+       if (free_node)
+               Free(n);
+}
+
+/*
+ * ravl_clear -- clears the entire tree, starting from the root
+ */
+void
+ravl_clear(struct ravl *ravl)
+{
+       ravl_foreach_node(ravl->root, NULL, NULL, 1);
+       ravl->root = NULL;
+}
+
+/*
+ * ravl_delete_cb -- clears and deletes the given ravl instance, calls callback
+ */
+void
+ravl_delete_cb(struct ravl *ravl, ravl_cb cb, void *arg)
+{
+       ravl_foreach_node(ravl->root, cb, arg, 1);
+       Free(ravl);
+}
+
+/*
+ * ravl_delete -- clears and deletes the given ravl instance
+ */
+void
+ravl_delete(struct ravl *ravl)
+{
+       ravl_delete_cb(ravl, NULL, NULL);
+}
+
+/*
+ * ravl_foreach -- traverses the entire tree, calling callback for every node
+ */
+void
+ravl_foreach(struct ravl *ravl, ravl_cb cb, void *arg)
+{
+       ravl_foreach_node(ravl->root, cb, arg, 0);
+}
+
+/*
+ * ravl_empty -- checks whether the given tree is empty
+ */
+int
+ravl_empty(struct ravl *ravl)
+{
+       return ravl->root == NULL;
+}
+
+/*
+ * ravl_node_insert_constructor -- node data constructor for ravl_insert
+ */
+static void
+ravl_node_insert_constructor(void *data, size_t data_size, const void *arg)
+{
+       /* copy only the 'arg' pointer */
+       memcpy(data, &arg, sizeof(arg));
+}
+
+/*
+ * ravl_node_copy_constructor -- node data constructor for ravl_emplace_copy
+ */
+static void
+ravl_node_copy_constructor(void *data, size_t data_size, const void *arg)
+{
+       memcpy(data, arg, data_size);
+}
+
+/*
+ * ravl_new_node -- (internal) allocates and initializes a new node
+ */
+static struct ravl_node *
+ravl_new_node(struct ravl *ravl, ravl_constr constr, const void *arg)
+{
+       struct ravl_node *n = Malloc(sizeof(*n) + ravl->data_size);
+       if (n == NULL) {
+               ERR("!Malloc");
+               return n;
+       }
+
+       n->parent = NULL;
+       n->slots[RAVL_LEFT] = NULL;
+       n->slots[RAVL_RIGHT] = NULL;
+       n->rank = 0;
+       n->pointer_based = constr == ravl_node_insert_constructor;
+       constr(n->data, ravl->data_size, arg);
+
+       return n;
+}
+
+/*
+ * ravl_slot_opposite -- (internal) returns the opposite slot type, cannot be
+ *     called for root type
+ */
+static enum ravl_slot_type
+ravl_slot_opposite(enum ravl_slot_type t)
+{
+       ASSERTne(t, RAVL_ROOT);
+
+       return t == RAVL_LEFT ? RAVL_RIGHT : RAVL_LEFT;
+}
+
+/*
+ * ravl_node_slot_type -- (internal) returns the type of the given node:
+ *     left child, right child or root
+ */
+static enum ravl_slot_type
+ravl_node_slot_type(struct ravl_node *n)
+{
+       if (n->parent == NULL)
+               return RAVL_ROOT;
+
+       return n->parent->slots[RAVL_LEFT] == n ? RAVL_LEFT : RAVL_RIGHT;
+}
+
+/*
+ * ravl_node_sibling -- (internal) returns the sibling of the given node,
+ *     NULL if the node is root (has no parent)
+ */
+static struct ravl_node *
+ravl_node_sibling(struct ravl_node *n)
+{
+       enum ravl_slot_type t = ravl_node_slot_type(n);
+       if (t == RAVL_ROOT)
+               return NULL;
+
+       return n->parent->slots[t == RAVL_LEFT ? RAVL_RIGHT : RAVL_LEFT];
+}
+
+/*
+ * ravl_node_ref -- (internal) returns the pointer to the memory location in
+ *     which the given node resides
+ */
+static struct ravl_node **
+ravl_node_ref(struct ravl *ravl, struct ravl_node *n)
+{
+       enum ravl_slot_type t = ravl_node_slot_type(n);
+
+       return t == RAVL_ROOT ? &ravl->root : &n->parent->slots[t];
+}
+
+/*
+ * ravl_rotate -- (internal) performs a rotation around a given node
+ *
+ * The node n swaps place with its parent. If n is right child, parent becomes
+ * the left child of n, otherwise parent becomes right child of n.
+ */
+static void
+ravl_rotate(struct ravl *ravl, struct ravl_node *n)
+{
+       ASSERTne(n->parent, NULL);
+       struct ravl_node *p = n->parent;
+       struct ravl_node **pref = ravl_node_ref(ravl, p);
+
+       enum ravl_slot_type t = ravl_node_slot_type(n);
+       enum ravl_slot_type t_opposite = ravl_slot_opposite(t);
+
+       n->parent = p->parent;
+       p->parent = n;
+       *pref = n;
+
+       if ((p->slots[t] = n->slots[t_opposite]) != NULL)
+               p->slots[t]->parent = p;
+       n->slots[t_opposite] = p;
+}
+
+/*
+ * ravl_node_rank -- (internal) returns the rank of the node
+ *
+ * For the purpose of balancing, NULL nodes have rank -1.
+ */
+static int
+ravl_node_rank(struct ravl_node *n)
+{
+       return n == NULL ? -1 : n->rank;
+}
+
+/*
+ * ravl_node_rank_difference_parent -- (internal) returns the rank different
+ *     between parent node p and its child n
+ *
+ * Every rank difference must be positive.
+ *
+ * Either of these can be NULL.
+ */
+static int
+ravl_node_rank_difference_parent(struct ravl_node *p, struct ravl_node *n)
+{
+       return ravl_node_rank(p) - ravl_node_rank(n);
+}
+
+/*
+ * ravl_node_rank_differenced - (internal) returns the rank difference between
+ *     parent and its child
+ *
+ * Can be used to check if a given node is an i-child.
+ */
+static int
+ravl_node_rank_difference(struct ravl_node *n)
+{
+       return ravl_node_rank_difference_parent(n->parent, n);
+}
+
+/*
+ * ravl_node_is_i_j -- (internal) checks if a given node is strictly i,j-node
+ */
+static int
+ravl_node_is_i_j(struct ravl_node *n, int i, int j)
+{
+       return (ravl_node_rank_difference_parent(n, n->slots[RAVL_LEFT]) == i &&
+               ravl_node_rank_difference_parent(n, n->slots[RAVL_RIGHT]) == j);
+}
+
+/*
+ * ravl_node_is -- (internal) checks if a given node is i,j-node or j,i-node
+ */
+static int
+ravl_node_is(struct ravl_node *n, int i, int j)
+{
+       return ravl_node_is_i_j(n, i, j) || ravl_node_is_i_j(n, j, i);
+}
+
+/*
+ * ravl_node_promote -- promotes a given node by increasing its rank
+ */
+static void
+ravl_node_promote(struct ravl_node *n)
+{
+       n->rank += 1;
+}
+
+/*
+ * ravl_node_promote -- demotes a given node by increasing its rank
+ */
+static void
+ravl_node_demote(struct ravl_node *n)
+{
+       ASSERT(n->rank > 0);
+       n->rank -= 1;
+}
+
+/*
+ * ravl_balance -- balances the tree after insert
+ *
+ * This function must restore the invariant that every rank
+ * difference is positive.
+ */
+static void
+ravl_balance(struct ravl *ravl, struct ravl_node *n)
+{
+       /* walk up the tree, promoting nodes */
+       while (n->parent && ravl_node_is(n->parent, 0, 1)) {
+               ravl_node_promote(n->parent);
+               n = n->parent;
+       }
+
+       /*
+        * Either the rank rule holds or n is a 0-child whose sibling is an
+        * i-child with i > 1.
+        */
+       struct ravl_node *s = ravl_node_sibling(n);
+       if (!(ravl_node_rank_difference(n) == 0 &&
+           ravl_node_rank_difference_parent(n->parent, s) > 1))
+               return;
+
+       struct ravl_node *y = n->parent;
+       /* if n is a left child, let z be n's right child and vice versa */
+       enum ravl_slot_type t = ravl_slot_opposite(ravl_node_slot_type(n));
+       struct ravl_node *z = n->slots[t];
+
+       if (z == NULL || ravl_node_rank_difference(z) == 2) {
+               ravl_rotate(ravl, n);
+               ravl_node_demote(y);
+       } else if (ravl_node_rank_difference(z) == 1) {
+               ravl_rotate(ravl, z);
+               ravl_rotate(ravl, z);
+               ravl_node_promote(z);
+               ravl_node_demote(n);
+               ravl_node_demote(y);
+       }
+}
+
+/*
+ * ravl_insert -- insert data into the tree
+ */
+int
+ravl_insert(struct ravl *ravl, const void *data)
+{
+       return ravl_emplace(ravl, ravl_node_insert_constructor, data);
+}
+
+/*
+ * ravl_insert -- copy construct data inside of a new tree node
+ */
+int
+ravl_emplace_copy(struct ravl *ravl, const void *data)
+{
+       return ravl_emplace(ravl, ravl_node_copy_constructor, data);
+}
+
+/*
+ * ravl_emplace -- construct data inside of a new tree node
+ */
+int
+ravl_emplace(struct ravl *ravl, ravl_constr constr, const void *arg)
+{
+       LOG(6, NULL);
+
+       struct ravl_node *n = ravl_new_node(ravl, constr, arg);
+       if (n == NULL)
+               return -1;
+
+       /* walk down the tree and insert the new node into a missing slot */
+       struct ravl_node **dstp = &ravl->root;
+       struct ravl_node *dst = NULL;
+       while (*dstp != NULL) {
+               dst = (*dstp);
+               int cmp_result = ravl->compare(ravl_data(n), ravl_data(dst));
+               if (cmp_result == 0)
+                       goto error_duplicate;
+
+               dstp = &dst->slots[cmp_result > 0];
+       }
+       n->parent = dst;
+       *dstp = n;
+
+       ravl_balance(ravl, n);
+
+       return 0;
+
+error_duplicate:
+       errno = EEXIST;
+       Free(n);
+       return -1;
+}
+
+/*
+ * ravl_node_type_most -- (internal) returns left-most or right-most node in
+ *     the subtree
+ */
+static struct ravl_node *
+ravl_node_type_most(struct ravl_node *n, enum ravl_slot_type t)
+{
+       while (n->slots[t] != NULL)
+               n = n->slots[t];
+
+       return n;
+}
+
+/*
+ * ravl_node_cessor -- (internal) returns the successor or predecessor of the
+ *     node
+ */
+static struct ravl_node *
+ravl_node_cessor(struct ravl_node *n, enum ravl_slot_type t)
+{
+       /*
+        * If t child is present, we are looking for t-opposite-most node
+        * in t child subtree
+        */
+       if (n->slots[t])
+               return ravl_node_type_most(n->slots[t], ravl_slot_opposite(t));
+
+       /* otherwise get the first parent on the t path */
+       while (n->parent != NULL && n == n->parent->slots[t])
+               n = n->parent;
+
+       return n->parent;
+}
+
+/*
+ * ravl_node_successor -- (internal) returns node's successor
+ *
+ * It's the first node larger than n.
+ */
+static struct ravl_node *
+ravl_node_successor(struct ravl_node *n)
+{
+       return ravl_node_cessor(n, RAVL_RIGHT);
+}
+
+/*
+ * ravl_node_successor -- (internal) returns node's successor
+ *
+ * It's the first node smaller than n.
+ */
+static struct ravl_node *
+ravl_node_predecessor(struct ravl_node *n)
+{
+       return ravl_node_cessor(n, RAVL_LEFT);
+}
+
+/*
+ * ravl_predicate_holds -- (internal) verifies the given predicate for
+ *     the current node in the search path
+ *
+ * If the predicate holds for the given node or a node that can be directly
+ * derived from it, returns 1. Otherwise returns 0.
+ */
+static int
+ravl_predicate_holds(struct ravl *ravl, int result, struct ravl_node **ret,
+       struct ravl_node *n, const void *data, enum ravl_predicate flags)
+{
+       if (flags & RAVL_PREDICATE_EQUAL) {
+               if (result == 0) {
+                       *ret = n;
+                       return 1;
+               }
+       }
+       if (flags & RAVL_PREDICATE_GREATER) {
+               if (result < 0) { /* data < n->data */
+                       *ret = n;
+                       return 0;
+               } else if (result == 0) {
+                       *ret = ravl_node_successor(n);
+                       return 1;
+               }
+       }
+       if (flags & RAVL_PREDICATE_LESS) {
+               if (result > 0) { /* data > n->data */
+                       *ret = n;
+                       return 0;
+               } else if (result == 0) {
+                       *ret = ravl_node_predecessor(n);
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * ravl_find -- searches for the node in the tree
+ */
+struct ravl_node *
+ravl_find(struct ravl *ravl, const void *data, enum ravl_predicate flags)
+{
+       LOG(6, NULL);
+
+       struct ravl_node *r = NULL;
+       struct ravl_node *n = ravl->root;
+       while (n) {
+               int result = ravl->compare(data, ravl_data(n));
+               if (ravl_predicate_holds(ravl, result, &r, n, data, flags))
+                       return r;
+
+               n = n->slots[result > 0];
+       }
+
+       return r;
+}
+
+/*
+ * ravl_remove -- removes the given node from the tree
+ */
+void
+ravl_remove(struct ravl *ravl, struct ravl_node *n)
+{
+       LOG(6, NULL);
+
+       if (n->slots[RAVL_LEFT] != NULL && n->slots[RAVL_RIGHT] != NULL) {
+               /* if both children are present, remove the successor instead */
+               struct ravl_node *s = ravl_node_successor(n);
+               memcpy(n->data, s->data, ravl->data_size);
+
+               ravl_remove(ravl, s);
+       } else {
+               /* swap n with the child that may exist */
+               struct ravl_node *r = n->slots[RAVL_LEFT] ?
+                       n->slots[RAVL_LEFT] : n->slots[RAVL_RIGHT];
+               if (r != NULL)
+                       r->parent = n->parent;
+
+               *ravl_node_ref(ravl, n) = r;
+               Free(n);
+       }
+}
+
+/*
+ * ravl_data -- returns the data contained within the node
+ */
+void *
+ravl_data(struct ravl_node *node)
+{
+       if (node->pointer_based) {
+               void *data;
+               memcpy(&data, node->data, sizeof(void *));
+               return data;
+       } else {
+               return (void *)node->data;
+       }
+}
diff --git a/ceph/src/pmdk/src/common/ravl.h b/ceph/src/pmdk/src/common/ravl.h
new file mode 100644 (file)
index 0000000..a008a66
--- /dev/null
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * ravl.h -- internal definitions for ravl tree
+ */
+
+#ifndef LIBPMEMOBJ_RAVL_H
+#define LIBPMEMOBJ_RAVL_H 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ravl;
+struct ravl_node;
+
+enum ravl_predicate {
+       RAVL_PREDICATE_EQUAL            =       1 << 0,
+       RAVL_PREDICATE_GREATER          =       1 << 1,
+       RAVL_PREDICATE_LESS             =       1 << 2,
+       RAVL_PREDICATE_LESS_EQUAL       =
+               RAVL_PREDICATE_EQUAL | RAVL_PREDICATE_LESS,
+       RAVL_PREDICATE_GREATER_EQUAL    =
+               RAVL_PREDICATE_EQUAL | RAVL_PREDICATE_GREATER,
+};
+
+typedef int ravl_compare(const void *lhs, const void *rhs);
+typedef void ravl_cb(void *data, void *arg);
+typedef void ravl_constr(void *data, size_t data_size, const void *arg);
+
+struct ravl *ravl_new(ravl_compare *compare);
+struct ravl *ravl_new_sized(ravl_compare *compare, size_t data_size);
+void ravl_delete(struct ravl *ravl);
+void ravl_delete_cb(struct ravl *ravl, ravl_cb cb, void *arg);
+void ravl_foreach(struct ravl *ravl, ravl_cb cb, void *arg);
+int ravl_empty(struct ravl *ravl);
+void ravl_clear(struct ravl *ravl);
+int ravl_insert(struct ravl *ravl, const void *data);
+int ravl_emplace(struct ravl *ravl, ravl_constr constr, const void *arg);
+int ravl_emplace_copy(struct ravl *ravl, const void *data);
+
+struct ravl_node *ravl_find(struct ravl *ravl, const void *data,
+       enum ravl_predicate predicate_flags);
+void *ravl_data(struct ravl_node *node);
+void ravl_remove(struct ravl *ravl, struct ravl_node *node);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPMEMOBJ_RAVL_H */
diff --git a/ceph/src/pmdk/src/common/set.c b/ceph/src/pmdk/src/common/set.c
new file mode 100644 (file)
index 0000000..e3f8b6f
--- /dev/null
@@ -0,0 +1,4439 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * set.c -- pool set utilities
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <endian.h>
+#include <errno.h>
+#include <stddef.h>
+#include <time.h>
+#include <ctype.h>
+#include <linux/limits.h>
+#include <sys/mman.h>
+
+#include "libpmem.h"
+#include "librpmem.h"
+#include "set.h"
+#include "file.h"
+#include "os.h"
+#include "mmap.h"
+#include "util.h"
+#include "out.h"
+#include "dlsym.h"
+#include "valgrind_internal.h"
+#include "sys_util.h"
+#include "util_pmem.h"
+#include "fs.h"
+#include "os_deep.h"
+#include "set_badblocks.h"
+
+#define LIBRARY_REMOTE "librpmem.so.1"
+#define SIZE_AUTODETECT_STR "AUTO"
+
+#define PMEM_EXT ".pmem"
+#define PMEM_EXT_LEN sizeof(PMEM_EXT)
+#define PMEM_FILE_PADDING 6
+#define PMEM_FILE_NAME_MAX_LEN 20
+#define PMEM_FILE_MAX_LEN (PMEM_FILE_NAME_MAX_LEN + PMEM_FILE_PADDING)
+
+static RPMEMpool *(*Rpmem_create)(const char *target, const char *pool_set_name,
+                       void *pool_addr, size_t pool_size, unsigned *nlanes,
+                       const struct rpmem_pool_attr *rpmem_attr);
+static RPMEMpool *(*Rpmem_open)(const char *target, const char *pool_set_name,
+                       void *pool_addr, size_t pool_size, unsigned *nlanes,
+                       struct rpmem_pool_attr *rpmem_attr);
+int (*Rpmem_close)(RPMEMpool *rpp);
+int (*Rpmem_persist)(RPMEMpool *rpp, size_t offset, size_t length,
+                       unsigned lane, unsigned flags);
+int (*Rpmem_deep_persist)(RPMEMpool *rpp, size_t offset, size_t length,
+                       unsigned lane);
+int (*Rpmem_read)(RPMEMpool *rpp, void *buff, size_t offset,
+               size_t length, unsigned lane);
+int (*Rpmem_remove)(const char *target, const char *pool_set_name, int flags);
+int (*Rpmem_set_attr)(RPMEMpool *rpp, const struct rpmem_pool_attr *rattr);
+
+static int Remote_replication_available;
+static os_mutex_t Remote_lock;
+static void *Rpmem_handle_remote;
+
+int Prefault_at_open = 0;
+int Prefault_at_create = 0;
+int SDS_at_create = POOL_FEAT_INCOMPAT_DEFAULT & POOL_E_FEAT_SDS ? 1 : 0;
+int Fallocate_at_create = 1;
+int COW_at_open = 0;
+
+/* list of pool set option names and flags */
+static const struct pool_set_option Options[] = {
+       { "SINGLEHDR", OPTION_SINGLEHDR },
+#ifndef _WIN32
+       { "NOHDRS", OPTION_NOHDRS },
+#endif
+       { NULL, OPTION_UNKNOWN }
+};
+
+/*
+ * util_remote_init -- initialize remote replication
+ */
+void
+util_remote_init(void)
+{
+       LOG(3, NULL);
+
+       /* XXX Is duplicate initialization really okay? */
+       if (!Remote_replication_available) {
+               util_mutex_init(&Remote_lock);
+               Remote_replication_available = 1;
+       }
+}
+
+/*
+ * util_remote_fini -- finalize remote replication
+ */
+void
+util_remote_fini(void)
+{
+       LOG(3, NULL);
+
+       util_remote_unload();
+
+       /* XXX Okay to be here if not initialized? */
+       if (Remote_replication_available) {
+               Remote_replication_available = 0;
+               util_mutex_destroy(&Remote_lock);
+       }
+}
+
+/*
+ * util_dl_check_error -- check libdl error
+ */
+static int
+util_dl_check_error(void *handle, const char *func)
+{
+       LOG(15, "handle %p func %s", handle, func);
+
+       if (handle == NULL) {
+               char *errstr = util_dlerror();
+               if (errstr)
+                       ERR("%s(): %s", func, errstr);
+               errno = ELIBACC;
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * util_remote_unload_core -- (internal) unload remote library (core function)
+ */
+static void
+util_remote_unload_core(void)
+{
+       if (Rpmem_handle_remote != NULL) {
+               util_dlclose(Rpmem_handle_remote);
+               Rpmem_handle_remote = NULL;
+       }
+       Rpmem_create = NULL;
+       Rpmem_open = NULL;
+       Rpmem_close = NULL;
+       Rpmem_persist = NULL;
+       Rpmem_deep_persist = NULL;
+       Rpmem_read = NULL;
+       Rpmem_remove = NULL;
+       Rpmem_set_attr = NULL;
+}
+
+/*
+ * util_remote_unload -- unload remote library
+ */
+void
+util_remote_unload(void)
+{
+       LOG(3, NULL);
+
+       if (!Remote_replication_available)
+               return;
+
+       util_mutex_lock(&Remote_lock);
+
+       util_remote_unload_core();
+
+       util_mutex_unlock(&Remote_lock);
+}
+
+/*
+ * util_remote_load -- load remote library
+ */
+int
+util_remote_load(void)
+{
+       LOG(3, NULL);
+
+       if (!Remote_replication_available) {
+               ERR("remote replication is not available");
+               return -1;
+       }
+
+       CHECK_FUNC_COMPATIBLE(rpmem_create, *Rpmem_create);
+       CHECK_FUNC_COMPATIBLE(rpmem_open, *Rpmem_open);
+       CHECK_FUNC_COMPATIBLE(rpmem_close, *Rpmem_close);
+       CHECK_FUNC_COMPATIBLE(rpmem_persist, *Rpmem_persist);
+       CHECK_FUNC_COMPATIBLE(rpmem_deep_persist, *Rpmem_deep_persist);
+       CHECK_FUNC_COMPATIBLE(rpmem_read, *Rpmem_read);
+       CHECK_FUNC_COMPATIBLE(rpmem_remove, *Rpmem_remove);
+
+       util_mutex_lock(&Remote_lock);
+
+       if (Rpmem_handle_remote)
+               goto end;
+
+       Rpmem_handle_remote = util_dlopen(LIBRARY_REMOTE);
+       if (util_dl_check_error(Rpmem_handle_remote, "dlopen")) {
+               ERR("the pool set requires a remote replica, "
+                   "but the '%s' library cannot be loaded",
+                   LIBRARY_REMOTE);
+               goto err;
+       }
+
+       Rpmem_create = util_dlsym(Rpmem_handle_remote, "rpmem_create");
+       if (util_dl_check_error(Rpmem_create, "dlsym")) {
+               ERR("symbol 'rpmem_create' not found");
+               goto err;
+       }
+
+       Rpmem_open = util_dlsym(Rpmem_handle_remote, "rpmem_open");
+       if (util_dl_check_error(Rpmem_open, "dlsym")) {
+               ERR("symbol 'rpmem_open' not found");
+               goto err;
+       }
+
+       Rpmem_close = util_dlsym(Rpmem_handle_remote, "rpmem_close");
+       if (util_dl_check_error(Rpmem_close, "dlsym")) {
+               ERR("symbol 'rpmem_close' not found");
+               goto err;
+       }
+
+       Rpmem_persist = util_dlsym(Rpmem_handle_remote, "rpmem_persist");
+       if (util_dl_check_error(Rpmem_persist, "dlsym")) {
+               ERR("symbol 'rpmem_persist' not found");
+               goto err;
+       }
+
+       Rpmem_deep_persist = util_dlsym(Rpmem_handle_remote,
+                       "rpmem_deep_persist");
+       if (util_dl_check_error(Rpmem_deep_persist, "dlsym")) {
+               ERR("symbol 'rpmem_deep_persist' not found");
+               goto err;
+       }
+
+       Rpmem_read = util_dlsym(Rpmem_handle_remote, "rpmem_read");
+       if (util_dl_check_error(Rpmem_read, "dlsym")) {
+               ERR("symbol 'rpmem_read' not found");
+               goto err;
+       }
+
+       Rpmem_remove = util_dlsym(Rpmem_handle_remote, "rpmem_remove");
+       if (util_dl_check_error(Rpmem_remove, "dlsym")) {
+               ERR("symbol 'rpmem_remove' not found");
+               goto err;
+       }
+
+       Rpmem_set_attr = util_dlsym(Rpmem_handle_remote, "rpmem_set_attr");
+       if (util_dl_check_error(Rpmem_set_attr, "dlsym")) {
+               ERR("symbol 'rpmem_set_attr' not found");
+               goto err;
+       }
+
+end:
+       util_mutex_unlock(&Remote_lock);
+       return 0;
+
+err:
+       LOG(4, "error clean up");
+       util_remote_unload_core();
+       util_mutex_unlock(&Remote_lock);
+       return -1;
+}
+
+/* reserve space for size, path and some whitespace and/or comment */
+
+enum parser_codes {
+       PARSER_CONTINUE = 0,
+       PARSER_PMEMPOOLSET,
+       PARSER_REPLICA,
+       PARSER_INVALID_TOKEN,
+       PARSER_REMOTE_REPLICA_EXPECTED,
+       PARSER_WRONG_SIZE,
+       PARSER_CANNOT_READ_SIZE,
+       PARSER_ABSOLUTE_PATH_EXPECTED,
+       PARSER_RELATIVE_PATH_EXPECTED,
+       PARSER_SET_NO_PARTS,
+       PARSER_REP_NO_PARTS,
+       PARSER_REMOTE_REP_UNEXPECTED_PARTS,
+       PARSER_SIZE_MISMATCH,
+       PARSER_OUT_OF_MEMORY,
+       PARSER_OPTION_UNKNOWN,
+       PARSER_OPTION_EXPECTED,
+       PARSER_FORMAT_OK,
+       PARSER_MAX_CODE
+};
+
+static const char *parser_errstr[PARSER_MAX_CODE] = {
+       "", /* parsing */
+       "the first line must be exactly 'PMEMPOOLSET'",
+       "exactly 'REPLICA' expected",
+       "invalid token found in the current line",
+       "address of remote node and descriptor of remote pool set expected",
+       "incorrect format of size",
+       "cannot determine size of a part",
+       "incorrect path (must be an absolute one)",
+       "incorrect descriptor (must be a relative path)",
+       "no pool set parts",
+       "no replica parts",
+       "unexpected parts for remote replica",
+       "sizes of pool set and replica mismatch",
+       "allocating memory failed",
+       "unknown option",
+       "missing option name",
+       "" /* format correct */
+};
+
+/*
+ * util_replica_force_page_allocation - (internal) forces page allocation for
+ * replica
+ */
+static void
+util_replica_force_page_allocation(struct pool_replica *rep)
+{
+       volatile char *cur_addr = rep->part[0].addr;
+       char *addr_end = (char *)cur_addr + rep->resvsize;
+       for (; cur_addr < addr_end; cur_addr += Pagesize) {
+               *cur_addr = *cur_addr;
+               VALGRIND_SET_CLEAN(cur_addr, 1);
+       }
+}
+
+/*
+ * util_map_hdr -- map a header of a pool set
+ */
+int
+util_map_hdr(struct pool_set_part *part, int flags, int rdonly)
+{
+       LOG(3, "part %p flags %d", part, flags);
+
+       COMPILE_ERROR_ON(POOL_HDR_SIZE == 0);
+       ASSERTeq(POOL_HDR_SIZE % Pagesize, 0);
+
+       /*
+        * Workaround for Device DAX not allowing to map a portion
+        * of the device if offset/length are not aligned to the internal
+        * device alignment (page size).  I.e. if the device alignment
+        * is 2M, we cannot map the 4K header, but need to align the mapping
+        * length to 2M.
+        *
+        * According to mmap(2), system should automatically align mapping
+        * length to be a multiple of the underlying page size, but it's
+        * not true for Device DAX.
+        */
+       size_t hdrsize = part->alignment > POOL_HDR_SIZE
+                       ? part->alignment : POOL_HDR_SIZE;
+
+       void *addr = NULL;
+
+#if VG_MEMCHECK_ENABLED
+       if (On_valgrind) {
+               /* this is required only for Device DAX & memcheck */
+               addr = util_map_hint(hdrsize, hdrsize);
+               if (addr == MAP_FAILED) {
+                       LOG(1, "cannot find a contiguous region of given size");
+                       /* there's nothing we can do */
+                       return -1;
+               }
+       }
+#endif
+
+       int prot = rdonly ? PROT_READ : PROT_READ|PROT_WRITE;
+       void *hdrp = util_map_sync(addr, hdrsize, prot, flags,
+                       part->fd, 0, &part->hdr_map_sync);
+       if (hdrp == MAP_FAILED) {
+               ERR("!mmap: %s", part->path);
+               return -1;
+       }
+
+       part->hdrsize = hdrsize;
+       part->hdr = hdrp;
+
+       VALGRIND_REGISTER_PMEM_MAPPING(part->hdr, part->hdrsize);
+       VALGRIND_REGISTER_PMEM_FILE(part->fd, part->hdr, part->hdrsize, 0);
+
+       return 0;
+}
+
+/*
+ * util_unmap_hdr -- unmap pool set part header
+ */
+void
+util_unmap_hdr(struct pool_set_part *part)
+{
+       if (part->hdr == NULL || part->hdrsize == 0)
+               return;
+
+       LOG(4, "munmap: addr %p size %zu", part->hdr, part->hdrsize);
+       VALGRIND_REMOVE_PMEM_MAPPING(part->hdr, part->hdrsize);
+       if (munmap(part->hdr, part->hdrsize) != 0)
+               /* this means there's a bug on the caller side */
+               FATAL("!munmap: %s", part->path);
+       part->hdr = NULL;
+       part->hdrsize = 0;
+}
+
+/*
+ * util_map_part -- map a part of a pool set
+ */
+int
+util_map_part(struct pool_set_part *part, void *addr, size_t size,
+       size_t offset, int flags, int rdonly)
+{
+       LOG(3, "part %p addr %p size %zu offset %zu flags %d",
+               part, addr, size, offset, flags);
+
+       ASSERTeq((uintptr_t)addr % Mmap_align, 0);
+       ASSERTeq(offset % Mmap_align, 0);
+       ASSERTeq(size % Mmap_align, 0);
+       ASSERT(((os_off_t)offset) >= 0);
+       ASSERTeq(offset % part->alignment, 0);
+       ASSERT(offset < part->filesize);
+
+       if (!size)
+               size = (part->filesize - offset) & ~(part->alignment - 1);
+       else
+               size = roundup(size, part->alignment);
+
+       int prot = rdonly ? PROT_READ : PROT_READ | PROT_WRITE;
+       void *addrp = util_map_sync(addr, size, prot, flags, part->fd,
+                       (os_off_t)offset, &part->map_sync);
+       if (addrp == MAP_FAILED) {
+               ERR("!mmap: %s", part->path);
+               return -1;
+       }
+
+       if (addr != NULL && (flags & MAP_FIXED) && addrp != addr) {
+               ERR("unable to map at requested address %p", addr);
+               munmap(addrp, size);
+               return -1;
+       }
+
+       part->addr = addrp;
+       part->size = size;
+
+       VALGRIND_REGISTER_PMEM_MAPPING(part->addr, part->size);
+       VALGRIND_REGISTER_PMEM_FILE(part->fd, part->addr, part->size, offset);
+
+       return 0;
+}
+
+/*
+ * util_unmap_part -- unmap a part of a pool set
+ */
+int
+util_unmap_part(struct pool_set_part *part)
+{
+       LOG(3, "part %p", part);
+
+       if (part->addr != NULL && part->size != 0) {
+               LOG(4, "munmap: addr %p size %zu", part->addr, part->size);
+               VALGRIND_REMOVE_PMEM_MAPPING(part->addr, part->size);
+               if (munmap(part->addr, part->size) != 0) {
+                       ERR("!munmap: %s", part->path);
+               }
+
+               part->addr = NULL;
+               part->size = 0;
+       }
+
+       return 0;
+}
+
+/*
+ * util_unmap_parts -- unmap parts from start_index to the end_index
+ */
+int
+util_unmap_parts(struct pool_replica *rep, unsigned start_index,
+       unsigned end_index)
+{
+       LOG(3, "rep: %p, start_index: %u, end_index: %u", rep, start_index,
+               end_index);
+
+       for (unsigned p = start_index; p <= end_index; p++)
+               util_unmap_part(&rep->part[p]);
+
+       return 0;
+}
+
+/*
+ * util_poolset_free -- free pool set info
+ */
+void
+util_poolset_free(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote == NULL) {
+                       /* only local replicas have paths */
+                       for (unsigned p = 0; p < rep->nallocated; p++) {
+                               Free((void *)(rep->part[p].path));
+                       }
+               } else {
+                       /* remote replica */
+                       ASSERTeq(rep->nparts, 1);
+                       Free(rep->remote->node_addr);
+                       Free(rep->remote->pool_desc);
+                       Free(rep->remote);
+               }
+               struct pool_set_directory *d;
+               VEC_FOREACH_BY_PTR(d, &rep->directory) {
+                       Free((void *)d->path);
+               }
+               VEC_DELETE(&rep->directory);
+               Free(set->replica[r]);
+       }
+       Free(set->path);
+       Free(set);
+}
+
+/*
+ * util_poolset_open -- open all replicas from a poolset
+ */
+int
+util_poolset_open(struct pool_set *set)
+{
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (util_replica_open(set, r, MAP_SHARED)) {
+                       LOG(2, "replica open failed: replica %u", r);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_replica_close_local -- close local replica, optionally delete the
+ *                             replica's parts
+ */
+int
+util_replica_close_local(struct pool_replica *rep, unsigned repn,
+               enum del_parts_mode del)
+{
+       for (unsigned p = 0; p < rep->nparts; p++) {
+               if (rep->part[p].fd != -1)
+                       (void) os_close(rep->part[p].fd);
+
+               if ((del == DELETE_CREATED_PARTS && rep->part[p].created) ||
+                               del == DELETE_ALL_PARTS) {
+                       LOG(4, "unlink %s", rep->part[p].path);
+                       int olderrno = errno;
+                       if (util_unlink(rep->part[p].path) && errno != ENOENT) {
+                               ERR("!unlink %s failed (part %u, replica %u)",
+                                               rep->part[p].path, p, repn);
+                               return -1;
+                       }
+                       errno = olderrno;
+               }
+       }
+       return 0;
+}
+
+/*
+ * util_replica_close_remote -- close remote replica, optionally delete the
+ *                              replica
+ */
+int
+util_replica_close_remote(struct pool_replica *rep, unsigned repn,
+               enum del_parts_mode del)
+{
+       if (!rep->remote)
+               return 0;
+
+       if (rep->remote->rpp) {
+               LOG(4, "closing remote replica #%u", repn);
+               Rpmem_close(rep->remote->rpp);
+               rep->remote->rpp = NULL;
+       }
+
+       if ((del == DELETE_CREATED_PARTS && rep->part[0].created) ||
+                       del == DELETE_ALL_PARTS) {
+               LOG(4, "removing remote replica #%u", repn);
+               int ret = Rpmem_remove(rep->remote->node_addr,
+                       rep->remote->pool_desc, 0);
+               if (ret) {
+                       LOG(1, "!removing remote replica #%u failed", repn);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * util_poolset_close -- unmap and close all the parts of the pool set,
+ *                       optionally delete parts
+ */
+void
+util_poolset_close(struct pool_set *set, enum del_parts_mode del)
+{
+       LOG(3, "set %p del %d", set, del);
+
+       int oerrno = errno;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               util_replica_close(set, r);
+
+               struct pool_replica *rep = set->replica[r];
+               if (!rep->remote)
+                       (void) util_replica_close_local(rep, r, del);
+               else
+                       (void) util_replica_close_remote(rep, r, del);
+       }
+
+       /*
+        * XXX On FreeBSD, mmap()ing a file does not increment the flock()
+        *     reference count, so we had to keep the files open until now.
+        */
+#ifdef __FreeBSD__
+       util_poolset_fdclose_always(set);
+#endif
+       util_poolset_free(set);
+
+       errno = oerrno;
+}
+
+/*
+ * util_poolset_chmod -- change mode for all created files related to pool set
+ */
+int
+util_poolset_chmod(struct pool_set *set, mode_t mode)
+{
+       LOG(3, "set %p mode %o", set, mode);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+
+               /* skip remote replicas */
+               if (rep->remote != NULL)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+
+                       /* skip not created or closed parts */
+                       if (!part->created || part->fd == -1)
+                               continue;
+
+                       os_stat_t stbuf;
+                       if (os_fstat(part->fd, &stbuf) != 0) {
+                               ERR("!fstat %d %s", part->fd, part->path);
+                               return -1;
+                       }
+
+                       if (stbuf.st_mode & ~(unsigned)S_IFMT) {
+                               LOG(1, "file permissions changed during pool "
+                                       "initialization, file: %s (%o)",
+                                       part->path,
+                                       stbuf.st_mode & ~(unsigned)S_IFMT);
+                       }
+
+                       if (os_chmod(part->path, mode)) {
+                               ERR("!chmod %u/%u/%s", r, p, part->path);
+                               return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_fdclose_always -- close file descriptors related to pool set
+ */
+void
+util_poolset_fdclose_always(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       for (unsigned r = 0; r < set->nreplicas; r++)
+               util_replica_fdclose(set->replica[r]);
+}
+
+/*
+ * util_poolset_fdclose -- close pool set file descriptors if not FreeBSD
+ *
+ * XXX On FreeBSD, mmap()ing a file does not increment the flock()
+ *     reference count, so we need to keep the files open.
+ */
+void
+util_poolset_fdclose(struct pool_set *set)
+{
+#ifdef __FreeBSD__
+       LOG(3, "set %p: holding open", set);
+#else
+       util_poolset_fdclose_always(set);
+#endif
+}
+
+/*
+ * util_autodetect_size -- (internal) retrieves size of an existing file
+ */
+static ssize_t
+util_autodetect_size(const char *path)
+{
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       if (type == TYPE_NORMAL) {
+               ERR("size autodetection is supported only for device dax");
+               return -1;
+       }
+
+       return util_file_get_size(path);
+}
+
+/*
+ * parser_read_line -- (internal) read line and validate size and path
+ *                      from a pool set file
+ */
+static enum parser_codes
+parser_read_line(char *line, size_t *size, char **path)
+{
+       int ret;
+       char *size_str;
+       char *path_str;
+       char *rest_str;
+       char *saveptr = NULL; /* must be NULL initialized on Windows */
+
+       size_str = strtok_r(line, " \t", &saveptr);
+       path_str = strtok_r(NULL, " \t", &saveptr);
+       rest_str = strtok_r(NULL, " \t", &saveptr);
+
+       if (!size_str || !path_str || rest_str)
+               return PARSER_INVALID_TOKEN;
+
+       LOG(10, "size '%s' path '%s'", size_str, path_str);
+
+       /*
+        * A format of the size is checked in detail. As regards the path,
+        * it is checked only if the read path is an absolute path.
+        * The rest should be checked during creating/opening the file.
+        */
+
+       /* check if the read path is an absolute path */
+       if (!util_is_absolute_path(path_str))
+               return PARSER_ABSOLUTE_PATH_EXPECTED;
+
+       *path = Strdup(path_str);
+       if (!(*path)) {
+               ERR("!Strdup");
+               return PARSER_OUT_OF_MEMORY;
+       }
+
+       if (strcmp(SIZE_AUTODETECT_STR, size_str) == 0) {
+               /*
+                * XXX: this should be done after the parsing completes, but
+                * currently this operation is performed in simply too many
+                * places in the code to move this someplace else.
+                */
+               ssize_t s = util_autodetect_size(path_str);
+               if (s < 0) {
+                       Free(*path);
+                       *path = NULL;
+                       return PARSER_CANNOT_READ_SIZE;
+               }
+
+               *size = (size_t)s;
+
+               return PARSER_CONTINUE;
+       }
+
+       ret = util_parse_size(size_str, size);
+       if (ret != 0 || *size == 0) {
+               Free(*path);
+               *path = NULL;
+               return PARSER_WRONG_SIZE;
+       }
+
+       return PARSER_CONTINUE;
+}
+
+/*
+ * parser_read_replica -- (internal) read line and validate remote replica
+ *                        from a pool set file
+ */
+static enum parser_codes
+parser_read_replica(char *line, char **node_addr, char **pool_desc)
+{
+       char *addr_str;
+       char *desc_str;
+       char *rest_str;
+       char *saveptr = NULL; /* must be NULL initialized on Windows */
+
+       addr_str = strtok_r(line, " \t", &saveptr);
+       desc_str = strtok_r(NULL, " \t", &saveptr);
+       rest_str = strtok_r(NULL, " \t", &saveptr);
+
+       if (!addr_str || !desc_str)
+               return PARSER_REMOTE_REPLICA_EXPECTED;
+
+       if (rest_str)
+               return PARSER_INVALID_TOKEN;
+
+       LOG(10, "node address '%s' pool set descriptor '%s'",
+               addr_str, desc_str);
+
+       /* check if the descriptor is a relative path */
+       if (util_is_absolute_path(desc_str))
+               return PARSER_RELATIVE_PATH_EXPECTED;
+
+       *node_addr = Strdup(addr_str);
+       *pool_desc = Strdup(desc_str);
+
+       if (!(*node_addr) || !(*pool_desc)) {
+               ERR("!Strdup");
+               if (*node_addr)
+                       Free(*node_addr);
+               if (*pool_desc)
+                       Free(*pool_desc);
+               return PARSER_OUT_OF_MEMORY;
+       }
+
+       return PARSER_CONTINUE;
+}
+
+/*
+ * parser_read_options -- (internal) read line and validate options
+ */
+static enum parser_codes
+parser_read_options(char *line, unsigned *options)
+{
+       LOG(3, "line '%s'", line);
+
+       int opt_cnt = 0;
+       char *saveptr = NULL; /* must be NULL initialized on Windows */
+
+       char *opt_str = strtok_r(line, " \t", &saveptr);
+       while (opt_str != NULL) {
+               LOG(4, "option '%s'", opt_str);
+
+               int i = 0;
+               while (Options[i].name && strcmp(opt_str, Options[i].name) != 0)
+                       i++;
+
+               if (Options[i].name == NULL) {
+                       LOG(4, "unknown option '%s'", opt_str);
+                       return PARSER_OPTION_UNKNOWN;
+               }
+
+               if (*options & Options[i].flag)
+                       LOG(4, "duplicated option '%s'", opt_str);
+
+               *options |= Options[i].flag;
+
+               opt_cnt++;
+               opt_str = strtok_r(NULL, " \t", &saveptr);
+       }
+
+       if (opt_cnt == 0)
+               return PARSER_OPTION_EXPECTED;
+
+       return PARSER_CONTINUE;
+}
+
+/*
+ * util_replica_reserve -- reserves part slots capacity in a replica
+ */
+static int
+util_replica_reserve(struct pool_replica **repp, unsigned n)
+{
+       LOG(3, "replica %p n %u", *repp, n);
+
+       struct pool_replica *rep = *repp;
+       if (rep->nallocated >= n)
+               return 0;
+
+       rep = Realloc(rep, sizeof(struct pool_replica) +
+               (n) * sizeof(struct pool_set_part));
+       if (rep == NULL) {
+               ERR("!Realloc");
+               return -1;
+       }
+
+       size_t nsize = sizeof(struct pool_set_part) * (n - rep->nallocated);
+       memset(rep->part + rep->nallocated, 0, nsize);
+
+       rep->nallocated = n;
+       *repp = rep;
+
+       return 0;
+}
+
+/*
+ * util_replica_add_part_by_idx -- (internal) allocates, initializes and adds a
+ *     part structure at the provided location in the replica info
+ */
+static int
+util_replica_add_part_by_idx(struct pool_replica **repp,
+       const char *path, size_t filesize, unsigned p)
+{
+       LOG(3, "replica %p path %s filesize %zu", *repp, path, filesize);
+
+       if (util_replica_reserve(repp, p + 1) != 0)
+               return -1;
+
+       struct pool_replica *rep = *repp;
+       ASSERTne(rep, NULL);
+
+       int is_dev_dax = 0;
+
+       if (path != NULL) {
+               enum file_type type = util_file_get_type(path);
+               if (type == OTHER_ERROR)
+                       return -1;
+
+               is_dev_dax = type == TYPE_DEVDAX;
+       }
+
+       rep->part[p].path = path;
+       rep->part[p].filesize = filesize;
+       rep->part[p].fd = -1;
+       rep->part[p].is_dev_dax = is_dev_dax;
+       rep->part[p].created = 0;
+       rep->part[p].hdr = NULL;
+       rep->part[p].addr = NULL;
+       rep->part[p].remote_hdr = NULL;
+       rep->part[p].has_bad_blocks = 0;
+
+       if (is_dev_dax)
+               rep->part[p].alignment = util_file_device_dax_alignment(path);
+       else
+               rep->part[p].alignment = Mmap_align;
+
+       ASSERTne(rep->part[p].alignment, 0);
+
+       rep->nparts += 1;
+
+       return 0;
+}
+
+/*
+ * util_replica_add_part -- adds a next part in replica info
+ */
+static int
+util_replica_add_part(struct pool_replica **repp,
+       const char *path, size_t filesize)
+{
+       LOG(3, "replica %p path \"%s\" filesize %zu", *repp, path, filesize);
+
+       return util_replica_add_part_by_idx(repp, path,
+               filesize, (*repp)->nparts);
+}
+
+/*
+ * util_parse_add_part -- (internal) add a new part file to the replica info
+ */
+static int
+util_parse_add_part(struct pool_set *set, const char *path, size_t filesize)
+{
+       LOG(3, "set %p path %s filesize %zu", set, path, filesize);
+
+       ASSERTne(set, NULL);
+
+       if (set->directory_based) {
+               ERR("cannot mix directories and files in a set");
+               errno = EINVAL;
+               return -1;
+       }
+
+       return util_replica_add_part(&set->replica[set->nreplicas - 1],
+               path, filesize);
+}
+
+/*
+ * util_parse_add_directory --
+ *     (internal) add a new directory to the replica info
+ */
+static int
+util_parse_add_directory(struct pool_set *set, const char *path,
+       size_t filesize)
+{
+       LOG(3, "set %p path %s filesize %zu", set, path, filesize);
+
+       ASSERTne(set, NULL);
+
+       struct pool_replica *rep = set->replica[set->nreplicas - 1];
+       ASSERTne(rep, NULL);
+
+       if (set->directory_based == 0) {
+               if (rep->nparts > 0 || set->nreplicas > 1) {
+                       ERR("cannot mix directories and files in a set");
+                       errno = EINVAL;
+                       return -1;
+               }
+               set->directory_based = 1;
+       }
+
+       char *rpath = util_part_realpath(path);
+       if (rpath == NULL) {
+               ERR("cannot resolve realpath of new directory");
+               return -1;
+       }
+
+       for (unsigned i = 0; i < set->nreplicas; ++i) {
+               struct pool_replica *r = set->replica[i];
+               struct pool_set_directory *dir;
+               char *dpath = NULL;
+               VEC_FOREACH_BY_PTR(dir, &r->directory) {
+                       dpath = util_part_realpath(dir->path);
+                       ASSERTne(dpath, NULL); /* must have been resolved */
+                       if (strcmp(rpath, dpath) == 0) {
+                               ERR("cannot use the same directory twice");
+                               errno = EEXIST;
+                               free(dpath);
+                               free(rpath);
+                               return -1;
+                       }
+                       free(dpath);
+               }
+       }
+       free(rpath);
+
+       struct pool_set_directory d;
+       d.path = path;
+       d.resvsize = filesize;
+
+       if (VEC_PUSH_BACK(&rep->directory, d) != 0)
+               return -1;
+
+       rep->resvsize += filesize;
+
+       return 0;
+}
+
+/*
+ * util_parse_add_element --
+ *     (internal) add a new element to the replica info
+ */
+static int
+util_parse_add_element(struct pool_set *set, const char *path, size_t filesize)
+{
+       LOG(3, "set %p path %s filesize %zu", set, path, filesize);
+
+       os_stat_t stat;
+
+       int olderrno = errno;
+
+       if (os_stat(path, &stat) == 0 && S_ISDIR(stat.st_mode))
+               return util_parse_add_directory(set, path, filesize);
+
+       errno = olderrno;
+
+       return util_parse_add_part(set, path, filesize);
+}
+
+/*
+ * util_parse_add_replica -- (internal) add a new replica to the pool set info
+ */
+static int
+util_parse_add_replica(struct pool_set **setp)
+{
+       LOG(3, "setp %p", setp);
+
+       ASSERTne(setp, NULL);
+
+       struct pool_set *set = *setp;
+       ASSERTne(set, NULL);
+
+       set = Realloc(set, sizeof(struct pool_set) +
+                       (set->nreplicas + 1) * sizeof(struct pool_replica *));
+       if (set == NULL) {
+               ERR("!Realloc");
+               return -1;
+       }
+       *setp = set;
+
+       struct pool_replica *rep;
+       rep = Zalloc(sizeof(struct pool_replica));
+       if (rep == NULL) {
+               ERR("!Zalloc");
+               return -1;
+       }
+
+       VEC_INIT(&rep->directory);
+
+       unsigned r = set->nreplicas++;
+
+       set->replica[r] = rep;
+
+       return 0;
+}
+
+/*
+ * util_replica_check_map_sync -- (internal) check MAP_SYNC restrictions
+ */
+static int
+util_replica_check_map_sync(struct pool_set *set, unsigned repidx,
+       int check_hdr)
+{
+       LOG(3, "set %p repidx %u", set, repidx);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       int map_sync = rep->part[0].map_sync;
+
+       for (unsigned p = 1; p < rep->nparts; p++) {
+               if (map_sync != rep->part[p].map_sync) {
+                       ERR("replica #%u part %u %smapped with MAP_SYNC",
+                               repidx, p, rep->part[p].map_sync ? "" : "not");
+                       return -1;
+               }
+       }
+
+       if (check_hdr) {
+               for (unsigned p = 0; p < rep->nhdrs; p++) {
+                       if (map_sync != rep->part[p].hdr_map_sync) {
+                               ERR("replica #%u part %u header %smapped "
+                                       "with MAP_SYNC", repidx, p,
+                                       rep->part[p].hdr_map_sync ?
+                                       "" : "not");
+                               return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_check_devdax -- (internal) check Device DAX restrictions
+ */
+static int
+util_poolset_check_devdax(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       if (set->directory_based)
+               return 0;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               int is_dev_dax = rep->part[0].is_dev_dax;
+
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       if (rep->part[p].is_dev_dax != is_dev_dax) {
+                               ERR(
+                                       "either all the parts must be Device DAX or none");
+                               return -1;
+                       }
+
+                       if (is_dev_dax && rep->nparts > 1 &&
+                                       (set->options & (OPTION_SINGLEHDR |
+                                       OPTION_NOHDRS)) == 0 &&
+                           util_file_device_dax_alignment(rep->part[p].path)
+                                       != Pagesize) {
+                               ERR(
+                                       "Multiple DAX devices with alignment other than 4KB. Use the SINGLEHDR poolset option.");
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * util_poolset_check_options -- (internal) check if poolset options are
+ *                               admissible
+ */
+static int
+util_poolset_check_options(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       if ((set->options & OPTION_SINGLEHDR) &&
+                       (set->options & OPTION_NOHDRS)) {
+               ERR(
+               "both SINGLEHDR and NOHDR poolset options used at the same time");
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * util_poolset_set_size -- (internal) calculate pool size
+ */
+static void
+util_poolset_set_size(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       set->poolsize = SIZE_MAX;
+       set->resvsize = SIZE_MAX;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+
+               if (set->options & OPTION_SINGLEHDR)
+                       rep->nhdrs = 1;
+               else if (set->options & OPTION_NOHDRS)
+                       rep->nhdrs = 0;
+               else
+                       rep->nhdrs = rep->nparts;
+
+               rep->repsize = 0;
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       rep->repsize +=
+                               (rep->part[p].filesize & ~(Mmap_align - 1));
+               }
+               if (rep->nhdrs > 0)
+                       rep->repsize -= (rep->nhdrs - 1) * Mmap_align;
+
+               if (rep->resvsize == 0)
+                       rep->resvsize = rep->repsize;
+
+               /*
+                * Calculate pool size - choose the smallest replica size.
+                * Ignore remote replicas.
+                */
+               if (rep->remote == NULL && rep->repsize < set->poolsize)
+                       set->poolsize = rep->repsize;
+               if (rep->remote == NULL && rep->resvsize < set->resvsize)
+                       set->resvsize = rep->resvsize;
+       }
+
+       LOG(3, "pool size set to %zu", set->poolsize);
+}
+
+/*
+ * util_parse_add_remote_replica -- (internal) add a new remote replica
+ *                                  to the pool set info
+ */
+static int
+util_parse_add_remote_replica(struct pool_set **setp, char *node_addr,
+                               char *pool_desc)
+{
+       LOG(3, "setp %p node_addr %s pool_desc %s", setp, node_addr, pool_desc);
+
+       ASSERTne(setp, NULL);
+       ASSERTne(node_addr, NULL);
+       ASSERTne(pool_desc, NULL);
+
+       int ret = util_parse_add_replica(setp);
+       if (ret != 0)
+               return ret;
+
+       /*
+        * A remote replica has one fake part of size equal twice pool header
+        * size for storing pool header and pool descriptor.
+        */
+       ret = util_parse_add_part(*setp, NULL, 2 * POOL_HDR_SIZE);
+       if (ret != 0)
+               return ret;
+
+       struct pool_set *set = *setp;
+       struct pool_replica *rep = set->replica[set->nreplicas - 1];
+       ASSERTne(rep, NULL);
+
+       rep->remote = Zalloc(sizeof(struct remote_replica));
+       if (rep->remote == NULL) {
+               ERR("!Malloc");
+               return -1;
+       }
+       rep->remote->node_addr = node_addr;
+       rep->remote->pool_desc = pool_desc;
+       set->remote = 1;
+
+       return 0;
+}
+
+/*
+ * util_part_idx_by_file_name -- (internal) retrieves the part index from a
+ *     name of the file that is an element of a directory poolset
+ */
+static long
+util_part_idx_by_file_name(const char *filename)
+{
+       LOG(3, "filename \"%s\"", filename);
+
+       int olderrno = errno;
+       errno = 0;
+       long part_idx = strtol(filename, NULL, 10);
+       if (errno != 0)
+               return -1;
+
+       errno = olderrno;
+
+       return part_idx;
+}
+
+/*
+ * util_poolset_directory_load -- (internal) loads and initializes all
+ *     existing parts in a single directory
+ */
+static int
+util_poolset_directory_load(struct pool_replica **repp, const char *directory)
+{
+       LOG(3, "rep %p dir \"%s\"", *repp, directory);
+
+       struct fs *f = fs_new(directory);
+       if (f == NULL) {
+               ERR("!fs_new: \"%s\"", directory);
+               return -1;
+       }
+
+       int nparts = 0;
+       char *path = NULL;
+
+       struct fs_entry *entry;
+       while ((entry = fs_read(f)) != NULL) {
+               if (entry->level != 1)
+                       continue;
+               if (entry->type != FS_ENTRY_FILE)
+                       continue;
+               if (entry->namelen < PMEM_EXT_LEN)
+                       continue;
+               const char *ext = entry->path + entry->pathlen -
+                       PMEM_EXT_LEN + 1;
+               if (strcmp(PMEM_EXT, ext) != 0)
+                       continue;
+
+               long part_idx = util_part_idx_by_file_name(entry->name);
+               if (part_idx < 0)
+                       continue;
+
+               ssize_t size = util_file_get_size(entry->path);
+               if (size < 0) {
+                       LOG(2,
+                       "cannot read size of file (%s) in a poolset directory",
+                       entry->path);
+                       goto err;
+               }
+
+               if ((path = Strdup(entry->path)) == NULL) {
+                       ERR("!Strdup");
+                       goto err;
+               }
+
+               if (util_replica_add_part_by_idx(repp, path,
+                               (size_t)size, (unsigned)part_idx) != 0) {
+                       ERR("unable to load part %s", entry->path);
+                       goto err;
+               }
+               nparts++;
+       }
+
+       fs_delete(f);
+       return nparts;
+
+err:
+       fs_delete(f);
+       return -1;
+}
+
+/*
+ * util_poolset_directories_load -- (internal) loads and initializes all
+ *     existing parts in the poolset directories
+ */
+static int
+util_poolset_directories_load(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       if (!set->directory_based)
+               return 0;
+
+       unsigned next_part_id = 0;
+       unsigned max_parts_rep = 0;
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               next_part_id = 0;
+
+               struct pool_set_directory *d;
+               int nparts = 0;
+               int prev_nparts = 0;
+               VEC_FOREACH_BY_PTR(d, &set->replica[r]->directory) {
+                       prev_nparts = nparts;
+                       nparts = util_poolset_directory_load(&set->replica[r],
+                               d->path);
+                       if (nparts < 0) {
+                               ERR("failed to load parts from directory %s",
+                                       d->path);
+                               return -1;
+                       }
+
+                       next_part_id += (unsigned)nparts;
+
+                       /* always try to evenly spread files across dirs */
+                       if (r == 0 && prev_nparts > nparts)
+                               set->next_directory_id++;
+               }
+
+               if (next_part_id > set->replica[max_parts_rep]->nparts)
+                       max_parts_rep = r;
+
+               if (r == 0)
+                       set->next_id = next_part_id;
+       }
+
+       /*
+        * In order to maintain the same semantics of poolset parsing for
+        * regular poolsets and directory poolsets, we need to speculatively
+        * recreate the information regarding any missing parts in replicas.
+        */
+       struct pool_replica *rep;
+       struct pool_replica *mrep = set->replica[max_parts_rep];
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               if (set->replica[r]->nparts == mrep->nparts)
+                       continue;
+
+               if (VEC_SIZE(&set->replica[r]->directory) == 0) {
+                       errno = ENOENT;
+                       ERR("!no directories in replica");
+                       return -1;
+               }
+
+               if (util_replica_reserve(&set->replica[r], mrep->nparts) != 0)
+                       return -1;
+
+               rep = set->replica[r];
+
+               struct pool_set_directory *d = VEC_GET(&rep->directory, 0);
+
+               for (unsigned pidx = 0; pidx < rep->nallocated; ++pidx) {
+                       struct pool_set_part *p = &rep->part[pidx];
+                       *p = mrep->part[pidx];
+
+                       size_t path_len = strlen(d->path) + PMEM_FILE_MAX_LEN;
+                       if ((p->path = Malloc(path_len)) == NULL) {
+                               ERR("!Malloc");
+                               return -1;
+                       }
+
+                       snprintf((char *)p->path, path_len,
+                                       "%s" OS_DIR_SEP_STR "%0*u%s",
+                                       d->path, PMEM_FILE_PADDING,
+                                       pidx, PMEM_EXT);
+               }
+               rep->nparts = mrep->nparts;
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_parse -- parse pool set config file
+ *
+ * Returns 0 if the file is a valid poolset config file,
+ * and -1 in case of any error.
+ *
+ * XXX: use memory mapped file
+ */
+int
+util_poolset_parse(struct pool_set **setp, const char *path, int fd)
+{
+       LOG(3, "setp %p path %s fd %d", setp, path, fd);
+
+       struct pool_set *set = NULL;
+       enum parser_codes result;
+       char *line;
+       char *ppath;
+       char *pool_desc;
+       char *node_addr;
+       char *cp;
+       size_t psize;
+       FILE *fs;
+       int oerrno;
+
+       if (os_lseek(fd, 0, SEEK_SET) != 0) {
+               ERR("!lseek %d", fd);
+               return -1;
+       }
+
+       fd = dup(fd);
+       if (fd < 0) {
+               ERR("!dup");
+               return -1;
+       }
+
+       /* associate a stream with the file descriptor */
+       if ((fs = os_fdopen(fd, "r")) == NULL) {
+               ERR("!fdopen %d", fd);
+               os_close(fd);
+               return -1;
+       }
+
+       unsigned nlines = 0;
+       unsigned nparts = 0; /* number of parts in current replica */
+
+       /* read the first line */
+       line = util_readline(fs);
+       if (line == NULL) {
+               ERR("!Reading poolset file");
+               goto err;
+       }
+       nlines++;
+
+       set = Zalloc(sizeof(struct pool_set));
+       if (set == NULL) {
+               ERR("!Malloc for pool set");
+               goto err;
+       }
+
+       set->path = Strdup(path);
+       if (set->path == NULL)  {
+               ERR("!Strdup");
+               goto err;
+       }
+
+       /* check also if the last character is '\n' */
+       if (strncmp(line, POOLSET_HDR_SIG, POOLSET_HDR_SIG_LEN) == 0 &&
+           line[POOLSET_HDR_SIG_LEN] == '\n') {
+               /* 'PMEMPOOLSET' signature detected */
+               LOG(10, "PMEMPOOLSET");
+
+               int ret = util_parse_add_replica(&set);
+               if (ret != 0)
+                       goto err;
+
+               nparts = 0;
+               result = PARSER_CONTINUE;
+       } else {
+               result = PARSER_PMEMPOOLSET;
+       }
+
+       while (result == PARSER_CONTINUE) {
+               Free(line);
+               /* read next line */
+               line = util_readline(fs);
+               nlines++;
+
+               if (line) {
+                       /* chop off newline and comments */
+                       if ((cp = strchr(line, '\n')) != NULL)
+                               *cp = '\0';
+                       if (cp != line && (cp = strchr(line, '#')) != NULL)
+                               *cp = '\0';
+
+                       /* skip comments and blank lines */
+                       if (cp == line)
+                               continue;
+               }
+
+               if (!line) {
+                       if (nparts >= 1) {
+                               result = PARSER_FORMAT_OK;
+                       } else {
+                               if (set->nreplicas == 1)
+                                       result = PARSER_SET_NO_PARTS;
+                               else
+                                       result = PARSER_REP_NO_PARTS;
+                       }
+               } else if (strncmp(line, POOLSET_OPTION_SIG,
+                                       POOLSET_OPTION_SIG_LEN) == 0) {
+                       result = parser_read_options(
+                                       line + POOLSET_OPTION_SIG_LEN,
+                                       &set->options);
+                       if (result == PARSER_CONTINUE) {
+                               LOG(10, "OPTIONS: %x", set->options);
+                       }
+               } else if (strncmp(line, POOLSET_REPLICA_SIG,
+                                       POOLSET_REPLICA_SIG_LEN) == 0) {
+                       if (line[POOLSET_REPLICA_SIG_LEN] != '\0') {
+                               /* something more than 'REPLICA' */
+                               char c = line[POOLSET_REPLICA_SIG_LEN];
+                               if (!isblank((unsigned char)c)) {
+                                       result = PARSER_REPLICA;
+                                       continue;
+                               }
+                               /* check if it is a remote replica */
+                               result = parser_read_replica(
+                                               line + POOLSET_REPLICA_SIG_LEN,
+                                               &node_addr, &pool_desc);
+                               if (result == PARSER_CONTINUE) {
+                                       /* remote REPLICA */
+                                       LOG(10, "REMOTE REPLICA "
+                                               "node address '%s' "
+                                               "pool set descriptor '%s'",
+                                               node_addr, pool_desc);
+                                       if (util_parse_add_remote_replica(&set,
+                                                       node_addr, pool_desc))
+                                               goto err;
+                               }
+                       } else if (nparts >= 1) {
+                               /* 'REPLICA' signature detected */
+                               LOG(10, "REPLICA");
+
+                               int ret = util_parse_add_replica(&set);
+                               if (ret != 0)
+                                       goto err;
+
+                               nparts = 0;
+                               result = PARSER_CONTINUE;
+                       } else {
+                               if (set->nreplicas == 1)
+                                       result = PARSER_SET_NO_PARTS;
+                               else
+                                       result = PARSER_REP_NO_PARTS;
+                       }
+               } else {
+                       /* there could be no parts for remote replicas */
+                       if (set->replica[set->nreplicas - 1]->remote) {
+                               result = PARSER_REMOTE_REP_UNEXPECTED_PARTS;
+                               continue;
+                       }
+
+                       /* read size and path */
+                       result = parser_read_line(line, &psize, &ppath);
+                       if (result == PARSER_CONTINUE) {
+                               /* add a new pool's part to the list */
+                               int ret = util_parse_add_element(set,
+                                       ppath, psize);
+                               if (ret != 0) {
+                                       Free(ppath);
+                                       goto err;
+                               }
+                               nparts++;
+                       }
+               }
+       }
+
+       if (result != PARSER_FORMAT_OK) {
+               ERR("%s [%s:%d]", path, parser_errstr[result], nlines);
+               switch (result) {
+               case PARSER_CANNOT_READ_SIZE:
+               case PARSER_OUT_OF_MEMORY:
+                       /* do not overwrite errno */
+                       break;
+               default:
+                       errno = EINVAL;
+               }
+               goto err;
+       }
+
+       if (util_poolset_check_devdax(set) != 0) {
+               errno = EINVAL;
+               goto err;
+       }
+
+       if (util_poolset_directories_load(set) != 0) {
+               ERR("cannot load part files from directories");
+               goto err;
+       }
+
+       LOG(4, "set file format correct (%s)", path);
+       (void) os_fclose(fs);
+       Free(line);
+       util_poolset_check_options(set);
+       util_poolset_set_size(set);
+       *setp = set;
+       return 0;
+
+err:
+       oerrno = errno;
+       Free(line);
+       (void) os_fclose(fs);
+       if (set)
+               util_poolset_free(set);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_poolset_single -- (internal) create a one-part pool set
+ *
+ * On success returns a pointer to a newly allocated and initialized
+ * pool set structure.  Otherwise, NULL is returned.
+ */
+static struct pool_set *
+util_poolset_single(const char *path, size_t filesize, int create,
+       int ignore_sds)
+{
+       LOG(3, "path %s filesize %zu create %d",
+                       path, filesize, create);
+
+       enum file_type type = util_file_get_type(path);
+       if (type == OTHER_ERROR)
+               return NULL;
+
+       struct pool_set *set;
+       set = Zalloc(sizeof(struct pool_set) +
+                       sizeof(struct pool_replica *));
+       if (set == NULL) {
+               ERR("!Malloc for pool set");
+               return NULL;
+       }
+
+       set->path = Strdup(path);
+       if (set->path == NULL)  {
+               ERR("!Strdup");
+               Free(set);
+               return NULL;
+       }
+
+       struct pool_replica *rep;
+       rep = Zalloc(sizeof(struct pool_replica) +
+                       sizeof(struct pool_set_part));
+       if (rep == NULL) {
+               ERR("!Malloc for pool set replica");
+               Free(set->path);
+               Free(set);
+               return NULL;
+       }
+
+       VEC_INIT(&rep->directory);
+
+       set->replica[0] = rep;
+
+       rep->part[0].filesize = filesize;
+       rep->part[0].path = Strdup(path);
+       rep->part[0].fd = -1;   /* will be filled out by util_poolset_file() */
+       rep->part[0].is_dev_dax = type == TYPE_DEVDAX;
+       rep->part[0].created = create;
+       rep->part[0].hdr = NULL;
+       rep->part[0].addr = NULL;
+       rep->part[0].has_bad_blocks = 0;
+
+       if (rep->part[0].is_dev_dax)
+               rep->part[0].alignment = util_file_device_dax_alignment(path);
+       else
+               rep->part[0].alignment = Mmap_align;
+
+       ASSERTne(rep->part[0].alignment, 0);
+
+       rep->nallocated = 1;
+       rep->nparts = 1;
+       rep->nhdrs = 1;
+
+       /* it does not have a remote replica */
+       rep->remote = NULL;
+       set->remote = 0;
+
+       /* round down to the nearest mapping alignment boundary */
+       rep->repsize = rep->part[0].filesize & ~(rep->part[0].alignment - 1);
+       rep->resvsize = rep->repsize;
+
+       set->poolsize = rep->repsize;
+       set->resvsize = rep->resvsize;
+
+       set->nreplicas = 1;
+       set->ignore_sds = ignore_sds || (set->options & OPTION_NOHDRS);
+
+       return set;
+}
+
+/*
+ * util_part_open -- open or create a single part file
+ */
+int
+util_part_open(struct pool_set_part *part, size_t minsize, int create_part)
+{
+       LOG(3, "part %p minsize %zu create %d", part, minsize, create_part);
+
+       int exists = util_file_exists(part->path);
+       if (exists < 0)
+               return -1;
+
+       int create_file = create_part;
+
+       if (exists)
+               create_file = 0;
+
+       part->created = 0;
+       if (create_file) {
+               part->fd = util_file_create(part->path, part->filesize,
+                               minsize);
+               if (part->fd == -1) {
+                       LOG(2, "failed to create file: %s", part->path);
+                       return -1;
+               }
+               part->created = 1;
+       } else {
+               size_t size = 0;
+               int flags = O_RDWR;
+               part->fd = util_file_open(part->path, &size, minsize, flags);
+               if (part->fd == -1) {
+                       LOG(2, "failed to open file: %s", part->path);
+                       return -1;
+               }
+
+               if (Fallocate_at_create && create_part && !part->is_dev_dax) {
+                       int ret = os_posix_fallocate(part->fd, 0,
+                                       (os_off_t)size);
+                       if (ret != 0) {
+                               errno = ret;
+                               ERR("!posix_fallocate \"%s\", %zu", part->path,
+                                       size);
+                               return -1;
+                       }
+               }
+
+               /* check if filesize matches */
+               if (part->filesize != size) {
+                       ERR("file size does not match config: %s, %zu != %zu",
+                               part->path, size, part->filesize);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_part_fdclose -- close part file
+ */
+void
+util_part_fdclose(struct pool_set_part *part)
+{
+       LOG(3, "part %p", part);
+
+       if (part->fd != -1) {
+               (void) os_close(part->fd);
+               part->fd = -1;
+       }
+}
+
+/*
+ * util_set_rpmem_attr -- (internal) overwrite existing pool attributes
+ *
+ * does not set uuid, next_part_uuid, prev_part_uuid
+ */
+static void
+util_set_rpmem_attr(struct pool_hdr *hdrp, const struct rpmem_pool_attr *rattr)
+{
+       LOG(5, "hdrp %p rattr %p", hdrp, rattr);
+       memcpy(hdrp->signature, rattr->signature, POOL_HDR_SIG_LEN);
+       hdrp->major = rattr->major;
+       hdrp->features.compat = rattr->compat_features;
+       hdrp->features.incompat = rattr->incompat_features;
+       hdrp->features.ro_compat = rattr->ro_compat_features;
+       memcpy(hdrp->poolset_uuid, rattr->poolset_uuid, POOL_HDR_UUID_LEN);
+       memcpy(hdrp->next_repl_uuid, rattr->next_uuid, POOL_HDR_UUID_LEN);
+       memcpy(hdrp->prev_repl_uuid, rattr->prev_uuid, POOL_HDR_UUID_LEN);
+       memcpy(&hdrp->arch_flags, rattr->user_flags, sizeof(struct arch_flags));
+}
+
+/*
+ * util_get_rpmem_attr -- (internal) get attributes for remote replica header
+ */
+static void
+util_get_rpmem_attr(struct rpmem_pool_attr *rattr, const struct pool_hdr *hdrp)
+{
+       LOG(5, "rpmem_attr %p hdrp %p", rattr, hdrp);
+       ASSERTne(rattr, NULL);
+       memcpy(rattr->signature, hdrp->signature, POOL_HDR_SIG_LEN);
+       rattr->major = hdrp->major;
+       rattr->compat_features = hdrp->features.compat;
+       rattr->incompat_features = hdrp->features.incompat;
+       rattr->ro_compat_features = hdrp->features.ro_compat;
+       memcpy(rattr->poolset_uuid, hdrp->poolset_uuid, POOL_HDR_UUID_LEN);
+       memcpy(rattr->uuid, hdrp->uuid, POOL_HDR_UUID_LEN);
+       memcpy(rattr->next_uuid, hdrp->next_repl_uuid, POOL_HDR_UUID_LEN);
+       memcpy(rattr->prev_uuid, hdrp->prev_repl_uuid, POOL_HDR_UUID_LEN);
+       memcpy(rattr->user_flags, &hdrp->arch_flags, sizeof(struct arch_flags));
+}
+
+/*
+ * util_remote_store_attr -- (internal) store attributes read from remote
+ *                           replica in the local volatile pool header
+ */
+static void
+util_remote_store_attr(struct pool_hdr *hdrp,
+               const struct rpmem_pool_attr *rattr)
+{
+       LOG(4, "hdrp %p rpmem_attr %p", hdrp, rattr);
+
+       util_set_rpmem_attr(hdrp, rattr);
+       memcpy(hdrp->uuid, rattr->uuid, POOL_HDR_UUID_LEN);
+       memcpy(hdrp->next_part_uuid, rattr->uuid, POOL_HDR_UUID_LEN);
+       memcpy(hdrp->prev_part_uuid, rattr->uuid, POOL_HDR_UUID_LEN);
+}
+
+/*
+ * util_update_remote_header --  update attributes of a remote replica;
+ *                               the remote replica must be open
+ */
+int
+util_update_remote_header(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+
+       ASSERTne(REP(set, repn)->remote, NULL);
+       ASSERTne(REP(set, repn)->remote->rpp, NULL);
+
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_hdr *hdr = HDR(rep, 0);
+
+       /* get attributes from the local pool header */
+       struct rpmem_pool_attr attributes;
+       util_get_rpmem_attr(&attributes, hdr);
+
+       /* push the attributes to the remote replica */
+       RPMEMpool *rpp = rep->remote->rpp;
+       int ret = Rpmem_set_attr(rpp, &attributes);
+       if (ret) {
+               ERR("!Rpmem_set_attr");
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * util_pool_close_remote -- close a remote replica
+ */
+int
+util_pool_close_remote(RPMEMpool *rpp)
+{
+       LOG(3, "rpp %p", rpp);
+
+       return Rpmem_close(rpp);
+}
+
+/*
+ * util_poolset_remote_open -- open or create a remote replica
+ */
+int
+util_poolset_remote_open(struct pool_replica *rep, unsigned repidx,
+                       size_t minsize, int create, void *pool_addr,
+                       size_t pool_size, unsigned *nlanes)
+{
+       LOG(3, "rep %p repidx %u minsize %zu create %d "
+               "pool_addr %p pool_size %zu nlanes %p",
+               rep, repidx, minsize, create,
+               pool_addr, pool_size, nlanes);
+
+       ASSERTne(nlanes, NULL);
+
+       if (!Rpmem_handle_remote) {
+               return -1;
+       }
+
+       unsigned remote_nlanes = *nlanes;
+
+       if (create) {
+               struct rpmem_pool_attr rpmem_attr_create;
+               util_get_rpmem_attr(&rpmem_attr_create, rep->part[0].hdr);
+
+               rep->remote->rpp = Rpmem_create(rep->remote->node_addr,
+                                               rep->remote->pool_desc,
+                                               pool_addr,
+                                               pool_size,
+                                               &remote_nlanes,
+                                               &rpmem_attr_create);
+               if (rep->remote->rpp == NULL) {
+                       ERR("creating remote replica #%u failed", repidx);
+                       return -1;
+               }
+               rep->part[0].created = 1;
+       } else { /* open */
+               struct rpmem_pool_attr rpmem_attr_open;
+
+               rep->remote->rpp = Rpmem_open(rep->remote->node_addr,
+                                               rep->remote->pool_desc,
+                                               pool_addr,
+                                               pool_size,
+                                               &remote_nlanes,
+                                               &rpmem_attr_open);
+               if (rep->remote->rpp == NULL) {
+                       ERR("opening remote replica #%u failed", repidx);
+                       return -1;
+               }
+
+               util_remote_store_attr(rep->part[0].hdr, &rpmem_attr_open);
+       }
+
+       if (remote_nlanes < *nlanes)
+               *nlanes = remote_nlanes;
+
+       return 0;
+}
+
+/*
+ * util_poolset_files_local -- (internal) open or create all the local
+ *                              part files of a pool set and replica sets
+ */
+static int
+util_poolset_files_local(struct pool_set *set, size_t minpartsize, int create)
+{
+       LOG(3, "set %p minpartsize %zu create %d", set, minpartsize, create);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (!rep->remote) {
+                       for (unsigned p = 0; p < rep->nparts; p++) {
+                               if (util_part_open(&rep->part[p], minpartsize,
+                                               create))
+                                       return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_remote_replica_open -- open remote replica
+ */
+int
+util_poolset_remote_replica_open(struct pool_set *set, unsigned repidx,
+       size_t minsize, int create, unsigned *nlanes)
+{
+#ifndef _WIN32
+       /*
+        * This is a workaround for an issue with using device dax with
+        * libibverbs. To handle fork() function calls correctly libfabric use
+        * ibv_fork_init(3) which makes all registered memory being madvised
+        * with MADV_DONTFORK flag. In libpmemobj the remote replication is
+        * performed without pool header (first 4k). In such case the address
+        * passed to madvise(2) is aligned to 4k, but device dax can require
+        * different alignment (default is 2MB). This workaround madvises the
+        * entire memory region before registering it by fi_mr_reg(3).
+        *
+        * The librpmem client requires fork() support to work correctly.
+        */
+       if (set->replica[0]->part[0].is_dev_dax) {
+               int ret = os_madvise(set->replica[0]->part[0].addr,
+                               set->replica[0]->part[0].filesize,
+                               MADV_DONTFORK);
+               if (ret) {
+                       ERR("!madvise");
+                       return ret;
+               }
+       }
+#endif
+
+       void *pool_addr = (void *)((uintptr_t)set->replica[0]->part[0].addr);
+
+       return util_poolset_remote_open(set->replica[repidx], repidx, minsize,
+                       create, pool_addr, set->poolsize, nlanes);
+}
+
+/*
+ * util_poolset_files_remote -- (internal) open or create all the remote
+ *                              part files of a pool set and replica sets
+ */
+static int
+util_poolset_files_remote(struct pool_set *set, size_t minsize,
+                               unsigned *nlanes, int create)
+{
+       LOG(3, "set %p minsize %zu nlanes %p create %d",
+               set, minsize, nlanes, create);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote) {
+                       if (util_poolset_remote_replica_open(set, r,
+                               minsize, create, nlanes))
+                               return -1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_read -- read memory pool set file
+ *
+ * On success returns 0 and a pointer to a newly allocated structure
+ * containing the info of all the parts of the pool set and replicas.
+ */
+int
+util_poolset_read(struct pool_set **setp, const char *path)
+{
+       LOG(3, "setp %p path %s", setp, path);
+
+       int oerrno;
+       int ret = 0;
+       int fd;
+
+       if ((fd = os_open(path, O_RDONLY)) < 0) {
+               ERR("!open: path \"%s\"", path);
+               return -1;
+       }
+
+       ret = util_poolset_parse(setp, path, fd);
+
+       oerrno = errno;
+       (void) os_close(fd);
+       errno = oerrno;
+       return ret;
+}
+
+/*
+ * util_poolset_create_set -- create a new pool set structure
+ *
+ * On success returns 0 and a pointer to a newly allocated structure
+ * containing the info of all the parts of the pool set and replicas.
+ */
+int
+util_poolset_create_set(struct pool_set **setp, const char *path,
+       size_t poolsize, size_t minsize, int ignore_sds)
+{
+       LOG(3, "setp %p path %s poolsize %zu minsize %zu",
+               setp, path, poolsize, minsize);
+
+       int oerrno;
+       int ret = 0;
+       int fd;
+       size_t size = 0;
+
+       enum file_type type = util_file_get_type(path);
+       if (type == OTHER_ERROR)
+               return -1;
+
+       if (poolsize != 0) {
+               if (type == TYPE_DEVDAX) {
+                       ERR("size must be zero for device dax");
+                       return -1;
+               }
+               *setp = util_poolset_single(path, poolsize, 1, ignore_sds);
+               if (*setp == NULL)
+                       return -1;
+
+               return 0;
+       }
+
+       /* do not check minsize */
+       if ((fd = util_file_open(path, &size, 0, O_RDONLY)) == -1)
+               return -1;
+
+       char signature[POOLSET_HDR_SIG_LEN];
+       if (type == TYPE_NORMAL) {
+               /*
+                * read returns ssize_t, but we know it will return value
+                * between -1 and POOLSET_HDR_SIG_LEN (11), so we can safely
+                * cast it to int
+                */
+               ret = (int)read(fd, signature, POOLSET_HDR_SIG_LEN);
+               if (ret < 0) {
+                       ERR("!read %d", fd);
+                       goto err;
+               }
+       }
+
+       if (type == TYPE_DEVDAX || ret < POOLSET_HDR_SIG_LEN ||
+           strncmp(signature, POOLSET_HDR_SIG, POOLSET_HDR_SIG_LEN)) {
+               LOG(4, "not a pool set header");
+               (void) os_close(fd);
+
+               if (size < minsize) {
+                       ERR("file is not a poolset file and its size (%zu)"
+                               " is smaller than %zu", size, minsize);
+                       errno = EINVAL;
+                       return -1;
+               }
+               *setp = util_poolset_single(path, size, 0, ignore_sds);
+               if (*setp == NULL)
+                       return -1;
+
+               return 0;
+       }
+
+       ret = util_poolset_parse(setp, path, fd);
+       if (ret)
+               goto err;
+
+       (*setp)->ignore_sds = ignore_sds || ((*setp)->options & OPTION_NOHDRS);
+#ifdef _WIN32
+       /* remote replication is not supported on Windows */
+       if ((*setp)->remote) {
+               util_poolset_free(*setp);
+               ERR("remote replication is not supported on Windows");
+               errno = ENOTSUP;
+               ret = -1;
+               goto err;
+       }
+#endif /* _WIN32 */
+
+err:
+       oerrno = errno;
+       (void) os_close(fd);
+       errno = oerrno;
+       return ret;
+}
+
+/*
+ * util_poolset_check_header_options -- (internal) check if poolset options
+ *                                      match given flags
+ */
+static int
+util_poolset_check_header_options(struct pool_set *set, uint32_t incompat)
+{
+       LOG(3, "set %p, incompat %#x", set, incompat);
+
+       if (((set->options & OPTION_SINGLEHDR) == 0) !=
+                       ((incompat & POOL_FEAT_SINGLEHDR) == 0)) {
+               ERR(
+                       "poolset file options (%u) do not match incompat feature flags (%#x)",
+                       set->options, incompat);
+               errno = EINVAL;
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * util_header_create -- create header of a single pool set file
+ */
+int
+util_header_create(struct pool_set *set, unsigned repidx, unsigned partidx,
+       const struct pool_attr *attr, int overwrite)
+{
+       LOG(3, "set %p repidx %u partidx %u attr %p overwrite %d", set, repidx,
+               partidx, attr, overwrite);
+
+       ASSERTne(attr, NULL);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       /* opaque info lives at the beginning of mapped memory pool */
+       struct pool_hdr *hdrp = rep->part[partidx].hdr;
+
+       /* check if the pool header is all zeros */
+       if (!util_is_zeroed(hdrp, sizeof(*hdrp)) && !overwrite) {
+               ERR("Non-empty file detected");
+               errno = EEXIST;
+               return -1;
+       }
+
+       /* create pool's header */
+       util_pool_attr2hdr(hdrp, attr);
+
+       if (set->options & OPTION_SINGLEHDR)
+               hdrp->features.incompat |= POOL_FEAT_SINGLEHDR;
+
+       memcpy(hdrp->poolset_uuid, set->uuid, POOL_HDR_UUID_LEN);
+       memcpy(hdrp->uuid, PART(rep, partidx)->uuid, POOL_HDR_UUID_LEN);
+
+       /* link parts */
+       if (set->options & OPTION_SINGLEHDR) {
+               /* next/prev part point to part #0 */
+               ASSERTeq(partidx, 0);
+               memcpy(hdrp->prev_part_uuid, PART(rep, 0)->uuid,
+                                                       POOL_HDR_UUID_LEN);
+               memcpy(hdrp->next_part_uuid, PART(rep, 0)->uuid,
+                                                       POOL_HDR_UUID_LEN);
+       } else {
+               memcpy(hdrp->prev_part_uuid, PARTP(rep, partidx)->uuid,
+                                                       POOL_HDR_UUID_LEN);
+               memcpy(hdrp->next_part_uuid, PARTN(rep, partidx)->uuid,
+                                                       POOL_HDR_UUID_LEN);
+       }
+
+       /* link replicas */
+       if (!util_is_zeroed(attr->prev_repl_uuid, POOL_HDR_UUID_LEN)) {
+               memcpy(hdrp->prev_repl_uuid, attr->prev_repl_uuid,
+                               POOL_HDR_UUID_LEN);
+       } else {
+               memcpy(hdrp->prev_repl_uuid, PART(REPP(set, repidx), 0)->uuid,
+                       POOL_HDR_UUID_LEN);
+       }
+       if (!util_is_zeroed(attr->next_repl_uuid, POOL_HDR_UUID_LEN)) {
+               memcpy(hdrp->next_repl_uuid, attr->next_repl_uuid,
+                               POOL_HDR_UUID_LEN);
+       } else {
+               memcpy(hdrp->next_repl_uuid, PART(REPN(set, repidx), 0)->uuid,
+                       POOL_HDR_UUID_LEN);
+       }
+
+       if (!rep->remote) {
+               os_stat_t stbuf;
+
+               if (os_fstat(rep->part[partidx].fd, &stbuf) != 0) {
+                       ERR("!fstat");
+                       return -1;
+               }
+               ASSERT(stbuf.st_ctime);
+               hdrp->crtime = (uint64_t)stbuf.st_ctime;
+       }
+
+       int arch_is_zeroed = util_is_zeroed(attr->arch_flags,
+                       POOL_HDR_ARCH_LEN);
+       if (arch_is_zeroed)
+               util_get_arch_flags(&hdrp->arch_flags);
+
+       util_convert2le_hdr(hdrp);
+
+       if (!arch_is_zeroed) {
+               memcpy(&hdrp->arch_flags, attr->arch_flags, POOL_HDR_ARCH_LEN);
+       }
+
+       if (!set->ignore_sds && partidx == 0 && !rep->remote) {
+               shutdown_state_init(&hdrp->sds, rep);
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       if (shutdown_state_add_part(&hdrp->sds,
+                                       PART(rep, p)->fd, rep))
+                               return -1;
+               }
+               shutdown_state_set_dirty(&hdrp->sds, rep);
+       }
+
+       util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum,
+               1, POOL_HDR_CSUM_END_OFF(hdrp));
+
+       /* store pool's header */
+       util_persist_auto(rep->is_pmem, hdrp, sizeof(*hdrp));
+
+       return 0;
+}
+
+/*
+ * util_header_check -- (internal) validate header of a single pool set file
+ */
+static int
+util_header_check(struct pool_set *set, unsigned repidx, unsigned partidx,
+       const struct pool_attr *attr)
+{
+       LOG(3, "set %p repidx %u partidx %u attr %p", set, repidx, partidx,
+                       attr);
+
+       ASSERTne(attr, NULL);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       /* opaque info lives at the beginning of mapped memory pool */
+       struct pool_hdr *hdrp = rep->part[partidx].hdr;
+       struct pool_hdr hdr;
+
+       memcpy(&hdr, hdrp, sizeof(hdr));
+
+       /* local copy of a remote header does not need to be converted */
+       if (rep->remote == NULL)
+               util_convert2h_hdr_nocheck(&hdr);
+
+       /* to be valid, a header must have a major version of at least 1 */
+       if (hdr.major == 0) {
+               ERR("invalid major version (0)");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check signature */
+       if (memcmp(hdr.signature, attr->signature, POOL_HDR_SIG_LEN)) {
+               ERR("wrong pool type: \"%.8s\"", hdr.signature);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check format version number */
+       if (hdr.major != attr->major) {
+               ERR("pool version %d (library expects %d)", hdr.major,
+                               attr->major);
+               if (hdr.major < attr->major)
+                       ERR(
+                               "Please run the pmdk-convert utility to upgrade the pool.");
+               errno = EINVAL;
+               return -1;
+       }
+
+       rep->part[partidx].rdonly = 0;
+
+       int retval = util_feature_check(&hdr, attr->features);
+       if (retval < 0)
+               return -1;
+
+       if (retval == 0)
+               rep->part[partidx].rdonly = 1;
+
+       if (rep->remote == NULL) {
+               /*
+                * and to be valid, the fields must checksum correctly
+                *
+                * NOTE: checksum validation is performed after format version
+                * and feature check, because if POOL_FEAT_CKSUM_2K flag is set,
+                * we want to report it as incompatible feature, rather than
+                * invalid checksum.
+                */
+               if (!util_checksum(&hdr, sizeof(hdr), &hdr.checksum,
+                               0, POOL_HDR_CSUM_END_OFF(&hdr))) {
+                       ERR("invalid checksum of pool header");
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               LOG(3, "valid header, signature \"%.8s\"", hdr.signature);
+       }
+
+       if (util_check_arch_flags(&hdr.arch_flags)) {
+               ERR("wrong architecture flags");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check pool set UUID */
+       if (memcmp(HDR(REP(set, 0), 0)->poolset_uuid, hdr.poolset_uuid,
+                                               POOL_HDR_UUID_LEN)) {
+               ERR("wrong pool set UUID");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check pool set linkage */
+       if (memcmp(HDRP(rep, partidx)->uuid, hdr.prev_part_uuid,
+                                               POOL_HDR_UUID_LEN) ||
+           memcmp(HDRN(rep, partidx)->uuid, hdr.next_part_uuid,
+                                               POOL_HDR_UUID_LEN)) {
+               ERR("wrong part UUID");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check format version */
+       if (HDR(rep, 0)->major != hdrp->major) {
+               ERR("incompatible pool format");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check compatibility features */
+       if (HDR(rep, 0)->features.compat != hdrp->features.compat ||
+           HDR(rep, 0)->features.incompat != hdrp->features.incompat ||
+           HDR(rep, 0)->features.ro_compat != hdrp->features.ro_compat) {
+               ERR("incompatible feature flags");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check poolset options */
+       if (util_poolset_check_header_options(set,
+                       HDR(rep, 0)->features.incompat))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * util_header_check_remote -- (internal) validate header of a remote
+ *                             pool set file
+ */
+static int
+util_header_check_remote(struct pool_set *set, unsigned partidx)
+{
+       LOG(3, "set %p partidx %u ", set, partidx);
+
+       /* there is only one replica in remote poolset */
+       struct pool_replica *rep = set->replica[0];
+       /* opaque info lives at the beginning of mapped memory pool */
+       struct pool_hdr *hdrp = rep->part[partidx].hdr;
+       struct pool_hdr hdr;
+
+       if (util_is_zeroed(hdrp, sizeof(*hdrp))) {
+               ERR("pool header zeroed");
+               errno = EINVAL;
+               return -1;
+       }
+
+       memcpy(&hdr, hdrp, sizeof(hdr));
+
+       util_convert2h_hdr_nocheck(&hdr);
+
+       /* valid header found */
+       if (memcmp(HDR(rep, 0)->signature, hdrp->signature, POOL_HDR_SIG_LEN)) {
+               ERR("pool signature mismatch in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check format version */
+       if (HDR(rep, 0)->major != hdrp->major) {
+               ERR("pool version mismatch in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check compatibility features */
+       if (HDR(rep, 0)->features.compat != hdrp->features.compat) {
+               ERR("'may have' compatibility flags mismatch in part %d",
+                                                               partidx);
+               errno = EINVAL;
+               return -1;
+       }
+       if (HDR(rep, 0)->features.incompat != hdrp->features.incompat) {
+               ERR("'must support' compatibility flags mismatch in part %d",
+                                                               partidx);
+               errno = EINVAL;
+               return -1;
+       }
+       if (HDR(rep, 0)->features.ro_compat != hdrp->features.ro_compat) {
+               ERR("'force read-only' compatibility flags mismatch in part %d",
+                                                               partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * and to be valid, the fields must checksum correctly
+        *
+        * NOTE: checksum validation is performed after format version and
+        * feature check, because if POOL_FEAT_CKSUM_2K flag is set,
+        * we want to report it as incompatible feature, rather than invalid
+        * checksum.
+        */
+       if (!util_checksum(&hdr, sizeof(hdr), &hdr.checksum,
+                       0, POOL_HDR_CSUM_END_OFF(&hdr))) {
+               ERR("invalid checksum of pool header");
+               return -1;
+       }
+
+       LOG(3, "valid header, signature \"%.8s\"", hdr.signature);
+
+       /* check pool set UUID */
+       if (memcmp(HDR(rep, 0)->poolset_uuid, hdrp->poolset_uuid,
+                                                       POOL_HDR_UUID_LEN)) {
+               ERR("wrong pool set UUID in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check previous replica UUID */
+       if (memcmp(HDR(rep, 0)->prev_repl_uuid, hdrp->prev_repl_uuid,
+                                                       POOL_HDR_UUID_LEN)) {
+               ERR("wrong previous replica UUID in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check next replica UUID */
+       if (memcmp(HDR(rep, 0)->next_repl_uuid, hdrp->next_repl_uuid,
+                                               POOL_HDR_UUID_LEN)) {
+               ERR("wrong next replica UUID in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (memcmp(&HDR(rep, 0)->arch_flags, &hdrp->arch_flags,
+                                               sizeof(hdrp->arch_flags))) {
+               ERR("wrong architecture flags");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* check pool set linkage */
+       if (memcmp(HDRP(rep, partidx)->uuid, hdrp->prev_part_uuid,
+                                                       POOL_HDR_UUID_LEN) ||
+           memcmp(HDRN(rep, partidx)->uuid, hdrp->next_part_uuid,
+                                                       POOL_HDR_UUID_LEN)) {
+               ERR("wrong part UUID in part %d", partidx);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /* read shutdown state toggle from header */
+       set->ignore_sds |= IGNORE_SDS(HDR(rep, 0));
+
+       if (!set->ignore_sds && partidx == 0) {
+               struct shutdown_state sds;
+               shutdown_state_init(&sds, NULL);
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       if (shutdown_state_add_part(&sds,
+                                       PART(rep, p)->fd, NULL))
+                               return -1;
+               }
+
+               if (shutdown_state_check(&sds, &hdrp->sds, rep)) {
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               shutdown_state_set_dirty(&hdrp->sds, rep);
+       }
+
+       rep->part[partidx].rdonly = 0;
+
+       return 0;
+}
+
+/*
+ * util_replica_set_is_pmem -- sets per-replica is_pmem flag
+ *
+ * The replica is PMEM if:
+ * - all parts are on device dax, or
+ * - all parts are mapped with MAP_SYNC.
+ *
+ * It's enough to check only first part because it's already verified
+ * that either all or none parts are device dax or mapped with MAP_SYNC.
+ */
+static inline void
+util_replica_set_is_pmem(struct pool_replica *rep)
+{
+       rep->is_pmem = rep->part[0].is_dev_dax || rep->part[0].map_sync ||
+               pmem_is_pmem(rep->part[0].addr, rep->resvsize);
+}
+
+/*
+ * util_replica_map_local -- (internal) map memory pool for local replica
+ */
+static int
+util_replica_map_local(struct pool_set *set, unsigned repidx, int flags)
+{
+       LOG(3, "set %p repidx %u flags %d", set, repidx, flags);
+
+       /*
+        * XXX: Like we reserve space for all parts in this replica when we map
+        * the first part, we need to reserve the space for all replicas
+        * upfront.  It is not necessary that the replicas are contiguous but
+        * that way we would not fragment the memory much.  I think we should
+        * leave this to MM, but let's have a note as per our collective minds.
+        */
+
+#ifndef _WIN32
+       int remaining_retries = 0;
+#else
+       int remaining_retries = 10;
+#endif
+       int retry_for_contiguous_addr;
+       size_t mapsize;
+       /* header size for all headers but the first one */
+       size_t hdrsize = (set->options & (OPTION_SINGLEHDR | OPTION_NOHDRS)) ?
+                       0 : Mmap_align;
+       void *addr;
+       struct pool_replica *rep = set->replica[repidx];
+
+       ASSERTeq(rep->remote, NULL);
+       ASSERTne(rep->part, NULL);
+
+       do {
+               retry_for_contiguous_addr = 0;
+               mapsize = rep->part[0].filesize & ~(Mmap_align - 1);
+
+               /* determine a hint address for mmap() */
+               addr = util_map_hint(rep->resvsize, 0);
+               if (addr == MAP_FAILED) {
+                       LOG(1, "cannot find a contiguous region of given size");
+                       return -1;
+               }
+
+               /* map the first part and reserve space for remaining parts */
+               if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
+                               flags, 0) != 0) {
+                       LOG(2, "pool mapping failed - replica #%u part #0",
+                               repidx);
+                       return -1;
+               }
+
+               VALGRIND_REGISTER_PMEM_MAPPING(rep->part[0].addr,
+                               rep->part[0].size);
+               VALGRIND_REGISTER_PMEM_FILE(rep->part[0].fd,
+                               rep->part[0].addr, rep->part[0].size, 0);
+
+               set->zeroed &= rep->part[0].created;
+
+               addr = (char *)rep->part[0].addr + mapsize;
+
+               /*
+                * map the remaining parts of the usable pool space
+                * (aligned to memory mapping granularity)
+                */
+               for (unsigned p = 1; p < rep->nparts; p++) {
+                       /* map data part */
+                       if (util_map_part(&rep->part[p], addr, 0, hdrsize,
+                                       flags | MAP_FIXED, 0) != 0) {
+                               /*
+                                * if we can't map the part at the address we
+                                * asked for, unmap all the parts that are
+                                * mapped and remap at a different address.
+                                */
+                               if ((errno == EINVAL) &&
+                                   (remaining_retries > 0)) {
+                                       LOG(2, "usable space mapping failed - "
+                                               "part #%d - retrying", p);
+                                       retry_for_contiguous_addr = 1;
+                                       remaining_retries--;
+
+                                       util_unmap_parts(rep, 0, p - 1);
+
+                                       /* release rest of the VA reserved */
+                                       ASSERTne(addr, NULL);
+                                       ASSERTne(addr, MAP_FAILED);
+                                       munmap(addr, rep->resvsize - mapsize);
+                                       break;
+                               }
+                               LOG(2, "usable space mapping failed - part #%d",
+                                       p);
+                               goto err;
+                       }
+
+                       VALGRIND_REGISTER_PMEM_FILE(rep->part[p].fd,
+                               rep->part[p].addr, rep->part[p].size,
+                               hdrsize);
+
+                       mapsize += rep->part[p].size;
+                       set->zeroed &= rep->part[p].created;
+                       addr = (char *)addr + rep->part[p].size;
+               }
+       } while (retry_for_contiguous_addr);
+
+       /*
+        * Initially part[0].size is the size of address space
+        * reservation for all parts from given replica. After
+        * mapping that space we need to overwrite part[0].size
+        * with its actual size to be consistent - size for each
+        * part should be the actual mapping size of this part
+        * only - it simplifies future calculations.
+        */
+       rep->part[0].size = rep->part[0].filesize & ~(Mmap_align - 1);
+
+       if (util_replica_check_map_sync(set, repidx, 0))
+               goto err;
+
+       util_replica_set_is_pmem(rep);
+
+       if (Prefault_at_create)
+               util_replica_force_page_allocation(rep);
+
+       ASSERTeq(mapsize, rep->repsize);
+
+       LOG(3, "replica #%u addr %p", repidx, rep->part[0].addr);
+
+       return 0;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (mapsize < rep->repsize) {
+               ASSERTne(rep->part[0].addr, NULL);
+               ASSERTne(rep->part[0].addr, MAP_FAILED);
+               munmap(rep->part[0].addr, rep->resvsize - mapsize);
+       }
+       for (unsigned p = 0; p < rep->nparts; p++) {
+               util_unmap_part(&rep->part[p]);
+       }
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_replica_init_headers_local -- (internal) initialize pool headers
+ */
+static int
+util_replica_init_headers_local(struct pool_set *set, unsigned repidx,
+       int flags, const struct pool_attr *attr)
+{
+       LOG(3, "set %p repidx %u flags %d attr %p", set, repidx, flags, attr);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       /* map all headers - don't care about the address */
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
+                       LOG(2, "header mapping failed - part #%d", p);
+                       goto err;
+               }
+       }
+
+       /* create headers, set UUID's */
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               if (util_header_create(set, repidx, p, attr, 0) != 0) {
+                       LOG(2, "header creation failed - part #%d", p);
+                       goto err;
+               }
+       }
+
+       /* unmap all headers */
+       for (unsigned p = 0; p < rep->nhdrs; p++)
+               util_unmap_hdr(&rep->part[p]);
+
+       return 0;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               util_unmap_hdr(&rep->part[p]);
+       }
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_replica_create_local -- (internal) create a new memory pool for local
+ * replica
+ */
+static int
+util_replica_create_local(struct pool_set *set, unsigned repidx, int flags,
+       const struct pool_attr *attr)
+{
+       LOG(3, "set %p repidx %u flags %d attr %p", set, repidx, flags, attr);
+
+       /*
+        * the first replica has to be mapped prior to remote ones so if
+        * a replica is already mapped skip mapping creation
+        */
+       if (PART(REP(set, repidx), 0)->addr == NULL) {
+               if (util_replica_map_local(set, repidx, flags) != 0) {
+                       LOG(2, "replica #%u map failed", repidx);
+                       return -1;
+               }
+       }
+
+       if (attr == NULL)
+               return 0;
+
+       if (util_replica_init_headers_local(set, repidx, flags, attr) != 0) {
+               LOG(2, "replica #%u headers initialization failed", repidx);
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * util_replica_create_remote -- (internal) create a new memory pool
+ *                               for remote replica
+ */
+static int
+util_replica_create_remote(struct pool_set *set, unsigned repidx, int flags,
+       const struct pool_attr *attr)
+{
+       LOG(3, "set %p repidx %u flags %d attr %p", set, repidx, flags, attr);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       ASSERTne(rep->remote, NULL);
+       ASSERTne(rep->part, NULL);
+       ASSERTeq(rep->nparts, 1);
+       ASSERTeq(rep->nhdrs, 1);
+       ASSERTne(attr, NULL);
+
+       struct pool_set_part *part = rep->part;
+
+       /*
+        * A remote replica has one fake part of size equal twice pool header
+        * size for storing pool header and pool descriptor.
+        */
+       part->size = rep->repsize;
+       ASSERT(IS_PAGE_ALIGNED(part->size));
+       part->remote_hdr = Zalloc(part->size + Pagesize);
+       if (!part->remote_hdr) {
+               ERR("!Zalloc");
+               return -1;
+       }
+
+       part->hdr = PAGE_ALIGN_UP(part->remote_hdr);
+       part->addr = PAGE_ALIGN_UP(part->remote_hdr);
+       part->hdrsize = POOL_HDR_SIZE;
+
+       /* create header, set UUID's */
+       if (util_header_create(set, repidx, 0, attr, 0) != 0) {
+               LOG(2, "header creation failed - part #0");
+               Free(part->remote_hdr);
+               return -1;
+       }
+
+       LOG(3, "replica #%u addr %p", repidx, rep->part[0].addr);
+
+       return 0;
+}
+
+/*
+ * util_replica_close -- close a memory pool replica
+ *
+ * This function unmaps all mapped memory regions.
+ */
+int
+util_replica_close(struct pool_set *set, unsigned repidx)
+{
+       LOG(3, "set %p repidx %u", set, repidx);
+       struct pool_replica *rep = set->replica[repidx];
+
+       if (rep->remote == NULL) {
+               struct pool_set_part *part = PART(rep, 0);
+               if (!set->ignore_sds && part->addr != NULL &&
+                               part->size != 0) {
+                       struct pool_hdr *hdr = part->addr;
+                       RANGE_RW(hdr, sizeof(*hdr), part->is_dev_dax);
+                       /*
+                        * deep drain will call msync on one page in each
+                        * part in replica to trigger WPQ flush.
+                        * This pages may have been marked as
+                        * undefined/inaccessible, but msyncing such memory
+                        * is not a bug, so as a workaround temporarily
+                        * disable error reporting.
+                        */
+                       VALGRIND_DO_DISABLE_ERROR_REPORTING;
+                       util_replica_deep_drain(part->addr, rep->repsize,
+                               set, repidx);
+                       VALGRIND_DO_ENABLE_ERROR_REPORTING;
+                       shutdown_state_clear_dirty(&hdr->sds, rep);
+               }
+               for (unsigned p = 0; p < rep->nhdrs; p++)
+                       util_unmap_hdr(&rep->part[p]);
+
+               rep->part[0].size = rep->resvsize;
+               util_unmap_part(&rep->part[0]);
+       } else {
+               LOG(4, "freeing volatile header of remote replica #%u", repidx);
+               Free(rep->part[0].remote_hdr);
+               rep->part[0].remote_hdr = NULL;
+               rep->part[0].hdr = NULL;
+               rep->part[0].hdrsize = 0;
+               rep->part[0].addr = NULL;
+               rep->part[0].size = 0;
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_append_new_part -- (internal) creates a new part in each replica
+ *     of the poolset
+ */
+static int
+util_poolset_append_new_part(struct pool_set *set, size_t size)
+{
+       LOG(3, "set %p size %zu", set, size);
+
+       if (!set->directory_based)
+               return -1;
+
+       struct pool_set_directory *d;
+       size_t directory_id;
+       char *path;
+       size_t path_len;
+
+       unsigned r;
+       for (r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+
+               directory_id = set->next_directory_id %
+                       VEC_SIZE(&rep->directory);
+               d = VEC_GET(&rep->directory, directory_id);
+
+               path_len = strlen(d->path) + PMEM_FILE_MAX_LEN;
+               if ((path = Malloc(path_len)) == NULL) {
+                       ERR("!Malloc");
+                       goto err_part_init;
+               }
+
+               snprintf(path, path_len, "%s" OS_DIR_SEP_STR "%0*u%s",
+                       d->path, PMEM_FILE_PADDING, set->next_id, PMEM_EXT);
+
+               if (util_replica_add_part(&set->replica[r], path, size) != 0)
+                       FATAL("cannot add a new part to the replica info");
+       }
+
+       set->next_directory_id += 1;
+       set->next_id += 1;
+
+       util_poolset_set_size(set);
+
+       return 0;
+
+err_part_init:
+       /* for each replica 0..r-1 remove the last part */
+       for (unsigned rn = 0; rn < r; ++rn) {
+               struct pool_replica *rep = set->replica[rn];
+               unsigned pidx = rep->nparts - 1;
+               Free((void *)(rep->part[pidx].path));
+               rep->part[pidx].path = NULL;
+               rep->nparts--;
+       }
+
+       return -1;
+}
+
+/*
+ * util_pool_extend -- extends the poolset by the provided size
+ */
+void *
+util_pool_extend(struct pool_set *set, size_t *size, size_t minpartsize)
+{
+       LOG(3, "set %p size %zu minpartsize %zu", set, *size, minpartsize);
+
+       if (*size == 0) {
+               ERR("cannot extend pool by 0 bytes");
+               return NULL;
+       }
+
+       if ((set->options & OPTION_SINGLEHDR) == 0) {
+               ERR(
+               "extending the pool by appending parts with headers is not supported!");
+               return NULL;
+       }
+
+       if (set->poolsize + *size > set->resvsize) {
+               *size = set->resvsize - set->poolsize;
+               if (*size < minpartsize) {
+                       ERR("exceeded reservation size");
+                       return NULL;
+               }
+               LOG(4, "extend size adjusted to not exceed reservation size");
+       }
+
+       size_t old_poolsize = set->poolsize;
+
+       if (util_poolset_append_new_part(set, *size) != 0) {
+               ERR("unable to append a new part to the pool");
+               return NULL;
+       }
+
+       size_t hdrsize = (set->options & OPTION_SINGLEHDR) ? 0 : Mmap_align;
+       void *addr = NULL;
+       void *addr_base = NULL;
+
+       unsigned r;
+       for (r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               unsigned pidx = rep->nparts - 1;
+               struct pool_set_part *p = &rep->part[pidx];
+
+               if (util_part_open(p, 0, 1 /* create */) != 0) {
+                       ERR("cannot open the new part");
+                       goto err;
+               }
+
+               addr = (char *)rep->part[0].addr + old_poolsize;
+               if (addr_base == NULL)
+                       addr_base = addr;
+
+               if (util_map_part(p, addr, 0, hdrsize,
+                               MAP_SHARED | MAP_FIXED, 0) != 0) {
+                       ERR("cannot map the new part");
+                       goto err;
+               }
+
+               /*
+                * new part must be mapped the same way as all the rest
+                * within a replica
+                */
+               if (p->map_sync != rep->part[0].map_sync) {
+                       if (p->map_sync)
+                               ERR("new part cannot be mapped with MAP_SYNC");
+                       else
+                               ERR("new part mapped with MAP_SYNC");
+                       goto err;
+               }
+       }
+
+       /* XXX: mode should be the same as for pmemxxx_create() */
+       if (util_poolset_chmod(set, S_IWUSR | S_IRUSR))
+               goto err;
+
+       util_poolset_fdclose(set);
+
+       return addr_base;
+
+err:
+       for (unsigned rn = 0; rn <= r; ++rn) {
+               struct pool_replica *rep = set->replica[r];
+               unsigned pidx = rep->nparts - 1;
+               struct pool_set_part *p = &rep->part[pidx];
+               rep->nparts--;
+
+               if (p->fd != 0)
+                       (void) os_close(p->fd);
+               if (p->created)
+                       os_unlink(p->path);
+               Free((void *)p->path);
+               p->path = NULL;
+       }
+       util_poolset_set_size(set);
+
+       return NULL;
+}
+
+/*
+ * util_print_bad_files_cb -- (internal) callback printing names of pool files
+ *                            containing bad blocks
+ */
+static int
+util_print_bad_files_cb(struct part_file *pf, void *arg)
+{
+       if (!pf->is_remote && pf->part && pf->part->has_bad_blocks)
+               ERR("file contains bad blocks -- '%s'", pf->part->path);
+
+       return 0;
+}
+
+/*
+ * util_pool_create_uuids -- create a new memory pool (set or a single file)
+ *                           with given uuids
+ *
+ * On success returns 0 and a pointer to a newly allocated structure
+ * containing the info of all the parts of the pool set and replicas.
+ */
+int
+util_pool_create_uuids(struct pool_set **setp, const char *path,
+       size_t poolsize, size_t minsize, size_t minpartsize,
+       const struct pool_attr *attr, unsigned *nlanes, int can_have_rep,
+       int remote)
+{
+       LOG(3, "setp %p path %s poolsize %zu minsize %zu minpartsize %zu "
+               "pattr %p nlanes %p can_have_rep %i remote %i", setp, path,
+               poolsize, minsize, minpartsize, attr, nlanes, can_have_rep,
+               remote);
+
+       /* attributes cannot be NULL for local replicas */
+       ASSERT(remote || attr != NULL);
+
+       int flags = MAP_SHARED;
+       int oerrno;
+
+       int exists = util_file_exists(path);
+       if (exists < 0)
+               return -1;
+
+       /* check if file exists */
+       if (poolsize > 0 && exists) {
+               ERR("file %s already exists", path);
+               errno = EEXIST;
+               return -1;
+       }
+
+       int ret = util_poolset_create_set(setp, path, poolsize, minsize,
+                       IGNORE_SDS(attr));
+       if (ret < 0) {
+               LOG(2, "cannot create pool set -- '%s'", path);
+               return -1;
+       }
+
+       struct pool_set *set = *setp;
+
+       ASSERT(set->nreplicas > 0);
+
+       if (!remote && (set->options & OPTION_NOHDRS)) {
+               ERR(
+                       "the NOHDRS poolset option is not supported for local poolsets");
+               errno = EINVAL;
+               goto err_poolset_free;
+       }
+
+       if ((attr == NULL) != ((set->options & OPTION_NOHDRS) != 0)) {
+               ERR(
+                       "pool attributes are not supported for poolsets without headers (with the NOHDRS option)");
+               errno = EINVAL;
+               goto err_poolset_free;
+       }
+
+       if (set->directory_based && ((set->options & OPTION_SINGLEHDR) == 0)) {
+               ERR(
+                       "directory based pools are not supported for poolsets with headers (without SINGLEHDR option)");
+               errno = EINVAL;
+               goto err_poolset_free;
+       }
+
+       if (set->resvsize < minsize) {
+               ERR("reservation pool size %zu smaller than %zu",
+                       set->resvsize, minsize);
+               errno = EINVAL;
+               goto err_poolset_free;
+       }
+
+       if (set->directory_based && set->poolsize == 0 &&
+                       util_poolset_append_new_part(set, minsize) != 0) {
+               ERR("cannot create a new part in provided directories");
+               goto err_poolset_free;
+       }
+
+       if (attr != NULL &&
+           (attr->features.compat & POOL_FEAT_CHECK_BAD_BLOCKS)) {
+               int bbs = badblocks_check_poolset(set, 1 /* create */);
+               if (bbs < 0) {
+                       LOG(1,
+                               "failed to check pool set for bad blocks -- '%s'",
+                               path);
+                       goto err_poolset_free;
+               }
+
+               if (bbs > 0) {
+                       util_poolset_foreach_part_struct(set,
+                                                       util_print_bad_files_cb,
+                                                       NULL);
+                       ERR(
+                               "pool set contains bad blocks and cannot be created, run 'pmempool create --clear-bad-blocks' utility to clear bad blocks and create a pool");
+                       errno = EIO;
+                       goto err_poolset_free;
+               }
+       }
+
+       if (set->poolsize < minsize) {
+               ERR("net pool size %zu smaller than %zu",
+                       set->poolsize, minsize);
+               errno = EINVAL;
+               goto err_poolset_free;
+       }
+
+       if (remote) {
+               /* it is a remote replica - it cannot have replicas */
+               if (set->nreplicas > 1) {
+                       LOG(2, "remote pool set cannot have replicas");
+                       errno = EINVAL;
+                       goto err_poolset_free;
+               }
+
+               /* check if poolset options match remote pool attributes */
+               if (attr != NULL &&
+                               ((set->options & OPTION_SINGLEHDR) == 0) !=
+                               ((attr->features.incompat &
+                                               POOL_FEAT_SINGLEHDR) == 0)) {
+                       ERR(
+                               "pool incompat feature flags and remote poolset options do not match");
+                       errno = EINVAL;
+                       goto err_poolset_free;
+               }
+       }
+
+       if (!can_have_rep && set->nreplicas > 1) {
+               ERR("replication not supported");
+               errno = ENOTSUP;
+               goto err_poolset_free;
+       }
+
+       if (set->remote && util_remote_load()) {
+               ERR(
+                       "the pool set requires a remote replica, but the '%s' library cannot be loaded",
+                       LIBRARY_REMOTE);
+               goto err_poolset_free;
+       }
+
+       set->zeroed = 1;
+
+       if (attr != NULL) {
+               if (!util_is_zeroed(attr->poolset_uuid, POOL_HDR_UUID_LEN)) {
+                       memcpy(set->uuid, attr->poolset_uuid,
+                                       POOL_HDR_UUID_LEN);
+               } else {
+                       /* generate pool set UUID */
+                       ret = util_uuid_generate(set->uuid);
+                       if (ret < 0) {
+                               LOG(2, "cannot generate pool set UUID");
+                               goto err_poolset;
+                       }
+               }
+
+               /* generate UUID's for all the parts */
+               for (unsigned r = 0; r < set->nreplicas; r++) {
+                       struct pool_replica *rep = set->replica[r];
+                       for (unsigned i = 0; i < rep->nhdrs; i++) {
+                               ret = util_uuid_generate(rep->part[i].uuid);
+                               if (ret < 0) {
+                                       LOG(2,
+                                       "cannot generate pool set part UUID");
+                                       goto err_poolset;
+                               }
+                       }
+               }
+
+               /* overwrite UUID of the first part if given */
+               if (!util_is_zeroed(attr->first_part_uuid, POOL_HDR_UUID_LEN)) {
+                       memcpy(set->replica[0]->part[0].uuid,
+                               attr->first_part_uuid, POOL_HDR_UUID_LEN);
+               }
+       }
+
+       ret = util_poolset_files_local(set, minpartsize, 1);
+       if (ret != 0)
+               goto err_poolset;
+
+       /* map first local replica - it has to exist prior to remote ones */
+       ret = util_replica_map_local(set, 0, flags);
+       if (ret != 0)
+               goto err_poolset;
+
+       /* prepare remote replicas first */
+       if (set->remote) {
+               for (unsigned r = 0; r < set->nreplicas; r++) {
+                       if (REP(set, r)->remote == NULL) {
+                               continue;
+                       }
+                       if (util_replica_create_remote(set, r, flags, attr) !=
+                                       0) {
+                               LOG(2, "replica #%u creation failed", r);
+                               goto err_create;
+                       }
+               }
+
+               ret = util_poolset_files_remote(set, minsize, nlanes,
+                               1 /* create */);
+               if (ret != 0)
+                       goto err_create;
+       }
+
+       /* prepare local replicas */
+       if (remote) {
+               if (util_replica_create_local(set, 0, flags, attr) != 0) {
+                       LOG(2, "replica #0 creation failed");
+                       goto err_create;
+               }
+       } else {
+               for (unsigned r = 0; r < set->nreplicas; r++) {
+                       if (REP(set, r)->remote != NULL) {
+                               continue;
+                       }
+                       if (util_replica_create_local(set, r, flags, attr) !=
+                                       0) {
+                               LOG(2, "replica #%u creation failed", r);
+                               goto err_create;
+                       }
+               }
+       }
+
+       return 0;
+
+err_create:
+       oerrno = errno;
+       for (unsigned r = 0; r < set->nreplicas; r++)
+               util_replica_close(set, r);
+       errno = oerrno;
+err_poolset:
+       oerrno = errno;
+       util_poolset_close(set, DELETE_CREATED_PARTS);
+       errno = oerrno;
+       return -1;
+
+err_poolset_free:
+       oerrno = errno;
+       util_poolset_free(set);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_pool_create -- create a new memory pool (set or a single file)
+ *
+ * On success returns 0 and a pointer to a newly allocated structure
+ * containing the info of all the parts of the pool set and replicas.
+ */
+int
+util_pool_create(struct pool_set **setp, const char *path, size_t poolsize,
+       size_t minsize, size_t minpartsize, const struct pool_attr *attr,
+       unsigned *nlanes, int can_have_rep)
+{
+       LOG(3, "setp %p path %s poolsize %zu minsize %zu minpartsize %zu "
+               "attr %p nlanes %p can_have_rep %i", setp, path, poolsize,
+               minsize, minpartsize, attr, nlanes, can_have_rep);
+
+       return util_pool_create_uuids(setp, path, poolsize, minsize,
+                       minpartsize, attr, nlanes, can_have_rep, POOL_LOCAL);
+}
+
+/*
+ * util_replica_open_local -- (internal) open a memory pool local replica
+ */
+static int
+util_replica_open_local(struct pool_set *set, unsigned repidx, int flags)
+{
+       LOG(3, "set %p repidx %u flags %d", set, repidx, flags);
+
+       int remaining_retries = 10;
+       int retry_for_contiguous_addr;
+       size_t mapsize;
+       size_t hdrsize = (set->options & (OPTION_SINGLEHDR | OPTION_NOHDRS)) ?
+                       0 : Mmap_align;
+       struct pool_replica *rep = set->replica[repidx];
+       void *addr = NULL;
+
+       do {
+               retry_for_contiguous_addr = 0;
+
+               /* determine a hint address for mmap() if not specified */
+               if (addr == NULL)
+                       addr = util_map_hint(rep->resvsize, 0);
+               if (addr == MAP_FAILED) {
+                       LOG(1, "cannot find a contiguous region of given size");
+                       return -1;
+               }
+
+               mapsize = rep->part[0].filesize & ~(Mmap_align - 1);
+
+               /* map the first part and reserve space for remaining parts */
+               if (util_map_part(&rep->part[0], addr, rep->resvsize, 0,
+                               flags, 0) != 0) {
+                       LOG(2, "pool mapping failed - replica #%u part #0",
+                               repidx);
+                       return -1;
+               }
+
+               VALGRIND_REGISTER_PMEM_MAPPING(rep->part[0].addr,
+                       rep->resvsize);
+               VALGRIND_REGISTER_PMEM_FILE(rep->part[0].fd,
+                       rep->part[0].addr, rep->resvsize, 0);
+
+               /* map all headers - don't care about the address */
+               for (unsigned p = 0; p < rep->nhdrs; p++) {
+                       if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
+                               LOG(2, "header mapping failed - part #%d", p);
+                               goto err;
+                       }
+               }
+
+               addr = (char *)rep->part[0].addr + mapsize;
+
+               /*
+                * map the remaining parts of the usable pool space
+                * (aligned to memory mapping granularity)
+                */
+               for (unsigned p = 1; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+                       size_t targetsize = mapsize +
+                               ALIGN_DOWN(part->filesize - hdrsize,
+                               part->alignment);
+                       if (targetsize > rep->resvsize) {
+                               ERR(
+                                       "pool mapping failed - address space reservation too small");
+                               errno = EINVAL;
+                               goto err;
+                       }
+
+                       /* map data part */
+                       if (util_map_part(part, addr, 0, hdrsize,
+                                       flags | MAP_FIXED, 0) != 0) {
+                               /*
+                                * if we can't map the part at the address we
+                                * asked for, unmap all the parts that are
+                                * mapped and remap at a different address.
+                                */
+                               if ((errno == EINVAL) &&
+                                   (remaining_retries > 0)) {
+                                       LOG(2, "usable space mapping failed - "
+                                               "part #%d - retrying", p);
+                                       retry_for_contiguous_addr = 1;
+                                       remaining_retries--;
+
+                                       util_unmap_parts(rep, 0, p - 1);
+
+                                       /* release rest of the VA reserved */
+                                       munmap(rep->part[0].addr,
+                                               rep->resvsize);
+                                       break;
+                               }
+                               LOG(2, "usable space mapping failed - part #%d",
+                                       p);
+                               goto err;
+                       }
+
+                       VALGRIND_REGISTER_PMEM_FILE(part->fd,
+                               part->addr, part->size, hdrsize);
+
+                       mapsize += part->size;
+                       addr = (char *)addr + part->size;
+               }
+       } while (retry_for_contiguous_addr);
+
+       /*
+        * Initially part[0].size is the size of address space
+        * reservation for all parts from given replica. After
+        * mapping that space we need to overwrite part[0].size
+        * with its actual size to be consistent - size for each
+        * part should be the actual mapping size of this part
+        * only - it simplifies future calculations.
+        */
+       rep->part[0].size = rep->part[0].filesize & ~(Mmap_align - 1);
+
+       if (util_replica_check_map_sync(set, repidx, 1))
+               goto err;
+
+       util_replica_set_is_pmem(rep);
+
+       if (Prefault_at_open)
+               util_replica_force_page_allocation(rep);
+
+       ASSERTeq(mapsize, rep->repsize);
+
+       /* calculate pool size - choose the smallest replica size */
+       if (rep->repsize < set->poolsize)
+               set->poolsize = rep->repsize;
+
+       LOG(3, "replica addr %p", rep->part[0].addr);
+
+       return 0;
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (mapsize < rep->repsize) {
+               ASSERTne(rep->part[0].addr, NULL);
+               ASSERTne(rep->part[0].addr, MAP_FAILED);
+               munmap(rep->part[0].addr, rep->resvsize - mapsize);
+       }
+       for (unsigned p = 0; p < rep->nhdrs; p++)
+               util_unmap_hdr(&rep->part[p]);
+       for (unsigned p = 0; p < rep->nparts; p++)
+               util_unmap_part(&rep->part[p]);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_replica_open_remote -- open a memory pool for remote replica
+ */
+int
+util_replica_open_remote(struct pool_set *set, unsigned repidx, int flags)
+{
+       LOG(3, "set %p repidx %u flags %d", set, repidx, flags);
+
+       struct pool_replica *rep = set->replica[repidx];
+
+       ASSERTne(rep->remote, NULL);
+       ASSERTne(rep->part, NULL);
+       ASSERTeq(rep->nparts, 1);
+       ASSERTeq(rep->nhdrs, 1);
+
+       struct pool_set_part *part = rep->part;
+
+       part->size = rep->repsize;
+       ASSERT(IS_PAGE_ALIGNED(part->size));
+       part->remote_hdr = Zalloc(part->size + Pagesize);
+       if (!part->remote_hdr) {
+               ERR("!Zalloc");
+               return -1;
+       }
+
+       part->hdr = PAGE_ALIGN_UP(part->remote_hdr);
+       part->addr = PAGE_ALIGN_UP(part->remote_hdr);
+       part->hdrsize = POOL_HDR_SIZE;
+
+       LOG(3, "replica #%u addr %p", repidx, rep->part[0].addr);
+
+       return 0;
+}
+
+/*
+ * util_replica_open -- open a memory pool replica
+ */
+int
+util_replica_open(struct pool_set *set, unsigned repidx, int flags)
+{
+       LOG(3, "set %p repidx %u flags %d", set, repidx, flags);
+
+       if (set->replica[repidx]->remote)
+               return util_replica_open_remote(set, repidx, flags);
+
+       return util_replica_open_local(set, repidx, flags);
+}
+
+/*
+ * util_replica_set_attr -- overwrite existing replica attributes
+ */
+int
+util_replica_set_attr(struct pool_replica *rep,
+               const struct rpmem_pool_attr *rattr)
+{
+       LOG(3, "rep %p, rattr %p", rep, rattr);
+       ASSERT(rattr != NULL || rep->nhdrs == 0);
+
+       if (rattr != NULL && rep->nhdrs == 0) {
+               ERR(
+               "cannot set pool attributes for a replica without headers (with the NOHDRS option)");
+               errno = EINVAL;
+               return -1;
+       }
+       int flags = MAP_SHARED;
+
+       /* map all headers - don't care about the address */
+       for (unsigned p = 0; p < rep->nparts; p++) {
+               if (util_map_hdr(&rep->part[p], flags, 0) != 0) {
+                       LOG(2, "header mapping failed - part #%d", p);
+                       goto err;
+               }
+       }
+
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               ASSERTne(rattr, NULL);
+
+               struct pool_hdr *hdrp = HDR(rep, p);
+               ASSERTne(hdrp, NULL);
+               util_convert2h_hdr_nocheck(hdrp);
+
+               util_set_rpmem_attr(hdrp, rattr);
+
+               if (hdrp == HDR(rep, 0))
+                       memcpy(hdrp->uuid, rattr->uuid, POOL_HDR_UUID_LEN);
+               if (hdrp == HDRP(rep, 0))
+                       memcpy(hdrp->next_part_uuid, rattr->uuid,
+                                       POOL_HDR_UUID_LEN);
+               if (hdrp == HDRN(rep, 0))
+                       memcpy(hdrp->prev_part_uuid, rattr->uuid,
+                                       POOL_HDR_UUID_LEN);
+
+               util_convert2le_hdr(hdrp);
+
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum,
+                       1, POOL_HDR_CSUM_END_OFF(hdrp));
+
+               /* store pool's header */
+               util_persist_auto(rep->is_pmem, hdrp, sizeof(*hdrp));
+       }
+
+       /* unmap all headers */
+       for (unsigned p = 0; p < rep->nhdrs; p++)
+               util_unmap_hdr(&rep->part[p]);
+
+       return 0;
+err:
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               util_unmap_hdr(&rep->part[p]);
+       }
+       return -1;
+}
+
+/*
+ * util_get_attr_from_header -- get pool attributes from a pool header
+ */
+void
+util_pool_hdr2attr(struct pool_attr *attr, struct pool_hdr *hdr)
+{
+       LOG(3, "attr %p, hdr %p", attr, hdr);
+       ASSERTne(attr, NULL);
+       ASSERTne(hdr, NULL);
+       memset(attr, 0, sizeof(*attr));
+       memcpy(attr->signature, hdr->signature, POOL_HDR_SIG_LEN);
+       attr->major = hdr->major;
+       attr->features.compat = hdr->features.compat;
+       attr->features.incompat = hdr->features.incompat;
+       attr->features.ro_compat = hdr->features.ro_compat;
+       memcpy(attr->poolset_uuid, hdr->poolset_uuid, POOL_HDR_UUID_LEN);
+}
+
+/*
+ * util_copy_attr_to_header -- copy pool attributes into pool header
+ */
+void
+util_pool_attr2hdr(struct pool_hdr *hdr, const struct pool_attr *attr)
+{
+       LOG(3, "hdr %p, attr %p", hdr, attr);
+       ASSERTne(hdr, NULL);
+       ASSERTne(attr, NULL);
+       memcpy(hdr->signature, attr->signature, POOL_HDR_SIG_LEN);
+       hdr->major = attr->major;
+       hdr->features.compat = attr->features.compat;
+       hdr->features.incompat = attr->features.incompat;
+       hdr->features.ro_compat = attr->features.ro_compat;
+}
+
+/*
+ * util_unmap_all_hdrs -- unmap all pool set headers
+ */
+static void
+util_unmap_all_hdrs(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote == NULL) {
+                       for (unsigned p = 0; p < rep->nhdrs; p++)
+                               util_unmap_hdr(&rep->part[p]);
+               } else {
+                       /*
+                        * hdr & hdrsize were set only for util_header_check(),
+                        * they will not be used any more. The memory will be
+                        * freed by util_replica_close()
+                        */
+                       rep->part[0].hdr = NULL;
+                       rep->part[0].hdrsize = 0;
+               }
+       }
+}
+
+/*
+ * util_replica_check -- check headers, check UUID's, check replicas linkage
+ */
+static int
+util_replica_check(struct pool_set *set, const struct pool_attr *attr)
+{
+       LOG(3, "set %p attr %p", set, attr);
+
+       /* read shutdown state toggle from header */
+       set->ignore_sds |= IGNORE_SDS(HDR(REP(set, 0), 0));
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               for (unsigned p = 0; p < rep->nhdrs; p++) {
+                       if (util_header_check(set, r, p, attr) != 0) {
+                               LOG(2, "header check failed - part #%d", p);
+                               return -1;
+                       }
+                       set->rdonly |= rep->part[p].rdonly;
+               }
+
+               if (memcmp(HDR(REPP(set, r), 0)->uuid,
+                                       HDR(REP(set, r), 0)->prev_repl_uuid,
+                                       POOL_HDR_UUID_LEN) ||
+                   memcmp(HDR(REPN(set, r), 0)->uuid,
+                                       HDR(REP(set, r), 0)->next_repl_uuid,
+                                       POOL_HDR_UUID_LEN)) {
+                       ERR("wrong replica UUID");
+                       errno = EINVAL;
+                       return -1;
+               }
+               if (!set->ignore_sds && !rep->remote && rep->nhdrs) {
+                       struct shutdown_state sds;
+                       shutdown_state_init(&sds, NULL);
+                       for (unsigned p = 0; p < rep->nparts; p++) {
+                               if (shutdown_state_add_part(&sds,
+                                               PART(rep, p)->fd, NULL))
+                                       return -1;
+                       }
+
+                       ASSERTne(rep->nhdrs, 0);
+                       ASSERTne(rep->nparts, 0);
+                       if (shutdown_state_check(&sds, &HDR(rep, 0)->sds,
+                                       rep)) {
+                               LOG(2, "ADR failure detected");
+                               errno = EINVAL;
+                               return -1;
+                       }
+                       shutdown_state_set_dirty(&HDR(rep, 0)->sds,
+                               rep);
+               }
+       }
+       return 0;
+}
+
+/*
+ * util_pool_has_device_dax -- (internal) check if poolset has any device dax
+ */
+int
+util_pool_has_device_dax(struct pool_set *set)
+{
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               /* either all the parts must be Device DAX or none */
+               if (PART(rep, 0)->is_dev_dax)
+                       return 1;
+       }
+       return 0;
+}
+
+/*
+ * util_pool_open_nocheck -- open a memory pool (set or a single file)
+ *
+ * This function opens a pool set without checking the header values.
+ */
+int
+util_pool_open_nocheck(struct pool_set *set, unsigned flags)
+{
+       LOG(3, "set %p flags 0x%x", set, flags);
+
+       int cow = flags & POOL_OPEN_COW;
+
+       if (cow && util_pool_has_device_dax(set)) {
+               ERR("device dax cannot be mapped privately");
+               errno = ENOTSUP;
+               return -1;
+       }
+
+       int mmap_flags = cow ? MAP_PRIVATE|MAP_NORESERVE : MAP_SHARED;
+       int oerrno;
+
+       ASSERTne(set, NULL);
+       ASSERT(set->nreplicas > 0);
+
+       if (flags & POOL_OPEN_CHECK_BAD_BLOCKS) {
+               /* check if any bad block recovery file exists */
+               int bfe = badblocks_recovery_file_exists(set);
+               if (bfe > 0) {
+                       ERR(
+                               "error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool");
+                       errno = EINVAL;
+                       return -1;
+               }
+               if (bfe < 0) {
+                       LOG(1,
+                               "an error occurred when checking whether recovery file exists.");
+                       return -1;
+               }
+
+               int bbs = badblocks_check_poolset(set, 0 /* not create */);
+               if (bbs < 0) {
+                       LOG(1, "failed to check pool set for bad blocks");
+                       return -1;
+               }
+
+               if (bbs > 0) {
+                       if (flags & POOL_OPEN_IGNORE_BAD_BLOCKS) {
+                               LOG(1,
+                                       "WARNING: pool set contains bad blocks, ignoring");
+                       } else {
+                               ERR(
+                                       "pool set contains bad blocks and cannot be opened, run 'pmempool sync --bad-blocks' utility to try to recover the pool");
+                               errno = EIO;
+                               return -1;
+                       }
+               }
+       }
+
+       if (set->remote && util_remote_load()) {
+               ERR("the pool set requires a remote replica, "
+                       "but the '%s' library cannot be loaded",
+                       LIBRARY_REMOTE);
+               return -1;
+       }
+
+       int ret = util_poolset_files_local(set, 0 /* minpartsize */, 0);
+       if (ret != 0)
+               goto err_poolset;
+
+       set->rdonly = 0;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               if (util_replica_open(set, r, mmap_flags) != 0) {
+                       LOG(2, "replica #%u open failed", r);
+                       goto err_replica;
+               }
+       }
+
+       if (set->remote) {
+               ret = util_poolset_files_remote(set, 0, NULL, 0);
+               if (ret != 0)
+                       goto err_replica;
+       }
+
+       util_unmap_all_hdrs(set);
+
+       return 0;
+
+err_replica:
+       LOG(4, "error clean up");
+       oerrno = errno;
+       for (unsigned r = 0; r < set->nreplicas; r++)
+               util_replica_close(set, r);
+       errno = oerrno;
+err_poolset:
+       oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_read_compat_features -- (internal) read compat features from the header
+ */
+static int
+util_read_compat_features(struct pool_set *set, uint32_t *compat_features)
+{
+       LOG(3, "set %p pcompat_features %p", set, compat_features);
+
+       *compat_features = 0;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+
+                       if (util_part_open(part, 0, 0 /* create */)) {
+                               LOG(1, "!cannot open the part -- \"%s\"",
+                                       part->path);
+                               /* try to open the next part */
+                               continue;
+                       }
+
+                       if (util_map_hdr(part, MAP_SHARED, 0) != 0) {
+                               LOG(1, "header mapping failed -- \"%s\"",
+                                       part->path);
+                               util_part_fdclose(part);
+                               return -1;
+                       }
+
+                       struct pool_hdr *hdrp = part->hdr;
+                       *compat_features = hdrp->features.compat;
+
+                       util_unmap_hdr(part);
+                       util_part_fdclose(part);
+
+                       /* exit on the first successfully opened part */
+                       return 0;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * unlink_remote_replicas -- removes remote replicas from poolset
+ *
+ * It is necessary when COW flag is set because remote replicas
+ * cannot be mapped privately
+ */
+static int
+unlink_remote_replicas(struct pool_set *set)
+{
+       unsigned i = 0;
+       while (i < set->nreplicas) {
+               if (set->replica[i]->remote == NULL) {
+                       i++;
+                       continue;
+               }
+
+               util_replica_close(set, i);
+               int ret = util_replica_close_remote(set->replica[i], i,
+                               DO_NOT_DELETE_PARTS);
+               if (ret != 0)
+                       return ret;
+
+               size_t size = sizeof(set->replica[i]) *
+                       (set->nreplicas - i - 1);
+               memmove(&set->replica[i], &set->replica[i + 1], size);
+               set->nreplicas--;
+       }
+
+       set->remote = 0;
+       return 0;
+}
+
+/*
+ * util_pool_open -- open a memory pool (set or a single file)
+ *
+ * This routine does all the work, but takes a rdonly flag so internal
+ * calls can map a read-only pool if required.
+ */
+int
+util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize,
+       const struct pool_attr *attr, unsigned *nlanes, void *addr,
+       unsigned flags)
+{
+       LOG(3, "setp %p path %s minpartsize %zu attr %p nlanes %p "
+               "addr %p flags 0x%x ", setp, path, minpartsize, attr, nlanes,
+               addr, flags);
+
+       int cow = flags & POOL_OPEN_COW;
+       int mmap_flags = cow ? MAP_PRIVATE|MAP_NORESERVE : MAP_SHARED;
+       int oerrno;
+
+       /* do not check minsize */
+       int ret = util_poolset_create_set(setp, path, 0, 0,
+                                               flags & POOL_OPEN_IGNORE_SDS);
+       if (ret < 0) {
+               LOG(2, "cannot open pool set -- '%s'", path);
+               return -1;
+       }
+
+       if ((*setp)->replica[0]->nparts == 0) {
+               errno = ENOENT;
+               ERR("!no parts in replicas");
+               goto err_poolset_free;
+       }
+
+       if (cow && (*setp)->replica[0]->part[0].is_dev_dax) {
+               ERR("device dax cannot be mapped privately");
+               errno = ENOTSUP;
+               goto err_poolset_free;
+       }
+
+       struct pool_set *set = *setp;
+
+       ASSERT(set->nreplicas > 0);
+
+       uint32_t compat_features;
+
+       if (util_read_compat_features(set, &compat_features)) {
+               LOG(1, "reading compat features failed");
+               goto err_poolset_free;
+       }
+
+       if (compat_features & POOL_FEAT_CHECK_BAD_BLOCKS) {
+               /* check if any bad block recovery file exists */
+               int bfe = badblocks_recovery_file_exists(set);
+               if (bfe > 0) {
+                       ERR(
+                               "error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' utility to try to recover the pool");
+                       errno = EINVAL;
+                       goto err_poolset_free;
+               }
+
+               if (bfe < 0) {
+                       LOG(1,
+                               "an error occurred when checking whether recovery file exists.");
+                       goto err_poolset_free;
+               }
+
+               int bbs = badblocks_check_poolset(set, 0 /* not create */);
+               if (bbs < 0) {
+                       LOG(1,
+                               "failed to check pool set for bad blocks -- '%s'",
+                               path);
+                       goto err_poolset_free;
+               }
+
+               if (bbs > 0) {
+                       if (flags & POOL_OPEN_IGNORE_BAD_BLOCKS) {
+                               LOG(1,
+                                       "WARNING: pool set contains bad blocks, ignoring -- '%s'",
+                                       path);
+                       } else {
+                               ERR(
+                                       "pool set contains bad blocks and cannot be opened, run 'pmempool sync --bad-blocks' utility to try to recover the pool -- '%s'",
+                                       path);
+                               errno = EIO;
+                               goto err_poolset_free;
+                       }
+               }
+       }
+
+       if (set->remote && util_remote_load()) {
+               ERR(
+                       "the pool set requires a remote replica, but the '%s' library cannot be loaded",
+                       LIBRARY_REMOTE);
+               goto err_poolset_free;
+       }
+
+       ret = util_poolset_files_local(set, minpartsize, 0);
+       if (ret != 0)
+               goto err_poolset;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               if (util_replica_open(set, r, mmap_flags) != 0) {
+                       LOG(2, "replica #%u open failed", r);
+                       goto err_replica;
+               }
+       }
+
+       if (set->remote) {
+               /* do not check minsize */
+               ret = util_poolset_files_remote(set, 0, nlanes, 0);
+               if (ret != 0)
+                       goto err_replica;
+       }
+
+       /* check headers, check UUID's, check replicas linkage */
+       if (attr != NULL && util_replica_check(set, attr))
+               goto err_replica;
+
+       /* unmap all headers */
+       util_unmap_all_hdrs(set);
+
+       /* remove all remote replicas from poolset when cow */
+       if (cow && set->remote) {
+               ret = unlink_remote_replicas(set);
+               if (ret != 0)
+                       goto err_replica;
+       }
+
+       return 0;
+
+err_replica:
+       LOG(4, "error clean up");
+       oerrno = errno;
+       for (unsigned r = 0; r < set->nreplicas; r++)
+               util_replica_close(set, r);
+       errno = oerrno;
+err_poolset:
+       oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+       return -1;
+
+err_poolset_free:
+       oerrno = errno;
+       util_poolset_free(*setp);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_pool_open_remote -- open a remote pool set file
+ *
+ * This routine does all the work, but takes a rdonly flag so internal
+ * calls can map a read-only pool if required.
+ */
+int
+util_pool_open_remote(struct pool_set **setp, const char *path, int cow,
+       size_t minpartsize, struct rpmem_pool_attr *rattr)
+{
+       LOG(3, "setp %p path %s cow %d minpartsize %zu rattr %p",
+               setp, path, cow, minpartsize, rattr);
+
+       int flags = cow ? MAP_PRIVATE|MAP_NORESERVE : MAP_SHARED;
+       int oerrno;
+
+       /* do not check minsize */
+       int ret = util_poolset_create_set(setp, path, 0, 0, 0);
+       if (ret < 0) {
+               LOG(2, "cannot open pool set -- '%s'", path);
+               return -1;
+       }
+
+       if (cow && (*setp)->replica[0]->part[0].is_dev_dax) {
+               ERR("device dax cannot be mapped privately");
+               errno = ENOTSUP;
+               return -1;
+       }
+
+       struct pool_set *set = *setp;
+
+       if (set->nreplicas > 1) {
+               LOG(2, "remote pool set cannot have replicas");
+               goto err_poolset;
+       }
+
+       uint32_t compat_features;
+
+       if (util_read_compat_features(set, &compat_features)) {
+               LOG(1, "reading compat features failed");
+               goto err_poolset;
+       }
+
+       if (compat_features & POOL_FEAT_CHECK_BAD_BLOCKS) {
+               /* check if there are any bad blocks */
+               int bbs = badblocks_check_poolset(set, 0 /* not create */);
+               if (bbs < 0) {
+                       LOG(1,
+                               "failed to check the remote replica for bad blocks -- '%s'",
+                               path);
+                       goto err_poolset;
+               }
+
+               if (bbs > 0) {
+                       ERR(
+                               "remote replica contains bad blocks and cannot be opened, run 'pmempool sync --bad-blocks' utility to recreate it -- '%s'",
+                               path);
+                       errno = EIO;
+                       goto err_poolset;
+               }
+       }
+
+       ret = util_poolset_files_local(set, minpartsize, 0);
+       if (ret != 0)
+               goto err_poolset;
+
+       if (util_replica_open(set, 0, flags) != 0) {
+               LOG(2, "replica open failed");
+               goto err_replica;
+       }
+
+       struct pool_replica *rep = set->replica[0];
+
+       set->rdonly |= rep->part[0].rdonly;
+
+       /* check headers, check UUID's, check replicas linkage */
+       for (unsigned p = 0; p < rep->nhdrs; p++) {
+               if (util_header_check_remote(set, p) != 0) {
+                       LOG(2, "header check failed - part #%d", p);
+                       goto err_replica;
+               }
+               set->rdonly |= rep->part[p].rdonly;
+       }
+
+       if (rep->nhdrs > 0) {
+               /* header exists, copy pool attributes */
+               struct pool_hdr *hdr = rep->part[0].hdr;
+               util_get_rpmem_attr(rattr, hdr);
+       } else {
+               /* header does not exist, zero pool attributes */
+               memset(rattr, 0, sizeof(*rattr));
+       }
+
+       /* unmap all headers */
+       for (unsigned p = 0; p < rep->nhdrs; p++)
+               util_unmap_hdr(&rep->part[p]);
+
+       return 0;
+
+err_replica:
+       LOG(4, "error clean up");
+       oerrno = errno;
+       util_replica_close(set, 0);
+       errno = oerrno;
+err_poolset:
+       oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * util_is_poolset_file -- check if specified file is a poolset file
+ *
+ * Return value:
+ * -1 - error
+ *  0 - not a poolset
+ *  1 - is a poolset
+ */
+int
+util_is_poolset_file(const char *path)
+{
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       if (type == TYPE_DEVDAX)
+               return 0;
+
+       int fd = util_file_open(path, NULL, 0, O_RDONLY);
+       if (fd < 0)
+               return -1;
+
+       int ret = 0;
+       ssize_t sret;
+       char signature[POOLSET_HDR_SIG_LEN];
+       size_t rd = 0;
+       do {
+               sret = util_read(fd, &signature[rd], sizeof(signature) - rd);
+               if (sret > 0)
+                       rd += (size_t)sret;
+       } while (sret > 0);
+       if (sret < 0) {
+               ERR("!read");
+               ret = -1;
+               goto out;
+       } else if (rd != sizeof(signature)) {
+               ret = 0;
+               goto out;
+       }
+
+       if (memcmp(signature, POOLSET_HDR_SIG, POOLSET_HDR_SIG_LEN) == 0)
+               ret = 1;
+out:
+       os_close(fd);
+       return ret;
+}
+/*
+ * util_poolset_foreach_part_struct -- walk through all poolset file parts
+ *                                  of the given set
+ *
+ * Stops processing if callback returns non-zero value.
+ * The value returned by callback is returned to the caller.
+ */
+int
+util_poolset_foreach_part_struct(struct pool_set *set,
+       int (*callback)(struct part_file *pf, void *arg), void *arg)
+{
+       LOG(3, "set %p callback %p arg %p", set, callback, arg);
+
+       ASSERTne(callback, NULL);
+
+       int ret;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct part_file cbdata;
+               if (set->replica[r]->remote) {
+                       cbdata.is_remote = 1;
+                       cbdata.remote = set->replica[r]->remote;
+                       cbdata.part = NULL;
+                       ret = (*callback)(&cbdata, arg);
+                       if (ret)
+                               return ret;
+               } else {
+                       cbdata.is_remote = 0;
+                       cbdata.remote = NULL;
+                       for (unsigned p = 0; p < set->replica[r]->nparts; p++) {
+                               cbdata.part = &set->replica[r]->part[p];
+                               ret = (*callback)(&cbdata, arg);
+                               if (ret)
+                                       return ret;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_foreach_part -- walk through all poolset file parts
+ *
+ * Stops processing if callback returns non-zero value.
+ * The value returned by callback is returned to the caller.
+ *
+ * Return value:
+ *  0 - all part files have been processed
+ * -1 - parsing poolset file error
+ */
+int
+util_poolset_foreach_part(const char *path,
+       int (*callback)(struct part_file *pf, void *arg), void *arg)
+{
+       LOG(3, "path %s callback %p arg %p", path, callback, arg);
+
+       ASSERTne(callback, NULL);
+
+       int fd = os_open(path, O_RDONLY);
+       if (fd < 0) {
+               ERR("!open: path \"%s\"", path);
+               return -1;
+       }
+
+       struct pool_set *set;
+       int ret = util_poolset_parse(&set, path, fd);
+       if (ret) {
+               ERR("util_poolset_parse failed -- '%s'", path);
+               ret = -1;
+               goto err_close;
+       }
+
+       ret = util_poolset_foreach_part_struct(set, callback, arg);
+
+       /*
+        * Make sure callback does not return -1,
+        * because this value is reserved for parsing
+        * error.
+        */
+       ASSERTne(ret, -1);
+       util_poolset_free(set);
+
+err_close:
+       os_close(fd);
+       return ret;
+}
+
+/*
+ * util_poolset_size -- get size of poolset, returns 0 on error
+ */
+size_t
+util_poolset_size(const char *path)
+{
+       int fd = os_open(path, O_RDONLY);
+       if (fd < 0)
+               return 0;
+
+       size_t size = 0;
+       struct pool_set *set;
+       if (util_poolset_parse(&set, path, fd))
+               goto err_close;
+
+       size = set->poolsize;
+
+       util_poolset_free(set);
+err_close:
+       os_close(fd);
+       return size;
+}
+
+/*
+ * util_replica_fdclose -- close all parts of given replica
+ */
+void
+util_replica_fdclose(struct pool_replica *rep)
+{
+       for (unsigned p = 0; p < rep->nparts; p++) {
+               struct pool_set_part *part = &rep->part[p];
+               util_part_fdclose(part);
+       }
+}
+
+/*
+ * util_replica_deep_common -- performs common calculations
+ * on all parts from replica to define intersection ranges
+ * for final flushing operations that take place in
+ * os_part_deep_common function.
+ */
+int
+util_replica_deep_common(const void *addr, size_t len, struct pool_set *set,
+                               unsigned replica_id, int flush)
+{
+       LOG(3, "addr %p len %zu set %p replica_id %u flush %d",
+               addr, len, set, replica_id, flush);
+
+       struct pool_replica *rep = set->replica[replica_id];
+       uintptr_t rep_start = (uintptr_t)rep->part[0].addr;
+       uintptr_t rep_end = rep_start + rep->repsize;
+       uintptr_t start = (uintptr_t)addr;
+       uintptr_t end = start + len;
+
+       ASSERT(start >= rep_start);
+       ASSERT(end <= rep_end);
+
+       for (unsigned p = 0; p < rep->nparts; p++) {
+               struct pool_set_part *part = &rep->part[p];
+               uintptr_t part_start = (uintptr_t)part->addr;
+               uintptr_t part_end = part_start + part->size;
+               /* init intersection start and end addresses */
+               uintptr_t range_start = start;
+               uintptr_t range_end = end;
+
+               if (part_start > end || part_end < start)
+                       continue;
+               /* recalculate intersection addresses */
+               if (part_start > start)
+                       range_start = part_start;
+               if (part_end < end)
+                       range_end = part_end;
+               size_t range_len = range_end - range_start;
+
+               LOG(15, "perform deep flushing for replica %u "
+                       "part %p, addr %p, len %lu",
+                       replica_id, part, (void *)range_start, range_len);
+               if (os_part_deep_common(rep, p, (void *)range_start,
+                               range_len, flush)) {
+                       LOG(1, "os_part_deep_common(%p, %p, %lu)",
+                               part, (void *)range_start, range_len);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * util_replica_deep_persist -- wrapper for util_replica_deep_common
+ * Calling the target precedes initialization of function that
+ * partly defines way of deep replica flushing.
+ */
+int
+util_replica_deep_persist(const void *addr, size_t len, struct pool_set *set,
+                               unsigned replica_id)
+{
+       LOG(3, "addr %p len %zu set %p replica_id %u",
+               addr, len, set, replica_id);
+
+       int flush = 1;
+       return util_replica_deep_common(addr, len, set, replica_id, flush);
+}
+
+/*
+ * util_replica_deep_drain -- wrapper for util_replica_deep_common
+ * Calling the target precedes initialization of function that
+ * partly defines way of deep replica flushing.
+ */
+int
+util_replica_deep_drain(const void *addr, size_t len, struct pool_set *set,
+                               unsigned replica_id)
+{
+       LOG(3, "addr %p len %zu set %p replica_id %u",
+               addr, len, set, replica_id);
+
+       int flush = 0;
+       return util_replica_deep_common(addr, len, set, replica_id, flush);
+}
diff --git a/ceph/src/pmdk/src/common/set.h b/ceph/src/pmdk/src/common/set.h
new file mode 100644 (file)
index 0000000..ba4603d
--- /dev/null
@@ -0,0 +1,440 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * set.h -- internal definitions for set module
+ */
+
+#ifndef PMDK_SET_H
+#define PMDK_SET_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include <sys/types.h>
+
+#include "out.h"
+#include "vec.h"
+#include "pool_hdr.h"
+#include "librpmem.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * pool sets & replicas
+ */
+#define POOLSET_HDR_SIG "PMEMPOOLSET"
+#define POOLSET_HDR_SIG_LEN 11 /* does NOT include '\0' */
+
+#define POOLSET_REPLICA_SIG "REPLICA"
+#define POOLSET_REPLICA_SIG_LEN 7      /* does NOT include '\0' */
+
+#define POOLSET_OPTION_SIG "OPTION"
+#define POOLSET_OPTION_SIG_LEN 6       /* does NOT include '\0' */
+
+/* pool set option flags */
+enum pool_set_option_flag {
+       OPTION_UNKNOWN = 0x0,
+       OPTION_SINGLEHDR = 0x1, /* pool headers only in the first part */
+       OPTION_NOHDRS = 0x2,    /* no pool headers, remote replicas only */
+};
+
+struct pool_set_option {
+       const char *name;
+       enum pool_set_option_flag flag;
+};
+
+#define POOL_LOCAL 0
+#define POOL_REMOTE 1
+
+#define REPLICAS_DISABLED 0
+#define REPLICAS_ENABLED 1
+
+/*  util_pool_open flags */
+#define POOL_OPEN_COW                  1       /* copy-on-write mode */
+#define POOL_OPEN_IGNORE_SDS           2       /* ignore shutdown state */
+#define POOL_OPEN_IGNORE_BAD_BLOCKS    4       /* ignore bad blocks */
+#define POOL_OPEN_CHECK_BAD_BLOCKS     8       /* check bad blocks */
+
+enum del_parts_mode {
+       DO_NOT_DELETE_PARTS,    /* do not delete part files */
+       DELETE_CREATED_PARTS,   /* delete only newly created parts files */
+       DELETE_ALL_PARTS        /* force delete all parts files */
+};
+
+struct pool_set_part {
+       /* populated by a pool set file parser */
+       const char *path;
+       size_t filesize;        /* aligned to page size */
+       int fd;
+       int flags;              /* stores flags used when opening the file */
+                               /* valid only if fd >= 0 */
+       int is_dev_dax;         /* indicates if the part is on device dax */
+       size_t alignment;       /* internal alignment (Device DAX only) */
+       int created;            /* indicates newly created (zeroed) file */
+
+       /* util_poolset_open/create */
+       void *remote_hdr;       /* allocated header for remote replica */
+       void *hdr;              /* base address of header */
+       size_t hdrsize;         /* size of the header mapping */
+       int hdr_map_sync;       /* header mapped with MAP_SYNC */
+       void *addr;             /* base address of the mapping */
+       size_t size;            /* size of the mapping - page aligned */
+       int map_sync;           /* part has been mapped with MAP_SYNC flag */
+       int rdonly;             /* is set based on compat features, affects */
+                               /* the whole poolset */
+       uuid_t uuid;
+       int has_bad_blocks;     /* part file contains bad blocks */
+       int sds_dirty_modified; /* sds dirty flag was set */
+};
+
+struct pool_set_directory {
+       const char *path;
+       size_t resvsize; /* size of the address space reservation */
+
+};
+
+struct remote_replica {
+       void *rpp;              /* RPMEMpool opaque handle */
+       char *node_addr;        /* address of a remote node */
+       /* poolset descriptor is a pool set file name on a remote node */
+       char *pool_desc;        /* descriptor of a poolset */
+};
+
+struct pool_replica {
+       unsigned nparts;
+       unsigned nallocated;
+       unsigned nhdrs;         /* should be 0, 1 or nparts */
+       size_t repsize;         /* total size of all the parts (mappings) */
+       size_t resvsize;        /* min size of the address space reservation */
+       int is_pmem;            /* true if all the parts are in PMEM */
+       struct remote_replica *remote;  /* not NULL if the replica */
+                                       /* is a remote one */
+       VEC(, struct pool_set_directory) directory;
+       struct pool_set_part part[];
+};
+
+struct pool_set {
+       char *path;             /* path of the poolset file */
+       unsigned nreplicas;
+       uuid_t uuid;
+       int rdonly;
+       int zeroed;             /* true if all the parts are new files */
+       size_t poolsize;        /* the smallest replica size */
+       int has_bad_blocks;     /* pool set contains bad blocks */
+       int remote;             /* true if contains a remote replica */
+       unsigned options;       /* enabled pool set options */
+
+       int directory_based;
+       size_t resvsize;
+
+       unsigned next_id;
+       unsigned next_directory_id;
+
+       int ignore_sds;         /* don't use shutdown state */
+       struct pool_replica *replica[];
+};
+
+struct part_file {
+       int is_remote;
+       /*
+        * Pointer to the part file structure -
+        * - not-NULL only for a local part file
+        */
+       struct pool_set_part *part;
+       /*
+        * Pointer to the replica structure -
+        * - not-NULL only for a remote replica
+        */
+       struct remote_replica *remote;
+};
+
+struct pool_attr {
+       char signature[POOL_HDR_SIG_LEN]; /* pool signature */
+       uint32_t major; /* format major version number */
+       features_t features; /* features flags */
+       unsigned char poolset_uuid[POOL_HDR_UUID_LEN];          /* pool uuid */
+       unsigned char first_part_uuid[POOL_HDR_UUID_LEN]; /* first part uuid */
+       unsigned char prev_repl_uuid[POOL_HDR_UUID_LEN]; /* prev replica uuid */
+       unsigned char next_repl_uuid[POOL_HDR_UUID_LEN]; /* next replica uuid */
+       unsigned char arch_flags[POOL_HDR_ARCH_LEN];            /* arch flags */
+};
+
+/* get index of the (r)th replica */
+static inline unsigned
+REPidx(const struct pool_set *set, unsigned r)
+{
+       ASSERTne(set->nreplicas, 0);
+       return r % set->nreplicas;
+}
+
+/* get index of the (r + 1)th replica */
+static inline unsigned
+REPNidx(const struct pool_set *set, unsigned r)
+{
+       ASSERTne(set->nreplicas, 0);
+       return (r + 1) % set->nreplicas;
+}
+
+/* get index of the (r - 1)th replica */
+static inline unsigned
+REPPidx(const struct pool_set *set, unsigned r)
+{
+       ASSERTne(set->nreplicas, 0);
+       return (set->nreplicas + r - 1) % set->nreplicas;
+}
+
+/* get index of the (r)th part */
+static inline unsigned
+PARTidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nparts, 0);
+       return p % rep->nparts;
+}
+
+/* get index of the (r + 1)th part */
+static inline unsigned
+PARTNidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nparts, 0);
+       return (p + 1) % rep->nparts;
+}
+
+/* get index of the (r - 1)th part */
+static inline unsigned
+PARTPidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nparts, 0);
+       return (rep->nparts + p - 1) % rep->nparts;
+}
+
+/* get index of the (r)th part */
+static inline unsigned
+HDRidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nhdrs, 0);
+       return p % rep->nhdrs;
+}
+
+/* get index of the (r + 1)th part */
+static inline unsigned
+HDRNidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nhdrs, 0);
+       return (p + 1) % rep->nhdrs;
+}
+
+/* get index of the (r - 1)th part */
+static inline unsigned
+HDRPidx(const struct pool_replica *rep, unsigned p)
+{
+       ASSERTne(rep->nhdrs, 0);
+       return (rep->nhdrs + p - 1) % rep->nhdrs;
+}
+
+/* get (r)th replica */
+static inline struct pool_replica *
+REP(const struct pool_set *set, unsigned r)
+{
+       return set->replica[REPidx(set, r)];
+}
+
+/* get (r + 1)th replica */
+static inline struct pool_replica *
+REPN(const struct pool_set *set, unsigned r)
+{
+       return set->replica[REPNidx(set, r)];
+}
+
+/* get (r - 1)th replica */
+static inline struct pool_replica *
+REPP(const struct pool_set *set, unsigned r)
+{
+       return set->replica[REPPidx(set, r)];
+}
+
+/* get (p)th part */
+static inline struct pool_set_part *
+PART(struct pool_replica *rep, unsigned p)
+{
+       return &rep->part[PARTidx(rep, p)];
+}
+
+/* get (p + 1)th part */
+static inline struct pool_set_part *
+PARTN(struct pool_replica *rep, unsigned p)
+{
+       return &rep->part[PARTNidx(rep, p)];
+}
+
+/* get (p - 1)th part */
+static inline struct pool_set_part *
+PARTP(struct pool_replica *rep, unsigned p)
+{
+       return &rep->part[PARTPidx(rep, p)];
+}
+
+/* get (p)th header */
+static inline struct pool_hdr *
+HDR(struct pool_replica *rep, unsigned p)
+{
+       return (struct pool_hdr *)(rep->part[HDRidx(rep, p)].hdr);
+}
+
+/* get (p + 1)th header */
+static inline struct pool_hdr *
+HDRN(struct pool_replica *rep, unsigned p)
+{
+       return (struct pool_hdr *)(rep->part[HDRNidx(rep, p)].hdr);
+}
+
+/* get (p - 1)th header */
+static inline struct pool_hdr *
+HDRP(struct pool_replica *rep, unsigned p)
+{
+       return (struct pool_hdr *)(rep->part[HDRPidx(rep, p)].hdr);
+}
+
+extern int Prefault_at_open;
+extern int Prefault_at_create;
+extern int SDS_at_create;
+extern int Fallocate_at_create;
+extern int COW_at_open;
+
+int util_poolset_parse(struct pool_set **setp, const char *path, int fd);
+int util_poolset_read(struct pool_set **setp, const char *path);
+int util_poolset_create_set(struct pool_set **setp, const char *path,
+       size_t poolsize, size_t minsize, int ignore_sds);
+int util_poolset_open(struct pool_set *set);
+void util_poolset_close(struct pool_set *set, enum del_parts_mode del);
+void util_poolset_free(struct pool_set *set);
+int util_poolset_chmod(struct pool_set *set, mode_t mode);
+void util_poolset_fdclose(struct pool_set *set);
+void util_poolset_fdclose_always(struct pool_set *set);
+int util_is_poolset_file(const char *path);
+int util_poolset_foreach_part_struct(struct pool_set *set,
+       int (*cb)(struct part_file *pf, void *arg), void *arg);
+int util_poolset_foreach_part(const char *path,
+       int (*cb)(struct part_file *pf, void *arg), void *arg);
+size_t util_poolset_size(const char *path);
+
+int util_replica_deep_common(const void *addr, size_t len,
+       struct pool_set *set, unsigned replica_id, int flush);
+int util_replica_deep_persist(const void *addr, size_t len,
+       struct pool_set *set, unsigned replica_id);
+int util_replica_deep_drain(const void *addr, size_t len,
+       struct pool_set *set, unsigned replica_id);
+
+int util_pool_create(struct pool_set **setp, const char *path, size_t poolsize,
+       size_t minsize, size_t minpartsize, const struct pool_attr *attr,
+       unsigned *nlanes, int can_have_rep);
+int util_pool_create_uuids(struct pool_set **setp, const char *path,
+       size_t poolsize, size_t minsize, size_t minpartsize,
+       const struct pool_attr *attr, unsigned *nlanes, int can_have_rep,
+       int remote);
+
+int util_part_open(struct pool_set_part *part, size_t minsize, int create_part);
+void util_part_fdclose(struct pool_set_part *part);
+int util_replica_open(struct pool_set *set, unsigned repidx, int flags);
+int util_replica_set_attr(struct pool_replica *rep,
+               const struct rpmem_pool_attr *rattr);
+void util_pool_hdr2attr(struct pool_attr *attr, struct pool_hdr *hdr);
+void util_pool_attr2hdr(struct pool_hdr *hdr,
+               const struct pool_attr *attr);
+int util_replica_close(struct pool_set *set, unsigned repidx);
+int util_map_part(struct pool_set_part *part, void *addr, size_t size,
+       size_t offset, int flags, int rdonly);
+int util_unmap_part(struct pool_set_part *part);
+int util_unmap_parts(struct pool_replica *rep, unsigned start_index,
+       unsigned end_index);
+int util_header_create(struct pool_set *set, unsigned repidx, unsigned partidx,
+       const struct pool_attr *attr, int overwrite);
+
+int util_map_hdr(struct pool_set_part *part, int flags, int rdonly);
+void util_unmap_hdr(struct pool_set_part *part);
+
+int util_pool_has_device_dax(struct pool_set *set);
+
+int util_pool_open_nocheck(struct pool_set *set, unsigned flags);
+int util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize,
+       const struct pool_attr *attr, unsigned *nlanes, void *addr,
+       unsigned flags);
+int util_pool_open_remote(struct pool_set **setp, const char *path, int cow,
+       size_t minpartsize, struct rpmem_pool_attr *rattr);
+
+void *util_pool_extend(struct pool_set *set, size_t *size, size_t minpartsize);
+
+void util_remote_init(void);
+void util_remote_fini(void);
+
+int util_update_remote_header(struct pool_set *set, unsigned repn);
+void util_remote_init_lock(void);
+void util_remote_destroy_lock(void);
+int util_pool_close_remote(RPMEMpool *rpp);
+void util_remote_unload(void);
+void util_replica_fdclose(struct pool_replica *rep);
+int util_poolset_remote_open(struct pool_replica *rep, unsigned repidx,
+       size_t minsize, int create, void *pool_addr,
+       size_t pool_size, unsigned *nlanes);
+int util_remote_load(void);
+int util_replica_open_remote(struct pool_set *set, unsigned repidx, int flags);
+int util_poolset_remote_replica_open(struct pool_set *set, unsigned repidx,
+       size_t minsize, int create, unsigned *nlanes);
+int util_replica_close_local(struct pool_replica *rep, unsigned repn,
+               enum del_parts_mode del);
+int util_replica_close_remote(struct pool_replica *rep, unsigned repn,
+               enum del_parts_mode del);
+
+extern int (*Rpmem_persist)(RPMEMpool *rpp, size_t offset, size_t length,
+                                               unsigned lane, unsigned flags);
+extern int (*Rpmem_deep_persist)(RPMEMpool *rpp, size_t offset, size_t length,
+                                                               unsigned lane);
+extern int (*Rpmem_read)(RPMEMpool *rpp, void *buff, size_t offset,
+                               size_t length, unsigned lane);
+extern int (*Rpmem_close)(RPMEMpool *rpp);
+
+extern int (*Rpmem_remove)(const char *target,
+               const char *pool_set_name, int flags);
+
+extern int (*Rpmem_set_attr)(RPMEMpool *rpp,
+               const struct rpmem_pool_attr *rattr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/set_badblocks.c b/ceph/src/pmdk/src/common/set_badblocks.c
new file mode 100644 (file)
index 0000000..1ee9687
--- /dev/null
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * set_badblocks.c - common part of implementation of bad blocks API
+ */
+#define _GNU_SOURCE
+
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+
+#include "file.h"
+#include "os.h"
+#include "out.h"
+#include "set_badblocks.h"
+#include "badblocks.h"
+
+/* helper structure for badblocks_check_file_cb() */
+struct check_file_cb {
+       int n_files_bbs;        /* number of files with bad blocks */
+       int create;             /* poolset is just being created */
+};
+
+/*
+ * badblocks_check_file_cb -- (internal) callback checking bad blocks
+ *                               in the given file
+ */
+static int
+badblocks_check_file_cb(struct part_file *pf, void *arg)
+{
+       LOG(3, "part_file %p arg %p", pf, arg);
+
+       struct check_file_cb *pcfcb = arg;
+
+       if (pf->is_remote) {
+               /*
+                * Remote replicas are checked for bad blocks
+                * while opening in util_pool_open_remote().
+                */
+               return 0;
+       }
+
+       int exists = util_file_exists(pf->part->path);
+       if (exists < 0)
+               return -1;
+
+       if (!exists)
+               /* the part does not exist, so it has no bad blocks */
+               return 0;
+
+       int ret = badblocks_check_file(pf->part->path);
+       if (ret < 0) {
+               ERR("checking the pool file for bad blocks failed -- '%s'",
+                       pf->part->path);
+               return -1;
+       }
+
+       if (ret > 0) {
+               ERR("part file contains bad blocks -- '%s'", pf->part->path);
+               pcfcb->n_files_bbs++;
+               pf->part->has_bad_blocks = 1;
+       }
+
+       return 0;
+}
+
+/*
+ * badblocks_check_poolset -- checks if the pool set contains bad blocks
+ *
+ * Return value:
+ * -1 error
+ *  0 pool set does not contain bad blocks
+ *  1 pool set contains bad blocks
+ */
+int
+badblocks_check_poolset(struct pool_set *set, int create)
+{
+       LOG(3, "set %p create %i", set, create);
+
+       struct check_file_cb cfcb;
+
+       cfcb.n_files_bbs = 0;
+       cfcb.create = create;
+
+       if (util_poolset_foreach_part_struct(set, badblocks_check_file_cb,
+                                               &cfcb)) {
+               return -1;
+       }
+
+       if (cfcb.n_files_bbs) {
+               LOG(1, "%i pool file(s) contain bad blocks", cfcb.n_files_bbs);
+               set->has_bad_blocks = 1;
+       }
+
+       return (cfcb.n_files_bbs > 0);
+}
+
+/*
+ * badblocks_clear_poolset_cb -- (internal) callback clearing bad blocks
+ *                                  in the given file
+ */
+static int
+badblocks_clear_poolset_cb(struct part_file *pf, void *arg)
+{
+       LOG(3, "part_file %p arg %p", pf, arg);
+
+       int *create = arg;
+
+       if (pf->is_remote) { /* XXX not supported yet */
+               LOG(1,
+                       "WARNING: clearing bad blocks in remote replicas is not supported yet -- '%s:%s'",
+                       pf->remote->node_addr, pf->remote->pool_desc);
+               return 0;
+       }
+
+       if (*create) {
+               /*
+                * Poolset is just being created - check if file exists
+                * and if we can read it.
+                */
+               int exists = util_file_exists(pf->part->path);
+               if (exists < 0)
+                       return -1;
+
+               if (!exists)
+                       return 0;
+       }
+
+       int ret = badblocks_clear_all(pf->part->path);
+       if (ret < 0) {
+               ERR("clearing bad blocks in the pool file failed -- '%s'",
+                       pf->part->path);
+               errno = EIO;
+               return -1;
+       }
+
+       pf->part->has_bad_blocks = 0;
+
+       return 0;
+}
+
+/*
+ * badblocks_clear_poolset -- clears bad blocks in the pool set
+ */
+int
+badblocks_clear_poolset(struct pool_set *set, int create)
+{
+       LOG(3, "set %p create %i", set, create);
+
+       if (util_poolset_foreach_part_struct(set, badblocks_clear_poolset_cb,
+                                               &create)) {
+               return -1;
+       }
+
+       set->has_bad_blocks = 0;
+
+       return 0;
+}
+
+/*
+ * badblocks_recovery_file_alloc -- allocate name of bad block recovery file,
+ *                                  the allocated name has to be freed
+ *                                  using Free()
+ */
+char *
+badblocks_recovery_file_alloc(const char *file, unsigned rep, unsigned part)
+{
+       LOG(3, "file %s rep %u part %u", file, rep, part);
+
+       char bbs_suffix[64];
+       char *path;
+
+       sprintf(bbs_suffix, "_r%u_p%u_badblocks.txt", rep, part);
+
+       size_t len_file = strlen(file);
+       size_t len_bbs_suffix = strlen(bbs_suffix);
+       size_t len_path = len_file + len_bbs_suffix;
+
+       path = Malloc(len_path + 1);
+       if (path == NULL) {
+               ERR("!Malloc");
+               return NULL;
+       }
+
+       strcpy(path, file);
+       strcat(path, bbs_suffix);
+
+       return path;
+}
+
+/*
+ * badblocks_recovery_file_exists -- check if any bad block recovery file exists
+ *
+ * Returns:
+ *    0 when there are no bad block recovery files and
+ *    1 when there is at least one bad block recovery file.
+ */
+int
+badblocks_recovery_file_exists(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       int recovery_file_exists = 0;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = PART(rep, p)->path;
+
+                       int exists = util_file_exists(path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (!exists) {
+                               /* part file does not exist - skip it */
+                               continue;
+                       }
+
+                       char *rec_file =
+                               badblocks_recovery_file_alloc(set->path, r, p);
+                       if (rec_file == NULL) {
+                               LOG(1,
+                                       "allocating name of bad block recovery file failed");
+                               return -1;
+                       }
+
+                       exists = util_file_exists(rec_file);
+                       if (exists < 0) {
+                               Free(rec_file);
+                               return -1;
+                       }
+
+                       if (exists) {
+                               LOG(3, "bad block recovery file exists: %s",
+                                       rec_file);
+
+                               recovery_file_exists = 1;
+                       }
+
+                       Free(rec_file);
+
+                       if (recovery_file_exists)
+                               return 1;
+               }
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/set_badblocks.h b/ceph/src/pmdk/src/common/set_badblocks.h
new file mode 100644 (file)
index 0000000..dbb59b8
--- /dev/null
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * set_badblocks.h - poolset part of bad blocks API
+ */
+
+#ifndef PMDK_SET_BADBLOCKS_H
+#define PMDK_SET_BADBLOCKS_H 1
+
+#include "set.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int badblocks_check_poolset(struct pool_set *set, int create);
+int badblocks_clear_poolset(struct pool_set *set, int create);
+
+char *badblocks_recovery_file_alloc(const char *file,
+                                       unsigned rep, unsigned part);
+int badblocks_recovery_file_exists(struct pool_set *set);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_SET_BADBLOCKS_H */
diff --git a/ceph/src/pmdk/src/common/shutdown_state.c b/ceph/src/pmdk/src/common/shutdown_state.c
new file mode 100644 (file)
index 0000000..3a2bb11
--- /dev/null
@@ -0,0 +1,234 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * shutdown_state.c -- unsafe shudown detection
+ */
+
+#include <string.h>
+#include <stdbool.h>
+#include <endian.h>
+#include "shutdown_state.h"
+#include "out.h"
+#include "util.h"
+#include "os_deep.h"
+#include "set.h"
+#include "libpmem2.h"
+#include "badblocks.h"
+#include "../libpmem2/pmem2_utils.h"
+
+#define FLUSH_SDS(sds, rep) \
+       if ((rep) != NULL) os_part_deep_common(rep, 0, sds, sizeof(*(sds)), 1)
+
+/*
+ * shutdown_state_checksum -- (internal) counts SDS checksum and flush it
+ */
+static void
+shutdown_state_checksum(struct shutdown_state *sds, struct pool_replica *rep)
+{
+       LOG(3, "sds %p", sds);
+
+       util_checksum(sds, sizeof(*sds), &sds->checksum, 1, 0);
+       FLUSH_SDS(sds, rep);
+}
+
+/*
+ * shutdown_state_init -- initializes shutdown_state struct
+ */
+int
+shutdown_state_init(struct shutdown_state *sds, struct pool_replica *rep)
+{
+       /* check if we didn't change size of shutdown_state accidentally */
+       COMPILE_ERROR_ON(sizeof(struct shutdown_state) != 64);
+       LOG(3, "sds %p", sds);
+
+       memset(sds, 0, sizeof(*sds));
+
+       shutdown_state_checksum(sds, rep);
+
+       return 0;
+}
+
+/*
+ * shutdown_state_add_part -- adds file uuid and usc to shutdown_state struct
+ *
+ * if path does not exist it will fail which does NOT mean shutdown failure
+ */
+int
+shutdown_state_add_part(struct shutdown_state *sds, int fd,
+       struct pool_replica *rep)
+{
+       LOG(3, "sds %p, fd %d", sds, fd);
+
+       size_t len = 0;
+       char *uid;
+       uint64_t usc;
+
+       struct pmem2_source *src;
+
+       if (pmem2_source_from_fd(&src, fd))
+               return 1;
+
+       int ret = pmem2_source_device_usc(src, &usc);
+
+       if (ret == PMEM2_E_NOSUPP) {
+               usc = 0;
+       } else if (ret != 0) {
+               if (ret == -EPERM) {
+                       /* overwrite error message */
+                       ERR(
+                               "Cannot read unsafe shutdown count. For more information please check https://github.com/pmem/pmdk/issues/4207");
+               }
+               LOG(2, "cannot read unsafe shutdown count for %d", fd);
+               goto err;
+       }
+
+       ret = pmem2_source_device_id(src, NULL, &len);
+       if (ret != PMEM2_E_NOSUPP && ret != 0) {
+               ERR("cannot read uuid of %d", fd);
+               goto err;
+       }
+
+       len += 4 - len % 4;
+       uid = Zalloc(len);
+
+       if (uid == NULL) {
+               ERR("!Zalloc");
+               goto err;
+       }
+
+       ret = pmem2_source_device_id(src, uid, &len);
+       if (ret != PMEM2_E_NOSUPP && ret != 0) {
+               ERR("cannot read uuid of %d", fd);
+               Free(uid);
+               goto err;
+       }
+
+       sds->usc = htole64(le64toh(sds->usc) + usc);
+
+       uint64_t tmp;
+       util_checksum(uid, len, &tmp, 1, 0);
+       sds->uuid = htole64(le64toh(sds->uuid) + tmp);
+
+       FLUSH_SDS(sds, rep);
+       Free(uid);
+       pmem2_source_delete(&src);
+       shutdown_state_checksum(sds, rep);
+       return 0;
+err:
+       pmem2_source_delete(&src);
+       return 1;
+}
+
+/*
+ * shutdown_state_set_dirty -- sets dirty pool flag
+ */
+void
+shutdown_state_set_dirty(struct shutdown_state *sds, struct pool_replica *rep)
+{
+       LOG(3, "sds %p", sds);
+
+       sds->dirty = 1;
+       rep->part[0].sds_dirty_modified = 1;
+
+       FLUSH_SDS(sds, rep);
+
+       shutdown_state_checksum(sds, rep);
+}
+
+/*
+ * shutdown_state_clear_dirty -- clears dirty pool flag
+ */
+void
+shutdown_state_clear_dirty(struct shutdown_state *sds, struct pool_replica *rep)
+{
+       LOG(3, "sds %p", sds);
+
+       struct pool_set_part part = rep->part[0];
+       /*
+        * If a dirty flag was set in previous program execution it should be
+        * preserved as it stores information about potential ADR failure.
+        */
+       if (part.sds_dirty_modified != 1)
+               return;
+
+       sds->dirty = 0;
+       part.sds_dirty_modified = 0;
+
+       FLUSH_SDS(sds, rep);
+
+       shutdown_state_checksum(sds, rep);
+}
+
+/*
+ * shutdown_state_reinit -- (internal) reinitializes shutdown_state struct
+ */
+static void
+shutdown_state_reinit(struct shutdown_state *curr_sds,
+       struct shutdown_state *pool_sds, struct pool_replica *rep)
+{
+       LOG(3, "curr_sds %p, pool_sds %p", curr_sds, pool_sds);
+       shutdown_state_init(pool_sds, rep);
+       pool_sds->uuid = htole64(curr_sds->uuid);
+       pool_sds->usc = htole64(curr_sds->usc);
+       pool_sds->dirty = 0;
+
+       FLUSH_SDS(pool_sds, rep);
+
+       shutdown_state_checksum(pool_sds, rep);
+}
+
+/*
+ * shutdown_state_check -- compares and fixes shutdown state
+ */
+int
+shutdown_state_check(struct shutdown_state *curr_sds,
+       struct shutdown_state *pool_sds, struct pool_replica *rep)
+{
+       LOG(3, "curr_sds %p, pool_sds %p", curr_sds, pool_sds);
+
+       if (util_is_zeroed(pool_sds, sizeof(*pool_sds)) &&
+                       !util_is_zeroed(curr_sds, sizeof(*curr_sds))) {
+               shutdown_state_reinit(curr_sds, pool_sds, rep);
+               return 0;
+       }
+
+       bool is_uuid_usc_correct =
+               le64toh(pool_sds->usc) == le64toh(curr_sds->usc) &&
+               le64toh(pool_sds->uuid) == le64toh(curr_sds->uuid);
+
+       bool is_checksum_correct = util_checksum(pool_sds,
+               sizeof(*pool_sds), &pool_sds->checksum, 0, 0);
+
+       int dirty = pool_sds->dirty;
+
+       if (!is_checksum_correct) {
+               /* the program was killed during opening or closing the pool */
+               LOG(2, "incorrect checksum - SDS will be reinitialized");
+               shutdown_state_reinit(curr_sds, pool_sds, rep);
+               return 0;
+       }
+
+       if (is_uuid_usc_correct) {
+               if (dirty == 0)
+                       return 0;
+               /*
+                * the program was killed when the pool was opened
+                * but there wasn't an ADR failure
+                */
+               LOG(2,
+                       "the pool was not closed - SDS will be reinitialized");
+               shutdown_state_reinit(curr_sds, pool_sds, rep);
+               return 0;
+       }
+       if (dirty == 0) {
+               /* an ADR failure but the pool was closed */
+               LOG(2,
+                       "an ADR failure was detected but the pool was closed - SDS will be reinitialized");
+               shutdown_state_reinit(curr_sds, pool_sds, rep);
+               return 0;
+       }
+       /* an ADR failure - the pool might be corrupted */
+       ERR("an ADR failure was detected, the pool might be corrupted");
+       return 1;
+}
diff --git a/ceph/src/pmdk/src/common/shutdown_state.h b/ceph/src/pmdk/src/common/shutdown_state.h
new file mode 100644 (file)
index 0000000..1f9fa4c
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * shutdown_state.h -- unsafe shudown detection
+ */
+
+#ifndef PMDK_SHUTDOWN_STATE_H
+#define PMDK_SHUTDOWN_STATE_H 1
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct pool_replica;
+struct shutdown_state {
+       uint64_t usc;
+       uint64_t uuid; /* UID checksum */
+       uint8_t dirty;
+       uint8_t reserved[39];
+       uint64_t checksum;
+};
+
+int shutdown_state_init(struct shutdown_state *sds, struct pool_replica *rep);
+int shutdown_state_add_part(struct shutdown_state *sds, int fd,
+       struct pool_replica *rep);
+void shutdown_state_set_dirty(struct shutdown_state *sds,
+       struct pool_replica *rep);
+void shutdown_state_clear_dirty(struct shutdown_state *sds,
+       struct pool_replica *rep);
+
+int shutdown_state_check(struct shutdown_state *curr_sds,
+       struct shutdown_state *pool_sds, struct pool_replica *rep);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* shutdown_state.h */
diff --git a/ceph/src/pmdk/src/common/sys_util.h b/ceph/src/pmdk/src/common/sys_util.h
new file mode 100644 (file)
index 0000000..fbe0c10
--- /dev/null
@@ -0,0 +1,315 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * sys_util.h -- internal utility wrappers around system functions
+ */
+
+#ifndef PMDK_SYS_UTIL_H
+#define PMDK_SYS_UTIL_H 1
+
+#include <errno.h>
+
+#include "os_thread.h"
+#include "out.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * util_mutex_init -- os_mutex_init variant that never fails from
+ * caller perspective. If os_mutex_init failed, this function aborts
+ * the program.
+ */
+static inline void
+util_mutex_init(os_mutex_t *m)
+{
+       int tmp = os_mutex_init(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_mutex_init");
+       }
+}
+
+/*
+ * util_mutex_destroy -- os_mutex_destroy variant that never fails from
+ * caller perspective. If os_mutex_destroy failed, this function aborts
+ * the program.
+ */
+static inline void
+util_mutex_destroy(os_mutex_t *m)
+{
+       int tmp = os_mutex_destroy(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_mutex_destroy");
+       }
+}
+
+/*
+ * util_mutex_lock -- os_mutex_lock variant that never fails from
+ * caller perspective. If os_mutex_lock failed, this function aborts
+ * the program.
+ */
+static inline void
+util_mutex_lock(os_mutex_t *m)
+{
+       int tmp = os_mutex_lock(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_mutex_lock");
+       }
+}
+
+/*
+ * util_mutex_trylock -- os_mutex_trylock variant that never fails from
+ * caller perspective (other than EBUSY). If util_mutex_trylock failed, this
+ * function aborts the program.
+ * Returns 0 if locked successfully, otherwise returns EBUSY.
+ */
+static inline int
+util_mutex_trylock(os_mutex_t *m)
+{
+       int tmp = os_mutex_trylock(m);
+       if (tmp && tmp != EBUSY) {
+               errno = tmp;
+               FATAL("!os_mutex_trylock");
+       }
+       return tmp;
+}
+
+/*
+ * util_mutex_unlock -- os_mutex_unlock variant that never fails from
+ * caller perspective. If os_mutex_unlock failed, this function aborts
+ * the program.
+ */
+static inline void
+util_mutex_unlock(os_mutex_t *m)
+{
+       int tmp = os_mutex_unlock(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_mutex_unlock");
+       }
+}
+
+/*
+ * util_rwlock_init -- os_rwlock_init variant that never fails from
+ * caller perspective. If os_rwlock_init failed, this function aborts
+ * the program.
+ */
+static inline void
+util_rwlock_init(os_rwlock_t *m)
+{
+       int tmp = os_rwlock_init(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_rwlock_init");
+       }
+}
+
+/*
+ * util_rwlock_rdlock -- os_rwlock_rdlock variant that never fails from
+ * caller perspective. If os_rwlock_rdlock failed, this function aborts
+ * the program.
+ */
+static inline void
+util_rwlock_rdlock(os_rwlock_t *m)
+{
+       int tmp = os_rwlock_rdlock(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_rwlock_rdlock");
+       }
+}
+
+/*
+ * util_rwlock_wrlock -- os_rwlock_wrlock variant that never fails from
+ * caller perspective. If os_rwlock_wrlock failed, this function aborts
+ * the program.
+ */
+static inline void
+util_rwlock_wrlock(os_rwlock_t *m)
+{
+       int tmp = os_rwlock_wrlock(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_rwlock_wrlock");
+       }
+}
+
+/*
+ * util_rwlock_unlock -- os_rwlock_unlock variant that never fails from
+ * caller perspective. If os_rwlock_unlock failed, this function aborts
+ * the program.
+ */
+static inline void
+util_rwlock_unlock(os_rwlock_t *m)
+{
+       int tmp = os_rwlock_unlock(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_rwlock_unlock");
+       }
+}
+
+/*
+ * util_rwlock_destroy -- os_rwlock_destroy variant that never fails from
+ * caller perspective. If os_rwlock_destroy failed, this function aborts
+ * the program.
+ */
+static inline void
+util_rwlock_destroy(os_rwlock_t *m)
+{
+       int tmp = os_rwlock_destroy(m);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_rwlock_destroy");
+       }
+}
+
+/*
+ * util_spin_init -- os_spin_init variant that logs on fail and sets errno.
+ */
+static inline int
+util_spin_init(os_spinlock_t *lock, int pshared)
+{
+       int tmp = os_spin_init(lock, pshared);
+       if (tmp) {
+               errno = tmp;
+               ERR("!os_spin_init");
+       }
+       return tmp;
+}
+
+/*
+ * util_spin_destroy -- os_spin_destroy variant that never fails from
+ * caller perspective. If os_spin_destroy failed, this function aborts
+ * the program.
+ */
+static inline void
+util_spin_destroy(os_spinlock_t *lock)
+{
+       int tmp = os_spin_destroy(lock);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_spin_destroy");
+       }
+}
+
+/*
+ * util_spin_lock -- os_spin_lock variant that never fails from caller
+ * perspective. If os_spin_lock failed, this function aborts the program.
+ */
+static inline void
+util_spin_lock(os_spinlock_t *lock)
+{
+       int tmp = os_spin_lock(lock);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_spin_lock");
+       }
+}
+
+/*
+ * util_spin_unlock -- os_spin_unlock variant that never fails
+ * from caller perspective. If os_spin_unlock failed,
+ * this function aborts the program.
+ */
+static inline void
+util_spin_unlock(os_spinlock_t *lock)
+{
+       int tmp = os_spin_unlock(lock);
+       if (tmp) {
+               errno = tmp;
+               FATAL("!os_spin_unlock");
+       }
+}
+
+/*
+ * util_semaphore_init -- os_semaphore_init variant that never fails
+ * from caller perspective. If os_semaphore_init failed,
+ * this function aborts the program.
+ */
+static inline void
+util_semaphore_init(os_semaphore_t *sem, unsigned value)
+{
+       if (os_semaphore_init(sem, value))
+               FATAL("!os_semaphore_init");
+}
+
+/*
+ * util_semaphore_destroy -- deletes a semaphore instance
+ */
+static inline void
+util_semaphore_destroy(os_semaphore_t *sem)
+{
+       if (os_semaphore_destroy(sem) != 0)
+               FATAL("!os_semaphore_destroy");
+}
+
+/*
+ * util_semaphore_wait -- decreases the value of the semaphore
+ */
+static inline void
+util_semaphore_wait(os_semaphore_t *sem)
+{
+       errno = 0;
+
+       int ret;
+       do {
+               ret = os_semaphore_wait(sem);
+       } while (errno == EINTR); /* signal interrupt */
+
+       if (ret != 0)
+               FATAL("!os_semaphore_wait");
+}
+
+/*
+ * util_semaphore_trywait -- tries to decrease the value of the semaphore
+ */
+static inline int
+util_semaphore_trywait(os_semaphore_t *sem)
+{
+       errno = 0;
+       int ret;
+       do {
+               ret = os_semaphore_trywait(sem);
+       } while (errno == EINTR); /* signal interrupt */
+
+       if (ret != 0 && errno != EAGAIN)
+               FATAL("!os_semaphore_trywait");
+
+       return ret;
+}
+
+/*
+ * util_semaphore_post -- increases the value of the semaphore
+ */
+static inline void
+util_semaphore_post(os_semaphore_t *sem)
+{
+       if (os_semaphore_post(sem) != 0)
+               FATAL("!os_semaphore_post");
+}
+
+static inline void
+util_cond_init(os_cond_t *__restrict cond)
+{
+       if (os_cond_init(cond))
+               FATAL("!os_cond_init");
+}
+
+static inline void
+util_cond_destroy(os_cond_t *__restrict cond)
+{
+       if (os_cond_destroy(cond))
+               FATAL("!os_cond_destroy");
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/util_pmem.h b/ceph/src/pmdk/src/common/util_pmem.h
new file mode 100644 (file)
index 0000000..a31b6b8
--- /dev/null
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * util_pmem.h -- internal definitions for pmem utils
+ */
+
+#ifndef PMDK_UTIL_PMEM_H
+#define PMDK_UTIL_PMEM_H 1
+
+#include "libpmem.h"
+#include "out.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * util_persist -- flush to persistence
+ */
+static inline void
+util_persist(int is_pmem, const void *addr, size_t len)
+{
+       LOG(3, "is_pmem %d, addr %p, len %zu", is_pmem, addr, len);
+
+       if (is_pmem)
+               pmem_persist(addr, len);
+       else if (pmem_msync(addr, len))
+               FATAL("!pmem_msync");
+}
+
+/*
+ * util_persist_auto -- flush to persistence
+ */
+static inline void
+util_persist_auto(int is_pmem, const void *addr, size_t len)
+{
+       LOG(3, "is_pmem %d, addr %p, len %zu", is_pmem, addr, len);
+
+       util_persist(is_pmem || pmem_is_pmem(addr, len), addr, len);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* util_pmem.h */
diff --git a/ceph/src/pmdk/src/common/uuid.c b/ceph/src/pmdk/src/common/uuid.c
new file mode 100644 (file)
index 0000000..94fdd73
--- /dev/null
@@ -0,0 +1,83 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * uuid.c -- uuid utilities
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "uuid.h"
+#include "out.h"
+
+/*
+ * util_uuid_to_string -- generate a string form of the uuid
+ */
+int
+util_uuid_to_string(const uuid_t u, char *buf)
+{
+       int len; /* size that is returned from sprintf call */
+
+       if (buf == NULL) {
+               LOG(2, "invalid buffer for uuid string");
+               return -1;
+       }
+
+       if (u == NULL) {
+               LOG(2, "invalid uuid structure");
+               return -1;
+       }
+
+       struct uuid *uuid = (struct uuid *)u;
+       len = snprintf(buf, POOL_HDR_UUID_STR_LEN,
+               "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+               uuid->time_low, uuid->time_mid, uuid->time_hi_and_ver,
+               uuid->clock_seq_hi, uuid->clock_seq_low, uuid->node[0],
+               uuid->node[1], uuid->node[2], uuid->node[3], uuid->node[4],
+               uuid->node[5]);
+
+       if (len != POOL_HDR_UUID_STR_LEN - 1) {
+               LOG(2, "snprintf(uuid): %d", len);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * util_uuid_from_string -- generate a binary form of the uuid
+ *
+ * uuid string read from /proc/sys/kernel/random/uuid. UUID string
+ * format example:
+ * f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+ */
+int
+util_uuid_from_string(const char *uuid, struct uuid *ud)
+{
+       if (strlen(uuid) != 36) {
+               LOG(2, "invalid uuid string");
+               return -1;
+       }
+
+       if (uuid[8] != '-' || uuid[13] != '-' || uuid[18] != '-' ||
+                       uuid[23] != '-') {
+               LOG(2, "invalid uuid string");
+               return -1;
+       }
+
+       int n = sscanf(uuid,
+               "%08x-%04hx-%04hx-%02hhx%02hhx-"
+               "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
+               &ud->time_low, &ud->time_mid, &ud->time_hi_and_ver,
+               &ud->clock_seq_hi, &ud->clock_seq_low, &ud->node[0],
+               &ud->node[1], &ud->node[2], &ud->node[3], &ud->node[4],
+               &ud->node[5]);
+
+       if (n != 11) {
+               LOG(2, "sscanf(uuid)");
+               return -1;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/uuid.h b/ceph/src/pmdk/src/common/uuid.h
new file mode 100644 (file)
index 0000000..5d817bb
--- /dev/null
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * uuid.h -- internal definitions for uuid module
+ */
+
+#ifndef PMDK_UUID_H
+#define PMDK_UUID_H 1
+
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Structure for binary version of uuid. From RFC4122,
+ * https://tools.ietf.org/html/rfc4122
+ */
+struct uuid {
+       uint32_t time_low;
+       uint16_t time_mid;
+       uint16_t time_hi_and_ver;
+       uint8_t clock_seq_hi;
+       uint8_t clock_seq_low;
+       uint8_t node[6];
+};
+
+#define POOL_HDR_UUID_LEN      16 /* uuid byte length */
+#define POOL_HDR_UUID_STR_LEN  37 /* uuid string length */
+#define POOL_HDR_UUID_GEN_FILE "/proc/sys/kernel/random/uuid"
+
+typedef unsigned char uuid_t[POOL_HDR_UUID_LEN]; /* 16 byte binary uuid value */
+
+int util_uuid_generate(uuid_t uuid);
+int util_uuid_to_string(const uuid_t u, char *buf);
+int util_uuid_from_string(const char uuid[POOL_HDR_UUID_STR_LEN],
+       struct uuid *ud);
+
+/*
+ * uuidcmp -- compare two uuids
+ */
+static inline int
+uuidcmp(const uuid_t uuid1, const uuid_t uuid2)
+{
+       return memcmp(uuid1, uuid2, POOL_HDR_UUID_LEN);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/common/uuid_freebsd.c b/ceph/src/pmdk/src/common/uuid_freebsd.c
new file mode 100644 (file)
index 0000000..0a771c9
--- /dev/null
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2017, Intel Corporation */
+
+/*
+ * uuid_freebsd.c -- FreeBSD-specific implementation for UUID generation
+ */
+
+#include "uuid.h"
+
+/* XXX Can't include <uuid/uuid.h> because it also defines uuid_t */
+void uuid_generate(uuid_t);
+
+/*
+ * util_uuid_generate -- generate a uuid
+ *
+ * Uses the available FreeBSD uuid_generate library function.
+ */
+int
+util_uuid_generate(uuid_t uuid)
+{
+       uuid_generate(uuid);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/uuid_linux.c b/ceph/src/pmdk/src/common/uuid_linux.c
new file mode 100644 (file)
index 0000000..979e0ad
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2017, Intel Corporation */
+
+/*
+ * uuid_linux.c -- pool set utilities with OS-specific implementation
+ */
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdint.h>
+
+#include "uuid.h"
+#include "os.h"
+#include "out.h"
+
+/*
+ * util_uuid_generate -- generate a uuid
+ *
+ * This function reads the uuid string from  /proc/sys/kernel/random/uuid
+ * It converts this string into the binary uuid format as specified in
+ * https://www.ietf.org/rfc/rfc4122.txt
+ */
+int
+util_uuid_generate(uuid_t uuid)
+{
+       char uu[POOL_HDR_UUID_STR_LEN];
+
+       int fd = os_open(POOL_HDR_UUID_GEN_FILE, O_RDONLY);
+       if (fd < 0) {
+               /* Fatal error */
+               LOG(2, "!open(uuid)");
+               return -1;
+       }
+       ssize_t num = read(fd, uu, POOL_HDR_UUID_STR_LEN);
+       if (num < POOL_HDR_UUID_STR_LEN) {
+               /* Fatal error */
+               LOG(2, "!read(uuid)");
+               os_close(fd);
+               return -1;
+       }
+       os_close(fd);
+
+       uu[POOL_HDR_UUID_STR_LEN - 1] = '\0';
+       int ret = util_uuid_from_string(uu, (struct uuid *)uuid);
+       if (ret < 0)
+               return ret;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/uuid_windows.c b/ceph/src/pmdk/src/common/uuid_windows.c
new file mode 100644 (file)
index 0000000..9c62a70
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2017, Intel Corporation */
+
+/*
+ * uuid_windows.c -- pool set utilities with OS-specific implementation
+ */
+
+#include "uuid.h"
+#include "out.h"
+
+/*
+ * util_uuid_generate -- generate a uuid
+ */
+int
+util_uuid_generate(uuid_t uuid)
+{
+       HRESULT res = CoCreateGuid((GUID *)(uuid));
+       if (res != S_OK) {
+               ERR("CoCreateGuid");
+               return -1;
+       }
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/common/vec.h b/ceph/src/pmdk/src/common/vec.h
new file mode 100644 (file)
index 0000000..c1ba60c
--- /dev/null
@@ -0,0 +1,157 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * vec.h -- vector interface
+ */
+
+#ifndef PMDK_VEC_H
+#define PMDK_VEC_H 1
+
+#include <stddef.h>
+#include "valgrind_internal.h"
+#include "util.h"
+#include "out.h"
+#include "alloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VEC_INIT_SIZE (64)
+
+#define VEC(name, type)\
+struct name {\
+       type *buffer;\
+       size_t size;\
+       size_t capacity;\
+}
+
+#define VEC_INITIALIZER {NULL, 0, 0}
+
+#define VEC_INIT(vec) do {\
+       (vec)->buffer = NULL;\
+       (vec)->size = 0;\
+       (vec)->capacity = 0;\
+} while (0)
+
+#define VEC_MOVE(vecl, vecr) do {\
+       Free((vecl)->buffer);\
+       (vecl)->buffer = (vecr)->buffer;\
+       (vecl)->size = (vecr)->size;\
+       (vecl)->capacity = (vecr)->capacity;\
+       (vecr)->buffer = NULL;\
+       (vecr)->size = 0;\
+       (vecr)->capacity = 0;\
+} while (0)
+
+#define VEC_REINIT(vec) do {\
+       VALGRIND_ANNOTATE_NEW_MEMORY((vec), sizeof(*vec));\
+       VALGRIND_ANNOTATE_NEW_MEMORY((vec)->buffer,\
+               (sizeof(*(vec)->buffer) * ((vec)->capacity)));\
+       (vec)->size = 0;\
+} while (0)
+
+static inline int
+vec_reserve(void *vec, size_t ncapacity, size_t s)
+{
+       size_t ncap = ncapacity == 0 ? VEC_INIT_SIZE : ncapacity;
+       VEC(vvec, void) *vecp = (struct vvec *)vec;
+       void *tbuf = Realloc(vecp->buffer, s * ncap);
+       if (tbuf == NULL) {
+               ERR("!Realloc");
+               return -1;
+       }
+       vecp->buffer = tbuf;
+       vecp->capacity = ncap;
+       return 0;
+}
+
+#define VEC_RESERVE(vec, ncapacity)\
+(((vec)->size == 0 || (ncapacity) > (vec)->size) ?\
+       vec_reserve((void *)vec, ncapacity, sizeof(*(vec)->buffer)) :\
+       0)
+
+#define VEC_POP_BACK(vec) do {\
+       (vec)->size -= 1;\
+} while (0)
+
+#define VEC_FRONT(vec)\
+(vec)->buffer[0]
+
+#define VEC_BACK(vec)\
+(vec)->buffer[(vec)->size - 1]
+
+#define VEC_ERASE_BY_POS(vec, pos) do {\
+       if ((pos) != ((vec)->size - 1))\
+               (vec)->buffer[(pos)] = VEC_BACK(vec);\
+       VEC_POP_BACK(vec);\
+} while (0)
+
+#define VEC_ERASE_BY_PTR(vec, element) do {\
+       if ((element) != &VEC_BACK(vec))\
+               *(element) = VEC_BACK(vec);\
+       VEC_POP_BACK(vec);\
+} while (0)
+
+#define VEC_INSERT(vec, element)\
+((vec)->buffer[(vec)->size - 1] = (element), 0)
+
+#define VEC_INC_SIZE(vec)\
+(((vec)->size++), 0)
+
+#define VEC_INC_BACK(vec)\
+((vec)->capacity == (vec)->size ?\
+       (VEC_RESERVE((vec), ((vec)->capacity * 2)) == 0 ?\
+               VEC_INC_SIZE(vec) : -1) :\
+       VEC_INC_SIZE(vec))
+
+#define VEC_PUSH_BACK(vec, element)\
+(VEC_INC_BACK(vec) == 0? VEC_INSERT(vec, element) : -1)
+
+#define VEC_FOREACH(el, vec)\
+for (size_t _vec_i = 0;\
+       _vec_i < (vec)->size && (((el) = (vec)->buffer[_vec_i]), 1);\
+       ++_vec_i)
+
+#define VEC_FOREACH_REVERSE(el, vec)\
+for (size_t _vec_i = ((vec)->size);\
+       _vec_i != 0 && (((el) = (vec)->buffer[_vec_i - 1]), 1);\
+       --_vec_i)
+
+#define VEC_FOREACH_BY_POS(elpos, vec)\
+for ((elpos) = 0; (elpos) < (vec)->size; ++(elpos))
+
+#define VEC_FOREACH_BY_PTR(el, vec)\
+for (size_t _vec_i = 0;\
+       _vec_i < (vec)->size && (((el) = &(vec)->buffer[_vec_i]), 1);\
+       ++_vec_i)
+
+#define VEC_SIZE(vec)\
+((vec)->size)
+
+#define VEC_CAPACITY(vec)\
+((vec)->capacity)
+
+#define VEC_ARR(vec)\
+((vec)->buffer)
+
+#define VEC_GET(vec, id)\
+(&(vec)->buffer[id])
+
+#define VEC_CLEAR(vec) do {\
+       (vec)->size = 0;\
+} while (0)
+
+#define VEC_DELETE(vec) do {\
+       Free((vec)->buffer);\
+       (vec)->buffer = NULL;\
+       (vec)->size = 0;\
+       (vec)->capacity = 0;\
+} while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_VEC_H */
diff --git a/ceph/src/pmdk/src/common/vecq.h b/ceph/src/pmdk/src/common/vecq.h
new file mode 100644 (file)
index 0000000..98c77b6
--- /dev/null
@@ -0,0 +1,128 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * vecq.h -- vector queue (FIFO) interface
+ */
+
+#ifndef PMDK_VECQ_H
+#define PMDK_VECQ_H 1
+
+#include <stddef.h>
+#include "util.h"
+#include "out.h"
+#include "alloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define VECQ_INIT_SIZE (64)
+
+#define VECQ(name, type)\
+struct name {\
+       type *buffer;\
+       size_t capacity;\
+       size_t front;\
+       size_t back;\
+}
+
+#define VECQ_INIT(vec) do {\
+       (vec)->buffer = NULL;\
+       (vec)->capacity = 0;\
+       (vec)->front = 0;\
+       (vec)->back = 0;\
+} while (0)
+
+#define VECQ_REINIT(vec) do {\
+       VALGRIND_ANNOTATE_NEW_MEMORY((vec), sizeof(*vec));\
+       VALGRIND_ANNOTATE_NEW_MEMORY((vec)->buffer,\
+               (sizeof(*(vec)->buffer) * ((vec)->capacity)));\
+       (vec)->front = 0;\
+       (vec)->back = 0;\
+} while (0)
+
+#define VECQ_FRONT_POS(vec)\
+((vec)->front & ((vec)->capacity - 1))
+
+#define VECQ_BACK_POS(vec)\
+((vec)->back & ((vec)->capacity - 1))
+
+#define VECQ_FRONT(vec)\
+(vec)->buffer[VECQ_FRONT_POS(vec)]
+
+#define VECQ_BACK(vec)\
+(vec)->buffer[VECQ_BACK_POS(vec)]
+
+#define VECQ_DEQUEUE(vec)\
+((vec)->buffer[(((vec)->front++) & ((vec)->capacity - 1))])
+
+#define VECQ_SIZE(vec)\
+((vec)->back - (vec)->front)
+
+static inline int
+realloc_set(void **buf, size_t s)
+{
+       void *tbuf = Realloc(*buf, s);
+       if (tbuf == NULL) {
+               ERR("!Realloc");
+               return -1;
+       }
+       *buf = tbuf;
+       return 0;
+}
+
+#define VECQ_NCAPACITY(vec)\
+((vec)->capacity == 0 ? VECQ_INIT_SIZE : (vec)->capacity * 2)
+#define VECQ_GROW(vec)\
+(realloc_set((void **)&(vec)->buffer,\
+               VECQ_NCAPACITY(vec) * sizeof(*(vec)->buffer)) ? -1 :\
+       (memcpy((vec)->buffer + (vec)->capacity, (vec)->buffer,\
+               VECQ_FRONT_POS(vec) * sizeof(*(vec)->buffer)),\
+       (vec)->front = VECQ_FRONT_POS(vec),\
+       (vec)->back = (vec)->front + (vec)->capacity,\
+       (vec)->capacity = VECQ_NCAPACITY(vec),\
+       0\
+))
+
+#define VECQ_INSERT(vec, element)\
+(VECQ_BACK(vec) = element, (vec)->back += 1, 0)
+
+#define VECQ_ENQUEUE(vec, element)\
+((vec)->capacity == VECQ_SIZE(vec) ?\
+       (VECQ_GROW(vec) == 0 ? VECQ_INSERT(vec, element) : -1) :\
+VECQ_INSERT(vec, element))
+
+#define VECQ_CAPACITY(vec)\
+((vec)->capacity)
+
+#define VECQ_FOREACH(el, vec)\
+for (size_t _vec_i = 0;\
+       _vec_i < VECQ_SIZE(vec) &&\
+       (((el) = (vec)->buffer[_vec_i & ((vec)->capacity - 1)]), 1);\
+       ++_vec_i)
+
+#define VECQ_FOREACH_REVERSE(el, vec)\
+for (size_t _vec_i = VECQ_SIZE(vec);\
+       _vec_i > 0 &&\
+       (((el) = (vec)->buffer[(_vec_i - 1) & ((vec)->capacity - 1)]), 1);\
+       --_vec_i)
+
+#define VECQ_CLEAR(vec) do {\
+       (vec)->front = 0;\
+       (vec)->back = 0;\
+} while (0)
+
+#define VECQ_DELETE(vec) do {\
+       Free((vec)->buffer);\
+       (vec)->buffer = NULL;\
+       (vec)->capacity = 0;\
+       (vec)->front = 0;\
+       (vec)->back = 0;\
+} while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_VECQ_H */
diff --git a/ceph/src/pmdk/src/core/Makefile b/ceph/src/pmdk/src/core/Makefile
new file mode 100644 (file)
index 0000000..c752655
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020, Intel Corporation
+
+#
+# src/core/Makefile -- Makefile for core
+#
+
+LIBRARY_NAME = pmemcore
+
+include pmemcore.inc
+
+include ../Makefile.inc
diff --git a/ceph/src/pmdk/src/core/alloc.c b/ceph/src/pmdk/src/core/alloc.c
new file mode 100644 (file)
index 0000000..e267e4e
--- /dev/null
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+#include <errno.h>
+
+#include "alloc.h"
+#include "fault_injection.h"
+#include "out.h"
+
+Malloc_func fn_malloc = malloc;
+Realloc_func fn_realloc = realloc;
+
+#if FAULT_INJECTION
+static __thread int malloc_num;
+static __thread int fail_malloc_num;
+static __thread const char *fail_malloc_from;
+
+void *
+_flt_Malloc(size_t size, const char *func)
+{
+       if (fail_malloc_from && strcmp(func, fail_malloc_from) == 0) {
+               if (++malloc_num == fail_malloc_num) {
+                       errno = ENOMEM;
+                       return NULL;
+               }
+       }
+       return fn_malloc(size);
+}
+
+static __thread int realloc_num;
+static __thread int fail_realloc_num;
+static __thread const char *fail_realloc_from;
+
+void *
+_flt_Realloc(void *ptr, size_t size, const char *func)
+{
+       if (fail_realloc_from && strcmp(func, fail_realloc_from) == 0) {
+               if (++realloc_num == fail_realloc_num) {
+                       errno = ENOMEM;
+                       return NULL;
+               }
+       }
+       return fn_realloc(ptr, size);
+}
+
+void
+core_inject_fault_at(enum pmem_allocation_type type, int nth, const char *at)
+{
+       switch (type) {
+               case PMEM_MALLOC:
+                       malloc_num = 0;
+                       fail_malloc_num = nth;
+                       fail_malloc_from = at;
+                       break;
+               case PMEM_REALLOC:
+                       realloc_num = 0;
+                       fail_realloc_num = nth;
+                       fail_realloc_from = at;
+                       break;
+               default:
+                       FATAL("unknown allocation type");
+       }
+}
+
+int
+core_fault_injection_enabled(void)
+{
+       return 1;
+}
+#else
+void *_Malloc(size_t size) {
+       return fn_malloc(size);
+}
+
+void *_Realloc(void *ptr, size_t size) {
+       return fn_realloc(ptr, size);
+}
+#endif
+
+void set_func_malloc(void *(*malloc_func)(size_t size)) {
+       fn_malloc = (malloc_func == NULL) ? malloc : malloc_func;
+}
+
+void set_func_realloc(void *(*realloc_func)(void *ptr, size_t size)) {
+       fn_realloc = (realloc_func == NULL) ? realloc : realloc_func;
+}
+
+/*
+ * our versions of malloc & friends start off pointing to the libc versions
+ */
+Free_func Free = free;
+Strdup_func Strdup = strdup;
+
+/*
+ * Zalloc -- allocate zeroed memory
+ */
+void *
+Zalloc(size_t sz)
+{
+       void *ret = Malloc(sz);
+       if (!ret)
+               return NULL;
+       return memset(ret, 0, sz);
+}
+
+/*
+ * util_set_alloc_funcs -- allow one to override malloc, etc.
+ */
+void
+util_set_alloc_funcs(void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s))
+{
+       set_func_malloc(malloc_func);
+       Free = (free_func == NULL) ? free : free_func;
+       set_func_realloc(realloc_func);
+       Strdup = (strdup_func == NULL) ? strdup : strdup_func;
+}
diff --git a/ceph/src/pmdk/src/core/alloc.h b/ceph/src/pmdk/src/core/alloc.h
new file mode 100644 (file)
index 0000000..a3c5c2b
--- /dev/null
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+#ifndef COMMON_ALLOC_H
+#define COMMON_ALLOC_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*Malloc_func)(size_t size);
+typedef void *(*Realloc_func)(void *ptr, size_t size);
+
+extern Malloc_func fn_malloc;
+extern Realloc_func fn_realloc;
+
+#if FAULT_INJECTION
+void *_flt_Malloc(size_t, const char *);
+void *_flt_Realloc(void *, size_t, const char *);
+
+#define Malloc(size) _flt_Malloc(size, __func__)
+#define Realloc(ptr, size) _flt_Realloc(ptr, size, __func__)
+#else
+void *_Malloc(size_t);
+void *_Realloc(void *, size_t);
+
+#define Malloc(size) _Malloc(size)
+#define Realloc(ptr, size) _Realloc(ptr, size)
+#endif
+
+void set_func_malloc(void *(*malloc_func)(size_t size));
+void set_func_realloc(void *(*realloc_func)(void *ptr, size_t size));
+
+/*
+ * overridable names for malloc & friends used by this library
+ */
+typedef void (*Free_func)(void *ptr);
+typedef char *(*Strdup_func)(const char *s);
+
+extern Free_func Free;
+extern Strdup_func Strdup;
+extern void *Zalloc(size_t sz);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/ceph/src/pmdk/src/core/errno_freebsd.h b/ceph/src/pmdk/src/core/errno_freebsd.h
new file mode 100644 (file)
index 0000000..e207aba
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * errno_freebsd.h -- map Linux errno's to something close on FreeBSD
+ */
+
+#ifndef PMDK_ERRNO_FREEBSD_H
+#define PMDK_ERRNO_FREEBSD_H 1
+
+#ifdef __FreeBSD__
+#define EBADFD EBADF
+#define ELIBACC EINVAL
+#define EMEDIUMTYPE EOPNOTSUPP
+#define ENOMEDIUM ENODEV
+#define EREMOTEIO EIO
+#endif
+
+#endif /* PMDK_ERRNO_FREEBSD_H */
diff --git a/ceph/src/pmdk/src/core/fault_injection.h b/ceph/src/pmdk/src/core/fault_injection.h
new file mode 100644 (file)
index 0000000..748d1ab
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+#ifndef CORE_FAULT_INJECTION
+#define CORE_FAULT_INJECTION
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum pmem_allocation_type { PMEM_MALLOC, PMEM_REALLOC };
+
+#if FAULT_INJECTION
+void core_inject_fault_at(enum pmem_allocation_type type,
+       int nth, const char *at);
+
+int core_fault_injection_enabled(void);
+
+#else
+static inline void
+core_inject_fault_at(enum pmem_allocation_type type, int nth, const char *at)
+{
+       abort();
+}
+
+static inline int
+core_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/core/fs.h b/ceph/src/pmdk/src/core/fs.h
new file mode 100644 (file)
index 0000000..2323204
--- /dev/null
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * fs.h -- file system traversal abstraction layer
+ */
+
+#ifndef PMDK_FS_H
+#define PMDK_FS_H 1
+
+#include <unistd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct fs;
+
+enum fs_entry_type {
+       FS_ENTRY_FILE,
+       FS_ENTRY_DIRECTORY,
+       FS_ENTRY_SYMLINK,
+       FS_ENTRY_OTHER,
+
+       MAX_FS_ENTRY_TYPES
+};
+
+struct fs_entry {
+       enum fs_entry_type type;
+
+       const char *name;
+       size_t namelen;
+
+       const char *path;
+       size_t pathlen;
+       /* the depth of the traversal */
+       /* XXX long on FreeBSD. Linux uses short. No harm in it being bigger */
+       long level;
+};
+
+struct fs *fs_new(const char *path);
+void fs_delete(struct fs *f);
+
+/* this call invalidates the previous entry */
+struct fs_entry *fs_read(struct fs *f);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_FS_H */
diff --git a/ceph/src/pmdk/src/core/fs_posix.c b/ceph/src/pmdk/src/core/fs_posix.c
new file mode 100644 (file)
index 0000000..ec27f43
--- /dev/null
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * fs_posix.c -- file system traversal Posix implementation
+ */
+
+#include <fts.h>
+#include "util.h"
+#include "out.h"
+#include "vec.h"
+#include "fs.h"
+
+struct fs {
+       FTS *ft;
+       struct fs_entry entry;
+};
+
+/*
+ * fs_new -- creates fs traversal instance
+ */
+struct fs *
+fs_new(const char *path)
+{
+       struct fs *f = Zalloc(sizeof(*f));
+       if (f == NULL)
+               goto error_fs_alloc;
+
+       const char *paths[2] = {path, NULL};
+       f->ft = fts_open((char * const *)paths, FTS_COMFOLLOW | FTS_XDEV, NULL);
+       if (f->ft == NULL)
+               goto error_fts_open;
+
+       return f;
+
+error_fts_open:
+       Free(f);
+error_fs_alloc:
+       return NULL;
+}
+
+/*
+ * fs_read -- reads an entry from the fs path
+ */
+struct fs_entry *
+fs_read(struct fs *f)
+{
+       FTSENT *entry = fts_read(f->ft);
+       if (entry == NULL)
+               return NULL;
+
+       switch (entry->fts_info) {
+       case FTS_D:
+               f->entry.type = FS_ENTRY_DIRECTORY;
+               break;
+       case FTS_F:
+               f->entry.type = FS_ENTRY_FILE;
+               break;
+       case FTS_SL:
+               f->entry.type = FS_ENTRY_SYMLINK;
+               break;
+       default:
+               f->entry.type = FS_ENTRY_OTHER;
+               break;
+       }
+
+       f->entry.name = entry->fts_name;
+       f->entry.namelen = entry->fts_namelen;
+       f->entry.path = entry->fts_path;
+       f->entry.pathlen = entry->fts_pathlen;
+       f->entry.level = entry->fts_level;
+
+       return &f->entry;
+}
+
+/*
+ * fs_delete -- deletes a fs traversal instance
+ */
+void
+fs_delete(struct fs *f)
+{
+       fts_close(f->ft);
+       Free(f);
+}
diff --git a/ceph/src/pmdk/src/core/fs_windows.c b/ceph/src/pmdk/src/core/fs_windows.c
new file mode 100644 (file)
index 0000000..5fb7c25
--- /dev/null
@@ -0,0 +1,123 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * fs_windows.c -- file system traversal windows implementation
+ */
+
+#include <windows.h>
+#include "alloc.h"
+#include "fs.h"
+#include "out.h"
+#include "util.h"
+
+struct fs {
+       size_t dirlen;
+       WIN32_FIND_DATAW ffd;
+       HANDLE hFind;
+       int first_done;
+       const char *dir;
+
+       struct fs_entry entry;
+};
+
+/*
+ * fs_new -- creates fs traversal instance
+ */
+struct fs *
+fs_new(const char *path)
+{
+       size_t pathlen = strlen(path);
+       char *search_path = Malloc(strlen(path) + sizeof("\\*\0"));
+       if (search_path == NULL)
+               goto error_spath_alloc;
+
+       strcpy(search_path, path);
+       strcpy(search_path + pathlen, "\\*\0");
+
+       wchar_t *pathw = util_toUTF16(search_path);
+       if (pathw == NULL)
+               goto error_path_alloc;
+
+       struct fs *f = Zalloc(sizeof(*f));
+       if (f == NULL)
+               goto error_fs_alloc;
+
+       f->first_done = 0;
+
+       f->hFind = FindFirstFileW(pathw, &f->ffd);
+       if (f->hFind == INVALID_HANDLE_VALUE)
+               goto error_fff;
+
+       f->dir = path;
+       f->dirlen = pathlen;
+       util_free_UTF16(pathw);
+       Free(search_path);
+
+       return f;
+
+error_fff:
+       Free(f);
+error_fs_alloc:
+       util_free_UTF16(pathw);
+error_path_alloc:
+       Free(search_path);
+error_spath_alloc:
+       return NULL;
+}
+
+/*
+ * fs_read -- reads an entry from the fs path
+ */
+struct fs_entry *
+fs_read(struct fs *f)
+{
+       util_free_UTF8((char *)f->entry.name);
+       Free((char *)f->entry.path);
+       f->entry.name = NULL;
+       f->entry.path = NULL;
+
+       if (f->first_done) {
+               if (FindNextFileW(f->hFind, &f->ffd) == 0)
+                       return NULL;
+       } else {
+               f->first_done = 1;
+       }
+
+       if (f->ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+               f->entry.type = FS_ENTRY_DIRECTORY;
+       else
+               f->entry.type = FS_ENTRY_FILE;
+
+       f->entry.name = util_toUTF8(f->ffd.cFileName);
+       if (f->entry.name == NULL)
+               return NULL;
+       f->entry.namelen = strnlen(f->entry.name, MAX_PATH);
+
+       f->entry.pathlen = f->dirlen + f->entry.namelen + 1;
+       char *path = Zalloc(f->entry.pathlen + 1);
+       if (path == NULL) {
+               util_free_UTF8((char *)f->entry.name);
+               return NULL;
+       }
+       strcpy(path, f->dir);
+       path[f->dirlen] = '\\';
+       strcpy(path + f->dirlen + 1, f->entry.name);
+       f->entry.path = path;
+       f->entry.level = 1;
+
+       return &f->entry;
+}
+
+/*
+ * fs_delete -- deletes a fs traversal instance
+ */
+void
+fs_delete(struct fs *f)
+{
+       util_free_UTF8((char *)f->entry.name);
+       Free((char *)f->entry.path);
+
+       FindClose(f->hFind);
+       Free(f);
+}
diff --git a/ceph/src/pmdk/src/core/libpmemcore.vcxproj b/ceph/src/pmdk/src/core/libpmemcore.vcxproj
new file mode 100644 (file)
index 0000000..e2b1020
--- /dev/null
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="alloc.c" />
+    <ClCompile Include="fs_windows.c" />
+    <ClCompile Include="os_thread_windows.c" />
+    <ClCompile Include="os_windows.c" />
+    <ClCompile Include="out.c" />
+    <ClCompile Include="util.c" />
+    <ClCompile Include="util_windows.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="alloc.h" />
+    <ClInclude Include="errno_freebsd.h" />
+    <ClInclude Include="fault_injection.h" />
+    <ClInclude Include="fs.h" />
+    <ClInclude Include="os.h" />
+    <ClInclude Include="os_thread.h" />
+    <ClInclude Include="out.h" />
+    <ClInclude Include="pmemcore.h" />
+    <ClInclude Include="util.h" />
+    <ClInclude Include="util_pmem.h" />
+    <ClInclude Include="valgrind_internal.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{2FA3155B-6F26-4D15-AC03-9D82D48DBC42}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libpmemcore</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.lib</TargetExt>
+    <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);.;</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetExt>.lib</TargetExt>
+    <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);.;</IncludePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>PMDK_UTF8_API;NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsC</CompileAs>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <ExceptionHandling>false</ExceptionHandling>
+      <TreatWarningAsError>true</TreatWarningAsError>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>PMDK_UTF8_API;NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsC</CompileAs>
+      <Optimization>MaxSpeed</Optimization>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <ExceptionHandling>false</ExceptionHandling>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <TreatWarningAsError>true</TreatWarningAsError>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <Lib>
+      <AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/core/libpmemcore.vcxproj.filters b/ceph/src/pmdk/src/core/libpmemcore.vcxproj.filters
new file mode 100644 (file)
index 0000000..7907f89
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="errno_freebsd.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pmemcore.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="util_pmem.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/core/os.h b/ceph/src/pmdk/src/core/os.h
new file mode 100644 (file)
index 0000000..9e984d9
--- /dev/null
@@ -0,0 +1,115 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * os.h -- os abstraction layer
+ */
+
+#ifndef PMDK_OS_H
+#define PMDK_OS_H 1
+
+#include <sys/stat.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "errno_freebsd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _WIN32
+#define OS_DIR_SEPARATOR '/'
+#define OS_DIR_SEP_STR "/"
+#else
+#define OS_DIR_SEPARATOR '\\'
+#define OS_DIR_SEP_STR "\\"
+#endif
+
+#ifndef _WIN32
+
+/* madvise() */
+#ifdef __FreeBSD__
+#define os_madvise minherit
+#define MADV_DONTFORK INHERIT_NONE
+#else
+#define os_madvise madvise
+#endif
+
+/* dlopen() */
+#ifdef __FreeBSD__
+#define RTLD_DEEPBIND 0        /* XXX */
+#endif
+
+/* major(), minor() */
+#ifdef __FreeBSD__
+#define os_major (unsigned)major
+#define os_minor (unsigned)minor
+#else
+#define os_major major
+#define os_minor minor
+#endif
+
+#endif /* #ifndef _WIN32 */
+
+struct iovec;
+
+/* os_flock */
+#define OS_LOCK_SH 1
+#define OS_LOCK_EX 2
+#define OS_LOCK_NB 4
+#define OS_LOCK_UN 8
+
+#ifndef _WIN32
+typedef struct stat os_stat_t;
+#define os_fstat       fstat
+#define os_lseek       lseek
+#else
+typedef struct _stat64 os_stat_t;
+#define os_fstat       _fstat64
+#define os_lseek       _lseeki64
+#endif
+
+#define os_close close
+#define os_fclose fclose
+
+#ifndef _WIN32
+typedef off_t os_off_t;
+#else
+/* XXX: os_off_t defined in platform.h */
+#endif
+int os_open(const char *pathname, int flags, ...);
+int os_fsync(int fd);
+int os_fsync_dir(const char *dir_name);
+int os_stat(const char *pathname, os_stat_t *buf);
+int os_unlink(const char *pathname);
+int os_access(const char *pathname, int mode);
+FILE *os_fopen(const char *pathname, const char *mode);
+FILE *os_fdopen(int fd, const char *mode);
+int os_chmod(const char *pathname, mode_t mode);
+int os_mkstemp(char *temp);
+int os_posix_fallocate(int fd, os_off_t offset, os_off_t len);
+int os_ftruncate(int fd, os_off_t length);
+int os_flock(int fd, int operation);
+ssize_t os_writev(int fd, const struct iovec *iov, int iovcnt);
+int os_clock_gettime(int id, struct timespec *ts);
+unsigned os_rand_r(unsigned *seedp);
+int os_unsetenv(const char *name);
+int os_setenv(const char *name, const char *value, int overwrite);
+char *os_getenv(const char *name);
+const char *os_strsignal(int sig);
+int os_execv(const char *path, char *const argv[]);
+
+/*
+ * XXX: missing APis (used in ut_file.c)
+ *
+ * rename
+ * read
+ * write
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* os.h */
diff --git a/ceph/src/pmdk/src/core/os_posix.c b/ceph/src/pmdk/src/core/os_posix.c
new file mode 100644 (file)
index 0000000..c953a40
--- /dev/null
@@ -0,0 +1,353 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * os_posix.c -- abstraction layer for basic Posix functions
+ */
+
+#define _GNU_SOURCE
+
+#include <fcntl.h>
+#include <stdarg.h>
+#include <sys/file.h>
+#ifdef __FreeBSD__
+#include <sys/mount.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <errno.h>
+#include "util.h"
+#include "out.h"
+#include "os.h"
+
+/*
+ * os_open -- open abstraction layer
+ */
+int
+os_open(const char *pathname, int flags, ...)
+{
+       int mode_required = (flags & O_CREAT) == O_CREAT;
+
+#ifdef O_TMPFILE
+       mode_required |= (flags & O_TMPFILE) == O_TMPFILE;
+#endif
+
+       if (mode_required) {
+               va_list arg;
+               va_start(arg, flags);
+               /* Clang requires int due to auto-promotion */
+               int mode = va_arg(arg, int);
+               va_end(arg);
+               return open(pathname, flags, (mode_t)mode);
+       } else {
+               return open(pathname, flags);
+       }
+}
+
+/*
+ * os_fsync -- fsync abstraction layer
+ */
+int
+os_fsync(int fd)
+{
+       return fsync(fd);
+}
+
+/*
+ * os_fsync_dir -- fsync the directory
+ */
+int
+os_fsync_dir(const char *dir_name)
+{
+       int fd = os_open(dir_name, O_RDONLY | O_DIRECTORY);
+       if (fd < 0)
+               return -1;
+
+       int ret = os_fsync(fd);
+
+       os_close(fd);
+
+       return ret;
+}
+
+/*
+ * os_stat -- stat abstraction layer
+ */
+int
+os_stat(const char *pathname, os_stat_t *buf)
+{
+       return stat(pathname, buf);
+}
+
+/*
+ * os_unlink -- unlink abstraction layer
+ */
+int
+os_unlink(const char *pathname)
+{
+       return unlink(pathname);
+}
+
+/*
+ * os_access -- access abstraction layer
+ */
+int
+os_access(const char *pathname, int mode)
+{
+       return access(pathname, mode);
+}
+
+/*
+ * os_fopen -- fopen abstraction layer
+ */
+FILE *
+os_fopen(const char *pathname, const char *mode)
+{
+       return fopen(pathname, mode);
+}
+
+/*
+ * os_fdopen -- fdopen abstraction layer
+ */
+FILE *
+os_fdopen(int fd, const char *mode)
+{
+       return fdopen(fd, mode);
+}
+
+/*
+ * os_chmod -- chmod abstraction layer
+ */
+int
+os_chmod(const char *pathname, mode_t mode)
+{
+       return chmod(pathname, mode);
+}
+
+/*
+ * os_mkstemp -- mkstemp abstraction layer
+ */
+int
+os_mkstemp(char *temp)
+{
+       return mkstemp(temp);
+}
+
+/*
+ * os_posix_fallocate -- posix_fallocate abstraction layer
+ */
+int
+os_posix_fallocate(int fd, os_off_t offset, off_t len)
+{
+
+#ifdef __FreeBSD__
+       struct stat fbuf;
+       struct statfs fsbuf;
+/*
+ * XXX Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223287
+ *
+ *     FreeBSD implements posix_fallocate with a simple block allocation/zero
+ *     loop. If the requested size is unreasonably large, this can result in
+ *     an uninterruptable system call that will suck up all the space in the
+ *     file system and could take hours to fail. To avoid this, make a crude
+ *     check to see if the requested allocation is larger than the available
+ *     space in the file system (minus any blocks already allocated to the
+ *     file), and if so, immediately return ENOSPC. We do the check only if
+ *     the offset is 0; otherwise, trying to figure out how many additional
+ *     blocks are required is too complicated.
+ *
+ *     This workaround is here mostly to fail "absurdly" large requests for
+ *     testing purposes; however, it is coded to allow normal (albeit slow)
+ *     operation if the space can actually be allocated. Because of the way
+ *     PMDK uses posix_fallocate, supporting Linux-style fallocate in
+ *     FreeBSD should be considered.
+ */
+       if (offset == 0) {
+               if (fstatfs(fd, &fsbuf) == -1 || fstat(fd, &fbuf) == -1)
+                       return errno;
+
+               size_t reqd_blocks =
+                       ((size_t)len + (fsbuf.f_bsize - 1)) / fsbuf.f_bsize;
+               if (fbuf.st_blocks > 0) {
+                       if (reqd_blocks >= (size_t)fbuf.st_blocks)
+                               reqd_blocks -= (size_t)fbuf.st_blocks;
+                       else
+                               reqd_blocks = 0;
+               }
+               if (reqd_blocks > (size_t)fsbuf.f_bavail)
+                       return ENOSPC;
+       }
+#endif
+
+/*
+ *     First, try to alloc the whole thing in one go.  This allows ENOSPC to
+ *     fail immediately -- allocating piece by piece would fill the storage
+ *     just to abort halfway.
+ */
+       int err = posix_fallocate(fd, offset, len);
+       if (err != ENOMEM && err != EINTR)
+               return err;
+
+/*
+ *     Workaround for a bug in tmpfs where it fails large but reasonable
+ *     requests that exceed available DRAM but fit within swap space.  And
+ *     even if a request fits within DRAM, tmpfs will evict other tasks
+ *     just to reserve space.
+ *
+ *     We also want to survive random unrelated signals.  Profilers spam
+ *     the program with SIGVTALRM/SIGPROF, anything run from a terminal can
+ *     receive SIGNWINCH, etc.  As fallocate is a long-running syscall,
+ *     let's restart it, but in a way that avoids infinite loops.
+ *
+ *     Thus:
+ *     * limit a single syscall to 1GB
+ *     * ignore sporadic signals
+ *     * on repeated failures, start reducing syscall size
+ *     * ... but not below 1MB
+ */
+       os_off_t chunk = 1LL << 30; /* 1GB */
+       int tries = 0;
+
+       while (len) {
+               if (chunk > len)
+                       chunk = len;
+
+               int err = posix_fallocate(fd, offset, chunk);
+               if (!err) {
+                       offset += chunk;
+                       len -= chunk;
+                       tries = 0;
+               } else if (err != ENOMEM && err != EINTR) {
+                       return err;
+               } else if (++tries == 5) {
+                       tries = 0;
+                       chunk /= 2;
+
+                       /*
+                        * Within memory pressure or a signal storm, small
+                        * allocs are more likely to get through, but once we
+                        * get this small, something is badly wrong.
+                        */
+                       if (chunk < 1LL << 20) /* 1MB */
+                               return err;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * os_ftruncate -- ftruncate abstraction layer
+ */
+int
+os_ftruncate(int fd, os_off_t length)
+{
+       return ftruncate(fd, length);
+}
+
+/*
+ * os_flock -- flock abstraction layer
+ */
+int
+os_flock(int fd, int operation)
+{
+       int opt = 0;
+       if (operation & OS_LOCK_EX)
+               opt |= LOCK_EX;
+       if (operation & OS_LOCK_SH)
+               opt |= LOCK_SH;
+       if (operation & OS_LOCK_UN)
+               opt |= LOCK_UN;
+       if (operation & OS_LOCK_NB)
+               opt |= LOCK_NB;
+
+       return flock(fd, opt);
+}
+
+/*
+ * os_writev -- writev abstraction layer
+ */
+ssize_t
+os_writev(int fd, const struct iovec *iov, int iovcnt)
+{
+       return writev(fd, iov, iovcnt);
+}
+
+/*
+ * os_clock_gettime -- clock_gettime abstraction layer
+ */
+int
+os_clock_gettime(int id, struct timespec *ts)
+{
+       return clock_gettime(id, ts);
+}
+
+/*
+ * os_rand_r -- rand_r abstraction layer
+ */
+unsigned
+os_rand_r(unsigned *seedp)
+{
+       return (unsigned)rand_r(seedp);
+}
+
+/*
+ * os_unsetenv -- unsetenv abstraction layer
+ */
+int
+os_unsetenv(const char *name)
+{
+       return unsetenv(name);
+}
+
+/*
+ * os_setenv -- setenv abstraction layer
+ */
+int
+os_setenv(const char *name, const char *value, int overwrite)
+{
+       return setenv(name, value, overwrite);
+}
+
+/*
+ * secure_getenv -- provide GNU secure_getenv for FreeBSD
+ */
+#if defined(__FreeBSD__)
+static char *
+secure_getenv(const char *name)
+{
+       if (issetugid() != 0)
+               return NULL;
+
+       return getenv(name);
+}
+#endif
+
+/*
+ * os_getenv -- getenv abstraction layer
+ */
+char *
+os_getenv(const char *name)
+{
+       return secure_getenv(name);
+}
+
+/*
+ * os_strsignal -- strsignal abstraction layer
+ */
+const char *
+os_strsignal(int sig)
+{
+       return strsignal(sig);
+}
+
+int
+os_execv(const char *path, char *const argv[])
+{
+       return execv(path, argv);
+}
diff --git a/ceph/src/pmdk/src/core/os_thread.h b/ceph/src/pmdk/src/core/os_thread.h
new file mode 100644 (file)
index 0000000..7369a49
--- /dev/null
@@ -0,0 +1,181 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * os_thread.h -- os thread abstraction layer
+ */
+
+#ifndef OS_THREAD_H
+#define OS_THREAD_H 1
+
+#include <stdint.h>
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef union {
+       long long align;
+       char padding[44]; /* linux: 40 windows: 44 */
+} os_mutex_t;
+
+typedef union {
+       long long align;
+       char padding[56]; /* linux: 56 windows: 13 */
+} os_rwlock_t;
+
+typedef union {
+       long long align;
+       char padding[48]; /* linux: 48 windows: 12 */
+} os_cond_t;
+
+typedef union {
+       long long align;
+       char padding[32]; /* linux: 8 windows: 32 */
+} os_thread_t;
+
+typedef union {
+       long long align;  /* linux: long windows: 8 FreeBSD: 12 */
+       char padding[16]; /* 16 to be safe */
+} os_once_t;
+
+#define OS_ONCE_INIT { .padding = {0} }
+
+typedef unsigned os_tls_key_t;
+
+typedef union {
+       long long align;
+       char padding[56];  /* linux: 56 windows: 8 */
+} os_semaphore_t;
+
+typedef union {
+       long long align;
+       char padding[56];  /* linux: 56 windows: 8 */
+} os_thread_attr_t;
+
+typedef union {
+       long long align;
+       char padding[512];
+} os_cpu_set_t;
+
+#ifdef __FreeBSD__
+#define cpu_set_t cpuset_t
+typedef uintptr_t os_spinlock_t;
+#else
+typedef volatile int os_spinlock_t; /* XXX: not implemented on windows */
+#endif
+
+void os_cpu_zero(os_cpu_set_t *set);
+void os_cpu_set(size_t cpu, os_cpu_set_t *set);
+
+#ifndef _WIN32
+#define _When_(...)
+#endif
+int os_once(os_once_t *o, void (*func)(void));
+
+int os_tls_key_create(os_tls_key_t *key, void (*destructor)(void *));
+int os_tls_key_delete(os_tls_key_t key);
+int os_tls_set(os_tls_key_t key, const void *value);
+void *os_tls_get(os_tls_key_t key);
+
+int os_mutex_init(os_mutex_t *__restrict mutex);
+int os_mutex_destroy(os_mutex_t *__restrict mutex);
+_When_(return == 0, _Acquires_lock_(mutex->lock))
+int os_mutex_lock(os_mutex_t *__restrict mutex);
+_When_(return == 0, _Acquires_lock_(mutex->lock))
+int os_mutex_trylock(os_mutex_t *__restrict mutex);
+int os_mutex_unlock(os_mutex_t *__restrict mutex);
+
+/* XXX - non POSIX */
+int os_mutex_timedlock(os_mutex_t *__restrict mutex,
+       const struct timespec *abstime);
+
+int os_rwlock_init(os_rwlock_t *__restrict rwlock);
+int os_rwlock_destroy(os_rwlock_t *__restrict rwlock);
+int os_rwlock_rdlock(os_rwlock_t *__restrict rwlock);
+int os_rwlock_wrlock(os_rwlock_t *__restrict rwlock);
+int os_rwlock_tryrdlock(os_rwlock_t *__restrict rwlock);
+_When_(return == 0, _Acquires_exclusive_lock_(rwlock->lock))
+int os_rwlock_trywrlock(os_rwlock_t *__restrict rwlock);
+_When_(rwlock->is_write != 0, _Requires_exclusive_lock_held_(rwlock->lock))
+_When_(rwlock->is_write == 0, _Requires_shared_lock_held_(rwlock->lock))
+int os_rwlock_unlock(os_rwlock_t *__restrict rwlock);
+int os_rwlock_timedrdlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime);
+int os_rwlock_timedwrlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime);
+
+int os_spin_init(os_spinlock_t *lock, int pshared);
+int os_spin_destroy(os_spinlock_t *lock);
+int os_spin_lock(os_spinlock_t *lock);
+int os_spin_unlock(os_spinlock_t *lock);
+int os_spin_trylock(os_spinlock_t *lock);
+
+int os_cond_init(os_cond_t *__restrict cond);
+int os_cond_destroy(os_cond_t *__restrict cond);
+int os_cond_broadcast(os_cond_t *__restrict cond);
+int os_cond_signal(os_cond_t *__restrict cond);
+int os_cond_timedwait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex, const struct timespec *abstime);
+int os_cond_wait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex);
+
+/* threading */
+
+int os_thread_create(os_thread_t *thread, const os_thread_attr_t *attr,
+       void *(*start_routine)(void *), void *arg);
+
+int os_thread_join(os_thread_t *thread, void **result);
+
+void os_thread_self(os_thread_t *thread);
+
+/* thread affinity */
+
+int os_thread_setaffinity_np(os_thread_t *thread, size_t set_size,
+       const os_cpu_set_t *set);
+
+int os_thread_atfork(void (*prepare)(void), void (*parent)(void),
+       void (*child)(void));
+
+int os_semaphore_init(os_semaphore_t *sem, unsigned value);
+int os_semaphore_destroy(os_semaphore_t *sem);
+int os_semaphore_wait(os_semaphore_t *sem);
+int os_semaphore_trywait(os_semaphore_t *sem);
+int os_semaphore_post(os_semaphore_t *sem);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* OS_THREAD_H */
diff --git a/ceph/src/pmdk/src/core/os_thread_posix.c b/ceph/src/pmdk/src/core/os_thread_posix.c
new file mode 100644 (file)
index 0000000..2d9b83b
--- /dev/null
@@ -0,0 +1,436 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * os_thread_posix.c -- Posix thread abstraction layer
+ */
+
+#define _GNU_SOURCE
+#include <pthread.h>
+#ifdef __FreeBSD__
+#include <pthread_np.h>
+#endif
+#include <semaphore.h>
+
+#include "os_thread.h"
+#include "util.h"
+
+typedef struct {
+       pthread_t thread;
+} internal_os_thread_t;
+
+/*
+ * os_once -- pthread_once abstraction layer
+ */
+int
+os_once(os_once_t *o, void (*func)(void))
+{
+       COMPILE_ERROR_ON(sizeof(os_once_t) < sizeof(pthread_once_t));
+       return pthread_once((pthread_once_t *)o, func);
+}
+
+/*
+ * os_tls_key_create -- pthread_key_create abstraction layer
+ */
+int
+os_tls_key_create(os_tls_key_t *key, void (*destructor)(void *))
+{
+       COMPILE_ERROR_ON(sizeof(os_tls_key_t) < sizeof(pthread_key_t));
+       return pthread_key_create((pthread_key_t *)key, destructor);
+}
+
+/*
+ * os_tls_key_delete -- pthread_key_delete abstraction layer
+ */
+int
+os_tls_key_delete(os_tls_key_t key)
+{
+       return pthread_key_delete((pthread_key_t)key);
+}
+
+/*
+ * os_tls_setspecific -- pthread_key_setspecific abstraction layer
+ */
+int
+os_tls_set(os_tls_key_t key, const void *value)
+{
+       return pthread_setspecific((pthread_key_t)key, value);
+}
+
+/*
+ * os_tls_get -- pthread_key_getspecific abstraction layer
+ */
+void *
+os_tls_get(os_tls_key_t key)
+{
+       return pthread_getspecific((pthread_key_t)key);
+}
+
+/*
+ * os_mutex_init -- pthread_mutex_init abstraction layer
+ */
+int
+os_mutex_init(os_mutex_t *__restrict mutex)
+{
+       COMPILE_ERROR_ON(sizeof(os_mutex_t) < sizeof(pthread_mutex_t));
+       return pthread_mutex_init((pthread_mutex_t *)mutex, NULL);
+}
+
+/*
+ * os_mutex_destroy -- pthread_mutex_destroy abstraction layer
+ */
+int
+os_mutex_destroy(os_mutex_t *__restrict mutex)
+{
+       return pthread_mutex_destroy((pthread_mutex_t *)mutex);
+}
+
+/*
+ * os_mutex_lock -- pthread_mutex_lock abstraction layer
+ */
+int
+os_mutex_lock(os_mutex_t *__restrict mutex)
+{
+       return pthread_mutex_lock((pthread_mutex_t *)mutex);
+}
+
+/*
+ * os_mutex_trylock -- pthread_mutex_trylock abstraction layer
+ */
+int
+os_mutex_trylock(os_mutex_t *__restrict mutex)
+{
+       return pthread_mutex_trylock((pthread_mutex_t *)mutex);
+}
+
+/*
+ * os_mutex_unlock -- pthread_mutex_unlock abstraction layer
+ */
+int
+os_mutex_unlock(os_mutex_t *__restrict mutex)
+{
+       return pthread_mutex_unlock((pthread_mutex_t *)mutex);
+}
+
+/*
+ * os_mutex_timedlock -- pthread_mutex_timedlock abstraction layer
+ */
+int
+os_mutex_timedlock(os_mutex_t *__restrict mutex,
+       const struct timespec *abstime)
+{
+       return pthread_mutex_timedlock((pthread_mutex_t *)mutex, abstime);
+}
+
+/*
+ * os_rwlock_init -- pthread_rwlock_init abstraction layer
+ */
+int
+os_rwlock_init(os_rwlock_t *__restrict rwlock)
+{
+       COMPILE_ERROR_ON(sizeof(os_rwlock_t) < sizeof(pthread_rwlock_t));
+       return pthread_rwlock_init((pthread_rwlock_t *)rwlock, NULL);
+}
+
+/*
+ * os_rwlock_destroy -- pthread_rwlock_destroy abstraction layer
+ */
+int
+os_rwlock_destroy(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_destroy((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_rdlock - pthread_rwlock_rdlock abstraction layer
+ */
+int
+os_rwlock_rdlock(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_rdlock((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_wrlock -- pthread_rwlock_wrlock abstraction layer
+ */
+int
+os_rwlock_wrlock(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_wrlock((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_unlock -- pthread_rwlock_unlock abstraction layer
+ */
+int
+os_rwlock_unlock(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_unlock((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_tryrdlock -- pthread_rwlock_tryrdlock abstraction layer
+ */
+int
+os_rwlock_tryrdlock(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_tryrdlock((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_tryrwlock -- pthread_rwlock_trywrlock abstraction layer
+ */
+int
+os_rwlock_trywrlock(os_rwlock_t *__restrict rwlock)
+{
+       return pthread_rwlock_trywrlock((pthread_rwlock_t *)rwlock);
+}
+
+/*
+ * os_rwlock_timedrdlock -- pthread_rwlock_timedrdlock abstraction layer
+ */
+int
+os_rwlock_timedrdlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime)
+{
+       return pthread_rwlock_timedrdlock((pthread_rwlock_t *)rwlock, abstime);
+}
+
+/*
+ * os_rwlock_timedwrlock -- pthread_rwlock_timedwrlock abstraction layer
+ */
+int
+os_rwlock_timedwrlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime)
+{
+       return pthread_rwlock_timedwrlock((pthread_rwlock_t *)rwlock, abstime);
+}
+
+/*
+ * os_spin_init -- pthread_spin_init abstraction layer
+ */
+int
+os_spin_init(os_spinlock_t *lock, int pshared)
+{
+       COMPILE_ERROR_ON(sizeof(os_spinlock_t) < sizeof(pthread_spinlock_t));
+       return pthread_spin_init((pthread_spinlock_t *)lock, pshared);
+}
+
+/*
+ * os_spin_destroy -- pthread_spin_destroy abstraction layer
+ */
+int
+os_spin_destroy(os_spinlock_t *lock)
+{
+       return pthread_spin_destroy((pthread_spinlock_t *)lock);
+}
+
+/*
+ * os_spin_lock -- pthread_spin_lock abstraction layer
+ */
+int
+os_spin_lock(os_spinlock_t *lock)
+{
+       return pthread_spin_lock((pthread_spinlock_t *)lock);
+}
+
+/*
+ * os_spin_unlock -- pthread_spin_unlock abstraction layer
+ */
+int
+os_spin_unlock(os_spinlock_t *lock)
+{
+       return pthread_spin_unlock((pthread_spinlock_t *)lock);
+}
+
+/*
+ * os_spin_trylock -- pthread_spin_trylock abstraction layer
+ */
+
+int
+os_spin_trylock(os_spinlock_t *lock)
+{
+       return pthread_spin_trylock((pthread_spinlock_t *)lock);
+}
+/*
+ * os_cond_init -- pthread_cond_init abstraction layer
+ */
+int
+os_cond_init(os_cond_t *__restrict cond)
+{
+       COMPILE_ERROR_ON(sizeof(os_cond_t) < sizeof(pthread_cond_t));
+       return pthread_cond_init((pthread_cond_t *)cond, NULL);
+}
+
+/*
+ * os_cond_destroy -- pthread_cond_destroy abstraction layer
+ */
+int
+os_cond_destroy(os_cond_t *__restrict cond)
+{
+       return pthread_cond_destroy((pthread_cond_t *)cond);
+}
+
+/*
+ * os_cond_broadcast -- pthread_cond_broadcast abstraction layer
+ */
+int
+os_cond_broadcast(os_cond_t *__restrict cond)
+{
+       return pthread_cond_broadcast((pthread_cond_t *)cond);
+}
+
+/*
+ * os_cond_signal -- pthread_cond_signal abstraction layer
+ */
+int
+os_cond_signal(os_cond_t *__restrict cond)
+{
+       return pthread_cond_signal((pthread_cond_t *)cond);
+}
+
+/*
+ * os_cond_timedwait -- pthread_cond_timedwait abstraction layer
+ */
+int
+os_cond_timedwait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex, const struct timespec *abstime)
+{
+       return pthread_cond_timedwait((pthread_cond_t *)cond,
+               (pthread_mutex_t *)mutex, abstime);
+}
+
+/*
+ * os_cond_wait -- pthread_cond_wait abstraction layer
+ */
+int
+os_cond_wait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex)
+{
+       return pthread_cond_wait((pthread_cond_t *)cond,
+               (pthread_mutex_t *)mutex);
+}
+
+/*
+ * os_thread_create -- pthread_create abstraction layer
+ */
+int
+os_thread_create(os_thread_t *thread, const os_thread_attr_t *attr,
+               void *(*start_routine)(void *), void *arg)
+{
+       COMPILE_ERROR_ON(sizeof(os_thread_t) < sizeof(internal_os_thread_t));
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)thread;
+
+       return pthread_create(&thread_info->thread, (pthread_attr_t *)attr,
+               start_routine, arg);
+}
+
+/*
+ * os_thread_join -- pthread_join abstraction layer
+ */
+int
+os_thread_join(os_thread_t *thread, void **result)
+{
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)thread;
+
+       return pthread_join(thread_info->thread, result);
+}
+
+/*
+ * os_thread_self -- pthread_self abstraction layer
+ */
+void
+os_thread_self(os_thread_t *thread)
+{
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)thread;
+
+       thread_info->thread = pthread_self();
+}
+
+/*
+ * os_thread_atfork -- pthread_atfork abstraction layer
+ */
+int
+os_thread_atfork(void (*prepare)(void), void (*parent)(void),
+       void (*child)(void))
+{
+       return pthread_atfork(prepare, parent, child);
+}
+
+/*
+ * os_thread_setaffinity_np -- pthread_atfork abstraction layer
+ */
+int
+os_thread_setaffinity_np(os_thread_t *thread, size_t set_size,
+                       const os_cpu_set_t *set)
+{
+       COMPILE_ERROR_ON(sizeof(os_cpu_set_t) < sizeof(cpu_set_t));
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)thread;
+
+       return pthread_setaffinity_np(thread_info->thread, set_size,
+               (cpu_set_t *)set);
+}
+
+/*
+ * os_cpu_zero -- CP_ZERO abstraction layer
+ */
+void
+os_cpu_zero(os_cpu_set_t *set)
+{
+       CPU_ZERO((cpu_set_t *)set);
+}
+
+/*
+ * os_cpu_set -- CP_SET abstraction layer
+ */
+void
+os_cpu_set(size_t cpu, os_cpu_set_t *set)
+{
+       CPU_SET(cpu, (cpu_set_t *)set);
+}
+
+/*
+ * os_semaphore_init -- initializes semaphore instance
+ */
+int
+os_semaphore_init(os_semaphore_t *sem, unsigned value)
+{
+       COMPILE_ERROR_ON(sizeof(os_semaphore_t) < sizeof(sem_t));
+       return sem_init((sem_t *)sem, 0, value);
+}
+
+/*
+ * os_semaphore_destroy -- destroys a semaphore instance
+ */
+int
+os_semaphore_destroy(os_semaphore_t *sem)
+{
+       return sem_destroy((sem_t *)sem);
+}
+
+/*
+ * os_semaphore_wait -- decreases the value of the semaphore
+ */
+int
+os_semaphore_wait(os_semaphore_t *sem)
+{
+       return sem_wait((sem_t *)sem);
+}
+
+/*
+ * os_semaphore_trywait -- tries to decrease the value of the semaphore
+ */
+int
+os_semaphore_trywait(os_semaphore_t *sem)
+{
+       return sem_trywait((sem_t *)sem);
+}
+
+/*
+ * os_semaphore_post -- increases the value of the semaphore
+ */
+int
+os_semaphore_post(os_semaphore_t *sem)
+{
+       return sem_post((sem_t *)sem);
+}
diff --git a/ceph/src/pmdk/src/core/os_thread_windows.c b/ceph/src/pmdk/src/core/os_thread_windows.c
new file mode 100644 (file)
index 0000000..8a2f1e9
--- /dev/null
@@ -0,0 +1,655 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * os_thread_windows.c -- (imperfect) POSIX-like threads for Windows
+ *
+ * Loosely inspired by:
+ * http://locklessinc.com/articles/pthreads_on_windows/
+ */
+
+#include <time.h>
+#include <synchapi.h>
+#include <sys/types.h>
+#include <sys/timeb.h>
+#include "os_thread.h"
+#include "util.h"
+#include "out.h"
+
+typedef struct {
+       unsigned attr;
+       CRITICAL_SECTION lock;
+} internal_os_mutex_t;
+
+typedef struct {
+       unsigned attr;
+       char is_write;
+       SRWLOCK lock;
+} internal_os_rwlock_t;
+
+typedef struct {
+       unsigned attr;
+       CONDITION_VARIABLE cond;
+} internal_os_cond_t;
+
+typedef long long internal_os_once_t;
+
+typedef struct {
+       HANDLE handle;
+} internal_semaphore_t;
+
+typedef struct {
+       GROUP_AFFINITY affinity;
+} internal_os_cpu_set_t;
+
+typedef struct {
+       HANDLE thread_handle;
+       void *arg;
+       void *(*start_routine)(void *);
+       void *result;
+} internal_os_thread_t;
+
+/* number of useconds between 1970-01-01T00:00:00Z and 1601-01-01T00:00:00Z */
+#define DELTA_WIN2UNIX (11644473600000000ull)
+#define TIMED_LOCK(action, ts) {\
+       if ((action) == TRUE)\
+               return 0;\
+       unsigned long long et = (ts)->tv_sec * 1000000000 + (ts)->tv_nsec;\
+       while (1) {\
+               FILETIME _t;\
+               GetSystemTimeAsFileTime(&_t);\
+               ULARGE_INTEGER _UI = {\
+                       .HighPart = _t.dwHighDateTime,\
+                       .LowPart = _t.dwLowDateTime,\
+               };\
+               if (100 * _UI.QuadPart - 1000 * DELTA_WIN2UNIX >= et)\
+                       return ETIMEDOUT;\
+               if ((action) == TRUE)\
+                       return 0;\
+               Sleep(1);\
+       }\
+       return ETIMEDOUT;\
+}
+
+/*
+ * os_mutex_init -- initializes mutex
+ */
+int
+os_mutex_init(os_mutex_t *__restrict mutex)
+{
+       COMPILE_ERROR_ON(sizeof(os_mutex_t) < sizeof(internal_os_mutex_t));
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       InitializeCriticalSection(&mutex_internal->lock);
+       return 0;
+}
+
+/*
+ * os_mutex_destroy -- destroys mutex
+ */
+int
+os_mutex_destroy(os_mutex_t *__restrict mutex)
+{
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       DeleteCriticalSection(&mutex_internal->lock);
+       return 0;
+}
+
+/*
+ * os_mutex_lock -- locks mutex
+ */
+_Use_decl_annotations_
+int
+os_mutex_lock(os_mutex_t *__restrict mutex)
+{
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       EnterCriticalSection(&mutex_internal->lock);
+
+       if (mutex_internal->lock.RecursionCount > 1) {
+               LeaveCriticalSection(&mutex_internal->lock);
+               FATAL("deadlock detected");
+       }
+       return 0;
+}
+
+/*
+ * os_mutex_trylock -- tries lock mutex
+ */
+_Use_decl_annotations_
+int
+os_mutex_trylock(os_mutex_t *__restrict mutex)
+{
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       if (TryEnterCriticalSection(&mutex_internal->lock) == FALSE)
+               return EBUSY;
+
+       if (mutex_internal->lock.RecursionCount > 1) {
+               LeaveCriticalSection(&mutex_internal->lock);
+               return EBUSY;
+       }
+
+       return 0;
+}
+
+/*
+ * os_mutex_timedlock -- tries lock mutex with timeout
+ */
+int
+os_mutex_timedlock(os_mutex_t *__restrict mutex,
+       const struct timespec *abstime)
+{
+       TIMED_LOCK((os_mutex_trylock(mutex) == 0), abstime);
+}
+
+/*
+ * os_mutex_unlock -- unlocks mutex
+ */
+int
+os_mutex_unlock(os_mutex_t *__restrict mutex)
+{
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       LeaveCriticalSection(&mutex_internal->lock);
+       return 0;
+}
+
+/*
+ * os_rwlock_init -- initializes rwlock
+ */
+int
+os_rwlock_init(os_rwlock_t *__restrict rwlock)
+{
+       COMPILE_ERROR_ON(sizeof(os_rwlock_t) < sizeof(internal_os_rwlock_t));
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       InitializeSRWLock(&rwlock_internal->lock);
+       return 0;
+}
+
+/*
+ * os_rwlock_destroy -- destroys rwlock
+ */
+int
+os_rwlock_destroy(os_rwlock_t *__restrict rwlock)
+{
+       /* do nothing */
+       UNREFERENCED_PARAMETER(rwlock);
+
+       return 0;
+}
+
+/*
+ * os_rwlock_rdlock -- get shared lock
+ */
+int
+os_rwlock_rdlock(os_rwlock_t *__restrict rwlock)
+{
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       AcquireSRWLockShared(&rwlock_internal->lock);
+       rwlock_internal->is_write = 0;
+       return 0;
+}
+
+/*
+ * os_rwlock_wrlock -- get exclusive lock
+ */
+int
+os_rwlock_wrlock(os_rwlock_t *__restrict rwlock)
+{
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       AcquireSRWLockExclusive(&rwlock_internal->lock);
+       rwlock_internal->is_write = 1;
+       return 0;
+}
+
+/*
+ * os_rwlock_tryrdlock -- tries get shared lock
+ */
+int
+os_rwlock_tryrdlock(os_rwlock_t *__restrict rwlock)
+{
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       if (TryAcquireSRWLockShared(&rwlock_internal->lock) == FALSE) {
+               return EBUSY;
+       } else {
+               rwlock_internal->is_write = 0;
+               return 0;
+       }
+}
+
+/*
+ * os_rwlock_trywrlock -- tries get exclusive lock
+ */
+_Use_decl_annotations_
+int
+os_rwlock_trywrlock(os_rwlock_t *__restrict rwlock)
+{
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       if (TryAcquireSRWLockExclusive(&rwlock_internal->lock) == FALSE) {
+               return EBUSY;
+       } else {
+               rwlock_internal->is_write = 1;
+               return 0;
+       }
+}
+
+/*
+ * os_rwlock_timedrdlock -- gets shared lock with timeout
+ */
+int
+os_rwlock_timedrdlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime)
+{
+       TIMED_LOCK((os_rwlock_tryrdlock(rwlock) == 0), abstime);
+}
+
+/*
+ * os_rwlock_timedwrlock -- gets exclusive lock with timeout
+ */
+int
+os_rwlock_timedwrlock(os_rwlock_t *__restrict rwlock,
+       const struct timespec *abstime)
+{
+       TIMED_LOCK((os_rwlock_trywrlock(rwlock) == 0), abstime);
+}
+
+/*
+ * os_rwlock_unlock -- unlocks rwlock
+ */
+_Use_decl_annotations_
+int
+os_rwlock_unlock(os_rwlock_t *__restrict rwlock)
+{
+       internal_os_rwlock_t *rwlock_internal = (internal_os_rwlock_t *)rwlock;
+       if (rwlock_internal->is_write)
+               ReleaseSRWLockExclusive(&rwlock_internal->lock);
+       else
+               ReleaseSRWLockShared(&rwlock_internal->lock);
+       return 0;
+}
+
+/*
+ * os_cond_init -- initializes condition variable
+ */
+int
+os_cond_init(os_cond_t *__restrict cond)
+{
+       COMPILE_ERROR_ON(sizeof(os_cond_t) < sizeof(internal_os_cond_t));
+
+       internal_os_cond_t *cond_internal = (internal_os_cond_t *)cond;
+       InitializeConditionVariable(&cond_internal->cond);
+       return 0;
+}
+
+/*
+ * os_cond_destroy -- destroys condition variable
+ */
+int
+os_cond_destroy(os_cond_t *__restrict cond)
+{
+       /* do nothing */
+       UNREFERENCED_PARAMETER(cond);
+
+       return 0;
+}
+
+/*
+ * os_cond_broadcast -- broadcast condition variable
+ */
+int
+os_cond_broadcast(os_cond_t *__restrict cond)
+{
+       internal_os_cond_t *cond_internal = (internal_os_cond_t *)cond;
+       WakeAllConditionVariable(&cond_internal->cond);
+       return 0;
+}
+
+/*
+ * os_cond_wait -- signal condition variable
+ */
+int
+os_cond_signal(os_cond_t *__restrict cond)
+{
+       internal_os_cond_t *cond_internal = (internal_os_cond_t *)cond;
+       WakeConditionVariable(&cond_internal->cond);
+       return 0;
+}
+/*
+ * get_rel_wait -- (internal) convert timespec to windows timeout
+ */
+static DWORD
+get_rel_wait(const struct timespec *abstime)
+{
+       struct __timeb64 t;
+       _ftime64_s(&t);
+       time_t now_ms = t.time * 1000 + t.millitm;
+       time_t ms = (time_t)(abstime->tv_sec * 1000 +
+               abstime->tv_nsec / 1000000);
+
+       return (DWORD)(ms - now_ms);
+}
+
+/*
+ * os_cond_timedwait -- waits on condition variable with timeout
+ */
+int
+os_cond_timedwait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex, const struct timespec *abstime)
+{
+       internal_os_cond_t *cond_internal = (internal_os_cond_t *)cond;
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       BOOL ret;
+       SetLastError(0);
+       ret = SleepConditionVariableCS(&cond_internal->cond,
+               &mutex_internal->lock, get_rel_wait(abstime));
+       if (ret == FALSE)
+               return (GetLastError() == ERROR_TIMEOUT) ? ETIMEDOUT : EINVAL;
+
+       return 0;
+}
+
+/*
+ * os_cond_wait -- waits on condition variable
+ */
+int
+os_cond_wait(os_cond_t *__restrict cond,
+       os_mutex_t *__restrict mutex)
+{
+       internal_os_cond_t *cond_internal = (internal_os_cond_t *)cond;
+       internal_os_mutex_t *mutex_internal = (internal_os_mutex_t *)mutex;
+       /* XXX - return error code based on GetLastError() */
+       BOOL ret;
+       ret = SleepConditionVariableCS(&cond_internal->cond,
+               &mutex_internal->lock, INFINITE);
+       return (ret == FALSE) ? EINVAL : 0;
+}
+
+/*
+ * os_once -- once-only function call
+ */
+int
+os_once(os_once_t *once, void (*func)(void))
+{
+       internal_os_once_t *once_internal = (internal_os_once_t *)once;
+       internal_os_once_t tmp;
+
+       while ((tmp = *once_internal) != 2) {
+               if (tmp == 1)
+                       continue; /* another thread is already calling func() */
+
+               /* try to be the first one... */
+               if (!util_bool_compare_and_swap64(once_internal, tmp, 1))
+                       continue; /* sorry, another thread was faster */
+
+               func();
+
+               if (!util_bool_compare_and_swap64(once_internal, 1, 2)) {
+                       ERR("error setting once");
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * os_tls_key_create -- creates a new tls key
+ */
+int
+os_tls_key_create(os_tls_key_t *key, void (*destructor)(void *))
+{
+       *key = FlsAlloc(destructor);
+       if (*key == TLS_OUT_OF_INDEXES)
+               return EAGAIN;
+       return 0;
+}
+
+/*
+ * os_tls_key_delete -- deletes key from tls
+ */
+int
+os_tls_key_delete(os_tls_key_t key)
+{
+       if (!FlsFree(key))
+               return EINVAL;
+       return 0;
+}
+
+/*
+ * os_tls_set -- sets a value in tls
+ */
+int
+os_tls_set(os_tls_key_t key, const void *value)
+{
+       if (!FlsSetValue(key, (LPVOID)value))
+               return ENOENT;
+       return 0;
+}
+
+/*
+ * os_tls_get -- gets a value from tls
+ */
+void *
+os_tls_get(os_tls_key_t key)
+{
+       return FlsGetValue(key);
+}
+
+/* threading */
+
+/*
+ * os_thread_start_routine_wrapper is a start routine for _beginthreadex() and
+ * it helps:
+ *
+ *  - wrap the os_thread_create's start function
+ */
+static unsigned __stdcall
+os_thread_start_routine_wrapper(void *arg)
+{
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)arg;
+
+       thread_info->result = thread_info->start_routine(thread_info->arg);
+
+       return 0;
+}
+
+/*
+ * os_thread_create -- starts a new thread
+ */
+int
+os_thread_create(os_thread_t *thread, const os_thread_attr_t *attr,
+       void *(*start_routine)(void *), void *arg)
+{
+       COMPILE_ERROR_ON(sizeof(os_thread_t) < sizeof(internal_os_thread_t));
+       internal_os_thread_t *thread_info = (internal_os_thread_t *)thread;
+
+       thread_info->start_routine = start_routine;
+       thread_info->arg = arg;
+
+       thread_info->thread_handle = (HANDLE)_beginthreadex(NULL, 0,
+               os_thread_start_routine_wrapper, thread_info, CREATE_SUSPENDED,
+               NULL);
+       if (thread_info->thread_handle == 0) {
+               free(thread_info);
+               return errno;
+       }
+
+       if (ResumeThread(thread_info->thread_handle) == -1) {
+               free(thread_info);
+               return EAGAIN;
+       }
+
+       return 0;
+}
+
+/*
+ * os_thread_join -- joins a thread
+ */
+int
+os_thread_join(os_thread_t *thread, void **result)
+{
+       internal_os_thread_t *internal_thread = (internal_os_thread_t *)thread;
+       WaitForSingleObject(internal_thread->thread_handle, INFINITE);
+       CloseHandle(internal_thread->thread_handle);
+
+       if (result != NULL)
+               *result = internal_thread->result;
+
+       return 0;
+}
+
+/*
+ * os_thread_self -- returns handle to calling thread
+ */
+void
+os_thread_self(os_thread_t *thread)
+{
+       internal_os_thread_t *internal_thread = (internal_os_thread_t *)thread;
+       internal_thread->thread_handle = GetCurrentThread();
+}
+
+/*
+ * os_cpu_zero -- clears cpu set
+ */
+void
+os_cpu_zero(os_cpu_set_t *set)
+{
+       internal_os_cpu_set_t *internal_set = (internal_os_cpu_set_t *)set;
+
+       memset(&internal_set->affinity, 0, sizeof(internal_set->affinity));
+}
+
+/*
+ * os_cpu_set -- adds cpu to set
+ */
+void
+os_cpu_set(size_t cpu, os_cpu_set_t *set)
+{
+       internal_os_cpu_set_t *internal_set = (internal_os_cpu_set_t *)set;
+       int sum = 0;
+       int group_max = GetActiveProcessorGroupCount();
+       int group = 0;
+       while (group < group_max) {
+               sum += GetActiveProcessorCount(group);
+               if (sum > cpu) {
+                       /*
+                        * XXX: can't set affinity to two different cpu groups
+                        */
+                       if (internal_set->affinity.Group != group) {
+                               internal_set->affinity.Mask = 0;
+                               internal_set->affinity.Group = group;
+                       }
+
+                       cpu -= sum - GetActiveProcessorCount(group);
+                       internal_set->affinity.Mask |= 1LL << cpu;
+                       return;
+               }
+
+               group++;
+       }
+       FATAL("os_cpu_set cpu out of bounds");
+}
+
+/*
+ * os_thread_setaffinity_np -- sets affinity of the thread
+ */
+int
+os_thread_setaffinity_np(os_thread_t *thread, size_t set_size,
+       const os_cpu_set_t *set)
+{
+       internal_os_cpu_set_t *internal_set = (internal_os_cpu_set_t *)set;
+       internal_os_thread_t *internal_thread = (internal_os_thread_t *)thread;
+
+       int ret = SetThreadGroupAffinity(internal_thread->thread_handle,
+                       &internal_set->affinity, NULL);
+       return ret != 0 ? 0 : EINVAL;
+}
+
+/*
+ * os_semaphore_init -- initializes a new semaphore instance
+ */
+int
+os_semaphore_init(os_semaphore_t *sem, unsigned value)
+{
+       internal_semaphore_t *internal_sem = (internal_semaphore_t *)sem;
+       internal_sem->handle = CreateSemaphore(NULL,
+               value, LONG_MAX, NULL);
+
+       return internal_sem->handle != 0 ? 0 : -1;
+}
+
+/*
+ * os_semaphore_destroy -- destroys a semaphore instance
+ */
+int
+os_semaphore_destroy(os_semaphore_t *sem)
+{
+       internal_semaphore_t *internal_sem = (internal_semaphore_t *)sem;
+       BOOL ret = CloseHandle(internal_sem->handle);
+       return ret ? 0 : -1;
+}
+
+/*
+ * os_semaphore_wait -- decreases the value of the semaphore
+ */
+int
+os_semaphore_wait(os_semaphore_t *sem)
+{
+       internal_semaphore_t *internal_sem = (internal_semaphore_t *)sem;
+       DWORD ret = WaitForSingleObject(internal_sem->handle, INFINITE);
+       return ret == WAIT_OBJECT_0 ? 0 : -1;
+}
+
+/*
+ * os_semaphore_trywait -- tries to decrease the value of the semaphore
+ */
+int
+os_semaphore_trywait(os_semaphore_t *sem)
+{
+       internal_semaphore_t *internal_sem = (internal_semaphore_t *)sem;
+       DWORD ret = WaitForSingleObject(internal_sem->handle, 0);
+
+       if (ret == WAIT_TIMEOUT)
+               errno = EAGAIN;
+
+       return ret == WAIT_OBJECT_0 ? 0 : -1;
+}
+
+/*
+ * os_semaphore_post -- increases the value of the semaphore
+ */
+int
+os_semaphore_post(os_semaphore_t *sem)
+{
+       internal_semaphore_t *internal_sem = (internal_semaphore_t *)sem;
+       BOOL ret = ReleaseSemaphore(internal_sem->handle, 1, NULL);
+       return ret ? 0 : -1;
+}
diff --git a/ceph/src/pmdk/src/core/os_windows.c b/ceph/src/pmdk/src/core/os_windows.c
new file mode 100644 (file)
index 0000000..e6e7c5b
--- /dev/null
@@ -0,0 +1,741 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * os_windows.c -- windows abstraction layer
+ */
+#include <io.h>
+#include <sys/locking.h>
+#include <errno.h>
+#include <pmemcompat.h>
+#include <windows.h>
+#include "alloc.h"
+#include "util.h"
+#include "os.h"
+#include "out.h"
+
+#define UTF8_BOM "\xEF\xBB\xBF"
+
+/*
+ * os_open -- open abstraction layer
+ */
+int
+os_open(const char *pathname, int flags, ...)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return -1;
+
+       int ret;
+
+       if (flags & O_CREAT) {
+               va_list arg;
+               va_start(arg, flags);
+               mode_t mode = va_arg(arg, mode_t);
+               va_end(arg);
+               ret = _wopen(path, flags, mode);
+       } else {
+               ret = _wopen(path, flags);
+       }
+       util_free_UTF16(path);
+       /* BOM skipping should not modify errno */
+       int orig_errno = errno;
+       /*
+        * text files on windows can contain BOM. As we open files
+        * in binary mode we have to detect bom and skip it
+        */
+       if (ret != -1) {
+               char bom[3];
+               if (_read(ret, bom, sizeof(bom)) != 3 ||
+                               memcmp(bom, UTF8_BOM, 3) != 0) {
+                       /* UTF-8 bom not found - reset file to the beginning */
+                       _lseek(ret, 0, SEEK_SET);
+               }
+       }
+       errno = orig_errno;
+       return ret;
+}
+
+/*
+ * os_fsync -- fsync abstraction layer
+ */
+int
+os_fsync(int fd)
+{
+       HANDLE handle = (HANDLE) _get_osfhandle(fd);
+
+       if (handle == INVALID_HANDLE_VALUE) {
+               errno = EBADF;
+               return -1;
+       }
+
+       if (!FlushFileBuffers(handle)) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * os_fsync_dir -- fsync the directory
+ */
+int
+os_fsync_dir(const char *dir_name)
+{
+       /* XXX not used and not implemented */
+       ASSERT(0);
+       return -1;
+}
+
+/*
+ * os_stat -- stat abstraction layer
+ */
+int
+os_stat(const char *pathname, os_stat_t *buf)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return -1;
+
+       int ret = _wstat64(path, buf);
+
+       util_free_UTF16(path);
+       return ret;
+}
+
+/*
+ * os_unlink -- unlink abstraction layer
+ */
+int
+os_unlink(const char *pathname)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return -1;
+
+       int ret = _wunlink(path);
+       util_free_UTF16(path);
+       return ret;
+}
+
+/*
+ * os_access -- access abstraction layer
+ */
+int
+os_access(const char *pathname, int mode)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return -1;
+
+       int ret = _waccess(path, mode);
+       util_free_UTF16(path);
+       return ret;
+}
+
+/*
+ * os_skipBOM -- (internal) Skip BOM in file stream
+ *
+ * text files on windows can contain BOM. We have to detect bom and skip it.
+ */
+static void
+os_skipBOM(FILE *file)
+{
+       if (file == NULL)
+               return;
+
+       /* BOM skipping should not modify errno */
+       int orig_errno = errno;
+       /* UTF-8 BOM */
+       uint8_t bom[3];
+       size_t read_num = fread(bom, sizeof(bom[0]), sizeof(bom), file);
+       if (read_num != ARRAY_SIZE(bom))
+               goto out;
+
+       if (memcmp(bom, UTF8_BOM, ARRAY_SIZE(bom)) != 0) {
+               /* UTF-8 bom not found - reset file to the beginning */
+               fseek(file, 0, SEEK_SET);
+       }
+
+out:
+       errno = orig_errno;
+}
+
+/*
+ * os_fopen -- fopen abstraction layer
+ */
+FILE *
+os_fopen(const char *pathname, const char *mode)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return NULL;
+
+       wchar_t *wmode = util_toUTF16(mode);
+       if (wmode == NULL) {
+               util_free_UTF16(path);
+               return NULL;
+       }
+
+       FILE *ret = _wfopen(path, wmode);
+
+       util_free_UTF16(path);
+       util_free_UTF16(wmode);
+
+       os_skipBOM(ret);
+       return ret;
+}
+
+/*
+ * os_fdopen -- fdopen abstraction layer
+ */
+FILE *
+os_fdopen(int fd, const char *mode)
+{
+       FILE *ret = fdopen(fd, mode);
+       os_skipBOM(ret);
+       return ret;
+}
+
+/*
+ * os_chmod -- chmod abstraction layer
+ */
+int
+os_chmod(const char *pathname, mode_t mode)
+{
+       wchar_t *path = util_toUTF16(pathname);
+       if (path == NULL)
+               return -1;
+
+       int ret = _wchmod(path, mode);
+       util_free_UTF16(path);
+       return ret;
+}
+
+/*
+ * os_mkstemp -- generate a unique temporary filename from template
+ */
+int
+os_mkstemp(char *temp)
+{
+       unsigned rnd;
+       wchar_t *utemp = util_toUTF16(temp);
+       if (utemp == NULL)
+               return -1;
+
+       wchar_t *path = _wmktemp(utemp);
+       if (path == NULL) {
+               util_free_UTF16(utemp);
+               return -1;
+       }
+
+       wchar_t *npath = Malloc(sizeof(*npath) * wcslen(path) + _MAX_FNAME);
+       if (npath == NULL) {
+               util_free_UTF16(utemp);
+               return -1;
+       }
+
+       wcscpy(npath, path);
+
+       util_free_UTF16(utemp);
+       /*
+        * Use rand_s to generate more unique tmp file name than _mktemp do.
+        * In case with multiple threads and multiple files even after close()
+        * file name conflicts occurred.
+        * It resolved issue with synchronous removing
+        * multiples files by system.
+        */
+       rand_s(&rnd);
+
+       int ret = _snwprintf(npath + wcslen(npath), _MAX_FNAME, L"%u", rnd);
+       if (ret < 0)
+               goto out;
+
+       /*
+        * Use O_TEMPORARY flag to make sure the file is deleted when
+        * the last file descriptor is closed.  Also, it prevents opening
+        * this file from another process.
+        */
+       ret = _wopen(npath, O_RDWR | O_CREAT | O_EXCL | O_TEMPORARY,
+               S_IWRITE | S_IREAD);
+
+out:
+       Free(npath);
+       return ret;
+}
+
+/*
+ * os_posix_fallocate -- allocate file space
+ */
+int
+os_posix_fallocate(int fd, os_off_t offset, os_off_t len)
+{
+       /*
+        * From POSIX:
+        * "EINVAL -- The len argument was zero or the offset argument was
+        * less than zero."
+        *
+        * From Linux man-page:
+        * "EINVAL -- offset was less than 0, or len was less than or
+        * equal to 0"
+        */
+       if (offset < 0 || len <= 0)
+               return EINVAL;
+
+       /*
+        * From POSIX:
+        * "EFBIG -- The value of offset+len is greater than the maximum
+        * file size."
+        *
+        * Overflow can't be checked for by _chsize_s, since it only gets
+        * the sum.
+        */
+       if (offset + len < offset)
+               return EFBIG;
+
+       HANDLE handle = (HANDLE)_get_osfhandle(fd);
+       if (handle == INVALID_HANDLE_VALUE) {
+               return errno;
+       }
+
+       FILE_ATTRIBUTE_TAG_INFO attributes;
+       if (!GetFileInformationByHandleEx(handle, FileAttributeTagInfo,
+                       &attributes, sizeof(attributes))) {
+               return EINVAL;
+       }
+       /*
+        * To physically allocate space on windows we have to remove
+        * sparsefile and file compressed flags. This method is much faster
+        * than using _chsize_s which has terrible performance. Dax on
+        * windows doesn't support sparse files and file compression so
+        * this workaround is acceptable.
+        */
+       if (attributes.FileAttributes & FILE_ATTRIBUTE_SPARSE_FILE) {
+               DWORD unused;
+               FILE_SET_SPARSE_BUFFER buffer;
+               buffer.SetSparse = FALSE;
+
+               if (!DeviceIoControl(handle, FSCTL_SET_SPARSE, &buffer,
+                               sizeof(buffer), NULL, 0, &unused,
+                               NULL)) {
+                       return EINVAL;
+               }
+       }
+       if (attributes.FileAttributes & FILE_ATTRIBUTE_COMPRESSED) {
+               DWORD unused;
+               USHORT buffer = 0; /* magic undocumented value */
+
+               if (!DeviceIoControl(handle, FSCTL_SET_COMPRESSION,
+                               &buffer, sizeof(buffer), NULL, 0,
+                               &unused, NULL)) {
+                       return EINVAL;
+               }
+       }
+
+       /*
+        * posix_fallocate should not clobber errno, but
+        * _filelengthi64 might set errno.
+        */
+       int orig_errno = errno;
+
+       __int64 current_size = _filelengthi64(fd);
+
+       int file_length_errno = errno;
+       errno = orig_errno;
+
+       if (current_size < 0)
+               return file_length_errno;
+
+       __int64 requested_size = offset + len;
+
+       if (requested_size <= current_size)
+               return 0;
+
+       int ret = os_ftruncate(fd, requested_size);
+
+       if (ret) {
+               errno = ret;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * os_ftruncate -- truncate a file to a specified length
+ */
+int
+os_ftruncate(int fd, os_off_t length)
+{
+       LARGE_INTEGER distanceToMove = {0};
+       distanceToMove.QuadPart = length;
+       HANDLE handle = (HANDLE)_get_osfhandle(fd);
+       if (handle == INVALID_HANDLE_VALUE)
+               return -1;
+
+       if (!SetFilePointerEx(handle, distanceToMove, NULL, FILE_BEGIN)) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (!SetEndOfFile(handle)) {
+               errno = EINVAL;
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * os_flock -- apply or remove an advisory lock on an open file
+ */
+int
+os_flock(int fd, int operation)
+{
+       int flags = 0;
+       SYSTEM_INFO  systemInfo;
+
+       GetSystemInfo(&systemInfo);
+
+       switch (operation & (OS_LOCK_EX | OS_LOCK_SH | OS_LOCK_UN)) {
+               case OS_LOCK_EX:
+               case OS_LOCK_SH:
+                       if (operation & OS_LOCK_NB)
+                               flags = _LK_NBLCK;
+                       else
+                               flags = _LK_LOCK;
+                       break;
+
+               case OS_LOCK_UN:
+                       flags = _LK_UNLCK;
+                       break;
+
+               default:
+                       errno = EINVAL;
+                       return -1;
+       }
+
+       os_off_t filelen = _filelengthi64(fd);
+       if (filelen < 0)
+               return -1;
+
+       /* for our purpose it's enough to lock the first page of the file */
+       long len = (filelen > systemInfo.dwPageSize) ?
+                               systemInfo.dwPageSize : (long)filelen;
+
+       int res = _locking(fd, flags, len);
+       if (res != 0 && errno == EACCES)
+               errno = EWOULDBLOCK; /* for consistency with flock() */
+
+       return res;
+}
+
+/*
+ * os_writev -- windows version of writev function
+ *
+ * XXX: _write and other similar functions are 32 bit on windows
+ *     if size of data is bigger then 2^32, this function
+ *     will be not atomic.
+ */
+ssize_t
+os_writev(int fd, const struct iovec *iov, int iovcnt)
+{
+       size_t size = 0;
+
+       /* XXX: _write is 32 bit on windows */
+       for (int i = 0; i < iovcnt; i++)
+               size += iov[i].iov_len;
+
+       void *buf = malloc(size);
+       if (buf == NULL)
+               return ENOMEM;
+
+       char *it_buf = buf;
+       for (int i = 0; i < iovcnt; i++) {
+               memcpy(it_buf, iov[i].iov_base, iov[i].iov_len);
+               it_buf += iov[i].iov_len;
+       }
+
+       ssize_t written = 0;
+       while (size > 0) {
+               int ret = _write(fd, buf, size >= MAXUINT ?
+                               MAXUINT : (unsigned)size);
+               if (ret == -1) {
+                       written = -1;
+                       break;
+               }
+               written += ret;
+               size -= ret;
+       }
+
+       free(buf);
+       return written;
+}
+
+#define NSEC_IN_SEC 1000000000ull
+/* number of useconds between 1970-01-01T00:00:00Z and 1601-01-01T00:00:00Z */
+#define DELTA_WIN2UNIX (11644473600000000ull)
+
+/*
+ * clock_gettime -- returns elapsed time since the system was restarted
+ * or since Epoch, depending on the mode id
+ */
+int
+os_clock_gettime(int id, struct timespec *ts)
+{
+       switch (id) {
+       case CLOCK_MONOTONIC:
+               {
+                       LARGE_INTEGER time;
+                       LARGE_INTEGER frequency;
+
+                       QueryPerformanceFrequency(&frequency);
+                       QueryPerformanceCounter(&time);
+
+                       ts->tv_sec = time.QuadPart / frequency.QuadPart;
+                       ts->tv_nsec = (long)(
+                               (time.QuadPart % frequency.QuadPart) *
+                               NSEC_IN_SEC / frequency.QuadPart);
+               }
+               break;
+
+       case CLOCK_REALTIME:
+               {
+                       FILETIME ctime_ft;
+                       GetSystemTimeAsFileTime(&ctime_ft);
+                       ULARGE_INTEGER ctime = {
+                               .HighPart = ctime_ft.dwHighDateTime,
+                               .LowPart = ctime_ft.dwLowDateTime,
+                       };
+                       ts->tv_sec = (ctime.QuadPart - DELTA_WIN2UNIX * 10)
+                               / 10000000;
+                       ts->tv_nsec = ((ctime.QuadPart - DELTA_WIN2UNIX * 10)
+                               % 10000000) * 100;
+               }
+               break;
+
+       default:
+               SetLastError(EINVAL);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * os_setenv -- change or add an environment variable
+ */
+int
+os_setenv(const char *name, const char *value, int overwrite)
+{
+       errno_t err;
+
+       /*
+        * If caller doesn't want to overwrite make sure that a environment
+        * variable with the same name doesn't exist.
+        */
+       if (!overwrite && getenv(name))
+               return 0;
+
+       /*
+        * _putenv_s returns a non-zero error code on failure but setenv
+        * needs to return -1 on failure, let's translate the error code.
+        */
+       if ((err = _putenv_s(name, value)) != 0) {
+               errno = err;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * os_unsetenv -- remove an environment variable
+ */
+int
+os_unsetenv(const char *name)
+{
+       errno_t err;
+       if ((err = _putenv_s(name, "")) != 0) {
+               errno = err;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * os_getenv -- getenv abstraction layer
+ */
+char *
+os_getenv(const char *name)
+{
+       return getenv(name);
+}
+
+/*
+ * rand_r -- rand_r for windows
+ *
+ * XXX: RAND_MAX is equal 0x7fff on Windows, so to get 32 bit random number
+ *     we need to merge two numbers returned by rand_s().
+ *     It is not to the best solution as subsequences returned by rand_s are
+ *     not guaranteed to be independent.
+ *
+ * XXX: Windows doesn't implement deterministic thread-safe pseudorandom
+ *     generator (generator which can be initialized by seed ).
+ *     We have to chose between a deterministic nonthread-safe generator
+ *     (rand(), srand()) or a non-deterministic thread-safe generator(rand_s())
+ *     as thread-safety is more important, a seed parameter is ignored in this
+ *     implementation.
+ */
+unsigned
+os_rand_r(unsigned *seedp)
+{
+       UNREFERENCED_PARAMETER(seedp);
+       unsigned part1, part2;
+       rand_s(&part1);
+       rand_s(&part2);
+       return part1 << 16 | part2;
+}
+
+/*
+ * sys_siglist -- map of signal to human readable messages like sys_siglist
+ */
+const char * const sys_siglist[] = {
+       "Unknown signal 0",             /*  0 */
+       "Hangup",                       /*  1 */
+       "Interrupt",                    /*  2 */
+       "Quit",                         /*  3 */
+       "Illegal instruction",          /*  4 */
+       "Trace/breakpoint trap",        /*  5 */
+       "Aborted",                      /*  6 */
+       "Bus error",                    /*  7 */
+       "Floating point exception",     /*  8 */
+       "Killed",                       /*  9 */
+       "User defined signal 1",        /* 10 */
+       "Segmentation fault",           /* 11 */
+       "User defined signal 2",        /* 12 */
+       "Broken pipe",                  /* 13 */
+       "Alarm clock",                  /* 14 */
+       "Terminated",                   /* 15 */
+       "Stack fault",                  /* 16 */
+       "Child exited",                 /* 17 */
+       "Continued",                    /* 18 */
+       "Stopped (signal)",             /* 19 */
+       "Stopped",                      /* 20 */
+       "Stopped (tty input)",          /* 21 */
+       "Stopped (tty output)",         /* 22 */
+       "Urgent I/O condition",         /* 23 */
+       "CPU time limit exceeded",      /* 24 */
+       "File size limit exceeded",     /* 25 */
+       "Virtual timer expired",        /* 26 */
+       "Profiling timer expired",      /* 27 */
+       "Window changed",               /* 28 */
+       "I/O possible",                 /* 29 */
+       "Power failure",                /* 30 */
+       "Bad system call",              /* 31 */
+       "Unknown signal 32"             /* 32 */
+};
+int sys_siglist_size = ARRAYSIZE(sys_siglist);
+
+/*
+ * string constants for strsignal
+ * XXX: ideally this should have the signal number as the suffix but then we
+ * should use a buffer from thread local storage, so deferring the same till
+ * we need it
+ * NOTE: In Linux strsignal uses TLS for the same reason but if it fails to get
+ * a thread local buffer it falls back to using a static buffer trading the
+ * thread safety.
+ */
+#define STR_REALTIME_SIGNAL    "Real-time signal"
+#define STR_UNKNOWN_SIGNAL     "Unknown signal"
+
+/*
+ * strsignal -- returns a string describing the signal number 'sig'
+ *
+ * XXX: According to POSIX, this one is of type 'char *', but in our
+ * implementation it returns 'const char *'.
+ */
+const char *
+os_strsignal(int sig)
+{
+       if (sig >= 0 && sig < ARRAYSIZE(sys_siglist))
+               return sys_siglist[sig];
+       else if (sig >= 34 && sig <= 64)
+               return STR_REALTIME_SIGNAL;
+       else
+               return STR_UNKNOWN_SIGNAL;
+}
+
+int
+os_execv(const char *path, char *const argv[])
+{
+       wchar_t *wpath = util_toUTF16(path);
+       if (wpath == NULL)
+               return -1;
+
+       int argc = 0;
+       while (argv[argc])
+               argc++;
+
+       int ret;
+       wchar_t **wargv = Zalloc((argc + 1) * sizeof(wargv[0]));
+       if (!wargv) {
+               ret = -1;
+               goto wargv_alloc_failed;
+       }
+
+       for (int i = 0; i < argc; ++i) {
+               wargv[i] = util_toUTF16(argv[i]);
+               if (!wargv[i]) {
+                       ret = -1;
+                       goto end;
+               }
+       }
+
+       intptr_t iret = _wexecv(wpath, wargv);
+       if (iret == 0)
+               ret = 0;
+       else
+               ret = -1;
+
+end:
+       for (int i = 0; i < argc; ++i)
+               util_free_UTF16(wargv[i]);
+       Free(wargv);
+
+wargv_alloc_failed:
+       util_free_UTF16(wpath);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/core/out.c b/ceph/src/pmdk/src/core/out.c
new file mode 100644 (file)
index 0000000..445885e
--- /dev/null
@@ -0,0 +1,592 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * out.c -- support for logging, tracing, and assertion output
+ *
+ * Macros like LOG(), OUT, ASSERT(), etc. end up here.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+
+#include "out.h"
+#include "os.h"
+#include "os_thread.h"
+#include "valgrind_internal.h"
+#include "util.h"
+
+/* XXX - modify Linux makefiles to generate srcversion.h and remove #ifdef */
+#ifdef _WIN32
+#include "srcversion.h"
+#endif
+
+static const char *Log_prefix;
+static int Log_level;
+static FILE *Out_fp;
+static unsigned Log_alignment;
+
+#ifndef NO_LIBPTHREAD
+#define MAXPRINT 8192  /* maximum expected log line */
+#else
+#define MAXPRINT 256   /* maximum expected log line for libpmem */
+#endif
+
+struct errormsg
+{
+       char msg[MAXPRINT];
+#ifdef _WIN32
+       wchar_t wmsg[MAXPRINT];
+#endif
+};
+
+#ifndef NO_LIBPTHREAD
+
+static os_once_t Last_errormsg_key_once = OS_ONCE_INIT;
+static os_tls_key_t Last_errormsg_key;
+
+static void
+_Last_errormsg_key_alloc(void)
+{
+       int pth_ret = os_tls_key_create(&Last_errormsg_key, free);
+       if (pth_ret)
+               FATAL("!os_thread_key_create");
+
+       VALGRIND_ANNOTATE_HAPPENS_BEFORE(&Last_errormsg_key_once);
+}
+
+static void
+Last_errormsg_key_alloc(void)
+{
+       os_once(&Last_errormsg_key_once, _Last_errormsg_key_alloc);
+       /*
+        * Workaround Helgrind's bug:
+        * https://bugs.kde.org/show_bug.cgi?id=337735
+        */
+       VALGRIND_ANNOTATE_HAPPENS_AFTER(&Last_errormsg_key_once);
+}
+
+static inline void
+Last_errormsg_fini(void)
+{
+       void *p = os_tls_get(Last_errormsg_key);
+       if (p) {
+               free(p);
+               (void) os_tls_set(Last_errormsg_key, NULL);
+       }
+       (void) os_tls_key_delete(Last_errormsg_key);
+}
+
+static inline struct errormsg *
+Last_errormsg_get(void)
+{
+       Last_errormsg_key_alloc();
+
+       struct errormsg *errormsg = os_tls_get(Last_errormsg_key);
+       if (errormsg == NULL) {
+               errormsg = malloc(sizeof(struct errormsg));
+               if (errormsg == NULL)
+                       FATAL("!malloc");
+               /* make sure it contains empty string initially */
+               errormsg->msg[0] = '\0';
+               int ret = os_tls_set(Last_errormsg_key, errormsg);
+               if (ret)
+                       FATAL("!os_tls_set");
+       }
+       return errormsg;
+}
+
+#else
+
+/*
+ * We don't want libpmem to depend on libpthread.  Instead of using pthread
+ * API to dynamically allocate thread-specific error message buffer, we put
+ * it into TLS.  However, keeping a pretty large static buffer (8K) in TLS
+ * may lead to some issues, so the maximum message length is reduced.
+ * Fortunately, it looks like the longest error message in libpmem should
+ * not be longer than about 90 chars (in case of pmem_check_version()).
+ */
+
+static __thread struct errormsg Last_errormsg;
+
+static inline void
+Last_errormsg_key_alloc(void)
+{
+}
+
+static inline void
+Last_errormsg_fini(void)
+{
+}
+
+static inline const struct errormsg *
+Last_errormsg_get(void)
+{
+       return &Last_errormsg;
+}
+
+#endif /* NO_LIBPTHREAD */
+
+/*
+ * out_init -- initialize the log
+ *
+ * This is called from the library initialization code.
+ */
+void
+out_init(const char *log_prefix, const char *log_level_var,
+               const char *log_file_var, int major_version,
+               int minor_version)
+{
+       static int once;
+
+       /* only need to initialize the out module once */
+       if (once)
+               return;
+       once++;
+
+       Log_prefix = log_prefix;
+
+#ifdef DEBUG
+       char *log_level;
+       char *log_file;
+
+       if ((log_level = os_getenv(log_level_var)) != NULL) {
+               Log_level = atoi(log_level);
+               if (Log_level < 0) {
+                       Log_level = 0;
+               }
+       }
+
+       if ((log_file = os_getenv(log_file_var)) != NULL &&
+                               log_file[0] != '\0') {
+
+               /* reserve more than enough space for a PID + '\0' */
+               char log_file_pid[PATH_MAX];
+               size_t len = strlen(log_file);
+               if (len > 0 && log_file[len - 1] == '-') {
+                       if (util_snprintf(log_file_pid, PATH_MAX, "%s%d",
+                                       log_file, getpid()) < 0) {
+                               ERR("snprintf: %d", errno);
+                               abort();
+                       }
+                       log_file = log_file_pid;
+               }
+
+               if ((Out_fp = os_fopen(log_file, "w")) == NULL) {
+                       char buff[UTIL_MAX_ERR_MSG];
+                       util_strerror(errno, buff, UTIL_MAX_ERR_MSG);
+                       fprintf(stderr, "Error (%s): %s=%s: %s\n",
+                               log_prefix, log_file_var,
+                               log_file, buff);
+                       abort();
+               }
+       }
+#endif /* DEBUG */
+
+       char *log_alignment = os_getenv("PMDK_LOG_ALIGN");
+       if (log_alignment) {
+               int align = atoi(log_alignment);
+               if (align > 0)
+                       Log_alignment = (unsigned)align;
+       }
+
+       if (Out_fp == NULL)
+               Out_fp = stderr;
+       else
+               setlinebuf(Out_fp);
+
+#ifdef DEBUG
+       static char namepath[PATH_MAX];
+       LOG(1, "pid %d: program: %s", getpid(),
+               util_getexecname(namepath, PATH_MAX));
+#endif
+       LOG(1, "%s version %d.%d", log_prefix, major_version, minor_version);
+
+       static __attribute__((used)) const char *version_msg =
+                       "src version: " SRCVERSION;
+       LOG(1, "%s", version_msg);
+#if VG_PMEMCHECK_ENABLED
+       /*
+        * Attribute "used" to prevent compiler from optimizing out the variable
+        * when LOG expands to no code (!DEBUG)
+        */
+       static __attribute__((used)) const char *pmemcheck_msg =
+                       "compiled with support for Valgrind pmemcheck";
+       LOG(1, "%s", pmemcheck_msg);
+#endif /* VG_PMEMCHECK_ENABLED */
+#if VG_HELGRIND_ENABLED
+       static __attribute__((used)) const char *helgrind_msg =
+                       "compiled with support for Valgrind helgrind";
+       LOG(1, "%s", helgrind_msg);
+#endif /* VG_HELGRIND_ENABLED */
+#if VG_MEMCHECK_ENABLED
+       static __attribute__((used)) const char *memcheck_msg =
+                       "compiled with support for Valgrind memcheck";
+       LOG(1, "%s", memcheck_msg);
+#endif /* VG_MEMCHECK_ENABLED */
+#if VG_DRD_ENABLED
+       static __attribute__((used)) const char *drd_msg =
+                       "compiled with support for Valgrind drd";
+       LOG(1, "%s", drd_msg);
+#endif /* VG_DRD_ENABLED */
+#if SDS_ENABLED
+       static __attribute__((used)) const char *shutdown_state_msg =
+                       "compiled with support for shutdown state";
+       LOG(1, "%s", shutdown_state_msg);
+#endif
+#if NDCTL_ENABLED
+       static __attribute__((used)) const char *ndctl_ge_63_msg =
+               "compiled with libndctl 63+";
+       LOG(1, "%s", ndctl_ge_63_msg);
+#endif
+
+       Last_errormsg_key_alloc();
+}
+
+/*
+ * out_fini -- close the log file
+ *
+ * This is called to close log file before process stop.
+ */
+void
+out_fini(void)
+{
+       if (Out_fp != NULL && Out_fp != stderr) {
+               fclose(Out_fp);
+               Out_fp = stderr;
+       }
+
+       Last_errormsg_fini();
+}
+
+/*
+ * out_print_func -- default print_func, goes to stderr or Out_fp
+ */
+static void
+out_print_func(const char *s)
+{
+       /* to suppress drd false-positive */
+       /* XXX: confirm real nature of this issue: pmem/issues#863 */
+#ifdef SUPPRESS_FPUTS_DRD_ERROR
+       VALGRIND_ANNOTATE_IGNORE_READS_BEGIN();
+       VALGRIND_ANNOTATE_IGNORE_WRITES_BEGIN();
+#endif
+       fputs(s, Out_fp);
+#ifdef SUPPRESS_FPUTS_DRD_ERROR
+       VALGRIND_ANNOTATE_IGNORE_READS_END();
+       VALGRIND_ANNOTATE_IGNORE_WRITES_END();
+#endif
+}
+
+/*
+ * calling Print(s) calls the current print_func...
+ */
+typedef void (*Print_func)(const char *s);
+typedef int (*Vsnprintf_func)(char *str, size_t size, const char *format,
+               va_list ap);
+static Print_func Print = out_print_func;
+static Vsnprintf_func Vsnprintf = vsnprintf;
+
+/*
+ * out_set_print_func -- allow override of print_func used by out module
+ */
+void
+out_set_print_func(void (*print_func)(const char *s))
+{
+       LOG(3, "print %p", print_func);
+
+       Print = (print_func == NULL) ? out_print_func : print_func;
+}
+
+/*
+ * out_set_vsnprintf_func -- allow override of vsnprintf_func used by out module
+ */
+void
+out_set_vsnprintf_func(int (*vsnprintf_func)(char *str, size_t size,
+                               const char *format, va_list ap))
+{
+       LOG(3, "vsnprintf %p", vsnprintf_func);
+
+       Vsnprintf = (vsnprintf_func == NULL) ? vsnprintf : vsnprintf_func;
+}
+
+/*
+ * out_snprintf -- (internal) custom snprintf implementation
+ */
+FORMAT_PRINTF(3, 4)
+static int
+out_snprintf(char *str, size_t size, const char *format, ...)
+{
+       int ret;
+       va_list ap;
+
+       va_start(ap, format);
+       ret = Vsnprintf(str, size, format, ap);
+       va_end(ap);
+
+       return (ret);
+}
+
+/*
+ * out_common -- common output code, all output goes through here
+ */
+static void
+out_common(const char *file, int line, const char *func, int level,
+               const char *suffix, const char *fmt, va_list ap)
+{
+       int oerrno = errno;
+       char buf[MAXPRINT];
+       unsigned cc = 0;
+       int ret;
+       const char *sep = "";
+       char errstr[UTIL_MAX_ERR_MSG] = "";
+
+       unsigned long olast_error = 0;
+#ifdef _WIN32
+       if (fmt && fmt[0] == '!' && fmt[1] == '!')
+               olast_error = GetLastError();
+#endif
+
+       if (file) {
+               char *f = strrchr(file, OS_DIR_SEPARATOR);
+               if (f)
+                       file = f + 1;
+               ret = out_snprintf(&buf[cc], MAXPRINT - cc,
+                               "<%s>: <%d> [%s:%d %s] ",
+                               Log_prefix, level, file, line, func);
+               if (ret < 0) {
+                       Print("out_snprintf failed");
+                       goto end;
+               }
+               cc += (unsigned)ret;
+               if (cc < Log_alignment) {
+                       memset(buf + cc, ' ', Log_alignment - cc);
+                       cc = Log_alignment;
+               }
+       }
+
+       if (fmt) {
+               if (*fmt == '!') {
+                       sep = ": ";
+                       fmt++;
+                       if (*fmt == '!') {
+                               fmt++;
+                               /* it will abort on non Windows OS */
+                               util_strwinerror(olast_error, errstr,
+                                       UTIL_MAX_ERR_MSG);
+                       } else {
+                               util_strerror(oerrno, errstr, UTIL_MAX_ERR_MSG);
+                       }
+
+               }
+               ret = Vsnprintf(&buf[cc], MAXPRINT - cc, fmt, ap);
+               if (ret < 0) {
+                       Print("Vsnprintf failed");
+                       goto end;
+               }
+               cc += (unsigned)ret;
+       }
+
+       out_snprintf(&buf[cc], MAXPRINT - cc, "%s%s%s", sep, errstr, suffix);
+
+       Print(buf);
+
+end:
+       errno = oerrno;
+#ifdef _WIN32
+       SetLastError(olast_error);
+#endif
+}
+
+/*
+ * out_error -- common error output code, all error messages go through here
+ */
+static void
+out_error(const char *file, int line, const char *func,
+               const char *suffix, const char *fmt, va_list ap)
+{
+       int oerrno = errno;
+       unsigned long olast_error = 0;
+#ifdef _WIN32
+       olast_error = GetLastError();
+#endif
+       unsigned cc = 0;
+       int ret;
+       const char *sep = "";
+       char errstr[UTIL_MAX_ERR_MSG] = "";
+
+       char *errormsg = (char *)out_get_errormsg();
+
+       if (fmt) {
+               if (*fmt == '!') {
+                       sep = ": ";
+                       fmt++;
+                       if (*fmt == '!') {
+                               fmt++;
+                               /* it will abort on non Windows OS */
+                               util_strwinerror(olast_error, errstr,
+                                       UTIL_MAX_ERR_MSG);
+                       } else {
+                               util_strerror(oerrno, errstr, UTIL_MAX_ERR_MSG);
+                       }
+               }
+
+               ret = Vsnprintf(&errormsg[cc], MAXPRINT, fmt, ap);
+               if (ret < 0) {
+                       strcpy(errormsg, "Vsnprintf failed");
+                       goto end;
+               }
+               cc += (unsigned)ret;
+               out_snprintf(&errormsg[cc], MAXPRINT - cc, "%s%s",
+                               sep, errstr);
+       }
+
+#ifdef DEBUG
+       if (Log_level >= 1) {
+               char buf[MAXPRINT];
+               cc = 0;
+
+               if (file) {
+                       char *f = strrchr(file, OS_DIR_SEPARATOR);
+                       if (f)
+                               file = f + 1;
+                       ret = out_snprintf(&buf[cc], MAXPRINT,
+                                       "<%s>: <1> [%s:%d %s] ",
+                                       Log_prefix, file, line, func);
+                       if (ret < 0) {
+                               Print("out_snprintf failed");
+                               goto end;
+                       }
+                       cc += (unsigned)ret;
+                       if (cc < Log_alignment) {
+                               memset(buf + cc, ' ', Log_alignment - cc);
+                               cc = Log_alignment;
+                       }
+               }
+
+               out_snprintf(&buf[cc], MAXPRINT - cc, "%s%s", errormsg,
+                               suffix);
+
+               Print(buf);
+       }
+#endif
+
+end:
+       errno = oerrno;
+#ifdef _WIN32
+       SetLastError(olast_error);
+#endif
+}
+
+/*
+ * out -- output a line, newline added automatically
+ */
+void
+out(const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+
+       out_common(NULL, 0, NULL, 0, "\n", fmt, ap);
+
+       va_end(ap);
+}
+
+/*
+ * out_nonl -- output a line, no newline added automatically
+ */
+void
+out_nonl(int level, const char *fmt, ...)
+{
+       va_list ap;
+
+       if (Log_level < level)
+                       return;
+
+       va_start(ap, fmt);
+       out_common(NULL, 0, NULL, level, "", fmt, ap);
+
+       va_end(ap);
+}
+
+/*
+ * out_log -- output a log line if Log_level >= level
+ */
+void
+out_log(const char *file, int line, const char *func, int level,
+               const char *fmt, ...)
+{
+       va_list ap;
+
+       if (Log_level < level)
+               return;
+
+       va_start(ap, fmt);
+       out_common(file, line, func, level, "\n", fmt, ap);
+
+       va_end(ap);
+}
+
+/*
+ * out_fatal -- output a fatal error & die (i.e. assertion failure)
+ */
+void
+out_fatal(const char *file, int line, const char *func,
+               const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+
+       out_common(file, line, func, 1, "\n", fmt, ap);
+
+       va_end(ap);
+
+       abort();
+}
+
+/*
+ * out_err -- output an error message
+ */
+void
+out_err(const char *file, int line, const char *func,
+               const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+
+       out_error(file, line, func, "\n", fmt, ap);
+
+       va_end(ap);
+}
+
+/*
+ * out_get_errormsg -- get the last error message
+ */
+const char *
+out_get_errormsg(void)
+{
+       const struct errormsg *errormsg = Last_errormsg_get();
+       return &errormsg->msg[0];
+}
+
+#ifdef _WIN32
+/*
+ * out_get_errormsgW -- get the last error message in wchar_t
+ */
+const wchar_t *
+out_get_errormsgW(void)
+{
+       struct errormsg *errormsg = Last_errormsg_get();
+       const char *utf8 = &errormsg->msg[0];
+       wchar_t *utf16 = &errormsg->wmsg[0];
+       if (util_toUTF16_buff(utf8, utf16, sizeof(errormsg->wmsg)) != 0)
+               FATAL("!Failed to convert string");
+
+       return (const wchar_t *)utf16;
+}
+#endif
diff --git a/ceph/src/pmdk/src/core/out.h b/ceph/src/pmdk/src/core/out.h
new file mode 100644 (file)
index 0000000..be81c31
--- /dev/null
@@ -0,0 +1,231 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * out.h -- definitions for "out" module
+ */
+
+#ifndef PMDK_OUT_H
+#define PMDK_OUT_H 1
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Suppress errors which are after appropriate ASSERT* macro for nondebug
+ * builds.
+ */
+#if !defined(DEBUG) && (defined(__clang_analyzer__) || defined(__COVERITY__) ||\
+               defined(__KLOCWORK__))
+#define OUT_FATAL_DISCARD_NORETURN __attribute__((noreturn))
+#else
+#define OUT_FATAL_DISCARD_NORETURN
+#endif
+
+#ifndef EVALUATE_DBG_EXPRESSIONS
+#if defined(DEBUG) || defined(__clang_analyzer__) || defined(__COVERITY__) ||\
+       defined(__KLOCWORK__)
+#define EVALUATE_DBG_EXPRESSIONS 1
+#else
+#define EVALUATE_DBG_EXPRESSIONS 0
+#endif
+#endif
+
+#ifdef DEBUG
+
+#define OUT_LOG out_log
+#define OUT_NONL out_nonl
+#define OUT_FATAL out_fatal
+#define OUT_FATAL_ABORT out_fatal
+
+#else
+
+static __attribute__((always_inline)) inline void
+out_log_discard(const char *file, int line, const char *func, int level,
+               const char *fmt, ...)
+{
+       (void) file;
+       (void) line;
+       (void) func;
+       (void) level;
+       (void) fmt;
+}
+
+static __attribute__((always_inline)) inline void
+out_nonl_discard(int level, const char *fmt, ...)
+{
+       (void) level;
+       (void) fmt;
+}
+
+static __attribute__((always_inline)) OUT_FATAL_DISCARD_NORETURN inline void
+out_fatal_discard(const char *file, int line, const char *func,
+               const char *fmt, ...)
+{
+       (void) file;
+       (void) line;
+       (void) func;
+       (void) fmt;
+}
+
+static __attribute__((always_inline)) NORETURN inline void
+out_fatal_abort(const char *file, int line, const char *func,
+               const char *fmt, ...)
+{
+       (void) file;
+       (void) line;
+       (void) func;
+       (void) fmt;
+
+       abort();
+}
+
+#define OUT_LOG out_log_discard
+#define OUT_NONL out_nonl_discard
+#define OUT_FATAL out_fatal_discard
+#define OUT_FATAL_ABORT out_fatal_abort
+
+#endif
+
+#if defined(__KLOCWORK__)
+#define TEST_ALWAYS_TRUE_EXPR(cnd)
+#define TEST_ALWAYS_EQ_EXPR(cnd)
+#define TEST_ALWAYS_NE_EXPR(cnd)
+#else
+#define TEST_ALWAYS_TRUE_EXPR(cnd)\
+       if (__builtin_constant_p(cnd))\
+               ASSERT_COMPILE_ERROR_ON(cnd);
+#define TEST_ALWAYS_EQ_EXPR(lhs, rhs)\
+       if (__builtin_constant_p(lhs) && __builtin_constant_p(rhs))\
+               ASSERT_COMPILE_ERROR_ON((lhs) == (rhs));
+#define TEST_ALWAYS_NE_EXPR(lhs, rhs)\
+       if (__builtin_constant_p(lhs) && __builtin_constant_p(rhs))\
+               ASSERT_COMPILE_ERROR_ON((lhs) != (rhs));
+#endif
+
+/* produce debug/trace output */
+#define LOG(level, ...) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS) break;\
+       OUT_LOG(__FILE__, __LINE__, __func__, level, __VA_ARGS__);\
+} while (0)
+
+/* produce debug/trace output without prefix and new line */
+#define LOG_NONL(level, ...) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS) break; \
+       OUT_NONL(level, __VA_ARGS__); \
+} while (0)
+
+/* produce output and exit */
+#define FATAL(...)\
+       OUT_FATAL_ABORT(__FILE__, __LINE__, __func__, __VA_ARGS__)
+
+/* assert a condition is true at runtime */
+#define ASSERT_rt(cnd) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS || (cnd)) break; \
+       OUT_FATAL(__FILE__, __LINE__, __func__, "assertion failure: %s", #cnd);\
+} while (0)
+
+/* assertion with extra info printed if assertion fails at runtime */
+#define ASSERTinfo_rt(cnd, info) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS || (cnd)) break; \
+       OUT_FATAL(__FILE__, __LINE__, __func__, \
+               "assertion failure: %s (%s = %s)", #cnd, #info, info);\
+} while (0)
+
+/* assert two integer values are equal at runtime */
+#define ASSERTeq_rt(lhs, rhs) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS || ((lhs) == (rhs))) break; \
+       OUT_FATAL(__FILE__, __LINE__, __func__,\
+       "assertion failure: %s (0x%llx) == %s (0x%llx)", #lhs,\
+       (unsigned long long)(lhs), #rhs, (unsigned long long)(rhs)); \
+} while (0)
+
+/* assert two integer values are not equal at runtime */
+#define ASSERTne_rt(lhs, rhs) do { \
+       if (!EVALUATE_DBG_EXPRESSIONS || ((lhs) != (rhs))) break; \
+       OUT_FATAL(__FILE__, __LINE__, __func__,\
+       "assertion failure: %s (0x%llx) != %s (0x%llx)", #lhs,\
+       (unsigned long long)(lhs), #rhs, (unsigned long long)(rhs)); \
+} while (0)
+
+/* assert a condition is true */
+#define ASSERT(cnd)\
+       do {\
+               /*\
+                * Detect useless asserts on always true expression. Please use\
+                * COMPILE_ERROR_ON(!cnd) or ASSERT_rt(cnd) in such cases.\
+                */\
+               TEST_ALWAYS_TRUE_EXPR(cnd);\
+               ASSERT_rt(cnd);\
+       } while (0)
+
+/* assertion with extra info printed if assertion fails */
+#define ASSERTinfo(cnd, info)\
+       do {\
+               /* See comment in ASSERT. */\
+               TEST_ALWAYS_TRUE_EXPR(cnd);\
+               ASSERTinfo_rt(cnd, info);\
+       } while (0)
+
+/* assert two integer values are equal */
+#define ASSERTeq(lhs, rhs)\
+       do {\
+               /* See comment in ASSERT. */\
+               TEST_ALWAYS_EQ_EXPR(lhs, rhs);\
+               ASSERTeq_rt(lhs, rhs);\
+       } while (0)
+
+/* assert two integer values are not equal */
+#define ASSERTne(lhs, rhs)\
+       do {\
+               /* See comment in ASSERT. */\
+               TEST_ALWAYS_NE_EXPR(lhs, rhs);\
+               ASSERTne_rt(lhs, rhs);\
+       } while (0)
+
+#define ERR(...)\
+       out_err(__FILE__, __LINE__, __func__, __VA_ARGS__)
+
+void out_init(const char *log_prefix, const char *log_level_var,
+               const char *log_file_var, int major_version,
+               int minor_version);
+void out_fini(void);
+void out(const char *fmt, ...) FORMAT_PRINTF(1, 2);
+void out_nonl(int level, const char *fmt, ...) FORMAT_PRINTF(2, 3);
+void out_log(const char *file, int line, const char *func, int level,
+       const char *fmt, ...) FORMAT_PRINTF(5, 6);
+void out_err(const char *file, int line, const char *func,
+       const char *fmt, ...) FORMAT_PRINTF(4, 5);
+void NORETURN out_fatal(const char *file, int line, const char *func,
+       const char *fmt, ...) FORMAT_PRINTF(4, 5);
+void out_set_print_func(void (*print_func)(const char *s));
+void out_set_vsnprintf_func(int (*vsnprintf_func)(char *str, size_t size,
+       const char *format, va_list ap));
+
+#ifdef _WIN32
+#ifndef PMDK_UTF8_API
+#define out_get_errormsg out_get_errormsgW
+#else
+#define out_get_errormsg out_get_errormsgU
+#endif
+#endif
+
+#ifndef _WIN32
+const char *out_get_errormsg(void);
+#else
+const char *out_get_errormsgU(void);
+const wchar_t *out_get_errormsgW(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/core/pmemcore.h b/ceph/src/pmdk/src/core/pmemcore.h
new file mode 100644 (file)
index 0000000..8291ad1
--- /dev/null
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * pmemcore.h -- definitions for "core" module
+ */
+
+#ifndef PMEMCORE_H
+#define PMEMCORE_H 1
+
+#include "util.h"
+#include "out.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * core_init -- core module initialization
+ */
+static inline void
+core_init(const char *log_prefix, const char *log_level_var,
+               const char *log_file_var, int major_version,
+               int minor_version)
+{
+       util_init();
+       out_init(log_prefix, log_level_var, log_file_var, major_version,
+               minor_version);
+}
+
+/*
+ * core_fini -- core module cleanup
+ */
+static inline void
+core_fini(void)
+{
+       out_fini();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/core/pmemcore.inc b/ceph/src/pmdk/src/core/pmemcore.inc
new file mode 100644 (file)
index 0000000..8332091
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 2020, Intel Corporation
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#
+#     * Neither the name of the copyright holder nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# src/pmemcore.inc -- core SOURCE definitions for PMDK libraries
+#
+
+SOURCE +=\
+       $(CORE)/alloc.c\
+       $(CORE)/fs_posix.c\
+       $(CORE)/os_posix.c\
+       $(CORE)/os_thread_posix.c\
+       $(CORE)/out.c\
+       $(CORE)/util.c\
+       $(CORE)/util_posix.c
diff --git a/ceph/src/pmdk/src/core/util.c b/ceph/src/pmdk/src/core/util.c
new file mode 100644 (file)
index 0000000..b0fd121
--- /dev/null
@@ -0,0 +1,494 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * util.c -- very basic utilities
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <endian.h>
+#include <errno.h>
+#include <time.h>
+#include <stdarg.h>
+
+#include "util.h"
+#include "os.h"
+#include "valgrind_internal.h"
+#include "alloc.h"
+
+/* library-wide page size */
+unsigned long long Pagesize;
+
+/* allocation/mmap granularity */
+unsigned long long Mmap_align;
+
+#if ANY_VG_TOOL_ENABLED
+/* Initialized to true if the process is running inside Valgrind. */
+unsigned _On_valgrind;
+#endif
+
+#if VG_HELGRIND_ENABLED
+/* Initialized to true if the process is running inside Valgrind helgrind. */
+unsigned _On_helgrind;
+#endif
+
+#if VG_DRD_ENABLED
+/* Initialized to true if the process is running inside Valgrind drd. */
+unsigned _On_drd;
+#endif
+
+#if VG_HELGRIND_ENABLED || VG_DRD_ENABLED
+/* Initialized to true if the process is running inside Valgrind drd or hg. */
+unsigned _On_drd_or_hg;
+#endif
+
+#if VG_MEMCHECK_ENABLED
+/* Initialized to true if the process is running inside Valgrind memcheck. */
+unsigned _On_memcheck;
+#endif
+
+#if VG_PMEMCHECK_ENABLED
+/* Initialized to true if the process is running inside Valgrind pmemcheck. */
+unsigned _On_pmemcheck;
+
+#define LIB_LOG_LEN 20
+#define FUNC_LOG_LEN 50
+#define SUFFIX_LEN 7
+
+/* true if pmreorder instrumentation has to be enabled */
+int _Pmreorder_emit;
+
+/*
+ * util_emit_log -- emits lib and func name with appropriate suffix
+ * to pmemcheck store log file
+ */
+void
+util_emit_log(const char *lib, const char *func, int order)
+{
+       char lib_name[LIB_LOG_LEN];
+       char func_name[FUNC_LOG_LEN];
+       char suffix[SUFFIX_LEN];
+       size_t lib_len = strlen(lib);
+       size_t func_len = strlen(func);
+
+       if (order == 0)
+               strcpy(suffix, ".BEGIN");
+       else
+               strcpy(suffix, ".END");
+
+       size_t suffix_len = strlen(suffix);
+
+       if (lib_len + suffix_len + 1 > LIB_LOG_LEN) {
+               VALGRIND_EMIT_LOG("Library name is too long");
+               return;
+       }
+
+       if (func_len + suffix_len + 1 > FUNC_LOG_LEN) {
+               VALGRIND_EMIT_LOG("Function name is too long");
+               return;
+       }
+
+       strcpy(lib_name, lib);
+       strcat(lib_name, suffix);
+       strcpy(func_name, func);
+       strcat(func_name, suffix);
+
+       if (order == 0) {
+               VALGRIND_EMIT_LOG(func_name);
+               VALGRIND_EMIT_LOG(lib_name);
+       } else {
+               VALGRIND_EMIT_LOG(lib_name);
+               VALGRIND_EMIT_LOG(func_name);
+       }
+}
+#endif
+
+/*
+ * util_is_zeroed -- check if given memory range is all zero
+ */
+int
+util_is_zeroed(const void *addr, size_t len)
+{
+       const char *a = addr;
+
+       if (len == 0)
+               return 1;
+
+       if (a[0] == 0 && memcmp(a, a + 1, len - 1) == 0)
+               return 1;
+
+       return 0;
+}
+
+/*
+ * util_checksum_compute -- compute Fletcher64-like checksum
+ *
+ * csump points to where the checksum lives, so that location
+ * is treated as zeros while calculating the checksum. The
+ * checksummed data is assumed to be in little endian order.
+ */
+uint64_t
+util_checksum_compute(void *addr, size_t len, uint64_t *csump, size_t skip_off)
+{
+       if (len % 4 != 0)
+               abort();
+
+       uint32_t *p32 = addr;
+       uint32_t *p32end = (uint32_t *)((char *)addr + len);
+       uint32_t *skip;
+       uint32_t lo32 = 0;
+       uint32_t hi32 = 0;
+
+       if (skip_off)
+               skip = (uint32_t *)((char *)addr + skip_off);
+       else
+               skip = (uint32_t *)((char *)addr + len);
+
+       while (p32 < p32end)
+               if (p32 == (uint32_t *)csump || p32 >= skip) {
+                       /* lo32 += 0; treat first 32-bits as zero */
+                       p32++;
+                       hi32 += lo32;
+                       /* lo32 += 0; treat second 32-bits as zero */
+                       p32++;
+                       hi32 += lo32;
+               } else {
+                       lo32 += le32toh(*p32);
+                       ++p32;
+                       hi32 += lo32;
+               }
+
+       return (uint64_t)hi32 << 32 | lo32;
+}
+
+/*
+ * util_checksum -- compute Fletcher64-like checksum
+ *
+ * csump points to where the checksum lives, so that location
+ * is treated as zeros while calculating the checksum.
+ * If insert is true, the calculated checksum is inserted into
+ * the range at *csump.  Otherwise the calculated checksum is
+ * checked against *csump and the result returned (true means
+ * the range checksummed correctly).
+ */
+int
+util_checksum(void *addr, size_t len, uint64_t *csump,
+               int insert, size_t skip_off)
+{
+       uint64_t csum = util_checksum_compute(addr, len, csump, skip_off);
+
+       if (insert) {
+               *csump = htole64(csum);
+               return 1;
+       }
+
+       return *csump == htole64(csum);
+}
+
+/*
+ * util_checksum_seq -- compute sequential Fletcher64-like checksum
+ *
+ * Merges checksum from the old buffer with checksum for current buffer.
+ */
+uint64_t
+util_checksum_seq(const void *addr, size_t len, uint64_t csum)
+{
+       if (len % 4 != 0)
+               abort();
+       const uint32_t *p32 = addr;
+       const uint32_t *p32end = (const uint32_t *)((const char *)addr + len);
+       uint32_t lo32 = (uint32_t)csum;
+       uint32_t hi32 = (uint32_t)(csum >> 32);
+       while (p32 < p32end) {
+               lo32 += le32toh(*p32);
+               ++p32;
+               hi32 += lo32;
+       }
+       return (uint64_t)hi32 << 32 | lo32;
+}
+
+/*
+ * util_fgets -- fgets wrapper with conversion CRLF to LF
+ */
+char *
+util_fgets(char *buffer, int max, FILE *stream)
+{
+       char *str = fgets(buffer, max, stream);
+       if (str == NULL)
+               goto end;
+
+       int len = (int)strlen(str);
+       if (len < 2)
+               goto end;
+       if (str[len - 2] == '\r' && str[len - 1] == '\n') {
+               str[len - 2] = '\n';
+               str[len - 1] = '\0';
+       }
+end:
+       return str;
+}
+
+struct suff {
+       const char *suff;
+       uint64_t mag;
+};
+
+/*
+ * util_parse_size -- parse size from string
+ */
+int
+util_parse_size(const char *str, size_t *sizep)
+{
+       const struct suff suffixes[] = {
+               { "B", 1ULL },
+               { "K", 1ULL << 10 },            /* JEDEC */
+               { "M", 1ULL << 20 },
+               { "G", 1ULL << 30 },
+               { "T", 1ULL << 40 },
+               { "P", 1ULL << 50 },
+               { "KiB", 1ULL << 10 },          /* IEC */
+               { "MiB", 1ULL << 20 },
+               { "GiB", 1ULL << 30 },
+               { "TiB", 1ULL << 40 },
+               { "PiB", 1ULL << 50 },
+               { "kB", 1000ULL },              /* SI */
+               { "MB", 1000ULL * 1000 },
+               { "GB", 1000ULL * 1000 * 1000 },
+               { "TB", 1000ULL * 1000 * 1000 * 1000 },
+               { "PB", 1000ULL * 1000 * 1000 * 1000 * 1000 }
+       };
+
+       int res = -1;
+       unsigned i;
+       size_t size = 0;
+       char unit[9] = {0};
+
+       int ret = sscanf(str, "%zu%8s", &size, unit);
+       if (ret == 1) {
+               res = 0;
+       } else if (ret == 2) {
+               for (i = 0; i < ARRAY_SIZE(suffixes); ++i) {
+                       if (strcmp(suffixes[i].suff, unit) == 0) {
+                               size = size * suffixes[i].mag;
+                               res = 0;
+                               break;
+                       }
+               }
+       } else {
+               return -1;
+       }
+
+       if (sizep && res == 0)
+               *sizep = size;
+       return res;
+}
+
+/*
+ * util_init -- initialize the utils
+ *
+ * This is called from the library initialization code.
+ */
+void
+util_init(void)
+{
+       /* XXX - replace sysconf() with util_get_sys_xxx() */
+       if (Pagesize == 0)
+               Pagesize = (unsigned long) sysconf(_SC_PAGESIZE);
+
+#ifndef _WIN32
+       Mmap_align = Pagesize;
+#else
+       if (Mmap_align == 0) {
+               SYSTEM_INFO si;
+               GetSystemInfo(&si);
+               Mmap_align = si.dwAllocationGranularity;
+       }
+#endif
+
+#if ANY_VG_TOOL_ENABLED
+       _On_valgrind = RUNNING_ON_VALGRIND;
+#endif
+
+#if VG_MEMCHECK_ENABLED
+       if (_On_valgrind) {
+               unsigned tmp;
+               unsigned result;
+               unsigned res = VALGRIND_GET_VBITS(&tmp, &result, sizeof(tmp));
+               _On_memcheck = res ? 1 : 0;
+       } else {
+               _On_memcheck = 0;
+       }
+#endif
+
+#if VG_DRD_ENABLED
+       if (_On_valgrind)
+               _On_drd = DRD_GET_DRD_THREADID ? 1 : 0;
+       else
+               _On_drd = 0;
+#endif
+
+#if VG_HELGRIND_ENABLED
+       if (_On_valgrind) {
+               unsigned tmp;
+               unsigned result;
+               /*
+                * As of now (pmem-3.15) VALGRIND_HG_GET_ABITS is broken on
+                * the upstream version of Helgrind headers. It generates
+                * a sign-conversion error and actually returns UINT32_MAX-1
+                * when not running under Helgrind.
+                */
+               long res = VALGRIND_HG_GET_ABITS(&tmp, &result, sizeof(tmp));
+               _On_helgrind = res != -2 ? 1 : 0;
+       } else {
+               _On_helgrind = 0;
+       }
+#endif
+
+#if VG_DRD_ENABLED || VG_HELGRIND_ENABLED
+       _On_drd_or_hg = (unsigned)(On_helgrind + On_drd);
+#endif
+
+#if VG_PMEMCHECK_ENABLED
+       if (On_valgrind) {
+               char *pmreorder_env = os_getenv("PMREORDER_EMIT_LOG");
+               if (pmreorder_env)
+                       _Pmreorder_emit = atoi(pmreorder_env);
+
+               VALGRIND_PMC_REGISTER_PMEM_MAPPING(&_On_pmemcheck,
+                               sizeof(_On_pmemcheck));
+               unsigned pmc = (unsigned)VALGRIND_PMC_CHECK_IS_PMEM_MAPPING(
+                               &_On_pmemcheck, sizeof(_On_pmemcheck));
+               VALGRIND_PMC_REMOVE_PMEM_MAPPING(&_On_pmemcheck,
+                               sizeof(_On_pmemcheck));
+               _On_pmemcheck = pmc ? 1 : 0;
+       } else {
+               _On_pmemcheck = 0;
+               _Pmreorder_emit = 0;
+       }
+#endif
+}
+
+/*
+ * util_concat_str -- concatenate two strings
+ */
+char *
+util_concat_str(const char *s1, const char *s2)
+{
+       char *result = malloc(strlen(s1) + strlen(s2) + 1);
+       if (!result)
+               return NULL;
+
+       strcpy(result, s1);
+       strcat(result, s2);
+
+       return result;
+}
+
+/*
+ * util_localtime -- a wrapper for localtime function
+ *
+ * localtime can set nonzero errno even if it succeeds (e.g. when there is no
+ * /etc/localtime file under Linux) and we do not want the errno to be polluted
+ * in such cases.
+ */
+struct tm *
+util_localtime(const time_t *timep)
+{
+       int oerrno = errno;
+       struct tm *tm = localtime(timep);
+       if (tm != NULL)
+               errno = oerrno;
+
+       return tm;
+}
+
+/*
+ * util_safe_strcpy -- copies string from src to dst, returns -1
+ * when length of source string (including null-terminator)
+ * is greater than max_length, 0 otherwise
+ *
+ * For gcc (found in version 8.1.1) calling this function with
+ * max_length equal to dst size produces -Wstringop-truncation warning
+ *
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85902
+ */
+#ifdef STRINGOP_TRUNCATION_SUPPORTED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
+int
+util_safe_strcpy(char *dst, const char *src, size_t max_length)
+{
+       if (max_length == 0)
+               return -1;
+
+       strncpy(dst, src, max_length);
+
+       return dst[max_length - 1] == '\0' ? 0 : -1;
+}
+#ifdef STRINGOP_TRUNCATION_SUPPORTED
+#pragma GCC diagnostic pop
+#endif
+
+#define PARSER_MAX_LINE (PATH_MAX + 1024)
+
+/*
+ * util_snprintf -- run snprintf; in case of truncation or a failure
+ * return a negative value, or the number of characters printed otherwise.
+ */
+int
+util_snprintf(char *str, size_t size, const char *format, ...)
+{
+       va_list ap;
+       va_start(ap, format);
+       int ret = vsnprintf(str, size, format, ap);
+       va_end(ap);
+
+       if (ret < 0) {
+               if (!errno)
+                       errno = EIO;
+               goto err;
+       } else if ((size_t)ret >= size) {
+               errno = ENOBUFS;
+               goto err;
+       }
+
+       return ret;
+err:
+       return -1;
+}
+
+/*
+ * util_readline -- read line from stream
+ */
+char *
+util_readline(FILE *fh)
+{
+       size_t bufsize = PARSER_MAX_LINE;
+       size_t position = 0;
+       char *buffer = NULL;
+
+       do {
+               char *tmp = buffer;
+               buffer = Realloc(buffer, bufsize);
+               if (buffer == NULL) {
+                       Free(tmp);
+                       return NULL;
+               }
+
+               /* ensure if we can cast bufsize to int */
+               char *s = util_fgets(buffer + position, (int)bufsize / 2, fh);
+               if (s == NULL) {
+                       Free(buffer);
+                       return NULL;
+               }
+
+               position = strlen(buffer);
+               bufsize *= 2;
+       } while (!feof(fh) && buffer[position - 1] != '\n');
+
+       return buffer;
+}
diff --git a/ceph/src/pmdk/src/core/util.h b/ceph/src/pmdk/src/core/util.h
new file mode 100644 (file)
index 0000000..bf6339e
--- /dev/null
@@ -0,0 +1,541 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016-2020, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * util.h -- internal definitions for util module
+ */
+
+#ifndef PMDK_UTIL_H
+#define PMDK_UTIL_H 1
+
+#include <string.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef _MSC_VER
+#include <intrin.h> /* popcnt, bitscan */
+#endif
+
+#include <sys/param.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern unsigned long long Pagesize;
+extern unsigned long long Mmap_align;
+
+#if defined(__x86_64) || defined(_M_X64) || defined(__aarch64__)
+#define CACHELINE_SIZE 64ULL
+#elif defined(__PPC64__)
+#define CACHELINE_SIZE 128ULL
+#else
+#error unable to recognize architecture at compile time
+#endif
+
+#define PAGE_ALIGNED_DOWN_SIZE(size) ((size) & ~(Pagesize - 1))
+#define PAGE_ALIGNED_UP_SIZE(size)\
+       PAGE_ALIGNED_DOWN_SIZE((size) + (Pagesize - 1))
+#define IS_PAGE_ALIGNED(size) (((size) & (Pagesize - 1)) == 0)
+#define IS_MMAP_ALIGNED(size) (((size) & (Mmap_align - 1)) == 0)
+#define PAGE_ALIGN_UP(addr) ((void *)PAGE_ALIGNED_UP_SIZE((uintptr_t)(addr)))
+
+#define ALIGN_UP(size, align) (((size) + (align) - 1) & ~((align) - 1))
+#define ALIGN_DOWN(size, align) ((size) & ~((align) - 1))
+
+#define ADDR_SUM(vp, lp) ((void *)((char *)(vp) + (lp)))
+
+#define util_alignof(t) offsetof(struct {char _util_c; t _util_m; }, _util_m)
+#define FORMAT_PRINTF(a, b) __attribute__((__format__(__printf__, (a), (b))))
+
+void util_init(void);
+int util_is_zeroed(const void *addr, size_t len);
+uint64_t util_checksum_compute(void *addr, size_t len, uint64_t *csump,
+               size_t skip_off);
+int util_checksum(void *addr, size_t len, uint64_t *csump,
+               int insert, size_t skip_off);
+uint64_t util_checksum_seq(const void *addr, size_t len, uint64_t csum);
+int util_parse_size(const char *str, size_t *sizep);
+char *util_fgets(char *buffer, int max, FILE *stream);
+char *util_getexecname(char *path, size_t pathlen);
+char *util_part_realpath(const char *path);
+int util_compare_file_inodes(const char *path1, const char *path2);
+void *util_aligned_malloc(size_t alignment, size_t size);
+void util_aligned_free(void *ptr);
+struct tm *util_localtime(const time_t *timep);
+int util_safe_strcpy(char *dst, const char *src, size_t max_length);
+void util_emit_log(const char *lib, const char *func, int order);
+char *util_readline(FILE *fh);
+int util_snprintf(char *str, size_t size,
+       const char *format, ...) FORMAT_PRINTF(3, 4);
+
+#ifdef _WIN32
+char *util_toUTF8(const wchar_t *wstr);
+wchar_t *util_toUTF16(const char *wstr);
+void util_free_UTF8(char *str);
+void util_free_UTF16(wchar_t *str);
+int util_toUTF16_buff(const char *in, wchar_t *out, size_t out_size);
+int util_toUTF8_buff(const wchar_t *in, char *out, size_t out_size);
+void util_suppress_errmsg(void);
+int util_lasterror_to_errno(unsigned long err);
+#endif
+
+#define UTIL_MAX_ERR_MSG 128
+void util_strerror(int errnum, char *buff, size_t bufflen);
+void util_strwinerror(unsigned long err, char *buff, size_t bufflen);
+
+void util_set_alloc_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s));
+
+/*
+ * Macro calculates number of elements in given table
+ */
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x)  (sizeof(x) / sizeof((x)[0]))
+#endif
+
+#ifdef _MSC_VER
+#define force_inline inline __forceinline
+#define NORETURN __declspec(noreturn)
+#define barrier() _ReadWriteBarrier()
+#else
+#define force_inline __attribute__((always_inline)) inline
+#define NORETURN __attribute__((noreturn))
+#define barrier() asm volatile("" ::: "memory")
+#endif
+
+#ifdef _MSC_VER
+typedef UNALIGNED uint64_t ua_uint64_t;
+typedef UNALIGNED uint32_t ua_uint32_t;
+typedef UNALIGNED uint16_t ua_uint16_t;
+#else
+typedef uint64_t ua_uint64_t __attribute__((aligned(1)));
+typedef uint32_t ua_uint32_t __attribute__((aligned(1)));
+typedef uint16_t ua_uint16_t __attribute__((aligned(1)));
+#endif
+
+#define util_get_not_masked_bits(x, mask) ((x) & ~(mask))
+
+/*
+ * util_setbit -- setbit macro substitution which properly deals with types
+ */
+static inline void
+util_setbit(uint8_t *b, uint32_t i)
+{
+       b[i / 8] = (uint8_t)(b[i / 8] | (uint8_t)(1 << (i % 8)));
+}
+
+/*
+ * util_clrbit -- clrbit macro substitution which properly deals with types
+ */
+static inline void
+util_clrbit(uint8_t *b, uint32_t i)
+{
+       b[i / 8] = (uint8_t)(b[i / 8] & (uint8_t)(~(1 << (i % 8))));
+}
+
+#define util_isset(a, i) isset(a, i)
+#define util_isclr(a, i) isclr(a, i)
+
+#define util_flag_isset(a, f) ((a) & (f))
+#define util_flag_isclr(a, f) (((a) & (f)) == 0)
+
+/*
+ * util_is_pow2 -- returns !0 when there's only 1 bit set in v, 0 otherwise
+ */
+static force_inline int
+util_is_pow2(uint64_t v)
+{
+       return v && !(v & (v - 1));
+}
+
+/*
+ * util_div_ceil -- divides a by b and rounds up the result
+ */
+static force_inline unsigned
+util_div_ceil(unsigned a, unsigned b)
+{
+       return (unsigned)(((unsigned long)a + b - 1) / b);
+}
+
+/*
+ * util_bool_compare_and_swap -- perform an atomic compare and swap
+ * util_fetch_and_* -- perform an operation atomically, return old value
+ * util_synchronize -- issue a full memory barrier
+ * util_popcount -- count number of set bits
+ * util_lssb_index -- return index of least significant set bit,
+ *                     undefined on zero
+ * util_mssb_index -- return index of most significant set bit
+ *                     undefined on zero
+ *
+ * XXX assertions needed on (value != 0) in both versions of bitscans
+ *
+ */
+
+#ifndef _MSC_VER
+/*
+ * ISO C11 -- 7.17.1.4
+ * memory_order - an enumerated type whose enumerators identify memory ordering
+ * constraints.
+ */
+typedef enum {
+       memory_order_relaxed = __ATOMIC_RELAXED,
+       memory_order_consume = __ATOMIC_CONSUME,
+       memory_order_acquire = __ATOMIC_ACQUIRE,
+       memory_order_release = __ATOMIC_RELEASE,
+       memory_order_acq_rel = __ATOMIC_ACQ_REL,
+       memory_order_seq_cst = __ATOMIC_SEQ_CST
+} memory_order;
+
+/*
+ * ISO C11 -- 7.17.7.2 The atomic_load generic functions
+ * Integer width specific versions as supplement for:
+ *
+ *
+ * #include <stdatomic.h>
+ * C atomic_load(volatile A *object);
+ * C atomic_load_explicit(volatile A *object, memory_order order);
+ *
+ * The atomic_load interface doesn't return the loaded value, but instead
+ * copies it to a specified address -- see comments at the MSVC version.
+ *
+ * Also, instead of generic functions, two versions are available:
+ * for 32 bit fundamental integers, and for 64 bit ones.
+ */
+#define util_atomic_load_explicit32 __atomic_load
+#define util_atomic_load_explicit64 __atomic_load
+
+/*
+ * ISO C11 -- 7.17.7.1 The atomic_store generic functions
+ * Integer width specific versions as supplement for:
+ *
+ * #include <stdatomic.h>
+ * void atomic_store(volatile A *object, C desired);
+ * void atomic_store_explicit(volatile A *object, C desired,
+ *                            memory_order order);
+ */
+#define util_atomic_store_explicit32 __atomic_store_n
+#define util_atomic_store_explicit64 __atomic_store_n
+
+/*
+ * https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html
+ * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
+ * https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions
+ */
+#define util_bool_compare_and_swap32 __sync_bool_compare_and_swap
+#define util_bool_compare_and_swap64 __sync_bool_compare_and_swap
+#define util_fetch_and_add32 __sync_fetch_and_add
+#define util_fetch_and_add64 __sync_fetch_and_add
+#define util_fetch_and_sub32 __sync_fetch_and_sub
+#define util_fetch_and_sub64 __sync_fetch_and_sub
+#define util_fetch_and_and32 __sync_fetch_and_and
+#define util_fetch_and_and64 __sync_fetch_and_and
+#define util_fetch_and_or32 __sync_fetch_and_or
+#define util_fetch_and_or64 __sync_fetch_and_or
+#define util_synchronize __sync_synchronize
+#define util_popcount(value) ((unsigned char)__builtin_popcount(value))
+#define util_popcount64(value) ((unsigned char)__builtin_popcountll(value))
+#define util_lssb_index(value) ((unsigned char)__builtin_ctz(value))
+#define util_lssb_index64(value) ((unsigned char)__builtin_ctzll(value))
+#define util_mssb_index(value) ((unsigned char)(31 - __builtin_clz(value)))
+#define util_mssb_index64(value) ((unsigned char)(63 - __builtin_clzll(value)))
+
+#else
+
+/* ISO C11 -- 7.17.1.4 */
+typedef enum {
+       memory_order_relaxed,
+       memory_order_consume,
+       memory_order_acquire,
+       memory_order_release,
+       memory_order_acq_rel,
+       memory_order_seq_cst
+} memory_order;
+
+/*
+ * ISO C11 -- 7.17.7.2 The atomic_load generic functions
+ * Integer width specific versions as supplement for:
+ *
+ *
+ * #include <stdatomic.h>
+ * C atomic_load(volatile A *object);
+ * C atomic_load_explicit(volatile A *object, memory_order order);
+ *
+ * The atomic_load interface doesn't return the loaded value, but instead
+ * copies it to a specified address.
+ * The MSVC specific implementation needs to trigger a barrier (at least
+ * compiler barrier) after the load from the volatile value. The actual load
+ * from the volatile value itself is expected to be atomic.
+ *
+ * The actual isnterface here:
+ * #include "util.h"
+ * void util_atomic_load32(volatile A *object, A *destination);
+ * void util_atomic_load64(volatile A *object, A *destination);
+ * void util_atomic_load_explicit32(volatile A *object, A *destination,
+ *                                  memory_order order);
+ * void util_atomic_load_explicit64(volatile A *object, A *destination,
+ *                                  memory_order order);
+ */
+
+#ifndef _M_X64
+#error MSVC ports of util_atomic_ only work on X86_64
+#endif
+
+#if _MSC_VER >= 2000
+#error util_atomic_ utility functions not tested with this version of VC++
+#error These utility functions are not future proof, as they are not
+#error based on publicly available documentation.
+#endif
+
+#define util_atomic_load_explicit(object, dest, order)\
+       do {\
+               COMPILE_ERROR_ON(order != memory_order_seq_cst &&\
+                               order != memory_order_consume &&\
+                               order != memory_order_acquire &&\
+                               order != memory_order_relaxed);\
+               *dest = *object;\
+               if (order == memory_order_seq_cst ||\
+                   order == memory_order_consume ||\
+                   order == memory_order_acquire)\
+               _ReadWriteBarrier();\
+       } while (0)
+
+#define util_atomic_load_explicit32 util_atomic_load_explicit
+#define util_atomic_load_explicit64 util_atomic_load_explicit
+
+/* ISO C11 -- 7.17.7.1 The atomic_store generic functions */
+
+#define util_atomic_store_explicit64(object, desired, order)\
+       do {\
+               COMPILE_ERROR_ON(order != memory_order_seq_cst &&\
+                               order != memory_order_release &&\
+                               order != memory_order_relaxed);\
+               if (order == memory_order_seq_cst) {\
+                       _InterlockedExchange64(\
+                                   (volatile long long *)object, desired);\
+               } else {\
+                       if (order == memory_order_release)\
+                               _ReadWriteBarrier();\
+                       *object = desired;\
+               }\
+       } while (0)
+
+#define util_atomic_store_explicit32(object, desired, order)\
+       do {\
+               COMPILE_ERROR_ON(order != memory_order_seq_cst &&\
+                               order != memory_order_release &&\
+                               order != memory_order_relaxed);\
+               if (order == memory_order_seq_cst) {\
+                       _InterlockedExchange(\
+                                   (volatile long *)object, desired);\
+               } else {\
+                       if (order == memory_order_release)\
+                               _ReadWriteBarrier();\
+                       *object = desired;\
+               }\
+       } while (0)
+
+/*
+ * https://msdn.microsoft.com/en-us/library/hh977022.aspx
+ */
+
+static __inline int
+bool_compare_and_swap32_VC(volatile LONG *ptr,
+               LONG oldval, LONG newval)
+{
+       LONG old = InterlockedCompareExchange(ptr, newval, oldval);
+       return (old == oldval);
+}
+
+static __inline int
+bool_compare_and_swap64_VC(volatile LONG64 *ptr,
+               LONG64 oldval, LONG64 newval)
+{
+       LONG64 old = InterlockedCompareExchange64(ptr, newval, oldval);
+       return (old == oldval);
+}
+
+#define util_bool_compare_and_swap32(p, o, n)\
+       bool_compare_and_swap32_VC((LONG *)(p), (LONG)(o), (LONG)(n))
+#define util_bool_compare_and_swap64(p, o, n)\
+       bool_compare_and_swap64_VC((LONG64 *)(p), (LONG64)(o), (LONG64)(n))
+#define util_fetch_and_add32(ptr, value)\
+    InterlockedExchangeAdd((LONG *)(ptr), value)
+#define util_fetch_and_add64(ptr, value)\
+    InterlockedExchangeAdd64((LONG64 *)(ptr), value)
+#define util_fetch_and_sub32(ptr, value)\
+    InterlockedExchangeSubtract((LONG *)(ptr), value)
+#define util_fetch_and_sub64(ptr, value)\
+    InterlockedExchangeAdd64((LONG64 *)(ptr), -((LONG64)(value)))
+#define util_fetch_and_and32(ptr, value)\
+    InterlockedAnd((LONG *)(ptr), value)
+#define util_fetch_and_and64(ptr, value)\
+    InterlockedAnd64((LONG64 *)(ptr), value)
+#define util_fetch_and_or32(ptr, value)\
+    InterlockedOr((LONG *)(ptr), value)
+#define util_fetch_and_or64(ptr, value)\
+    InterlockedOr64((LONG64 *)(ptr), value)
+
+static __inline void
+util_synchronize(void)
+{
+       MemoryBarrier();
+}
+
+#define util_popcount(value) (unsigned char)__popcnt(value)
+#define util_popcount64(value) (unsigned char)__popcnt64(value)
+
+static __inline unsigned char
+util_lssb_index(int value)
+{
+       unsigned long ret;
+       _BitScanForward(&ret, value);
+       return (unsigned char)ret;
+}
+
+static __inline unsigned char
+util_lssb_index64(long long value)
+{
+       unsigned long ret;
+       _BitScanForward64(&ret, value);
+       return (unsigned char)ret;
+}
+
+static __inline unsigned char
+util_mssb_index(int value)
+{
+       unsigned long ret;
+       _BitScanReverse(&ret, value);
+       return (unsigned char)ret;
+}
+
+static __inline unsigned char
+util_mssb_index64(long long value)
+{
+       unsigned long ret;
+       _BitScanReverse64(&ret, value);
+       return (unsigned char)ret;
+}
+
+#endif
+
+/* ISO C11 -- 7.17.7 Operations on atomic types */
+#define util_atomic_load32(object, dest)\
+       util_atomic_load_explicit32(object, dest, memory_order_seq_cst)
+#define util_atomic_load64(object, dest)\
+       util_atomic_load_explicit64(object, dest, memory_order_seq_cst)
+
+#define util_atomic_store32(object, desired)\
+       util_atomic_store_explicit32(object, desired, memory_order_seq_cst)
+#define util_atomic_store64(object, desired)\
+       util_atomic_store_explicit64(object, desired, memory_order_seq_cst)
+
+/*
+ * util_get_printable_ascii -- convert non-printable ascii to dot '.'
+ */
+static inline char
+util_get_printable_ascii(char c)
+{
+       return isprint((unsigned char)c) ? c : '.';
+}
+
+char *util_concat_str(const char *s1, const char *s2);
+
+#if !defined(likely)
+#if defined(__GNUC__)
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#else
+#define likely(x) (!!(x))
+#define unlikely(x) (!!(x))
+#endif
+#endif
+
+#if defined(__CHECKER__)
+#define COMPILE_ERROR_ON(cond)
+#define ASSERT_COMPILE_ERROR_ON(cond)
+#elif defined(_MSC_VER)
+#define COMPILE_ERROR_ON(cond) C_ASSERT(!(cond))
+/* XXX - can't be done with C_ASSERT() unless we have __builtin_constant_p() */
+#define ASSERT_COMPILE_ERROR_ON(cond) do {} while (0)
+#else
+#define COMPILE_ERROR_ON(cond) ((void)sizeof(char[(cond) ? -1 : 1]))
+#define ASSERT_COMPILE_ERROR_ON(cond) COMPILE_ERROR_ON(cond)
+#endif
+
+#ifndef _MSC_VER
+#define ATTR_CONSTRUCTOR __attribute__((constructor)) static
+#define ATTR_DESTRUCTOR __attribute__((destructor)) static
+#else
+#define ATTR_CONSTRUCTOR
+#define ATTR_DESTRUCTOR
+#endif
+
+#ifndef _MSC_VER
+#define CONSTRUCTOR(fun) ATTR_CONSTRUCTOR
+#else
+#ifdef __cplusplus
+#define CONSTRUCTOR(fun)               \
+void fun();                            \
+struct _##fun {                        \
+       _##fun() {                      \
+               fun();                  \
+       }                               \
+}; static  _##fun foo;                 \
+static
+#else
+#define CONSTRUCTOR(fun) \
+       MSVC_CONSTR(fun) \
+       static
+#endif
+#endif
+
+#ifdef __GNUC__
+#define CHECK_FUNC_COMPATIBLE(func1, func2)\
+       COMPILE_ERROR_ON(!__builtin_types_compatible_p(typeof(func1),\
+                                                               typeof(func2)))
+#else
+#define CHECK_FUNC_COMPATIBLE(func1, func2) do {} while (0)
+#endif /* __GNUC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* util.h */
diff --git a/ceph/src/pmdk/src/core/util_posix.c b/ceph/src/pmdk/src/core/util_posix.c
new file mode 100644 (file)
index 0000000..98765a1
--- /dev/null
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * util_posix.c -- Abstraction layer for misc utilities (Posix implementation)
+ */
+
+#include <string.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include "os.h"
+#include "out.h"
+#include "util.h"
+
+/* pass through for Posix */
+void
+util_strerror(int errnum, char *buff, size_t bufflen)
+{
+       strerror_r(errnum, buff, bufflen);
+}
+
+/*
+ * util_strwinerror -- should never be called on posix OS - abort()
+ */
+void
+util_strwinerror(unsigned long err, char *buff, size_t bufflen)
+{
+       abort();
+}
+
+/*
+ * util_part_realpath -- get canonicalized absolute pathname
+ *
+ * As paths used in a poolset file have to be absolute (checked when parsing
+ * a poolset file), here we only have to resolve symlinks.
+ */
+char *
+util_part_realpath(const char *path)
+{
+       return realpath(path, NULL);
+}
+
+/*
+ * util_compare_file_inodes -- compare device and inodes of two files;
+ *                             this resolves hard links
+ */
+int
+util_compare_file_inodes(const char *path1, const char *path2)
+{
+       struct stat sb1, sb2;
+       if (os_stat(path1, &sb1)) {
+               if (errno != ENOENT) {
+                       ERR("!stat failed for %s", path1);
+                       return -1;
+               }
+               LOG(1, "stat failed for %s", path1);
+               errno = 0;
+               return strcmp(path1, path2) != 0;
+       }
+
+       if (os_stat(path2, &sb2)) {
+               if (errno != ENOENT) {
+                       ERR("!stat failed for %s", path2);
+                       return -1;
+               }
+               LOG(1, "stat failed for %s", path2);
+               errno = 0;
+               return strcmp(path1, path2) != 0;
+       }
+
+       return sb1.st_dev != sb2.st_dev || sb1.st_ino != sb2.st_ino;
+}
+
+/*
+ * util_aligned_malloc -- allocate aligned memory
+ */
+void *
+util_aligned_malloc(size_t alignment, size_t size)
+{
+       void *retval = NULL;
+
+       errno = posix_memalign(&retval, alignment, size);
+
+       return retval;
+}
+
+/*
+ * util_aligned_free -- free allocated memory in util_aligned_malloc
+ */
+void
+util_aligned_free(void *ptr)
+{
+       free(ptr);
+}
+
+/*
+ * util_getexecname -- return name of current executable
+ */
+char *
+util_getexecname(char *path, size_t pathlen)
+{
+       ASSERT(pathlen != 0);
+       ssize_t cc;
+
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+       int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+
+       cc = (sysctl(mib, 4, path, &pathlen, NULL, 0) == -1) ?
+               -1 : (ssize_t)pathlen;
+#else
+       cc = readlink("/proc/self/exe", path, pathlen);
+#endif
+       if (cc == -1) {
+               strncpy(path, "unknown", pathlen);
+               path[pathlen - 1] = '\0';
+       } else {
+               path[cc] = '\0';
+       }
+
+       return path;
+}
diff --git a/ceph/src/pmdk/src/core/util_windows.c b/ceph/src/pmdk/src/core/util_windows.c
new file mode 100644 (file)
index 0000000..123ee61
--- /dev/null
@@ -0,0 +1,320 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * util_windows.c -- misc utilities with OS-specific implementation
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <tchar.h>
+
+#include "alloc.h"
+#include "util.h"
+#include "out.h"
+#include "os.h"
+
+/* Windows CRT doesn't support all errors, add unmapped here */
+#define ENOTSUP_STR "Operation not supported"
+#define ECANCELED_STR "Operation canceled"
+#define ENOERROR 0
+#define ENOERROR_STR "Success"
+#define UNMAPPED_STR "Unmapped error"
+
+/*
+ * util_strerror -- return string describing error number
+ *
+ * XXX: There are many other POSIX error codes that are not recognized by
+ * strerror_s(), so eventually we may want to implement this in a similar
+ * fashion as strsignal().
+ */
+void
+util_strerror(int errnum, char *buff, size_t bufflen)
+{
+       switch (errnum) {
+       case ENOERROR:
+               strcpy_s(buff, bufflen, ENOERROR_STR);
+               break;
+       case ENOTSUP:
+               strcpy_s(buff, bufflen, ENOTSUP_STR);
+               break;
+       case ECANCELED:
+               strcpy_s(buff, bufflen, ECANCELED_STR);
+               break;
+       default:
+               if (strerror_s(buff, bufflen, errnum))
+                       strcpy_s(buff, bufflen, UNMAPPED_STR);
+       }
+}
+
+/*
+ * util_strwinerror -- return string describing windows error codes
+ */
+void
+util_strwinerror(unsigned long err, char *buff, size_t bufflen)
+{
+       wchar_t *error_str;
+
+       if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                       FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS,
+                       NULL,
+                       err,
+                       0,
+                       (LPWSTR)&error_str,
+                       0, NULL) == 0) {
+               sprintf_s(buff, bufflen, "GetLastError() ==  %lu", err);
+               return;
+       }
+
+       if (util_toUTF8_buff(error_str, buff, bufflen)) {
+               LocalFree(error_str);
+               sprintf_s(buff, bufflen, "GetLastError() ==  %lu", err);
+               return;
+       }
+
+       /* let's do the error message without '\r' and '\n' at the end */
+       size_t len = strlen(buff);
+       for (size_t i = len - 1; i > 0; i--) {
+               if (buff[i] != '\r' && buff[i] != '\n') {
+                       buff[i + 1] = '\0';
+                       break;
+               }
+       }
+
+       LocalFree(error_str);
+}
+
+/*
+ * util_part_realpath -- get canonicalized absolute pathname for a part file
+ *
+ * On Windows, paths cannot be symlinks and paths used in a poolset have to
+ * be absolute (checked when parsing a poolset file), so we just return
+ * the path.
+ */
+char *
+util_part_realpath(const char *path)
+{
+       return strdup(path);
+}
+
+/*
+ * util_compare_file_inodes -- compare device and inodes of two files
+ */
+int
+util_compare_file_inodes(const char *path1, const char *path2)
+{
+       return strcmp(path1, path2) != 0;
+}
+
+/*
+ * util_aligned_malloc -- allocate aligned memory
+ */
+void *
+util_aligned_malloc(size_t alignment, size_t size)
+{
+       return _aligned_malloc(size, alignment);
+}
+
+/*
+ * util_aligned_free -- free allocated memory in util_aligned_malloc
+ */
+void
+util_aligned_free(void *ptr)
+{
+       _aligned_free(ptr);
+}
+
+/*
+ * util_toUTF8 -- allocating conversion from wide char string to UTF8
+ */
+char *
+util_toUTF8(const wchar_t *wstr)
+{
+       int size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wstr, -1,
+               NULL, 0, NULL, NULL);
+       if (size == 0)
+               goto err;
+
+       char *str = Malloc(size * sizeof(char));
+       if (str == NULL)
+               goto out;
+
+       if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wstr, -1, str,
+               size, NULL, NULL) == 0) {
+               Free(str);
+               goto err;
+       }
+
+out:
+       return str;
+
+err:
+       errno = EINVAL;
+       return NULL;
+}
+
+/*
+ * util_free_UTF8 -- free UTF8 string
+ */
+void util_free_UTF8(char *str) {
+       Free(str);
+}
+
+/*
+ * util_toUTF16 -- allocating conversion from UTF8 to wide char string
+ */
+wchar_t *
+util_toUTF16(const char *str)
+{
+       int size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1,
+               NULL, 0);
+       if (size == 0)
+               goto err;
+
+       wchar_t *wstr = Malloc(size * sizeof(wchar_t));
+       if (wstr == NULL)
+               goto out;
+
+       if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, wstr,
+               size) == 0) {
+               Free(wstr);
+               goto err;
+       }
+
+out:
+       return wstr;
+
+err:
+       errno = EINVAL;
+       return NULL;
+}
+
+/*
+ * util_free_UTF16 -- free wide char string
+ */
+void
+util_free_UTF16(wchar_t *wstr)
+{
+       Free(wstr);
+}
+
+/*
+ * util_toUTF16_buff -- non-allocating conversion from UTF8 to wide char string
+ *
+ * The user responsible for supplying a large enough out buffer.
+ */
+int
+util_toUTF16_buff(const char *in, wchar_t *out, size_t out_size)
+{
+       ASSERT(out != NULL);
+
+       int size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, in,
+               -1, NULL, 0);
+       if (size == 0 || out_size < size)
+               goto err;
+
+       if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, in, -1,
+               out, size) == 0)
+               goto err;
+
+       return 0;
+err:
+       errno = EINVAL;
+       return -1;
+}
+
+/*
+ * util_toUTF8_buff -- non-allocating conversion from wide char string to UTF8
+ *
+ * The user responsible for supplying a large enough out buffer.
+ */
+int
+util_toUTF8_buff(const wchar_t *in, char *out, size_t out_size)
+{
+       ASSERT(out != NULL);
+
+       int size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, in, -1,
+               NULL, 0, NULL, NULL);
+       if (size == 0 || out_size < size)
+               goto err;
+
+       if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, in, -1,
+               out, size, NULL, NULL) == 0)
+               goto err;
+
+       return 0;
+err:
+       errno = EINVAL;
+       return -1;
+}
+
+/*
+ * util_getexecname -- return name of current executable
+ */
+char *
+util_getexecname(char *path, size_t pathlen)
+{
+       ssize_t cc;
+       if ((cc = GetModuleFileNameA(NULL, path, (DWORD)pathlen)) == 0)
+               strcpy(path, "unknown");
+       else
+               path[cc] = '\0';
+
+       return path;
+}
+
+/*
+ * util_suppress_errmsg -- suppresses "abort" window on Windows if env variable
+ * is set, useful for automatic tests
+ */
+void
+util_suppress_errmsg(void)
+{
+       if (os_getenv("PMDK_NO_ABORT_MSG") != NULL) {
+               DWORD err = GetErrorMode();
+               SetErrorMode(err | SEM_NOGPFAULTERRORBOX |
+                       SEM_FAILCRITICALERRORS);
+               _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
+       }
+}
+
+static int Lasterror_to_errno[16000] = {
+       [ERROR_ACCESS_DENIED] = EACCES,
+       [ERROR_FILE_NOT_FOUND] = ENOENT,
+       [ERROR_INVALID_ACCESS] = EACCES,
+       [ERROR_INVALID_ADDRESS] = EINVAL,
+       [ERROR_INVALID_FUNCTION] = EINVAL,
+       [ERROR_INVALID_HANDLE] = EINVAL,
+       [ERROR_INVALID_PARAMETER] = EINVAL,
+       [ERROR_LOCK_FAILED] = EACCES,
+       [ERROR_MAPPED_ALIGNMENT] = EINVAL,
+       [ERROR_NOT_ENOUGH_MEMORY] = ENOMEM,
+       [ERROR_NOT_SUPPORTED] = ENOTSUP,
+       [ERROR_OUTOFMEMORY] = ENOMEM,
+       [ERROR_PATH_NOT_FOUND] = ENOENT,
+       [ERROR_TOO_MANY_OPEN_FILES] = EMFILE,
+};
+
+/*
+ * util_lasterror_to_errno - converts windows error codes to errno
+ */
+int
+util_lasterror_to_errno(unsigned long err)
+{
+       if (err >= ARRAY_SIZE(Lasterror_to_errno))
+               return -1;
+
+       /* no error */
+       if (err == 0)
+               return 0;
+
+       int ret = Lasterror_to_errno[err];
+
+       /* 0 is used to signalize missing entry in Lasterror_to_errno array */
+       if (ret == 0)
+               return -1;
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/core/valgrind/.cstyleignore b/ceph/src/pmdk/src/core/valgrind/.cstyleignore
new file mode 100644 (file)
index 0000000..049c177
--- /dev/null
@@ -0,0 +1,5 @@
+drd.h
+helgrind.h
+memcheck.h
+pmemcheck.h
+valgrind.h
diff --git a/ceph/src/pmdk/src/core/valgrind/README b/ceph/src/pmdk/src/core/valgrind/README
new file mode 100644 (file)
index 0000000..b5fb4f6
--- /dev/null
@@ -0,0 +1,2 @@
+Files in this directory were imported from Valgrind 3.14:
+https://github.com/pmem/valgrind
diff --git a/ceph/src/pmdk/src/core/valgrind/drd.h b/ceph/src/pmdk/src/core/valgrind/drd.h
new file mode 100644 (file)
index 0000000..d63b3dd
--- /dev/null
@@ -0,0 +1,571 @@
+/*
+  ----------------------------------------------------------------
+
+  Notice that the following BSD-style license applies to this one
+  file (drd.h) only.  The rest of Valgrind is licensed under the
+  terms of the GNU General Public License, version 2, unless
+  otherwise indicated.  See the COPYING file in the source
+  distribution for details.
+
+  ----------------------------------------------------------------
+
+  This file is part of DRD, a Valgrind tool for verification of
+  multithreaded programs.
+
+  Copyright (C) 2006-2017 Bart Van Assche <bvanassche@acm.org>.
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+  2. The origin of this software must not be misrepresented; you must
+  not claim that you wrote the original software.  If you use this
+  software in a product, an acknowledgment in the product
+  documentation would be appreciated but is not required.
+
+  3. Altered source versions must be plainly marked as such, and must
+  not be misrepresented as being the original software.
+
+  4. The name of the author may not be used to endorse or promote
+  products derived from this software without specific prior written
+  permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+  ----------------------------------------------------------------
+
+  Notice that the above BSD-style license applies to this one file
+  (drd.h) only.  The entire rest of Valgrind is licensed under
+  the terms of the GNU General Public License, version 2.  See the
+  COPYING file in the source distribution for details.
+
+  ----------------------------------------------------------------
+*/
+
+#ifndef __VALGRIND_DRD_H
+#define __VALGRIND_DRD_H
+
+
+#include "valgrind.h"
+
+
+/** Obtain the thread ID assigned by Valgrind's core. */
+#define DRD_GET_VALGRIND_THREADID                                          \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                           \
+                                   VG_USERREQ__DRD_GET_VALGRIND_THREAD_ID, \
+                                   0, 0, 0, 0, 0)
+
+/** Obtain the thread ID assigned by DRD. */
+#define DRD_GET_DRD_THREADID                                            \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                        \
+                                   VG_USERREQ__DRD_GET_DRD_THREAD_ID,   \
+                                   0, 0, 0, 0, 0)
+
+
+/** Tell DRD not to complain about data races for the specified variable. */
+#define DRD_IGNORE_VAR(x) ANNOTATE_BENIGN_RACE_SIZED(&(x), sizeof(x), "")
+
+/** Tell DRD to no longer ignore data races for the specified variable. */
+#define DRD_STOP_IGNORING_VAR(x)                                       \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_FINISH_SUPPRESSION, \
+                                   &(x), sizeof(x), 0, 0, 0)
+
+/**
+ * Tell DRD to trace all memory accesses for the specified variable
+ * until the memory that was allocated for the variable is freed.
+ */
+#define DRD_TRACE_VAR(x)                                             \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_START_TRACE_ADDR, \
+                                   &(x), sizeof(x), 0, 0, 0)
+
+/**
+ * Tell DRD to stop tracing memory accesses for the specified variable.
+ */
+#define DRD_STOP_TRACING_VAR(x)                                       \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_STOP_TRACE_ADDR, \
+                                   &(x), sizeof(x), 0, 0, 0)
+
+/**
+ * @defgroup RaceDetectionAnnotations Data race detection annotations.
+ *
+ * @see See also the source file <a href="http://code.google.com/p/data-race-test/source/browse/trunk/dynamic_annotations/dynamic_annotations.h</a>
+
+ * in the ThreadSanitizer project.
+ */
+/*@{*/
+
+#ifndef __HELGRIND_H
+
+/**
+ * Tell DRD to insert a happens-before mark. addr is the address of an object
+ * that is not a pthread synchronization object.
+ */
+#define ANNOTATE_HAPPENS_BEFORE(addr)                                       \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE, \
+                                   addr, 0, 0, 0, 0)
+
+/**
+ * Tell DRD that the memory accesses executed after this annotation will
+ * happen after all memory accesses performed before all preceding
+ * ANNOTATE_HAPPENS_BEFORE(addr). addr is the address of an object that is not
+ * a pthread synchronization object. Inserting a happens-after annotation
+ * before any other thread has passed by a happens-before annotation for the
+ * same address is an error.
+ */
+#define ANNOTATE_HAPPENS_AFTER(addr)                                       \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER, \
+                                   addr, 0, 0, 0, 0)
+
+#else /* __HELGRIND_H */
+
+#undef ANNOTATE_CONDVAR_LOCK_WAIT
+#undef ANNOTATE_CONDVAR_WAIT
+#undef ANNOTATE_CONDVAR_SIGNAL
+#undef ANNOTATE_CONDVAR_SIGNAL_ALL
+#undef ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX
+#undef ANNOTATE_PUBLISH_MEMORY_RANGE
+#undef ANNOTATE_BARRIER_INIT
+#undef ANNOTATE_BARRIER_WAIT_BEFORE
+#undef ANNOTATE_BARRIER_WAIT_AFTER
+#undef ANNOTATE_BARRIER_DESTROY
+#undef ANNOTATE_PCQ_CREATE
+#undef ANNOTATE_PCQ_DESTROY
+#undef ANNOTATE_PCQ_PUT
+#undef ANNOTATE_PCQ_GET
+#undef ANNOTATE_BENIGN_RACE
+#undef ANNOTATE_BENIGN_RACE_SIZED
+#undef ANNOTATE_IGNORE_READS_BEGIN
+#undef ANNOTATE_IGNORE_READS_END
+#undef ANNOTATE_IGNORE_WRITES_BEGIN
+#undef ANNOTATE_IGNORE_WRITES_END
+#undef ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN
+#undef ANNOTATE_IGNORE_READS_AND_WRITES_END
+#undef ANNOTATE_NEW_MEMORY
+#undef ANNOTATE_TRACE_MEMORY
+#undef ANNOTATE_THREAD_NAME
+
+#endif /* __HELGRIND_H */
+
+/**
+ * Tell DRD that waiting on the condition variable at address cv has succeeded
+ * and a lock on the mutex at address mtx is now held. Since DRD always inserts
+ * a happens before relation between the pthread_cond_signal() or
+ * pthread_cond_broadcast() call that wakes up a pthread_cond_wait() or
+ * pthread_cond_timedwait() call and the woken up thread, this macro has been
+ * defined such that it has no effect.
+ */
+#define ANNOTATE_CONDVAR_LOCK_WAIT(cv, mtx) do { } while(0)
+
+/**
+ * Tell DRD that the condition variable at address cv is about to be signaled.
+ */
+#define ANNOTATE_CONDVAR_SIGNAL(cv) do { } while(0)
+
+/**
+ * Tell DRD that the condition variable at address cv is about to be signaled.
+ */
+#define ANNOTATE_CONDVAR_SIGNAL_ALL(cv) do { } while(0)
+
+/**
+ * Tell DRD that waiting on condition variable at address cv succeeded and that
+ * the memory operations performed after this annotation should be considered
+ * to happen after the matching ANNOTATE_CONDVAR_SIGNAL(cv). Since this is the
+ * default behavior of DRD, this macro and the macro above have been defined
+ * such that they have no effect.
+ */
+#define ANNOTATE_CONDVAR_WAIT(cv) do { } while(0)
+
+/**
+ * Tell DRD to consider the memory operations that happened before a mutex
+ * unlock event and after the subsequent mutex lock event on the same mutex as
+ * ordered. This is how DRD always behaves, so this macro has been defined
+ * such that it has no effect.
+ */
+#define ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mtx) do { } while(0)
+
+/** Deprecated -- don't use this annotation. */
+#define ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mtx) do { } while(0)
+
+/**
+ * Tell DRD to handle the specified memory range like a pure happens-before
+ * detector would do. Since this is how DRD always behaves, this annotation
+ * has been defined such that it has no effect.
+ */
+#define ANNOTATE_PUBLISH_MEMORY_RANGE(addr, size) do { } while(0)
+
+/** Deprecated -- don't use this annotation. */
+#define ANNOTATE_UNPUBLISH_MEMORY_RANGE(addr, size) do { } while(0)
+
+/** Deprecated -- don't use this annotation. */
+#define ANNOTATE_SWAP_MEMORY_RANGE(addr, size) do { } while(0)
+
+#ifndef __HELGRIND_H
+
+/** Tell DRD that a reader-writer lock object has been initialized. */
+#define ANNOTATE_RWLOCK_CREATE(rwlock)                                     \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE, \
+                                   rwlock, 0, 0, 0, 0);
+
+/** Tell DRD that a reader-writer lock object has been destroyed. */
+#define ANNOTATE_RWLOCK_DESTROY(rwlock)                                     \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY, \
+                                   rwlock, 0, 0, 0, 0);
+
+/**
+ * Tell DRD that a reader-writer lock has been acquired. is_w == 1 means that
+ * a write lock has been obtained, is_w == 0 means that a read lock has been
+ * obtained.
+ */
+#define ANNOTATE_RWLOCK_ACQUIRED(rwlock, is_w)                               \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED, \
+                                   rwlock, is_w, 0, 0, 0)
+
+#endif /* __HELGRIND_H */
+
+/**
+ * Tell DRD that a reader lock has been acquired on a reader-writer
+ * synchronization object.
+ */
+#define ANNOTATE_READERLOCK_ACQUIRED(rwlock) ANNOTATE_RWLOCK_ACQUIRED(rwlock, 0)
+
+/**
+ * Tell DRD that a writer lock has been acquired on a reader-writer
+ * synchronization object.
+ */
+#define ANNOTATE_WRITERLOCK_ACQUIRED(rwlock) ANNOTATE_RWLOCK_ACQUIRED(rwlock, 1)
+
+#ifndef __HELGRIND_H
+
+/**
+ * Tell DRD that a reader-writer lock is about to be released. is_w == 1 means
+ * that a write lock is about to be released, is_w == 0 means that a read lock
+ * is about to be released.
+ */
+#define ANNOTATE_RWLOCK_RELEASED(rwlock, is_w)                               \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED, \
+                                   rwlock, is_w, 0, 0, 0);
+
+#endif /* __HELGRIND_H */
+
+/**
+ * Tell DRD that a reader lock is about to be released.
+ */
+#define ANNOTATE_READERLOCK_RELEASED(rwlock) ANNOTATE_RWLOCK_RELEASED(rwlock, 0)
+
+/**
+ * Tell DRD that a writer lock is about to be released.
+ */
+#define ANNOTATE_WRITERLOCK_RELEASED(rwlock) ANNOTATE_RWLOCK_RELEASED(rwlock, 1)
+
+/** Tell DRD that a semaphore object is going to be initialized. */
+#define ANNOTATE_SEM_INIT_PRE(sem, value)                                 \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_SEM_INIT_PRE, \
+                                   sem, value, 0, 0, 0);
+
+/** Tell DRD that a semaphore object has been destroyed. */
+#define ANNOTATE_SEM_DESTROY_POST(sem)                                        \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_SEM_DESTROY_POST, \
+                                   sem, 0, 0, 0, 0);
+
+/** Tell DRD that a semaphore is going to be acquired. */
+#define ANNOTATE_SEM_WAIT_PRE(sem)                                        \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_SEM_WAIT_PRE, \
+                                   sem, 0, 0, 0, 0)
+
+/** Tell DRD that a semaphore has been acquired. */
+#define ANNOTATE_SEM_WAIT_POST(sem)                                        \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_SEM_WAIT_POST, \
+                                   sem, 0, 0, 0, 0)
+
+/** Tell DRD that a semaphore is going to be released. */
+#define ANNOTATE_SEM_POST_PRE(sem)                                        \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_SEM_POST_PRE, \
+                                   sem, 0, 0, 0, 0)
+
+/*
+ * Report that a barrier has been initialized with a given barrier count.  The
+ * third argument specifies whether or not reinitialization is allowed, that
+ * is, whether or not it is allowed to call barrier_init() several times
+ * without calling barrier_destroy().
+ */
+#define ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP,    \
+                                   "ANNOTATE_BARRIER_INIT", barrier,    \
+                                   count, reinitialization_allowed, 0)
+
+/* Report that a barrier has been destroyed. */
+#define ANNOTATE_BARRIER_DESTROY(barrier)                               \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP,    \
+                                   "ANNOTATE_BARRIER_DESTROY",          \
+                                   barrier, 0, 0, 0)
+
+/* Report that the calling thread is about to start waiting for a barrier. */
+#define ANNOTATE_BARRIER_WAIT_BEFORE(barrier)                           \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP,    \
+                                   "ANNOTATE_BARRIER_WAIT_BEFORE",      \
+                                   barrier, 0, 0, 0)
+
+/* Report that the calling thread has just finished waiting for a barrier. */
+#define ANNOTATE_BARRIER_WAIT_AFTER(barrier)                            \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATION_UNIMP,    \
+                                   "ANNOTATE_BARRIER_WAIT_AFTER",       \
+                                   barrier, 0, 0, 0)
+
+/**
+ * Tell DRD that a FIFO queue has been created. The abbreviation PCQ stands for
+ * <em>producer-consumer</em>.
+ */
+#define ANNOTATE_PCQ_CREATE(pcq) do { } while(0)
+
+/** Tell DRD that a FIFO queue has been destroyed. */
+#define ANNOTATE_PCQ_DESTROY(pcq) do { } while(0)
+
+/**
+ * Tell DRD that an element has been added to the FIFO queue at address pcq.
+ */
+#define ANNOTATE_PCQ_PUT(pcq) do { } while(0)
+
+/**
+ * Tell DRD that an element has been removed from the FIFO queue at address pcq,
+ * and that DRD should insert a happens-before relationship between the memory
+ * accesses that occurred before the corresponding ANNOTATE_PCQ_PUT(pcq)
+ * annotation and the memory accesses after this annotation. Correspondence
+ * between PUT and GET annotations happens in FIFO order. Since locking
+ * of the queue is needed anyway to add elements to or to remove elements from
+ * the queue, for DRD all four FIFO annotations are defined as no-ops.
+ */
+#define ANNOTATE_PCQ_GET(pcq) do { } while(0)
+
+/**
+ * Tell DRD that data races at the specified address are expected and must not
+ * be reported.
+ */
+#define ANNOTATE_BENIGN_RACE(addr, descr) \
+   ANNOTATE_BENIGN_RACE_SIZED(addr, sizeof(*addr), descr)
+
+/* Same as ANNOTATE_BENIGN_RACE(addr, descr), but applies to
+   the memory range [addr, addr + size). */
+#define ANNOTATE_BENIGN_RACE_SIZED(addr, size, descr)                   \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_START_SUPPRESSION,   \
+                                   addr, size, 0, 0, 0)
+
+/** Tell DRD to ignore all reads performed by the current thread. */
+#define ANNOTATE_IGNORE_READS_BEGIN()                                \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_LOADS,     \
+                                   0, 0, 0, 0, 0);
+
+
+/** Tell DRD to no longer ignore the reads performed by the current thread. */
+#define ANNOTATE_IGNORE_READS_END()                                  \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_LOADS,     \
+                                   1, 0, 0, 0, 0);
+
+/** Tell DRD to ignore all writes performed by the current thread. */
+#define ANNOTATE_IGNORE_WRITES_BEGIN()                                \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_STORES,     \
+                                   0, 0, 0, 0, 0)
+
+/** Tell DRD to no longer ignore the writes performed by the current thread. */
+#define ANNOTATE_IGNORE_WRITES_END()                                  \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_RECORD_STORES,     \
+                                   1, 0, 0, 0, 0)
+
+/** Tell DRD to ignore all memory accesses performed by the current thread. */
+#define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
+   do { ANNOTATE_IGNORE_READS_BEGIN(); ANNOTATE_IGNORE_WRITES_BEGIN(); } while(0)
+
+/**
+ * Tell DRD to no longer ignore the memory accesses performed by the current
+ * thread.
+ */
+#define ANNOTATE_IGNORE_READS_AND_WRITES_END() \
+   do { ANNOTATE_IGNORE_READS_END(); ANNOTATE_IGNORE_WRITES_END(); } while(0)
+
+/**
+ * Tell DRD that size bytes starting at addr has been allocated by a custom
+ * memory allocator.
+ */
+#define ANNOTATE_NEW_MEMORY(addr, size)                           \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_CLEAN_MEMORY,  \
+                                   addr, size, 0, 0, 0)
+
+/** Ask DRD to report every access to the specified address. */
+#define ANNOTATE_TRACE_MEMORY(addr) DRD_TRACE_VAR(*(char*)(addr))
+
+/**
+ * Tell DRD to assign the specified name to the current thread. This name will
+ * be used in error messages printed by DRD.
+ */
+#define ANNOTATE_THREAD_NAME(name)                                      \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_SET_THREAD_NAME,     \
+                                   name, 0, 0, 0, 0)
+
+/*@}*/
+
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end.
+*/
+enum {
+   /* Ask the DRD tool to discard all information about memory accesses   */
+   /* and client objects for the specified range. This client request is  */
+   /* binary compatible with the similarly named Helgrind client request. */
+   VG_USERREQ__DRD_CLEAN_MEMORY = VG_USERREQ_TOOL_BASE('H','G'),
+   /* args: Addr, SizeT. */
+
+   /* Ask the DRD tool the thread ID assigned by Valgrind. */
+   VG_USERREQ__DRD_GET_VALGRIND_THREAD_ID = VG_USERREQ_TOOL_BASE('D','R'),
+   /* args: none. */
+   /* Ask the DRD tool the thread ID assigned by DRD. */
+   VG_USERREQ__DRD_GET_DRD_THREAD_ID,
+   /* args: none. */
+
+   /* To tell the DRD tool to suppress data race detection on the */
+   /* specified address range. */
+   VG_USERREQ__DRD_START_SUPPRESSION,
+   /* args: start address, size in bytes */
+   /* To tell the DRD tool no longer to suppress data race detection on */
+   /* the specified address range. */
+   VG_USERREQ__DRD_FINISH_SUPPRESSION,
+   /* args: start address, size in bytes */
+
+   /* To ask the DRD tool to trace all accesses to the specified range. */
+   VG_USERREQ__DRD_START_TRACE_ADDR,
+   /* args: Addr, SizeT. */
+   /* To ask the DRD tool to stop tracing accesses to the specified range. */
+   VG_USERREQ__DRD_STOP_TRACE_ADDR,
+   /* args: Addr, SizeT. */
+
+   /* Tell DRD whether or not to record memory loads in the calling thread. */
+   VG_USERREQ__DRD_RECORD_LOADS,
+   /* args: Bool. */
+   /* Tell DRD whether or not to record memory stores in the calling thread. */
+   VG_USERREQ__DRD_RECORD_STORES,
+   /* args: Bool. */
+
+   /* Set the name of the thread that performs this client request. */
+   VG_USERREQ__DRD_SET_THREAD_NAME,
+   /* args: null-terminated character string. */
+
+   /* Tell DRD that a DRD annotation has not yet been implemented. */
+   VG_USERREQ__DRD_ANNOTATION_UNIMP,
+   /* args: char*. */
+
+   /* Tell DRD that a user-defined semaphore synchronization object
+    * is about to be created. */
+   VG_USERREQ__DRD_ANNOTATE_SEM_INIT_PRE,
+   /* args: Addr, UInt value. */
+   /* Tell DRD that a user-defined semaphore synchronization object
+    * has been destroyed. */
+   VG_USERREQ__DRD_ANNOTATE_SEM_DESTROY_POST,
+   /* args: Addr. */
+   /* Tell DRD that a user-defined semaphore synchronization
+    * object is going to be acquired (semaphore wait). */
+   VG_USERREQ__DRD_ANNOTATE_SEM_WAIT_PRE,
+   /* args: Addr. */
+   /* Tell DRD that a user-defined semaphore synchronization
+    * object has been acquired (semaphore wait). */
+   VG_USERREQ__DRD_ANNOTATE_SEM_WAIT_POST,
+   /* args: Addr. */
+   /* Tell DRD that a user-defined semaphore synchronization
+    * object is about to be released (semaphore post). */
+   VG_USERREQ__DRD_ANNOTATE_SEM_POST_PRE,
+   /* args: Addr. */
+
+   /* Tell DRD to ignore the inter-thread ordering introduced by a mutex. */
+   VG_USERREQ__DRD_IGNORE_MUTEX_ORDERING,
+   /* args: Addr. */
+
+   /* Tell DRD that a user-defined reader-writer synchronization object
+    * has been created. */
+   VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 14,
+   /* args: Addr. */
+   /* Tell DRD that a user-defined reader-writer synchronization object
+    * is about to be destroyed. */
+   VG_USERREQ__DRD_ANNOTATE_RWLOCK_DESTROY
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 15,
+   /* args: Addr. */
+   /* Tell DRD that a lock on a user-defined reader-writer synchronization
+    * object has been acquired. */
+   VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 17,
+   /* args: Addr, Int is_rw. */
+   /* Tell DRD that a lock on a user-defined reader-writer synchronization
+    * object is about to be released. */
+   VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 18,
+   /* args: Addr, Int is_rw. */
+
+   /* Tell DRD that a Helgrind annotation has not yet been implemented. */
+   VG_USERREQ__HELGRIND_ANNOTATION_UNIMP
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 32,
+   /* args: char*. */
+
+   /* Tell DRD to insert a happens-before annotation. */
+   VG_USERREQ__DRD_ANNOTATE_HAPPENS_BEFORE
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 33,
+   /* args: Addr. */
+   /* Tell DRD to insert a happens-after annotation. */
+   VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER
+      = VG_USERREQ_TOOL_BASE('H','G') + 256 + 34,
+   /* args: Addr. */
+
+};
+
+
+/**
+ * @addtogroup RaceDetectionAnnotations
+ */
+/*@{*/
+
+#ifdef __cplusplus
+/* ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racy reads.
+
+   Instead of doing
+   ANNOTATE_IGNORE_READS_BEGIN();
+   ... = x;
+   ANNOTATE_IGNORE_READS_END();
+   one can use
+   ... = ANNOTATE_UNPROTECTED_READ(x); */
+template <typename T>
+inline T ANNOTATE_UNPROTECTED_READ(const volatile T& x) {
+   ANNOTATE_IGNORE_READS_BEGIN();
+   const T result = x;
+   ANNOTATE_IGNORE_READS_END();
+   return result;
+}
+/* Apply ANNOTATE_BENIGN_RACE_SIZED to a static variable. */
+#define ANNOTATE_BENIGN_RACE_STATIC(static_var, description)           \
+   namespace {                                                         \
+      static class static_var##_annotator                              \
+      {                                                                        \
+      public:                                                          \
+        static_var##_annotator()                                       \
+        {                                                              \
+           ANNOTATE_BENIGN_RACE_SIZED(&static_var, sizeof(static_var), \
+                                      #static_var ": " description);   \
+        }                                                              \
+      } the_##static_var##_annotator;                                  \
+   }
+#endif
+
+/*@}*/
+
+#endif /* __VALGRIND_DRD_H */
diff --git a/ceph/src/pmdk/src/core/valgrind/helgrind.h b/ceph/src/pmdk/src/core/valgrind/helgrind.h
new file mode 100644 (file)
index 0000000..4579948
--- /dev/null
@@ -0,0 +1,841 @@
+/*
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (helgrind.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ----------------------------------------------------------------
+
+   This file is part of Helgrind, a Valgrind tool for detecting errors
+   in threaded programs.
+
+   Copyright (C) 2007-2017 OpenWorks LLP
+      info@open-works.co.uk
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (helgrind.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ---------------------------------------------------------------- 
+*/
+
+#ifndef __HELGRIND_H
+#define __HELGRIND_H
+
+#include "valgrind.h"
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+typedef
+   enum {
+      VG_USERREQ__HG_CLEAN_MEMORY = VG_USERREQ_TOOL_BASE('H','G'),
+
+      /* The rest are for Helgrind's internal use.  Not for end-user
+         use.  Do not use them unless you are a Valgrind developer. */
+
+      /* Notify the tool what this thread's pthread_t is. */
+      _VG_USERREQ__HG_SET_MY_PTHREAD_T = VG_USERREQ_TOOL_BASE('H','G') 
+                                         + 256,
+      _VG_USERREQ__HG_PTH_API_ERROR,              /* char*, int */
+      _VG_USERREQ__HG_PTHREAD_JOIN_POST,          /* pthread_t of quitter */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_INIT_POST,    /* pth_mx_t*, long mbRec */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_DESTROY_PRE,  /* pth_mx_t*, long isInit */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_PRE,   /* pth_mx_t* */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_POST,  /* pth_mx_t* */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_ACQUIRE_PRE,  /* void*, long isTryLock */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_ACQUIRE_POST, /* void* */
+      _VG_USERREQ__HG_PTHREAD_COND_SIGNAL_PRE,    /* pth_cond_t* */
+      _VG_USERREQ__HG_PTHREAD_COND_BROADCAST_PRE, /* pth_cond_t* */
+      _VG_USERREQ__HG_PTHREAD_COND_WAIT_PRE,     /* pth_cond_t*, pth_mx_t* */
+      _VG_USERREQ__HG_PTHREAD_COND_WAIT_POST,    /* pth_cond_t*, pth_mx_t* */
+      _VG_USERREQ__HG_PTHREAD_COND_DESTROY_PRE,   /* pth_cond_t*, long isInit */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_INIT_POST,   /* pth_rwlk_t* */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_DESTROY_PRE, /* pth_rwlk_t* */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_PRE,    /* pth_rwlk_t*, long isW */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_ACQUIRED,    /* void*, long isW */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_RELEASED,    /* void* */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_UNLOCK_POST, /* pth_rwlk_t* */
+      _VG_USERREQ__HG_POSIX_SEM_INIT_POST,        /* sem_t*, ulong value */
+      _VG_USERREQ__HG_POSIX_SEM_DESTROY_PRE,      /* sem_t* */
+      _VG_USERREQ__HG_POSIX_SEM_RELEASED,         /* void* */
+      _VG_USERREQ__HG_POSIX_SEM_ACQUIRED,         /* void* */
+      _VG_USERREQ__HG_PTHREAD_BARRIER_INIT_PRE,   /* pth_bar_t*, ulong, ulong */
+      _VG_USERREQ__HG_PTHREAD_BARRIER_WAIT_PRE,   /* pth_bar_t* */
+      _VG_USERREQ__HG_PTHREAD_BARRIER_DESTROY_PRE, /* pth_bar_t* */
+      _VG_USERREQ__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE,  /* pth_slk_t* */
+      _VG_USERREQ__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_POST, /* pth_slk_t* */
+      _VG_USERREQ__HG_PTHREAD_SPIN_LOCK_PRE,      /* pth_slk_t* */
+      _VG_USERREQ__HG_PTHREAD_SPIN_LOCK_POST,     /* pth_slk_t* */
+      _VG_USERREQ__HG_PTHREAD_SPIN_DESTROY_PRE,   /* pth_slk_t* */
+      _VG_USERREQ__HG_CLIENTREQ_UNIMP,            /* char* */
+      _VG_USERREQ__HG_USERSO_SEND_PRE,        /* arbitrary UWord SO-tag */
+      _VG_USERREQ__HG_USERSO_RECV_POST,       /* arbitrary UWord SO-tag */
+      _VG_USERREQ__HG_USERSO_FORGET_ALL,      /* arbitrary UWord SO-tag */
+      _VG_USERREQ__HG_RESERVED2,              /* Do not use */
+      _VG_USERREQ__HG_RESERVED3,              /* Do not use */
+      _VG_USERREQ__HG_RESERVED4,              /* Do not use */
+      _VG_USERREQ__HG_ARANGE_MAKE_UNTRACKED, /* Addr a, ulong len */
+      _VG_USERREQ__HG_ARANGE_MAKE_TRACKED,   /* Addr a, ulong len */
+      _VG_USERREQ__HG_PTHREAD_BARRIER_RESIZE_PRE, /* pth_bar_t*, ulong */
+      _VG_USERREQ__HG_CLEAN_MEMORY_HEAPBLOCK, /* Addr start_of_block */
+      _VG_USERREQ__HG_PTHREAD_COND_INIT_POST,  /* pth_cond_t*, pth_cond_attr_t*/
+      _VG_USERREQ__HG_GNAT_MASTER_HOOK,       /* void*d,void*m,Word ml */
+      _VG_USERREQ__HG_GNAT_MASTER_COMPLETED_HOOK, /* void*s,Word ml */
+      _VG_USERREQ__HG_GET_ABITS,              /* Addr a,Addr abits, ulong len */
+      _VG_USERREQ__HG_PTHREAD_CREATE_BEGIN,
+      _VG_USERREQ__HG_PTHREAD_CREATE_END,
+      _VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_PRE,     /* pth_mx_t*,long isTryLock */
+      _VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_POST,    /* pth_mx_t *,long tookLock */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_LOCK_POST,  /* pth_rwlk_t*,long isW,long */
+      _VG_USERREQ__HG_PTHREAD_RWLOCK_UNLOCK_PRE,  /* pth_rwlk_t* */
+      _VG_USERREQ__HG_POSIX_SEM_POST_PRE,         /* sem_t* */
+      _VG_USERREQ__HG_POSIX_SEM_POST_POST,        /* sem_t* */
+      _VG_USERREQ__HG_POSIX_SEM_WAIT_PRE,         /* sem_t* */
+      _VG_USERREQ__HG_POSIX_SEM_WAIT_POST,        /* sem_t*, long tookLock */
+      _VG_USERREQ__HG_PTHREAD_COND_SIGNAL_POST,   /* pth_cond_t* */
+      _VG_USERREQ__HG_PTHREAD_COND_BROADCAST_POST,/* pth_cond_t* */
+      _VG_USERREQ__HG_RTLD_BIND_GUARD,            /* int flags */
+      _VG_USERREQ__HG_RTLD_BIND_CLEAR,            /* int flags */
+      _VG_USERREQ__HG_GNAT_DEPENDENT_MASTER_JOIN  /* void*d, void*m */
+   } Vg_TCheckClientRequest;
+
+
+/*----------------------------------------------------------------*/
+/*---                                                          ---*/
+/*--- Implementation-only facilities.  Not for end-user use.   ---*/
+/*--- For end-user facilities see below (the next section in   ---*/
+/*--- this file.)                                              ---*/
+/*---                                                          ---*/
+/*----------------------------------------------------------------*/
+
+/* Do a client request.  These are macros rather than a functions so
+   as to avoid having an extra frame in stack traces.
+
+   NB: these duplicate definitions in hg_intercepts.c.  But here, we
+   have to make do with weaker typing (no definition of Word etc) and
+   no assertions, whereas in helgrind.h we can use those facilities.
+   Obviously it's important the two sets of definitions are kept in
+   sync.
+
+   The commented-out asserts should actually hold, but unfortunately
+   they can't be allowed to be visible here, because that would
+   require the end-user code to #include <assert.h>.
+*/
+
+#define DO_CREQ_v_W(_creqF, _ty1F,_arg1F)                \
+   do {                                                  \
+      long int _arg1;                                    \
+      /* assert(sizeof(_ty1F) == sizeof(long int)); */   \
+      _arg1 = (long int)(_arg1F);                        \
+      VALGRIND_DO_CLIENT_REQUEST_STMT(                   \
+                                 (_creqF),               \
+                                 _arg1, 0,0,0,0);        \
+   } while (0)
+
+#define DO_CREQ_W_W(_resF, _dfltF, _creqF, _ty1F,_arg1F) \
+   do {                                                  \
+      long int _arg1;                                    \
+      /* assert(sizeof(_ty1F) == sizeof(long int)); */   \
+      _arg1 = (long int)(_arg1F);                        \
+      _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(        \
+                                 (_dfltF),               \
+                                 (_creqF),               \
+                                 _arg1, 0,0,0,0);        \
+      _resF = _qzz_res;                                  \
+   } while (0)
+
+#define DO_CREQ_v_WW(_creqF, _ty1F,_arg1F, _ty2F,_arg2F) \
+   do {                                                  \
+      long int _arg1, _arg2;                             \
+      /* assert(sizeof(_ty1F) == sizeof(long int)); */   \
+      /* assert(sizeof(_ty2F) == sizeof(long int)); */   \
+      _arg1 = (long int)(_arg1F);                        \
+      _arg2 = (long int)(_arg2F);                        \
+      VALGRIND_DO_CLIENT_REQUEST_STMT(                   \
+                                 (_creqF),               \
+                                 _arg1,_arg2,0,0,0);     \
+   } while (0)
+
+#define DO_CREQ_v_WWW(_creqF, _ty1F,_arg1F,              \
+                      _ty2F,_arg2F, _ty3F, _arg3F)       \
+   do {                                                  \
+      long int _arg1, _arg2, _arg3;                      \
+      /* assert(sizeof(_ty1F) == sizeof(long int)); */   \
+      /* assert(sizeof(_ty2F) == sizeof(long int)); */   \
+      /* assert(sizeof(_ty3F) == sizeof(long int)); */   \
+      _arg1 = (long int)(_arg1F);                        \
+      _arg2 = (long int)(_arg2F);                        \
+      _arg3 = (long int)(_arg3F);                        \
+      VALGRIND_DO_CLIENT_REQUEST_STMT(                   \
+                                 (_creqF),               \
+                                 _arg1,_arg2,_arg3,0,0); \
+   } while (0)
+
+#define DO_CREQ_W_WWW(_resF, _dfltF, _creqF, _ty1F,_arg1F, \
+                      _ty2F,_arg2F, _ty3F, _arg3F)       \
+   do {                                                  \
+      long int _qzz_res;                                 \
+      long int _arg1, _arg2, _arg3;                      \
+      /* assert(sizeof(_ty1F) == sizeof(long int)); */   \
+      _arg1 = (long int)(_arg1F);                        \
+      _arg2 = (long int)(_arg2F);                        \
+      _arg3 = (long int)(_arg3F);                        \
+      /*                                                 \
+       * XXX: here PMDK's version deviates from upstream;\
+       * without the fix, this code generates            \
+       * a sign-conversion warning, which PMDK's         \
+       * "awesome" build system promotes to an error     \
+       */                                                \
+      _qzz_res = (long)VALGRIND_DO_CLIENT_REQUEST_EXPR(  \
+                                 (_dfltF),               \
+                                 (_creqF),               \
+                                 _arg1,_arg2,_arg3,0,0); \
+      _resF = _qzz_res;                                  \
+   } while (0)
+
+
+
+#define _HG_CLIENTREQ_UNIMP(_qzz_str)                    \
+   DO_CREQ_v_W(_VG_USERREQ__HG_CLIENTREQ_UNIMP,          \
+               (char*),(_qzz_str))
+
+
+/*----------------------------------------------------------------*/
+/*---                                                          ---*/
+/*--- Helgrind-native requests.  These allow access to         ---*/
+/*--- the same set of annotation primitives that are used      ---*/
+/*--- to build the POSIX pthread wrappers.                     ---*/
+/*---                                                          ---*/
+/*----------------------------------------------------------------*/
+
+/* ----------------------------------------------------------
+   For describing ordinary mutexes (non-rwlocks).  For rwlock
+   descriptions see ANNOTATE_RWLOCK_* below.
+   ---------------------------------------------------------- */
+
+/* Notify here immediately after mutex creation.  _mbRec == 0 for a
+   non-recursive mutex, 1 for a recursive mutex. */
+#define VALGRIND_HG_MUTEX_INIT_POST(_mutex, _mbRec)          \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_INIT_POST,     \
+                void*,(_mutex), long,(_mbRec))
+
+/* Notify here immediately before mutex acquisition.  _isTryLock == 0
+   for a normal acquisition, 1 for a "try" style acquisition. */
+#define VALGRIND_HG_MUTEX_LOCK_PRE(_mutex, _isTryLock)       \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_ACQUIRE_PRE,   \
+                void*,(_mutex), long,(_isTryLock))
+
+/* Notify here immediately after a successful mutex acquisition. */
+#define VALGRIND_HG_MUTEX_LOCK_POST(_mutex)                  \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_ACQUIRE_POST,   \
+               void*,(_mutex))
+
+/* Notify here immediately before a mutex release. */
+#define VALGRIND_HG_MUTEX_UNLOCK_PRE(_mutex)                 \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_PRE,     \
+               void*,(_mutex))
+
+/* Notify here immediately after a mutex release. */
+#define VALGRIND_HG_MUTEX_UNLOCK_POST(_mutex)                \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_POST,    \
+               void*,(_mutex))
+
+/* Notify here immediately before mutex destruction. */
+#define VALGRIND_HG_MUTEX_DESTROY_PRE(_mutex)                \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_DESTROY_PRE,    \
+               void*,(_mutex))
+
+/* ----------------------------------------------------------
+   For describing semaphores.
+   ---------------------------------------------------------- */
+
+/* Notify here immediately after semaphore creation. */
+#define VALGRIND_HG_SEM_INIT_POST(_sem, _value)              \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_POSIX_SEM_INIT_POST,         \
+                void*, (_sem), unsigned long, (_value))
+
+/* Notify here immediately after a semaphore wait (an acquire-style
+   operation) */
+#define VALGRIND_HG_SEM_WAIT_POST(_sem)                      \
+   DO_CREQ_v_W(_VG_USERREQ__HG_POSIX_SEM_ACQUIRED,           \
+               void*,(_sem))
+
+/* Notify here immediately before semaphore post (a release-style
+   operation) */
+#define VALGRIND_HG_SEM_POST_PRE(_sem)                       \
+   DO_CREQ_v_W(_VG_USERREQ__HG_POSIX_SEM_RELEASED,           \
+               void*,(_sem))
+
+/* Notify here immediately before semaphore destruction. */
+#define VALGRIND_HG_SEM_DESTROY_PRE(_sem)                    \
+   DO_CREQ_v_W(_VG_USERREQ__HG_POSIX_SEM_DESTROY_PRE,        \
+               void*, (_sem))
+
+/* ----------------------------------------------------------
+   For describing barriers.
+   ---------------------------------------------------------- */
+
+/* Notify here immediately before barrier creation.  _count is the
+   capacity.  _resizable == 0 means the barrier may not be resized, 1
+   means it may be. */
+#define VALGRIND_HG_BARRIER_INIT_PRE(_bar, _count, _resizable) \
+   DO_CREQ_v_WWW(_VG_USERREQ__HG_PTHREAD_BARRIER_INIT_PRE,   \
+                 void*,(_bar),                               \
+                 unsigned long,(_count),                     \
+                 unsigned long,(_resizable))
+
+/* Notify here immediately before arrival at a barrier. */
+#define VALGRIND_HG_BARRIER_WAIT_PRE(_bar)                   \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_BARRIER_WAIT_PRE,     \
+               void*,(_bar))
+
+/* Notify here immediately before a resize (change of barrier
+   capacity).  If _newcount >= the existing capacity, then there is no
+   change in the state of any threads waiting at the barrier.  If
+   _newcount < the existing capacity, and >= _newcount threads are
+   currently waiting at the barrier, then this notification is
+   considered to also have the effect of telling the checker that all
+   waiting threads have now moved past the barrier.  (I can't think of
+   any other sane semantics.) */
+#define VALGRIND_HG_BARRIER_RESIZE_PRE(_bar, _newcount)      \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_BARRIER_RESIZE_PRE,  \
+                void*,(_bar),                                \
+                unsigned long,(_newcount))
+
+/* Notify here immediately before barrier destruction. */
+#define VALGRIND_HG_BARRIER_DESTROY_PRE(_bar)                \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_BARRIER_DESTROY_PRE,  \
+               void*,(_bar))
+
+/* ----------------------------------------------------------
+   For describing memory ownership changes.
+   ---------------------------------------------------------- */
+
+/* Clean memory state.  This makes Helgrind forget everything it knew
+   about the specified memory range.  Effectively this announces that
+   the specified memory range now "belongs" to the calling thread, so
+   that: (1) the calling thread can access it safely without
+   synchronisation, and (2) all other threads must sync with this one
+   to access it safely.  This is particularly useful for memory
+   allocators that wish to recycle memory. */
+#define VALGRIND_HG_CLEAN_MEMORY(_qzz_start, _qzz_len)       \
+   DO_CREQ_v_WW(VG_USERREQ__HG_CLEAN_MEMORY,                 \
+                void*,(_qzz_start),                          \
+                unsigned long,(_qzz_len))
+
+/* The same, but for the heap block starting at _qzz_blockstart.  This
+   allows painting when we only know the address of an object, but not
+   its size, which is sometimes the case in C++ code involving
+   inheritance, and in which RTTI is not, for whatever reason,
+   available.  Returns the number of bytes painted, which can be zero
+   for a zero-sized block.  Hence, return values >= 0 indicate success
+   (the block was found), and the value -1 indicates block not
+   found, and -2 is returned when not running on Helgrind. */
+#define VALGRIND_HG_CLEAN_MEMORY_HEAPBLOCK(_qzz_blockstart)  \
+   (__extension__                                            \
+   ({long int _npainted;                                     \
+     DO_CREQ_W_W(_npainted, (-2)/*default*/,                 \
+                 _VG_USERREQ__HG_CLEAN_MEMORY_HEAPBLOCK,     \
+                            void*,(_qzz_blockstart));        \
+     _npainted;                                              \
+   }))
+
+/* ----------------------------------------------------------
+   For error control.
+   ---------------------------------------------------------- */
+
+/* Tell H that an address range is not to be "tracked" until further
+   notice.  This puts it in the NOACCESS state, in which case we
+   ignore all reads and writes to it.  Useful for ignoring ranges of
+   memory where there might be races we don't want to see.  If the
+   memory is subsequently reallocated via malloc/new/stack allocation,
+   then it is put back in the trackable state.  Hence it is safe in
+   the situation where checking is disabled, the containing area is
+   deallocated and later reallocated for some other purpose. */
+#define VALGRIND_HG_DISABLE_CHECKING(_qzz_start, _qzz_len)   \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_ARANGE_MAKE_UNTRACKED,       \
+                 void*,(_qzz_start),                         \
+                 unsigned long,(_qzz_len))
+
+/* And put it back into the normal "tracked" state, that is, make it
+   once again subject to the normal race-checking machinery.  This
+   puts it in the same state as new memory allocated by this thread --
+   that is, basically owned exclusively by this thread. */
+#define VALGRIND_HG_ENABLE_CHECKING(_qzz_start, _qzz_len)    \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_ARANGE_MAKE_TRACKED,         \
+                 void*,(_qzz_start),                         \
+                 unsigned long,(_qzz_len))
+
+
+/*  Checks the accessibility bits for addresses [zza..zza+zznbytes-1].
+    If zzabits array is provided, copy the accessibility bits in zzabits.
+   Return values:
+     -2   if not running on helgrind
+     -1   if any parts of zzabits is not addressable
+     >= 0 : success.
+   When success, it returns the nr of addressable bytes found.
+      So, to check that a whole range is addressable, check
+         VALGRIND_HG_GET_ABITS(addr,NULL,len) == len
+      In addition, if you want to examine the addressability of each
+      byte of the range, you need to provide a non NULL ptr as
+      second argument, pointing to an array of unsigned char
+      of length len.
+      Addressable bytes are indicated with 0xff.
+      Non-addressable bytes are indicated with 0x00.
+*/
+#define VALGRIND_HG_GET_ABITS(zza,zzabits,zznbytes)          \
+   (__extension__                                            \
+   ({long int _res;                                          \
+      /*                                                     \
+       * XXX: here PMDK's version deviates from upstream;    \
+       * without the fix, this macro doesn't return          \
+       * the default value correctly                         \
+       */                                                    \
+      DO_CREQ_W_WWW(_res, (-2LL)/*default*/,                 \
+                    _VG_USERREQ__HG_GET_ABITS,               \
+                    void*,(zza), void*,(zzabits),            \
+                    unsigned long,(zznbytes));               \
+      _res;                                                  \
+   }))
+
+/* End-user request for Ada applications compiled with GNAT.
+   Helgrind understands the Ada concept of Ada task dependencies and
+   terminations. See Ada Reference Manual section 9.3 "Task Dependence 
+   - Termination of Tasks".
+   However, in some cases, the master of (terminated) tasks completes
+   only when the application exits. An example of this is dynamically
+   allocated tasks with an access type defined at Library Level.
+   By default, the state of such tasks in Helgrind will be 'exited but
+   join not done yet'. Many tasks in such a state are however causing
+   Helgrind CPU and memory to increase significantly.
+   VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN can be used to indicate
+   to Helgrind that a not yet completed master has however already
+   'seen' the termination of a dependent : this is conceptually the
+   same as a pthread_join and causes the cleanup of the dependent
+   as done by Helgrind when a master completes.
+   This allows to avoid the overhead in helgrind caused by such tasks.
+   A typical usage for a master to indicate it has done conceptually a join
+   with a dependent task before the master completes is:
+      while not Dep_Task'Terminated loop
+         ... do whatever to wait for Dep_Task termination.
+      end loop;
+      VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN
+        (Dep_Task'Identity,
+         Ada.Task_Identification.Current_Task);
+    Note that VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN should be a binding
+    to a C function built with the below macro. */
+#define VALGRIND_HG_GNAT_DEPENDENT_MASTER_JOIN(_qzz_dep, _qzz_master) \
+   DO_CREQ_v_WW(_VG_USERREQ__HG_GNAT_DEPENDENT_MASTER_JOIN,           \
+                void*,(_qzz_dep),                                     \
+                void*,(_qzz_master))
+
+/*----------------------------------------------------------------*/
+/*---                                                          ---*/
+/*--- ThreadSanitizer-compatible requests                      ---*/
+/*--- (mostly unimplemented)                                   ---*/
+/*---                                                          ---*/
+/*----------------------------------------------------------------*/
+
+/* A quite-broad set of annotations, as used in the ThreadSanitizer
+   project.  This implementation aims to be a (source-level)
+   compatible implementation of the macros defined in:
+
+   http://code.google.com/p/data-race-test/source
+          /browse/trunk/dynamic_annotations/dynamic_annotations.h
+
+   (some of the comments below are taken from the above file)
+
+   The implementation here is very incomplete, and intended as a
+   starting point.  Many of the macros are unimplemented.  Rather than
+   allowing unimplemented macros to silently do nothing, they cause an
+   assertion.  Intention is to implement them on demand.
+
+   The major use of these macros is to make visible to race detectors,
+   the behaviour (effects) of user-implemented synchronisation
+   primitives, that the detectors could not otherwise deduce from the
+   normal observation of pthread etc calls.
+
+   Some of the macros are no-ops in Helgrind.  That's because Helgrind
+   is a pure happens-before detector, whereas ThreadSanitizer uses a
+   hybrid lockset and happens-before scheme, which requires more
+   accurate annotations for correct operation.
+
+   The macros are listed in the same order as in dynamic_annotations.h
+   (URL just above).
+
+   I should point out that I am less than clear about the intended
+   semantics of quite a number of them.  Comments and clarifications
+   welcomed!
+*/
+
+/* ----------------------------------------------------------------
+   These four allow description of user-level condition variables,
+   apparently in the style of POSIX's pthread_cond_t.  Currently
+   unimplemented and will assert.
+   ----------------------------------------------------------------
+*/
+/* Report that wait on the condition variable at address CV has
+   succeeded and the lock at address LOCK is now held.  CV and LOCK
+   are completely arbitrary memory addresses which presumably mean
+   something to the application, but are meaningless to Helgrind. */
+#define ANNOTATE_CONDVAR_LOCK_WAIT(cv, lock) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_CONDVAR_LOCK_WAIT")
+
+/* Report that wait on the condition variable at CV has succeeded.
+   Variant w/o lock. */
+#define ANNOTATE_CONDVAR_WAIT(cv) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_CONDVAR_WAIT")
+
+/* Report that we are about to signal on the condition variable at
+   address CV. */
+#define ANNOTATE_CONDVAR_SIGNAL(cv) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_CONDVAR_SIGNAL")
+  
+/* Report that we are about to signal_all on the condition variable at
+   CV. */
+#define ANNOTATE_CONDVAR_SIGNAL_ALL(cv) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_CONDVAR_SIGNAL_ALL")
+
+
+/* ----------------------------------------------------------------
+   Create completely arbitrary happens-before edges between threads.
+
+   If threads T1 .. Tn all do ANNOTATE_HAPPENS_BEFORE(obj) and later
+   (w.r.t. some notional global clock for the computation) thread Tm
+   does ANNOTATE_HAPPENS_AFTER(obj), then Helgrind will regard all
+   memory accesses done by T1 .. Tn before the ..BEFORE.. call as
+   happening-before all memory accesses done by Tm after the
+   ..AFTER.. call.  Hence Helgrind won't complain about races if Tm's
+   accesses afterwards are to the same locations as accesses before by
+   any of T1 .. Tn.
+
+   OBJ is a machine word (unsigned long, or void*), is completely
+   arbitrary, and denotes the identity of some synchronisation object
+   you're modelling.
+
+   You must do the _BEFORE call just before the real sync event on the
+   signaller's side, and _AFTER just after the real sync event on the
+   waiter's side.
+
+   If none of the rest of these macros make sense to you, at least
+   take the time to understand these two.  They form the very essence
+   of describing arbitrary inter-thread synchronisation events to
+   Helgrind.  You can get a long way just with them alone.
+
+   See also, extensive discussion on semantics of this in 
+   https://bugs.kde.org/show_bug.cgi?id=243935
+
+   ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(obj) is interim until such time
+   as bug 243935 is fully resolved.  It instructs Helgrind to forget
+   about any ANNOTATE_HAPPENS_BEFORE calls on the specified object, in
+   effect putting it back in its original state.  Once in that state,
+   a use of ANNOTATE_HAPPENS_AFTER on it has no effect on the calling
+   thread.
+
+   An implementation may optionally release resources it has
+   associated with 'obj' when ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(obj)
+   happens.  Users are recommended to use
+   ANNOTATE_HAPPENS_BEFORE_FORGET_ALL to indicate when a
+   synchronisation object is no longer needed, so as to avoid
+   potential indefinite resource leaks.
+   ----------------------------------------------------------------
+*/
+#define ANNOTATE_HAPPENS_BEFORE(obj) \
+   DO_CREQ_v_W(_VG_USERREQ__HG_USERSO_SEND_PRE, void*,(obj))
+
+#define ANNOTATE_HAPPENS_AFTER(obj) \
+   DO_CREQ_v_W(_VG_USERREQ__HG_USERSO_RECV_POST, void*,(obj))
+
+#define ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(obj) \
+   DO_CREQ_v_W(_VG_USERREQ__HG_USERSO_FORGET_ALL, void*,(obj))
+
+/* ----------------------------------------------------------------
+   Memory publishing.  The TSan sources say:
+
+     Report that the bytes in the range [pointer, pointer+size) are about
+     to be published safely. The race checker will create a happens-before
+     arc from the call ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) to
+     subsequent accesses to this memory.
+
+   I'm not sure I understand what this means exactly, nor whether it
+   is relevant for a pure h-b detector.  Leaving unimplemented for
+   now.
+   ----------------------------------------------------------------
+*/
+#define ANNOTATE_PUBLISH_MEMORY_RANGE(pointer, size) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PUBLISH_MEMORY_RANGE")
+
+/* DEPRECATED. Don't use it. */
+/* #define ANNOTATE_UNPUBLISH_MEMORY_RANGE(pointer, size) */
+
+/* DEPRECATED. Don't use it. */
+/* #define ANNOTATE_SWAP_MEMORY_RANGE(pointer, size) */
+
+
+/* ----------------------------------------------------------------
+   TSan sources say:
+   
+     Instruct the tool to create a happens-before arc between
+     MU->Unlock() and MU->Lock().  This annotation may slow down the
+     race detector; normally it is used only when it would be
+     difficult to annotate each of the mutex's critical sections
+     individually using the annotations above.
+
+   If MU is a posix pthread_mutex_t then Helgrind will do this anyway.
+   In any case, leave as unimp for now.  I'm unsure about the intended
+   behaviour.
+   ---------------------------------------------------------------- 
+*/
+#define ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX(mu) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX")
+
+/* Deprecated. Use ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX. */
+/* #define ANNOTATE_MUTEX_IS_USED_AS_CONDVAR(mu) */
+
+
+/* ----------------------------------------------------------------
+   TSan sources say:
+   
+     Annotations useful when defining memory allocators, or when
+     memory that was protected in one way starts to be protected in
+     another.
+
+     Report that a new memory at "address" of size "size" has been
+     allocated.  This might be used when the memory has been retrieved
+     from a free list and is about to be reused, or when a the locking
+     discipline for a variable changes.
+
+   AFAICS this is the same as VALGRIND_HG_CLEAN_MEMORY.
+   ---------------------------------------------------------------- 
+*/
+#define ANNOTATE_NEW_MEMORY(address, size) \
+   VALGRIND_HG_CLEAN_MEMORY((address), (size))
+
+
+/* ----------------------------------------------------------------
+   TSan sources say:
+
+     Annotations useful when defining FIFO queues that transfer data
+     between threads.
+
+   All unimplemented.  Am not claiming to understand this (yet).
+   ---------------------------------------------------------------- 
+*/
+
+/* Report that the producer-consumer queue object at address PCQ has
+   been created.  The ANNOTATE_PCQ_* annotations should be used only
+   for FIFO queues.  For non-FIFO queues use ANNOTATE_HAPPENS_BEFORE
+   (for put) and ANNOTATE_HAPPENS_AFTER (for get). */
+#define ANNOTATE_PCQ_CREATE(pcq) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PCQ_CREATE")
+
+/* Report that the queue at address PCQ is about to be destroyed. */
+#define ANNOTATE_PCQ_DESTROY(pcq) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PCQ_DESTROY")
+
+/* Report that we are about to put an element into a FIFO queue at
+   address PCQ. */
+#define ANNOTATE_PCQ_PUT(pcq) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PCQ_PUT")
+
+/* Report that we've just got an element from a FIFO queue at address
+   PCQ. */
+#define ANNOTATE_PCQ_GET(pcq) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_PCQ_GET")
+
+
+/* ----------------------------------------------------------------
+   Annotations that suppress errors.  It is usually better to express
+   the program's synchronization using the other annotations, but
+   these can be used when all else fails.
+
+   Currently these are all unimplemented.  I can't think of a simple
+   way to implement them without at least some performance overhead.
+   ----------------------------------------------------------------
+*/
+
+/* Report that we may have a benign race at "pointer", with size
+   "sizeof(*(pointer))". "pointer" must be a non-void* pointer.  Insert at the
+   point where "pointer" has been allocated, preferably close to the point
+   where the race happens.  See also ANNOTATE_BENIGN_RACE_STATIC.
+
+   XXX: what's this actually supposed to do?  And what's the type of
+   DESCRIPTION?  When does the annotation stop having an effect?
+*/
+#define ANNOTATE_BENIGN_RACE(pointer, description) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_BENIGN_RACE")
+
+/* Same as ANNOTATE_BENIGN_RACE(address, description), but applies to
+   the memory range [address, address+size). */
+#define ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \
+   VALGRIND_HG_DISABLE_CHECKING(address, size)
+
+/* Request the analysis tool to ignore all reads in the current thread
+   until ANNOTATE_IGNORE_READS_END is called.  Useful to ignore
+   intentional racey reads, while still checking other reads and all
+   writes. */
+#define ANNOTATE_IGNORE_READS_BEGIN() \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_IGNORE_READS_BEGIN")
+
+/* Stop ignoring reads. */
+#define ANNOTATE_IGNORE_READS_END() \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_IGNORE_READS_END")
+
+/* Similar to ANNOTATE_IGNORE_READS_BEGIN, but ignore writes. */
+#define ANNOTATE_IGNORE_WRITES_BEGIN() \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_IGNORE_WRITES_BEGIN")
+
+/* Stop ignoring writes. */
+#define ANNOTATE_IGNORE_WRITES_END() \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_IGNORE_WRITES_END")
+
+/* Start ignoring all memory accesses (reads and writes). */
+#define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \
+   do { \
+      ANNOTATE_IGNORE_READS_BEGIN(); \
+      ANNOTATE_IGNORE_WRITES_BEGIN(); \
+   } while (0)
+
+/* Stop ignoring all memory accesses. */
+#define ANNOTATE_IGNORE_READS_AND_WRITES_END() \
+   do { \
+      ANNOTATE_IGNORE_WRITES_END(); \
+      ANNOTATE_IGNORE_READS_END(); \
+   } while (0)
+
+
+/* ----------------------------------------------------------------
+   Annotations useful for debugging.
+
+   Again, so for unimplemented, partly for performance reasons.
+   ----------------------------------------------------------------
+*/
+
+/* Request to trace every access to ADDRESS. */
+#define ANNOTATE_TRACE_MEMORY(address) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_TRACE_MEMORY")
+
+/* Report the current thread name to a race detector. */
+#define ANNOTATE_THREAD_NAME(name) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_THREAD_NAME")
+
+
+/* ----------------------------------------------------------------
+   Annotations for describing behaviour of user-implemented lock
+   primitives.  In all cases, the LOCK argument is a completely
+   arbitrary machine word (unsigned long, or void*) and can be any
+   value which gives a unique identity to the lock objects being
+   modelled.
+
+   We just pretend they're ordinary posix rwlocks.  That'll probably
+   give some rather confusing wording in error messages, claiming that
+   the arbitrary LOCK values are pthread_rwlock_t*'s, when in fact
+   they are not.  Ah well.
+   ----------------------------------------------------------------
+*/
+/* Report that a lock has just been created at address LOCK. */
+#define ANNOTATE_RWLOCK_CREATE(lock)                         \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_RWLOCK_INIT_POST,     \
+               void*,(lock))
+    
+/* Report that the lock at address LOCK is about to be destroyed. */
+#define ANNOTATE_RWLOCK_DESTROY(lock)                        \
+   DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_RWLOCK_DESTROY_PRE,   \
+               void*,(lock))
+
+/* Report that the lock at address LOCK has just been acquired.
+   is_w=1 for writer lock, is_w=0 for reader lock. */
+#define ANNOTATE_RWLOCK_ACQUIRED(lock, is_w)                 \
+  DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_RWLOCK_ACQUIRED,      \
+               void*,(lock), unsigned long,(is_w))
+
+/* Report that the lock at address LOCK is about to be released. */
+#define ANNOTATE_RWLOCK_RELEASED(lock, is_w)                 \
+  DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_RWLOCK_RELEASED,       \
+              void*,(lock)) /* is_w is ignored */
+
+
+/* -------------------------------------------------------------
+   Annotations useful when implementing barriers.  They are not
+   normally needed by modules that merely use barriers.
+   The "barrier" argument is a pointer to the barrier object.
+   ----------------------------------------------------------------
+*/
+
+/* Report that the "barrier" has been initialized with initial
+   "count".  If 'reinitialization_allowed' is true, initialization is
+   allowed to happen multiple times w/o calling barrier_destroy() */
+#define ANNOTATE_BARRIER_INIT(barrier, count, reinitialization_allowed) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_BARRIER_INIT")
+
+/* Report that we are about to enter barrier_wait("barrier"). */
+#define ANNOTATE_BARRIER_WAIT_BEFORE(barrier) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_BARRIER_DESTROY")
+
+/* Report that we just exited barrier_wait("barrier"). */
+#define ANNOTATE_BARRIER_WAIT_AFTER(barrier) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_BARRIER_DESTROY")
+
+/* Report that the "barrier" has been destroyed. */
+#define ANNOTATE_BARRIER_DESTROY(barrier) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_BARRIER_DESTROY")
+
+
+/* ----------------------------------------------------------------
+   Annotations useful for testing race detectors.
+   ----------------------------------------------------------------
+*/
+
+/* Report that we expect a race on the variable at ADDRESS.  Use only
+   in unit tests for a race detector. */
+#define ANNOTATE_EXPECT_RACE(address, description) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_EXPECT_RACE")
+
+/* A no-op. Insert where you like to test the interceptors. */
+#define ANNOTATE_NO_OP(arg) \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_NO_OP")
+
+/* Force the race detector to flush its state. The actual effect depends on
+ * the implementation of the detector. */
+#define ANNOTATE_FLUSH_STATE() \
+   _HG_CLIENTREQ_UNIMP("ANNOTATE_FLUSH_STATE")
+
+#endif /* __HELGRIND_H */
diff --git a/ceph/src/pmdk/src/core/valgrind/memcheck.h b/ceph/src/pmdk/src/core/valgrind/memcheck.h
new file mode 100644 (file)
index 0000000..fafe787
--- /dev/null
@@ -0,0 +1,320 @@
+
+/*
+   ----------------------------------------------------------------
+
+   Notice that the following BSD-style license applies to this one
+   file (memcheck.h) only.  The rest of Valgrind is licensed under the
+   terms of the GNU General Public License, version 2, unless
+   otherwise indicated.  See the COPYING file in the source
+   distribution for details.
+
+   ----------------------------------------------------------------
+
+   This file is part of MemCheck, a heavyweight Valgrind tool for
+   detecting memory errors.
+
+   Copyright (C) 2000-2017 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (memcheck.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ---------------------------------------------------------------- 
+*/
+
+
+#ifndef __MEMCHECK_H
+#define __MEMCHECK_H
+
+
+/* This file is for inclusion into client (your!) code.
+
+   You can use these macros to manipulate and query memory permissions
+   inside your own programs.
+
+   See comment near the top of valgrind.h on how to use them.
+*/
+
+#include "valgrind.h"
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! 
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+typedef
+   enum { 
+      VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE('M','C'),
+      VG_USERREQ__MAKE_MEM_UNDEFINED,
+      VG_USERREQ__MAKE_MEM_DEFINED,
+      VG_USERREQ__DISCARD,
+      VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,
+      VG_USERREQ__CHECK_MEM_IS_DEFINED,
+      VG_USERREQ__DO_LEAK_CHECK,
+      VG_USERREQ__COUNT_LEAKS,
+
+      VG_USERREQ__GET_VBITS,
+      VG_USERREQ__SET_VBITS,
+
+      VG_USERREQ__CREATE_BLOCK,
+
+      VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE,
+
+      /* Not next to VG_USERREQ__COUNT_LEAKS because it was added later. */
+      VG_USERREQ__COUNT_LEAK_BLOCKS,
+
+      VG_USERREQ__ENABLE_ADDR_ERROR_REPORTING_IN_RANGE,
+      VG_USERREQ__DISABLE_ADDR_ERROR_REPORTING_IN_RANGE,
+
+      VG_USERREQ__CHECK_MEM_IS_UNADDRESSABLE,
+      VG_USERREQ__CHECK_MEM_IS_UNDEFINED,
+
+      /* This is just for memcheck's internal use - don't use it */
+      _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR 
+         = VG_USERREQ_TOOL_BASE('M','C') + 256
+   } Vg_MemCheckClientRequest;
+
+
+
+/* Client-code macros to manipulate the state of memory. */
+
+/* Mark memory at _qzz_addr as unaddressable for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len)           \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_NOACCESS,       \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+      
+/* Similarly, mark memory at _qzz_addr as addressable but undefined
+   for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len)          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_UNDEFINED,      \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Similarly, mark memory at _qzz_addr as addressable and defined
+   for _qzz_len bytes. */
+#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len)            \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__MAKE_MEM_DEFINED,        \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Similar to VALGRIND_MAKE_MEM_DEFINED except that addressability is
+   not altered: bytes which are addressable are marked as defined,
+   but those which are not addressable are left unchanged. */
+#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len)     \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,              \
+                            VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Create a block-description handle.  The description is an ascii
+   string which is included in any messages pertaining to addresses
+   within the specified memory range.  Has no other effect on the
+   properties of the memory range. */
+#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc)      \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,        \
+                            VG_USERREQ__CREATE_BLOCK,              \
+                            (_qzz_addr), (_qzz_len), (_qzz_desc),  \
+                            0, 0)
+
+/* Discard a block-description-handle. Returns 1 for an
+   invalid handle, 0 for a valid handle. */
+#define VALGRIND_DISCARD(_qzz_blkindex)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,      \
+                            VG_USERREQ__DISCARD,                 \
+                            0, (_qzz_blkindex), 0, 0, 0)
+
+
+/* Client-code macros to check the state of memory. */
+
+/* Check that memory at _qzz_addr is addressable for _qzz_len bytes.
+   If suitable addressability is not established, Valgrind prints an
+   error message and returns the address of the first offending byte.
+   Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len)      \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                             \
+                            VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,  \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Check that memory at _qzz_addr is addressable and defined for
+   _qzz_len bytes.  If suitable addressability and definedness are not
+   established, Valgrind prints an error message and returns the
+   address of the first offending byte.  Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len)        \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                           \
+                            VG_USERREQ__CHECK_MEM_IS_DEFINED,    \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Use this macro to force the definedness and addressability of an
+   lvalue to be checked.  If suitable addressability and definedness
+   are not established, Valgrind prints an error message and returns
+   the address of the first offending byte.  Otherwise it returns
+   zero. */
+#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue)                \
+   VALGRIND_CHECK_MEM_IS_DEFINED(                                \
+      (volatile unsigned char *)&(__lvalue),                     \
+                      (unsigned long)(sizeof (__lvalue)))
+
+/* Check that memory at _qzz_addr is unaddressable for _qzz_len bytes.
+   If any byte in this range is addressable, Valgrind returns the
+   address of the first offending byte. Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_UNADDRESSABLE(_qzz_addr,_qzz_len)    \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                             \
+                            VG_USERREQ__CHECK_MEM_IS_UNADDRESSABLE,\
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Check that memory at _qzz_addr is undefined for _qzz_len bytes. If any
+   byte in this range is defined or unaddressable, Valgrind returns the
+   address of the first offending byte. Otherwise it returns zero. */
+#define VALGRIND_CHECK_MEM_IS_UNDEFINED(_qzz_addr,_qzz_len)        \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                             \
+                            VG_USERREQ__CHECK_MEM_IS_UNDEFINED,    \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/* Do a full memory leak check (like --leak-check=full) mid-execution. */
+#define VALGRIND_DO_LEAK_CHECK                                   \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,   \
+                                    0, 0, 0, 0, 0)
+
+/* Same as VALGRIND_DO_LEAK_CHECK but only showing the entries for
+   which there was an increase in leaked bytes or leaked nr of blocks
+   since the previous leak search. */
+#define VALGRIND_DO_ADDED_LEAK_CHECK                            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,  \
+                                    0, 1, 0, 0, 0)
+
+/* Same as VALGRIND_DO_ADDED_LEAK_CHECK but showing entries with
+   increased or decreased leaked bytes/blocks since previous leak
+   search. */
+#define VALGRIND_DO_CHANGED_LEAK_CHECK                          \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,  \
+                                    0, 2, 0, 0, 0)
+
+/* Do a summary memory leak check (like --leak-check=summary) mid-execution. */
+#define VALGRIND_DO_QUICK_LEAK_CHECK                             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DO_LEAK_CHECK,   \
+                                    1, 0, 0, 0, 0)
+
+/* Return number of leaked, dubious, reachable and suppressed bytes found by
+   all previous leak checks.  They must be lvalues.  */
+#define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed)     \
+   /* For safety on 64-bit platforms we assign the results to private
+      unsigned long variables, then assign these to the lvalues the user
+      specified, which works no matter what type 'leaked', 'dubious', etc
+      are.  We also initialise '_qzz_leaked', etc because
+      VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
+      defined. */                                                        \
+   {                                                                     \
+    unsigned long _qzz_leaked    = 0, _qzz_dubious    = 0;               \
+    unsigned long _qzz_reachable = 0, _qzz_suppressed = 0;               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(                                     \
+                               VG_USERREQ__COUNT_LEAKS,                  \
+                               &_qzz_leaked, &_qzz_dubious,              \
+                               &_qzz_reachable, &_qzz_suppressed, 0);    \
+    leaked     = _qzz_leaked;                                            \
+    dubious    = _qzz_dubious;                                           \
+    reachable  = _qzz_reachable;                                         \
+    suppressed = _qzz_suppressed;                                        \
+   }
+
+/* Return number of leaked, dubious, reachable and suppressed bytes found by
+   all previous leak checks.  They must be lvalues.  */
+#define VALGRIND_COUNT_LEAK_BLOCKS(leaked, dubious, reachable, suppressed) \
+   /* For safety on 64-bit platforms we assign the results to private
+      unsigned long variables, then assign these to the lvalues the user
+      specified, which works no matter what type 'leaked', 'dubious', etc
+      are.  We also initialise '_qzz_leaked', etc because
+      VG_USERREQ__COUNT_LEAKS doesn't mark the values returned as
+      defined. */                                                        \
+   {                                                                     \
+    unsigned long _qzz_leaked    = 0, _qzz_dubious    = 0;               \
+    unsigned long _qzz_reachable = 0, _qzz_suppressed = 0;               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(                                     \
+                               VG_USERREQ__COUNT_LEAK_BLOCKS,            \
+                               &_qzz_leaked, &_qzz_dubious,              \
+                               &_qzz_reachable, &_qzz_suppressed, 0);    \
+    leaked     = _qzz_leaked;                                            \
+    dubious    = _qzz_dubious;                                           \
+    reachable  = _qzz_reachable;                                         \
+    suppressed = _qzz_suppressed;                                        \
+   }
+
+
+/* Get the validity data for addresses [zza..zza+zznbytes-1] and copy it
+   into the provided zzvbits array.  Return values:
+      0   if not running on valgrind
+      1   success
+      2   [previously indicated unaligned arrays;  these are now allowed]
+      3   if any parts of zzsrc/zzvbits are not addressable.
+   The metadata is not copied in cases 0, 2 or 3 so it should be
+   impossible to segfault your system by using this call.
+*/
+#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes)                \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                \
+                                    VG_USERREQ__GET_VBITS,      \
+                                    (const char*)(zza),         \
+                                    (char*)(zzvbits),           \
+                                    (zznbytes), 0, 0)
+
+/* Set the validity data for addresses [zza..zza+zznbytes-1], copying it
+   from the provided zzvbits array.  Return values:
+      0   if not running on valgrind
+      1   success
+      2   [previously indicated unaligned arrays;  these are now allowed]
+      3   if any parts of zza/zzvbits are not addressable.
+   The metadata is not copied in cases 0, 2 or 3 so it should be
+   impossible to segfault your system by using this call.
+*/
+#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes)                \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                \
+                                    VG_USERREQ__SET_VBITS,      \
+                                    (const char*)(zza),         \
+                                    (const char*)(zzvbits),     \
+                                    (zznbytes), 0, 0 )
+
+/* Disable and re-enable reporting of addressing errors in the
+   specified address range. */
+#define VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE(_qzz_addr,_qzz_len) \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,    \
+       VG_USERREQ__DISABLE_ADDR_ERROR_REPORTING_IN_RANGE,      \
+       (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+#define VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE(_qzz_addr,_qzz_len) \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,    \
+       VG_USERREQ__ENABLE_ADDR_ERROR_REPORTING_IN_RANGE,       \
+       (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+#endif
+
diff --git a/ceph/src/pmdk/src/core/valgrind/pmemcheck.h b/ceph/src/pmdk/src/core/valgrind/pmemcheck.h
new file mode 100644 (file)
index 0000000..94796db
--- /dev/null
@@ -0,0 +1,186 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+#ifndef __PMEMCHECK_H
+#define __PMEMCHECK_H
+
+
+/* This file is for inclusion into client (your!) code.
+
+   You can use these macros to manipulate and query memory permissions
+   inside your own programs.
+
+   See comment near the top of valgrind.h on how to use them.
+*/
+
+#include "valgrind.h"
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE ORDER OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+typedef
+   enum {
+       VG_USERREQ__PMC_REGISTER_PMEM_MAPPING = VG_USERREQ_TOOL_BASE('P','C'),
+       VG_USERREQ__PMC_REGISTER_PMEM_FILE,
+       VG_USERREQ__PMC_REMOVE_PMEM_MAPPING,
+       VG_USERREQ__PMC_CHECK_IS_PMEM_MAPPING,
+       VG_USERREQ__PMC_PRINT_PMEM_MAPPINGS,
+       VG_USERREQ__PMC_DO_FLUSH,
+       VG_USERREQ__PMC_DO_FENCE,
+       VG_USERREQ__PMC_RESERVED1,  /* Do not use. */
+       VG_USERREQ__PMC_WRITE_STATS,
+       VG_USERREQ__PMC_RESERVED2,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED3,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED4,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED5,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED7,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED8,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED9,  /* Do not use. */
+       VG_USERREQ__PMC_RESERVED10, /* Do not use. */
+       VG_USERREQ__PMC_SET_CLEAN,
+       /* transaction support */
+       VG_USERREQ__PMC_START_TX,
+       VG_USERREQ__PMC_START_TX_N,
+       VG_USERREQ__PMC_END_TX,
+       VG_USERREQ__PMC_END_TX_N,
+       VG_USERREQ__PMC_ADD_TO_TX,
+       VG_USERREQ__PMC_ADD_TO_TX_N,
+       VG_USERREQ__PMC_REMOVE_FROM_TX,
+       VG_USERREQ__PMC_REMOVE_FROM_TX_N,
+       VG_USERREQ__PMC_ADD_THREAD_TO_TX_N,
+       VG_USERREQ__PMC_REMOVE_THREAD_FROM_TX_N,
+       VG_USERREQ__PMC_ADD_TO_GLOBAL_TX_IGNORE,
+       VG_USERREQ__PMC_RESERVED6,  /* Do not use. */
+       VG_USERREQ__PMC_EMIT_LOG,
+   } Vg_PMemCheckClientRequest;
+
+
+
+/* Client-code macros to manipulate pmem mappings */
+
+/** Register a persistent memory mapping region */
+#define VALGRIND_PMC_REGISTER_PMEM_MAPPING(_qzz_addr, _qzz_len)             \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REGISTER_PMEM_MAPPING,          \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Register a persistent memory file */
+#define VALGRIND_PMC_REGISTER_PMEM_FILE(_qzz_desc, _qzz_addr_base,          \
+                                        _qzz_size, _qzz_offset)             \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REGISTER_PMEM_FILE,             \
+                            (_qzz_desc), (_qzz_addr_base), (_qzz_size),     \
+                            (_qzz_offset), 0)
+
+/** Remove a persistent memory mapping region */
+#define VALGRIND_PMC_REMOVE_PMEM_MAPPING(_qzz_addr,_qzz_len)                \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REMOVE_PMEM_MAPPING,            \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Check if the given range is a registered persistent memory mapping */
+#define VALGRIND_PMC_CHECK_IS_PMEM_MAPPING(_qzz_addr,_qzz_len)              \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_CHECK_IS_PMEM_MAPPING,          \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Register an SFENCE */
+#define VALGRIND_PMC_PRINT_PMEM_MAPPINGS                                    \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_PRINT_PMEM_MAPPINGS,    \
+                                    0, 0, 0, 0, 0)
+
+/** Register a CLFLUSH-like operation */
+#define VALGRIND_PMC_DO_FLUSH(_qzz_addr,_qzz_len)                           \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_DO_FLUSH,                       \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Register an SFENCE */
+#define VALGRIND_PMC_DO_FENCE                                               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_DO_FENCE,               \
+                                    0, 0, 0, 0, 0)
+
+/** Write tool stats */
+#define VALGRIND_PMC_WRITE_STATS                                            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_WRITE_STATS,            \
+                                    0, 0, 0, 0, 0)
+
+/** Emit user log */
+#define VALGRIND_PMC_EMIT_LOG(_qzz_emit_log)                                \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_EMIT_LOG,                       \
+                            (_qzz_emit_log), 0, 0, 0, 0)
+
+/** Set a region of persistent memory as clean */
+#define VALGRIND_PMC_SET_CLEAN(_qzz_addr,_qzz_len)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_SET_CLEAN,                      \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Support for transactions */
+
+/** Start an implicit persistent memory transaction */
+#define VALGRIND_PMC_START_TX                                               \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_START_TX,               \
+                                    0, 0, 0, 0, 0)
+
+/** Start an explicit persistent memory transaction */
+#define VALGRIND_PMC_START_TX_N(_qzz_txn)                                   \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_START_TX_N,                     \
+                            (_qzz_txn), 0, 0, 0, 0)
+
+/** End an implicit persistent memory transaction */
+#define VALGRIND_PMC_END_TX                                                 \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_END_TX,                 \
+                                    0, 0, 0, 0, 0)
+
+/** End an explicit persistent memory transaction */
+#define VALGRIND_PMC_END_TX_N(_qzz_txn)                                     \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_END_TX_N,                       \
+                            (_qzz_txn), 0, 0, 0, 0)
+
+/** Add a persistent memory region to the implicit transaction */
+#define VALGRIND_PMC_ADD_TO_TX(_qzz_addr,_qzz_len)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_ADD_TO_TX,                      \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Add a persistent memory region to an explicit transaction */
+#define VALGRIND_PMC_ADD_TO_TX_N(_qzz_txn,_qzz_addr,_qzz_len)               \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_ADD_TO_TX_N,                    \
+                            (_qzz_txn), (_qzz_addr), (_qzz_len), 0, 0)
+
+/** Remove a persistent memory region from the implicit transaction */
+#define VALGRIND_PMC_REMOVE_FROM_TX(_qzz_addr,_qzz_len)                     \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REMOVE_FROM_TX,                 \
+                            (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+/** Remove a persistent memory region from an explicit transaction */
+#define VALGRIND_PMC_REMOVE_FROM_TX_N(_qzz_txn,_qzz_addr,_qzz_len)          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REMOVE_FROM_TX_N,               \
+                            (_qzz_txn), (_qzz_addr), (_qzz_len), 0, 0)
+
+/** End an explicit persistent memory transaction */
+#define VALGRIND_PMC_ADD_THREAD_TX_N(_qzz_txn)                              \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_ADD_THREAD_TO_TX_N,             \
+                            (_qzz_txn), 0, 0, 0, 0)
+
+/** End an explicit persistent memory transaction */
+#define VALGRIND_PMC_REMOVE_THREAD_FROM_TX_N(_qzz_txn)                      \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,                 \
+                            VG_USERREQ__PMC_REMOVE_THREAD_FROM_TX_N,        \
+                            (_qzz_txn), 0, 0, 0, 0)
+
+/** Remove a persistent memory region from the implicit transaction */
+#define VALGRIND_PMC_ADD_TO_GLOBAL_TX_IGNORE(_qzz_addr,_qzz_len)            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__PMC_ADD_TO_GLOBAL_TX_IGNORE,\
+                                    (_qzz_addr), (_qzz_len), 0, 0, 0)
+
+#endif
diff --git a/ceph/src/pmdk/src/core/valgrind/valgrind.h b/ceph/src/pmdk/src/core/valgrind/valgrind.h
new file mode 100644 (file)
index 0000000..16d3f9b
--- /dev/null
@@ -0,0 +1,6647 @@
+/* -*- c -*-
+   ----------------------------------------------------------------
+
+   Notice that the following BSD-style license applies to this one
+   file (valgrind.h) only.  The rest of Valgrind is licensed under the
+   terms of the GNU General Public License, version 2, unless
+   otherwise indicated.  See the COPYING file in the source
+   distribution for details.
+
+   ----------------------------------------------------------------
+
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2017 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+   ----------------------------------------------------------------
+
+   Notice that the above BSD-style license applies to this one file
+   (valgrind.h) only.  The entire rest of Valgrind is licensed under
+   the terms of the GNU General Public License, version 2.  See the
+   COPYING file in the source distribution for details.
+
+   ---------------------------------------------------------------- 
+*/
+
+
+/* This file is for inclusion into client (your!) code.
+
+   You can use these macros to manipulate and query Valgrind's 
+   execution inside your own programs.
+
+   The resulting executables will still run without Valgrind, just a
+   little bit more slowly than they otherwise would, but otherwise
+   unchanged.  When not running on valgrind, each client request
+   consumes very few (eg. 7) instructions, so the resulting performance
+   loss is negligible unless you plan to execute client requests
+   millions of times per second.  Nevertheless, if that is still a
+   problem, you can compile with the NVALGRIND symbol defined (gcc
+   -DNVALGRIND) so that client requests are not even compiled in.  */
+
+#ifndef __VALGRIND_H
+#define __VALGRIND_H
+
+
+/* ------------------------------------------------------------------ */
+/* VERSION NUMBER OF VALGRIND                                         */
+/* ------------------------------------------------------------------ */
+
+/* Specify Valgrind's version number, so that user code can
+   conditionally compile based on our version number.  Note that these
+   were introduced at version 3.6 and so do not exist in version 3.5
+   or earlier.  The recommended way to use them to check for "version
+   X.Y or later" is (eg)
+
+#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__)   \
+    && (__VALGRIND_MAJOR__ > 3                                   \
+        || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
+*/
+#define __VALGRIND_MAJOR__    3
+#define __VALGRIND_MINOR__    14
+
+
+#include <stdarg.h>
+
+/* Nb: this file might be included in a file compiled with -ansi.  So
+   we can't use C++ style "//" comments nor the "asm" keyword (instead
+   use "__asm__"). */
+
+/* Derive some tags indicating what the target platform is.  Note
+   that in this file we're using the compiler's CPP symbols for
+   identifying architectures, which are different to the ones we use
+   within the rest of Valgrind.  Note, __powerpc__ is active for both
+   32 and 64-bit PPC, whereas __powerpc64__ is only active for the
+   latter (on Linux, that is).
+
+   Misc note: how to find out what's predefined in gcc by default:
+   gcc -Wp,-dM somefile.c
+*/
+#undef PLAT_x86_darwin
+#undef PLAT_amd64_darwin
+#undef PLAT_x86_win32
+#undef PLAT_amd64_win64
+#undef PLAT_x86_linux
+#undef PLAT_amd64_linux
+#undef PLAT_ppc32_linux
+#undef PLAT_ppc64be_linux
+#undef PLAT_ppc64le_linux
+#undef PLAT_arm_linux
+#undef PLAT_arm64_linux
+#undef PLAT_s390x_linux
+#undef PLAT_mips32_linux
+#undef PLAT_mips64_linux
+#undef PLAT_x86_solaris
+#undef PLAT_amd64_solaris
+
+
+#if defined(__APPLE__) && defined(__i386__)
+#  define PLAT_x86_darwin 1
+#elif defined(__APPLE__) && defined(__x86_64__)
+#  define PLAT_amd64_darwin 1
+#elif (defined(__MINGW32__) && !defined(__MINGW64__)) \
+      || defined(__CYGWIN32__) \
+      || (defined(_WIN32) && defined(_M_IX86))
+#  define PLAT_x86_win32 1
+#elif defined(__MINGW64__) \
+      || (defined(_WIN64) && defined(_M_X64))
+#  define PLAT_amd64_win64 1
+#elif defined(__linux__) && defined(__i386__)
+#  define PLAT_x86_linux 1
+#elif defined(__linux__) && defined(__x86_64__) && !defined(__ILP32__)
+#  define PLAT_amd64_linux 1
+#elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__)
+#  define PLAT_ppc32_linux 1
+#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && _CALL_ELF != 2
+/* Big Endian uses ELF version 1 */
+#  define PLAT_ppc64be_linux 1
+#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && _CALL_ELF == 2
+/* Little Endian uses ELF version 2 */
+#  define PLAT_ppc64le_linux 1
+#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
+#  define PLAT_arm_linux 1
+#elif defined(__linux__) && defined(__aarch64__) && !defined(__arm__)
+#  define PLAT_arm64_linux 1
+#elif defined(__linux__) && defined(__s390__) && defined(__s390x__)
+#  define PLAT_s390x_linux 1
+#elif defined(__linux__) && defined(__mips__) && (__mips==64)
+#  define PLAT_mips64_linux 1
+#elif defined(__linux__) && defined(__mips__) && (__mips!=64)
+#  define PLAT_mips32_linux 1
+#elif defined(__sun) && defined(__i386__)
+#  define PLAT_x86_solaris 1
+#elif defined(__sun) && defined(__x86_64__)
+#  define PLAT_amd64_solaris 1
+#else
+/* If we're not compiling for our target platform, don't generate
+   any inline asms.  */
+#  if !defined(NVALGRIND)
+#    define NVALGRIND 1
+#  endif
+#endif
+
+
+/* ------------------------------------------------------------------ */
+/* ARCHITECTURE SPECIFICS for SPECIAL INSTRUCTIONS.  There is nothing */
+/* in here of use to end-users -- skip to the next section.           */
+/* ------------------------------------------------------------------ */
+
+/*
+ * VALGRIND_DO_CLIENT_REQUEST(): a statement that invokes a Valgrind client
+ * request. Accepts both pointers and integers as arguments.
+ *
+ * VALGRIND_DO_CLIENT_REQUEST_STMT(): a statement that invokes a Valgrind
+ * client request that does not return a value.
+
+ * VALGRIND_DO_CLIENT_REQUEST_EXPR(): a C expression that invokes a Valgrind
+ * client request and whose value equals the client request result.  Accepts
+ * both pointers and integers as arguments.  Note that such calls are not
+ * necessarily pure functions -- they may have side effects.
+ */
+
+#define VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default,            \
+                                   _zzq_request, _zzq_arg1, _zzq_arg2,  \
+                                   _zzq_arg3, _zzq_arg4, _zzq_arg5)     \
+  do { (_zzq_rlval) = VALGRIND_DO_CLIENT_REQUEST_EXPR((_zzq_default),   \
+                        (_zzq_request), (_zzq_arg1), (_zzq_arg2),       \
+                        (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
+#define VALGRIND_DO_CLIENT_REQUEST_STMT(_zzq_request, _zzq_arg1,        \
+                           _zzq_arg2,  _zzq_arg3, _zzq_arg4, _zzq_arg5) \
+  do { (void) VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                        \
+                    (_zzq_request), (_zzq_arg1), (_zzq_arg2),           \
+                    (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
+#if defined(NVALGRIND)
+
+/* Define NVALGRIND to completely remove the Valgrind magic sequence
+   from the compiled code (analogous to NDEBUG's effects on
+   assert()) */
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+      (_zzq_default)
+
+#else  /* ! NVALGRIND */
+
+/* The following defines the magic code sequences which the JITter
+   spots and handles magically.  Don't look too closely at them as
+   they will rot your brain.
+
+   The assembly code sequences for all architectures is in this one
+   file.  This is because this file must be stand-alone, and we don't
+   want to have multiple files.
+
+   For VALGRIND_DO_CLIENT_REQUEST, we must ensure that the default
+   value gets put in the return slot, so that everything works when
+   this is executed not under Valgrind.  Args are passed in a memory
+   block, and so there's no intrinsic limit to the number that could
+   be passed, but it's currently five.
+   
+   The macro args are: 
+      _zzq_rlval    result lvalue
+      _zzq_default  default value (result returned when running on real CPU)
+      _zzq_request  request code
+      _zzq_arg1..5  request params
+
+   The other two macros are used to support function wrapping, and are
+   a lot simpler.  VALGRIND_GET_NR_CONTEXT returns the value of the
+   guest's NRADDR pseudo-register and whatever other information is
+   needed to safely run the call original from the wrapper: on
+   ppc64-linux, the R2 value at the divert point is also needed.  This
+   information is abstracted into a user-visible type, OrigFn.
+
+   VALGRIND_CALL_NOREDIR_* behaves the same as the following on the
+   guest, but guarantees that the branch instruction will not be
+   redirected: x86: call *%eax, amd64: call *%rax, ppc32/ppc64:
+   branch-and-link-to-r11.  VALGRIND_CALL_NOREDIR is just text, not a
+   complete inline asm, since it needs to be combined with more magic
+   inline asm stuff to be useful.
+*/
+
+/* ----------------- x86-{linux,darwin,solaris} ---------------- */
+
+#if defined(PLAT_x86_linux)  ||  defined(PLAT_x86_darwin)  \
+    ||  (defined(PLAT_x86_win32) && defined(__GNUC__)) \
+    ||  defined(PLAT_x86_solaris)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "roll $3,  %%edi ; roll $13, %%edi\n\t"      \
+                     "roll $29, %%edi ; roll $19, %%edi\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+  __extension__                                                   \
+  ({volatile unsigned int _zzq_args[6];                           \
+    volatile unsigned int _zzq_result;                            \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %EDX = client_request ( %EAX ) */         \
+                     "xchgl %%ebx,%%ebx"                          \
+                     : "=d" (_zzq_result)                         \
+                     : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned int __addr;                                 \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %EAX = guest_NRADDR */                    \
+                     "xchgl %%ecx,%%ecx"                          \
+                     : "=a" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_EAX                                 \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* call-noredir *%EAX */                     \
+                     "xchgl %%edx,%%edx\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "xchgl %%edi,%%edi\n\t"                     \
+                     : : : "cc", "memory"                        \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_x86_linux || PLAT_x86_darwin || (PLAT_x86_win32 && __GNUC__)
+          || PLAT_x86_solaris */
+
+/* ------------------------- x86-Win32 ------------------------- */
+
+#if defined(PLAT_x86_win32) && !defined(__GNUC__)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#if defined(_MSC_VER)
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     __asm rol edi, 3  __asm rol edi, 13          \
+                     __asm rol edi, 29 __asm rol edi, 19
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+    valgrind_do_client_request_expr((uintptr_t)(_zzq_default),    \
+        (uintptr_t)(_zzq_request), (uintptr_t)(_zzq_arg1),        \
+        (uintptr_t)(_zzq_arg2), (uintptr_t)(_zzq_arg3),           \
+        (uintptr_t)(_zzq_arg4), (uintptr_t)(_zzq_arg5))
+
+static __inline uintptr_t
+valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
+                                uintptr_t _zzq_arg1, uintptr_t _zzq_arg2,
+                                uintptr_t _zzq_arg3, uintptr_t _zzq_arg4,
+                                uintptr_t _zzq_arg5)
+{
+    volatile uintptr_t _zzq_args[6];
+    volatile unsigned int _zzq_result;
+    _zzq_args[0] = (uintptr_t)(_zzq_request);
+    _zzq_args[1] = (uintptr_t)(_zzq_arg1);
+    _zzq_args[2] = (uintptr_t)(_zzq_arg2);
+    _zzq_args[3] = (uintptr_t)(_zzq_arg3);
+    _zzq_args[4] = (uintptr_t)(_zzq_arg4);
+    _zzq_args[5] = (uintptr_t)(_zzq_arg5);
+    __asm { __asm lea eax, _zzq_args __asm mov edx, _zzq_default
+            __SPECIAL_INSTRUCTION_PREAMBLE
+            /* %EDX = client_request ( %EAX ) */
+            __asm xchg ebx,ebx
+            __asm mov _zzq_result, edx
+    }
+    return _zzq_result;
+}
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned int __addr;                                 \
+    __asm { __SPECIAL_INSTRUCTION_PREAMBLE                        \
+            /* %EAX = guest_NRADDR */                             \
+            __asm xchg ecx,ecx                                    \
+            __asm mov __addr, eax                                 \
+    }                                                             \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_EAX ERROR
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm { __SPECIAL_INSTRUCTION_PREAMBLE                       \
+            __asm xchg edi,edi                                   \
+    }                                                            \
+ } while (0)
+
+#else
+#error Unsupported compiler.
+#endif
+
+#endif /* PLAT_x86_win32 */
+
+/* ----------------- amd64-{linux,darwin,solaris} --------------- */
+
+#if defined(PLAT_amd64_linux)  ||  defined(PLAT_amd64_darwin) \
+    ||  defined(PLAT_amd64_solaris) \
+    ||  (defined(PLAT_amd64_win64) && defined(__GNUC__))
+
+typedef
+   struct { 
+      unsigned long int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rolq $3,  %%rdi ; rolq $13, %%rdi\n\t"      \
+                     "rolq $61, %%rdi ; rolq $51, %%rdi\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+    __extension__                                                 \
+    ({ volatile unsigned long int _zzq_args[6];                   \
+    volatile unsigned long int _zzq_result;                       \
+    _zzq_args[0] = (unsigned long int)(_zzq_request);             \
+    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
+    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
+    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
+    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
+    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %RDX = client_request ( %RAX ) */         \
+                     "xchgq %%rbx,%%rbx"                          \
+                     : "=d" (_zzq_result)                         \
+                     : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_result;                                                  \
+    })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned long int __addr;                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %RAX = guest_NRADDR */                    \
+                     "xchgq %%rcx,%%rcx"                          \
+                     : "=a" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory"                             \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_RAX                                 \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* call-noredir *%RAX */                     \
+                     "xchgq %%rdx,%%rdx\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "xchgq %%rdi,%%rdi\n\t"                     \
+                     : : : "cc", "memory"                        \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_amd64_linux || PLAT_amd64_darwin || PLAT_amd64_solaris */
+
+/* ------------------------- amd64-Win64 ------------------------- */
+
+#if defined(PLAT_amd64_win64) && !defined(__GNUC__)
+
+#error Unsupported compiler.
+
+#endif /* PLAT_amd64_win64 */
+
+/* ------------------------ ppc32-linux ------------------------ */
+
+#if defined(PLAT_ppc32_linux)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                    "rlwinm 0,0,3,0,31  ; rlwinm 0,0,13,0,31\n\t" \
+                    "rlwinm 0,0,29,0,31 ; rlwinm 0,0,19,0,31\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+    __extension__                                                 \
+  ({         unsigned int  _zzq_args[6];                          \
+             unsigned int  _zzq_result;                           \
+             unsigned int* _zzq_ptr;                              \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    _zzq_ptr = _zzq_args;                                         \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = client_request ( %R4 ) */           \
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+    })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned int __addr;                                          \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR */                     \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R11 */       \
+                     "or 3,3,3\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "or 5,5,5\n\t"                              \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_ppc32_linux */
+
+/* ------------------------ ppc64-linux ------------------------ */
+
+#if defined(PLAT_ppc64be_linux)
+
+typedef
+   struct { 
+      unsigned long int nraddr; /* where's the code? */
+      unsigned long int r2;  /* what tocptr do we need? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rotldi 0,0,3  ; rotldi 0,0,13\n\t"          \
+                     "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({         unsigned long int  _zzq_args[6];                     \
+             unsigned long int  _zzq_result;                      \
+             unsigned long int* _zzq_ptr;                         \
+    _zzq_args[0] = (unsigned long int)(_zzq_request);             \
+    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
+    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
+    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
+    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
+    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
+    _zzq_ptr = _zzq_args;                                         \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = client_request ( %R4 ) */           \
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned long int __addr;                                     \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR */                     \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR_GPR2 */                \
+                     "or 4,4,4\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->r2 = __addr;                                       \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R11 */       \
+                     "or 3,3,3\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "or 5,5,5\n\t"                              \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_ppc64be_linux */
+
+#if defined(PLAT_ppc64le_linux)
+
+typedef
+   struct {
+      unsigned long int nraddr; /* where's the code? */
+      unsigned long int r2;     /* what tocptr do we need? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+                     "rotldi 0,0,3  ; rotldi 0,0,13\n\t"          \
+                     "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({         unsigned long int  _zzq_args[6];                     \
+             unsigned long int  _zzq_result;                      \
+             unsigned long int* _zzq_ptr;                         \
+    _zzq_args[0] = (unsigned long int)(_zzq_request);             \
+    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
+    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
+    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
+    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
+    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
+    _zzq_ptr = _zzq_args;                                         \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = client_request ( %R4 ) */           \
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned long int __addr;                                     \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR */                     \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %R3 = guest_NRADDR_GPR2 */                \
+                     "or 4,4,4\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->r2 = __addr;                                       \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R12 */       \
+                     "or 3,3,3\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "or 5,5,5\n\t"                              \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_ppc64le_linux */
+
+/* ------------------------- arm-linux ------------------------- */
+
+#if defined(PLAT_arm_linux)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+            "mov r12, r12, ror #3  ; mov r12, r12, ror #13 \n\t"  \
+            "mov r12, r12, ror #29 ; mov r12, r12, ror #19 \n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({volatile unsigned int  _zzq_args[6];                          \
+    volatile unsigned int  _zzq_result;                           \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+    __asm__ volatile("mov r3, %1\n\t" /*default*/                 \
+                     "mov r4, %2\n\t" /*ptr*/                     \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* R3 = client_request ( R4 ) */             \
+                     "orr r10, r10, r10\n\t"                      \
+                     "mov %0, r3"     /*result*/                  \
+                     : "=r" (_zzq_result)                         \
+                     : "r" (_zzq_default), "r" (&_zzq_args[0])    \
+                     : "cc","memory", "r3", "r4");                \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned int __addr;                                          \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* R3 = guest_NRADDR */                      \
+                     "orr r11, r11, r11\n\t"                      \
+                     "mov %0, r3"                                 \
+                     : "=r" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "r3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                    \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir *%R4 */        \
+                     "orr r12, r12, r12\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "orr r9, r9, r9\n\t"                        \
+                     : : : "cc", "memory"                        \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_arm_linux */
+
+/* ------------------------ arm64-linux ------------------------- */
+
+#if defined(PLAT_arm64_linux)
+
+typedef
+   struct { 
+      unsigned long int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
+            "ror x12, x12, #3  ;  ror x12, x12, #13 \n\t"         \
+            "ror x12, x12, #51 ;  ror x12, x12, #61 \n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
+        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+                                                                  \
+  __extension__                                                   \
+  ({volatile unsigned long int  _zzq_args[6];                     \
+    volatile unsigned long int  _zzq_result;                      \
+    _zzq_args[0] = (unsigned long int)(_zzq_request);             \
+    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
+    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
+    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
+    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
+    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
+    __asm__ volatile("mov x3, %1\n\t" /*default*/                 \
+                     "mov x4, %2\n\t" /*ptr*/                     \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* X3 = client_request ( X4 ) */             \
+                     "orr x10, x10, x10\n\t"                      \
+                     "mov %0, x3"     /*result*/                  \
+                     : "=r" (_zzq_result)                         \
+                     : "r" ((unsigned long int)(_zzq_default)),   \
+                       "r" (&_zzq_args[0])                        \
+                     : "cc","memory", "x3", "x4");                \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    unsigned long int __addr;                                     \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* X3 = guest_NRADDR */                      \
+                     "orr x11, x11, x11\n\t"                      \
+                     "mov %0, x3"                                 \
+                     : "=r" (__addr)                              \
+                     :                                            \
+                     : "cc", "memory", "x3"                       \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                    \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* branch-and-link-to-noredir X8 */          \
+                     "orr x12, x12, x12\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "orr x9, x9, x9\n\t"                        \
+                     : : : "cc", "memory"                        \
+                    );                                           \
+ } while (0)
+
+#endif /* PLAT_arm64_linux */
+
+/* ------------------------ s390x-linux ------------------------ */
+
+#if defined(PLAT_s390x_linux)
+
+typedef
+  struct {
+     unsigned long int nraddr; /* where's the code? */
+  }
+  OrigFn;
+
+/* __SPECIAL_INSTRUCTION_PREAMBLE will be used to identify Valgrind specific
+ * code. This detection is implemented in platform specific toIR.c
+ * (e.g. VEX/priv/guest_s390_decoder.c).
+ */
+#define __SPECIAL_INSTRUCTION_PREAMBLE                           \
+                     "lr 15,15\n\t"                              \
+                     "lr 1,1\n\t"                                \
+                     "lr 2,2\n\t"                                \
+                     "lr 3,3\n\t"
+
+#define __CLIENT_REQUEST_CODE "lr 2,2\n\t"
+#define __GET_NR_CONTEXT_CODE "lr 3,3\n\t"
+#define __CALL_NO_REDIR_CODE  "lr 4,4\n\t"
+#define __VEX_INJECT_IR_CODE  "lr 5,5\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                         \
+       _zzq_default, _zzq_request,                               \
+       _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+  __extension__                                                  \
+ ({volatile unsigned long int _zzq_args[6];                      \
+   volatile unsigned long int _zzq_result;                       \
+   _zzq_args[0] = (unsigned long int)(_zzq_request);             \
+   _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
+   _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
+   _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
+   _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
+   _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
+   __asm__ volatile(/* r2 = args */                              \
+                    "lgr 2,%1\n\t"                               \
+                    /* r3 = default */                           \
+                    "lgr 3,%2\n\t"                               \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CLIENT_REQUEST_CODE                        \
+                    /* results = r3 */                           \
+                    "lgr %0, 3\n\t"                              \
+                    : "=d" (_zzq_result)                         \
+                    : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                    : "cc", "2", "3", "memory"                   \
+                   );                                            \
+   _zzq_result;                                                  \
+ })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                      \
+ { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+   volatile unsigned long int __addr;                            \
+   __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __GET_NR_CONTEXT_CODE                        \
+                    "lgr %0, 3\n\t"                              \
+                    : "=a" (__addr)                              \
+                    :                                            \
+                    : "cc", "3", "memory"                        \
+                   );                                            \
+   _zzq_orig->nraddr = __addr;                                   \
+ }
+
+#define VALGRIND_CALL_NOREDIR_R1                                 \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CALL_NO_REDIR_CODE
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     __VEX_INJECT_IR_CODE);                      \
+ } while (0)
+
+#endif /* PLAT_s390x_linux */
+
+/* ------------------------- mips32-linux ---------------- */
+
+#if defined(PLAT_mips32_linux)
+
+typedef
+   struct { 
+      unsigned int nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+/* .word  0x342
+ * .word  0x742
+ * .word  0xC2
+ * .word  0x4C2*/
+#define __SPECIAL_INSTRUCTION_PREAMBLE          \
+                     "srl $0, $0, 13\n\t"       \
+                     "srl $0, $0, 29\n\t"       \
+                     "srl $0, $0, 3\n\t"        \
+                     "srl $0, $0, 19\n\t"
+                    
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+       _zzq_default, _zzq_request,                                \
+       _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)     \
+  __extension__                                                   \
+  ({ volatile unsigned int _zzq_args[6];                          \
+    volatile unsigned int _zzq_result;                            \
+    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
+    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
+    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
+    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
+    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
+    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
+        __asm__ volatile("move $11, %1\n\t" /*default*/           \
+                     "move $12, %2\n\t" /*ptr*/                   \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* T3 = client_request ( T4 ) */             \
+                     "or $13, $13, $13\n\t"                       \
+                     "move %0, $11\n\t"     /*result*/            \
+                     : "=r" (_zzq_result)                         \
+                     : "r" (_zzq_default), "r" (&_zzq_args[0])    \
+                     : "$11", "$12", "memory");                   \
+    _zzq_result;                                                  \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+    volatile unsigned int __addr;                                 \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                     /* %t9 = guest_NRADDR */                     \
+                     "or $14, $14, $14\n\t"                       \
+                     "move %0, $11"     /*result*/                \
+                     : "=r" (__addr)                              \
+                     :                                            \
+                     : "$11"                                      \
+                    );                                            \
+    _zzq_orig->nraddr = __addr;                                   \
+  }
+
+#define VALGRIND_CALL_NOREDIR_T9                                 \
+                     __SPECIAL_INSTRUCTION_PREAMBLE              \
+                     /* call-noredir *%t9 */                     \
+                     "or $15, $15, $15\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                 \
+ do {                                                            \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE              \
+                     "or $11, $11, $11\n\t"                      \
+                    );                                           \
+ } while (0)
+
+
+#endif /* PLAT_mips32_linux */
+
+/* ------------------------- mips64-linux ---------------- */
+
+#if defined(PLAT_mips64_linux)
+
+typedef
+   struct {
+      unsigned long nraddr; /* where's the code? */
+   }
+   OrigFn;
+
+/* dsll $0,$0, 3
+ * dsll $0,$0, 13
+ * dsll $0,$0, 29
+ * dsll $0,$0, 19*/
+#define __SPECIAL_INSTRUCTION_PREAMBLE                              \
+                     "dsll $0,$0, 3 ; dsll $0,$0,13\n\t"            \
+                     "dsll $0,$0,29 ; dsll $0,$0,19\n\t"
+
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                            \
+       _zzq_default, _zzq_request,                                  \
+       _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)       \
+  __extension__                                                     \
+  ({ volatile unsigned long int _zzq_args[6];                       \
+    volatile unsigned long int _zzq_result;                         \
+    _zzq_args[0] = (unsigned long int)(_zzq_request);               \
+    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                  \
+    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                  \
+    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                  \
+    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                  \
+    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                  \
+        __asm__ volatile("move $11, %1\n\t" /*default*/             \
+                         "move $12, %2\n\t" /*ptr*/                 \
+                         __SPECIAL_INSTRUCTION_PREAMBLE             \
+                         /* $11 = client_request ( $12 ) */         \
+                         "or $13, $13, $13\n\t"                     \
+                         "move %0, $11\n\t"     /*result*/          \
+                         : "=r" (_zzq_result)                       \
+                         : "r" (_zzq_default), "r" (&_zzq_args[0])  \
+                         : "$11", "$12", "memory");                 \
+    _zzq_result;                                                    \
+  })
+
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                         \
+  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                     \
+    volatile unsigned long int __addr;                              \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE                 \
+                     /* $11 = guest_NRADDR */                       \
+                     "or $14, $14, $14\n\t"                         \
+                     "move %0, $11"     /*result*/                  \
+                     : "=r" (__addr)                                \
+                     :                                              \
+                     : "$11");                                      \
+    _zzq_orig->nraddr = __addr;                                     \
+  }
+
+#define VALGRIND_CALL_NOREDIR_T9                                    \
+                     __SPECIAL_INSTRUCTION_PREAMBLE                 \
+                     /* call-noredir $25 */                         \
+                     "or $15, $15, $15\n\t"
+
+#define VALGRIND_VEX_INJECT_IR()                                    \
+ do {                                                               \
+    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE                 \
+                     "or $11, $11, $11\n\t"                         \
+                    );                                              \
+ } while (0)
+
+#endif /* PLAT_mips64_linux */
+
+/* Insert assembly code for other platforms here... */
+
+#endif /* NVALGRIND */
+
+
+/* ------------------------------------------------------------------ */
+/* PLATFORM SPECIFICS for FUNCTION WRAPPING.  This is all very        */
+/* ugly.  It's the least-worst tradeoff I can think of.               */
+/* ------------------------------------------------------------------ */
+
+/* This section defines magic (a.k.a appalling-hack) macros for doing
+   guaranteed-no-redirection macros, so as to get from function
+   wrappers to the functions they are wrapping.  The whole point is to
+   construct standard call sequences, but to do the call itself with a
+   special no-redirect call pseudo-instruction that the JIT
+   understands and handles specially.  This section is long and
+   repetitious, and I can't see a way to make it shorter.
+
+   The naming scheme is as follows:
+
+      CALL_FN_{W,v}_{v,W,WW,WWW,WWWW,5W,6W,7W,etc}
+
+   'W' stands for "word" and 'v' for "void".  Hence there are
+   different macros for calling arity 0, 1, 2, 3, 4, etc, functions,
+   and for each, the possibility of returning a word-typed result, or
+   no result.
+*/
+
+/* Use these to write the name of your wrapper.  NOTE: duplicates
+   VG_WRAP_FUNCTION_Z{U,Z} in pub_tool_redir.h.  NOTE also: inserts
+   the default behaviour equivalance class tag "0000" into the name.
+   See pub_tool_redir.h for details -- normally you don't need to
+   think about this, though. */
+
+/* Use an extra level of macroisation so as to ensure the soname/fnname
+   args are fully macro-expanded before pasting them together. */
+#define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd
+
+#define I_WRAP_SONAME_FNNAME_ZU(soname,fnname)                    \
+   VG_CONCAT4(_vgw00000ZU_,soname,_,fnname)
+
+#define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname)                    \
+   VG_CONCAT4(_vgw00000ZZ_,soname,_,fnname)
+
+/* Use this macro from within a wrapper function to collect the
+   context (address and possibly other info) of the original function.
+   Once you have that you can then use it in one of the CALL_FN_
+   macros.  The type of the argument _lval is OrigFn. */
+#define VALGRIND_GET_ORIG_FN(_lval)  VALGRIND_GET_NR_CONTEXT(_lval)
+
+/* Also provide end-user facilities for function replacement, rather
+   than wrapping.  A replacement function differs from a wrapper in
+   that it has no way to get hold of the original function being
+   called, and hence no way to call onwards to it.  In a replacement
+   function, VALGRIND_GET_ORIG_FN always returns zero. */
+
+#define I_REPLACE_SONAME_FNNAME_ZU(soname,fnname)                 \
+   VG_CONCAT4(_vgr00000ZU_,soname,_,fnname)
+
+#define I_REPLACE_SONAME_FNNAME_ZZ(soname,fnname)                 \
+   VG_CONCAT4(_vgr00000ZZ_,soname,_,fnname)
+
+/* Derivatives of the main macros below, for calling functions
+   returning void. */
+
+#define CALL_FN_v_v(fnptr)                                        \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_v(_junk,fnptr); } while (0)
+
+#define CALL_FN_v_W(fnptr, arg1)                                  \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_W(_junk,fnptr,arg1); } while (0)
+
+#define CALL_FN_v_WW(fnptr, arg1,arg2)                            \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WW(_junk,fnptr,arg1,arg2); } while (0)
+
+#define CALL_FN_v_WWW(fnptr, arg1,arg2,arg3)                      \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WWW(_junk,fnptr,arg1,arg2,arg3); } while (0)
+
+#define CALL_FN_v_WWWW(fnptr, arg1,arg2,arg3,arg4)                \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_WWWW(_junk,fnptr,arg1,arg2,arg3,arg4); } while (0)
+
+#define CALL_FN_v_5W(fnptr, arg1,arg2,arg3,arg4,arg5)             \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_5W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5); } while (0)
+
+#define CALL_FN_v_6W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6)        \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_6W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6); } while (0)
+
+#define CALL_FN_v_7W(fnptr, arg1,arg2,arg3,arg4,arg5,arg6,arg7)   \
+   do { volatile unsigned long _junk;                             \
+        CALL_FN_W_7W(_junk,fnptr,arg1,arg2,arg3,arg4,arg5,arg6,arg7); } while (0)
+
+/* ----------------- x86-{linux,darwin,solaris} ---------------- */
+
+#if defined(PLAT_x86_linux)  ||  defined(PLAT_x86_darwin) \
+    ||  defined(PLAT_x86_solaris)
+
+/* These regs are trashed by the hidden call.  No need to mention eax
+   as gcc can already see that, plus causes gcc to bomb. */
+#define __CALLER_SAVED_REGS /*"eax"*/ "ecx", "edx"
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+#define VALGRIND_ALIGN_STACK               \
+      "movl %%esp,%%edi\n\t"               \
+      "andl $0xfffffff0,%%esp\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "movl %%edi,%%esp\n\t"
+
+/* These CALL_FN_ macros assume that on x86-linux, sizeof(unsigned
+   long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $12, %%esp\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $8, %%esp\n\t"                                     \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "subl $4, %%esp\n\t"                                     \
+         "pushl 44(%%eax)\n\t"                                    \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "pushl 48(%%eax)\n\t"                                    \
+         "pushl 44(%%eax)\n\t"                                    \
+         "pushl 40(%%eax)\n\t"                                    \
+         "pushl 36(%%eax)\n\t"                                    \
+         "pushl 32(%%eax)\n\t"                                    \
+         "pushl 28(%%eax)\n\t"                                    \
+         "pushl 24(%%eax)\n\t"                                    \
+         "pushl 20(%%eax)\n\t"                                    \
+         "pushl 16(%%eax)\n\t"                                    \
+         "pushl 12(%%eax)\n\t"                                    \
+         "pushl 8(%%eax)\n\t"                                     \
+         "pushl 4(%%eax)\n\t"                                     \
+         "movl (%%eax), %%eax\n\t"  /* target->%eax */            \
+         VALGRIND_CALL_NOREDIR_EAX                                \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=a" (_res)                                  \
+         : /*in*/    "a" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "edi"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_x86_linux || PLAT_x86_darwin || PLAT_x86_solaris */
+
+/* ---------------- amd64-{linux,darwin,solaris} --------------- */
+
+#if defined(PLAT_amd64_linux)  ||  defined(PLAT_amd64_darwin) \
+    ||  defined(PLAT_amd64_solaris)
+
+/* ARGREGS: rdi rsi rdx rcx r8 r9 (the rest on stack in R-to-L order) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS /*"rax",*/ "rcx", "rdx", "rsi",       \
+                            "rdi", "r8", "r9", "r10", "r11"
+
+/* This is all pretty complex.  It's so as to make stack unwinding
+   work reliably.  See bug 243270.  The basic problem is the sub and
+   add of 128 of %rsp in all of the following macros.  If gcc believes
+   the CFA is in %rsp, then unwinding may fail, because what's at the
+   CFA is not what gcc "expected" when it constructs the CFIs for the
+   places where the macros are instantiated.
+
+   But we can't just add a CFI annotation to increase the CFA offset
+   by 128, to match the sub of 128 from %rsp, because we don't know
+   whether gcc has chosen %rsp as the CFA at that point, or whether it
+   has chosen some other register (eg, %rbp).  In the latter case,
+   adding a CFI annotation to change the CFA offset is simply wrong.
+
+   So the solution is to get hold of the CFA using
+   __builtin_dwarf_cfa(), put it in a known register, and add a
+   CFI annotation to say what the register is.  We choose %rbp for
+   this (perhaps perversely), because:
+
+   (1) %rbp is already subject to unwinding.  If a new register was
+       chosen then the unwinder would have to unwind it in all stack
+       traces, which is expensive, and
+
+   (2) %rbp is already subject to precise exception updates in the
+       JIT.  If a new register was chosen, we'd have to have precise
+       exceptions for it too, which reduces performance of the
+       generated code.
+
+   However .. one extra complication.  We can't just whack the result
+   of __builtin_dwarf_cfa() into %rbp and then add %rbp to the
+   list of trashed registers at the end of the inline assembly
+   fragments; gcc won't allow %rbp to appear in that list.  Hence
+   instead we need to stash %rbp in %r15 for the duration of the asm,
+   and say that %r15 is trashed instead.  gcc seems happy to go with
+   that.
+
+   Oh .. and this all needs to be conditionalised so that it is
+   unchanged from before this commit, when compiled with older gccs
+   that don't support __builtin_dwarf_cfa.  Furthermore, since
+   this header file is freestanding, it has to be independent of
+   config.h, and so the following conditionalisation cannot depend on
+   configure time checks.
+
+   Although it's not clear from
+   'defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)',
+   this expression excludes Darwin.
+   .cfi directives in Darwin assembly appear to be completely
+   different and I haven't investigated how they work.
+
+   For even more entertainment value, note we have to use the
+   completely undocumented __builtin_dwarf_cfa(), which appears to
+   really compute the CFA, whereas __builtin_frame_address(0) claims
+   to but actually doesn't.  See
+   https://bugs.kde.org/show_bug.cgi?id=243270#c47
+*/
+#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
+#  define __FRAME_POINTER                                         \
+      ,"r"(__builtin_dwarf_cfa())
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      "movq %%rbp, %%r15\n\t"                                     \
+      "movq %2, %%rbp\n\t"                                        \
+      ".cfi_remember_state\n\t"                                   \
+      ".cfi_def_cfa rbp, 0\n\t"
+#  define VALGRIND_CFI_EPILOGUE                                   \
+      "movq %%r15, %%rbp\n\t"                                     \
+      ".cfi_restore_state\n\t"
+#else
+#  define __FRAME_POINTER
+#  define VALGRIND_CFI_PROLOGUE
+#  define VALGRIND_CFI_EPILOGUE
+#endif
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+#define VALGRIND_ALIGN_STACK               \
+      "movq %%rsp,%%r14\n\t"               \
+      "andq $0xfffffffffffffff0,%%rsp\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "movq %%r14,%%rsp\n\t"
+
+/* These CALL_FN_ macros assume that on amd64-linux, sizeof(unsigned
+   long) == 8. */
+
+/* NB 9 Sept 07.  There is a nasty kludge here in all these CALL_FN_
+   macros.  In order not to trash the stack redzone, we need to drop
+   %rsp by 128 before the hidden call, and restore afterwards.  The
+   nastiness is that it is only by luck that the stack still appears
+   to be unwindable during the hidden call - since then the behaviour
+   of any routine using this macro does not match what the CFI data
+   says.  Sigh.
+
+   Why is this important?  Imagine that a wrapper has a stack
+   allocated local, and passes to the hidden call, a pointer to it.
+   Because gcc does not know about the hidden call, it may allocate
+   that local in the redzone.  Unfortunately the hidden call may then
+   trash it before it comes to use it.  So we must step clear of the
+   redzone, for the duration of the hidden call, to make it safe.
+
+   Probably the same problem afflicts the other redzone-style ABIs too
+   (ppc64-linux); but for those, the stack is
+   self describing (none of this CFI nonsense) so at least messing
+   with the stack pointer doesn't give a danger of non-unwindable
+   stack. */
+
+#define CALL_FN_W_v(lval, orig)                                        \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[1];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                                  \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[2];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                            \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[3];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                      \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[4];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)                \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[5];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)             \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[6];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)        \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[7];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,        \
+                                 arg7)                                 \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[8];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $136,%%rsp\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,        \
+                                 arg7,arg8)                            \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[9];                               \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      _argvec[8] = (unsigned long)(arg8);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "pushq 64(%%rax)\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,        \
+                                 arg7,arg8,arg9)                       \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[10];                              \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      _argvec[8] = (unsigned long)(arg8);                              \
+      _argvec[9] = (unsigned long)(arg9);                              \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $136,%%rsp\n\t"                                         \
+         "pushq 72(%%rax)\n\t"                                         \
+         "pushq 64(%%rax)\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,       \
+                                  arg7,arg8,arg9,arg10)                \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[11];                              \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      _argvec[8] = (unsigned long)(arg8);                              \
+      _argvec[9] = (unsigned long)(arg9);                              \
+      _argvec[10] = (unsigned long)(arg10);                            \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "pushq 80(%%rax)\n\t"                                         \
+         "pushq 72(%%rax)\n\t"                                         \
+         "pushq 64(%%rax)\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,       \
+                                  arg7,arg8,arg9,arg10,arg11)          \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[12];                              \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      _argvec[8] = (unsigned long)(arg8);                              \
+      _argvec[9] = (unsigned long)(arg9);                              \
+      _argvec[10] = (unsigned long)(arg10);                            \
+      _argvec[11] = (unsigned long)(arg11);                            \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $136,%%rsp\n\t"                                         \
+         "pushq 88(%%rax)\n\t"                                         \
+         "pushq 80(%%rax)\n\t"                                         \
+         "pushq 72(%%rax)\n\t"                                         \
+         "pushq 64(%%rax)\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,       \
+                                arg7,arg8,arg9,arg10,arg11,arg12)      \
+   do {                                                                \
+      volatile OrigFn        _orig = (orig);                           \
+      volatile unsigned long _argvec[13];                              \
+      volatile unsigned long _res;                                     \
+      _argvec[0] = (unsigned long)_orig.nraddr;                        \
+      _argvec[1] = (unsigned long)(arg1);                              \
+      _argvec[2] = (unsigned long)(arg2);                              \
+      _argvec[3] = (unsigned long)(arg3);                              \
+      _argvec[4] = (unsigned long)(arg4);                              \
+      _argvec[5] = (unsigned long)(arg5);                              \
+      _argvec[6] = (unsigned long)(arg6);                              \
+      _argvec[7] = (unsigned long)(arg7);                              \
+      _argvec[8] = (unsigned long)(arg8);                              \
+      _argvec[9] = (unsigned long)(arg9);                              \
+      _argvec[10] = (unsigned long)(arg10);                            \
+      _argvec[11] = (unsigned long)(arg11);                            \
+      _argvec[12] = (unsigned long)(arg12);                            \
+      __asm__ volatile(                                                \
+         VALGRIND_CFI_PROLOGUE                                         \
+         VALGRIND_ALIGN_STACK                                          \
+         "subq $128,%%rsp\n\t"                                         \
+         "pushq 96(%%rax)\n\t"                                         \
+         "pushq 88(%%rax)\n\t"                                         \
+         "pushq 80(%%rax)\n\t"                                         \
+         "pushq 72(%%rax)\n\t"                                         \
+         "pushq 64(%%rax)\n\t"                                         \
+         "pushq 56(%%rax)\n\t"                                         \
+         "movq 48(%%rax), %%r9\n\t"                                    \
+         "movq 40(%%rax), %%r8\n\t"                                    \
+         "movq 32(%%rax), %%rcx\n\t"                                   \
+         "movq 24(%%rax), %%rdx\n\t"                                   \
+         "movq 16(%%rax), %%rsi\n\t"                                   \
+         "movq 8(%%rax), %%rdi\n\t"                                    \
+         "movq (%%rax), %%rax\n\t"  /* target->%rax */                 \
+         VALGRIND_CALL_NOREDIR_RAX                                     \
+         VALGRIND_RESTORE_STACK                                        \
+         VALGRIND_CFI_EPILOGUE                                         \
+         : /*out*/   "=a" (_res)                                       \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER                 \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r14", "r15" \
+      );                                                               \
+      lval = (__typeof__(lval)) _res;                                  \
+   } while (0)
+
+#endif /* PLAT_amd64_linux || PLAT_amd64_darwin || PLAT_amd64_solaris */
+
+/* ------------------------ ppc32-linux ------------------------ */
+
+#if defined(PLAT_ppc32_linux)
+
+/* This is useful for finding out about the on-stack stuff:
+
+   extern int f9  ( int,int,int,int,int,int,int,int,int );
+   extern int f10 ( int,int,int,int,int,int,int,int,int,int );
+   extern int f11 ( int,int,int,int,int,int,int,int,int,int,int );
+   extern int f12 ( int,int,int,int,int,int,int,int,int,int,int,int );
+
+   int g9 ( void ) {
+      return f9(11,22,33,44,55,66,77,88,99);
+   }
+   int g10 ( void ) {
+      return f10(11,22,33,44,55,66,77,88,99,110);
+   }
+   int g11 ( void ) {
+      return f11(11,22,33,44,55,66,77,88,99,110,121);
+   }
+   int g12 ( void ) {
+      return f12(11,22,33,44,55,66,77,88,99,110,121,132);
+   }
+*/
+
+/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS                                       \
+   "lr", "ctr", "xer",                                            \
+   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
+   "r11", "r12", "r13"
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+#define VALGRIND_ALIGN_STACK               \
+      "mr 28,1\n\t"                        \
+      "rlwinm 1,1,0,0,27\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "mr 1,28\n\t"
+
+/* These CALL_FN_ macros assume that on ppc32-linux, 
+   sizeof(unsigned long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-16\n\t"                                       \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-16\n\t"                                       \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      _argvec[11] = (unsigned long)arg11;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-32\n\t"                                       \
+         /* arg11 */                                              \
+         "lwz 3,44(11)\n\t"                                       \
+         "stw 3,16(1)\n\t"                                        \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)arg1;                           \
+      _argvec[2] = (unsigned long)arg2;                           \
+      _argvec[3] = (unsigned long)arg3;                           \
+      _argvec[4] = (unsigned long)arg4;                           \
+      _argvec[5] = (unsigned long)arg5;                           \
+      _argvec[6] = (unsigned long)arg6;                           \
+      _argvec[7] = (unsigned long)arg7;                           \
+      _argvec[8] = (unsigned long)arg8;                           \
+      _argvec[9] = (unsigned long)arg9;                           \
+      _argvec[10] = (unsigned long)arg10;                         \
+      _argvec[11] = (unsigned long)arg11;                         \
+      _argvec[12] = (unsigned long)arg12;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "addi 1,1,-32\n\t"                                       \
+         /* arg12 */                                              \
+         "lwz 3,48(11)\n\t"                                       \
+         "stw 3,20(1)\n\t"                                        \
+         /* arg11 */                                              \
+         "lwz 3,44(11)\n\t"                                       \
+         "stw 3,16(1)\n\t"                                        \
+         /* arg10 */                                              \
+         "lwz 3,40(11)\n\t"                                       \
+         "stw 3,12(1)\n\t"                                        \
+         /* arg9 */                                               \
+         "lwz 3,36(11)\n\t"                                       \
+         "stw 3,8(1)\n\t"                                         \
+         /* args1-8 */                                            \
+         "lwz 3,4(11)\n\t"   /* arg1->r3 */                       \
+         "lwz 4,8(11)\n\t"                                        \
+         "lwz 5,12(11)\n\t"                                       \
+         "lwz 6,16(11)\n\t"  /* arg4->r6 */                       \
+         "lwz 7,20(11)\n\t"                                       \
+         "lwz 8,24(11)\n\t"                                       \
+         "lwz 9,28(11)\n\t"                                       \
+         "lwz 10,32(11)\n\t" /* arg8->r10 */                      \
+         "lwz 11,0(11)\n\t"  /* target->r11 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         VALGRIND_RESTORE_STACK                                   \
+         "mr %0,3"                                                \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_ppc32_linux */
+
+/* ------------------------ ppc64-linux ------------------------ */
+
+#if defined(PLAT_ppc64be_linux)
+
+/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS                                       \
+   "lr", "ctr", "xer",                                            \
+   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+   "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",         \
+   "r11", "r12", "r13"
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+#define VALGRIND_ALIGN_STACK               \
+      "mr 28,1\n\t"                        \
+      "rldicr 1,1,0,59\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "mr 1,28\n\t"
+
+/* These CALL_FN_ macros assume that on ppc64-linux, sizeof(unsigned
+   long) == 8. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+0];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1] = (unsigned long)_orig.r2;                       \
+      _argvec[2] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+1];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+2];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+3];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+4];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+5];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+6];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+7];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+8];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+9];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+10];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+11];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg11 */                                              \
+         "ld  3,88(11)\n\t"                                       \
+         "std 3,128(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+12];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      _argvec[2+12] = (unsigned long)arg12;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 11,%1\n\t"                                           \
+         "std 2,-16(11)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg12 */                                              \
+         "ld  3,96(11)\n\t"                                       \
+         "std 3,136(1)\n\t"                                       \
+         /* arg11 */                                              \
+         "ld  3,88(11)\n\t"                                       \
+         "std 3,128(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(11)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(11)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* args1-8 */                                            \
+         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
+         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
+         "mr 11,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_ppc64be_linux */
+
+/* ------------------------- ppc64le-linux ----------------------- */
+#if defined(PLAT_ppc64le_linux)
+
+/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS                                       \
+   "lr", "ctr", "xer",                                            \
+   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
+   "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",         \
+   "r11", "r12", "r13"
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+#define VALGRIND_ALIGN_STACK               \
+      "mr 28,1\n\t"                        \
+      "rldicr 1,1,0,59\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "mr 1,28\n\t"
+
+/* These CALL_FN_ macros assume that on ppc64-linux, sizeof(unsigned
+   long) == 8. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+0];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1] = (unsigned long)_orig.r2;                       \
+      _argvec[2] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+1];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+2];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+3];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+4];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+5];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+6];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+7];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+8];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(12)\n\t" /* arg8->r10 */                     \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+9];                        \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg9 */                                               \
+         "ld  3,72(12)\n\t"                                       \
+         "std 3,96(1)\n\t"                                        \
+         /* args1-8 */                                            \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(12)\n\t" /* arg8->r10 */                     \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+10];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-128\n\t"  /* expand stack frame */            \
+         /* arg10 */                                              \
+         "ld  3,80(12)\n\t"                                       \
+         "std 3,104(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(12)\n\t"                                       \
+         "std 3,96(1)\n\t"                                        \
+         /* args1-8 */                                            \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(12)\n\t" /* arg8->r10 */                     \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+11];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg11 */                                              \
+         "ld  3,88(12)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(12)\n\t"                                       \
+         "std 3,104(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(12)\n\t"                                       \
+         "std 3,96(1)\n\t"                                        \
+         /* args1-8 */                                            \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(12)\n\t" /* arg8->r10 */                     \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                arg7,arg8,arg9,arg10,arg11,arg12) \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3+12];                       \
+      volatile unsigned long _res;                                \
+      /* _argvec[0] holds current r2 across the call */           \
+      _argvec[1]   = (unsigned long)_orig.r2;                     \
+      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
+      _argvec[2+1] = (unsigned long)arg1;                         \
+      _argvec[2+2] = (unsigned long)arg2;                         \
+      _argvec[2+3] = (unsigned long)arg3;                         \
+      _argvec[2+4] = (unsigned long)arg4;                         \
+      _argvec[2+5] = (unsigned long)arg5;                         \
+      _argvec[2+6] = (unsigned long)arg6;                         \
+      _argvec[2+7] = (unsigned long)arg7;                         \
+      _argvec[2+8] = (unsigned long)arg8;                         \
+      _argvec[2+9] = (unsigned long)arg9;                         \
+      _argvec[2+10] = (unsigned long)arg10;                       \
+      _argvec[2+11] = (unsigned long)arg11;                       \
+      _argvec[2+12] = (unsigned long)arg12;                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "mr 12,%1\n\t"                                           \
+         "std 2,-16(12)\n\t"  /* save tocptr */                   \
+         "ld   2,-8(12)\n\t"  /* use nraddr's tocptr */           \
+         "addi 1,1,-144\n\t"  /* expand stack frame */            \
+         /* arg12 */                                              \
+         "ld  3,96(12)\n\t"                                       \
+         "std 3,120(1)\n\t"                                       \
+         /* arg11 */                                              \
+         "ld  3,88(12)\n\t"                                       \
+         "std 3,112(1)\n\t"                                       \
+         /* arg10 */                                              \
+         "ld  3,80(12)\n\t"                                       \
+         "std 3,104(1)\n\t"                                       \
+         /* arg9 */                                               \
+         "ld  3,72(12)\n\t"                                       \
+         "std 3,96(1)\n\t"                                        \
+         /* args1-8 */                                            \
+         "ld   3, 8(12)\n\t"  /* arg1->r3 */                      \
+         "ld   4, 16(12)\n\t" /* arg2->r4 */                      \
+         "ld   5, 24(12)\n\t" /* arg3->r5 */                      \
+         "ld   6, 32(12)\n\t" /* arg4->r6 */                      \
+         "ld   7, 40(12)\n\t" /* arg5->r7 */                      \
+         "ld   8, 48(12)\n\t" /* arg6->r8 */                      \
+         "ld   9, 56(12)\n\t" /* arg7->r9 */                      \
+         "ld  10, 64(12)\n\t" /* arg8->r10 */                     \
+         "ld  12, 0(12)\n\t"  /* target->r12 */                   \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R12                  \
+         "mr 12,%1\n\t"                                           \
+         "mr %0,3\n\t"                                            \
+         "ld 2,-16(12)\n\t" /* restore tocptr */                  \
+         VALGRIND_RESTORE_STACK                                   \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[2])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r28"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_ppc64le_linux */
+
+/* ------------------------- arm-linux ------------------------- */
+
+#if defined(PLAT_arm_linux)
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS "r0", "r1", "r2", "r3","r4", "r12", "r14"
+
+/* Macros to save and align the stack before making a function
+   call and restore it afterwards as gcc may not keep the stack
+   pointer aligned if it doesn't realise calls are being made
+   to other functions. */
+
+/* This is a bit tricky.  We store the original stack pointer in r10
+   as it is callee-saves.  gcc doesn't allow the use of r11 for some
+   reason.  Also, we can't directly "bic" the stack pointer in thumb
+   mode since r13 isn't an allowed register number in that context.
+   So use r4 as a temporary, since that is about to get trashed
+   anyway, just after each use of this macro.  Side effect is we need
+   to be very careful about any future changes, since
+   VALGRIND_ALIGN_STACK simply assumes r4 is usable. */
+#define VALGRIND_ALIGN_STACK               \
+      "mov r10, sp\n\t"                    \
+      "mov r4,  sp\n\t"                    \
+      "bic r4,  r4, #7\n\t"                \
+      "mov sp,  r4\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "mov sp,  r10\n\t"
+
+/* These CALL_FN_ macros assume that on arm-linux, sizeof(unsigned
+   long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #4 \n\t"                                    \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "push {r0} \n\t"                                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "push {r0, r1} \n\t"                                     \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #4 \n\t"                                    \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "push {r0, r1, r2} \n\t"                                 \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "push {r0, r1, r2, r3} \n\t"                             \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #4 \n\t"                                    \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "push {r0} \n\t"                                         \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #4 \n\t"                                    \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "ldr r1, [%1, #44] \n\t"                                 \
+         "push {r0, r1} \n\t"                                     \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr r0, [%1, #40] \n\t"                                 \
+         "ldr r1, [%1, #44] \n\t"                                 \
+         "ldr r2, [%1, #48] \n\t"                                 \
+         "push {r0, r1, r2} \n\t"                                 \
+         "ldr r0, [%1, #20] \n\t"                                 \
+         "ldr r1, [%1, #24] \n\t"                                 \
+         "ldr r2, [%1, #28] \n\t"                                 \
+         "ldr r3, [%1, #32] \n\t"                                 \
+         "ldr r4, [%1, #36] \n\t"                                 \
+         "push {r0, r1, r2, r3, r4} \n\t"                         \
+         "ldr r0, [%1, #4] \n\t"                                  \
+         "ldr r1, [%1, #8] \n\t"                                  \
+         "ldr r2, [%1, #12] \n\t"                                 \
+         "ldr r3, [%1, #16] \n\t"                                 \
+         "ldr r4, [%1] \n\t"  /* target->r4 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R4                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, r0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "r10"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_arm_linux */
+
+/* ------------------------ arm64-linux ------------------------ */
+
+#if defined(PLAT_arm64_linux)
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS \
+     "x0", "x1", "x2", "x3","x4", "x5", "x6", "x7", "x8", "x9",   \
+     "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17",      \
+     "x18", "x19", "x20", "x30",                                  \
+     "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9",  \
+     "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17",      \
+     "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25",      \
+     "v26", "v27", "v28", "v29", "v30", "v31"
+
+/* x21 is callee-saved, so we can use it to save and restore SP around
+   the hidden call. */
+#define VALGRIND_ALIGN_STACK               \
+      "mov x21, sp\n\t"                    \
+      "bic sp, x21, #15\n\t"
+#define VALGRIND_RESTORE_STACK             \
+      "mov sp,  x21\n\t"
+
+/* These CALL_FN_ macros assume that on arm64-linux,
+   sizeof(unsigned long) == 8. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[2];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0\n"                                           \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x7, [%1, #64] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #0x20 \n\t"                                 \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x7, [%1, #64] \n\t"                                 \
+         "ldr x8, [%1, #72] \n\t"                                 \
+         "str x8, [sp, #0]  \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #0x20 \n\t"                                 \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x7, [%1, #64] \n\t"                                 \
+         "ldr x8, [%1, #72] \n\t"                                 \
+         "str x8, [sp, #0]  \n\t"                                 \
+         "ldr x8, [%1, #80] \n\t"                                 \
+         "str x8, [sp, #8]  \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11)     \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #0x30 \n\t"                                 \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x7, [%1, #64] \n\t"                                 \
+         "ldr x8, [%1, #72] \n\t"                                 \
+         "str x8, [sp, #0]  \n\t"                                 \
+         "ldr x8, [%1, #80] \n\t"                                 \
+         "str x8, [sp, #8]  \n\t"                                 \
+         "ldr x8, [%1, #88] \n\t"                                 \
+         "str x8, [sp, #16] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10,arg11,     \
+                                  arg12)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         VALGRIND_ALIGN_STACK                                     \
+         "sub sp, sp, #0x30 \n\t"                                 \
+         "ldr x0, [%1, #8] \n\t"                                  \
+         "ldr x1, [%1, #16] \n\t"                                 \
+         "ldr x2, [%1, #24] \n\t"                                 \
+         "ldr x3, [%1, #32] \n\t"                                 \
+         "ldr x4, [%1, #40] \n\t"                                 \
+         "ldr x5, [%1, #48] \n\t"                                 \
+         "ldr x6, [%1, #56] \n\t"                                 \
+         "ldr x7, [%1, #64] \n\t"                                 \
+         "ldr x8, [%1, #72] \n\t"                                 \
+         "str x8, [sp, #0]  \n\t"                                 \
+         "ldr x8, [%1, #80] \n\t"                                 \
+         "str x8, [sp, #8]  \n\t"                                 \
+         "ldr x8, [%1, #88] \n\t"                                 \
+         "str x8, [sp, #16] \n\t"                                 \
+         "ldr x8, [%1, #96] \n\t"                                 \
+         "str x8, [sp, #24] \n\t"                                 \
+         "ldr x8, [%1] \n\t"  /* target->x8 */                    \
+         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_X8                   \
+         VALGRIND_RESTORE_STACK                                   \
+         "mov %0, x0"                                             \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS, "x21"   \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_arm64_linux */
+
+/* ------------------------- s390x-linux ------------------------- */
+
+#if defined(PLAT_s390x_linux)
+
+/* Similar workaround as amd64 (see above), but we use r11 as frame
+   pointer and save the old r11 in r7. r11 might be used for
+   argvec, therefore we copy argvec in r1 since r1 is clobbered
+   after the call anyway.  */
+#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
+#  define __FRAME_POINTER                                         \
+      ,"d"(__builtin_dwarf_cfa())
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      ".cfi_remember_state\n\t"                                   \
+      "lgr 1,%1\n\t" /* copy the argvec pointer in r1 */          \
+      "lgr 7,11\n\t"                                              \
+      "lgr 11,%2\n\t"                                             \
+      ".cfi_def_cfa r11, 0\n\t"
+#  define VALGRIND_CFI_EPILOGUE                                   \
+      "lgr 11, 7\n\t"                                             \
+      ".cfi_restore_state\n\t"
+#else
+#  define __FRAME_POINTER
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      "lgr 1,%1\n\t"
+#  define VALGRIND_CFI_EPILOGUE
+#endif
+
+/* Nb: On s390 the stack pointer is properly aligned *at all times*
+   according to the s390 GCC maintainer. (The ABI specification is not
+   precise in this regard.) Therefore, VALGRIND_ALIGN_STACK and
+   VALGRIND_RESTORE_STACK are not defined here. */
+
+/* These regs are trashed by the hidden call. Note that we overwrite
+   r14 in s390_irgen_noredir (VEX/priv/guest_s390_irgen.c) to give the
+   function a proper return address. All others are ABI defined call
+   clobbers. */
+#define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \
+                           "f0","f1","f2","f3","f4","f5","f6","f7"
+
+/* Nb: Although r11 is modified in the asm snippets below (inside 
+   VALGRIND_CFI_PROLOGUE) it is not listed in the clobber section, for
+   two reasons:
+   (1) r11 is restored in VALGRIND_CFI_EPILOGUE, so effectively it is not
+       modified
+   (2) GCC will complain that r11 cannot appear inside a clobber section,
+       when compiled with -O -fno-omit-frame-pointer
+ */
+
+#define CALL_FN_W_v(lval, orig)                                  \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long  _argvec[1];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 1, 0(1)\n\t"  /* target->r1 */                      \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "d" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+/* The call abi has the arguments in r2-r6 and stack */
+#define CALL_FN_W_W(lval, orig, arg1)                            \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[2];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1, arg2)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[3];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1, arg2, arg3)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[4];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1, arg2, arg3, arg4)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[5];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1, arg2, arg3, arg4, arg5)   \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[6];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6)                                       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[7];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-168\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,168\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7)                                 \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[8];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-176\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,176\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8)                           \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[9];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-184\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,184\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8, arg9)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[10];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-192\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,192\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[11];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-200\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,200\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[12];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-208\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,208\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11, arg12)\
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[13];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      _argvec[12] = (unsigned long)arg12;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-216\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "mvc 208(8,15), 96(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,216\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
+   } while (0)
+
+
+#endif /* PLAT_s390x_linux */
+
+/* ------------------------- mips32-linux ----------------------- */
+#if defined(PLAT_mips32_linux)
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS "$2", "$3", "$4", "$5", "$6",       \
+"$7", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
+"$25", "$31"
+
+/* These CALL_FN_ macros assume that on mips-linux, sizeof(unsigned
+   long) == 4. */
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[1];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "subu $29, $29, 16 \n\t"                                 \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 16\n\t"                                  \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+     volatile unsigned long _argvec[2];                           \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "subu $29, $29, 16 \n\t"                                 \
+         "lw $4, 4(%1) \n\t"   /* arg1*/                          \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 16 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory",  __CALLER_SAVED_REGS               \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[3];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "subu $29, $29, 16 \n\t"                                 \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 16 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[4];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "subu $29, $29, 16 \n\t"                                 \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 16 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[5];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "subu $29, $29, 16 \n\t"                                 \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 16 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[6];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 24\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 24 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[7];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 32\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "nop\n\t"                                                \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 32 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[8];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 32\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 32 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[9];                          \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 40\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 32(%1) \n\t"                                     \
+         "sw $4, 28($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 40 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[10];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 40\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 32(%1) \n\t"                                     \
+         "sw $4, 28($29) \n\t"                                    \
+         "lw $4, 36(%1) \n\t"                                     \
+         "sw $4, 32($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 40 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[11];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 48\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 32(%1) \n\t"                                     \
+         "sw $4, 28($29) \n\t"                                    \
+         "lw $4, 36(%1) \n\t"                                     \
+         "sw $4, 32($29) \n\t"                                    \
+         "lw $4, 40(%1) \n\t"                                     \
+         "sw $4, 36($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 48 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[12];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 48\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 32(%1) \n\t"                                     \
+         "sw $4, 28($29) \n\t"                                    \
+         "lw $4, 36(%1) \n\t"                                     \
+         "sw $4, 32($29) \n\t"                                    \
+         "lw $4, 40(%1) \n\t"                                     \
+         "sw $4, 36($29) \n\t"                                    \
+         "lw $4, 44(%1) \n\t"                                     \
+         "sw $4, 40($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 48 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long _argvec[13];                         \
+      volatile unsigned long _res;                                \
+      _argvec[0] = (unsigned long)_orig.nraddr;                   \
+      _argvec[1] = (unsigned long)(arg1);                         \
+      _argvec[2] = (unsigned long)(arg2);                         \
+      _argvec[3] = (unsigned long)(arg3);                         \
+      _argvec[4] = (unsigned long)(arg4);                         \
+      _argvec[5] = (unsigned long)(arg5);                         \
+      _argvec[6] = (unsigned long)(arg6);                         \
+      _argvec[7] = (unsigned long)(arg7);                         \
+      _argvec[8] = (unsigned long)(arg8);                         \
+      _argvec[9] = (unsigned long)(arg9);                         \
+      _argvec[10] = (unsigned long)(arg10);                       \
+      _argvec[11] = (unsigned long)(arg11);                       \
+      _argvec[12] = (unsigned long)(arg12);                       \
+      __asm__ volatile(                                           \
+         "subu $29, $29, 8 \n\t"                                  \
+         "sw $28, 0($29) \n\t"                                    \
+         "sw $31, 4($29) \n\t"                                    \
+         "lw $4, 20(%1) \n\t"                                     \
+         "subu $29, $29, 56\n\t"                                  \
+         "sw $4, 16($29) \n\t"                                    \
+         "lw $4, 24(%1) \n\t"                                     \
+         "sw $4, 20($29) \n\t"                                    \
+         "lw $4, 28(%1) \n\t"                                     \
+         "sw $4, 24($29) \n\t"                                    \
+         "lw $4, 32(%1) \n\t"                                     \
+         "sw $4, 28($29) \n\t"                                    \
+         "lw $4, 36(%1) \n\t"                                     \
+         "sw $4, 32($29) \n\t"                                    \
+         "lw $4, 40(%1) \n\t"                                     \
+         "sw $4, 36($29) \n\t"                                    \
+         "lw $4, 44(%1) \n\t"                                     \
+         "sw $4, 40($29) \n\t"                                    \
+         "lw $4, 48(%1) \n\t"                                     \
+         "sw $4, 44($29) \n\t"                                    \
+         "lw $4, 4(%1) \n\t"                                      \
+         "lw $5, 8(%1) \n\t"                                      \
+         "lw $6, 12(%1) \n\t"                                     \
+         "lw $7, 16(%1) \n\t"                                     \
+         "lw $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "addu $29, $29, 56 \n\t"                                 \
+         "lw $28, 0($29) \n\t"                                    \
+         "lw $31, 4($29) \n\t"                                    \
+         "addu $29, $29, 8 \n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) _res;                             \
+   } while (0)
+
+#endif /* PLAT_mips32_linux */
+
+/* ------------------------- mips64-linux ------------------------- */
+
+#if defined(PLAT_mips64_linux)
+
+/* These regs are trashed by the hidden call. */
+#define __CALLER_SAVED_REGS "$2", "$3", "$4", "$5", "$6",       \
+"$7", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
+"$25", "$31"
+
+/* These CALL_FN_ macros assume that on mips64-linux,
+   sizeof(long long) == 8. */
+
+#define MIPS64_LONG2REG_CAST(x) ((long long)(long)x)
+
+#define CALL_FN_W_v(lval, orig)                                   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[1];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      __asm__ volatile(                                           \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "0" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_W(lval, orig, arg1)                             \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[2];                     \
+      volatile unsigned long long  _res;                          \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"   /* arg1*/                           \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[3];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = _orig.nraddr;                                  \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+
+#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[4];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = _orig.nraddr;                                  \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[5];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[6];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[7];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7)                            \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[8];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8)                       \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[9];                     \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      _argvec[8] = MIPS64_LONG2REG_CAST(arg8);                    \
+      __asm__ volatile(                                           \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $11, 64(%1)\n\t"                                     \
+         "ld $25, 0(%1) \n\t"  /* target->t9 */                   \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
+                                 arg7,arg8,arg9)                  \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[10];                    \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      _argvec[8] = MIPS64_LONG2REG_CAST(arg8);                    \
+      _argvec[9] = MIPS64_LONG2REG_CAST(arg9);                    \
+      __asm__ volatile(                                           \
+         "dsubu $29, $29, 8\n\t"                                  \
+         "ld $4, 72(%1)\n\t"                                      \
+         "sd $4, 0($29)\n\t"                                      \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $11, 64(%1)\n\t"                                     \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "daddu $29, $29, 8\n\t"                                  \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
+                                  arg7,arg8,arg9,arg10)           \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[11];                    \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      _argvec[8] = MIPS64_LONG2REG_CAST(arg8);                    \
+      _argvec[9] = MIPS64_LONG2REG_CAST(arg9);                    \
+      _argvec[10] = MIPS64_LONG2REG_CAST(arg10);                  \
+      __asm__ volatile(                                           \
+         "dsubu $29, $29, 16\n\t"                                 \
+         "ld $4, 72(%1)\n\t"                                      \
+         "sd $4, 0($29)\n\t"                                      \
+         "ld $4, 80(%1)\n\t"                                      \
+         "sd $4, 8($29)\n\t"                                      \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $11, 64(%1)\n\t"                                     \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "daddu $29, $29, 16\n\t"                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11)                          \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[12];                    \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      _argvec[8] = MIPS64_LONG2REG_CAST(arg8);                    \
+      _argvec[9] = MIPS64_LONG2REG_CAST(arg9);                    \
+      _argvec[10] = MIPS64_LONG2REG_CAST(arg10);                  \
+      _argvec[11] = MIPS64_LONG2REG_CAST(arg11);                  \
+      __asm__ volatile(                                           \
+         "dsubu $29, $29, 24\n\t"                                 \
+         "ld $4, 72(%1)\n\t"                                      \
+         "sd $4, 0($29)\n\t"                                      \
+         "ld $4, 80(%1)\n\t"                                      \
+         "sd $4, 8($29)\n\t"                                      \
+         "ld $4, 88(%1)\n\t"                                      \
+         "sd $4, 16($29)\n\t"                                     \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $11, 64(%1)\n\t"                                     \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "daddu $29, $29, 24\n\t"                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,       \
+                                  arg6,arg7,arg8,arg9,arg10,      \
+                                  arg11,arg12)                    \
+   do {                                                           \
+      volatile OrigFn        _orig = (orig);                      \
+      volatile unsigned long long _argvec[13];                    \
+      volatile unsigned long long _res;                           \
+      _argvec[0] = MIPS64_LONG2REG_CAST(_orig.nraddr);            \
+      _argvec[1] = MIPS64_LONG2REG_CAST(arg1);                    \
+      _argvec[2] = MIPS64_LONG2REG_CAST(arg2);                    \
+      _argvec[3] = MIPS64_LONG2REG_CAST(arg3);                    \
+      _argvec[4] = MIPS64_LONG2REG_CAST(arg4);                    \
+      _argvec[5] = MIPS64_LONG2REG_CAST(arg5);                    \
+      _argvec[6] = MIPS64_LONG2REG_CAST(arg6);                    \
+      _argvec[7] = MIPS64_LONG2REG_CAST(arg7);                    \
+      _argvec[8] = MIPS64_LONG2REG_CAST(arg8);                    \
+      _argvec[9] = MIPS64_LONG2REG_CAST(arg9);                    \
+      _argvec[10] = MIPS64_LONG2REG_CAST(arg10);                  \
+      _argvec[11] = MIPS64_LONG2REG_CAST(arg11);                  \
+      _argvec[12] = MIPS64_LONG2REG_CAST(arg12);                  \
+      __asm__ volatile(                                           \
+         "dsubu $29, $29, 32\n\t"                                 \
+         "ld $4, 72(%1)\n\t"                                      \
+         "sd $4, 0($29)\n\t"                                      \
+         "ld $4, 80(%1)\n\t"                                      \
+         "sd $4, 8($29)\n\t"                                      \
+         "ld $4, 88(%1)\n\t"                                      \
+         "sd $4, 16($29)\n\t"                                     \
+         "ld $4, 96(%1)\n\t"                                      \
+         "sd $4, 24($29)\n\t"                                     \
+         "ld $4, 8(%1)\n\t"                                       \
+         "ld $5, 16(%1)\n\t"                                      \
+         "ld $6, 24(%1)\n\t"                                      \
+         "ld $7, 32(%1)\n\t"                                      \
+         "ld $8, 40(%1)\n\t"                                      \
+         "ld $9, 48(%1)\n\t"                                      \
+         "ld $10, 56(%1)\n\t"                                     \
+         "ld $11, 64(%1)\n\t"                                     \
+         "ld $25, 0(%1)\n\t"  /* target->t9 */                    \
+         VALGRIND_CALL_NOREDIR_T9                                 \
+         "daddu $29, $29, 32\n\t"                                 \
+         "move %0, $2\n"                                          \
+         : /*out*/   "=r" (_res)                                  \
+         : /*in*/    "r" (&_argvec[0])                            \
+         : /*trash*/ "memory", __CALLER_SAVED_REGS                \
+      );                                                          \
+      lval = (__typeof__(lval)) (long)_res;                       \
+   } while (0)
+
+#endif /* PLAT_mips64_linux */
+
+/* ------------------------------------------------------------------ */
+/* ARCHITECTURE INDEPENDENT MACROS for CLIENT REQUESTS.               */
+/*                                                                    */
+/* ------------------------------------------------------------------ */
+
+/* Some request codes.  There are many more of these, but most are not
+   exposed to end-user view.  These are the public ones, all of the
+   form 0x1000 + small_number.
+
+   Core ones are in the range 0x00000000--0x0000ffff.  The non-public
+   ones start at 0x2000.
+*/
+
+/* These macros are used by tools -- they must be public, but don't
+   embed them into other programs. */
+#define VG_USERREQ_TOOL_BASE(a,b) \
+   ((unsigned int)(((a)&0xff) << 24 | ((b)&0xff) << 16))
+#define VG_IS_TOOL_USERREQ(a, b, v) \
+   (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000))
+
+/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! 
+   This enum comprises an ABI exported by Valgrind to programs
+   which use client requests.  DO NOT CHANGE THE NUMERIC VALUES OF THESE
+   ENTRIES, NOR DELETE ANY -- add new ones at the end of the most
+   relevant group. */
+typedef
+   enum { VG_USERREQ__RUNNING_ON_VALGRIND  = 0x1001,
+          VG_USERREQ__DISCARD_TRANSLATIONS = 0x1002,
+
+          /* These allow any function to be called from the simulated
+             CPU but run on the real CPU.  Nb: the first arg passed to
+             the function is always the ThreadId of the running
+             thread!  So CLIENT_CALL0 actually requires a 1 arg
+             function, etc. */
+          VG_USERREQ__CLIENT_CALL0 = 0x1101,
+          VG_USERREQ__CLIENT_CALL1 = 0x1102,
+          VG_USERREQ__CLIENT_CALL2 = 0x1103,
+          VG_USERREQ__CLIENT_CALL3 = 0x1104,
+
+          /* Can be useful in regression testing suites -- eg. can
+             send Valgrind's output to /dev/null and still count
+             errors. */
+          VG_USERREQ__COUNT_ERRORS = 0x1201,
+
+          /* Allows the client program and/or gdbserver to execute a monitor
+             command. */
+          VG_USERREQ__GDB_MONITOR_COMMAND = 0x1202,
+
+          /* These are useful and can be interpreted by any tool that
+             tracks malloc() et al, by using vg_replace_malloc.c. */
+          VG_USERREQ__MALLOCLIKE_BLOCK = 0x1301,
+          VG_USERREQ__RESIZEINPLACE_BLOCK = 0x130b,
+          VG_USERREQ__FREELIKE_BLOCK   = 0x1302,
+          /* Memory pool support. */
+          VG_USERREQ__CREATE_MEMPOOL   = 0x1303,
+          VG_USERREQ__DESTROY_MEMPOOL  = 0x1304,
+          VG_USERREQ__MEMPOOL_ALLOC    = 0x1305,
+          VG_USERREQ__MEMPOOL_FREE     = 0x1306,
+          VG_USERREQ__MEMPOOL_TRIM     = 0x1307,
+          VG_USERREQ__MOVE_MEMPOOL     = 0x1308,
+          VG_USERREQ__MEMPOOL_CHANGE   = 0x1309,
+          VG_USERREQ__MEMPOOL_EXISTS   = 0x130a,
+
+          /* Allow printfs to valgrind log. */
+          /* The first two pass the va_list argument by value, which
+             assumes it is the same size as or smaller than a UWord,
+             which generally isn't the case.  Hence are deprecated.
+             The second two pass the vargs by reference and so are
+             immune to this problem. */
+          /* both :: char* fmt, va_list vargs (DEPRECATED) */
+          VG_USERREQ__PRINTF           = 0x1401,
+          VG_USERREQ__PRINTF_BACKTRACE = 0x1402,
+          /* both :: char* fmt, va_list* vargs */
+          VG_USERREQ__PRINTF_VALIST_BY_REF = 0x1403,
+          VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF = 0x1404,
+
+          /* Stack support. */
+          VG_USERREQ__STACK_REGISTER   = 0x1501,
+          VG_USERREQ__STACK_DEREGISTER = 0x1502,
+          VG_USERREQ__STACK_CHANGE     = 0x1503,
+
+          /* Wine support */
+          VG_USERREQ__LOAD_PDB_DEBUGINFO = 0x1601,
+
+          /* Querying of debug info. */
+          VG_USERREQ__MAP_IP_TO_SRCLOC = 0x1701,
+
+          /* Disable/enable error reporting level.  Takes a single
+             Word arg which is the delta to this thread's error
+             disablement indicator.  Hence 1 disables or further
+             disables errors, and -1 moves back towards enablement.
+             Other values are not allowed. */
+          VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801,
+
+          /* Some requests used for Valgrind internal, such as
+             self-test or self-hosting. */
+          /* Initialise IR injection */
+          VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901,
+          /* Used by Inner Valgrind to inform Outer Valgrind where to
+             find the list of inner guest threads */
+          VG_USERREQ__INNER_THREADS    = 0x1902
+   } Vg_ClientRequest;
+
+#if !defined(__GNUC__)
+#  define __extension__ /* */
+#endif
+
+
+/* Returns the number of Valgrinds this code is running under.  That
+   is, 0 if running natively, 1 if running under Valgrind, 2 if
+   running under Valgrind which is running under another Valgrind,
+   etc. */
+#define RUNNING_ON_VALGRIND                                           \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */,         \
+                                    VG_USERREQ__RUNNING_ON_VALGRIND,  \
+                                    0, 0, 0, 0, 0)                    \
+
+
+/* Discard translation of code in the range [_qzz_addr .. _qzz_addr +
+   _qzz_len - 1].  Useful if you are debugging a JITter or some such,
+   since it provides a way to make sure valgrind will retranslate the
+   invalidated area.  Returns no value. */
+#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len)              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS,  \
+                                    _qzz_addr, _qzz_len, 0, 0, 0)
+
+#define VALGRIND_INNER_THREADS(_qzz_addr)                               \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__INNER_THREADS,           \
+                                   _qzz_addr, 0, 0, 0, 0)
+
+
+/* These requests are for getting Valgrind itself to print something.
+   Possibly with a backtrace.  This is a really ugly hack.  The return value
+   is the number of characters printed, excluding the "**<pid>** " part at the
+   start and the backtrace (if present). */
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER) && !defined(_MSC_VER)
+/* Modern GCC will optimize the static routine out if unused,
+   and unused attribute will shut down warnings about it.  */
+static int VALGRIND_PRINTF(const char *format, ...)
+   __attribute__((format(__printf__, 1, 2), __unused__));
+#endif
+static int
+#if defined(_MSC_VER)
+__inline
+#endif
+VALGRIND_PRINTF(const char *format, ...)
+{
+#if defined(NVALGRIND)
+   (void)format;
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER) || defined(__MINGW64__)
+   uintptr_t _qzz_res;
+#else
+   unsigned long _qzz_res;
+#endif
+   va_list vargs;
+   va_start(vargs, format);
+#if defined(_MSC_VER) || defined(__MINGW64__)
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_VALIST_BY_REF,
+                              (uintptr_t)format,
+                              (uintptr_t)&vargs,
+                              0, 0, 0);
+#else
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_VALIST_BY_REF,
+                              (unsigned long)format,
+                              (unsigned long)&vargs, 
+                              0, 0, 0);
+#endif
+   va_end(vargs);
+   return (int)_qzz_res;
+#endif /* NVALGRIND */
+}
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER) && !defined(_MSC_VER)
+static int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+   __attribute__((format(__printf__, 1, 2), __unused__));
+#endif
+static int
+#if defined(_MSC_VER)
+__inline
+#endif
+VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
+{
+#if defined(NVALGRIND)
+   (void)format;
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER) || defined(__MINGW64__)
+   uintptr_t _qzz_res;
+#else
+   unsigned long _qzz_res;
+#endif
+   va_list vargs;
+   va_start(vargs, format);
+#if defined(_MSC_VER) || defined(__MINGW64__)
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
+                              (uintptr_t)format,
+                              (uintptr_t)&vargs,
+                              0, 0, 0);
+#else
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
+                              VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
+                              (unsigned long)format,
+                              (unsigned long)&vargs, 
+                              0, 0, 0);
+#endif
+   va_end(vargs);
+   return (int)_qzz_res;
+#endif /* NVALGRIND */
+}
+
+
+/* These requests allow control to move from the simulated CPU to the
+   real CPU, calling an arbitrary function.
+   
+   Note that the current ThreadId is inserted as the first argument.
+   So this call:
+
+     VALGRIND_NON_SIMD_CALL2(f, arg1, arg2)
+
+   requires f to have this signature:
+
+     Word f(Word tid, Word arg1, Word arg2)
+
+   where "Word" is a word-sized type.
+
+   Note that these client requests are not entirely reliable.  For example,
+   if you call a function with them that subsequently calls printf(),
+   there's a high chance Valgrind will crash.  Generally, your prospects of
+   these working are made higher if the called function does not refer to
+   any global variables, and does not refer to any libc or other functions
+   (printf et al).  Any kind of entanglement with libc or dynamic linking is
+   likely to have a bad outcome, for tricky reasons which we've grappled
+   with a lot in the past.
+*/
+#define VALGRIND_NON_SIMD_CALL0(_qyy_fn)                          \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,       \
+                                    VG_USERREQ__CLIENT_CALL0,     \
+                                    _qyy_fn,                      \
+                                    0, 0, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1)                    \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL1,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, 0, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2)         \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL2,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, _qyy_arg2, 0, 0)
+
+#define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3) \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,             \
+                                    VG_USERREQ__CLIENT_CALL3,           \
+                                    _qyy_fn,                            \
+                                    _qyy_arg1, _qyy_arg2,               \
+                                    _qyy_arg3, 0)
+
+
+/* Counts the number of errors that have been recorded by a tool.  Nb:
+   the tool must record the errors with VG_(maybe_record_error)() or
+   VG_(unique_error)() for them to be counted. */
+#define VALGRIND_COUNT_ERRORS                                     \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(                    \
+                               0 /* default return */,            \
+                               VG_USERREQ__COUNT_ERRORS,          \
+                               0, 0, 0, 0, 0)
+
+/* Several Valgrind tools (Memcheck, Massif, Helgrind, DRD) rely on knowing
+   when heap blocks are allocated in order to give accurate results.  This
+   happens automatically for the standard allocator functions such as
+   malloc(), calloc(), realloc(), memalign(), new, new[], free(), delete,
+   delete[], etc.
+
+   But if your program uses a custom allocator, this doesn't automatically
+   happen, and Valgrind will not do as well.  For example, if you allocate
+   superblocks with mmap() and then allocates chunks of the superblocks, all
+   Valgrind's observations will be at the mmap() level and it won't know that
+   the chunks should be considered separate entities.  In Memcheck's case,
+   that means you probably won't get heap block overrun detection (because
+   there won't be redzones marked as unaddressable) and you definitely won't
+   get any leak detection.
+
+   The following client requests allow a custom allocator to be annotated so
+   that it can be handled accurately by Valgrind.
+
+   VALGRIND_MALLOCLIKE_BLOCK marks a region of memory as having been allocated
+   by a malloc()-like function.  For Memcheck (an illustrative case), this
+   does two things:
+
+   - It records that the block has been allocated.  This means any addresses
+     within the block mentioned in error messages will be
+     identified as belonging to the block.  It also means that if the block
+     isn't freed it will be detected by the leak checker.
+
+   - It marks the block as being addressable and undefined (if 'is_zeroed' is
+     not set), or addressable and defined (if 'is_zeroed' is set).  This
+     controls how accesses to the block by the program are handled.
+   
+   'addr' is the start of the usable block (ie. after any
+   redzone), 'sizeB' is its size.  'rzB' is the redzone size if the allocator
+   can apply redzones -- these are blocks of padding at the start and end of
+   each block.  Adding redzones is recommended as it makes it much more likely
+   Valgrind will spot block overruns.  `is_zeroed' indicates if the memory is
+   zeroed (or filled with another predictable value), as is the case for
+   calloc().
+   
+   VALGRIND_MALLOCLIKE_BLOCK should be put immediately after the point where a
+   heap block -- that will be used by the client program -- is allocated.
+   It's best to put it at the outermost level of the allocator if possible;
+   for example, if you have a function my_alloc() which calls
+   internal_alloc(), and the client request is put inside internal_alloc(),
+   stack traces relating to the heap block will contain entries for both
+   my_alloc() and internal_alloc(), which is probably not what you want.
+
+   For Memcheck users: if you use VALGRIND_MALLOCLIKE_BLOCK to carve out
+   custom blocks from within a heap block, B, that has been allocated with
+   malloc/calloc/new/etc, then block B will be *ignored* during leak-checking
+   -- the custom blocks will take precedence.
+
+   VALGRIND_FREELIKE_BLOCK is the partner to VALGRIND_MALLOCLIKE_BLOCK.  For
+   Memcheck, it does two things:
+
+   - It records that the block has been deallocated.  This assumes that the
+     block was annotated as having been allocated via
+     VALGRIND_MALLOCLIKE_BLOCK.  Otherwise, an error will be issued.
+
+   - It marks the block as being unaddressable.
+
+   VALGRIND_FREELIKE_BLOCK should be put immediately after the point where a
+   heap block is deallocated.
+
+   VALGRIND_RESIZEINPLACE_BLOCK informs a tool about reallocation. For
+   Memcheck, it does four things:
+
+   - It records that the size of a block has been changed.  This assumes that
+     the block was annotated as having been allocated via
+     VALGRIND_MALLOCLIKE_BLOCK.  Otherwise, an error will be issued.
+
+   - If the block shrunk, it marks the freed memory as being unaddressable.
+
+   - If the block grew, it marks the new area as undefined and defines a red
+     zone past the end of the new block.
+
+   - The V-bits of the overlap between the old and the new block are preserved.
+
+   VALGRIND_RESIZEINPLACE_BLOCK should be put after allocation of the new block
+   and before deallocation of the old block.
+
+   In many cases, these three client requests will not be enough to get your
+   allocator working well with Memcheck.  More specifically, if your allocator
+   writes to freed blocks in any way then a VALGRIND_MAKE_MEM_UNDEFINED call
+   will be necessary to mark the memory as addressable just before the zeroing
+   occurs, otherwise you'll get a lot of invalid write errors.  For example,
+   you'll need to do this if your allocator recycles freed blocks, but it
+   zeroes them before handing them back out (via VALGRIND_MALLOCLIKE_BLOCK).
+   Alternatively, if your allocator reuses freed blocks for allocator-internal
+   data structures, VALGRIND_MAKE_MEM_UNDEFINED calls will also be necessary.
+
+   Really, what's happening is a blurring of the lines between the client
+   program and the allocator... after VALGRIND_FREELIKE_BLOCK is called, the
+   memory should be considered unaddressable to the client program, but the
+   allocator knows more than the rest of the client program and so may be able
+   to safely access it.  Extra client requests are necessary for Valgrind to
+   understand the distinction between the allocator and the rest of the
+   program.
+
+   Ignored if addr == 0.
+*/
+#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)          \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MALLOCLIKE_BLOCK,       \
+                                    addr, sizeB, rzB, is_zeroed, 0)
+
+/* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
+   Ignored if addr == 0.
+*/
+#define VALGRIND_RESIZEINPLACE_BLOCK(addr, oldSizeB, newSizeB, rzB)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__RESIZEINPLACE_BLOCK,    \
+                                    addr, oldSizeB, newSizeB, rzB, 0)
+
+/* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
+   Ignored if addr == 0.
+*/
+#define VALGRIND_FREELIKE_BLOCK(addr, rzB)                              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__FREELIKE_BLOCK,         \
+                                    addr, rzB, 0, 0, 0)
+
+/* Create a memory pool. */
+#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL,   \
+                                    pool, rzB, is_zeroed, 0, 0)
+
+/* Create a memory pool with some flags specifying extended behaviour.
+   When flags is zero, the behaviour is identical to VALGRIND_CREATE_MEMPOOL.
+   
+   The flag VALGRIND_MEMPOOL_METAPOOL specifies that the pieces of memory 
+   associated with the pool using VALGRIND_MEMPOOL_ALLOC  will be used
+   by the application as superblocks to dole out MALLOC_LIKE blocks using
+   VALGRIND_MALLOCLIKE_BLOCK. In other words, a meta pool is a "2 levels"
+   pool : first level is the blocks described by VALGRIND_MEMPOOL_ALLOC.
+   The second level blocks are described using VALGRIND_MALLOCLIKE_BLOCK.
+   Note that the association between the pool and the second level blocks
+   is implicit : second level blocks will be located inside first level
+   blocks. It is necessary to use the VALGRIND_MEMPOOL_METAPOOL flag
+   for such 2 levels pools, as otherwise valgrind will detect overlapping
+   memory blocks, and will abort execution (e.g. during leak search).
+
+   Such a meta pool can also be marked as an 'auto free' pool using the flag
+   VALGRIND_MEMPOOL_AUTO_FREE, which must be OR-ed together with the
+   VALGRIND_MEMPOOL_METAPOOL. For an 'auto free' pool, VALGRIND_MEMPOOL_FREE
+   will automatically free the second level blocks that are contained
+   inside the first level block freed with VALGRIND_MEMPOOL_FREE.
+   In other words, calling VALGRIND_MEMPOOL_FREE will cause implicit calls
+   to VALGRIND_FREELIKE_BLOCK for all the second level blocks included
+   in the first level block.
+   Note: it is an error to use the VALGRIND_MEMPOOL_AUTO_FREE flag
+   without the VALGRIND_MEMPOOL_METAPOOL flag.
+*/
+#define VALGRIND_MEMPOOL_AUTO_FREE  1
+#define VALGRIND_MEMPOOL_METAPOOL   2
+#define VALGRIND_CREATE_MEMPOOL_EXT(pool, rzB, is_zeroed, flags)        \
+   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL,          \
+                                   pool, rzB, is_zeroed, flags, 0)
+
+/* Destroy a memory pool. */
+#define VALGRIND_DESTROY_MEMPOOL(pool)                            \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL,  \
+                                    pool, 0, 0, 0, 0)
+
+/* Associate a piece of memory with a memory pool. */
+#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)                  \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_ALLOC,    \
+                                    pool, addr, size, 0, 0)
+
+/* Disassociate a piece of memory from a memory pool. */
+#define VALGRIND_MEMPOOL_FREE(pool, addr)                         \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_FREE,     \
+                                    pool, addr, 0, 0, 0)
+
+/* Disassociate any pieces outside a particular range. */
+#define VALGRIND_MEMPOOL_TRIM(pool, addr, size)                   \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_TRIM,     \
+                                    pool, addr, size, 0, 0)
+
+/* Resize and/or move a piece associated with a memory pool. */
+#define VALGRIND_MOVE_MEMPOOL(poolA, poolB)                       \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MOVE_MEMPOOL,     \
+                                    poolA, poolB, 0, 0, 0)
+
+/* Resize and/or move a piece associated with a memory pool. */
+#define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size)         \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_CHANGE,   \
+                                    pool, addrA, addrB, size, 0)
+
+/* Return 1 if a mempool exists, else 0. */
+#define VALGRIND_MEMPOOL_EXISTS(pool)                             \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__MEMPOOL_EXISTS,        \
+                               pool, 0, 0, 0, 0)
+
+/* Mark a piece of memory as being a stack. Returns a stack id.
+   start is the lowest addressable stack byte, end is the highest
+   addressable stack byte. */
+#define VALGRIND_STACK_REGISTER(start, end)                       \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__STACK_REGISTER,        \
+                               start, end, 0, 0, 0)
+
+/* Unmark the piece of memory associated with a stack id as being a
+   stack. */
+#define VALGRIND_STACK_DEREGISTER(id)                             \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_DEREGISTER, \
+                                    id, 0, 0, 0, 0)
+
+/* Change the start and end address of the stack id.
+   start is the new lowest addressable stack byte, end is the new highest
+   addressable stack byte. */
+#define VALGRIND_STACK_CHANGE(id, start, end)                     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_CHANGE,     \
+                                    id, start, end, 0, 0)
+
+/* Load PDB debug info for Wine PE image_map. */
+#define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__LOAD_PDB_DEBUGINFO, \
+                                    fd, ptr, total_size, delta, 0)
+
+/* Map a code address to a source file name and line number.  buf64
+   must point to a 64-byte buffer in the caller's address space.  The
+   result will be dumped in there and is guaranteed to be zero
+   terminated.  If no info is found, the first byte is set to zero. */
+#define VALGRIND_MAP_IP_TO_SRCLOC(addr, buf64)                    \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
+                               VG_USERREQ__MAP_IP_TO_SRCLOC,      \
+                               addr, buf64, 0, 0, 0)
+
+/* Disable error reporting for this thread.  Behaves in a stack like
+   way, so you can safely call this multiple times provided that
+   VALGRIND_ENABLE_ERROR_REPORTING is called the same number of times
+   to re-enable reporting.  The first call of this macro disables
+   reporting.  Subsequent calls have no effect except to increase the
+   number of VALGRIND_ENABLE_ERROR_REPORTING calls needed to re-enable
+   reporting.  Child threads do not inherit this setting from their
+   parents -- they are always created with reporting enabled. */
+#define VALGRIND_DISABLE_ERROR_REPORTING                                \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    1, 0, 0, 0, 0)
+
+/* Re-enable error reporting, as per comments on
+   VALGRIND_DISABLE_ERROR_REPORTING. */
+#define VALGRIND_ENABLE_ERROR_REPORTING                                 \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    -1, 0, 0, 0, 0)
+
+/* Execute a monitor command from the client program.
+   If a connection is opened with GDB, the output will be sent
+   according to the output mode set for vgdb.
+   If no connection is opened, output will go to the log output.
+   Returns 1 if command not recognised, 0 otherwise. */
+#define VALGRIND_MONITOR_COMMAND(command)                               \
+   VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__GDB_MONITOR_COMMAND, \
+                                   command, 0, 0, 0, 0)
+
+
+#undef PLAT_x86_darwin
+#undef PLAT_amd64_darwin
+#undef PLAT_x86_win32
+#undef PLAT_amd64_win64
+#undef PLAT_x86_linux
+#undef PLAT_amd64_linux
+#undef PLAT_ppc32_linux
+#undef PLAT_ppc64be_linux
+#undef PLAT_ppc64le_linux
+#undef PLAT_arm_linux
+#undef PLAT_s390x_linux
+#undef PLAT_mips32_linux
+#undef PLAT_mips64_linux
+#undef PLAT_x86_solaris
+#undef PLAT_amd64_solaris
+
+#endif   /* __VALGRIND_H */
diff --git a/ceph/src/pmdk/src/core/valgrind_internal.h b/ceph/src/pmdk/src/core/valgrind_internal.h
new file mode 100644 (file)
index 0000000..910421a
--- /dev/null
@@ -0,0 +1,478 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * valgrind_internal.h -- internal definitions for valgrind macros
+ */
+
+#ifndef PMDK_VALGRIND_INTERNAL_H
+#define PMDK_VALGRIND_INTERNAL_H 1
+
+#if !defined(_WIN32) && !defined(__FreeBSD__)
+#ifndef VALGRIND_ENABLED
+#define VALGRIND_ENABLED 1
+#endif
+#endif
+
+#if VALGRIND_ENABLED
+#define VG_PMEMCHECK_ENABLED 1
+#define VG_HELGRIND_ENABLED 1
+#define VG_MEMCHECK_ENABLED 1
+#define VG_DRD_ENABLED 1
+#endif
+
+#if VG_PMEMCHECK_ENABLED || VG_HELGRIND_ENABLED || VG_MEMCHECK_ENABLED || \
+       VG_DRD_ENABLED
+#define ANY_VG_TOOL_ENABLED 1
+#else
+#define ANY_VG_TOOL_ENABLED 0
+#endif
+
+#if ANY_VG_TOOL_ENABLED
+extern unsigned _On_valgrind;
+#define On_valgrind __builtin_expect(_On_valgrind, 0)
+#include "valgrind/valgrind.h"
+#else
+#define On_valgrind (0)
+#endif
+
+#if VG_HELGRIND_ENABLED
+extern unsigned _On_helgrind;
+#define On_helgrind __builtin_expect(_On_helgrind, 0)
+#include "valgrind/helgrind.h"
+#else
+#define On_helgrind (0)
+#endif
+
+#if VG_DRD_ENABLED
+extern unsigned _On_drd;
+#define On_drd __builtin_expect(_On_drd, 0)
+#include "valgrind/drd.h"
+#else
+#define On_drd (0)
+#endif
+
+#if VG_HELGRIND_ENABLED || VG_DRD_ENABLED
+
+extern unsigned _On_drd_or_hg;
+#define On_drd_or_hg __builtin_expect(_On_drd_or_hg, 0)
+
+#define VALGRIND_ANNOTATE_HAPPENS_BEFORE(obj) do {\
+       if (On_drd_or_hg) \
+               ANNOTATE_HAPPENS_BEFORE((obj));\
+} while (0)
+
+#define VALGRIND_ANNOTATE_HAPPENS_AFTER(obj) do {\
+       if (On_drd_or_hg) \
+               ANNOTATE_HAPPENS_AFTER((obj));\
+} while (0)
+
+#define VALGRIND_ANNOTATE_NEW_MEMORY(addr, size) do {\
+       if (On_drd_or_hg) \
+               ANNOTATE_NEW_MEMORY((addr), (size));\
+} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_READS_BEGIN() do {\
+       if (On_drd_or_hg) \
+       ANNOTATE_IGNORE_READS_BEGIN();\
+} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_READS_END() do {\
+       if (On_drd_or_hg) \
+       ANNOTATE_IGNORE_READS_END();\
+} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_WRITES_BEGIN() do {\
+       if (On_drd_or_hg) \
+       ANNOTATE_IGNORE_WRITES_BEGIN();\
+} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_WRITES_END() do {\
+       if (On_drd_or_hg) \
+       ANNOTATE_IGNORE_WRITES_END();\
+} while (0)
+
+/* Supported by both helgrind and drd. */
+#define VALGRIND_HG_DRD_DISABLE_CHECKING(addr, size) do {\
+       if (On_drd_or_hg) \
+               VALGRIND_HG_DISABLE_CHECKING((addr), (size));\
+} while (0)
+
+#else
+
+#define On_drd_or_hg (0)
+
+#define VALGRIND_ANNOTATE_HAPPENS_BEFORE(obj) do { (void)(obj); } while (0)
+
+#define VALGRIND_ANNOTATE_HAPPENS_AFTER(obj) do { (void)(obj); } while (0)
+
+#define VALGRIND_ANNOTATE_NEW_MEMORY(addr, size) do {\
+       (void) (addr);\
+       (void) (size);\
+} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_READS_BEGIN() do {} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_READS_END() do {} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_WRITES_BEGIN() do {} while (0)
+
+#define VALGRIND_ANNOTATE_IGNORE_WRITES_END() do {} while (0)
+
+#define VALGRIND_HG_DRD_DISABLE_CHECKING(addr, size) do {\
+       (void) (addr);\
+       (void) (size);\
+} while (0)
+
+#endif
+
+#if VG_PMEMCHECK_ENABLED
+
+extern unsigned _On_pmemcheck;
+#define On_pmemcheck __builtin_expect(_On_pmemcheck, 0)
+
+#include "valgrind/pmemcheck.h"
+
+void pobj_emit_log(const char *func, int order);
+void pmem_emit_log(const char *func, int order);
+void pmem2_emit_log(const char *func, int order);
+extern int _Pmreorder_emit;
+
+#define Pmreorder_emit __builtin_expect(_Pmreorder_emit, 0)
+
+#define VALGRIND_REGISTER_PMEM_MAPPING(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_REGISTER_PMEM_MAPPING((addr), (len));\
+} while (0)
+
+#define VALGRIND_REGISTER_PMEM_FILE(desc, base_addr, size, offset) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_REGISTER_PMEM_FILE((desc), (base_addr), (size), \
+               (offset));\
+} while (0)
+
+#define VALGRIND_REMOVE_PMEM_MAPPING(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_REMOVE_PMEM_MAPPING((addr), (len));\
+} while (0)
+
+#define VALGRIND_CHECK_IS_PMEM_MAPPING(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_CHECK_IS_PMEM_MAPPING((addr), (len));\
+} while (0)
+
+#define VALGRIND_PRINT_PMEM_MAPPINGS do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_PRINT_PMEM_MAPPINGS;\
+} while (0)
+
+#define VALGRIND_DO_FLUSH(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_DO_FLUSH((addr), (len));\
+} while (0)
+
+#define VALGRIND_DO_FENCE do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_DO_FENCE;\
+} while (0)
+
+#define VALGRIND_DO_PERSIST(addr, len) do {\
+       if (On_pmemcheck) {\
+               VALGRIND_PMC_DO_FLUSH((addr), (len));\
+               VALGRIND_PMC_DO_FENCE;\
+       }\
+} while (0)
+
+#define VALGRIND_SET_CLEAN(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_SET_CLEAN(addr, len);\
+} while (0)
+
+#define VALGRIND_WRITE_STATS do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_WRITE_STATS;\
+} while (0)
+
+#define VALGRIND_EMIT_LOG(emit_log) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_EMIT_LOG((emit_log));\
+} while (0)
+
+#define VALGRIND_START_TX do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_START_TX;\
+} while (0)
+
+#define VALGRIND_START_TX_N(txn) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_START_TX_N(txn);\
+} while (0)
+
+#define VALGRIND_END_TX do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_END_TX;\
+} while (0)
+
+#define VALGRIND_END_TX_N(txn) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_END_TX_N(txn);\
+} while (0)
+
+#define VALGRIND_ADD_TO_TX(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_ADD_TO_TX(addr, len);\
+} while (0)
+
+#define VALGRIND_ADD_TO_TX_N(txn, addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_ADD_TO_TX_N(txn, addr, len);\
+} while (0)
+
+#define VALGRIND_REMOVE_FROM_TX(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_REMOVE_FROM_TX(addr, len);\
+} while (0)
+
+#define VALGRIND_REMOVE_FROM_TX_N(txn, addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_REMOVE_FROM_TX_N(txn, addr, len);\
+} while (0)
+
+#define VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(addr, len) do {\
+       if (On_pmemcheck)\
+               VALGRIND_PMC_ADD_TO_GLOBAL_TX_IGNORE(addr, len);\
+} while (0)
+
+/*
+ * Logs library and function name with proper suffix
+ * to pmemcheck store log file.
+ */
+#define PMEMOBJ_API_START()\
+       if (Pmreorder_emit)\
+               pobj_emit_log(__func__, 0);
+#define PMEMOBJ_API_END()\
+       if (Pmreorder_emit)\
+               pobj_emit_log(__func__, 1);
+
+#define PMEM_API_START()\
+       if (Pmreorder_emit)\
+               pmem_emit_log(__func__, 0);
+#define PMEM_API_END()\
+       if (Pmreorder_emit)\
+               pmem_emit_log(__func__, 1);
+
+#define PMEM2_API_START(func_name)\
+       if (Pmreorder_emit)\
+               pmem2_emit_log(func_name, 0);
+#define PMEM2_API_END(func_name)\
+       if (Pmreorder_emit)\
+               pmem2_emit_log(func_name, 1);
+
+#else
+
+#define On_pmemcheck (0)
+#define Pmreorder_emit (0)
+
+#define VALGRIND_REGISTER_PMEM_MAPPING(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_REGISTER_PMEM_FILE(desc, base_addr, size, offset) do {\
+       (void) (desc);\
+       (void) (base_addr);\
+       (void) (size);\
+       (void) (offset);\
+} while (0)
+
+#define VALGRIND_REMOVE_PMEM_MAPPING(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_CHECK_IS_PMEM_MAPPING(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_PRINT_PMEM_MAPPINGS do {} while (0)
+
+#define VALGRIND_DO_FLUSH(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_DO_FENCE do {} while (0)
+
+#define VALGRIND_DO_PERSIST(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_SET_CLEAN(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_WRITE_STATS do {} while (0)
+
+#define VALGRIND_EMIT_LOG(emit_log) do {\
+       (void) (emit_log);\
+} while (0)
+
+#define VALGRIND_START_TX do {} while (0)
+
+#define VALGRIND_START_TX_N(txn) do { (void) (txn); } while (0)
+
+#define VALGRIND_END_TX do {} while (0)
+
+#define VALGRIND_END_TX_N(txn) do {\
+       (void) (txn);\
+} while (0)
+
+#define VALGRIND_ADD_TO_TX(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_ADD_TO_TX_N(txn, addr, len) do {\
+       (void) (txn);\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_REMOVE_FROM_TX(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_REMOVE_FROM_TX_N(txn, addr, len) do {\
+       (void) (txn);\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(addr, len) do {\
+       (void) (addr);\
+       (void) (len);\
+} while (0)
+
+#define PMEMOBJ_API_START() do {} while (0)
+
+#define PMEMOBJ_API_END() do {} while (0)
+
+#define PMEM_API_START() do {} while (0)
+
+#define PMEM_API_END() do {} while (0)
+
+#define PMEM2_API_START(func_name) do {\
+       (void) (func_name);\
+} while (0)
+
+#define PMEM2_API_END(func_name) do {\
+       (void) (func_name);\
+} while (0)
+#endif
+
+#if VG_MEMCHECK_ENABLED
+
+extern unsigned _On_memcheck;
+#define On_memcheck __builtin_expect(_On_memcheck, 0)
+
+#include "valgrind/memcheck.h"
+
+#define VALGRIND_DO_DISABLE_ERROR_REPORTING do {\
+       if (On_valgrind)\
+               VALGRIND_DISABLE_ERROR_REPORTING;\
+} while (0)
+
+#define VALGRIND_DO_ENABLE_ERROR_REPORTING do {\
+       if (On_valgrind)\
+               VALGRIND_ENABLE_ERROR_REPORTING;\
+} while (0)
+
+#define VALGRIND_DO_CREATE_MEMPOOL(heap, rzB, is_zeroed) do {\
+       if (On_memcheck)\
+               VALGRIND_CREATE_MEMPOOL(heap, rzB, is_zeroed);\
+} while (0)
+
+#define VALGRIND_DO_DESTROY_MEMPOOL(heap) do {\
+       if (On_memcheck)\
+               VALGRIND_DESTROY_MEMPOOL(heap);\
+} while (0)
+
+#define VALGRIND_DO_MEMPOOL_ALLOC(heap, addr, size) do {\
+       if (On_memcheck)\
+               VALGRIND_MEMPOOL_ALLOC(heap, addr, size);\
+} while (0)
+
+#define VALGRIND_DO_MEMPOOL_FREE(heap, addr) do {\
+       if (On_memcheck)\
+               VALGRIND_MEMPOOL_FREE(heap, addr);\
+} while (0)
+
+#define VALGRIND_DO_MEMPOOL_CHANGE(heap, addrA, addrB, size) do {\
+       if (On_memcheck)\
+               VALGRIND_MEMPOOL_CHANGE(heap, addrA, addrB, size);\
+} while (0)
+
+#define VALGRIND_DO_MAKE_MEM_DEFINED(addr, len) do {\
+       if (On_memcheck)\
+               VALGRIND_MAKE_MEM_DEFINED(addr, len);\
+} while (0)
+
+#define VALGRIND_DO_MAKE_MEM_UNDEFINED(addr, len) do {\
+       if (On_memcheck)\
+               VALGRIND_MAKE_MEM_UNDEFINED(addr, len);\
+} while (0)
+
+#define VALGRIND_DO_MAKE_MEM_NOACCESS(addr, len) do {\
+       if (On_memcheck)\
+               VALGRIND_MAKE_MEM_NOACCESS(addr, len);\
+} while (0)
+
+#define VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len) do {\
+       if (On_memcheck)\
+               VALGRIND_CHECK_MEM_IS_ADDRESSABLE(addr, len);\
+} while (0)
+
+#else
+
+#define On_memcheck (0)
+
+#define VALGRIND_DO_DISABLE_ERROR_REPORTING do {} while (0)
+
+#define VALGRIND_DO_ENABLE_ERROR_REPORTING do {} while (0)
+
+#define VALGRIND_DO_CREATE_MEMPOOL(heap, rzB, is_zeroed)\
+       do { (void) (heap); (void) (rzB); (void) (is_zeroed); } while (0)
+
+#define VALGRIND_DO_DESTROY_MEMPOOL(heap)\
+       do { (void) (heap); } while (0)
+
+#define VALGRIND_DO_MEMPOOL_ALLOC(heap, addr, size)\
+       do { (void) (heap); (void) (addr); (void) (size); } while (0)
+
+#define VALGRIND_DO_MEMPOOL_FREE(heap, addr)\
+       do { (void) (heap); (void) (addr); } while (0)
+
+#define VALGRIND_DO_MEMPOOL_CHANGE(heap, addrA, addrB, size)\
+       do {\
+               (void) (heap); (void) (addrA); (void) (addrB); (void) (size);\
+       } while (0)
+
+#define VALGRIND_DO_MAKE_MEM_DEFINED(addr, len)\
+       do { (void) (addr); (void) (len); } while (0)
+
+#define VALGRIND_DO_MAKE_MEM_UNDEFINED(addr, len)\
+       do { (void) (addr); (void) (len); } while (0)
+
+#define VALGRIND_DO_MAKE_MEM_NOACCESS(addr, len)\
+       do { (void) (addr); (void) (len); } while (0)
+
+#define VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len)\
+       do { (void) (addr); (void) (len); } while (0)
+
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/freebsd/README b/ceph/src/pmdk/src/freebsd/README
new file mode 100644 (file)
index 0000000..f0f065d
--- /dev/null
@@ -0,0 +1,13 @@
+Persistent Memory Development Kit
+
+This is src/freebsd/README.
+
+This directory contains FreeBSD-specific files for the Persistent Memory Development Kit.
+
+The subdirectory "include" contains header files that have no equivalents
+on FreeBSD. Most of these files are empty, which is a cheap trick to avoid
+preprocessor errors when including non-existing files. Others are redirects
+for files that are in different locations on FreeBSD. This way we don't
+need a lot of preprocessor conditionals in all the source code files, although
+it does require conditionals in the Makefiles (which could be addressed by
+using autoconf).
diff --git a/ceph/src/pmdk/src/freebsd/include/endian.h b/ceph/src/pmdk/src/freebsd/include/endian.h
new file mode 100644 (file)
index 0000000..103b89e
--- /dev/null
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * endian.h -- redirect for FreeBSD <sys/endian.h>
+ */
+
+#include <sys/endian.h>
diff --git a/ceph/src/pmdk/src/freebsd/include/features.h b/ceph/src/pmdk/src/freebsd/include/features.h
new file mode 100644 (file)
index 0000000..b0740ec
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * features.h -- Empty file redirect
+ */
diff --git a/ceph/src/pmdk/src/freebsd/include/linux/kdev_t.h b/ceph/src/pmdk/src/freebsd/include/linux/kdev_t.h
new file mode 100644 (file)
index 0000000..4890fa0
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * linux/kdev_t.h -- Empty file redirect
+ */
diff --git a/ceph/src/pmdk/src/freebsd/include/linux/limits.h b/ceph/src/pmdk/src/freebsd/include/linux/limits.h
new file mode 100644 (file)
index 0000000..8c1575d
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * linux/limits.h -- Empty file redirect
+ */
diff --git a/ceph/src/pmdk/src/freebsd/include/sys/sysmacros.h b/ceph/src/pmdk/src/freebsd/include/sys/sysmacros.h
new file mode 100644 (file)
index 0000000..065392b
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * sys/sysmacros.h -- Empty file redirect
+ */
diff --git a/ceph/src/pmdk/src/include/.cstyleignore b/ceph/src/pmdk/src/include/.cstyleignore
new file mode 100644 (file)
index 0000000..1bcbd0d
--- /dev/null
@@ -0,0 +1 @@
+pmemcompat.h
diff --git a/ceph/src/pmdk/src/include/README b/ceph/src/pmdk/src/include/README
new file mode 100644 (file)
index 0000000..6cd9ebb
--- /dev/null
@@ -0,0 +1,27 @@
+Persistent Memory Development Kit
+
+This is src/include/README.
+
+This directory contains include files that are meant to be installed on
+a system when the Persistent Memory Development Kit package is installed.
+These include files provide the public information exported
+by the libraries that is necessary for applications to call into
+the libraries.  Private include files, used only internally in
+the libraries, don't live here -- they typically live next to
+the source for their module.
+
+Here you'll find:
+
+libpmem.h -- definitions of libpmem entry points (see libpmem(7))
+
+libpmem2.h -- definitions of libpmem2 entry points (see libpmem2(7))
+
+libpmemblk.h -- definitions of libpmemblk entry points (see libpmemblk(7))
+
+libpmemlog.h -- definitions of libpmemlog entry points (see libpmemlog(7))
+
+libpmemobj.h -- definitions of libpmemobj entry points (see libpmemobj(7))
+
+Experimental libraries:
+
+librpmem.h -- definitions of librpmem entry points (see librpmem(7))
diff --git a/ceph/src/pmdk/src/include/libpmem.h b/ceph/src/pmdk/src/include/libpmem.h
new file mode 100644 (file)
index 0000000..5eb0930
--- /dev/null
@@ -0,0 +1,131 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmem.h -- definitions of libpmem entry points
+ *
+ * This library provides support for programming with persistent memory (pmem).
+ *
+ * libpmem provides support for using raw pmem directly.
+ *
+ * See libpmem(7) for details.
+ */
+
+#ifndef LIBPMEM_H
+#define LIBPMEM_H 1
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmem_map_file pmem_map_fileW
+#define pmem_check_version pmem_check_versionW
+#define pmem_errormsg pmem_errormsgW
+#else
+#define pmem_map_file pmem_map_fileU
+#define pmem_check_version pmem_check_versionU
+#define pmem_errormsg pmem_errormsgU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This limit is set arbitrary to incorporate a pool header and required
+ * alignment plus supply.
+ */
+#define PMEM_MIN_PART ((size_t)(1024 * 1024 * 2)) /* 2 MiB */
+
+/*
+ * flags supported by pmem_map_file()
+ */
+#define PMEM_FILE_CREATE       (1 << 0)
+#define PMEM_FILE_EXCL         (1 << 1)
+#define PMEM_FILE_SPARSE       (1 << 2)
+#define PMEM_FILE_TMPFILE      (1 << 3)
+
+#ifndef _WIN32
+void *pmem_map_file(const char *path, size_t len, int flags, mode_t mode,
+       size_t *mapped_lenp, int *is_pmemp);
+#else
+void *pmem_map_fileU(const char *path, size_t len, int flags, mode_t mode,
+       size_t *mapped_lenp, int *is_pmemp);
+void *pmem_map_fileW(const wchar_t *path, size_t len, int flags, mode_t mode,
+       size_t *mapped_lenp, int *is_pmemp);
+#endif
+
+int pmem_unmap(void *addr, size_t len);
+int pmem_is_pmem(const void *addr, size_t len);
+void pmem_persist(const void *addr, size_t len);
+int pmem_msync(const void *addr, size_t len);
+int pmem_has_auto_flush(void);
+void pmem_flush(const void *addr, size_t len);
+void pmem_deep_flush(const void *addr, size_t len);
+int pmem_deep_drain(const void *addr, size_t len);
+int pmem_deep_persist(const void *addr, size_t len);
+void pmem_drain(void);
+int pmem_has_hw_drain(void);
+
+void *pmem_memmove_persist(void *pmemdest, const void *src, size_t len);
+void *pmem_memcpy_persist(void *pmemdest, const void *src, size_t len);
+void *pmem_memset_persist(void *pmemdest, int c, size_t len);
+void *pmem_memmove_nodrain(void *pmemdest, const void *src, size_t len);
+void *pmem_memcpy_nodrain(void *pmemdest, const void *src, size_t len);
+void *pmem_memset_nodrain(void *pmemdest, int c, size_t len);
+
+#define PMEM_F_MEM_NODRAIN     (1U << 0)
+
+#define PMEM_F_MEM_NONTEMPORAL (1U << 1)
+#define PMEM_F_MEM_TEMPORAL    (1U << 2)
+
+#define PMEM_F_MEM_WC          (1U << 3)
+#define PMEM_F_MEM_WB          (1U << 4)
+
+#define PMEM_F_MEM_NOFLUSH     (1U << 5)
+
+#define PMEM_F_MEM_VALID_FLAGS (PMEM_F_MEM_NODRAIN | \
+                               PMEM_F_MEM_NONTEMPORAL | \
+                               PMEM_F_MEM_TEMPORAL | \
+                               PMEM_F_MEM_WC | \
+                               PMEM_F_MEM_WB | \
+                               PMEM_F_MEM_NOFLUSH)
+
+void *pmem_memmove(void *pmemdest, const void *src, size_t len, unsigned flags);
+void *pmem_memcpy(void *pmemdest, const void *src, size_t len, unsigned flags);
+void *pmem_memset(void *pmemdest, int c, size_t len, unsigned flags);
+
+/*
+ * PMEM_MAJOR_VERSION and PMEM_MINOR_VERSION provide the current version of the
+ * libpmem API as provided by this header file.  Applications can verify that
+ * the version available at run-time is compatible with the version used at
+ * compile-time by passing these defines to pmem_check_version().
+ */
+#define PMEM_MAJOR_VERSION 1
+#define PMEM_MINOR_VERSION 1
+
+#ifndef _WIN32
+const char *pmem_check_version(unsigned major_required,
+       unsigned minor_required);
+#else
+const char *pmem_check_versionU(unsigned major_required,
+       unsigned minor_required);
+const wchar_t *pmem_check_versionW(unsigned major_required,
+       unsigned minor_required);
+#endif
+
+#ifndef _WIN32
+const char *pmem_errormsg(void);
+#else
+const char *pmem_errormsgU(void);
+const wchar_t *pmem_errormsgW(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmem.h */
diff --git a/ceph/src/pmdk/src/include/libpmem2.h b/ceph/src/pmdk/src/include/libpmem2.h
new file mode 100644 (file)
index 0000000..37fb24a
--- /dev/null
@@ -0,0 +1,272 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * libpmem2.h -- definitions of libpmem2 entry points
+ *
+ * This library provides support for programming with persistent memory (pmem).
+ *
+ * libpmem2 provides support for using raw pmem directly.
+ *
+ * See libpmem2(7) for details.
+ */
+
+#ifndef LIBPMEM2_H
+#define LIBPMEM2_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmem2_source_device_id pmem2_source_device_idW
+#define pmem2_errormsg pmem2_errormsgW
+#define pmem2_perror pmem2_perrorW
+#else
+#define pmem2_source_device_id pmem2_source_device_idU
+#define pmem2_errormsg pmem2_errormsgU
+#define pmem2_perror pmem2_perrorU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PMEM2_E_UNKNOWN                                (-100000)
+#define PMEM2_E_NOSUPP                         (-100001)
+#define PMEM2_E_FILE_HANDLE_NOT_SET            (-100003)
+#define PMEM2_E_INVALID_FILE_HANDLE            (-100004)
+#define PMEM2_E_INVALID_FILE_TYPE              (-100005)
+#define PMEM2_E_MAP_RANGE                      (-100006)
+#define PMEM2_E_MAPPING_EXISTS                 (-100007)
+#define PMEM2_E_GRANULARITY_NOT_SET            (-100008)
+#define PMEM2_E_GRANULARITY_NOT_SUPPORTED      (-100009)
+#define PMEM2_E_OFFSET_OUT_OF_RANGE            (-100010)
+#define PMEM2_E_OFFSET_UNALIGNED               (-100011)
+#define PMEM2_E_INVALID_ALIGNMENT_FORMAT       (-100012)
+#define PMEM2_E_INVALID_ALIGNMENT_VALUE                (-100013)
+#define PMEM2_E_INVALID_SIZE_FORMAT            (-100014)
+#define PMEM2_E_LENGTH_UNALIGNED               (-100015)
+#define PMEM2_E_MAPPING_NOT_FOUND              (-100016)
+#define PMEM2_E_BUFFER_TOO_SMALL               (-100017)
+#define PMEM2_E_SOURCE_EMPTY                   (-100018)
+#define PMEM2_E_INVALID_SHARING_VALUE          (-100019)
+#define PMEM2_E_SRC_DEVDAX_PRIVATE             (-100020)
+#define PMEM2_E_INVALID_ADDRESS_REQUEST_TYPE   (-100021)
+#define PMEM2_E_ADDRESS_UNALIGNED              (-100022)
+#define PMEM2_E_ADDRESS_NULL                   (-100023)
+#define PMEM2_E_DEEP_FLUSH_RANGE               (-100024)
+#define PMEM2_E_INVALID_REGION_FORMAT          (-100025)
+#define PMEM2_E_DAX_REGION_NOT_FOUND           (-100026)
+#define PMEM2_E_INVALID_DEV_FORMAT             (-100027)
+#define PMEM2_E_CANNOT_READ_BOUNDS             (-100028)
+#define PMEM2_E_NO_BAD_BLOCK_FOUND             (-100029)
+#define PMEM2_E_LENGTH_OUT_OF_RANGE            (-100030)
+#define PMEM2_E_INVALID_PROT_FLAG              (-100031)
+#define PMEM2_E_NO_ACCESS                      (-100032)
+#define PMEM2_E_VM_RESERVATION_NOT_EMPTY       (-100033)
+#define PMEM2_E_MAP_EXISTS                     (-100034)
+#define PMEM2_E_FILE_DESCRIPTOR_NOT_SET                (-100035)
+
+/* source setup */
+
+struct pmem2_source;
+
+int pmem2_source_from_fd(struct pmem2_source **src, int fd);
+int pmem2_source_from_anon(struct pmem2_source **src, size_t size);
+#ifdef _WIN32
+int pmem2_source_from_handle(struct pmem2_source **src, HANDLE handle);
+int pmem2_source_get_handle(const struct pmem2_source *src, HANDLE *h);
+#else
+int pmem2_source_get_fd(const struct pmem2_source *src, int *fd);
+#endif
+
+int pmem2_source_size(const struct pmem2_source *src, size_t *size);
+
+int pmem2_source_alignment(const struct pmem2_source *src,
+               size_t *alignment);
+
+int pmem2_source_delete(struct pmem2_source **src);
+
+/* vm reservation setup */
+
+struct pmem2_vm_reservation;
+
+void *pmem2_vm_reservation_get_address(struct pmem2_vm_reservation *rsv);
+
+size_t pmem2_vm_reservation_get_size(struct pmem2_vm_reservation *rsv);
+
+int pmem2_vm_reservation_new(struct pmem2_vm_reservation **rsv_ptr,
+               void *addr, size_t size);
+
+int pmem2_vm_reservation_delete(struct pmem2_vm_reservation **rsv_ptr);
+
+/* config setup */
+
+struct pmem2_config;
+
+int pmem2_config_new(struct pmem2_config **cfg);
+
+int pmem2_config_delete(struct pmem2_config **cfg);
+
+enum pmem2_granularity {
+       PMEM2_GRANULARITY_BYTE,
+       PMEM2_GRANULARITY_CACHE_LINE,
+       PMEM2_GRANULARITY_PAGE,
+};
+
+int pmem2_config_set_required_store_granularity(struct pmem2_config *cfg,
+       enum pmem2_granularity g);
+
+int pmem2_config_set_offset(struct pmem2_config *cfg, size_t offset);
+
+int pmem2_config_set_length(struct pmem2_config *cfg, size_t length);
+
+enum pmem2_sharing_type {
+       PMEM2_SHARED,
+       PMEM2_PRIVATE,
+};
+
+int pmem2_config_set_sharing(struct pmem2_config *cfg,
+                               enum pmem2_sharing_type type);
+
+#define PMEM2_PROT_EXEC        (1U << 29)
+#define PMEM2_PROT_READ        (1U << 30)
+#define PMEM2_PROT_WRITE       (1U << 31)
+#define PMEM2_PROT_NONE        0
+
+int pmem2_config_set_protection(struct pmem2_config *cfg,
+                               unsigned prot);
+
+int pmem2_config_set_vm_reservation(struct pmem2_config *cfg,
+               struct pmem2_vm_reservation *rsv, size_t offset);
+
+/* mapping */
+
+struct pmem2_map;
+int pmem2_map_from_existing(struct pmem2_map **map,
+       const struct pmem2_source *src, void *addr, size_t len,
+       enum pmem2_granularity gran);
+
+int pmem2_map_new(struct pmem2_map **map_ptr, const struct pmem2_config *cfg,
+               const struct pmem2_source *src);
+
+int pmem2_map_delete(struct pmem2_map **map_ptr);
+
+void *pmem2_map_get_address(struct pmem2_map *map);
+
+size_t pmem2_map_get_size(struct pmem2_map *map);
+
+enum pmem2_granularity pmem2_map_get_store_granularity(struct pmem2_map *map);
+
+/* flushing */
+
+typedef void (*pmem2_persist_fn)(const void *ptr, size_t size);
+
+typedef void (*pmem2_flush_fn)(const void *ptr, size_t size);
+
+typedef void (*pmem2_drain_fn)(void);
+
+pmem2_persist_fn pmem2_get_persist_fn(struct pmem2_map *map);
+
+pmem2_flush_fn pmem2_get_flush_fn(struct pmem2_map *map);
+
+pmem2_drain_fn pmem2_get_drain_fn(struct pmem2_map *map);
+
+#define PMEM2_F_MEM_NODRAIN    (1U << 0)
+
+#define PMEM2_F_MEM_NONTEMPORAL        (1U << 1)
+#define PMEM2_F_MEM_TEMPORAL   (1U << 2)
+
+#define PMEM2_F_MEM_WC         (1U << 3)
+#define PMEM2_F_MEM_WB         (1U << 4)
+
+#define PMEM2_F_MEM_NOFLUSH    (1U << 5)
+
+#define PMEM2_F_MEM_VALID_FLAGS (PMEM2_F_MEM_NODRAIN | \
+               PMEM2_F_MEM_NONTEMPORAL | \
+               PMEM2_F_MEM_TEMPORAL | \
+               PMEM2_F_MEM_WC | \
+               PMEM2_F_MEM_WB | \
+               PMEM2_F_MEM_NOFLUSH)
+
+typedef void *(*pmem2_memmove_fn)(void *pmemdest, const void *src, size_t len,
+               unsigned flags);
+
+typedef void *(*pmem2_memcpy_fn)(void *pmemdest, const void *src, size_t len,
+               unsigned flags);
+
+typedef void *(*pmem2_memset_fn)(void *pmemdest, int c, size_t len,
+               unsigned flags);
+
+pmem2_memmove_fn pmem2_get_memmove_fn(struct pmem2_map *map);
+
+pmem2_memcpy_fn pmem2_get_memcpy_fn(struct pmem2_map *map);
+
+pmem2_memset_fn pmem2_get_memset_fn(struct pmem2_map *map);
+
+/* RAS */
+
+int pmem2_deep_flush(struct pmem2_map *map, void *ptr, size_t size);
+
+#ifndef _WIN32
+int pmem2_source_device_id(const struct pmem2_source *src,
+       char *id, size_t *len);
+#else
+int pmem2_source_device_idW(const struct pmem2_source *src,
+       wchar_t *id, size_t *len);
+
+int pmem2_source_device_idU(const struct pmem2_source *src,
+       char *id, size_t *len);
+#endif
+
+int pmem2_source_device_usc(const struct pmem2_source *src, uint64_t *usc);
+
+struct pmem2_badblock_context;
+
+struct pmem2_badblock {
+       size_t offset;
+       size_t length;
+};
+
+int pmem2_badblock_context_new(struct pmem2_badblock_context **bbctx,
+               const struct pmem2_source *src);
+
+int pmem2_badblock_next(struct pmem2_badblock_context *bbctx,
+               struct pmem2_badblock *bb);
+
+void pmem2_badblock_context_delete(
+               struct pmem2_badblock_context **bbctx);
+
+int pmem2_badblock_clear(struct pmem2_badblock_context *bbctx,
+               const struct pmem2_badblock *bb);
+
+/* error handling */
+
+#ifndef _WIN32
+const char *pmem2_errormsg(void);
+#else
+const char *pmem2_errormsgU(void);
+
+const wchar_t *pmem2_errormsgW(void);
+#endif
+
+int pmem2_err_to_errno(int);
+
+#ifndef _WIN32
+void pmem2_perror(const char *format,
+               ...) __attribute__((__format__(__printf__, 1, 2)));
+#else
+void pmem2_perrorU(const char *format, ...);
+
+void pmem2_perrorW(const wchar_t *format, ...);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmem2.h */
diff --git a/ceph/src/pmdk/src/include/libpmemblk.h b/ceph/src/pmdk/src/include/libpmemblk.h
new file mode 100644 (file)
index 0000000..72f6fd5
--- /dev/null
@@ -0,0 +1,164 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemblk.h -- definitions of libpmemblk entry points
+ *
+ * This library provides support for programming with persistent memory (pmem).
+ *
+ * libpmemblk provides support for arrays of atomically-writable blocks.
+ *
+ * See libpmemblk(7) for details.
+ */
+
+#ifndef LIBPMEMBLK_H
+#define LIBPMEMBLK_H 1
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmemblk_open pmemblk_openW
+#define pmemblk_create pmemblk_createW
+#define pmemblk_check pmemblk_checkW
+#define pmemblk_check_version pmemblk_check_versionW
+#define pmemblk_errormsg pmemblk_errormsgW
+#define pmemblk_ctl_get pmemblk_ctl_getW
+#define pmemblk_ctl_set pmemblk_ctl_setW
+#define pmemblk_ctl_exec pmemblk_ctl_execW
+#else
+#define pmemblk_open pmemblk_openU
+#define pmemblk_create pmemblk_createU
+#define pmemblk_check pmemblk_checkU
+#define pmemblk_check_version pmemblk_check_versionU
+#define pmemblk_errormsg pmemblk_errormsgU
+#define pmemblk_ctl_get pmemblk_ctl_getU
+#define pmemblk_ctl_set pmemblk_ctl_setU
+#define pmemblk_ctl_exec pmemblk_ctl_execU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * opaque type, internal to libpmemblk
+ */
+typedef struct pmemblk PMEMblkpool;
+
+/*
+ * PMEMBLK_MAJOR_VERSION and PMEMBLK_MINOR_VERSION provide the current version
+ * of the libpmemblk API as provided by this header file.  Applications can
+ * verify that the version available at run-time is compatible with the version
+ * used at compile-time by passing these defines to pmemblk_check_version().
+ */
+#define PMEMBLK_MAJOR_VERSION 1
+#define PMEMBLK_MINOR_VERSION 1
+
+#ifndef _WIN32
+const char *pmemblk_check_version(unsigned major_required,
+       unsigned minor_required);
+#else
+const char *pmemblk_check_versionU(unsigned major_required,
+       unsigned minor_required);
+const wchar_t *pmemblk_check_versionW(unsigned major_required,
+       unsigned minor_required);
+#endif
+
+/* XXX - unify minimum pool size for both OS-es */
+
+#ifndef _WIN32
+#if defined(__x86_64__) || defined(__M_X64__) || defined(__aarch64__)
+/* minimum pool size: 16MiB + 4KiB (minimum BTT size + mmap alignment) */
+#define PMEMBLK_MIN_POOL ((size_t)((1u << 20) * 16 + (1u << 10) * 8))
+#elif defined(__PPC64__)
+/* minimum pool size: 16MiB + 128KiB (minimum BTT size + mmap alignment) */
+#define PMEMBLK_MIN_POOL ((size_t)((1u << 20) * 16 + (1u << 10) * 128))
+#else
+#error unable to recognize ISA at compile time
+#endif
+#else
+/* minimum pool size: 16MiB + 64KiB (minimum BTT size + mmap alignment) */
+#define PMEMBLK_MIN_POOL ((size_t)((1u << 20) * 16 + (1u << 10) * 64))
+#endif
+
+/*
+ * This limit is set arbitrary to incorporate a pool header and required
+ * alignment plus supply.
+ */
+#define PMEMBLK_MIN_PART ((size_t)(1024 * 1024 * 2)) /* 2 MiB */
+
+#define PMEMBLK_MIN_BLK ((size_t)512)
+
+#ifndef _WIN32
+PMEMblkpool *pmemblk_open(const char *path, size_t bsize);
+#else
+PMEMblkpool *pmemblk_openU(const char *path, size_t bsize);
+PMEMblkpool *pmemblk_openW(const wchar_t *path, size_t bsize);
+#endif
+
+#ifndef _WIN32
+PMEMblkpool *pmemblk_create(const char *path, size_t bsize,
+               size_t poolsize, mode_t mode);
+#else
+PMEMblkpool *pmemblk_createU(const char *path, size_t bsize,
+               size_t poolsize, mode_t mode);
+PMEMblkpool *pmemblk_createW(const wchar_t *path, size_t bsize,
+               size_t poolsize, mode_t mode);
+#endif
+
+#ifndef _WIN32
+int pmemblk_check(const char *path, size_t bsize);
+#else
+int pmemblk_checkU(const char *path, size_t bsize);
+int pmemblk_checkW(const wchar_t *path, size_t bsize);
+#endif
+
+void pmemblk_close(PMEMblkpool *pbp);
+size_t pmemblk_bsize(PMEMblkpool *pbp);
+size_t pmemblk_nblock(PMEMblkpool *pbp);
+int pmemblk_read(PMEMblkpool *pbp, void *buf, long long blockno);
+int pmemblk_write(PMEMblkpool *pbp, const void *buf, long long blockno);
+int pmemblk_set_zero(PMEMblkpool *pbp, long long blockno);
+int pmemblk_set_error(PMEMblkpool *pbp, long long blockno);
+
+/*
+ * Passing NULL to pmemblk_set_funcs() tells libpmemblk to continue to use the
+ * default for that function.  The replacement functions must not make calls
+ * back into libpmemblk.
+ */
+void pmemblk_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s));
+
+#ifndef _WIN32
+const char *pmemblk_errormsg(void);
+#else
+const char *pmemblk_errormsgU(void);
+const wchar_t *pmemblk_errormsgW(void);
+#endif
+
+#ifndef _WIN32
+/* EXPERIMENTAL */
+int pmemblk_ctl_get(PMEMblkpool *pbp, const char *name, void *arg);
+int pmemblk_ctl_set(PMEMblkpool *pbp, const char *name, void *arg);
+int pmemblk_ctl_exec(PMEMblkpool *pbp, const char *name, void *arg);
+#else
+int pmemblk_ctl_getU(PMEMblkpool *pbp, const char *name, void *arg);
+int pmemblk_ctl_getW(PMEMblkpool *pbp, const wchar_t *name, void *arg);
+int pmemblk_ctl_setU(PMEMblkpool *pbp, const char *name, void *arg);
+int pmemblk_ctl_setW(PMEMblkpool *pbp, const wchar_t *name, void *arg);
+int pmemblk_ctl_execU(PMEMblkpool *pbp, const char *name, void *arg);
+int pmemblk_ctl_execW(PMEMblkpool *pbp, const wchar_t *name, void *arg);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemblk.h */
diff --git a/ceph/src/pmdk/src/include/libpmemlog.h b/ceph/src/pmdk/src/include/libpmemlog.h
new file mode 100644 (file)
index 0000000..5594a01
--- /dev/null
@@ -0,0 +1,152 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemlog.h -- definitions of libpmemlog entry points
+ *
+ * This library provides support for programming with persistent memory (pmem).
+ *
+ * libpmemlog provides support for pmem-resident log files.
+ *
+ * See libpmemlog(7) for details.
+ */
+
+#ifndef LIBPMEMLOG_H
+#define LIBPMEMLOG_H 1
+
+#include <sys/types.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmemlog_open pmemlog_openW
+#define pmemlog_create pmemlog_createW
+#define pmemlog_check pmemlog_checkW
+#define pmemlog_check_version pmemlog_check_versionW
+#define pmemlog_errormsg pmemlog_errormsgW
+#define pmemlog_ctl_get pmemlog_ctl_getW
+#define pmemlog_ctl_set pmemlog_ctl_setW
+#define pmemlog_ctl_exec pmemlog_ctl_execW
+#else
+#define pmemlog_open pmemlog_openU
+#define pmemlog_create pmemlog_createU
+#define pmemlog_check pmemlog_checkU
+#define pmemlog_check_version pmemlog_check_versionU
+#define pmemlog_errormsg pmemlog_errormsgU
+#define pmemlog_ctl_get pmemlog_ctl_getU
+#define pmemlog_ctl_set pmemlog_ctl_setU
+#define pmemlog_ctl_exec pmemlog_ctl_execU
+#endif
+
+#else
+#include <sys/uio.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * opaque type, internal to libpmemlog
+ */
+typedef struct pmemlog PMEMlogpool;
+
+/*
+ * PMEMLOG_MAJOR_VERSION and PMEMLOG_MINOR_VERSION provide the current
+ * version of the libpmemlog API as provided by this header file.
+ * Applications can verify that the version available at run-time
+ * is compatible with the version used at compile-time by passing
+ * these defines to pmemlog_check_version().
+ */
+#define PMEMLOG_MAJOR_VERSION 1
+#define PMEMLOG_MINOR_VERSION 1
+
+#ifndef _WIN32
+const char *pmemlog_check_version(unsigned major_required,
+       unsigned minor_required);
+#else
+const char *pmemlog_check_versionU(unsigned major_required,
+       unsigned minor_required);
+const wchar_t *pmemlog_check_versionW(unsigned major_required,
+       unsigned minor_required);
+#endif
+
+/*
+ * support for PMEM-resident log files...
+ */
+#define PMEMLOG_MIN_POOL ((size_t)(1024 * 1024 * 2)) /* min pool size: 2MiB */
+
+/*
+ * This limit is set arbitrary to incorporate a pool header and required
+ * alignment plus supply.
+ */
+#define PMEMLOG_MIN_PART ((size_t)(1024 * 1024 * 2)) /* 2 MiB */
+
+#ifndef _WIN32
+PMEMlogpool *pmemlog_open(const char *path);
+#else
+PMEMlogpool *pmemlog_openU(const char *path);
+PMEMlogpool *pmemlog_openW(const wchar_t *path);
+#endif
+
+#ifndef _WIN32
+PMEMlogpool *pmemlog_create(const char *path, size_t poolsize, mode_t mode);
+#else
+PMEMlogpool *pmemlog_createU(const char *path, size_t poolsize, mode_t mode);
+PMEMlogpool *pmemlog_createW(const wchar_t *path, size_t poolsize, mode_t mode);
+#endif
+
+#ifndef _WIN32
+int pmemlog_check(const char *path);
+#else
+int pmemlog_checkU(const char *path);
+int pmemlog_checkW(const wchar_t *path);
+#endif
+
+void pmemlog_close(PMEMlogpool *plp);
+size_t pmemlog_nbyte(PMEMlogpool *plp);
+int pmemlog_append(PMEMlogpool *plp, const void *buf, size_t count);
+int pmemlog_appendv(PMEMlogpool *plp, const struct iovec *iov, int iovcnt);
+long long pmemlog_tell(PMEMlogpool *plp);
+void pmemlog_rewind(PMEMlogpool *plp);
+void pmemlog_walk(PMEMlogpool *plp, size_t chunksize,
+       int (*process_chunk)(const void *buf, size_t len, void *arg),
+       void *arg);
+
+/*
+ * Passing NULL to pmemlog_set_funcs() tells libpmemlog to continue to use the
+ * default for that function.  The replacement functions must not make calls
+ * back into libpmemlog.
+ */
+void pmemlog_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s));
+
+#ifndef _WIN32
+const char *pmemlog_errormsg(void);
+#else
+const char *pmemlog_errormsgU(void);
+const wchar_t *pmemlog_errormsgW(void);
+#endif
+
+#ifndef _WIN32
+/* EXPERIMENTAL */
+int pmemlog_ctl_get(PMEMlogpool *plp, const char *name, void *arg);
+int pmemlog_ctl_set(PMEMlogpool *plp, const char *name, void *arg);
+int pmemlog_ctl_exec(PMEMlogpool *plp, const char *name, void *arg);
+#else
+int pmemlog_ctl_getU(PMEMlogpool *plp, const char *name, void *arg);
+int pmemlog_ctl_getW(PMEMlogpool *plp, const wchar_t *name, void *arg);
+int pmemlog_ctl_setU(PMEMlogpool *plp, const char *name, void *arg);
+int pmemlog_ctl_setW(PMEMlogpool *plp, const wchar_t *name, void *arg);
+int pmemlog_ctl_execU(PMEMlogpool *plp, const char *name, void *arg);
+int pmemlog_ctl_execW(PMEMlogpool *plp, const wchar_t *name, void *arg);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemlog.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj++/README.md b/ceph/src/pmdk/src/include/libpmemobj++/README.md
new file mode 100644 (file)
index 0000000..220083b
--- /dev/null
@@ -0,0 +1,2 @@
+This folder contained libpmemobj C++ bindings.
+They have been moved to https://github.com/pmem/libpmemobj-cpp
diff --git a/ceph/src/pmdk/src/include/libpmemobj++/detail/README.md b/ceph/src/pmdk/src/include/libpmemobj++/detail/README.md
new file mode 100644 (file)
index 0000000..eae27c1
--- /dev/null
@@ -0,0 +1,2 @@
+This folder contained libpmemobj C++ bindings.
+They have been moved to https://github.com/pmem/libpmemobj-cpp/tree/master/include/libpmemobj++/detail
diff --git a/ceph/src/pmdk/src/include/libpmemobj.h b/ceph/src/pmdk/src/include/libpmemobj.h
new file mode 100644 (file)
index 0000000..e1fd75a
--- /dev/null
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj.h -- definitions of libpmemobj entry points
+ *
+ * This library provides support for programming with persistent memory (pmem).
+ *
+ * libpmemobj provides a pmem-resident transactional object store.
+ *
+ * See libpmemobj(7) for details.
+ */
+
+#ifndef LIBPMEMOBJ_H
+#define LIBPMEMOBJ_H 1
+
+#include <libpmemobj/action.h>
+#include <libpmemobj/atomic.h>
+#include <libpmemobj/ctl.h>
+#include <libpmemobj/iterator.h>
+#include <libpmemobj/lists_atomic.h>
+#include <libpmemobj/pool.h>
+#include <libpmemobj/thread.h>
+#include <libpmemobj/tx.h>
+
+#endif /* libpmemobj.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/action.h b/ceph/src/pmdk/src/include/libpmemobj/action.h
new file mode 100644 (file)
index 0000000..7e1c7bc
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * libpmemobj/action.h -- definitions of libpmemobj action interface
+ */
+
+#ifndef LIBPMEMOBJ_ACTION_H
+#define LIBPMEMOBJ_ACTION_H 1
+
+#include <libpmemobj/action_base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define POBJ_RESERVE_NEW(pop, t, act)\
+((TOID(t))pmemobj_reserve(pop, act, sizeof(t), TOID_TYPE_NUM(t)))
+
+#define POBJ_RESERVE_ALLOC(pop, t, size, act)\
+((TOID(t))pmemobj_reserve(pop, act, size, TOID_TYPE_NUM(t)))
+
+#define POBJ_XRESERVE_NEW(pop, t, act, flags)\
+((TOID(t))pmemobj_xreserve(pop, act, sizeof(t), TOID_TYPE_NUM(t), flags))
+
+#define POBJ_XRESERVE_ALLOC(pop, t, size, act, flags)\
+((TOID(t))pmemobj_xreserve(pop, act, size, TOID_TYPE_NUM(t), flags))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/action_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/action_base.h b/ceph/src/pmdk/src/include/libpmemobj/action_base.h
new file mode 100644 (file)
index 0000000..e9d3e93
--- /dev/null
@@ -0,0 +1,74 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * libpmemobj/action_base.h -- definitions of libpmemobj action interface
+ */
+
+#ifndef LIBPMEMOBJ_ACTION_BASE_H
+#define LIBPMEMOBJ_ACTION_BASE_H 1
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum pobj_action_type {
+       /* a heap action (e.g., alloc) */
+       POBJ_ACTION_TYPE_HEAP,
+       /* a single memory operation (e.g., value set)  */
+       POBJ_ACTION_TYPE_MEM,
+
+       POBJ_MAX_ACTION_TYPE
+};
+
+struct pobj_action_heap {
+       /* offset to the element being freed/allocated */
+       uint64_t offset;
+       /* usable size of the element being allocated */
+       uint64_t usable_size;
+};
+
+struct pobj_action {
+       /*
+        * These fields are internal for the implementation and are not
+        * guaranteed to be stable across different versions of the API.
+        * Use with caution.
+        *
+        * This structure should NEVER be stored on persistent memory!
+        */
+       enum pobj_action_type type;
+       uint32_t data[3];
+       union {
+               struct pobj_action_heap heap;
+               uint64_t data2[14];
+       };
+};
+
+#define POBJ_ACTION_XRESERVE_VALID_FLAGS\
+       (POBJ_XALLOC_CLASS_MASK |\
+       POBJ_XALLOC_ARENA_MASK |\
+       POBJ_XALLOC_ZERO)
+
+PMEMoid pmemobj_reserve(PMEMobjpool *pop, struct pobj_action *act,
+       size_t size, uint64_t type_num);
+PMEMoid pmemobj_xreserve(PMEMobjpool *pop, struct pobj_action *act,
+       size_t size, uint64_t type_num, uint64_t flags);
+void pmemobj_set_value(PMEMobjpool *pop, struct pobj_action *act,
+       uint64_t *ptr, uint64_t value);
+void pmemobj_defer_free(PMEMobjpool *pop, PMEMoid oid, struct pobj_action *act);
+
+int pmemobj_publish(PMEMobjpool *pop, struct pobj_action *actv,
+       size_t actvcnt);
+int pmemobj_tx_publish(struct pobj_action *actv, size_t actvcnt);
+int pmemobj_tx_xpublish(struct pobj_action *actv, size_t actvcnt,
+               uint64_t flags);
+
+void pmemobj_cancel(PMEMobjpool *pop, struct pobj_action *actv, size_t actvcnt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/action_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/atomic.h b/ceph/src/pmdk/src/include/libpmemobj/atomic.h
new file mode 100644 (file)
index 0000000..ed11628
--- /dev/null
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/atomic.h -- definitions of libpmemobj atomic macros
+ */
+
+#ifndef LIBPMEMOBJ_ATOMIC_H
+#define LIBPMEMOBJ_ATOMIC_H 1
+
+#include <libpmemobj/atomic_base.h>
+#include <libpmemobj/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define POBJ_NEW(pop, o, t, constr, arg)\
+pmemobj_alloc((pop), (PMEMoid *)(o), sizeof(t), TOID_TYPE_NUM(t),\
+       (constr), (arg))
+
+#define POBJ_ALLOC(pop, o, t, size, constr, arg)\
+pmemobj_alloc((pop), (PMEMoid *)(o), (size), TOID_TYPE_NUM(t),\
+       (constr), (arg))
+
+#define POBJ_ZNEW(pop, o, t)\
+pmemobj_zalloc((pop), (PMEMoid *)(o), sizeof(t), TOID_TYPE_NUM(t))
+
+#define POBJ_ZALLOC(pop, o, t, size)\
+pmemobj_zalloc((pop), (PMEMoid *)(o), (size), TOID_TYPE_NUM(t))
+
+#define POBJ_REALLOC(pop, o, t, size)\
+pmemobj_realloc((pop), (PMEMoid *)(o), (size), TOID_TYPE_NUM(t))
+
+#define POBJ_ZREALLOC(pop, o, t, size)\
+pmemobj_zrealloc((pop), (PMEMoid *)(o), (size), TOID_TYPE_NUM(t))
+
+#define POBJ_FREE(o)\
+pmemobj_free((PMEMoid *)(o))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/atomic.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/atomic_base.h b/ceph/src/pmdk/src/include/libpmemobj/atomic_base.h
new file mode 100644 (file)
index 0000000..b2058f5
--- /dev/null
@@ -0,0 +1,93 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/atomic_base.h -- definitions of libpmemobj atomic entry points
+ */
+
+#ifndef LIBPMEMOBJ_ATOMIC_BASE_H
+#define LIBPMEMOBJ_ATOMIC_BASE_H 1
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Non-transactional atomic allocations
+ *
+ * Those functions can be used outside transactions. The allocations are always
+ * aligned to the cache-line boundary.
+ */
+
+#define POBJ_XALLOC_VALID_FLAGS        (POBJ_XALLOC_ZERO |\
+       POBJ_XALLOC_CLASS_MASK)
+
+/*
+ * Allocates a new object from the pool and calls a constructor function before
+ * returning. It is guaranteed that allocated object is either properly
+ * initialized, or if it's interrupted before the constructor completes, the
+ * memory reserved for the object is automatically reclaimed.
+ */
+int pmemobj_alloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num, pmemobj_constr constructor, void *arg);
+
+/*
+ * Allocates with flags a new object from the pool.
+ */
+int pmemobj_xalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num, uint64_t flags,
+       pmemobj_constr constructor, void *arg);
+
+/*
+ * Allocates a new zeroed object from the pool.
+ */
+int pmemobj_zalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num);
+
+/*
+ * Resizes an existing object.
+ */
+int pmemobj_realloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num);
+
+/*
+ * Resizes an existing object, if extended new space is zeroed.
+ */
+int pmemobj_zrealloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num);
+
+/*
+ * Allocates a new object with duplicate of the string s.
+ */
+int pmemobj_strdup(PMEMobjpool *pop, PMEMoid *oidp, const char *s,
+       uint64_t type_num);
+
+/*
+ * Allocates a new object with duplicate of the wide character string s.
+ */
+int pmemobj_wcsdup(PMEMobjpool *pop, PMEMoid *oidp, const wchar_t *s,
+       uint64_t type_num);
+
+/*
+ * Frees an existing object.
+ */
+void pmemobj_free(PMEMoid *oidp);
+
+struct pobj_defrag_result {
+       size_t total; /* number of processed objects */
+       size_t relocated; /* number of relocated objects */
+};
+
+/*
+ * Performs defragmentation on the provided array of objects.
+ */
+int pmemobj_defrag(PMEMobjpool *pop, PMEMoid **oidv, size_t oidcnt,
+       struct pobj_defrag_result *result);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/atomic_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/base.h b/ceph/src/pmdk/src/include/libpmemobj/base.h
new file mode 100644 (file)
index 0000000..ebb30d8
--- /dev/null
@@ -0,0 +1,299 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/base.h -- definitions of base libpmemobj entry points
+ */
+
+#ifndef LIBPMEMOBJ_BASE_H
+#define LIBPMEMOBJ_BASE_H 1
+
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmemobj_check_version pmemobj_check_versionW
+#define pmemobj_errormsg pmemobj_errormsgW
+#else
+#define pmemobj_check_version pmemobj_check_versionU
+#define pmemobj_errormsg pmemobj_errormsgU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * opaque type internal to libpmemobj
+ */
+typedef struct pmemobjpool PMEMobjpool;
+
+#define PMEMOBJ_MAX_ALLOC_SIZE ((size_t)0x3FFDFFFC0)
+
+/*
+ * allocation functions flags
+ */
+#define POBJ_FLAG_ZERO                 (((uint64_t)1) << 0)
+#define POBJ_FLAG_NO_FLUSH             (((uint64_t)1) << 1)
+#define POBJ_FLAG_NO_SNAPSHOT          (((uint64_t)1) << 2)
+#define POBJ_FLAG_ASSUME_INITIALIZED   (((uint64_t)1) << 3)
+#define POBJ_FLAG_TX_NO_ABORT          (((uint64_t)1) << 4)
+
+#define POBJ_CLASS_ID(id)      (((uint64_t)(id)) << 48)
+#define POBJ_ARENA_ID(id)      (((uint64_t)(id)) << 32)
+
+#define POBJ_XALLOC_CLASS_MASK ((((uint64_t)1 << 16) - 1) << 48)
+#define POBJ_XALLOC_ARENA_MASK ((((uint64_t)1 << 16) - 1) << 32)
+#define POBJ_XALLOC_ZERO       POBJ_FLAG_ZERO
+#define POBJ_XALLOC_NO_FLUSH   POBJ_FLAG_NO_FLUSH
+#define POBJ_XALLOC_NO_ABORT   POBJ_FLAG_TX_NO_ABORT
+
+/*
+ * pmemobj_mem* flags
+ */
+#define PMEMOBJ_F_MEM_NODRAIN          (1U << 0)
+
+#define PMEMOBJ_F_MEM_NONTEMPORAL      (1U << 1)
+#define PMEMOBJ_F_MEM_TEMPORAL         (1U << 2)
+
+#define PMEMOBJ_F_MEM_WC               (1U << 3)
+#define PMEMOBJ_F_MEM_WB               (1U << 4)
+
+#define PMEMOBJ_F_MEM_NOFLUSH          (1U << 5)
+
+/*
+ * pmemobj_mem*, pmemobj_xflush & pmemobj_xpersist flags
+ */
+#define PMEMOBJ_F_RELAXED              (1U << 31)
+
+/*
+ * Persistent memory object
+ */
+
+/*
+ * Object handle
+ */
+typedef struct pmemoid {
+       uint64_t pool_uuid_lo;
+       uint64_t off;
+} PMEMoid;
+
+static const PMEMoid OID_NULL = { 0, 0 };
+#define OID_IS_NULL(o) ((o).off == 0)
+#define OID_EQUALS(lhs, rhs)\
+((lhs).off == (rhs).off &&\
+       (lhs).pool_uuid_lo == (rhs).pool_uuid_lo)
+
+PMEMobjpool *pmemobj_pool_by_ptr(const void *addr);
+PMEMobjpool *pmemobj_pool_by_oid(PMEMoid oid);
+
+#ifndef _WIN32
+
+extern int _pobj_cache_invalidate;
+extern __thread struct _pobj_pcache {
+       PMEMobjpool *pop;
+       uint64_t uuid_lo;
+       int invalidate;
+} _pobj_cached_pool;
+
+/*
+ * Returns the direct pointer of an object.
+ */
+static inline void *
+pmemobj_direct_inline(PMEMoid oid)
+{
+       if (oid.off == 0 || oid.pool_uuid_lo == 0)
+               return NULL;
+
+       struct _pobj_pcache *cache = &_pobj_cached_pool;
+       if (_pobj_cache_invalidate != cache->invalidate ||
+                       cache->uuid_lo != oid.pool_uuid_lo) {
+               cache->invalidate = _pobj_cache_invalidate;
+
+               if (!(cache->pop = pmemobj_pool_by_oid(oid))) {
+                       cache->uuid_lo = 0;
+                       return NULL;
+               }
+
+               cache->uuid_lo = oid.pool_uuid_lo;
+       }
+
+       return (void *)((uintptr_t)cache->pop + oid.off);
+}
+
+#endif /* _WIN32 */
+
+/*
+ * Returns the direct pointer of an object.
+ */
+#if defined(_WIN32) || defined(_PMEMOBJ_INTRNL) ||\
+       defined(PMEMOBJ_DIRECT_NON_INLINE)
+void *pmemobj_direct(PMEMoid oid);
+#else
+#define pmemobj_direct pmemobj_direct_inline
+#endif
+
+struct pmemvlt {
+       uint64_t runid;
+};
+
+#define PMEMvlt(T)\
+struct {\
+       struct pmemvlt vlt;\
+       T value;\
+}
+
+/*
+ * Returns lazily initialized volatile variable. (EXPERIMENTAL)
+ */
+void *pmemobj_volatile(PMEMobjpool *pop, struct pmemvlt *vlt,
+       void *ptr, size_t size,
+       int (*constr)(void *ptr, void *arg), void *arg);
+
+/*
+ * Returns the OID of the object pointed to by addr.
+ */
+PMEMoid pmemobj_oid(const void *addr);
+
+/*
+ * Returns the number of usable bytes in the object. May be greater than
+ * the requested size of the object because of internal alignment.
+ *
+ * Can be used with objects allocated by any of the available methods.
+ */
+size_t pmemobj_alloc_usable_size(PMEMoid oid);
+
+/*
+ * Returns the type number of the object.
+ */
+uint64_t pmemobj_type_num(PMEMoid oid);
+
+/*
+ * Pmemobj specific low-level memory manipulation functions.
+ *
+ * These functions are meant to be used with pmemobj pools, because they provide
+ * additional functionality specific to this type of pool. These may include
+ * for example replication support. They also take advantage of the knowledge
+ * of the type of memory in the pool (pmem/non-pmem) to assure persistence.
+ */
+
+/*
+ * Pmemobj version of memcpy. Data copied is made persistent.
+ */
+void *pmemobj_memcpy_persist(PMEMobjpool *pop, void *dest, const void *src,
+       size_t len);
+
+/*
+ * Pmemobj version of memset. Data range set is made persistent.
+ */
+void *pmemobj_memset_persist(PMEMobjpool *pop, void *dest, int c, size_t len);
+
+/*
+ * Pmemobj version of memcpy. Data copied is made persistent (unless opted-out
+ * using flags).
+ */
+void *pmemobj_memcpy(PMEMobjpool *pop, void *dest, const void *src, size_t len,
+               unsigned flags);
+
+/*
+ * Pmemobj version of memmove. Data copied is made persistent (unless opted-out
+ * using flags).
+ */
+void *pmemobj_memmove(PMEMobjpool *pop, void *dest, const void *src, size_t len,
+               unsigned flags);
+
+/*
+ * Pmemobj version of memset. Data range set is made persistent (unless
+ * opted-out using flags).
+ */
+void *pmemobj_memset(PMEMobjpool *pop, void *dest, int c, size_t len,
+               unsigned flags);
+
+/*
+ * Pmemobj version of pmem_persist.
+ */
+void pmemobj_persist(PMEMobjpool *pop, const void *addr, size_t len);
+
+/*
+ * Pmemobj version of pmem_persist with additional flags argument.
+ */
+int pmemobj_xpersist(PMEMobjpool *pop, const void *addr, size_t len,
+               unsigned flags);
+
+/*
+ * Pmemobj version of pmem_flush.
+ */
+void pmemobj_flush(PMEMobjpool *pop, const void *addr, size_t len);
+
+/*
+ * Pmemobj version of pmem_flush with additional flags argument.
+ */
+int pmemobj_xflush(PMEMobjpool *pop, const void *addr, size_t len,
+               unsigned flags);
+
+/*
+ * Pmemobj version of pmem_drain.
+ */
+void pmemobj_drain(PMEMobjpool *pop);
+
+/*
+ * Version checking.
+ */
+
+/*
+ * PMEMOBJ_MAJOR_VERSION and PMEMOBJ_MINOR_VERSION provide the current version
+ * of the libpmemobj API as provided by this header file.  Applications can
+ * verify that the version available at run-time is compatible with the version
+ * used at compile-time by passing these defines to pmemobj_check_version().
+ */
+#define PMEMOBJ_MAJOR_VERSION 2
+#define PMEMOBJ_MINOR_VERSION 4
+
+#ifndef _WIN32
+const char *pmemobj_check_version(unsigned major_required,
+       unsigned minor_required);
+#else
+const char *pmemobj_check_versionU(unsigned major_required,
+       unsigned minor_required);
+const wchar_t *pmemobj_check_versionW(unsigned major_required,
+       unsigned minor_required);
+#endif
+
+/*
+ * Passing NULL to pmemobj_set_funcs() tells libpmemobj to continue to use the
+ * default for that function.  The replacement functions must not make calls
+ * back into libpmemobj.
+ */
+void pmemobj_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s));
+
+typedef int (*pmemobj_constr)(PMEMobjpool *pop, void *ptr, void *arg);
+
+/*
+ * (debug helper function) logs notice message if used inside a transaction
+ */
+void _pobj_debug_notice(const char *func_name, const char *file, int line);
+
+#ifndef _WIN32
+const char *pmemobj_errormsg(void);
+#else
+const char *pmemobj_errormsgU(void);
+const wchar_t *pmemobj_errormsgW(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemobj/base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/ctl.h b/ceph/src/pmdk/src/include/libpmemobj/ctl.h
new file mode 100644 (file)
index 0000000..12bbc58
--- /dev/null
@@ -0,0 +1,175 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * libpmemobj/ctl.h -- definitions of pmemobj_ctl related entry points
+ */
+
+#ifndef LIBPMEMOBJ_CTL_H
+#define LIBPMEMOBJ_CTL_H 1
+
+#include <stddef.h>
+#include <sys/types.h>
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Allocation class interface
+ *
+ * When requesting an object from the allocator, the first step is to determine
+ * which allocation class best approximates the size of the object.
+ * Once found, the appropriate free list, called bucket, for that
+ * class is selected in a fashion that minimizes contention between threads.
+ * Depending on the requested size and the allocation class, it might happen
+ * that the object size (including required metadata) would be bigger than the
+ * allocation class size - called unit size. In those situations, the object is
+ * constructed from two or more units (up to 64).
+ *
+ * If the requested number of units cannot be retrieved from the selected
+ * bucket, the thread reaches out to the global, shared, heap which manages
+ * memory in 256 kilobyte chunks and gives it out in a best-fit fashion. This
+ * operation must be performed under an exclusive lock.
+ * Once the thread is in the possession of a chunk, the lock is dropped, and the
+ * memory is split into units that repopulate the bucket.
+ *
+ * These are the CTL entry points that control allocation classes:
+ * - heap.alloc_class.[class_id].desc
+ *     Creates/retrieves allocation class information
+ *
+ * It's VERY important to remember that the allocation classes are a RUNTIME
+ * property of the allocator - they are NOT stored persistently in the pool.
+ * It's recommended to always create custom allocation classes immediately after
+ * creating or opening the pool, before any use.
+ * If there are existing objects created using a class that is no longer stored
+ * in the runtime state of the allocator, they can be normally freed, but
+ * allocating equivalent objects will be done using the allocation class that
+ * is currently defined for that size.
+ *
+ * Please see the libpmemobj man page for more information about entry points.
+ */
+
+/*
+ * Persistent allocation header
+ */
+enum pobj_header_type {
+       /*
+        * 64-byte header used up until the version 1.3 of the library,
+        * functionally equivalent to the compact header.
+        * It's not recommended to create any new classes with this header.
+        */
+       POBJ_HEADER_LEGACY,
+       /*
+        * 16-byte header used by the default allocation classes. All library
+        * metadata is by default allocated using this header.
+        * Supports type numbers and variably sized allocations.
+        */
+       POBJ_HEADER_COMPACT,
+       /*
+        * 0-byte header with metadata stored exclusively in a bitmap. This
+        * ensures that objects are allocated in memory contiguously and
+        * without attached headers.
+        * This can be used to create very small allocation classes, but it
+        * does not support type numbers.
+        * Additionally, allocations with this header can only span a single
+        * unit.
+        * Objects allocated with this header do show up when iterating through
+        * the heap using pmemobj_first/pmemobj_next functions, but have a
+        * type_num equal 0.
+        */
+       POBJ_HEADER_NONE,
+
+       MAX_POBJ_HEADER_TYPES
+};
+
+/*
+ * Description of allocation classes
+ */
+struct pobj_alloc_class_desc {
+       /*
+        * The number of bytes in a single unit of allocation. A single
+        * allocation can span up to 64 units (or 1 in the case of no header).
+        * If one creates an allocation class with a certain unit size and
+        * forces it to handle bigger sizes, more than one unit
+        * will be used.
+        * For example, an allocation class with a compact header and 128 bytes
+        * unit size, for a request of 200 bytes will create a memory block
+        * containing 256 bytes that spans two units. The usable size of that
+        * allocation will be 240 bytes: 2 * 128 - 16 (header).
+        */
+       size_t unit_size;
+
+       /*
+        * Desired alignment of objects from the allocation class.
+        * If non zero, must be a power of two and an even divisor of unit size.
+        *
+        * All allocation classes have default alignment
+        * of 64. User data alignment is affected by the size of a header. For
+        * compact one this means that the alignment is 48 bytes.
+        *
+        */
+       size_t alignment;
+
+       /*
+        * The minimum number of units that must be present in a
+        * single, contiguous, memory block.
+        * Those blocks (internally called runs), are fetched on demand from the
+        * heap. Accessing that global state is a serialization point for the
+        * allocator and thus it is imperative for performance and scalability
+        * that a reasonable amount of memory is fetched in a single call.
+        * Threads generally do not share memory blocks from which they
+        * allocate, but blocks do go back to the global heap if they are no
+        * longer actively used for allocation.
+        */
+       unsigned units_per_block;
+
+       /*
+        * The header of allocations that originate from this allocation class.
+        */
+       enum pobj_header_type header_type;
+
+       /*
+        * The identifier of this allocation class.
+        */
+       unsigned class_id;
+};
+
+enum pobj_stats_enabled {
+       POBJ_STATS_ENABLED_TRANSIENT,
+       POBJ_STATS_ENABLED_BOTH,
+       POBJ_STATS_ENABLED_PERSISTENT,
+       POBJ_STATS_DISABLED,
+};
+
+#ifndef _WIN32
+/* EXPERIMENTAL */
+int pmemobj_ctl_get(PMEMobjpool *pop, const char *name, void *arg);
+int pmemobj_ctl_set(PMEMobjpool *pop, const char *name, void *arg);
+int pmemobj_ctl_exec(PMEMobjpool *pop, const char *name, void *arg);
+#else
+int pmemobj_ctl_getU(PMEMobjpool *pop, const char *name, void *arg);
+int pmemobj_ctl_getW(PMEMobjpool *pop, const wchar_t *name, void *arg);
+int pmemobj_ctl_setU(PMEMobjpool *pop, const char *name, void *arg);
+int pmemobj_ctl_setW(PMEMobjpool *pop, const wchar_t *name, void *arg);
+int pmemobj_ctl_execU(PMEMobjpool *pop, const char *name, void *arg);
+int pmemobj_ctl_execW(PMEMobjpool *pop, const wchar_t *name, void *arg);
+
+#ifndef PMDK_UTF8_API
+#define pmemobj_ctl_get pmemobj_ctl_getW
+#define pmemobj_ctl_set pmemobj_ctl_setW
+#define pmemobj_ctl_exec pmemobj_ctl_execW
+#else
+#define pmemobj_ctl_get pmemobj_ctl_getU
+#define pmemobj_ctl_set pmemobj_ctl_setU
+#define pmemobj_ctl_exec pmemobj_ctl_execU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemobj/ctl.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/iterator.h b/ceph/src/pmdk/src/include/libpmemobj/iterator.h
new file mode 100644 (file)
index 0000000..901e3dd
--- /dev/null
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/iterator.h -- definitions of libpmemobj iterator macros
+ */
+
+#ifndef LIBPMEMOBJ_ITERATOR_H
+#define LIBPMEMOBJ_ITERATOR_H 1
+
+#include <libpmemobj/iterator_base.h>
+#include <libpmemobj/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline PMEMoid
+POBJ_FIRST_TYPE_NUM(PMEMobjpool *pop, uint64_t type_num)
+{
+       PMEMoid _pobj_ret = pmemobj_first(pop);
+
+       while (!OID_IS_NULL(_pobj_ret) &&
+                       pmemobj_type_num(_pobj_ret) != type_num) {
+               _pobj_ret = pmemobj_next(_pobj_ret);
+       }
+       return _pobj_ret;
+}
+
+static inline PMEMoid
+POBJ_NEXT_TYPE_NUM(PMEMoid o)
+{
+       PMEMoid _pobj_ret = o;
+
+       do {
+               _pobj_ret = pmemobj_next(_pobj_ret);\
+       } while (!OID_IS_NULL(_pobj_ret) &&
+                       pmemobj_type_num(_pobj_ret) != pmemobj_type_num(o));
+       return _pobj_ret;
+}
+
+#define POBJ_FIRST(pop, t) ((TOID(t))POBJ_FIRST_TYPE_NUM(pop, TOID_TYPE_NUM(t)))
+
+#define POBJ_NEXT(o) ((__typeof__(o))POBJ_NEXT_TYPE_NUM((o).oid))
+
+/*
+ * Iterates through every existing allocated object.
+ */
+#define POBJ_FOREACH(pop, varoid)\
+for (_pobj_debug_notice("POBJ_FOREACH", __FILE__, __LINE__),\
+       varoid = pmemobj_first(pop);\
+               (varoid).off != 0; varoid = pmemobj_next(varoid))
+
+/*
+ * Safe variant of POBJ_FOREACH in which pmemobj_free on varoid is allowed
+ */
+#define POBJ_FOREACH_SAFE(pop, varoid, nvaroid)\
+for (_pobj_debug_notice("POBJ_FOREACH_SAFE", __FILE__, __LINE__),\
+       varoid = pmemobj_first(pop);\
+               (varoid).off != 0 && (nvaroid = pmemobj_next(varoid), 1);\
+               varoid = nvaroid)
+
+/*
+ * Iterates through every object of the specified type.
+ */
+#define POBJ_FOREACH_TYPE(pop, var)\
+POBJ_FOREACH(pop, (var).oid)\
+if (pmemobj_type_num((var).oid) == TOID_TYPE_NUM_OF(var))
+
+/*
+ * Safe variant of POBJ_FOREACH_TYPE in which pmemobj_free on var
+ * is allowed.
+ */
+#define POBJ_FOREACH_SAFE_TYPE(pop, var, nvar)\
+POBJ_FOREACH_SAFE(pop, (var).oid, (nvar).oid)\
+if (pmemobj_type_num((var).oid) == TOID_TYPE_NUM_OF(var))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/iterator.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/iterator_base.h b/ceph/src/pmdk/src/include/libpmemobj/iterator_base.h
new file mode 100644 (file)
index 0000000..76076bc
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/iterator_base.h -- definitions of libpmemobj iterator entry points
+ */
+
+#ifndef LIBPMEMOBJ_ITERATOR_BASE_H
+#define LIBPMEMOBJ_ITERATOR_BASE_H 1
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The following functions allow access to the entire collection of objects.
+ *
+ * Use with conjunction with non-transactional allocations. Pmemobj pool acts
+ * as a generic container (list) of objects that are not assigned to any
+ * user-defined data structures.
+ */
+
+/*
+ * Returns the first object of the specified type number.
+ */
+PMEMoid pmemobj_first(PMEMobjpool *pop);
+
+/*
+ * Returns the next object of the same type.
+ */
+PMEMoid pmemobj_next(PMEMoid oid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/iterator_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/lists_atomic.h b/ceph/src/pmdk/src/include/libpmemobj/lists_atomic.h
new file mode 100644 (file)
index 0000000..8b58f23
--- /dev/null
@@ -0,0 +1,164 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/lists_atomic.h -- definitions of libpmemobj atomic lists macros
+ */
+
+#ifndef LIBPMEMOBJ_LISTS_ATOMIC_H
+#define LIBPMEMOBJ_LISTS_ATOMIC_H 1
+
+#include <libpmemobj/lists_atomic_base.h>
+#include <libpmemobj/thread.h>
+#include <libpmemobj/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Non-transactional persistent atomic circular doubly-linked list
+ */
+#define POBJ_LIST_ENTRY(type)\
+struct {\
+       TOID(type) pe_next;\
+       TOID(type) pe_prev;\
+}
+
+#define POBJ_LIST_HEAD(name, type)\
+struct name {\
+       TOID(type) pe_first;\
+       PMEMmutex lock;\
+}
+
+#define POBJ_LIST_FIRST(head)  ((head)->pe_first)
+#define POBJ_LIST_LAST(head, field) (\
+TOID_IS_NULL((head)->pe_first) ?\
+(head)->pe_first :\
+D_RO((head)->pe_first)->field.pe_prev)
+
+#define POBJ_LIST_EMPTY(head)  (TOID_IS_NULL((head)->pe_first))
+#define POBJ_LIST_NEXT(elm, field)     (D_RO(elm)->field.pe_next)
+#define POBJ_LIST_PREV(elm, field)     (D_RO(elm)->field.pe_prev)
+#define POBJ_LIST_DEST_HEAD    1
+#define POBJ_LIST_DEST_TAIL    0
+#define POBJ_LIST_DEST_BEFORE  1
+#define POBJ_LIST_DEST_AFTER   0
+
+#define POBJ_LIST_FOREACH(var, head, field)\
+for (_pobj_debug_notice("POBJ_LIST_FOREACH", __FILE__, __LINE__),\
+       (var) = POBJ_LIST_FIRST((head));\
+       TOID_IS_NULL((var)) == 0;\
+       TOID_EQUALS(POBJ_LIST_NEXT((var), field),\
+       POBJ_LIST_FIRST((head))) ?\
+       TOID_ASSIGN((var), OID_NULL) :\
+       ((var) = POBJ_LIST_NEXT((var), field)))
+
+#define POBJ_LIST_FOREACH_REVERSE(var, head, field)\
+for (_pobj_debug_notice("POBJ_LIST_FOREACH_REVERSE", __FILE__, __LINE__),\
+       (var) = POBJ_LIST_LAST((head), field);\
+       TOID_IS_NULL((var)) == 0;\
+       TOID_EQUALS(POBJ_LIST_PREV((var), field),\
+       POBJ_LIST_LAST((head), field)) ?\
+       TOID_ASSIGN((var), OID_NULL) :\
+       ((var) = POBJ_LIST_PREV((var), field)))
+
+#define POBJ_LIST_INSERT_HEAD(pop, head, elm, field)\
+pmemobj_list_insert((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), OID_NULL,\
+       POBJ_LIST_DEST_HEAD, (elm).oid)
+
+#define POBJ_LIST_INSERT_TAIL(pop, head, elm, field)\
+pmemobj_list_insert((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), OID_NULL,\
+       POBJ_LIST_DEST_TAIL, (elm).oid)
+
+#define POBJ_LIST_INSERT_AFTER(pop, head, listelm, elm, field)\
+pmemobj_list_insert((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), (listelm).oid,\
+       0 /* after */, (elm).oid)
+
+#define POBJ_LIST_INSERT_BEFORE(pop, head, listelm, elm, field)\
+pmemobj_list_insert((pop), \
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), (listelm).oid,\
+       1 /* before */, (elm).oid)
+
+#define POBJ_LIST_INSERT_NEW_HEAD(pop, head, field, size, constr, arg)\
+pmemobj_list_insert_new((pop),\
+       TOID_OFFSETOF((head)->pe_first, field),\
+       (head), OID_NULL, POBJ_LIST_DEST_HEAD, (size),\
+       TOID_TYPE_NUM_OF((head)->pe_first), (constr), (arg))
+
+#define POBJ_LIST_INSERT_NEW_TAIL(pop, head, field, size, constr, arg)\
+pmemobj_list_insert_new((pop),\
+       TOID_OFFSETOF((head)->pe_first, field),\
+       (head), OID_NULL, POBJ_LIST_DEST_TAIL, (size),\
+       TOID_TYPE_NUM_OF((head)->pe_first), (constr), (arg))
+
+#define POBJ_LIST_INSERT_NEW_AFTER(pop, head, listelm, field, size,\
+       constr, arg)\
+pmemobj_list_insert_new((pop),\
+       TOID_OFFSETOF((head)->pe_first, field),\
+       (head), (listelm).oid, 0 /* after */, (size),\
+       TOID_TYPE_NUM_OF((head)->pe_first), (constr), (arg))
+
+#define POBJ_LIST_INSERT_NEW_BEFORE(pop, head, listelm, field, size,\
+               constr, arg)\
+pmemobj_list_insert_new((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), (listelm).oid, 1 /* before */, (size),\
+       TOID_TYPE_NUM_OF((head)->pe_first), (constr), (arg))
+
+#define POBJ_LIST_REMOVE(pop, head, elm, field)\
+pmemobj_list_remove((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), (elm).oid, 0 /* no free */)
+
+#define POBJ_LIST_REMOVE_FREE(pop, head, elm, field)\
+pmemobj_list_remove((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head), (elm).oid, 1 /* free */)
+
+#define POBJ_LIST_MOVE_ELEMENT_HEAD(pop, head, head_new, elm, field, field_new)\
+pmemobj_list_move((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head_new), field_new),\
+       (head_new), OID_NULL, POBJ_LIST_DEST_HEAD, (elm).oid)
+
+#define POBJ_LIST_MOVE_ELEMENT_TAIL(pop, head, head_new, elm, field, field_new)\
+pmemobj_list_move((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head_new), field_new),\
+       (head_new), OID_NULL, POBJ_LIST_DEST_TAIL, (elm).oid)
+
+#define POBJ_LIST_MOVE_ELEMENT_AFTER(pop,\
+       head, head_new, listelm, elm, field, field_new)\
+pmemobj_list_move((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head_new), field_new),\
+       (head_new),\
+       (listelm).oid,\
+       0 /* after */, (elm).oid)
+
+#define POBJ_LIST_MOVE_ELEMENT_BEFORE(pop,\
+       head, head_new, listelm, elm, field, field_new)\
+pmemobj_list_move((pop),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head), field),\
+       (head),\
+       TOID_OFFSETOF(POBJ_LIST_FIRST(head_new), field_new),\
+       (head_new),\
+       (listelm).oid,\
+       1 /* before */, (elm).oid)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/lists_atomic.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/lists_atomic_base.h b/ceph/src/pmdk/src/include/libpmemobj/lists_atomic_base.h
new file mode 100644 (file)
index 0000000..be80d1d
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/lists_atomic_base.h -- definitions of libpmemobj atomic lists
+ */
+
+#ifndef LIBPMEMOBJ_LISTS_ATOMIC_BASE_H
+#define LIBPMEMOBJ_LISTS_ATOMIC_BASE_H 1
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Non-transactional persistent atomic circular doubly-linked list
+ */
+
+int pmemobj_list_insert(PMEMobjpool *pop, size_t pe_offset, void *head,
+       PMEMoid dest, int before, PMEMoid oid);
+
+PMEMoid pmemobj_list_insert_new(PMEMobjpool *pop, size_t pe_offset, void *head,
+       PMEMoid dest, int before, size_t size, uint64_t type_num,
+       pmemobj_constr constructor, void *arg);
+
+int pmemobj_list_remove(PMEMobjpool *pop, size_t pe_offset, void *head,
+       PMEMoid oid, int free);
+
+int pmemobj_list_move(PMEMobjpool *pop, size_t pe_old_offset,
+       void *head_old, size_t pe_new_offset, void *head_new,
+       PMEMoid dest, int before, PMEMoid oid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/lists_atomic_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/pool.h b/ceph/src/pmdk/src/include/libpmemobj/pool.h
new file mode 100644 (file)
index 0000000..95d3968
--- /dev/null
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/pool.h -- definitions of libpmemobj pool macros
+ */
+
+#ifndef LIBPMEMOBJ_POOL_H
+#define LIBPMEMOBJ_POOL_H 1
+
+#include <libpmemobj/pool_base.h>
+#include <libpmemobj/types.h>
+
+#define POBJ_ROOT(pop, t) (\
+(TOID(t))pmemobj_root((pop), sizeof(t)))
+
+#endif /* libpmemobj/pool.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/pool_base.h b/ceph/src/pmdk/src/include/libpmemobj/pool_base.h
new file mode 100644 (file)
index 0000000..303e69f
--- /dev/null
@@ -0,0 +1,105 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/pool_base.h -- definitions of libpmemobj pool entry points
+ */
+
+#ifndef LIBPMEMOBJ_POOL_BASE_H
+#define LIBPMEMOBJ_POOL_BASE_H 1
+
+#include <stddef.h>
+#include <sys/types.h>
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PMEMOBJ_MIN_POOL ((size_t)(1024 * 1024 * 8)) /* 8 MiB */
+
+/*
+ * This limit is set arbitrary to incorporate a pool header and required
+ * alignment plus supply.
+ */
+#define PMEMOBJ_MIN_PART ((size_t)(1024 * 1024 * 2)) /* 2 MiB */
+
+/*
+ * Pool management.
+ */
+#ifdef _WIN32
+#ifndef PMDK_UTF8_API
+#define pmemobj_open pmemobj_openW
+#define pmemobj_create pmemobj_createW
+#define pmemobj_check pmemobj_checkW
+#else
+#define pmemobj_open pmemobj_openU
+#define pmemobj_create pmemobj_createU
+#define pmemobj_check pmemobj_checkU
+#endif
+#endif
+
+#ifndef _WIN32
+PMEMobjpool *pmemobj_open(const char *path, const char *layout);
+#else
+PMEMobjpool *pmemobj_openU(const char *path, const char *layout);
+PMEMobjpool *pmemobj_openW(const wchar_t *path, const wchar_t *layout);
+#endif
+
+#ifndef _WIN32
+PMEMobjpool *pmemobj_create(const char *path, const char *layout,
+       size_t poolsize, mode_t mode);
+#else
+PMEMobjpool *pmemobj_createU(const char *path, const char *layout,
+       size_t poolsize, mode_t mode);
+PMEMobjpool *pmemobj_createW(const wchar_t *path, const wchar_t *layout,
+       size_t poolsize, mode_t mode);
+#endif
+
+#ifndef _WIN32
+int pmemobj_check(const char *path, const char *layout);
+#else
+int pmemobj_checkU(const char *path, const char *layout);
+int pmemobj_checkW(const wchar_t *path, const wchar_t *layout);
+#endif
+
+void pmemobj_close(PMEMobjpool *pop);
+/*
+ * If called for the first time on a newly created pool, the root object
+ * of given size is allocated.  Otherwise, it returns the existing root object.
+ * In such case, the size must be not less than the actual root object size
+ * stored in the pool.  If it's larger, the root object is automatically
+ * resized.
+ *
+ * This function is thread-safe.
+ */
+PMEMoid pmemobj_root(PMEMobjpool *pop, size_t size);
+
+/*
+ * Same as above, but calls the constructor function when the object is first
+ * created and on all subsequent reallocations.
+ */
+PMEMoid pmemobj_root_construct(PMEMobjpool *pop, size_t size,
+       pmemobj_constr constructor, void *arg);
+
+/*
+ * Returns the size in bytes of the root object. Always equal to the requested
+ * size.
+ */
+size_t pmemobj_root_size(PMEMobjpool *pop);
+
+/*
+ * Sets volatile pointer to the user data for specified pool.
+ */
+void pmemobj_set_user_data(PMEMobjpool *pop, void *data);
+
+/*
+ * Gets volatile pointer to the user data associated with the specified pool.
+ */
+void *pmemobj_get_user_data(PMEMobjpool *pop);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemobj/pool_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/thread.h b/ceph/src/pmdk/src/include/libpmemobj/thread.h
new file mode 100644 (file)
index 0000000..23bc470
--- /dev/null
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/thread.h -- definitions of libpmemobj thread/locking entry points
+ */
+
+#ifndef LIBPMEMOBJ_THREAD_H
+#define LIBPMEMOBJ_THREAD_H 1
+
+#include <time.h>
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Locking.
+ */
+#define _POBJ_CL_SIZE 64 /* cache line size */
+
+typedef union {
+       long long align;
+       char padding[_POBJ_CL_SIZE];
+} PMEMmutex;
+
+typedef union {
+       long long align;
+       char padding[_POBJ_CL_SIZE];
+} PMEMrwlock;
+
+typedef union {
+       long long align;
+       char padding[_POBJ_CL_SIZE];
+} PMEMcond;
+
+void pmemobj_mutex_zero(PMEMobjpool *pop, PMEMmutex *mutexp);
+int pmemobj_mutex_lock(PMEMobjpool *pop, PMEMmutex *mutexp);
+int pmemobj_mutex_timedlock(PMEMobjpool *pop, PMEMmutex *__restrict mutexp,
+       const struct timespec *__restrict abs_timeout);
+int pmemobj_mutex_trylock(PMEMobjpool *pop, PMEMmutex *mutexp);
+int pmemobj_mutex_unlock(PMEMobjpool *pop, PMEMmutex *mutexp);
+
+void pmemobj_rwlock_zero(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+int pmemobj_rwlock_rdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+int pmemobj_rwlock_wrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+int pmemobj_rwlock_timedrdlock(PMEMobjpool *pop,
+       PMEMrwlock *__restrict rwlockp,
+       const struct timespec *__restrict abs_timeout);
+int pmemobj_rwlock_timedwrlock(PMEMobjpool *pop,
+       PMEMrwlock *__restrict rwlockp,
+       const struct timespec *__restrict abs_timeout);
+int pmemobj_rwlock_tryrdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+int pmemobj_rwlock_trywrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+int pmemobj_rwlock_unlock(PMEMobjpool *pop, PMEMrwlock *rwlockp);
+
+void pmemobj_cond_zero(PMEMobjpool *pop, PMEMcond *condp);
+int pmemobj_cond_broadcast(PMEMobjpool *pop, PMEMcond *condp);
+int pmemobj_cond_signal(PMEMobjpool *pop, PMEMcond *condp);
+int pmemobj_cond_timedwait(PMEMobjpool *pop, PMEMcond *__restrict condp,
+       PMEMmutex *__restrict mutexp,
+       const struct timespec *__restrict abs_timeout);
+int pmemobj_cond_wait(PMEMobjpool *pop, PMEMcond *condp,
+       PMEMmutex *__restrict mutexp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/thread.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/tx.h b/ceph/src/pmdk/src/include/libpmemobj/tx.h
new file mode 100644 (file)
index 0000000..ab95803
--- /dev/null
@@ -0,0 +1,185 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/tx.h -- definitions of libpmemobj transactional macros
+ */
+
+#ifndef LIBPMEMOBJ_TX_H
+#define LIBPMEMOBJ_TX_H 1
+
+#include <errno.h>
+#include <string.h>
+
+#include <libpmemobj/tx_base.h>
+#include <libpmemobj/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef POBJ_TX_CRASH_ON_NO_ONABORT
+#define TX_ONABORT_CHECK do {\
+               if (_stage == TX_STAGE_ONABORT)\
+                       abort();\
+       } while (0)
+#else
+#define TX_ONABORT_CHECK do {} while (0)
+#endif
+
+#define _POBJ_TX_BEGIN(pop, ...)\
+{\
+       jmp_buf _tx_env;\
+       enum pobj_tx_stage _stage;\
+       int _pobj_errno;\
+       if (setjmp(_tx_env)) {\
+               errno = pmemobj_tx_errno();\
+       } else {\
+               _pobj_errno = pmemobj_tx_begin(pop, _tx_env, __VA_ARGS__,\
+                               TX_PARAM_NONE);\
+               if (_pobj_errno)\
+                       errno = _pobj_errno;\
+       }\
+       while ((_stage = pmemobj_tx_stage()) != TX_STAGE_NONE) {\
+               switch (_stage) {\
+                       case TX_STAGE_WORK:
+
+#define TX_BEGIN_PARAM(pop, ...)\
+_POBJ_TX_BEGIN(pop, ##__VA_ARGS__)
+
+#define TX_BEGIN_LOCK TX_BEGIN_PARAM
+
+/* Just to let compiler warn when incompatible function pointer is used */
+static inline pmemobj_tx_callback
+_pobj_validate_cb_sig(pmemobj_tx_callback cb)
+{
+       return cb;
+}
+
+#define TX_BEGIN_CB(pop, cb, arg, ...) _POBJ_TX_BEGIN(pop, TX_PARAM_CB,\
+               _pobj_validate_cb_sig(cb), arg, ##__VA_ARGS__)
+
+#define TX_BEGIN(pop) _POBJ_TX_BEGIN(pop, TX_PARAM_NONE)
+
+#define TX_ONABORT\
+                               pmemobj_tx_process();\
+                               break;\
+                       case TX_STAGE_ONABORT:
+
+#define TX_ONCOMMIT\
+                               pmemobj_tx_process();\
+                               break;\
+                       case TX_STAGE_ONCOMMIT:
+
+#define TX_FINALLY\
+                               pmemobj_tx_process();\
+                               break;\
+                       case TX_STAGE_FINALLY:
+
+#define TX_END\
+                               pmemobj_tx_process();\
+                               break;\
+                       default:\
+                               TX_ONABORT_CHECK;\
+                               pmemobj_tx_process();\
+                               break;\
+               }\
+       }\
+       _pobj_errno = pmemobj_tx_end();\
+       if (_pobj_errno)\
+               errno = _pobj_errno;\
+}
+
+#define TX_ADD(o)\
+pmemobj_tx_add_range((o).oid, 0, sizeof(*(o)._type))
+
+#define TX_ADD_FIELD(o, field)\
+       TX_ADD_DIRECT(&(D_RO(o)->field))
+
+#define TX_ADD_DIRECT(p)\
+pmemobj_tx_add_range_direct(p, sizeof(*(p)))
+
+#define TX_ADD_FIELD_DIRECT(p, field)\
+pmemobj_tx_add_range_direct(&(p)->field, sizeof((p)->field))
+
+#define TX_XADD(o, flags)\
+pmemobj_tx_xadd_range((o).oid, 0, sizeof(*(o)._type), flags)
+
+#define TX_XADD_FIELD(o, field, flags)\
+       TX_XADD_DIRECT(&(D_RO(o)->field), flags)
+
+#define TX_XADD_DIRECT(p, flags)\
+pmemobj_tx_xadd_range_direct(p, sizeof(*(p)), flags)
+
+#define TX_XADD_FIELD_DIRECT(p, field, flags)\
+pmemobj_tx_xadd_range_direct(&(p)->field, sizeof((p)->field), flags)
+
+#define TX_NEW(t)\
+((TOID(t))pmemobj_tx_alloc(sizeof(t), TOID_TYPE_NUM(t)))
+
+#define TX_ALLOC(t, size)\
+((TOID(t))pmemobj_tx_alloc(size, TOID_TYPE_NUM(t)))
+
+#define TX_ZNEW(t)\
+((TOID(t))pmemobj_tx_zalloc(sizeof(t), TOID_TYPE_NUM(t)))
+
+#define TX_ZALLOC(t, size)\
+((TOID(t))pmemobj_tx_zalloc(size, TOID_TYPE_NUM(t)))
+
+#define TX_XALLOC(t, size, flags)\
+((TOID(t))pmemobj_tx_xalloc(size, TOID_TYPE_NUM(t), flags))
+
+/* XXX - not available when compiled with VC++ as C code (/TC) */
+#if !defined(_MSC_VER) || defined(__cplusplus)
+#define TX_REALLOC(o, size)\
+((__typeof__(o))pmemobj_tx_realloc((o).oid, size, TOID_TYPE_NUM_OF(o)))
+
+#define TX_ZREALLOC(o, size)\
+((__typeof__(o))pmemobj_tx_zrealloc((o).oid, size, TOID_TYPE_NUM_OF(o)))
+#endif /* !defined(_MSC_VER) || defined(__cplusplus) */
+
+#define TX_STRDUP(s, type_num)\
+pmemobj_tx_strdup(s, type_num)
+
+#define TX_XSTRDUP(s, type_num, flags)\
+pmemobj_tx_xstrdup(s, type_num, flags)
+
+#define TX_WCSDUP(s, type_num)\
+pmemobj_tx_wcsdup(s, type_num)
+
+#define TX_XWCSDUP(s, type_num, flags)\
+pmemobj_tx_xwcsdup(s, type_num, flags)
+
+#define TX_FREE(o)\
+pmemobj_tx_free((o).oid)
+
+#define TX_XFREE(o, flags)\
+pmemobj_tx_xfree((o).oid, flags)
+
+#define TX_SET(o, field, value) (\
+       TX_ADD_FIELD(o, field),\
+       D_RW(o)->field = (value))
+
+#define TX_SET_DIRECT(p, field, value) (\
+       TX_ADD_FIELD_DIRECT(p, field),\
+       (p)->field = (value))
+
+static inline void *
+TX_MEMCPY(void *dest, const void *src, size_t num)
+{
+       pmemobj_tx_add_range_direct(dest, num);
+       return memcpy(dest, src, num);
+}
+
+static inline void *
+TX_MEMSET(void *dest, int c, size_t num)
+{
+       pmemobj_tx_add_range_direct(dest, num);
+       return memset(dest, c, num);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/tx.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/tx_base.h b/ceph/src/pmdk/src/include/libpmemobj/tx_base.h
new file mode 100644 (file)
index 0000000..3bb8032
--- /dev/null
@@ -0,0 +1,450 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/tx_base.h -- definitions of libpmemobj transactional entry points
+ */
+
+#ifndef LIBPMEMOBJ_TX_BASE_H
+#define LIBPMEMOBJ_TX_BASE_H 1
+
+#include <setjmp.h>
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Transactions
+ *
+ * Stages are changed only by the pmemobj_tx_* functions, each transition
+ * to the TX_STAGE_ONABORT is followed by a longjmp to the jmp_buf provided in
+ * the pmemobj_tx_begin function.
+ */
+enum pobj_tx_stage {
+       TX_STAGE_NONE,          /* no transaction in this thread */
+       TX_STAGE_WORK,          /* transaction in progress */
+       TX_STAGE_ONCOMMIT,      /* successfully committed */
+       TX_STAGE_ONABORT,       /* tx_begin failed or transaction aborted */
+       TX_STAGE_FINALLY,       /* always called */
+
+       MAX_TX_STAGE
+};
+
+/*
+ * Always returns the current transaction stage for a thread.
+ */
+enum pobj_tx_stage pmemobj_tx_stage(void);
+
+enum pobj_tx_param {
+       TX_PARAM_NONE,
+       TX_PARAM_MUTEX,  /* PMEMmutex */
+       TX_PARAM_RWLOCK, /* PMEMrwlock */
+       TX_PARAM_CB,     /* pmemobj_tx_callback cb, void *arg */
+};
+
+enum pobj_log_type {
+       TX_LOG_TYPE_SNAPSHOT,
+       TX_LOG_TYPE_INTENT,
+};
+
+enum pobj_tx_failure_behavior {
+       POBJ_TX_FAILURE_ABORT,
+       POBJ_TX_FAILURE_RETURN,
+};
+
+#if !defined(pmdk_use_attr_deprec_with_msg) && defined(__COVERITY__)
+#define pmdk_use_attr_deprec_with_msg 0
+#endif
+
+#if !defined(pmdk_use_attr_deprec_with_msg) && defined(__clang__)
+#if __has_extension(attribute_deprecated_with_message)
+#define pmdk_use_attr_deprec_with_msg 1
+#else
+#define pmdk_use_attr_deprec_with_msg 0
+#endif
+#endif
+
+#if !defined(pmdk_use_attr_deprec_with_msg) && \
+               defined(__GNUC__) && !defined(__INTEL_COMPILER)
+#if __GNUC__ * 100 + __GNUC_MINOR__ >= 601 /* 6.1 */
+#define pmdk_use_attr_deprec_with_msg 1
+#else
+#define pmdk_use_attr_deprec_with_msg 0
+#endif
+#endif
+
+#if !defined(pmdk_use_attr_deprec_with_msg)
+#define pmdk_use_attr_deprec_with_msg 0
+#endif
+
+#if pmdk_use_attr_deprec_with_msg
+#define tx_lock_deprecated __attribute__((deprecated(\
+               "enum pobj_tx_lock is deprecated, use enum pobj_tx_param")))
+#else
+#define tx_lock_deprecated
+#endif
+
+/* deprecated, do not use */
+enum tx_lock_deprecated pobj_tx_lock {
+       TX_LOCK_NONE   tx_lock_deprecated = TX_PARAM_NONE,
+       TX_LOCK_MUTEX  tx_lock_deprecated = TX_PARAM_MUTEX,
+       TX_LOCK_RWLOCK tx_lock_deprecated = TX_PARAM_RWLOCK,
+};
+
+typedef void (*pmemobj_tx_callback)(PMEMobjpool *pop, enum pobj_tx_stage stage,
+               void *);
+
+#define POBJ_TX_XALLOC_VALID_FLAGS     (POBJ_XALLOC_ZERO |\
+       POBJ_XALLOC_NO_FLUSH |\
+       POBJ_XALLOC_ARENA_MASK |\
+       POBJ_XALLOC_CLASS_MASK |\
+       POBJ_XALLOC_NO_ABORT)
+
+#define POBJ_XADD_NO_FLUSH             POBJ_FLAG_NO_FLUSH
+#define POBJ_XADD_NO_SNAPSHOT          POBJ_FLAG_NO_SNAPSHOT
+#define POBJ_XADD_ASSUME_INITIALIZED   POBJ_FLAG_ASSUME_INITIALIZED
+#define POBJ_XADD_NO_ABORT             POBJ_FLAG_TX_NO_ABORT
+#define POBJ_XADD_VALID_FLAGS  (POBJ_XADD_NO_FLUSH |\
+       POBJ_XADD_NO_SNAPSHOT |\
+       POBJ_XADD_ASSUME_INITIALIZED |\
+       POBJ_XADD_NO_ABORT)
+
+#define POBJ_XLOCK_NO_ABORT            POBJ_FLAG_TX_NO_ABORT
+#define POBJ_XLOCK_VALID_FLAGS (POBJ_XLOCK_NO_ABORT)
+
+#define POBJ_XFREE_NO_ABORT            POBJ_FLAG_TX_NO_ABORT
+#define POBJ_XFREE_VALID_FLAGS (POBJ_XFREE_NO_ABORT)
+
+#define POBJ_XPUBLISH_NO_ABORT         POBJ_FLAG_TX_NO_ABORT
+#define POBJ_XPUBLISH_VALID_FLAGS      (POBJ_XPUBLISH_NO_ABORT)
+
+#define POBJ_XLOG_APPEND_BUFFER_NO_ABORT       POBJ_FLAG_TX_NO_ABORT
+#define POBJ_XLOG_APPEND_BUFFER_VALID_FLAGS (POBJ_XLOG_APPEND_BUFFER_NO_ABORT)
+/*
+ * Starts a new transaction in the current thread.
+ * If called within an open transaction, starts a nested transaction.
+ *
+ * If successful, transaction stage changes to TX_STAGE_WORK and function
+ * returns zero. Otherwise, stage changes to TX_STAGE_ONABORT and an error
+ * number is returned.
+ */
+int pmemobj_tx_begin(PMEMobjpool *pop, jmp_buf env, ...);
+
+/*
+ * Adds lock of given type to current transaction.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XLOCK_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ */
+int pmemobj_tx_xlock(enum pobj_tx_param type, void *lockp, uint64_t flags);
+
+/*
+ * Adds lock of given type to current transaction.
+ */
+int pmemobj_tx_lock(enum pobj_tx_param type, void *lockp);
+
+/*
+ * Aborts current transaction
+ *
+ * Causes transition to TX_STAGE_ONABORT.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+void pmemobj_tx_abort(int errnum);
+
+/*
+ * Commits current transaction
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+void pmemobj_tx_commit(void);
+
+/*
+ * Cleanups current transaction. Must always be called after pmemobj_tx_begin,
+ * even if starting the transaction failed.
+ *
+ * If called during TX_STAGE_NONE, has no effect.
+ *
+ * Always causes transition to TX_STAGE_NONE.
+ *
+ * If transaction was successful, returns 0. Otherwise returns error code set
+ * by pmemobj_tx_abort.
+ *
+ * This function must *not* be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_end(void);
+
+/*
+ * Performs the actions associated with current stage of the transaction,
+ * and makes the transition to the next stage. Current stage must always
+ * be obtained by calling pmemobj_tx_stage.
+ *
+ * This function must be called in transaction.
+ */
+void pmemobj_tx_process(void);
+
+/*
+ * Returns last transaction error code.
+ */
+int pmemobj_tx_errno(void);
+
+/*
+ * Takes a "snapshot" of the memory block of given size and located at given
+ * offset 'off' in the object 'oid' and saves it in the undo log.
+ * The application is then free to directly modify the object in that memory
+ * range. In case of failure or abort, all the changes within this range will
+ * be rolled-back automatically.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_add_range(PMEMoid oid, uint64_t off, size_t size);
+
+/*
+ * Takes a "snapshot" of the given memory region and saves it in the undo log.
+ * The application is then free to directly modify the object in that memory
+ * range. In case of failure or abort, all the changes within this range will
+ * be rolled-back automatically. The supplied block of memory has to be within
+ * the given pool.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_add_range_direct(const void *ptr, size_t size);
+
+/*
+ * Behaves exactly the same as pmemobj_tx_add_range when 'flags' equals 0.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XADD_NO_FLUSH - skips flush on commit
+ *  - POBJ_XADD_NO_SNAPSHOT - added range will not be snapshotted
+ *  - POBJ_XADD_ASSUME_INITIALIZED - added range is assumed to be initialized
+ *  - POBJ_XADD_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ */
+int pmemobj_tx_xadd_range(PMEMoid oid, uint64_t off, size_t size,
+               uint64_t flags);
+
+/*
+ * Behaves exactly the same as pmemobj_tx_add_range_direct when 'flags' equals
+ * 0. 'Flags' is a bitmask of the following values:
+ *  - POBJ_XADD_NO_FLUSH - skips flush on commit
+ *  - POBJ_XADD_NO_SNAPSHOT - added range will not be snapshotted
+ *  - POBJ_XADD_ASSUME_INITIALIZED - added range is assumed to be initialized
+ *  - POBJ_XADD_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ */
+int pmemobj_tx_xadd_range_direct(const void *ptr, size_t size, uint64_t flags);
+
+/*
+ * Transactionally allocates a new object.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_alloc(size_t size, uint64_t type_num);
+
+/*
+ * Transactionally allocates a new object.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XALLOC_ZERO - zero the allocated object
+ *  - POBJ_XALLOC_NO_FLUSH - skip flush on commit
+ *  - POBJ_XALLOC_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_xalloc(size_t size, uint64_t type_num, uint64_t flags);
+
+/*
+ * Transactionally allocates new zeroed object.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_zalloc(size_t size, uint64_t type_num);
+
+/*
+ * Transactionally resizes an existing object.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_realloc(PMEMoid oid, size_t size, uint64_t type_num);
+
+/*
+ * Transactionally resizes an existing object, if extended new space is zeroed.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_zrealloc(PMEMoid oid, size_t size, uint64_t type_num);
+
+/*
+ * Transactionally allocates a new object with duplicate of the string s.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_strdup(const char *s, uint64_t type_num);
+
+/*
+ * Transactionally allocates a new object with duplicate of the string s.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XALLOC_ZERO - zero the allocated object
+ *  - POBJ_XALLOC_NO_FLUSH - skip flush on commit
+ *  - POBJ_XALLOC_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_xstrdup(const char *s, uint64_t type_num, uint64_t flags);
+
+/*
+ * Transactionally allocates a new object with duplicate of the wide character
+ * string s.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_wcsdup(const wchar_t *s, uint64_t type_num);
+
+/*
+ * Transactionally allocates a new object with duplicate of the wide character
+ * string s.
+ *
+ * If successful, returns PMEMoid.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an OID_NULL is returned.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XALLOC_ZERO - zero the allocated object
+ *  - POBJ_XALLOC_NO_FLUSH - skip flush on commit
+ *  - POBJ_XALLOC_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+PMEMoid pmemobj_tx_xwcsdup(const wchar_t *s, uint64_t type_num, uint64_t flags);
+
+/*
+ * Transactionally frees an existing object.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_free(PMEMoid oid);
+
+/*
+ * Transactionally frees an existing object.
+ *
+ * If successful, returns zero.
+ * Otherwise, the stage changes to TX_STAGE_ONABORT and the error number is
+ * returned.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XFREE_NO_ABORT - if the function does not end successfully,
+ *  do not abort the transaction and return the error number.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_xfree(PMEMoid oid, uint64_t flags);
+
+/*
+ * Append user allocated buffer to the ulog.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_log_append_buffer(enum pobj_log_type type,
+       void *addr, size_t size);
+
+/*
+ * Append user allocated buffer to the ulog.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ * 'Flags' is a bitmask of the following values:
+ *  - POBJ_XLOG_APPEND_BUFFER_NO_ABORT - if the function does not end
+ *  successfully, do not abort the transaction and return the error number.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_xlog_append_buffer(enum pobj_log_type type,
+       void *addr, size_t size, uint64_t flags);
+
+/*
+ * Enables or disables automatic ulog allocations.
+ *
+ * If successful, returns zero.
+ * Otherwise, stage changes to TX_STAGE_ONABORT and an error number is returned.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+int pmemobj_tx_log_auto_alloc(enum pobj_log_type type, int on_off);
+
+/*
+ * Calculates and returns size for user buffers for snapshots.
+ */
+size_t pmemobj_tx_log_snapshots_max_size(size_t *sizes, size_t nsizes);
+
+/*
+ * Calculates and returns size for user buffers for intents.
+ */
+size_t pmemobj_tx_log_intents_max_size(size_t nintents);
+
+/*
+ * Sets volatile pointer to the user data for the current transaction.
+ */
+void pmemobj_tx_set_user_data(void *data);
+
+/*
+ * Gets volatile pointer to the user data associated with the current
+ * transaction.
+ */
+void *pmemobj_tx_get_user_data(void);
+
+/*
+ * Sets the failure behavior of transactional functions.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+void pmemobj_tx_set_failure_behavior(enum pobj_tx_failure_behavior behavior);
+
+/*
+ * Returns failure behavior for the current transaction.
+ *
+ * This function must be called during TX_STAGE_WORK.
+ */
+enum pobj_tx_failure_behavior pmemobj_tx_get_failure_behavior(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libpmemobj/tx_base.h */
diff --git a/ceph/src/pmdk/src/include/libpmemobj/types.h b/ceph/src/pmdk/src/include/libpmemobj/types.h
new file mode 100644 (file)
index 0000000..76658c5
--- /dev/null
@@ -0,0 +1,205 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * libpmemobj/types.h -- definitions of libpmemobj type-safe macros
+ */
+#ifndef LIBPMEMOBJ_TYPES_H
+#define LIBPMEMOBJ_TYPES_H 1
+
+#include <libpmemobj/base.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TOID_NULL(t)   ((TOID(t))OID_NULL)
+#define PMEMOBJ_MAX_LAYOUT ((size_t)1024)
+
+/*
+ * Type safety macros
+ */
+#if !(defined _MSC_VER || defined __clang__)
+
+#define TOID_ASSIGN(o, value)(\
+{\
+       (o).oid = value;\
+       (o); /* to avoid "error: statement with no effect" */\
+})
+
+#else /* _MSC_VER or __clang__ */
+
+#define TOID_ASSIGN(o, value) ((o).oid = value, (o))
+
+#endif
+
+#if (defined _MSC_VER && _MSC_VER < 1912)
+/*
+ * XXX - workaround for offsetof issue in VS 15.3,
+ *       it has been fixed since Visual Studio 2017 Version 15.5
+ *       (_MSC_VER == 1912)
+ */
+#ifdef PMEMOBJ_OFFSETOF_WA
+#ifdef _CRT_USE_BUILTIN_OFFSETOF
+#undef offsetof
+#define offsetof(s, m) ((size_t)&reinterpret_cast < char const volatile& > \
+((((s *)0)->m)))
+#endif
+#else
+#ifdef _CRT_USE_BUILTIN_OFFSETOF
+#error "Invalid definition of offsetof() macro - see: \
+https://developercommunity.visualstudio.com/content/problem/96174/\
+offsetof-macro-is-broken-for-nested-objects.html \
+Please upgrade your VS, fix offsetof as described under the link or define \
+PMEMOBJ_OFFSETOF_WA to enable workaround in libpmemobj.h"
+#endif
+#endif
+
+#endif /* _MSC_VER */
+
+#define TOID_EQUALS(lhs, rhs)\
+((lhs).oid.off == (rhs).oid.off &&\
+       (lhs).oid.pool_uuid_lo == (rhs).oid.pool_uuid_lo)
+
+/* type number of root object */
+#define POBJ_ROOT_TYPE_NUM 0
+#define _toid_struct
+#define _toid_union
+#define _toid_enum
+#define _POBJ_LAYOUT_REF(name) (sizeof(_pobj_layout_##name##_ref))
+
+/*
+ * Typed OID
+ */
+#define TOID(t)\
+union _toid_##t##_toid
+
+#ifdef __cplusplus
+#define _TOID_CONSTR(t)\
+_toid_##t##_toid()\
+{ }\
+_toid_##t##_toid(PMEMoid _oid) : oid(_oid)\
+{ }
+#else
+#define _TOID_CONSTR(t)
+#endif
+
+/*
+ * Declaration of typed OID
+ */
+#define _TOID_DECLARE(t, i)\
+typedef uint8_t _toid_##t##_toid_type_num[(i) + 1];\
+TOID(t)\
+{\
+       _TOID_CONSTR(t)\
+       PMEMoid oid;\
+       t *_type;\
+       _toid_##t##_toid_type_num *_type_num;\
+}
+
+/*
+ * Declaration of typed OID of an object
+ */
+#define TOID_DECLARE(t, i) _TOID_DECLARE(t, i)
+
+/*
+ * Declaration of typed OID of a root object
+ */
+#define TOID_DECLARE_ROOT(t) _TOID_DECLARE(t, POBJ_ROOT_TYPE_NUM)
+
+/*
+ * Type number of specified type
+ */
+#define TOID_TYPE_NUM(t) (sizeof(_toid_##t##_toid_type_num) - 1)
+
+/*
+ * Type number of object read from typed OID
+ */
+#define TOID_TYPE_NUM_OF(o) (sizeof(*(o)._type_num) - 1)
+
+/*
+ * NULL check
+ */
+#define TOID_IS_NULL(o)        ((o).oid.off == 0)
+
+/*
+ * Validates whether type number stored in typed OID is the same
+ * as type number stored in object's metadata
+ */
+#define TOID_VALID(o) (TOID_TYPE_NUM_OF(o) == pmemobj_type_num((o).oid))
+
+/*
+ * Checks whether the object is of a given type
+ */
+#define OID_INSTANCEOF(o, t) (TOID_TYPE_NUM(t) == pmemobj_type_num(o))
+
+/*
+ * Begin of layout declaration
+ */
+#define POBJ_LAYOUT_BEGIN(name)\
+typedef uint8_t _pobj_layout_##name##_ref[__COUNTER__ + 1]
+
+/*
+ * End of layout declaration
+ */
+#define POBJ_LAYOUT_END(name)\
+typedef char _pobj_layout_##name##_cnt[__COUNTER__ + 1 -\
+_POBJ_LAYOUT_REF(name)];
+
+/*
+ * Number of types declared inside layout without the root object
+ */
+#define POBJ_LAYOUT_TYPES_NUM(name) (sizeof(_pobj_layout_##name##_cnt) - 1)
+
+/*
+ * Declaration of typed OID inside layout declaration
+ */
+#define POBJ_LAYOUT_TOID(name, t)\
+TOID_DECLARE(t, (__COUNTER__ + 1 - _POBJ_LAYOUT_REF(name)));
+
+/*
+ * Declaration of typed OID of root inside layout declaration
+ */
+#define POBJ_LAYOUT_ROOT(name, t)\
+TOID_DECLARE_ROOT(t);
+
+/*
+ * Name of declared layout
+ */
+#define POBJ_LAYOUT_NAME(name) #name
+
+#define TOID_TYPEOF(o) __typeof__(*(o)._type)
+
+#define TOID_OFFSETOF(o, field) offsetof(TOID_TYPEOF(o), field)
+
+/*
+ * XXX - DIRECT_RW and DIRECT_RO are not available when compiled using VC++
+ *       as C code (/TC).  Use /TP option.
+ */
+#ifndef _MSC_VER
+
+#define DIRECT_RW(o) (\
+{__typeof__(o) _o; _o._type = NULL; (void)_o;\
+(__typeof__(*(o)._type) *)pmemobj_direct((o).oid); })
+#define DIRECT_RO(o) ((const __typeof__(*(o)._type) *)pmemobj_direct((o).oid))
+
+#elif defined(__cplusplus)
+
+/*
+ * XXX - On Windows, these macros do not behave exactly the same as on Linux.
+ */
+#define DIRECT_RW(o) \
+       (reinterpret_cast < __typeof__((o)._type) > (pmemobj_direct((o).oid)))
+#define DIRECT_RO(o) \
+       (reinterpret_cast < const __typeof__((o)._type) > \
+       (pmemobj_direct((o).oid)))
+
+#endif /* (defined(_MSC_VER) || defined(__cplusplus)) */
+
+#define D_RW   DIRECT_RW
+#define D_RO   DIRECT_RO
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmemobj/types.h */
diff --git a/ceph/src/pmdk/src/include/libpmempool.h b/ceph/src/pmdk/src/include/libpmempool.h
new file mode 100644 (file)
index 0000000..87f3b4e
--- /dev/null
@@ -0,0 +1,334 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * libpmempool.h -- definitions of libpmempool entry points
+ *
+ * See libpmempool(7) for details.
+ */
+
+#ifndef LIBPMEMPOOL_H
+#define LIBPMEMPOOL_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+#include <limits.h>
+
+#ifdef _WIN32
+#include <pmemcompat.h>
+
+#ifndef PMDK_UTF8_API
+#define pmempool_check_status pmempool_check_statusW
+#define pmempool_check_args pmempool_check_argsW
+
+#define pmempool_check_init pmempool_check_initW
+#define pmempool_check pmempool_checkW
+#define pmempool_sync pmempool_syncW
+#define pmempool_transform pmempool_transformW
+#define pmempool_rm pmempool_rmW
+#define pmempool_check_version pmempool_check_versionW
+#define pmempool_errormsg pmempool_errormsgW
+#define pmempool_feature_enable pmempool_feature_enableW
+#define pmempool_feature_disable pmempool_feature_disableW
+#define pmempool_feature_query pmempool_feature_queryW
+#else
+#define pmempool_check_status pmempool_check_statusU
+#define pmempool_check_args pmempool_check_argsU
+
+#define pmempool_check_init pmempool_check_initU
+#define pmempool_check pmempool_checkU
+#define pmempool_sync pmempool_syncU
+#define pmempool_transform pmempool_transformU
+#define pmempool_rm pmempool_rmU
+#define pmempool_check_version pmempool_check_versionU
+#define pmempool_errormsg pmempool_errormsgU
+#define pmempool_feature_enable pmempool_feature_enableU
+#define pmempool_feature_disable pmempool_feature_disableU
+#define pmempool_feature_query pmempool_feature_queryU
+#endif
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PMEMPOOL CHECK */
+
+/*
+ * pool types
+ */
+enum pmempool_pool_type {
+       PMEMPOOL_POOL_TYPE_DETECT,
+       PMEMPOOL_POOL_TYPE_LOG,
+       PMEMPOOL_POOL_TYPE_BLK,
+       PMEMPOOL_POOL_TYPE_OBJ,
+       PMEMPOOL_POOL_TYPE_BTT,
+       PMEMPOOL_POOL_TYPE_RESERVED1, /* used to be cto */
+};
+
+/*
+ * perform repairs
+ */
+#define PMEMPOOL_CHECK_REPAIR          (1U << 0)
+/*
+ * emulate repairs
+ */
+#define PMEMPOOL_CHECK_DRY_RUN         (1U << 1)
+/*
+ * perform hazardous repairs
+ */
+#define PMEMPOOL_CHECK_ADVANCED                (1U << 2)
+/*
+ * do not ask before repairs
+ */
+#define PMEMPOOL_CHECK_ALWAYS_YES      (1U << 3)
+/*
+ * generate info statuses
+ */
+#define PMEMPOOL_CHECK_VERBOSE         (1U << 4)
+/*
+ * generate string format statuses
+ */
+#define PMEMPOOL_CHECK_FORMAT_STR      (1U << 5)
+
+/*
+ * types of check statuses
+ */
+enum pmempool_check_msg_type {
+       PMEMPOOL_CHECK_MSG_TYPE_INFO,
+       PMEMPOOL_CHECK_MSG_TYPE_ERROR,
+       PMEMPOOL_CHECK_MSG_TYPE_QUESTION,
+};
+
+/*
+ * check result types
+ */
+enum pmempool_check_result {
+       PMEMPOOL_CHECK_RESULT_CONSISTENT,
+       PMEMPOOL_CHECK_RESULT_NOT_CONSISTENT,
+       PMEMPOOL_CHECK_RESULT_REPAIRED,
+       PMEMPOOL_CHECK_RESULT_CANNOT_REPAIR,
+       PMEMPOOL_CHECK_RESULT_ERROR,
+       PMEMPOOL_CHECK_RESULT_SYNC_REQ,
+};
+
+/*
+ * check context
+ */
+typedef struct pmempool_check_ctx PMEMpoolcheck;
+
+/*
+ * finalize the check and get the result
+ */
+enum pmempool_check_result pmempool_check_end(PMEMpoolcheck *ppc);
+
+/* PMEMPOOL RM */
+
+#define PMEMPOOL_RM_FORCE              (1U << 0) /* ignore any errors */
+#define PMEMPOOL_RM_POOLSET_LOCAL      (1U << 1) /* remove local poolsets */
+#define PMEMPOOL_RM_POOLSET_REMOTE     (1U << 2) /* remove remote poolsets */
+
+/*
+ * LIBPMEMPOOL SYNC
+ */
+
+/*
+ * fix bad blocks - it requires creating or reading special recovery files
+ */
+#define PMEMPOOL_SYNC_FIX_BAD_BLOCKS   (1U << 0)
+/*
+ * do not apply changes, only check if operation is viable
+ */
+#define PMEMPOOL_SYNC_DRY_RUN          (1U << 1)
+
+/*
+ * LIBPMEMPOOL TRANSFORM
+ */
+
+/*
+ * do not apply changes, only check if operation is viable
+ */
+#define PMEMPOOL_TRANSFORM_DRY_RUN     (1U << 1)
+
+/*
+ * PMEMPOOL_MAJOR_VERSION and PMEMPOOL_MINOR_VERSION provide the current version
+ * of the libpmempool API as provided by this header file.  Applications can
+ * verify that the version available at run-time is compatible with the version
+ * used at compile-time by passing these defines to pmempool_check_version().
+ */
+#define PMEMPOOL_MAJOR_VERSION 1
+#define PMEMPOOL_MINOR_VERSION 3
+
+/*
+ * check status
+ */
+struct pmempool_check_statusU {
+       enum pmempool_check_msg_type type;
+       struct {
+               const char *msg;
+               const char *answer;
+       } str;
+};
+
+#ifndef _WIN32
+#define pmempool_check_status pmempool_check_statusU
+#else
+struct pmempool_check_statusW {
+       enum pmempool_check_msg_type type;
+       struct {
+               const wchar_t *msg;
+               const wchar_t *answer;
+       } str;
+};
+#endif
+
+/*
+ * check context arguments
+ */
+struct pmempool_check_argsU {
+       const char *path;
+       const char *backup_path;
+       enum pmempool_pool_type pool_type;
+       unsigned flags;
+};
+
+#ifndef _WIN32
+#define pmempool_check_args pmempool_check_argsU
+#else
+struct pmempool_check_argsW {
+       const wchar_t *path;
+       const wchar_t *backup_path;
+       enum pmempool_pool_type pool_type;
+       unsigned flags;
+};
+#endif
+
+/*
+ * initialize a check context
+ */
+#ifndef _WIN32
+PMEMpoolcheck *
+pmempool_check_init(struct pmempool_check_args *args, size_t args_size);
+#else
+PMEMpoolcheck *
+pmempool_check_initU(struct pmempool_check_argsU *args, size_t args_size);
+PMEMpoolcheck *
+pmempool_check_initW(struct pmempool_check_argsW *args, size_t args_size);
+#endif
+
+/*
+ * start / resume the check
+ */
+#ifndef _WIN32
+struct pmempool_check_status *pmempool_check(PMEMpoolcheck *ppc);
+#else
+struct pmempool_check_statusU *pmempool_checkU(PMEMpoolcheck *ppc);
+struct pmempool_check_statusW *pmempool_checkW(PMEMpoolcheck *ppc);
+#endif
+
+/*
+ * LIBPMEMPOOL SYNC & TRANSFORM
+ */
+
+/*
+ * Synchronize data between replicas within a poolset.
+ *
+ * EXPERIMENTAL
+ */
+#ifndef _WIN32
+int pmempool_sync(const char *poolset_file, unsigned flags);
+#else
+int pmempool_syncU(const char *poolset_file, unsigned flags);
+int pmempool_syncW(const wchar_t *poolset_file, unsigned flags);
+#endif
+
+/*
+ * Modify internal structure of a poolset.
+ *
+ * EXPERIMENTAL
+ */
+#ifndef _WIN32
+int pmempool_transform(const char *poolset_file_src,
+       const char *poolset_file_dst, unsigned flags);
+#else
+int pmempool_transformU(const char *poolset_file_src,
+       const char *poolset_file_dst, unsigned flags);
+int pmempool_transformW(const wchar_t *poolset_file_src,
+       const wchar_t *poolset_file_dst, unsigned flags);
+#endif
+
+/* PMEMPOOL feature enable, disable, query */
+
+/*
+ * feature types
+ */
+enum pmempool_feature {
+       PMEMPOOL_FEAT_SINGLEHDR,
+       PMEMPOOL_FEAT_CKSUM_2K,
+       PMEMPOOL_FEAT_SHUTDOWN_STATE,
+       PMEMPOOL_FEAT_CHECK_BAD_BLOCKS,
+};
+
+/* PMEMPOOL FEATURE ENABLE */
+#ifndef _WIN32
+int pmempool_feature_enable(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+#else
+int pmempool_feature_enableU(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+int pmempool_feature_enableW(const wchar_t *path,
+       enum pmempool_feature feature, unsigned flags);
+#endif
+
+/* PMEMPOOL FEATURE DISABLE */
+#ifndef _WIN32
+int pmempool_feature_disable(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+#else
+int pmempool_feature_disableU(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+int pmempool_feature_disableW(const wchar_t *path,
+       enum pmempool_feature feature, unsigned flags);
+#endif
+
+/* PMEMPOOL FEATURE QUERY */
+#ifndef _WIN32
+int pmempool_feature_query(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+#else
+int pmempool_feature_queryU(const char *path, enum pmempool_feature feature,
+       unsigned flags);
+int pmempool_feature_queryW(const wchar_t *path,
+       enum pmempool_feature feature, unsigned flags);
+#endif
+
+/* PMEMPOOL RM */
+#ifndef _WIN32
+int pmempool_rm(const char *path, unsigned flags);
+#else
+int pmempool_rmU(const char *path, unsigned flags);
+int pmempool_rmW(const wchar_t *path, unsigned flags);
+#endif
+
+#ifndef _WIN32
+const char *pmempool_check_version(unsigned major_required,
+       unsigned minor_required);
+#else
+const char *pmempool_check_versionU(unsigned major_required,
+       unsigned minor_required);
+const wchar_t *pmempool_check_versionW(unsigned major_required,
+       unsigned minor_required);
+#endif
+
+#ifndef _WIN32
+const char *pmempool_errormsg(void);
+#else
+const char *pmempool_errormsgU(void);
+const wchar_t *pmempool_errormsgW(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* libpmempool.h */
diff --git a/ceph/src/pmdk/src/include/librpmem.h b/ceph/src/pmdk/src/include/librpmem.h
new file mode 100644 (file)
index 0000000..ac0e34c
--- /dev/null
@@ -0,0 +1,98 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * librpmem.h -- definitions of librpmem entry points (EXPERIMENTAL)
+ *
+ * This library provides low-level support for remote access to persistent
+ * memory utilizing RDMA-capable RNICs.
+ *
+ * See librpmem(7) for details.
+ */
+
+#ifndef LIBRPMEM_H
+#define LIBRPMEM_H 1
+
+#include <sys/types.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rpmem_pool RPMEMpool;
+
+#define RPMEM_POOL_HDR_SIG_LEN 8
+#define RPMEM_POOL_HDR_UUID_LEN        16 /* uuid byte length */
+#define RPMEM_POOL_USER_FLAGS_LEN 16
+
+struct rpmem_pool_attr {
+       char signature[RPMEM_POOL_HDR_SIG_LEN]; /* pool signature */
+       uint32_t major; /* format major version number */
+       uint32_t compat_features; /* mask: compatible "may" features */
+       uint32_t incompat_features; /* mask: "must support" features */
+       uint32_t ro_compat_features; /* mask: force RO if unsupported */
+       unsigned char poolset_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* pool uuid */
+       unsigned char uuid[RPMEM_POOL_HDR_UUID_LEN]; /* first part uuid */
+       unsigned char next_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* next pool uuid */
+       unsigned char prev_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* prev pool uuid */
+       unsigned char user_flags[RPMEM_POOL_USER_FLAGS_LEN]; /* user flags */
+};
+
+RPMEMpool *rpmem_create(const char *target, const char *pool_set_name,
+               void *pool_addr, size_t pool_size, unsigned *nlanes,
+               const struct rpmem_pool_attr *create_attr);
+
+RPMEMpool *rpmem_open(const char *target, const char *pool_set_name,
+               void *pool_addr, size_t pool_size, unsigned *nlanes,
+               struct rpmem_pool_attr *open_attr);
+
+int rpmem_set_attr(RPMEMpool *rpp, const struct rpmem_pool_attr *attr);
+
+int rpmem_close(RPMEMpool *rpp);
+
+#define RPMEM_PERSIST_RELAXED  (1U << 0)
+#define RPMEM_FLUSH_RELAXED    (1U << 0)
+
+int rpmem_flush(RPMEMpool *rpp, size_t offset, size_t length, unsigned lane,
+               unsigned flags);
+int rpmem_drain(RPMEMpool *rpp, unsigned lane, unsigned flags);
+
+int rpmem_persist(RPMEMpool *rpp, size_t offset, size_t length,
+               unsigned lane, unsigned flags);
+int rpmem_read(RPMEMpool *rpp, void *buff, size_t offset, size_t length,
+               unsigned lane);
+int rpmem_deep_persist(RPMEMpool *rpp, size_t offset, size_t length,
+               unsigned lane);
+
+#define RPMEM_REMOVE_FORCE 0x1
+#define RPMEM_REMOVE_POOL_SET 0x2
+
+int rpmem_remove(const char *target, const char *pool_set, int flags);
+
+/*
+ * RPMEM_MAJOR_VERSION and RPMEM_MINOR_VERSION provide the current version of
+ * the librpmem API as provided by this header file.  Applications can verify
+ * that the version available at run-time is compatible with the version used
+ * at compile-time by passing these defines to rpmem_check_version().
+ */
+#define RPMEM_MAJOR_VERSION 1
+#define RPMEM_MINOR_VERSION 3
+const char *rpmem_check_version(unsigned major_required,
+               unsigned minor_required);
+
+const char *rpmem_errormsg(void);
+
+/* minimum size of a pool */
+#define RPMEM_MIN_POOL ((size_t)(1024 * 8)) /* 8 KB */
+
+/*
+ * This limit is set arbitrary to incorporate a pool header and required
+ * alignment plus supply.
+ */
+#define RPMEM_MIN_PART ((size_t)(1024 * 1024 * 2)) /* 2 MiB */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* librpmem.h */
diff --git a/ceph/src/pmdk/src/include/pmemcompat.h b/ceph/src/pmdk/src/include/pmemcompat.h
new file mode 100644 (file)
index 0000000..a7730bf
--- /dev/null
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * pmemcompat.h -- compatibility layer for libpmem* libraries
+ */
+
+#ifndef PMEMCOMPAT_H
+#define PMEMCOMPAT_H
+#include <windows.h>
+
+/* for backward compatibility */
+#ifdef NVML_UTF8_API
+#pragma message( "NVML_UTF8_API macro is obsolete, please use PMDK_UTF8_API instead." )
+#ifndef PMDK_UTF8_API
+#define PMDK_UTF8_API
+#endif
+#endif
+
+struct iovec {
+       void  *iov_base;
+       size_t iov_len;
+};
+
+typedef int mode_t;
+/*
+ * XXX: this code will not work on windows if our library is included in
+ * an extern block.
+ */
+#if defined(__cplusplus) && defined(_MSC_VER) && !defined(__typeof__)
+#include <type_traits>
+/*
+ * These templates are used to remove a type reference(T&) which, in some
+ * cases, is returned by decltype
+ */
+namespace pmem {
+
+namespace detail {
+
+template<typename T>
+struct get_type {
+       using type = T;
+};
+
+template<typename T>
+struct get_type<T*> {
+       using type = T*;
+};
+
+template<typename T>
+struct get_type<T&> {
+       using type = T;
+};
+
+} /* namespace detail */
+
+} /* namespace pmem */
+
+#define __typeof__(p) pmem::detail::get_type<decltype(p)>::type
+
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem/Makefile b/ceph/src/pmdk/src/libpmem/Makefile
new file mode 100644 (file)
index 0000000..d4d5a14
--- /dev/null
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# src/libpmem/Makefile -- Makefile for libpmem
+#
+
+include ../common.inc
+
+LIBRARY_NAME = pmem
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+SOURCE =\
+       $(CORE)/alloc.c\
+       $(CORE)/fs_posix.c\
+       $(CORE)/os_posix.c\
+       $(CORE)/os_thread_posix.c\
+       $(CORE)/out.c\
+       $(CORE)/util.c\
+       $(CORE)/util_posix.c\
+       $(COMMON)/file.c\
+       $(COMMON)/file_posix.c\
+       $(COMMON)/mmap.c\
+       $(COMMON)/mmap_posix.c\
+       $(COMMON)/os_deep_linux.c\
+       libpmem.c\
+       memops_generic.c\
+       pmem.c\
+       pmem_posix.c\
+       $(PMEM2)/pmem2_utils.c\
+       $(PMEM2)/config.c\
+       $(PMEM2)/persist_posix.c\
+       $(PMEM2)/source.c\
+       $(PMEM2)/source_posix.c
+
+ifeq ($(OS_KERNEL_NAME),Linux)
+SOURCE +=\
+       $(PMEM2)/pmem2_utils_linux.c\
+       $(PMEM2)/pmem2_utils_$(OS_DIMM).c\
+       $(PMEM2)/auto_flush_linux.c\
+       $(PMEM2)/deep_flush_linux.c
+else
+SOURCE +=\
+       $(PMEM2)/pmem2_utils_other.c\
+       $(PMEM2)/auto_flush_none.c\
+       $(PMEM2)/deep_flush_other.c
+endif
+
+ifeq ($(OS_DIMM),ndctl)
+SOURCE += region_namespace_ndctl.c
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += $(LIBNDCTL_LIBS)
+else
+SOURCE += region_namespace_none.c
+endif
+
+INCS += -I$(TOP)/src/libpmem2
+
+include ../libpmem2/$(ARCH)/sources.inc
+
+SOURCE += $(LIBPMEM2_ARCH_SOURCE)
+
+include ../Makefile.inc
+
+include $(PMEM2)/$(ARCH)/flags.inc
+
+CFLAGS += -I.
+LIBS += -pthread
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.c b/ceph/src/pmdk/src/libpmem/libpmem.c
new file mode 100644 (file)
index 0000000..fbc2e5b
--- /dev/null
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2017, Intel Corporation */
+
+/*
+ * libpmem.c -- pmem entry points for libpmem
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "libpmem.h"
+
+#include "pmem.h"
+#include "pmemcommon.h"
+
+/*
+ * libpmem_init -- load-time initialization for libpmem
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmem_init(void)
+{
+       common_init(PMEM_LOG_PREFIX, PMEM_LOG_LEVEL_VAR, PMEM_LOG_FILE_VAR,
+                       PMEM_MAJOR_VERSION, PMEM_MINOR_VERSION);
+       LOG(3, NULL);
+       pmem_init();
+}
+
+/*
+ * libpmem_fini -- libpmem cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmem_fini(void)
+{
+       LOG(3, NULL);
+
+       common_fini();
+}
+
+/*
+ * pmem_check_versionU -- see if library meets application version requirements
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmem_check_versionU(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != PMEM_MAJOR_VERSION) {
+               ERR("libpmem major version mismatch (need %u, found %u)",
+                       major_required, PMEM_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > PMEM_MINOR_VERSION) {
+               ERR("libpmem minor version mismatch (need %u, found %u)",
+                       minor_required, PMEM_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmem_check_version -- see if library meets application version requirements
+ */
+const char *
+pmem_check_version(unsigned major_required, unsigned minor_required)
+{
+       return pmem_check_versionU(major_required, minor_required);
+}
+#else
+/*
+ * pmem_check_versionW -- see if library meets application version requirements
+ */
+const wchar_t *
+pmem_check_versionW(unsigned major_required, unsigned minor_required)
+{
+       if (pmem_check_versionU(major_required, minor_required) != NULL)
+               return out_get_errormsgW();
+       else
+               return NULL;
+}
+#endif
+
+/*
+ * pmem_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmem_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmem_errormsg -- return last error message
+ */
+const char *
+pmem_errormsg(void)
+{
+       return pmem_errormsgU();
+}
+#else
+/*
+ * pmem_errormsgW -- return last error message as wchar_t
+ */
+const wchar_t *
+pmem_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.def b/ceph/src/pmdk/src/libpmem/libpmem.def
new file mode 100644 (file)
index 0000000..8f82670
--- /dev/null
@@ -0,0 +1,66 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2015-2018, Intel Corporation
+;;;;  End Copyright Notice
+
+;
+; XXX - libpmem exports mmap/munmap/msync/mprotect functions
+;
+; This is a _temporary_ solution to make those function available for all
+; the other PMDK libraries and to have only one instance of a file mapping
+; list (owned by libpmem).  Otherwise, each library would have its own
+; instance of the file mapping list, resulting in libpmem being not able
+; to find a file handle associated with the mapping address passed to
+; pmem_msync(), pmem_memcpy(), etc. causing those functions to fail.
+;
+; The proposed target solution would include:
+; - implementation of pmem_mmap, pmem_unmap, pmem_msync and
+;   pmem_mprotect functions in libpmem (pmem_unmap and pmem_msync are
+;   already there);
+; - making sure that all the PMDK libraries never call mmap, munmap,
+;   msync and mprotect directly, but only through their libpmem counterparts;
+; - new pmem_mmap() function must provide similar functionality to
+;   mmap(), i.e. it must take 'offset' argument, but should not take
+;   file descriptor argument.  Perhaps it could be an opaque handle
+;   to the file, that is internally casted to a file descriptor
+;   or a HANDLE, depending on the OS.
+;
+
+LIBRARY libpmem
+
+VERSION 1.0
+
+EXPORTS
+       pmem_map_fileU
+       pmem_map_fileW
+       pmem_unmap
+       pmem_is_pmem
+       pmem_persist
+       pmem_msync
+       pmem_has_auto_flush
+       pmem_deep_persist
+       pmem_flush
+       pmem_deep_flush
+       pmem_deep_drain
+       pmem_drain
+       pmem_has_hw_drain
+       pmem_memmove_persist
+       pmem_memcpy_persist
+       pmem_memset_persist
+       pmem_memmove_nodrain
+       pmem_memcpy_nodrain
+       pmem_memset_nodrain
+       pmem_memmove
+       pmem_memcpy
+       pmem_memset
+       pmem_check_versionU
+       pmem_check_versionW
+       pmem_errormsgU
+       pmem_errormsgW
+
+       mmap
+       munmap
+       msync
+       mprotect
+
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.link.in b/ceph/src/pmdk/src/libpmem/libpmem.link.in
new file mode 100644 (file)
index 0000000..16673da
--- /dev/null
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2019, Intel Corporation
+#
+#
+# src/libpmem.link -- linker link file for libpmem
+#
+LIBPMEM_1.0 {
+       global:
+               pmem_map_file;
+               pmem_unmap;
+               pmem_is_pmem;
+               pmem_persist;
+               pmem_msync;
+               pmem_has_auto_flush;
+               pmem_deep_persist;
+               pmem_flush;
+               pmem_deep_flush;
+               pmem_deep_drain;
+               pmem_drain;
+               pmem_has_hw_drain;
+               pmem_check_version;
+               pmem_errormsg;
+               pmem_memmove_persist;
+               pmem_memcpy_persist;
+               pmem_memset_persist;
+               pmem_memmove_nodrain;
+               pmem_memcpy_nodrain;
+               pmem_memset_nodrain;
+               pmem_memmove;
+               pmem_memcpy;
+               pmem_memset;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.rc b/ceph/src/pmdk/src/libpmem/libpmem.rc
new file mode 100644 (file)
index 0000000..82e6a5c
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016, Intel Corporation */
+
+/*
+ * libpmem.rc -- libpmem resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmem.dll"
+#define DESCRIPTION "libpmem - persistent memory support library"
+#define TYPE VFT_DLL
+#include <common.rc>
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.vcxproj b/ceph/src/pmdk/src/libpmem/libpmem.vcxproj
new file mode 100644 (file)
index 0000000..e548abb
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmem\libpmem.c" />
+    <ClCompile Include="..\..\src\libpmem\pmem.c" />
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\common\file.c" />
+    <ClCompile Include="..\common\file_windows.c" />
+    <ClCompile Include="..\common\mmap.c" />
+    <ClCompile Include="..\common\mmap_windows.c" />
+    <ClCompile Include="..\core\fs_windows.c" />
+    <ClCompile Include="..\common\os_deep_windows.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\pool_hdr.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="..\common\uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem\libpmem_main.c" />
+    <ClCompile Include="..\windows\win_mmap.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\cpu.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\init.c" />
+    <ClCompile Include="pmem_windows.c" />
+    <ClCompile Include="..\libpmem2\memops_generic.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_nt_sse2.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_nt_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_t_sse2.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_t_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_nt_sse2.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_nt_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_t_sse2.c" />
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_t_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h" />
+    <ClInclude Include="..\..\src\core\util.h" />
+    <ClInclude Include="..\..\src\common\valgrind_internal.h" />
+    <ClInclude Include="..\..\src\include\libpmem.h" />
+    <ClInclude Include="..\..\src\libpmem\pmem.h" />
+    <ClInclude Include="..\core\alloc.h" />
+    <ClInclude Include="..\common\dlsym.h" />
+    <ClInclude Include="..\core\fault_injection.h" />
+    <ClInclude Include="..\common\file.h" />
+    <ClInclude Include="..\core\fs.h" />
+    <ClInclude Include="..\common\mmap.h" />
+    <ClInclude Include="..\core\os.h" />
+    <ClInclude Include="..\common\os_deep.h" />
+    <ClInclude Include="..\core\os_thread.h" />
+    <ClInclude Include="..\common\pool_hdr.h" />
+    <ClInclude Include="..\common\set.h" />
+    <ClInclude Include="..\common\sys_util.h" />
+    <ClInclude Include="..\common\uuid.h" />
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="..\libpmem2\pmem2_arch.h" />
+    <ClInclude Include="..\windows\include\win_mmap.h" />
+    <ClInclude Include="..\libpmem2\x86_64\cpu.h" />
+    <ClInclude Include="..\libpmem2\x86_64\avx.h" />
+    <ClInclude Include="..\libpmem2\x86_64\flush.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_avx.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_avx512f.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_sse2.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memcpy_memset.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_avx.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_avx512f.h" />
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_sse2.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\source.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmem.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmem.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{9e9e3d25-2139-4a5d-9200-18148ddead45}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmem</ProjectName>
+    <RootNamespace>libpmem</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\src\libpmem2\x86_64\</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\src\libpmem2\x86_64\</IncludePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)libpmem2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)libpmem2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmem/libpmem.vcxproj.filters b/ceph/src/pmdk/src/libpmem/libpmem.vcxproj.filters
new file mode 100644 (file)
index 0000000..1ce5507
--- /dev/null
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{16473205-8f12-4d4c-b1e9-e14ea3013e70}</UniqueIdentifier>
+      <Extensions>h</Extensions>
+    </Filter>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{17275273-f923-45ff-9b7e-b2ea76561168}</UniqueIdentifier>
+      <Extensions>c;def</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmem\libpmem.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem\libpmem_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem\pmem.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\cpu.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\init.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\windows\win_mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pmem_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_nt_sse2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_nt_avx.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_t_sse2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memcpy\memcpy_t_avx.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_nt_sse2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_nt_avx.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_t_sse2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmem2\x86_64\memset\memset_t_avx.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\memops_generic.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmem\pmem.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\common\valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\include\libpmem.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\windows\include\win_mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_avx512f.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_avx512f.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_avx.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memset\memset_sse2.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_avx.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memcpy\memcpy_sse2.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\avx.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\memcpy_memset.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_arch.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\x86_64\cpu.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\source.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmem.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmem.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmem/libpmem_main.c b/ceph/src/pmdk/src/libpmem/libpmem_main.c
new file mode 100644 (file)
index 0000000..8978229
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2018, Intel Corporation */
+
+/*
+ * libpmem_main.c -- entry point for libpmem.dll
+ *
+ * XXX - This is a placeholder.  All the library initialization/cleanup
+ * that is done in library ctors/dtors, as well as TLS initialization
+ * should be moved here.
+ */
+
+#include "win_mmap.h"
+
+void libpmem_init(void);
+void libpmem_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmem_init();
+               win_mmap_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               win_mmap_fini();
+               libpmem_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmem/pmem.c b/ceph/src/pmdk/src/libpmem/pmem.c
new file mode 100644 (file)
index 0000000..2730d02
--- /dev/null
@@ -0,0 +1,957 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * pmem.c -- pmem entry points for libpmem
+ *
+ *
+ * PERSISTENT MEMORY INSTRUCTIONS ON X86
+ *
+ * The primary feature of this library is to provide a way to flush
+ * changes to persistent memory as outlined below (note that many
+ * of the decisions below are made at initialization time, and not
+ * repeated every time a flush is requested).
+ *
+ * To flush a range to pmem when CLWB is available:
+ *
+ *     CLWB for each cache line in the given range.
+ *
+ *     SFENCE to ensure the CLWBs above have completed.
+ *
+ * To flush a range to pmem when CLFLUSHOPT is available and CLWB is not
+ * (same as above but issue CLFLUSHOPT instead of CLWB):
+ *
+ *     CLFLUSHOPT for each cache line in the given range.
+ *
+ *     SFENCE to ensure the CLWBs above have completed.
+ *
+ * To flush a range to pmem when neither CLFLUSHOPT or CLWB are available
+ * (same as above but fences surrounding CLFLUSH are not required):
+ *
+ *     CLFLUSH for each cache line in the given range.
+ *
+ * To memcpy a range of memory to pmem when MOVNT is available:
+ *
+ *     Copy any non-64-byte portion of the destination using MOV.
+ *
+ *     Use the flush flow above without the fence for the copied portion.
+ *
+ *     Copy using MOVNTDQ, up to any non-64-byte aligned end portion.
+ *     (The MOVNT instructions bypass the cache, so no flush is required.)
+ *
+ *     Copy any unaligned end portion using MOV.
+ *
+ *     Use the flush flow above for the copied portion (including fence).
+ *
+ * To memcpy a range of memory to pmem when MOVNT is not available:
+ *
+ *     Just pass the call to the normal memcpy() followed by pmem_persist().
+ *
+ * To memset a non-trivial sized range of memory to pmem:
+ *
+ *     Same as the memcpy cases above but store the given value instead
+ *     of reading values from the source.
+ *
+ * These features are supported for ARM AARCH64 using equivalent ARM
+ * assembly instruction. Please refer to (arm_cacheops.h) for more details.
+ *
+ * INTERFACES FOR FLUSHING TO PERSISTENT MEMORY
+ *
+ * Given the flows above, three interfaces are provided for flushing a range
+ * so that the caller has the ability to separate the steps when necessary,
+ * but otherwise leaves the detection of available instructions to the libpmem:
+ *
+ * pmem_persist(addr, len)
+ *
+ *     This is the common case, which just calls the two other functions:
+ *
+ *             pmem_flush(addr, len);
+ *             pmem_drain();
+ *
+ * pmem_flush(addr, len)
+ *
+ *     CLWB or CLFLUSHOPT or CLFLUSH for each cache line
+ *
+ * pmem_drain()
+ *
+ *     SFENCE unless using CLFLUSH
+ *
+ *
+ * INTERFACES FOR COPYING/SETTING RANGES OF MEMORY
+ *
+ * Given the flows above, the following interfaces are provided for the
+ * memmove/memcpy/memset operations to persistent memory:
+ *
+ * pmem_memmove_nodrain()
+ *
+ *     Checks for overlapped ranges to determine whether to copy from
+ *     the beginning of the range or from the end.  If MOVNT instructions
+ *     are available, uses the memory copy flow described above, otherwise
+ *     calls the libc memmove() followed by pmem_flush(). Since no conditional
+ *     compilation and/or architecture specific CFLAGS are in use at the
+ *     moment, SSE2 ( thus movnt ) is just assumed to be available.
+ *
+ * pmem_memcpy_nodrain()
+ *
+ *     Just calls pmem_memmove_nodrain().
+ *
+ * pmem_memset_nodrain()
+ *
+ *     If MOVNT instructions are available, uses the memset flow described
+ *     above, otherwise calls the libc memset() followed by pmem_flush().
+ *
+ * pmem_memmove_persist()
+ * pmem_memcpy_persist()
+ * pmem_memset_persist()
+ *
+ *     Calls the appropriate _nodrain() function followed by pmem_drain().
+ *
+ *
+ * DECISIONS MADE AT INITIALIZATION TIME
+ *
+ * As much as possible, all decisions described above are made at library
+ * initialization time.  This is achieved using function pointers that are
+ * setup by pmem_init() when the library loads.
+ *
+ *     Func_fence is used by pmem_drain() to call one of:
+ *             fence_empty()
+ *             memory_barrier()
+ *
+ *     Func_flush is used by pmem_flush() to call one of:
+ *             flush_dcache()
+ *             flush_dcache_invalidate_opt()
+ *             flush_dcache_invalidate()
+ *
+ *     Func_memmove_nodrain is used by memmove_nodrain() to call one of:
+ *             memmove_nodrain_libc()
+ *             memmove_nodrain_movnt()
+ *
+ *     Func_memset_nodrain is used by memset_nodrain() to call one of:
+ *             memset_nodrain_libc()
+ *             memset_nodrain_movnt()
+ *
+ * DEBUG LOGGING
+ *
+ * Many of the functions here get called hundreds of times from loops
+ * iterating over ranges, making the usual LOG() calls at level 3
+ * impractical.  The call tracing log for those functions is set at 15.
+ */
+
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include "libpmem.h"
+#include "pmem.h"
+#include "pmem2_arch.h"
+#include "out.h"
+#include "os.h"
+#include "mmap.h"
+#include "file.h"
+#include "valgrind_internal.h"
+#include "os_deep.h"
+#include "auto_flush.h"
+
+struct pmem_funcs {
+       memmove_nodrain_func memmove_nodrain;
+       memset_nodrain_func memset_nodrain;
+
+       flush_func deep_flush;
+       flush_func flush;
+       fence_func fence;
+};
+
+static struct pmem_funcs Funcs;
+static is_pmem_func Is_pmem = NULL;
+
+/*
+ * pmem_has_hw_drain -- return whether or not HW drain was found
+ *
+ * Always false for x86: HW drain is done by HW with no SW involvement.
+ */
+int
+pmem_has_hw_drain(void)
+{
+       LOG(3, NULL);
+
+       return 0;
+}
+
+/*
+ * pmem_drain -- wait for any PM stores to drain from HW buffers
+ */
+void
+pmem_drain(void)
+{
+       LOG(15, NULL);
+
+       Funcs.fence();
+}
+
+/*
+ * pmem_has_auto_flush -- check if platform supports eADR
+ */
+int
+pmem_has_auto_flush()
+{
+       LOG(3, NULL);
+
+       return pmem2_auto_flush();
+}
+
+/*
+ * pmem_deep_flush -- flush processor cache for the given range
+ * regardless of eADR support on platform
+ */
+void
+pmem_deep_flush(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len);
+
+       Funcs.deep_flush(addr, len);
+}
+
+/*
+ * pmem_flush -- flush processor cache for the given range
+ */
+void
+pmem_flush(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len);
+
+       Funcs.flush(addr, len);
+}
+
+/*
+ * pmem_persist -- make any cached changes to a range of pmem persistent
+ */
+void
+pmem_persist(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       pmem_flush(addr, len);
+       pmem_drain();
+}
+
+/*
+ * pmem_msync -- flush to persistence via msync
+ *
+ * Using msync() means this routine is less optimal for pmem (but it
+ * still works) but it also works for any memory mapped file, unlike
+ * pmem_persist() which is only safe where pmem_is_pmem() returns true.
+ */
+int
+pmem_msync(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len);
+
+       /*
+        * msync requires addr to be a multiple of pagesize but there are no
+        * requirements for len. Align addr down and change len so that
+        * [addr, addr + len) still contains initial range.
+        */
+
+       /* increase len by the amount we gain when we round addr down */
+       len += (uintptr_t)addr & (Pagesize - 1);
+
+       /* round addr down to page boundary */
+       uintptr_t uptr = (uintptr_t)addr & ~((uintptr_t)Pagesize - 1);
+
+       /*
+        * msync accepts addresses aligned to page boundary, so we may sync
+        * more and part of it may have been marked as undefined/inaccessible
+        * Msyncing such memory is not a bug, so as a workaround temporarily
+        * disable error reporting.
+        */
+       VALGRIND_DO_DISABLE_ERROR_REPORTING;
+
+       int ret;
+       if ((ret = msync((void *)uptr, len, MS_SYNC)) < 0)
+               ERR("!msync");
+
+       VALGRIND_DO_ENABLE_ERROR_REPORTING;
+
+       /* full flush */
+       VALGRIND_DO_PERSIST(uptr, len);
+
+       return ret;
+}
+
+/*
+ * is_pmem_always -- (internal) always true (for meaningful parameters) version
+ *     of pmem_is_pmem()
+ */
+static int
+is_pmem_always(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       if (len == 0)
+               return 0;
+
+       return 1;
+}
+
+/*
+ * is_pmem_never -- (internal) never true version of pmem_is_pmem()
+ */
+static int
+is_pmem_never(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       return 0;
+}
+
+/*
+ * pmem_is_pmem_init -- (internal) initialize Func_is_pmem pointer
+ *
+ * This should be done only once - on the first call to pmem_is_pmem().
+ * If PMEM_IS_PMEM_FORCE is set, it would override the default behavior
+ * of pmem_is_pmem().
+ */
+static void
+pmem_is_pmem_init(void)
+{
+       LOG(3, NULL);
+
+       static volatile unsigned init;
+
+       while (init != 2) {
+               if (!util_bool_compare_and_swap32(&init, 0, 1))
+                       continue;
+
+               /*
+                * For debugging/testing, allow pmem_is_pmem() to be forced
+                * to always true or never true using environment variable
+                * PMEM_IS_PMEM_FORCE values of zero or one.
+                *
+                * This isn't #ifdef DEBUG because it has a trivial performance
+                * impact and it may turn out to be useful as a "chicken bit"
+                * for systems where pmem_is_pmem() isn't correctly detecting
+                * true persistent memory.
+                */
+               char *ptr = os_getenv("PMEM_IS_PMEM_FORCE");
+               if (ptr) {
+                       int val = atoi(ptr);
+
+                       if (val == 0)
+                               Is_pmem = is_pmem_never;
+                       else if (val == 1)
+                               Is_pmem = is_pmem_always;
+
+                       VALGRIND_ANNOTATE_HAPPENS_BEFORE(&Is_pmem);
+
+                       LOG(4, "PMEM_IS_PMEM_FORCE=%d", val);
+               }
+
+               if (Funcs.deep_flush == NULL)
+                       Is_pmem = is_pmem_never;
+
+               if (!util_bool_compare_and_swap32(&init, 1, 2))
+                       FATAL("util_bool_compare_and_swap32");
+       }
+}
+
+/*
+ * pmem_is_pmem -- return true if entire range is persistent memory
+ */
+int
+pmem_is_pmem(const void *addr, size_t len)
+{
+       LOG(10, "addr %p len %zu", addr, len);
+
+       static int once;
+
+       /* This is not thread-safe, but pmem_is_pmem_init() is. */
+       if (once == 0) {
+               pmem_is_pmem_init();
+               util_fetch_and_add32(&once, 1);
+       }
+
+       VALGRIND_ANNOTATE_HAPPENS_AFTER(&Is_pmem);
+       return Is_pmem(addr, len);
+}
+
+#define PMEM_FILE_ALL_FLAGS\
+       (PMEM_FILE_CREATE|PMEM_FILE_EXCL|PMEM_FILE_SPARSE|PMEM_FILE_TMPFILE)
+
+#define PMEM_DAX_VALID_FLAGS\
+       (PMEM_FILE_CREATE|PMEM_FILE_SPARSE)
+
+/*
+ * pmem_map_fileU -- create or open the file and map it to memory
+ */
+#ifndef _WIN32
+static inline
+#endif
+void *
+pmem_map_fileU(const char *path, size_t len, int flags,
+       mode_t mode, size_t *mapped_lenp, int *is_pmemp)
+{
+       LOG(3, "path \"%s\" size %zu flags %x mode %o mapped_lenp %p "
+               "is_pmemp %p", path, len, flags, mode, mapped_lenp, is_pmemp);
+
+       int oerrno;
+       int fd;
+       int open_flags = O_RDWR;
+       int delete_on_err = 0;
+       int file_type = util_file_get_type(path);
+#ifdef _WIN32
+       open_flags |= O_BINARY;
+#endif
+
+       if (file_type == OTHER_ERROR)
+               return NULL;
+
+       if (flags & ~(PMEM_FILE_ALL_FLAGS)) {
+               ERR("invalid flag specified %x", flags);
+               errno = EINVAL;
+               return NULL;
+       }
+
+       if (file_type == TYPE_DEVDAX) {
+               if (flags & ~(PMEM_DAX_VALID_FLAGS)) {
+                       ERR("flag unsupported for Device DAX %x", flags);
+                       errno = EINVAL;
+                       return NULL;
+               } else {
+                       /* we are ignoring all of the flags */
+                       flags = 0;
+                       ssize_t actual_len = util_file_get_size(path);
+                       if (actual_len < 0) {
+                               ERR("unable to read Device DAX size");
+                               errno = EINVAL;
+                               return NULL;
+                       }
+                       if (len != 0 && len != (size_t)actual_len) {
+                               ERR("Device DAX length must be either 0 or "
+                                       "the exact size of the device: %zu",
+                                       actual_len);
+                               errno = EINVAL;
+                               return NULL;
+                       }
+                       len = 0;
+               }
+       }
+
+       if (flags & PMEM_FILE_CREATE) {
+               if ((os_off_t)len < 0) {
+                       ERR("invalid file length %zu", len);
+                       errno = EINVAL;
+                       return NULL;
+               }
+               open_flags |= O_CREAT;
+       }
+
+       if (flags & PMEM_FILE_EXCL)
+               open_flags |= O_EXCL;
+
+       if ((len != 0) && !(flags & PMEM_FILE_CREATE)) {
+               ERR("non-zero 'len' not allowed without PMEM_FILE_CREATE");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       if ((len == 0) && (flags & PMEM_FILE_CREATE)) {
+               ERR("zero 'len' not allowed with PMEM_FILE_CREATE");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       if ((flags & PMEM_FILE_TMPFILE) && !(flags & PMEM_FILE_CREATE)) {
+               ERR("PMEM_FILE_TMPFILE not allowed without PMEM_FILE_CREATE");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       if (flags & PMEM_FILE_TMPFILE) {
+               if ((fd = util_tmpfile(path,
+                                       OS_DIR_SEP_STR"pmem.XXXXXX",
+                                       open_flags & O_EXCL)) < 0) {
+                       LOG(2, "failed to create temporary file at \"%s\"",
+                               path);
+                       return NULL;
+               }
+       } else {
+               if ((fd = os_open(path, open_flags, mode)) < 0) {
+                       ERR("!open %s", path);
+                       return NULL;
+               }
+               if ((flags & PMEM_FILE_CREATE) && (flags & PMEM_FILE_EXCL))
+                       delete_on_err = 1;
+       }
+
+       if (flags & PMEM_FILE_CREATE) {
+               /*
+                * Always set length of file to 'len'.
+                * (May either extend or truncate existing file.)
+                */
+               if (os_ftruncate(fd, (os_off_t)len) != 0) {
+                       ERR("!ftruncate");
+                       goto err;
+               }
+               if ((flags & PMEM_FILE_SPARSE) == 0) {
+                       if ((errno = os_posix_fallocate(fd, 0,
+                                                       (os_off_t)len)) != 0) {
+                               ERR("!posix_fallocate");
+                               goto err;
+                       }
+               }
+       } else {
+               ssize_t actual_size = util_fd_get_size(fd);
+               if (actual_size < 0) {
+                       ERR("stat %s: negative size", path);
+                       errno = EINVAL;
+                       goto err;
+               }
+
+               len = (size_t)actual_size;
+       }
+
+       void *addr = pmem_map_register(fd, len, path, file_type == TYPE_DEVDAX);
+       if (addr == NULL)
+               goto err;
+
+       if (mapped_lenp != NULL)
+               *mapped_lenp = len;
+
+       if (is_pmemp != NULL)
+               *is_pmemp = pmem_is_pmem(addr, len);
+
+       LOG(3, "returning %p", addr);
+
+       VALGRIND_REGISTER_PMEM_MAPPING(addr, len);
+       VALGRIND_REGISTER_PMEM_FILE(fd, addr, len, 0);
+
+       (void) os_close(fd);
+
+       return addr;
+err:
+       oerrno = errno;
+       (void) os_close(fd);
+       if (delete_on_err)
+               (void) os_unlink(path);
+       errno = oerrno;
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmem_map_file -- create or open the file and map it to memory
+ */
+void *
+pmem_map_file(const char *path, size_t len, int flags,
+       mode_t mode, size_t *mapped_lenp, int *is_pmemp)
+{
+       return pmem_map_fileU(path, len, flags, mode, mapped_lenp, is_pmemp);
+}
+#else
+/*
+ * pmem_map_fileW -- create or open the file and map it to memory
+ */
+void *
+pmem_map_fileW(const wchar_t *path, size_t len, int flags, mode_t mode,
+               size_t *mapped_lenp, int *is_pmemp) {
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       void *ret = pmem_map_fileU(upath, len, flags, mode, mapped_lenp,
+                                       is_pmemp);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmem_unmap -- unmap the specified region
+ */
+int
+pmem_unmap(void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+#ifndef _WIN32
+       util_range_unregister(addr, len);
+#endif
+       VALGRIND_REMOVE_PMEM_MAPPING(addr, len);
+       return util_unmap(addr, len);
+}
+
+/*
+ * pmem_memmove --  memmove to pmem
+ */
+void *
+pmem_memmove(void *pmemdest, const void *src, size_t len, unsigned flags)
+{
+       LOG(15, "pmemdest %p src %p len %zu flags 0x%x",
+                       pmemdest, src, len, flags);
+
+#ifdef DEBUG
+       if (flags & ~PMEM_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM_API_START();
+       Funcs.memmove_nodrain(pmemdest, src, len, flags & ~PMEM_F_MEM_NODRAIN,
+                       Funcs.flush);
+
+       if ((flags & (PMEM_F_MEM_NODRAIN | PMEM_F_MEM_NOFLUSH)) == 0)
+               pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memcpy --  memcpy to pmem
+ */
+void *
+pmem_memcpy(void *pmemdest, const void *src, size_t len, unsigned flags)
+{
+       LOG(15, "pmemdest %p src %p len %zu flags 0x%x",
+                       pmemdest, src, len, flags);
+
+#ifdef DEBUG
+       if (flags & ~PMEM_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM_API_START();
+       Funcs.memmove_nodrain(pmemdest, src, len, flags & ~PMEM_F_MEM_NODRAIN,
+                       Funcs.flush);
+
+       if ((flags & (PMEM_F_MEM_NODRAIN | PMEM_F_MEM_NOFLUSH)) == 0)
+               pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memset -- memset to pmem
+ */
+void *
+pmem_memset(void *pmemdest, int c, size_t len, unsigned flags)
+{
+       LOG(15, "pmemdest %p c 0x%x len %zu flags 0x%x",
+                       pmemdest, c, len, flags);
+
+#ifdef DEBUG
+       if (flags & ~PMEM_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+
+       PMEM_API_START();
+       Funcs.memset_nodrain(pmemdest, c, len, flags & ~PMEM_F_MEM_NODRAIN,
+                       Funcs.flush);
+
+       if ((flags & (PMEM_F_MEM_NODRAIN | PMEM_F_MEM_NOFLUSH)) == 0)
+               pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memmove_nodrain -- memmove to pmem without hw drain
+ */
+void *
+pmem_memmove_nodrain(void *pmemdest, const void *src, size_t len)
+{
+       LOG(15, "pmemdest %p src %p len %zu", pmemdest, src, len);
+
+       PMEM_API_START();
+
+       Funcs.memmove_nodrain(pmemdest, src, len, 0, Funcs.flush);
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memcpy_nodrain -- memcpy to pmem without hw drain
+ */
+void *
+pmem_memcpy_nodrain(void *pmemdest, const void *src, size_t len)
+{
+       LOG(15, "pmemdest %p src %p len %zu", pmemdest, src, len);
+
+       PMEM_API_START();
+
+       Funcs.memmove_nodrain(pmemdest, src, len, 0, Funcs.flush);
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memmove_persist -- memmove to pmem
+ */
+void *
+pmem_memmove_persist(void *pmemdest, const void *src, size_t len)
+{
+       LOG(15, "pmemdest %p src %p len %zu", pmemdest, src, len);
+
+       PMEM_API_START();
+
+       Funcs.memmove_nodrain(pmemdest, src, len, 0, Funcs.flush);
+       pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memcpy_persist -- memcpy to pmem
+ */
+void *
+pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
+{
+       LOG(15, "pmemdest %p src %p len %zu", pmemdest, src, len);
+
+       PMEM_API_START();
+
+       Funcs.memmove_nodrain(pmemdest, src, len, 0, Funcs.flush);
+       pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memset_nodrain -- memset to pmem without hw drain
+ */
+void *
+pmem_memset_nodrain(void *pmemdest, int c, size_t len)
+{
+       LOG(15, "pmemdest %p c %d len %zu", pmemdest, c, len);
+
+       PMEM_API_START();
+
+       Funcs.memset_nodrain(pmemdest, c, len, 0, Funcs.flush);
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * pmem_memset_persist -- memset to pmem
+ */
+void *
+pmem_memset_persist(void *pmemdest, int c, size_t len)
+{
+       LOG(15, "pmemdest %p c %d len %zu", pmemdest, c, len);
+
+       PMEM_API_START();
+
+       Funcs.memset_nodrain(pmemdest, c, len, 0, Funcs.flush);
+       pmem_drain();
+
+       PMEM_API_END();
+       return pmemdest;
+}
+
+/*
+ * memmove_nodrain_libc -- (internal) memmove to pmem using libc
+ */
+static void *
+memmove_nodrain_libc(void *pmemdest, const void *src, size_t len,
+               unsigned flags, flush_func flush)
+{
+       LOG(15, "pmemdest %p src %p len %zu flags 0x%x", pmemdest, src, len,
+                       flags);
+
+       memmove(pmemdest, src, len);
+
+       if (!(flags & PMEM_F_MEM_NOFLUSH))
+               flush(pmemdest, len);
+
+       return pmemdest;
+}
+
+/*
+ * memset_nodrain_libc -- (internal) memset to pmem using libc
+ */
+static void *
+memset_nodrain_libc(void *pmemdest, int c, size_t len, unsigned flags,
+               flush_func flush)
+{
+       LOG(15, "pmemdest %p c 0x%x len %zu flags 0x%x", pmemdest, c, len,
+                       flags);
+
+       memset(pmemdest, c, len);
+
+       if (!(flags & PMEM_F_MEM_NOFLUSH))
+               flush(pmemdest, len);
+
+       return pmemdest;
+}
+
+/*
+ * flush_empty -- (internal) do not flush the CPU cache
+ */
+static void
+flush_empty(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       flush_empty_nolog(addr, len);
+}
+
+/*
+ * fence_empty -- (internal) issue the fence instruction
+ */
+static void
+fence_empty(void)
+{
+       LOG(15, NULL);
+
+       VALGRIND_DO_FENCE;
+}
+
+/*
+ * pmem_init -- load-time initialization for pmem.c
+ */
+void
+pmem_init(void)
+{
+       LOG(3, NULL);
+
+       struct pmem2_arch_info info;
+       info.memmove_nodrain = NULL;
+       info.memset_nodrain = NULL;
+       info.flush = NULL;
+       info.fence = NULL;
+       info.flush_has_builtin_fence = 0;
+
+       pmem2_arch_init(&info);
+
+       int flush;
+       char *e = os_getenv("PMEM_NO_FLUSH");
+       if (e && (strcmp(e, "1") == 0)) {
+               flush = 0;
+               LOG(3, "Forced not flushing CPU_cache");
+       } else if (e && (strcmp(e, "0") == 0)) {
+               flush = 1;
+               LOG(3, "Forced flushing CPU_cache");
+       } else if (pmem2_auto_flush() == 1) {
+               flush = 0;
+               LOG(3, "Not flushing CPU_cache, eADR detected");
+       } else {
+               flush = 1;
+               LOG(3, "Flushing CPU cache");
+       }
+
+       Funcs.deep_flush = info.flush;
+       if (flush) {
+               Funcs.flush = info.flush;
+               Funcs.memmove_nodrain = info.memmove_nodrain;
+               Funcs.memset_nodrain = info.memset_nodrain;
+               if (info.flush_has_builtin_fence)
+                       Funcs.fence = fence_empty;
+               else
+                       Funcs.fence = info.fence;
+       } else {
+               Funcs.memmove_nodrain = info.memmove_nodrain_eadr;
+               Funcs.memset_nodrain = info.memset_nodrain_eadr;
+               Funcs.flush = flush_empty;
+               Funcs.fence = info.fence;
+       }
+
+       char *ptr = os_getenv("PMEM_NO_GENERIC_MEMCPY");
+       long long no_generic = 0;
+       if (ptr)
+               no_generic = atoll(ptr);
+
+       if (info.memmove_nodrain == NULL) {
+               if (no_generic) {
+                       Funcs.memmove_nodrain = memmove_nodrain_libc;
+                       LOG(3, "using libc memmove");
+               } else {
+                       Funcs.memmove_nodrain = memmove_nodrain_generic;
+                       LOG(3, "using generic memmove");
+               }
+       } else {
+               Funcs.memmove_nodrain = info.memmove_nodrain;
+       }
+
+       if (info.memset_nodrain == NULL) {
+               if (no_generic) {
+                       Funcs.memset_nodrain = memset_nodrain_libc;
+                       LOG(3, "using libc memset");
+               } else {
+                       Funcs.memset_nodrain = memset_nodrain_generic;
+                       LOG(3, "using generic memset");
+               }
+       } else {
+               Funcs.memset_nodrain = info.memset_nodrain;
+       }
+
+       if (Funcs.flush == flush_empty)
+               LOG(3, "not flushing CPU cache");
+       else if (Funcs.flush != Funcs.deep_flush)
+               FATAL("invalid flush function address");
+
+       pmem_os_init(&Is_pmem);
+}
+
+/*
+ * pmem_deep_persist -- perform deep persist on a memory range
+ *
+ * It merely acts as wrapper around an msync call in most cases, the only
+ * exception is the case of an mmap'ed DAX device on Linux.
+ */
+int
+pmem_deep_persist(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       pmem_deep_flush(addr, len);
+       return pmem_deep_drain(addr, len);
+}
+
+/*
+ * pmem_deep_drain -- perform deep drain on a memory range
+ */
+int
+pmem_deep_drain(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       return os_range_deep_common((uintptr_t)addr, len);
+}
+
+#if VG_PMEMCHECK_ENABLED
+/*
+ * pmem_emit_log -- logs library and function names to pmemcheck store log
+ */
+void
+pmem_emit_log(const char *func, int order)
+{
+       util_emit_log("libpmem", func, order);
+}
+#endif
+
+#if FAULT_INJECTION
+void
+pmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       core_inject_fault_at(type, nth, at);
+}
+
+int
+pmem_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem/pmem.h b/ceph/src/pmdk/src/libpmem/pmem.h
new file mode 100644 (file)
index 0000000..7cf6bf1
--- /dev/null
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * pmem.h -- internal definitions for libpmem
+ */
+#ifndef PMEM_H
+#define PMEM_H
+
+#include <stddef.h>
+#include "alloc.h"
+#include "fault_injection.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PMEM_LOG_PREFIX "libpmem"
+#define PMEM_LOG_LEVEL_VAR "PMEM_LOG_LEVEL"
+#define PMEM_LOG_FILE_VAR "PMEM_LOG_FILE"
+
+typedef int (*is_pmem_func)(const void *addr, size_t len);
+
+void pmem_init(void);
+void pmem_os_init(is_pmem_func *func);
+
+int is_pmem_detect(const void *addr, size_t len);
+void *pmem_map_register(int fd, size_t len, const char *path, int is_dev_dax);
+
+#if FAULT_INJECTION
+void
+pmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at);
+
+int
+pmem_fault_injection_enabled(void);
+#else
+static inline void
+pmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       abort();
+}
+
+static inline int
+pmem_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem/pmem_posix.c b/ceph/src/pmdk/src/libpmem/pmem_posix.c
new file mode 100644 (file)
index 0000000..d295b13
--- /dev/null
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * pmem_posix.c -- pmem utilities with Posix implementation
+ */
+
+#include <stddef.h>
+#include <sys/mman.h>
+
+#include "pmem.h"
+#include "out.h"
+#include "mmap.h"
+
+/*
+ * is_pmem_detect -- implement pmem_is_pmem()
+ *
+ * This function returns true only if the entire range can be confirmed
+ * as being direct access persistent memory.  Finding any part of the
+ * range is not direct access, or failing to look up the information
+ * because it is unmapped or because any sort of error happens, just
+ * results in returning false.
+ */
+int
+is_pmem_detect(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       if (len == 0)
+               return 0;
+
+       int retval = util_range_is_pmem(addr, len);
+
+       LOG(4, "returning %d", retval);
+       return retval;
+}
+
+/*
+ * pmem_map_register -- memory map file and register mapping
+ */
+void *
+pmem_map_register(int fd, size_t len, const char *path, int is_dev_dax)
+{
+       LOG(3, "fd %d len %zu path %s id_dev_dax %d",
+                       fd, len, path, is_dev_dax);
+
+       void *addr;
+       int map_sync;
+       addr = util_map(fd, 0, len, MAP_SHARED, 0, 0, &map_sync);
+       if (!addr)
+               return NULL;
+
+       enum pmem_map_type type = MAX_PMEM_TYPE;
+       if (is_dev_dax)
+               type = PMEM_DEV_DAX;
+       else if (map_sync)
+               type = PMEM_MAP_SYNC;
+
+       if (type != MAX_PMEM_TYPE) {
+               if (util_range_register(addr, len, path, type)) {
+                       LOG(1, "can't track mapped region");
+                       goto err_unmap;
+               }
+       }
+
+       return addr;
+err_unmap:
+       util_unmap(addr, len);
+       return NULL;
+}
+
+/*
+ * pmem_os_init -- os-dependent part of pmem initialization
+ */
+void
+pmem_os_init(is_pmem_func *func)
+{
+       LOG(3, NULL);
+
+       *func = is_pmem_detect;
+}
diff --git a/ceph/src/pmdk/src/libpmem/pmem_windows.c b/ceph/src/pmdk/src/libpmem/pmem_windows.c
new file mode 100644 (file)
index 0000000..f8a94eb
--- /dev/null
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * pmem_windows.c -- pmem utilities with OS-specific implementation
+ */
+
+#include <memoryapi.h>
+#include "pmem.h"
+#include "out.h"
+#include "mmap.h"
+#include "win_mmap.h"
+#include "sys/mman.h"
+
+#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
+typedef BOOL (WINAPI *PQVM)(
+               HANDLE, const void *,
+               enum WIN32_MEMORY_INFORMATION_CLASS, PVOID,
+               SIZE_T, PSIZE_T);
+
+static PQVM Func_qvmi = NULL;
+#endif
+
+/*
+ * is_direct_mapped -- (internal) for each page in the given region
+ * checks with MM, if it's direct mapped.
+ */
+static int
+is_direct_mapped(const void *begin, const void *end)
+{
+       LOG(3, "begin %p end %p", begin, end);
+
+#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
+       int retval = 1;
+       WIN32_MEMORY_REGION_INFORMATION region_info;
+       SIZE_T bytes_returned;
+
+       if (Func_qvmi == NULL) {
+               LOG(4, "QueryVirtualMemoryInformation not supported, "
+                       "assuming non-DAX.");
+               return 0;
+       }
+
+       const void *begin_aligned = (const void *)rounddown((intptr_t)begin,
+                                       Pagesize);
+       const void *end_aligned = (const void *)roundup((intptr_t)end,
+                                       Pagesize);
+
+       for (const void *page = begin_aligned;
+                       page < end_aligned;
+                       page = (const void *)((char *)page + Pagesize)) {
+               if (Func_qvmi(GetCurrentProcess(), page,
+                               MemoryRegionInfo, &region_info,
+                               sizeof(region_info), &bytes_returned)) {
+                       retval = region_info.DirectMapped;
+               } else {
+                       LOG(4, "QueryVirtualMemoryInformation failed, assuming "
+                               "non-DAX.  Last error: %08x", GetLastError());
+                       retval = 0;
+               }
+
+               if (retval == 0) {
+                       LOG(4, "page %p is not direct mapped", page);
+                       break;
+               }
+       }
+
+       return retval;
+#else
+       /* if the MM API is not available the safest answer is NO */
+       return 0;
+#endif /* NTDDI_VERSION >= NTDDI_WIN10_RS1 */
+
+}
+
+/*
+ * is_pmem_detect -- implement pmem_is_pmem()
+ *
+ * This function returns true only if the entire range can be confirmed
+ * as being direct access persistent memory.  Finding any part of the
+ * range is not direct access, or failing to look up the information
+ * because it is unmapped or because any sort of error happens, just
+ * results in returning false.
+ */
+int
+is_pmem_detect(const void *addr, size_t len)
+{
+       LOG(3, "addr %p len %zu", addr, len);
+
+       if (len == 0)
+               return 0;
+
+       if (len > UINTPTR_MAX - (uintptr_t)addr) {
+               len = UINTPTR_MAX - (uintptr_t)addr;
+               LOG(4, "limit len to %zu to not get beyond address space", len);
+       }
+
+       int retval = 1;
+       const void *begin = addr;
+       const void *end = (const void *)((char *)addr + len);
+
+       LOG(4, "begin %p end %p", begin, end);
+
+       AcquireSRWLockShared(&FileMappingQLock);
+
+       PFILE_MAPPING_TRACKER mt;
+       PMDK_SORTEDQ_FOREACH(mt, &FileMappingQHead, ListEntry) {
+               if (mt->BaseAddress >= end) {
+                       LOG(4, "ignoring all mapped ranges beyond given range");
+                       break;
+               }
+               if (mt->EndAddress <= begin) {
+                       LOG(4, "skipping all mapped ranges before given range");
+                       continue;
+               }
+
+               if (!(mt->Flags & FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED)) {
+                       LOG(4, "tracked range [%p, %p) is not direct mapped",
+                               mt->BaseAddress, mt->EndAddress);
+                       retval = 0;
+                       break;
+               }
+
+               /*
+                * If there is a gap between the given region that we process
+                * currently and the mapped region in our tracking list, we
+                * need to process the gap by taking the long route of asking
+                * MM for each page in that range.
+                */
+               if (begin < mt->BaseAddress &&
+                   !is_direct_mapped(begin, mt->BaseAddress)) {
+                       LOG(4, "untracked range [%p, %p) is not direct mapped",
+                               begin, mt->BaseAddress);
+                       retval = 0;
+                       break;
+               }
+
+               /* push our begin to reflect what we have already processed */
+               begin = mt->EndAddress;
+       }
+
+       /*
+        * If we still have a range to verify, check with MM if the entire
+        * region is direct mapped.
+        */
+       if (begin < end && !is_direct_mapped(begin, end)) {
+               LOG(4, "untracked end range [%p, %p) is not direct mapped",
+                       begin, end);
+               retval = 0;
+       }
+
+       ReleaseSRWLockShared(&FileMappingQLock);
+
+       LOG(4, "returning %d", retval);
+       return retval;
+}
+
+/*
+ * pmem_map_register -- memory map file and register mapping
+ */
+void *
+pmem_map_register(int fd, size_t len, const char *path, int is_dev_dax)
+{
+       /* there is no device dax on windows */
+       ASSERTeq(is_dev_dax, 0);
+
+       return util_map(fd, 0, len, MAP_SHARED, 0, 0, NULL);
+}
+
+/*
+ * pmem_os_init -- os-dependent part of pmem initialization
+ */
+void
+pmem_os_init(is_pmem_func *func)
+{
+       LOG(3, NULL);
+
+       *func = is_pmem_detect;
+#if NTDDI_VERSION >= NTDDI_WIN10_RS1
+       Func_qvmi = (PQVM)GetProcAddress(
+                       GetModuleHandle(TEXT("KernelBase.dll")),
+                       "QueryVirtualMemoryInformation");
+#endif
+}
diff --git a/ceph/src/pmdk/src/libpmem2/Makefile b/ceph/src/pmdk/src/libpmem2/Makefile
new file mode 100644 (file)
index 0000000..4816aa3
--- /dev/null
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019-2020, Intel Corporation
+
+#
+# src/libpmem2/Makefile -- Makefile for libpmem2
+#
+
+include ../common.inc
+
+LIBRARY_NAME = pmem2
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+SOURCE =\
+       $(COMMON)/ravl.c\
+       libpmem2.c\
+       badblocks.c\
+       badblocks_$(OS_DIMM).c\
+       config.c\
+       deep_flush.c\
+       errormsg.c\
+       memops_generic.c\
+       map.c\
+       map_posix.c\
+       persist.c\
+       persist_posix.c\
+       pmem2_utils.c\
+       usc_$(OS_DIMM).c\
+       source.c\
+       source_posix.c\
+       vm_reservation.c\
+       vm_reservation_posix.c\
+       ravl_interval.c
+
+ifeq ($(OS_KERNEL_NAME),Linux)
+SOURCE +=\
+       auto_flush_linux.c\
+       deep_flush_linux.c\
+       extent_linux.c\
+       pmem2_utils_linux.c\
+       pmem2_utils_$(OS_DIMM).c
+else
+SOURCE +=\
+       auto_flush_none.c\
+       deep_flush_other.c\
+       extent_none.c\
+       pmem2_utils_other.c
+endif
+
+ifeq ($(OS_DIMM),ndctl)
+SOURCE += region_namespace_ndctl.c
+else
+SOURCE += region_namespace_none.c
+endif
+
+include $(ARCH)/sources.inc
+
+include ../core/pmemcore.inc
+
+SOURCE += $(LIBPMEM2_ARCH_SOURCE)
+
+include ../Makefile.inc
+
+include $(PMEM2)/$(ARCH)/flags.inc
+
+CFLAGS += -I. $(LIBNDCTL_CFLAGS)
+LIBS += -pthread $(LIBNDCTL_LIBS)
diff --git a/ceph/src/pmdk/src/libpmem2/aarch64/arm_cacheops.h b/ceph/src/pmdk/src/libpmem2/aarch64/arm_cacheops.h
new file mode 100644 (file)
index 0000000..5eab999
--- /dev/null
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+/*
+ * ARM inline assembly to flush and invalidate caches
+ * clwb => dc cvac
+ * clflushopt => dc civac
+ * fence => dmb ish
+ * sfence => dmb ishst
+ */
+
+/*
+ * Cache instructions on ARM:
+ * ARMv8.0-a    DC CVAC  - cache clean to Point of Coherency
+ *                         Meant for thread synchronization, usually implies
+ *                         real memory flush but may mean less.
+ * ARMv8.2-a    DC CVAP  - cache clean to Point of Persistency
+ *                         Meant exactly for our use.
+ * ARMv8.5-a    DC CVADP - cache clean to Point of Deep Persistency
+ *                         As of mid-2019 not on any commercially available CPU.
+ * Any of the above may be disabled for EL0, but it's probably safe to consider
+ * that a system configuration error.
+ * Other flags include I (like "DC CIVAC") that invalidates the cache line, but
+ * we don't want that.
+ *
+ * Memory fences:
+ * * DMB [ISH]    MFENCE
+ * * DMB [ISH]ST  SFENCE
+ * * DMB [ISH]LD  LFENCE
+ *
+ * Memory domains (cache coherency):
+ * * non-shareable - local to a single core
+ * * inner shareable (ISH) - a group of CPU clusters/sockets/other hardware
+ *      Linux requires that anything within one operating system/hypervisor
+ *      is within the same Inner Shareable domain.
+ * * outer shareable (OSH) - one or more separate ISH domains
+ * * full system (SY) - anything that can possibly access memory
+ * Docs: ARM DDI 0487E.a page B2-144.
+ *
+ * Exception (privilege) levels:
+ * * EL0 - userspace (ring 3)
+ * * EL1 - kernel (ring 0)
+ * * EL2 - hypervisor (ring -1)
+ * * EL3 - "secure world" (ring -3)
+ */
+
+#ifndef AARCH64_CACHEOPS_H
+#define AARCH64_CACHEOPS_H
+
+#include <stdlib.h>
+
+static inline void
+arm_clean_va_to_poc(void const *p __attribute__((unused)))
+{
+       asm volatile("dc cvac, %0" : : "r" (p) : "memory");
+}
+
+static inline void
+arm_store_memory_barrier(void)
+{
+       asm volatile("dmb ishst" : : : "memory");
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/aarch64/flags.inc b/ceph/src/pmdk/src/libpmem2/aarch64/flags.inc
new file mode 100644 (file)
index 0000000..e54a244
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+#
+# src/libpmem2/aarch64/flags.inc -- flags for libpmem2/arm64
+#
+
+vpath %.c $(TOP)/src/libpmem2/aarch64
+vpath %.h $(TOP)/src/libpmem2/aarch64
+
+CFLAGS += -Iaarch64
diff --git a/ceph/src/pmdk/src/libpmem2/aarch64/flush.h b/ceph/src/pmdk/src/libpmem2/aarch64/flush.h
new file mode 100644 (file)
index 0000000..880d15b
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+#ifndef ARM64_FLUSH_H
+#define ARM64_FLUSH_H
+
+#include <stdint.h>
+#include "arm_cacheops.h"
+#include "util.h"
+
+#define FLUSH_ALIGN ((uintptr_t)64)
+
+/*
+ * flush_dcache_nolog -- flush the CPU cache, using DC CVAC
+ */
+static force_inline void
+flush_dcache_nolog(const void *addr, size_t len)
+{
+       uintptr_t uptr;
+
+       /*
+        * Loop through cache-line-size (typically 64B) aligned chunks
+        * covering the given range.
+        */
+       for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
+               uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
+               arm_clean_va_to_poc((char *)uptr);
+       }
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/aarch64/init.c b/ceph/src/pmdk/src/libpmem2/aarch64/init.c
new file mode 100644 (file)
index 0000000..fe5b8c4
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+#include <string.h>
+
+#include "auto_flush.h"
+#include "flush.h"
+#include "out.h"
+#include "pmem2_arch.h"
+
+/*
+ * memory_barrier -- (internal) issue the fence instruction
+ */
+static void
+memory_barrier(void)
+{
+       LOG(15, NULL);
+       arm_store_memory_barrier();
+}
+
+/*
+ * flush_dcache -- (internal) flush the CPU cache
+ */
+static void
+flush_dcache(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       flush_dcache_nolog(addr, len);
+}
+
+/*
+ * pmem2_arch_init -- initialize architecture-specific list of pmem operations
+ */
+void
+pmem2_arch_init(struct pmem2_arch_info *info)
+{
+       LOG(3, NULL);
+
+       info->fence = memory_barrier;
+       info->flush = flush_dcache;
+
+       if (info->flush == flush_dcache)
+               LOG(3, "Synchronize VA to poc for ARM");
+       else
+               FATAL("invalid deep flush function address");
+}
diff --git a/ceph/src/pmdk/src/libpmem2/aarch64/sources.inc b/ceph/src/pmdk/src/libpmem2/aarch64/sources.inc
new file mode 100644 (file)
index 0000000..22f79ee
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+#
+# src/libpmem2/aarch64/sources.inc -- list of files for libpmem2/arm64
+#
+
+LIBPMEM2_ARCH_SOURCE = init.c
diff --git a/ceph/src/pmdk/src/libpmem2/auto_flush.h b/ceph/src/pmdk/src/libpmem2/auto_flush.h
new file mode 100644 (file)
index 0000000..8865c13
--- /dev/null
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * auto_flush.h -- auto flush detection functionality
+ */
+
+#ifndef PMEM2_AUTO_FLUSH_H
+#define PMEM2_AUTO_FLUSH_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int pmem2_auto_flush(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/auto_flush_linux.c b/ceph/src/pmdk/src/libpmem2/auto_flush_linux.c
new file mode 100644 (file)
index 0000000..ca12e34
--- /dev/null
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * auto_flush_linux.c -- Linux auto flush detection
+ */
+
+#define _GNU_SOURCE
+
+#include <inttypes.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+#include "out.h"
+#include "os.h"
+#include "fs.h"
+#include "auto_flush.h"
+
+#define BUS_DEVICE_PATH "/sys/bus/nd/devices"
+#define PERSISTENCE_DOMAIN "persistence_domain"
+#define DOMAIN_VALUE_LEN 32
+
+/*
+ * check_cpu_cache -- (internal) check if file contains "cpu_cache" entry
+ */
+static int
+check_cpu_cache(const char *domain_path)
+{
+       LOG(3, "domain_path: %s", domain_path);
+
+       char domain_value[DOMAIN_VALUE_LEN];
+       int domain_fd;
+       int cpu_cache = 0;
+
+       if ((domain_fd = os_open(domain_path, O_RDONLY)) < 0) {
+               LOG(1, "!open(\"%s\", O_RDONLY)", domain_path);
+                       goto end;
+       }
+       ssize_t len = read(domain_fd, domain_value,
+                       DOMAIN_VALUE_LEN);
+
+       if (len < 0) {
+               ERR("!read(%d, %p, %d)", domain_fd,
+                       domain_value, DOMAIN_VALUE_LEN);
+               cpu_cache = -1;
+               goto end;
+       } else if (len == 0) {
+               errno = EIO;
+               ERR("read(%d, %p, %d) empty string",
+                       domain_fd, domain_value,
+                       DOMAIN_VALUE_LEN);
+               cpu_cache = -1;
+               goto end;
+       } else if (domain_value[len - 1] != '\n') {
+               ERR("!read(%d, %p, %d) invalid format",
+                       domain_fd, domain_value,
+                       DOMAIN_VALUE_LEN);
+               cpu_cache = -1;
+               goto end;
+       }
+
+       domain_value[len - 1] = '\0';
+       LOG(15, "detected persistent_domain: %s", domain_value);
+       if (strcmp(domain_value, "cpu_cache") == 0) {
+               LOG(15, "cpu_cache in persistent_domain: %s", domain_path);
+               cpu_cache = 1;
+       } else {
+               LOG(15, "cpu_cache not in persistent_domain: %s", domain_path);
+               cpu_cache = 0;
+       }
+
+end:
+       if (domain_fd >= 0)
+               os_close(domain_fd);
+       return cpu_cache;
+}
+
+/*
+ * check_domain_in_region -- (internal) check if region
+ * contains persistence_domain file
+ */
+static int
+check_domain_in_region(const char *region_path)
+{
+       LOG(3, "region_path: %s", region_path);
+
+       struct fs *reg = NULL;
+       struct fs_entry *reg_entry;
+       char domain_path[PATH_MAX];
+       int cpu_cache = 0;
+
+       reg = fs_new(region_path);
+       if (reg == NULL) {
+               ERR("!fs_new: \"%s\"", region_path);
+               cpu_cache = -1;
+               goto end;
+       }
+
+       while ((reg_entry = fs_read(reg)) != NULL) {
+               /*
+                * persistence_domain has to be a file type entry
+                * and it has to be first level child for region;
+                * there is no need to run into deeper levels
+                */
+               if (reg_entry->type != FS_ENTRY_FILE ||
+                               strcmp(reg_entry->name,
+                               PERSISTENCE_DOMAIN) != 0 ||
+                               reg_entry->level != 1)
+                       continue;
+
+               int ret = util_snprintf(domain_path, PATH_MAX,
+                       "%s/"PERSISTENCE_DOMAIN, region_path);
+               if (ret < 0) {
+                       ERR("!snprintf");
+                       cpu_cache = -1;
+                       goto end;
+               }
+               cpu_cache = check_cpu_cache(domain_path);
+       }
+
+end:
+       if (reg)
+               fs_delete(reg);
+       return cpu_cache;
+}
+
+/*
+ * pmem2_auto_flush -- check if platform supports auto flush for all regions
+ *
+ * Traverse "/sys/bus/nd/devices" path to find all the nvdimm regions,
+ * then for each region checks if "persistence_domain" file exists and
+ * contains "cpu_cache" string.
+ * If for any region "persistence_domain" entry does not exists, or its
+ * context is not as expected, assume eADR is not available on this platform.
+ */
+int
+pmem2_auto_flush(void)
+{
+       LOG(15, NULL);
+
+       char *device_path;
+       int cpu_cache = 0;
+
+       device_path = BUS_DEVICE_PATH;
+
+       os_stat_t sdev;
+       if (os_stat(device_path, &sdev) != 0 ||
+               S_ISDIR(sdev.st_mode) == 0) {
+               LOG(3, "eADR not supported");
+               return cpu_cache;
+       }
+
+       struct fs *dev = fs_new(device_path);
+       if (dev == NULL) {
+               ERR("!fs_new: \"%s\"", device_path);
+               return -1;
+       }
+
+       struct fs_entry *dev_entry;
+
+       while ((dev_entry = fs_read(dev)) != NULL) {
+               /*
+                * Skip if not a symlink, because we expect that
+                * region on sysfs path is a symlink.
+                * Skip if depth is different than 1, because region
+                * we are interested in should be the first level
+                * child for device.
+                */
+               if ((dev_entry->type != FS_ENTRY_SYMLINK) ||
+                               !strstr(dev_entry->name, "region") ||
+                               dev_entry->level != 1)
+                       continue;
+
+               LOG(15, "Start traversing region: %s", dev_entry->path);
+               cpu_cache = check_domain_in_region(dev_entry->path);
+               if (cpu_cache != 1)
+                       goto end;
+       }
+
+end:
+       fs_delete(dev);
+       return cpu_cache;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/auto_flush_none.c b/ceph/src/pmdk/src/libpmem2/auto_flush_none.c
new file mode 100644 (file)
index 0000000..77e930e
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, Intel Corporation */
+
+#include "auto_flush.h"
+#include "out.h"
+
+/*
+ * pmem2_auto_flush -- check if platform supports auto flush for all regions
+ */
+int
+pmem2_auto_flush(void)
+{
+       LOG(15, NULL);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/auto_flush_windows.c b/ceph/src/pmdk/src/libpmem2/auto_flush_windows.c
new file mode 100644 (file)
index 0000000..fe56e2f
--- /dev/null
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * auto_flush_windows.c -- Windows auto flush detection
+ */
+
+#include <windows.h>
+#include <inttypes.h>
+
+#include "alloc.h"
+#include "out.h"
+#include "os.h"
+#include "endian.h"
+#include "auto_flush_windows.h"
+
+/*
+ * is_nfit_available -- (internal) check if platform supports NFIT table.
+ */
+static int
+is_nfit_available()
+{
+       LOG(3, "is_nfit_available()");
+
+       DWORD signatures_size;
+       char *signatures = NULL;
+       int is_nfit = 0;
+       DWORD offset = 0;
+
+       signatures_size = EnumSystemFirmwareTables(ACPI_SIGNATURE, NULL, 0);
+       if (signatures_size == 0) {
+               ERR("!EnumSystemFirmwareTables");
+               return -1;
+       }
+       signatures = (char *)Malloc(signatures_size + 1);
+       if (signatures == NULL) {
+               ERR("!malloc");
+               return -1;
+       }
+       int ret = EnumSystemFirmwareTables(ACPI_SIGNATURE,
+                                       signatures, signatures_size);
+       signatures[signatures_size] = '\0';
+       if (ret != signatures_size) {
+               ERR("!EnumSystemFirmwareTables");
+               goto err;
+       }
+
+       while (offset <= signatures_size) {
+               int nfit_sig  = strncmp(signatures + offset,
+                               NFIT_STR_SIGNATURE, NFIT_SIGNATURE_LEN);
+               if (nfit_sig == 0) {
+                       is_nfit = 1;
+                       break;
+               }
+               offset += NFIT_SIGNATURE_LEN;
+       }
+
+       Free(signatures);
+       return is_nfit;
+
+err:
+       Free(signatures);
+       return -1;
+}
+
+/*
+ * is_auto_flush_cap_set -- (internal) check if specific
+ *                           capabilities bits are set.
+ *
+ * ACPI 6.2A Specification:
+ * Bit[0] - CPU Cache Flush to NVDIMM Durability on
+ * Power Loss Capable. If set to 1, indicates that platform
+ * ensures the entire CPU store data path is flushed to
+ * persistent memory on system power loss.
+ * Bit[1] - Memory Controller Flush to NVDIMM Durability on Power Loss Capable.
+ * If set to 1, indicates that platform provides mechanisms to automatically
+ * flush outstanding write data from the memory controller to persistent memory
+ * in the event of platform power loss. Note: If bit 0 is set to 1 then this bit
+ * shall be set to 1 as well.
+ */
+static int
+is_auto_flush_cap_set(uint32_t capabilities)
+{
+       LOG(3, "is_auto_flush_cap_set capabilities 0x%" PRIx32, capabilities);
+
+       int CPU_cache_flush = CHECK_BIT(capabilities, 0);
+       int memory_controller_flush = CHECK_BIT(capabilities, 1);
+
+       LOG(15, "CPU_cache_flush %d, memory_controller_flush %d",
+                       CPU_cache_flush, memory_controller_flush);
+       if (memory_controller_flush == 1 && CPU_cache_flush == 1)
+               return 1;
+
+       return 0;
+}
+
+/*
+ * parse_nfit_buffer -- (internal) parse nfit buffer
+ * if platform_capabilities struct is available return pcs structure.
+ */
+static struct platform_capabilities
+parse_nfit_buffer(const unsigned char *nfit_buffer, unsigned long buffer_size)
+{
+       LOG(3, "parse_nfit_buffer nfit_buffer %s, buffer_size %lu",
+                       nfit_buffer, buffer_size);
+
+       uint16_t type;
+       uint16_t length;
+       size_t offset = sizeof(struct nfit_header);
+       struct platform_capabilities pcs = {0};
+
+       while (offset < buffer_size) {
+               type = *(nfit_buffer + offset);
+               length = *(nfit_buffer + offset + 2);
+               if (type == PCS_TYPE_NUMBER) {
+                       if (length == sizeof(struct platform_capabilities)) {
+                               memmove(&pcs, nfit_buffer + offset, length);
+                               return pcs;
+                       }
+               }
+               offset += length;
+       }
+       return pcs;
+}
+
+/*
+ * pmem2_auto_flush -- check if platform supports auto flush.
+ */
+int
+pmem2_auto_flush(void)
+{
+       LOG(3, NULL);
+
+       DWORD nfit_buffer_size = 0;
+       DWORD nfit_written = 0;
+       PVOID nfit_buffer = NULL;
+       struct nfit_header *nfit_data;
+       struct platform_capabilities *pc = NULL;
+
+       int eADR = 0;
+       int is_nfit = is_nfit_available();
+       if (is_nfit == 0) {
+               LOG(15, "ACPI NFIT table not available");
+               return 0;
+       }
+       if (is_nfit < 0 || is_nfit != 1) {
+               LOG(1, "!is_nfit_available");
+               return -1;
+       }
+
+       /* get the entire nfit size */
+       nfit_buffer_size = GetSystemFirmwareTable(
+               (DWORD)ACPI_SIGNATURE, (DWORD)NFIT_REV_SIGNATURE, NULL, 0);
+       if (nfit_buffer_size == 0) {
+               ERR("!GetSystemFirmwareTable");
+               return -1;
+       }
+       /* reserve buffer */
+       nfit_buffer = (unsigned char *)Malloc(nfit_buffer_size);
+       if (nfit_buffer == NULL) {
+               ERR("!malloc");
+               goto err;
+       }
+       /* write actual nfit to buffer */
+       nfit_written = GetSystemFirmwareTable(
+               (DWORD)ACPI_SIGNATURE, (DWORD)NFIT_REV_SIGNATURE,
+               nfit_buffer, nfit_buffer_size);
+       if (nfit_written == 0) {
+               ERR("!GetSystemFirmwareTable");
+               goto err;
+       }
+
+       if (nfit_buffer_size != nfit_written) {
+               errno = ERROR_INVALID_DATA;
+               ERR("!GetSystemFirmwareTable invalid data");
+               goto err;
+       }
+
+       nfit_data = (struct nfit_header *)nfit_buffer;
+       int nfit_sig = strncmp(nfit_data->signature,
+                       NFIT_STR_SIGNATURE, NFIT_SIGNATURE_LEN);
+       if (nfit_sig != 0) {
+               ERR("!NFIT buffer has invalid data");
+               goto err;
+       }
+
+       struct platform_capabilities pcs = parse_nfit_buffer(
+                       nfit_buffer, nfit_buffer_size);
+       eADR = is_auto_flush_cap_set(pcs.capabilities);
+
+       Free(nfit_buffer);
+       return eADR;
+
+err:
+       Free(nfit_buffer);
+       return -1;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/auto_flush_windows.h b/ceph/src/pmdk/src/libpmem2/auto_flush_windows.h
new file mode 100644 (file)
index 0000000..4153d84
--- /dev/null
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+#ifndef PMEM2_AUTO_FLUSH_WINDOWS_H
+#define PMEM2_AUTO_FLUSH_WINDOWS_H 1
+
+#define ACPI_SIGNATURE 0x41435049 /* hex value of ACPI signature */
+#define NFIT_REV_SIGNATURE 0x5449464e /* hex value of htonl(NFIT) signature */
+#define NFIT_STR_SIGNATURE "NFIT"
+
+#define NFIT_SIGNATURE_LEN 4
+#define NFIT_OEM_ID_LEN 6
+#define NFIT_OEM_TABLE_ID_LEN 8
+#define NFIT_MAX_STRUCTURES 8
+
+#define PCS_RESERVED 3
+#define PCS_RESERVED_2 4
+#define PCS_TYPE_NUMBER 7
+
+/* check if bit on 'bit' position in number 'num' is set */
+#define CHECK_BIT(num, bit) (((num) >> (bit)) & 1)
+/*
+ * sets alignment of members of structure
+ */
+#pragma pack(1)
+struct platform_capabilities
+{
+       uint16_t type;
+       uint16_t length;
+       uint8_t highest_valid;
+       uint8_t reserved[PCS_RESERVED];
+       uint32_t capabilities;
+       uint8_t reserved2[PCS_RESERVED_2];
+};
+
+struct nfit_header
+{
+       uint8_t signature[NFIT_SIGNATURE_LEN];
+       uint32_t length;
+       uint8_t revision;
+       uint8_t checksum;
+       uint8_t oem_id[NFIT_OEM_ID_LEN];
+       uint8_t oem_table_id[NFIT_OEM_TABLE_ID_LEN];
+       uint32_t oem_revision;
+       uint8_t creator_id[4];
+       uint32_t creator_revision;
+       uint32_t reserved;
+};
+#pragma pack()
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/badblocks.c b/ceph/src/pmdk/src/libpmem2/badblocks.c
new file mode 100644 (file)
index 0000000..e126f3e
--- /dev/null
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * badblocks.c -- implementation of common bad blocks API
+ */
+
+#include "badblocks.h"
+#include "alloc.h"
+#include "out.h"
+
+/*
+ * badblocks_new -- zalloc bad blocks structure
+ */
+struct badblocks *
+badblocks_new(void)
+{
+       LOG(3, " ");
+
+       struct badblocks *bbs = Zalloc(sizeof(struct badblocks));
+       if (bbs == NULL) {
+               ERR("!Zalloc");
+       }
+
+       return bbs;
+}
+
+/*
+ * badblocks_delete -- free bad blocks structure
+ */
+void
+badblocks_delete(struct badblocks *bbs)
+{
+       LOG(3, "badblocks %p", bbs);
+
+       if (bbs == NULL)
+               return;
+
+       Free(bbs->bbv);
+       Free(bbs);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/badblocks_ndctl.c b/ceph/src/pmdk/src/libpmem2/badblocks_ndctl.c
new file mode 100644 (file)
index 0000000..76f724c
--- /dev/null
@@ -0,0 +1,771 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * badblocks_ndctl.c -- implementation of DIMMs API based on the ndctl library
+ */
+#define _GNU_SOURCE
+
+#include <sys/types.h>
+#include <libgen.h>
+#include <linux/falloc.h>
+#include <limits.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/sysmacros.h>
+#include <fcntl.h>
+#include <ndctl/libndctl.h>
+#include <ndctl/libdaxctl.h>
+
+#include "libpmem2.h"
+#include "pmem2_utils.h"
+#include "source.h"
+#include "region_namespace_ndctl.h"
+
+#include "file.h"
+#include "out.h"
+#include "badblocks.h"
+#include "set_badblocks.h"
+#include "extent.h"
+
+typedef int pmem2_badblock_next_type(
+               struct pmem2_badblock_context *bbctx,
+               struct pmem2_badblock *bb);
+
+typedef void *pmem2_badblock_get_next_type(
+               struct pmem2_badblock_context *bbctx);
+
+struct pmem2_badblock_context {
+       /* file descriptor */
+       int fd;
+
+       /* pmem2 file type */
+       enum pmem2_file_type file_type;
+
+       /* ndctl context */
+       struct ndctl_ctx *ctx;
+
+       /*
+        * Function pointer to:
+        * - pmem2_badblock_next_namespace() or
+        * - pmem2_badblock_next_region()
+        */
+       pmem2_badblock_next_type *pmem2_badblock_next_func;
+
+       /*
+        * Function pointer to:
+        * - pmem2_namespace_get_first_badblock() or
+        * - pmem2_namespace_get_next_badblock() or
+        * - pmem2_region_get_first_badblock() or
+        * - pmem2_region_get_next_badblock()
+        */
+       pmem2_badblock_get_next_type *pmem2_badblock_get_next_func;
+
+       /* needed only by the ndctl namespace badblock iterator */
+       struct ndctl_namespace *ndns;
+
+       /* needed only by the ndctl region badblock iterator */
+       struct {
+               struct ndctl_bus *bus;
+               struct ndctl_region *region;
+               unsigned long long ns_res; /* address of the namespace */
+               unsigned long long ns_beg; /* the begining of the namespace */
+               unsigned long long ns_end; /* the end of the namespace */
+       } rgn;
+
+       /* file's extents */
+       struct extents *exts;
+       unsigned first_extent;
+       struct pmem2_badblock last_bb;
+};
+
+/* forward declarations */
+static int pmem2_badblock_next_namespace(
+               struct pmem2_badblock_context *bbctx,
+               struct pmem2_badblock *bb);
+static int pmem2_badblock_next_region(
+               struct pmem2_badblock_context *bbctx,
+               struct pmem2_badblock *bb);
+static void *pmem2_namespace_get_first_badblock(
+               struct pmem2_badblock_context *bbctx);
+static void *pmem2_region_get_first_badblock(
+               struct pmem2_badblock_context *bbctx);
+
+/*
+ * badblocks_get_namespace_bounds -- (internal) returns the bounds
+ *                                   (offset and size) of the given namespace
+ *                                   relative to the beginning of its region
+ */
+static int
+badblocks_get_namespace_bounds(struct ndctl_region *region,
+                               struct ndctl_namespace *ndns,
+                               unsigned long long *ns_offset,
+                               unsigned long long *ns_size)
+{
+       LOG(3, "region %p namespace %p ns_offset %p ns_size %p",
+               region, ndns, ns_offset, ns_size);
+
+       struct ndctl_pfn *pfn = ndctl_namespace_get_pfn(ndns);
+       struct ndctl_dax *dax = ndctl_namespace_get_dax(ndns);
+
+       ASSERTne(ns_offset, NULL);
+       ASSERTne(ns_size, NULL);
+
+       if (pfn) {
+               *ns_offset = ndctl_pfn_get_resource(pfn);
+               if (*ns_offset == ULLONG_MAX) {
+                       ERR("(pfn) cannot read offset of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               *ns_size = ndctl_pfn_get_size(pfn);
+               if (*ns_size == ULLONG_MAX) {
+                       ERR("(pfn) cannot read size of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               LOG(10, "(pfn) ns_offset 0x%llx ns_size %llu",
+                       *ns_offset, *ns_size);
+       } else if (dax) {
+               *ns_offset = ndctl_dax_get_resource(dax);
+               if (*ns_offset == ULLONG_MAX) {
+                       ERR("(dax) cannot read offset of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               *ns_size = ndctl_dax_get_size(dax);
+               if (*ns_size == ULLONG_MAX) {
+                       ERR("(dax) cannot read size of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               LOG(10, "(dax) ns_offset 0x%llx ns_size %llu",
+                       *ns_offset, *ns_size);
+       } else { /* raw or btt */
+               *ns_offset = ndctl_namespace_get_resource(ndns);
+               if (*ns_offset == ULLONG_MAX) {
+                       ERR("(raw/btt) cannot read offset of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               *ns_size = ndctl_namespace_get_size(ndns);
+               if (*ns_size == ULLONG_MAX) {
+                       ERR("(raw/btt) cannot read size of the namespace");
+                       return PMEM2_E_CANNOT_READ_BOUNDS;
+               }
+
+               LOG(10, "(raw/btt) ns_offset 0x%llx ns_size %llu",
+                       *ns_offset, *ns_size);
+       }
+
+       unsigned long long region_offset = ndctl_region_get_resource(region);
+       if (region_offset == ULLONG_MAX) {
+               ERR("!cannot read offset of the region");
+               return PMEM2_E_ERRNO;
+       }
+
+       LOG(10, "region_offset 0x%llx", region_offset);
+       *ns_offset -= region_offset;
+
+       return 0;
+}
+
+/*
+ * badblocks_devdax_clear_one_badblock -- (internal) clear one bad block
+ *                                        in the dax device
+ */
+static int
+badblocks_devdax_clear_one_badblock(struct ndctl_bus *bus,
+                               unsigned long long address,
+                               unsigned long long length)
+{
+       LOG(3, "bus %p address 0x%llx length %llu (bytes)",
+               bus, address, length);
+
+       int ret;
+
+       struct ndctl_cmd *cmd_ars_cap = ndctl_bus_cmd_new_ars_cap(bus,
+                                                       address, length);
+       if (cmd_ars_cap == NULL) {
+               ERR("ndctl_bus_cmd_new_ars_cap() failed (bus '%s')",
+                       ndctl_bus_get_provider(bus));
+               return PMEM2_E_ERRNO;
+       }
+
+       ret = ndctl_cmd_submit(cmd_ars_cap);
+       if (ret) {
+               ERR("ndctl_cmd_submit() failed (bus '%s')",
+                       ndctl_bus_get_provider(bus));
+               /* ndctl_cmd_submit() returns -errno */
+               goto out_ars_cap;
+       }
+
+       struct ndctl_range range;
+       ret = ndctl_cmd_ars_cap_get_range(cmd_ars_cap, &range);
+       if (ret) {
+               ERR("ndctl_cmd_ars_cap_get_range() failed");
+               /* ndctl_cmd_ars_cap_get_range() returns -errno */
+               goto out_ars_cap;
+       }
+
+       struct ndctl_cmd *cmd_clear_error = ndctl_bus_cmd_new_clear_error(
+               range.address, range.length, cmd_ars_cap);
+
+       ret = ndctl_cmd_submit(cmd_clear_error);
+       if (ret) {
+               ERR("ndctl_cmd_submit() failed (bus '%s')",
+                       ndctl_bus_get_provider(bus));
+               /* ndctl_cmd_submit() returns -errno */
+               goto out_clear_error;
+       }
+
+       size_t cleared = ndctl_cmd_clear_error_get_cleared(cmd_clear_error);
+
+       LOG(4, "cleared %zu out of %llu bad blocks", cleared, length);
+
+       ASSERT(cleared <= length);
+
+       if (cleared < length) {
+               ERR("failed to clear %llu out of %llu bad blocks",
+                       length - cleared, length);
+               errno = ENXIO; /* ndctl handles such error in this way */
+               ret = PMEM2_E_ERRNO;
+       } else {
+               ret = 0;
+       }
+
+out_clear_error:
+       ndctl_cmd_unref(cmd_clear_error);
+out_ars_cap:
+       ndctl_cmd_unref(cmd_ars_cap);
+
+       return ret;
+}
+
+/*
+ * pmem2_badblock_context_new -- allocate and create a new bad block context
+ */
+int
+pmem2_badblock_context_new(struct pmem2_badblock_context **bbctx,
+       const struct pmem2_source *src)
+{
+       LOG(3, "src %p bbctx %p", src, bbctx);
+       PMEM2_ERR_CLR();
+
+       ASSERTne(bbctx, NULL);
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not support bad blocks");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_FD);
+
+       struct ndctl_ctx *ctx;
+       struct ndctl_region *region;
+       struct ndctl_namespace *ndns;
+       struct pmem2_badblock_context *tbbctx = NULL;
+       enum pmem2_file_type pmem2_type;
+       int ret = PMEM2_E_UNKNOWN;
+       *bbctx = NULL;
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       pmem2_type = src->value.ftype;
+
+       ret = pmem2_region_namespace(ctx, src, &region, &ndns);
+       if (ret) {
+               LOG(1, "getting region and namespace failed");
+               goto exit_ndctl_unref;
+       }
+
+       tbbctx = pmem2_zalloc(sizeof(struct pmem2_badblock_context), &ret);
+       if (ret)
+               goto exit_ndctl_unref;
+
+       tbbctx->fd = src->value.fd;
+       tbbctx->file_type = pmem2_type;
+       tbbctx->ctx = ctx;
+
+       if (region == NULL || ndns == NULL) {
+               /* did not found any matching device */
+               *bbctx = tbbctx;
+               return 0;
+       }
+
+       if (ndctl_namespace_get_mode(ndns) == NDCTL_NS_MODE_FSDAX) {
+               tbbctx->ndns = ndns;
+               tbbctx->pmem2_badblock_next_func =
+                       pmem2_badblock_next_namespace;
+               tbbctx->pmem2_badblock_get_next_func =
+                       pmem2_namespace_get_first_badblock;
+       } else {
+               unsigned long long ns_beg, ns_size, ns_end;
+               ret = badblocks_get_namespace_bounds(
+                               region, ndns,
+                               &ns_beg, &ns_size);
+               if (ret) {
+                       LOG(1, "cannot read namespace's bounds");
+                       goto error_free_all;
+               }
+
+               ns_end = ns_beg + ns_size - 1;
+
+               LOG(10,
+                       "namespace: begin %llu, end %llu size %llu (in 512B sectors)",
+                       B2SEC(ns_beg), B2SEC(ns_end + 1) - 1, B2SEC(ns_size));
+
+               tbbctx->rgn.bus = ndctl_region_get_bus(region);
+               tbbctx->rgn.region = region;
+               tbbctx->rgn.ns_beg = ns_beg;
+               tbbctx->rgn.ns_end = ns_end;
+               tbbctx->rgn.ns_res = ns_beg + ndctl_region_get_resource(region);
+               tbbctx->pmem2_badblock_next_func =
+                       pmem2_badblock_next_region;
+               tbbctx->pmem2_badblock_get_next_func =
+                       pmem2_region_get_first_badblock;
+       }
+
+       if (pmem2_type == PMEM2_FTYPE_REG) {
+               /* only regular files have extents */
+               ret = pmem2_extents_create_get(src->value.fd, &tbbctx->exts);
+               if (ret) {
+                       LOG(1, "getting extents of fd %i failed",
+                               src->value.fd);
+                       goto error_free_all;
+               }
+       }
+
+       /* set the context */
+       *bbctx = tbbctx;
+
+       return 0;
+
+error_free_all:
+       pmem2_extents_destroy(&tbbctx->exts);
+       Free(tbbctx);
+
+exit_ndctl_unref:
+       ndctl_unref(ctx);
+
+       return ret;
+}
+
+/*
+ * pmem2_badblock_context_delete -- delete and free the bad block context
+ */
+void
+pmem2_badblock_context_delete(struct pmem2_badblock_context **bbctx)
+{
+       LOG(3, "bbctx %p", bbctx);
+       PMEM2_ERR_CLR();
+
+       ASSERTne(bbctx, NULL);
+
+       if (*bbctx == NULL)
+               return;
+
+       struct pmem2_badblock_context *tbbctx = *bbctx;
+
+       pmem2_extents_destroy(&tbbctx->exts);
+       ndctl_unref(tbbctx->ctx);
+       Free(tbbctx);
+
+       *bbctx = NULL;
+}
+
+/*
+ * pmem2_namespace_get_next_badblock -- (internal) wrapper for
+ *                                      ndctl_namespace_get_next_badblock
+ */
+static void *
+pmem2_namespace_get_next_badblock(struct pmem2_badblock_context *bbctx)
+{
+       LOG(3, "bbctx %p", bbctx);
+
+       return ndctl_namespace_get_next_badblock(bbctx->ndns);
+}
+
+/*
+ * pmem2_namespace_get_first_badblock -- (internal) wrapper for
+ *                                       ndctl_namespace_get_first_badblock
+ */
+static void *
+pmem2_namespace_get_first_badblock(struct pmem2_badblock_context *bbctx)
+{
+       LOG(3, "bbctx %p", bbctx);
+
+       bbctx->pmem2_badblock_get_next_func = pmem2_namespace_get_next_badblock;
+       return ndctl_namespace_get_first_badblock(bbctx->ndns);
+}
+
+/*
+ * pmem2_region_get_next_badblock -- (internal) wrapper for
+ *                                   ndctl_region_get_next_badblock
+ */
+static void *
+pmem2_region_get_next_badblock(struct pmem2_badblock_context *bbctx)
+{
+       LOG(3, "bbctx %p", bbctx);
+
+       return ndctl_region_get_next_badblock(bbctx->rgn.region);
+}
+
+/*
+ * pmem2_region_get_first_badblock -- (internal) wrapper for
+ *                                    ndctl_region_get_first_badblock
+ */
+static void *
+pmem2_region_get_first_badblock(struct pmem2_badblock_context *bbctx)
+{
+       LOG(3, "bbctx %p", bbctx);
+
+       bbctx->pmem2_badblock_get_next_func = pmem2_region_get_next_badblock;
+       return ndctl_region_get_first_badblock(bbctx->rgn.region);
+}
+
+/*
+ * pmem2_badblock_next_namespace -- (internal) version of pmem2_badblock_next()
+ *                                  called for ndctl with namespace badblock
+ *                                  iterator
+ *
+ * This function works only for fsdax, but does not require any special
+ * permissions.
+ */
+static int
+pmem2_badblock_next_namespace(struct pmem2_badblock_context *bbctx,
+                               struct pmem2_badblock *bb)
+{
+       LOG(3, "bbctx %p bb %p", bbctx, bb);
+
+       ASSERTne(bbctx, NULL);
+       ASSERTne(bb, NULL);
+
+       struct badblock *bbn;
+
+       bbn = bbctx->pmem2_badblock_get_next_func(bbctx);
+       if (bbn == NULL)
+               return PMEM2_E_NO_BAD_BLOCK_FOUND;
+
+       /*
+        * libndctl returns offset and length of a bad block
+        * both expressed in 512B sectors. Offset is relative
+        * to the beginning of the namespace.
+        */
+       bb->offset = SEC2B(bbn->offset);
+       bb->length = SEC2B(bbn->len);
+
+       return 0;
+}
+
+/*
+ * pmem2_badblock_next_region -- (internal) version of pmem2_badblock_next()
+ *                               called for ndctl with region badblock iterator
+ *
+ * This function works for all types of namespaces, but requires read access to
+ * privileged device information.
+ */
+static int
+pmem2_badblock_next_region(struct pmem2_badblock_context *bbctx,
+                               struct pmem2_badblock *bb)
+{
+       LOG(3, "bbctx %p bb %p", bbctx, bb);
+
+       ASSERTne(bbctx, NULL);
+       ASSERTne(bb, NULL);
+
+       unsigned long long bb_beg, bb_end;
+       unsigned long long beg, end;
+       struct badblock *bbn;
+
+       unsigned long long ns_beg = bbctx->rgn.ns_beg;
+       unsigned long long ns_end = bbctx->rgn.ns_end;
+
+       do {
+               bbn = bbctx->pmem2_badblock_get_next_func(bbctx);
+               if (bbn == NULL)
+                       return PMEM2_E_NO_BAD_BLOCK_FOUND;
+
+               LOG(10,
+                       "region bad block: begin %llu end %llu length %u (in 512B sectors)",
+                       bbn->offset, bbn->offset + bbn->len - 1, bbn->len);
+
+               /*
+                * libndctl returns offset and length of a bad block
+                * both expressed in 512B sectors. Offset is relative
+                * to the beginning of the region.
+                */
+               bb_beg = SEC2B(bbn->offset);
+               bb_end = bb_beg + SEC2B(bbn->len) - 1;
+
+       } while (bb_beg > ns_end || ns_beg > bb_end);
+
+       beg = (bb_beg > ns_beg) ? bb_beg : ns_beg;
+       end = (bb_end < ns_end) ? bb_end : ns_end;
+
+       /*
+        * Form a new bad block structure with offset and length
+        * expressed in bytes and offset relative to the beginning
+        * of the namespace.
+        */
+       bb->offset = beg - ns_beg;
+       bb->length = end - beg + 1;
+
+       LOG(4,
+               "namespace bad block: begin %llu end %llu length %llu (in 512B sectors)",
+               B2SEC(beg - ns_beg), B2SEC(end - ns_beg), B2SEC(end - beg) + 1);
+
+       return 0;
+}
+
+/*
+ * pmem2_badblock_next -- get the next bad block
+ */
+int
+pmem2_badblock_next(struct pmem2_badblock_context *bbctx,
+                       struct pmem2_badblock *bb)
+{
+       LOG(3, "bbctx %p bb %p", bbctx, bb);
+       PMEM2_ERR_CLR();
+
+       ASSERTne(bbctx, NULL);
+       ASSERTne(bb, NULL);
+
+       struct pmem2_badblock bbn;
+       unsigned long long bb_beg;
+       unsigned long long bb_end;
+       unsigned long long bb_len;
+       unsigned long long bb_off;
+       unsigned long long ext_beg = 0; /* placate compiler warnings */
+       unsigned long long ext_end = -1ULL;
+       unsigned e;
+       int ret;
+
+       if (bbctx->rgn.region == NULL && bbctx->ndns == NULL) {
+               ERR("Cannot find any matching device, no bad blocks found");
+               return PMEM2_E_NO_BAD_BLOCK_FOUND;
+       }
+
+       struct extents *exts = bbctx->exts;
+
+       /* DAX devices have no extents */
+       if (!exts) {
+               ret = bbctx->pmem2_badblock_next_func(bbctx, &bbn);
+               *bb = bbn;
+               return ret;
+       }
+
+       /*
+        * There is at least one extent.
+        * Loop until:
+        * 1) a bad block overlaps with an extent or
+        * 2) there are no more bad blocks.
+        */
+       int bb_overlaps_with_extent = 0;
+       do {
+               if (bbctx->last_bb.length) {
+                       /*
+                        * We have saved the last bad block to check it
+                        * with the next extent saved
+                        * in bbctx->first_extent.
+                        */
+                       ASSERTne(bbctx->first_extent, 0);
+                       bbn = bbctx->last_bb;
+                       bbctx->last_bb.offset = 0;
+                       bbctx->last_bb.length = 0;
+               } else {
+                       ASSERTeq(bbctx->first_extent, 0);
+                       /* look for the next bad block */
+                       ret = bbctx->pmem2_badblock_next_func(bbctx, &bbn);
+                       if (ret)
+                               return ret;
+               }
+
+               bb_beg = bbn.offset;
+               bb_end = bb_beg + bbn.length - 1;
+
+               for (e = bbctx->first_extent;
+                               e < exts->extents_count;
+                               e++) {
+
+                       ext_beg = exts->extents[e].offset_physical;
+                       ext_end = ext_beg + exts->extents[e].length - 1;
+
+                       /* check if the bad block overlaps with the extent */
+                       if (bb_beg <= ext_end && ext_beg <= bb_end) {
+                               /* bad block overlaps with the extent */
+                               bb_overlaps_with_extent = 1;
+
+                               if (bb_end > ext_end &&
+                                   e + 1 < exts->extents_count) {
+                                       /*
+                                        * The bad block is longer than
+                                        * the extent and there are
+                                        * more extents.
+                                        * Save the current bad block
+                                        * to check it with the next extent.
+                                        */
+                                       bbctx->first_extent = e + 1;
+                                       bbctx->last_bb = bbn;
+                               } else {
+                                       /*
+                                        * All extents were checked
+                                        * with the current bad block.
+                                        */
+                                       bbctx->first_extent = 0;
+                                       bbctx->last_bb.length = 0;
+                                       bbctx->last_bb.offset = 0;
+                               }
+                               break;
+                       }
+               }
+
+               /* check all extents with the next bad block */
+               if (bb_overlaps_with_extent == 0) {
+                       bbctx->first_extent = 0;
+                       bbctx->last_bb.length = 0;
+                       bbctx->last_bb.offset = 0;
+               }
+
+       } while (bb_overlaps_with_extent == 0);
+
+       /* bad block overlaps with an extent */
+
+       bb_beg = (bb_beg > ext_beg) ? bb_beg : ext_beg;
+       bb_end = (bb_end < ext_end) ? bb_end : ext_end;
+       bb_len = bb_end - bb_beg + 1;
+       bb_off = bb_beg + exts->extents[e].offset_logical
+                       - exts->extents[e].offset_physical;
+
+       LOG(10, "bad block found: physical offset: %llu, length: %llu",
+               bb_beg, bb_len);
+
+       /* make sure the offset is block-aligned */
+       unsigned long long not_block_aligned = bb_off & (exts->blksize - 1);
+       if (not_block_aligned) {
+               bb_off -= not_block_aligned;
+               bb_len += not_block_aligned;
+       }
+
+       /* make sure the length is block-aligned */
+       bb_len = ALIGN_UP(bb_len, exts->blksize);
+
+       LOG(4, "bad block found: logical offset: %llu, length: %llu",
+               bb_off, bb_len);
+
+       /*
+        * Return the bad block with offset and length
+        * expressed in bytes and offset relative
+        * to the beginning of the file.
+        */
+       bb->offset = bb_off;
+       bb->length = bb_len;
+
+       return 0;
+}
+
+/*
+ * pmem2_badblock_clear_fsdax -- (internal) clear one bad block
+ *                               in a FSDAX device
+ */
+static int
+pmem2_badblock_clear_fsdax(int fd, const struct pmem2_badblock *bb)
+{
+       LOG(3, "fd %i badblock %p", fd, bb);
+       PMEM2_ERR_CLR();
+
+       ASSERTne(bb, NULL);
+
+       LOG(10,
+               "clearing a bad block: fd %i logical offset %zu length %zu (in 512B sectors)",
+               fd, B2SEC(bb->offset), B2SEC(bb->length));
+
+       /* fallocate() takes offset as the off_t type */
+       if (bb->offset > (size_t)INT64_MAX) {
+               ERR("bad block's offset is greater than INT64_MAX");
+               return PMEM2_E_OFFSET_OUT_OF_RANGE;
+       }
+
+       /* fallocate() takes length as the off_t type */
+       if (bb->length > (size_t)INT64_MAX) {
+               ERR("bad block's length is greater than INT64_MAX");
+               return PMEM2_E_LENGTH_OUT_OF_RANGE;
+       }
+
+       off_t offset = (off_t)bb->offset;
+       off_t length = (off_t)bb->length;
+
+       /* deallocate bad blocks */
+       if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
+                       offset, length)) {
+               ERR("!fallocate");
+               return PMEM2_E_ERRNO;
+       }
+
+       /* allocate new blocks */
+       if (fallocate(fd, FALLOC_FL_KEEP_SIZE, offset, length)) {
+               ERR("!fallocate");
+               return PMEM2_E_ERRNO;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_badblock_clear_devdax -- (internal) clear one bad block
+ *                                in a DAX device
+ */
+static int
+pmem2_badblock_clear_devdax(const struct pmem2_badblock_context *bbctx,
+                               const struct pmem2_badblock *bb)
+{
+       LOG(3, "bbctx %p bb %p", bbctx, bb);
+
+       ASSERTne(bb, NULL);
+       ASSERTne(bbctx, NULL);
+       ASSERTne(bbctx->rgn.bus, NULL);
+       ASSERTne(bbctx->rgn.ns_res, 0);
+
+       LOG(4,
+               "clearing a bad block: offset %zu length %zu (in 512B sectors)",
+               B2SEC(bb->offset), B2SEC(bb->length));
+
+       int ret = badblocks_devdax_clear_one_badblock(bbctx->rgn.bus,
+                               bb->offset + bbctx->rgn.ns_res,
+                               bb->length);
+       if (ret) {
+               LOG(1,
+                       "failed to clear a bad block: offset %zu length %zu (in 512B sectors)",
+                       B2SEC(bb->offset),
+                       B2SEC(bb->length));
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_badblock_clear -- clear one bad block
+ */
+int
+pmem2_badblock_clear(struct pmem2_badblock_context *bbctx,
+                       const struct pmem2_badblock *bb)
+{
+       LOG(3, "bbctx %p badblock %p", bbctx, bb);
+       PMEM2_ERR_CLR();
+
+       ASSERTne(bbctx, NULL);
+       ASSERTne(bb, NULL);
+
+       if (bbctx->file_type == PMEM2_FTYPE_DEVDAX)
+               return pmem2_badblock_clear_devdax(bbctx, bb);
+
+       ASSERTeq(bbctx->file_type, PMEM2_FTYPE_REG);
+
+       return pmem2_badblock_clear_fsdax(bbctx->fd, bb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/badblocks_none.c b/ceph/src/pmdk/src/libpmem2/badblocks_none.c
new file mode 100644 (file)
index 0000000..84ee79d
--- /dev/null
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * badblocks_none.c -- fake bad blocks functions
+ */
+
+#include <errno.h>
+
+#include "libpmem2.h"
+#include "out.h"
+
+/*
+ * pmem2_badblock_context_new -- allocate and create a new bad block context
+ */
+int
+pmem2_badblock_context_new(struct pmem2_badblock_context **bbctx,
+       const struct pmem2_source *src)
+{
+       return PMEM2_E_NOSUPP;
+}
+
+/*
+ * pmem2_badblock_context_delete -- delete and free the bad block context
+ */
+void
+pmem2_badblock_context_delete(
+       struct pmem2_badblock_context **bbctx)
+{
+}
+
+/*
+ * pmem2_badblock_next -- get the next bad block
+ */
+int
+pmem2_badblock_next(struct pmem2_badblock_context *bbctx,
+       struct pmem2_badblock *bb)
+{
+       return PMEM2_E_NOSUPP;
+}
+
+/*
+ * pmem2_badblock_clear -- clear one bad block
+ */
+int
+pmem2_badblock_clear(struct pmem2_badblock_context *bbctx,
+                       const struct pmem2_badblock *bb)
+{
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/config.c b/ceph/src/pmdk/src/libpmem2/config.c
new file mode 100644 (file)
index 0000000..9274788
--- /dev/null
@@ -0,0 +1,218 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * config.c -- pmem2_config implementation
+ */
+
+#include <unistd.h>
+#include "alloc.h"
+#include "config.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2.h"
+#include "pmem2_utils.h"
+
+/*
+ * pmem2_config_init -- initialize cfg structure.
+ */
+void
+pmem2_config_init(struct pmem2_config *cfg)
+{
+       cfg->offset = 0;
+       cfg->length = 0;
+       cfg->requested_max_granularity = PMEM2_GRANULARITY_INVALID;
+       cfg->sharing = PMEM2_SHARED;
+       cfg->protection_flag = PMEM2_PROT_READ | PMEM2_PROT_WRITE;
+       cfg->reserv = NULL;
+       cfg->reserv_offset = 0;
+}
+
+/*
+ * pmem2_config_new -- allocates and initialize cfg structure.
+ */
+int
+pmem2_config_new(struct pmem2_config **cfg)
+{
+       PMEM2_ERR_CLR();
+
+       int ret;
+       *cfg = pmem2_malloc(sizeof(**cfg), &ret);
+
+       if (ret)
+               return ret;
+
+       ASSERTne(cfg, NULL);
+
+       pmem2_config_init(*cfg);
+       return 0;
+}
+
+/*
+ * pmem2_config_delete -- deallocate cfg structure.
+ */
+int
+pmem2_config_delete(struct pmem2_config **cfg)
+{
+       /* we do not need to clear err because this function cannot fail */
+
+       Free(*cfg);
+       *cfg = NULL;
+       return 0;
+}
+
+/*
+ * pmem2_config_set_required_store_granularity -- set granularity
+ * requested by user in the pmem2_config structure
+ */
+int
+pmem2_config_set_required_store_granularity(struct pmem2_config *cfg,
+               enum pmem2_granularity g)
+{
+       PMEM2_ERR_CLR();
+
+       switch (g) {
+               case PMEM2_GRANULARITY_BYTE:
+               case PMEM2_GRANULARITY_CACHE_LINE:
+               case PMEM2_GRANULARITY_PAGE:
+                       break;
+               default:
+                       ERR("unknown granularity value %d", g);
+                       return PMEM2_E_GRANULARITY_NOT_SUPPORTED;
+       }
+
+       cfg->requested_max_granularity = g;
+
+       return 0;
+}
+
+/*
+ * pmem2_config_set_offset -- set offset in the pmem2_config structure
+ */
+int
+pmem2_config_set_offset(struct pmem2_config *cfg, size_t offset)
+{
+       PMEM2_ERR_CLR();
+
+       /* mmap func takes offset as a type of off_t */
+       if (offset > (size_t)INT64_MAX) {
+               ERR("offset is greater than INT64_MAX");
+               return PMEM2_E_OFFSET_OUT_OF_RANGE;
+       }
+
+       cfg->offset = offset;
+
+       return 0;
+}
+
+/*
+ * pmem2_config_set_length -- set length in the pmem2_config structure
+ */
+int
+pmem2_config_set_length(struct pmem2_config *cfg, size_t length)
+{
+       PMEM2_ERR_CLR();
+
+       cfg->length = length;
+
+       return 0;
+}
+
+/*
+ * pmem2_config_validate_length -- validate that length in the pmem2_config
+ * structure is consistent with the file length
+ */
+int
+pmem2_config_validate_length(const struct pmem2_config *cfg,
+               size_t file_len, size_t alignment)
+{
+       ASSERTne(alignment, 0);
+
+       if (file_len == 0) {
+               ERR("file length is equal 0");
+               return PMEM2_E_SOURCE_EMPTY;
+       }
+
+       if (cfg->length % alignment) {
+               ERR("length is not a multiple of %lu", alignment);
+               return PMEM2_E_LENGTH_UNALIGNED;
+       }
+
+       /* overflow check */
+       const size_t end = cfg->offset + cfg->length;
+       if (end < cfg->offset) {
+               ERR("overflow of offset and length");
+               return PMEM2_E_MAP_RANGE;
+       }
+
+       /* let's align the file size */
+       size_t aligned_file_len = file_len;
+       if (file_len % alignment)
+               aligned_file_len = ALIGN_UP(file_len, alignment);
+
+       /* validate mapping fit into the file */
+       if (end > aligned_file_len) {
+               ERR("mapping larger than file size");
+               return PMEM2_E_MAP_RANGE;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_config_set_sharing -- set the way pmem2_map_new will map the file
+ */
+int
+pmem2_config_set_sharing(struct pmem2_config *cfg, enum pmem2_sharing_type type)
+{
+       PMEM2_ERR_CLR();
+
+       switch (type) {
+               case PMEM2_SHARED:
+               case PMEM2_PRIVATE:
+                       cfg->sharing = type;
+                       break;
+               default:
+                       ERR("unknown sharing value %d", type);
+                       return PMEM2_E_INVALID_SHARING_VALUE;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_config_set_vm_reservation -- set vm_reservation in the
+ *                                    pmem2_config structure
+ */
+int
+pmem2_config_set_vm_reservation(struct pmem2_config *cfg,
+               struct pmem2_vm_reservation *rsv, size_t offset)
+{
+       PMEM2_ERR_CLR();
+
+       cfg->reserv = rsv;
+       cfg->reserv_offset = offset;
+
+       return 0;
+}
+
+/*
+ * pmem2_config_set_protection -- set protection flags
+ * in the config struct
+ */
+int
+pmem2_config_set_protection(struct pmem2_config *cfg,
+               unsigned prot)
+{
+       PMEM2_ERR_CLR();
+
+       unsigned unknown_prot = prot & ~(PMEM2_PROT_READ | PMEM2_PROT_WRITE |
+       PMEM2_PROT_EXEC | PMEM2_PROT_NONE);
+       if (unknown_prot) {
+               ERR("invalid flag %u", prot);
+               return PMEM2_E_INVALID_PROT_FLAG;
+       }
+
+       cfg->protection_flag = prot;
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/config.h b/ceph/src/pmdk/src/libpmem2/config.h
new file mode 100644 (file)
index 0000000..beb693c
--- /dev/null
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * config.h -- internal definitions for pmem2_config
+ */
+#ifndef PMEM2_CONFIG_H
+#define PMEM2_CONFIG_H
+
+#include "libpmem2.h"
+
+#define PMEM2_GRANULARITY_INVALID ((enum pmem2_granularity) (-1))
+#define PMEM2_ADDRESS_ANY 0 /* default value of the address request type */
+
+struct pmem2_config {
+       /* offset from the beginning of the file */
+       size_t offset;
+       size_t length; /* length of the mapping */
+       /* persistence granularity requested by user */
+       void *addr; /* address of the mapping */
+       int addr_request; /* address request type */
+       enum pmem2_granularity requested_max_granularity;
+       enum pmem2_sharing_type sharing; /* the way the file will be mapped */
+       unsigned protection_flag;
+       struct pmem2_vm_reservation *reserv;
+       size_t reserv_offset;
+};
+
+void pmem2_config_init(struct pmem2_config *cfg);
+
+int pmem2_config_validate_length(const struct pmem2_config *cfg,
+               size_t file_len, size_t alignment);
+
+#endif /* PMEM2_CONFIG_H */
diff --git a/ceph/src/pmdk/src/libpmem2/deep_flush.c b/ceph/src/pmdk/src/libpmem2/deep_flush.c
new file mode 100644 (file)
index 0000000..585772a
--- /dev/null
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * deep_flush.c -- pmem2_deep_flush implementation
+ */
+
+#include <stdlib.h>
+
+#include "libpmem2.h"
+#include "deep_flush.h"
+#include "out.h"
+#include "pmem2_utils.h"
+
+/*
+ * pmem2_deep_flush -- performs deep flush operation
+ */
+int
+pmem2_deep_flush(struct pmem2_map *map, void *ptr, size_t size)
+{
+       LOG(3, "map %p ptr %p size %zu", map, ptr, size);
+       PMEM2_ERR_CLR();
+
+       uintptr_t map_addr = (uintptr_t)map->addr;
+       uintptr_t map_end = map_addr + map->content_length;
+       uintptr_t flush_addr = (uintptr_t)ptr;
+       uintptr_t flush_end = flush_addr + size;
+
+       if (flush_addr < map_addr || flush_end > map_end) {
+               ERR("requested deep flush rage ptr %p size %zu"
+                       "exceeds map range %p", ptr, size, map);
+               return PMEM2_E_DEEP_FLUSH_RANGE;
+       }
+
+       int ret = map->deep_flush_fn(map, ptr, size);
+       if (ret) {
+               LOG(1, "cannot perform deep flush operation for map %p", map);
+               return ret;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/deep_flush.h b/ceph/src/pmdk/src/libpmem2/deep_flush.h
new file mode 100644 (file)
index 0000000..258f670
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * deep_flush.h -- functions for deep flush functionality
+ */
+
+#ifndef PMEM2_DEEP_FLUSH_H
+#define PMEM2_DEEP_FLUSH_H 1
+
+#include "map.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int pmem2_deep_flush_write(unsigned region_id);
+int pmem2_deep_flush_dax(struct pmem2_map *map, void *ptr, size_t size);
+int pmem2_deep_flush_page(struct pmem2_map *map, void *ptr, size_t size);
+int pmem2_deep_flush_cache(struct pmem2_map *map, void *ptr, size_t size);
+int pmem2_deep_flush_byte(struct pmem2_map *map, void *ptr, size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/deep_flush_linux.c b/ceph/src/pmdk/src/libpmem2/deep_flush_linux.c
new file mode 100644 (file)
index 0000000..567174b
--- /dev/null
@@ -0,0 +1,124 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * deep_flush_linux.c -- deep_flush functionality
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "deep_flush.h"
+#include "libpmem2.h"
+#include "map.h"
+#include "os.h"
+#include "out.h"
+#include "persist.h"
+#include "pmem2_utils.h"
+#include "region_namespace.h"
+
+/*
+ * pmem2_deep_flush_write -- perform write to deep_flush file
+ * on given region_id
+ */
+int
+pmem2_deep_flush_write(unsigned region_id)
+{
+       LOG(3, "region_id %d", region_id);
+
+       char deep_flush_path[PATH_MAX];
+       int deep_flush_fd;
+       char rbuf[2];
+
+       if (util_snprintf(deep_flush_path, PATH_MAX,
+               "/sys/bus/nd/devices/region%u/deep_flush", region_id) < 0) {
+               ERR("!snprintf");
+               return PMEM2_E_ERRNO;
+       }
+
+       if ((deep_flush_fd = os_open(deep_flush_path, O_RDONLY)) < 0) {
+               LOG(1, "!os_open(\"%s\", O_RDONLY)", deep_flush_path);
+               return 0;
+       }
+
+       if (read(deep_flush_fd, rbuf, sizeof(rbuf)) != 2) {
+               LOG(1, "!read(%d)", deep_flush_fd);
+               goto end;
+       }
+
+       if (rbuf[0] == '0' && rbuf[1] == '\n') {
+               LOG(3, "Deep flushing not needed");
+               goto end;
+       }
+
+       os_close(deep_flush_fd);
+
+       if ((deep_flush_fd = os_open(deep_flush_path, O_WRONLY)) < 0) {
+               LOG(1, "Cannot open deep_flush file %s to write",
+                       deep_flush_path);
+               return 0;
+       }
+
+       if (write(deep_flush_fd, "1", 1) != 1) {
+               LOG(1, "Cannot write to deep_flush file %d", deep_flush_fd);
+               goto end;
+       }
+
+end:
+       os_close(deep_flush_fd);
+       return 0;
+}
+
+/*
+ * pmem2_deep_flush_dax -- reads file type for map and check
+ * if it is device dax or reg file, depend on file type
+ * performs proper flush operation
+ */
+int
+pmem2_deep_flush_dax(struct pmem2_map *map, void *ptr, size_t size)
+{
+       int ret;
+       enum pmem2_file_type type = map->source.value.ftype;
+
+       if (type == PMEM2_FTYPE_REG) {
+               /*
+                * Flushing using OS-provided mechanisms requires that
+                * the address be a multiple of the page size.
+                * Align address down and change len so that [addr, addr + len)
+                * still contains the initial range.
+                */
+
+               /* round address down to page boundary */
+               uintptr_t new_addr = ALIGN_DOWN((uintptr_t)ptr, Pagesize);
+               /* increase len by the amount we gain when we round addr down */
+               size += (uintptr_t)ptr - new_addr;
+               ptr = (void *)new_addr;
+
+               ret = pmem2_flush_file_buffers_os(map, ptr, size, 0);
+               if (ret) {
+                       LOG(1, "cannot flush buffers addr %p len %zu",
+                                       ptr, size);
+                       return ret;
+               }
+       } else if (type == PMEM2_FTYPE_DEVDAX) {
+               unsigned region_id;
+               int ret = pmem2_get_region_id(&map->source, &region_id);
+               if (ret < 0) {
+                       LOG(1, "cannot find region id for dev %lu",
+                               map->source.value.st_rdev);
+                       return ret;
+               }
+               ret = pmem2_deep_flush_write(region_id);
+               if (ret) {
+                       LOG(1, "cannot write to deep_flush file for region %d",
+                               region_id);
+                       return ret;
+               }
+       } else {
+               ASSERT(0);
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/deep_flush_other.c b/ceph/src/pmdk/src/libpmem2/deep_flush_other.c
new file mode 100644 (file)
index 0000000..dd1d89a
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * deep_flush_other.c -- deep_flush functionality
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "deep_flush.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "persist.h"
+
+/*
+ * pmem2_deep_flush_dax -- performs flush buffer operation
+ */
+int
+pmem2_deep_flush_dax(struct pmem2_map *map, void *ptr, size_t size)
+{
+       int ret = pmem2_flush_file_buffers_os(map, ptr, size, 0);
+       if (ret) {
+               LOG(1, "cannot flush buffers addr %p len %zu", ptr, size);
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_deep_flush_write --  perform write to deep_flush file
+ * on given region_id (Device Dax only)
+ */
+int
+pmem2_deep_flush_write(unsigned region_id)
+{
+       const char *err =
+               "BUG: pmem2_deep_flush_write should never be called on this OS";
+       ERR("%s", err);
+       ASSERTinfo(0, err);
+
+       /* not supported */
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/deep_flush_windows.c b/ceph/src/pmdk/src/libpmem2/deep_flush_windows.c
new file mode 100644 (file)
index 0000000..01a1d09
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * deep_flush_windows.c -- deeep_flush functionality
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "deep_flush.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "persist.h"
+
+/*
+ * pmem2_deep_flush_dax -- performs flush buffer operation
+ */
+int
+pmem2_deep_flush_dax(struct pmem2_map *map, void *ptr, size_t size)
+{
+       int ret = pmem2_flush_file_buffers_os(map, ptr, size, 0);
+       if (ret) {
+               LOG(1, "cannot flush buffers addr %p len %zu", ptr, size);
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_deep_flush_write --  perform write to deep_flush file
+ * on given region_id (Device Dax only)
+ */
+int
+pmem2_deep_flush_write(unsigned region_id)
+{
+       const char *err =
+               "BUG: pmem2_deep_flush_write should never be called on this OS";
+       ERR("%s", err);
+       ASSERTinfo(0, err);
+
+       /* not supported */
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/errormsg.c b/ceph/src/pmdk/src/libpmem2/errormsg.c
new file mode 100644 (file)
index 0000000..9c7b090
--- /dev/null
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * errormsg.c -- pmem2_errormsg* implementation
+ */
+
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+
+/*
+ * pmem2_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmem2_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmem2_errormsg -- return last error message
+ */
+const char *
+pmem2_errormsg(void)
+{
+       return pmem2_errormsgU();
+}
+#else
+/*
+ * pmem2_errormsgW -- return last error message as wchar_t
+ */
+const wchar_t *
+pmem2_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+#endif
+
+/*
+ * pmem2_perrorU -- prints a descriptive error message to the stderr
+ */
+#ifndef _WIN32
+static inline void
+pmem2_perrorU(const char *format, va_list args)
+{
+       vfprintf(stderr, format, args);
+       fprintf(stderr, ": %s\n", pmem2_errormsg());
+}
+#else
+void
+pmem2_perrorU(const char *format, ...)
+{
+       va_list args;
+       va_start(args, format);
+
+       vfprintf(stderr, format, args);
+       fprintf(stderr, ": %s\n", pmem2_errormsg());
+
+       va_end(args);
+}
+#endif
+
+#ifndef _WIN32
+/*
+ * pmem2_perror -- prints a descriptive error message to the stderr
+ */
+void
+pmem2_perror(const char *format, ...)
+{
+       va_list args;
+       va_start(args, format);
+
+       pmem2_perrorU(format, args);
+
+       va_end(args);
+}
+#else
+/*
+ * pmem2_perrorW -- prints a descriptive error message to the stderr
+ */
+void
+pmem2_perrorW(const wchar_t *format, ...)
+{
+       va_list args;
+       va_start(args, format);
+
+       vfwprintf(stderr, format, args);
+       fwprintf(stderr, L": %s\n", pmem2_errormsgW());
+
+       va_end(args);
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/extent.h b/ceph/src/pmdk/src/libpmem2/extent.h
new file mode 100644 (file)
index 0000000..8c8c689
--- /dev/null
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * extent.h -- fs extent query API
+ */
+
+#ifndef PMDK_EXTENT_H
+#define PMDK_EXTENT_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct extent {
+       uint64_t offset_physical;
+       uint64_t offset_logical;
+       uint64_t length;
+};
+
+struct extents {
+       uint64_t blksize;
+       uint32_t extents_count;
+       struct extent *extents;
+};
+
+int pmem2_extents_create_get(int fd, struct extents **exts);
+void pmem2_extents_destroy(struct extents **exts);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_EXTENT_H */
diff --git a/ceph/src/pmdk/src/libpmem2/extent_linux.c b/ceph/src/pmdk/src/libpmem2/extent_linux.c
new file mode 100644 (file)
index 0000000..6491e67
--- /dev/null
@@ -0,0 +1,164 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * extent_linux.c - implementation of the linux fs extent query API
+ */
+
+#include <string.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <linux/fs.h>
+#include <linux/fiemap.h>
+
+#include "libpmem2.h"
+#include "pmem2_utils.h"
+
+#include "file.h"
+#include "out.h"
+#include "extent.h"
+#include "alloc.h"
+
+/*
+ * pmem2_extents_create_get -- allocate extents structure and get extents
+ *                             of the given file
+ */
+int
+pmem2_extents_create_get(int fd, struct extents **exts)
+{
+       LOG(3, "fd %i extents %p", fd, exts);
+
+       ASSERT(fd > 2);
+       ASSERTne(exts, NULL);
+
+       enum pmem2_file_type pmem2_type;
+       struct extents *pexts = NULL;
+       struct fiemap *fmap = NULL;
+       os_stat_t st;
+
+       if (os_fstat(fd, &st) < 0) {
+               ERR("!fstat %d", fd);
+               return PMEM2_E_ERRNO;
+       }
+
+       int ret = pmem2_get_type_from_stat(&st, &pmem2_type);
+       if (ret)
+               return ret;
+
+       /* directories do not have any extents */
+       if (pmem2_type == PMEM2_FTYPE_DIR) {
+               ERR(
+                       "checking extents does not make sense in case of directories");
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       /* allocate extents structure */
+       pexts = pmem2_zalloc(sizeof(struct extents), &ret);
+       if (ret)
+               return ret;
+
+       /* save block size */
+       LOG(10, "fd %i: block size: %li", fd, (long int)st.st_blksize);
+       pexts->blksize = (uint64_t)st.st_blksize;
+
+       /* DAX device does not have any extents */
+       if (pmem2_type == PMEM2_FTYPE_DEVDAX) {
+               *exts = pexts;
+               return 0;
+       }
+
+       ASSERTeq(pmem2_type, PMEM2_FTYPE_REG);
+
+       fmap = pmem2_zalloc(sizeof(struct fiemap), &ret);
+       if (ret)
+               goto error_free;
+
+       fmap->fm_start = 0;
+       fmap->fm_length = (size_t)st.st_size;
+       fmap->fm_flags = 0;
+       fmap->fm_extent_count = 0;
+       fmap->fm_mapped_extents = 0;
+
+       if (ioctl(fd, FS_IOC_FIEMAP, fmap) != 0) {
+               ERR("!fiemap ioctl() for fd=%d failed", fd);
+               ret = PMEM2_E_ERRNO;
+               goto error_free;
+       }
+
+       size_t newsize = sizeof(struct fiemap) +
+               fmap->fm_mapped_extents * sizeof(struct fiemap_extent);
+
+       struct fiemap *newfmap = pmem2_realloc(fmap, newsize, &ret);
+       if (ret)
+               goto error_free;
+
+       fmap = newfmap;
+       memset(fmap->fm_extents, 0, fmap->fm_mapped_extents *
+                                       sizeof(struct fiemap_extent));
+       fmap->fm_extent_count = fmap->fm_mapped_extents;
+       fmap->fm_mapped_extents = 0;
+
+       if (ioctl(fd, FS_IOC_FIEMAP, fmap) != 0) {
+               ERR("!fiemap ioctl() for fd=%d failed", fd);
+               ret = PMEM2_E_ERRNO;
+               goto error_free;
+       }
+
+       LOG(4, "file with fd=%i has %u extents:", fd, fmap->fm_mapped_extents);
+
+       /* save number of extents */
+       pexts->extents_count = fmap->fm_mapped_extents;
+
+       pexts->extents = pmem2_malloc(
+                               pexts->extents_count * sizeof(struct extent),
+                               &ret);
+       if (ret)
+               goto error_free;
+
+       /* save extents */
+       unsigned e;
+       for (e = 0; e < fmap->fm_mapped_extents; e++) {
+               pexts->extents[e].offset_physical =
+                       fmap->fm_extents[e].fe_physical;
+               pexts->extents[e].offset_logical =
+                       fmap->fm_extents[e].fe_logical;
+               pexts->extents[e].length =
+                       fmap->fm_extents[e].fe_length;
+
+               LOG(10, "   #%u: off_phy: %lu off_log: %lu len: %lu",
+                       e,
+                       pexts->extents[e].offset_physical,
+                       pexts->extents[e].offset_logical,
+                       pexts->extents[e].length);
+       }
+
+       *exts = pexts;
+
+       Free(fmap);
+
+       return 0;
+
+error_free:
+       Free(pexts->extents);
+       Free(pexts);
+       Free(fmap);
+
+       return ret;
+}
+
+/*
+ * pmem2_extents_destroy -- free extents structure
+ */
+void
+pmem2_extents_destroy(struct extents **exts)
+{
+       LOG(3, "extents %p", exts);
+
+       ASSERTne(exts, NULL);
+
+       if (*exts) {
+               Free((*exts)->extents);
+               Free(*exts);
+               *exts = NULL;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmem2/extent_none.c b/ceph/src/pmdk/src/libpmem2/extent_none.c
new file mode 100644 (file)
index 0000000..9cd8876
--- /dev/null
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * extent_none.c - fake implementation of the FS extent query API
+ */
+
+#include "libpmem2.h"
+#include "out.h"
+#include "extent.h"
+
+/*
+ * pmem2_extents_create_get -- allocate extents structure and get extents
+ *                             of the given file
+ */
+int
+pmem2_extents_create_get(int fd, struct extents **exts)
+{
+       LOG(3, "fd %i extents %p", fd, exts);
+
+       return PMEM2_E_NOSUPP;
+}
+
+/*
+ * pmem2_extents_destroy -- free extents structure
+ */
+void
+pmem2_extents_destroy(struct extents **exts)
+{
+       LOG(3, "extents %p", exts);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.c b/ceph/src/pmdk/src/libpmem2/libpmem2.c
new file mode 100644 (file)
index 0000000..e768e2f
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * libpmem2.c -- pmem2 library constructor & destructor
+ */
+
+#include "libpmem2.h"
+
+#include "map.h"
+#include "out.h"
+#include "persist.h"
+#include "pmem2.h"
+#include "util.h"
+
+/*
+ * libpmem2_init -- load-time initialization for libpmem2
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmem2_init(void)
+{
+       util_init();
+       out_init(PMEM2_LOG_PREFIX, PMEM2_LOG_LEVEL_VAR, PMEM2_LOG_FILE_VAR,
+                       PMEM2_MAJOR_VERSION, PMEM2_MINOR_VERSION);
+
+       LOG(3, NULL);
+
+       pmem2_map_init();
+       pmem2_persist_init();
+}
+
+/*
+ * libpmem2_fini -- libpmem2 cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmem2_fini(void)
+{
+       LOG(3, NULL);
+
+       pmem2_map_fini();
+       out_fini();
+}
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.def b/ceph/src/pmdk/src/libpmem2/libpmem2.def
new file mode 100644 (file)
index 0000000..ccda52c
--- /dev/null
@@ -0,0 +1,55 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2019-2020, Intel Corporation
+;;;;  End Copyright Notice
+
+LIBRARY libpmem2
+
+VERSION 1.0
+
+EXPORTS
+       pmem2_badblock_clear
+       pmem2_badblock_context_delete
+       pmem2_badblock_context_new
+       pmem2_badblock_next
+       pmem2_config_delete
+       pmem2_config_new
+       pmem2_config_set_length
+       pmem2_config_set_offset
+       pmem2_config_set_protection
+       pmem2_config_set_required_store_granularity
+       pmem2_config_set_sharing
+       pmem2_config_set_vm_reservation
+       pmem2_deep_flush
+       pmem2_errormsgU
+       pmem2_errormsgW
+       pmem2_get_drain_fn
+       pmem2_get_flush_fn
+       pmem2_get_memcpy_fn
+       pmem2_get_memmove_fn
+       pmem2_get_memset_fn
+       pmem2_get_persist_fn
+       pmem2_map_delete
+       pmem2_map_get_address
+       pmem2_map_get_size
+       pmem2_map_get_store_granularity
+       pmem2_map_new
+       pmem2_map_from_existing
+       pmem2_perrorU
+       pmem2_perrorW
+       pmem2_source_alignment
+       pmem2_source_delete
+       pmem2_source_device_idU
+       pmem2_source_device_idW
+       pmem2_source_device_usc
+       pmem2_source_from_anon
+       pmem2_source_from_fd
+       pmem2_source_from_handle
+       pmem2_source_get_handle
+       pmem2_source_size
+       pmem2_vm_reservation_delete
+       pmem2_vm_reservation_get_address
+       pmem2_vm_reservation_get_size
+       pmem2_vm_reservation_new
+
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.link.in b/ceph/src/pmdk/src/libpmem2/libpmem2.link.in
new file mode 100644 (file)
index 0000000..320b7e7
--- /dev/null
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019-2020, Intel Corporation
+#
+#
+# src/libpmem2.link -- linker link file for libpmem2
+#
+LIBPMEM2_1.0 {
+       global:
+               pmem2_badblock_clear;
+               pmem2_badblock_context_delete;
+               pmem2_badblock_context_new;
+               pmem2_badblock_next;
+               pmem2_config_delete;
+               pmem2_config_new;
+               pmem2_config_set_length;
+               pmem2_config_set_offset;
+               pmem2_config_set_protection;
+               pmem2_config_set_required_store_granularity;
+               pmem2_config_set_sharing;
+               pmem2_config_set_vm_reservation;
+               pmem2_deep_flush;
+               pmem2_errormsg;
+               pmem2_get_drain_fn;
+               pmem2_get_flush_fn;
+               pmem2_get_memcpy_fn;
+               pmem2_get_memmove_fn;
+               pmem2_get_memset_fn;
+               pmem2_get_persist_fn;
+               pmem2_map_delete;
+               pmem2_map_get_address;
+               pmem2_map_get_size;
+               pmem2_map_get_store_granularity;
+               pmem2_map_new;
+               pmem2_map_from_existing;
+               pmem2_perror;
+               pmem2_source_alignment;
+               pmem2_source_delete;
+               pmem2_source_device_id;
+               pmem2_source_device_usc;
+               pmem2_source_from_anon;
+               pmem2_source_from_fd;
+               pmem2_source_from_handle;
+               pmem2_source_get_fd;
+               pmem2_source_size;
+               pmem2_vm_reservation_delete;
+               pmem2_vm_reservation_get_address;
+               pmem2_vm_reservation_get_size;
+               pmem2_vm_reservation_new;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.rc b/ceph/src/pmdk/src/libpmem2/libpmem2.rc
new file mode 100644 (file)
index 0000000..d077a0a
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, Intel Corporation */
+
+/*
+ * libpmem2.rc -- libpmem2 resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmem2.dll"
+#define DESCRIPTION "libpmem2 - persistent memory support library v2"
+#define TYPE VFT_DLL
+#include <common.rc>
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj b/ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj
new file mode 100644 (file)
index 0000000..6492e60
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\ravl.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="deep_flush.c" />
+    <ClCompile Include="deep_flush_windows.c" />
+    <ClCompile Include="libpmem2_main.c" />
+    <ClCompile Include="libpmem2.c" />
+    <ClCompile Include="auto_flush_windows.c" />
+    <ClCompile Include="badblocks_none.c" />
+    <ClCompile Include="config.c" />
+    <ClCompile Include="errormsg.c" />
+    <ClCompile Include="map.c" />
+    <ClCompile Include="map_windows.c" />
+    <ClCompile Include="memops_generic.c" />
+    <ClCompile Include="persist.c" />
+    <ClCompile Include="persist_windows.c" />
+    <ClCompile Include="pmem2_utils.c" />
+    <ClCompile Include="pmem2_utils_other.c" />
+    <ClCompile Include="ravl_interval.c" />
+    <ClCompile Include="source.c" />
+    <ClCompile Include="source_windows.c" />
+    <ClCompile Include="usc_windows.c" />
+    <ClCompile Include="vm_reservation.c" />
+    <ClCompile Include="vm_reservation_windows.c" />
+    <ClCompile Include="x86_64\cpu.c" />
+    <ClCompile Include="x86_64\init.c" />
+    <ClCompile Include="x86_64\memcpy\memcpy_nt_sse2.c" />
+    <ClCompile Include="x86_64\memcpy\memcpy_nt_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="x86_64\memcpy\memcpy_t_sse2.c" />
+    <ClCompile Include="x86_64\memcpy\memcpy_t_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_nt_sse2.c" />
+    <ClCompile Include="x86_64\memset\memset_nt_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_t_sse2.c" />
+    <ClCompile Include="x86_64\memset\memset_t_avx.c">
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\include\libpmem2.h" />
+    <ClInclude Include="..\core\os_thread.h" />
+    <ClInclude Include="auto_flush.h" />
+    <ClInclude Include="auto_flush_windows.h" />
+    <ClInclude Include="deep_flush.h" />
+    <ClInclude Include="config.h" />
+    <ClInclude Include="map.h" />
+    <ClInclude Include="persist.h" />
+    <ClInclude Include="pmem2.h" />
+    <ClInclude Include="pmem2_arch.h" />
+    <ClInclude Include="pmem2_utils.h" />
+    <ClInclude Include="ravl_interval.h" />
+    <ClInclude Include="source.h" />
+    <ClInclude Include="vm_reservation.h" />
+    <ClInclude Include="x86_64\cpu.h" />
+    <ClInclude Include="x86_64\avx.h" />
+    <ClInclude Include="x86_64\flush.h" />
+    <ClInclude Include="x86_64\memcpy\memcpy_avx.h" />
+    <ClInclude Include="x86_64\memcpy\memcpy_avx512f.h" />
+    <ClInclude Include="x86_64\memcpy\memcpy_sse2.h" />
+    <ClInclude Include="x86_64\memcpy_memset.h" />
+    <ClInclude Include="x86_64\memset\memset_avx.h" />
+    <ClInclude Include="x86_64\memset\memset_avx512f.h" />
+    <ClInclude Include="x86_64\memset\memset_sse2.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmem2.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmem2.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{F596C36C-5C96-4F08-B420-8908AF500954}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmem2</ProjectName>
+    <RootNamespace>libpmem2</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);x86_64\</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);x86_64\</IncludePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj.filters b/ceph/src/pmdk/src/libpmem2/libpmem2.vcxproj.filters
new file mode 100644 (file)
index 0000000..1d2b5f0
--- /dev/null
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{16473205-8f12-4d4c-b1e9-e14ea3013e70}</UniqueIdentifier>
+      <Extensions>h</Extensions>
+    </Filter>
+    <Filter Include="Header Files\x86_64">
+      <UniqueIdentifier>{16473205-8f12-4d4c-b1e9-e14ea3013e71}</UniqueIdentifier>
+      <Extensions>h</Extensions>
+    </Filter>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{17275273-f923-45ff-9b7e-b2ea76561168}</UniqueIdentifier>
+      <Extensions>c;def</Extensions>
+    </Filter>
+    <Filter Include="Source Files\common">
+      <UniqueIdentifier>{6c8580b3-4650-42ca-9589-ec45a8f4278c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files\x86_64">
+      <UniqueIdentifier>{6c8580b3-4650-42ca-9589-ec45a8f4278d}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ravl.c">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmem2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmem2_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="errormsg.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="map.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="map_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="memops_generic.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="persist.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="persist_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\cpu.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\init.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memcpy\memcpy_nt_sse2.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memcpy\memcpy_nt_avx.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memcpy\memcpy_t_sse2.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memcpy\memcpy_t_avx.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_nt_sse2.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_nt_avx.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_t_sse2.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="x86_64\memset\memset_t_avx.c">
+      <Filter>Source Files\x86_64</Filter>
+    </ClCompile>
+    <ClCompile Include="source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="deep_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="deep_flush.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="vm_reservation.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="ravl_interval.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="vm_reservation_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\core\os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmem2.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="map.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pmem2.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\cpu.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memcpy\memcpy_avx512f.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memset\memset_avx512f.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memset\memset_avx.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memset\memset_sse2.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memcpy\memcpy_avx.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memcpy\memcpy_sse2.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\avx.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\flush.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="x86_64\memcpy_memset.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="pmem2_arch.h">
+      <Filter>Header Files\x86_64</Filter>
+    </ClInclude>
+    <ClInclude Include="source.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="deep_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="persist.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="ravl_interval.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="vm_reservation.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmem2.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmem2.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmem2/libpmem2_main.c b/ceph/src/pmdk/src/libpmem2/libpmem2_main.c
new file mode 100644 (file)
index 0000000..8807aa1
--- /dev/null
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, Intel Corporation */
+
+/*
+ * libpmem2_main.c -- entry point for libpmem2.dll
+ */
+
+void libpmem2_init(void);
+void libpmem2_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmem2_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               libpmem2_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/map.c b/ceph/src/pmdk/src/libpmem2/map.c
new file mode 100644 (file)
index 0000000..cce1e74
--- /dev/null
@@ -0,0 +1,294 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * map.c -- pmem2_map (common)
+ */
+
+#include "out.h"
+
+#include "alloc.h"
+#include "config.h"
+#include "map.h"
+#include "ravl_interval.h"
+#include "os.h"
+#include "os_thread.h"
+#include "persist.h"
+#include "pmem2.h"
+#include "pmem2_utils.h"
+#include "ravl.h"
+#include "sys_util.h"
+#include "valgrind_internal.h"
+
+#include <libpmem2.h>
+
+/*
+ * pmem2_map_get_address -- get mapping address
+ */
+void *
+pmem2_map_get_address(struct pmem2_map *map)
+{
+       LOG(3, "map %p", map);
+
+       /* we do not need to clear err because this function cannot fail */
+       return map->addr;
+}
+
+/*
+ * pmem2_map_get_size -- get mapping size
+ */
+size_t
+pmem2_map_get_size(struct pmem2_map *map)
+{
+       LOG(3, "map %p", map);
+
+       /* we do not need to clear err because this function cannot fail */
+       return map->content_length;
+}
+
+/*
+ * pmem2_map_get_store_granularity -- returns granularity of the mapped
+ * file
+ */
+enum pmem2_granularity
+pmem2_map_get_store_granularity(struct pmem2_map *map)
+{
+       LOG(3, "map %p", map);
+
+       /* we do not need to clear err because this function cannot fail */
+       return map->effective_granularity;
+}
+
+/*
+ * parse_force_granularity -- parse PMEM2_FORCE_GRANULARITY environment variable
+ */
+static enum pmem2_granularity
+parse_force_granularity()
+{
+       char *ptr = os_getenv("PMEM2_FORCE_GRANULARITY");
+       if (ptr) {
+               char str[11]; /* strlen("CACHE_LINE") + 1 */
+
+               if (util_safe_strcpy(str, ptr, sizeof(str))) {
+                       LOG(1, "Invalid value of PMEM2_FORCE_GRANULARITY");
+                       return PMEM2_GRANULARITY_INVALID;
+               }
+
+               char *s = str;
+               while (*s) {
+                       *s = (char)toupper((char)*s);
+                       s++;
+               }
+
+               if (strcmp(str, "BYTE") == 0) {
+                       return PMEM2_GRANULARITY_BYTE;
+               } else if (strcmp(str, "CACHE_LINE") == 0) {
+                       return PMEM2_GRANULARITY_CACHE_LINE;
+               } else if (strcmp(str, "CACHELINE") == 0) {
+                       return PMEM2_GRANULARITY_CACHE_LINE;
+               } else if (strcmp(str, "PAGE") == 0) {
+                       return PMEM2_GRANULARITY_PAGE;
+               }
+
+               LOG(1, "Invalid value of PMEM2_FORCE_GRANULARITY");
+       }
+       return PMEM2_GRANULARITY_INVALID;
+}
+
+/*
+ * get_min_granularity -- checks min available granularity
+ */
+enum pmem2_granularity
+get_min_granularity(bool eADR, bool is_pmem, enum pmem2_sharing_type sharing)
+{
+       enum pmem2_granularity force = parse_force_granularity();
+       /* PMEM2_PRIVATE sharing does not require data flushing */
+       if (sharing == PMEM2_PRIVATE)
+               return PMEM2_GRANULARITY_BYTE;
+       if (force != PMEM2_GRANULARITY_INVALID)
+               return force;
+       if (!is_pmem)
+               return PMEM2_GRANULARITY_PAGE;
+       if (!eADR)
+               return PMEM2_GRANULARITY_CACHE_LINE;
+
+       return PMEM2_GRANULARITY_BYTE;
+}
+
+/*
+ * pmem2_validate_offset -- verify if the offset is a multiple of
+ * the alignment required for the config
+ */
+int
+pmem2_validate_offset(const struct pmem2_config *cfg, size_t *offset,
+       size_t alignment)
+{
+       ASSERTne(alignment, 0);
+       if (cfg->offset % alignment) {
+               ERR("offset is not a multiple of %lu", alignment);
+               return PMEM2_E_OFFSET_UNALIGNED;
+       }
+
+       *offset = cfg->offset;
+
+       return 0;
+}
+
+/*
+ * mapping_min - return min boundary for mapping
+ */
+static size_t
+mapping_min(void *addr)
+{
+       struct pmem2_map *map = (struct pmem2_map *)addr;
+       return (size_t)map->addr;
+}
+
+/*
+ * mapping_max - return max boundary for mapping
+ */
+static size_t
+mapping_max(void *addr)
+{
+       struct pmem2_map *map = (struct pmem2_map *)addr;
+       return (size_t)map->addr + map->content_length;
+}
+
+static struct pmem2_state {
+       struct ravl_interval *range_map;
+       os_rwlock_t range_map_lock;
+} State;
+
+/*
+ * pmem2_map_init -- initialize the map module
+ */
+void
+pmem2_map_init()
+{
+       util_rwlock_init(&State.range_map_lock);
+
+       util_rwlock_wrlock(&State.range_map_lock);
+       State.range_map = ravl_interval_new(mapping_min, mapping_max);
+       util_rwlock_unlock(&State.range_map_lock);
+
+       if (!State.range_map)
+               abort();
+}
+
+/*
+ * pmem2_map_fini -- finalize the map module
+ */
+void
+pmem2_map_fini(void)
+{
+       util_rwlock_wrlock(&State.range_map_lock);
+       ravl_interval_delete(State.range_map);
+       util_rwlock_unlock(&State.range_map_lock);
+}
+
+/*
+ * pmem2_register_mapping -- register mapping in the mappings tree
+ */
+int
+pmem2_register_mapping(struct pmem2_map *map)
+{
+       util_rwlock_wrlock(&State.range_map_lock);
+       int ret = ravl_interval_insert(State.range_map, map);
+       util_rwlock_unlock(&State.range_map_lock);
+
+       return ret;
+}
+
+/*
+ * pmem2_unregister_mapping -- unregister mapping from the mappings tree
+ */
+int
+pmem2_unregister_mapping(struct pmem2_map *map)
+{
+       int ret = 0;
+       struct ravl_interval_node *node;
+
+       util_rwlock_wrlock(&State.range_map_lock);
+       node = ravl_interval_find_equal(State.range_map, map);
+       if (node) {
+               ret = ravl_interval_remove(State.range_map, node);
+       } else {
+               ERR("Cannot find mapping %p to delete", map);
+               ret = PMEM2_E_MAPPING_NOT_FOUND;
+       }
+       util_rwlock_unlock(&State.range_map_lock);
+
+       return ret;
+}
+
+/*
+ * pmem2_map_find -- find the earliest mapping overlapping with
+ * (addr, addr+size) range
+ */
+struct pmem2_map *
+pmem2_map_find(const void *addr, size_t len)
+{
+       struct pmem2_map map;
+       map.addr = (void *)addr;
+       map.content_length = len;
+
+       struct ravl_interval_node *node;
+
+       util_rwlock_rdlock(&State.range_map_lock);
+       node = ravl_interval_find(State.range_map, &map);
+       util_rwlock_unlock(&State.range_map_lock);
+
+       if (!node)
+               return NULL;
+
+       return (struct pmem2_map *)ravl_interval_data(node);
+}
+
+/*
+ * pmem2_map_from_existing -- create map object for exisiting mapping
+ */
+int
+pmem2_map_from_existing(struct pmem2_map **map_ptr,
+       const struct pmem2_source *src, void *addr, size_t len,
+       enum pmem2_granularity gran)
+{
+       int ret;
+       struct pmem2_map *map =
+               (struct pmem2_map *)pmem2_malloc(sizeof(*map), &ret);
+
+       if (!map)
+               return ret;
+
+       map->reserv = NULL;
+       map->addr = addr;
+       map->reserved_length = 0;
+       map->content_length = len;
+       map->effective_granularity = gran;
+       pmem2_set_flush_fns(map);
+       pmem2_set_mem_fns(map);
+       map->source = *src;
+
+#ifndef _WIN32
+       /* fd should not be used after map */
+       map->source.value.fd = INVALID_FD;
+#endif
+       ret = pmem2_register_mapping(map);
+       if (ret) {
+               Free(map);
+               if (ret == -EEXIST) {
+                       ERR(
+                               "Provided mappping(addr %p len %zu) is already registered by libpmem2",
+                               addr, len);
+                       return PMEM2_E_MAP_EXISTS;
+               }
+               return ret;
+       }
+#ifndef _WIN32
+       if (src->type == PMEM2_SOURCE_FD) {
+               VALGRIND_REGISTER_PMEM_MAPPING(map->addr,
+                       map->content_length);
+       }
+#endif
+       *map_ptr = map;
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/map.h b/ceph/src/pmdk/src/libpmem2/map.h
new file mode 100644 (file)
index 0000000..9cc1729
--- /dev/null
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * map.h -- internal definitions for libpmem2
+ */
+#ifndef PMEM2_MAP_H
+#define PMEM2_MAP_H
+
+#include <stddef.h>
+#include <stdbool.h>
+#include "libpmem2.h"
+#include "os.h"
+#include "source.h"
+#include "vm_reservation.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int (*pmem2_deep_flush_fn)(struct pmem2_map *map,
+               void *ptr, size_t size);
+
+struct pmem2_map {
+       void *addr; /* base address */
+       size_t reserved_length; /* length of the mapping reservation */
+       size_t content_length; /* length of the mapped content */
+       /* effective persistence granularity */
+       enum pmem2_granularity effective_granularity;
+
+       pmem2_persist_fn persist_fn;
+       pmem2_flush_fn flush_fn;
+       pmem2_drain_fn drain_fn;
+       pmem2_deep_flush_fn deep_flush_fn;
+
+       pmem2_memmove_fn memmove_fn;
+       pmem2_memcpy_fn memcpy_fn;
+       pmem2_memset_fn memset_fn;
+
+       struct pmem2_source source;
+       struct pmem2_vm_reservation *reserv;
+};
+
+enum pmem2_granularity get_min_granularity(bool eADR, bool is_pmem,
+                                       enum pmem2_sharing_type sharing);
+struct pmem2_map *pmem2_map_find(const void *addr, size_t len);
+int pmem2_register_mapping(struct pmem2_map *map);
+int pmem2_unregister_mapping(struct pmem2_map *map);
+void pmem2_map_init(void);
+void pmem2_map_fini(void);
+
+int pmem2_validate_offset(const struct pmem2_config *cfg,
+       size_t *offset, size_t alignment);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* map.h */
diff --git a/ceph/src/pmdk/src/libpmem2/map_posix.c b/ceph/src/pmdk/src/libpmem2/map_posix.c
new file mode 100644 (file)
index 0000000..0b042aa
--- /dev/null
@@ -0,0 +1,609 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * map_posix.c -- pmem2_map (POSIX)
+ */
+
+#include <errno.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#include "libpmem2.h"
+
+#include "alloc.h"
+#include "auto_flush.h"
+#include "config.h"
+#include "file.h"
+#include "map.h"
+#include "out.h"
+#include "persist.h"
+#include "pmem2_utils.h"
+#include "source.h"
+#include "sys_util.h"
+#include "valgrind_internal.h"
+
+#ifndef MAP_SYNC
+#define MAP_SYNC 0x80000
+#endif
+
+#ifndef MAP_SHARED_VALIDATE
+#define MAP_SHARED_VALIDATE 0x03
+#endif
+
+#define MEGABYTE ((uintptr_t)1 << 20)
+#define GIGABYTE ((uintptr_t)1 << 30)
+
+/* indicates the cases in which the error cannot occur */
+#define GRAN_IMPOSSIBLE "impossible"
+#ifdef __linux__
+       /* requested CACHE_LINE, available PAGE */
+#define REQ_CL_AVAIL_PG \
+       "requested granularity not available because fd doesn't point to DAX-enabled file " \
+       "or kernel doesn't support MAP_SYNC flag (Linux >= 4.15)"
+
+/* requested BYTE, available PAGE */
+#define REQ_BY_AVAIL_PG REQ_CL_AVAIL_PG
+
+/* requested BYTE, available CACHE_LINE */
+#define REQ_BY_AVAIL_CL \
+       "requested granularity not available because the platform doesn't support eADR"
+
+static const char *granularity_err_msg[3][3] = {
+/*             requested granularity / available granularity           */
+/* -------------------------------------------------------------------- */
+/*             BYTE            CACHE_LINE              PAGE            */
+/* -------------------------------------------------------------------- */
+/* BYTE */ {GRAN_IMPOSSIBLE,   REQ_BY_AVAIL_CL,        REQ_BY_AVAIL_PG},
+/* CL  */ {GRAN_IMPOSSIBLE,    GRAN_IMPOSSIBLE,        REQ_CL_AVAIL_PG},
+/* PAGE */ {GRAN_IMPOSSIBLE,   GRAN_IMPOSSIBLE,        GRAN_IMPOSSIBLE}};
+#else
+/* requested CACHE_LINE, available PAGE */
+#define REQ_CL_AVAIL_PG \
+       "the operating system doesn't provide a method of detecting granularity"
+
+/* requested BYTE, available PAGE */
+#define REQ_BY_AVAIL_PG \
+       "the operating system doesn't provide a method of detecting whether the platform supports eADR"
+
+static const char *granularity_err_msg[3][3] = {
+/*             requested granularity / available granularity           */
+/* -------------------------------------------------------------------- */
+/*             BYTE            CACHE_LINE              PAGE            */
+/* -------------------------------------------------------------------- */
+/* BYTE */ {GRAN_IMPOSSIBLE,   GRAN_IMPOSSIBLE,        REQ_BY_AVAIL_PG},
+/* CL  */ {GRAN_IMPOSSIBLE,    GRAN_IMPOSSIBLE,        REQ_CL_AVAIL_PG},
+/* PAGE */ {GRAN_IMPOSSIBLE,   GRAN_IMPOSSIBLE,        GRAN_IMPOSSIBLE}};
+#endif
+
+/*
+ * get_map_alignment -- (internal) choose the desired mapping alignment
+ *
+ * The smallest supported alignment is 2 megabytes because of the object
+ * alignment requirements. Changing this value to 4 kilobytes constitutes a
+ * layout change.
+ *
+ * Use 1GB page alignment only if the mapping length is at least
+ * twice as big as the page size.
+ */
+static inline size_t
+get_map_alignment(size_t len, size_t req_align)
+{
+       size_t align = 2 * MEGABYTE;
+       if (req_align)
+               align = req_align;
+       else if (len >= 2 * GIGABYTE)
+               align = GIGABYTE;
+
+       return align;
+}
+
+/*
+ * map_reserve -- (internal) reserve an address for mmap()
+ *
+ * ALSR in 64-bit Linux kernel uses 28-bit of randomness for mmap
+ * (bit positions 12-39), which means the base mapping address is randomized
+ * within [0..1024GB] range, with 4KB granularity.  Assuming additional
+ * 1GB alignment, it results in 1024 possible locations.
+ */
+static int
+map_reserve(size_t len, size_t alignment, void **reserv, size_t *reslen,
+               const struct pmem2_config *cfg)
+{
+       ASSERTne(reserv, NULL);
+
+       size_t dlength = len + alignment; /* dummy length */
+
+       /*
+        * Create dummy mapping to find an unused region of given size.
+        * Request for increased size for later address alignment.
+        * Use MAP_PRIVATE with read-only access to simulate
+        * zero cost for overcommit accounting.  Note: MAP_NORESERVE
+        * flag is ignored if overcommit is disabled (mode 2).
+        */
+       char *daddr = mmap(NULL, dlength, PROT_READ,
+                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+       if (daddr == MAP_FAILED) {
+               if (errno == EEXIST) {
+                       ERR("!mmap MAP_FIXED_NOREPLACE");
+                       return PMEM2_E_MAPPING_EXISTS;
+               }
+               ERR("!mmap MAP_ANONYMOUS");
+               return PMEM2_E_ERRNO;
+       }
+
+       LOG(4, "system choice %p", daddr);
+       *reserv = (void *)roundup((uintptr_t)daddr, alignment);
+       /*
+        * since the last part of the reservation from (reserv + reslen == end)
+        * will be unmapped, the 'end' address has to be page-aligned.
+        * 'reserv' is already page-aligned (or even aligned to multiple of page
+        * size) so it is enough to page-align the 'reslen' value.
+        */
+       *reslen = roundup(len, Pagesize);
+       LOG(4, "hint %p", *reserv);
+
+       /*
+        * The placeholder mapping is divided into few parts:
+        *
+        * 1      2         3   4                 5
+        * |......|uuuuuuuuu|rrr|.................|
+        *
+        * Addresses:
+        * 1 == daddr
+        * 2 == reserv
+        * 3 == reserv + len
+        * 4 == reserv + reslen == end (has to be page-aligned)
+        * 5 == daddr + dlength
+        *
+        * Key:
+        * - '.' is an unused part of the placeholder
+        * - 'u' is where the actual mapping lies
+        * - 'r' is what reserved as padding
+        */
+
+       /* unmap the placeholder before the actual mapping */
+       const size_t before = (uintptr_t)(*reserv) - (uintptr_t)daddr;
+       if (before) {
+               if (munmap(daddr, before)) {
+                       ERR("!munmap");
+                       return PMEM2_E_ERRNO;
+               }
+       }
+
+       /* unmap the placeholder after the actual mapping */
+       const size_t after = dlength - *reslen - before;
+       void *end = (void *)((uintptr_t)(*reserv) + (uintptr_t)*reslen);
+       if (after)
+               if (munmap(end, after)) {
+                       ERR("!munmap");
+                       return PMEM2_E_ERRNO;
+               }
+
+       return 0;
+}
+
+/*
+ * file_map -- (internal) memory map given file into memory
+ * If (flags & MAP_PRIVATE) it uses just mmap. Otherwise, it tries to mmap with
+ * (flags | MAP_SHARED_VALIDATE | MAP_SYNC) which allows flushing from the
+ * user-space. If MAP_SYNC fails and the user did not specify it by himself it
+ * falls back to the mmap with user-provided flags.
+ */
+static int
+file_map(void *reserv, size_t len, int proto, int flags,
+               int fd, off_t offset, bool *map_sync, void **base)
+{
+       LOG(15, "reserve %p len %zu proto %x flags %x fd %d offset %ld "
+                       "map_sync %p", reserv, len, proto, flags, fd, offset,
+                       map_sync);
+
+       ASSERTne(map_sync, NULL);
+       ASSERTne(base, NULL);
+
+       /*
+        * MAP_PRIVATE and MAP_SHARED are mutually exclusive, therefore mmap
+        * with MAP_PRIVATE is executed separately.
+        */
+       if (flags & MAP_PRIVATE) {
+               *base = mmap(reserv, len, proto, flags, fd, offset);
+               if (*base == MAP_FAILED) {
+                       ERR("!mmap");
+                       return PMEM2_E_ERRNO;
+               }
+               LOG(4, "mmap with MAP_PRIVATE succeeded");
+               *map_sync = false;
+               return 0;
+       }
+
+       /* try to mmap with MAP_SYNC flag */
+       const int sync_flags = MAP_SHARED_VALIDATE | MAP_SYNC;
+       *base = mmap(reserv, len, proto, flags | sync_flags, fd, offset);
+       if (*base != MAP_FAILED) {
+               LOG(4, "mmap with MAP_SYNC succeeded");
+               *map_sync = true;
+               return 0;
+       }
+
+       /* try to mmap with MAP_SHARED flag (without MAP_SYNC) */
+       if (errno == EINVAL || errno == ENOTSUP) {
+               LOG(4, "mmap with MAP_SYNC not supported");
+               *base = mmap(reserv, len, proto, flags | MAP_SHARED, fd,
+                               offset);
+               if (*base != MAP_FAILED) {
+                       *map_sync = false;
+                       return 0;
+               }
+       }
+
+       ERR("!mmap");
+       return PMEM2_E_ERRNO;
+}
+
+/*
+ * unmap -- (internal) unmap a memory range
+ */
+static int
+unmap(void *addr, size_t len)
+{
+       int retval = munmap(addr, len);
+       if (retval < 0) {
+               ERR("!munmap");
+               return PMEM2_E_ERRNO;
+       }
+
+       return 0;
+}
+
+/*
+ * vm_reservation_mend -- replaces the given mapping with anonymous
+ *                        reservation, mending the reservation area
+ */
+static int
+vm_reservation_mend(struct pmem2_vm_reservation *rsv, void *addr, size_t size)
+{
+       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+       size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+
+       ASSERT((char *)addr >= (char *)rsv_addr &&
+                       (char *)addr + size <= (char *)rsv_addr + rsv_size);
+
+       char *daddr = mmap(addr, size, PROT_NONE,
+                       MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
+       if (daddr == MAP_FAILED) {
+               ERR("!mmap MAP_ANONYMOUS");
+               return PMEM2_E_ERRNO;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_map_new -- map memory according to provided config
+ */
+int
+pmem2_map_new(struct pmem2_map **map_ptr, const struct pmem2_config *cfg,
+               const struct pmem2_source *src)
+{
+       LOG(3, "cfg %p src %p map_ptr %p", cfg, src, map_ptr);
+       PMEM2_ERR_CLR();
+
+       int ret = 0;
+       struct pmem2_map *map;
+       size_t file_len;
+       *map_ptr = NULL;
+
+       if (cfg->requested_max_granularity == PMEM2_GRANULARITY_INVALID) {
+               ERR(
+                       "please define the max granularity requested for the mapping");
+
+               return PMEM2_E_GRANULARITY_NOT_SET;
+       }
+
+       size_t src_alignment;
+       ret = pmem2_source_alignment(src, &src_alignment);
+       if (ret)
+               return ret;
+
+       /* get file size */
+       ret = pmem2_source_size(src, &file_len);
+       if (ret)
+               return ret;
+
+       /* get offset */
+       size_t effective_offset;
+       ret = pmem2_validate_offset(cfg, &effective_offset, src_alignment);
+       if (ret)
+               return ret;
+       ASSERTeq(effective_offset, cfg->offset);
+
+       if (src->type == PMEM2_SOURCE_ANON)
+               effective_offset = 0;
+
+       os_off_t off = (os_off_t)effective_offset;
+
+       /* map input and output variables */
+       bool map_sync = false;
+       /*
+        * MAP_SHARED - is required to mmap directly the underlying hardware
+        * MAP_FIXED - is required to mmap at exact address pointed by hint
+        */
+       int flags = MAP_FIXED;
+       void *addr;
+
+       /* "translate" pmem2 protection flags into linux flags */
+       int proto = 0;
+       if (cfg->protection_flag == PMEM2_PROT_NONE)
+               proto = PROT_NONE;
+       if (cfg->protection_flag & PMEM2_PROT_EXEC)
+               proto |= PROT_EXEC;
+       if (cfg->protection_flag & PMEM2_PROT_READ)
+               proto |= PROT_READ;
+       if (cfg->protection_flag & PMEM2_PROT_WRITE)
+               proto |= PROT_WRITE;
+
+       if (src->type == PMEM2_SOURCE_FD) {
+               if (src->value.ftype == PMEM2_FTYPE_DIR) {
+                       ERR("the directory is not a supported file type");
+                       return PMEM2_E_INVALID_FILE_TYPE;
+               }
+
+               ASSERT(src->value.ftype == PMEM2_FTYPE_REG ||
+                       src->value.ftype == PMEM2_FTYPE_DEVDAX);
+
+               if (cfg->sharing == PMEM2_PRIVATE &&
+                       src->value.ftype == PMEM2_FTYPE_DEVDAX) {
+                       ERR(
+                       "device DAX does not support mapping with MAP_PRIVATE");
+                       return PMEM2_E_SRC_DEVDAX_PRIVATE;
+               }
+       }
+
+       size_t content_length, reserved_length = 0;
+       ret = pmem2_config_validate_length(cfg, file_len, src_alignment);
+       if (ret)
+               return ret;
+
+       /* without user-provided length, map to the end of the file */
+       if (cfg->length)
+               content_length = cfg->length;
+       else
+               content_length = file_len - effective_offset;
+
+       size_t alignment = get_map_alignment(content_length,
+                       src_alignment);
+
+       void *reserv_region = NULL;
+       void *rsv = cfg->reserv;
+       if (rsv) {
+               void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+               size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+               size_t rsv_offset = cfg->reserv_offset;
+
+               reserved_length = roundup(content_length, Pagesize);
+
+               if (rsv_offset % Mmap_align) {
+                       ret = PMEM2_E_OFFSET_UNALIGNED;
+                       ERR(
+                               "virtual memory reservation offset %zu is not a multiple of %llu",
+                                       rsv_offset, Mmap_align);
+                       return ret;
+               }
+
+               if (rsv_offset + reserved_length > rsv_size) {
+                       ret = PMEM2_E_LENGTH_OUT_OF_RANGE;
+                       ERR(
+                               "Reservation %p has not enough space for the intended content",
+                                       rsv);
+                       return ret;
+               }
+
+               reserv_region = (char *)rsv_addr + rsv_offset;
+               if ((size_t)reserv_region % alignment) {
+                       ret = PMEM2_E_ADDRESS_UNALIGNED;
+                       ERR(
+                               "base mapping address %p (virtual memory reservation address + offset)" \
+                               " is not a multiple of %zu required by device DAX",
+                                       reserv_region, alignment);
+                       return ret;
+               }
+
+               /* check if the region in the reservation is occupied */
+               if (vm_reservation_map_find_acquire(rsv, rsv_offset,
+                               reserved_length)) {
+                       ret = PMEM2_E_MAPPING_EXISTS;
+                       ERR(
+                               "region of the reservation %p at the offset %zu and "
+                               "length %zu is at least partly occupied by other mapping",
+                               rsv, rsv_offset, reserved_length);
+                       goto err_reservation_release;
+               }
+       } else {
+               /* find a hint for the mapping */
+               ret = map_reserve(content_length, alignment, &reserv_region,
+                               &reserved_length, cfg);
+               if (ret != 0) {
+                       if (ret == PMEM2_E_MAPPING_EXISTS)
+                               LOG(1,
+                                       "given mapping region is already occupied");
+                       else
+                               LOG(1,
+                                       "cannot find a contiguous region of given size");
+                       return ret;
+               }
+       }
+
+       ASSERTne(reserv_region, NULL);
+
+       if (cfg->sharing == PMEM2_PRIVATE) {
+               flags |= MAP_PRIVATE;
+       }
+
+       int map_fd = INVALID_FD;
+       if (src->type == PMEM2_SOURCE_FD) {
+               map_fd = src->value.fd;
+       } else if (src->type == PMEM2_SOURCE_ANON) {
+               flags |= MAP_ANONYMOUS;
+       } else {
+               ASSERT(0);
+       }
+
+       ret = file_map(reserv_region, content_length, proto, flags, map_fd, off,
+                       &map_sync, &addr);
+       if (ret) {
+               /*
+                * unmap the reservation mapping only
+                * if it wasn't provided by the config
+                */
+               if (!rsv)
+                       munmap(reserv_region, reserved_length);
+
+               if (ret == -EACCES)
+                       ret = PMEM2_E_NO_ACCESS;
+               else if (ret == -ENOTSUP)
+                       ret = PMEM2_E_NOSUPP;
+               else if (ret == -EEXIST)
+                       ret =  PMEM2_E_MAPPING_EXISTS;
+               goto err_reservation_release;
+       }
+
+       LOG(3, "mapped at %p", addr);
+
+       bool eADR = (pmem2_auto_flush() == 1);
+       enum pmem2_granularity available_min_granularity =
+               src->type == PMEM2_SOURCE_ANON ? PMEM2_GRANULARITY_BYTE :
+               get_min_granularity(eADR, map_sync, cfg->sharing);
+
+       if (available_min_granularity > cfg->requested_max_granularity) {
+               const char *err = granularity_err_msg
+                       [cfg->requested_max_granularity]
+                       [available_min_granularity];
+               if (strcmp(err, GRAN_IMPOSSIBLE) == 0)
+                       FATAL(
+                               "unhandled granularity error: available_min_granularity: %d" \
+                               "requested_max_granularity: %d",
+                               available_min_granularity,
+                               cfg->requested_max_granularity);
+               ERR("%s", err);
+               ret = PMEM2_E_GRANULARITY_NOT_SUPPORTED;
+               goto err_undo_mapping;
+       }
+
+       /* prepare pmem2_map structure */
+       map = (struct pmem2_map *)pmem2_malloc(sizeof(*map), &ret);
+       if (!map)
+               goto err_undo_mapping;
+
+       map->addr = addr;
+       map->reserved_length = reserved_length;
+       map->content_length = content_length;
+       map->effective_granularity = available_min_granularity;
+       pmem2_set_flush_fns(map);
+       pmem2_set_mem_fns(map);
+       map->reserv = rsv;
+       map->source = *src;
+       map->source.value.fd = INVALID_FD; /* fd should not be used after map */
+
+       ret = pmem2_register_mapping(map);
+       if (ret) {
+               goto err_free_map_struct;
+       }
+
+       if (rsv) {
+               ret = vm_reservation_map_register_release(rsv, map);
+               if (ret)
+                       goto err_unregister_map;
+       }
+
+       *map_ptr = map;
+
+       if (src->type == PMEM2_SOURCE_FD) {
+               VALGRIND_REGISTER_PMEM_MAPPING(map->addr, map->content_length);
+               VALGRIND_REGISTER_PMEM_FILE(src->value.fd,
+                       map->addr, map->content_length, 0);
+       }
+
+       return 0;
+
+err_unregister_map:
+       pmem2_unregister_mapping(map);
+err_free_map_struct:
+       Free(map);
+err_undo_mapping:
+       /*
+        * if the reservation was given by pmem2_config, instead of unmapping,
+        * we will need to mend the reservation
+        */
+       if (rsv)
+               vm_reservation_mend(rsv, addr, reserved_length);
+       else
+               unmap(addr, reserved_length);
+err_reservation_release:
+       if (rsv)
+               vm_reservation_release(rsv);
+       return ret;
+}
+
+/*
+ * pmem2_map_delete -- unmap the specified mapping
+ */
+int
+pmem2_map_delete(struct pmem2_map **map_ptr)
+{
+       LOG(3, "map_ptr %p", map_ptr);
+       PMEM2_ERR_CLR();
+
+       int ret = 0;
+       struct pmem2_map *map = *map_ptr;
+       size_t map_len = map->content_length;
+       void *map_addr = map->addr;
+       struct pmem2_vm_reservation *rsv = map->reserv;
+
+       ret = pmem2_unregister_mapping(map);
+       if (ret)
+               return ret;
+
+       /*
+        * when reserved_length==0 mapping is created by pmem2_map_from_existing
+        * such mappings are provided by the users and shouldn't be unmapped
+        * by pmem2.
+        */
+       if (map->reserved_length) {
+               VALGRIND_REMOVE_PMEM_MAPPING(map_addr, map_len);
+
+               if (rsv) {
+                       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+                       size_t rsv_offset = (size_t)map_addr - (size_t)rsv_addr;
+                       if (!vm_reservation_map_find_acquire(rsv, rsv_offset,
+                                       map_len)) {
+                               ret = PMEM2_E_MAPPING_NOT_FOUND;
+                               goto err_reservation_release;
+                       }
+
+                       ret = vm_reservation_mend(rsv, map_addr, map_len);
+                       if (ret)
+                               goto err_reservation_release;
+
+                       ret = vm_reservation_map_unregister_release(rsv, map);
+                       if (ret)
+                               goto err_register_map;
+               } else {
+                       ret = unmap(map_addr, map_len);
+                       if (ret)
+                               goto err_register_map;
+               }
+       }
+
+       Free(map);
+       *map_ptr = NULL;
+
+       return 0;
+
+err_reservation_release:
+       vm_reservation_release(rsv);
+err_register_map:
+       VALGRIND_REGISTER_PMEM_MAPPING(map_addr, map_len);
+       pmem2_register_mapping(map);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/map_windows.c b/ceph/src/pmdk/src/libpmem2/map_windows.c
new file mode 100644 (file)
index 0000000..67901ee
--- /dev/null
@@ -0,0 +1,590 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * map_windows.c -- pmem2_map (Windows)
+ */
+
+#include <stdbool.h>
+
+#include "libpmem2.h"
+
+#include "alloc.h"
+#include "auto_flush.h"
+#include "config.h"
+#include "map.h"
+#include "os_thread.h"
+#include "out.h"
+#include "persist.h"
+#include "pmem2_utils.h"
+#include "source.h"
+#include "sys_util.h"
+#include "util.h"
+
+#define HIDWORD(x) ((DWORD)((x) >> 32))
+#define LODWORD(x) ((DWORD)((x) & 0xFFFFFFFF))
+
+/* requested CACHE_LINE, available PAGE */
+#define REQ_CL_AVAIL_PG \
+       "requested granularity not available because specified volume is not a direct access (DAX) volume"
+
+/* requested BYTE, available PAGE */
+#define REQ_BY_AVAIL_PG REQ_CL_AVAIL_PG
+
+/* requested BYTE, available CACHE_LINE */
+#define REQ_BY_AVAIL_CL \
+       "requested granularity not available because the platform doesn't support eADR"
+
+/* indicates the cases in which the error cannot occur */
+#define GRAN_IMPOSSIBLE "impossible"
+static const char *granularity_err_msg[3][3] = {
+/*             requested granularity / available granularity           */
+/* -------------------------------------------------------------------- */
+/*             BYTE            CACHE_LINE              PAGE            */
+/* -------------------------------------------------------------------- */
+/* BYTE */ {GRAN_IMPOSSIBLE,   REQ_BY_AVAIL_CL,        REQ_BY_AVAIL_PG},
+/* CL  */ {GRAN_IMPOSSIBLE,    GRAN_IMPOSSIBLE,        REQ_CL_AVAIL_PG},
+/* PAGE */ {GRAN_IMPOSSIBLE,   GRAN_IMPOSSIBLE,        GRAN_IMPOSSIBLE}};
+
+/*
+ * create_mapping -- creates file mapping object for a file
+ */
+static HANDLE
+create_mapping(HANDLE hfile, size_t offset, size_t length, DWORD protect,
+               unsigned long *err)
+{
+       size_t max_size = length + offset;
+       SetLastError(0);
+       HANDLE mh = CreateFileMapping(hfile,
+               NULL, /* security attributes */
+               protect,
+               HIDWORD(max_size),
+               LODWORD(max_size),
+               NULL);
+
+       *err = GetLastError();
+       if (!mh) {
+               ERR("!!CreateFileMapping");
+               return NULL;
+       }
+
+       if (*err == ERROR_ALREADY_EXISTS) {
+               ERR("!!CreateFileMapping");
+               CloseHandle(mh);
+               return NULL;
+       }
+
+       /* if the handle is valid the last error is undefined */
+       *err = 0;
+       return mh;
+}
+
+/*
+ * is_direct_access -- check if the specified volume is a
+ * direct access (DAX) volume
+ */
+static int
+is_direct_access(HANDLE fh)
+{
+       DWORD filesystemFlags;
+
+       if (!GetVolumeInformationByHandleW(fh, NULL, 0, NULL,
+                       NULL, &filesystemFlags, NULL, 0)) {
+               ERR("!!GetVolumeInformationByHandleW");
+               /* always return a negative value */
+               return pmem2_lasterror_to_err();
+       }
+
+       if (filesystemFlags & FILE_DAX_VOLUME)
+                       return 1;
+
+       return 0;
+}
+
+struct pmem2_map *vm_reservation_map_find_closest_prior(
+               struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len);
+struct pmem2_map *vm_reservation_map_find_closest_later(
+               struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len);
+
+/*
+ * vm_reservation_unmap -- unmaps given region of the reservation,
+ *                         preserves the placeholder
+ */
+static int
+vm_reservation_unmap(struct pmem2_vm_reservation *rsv, void *addr,
+               size_t length)
+{
+       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+       size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+
+       if (addr < rsv_addr ||
+                       (char *)addr + length > (char *)rsv_addr + rsv_size)
+               return PMEM2_E_LENGTH_OUT_OF_RANGE;
+
+       int ret = UnmapViewOfFile2(GetCurrentProcess(),
+               addr,
+               MEM_PRESERVE_PLACEHOLDER);
+       if (!ret) {
+               ERR("!!UnmapViewOfFile2");
+               return pmem2_lasterror_to_err();
+       }
+
+       return 0;
+}
+
+/*
+ * vm_reservation_merge -- merges given placeholder region with his neighbouring
+ *                         placeholders
+ */
+static int
+vm_reservation_merge(struct pmem2_vm_reservation *rsv, void *addr,
+               size_t length)
+{
+       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+       size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+       size_t rsv_offset = (size_t)addr - (size_t)rsv_addr;
+
+       /*
+        * After unmapping from the reservation, it is neccessary to merge
+        * the unoccupied neighbours so that the placeholders will be available
+        * for splitting for the required size of the mapping.
+        */
+       void *merge_addr = addr;
+       size_t merge_size = length;
+       struct pmem2_map *map = NULL;
+
+       if (rsv_offset > 0) {
+               map = vm_reservation_map_find_closest_prior(rsv, rsv_offset,
+                               length);
+               if (map) {
+                       merge_addr = (char *)map->addr + map->reserved_length;
+                       merge_size += (char *)addr - (char *)merge_addr;
+               } else {
+                       merge_addr = rsv_addr;
+                       merge_size += rsv_offset;
+               }
+       }
+
+       if (rsv_offset + length < rsv_size) {
+               map = vm_reservation_map_find_closest_later(rsv, rsv_offset,
+                               length);
+               if (map)
+                       merge_size += (char *)map->addr - (char *)addr - length;
+               else
+                       merge_size += rsv_size - rsv_offset - length;
+       }
+
+       if ((addr != merge_addr) || (length != merge_size)) {
+               int ret = VirtualFree(merge_addr,
+                       merge_size,
+                       MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+               if (!ret) {
+                       ERR("!!VirtualFree");
+                       return pmem2_lasterror_to_err();
+
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * vm_reservation_split - splits the virtual memory reservation into
+ *                        separate regions
+ */
+int
+vm_reservation_split(struct pmem2_vm_reservation *rsv, size_t rsv_offset,
+               size_t length)
+{
+       LOG(3, "rsv %p rsv_offset %zu length %zu", rsv, rsv_offset, length);
+
+       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+       size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+
+       LOG(3, "rsv_addr %p rsv_size %zu", rsv_addr, rsv_size);
+
+       if ((rsv_offset > 0 && !vm_reservation_map_find(rsv,
+                       rsv_offset - 1, 1)) ||
+                       (rsv_offset + length < rsv_size &&
+                       !vm_reservation_map_find(rsv,
+                       rsv_offset + length, 1))) {
+               /* split the placeholder */
+               int ret = VirtualFree((char *)rsv_addr + rsv_offset,
+                       length,
+                       MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
+               if (!ret) {
+                       ERR("!!VirtualFree");
+                       ret = pmem2_lasterror_to_err();
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_map_new -- map memory according to provided config
+ */
+int
+pmem2_map_new(struct pmem2_map **map_ptr, const struct pmem2_config *cfg,
+               const struct pmem2_source *src)
+{
+       LOG(3, "cfg %p src %p map_ptr %p", cfg, src, map_ptr);
+       PMEM2_ERR_CLR();
+
+       int ret = 0;
+       unsigned long err = 0;
+       size_t file_size;
+       *map_ptr = NULL;
+
+       if ((int)cfg->requested_max_granularity == PMEM2_GRANULARITY_INVALID) {
+               ERR(
+                       "please define the max granularity requested for the mapping");
+
+               return PMEM2_E_GRANULARITY_NOT_SET;
+       }
+
+       ret = pmem2_source_size(src, &file_size);
+       if (ret)
+               return ret;
+
+       size_t src_alignment;
+       ret = pmem2_source_alignment(src, &src_alignment);
+       if (ret)
+               return ret;
+
+       size_t length;
+       ret = pmem2_config_validate_length(cfg, file_size, src_alignment);
+       if (ret)
+               return ret;
+
+       size_t effective_offset;
+       ret = pmem2_validate_offset(cfg, &effective_offset, src_alignment);
+       if (ret)
+               return ret;
+
+       if (src->type == PMEM2_SOURCE_ANON)
+               effective_offset = 0;
+
+       /* without user-provided length, map to the end of the file */
+       if (cfg->length)
+               length = cfg->length;
+       else
+               length = file_size - effective_offset;
+
+       HANDLE map_handle = INVALID_HANDLE_VALUE;
+       if (src->type == PMEM2_SOURCE_HANDLE) {
+               map_handle = src->value.handle;
+       } else if (src->type == PMEM2_SOURCE_ANON) {
+               /* no extra settings */
+       } else {
+               ASSERT(0);
+       }
+
+       DWORD proto = PAGE_READWRITE;
+       DWORD access = FILE_MAP_ALL_ACCESS;
+
+       /* Unsupported flag combinations */
+       if ((cfg->protection_flag == PMEM2_PROT_NONE) ||
+                       (cfg->protection_flag == PMEM2_PROT_WRITE) ||
+                       (cfg->protection_flag == PMEM2_PROT_EXEC) ||
+                       (cfg->protection_flag == (PMEM2_PROT_WRITE |
+                                       PMEM2_PROT_EXEC))) {
+               ERR("Windows does not support "
+                               "this protection flag combination.");
+               return PMEM2_E_NOSUPP;
+       }
+
+       /* Translate protection flags into Windows flags */
+       if (cfg->protection_flag & PMEM2_PROT_WRITE) {
+               if (cfg->protection_flag & PMEM2_PROT_EXEC) {
+                       proto = PAGE_EXECUTE_READWRITE;
+                       access = FILE_MAP_READ | FILE_MAP_WRITE |
+                       FILE_MAP_EXECUTE;
+               } else {
+                       /*
+                        * Due to the already done exclusion
+                        * of incorrect combinations, PROT_WRITE
+                        * implies PROT_READ
+                        */
+                       proto = PAGE_READWRITE;
+                       access = FILE_MAP_READ | FILE_MAP_WRITE;
+               }
+       } else if (cfg->protection_flag & PMEM2_PROT_READ) {
+               if (cfg->protection_flag & PMEM2_PROT_EXEC) {
+                       proto = PAGE_EXECUTE_READ;
+                       access = FILE_MAP_READ | FILE_MAP_EXECUTE;
+               } else {
+                       proto = PAGE_READONLY;
+                       access = FILE_MAP_READ;
+               }
+       }
+
+       if (cfg->sharing == PMEM2_PRIVATE) {
+               if (cfg->protection_flag & PMEM2_PROT_EXEC) {
+                       proto = PAGE_EXECUTE_WRITECOPY;
+                       access = FILE_MAP_EXECUTE | FILE_MAP_COPY;
+               } else {
+                       /*
+                        * If FILE_MAP_COPY is set,
+                        * protection is changed to read/write
+                        */
+                       proto = PAGE_READONLY;
+                       access = FILE_MAP_COPY;
+               }
+       }
+
+       /* create a file mapping handle */
+       HANDLE mh = create_mapping(map_handle, effective_offset, length,
+               proto, &err);
+
+       if (!mh) {
+               if (err == ERROR_ALREADY_EXISTS) {
+                       ERR("mapping already exists");
+                       return PMEM2_E_MAPPING_EXISTS;
+               } else if (err == ERROR_ACCESS_DENIED) {
+                       return PMEM2_E_NO_ACCESS;
+               }
+               return pmem2_lasterror_to_err();
+       }
+
+       void *base;
+       void *rsv = cfg->reserv;
+       if (rsv) {
+               void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+               size_t rsv_size = pmem2_vm_reservation_get_size(rsv);
+               size_t rsv_offset = cfg->reserv_offset;
+
+               if (rsv_offset % Mmap_align) {
+                       ret = PMEM2_E_OFFSET_UNALIGNED;
+                       ERR(
+                               "offset from the beggining of virtual memory "
+                               "reservation %zu is not a multiple of %llu",
+                               rsv_offset, Mmap_align);
+                       goto err_close_mapping_handle;
+               }
+
+               if (rsv_offset + length > rsv_size) {
+                       ret = PMEM2_E_LENGTH_OUT_OF_RANGE;
+                       ERR(
+                               "length of the mapping %zu combined with the "
+                               "offset into the reservation %zu exceeds virtual "
+                               "memory reservation size %zu",
+                               length, effective_offset, rsv_size);
+                       goto err_close_mapping_handle;
+               }
+
+               if (vm_reservation_map_find_acquire(rsv, rsv_offset, length)) {
+                       ret = PMEM2_E_MAPPING_EXISTS;
+                       ERR(
+                               "region of the reservation %p at the offset %zu and "
+                               "length %zu is at least partly occupied by other mapping",
+                               rsv, rsv_offset, length);
+                       goto err_reservation_release;
+               }
+
+               void *addr = (char *)rsv_addr + rsv_offset;
+               /*
+                * Before mapping to the reservation, it is neccessary to split
+                * the unoccupied region into separate placeholders,
+                * so that the size to be mapped and the cut out placeholder
+                * size will be the same.
+                */
+               ret = vm_reservation_split(rsv, rsv_offset, length);
+               if (ret)
+                       goto err_reservation_release;
+
+               /* replace placeholder with a regular mapping */
+               base = MapViewOfFile3(mh,
+                       NULL,
+                       addr, /* addr in reservation */
+                       effective_offset,
+                       length,
+                       MEM_REPLACE_PLACEHOLDER,
+                       proto,
+                       NULL,
+                       0);
+
+               if (base == NULL) {
+                       ERR("!!MapViewOfFile3");
+                       DWORD ret_windows = GetLastError();
+                       if (ret_windows == ERROR_INVALID_ADDRESS)
+                               ret = PMEM2_E_MAPPING_EXISTS;
+                       else
+                               ret = pmem2_lasterror_to_err();
+                       goto err_merge_reservation_regions;
+               }
+
+               ASSERTeq(base, addr);
+       } else {
+               /* obtain a pointer to the mapping view */
+               base = MapViewOfFile(mh,
+                       access,
+                       HIDWORD(effective_offset),
+                       LODWORD(effective_offset),
+                       length);
+
+               if (base == NULL) {
+                       ERR("!!MapViewOfFile");
+                       ret = pmem2_lasterror_to_err();
+                       goto err_close_mapping_handle;
+               }
+       }
+
+       if (!CloseHandle(mh)) {
+               ERR("!!CloseHandle");
+               ret = pmem2_lasterror_to_err();
+               goto err_undo_mapping;
+       }
+
+       enum pmem2_granularity available_min_granularity =
+               PMEM2_GRANULARITY_PAGE;
+       if (src->type == PMEM2_SOURCE_HANDLE) {
+               int direct_access = is_direct_access(src->value.handle);
+               if (direct_access < 0) {
+                       ret = direct_access;
+                       goto err_undo_mapping;
+               }
+
+               bool eADR = (pmem2_auto_flush() == 1);
+               available_min_granularity =
+                       get_min_granularity(eADR, direct_access, cfg->sharing);
+       } else if (src->type == PMEM2_SOURCE_ANON) {
+               available_min_granularity = PMEM2_GRANULARITY_BYTE;
+       } else {
+               ASSERT(0);
+       }
+
+       if (available_min_granularity > cfg->requested_max_granularity) {
+               const char *err = granularity_err_msg
+                       [cfg->requested_max_granularity]
+                       [available_min_granularity];
+               if (strcmp(err, GRAN_IMPOSSIBLE) == 0)
+                       FATAL(
+                               "unhandled granularity error: available_min_granularity: %d" \
+                               "requested_max_granularity: %d",
+                               available_min_granularity,
+                               cfg->requested_max_granularity);
+               ERR("%s", err);
+               ret = PMEM2_E_GRANULARITY_NOT_SUPPORTED;
+               goto err_undo_mapping;
+       }
+
+       /* prepare pmem2_map structure */
+       struct pmem2_map *map;
+       map = (struct pmem2_map *)pmem2_malloc(sizeof(*map), &ret);
+       if (!map)
+               goto err_undo_mapping;
+
+       map->addr = base;
+       /*
+        * XXX probably in some cases the reserved length > the content length.
+        * Maybe it is worth to do the research.
+        */
+       map->reserved_length = length;
+       map->content_length = length;
+       map->effective_granularity = available_min_granularity;
+       map->reserv = rsv;
+       map->source = *src;
+       pmem2_set_flush_fns(map);
+       pmem2_set_mem_fns(map);
+
+       ret = pmem2_register_mapping(map);
+       if (ret) {
+               goto err_free_map_struct;
+       }
+
+       if (rsv) {
+               ret = vm_reservation_map_register_release(rsv, map);
+               if (ret)
+                       goto err_unregister_map;
+       }
+
+       /* return a pointer to the pmem2_map structure */
+       *map_ptr = map;
+
+       return ret;
+
+err_unregister_map:
+       pmem2_unregister_mapping(map);
+err_free_map_struct:
+       free(map);
+err_undo_mapping:
+       if (rsv)
+               vm_reservation_unmap(rsv, base, length);
+       else
+               UnmapViewOfFile(base);
+err_merge_reservation_regions:
+       if (rsv)
+               vm_reservation_merge(rsv, base, length);
+err_reservation_release:
+       if (rsv)
+               vm_reservation_release(rsv);
+err_close_mapping_handle:
+       CloseHandle(mh);
+       return ret;
+}
+
+/*
+ * pmem2_map_delete -- unmap the specified region
+ */
+int
+pmem2_map_delete(struct pmem2_map **map_ptr)
+{
+       LOG(3, "map_ptr %p", map_ptr);
+       PMEM2_ERR_CLR();
+
+       struct pmem2_map *map = *map_ptr;
+       size_t map_len = map->content_length;
+       void *map_addr = map->addr;
+       struct pmem2_vm_reservation *rsv = map->reserv;
+
+       int ret = pmem2_unregister_mapping(map);
+       if (ret)
+               return ret;
+
+       if (map->reserved_length != 0) {
+               if (rsv) {
+                       void *rsv_addr = pmem2_vm_reservation_get_address(rsv);
+                       size_t rsv_offset = (size_t)map_addr - (size_t)rsv_addr;
+                       if (!vm_reservation_map_find_acquire(rsv, rsv_offset,
+                                       map_len)) {
+                               ret = PMEM2_E_MAPPING_NOT_FOUND;
+                               goto err_reservation_release;
+                       }
+
+                       ret = vm_reservation_unmap(rsv, map->addr,
+                                       map->reserved_length);
+                       if (ret)
+                               goto err_reservation_release;
+
+                       ret = vm_reservation_merge(rsv, map->addr,
+                                       map->reserved_length);
+                       if (ret)
+                               goto err_reservation_release;
+
+                       ret = vm_reservation_map_unregister_release(rsv, map);
+                       if (ret)
+                               goto err_register_map;
+               } else {
+                       if (!UnmapViewOfFile(map->addr)) {
+                               ERR("!!UnmapViewOfFile");
+                               ret = pmem2_lasterror_to_err();
+                               goto err_register_map;
+                       }
+               }
+       }
+
+       Free(map);
+       *map_ptr = NULL;
+
+       return 0;
+
+err_reservation_release:
+       vm_reservation_release(rsv);
+err_register_map:
+       pmem2_register_mapping(map);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/memops_generic.c b/ceph/src/pmdk/src/libpmem2/memops_generic.c
new file mode 100644 (file)
index 0000000..fccb0bd
--- /dev/null
@@ -0,0 +1,339 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * memops_generic.c -- architecture-independent memmove & memset fallback
+ *
+ * This fallback is needed to fulfill guarantee that pmem_mem[cpy|set|move]
+ * will use at least 8-byte stores (for 8-byte aligned buffers and sizes),
+ * even when accelerated implementation is missing or disabled.
+ * This guarantee is needed to maintain correctness eg in pmemobj.
+ * Libc may do the same, but this behavior is not documented, so we can't rely
+ * on that.
+ */
+
+#include <stddef.h>
+
+#include "out.h"
+#include "pmem2_arch.h"
+#include "util.h"
+
+/*
+ * pmem2_flush_flags -- internal wrapper around pmem_flush
+ */
+static inline void
+pmem2_flush_flags(const void *addr, size_t len, unsigned flags,
+               flush_func flush)
+{
+       if (!(flags & PMEM2_F_MEM_NOFLUSH))
+               flush(addr, len);
+}
+
+/*
+ * cpy128 -- (internal) copy 128 bytes from src to dst
+ */
+static force_inline void
+cpy128(uint64_t *dst, const uint64_t *src)
+{
+       /*
+        * We use atomics here just to be sure compiler will not split stores.
+        * Order of stores doesn't matter.
+        */
+       uint64_t tmp[16];
+       util_atomic_load_explicit64(&src[0], &tmp[0], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[1], &tmp[1], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[2], &tmp[2], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[3], &tmp[3], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[4], &tmp[4], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[5], &tmp[5], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[6], &tmp[6], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[7], &tmp[7], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[8], &tmp[8], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[9], &tmp[9], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[10], &tmp[10], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[11], &tmp[11], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[12], &tmp[12], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[13], &tmp[13], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[14], &tmp[14], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[15], &tmp[15], memory_order_relaxed);
+
+       util_atomic_store_explicit64(&dst[0], tmp[0], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[1], tmp[1], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[2], tmp[2], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[3], tmp[3], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[4], tmp[4], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[5], tmp[5], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[6], tmp[6], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[7], tmp[7], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[8], tmp[8], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[9], tmp[9], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[10], tmp[10], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[11], tmp[11], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[12], tmp[12], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[13], tmp[13], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[14], tmp[14], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[15], tmp[15], memory_order_relaxed);
+}
+
+/*
+ * cpy64 -- (internal) copy 64 bytes from src to dst
+ */
+static force_inline void
+cpy64(uint64_t *dst, const uint64_t *src)
+{
+       /*
+        * We use atomics here just to be sure compiler will not split stores.
+        * Order of stores doesn't matter.
+        */
+       uint64_t tmp[8];
+       util_atomic_load_explicit64(&src[0], &tmp[0], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[1], &tmp[1], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[2], &tmp[2], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[3], &tmp[3], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[4], &tmp[4], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[5], &tmp[5], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[6], &tmp[6], memory_order_relaxed);
+       util_atomic_load_explicit64(&src[7], &tmp[7], memory_order_relaxed);
+
+       util_atomic_store_explicit64(&dst[0], tmp[0], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[1], tmp[1], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[2], tmp[2], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[3], tmp[3], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[4], tmp[4], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[5], tmp[5], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[6], tmp[6], memory_order_relaxed);
+       util_atomic_store_explicit64(&dst[7], tmp[7], memory_order_relaxed);
+}
+
+/*
+ * cpy8 -- (internal) copy 8 bytes from src to dst
+ */
+static force_inline void
+cpy8(uint64_t *dst, const uint64_t *src)
+{
+       uint64_t tmp;
+       util_atomic_load_explicit64(src, &tmp, memory_order_relaxed);
+       util_atomic_store_explicit64(dst, tmp, memory_order_relaxed);
+}
+
+/*
+ * store8 -- (internal) store 8 bytes
+ */
+static force_inline void
+store8(uint64_t *dst, uint64_t c)
+{
+       util_atomic_store_explicit64(dst, c, memory_order_relaxed);
+}
+
+/*
+ * memmove_nodrain_generic -- generic memmove to pmem without hw drain
+ */
+void *
+memmove_nodrain_generic(void *dst, const void *src, size_t len,
+               unsigned flags, flush_func flush)
+{
+       LOG(15, "pmemdest %p src %p len %zu flags 0x%x", dst, src, len,
+                       flags);
+
+       char *cdst = dst;
+       const char *csrc = src;
+       size_t remaining;
+       (void) flags;
+
+       if ((uintptr_t)cdst - (uintptr_t)csrc >= len) {
+               size_t cnt = (uint64_t)cdst & 7;
+               if (cnt > 0) {
+                       cnt = 8 - cnt;
+
+                       if (cnt > len)
+                               cnt = len;
+
+                       for (size_t i = 0; i < cnt; ++i)
+                               cdst[i] = csrc[i];
+
+                       pmem2_flush_flags(cdst, cnt, flags, flush);
+
+                       cdst += cnt;
+                       csrc += cnt;
+                       len -= cnt;
+               }
+
+               uint64_t *dst8 = (uint64_t *)cdst;
+               const uint64_t *src8 = (const uint64_t *)csrc;
+
+               while (len >= 128 && CACHELINE_SIZE == 128) {
+                       cpy128(dst8, src8);
+                       pmem2_flush_flags(dst8, 128, flags, flush);
+                       len -= 128;
+                       dst8 += 16;
+                       src8 += 16;
+               }
+
+               while (len >= 64) {
+                       cpy64(dst8, src8);
+                       pmem2_flush_flags(dst8, 64, flags, flush);
+                       len -= 64;
+                       dst8 += 8;
+                       src8 += 8;
+               }
+
+               remaining = len;
+               while (len >= 8) {
+                       cpy8(dst8, src8);
+                       len -= 8;
+                       dst8++;
+                       src8++;
+               }
+
+               cdst = (char *)dst8;
+               csrc = (const char *)src8;
+
+               for (size_t i = 0; i < len; ++i)
+                       *cdst++ = *csrc++;
+
+               if (remaining)
+                       pmem2_flush_flags(cdst - remaining, remaining, flags,
+                                       flush);
+       } else {
+               cdst += len;
+               csrc += len;
+
+               size_t cnt = (uint64_t)cdst & 7;
+               if (cnt > 0) {
+                       if (cnt > len)
+                               cnt = len;
+
+                       cdst -= cnt;
+                       csrc -= cnt;
+                       len -= cnt;
+
+                       for (size_t i = cnt; i > 0; --i)
+                               cdst[i - 1] = csrc[i - 1];
+                       pmem2_flush_flags(cdst, cnt, flags, flush);
+               }
+
+               uint64_t *dst8 = (uint64_t *)cdst;
+               const uint64_t *src8 = (const uint64_t *)csrc;
+
+               while (len >= 128 && CACHELINE_SIZE == 128) {
+                       dst8 -= 16;
+                       src8 -= 16;
+                       cpy128(dst8, src8);
+                       pmem2_flush_flags(dst8, 128, flags, flush);
+                       len -= 128;
+               }
+
+               while (len >= 64) {
+                       dst8 -= 8;
+                       src8 -= 8;
+                       cpy64(dst8, src8);
+                       pmem2_flush_flags(dst8, 64, flags, flush);
+                       len -= 64;
+               }
+
+               remaining = len;
+               while (len >= 8) {
+                       --dst8;
+                       --src8;
+                       cpy8(dst8, src8);
+                       len -= 8;
+               }
+
+               cdst = (char *)dst8;
+               csrc = (const char *)src8;
+
+               for (size_t i = len; i > 0; --i)
+                       *--cdst = *--csrc;
+
+               if (remaining)
+                       pmem2_flush_flags(cdst, remaining, flags, flush);
+       }
+
+       return dst;
+}
+
+/*
+ * memset_nodrain_generic -- generic memset to pmem without hw drain
+ */
+void *
+memset_nodrain_generic(void *dst, int c, size_t len, unsigned flags,
+               flush_func flush)
+{
+       LOG(15, "pmemdest %p c 0x%x len %zu flags 0x%x", dst, c, len,
+                       flags);
+       (void) flags;
+
+       char *cdst = dst;
+       size_t cnt = (uint64_t)cdst & 7;
+       if (cnt > 0) {
+               cnt = 8 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               for (size_t i = 0; i < cnt; ++i)
+                       cdst[i] = (char)c;
+               pmem2_flush_flags(cdst, cnt, flags, flush);
+
+               cdst += cnt;
+               len -= cnt;
+       }
+
+       uint64_t *dst8 = (uint64_t *)cdst;
+
+       uint64_t u = (unsigned char)c;
+       uint64_t tmp = (u << 56) | (u << 48) | (u << 40) | (u << 32) |
+                       (u << 24) | (u << 16) | (u << 8) | u;
+
+       while (len >= 128 && CACHELINE_SIZE == 128) {
+               store8(&dst8[0], tmp);
+               store8(&dst8[1], tmp);
+               store8(&dst8[2], tmp);
+               store8(&dst8[3], tmp);
+               store8(&dst8[4], tmp);
+               store8(&dst8[5], tmp);
+               store8(&dst8[6], tmp);
+               store8(&dst8[7], tmp);
+               store8(&dst8[8], tmp);
+               store8(&dst8[9], tmp);
+               store8(&dst8[10], tmp);
+               store8(&dst8[11], tmp);
+               store8(&dst8[12], tmp);
+               store8(&dst8[13], tmp);
+               store8(&dst8[14], tmp);
+               store8(&dst8[15], tmp);
+               pmem2_flush_flags(dst8, 128, flags, flush);
+               len -= 128;
+               dst8 += 16;
+       }
+
+       while (len >= 64) {
+               store8(&dst8[0], tmp);
+               store8(&dst8[1], tmp);
+               store8(&dst8[2], tmp);
+               store8(&dst8[3], tmp);
+               store8(&dst8[4], tmp);
+               store8(&dst8[5], tmp);
+               store8(&dst8[6], tmp);
+               store8(&dst8[7], tmp);
+               pmem2_flush_flags(dst8, 64, flags, flush);
+               len -= 64;
+               dst8 += 8;
+       }
+
+       size_t remaining = len;
+       while (len >= 8) {
+               store8(dst8, tmp);
+               len -= 8;
+               dst8++;
+       }
+
+       cdst = (char *)dst8;
+
+       for (size_t i = 0; i < len; ++i)
+               *cdst++ = (char)c;
+
+       if (remaining)
+               pmem2_flush_flags(cdst - remaining, remaining, flags, flush);
+       return dst;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/persist.c b/ceph/src/pmdk/src/libpmem2/persist.c
new file mode 100644 (file)
index 0000000..a7ec0fc
--- /dev/null
@@ -0,0 +1,610 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * persist.c -- pmem2_get_[persist|flush|drain]_fn
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+
+#include "libpmem2.h"
+#include "map.h"
+#include "out.h"
+#include "os.h"
+#include "persist.h"
+#include "deep_flush.h"
+#include "pmem2_arch.h"
+#include "pmem2_utils.h"
+#include "valgrind_internal.h"
+
+static struct pmem2_arch_info Info;
+
+/*
+ * memmove_nodrain_libc -- (internal) memmove to pmem using libc
+ */
+static void *
+memmove_nodrain_libc(void *pmemdest, const void *src, size_t len,
+               unsigned flags, flush_func flush)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       LOG(15, "pmemdest %p src %p len %zu flags 0x%x", pmemdest, src, len,
+                       flags);
+
+       memmove(pmemdest, src, len);
+
+       if (!(flags & PMEM2_F_MEM_NOFLUSH))
+               flush(pmemdest, len);
+
+       return pmemdest;
+}
+
+/*
+ * memset_nodrain_libc -- (internal) memset to pmem using libc
+ */
+static void *
+memset_nodrain_libc(void *pmemdest, int c, size_t len, unsigned flags,
+               flush_func flush)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       LOG(15, "pmemdest %p c 0x%x len %zu flags 0x%x", pmemdest, c, len,
+                       flags);
+
+       memset(pmemdest, c, len);
+
+       if (!(flags & PMEM2_F_MEM_NOFLUSH))
+               flush(pmemdest, len);
+
+       return pmemdest;
+}
+
+/*
+ * pmem2_persist_init -- initialize persist module
+ */
+void
+pmem2_persist_init(void)
+{
+       Info.memmove_nodrain = NULL;
+       Info.memset_nodrain = NULL;
+       Info.memmove_nodrain_eadr = NULL;
+       Info.memset_nodrain_eadr = NULL;
+       Info.flush = NULL;
+       Info.fence = NULL;
+       Info.flush_has_builtin_fence = 0;
+
+       pmem2_arch_init(&Info);
+
+       char *ptr = os_getenv("PMEM_NO_GENERIC_MEMCPY");
+       long long no_generic = 0;
+       if (ptr)
+               no_generic = atoll(ptr);
+
+       if (Info.memmove_nodrain == NULL) {
+               if (no_generic) {
+                       Info.memmove_nodrain = memmove_nodrain_libc;
+                       Info.memmove_nodrain_eadr = memmove_nodrain_libc;
+                       LOG(3, "using libc memmove");
+               } else {
+                       Info.memmove_nodrain = memmove_nodrain_generic;
+                       Info.memmove_nodrain_eadr = memmove_nodrain_generic;
+                       LOG(3, "using generic memmove");
+               }
+       }
+
+       if (Info.memset_nodrain == NULL) {
+               if (no_generic) {
+                       Info.memset_nodrain = memset_nodrain_libc;
+                       Info.memset_nodrain_eadr = memset_nodrain_libc;
+                       LOG(3, "using libc memset");
+               } else {
+                       Info.memset_nodrain = memset_nodrain_generic;
+                       Info.memset_nodrain_eadr = memset_nodrain_generic;
+                       LOG(3, "using generic memset");
+               }
+       }
+}
+
+/*
+ * pmem2_drain -- wait for any PM stores to drain from HW buffers
+ */
+static void
+pmem2_drain(void)
+{
+       LOG(15, NULL);
+
+       Info.fence();
+}
+
+/*
+ * pmem2_log_flush -- log the flush attempt for the given range
+ */
+static inline void
+pmem2_log_flush(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       VALGRIND_DO_CHECK_MEM_IS_ADDRESSABLE(addr, len);
+}
+
+/*
+ * pmem2_flush_nop -- NOP version of the flush routine, used in cases where
+ * memory behind the mapping is already in persistence domain
+ */
+static void
+pmem2_flush_nop(const void *addr, size_t len)
+{
+       pmem2_log_flush(addr, len);
+
+       /* nothing more to do, other than telling pmemcheck about it */
+       VALGRIND_DO_FLUSH(addr, len);
+}
+
+/*
+ * pmem2_flush_cpu_cache -- flush processor cache for the given range
+ */
+static void
+pmem2_flush_cpu_cache(const void *addr, size_t len)
+{
+       pmem2_log_flush(addr, len);
+
+       Info.flush(addr, len);
+}
+
+/*
+ * pmem2_persist_noflush -- make all changes to a range of pmem persistent
+ */
+static void
+pmem2_persist_noflush(const void *addr, size_t len)
+{
+       pmem2_flush_nop(addr, len);
+       pmem2_drain();
+}
+
+/*
+ * pmem2_persist_cpu_cache -- make all changes to a range of pmem persistent
+ */
+static void
+pmem2_persist_cpu_cache(const void *addr, size_t len)
+{
+       pmem2_flush_cpu_cache(addr, len);
+       pmem2_drain();
+}
+
+/*
+ * pmem2_flush_file_buffers -- flush CPU and OS caches for the given range
+ */
+static int
+pmem2_flush_file_buffers(const void *addr, size_t len, int autorestart)
+{
+       int olderrno = errno;
+
+       pmem2_log_flush(addr, len);
+
+       /*
+        * Flushing using OS-provided mechanisms requires that the address
+        * be a multiple of the page size.
+        * Align address down and change len so that [addr, addr + len) still
+        * contains the initial range.
+        */
+
+       /* round address down to page boundary */
+       uintptr_t new_addr = ALIGN_DOWN((uintptr_t)addr, Pagesize);
+
+       /* increase len by the amount we gain when we round addr down */
+       len += (uintptr_t)addr - new_addr;
+
+       addr = (const void *)new_addr;
+
+       int ret = 0;
+
+       /*
+        * Find all the mappings overlapping with the [addr, addr + len) range
+        * and flush them, one by one.
+        */
+       do {
+               struct pmem2_map *map = pmem2_map_find(addr, len);
+               if (!map)
+                       break;
+
+               size_t flush;
+               size_t remaining = map->reserved_length;
+               if (map->addr < addr) {
+                       /*
+                        * Addr is inside of the mapping, so we have to decrease
+                        * the remaining length by an offset from the start
+                        * of our mapping.
+                        */
+                       remaining -= (uintptr_t)addr - (uintptr_t)map->addr;
+               } else if (map->addr == addr) {
+                       /* perfect match, there's nothing to do in this case */
+               } else {
+                       /*
+                        * map->addr > addr, so we have to skip the hole
+                        * between addr and map->addr.
+                        */
+                       len -= (uintptr_t)map->addr - (uintptr_t)addr;
+                       addr = map->addr;
+               }
+
+               if (len > remaining)
+                       flush = remaining;
+               else
+                       flush = len;
+
+               int ret1 = pmem2_flush_file_buffers_os(map, addr, flush,
+                               autorestart);
+               if (ret1 != 0)
+                       ret = ret1;
+
+               addr = ((const char *)addr) + flush;
+               len -= flush;
+       } while (len > 0);
+
+       errno = olderrno;
+
+       return ret;
+}
+
+/*
+ * pmem2_persist_pages -- flush processor cache for the given range
+ */
+static void
+pmem2_persist_pages(const void *addr, size_t len)
+{
+       /*
+        * Restarting on EINTR in general is a bad idea, but we don't have
+        * any way to communicate the failure outside.
+        */
+       const int autorestart = 1;
+
+       int ret = pmem2_flush_file_buffers(addr, len, autorestart);
+       if (ret) {
+               /*
+                * 1) There's no way to propagate this error. Silently ignoring
+                *    it would lead to data corruption.
+                * 2) non-pmem code path shouldn't be used in production.
+                *
+                * The only sane thing to do is to crash the application. Sorry.
+                */
+               abort();
+       }
+}
+
+/*
+ * pmem2_drain_nop -- variant of pmem2_drain for page granularity;
+ * it is a NOP because the flush part has built-in drain
+ */
+static void
+pmem2_drain_nop(void)
+{
+       LOG(15, NULL);
+}
+
+/*
+ * pmem2_deep_flush_page -- do nothing - pmem2_persist_fn already did msync
+ */
+int
+pmem2_deep_flush_page(struct pmem2_map *map, void *ptr, size_t size)
+{
+       LOG(3, "map %p ptr %p size %zu", map, ptr, size);
+       return 0;
+}
+
+/*
+ * pmem2_deep_flush_cache -- flush buffers for fsdax or write
+ * to deep_flush for DevDax
+ */
+int
+pmem2_deep_flush_cache(struct pmem2_map *map, void *ptr, size_t size)
+{
+       LOG(3, "map %p ptr %p size %zu", map, ptr, size);
+
+       enum pmem2_file_type type = map->source.value.ftype;
+
+       /*
+        * XXX: this should be moved to pmem2_deep_flush_dax
+        * while refactoring abstraction
+        */
+       if (type == PMEM2_FTYPE_DEVDAX)
+               pmem2_persist_cpu_cache(ptr, size);
+
+       int ret = pmem2_deep_flush_dax(map, ptr, size);
+       if (ret < 0) {
+               LOG(1, "cannot perform deep flush cache for map %p", map);
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_deep_flush_byte -- flush cpu cache and perform deep flush for dax
+ */
+int
+pmem2_deep_flush_byte(struct pmem2_map *map, void *ptr, size_t size)
+{
+       LOG(3, "map %p ptr %p size %zu", map, ptr, size);
+
+       if (map->source.type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not support deep flush");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERT(map->source.type == PMEM2_SOURCE_FD ||
+               map->source.type == PMEM2_SOURCE_HANDLE);
+
+       enum pmem2_file_type type = map->source.value.ftype;
+
+       /*
+        * XXX: this should be moved to pmem2_deep_flush_dax
+        * while refactoring abstraction
+        */
+       if (type == PMEM2_FTYPE_DEVDAX)
+               pmem2_persist_cpu_cache(ptr, size);
+
+       int ret = pmem2_deep_flush_dax(map, ptr, size);
+       if (ret < 0) {
+               LOG(1, "cannot perform deep flush byte for map %p", map);
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_set_flush_fns -- set function pointers related to flushing
+ */
+void
+pmem2_set_flush_fns(struct pmem2_map *map)
+{
+       switch (map->effective_granularity) {
+               case PMEM2_GRANULARITY_PAGE:
+                       map->persist_fn = pmem2_persist_pages;
+                       map->flush_fn = pmem2_persist_pages;
+                       map->drain_fn = pmem2_drain_nop;
+                       map->deep_flush_fn = pmem2_deep_flush_page;
+                       break;
+               case PMEM2_GRANULARITY_CACHE_LINE:
+                       map->persist_fn = pmem2_persist_cpu_cache;
+                       map->flush_fn = pmem2_flush_cpu_cache;
+                       map->drain_fn = pmem2_drain;
+                       map->deep_flush_fn = pmem2_deep_flush_cache;
+                       break;
+               case PMEM2_GRANULARITY_BYTE:
+                       map->persist_fn = pmem2_persist_noflush;
+                       map->flush_fn = pmem2_flush_nop;
+                       map->drain_fn = pmem2_drain;
+                       map->deep_flush_fn = pmem2_deep_flush_byte;
+                       break;
+               default:
+                       abort();
+       }
+
+}
+
+/*
+ * pmem2_get_persist_fn - return a pointer to a function responsible for
+ * persisting data in range owned by pmem2_map
+ */
+pmem2_persist_fn
+pmem2_get_persist_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->persist_fn;
+}
+
+/*
+ * pmem2_get_flush_fn - return a pointer to a function responsible for
+ * flushing data in range owned by pmem2_map
+ */
+pmem2_flush_fn
+pmem2_get_flush_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->flush_fn;
+}
+
+/*
+ * pmem2_get_drain_fn - return a pointer to a function responsible for
+ * draining flushes in range owned by pmem2_map
+ */
+pmem2_drain_fn
+pmem2_get_drain_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->drain_fn;
+}
+
+/*
+ * pmem2_memmove_nonpmem -- mem[move|cpy] followed by an msync
+ */
+static void *
+pmem2_memmove_nonpmem(void *pmemdest, const void *src, size_t len,
+               unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memmove");
+       Info.memmove_nodrain(pmemdest, src, len, flags & ~PMEM2_F_MEM_NODRAIN,
+                       Info.flush);
+
+       pmem2_persist_pages(pmemdest, len);
+
+       PMEM2_API_END("pmem2_memmove");
+       return pmemdest;
+}
+
+/*
+ * pmem2_memset_nonpmem -- memset followed by an msync
+ */
+static void *
+pmem2_memset_nonpmem(void *pmemdest, int c, size_t len, unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memset");
+       Info.memset_nodrain(pmemdest, c, len, flags & ~PMEM2_F_MEM_NODRAIN,
+                       Info.flush);
+
+       pmem2_persist_pages(pmemdest, len);
+
+       PMEM2_API_END("pmem2_memset");
+       return pmemdest;
+}
+
+/*
+ * pmem2_memmove -- mem[move|cpy] to pmem
+ */
+static void *
+pmem2_memmove(void *pmemdest, const void *src, size_t len,
+               unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memmove");
+       Info.memmove_nodrain(pmemdest, src, len, flags, Info.flush);
+       if ((flags & (PMEM2_F_MEM_NODRAIN | PMEM2_F_MEM_NOFLUSH)) == 0)
+               pmem2_drain();
+
+       PMEM2_API_END("pmem2_memmove");
+       return pmemdest;
+}
+
+/*
+ * pmem2_memset -- memset to pmem
+ */
+static void *
+pmem2_memset(void *pmemdest, int c, size_t len, unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memset");
+       Info.memset_nodrain(pmemdest, c, len, flags, Info.flush);
+       if ((flags & (PMEM2_F_MEM_NODRAIN | PMEM2_F_MEM_NOFLUSH)) == 0)
+               pmem2_drain();
+
+       PMEM2_API_END("pmem2_memset");
+       return pmemdest;
+}
+
+/*
+ * pmem2_memmove_eadr -- mem[move|cpy] to pmem, platform supports eADR
+ */
+static void *
+pmem2_memmove_eadr(void *pmemdest, const void *src, size_t len,
+               unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memmove");
+       Info.memmove_nodrain_eadr(pmemdest, src, len, flags, Info.flush);
+       if ((flags & (PMEM2_F_MEM_NODRAIN | PMEM2_F_MEM_NOFLUSH)) == 0)
+               pmem2_drain();
+
+       PMEM2_API_END("pmem2_memmove");
+       return pmemdest;
+}
+
+/*
+ * pmem2_memset_eadr -- memset to pmem, platform supports eADR
+ */
+static void *
+pmem2_memset_eadr(void *pmemdest, int c, size_t len, unsigned flags)
+{
+#ifdef DEBUG
+       if (flags & ~PMEM2_F_MEM_VALID_FLAGS)
+               ERR("invalid flags 0x%x", flags);
+#endif
+       PMEM2_API_START("pmem2_memset");
+       Info.memset_nodrain_eadr(pmemdest, c, len, flags, Info.flush);
+       if ((flags & (PMEM2_F_MEM_NODRAIN | PMEM2_F_MEM_NOFLUSH)) == 0)
+               pmem2_drain();
+
+       PMEM2_API_END("pmem2_memset");
+       return pmemdest;
+}
+
+/*
+ * pmem2_set_mem_fns -- set function pointers related to mem[move|cpy|set]
+ */
+void
+pmem2_set_mem_fns(struct pmem2_map *map)
+{
+       switch (map->effective_granularity) {
+               case PMEM2_GRANULARITY_PAGE:
+                       map->memmove_fn = pmem2_memmove_nonpmem;
+                       map->memcpy_fn = pmem2_memmove_nonpmem;
+                       map->memset_fn = pmem2_memset_nonpmem;
+                       break;
+               case PMEM2_GRANULARITY_CACHE_LINE:
+                       map->memmove_fn = pmem2_memmove;
+                       map->memcpy_fn = pmem2_memmove;
+                       map->memset_fn = pmem2_memset;
+                       break;
+               case PMEM2_GRANULARITY_BYTE:
+                       map->memmove_fn = pmem2_memmove_eadr;
+                       map->memcpy_fn = pmem2_memmove_eadr;
+                       map->memset_fn = pmem2_memset_eadr;
+                       break;
+               default:
+                       abort();
+       }
+
+}
+
+/*
+ * pmem2_get_memmove_fn - return a pointer to a function
+ */
+pmem2_memmove_fn
+pmem2_get_memmove_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->memmove_fn;
+}
+
+/*
+ * pmem2_get_memcpy_fn - return a pointer to a function
+ */
+pmem2_memcpy_fn
+pmem2_get_memcpy_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->memcpy_fn;
+}
+
+/*
+ * pmem2_get_memset_fn - return a pointer to a function
+ */
+pmem2_memset_fn
+pmem2_get_memset_fn(struct pmem2_map *map)
+{
+       /* we do not need to clear err because this function cannot fail */
+       return map->memset_fn;
+}
+
+#if VG_PMEMCHECK_ENABLED
+/*
+ * pmem2_emit_log -- logs library and function names to pmemcheck store log
+ */
+void
+pmem2_emit_log(const char *func, int order)
+{
+       util_emit_log("libpmem2", func, order);
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/persist.h b/ceph/src/pmdk/src/libpmem2/persist.h
new file mode 100644 (file)
index 0000000..525508c
--- /dev/null
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * persist.h -- internal definitions for libpmem2 persist module
+ */
+#ifndef PMEM2_PERSIST_H
+#define PMEM2_PERSIST_H
+
+#include <stddef.h>
+
+#include "map.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void pmem2_persist_init(void);
+
+int pmem2_flush_file_buffers_os(struct pmem2_map *map, const void *addr,
+               size_t len, int autorestart);
+void pmem2_set_flush_fns(struct pmem2_map *map);
+void pmem2_set_mem_fns(struct pmem2_map *map);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/persist_posix.c b/ceph/src/pmdk/src/libpmem2/persist_posix.c
new file mode 100644 (file)
index 0000000..34c0ae6
--- /dev/null
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * persist_posix.c -- POSIX-specific part of persist implementation
+ */
+
+#include <errno.h>
+#include <stdint.h>
+#include <sys/mman.h>
+
+#include "out.h"
+#include "persist.h"
+#include "pmem2_utils.h"
+#include "valgrind_internal.h"
+
+/*
+ * pmem2_flush_file_buffers_os -- flush CPU and OS file caches for the given
+ * range
+ */
+int
+pmem2_flush_file_buffers_os(struct pmem2_map *map, const void *addr, size_t len,
+               int autorestart)
+{
+       /*
+        * msync accepts addresses aligned to the page boundary, so we may sync
+        * more and part of it may have been marked as undefined/inaccessible.
+        * Msyncing such memory is not a bug, so as a workaround temporarily
+        * disable error reporting.
+        */
+       VALGRIND_DO_DISABLE_ERROR_REPORTING;
+       int ret;
+       do {
+               ret = msync((void *)addr, len, MS_SYNC);
+
+               if (ret < 0) {
+                       ERR("!msync");
+               } else {
+                       /* full flush */
+                       VALGRIND_DO_PERSIST((uintptr_t)addr, len);
+               }
+       } while (autorestart && ret < 0 && errno == EINTR);
+
+       VALGRIND_DO_ENABLE_ERROR_REPORTING;
+
+       if (ret)
+               return PMEM2_E_ERRNO;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/persist_windows.c b/ceph/src/pmdk/src/libpmem2/persist_windows.c
new file mode 100644 (file)
index 0000000..a169d1d
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * persist_windows.c -- Windows-specific part of persist implementation
+ */
+
+#include <stdlib.h>
+#include <windows.h>
+
+#include "out.h"
+#include "persist.h"
+#include "pmem2_utils.h"
+
+/*
+ * pmem2_flush_file_buffers_os -- flush CPU and OS file caches for the given
+ * range
+ */
+int
+pmem2_flush_file_buffers_os(struct pmem2_map *map, const void *addr, size_t len,
+               int autorestart)
+{
+       ASSERTeq(map->source.type, PMEM2_SOURCE_HANDLE);
+
+       if (FlushViewOfFile(addr, len) == FALSE) {
+               ERR("!!FlushViewOfFile");
+               return pmem2_lasterror_to_err();
+       }
+
+       if (FlushFileBuffers(map->source.value.handle) == FALSE) {
+               ERR("!!FlushFileBuffers");
+               return pmem2_lasterror_to_err();
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2.h b/ceph/src/pmdk/src/libpmem2/pmem2.h
new file mode 100644 (file)
index 0000000..415695a
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * pmem2.h -- internal definitions for libpmem2
+ */
+#ifndef PMEM2_H
+#define PMEM2_H
+
+#include "libpmem2.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PMEM2_MAJOR_VERSION 0
+#define PMEM2_MINOR_VERSION 0
+
+#define PMEM2_LOG_PREFIX "libpmem2"
+#define PMEM2_LOG_LEVEL_VAR "PMEM2_LOG_LEVEL"
+#define PMEM2_LOG_FILE_VAR "PMEM2_LOG_FILE"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_arch.h b/ceph/src/pmdk/src/libpmem2/pmem2_arch.h
new file mode 100644 (file)
index 0000000..80be875
--- /dev/null
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * pmem2_arch.h -- core-arch interface
+ */
+#ifndef PMEM2_ARCH_H
+#define PMEM2_ARCH_H
+
+#include <stddef.h>
+#include "libpmem2.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct pmem2_arch_info;
+
+typedef void (*fence_func)(void);
+typedef void (*flush_func)(const void *, size_t);
+typedef void *(*memmove_nodrain_func)(void *pmemdest, const void *src,
+               size_t len, unsigned flags, flush_func flush);
+typedef void *(*memset_nodrain_func)(void *pmemdest, int c, size_t len,
+               unsigned flags, flush_func flush);
+
+struct pmem2_arch_info {
+       memmove_nodrain_func memmove_nodrain;
+       memmove_nodrain_func memmove_nodrain_eadr;
+       memset_nodrain_func memset_nodrain;
+       memset_nodrain_func memset_nodrain_eadr;
+       flush_func flush;
+       fence_func fence;
+       int flush_has_builtin_fence;
+};
+
+void pmem2_arch_init(struct pmem2_arch_info *info);
+
+/*
+ * flush_empty_nolog -- (internal) do not flush the CPU cache
+ */
+static force_inline void
+flush_empty_nolog(const void *addr, size_t len)
+{
+       /* NOP, but tell pmemcheck about it */
+       VALGRIND_DO_FLUSH(addr, len);
+}
+
+void *memmove_nodrain_generic(void *pmemdest, const void *src, size_t len,
+               unsigned flags, flush_func flush);
+void *memset_nodrain_generic(void *pmemdest, int c, size_t len, unsigned flags,
+               flush_func flush);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils.c b/ceph/src/pmdk/src/libpmem2/pmem2_utils.c
new file mode 100644 (file)
index 0000000..23c258d
--- /dev/null
@@ -0,0 +1,95 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * pmem2_utils.c -- libpmem2 utilities functions
+ */
+
+#include <errno.h>
+#include "alloc.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "util.h"
+
+/*
+ * pmem2_malloc -- allocate a buffer and handle an error
+ */
+void *
+pmem2_malloc(size_t size, int *err)
+{
+       void *ptr = Malloc(size);
+       *err = 0;
+
+       if (ptr == NULL) {
+               ERR("!malloc(%zu)", size);
+               *err = PMEM2_E_ERRNO;
+       }
+
+       return ptr;
+}
+
+/*
+ * pmem2_zalloc -- allocate a buffer, zero it and handle an error
+ */
+void *
+pmem2_zalloc(size_t size, int *err)
+{
+       void *ptr = Zalloc(size);
+       *err = 0;
+
+       if (ptr == NULL) {
+               ERR("!malloc(%zu)", size);
+               *err = PMEM2_E_ERRNO;
+       }
+
+       return ptr;
+}
+
+/*
+ * pmem2_realloc -- reallocate a buffer and handle an error
+ */
+void *
+pmem2_realloc(void *ptr, size_t size, int *err)
+{
+       void *newptr = Realloc(ptr, size);
+       *err = 0;
+
+       if (newptr == NULL) {
+               ERR("!realloc(%zu)", size);
+               *err = PMEM2_E_ERRNO;
+       }
+
+       return newptr;
+}
+
+int
+pmem2_err_to_errno(int err)
+{
+       if (err > 0)
+               FATAL("positive error code is a bug in libpmem2");
+
+       if (err == PMEM2_E_NOSUPP)
+               return ENOTSUP;
+
+       if (err <= PMEM2_E_UNKNOWN)
+               return EINVAL;
+
+       return -err;
+}
+
+#ifdef _WIN32
+/*
+ * converts windows error codes to pmem2 error
+ */
+int
+pmem2_lasterror_to_err()
+{
+       int err = util_lasterror_to_errno(GetLastError());
+
+       if (err == -1)
+               return PMEM2_E_UNKNOWN;
+
+       return -err;
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils.h b/ceph/src/pmdk/src/libpmem2/pmem2_utils.h
new file mode 100644 (file)
index 0000000..84464f4
--- /dev/null
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * pmem2_utils.h -- libpmem2 utilities functions
+ */
+
+#ifndef PMEM2_UTILS_H
+#define PMEM2_UTILS_H 1
+
+#include <errno.h>
+
+#include "os.h"
+#include "out.h"
+#include "source.h"
+
+static inline int
+pmem2_assert_errno(void)
+{
+       if (!errno) {
+               ERR("errno is not set");
+               ASSERTinfo(0, "errno is not set");
+               return -EINVAL;
+       }
+
+       return -errno;
+}
+
+#define PMEM2_E_ERRNO (pmem2_assert_errno())
+
+#ifdef DEBUG
+#define PMEM2_ERR_CLR() \
+{\
+       errno = 0;\
+       char *errormsg = (char *)out_get_errormsg();\
+       strcpy(errormsg, "\0");\
+}
+#else
+#define PMEM2_ERR_CLR()
+#endif
+
+void *pmem2_malloc(size_t size, int *err);
+void *pmem2_zalloc(size_t size, int *err);
+void *pmem2_realloc(void *ptr, size_t size, int *err);
+
+#ifdef _WIN32
+int pmem2_lasterror_to_err();
+#endif
+
+int pmem2_get_type_from_stat(const os_stat_t *st, enum pmem2_file_type *type);
+int pmem2_device_dax_size(const struct pmem2_source *src, size_t *size);
+int pmem2_device_dax_alignment(const struct pmem2_source *src,
+               size_t *alignment);
+
+#endif /* PMEM2_UTILS_H */
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils_linux.c b/ceph/src/pmdk/src/libpmem2/pmem2_utils_linux.c
new file mode 100644 (file)
index 0000000..57cc432
--- /dev/null
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "region_namespace.h"
+#include "source.h"
+
+/*
+ * pmem2_get_type_from_stat -- determine type of file based on output of stat
+ * syscall
+ */
+int
+pmem2_get_type_from_stat(const os_stat_t *st, enum pmem2_file_type *type)
+{
+       if (S_ISREG(st->st_mode)) {
+               *type = PMEM2_FTYPE_REG;
+               return 0;
+       }
+
+       if (S_ISDIR(st->st_mode)) {
+               *type = PMEM2_FTYPE_DIR;
+               return 0;
+       }
+
+       if (!S_ISCHR(st->st_mode)) {
+               ERR("file type 0%o not supported", st->st_mode & S_IFMT);
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       char spath[PATH_MAX];
+       int ret = util_snprintf(spath, PATH_MAX,
+                       "/sys/dev/char/%u:%u/subsystem",
+                       os_major(st->st_rdev), os_minor(st->st_rdev));
+
+       if (ret < 0) {
+               /* impossible */
+               ERR("!snprintf");
+               ASSERTinfo(0, "snprintf failed");
+               return PMEM2_E_ERRNO;
+       }
+
+       LOG(4, "device subsystem path \"%s\"", spath);
+
+       char npath[PATH_MAX];
+       char *rpath = realpath(spath, npath);
+       if (rpath == NULL) {
+               ERR("!realpath \"%s\"", spath);
+               return PMEM2_E_ERRNO;
+       }
+
+       char *basename = strrchr(rpath, '/');
+       if (!basename || strcmp("dax", basename + 1) != 0) {
+               LOG(3, "%s path does not match device dax prefix path", rpath);
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       *type = PMEM2_FTYPE_DEVDAX;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils_ndctl.c b/ceph/src/pmdk/src/libpmem2/pmem2_utils_ndctl.c
new file mode 100644 (file)
index 0000000..fed8230
--- /dev/null
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+#include <errno.h>
+#include <ndctl/libndctl.h>
+
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "region_namespace_ndctl.h"
+#include "source.h"
+
+/*
+ * pmem2_device_dax_alignment -- checks the alignment of a given
+ * dax device from given source
+ */
+int
+pmem2_device_dax_alignment(const struct pmem2_source *src, size_t *alignment)
+{
+       int ret = 0;
+       size_t size = 0;
+       struct ndctl_ctx *ctx;
+       struct ndctl_namespace *ndns;
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       ret = pmem2_region_namespace(ctx, src, NULL, &ndns);
+       if (ret) {
+               LOG(1, "getting region and namespace failed");
+               goto end;
+       }
+
+       struct ndctl_dax *dax = ndctl_namespace_get_dax(ndns);
+
+       if (dax)
+               size = ndctl_dax_get_align(dax);
+       else
+               ret = PMEM2_E_INVALID_ALIGNMENT_FORMAT;
+
+end:
+       ndctl_unref(ctx);
+
+       *alignment = size;
+       LOG(4, "device alignment %zu", *alignment);
+
+       return ret;
+}
+
+/*
+ * pmem2_device_dax_size -- checks the size of a given
+ * dax device from given source structure
+ */
+int
+pmem2_device_dax_size(const struct pmem2_source *src, size_t *size)
+{
+       int ret = 0;
+       struct ndctl_ctx *ctx;
+       struct ndctl_namespace *ndns;
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       ret = pmem2_region_namespace(ctx, src, NULL, &ndns);
+       if (ret) {
+               LOG(1, "getting region and namespace failed");
+               goto end;
+       }
+
+       struct ndctl_dax *dax = ndctl_namespace_get_dax(ndns);
+
+       if (dax) {
+               *size = ndctl_dax_get_size(dax);
+       } else {
+               ret = PMEM2_E_DAX_REGION_NOT_FOUND;
+               ERR("Issue while reading Device Dax size - cannot "
+                       "find dax region");
+       }
+
+end:
+       ndctl_unref(ctx);
+       LOG(4, "device size %zu", *size);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils_none.c b/ceph/src/pmdk/src/libpmem2/pmem2_utils_none.c
new file mode 100644 (file)
index 0000000..d24a9d4
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+#include <errno.h>
+
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "source.h"
+
+/*
+ * pmem2_device_dax_alignment -- checks the alignment of a given
+ * dax device from given source
+ */
+int
+pmem2_device_dax_alignment(const struct pmem2_source *src, size_t *alignment)
+{
+       ERR("Cannot read Device Dax alignment - ndctl is not available");
+
+       return PMEM2_E_NOSUPP;
+}
+
+/*
+ * pmem2_device_dax_size -- checks the size of a given dax device from
+ * given source
+ */
+int
+pmem2_device_dax_size(const struct pmem2_source *src, size_t *size)
+{
+       ERR("Cannot read Device Dax size - ndctl is not available");
+
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/pmem2_utils_other.c b/ceph/src/pmdk/src/libpmem2/pmem2_utils_other.c
new file mode 100644 (file)
index 0000000..3df5e6f
--- /dev/null
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+#include <errno.h>
+#include <sys/stat.h>
+
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2_utils.h"
+
+#ifdef _WIN32
+#define S_ISREG(m)     (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m)     (((m) & S_IFMT) == S_IFDIR)
+#endif
+
+int
+pmem2_get_type_from_stat(const os_stat_t *st, enum pmem2_file_type *type)
+{
+       if (S_ISREG(st->st_mode)) {
+               *type = PMEM2_FTYPE_REG;
+               return 0;
+       }
+
+       if (S_ISDIR(st->st_mode)) {
+               *type = PMEM2_FTYPE_DIR;
+               return 0;
+       }
+
+       ERR("file type 0%o not supported", st->st_mode & S_IFMT);
+       return PMEM2_E_INVALID_FILE_TYPE;
+}
+
+/*
+ * pmem2_device_dax_size -- checks the size of a given
+ * dax device from given source structure
+ */
+int
+pmem2_device_dax_size(const struct pmem2_source *src, size_t *size)
+{
+       const char *err =
+               "BUG: pmem2_device_dax_size should never be called on this OS";
+       ERR("%s", err);
+       ASSERTinfo(0, err);
+       return PMEM2_E_NOSUPP;
+}
+
+/*
+ * pmem2_device_dax_alignment -- checks the alignment of a given
+ * dax device from given source
+ */
+int
+pmem2_device_dax_alignment(const struct pmem2_source *src, size_t *alignment)
+{
+       const char *err =
+               "BUG: pmem2_device_dax_alignment should never be called on this OS";
+       ERR("%s", err);
+       ASSERTinfo(0, err);
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/ppc64/.cstyleignore b/ceph/src/pmdk/src/libpmem2/ppc64/.cstyleignore
new file mode 100644 (file)
index 0000000..27bb127
--- /dev/null
@@ -0,0 +1 @@
+init.c
diff --git a/ceph/src/pmdk/src/libpmem2/ppc64/flags.inc b/ceph/src/pmdk/src/libpmem2/ppc64/flags.inc
new file mode 100644 (file)
index 0000000..35148f5
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019, IBM Corporation
+
+# Add ppc64 directory to the gnu-make search path
+vpath %.c $(TOP)/src/libpmem2/ppc64
+vpath %.h $(TOP)/src/libpmem2/ppc64
+
+# Include the ppc64 directory in gcc include search path
+CFLAGS += -Ippc64
diff --git a/ceph/src/pmdk/src/libpmem2/ppc64/init.c b/ceph/src/pmdk/src/libpmem2/ppc64/init.c
new file mode 100644 (file)
index 0000000..9fef99d
--- /dev/null
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019, IBM Corporation */
+/* Copyright 2019-2020, Intel Corporation */
+
+#include <errno.h>
+#include <sys/mman.h>
+
+#include "out.h"
+#include "pmem2_arch.h"
+#include "util.h"
+
+/*
+ * Older assemblers versions do not support the latest versions of L, e.g.
+ * Binutils 2.34.
+ * Workaround this by using longs.
+ */
+#define __SYNC(l) ".long (0x7c0004AC | ((" #l ") << 21))"
+#define __DCBF(ra, rb, l) ".long (0x7c0000AC | ((" #l ") << 21)"       \
+       " | ((" #ra ") << 16) | ((" #rb ") << 11))"
+
+static void
+ppc_fence(void)
+{
+       LOG(15, NULL);
+
+       /*
+        * Force a memory barrier to flush out all cache lines.
+        * Uses a heavyweight sync in order to guarantee the memory ordering
+        * even with a data cache flush.
+        * According to the POWER ISA 3.1, phwsync (aka. sync (L=4)) is treated
+        * as a hwsync by processors compatible with previous versions of the
+        * POWER ISA.
+        */
+       asm volatile(__SYNC(4) : : : "memory");
+}
+
+static void
+ppc_flush(const void *addr, size_t size)
+{
+       LOG(15, "addr %p size %zu", addr, size);
+
+       uintptr_t uptr = (uintptr_t)addr;
+       uintptr_t end = uptr + size;
+
+       /* round down the address */
+       uptr &= ~(CACHELINE_SIZE - 1);
+       while (uptr < end) {
+               /*
+                * Flush the data cache block.
+                * According to the POWER ISA 3.1, dcbstps (aka. dcbf (L=6))
+                * behaves as dcbf (L=0) on previous processors.
+                */
+               asm volatile(__DCBF(0, %0, 6) : :"r"(uptr) : "memory");
+
+               uptr += CACHELINE_SIZE;
+       }
+}
+
+void
+pmem2_arch_init(struct pmem2_arch_info *info)
+{
+       LOG(3, "libpmem*: PPC64 support");
+
+       info->fence = ppc_fence;
+       info->flush = ppc_flush;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/ppc64/sources.inc b/ceph/src/pmdk/src/libpmem2/ppc64/sources.inc
new file mode 100644 (file)
index 0000000..601ae03
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019, IBM Corporation
+
+LIBPMEM2_ARCH_SOURCE += init.c
diff --git a/ceph/src/pmdk/src/libpmem2/ravl_interval.c b/ceph/src/pmdk/src/libpmem2/ravl_interval.c
new file mode 100644 (file)
index 0000000..fe4debe
--- /dev/null
@@ -0,0 +1,260 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * ravl_interval.c -- ravl_interval implementation
+ */
+
+#include "alloc.h"
+#include "map.h"
+#include "ravl_interval.h"
+#include "pmem2_utils.h"
+#include "sys_util.h"
+#include "os_thread.h"
+#include "ravl.h"
+
+/*
+ * ravl_interval - structure representing two points
+ *                 on the number line
+ */
+struct ravl_interval {
+       struct ravl *tree;
+       ravl_interval_min *get_min;
+       ravl_interval_max *get_max;
+};
+
+/*
+ * ravl_interval_node - structure holding min, max functions and address
+ */
+struct ravl_interval_node {
+       void *addr;
+       ravl_interval_min *get_min;
+       ravl_interval_max *get_max;
+};
+
+/*
+ * ravl_interval_compare -- compare intervals by its boundaries,
+ *                          no overlapping allowed
+ */
+static int
+ravl_interval_compare(const void *lhs, const void *rhs)
+{
+       const struct ravl_interval_node *left = lhs;
+       const struct ravl_interval_node *right = rhs;
+
+       if (left->get_max(left->addr) <= right->get_min(right->addr))
+               return -1;
+       if (left->get_min(left->addr) >= right->get_max(right->addr))
+               return 1;
+       return 0;
+}
+
+/*
+ * ravl_interval_delete - finalize the ravl interval module
+ */
+void
+ravl_interval_delete(struct ravl_interval *ri)
+{
+       ravl_delete(ri->tree);
+       ri->tree = NULL;
+       Free(ri);
+}
+
+/*
+ * ravl_interval_new -- initialize the ravl interval module
+ */
+struct ravl_interval *
+ravl_interval_new(ravl_interval_min *get_min, ravl_interval_max *get_max)
+{
+       int ret;
+       struct ravl_interval *interval = pmem2_malloc(sizeof(*interval), &ret);
+       if (ret)
+               goto ret_null;
+
+       interval->tree = ravl_new_sized(ravl_interval_compare,
+                       sizeof(struct ravl_interval_node));
+       if (!(interval->tree))
+               goto free_alloc;
+
+       interval->get_min = get_min;
+       interval->get_max = get_max;
+
+       return interval;
+
+free_alloc:
+       Free(interval);
+ret_null:
+       return NULL;
+}
+
+/*
+ * ravl_interval_insert -- insert interval entry into the tree
+ */
+int
+ravl_interval_insert(struct ravl_interval *ri, void *addr)
+{
+       struct ravl_interval_node rin;
+       rin.addr = addr;
+       rin.get_min = ri->get_min;
+       rin.get_max = ri->get_max;
+
+       if (ravl_emplace_copy(ri->tree, &rin))
+               return PMEM2_E_ERRNO;
+
+       return 0;
+}
+
+/*
+ * ravl_interval_remove -- remove interval entry from the tree
+ */
+int
+ravl_interval_remove(struct ravl_interval *ri, struct ravl_interval_node *rin)
+{
+       struct ravl_node *node = ravl_find(ri->tree, rin,
+                       RAVL_PREDICATE_EQUAL);
+       if (!node)
+               return PMEM2_E_MAPPING_NOT_FOUND;
+
+       ravl_remove(ri->tree, node);
+
+       return 0;
+}
+
+/*
+ * ravl_interval_find_prior_or_eq -- find overlapping interval starting prior to
+ *                                   the current one or at the same place
+ */
+static struct ravl_interval_node *
+ravl_interval_find_prior_or_eq(struct ravl *tree,
+               struct ravl_interval_node *rin)
+{
+       struct ravl_node *node;
+       struct ravl_interval_node *cur;
+
+       node = ravl_find(tree, rin, RAVL_PREDICATE_LESS_EQUAL);
+       if (!node)
+               return NULL;
+
+       cur = ravl_data(node);
+       /*
+        * If the end of the found interval is below the searched boundary, then
+        * this is not our interval.
+        */
+       if (cur->get_max(cur->addr) <= rin->get_min(rin->addr))
+               return NULL;
+
+       return cur;
+}
+
+/*
+ * ravl_interval_find_later -- find overlapping interval starting later than
+ *                             the current one
+ */
+static struct ravl_interval_node *
+ravl_interval_find_later(struct ravl *tree, struct ravl_interval_node *rin)
+{
+       struct ravl_node *node;
+       struct ravl_interval_node *cur;
+
+       node = ravl_find(tree, rin, RAVL_PREDICATE_GREATER);
+       if (!node)
+               return NULL;
+
+       cur = ravl_data(node);
+
+       /*
+        * If the beginning of the found interval is above the end of
+        * the searched range, then this is not our interval.
+        */
+       if (cur->get_min(cur->addr) >= rin->get_max(rin->addr))
+               return NULL;
+
+       return cur;
+}
+
+/*
+ * ravl_interval_find_equal -- find the interval with exact (min, max) range
+ */
+struct ravl_interval_node *
+ravl_interval_find_equal(struct ravl_interval *ri, void *addr)
+{
+       struct ravl_interval_node range;
+       range.addr = addr;
+       range.get_min = ri->get_min;
+       range.get_max = ri->get_max;
+
+       struct ravl_node *node;
+       node = ravl_find(ri->tree, &range, RAVL_PREDICATE_EQUAL);
+       if (!node)
+               return NULL;
+
+       return ravl_data(node);
+}
+
+/*
+ * ravl_interval_find -- find the earliest interval within (min, max) range
+ */
+struct ravl_interval_node *
+ravl_interval_find(struct ravl_interval *ri, void *addr)
+{
+       struct ravl_interval_node range;
+       range.addr = addr;
+       range.get_min = ri->get_min;
+       range.get_max = ri->get_max;
+
+       struct ravl_interval_node *cur;
+       cur = ravl_interval_find_prior_or_eq(ri->tree, &range);
+       if (!cur)
+               cur = ravl_interval_find_later(ri->tree, &range);
+
+       return cur;
+}
+
+/*
+ * ravl_interval_find_closest_prior -- find the closest interval
+ *                                     neighbor prior to the current one
+ */
+struct ravl_interval_node *
+ravl_interval_find_closest_prior(struct ravl_interval *ri, void *addr)
+{
+       struct ravl_interval_node range;
+       range.addr = addr;
+       range.get_min = ri->get_min;
+       range.get_max = ri->get_max;
+
+       struct ravl_node *node;
+       node = ravl_find(ri->tree, &range, RAVL_PREDICATE_LESS);
+       if (!node)
+               return NULL;
+
+       return ravl_data(node);
+}
+
+/*
+ * ravl_interval_find_closest_later -- find the closest interval neighbor
+ *                                     that occurs after the current one
+ */
+struct ravl_interval_node *
+ravl_interval_find_closest_later(struct ravl_interval *ri, void *addr)
+{
+       struct ravl_interval_node range;
+       range.addr = addr;
+       range.get_min = ri->get_min;
+       range.get_max = ri->get_max;
+
+       struct ravl_node *node;
+       node = ravl_find(ri->tree, &range, RAVL_PREDICATE_GREATER);
+       if (!node)
+               return NULL;
+
+       return ravl_data(node);
+}
+
+/*
+ * ravl_interval_data -- returns the data contained within an interval node
+ */
+void *
+ravl_interval_data(struct ravl_interval_node *rin)
+{
+       return (void *)rin->addr;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/ravl_interval.h b/ceph/src/pmdk/src/libpmem2/ravl_interval.h
new file mode 100644 (file)
index 0000000..5dd8b59
--- /dev/null
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * ravl_interval.h -- internal definitions for ravl_interval
+ */
+
+#ifndef RAVL_INTERVAL_H
+#define RAVL_INTERVAL_H
+
+#include "libpmem2.h"
+#include "os_thread.h"
+#include "ravl.h"
+
+struct ravl_interval;
+struct ravl_interval_node;
+
+typedef size_t ravl_interval_min(void *addr);
+typedef size_t ravl_interval_max(void *addr);
+
+struct ravl_interval *ravl_interval_new(ravl_interval_min *min,
+               ravl_interval_min *max);
+void  ravl_interval_delete(struct ravl_interval *ri);
+int ravl_interval_insert(struct ravl_interval *ri, void *addr);
+int ravl_interval_remove(struct ravl_interval *ri,
+               struct ravl_interval_node *rin);
+struct ravl_interval_node *ravl_interval_find_equal(struct ravl_interval *ri,
+               void *addr);
+struct ravl_interval_node *ravl_interval_find(struct ravl_interval *ri,
+               void *addr);
+struct ravl_interval_node *ravl_interval_find_closest_prior(
+       struct ravl_interval *ri, void *addr);
+struct ravl_interval_node *ravl_interval_find_closest_later(
+               struct ravl_interval *ri, void *addr);
+void *ravl_interval_data(struct ravl_interval_node *rin);
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/region_namespace.h b/ceph/src/pmdk/src/libpmem2/region_namespace.h
new file mode 100644 (file)
index 0000000..2957ea6
--- /dev/null
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * region_namespace.h -- internal definitions for libpmem2
+ *                       common region related functions
+ */
+
+#ifndef PMDK_REGION_NAMESPACE_H
+#define PMDK_REGION_NAMESPACE_H 1
+
+#include "os.h"
+#include "pmem2_utils.h"
+#include "source.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int pmem2_get_region_id(const struct pmem2_source *src, unsigned *region_id);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_REGION_NAMESPACE_H */
diff --git a/ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.c b/ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.c
new file mode 100644 (file)
index 0000000..1383796
--- /dev/null
@@ -0,0 +1,258 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * region_namespace_ndctl.c -- common ndctl functions
+ */
+
+#include <ndctl/libndctl.h>
+#include <ndctl/libdaxctl.h>
+#include <sys/sysmacros.h>
+#include <fcntl.h>
+
+#include "libpmem2.h"
+#include "pmem2_utils.h"
+
+#include "region_namespace_ndctl.h"
+#include "region_namespace.h"
+#include "out.h"
+
+/*
+ * ndctl_match_devdax -- (internal) returns 0 if the devdax matches
+ *                       with the given file, 1 if it doesn't match,
+ *                       and a negative value in case of an error.
+ */
+static int
+ndctl_match_devdax(dev_t st_rdev, const char *devname)
+{
+       LOG(3, "st_rdev %lu devname %s", st_rdev, devname);
+
+       if (*devname == '\0')
+               return 1;
+
+       char path[PATH_MAX];
+       os_stat_t stat;
+
+       if (util_snprintf(path, PATH_MAX, "/dev/%s", devname) < 0) {
+               ERR("!snprintf");
+               return PMEM2_E_ERRNO;
+       }
+
+       if (os_stat(path, &stat)) {
+               ERR("!stat %s", path);
+               return PMEM2_E_ERRNO;
+       }
+
+       if (st_rdev != stat.st_rdev) {
+               LOG(10, "skipping not matching device: %s", path);
+               return 1;
+       }
+
+       LOG(4, "found matching device: %s", path);
+
+       return 0;
+}
+
+#define BUFF_LENGTH 64
+
+/*
+ * ndctl_match_fsdax -- (internal) returns 0 if the device matches
+ *                      with the given file, 1 if it doesn't match,
+ *                      and a negative value in case of an error.
+ */
+static int
+ndctl_match_fsdax(dev_t st_dev, const char *devname)
+{
+       LOG(3, "st_dev %lu devname %s", st_dev, devname);
+
+       if (*devname == '\0')
+               return 1;
+
+       char path[PATH_MAX];
+       char dev_id[BUFF_LENGTH];
+
+       if (util_snprintf(path, PATH_MAX, "/sys/block/%s/dev", devname) < 0) {
+               ERR("!snprintf");
+               return PMEM2_E_ERRNO;
+       }
+
+       if (util_snprintf(dev_id, BUFF_LENGTH, "%d:%d",
+                       major(st_dev), minor(st_dev)) < 0) {
+               ERR("!snprintf");
+               return PMEM2_E_ERRNO;
+       }
+
+       int fd = os_open(path, O_RDONLY);
+       if (fd < 0) {
+               ERR("!open \"%s\"", path);
+               return PMEM2_E_ERRNO;
+       }
+
+       char buff[BUFF_LENGTH];
+       ssize_t nread = read(fd, buff, BUFF_LENGTH);
+       if (nread < 0) {
+               ERR("!read");
+               int oerrno = errno; /* save the errno */
+               os_close(fd);
+               errno = oerrno;
+               return PMEM2_E_ERRNO;
+       }
+
+       os_close(fd);
+
+       if (nread == 0) {
+               ERR("%s is empty", path);
+               return PMEM2_E_INVALID_DEV_FORMAT;
+       }
+
+       if (buff[nread - 1] != '\n') {
+               ERR("%s doesn't end with new line", path);
+               return PMEM2_E_INVALID_DEV_FORMAT;
+       }
+
+       buff[nread - 1] = '\0';
+
+       if (strcmp(buff, dev_id) != 0) {
+               LOG(10, "skipping not matching device: %s", path);
+               return 1;
+       }
+
+       LOG(4, "found matching device: %s", path);
+
+       return 0;
+}
+
+/*
+ * pmem2_region_namespace -- returns the region
+ *                           (and optionally the namespace)
+ *                           where the given file is located
+ */
+int
+pmem2_region_namespace(struct ndctl_ctx *ctx,
+                       const struct pmem2_source *src,
+                       struct ndctl_region **pregion,
+                       struct ndctl_namespace **pndns)
+{
+       LOG(3, "ctx %p src %p pregion %p pnamespace %p",
+               ctx, src, pregion, pndns);
+
+       struct ndctl_bus *bus;
+       struct ndctl_region *region;
+       struct ndctl_namespace *ndns;
+
+       if (pregion)
+               *pregion = NULL;
+
+       if (pndns)
+               *pndns = NULL;
+
+       if (src->value.ftype == PMEM2_FTYPE_DIR) {
+               ERR("cannot check region or namespace of a directory");
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       FOREACH_BUS_REGION_NAMESPACE(ctx, bus, region, ndns) {
+               struct ndctl_btt *btt;
+               struct ndctl_dax *dax = NULL;
+               struct ndctl_pfn *pfn;
+               const char *devname;
+
+               if ((dax = ndctl_namespace_get_dax(ndns))) {
+                       if (src->value.ftype == PMEM2_FTYPE_REG)
+                               continue;
+                       ASSERTeq(src->value.ftype, PMEM2_FTYPE_DEVDAX);
+
+                       struct daxctl_region *dax_region;
+                       dax_region = ndctl_dax_get_daxctl_region(dax);
+                       if (!dax_region) {
+                               ERR("!cannot find dax region");
+                               return PMEM2_E_DAX_REGION_NOT_FOUND;
+                       }
+                       struct daxctl_dev *dev;
+                       daxctl_dev_foreach(dax_region, dev) {
+                               devname = daxctl_dev_get_devname(dev);
+                               int ret = ndctl_match_devdax(src->value.st_rdev,
+                                       devname);
+                               if (ret < 0)
+                                       return ret;
+
+                               if (ret == 0) {
+                                       if (pregion)
+                                               *pregion = region;
+                                       if (pndns)
+                                               *pndns = ndns;
+
+                                       return 0;
+                               }
+                       }
+
+               } else {
+                       if (src->value.ftype == PMEM2_FTYPE_DEVDAX)
+                               continue;
+                       ASSERTeq(src->value.ftype, PMEM2_FTYPE_REG);
+
+                       if ((btt = ndctl_namespace_get_btt(ndns))) {
+                               devname = ndctl_btt_get_block_device(btt);
+                       } else if ((pfn = ndctl_namespace_get_pfn(ndns))) {
+                               devname = ndctl_pfn_get_block_device(pfn);
+                       } else {
+                               devname =
+                                       ndctl_namespace_get_block_device(ndns);
+                       }
+
+                       int ret = ndctl_match_fsdax(src->value.st_dev, devname);
+                       if (ret < 0)
+                               return ret;
+
+                       if (ret == 0) {
+                               if (pregion)
+                                       *pregion = region;
+                               if (pndns)
+                                       *pndns = ndns;
+
+                               return 0;
+                       }
+               }
+       }
+
+       LOG(10, "did not found any matching device");
+
+       return 0;
+}
+
+/*
+ * pmem2_region_get_id -- returns the region id
+ */
+int
+pmem2_get_region_id(const struct pmem2_source *src, unsigned *region_id)
+{
+       LOG(3, "src %p region_id %p", src, region_id);
+
+       struct ndctl_region *region;
+       struct ndctl_namespace *ndns;
+       struct ndctl_ctx *ctx;
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       int rv = pmem2_region_namespace(ctx, src, &region, &ndns);
+       if (rv) {
+               LOG(1, "getting region and namespace failed");
+               goto end;
+       }
+
+       if (!region) {
+               ERR("unknown region");
+               rv = PMEM2_E_DAX_REGION_NOT_FOUND;
+               goto end;
+       }
+
+       *region_id = ndctl_region_get_id(region);
+
+end:
+       ndctl_unref(ctx);
+       return rv;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.h b/ceph/src/pmdk/src/libpmem2/region_namespace_ndctl.h
new file mode 100644 (file)
index 0000000..8c89a16
--- /dev/null
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * region_namespace_ndctl.h -- internal definitions for libpmem2
+ *                             common ndctl functions
+ */
+
+#ifndef PMDK_REGION_NAMESPACE_NDCTL_H
+#define PMDK_REGION_NAMESPACE_NDCTL_H 1
+
+#include "os.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define FOREACH_BUS_REGION_NAMESPACE(ctx, bus, region, ndns)   \
+       ndctl_bus_foreach(ctx, bus)                             \
+       ndctl_region_foreach(bus, region)                       \
+       ndctl_namespace_foreach(region, ndns)
+
+int pmem2_region_namespace(struct ndctl_ctx *ctx,
+                       const struct pmem2_source *src,
+                       struct ndctl_region **pregion,
+                       struct ndctl_namespace **pndns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PMDK_REGION_NAMESPACE_NDCTL_H */
diff --git a/ceph/src/pmdk/src/libpmem2/region_namespace_none.c b/ceph/src/pmdk/src/libpmem2/region_namespace_none.c
new file mode 100644 (file)
index 0000000..9fd934a
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+#include "region_namespace.h"
+#include "out.h"
+
+/*
+ * pmem2_get_region_id -- define behavior without ndctl
+ */
+int
+pmem2_get_region_id(const struct pmem2_source *src, unsigned *region_id)
+{
+       LOG(3, "Cannot read region id - ndctl is not available");
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/source.c b/ceph/src/pmdk/src/libpmem2/source.c
new file mode 100644 (file)
index 0000000..380d21a
--- /dev/null
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+#include "source.h"
+#include "alloc.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2.h"
+#include "pmem2_utils.h"
+
+int
+pmem2_source_from_anon(struct pmem2_source **src, size_t size)
+{
+       PMEM2_ERR_CLR();
+
+       int ret;
+       struct pmem2_source *srcp = pmem2_malloc(sizeof(**src), &ret);
+       if (ret)
+               return ret;
+
+       srcp->type = PMEM2_SOURCE_ANON;
+       srcp->value.size = size;
+
+       *src = srcp;
+
+       return 0;
+}
+
+int
+pmem2_source_delete(struct pmem2_source **src)
+{
+       /* we do not need to clear err because this function cannot fail */
+
+       Free(*src);
+       *src = NULL;
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/source.h b/ceph/src/pmdk/src/libpmem2/source.h
new file mode 100644 (file)
index 0000000..38ae321
--- /dev/null
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+#ifndef PMEM2_SOURCE_H
+#define PMEM2_SOURCE_H
+
+#include "os.h"
+
+#define INVALID_FD (-1)
+
+enum pmem2_file_type {
+       PMEM2_FTYPE_REG = 1,
+       PMEM2_FTYPE_DEVDAX = 2,
+       PMEM2_FTYPE_DIR = 3,
+};
+
+enum pmem2_source_type {
+       PMEM2_SOURCE_UNSPECIFIED,
+       PMEM2_SOURCE_ANON,
+       PMEM2_SOURCE_FD,
+       PMEM2_SOURCE_HANDLE,
+
+       MAX_PMEM2_SOURCE_TYPE
+};
+
+struct pmem2_source {
+       /* a source file descriptor / handle for the designed mapping */
+       enum pmem2_source_type type;
+       struct {
+               enum pmem2_file_type ftype;
+               union {
+                       /* PMEM2_SOURCE_ANON */
+                       size_t size;
+#ifdef _WIN32
+                       /* PMEM2_SOURCE_HANDLE */
+                       HANDLE handle;
+#else
+                       /* PMEM2_SOURCE_FD */
+                       struct {
+                               int fd;
+                               dev_t st_rdev;
+                               dev_t st_dev;
+                       };
+#endif
+               };
+       } value;
+};
+
+#endif /* PMEM2_SOURCE_H */
diff --git a/ceph/src/pmdk/src/libpmem2/source_posix.c b/ceph/src/pmdk/src/libpmem2/source_posix.c
new file mode 100644 (file)
index 0000000..92f6186
--- /dev/null
@@ -0,0 +1,196 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+#include <errno.h>
+#include <fcntl.h>
+#include "os.h"
+#include "source.h"
+#include "alloc.h"
+#include "libpmem2.h"
+#include "out.h"
+#include "pmem2.h"
+#include "pmem2_utils.h"
+#include "util.h"
+
+/*
+ * pmem2_source_from_fd -- create a new data source instance
+ */
+int
+pmem2_source_from_fd(struct pmem2_source **src, int fd)
+{
+       PMEM2_ERR_CLR();
+
+       *src = NULL;
+
+       if (fd < 0)
+               return PMEM2_E_INVALID_FILE_HANDLE;
+
+       int flags = fcntl(fd, F_GETFL);
+
+       if (flags == -1) {
+               ERR("!fcntl");
+               if (errno == EBADF)
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               return PMEM2_E_ERRNO;
+       }
+
+       if ((flags & O_ACCMODE) == O_WRONLY) {
+               ERR("fd must be open with O_RDONLY or O_RDWR");
+               return PMEM2_E_INVALID_FILE_HANDLE;
+       }
+
+       /*
+        * XXX Files with FS_APPEND_FL attribute should also generate an error.
+        * If it is possible to filter them out pmem2_map_new would not generate
+        * -EACCESS trying to map them. Please update pmem2_map_new.3 when it
+        * will be fixed.
+        * For details please see the ioctl_iflags(2) manual page.
+        */
+
+       os_stat_t st;
+
+       if (os_fstat(fd, &st) < 0) {
+               ERR("!fstat");
+               if (errno == EBADF)
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               return PMEM2_E_ERRNO;
+       }
+
+       enum pmem2_file_type ftype;
+       int ret = pmem2_get_type_from_stat(&st, &ftype);
+       if (ret != 0)
+               return ret;
+
+       if (ftype == PMEM2_FTYPE_DIR) {
+               ERR("cannot set fd to directory in pmem2_source_from_fd");
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       struct pmem2_source *srcp = pmem2_malloc(sizeof(**src), &ret);
+       if (ret)
+               return ret;
+
+       ASSERTne(srcp, NULL);
+
+       srcp->type = PMEM2_SOURCE_FD;
+       srcp->value.ftype = ftype;
+       srcp->value.fd = fd;
+       srcp->value.st_rdev = st.st_rdev;
+       srcp->value.st_dev = st.st_dev;
+       *src = srcp;
+
+       return 0;
+}
+
+/*
+ * pmem2_source_size -- get a size of the file descriptor stored in the provided
+ * source
+ */
+int
+pmem2_source_size(const struct pmem2_source *src, size_t *size)
+{
+       LOG(3, "type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               *size = src->value.size;
+               return 0;
+       }
+
+       ASSERT(src->type == PMEM2_SOURCE_FD);
+
+       os_stat_t st;
+
+       if (os_fstat(src->value.fd, &st) < 0) {
+               ERR("!fstat");
+               if (errno == EBADF)
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               return PMEM2_E_ERRNO;
+       }
+
+       switch (src->value.ftype) {
+       case PMEM2_FTYPE_DEVDAX: {
+               int ret = pmem2_device_dax_size(src, size);
+               if (ret)
+                       return ret;
+               break;
+       }
+       case PMEM2_FTYPE_REG:
+               if (st.st_size < 0) {
+                       ERR(
+                               "kernel says size of regular file is negative (%ld)",
+                               st.st_size);
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               }
+               *size = (size_t)st.st_size;
+               break;
+       default:
+               FATAL(
+                       "BUG: unhandled file type in pmem2_source_size");
+       }
+
+       LOG(4, "file length %zu", *size);
+       return 0;
+}
+
+/*
+ * pmem2_source_alignment -- get alignment from the file descriptor stored in
+ * the provided source
+ */
+int
+pmem2_source_alignment(const struct pmem2_source *src, size_t *alignment)
+{
+       LOG(3, "type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               *alignment = Pagesize;
+               return 0;
+       }
+
+       ASSERT(src->type == PMEM2_SOURCE_FD);
+
+       switch (src->value.ftype) {
+       case PMEM2_FTYPE_DEVDAX: {
+               int ret = pmem2_device_dax_alignment(src, alignment);
+               if (ret)
+                       return ret;
+               break;
+       }
+       case PMEM2_FTYPE_REG:
+               *alignment = Pagesize;
+               break;
+       default:
+               FATAL(
+                       "BUG: unhandled file type in pmem2_source_alignment");
+       }
+
+       if (!util_is_pow2(*alignment)) {
+               ERR("alignment (%zu) has to be a power of two", *alignment);
+               return PMEM2_E_INVALID_ALIGNMENT_VALUE;
+       }
+
+       LOG(4, "alignment %zu", *alignment);
+
+       return 0;
+}
+
+/*
+ * pmem2_source_get_fd -- get file descriptor from provided source
+ */
+int
+pmem2_source_get_fd(const struct pmem2_source *src, int *fd)
+{
+       LOG(3, "src type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_FD) {
+               *fd = src->value.fd;
+       } else {
+               ERR(
+                       "File descriptor is not set, source type does not support fd");
+               return PMEM2_E_FILE_DESCRIPTOR_NOT_SET;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/source_windows.c b/ceph/src/pmdk/src/libpmem2/source_windows.c
new file mode 100644 (file)
index 0000000..fb81327
--- /dev/null
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2019-2020, Intel Corporation */
+
+/*
+ * source_windows.c -- windows specific pmem2_source implementation
+ */
+
+#include <Windows.h>
+#include "config.h"
+#include "libpmem2.h"
+#include "config.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "source.h"
+#include "util.h"
+
+/*
+ * pmem2_source_from_fd -- create a new data source instance
+ */
+int
+pmem2_source_from_fd(struct pmem2_source **src, int fd)
+{
+       PMEM2_ERR_CLR();
+
+       *src = NULL;
+
+       if (fd < 0) {
+               ERR("Invalid file descriptor value %d", fd);
+               return PMEM2_E_INVALID_FILE_HANDLE;
+       }
+
+       HANDLE handle = (HANDLE)_get_osfhandle(fd);
+
+       if (handle == INVALID_HANDLE_VALUE) {
+               /*
+                * _get_osfhandle aborts in an error case, so technically
+                * this is dead code. But according to MSDN it is
+                * setting an errno on failure, so we can return it in case of
+                * "windows magic" happen and this function "accidentally"
+                * will not abort.
+                */
+               ERR("!_get_osfhandle");
+               if (errno == EBADF)
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               return PMEM2_E_ERRNO;
+       }
+
+       return pmem2_source_from_handle(src, handle);
+}
+
+/*
+ * pmem2_win_stat -- retrieve information about handle
+ */
+static int
+pmem2_win_stat(HANDLE handle, BY_HANDLE_FILE_INFORMATION *info)
+{
+       if (!GetFileInformationByHandle(handle, info)) {
+               ERR("!!GetFileInformationByHandle");
+               if (GetLastError() == ERROR_INVALID_HANDLE)
+                       return PMEM2_E_INVALID_FILE_HANDLE;
+               else
+                       return pmem2_lasterror_to_err();
+       }
+
+       if (info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+               ERR(
+                       "using directory doesn't make any sense in context of pmem2");
+               return PMEM2_E_INVALID_FILE_TYPE;
+       }
+
+       return 0;
+}
+
+/*
+ * pmem2_source_from_fd -- create a new data source instance
+ */
+int
+pmem2_source_from_handle(struct pmem2_source **src, HANDLE handle)
+{
+       PMEM2_ERR_CLR();
+
+       *src = NULL;
+       int ret;
+
+       if (handle == INVALID_HANDLE_VALUE) {
+               ERR("Invalid file handle has been passed");
+               return PMEM2_E_INVALID_FILE_HANDLE;
+       }
+
+       BY_HANDLE_FILE_INFORMATION file_info;
+       ret = pmem2_win_stat(handle, &file_info);
+       if (ret)
+               return ret;
+
+       /* XXX: winapi doesn't provide option to get open flags from HANDLE */
+
+       struct pmem2_source *srcp = pmem2_malloc(sizeof(**src), &ret);
+
+       if (ret)
+               return ret;
+
+       ASSERTne(srcp, NULL);
+
+       srcp->type = PMEM2_SOURCE_HANDLE;
+       srcp->value.handle = handle;
+       *src = srcp;
+
+       return 0;
+}
+
+/*
+ * pmem2_source_size -- get a size of the file handle stored in the provided
+ * source
+ */
+int
+pmem2_source_size(const struct pmem2_source *src, size_t *size)
+{
+       LOG(3, "type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       int ret;
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               *size = src->value.size;
+               return 0;
+       }
+       ASSERTeq(src->type, PMEM2_SOURCE_HANDLE);
+
+       BY_HANDLE_FILE_INFORMATION info;
+       ret = pmem2_win_stat(src->value.handle, &info);
+       if (ret)
+               return ret;
+
+       *size = ((size_t)info.nFileSizeHigh << 32) | info.nFileSizeLow;
+
+       LOG(4, "file length %zu", *size);
+
+       return 0;
+}
+
+/*
+ * pmem2_source_alignment -- get alignment from the system info
+ */
+int
+pmem2_source_alignment(const struct pmem2_source *src, size_t *alignment)
+{
+       LOG(3, "type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       SYSTEM_INFO info;
+       GetSystemInfo(&info);
+
+       *alignment = (size_t)info.dwAllocationGranularity;
+
+       if (!util_is_pow2(*alignment)) {
+               ERR("alignment (%zu) has to be a power of two", *alignment);
+               return PMEM2_E_INVALID_ALIGNMENT_VALUE;
+       }
+
+       LOG(4, "alignment %zu", *alignment);
+
+       return 0;
+}
+
+/*
+ * pmem2_source_get_handle -- get file handler from provided source
+ */
+int
+pmem2_source_get_handle(const struct pmem2_source *src, HANDLE *h)
+{
+       LOG(3, "src type %d", src->type);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_HANDLE) {
+               *h = src->value.handle;
+       } else {
+               ERR(
+                       "File handle is not set, source type does not support file handles");
+               return PMEM2_E_FILE_HANDLE_NOT_SET;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/usc_ndctl.c b/ceph/src/pmdk/src/libpmem2/usc_ndctl.c
new file mode 100644 (file)
index 0000000..be63e87
--- /dev/null
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * usc_ndctl.c -- pmem2 usc function for platforms using ndctl
+ */
+#include <ndctl/libndctl.h>
+#include <ndctl/libdaxctl.h>
+#include <sys/types.h>
+#include <sys/sysmacros.h>
+#include <fcntl.h>
+
+#include "config.h"
+#include "file.h"
+#include "libpmem2.h"
+#include "os.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "source.h"
+#include "region_namespace_ndctl.h"
+
+int
+pmem2_source_device_usc(const struct pmem2_source *src, uint64_t *usc)
+{
+       LOG(3, "type %d, uid %p", src->type, usc);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not support unsafe shutdown count");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_FD);
+
+       struct ndctl_ctx *ctx;
+       int ret = PMEM2_E_NOSUPP;
+       *usc = 0;
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       struct ndctl_region *region = NULL;
+       ret = pmem2_region_namespace(ctx, src, &region, NULL);
+
+       if (ret < 0)
+               goto err;
+
+       ret = PMEM2_E_NOSUPP;
+
+       if (region == NULL) {
+               ERR(
+                       "Unsafe shutdown count is not supported for this source");
+               goto err;
+       }
+
+       struct ndctl_dimm *dimm;
+
+       ndctl_dimm_foreach_in_region(region, dimm) {
+               long long dimm_usc = ndctl_dimm_get_dirty_shutdown(dimm);
+               if (dimm_usc < 0) {
+                       ret = PMEM2_E_NOSUPP;
+                       ERR(
+                               "Unsafe shutdown count is not supported for this source");
+                       goto err;
+               }
+               *usc += (unsigned long long)dimm_usc;
+       }
+
+       ret = 0;
+
+err:
+       ndctl_unref(ctx);
+       return ret;
+}
+
+int
+pmem2_source_device_id(const struct pmem2_source *src, char *id, size_t *len)
+{
+       PMEM2_ERR_CLR();
+
+       struct ndctl_ctx *ctx;
+       struct ndctl_dimm *dimm;
+       int ret;
+       struct ndctl_region *region = NULL;
+       const char *dimm_uid;
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not have device id");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_FD);
+
+       errno = ndctl_new(&ctx) * (-1);
+       if (errno) {
+               ERR("!ndctl_new");
+               return PMEM2_E_ERRNO;
+       }
+
+       size_t len_base = 1; /* '\0' */
+
+       ret = pmem2_region_namespace(ctx, src, &region, NULL);
+
+       if (ret < 0)
+               goto err;
+
+       if (region == NULL) {
+               ret = PMEM2_E_NOSUPP;
+               goto err;
+       }
+
+       if (id == NULL) {
+               ndctl_dimm_foreach_in_region(region, dimm) {
+                       dimm_uid = ndctl_dimm_get_unique_id(dimm);
+                       if (dimm_uid == NULL) {
+                               ret = PMEM2_E_NOSUPP;
+                               goto err;
+                       }
+                       len_base += strlen(ndctl_dimm_get_unique_id(dimm));
+               }
+               goto end;
+       }
+
+       size_t count = 1;
+       ndctl_dimm_foreach_in_region(region, dimm) {
+               dimm_uid = ndctl_dimm_get_unique_id(dimm);
+               if (dimm_uid == NULL) {
+                       ret = PMEM2_E_NOSUPP;
+                       goto err;
+               }
+               count += strlen(dimm_uid);
+               if (count > *len) {
+                       ret = PMEM2_E_BUFFER_TOO_SMALL;
+                       goto err;
+               }
+               strncat(id, dimm_uid, *len);
+       }
+
+end:
+       ret = 0;
+       if (id == NULL)
+               *len = len_base;
+err:
+       ndctl_unref(ctx);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/usc_none.c b/ceph/src/pmdk/src/libpmem2/usc_none.c
new file mode 100644 (file)
index 0000000..9093f2b
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * usc_none.c -- pmem2 usc function for non supported platform
+ */
+
+#include "libpmem2.h"
+#include "out.h"
+
+int
+pmem2_source_device_id(const struct pmem2_source *src, char *id, size_t *len)
+{
+       ERR("Cannot read device id - ndctl is not available");
+       return PMEM2_E_NOSUPP;
+}
+
+int
+pmem2_source_device_usc(const struct pmem2_source *src, uint64_t *usc)
+{
+       ERR("Cannot read device usc - ndctl is not available");
+       return PMEM2_E_NOSUPP;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/usc_windows.c b/ceph/src/pmdk/src/libpmem2/usc_windows.c
new file mode 100644 (file)
index 0000000..1a949bc
--- /dev/null
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * usc_windows.c -- pmem2 usc function for windows
+ */
+
+#include "alloc.h"
+#include "source.h"
+#include "out.h"
+#include "libpmem2.h"
+#include "pmem2_utils.h"
+#define GUID_SIZE sizeof("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
+#define VOLUME_PATH_SIZE sizeof("\\\\?\\Volume{}") + (GUID_SIZE - 2 /* \0 */)
+
+/*
+ * get_volume_handle -- returns volume handle
+ */
+static int
+get_volume_handle(HANDLE handle, HANDLE *volume_handle)
+{
+       wchar_t *volume;
+       wchar_t tmp[10];
+       DWORD len =
+               GetFinalPathNameByHandleW(handle, tmp, 10, VOLUME_NAME_GUID);
+
+       if (len == 0) {
+               ERR("!!GetFinalPathNameByHandleW");
+               return pmem2_lasterror_to_err();
+       }
+
+       len *= sizeof(wchar_t);
+
+       int err;
+       volume = pmem2_malloc(len, &err);
+       if (volume == NULL)
+               return err;
+
+       if (!GetFinalPathNameByHandleW(handle, volume, len,
+               VOLUME_NAME_GUID)) {
+               Free(volume);
+               ERR("!!GetFinalPathNameByHandleW");
+               return pmem2_lasterror_to_err();
+       }
+
+       ASSERTeq(volume[VOLUME_PATH_SIZE], '\\');
+       volume[VOLUME_PATH_SIZE] = '\0';
+
+       *volume_handle = CreateFileW(volume, /* path to the file */
+               /* request access to send ioctl to the file */
+               FILE_READ_ATTRIBUTES,
+               /* do not block access to the file */
+               FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+               NULL, /* security attributes */
+               OPEN_EXISTING, /* open only if it exists */
+               FILE_ATTRIBUTE_NORMAL, /* no attributes */
+               NULL); /* used only for new files */
+
+       Free(volume);
+       if (*volume_handle == INVALID_HANDLE_VALUE) {
+               ERR("!!CreateFileW");
+               return pmem2_lasterror_to_err();
+       }
+
+       return 0;
+}
+
+static int
+get_device_guid(HANDLE handle, GUID *guid)
+{
+       HANDLE vHandle;
+       int ret = get_volume_handle(handle, &vHandle);
+       if (vHandle == INVALID_HANDLE_VALUE)
+               return ret;
+
+       STORAGE_DEVICE_NUMBER_EX sdn;
+       sdn.DeviceNumber = -1;
+       DWORD dwBytesReturned = 0;
+       if (!DeviceIoControl(vHandle,
+               IOCTL_STORAGE_GET_DEVICE_NUMBER_EX,
+               NULL, 0,
+               &sdn, sizeof(sdn),
+               &dwBytesReturned, NULL)) {
+               /*
+                * IOCTL_STORAGE_GET_DEVICE_NUMBER_EX is not supported
+                * on this server
+                */
+               ERR(
+                       "Getting device id (IOCTL_STORAGE_GET_DEVICE_NUMBER_EX) is not supported on this system");
+               CloseHandle(vHandle);
+               return PMEM2_E_NOSUPP;
+       }
+       *guid = sdn.DeviceGuid;
+
+       CloseHandle(vHandle);
+       return 0;
+}
+
+int
+pmem2_source_device_idW(const struct pmem2_source *src, wchar_t *id,
+       size_t *len)
+{
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not have device id");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_HANDLE);
+
+       if (id == NULL) {
+               *len = GUID_SIZE * sizeof(*id);
+               return 0;
+       }
+
+       if (*len < GUID_SIZE * sizeof(*id)) {
+               ERR("id buffer is to small");
+               return PMEM2_E_BUFFER_TOO_SMALL;
+       }
+
+       GUID guid;
+       int ret = get_device_guid(src->value.handle, &guid);
+       if (ret)
+               return ret;
+
+       _snwprintf(id, GUID_SIZE,
+               L"%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX",
+               guid.Data1, guid.Data2, guid.Data3, guid.Data4[0],
+               guid.Data4[1], guid.Data4[2], guid.Data4[3],
+               guid.Data4[4], guid.Data4[5], guid.Data4[6],
+               guid.Data4[7]);
+       return 0;
+}
+
+int
+pmem2_source_device_idU(const struct pmem2_source *src, char *id, size_t *len)
+{
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not have device id");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_HANDLE);
+
+       if (id == NULL) {
+               *len = GUID_SIZE * sizeof(*id);
+               return 0;
+       }
+       if (*len < GUID_SIZE * sizeof(*id)) {
+               ERR("id buffer is to small");
+               return PMEM2_E_BUFFER_TOO_SMALL;
+       }
+
+       GUID guid;
+       int ret = get_device_guid(src->value.handle, &guid);
+       if (ret)
+               return ret;
+
+       if (util_snprintf(id, GUID_SIZE,
+               "%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX",
+               guid.Data1, guid.Data2, guid.Data3, guid.Data4[0],
+               guid.Data4[1], guid.Data4[2], guid.Data4[3],
+               guid.Data4[4], guid.Data4[5], guid.Data4[6],
+               guid.Data4[7]) < 0) {
+               ERR("!snprintf");
+               return PMEM2_E_ERRNO;
+       }
+
+       return 0;
+}
+
+int
+pmem2_source_device_usc(const struct pmem2_source *src, uint64_t *usc)
+{
+       LOG(3, "cfg %p, usc %p", src, usc);
+       PMEM2_ERR_CLR();
+
+       if (src->type == PMEM2_SOURCE_ANON) {
+               ERR("Anonymous source does not support unsafe shutdown count");
+               return PMEM2_E_NOSUPP;
+       }
+
+       ASSERTeq(src->type, PMEM2_SOURCE_HANDLE);
+
+       *usc = 0;
+
+       HANDLE vHandle;
+       int err = get_volume_handle(src->value.handle, &vHandle);
+       if (vHandle == INVALID_HANDLE_VALUE)
+               return err;
+
+       STORAGE_PROPERTY_QUERY prop;
+       DWORD dwSize;
+       prop.PropertyId = StorageDeviceUnsafeShutdownCount;
+       prop.QueryType = PropertyExistsQuery;
+       prop.AdditionalParameters[0] = 0;
+       STORAGE_DEVICE_UNSAFE_SHUTDOWN_COUNT ret;
+
+       BOOL bResult = DeviceIoControl(vHandle,
+               IOCTL_STORAGE_QUERY_PROPERTY,
+               &prop, sizeof(prop),
+               &ret, sizeof(ret),
+               (LPDWORD)&dwSize, (LPOVERLAPPED)NULL);
+
+       if (!bResult) {
+               ERR(
+                       "Getting unsafe shutdown count is not supported on this system");
+               CloseHandle(vHandle);
+               return PMEM2_E_NOSUPP;
+       }
+       prop.QueryType = PropertyStandardQuery;
+       bResult = DeviceIoControl(vHandle,
+               IOCTL_STORAGE_QUERY_PROPERTY,
+               &prop, sizeof(prop),
+               &ret, sizeof(ret),
+               (LPDWORD)&dwSize, (LPOVERLAPPED)NULL);
+
+       CloseHandle(vHandle);
+       if (!bResult) {
+               ERR("!!DeviceIoControl");
+               return pmem2_lasterror_to_err();
+       }
+
+       *usc = ret.UnsafeShutdownCount;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/vm_reservation.c b/ceph/src/pmdk/src/libpmem2/vm_reservation.c
new file mode 100644 (file)
index 0000000..7ea4003
--- /dev/null
@@ -0,0 +1,294 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * vm_reservation.c -- implementation of virtual memory allocation API
+ */
+
+#include "alloc.h"
+#include "map.h"
+#include "pmem2_utils.h"
+#include "ravl_interval.h"
+#include "sys_util.h"
+#include "vm_reservation.h"
+
+#ifdef _WIN32
+#include <Windows.h>
+#endif
+
+struct pmem2_vm_reservation {
+       struct ravl_interval *itree;
+       void *addr;
+       size_t size;
+       os_rwlock_t lock;
+};
+
+int vm_reservation_reserve_memory(void *addr, size_t size, void **raddr,
+               size_t *rsize);
+int vm_reservation_release_memory(void *addr, size_t size);
+struct ravl_interval *vm_reservation_get_interval_tree(
+               struct pmem2_vm_reservation *rsv);
+
+/*
+ * pmem2_vm_reservation_get_address -- get reservation address
+ */
+void *
+pmem2_vm_reservation_get_address(struct pmem2_vm_reservation *rsv)
+{
+       LOG(3, "reservation %p", rsv);
+       /* we do not need to clear err because this function cannot fail */
+
+       return rsv->addr;
+}
+
+/*
+ * pmem2_vm_reservation_get_size -- get reservation size
+ */
+size_t
+pmem2_vm_reservation_get_size(struct pmem2_vm_reservation *rsv)
+{
+       LOG(3, "reservation %p", rsv);
+       /* we do not need to clear err because this function cannot fail */
+
+       return rsv->size;
+}
+
+/*
+ * mapping_min - return min boundary for mapping
+ */
+static size_t
+mapping_min(void *addr)
+{
+       struct pmem2_map *map = (struct pmem2_map *)addr;
+       return (size_t)map->addr;
+}
+
+/*
+ * mapping_max - return max boundary for mapping
+ */
+static size_t
+mapping_max(void *addr)
+{
+       struct pmem2_map *map = (struct pmem2_map *)addr;
+       return (size_t)map->addr + map->content_length;
+}
+
+/*
+ * pmem2_vm_reservation_init - initialize the reservation structure
+ */
+static int
+vm_reservation_init(struct pmem2_vm_reservation *rsv)
+{
+       util_rwlock_init(&rsv->lock);
+
+       rsv->itree = ravl_interval_new(mapping_min, mapping_max);
+       if (!rsv->itree)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * pmem2_vm_reservation_fini - finalize the reservation structure
+ */
+static void
+vm_reservation_fini(struct pmem2_vm_reservation *rsv)
+{
+       ravl_interval_delete(rsv->itree);
+       util_rwlock_destroy(&rsv->lock);
+}
+
+/*
+ * pmem2_vm_reservation_new -- creates new virtual memory reservation
+ */
+int
+pmem2_vm_reservation_new(struct pmem2_vm_reservation **rsv_ptr,
+       void *addr, size_t size)
+{
+       PMEM2_ERR_CLR();
+       *rsv_ptr = NULL;
+
+       /*
+        * base address has to be aligned to the allocation granularity
+        * on Windows, and to page size otherwise
+        */
+       if (addr && (unsigned long long)addr % Mmap_align) {
+               ERR("address %p is not a multiple of 0x%llx", addr,
+                       Mmap_align);
+               return PMEM2_E_ADDRESS_UNALIGNED;
+       }
+
+       /* the size must always be a multiple of the page size */
+       if (size % Pagesize) {
+               ERR("reservation size %zu is not a multiple of %llu",
+                       size, Pagesize);
+               return PMEM2_E_LENGTH_UNALIGNED;
+       }
+
+       int ret;
+       struct pmem2_vm_reservation *rsv = pmem2_malloc(
+                       sizeof(struct pmem2_vm_reservation), &ret);
+       if (ret)
+               return ret;
+
+       /* initialize the ravl interval tree */
+       ret = vm_reservation_init(rsv);
+       if (ret)
+               goto err_rsv_init;
+
+       void *raddr = NULL;
+       size_t rsize = 0;
+       ret = vm_reservation_reserve_memory(addr, size, &raddr, &rsize);
+       if (ret)
+               goto err_reserve;
+
+       rsv->addr = raddr;
+       rsv->size = rsize;
+
+       *rsv_ptr = rsv;
+
+       return 0;
+
+err_reserve:
+       vm_reservation_fini(rsv);
+err_rsv_init:
+       Free(rsv);
+       return ret;
+}
+
+/*
+ * pmem2_vm_reservation_delete -- deletes reservation bound to
+ *                                the pmem2_vm_reservation structure
+ */
+int
+pmem2_vm_reservation_delete(struct pmem2_vm_reservation **rsv_ptr)
+{
+       PMEM2_ERR_CLR();
+
+       struct pmem2_vm_reservation *rsv = *rsv_ptr;
+
+       /* check if reservation contains any mapping */
+       if (vm_reservation_map_find(rsv, 0, rsv->size)) {
+               ERR("vm reservation %p isn't empty", rsv);
+               return PMEM2_E_VM_RESERVATION_NOT_EMPTY;
+       }
+
+       int ret = vm_reservation_release_memory(rsv->addr, rsv->size);
+       if (ret)
+               return ret;
+
+       vm_reservation_fini(rsv);
+       Free(rsv);
+
+       return 0;
+}
+
+/*
+ * vm_reservation_map_register_release -- register mapping in the mappings tree
+ * of reservation structure and release previously acquired lock regardless
+ * of the success or failure of the function.
+ */
+int
+vm_reservation_map_register_release(struct pmem2_vm_reservation *rsv,
+               struct pmem2_map *map)
+{
+       int ret =  ravl_interval_insert(rsv->itree, map);
+       util_rwlock_unlock(&rsv->lock);
+
+       if (ret == -EEXIST) {
+               ERR(
+                       "mapping at the given region of the reservation already exist");
+               return PMEM2_E_MAPPING_EXISTS;
+       }
+
+       return ret;
+}
+
+/*
+ * vm_reservation_map_unregister_release -- unregister mapping from the mapping
+ * tree of reservation structure and release previously acquired lock regardless
+ * of the success or failure of the function.
+ */
+int
+vm_reservation_map_unregister_release(struct pmem2_vm_reservation *rsv,
+               struct pmem2_map *map)
+{
+       int ret = 0;
+       struct ravl_interval_node *node;
+
+       node = ravl_interval_find_equal(rsv->itree, map);
+       if (node) {
+               ret = ravl_interval_remove(rsv->itree, node);
+       } else {
+               ERR("Cannot find mapping %p in the reservation %p",
+                               map, rsv);
+               ret = PMEM2_E_MAPPING_NOT_FOUND;
+       }
+       util_rwlock_unlock(&rsv->lock);
+
+       return ret;
+}
+
+/*
+ * vm_reservation_map_find -- find the earliest mapping overlapping
+ *                                    with (addr, addr+size) range
+ */
+struct pmem2_map *
+vm_reservation_map_find(struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len)
+{
+       struct pmem2_map map;
+       map.addr = (char *)rsv->addr + reserv_offset;
+       map.content_length = len;
+
+       struct ravl_interval_node *node;
+
+       node = ravl_interval_find(rsv->itree, &map);
+
+       if (!node)
+               return NULL;
+
+       return (struct pmem2_map *)ravl_interval_data(node);
+}
+
+/*
+ * vm_reservation_map_find_acquire -- find the earliest mapping overlapping
+ * with (addr, addr+size) range. This function acquires a lock and keeps it
+ * until next release operation.
+ */
+struct pmem2_map *
+vm_reservation_map_find_acquire(struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len)
+{
+       struct pmem2_map map;
+       map.addr = (char *)rsv->addr + reserv_offset;
+       map.content_length = len;
+
+       struct ravl_interval_node *node;
+
+       util_rwlock_wrlock(&rsv->lock);
+       node = ravl_interval_find(rsv->itree, &map);
+
+       if (!node)
+               return NULL;
+
+       return (struct pmem2_map *)ravl_interval_data(node);
+}
+
+/*
+ * vm_reservation_release -- releases previously acquired lock
+ */
+void
+vm_reservation_release(struct pmem2_vm_reservation *rsv)
+{
+       util_rwlock_unlock(&rsv->lock);
+}
+
+/*
+ * vm_reservation_get_interval_tree -- get interval tree
+ */
+struct ravl_interval *
+vm_reservation_get_interval_tree(struct pmem2_vm_reservation *rsv)
+{
+       return rsv->itree;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/vm_reservation.h b/ceph/src/pmdk/src/libpmem2/vm_reservation.h
new file mode 100644 (file)
index 0000000..68e4273
--- /dev/null
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * vm_reservation.h -- internal definitions for virtual memory reservation
+ */
+#ifndef PMEM2_VM_RESERVATION_H
+#define PMEM2_VM_RESERVATION_H
+
+#include "ravl_interval.h"
+
+struct pmem2_vm_reservation;
+
+int vm_reservation_map_register_release(struct pmem2_vm_reservation *rsv,
+               struct pmem2_map *map);
+int vm_reservation_map_unregister_release(struct pmem2_vm_reservation *rsv,
+               struct pmem2_map *map);
+struct pmem2_map *vm_reservation_map_find(struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len);
+struct pmem2_map *vm_reservation_map_find_acquire(
+               struct pmem2_vm_reservation *rsv, size_t reserv_offset,
+               size_t len);
+void vm_reservation_release(struct pmem2_vm_reservation *rsv);
+
+#endif /* vm_reservation.h */
diff --git a/ceph/src/pmdk/src/libpmem2/vm_reservation_posix.c b/ceph/src/pmdk/src/libpmem2/vm_reservation_posix.c
new file mode 100644 (file)
index 0000000..ecbe3a9
--- /dev/null
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * vm_reservation_posix.c -- implementation of virtual memory
+ *                           reservation API (POSIX)
+ */
+
+#include <sys/mman.h>
+
+#include "alloc.h"
+#include "map.h"
+#include "out.h"
+#include "pmem2_utils.h"
+
+int vm_reservation_reserve_memory(void *addr, size_t size, void **raddr,
+               size_t *rsize);
+int vm_reservation_release_memory(void *addr, size_t size);
+
+/*
+ * vm_reservation_reserve_memory -- create a blank virual memory mapping
+ */
+int
+vm_reservation_reserve_memory(void *addr, size_t size, void **raddr,
+               size_t *rsize)
+{
+       int map_flag = 0;
+       if (addr) {
+/*
+ * glibc started exposing MAP_FIXED_NOREPLACE flag in version 4.17,
+ * but even if the flag is not supported, we can imitate its behavior
+ */
+#ifdef MAP_FIXED_NOREPLACE
+               map_flag = MAP_FIXED_NOREPLACE;
+#endif
+       }
+
+       /*
+        * Create a dummy mapping to find an unused region of given size.
+        * If the flag is supported and requested region is occupied,
+        * mmap will fail with EEXIST.
+        */
+       char *daddr = mmap(addr, size, PROT_NONE,
+                       MAP_PRIVATE | MAP_ANONYMOUS | map_flag, -1, 0);
+       if (daddr == MAP_FAILED) {
+               if (errno == EEXIST) {
+                       ERR("!mmap MAP_FIXED_NOREPLACE");
+                       return PMEM2_E_MAPPING_EXISTS;
+               }
+               ERR("!mmap MAP_ANONYMOUS");
+               return PMEM2_E_ERRNO;
+       }
+
+       /*
+        * When requested address is not specified, any returned address
+        * is acceptable. If kernel does not support flag and given addr
+        * is occupied, kernel chooses new addr randomly and returns it.
+        * We do not want that behavior, so we validate it and fail when
+        * addresses do not match.
+        */
+       if (addr && daddr != addr) {
+               munmap(daddr, size);
+               ERR("mapping exists in the given address");
+               return PMEM2_E_MAPPING_EXISTS;
+       }
+
+       *raddr = daddr;
+       *rsize = roundup(size, Pagesize);
+
+       return 0;
+}
+
+/*
+ * vm_reservation_release_memory -- releases blank virtual memory mapping
+ */
+int
+vm_reservation_release_memory(void *addr, size_t size)
+{
+       if (munmap(addr, size)) {
+               ERR("!munmap");
+               return PMEM2_E_ERRNO;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/vm_reservation_windows.c b/ceph/src/pmdk/src/libpmem2/vm_reservation_windows.c
new file mode 100644 (file)
index 0000000..6e8c2a7
--- /dev/null
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2020, Intel Corporation */
+
+/*
+ * vm_reservation_windows.c -- implementation of virtual memory
+ *                             reservation API (Windows)
+ */
+
+#include "alloc.h"
+#include "map.h"
+#include "os_thread.h"
+#include "out.h"
+#include "pmem2_utils.h"
+#include "sys_util.h"
+
+int vm_reservation_reserve_memory(void *addr, size_t size, void **raddr,
+               size_t *rsize);
+int vm_reservation_release_memory(void *addr, size_t size);
+struct pmem2_map *vm_reservation_map_find_closest_prior(
+               struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len);
+struct pmem2_map *vm_reservation_map_find_closest_later(
+               struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len);
+struct ravl_interval *vm_reservation_get_interval_tree(
+               struct pmem2_vm_reservation *rsv);
+
+/*
+ * vm_reservation_reserve_memory -- create a blank virual memory mapping
+ */
+int
+vm_reservation_reserve_memory(void *addr, size_t size, void **raddr,
+               size_t *rsize)
+{
+       void *daddr = VirtualAlloc2(GetCurrentProcess(),
+               addr,
+               size,
+               MEM_RESERVE | MEM_RESERVE_PLACEHOLDER,
+               PAGE_NOACCESS,
+               NULL,
+               0);
+
+       if (daddr == NULL) {
+               ERR("!!VirtualAlloc2");
+               DWORD ret_windows = GetLastError();
+               if (ret_windows == ERROR_INVALID_ADDRESS)
+                       return PMEM2_E_MAPPING_EXISTS;
+               else
+                       return pmem2_lasterror_to_err();
+       }
+
+       *raddr = daddr;
+       *rsize = size;
+
+       return 0;
+}
+
+/*
+ * vm_reservation_release_memory -- releases blank virtual memory mapping
+ */
+int
+vm_reservation_release_memory(void *addr, size_t size)
+{
+       int ret = VirtualFree(addr,
+               0,
+               MEM_RELEASE);
+       if (!ret) {
+               ERR("!!VirtualFree");
+               return pmem2_lasterror_to_err();
+       }
+
+       return 0;
+}
+
+/*
+ * vm_reservation_map_find_closest_prior -- find closest mapping neighbor
+ *                                          prior to the provided mapping
+ */
+struct pmem2_map *
+vm_reservation_map_find_closest_prior(struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len)
+{
+       struct pmem2_map map;
+
+       map.addr = (char *)pmem2_vm_reservation_get_address(rsv) +
+                       reserv_offset;
+       map.content_length = len;
+
+       struct ravl_interval_node *node;
+       struct ravl_interval *itree = vm_reservation_get_interval_tree(rsv);
+       node = ravl_interval_find_closest_prior(itree, &map);
+
+       if (!node)
+               return NULL;
+
+       return (struct pmem2_map *)ravl_interval_data(node);
+}
+
+/*
+ * vm_reservation_map_find_closest_later -- find closest mapping neighbor later
+ *                                          than the mapping provided
+ */
+struct pmem2_map *
+vm_reservation_map_find_closest_later(struct pmem2_vm_reservation *rsv,
+               size_t reserv_offset, size_t len)
+{
+       struct pmem2_map map;
+       map.addr = (char *)pmem2_vm_reservation_get_address(rsv) +
+                       reserv_offset;
+       map.content_length = len;
+
+       struct ravl_interval_node *node;
+       struct ravl_interval *itree = vm_reservation_get_interval_tree(rsv);
+       node = ravl_interval_find_closest_later(itree, &map);
+
+       if (!node)
+               return NULL;
+
+       return (struct pmem2_map *)ravl_interval_data(node);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/avx.h b/ceph/src/pmdk/src/libpmem2/x86_64/avx.h
new file mode 100644 (file)
index 0000000..8726d3d
--- /dev/null
@@ -0,0 +1,86 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM_AVX_H
+#define PMEM_AVX_H
+
+#include <immintrin.h>
+#include "util.h"
+
+/*
+ * avx_zeroupper -- _mm256_zeroupper wrapper
+ *
+ * _mm256_zeroupper clears upper parts of avx registers.
+ *
+ * It's needed for 2 reasons:
+ * - it improves performance of non-avx code after avx
+ * - it works around problem discovered by Valgrind
+ *
+ * In optimized builds gcc inserts VZEROUPPER automatically before
+ * calling non-avx code (or at the end of the function). But in release
+ * builds it doesn't, so if we don't do this by ourselves, then when
+ * someone memcpy'ies uninitialized data, Valgrind complains whenever
+ * someone reads those registers.
+ *
+ * One notable example is loader, which tries to detect whether it
+ * needs to save whole ymm registers by looking at their current
+ * (possibly uninitialized) value.
+ *
+ * Valgrind complains like that:
+ * Conditional jump or move depends on uninitialised value(s)
+ *    at 0x4015CC9: _dl_runtime_resolve_avx_slow
+ *                                 (in /lib/x86_64-linux-gnu/ld-2.24.so)
+ *    by 0x10B531: test_realloc_api (obj_basic_integration.c:185)
+ *    by 0x10F1EE: main (obj_basic_integration.c:594)
+ *
+ * Note: We have to be careful to not read AVX registers after this
+ * intrinsic, because of this stupid gcc bug:
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82735
+ */
+static force_inline void
+avx_zeroupper(void)
+{
+       _mm256_zeroupper();
+}
+
+static force_inline __m128i
+m256_get16b(__m256i ymm)
+{
+       return _mm256_extractf128_si256(ymm, 0);
+}
+
+#ifdef _MSC_VER
+static force_inline uint64_t
+m256_get8b(__m256i ymm)
+{
+       return (uint64_t)_mm_extract_epi64(m256_get16b(ymm), 0);
+}
+static force_inline uint32_t
+m256_get4b(__m256i ymm)
+{
+       return (uint32_t)m256_get8b(ymm);
+}
+static force_inline uint16_t
+m256_get2b(__m256i ymm)
+{
+       return (uint16_t)m256_get8b(ymm);
+}
+#else
+static force_inline uint64_t
+m256_get8b(__m256i ymm)
+{
+       return (uint64_t)_mm256_extract_epi64(ymm, 0);
+}
+static force_inline uint32_t
+m256_get4b(__m256i ymm)
+{
+       return (uint32_t)_mm256_extract_epi32(ymm, 0);
+}
+static force_inline uint16_t
+m256_get2b(__m256i ymm)
+{
+       return (uint16_t)_mm256_extract_epi16(ymm, 0);
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/cpu.c b/ceph/src/pmdk/src/libpmem2/x86_64/cpu.c
new file mode 100644 (file)
index 0000000..7c368c5
--- /dev/null
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * cpu.c -- CPU features detection
+ */
+
+/*
+ * Reference:
+ * http://www.intel.com/content/www/us/en/processors/
+ * architectures-software-developer-manuals.html
+ *
+ * https://support.amd.com/TechDocs/24594.pdf
+ */
+
+#include <string.h>
+
+#include "out.h"
+#include "cpu.h"
+
+#define EAX_IDX 0
+#define EBX_IDX 1
+#define ECX_IDX 2
+#define EDX_IDX 3
+
+#if defined(__x86_64__) || defined(__amd64__)
+
+#include <cpuid.h>
+
+static inline void
+cpuid(unsigned func, unsigned subfunc, unsigned cpuinfo[4])
+{
+       __cpuid_count(func, subfunc, cpuinfo[EAX_IDX], cpuinfo[EBX_IDX],
+                       cpuinfo[ECX_IDX], cpuinfo[EDX_IDX]);
+}
+
+#elif defined(_M_X64) || defined(_M_AMD64)
+
+#include <intrin.h>
+
+static inline void
+cpuid(unsigned func, unsigned subfunc, unsigned cpuinfo[4])
+{
+       __cpuidex(cpuinfo, func, subfunc);
+}
+
+#else
+
+#error unsupported compiler
+
+#endif
+
+#ifndef bit_CLFLUSH
+#define bit_CLFLUSH    (1 << 19)
+#endif
+
+#ifndef bit_CLFLUSHOPT
+#define bit_CLFLUSHOPT (1 << 23)
+#endif
+
+#ifndef bit_CLWB
+#define bit_CLWB       (1 << 24)
+#endif
+
+#ifndef bit_AVX
+#define bit_AVX                (1 << 28)
+#endif
+
+#ifndef bit_AVX512F
+#define bit_AVX512F    (1 << 16)
+#endif
+
+/*
+ * is_cpu_feature_present -- (internal) checks if CPU feature is supported
+ */
+static int
+is_cpu_feature_present(unsigned func, unsigned reg, unsigned bit)
+{
+       unsigned cpuinfo[4] = { 0 };
+
+       /* check CPUID level first */
+       cpuid(0x0, 0x0, cpuinfo);
+       if (cpuinfo[EAX_IDX] < func)
+               return 0;
+
+       cpuid(func, 0x0, cpuinfo);
+       return (cpuinfo[reg] & bit) != 0;
+}
+
+/*
+ * is_cpu_genuine_intel -- checks for genuine Intel CPU
+ */
+int
+is_cpu_genuine_intel(void)
+{
+       unsigned cpuinfo[4] = { 0 };
+
+       union {
+               char name[0x20];
+               unsigned cpuinfo[3];
+       } vendor;
+
+       memset(&vendor, 0, sizeof(vendor));
+
+       cpuid(0x0, 0x0, cpuinfo);
+
+       vendor.cpuinfo[0] = cpuinfo[EBX_IDX];
+       vendor.cpuinfo[1] = cpuinfo[EDX_IDX];
+       vendor.cpuinfo[2] = cpuinfo[ECX_IDX];
+
+       LOG(4, "CPU vendor: %s", vendor.name);
+       return (strncmp(vendor.name, "GenuineIntel",
+                               sizeof(vendor.name))) == 0;
+}
+
+/*
+ * is_cpu_clflush_present -- checks if CLFLUSH instruction is supported
+ */
+int
+is_cpu_clflush_present(void)
+{
+       int ret = is_cpu_feature_present(0x1, EDX_IDX, bit_CLFLUSH);
+       LOG(4, "CLFLUSH %ssupported", ret == 0 ? "not " : "");
+
+       return ret;
+}
+
+/*
+ * is_cpu_clflushopt_present -- checks if CLFLUSHOPT instruction is supported
+ */
+int
+is_cpu_clflushopt_present(void)
+{
+       int ret = is_cpu_feature_present(0x7, EBX_IDX, bit_CLFLUSHOPT);
+       LOG(4, "CLFLUSHOPT %ssupported", ret == 0 ? "not " : "");
+
+       return ret;
+}
+
+/*
+ * is_cpu_clwb_present -- checks if CLWB instruction is supported
+ */
+int
+is_cpu_clwb_present(void)
+{
+       int ret = is_cpu_feature_present(0x7, EBX_IDX, bit_CLWB);
+       LOG(4, "CLWB %ssupported", ret == 0 ? "not " : "");
+
+       return ret;
+}
+
+/*
+ * is_cpu_avx_present -- checks if AVX instructions are supported
+ */
+int
+is_cpu_avx_present(void)
+{
+       int ret = is_cpu_feature_present(0x1, ECX_IDX, bit_AVX);
+       LOG(4, "AVX %ssupported", ret == 0 ? "not " : "");
+
+       return ret;
+}
+
+/*
+ * is_cpu_avx512f_present -- checks if AVX-512f instructions are supported
+ */
+int
+is_cpu_avx512f_present(void)
+{
+       int ret = is_cpu_feature_present(0x7, EBX_IDX, bit_AVX512F);
+       LOG(4, "AVX512f %ssupported", ret == 0 ? "not " : "");
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/cpu.h b/ceph/src/pmdk/src/libpmem2/x86_64/cpu.h
new file mode 100644 (file)
index 0000000..f02df5c
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+#ifndef PMDK_CPU_H
+#define PMDK_CPU_H 1
+
+/*
+ * cpu.h -- definitions for "cpu" module
+ */
+
+int is_cpu_genuine_intel(void);
+int is_cpu_clflush_present(void);
+int is_cpu_clflushopt_present(void);
+int is_cpu_clwb_present(void);
+int is_cpu_avx_present(void);
+int is_cpu_avx512f_present(void);
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/flags.inc b/ceph/src/pmdk/src/libpmem2/x86_64/flags.inc
new file mode 100644 (file)
index 0000000..33b7d31
--- /dev/null
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+#
+# src/libpmem2/x86_64/flags.inc -- flags for libpmem2/x86_64
+#
+
+vpath %.c $(TOP)/src/libpmem2/x86_64
+vpath %.h $(TOP)/src/libpmem2/x86_64
+vpath %.c $(TOP)/src/libpmem2/x86_64/memcpy
+vpath %.c $(TOP)/src/libpmem2/x86_64/memset
+
+$(objdir)/memcpy_nt_avx512f.o: CFLAGS += -mavx512f
+$(objdir)/memset_nt_avx512f.o: CFLAGS += -mavx512f
+
+$(objdir)/memcpy_nt_avx.o: CFLAGS += -mavx
+$(objdir)/memset_nt_avx.o: CFLAGS += -mavx
+
+$(objdir)/memcpy_t_avx512f.o: CFLAGS += -mavx512f
+$(objdir)/memset_t_avx512f.o: CFLAGS += -mavx512f
+
+$(objdir)/memcpy_t_avx.o: CFLAGS += -mavx
+$(objdir)/memset_t_avx.o: CFLAGS += -mavx
+
+CFLAGS += -I$(TOP)/src/libpmem2/x86_64
+
+ifeq ($(AVX512F_AVAILABLE), y)
+CFLAGS += -DAVX512F_AVAILABLE=1
+else
+CFLAGS += -DAVX512F_AVAILABLE=0
+endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/flush.h b/ceph/src/pmdk/src/libpmem2/x86_64/flush.h
new file mode 100644 (file)
index 0000000..f25450b
--- /dev/null
@@ -0,0 +1,118 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+#ifndef X86_64_FLUSH_H
+#define X86_64_FLUSH_H
+
+#include <emmintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+#include "util.h"
+#include "valgrind_internal.h"
+
+#define FLUSH_ALIGN ((uintptr_t)64)
+
+static force_inline void
+pmem_clflush(const void *addr)
+{
+       _mm_clflush(addr);
+}
+
+#ifdef _MSC_VER
+static force_inline void
+pmem_clflushopt(const void *addr)
+{
+       _mm_clflushopt(addr);
+}
+
+static force_inline void
+pmem_clwb(const void *addr)
+{
+       _mm_clwb(addr);
+}
+#else
+/*
+ * The x86 memory instructions are new enough that the compiler
+ * intrinsic functions are not always available.  The intrinsic
+ * functions are defined here in terms of asm statements for now.
+ */
+static force_inline void
+pmem_clflushopt(const void *addr)
+{
+       asm volatile(".byte 0x66; clflush %0" : "+m" \
+               (*(volatile char *)(addr)));
+}
+static force_inline void
+pmem_clwb(const void *addr)
+{
+       asm volatile(".byte 0x66; xsaveopt %0" : "+m" \
+               (*(volatile char *)(addr)));
+}
+#endif /* _MSC_VER */
+
+typedef void flush_fn(const void *, size_t);
+
+/*
+ * flush_clflush_nolog -- flush the CPU cache, using clflush
+ */
+static force_inline void
+flush_clflush_nolog(const void *addr, size_t len)
+{
+       uintptr_t uptr;
+
+       /*
+        * Loop through cache-line-size (typically 64B) aligned chunks
+        * covering the given range.
+        */
+       for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
+               uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN)
+               _mm_clflush((char *)uptr);
+}
+
+/*
+ * flush_clflushopt_nolog -- flush the CPU cache, using clflushopt
+ */
+static force_inline void
+flush_clflushopt_nolog(const void *addr, size_t len)
+{
+       uintptr_t uptr;
+
+       /*
+        * Loop through cache-line-size (typically 64B) aligned chunks
+        * covering the given range.
+        */
+       for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
+               uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
+               pmem_clflushopt((char *)uptr);
+       }
+}
+
+/*
+ * flush_clwb_nolog -- flush the CPU cache, using clwb
+ */
+static force_inline void
+flush_clwb_nolog(const void *addr, size_t len)
+{
+       uintptr_t uptr;
+
+       /*
+        * Loop through cache-line-size (typically 64B) aligned chunks
+        * covering the given range.
+        */
+       for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
+               uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
+               pmem_clwb((char *)uptr);
+       }
+}
+
+/*
+ * flush64b_empty -- (internal) do not flush the CPU cache
+ */
+static force_inline void
+flush64b_empty(const void *addr)
+{
+       /* NOP, but tell pmemcheck about it */
+       VALGRIND_DO_FLUSH(addr, 64);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/init.c b/ceph/src/pmdk/src/libpmem2/x86_64/init.c
new file mode 100644 (file)
index 0000000..d0e383b
--- /dev/null
@@ -0,0 +1,528 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+#include <string.h>
+#include <xmmintrin.h>
+
+#include "auto_flush.h"
+#include "cpu.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "os.h"
+#include "out.h"
+#include "pmem2_arch.h"
+#include "valgrind_internal.h"
+
+#define MOVNT_THRESHOLD        256
+
+size_t Movnt_threshold = MOVNT_THRESHOLD;
+
+/*
+ * memory_barrier -- (internal) issue the fence instruction
+ */
+static void
+memory_barrier(void)
+{
+       LOG(15, NULL);
+       _mm_sfence();   /* ensure CLWB or CLFLUSHOPT completes */
+}
+
+/*
+ * flush_clflush -- (internal) flush the CPU cache, using clflush
+ */
+static void
+flush_clflush(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       flush_clflush_nolog(addr, len);
+}
+
+/*
+ * flush_clflushopt -- (internal) flush the CPU cache, using clflushopt
+ */
+static void
+flush_clflushopt(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       flush_clflushopt_nolog(addr, len);
+}
+
+/*
+ * flush_clwb -- (internal) flush the CPU cache, using clwb
+ */
+static void
+flush_clwb(const void *addr, size_t len)
+{
+       LOG(15, "addr %p len %zu", addr, len);
+
+       flush_clwb_nolog(addr, len);
+}
+
+#if SSE2_AVAILABLE || AVX_AVAILABLE || AVX512F_AVAILABLE
+#define PMEM2_F_MEM_MOVNT (PMEM2_F_MEM_WC | PMEM2_F_MEM_NONTEMPORAL)
+#define PMEM2_F_MEM_MOV   (PMEM2_F_MEM_WB | PMEM2_F_MEM_TEMPORAL)
+
+#define MEMCPY_TEMPLATE(isa, flush, perfbarrier) \
+static void *\
+memmove_nodrain_##isa##_##flush##perfbarrier(void *dest, const void *src, \
+               size_t len, unsigned flags, flush_func flushf)\
+{\
+       if (len == 0 || src == dest)\
+               return dest;\
+\
+       if (flags & PMEM2_F_MEM_NOFLUSH) \
+               memmove_mov_##isa##_noflush(dest, src, len); \
+       else if (flags & PMEM2_F_MEM_MOVNT)\
+               memmove_movnt_##isa ##_##flush##perfbarrier(dest, src, len);\
+       else if (flags & PMEM2_F_MEM_MOV)\
+               memmove_mov_##isa##_##flush(dest, src, len);\
+       else if (len < Movnt_threshold)\
+               memmove_mov_##isa##_##flush(dest, src, len);\
+       else\
+               memmove_movnt_##isa##_##flush##perfbarrier(dest, src, len);\
+\
+       return dest;\
+}
+
+#define MEMCPY_TEMPLATE_EADR(isa, perfbarrier) \
+static void *\
+memmove_nodrain_##isa##_eadr##perfbarrier(void *dest, const void *src, \
+               size_t len, unsigned flags, flush_func flushf)\
+{\
+       if (len == 0 || src == dest)\
+               return dest;\
+\
+       if (flags & PMEM2_F_MEM_NOFLUSH)\
+               memmove_mov_##isa##_noflush(dest, src, len);\
+       else if (flags & PMEM2_F_MEM_NONTEMPORAL)\
+               memmove_movnt_##isa##_empty##perfbarrier(dest, src, len);\
+       else\
+               memmove_mov_##isa##_empty(dest, src, len);\
+\
+       return dest;\
+}
+
+#define MEMSET_TEMPLATE(isa, flush, perfbarrier)\
+static void *\
+memset_nodrain_##isa##_##flush##perfbarrier(void *dest, int c, size_t len, \
+               unsigned flags, flush_func flushf)\
+{\
+       if (len == 0)\
+               return dest;\
+\
+       if (flags & PMEM2_F_MEM_NOFLUSH) \
+               memset_mov_##isa##_noflush(dest, c, len); \
+       else if (flags & PMEM2_F_MEM_MOVNT)\
+               memset_movnt_##isa##_##flush##perfbarrier(dest, c, len);\
+       else if (flags & PMEM2_F_MEM_MOV)\
+               memset_mov_##isa##_##flush(dest, c, len);\
+       else if (len < Movnt_threshold)\
+               memset_mov_##isa##_##flush(dest, c, len);\
+       else\
+               memset_movnt_##isa##_##flush##perfbarrier(dest, c, len);\
+\
+       return dest;\
+}
+
+#define MEMSET_TEMPLATE_EADR(isa, perfbarrier) \
+static void *\
+memset_nodrain_##isa##_eadr##perfbarrier(void *dest, int c, size_t len, \
+               unsigned flags, flush_func flushf)\
+{\
+       if (len == 0)\
+               return dest;\
+\
+       if (flags & PMEM2_F_MEM_NOFLUSH)\
+               memset_mov_##isa##_noflush(dest, c, len);\
+       else if (flags & PMEM2_F_MEM_NONTEMPORAL)\
+               memset_movnt_##isa##_empty##perfbarrier(dest, c, len);\
+       else\
+               memset_mov_##isa##_empty(dest, c, len);\
+\
+       return dest;\
+}
+#endif
+
+#if SSE2_AVAILABLE
+MEMCPY_TEMPLATE(sse2, clflush, _nobarrier)
+MEMCPY_TEMPLATE(sse2, clflushopt, _nobarrier)
+MEMCPY_TEMPLATE(sse2, clwb, _nobarrier)
+MEMCPY_TEMPLATE_EADR(sse2, _nobarrier)
+
+MEMSET_TEMPLATE(sse2, clflush, _nobarrier)
+MEMSET_TEMPLATE(sse2, clflushopt, _nobarrier)
+MEMSET_TEMPLATE(sse2, clwb, _nobarrier)
+MEMSET_TEMPLATE_EADR(sse2, _nobarrier)
+
+MEMCPY_TEMPLATE(sse2, clflush, _wcbarrier)
+MEMCPY_TEMPLATE(sse2, clflushopt, _wcbarrier)
+MEMCPY_TEMPLATE(sse2, clwb, _wcbarrier)
+MEMCPY_TEMPLATE_EADR(sse2, _wcbarrier)
+
+MEMSET_TEMPLATE(sse2, clflush, _wcbarrier)
+MEMSET_TEMPLATE(sse2, clflushopt, _wcbarrier)
+MEMSET_TEMPLATE(sse2, clwb, _wcbarrier)
+MEMSET_TEMPLATE_EADR(sse2, _wcbarrier)
+#endif
+
+#if AVX_AVAILABLE
+MEMCPY_TEMPLATE(avx, clflush, _nobarrier)
+MEMCPY_TEMPLATE(avx, clflushopt, _nobarrier)
+MEMCPY_TEMPLATE(avx, clwb, _nobarrier)
+MEMCPY_TEMPLATE_EADR(avx, _nobarrier)
+
+MEMSET_TEMPLATE(avx, clflush, _nobarrier)
+MEMSET_TEMPLATE(avx, clflushopt, _nobarrier)
+MEMSET_TEMPLATE(avx, clwb, _nobarrier)
+MEMSET_TEMPLATE_EADR(avx, _nobarrier)
+
+MEMCPY_TEMPLATE(avx, clflush, _wcbarrier)
+MEMCPY_TEMPLATE(avx, clflushopt, _wcbarrier)
+MEMCPY_TEMPLATE(avx, clwb, _wcbarrier)
+MEMCPY_TEMPLATE_EADR(avx, _wcbarrier)
+
+MEMSET_TEMPLATE(avx, clflush, _wcbarrier)
+MEMSET_TEMPLATE(avx, clflushopt, _wcbarrier)
+MEMSET_TEMPLATE(avx, clwb, _wcbarrier)
+MEMSET_TEMPLATE_EADR(avx, _wcbarrier)
+#endif
+
+#if AVX512F_AVAILABLE
+MEMCPY_TEMPLATE(avx512f, clflush, /* cstyle wa */)
+MEMCPY_TEMPLATE(avx512f, clflushopt, /* */)
+MEMCPY_TEMPLATE(avx512f, clwb, /* */)
+MEMCPY_TEMPLATE_EADR(avx512f, /* */)
+
+MEMSET_TEMPLATE(avx512f, clflush, /* */)
+MEMSET_TEMPLATE(avx512f, clflushopt, /* */)
+MEMSET_TEMPLATE(avx512f, clwb, /* */)
+MEMSET_TEMPLATE_EADR(avx512f, /* */)
+#endif
+
+enum memcpy_impl {
+       MEMCPY_INVALID,
+       MEMCPY_SSE2,
+       MEMCPY_AVX,
+       MEMCPY_AVX512F
+};
+
+/*
+ * use_sse2_memcpy_memset -- (internal) SSE2 detected, use it if possible
+ */
+static void
+use_sse2_memcpy_memset(struct pmem2_arch_info *info, enum memcpy_impl *impl,
+               int wc_workaround)
+{
+#if SSE2_AVAILABLE
+       *impl = MEMCPY_SSE2;
+       if (wc_workaround) {
+               info->memmove_nodrain_eadr =
+                               memmove_nodrain_sse2_eadr_wcbarrier;
+               if (info->flush == flush_clflush)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clflush_wcbarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clflushopt_wcbarrier;
+               else if (info->flush == flush_clwb)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clwb_wcbarrier;
+               else
+                       ASSERT(0);
+
+               info->memset_nodrain_eadr = memset_nodrain_sse2_eadr_wcbarrier;
+               if (info->flush == flush_clflush)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clflush_wcbarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clflushopt_wcbarrier;
+               else if (info->flush == flush_clwb)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clwb_wcbarrier;
+               else
+                       ASSERT(0);
+       } else {
+               info->memmove_nodrain_eadr =
+                               memmove_nodrain_sse2_eadr_nobarrier;
+               if (info->flush == flush_clflush)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clflush_nobarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clflushopt_nobarrier;
+               else if (info->flush == flush_clwb)
+                       info->memmove_nodrain =
+                               memmove_nodrain_sse2_clwb_nobarrier;
+               else
+                       ASSERT(0);
+
+               info->memset_nodrain_eadr =
+                               memset_nodrain_sse2_eadr_nobarrier;
+               if (info->flush == flush_clflush)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clflush_nobarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clflushopt_nobarrier;
+               else if (info->flush == flush_clwb)
+                       info->memset_nodrain =
+                               memset_nodrain_sse2_clwb_nobarrier;
+               else
+                       ASSERT(0);
+       }
+
+#else
+       LOG(3, "sse2 disabled at build time");
+#endif
+
+}
+
+/*
+ * use_avx_memcpy_memset -- (internal) AVX detected, use it if possible
+ */
+static void
+use_avx_memcpy_memset(struct pmem2_arch_info *info, enum memcpy_impl *impl,
+               int wc_workaround)
+{
+#if AVX_AVAILABLE
+       LOG(3, "avx supported");
+
+       char *e = os_getenv("PMEM_AVX");
+       if (e != NULL && strcmp(e, "0") == 0) {
+               LOG(3, "PMEM_AVX set to 0");
+               return;
+       }
+
+       LOG(3, "PMEM_AVX enabled");
+       *impl = MEMCPY_AVX;
+
+       if (wc_workaround) {
+               info->memmove_nodrain_eadr =
+                               memmove_nodrain_avx_eadr_wcbarrier;
+               if (info->flush == flush_clflush)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clflush_wcbarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clflushopt_wcbarrier;
+               else if (info->flush == flush_clwb)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clwb_wcbarrier;
+               else
+                       ASSERT(0);
+
+               info->memset_nodrain_eadr =
+                               memset_nodrain_avx_eadr_wcbarrier;
+               if (info->flush == flush_clflush)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clflush_wcbarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clflushopt_wcbarrier;
+               else if (info->flush == flush_clwb)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clwb_wcbarrier;
+               else
+                       ASSERT(0);
+       } else {
+               info->memmove_nodrain_eadr =
+                               memmove_nodrain_avx_eadr_nobarrier;
+               if (info->flush == flush_clflush)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clflush_nobarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clflushopt_nobarrier;
+               else if (info->flush == flush_clwb)
+                       info->memmove_nodrain =
+                               memmove_nodrain_avx_clwb_nobarrier;
+               else
+                       ASSERT(0);
+
+               info->memset_nodrain_eadr =
+                               memset_nodrain_avx_eadr_nobarrier;
+               if (info->flush == flush_clflush)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clflush_nobarrier;
+               else if (info->flush == flush_clflushopt)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clflushopt_nobarrier;
+               else if (info->flush == flush_clwb)
+                       info->memset_nodrain =
+                               memset_nodrain_avx_clwb_nobarrier;
+               else
+                       ASSERT(0);
+       }
+#else
+       LOG(3, "avx supported, but disabled at build time");
+#endif
+}
+
+/*
+ * use_avx512f_memcpy_memset -- (internal) AVX512F detected, use it if possible
+ */
+static void
+use_avx512f_memcpy_memset(struct pmem2_arch_info *info,
+               enum memcpy_impl *impl)
+{
+#if AVX512F_AVAILABLE
+       LOG(3, "avx512f supported");
+
+       char *e = os_getenv("PMEM_AVX512F");
+       if (e != NULL && strcmp(e, "0") == 0) {
+               LOG(3, "PMEM_AVX512F set to 0");
+               return;
+       }
+
+       LOG(3, "PMEM_AVX512F enabled");
+       *impl = MEMCPY_AVX512F;
+
+       info->memmove_nodrain_eadr = memmove_nodrain_avx512f_eadr;
+       if (info->flush == flush_clflush)
+               info->memmove_nodrain = memmove_nodrain_avx512f_clflush;
+       else if (info->flush == flush_clflushopt)
+               info->memmove_nodrain = memmove_nodrain_avx512f_clflushopt;
+       else if (info->flush == flush_clwb)
+               info->memmove_nodrain = memmove_nodrain_avx512f_clwb;
+       else
+               ASSERT(0);
+
+       info->memset_nodrain_eadr = memset_nodrain_avx512f_eadr;
+       if (info->flush == flush_clflush)
+               info->memset_nodrain = memset_nodrain_avx512f_clflush;
+       else if (info->flush == flush_clflushopt)
+               info->memset_nodrain = memset_nodrain_avx512f_clflushopt;
+       else if (info->flush == flush_clwb)
+               info->memset_nodrain = memset_nodrain_avx512f_clwb;
+       else
+               ASSERT(0);
+#else
+       LOG(3, "avx512f supported, but disabled at build time");
+#endif
+}
+
+/*
+ * pmem_get_cpuinfo -- configure libpmem based on CPUID
+ */
+static void
+pmem_cpuinfo_to_funcs(struct pmem2_arch_info *info, enum memcpy_impl *impl)
+{
+       LOG(3, NULL);
+
+       if (is_cpu_clflush_present()) {
+               LOG(3, "clflush supported");
+
+               info->flush = flush_clflush;
+               info->flush_has_builtin_fence = 1;
+               info->fence = memory_barrier;
+       }
+
+       if (is_cpu_clflushopt_present()) {
+               LOG(3, "clflushopt supported");
+
+               char *e = os_getenv("PMEM_NO_CLFLUSHOPT");
+               if (e && strcmp(e, "1") == 0) {
+                       LOG(3, "PMEM_NO_CLFLUSHOPT forced no clflushopt");
+               } else {
+                       info->flush = flush_clflushopt;
+                       info->flush_has_builtin_fence = 0;
+                       info->fence = memory_barrier;
+               }
+       }
+
+       if (is_cpu_clwb_present()) {
+               LOG(3, "clwb supported");
+
+               char *e = os_getenv("PMEM_NO_CLWB");
+               if (e && strcmp(e, "1") == 0) {
+                       LOG(3, "PMEM_NO_CLWB forced no clwb");
+               } else {
+                       info->flush = flush_clwb;
+                       info->flush_has_builtin_fence = 0;
+                       info->fence = memory_barrier;
+               }
+       }
+
+       /*
+        * XXX Disable this work around for Intel CPUs with optimized
+        * WC eviction.
+        */
+       int wc_workaround = is_cpu_genuine_intel();
+
+       char *ptr = os_getenv("PMEM_WC_WORKAROUND");
+       if (ptr) {
+               if (strcmp(ptr, "1") == 0) {
+                       LOG(3, "WC workaround forced to 1");
+                       wc_workaround = 1;
+               } else if (strcmp(ptr, "0") == 0) {
+                       LOG(3, "WC workaround forced to 0");
+                       wc_workaround = 0;
+               } else {
+                       LOG(3, "incorrect value of PMEM_WC_WORKAROUND (%s)",
+                               ptr);
+               }
+       }
+       LOG(3, "WC workaround = %d", wc_workaround);
+
+       ptr = os_getenv("PMEM_NO_MOVNT");
+       if (ptr && strcmp(ptr, "1") == 0) {
+               LOG(3, "PMEM_NO_MOVNT forced no movnt");
+       } else {
+               use_sse2_memcpy_memset(info, impl, wc_workaround);
+
+               if (is_cpu_avx_present())
+                       use_avx_memcpy_memset(info, impl, wc_workaround);
+
+               if (is_cpu_avx512f_present())
+                       use_avx512f_memcpy_memset(info, impl);
+       }
+}
+
+/*
+ * pmem2_arch_init -- initialize architecture-specific list of pmem operations
+ */
+void
+pmem2_arch_init(struct pmem2_arch_info *info)
+{
+       LOG(3, NULL);
+       enum memcpy_impl impl = MEMCPY_INVALID;
+
+       pmem_cpuinfo_to_funcs(info, &impl);
+
+       /*
+        * For testing, allow overriding the default threshold
+        * for using non-temporal stores in pmem_memcpy_*(), pmem_memmove_*()
+        * and pmem_memset_*().
+        * It has no effect if movnt is not supported or disabled.
+        */
+       const char *ptr = os_getenv("PMEM_MOVNT_THRESHOLD");
+       if (ptr) {
+               long long val = atoll(ptr);
+
+               if (val < 0) {
+                       LOG(3, "Invalid PMEM_MOVNT_THRESHOLD");
+               } else {
+                       LOG(3, "PMEM_MOVNT_THRESHOLD set to %zu", (size_t)val);
+                       Movnt_threshold = (size_t)val;
+               }
+       }
+
+       if (info->flush == flush_clwb)
+               LOG(3, "using clwb");
+       else if (info->flush == flush_clflushopt)
+               LOG(3, "using clflushopt");
+       else if (info->flush == flush_clflush)
+               LOG(3, "using clflush");
+       else
+               FATAL("invalid deep flush function address");
+
+       if (impl == MEMCPY_AVX512F)
+               LOG(3, "using movnt AVX512F");
+       else if (impl == MEMCPY_AVX)
+               LOG(3, "using movnt AVX");
+       else if (impl == MEMCPY_SSE2)
+               LOG(3, "using movnt SSE2");
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx.h b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx.h
new file mode 100644 (file)
index 0000000..9b95266
--- /dev/null
@@ -0,0 +1,100 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMCPY_AVX_H
+#define PMEM2_MEMCPY_AVX_H
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "out.h"
+
+static force_inline void
+memmove_small_avx_noflush(char *dest, const char *src, size_t len)
+{
+       ASSERT(len <= 64);
+
+       if (len <= 8)
+               goto le8;
+       if (len <= 32)
+               goto le32;
+
+       /* 33..64 */
+       __m256i ymm0 = _mm256_loadu_si256((__m256i *)src);
+       __m256i ymm1 = _mm256_loadu_si256((__m256i *)(src + len - 32));
+
+       _mm256_storeu_si256((__m256i *)dest, ymm0);
+       _mm256_storeu_si256((__m256i *)(dest + len - 32), ymm1);
+       return;
+
+le32:
+       if (len > 16) {
+               /* 17..32 */
+               __m128i xmm0 = _mm_loadu_si128((__m128i *)src);
+               __m128i xmm1 = _mm_loadu_si128((__m128i *)(src + len - 16));
+
+               _mm_storeu_si128((__m128i *)dest, xmm0);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm1);
+               return;
+       }
+
+       /* 9..16 */
+       ua_uint64_t d80 = *(ua_uint64_t *)src;
+       ua_uint64_t d81 = *(ua_uint64_t *)(src + len - 8);
+
+       *(ua_uint64_t *)dest = d80;
+       *(ua_uint64_t *)(dest + len - 8) = d81;
+       return;
+
+le8:
+       if (len <= 2)
+               goto le2;
+
+       if (len > 4) {
+               /* 5..8 */
+               ua_uint32_t d40 = *(ua_uint32_t *)src;
+               ua_uint32_t d41 = *(ua_uint32_t *)(src + len - 4);
+
+               *(ua_uint32_t *)dest = d40;
+               *(ua_uint32_t *)(dest + len - 4) = d41;
+               return;
+       }
+
+       /* 3..4 */
+       ua_uint16_t d20 = *(ua_uint16_t *)src;
+       ua_uint16_t d21 = *(ua_uint16_t *)(src + len - 2);
+
+       *(ua_uint16_t *)dest = d20;
+       *(ua_uint16_t *)(dest + len - 2) = d21;
+       return;
+
+le2:
+       if (len == 2) {
+               *(ua_uint16_t *)dest = *(ua_uint16_t *)src;
+               return;
+       }
+
+       *(uint8_t *)dest = *(uint8_t *)src;
+}
+
+static force_inline void
+memmove_small_avx(char *dest, const char *src, size_t len, flush_fn flush)
+{
+       /*
+        * pmemcheck complains about "overwritten stores before they were made
+        * persistent" for overlapping stores (last instruction in each code
+        * path) in the optimized version.
+        * libc's memcpy also does that, so we can't use it here.
+        */
+       if (On_pmemcheck) {
+               memmove_nodrain_generic(dest, src, len, PMEM2_F_MEM_NOFLUSH,
+                               NULL);
+       } else {
+               memmove_small_avx_noflush(dest, src, len);
+       }
+
+       flush(dest, len);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx512f.h b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_avx512f.h
new file mode 100644 (file)
index 0000000..15701e1
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMCPY_AVX512F_H
+#define PMEM2_MEMCPY_AVX512F_H
+
+#include <stddef.h>
+
+#include "memcpy_avx.h"
+
+static force_inline void
+memmove_small_avx512f(char *dest, const char *src, size_t len, flush_fn flush)
+{
+       /* We can't do better than AVX here. */
+       memmove_small_avx(dest, src, len, flush);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx.c
new file mode 100644 (file)
index 0000000..ff007fb
--- /dev/null
@@ -0,0 +1,443 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_avx.h"
+#include "valgrind_internal.h"
+
+static force_inline __m256i
+mm256_loadu_si256(const char *src, unsigned idx)
+{
+       return _mm256_loadu_si256((const __m256i *)src + idx);
+}
+
+static force_inline void
+mm256_stream_si256(char *dest, unsigned idx, __m256i src)
+{
+       _mm256_stream_si256((__m256i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memmove_movnt8x64b(char *dest, const char *src)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+       __m256i ymm4 = mm256_loadu_si256(src, 4);
+       __m256i ymm5 = mm256_loadu_si256(src, 5);
+       __m256i ymm6 = mm256_loadu_si256(src, 6);
+       __m256i ymm7 = mm256_loadu_si256(src, 7);
+       __m256i ymm8 = mm256_loadu_si256(src, 8);
+       __m256i ymm9 = mm256_loadu_si256(src, 9);
+       __m256i ymm10 = mm256_loadu_si256(src, 10);
+       __m256i ymm11 = mm256_loadu_si256(src, 11);
+       __m256i ymm12 = mm256_loadu_si256(src, 12);
+       __m256i ymm13 = mm256_loadu_si256(src, 13);
+       __m256i ymm14 = mm256_loadu_si256(src, 14);
+       __m256i ymm15 = mm256_loadu_si256(src, 15);
+
+       mm256_stream_si256(dest, 0, ymm0);
+       mm256_stream_si256(dest, 1, ymm1);
+       mm256_stream_si256(dest, 2, ymm2);
+       mm256_stream_si256(dest, 3, ymm3);
+       mm256_stream_si256(dest, 4, ymm4);
+       mm256_stream_si256(dest, 5, ymm5);
+       mm256_stream_si256(dest, 6, ymm6);
+       mm256_stream_si256(dest, 7, ymm7);
+       mm256_stream_si256(dest, 8, ymm8);
+       mm256_stream_si256(dest, 9, ymm9);
+       mm256_stream_si256(dest, 10, ymm10);
+       mm256_stream_si256(dest, 11, ymm11);
+       mm256_stream_si256(dest, 12, ymm12);
+       mm256_stream_si256(dest, 13, ymm13);
+       mm256_stream_si256(dest, 14, ymm14);
+       mm256_stream_si256(dest, 15, ymm15);
+}
+
+static force_inline void
+memmove_movnt4x64b(char *dest, const char *src)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+       __m256i ymm4 = mm256_loadu_si256(src, 4);
+       __m256i ymm5 = mm256_loadu_si256(src, 5);
+       __m256i ymm6 = mm256_loadu_si256(src, 6);
+       __m256i ymm7 = mm256_loadu_si256(src, 7);
+
+       mm256_stream_si256(dest, 0, ymm0);
+       mm256_stream_si256(dest, 1, ymm1);
+       mm256_stream_si256(dest, 2, ymm2);
+       mm256_stream_si256(dest, 3, ymm3);
+       mm256_stream_si256(dest, 4, ymm4);
+       mm256_stream_si256(dest, 5, ymm5);
+       mm256_stream_si256(dest, 6, ymm6);
+       mm256_stream_si256(dest, 7, ymm7);
+}
+
+static force_inline void
+memmove_movnt2x64b(char *dest, const char *src)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+
+       mm256_stream_si256(dest, 0, ymm0);
+       mm256_stream_si256(dest, 1, ymm1);
+       mm256_stream_si256(dest, 2, ymm2);
+       mm256_stream_si256(dest, 3, ymm3);
+}
+
+static force_inline void
+memmove_movnt1x64b(char *dest, const char *src)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+
+       mm256_stream_si256(dest, 0, ymm0);
+       mm256_stream_si256(dest, 1, ymm1);
+}
+
+static force_inline void
+memmove_movnt1x32b(char *dest, const char *src)
+{
+       __m256i ymm0 = _mm256_loadu_si256((__m256i *)src);
+
+       mm256_stream_si256(dest, 0, ymm0);
+}
+
+static force_inline void
+memmove_movnt1x16b(char *dest, const char *src)
+{
+       __m128i xmm0 = _mm_loadu_si128((__m128i *)src);
+
+       _mm_stream_si128((__m128i *)dest, xmm0);
+}
+
+static force_inline void
+memmove_movnt1x8b(char *dest, const char *src)
+{
+       _mm_stream_si64((long long *)dest, *(long long *)src);
+}
+
+static force_inline void
+memmove_movnt1x4b(char *dest, const char *src)
+{
+       _mm_stream_si32((int *)dest, *(int *)src);
+}
+
+static force_inline void
+memmove_movnt_avx_fw(char *dest, const char *src, size_t len, flush_fn flush,
+               perf_barrier_fn perf_barrier)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_avx(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       const char *srcend = src + len;
+       prefetch_ini_fw(src, len);
+
+       while (len >= PERF_BARRIER_SIZE) {
+               prefetch_next_fw(src, srcend);
+
+               memmove_movnt8x64b(dest, src);
+               dest += 8 * 64;
+               src += 8 * 64;
+               len -= 8 * 64;
+
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (8 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       if (len >= 8 * 64) {
+               memmove_movnt8x64b(dest, src);
+               dest += 8 * 64;
+               src += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_movnt2x64b(dest, src);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_movnt1x64b(dest, src);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memmove_movnt1x32b(dest, src);
+               else if (len == 16)
+                       memmove_movnt1x16b(dest, src);
+               else if (len == 8)
+                       memmove_movnt1x8b(dest, src);
+               else if (len == 4)
+                       memmove_movnt1x4b(dest, src);
+               else
+                       goto nonnt;
+
+               goto end;
+       }
+
+nonnt:
+       memmove_small_avx(dest, src, len, flush);
+end:
+       avx_zeroupper();
+}
+
+static force_inline void
+memmove_movnt_avx_bw(char *dest, const char *src, size_t len, flush_fn flush,
+               perf_barrier_fn perf_barrier)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+
+               memmove_small_avx(dest, src, cnt, flush);
+       }
+
+       const char *srcbegin = src - len;
+       prefetch_ini_bw(src, len);
+
+       while (len >= PERF_BARRIER_SIZE) {
+               prefetch_next_bw(src, srcbegin);
+
+               dest -= 8 * 64;
+               src -= 8 * 64;
+               len -= 8 * 64;
+               memmove_movnt8x64b(dest, src);
+
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (8 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       if (len >= 8 * 64) {
+               dest -= 8 * 64;
+               src -= 8 * 64;
+               len -= 8 * 64;
+               memmove_movnt8x64b(dest, src);
+       }
+
+       if (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_movnt2x64b(dest, src);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+               memmove_movnt1x64b(dest, src);
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32) {
+                       dest -= 32;
+                       src -= 32;
+                       memmove_movnt1x32b(dest, src);
+               } else if (len == 16) {
+                       dest -= 16;
+                       src -= 16;
+                       memmove_movnt1x16b(dest, src);
+               } else if (len == 8) {
+                       dest -= 8;
+                       src -= 8;
+                       memmove_movnt1x8b(dest, src);
+               } else if (len == 4) {
+                       dest -= 4;
+                       src -= 4;
+                       memmove_movnt1x4b(dest, src);
+               } else {
+                       goto nonnt;
+               }
+
+               goto end;
+       }
+
+nonnt:
+       dest -= len;
+       src -= len;
+       memmove_small_avx(dest, src, len, flush);
+end:
+       avx_zeroupper();
+}
+
+static force_inline void
+memmove_movnt_avx(char *dest, const char *src, size_t len, flush_fn flush,
+               barrier_fn barrier, perf_barrier_fn perf_barrier)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_movnt_avx_fw(dest, src, len, flush, perf_barrier);
+       else
+               memmove_movnt_avx_bw(dest, src, len, flush, perf_barrier);
+
+       barrier();
+
+       VALGRIND_DO_FLUSH(dest, len);
+}
+
+/* variants without perf_barrier */
+
+void
+memmove_movnt_avx_noflush_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, noflush, barrier_after_ntstores,
+                       no_barrier);
+}
+
+void
+memmove_movnt_avx_empty_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_empty_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+void
+memmove_movnt_avx_clflush_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clflush_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memmove_movnt_avx_clflushopt_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+void
+memmove_movnt_avx_clwb_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+/* variants with perf_barrier */
+
+void
+memmove_movnt_avx_noflush_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, noflush, barrier_after_ntstores,
+                       wc_barrier);
+}
+
+void
+memmove_movnt_avx_empty_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_empty_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+void
+memmove_movnt_avx_clflush_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clflush_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memmove_movnt_avx_clflushopt_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
+
+void
+memmove_movnt_avx_clwb_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx(dest, src, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx512f.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_avx512f.c
new file mode 100644 (file)
index 0000000..fb19504
--- /dev/null
@@ -0,0 +1,459 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_avx512f.h"
+#include "valgrind_internal.h"
+
+static force_inline __m512i
+mm512_loadu_si512(const char *src, unsigned idx)
+{
+       return _mm512_loadu_si512((const __m512i *)src + idx);
+}
+
+static force_inline void
+mm512_stream_si512(char *dest, unsigned idx, __m512i src)
+{
+       _mm512_stream_si512((__m512i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memmove_movnt32x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+       __m512i zmm8 = mm512_loadu_si512(src, 8);
+       __m512i zmm9 = mm512_loadu_si512(src, 9);
+       __m512i zmm10 = mm512_loadu_si512(src, 10);
+       __m512i zmm11 = mm512_loadu_si512(src, 11);
+       __m512i zmm12 = mm512_loadu_si512(src, 12);
+       __m512i zmm13 = mm512_loadu_si512(src, 13);
+       __m512i zmm14 = mm512_loadu_si512(src, 14);
+       __m512i zmm15 = mm512_loadu_si512(src, 15);
+       __m512i zmm16 = mm512_loadu_si512(src, 16);
+       __m512i zmm17 = mm512_loadu_si512(src, 17);
+       __m512i zmm18 = mm512_loadu_si512(src, 18);
+       __m512i zmm19 = mm512_loadu_si512(src, 19);
+       __m512i zmm20 = mm512_loadu_si512(src, 20);
+       __m512i zmm21 = mm512_loadu_si512(src, 21);
+       __m512i zmm22 = mm512_loadu_si512(src, 22);
+       __m512i zmm23 = mm512_loadu_si512(src, 23);
+       __m512i zmm24 = mm512_loadu_si512(src, 24);
+       __m512i zmm25 = mm512_loadu_si512(src, 25);
+       __m512i zmm26 = mm512_loadu_si512(src, 26);
+       __m512i zmm27 = mm512_loadu_si512(src, 27);
+       __m512i zmm28 = mm512_loadu_si512(src, 28);
+       __m512i zmm29 = mm512_loadu_si512(src, 29);
+       __m512i zmm30 = mm512_loadu_si512(src, 30);
+       __m512i zmm31 = mm512_loadu_si512(src, 31);
+
+       mm512_stream_si512(dest, 0, zmm0);
+       mm512_stream_si512(dest, 1, zmm1);
+       mm512_stream_si512(dest, 2, zmm2);
+       mm512_stream_si512(dest, 3, zmm3);
+       mm512_stream_si512(dest, 4, zmm4);
+       mm512_stream_si512(dest, 5, zmm5);
+       mm512_stream_si512(dest, 6, zmm6);
+       mm512_stream_si512(dest, 7, zmm7);
+       mm512_stream_si512(dest, 8, zmm8);
+       mm512_stream_si512(dest, 9, zmm9);
+       mm512_stream_si512(dest, 10, zmm10);
+       mm512_stream_si512(dest, 11, zmm11);
+       mm512_stream_si512(dest, 12, zmm12);
+       mm512_stream_si512(dest, 13, zmm13);
+       mm512_stream_si512(dest, 14, zmm14);
+       mm512_stream_si512(dest, 15, zmm15);
+       mm512_stream_si512(dest, 16, zmm16);
+       mm512_stream_si512(dest, 17, zmm17);
+       mm512_stream_si512(dest, 18, zmm18);
+       mm512_stream_si512(dest, 19, zmm19);
+       mm512_stream_si512(dest, 20, zmm20);
+       mm512_stream_si512(dest, 21, zmm21);
+       mm512_stream_si512(dest, 22, zmm22);
+       mm512_stream_si512(dest, 23, zmm23);
+       mm512_stream_si512(dest, 24, zmm24);
+       mm512_stream_si512(dest, 25, zmm25);
+       mm512_stream_si512(dest, 26, zmm26);
+       mm512_stream_si512(dest, 27, zmm27);
+       mm512_stream_si512(dest, 28, zmm28);
+       mm512_stream_si512(dest, 29, zmm29);
+       mm512_stream_si512(dest, 30, zmm30);
+       mm512_stream_si512(dest, 31, zmm31);
+}
+
+static force_inline void
+memmove_movnt16x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+       __m512i zmm8 = mm512_loadu_si512(src, 8);
+       __m512i zmm9 = mm512_loadu_si512(src, 9);
+       __m512i zmm10 = mm512_loadu_si512(src, 10);
+       __m512i zmm11 = mm512_loadu_si512(src, 11);
+       __m512i zmm12 = mm512_loadu_si512(src, 12);
+       __m512i zmm13 = mm512_loadu_si512(src, 13);
+       __m512i zmm14 = mm512_loadu_si512(src, 14);
+       __m512i zmm15 = mm512_loadu_si512(src, 15);
+
+       mm512_stream_si512(dest, 0, zmm0);
+       mm512_stream_si512(dest, 1, zmm1);
+       mm512_stream_si512(dest, 2, zmm2);
+       mm512_stream_si512(dest, 3, zmm3);
+       mm512_stream_si512(dest, 4, zmm4);
+       mm512_stream_si512(dest, 5, zmm5);
+       mm512_stream_si512(dest, 6, zmm6);
+       mm512_stream_si512(dest, 7, zmm7);
+       mm512_stream_si512(dest, 8, zmm8);
+       mm512_stream_si512(dest, 9, zmm9);
+       mm512_stream_si512(dest, 10, zmm10);
+       mm512_stream_si512(dest, 11, zmm11);
+       mm512_stream_si512(dest, 12, zmm12);
+       mm512_stream_si512(dest, 13, zmm13);
+       mm512_stream_si512(dest, 14, zmm14);
+       mm512_stream_si512(dest, 15, zmm15);
+}
+
+static force_inline void
+memmove_movnt8x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+
+       mm512_stream_si512(dest, 0, zmm0);
+       mm512_stream_si512(dest, 1, zmm1);
+       mm512_stream_si512(dest, 2, zmm2);
+       mm512_stream_si512(dest, 3, zmm3);
+       mm512_stream_si512(dest, 4, zmm4);
+       mm512_stream_si512(dest, 5, zmm5);
+       mm512_stream_si512(dest, 6, zmm6);
+       mm512_stream_si512(dest, 7, zmm7);
+}
+
+static force_inline void
+memmove_movnt4x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+
+       mm512_stream_si512(dest, 0, zmm0);
+       mm512_stream_si512(dest, 1, zmm1);
+       mm512_stream_si512(dest, 2, zmm2);
+       mm512_stream_si512(dest, 3, zmm3);
+}
+
+static force_inline void
+memmove_movnt2x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+
+       mm512_stream_si512(dest, 0, zmm0);
+       mm512_stream_si512(dest, 1, zmm1);
+}
+
+static force_inline void
+memmove_movnt1x64b(char *dest, const char *src)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+
+       mm512_stream_si512(dest, 0, zmm0);
+}
+
+static force_inline void
+memmove_movnt1x32b(char *dest, const char *src)
+{
+       __m256i zmm0 = _mm256_loadu_si256((__m256i *)src);
+
+       _mm256_stream_si256((__m256i *)dest, zmm0);
+}
+
+static force_inline void
+memmove_movnt1x16b(char *dest, const char *src)
+{
+       __m128i ymm0 = _mm_loadu_si128((__m128i *)src);
+
+       _mm_stream_si128((__m128i *)dest, ymm0);
+}
+
+static force_inline void
+memmove_movnt1x8b(char *dest, const char *src)
+{
+       _mm_stream_si64((long long *)dest, *(long long *)src);
+}
+
+static force_inline void
+memmove_movnt1x4b(char *dest, const char *src)
+{
+       _mm_stream_si32((int *)dest, *(int *)src);
+}
+
+static force_inline void
+memmove_movnt_avx512f_fw(char *dest, const char *src, size_t len,
+               flush_fn flush)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_avx512f(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 32 * 64) {
+               memmove_movnt32x64b(dest, src);
+               dest += 32 * 64;
+               src += 32 * 64;
+               len -= 32 * 64;
+       }
+
+       if (len >= 16 * 64) {
+               memmove_movnt16x64b(dest, src);
+               dest += 16 * 64;
+               src += 16 * 64;
+               len -= 16 * 64;
+       }
+
+       if (len >= 8 * 64) {
+               memmove_movnt8x64b(dest, src);
+               dest += 8 * 64;
+               src += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_movnt2x64b(dest, src);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_movnt1x64b(dest, src);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memmove_movnt1x32b(dest, src);
+               else if (len == 16)
+                       memmove_movnt1x16b(dest, src);
+               else if (len == 8)
+                       memmove_movnt1x8b(dest, src);
+               else if (len == 4)
+                       memmove_movnt1x4b(dest, src);
+               else
+                       goto nonnt;
+
+               goto end;
+       }
+
+nonnt:
+       memmove_small_avx512f(dest, src, len, flush);
+end:
+       avx_zeroupper();
+}
+
+static force_inline void
+memmove_movnt_avx512f_bw(char *dest, const char *src, size_t len,
+               flush_fn flush)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+
+               memmove_small_avx512f(dest, src, cnt, flush);
+       }
+
+       while (len >= 32 * 64) {
+               dest -= 32 * 64;
+               src -= 32 * 64;
+               len -= 32 * 64;
+               memmove_movnt32x64b(dest, src);
+       }
+
+       if (len >= 16 * 64) {
+               dest -= 16 * 64;
+               src -= 16 * 64;
+               len -= 16 * 64;
+               memmove_movnt16x64b(dest, src);
+       }
+
+       if (len >= 8 * 64) {
+               dest -= 8 * 64;
+               src -= 8 * 64;
+               len -= 8 * 64;
+               memmove_movnt8x64b(dest, src);
+       }
+
+       if (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_movnt2x64b(dest, src);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+
+               memmove_movnt1x64b(dest, src);
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32) {
+                       dest -= 32;
+                       src -= 32;
+                       memmove_movnt1x32b(dest, src);
+               } else if (len == 16) {
+                       dest -= 16;
+                       src -= 16;
+                       memmove_movnt1x16b(dest, src);
+               } else if (len == 8) {
+                       dest -= 8;
+                       src -= 8;
+                       memmove_movnt1x8b(dest, src);
+               } else if (len == 4) {
+                       dest -= 4;
+                       src -= 4;
+                       memmove_movnt1x4b(dest, src);
+               } else {
+                       goto nonnt;
+               }
+
+               goto end;
+       }
+
+nonnt:
+       dest -= len;
+       src -= len;
+
+       memmove_small_avx512f(dest, src, len, flush);
+end:
+       avx_zeroupper();
+}
+
+static force_inline void
+memmove_movnt_avx512f(char *dest, const char *src, size_t len, flush_fn flush,
+               barrier_fn barrier)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_movnt_avx512f_fw(dest, src, len, flush);
+       else
+               memmove_movnt_avx512f_bw(dest, src, len, flush);
+
+       barrier();
+
+       VALGRIND_DO_FLUSH(dest, len);
+}
+
+void
+memmove_movnt_avx512f_noflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx512f(dest, src, len, noflush, barrier_after_ntstores);
+}
+
+void
+memmove_movnt_avx512f_empty(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx512f(dest, src, len, flush_empty_nolog,
+                       barrier_after_ntstores);
+}
+
+void
+memmove_movnt_avx512f_clflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx512f(dest, src, len, flush_clflush_nolog,
+                       barrier_after_ntstores);
+}
+
+void
+memmove_movnt_avx512f_clflushopt(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx512f(dest, src, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores);
+}
+
+void
+memmove_movnt_avx512f_clwb(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_avx512f(dest, src, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_sse2.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_nt_sse2.c
new file mode 100644 (file)
index 0000000..b633be9
--- /dev/null
@@ -0,0 +1,428 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_sse2.h"
+#include "valgrind_internal.h"
+
+static force_inline __m128i
+mm_loadu_si128(const char *src, unsigned idx)
+{
+       return _mm_loadu_si128((const __m128i *)src + idx);
+}
+
+static force_inline void
+mm_stream_si128(char *dest, unsigned idx, __m128i src)
+{
+       _mm_stream_si128((__m128i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memmove_movnt4x64b(char *dest, const char *src)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+       __m128i xmm4 = mm_loadu_si128(src, 4);
+       __m128i xmm5 = mm_loadu_si128(src, 5);
+       __m128i xmm6 = mm_loadu_si128(src, 6);
+       __m128i xmm7 = mm_loadu_si128(src, 7);
+       __m128i xmm8 = mm_loadu_si128(src, 8);
+       __m128i xmm9 = mm_loadu_si128(src, 9);
+       __m128i xmm10 = mm_loadu_si128(src, 10);
+       __m128i xmm11 = mm_loadu_si128(src, 11);
+       __m128i xmm12 = mm_loadu_si128(src, 12);
+       __m128i xmm13 = mm_loadu_si128(src, 13);
+       __m128i xmm14 = mm_loadu_si128(src, 14);
+       __m128i xmm15 = mm_loadu_si128(src, 15);
+
+       mm_stream_si128(dest, 0, xmm0);
+       mm_stream_si128(dest, 1, xmm1);
+       mm_stream_si128(dest, 2, xmm2);
+       mm_stream_si128(dest, 3, xmm3);
+       mm_stream_si128(dest, 4, xmm4);
+       mm_stream_si128(dest, 5, xmm5);
+       mm_stream_si128(dest, 6, xmm6);
+       mm_stream_si128(dest, 7, xmm7);
+       mm_stream_si128(dest, 8, xmm8);
+       mm_stream_si128(dest, 9, xmm9);
+       mm_stream_si128(dest, 10, xmm10);
+       mm_stream_si128(dest, 11, xmm11);
+       mm_stream_si128(dest, 12, xmm12);
+       mm_stream_si128(dest, 13, xmm13);
+       mm_stream_si128(dest, 14, xmm14);
+       mm_stream_si128(dest, 15, xmm15);
+}
+
+static force_inline void
+memmove_movnt2x64b(char *dest, const char *src)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+       __m128i xmm4 = mm_loadu_si128(src, 4);
+       __m128i xmm5 = mm_loadu_si128(src, 5);
+       __m128i xmm6 = mm_loadu_si128(src, 6);
+       __m128i xmm7 = mm_loadu_si128(src, 7);
+
+       mm_stream_si128(dest, 0, xmm0);
+       mm_stream_si128(dest, 1, xmm1);
+       mm_stream_si128(dest, 2, xmm2);
+       mm_stream_si128(dest, 3, xmm3);
+       mm_stream_si128(dest, 4, xmm4);
+       mm_stream_si128(dest, 5, xmm5);
+       mm_stream_si128(dest, 6, xmm6);
+       mm_stream_si128(dest, 7, xmm7);
+}
+
+static force_inline void
+memmove_movnt1x64b(char *dest, const char *src)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+
+       mm_stream_si128(dest, 0, xmm0);
+       mm_stream_si128(dest, 1, xmm1);
+       mm_stream_si128(dest, 2, xmm2);
+       mm_stream_si128(dest, 3, xmm3);
+}
+
+static force_inline void
+memmove_movnt1x32b(char *dest, const char *src)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+
+       mm_stream_si128(dest, 0, xmm0);
+       mm_stream_si128(dest, 1, xmm1);
+}
+
+static force_inline void
+memmove_movnt1x16b(char *dest, const char *src)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+
+       mm_stream_si128(dest, 0, xmm0);
+}
+
+static force_inline void
+memmove_movnt1x8b(char *dest, const char *src)
+{
+       _mm_stream_si64((long long *)dest, *(long long *)src);
+}
+
+static force_inline void
+memmove_movnt1x4b(char *dest, const char *src)
+{
+       _mm_stream_si32((int *)dest, *(int *)src);
+}
+
+static force_inline void
+memmove_movnt_sse_fw(char *dest, const char *src, size_t len, flush_fn flush,
+               perf_barrier_fn perf_barrier)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_sse2(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       const char *srcend = src + len;
+       prefetch_ini_fw(src, len);
+
+       while (len >= PERF_BARRIER_SIZE) {
+               prefetch_next_fw(src, srcend);
+
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (4 + 4 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       while (len >= 4 * 64) {
+               memmove_movnt4x64b(dest, src);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_movnt2x64b(dest, src);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_movnt1x64b(dest, src);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               return;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memmove_movnt1x32b(dest, src);
+               else if (len == 16)
+                       memmove_movnt1x16b(dest, src);
+               else if (len == 8)
+                       memmove_movnt1x8b(dest, src);
+               else if (len == 4)
+                       memmove_movnt1x4b(dest, src);
+               else
+                       goto nonnt;
+
+               return;
+       }
+
+nonnt:
+       memmove_small_sse2(dest, src, len, flush);
+}
+
+static force_inline void
+memmove_movnt_sse_bw(char *dest, const char *src, size_t len, flush_fn flush,
+               perf_barrier_fn perf_barrier)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+
+               memmove_small_sse2(dest, src, cnt, flush);
+       }
+
+       const char *srcbegin = src - len;
+       prefetch_ini_bw(src, len);
+
+       while (len >= PERF_BARRIER_SIZE) {
+               prefetch_next_bw(src, srcbegin);
+
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (4 + 4 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       while (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_movnt4x64b(dest, src);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_movnt2x64b(dest, src);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+               memmove_movnt1x64b(dest, src);
+       }
+
+       if (len == 0)
+               return;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32) {
+                       dest -= 32;
+                       src -= 32;
+                       memmove_movnt1x32b(dest, src);
+               } else if (len == 16) {
+                       dest -= 16;
+                       src -= 16;
+                       memmove_movnt1x16b(dest, src);
+               } else if (len == 8) {
+                       dest -= 8;
+                       src -= 8;
+                       memmove_movnt1x8b(dest, src);
+               } else if (len == 4) {
+                       dest -= 4;
+                       src -= 4;
+                       memmove_movnt1x4b(dest, src);
+               } else {
+                       goto nonnt;
+               }
+
+               return;
+       }
+
+nonnt:
+       dest -= len;
+       src -= len;
+       memmove_small_sse2(dest, src, len, flush);
+}
+
+static force_inline void
+memmove_movnt_sse2(char *dest, const char *src, size_t len, flush_fn flush,
+               barrier_fn barrier, perf_barrier_fn perf_barrier)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_movnt_sse_fw(dest, src, len, flush, perf_barrier);
+       else
+               memmove_movnt_sse_bw(dest, src, len, flush, perf_barrier);
+
+       barrier();
+
+       VALGRIND_DO_FLUSH(dest, len);
+}
+
+/* variants without perf_barrier */
+
+void
+memmove_movnt_sse2_noflush_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, noflush, barrier_after_ntstores,
+                       no_barrier);
+}
+
+void
+memmove_movnt_sse2_empty_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_empty_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memmove_movnt_sse2_clflush_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clflush_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memmove_movnt_sse2_clflushopt_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+void
+memmove_movnt_sse2_clwb_nobarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+/* variants with perf_barrier */
+
+void
+memmove_movnt_sse2_noflush_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, noflush, barrier_after_ntstores,
+                       wc_barrier);
+}
+
+void
+memmove_movnt_sse2_empty_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_empty_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memmove_movnt_sse2_clflush_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clflush_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memmove_movnt_sse2_clflushopt_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
+
+void
+memmove_movnt_sse2_clwb_wcbarrier(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_movnt_sse2(dest, src, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_sse2.h b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_sse2.h
new file mode 100644 (file)
index 0000000..1e18bf8
--- /dev/null
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMCPY_SSE2_H
+#define PMEM2_MEMCPY_SSE2_H
+
+#include <xmmintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "out.h"
+
+static force_inline void
+memmove_small_sse2_noflush(char *dest, const char *src, size_t len)
+{
+       ASSERT(len <= 64);
+
+       if (len <= 8)
+               goto le8;
+       if (len <= 32)
+               goto le32;
+
+       if (len > 48) {
+               /* 49..64 */
+               __m128i xmm0 = _mm_loadu_si128((__m128i *)src);
+               __m128i xmm1 = _mm_loadu_si128((__m128i *)(src + 16));
+               __m128i xmm2 = _mm_loadu_si128((__m128i *)(src + 32));
+               __m128i xmm3 = _mm_loadu_si128((__m128i *)(src + len - 16));
+
+               _mm_storeu_si128((__m128i *)dest, xmm0);
+               _mm_storeu_si128((__m128i *)(dest + 16), xmm1);
+               _mm_storeu_si128((__m128i *)(dest + 32), xmm2);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm3);
+               return;
+       }
+
+       /* 33..48 */
+       __m128i xmm0 = _mm_loadu_si128((__m128i *)src);
+       __m128i xmm1 = _mm_loadu_si128((__m128i *)(src + 16));
+       __m128i xmm2 = _mm_loadu_si128((__m128i *)(src + len - 16));
+
+       _mm_storeu_si128((__m128i *)dest, xmm0);
+       _mm_storeu_si128((__m128i *)(dest + 16), xmm1);
+       _mm_storeu_si128((__m128i *)(dest + len - 16), xmm2);
+       return;
+
+le32:
+       if (len > 16) {
+               /* 17..32 */
+               __m128i xmm0 = _mm_loadu_si128((__m128i *)src);
+               __m128i xmm1 = _mm_loadu_si128((__m128i *)(src + len - 16));
+
+               _mm_storeu_si128((__m128i *)dest, xmm0);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm1);
+               return;
+       }
+
+       /* 9..16 */
+       uint64_t d80 = *(ua_uint64_t *)src;
+       uint64_t d81 = *(ua_uint64_t *)(src + len - 8);
+
+       *(ua_uint64_t *)dest = d80;
+       *(ua_uint64_t *)(dest + len - 8) = d81;
+       return;
+
+le8:
+       if (len <= 2)
+               goto le2;
+
+       if (len > 4) {
+               /* 5..8 */
+               uint32_t d40 = *(ua_uint32_t *)src;
+               uint32_t d41 = *(ua_uint32_t *)(src + len - 4);
+
+               *(ua_uint32_t *)dest = d40;
+               *(ua_uint32_t *)(dest + len - 4) = d41;
+               return;
+       }
+
+       /* 3..4 */
+       uint16_t d20 = *(ua_uint16_t *)src;
+       uint16_t d21 = *(ua_uint16_t *)(src + len - 2);
+
+       *(ua_uint16_t *)dest = d20;
+       *(ua_uint16_t *)(dest + len - 2) = d21;
+       return;
+
+le2:
+       if (len == 2) {
+               *(ua_uint16_t *)dest = *(ua_uint16_t *)src;
+               return;
+       }
+
+       *(uint8_t *)dest = *(uint8_t *)src;
+}
+
+static force_inline void
+memmove_small_sse2(char *dest, const char *src, size_t len, flush_fn flush)
+{
+       /*
+        * pmemcheck complains about "overwritten stores before they were made
+        * persistent" for overlapping stores (last instruction in each code
+        * path) in the optimized version.
+        * libc's memcpy also does that, so we can't use it here.
+        */
+       if (On_pmemcheck) {
+               memmove_nodrain_generic(dest, src, len, PMEM2_F_MEM_NOFLUSH,
+                               NULL);
+       } else {
+               memmove_small_sse2_noflush(dest, src, len);
+       }
+
+       flush(dest, len);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx.c
new file mode 100644 (file)
index 0000000..c4780ca
--- /dev/null
@@ -0,0 +1,281 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_avx.h"
+
+static force_inline __m256i
+mm256_loadu_si256(const char *src, unsigned idx)
+{
+       return _mm256_loadu_si256((const __m256i *)src + idx);
+}
+
+static force_inline void
+mm256_store_si256(char *dest, unsigned idx, __m256i src)
+{
+       _mm256_store_si256((__m256i *)dest + idx, src);
+}
+
+static force_inline void
+memmove_mov8x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+       __m256i ymm4 = mm256_loadu_si256(src, 4);
+       __m256i ymm5 = mm256_loadu_si256(src, 5);
+       __m256i ymm6 = mm256_loadu_si256(src, 6);
+       __m256i ymm7 = mm256_loadu_si256(src, 7);
+       __m256i ymm8 = mm256_loadu_si256(src, 8);
+       __m256i ymm9 = mm256_loadu_si256(src, 9);
+       __m256i ymm10 = mm256_loadu_si256(src, 10);
+       __m256i ymm11 = mm256_loadu_si256(src, 11);
+       __m256i ymm12 = mm256_loadu_si256(src, 12);
+       __m256i ymm13 = mm256_loadu_si256(src, 13);
+       __m256i ymm14 = mm256_loadu_si256(src, 14);
+       __m256i ymm15 = mm256_loadu_si256(src, 15);
+
+       mm256_store_si256(dest, 0, ymm0);
+       mm256_store_si256(dest, 1, ymm1);
+       mm256_store_si256(dest, 2, ymm2);
+       mm256_store_si256(dest, 3, ymm3);
+       mm256_store_si256(dest, 4, ymm4);
+       mm256_store_si256(dest, 5, ymm5);
+       mm256_store_si256(dest, 6, ymm6);
+       mm256_store_si256(dest, 7, ymm7);
+       mm256_store_si256(dest, 8, ymm8);
+       mm256_store_si256(dest, 9, ymm9);
+       mm256_store_si256(dest, 10, ymm10);
+       mm256_store_si256(dest, 11, ymm11);
+       mm256_store_si256(dest, 12, ymm12);
+       mm256_store_si256(dest, 13, ymm13);
+       mm256_store_si256(dest, 14, ymm14);
+       mm256_store_si256(dest, 15, ymm15);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+}
+
+static force_inline void
+memmove_mov4x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+       __m256i ymm4 = mm256_loadu_si256(src, 4);
+       __m256i ymm5 = mm256_loadu_si256(src, 5);
+       __m256i ymm6 = mm256_loadu_si256(src, 6);
+       __m256i ymm7 = mm256_loadu_si256(src, 7);
+
+       mm256_store_si256(dest, 0, ymm0);
+       mm256_store_si256(dest, 1, ymm1);
+       mm256_store_si256(dest, 2, ymm2);
+       mm256_store_si256(dest, 3, ymm3);
+       mm256_store_si256(dest, 4, ymm4);
+       mm256_store_si256(dest, 5, ymm5);
+       mm256_store_si256(dest, 6, ymm6);
+       mm256_store_si256(dest, 7, ymm7);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memmove_mov2x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+       __m256i ymm2 = mm256_loadu_si256(src, 2);
+       __m256i ymm3 = mm256_loadu_si256(src, 3);
+
+       mm256_store_si256(dest, 0, ymm0);
+       mm256_store_si256(dest, 1, ymm1);
+       mm256_store_si256(dest, 2, ymm2);
+       mm256_store_si256(dest, 3, ymm3);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memmove_mov1x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m256i ymm0 = mm256_loadu_si256(src, 0);
+       __m256i ymm1 = mm256_loadu_si256(src, 1);
+
+       mm256_store_si256(dest, 0, ymm0);
+       mm256_store_si256(dest, 1, ymm1);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memmove_mov_avx_fw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_avx(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 8 * 64) {
+               memmove_mov8x64b(dest, src, flush64b);
+               dest += 8 * 64;
+               src += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memmove_mov4x64b(dest, src, flush64b);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_mov2x64b(dest, src, flush64b);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_mov1x64b(dest, src, flush64b);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memmove_small_avx(dest, src, len, flush);
+}
+
+static force_inline void
+memmove_mov_avx_bw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+               memmove_small_avx(dest, src, cnt, flush);
+       }
+
+       while (len >= 8 * 64) {
+               dest -= 8 * 64;
+               src -= 8 * 64;
+               len -= 8 * 64;
+               memmove_mov8x64b(dest, src, flush64b);
+       }
+
+       if (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_mov4x64b(dest, src, flush64b);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_mov2x64b(dest, src, flush64b);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+               memmove_mov1x64b(dest, src, flush64b);
+       }
+
+       if (len)
+               memmove_small_avx(dest - len, src - len, len, flush);
+}
+
+static force_inline void
+memmove_mov_avx(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_mov_avx_fw(dest, src, len, flush, flush64b);
+       else
+               memmove_mov_avx_bw(dest, src, len, flush, flush64b);
+
+       avx_zeroupper();
+}
+
+void
+memmove_mov_avx_noflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx(dest, src, len, noflush, noflush64b);
+}
+
+void
+memmove_mov_avx_empty(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx(dest, src, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memmove_mov_avx_clflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx(dest, src, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memmove_mov_avx_clflushopt(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx(dest, src, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memmove_mov_avx_clwb(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx(dest, src, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx512f.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_avx512f.c
new file mode 100644 (file)
index 0000000..b177528
--- /dev/null
@@ -0,0 +1,438 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_avx512f.h"
+
+static force_inline __m512i
+mm512_loadu_si512(const char *src, unsigned idx)
+{
+       return _mm512_loadu_si512((const __m512i *)src + idx);
+}
+
+static force_inline void
+mm512_store_si512(char *dest, unsigned idx, __m512i src)
+{
+       _mm512_store_si512((__m512i *)dest + idx, src);
+}
+
+static force_inline void
+memmove_mov32x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+       __m512i zmm8 = mm512_loadu_si512(src, 8);
+       __m512i zmm9 = mm512_loadu_si512(src, 9);
+       __m512i zmm10 = mm512_loadu_si512(src, 10);
+       __m512i zmm11 = mm512_loadu_si512(src, 11);
+       __m512i zmm12 = mm512_loadu_si512(src, 12);
+       __m512i zmm13 = mm512_loadu_si512(src, 13);
+       __m512i zmm14 = mm512_loadu_si512(src, 14);
+       __m512i zmm15 = mm512_loadu_si512(src, 15);
+       __m512i zmm16 = mm512_loadu_si512(src, 16);
+       __m512i zmm17 = mm512_loadu_si512(src, 17);
+       __m512i zmm18 = mm512_loadu_si512(src, 18);
+       __m512i zmm19 = mm512_loadu_si512(src, 19);
+       __m512i zmm20 = mm512_loadu_si512(src, 20);
+       __m512i zmm21 = mm512_loadu_si512(src, 21);
+       __m512i zmm22 = mm512_loadu_si512(src, 22);
+       __m512i zmm23 = mm512_loadu_si512(src, 23);
+       __m512i zmm24 = mm512_loadu_si512(src, 24);
+       __m512i zmm25 = mm512_loadu_si512(src, 25);
+       __m512i zmm26 = mm512_loadu_si512(src, 26);
+       __m512i zmm27 = mm512_loadu_si512(src, 27);
+       __m512i zmm28 = mm512_loadu_si512(src, 28);
+       __m512i zmm29 = mm512_loadu_si512(src, 29);
+       __m512i zmm30 = mm512_loadu_si512(src, 30);
+       __m512i zmm31 = mm512_loadu_si512(src, 31);
+
+       mm512_store_si512(dest, 0, zmm0);
+       mm512_store_si512(dest, 1, zmm1);
+       mm512_store_si512(dest, 2, zmm2);
+       mm512_store_si512(dest, 3, zmm3);
+       mm512_store_si512(dest, 4, zmm4);
+       mm512_store_si512(dest, 5, zmm5);
+       mm512_store_si512(dest, 6, zmm6);
+       mm512_store_si512(dest, 7, zmm7);
+       mm512_store_si512(dest, 8, zmm8);
+       mm512_store_si512(dest, 9, zmm9);
+       mm512_store_si512(dest, 10, zmm10);
+       mm512_store_si512(dest, 11, zmm11);
+       mm512_store_si512(dest, 12, zmm12);
+       mm512_store_si512(dest, 13, zmm13);
+       mm512_store_si512(dest, 14, zmm14);
+       mm512_store_si512(dest, 15, zmm15);
+       mm512_store_si512(dest, 16, zmm16);
+       mm512_store_si512(dest, 17, zmm17);
+       mm512_store_si512(dest, 18, zmm18);
+       mm512_store_si512(dest, 19, zmm19);
+       mm512_store_si512(dest, 20, zmm20);
+       mm512_store_si512(dest, 21, zmm21);
+       mm512_store_si512(dest, 22, zmm22);
+       mm512_store_si512(dest, 23, zmm23);
+       mm512_store_si512(dest, 24, zmm24);
+       mm512_store_si512(dest, 25, zmm25);
+       mm512_store_si512(dest, 26, zmm26);
+       mm512_store_si512(dest, 27, zmm27);
+       mm512_store_si512(dest, 28, zmm28);
+       mm512_store_si512(dest, 29, zmm29);
+       mm512_store_si512(dest, 30, zmm30);
+       mm512_store_si512(dest, 31, zmm31);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+       flush64b(dest + 8 * 64);
+       flush64b(dest + 9 * 64);
+       flush64b(dest + 10 * 64);
+       flush64b(dest + 11 * 64);
+       flush64b(dest + 12 * 64);
+       flush64b(dest + 13 * 64);
+       flush64b(dest + 14 * 64);
+       flush64b(dest + 15 * 64);
+       flush64b(dest + 16 * 64);
+       flush64b(dest + 17 * 64);
+       flush64b(dest + 18 * 64);
+       flush64b(dest + 19 * 64);
+       flush64b(dest + 20 * 64);
+       flush64b(dest + 21 * 64);
+       flush64b(dest + 22 * 64);
+       flush64b(dest + 23 * 64);
+       flush64b(dest + 24 * 64);
+       flush64b(dest + 25 * 64);
+       flush64b(dest + 26 * 64);
+       flush64b(dest + 27 * 64);
+       flush64b(dest + 28 * 64);
+       flush64b(dest + 29 * 64);
+       flush64b(dest + 30 * 64);
+       flush64b(dest + 31 * 64);
+}
+
+static force_inline void
+memmove_mov16x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+       __m512i zmm8 = mm512_loadu_si512(src, 8);
+       __m512i zmm9 = mm512_loadu_si512(src, 9);
+       __m512i zmm10 = mm512_loadu_si512(src, 10);
+       __m512i zmm11 = mm512_loadu_si512(src, 11);
+       __m512i zmm12 = mm512_loadu_si512(src, 12);
+       __m512i zmm13 = mm512_loadu_si512(src, 13);
+       __m512i zmm14 = mm512_loadu_si512(src, 14);
+       __m512i zmm15 = mm512_loadu_si512(src, 15);
+
+       mm512_store_si512(dest, 0, zmm0);
+       mm512_store_si512(dest, 1, zmm1);
+       mm512_store_si512(dest, 2, zmm2);
+       mm512_store_si512(dest, 3, zmm3);
+       mm512_store_si512(dest, 4, zmm4);
+       mm512_store_si512(dest, 5, zmm5);
+       mm512_store_si512(dest, 6, zmm6);
+       mm512_store_si512(dest, 7, zmm7);
+       mm512_store_si512(dest, 8, zmm8);
+       mm512_store_si512(dest, 9, zmm9);
+       mm512_store_si512(dest, 10, zmm10);
+       mm512_store_si512(dest, 11, zmm11);
+       mm512_store_si512(dest, 12, zmm12);
+       mm512_store_si512(dest, 13, zmm13);
+       mm512_store_si512(dest, 14, zmm14);
+       mm512_store_si512(dest, 15, zmm15);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+       flush64b(dest + 8 * 64);
+       flush64b(dest + 9 * 64);
+       flush64b(dest + 10 * 64);
+       flush64b(dest + 11 * 64);
+       flush64b(dest + 12 * 64);
+       flush64b(dest + 13 * 64);
+       flush64b(dest + 14 * 64);
+       flush64b(dest + 15 * 64);
+}
+
+static force_inline void
+memmove_mov8x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+       __m512i zmm4 = mm512_loadu_si512(src, 4);
+       __m512i zmm5 = mm512_loadu_si512(src, 5);
+       __m512i zmm6 = mm512_loadu_si512(src, 6);
+       __m512i zmm7 = mm512_loadu_si512(src, 7);
+
+       mm512_store_si512(dest, 0, zmm0);
+       mm512_store_si512(dest, 1, zmm1);
+       mm512_store_si512(dest, 2, zmm2);
+       mm512_store_si512(dest, 3, zmm3);
+       mm512_store_si512(dest, 4, zmm4);
+       mm512_store_si512(dest, 5, zmm5);
+       mm512_store_si512(dest, 6, zmm6);
+       mm512_store_si512(dest, 7, zmm7);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+}
+
+static force_inline void
+memmove_mov4x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+       __m512i zmm2 = mm512_loadu_si512(src, 2);
+       __m512i zmm3 = mm512_loadu_si512(src, 3);
+
+       mm512_store_si512(dest, 0, zmm0);
+       mm512_store_si512(dest, 1, zmm1);
+       mm512_store_si512(dest, 2, zmm2);
+       mm512_store_si512(dest, 3, zmm3);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memmove_mov2x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+       __m512i zmm1 = mm512_loadu_si512(src, 1);
+
+       mm512_store_si512(dest, 0, zmm0);
+       mm512_store_si512(dest, 1, zmm1);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memmove_mov1x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m512i zmm0 = mm512_loadu_si512(src, 0);
+
+       mm512_store_si512(dest, 0, zmm0);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memmove_mov_avx512f_fw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_avx512f(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 32 * 64) {
+               memmove_mov32x64b(dest, src, flush64b);
+               dest += 32 * 64;
+               src += 32 * 64;
+               len -= 32 * 64;
+       }
+
+       if (len >= 16 * 64) {
+               memmove_mov16x64b(dest, src, flush64b);
+               dest += 16 * 64;
+               src += 16 * 64;
+               len -= 16 * 64;
+       }
+
+       if (len >= 8 * 64) {
+               memmove_mov8x64b(dest, src, flush64b);
+               dest += 8 * 64;
+               src += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memmove_mov4x64b(dest, src, flush64b);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_mov2x64b(dest, src, flush64b);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_mov1x64b(dest, src, flush64b);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memmove_small_avx512f(dest, src, len, flush);
+}
+
+static force_inline void
+memmove_mov_avx512f_bw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+
+               memmove_small_avx512f(dest, src, cnt, flush);
+       }
+
+       while (len >= 32 * 64) {
+               dest -= 32 * 64;
+               src -= 32 * 64;
+               len -= 32 * 64;
+               memmove_mov32x64b(dest, src, flush64b);
+       }
+
+       if (len >= 16 * 64) {
+               dest -= 16 * 64;
+               src -= 16 * 64;
+               len -= 16 * 64;
+               memmove_mov16x64b(dest, src, flush64b);
+       }
+
+       if (len >= 8 * 64) {
+               dest -= 8 * 64;
+               src -= 8 * 64;
+               len -= 8 * 64;
+               memmove_mov8x64b(dest, src, flush64b);
+       }
+
+       if (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_mov4x64b(dest, src, flush64b);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_mov2x64b(dest, src, flush64b);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+               memmove_mov1x64b(dest, src, flush64b);
+       }
+
+       if (len)
+               memmove_small_avx512f(dest - len, src - len, len, flush);
+}
+
+static force_inline void
+memmove_mov_avx512f(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_mov_avx512f_fw(dest, src, len, flush, flush64b);
+       else
+               memmove_mov_avx512f_bw(dest, src, len, flush, flush64b);
+
+       avx_zeroupper();
+}
+
+void
+memmove_mov_avx512f_noflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx512f(dest, src, len, noflush, noflush64b);
+}
+
+void
+memmove_mov_avx512f_empty(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx512f(dest, src, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memmove_mov_avx512f_clflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx512f(dest, src, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memmove_mov_avx512f_clflushopt(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx512f(dest, src, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memmove_mov_avx512f_clwb(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_avx512f(dest, src, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_sse2.c b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy/memcpy_t_sse2.c
new file mode 100644 (file)
index 0000000..10c03a0
--- /dev/null
@@ -0,0 +1,246 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memcpy_sse2.h"
+#include "out.h"
+
+static force_inline __m128i
+mm_loadu_si128(const char *src, unsigned idx)
+{
+       return _mm_loadu_si128((const __m128i *)src + idx);
+}
+
+static force_inline void
+mm_store_si128(char *dest, unsigned idx, __m128i src)
+{
+       _mm_store_si128((__m128i *)dest + idx, src);
+}
+
+static force_inline void
+memmove_mov4x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+       __m128i xmm4 = mm_loadu_si128(src, 4);
+       __m128i xmm5 = mm_loadu_si128(src, 5);
+       __m128i xmm6 = mm_loadu_si128(src, 6);
+       __m128i xmm7 = mm_loadu_si128(src, 7);
+       __m128i xmm8 = mm_loadu_si128(src, 8);
+       __m128i xmm9 = mm_loadu_si128(src, 9);
+       __m128i xmm10 = mm_loadu_si128(src, 10);
+       __m128i xmm11 = mm_loadu_si128(src, 11);
+       __m128i xmm12 = mm_loadu_si128(src, 12);
+       __m128i xmm13 = mm_loadu_si128(src, 13);
+       __m128i xmm14 = mm_loadu_si128(src, 14);
+       __m128i xmm15 = mm_loadu_si128(src, 15);
+
+       mm_store_si128(dest, 0, xmm0);
+       mm_store_si128(dest, 1, xmm1);
+       mm_store_si128(dest, 2, xmm2);
+       mm_store_si128(dest, 3, xmm3);
+       mm_store_si128(dest, 4, xmm4);
+       mm_store_si128(dest, 5, xmm5);
+       mm_store_si128(dest, 6, xmm6);
+       mm_store_si128(dest, 7, xmm7);
+       mm_store_si128(dest, 8, xmm8);
+       mm_store_si128(dest, 9, xmm9);
+       mm_store_si128(dest, 10, xmm10);
+       mm_store_si128(dest, 11, xmm11);
+       mm_store_si128(dest, 12, xmm12);
+       mm_store_si128(dest, 13, xmm13);
+       mm_store_si128(dest, 14, xmm14);
+       mm_store_si128(dest, 15, xmm15);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memmove_mov2x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+       __m128i xmm4 = mm_loadu_si128(src, 4);
+       __m128i xmm5 = mm_loadu_si128(src, 5);
+       __m128i xmm6 = mm_loadu_si128(src, 6);
+       __m128i xmm7 = mm_loadu_si128(src, 7);
+
+       mm_store_si128(dest, 0, xmm0);
+       mm_store_si128(dest, 1, xmm1);
+       mm_store_si128(dest, 2, xmm2);
+       mm_store_si128(dest, 3, xmm3);
+       mm_store_si128(dest, 4, xmm4);
+       mm_store_si128(dest, 5, xmm5);
+       mm_store_si128(dest, 6, xmm6);
+       mm_store_si128(dest, 7, xmm7);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memmove_mov1x64b(char *dest, const char *src, flush64b_fn flush64b)
+{
+       __m128i xmm0 = mm_loadu_si128(src, 0);
+       __m128i xmm1 = mm_loadu_si128(src, 1);
+       __m128i xmm2 = mm_loadu_si128(src, 2);
+       __m128i xmm3 = mm_loadu_si128(src, 3);
+
+       mm_store_si128(dest, 0, xmm0);
+       mm_store_si128(dest, 1, xmm1);
+       mm_store_si128(dest, 2, xmm2);
+       mm_store_si128(dest, 3, xmm3);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memmove_mov_sse_fw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memmove_small_sse2(dest, src, cnt, flush);
+
+               dest += cnt;
+               src += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 4 * 64) {
+               memmove_mov4x64b(dest, src, flush64b);
+               dest += 4 * 64;
+               src += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memmove_mov2x64b(dest, src, flush64b);
+               dest += 2 * 64;
+               src += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memmove_mov1x64b(dest, src, flush64b);
+
+               dest += 1 * 64;
+               src += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memmove_small_sse2(dest, src, len, flush);
+}
+
+static force_inline void
+memmove_mov_sse_bw(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       dest += len;
+       src += len;
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               if (cnt > len)
+                       cnt = len;
+
+               dest -= cnt;
+               src -= cnt;
+               len -= cnt;
+               memmove_small_sse2(dest, src, cnt, flush);
+       }
+
+       while (len >= 4 * 64) {
+               dest -= 4 * 64;
+               src -= 4 * 64;
+               len -= 4 * 64;
+               memmove_mov4x64b(dest, src, flush64b);
+       }
+
+       if (len >= 2 * 64) {
+               dest -= 2 * 64;
+               src -= 2 * 64;
+               len -= 2 * 64;
+               memmove_mov2x64b(dest, src, flush64b);
+       }
+
+       if (len >= 1 * 64) {
+               dest -= 1 * 64;
+               src -= 1 * 64;
+               len -= 1 * 64;
+               memmove_mov1x64b(dest, src, flush64b);
+       }
+
+       if (len)
+               memmove_small_sse2(dest - len, src - len, len, flush);
+}
+
+static force_inline void
+memmove_mov_sse2(char *dest, const char *src, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       if ((uintptr_t)dest - (uintptr_t)src >= len)
+               memmove_mov_sse_fw(dest, src, len, flush, flush64b);
+       else
+               memmove_mov_sse_bw(dest, src, len, flush, flush64b);
+}
+
+void
+memmove_mov_sse2_noflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_sse2(dest, src, len, noflush, noflush64b);
+}
+
+void
+memmove_mov_sse2_empty(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_sse2(dest, src, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memmove_mov_sse2_clflush(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_sse2(dest, src, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memmove_mov_sse2_clflushopt(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_sse2(dest, src, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memmove_mov_sse2_clwb(char *dest, const char *src, size_t len)
+{
+       LOG(15, "dest %p src %p len %zu", dest, src, len);
+
+       memmove_mov_sse2(dest, src, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memcpy_memset.h b/ceph/src/pmdk/src/libpmem2/x86_64/memcpy_memset.h
new file mode 100644 (file)
index 0000000..70235dd
--- /dev/null
@@ -0,0 +1,273 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+#ifndef MEMCPY_MEMSET_H
+#define MEMCPY_MEMSET_H
+
+#include <stddef.h>
+#include <xmmintrin.h>
+#include "pmem2_arch.h"
+
+typedef void barrier_fn(void);
+typedef void flush64b_fn(const void *);
+
+static inline void
+barrier_after_ntstores(void)
+{
+       /*
+        * In this configuration pmem_drain does not contain sfence, so we have
+        * to serialize non-temporal store instructions.
+        */
+       _mm_sfence();
+}
+
+static inline void
+no_barrier_after_ntstores(void)
+{
+       /*
+        * In this configuration pmem_drain contains sfence, so we don't have
+        * to serialize non-temporal store instructions
+        */
+}
+
+static inline void
+noflush(const void *addr, size_t len)
+{
+       /* NOP, not even pmemcheck annotation */
+}
+
+static inline void
+noflush64b(const void *addr)
+{
+       /* NOP, not even pmemcheck annotation */
+}
+
+typedef void perf_barrier_fn(void);
+
+static force_inline void
+wc_barrier(void)
+{
+       /*
+        * Currently, for SSE2 and AVX code paths, use of non-temporal stores
+        * on all generations of CPUs must be limited to the number of
+        * write-combining buffers (12) because otherwise, suboptimal eviction
+        * policy might impact performance when writing more data than WC
+        * buffers can simultaneously hold.
+        *
+        * The AVX512 code path is not affected, probably because we are
+        * overwriting whole cache lines.
+        */
+       _mm_sfence();
+}
+
+static force_inline void
+no_barrier(void)
+{
+}
+
+#ifndef AVX512F_AVAILABLE
+/*
+ * XXX not supported in MSVC version we currently use.
+ * Enable Windows tests pmem2_mem_ext when MSVC we
+ * use will support AVX512F.
+ */
+#ifdef _MSC_VER
+#define AVX512F_AVAILABLE 0
+#else
+#define AVX512F_AVAILABLE 1
+#endif
+#endif
+
+#ifndef AVX_AVAILABLE
+#define AVX_AVAILABLE 1
+#endif
+
+#ifndef SSE2_AVAILABLE
+#define SSE2_AVAILABLE 1
+#endif
+
+#if SSE2_AVAILABLE
+void memmove_mov_sse2_clflush(char *dest, const char *src, size_t len);
+void memmove_mov_sse2_clflushopt(char *dest, const char *src, size_t len);
+void memmove_mov_sse2_clwb(char *dest, const char *src, size_t len);
+void memmove_mov_sse2_empty(char *dest, const char *src, size_t len);
+void memmove_mov_sse2_noflush(char *dest, const char *src, size_t len);
+
+void memmove_movnt_sse2_clflush_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_clflushopt_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_clwb_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_empty_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_noflush_nobarrier(char *dest, const char *src,
+               size_t len);
+
+void memmove_movnt_sse2_clflush_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_clflushopt_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_clwb_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_empty_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_sse2_noflush_wcbarrier(char *dest, const char *src,
+               size_t len);
+
+void memset_mov_sse2_clflush(char *dest, int c, size_t len);
+void memset_mov_sse2_clflushopt(char *dest, int c, size_t len);
+void memset_mov_sse2_clwb(char *dest, int c, size_t len);
+void memset_mov_sse2_empty(char *dest, int c, size_t len);
+void memset_mov_sse2_noflush(char *dest, int c, size_t len);
+
+void memset_movnt_sse2_clflush_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_clflushopt_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_clwb_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_empty_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_noflush_nobarrier(char *dest, int c, size_t len);
+
+void memset_movnt_sse2_clflush_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_clflushopt_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_clwb_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_empty_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_sse2_noflush_wcbarrier(char *dest, int c, size_t len);
+#endif
+
+#if AVX_AVAILABLE
+void memmove_mov_avx_clflush(char *dest, const char *src, size_t len);
+void memmove_mov_avx_clflushopt(char *dest, const char *src, size_t len);
+void memmove_mov_avx_clwb(char *dest, const char *src, size_t len);
+void memmove_mov_avx_empty(char *dest, const char *src, size_t len);
+void memmove_mov_avx_noflush(char *dest, const char *src, size_t len);
+
+void memmove_movnt_avx_clflush_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_clflushopt_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_clwb_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_empty_nobarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_noflush_nobarrier(char *dest, const char *src,
+               size_t len);
+
+void memmove_movnt_avx_clflush_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_clflushopt_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_clwb_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_empty_wcbarrier(char *dest, const char *src,
+               size_t len);
+void memmove_movnt_avx_noflush_wcbarrier(char *dest, const char *src,
+               size_t len);
+
+void memset_mov_avx_clflush(char *dest, int c, size_t len);
+void memset_mov_avx_clflushopt(char *dest, int c, size_t len);
+void memset_mov_avx_clwb(char *dest, int c, size_t len);
+void memset_mov_avx_empty(char *dest, int c, size_t len);
+void memset_mov_avx_noflush(char *dest, int c, size_t len);
+
+void memset_movnt_avx_clflush_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_clflushopt_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_clwb_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_empty_nobarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_noflush_nobarrier(char *dest, int c, size_t len);
+
+void memset_movnt_avx_clflush_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_clflushopt_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_clwb_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_empty_wcbarrier(char *dest, int c, size_t len);
+void memset_movnt_avx_noflush_wcbarrier(char *dest, int c, size_t len);
+#endif
+
+#if AVX512F_AVAILABLE
+void memmove_mov_avx512f_clflush(char *dest, const char *src, size_t len);
+void memmove_mov_avx512f_clflushopt(char *dest, const char *src, size_t len);
+void memmove_mov_avx512f_clwb(char *dest, const char *src, size_t len);
+void memmove_mov_avx512f_empty(char *dest, const char *src, size_t len);
+void memmove_mov_avx512f_noflush(char *dest, const char *src, size_t len);
+void memmove_movnt_avx512f_clflush(char *dest, const char *src, size_t len);
+void memmove_movnt_avx512f_clflushopt(char *dest, const char *src, size_t len);
+void memmove_movnt_avx512f_clwb(char *dest, const char *src, size_t len);
+void memmove_movnt_avx512f_empty(char *dest, const char *src, size_t len);
+void memmove_movnt_avx512f_noflush(char *dest, const char *src, size_t len);
+void memset_mov_avx512f_clflush(char *dest, int c, size_t len);
+void memset_mov_avx512f_clflushopt(char *dest, int c, size_t len);
+void memset_mov_avx512f_clwb(char *dest, int c, size_t len);
+void memset_mov_avx512f_empty(char *dest, int c, size_t len);
+void memset_mov_avx512f_noflush(char *dest, int c, size_t len);
+void memset_movnt_avx512f_clflush(char *dest, int c, size_t len);
+void memset_movnt_avx512f_clflushopt(char *dest, int c, size_t len);
+void memset_movnt_avx512f_clwb(char *dest, int c, size_t len);
+void memset_movnt_avx512f_empty(char *dest, int c, size_t len);
+void memset_movnt_avx512f_noflush(char *dest, int c, size_t len);
+#endif
+
+extern size_t Movnt_threshold;
+
+/*
+ * SSE2/AVX1 only:
+ *
+ * How much data WC buffers can hold at the same time, after which sfence
+ * is needed to flush them.
+ *
+ * For some reason sfence affects performance of reading from DRAM, so we have
+ * to prefetch the source data earlier.
+ */
+#define PERF_BARRIER_SIZE (12 * CACHELINE_SIZE /*  768 */)
+
+/*
+ * How much to prefetch initially.
+ * Cannot be bigger than the size of L1 (32kB) - PERF_BARRIER_SIZE.
+ */
+#define INI_PREFETCH_SIZE (64 * CACHELINE_SIZE /* 4096 */)
+
+static force_inline void
+prefetch(const char *addr)
+{
+       _mm_prefetch(addr, _MM_HINT_T0);
+}
+
+static force_inline void
+prefetch_ini_fw(const char *src, size_t len)
+{
+       size_t pref = MIN(len, INI_PREFETCH_SIZE);
+       for (size_t i = 0; i < pref; i += CACHELINE_SIZE)
+               prefetch(src + i);
+}
+
+static force_inline void
+prefetch_ini_bw(const char *src, size_t len)
+{
+       size_t pref = MIN(len, INI_PREFETCH_SIZE);
+       for (size_t i = 0; i < pref; i += CACHELINE_SIZE)
+               prefetch(src - i);
+}
+
+static force_inline void
+prefetch_next_fw(const char *src, const char *srcend)
+{
+       const char *begin = src + INI_PREFETCH_SIZE;
+       const char *end = begin + PERF_BARRIER_SIZE;
+       if (end > srcend)
+               end = srcend;
+
+       for (const char *addr = begin; addr < end; addr += CACHELINE_SIZE)
+               prefetch(addr);
+}
+
+static force_inline void
+prefetch_next_bw(const char *src, const char *srcbegin)
+{
+       const char *begin = src - INI_PREFETCH_SIZE;
+       const char *end = begin - PERF_BARRIER_SIZE;
+       if (end < srcbegin)
+               end = srcbegin;
+
+       for (const char *addr = begin; addr >= end; addr -= CACHELINE_SIZE)
+               prefetch(addr);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx.h b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx.h
new file mode 100644 (file)
index 0000000..be84476
--- /dev/null
@@ -0,0 +1,97 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMSET_AVX_H
+#define PMEM2_MEMSET_AVX_H
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "avx.h"
+#include "out.h"
+
+static force_inline void
+memset_small_avx_noflush(char *dest, __m256i ymm, size_t len)
+{
+       ASSERT(len <= 64);
+
+       if (len <= 8)
+               goto le8;
+       if (len <= 32)
+               goto le32;
+
+       /* 33..64 */
+       _mm256_storeu_si256((__m256i *)dest, ymm);
+       _mm256_storeu_si256((__m256i *)(dest + len - 32), ymm);
+       return;
+
+le32:
+       if (len > 16) {
+               /* 17..32 */
+               __m128i xmm = m256_get16b(ymm);
+
+               _mm_storeu_si128((__m128i *)dest, xmm);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
+               return;
+       }
+
+       /* 9..16 */
+       uint64_t d8 = m256_get8b(ymm);
+
+       *(ua_uint64_t *)dest = d8;
+       *(ua_uint64_t *)(dest + len - 8) = d8;
+       return;
+
+le8:
+       if (len <= 2)
+               goto le2;
+
+       if (len > 4) {
+               /* 5..8 */
+               uint32_t d = m256_get4b(ymm);
+
+               *(ua_uint32_t *)dest = d;
+               *(ua_uint32_t *)(dest + len - 4) = d;
+               return;
+       }
+
+       /* 3..4 */
+       uint16_t d2 = m256_get2b(ymm);
+
+       *(ua_uint16_t *)dest = d2;
+       *(ua_uint16_t *)(dest + len - 2) = d2;
+       return;
+
+le2:
+       if (len == 2) {
+               uint16_t d2 = m256_get2b(ymm);
+
+               *(ua_uint16_t *)dest = d2;
+               return;
+       }
+
+       *(uint8_t *)dest = (uint8_t)m256_get2b(ymm);
+}
+
+static force_inline void
+memset_small_avx(char *dest, __m256i ymm, size_t len, flush_fn flush)
+{
+       /*
+        * pmemcheck complains about "overwritten stores before they were made
+        * persistent" for overlapping stores (last instruction in each code
+        * path) in the optimized version.
+        * libc's memset also does that, so we can't use it here.
+        */
+       if (On_pmemcheck) {
+               memset_nodrain_generic(dest, (uint8_t)m256_get2b(ymm),
+                                               len, PMEM2_F_MEM_NOFLUSH, NULL);
+       } else {
+               memset_small_avx_noflush(dest, ymm, len);
+       }
+
+       flush(dest, len);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx512f.h b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_avx512f.h
new file mode 100644 (file)
index 0000000..a0f6cf9
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMSET_AVX512F_H
+#define PMEM2_MEMSET_AVX512F_H
+
+#include <stddef.h>
+
+#include "memset_avx.h"
+
+static force_inline void
+memset_small_avx512f(char *dest, __m256i ymm, size_t len, flush_fn flush)
+{
+       /* We can't do better than AVX here. */
+       memset_small_avx(dest, ymm, len, flush);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx.c
new file mode 100644 (file)
index 0000000..4a4d5f6
--- /dev/null
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_avx.h"
+#include "out.h"
+#include "valgrind_internal.h"
+
+static force_inline void
+mm256_stream_si256(char *dest, unsigned idx, __m256i src)
+{
+       _mm256_stream_si256((__m256i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memset_movnt8x64b(char *dest, __m256i ymm)
+{
+       mm256_stream_si256(dest, 0, ymm);
+       mm256_stream_si256(dest, 1, ymm);
+       mm256_stream_si256(dest, 2, ymm);
+       mm256_stream_si256(dest, 3, ymm);
+       mm256_stream_si256(dest, 4, ymm);
+       mm256_stream_si256(dest, 5, ymm);
+       mm256_stream_si256(dest, 6, ymm);
+       mm256_stream_si256(dest, 7, ymm);
+       mm256_stream_si256(dest, 8, ymm);
+       mm256_stream_si256(dest, 9, ymm);
+       mm256_stream_si256(dest, 10, ymm);
+       mm256_stream_si256(dest, 11, ymm);
+       mm256_stream_si256(dest, 12, ymm);
+       mm256_stream_si256(dest, 13, ymm);
+       mm256_stream_si256(dest, 14, ymm);
+       mm256_stream_si256(dest, 15, ymm);
+}
+
+static force_inline void
+memset_movnt4x64b(char *dest, __m256i ymm)
+{
+       mm256_stream_si256(dest, 0, ymm);
+       mm256_stream_si256(dest, 1, ymm);
+       mm256_stream_si256(dest, 2, ymm);
+       mm256_stream_si256(dest, 3, ymm);
+       mm256_stream_si256(dest, 4, ymm);
+       mm256_stream_si256(dest, 5, ymm);
+       mm256_stream_si256(dest, 6, ymm);
+       mm256_stream_si256(dest, 7, ymm);
+}
+
+static force_inline void
+memset_movnt2x64b(char *dest, __m256i ymm)
+{
+       mm256_stream_si256(dest, 0, ymm);
+       mm256_stream_si256(dest, 1, ymm);
+       mm256_stream_si256(dest, 2, ymm);
+       mm256_stream_si256(dest, 3, ymm);
+}
+
+static force_inline void
+memset_movnt1x64b(char *dest, __m256i ymm)
+{
+       mm256_stream_si256(dest, 0, ymm);
+       mm256_stream_si256(dest, 1, ymm);
+}
+
+static force_inline void
+memset_movnt1x32b(char *dest, __m256i ymm)
+{
+       mm256_stream_si256(dest, 0, ymm);
+}
+
+static force_inline void
+memset_movnt1x16b(char *dest, __m256i ymm)
+{
+       __m128i xmm0 = m256_get16b(ymm);
+
+       _mm_stream_si128((__m128i *)dest, xmm0);
+}
+
+static force_inline void
+memset_movnt1x8b(char *dest, __m256i ymm)
+{
+       uint64_t x = m256_get8b(ymm);
+
+       _mm_stream_si64((long long *)dest, (long long)x);
+}
+
+static force_inline void
+memset_movnt1x4b(char *dest, __m256i ymm)
+{
+       uint32_t x = m256_get4b(ymm);
+
+       _mm_stream_si32((int *)dest, (int)x);
+}
+
+static force_inline void
+memset_movnt_avx(char *dest, int c, size_t len, flush_fn flush,
+               barrier_fn barrier, perf_barrier_fn perf_barrier)
+{
+       char *orig_dest = dest;
+       size_t orig_len = len;
+
+       __m256i ymm = _mm256_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_avx(dest, ymm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= PERF_BARRIER_SIZE) {
+               memset_movnt8x64b(dest, ymm);
+               dest += 8 * 64;
+               len -= 8 * 64;
+
+               memset_movnt4x64b(dest, ymm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (8 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       if (len >= 8 * 64) {
+               memset_movnt8x64b(dest, ymm);
+               dest += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memset_movnt4x64b(dest, ymm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_movnt2x64b(dest, ymm);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_movnt1x64b(dest, ymm);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memset_movnt1x32b(dest, ymm);
+               else if (len == 16)
+                       memset_movnt1x16b(dest, ymm);
+               else if (len == 8)
+                       memset_movnt1x8b(dest, ymm);
+               else if (len == 4)
+                       memset_movnt1x4b(dest, ymm);
+               else
+                       goto nonnt;
+
+               goto end;
+       }
+
+nonnt:
+       memset_small_avx(dest, ymm, len, flush);
+end:
+       avx_zeroupper();
+
+       barrier();
+
+       VALGRIND_DO_FLUSH(orig_dest, orig_len);
+}
+
+/* variants without perf_barrier */
+
+void
+memset_movnt_avx_noflush_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, noflush, barrier_after_ntstores,
+                       no_barrier);
+}
+
+void
+memset_movnt_avx_empty_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_empty_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_avx_clflush_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clflush_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_avx_clflushopt_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_avx_clwb_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+/* variants with perf_barrier */
+
+void
+memset_movnt_avx_noflush_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, noflush, barrier_after_ntstores,
+                       wc_barrier);
+}
+
+void
+memset_movnt_avx_empty_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_empty_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_avx_clflush_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clflush_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_avx_clflushopt_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_avx_clwb_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx(dest, c, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx512f.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_avx512f.c
new file mode 100644 (file)
index 0000000..b29402a
--- /dev/null
@@ -0,0 +1,282 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_avx512f.h"
+#include "out.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+static force_inline void
+mm512_stream_si512(char *dest, unsigned idx, __m512i src)
+{
+       _mm512_stream_si512((__m512i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memset_movnt32x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+       mm512_stream_si512(dest, 1, zmm);
+       mm512_stream_si512(dest, 2, zmm);
+       mm512_stream_si512(dest, 3, zmm);
+       mm512_stream_si512(dest, 4, zmm);
+       mm512_stream_si512(dest, 5, zmm);
+       mm512_stream_si512(dest, 6, zmm);
+       mm512_stream_si512(dest, 7, zmm);
+       mm512_stream_si512(dest, 8, zmm);
+       mm512_stream_si512(dest, 9, zmm);
+       mm512_stream_si512(dest, 10, zmm);
+       mm512_stream_si512(dest, 11, zmm);
+       mm512_stream_si512(dest, 12, zmm);
+       mm512_stream_si512(dest, 13, zmm);
+       mm512_stream_si512(dest, 14, zmm);
+       mm512_stream_si512(dest, 15, zmm);
+       mm512_stream_si512(dest, 16, zmm);
+       mm512_stream_si512(dest, 17, zmm);
+       mm512_stream_si512(dest, 18, zmm);
+       mm512_stream_si512(dest, 19, zmm);
+       mm512_stream_si512(dest, 20, zmm);
+       mm512_stream_si512(dest, 21, zmm);
+       mm512_stream_si512(dest, 22, zmm);
+       mm512_stream_si512(dest, 23, zmm);
+       mm512_stream_si512(dest, 24, zmm);
+       mm512_stream_si512(dest, 25, zmm);
+       mm512_stream_si512(dest, 26, zmm);
+       mm512_stream_si512(dest, 27, zmm);
+       mm512_stream_si512(dest, 28, zmm);
+       mm512_stream_si512(dest, 29, zmm);
+       mm512_stream_si512(dest, 30, zmm);
+       mm512_stream_si512(dest, 31, zmm);
+}
+
+static force_inline void
+memset_movnt16x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+       mm512_stream_si512(dest, 1, zmm);
+       mm512_stream_si512(dest, 2, zmm);
+       mm512_stream_si512(dest, 3, zmm);
+       mm512_stream_si512(dest, 4, zmm);
+       mm512_stream_si512(dest, 5, zmm);
+       mm512_stream_si512(dest, 6, zmm);
+       mm512_stream_si512(dest, 7, zmm);
+       mm512_stream_si512(dest, 8, zmm);
+       mm512_stream_si512(dest, 9, zmm);
+       mm512_stream_si512(dest, 10, zmm);
+       mm512_stream_si512(dest, 11, zmm);
+       mm512_stream_si512(dest, 12, zmm);
+       mm512_stream_si512(dest, 13, zmm);
+       mm512_stream_si512(dest, 14, zmm);
+       mm512_stream_si512(dest, 15, zmm);
+}
+
+static force_inline void
+memset_movnt8x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+       mm512_stream_si512(dest, 1, zmm);
+       mm512_stream_si512(dest, 2, zmm);
+       mm512_stream_si512(dest, 3, zmm);
+       mm512_stream_si512(dest, 4, zmm);
+       mm512_stream_si512(dest, 5, zmm);
+       mm512_stream_si512(dest, 6, zmm);
+       mm512_stream_si512(dest, 7, zmm);
+}
+
+static force_inline void
+memset_movnt4x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+       mm512_stream_si512(dest, 1, zmm);
+       mm512_stream_si512(dest, 2, zmm);
+       mm512_stream_si512(dest, 3, zmm);
+}
+
+static force_inline void
+memset_movnt2x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+       mm512_stream_si512(dest, 1, zmm);
+}
+
+static force_inline void
+memset_movnt1x64b(char *dest, __m512i zmm)
+{
+       mm512_stream_si512(dest, 0, zmm);
+}
+
+static force_inline void
+memset_movnt1x32b(char *dest, __m256i ymm)
+{
+       _mm256_stream_si256((__m256i *)dest, ymm);
+}
+
+static force_inline void
+memset_movnt1x16b(char *dest, __m256i ymm)
+{
+       __m128i xmm = _mm256_extracti128_si256(ymm, 0);
+
+       _mm_stream_si128((__m128i *)dest, xmm);
+}
+
+static force_inline void
+memset_movnt1x8b(char *dest, __m256i ymm)
+{
+       uint64_t x = m256_get8b(ymm);
+
+       _mm_stream_si64((long long *)dest, (long long)x);
+}
+
+static force_inline void
+memset_movnt1x4b(char *dest, __m256i ymm)
+{
+       uint32_t x = m256_get4b(ymm);
+
+       _mm_stream_si32((int *)dest, (int)x);
+}
+
+static force_inline void
+memset_movnt_avx512f(char *dest, int c, size_t len, flush_fn flush,
+               barrier_fn barrier)
+{
+       char *orig_dest = dest;
+       size_t orig_len = len;
+
+       __m512i zmm = _mm512_set1_epi8((char)c);
+       /*
+        * Can't use _mm512_extracti64x4_epi64, because some versions of gcc
+        * crash. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
+        */
+       __m256i ymm = _mm256_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_avx512f(dest, ymm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 32 * 64) {
+               memset_movnt32x64b(dest, zmm);
+               dest += 32 * 64;
+               len -= 32 * 64;
+       }
+
+       if (len >= 16 * 64) {
+               memset_movnt16x64b(dest, zmm);
+               dest += 16 * 64;
+               len -= 16 * 64;
+       }
+
+       if (len >= 8 * 64) {
+               memset_movnt8x64b(dest, zmm);
+               dest += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memset_movnt4x64b(dest, zmm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_movnt2x64b(dest, zmm);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_movnt1x64b(dest, zmm);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memset_movnt1x32b(dest, ymm);
+               else if (len == 16)
+                       memset_movnt1x16b(dest, ymm);
+               else if (len == 8)
+                       memset_movnt1x8b(dest, ymm);
+               else if (len == 4)
+                       memset_movnt1x4b(dest, ymm);
+               else
+                       goto nonnt;
+
+               goto end;
+       }
+
+nonnt:
+       memset_small_avx512f(dest, ymm, len, flush);
+end:
+       avx_zeroupper();
+
+       barrier();
+
+       VALGRIND_DO_FLUSH(orig_dest, orig_len);
+}
+
+void
+memset_movnt_avx512f_noflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx512f(dest, c, len, noflush, barrier_after_ntstores);
+}
+
+void
+memset_movnt_avx512f_empty(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx512f(dest, c, len, flush_empty_nolog,
+                       barrier_after_ntstores);
+}
+
+void
+memset_movnt_avx512f_clflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx512f(dest, c, len, flush_clflush_nolog,
+                       barrier_after_ntstores);
+}
+
+void
+memset_movnt_avx512f_clflushopt(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx512f(dest, c, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores);
+}
+
+void
+memset_movnt_avx512f_clwb(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_avx512f(dest, c, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_sse2.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_nt_sse2.c
new file mode 100644 (file)
index 0000000..5590a65
--- /dev/null
@@ -0,0 +1,273 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_sse2.h"
+#include "out.h"
+#include "valgrind_internal.h"
+
+static force_inline void
+mm_stream_si128(char *dest, unsigned idx, __m128i src)
+{
+       _mm_stream_si128((__m128i *)dest + idx, src);
+       barrier();
+}
+
+static force_inline void
+memset_movnt4x64b(char *dest, __m128i xmm)
+{
+       mm_stream_si128(dest, 0, xmm);
+       mm_stream_si128(dest, 1, xmm);
+       mm_stream_si128(dest, 2, xmm);
+       mm_stream_si128(dest, 3, xmm);
+       mm_stream_si128(dest, 4, xmm);
+       mm_stream_si128(dest, 5, xmm);
+       mm_stream_si128(dest, 6, xmm);
+       mm_stream_si128(dest, 7, xmm);
+       mm_stream_si128(dest, 8, xmm);
+       mm_stream_si128(dest, 9, xmm);
+       mm_stream_si128(dest, 10, xmm);
+       mm_stream_si128(dest, 11, xmm);
+       mm_stream_si128(dest, 12, xmm);
+       mm_stream_si128(dest, 13, xmm);
+       mm_stream_si128(dest, 14, xmm);
+       mm_stream_si128(dest, 15, xmm);
+}
+
+static force_inline void
+memset_movnt2x64b(char *dest, __m128i xmm)
+{
+       mm_stream_si128(dest, 0, xmm);
+       mm_stream_si128(dest, 1, xmm);
+       mm_stream_si128(dest, 2, xmm);
+       mm_stream_si128(dest, 3, xmm);
+       mm_stream_si128(dest, 4, xmm);
+       mm_stream_si128(dest, 5, xmm);
+       mm_stream_si128(dest, 6, xmm);
+       mm_stream_si128(dest, 7, xmm);
+}
+
+static force_inline void
+memset_movnt1x64b(char *dest, __m128i xmm)
+{
+       mm_stream_si128(dest, 0, xmm);
+       mm_stream_si128(dest, 1, xmm);
+       mm_stream_si128(dest, 2, xmm);
+       mm_stream_si128(dest, 3, xmm);
+}
+
+static force_inline void
+memset_movnt1x32b(char *dest, __m128i xmm)
+{
+       mm_stream_si128(dest, 0, xmm);
+       mm_stream_si128(dest, 1, xmm);
+}
+
+static force_inline void
+memset_movnt1x16b(char *dest, __m128i xmm)
+{
+       _mm_stream_si128((__m128i *)dest, xmm);
+}
+
+static force_inline void
+memset_movnt1x8b(char *dest, __m128i xmm)
+{
+       uint64_t x = (uint64_t)_mm_cvtsi128_si64(xmm);
+
+       _mm_stream_si64((long long *)dest, (long long)x);
+}
+
+static force_inline void
+memset_movnt1x4b(char *dest, __m128i xmm)
+{
+       uint32_t x = (uint32_t)_mm_cvtsi128_si32(xmm);
+
+       _mm_stream_si32((int *)dest, (int)x);
+}
+
+static force_inline void
+memset_movnt_sse2(char *dest, int c, size_t len, flush_fn flush,
+               barrier_fn barrier, perf_barrier_fn perf_barrier)
+{
+       char *orig_dest = dest;
+       size_t orig_len = len;
+
+       __m128i xmm = _mm_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_sse2(dest, xmm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= PERF_BARRIER_SIZE) {
+               memset_movnt4x64b(dest, xmm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+
+               memset_movnt4x64b(dest, xmm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+
+               memset_movnt4x64b(dest, xmm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+
+               COMPILE_ERROR_ON(PERF_BARRIER_SIZE != (4 + 4 + 4) * 64);
+
+               if (len)
+                       perf_barrier();
+       }
+
+       while (len >= 4 * 64) {
+               memset_movnt4x64b(dest, xmm);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_movnt2x64b(dest, xmm);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_movnt1x64b(dest, xmm);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len == 0)
+               goto end;
+
+       /* There's no point in using more than 1 nt store for 1 cache line. */
+       if (util_is_pow2(len)) {
+               if (len == 32)
+                       memset_movnt1x32b(dest, xmm);
+               else if (len == 16)
+                       memset_movnt1x16b(dest, xmm);
+               else if (len == 8)
+                       memset_movnt1x8b(dest, xmm);
+               else if (len == 4)
+                       memset_movnt1x4b(dest, xmm);
+               else
+                       goto nonnt;
+
+               goto end;
+       }
+
+nonnt:
+       memset_small_sse2(dest, xmm, len, flush);
+end:
+       barrier();
+
+       VALGRIND_DO_FLUSH(orig_dest, orig_len);
+}
+
+/* variants without perf_barrier */
+
+void
+memset_movnt_sse2_noflush_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, noflush, barrier_after_ntstores,
+                       no_barrier);
+}
+
+void
+memset_movnt_sse2_empty_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_empty_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_sse2_clflush_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clflush_nolog,
+                       barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_sse2_clflushopt_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+void
+memset_movnt_sse2_clwb_nobarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, no_barrier);
+}
+
+/* variants with perf_barrier */
+
+void
+memset_movnt_sse2_noflush_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, noflush, barrier_after_ntstores,
+                       wc_barrier);
+}
+
+void
+memset_movnt_sse2_empty_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_empty_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_sse2_clflush_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clflush_nolog,
+                       barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_sse2_clflushopt_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clflushopt_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
+
+void
+memset_movnt_sse2_clwb_wcbarrier(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_movnt_sse2(dest, c, len, flush_clwb_nolog,
+                       no_barrier_after_ntstores, wc_barrier);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_sse2.h b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_sse2.h
new file mode 100644 (file)
index 0000000..6d9b22e
--- /dev/null
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+#ifndef PMEM2_MEMSET_SSE2_H
+#define PMEM2_MEMSET_SSE2_H
+
+#include <xmmintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "out.h"
+
+static force_inline void
+memset_small_sse2_noflush(char *dest, __m128i xmm, size_t len)
+{
+       ASSERT(len <= 64);
+
+       if (len <= 8)
+               goto le8;
+       if (len <= 32)
+               goto le32;
+
+       if (len > 48) {
+               /* 49..64 */
+               _mm_storeu_si128((__m128i *)(dest + 0), xmm);
+               _mm_storeu_si128((__m128i *)(dest + 16), xmm);
+               _mm_storeu_si128((__m128i *)(dest + 32), xmm);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
+               return;
+       }
+
+       /* 33..48 */
+       _mm_storeu_si128((__m128i *)(dest + 0), xmm);
+       _mm_storeu_si128((__m128i *)(dest + 16), xmm);
+       _mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
+       return;
+
+le32:
+       if (len > 16) {
+               /* 17..32 */
+               _mm_storeu_si128((__m128i *)(dest + 0), xmm);
+               _mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
+               return;
+       }
+
+       /* 9..16 */
+       uint64_t d8 = (uint64_t)_mm_cvtsi128_si64(xmm);
+
+       *(ua_uint64_t *)dest = d8;
+       *(ua_uint64_t *)(dest + len - 8) = d8;
+       return;
+
+le8:
+       if (len <= 2)
+               goto le2;
+
+       if (len > 4) {
+               /* 5..8 */
+               uint32_t d4 = (uint32_t)_mm_cvtsi128_si32(xmm);
+
+               *(ua_uint32_t *)dest = d4;
+               *(ua_uint32_t *)(dest + len - 4) = d4;
+               return;
+       }
+
+       /* 3..4 */
+       uint16_t d2 = (uint16_t)(uint32_t)_mm_cvtsi128_si32(xmm);
+
+       *(ua_uint16_t *)dest = d2;
+       *(ua_uint16_t *)(dest + len - 2) = d2;
+       return;
+
+le2:
+       if (len == 2) {
+               uint16_t d2 = (uint16_t)(uint32_t)_mm_cvtsi128_si32(xmm);
+
+               *(ua_uint16_t *)dest = d2;
+               return;
+       }
+
+       *(uint8_t *)dest = (uint8_t)_mm_cvtsi128_si32(xmm);
+}
+
+static force_inline void
+memset_small_sse2(char *dest, __m128i xmm, size_t len, flush_fn flush)
+{
+       /*
+        * pmemcheck complains about "overwritten stores before they were made
+        * persistent" for overlapping stores (last instruction in each code
+        * path) in the optimized version.
+        * libc's memset also does that, so we can't use it here.
+        */
+       if (On_pmemcheck) {
+               memset_nodrain_generic(dest, (uint8_t)_mm_cvtsi128_si32(xmm),
+                               len, PMEM2_F_MEM_NOFLUSH, NULL);
+       } else {
+               memset_small_sse2_noflush(dest, xmm, len);
+       }
+
+       flush(dest, len);
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx.c
new file mode 100644 (file)
index 0000000..4c989d8
--- /dev/null
@@ -0,0 +1,178 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_avx.h"
+
+static force_inline void
+mm256_store_si256(char *dest, unsigned idx, __m256i src)
+{
+       _mm256_store_si256((__m256i *)dest + idx, src);
+}
+
+static force_inline void
+memset_mov8x64b(char *dest, __m256i ymm, flush64b_fn flush64b)
+{
+       mm256_store_si256(dest, 0, ymm);
+       mm256_store_si256(dest, 1, ymm);
+       mm256_store_si256(dest, 2, ymm);
+       mm256_store_si256(dest, 3, ymm);
+       mm256_store_si256(dest, 4, ymm);
+       mm256_store_si256(dest, 5, ymm);
+       mm256_store_si256(dest, 6, ymm);
+       mm256_store_si256(dest, 7, ymm);
+       mm256_store_si256(dest, 8, ymm);
+       mm256_store_si256(dest, 9, ymm);
+       mm256_store_si256(dest, 10, ymm);
+       mm256_store_si256(dest, 11, ymm);
+       mm256_store_si256(dest, 12, ymm);
+       mm256_store_si256(dest, 13, ymm);
+       mm256_store_si256(dest, 14, ymm);
+       mm256_store_si256(dest, 15, ymm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+}
+
+static force_inline void
+memset_mov4x64b(char *dest, __m256i ymm, flush64b_fn flush64b)
+{
+       mm256_store_si256(dest, 0, ymm);
+       mm256_store_si256(dest, 1, ymm);
+       mm256_store_si256(dest, 2, ymm);
+       mm256_store_si256(dest, 3, ymm);
+       mm256_store_si256(dest, 4, ymm);
+       mm256_store_si256(dest, 5, ymm);
+       mm256_store_si256(dest, 6, ymm);
+       mm256_store_si256(dest, 7, ymm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memset_mov2x64b(char *dest, __m256i ymm, flush64b_fn flush64b)
+{
+       mm256_store_si256(dest, 0, ymm);
+       mm256_store_si256(dest, 1, ymm);
+       mm256_store_si256(dest, 2, ymm);
+       mm256_store_si256(dest, 3, ymm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memset_mov1x64b(char *dest, __m256i ymm, flush64b_fn flush64b)
+{
+       mm256_store_si256(dest, 0, ymm);
+       mm256_store_si256(dest, 1, ymm);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memset_mov_avx(char *dest, int c, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       __m256i ymm = _mm256_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_avx(dest, ymm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 8 * 64) {
+               memset_mov8x64b(dest, ymm, flush64b);
+               dest += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memset_mov4x64b(dest, ymm, flush64b);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_mov2x64b(dest, ymm, flush64b);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_mov1x64b(dest, ymm, flush64b);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memset_small_avx(dest, ymm, len, flush);
+
+       avx_zeroupper();
+}
+
+void
+memset_mov_avx_noflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx(dest, c, len, noflush, noflush64b);
+}
+
+void
+memset_mov_avx_empty(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx(dest, c, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memset_mov_avx_clflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx(dest, c, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memset_mov_avx_clflushopt(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx(dest, c, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memset_mov_avx_clwb(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx(dest, c, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx512f.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_avx512f.c
new file mode 100644 (file)
index 0000000..f2127f2
--- /dev/null
@@ -0,0 +1,285 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "avx.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_avx512f.h"
+
+static force_inline void
+mm512_store_si512(char *dest, unsigned idx, __m512i src)
+{
+       _mm512_store_si512((__m512i *)dest + idx, src);
+}
+
+static force_inline void
+memset_mov32x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+       mm512_store_si512(dest, 1, zmm);
+       mm512_store_si512(dest, 2, zmm);
+       mm512_store_si512(dest, 3, zmm);
+       mm512_store_si512(dest, 4, zmm);
+       mm512_store_si512(dest, 5, zmm);
+       mm512_store_si512(dest, 6, zmm);
+       mm512_store_si512(dest, 7, zmm);
+       mm512_store_si512(dest, 8, zmm);
+       mm512_store_si512(dest, 9, zmm);
+       mm512_store_si512(dest, 10, zmm);
+       mm512_store_si512(dest, 11, zmm);
+       mm512_store_si512(dest, 12, zmm);
+       mm512_store_si512(dest, 13, zmm);
+       mm512_store_si512(dest, 14, zmm);
+       mm512_store_si512(dest, 15, zmm);
+       mm512_store_si512(dest, 16, zmm);
+       mm512_store_si512(dest, 17, zmm);
+       mm512_store_si512(dest, 18, zmm);
+       mm512_store_si512(dest, 19, zmm);
+       mm512_store_si512(dest, 20, zmm);
+       mm512_store_si512(dest, 21, zmm);
+       mm512_store_si512(dest, 22, zmm);
+       mm512_store_si512(dest, 23, zmm);
+       mm512_store_si512(dest, 24, zmm);
+       mm512_store_si512(dest, 25, zmm);
+       mm512_store_si512(dest, 26, zmm);
+       mm512_store_si512(dest, 27, zmm);
+       mm512_store_si512(dest, 28, zmm);
+       mm512_store_si512(dest, 29, zmm);
+       mm512_store_si512(dest, 30, zmm);
+       mm512_store_si512(dest, 31, zmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+       flush64b(dest + 8 * 64);
+       flush64b(dest + 9 * 64);
+       flush64b(dest + 10 * 64);
+       flush64b(dest + 11 * 64);
+       flush64b(dest + 12 * 64);
+       flush64b(dest + 13 * 64);
+       flush64b(dest + 14 * 64);
+       flush64b(dest + 15 * 64);
+       flush64b(dest + 16 * 64);
+       flush64b(dest + 17 * 64);
+       flush64b(dest + 18 * 64);
+       flush64b(dest + 19 * 64);
+       flush64b(dest + 20 * 64);
+       flush64b(dest + 21 * 64);
+       flush64b(dest + 22 * 64);
+       flush64b(dest + 23 * 64);
+       flush64b(dest + 24 * 64);
+       flush64b(dest + 25 * 64);
+       flush64b(dest + 26 * 64);
+       flush64b(dest + 27 * 64);
+       flush64b(dest + 28 * 64);
+       flush64b(dest + 29 * 64);
+       flush64b(dest + 30 * 64);
+       flush64b(dest + 31 * 64);
+}
+
+static force_inline void
+memset_mov16x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+       mm512_store_si512(dest, 1, zmm);
+       mm512_store_si512(dest, 2, zmm);
+       mm512_store_si512(dest, 3, zmm);
+       mm512_store_si512(dest, 4, zmm);
+       mm512_store_si512(dest, 5, zmm);
+       mm512_store_si512(dest, 6, zmm);
+       mm512_store_si512(dest, 7, zmm);
+       mm512_store_si512(dest, 8, zmm);
+       mm512_store_si512(dest, 9, zmm);
+       mm512_store_si512(dest, 10, zmm);
+       mm512_store_si512(dest, 11, zmm);
+       mm512_store_si512(dest, 12, zmm);
+       mm512_store_si512(dest, 13, zmm);
+       mm512_store_si512(dest, 14, zmm);
+       mm512_store_si512(dest, 15, zmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+       flush64b(dest + 8 * 64);
+       flush64b(dest + 9 * 64);
+       flush64b(dest + 10 * 64);
+       flush64b(dest + 11 * 64);
+       flush64b(dest + 12 * 64);
+       flush64b(dest + 13 * 64);
+       flush64b(dest + 14 * 64);
+       flush64b(dest + 15 * 64);
+}
+
+static force_inline void
+memset_mov8x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+       mm512_store_si512(dest, 1, zmm);
+       mm512_store_si512(dest, 2, zmm);
+       mm512_store_si512(dest, 3, zmm);
+       mm512_store_si512(dest, 4, zmm);
+       mm512_store_si512(dest, 5, zmm);
+       mm512_store_si512(dest, 6, zmm);
+       mm512_store_si512(dest, 7, zmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+       flush64b(dest + 4 * 64);
+       flush64b(dest + 5 * 64);
+       flush64b(dest + 6 * 64);
+       flush64b(dest + 7 * 64);
+}
+
+static force_inline void
+memset_mov4x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+       mm512_store_si512(dest, 1, zmm);
+       mm512_store_si512(dest, 2, zmm);
+       mm512_store_si512(dest, 3, zmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memset_mov2x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+       mm512_store_si512(dest, 1, zmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memset_mov1x64b(char *dest, __m512i zmm, flush64b_fn flush64b)
+{
+       mm512_store_si512(dest, 0, zmm);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memset_mov_avx512f(char *dest, int c, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       __m512i zmm = _mm512_set1_epi8((char)c);
+       /* See comment in memset_movnt_avx512f */
+       __m256i ymm = _mm256_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_avx512f(dest, ymm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 32 * 64) {
+               memset_mov32x64b(dest, zmm, flush64b);
+               dest += 32 * 64;
+               len -= 32 * 64;
+       }
+
+       if (len >= 16 * 64) {
+               memset_mov16x64b(dest, zmm, flush64b);
+               dest += 16 * 64;
+               len -= 16 * 64;
+       }
+
+       if (len >= 8 * 64) {
+               memset_mov8x64b(dest, zmm, flush64b);
+               dest += 8 * 64;
+               len -= 8 * 64;
+       }
+
+       if (len >= 4 * 64) {
+               memset_mov4x64b(dest, zmm, flush64b);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_mov2x64b(dest, zmm, flush64b);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_mov1x64b(dest, zmm, flush64b);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memset_small_avx512f(dest, ymm, len, flush);
+
+       avx_zeroupper();
+}
+
+void
+memset_mov_avx512f_noflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx512f(dest, c, len, noflush, noflush64b);
+}
+
+void
+memset_mov_avx512f_empty(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx512f(dest, c, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memset_mov_avx512f_clflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx512f(dest, c, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memset_mov_avx512f_clflushopt(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx512f(dest, c, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memset_mov_avx512f_clwb(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_avx512f(dest, c, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_sse2.c b/ceph/src/pmdk/src/libpmem2/x86_64/memset/memset_t_sse2.c
new file mode 100644 (file)
index 0000000..49a4a5c
--- /dev/null
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2020, Intel Corporation */
+
+#include <immintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "pmem2_arch.h"
+#include "flush.h"
+#include "memcpy_memset.h"
+#include "memset_sse2.h"
+
+static force_inline void
+mm_store_si128(char *dest, unsigned idx, __m128i src)
+{
+       _mm_store_si128((__m128i *)dest + idx, src);
+}
+
+static force_inline void
+memset_mov4x64b(char *dest, __m128i xmm, flush64b_fn flush64b)
+{
+       mm_store_si128(dest, 0, xmm);
+       mm_store_si128(dest, 1, xmm);
+       mm_store_si128(dest, 2, xmm);
+       mm_store_si128(dest, 3, xmm);
+       mm_store_si128(dest, 4, xmm);
+       mm_store_si128(dest, 5, xmm);
+       mm_store_si128(dest, 6, xmm);
+       mm_store_si128(dest, 7, xmm);
+       mm_store_si128(dest, 8, xmm);
+       mm_store_si128(dest, 9, xmm);
+       mm_store_si128(dest, 10, xmm);
+       mm_store_si128(dest, 11, xmm);
+       mm_store_si128(dest, 12, xmm);
+       mm_store_si128(dest, 13, xmm);
+       mm_store_si128(dest, 14, xmm);
+       mm_store_si128(dest, 15, xmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+       flush64b(dest + 2 * 64);
+       flush64b(dest + 3 * 64);
+}
+
+static force_inline void
+memset_mov2x64b(char *dest, __m128i xmm, flush64b_fn flush64b)
+{
+       mm_store_si128(dest, 0, xmm);
+       mm_store_si128(dest, 1, xmm);
+       mm_store_si128(dest, 2, xmm);
+       mm_store_si128(dest, 3, xmm);
+       mm_store_si128(dest, 4, xmm);
+       mm_store_si128(dest, 5, xmm);
+       mm_store_si128(dest, 6, xmm);
+       mm_store_si128(dest, 7, xmm);
+
+       flush64b(dest + 0 * 64);
+       flush64b(dest + 1 * 64);
+}
+
+static force_inline void
+memset_mov1x64b(char *dest, __m128i xmm, flush64b_fn flush64b)
+{
+       mm_store_si128(dest, 0, xmm);
+       mm_store_si128(dest, 1, xmm);
+       mm_store_si128(dest, 2, xmm);
+       mm_store_si128(dest, 3, xmm);
+
+       flush64b(dest + 0 * 64);
+}
+
+static force_inline void
+memset_mov_sse2(char *dest, int c, size_t len,
+               flush_fn flush, flush64b_fn flush64b)
+{
+       __m128i xmm = _mm_set1_epi8((char)c);
+
+       size_t cnt = (uint64_t)dest & 63;
+       if (cnt > 0) {
+               cnt = 64 - cnt;
+
+               if (cnt > len)
+                       cnt = len;
+
+               memset_small_sse2(dest, xmm, cnt, flush);
+
+               dest += cnt;
+               len -= cnt;
+       }
+
+       while (len >= 4 * 64) {
+               memset_mov4x64b(dest, xmm, flush64b);
+               dest += 4 * 64;
+               len -= 4 * 64;
+       }
+
+       if (len >= 2 * 64) {
+               memset_mov2x64b(dest, xmm, flush64b);
+               dest += 2 * 64;
+               len -= 2 * 64;
+       }
+
+       if (len >= 1 * 64) {
+               memset_mov1x64b(dest, xmm, flush64b);
+
+               dest += 1 * 64;
+               len -= 1 * 64;
+       }
+
+       if (len)
+               memset_small_sse2(dest, xmm, len, flush);
+}
+
+void
+memset_mov_sse2_noflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_sse2(dest, c, len, noflush, noflush64b);
+}
+
+void
+memset_mov_sse2_empty(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_sse2(dest, c, len, flush_empty_nolog, flush64b_empty);
+}
+
+void
+memset_mov_sse2_clflush(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_sse2(dest, c, len, flush_clflush_nolog, pmem_clflush);
+}
+
+void
+memset_mov_sse2_clflushopt(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_sse2(dest, c, len, flush_clflushopt_nolog,
+                       pmem_clflushopt);
+}
+
+void
+memset_mov_sse2_clwb(char *dest, int c, size_t len)
+{
+       LOG(15, "dest %p c %d len %zu", dest, c, len);
+
+       memset_mov_sse2(dest, c, len, flush_clwb_nolog, pmem_clwb);
+}
diff --git a/ceph/src/pmdk/src/libpmem2/x86_64/sources.inc b/ceph/src/pmdk/src/libpmem2/x86_64/sources.inc
new file mode 100644 (file)
index 0000000..3735c90
--- /dev/null
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+#
+# src/libpmem2/x86_64/sources.inc -- list of files for libpmem2/x86_64
+#
+
+LIBPMEM2_ARCH_SOURCE = init.c\
+       cpu.c\
+       memcpy_nt_avx.c\
+       memcpy_nt_sse2.c\
+       memset_nt_avx.c\
+       memset_nt_sse2.c\
+       memcpy_t_avx.c\
+       memcpy_t_sse2.c\
+       memset_t_avx.c\
+       memset_t_sse2.c
+
+AVX512F_PROG="\#include <immintrin.h>\n\#include <stdint.h>\nint main(){ uint64_t v[8]; __m512i zmm0 = _mm512_loadu_si512((__m512i *)&v); return 0;}"
+AVX512F_AVAILABLE := $(shell printf $(AVX512F_PROG) |\
+       $(CC) $(CFLAGS) -x c -mavx512f -o /dev/null - 2>/dev/null && echo y || echo n)
+
+ifeq ($(AVX512F_AVAILABLE), y)
+LIBPMEM2_ARCH_SOURCE += \
+       memcpy_nt_avx512f.c\
+       memset_nt_avx512f.c\
+       memcpy_t_avx512f.c\
+       memset_t_avx512f.c
+endif
+
diff --git a/ceph/src/pmdk/src/libpmemblk/Makefile b/ceph/src/pmdk/src/libpmemblk/Makefile
new file mode 100644 (file)
index 0000000..8f5d99e
--- /dev/null
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# src/libpmemblk/Makefile -- Makefile for libpmemblk
+#
+
+LIBRARY_NAME = pmemblk
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+
+include ../core/pmemcore.inc
+include ../common/pmemcommon.inc
+SOURCE +=\
+       blk.c\
+       btt.c\
+       libpmemblk.c
+
+include ../Makefile.inc
+
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += -pthread -lpmem $(LIBNDCTL_LIBS)
diff --git a/ceph/src/pmdk/src/libpmemblk/blk.c b/ceph/src/pmdk/src/libpmemblk/blk.c
new file mode 100644 (file)
index 0000000..58f9c9f
--- /dev/null
@@ -0,0 +1,948 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * blk.c -- block memory pool entry points for libpmem
+ */
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <errno.h>
+#include <time.h>
+#include <stdint.h>
+#include <endian.h>
+#include <stdbool.h>
+
+#include "libpmem.h"
+#include "libpmemblk.h"
+
+#include "mmap.h"
+#include "set.h"
+#include "out.h"
+#include "btt.h"
+#include "blk.h"
+#include "util.h"
+#include "sys_util.h"
+#include "util_pmem.h"
+#include "valgrind_internal.h"
+
+static const struct pool_attr Blk_create_attr = {
+               BLK_HDR_SIG,
+               BLK_FORMAT_MAJOR,
+               BLK_FORMAT_FEAT_DEFAULT,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+static const struct pool_attr Blk_open_attr = {
+               BLK_HDR_SIG,
+               BLK_FORMAT_MAJOR,
+               BLK_FORMAT_FEAT_CHECK,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+/*
+ * lane_enter -- (internal) acquire a unique lane number
+ */
+static void
+lane_enter(PMEMblkpool *pbp, unsigned *lane)
+{
+       unsigned mylane;
+
+       mylane = util_fetch_and_add32(&pbp->next_lane, 1) % pbp->nlane;
+
+       /* lane selected, grab the per-lane lock */
+       util_mutex_lock(&pbp->locks[mylane]);
+
+       *lane = mylane;
+}
+
+/*
+ * lane_exit -- (internal) drop lane lock
+ */
+static void
+lane_exit(PMEMblkpool *pbp, unsigned mylane)
+{
+       util_mutex_unlock(&pbp->locks[mylane]);
+}
+
+/*
+ * nsread -- (internal) read data from the namespace encapsulating the BTT
+ *
+ * This routine is provided to btt_init() to allow the btt module to
+ * do I/O on the memory pool containing the BTT layout.
+ */
+static int
+nsread(void *ns, unsigned lane, void *buf, size_t count, uint64_t off)
+{
+       struct pmemblk *pbp = (struct pmemblk *)ns;
+
+       LOG(13, "pbp %p lane %u count %zu off %" PRIu64, pbp, lane, count, off);
+
+       if (off + count > pbp->datasize) {
+               ERR("offset + count (%zu) past end of data area (%zu)",
+                               (size_t)off + count, pbp->datasize);
+               errno = EINVAL;
+               return -1;
+       }
+
+       memcpy(buf, (char *)pbp->data + off, count);
+
+       return 0;
+}
+
+/*
+ * nswrite -- (internal) write data to the namespace encapsulating the BTT
+ *
+ * This routine is provided to btt_init() to allow the btt module to
+ * do I/O on the memory pool containing the BTT layout.
+ */
+static int
+nswrite(void *ns, unsigned lane, const void *buf, size_t count,
+               uint64_t off)
+{
+       struct pmemblk *pbp = (struct pmemblk *)ns;
+
+       LOG(13, "pbp %p lane %u count %zu off %" PRIu64, pbp, lane, count, off);
+
+       if (off + count > pbp->datasize) {
+               ERR("offset + count (%zu) past end of data area (%zu)",
+                               (size_t)off + count, pbp->datasize);
+               errno = EINVAL;
+               return -1;
+       }
+
+       void *dest = (char *)pbp->data + off;
+
+#ifdef DEBUG
+       /* grab debug write lock */
+       util_mutex_lock(&pbp->write_lock);
+#endif
+
+       /* unprotect the memory (debug version only) */
+       RANGE_RW(dest, count, pbp->is_dev_dax);
+
+       if (pbp->is_pmem)
+               pmem_memcpy_nodrain(dest, buf, count);
+       else
+               memcpy(dest, buf, count);
+
+       /* protect the memory again (debug version only) */
+       RANGE_RO(dest, count, pbp->is_dev_dax);
+
+#ifdef DEBUG
+       /* release debug write lock */
+       util_mutex_unlock(&pbp->write_lock);
+#endif
+
+       if (pbp->is_pmem)
+               pmem_drain();
+       else
+               pmem_msync(dest, count);
+
+       return 0;
+}
+
+/*
+ * nsmap -- (internal) allow direct access to a range of a namespace
+ *
+ * The caller requests a range to be "mapped" but the return value
+ * may indicate a smaller amount (in which case the caller is expected
+ * to call back later for another mapping).
+ *
+ * This routine is provided to btt_init() to allow the btt module to
+ * do I/O on the memory pool containing the BTT layout.
+ */
+static ssize_t
+nsmap(void *ns, unsigned lane, void **addrp, size_t len, uint64_t off)
+{
+       struct pmemblk *pbp = (struct pmemblk *)ns;
+
+       LOG(12, "pbp %p lane %u len %zu off %" PRIu64, pbp, lane, len, off);
+
+       ASSERT(((ssize_t)len) >= 0);
+
+       if (off + len >= pbp->datasize) {
+               ERR("offset + len (%zu) past end of data area (%zu)",
+                               (size_t)off + len, pbp->datasize - 1);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * Since the entire file is memory-mapped, this callback
+        * can always provide the entire length requested.
+        */
+       *addrp = (char *)pbp->data + off;
+
+       LOG(12, "returning addr %p", *addrp);
+
+       return (ssize_t)len;
+}
+
+/*
+ * nssync -- (internal) flush changes made to a namespace range
+ *
+ * This is used in conjunction with the addresses handed out by
+ * nsmap() above.  There's no need to sync things written via
+ * nswrite() since those changes are flushed each time nswrite()
+ * is called.
+ *
+ * This routine is provided to btt_init() to allow the btt module to
+ * do I/O on the memory pool containing the BTT layout.
+ */
+static void
+nssync(void *ns, unsigned lane, void *addr, size_t len)
+{
+       struct pmemblk *pbp = (struct pmemblk *)ns;
+
+       LOG(12, "pbp %p lane %u addr %p len %zu", pbp, lane, addr, len);
+
+       if (pbp->is_pmem)
+               pmem_persist(addr, len);
+       else
+               pmem_msync(addr, len);
+}
+
+/*
+ * nszero -- (internal) zero data in the namespace encapsulating the BTT
+ *
+ * This routine is provided to btt_init() to allow the btt module to
+ * zero the memory pool containing the BTT layout.
+ */
+static int
+nszero(void *ns, unsigned lane, size_t count, uint64_t off)
+{
+       struct pmemblk *pbp = (struct pmemblk *)ns;
+
+       LOG(13, "pbp %p lane %u count %zu off %" PRIu64, pbp, lane, count, off);
+
+       if (off + count > pbp->datasize) {
+               ERR("offset + count (%zu) past end of data area (%zu)",
+                               (size_t)off + count, pbp->datasize);
+               errno = EINVAL;
+               return -1;
+       }
+
+       void *dest = (char *)pbp->data + off;
+
+       /* unprotect the memory (debug version only) */
+       RANGE_RW(dest, count, pbp->is_dev_dax);
+
+       pmem_memset_persist(dest, 0, count);
+
+       /* protect the memory again (debug version only) */
+       RANGE_RO(dest, count, pbp->is_dev_dax);
+
+       return 0;
+}
+
+/* callbacks for btt_init() */
+static struct ns_callback ns_cb = {
+       .nsread = nsread,
+       .nswrite = nswrite,
+       .nszero = nszero,
+       .nsmap = nsmap,
+       .nssync = nssync,
+       .ns_is_zeroed = 0
+};
+
+/*
+ * blk_descr_create -- (internal) create block memory pool descriptor
+ */
+static void
+blk_descr_create(PMEMblkpool *pbp, uint32_t bsize, int zeroed)
+{
+       LOG(3, "pbp %p bsize %u zeroed %d", pbp, bsize, zeroed);
+
+       /* create the required metadata */
+       pbp->bsize = htole32(bsize);
+       util_persist(pbp->is_pmem, &pbp->bsize, sizeof(bsize));
+
+       pbp->is_zeroed = zeroed;
+       util_persist(pbp->is_pmem, &pbp->is_zeroed, sizeof(pbp->is_zeroed));
+}
+
+/*
+ * blk_descr_check -- (internal) validate block memory pool descriptor
+ */
+static int
+blk_descr_check(PMEMblkpool *pbp, size_t *bsize)
+{
+       LOG(3, "pbp %p bsize %zu", pbp, *bsize);
+
+       size_t hdr_bsize = le32toh(pbp->bsize);
+       if (*bsize && *bsize != hdr_bsize) {
+               ERR("wrong bsize (%zu), pool created with bsize %zu",
+                               *bsize, hdr_bsize);
+               errno = EINVAL;
+               return -1;
+       }
+       *bsize = hdr_bsize;
+       LOG(3, "using block size from header: %zu", *bsize);
+
+       return 0;
+}
+
+/*
+ * blk_runtime_init -- (internal) initialize block memory pool runtime data
+ */
+static int
+blk_runtime_init(PMEMblkpool *pbp, size_t bsize, int rdonly)
+{
+       LOG(3, "pbp %p bsize %zu rdonly %d",
+                       pbp, bsize, rdonly);
+
+       /* remove volatile part of header */
+       VALGRIND_REMOVE_PMEM_MAPPING(&pbp->addr,
+                       sizeof(struct pmemblk) -
+                       sizeof(struct pool_hdr) -
+                       sizeof(pbp->bsize) -
+                       sizeof(pbp->is_zeroed));
+
+       /*
+        * Use some of the memory pool area for run-time info.  This
+        * run-time state is never loaded from the file, it is always
+        * created here, so no need to worry about byte-order.
+        */
+       pbp->rdonly = rdonly;
+       pbp->data = (char *)pbp->addr +
+                       roundup(sizeof(*pbp), BLK_FORMAT_DATA_ALIGN);
+       ASSERT(((char *)pbp->addr + pbp->size) >= (char *)pbp->data);
+       pbp->datasize = (size_t)
+                       (((char *)pbp->addr + pbp->size) - (char *)pbp->data);
+
+       LOG(4, "data area %p data size %zu bsize %zu",
+               pbp->data, pbp->datasize, bsize);
+
+       long ncpus = sysconf(_SC_NPROCESSORS_ONLN);
+       if (ncpus < 1)
+               ncpus = 1;
+
+       ns_cb.ns_is_zeroed = pbp->is_zeroed;
+
+       /* things free by "goto err" if not NULL */
+       struct btt *bttp = NULL;
+       os_mutex_t *locks = NULL;
+
+       bttp = btt_init(pbp->datasize, (uint32_t)bsize, pbp->hdr.poolset_uuid,
+                       (unsigned)ncpus * 2, pbp, &ns_cb);
+
+       if (bttp == NULL)
+               goto err;       /* btt_init set errno, called LOG */
+
+       pbp->bttp = bttp;
+
+       pbp->nlane = btt_nlane(pbp->bttp);
+       pbp->next_lane = 0;
+       if ((locks = Malloc(pbp->nlane * sizeof(*locks))) == NULL) {
+               ERR("!Malloc for lane locks");
+               goto err;
+       }
+
+       for (unsigned i = 0; i < pbp->nlane; i++)
+               util_mutex_init(&locks[i]);
+
+       pbp->locks = locks;
+
+#ifdef DEBUG
+       /* initialize debug lock */
+       util_mutex_init(&pbp->write_lock);
+#endif
+
+       /*
+        * If possible, turn off all permissions on the pool header page.
+        *
+        * The prototype PMFS doesn't allow this when large pages are in
+        * use. It is not considered an error if this fails.
+        */
+       RANGE_NONE(pbp->addr, sizeof(struct pool_hdr), pbp->is_dev_dax);
+
+       /* the data area should be kept read-only for debug version */
+       RANGE_RO(pbp->data, pbp->datasize, pbp->is_dev_dax);
+
+       return 0;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (bttp)
+               btt_fini(bttp);
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * pmemblk_createU -- create a block memory pool
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMblkpool *
+pmemblk_createU(const char *path, size_t bsize, size_t poolsize, mode_t mode)
+{
+       LOG(3, "path %s bsize %zu poolsize %zu mode %o",
+                       path, bsize, poolsize, mode);
+
+       /* check if bsize is valid */
+       if (bsize == 0) {
+               ERR("Invalid block size %zu", bsize);
+               errno = EINVAL;
+               return NULL;
+       }
+
+       if (bsize > UINT32_MAX) {
+               ERR("Invalid block size %zu", bsize);
+               errno = EINVAL;
+               return NULL;
+       }
+
+       struct pool_set *set;
+       struct pool_attr adj_pool_attr = Blk_create_attr;
+
+       /* force set SDS feature */
+       if (SDS_at_create)
+               adj_pool_attr.features.incompat |= POOL_FEAT_SDS;
+       else
+               adj_pool_attr.features.incompat &= ~POOL_FEAT_SDS;
+
+       if (util_pool_create(&set, path, poolsize, PMEMBLK_MIN_POOL,
+                       PMEMBLK_MIN_PART, &adj_pool_attr, NULL,
+                       REPLICAS_DISABLED) != 0) {
+               LOG(2, "cannot create pool or pool set");
+               return NULL;
+       }
+
+       ASSERT(set->nreplicas > 0);
+
+       struct pool_replica *rep = set->replica[0];
+       PMEMblkpool *pbp = rep->part[0].addr;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(&pbp->addr,
+                       sizeof(struct pmemblk) -
+                       ((uintptr_t)&pbp->addr - (uintptr_t)&pbp->hdr));
+
+       pbp->addr = pbp;
+       pbp->size = rep->repsize;
+       pbp->set = set;
+       pbp->is_pmem = rep->is_pmem;
+       pbp->is_dev_dax = rep->part[0].is_dev_dax;
+
+       /* is_dev_dax implies is_pmem */
+       ASSERT(!pbp->is_dev_dax || pbp->is_pmem);
+
+       /* create pool descriptor */
+       blk_descr_create(pbp, (uint32_t)bsize, set->zeroed);
+
+       /* initialize runtime parts */
+       if (blk_runtime_init(pbp, bsize, 0) != 0) {
+               ERR("pool initialization failed");
+               goto err;
+       }
+
+       if (util_poolset_chmod(set, mode))
+               goto err;
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "pbp %p", pbp);
+       return pbp;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       util_poolset_close(set, DELETE_CREATED_PARTS);
+       errno = oerrno;
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_create -- create a block memory pool
+ */
+PMEMblkpool *
+pmemblk_create(const char *path, size_t bsize, size_t poolsize, mode_t mode)
+{
+       return pmemblk_createU(path, bsize, poolsize, mode);
+}
+#else
+/*
+ * pmemblk_createW -- create a block memory pool
+ */
+PMEMblkpool *
+pmemblk_createW(const wchar_t *path, size_t bsize, size_t poolsize,
+       mode_t mode)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       PMEMblkpool *ret = pmemblk_createU(upath, bsize, poolsize, mode);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * blk_open_common -- (internal) open a block memory pool
+ *
+ * This routine does all the work, but takes a cow flag so internal
+ * calls can map a read-only pool if required.
+ *
+ * Passing in bsize == 0 means a valid pool header must exist (which
+ * will supply the block size).
+ */
+static PMEMblkpool *
+blk_open_common(const char *path, size_t bsize, unsigned flags)
+{
+       LOG(3, "path %s bsize %zu flags 0x%x", path, bsize, flags);
+
+       struct pool_set *set;
+
+       if (util_pool_open(&set, path, PMEMBLK_MIN_PART, &Blk_open_attr,
+                       NULL, NULL, flags) != 0) {
+               LOG(2, "cannot open pool or pool set");
+               return NULL;
+       }
+
+       ASSERT(set->nreplicas > 0);
+
+       struct pool_replica *rep = set->replica[0];
+       PMEMblkpool *pbp = rep->part[0].addr;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(&pbp->addr,
+                       sizeof(struct pmemblk) -
+                       ((uintptr_t)&pbp->addr - (uintptr_t)&pbp->hdr));
+
+       pbp->addr = pbp;
+       pbp->size = rep->repsize;
+       pbp->set = set;
+       pbp->is_pmem = rep->is_pmem;
+       pbp->is_dev_dax = rep->part[0].is_dev_dax;
+
+       /* is_dev_dax implies is_pmem */
+       ASSERT(!pbp->is_dev_dax || pbp->is_pmem);
+
+       if (set->nreplicas > 1) {
+               errno = ENOTSUP;
+               ERR("!replicas not supported");
+               goto err;
+       }
+
+       /* validate pool descriptor */
+       if (blk_descr_check(pbp, &bsize) != 0) {
+               LOG(2, "descriptor check failed");
+               goto err;
+       }
+
+       /* initialize runtime parts */
+       if (blk_runtime_init(pbp, bsize, set->rdonly) != 0) {
+               ERR("pool initialization failed");
+               goto err;
+       }
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "pbp %p", pbp);
+       return pbp;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+       return NULL;
+}
+
+/*
+ * pmemblk_openU -- open a block memory pool
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMblkpool *
+pmemblk_openU(const char *path, size_t bsize)
+{
+       LOG(3, "path %s bsize %zu", path, bsize);
+
+       return blk_open_common(path, bsize, COW_at_open ? POOL_OPEN_COW : 0);
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_open -- open a block memory pool
+ */
+PMEMblkpool *
+pmemblk_open(const char *path, size_t bsize)
+{
+       return pmemblk_openU(path, bsize);
+}
+#else
+/*
+ * pmemblk_openW -- open a block memory pool
+ */
+PMEMblkpool *
+pmemblk_openW(const wchar_t *path, size_t bsize)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       PMEMblkpool *ret = pmemblk_openU(upath, bsize);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmemblk_close -- close a block memory pool
+ */
+void
+pmemblk_close(PMEMblkpool *pbp)
+{
+       LOG(3, "pbp %p", pbp);
+
+       btt_fini(pbp->bttp);
+       if (pbp->locks) {
+               for (unsigned i = 0; i < pbp->nlane; i++)
+                       util_mutex_destroy(&pbp->locks[i]);
+               Free((void *)pbp->locks);
+       }
+
+#ifdef DEBUG
+       /* destroy debug lock */
+       util_mutex_destroy(&pbp->write_lock);
+#endif
+
+       util_poolset_close(pbp->set, DO_NOT_DELETE_PARTS);
+}
+
+/*
+ * pmemblk_bsize -- return size of block for specified pool
+ */
+size_t
+pmemblk_bsize(PMEMblkpool *pbp)
+{
+       LOG(3, "pbp %p", pbp);
+
+       return le32toh(pbp->bsize);
+}
+
+/*
+ * pmemblk_nblock -- return number of usable blocks in a block memory pool
+ */
+size_t
+pmemblk_nblock(PMEMblkpool *pbp)
+{
+       LOG(3, "pbp %p", pbp);
+
+       return btt_nlba(pbp->bttp);
+}
+
+/*
+ * pmemblk_read -- read a block in a block memory pool
+ */
+int
+pmemblk_read(PMEMblkpool *pbp, void *buf, long long blockno)
+{
+       LOG(3, "pbp %p buf %p blockno %lld", pbp, buf, blockno);
+
+       if (blockno < 0) {
+               ERR("negative block number");
+               errno = EINVAL;
+               return -1;
+       }
+
+       unsigned lane;
+
+       lane_enter(pbp, &lane);
+
+       int err = btt_read(pbp->bttp, lane, (uint64_t)blockno, buf);
+
+       lane_exit(pbp, lane);
+
+       return err;
+}
+
+/*
+ * pmemblk_write -- write a block (atomically) in a block memory pool
+ */
+int
+pmemblk_write(PMEMblkpool *pbp, const void *buf, long long blockno)
+{
+       LOG(3, "pbp %p buf %p blockno %lld", pbp, buf, blockno);
+
+       if (pbp->rdonly) {
+               ERR("EROFS (pool is read-only)");
+               errno = EROFS;
+               return -1;
+       }
+
+       if (blockno < 0) {
+               ERR("negative block number");
+               errno = EINVAL;
+               return -1;
+       }
+
+       unsigned lane;
+
+       lane_enter(pbp, &lane);
+
+       int err = btt_write(pbp->bttp, lane, (uint64_t)blockno, buf);
+
+       lane_exit(pbp, lane);
+
+       return err;
+}
+
+/*
+ * pmemblk_set_zero -- zero a block in a block memory pool
+ */
+int
+pmemblk_set_zero(PMEMblkpool *pbp, long long blockno)
+{
+       LOG(3, "pbp %p blockno %lld", pbp, blockno);
+
+       if (pbp->rdonly) {
+               ERR("EROFS (pool is read-only)");
+               errno = EROFS;
+               return -1;
+       }
+
+       if (blockno < 0) {
+               ERR("negative block number");
+               errno = EINVAL;
+               return -1;
+       }
+
+       unsigned lane;
+
+       lane_enter(pbp, &lane);
+
+       int err = btt_set_zero(pbp->bttp, lane, (uint64_t)blockno);
+
+       lane_exit(pbp, lane);
+
+       return err;
+}
+
+/*
+ * pmemblk_set_error -- set the error state on a block in a block memory pool
+ */
+int
+pmemblk_set_error(PMEMblkpool *pbp, long long blockno)
+{
+       LOG(3, "pbp %p blockno %lld", pbp, blockno);
+
+       if (pbp->rdonly) {
+               ERR("EROFS (pool is read-only)");
+               errno = EROFS;
+               return -1;
+       }
+
+       if (blockno < 0) {
+               ERR("negative block number");
+               errno = EINVAL;
+               return -1;
+       }
+
+       unsigned lane;
+
+       lane_enter(pbp, &lane);
+
+       int err = btt_set_error(pbp->bttp, lane, (uint64_t)blockno);
+
+       lane_exit(pbp, lane);
+
+       return err;
+}
+
+/*
+ * pmemblk_checkU -- block memory pool consistency check
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemblk_checkU(const char *path, size_t bsize)
+{
+       LOG(3, "path \"%s\" bsize %zu", path, bsize);
+
+       /* map the pool read-only */
+       PMEMblkpool *pbp = blk_open_common(path, bsize, POOL_OPEN_COW);
+       if (pbp == NULL)
+               return -1;      /* errno set by blk_open_common() */
+
+       int retval = btt_check(pbp->bttp);
+       int oerrno = errno;
+       pmemblk_close(pbp);
+       errno = oerrno;
+
+       return retval;
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_check -- block memory pool consistency check
+ */
+int
+pmemblk_check(const char *path, size_t bsize)
+{
+       return pmemblk_checkU(path, bsize);
+}
+#else
+/*
+ * pmemblk_checkW -- block memory pool consistency check
+ */
+int
+pmemblk_checkW(const wchar_t *path, size_t bsize)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return -1;
+
+       int ret = pmemblk_checkU(upath, bsize);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmemblk_ctl_getU -- programmatically executes a read ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemblk_ctl_getU(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       LOG(3, "pbp %p name %s arg %p", pbp, name, arg);
+       return ctl_query(pbp == NULL ? NULL : pbp->ctl, pbp,
+                       CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_READ, arg);
+}
+
+/*
+ * pmemblk_ctl_setU -- programmatically executes a write ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemblk_ctl_setU(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       LOG(3, "pbp %p name %s arg %p", pbp, name, arg);
+       return ctl_query(pbp == NULL ? NULL : pbp->ctl, pbp,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_WRITE, arg);
+}
+
+/*
+ * pmemblk_ctl_execU -- programmatically executes a runnable ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemblk_ctl_execU(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       LOG(3, "pbp %p name %s arg %p", pbp, name, arg);
+       return ctl_query(pbp == NULL ? NULL : pbp->ctl, pbp,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_RUNNABLE, arg);
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_ctl_get -- programmatically executes a read ctl query
+ */
+int
+pmemblk_ctl_get(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       return pmemblk_ctl_getU(pbp, name, arg);
+}
+
+/*
+ * pmemblk_ctl_set -- programmatically executes a write ctl query
+ */
+int
+pmemblk_ctl_set(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       return pmemblk_ctl_setU(pbp, name, arg);
+}
+
+/*
+ * pmemblk_ctl_exec -- programmatically executes a runnable ctl query
+ */
+int
+pmemblk_ctl_exec(PMEMblkpool *pbp, const char *name, void *arg)
+{
+       return pmemblk_ctl_execU(pbp, name, arg);
+}
+#else
+/*
+ * pmemblk_ctl_getW -- programmatically executes a read ctl query
+ */
+int
+pmemblk_ctl_getW(PMEMblkpool *pbp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemblk_ctl_getU(pbp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemblk_ctl_setW -- programmatically executes a write ctl query
+ */
+int
+pmemblk_ctl_setW(PMEMblkpool *pbp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemblk_ctl_setU(pbp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemblk_ctl_execW -- programmatically executes a runnable ctl query
+ */
+int
+pmemblk_ctl_execW(PMEMblkpool *pbp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemblk_ctl_execU(pbp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+#endif
+
+#if FAULT_INJECTION
+void
+pmemblk_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at)
+{
+       core_inject_fault_at(type, nth, at);
+}
+
+int
+pmemblk_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemblk/blk.h b/ceph/src/pmdk/src/libpmemblk/blk.h
new file mode 100644 (file)
index 0000000..095331b
--- /dev/null
@@ -0,0 +1,102 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * blk.h -- internal definitions for libpmem blk module
+ */
+
+#ifndef BLK_H
+#define BLK_H 1
+
+#include <stddef.h>
+
+#include "ctl.h"
+#include "os_thread.h"
+#include "pool_hdr.h"
+#include "page_size.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "alloc.h"
+#include "fault_injection.h"
+
+#define PMEMBLK_LOG_PREFIX "libpmemblk"
+#define PMEMBLK_LOG_LEVEL_VAR "PMEMBLK_LOG_LEVEL"
+#define PMEMBLK_LOG_FILE_VAR "PMEMBLK_LOG_FILE"
+
+/* attributes of the blk memory pool format for the pool header */
+#define BLK_HDR_SIG "PMEMBLK"  /* must be 8 bytes including '\0' */
+#define BLK_FORMAT_MAJOR 1
+
+#define BLK_FORMAT_FEAT_DEFAULT \
+       {POOL_FEAT_COMPAT_DEFAULT, POOL_FEAT_INCOMPAT_DEFAULT, 0x0000}
+
+#define BLK_FORMAT_FEAT_CHECK \
+       {POOL_FEAT_COMPAT_VALID, POOL_FEAT_INCOMPAT_VALID, 0x0000}
+
+static const features_t blk_format_feat_default = BLK_FORMAT_FEAT_DEFAULT;
+
+struct pmemblk {
+       struct pool_hdr hdr;    /* memory pool header */
+
+       /* root info for on-media format... */
+       uint32_t bsize;         /* block size */
+
+       /* flag indicating if the pool was zero-initialized */
+       int is_zeroed;
+
+       /* some run-time state, allocated out of memory pool... */
+       void *addr;             /* mapped region */
+       size_t size;            /* size of mapped region */
+       int is_pmem;            /* true if pool is PMEM */
+       int rdonly;             /* true if pool is opened read-only */
+       void *data;             /* post-header data area */
+       size_t datasize;        /* size of data area */
+       size_t nlba;            /* number of LBAs in pool */
+       struct btt *bttp;       /* btt handle */
+       unsigned nlane;         /* number of lanes */
+       unsigned next_lane;     /* used to rotate through lanes */
+       os_mutex_t *locks;      /* one per lane */
+       int is_dev_dax;         /* true if mapped on device dax */
+       struct ctl *ctl;        /* top level node of the ctl tree structure */
+
+       struct pool_set *set;   /* pool set info */
+
+#ifdef DEBUG
+       /* held during read/write mprotected sections */
+       os_mutex_t write_lock;
+#endif
+};
+
+/* data area starts at this alignment after the struct pmemblk above */
+#define BLK_FORMAT_DATA_ALIGN ((uintptr_t)PMEM_PAGESIZE)
+
+#if FAULT_INJECTION
+void
+pmemblk_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at);
+
+int
+pmemblk_fault_injection_enabled(void);
+#else
+static inline void
+pmemblk_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       abort();
+}
+
+static inline int
+pmemblk_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemblk/btt.c b/ceph/src/pmdk/src/libpmemblk/btt.c
new file mode 100644 (file)
index 0000000..f59389f
--- /dev/null
@@ -0,0 +1,2051 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * btt.c -- block translation table providing atomic block updates
+ *
+ * This is a user-space implementation of the BTT mechanism providing
+ * single block powerfail write atomicity, as described by:
+ *     The NVDIMM Namespace Specification
+ *
+ * To use this module, the caller must provide five routines for
+ * accessing the namespace containing the data (in this context,
+ * "namespace" refers to the storage containing the BTT layout, such
+ * as a file).  All namespace I/O is done by these callbacks:
+ *
+ *     nsread  Read count bytes from namespace at offset off
+ *     nswrite Write count bytes to namespace at offset off
+ *     nszero  Zero count bytes in namespace at offset off
+ *     nsmap   Return direct access to a range of a namespace
+ *     nssync  Flush changes made to an nsmap'd range
+ *
+ * Data written by the nswrite callback is flushed out to the media
+ * (made durable) when the call returns.  Data written directly via
+ * the nsmap callback must be flushed explicitly using nssync.
+ *
+ * The caller passes these callbacks, along with information such as
+ * namespace size and UUID to btt_init() and gets back an opaque handle
+ * which is then used with the rest of the entry points.
+ *
+ * Here is a brief list of the entry points to this module:
+ *
+ *     btt_nlane       Returns number of concurrent threads allowed
+ *
+ *     btt_nlba        Returns the usable size, as a count of LBAs
+ *
+ *     btt_read        Reads a single block at a given LBA
+ *
+ *     btt_write       Writes a single block (atomically) at a given LBA
+ *
+ *     btt_set_zero    Sets a block to read back as zeros
+ *
+ *     btt_set_error   Sets a block to return error on read
+ *
+ *     btt_check       Checks the BTT metadata for consistency
+ *
+ *     btt_fini        Frees run-time state, done using namespace
+ *
+ * If the caller is multi-threaded, it must only allow btt_nlane() threads
+ * to enter this module at a time, each assigned a unique "lane" number
+ * between 0 and btt_nlane() - 1.
+ *
+ * There are a number of static routines defined in this module.  Here's
+ * a brief overview of the most important routines:
+ *
+ *     read_layout     Checks for valid BTT layout and builds run-time state.
+ *                     A number of helper functions are used by read_layout
+ *                     to handle various parts of the metadata:
+ *                             read_info
+ *                             read_arenas
+ *                             read_arena
+ *                             read_flogs
+ *                             read_flog_pair
+ *
+ *     write_layout    Generates a new BTT layout when one doesn't exist.
+ *                     Once a new layout is written, write_layout uses
+ *                     the same helper functions above to construct the
+ *                     run-time state.
+ *
+ *     invalid_lba     Range check done by each entry point that takes
+ *                     an LBA.
+ *
+ *     lba_to_arena_lba
+ *                     Find the arena and LBA in that arena for a given
+ *                     external LBA.  This is the heart of the arena
+ *                     range matching logic.
+ *
+ *     flog_update     Update the BTT free list/log combined data structure
+ *                     (known as the "flog").  This is the heart of the
+ *                     logic that makes writes powerfail atomic.
+ *
+ *     map_lock        These routines provide atomic access to the BTT map
+ *     map_unlock      data structure in an area.
+ *     map_abort
+ *
+ *     map_entry_setf  Common code for btt_set_zero() and btt_set_error().
+ *
+ *     zero_block      Generate a block of all zeros (instead of actually
+ *                     doing a read), when the metadata indicates the
+ *                     block should read as zeros.
+ *
+ *     build_rtt       These routines construct the run-time tracking
+ *     build_map_locks data structures used during I/O.
+ */
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <stdint.h>
+#include <endian.h>
+
+#include "out.h"
+#include "uuid.h"
+#include "btt.h"
+#include "btt_layout.h"
+#include "sys_util.h"
+#include "util.h"
+#include "alloc.h"
+
+/*
+ * The opaque btt handle containing state tracked by this module
+ * for the btt namespace.  This is created by btt_init(), handed to
+ * all the other btt_* entry points, and deleted by btt_fini().
+ */
+struct btt {
+       unsigned nlane; /* number of concurrent threads allowed per btt */
+
+       /*
+        * The laidout flag indicates whether the namespace contains valid BTT
+        * metadata.  It is initialized by read_layout() and if no valid layout
+        * is found, all reads return zeros and the first write will write the
+        * BTT layout.  The layout_write_mutex protects the laidout flag so
+        * only one write threads ends up writing the initial metadata by
+        * calling write_layout().
+        */
+       os_mutex_t layout_write_mutex;
+       int laidout;
+
+       /*
+        * UUID of the BTT
+        */
+       uint8_t uuid[BTTINFO_UUID_LEN];
+
+       /*
+        * UUID of the containing namespace, used to validate BTT metadata.
+        */
+       uint8_t parent_uuid[BTTINFO_UUID_LEN];
+
+       /*
+        * Parameters controlling/describing the BTT layout.
+        */
+       uint64_t rawsize;               /* size of containing namespace */
+       uint32_t lbasize;               /* external LBA size */
+       uint32_t nfree;                 /* available flog entries */
+       uint64_t nlba;                  /* total number of external LBAs */
+       unsigned narena;                /* number of arenas */
+
+       /* run-time state kept for each arena */
+       struct arena {
+               uint32_t flags;         /* arena flags (btt_info) */
+               uint32_t external_nlba; /* LBAs that live in this arena */
+               uint32_t internal_lbasize;
+               uint32_t internal_nlba;
+
+               /*
+                * The following offsets are relative to the beginning of
+                * the encapsulating namespace.  This is different from
+                * how these offsets are stored on-media, where they are
+                * relative to the start of the arena.  The offset are
+                * converted by read_layout() to make them more convenient
+                * for run-time use.
+                */
+               uint64_t startoff;      /* offset to start of arena */
+               uint64_t dataoff;       /* offset to arena data area */
+               uint64_t mapoff;        /* offset to area map */
+               uint64_t flogoff;       /* offset to area flog */
+               uint64_t nextoff;       /* offset to next arena */
+
+               /*
+                * Run-time flog state.  Indexed by lane.
+                *
+                * The write path uses the flog to find the free block
+                * it writes to before atomically making it the new
+                * active block for an external LBA.
+                *
+                * The read path doesn't use the flog at all.
+                */
+               struct flog_runtime {
+                       struct btt_flog flog;   /* current info */
+                       uint64_t entries[2];    /* offsets for flog pair */
+                       int next;               /* next write (0 or 1) */
+               } *flogs;
+
+               /*
+                * Read tracking table.  Indexed by lane.
+                *
+                * Before using a free block found in the flog, the write path
+                * scans the rtt to see if there are any outstanding reads on
+                * that block (reads that started before the block was freed by
+                * a concurrent write).  Unused slots in the rtt are indicated
+                * by setting the error bit, BTT_MAP_ENTRY_ERROR, so that the
+                * entry won't match any post-map LBA when checked.
+                */
+               uint32_t volatile *rtt;
+
+               /*
+                * Map locking.  Indexed by pre-map LBA modulo nlane.
+                */
+               os_mutex_t *map_locks;
+
+               /*
+                * Arena info block locking.
+                */
+               os_mutex_t info_lock;
+       } *arenas;
+
+       /*
+        * Callbacks for doing I/O to namespace.  These are provided by
+        * the code calling the BTT module, which passes them in to
+        * btt_init().  All namespace I/O is done using these.
+        *
+        * The opaque namespace handle "ns" was provided by the code calling
+        * the BTT module and is passed to each callback to identify the
+        * namespace being accessed.
+        */
+       void *ns;
+       const struct ns_callback *ns_cbp;
+};
+
+/*
+ * Signature for arena info blocks.  Total size is 16 bytes, including
+ * the '\0' added to the string by the declaration (the last two bytes
+ * of the string are '\0').
+ */
+static const char Sig[] = BTTINFO_SIG;
+
+/*
+ * Zeroed out flog entry, used when initializing the flog.
+ */
+static const struct btt_flog Zflog;
+
+/*
+ * Lookup table and macro for looking up sequence numbers.  These are
+ * the 2-bit numbers that cycle between 01, 10, and 11.
+ *
+ * To advance a sequence number to the next number, use something like:
+ *     seq = NSEQ(seq);
+ */
+static const unsigned Nseq[] = { 0, 2, 3, 1 };
+#define NSEQ(seq) (Nseq[(seq) & 3])
+
+/*
+ * get_map_lock_num -- (internal) Calculate offset into map_locks[]
+ *
+ * map_locks[] contains nfree locks which are used to protect the map
+ * from concurrent access to the same cache line.  The index into
+ * map_locks[] is calculated by looking at the byte offset into the map
+ * (premap_lba * BTT_MAP_ENTRY_SIZE), figuring out how many cache lines
+ * that is into the map that is (dividing by BTT_MAP_LOCK_ALIGN), and
+ * then selecting one of nfree locks (the modulo at the end).
+ *
+ * The extra cast is to keep gcc from generating a false positive
+ * 64-32 bit conversion error when -fsanitize is set.
+ */
+static inline uint32_t
+get_map_lock_num(uint32_t premap_lba, uint32_t nfree)
+{
+       return (uint32_t)(premap_lba * BTT_MAP_ENTRY_SIZE / BTT_MAP_LOCK_ALIGN)
+               % nfree;
+}
+
+/*
+ * invalid_lba -- (internal) set errno and return true if lba is invalid
+ *
+ * This function is used at the top of the entry points where an external
+ * LBA is provided, like this:
+ *
+ *     if (invalid_lba(bttp, lba))
+ *             return -1;
+ */
+static int
+invalid_lba(struct btt *bttp, uint64_t lba)
+{
+       LOG(3, "bttp %p lba %" PRIu64, bttp, lba);
+
+       if (lba >= bttp->nlba) {
+               ERR("lba out of range (nlba %" PRIu64 ")", bttp->nlba);
+               errno = EINVAL;
+               return 1;
+       }
+
+       return 0;
+}
+
+/*
+ * read_info -- (internal) convert btt_info to host byte order & validate
+ *
+ * Returns true if info block is valid, and all the integer fields are
+ * converted to host byte order.  If the info block is not valid, this
+ * routine returns false and the info block passed in is left in an
+ * unknown state.
+ */
+static int
+read_info(struct btt *bttp, struct btt_info *infop)
+{
+       LOG(3, "infop %p", infop);
+
+       if (memcmp(infop->sig, Sig, BTTINFO_SIG_LEN)) {
+               LOG(3, "signature invalid");
+               return 0;
+       }
+
+       if (memcmp(infop->parent_uuid, bttp->parent_uuid, BTTINFO_UUID_LEN)) {
+               LOG(3, "parent UUID mismatch");
+               return 0;
+       }
+
+       /* to be valid, the fields must checksum correctly */
+       if (!util_checksum(infop, sizeof(*infop), &infop->checksum, 0, 0)) {
+               LOG(3, "invalid checksum");
+               return 0;
+       }
+
+       /* to be valid, info block must have a major version of at least 1 */
+       if ((infop->major = le16toh(infop->major)) == 0) {
+               LOG(3, "invalid major version (0)");
+               return 0;
+       }
+
+       infop->flags = le32toh(infop->flags);
+       infop->minor = le16toh(infop->minor);
+       infop->external_lbasize = le32toh(infop->external_lbasize);
+       infop->external_nlba = le32toh(infop->external_nlba);
+       infop->internal_lbasize = le32toh(infop->internal_lbasize);
+       infop->internal_nlba = le32toh(infop->internal_nlba);
+       infop->nfree = le32toh(infop->nfree);
+       infop->infosize = le32toh(infop->infosize);
+       infop->nextoff = le64toh(infop->nextoff);
+       infop->dataoff = le64toh(infop->dataoff);
+       infop->mapoff = le64toh(infop->mapoff);
+       infop->flogoff = le64toh(infop->flogoff);
+       infop->infooff = le64toh(infop->infooff);
+
+       return 1;
+}
+
+/*
+ * map_entry_is_zero -- (internal) checks if map_entry is in zero state
+ */
+static inline int
+map_entry_is_zero(uint32_t map_entry)
+{
+       return (map_entry & ~BTT_MAP_ENTRY_LBA_MASK) == BTT_MAP_ENTRY_ZERO;
+}
+
+/*
+ * map_entry_is_error -- (internal) checks if map_entry is in error state
+ */
+static inline int
+map_entry_is_error(uint32_t map_entry)
+{
+       return (map_entry & ~BTT_MAP_ENTRY_LBA_MASK) == BTT_MAP_ENTRY_ERROR;
+}
+
+/*
+ * map_entry_is_initial -- checks if map_entry is in initial state
+ */
+int
+map_entry_is_initial(uint32_t map_entry)
+{
+       return (map_entry & ~BTT_MAP_ENTRY_LBA_MASK) == 0;
+}
+
+/*
+ * map_entry_is_zero_or_initial -- (internal) checks if map_entry is in initial
+ * or zero state
+ */
+static inline int
+map_entry_is_zero_or_initial(uint32_t map_entry)
+{
+       uint32_t entry_flags = map_entry & ~BTT_MAP_ENTRY_LBA_MASK;
+       return entry_flags == 0 || entry_flags == BTT_MAP_ENTRY_ZERO;
+}
+
+/*
+ * btt_flog_get_valid -- return valid and current flog entry
+ */
+struct btt_flog *
+btt_flog_get_valid(struct btt_flog *flog_pair, int *next)
+{
+       /*
+        * Interesting cases:
+        *      - no valid seq numbers:  layout consistency error
+        *      - one valid seq number:  that's the current entry
+        *      - two valid seq numbers: higher number is current entry
+        *      - identical seq numbers: layout consistency error
+        */
+       if (flog_pair[0].seq == flog_pair[1].seq) {
+               return NULL;
+       } else if (flog_pair[0].seq == 0) {
+               /* singleton valid flog at flog_pair[1] */
+               *next = 0;
+               return &flog_pair[1];
+       } else if (flog_pair[1].seq == 0) {
+               /* singleton valid flog at flog_pair[0] */
+               *next = 1;
+               return &flog_pair[0];
+       } else if (NSEQ(flog_pair[0].seq) == flog_pair[1].seq) {
+               /* flog_pair[1] has the later sequence number */
+               *next = 0;
+               return &flog_pair[1];
+       } else {
+               /* flog_pair[0] has the later sequence number */
+               *next = 1;
+               return &flog_pair[0];
+       }
+}
+
+/*
+ * read_flog_pair -- (internal) load up a single flog pair
+ *
+ * Zero is returned on success, otherwise -1/errno.
+ */
+static int
+read_flog_pair(struct btt *bttp, unsigned lane, struct arena *arenap,
+       uint64_t flog_off, struct flog_runtime *flog_runtimep, uint32_t flognum)
+{
+       LOG(5, "bttp %p lane %u arenap %p flog_off %" PRIu64 " runtimep %p "
+               "flognum %u", bttp, lane, arenap, flog_off, flog_runtimep,
+               flognum);
+
+       flog_runtimep->entries[0] = flog_off;
+       flog_runtimep->entries[1] = flog_off + sizeof(struct btt_flog);
+
+       if (lane >= bttp->nfree) {
+               ERR("invalid lane %u among nfree %d", lane, bttp->nfree);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (flog_off == 0) {
+               ERR("invalid flog offset %" PRIu64, flog_off);
+               errno = EINVAL;
+               return -1;
+       }
+
+       struct btt_flog flog_pair[2];
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, flog_pair,
+                               sizeof(flog_pair), flog_off) < 0)
+               return -1;
+
+       btt_flog_convert2h(&flog_pair[0]);
+       if (invalid_lba(bttp, flog_pair[0].lba))
+               return -1;
+
+       btt_flog_convert2h(&flog_pair[1]);
+       if (invalid_lba(bttp, flog_pair[1].lba))
+               return -1;
+
+       LOG(6, "flog_pair[0] flog_off %" PRIu64 " old_map %u new_map %u seq %u",
+                       flog_off, flog_pair[0].old_map,
+                       flog_pair[0].new_map, flog_pair[0].seq);
+       LOG(6, "flog_pair[1] old_map %u new_map %u seq %u",
+                       flog_pair[1].old_map, flog_pair[1].new_map,
+                       flog_pair[1].seq);
+
+       struct btt_flog *currentp = btt_flog_get_valid(flog_pair,
+               &flog_runtimep->next);
+
+       if (currentp == NULL) {
+               ERR("flog layout error: bad seq numbers %d %d",
+                       flog_pair[0].seq, flog_pair[1].seq);
+               arenap->flags |= BTTINFO_FLAG_ERROR;
+               return 0;
+       }
+
+       LOG(6, "run-time flog next is %d", flog_runtimep->next);
+
+       /* copy current flog into run-time flog state */
+       flog_runtimep->flog = *currentp;
+
+       LOG(9, "read flog[%u]: lba %u old %u%s%s%s new %u%s%s%s", flognum,
+               currentp->lba,
+               currentp->old_map & BTT_MAP_ENTRY_LBA_MASK,
+               (map_entry_is_error(currentp->old_map)) ? " ERROR" : "",
+               (map_entry_is_zero(currentp->old_map)) ? " ZERO" : "",
+               (map_entry_is_initial(currentp->old_map)) ? " INIT" : "",
+               currentp->new_map & BTT_MAP_ENTRY_LBA_MASK,
+               (map_entry_is_error(currentp->new_map)) ? " ERROR" : "",
+               (map_entry_is_zero(currentp->new_map)) ? " ZERO" : "",
+               (map_entry_is_initial(currentp->new_map)) ? " INIT" : "");
+
+       /*
+        * Decide if the current flog info represents a completed
+        * operation or an incomplete operation.  If completed, the
+        * old_map field will contain the free block to be used for
+        * the next write.  But if the operation didn't complete (indicated
+        * by the map entry not being updated), then the operation is
+        * completed now by updating the map entry.
+        *
+        * A special case, used by flog entries when first created, is
+        * when old_map == new_map.  This counts as a complete entry
+        * and doesn't require reading the map to see if recovery is
+        * required.
+        */
+       if (currentp->old_map == currentp->new_map) {
+               LOG(9, "flog[%u] entry complete (initial state)", flognum);
+               return 0;
+       }
+
+       /* convert pre-map LBA into an offset into the map */
+       uint64_t map_entry_off = arenap->mapoff +
+                               BTT_MAP_ENTRY_SIZE * currentp->lba;
+
+       /* read current map entry */
+       uint32_t entry;
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &entry,
+                               sizeof(entry), map_entry_off) < 0)
+               return -1;
+
+       entry = le32toh(entry);
+
+       /* map entry in initial state */
+       if (map_entry_is_initial(entry))
+               entry = currentp->lba | BTT_MAP_ENTRY_NORMAL;
+
+       if (currentp->new_map != entry && currentp->old_map == entry) {
+               /* last update didn't complete */
+               LOG(9, "recover flog[%u]: map[%u]: %u",
+                               flognum, currentp->lba, currentp->new_map);
+
+               /*
+                * Recovery step is to complete the transaction by
+                * updating the map entry.
+                */
+               entry = htole32(currentp->new_map);
+               if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &entry,
+                                       sizeof(uint32_t), map_entry_off) < 0)
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * flog_update -- (internal) write out an updated flog entry
+ *
+ * The flog entries are not checksummed.  Instead, increasing sequence
+ * numbers are used to atomically switch the active flog entry between
+ * the first and second struct btt_flog in each slot.  In order for this
+ * to work, the sequence number must be updated only after all the other
+ * fields in the flog are updated.  So the writes to the flog are broken
+ * into two writes, one for the first three fields (lba, old_map, new_map)
+ * and, only after those fields are known to be written durably, the
+ * second write for the seq field is done.
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+static int
+flog_update(struct btt *bttp, unsigned lane, struct arena *arenap,
+               uint32_t lba, uint32_t old_map, uint32_t new_map)
+{
+       LOG(3, "bttp %p lane %u arenap %p lba %u old_map %u new_map %u",
+                       bttp, lane, arenap, lba, old_map, new_map);
+
+       /* construct new flog entry in little-endian byte order */
+       struct btt_flog new_flog;
+       new_flog.lba = lba;
+       new_flog.old_map = old_map;
+       new_flog.new_map = new_map;
+       new_flog.seq = NSEQ(arenap->flogs[lane].flog.seq);
+       btt_flog_convert2le(&new_flog);
+
+       uint64_t new_flog_off =
+               arenap->flogs[lane].entries[arenap->flogs[lane].next];
+
+       /* write out first two fields first */
+       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &new_flog,
+                               sizeof(uint32_t) * 2, new_flog_off) < 0)
+               return -1;
+       new_flog_off += sizeof(uint32_t) * 2;
+
+       /* write out new_map and seq field to make it active */
+       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &new_flog.new_map,
+                               sizeof(uint32_t) * 2, new_flog_off) < 0)
+               return -1;
+
+       /* flog entry written successfully, update run-time state */
+       arenap->flogs[lane].next = 1 - arenap->flogs[lane].next;
+       arenap->flogs[lane].flog.lba = lba;
+       arenap->flogs[lane].flog.old_map = old_map;
+       arenap->flogs[lane].flog.new_map = new_map;
+       arenap->flogs[lane].flog.seq = NSEQ(arenap->flogs[lane].flog.seq);
+
+       LOG(9, "update flog[%u]: lba %u old %u%s%s%s new %u%s%s%s", lane, lba,
+                       old_map & BTT_MAP_ENTRY_LBA_MASK,
+                       (map_entry_is_error(old_map)) ? " ERROR" : "",
+                       (map_entry_is_zero(old_map)) ? " ZERO" : "",
+                       (map_entry_is_initial(old_map)) ? " INIT" : "",
+                       new_map & BTT_MAP_ENTRY_LBA_MASK,
+                       (map_entry_is_error(new_map)) ? " ERROR" : "",
+                       (map_entry_is_zero(new_map)) ? " ZERO" : "",
+                       (map_entry_is_initial(new_map)) ? " INIT" : "");
+
+       return 0;
+}
+
+/*
+ * arena_setf -- (internal) updates the given flag for the arena info block
+ */
+static int
+arena_setf(struct btt *bttp, struct arena *arenap, unsigned lane, uint32_t setf)
+{
+       LOG(3, "bttp %p arenap %p lane %u setf 0x%x", bttp, arenap, lane, setf);
+
+       /* update runtime state */
+       util_fetch_and_or32(&arenap->flags, setf);
+
+       if (!bttp->laidout) {
+               /* no layout yet to update */
+               return 0;
+       }
+
+       /*
+        * Read, modify and write out the info block
+        * at both the beginning and end of the arena.
+        */
+       uint64_t arena_off = arenap->startoff;
+
+       struct btt_info info;
+
+       /* protect from simultaneous writes to the layout */
+       util_mutex_lock(&arenap->info_lock);
+
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &info,
+                       sizeof(info), arena_off) < 0) {
+               goto err;
+       }
+
+       uint64_t infooff = le64toh(info.infooff);
+
+       /* update flags */
+       info.flags |= htole32(setf);
+
+       /* update checksum */
+       util_checksum(&info, sizeof(info), &info.checksum, 1, 0);
+
+       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &info,
+                               sizeof(info), arena_off) < 0) {
+               goto err;
+       }
+
+       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &info,
+                               sizeof(info), arena_off + infooff) < 0) {
+               goto err;
+       }
+
+       util_mutex_unlock(&arenap->info_lock);
+       return 0;
+
+err:
+       util_mutex_unlock(&arenap->info_lock);
+       return -1;
+}
+
+/*
+ * set_arena_error -- (internal) set the error flag for the given arena
+ */
+static int
+set_arena_error(struct btt *bttp, struct arena *arenap, unsigned lane)
+{
+       LOG(3, "bttp %p arena %p lane %u", bttp, arenap, lane);
+
+       return arena_setf(bttp, arenap, lane, BTTINFO_FLAG_ERROR);
+}
+
+/*
+ * read_flogs -- (internal) load up all the flog entries for an arena
+ *
+ * Zero is returned on success, otherwise -1/errno.
+ */
+static int
+read_flogs(struct btt *bttp, unsigned lane, struct arena *arenap)
+{
+       if ((arenap->flogs = Zalloc(bttp->nfree *
+                       sizeof(struct flog_runtime))) == NULL) {
+               ERR("!Malloc for %u flog entries", bttp->nfree);
+               return -1;
+       }
+
+       /*
+        * Load up the flog state.  read_flog_pair() will determine if
+        * any recovery steps are required take them on the in-memory
+        * data structures it creates. Sets error flag when it
+        * determines an invalid state.
+        */
+       uint64_t flog_off = arenap->flogoff;
+       struct flog_runtime *flog_runtimep = arenap->flogs;
+       for (uint32_t i = 0; i < bttp->nfree; i++) {
+               if (read_flog_pair(bttp, lane, arenap, flog_off,
+                                               flog_runtimep, i) < 0) {
+                       set_arena_error(bttp, arenap, lane);
+                       return -1;
+               }
+
+               /* prepare for next time around the loop */
+               flog_off += roundup(2 * sizeof(struct btt_flog),
+                               BTT_FLOG_PAIR_ALIGN);
+               flog_runtimep++;
+       }
+
+       return 0;
+}
+
+/*
+ * build_rtt -- (internal) construct a read tracking table for an arena
+ *
+ * Zero is returned on success, otherwise -1/errno.
+ *
+ * The rtt is big enough to hold an entry for each free block (nfree)
+ * since nlane can't be bigger than nfree.  nlane may end up smaller,
+ * in which case some of the high rtt entries will be unused.
+ */
+static int
+build_rtt(struct btt *bttp, struct arena *arenap)
+{
+       if ((arenap->rtt = Malloc(bttp->nfree * sizeof(uint32_t)))
+                                                       == NULL) {
+               ERR("!Malloc for %d rtt entries", bttp->nfree);
+               return -1;
+       }
+       for (uint32_t lane = 0; lane < bttp->nfree; lane++)
+               arenap->rtt[lane] = BTT_MAP_ENTRY_ERROR;
+       util_synchronize();
+
+       return 0;
+}
+
+/*
+ * build_map_locks -- (internal) construct map locks
+ *
+ * Zero is returned on success, otherwise -1/errno.
+ */
+static int
+build_map_locks(struct btt *bttp, struct arena *arenap)
+{
+       if ((arenap->map_locks =
+                       Malloc(bttp->nfree * sizeof(*arenap->map_locks)))
+                                                       == NULL) {
+               ERR("!Malloc for %d map_lock entries", bttp->nfree);
+               return -1;
+       }
+       for (uint32_t lane = 0; lane < bttp->nfree; lane++)
+               util_mutex_init(&arenap->map_locks[lane]);
+
+       return 0;
+}
+
+/*
+ * read_arena -- (internal) load up an arena and build run-time state
+ *
+ * Zero is returned on success, otherwise -1/errno.
+ */
+static int
+read_arena(struct btt *bttp, unsigned lane, uint64_t arena_off,
+               struct arena *arenap)
+{
+       LOG(3, "bttp %p lane %u arena_off %" PRIu64 " arenap %p",
+                       bttp, lane, arena_off, arenap);
+
+       struct btt_info info;
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &info, sizeof(info),
+                                                       arena_off) < 0)
+               return -1;
+
+       arenap->flags = le32toh(info.flags);
+       arenap->external_nlba = le32toh(info.external_nlba);
+       arenap->internal_lbasize = le32toh(info.internal_lbasize);
+       arenap->internal_nlba = le32toh(info.internal_nlba);
+
+       arenap->startoff = arena_off;
+       arenap->dataoff = arena_off + le64toh(info.dataoff);
+       arenap->mapoff = arena_off + le64toh(info.mapoff);
+       arenap->flogoff = arena_off + le64toh(info.flogoff);
+       arenap->nextoff = arena_off + le64toh(info.nextoff);
+
+       if (read_flogs(bttp, lane, arenap) < 0)
+               return -1;
+
+       if (build_rtt(bttp, arenap) < 0)
+               return -1;
+
+       if (build_map_locks(bttp, arenap) < 0)
+               return -1;
+
+       /* initialize the per arena info block lock */
+       util_mutex_init(&arenap->info_lock);
+
+       return 0;
+}
+
+/*
+ * util_convert2h_btt_info -- convert btt_info to host byte order
+ */
+void
+btt_info_convert2h(struct btt_info *infop)
+{
+       infop->flags = le32toh(infop->flags);
+       infop->major = le16toh(infop->major);
+       infop->minor = le16toh(infop->minor);
+       infop->external_lbasize = le32toh(infop->external_lbasize);
+       infop->external_nlba = le32toh(infop->external_nlba);
+       infop->internal_lbasize = le32toh(infop->internal_lbasize);
+       infop->internal_nlba = le32toh(infop->internal_nlba);
+       infop->nfree = le32toh(infop->nfree);
+       infop->infosize = le32toh(infop->infosize);
+       infop->nextoff = le64toh(infop->nextoff);
+       infop->dataoff = le64toh(infop->dataoff);
+       infop->mapoff = le64toh(infop->mapoff);
+       infop->flogoff = le64toh(infop->flogoff);
+       infop->infooff = le64toh(infop->infooff);
+}
+
+/*
+ * btt_info_convert2le -- convert btt_info to little-endian byte order
+ */
+void
+btt_info_convert2le(struct btt_info *infop)
+{
+       infop->flags = le32toh(infop->flags);
+       infop->major = le16toh(infop->major);
+       infop->minor = le16toh(infop->minor);
+       infop->external_lbasize = le32toh(infop->external_lbasize);
+       infop->external_nlba = le32toh(infop->external_nlba);
+       infop->internal_lbasize = le32toh(infop->internal_lbasize);
+       infop->internal_nlba = le32toh(infop->internal_nlba);
+       infop->nfree = le32toh(infop->nfree);
+       infop->infosize = le32toh(infop->infosize);
+       infop->nextoff = le64toh(infop->nextoff);
+       infop->dataoff = le64toh(infop->dataoff);
+       infop->mapoff = le64toh(infop->mapoff);
+       infop->flogoff = le64toh(infop->flogoff);
+       infop->infooff = le64toh(infop->infooff);
+}
+
+/*
+ * btt_flog_convert2h -- convert btt_flog to host byte order
+ */
+void
+btt_flog_convert2h(struct btt_flog *flogp)
+{
+       flogp->lba = le32toh(flogp->lba);
+       flogp->old_map = le32toh(flogp->old_map);
+       flogp->new_map = le32toh(flogp->new_map);
+       flogp->seq = le32toh(flogp->seq);
+}
+
+/*
+ * btt_flog_convert2le -- convert btt_flog to LE byte order
+ */
+void
+btt_flog_convert2le(struct btt_flog *flogp)
+{
+       flogp->lba = htole32(flogp->lba);
+       flogp->old_map = htole32(flogp->old_map);
+       flogp->new_map = htole32(flogp->new_map);
+       flogp->seq = htole32(flogp->seq);
+}
+
+/*
+ * read_arenas -- (internal) load up all arenas and build run-time state
+ *
+ * On entry, layout must be known to be valid, and the number of arenas
+ * must be known.  Zero is returned on success, otherwise -1/errno.
+ */
+static int
+read_arenas(struct btt *bttp, unsigned lane, unsigned narena)
+{
+       LOG(3, "bttp %p lane %u narena %d", bttp, lane, narena);
+
+       if ((bttp->arenas = Zalloc(narena * sizeof(*bttp->arenas))) == NULL) {
+               ERR("!Malloc for %u arenas", narena);
+               goto err;
+       }
+
+       uint64_t arena_off = 0;
+       struct arena *arenap = bttp->arenas;
+       for (unsigned i = 0; i < narena; i++) {
+
+               if (read_arena(bttp, lane, arena_off, arenap) < 0)
+                       goto err;
+
+               /* prepare for next time around the loop */
+               arena_off = arenap->nextoff;
+               arenap++;
+       }
+
+       bttp->laidout = 1;
+
+       return 0;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (bttp->arenas) {
+               for (unsigned i = 0; i < bttp->narena; i++) {
+                       if (bttp->arenas[i].flogs)
+                               Free(bttp->arenas[i].flogs);
+                       if (bttp->arenas[i].rtt)
+                               Free((void *)bttp->arenas[i].rtt);
+                       if (bttp->arenas[i].map_locks)
+                               Free((void *)bttp->arenas[i].map_locks);
+               }
+               Free(bttp->arenas);
+               bttp->arenas = NULL;
+       }
+       errno = oerrno;
+       return -1;
+}
+
+/*
+ * internal_lbasize -- (internal) calculate internal LBA size
+ */
+static inline uint32_t
+internal_lbasize(uint32_t external_lbasize)
+{
+       uint32_t internal_lbasize = external_lbasize;
+       if (internal_lbasize < BTT_MIN_LBA_SIZE)
+               internal_lbasize = BTT_MIN_LBA_SIZE;
+       internal_lbasize =
+               roundup(internal_lbasize, BTT_INTERNAL_LBA_ALIGNMENT);
+       /* check for overflow */
+       if (internal_lbasize < BTT_INTERNAL_LBA_ALIGNMENT) {
+               errno = EINVAL;
+               ERR("!Invalid lba size after alignment: %u ", internal_lbasize);
+               return 0;
+       }
+
+       return internal_lbasize;
+}
+
+/*
+ * btt_flog_size -- calculate flog data size
+ */
+uint64_t
+btt_flog_size(uint32_t nfree)
+{
+       uint64_t flog_size = nfree * roundup(2 * sizeof(struct btt_flog),
+               BTT_FLOG_PAIR_ALIGN);
+       return roundup(flog_size, BTT_ALIGNMENT);
+}
+
+/*
+ * btt_map_size -- calculate map data size
+ */
+uint64_t
+btt_map_size(uint32_t external_nlba)
+{
+       return roundup(external_nlba * BTT_MAP_ENTRY_SIZE, BTT_ALIGNMENT);
+}
+
+/*
+ * btt_arena_datasize -- whole arena size without BTT Info header, backup and
+ *     flog means size of blocks and map
+ */
+uint64_t
+btt_arena_datasize(uint64_t arena_size, uint32_t nfree)
+{
+       return arena_size - 2 * sizeof(struct btt_info) - btt_flog_size(nfree);
+}
+
+/*
+ * btt_info_set_params -- (internal) calculate and set BTT Info
+ *     external_lbasize, internal_lbasize, nfree, infosize, external_nlba and
+ *     internal_nlba
+ */
+static int
+btt_info_set_params(struct btt_info *info, uint32_t external_lbasize,
+       uint32_t internal_lbasize, uint32_t nfree, uint64_t arena_size)
+{
+       info->external_lbasize = external_lbasize;
+       info->internal_lbasize = internal_lbasize;
+       info->nfree = nfree;
+       info->infosize = sizeof(*info);
+
+       uint64_t arena_data_size = btt_arena_datasize(arena_size, nfree);
+
+       /* allow for map alignment padding */
+       uint64_t internal_nlba = (arena_data_size - BTT_ALIGNMENT) /
+               (info->internal_lbasize + BTT_MAP_ENTRY_SIZE);
+
+       /* ensure the number of blocks is at least 2*nfree */
+       if (internal_nlba < 2 * nfree) {
+               errno = EINVAL;
+               ERR("!number of internal blocks: %" PRIu64
+                       " expected at least %u",
+                       internal_nlba, 2 * nfree);
+               return -1;
+       }
+
+       ASSERT(internal_nlba <= UINT32_MAX);
+       uint32_t internal_nlba_u32 = (uint32_t)internal_nlba;
+
+       info->internal_nlba = internal_nlba_u32;
+       /* external LBA does not include free blocks */
+       info->external_nlba = internal_nlba_u32 - info->nfree;
+
+       ASSERT((arena_data_size - btt_map_size(info->external_nlba)) /
+               internal_lbasize >= internal_nlba);
+
+       return 0;
+}
+
+/*
+ * btt_info_set_offs -- (internal) calculate and set the BTT Info dataoff,
+ *     nextoff, infooff, flogoff and mapoff. These are all relative to the
+ *     beginning of the arena.
+ */
+static void
+btt_info_set_offs(struct btt_info *info, uint64_t arena_size,
+       uint64_t space_left)
+{
+       info->dataoff = info->infosize;
+
+       /* set offset to next valid arena */
+       if (space_left >= BTT_MIN_SIZE)
+               info->nextoff = arena_size;
+       else
+               info->nextoff = 0;
+
+       info->infooff = arena_size - sizeof(struct btt_info);
+       info->flogoff = info->infooff - btt_flog_size(info->nfree);
+       info->mapoff = info->flogoff - btt_map_size(info->external_nlba);
+
+       ASSERTeq(btt_arena_datasize(arena_size, info->nfree) -
+               btt_map_size(info->external_nlba), info->mapoff -
+               info->dataoff);
+}
+
+/*
+ * btt_info_set -- set BTT Info params and offsets
+ */
+int
+btt_info_set(struct btt_info *info, uint32_t external_lbasize,
+       uint32_t nfree, uint64_t arena_size, uint64_t space_left)
+{
+       /* calculate internal LBA size */
+       uint32_t internal_lba_size = internal_lbasize(external_lbasize);
+       if (internal_lba_size == 0)
+               return -1;
+
+       /* set params and offsets */
+       if (btt_info_set_params(info, external_lbasize,
+                       internal_lba_size, nfree, arena_size))
+               return -1;
+
+       btt_info_set_offs(info, arena_size, space_left);
+
+       return 0;
+}
+
+/*
+ * write_layout -- (internal) write out the initial btt metadata layout
+ *
+ * Called with write == 1 only once in the life time of a btt namespace, when
+ * the first write happens.  The caller of this routine is responsible for
+ * locking out multiple threads.  This routine doesn't read anything -- by the
+ * time it is called, it is known there's no layout in the namespace and a new
+ * layout should be written.
+ *
+ * Calling with write == 0 tells this routine to do the calculations for
+ * bttp->narena and bttp->nlba, but don't write out any metadata.
+ *
+ * If successful, sets bttp->layout to 1 and returns 0.  Otherwise -1
+ * is returned and errno is set, and bttp->layout remains 0 so that
+ * later attempts to write will try again to create the layout.
+ */
+static int
+write_layout(struct btt *bttp, unsigned lane, int write)
+{
+       LOG(3, "bttp %p lane %u write %d", bttp, lane, write);
+
+       ASSERT(bttp->rawsize >= BTT_MIN_SIZE);
+       ASSERT(bttp->nfree);
+
+       /*
+        * If a new layout is being written, generate the BTT's UUID.
+        */
+       if (write) {
+               int ret = util_uuid_generate(bttp->uuid);
+               if (ret < 0) {
+                       LOG(2, "util_uuid_generate failed");
+                       return -1;
+               }
+       }
+
+       /*
+        * The number of arenas is the number of full arena of
+        * size BTT_MAX_ARENA that fit into rawsize and then, if
+        * the remainder is at least BTT_MIN_SIZE in size, then
+        * that adds one more arena.
+        */
+       bttp->narena = (unsigned)(bttp->rawsize / BTT_MAX_ARENA);
+       if (bttp->rawsize % BTT_MAX_ARENA >= BTT_MIN_SIZE)
+               bttp->narena++;
+       LOG(4, "narena %u", bttp->narena);
+
+       uint32_t internal_lba_size = internal_lbasize(bttp->lbasize);
+       if (internal_lba_size == 0)
+               return -1;
+       LOG(4, "adjusted internal_lbasize %u", internal_lba_size);
+
+       uint64_t total_nlba = 0;
+       uint64_t rawsize = bttp->rawsize;
+       unsigned arena_num = 0;
+       uint64_t arena_off = 0;
+
+       /*
+        * for each arena...
+        */
+       while (rawsize >= BTT_MIN_SIZE) {
+               LOG(4, "layout arena %u", arena_num);
+
+               uint64_t arena_rawsize = rawsize;
+               if (arena_rawsize > BTT_MAX_ARENA) {
+                       arena_rawsize = BTT_MAX_ARENA;
+               }
+               rawsize -= arena_rawsize;
+               arena_num++;
+
+               struct btt_info info;
+               memset(&info, '\0', sizeof(info));
+               if (btt_info_set_params(&info, bttp->lbasize,
+                               internal_lba_size, bttp->nfree, arena_rawsize))
+                       return -1;
+
+               LOG(4, "internal_nlba %u external_nlba %u",
+                       info.internal_nlba, info.external_nlba);
+
+               total_nlba += info.external_nlba;
+
+               /*
+                * The rest of the loop body calculates metadata structures
+                * and lays it out for this arena.  So only continue if
+                * the write flag is set.
+                */
+               if (!write)
+                       continue;
+
+               btt_info_set_offs(&info, arena_rawsize, rawsize);
+
+               LOG(4, "nextoff 0x%016" PRIx64, info.nextoff);
+               LOG(4, "dataoff 0x%016" PRIx64, info.dataoff);
+               LOG(4, "mapoff  0x%016" PRIx64, info.mapoff);
+               LOG(4, "flogoff 0x%016" PRIx64, info.flogoff);
+               LOG(4, "infooff 0x%016" PRIx64, info.infooff);
+
+               /* zero map if ns is not zero-initialized */
+               if (!bttp->ns_cbp->ns_is_zeroed) {
+                       uint64_t mapsize = btt_map_size(info.external_nlba);
+                       if ((*bttp->ns_cbp->nszero)(bttp->ns, lane, mapsize,
+                                       info.mapoff) < 0)
+                               return -1;
+               }
+
+               /* write out the initial flog */
+               uint64_t flog_entry_off = arena_off + info.flogoff;
+               uint32_t next_free_lba = info.external_nlba;
+               for (uint32_t i = 0; i < bttp->nfree; i++) {
+                       struct btt_flog flog;
+                       flog.lba = htole32(i);
+                       flog.old_map = flog.new_map =
+                               htole32(next_free_lba | BTT_MAP_ENTRY_ZERO);
+                       flog.seq = htole32(1);
+
+                       /*
+                        * Write both btt_flog structs in the pair, writing
+                        * the second one as all zeros.
+                        */
+                       LOG(6, "flog[%u] entry off %" PRIu64
+                                       " initial %u + zero = %u",
+                                       i, flog_entry_off,
+                                       next_free_lba,
+                                       next_free_lba | BTT_MAP_ENTRY_ZERO);
+                       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &flog,
+                                       sizeof(flog), flog_entry_off) < 0)
+                               return -1;
+                       flog_entry_off += sizeof(flog);
+
+                       LOG(6, "flog[%u] entry off %" PRIu64 " zeros",
+                                       i, flog_entry_off);
+                       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &Zflog,
+                                       sizeof(Zflog), flog_entry_off) < 0)
+                               return -1;
+                       flog_entry_off += sizeof(flog);
+                       flog_entry_off = roundup(flog_entry_off,
+                                       BTT_FLOG_PAIR_ALIGN);
+
+                       next_free_lba++;
+               }
+
+               /*
+                * Construct the BTT info block and write it out
+                * at both the beginning and end of the arena.
+                */
+               memcpy(info.sig, Sig, BTTINFO_SIG_LEN);
+               memcpy(info.uuid, bttp->uuid, BTTINFO_UUID_LEN);
+               memcpy(info.parent_uuid, bttp->parent_uuid, BTTINFO_UUID_LEN);
+               info.major = BTTINFO_MAJOR_VERSION;
+               info.minor = BTTINFO_MINOR_VERSION;
+               btt_info_convert2le(&info);
+
+               util_checksum(&info, sizeof(info), &info.checksum, 1, 0);
+
+               if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &info,
+                               sizeof(info), arena_off) < 0)
+                       return -1;
+               if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, &info,
+                               sizeof(info), arena_off + info.infooff) < 0)
+                       return -1;
+
+               arena_off += info.nextoff;
+       }
+
+       ASSERTeq(bttp->narena, arena_num);
+
+       bttp->nlba = total_nlba;
+
+       if (write) {
+               /*
+                * The layout is written now, so load up the arenas.
+                */
+               return read_arenas(bttp, lane, bttp->narena);
+       }
+
+       return 0;
+}
+
+/*
+ * read_layout -- (internal) load up layout info from btt namespace
+ *
+ * Called once when the btt namespace is opened for use.
+ * Sets bttp->layout to 0 if no valid layout is found, 1 otherwise.
+ *
+ * Any recovery actions required (as indicated by the flog state) are
+ * performed by this routine.
+ *
+ * Any quick checks for layout consistency are performed by this routine
+ * (quick enough to be done each time a BTT area is opened for use, not
+ * like the slow consistency checks done by btt_check()).
+ *
+ * Returns 0 if no errors are encountered accessing the namespace (in this
+ * context, detecting there's no layout is not an error if the nsread function
+ * didn't have any problems doing the reads).  Otherwise, -1 is returned
+ * and errno is set.
+ */
+static int
+read_layout(struct btt *bttp, unsigned lane)
+{
+       LOG(3, "bttp %p", bttp);
+
+       ASSERT(bttp->rawsize >= BTT_MIN_SIZE);
+
+       unsigned narena = 0;
+       uint32_t smallest_nfree = UINT32_MAX;
+       uint64_t rawsize = bttp->rawsize;
+       uint64_t total_nlba = 0;
+       uint64_t arena_off = 0;
+
+       bttp->nfree = BTT_DEFAULT_NFREE;
+
+       /*
+        * For each arena, see if there's a valid info block
+        */
+       while (rawsize >= BTT_MIN_SIZE) {
+               narena++;
+
+               struct btt_info info;
+               if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &info,
+                                       sizeof(info), arena_off) < 0)
+                       return -1;
+
+               if (!read_info(bttp, &info)) {
+                       /*
+                        * Failed to find complete BTT metadata.  Just
+                        * calculate the narena and nlba values that will
+                        * result when write_layout() gets called.  This
+                        * allows checks against nlba to work correctly
+                        * even before the layout is written.
+                        */
+                       return write_layout(bttp, lane, 0);
+               }
+               if (info.external_lbasize != bttp->lbasize) {
+                       /* can't read it assuming the wrong block size */
+                       ERR("inconsistent lbasize");
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               if (info.nfree == 0) {
+                       ERR("invalid nfree");
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               if (info.external_nlba == 0) {
+                       ERR("invalid external_nlba");
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               if (info.nextoff && (info.nextoff != BTT_MAX_ARENA)) {
+                       ERR("invalid arena size");
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               if (info.nfree < smallest_nfree)
+                       smallest_nfree = info.nfree;
+
+               total_nlba += info.external_nlba;
+               arena_off += info.nextoff;
+               if (info.nextoff == 0)
+                       break;
+               if (info.nextoff > rawsize) {
+                       ERR("invalid next arena offset");
+                       errno = EINVAL;
+                       return -1;
+               }
+               rawsize -= info.nextoff;
+       }
+
+       ASSERT(narena);
+
+       bttp->narena = narena;
+       bttp->nlba = total_nlba;
+
+       /*
+        * All arenas were valid.  nfree should be the smallest value found
+        * among different arenas.
+        */
+       if (smallest_nfree < bttp->nfree)
+               bttp->nfree = smallest_nfree;
+
+       /*
+        * Load up arenas.
+        */
+       return read_arenas(bttp, lane, narena);
+}
+
+/*
+ * zero_block -- (internal) satisfy a read with a block of zeros
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+static int
+zero_block(struct btt *bttp, void *buf)
+{
+       LOG(3, "bttp %p", bttp);
+
+       memset(buf, '\0', bttp->lbasize);
+       return 0;
+}
+
+/*
+ * lba_to_arena_lba -- (internal) calculate the arena & pre-map LBA
+ *
+ * This routine takes the external LBA and matches it to the
+ * appropriate arena, adjusting the lba for use within that arena.
+ *
+ * If successful, zero is returned, *arenapp is a pointer to the appropriate
+ * arena struct in the run-time state, and *premap_lbap is the LBA adjusted
+ * to an arena-internal LBA (also known as the pre-map LBA).  Otherwise
+ * -1/errno.
+ */
+static int
+lba_to_arena_lba(struct btt *bttp, uint64_t lba,
+               struct arena **arenapp, uint32_t *premap_lbap)
+{
+       LOG(3, "bttp %p lba %" PRIu64, bttp, lba);
+
+       ASSERT(bttp->laidout);
+
+       unsigned arena;
+       for (arena = 0; arena < bttp->narena; arena++)
+               if (lba < bttp->arenas[arena].external_nlba)
+                       break;
+               else
+                       lba -= bttp->arenas[arena].external_nlba;
+
+       ASSERT(arena < bttp->narena);
+
+       *arenapp = &bttp->arenas[arena];
+       ASSERT(lba <= UINT32_MAX);
+       *premap_lbap = (uint32_t)lba;
+
+       LOG(3, "arenap %p pre-map LBA %u", *arenapp, *premap_lbap);
+       return 0;
+}
+
+/*
+ * btt_init -- prepare a btt namespace for use, returning an opaque handle
+ *
+ * Returns handle on success, otherwise NULL/errno.
+ *
+ * When submitted a pristine namespace it will be formatted implicitly when
+ * touched for the first time.
+ *
+ * If arenas have different nfree values, we will be using the lowest one
+ * found as limiting to the overall "bandwidth".
+ */
+struct btt *
+btt_init(uint64_t rawsize, uint32_t lbasize, uint8_t parent_uuid[],
+               unsigned maxlane, void *ns, const struct ns_callback *ns_cbp)
+{
+       LOG(3, "rawsize %" PRIu64 " lbasize %u", rawsize, lbasize);
+
+       if (rawsize < BTT_MIN_SIZE) {
+               ERR("rawsize smaller than BTT_MIN_SIZE %u", BTT_MIN_SIZE);
+               errno = EINVAL;
+               return NULL;
+       }
+
+       struct btt *bttp = Zalloc(sizeof(*bttp));
+
+       if (bttp == NULL) {
+               ERR("!Malloc %zu bytes", sizeof(*bttp));
+               return NULL;
+       }
+
+       util_mutex_init(&bttp->layout_write_mutex);
+       memcpy(bttp->parent_uuid, parent_uuid, BTTINFO_UUID_LEN);
+       bttp->rawsize = rawsize;
+       bttp->lbasize = lbasize;
+       bttp->ns = ns;
+       bttp->ns_cbp = ns_cbp;
+
+       /*
+        * Load up layout, if it exists.
+        *
+        * Whether read_layout() finds a valid layout or not, it finishes
+        * updating these layout-related fields:
+        *      bttp->nfree
+        *      bttp->nlba
+        *      bttp->narena
+        * since these fields are used even before a valid layout it written.
+        */
+       if (read_layout(bttp, 0) < 0) {
+               btt_fini(bttp);         /* free up any allocations */
+               return NULL;
+       }
+
+       bttp->nlane = bttp->nfree;
+
+       /* maxlane, if provided, is an upper bound on nlane */
+       if (maxlane && bttp->nlane > maxlane)
+               bttp->nlane = maxlane;
+
+       LOG(3, "success, bttp %p nlane %u", bttp, bttp->nlane);
+       return bttp;
+}
+
+/*
+ * btt_nlane -- return the number of "lanes" for this btt namespace
+ *
+ * The number of lanes is the number of threads allowed in this module
+ * concurrently for a given btt.  Each thread executing this code must
+ * have a unique "lane" number assigned to it between 0 and btt_nlane() - 1.
+ */
+unsigned
+btt_nlane(struct btt *bttp)
+{
+       LOG(3, "bttp %p", bttp);
+
+       return bttp->nlane;
+}
+
+/*
+ * btt_nlba -- return the number of usable blocks in a btt namespace
+ *
+ * Valid LBAs to pass to btt_read() and btt_write() are 0 through
+ * btt_nlba() - 1.
+ */
+size_t
+btt_nlba(struct btt *bttp)
+{
+       LOG(3, "bttp %p", bttp);
+
+       return bttp->nlba;
+}
+
+/*
+ * btt_read -- read a block from a btt namespace
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+int
+btt_read(struct btt *bttp, unsigned lane, uint64_t lba, void *buf)
+{
+       LOG(3, "bttp %p lane %u lba %" PRIu64, bttp, lane, lba);
+
+       if (invalid_lba(bttp, lba))
+               return -1;
+
+       /* if there's no layout written yet, all reads come back as zeros */
+       if (!bttp->laidout)
+               return zero_block(bttp, buf);
+
+       /* find which arena LBA lives in, and the offset to the map entry */
+       struct arena *arenap;
+       uint32_t premap_lba;
+       uint64_t map_entry_off;
+       if (lba_to_arena_lba(bttp, lba, &arenap, &premap_lba) < 0)
+               return -1;
+
+       /* convert pre-map LBA into an offset into the map */
+       map_entry_off = arenap->mapoff + BTT_MAP_ENTRY_SIZE * premap_lba;
+
+       /*
+        * Read the current map entry to get the post-map LBA for the data
+        * block read.
+        */
+       uint32_t entry;
+
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &entry,
+                               sizeof(entry), map_entry_off) < 0)
+               return -1;
+
+       entry = le32toh(entry);
+
+       /*
+        * Retries come back to the top of this loop (for a rare case where
+        * the map is changed by another thread doing writes to the same LBA).
+        */
+       while (1) {
+               if (map_entry_is_error(entry)) {
+                       ERR("EIO due to map entry error flag");
+                       errno = EIO;
+                       return -1;
+               }
+
+               if (map_entry_is_zero_or_initial(entry))
+                       return zero_block(bttp, buf);
+
+               /*
+                * Record the post-map LBA in the read tracking table during
+                * the read.  The write will check entries in the read tracking
+                * table before allocating a block for a write, waiting for
+                * outstanding reads on that block to complete.
+                *
+                * Since we already checked for error, zero, and initial
+                * states above, the entry must have both error and zero
+                * bits set at this point (BTT_MAP_ENTRY_NORMAL).  We store
+                * the entry that way, with those bits set, in the rtt and
+                * btt_write() will check for it the same way, with the bits
+                * both set.
+                */
+               arenap->rtt[lane] = entry;
+               util_synchronize();
+
+               /*
+                * In case this thread was preempted between reading entry and
+                * storing it in the rtt, check to see if the map changed.  If
+                * it changed, the block about to be read is at least free now
+                * (in the flog, but that's okay since the data will still be
+                * undisturbed) and potentially allocated and being used for
+                * another write (data disturbed, so not okay to continue).
+                */
+               uint32_t latest_entry;
+               if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, &latest_entry,
+                               sizeof(latest_entry), map_entry_off) < 0) {
+                       arenap->rtt[lane] = BTT_MAP_ENTRY_ERROR;
+                       return -1;
+               }
+
+               latest_entry = le32toh(latest_entry);
+
+               if (entry == latest_entry)
+                       break;                  /* map stayed the same */
+               else
+                       entry = latest_entry;   /* try again */
+       }
+
+       /*
+        * It is safe to read the block now, since the rtt protects the
+        * block from getting re-allocated to something else by a write.
+        */
+       uint64_t data_block_off =
+               arenap->dataoff + (uint64_t)(entry & BTT_MAP_ENTRY_LBA_MASK) *
+               arenap->internal_lbasize;
+       int readret = (*bttp->ns_cbp->nsread)(bttp->ns, lane, buf,
+                                       bttp->lbasize, data_block_off);
+
+       /* done with read, so clear out rtt entry */
+       arenap->rtt[lane] = BTT_MAP_ENTRY_ERROR;
+
+       return readret;
+}
+
+/*
+ * map_lock -- (internal) grab the map_lock and read a map entry
+ */
+static int
+map_lock(struct btt *bttp, unsigned lane, struct arena *arenap,
+               uint32_t *entryp, uint32_t premap_lba)
+{
+       LOG(3, "bttp %p lane %u arenap %p premap_lba %u",
+                       bttp, lane, arenap, premap_lba);
+
+       uint64_t map_entry_off =
+                       arenap->mapoff + BTT_MAP_ENTRY_SIZE * premap_lba;
+       uint32_t map_lock_num = get_map_lock_num(premap_lba, bttp->nfree);
+
+       util_mutex_lock(&arenap->map_locks[map_lock_num]);
+
+       /* read the old map entry */
+       if ((*bttp->ns_cbp->nsread)(bttp->ns, lane, entryp,
+                               sizeof(uint32_t), map_entry_off) < 0) {
+               util_mutex_unlock(&arenap->map_locks[map_lock_num]);
+               return -1;
+       }
+
+       /* if map entry is in its initial state return premap_lba */
+       if (map_entry_is_initial(*entryp))
+               *entryp = htole32(premap_lba | BTT_MAP_ENTRY_NORMAL);
+
+       LOG(9, "locked map[%d]: %u%s%s", premap_lba,
+                       *entryp & BTT_MAP_ENTRY_LBA_MASK,
+                       (map_entry_is_error(*entryp)) ? " ERROR" : "",
+                       (map_entry_is_zero(*entryp)) ? " ZERO" : "");
+
+       return 0;
+}
+
+/*
+ * map_abort -- (internal) drop the map_lock without updating the entry
+ */
+static void
+map_abort(struct btt *bttp, unsigned lane, struct arena *arenap,
+               uint32_t premap_lba)
+{
+       LOG(3, "bttp %p lane %u arenap %p premap_lba %u",
+                       bttp, lane, arenap, premap_lba);
+
+       util_mutex_unlock(&arenap->map_locks[get_map_lock_num(premap_lba,
+                               bttp->nfree)]);
+}
+
+/*
+ * map_unlock -- (internal) update the map and drop the map_lock
+ */
+static int
+map_unlock(struct btt *bttp, unsigned lane, struct arena *arenap,
+               uint32_t entry, uint32_t premap_lba)
+{
+       LOG(3, "bttp %p lane %u arenap %p entry %u premap_lba %u",
+                       bttp, lane, arenap, entry, premap_lba);
+
+       uint64_t map_entry_off =
+                       arenap->mapoff + BTT_MAP_ENTRY_SIZE * premap_lba;
+
+       /* write the new map entry */
+       int err = (*bttp->ns_cbp->nswrite)(bttp->ns, lane, &entry,
+                               sizeof(uint32_t), map_entry_off);
+
+       util_mutex_unlock(&arenap->map_locks[get_map_lock_num(premap_lba,
+                               bttp->nfree)]);
+
+       LOG(9, "unlocked map[%d]: %u%s%s", premap_lba,
+                       entry & BTT_MAP_ENTRY_LBA_MASK,
+                       (map_entry_is_error(entry)) ? " ERROR" : "",
+                       (map_entry_is_zero(entry)) ? " ZERO" : "");
+
+       return err;
+}
+
+/*
+ * btt_write -- write a block to a btt namespace
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+int
+btt_write(struct btt *bttp, unsigned lane, uint64_t lba, const void *buf)
+{
+       LOG(3, "bttp %p lane %u lba %" PRIu64, bttp, lane, lba);
+
+       if (invalid_lba(bttp, lba))
+               return -1;
+
+       /* first write through here will initialize the metadata layout */
+       if (!bttp->laidout) {
+               int err = 0;
+
+               util_mutex_lock(&bttp->layout_write_mutex);
+
+               if (!bttp->laidout)
+                       err = write_layout(bttp, lane, 1);
+
+               util_mutex_unlock(&bttp->layout_write_mutex);
+
+               if (err < 0)
+                       return err;
+       }
+
+       /* find which arena LBA lives in, and the offset to the map entry */
+       struct arena *arenap;
+       uint32_t premap_lba;
+       if (lba_to_arena_lba(bttp, lba, &arenap, &premap_lba) < 0)
+               return -1;
+
+       /* if the arena is in an error state, writing is not allowed */
+       if (arenap->flags & BTTINFO_FLAG_ERROR_MASK) {
+               ERR("EIO due to btt_info error flags 0x%x",
+                       arenap->flags & BTTINFO_FLAG_ERROR_MASK);
+               errno = EIO;
+               return -1;
+       }
+
+       /*
+        * This routine was passed a unique "lane" which is an index
+        * into the flog.  That means the free block held by flog[lane]
+        * is assigned to this thread and to no other threads (no additional
+        * locking required).  So start by performing the write to the
+        * free block.  It is only safe to write to a free block if it
+        * doesn't appear in the read tracking table, so scan that first
+        * and if found, wait for the thread reading from it to finish.
+        */
+       uint32_t free_entry = (arenap->flogs[lane].flog.old_map &
+                       BTT_MAP_ENTRY_LBA_MASK) | BTT_MAP_ENTRY_NORMAL;
+
+       LOG(3, "free_entry %u (before mask %u)", free_entry,
+                               arenap->flogs[lane].flog.old_map);
+
+       /* wait for other threads to finish any reads on free block */
+       for (unsigned i = 0; i < bttp->nlane; i++)
+               while (arenap->rtt[i] == free_entry)
+                       ;
+
+       /* it is now safe to perform write to the free block */
+       uint64_t data_block_off = arenap->dataoff +
+               (uint64_t)(free_entry & BTT_MAP_ENTRY_LBA_MASK) *
+               arenap->internal_lbasize;
+       if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, buf,
+                               bttp->lbasize, data_block_off) < 0)
+               return -1;
+
+       /*
+        * Make the new block active atomically by updating the on-media flog
+        * and then updating the map.
+        */
+       uint32_t old_entry;
+       if (map_lock(bttp, lane, arenap, &old_entry, premap_lba) < 0)
+               return -1;
+
+       old_entry = le32toh(old_entry);
+
+       /* update the flog */
+       if (flog_update(bttp, lane, arenap, premap_lba,
+                                       old_entry, free_entry) < 0) {
+               map_abort(bttp, lane, arenap, premap_lba);
+               return -1;
+       }
+
+       if (map_unlock(bttp, lane, arenap, htole32(free_entry),
+                                       premap_lba) < 0) {
+               /*
+                * A critical write error occurred, set the arena's
+                * info block error bit.
+                */
+               set_arena_error(bttp, arenap, lane);
+               errno = EIO;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * map_entry_setf -- (internal) set a given flag on a map entry
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+static int
+map_entry_setf(struct btt *bttp, unsigned lane, uint64_t lba, uint32_t setf)
+{
+       LOG(3, "bttp %p lane %u lba %" PRIu64 " setf 0x%x",
+           bttp, lane, lba, setf);
+
+       if (invalid_lba(bttp, lba))
+               return -1;
+
+       if (!bttp->laidout) {
+               /*
+                * No layout is written yet.  If the flag being set
+                * is the zero flag, it is superfluous since all blocks
+                * read as zero at this point.
+                */
+               if (setf == BTT_MAP_ENTRY_ZERO)
+                       return 0;
+
+               /*
+                * Treat this like the first write and write out
+                * the metadata layout at this point.
+                */
+               int err = 0;
+               util_mutex_lock(&bttp->layout_write_mutex);
+
+               if (!bttp->laidout)
+                       err = write_layout(bttp, lane, 1);
+
+               util_mutex_unlock(&bttp->layout_write_mutex);
+
+               if (err < 0)
+                       return err;
+       }
+
+       /* find which arena LBA lives in, and the offset to the map entry */
+       struct arena *arenap;
+       uint32_t premap_lba;
+       if (lba_to_arena_lba(bttp, lba, &arenap, &premap_lba) < 0)
+               return -1;
+
+       /* if the arena is in an error state, writing is not allowed */
+       if (arenap->flags & BTTINFO_FLAG_ERROR_MASK) {
+               ERR("EIO due to btt_info error flags 0x%x",
+                       arenap->flags & BTTINFO_FLAG_ERROR_MASK);
+               errno = EIO;
+               return -1;
+       }
+
+       /*
+        * Set the flags in the map entry.  To do this, read the
+        * current map entry, set the flags, and write out the update.
+        */
+       uint32_t old_entry;
+       uint32_t new_entry;
+
+       if (map_lock(bttp, lane, arenap, &old_entry, premap_lba) < 0)
+               return -1;
+
+       old_entry = le32toh(old_entry);
+
+       if (setf == BTT_MAP_ENTRY_ZERO &&
+                       map_entry_is_zero_or_initial(old_entry)) {
+               map_abort(bttp, lane, arenap, premap_lba);
+               return 0;       /* block already zero, nothing to do */
+       }
+
+       /* create the new map entry */
+       new_entry = (old_entry & BTT_MAP_ENTRY_LBA_MASK) | setf;
+
+       if (map_unlock(bttp, lane, arenap, htole32(new_entry), premap_lba) < 0)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * btt_set_zero -- mark a block as zeroed in a btt namespace
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+int
+btt_set_zero(struct btt *bttp, unsigned lane, uint64_t lba)
+{
+       LOG(3, "bttp %p lane %u lba %" PRIu64, bttp, lane, lba);
+
+       return map_entry_setf(bttp, lane, lba, BTT_MAP_ENTRY_ZERO);
+}
+
+/*
+ * btt_set_error -- mark a block as in an error state in a btt namespace
+ *
+ * Returns 0 on success, otherwise -1/errno.
+ */
+int
+btt_set_error(struct btt *bttp, unsigned lane, uint64_t lba)
+{
+       LOG(3, "bttp %p lane %u lba %" PRIu64, bttp, lane, lba);
+
+       return map_entry_setf(bttp, lane, lba, BTT_MAP_ENTRY_ERROR);
+}
+
+/*
+ * check_arena -- (internal) perform a consistency check on an arena
+ */
+static int
+check_arena(struct btt *bttp, struct arena *arenap)
+{
+       LOG(3, "bttp %p arenap %p", bttp, arenap);
+
+       int consistent = 1;
+
+       uint64_t map_entry_off = arenap->mapoff;
+       uint32_t bitmapsize = howmany(arenap->internal_nlba, 8);
+       uint8_t *bitmap = Zalloc(bitmapsize);
+       if (bitmap == NULL) {
+               ERR("!Malloc for bitmap");
+               return -1;
+       }
+
+       /*
+        * Go through every post-map LBA mentioned in the map and make sure
+        * there are no duplicates.  bitmap is used to track which LBAs have
+        * been seen so far.
+        */
+       uint32_t *mapp = NULL;
+       ssize_t mlen;
+       int next_index = 0;
+       size_t remaining = 0;
+       for (uint32_t i = 0; i < arenap->external_nlba; i++) {
+               uint32_t entry;
+
+               if (remaining == 0) {
+                       /* request a mapping of remaining map area */
+                       size_t req_len =
+                               (arenap->external_nlba - i) * sizeof(uint32_t);
+                       mlen = (*bttp->ns_cbp->nsmap)(bttp->ns, 0,
+                               (void **)&mapp, req_len, map_entry_off);
+
+                       if (mlen < 0)
+                               return -1;
+
+                       remaining = (size_t)mlen;
+                       next_index = 0;
+               }
+               entry = le32toh(mapp[next_index]);
+
+               /* for debug, dump non-zero map entries at log level 11 */
+               if (map_entry_is_zero_or_initial(entry) == 0)
+                       LOG(11, "map[%d]: %u%s", i,
+                               entry & BTT_MAP_ENTRY_LBA_MASK,
+                               (map_entry_is_error(entry)) ? " ERROR" : "");
+
+               /* this is an uninitialized map entry, set the default value */
+               if (map_entry_is_initial(entry))
+                       entry = i;
+               else
+                       entry &= BTT_MAP_ENTRY_LBA_MASK;
+
+               /* check if entry is valid */
+               if (entry >= arenap->internal_nlba) {
+                       ERR("map[%d] entry out of bounds: %u", i, entry);
+                       errno = EINVAL;
+                       return -1;
+               }
+
+               if (util_isset(bitmap, entry)) {
+                       ERR("map[%d] duplicate entry: %u", i, entry);
+                       consistent = 0;
+               } else
+                       util_setbit(bitmap, entry);
+
+               map_entry_off += sizeof(uint32_t);
+               next_index++;
+               ASSERT(remaining >= sizeof(uint32_t));
+               remaining -= sizeof(uint32_t);
+       }
+
+       /*
+        * Go through the free blocks in the flog, adding them to bitmap
+        * and checking for duplications.  It is sufficient to read the
+        * run-time flog here, avoiding more calls to nsread.
+        */
+       for (uint32_t i = 0; i < bttp->nfree; i++) {
+               uint32_t entry = arenap->flogs[i].flog.old_map;
+               entry &= BTT_MAP_ENTRY_LBA_MASK;
+
+               if (util_isset(bitmap, entry)) {
+                       ERR("flog[%u] duplicate entry: %u", i, entry);
+                       consistent = 0;
+               } else
+                       util_setbit(bitmap, entry);
+       }
+
+       /*
+        * Make sure every possible post-map LBA was accounted for
+        * in the two loops above.
+        */
+       for (uint32_t i = 0; i < arenap->internal_nlba; i++)
+               if (util_isclr(bitmap, i)) {
+                       ERR("unreferenced lba: %d", i);
+                       consistent = 0;
+               }
+
+       Free(bitmap);
+
+       return consistent;
+}
+
+/*
+ * btt_check -- perform a consistency check on a btt namespace
+ *
+ * This routine contains a fairly high-impact set of consistency checks.
+ * It may use a good amount of dynamic memory and CPU time performing
+ * the checks.  Any lightweight, quick consistency checks are included
+ * in read_layout() so they happen every time the BTT area is opened
+ * for use.
+ *
+ * Returns true if consistent, zero if inconsistent, -1/error if checking
+ * cannot happen due to other errors.
+ *
+ * No lane number required here because only one thread is allowed -- all
+ * other threads must be locked out of all btt routines for this btt
+ * namespace while this is running.
+ */
+int
+btt_check(struct btt *bttp)
+{
+       LOG(3, "bttp %p", bttp);
+
+       int consistent = 1;
+
+       if (!bttp->laidout) {
+               /* consistent by definition */
+               LOG(3, "no layout yet");
+               return consistent;
+       }
+
+       /* XXX report issues found during read_layout (from flags) */
+
+       /* for each arena... */
+       struct arena *arenap = bttp->arenas;
+       for (unsigned i = 0; i < bttp->narena; i++, arenap++) {
+               /*
+                * Perform the consistency checks for the arena.
+                */
+               int retval = check_arena(bttp, arenap);
+               if (retval < 0)
+                       return retval;
+               else if (retval == 0)
+                       consistent = 0;
+       }
+
+       /* XXX stub */
+       return consistent;
+}
+
+/*
+ * btt_fini -- delete opaque btt info, done using btt namespace
+ */
+void
+btt_fini(struct btt *bttp)
+{
+       LOG(3, "bttp %p", bttp);
+
+       if (bttp->arenas) {
+               for (unsigned i = 0; i < bttp->narena; i++) {
+                       if (bttp->arenas[i].flogs)
+                               Free(bttp->arenas[i].flogs);
+                       if (bttp->arenas[i].rtt)
+                               Free((void *)bttp->arenas[i].rtt);
+                       if (bttp->arenas[i].rtt)
+                               Free((void *)bttp->arenas[i].map_locks);
+               }
+               Free(bttp->arenas);
+       }
+       Free(bttp);
+}
diff --git a/ceph/src/pmdk/src/libpmemblk/btt.h b/ceph/src/pmdk/src/libpmemblk/btt.h
new file mode 100644 (file)
index 0000000..94f6994
--- /dev/null
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * btt.h -- btt module definitions
+ */
+
+#ifndef BTT_H
+#define BTT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* callback functions passed to btt_init() */
+struct ns_callback {
+       int (*nsread)(void *ns, unsigned lane,
+               void *buf, size_t count, uint64_t off);
+       int (*nswrite)(void *ns, unsigned lane,
+               const void *buf, size_t count, uint64_t off);
+       int (*nszero)(void *ns, unsigned lane, size_t count, uint64_t off);
+       ssize_t (*nsmap)(void *ns, unsigned lane, void **addrp,
+                       size_t len, uint64_t off);
+       void (*nssync)(void *ns, unsigned lane, void *addr, size_t len);
+
+       int ns_is_zeroed;
+};
+
+struct btt_info;
+
+struct btt *btt_init(uint64_t rawsize, uint32_t lbasize, uint8_t parent_uuid[],
+               unsigned maxlane, void *ns, const struct ns_callback *ns_cbp);
+unsigned btt_nlane(struct btt *bttp);
+size_t btt_nlba(struct btt *bttp);
+int btt_read(struct btt *bttp, unsigned lane, uint64_t lba, void *buf);
+int btt_write(struct btt *bttp, unsigned lane, uint64_t lba, const void *buf);
+int btt_set_zero(struct btt *bttp, unsigned lane, uint64_t lba);
+int btt_set_error(struct btt *bttp, unsigned lane, uint64_t lba);
+int btt_check(struct btt *bttp);
+void btt_fini(struct btt *bttp);
+
+uint64_t btt_flog_size(uint32_t nfree);
+uint64_t btt_map_size(uint32_t external_nlba);
+uint64_t btt_arena_datasize(uint64_t arena_size, uint32_t nfree);
+int btt_info_set(struct btt_info *info, uint32_t external_lbasize,
+       uint32_t nfree, uint64_t arena_size, uint64_t space_left);
+
+struct btt_flog *btt_flog_get_valid(struct btt_flog *flog_pair, int *next);
+int map_entry_is_initial(uint32_t map_entry);
+void btt_info_convert2h(struct btt_info *infop);
+void btt_info_convert2le(struct btt_info *infop);
+void btt_flog_convert2h(struct btt_flog *flogp);
+void btt_flog_convert2le(struct btt_flog *flogp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemblk/btt_layout.h b/ceph/src/pmdk/src/libpmemblk/btt_layout.h
new file mode 100644 (file)
index 0000000..8fa33f9
--- /dev/null
@@ -0,0 +1,107 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * btt_layout.h -- block translation table on-media layout definitions
+ */
+
+/*
+ * Layout of BTT info block.  All integers are stored little-endian.
+ */
+
+#ifndef BTT_LAYOUT_H
+#define BTT_LAYOUT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define BTT_ALIGNMENT ((uintptr_t)4096)        /* alignment of all BTT structures */
+#define BTTINFO_SIG_LEN 16
+#define BTTINFO_UUID_LEN 16
+#define BTTINFO_UNUSED_LEN 3968
+#define BTTINFO_SIG            "BTT_ARENA_INFO\0"
+
+struct btt_info {
+       char sig[BTTINFO_SIG_LEN];      /* must be "BTT_ARENA_INFO\0\0" */
+       uint8_t uuid[BTTINFO_UUID_LEN]; /* BTT UUID */
+       uint8_t parent_uuid[BTTINFO_UUID_LEN];  /* UUID of container */
+       uint32_t flags;                 /* see flag bits below */
+       uint16_t major;                 /* major version */
+       uint16_t minor;                 /* minor version */
+       uint32_t external_lbasize;      /* advertised LBA size (bytes) */
+       uint32_t external_nlba;         /* advertised LBAs in this arena */
+       uint32_t internal_lbasize;      /* size of data area blocks (bytes) */
+       uint32_t internal_nlba;         /* number of blocks in data area */
+       uint32_t nfree;                 /* number of free blocks */
+       uint32_t infosize;              /* size of this info block */
+
+       /*
+        * The following offsets are relative to the beginning of
+        * the btt_info block.
+        */
+       uint64_t nextoff;               /* offset to next arena (or zero) */
+       uint64_t dataoff;               /* offset to arena data area */
+       uint64_t mapoff;                /* offset to area map */
+       uint64_t flogoff;               /* offset to area flog */
+       uint64_t infooff;               /* offset to backup info block */
+
+       char unused[BTTINFO_UNUSED_LEN];        /* must be zero */
+
+       uint64_t checksum;              /* Fletcher64 of all fields */
+};
+
+/*
+ * Definitions for flags mask for btt_info structure above.
+ */
+#define BTTINFO_FLAG_ERROR     0x00000001 /* error state (read-only) */
+#define BTTINFO_FLAG_ERROR_MASK        0x00000001 /* all error bits */
+
+/*
+ * Current on-media format versions.
+ */
+#define BTTINFO_MAJOR_VERSION 1
+#define BTTINFO_MINOR_VERSION 1
+
+/*
+ * Layout of a BTT "flog" entry.  All integers are stored little-endian.
+ *
+ * The "nfree" field in the BTT info block determines how many of these
+ * flog entries there are, and each entry consists of two of the following
+ * structs (entry updates alternate between the two structs), padded up
+ * to a cache line boundary to isolate adjacent updates.
+ */
+
+#define BTT_FLOG_PAIR_ALIGN ((uintptr_t)64)
+
+struct btt_flog {
+       uint32_t lba;           /* last pre-map LBA using this entry */
+       uint32_t old_map;       /* old post-map LBA (the freed block) */
+       uint32_t new_map;       /* new post-map LBA */
+       uint32_t seq;           /* sequence number (01, 10, 11) */
+};
+
+/*
+ * Layout of a BTT "map" entry.  4-byte internal LBA offset, little-endian.
+ */
+#define BTT_MAP_ENTRY_SIZE 4
+#define BTT_MAP_ENTRY_ERROR 0x40000000U
+#define BTT_MAP_ENTRY_ZERO 0x80000000U
+#define BTT_MAP_ENTRY_NORMAL 0xC0000000U
+#define BTT_MAP_ENTRY_LBA_MASK 0x3fffffffU
+#define BTT_MAP_LOCK_ALIGN ((uintptr_t)64)
+
+/*
+ * BTT layout properties...
+ */
+#define BTT_MIN_SIZE ((1u << 20) * 16)
+#define BTT_MAX_ARENA (1ull << 39) /* 512GB per arena */
+#define BTT_MIN_LBA_SIZE (size_t)512
+#define BTT_INTERNAL_LBA_ALIGNMENT 256U
+#define BTT_DEFAULT_NFREE 256
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.c b/ceph/src/pmdk/src/libpmemblk/libpmemblk.c
new file mode 100644 (file)
index 0000000..21675ef
--- /dev/null
@@ -0,0 +1,200 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * libpmemblk.c -- pmem entry points for libpmemblk
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "libpmemblk.h"
+#include "ctl_global.h"
+
+#include "pmemcommon.h"
+#include "blk.h"
+
+/*
+ * The variable from which the config is directly loaded. The string
+ * cannot contain any comments or extraneous white characters.
+ */
+#define BLK_CONFIG_ENV_VARIABLE "PMEMBLK_CONF"
+
+/*
+ * The variable that points to a config file from which the config is loaded.
+ */
+#define BLK_CONFIG_FILE_ENV_VARIABLE "PMEMBLK_CONF_FILE"
+
+/*
+ * blk_ctl_init_and_load -- (static) initializes CTL and loads configuration
+ *     from env variable and file
+ */
+static int
+blk_ctl_init_and_load(PMEMblkpool *pbp)
+{
+       LOG(3, "pbp %p", pbp);
+
+       if (pbp != NULL && (pbp->ctl = ctl_new()) == NULL) {
+               LOG(2, "!ctl_new");
+               return -1;
+       }
+
+       char *env_config = os_getenv(BLK_CONFIG_ENV_VARIABLE);
+       if (env_config != NULL) {
+               if (ctl_load_config_from_string(pbp ? pbp->ctl : NULL,
+                               pbp, env_config) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "environment variable",
+                               BLK_CONFIG_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       char *env_config_file = os_getenv(BLK_CONFIG_FILE_ENV_VARIABLE);
+       if (env_config_file != NULL && env_config_file[0] != '\0') {
+               if (ctl_load_config_from_file(pbp ? pbp->ctl : NULL,
+                               pbp, env_config_file) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "file (from %s environment variable)",
+                               env_config_file,
+                               BLK_CONFIG_FILE_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       return 0;
+err:
+       if (pbp)
+               ctl_delete(pbp->ctl);
+       return -1;
+}
+
+/*
+ * libpmemblk_init -- (internal) load-time initialization for blk
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmemblk_init(void)
+{
+       ctl_global_register();
+
+       if (blk_ctl_init_and_load(NULL))
+               FATAL("error: %s", pmemblk_errormsg());
+
+       common_init(PMEMBLK_LOG_PREFIX, PMEMBLK_LOG_LEVEL_VAR,
+                       PMEMBLK_LOG_FILE_VAR, PMEMBLK_MAJOR_VERSION,
+                       PMEMBLK_MINOR_VERSION);
+       LOG(3, NULL);
+}
+
+/*
+ * libpmemblk_fini -- libpmemblk cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmemblk_fini(void)
+{
+       LOG(3, NULL);
+       common_fini();
+}
+
+/*
+ * pmemblk_check_versionU -- see if lib meets application version requirements
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemblk_check_versionU(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != PMEMBLK_MAJOR_VERSION) {
+               ERR("libpmemblk major version mismatch (need %u, found %u)",
+                       major_required, PMEMBLK_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > PMEMBLK_MINOR_VERSION) {
+               ERR("libpmemblk minor version mismatch (need %u, found %u)",
+                       minor_required, PMEMBLK_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_check_version -- see if lib meets application version requirements
+ */
+const char *
+pmemblk_check_version(unsigned major_required, unsigned minor_required)
+{
+       return pmemblk_check_versionU(major_required, minor_required);
+}
+#else
+/*
+ * pmemblk_check_versionW -- see if lib meets application version requirements
+ */
+const wchar_t *
+pmemblk_check_versionW(unsigned major_required, unsigned minor_required)
+{
+       if (pmemblk_check_versionU(major_required, minor_required) != NULL)
+               return out_get_errormsgW();
+       else
+               return NULL;
+}
+#endif
+
+/*
+ * pmemblk_set_funcs -- allow overriding libpmemblk's call to malloc, etc.
+ */
+void
+pmemblk_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s))
+{
+       LOG(3, NULL);
+
+       util_set_alloc_funcs(malloc_func, free_func, realloc_func, strdup_func);
+}
+
+/*
+ * pmemblk_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemblk_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmemblk_errormsg -- return last error message
+ */
+const char *
+pmemblk_errormsg(void)
+{
+       return pmemblk_errormsgU();
+}
+#else
+/*
+ * pmemblk_errormsgW -- return last error message as wchar_t
+ */
+const wchar_t *
+pmemblk_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.def b/ceph/src/pmdk/src/libpmemblk/libpmemblk.def
new file mode 100644 (file)
index 0000000..fa7f91f
--- /dev/null
@@ -0,0 +1,36 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2015-2018, Intel Corporation
+;;;;  End Copyright Notice
+
+LIBRARY libpmemblk
+
+VERSION 1.0
+
+EXPORTS
+       pmemblk_check_versionU
+       pmemblk_check_versionW
+       pmemblk_set_funcs
+       pmemblk_errormsgU
+       pmemblk_errormsgW
+       pmemblk_createU
+       pmemblk_createW
+       pmemblk_openU
+       pmemblk_openW
+       pmemblk_close
+       pmemblk_checkU
+       pmemblk_checkW
+       pmemblk_ctl_execU;
+       pmemblk_ctl_execW;
+       pmemblk_ctl_getU;
+       pmemblk_ctl_getW;
+       pmemblk_ctl_setU;
+       pmemblk_ctl_setW;
+       pmemblk_bsize
+       pmemblk_nblock
+       pmemblk_read
+       pmemblk_write
+       pmemblk_set_zero
+       pmemblk_set_error
+
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.link.in b/ceph/src/pmdk/src/libpmemblk/libpmemblk.link.in
new file mode 100644 (file)
index 0000000..b61e83c
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2019, Intel Corporation
+#
+#
+# src/libpmemblk.link -- linker link file for libpmemblk
+#
+LIBPMEMBLK_1.0 {
+       global:
+               pmemblk_check_version;
+               pmemblk_set_funcs;
+               pmemblk_errormsg;
+               pmemblk_create;
+               pmemblk_open;
+               pmemblk_close;
+               pmemblk_check;
+               pmemblk_ctl_exec;
+               pmemblk_ctl_get;
+               pmemblk_ctl_set;
+               pmemblk_nblock;
+               pmemblk_read;
+               pmemblk_write;
+               pmemblk_set_zero;
+               pmemblk_set_error;
+               pmemblk_bsize;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.rc b/ceph/src/pmdk/src/libpmemblk/libpmemblk.rc
new file mode 100644 (file)
index 0000000..b95b625
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016, Intel Corporation */
+
+/*
+ * libpmemblk.rc -- libpmemblk resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemblk.dll"
+#define DESCRIPTION "libpmemblk - persistent memory resident array of blocks"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj b/ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj
new file mode 100644 (file)
index 0000000..680052a
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemblk\blk.c" />
+    <ClCompile Include="..\..\src\libpmemblk\btt.c" />
+    <ClCompile Include="..\..\src\libpmemblk\libpmemblk.c" />
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\common\set_badblocks.c" />
+    <ClCompile Include="..\common\ctl.c" />
+    <ClCompile Include="..\common\ctl_cow.c" />
+    <ClCompile Include="..\common\ctl_prefault.c" />
+    <ClCompile Include="..\common\ctl_sds.c" />
+    <ClCompile Include="..\common\ctl_fallocate.c" />
+    <ClCompile Include="..\common\file.c" />
+    <ClCompile Include="..\common\file_windows.c" />
+    <ClCompile Include="..\common\mmap.c" />
+    <ClCompile Include="..\common\mmap_windows.c" />
+    <ClCompile Include="..\core\fs_windows.c" />
+    <ClCompile Include="..\common\bad_blocks.c" />
+    <ClCompile Include="..\common\os_deep_windows.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\pool_hdr.c" />
+    <ClCompile Include="..\common\set.c" />
+    <ClCompile Include="..\common\shutdown_state.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="..\common\uuid.c" />
+    <ClCompile Include="..\common\uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem2\usc_windows.c" />
+    <ClCompile Include="libpmemblk_main.c" />
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\badblocks.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h" />
+    <ClInclude Include="..\..\src\core\util.h" />
+    <ClInclude Include="..\..\src\common\valgrind_internal.h" />
+    <ClInclude Include="..\..\src\include\libpmemblk.h" />
+    <ClInclude Include="..\..\src\libpmemblk\blk.h" />
+    <ClInclude Include="..\..\src\libpmemblk\btt.h" />
+    <ClInclude Include="..\..\src\libpmemblk\btt_layout.h" />
+    <ClInclude Include="..\core\alloc.h" />
+    <ClInclude Include="..\common\ctl.h" />
+    <ClInclude Include="..\common\ctl_global.h" />
+    <ClInclude Include="..\common\dlsym.h" />
+    <ClInclude Include="..\core\fault_injection.h" />
+    <ClInclude Include="..\common\file.h" />
+    <ClInclude Include="..\core\fs.h" />
+    <ClInclude Include="..\common\mmap.h" />
+    <ClInclude Include="..\core\os.h" />
+    <ClInclude Include="..\common\os_deep.h" />
+    <ClInclude Include="..\core\os_thread.h" />
+    <ClInclude Include="..\common\pmemcommon.h" />
+    <ClInclude Include="..\common\pool_hdr.h" />
+    <ClInclude Include="..\common\set.h" />
+    <ClInclude Include="..\common\sys_util.h" />
+    <ClInclude Include="..\common\uuid.h" />
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemblk.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\libpmem\libpmem.vcxproj">
+      <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemblk.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmemblk</ProjectName>
+    <RootNamespace>libpmemblk</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj.filters b/ceph/src/pmdk/src/libpmemblk/libpmemblk.vcxproj.filters
new file mode 100644 (file)
index 0000000..1985959
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{5f4b56cf-a674-4f35-abfa-d867d9d91f68}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{dee0ff57-9af8-485a-888b-0087d6e11cf8}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemblk\blk.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemblk\btt.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemblk\libpmemblk.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmemblk_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\shutdown_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set_badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_prefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_fallocate.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_sds.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_cow.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\include\libpmemblk.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemblk\blk.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemblk\btt.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemblk\btt_layout.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\common\valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pmemcommon.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl_global.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemblk.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemblk.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemblk/libpmemblk_main.c b/ceph/src/pmdk/src/libpmemblk/libpmemblk_main.c
new file mode 100644 (file)
index 0000000..28c547d
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2017, Intel Corporation */
+
+/*
+ * libpmemblk_main.c -- entry point for libpmemblk.dll
+ *
+ * XXX - This is a placeholder.  All the library initialization/cleanup
+ * that is done in library ctors/dtors, as well as TLS initialization
+ * should be moved here.
+ */
+
+void libpmemblk_init(void);
+void libpmemblk_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmemblk_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               libpmemblk_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmemlog/Makefile b/ceph/src/pmdk/src/libpmemlog/Makefile
new file mode 100644 (file)
index 0000000..25fa84d
--- /dev/null
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# src/libpmemlog/Makefile -- Makefile for libpmemlog
+#
+
+LIBRARY_NAME = pmemlog
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+
+include ../core/pmemcore.inc
+include ../common/pmemcommon.inc
+
+SOURCE +=\
+       libpmemlog.c\
+       log.c
+
+include ../Makefile.inc
+
+CFLAGS += $(LIBNDCTL_CFLAGS)
+
+LIBS += -pthread -lpmem $(LIBNDCTL_LIBS)
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.c b/ceph/src/pmdk/src/libpmemlog/libpmemlog.c
new file mode 100644 (file)
index 0000000..c24e0c7
--- /dev/null
@@ -0,0 +1,201 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * libpmemlog.c -- pmem entry points for libpmemlog
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "libpmemlog.h"
+#include "ctl_global.h"
+
+#include "pmemcommon.h"
+#include "log.h"
+
+/*
+ * The variable from which the config is directly loaded. The string
+ * cannot contain any comments or extraneous white characters.
+ */
+#define LOG_CONFIG_ENV_VARIABLE "PMEMLOG_CONF"
+
+/*
+ * The variable that points to a config file from which the config is loaded.
+ */
+#define LOG_CONFIG_FILE_ENV_VARIABLE "PMEMLOG_CONF_FILE"
+
+/*
+ * log_ctl_init_and_load -- (static) initializes CTL and loads configuration
+ *     from env variable and file
+ */
+static int
+log_ctl_init_and_load(PMEMlogpool *plp)
+{
+       LOG(3, "plp %p", plp);
+
+       if (plp != NULL && (plp->ctl = ctl_new()) == NULL) {
+               LOG(2, "!ctl_new");
+               return -1;
+       }
+
+       char *env_config = os_getenv(LOG_CONFIG_ENV_VARIABLE);
+       if (env_config != NULL) {
+               if (ctl_load_config_from_string(plp ? plp->ctl : NULL,
+                               plp, env_config) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "environment variable",
+                               LOG_CONFIG_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       char *env_config_file = os_getenv(LOG_CONFIG_FILE_ENV_VARIABLE);
+       if (env_config_file != NULL && env_config_file[0] != '\0') {
+               if (ctl_load_config_from_file(plp ? plp->ctl : NULL,
+                               plp, env_config_file) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "file (from %s environment variable)",
+                               env_config_file,
+                               LOG_CONFIG_FILE_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       return 0;
+err:
+       if (plp)
+               ctl_delete(plp->ctl);
+       return -1;
+}
+
+/*
+ * log_init -- load-time initialization for log
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmemlog_init(void)
+{
+       ctl_global_register();
+
+       if (log_ctl_init_and_load(NULL))
+               FATAL("error: %s", pmemlog_errormsg());
+
+       common_init(PMEMLOG_LOG_PREFIX, PMEMLOG_LOG_LEVEL_VAR,
+                       PMEMLOG_LOG_FILE_VAR, PMEMLOG_MAJOR_VERSION,
+                       PMEMLOG_MINOR_VERSION);
+       LOG(3, NULL);
+}
+
+/*
+ * libpmemlog_fini -- libpmemlog cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmemlog_fini(void)
+{
+       LOG(3, NULL);
+       common_fini();
+}
+
+/*
+ * pmemlog_check_versionU -- see if lib meets application version requirements
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemlog_check_versionU(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != PMEMLOG_MAJOR_VERSION) {
+               ERR("libpmemlog major version mismatch (need %u, found %u)",
+                       major_required, PMEMLOG_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > PMEMLOG_MINOR_VERSION) {
+               ERR("libpmemlog minor version mismatch (need %u, found %u)",
+                       minor_required, PMEMLOG_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_check_version -- see if lib meets application version requirements
+ */
+const char *
+pmemlog_check_version(unsigned major_required, unsigned minor_required)
+{
+       return pmemlog_check_versionU(major_required, minor_required);
+}
+#else
+/*
+ * pmemlog_check_versionW -- see if lib meets application version requirements
+ */
+const wchar_t *
+pmemlog_check_versionW(unsigned major_required, unsigned minor_required)
+{
+       if (pmemlog_check_versionU(major_required, minor_required) != NULL)
+               return out_get_errormsgW();
+       else
+               return NULL;
+}
+#endif
+
+/*
+ * pmemlog_set_funcs -- allow overriding libpmemlog's call to malloc, etc.
+ */
+void
+pmemlog_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s))
+{
+       LOG(3, NULL);
+
+       util_set_alloc_funcs(malloc_func, free_func, realloc_func, strdup_func);
+}
+
+/*
+ * pmemlog_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemlog_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_errormsg -- return last error message
+ */
+const char *
+pmemlog_errormsg(void)
+{
+       return pmemlog_errormsgU();
+}
+#else
+/*
+ * pmemlog_errormsgW -- return last error message as wchar_t
+ */
+const wchar_t *
+pmemlog_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.def b/ceph/src/pmdk/src/libpmemlog/libpmemlog.def
new file mode 100644 (file)
index 0000000..34c887f
--- /dev/null
@@ -0,0 +1,36 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2016-2018, Intel Corporation
+;;;;  End Copyright Notice
+
+LIBRARY libpmemlog
+
+VERSION 1.0
+
+EXPORTS
+       pmemlog_check_versionU
+       pmemlog_check_versionW
+       pmemlog_ctl_execU;
+       pmemlog_ctl_execW;
+       pmemlog_ctl_getU;
+       pmemlog_ctl_getW;
+       pmemlog_ctl_setU;
+       pmemlog_ctl_setW;
+       pmemlog_set_funcs
+       pmemlog_errormsgU
+       pmemlog_errormsgW
+       pmemlog_createU
+       pmemlog_createW
+       pmemlog_openU
+       pmemlog_openW
+       pmemlog_close
+       pmemlog_checkU
+       pmemlog_checkW
+       pmemlog_nbyte
+       pmemlog_append
+       pmemlog_appendv
+       pmemlog_rewind
+       pmemlog_tell
+       pmemlog_walk
+
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.link.in b/ceph/src/pmdk/src/libpmemlog/libpmemlog.link.in
new file mode 100644 (file)
index 0000000..c003eaa
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2019, Intel Corporation
+#
+#
+# src/libpmemlog.link -- linker link file for libpmemlog
+#
+LIBPMEMLOG_1.0 {
+       global:
+               pmemlog_check_version;
+               pmemlog_ctl_exec;
+               pmemlog_ctl_get;
+               pmemlog_ctl_set;
+               pmemlog_set_funcs;
+               pmemlog_errormsg;
+               pmemlog_create;
+               pmemlog_open;
+               pmemlog_close;
+               pmemlog_check;
+               pmemlog_nbyte;
+               pmemlog_append;
+               pmemlog_appendv;
+               pmemlog_tell;
+               pmemlog_rewind;
+               pmemlog_walk;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.rc b/ceph/src/pmdk/src/libpmemlog/libpmemlog.rc
new file mode 100644 (file)
index 0000000..89d5153
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016, Intel Corporation */
+
+/*
+ * libpmemlog.rc -- libpmemlog resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemlog.dll"
+#define DESCRIPTION "libpmemlog - persistent memory resident log file"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj b/ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj
new file mode 100644 (file)
index 0000000..eebb69d
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemlog\log.c" />
+    <ClCompile Include="..\..\src\libpmemlog\libpmemlog.c" />
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\common\set_badblocks.c" />
+    <ClCompile Include="..\common\ctl.c" />
+    <ClCompile Include="..\common\ctl_cow.c" />
+    <ClCompile Include="..\common\ctl_prefault.c" />
+    <ClCompile Include="..\common\ctl_sds.c" />
+    <ClCompile Include="..\common\ctl_fallocate.c" />
+    <ClCompile Include="..\common\file.c" />
+    <ClCompile Include="..\common\file_windows.c" />
+    <ClCompile Include="..\common\mmap.c" />
+    <ClCompile Include="..\common\mmap_windows.c" />
+    <ClCompile Include="..\core\fs_windows.c" />
+    <ClCompile Include="..\common\bad_blocks.c" />
+    <ClCompile Include="..\common\os_deep_windows.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\pool_hdr.c" />
+    <ClCompile Include="..\common\set.c" />
+    <ClCompile Include="..\common\shutdown_state.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="..\common\uuid.c" />
+    <ClCompile Include="..\common\uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem2\badblocks.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\libpmem2\usc_windows.c" />
+    <ClCompile Include="libpmemlog_main.c" />
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h" />
+    <ClInclude Include="..\..\src\core\util.h" />
+    <ClInclude Include="..\..\src\common\valgrind_internal.h" />
+    <ClInclude Include="..\..\src\include\libpmemlog.h" />
+    <ClInclude Include="..\..\src\libpmemlog\log.h" />
+    <ClInclude Include="..\core\alloc.h" />
+    <ClInclude Include="..\common\ctl.h" />
+    <ClInclude Include="..\common\ctl_global.h" />
+    <ClInclude Include="..\common\dlsym.h" />
+    <ClInclude Include="..\core\fault_injection.h" />
+    <ClInclude Include="..\common\file.h" />
+    <ClInclude Include="..\core\fs.h" />
+    <ClInclude Include="..\common\mmap.h" />
+    <ClInclude Include="..\core\os.h" />
+    <ClInclude Include="..\common\os_deep.h" />
+    <ClInclude Include="..\core\os_thread.h" />
+    <ClInclude Include="..\common\pmemcommon.h" />
+    <ClInclude Include="..\common\pool_hdr.h" />
+    <ClInclude Include="..\common\set.h" />
+    <ClInclude Include="..\common\sys_util.h" />
+    <ClInclude Include="..\common\uuid.h" />
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemlog.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\libpmem\libpmem.vcxproj">
+      <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemlog.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{0B1818EB-BDC8-4865-964F-DB8BF05CFD86}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmemlog</ProjectName>
+    <RootNamespace>libpmemlog</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj.filters b/ceph/src/pmdk/src/libpmemlog/libpmemlog.vcxproj.filters
new file mode 100644 (file)
index 0000000..ac20a4a
--- /dev/null
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemlog\libpmemlog.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmemlog_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemlog\log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\shutdown_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set_badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_prefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_sds.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_fallocate.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_cow.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\include\libpmemlog.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemlog\log.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\common\valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pmemcommon.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl_global.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{49cfa2b4-cfcb-4c02-928a-c04d1cceffb8}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{ac09c2fe-a24b-4a86-8763-d4e06d996ef3}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemlog.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemlog.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemlog/libpmemlog_main.c b/ceph/src/pmdk/src/libpmemlog/libpmemlog_main.c
new file mode 100644 (file)
index 0000000..d688a36
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2017, Intel Corporation */
+
+/*
+ * libpmemlog_main.c -- entry point for libpmemlog.dll
+ *
+ * XXX - This is a placeholder.  All the library initialization/cleanup
+ * that is done in library ctors/dtors, as well as TLS initialization
+ * should be moved here.
+ */
+
+void libpmemlog_init(void);
+void libpmemlog_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmemlog_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               libpmemlog_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmemlog/log.c b/ceph/src/pmdk/src/libpmemlog/log.c
new file mode 100644 (file)
index 0000000..0f0145b
--- /dev/null
@@ -0,0 +1,895 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * log.c -- log memory pool entry points for libpmem
+ */
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <errno.h>
+#include <time.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "libpmem.h"
+#include "libpmemlog.h"
+#include "ctl_global.h"
+
+#include "os.h"
+#include "set.h"
+#include "out.h"
+#include "log.h"
+#include "mmap.h"
+#include "sys_util.h"
+#include "util_pmem.h"
+#include "valgrind_internal.h"
+
+static const struct pool_attr Log_create_attr = {
+               LOG_HDR_SIG,
+               LOG_FORMAT_MAJOR,
+               LOG_FORMAT_FEAT_DEFAULT,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+static const struct pool_attr Log_open_attr = {
+               LOG_HDR_SIG,
+               LOG_FORMAT_MAJOR,
+               LOG_FORMAT_FEAT_CHECK,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+/*
+ * log_descr_create -- (internal) create log memory pool descriptor
+ */
+static void
+log_descr_create(PMEMlogpool *plp, size_t poolsize)
+{
+       LOG(3, "plp %p poolsize %zu", plp, poolsize);
+
+       ASSERTeq(poolsize % Pagesize, 0);
+
+       /* create required metadata */
+       plp->start_offset = htole64(roundup(sizeof(*plp),
+                                       LOG_FORMAT_DATA_ALIGN));
+       plp->end_offset = htole64(poolsize);
+       plp->write_offset = plp->start_offset;
+
+       /* store non-volatile part of pool's descriptor */
+       util_persist(plp->is_pmem, &plp->start_offset, 3 * sizeof(uint64_t));
+}
+
+/*
+ * log_descr_check -- (internal) validate log memory pool descriptor
+ */
+static int
+log_descr_check(PMEMlogpool *plp, size_t poolsize)
+{
+       LOG(3, "plp %p poolsize %zu", plp, poolsize);
+
+       struct pmemlog hdr = *plp;
+       log_convert2h(&hdr);
+
+       if ((hdr.start_offset !=
+                       roundup(sizeof(*plp), LOG_FORMAT_DATA_ALIGN)) ||
+                       (hdr.end_offset != poolsize) ||
+                       (hdr.start_offset > hdr.end_offset)) {
+               ERR("wrong start/end offsets "
+                       "(start: %" PRIu64 " end: %" PRIu64 "), "
+                       "pool size %zu",
+                       hdr.start_offset, hdr.end_offset, poolsize);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if ((hdr.write_offset > hdr.end_offset) || (hdr.write_offset <
+                       hdr.start_offset)) {
+               ERR("wrong write offset (start: %" PRIu64 " end: %" PRIu64
+                       " write: %" PRIu64 ")",
+                       hdr.start_offset, hdr.end_offset, hdr.write_offset);
+               errno = EINVAL;
+               return -1;
+       }
+
+       LOG(3, "start: %" PRIu64 ", end: %" PRIu64 ", write: %" PRIu64 "",
+               hdr.start_offset, hdr.end_offset, hdr.write_offset);
+
+       return 0;
+}
+
+/*
+ * log_runtime_init -- (internal) initialize log memory pool runtime data
+ */
+static int
+log_runtime_init(PMEMlogpool *plp, int rdonly)
+{
+       LOG(3, "plp %p rdonly %d", plp, rdonly);
+
+       /* remove volatile part of header */
+       VALGRIND_REMOVE_PMEM_MAPPING(&plp->addr,
+               sizeof(struct pmemlog) -
+               sizeof(struct pool_hdr) -
+               3 * sizeof(uint64_t));
+
+       /*
+        * Use some of the memory pool area for run-time info.  This
+        * run-time state is never loaded from the file, it is always
+        * created here, so no need to worry about byte-order.
+        */
+       plp->rdonly = rdonly;
+
+       if ((plp->rwlockp = Malloc(sizeof(*plp->rwlockp))) == NULL) {
+               ERR("!Malloc for a RW lock");
+               return -1;
+       }
+
+       util_rwlock_init(plp->rwlockp);
+
+       /*
+        * If possible, turn off all permissions on the pool header page.
+        *
+        * The prototype PMFS doesn't allow this when large pages are in
+        * use. It is not considered an error if this fails.
+        */
+       RANGE_NONE(plp->addr, sizeof(struct pool_hdr), plp->is_dev_dax);
+
+       /* the rest should be kept read-only (debug version only) */
+       RANGE_RO((char *)plp->addr + sizeof(struct pool_hdr),
+                       plp->size - sizeof(struct pool_hdr), plp->is_dev_dax);
+
+       return 0;
+}
+
+/*
+ * pmemlog_createU -- create a log memory pool
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMlogpool *
+pmemlog_createU(const char *path, size_t poolsize, mode_t mode)
+{
+       LOG(3, "path %s poolsize %zu mode %d", path, poolsize, mode);
+
+       struct pool_set *set;
+       struct pool_attr adj_pool_attr = Log_create_attr;
+
+       /* force set SDS feature */
+       if (SDS_at_create)
+               adj_pool_attr.features.incompat |= POOL_FEAT_SDS;
+       else
+               adj_pool_attr.features.incompat &= ~POOL_FEAT_SDS;
+
+       if (util_pool_create(&set, path, poolsize, PMEMLOG_MIN_POOL,
+                       PMEMLOG_MIN_PART, &adj_pool_attr, NULL,
+                       REPLICAS_DISABLED) != 0) {
+               LOG(2, "cannot create pool or pool set");
+               return NULL;
+       }
+
+       ASSERT(set->nreplicas > 0);
+
+       struct pool_replica *rep = set->replica[0];
+       PMEMlogpool *plp = rep->part[0].addr;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(&plp->addr,
+                       sizeof(struct pmemlog) -
+                       ((uintptr_t)&plp->addr - (uintptr_t)&plp->hdr));
+
+       plp->addr = plp;
+       plp->size = rep->repsize;
+       plp->set = set;
+       plp->is_pmem = rep->is_pmem;
+       plp->is_dev_dax = rep->part[0].is_dev_dax;
+
+       /* is_dev_dax implies is_pmem */
+       ASSERT(!plp->is_dev_dax || plp->is_pmem);
+
+       /* create pool descriptor */
+       log_descr_create(plp, rep->repsize);
+
+       /* initialize runtime parts */
+       if (log_runtime_init(plp, 0) != 0) {
+               ERR("pool initialization failed");
+               goto err;
+       }
+
+       if (util_poolset_chmod(set, mode))
+               goto err;
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "plp %p", plp);
+       return plp;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       util_poolset_close(set, DELETE_CREATED_PARTS);
+       errno = oerrno;
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_create -- create a log memory pool
+ */
+PMEMlogpool *
+pmemlog_create(const char *path, size_t poolsize, mode_t mode)
+{
+       return pmemlog_createU(path, poolsize, mode);
+}
+#else
+/*
+ * pmemlog_createW -- create a log memory pool
+ */
+PMEMlogpool *
+pmemlog_createW(const wchar_t *path, size_t poolsize, mode_t mode)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       PMEMlogpool *ret = pmemlog_createU(upath, poolsize, mode);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * log_open_common -- (internal) open a log memory pool
+ *
+ * This routine does all the work, but takes a cow flag so internal
+ * calls can map a read-only pool if required.
+ */
+static PMEMlogpool *
+log_open_common(const char *path, unsigned flags)
+{
+       LOG(3, "path %s flags 0x%x", path, flags);
+
+       struct pool_set *set;
+
+       if (util_pool_open(&set, path, PMEMLOG_MIN_PART, &Log_open_attr,
+                       NULL, NULL, flags) != 0) {
+               LOG(2, "cannot open pool or pool set");
+               return NULL;
+       }
+
+       ASSERT(set->nreplicas > 0);
+
+       struct pool_replica *rep = set->replica[0];
+       PMEMlogpool *plp = rep->part[0].addr;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(&plp->addr,
+                       sizeof(struct pmemlog) -
+                       ((uintptr_t)&plp->addr - (uintptr_t)&plp->hdr));
+
+       plp->addr = plp;
+       plp->size = rep->repsize;
+       plp->set = set;
+       plp->is_pmem = rep->is_pmem;
+       plp->is_dev_dax = rep->part[0].is_dev_dax;
+
+       /* is_dev_dax implies is_pmem */
+       ASSERT(!plp->is_dev_dax || plp->is_pmem);
+
+       if (set->nreplicas > 1) {
+               errno = ENOTSUP;
+               ERR("!replicas not supported");
+               goto err;
+       }
+
+       /* validate pool descriptor */
+       if (log_descr_check(plp, rep->repsize) != 0) {
+               LOG(2, "descriptor check failed");
+               goto err;
+       }
+
+       /* initialize runtime parts */
+       if (log_runtime_init(plp, set->rdonly) != 0) {
+               ERR("pool initialization failed");
+               goto err;
+       }
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "plp %p", plp);
+       return plp;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+       return NULL;
+}
+
+/*
+ * pmemlog_openU -- open an existing log memory pool
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMlogpool *
+pmemlog_openU(const char *path)
+{
+       LOG(3, "path %s", path);
+
+       return log_open_common(path, COW_at_open ? POOL_OPEN_COW : 0);
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_open -- open an existing log memory pool
+ */
+PMEMlogpool *
+pmemlog_open(const char *path)
+{
+       return pmemlog_openU(path);
+}
+#else
+/*
+ * pmemlog_openW -- open an existing log memory pool
+ */
+PMEMlogpool *
+pmemlog_openW(const wchar_t *path)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       PMEMlogpool *ret = pmemlog_openU(upath);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmemlog_close -- close a log memory pool
+ */
+void
+pmemlog_close(PMEMlogpool *plp)
+{
+       LOG(3, "plp %p", plp);
+
+       util_rwlock_destroy(plp->rwlockp);
+       Free((void *)plp->rwlockp);
+
+       util_poolset_close(plp->set, DO_NOT_DELETE_PARTS);
+}
+
+/*
+ * pmemlog_nbyte -- return usable size of a log memory pool
+ */
+size_t
+pmemlog_nbyte(PMEMlogpool *plp)
+{
+       LOG(3, "plp %p", plp);
+
+       util_rwlock_rdlock(plp->rwlockp);
+
+       size_t size = le64toh(plp->end_offset) - le64toh(plp->start_offset);
+       LOG(4, "plp %p nbyte %zu", plp, size);
+
+       util_rwlock_unlock(plp->rwlockp);
+
+       return size;
+}
+
+/*
+ * log_persist -- (internal) persist data, then metadata
+ *
+ * On entry, the write lock should be held.
+ */
+static void
+log_persist(PMEMlogpool *plp, uint64_t new_write_offset)
+{
+       uint64_t old_write_offset = le64toh(plp->write_offset);
+       size_t length = new_write_offset - old_write_offset;
+
+       /* unprotect the log space range (debug version only) */
+       RANGE_RW((char *)plp->addr + old_write_offset, length, plp->is_dev_dax);
+
+       /* persist the data */
+       if (plp->is_pmem)
+               pmem_drain(); /* data already flushed */
+       else
+               pmem_msync((char *)plp->addr + old_write_offset, length);
+
+       /* protect the log space range (debug version only) */
+       RANGE_RO((char *)plp->addr + old_write_offset, length, plp->is_dev_dax);
+
+       /* unprotect the pool descriptor (debug version only) */
+       RANGE_RW((char *)plp->addr + sizeof(struct pool_hdr),
+                       LOG_FORMAT_DATA_ALIGN, plp->is_dev_dax);
+
+       /* write the metadata */
+       plp->write_offset = htole64(new_write_offset);
+
+       /* persist the metadata */
+       if (plp->is_pmem)
+               pmem_persist(&plp->write_offset, sizeof(plp->write_offset));
+       else
+               pmem_msync(&plp->write_offset, sizeof(plp->write_offset));
+
+       /* set the write-protection again (debug version only) */
+       RANGE_RO((char *)plp->addr + sizeof(struct pool_hdr),
+                       LOG_FORMAT_DATA_ALIGN, plp->is_dev_dax);
+}
+
+/*
+ * pmemlog_append -- add data to a log memory pool
+ */
+int
+pmemlog_append(PMEMlogpool *plp, const void *buf, size_t count)
+{
+       int ret = 0;
+
+       LOG(3, "plp %p buf %p count %zu", plp, buf, count);
+
+       if (plp->rdonly) {
+               ERR("can't append to read-only log");
+               errno = EROFS;
+               return -1;
+       }
+
+       util_rwlock_wrlock(plp->rwlockp);
+
+       /* get the current values */
+       uint64_t end_offset = le64toh(plp->end_offset);
+       uint64_t write_offset = le64toh(plp->write_offset);
+
+       if (write_offset >= end_offset) {
+               /* no space left */
+               errno = ENOSPC;
+               ERR("!pmemlog_append");
+               ret = -1;
+               goto end;
+       }
+
+       /* make sure we don't write past the available space */
+       if (count > (end_offset - write_offset)) {
+               errno = ENOSPC;
+               ERR("!pmemlog_append");
+               ret = -1;
+               goto end;
+       }
+
+       char *data = plp->addr;
+
+       /*
+        * unprotect the log space range, where the new data will be stored
+        * (debug version only)
+        */
+       RANGE_RW(&data[write_offset], count, plp->is_dev_dax);
+
+       if (plp->is_pmem)
+               pmem_memcpy_nodrain(&data[write_offset], buf, count);
+       else
+               memcpy(&data[write_offset], buf, count);
+
+       /* protect the log space range (debug version only) */
+       RANGE_RO(&data[write_offset], count, plp->is_dev_dax);
+
+       write_offset += count;
+
+       /* persist the data and the metadata */
+       log_persist(plp, write_offset);
+
+end:
+       util_rwlock_unlock(plp->rwlockp);
+
+       return ret;
+}
+
+/*
+ * pmemlog_appendv -- add gathered data to a log memory pool
+ */
+int
+pmemlog_appendv(PMEMlogpool *plp, const struct iovec *iov, int iovcnt)
+{
+       LOG(3, "plp %p iovec %p iovcnt %d", plp, iov, iovcnt);
+
+       int ret = 0;
+       int i;
+
+       if (iovcnt < 0) {
+               errno = EINVAL;
+               ERR("iovcnt is less than zero: %d", iovcnt);
+               return -1;
+       }
+
+       if (plp->rdonly) {
+               ERR("can't append to read-only log");
+               errno = EROFS;
+               return -1;
+       }
+
+       util_rwlock_wrlock(plp->rwlockp);
+
+       /* get the current values */
+       uint64_t end_offset = le64toh(plp->end_offset);
+       uint64_t write_offset = le64toh(plp->write_offset);
+
+       if (write_offset >= end_offset) {
+               /* no space left */
+               errno = ENOSPC;
+               ERR("!pmemlog_appendv");
+               ret = -1;
+               goto end;
+       }
+
+       char *data = plp->addr;
+       uint64_t count = 0;
+       char *buf;
+
+       /* calculate required space */
+       for (i = 0; i < iovcnt; ++i)
+               count += iov[i].iov_len;
+
+       /* check if there is enough free space */
+       if (count > (end_offset - write_offset)) {
+               errno = ENOSPC;
+               ret = -1;
+               goto end;
+       }
+
+       /* append the data */
+       for (i = 0; i < iovcnt; ++i) {
+               buf = iov[i].iov_base;
+               count = iov[i].iov_len;
+
+               /*
+                * unprotect the log space range, where the new data will be
+                * stored (debug version only)
+                */
+               RANGE_RW(&data[write_offset], count, plp->is_dev_dax);
+
+               if (plp->is_pmem)
+                       pmem_memcpy_nodrain(&data[write_offset], buf, count);
+               else
+                       memcpy(&data[write_offset], buf, count);
+
+               /*
+                * protect the log space range (debug version only)
+                */
+               RANGE_RO(&data[write_offset], count, plp->is_dev_dax);
+
+               write_offset += count;
+       }
+
+       /* persist the data and the metadata */
+       log_persist(plp, write_offset);
+
+end:
+       util_rwlock_unlock(plp->rwlockp);
+
+       return ret;
+}
+
+/*
+ * pmemlog_tell -- return current write point in a log memory pool
+ */
+long long
+pmemlog_tell(PMEMlogpool *plp)
+{
+       LOG(3, "plp %p", plp);
+
+       util_rwlock_rdlock(plp->rwlockp);
+
+       ASSERT(le64toh(plp->write_offset) >= le64toh(plp->start_offset));
+       long long wp = (long long)(le64toh(plp->write_offset) -
+                       le64toh(plp->start_offset));
+
+       LOG(4, "write offset %lld", wp);
+
+       util_rwlock_unlock(plp->rwlockp);
+
+       return wp;
+}
+
+/*
+ * pmemlog_rewind -- discard all data, resetting a log memory pool to empty
+ */
+void
+pmemlog_rewind(PMEMlogpool *plp)
+{
+       LOG(3, "plp %p", plp);
+
+       if (plp->rdonly) {
+               ERR("can't rewind read-only log");
+               errno = EROFS;
+               return;
+       }
+
+       util_rwlock_wrlock(plp->rwlockp);
+
+       /* unprotect the pool descriptor (debug version only) */
+       RANGE_RW((char *)plp->addr + sizeof(struct pool_hdr),
+                       LOG_FORMAT_DATA_ALIGN, plp->is_dev_dax);
+
+       plp->write_offset = plp->start_offset;
+       if (plp->is_pmem)
+               pmem_persist(&plp->write_offset, sizeof(uint64_t));
+       else
+               pmem_msync(&plp->write_offset, sizeof(uint64_t));
+
+       /* set the write-protection again (debug version only) */
+       RANGE_RO((char *)plp->addr + sizeof(struct pool_hdr),
+                       LOG_FORMAT_DATA_ALIGN, plp->is_dev_dax);
+
+       util_rwlock_unlock(plp->rwlockp);
+}
+
+/*
+ * pmemlog_walk -- walk through all data in a log memory pool
+ *
+ * chunksize of 0 means process_chunk gets called once for all data
+ * as a single chunk.
+ */
+void
+pmemlog_walk(PMEMlogpool *plp, size_t chunksize,
+       int (*process_chunk)(const void *buf, size_t len, void *arg), void *arg)
+{
+       LOG(3, "plp %p chunksize %zu", plp, chunksize);
+
+       /*
+        * We are assuming that the walker doesn't change the data it's reading
+        * in place. We prevent everyone from changing the data behind our back
+        * until we are done with processing it.
+        */
+       util_rwlock_rdlock(plp->rwlockp);
+
+       char *data = plp->addr;
+       uint64_t write_offset = le64toh(plp->write_offset);
+       uint64_t data_offset = le64toh(plp->start_offset);
+       size_t len;
+
+       if (chunksize == 0) {
+               /* most common case: process everything at once */
+               len = write_offset - data_offset;
+               LOG(3, "length %zu", len);
+               (*process_chunk)(&data[data_offset], len, arg);
+       } else {
+               /*
+                * Walk through the complete record, chunk by chunk.
+                * The callback returns 0 to terminate the walk.
+                */
+               while (data_offset < write_offset) {
+                       len = MIN(chunksize, write_offset - data_offset);
+                       if (!(*process_chunk)(&data[data_offset], len, arg))
+                               break;
+                       data_offset += chunksize;
+               }
+       }
+
+       util_rwlock_unlock(plp->rwlockp);
+}
+
+/*
+ * pmemlog_checkU -- log memory pool consistency check
+ *
+ * Returns true if consistent, zero if inconsistent, -1/error if checking
+ * cannot happen due to other errors.
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemlog_checkU(const char *path)
+{
+       LOG(3, "path \"%s\"", path);
+
+       PMEMlogpool *plp = log_open_common(path, POOL_OPEN_COW);
+       if (plp == NULL)
+               return -1;      /* errno set by log_open_common() */
+
+       int consistent = 1;
+
+       /* validate pool descriptor */
+       uint64_t hdr_start = le64toh(plp->start_offset);
+       uint64_t hdr_end = le64toh(plp->end_offset);
+       uint64_t hdr_write = le64toh(plp->write_offset);
+
+       if (hdr_start != roundup(sizeof(*plp), LOG_FORMAT_DATA_ALIGN)) {
+               ERR("wrong value of start_offset");
+               consistent = 0;
+       }
+
+       if (hdr_end != plp->size) {
+               ERR("wrong value of end_offset");
+               consistent = 0;
+       }
+
+       if (hdr_start > hdr_end) {
+               ERR("start_offset greater than end_offset");
+               consistent = 0;
+       }
+
+       if (hdr_start > hdr_write) {
+               ERR("start_offset greater than write_offset");
+               consistent = 0;
+       }
+
+       if (hdr_write > hdr_end) {
+               ERR("write_offset greater than end_offset");
+               consistent = 0;
+       }
+
+       pmemlog_close(plp);
+
+       if (consistent)
+               LOG(4, "pool consistency check OK");
+
+       return consistent;
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_check -- log memory pool consistency check
+ *
+ * Returns true if consistent, zero if inconsistent, -1/error if checking
+ * cannot happen due to other errors.
+ */
+int
+pmemlog_check(const char *path)
+{
+       return pmemlog_checkU(path);
+}
+#else
+/*
+ * pmemlog_checkW -- log memory pool consistency check
+ */
+int
+pmemlog_checkW(const wchar_t *path)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return -1;
+
+       int ret = pmemlog_checkU(upath);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmemlog_ctl_getU -- programmatically executes a read ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemlog_ctl_getU(PMEMlogpool *plp, const char *name, void *arg)
+{
+       LOG(3, "plp %p name %s arg %p", plp, name, arg);
+       return ctl_query(plp == NULL ? NULL : plp->ctl, plp,
+                       CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_READ, arg);
+}
+
+/*
+ * pmemblk_ctl_setU -- programmatically executes a write ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemlog_ctl_setU(PMEMlogpool *plp, const char *name, void *arg)
+{
+       LOG(3, "plp %p name %s arg %p", plp, name, arg);
+       return ctl_query(plp == NULL ? NULL : plp->ctl, plp,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_WRITE, arg);
+}
+
+/*
+ * pmemlog_ctl_execU -- programmatically executes a runnable ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemlog_ctl_execU(PMEMlogpool *plp, const char *name, void *arg)
+{
+       LOG(3, "plp %p name %s arg %p", plp, name, arg);
+       return ctl_query(plp == NULL ? NULL : plp->ctl, plp,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_RUNNABLE, arg);
+}
+
+#ifndef _WIN32
+/*
+ * pmemlog_ctl_get -- programmatically executes a read ctl query
+ */
+int
+pmemlog_ctl_get(PMEMlogpool *plp, const char *name, void *arg)
+{
+       return pmemlog_ctl_getU(plp, name, arg);
+}
+
+/*
+ * pmemlog_ctl_set -- programmatically executes a write ctl query
+ */
+int
+pmemlog_ctl_set(PMEMlogpool *plp, const char *name, void *arg)
+{
+       return pmemlog_ctl_setU(plp, name, arg);
+}
+
+/*
+ * pmemlog_ctl_exec -- programmatically executes a runnable ctl query
+ */
+int
+pmemlog_ctl_exec(PMEMlogpool *plp, const char *name, void *arg)
+{
+       return pmemlog_ctl_execU(plp, name, arg);
+}
+#else
+/*
+ * pmemlog_ctl_getW -- programmatically executes a read ctl query
+ */
+int
+pmemlog_ctl_getW(PMEMlogpool *plp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemlog_ctl_getU(plp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemlog_ctl_setW -- programmatically executes a write ctl query
+ */
+int
+pmemlog_ctl_setW(PMEMlogpool *plp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemlog_ctl_setU(plp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemlog_ctl_execW -- programmatically executes a runnable ctl query
+ */
+int
+pmemlog_ctl_execW(PMEMlogpool *plp, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemlog_ctl_execU(plp, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+#endif
+
+#if FAULT_INJECTION
+void
+pmemlog_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at)
+{
+       core_inject_fault_at(type, nth, at);
+}
+
+int
+pmemlog_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemlog/log.h b/ceph/src/pmdk/src/libpmemlog/log.h
new file mode 100644 (file)
index 0000000..7b86ca0
--- /dev/null
@@ -0,0 +1,115 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * log.h -- internal definitions for libpmem log module
+ */
+
+#ifndef LOG_H
+#define LOG_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+#include <endian.h>
+
+#include "ctl.h"
+#include "util.h"
+#include "os_thread.h"
+#include "pool_hdr.h"
+#include "page_size.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "alloc.h"
+#include "fault_injection.h"
+
+#define PMEMLOG_LOG_PREFIX "libpmemlog"
+#define PMEMLOG_LOG_LEVEL_VAR "PMEMLOG_LOG_LEVEL"
+#define PMEMLOG_LOG_FILE_VAR "PMEMLOG_LOG_FILE"
+
+/* attributes of the log memory pool format for the pool header */
+#define LOG_HDR_SIG "PMEMLOG"  /* must be 8 bytes including '\0' */
+#define LOG_FORMAT_MAJOR 1
+
+#define LOG_FORMAT_FEAT_DEFAULT \
+       {POOL_FEAT_COMPAT_DEFAULT, POOL_FEAT_INCOMPAT_DEFAULT, 0x0000}
+
+#define LOG_FORMAT_FEAT_CHECK \
+       {POOL_FEAT_COMPAT_VALID, POOL_FEAT_INCOMPAT_VALID, 0x0000}
+
+static const features_t log_format_feat_default = LOG_FORMAT_FEAT_DEFAULT;
+
+struct pmemlog {
+       struct pool_hdr hdr;    /* memory pool header */
+
+       /* root info for on-media format... */
+       uint64_t start_offset;  /* start offset of the usable log space */
+       uint64_t end_offset;    /* maximum offset of the usable log space */
+       uint64_t write_offset;  /* current write point for the log */
+
+       /* some run-time state, allocated out of memory pool... */
+       void *addr;             /* mapped region */
+       size_t size;            /* size of mapped region */
+       int is_pmem;            /* true if pool is PMEM */
+       int rdonly;             /* true if pool is opened read-only */
+       os_rwlock_t *rwlockp;   /* pointer to RW lock */
+       int is_dev_dax;         /* true if mapped on device dax */
+       struct ctl *ctl;        /* top level node of the ctl tree structure */
+
+       struct pool_set *set;   /* pool set info */
+};
+
+/* data area starts at this alignment after the struct pmemlog above */
+#define LOG_FORMAT_DATA_ALIGN ((uintptr_t)PMEM_PAGESIZE)
+
+/*
+ * log_convert2h -- convert pmemlog structure to host byte order
+ */
+static inline void
+log_convert2h(struct pmemlog *plp)
+{
+       plp->start_offset = le64toh(plp->start_offset);
+       plp->end_offset = le64toh(plp->end_offset);
+       plp->write_offset = le64toh(plp->write_offset);
+}
+
+/*
+ * log_convert2le -- convert pmemlog structure to LE byte order
+ */
+static inline void
+log_convert2le(struct pmemlog *plp)
+{
+       plp->start_offset = htole64(plp->start_offset);
+       plp->end_offset = htole64(plp->end_offset);
+       plp->write_offset = htole64(plp->write_offset);
+}
+
+#if FAULT_INJECTION
+void
+pmemlog_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at);
+
+int
+pmemlog_fault_injection_enabled(void);
+#else
+static inline void
+pmemlog_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at)
+{
+       abort();
+}
+
+static inline int
+pmemlog_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/Makefile b/ceph/src/pmdk/src/libpmemobj/Makefile
new file mode 100644 (file)
index 0000000..6ad3d73
--- /dev/null
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# src/libpmemobj/Makefile -- Makefile for libpmemobj
+#
+
+LIBRARY_NAME = pmemobj
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+
+include ../core/pmemcore.inc
+include ../common/pmemcommon.inc
+
+SOURCE +=\
+       alloc_class.c\
+       bucket.c\
+       container_ravl.c\
+       container_seglists.c\
+       critnib.c\
+       ctl_debug.o\
+       heap.c\
+       lane.c\
+       libpmemobj.c\
+       list.c\
+       memblock.c\
+       memops.c\
+       obj.c\
+       palloc.c\
+       pmalloc.c\
+       recycler.c\
+       sync.c\
+       tx.c\
+       stats.c\
+       ulog.c
+
+include ../Makefile.inc
+
+CFLAGS += -DUSE_LIBDL -D_PMEMOBJ_INTRNL $(LIBNDCTL_CFLAGS)
+
+LIBS += -pthread -lpmem $(LIBDL) $(LIBNDCTL_LIBS)
diff --git a/ceph/src/pmdk/src/libpmemobj/alloc_class.c b/ceph/src/pmdk/src/libpmemobj/alloc_class.c
new file mode 100644 (file)
index 0000000..981815f
--- /dev/null
@@ -0,0 +1,636 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * alloc_class.c -- implementation of allocation classes
+ */
+
+#include <float.h>
+#include <string.h>
+
+#include "alloc_class.h"
+#include "heap_layout.h"
+#include "util.h"
+#include "out.h"
+#include "bucket.h"
+#include "critnib.h"
+
+#define RUN_CLASS_KEY_PACK(map_idx_s, flags_s, size_idx_s)\
+((uint64_t)(map_idx_s) << 32 |\
+(uint64_t)(flags_s) << 16 |\
+(uint64_t)(size_idx_s))
+
+/*
+ * Value used to mark a reserved spot in the bucket array.
+ */
+#define ACLASS_RESERVED ((void *)0xFFFFFFFFULL)
+
+/*
+ * The last size that is handled by runs.
+ */
+#define MAX_RUN_SIZE (CHUNKSIZE * 10)
+
+/*
+ * Maximum number of bytes the allocation class generation algorithm can decide
+ * to waste in a single run chunk.
+ */
+#define MAX_RUN_WASTED_BYTES 1024
+
+/*
+ * Allocation categories are used for allocation classes generation. Each one
+ * defines the biggest handled size (in bytes) and step pct of the generation
+ * process. The step percentage defines maximum allowed external fragmentation
+ * for the category.
+ */
+#define MAX_ALLOC_CATEGORIES 9
+
+/*
+ * The first size (in byes) which is actually used in the allocation
+ * class generation algorithm. All smaller sizes use the first predefined bucket
+ * with the smallest run unit size.
+ */
+#define FIRST_GENERATED_CLASS_SIZE 128
+
+/*
+ * The granularity of the allocation class generation algorithm.
+ */
+#define ALLOC_BLOCK_SIZE_GEN 64
+
+/*
+ * The first predefined allocation class size
+ */
+#define MIN_UNIT_SIZE 128
+
+static const struct {
+       size_t size;
+       float step;
+} categories[MAX_ALLOC_CATEGORIES] = {
+       /* dummy category - the first allocation class is predefined */
+       {FIRST_GENERATED_CLASS_SIZE, 0.05f},
+       {1024, 0.05f},
+       {2048, 0.05f},
+       {4096, 0.05f},
+       {8192, 0.05f},
+       {16384, 0.05f},
+       {32768, 0.05f},
+       {131072, 0.05f},
+       {393216, 0.05f},
+};
+
+#define RUN_UNIT_MAX_ALLOC 8U
+
+/*
+ * Every allocation has to be a multiple of at least 8 because we need to
+ * ensure proper alignment of every pmem structure.
+ */
+#define ALLOC_BLOCK_SIZE 16
+
+/*
+ * Converts size (in bytes) to number of allocation blocks.
+ */
+#define SIZE_TO_CLASS_MAP_INDEX(_s, _g) (1 + (((_s) - 1) / (_g)))
+
+/*
+ * Target number of allocations per run instance.
+ */
+#define RUN_MIN_NALLOCS 200
+
+/*
+ * Hard limit of chunks per single run.
+ */
+#define RUN_SIZE_IDX_CAP (16)
+
+#define ALLOC_CLASS_DEFAULT_FLAGS CHUNK_FLAG_FLEX_BITMAP
+
+struct alloc_class_collection {
+       size_t granularity;
+
+       struct alloc_class *aclasses[MAX_ALLOCATION_CLASSES];
+
+       /*
+        * The last size (in bytes) that is handled by runs, everything bigger
+        * uses the default class.
+        */
+       size_t last_run_max_size;
+
+       /* maps allocation classes to allocation sizes, excluding the header! */
+       uint8_t *class_map_by_alloc_size;
+
+       /* maps allocation classes to run unit sizes */
+       struct critnib *class_map_by_unit_size;
+
+       int fail_on_missing_class;
+       int autogenerate_on_missing_class;
+};
+
+/*
+ * alloc_class_find_first_free_slot -- searches for the
+ *     first available allocation class slot
+ *
+ * This function must be thread-safe because allocation classes can be created
+ * at runtime.
+ */
+int
+alloc_class_find_first_free_slot(struct alloc_class_collection *ac,
+       uint8_t *slot)
+{
+       LOG(10, NULL);
+
+       for (int n = 0; n < MAX_ALLOCATION_CLASSES; ++n) {
+               if (util_bool_compare_and_swap64(&ac->aclasses[n],
+                               NULL, ACLASS_RESERVED)) {
+                       *slot = (uint8_t)n;
+                       return 0;
+               }
+       }
+
+       return -1;
+}
+
+/*
+ * alloc_class_reserve -- reserve the specified class id
+ */
+int
+alloc_class_reserve(struct alloc_class_collection *ac, uint8_t id)
+{
+       LOG(10, NULL);
+
+       return util_bool_compare_and_swap64(&ac->aclasses[id],
+                       NULL, ACLASS_RESERVED) ? 0 : -1;
+}
+
+/*
+ * alloc_class_reservation_clear -- removes the reservation on class id
+ */
+static void
+alloc_class_reservation_clear(struct alloc_class_collection *ac, int id)
+{
+       LOG(10, NULL);
+
+       int ret = util_bool_compare_and_swap64(&ac->aclasses[id],
+               ACLASS_RESERVED, NULL);
+       ASSERT(ret);
+}
+
+/*
+ * alloc_class_new -- creates a new allocation class
+ */
+struct alloc_class *
+alloc_class_new(int id, struct alloc_class_collection *ac,
+       enum alloc_class_type type, enum header_type htype,
+       size_t unit_size, size_t alignment,
+       uint32_t size_idx)
+{
+       LOG(10, NULL);
+
+       struct alloc_class *c = Malloc(sizeof(*c));
+       if (c == NULL)
+               goto error_class_alloc;
+
+       c->unit_size = unit_size;
+       c->header_type = htype;
+       c->type = type;
+       c->flags = (uint16_t)
+               (header_type_to_flag[c->header_type] |
+               (alignment ? CHUNK_FLAG_ALIGNED : 0)) |
+               ALLOC_CLASS_DEFAULT_FLAGS;
+
+       switch (type) {
+               case CLASS_HUGE:
+                       id = DEFAULT_ALLOC_CLASS_ID;
+                       break;
+               case CLASS_RUN:
+                       c->rdsc.alignment = alignment;
+                       memblock_run_bitmap(&size_idx, c->flags, unit_size,
+                               alignment, NULL, &c->rdsc.bitmap);
+                       c->rdsc.nallocs = c->rdsc.bitmap.nbits;
+                       c->rdsc.size_idx = size_idx;
+
+                       /* these two fields are duplicated from class */
+                       c->rdsc.unit_size = c->unit_size;
+                       c->rdsc.flags = c->flags;
+
+                       uint8_t slot = (uint8_t)id;
+                       if (id < 0 && alloc_class_find_first_free_slot(ac,
+                                       &slot) != 0)
+                               goto error_class_alloc;
+                       id = slot;
+
+                       size_t map_idx = SIZE_TO_CLASS_MAP_INDEX(c->unit_size,
+                               ac->granularity);
+                       ASSERT(map_idx <= UINT32_MAX);
+                       uint32_t map_idx_s = (uint32_t)map_idx;
+                       uint16_t size_idx_s = (uint16_t)size_idx;
+                       uint16_t flags_s = (uint16_t)c->flags;
+                       uint64_t k = RUN_CLASS_KEY_PACK(map_idx_s,
+                               flags_s, size_idx_s);
+                       if (critnib_insert(ac->class_map_by_unit_size,
+                           k, c) != 0) {
+                               ERR("unable to register allocation class");
+                               goto error_map_insert;
+                       }
+
+                       break;
+               default:
+                       ASSERT(0);
+       }
+
+       c->id = (uint8_t)id;
+       ac->aclasses[c->id] = c;
+       return c;
+
+error_map_insert:
+       Free(c);
+error_class_alloc:
+       if (id >= 0)
+               alloc_class_reservation_clear(ac, id);
+       return NULL;
+}
+
+/*
+ * alloc_class_delete -- (internal) deletes an allocation class
+ */
+void
+alloc_class_delete(struct alloc_class_collection *ac,
+       struct alloc_class *c)
+{
+       LOG(10, NULL);
+
+       ac->aclasses[c->id] = NULL;
+       Free(c);
+}
+
+/*
+ * alloc_class_find_or_create -- (internal) searches for the
+ * biggest allocation class for which unit_size is evenly divisible by n.
+ * If no such class exists, create one.
+ */
+static struct alloc_class *
+alloc_class_find_or_create(struct alloc_class_collection *ac, size_t n)
+{
+       LOG(10, NULL);
+
+       COMPILE_ERROR_ON(MAX_ALLOCATION_CLASSES > UINT8_MAX);
+       uint64_t required_size_bytes = n * RUN_MIN_NALLOCS;
+       uint32_t required_size_idx = 1;
+       if (required_size_bytes > RUN_DEFAULT_SIZE) {
+               required_size_bytes -= RUN_DEFAULT_SIZE;
+               required_size_idx +=
+                       CALC_SIZE_IDX(CHUNKSIZE, required_size_bytes);
+               if (required_size_idx > RUN_SIZE_IDX_CAP)
+                       required_size_idx = RUN_SIZE_IDX_CAP;
+       }
+
+       for (int i = MAX_ALLOCATION_CLASSES - 1; i >= 0; --i) {
+               struct alloc_class *c = ac->aclasses[i];
+
+               if (c == NULL || c->type == CLASS_HUGE ||
+                               c->rdsc.size_idx < required_size_idx)
+                       continue;
+
+               if (n % c->unit_size == 0 &&
+                       n / c->unit_size <= RUN_UNIT_MAX_ALLOC)
+                       return c;
+       }
+
+       /*
+        * In order to minimize the wasted space at the end of the run the
+        * run data size must be divisible by the allocation class unit size
+        * with the smallest possible remainder, preferably 0.
+        */
+       struct run_bitmap b;
+       size_t runsize_bytes = 0;
+       do {
+               if (runsize_bytes != 0) /* don't increase on first iteration */
+                       n += ALLOC_BLOCK_SIZE_GEN;
+
+               uint32_t size_idx = required_size_idx;
+               memblock_run_bitmap(&size_idx, ALLOC_CLASS_DEFAULT_FLAGS, n, 0,
+                       NULL, &b);
+
+               runsize_bytes = RUN_CONTENT_SIZE_BYTES(size_idx) - b.size;
+       } while ((runsize_bytes % n) > MAX_RUN_WASTED_BYTES);
+
+       /*
+        * Now that the desired unit size is found the existing classes need
+        * to be searched for possible duplicates. If a class that can handle
+        * the calculated size already exists, simply return that.
+        */
+       for (int i = 1; i < MAX_ALLOCATION_CLASSES; ++i) {
+               struct alloc_class *c = ac->aclasses[i];
+               if (c == NULL || c->type == CLASS_HUGE)
+                       continue;
+               if (n / c->unit_size <= RUN_UNIT_MAX_ALLOC &&
+                       n % c->unit_size == 0)
+                       return c;
+               if (c->unit_size == n)
+                       return c;
+       }
+
+       return alloc_class_new(-1, ac, CLASS_RUN, HEADER_COMPACT, n, 0,
+               required_size_idx);
+}
+
+/*
+ * alloc_class_find_min_frag -- searches for an existing allocation
+ * class that will provide the smallest internal fragmentation for the given
+ * size.
+ */
+static struct alloc_class *
+alloc_class_find_min_frag(struct alloc_class_collection *ac, size_t n)
+{
+       LOG(10, NULL);
+
+       struct alloc_class *best_c = NULL;
+       size_t lowest_waste = SIZE_MAX;
+
+       ASSERTne(n, 0);
+
+       /*
+        * Start from the largest buckets in order to minimize unit size of
+        * allocated memory blocks.
+        */
+       for (int i = MAX_ALLOCATION_CLASSES - 1; i >= 0; --i) {
+               struct alloc_class *c = ac->aclasses[i];
+
+               /* can't use alloc classes /w no headers by default */
+               if (c == NULL || c->header_type == HEADER_NONE)
+                       continue;
+
+               size_t real_size = n + header_type_to_size[c->header_type];
+
+               size_t units = CALC_SIZE_IDX(c->unit_size, real_size);
+
+               /* can't exceed the maximum allowed run unit max */
+               if (c->type == CLASS_RUN && units > RUN_UNIT_MAX_ALLOC)
+                       continue;
+
+               if (c->unit_size * units == real_size)
+                       return c;
+
+               size_t waste = (c->unit_size * units) - real_size;
+
+               /*
+                * If we assume that the allocation class is only ever going to
+                * be used with exactly one size, the effective internal
+                * fragmentation would be increased by the leftover
+                * memory at the end of the run.
+                */
+               if (c->type == CLASS_RUN) {
+                       size_t wasted_units = c->rdsc.nallocs % units;
+                       size_t wasted_bytes = wasted_units * c->unit_size;
+                       size_t waste_avg_per_unit = wasted_bytes /
+                               c->rdsc.nallocs;
+
+                       waste += waste_avg_per_unit;
+               }
+
+               if (best_c == NULL || lowest_waste > waste) {
+                       best_c = c;
+                       lowest_waste = waste;
+               }
+       }
+
+       ASSERTne(best_c, NULL);
+       return best_c;
+}
+
+/*
+ * alloc_class_collection_new -- creates a new collection of allocation classes
+ */
+struct alloc_class_collection *
+alloc_class_collection_new()
+{
+       LOG(10, NULL);
+
+       struct alloc_class_collection *ac = Zalloc(sizeof(*ac));
+       if (ac == NULL)
+               return NULL;
+
+       ac->granularity = ALLOC_BLOCK_SIZE;
+       ac->last_run_max_size = MAX_RUN_SIZE;
+       ac->fail_on_missing_class = 0;
+       ac->autogenerate_on_missing_class = 1;
+
+       size_t maps_size = (MAX_RUN_SIZE / ac->granularity) + 1;
+
+       if ((ac->class_map_by_alloc_size = Malloc(maps_size)) == NULL)
+               goto error;
+       if ((ac->class_map_by_unit_size = critnib_new()) == NULL)
+               goto error;
+
+       memset(ac->class_map_by_alloc_size, 0xFF, maps_size);
+
+       if (alloc_class_new(-1, ac, CLASS_HUGE, HEADER_COMPACT,
+               CHUNKSIZE, 0, 1) == NULL)
+               goto error;
+
+       struct alloc_class *predefined_class =
+               alloc_class_new(-1, ac, CLASS_RUN, HEADER_COMPACT,
+                       MIN_UNIT_SIZE, 0, 1);
+       if (predefined_class == NULL)
+               goto error;
+
+       for (size_t i = 0; i < FIRST_GENERATED_CLASS_SIZE / ac->granularity;
+               ++i) {
+               ac->class_map_by_alloc_size[i] = predefined_class->id;
+       }
+
+       /*
+        * Based on the defined categories, a set of allocation classes is
+        * created. The unit size of those classes is depended on the category
+        * initial size and step.
+        */
+       size_t granularity_mask = ALLOC_BLOCK_SIZE_GEN - 1;
+       for (int c = 1; c < MAX_ALLOC_CATEGORIES; ++c) {
+               size_t n = categories[c - 1].size + ALLOC_BLOCK_SIZE_GEN;
+               do {
+                       if (alloc_class_find_or_create(ac, n) == NULL)
+                               goto error;
+
+                       float stepf = (float)n * categories[c].step;
+                       size_t stepi = (size_t)stepf;
+                       stepi = (stepf - (float)stepi < FLT_EPSILON) ?
+                               stepi : stepi + 1;
+
+                       n += (stepi + (granularity_mask)) & ~granularity_mask;
+               } while (n <= categories[c].size);
+       }
+
+       /*
+        * Find the largest alloc class and use it's unit size as run allocation
+        * threshold.
+        */
+       uint8_t largest_aclass_slot;
+       for (largest_aclass_slot = MAX_ALLOCATION_CLASSES - 1;
+                       largest_aclass_slot > 0 &&
+                       ac->aclasses[largest_aclass_slot] == NULL;
+                       --largest_aclass_slot) {
+               /* intentional NOP */
+       }
+
+       struct alloc_class *c = ac->aclasses[largest_aclass_slot];
+
+       /*
+        * The actual run might contain less unit blocks than the theoretical
+        * unit max variable. This may be the case for very large unit sizes.
+        */
+       size_t real_unit_max = c->rdsc.nallocs < RUN_UNIT_MAX_ALLOC ?
+               c->rdsc.nallocs : RUN_UNIT_MAX_ALLOC;
+
+       size_t theoretical_run_max_size = c->unit_size * real_unit_max;
+
+       ac->last_run_max_size = MAX_RUN_SIZE > theoretical_run_max_size ?
+               theoretical_run_max_size : MAX_RUN_SIZE;
+
+#ifdef DEBUG
+       /*
+        * Verify that each bucket's unit size points back to the bucket by the
+        * bucket map. This must be true for the default allocation classes,
+        * otherwise duplicate buckets will be created.
+        */
+       for (size_t i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               struct alloc_class *c = ac->aclasses[i];
+
+               if (c != NULL && c->type == CLASS_RUN) {
+                       ASSERTeq(i, c->id);
+                       ASSERTeq(alloc_class_by_run(ac, c->unit_size,
+                               c->flags, c->rdsc.size_idx), c);
+               }
+       }
+#endif
+
+       return ac;
+
+error:
+       alloc_class_collection_delete(ac);
+
+       return NULL;
+}
+
+/*
+ * alloc_class_collection_delete -- deletes the allocation class collection and
+ *     all of the classes within it
+ */
+void
+alloc_class_collection_delete(struct alloc_class_collection *ac)
+{
+       LOG(10, NULL);
+
+       for (size_t i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               struct alloc_class *c = ac->aclasses[i];
+               if (c != NULL) {
+                       alloc_class_delete(ac, c);
+               }
+       }
+
+       if (ac->class_map_by_unit_size)
+               critnib_delete(ac->class_map_by_unit_size);
+       Free(ac->class_map_by_alloc_size);
+       Free(ac);
+}
+
+/*
+ * alloc_class_assign_by_size -- (internal) chooses the allocation class that
+ *     best approximates the provided size
+ */
+static struct alloc_class *
+alloc_class_assign_by_size(struct alloc_class_collection *ac,
+       size_t size)
+{
+       LOG(10, NULL);
+
+       size_t class_map_index = SIZE_TO_CLASS_MAP_INDEX(size,
+               ac->granularity);
+
+       struct alloc_class *c = alloc_class_find_min_frag(ac,
+               class_map_index * ac->granularity);
+       ASSERTne(c, NULL);
+
+       /*
+        * We don't lock this array because locking this section here and then
+        * bailing out if someone else was faster would be still slower than
+        * just calculating the class and failing to assign the variable.
+        * We are using a compare and swap so that helgrind/drd don't complain.
+        */
+       util_bool_compare_and_swap64(
+               &ac->class_map_by_alloc_size[class_map_index],
+               MAX_ALLOCATION_CLASSES, c->id);
+
+       return c;
+}
+
+/*
+ * alloc_class_by_alloc_size -- returns allocation class that is assigned
+ *     to handle an allocation of the provided size
+ */
+struct alloc_class *
+alloc_class_by_alloc_size(struct alloc_class_collection *ac, size_t size)
+{
+       if (size < ac->last_run_max_size) {
+               uint8_t class_id = ac->class_map_by_alloc_size[
+                       SIZE_TO_CLASS_MAP_INDEX(size, ac->granularity)];
+
+               if (class_id == MAX_ALLOCATION_CLASSES) {
+                       if (ac->fail_on_missing_class)
+                               return NULL;
+                       else if (ac->autogenerate_on_missing_class)
+                               return alloc_class_assign_by_size(ac, size);
+                       else
+                               return ac->aclasses[DEFAULT_ALLOC_CLASS_ID];
+               }
+
+               return ac->aclasses[class_id];
+       } else {
+               return ac->aclasses[DEFAULT_ALLOC_CLASS_ID];
+       }
+}
+
+/*
+ * alloc_class_by_run -- returns the allocation class that has the given
+ *     unit size
+ */
+struct alloc_class *
+alloc_class_by_run(struct alloc_class_collection *ac,
+       size_t unit_size, uint16_t flags, uint32_t size_idx)
+{
+       size_t map_idx = SIZE_TO_CLASS_MAP_INDEX(unit_size, ac->granularity);
+       ASSERT(map_idx <= UINT32_MAX);
+       uint32_t map_idx_s = (uint32_t)map_idx;
+       ASSERT(size_idx <= UINT16_MAX);
+       uint16_t size_idx_s = (uint16_t)size_idx;
+       uint16_t flags_s = (uint16_t)flags;
+
+       return critnib_get(ac->class_map_by_unit_size,
+               RUN_CLASS_KEY_PACK(map_idx_s, flags_s, size_idx_s));
+}
+
+/*
+ * alloc_class_by_id -- returns the allocation class with an id
+ */
+struct alloc_class *
+alloc_class_by_id(struct alloc_class_collection *ac, uint8_t id)
+{
+       return ac->aclasses[id];
+}
+
+/*
+ * alloc_class_calc_size_idx -- calculates how many units does the size require
+ */
+ssize_t
+alloc_class_calc_size_idx(struct alloc_class *c, size_t size)
+{
+       uint32_t size_idx = CALC_SIZE_IDX(c->unit_size,
+               size + header_type_to_size[c->header_type]);
+
+       if (c->type == CLASS_RUN) {
+               if (c->header_type == HEADER_NONE && size_idx != 1)
+                       return -1;
+               else if (size_idx > RUN_UNIT_MAX)
+                       return -1;
+               else if (size_idx > c->rdsc.nallocs)
+                       return -1;
+       }
+
+       return size_idx;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/alloc_class.h b/ceph/src/pmdk/src/libpmemobj/alloc_class.h
new file mode 100644 (file)
index 0000000..442fa06
--- /dev/null
@@ -0,0 +1,79 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * alloc_class.h -- internal definitions for allocation classes
+ */
+
+#ifndef LIBPMEMOBJ_ALLOC_CLASS_H
+#define LIBPMEMOBJ_ALLOC_CLASS_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include "heap_layout.h"
+#include "memblock.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_ALLOCATION_CLASSES (UINT8_MAX)
+#define DEFAULT_ALLOC_CLASS_ID (0)
+#define RUN_UNIT_MAX RUN_BITS_PER_VALUE
+
+struct alloc_class_collection;
+
+enum alloc_class_type {
+       CLASS_UNKNOWN,
+       CLASS_HUGE,
+       CLASS_RUN,
+
+       MAX_ALLOC_CLASS_TYPES
+};
+
+struct alloc_class {
+       uint8_t id;
+       uint16_t flags;
+
+       size_t unit_size;
+
+       enum header_type header_type;
+       enum alloc_class_type type;
+
+       /* run-specific data */
+       struct run_descriptor rdsc;
+};
+
+struct alloc_class_collection *alloc_class_collection_new(void);
+void alloc_class_collection_delete(struct alloc_class_collection *ac);
+
+struct alloc_class *alloc_class_by_run(
+       struct alloc_class_collection *ac,
+       size_t unit_size, uint16_t flags, uint32_t size_idx);
+struct alloc_class *alloc_class_by_alloc_size(
+       struct alloc_class_collection *ac, size_t size);
+struct alloc_class *alloc_class_by_id(
+       struct alloc_class_collection *ac, uint8_t id);
+
+int alloc_class_reserve(struct alloc_class_collection *ac, uint8_t id);
+int alloc_class_find_first_free_slot(struct alloc_class_collection *ac,
+       uint8_t *slot);
+
+ssize_t
+alloc_class_calc_size_idx(struct alloc_class *c, size_t size);
+
+struct alloc_class *
+alloc_class_new(int id, struct alloc_class_collection *ac,
+       enum alloc_class_type type, enum header_type htype,
+       size_t unit_size, size_t alignment,
+       uint32_t size_idx);
+
+void alloc_class_delete(struct alloc_class_collection *ac,
+       struct alloc_class *c);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/bucket.c b/ceph/src/pmdk/src/libpmemobj/bucket.c
new file mode 100644 (file)
index 0000000..4b32dc0
--- /dev/null
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * bucket.c -- bucket implementation
+ *
+ * Buckets manage volatile state of the heap. They are the abstraction layer
+ * between the heap-managed chunks/runs and memory allocations.
+ *
+ * Each bucket instance can have a different underlying container that is
+ * responsible for selecting blocks - which means that whether the allocator
+ * serves memory blocks in best/first/next -fit manner is decided during bucket
+ * creation.
+ */
+
+#include "alloc_class.h"
+#include "bucket.h"
+#include "heap.h"
+#include "out.h"
+#include "sys_util.h"
+#include "valgrind_internal.h"
+
+/*
+ * bucket_new -- creates a new bucket instance
+ */
+struct bucket *
+bucket_new(struct block_container *c, struct alloc_class *aclass)
+{
+       if (c == NULL)
+               return NULL;
+
+       struct bucket *b = Malloc(sizeof(*b));
+       if (b == NULL)
+               return NULL;
+
+       b->container = c;
+       b->c_ops = c->c_ops;
+
+       util_mutex_init(&b->lock);
+
+       b->is_active = 0;
+       b->active_memory_block = NULL;
+       if (aclass && aclass->type == CLASS_RUN) {
+               b->active_memory_block =
+                       Zalloc(sizeof(struct memory_block_reserved));
+
+               if (b->active_memory_block == NULL)
+                       goto error_active_alloc;
+       }
+       b->aclass = aclass;
+
+       return b;
+
+error_active_alloc:
+
+       util_mutex_destroy(&b->lock);
+       Free(b);
+       return NULL;
+}
+
+/*
+ * bucket_insert_block -- inserts a block into the bucket
+ */
+int
+bucket_insert_block(struct bucket *b, const struct memory_block *m)
+{
+#if VG_MEMCHECK_ENABLED || VG_HELGRIND_ENABLED || VG_DRD_ENABLED
+       if (On_memcheck || On_drd_or_hg) {
+               size_t size = m->m_ops->get_real_size(m);
+               void *data = m->m_ops->get_real_data(m);
+               VALGRIND_DO_MAKE_MEM_NOACCESS(data, size);
+               VALGRIND_ANNOTATE_NEW_MEMORY(data, size);
+       }
+#endif
+       return b->c_ops->insert(b->container, m);
+}
+
+/*
+ * bucket_delete -- cleanups and deallocates bucket instance
+ */
+void
+bucket_delete(struct bucket *b)
+{
+       if (b->active_memory_block)
+               Free(b->active_memory_block);
+
+       util_mutex_destroy(&b->lock);
+       b->c_ops->destroy(b->container);
+       Free(b);
+}
+
+/*
+ * bucket_current_resvp -- returns the pointer to the current reservation count
+ */
+int *
+bucket_current_resvp(struct bucket *b)
+{
+       return b->active_memory_block ? &b->active_memory_block->nresv : NULL;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/bucket.h b/ceph/src/pmdk/src/libpmemobj/bucket.h
new file mode 100644 (file)
index 0000000..167b6f4
--- /dev/null
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * bucket.h -- internal definitions for bucket
+ */
+
+#ifndef LIBPMEMOBJ_BUCKET_H
+#define LIBPMEMOBJ_BUCKET_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "container.h"
+#include "memblock.h"
+#include "os_thread.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CALC_SIZE_IDX(_unit_size, _size)\
+((_size) == 0 ? 0 : (uint32_t)((((_size) - 1) / (_unit_size)) + 1))
+
+struct bucket {
+       os_mutex_t lock;
+
+       struct alloc_class *aclass;
+
+       struct block_container *container;
+       const struct block_container_ops *c_ops;
+
+       struct memory_block_reserved *active_memory_block;
+       int is_active;
+};
+
+struct bucket *bucket_new(struct block_container *c,
+       struct alloc_class *aclass);
+
+int *bucket_current_resvp(struct bucket *b);
+
+int bucket_insert_block(struct bucket *b, const struct memory_block *m);
+
+void bucket_delete(struct bucket *b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/container.h b/ceph/src/pmdk/src/libpmemobj/container.h
new file mode 100644 (file)
index 0000000..1b8f752
--- /dev/null
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * container.h -- internal definitions for block containers
+ */
+
+#ifndef LIBPMEMOBJ_CONTAINER_H
+#define LIBPMEMOBJ_CONTAINER_H 1
+
+#include "memblock.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct block_container {
+       const struct block_container_ops *c_ops;
+       struct palloc_heap *heap;
+};
+
+struct block_container_ops {
+       /* inserts a new memory block into the container */
+       int (*insert)(struct block_container *c, const struct memory_block *m);
+
+       /* removes exact match memory block */
+       int (*get_rm_exact)(struct block_container *c,
+               const struct memory_block *m);
+
+       /* removes and returns the best-fit memory block for size */
+       int (*get_rm_bestfit)(struct block_container *c,
+               struct memory_block *m);
+
+       /* checks whether the container is empty */
+       int (*is_empty)(struct block_container *c);
+
+       /* removes all elements from the container */
+       void (*rm_all)(struct block_container *c);
+
+       /* deletes the container */
+       void (*destroy)(struct block_container *c);
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPMEMOBJ_CONTAINER_H */
diff --git a/ceph/src/pmdk/src/libpmemobj/container_ravl.c b/ceph/src/pmdk/src/libpmemobj/container_ravl.c
new file mode 100644 (file)
index 0000000..4c11d73
--- /dev/null
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * container_ravl.c -- implementation of ravl-based block container
+ */
+
+#include "container_ravl.h"
+#include "ravl.h"
+#include "out.h"
+#include "sys_util.h"
+
+struct block_container_ravl {
+       struct block_container super;
+       struct ravl *tree;
+};
+
+/*
+ * container_compare_memblocks -- (internal) compares two memory blocks
+ */
+static int
+container_compare_memblocks(const void *lhs, const void *rhs)
+{
+       const struct memory_block *l = lhs;
+       const struct memory_block *r = rhs;
+
+       int64_t diff = (int64_t)l->size_idx - (int64_t)r->size_idx;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->zone_id - (int64_t)r->zone_id;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->chunk_id - (int64_t)r->chunk_id;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->block_off - (int64_t)r->block_off;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       return 0;
+}
+
+/*
+ * container_ravl_insert_block -- (internal) inserts a new memory block
+ *     into the container
+ */
+static int
+container_ravl_insert_block(struct block_container *bc,
+       const struct memory_block *m)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       struct memory_block *e = m->m_ops->get_user_data(m);
+       VALGRIND_DO_MAKE_MEM_DEFINED(e, sizeof(*e));
+       VALGRIND_ADD_TO_TX(e, sizeof(*e));
+       *e = *m;
+       VALGRIND_SET_CLEAN(e, sizeof(*e));
+       VALGRIND_REMOVE_FROM_TX(e, sizeof(*e));
+
+       return ravl_insert(c->tree, e);
+}
+
+/*
+ * container_ravl_get_rm_block_bestfit -- (internal) removes and returns the
+ *     best-fit memory block for size
+ */
+static int
+container_ravl_get_rm_block_bestfit(struct block_container *bc,
+       struct memory_block *m)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       struct ravl_node *n = ravl_find(c->tree, m,
+               RAVL_PREDICATE_GREATER_EQUAL);
+       if (n == NULL)
+               return ENOMEM;
+
+       struct memory_block *e = ravl_data(n);
+       *m = *e;
+       ravl_remove(c->tree, n);
+
+       return 0;
+}
+
+/*
+ * container_ravl_get_rm_block_exact --
+ *     (internal) removes exact match memory block
+ */
+static int
+container_ravl_get_rm_block_exact(struct block_container *bc,
+       const struct memory_block *m)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       struct ravl_node *n = ravl_find(c->tree, m, RAVL_PREDICATE_EQUAL);
+       if (n == NULL)
+               return ENOMEM;
+
+       ravl_remove(c->tree, n);
+
+       return 0;
+}
+
+/*
+ * container_ravl_is_empty -- (internal) checks whether the container is empty
+ */
+static int
+container_ravl_is_empty(struct block_container *bc)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       return ravl_empty(c->tree);
+}
+
+/*
+ * container_ravl_rm_all -- (internal) removes all elements from the tree
+ */
+static void
+container_ravl_rm_all(struct block_container *bc)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       ravl_clear(c->tree);
+}
+
+/*
+ * container_ravl_delete -- (internal) deletes the container
+ */
+static void
+container_ravl_destroy(struct block_container *bc)
+{
+       struct block_container_ravl *c =
+               (struct block_container_ravl *)bc;
+
+       ravl_delete(c->tree);
+
+       Free(bc);
+}
+
+/*
+ * Tree-based block container used to provide best-fit functionality to the
+ * bucket. The time complexity for this particular container is O(k) where k is
+ * the length of the key.
+ *
+ * The get methods also guarantee that the block with lowest possible address
+ * that best matches the requirements is provided.
+ */
+static const struct block_container_ops container_ravl_ops = {
+       .insert = container_ravl_insert_block,
+       .get_rm_exact = container_ravl_get_rm_block_exact,
+       .get_rm_bestfit = container_ravl_get_rm_block_bestfit,
+       .is_empty = container_ravl_is_empty,
+       .rm_all = container_ravl_rm_all,
+       .destroy = container_ravl_destroy,
+};
+
+/*
+ * container_new_ravl -- allocates and initializes a ravl container
+ */
+struct block_container *
+container_new_ravl(struct palloc_heap *heap)
+{
+       struct block_container_ravl *bc = Malloc(sizeof(*bc));
+       if (bc == NULL)
+               goto error_container_malloc;
+
+       bc->super.heap = heap;
+       bc->super.c_ops = &container_ravl_ops;
+       bc->tree = ravl_new(container_compare_memblocks);
+       if (bc->tree == NULL)
+               goto error_ravl_new;
+
+       return (struct block_container *)&bc->super;
+
+error_ravl_new:
+       Free(bc);
+
+error_container_malloc:
+       return NULL;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/container_ravl.h b/ceph/src/pmdk/src/libpmemobj/container_ravl.h
new file mode 100644 (file)
index 0000000..62bc0da
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * container_ravl.h -- internal definitions for ravl-based block container
+ */
+
+#ifndef LIBPMEMOBJ_CONTAINER_RAVL_H
+#define LIBPMEMOBJ_CONTAINER_RAVL_H 1
+
+#include "container.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct block_container *container_new_ravl(struct palloc_heap *heap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPMEMOBJ_CONTAINER_RAVL_H */
diff --git a/ceph/src/pmdk/src/libpmemobj/container_seglists.c b/ceph/src/pmdk/src/libpmemobj/container_seglists.c
new file mode 100644 (file)
index 0000000..286cf60
--- /dev/null
@@ -0,0 +1,171 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2019, Intel Corporation */
+
+/*
+ * container_seglists.c -- implementation of segregated lists block container
+ *
+ * This container is constructed from N (up to 64) intrusive lists and a
+ * single 8 byte bitmap that stores the information whether a given list is
+ * empty or not.
+ */
+
+#include "container_seglists.h"
+#include "out.h"
+#include "sys_util.h"
+#include "util.h"
+#include "valgrind_internal.h"
+#include "vecq.h"
+
+#define SEGLIST_BLOCK_LISTS 64U
+
+struct block_container_seglists {
+       struct block_container super;
+       struct memory_block m;
+       VECQ(, uint32_t) blocks[SEGLIST_BLOCK_LISTS];
+       uint64_t nonempty_lists;
+};
+
+/*
+ * container_seglists_insert_block -- (internal) inserts a new memory block
+ *     into the container
+ */
+static int
+container_seglists_insert_block(struct block_container *bc,
+       const struct memory_block *m)
+{
+       ASSERT(m->chunk_id < MAX_CHUNK);
+       ASSERT(m->zone_id < UINT16_MAX);
+       ASSERTne(m->size_idx, 0);
+
+       struct block_container_seglists *c =
+               (struct block_container_seglists *)bc;
+
+       if (c->nonempty_lists == 0)
+               c->m = *m;
+
+       ASSERT(m->size_idx <= SEGLIST_BLOCK_LISTS);
+       ASSERT(m->chunk_id == c->m.chunk_id);
+       ASSERT(m->zone_id == c->m.zone_id);
+
+       if (VECQ_ENQUEUE(&c->blocks[m->size_idx - 1], m->block_off) != 0)
+               return -1;
+
+       /* marks the list as nonempty */
+       c->nonempty_lists |= 1ULL << (m->size_idx - 1);
+
+       return 0;
+}
+
+/*
+ * container_seglists_get_rm_block_bestfit -- (internal) removes and returns the
+ *     best-fit memory block for size
+ */
+static int
+container_seglists_get_rm_block_bestfit(struct block_container *bc,
+       struct memory_block *m)
+{
+       struct block_container_seglists *c =
+               (struct block_container_seglists *)bc;
+
+       ASSERT(m->size_idx <= SEGLIST_BLOCK_LISTS);
+       uint32_t i = 0;
+
+       /* applicable lists */
+       uint64_t size_mask = (1ULL << (m->size_idx - 1)) - 1;
+       uint64_t v = c->nonempty_lists & ~size_mask;
+       if (v == 0)
+               return ENOMEM;
+
+       /* finds the list that serves the smallest applicable size */
+       i = util_lssb_index64(v);
+
+       uint32_t block_offset = VECQ_DEQUEUE(&c->blocks[i]);
+
+       if (VECQ_SIZE(&c->blocks[i]) == 0) /* marks the list as empty */
+               c->nonempty_lists &= ~(1ULL << (i));
+
+       *m = c->m;
+       m->block_off = block_offset;
+       m->size_idx = i + 1;
+
+       return 0;
+}
+
+/*
+ * container_seglists_is_empty -- (internal) checks whether the container is
+ * empty
+ */
+static int
+container_seglists_is_empty(struct block_container *bc)
+{
+       struct block_container_seglists *c =
+               (struct block_container_seglists *)bc;
+
+       return c->nonempty_lists == 0;
+}
+
+/*
+ * container_seglists_rm_all -- (internal) removes all elements from the tree
+ */
+static void
+container_seglists_rm_all(struct block_container *bc)
+{
+       struct block_container_seglists *c =
+               (struct block_container_seglists *)bc;
+
+       for (unsigned i = 0; i < SEGLIST_BLOCK_LISTS; ++i)
+               VECQ_CLEAR(&c->blocks[i]);
+
+       c->nonempty_lists = 0;
+}
+
+/*
+ * container_seglists_delete -- (internal) deletes the container
+ */
+static void
+container_seglists_destroy(struct block_container *bc)
+{
+       struct block_container_seglists *c =
+               (struct block_container_seglists *)bc;
+
+       for (unsigned i = 0; i < SEGLIST_BLOCK_LISTS; ++i)
+               VECQ_DELETE(&c->blocks[i]);
+
+       Free(c);
+}
+
+/*
+ * This container does not support retrieval of exact memory blocks, but other
+ * than provides best-fit in O(1) time for unit sizes that do not exceed 64.
+ */
+static const struct block_container_ops container_seglists_ops = {
+       .insert = container_seglists_insert_block,
+       .get_rm_exact = NULL,
+       .get_rm_bestfit = container_seglists_get_rm_block_bestfit,
+       .is_empty = container_seglists_is_empty,
+       .rm_all = container_seglists_rm_all,
+       .destroy = container_seglists_destroy,
+};
+
+/*
+ * container_new_seglists -- allocates and initializes a seglists container
+ */
+struct block_container *
+container_new_seglists(struct palloc_heap *heap)
+{
+       struct block_container_seglists *bc = Malloc(sizeof(*bc));
+       if (bc == NULL)
+               goto error_container_malloc;
+
+       bc->super.heap = heap;
+       bc->super.c_ops = &container_seglists_ops;
+
+       for (unsigned i = 0; i < SEGLIST_BLOCK_LISTS; ++i)
+               VECQ_INIT(&bc->blocks[i]);
+       bc->nonempty_lists = 0;
+
+       return (struct block_container *)&bc->super;
+
+error_container_malloc:
+       return NULL;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/container_seglists.h b/ceph/src/pmdk/src/libpmemobj/container_seglists.h
new file mode 100644 (file)
index 0000000..c21bb86
--- /dev/null
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * container_seglists.h -- internal definitions for
+ *     segregated lists block container
+ */
+
+#ifndef LIBPMEMOBJ_CONTAINER_SEGLISTS_H
+#define LIBPMEMOBJ_CONTAINER_SEGLISTS_H 1
+
+#include "container.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct block_container *container_new_seglists(struct palloc_heap *heap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPMEMOBJ_CONTAINER_SEGLISTS_H */
diff --git a/ceph/src/pmdk/src/libpmemobj/critnib.c b/ceph/src/pmdk/src/libpmemobj/critnib.c
new file mode 100644 (file)
index 0000000..6b59b13
--- /dev/null
@@ -0,0 +1,651 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * critnib.c -- implementation of critnib tree
+ *
+ * It offers identity lookup (like a hashmap) and <= lookup (like a search
+ * tree).  Unlike some hashing algorithms (cuckoo hash, perfect hashing) the
+ * complexity isn't constant, but for data sizes we expect it's several
+ * times as fast as cuckoo, and has no "stop the world" cases that would
+ * cause latency (ie, better worst case behaviour).
+ */
+
+/*
+ * STRUCTURE DESCRIPTION
+ *
+ * Critnib is a hybrid between a radix tree and DJ Bernstein's critbit:
+ * it skips nodes for uninteresting radix nodes (ie, ones that would have
+ * exactly one child), this requires adding to every node a field that
+ * describes the slice (4-bit in our case) that this radix level is for.
+ *
+ * This implementation also stores each node's path (ie, bits that are
+ * common to every key in that subtree) -- this doesn't help with lookups
+ * at all (unused in == match, could be reconstructed at no cost in <=
+ * after first dive) but simplifies inserts and removes.  If we ever want
+ * that piece of memory it's easy to trim it down.
+ */
+
+/*
+ * CONCURRENCY ISSUES
+ *
+ * Reads are completely lock-free sync-free, but only almost wait-free:
+ * if for some reason a read thread gets pathologically stalled, it will
+ * notice the data being stale and restart the work.  In usual cases,
+ * the structure having been modified does _not_ cause a restart.
+ *
+ * Writes could be easily made lock-free as well (with only a cmpxchg
+ * sync), but this leads to problems with removes.  A possible solution
+ * would be doing removes by overwriting by NULL w/o freeing -- yet this
+ * would lead to the structure growing without bounds.  Complex per-node
+ * locks would increase concurrency but they slow down individual writes
+ * enough that in practice a simple global write lock works faster.
+ *
+ * Removes are the only operation that can break reads.  The structure
+ * can do local RCU well -- the problem being knowing when it's safe to
+ * free.  Any synchronization with reads would kill their speed, thus
+ * instead we have a remove count.  The grace period is DELETED_LIFE,
+ * after which any read will notice staleness and restart its work.
+ */
+#include <errno.h>
+#include <stdbool.h>
+
+#include "alloc.h"
+#include "critnib.h"
+#include "out.h"
+#include "sys_util.h"
+#include "valgrind_internal.h"
+
+/*
+ * A node that has been deleted is left untouched for this many delete
+ * cycles.  Reads have guaranteed correctness if they took no longer than
+ * DELETED_LIFE concurrent deletes, otherwise they notice something is
+ * wrong and restart.  The memory of deleted nodes is never freed to
+ * malloc nor their pointers lead anywhere wrong, thus a stale read will
+ * (temporarily) get a wrong answer but won't crash.
+ *
+ * There's no need to count writes as they never interfere with reads.
+ *
+ * Allowing stale reads (of arbitrarily old writes or of deletes less than
+ * DELETED_LIFE old) might sound counterintuitive, but it doesn't affect
+ * semantics in any way: the thread could have been stalled just after
+ * returning from our code.  Thus, the guarantee is: the result of get() or
+ * find_le() is a value that was current at any point between the call
+ * start and end.
+ */
+#define DELETED_LIFE 16
+
+#define SLICE 4
+#define NIB ((1ULL << SLICE) - 1)
+#define SLNODES (1 << SLICE)
+
+typedef unsigned char sh_t;
+
+struct critnib_node {
+       /*
+        * path is the part of a tree that's already traversed (be it through
+        * explicit nodes or collapsed links) -- ie, any subtree below has all
+        * those bits set to this value.
+        *
+        * nib is a 4-bit slice that's an index into the node's children.
+        *
+        * shift is the length (in bits) of the part of the key below this node.
+        *
+        *            nib
+        * |XXXXXXXXXX|?|*****|
+        *    path      ^
+        *              +-----+
+        *               shift
+        */
+       struct critnib_node *child[SLNODES];
+       uint64_t path;
+       sh_t shift;
+};
+
+struct critnib_leaf {
+       uint64_t key;
+       void *value;
+};
+
+struct critnib {
+       struct critnib_node *root;
+
+       /* pool of freed nodes: singly linked list, next at child[0] */
+       struct critnib_node *deleted_node;
+       struct critnib_leaf *deleted_leaf;
+
+       /* nodes removed but not yet eligible for reuse */
+       struct critnib_node *pending_del_nodes[DELETED_LIFE];
+       struct critnib_leaf *pending_del_leaves[DELETED_LIFE];
+
+       uint64_t remove_count;
+
+       os_mutex_t mutex; /* writes/removes */
+};
+
+/*
+ * atomic load
+ */
+static void
+load(void *src, void *dst)
+{
+       util_atomic_load_explicit64((uint64_t *)src, (uint64_t *)dst,
+               memory_order_acquire);
+}
+
+/*
+ * atomic store
+ */
+static void
+store(void *dst, void *src)
+{
+       util_atomic_store_explicit64((uint64_t *)dst, (uint64_t)src,
+               memory_order_release);
+}
+
+/*
+ * internal: is_leaf -- check tagged pointer for leafness
+ */
+static inline bool
+is_leaf(struct critnib_node *n)
+{
+       return (uint64_t)n & 1;
+}
+
+/*
+ * internal: to_leaf -- untag a leaf pointer
+ */
+static inline struct critnib_leaf *
+to_leaf(struct critnib_node *n)
+{
+       return (void *)((uint64_t)n & ~1ULL);
+}
+
+/*
+ * internal: path_mask -- return bit mask of a path above a subtree [shift]
+ * bits tall
+ */
+static inline uint64_t
+path_mask(sh_t shift)
+{
+       return ~NIB << shift;
+}
+
+/*
+ * internal: slice_index -- return index of child at the given nib
+ */
+static inline unsigned
+slice_index(uint64_t key, sh_t shift)
+{
+       return (unsigned)((key >> shift) & NIB);
+}
+
+/*
+ * critnib_new -- allocates a new critnib structure
+ */
+struct critnib *
+critnib_new(void)
+{
+       struct critnib *c = Zalloc(sizeof(struct critnib));
+       if (!c)
+               return NULL;
+
+       util_mutex_init(&c->mutex);
+
+       VALGRIND_HG_DRD_DISABLE_CHECKING(&c->root, sizeof(c->root));
+       VALGRIND_HG_DRD_DISABLE_CHECKING(&c->remove_count,
+                                       sizeof(c->remove_count));
+
+       return c;
+}
+
+/*
+ * internal: delete_node -- recursively free (to malloc) a subtree
+ */
+static void
+delete_node(struct critnib_node *__restrict n)
+{
+       if (!is_leaf(n)) {
+               for (int i = 0; i < SLNODES; i++) {
+                       if (n->child[i])
+                               delete_node(n->child[i]);
+               }
+
+               Free(n);
+       } else {
+               Free(to_leaf(n));
+       }
+}
+
+/*
+ * critnib_delete -- destroy and free a critnib struct
+ */
+void
+critnib_delete(struct critnib *c)
+{
+       if (c->root)
+               delete_node(c->root);
+
+       util_mutex_destroy(&c->mutex);
+
+       for (struct critnib_node *m = c->deleted_node; m; ) {
+               struct critnib_node *mm = m->child[0];
+               Free(m);
+               m = mm;
+       }
+
+       for (struct critnib_leaf *k = c->deleted_leaf; k; ) {
+               struct critnib_leaf *kk = k->value;
+               Free(k);
+               k = kk;
+       }
+
+       for (int i = 0; i < DELETED_LIFE; i++) {
+               Free(c->pending_del_nodes[i]);
+               Free(c->pending_del_leaves[i]);
+       }
+
+       Free(c);
+}
+
+/*
+ * internal: free_node -- free (to internal pool, not malloc) a node.
+ *
+ * We cannot free them to malloc as a stalled reader thread may still walk
+ * through such nodes; it will notice the result being bogus but only after
+ * completing the walk, thus we need to ensure any freed nodes still point
+ * to within the critnib structure.
+ */
+static void
+free_node(struct critnib *__restrict c, struct critnib_node *__restrict n)
+{
+       if (!n)
+               return;
+
+       ASSERT(!is_leaf(n));
+       n->child[0] = c->deleted_node;
+       c->deleted_node = n;
+}
+
+/*
+ * internal: alloc_node -- allocate a node from our pool or from malloc
+ */
+static struct critnib_node *
+alloc_node(struct critnib *__restrict c)
+{
+       if (!c->deleted_node) {
+               struct critnib_node *n = Malloc(sizeof(struct critnib_node));
+               if (n == NULL)
+                       ERR("!Malloc");
+
+               return n;
+       }
+
+       struct critnib_node *n = c->deleted_node;
+
+       c->deleted_node = n->child[0];
+       VALGRIND_ANNOTATE_NEW_MEMORY(n, sizeof(*n));
+
+       return n;
+}
+
+/*
+ * internal: free_leaf -- free (to internal pool, not malloc) a leaf.
+ *
+ * See free_node().
+ */
+static void
+free_leaf(struct critnib *__restrict c, struct critnib_leaf *__restrict k)
+{
+       if (!k)
+               return;
+
+       k->value = c->deleted_leaf;
+       c->deleted_leaf = k;
+}
+
+/*
+ * internal: alloc_leaf -- allocate a leaf from our pool or from malloc
+ */
+static struct critnib_leaf *
+alloc_leaf(struct critnib *__restrict c)
+{
+       if (!c->deleted_leaf) {
+               struct critnib_leaf *k = Malloc(sizeof(struct critnib_leaf));
+               if (k == NULL)
+                       ERR("!Malloc");
+
+               return k;
+       }
+
+       struct critnib_leaf *k = c->deleted_leaf;
+
+       c->deleted_leaf = k->value;
+       VALGRIND_ANNOTATE_NEW_MEMORY(k, sizeof(*k));
+
+       return k;
+}
+
+/*
+ * crinib_insert -- write a key:value pair to the critnib structure
+ *
+ * Returns:
+ *  • 0 on success
+ *  • EEXIST if such a key already exists
+ *  • ENOMEM if we're out of memory
+ *
+ * Takes a global write lock but doesn't stall any readers.
+ */
+int
+critnib_insert(struct critnib *c, uint64_t key, void *value)
+{
+       util_mutex_lock(&c->mutex);
+
+       struct critnib_leaf *k = alloc_leaf(c);
+       if (!k) {
+               util_mutex_unlock(&c->mutex);
+
+               return ENOMEM;
+       }
+
+       VALGRIND_HG_DRD_DISABLE_CHECKING(k, sizeof(struct critnib_leaf));
+
+       k->key = key;
+       k->value = value;
+
+       struct critnib_node *kn = (void *)((uint64_t)k | 1);
+
+       struct critnib_node *n = c->root;
+       if (!n) {
+               c->root = kn;
+
+               util_mutex_unlock(&c->mutex);
+
+               return 0;
+       }
+
+       struct critnib_node **parent = &c->root;
+       struct critnib_node *prev = c->root;
+
+       while (n && !is_leaf(n) && (key & path_mask(n->shift)) == n->path) {
+               prev = n;
+               parent = &n->child[slice_index(key, n->shift)];
+               n = *parent;
+       }
+
+       if (!n) {
+               n = prev;
+               store(&n->child[slice_index(key, n->shift)], kn);
+
+               util_mutex_unlock(&c->mutex);
+
+               return 0;
+       }
+
+       uint64_t path = is_leaf(n) ? to_leaf(n)->key : n->path;
+       /* Find where the path differs from our key. */
+       uint64_t at = path ^ key;
+       if (!at) {
+               ASSERT(is_leaf(n));
+               free_leaf(c, to_leaf(kn));
+               /* fail instead of replacing */
+
+               util_mutex_unlock(&c->mutex);
+
+               return EEXIST;
+       }
+
+       /* and convert that to an index. */
+       sh_t sh = util_mssb_index64(at) & (sh_t)~(SLICE - 1);
+
+       struct critnib_node *m = alloc_node(c);
+       if (!m) {
+               free_leaf(c, to_leaf(kn));
+
+               util_mutex_unlock(&c->mutex);
+
+               return ENOMEM;
+       }
+       VALGRIND_HG_DRD_DISABLE_CHECKING(m, sizeof(struct critnib_node));
+
+       for (int i = 0; i < SLNODES; i++)
+               m->child[i] = NULL;
+
+       m->child[slice_index(key, sh)] = kn;
+       m->child[slice_index(path, sh)] = n;
+       m->shift = sh;
+       m->path = key & path_mask(sh);
+       store(parent, m);
+
+       util_mutex_unlock(&c->mutex);
+
+       return 0;
+}
+
+/*
+ * critnib_remove -- delete a key from the critnib structure, return its value
+ */
+void *
+critnib_remove(struct critnib *c, uint64_t key)
+{
+       struct critnib_leaf *k;
+       void *value = NULL;
+
+       util_mutex_lock(&c->mutex);
+
+       struct critnib_node *n = c->root;
+       if (!n)
+               goto not_found;
+
+       uint64_t del = util_fetch_and_add64(&c->remove_count, 1) % DELETED_LIFE;
+       free_node(c, c->pending_del_nodes[del]);
+       free_leaf(c, c->pending_del_leaves[del]);
+       c->pending_del_nodes[del] = NULL;
+       c->pending_del_leaves[del] = NULL;
+
+       if (is_leaf(n)) {
+               k = to_leaf(n);
+               if (k->key == key) {
+                       store(&c->root, NULL);
+                       goto del_leaf;
+               }
+
+               goto not_found;
+       }
+       /*
+        * n and k are a parent:child pair (after the first iteration); k is the
+        * leaf that holds the key we're deleting.
+        */
+       struct critnib_node **k_parent = &c->root;
+       struct critnib_node **n_parent = &c->root;
+       struct critnib_node *kn = n;
+
+       while (!is_leaf(kn)) {
+               n_parent = k_parent;
+               n = kn;
+               k_parent = &kn->child[slice_index(key, kn->shift)];
+               kn = *k_parent;
+
+               if (!kn)
+                       goto not_found;
+       }
+
+       k = to_leaf(kn);
+       if (k->key != key)
+               goto not_found;
+
+       store(&n->child[slice_index(key, n->shift)], NULL);
+
+       /* Remove the node if there's only one remaining child. */
+       int ochild = -1;
+       for (int i = 0; i < SLNODES; i++) {
+               if (n->child[i]) {
+                       if (ochild != -1)
+                               goto del_leaf;
+
+                       ochild = i;
+               }
+       }
+
+       ASSERTne(ochild, -1);
+
+       store(n_parent, n->child[ochild]);
+       c->pending_del_nodes[del] = n;
+
+del_leaf:
+       value = k->value;
+       c->pending_del_leaves[del] = k;
+
+not_found:
+       util_mutex_unlock(&c->mutex);
+       return value;
+}
+
+/*
+ * critnib_get -- query for a key ("==" match), returns value or NULL
+ *
+ * Doesn't need a lock but if many deletes happened while our thread was
+ * somehow stalled the query is restarted (as freed nodes remain unused only
+ * for a grace period).
+ *
+ * Counterintuitively, it's pointless to return the most current answer,
+ * we need only one that was valid at any point after the call started.
+ */
+void *
+critnib_get(struct critnib *c, uint64_t key)
+{
+       uint64_t wrs1, wrs2;
+       void *res;
+
+       do {
+               struct critnib_node *n;
+
+               load(&c->remove_count, &wrs1);
+               load(&c->root, &n);
+
+               /*
+                * critbit algorithm: dive into the tree, looking at nothing but
+                * each node's critical bit^H^H^Hnibble.  This means we risk
+                * going wrong way if our path is missing, but that's ok...
+                */
+               while (n && !is_leaf(n))
+                       load(&n->child[slice_index(key, n->shift)], &n);
+
+               /* ... as we check it at the end. */
+               struct critnib_leaf *k = to_leaf(n);
+               res = (n && k->key == key) ? k->value : NULL;
+               load(&c->remove_count, &wrs2);
+       } while (wrs1 + DELETED_LIFE <= wrs2);
+
+       return res;
+}
+
+/*
+ * internal: find_successor -- return the rightmost non-null node in a subtree
+ */
+static void *
+find_successor(struct critnib_node *__restrict n)
+{
+       while (1) {
+               int nib;
+               for (nib = NIB; nib >= 0; nib--)
+                       if (n->child[nib])
+                               break;
+
+               if (nib < 0)
+                       return NULL;
+
+               n = n->child[nib];
+               if (is_leaf(n))
+                       return to_leaf(n)->value;
+       }
+}
+
+/*
+ * internal: find_le -- recursively search <= in a subtree
+ */
+static void *
+find_le(struct critnib_node *__restrict n, uint64_t key)
+{
+       if (!n)
+               return NULL;
+
+       if (is_leaf(n)) {
+               struct critnib_leaf *k = to_leaf(n);
+
+               return (k->key <= key) ? k->value : NULL;
+       }
+
+       /*
+        * is our key outside the subtree we're in?
+        *
+        * If we're inside, all bits above the nib will be identical; note
+        * that shift points at the nib's lower rather than upper edge, so it
+        * needs to be masked away as well.
+        */
+       if ((key ^ n->path) >> (n->shift) & ~NIB) {
+               /*
+                * subtree is too far to the left?
+                * -> its rightmost value is good
+                */
+               if (n->path < key)
+                       return find_successor(n);
+
+               /*
+                * subtree is too far to the right?
+                * -> it has nothing of interest to us
+                */
+               return NULL;
+       }
+
+       unsigned nib = slice_index(key, n->shift);
+       /* recursive call: follow the path */
+       {
+               struct critnib_node *m;
+               load(&n->child[nib], &m);
+               void *value = find_le(m, key);
+               if (value)
+                       return value;
+       }
+
+       /*
+        * nothing in that subtree?  We strayed from the path at this point,
+        * thus need to search every subtree to our left in this node.  No
+        * need to dive into any but the first non-null, though.
+        */
+       for (; nib > 0; nib--) {
+               struct critnib_node *m;
+               load(&n->child[nib - 1], &m);
+               if (m) {
+                       n = m;
+                       if (is_leaf(n))
+                               return to_leaf(n)->value;
+
+                       return find_successor(n);
+               }
+       }
+
+       return NULL;
+}
+
+/*
+ * critnib_find_le -- query for a key ("<=" match), returns value or NULL
+ *
+ * Same guarantees as critnib_get().
+ */
+void *
+critnib_find_le(struct critnib *c, uint64_t key)
+{
+       uint64_t wrs1, wrs2;
+       void *res;
+
+       do {
+               load(&c->remove_count, &wrs1);
+               struct critnib_node *n; /* avoid a subtle TOCTOU */
+               load(&c->root, &n);
+               res = n ? find_le(n, key) : NULL;
+               load(&c->remove_count, &wrs2);
+       } while (wrs1 + DELETED_LIFE <= wrs2);
+
+       return res;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/critnib.h b/ceph/src/pmdk/src/libpmemobj/critnib.h
new file mode 100644 (file)
index 0000000..d336643
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * critnib.h -- internal definitions for critnib tree
+ */
+
+#ifndef LIBPMEMOBJ_CRITNIB_H
+#define LIBPMEMOBJ_CRITNIB_H 1
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct critnib;
+
+struct critnib *critnib_new(void);
+void critnib_delete(struct critnib *c);
+
+int critnib_insert(struct critnib *c, uint64_t key, void *value);
+void *critnib_remove(struct critnib *c, uint64_t key);
+void *critnib_get(struct critnib *c, uint64_t key);
+void *critnib_find_le(struct critnib *c, uint64_t key);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/ctl_debug.c b/ceph/src/pmdk/src/libpmemobj/ctl_debug.c
new file mode 100644 (file)
index 0000000..fa7b209
--- /dev/null
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * ctl_debug.c -- implementation of the debug CTL namespace
+ */
+
+#include "ctl.h"
+#include "ctl_debug.h"
+#include "obj.h"
+
+/*
+ * CTL_WRITE_HANDLER(alloc_pattern) -- sets the alloc_pattern field in heap
+ */
+static int
+CTL_WRITE_HANDLER(alloc_pattern)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       int arg_in = *(int *)arg;
+
+       pop->heap.alloc_pattern = arg_in;
+       return 0;
+}
+
+/*
+ * CTL_READ_HANDLER(alloc_pattern) -- returns alloc_pattern heap field
+ */
+static int
+CTL_READ_HANDLER(alloc_pattern)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       int *arg_out = arg;
+
+       *arg_out = pop->heap.alloc_pattern;
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(alloc_pattern) = CTL_ARG_LONG_LONG;
+
+static const struct ctl_node CTL_NODE(heap)[] = {
+       CTL_LEAF_RW(alloc_pattern),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(debug)[] = {
+       CTL_CHILD(heap),
+
+       CTL_NODE_END
+};
+
+/*
+ * debug_ctl_register -- registers ctl nodes for "debug" module
+ */
+void
+debug_ctl_register(PMEMobjpool *pop)
+{
+       CTL_REGISTER_MODULE(pop->ctl, debug);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/ctl_debug.h b/ceph/src/pmdk/src/libpmemobj/ctl_debug.h
new file mode 100644 (file)
index 0000000..7cdb52c
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * ctl_debug.h -- definitions for the debug CTL namespace
+ */
+#ifndef LIBPMEMOBJ_CTL_DEBUG_H
+#define LIBPMEMOBJ_CTL_DEBUG_H 1
+
+#include "libpmemobj.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void debug_ctl_register(PMEMobjpool *pop);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPMEMOBJ_CTL_DEBUG_H */
diff --git a/ceph/src/pmdk/src/libpmemobj/heap.c b/ceph/src/pmdk/src/libpmemobj/heap.c
new file mode 100644 (file)
index 0000000..13fb4b5
--- /dev/null
@@ -0,0 +1,1893 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * heap.c -- heap implementation
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <float.h>
+
+#include "queue.h"
+#include "heap.h"
+#include "out.h"
+#include "util.h"
+#include "sys_util.h"
+#include "valgrind_internal.h"
+#include "recycler.h"
+#include "container_ravl.h"
+#include "container_seglists.h"
+#include "alloc_class.h"
+#include "os_thread.h"
+#include "set.h"
+
+#define MAX_RUN_LOCKS MAX_CHUNK
+#define MAX_RUN_LOCKS_VG 1024 /* avoid perf issues /w drd */
+
+/*
+ * This is the value by which the heap might grow once we hit an OOM.
+ */
+#define HEAP_DEFAULT_GROW_SIZE (1 << 27) /* 128 megabytes */
+#define MAX_DEFAULT_ARENAS (1 << 10) /* 1024 arenas */
+
+struct arenas {
+       VEC(, struct arena *) vec;
+       size_t nactive;
+
+       /*
+        * When nesting with other locks, this one must be acquired first,
+        * prior to locking any buckets or memory blocks.
+        */
+       os_mutex_t lock;
+
+       /* stores a pointer to one of the arenas */
+       os_tls_key_t thread;
+};
+
+/*
+ * Arenas store the collection of buckets for allocation classes.
+ * Each thread is assigned an arena on its first allocator operation
+ * if arena is set to auto.
+ */
+struct arena {
+       /* one bucket per allocation class */
+       struct bucket *buckets[MAX_ALLOCATION_CLASSES];
+
+       /*
+        * Decides whether the arena can be
+        * automatically assigned to a thread.
+        */
+       int automatic;
+       size_t nthreads;
+       struct arenas *arenas;
+};
+
+struct heap_rt {
+       struct alloc_class_collection *alloc_classes;
+
+       /* DON'T use these two variable directly! */
+       struct bucket *default_bucket;
+
+       struct arenas arenas;
+
+       struct recycler *recyclers[MAX_ALLOCATION_CLASSES];
+
+       os_mutex_t run_locks[MAX_RUN_LOCKS];
+       unsigned nlocks;
+
+       unsigned nzones;
+       unsigned zones_exhausted;
+};
+
+/*
+ * heap_arenas_init - (internal) initialize generic arenas info
+ */
+static int
+heap_arenas_init(struct arenas *arenas)
+{
+       util_mutex_init(&arenas->lock);
+       VEC_INIT(&arenas->vec);
+       arenas->nactive = 0;
+
+       if (VEC_RESERVE(&arenas->vec, MAX_DEFAULT_ARENAS) == -1)
+               return -1;
+       return 0;
+}
+
+/*
+ * heap_arenas_fini - (internal) destroy generic arenas info
+ */
+static void
+heap_arenas_fini(struct arenas *arenas)
+{
+       util_mutex_destroy(&arenas->lock);
+       VEC_DELETE(&arenas->vec);
+}
+
+/*
+ * heap_alloc_classes -- returns the allocation classes collection
+ */
+struct alloc_class_collection *
+heap_alloc_classes(struct palloc_heap *heap)
+{
+       return heap->rt ? heap->rt->alloc_classes : NULL;
+}
+
+/*
+ * heap_arena_delete -- (internal) destroys arena instance
+ */
+static void
+heap_arena_delete(struct arena *arena)
+{
+       for (int i = 0; i < MAX_ALLOCATION_CLASSES; ++i)
+               if (arena->buckets[i] != NULL)
+                       bucket_delete(arena->buckets[i]);
+       Free(arena);
+}
+
+/*
+ * heap_arena_new -- (internal) initializes arena instance
+ */
+static struct arena *
+heap_arena_new(struct palloc_heap *heap, int automatic)
+{
+       struct heap_rt *rt = heap->rt;
+
+       struct arena *arena = Zalloc(sizeof(struct arena));
+       if (arena == NULL) {
+               ERR("!heap: arena malloc error");
+               return NULL;
+       }
+       arena->nthreads = 0;
+       arena->automatic = automatic;
+       arena->arenas = &heap->rt->arenas;
+
+       COMPILE_ERROR_ON(MAX_ALLOCATION_CLASSES > UINT8_MAX);
+       for (uint8_t i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               struct alloc_class *ac =
+                       alloc_class_by_id(rt->alloc_classes, i);
+               if (ac != NULL) {
+                       arena->buckets[i] =
+                               bucket_new(container_new_seglists(heap), ac);
+                       if (arena->buckets[i] == NULL)
+                               goto error_bucket_create;
+               } else {
+                       arena->buckets[i] = NULL;
+               }
+       }
+
+       return arena;
+
+error_bucket_create:
+       heap_arena_delete(arena);
+       return NULL;
+}
+
+/*
+ * heap_get_best_class -- returns the alloc class that best fits the
+ *     requested size
+ */
+struct alloc_class *
+heap_get_best_class(struct palloc_heap *heap, size_t size)
+{
+       return alloc_class_by_alloc_size(heap->rt->alloc_classes, size);
+}
+
+/*
+ * heap_arena_thread_detach -- detaches arena from the current thread
+ *
+ * Must be called with arenas lock taken.
+ */
+static void
+heap_arena_thread_detach(struct arena *a)
+{
+       /*
+        * Even though this is under a lock, nactive variable can also be read
+        * concurrently from the recycler (without the arenas lock).
+        * That's why we are using an atomic operation.
+        */
+       if ((--a->nthreads) == 0)
+               util_fetch_and_sub64(&a->arenas->nactive, 1);
+}
+
+/*
+ * heap_arena_thread_attach -- assign arena to the current thread
+ *
+ * Must be called with arenas lock taken.
+ */
+static void
+heap_arena_thread_attach(struct palloc_heap *heap, struct arena *a)
+{
+       struct heap_rt *h = heap->rt;
+
+       struct arena *thread_arena = os_tls_get(h->arenas.thread);
+       if (thread_arena)
+               heap_arena_thread_detach(thread_arena);
+
+       ASSERTne(a, NULL);
+
+       /*
+        * Even though this is under a lock, nactive variable can also be read
+        * concurrently from the recycler (without the arenas lock).
+        * That's why we are using an atomic operation.
+        */
+       if ((a->nthreads++) == 0)
+               util_fetch_and_add64(&a->arenas->nactive, 1);
+
+       os_tls_set(h->arenas.thread, a);
+}
+
+/*
+ * heap_thread_arena_destructor -- (internal) removes arena thread assignment
+ */
+static void
+heap_thread_arena_destructor(void *arg)
+{
+       struct arena *a = arg;
+       os_mutex_lock(&a->arenas->lock);
+       heap_arena_thread_detach(a);
+       os_mutex_unlock(&a->arenas->lock);
+}
+
+/*
+ * heap_get_arena_by_id -- returns arena by id
+ *
+ * Must be called with arenas lock taken.
+ */
+static struct arena *
+heap_get_arena_by_id(struct palloc_heap *heap, unsigned arena_id)
+{
+       return VEC_ARR(&heap->rt->arenas.vec)[arena_id - 1];
+}
+
+/*
+ * heap_thread_arena_assign -- (internal) assigns the least used arena
+ *     to current thread
+ *
+ * To avoid complexities with regards to races in the search for the least
+ * used arena, a lock is used, but the nthreads counter of the arena is still
+ * bumped using atomic instruction because it can happen in parallel to a
+ * destructor of a thread, which also touches that variable.
+ */
+static struct arena *
+heap_thread_arena_assign(struct palloc_heap *heap)
+{
+       util_mutex_lock(&heap->rt->arenas.lock);
+
+       struct arena *least_used = NULL;
+
+       ASSERTne(VEC_SIZE(&heap->rt->arenas.vec), 0);
+
+       struct arena *a;
+       VEC_FOREACH(a, &heap->rt->arenas.vec) {
+               if (!a->automatic)
+                       continue;
+               if (least_used == NULL ||
+                       a->nthreads < least_used->nthreads)
+                       least_used = a;
+       }
+
+       LOG(4, "assigning %p arena to current thread", least_used);
+
+       /* at least one automatic arena must exist */
+       ASSERTne(least_used, NULL);
+       heap_arena_thread_attach(heap, least_used);
+
+       util_mutex_unlock(&heap->rt->arenas.lock);
+
+       return least_used;
+}
+
+/*
+ * heap_thread_arena -- (internal) returns the arena assigned to the current
+ *     thread
+ */
+static struct arena *
+heap_thread_arena(struct palloc_heap *heap)
+{
+       struct arena *a;
+       if ((a = os_tls_get(heap->rt->arenas.thread)) == NULL)
+               a = heap_thread_arena_assign(heap);
+
+       return a;
+}
+
+/*
+ * heap_get_thread_arena_id -- returns the arena id assigned to the current
+ *     thread
+ */
+unsigned
+heap_get_thread_arena_id(struct palloc_heap *heap)
+{
+       unsigned arena_id = 1;
+       struct arena *arenap = heap_thread_arena(heap);
+       struct arena *arenav;
+       struct heap_rt *rt = heap->rt;
+
+       util_mutex_lock(&rt->arenas.lock);
+       VEC_FOREACH(arenav, &heap->rt->arenas.vec) {
+               if (arenav == arenap) {
+                       util_mutex_unlock(&rt->arenas.lock);
+                       return arena_id;
+               }
+               arena_id++;
+       }
+
+       util_mutex_unlock(&rt->arenas.lock);
+       ASSERT(0);
+       return arena_id;
+}
+
+/*
+ * heap_bucket_acquire -- fetches by arena or by id a bucket exclusive
+ * for the thread until heap_bucket_release is called
+ */
+struct bucket *
+heap_bucket_acquire(struct palloc_heap *heap, uint8_t class_id,
+               uint16_t arena_id)
+{
+       struct heap_rt *rt = heap->rt;
+       struct bucket *b;
+
+       if (class_id == DEFAULT_ALLOC_CLASS_ID) {
+               b = rt->default_bucket;
+               goto out;
+       }
+
+       if (arena_id == HEAP_ARENA_PER_THREAD) {
+               struct arena *arena = heap_thread_arena(heap);
+               ASSERTne(arena->buckets, NULL);
+               b = arena->buckets[class_id];
+       } else {
+               b = (VEC_ARR(&heap->rt->arenas.vec)
+                       [arena_id - 1])->buckets[class_id];
+       }
+
+out:
+       util_mutex_lock(&b->lock);
+
+       return b;
+}
+
+/*
+ * heap_bucket_release -- puts the bucket back into the heap
+ */
+void
+heap_bucket_release(struct palloc_heap *heap, struct bucket *b)
+{
+       util_mutex_unlock(&b->lock);
+}
+
+/*
+ * heap_get_run_lock -- returns the lock associated with memory block
+ */
+os_mutex_t *
+heap_get_run_lock(struct palloc_heap *heap, uint32_t chunk_id)
+{
+       return &heap->rt->run_locks[chunk_id % heap->rt->nlocks];
+}
+
+/*
+ * heap_max_zone -- (internal) calculates how many zones can the heap fit
+ */
+static unsigned
+heap_max_zone(size_t size)
+{
+       unsigned max_zone = 0;
+       size -= sizeof(struct heap_header);
+
+       while (size >= ZONE_MIN_SIZE) {
+               max_zone++;
+               size -= size <= ZONE_MAX_SIZE ? size : ZONE_MAX_SIZE;
+       }
+
+       return max_zone;
+}
+
+/*
+ * zone_calc_size_idx -- (internal) calculates zone size index
+ */
+static uint32_t
+zone_calc_size_idx(uint32_t zone_id, unsigned max_zone, size_t heap_size)
+{
+       ASSERT(max_zone > 0);
+       if (zone_id < max_zone - 1)
+               return MAX_CHUNK;
+
+       ASSERT(heap_size >= zone_id * ZONE_MAX_SIZE);
+       size_t zone_raw_size = heap_size - zone_id * ZONE_MAX_SIZE;
+
+       ASSERT(zone_raw_size >= (sizeof(struct zone_header) +
+                       sizeof(struct chunk_header) * MAX_CHUNK) +
+                       sizeof(struct heap_header));
+       zone_raw_size -= sizeof(struct zone_header) +
+               sizeof(struct chunk_header) * MAX_CHUNK +
+               sizeof(struct heap_header);
+
+       size_t zone_size_idx = zone_raw_size / CHUNKSIZE;
+       ASSERT(zone_size_idx <= UINT32_MAX);
+
+       return (uint32_t)zone_size_idx;
+}
+
+/*
+ * heap_zone_init -- (internal) writes zone's first chunk and header
+ */
+static void
+heap_zone_init(struct palloc_heap *heap, uint32_t zone_id,
+       uint32_t first_chunk_id)
+{
+       struct zone *z = ZID_TO_ZONE(heap->layout, zone_id);
+       uint32_t size_idx = zone_calc_size_idx(zone_id, heap->rt->nzones,
+                       *heap->sizep);
+
+       ASSERT(size_idx > first_chunk_id);
+       memblock_huge_init(heap, first_chunk_id, zone_id,
+               size_idx - first_chunk_id);
+
+       struct zone_header nhdr = {
+               .size_idx = size_idx,
+               .magic = ZONE_HEADER_MAGIC,
+       };
+       z->header = nhdr; /* write the entire header (8 bytes) at once */
+       pmemops_persist(&heap->p_ops, &z->header, sizeof(z->header));
+}
+
+/*
+ * heap_memblock_insert_block -- (internal) bucket insert wrapper for callbacks
+ */
+static int
+heap_memblock_insert_block(const struct memory_block *m, void *b)
+{
+       return bucket_insert_block(b, m);
+}
+
+/*
+ * heap_run_create -- (internal) initializes a new run on an existing free chunk
+ */
+static int
+heap_run_create(struct palloc_heap *heap, struct bucket *b,
+       struct memory_block *m)
+{
+       *m = memblock_run_init(heap, m->chunk_id, m->zone_id, &b->aclass->rdsc);
+
+       if (m->m_ops->iterate_free(m, heap_memblock_insert_block, b) != 0) {
+               b->c_ops->rm_all(b->container);
+               return -1;
+       }
+
+       STATS_INC(heap->stats, transient, heap_run_active,
+               m->size_idx * CHUNKSIZE);
+
+       return 0;
+}
+
+/*
+ * heap_run_reuse -- (internal) reuses existing run
+ */
+static int
+heap_run_reuse(struct palloc_heap *heap, struct bucket *b,
+       const struct memory_block *m)
+{
+       int ret = 0;
+
+       ASSERTeq(m->type, MEMORY_BLOCK_RUN);
+       os_mutex_t *lock = m->m_ops->get_lock(m);
+
+       util_mutex_lock(lock);
+
+       ret = m->m_ops->iterate_free(m, heap_memblock_insert_block, b);
+
+       util_mutex_unlock(lock);
+
+       if (ret == 0) {
+               b->active_memory_block->m = *m;
+               b->active_memory_block->bucket = b;
+               b->is_active = 1;
+               util_fetch_and_add64(&b->active_memory_block->nresv, 1);
+       } else {
+               b->c_ops->rm_all(b->container);
+       }
+
+       return ret;
+}
+
+/*
+ * heap_free_chunk_reuse -- reuses existing free chunk
+ */
+int
+heap_free_chunk_reuse(struct palloc_heap *heap,
+       struct bucket *bucket,
+       struct memory_block *m)
+{
+       /*
+        * Perform coalescing just in case there
+        * are any neighboring free chunks.
+        */
+       struct memory_block nm = heap_coalesce_huge(heap, bucket, m);
+       if (nm.size_idx != m->size_idx) {
+               m->m_ops->prep_hdr(&nm, MEMBLOCK_FREE, NULL);
+       }
+
+       *m = nm;
+
+       return bucket_insert_block(bucket, m);
+}
+
+/*
+ * heap_run_into_free_chunk -- (internal) creates a new free chunk in place of
+ *     a run.
+ */
+static void
+heap_run_into_free_chunk(struct palloc_heap *heap,
+       struct bucket *bucket,
+       struct memory_block *m)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(heap, m);
+
+       m->block_off = 0;
+       m->size_idx = hdr->size_idx;
+
+       STATS_SUB(heap->stats, transient, heap_run_active,
+               m->size_idx * CHUNKSIZE);
+
+       /*
+        * The only thing this could race with is heap_memblock_on_free()
+        * because that function is called after processing the operation,
+        * which means that a different thread might immediately call this
+        * function if the free() made the run empty.
+        * We could forgo this lock if it weren't for helgrind which needs it
+        * to establish happens-before relation for the chunk metadata.
+        */
+       os_mutex_t *lock = m->m_ops->get_lock(m);
+       util_mutex_lock(lock);
+
+       *m = memblock_huge_init(heap, m->chunk_id, m->zone_id, m->size_idx);
+
+       heap_free_chunk_reuse(heap, bucket, m);
+
+       util_mutex_unlock(lock);
+}
+
+/*
+ * heap_reclaim_run -- checks the run for available memory if unclaimed.
+ *
+ * Returns 1 if reclaimed chunk, 0 otherwise.
+ */
+static int
+heap_reclaim_run(struct palloc_heap *heap, struct memory_block *m, int startup)
+{
+       struct chunk_run *run = heap_get_chunk_run(heap, m);
+       struct chunk_header *hdr = heap_get_chunk_hdr(heap, m);
+
+       struct alloc_class *c = alloc_class_by_run(
+               heap->rt->alloc_classes,
+               run->hdr.block_size, hdr->flags, m->size_idx);
+
+       struct recycler_element e = recycler_element_new(heap, m);
+       if (c == NULL) {
+               uint32_t size_idx = m->size_idx;
+               struct run_bitmap b;
+               m->m_ops->get_bitmap(m, &b);
+
+               ASSERTeq(size_idx, m->size_idx);
+
+               return e.free_space == b.nbits;
+       }
+
+       if (e.free_space == c->rdsc.nallocs)
+               return 1;
+
+       if (startup) {
+               STATS_INC(heap->stats, transient, heap_run_active,
+                       m->size_idx * CHUNKSIZE);
+               STATS_INC(heap->stats, transient, heap_run_allocated,
+                       (c->rdsc.nallocs - e.free_space) * run->hdr.block_size);
+       }
+
+       if (recycler_put(heap->rt->recyclers[c->id], m, e) < 0)
+               ERR("lost runtime tracking info of %u run due to OOM", c->id);
+
+       return 0;
+}
+
+/*
+ * heap_reclaim_zone_garbage -- (internal) creates volatile state of unused runs
+ */
+static void
+heap_reclaim_zone_garbage(struct palloc_heap *heap, struct bucket *bucket,
+       uint32_t zone_id)
+{
+       struct zone *z = ZID_TO_ZONE(heap->layout, zone_id);
+
+       for (uint32_t i = 0; i < z->header.size_idx; ) {
+               struct chunk_header *hdr = &z->chunk_headers[i];
+               ASSERT(hdr->size_idx != 0);
+
+               struct memory_block m = MEMORY_BLOCK_NONE;
+               m.zone_id = zone_id;
+               m.chunk_id = i;
+               m.size_idx = hdr->size_idx;
+
+               memblock_rebuild_state(heap, &m);
+               m.m_ops->reinit_chunk(&m);
+
+               switch (hdr->type) {
+                       case CHUNK_TYPE_RUN:
+                               if (heap_reclaim_run(heap, &m, 1) != 0)
+                                       heap_run_into_free_chunk(heap, bucket,
+                                               &m);
+                               break;
+                       case CHUNK_TYPE_FREE:
+                               heap_free_chunk_reuse(heap, bucket, &m);
+                               break;
+                       case CHUNK_TYPE_USED:
+                               break;
+                       default:
+                               ASSERT(0);
+               }
+
+               i = m.chunk_id + m.size_idx; /* hdr might have changed */
+       }
+}
+
+/*
+ * heap_populate_bucket -- (internal) creates volatile state of memory blocks
+ */
+static int
+heap_populate_bucket(struct palloc_heap *heap, struct bucket *bucket)
+{
+       struct heap_rt *h = heap->rt;
+
+       /* at this point we are sure that there's no more memory in the heap */
+       if (h->zones_exhausted == h->nzones)
+               return ENOMEM;
+
+       uint32_t zone_id = h->zones_exhausted++;
+       struct zone *z = ZID_TO_ZONE(heap->layout, zone_id);
+
+       /* ignore zone and chunk headers */
+       VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(z, sizeof(z->header) +
+               sizeof(z->chunk_headers));
+
+       if (z->header.magic != ZONE_HEADER_MAGIC)
+               heap_zone_init(heap, zone_id, 0);
+
+       heap_reclaim_zone_garbage(heap, bucket, zone_id);
+
+       /*
+        * It doesn't matter that this function might not have found any
+        * free blocks because there is still potential that subsequent calls
+        * will find something in later zones.
+        */
+       return 0;
+}
+
+/*
+ * heap_recycle_unused -- recalculate scores in the recycler and turn any
+ *     empty runs into free chunks
+ *
+ * If force is not set, this function might effectively be a noop if not enough
+ * of space was freed.
+ */
+static int
+heap_recycle_unused(struct palloc_heap *heap, struct recycler *recycler,
+       struct bucket *defb, int force)
+{
+       struct empty_runs r = recycler_recalc(recycler, force);
+       if (VEC_SIZE(&r) == 0)
+               return ENOMEM;
+
+       struct bucket *nb = defb == NULL ? heap_bucket_acquire(heap,
+               DEFAULT_ALLOC_CLASS_ID, HEAP_ARENA_PER_THREAD) : NULL;
+
+       ASSERT(defb != NULL || nb != NULL);
+
+       struct memory_block *nm;
+       VEC_FOREACH_BY_PTR(nm, &r) {
+               heap_run_into_free_chunk(heap, defb ? defb : nb, nm);
+       }
+
+       if (nb != NULL)
+               heap_bucket_release(heap, nb);
+
+       VEC_DELETE(&r);
+
+       return 0;
+}
+
+/*
+ * heap_reclaim_garbage -- (internal) creates volatile state of unused runs
+ */
+static int
+heap_reclaim_garbage(struct palloc_heap *heap, struct bucket *bucket)
+{
+       int ret = ENOMEM;
+       struct recycler *r;
+       for (size_t i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               if ((r = heap->rt->recyclers[i]) == NULL)
+                       continue;
+
+               if (heap_recycle_unused(heap, r, bucket, 1) == 0)
+                       ret = 0;
+       }
+
+       return ret;
+}
+
+/*
+ * heap_ensure_huge_bucket_filled --
+ *     (internal) refills the default bucket if needed
+ */
+static int
+heap_ensure_huge_bucket_filled(struct palloc_heap *heap, struct bucket *bucket)
+{
+       if (heap_reclaim_garbage(heap, bucket) == 0)
+               return 0;
+
+       if (heap_populate_bucket(heap, bucket) == 0)
+               return 0;
+
+       int extend;
+       if ((extend = heap_extend(heap, bucket, heap->growsize)) < 0)
+               return ENOMEM;
+
+       if (extend == 1)
+               return 0;
+
+       /*
+        * Extending the pool does not automatically add the chunks into the
+        * runtime state of the bucket - we need to traverse the new zone if
+        * it was created.
+        */
+       if (heap_populate_bucket(heap, bucket) == 0)
+               return 0;
+
+       return ENOMEM;
+}
+
+/*
+ * heap_bucket_deref_active -- detaches active blocks from the bucket
+ */
+static int
+heap_bucket_deref_active(struct palloc_heap *heap, struct bucket *b)
+{
+       /* get rid of the active block in the bucket */
+       struct memory_block_reserved **active = &b->active_memory_block;
+
+       if (b->is_active) {
+               b->c_ops->rm_all(b->container);
+               if (util_fetch_and_sub64(&(*active)->nresv, 1) == 1) {
+                       VALGRIND_ANNOTATE_HAPPENS_AFTER(&(*active)->nresv);
+                       heap_discard_run(heap, &(*active)->m);
+               } else {
+                       VALGRIND_ANNOTATE_HAPPENS_BEFORE(&(*active)->nresv);
+                       *active = NULL;
+               }
+               b->is_active = 0;
+       }
+
+       if (*active == NULL) {
+               *active = Zalloc(sizeof(struct memory_block_reserved));
+               if (*active == NULL)
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_force_recycle -- detaches all memory from arenas, and forces global
+ *     recycling of all memory blocks
+ */
+void
+heap_force_recycle(struct palloc_heap *heap)
+{
+       util_mutex_lock(&heap->rt->arenas.lock);
+       struct arena *arenap;
+       VEC_FOREACH(arenap, &heap->rt->arenas.vec) {
+               for (int i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+                       struct bucket *b = arenap->buckets[i];
+                       if (b == NULL)
+                               continue;
+                       util_mutex_lock(&b->lock);
+                       /*
+                        * There's no need to check if this fails, as that
+                        * will not prevent progress in this function.
+                        */
+                       heap_bucket_deref_active(heap, b);
+                       util_mutex_unlock(&b->lock);
+               }
+       }
+       util_mutex_unlock(&heap->rt->arenas.lock);
+       heap_reclaim_garbage(heap, NULL);
+}
+
+/*
+ * heap_reuse_from_recycler -- (internal) try reusing runs that are currently
+ *     in the recycler
+ */
+static int
+heap_reuse_from_recycler(struct palloc_heap *heap,
+       struct bucket *b, uint32_t units, int force)
+{
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.size_idx = units;
+
+       struct recycler *r = heap->rt->recyclers[b->aclass->id];
+       if (!force && recycler_get(r, &m) == 0)
+               return heap_run_reuse(heap, b, &m);
+
+       heap_recycle_unused(heap, r, NULL, force);
+
+       if (recycler_get(r, &m) == 0)
+               return heap_run_reuse(heap, b, &m);
+
+       return ENOMEM;
+}
+
+/*
+ * heap_discard_run -- puts the memory block back into the global heap.
+ */
+void
+heap_discard_run(struct palloc_heap *heap, struct memory_block *m)
+{
+       if (heap_reclaim_run(heap, m, 0)) {
+               struct bucket *defb =
+                       heap_bucket_acquire(heap,
+                       DEFAULT_ALLOC_CLASS_ID, 0);
+
+               heap_run_into_free_chunk(heap, defb, m);
+
+               heap_bucket_release(heap, defb);
+       }
+}
+
+/*
+ * heap_ensure_run_bucket_filled -- (internal) refills the bucket if needed
+ */
+static int
+heap_ensure_run_bucket_filled(struct palloc_heap *heap, struct bucket *b,
+       uint32_t units)
+{
+       ASSERTeq(b->aclass->type, CLASS_RUN);
+       int ret = 0;
+
+       if (heap_bucket_deref_active(heap, b) != 0)
+               return ENOMEM;
+
+       if (heap_reuse_from_recycler(heap, b, units, 0) == 0)
+               goto out;
+
+       /* search in the next zone before attempting to create a new run */
+       struct bucket *defb = heap_bucket_acquire(heap,
+               DEFAULT_ALLOC_CLASS_ID,
+               HEAP_ARENA_PER_THREAD);
+       heap_populate_bucket(heap, defb);
+       heap_bucket_release(heap, defb);
+
+       if (heap_reuse_from_recycler(heap, b, units, 0) == 0)
+               goto out;
+
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.size_idx = b->aclass->rdsc.size_idx;
+
+       defb = heap_bucket_acquire(heap,
+               DEFAULT_ALLOC_CLASS_ID,
+               HEAP_ARENA_PER_THREAD);
+       /* cannot reuse an existing run, create a new one */
+       if (heap_get_bestfit_block(heap, defb, &m) == 0) {
+               ASSERTeq(m.block_off, 0);
+               if (heap_run_create(heap, b, &m) != 0) {
+                       heap_bucket_release(heap, defb);
+                       return ENOMEM;
+               }
+
+               b->active_memory_block->m = m;
+               b->is_active = 1;
+               b->active_memory_block->bucket = b;
+               util_fetch_and_add64(&b->active_memory_block->nresv, 1);
+
+               heap_bucket_release(heap, defb);
+
+               goto out;
+       }
+       heap_bucket_release(heap, defb);
+
+       if (heap_reuse_from_recycler(heap, b, units, 0) == 0)
+               goto out;
+
+       ret = ENOMEM;
+out:
+
+       return ret;
+}
+
+/*
+ * heap_memblock_on_free -- bookkeeping actions executed at every free of a
+ *     block
+ */
+void
+heap_memblock_on_free(struct palloc_heap *heap, const struct memory_block *m)
+{
+       if (m->type != MEMORY_BLOCK_RUN)
+               return;
+
+       struct chunk_header *hdr = heap_get_chunk_hdr(heap, m);
+       struct chunk_run *run = heap_get_chunk_run(heap, m);
+
+       ASSERTeq(hdr->type, CHUNK_TYPE_RUN);
+
+       struct alloc_class *c = alloc_class_by_run(
+               heap->rt->alloc_classes,
+               run->hdr.block_size, hdr->flags, hdr->size_idx);
+
+       if (c == NULL)
+               return;
+
+       recycler_inc_unaccounted(heap->rt->recyclers[c->id], m);
+}
+
+/*
+ * heap_split_block -- (internal) splits unused part of the memory block
+ */
+static void
+heap_split_block(struct palloc_heap *heap, struct bucket *b,
+               struct memory_block *m, uint32_t units)
+{
+       ASSERT(units <= UINT16_MAX);
+       ASSERT(units > 0);
+
+       if (b->aclass->type == CLASS_RUN) {
+               ASSERT((uint64_t)m->block_off + (uint64_t)units <= UINT32_MAX);
+               struct memory_block r = {m->chunk_id, m->zone_id,
+                       m->size_idx - units, (uint32_t)(m->block_off + units),
+                       NULL, NULL, 0, 0, NULL};
+               memblock_rebuild_state(heap, &r);
+               if (bucket_insert_block(b, &r) != 0)
+                       LOG(2,
+                               "failed to allocate memory block runtime tracking info");
+       } else {
+               uint32_t new_chunk_id = m->chunk_id + units;
+               uint32_t new_size_idx = m->size_idx - units;
+
+               struct memory_block n = memblock_huge_init(heap,
+                       new_chunk_id, m->zone_id, new_size_idx);
+
+               *m = memblock_huge_init(heap, m->chunk_id, m->zone_id, units);
+
+               if (bucket_insert_block(b, &n) != 0)
+                       LOG(2,
+                               "failed to allocate memory block runtime tracking info");
+       }
+
+       m->size_idx = units;
+}
+
+/*
+ * heap_get_bestfit_block --
+ *     extracts a memory block of equal size index
+ */
+int
+heap_get_bestfit_block(struct palloc_heap *heap, struct bucket *b,
+       struct memory_block *m)
+{
+       uint32_t units = m->size_idx;
+
+       while (b->c_ops->get_rm_bestfit(b->container, m) != 0) {
+               if (b->aclass->type == CLASS_HUGE) {
+                       if (heap_ensure_huge_bucket_filled(heap, b) != 0)
+                               return ENOMEM;
+               } else {
+                       if (heap_ensure_run_bucket_filled(heap, b, units) != 0)
+                               return ENOMEM;
+               }
+       }
+
+       ASSERT(m->size_idx >= units);
+
+       if (units != m->size_idx)
+               heap_split_block(heap, b, m, units);
+
+       m->m_ops->ensure_header_type(m, b->aclass->header_type);
+       m->header_type = b->aclass->header_type;
+
+       return 0;
+}
+
+/*
+ * heap_get_adjacent_free_block -- locates adjacent free memory block in heap
+ */
+static int
+heap_get_adjacent_free_block(struct palloc_heap *heap,
+       const struct memory_block *in, struct memory_block *out, int prev)
+{
+       struct zone *z = ZID_TO_ZONE(heap->layout, in->zone_id);
+       struct chunk_header *hdr = &z->chunk_headers[in->chunk_id];
+       out->zone_id = in->zone_id;
+
+       if (prev) {
+               if (in->chunk_id == 0)
+                       return ENOENT;
+
+               struct chunk_header *prev_hdr =
+                       &z->chunk_headers[in->chunk_id - 1];
+               out->chunk_id = in->chunk_id - prev_hdr->size_idx;
+
+               if (z->chunk_headers[out->chunk_id].type != CHUNK_TYPE_FREE)
+                       return ENOENT;
+
+               out->size_idx = z->chunk_headers[out->chunk_id].size_idx;
+       } else { /* next */
+               if (in->chunk_id + hdr->size_idx == z->header.size_idx)
+                       return ENOENT;
+
+               out->chunk_id = in->chunk_id + hdr->size_idx;
+
+               if (z->chunk_headers[out->chunk_id].type != CHUNK_TYPE_FREE)
+                       return ENOENT;
+
+               out->size_idx = z->chunk_headers[out->chunk_id].size_idx;
+       }
+       memblock_rebuild_state(heap, out);
+
+       return 0;
+}
+
+/*
+ * heap_coalesce -- (internal) merges adjacent memory blocks
+ */
+static struct memory_block
+heap_coalesce(struct palloc_heap *heap,
+       const struct memory_block *blocks[], int n)
+{
+       struct memory_block ret = MEMORY_BLOCK_NONE;
+
+       const struct memory_block *b = NULL;
+       ret.size_idx = 0;
+       for (int i = 0; i < n; ++i) {
+               if (blocks[i] == NULL)
+                       continue;
+               b = b ? b : blocks[i];
+               ret.size_idx += blocks[i]->size_idx;
+       }
+
+       ASSERTne(b, NULL);
+
+       ret.chunk_id = b->chunk_id;
+       ret.zone_id = b->zone_id;
+       ret.block_off = b->block_off;
+       memblock_rebuild_state(heap, &ret);
+
+       return ret;
+}
+
+/*
+ * heap_coalesce_huge -- finds neighbours of a huge block, removes them from the
+ *     volatile state and returns the resulting block
+ */
+struct memory_block
+heap_coalesce_huge(struct palloc_heap *heap, struct bucket *b,
+       const struct memory_block *m)
+{
+       const struct memory_block *blocks[3] = {NULL, m, NULL};
+
+       struct memory_block prev = MEMORY_BLOCK_NONE;
+       if (heap_get_adjacent_free_block(heap, m, &prev, 1) == 0 &&
+               b->c_ops->get_rm_exact(b->container, &prev) == 0) {
+               blocks[0] = &prev;
+       }
+
+       struct memory_block next = MEMORY_BLOCK_NONE;
+       if (heap_get_adjacent_free_block(heap, m, &next, 0) == 0 &&
+               b->c_ops->get_rm_exact(b->container, &next) == 0) {
+               blocks[2] = &next;
+       }
+
+       return heap_coalesce(heap, blocks, 3);
+}
+
+/*
+ * heap_end -- returns first address after heap
+ */
+void *
+heap_end(struct palloc_heap *h)
+{
+       ASSERT(h->rt->nzones > 0);
+
+       struct zone *last_zone = ZID_TO_ZONE(h->layout, h->rt->nzones - 1);
+
+       return &last_zone->chunks[last_zone->header.size_idx];
+}
+
+/*
+ * heap_arena_create -- create a new arena, push it to the vector
+ * and return new arena id or -1 on failure
+ */
+int
+heap_arena_create(struct palloc_heap *heap)
+{
+       struct heap_rt *h = heap->rt;
+
+       struct arena *arena = heap_arena_new(heap, 0);
+       if (arena == NULL)
+               return -1;
+
+       util_mutex_lock(&h->arenas.lock);
+
+       if (VEC_PUSH_BACK(&h->arenas.vec, arena))
+               goto err_push_back;
+
+       int ret = (int)VEC_SIZE(&h->arenas.vec);
+       util_mutex_unlock(&h->arenas.lock);
+
+       return ret;
+
+err_push_back:
+       util_mutex_unlock(&h->arenas.lock);
+       heap_arena_delete(arena);
+       return -1;
+}
+
+/*
+ * heap_get_narenas_total -- returns the number of all arenas in the heap
+ */
+unsigned
+heap_get_narenas_total(struct palloc_heap *heap)
+{
+       struct heap_rt *h = heap->rt;
+
+       util_mutex_lock(&h->arenas.lock);
+       unsigned total = (unsigned)VEC_SIZE(&h->arenas.vec);
+       util_mutex_unlock(&h->arenas.lock);
+
+       return total;
+}
+
+/*
+ * heap_get_narenas_max -- returns the max number of arenas
+ */
+unsigned
+heap_get_narenas_max(struct palloc_heap *heap)
+{
+       struct heap_rt *h = heap->rt;
+
+       util_mutex_lock(&h->arenas.lock);
+       unsigned max = (unsigned)VEC_CAPACITY(&h->arenas.vec);
+       util_mutex_unlock(&h->arenas.lock);
+
+       return max;
+}
+
+/*
+ * heap_set_narenas_max -- change the max number of arenas
+ */
+int
+heap_set_narenas_max(struct palloc_heap *heap, unsigned size)
+{
+       struct heap_rt *h = heap->rt;
+       int ret = -1;
+
+       util_mutex_lock(&h->arenas.lock);
+       unsigned capacity = (unsigned)VEC_CAPACITY(&h->arenas.vec);
+       if (size < capacity) {
+               LOG(2, "cannot decrease max number of arenas");
+               goto out;
+       } else if (size == capacity) {
+               ret = 0;
+               goto out;
+       }
+
+       ret = VEC_RESERVE(&h->arenas.vec, size);
+
+out:
+       util_mutex_unlock(&h->arenas.lock);
+       return ret;
+}
+
+/*
+ * heap_get_narenas_auto -- returns the number of all automatic arenas
+ */
+unsigned
+heap_get_narenas_auto(struct palloc_heap *heap)
+{
+       struct heap_rt *h = heap->rt;
+       struct arena *arena;
+       unsigned narenas = 0;
+
+       util_mutex_lock(&h->arenas.lock);
+
+       VEC_FOREACH(arena, &h->arenas.vec) {
+               if (arena->automatic)
+                       narenas++;
+       }
+
+       util_mutex_unlock(&h->arenas.lock);
+
+       return narenas;
+}
+
+/*
+ * heap_get_arena_buckets -- returns a pointer to buckets from the arena
+ */
+struct bucket **
+heap_get_arena_buckets(struct palloc_heap *heap, unsigned arena_id)
+{
+       util_mutex_lock(&heap->rt->arenas.lock);
+       struct arena *a = heap_get_arena_by_id(heap, arena_id);
+       util_mutex_unlock(&heap->rt->arenas.lock);
+
+       return a->buckets;
+}
+
+/*
+ * heap_get_arena_auto -- returns arena automatic value
+ */
+int
+heap_get_arena_auto(struct palloc_heap *heap, unsigned arena_id)
+{
+       util_mutex_lock(&heap->rt->arenas.lock);
+       struct arena *a = heap_get_arena_by_id(heap, arena_id);
+       util_mutex_unlock(&heap->rt->arenas.lock);
+
+       return a->automatic;
+}
+
+/*
+ * heap_set_arena_auto -- sets arena automatic value
+ */
+int
+heap_set_arena_auto(struct palloc_heap *heap, unsigned arena_id,
+               int automatic)
+{
+       unsigned nautomatic = 0;
+       struct arena *a;
+       struct heap_rt *h = heap->rt;
+       int ret = 0;
+
+       util_mutex_lock(&h->arenas.lock);
+       VEC_FOREACH(a, &h->arenas.vec)
+               if (a->automatic)
+                       nautomatic++;
+
+       a = VEC_ARR(&heap->rt->arenas.vec)[arena_id - 1];
+
+       if (!automatic && nautomatic <= 1 && a->automatic) {
+               ERR("at least one automatic arena must exist");
+               ret = -1;
+               goto out;
+       }
+       a->automatic = automatic;
+
+out:
+       util_mutex_unlock(&h->arenas.lock);
+       return ret;
+
+}
+
+/*
+ * heap_set_arena_thread -- assign arena with given id to the current thread
+ */
+void
+heap_set_arena_thread(struct palloc_heap *heap, unsigned arena_id)
+{
+       os_mutex_lock(&heap->rt->arenas.lock);
+       heap_arena_thread_attach(heap, heap_get_arena_by_id(heap, arena_id));
+       os_mutex_unlock(&heap->rt->arenas.lock);
+}
+
+/*
+ * heap_get_procs -- (internal) returns the number of arenas to create
+ */
+static unsigned
+heap_get_procs(void)
+{
+       long cpus = sysconf(_SC_NPROCESSORS_ONLN);
+       if (cpus < 1)
+               cpus = 1;
+
+       unsigned arenas = (unsigned)cpus;
+
+       LOG(4, "creating %u arenas", arenas);
+
+       return arenas;
+}
+
+/*
+ * heap_create_alloc_class_buckets -- allocates all cache bucket
+ * instances of the specified type
+ */
+int
+heap_create_alloc_class_buckets(struct palloc_heap *heap, struct alloc_class *c)
+{
+       struct heap_rt *h = heap->rt;
+
+       if (c->type == CLASS_RUN) {
+               h->recyclers[c->id] = recycler_new(heap, c->rdsc.nallocs,
+                       &heap->rt->arenas.nactive);
+               if (h->recyclers[c->id] == NULL)
+                       goto error_recycler_new;
+       }
+
+       size_t i;
+       struct arena *arena;
+       VEC_FOREACH_BY_POS(i, &h->arenas.vec) {
+               arena = VEC_ARR(&h->arenas.vec)[i];
+               if (arena->buckets[c->id] == NULL)
+                       arena->buckets[c->id] = bucket_new(
+                               container_new_seglists(heap), c);
+               if (arena->buckets[c->id] == NULL)
+                       goto error_cache_bucket_new;
+       }
+
+       return 0;
+
+error_cache_bucket_new:
+       recycler_delete(h->recyclers[c->id]);
+
+       for (; i != 0; --i)
+               bucket_delete(VEC_ARR(&h->arenas.vec)[i - 1]->buckets[c->id]);
+
+error_recycler_new:
+       return -1;
+}
+
+/*
+ * heap_buckets_init -- (internal) initializes bucket instances
+ */
+int
+heap_buckets_init(struct palloc_heap *heap)
+{
+       struct heap_rt *h = heap->rt;
+
+       for (uint8_t i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               struct alloc_class *c = alloc_class_by_id(h->alloc_classes, i);
+               if (c != NULL) {
+                       if (heap_create_alloc_class_buckets(heap, c) != 0)
+                               goto error_bucket_create;
+               }
+       }
+
+       h->default_bucket = bucket_new(container_new_ravl(heap),
+               alloc_class_by_id(h->alloc_classes, DEFAULT_ALLOC_CLASS_ID));
+
+       if (h->default_bucket == NULL)
+               goto error_bucket_create;
+
+       return 0;
+
+error_bucket_create: {
+               struct arena *arena;
+               VEC_FOREACH(arena, &h->arenas.vec)
+                       heap_arena_delete(arena);
+       }
+       return -1;
+}
+
+/*
+ * heap_extend -- extend the heap by the given size
+ *
+ * Returns 0 if the current zone has been extended, 1 if a new zone had to be
+ *     created, -1 if unsuccessful.
+ *
+ * If this function has to create a new zone, it will NOT populate buckets with
+ * the new chunks.
+ */
+int
+heap_extend(struct palloc_heap *heap, struct bucket *b, size_t size)
+{
+       void *nptr = util_pool_extend(heap->set, &size, PMEMOBJ_MIN_PART);
+       if (nptr == NULL)
+               return -1;
+
+       *heap->sizep += size;
+       pmemops_persist(&heap->p_ops, heap->sizep, sizeof(*heap->sizep));
+
+       /*
+        * If interrupted after changing the size, the heap will just grow
+        * automatically on the next heap_boot.
+        */
+
+       uint32_t nzones = heap_max_zone(*heap->sizep);
+       uint32_t zone_id = nzones - 1;
+       struct zone *z = ZID_TO_ZONE(heap->layout, zone_id);
+       uint32_t chunk_id = heap->rt->nzones == nzones ? z->header.size_idx : 0;
+       heap_zone_init(heap, zone_id, chunk_id);
+
+       if (heap->rt->nzones != nzones) {
+               heap->rt->nzones = nzones;
+               return 0;
+       }
+
+       struct chunk_header *hdr = &z->chunk_headers[chunk_id];
+
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.chunk_id = chunk_id;
+       m.zone_id = zone_id;
+       m.block_off = 0;
+       m.size_idx = hdr->size_idx;
+       memblock_rebuild_state(heap, &m);
+
+       heap_free_chunk_reuse(heap, b, &m);
+
+       return 1;
+}
+
+/*
+ * heap_zone_update_if_needed -- updates the zone metadata if the pool has been
+ *     extended.
+ */
+static void
+heap_zone_update_if_needed(struct palloc_heap *heap)
+{
+       struct zone *z;
+
+       for (uint32_t i = 0; i < heap->rt->nzones; ++i) {
+               z = ZID_TO_ZONE(heap->layout, i);
+               if (z->header.magic != ZONE_HEADER_MAGIC)
+                       continue;
+
+               size_t size_idx = zone_calc_size_idx(i, heap->rt->nzones,
+                       *heap->sizep);
+
+               if (size_idx == z->header.size_idx)
+                       continue;
+
+               heap_zone_init(heap, i, z->header.size_idx);
+       }
+}
+
+/*
+ * heap_boot -- opens the heap region of the pmemobj pool
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+heap_boot(struct palloc_heap *heap, void *heap_start, uint64_t heap_size,
+               uint64_t *sizep, void *base, struct pmem_ops *p_ops,
+               struct stats *stats, struct pool_set *set)
+{
+       /*
+        * The size can be 0 if interrupted during heap_init or this is the
+        * first time booting the heap with the persistent size field.
+        */
+       if (*sizep == 0) {
+               *sizep = heap_size;
+               pmemops_persist(p_ops, sizep, sizeof(*sizep));
+       }
+
+       if (heap_size < *sizep) {
+               ERR("mapped region smaller than the heap size");
+               return EINVAL;
+       }
+
+       struct heap_rt *h = Malloc(sizeof(*h));
+       int err;
+       if (h == NULL) {
+               err = ENOMEM;
+               goto error_heap_malloc;
+       }
+
+       h->alloc_classes = alloc_class_collection_new();
+       if (h->alloc_classes == NULL) {
+               err = ENOMEM;
+               goto error_alloc_classes_new;
+       }
+
+       unsigned narenas_default = heap_get_procs();
+
+       if (heap_arenas_init(&h->arenas) != 0) {
+               err = errno;
+               goto error_arenas_malloc;
+       }
+
+       h->nzones = heap_max_zone(heap_size);
+
+       h->zones_exhausted = 0;
+
+       h->nlocks = On_valgrind ? MAX_RUN_LOCKS_VG : MAX_RUN_LOCKS;
+       for (unsigned i = 0; i < h->nlocks; ++i)
+               util_mutex_init(&h->run_locks[i]);
+
+       os_tls_key_create(&h->arenas.thread, heap_thread_arena_destructor);
+
+       heap->p_ops = *p_ops;
+       heap->layout = heap_start;
+       heap->rt = h;
+       heap->sizep = sizep;
+       heap->base = base;
+       heap->stats = stats;
+       heap->set = set;
+       heap->growsize = HEAP_DEFAULT_GROW_SIZE;
+       heap->alloc_pattern = PALLOC_CTL_DEBUG_NO_PATTERN;
+       VALGRIND_DO_CREATE_MEMPOOL(heap->layout, 0, 0);
+
+       for (unsigned i = 0; i < narenas_default; ++i) {
+               if (VEC_PUSH_BACK(&h->arenas.vec, heap_arena_new(heap, 1))) {
+                       err = errno;
+                       goto error_vec_reserve;
+               }
+       }
+
+       for (unsigned i = 0; i < MAX_ALLOCATION_CLASSES; ++i)
+               h->recyclers[i] = NULL;
+
+       heap_zone_update_if_needed(heap);
+
+       return 0;
+
+error_vec_reserve:
+       heap_arenas_fini(&h->arenas);
+error_arenas_malloc:
+       alloc_class_collection_delete(h->alloc_classes);
+error_alloc_classes_new:
+       Free(h);
+       heap->rt = NULL;
+error_heap_malloc:
+       return err;
+}
+
+/*
+ * heap_write_header -- (internal) creates a clean header
+ */
+static void
+heap_write_header(struct heap_header *hdr)
+{
+       struct heap_header newhdr = {
+               .signature = HEAP_SIGNATURE,
+               .major = HEAP_MAJOR,
+               .minor = HEAP_MINOR,
+               .unused = 0,
+               .chunksize = CHUNKSIZE,
+               .chunks_per_zone = MAX_CHUNK,
+               .reserved = {0},
+               .checksum = 0
+       };
+
+       util_checksum(&newhdr, sizeof(newhdr), &newhdr.checksum, 1, 0);
+       *hdr = newhdr;
+}
+
+/*
+ * heap_init -- initializes the heap
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+heap_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
+       struct pmem_ops *p_ops)
+{
+       if (heap_size < HEAP_MIN_SIZE)
+               return EINVAL;
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(heap_start, heap_size);
+
+       struct heap_layout *layout = heap_start;
+       heap_write_header(&layout->header);
+       pmemops_persist(p_ops, &layout->header, sizeof(struct heap_header));
+
+       unsigned zones = heap_max_zone(heap_size);
+       for (unsigned i = 0; i < zones; ++i) {
+               struct zone *zone = ZID_TO_ZONE(layout, i);
+               pmemops_memset(p_ops, &zone->header, 0,
+                               sizeof(struct zone_header), 0);
+               pmemops_memset(p_ops, &zone->chunk_headers, 0,
+                               sizeof(struct chunk_header), 0);
+
+               /* only explicitly allocated chunks should be accessible */
+               VALGRIND_DO_MAKE_MEM_NOACCESS(&zone->chunk_headers,
+                       sizeof(struct chunk_header));
+       }
+
+       *sizep = heap_size;
+       pmemops_persist(p_ops, sizep, sizeof(*sizep));
+
+       return 0;
+}
+
+/*
+ * heap_cleanup -- cleanups the volatile heap state
+ */
+void
+heap_cleanup(struct palloc_heap *heap)
+{
+       struct heap_rt *rt = heap->rt;
+
+       alloc_class_collection_delete(rt->alloc_classes);
+
+       os_tls_key_delete(rt->arenas.thread);
+       bucket_delete(rt->default_bucket);
+
+       struct arena *arena;
+       VEC_FOREACH(arena, &rt->arenas.vec)
+               heap_arena_delete(arena);
+
+       for (unsigned i = 0; i < rt->nlocks; ++i)
+               util_mutex_destroy(&rt->run_locks[i]);
+
+       heap_arenas_fini(&rt->arenas);
+
+       for (int i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               if (heap->rt->recyclers[i] == NULL)
+                       continue;
+
+               recycler_delete(rt->recyclers[i]);
+       }
+
+       VALGRIND_DO_DESTROY_MEMPOOL(heap->layout);
+
+       Free(rt);
+       heap->rt = NULL;
+}
+
+/*
+ * heap_verify_header -- (internal) verifies if the heap header is consistent
+ */
+static int
+heap_verify_header(struct heap_header *hdr)
+{
+       if (util_checksum(hdr, sizeof(*hdr), &hdr->checksum, 0, 0) != 1) {
+               ERR("heap: invalid header's checksum");
+               return -1;
+       }
+
+       if (memcmp(hdr->signature, HEAP_SIGNATURE, HEAP_SIGNATURE_LEN) != 0) {
+               ERR("heap: invalid signature");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_verify_zone_header --
+ *     (internal) verifies if the zone header is consistent
+ */
+static int
+heap_verify_zone_header(struct zone_header *hdr)
+{
+       if (hdr->magic != ZONE_HEADER_MAGIC) /* not initialized */
+               return 0;
+
+       if (hdr->size_idx == 0) {
+               ERR("heap: invalid zone size");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_verify_chunk_header --
+ *     (internal) verifies if the chunk header is consistent
+ */
+static int
+heap_verify_chunk_header(struct chunk_header *hdr)
+{
+       if (hdr->type == CHUNK_TYPE_UNKNOWN) {
+               ERR("heap: invalid chunk type");
+               return -1;
+       }
+
+       if (hdr->type >= MAX_CHUNK_TYPE) {
+               ERR("heap: unknown chunk type");
+               return -1;
+       }
+
+       if (hdr->flags & ~CHUNK_FLAGS_ALL_VALID) {
+               ERR("heap: invalid chunk flags");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_verify_zone -- (internal) verifies if the zone is consistent
+ */
+static int
+heap_verify_zone(struct zone *zone)
+{
+       if (zone->header.magic == 0)
+               return 0; /* not initialized, and that is OK */
+
+       if (zone->header.magic != ZONE_HEADER_MAGIC) {
+               ERR("heap: invalid zone magic");
+               return -1;
+       }
+
+       if (heap_verify_zone_header(&zone->header))
+               return -1;
+
+       uint32_t i;
+       for (i = 0; i < zone->header.size_idx; ) {
+               if (heap_verify_chunk_header(&zone->chunk_headers[i]))
+                       return -1;
+
+               i += zone->chunk_headers[i].size_idx;
+       }
+
+       if (i != zone->header.size_idx) {
+               ERR("heap: chunk sizes mismatch");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_check -- verifies if the heap is consistent and can be opened properly
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+heap_check(void *heap_start, uint64_t heap_size)
+{
+       if (heap_size < HEAP_MIN_SIZE) {
+               ERR("heap: invalid heap size");
+               return -1;
+       }
+
+       struct heap_layout *layout = heap_start;
+
+       if (heap_verify_header(&layout->header))
+               return -1;
+
+       for (unsigned i = 0; i < heap_max_zone(heap_size); ++i) {
+               if (heap_verify_zone(ZID_TO_ZONE(layout, i)))
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_check_remote -- verifies if the heap of a remote pool is consistent
+ *     and can be opened properly
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+heap_check_remote(void *heap_start, uint64_t heap_size, struct remote_ops *ops)
+{
+       if (heap_size < HEAP_MIN_SIZE) {
+               ERR("heap: invalid heap size");
+               return -1;
+       }
+
+       struct heap_layout *layout = heap_start;
+
+       struct heap_header header;
+       if (ops->read(ops->ctx, ops->base, &header, &layout->header,
+                                               sizeof(struct heap_header))) {
+               ERR("heap: obj_read_remote error");
+               return -1;
+       }
+
+       if (heap_verify_header(&header))
+               return -1;
+
+       struct zone *zone_buff = (struct zone *)Malloc(sizeof(struct zone));
+       if (zone_buff == NULL) {
+               ERR("heap: zone_buff malloc error");
+               return -1;
+       }
+       for (unsigned i = 0; i < heap_max_zone(heap_size); ++i) {
+               if (ops->read(ops->ctx, ops->base, zone_buff,
+                               ZID_TO_ZONE(layout, i), sizeof(struct zone))) {
+                       ERR("heap: obj_read_remote error");
+                       goto out;
+               }
+
+               if (heap_verify_zone(zone_buff)) {
+                       goto out;
+               }
+       }
+       Free(zone_buff);
+       return 0;
+
+out:
+       Free(zone_buff);
+       return -1;
+}
+
+/*
+ * heap_zone_foreach_object -- (internal) iterates through objects in a zone
+ */
+static int
+heap_zone_foreach_object(struct palloc_heap *heap, object_callback cb,
+       void *arg, struct memory_block *m)
+{
+       struct zone *zone = ZID_TO_ZONE(heap->layout, m->zone_id);
+       if (zone->header.magic == 0)
+               return 0;
+
+       for (; m->chunk_id < zone->header.size_idx; ) {
+               struct chunk_header *hdr = heap_get_chunk_hdr(heap, m);
+               memblock_rebuild_state(heap, m);
+               m->size_idx = hdr->size_idx;
+
+               if (m->m_ops->iterate_used(m, cb, arg) != 0)
+                       return 1;
+
+               m->chunk_id += m->size_idx;
+               m->block_off = 0;
+       }
+
+       return 0;
+}
+
+/*
+ * heap_foreach_object -- (internal) iterates through objects in the heap
+ */
+void
+heap_foreach_object(struct palloc_heap *heap, object_callback cb, void *arg,
+       struct memory_block m)
+{
+       for (; m.zone_id < heap->rt->nzones; ++m.zone_id) {
+               if (heap_zone_foreach_object(heap, cb, arg, &m) != 0)
+                       break;
+
+               m.chunk_id = 0;
+       }
+}
+
+#if VG_MEMCHECK_ENABLED
+
+/*
+ * heap_vg_open -- notifies Valgrind about heap layout
+ */
+void
+heap_vg_open(struct palloc_heap *heap, object_callback cb,
+       void *arg, int objects)
+{
+       ASSERTne(cb, NULL);
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(heap->layout, *heap->sizep);
+
+       struct heap_layout *layout = heap->layout;
+
+       VALGRIND_DO_MAKE_MEM_DEFINED(&layout->header, sizeof(layout->header));
+
+       unsigned zones = heap_max_zone(*heap->sizep);
+
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       for (unsigned i = 0; i < zones; ++i) {
+               struct zone *z = ZID_TO_ZONE(layout, i);
+               uint32_t chunks;
+               m.zone_id = i;
+               m.chunk_id = 0;
+
+               VALGRIND_DO_MAKE_MEM_DEFINED(&z->header, sizeof(z->header));
+
+               if (z->header.magic != ZONE_HEADER_MAGIC)
+                       continue;
+
+               chunks = z->header.size_idx;
+
+               for (uint32_t c = 0; c < chunks; ) {
+                       struct chunk_header *hdr = &z->chunk_headers[c];
+
+                       /* define the header before rebuilding state */
+                       VALGRIND_DO_MAKE_MEM_DEFINED(hdr, sizeof(*hdr));
+
+                       m.chunk_id = c;
+                       m.size_idx = hdr->size_idx;
+
+                       memblock_rebuild_state(heap, &m);
+
+                       m.m_ops->vg_init(&m, objects, cb, arg);
+                       m.block_off = 0;
+
+                       ASSERT(hdr->size_idx > 0);
+
+                       c += hdr->size_idx;
+               }
+
+               /* mark all unused chunk headers after last as not accessible */
+               VALGRIND_DO_MAKE_MEM_NOACCESS(&z->chunk_headers[chunks],
+                       (MAX_CHUNK - chunks) * sizeof(struct chunk_header));
+       }
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/heap.h b/ceph/src/pmdk/src/libpmemobj/heap.h
new file mode 100644 (file)
index 0000000..ae5d3b3
--- /dev/null
@@ -0,0 +1,132 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * heap.h -- internal definitions for heap
+ */
+
+#ifndef LIBPMEMOBJ_HEAP_H
+#define LIBPMEMOBJ_HEAP_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "bucket.h"
+#include "memblock.h"
+#include "memops.h"
+#include "palloc.h"
+#include "os_thread.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HEAP_OFF_TO_PTR(heap, off) ((void *)((char *)((heap)->base) + (off)))
+#define HEAP_PTR_TO_OFF(heap, ptr)\
+       ((uintptr_t)(ptr) - (uintptr_t)((heap)->base))
+
+#define BIT_IS_CLR(a, i)       (!((a) & (1ULL << (i))))
+#define HEAP_ARENA_PER_THREAD (0)
+
+int heap_boot(struct palloc_heap *heap, void *heap_start, uint64_t heap_size,
+               uint64_t *sizep,
+               void *base, struct pmem_ops *p_ops,
+               struct stats *stats, struct pool_set *set);
+int heap_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
+       struct pmem_ops *p_ops);
+void heap_cleanup(struct palloc_heap *heap);
+int heap_check(void *heap_start, uint64_t heap_size);
+int heap_check_remote(void *heap_start, uint64_t heap_size,
+               struct remote_ops *ops);
+int heap_buckets_init(struct palloc_heap *heap);
+int heap_create_alloc_class_buckets(struct palloc_heap *heap,
+       struct alloc_class *c);
+
+int heap_extend(struct palloc_heap *heap, struct bucket *defb, size_t size);
+
+struct alloc_class *
+heap_get_best_class(struct palloc_heap *heap, size_t size);
+
+struct bucket *
+heap_bucket_acquire(struct palloc_heap *heap, uint8_t class_id,
+               uint16_t arena_id);
+
+void
+heap_bucket_release(struct palloc_heap *heap, struct bucket *b);
+
+int heap_get_bestfit_block(struct palloc_heap *heap, struct bucket *b,
+       struct memory_block *m);
+struct memory_block
+heap_coalesce_huge(struct palloc_heap *heap, struct bucket *b,
+       const struct memory_block *m);
+os_mutex_t *heap_get_run_lock(struct palloc_heap *heap,
+               uint32_t chunk_id);
+
+void
+heap_force_recycle(struct palloc_heap *heap);
+
+void
+heap_discard_run(struct palloc_heap *heap, struct memory_block *m);
+
+void
+heap_memblock_on_free(struct palloc_heap *heap, const struct memory_block *m);
+
+int
+heap_free_chunk_reuse(struct palloc_heap *heap,
+       struct bucket *bucket, struct memory_block *m);
+
+void heap_foreach_object(struct palloc_heap *heap, object_callback cb,
+       void *arg, struct memory_block start);
+
+struct alloc_class_collection *heap_alloc_classes(struct palloc_heap *heap);
+
+void *heap_end(struct palloc_heap *heap);
+
+unsigned heap_get_narenas_total(struct palloc_heap *heap);
+
+unsigned heap_get_narenas_max(struct palloc_heap *heap);
+
+int heap_set_narenas_max(struct palloc_heap *heap, unsigned size);
+
+unsigned heap_get_narenas_auto(struct palloc_heap *heap);
+
+unsigned heap_get_thread_arena_id(struct palloc_heap *heap);
+
+int heap_arena_create(struct palloc_heap *heap);
+
+struct bucket **
+heap_get_arena_buckets(struct palloc_heap *heap, unsigned arena_id);
+
+int heap_get_arena_auto(struct palloc_heap *heap, unsigned arena_id);
+
+int heap_set_arena_auto(struct palloc_heap *heap, unsigned arena_id,
+               int automatic);
+
+void heap_set_arena_thread(struct palloc_heap *heap, unsigned arena_id);
+
+void heap_vg_open(struct palloc_heap *heap, object_callback cb,
+               void *arg, int objects);
+
+static inline struct chunk_header *
+heap_get_chunk_hdr(struct palloc_heap *heap, const struct memory_block *m)
+{
+       return GET_CHUNK_HDR(heap->layout, m->zone_id, m->chunk_id);
+}
+
+static inline struct chunk *
+heap_get_chunk(struct palloc_heap *heap, const struct memory_block *m)
+{
+       return GET_CHUNK(heap->layout, m->zone_id, m->chunk_id);
+}
+
+static inline struct chunk_run *
+heap_get_chunk_run(struct palloc_heap *heap, const struct memory_block *m)
+{
+       return GET_CHUNK_RUN(heap->layout, m->zone_id, m->chunk_id);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/heap_layout.h b/ceph/src/pmdk/src/libpmemobj/heap_layout.h
new file mode 100644 (file)
index 0000000..94554f2
--- /dev/null
@@ -0,0 +1,206 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * heap_layout.h -- internal definitions for heap layout
+ */
+
+#ifndef LIBPMEMOBJ_HEAP_LAYOUT_H
+#define LIBPMEMOBJ_HEAP_LAYOUT_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HEAP_MAJOR 1
+#define HEAP_MINOR 0
+
+#define MAX_CHUNK (UINT16_MAX - 7) /* has to be multiple of 8 */
+#define CHUNK_BASE_ALIGNMENT 1024
+#define CHUNKSIZE ((size_t)1024 * 256) /* 256 kilobytes */
+#define MAX_MEMORY_BLOCK_SIZE (MAX_CHUNK * CHUNKSIZE)
+#define HEAP_SIGNATURE_LEN 16
+#define HEAP_SIGNATURE "MEMORY_HEAP_HDR\0"
+#define ZONE_HEADER_MAGIC 0xC3F0A2D2
+#define ZONE_MIN_SIZE (sizeof(struct zone) + sizeof(struct chunk))
+#define ZONE_MAX_SIZE (sizeof(struct zone) + sizeof(struct chunk) * MAX_CHUNK)
+#define HEAP_MIN_SIZE (sizeof(struct heap_layout) + ZONE_MIN_SIZE)
+
+/* Base bitmap values, relevant for both normal and flexible bitmaps */
+#define RUN_BITS_PER_VALUE 64U
+#define RUN_BASE_METADATA_VALUES\
+       ((unsigned)(sizeof(struct chunk_run_header) / sizeof(uint64_t)))
+#define RUN_BASE_METADATA_SIZE (sizeof(struct chunk_run_header))
+
+#define RUN_CONTENT_SIZE (CHUNKSIZE - RUN_BASE_METADATA_SIZE)
+
+/*
+ * Calculates the size in bytes of a single run instance, including bitmap
+ */
+#define RUN_CONTENT_SIZE_BYTES(size_idx)\
+(RUN_CONTENT_SIZE + (((size_idx) - 1) * CHUNKSIZE))
+
+/* Default bitmap values, specific for old, non-flexible, bitmaps */
+#define RUN_DEFAULT_METADATA_VALUES 40 /* in 8 byte words, 320 bytes total */
+#define RUN_DEFAULT_BITMAP_VALUES \
+       (RUN_DEFAULT_METADATA_VALUES - RUN_BASE_METADATA_VALUES)
+#define RUN_DEFAULT_BITMAP_SIZE (sizeof(uint64_t) * RUN_DEFAULT_BITMAP_VALUES)
+#define RUN_DEFAULT_BITMAP_NBITS\
+       (RUN_BITS_PER_VALUE * RUN_DEFAULT_BITMAP_VALUES)
+#define RUN_DEFAULT_SIZE \
+       (CHUNKSIZE - RUN_BASE_METADATA_SIZE - RUN_DEFAULT_BITMAP_SIZE)
+
+/*
+ * Calculates the size in bytes of a single run instance, without bitmap,
+ * but only for the default fixed-bitmap algorithm
+ */
+#define RUN_DEFAULT_SIZE_BYTES(size_idx)\
+(RUN_DEFAULT_SIZE + (((size_idx) - 1) * CHUNKSIZE))
+
+#define CHUNK_MASK ((CHUNKSIZE) - 1)
+#define CHUNK_ALIGN_UP(value) ((((value) + CHUNK_MASK) & ~CHUNK_MASK))
+
+enum chunk_flags {
+       CHUNK_FLAG_COMPACT_HEADER       =       0x0001,
+       CHUNK_FLAG_HEADER_NONE          =       0x0002,
+       CHUNK_FLAG_ALIGNED              =       0x0004,
+       CHUNK_FLAG_FLEX_BITMAP          =       0x0008,
+};
+
+#define CHUNK_FLAGS_ALL_VALID (\
+       CHUNK_FLAG_COMPACT_HEADER |\
+       CHUNK_FLAG_HEADER_NONE |\
+       CHUNK_FLAG_ALIGNED |\
+       CHUNK_FLAG_FLEX_BITMAP\
+)
+
+enum chunk_type {
+       CHUNK_TYPE_UNKNOWN,
+       CHUNK_TYPE_FOOTER, /* not actual chunk type */
+       CHUNK_TYPE_FREE,
+       CHUNK_TYPE_USED,
+       CHUNK_TYPE_RUN,
+       CHUNK_TYPE_RUN_DATA,
+
+       MAX_CHUNK_TYPE
+};
+
+struct chunk {
+       uint8_t data[CHUNKSIZE];
+};
+
+struct chunk_run_header {
+       uint64_t block_size;
+       uint64_t alignment; /* valid only /w CHUNK_FLAG_ALIGNED */
+};
+
+struct chunk_run {
+       struct chunk_run_header hdr;
+       uint8_t content[RUN_CONTENT_SIZE]; /* bitmap + data */
+};
+
+struct chunk_header {
+       uint16_t type;
+       uint16_t flags;
+       uint32_t size_idx;
+};
+
+struct zone_header {
+       uint32_t magic;
+       uint32_t size_idx;
+       uint8_t reserved[56];
+};
+
+struct zone {
+       struct zone_header header;
+       struct chunk_header chunk_headers[MAX_CHUNK];
+       struct chunk chunks[];
+};
+
+struct heap_header {
+       char signature[HEAP_SIGNATURE_LEN];
+       uint64_t major;
+       uint64_t minor;
+       uint64_t unused; /* might be garbage */
+       uint64_t chunksize;
+       uint64_t chunks_per_zone;
+       uint8_t reserved[960];
+       uint64_t checksum;
+};
+
+struct heap_layout {
+       struct heap_header header;
+       struct zone zone0;      /* first element of zones array */
+};
+
+#define ALLOC_HDR_SIZE_SHIFT (48ULL)
+#define ALLOC_HDR_FLAGS_MASK (((1ULL) << ALLOC_HDR_SIZE_SHIFT) - 1)
+
+struct allocation_header_legacy {
+       uint8_t unused[8];
+       uint64_t size;
+       uint8_t unused2[32];
+       uint64_t root_size;
+       uint64_t type_num;
+};
+
+#define ALLOC_HDR_COMPACT_SIZE sizeof(struct allocation_header_compact)
+
+struct allocation_header_compact {
+       uint64_t size;
+       uint64_t extra;
+};
+
+enum header_type {
+       HEADER_LEGACY,
+       HEADER_COMPACT,
+       HEADER_NONE,
+
+       MAX_HEADER_TYPES
+};
+
+static const size_t header_type_to_size[MAX_HEADER_TYPES] = {
+       sizeof(struct allocation_header_legacy),
+       sizeof(struct allocation_header_compact),
+       0
+};
+
+static const enum chunk_flags header_type_to_flag[MAX_HEADER_TYPES] = {
+       (enum chunk_flags)0,
+       CHUNK_FLAG_COMPACT_HEADER,
+       CHUNK_FLAG_HEADER_NONE
+};
+
+static inline struct zone *
+ZID_TO_ZONE(struct heap_layout *layout, size_t zone_id)
+{
+       return (struct zone *)
+               ((uintptr_t)&layout->zone0 + ZONE_MAX_SIZE * zone_id);
+}
+
+static inline struct chunk_header *
+GET_CHUNK_HDR(struct heap_layout *layout, size_t zone_id, unsigned chunk_id)
+{
+       return &ZID_TO_ZONE(layout, zone_id)->chunk_headers[chunk_id];
+}
+
+static inline struct chunk *
+GET_CHUNK(struct heap_layout *layout, size_t zone_id, unsigned chunk_id)
+{
+       return &ZID_TO_ZONE(layout, zone_id)->chunks[chunk_id];
+}
+
+static inline struct chunk_run *
+GET_CHUNK_RUN(struct heap_layout *layout, size_t zone_id, unsigned chunk_id)
+{
+       return (struct chunk_run *)GET_CHUNK(layout, zone_id, chunk_id);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/lane.c b/ceph/src/pmdk/src/libpmemobj/lane.c
new file mode 100644 (file)
index 0000000..350da81
--- /dev/null
@@ -0,0 +1,572 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2019, Intel Corporation */
+
+/*
+ * lane.c -- lane implementation
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
+#include <sched.h>
+
+#include "libpmemobj.h"
+#include "critnib.h"
+#include "lane.h"
+#include "out.h"
+#include "util.h"
+#include "obj.h"
+#include "os_thread.h"
+#include "valgrind_internal.h"
+#include "memops.h"
+#include "palloc.h"
+#include "tx.h"
+
+static os_tls_key_t Lane_info_key;
+
+static __thread struct critnib *Lane_info_ht;
+static __thread struct lane_info *Lane_info_records;
+static __thread struct lane_info *Lane_info_cache;
+
+/*
+ * lane_info_create -- (internal) constructor for thread shared data
+ */
+static inline void
+lane_info_create(void)
+{
+       Lane_info_ht = critnib_new();
+       if (Lane_info_ht == NULL)
+               FATAL("critnib_new");
+}
+
+/*
+ * lane_info_delete -- (internal) deletes lane info hash table
+ */
+static inline void
+lane_info_delete(void)
+{
+       if (unlikely(Lane_info_ht == NULL))
+               return;
+
+       critnib_delete(Lane_info_ht);
+       struct lane_info *record;
+       struct lane_info *head = Lane_info_records;
+       while (head != NULL) {
+               record = head;
+               head = head->next;
+               Free(record);
+       }
+
+       Lane_info_ht = NULL;
+       Lane_info_records = NULL;
+       Lane_info_cache = NULL;
+}
+
+/*
+ * lane_info_ht_boot -- (internal) boot lane info and add it to thread shared
+ *     data
+ */
+static inline void
+lane_info_ht_boot(void)
+{
+       lane_info_create();
+       int result = os_tls_set(Lane_info_key, Lane_info_ht);
+       if (result != 0) {
+               errno = result;
+               FATAL("!os_tls_set");
+       }
+}
+
+/*
+ * lane_info_ht_destroy -- (internal) destructor for thread shared data
+ */
+static inline void
+lane_info_ht_destroy(void *ht)
+{
+       lane_info_delete();
+}
+
+/*
+ * lane_info_boot -- initialize lane info hash table and lane info key
+ */
+void
+lane_info_boot(void)
+{
+       int result = os_tls_key_create(&Lane_info_key, lane_info_ht_destroy);
+       if (result != 0) {
+               errno = result;
+               FATAL("!os_tls_key_create");
+       }
+}
+
+/*
+ * lane_info_destroy -- destroy lane info hash table
+ */
+void
+lane_info_destroy(void)
+{
+       lane_info_delete();
+       (void) os_tls_key_delete(Lane_info_key);
+}
+
+/*
+ * lane_info_cleanup -- remove lane info record regarding pool being deleted
+ */
+static inline void
+lane_info_cleanup(PMEMobjpool *pop)
+{
+       if (unlikely(Lane_info_ht == NULL))
+               return;
+
+       struct lane_info *info = critnib_remove(Lane_info_ht, pop->uuid_lo);
+       if (likely(info != NULL)) {
+               if (info->prev)
+                       info->prev->next = info->next;
+
+               if (info->next)
+                       info->next->prev = info->prev;
+
+               if (Lane_info_cache == info)
+                       Lane_info_cache = NULL;
+
+               if (Lane_info_records == info)
+                       Lane_info_records = info->next;
+
+               Free(info);
+       }
+}
+
+/*
+ * lane_get_layout -- (internal) calculates the real pointer of the lane layout
+ */
+static struct lane_layout *
+lane_get_layout(PMEMobjpool *pop, uint64_t lane_idx)
+{
+       return (void *)((char *)pop + pop->lanes_offset +
+               sizeof(struct lane_layout) * lane_idx);
+}
+
+/*
+ * lane_ulog_constructor -- (internal) constructor of a ulog extension
+ */
+static int
+lane_ulog_constructor(void *base, void *ptr, size_t usable_size, void *arg)
+{
+       PMEMobjpool *pop = base;
+       const struct pmem_ops *p_ops = &pop->p_ops;
+
+       size_t capacity = ALIGN_DOWN(usable_size - sizeof(struct ulog),
+               CACHELINE_SIZE);
+
+       uint64_t gen_num = *(uint64_t *)arg;
+       ulog_construct(OBJ_PTR_TO_OFF(base, ptr), capacity,
+                       gen_num, 1, 0, p_ops);
+
+       return 0;
+}
+
+/*
+ * lane_undo_extend -- allocates a new undo log
+ */
+static int
+lane_undo_extend(void *base, uint64_t *redo, uint64_t gen_num)
+{
+       PMEMobjpool *pop = base;
+       struct tx_parameters *params = pop->tx_params;
+       size_t s = SIZEOF_ALIGNED_ULOG(params->cache_size);
+
+       return pmalloc_construct(base, redo, s, lane_ulog_constructor, &gen_num,
+               0, OBJ_INTERNAL_OBJECT_MASK, 0);
+}
+
+/*
+ * lane_redo_extend -- allocates a new redo log
+ */
+static int
+lane_redo_extend(void *base, uint64_t *redo, uint64_t gen_num)
+{
+       size_t s = SIZEOF_ALIGNED_ULOG(LANE_REDO_EXTERNAL_SIZE);
+
+       return pmalloc_construct(base, redo, s, lane_ulog_constructor, &gen_num,
+               0, OBJ_INTERNAL_OBJECT_MASK, 0);
+}
+
+/*
+ * lane_init -- (internal) initializes a single lane runtime variables
+ */
+static int
+lane_init(PMEMobjpool *pop, struct lane *lane, struct lane_layout *layout)
+{
+       ASSERTne(lane, NULL);
+
+       lane->layout = layout;
+
+       lane->internal = operation_new((struct ulog *)&layout->internal,
+               LANE_REDO_INTERNAL_SIZE,
+               NULL, NULL, &pop->p_ops,
+               LOG_TYPE_REDO);
+       if (lane->internal == NULL)
+               goto error_internal_new;
+
+       lane->external = operation_new((struct ulog *)&layout->external,
+               LANE_REDO_EXTERNAL_SIZE,
+               lane_redo_extend, (ulog_free_fn)pfree, &pop->p_ops,
+               LOG_TYPE_REDO);
+       if (lane->external == NULL)
+               goto error_external_new;
+
+       lane->undo = operation_new((struct ulog *)&layout->undo,
+               LANE_UNDO_SIZE,
+               lane_undo_extend, (ulog_free_fn)pfree, &pop->p_ops,
+               LOG_TYPE_UNDO);
+       if (lane->undo == NULL)
+               goto error_undo_new;
+
+       return 0;
+
+error_undo_new:
+       operation_delete(lane->external);
+error_external_new:
+       operation_delete(lane->internal);
+error_internal_new:
+       return -1;
+}
+
+/*
+ * lane_destroy -- cleanups a single lane runtime variables
+ */
+static void
+lane_destroy(PMEMobjpool *pop, struct lane *lane)
+{
+       operation_delete(lane->undo);
+       operation_delete(lane->internal);
+       operation_delete(lane->external);
+}
+
+/*
+ * lane_boot -- initializes all lanes
+ */
+int
+lane_boot(PMEMobjpool *pop)
+{
+       int err = 0;
+
+       pop->lanes_desc.lane = Malloc(sizeof(struct lane) * pop->nlanes);
+       if (pop->lanes_desc.lane == NULL) {
+               err = ENOMEM;
+               ERR("!Malloc of volatile lanes");
+               goto error_lanes_malloc;
+       }
+
+       pop->lanes_desc.next_lane_idx = 0;
+
+       pop->lanes_desc.lane_locks =
+               Zalloc(sizeof(*pop->lanes_desc.lane_locks) * pop->nlanes);
+       if (pop->lanes_desc.lane_locks == NULL) {
+               ERR("!Malloc for lane locks");
+               goto error_locks_malloc;
+       }
+
+       /* add lanes to pmemcheck ignored list */
+       VALGRIND_ADD_TO_GLOBAL_TX_IGNORE((char *)pop + pop->lanes_offset,
+               (sizeof(struct lane_layout) * pop->nlanes));
+
+       uint64_t i;
+       for (i = 0; i < pop->nlanes; ++i) {
+               struct lane_layout *layout = lane_get_layout(pop, i);
+
+               if ((err = lane_init(pop, &pop->lanes_desc.lane[i], layout))) {
+                       ERR("!lane_init");
+                       goto error_lane_init;
+               }
+       }
+
+       return 0;
+
+error_lane_init:
+       for (; i >= 1; --i)
+               lane_destroy(pop, &pop->lanes_desc.lane[i - 1]);
+       Free(pop->lanes_desc.lane_locks);
+       pop->lanes_desc.lane_locks = NULL;
+error_locks_malloc:
+       Free(pop->lanes_desc.lane);
+       pop->lanes_desc.lane = NULL;
+error_lanes_malloc:
+       return err;
+}
+
+/*
+ * lane_init_data -- initializes ulogs for all the lanes
+ */
+void
+lane_init_data(PMEMobjpool *pop)
+{
+       struct lane_layout *layout;
+
+       for (uint64_t i = 0; i < pop->nlanes; ++i) {
+               layout = lane_get_layout(pop, i);
+               ulog_construct(OBJ_PTR_TO_OFF(pop, &layout->internal),
+                       LANE_REDO_INTERNAL_SIZE, 0, 0, 0, &pop->p_ops);
+               ulog_construct(OBJ_PTR_TO_OFF(pop, &layout->external),
+                       LANE_REDO_EXTERNAL_SIZE, 0, 0, 0, &pop->p_ops);
+               ulog_construct(OBJ_PTR_TO_OFF(pop, &layout->undo),
+                       LANE_UNDO_SIZE, 0, 0, 0, &pop->p_ops);
+       }
+       layout = lane_get_layout(pop, 0);
+       pmemops_xpersist(&pop->p_ops, layout,
+               pop->nlanes * sizeof(struct lane_layout),
+               PMEMOBJ_F_RELAXED);
+}
+
+/*
+ * lane_cleanup -- destroys all lanes
+ */
+void
+lane_cleanup(PMEMobjpool *pop)
+{
+       for (uint64_t i = 0; i < pop->nlanes; ++i)
+               lane_destroy(pop, &pop->lanes_desc.lane[i]);
+
+       Free(pop->lanes_desc.lane);
+       pop->lanes_desc.lane = NULL;
+       Free(pop->lanes_desc.lane_locks);
+       pop->lanes_desc.lane_locks = NULL;
+
+       lane_info_cleanup(pop);
+}
+
+/*
+ * lane_recover_and_section_boot -- performs initialization and recovery of all
+ * lanes
+ */
+int
+lane_recover_and_section_boot(PMEMobjpool *pop)
+{
+       COMPILE_ERROR_ON(SIZEOF_ULOG(LANE_UNDO_SIZE) +
+               SIZEOF_ULOG(LANE_REDO_EXTERNAL_SIZE) +
+               SIZEOF_ULOG(LANE_REDO_INTERNAL_SIZE) != LANE_TOTAL_SIZE);
+
+       int err = 0;
+       uint64_t i; /* lane index */
+       struct lane_layout *layout;
+
+       /*
+        * First we need to recover the internal/external redo logs so that the
+        * allocator state is consistent before we boot it.
+        */
+       for (i = 0; i < pop->nlanes; ++i) {
+               layout = lane_get_layout(pop, i);
+
+               ulog_recover((struct ulog *)&layout->internal,
+                       OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops);
+               ulog_recover((struct ulog *)&layout->external,
+                       OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops);
+       }
+
+       if ((err = pmalloc_boot(pop)) != 0)
+               return err;
+
+       /*
+        * Undo logs must be processed after the heap is initialized since
+        * a undo recovery might require deallocation of the next ulogs.
+        */
+       for (i = 0; i < pop->nlanes; ++i) {
+               struct operation_context *ctx = pop->lanes_desc.lane[i].undo;
+               operation_resume(ctx);
+               operation_process(ctx);
+               operation_finish(ctx, ULOG_INC_FIRST_GEN_NUM |
+                               ULOG_FREE_AFTER_FIRST);
+       }
+
+       return 0;
+}
+
+/*
+ * lane_section_cleanup -- performs runtime cleanup of all lanes
+ */
+int
+lane_section_cleanup(PMEMobjpool *pop)
+{
+       return pmalloc_cleanup(pop);
+}
+
+/*
+ * lane_check -- performs check of all lanes
+ */
+int
+lane_check(PMEMobjpool *pop)
+{
+       int err = 0;
+       uint64_t j; /* lane index */
+       struct lane_layout *layout;
+
+       for (j = 0; j < pop->nlanes; ++j) {
+               layout = lane_get_layout(pop, j);
+               if (ulog_check((struct ulog *)&layout->internal,
+                   OBJ_OFF_IS_VALID_FROM_CTX, &pop->p_ops) != 0) {
+                       LOG(2, "lane %" PRIu64 " internal redo failed: %d",
+                               j, err);
+                       return err;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * get_lane -- (internal) get free lane index
+ */
+static inline void
+get_lane(uint64_t *locks, struct lane_info *info, uint64_t nlocks)
+{
+       info->lane_idx = info->primary;
+       while (1) {
+               do {
+                       info->lane_idx %= nlocks;
+                       if (likely(util_bool_compare_and_swap64(
+                                       &locks[info->lane_idx], 0, 1))) {
+                               if (info->lane_idx == info->primary) {
+                                       info->primary_attempts =
+                                               LANE_PRIMARY_ATTEMPTS;
+                               } else if (info->primary_attempts == 0) {
+                                       info->primary = info->lane_idx;
+                                       info->primary_attempts =
+                                               LANE_PRIMARY_ATTEMPTS;
+                               }
+                               return;
+                       }
+
+                       if (info->lane_idx == info->primary &&
+                                       info->primary_attempts > 0) {
+                               info->primary_attempts--;
+                       }
+
+                       ++info->lane_idx;
+               } while (info->lane_idx < nlocks);
+
+               sched_yield();
+       }
+}
+
+/*
+ * get_lane_info_record -- (internal) get lane record attached to memory pool
+ *     or first free
+ */
+static inline struct lane_info *
+get_lane_info_record(PMEMobjpool *pop)
+{
+       if (likely(Lane_info_cache != NULL &&
+                       Lane_info_cache->pop_uuid_lo == pop->uuid_lo)) {
+               return Lane_info_cache;
+       }
+
+       if (unlikely(Lane_info_ht == NULL)) {
+               lane_info_ht_boot();
+       }
+
+       struct lane_info *info = critnib_get(Lane_info_ht, pop->uuid_lo);
+
+       if (unlikely(info == NULL)) {
+               info = Malloc(sizeof(struct lane_info));
+               if (unlikely(info == NULL)) {
+                       FATAL("Malloc");
+               }
+               info->pop_uuid_lo = pop->uuid_lo;
+               info->lane_idx = UINT64_MAX;
+               info->nest_count = 0;
+               info->next = Lane_info_records;
+               info->prev = NULL;
+               info->primary = 0;
+               info->primary_attempts = LANE_PRIMARY_ATTEMPTS;
+               if (Lane_info_records) {
+                       Lane_info_records->prev = info;
+               }
+               Lane_info_records = info;
+
+               if (unlikely(critnib_insert(
+                               Lane_info_ht, pop->uuid_lo, info) != 0)) {
+                       FATAL("critnib_insert");
+               }
+       }
+
+       Lane_info_cache = info;
+       return info;
+}
+
+/*
+ * lane_hold -- grabs a per-thread lane in a round-robin fashion
+ */
+unsigned
+lane_hold(PMEMobjpool *pop, struct lane **lanep)
+{
+       /*
+        * Before runtime lane initialization all remote operations are
+        * executed using RLANE_DEFAULT.
+        */
+       if (unlikely(!pop->lanes_desc.runtime_nlanes)) {
+               ASSERT(pop->has_remote_replicas);
+               if (lanep != NULL)
+                       FATAL("cannot obtain section before lane's init");
+               return RLANE_DEFAULT;
+       }
+
+       struct lane_info *lane = get_lane_info_record(pop);
+       while (unlikely(lane->lane_idx == UINT64_MAX)) {
+               /* initial wrap to next CL */
+               lane->primary = lane->lane_idx = util_fetch_and_add32(
+                       &pop->lanes_desc.next_lane_idx, LANE_JUMP);
+       } /* handles wraparound */
+
+       uint64_t *llocks = pop->lanes_desc.lane_locks;
+       /* grab next free lane from lanes available at runtime */
+       if (!lane->nest_count++) {
+               get_lane(llocks, lane, pop->lanes_desc.runtime_nlanes);
+       }
+
+       struct lane *l = &pop->lanes_desc.lane[lane->lane_idx];
+
+       /* reinitialize lane's content only if in outermost hold */
+       if (lanep && lane->nest_count == 1) {
+               VALGRIND_ANNOTATE_NEW_MEMORY(l, sizeof(*l));
+               VALGRIND_ANNOTATE_NEW_MEMORY(l->layout, sizeof(*l->layout));
+               operation_init(l->external);
+               operation_init(l->internal);
+               operation_init(l->undo);
+       }
+
+       if (lanep)
+               *lanep = l;
+
+       return (unsigned)lane->lane_idx;
+}
+
+/*
+ * lane_release -- drops the per-thread lane
+ */
+void
+lane_release(PMEMobjpool *pop)
+{
+       if (unlikely(!pop->lanes_desc.runtime_nlanes)) {
+               ASSERT(pop->has_remote_replicas);
+               return;
+       }
+
+       struct lane_info *lane = get_lane_info_record(pop);
+
+       ASSERTne(lane, NULL);
+       ASSERTne(lane->lane_idx, UINT64_MAX);
+
+       if (unlikely(lane->nest_count == 0)) {
+               FATAL("lane_release");
+       } else if (--(lane->nest_count) == 0) {
+               if (unlikely(!util_bool_compare_and_swap64(
+                               &pop->lanes_desc.lane_locks[lane->lane_idx],
+                               1, 0))) {
+                       FATAL("util_bool_compare_and_swap64");
+               }
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/lane.h b/ceph/src/pmdk/src/libpmemobj/lane.h
new file mode 100644 (file)
index 0000000..1dfc29d
--- /dev/null
@@ -0,0 +1,149 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * lane.h -- internal definitions for lanes
+ */
+
+#ifndef LIBPMEMOBJ_LANE_H
+#define LIBPMEMOBJ_LANE_H 1
+
+#include <stdint.h>
+#include "ulog.h"
+#include "libpmemobj.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Distance between lanes used by threads required to prevent threads from
+ * false sharing part of lanes array. Used if properly spread lanes are
+ * available. Otherwise less spread out lanes would be used.
+ */
+#define LANE_JUMP (64 / sizeof(uint64_t))
+
+/*
+ * Number of times the algorithm will try to reacquire the primary lane for the
+ * thread. If this threshold is exceeded, a new primary lane is selected for the
+ * thread.
+ */
+#define LANE_PRIMARY_ATTEMPTS 128
+
+#define RLANE_DEFAULT 0
+
+#define LANE_TOTAL_SIZE 3072 /* 3 * 1024 (sum of 3 old lane sections) */
+/*
+ * We have 3 kilobytes to distribute.
+ * The smallest capacity is needed for the internal redo log for which we can
+ * accurately calculate the maximum number of occupied space: 48 bytes,
+ * 3 times sizeof(struct ulog_entry_val). One for bitmap OR, second for bitmap
+ * AND, third for modification of the destination pointer. For future needs,
+ * this has been bumped up to 12 ulog entries.
+ *
+ * The remaining part has to be split between transactional redo and undo logs,
+ * and since by far the most space consuming operations are transactional
+ * snapshots, most of the space, 2 kilobytes, is assigned to the undo log.
+ * After that, the remainder, 640 bytes, or 40 ulog entries, is left for the
+ * transactional redo logs.
+ * Thanks to this distribution, all small and medium transactions should be
+ * entirely performed without allocating any additional metadata.
+ *
+ * These values must be cacheline size aligned to be used for ulogs. Therefore
+ * they are parametrized for the size of the struct ulog changes between
+ * platforms.
+ */
+#define LANE_UNDO_SIZE (LANE_TOTAL_SIZE \
+                       - LANE_REDO_EXTERNAL_SIZE \
+                       - LANE_REDO_INTERNAL_SIZE \
+                       - 3 * sizeof(struct ulog)) /* 2048 for 64B ulog */
+#define LANE_REDO_EXTERNAL_SIZE ALIGN_UP(704 - sizeof(struct ulog), \
+                                       CACHELINE_SIZE) /* 640 for 64B ulog */
+#define LANE_REDO_INTERNAL_SIZE ALIGN_UP(256 - sizeof(struct ulog), \
+                                       CACHELINE_SIZE) /* 192 for 64B ulog */
+
+struct lane_layout {
+       /*
+        * Redo log for self-contained and 'one-shot' allocator operations.
+        * Cannot be extended.
+        */
+       struct ULOG(LANE_REDO_INTERNAL_SIZE) internal;
+       /*
+        * Redo log for large operations/transactions.
+        * Can be extended by the use of internal ulog.
+        */
+       struct ULOG(LANE_REDO_EXTERNAL_SIZE) external;
+       /*
+        * Undo log for snapshots done in a transaction.
+        * Can be extended/shrunk by the use of internal ulog.
+        */
+       struct ULOG(LANE_UNDO_SIZE) undo;
+};
+
+struct lane {
+       struct lane_layout *layout; /* pointer to persistent layout */
+       struct operation_context *internal; /* context for internal ulog */
+       struct operation_context *external; /* context for external ulog */
+       struct operation_context *undo; /* context for undo ulog */
+};
+
+struct lane_descriptor {
+       /*
+        * Number of lanes available at runtime must be <= total number of lanes
+        * available in the pool. Number of lanes can be limited by shortage of
+        * other resources e.g. available RNIC's submission queue sizes.
+        */
+       unsigned runtime_nlanes;
+       unsigned next_lane_idx;
+       uint64_t *lane_locks;
+       struct lane *lane;
+};
+
+typedef int (*section_layout_op)(PMEMobjpool *pop, void *data, unsigned length);
+typedef void *(*section_constr)(PMEMobjpool *pop, void *data);
+typedef void (*section_destr)(PMEMobjpool *pop, void *rt);
+typedef int (*section_global_op)(PMEMobjpool *pop);
+
+struct section_operations {
+       section_constr construct_rt;
+       section_destr destroy_rt;
+       section_layout_op check;
+       section_layout_op recover;
+       section_global_op boot;
+       section_global_op cleanup;
+};
+
+struct lane_info {
+       uint64_t pop_uuid_lo;
+       uint64_t lane_idx;
+       unsigned long nest_count;
+
+       /*
+        * The index of the primary lane for the thread. A thread will always
+        * try to acquire the primary lane first, and only if that fails it will
+        * look for a different available lane.
+        */
+       uint64_t primary;
+       int primary_attempts;
+
+       struct lane_info *prev, *next;
+};
+
+void lane_info_boot(void);
+void lane_info_destroy(void);
+
+void lane_init_data(PMEMobjpool *pop);
+int lane_boot(PMEMobjpool *pop);
+void lane_cleanup(PMEMobjpool *pop);
+int lane_recover_and_section_boot(PMEMobjpool *pop);
+int lane_section_cleanup(PMEMobjpool *pop);
+int lane_check(PMEMobjpool *pop);
+
+unsigned lane_hold(PMEMobjpool *pop, struct lane **lane);
+void lane_release(PMEMobjpool *pop);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.c b/ceph/src/pmdk/src/libpmemobj/libpmemobj.c
new file mode 100644 (file)
index 0000000..36fb212
--- /dev/null
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2017, Intel Corporation */
+
+/*
+ * libpmemobj.c -- pmem entry points for libpmemobj
+ */
+
+#include "pmemcommon.h"
+#include "obj.h"
+
+/*
+ * libpmemobj_init -- load-time initialization for obj
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmemobj_init(void)
+{
+       common_init(PMEMOBJ_LOG_PREFIX, PMEMOBJ_LOG_LEVEL_VAR,
+                       PMEMOBJ_LOG_FILE_VAR, PMEMOBJ_MAJOR_VERSION,
+                       PMEMOBJ_MINOR_VERSION);
+       LOG(3, NULL);
+       obj_init();
+}
+
+/*
+ * libpmemobj_fini -- libpmemobj cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmemobj_fini(void)
+{
+       LOG(3, NULL);
+       obj_fini();
+       common_fini();
+}
+
+/*
+ * pmemobj_check_versionU -- see if lib meets application version requirements
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemobj_check_versionU(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != PMEMOBJ_MAJOR_VERSION) {
+               ERR("libpmemobj major version mismatch (need %u, found %u)",
+                       major_required, PMEMOBJ_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > PMEMOBJ_MINOR_VERSION) {
+               ERR("libpmemobj minor version mismatch (need %u, found %u)",
+                       minor_required, PMEMOBJ_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_check_version -- see if lib meets application version requirements
+ */
+const char *
+pmemobj_check_version(unsigned major_required, unsigned minor_required)
+{
+       return pmemobj_check_versionU(major_required, minor_required);
+}
+#else
+/*
+ * pmemobj_check_versionW -- see if lib meets application version requirements
+ */
+const wchar_t *
+pmemobj_check_versionW(unsigned major_required, unsigned minor_required)
+{
+       if (pmemobj_check_versionU(major_required, minor_required) != NULL)
+               return out_get_errormsgW();
+       else
+               return NULL;
+}
+#endif
+
+/*
+ * pmemobj_set_funcs -- allow overriding libpmemobj's call to malloc, etc.
+ */
+void
+pmemobj_set_funcs(
+               void *(*malloc_func)(size_t size),
+               void (*free_func)(void *ptr),
+               void *(*realloc_func)(void *ptr, size_t size),
+               char *(*strdup_func)(const char *s))
+{
+       LOG(3, NULL);
+
+       util_set_alloc_funcs(malloc_func, free_func, realloc_func, strdup_func);
+}
+
+/*
+ * pmemobj_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmemobj_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_errormsg -- return last error message
+ */
+const char *
+pmemobj_errormsg(void)
+{
+       return pmemobj_errormsgU();
+}
+#else
+/*
+ * pmemobj_errormsgW -- return last error message as wchar_t
+ */
+const wchar_t *
+pmemobj_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.def b/ceph/src/pmdk/src/libpmemobj/libpmemobj.def
new file mode 100644 (file)
index 0000000..d20fa25
--- /dev/null
@@ -0,0 +1,124 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2015-2020, Intel Corporation
+;;;;  End Copyright Notice
+
+LIBRARY libpmemobj
+
+VERSION 1.0
+
+EXPORTS
+       pmemobj_check_versionU
+       pmemobj_check_versionW
+       pmemobj_set_funcs
+       pmemobj_errormsgU
+       pmemobj_errormsgW
+       pmemobj_createU
+       pmemobj_createW
+       pmemobj_openU
+       pmemobj_openW
+       pmemobj_close
+       pmemobj_checkU
+       pmemobj_checkW
+       pmemobj_mutex_zero
+       pmemobj_mutex_lock
+       pmemobj_mutex_trylock
+       pmemobj_mutex_unlock
+       pmemobj_mutex_timedlock
+       pmemobj_rwlock_zero
+       pmemobj_rwlock_rdlock
+       pmemobj_rwlock_wrlock
+       pmemobj_rwlock_timedrdlock
+       pmemobj_rwlock_timedwrlock
+       pmemobj_rwlock_tryrdlock
+       pmemobj_rwlock_trywrlock
+       pmemobj_rwlock_unlock
+       pmemobj_cond_zero
+       pmemobj_cond_broadcast
+       pmemobj_cond_signal
+       pmemobj_cond_timedwait
+       pmemobj_cond_wait
+       pmemobj_ctl_execU;
+       pmemobj_ctl_execW;
+       pmemobj_ctl_getU;
+       pmemobj_ctl_getW;
+       pmemobj_ctl_setU;
+       pmemobj_ctl_setW;
+       pmemobj_pool_by_oid
+       pmemobj_pool_by_ptr
+       pmemobj_alloc
+       pmemobj_xalloc
+       pmemobj_zalloc
+       pmemobj_realloc
+       pmemobj_zrealloc
+       pmemobj_strdup
+       pmemobj_wcsdup
+       pmemobj_free
+       pmemobj_alloc_usable_size
+       pmemobj_type_num
+       pmemobj_root
+       pmemobj_root_construct
+       pmemobj_root_size
+       pmemobj_first
+       pmemobj_next
+       pmemobj_list_insert
+       pmemobj_list_insert_new
+       pmemobj_list_remove
+       pmemobj_list_move
+       pmemobj_tx_begin
+       pmemobj_tx_stage
+       pmemobj_tx_abort
+       pmemobj_tx_commit
+       pmemobj_tx_end
+       pmemobj_tx_process
+       pmemobj_tx_add_range
+       pmemobj_tx_add_range_direct
+       pmemobj_tx_alloc
+       pmemobj_tx_xadd_range
+       pmemobj_tx_xadd_range_direct
+       pmemobj_tx_xalloc
+       pmemobj_tx_zalloc
+       pmemobj_tx_realloc
+       pmemobj_tx_zrealloc
+       pmemobj_tx_strdup
+       pmemobj_tx_xstrdup
+       pmemobj_tx_wcsdup
+       pmemobj_tx_xwcsdup
+       pmemobj_tx_free
+       pmemobj_tx_xfree
+       pmemobj_tx_errno
+       pmemobj_tx_lock
+       pmemobj_tx_xlock
+       pmemobj_tx_log_append_buffer
+       pmemobj_tx_xlog_append_buffer
+       pmemobj_tx_log_auto_alloc
+       pmemobj_tx_log_snapshots_max_size
+       pmemobj_tx_log_intents_max_size
+       pmemobj_tx_set_user_data
+       pmemobj_tx_get_user_data
+       pmemobj_tx_set_failure_behavior
+       pmemobj_tx_get_failure_behavior
+       pmemobj_memcpy
+       pmemobj_memcpy_persist
+       pmemobj_memmove
+       pmemobj_memset
+       pmemobj_memset_persist
+       pmemobj_persist
+       pmemobj_flush
+       pmemobj_drain
+       pmemobj_direct
+       pmemobj_volatile
+       pmemobj_oid
+       pmemobj_reserve
+       pmemobj_xreserve
+       pmemobj_defer_free
+       pmemobj_set_value
+       pmemobj_publish
+       pmemobj_tx_publish
+       pmemobj_tx_xpublish
+       pmemobj_cancel
+       pmemobj_set_user_data
+       pmemobj_get_user_data
+       pmemobj_defrag
+       _pobj_debug_notice
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.link.in b/ceph/src/pmdk/src/libpmemobj/libpmemobj.link.in
new file mode 100644 (file)
index 0000000..5b730ca
--- /dev/null
@@ -0,0 +1,121 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+#
+#
+# src/libpmemobj.link -- linker link file for libpmemobj
+#
+LIBPMEMOBJ_1.0 {
+       global:
+               pmemobj_check_version;
+               pmemobj_set_funcs;
+               pmemobj_errormsg;
+               pmemobj_create;
+               pmemobj_open;
+               pmemobj_close;
+               pmemobj_check;
+               pmemobj_ctl_exec;
+               pmemobj_ctl_get;
+               pmemobj_ctl_set;
+               pmemobj_mutex_zero;
+               pmemobj_mutex_lock;
+               pmemobj_mutex_timedlock;
+               pmemobj_mutex_trylock;
+               pmemobj_mutex_unlock;
+               pmemobj_rwlock_zero;
+               pmemobj_rwlock_rdlock;
+               pmemobj_rwlock_wrlock;
+               pmemobj_rwlock_timedrdlock;
+               pmemobj_rwlock_timedwrlock;
+               pmemobj_rwlock_tryrdlock;
+               pmemobj_rwlock_trywrlock;
+               pmemobj_rwlock_unlock;
+               pmemobj_cond_zero;
+               pmemobj_cond_broadcast;
+               pmemobj_cond_signal;
+               pmemobj_cond_timedwait;
+               pmemobj_cond_wait;
+               pmemobj_pool_by_oid;
+               pmemobj_pool_by_ptr;
+               pmemobj_oid;
+               pmemobj_alloc;
+               pmemobj_xalloc;
+               pmemobj_zalloc;
+               pmemobj_realloc;
+               pmemobj_zrealloc;
+               pmemobj_strdup;
+               pmemobj_wcsdup;
+               pmemobj_free;
+               pmemobj_alloc_usable_size;
+               pmemobj_type_num;
+               pmemobj_root;
+               pmemobj_root_construct;
+               pmemobj_root_size;
+               pmemobj_first;
+               pmemobj_next;
+               pmemobj_list_insert;
+               pmemobj_list_insert_new;
+               pmemobj_list_remove;
+               pmemobj_list_move;
+               pmemobj_tx_begin;
+               pmemobj_tx_stage;
+               pmemobj_tx_abort;
+               pmemobj_tx_commit;
+               pmemobj_tx_end;
+               pmemobj_tx_errno;
+               pmemobj_tx_process;
+               pmemobj_tx_add_range;
+               pmemobj_tx_add_range_direct;
+               pmemobj_tx_xadd_range;
+               pmemobj_tx_xadd_range_direct;
+               pmemobj_tx_alloc;
+               pmemobj_tx_xalloc;
+               pmemobj_tx_zalloc;
+               pmemobj_tx_realloc;
+               pmemobj_tx_zrealloc;
+               pmemobj_tx_strdup;
+               pmemobj_tx_xstrdup;
+               pmemobj_tx_wcsdup;
+               pmemobj_tx_xwcsdup;
+               pmemobj_tx_free;
+               pmemobj_tx_xfree;
+               pmemobj_tx_lock;
+               pmemobj_tx_xlock;
+               pmemobj_tx_log_append_buffer;
+               pmemobj_tx_xlog_append_buffer;
+               pmemobj_tx_log_auto_alloc;
+               pmemobj_tx_log_snapshots_max_size;
+               pmemobj_tx_log_intents_max_size;
+               pmemobj_tx_set_user_data;
+               pmemobj_tx_get_user_data;
+               pmemobj_tx_set_failure_behavior;
+               pmemobj_tx_get_failure_behavior;
+               pmemobj_memcpy;
+               pmemobj_memcpy_persist;
+               pmemobj_memmove;
+               pmemobj_memset;
+               pmemobj_memset_persist;
+               pmemobj_persist;
+               pmemobj_flush;
+               pmemobj_drain;
+               pmemobj_xpersist;
+               pmemobj_xflush;
+               pmemobj_direct;
+               pmemobj_volatile;
+               pmemobj_reserve;
+               pmemobj_xreserve;
+               pmemobj_defer_free;
+               pmemobj_set_value;
+               pmemobj_publish;
+               pmemobj_tx_publish;
+               pmemobj_tx_xpublish;
+               pmemobj_cancel;
+               pmemobj_set_user_data;
+               pmemobj_get_user_data;
+               pmemobj_defrag;
+               _pobj_cached_pool;
+               _pobj_cache_invalidate;
+               _pobj_debug_notice;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.rc b/ceph/src/pmdk/src/libpmemobj/libpmemobj.rc
new file mode 100644 (file)
index 0000000..fae9e2d
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016, Intel Corporation */
+
+/*
+ * libpmemobj.rc -- libpmemobj resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemobj.dll"
+#define DESCRIPTION "libpmemobj - persistent memory transactional object store"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj b/ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj
new file mode 100644 (file)
index 0000000..8f627bb
--- /dev/null
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemobj\bucket.c" />
+    <ClCompile Include="..\..\src\libpmemobj\critnib.c" />
+    <ClCompile Include="..\..\src\libpmemobj\ctl_debug.c" />
+    <ClCompile Include="..\..\src\libpmemobj\heap.c" />
+    <ClCompile Include="..\..\src\libpmemobj\lane.c" />
+    <ClCompile Include="..\..\src\libpmemobj\libpmemobj.c" />
+    <ClCompile Include="..\..\src\libpmemobj\list.c" />
+    <ClCompile Include="..\..\src\libpmemobj\memops.c" />
+    <ClCompile Include="..\..\src\libpmemobj\obj.c" />
+    <ClCompile Include="..\..\src\libpmemobj\palloc.c" />
+    <ClCompile Include="..\..\src\libpmemobj\pmalloc.c" />
+    <ClCompile Include="..\common\ravl.c" />
+    <ClCompile Include="..\..\src\libpmemobj\ulog.c" />
+    <ClCompile Include="..\..\src\libpmemobj\sync.c" />
+    <ClCompile Include="..\..\src\libpmemobj\tx.c" />
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\common\set_badblocks.c" />
+    <ClCompile Include="..\common\bad_blocks.c" />
+    <ClCompile Include="..\common\ctl.c" />
+    <ClCompile Include="..\common\ctl_cow.c" />
+    <ClCompile Include="..\common\ctl_prefault.c" />
+    <ClCompile Include="..\common\ctl_sds.c" />
+    <ClCompile Include="..\common\ctl_fallocate.c" />
+    <ClCompile Include="..\common\file.c" />
+    <ClCompile Include="..\common\file_windows.c" />
+    <ClCompile Include="..\core\fs_windows.c" />
+    <ClCompile Include="..\common\mmap.c" />
+    <ClCompile Include="..\common\mmap_windows.c" />
+    <ClCompile Include="..\common\os_deep_windows.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\pool_hdr.c" />
+    <ClCompile Include="..\common\set.c" />
+    <ClCompile Include="..\common\shutdown_state.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="..\common\uuid.c" />
+    <ClCompile Include="..\common\uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem2\badblocks.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\libpmem2\usc_windows.c" />
+    <ClCompile Include="alloc_class.c" />
+    <ClCompile Include="container_ravl.c" />
+    <ClCompile Include="container_seglists.c" />
+    <ClCompile Include="libpmemobj_main.c" />
+    <ClCompile Include="memblock.c" />
+    <ClCompile Include="recycler.c" />
+    <ClCompile Include="stats.c" />
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h" />
+    <ClInclude Include="..\..\src\core\util.h" />
+    <ClInclude Include="..\..\src\common\valgrind_internal.h" />
+    <ClInclude Include="..\..\src\include\libpmemobj.h" />
+    <ClInclude Include="..\..\src\libpmemobj\bucket.h" />
+    <ClInclude Include="..\..\src\libpmemobj\critnib.h" />
+    <ClInclude Include="..\..\src\libpmemobj\ctl_debug.h" />
+    <ClInclude Include="..\..\src\libpmemobj\heap.h" />
+    <ClInclude Include="..\..\src\libpmemobj\heap_layout.h" />
+    <ClInclude Include="..\..\src\libpmemobj\lane.h" />
+    <ClInclude Include="..\..\src\libpmemobj\list.h" />
+    <ClInclude Include="..\..\src\libpmemobj\memops.h" />
+    <ClInclude Include="..\..\src\libpmemobj\obj.h" />
+    <ClInclude Include="..\..\src\libpmemobj\palloc.h" />
+    <ClInclude Include="..\..\src\libpmemobj\pmalloc.h" />
+    <ClInclude Include="..\..\src\libpmemobj\pmemops.h" />
+    <ClInclude Include="..\..\src\libpmemobj\redo.h" />
+    <ClInclude Include="..\common\ravl.h" />
+    <ClInclude Include="..\core\alloc.h" />
+    <ClInclude Include="..\common\ctl.h" />
+    <ClInclude Include="..\common\ctl_global.h" />
+    <ClInclude Include="..\common\dlsym.h" />
+    <ClInclude Include="..\core\fault_injection.h" />
+    <ClInclude Include="..\common\file.h" />
+    <ClInclude Include="..\core\fs.h" />
+    <ClInclude Include="..\common\mmap.h" />
+    <ClInclude Include="..\core\os.h" />
+    <ClInclude Include="..\common\os_deep.h" />
+    <ClInclude Include="..\core\os_thread.h" />
+    <ClInclude Include="..\common\pmemcommon.h" />
+    <ClInclude Include="..\common\pool_hdr.h" />
+    <ClInclude Include="..\common\queue.h" />
+    <ClInclude Include="..\common\set.h" />
+    <ClInclude Include="..\common\sys_util.h" />
+    <ClInclude Include="..\common\uuid.h" />
+    <ClInclude Include="..\include\libpmemobj\action.h" />
+    <ClInclude Include="..\include\libpmemobj\action_base.h" />
+    <ClInclude Include="..\include\libpmemobj\atomic.h" />
+    <ClInclude Include="..\include\libpmemobj\atomic_base.h" />
+    <ClInclude Include="..\include\libpmemobj\base.h" />
+    <ClInclude Include="..\include\libpmemobj\iterator.h" />
+    <ClInclude Include="..\include\libpmemobj\iterator_base.h" />
+    <ClInclude Include="..\include\libpmemobj\lists_atomic.h" />
+    <ClInclude Include="..\include\libpmemobj\lists_atomic_base.h" />
+    <ClInclude Include="..\include\libpmemobj\pool.h" />
+    <ClInclude Include="..\include\libpmemobj\pool_base.h" />
+    <ClInclude Include="..\include\libpmemobj\thread.h" />
+    <ClInclude Include="..\include\libpmemobj\tx.h" />
+    <ClInclude Include="..\include\libpmemobj\tx_base.h" />
+    <ClInclude Include="..\include\libpmemobj\types.h" />
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="alloc_class.h" />
+    <ClInclude Include="container.h" />
+    <ClInclude Include="container_ravl.h" />
+    <ClInclude Include="container_seglists.h" />
+    <ClInclude Include="memblock.h" />
+    <ClInclude Include="recycler.h" />
+    <ClInclude Include="stats.h" />
+    <ClInclude Include="sync.h" />
+    <ClInclude Include="tx.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemobj.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\libpmem\libpmem.vcxproj">
+      <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemobj.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{1BAA1617-93AE-4196-8A1A-BD492FB18AEF}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmemobj</ProjectName>
+    <RootNamespace>libpmemobj</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj.filters b/ceph/src/pmdk/src/libpmemobj/libpmemobj.vcxproj.filters
new file mode 100644 (file)
index 0000000..e32a538
--- /dev/null
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="..\..\src\libpmemobj\bucket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\critnib.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\ctl_debug.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\heap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\lane.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\libpmemobj.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\list.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\memops.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\obj.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\palloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\pmalloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\ulog.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\sync.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\libpmemobj\tx.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set_badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\shutdown_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="alloc_class.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="container_ravl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="container_seglists.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmemobj_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="memblock.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="recycler.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="stats.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_prefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_sds.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_fallocate.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ctl_cow.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\ravl.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\core\out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\core\util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\common\valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\include\libpmemobj.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\bucket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\critnib.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\ctl_debug.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\heap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\heap_layout.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\lane.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\list.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\memops.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\obj.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\palloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\pmalloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\pmemops.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\libpmemobj\redo.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ctl_global.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os_thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pmemcommon.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\queue.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\action.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\action_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\atomic.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\atomic_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\iterator.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\iterator_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\lists_atomic.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\lists_atomic_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\pool.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\pool_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\thread.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\tx.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\tx_base.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmemobj\types.h">
+      <Filter>Header Files\libpmemobj</Filter>
+    </ClInclude>
+    <ClInclude Include="alloc_class.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="container.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="container_ravl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="container_seglists.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="memblock.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="recycler.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="stats.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="sync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="tx.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\ravl.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{73806be6-053a-4dfd-92de-956b0480b5d9}</UniqueIdentifier>
+      <Extensions>h</Extensions>
+    </Filter>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{60288a68-9214-4faa-b5c4-bf33b1020120}</UniqueIdentifier>
+      <Extensions>c;def</Extensions>
+    </Filter>
+    <Filter Include="Header Files\libpmemobj">
+      <UniqueIdentifier>{ab47d7d2-14e7-4ab2-af19-e7cf10e43fbf}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmemobj.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmemobj.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmemobj/libpmemobj_main.c b/ceph/src/pmdk/src/libpmemobj/libpmemobj_main.c
new file mode 100644 (file)
index 0000000..cf5bdae
--- /dev/null
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2017, Intel Corporation */
+
+/*
+ * libpmemobj_main.c -- entry point for libpmemobj.dll
+ *
+ * XXX - This is a placeholder.  All the library initialization/cleanup
+ * that is done in library ctors/dtors, as well as TLS initialization
+ * should be moved here.
+ */
+
+void libpmemobj_init(void);
+void libpmemobj_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmemobj_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               libpmemobj_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/list.c b/ceph/src/pmdk/src/libpmemobj/list.c
new file mode 100644 (file)
index 0000000..9eb1b70
--- /dev/null
@@ -0,0 +1,939 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2019, Intel Corporation */
+
+/*
+ * list.c -- implementation of persistent atomic lists module
+ */
+#include <inttypes.h>
+
+#include "list.h"
+#include "obj.h"
+#include "os_thread.h"
+#include "out.h"
+#include "sync.h"
+#include "valgrind_internal.h"
+#include "memops.h"
+
+#define PREV_OFF (offsetof(struct list_entry, pe_prev) + offsetof(PMEMoid, off))
+#define NEXT_OFF (offsetof(struct list_entry, pe_next) + offsetof(PMEMoid, off))
+
+/*
+ * list_args_common -- common arguments for operations on list
+ *
+ * pe_offset    - offset to list entry relative to user data
+ * obj_doffset  - offset to element's data relative to pmemobj pool
+ * entry_ptr    - list entry structure of element
+ */
+struct list_args_common {
+       ssize_t pe_offset;
+       uint64_t obj_doffset;
+       struct list_entry *entry_ptr;
+};
+
+/*
+ * list_args_insert -- arguments for inserting element to list
+ *
+ * head           - list head
+ * dest           - destination element OID
+ * dest_entry_ptr - list entry of destination element
+ * before         - insert before or after destination element
+ */
+struct list_args_insert {
+       struct list_head *head;
+       PMEMoid dest;
+       struct list_entry *dest_entry_ptr;
+       int before;
+};
+
+/*
+ * list_args_reinsert -- arguments for reinserting element on list
+ *
+ * head         - list head
+ * entry_ptr    - list entry of old element
+ * obj_doffset  - offset to element's data relative to pmemobj pool
+ */
+struct list_args_reinsert {
+       struct list_head *head;
+       struct list_entry *entry_ptr;
+       uint64_t obj_doffset;
+};
+
+/*
+ * list_args_remove -- arguments for removing element from list
+ *
+ * pe_offset    - offset to list entry relative to user data
+ * obj_doffset  - offset to element's data relative to pmemobj pool
+ * head         - list head
+ * entry_ptr    - list entry structure of element
+ */
+struct list_args_remove {
+       ssize_t pe_offset;
+       uint64_t obj_doffset;
+       struct list_head *head;
+       struct list_entry *entry_ptr;
+};
+
+/*
+ * list_mutexes_lock -- (internal) grab one or two locks in ascending
+ * address order
+ */
+static inline int
+list_mutexes_lock(PMEMobjpool *pop,
+       struct list_head *head1, struct list_head *head2)
+{
+       ASSERTne(head1, NULL);
+
+       if (!head2 || head1 == head2)
+               return pmemobj_mutex_lock(pop, &head1->lock);
+
+       PMEMmutex *lock1;
+       PMEMmutex *lock2;
+       if ((uintptr_t)&head1->lock < (uintptr_t)&head2->lock) {
+               lock1 = &head1->lock;
+               lock2 = &head2->lock;
+       } else {
+               lock1 = &head2->lock;
+               lock2 = &head1->lock;
+       }
+
+       int ret;
+       if ((ret = pmemobj_mutex_lock(pop, lock1)))
+               goto err;
+       if ((ret = pmemobj_mutex_lock(pop, lock2)))
+               goto err_unlock;
+
+       return 0;
+
+err_unlock:
+       pmemobj_mutex_unlock(pop, lock1);
+err:
+       return ret;
+}
+
+/*
+ * list_mutexes_unlock -- (internal) release one or two locks
+ */
+static inline void
+list_mutexes_unlock(PMEMobjpool *pop,
+       struct list_head *head1, struct list_head *head2)
+{
+       ASSERTne(head1, NULL);
+
+       if (!head2 || head1 == head2) {
+               pmemobj_mutex_unlock_nofail(pop, &head1->lock);
+               return;
+       }
+
+       pmemobj_mutex_unlock_nofail(pop, &head1->lock);
+       pmemobj_mutex_unlock_nofail(pop, &head2->lock);
+}
+
+/*
+ * list_get_dest -- (internal) return destination object ID
+ *
+ * If the input dest is not OID_NULL returns dest.
+ * If the input dest is OID_NULL and before is set returns first element.
+ * If the input dest is OID_NULL and before is no set returns last element.
+ */
+static inline PMEMoid
+list_get_dest(PMEMobjpool *pop, struct list_head *head, PMEMoid dest,
+               ssize_t pe_offset, int before)
+{
+       if (dest.off)
+               return dest;
+
+       if (head->pe_first.off == 0 || !!before == POBJ_LIST_DEST_HEAD)
+               return head->pe_first;
+
+       struct list_entry *first_ptr = (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                       (uintptr_t)((ssize_t)head->pe_first.off + pe_offset));
+
+       return first_ptr->pe_prev;
+}
+
+/*
+ * list_set_oid_redo_log -- (internal) set PMEMoid value using redo log
+ */
+static size_t
+list_set_oid_redo_log(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       PMEMoid *oidp, uint64_t obj_doffset, int oidp_inited)
+{
+       ASSERT(OBJ_PTR_IS_VALID(pop, oidp));
+
+       if (!oidp_inited || oidp->pool_uuid_lo != pop->uuid_lo) {
+               if (oidp_inited)
+                       ASSERTeq(oidp->pool_uuid_lo, 0);
+
+               operation_add_entry(ctx, &oidp->pool_uuid_lo, pop->uuid_lo,
+                       ULOG_OPERATION_SET);
+       }
+
+       operation_add_entry(ctx, &oidp->off, obj_doffset,
+               ULOG_OPERATION_SET);
+       return 0;
+}
+
+/*
+ * list_update_head -- (internal) update pe_first entry in list head
+ */
+static size_t
+list_update_head(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_head *head, uint64_t first_offset)
+{
+       LOG(15, NULL);
+
+       operation_add_entry(ctx, &head->pe_first.off, first_offset,
+               ULOG_OPERATION_SET);
+
+       if (head->pe_first.pool_uuid_lo == 0) {
+               operation_add_entry(ctx, &head->pe_first.pool_uuid_lo,
+                       pop->uuid_lo, ULOG_OPERATION_SET);
+       }
+
+       return 0;
+}
+
+/*
+ * u64_add_offset -- (internal) add signed offset to unsigned integer and check
+ * for overflows
+ */
+static void
+u64_add_offset(uint64_t *value, ssize_t off)
+{
+       uint64_t prev = *value;
+       if (off >= 0) {
+               *value += (size_t)off;
+               ASSERT(*value >= prev); /* detect overflow */
+       } else {
+               *value -= (size_t)-off;
+               ASSERT(*value < prev);
+       }
+}
+
+/*
+ * list_fill_entry_persist -- (internal) fill new entry using persist function
+ *
+ * Used for newly allocated objects.
+ */
+static void
+list_fill_entry_persist(PMEMobjpool *pop, struct list_entry *entry_ptr,
+               uint64_t next_offset, uint64_t prev_offset)
+{
+       LOG(15, NULL);
+
+       VALGRIND_ADD_TO_TX(entry_ptr, sizeof(*entry_ptr));
+       entry_ptr->pe_next.pool_uuid_lo = pop->uuid_lo;
+       entry_ptr->pe_next.off = next_offset;
+
+       entry_ptr->pe_prev.pool_uuid_lo = pop->uuid_lo;
+       entry_ptr->pe_prev.off = prev_offset;
+       VALGRIND_REMOVE_FROM_TX(entry_ptr, sizeof(*entry_ptr));
+
+       pmemops_persist(&pop->p_ops, entry_ptr, sizeof(*entry_ptr));
+}
+
+/*
+ * list_fill_entry_redo_log -- (internal) fill new entry using redo log
+ *
+ * Used to update entry in existing object.
+ */
+static size_t
+list_fill_entry_redo_log(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_args_common *args,
+       uint64_t next_offset, uint64_t prev_offset, int set_uuid)
+{
+       LOG(15, NULL);
+       struct pmem_ops *ops = &pop->p_ops;
+
+       ASSERTne(args->entry_ptr, NULL);
+       ASSERTne(args->obj_doffset, 0);
+
+       if (set_uuid) {
+               VALGRIND_ADD_TO_TX(&(args->entry_ptr->pe_next.pool_uuid_lo),
+                               sizeof(args->entry_ptr->pe_next.pool_uuid_lo));
+               VALGRIND_ADD_TO_TX(&(args->entry_ptr->pe_prev.pool_uuid_lo),
+                               sizeof(args->entry_ptr->pe_prev.pool_uuid_lo));
+               /* don't need to fill pool uuid using redo log */
+               args->entry_ptr->pe_next.pool_uuid_lo = pop->uuid_lo;
+               args->entry_ptr->pe_prev.pool_uuid_lo = pop->uuid_lo;
+               VALGRIND_REMOVE_FROM_TX(
+                               &(args->entry_ptr->pe_next.pool_uuid_lo),
+                               sizeof(args->entry_ptr->pe_next.pool_uuid_lo));
+               VALGRIND_REMOVE_FROM_TX(
+                               &(args->entry_ptr->pe_prev.pool_uuid_lo),
+                               sizeof(args->entry_ptr->pe_prev.pool_uuid_lo));
+               pmemops_persist(ops, args->entry_ptr, sizeof(*args->entry_ptr));
+       } else {
+               ASSERTeq(args->entry_ptr->pe_next.pool_uuid_lo, pop->uuid_lo);
+               ASSERTeq(args->entry_ptr->pe_prev.pool_uuid_lo, pop->uuid_lo);
+       }
+
+       /* set current->next and current->prev using redo log */
+       uint64_t next_off_off = args->obj_doffset + NEXT_OFF;
+       uint64_t prev_off_off = args->obj_doffset + PREV_OFF;
+       u64_add_offset(&next_off_off, args->pe_offset);
+       u64_add_offset(&prev_off_off, args->pe_offset);
+       void *next_ptr = (char *)pop + next_off_off;
+       void *prev_ptr = (char *)pop + prev_off_off;
+
+       operation_add_entry(ctx, next_ptr, next_offset, ULOG_OPERATION_SET);
+       operation_add_entry(ctx, prev_ptr, prev_offset, ULOG_OPERATION_SET);
+
+       return 0;
+}
+
+/*
+ * list_remove_single -- (internal) remove element from single list
+ */
+static size_t
+list_remove_single(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_args_remove *args)
+{
+       LOG(15, NULL);
+
+       if (args->entry_ptr->pe_next.off == args->obj_doffset) {
+               /* only one element on list */
+               ASSERTeq(args->head->pe_first.off, args->obj_doffset);
+               ASSERTeq(args->entry_ptr->pe_prev.off, args->obj_doffset);
+
+               return list_update_head(pop, ctx, args->head, 0);
+       } else {
+               /* set next->prev = prev and prev->next = next */
+               uint64_t next_off = args->entry_ptr->pe_next.off;
+               uint64_t next_prev_off = next_off + PREV_OFF;
+               u64_add_offset(&next_prev_off, args->pe_offset);
+               uint64_t prev_off = args->entry_ptr->pe_prev.off;
+               uint64_t prev_next_off = prev_off + NEXT_OFF;
+               u64_add_offset(&prev_next_off, args->pe_offset);
+
+               void *prev_ptr = (char *)pop + next_prev_off;
+               void *next_ptr = (char *)pop + prev_next_off;
+
+               operation_add_entry(ctx, prev_ptr, prev_off,
+                       ULOG_OPERATION_SET);
+               operation_add_entry(ctx, next_ptr, next_off,
+                       ULOG_OPERATION_SET);
+
+               if (args->head->pe_first.off == args->obj_doffset) {
+                       /* removing element is the first one */
+                       return list_update_head(pop, ctx,
+                                       args->head, next_off);
+               } else {
+                       return 0;
+               }
+       }
+}
+
+/*
+ * list_insert_before -- (internal) insert element at offset before an element
+ */
+static size_t
+list_insert_before(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_args_insert *args, struct list_args_common *args_common,
+       uint64_t *next_offset, uint64_t *prev_offset)
+{
+       LOG(15, NULL);
+
+       /* current->next = dest and current->prev = dest->prev */
+       *next_offset = args->dest.off;
+       *prev_offset = args->dest_entry_ptr->pe_prev.off;
+
+       /* dest->prev = current and dest->prev->next = current */
+       uint64_t dest_prev_off = args->dest.off + PREV_OFF;
+       u64_add_offset(&dest_prev_off, args_common->pe_offset);
+       uint64_t dest_prev_next_off = args->dest_entry_ptr->pe_prev.off +
+                                       NEXT_OFF;
+       u64_add_offset(&dest_prev_next_off, args_common->pe_offset);
+
+       void *dest_prev_ptr = (char *)pop + dest_prev_off;
+       void *dest_prev_next_ptr = (char *)pop + dest_prev_next_off;
+       operation_add_entry(ctx, dest_prev_ptr, args_common->obj_doffset,
+               ULOG_OPERATION_SET);
+       operation_add_entry(ctx, dest_prev_next_ptr, args_common->obj_doffset,
+               ULOG_OPERATION_SET);
+
+       return 0;
+}
+
+/*
+ * list_insert_after -- (internal) insert element at offset after an element
+ */
+static size_t
+list_insert_after(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_args_insert *args, struct list_args_common *args_common,
+       uint64_t *next_offset, uint64_t *prev_offset)
+{
+       LOG(15, NULL);
+
+       /* current->next = dest->next and current->prev = dest */
+       *next_offset = args->dest_entry_ptr->pe_next.off;
+       *prev_offset = args->dest.off;
+
+       /* dest->next = current and dest->next->prev = current */
+       uint64_t dest_next_off = args->dest.off + NEXT_OFF;
+       u64_add_offset(&dest_next_off, args_common->pe_offset);
+       uint64_t dest_next_prev_off = args->dest_entry_ptr->pe_next.off +
+                                       PREV_OFF;
+       u64_add_offset(&dest_next_prev_off, args_common->pe_offset);
+
+       void *dest_next_ptr = (char *)pop + dest_next_off;
+       void *dest_next_prev_ptr = (char *)pop + dest_next_prev_off;
+       operation_add_entry(ctx, dest_next_ptr, args_common->obj_doffset,
+               ULOG_OPERATION_SET);
+       operation_add_entry(ctx, dest_next_prev_ptr, args_common->obj_doffset,
+               ULOG_OPERATION_SET);
+
+       return 0;
+}
+
+/*
+ * list_insert_user -- (internal) insert element at offset to a user list
+ */
+static size_t
+list_insert_user(PMEMobjpool *pop,
+       struct operation_context *ctx,
+       struct list_args_insert *args, struct list_args_common *args_common,
+       uint64_t *next_offset, uint64_t *prev_offset)
+{
+       LOG(15, NULL);
+       if (args->dest.off == 0) {
+               /* inserting the first element on list */
+               ASSERTeq(args->head->pe_first.off, 0);
+
+               /* set loop on current element */
+               *next_offset = args_common->obj_doffset;
+               *prev_offset = args_common->obj_doffset;
+
+               /* update head */
+               list_update_head(pop, ctx, args->head,
+                       args_common->obj_doffset);
+       } else {
+               if (args->before) {
+                       /* inserting before dest */
+                       list_insert_before(pop, ctx, args, args_common,
+                               next_offset, prev_offset);
+
+                       if (args->dest.off == args->head->pe_first.off) {
+                               /* current element at first position */
+                               list_update_head(pop, ctx, args->head,
+                                       args_common->obj_doffset);
+                       }
+               } else {
+                       /* inserting after dest */
+                       list_insert_after(pop, ctx, args, args_common,
+                               next_offset, prev_offset);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * list_insert_new -- allocate and insert element to oob and user lists
+ *
+ * pop         - pmemobj pool handle
+ * pe_offset   - offset to list entry on user list relative to user data
+ * user_head   - user list head, must be locked if not NULL
+ * dest        - destination on user list
+ * before      - insert before/after destination on user list
+ * size        - size of allocation, will be increased by OBJ_OOB_SIZE
+ * constructor - object's constructor
+ * arg         - argument for object's constructor
+ * oidp        - pointer to target object ID
+ */
+static int
+list_insert_new(PMEMobjpool *pop,
+       size_t pe_offset, struct list_head *user_head, PMEMoid dest, int before,
+       size_t size, uint64_t type_num, int (*constructor)(void *ctx, void *ptr,
+       size_t usable_size, void *arg), void *arg, PMEMoid *oidp)
+{
+       LOG(3, NULL);
+       ASSERT(user_head != NULL);
+
+       int ret;
+
+#ifdef DEBUG
+       int r = pmemobj_mutex_assert_locked(pop, &user_head->lock);
+       ASSERTeq(r, 0);
+#endif
+       struct lane *lane;
+       lane_hold(pop, &lane);
+
+       struct pobj_action reserved;
+       if (palloc_reserve(&pop->heap, size, constructor, arg,
+               type_num, 0, 0, 0, &reserved) != 0) {
+               ERR("!palloc_reserve");
+               ret = -1;
+               goto err_pmalloc;
+       }
+       uint64_t obj_doffset = reserved.heap.offset;
+
+       struct operation_context *ctx = lane->external;
+       operation_start(ctx);
+
+       ASSERT((ssize_t)pe_offset >= 0);
+
+       dest = list_get_dest(pop, user_head, dest,
+               (ssize_t)pe_offset, before);
+
+       struct list_entry *entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               obj_doffset + pe_offset);
+
+       struct list_entry *dest_entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               dest.off + pe_offset);
+
+       struct list_args_insert args = {
+               .dest = dest,
+               .dest_entry_ptr = dest_entry_ptr,
+               .head = user_head,
+               .before = before,
+       };
+
+       struct list_args_common args_common = {
+               .obj_doffset = obj_doffset,
+               .entry_ptr = entry_ptr,
+               .pe_offset = (ssize_t)pe_offset,
+       };
+
+       uint64_t next_offset;
+       uint64_t prev_offset;
+
+       /* insert element to user list */
+       list_insert_user(pop,
+               ctx, &args, &args_common,
+               &next_offset, &prev_offset);
+
+       /* don't need to use redo log for filling new element */
+       list_fill_entry_persist(pop, entry_ptr,
+                       next_offset, prev_offset);
+
+       if (oidp != NULL) {
+               if (OBJ_PTR_IS_VALID(pop, oidp)) {
+                       list_set_oid_redo_log(pop, ctx,
+                               oidp, obj_doffset, 0);
+               } else {
+                       oidp->off = obj_doffset;
+                       oidp->pool_uuid_lo = pop->uuid_lo;
+               }
+       }
+
+       palloc_publish(&pop->heap, &reserved, 1, ctx);
+
+       ret = 0;
+
+err_pmalloc:
+       lane_release(pop);
+
+       ASSERT(ret == 0 || ret == -1);
+       return ret;
+}
+
+/*
+ * list_insert_new_user -- allocate and insert element to oob and user lists
+ *
+ * pop         - pmemobj pool handle
+ * oob_head    - oob list head
+ * pe_offset   - offset to list entry on user list relative to user data
+ * user_head   - user list head
+ * dest        - destination on user list
+ * before      - insert before/after destination on user list
+ * size        - size of allocation, will be increased by OBJ_OOB_SIZE
+ * constructor - object's constructor
+ * arg         - argument for object's constructor
+ * oidp        - pointer to target object ID
+ */
+int
+list_insert_new_user(PMEMobjpool *pop,
+       size_t pe_offset, struct list_head *user_head, PMEMoid dest, int before,
+       size_t size, uint64_t type_num, int (*constructor)(void *ctx, void *ptr,
+       size_t usable_size, void *arg), void *arg, PMEMoid *oidp)
+{
+       int ret;
+       if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) {
+               errno = ret;
+               LOG(2, "pmemobj_mutex_lock failed");
+               return -1;
+       }
+
+       ret = list_insert_new(pop, pe_offset, user_head,
+                       dest, before, size, type_num, constructor, arg, oidp);
+
+       pmemobj_mutex_unlock_nofail(pop, &user_head->lock);
+
+       ASSERT(ret == 0 || ret == -1);
+       return ret;
+}
+
+/*
+ * list_insert -- insert object to a single list
+ *
+ * pop          - pmemobj handle
+ * pe_offset    - offset to list entry on user list relative to user data
+ * head         - list head
+ * dest         - destination object ID
+ * before       - before/after destination
+ * oid          - target object ID
+ */
+int
+list_insert(PMEMobjpool *pop,
+       ssize_t pe_offset, struct list_head *head,
+       PMEMoid dest, int before,
+       PMEMoid oid)
+{
+       LOG(3, NULL);
+       ASSERTne(head, NULL);
+
+       struct lane *lane;
+       lane_hold(pop, &lane);
+
+       int ret;
+
+       if ((ret = pmemobj_mutex_lock(pop, &head->lock))) {
+               errno = ret;
+               LOG(2, "pmemobj_mutex_lock failed");
+               ret = -1;
+               goto err;
+       }
+
+       struct operation_context *ctx = lane->external;
+       operation_start(ctx);
+
+       dest = list_get_dest(pop, head, dest, pe_offset, before);
+
+       struct list_entry *entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                       (uintptr_t)((ssize_t)oid.off + pe_offset));
+
+       struct list_entry *dest_entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                       (uintptr_t)((ssize_t)dest.off + pe_offset));
+
+       struct list_args_insert args = {
+               .dest = dest,
+               .dest_entry_ptr = dest_entry_ptr,
+               .head = head,
+               .before = before,
+       };
+
+       struct list_args_common args_common = {
+               .obj_doffset = oid.off,
+               .entry_ptr = entry_ptr,
+               .pe_offset = (ssize_t)pe_offset,
+       };
+
+       uint64_t next_offset;
+       uint64_t prev_offset;
+
+       /* insert element to user list */
+       list_insert_user(pop, ctx,
+                       &args, &args_common, &next_offset, &prev_offset);
+
+       /* fill entry of existing element using redo log */
+       list_fill_entry_redo_log(pop, ctx,
+                       &args_common, next_offset, prev_offset, 1);
+
+       operation_process(ctx);
+       operation_finish(ctx, 0);
+
+       pmemobj_mutex_unlock_nofail(pop, &head->lock);
+err:
+       lane_release(pop);
+
+       ASSERT(ret == 0 || ret == -1);
+       return ret;
+}
+
+/*
+ * list_remove_free -- remove from two lists and free an object
+ *
+ * pop         - pmemobj pool handle
+ * oob_head    - oob list head
+ * pe_offset   - offset to list entry on user list relative to user data
+ * user_head   - user list head, *must* be locked if not NULL
+ * oidp        - pointer to target object ID
+ */
+static void
+list_remove_free(PMEMobjpool *pop, size_t pe_offset,
+       struct list_head *user_head, PMEMoid *oidp)
+{
+       LOG(3, NULL);
+       ASSERT(user_head != NULL);
+
+#ifdef DEBUG
+       int r = pmemobj_mutex_assert_locked(pop, &user_head->lock);
+       ASSERTeq(r, 0);
+#endif
+
+       struct lane *lane;
+       lane_hold(pop, &lane);
+       struct operation_context *ctx = lane->external;
+       operation_start(ctx);
+
+       struct pobj_action deferred;
+       palloc_defer_free(&pop->heap, oidp->off, &deferred);
+       uint64_t obj_doffset = oidp->off;
+
+       ASSERT((ssize_t)pe_offset >= 0);
+
+       struct list_entry *entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               obj_doffset + pe_offset);
+
+       struct list_args_remove args = {
+               .pe_offset = (ssize_t)pe_offset,
+               .head = user_head,
+               .entry_ptr = entry_ptr,
+               .obj_doffset = obj_doffset
+       };
+
+       /* remove from user list */
+       list_remove_single(pop, ctx, &args);
+
+       /* clear the oid */
+       if (OBJ_PTR_IS_VALID(pop, oidp))
+               list_set_oid_redo_log(pop, ctx, oidp, 0, 1);
+       else
+               oidp->off = 0;
+
+       palloc_publish(&pop->heap, &deferred, 1, ctx);
+
+       lane_release(pop);
+}
+
+/*
+ * list_remove_free_user -- remove from two lists and free an object
+ *
+ * pop         - pmemobj pool handle
+ * oob_head    - oob list head
+ * pe_offset   - offset to list entry on user list relative to user data
+ * user_head   - user list head
+ * oidp        - pointer to target object ID
+ */
+int
+list_remove_free_user(PMEMobjpool *pop, size_t pe_offset,
+       struct list_head *user_head, PMEMoid *oidp)
+{
+       LOG(3, NULL);
+
+       int ret;
+       if ((ret = pmemobj_mutex_lock(pop, &user_head->lock))) {
+               errno = ret;
+               LOG(2, "pmemobj_mutex_lock failed");
+               return -1;
+       }
+
+       list_remove_free(pop, pe_offset, user_head, oidp);
+
+       pmemobj_mutex_unlock_nofail(pop, &user_head->lock);
+
+       return 0;
+}
+
+/*
+ * list_remove -- remove object from list
+ *
+ * pop          - pmemobj handle
+ * pe_offset    - offset to list entry on user list relative to user data
+ * head         - list head
+ * oid          - target object ID
+ */
+int
+list_remove(PMEMobjpool *pop,
+       ssize_t pe_offset, struct list_head *head,
+       PMEMoid oid)
+{
+       LOG(3, NULL);
+       ASSERTne(head, NULL);
+
+       int ret;
+
+       struct lane *lane;
+       lane_hold(pop, &lane);
+
+       if ((ret = pmemobj_mutex_lock(pop, &head->lock))) {
+               errno = ret;
+               LOG(2, "pmemobj_mutex_lock failed");
+               ret = -1;
+               goto err;
+       }
+
+       struct operation_context *ctx = lane->external;
+       operation_start(ctx);
+
+       struct list_entry *entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               oid.off + (size_t)pe_offset);
+
+       struct list_args_remove args = {
+               .pe_offset = (ssize_t)pe_offset,
+               .head = head,
+               .entry_ptr = entry_ptr,
+               .obj_doffset = oid.off,
+       };
+
+       struct list_args_common args_common = {
+               .obj_doffset = oid.off,
+               .entry_ptr = entry_ptr,
+               .pe_offset = (ssize_t)pe_offset,
+       };
+
+       /* remove element from user list */
+       list_remove_single(pop, ctx, &args);
+
+       /* clear next and prev offsets in removing element using redo log */
+       list_fill_entry_redo_log(pop, ctx,
+                       &args_common, 0, 0, 0);
+
+       operation_process(ctx);
+       operation_finish(ctx, 0);
+
+       pmemobj_mutex_unlock_nofail(pop, &head->lock);
+err:
+       lane_release(pop);
+
+       ASSERT(ret == 0 || ret == -1);
+       return ret;
+}
+
+/*
+ * list_move -- move object between two lists
+ *
+ * pop           - pmemobj handle
+ * pe_offset_old - offset to old list entry relative to user data
+ * head_old      - old list head
+ * pe_offset_new - offset to new list entry relative to user data
+ * head_new      - new list head
+ * dest          - destination object ID
+ * before        - before/after destination
+ * oid           - target object ID
+ */
+int
+list_move(PMEMobjpool *pop,
+       size_t pe_offset_old, struct list_head *head_old,
+       size_t pe_offset_new, struct list_head *head_new,
+       PMEMoid dest, int before, PMEMoid oid)
+{
+       LOG(3, NULL);
+       ASSERTne(head_old, NULL);
+       ASSERTne(head_new, NULL);
+
+       int ret;
+
+       struct lane *lane;
+       lane_hold(pop, &lane);
+
+       /*
+        * Grab locks in specified order to avoid dead-locks.
+        *
+        * XXX performance improvement: initialize oob locks at pool opening
+        */
+       if ((ret = list_mutexes_lock(pop, head_new, head_old))) {
+               errno = ret;
+               LOG(2, "list_mutexes_lock failed");
+               ret = -1;
+               goto err;
+       }
+
+       struct operation_context *ctx = lane->external;
+       operation_start(ctx);
+
+       dest = list_get_dest(pop, head_new, dest,
+               (ssize_t)pe_offset_new, before);
+
+       struct list_entry *entry_ptr_old =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               oid.off + pe_offset_old);
+
+       struct list_entry *entry_ptr_new =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               oid.off + pe_offset_new);
+
+       struct list_entry *dest_entry_ptr =
+               (struct list_entry *)OBJ_OFF_TO_PTR(pop,
+                               dest.off + pe_offset_new);
+
+       if (head_old == head_new) {
+               /* moving within the same list */
+
+               if (dest.off == oid.off)
+                       goto unlock;
+
+               if (before && dest_entry_ptr->pe_prev.off == oid.off) {
+                       if (head_old->pe_first.off != dest.off)
+                               goto unlock;
+
+                       list_update_head(pop, ctx,
+                                       head_old, oid.off);
+
+                       goto redo_last;
+               }
+
+               if (!before && dest_entry_ptr->pe_next.off == oid.off) {
+                       if (head_old->pe_first.off != oid.off)
+                               goto unlock;
+
+                       list_update_head(pop, ctx,
+                                       head_old, entry_ptr_old->pe_next.off);
+
+                       goto redo_last;
+               }
+       }
+
+       ASSERT((ssize_t)pe_offset_old >= 0);
+       struct list_args_remove args_remove = {
+               .pe_offset = (ssize_t)pe_offset_old,
+               .head = head_old,
+               .entry_ptr = entry_ptr_old,
+               .obj_doffset = oid.off,
+       };
+
+       struct list_args_insert args_insert = {
+               .head = head_new,
+               .dest = dest,
+               .dest_entry_ptr = dest_entry_ptr,
+               .before = before,
+       };
+
+       ASSERT((ssize_t)pe_offset_new >= 0);
+       struct list_args_common args_common = {
+               .obj_doffset = oid.off,
+               .entry_ptr = entry_ptr_new,
+               .pe_offset = (ssize_t)pe_offset_new,
+       };
+
+       uint64_t next_offset;
+       uint64_t prev_offset;
+
+       /* remove element from user list */
+       list_remove_single(pop, ctx, &args_remove);
+
+       /* insert element to user list */
+       list_insert_user(pop, ctx, &args_insert,
+                       &args_common, &next_offset, &prev_offset);
+
+       /* offsets differ, move is between different list entries - set uuid */
+       int set_uuid = pe_offset_new != pe_offset_old ? 1 : 0;
+
+       /* fill next and prev offsets of moving element using redo log */
+       list_fill_entry_redo_log(pop, ctx,
+                       &args_common, next_offset, prev_offset, set_uuid);
+
+redo_last:
+unlock:
+       operation_process(ctx);
+       operation_finish(ctx, 0);
+       list_mutexes_unlock(pop, head_new, head_old);
+err:
+       lane_release(pop);
+
+       ASSERT(ret == 0 || ret == -1);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/list.h b/ceph/src/pmdk/src/libpmemobj/list.h
new file mode 100644 (file)
index 0000000..bb89691
--- /dev/null
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * list.h -- internal definitions for persistent atomic lists module
+ */
+
+#ifndef LIBPMEMOBJ_LIST_H
+#define LIBPMEMOBJ_LIST_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#include "libpmemobj.h"
+#include "lane.h"
+#include "pmalloc.h"
+#include "ulog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct list_entry {
+       PMEMoid pe_next;
+       PMEMoid pe_prev;
+};
+
+struct list_head {
+       PMEMoid pe_first;
+       PMEMmutex lock;
+};
+
+int list_insert_new_user(PMEMobjpool *pop,
+       size_t pe_offset, struct list_head *user_head, PMEMoid dest, int before,
+       size_t size, uint64_t type_num, palloc_constr constructor, void *arg,
+       PMEMoid *oidp);
+
+int list_insert(PMEMobjpool *pop,
+       ssize_t pe_offset, struct list_head *head, PMEMoid dest, int before,
+       PMEMoid oid);
+
+int list_remove_free_user(PMEMobjpool *pop,
+       size_t pe_offset, struct list_head *user_head,
+       PMEMoid *oidp);
+
+int list_remove(PMEMobjpool *pop,
+       ssize_t pe_offset, struct list_head *head,
+       PMEMoid oid);
+
+int list_move(PMEMobjpool *pop,
+       size_t pe_offset_old, struct list_head *head_old,
+       size_t pe_offset_new, struct list_head *head_new,
+       PMEMoid dest, int before, PMEMoid oid);
+
+void list_move_oob(PMEMobjpool *pop,
+       struct list_head *head_old, struct list_head *head_new,
+       PMEMoid oid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/memblock.c b/ceph/src/pmdk/src/libpmemobj/memblock.c
new file mode 100644 (file)
index 0000000..0e1dd14
--- /dev/null
@@ -0,0 +1,1520 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * memblock.c -- implementation of memory block
+ *
+ * Memory block is a representation of persistent object that resides in the
+ * heap. A valid memory block must be either a huge (free or used) chunk or a
+ * block inside a run.
+ *
+ * Huge blocks are 1:1 correlated with the chunk headers in the zone whereas
+ * run blocks are represented by bits in corresponding chunk bitmap.
+ *
+ * This file contains implementations of abstract operations on memory blocks.
+ * Instead of storing the mbops structure inside each memory block the correct
+ * method implementation is chosen at runtime.
+ */
+
+#include <string.h>
+
+#include "obj.h"
+#include "heap.h"
+#include "memblock.h"
+#include "out.h"
+#include "valgrind_internal.h"
+#include "alloc_class.h"
+
+/* calculates the size of the entire run, including any additional chunks */
+#define SIZEOF_RUN(runp, size_idx)\
+       (sizeof(*(runp)) + (((size_idx) - 1) * CHUNKSIZE))
+
+/*
+ * memblock_header_type -- determines the memory block's header type
+ */
+static enum header_type
+memblock_header_type(const struct memory_block *m)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+       if (hdr->flags & CHUNK_FLAG_COMPACT_HEADER)
+               return HEADER_COMPACT;
+
+       if (hdr->flags & CHUNK_FLAG_HEADER_NONE)
+               return HEADER_NONE;
+
+       return HEADER_LEGACY;
+}
+
+/*
+ * memblock_header_legacy_get_size --
+ *     (internal) returns the size stored in a legacy header
+ */
+static size_t
+memblock_header_legacy_get_size(const struct memory_block *m)
+{
+       struct allocation_header_legacy *hdr = m->m_ops->get_real_data(m);
+
+       return hdr->size;
+}
+
+/*
+ * memblock_header_compact_get_size --
+ *     (internal) returns the size stored in a compact header
+ */
+static size_t
+memblock_header_compact_get_size(const struct memory_block *m)
+{
+       struct allocation_header_compact *hdr = m->m_ops->get_real_data(m);
+
+       return hdr->size & ALLOC_HDR_FLAGS_MASK;
+}
+
+/*
+ * memblock_header_none_get_size --
+ *     (internal) determines the sizes of an object without a header
+ */
+static size_t
+memblock_header_none_get_size(const struct memory_block *m)
+{
+       return m->m_ops->block_size(m);
+}
+
+/*
+ * memblock_header_legacy_get_extra --
+ *     (internal) returns the extra field stored in a legacy header
+ */
+static uint64_t
+memblock_header_legacy_get_extra(const struct memory_block *m)
+{
+       struct allocation_header_legacy *hdr = m->m_ops->get_real_data(m);
+
+       return hdr->type_num;
+}
+
+/*
+ * memblock_header_compact_get_extra --
+ *     (internal) returns the extra field stored in a compact header
+ */
+static uint64_t
+memblock_header_compact_get_extra(const struct memory_block *m)
+{
+       struct allocation_header_compact *hdr = m->m_ops->get_real_data(m);
+
+       return hdr->extra;
+}
+
+/*
+ * memblock_header_none_get_extra --
+ *     (internal) objects without a header don't have an extra field
+ */
+static uint64_t
+memblock_header_none_get_extra(const struct memory_block *m)
+{
+       return 0;
+}
+
+/*
+ * memblock_header_legacy_get_flags --
+ *     (internal) returns the flags stored in a legacy header
+ */
+static uint16_t
+memblock_header_legacy_get_flags(const struct memory_block *m)
+{
+       struct allocation_header_legacy *hdr = m->m_ops->get_real_data(m);
+
+       return (uint16_t)(hdr->root_size >> ALLOC_HDR_SIZE_SHIFT);
+}
+
+/*
+ * memblock_header_compact_get_flags --
+ *     (internal) returns the flags stored in a compact header
+ */
+static uint16_t
+memblock_header_compact_get_flags(const struct memory_block *m)
+{
+       struct allocation_header_compact *hdr = m->m_ops->get_real_data(m);
+
+       return (uint16_t)(hdr->size >> ALLOC_HDR_SIZE_SHIFT);
+}
+
+/*
+ * memblock_header_none_get_flags --
+ *     (internal) objects without a header do not support flags
+ */
+static uint16_t
+memblock_header_none_get_flags(const struct memory_block *m)
+{
+       return 0;
+}
+
+/*
+ * memblock_header_legacy_write --
+ *     (internal) writes a legacy header of an object
+ */
+static void
+memblock_header_legacy_write(const struct memory_block *m,
+       size_t size, uint64_t extra, uint16_t flags)
+{
+       struct allocation_header_legacy hdr;
+       hdr.size = size;
+       hdr.type_num = extra;
+       hdr.root_size = ((uint64_t)flags << ALLOC_HDR_SIZE_SHIFT);
+
+       struct allocation_header_legacy *hdrp = m->m_ops->get_real_data(m);
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(hdrp, sizeof(*hdrp));
+
+       VALGRIND_ADD_TO_TX(hdrp, sizeof(*hdrp));
+       pmemops_memcpy(&m->heap->p_ops, hdrp, &hdr,
+               sizeof(hdr), /* legacy header is 64 bytes in size */
+               PMEMOBJ_F_MEM_WC | PMEMOBJ_F_MEM_NODRAIN | PMEMOBJ_F_RELAXED);
+       VALGRIND_REMOVE_FROM_TX(hdrp, sizeof(*hdrp));
+
+       /* unused fields of the legacy headers are used as a red zone */
+       VALGRIND_DO_MAKE_MEM_NOACCESS(hdrp->unused, sizeof(hdrp->unused));
+}
+
+/*
+ * memblock_header_compact_write --
+ *     (internal) writes a compact header of an object
+ */
+static void
+memblock_header_compact_write(const struct memory_block *m,
+       size_t size, uint64_t extra, uint16_t flags)
+{
+       COMPILE_ERROR_ON(ALLOC_HDR_COMPACT_SIZE > CACHELINE_SIZE);
+
+       struct {
+               struct allocation_header_compact hdr;
+               uint8_t padding[CACHELINE_SIZE - ALLOC_HDR_COMPACT_SIZE];
+       } padded;
+
+       padded.hdr.size = size | ((uint64_t)flags << ALLOC_HDR_SIZE_SHIFT);
+       padded.hdr.extra = extra;
+
+       struct allocation_header_compact *hdrp = m->m_ops->get_real_data(m);
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(hdrp, sizeof(*hdrp));
+
+       /*
+        * If possible write the entire header with a single memcpy, this allows
+        * the copy implementation to avoid a cache miss on a partial cache line
+        * write.
+        */
+       size_t hdr_size = ALLOC_HDR_COMPACT_SIZE;
+       if ((uintptr_t)hdrp % CACHELINE_SIZE == 0 && size >= sizeof(padded))
+               hdr_size = sizeof(padded);
+
+       VALGRIND_ADD_TO_TX(hdrp, hdr_size);
+
+       pmemops_memcpy(&m->heap->p_ops, hdrp, &padded, hdr_size,
+               PMEMOBJ_F_MEM_WC | PMEMOBJ_F_MEM_NODRAIN | PMEMOBJ_F_RELAXED);
+       VALGRIND_DO_MAKE_MEM_UNDEFINED((char *)hdrp + ALLOC_HDR_COMPACT_SIZE,
+               hdr_size - ALLOC_HDR_COMPACT_SIZE);
+
+       VALGRIND_REMOVE_FROM_TX(hdrp, hdr_size);
+}
+
+/*
+ * memblock_header_none_write --
+ *     (internal) nothing to write
+ */
+static void
+memblock_header_none_write(const struct memory_block *m,
+       size_t size, uint64_t extra, uint16_t flags)
+{
+       /* NOP */
+}
+
+/*
+ * memblock_header_legacy_invalidate --
+ *     (internal) invalidates a legacy header
+ */
+static void
+memblock_header_legacy_invalidate(const struct memory_block *m)
+{
+       struct allocation_header_legacy *hdr = m->m_ops->get_real_data(m);
+       VALGRIND_SET_CLEAN(hdr, sizeof(*hdr));
+}
+
+/*
+ * memblock_header_compact_invalidate --
+ *     (internal) invalidates a compact header
+ */
+static void
+memblock_header_compact_invalidate(const struct memory_block *m)
+{
+       struct allocation_header_compact *hdr = m->m_ops->get_real_data(m);
+       VALGRIND_SET_CLEAN(hdr, sizeof(*hdr));
+}
+
+/*
+ * memblock_no_header_invalidate --
+ *     (internal) nothing to invalidate
+ */
+static void
+memblock_header_none_invalidate(const struct memory_block *m)
+{
+       /* NOP */
+}
+
+/*
+ * memblock_header_legacy_reinit --
+ *     (internal) reinitializes a legacy header after a heap restart
+ */
+static void
+memblock_header_legacy_reinit(const struct memory_block *m)
+{
+       struct allocation_header_legacy *hdr = m->m_ops->get_real_data(m);
+
+       VALGRIND_DO_MAKE_MEM_DEFINED(hdr, sizeof(*hdr));
+
+       /* unused fields of the legacy headers are used as a red zone */
+       VALGRIND_DO_MAKE_MEM_NOACCESS(hdr->unused, sizeof(hdr->unused));
+}
+
+/*
+ * memblock_header_compact_reinit --
+ *     (internal) reinitializes a compact header after a heap restart
+ */
+static void
+memblock_header_compact_reinit(const struct memory_block *m)
+{
+       struct allocation_header_compact *hdr = m->m_ops->get_real_data(m);
+
+       VALGRIND_DO_MAKE_MEM_DEFINED(hdr, sizeof(*hdr));
+}
+
+/*
+ * memblock_header_none_reinit --
+ *     (internal) nothing to reinitialize
+ */
+static void
+memblock_header_none_reinit(const struct memory_block *m)
+{
+       /* NOP */
+}
+
+static const struct {
+       /* determines the sizes of an object */
+       size_t (*get_size)(const struct memory_block *m);
+
+       /* returns the extra field (if available, 0 if not) */
+       uint64_t (*get_extra)(const struct memory_block *m);
+
+       /* returns the flags stored in a header (if available, 0 if not) */
+       uint16_t (*get_flags)(const struct memory_block *m);
+
+       /*
+        * Stores size, extra info and flags in header of an object
+        * (if available, does nothing otherwise).
+        */
+       void (*write)(const struct memory_block *m,
+               size_t size, uint64_t extra, uint16_t flags);
+       void (*invalidate)(const struct memory_block *m);
+
+       /*
+        * Reinitializes a header after a heap restart (if available, does
+        * nothing otherwise) (VG).
+        */
+       void (*reinit)(const struct memory_block *m);
+} memblock_header_ops[MAX_HEADER_TYPES] = {
+       [HEADER_LEGACY] = {
+               memblock_header_legacy_get_size,
+               memblock_header_legacy_get_extra,
+               memblock_header_legacy_get_flags,
+               memblock_header_legacy_write,
+               memblock_header_legacy_invalidate,
+               memblock_header_legacy_reinit,
+       },
+       [HEADER_COMPACT] = {
+               memblock_header_compact_get_size,
+               memblock_header_compact_get_extra,
+               memblock_header_compact_get_flags,
+               memblock_header_compact_write,
+               memblock_header_compact_invalidate,
+               memblock_header_compact_reinit,
+       },
+       [HEADER_NONE] = {
+               memblock_header_none_get_size,
+               memblock_header_none_get_extra,
+               memblock_header_none_get_flags,
+               memblock_header_none_write,
+               memblock_header_none_invalidate,
+               memblock_header_none_reinit,
+       }
+};
+
+/*
+ * memblock_run_default_nallocs -- returns the number of memory blocks
+ *     available in the in a run with given parameters using the default
+ *     fixed-bitmap algorithm
+ */
+static unsigned
+memblock_run_default_nallocs(uint32_t *size_idx, uint16_t flags,
+       uint64_t unit_size, uint64_t alignment)
+{
+       unsigned nallocs = (unsigned)
+               (RUN_DEFAULT_SIZE_BYTES(*size_idx) / unit_size);
+
+       while (nallocs > RUN_DEFAULT_BITMAP_NBITS) {
+               LOG(3, "tried to create a run (%lu) with number "
+                       "of units (%u) exceeding the bitmap size (%u)",
+                       unit_size, nallocs, RUN_DEFAULT_BITMAP_NBITS);
+               if (*size_idx > 1) {
+                       *size_idx -= 1;
+                       /* recalculate the number of allocations */
+                       nallocs = (uint32_t)
+                               (RUN_DEFAULT_SIZE_BYTES(*size_idx) / unit_size);
+                       LOG(3, "run (%lu) was constructed with "
+                               "fewer (%u) than requested chunks (%u)",
+                               unit_size, *size_idx, *size_idx + 1);
+               } else {
+                       LOG(3, "run (%lu) was constructed with "
+                               "fewer units (%u) than optimal (%u), "
+                               "this might lead to "
+                               "inefficient memory utilization!",
+                               unit_size,
+                               RUN_DEFAULT_BITMAP_NBITS, nallocs);
+
+                       nallocs = RUN_DEFAULT_BITMAP_NBITS;
+               }
+       }
+
+       return nallocs - (alignment ? 1 : 0);
+}
+
+/*
+ * memblock_run_bitmap -- calculate bitmap parameters for given arguments
+ */
+void
+memblock_run_bitmap(uint32_t *size_idx, uint16_t flags,
+       uint64_t unit_size, uint64_t alignment, void *content,
+       struct run_bitmap *b)
+{
+       ASSERTne(*size_idx, 0);
+
+       /*
+        * Flexible bitmaps have a variably sized values array. The size varies
+        * depending on:
+        *      alignment - initial run alignment might require up-to a unit
+        *      size idx - the larger the run, the more units it carries
+        *      unit_size - the smaller the unit size, the more units per run
+        *
+        * The size of the bitmap also has to be calculated in such a way that
+        * the beginning of allocations data is cacheline aligned. This is
+        * required to perform many optimizations throughout the codebase.
+        * This alignment requirement means that some of the bitmap values might
+        * remain unused and will serve only as a padding for data.
+        */
+       if (flags & CHUNK_FLAG_FLEX_BITMAP) {
+               /*
+                * First calculate the number of values without accounting for
+                * the bitmap size.
+                */
+               size_t content_size = RUN_CONTENT_SIZE_BYTES(*size_idx);
+               b->nbits = (unsigned)(content_size / unit_size);
+               b->nvalues = util_div_ceil(b->nbits, RUN_BITS_PER_VALUE);
+
+               /*
+                * Then, align the number of values up, so that the cacheline
+                * alignment is preserved.
+                */
+               b->nvalues = ALIGN_UP(b->nvalues + RUN_BASE_METADATA_VALUES,
+                       (unsigned)(CACHELINE_SIZE / sizeof(*b->values)))
+                       - RUN_BASE_METADATA_VALUES;
+
+               /*
+                * This is the total number of bytes needed for the bitmap AND
+                * padding.
+                */
+               b->size = b->nvalues * sizeof(*b->values);
+
+               /*
+                * Calculate the number of allocations again, but this time
+                * accounting for the bitmap/padding.
+                */
+               b->nbits = (unsigned)((content_size - b->size) / unit_size)
+                       - (alignment ? 1U : 0U);
+
+               /*
+                * The last step is to calculate how much of the padding
+                * is left at the end of the bitmap.
+                */
+               unsigned unused_bits = (b->nvalues * RUN_BITS_PER_VALUE)
+                       - b->nbits;
+               unsigned unused_values = unused_bits / RUN_BITS_PER_VALUE;
+               b->nvalues -= unused_values;
+
+               b->values = (uint64_t *)content;
+
+               return;
+       }
+
+       b->size = RUN_DEFAULT_BITMAP_SIZE;
+       b->nbits = memblock_run_default_nallocs(size_idx, flags,
+               unit_size, alignment);
+
+       unsigned unused_bits = RUN_DEFAULT_BITMAP_NBITS - b->nbits;
+       unsigned unused_values = unused_bits / RUN_BITS_PER_VALUE;
+       b->nvalues = RUN_DEFAULT_BITMAP_VALUES - unused_values;
+
+       b->values = (uint64_t *)content;
+}
+
+/*
+ * run_get_bitmap -- initializes run bitmap information
+ */
+static void
+run_get_bitmap(const struct memory_block *m, struct run_bitmap *b)
+{
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+
+       if (m->cached_bitmap != NULL) {
+               *b = *m->cached_bitmap;
+               b->values = (uint64_t *)run->content;
+       } else {
+               struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+               uint32_t size_idx = hdr->size_idx;
+               memblock_run_bitmap(&size_idx, hdr->flags, run->hdr.block_size,
+                       run->hdr.alignment, run->content, b);
+               ASSERTeq(size_idx, hdr->size_idx);
+       }
+}
+
+/*
+ * huge_block_size -- returns the compile-time constant which defines the
+ *     huge memory block size.
+ */
+static size_t
+huge_block_size(const struct memory_block *m)
+{
+       return CHUNKSIZE;
+}
+
+/*
+ * run_block_size -- looks for the right chunk and returns the block size
+ *     information that is attached to the run block metadata.
+ */
+static size_t
+run_block_size(const struct memory_block *m)
+{
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+
+       return run->hdr.block_size;
+}
+
+/*
+ * huge_get_real_data -- returns pointer to the beginning data of a huge block
+ */
+static void *
+huge_get_real_data(const struct memory_block *m)
+{
+       return heap_get_chunk(m->heap, m)->data;
+}
+
+/*
+ * run_get_data_start -- (internal) returns the pointer to the beginning of
+ *     allocations in a run
+ */
+static char *
+run_get_data_start(const struct memory_block *m)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       if (hdr->flags & CHUNK_FLAG_ALIGNED) {
+               /*
+                * Alignment is property of user data in allocations. And
+                * since objects have headers, we need to take them into
+                * account when calculating the address.
+                */
+               uintptr_t hsize = header_type_to_size[m->header_type];
+               uintptr_t base = (uintptr_t)run->content +
+                       b.size + hsize;
+               return (char *)(ALIGN_UP(base, run->hdr.alignment) - hsize);
+       } else {
+               return (char *)&run->content + b.size;
+       }
+}
+
+/*
+ * run_get_data_offset -- (internal) returns the number of bytes between
+ *     run base metadata and data
+ */
+static size_t
+run_get_data_offset(const struct memory_block *m)
+{
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+       return (size_t)run_get_data_start(m) - (size_t)&run->content;
+}
+
+/*
+ * run_get_real_data -- returns pointer to the beginning data of a run block
+ */
+static void *
+run_get_real_data(const struct memory_block *m)
+{
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+       ASSERT(run->hdr.block_size != 0);
+
+       return run_get_data_start(m) + (run->hdr.block_size * m->block_off);
+}
+
+/*
+ * block_get_user_data -- returns pointer to the data of a block
+ */
+static void *
+block_get_user_data(const struct memory_block *m)
+{
+       return (char *)m->m_ops->get_real_data(m) +
+               header_type_to_size[m->header_type];
+}
+
+/*
+ * chunk_get_chunk_hdr_value -- (internal) get value of a header for redo log
+ */
+static uint64_t
+chunk_get_chunk_hdr_value(uint16_t type, uint16_t flags, uint32_t size_idx)
+{
+       uint64_t val;
+       COMPILE_ERROR_ON(sizeof(struct chunk_header) != sizeof(uint64_t));
+
+       struct chunk_header hdr;
+       hdr.type = type;
+       hdr.flags = flags;
+       hdr.size_idx = size_idx;
+       memcpy(&val, &hdr, sizeof(val));
+
+       return val;
+}
+
+/*
+ * huge_prep_operation_hdr -- prepares the new value of a chunk header that will
+ *     be set after the operation concludes.
+ */
+static void
+huge_prep_operation_hdr(const struct memory_block *m, enum memblock_state op,
+       struct operation_context *ctx)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+       /*
+        * Depending on the operation that needs to be performed a new chunk
+        * header needs to be prepared with the new chunk state.
+        */
+       uint64_t val = chunk_get_chunk_hdr_value(
+               op == MEMBLOCK_ALLOCATED ? CHUNK_TYPE_USED : CHUNK_TYPE_FREE,
+               hdr->flags,
+               m->size_idx);
+
+       if (ctx == NULL) {
+               util_atomic_store_explicit64((uint64_t *)hdr, val,
+                       memory_order_relaxed);
+               pmemops_persist(&m->heap->p_ops, hdr, sizeof(*hdr));
+       } else {
+               operation_add_entry(ctx, hdr, val, ULOG_OPERATION_SET);
+       }
+
+       VALGRIND_DO_MAKE_MEM_NOACCESS(hdr + 1,
+               (hdr->size_idx - 1) * sizeof(struct chunk_header));
+
+       /*
+        * In the case of chunks larger than one unit the footer must be
+        * created immediately AFTER the persistent state is safely updated.
+        */
+       if (m->size_idx == 1)
+               return;
+
+       struct chunk_header *footer = hdr + m->size_idx - 1;
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(footer, sizeof(*footer));
+
+       val = chunk_get_chunk_hdr_value(CHUNK_TYPE_FOOTER, 0, m->size_idx);
+
+       /*
+        * It's only safe to write the footer AFTER the persistent part of
+        * the operation have been successfully processed because the footer
+        * pointer might point to a currently valid persistent state
+        * of a different chunk.
+        * The footer entry change is updated as transient because it will
+        * be recreated at heap boot regardless - it's just needed for runtime
+        * operations.
+        */
+       if (ctx == NULL) {
+               util_atomic_store_explicit64((uint64_t *)footer, val,
+                       memory_order_relaxed);
+               VALGRIND_SET_CLEAN(footer, sizeof(*footer));
+       } else {
+               operation_add_typed_entry(ctx,
+                       footer, val, ULOG_OPERATION_SET, LOG_TRANSIENT);
+       }
+}
+
+/*
+ * run_prep_operation_hdr -- prepares the new value for a select few bytes of
+ *     a run bitmap that will be set after the operation concludes.
+ *
+ * It's VERY important to keep in mind that the particular value of the
+ * bitmap this method is modifying must not be changed after this function
+ * is called and before the operation is processed.
+ */
+static void
+run_prep_operation_hdr(const struct memory_block *m, enum memblock_state op,
+       struct operation_context *ctx)
+{
+       ASSERT(m->size_idx <= RUN_BITS_PER_VALUE);
+
+       /*
+        * Free blocks are represented by clear bits and used blocks by set
+        * bits - which is the reverse of the commonly used scheme.
+        *
+        * Here a bit mask is prepared that flips the bits that represent the
+        * memory block provided by the caller - because both the size index and
+        * the block offset are tied 1:1 to the bitmap this operation is
+        * relatively simple.
+        */
+       uint64_t bmask;
+       if (m->size_idx == RUN_BITS_PER_VALUE) {
+               ASSERTeq(m->block_off % RUN_BITS_PER_VALUE, 0);
+               bmask = UINT64_MAX;
+       } else {
+               bmask = ((1ULL << m->size_idx) - 1ULL) <<
+                               (m->block_off % RUN_BITS_PER_VALUE);
+       }
+
+       /*
+        * The run bitmap is composed of several 8 byte values, so a proper
+        * element of the bitmap array must be selected.
+        */
+       unsigned bpos = m->block_off / RUN_BITS_PER_VALUE;
+
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       /* the bit mask is applied immediately by the add entry operations */
+       if (op == MEMBLOCK_ALLOCATED) {
+               operation_add_entry(ctx, &b.values[bpos],
+                       bmask, ULOG_OPERATION_OR);
+       } else if (op == MEMBLOCK_FREE) {
+               operation_add_entry(ctx, &b.values[bpos],
+                       ~bmask, ULOG_OPERATION_AND);
+       } else {
+               ASSERT(0);
+       }
+}
+
+/*
+ * huge_get_lock -- because huge memory blocks are always allocated from a
+ *     single bucket there's no reason to lock them - the bucket itself is
+ *     protected.
+ */
+static os_mutex_t *
+huge_get_lock(const struct memory_block *m)
+{
+       return NULL;
+}
+
+/*
+ * run_get_lock -- gets the runtime mutex from the heap.
+ */
+static os_mutex_t *
+run_get_lock(const struct memory_block *m)
+{
+       return heap_get_run_lock(m->heap, m->chunk_id);
+}
+
+/*
+ * huge_get_state -- returns whether a huge block is allocated or not
+ */
+static enum memblock_state
+huge_get_state(const struct memory_block *m)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+       if (hdr->type == CHUNK_TYPE_USED)
+               return MEMBLOCK_ALLOCATED;
+
+       if (hdr->type == CHUNK_TYPE_FREE)
+               return MEMBLOCK_FREE;
+
+       return MEMBLOCK_STATE_UNKNOWN;
+}
+
+/*
+ * huge_get_state -- returns whether a block from a run is allocated or not
+ */
+static enum memblock_state
+run_get_state(const struct memory_block *m)
+{
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       unsigned v = m->block_off / RUN_BITS_PER_VALUE;
+       uint64_t bitmap = b.values[v];
+       unsigned bit = m->block_off % RUN_BITS_PER_VALUE;
+
+       unsigned bit_last = bit + m->size_idx;
+       ASSERT(bit_last <= RUN_BITS_PER_VALUE);
+
+       for (unsigned i = bit; i < bit_last; ++i) {
+               if (!BIT_IS_CLR(bitmap, i)) {
+                       return MEMBLOCK_ALLOCATED;
+               }
+       }
+
+       return MEMBLOCK_FREE;
+}
+
+/*
+ * huge_ensure_header_type -- checks the header type of a chunk and modifies
+ *     it if necessary. This is fail-safe atomic.
+ */
+static void
+huge_ensure_header_type(const struct memory_block *m,
+       enum header_type t)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       ASSERTeq(hdr->type, CHUNK_TYPE_FREE);
+
+       if ((hdr->flags & header_type_to_flag[t]) == 0) {
+               VALGRIND_ADD_TO_TX(hdr, sizeof(*hdr));
+               uint16_t f = ((uint16_t)header_type_to_flag[t]);
+               hdr->flags |= f;
+               pmemops_persist(&m->heap->p_ops, hdr, sizeof(*hdr));
+               VALGRIND_REMOVE_FROM_TX(hdr, sizeof(*hdr));
+       }
+}
+
+/*
+ * run_ensure_header_type -- runs must be created with appropriate header type.
+ */
+static void
+run_ensure_header_type(const struct memory_block *m,
+       enum header_type t)
+{
+#ifdef DEBUG
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       ASSERTeq(hdr->type, CHUNK_TYPE_RUN);
+       ASSERT((hdr->flags & header_type_to_flag[t]) == header_type_to_flag[t]);
+#endif
+}
+
+/*
+ * block_get_real_size -- returns the size of a memory block that includes all
+ *     of the overhead (headers)
+ */
+static size_t
+block_get_real_size(const struct memory_block *m)
+{
+       /*
+        * There are two valid ways to get a size. If the memory block
+        * initialized properly and the size index is set, the chunk unit size
+        * can be simply multiplied by that index, otherwise we need to look at
+        * the allocation header.
+        */
+       if (m->size_idx != 0) {
+               return m->m_ops->block_size(m) * m->size_idx;
+       } else {
+               return memblock_header_ops[m->header_type].get_size(m);
+       }
+}
+
+/*
+ * block_get_user_size -- returns the size of a memory block without overheads,
+ *     this is the size of a data block that can be used.
+ */
+static size_t
+block_get_user_size(const struct memory_block *m)
+{
+       return block_get_real_size(m) - header_type_to_size[m->header_type];
+}
+
+/*
+ * block_write_header -- writes a header of an allocation
+ */
+static void
+block_write_header(const struct memory_block *m,
+       uint64_t extra_field, uint16_t flags)
+{
+       memblock_header_ops[m->header_type].write(m,
+               block_get_real_size(m), extra_field, flags);
+}
+
+/*
+ * block_invalidate -- invalidates allocation data and header
+ */
+static void
+block_invalidate(const struct memory_block *m)
+{
+       void *data = m->m_ops->get_user_data(m);
+       size_t size = m->m_ops->get_user_size(m);
+       VALGRIND_SET_CLEAN(data, size);
+
+       memblock_header_ops[m->header_type].invalidate(m);
+}
+
+/*
+ * block_reinit_header -- reinitializes a block after a heap restart
+ */
+static void
+block_reinit_header(const struct memory_block *m)
+{
+       memblock_header_ops[m->header_type].reinit(m);
+}
+
+/*
+ * block_get_extra -- returns the extra field of an allocation
+ */
+static uint64_t
+block_get_extra(const struct memory_block *m)
+{
+       return memblock_header_ops[m->header_type].get_extra(m);
+}
+
+/*
+ * block_get_flags -- returns the flags of an allocation
+ */
+static uint16_t
+block_get_flags(const struct memory_block *m)
+{
+       return memblock_header_ops[m->header_type].get_flags(m);
+}
+
+/*
+ * heap_run_process_bitmap_value -- (internal) looks for unset bits in the
+ * value, creates a valid memory block out of them and inserts that
+ * block into the given bucket.
+ */
+static int
+run_process_bitmap_value(const struct memory_block *m,
+       uint64_t value, uint32_t base_offset, object_callback cb, void *arg)
+{
+       int ret = 0;
+
+       uint64_t shift = 0; /* already processed bits */
+       struct memory_block s = *m;
+       do {
+               /*
+                * Shift the value so that the next memory block starts on the
+                * least significant position:
+                *      ..............0 (free block)
+                * or   ..............1 (used block)
+                */
+               uint64_t shifted = value >> shift;
+
+               /* all clear or set bits indicate the end of traversal */
+               if (shifted == 0) {
+                       /*
+                        * Insert the remaining blocks as free. Remember that
+                        * unsigned values are always zero-filled, so we must
+                        * take the current shift into account.
+                        */
+                       s.block_off = (uint32_t)(base_offset + shift);
+                       s.size_idx = (uint32_t)(RUN_BITS_PER_VALUE - shift);
+
+                       if ((ret = cb(&s, arg)) != 0)
+                               return ret;
+
+                       break;
+               } else if (shifted == UINT64_MAX) {
+                       break;
+               }
+
+               /*
+                * Offset and size of the next free block, either of these
+                * can be zero depending on where the free block is located
+                * in the value.
+                */
+               unsigned off = (unsigned)util_lssb_index64(~shifted);
+               unsigned size = (unsigned)util_lssb_index64(shifted);
+
+               shift += off + size;
+
+               if (size != 0) { /* zero size means skip to the next value */
+                       s.block_off = (uint32_t)(base_offset + (shift - size));
+                       s.size_idx = (uint32_t)(size);
+
+                       memblock_rebuild_state(m->heap, &s);
+                       if ((ret = cb(&s, arg)) != 0)
+                               return ret;
+               }
+       } while (shift != RUN_BITS_PER_VALUE);
+
+       return 0;
+}
+
+/*
+ * run_iterate_free -- iterates over free blocks in a run
+ */
+static int
+run_iterate_free(const struct memory_block *m, object_callback cb, void *arg)
+{
+       int ret = 0;
+       uint32_t block_off = 0;
+
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       struct memory_block nm = *m;
+       for (unsigned i = 0; i < b.nvalues; ++i) {
+               uint64_t v = b.values[i];
+               ASSERT((uint64_t)RUN_BITS_PER_VALUE * (uint64_t)i
+                       <= UINT32_MAX);
+               block_off = RUN_BITS_PER_VALUE * i;
+               ret = run_process_bitmap_value(&nm, v, block_off, cb, arg);
+               if (ret != 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * run_iterate_used -- iterates over used blocks in a run
+ */
+static int
+run_iterate_used(const struct memory_block *m, object_callback cb, void *arg)
+{
+       uint32_t i = m->block_off / RUN_BITS_PER_VALUE;
+       uint32_t block_start = m->block_off % RUN_BITS_PER_VALUE;
+       uint32_t block_off;
+
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+
+       struct memory_block iter = *m;
+
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       for (; i < b.nvalues; ++i) {
+               uint64_t v = b.values[i];
+               block_off = (uint32_t)(RUN_BITS_PER_VALUE * i);
+
+               for (uint32_t j = block_start; j < RUN_BITS_PER_VALUE; ) {
+                       if (block_off + j >= (uint32_t)b.nbits)
+                               break;
+
+                       if (!BIT_IS_CLR(v, j)) {
+                               iter.block_off = (uint32_t)(block_off + j);
+
+                               /*
+                                * The size index of this memory block cannot be
+                                * retrieved at this time because the header
+                                * might not be initialized in valgrind yet.
+                                */
+                               iter.size_idx = 0;
+
+                               if (cb(&iter, arg) != 0)
+                                       return 1;
+
+                               iter.size_idx = CALC_SIZE_IDX(
+                                       run->hdr.block_size,
+                                       iter.m_ops->get_real_size(&iter));
+                               j = (uint32_t)(j + iter.size_idx);
+                       } else {
+                               ++j;
+                       }
+               }
+               block_start = 0;
+       }
+
+       return 0;
+}
+
+/*
+ * huge_iterate_free -- calls cb on memory block if it's free
+ */
+static int
+huge_iterate_free(const struct memory_block *m, object_callback cb, void *arg)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+       return hdr->type == CHUNK_TYPE_FREE ? cb(m, arg) : 0;
+}
+
+/*
+ * huge_iterate_free -- calls cb on memory block if it's used
+ */
+static int
+huge_iterate_used(const struct memory_block *m, object_callback cb, void *arg)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+
+       return hdr->type == CHUNK_TYPE_USED ? cb(m, arg) : 0;
+}
+
+/*
+ * huge_vg_init -- initializes chunk metadata in memcheck state
+ */
+static void
+huge_vg_init(const struct memory_block *m, int objects,
+       object_callback cb, void *arg)
+{
+       struct zone *z = ZID_TO_ZONE(m->heap->layout, m->zone_id);
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       struct chunk *chunk = heap_get_chunk(m->heap, m);
+       VALGRIND_DO_MAKE_MEM_DEFINED(hdr, sizeof(*hdr));
+
+       /*
+        * Mark unused chunk headers as not accessible.
+        */
+       VALGRIND_DO_MAKE_MEM_NOACCESS(
+               &z->chunk_headers[m->chunk_id + 1],
+               (m->size_idx - 1) *
+               sizeof(struct chunk_header));
+
+       size_t size = block_get_real_size(m);
+       VALGRIND_DO_MAKE_MEM_NOACCESS(chunk, size);
+
+       if (objects && huge_get_state(m) == MEMBLOCK_ALLOCATED) {
+               if (cb(m, arg) != 0)
+                       FATAL("failed to initialize valgrind state");
+       }
+}
+
+/*
+ * run_vg_init -- initializes run metadata in memcheck state
+ */
+static void
+run_vg_init(const struct memory_block *m, int objects,
+       object_callback cb, void *arg)
+{
+       struct zone *z = ZID_TO_ZONE(m->heap->layout, m->zone_id);
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       struct chunk_run *run = heap_get_chunk_run(m->heap, m);
+       VALGRIND_DO_MAKE_MEM_DEFINED(hdr, sizeof(*hdr));
+
+       /* set the run metadata as defined */
+       VALGRIND_DO_MAKE_MEM_DEFINED(run, RUN_BASE_METADATA_SIZE);
+
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+
+       /*
+        * Mark run data headers as defined.
+        */
+       for (unsigned j = 1; j < m->size_idx; ++j) {
+               struct chunk_header *data_hdr =
+                       &z->chunk_headers[m->chunk_id + j];
+               VALGRIND_DO_MAKE_MEM_DEFINED(data_hdr,
+                       sizeof(struct chunk_header));
+               ASSERTeq(data_hdr->type, CHUNK_TYPE_RUN_DATA);
+       }
+
+       VALGRIND_DO_MAKE_MEM_NOACCESS(run, SIZEOF_RUN(run, m->size_idx));
+
+       /* set the run bitmap as defined */
+       VALGRIND_DO_MAKE_MEM_DEFINED(run, b.size + RUN_BASE_METADATA_SIZE);
+
+       if (objects) {
+               if (run_iterate_used(m, cb, arg) != 0)
+                       FATAL("failed to initialize valgrind state");
+       }
+}
+
+/*
+ * run_reinit_chunk -- run reinitialization on first zone traversal
+ */
+static void
+run_reinit_chunk(const struct memory_block *m)
+{
+       /* noop */
+}
+
+/*
+ * huge_write_footer -- (internal) writes a chunk footer
+ */
+static void
+huge_write_footer(struct chunk_header *hdr, uint32_t size_idx)
+{
+       if (size_idx == 1) /* that would overwrite the header */
+               return;
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(hdr + size_idx - 1, sizeof(*hdr));
+
+       struct chunk_header f = *hdr;
+       f.type = CHUNK_TYPE_FOOTER;
+       f.size_idx = size_idx;
+       *(hdr + size_idx - 1) = f;
+       /* no need to persist, footers are recreated in heap_populate_buckets */
+       VALGRIND_SET_CLEAN(hdr + size_idx - 1, sizeof(f));
+}
+
+/*
+ * huge_reinit_chunk -- chunk reinitialization on first zone traversal
+ */
+static void
+huge_reinit_chunk(const struct memory_block *m)
+{
+       struct chunk_header *hdr = heap_get_chunk_hdr(m->heap, m);
+       if (hdr->type == CHUNK_TYPE_USED)
+               huge_write_footer(hdr, hdr->size_idx);
+}
+
+/*
+ * run_calc_free -- calculates the number of free units in a run
+ */
+static void
+run_calc_free(const struct memory_block *m,
+       uint32_t *free_space, uint32_t *max_free_block)
+{
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+       for (unsigned i = 0; i < b.nvalues; ++i) {
+               uint64_t value = ~b.values[i];
+               if (value == 0)
+                       continue;
+
+               uint32_t free_in_value = util_popcount64(value);
+               *free_space = *free_space + free_in_value;
+
+               /*
+                * If this value has less free blocks than already found max,
+                * there's no point in calculating.
+                */
+               if (free_in_value < *max_free_block)
+                       continue;
+
+               /* if the entire value is empty, no point in calculating */
+               if (free_in_value == RUN_BITS_PER_VALUE) {
+                       *max_free_block = RUN_BITS_PER_VALUE;
+                       continue;
+               }
+
+               /* if already at max, no point in calculating */
+               if (*max_free_block == RUN_BITS_PER_VALUE)
+                       continue;
+
+               /*
+                * Calculate the biggest free block in the bitmap.
+                * This algorithm is not the most clever imaginable, but it's
+                * easy to implement and fast enough.
+                */
+               uint16_t n = 0;
+               while (value != 0) {
+                       value &= (value << 1ULL);
+                       n++;
+               }
+
+               if (n > *max_free_block)
+                       *max_free_block = n;
+       }
+}
+
+/*
+ * huge_fill_pct -- huge blocks by definition use the entirety of a chunk
+ */
+static unsigned
+huge_fill_pct(const struct memory_block *m)
+{
+       return 100;
+}
+
+/*
+ * run_fill_pct -- calculates the percentage of allocated units inside of a run
+ */
+static unsigned
+run_fill_pct(const struct memory_block *m)
+{
+       struct run_bitmap b;
+       run_get_bitmap(m, &b);
+       unsigned clearbits = 0;
+       for (unsigned i = 0; i < b.nvalues; ++i) {
+               uint64_t value = ~b.values[i];
+               if (value == 0)
+                       continue;
+
+               clearbits += util_popcount64(value);
+       }
+       ASSERT(b.nbits >= clearbits);
+       unsigned setbits = b.nbits - clearbits;
+
+       return (100 * setbits) / b.nbits;
+}
+
+static const struct memory_block_ops mb_ops[MAX_MEMORY_BLOCK] = {
+       [MEMORY_BLOCK_HUGE] = {
+               .block_size = huge_block_size,
+               .prep_hdr = huge_prep_operation_hdr,
+               .get_lock = huge_get_lock,
+               .get_state = huge_get_state,
+               .get_user_data = block_get_user_data,
+               .get_real_data = huge_get_real_data,
+               .get_user_size = block_get_user_size,
+               .get_real_size = block_get_real_size,
+               .write_header = block_write_header,
+               .invalidate = block_invalidate,
+               .ensure_header_type = huge_ensure_header_type,
+               .reinit_header = block_reinit_header,
+               .vg_init = huge_vg_init,
+               .get_extra = block_get_extra,
+               .get_flags = block_get_flags,
+               .iterate_free = huge_iterate_free,
+               .iterate_used = huge_iterate_used,
+               .reinit_chunk = huge_reinit_chunk,
+               .calc_free = NULL,
+               .get_bitmap = NULL,
+               .fill_pct = huge_fill_pct,
+       },
+       [MEMORY_BLOCK_RUN] = {
+               .block_size = run_block_size,
+               .prep_hdr = run_prep_operation_hdr,
+               .get_lock = run_get_lock,
+               .get_state = run_get_state,
+               .get_user_data = block_get_user_data,
+               .get_real_data = run_get_real_data,
+               .get_user_size = block_get_user_size,
+               .get_real_size = block_get_real_size,
+               .write_header = block_write_header,
+               .invalidate = block_invalidate,
+               .ensure_header_type = run_ensure_header_type,
+               .reinit_header = block_reinit_header,
+               .vg_init = run_vg_init,
+               .get_extra = block_get_extra,
+               .get_flags = block_get_flags,
+               .iterate_free = run_iterate_free,
+               .iterate_used = run_iterate_used,
+               .reinit_chunk = run_reinit_chunk,
+               .calc_free = run_calc_free,
+               .get_bitmap = run_get_bitmap,
+               .fill_pct = run_fill_pct,
+       }
+};
+
+/*
+ * memblock_huge_init -- initializes a new huge memory block
+ */
+struct memory_block
+memblock_huge_init(struct palloc_heap *heap,
+       uint32_t chunk_id, uint32_t zone_id, uint32_t size_idx)
+{
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.chunk_id = chunk_id;
+       m.zone_id = zone_id;
+       m.size_idx = size_idx;
+       m.heap = heap;
+
+       struct chunk_header nhdr = {
+               .type = CHUNK_TYPE_FREE,
+               .flags = 0,
+               .size_idx = size_idx
+       };
+
+       struct chunk_header *hdr = heap_get_chunk_hdr(heap, &m);
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(hdr, sizeof(*hdr));
+       VALGRIND_ANNOTATE_NEW_MEMORY(hdr, sizeof(*hdr));
+
+       *hdr = nhdr; /* write the entire header (8 bytes) at once */
+
+       pmemops_persist(&heap->p_ops, hdr, sizeof(*hdr));
+
+       huge_write_footer(hdr, size_idx);
+
+       memblock_rebuild_state(heap, &m);
+
+       return m;
+}
+
+/*
+ * memblock_run_init -- initializes a new run memory block
+ */
+struct memory_block
+memblock_run_init(struct palloc_heap *heap,
+       uint32_t chunk_id, uint32_t zone_id, struct run_descriptor *rdsc)
+{
+       uint32_t size_idx = rdsc->size_idx;
+       ASSERTne(size_idx, 0);
+
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.chunk_id = chunk_id;
+       m.zone_id = zone_id;
+       m.size_idx = size_idx;
+       m.heap = heap;
+
+       struct zone *z = ZID_TO_ZONE(heap->layout, zone_id);
+
+       struct chunk_run *run = heap_get_chunk_run(heap, &m);
+       size_t runsize = SIZEOF_RUN(run, size_idx);
+
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(run, runsize);
+
+       /* add/remove chunk_run and chunk_header to valgrind transaction */
+       VALGRIND_ADD_TO_TX(run, runsize);
+       run->hdr.block_size = rdsc->unit_size;
+       run->hdr.alignment = rdsc->alignment;
+
+       struct run_bitmap b = rdsc->bitmap;
+       b.values = (uint64_t *)run->content;
+
+       size_t bitmap_size = b.size;
+
+       /* set all the bits */
+       memset(b.values, 0xFF, bitmap_size);
+
+       /* clear only the bits available for allocations from this bucket */
+       memset(b.values, 0, sizeof(*b.values) * (b.nvalues - 1));
+
+       unsigned trailing_bits = b.nbits % RUN_BITS_PER_VALUE;
+       uint64_t last_value = UINT64_MAX << trailing_bits;
+       b.values[b.nvalues - 1] = last_value;
+
+       VALGRIND_REMOVE_FROM_TX(run, runsize);
+
+       pmemops_flush(&heap->p_ops, run,
+               sizeof(struct chunk_run_header) +
+               bitmap_size);
+
+       struct chunk_header run_data_hdr;
+       run_data_hdr.type = CHUNK_TYPE_RUN_DATA;
+       run_data_hdr.flags = 0;
+
+       VALGRIND_ADD_TO_TX(&z->chunk_headers[chunk_id],
+               sizeof(struct chunk_header) * size_idx);
+
+       struct chunk_header *data_hdr;
+       for (unsigned i = 1; i < size_idx; ++i) {
+               data_hdr = &z->chunk_headers[chunk_id + i];
+               VALGRIND_DO_MAKE_MEM_UNDEFINED(data_hdr, sizeof(*data_hdr));
+               VALGRIND_ANNOTATE_NEW_MEMORY(data_hdr, sizeof(*data_hdr));
+               run_data_hdr.size_idx = i;
+               *data_hdr = run_data_hdr;
+       }
+       pmemops_persist(&heap->p_ops,
+               &z->chunk_headers[chunk_id + 1],
+               sizeof(struct chunk_header) * (size_idx - 1));
+
+       struct chunk_header *hdr = &z->chunk_headers[chunk_id];
+       ASSERT(hdr->type == CHUNK_TYPE_FREE);
+
+       VALGRIND_ANNOTATE_NEW_MEMORY(hdr, sizeof(*hdr));
+
+       struct chunk_header run_hdr;
+       run_hdr.size_idx = hdr->size_idx;
+       run_hdr.type = CHUNK_TYPE_RUN;
+       run_hdr.flags = rdsc->flags;
+       *hdr = run_hdr;
+       pmemops_persist(&heap->p_ops, hdr, sizeof(*hdr));
+
+       VALGRIND_REMOVE_FROM_TX(&z->chunk_headers[chunk_id],
+               sizeof(struct chunk_header) * size_idx);
+
+       memblock_rebuild_state(heap, &m);
+       m.cached_bitmap = &rdsc->bitmap;
+
+       return m;
+}
+
+/*
+ * memblock_detect_type -- looks for the corresponding chunk header and
+ *     depending on the chunks type returns the right memory block type
+ */
+static enum memory_block_type
+memblock_detect_type(struct palloc_heap *heap, const struct memory_block *m)
+{
+       enum memory_block_type ret;
+
+       switch (heap_get_chunk_hdr(heap, m)->type) {
+               case CHUNK_TYPE_RUN:
+               case CHUNK_TYPE_RUN_DATA:
+                       ret = MEMORY_BLOCK_RUN;
+                       break;
+               case CHUNK_TYPE_FREE:
+               case CHUNK_TYPE_USED:
+               case CHUNK_TYPE_FOOTER:
+                       ret = MEMORY_BLOCK_HUGE;
+                       break;
+               default:
+                       /* unreachable */
+                       FATAL("possible zone chunks metadata corruption");
+       }
+       return ret;
+}
+
+/*
+ * memblock_from_offset -- resolves a memory block data from an offset that
+ *     originates from the heap
+ */
+struct memory_block
+memblock_from_offset_opt(struct palloc_heap *heap, uint64_t off, int size)
+{
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.heap = heap;
+
+       off -= HEAP_PTR_TO_OFF(heap, &heap->layout->zone0);
+       m.zone_id = (uint32_t)(off / ZONE_MAX_SIZE);
+
+       off -= (ZONE_MAX_SIZE * m.zone_id) + sizeof(struct zone);
+       m.chunk_id = (uint32_t)(off / CHUNKSIZE);
+
+       struct chunk_header *hdr = heap_get_chunk_hdr(heap, &m);
+
+       if (hdr->type == CHUNK_TYPE_RUN_DATA)
+               m.chunk_id -= hdr->size_idx;
+
+       off -= CHUNKSIZE * m.chunk_id;
+
+       m.header_type = memblock_header_type(&m);
+
+       off -= header_type_to_size[m.header_type];
+
+       m.type = off != 0 ? MEMORY_BLOCK_RUN : MEMORY_BLOCK_HUGE;
+       ASSERTeq(memblock_detect_type(heap, &m), m.type);
+
+       m.m_ops = &mb_ops[m.type];
+
+       uint64_t unit_size = m.m_ops->block_size(&m);
+
+       if (off != 0) { /* run */
+               off -= run_get_data_offset(&m);
+               off -= RUN_BASE_METADATA_SIZE;
+               m.block_off = (uint16_t)(off / unit_size);
+               off -= m.block_off * unit_size;
+       }
+
+       struct alloc_class_collection *acc = heap_alloc_classes(heap);
+       if (acc != NULL) {
+               struct alloc_class *ac = alloc_class_by_run(acc,
+                       unit_size, hdr->flags, hdr->size_idx);
+               if (ac != NULL)
+                       m.cached_bitmap = &ac->rdsc.bitmap;
+       }
+
+       m.size_idx = !size ? 0 : CALC_SIZE_IDX(unit_size,
+               memblock_header_ops[m.header_type].get_size(&m));
+
+       ASSERTeq(off, 0);
+
+       return m;
+}
+
+/*
+ * memblock_from_offset -- returns memory block with size
+ */
+struct memory_block
+memblock_from_offset(struct palloc_heap *heap, uint64_t off)
+{
+       return memblock_from_offset_opt(heap, off, 1);
+}
+
+/*
+ * memblock_rebuild_state -- fills in the runtime-state related fields of a
+ *     memory block structure
+ *
+ * This function must be called on all memory blocks that were created by hand
+ * (as opposed to retrieved from memblock_from_offset function).
+ */
+void
+memblock_rebuild_state(struct palloc_heap *heap, struct memory_block *m)
+{
+       m->heap = heap;
+       m->header_type = memblock_header_type(m);
+       m->type = memblock_detect_type(heap, m);
+       m->m_ops = &mb_ops[m->type];
+       m->cached_bitmap = NULL;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/memblock.h b/ceph/src/pmdk/src/libpmemobj/memblock.h
new file mode 100644 (file)
index 0000000..653c093
--- /dev/null
@@ -0,0 +1,306 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * memblock.h -- internal definitions for memory block
+ */
+
+#ifndef LIBPMEMOBJ_MEMBLOCK_H
+#define LIBPMEMOBJ_MEMBLOCK_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "os_thread.h"
+#include "heap_layout.h"
+#include "memops.h"
+#include "palloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MEMORY_BLOCK_NONE \
+(struct memory_block)\
+{0, 0, 0, 0, NULL, NULL, MAX_HEADER_TYPES, MAX_MEMORY_BLOCK, NULL}
+
+#define MEMORY_BLOCK_IS_NONE(_m)\
+((_m).heap == NULL)
+
+#define MEMORY_BLOCK_EQUALS(lhs, rhs)\
+((lhs).zone_id == (rhs).zone_id && (lhs).chunk_id == (rhs).chunk_id &&\
+(lhs).block_off == (rhs).block_off && (lhs).heap == (rhs).heap)
+
+enum memory_block_type {
+       /*
+        * Huge memory blocks are directly backed by memory chunks. A single
+        * huge block can consist of several chunks.
+        * The persistent representation of huge memory blocks can be thought
+        * of as a doubly linked list with variable length elements.
+        * That list is stored in the chunk headers array where one element
+        * directly corresponds to one chunk.
+        *
+        * U - used, F - free, R - footer, . - empty
+        * |U| represents a used chunk with a size index of 1, with type
+        * information (CHUNK_TYPE_USED) stored in the corresponding header
+        * array element - chunk_headers[chunk_id].
+        *
+        * |F...R| represents a free chunk with size index of 5. The empty
+        * chunk headers have undefined values and shouldn't be used. All
+        * chunks with size larger than 1 must have a footer in the last
+        * corresponding header array - chunk_headers[chunk_id - size_idx - 1].
+        *
+        * The above representation of chunks will be used to describe the
+        * way fail-safety is achieved during heap operations.
+        *
+        * Allocation of huge memory block with size index 5:
+        * Initial heap state: |U| <> |F..R| <> |U| <> |F......R|
+        *
+        * The only block that matches that size is at very end of the chunks
+        * list: |F......R|
+        *
+        * As the request was for memory block of size 5, and this ones size is
+        * 7 there's a need to first split the chunk in two.
+        * 1) The last chunk header of the new allocation is marked as footer
+        *      and the block after that one is marked as free: |F...RF.R|
+        *      This is allowed and has no impact on the heap because this
+        *      modification is into chunk header that is otherwise unused, in
+        *      other words the linked list didn't change.
+        *
+        * 2) The size index of the first header is changed from previous value
+        *      of 7 to 5: |F...R||F.R|
+        *      This is a single fail-safe atomic operation and this is the
+        *      first change that is noticeable by the heap operations.
+        *      A single linked list element is split into two new ones.
+        *
+        * 3) The allocation process either uses redo log or changes directly
+        *      the chunk header type from free to used: |U...R| <> |F.R|
+        *
+        * In a similar fashion the reverse operation, free, is performed:
+        * Initial heap state: |U| <> |F..R| <> |F| <> |U...R| <> |F.R|
+        *
+        * This is the heap after the previous example with the single chunk
+        * in between changed from used to free.
+        *
+        * 1) Determine the neighbors of the memory block which is being
+        *      freed.
+        *
+        * 2) Update the footer (if needed) information of the last chunk which
+        *      is the memory block being freed or it's neighbor to the right.
+        *      |F| <> |U...R| <> |F.R << this one|
+        *
+        * 3) Update the size index and type of the left-most chunk header.
+        *      And so this: |F << this one| <> |U...R| <> |F.R|
+        *      becomes this: |F.......R|
+        *      The entire chunk header can be updated in a single fail-safe
+        *      atomic operation because it's size is only 64 bytes.
+        */
+       MEMORY_BLOCK_HUGE,
+       /*
+        * Run memory blocks are chunks with CHUNK_TYPE_RUN and size index of 1.
+        * The entire chunk is subdivided into smaller blocks and has an
+        * additional metadata attached in the form of a bitmap - each bit
+        * corresponds to a single block.
+        * In this case there's no need to perform any coalescing or splitting
+        * on the persistent metadata.
+        * The bitmap is stored on a variable number of 64 bit values and
+        * because of the requirement of allocation fail-safe atomicity the
+        * maximum size index of a memory block from a run is 64 - since that's
+        * the limit of atomic write guarantee.
+        *
+        * The allocation/deallocation process is a single 8 byte write that
+        * sets/clears the corresponding bits. Depending on the user choice
+        * it can either be made atomically or using redo-log when grouped with
+        * other operations.
+        * It's also important to note that in a case of realloc it might so
+        * happen that a single 8 byte bitmap value has its bits both set and
+        * cleared - that's why the run memory block metadata changes operate
+        * on AND'ing or OR'ing a bitmask instead of directly setting the value.
+        */
+       MEMORY_BLOCK_RUN,
+
+       MAX_MEMORY_BLOCK
+};
+
+enum memblock_state {
+       MEMBLOCK_STATE_UNKNOWN,
+       MEMBLOCK_ALLOCATED,
+       MEMBLOCK_FREE,
+
+       MAX_MEMBLOCK_STATE,
+};
+
+/* runtime bitmap information for a run */
+struct run_bitmap {
+       unsigned nvalues; /* number of 8 byte values - size of values array */
+       unsigned nbits; /* number of valid bits */
+
+       size_t size; /* total size of the bitmap in bytes */
+
+       uint64_t *values; /* pointer to the bitmap's values array */
+};
+
+/* runtime information necessary to create a run */
+struct run_descriptor {
+       uint16_t flags; /* chunk flags for the run */
+       size_t unit_size; /* the size of a single unit in a run */
+       uint32_t size_idx; /* size index of a single run instance */
+       size_t alignment; /* required alignment of objects */
+       unsigned nallocs; /* number of allocs per run */
+       struct run_bitmap bitmap;
+};
+
+struct memory_block_ops {
+       /* returns memory block size */
+       size_t (*block_size)(const struct memory_block *m);
+
+       /* prepares header modification operation */
+       void (*prep_hdr)(const struct memory_block *m,
+               enum memblock_state dest_state, struct operation_context *ctx);
+
+       /* returns lock associated with memory block */
+       os_mutex_t *(*get_lock)(const struct memory_block *m);
+
+       /* returns whether a block is allocated or not */
+       enum memblock_state (*get_state)(const struct memory_block *m);
+
+       /* returns pointer to the data of a block */
+       void *(*get_user_data)(const struct memory_block *m);
+
+       /*
+        * Returns the size of a memory block without overhead.
+        * This is the size of a data block that can be used.
+        */
+       size_t (*get_user_size)(const struct memory_block *m);
+
+       /* returns pointer to the beginning of data of a run block */
+       void *(*get_real_data)(const struct memory_block *m);
+
+       /* returns the size of a memory block, including headers */
+       size_t (*get_real_size)(const struct memory_block *m);
+
+       /* writes a header of an allocation */
+       void (*write_header)(const struct memory_block *m,
+               uint64_t extra_field, uint16_t flags);
+       void (*invalidate)(const struct memory_block *m);
+
+       /*
+        * Checks the header type of a chunk matches the expected type and
+        * modifies it if necessary. This is fail-safe atomic.
+        */
+       void (*ensure_header_type)(const struct memory_block *m,
+               enum header_type t);
+
+       /*
+        * Reinitializes a block after a heap restart.
+        * This is called for EVERY allocation, but *only* under Valgrind.
+        */
+       void (*reinit_header)(const struct memory_block *m);
+
+       /* returns the extra field of an allocation */
+       uint64_t (*get_extra)(const struct memory_block *m);
+
+       /* returns the flags of an allocation */
+       uint16_t (*get_flags)(const struct memory_block *m);
+
+       /* initializes memblock in valgrind */
+       void (*vg_init)(const struct memory_block *m, int objects,
+               object_callback cb, void *arg);
+
+       /* iterates over every free block */
+       int (*iterate_free)(const struct memory_block *m,
+               object_callback cb, void *arg);
+
+       /* iterates over every used block */
+       int (*iterate_used)(const struct memory_block *m,
+               object_callback cb, void *arg);
+
+       /* calculates number of free units, valid only for runs */
+       void (*calc_free)(const struct memory_block *m,
+               uint32_t *free_space, uint32_t *max_free_block);
+
+       /* this is called exactly once for every existing chunk */
+       void (*reinit_chunk)(const struct memory_block *m);
+
+       /*
+        * Initializes bitmap data for a run.
+        * Do *not* use this function unless absolutely necessary, it breaks
+        * the abstraction layer by exposing implementation details.
+        */
+       void (*get_bitmap)(const struct memory_block *m, struct run_bitmap *b);
+
+       /* calculates the ratio between occupied and unoccupied space */
+       unsigned (*fill_pct)(const struct memory_block *m);
+};
+
+struct memory_block {
+       uint32_t chunk_id; /* index of the memory block in its zone */
+       uint32_t zone_id; /* index of this block zone in the heap */
+
+       /*
+        * Size index of the memory block represented in either multiple of
+        * CHUNKSIZE in the case of a huge chunk or in multiple of a run
+        * block size.
+        */
+       uint32_t size_idx;
+
+       /*
+        * Used only for run chunks, must be zeroed for huge.
+        * Number of preceding blocks in the chunk. In other words, the
+        * position of this memory block in run bitmap.
+        */
+       uint32_t block_off;
+
+       /*
+        * The variables below are associated with the memory block and are
+        * stored here for convenience. Those fields are filled by either the
+        * memblock_from_offset or memblock_rebuild_state, and they should not
+        * be modified manually.
+        */
+       const struct memory_block_ops *m_ops;
+       struct palloc_heap *heap;
+       enum header_type header_type;
+       enum memory_block_type type;
+       struct run_bitmap *cached_bitmap;
+};
+
+/*
+ * This is a representation of a run memory block that is active in a bucket or
+ * is on a pending list in the recycler.
+ * This structure should never be passed around by value because the address of
+ * the nresv variable can be in reservations made through palloc_reserve(). Only
+ * if the number of reservations equals 0 the structure can be moved/freed.
+ */
+struct memory_block_reserved {
+       struct memory_block m;
+
+       struct bucket *bucket;
+       /*
+        * Number of reservations made from this run, the pointer to this value
+        * is stored in a user facing pobj_action structure. Decremented once
+        * the reservation is published or canceled.
+        */
+       int nresv;
+};
+
+struct memory_block memblock_from_offset(struct palloc_heap *heap,
+       uint64_t off);
+struct memory_block memblock_from_offset_opt(struct palloc_heap *heap,
+       uint64_t off, int size);
+void memblock_rebuild_state(struct palloc_heap *heap, struct memory_block *m);
+
+struct memory_block memblock_huge_init(struct palloc_heap *heap,
+       uint32_t chunk_id, uint32_t zone_id, uint32_t size_idx);
+
+struct memory_block memblock_run_init(struct palloc_heap *heap,
+       uint32_t chunk_id, uint32_t zone_id, struct run_descriptor *rdsc);
+
+void memblock_run_bitmap(uint32_t *size_idx, uint16_t flags,
+       uint64_t unit_size, uint64_t alignment, void *content,
+       struct run_bitmap *b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/memops.c b/ceph/src/pmdk/src/libpmemobj/memops.c
new file mode 100644 (file)
index 0000000..81464e6
--- /dev/null
@@ -0,0 +1,837 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * memops.c -- aggregated memory operations helper implementation
+ *
+ * The operation collects all of the required memory modifications that
+ * need to happen in an atomic way (all of them or none), and abstracts
+ * away the storage type (transient/persistent) and the underlying
+ * implementation of how it's actually performed - in some cases using
+ * the redo log is unnecessary and the allocation process can be sped up
+ * a bit by completely omitting that whole machinery.
+ *
+ * The modifications are not visible until the context is processed.
+ */
+
+#include "memops.h"
+#include "obj.h"
+#include "out.h"
+#include "ravl.h"
+#include "valgrind_internal.h"
+#include "vecq.h"
+#include "sys_util.h"
+
+#define ULOG_BASE_SIZE 1024
+#define OP_MERGE_SEARCH 64
+
+enum operation_state {
+       OPERATION_IDLE,
+       OPERATION_IN_PROGRESS,
+       OPERATION_CLEANUP,
+};
+
+struct operation_log {
+       size_t capacity; /* capacity of the ulog log */
+       size_t offset; /* data offset inside of the log */
+       struct ulog *ulog; /* DRAM allocated log of modifications */
+};
+
+/*
+ * operation_context -- context of an ongoing palloc operation
+ */
+struct operation_context {
+       enum log_type type;
+
+       ulog_extend_fn extend; /* function to allocate next ulog */
+       ulog_free_fn ulog_free; /* function to free next ulogs */
+
+       const struct pmem_ops *p_ops;
+       struct pmem_ops t_ops; /* used for transient data processing */
+       struct pmem_ops s_ops; /* used for shadow copy data processing */
+
+       size_t ulog_curr_offset; /* offset in the log for buffer stores */
+       size_t ulog_curr_capacity; /* capacity of the current log */
+       size_t ulog_curr_gen_num; /* transaction counter in the current log */
+       struct ulog *ulog_curr; /* current persistent log */
+       size_t total_logged; /* total amount of buffer stores in the logs */
+
+       struct ulog *ulog; /* pointer to the persistent ulog log */
+       size_t ulog_base_nbytes; /* available bytes in initial ulog log */
+       size_t ulog_capacity; /* sum of capacity, incl all next ulog logs */
+       int ulog_auto_reserve; /* allow or do not to auto ulog reservation */
+       int ulog_any_user_buffer; /* set if any user buffer is added */
+
+       struct ulog_next next; /* vector of 'next' fields of persistent ulog */
+
+       enum operation_state state; /* operation sanity check */
+
+       struct operation_log pshadow_ops; /* shadow copy of persistent ulog */
+       struct operation_log transient_ops; /* log of transient changes */
+
+       /* collection used to look for potential merge candidates */
+       VECQ(, struct ulog_entry_val *) merge_entries;
+};
+
+/*
+ * operation_log_transient_init -- (internal) initialize operation log
+ *     containing transient memory resident changes
+ */
+static int
+operation_log_transient_init(struct operation_log *log)
+{
+       log->capacity = ULOG_BASE_SIZE;
+       log->offset = 0;
+
+       struct ulog *src = Zalloc(sizeof(struct ulog) +
+               ULOG_BASE_SIZE);
+       if (src == NULL) {
+               ERR("!Zalloc");
+               return -1;
+       }
+
+       /* initialize underlying redo log structure */
+       src->capacity = ULOG_BASE_SIZE;
+
+       log->ulog = src;
+
+       return 0;
+}
+
+/*
+ * operation_log_persistent_init -- (internal) initialize operation log
+ *     containing persistent memory resident changes
+ */
+static int
+operation_log_persistent_init(struct operation_log *log,
+       size_t ulog_base_nbytes)
+{
+       log->capacity = ULOG_BASE_SIZE;
+       log->offset = 0;
+
+       struct ulog *src = Zalloc(sizeof(struct ulog) +
+               ULOG_BASE_SIZE);
+       if (src == NULL) {
+               ERR("!Zalloc");
+               return -1;
+       }
+
+       /* initialize underlying redo log structure */
+       src->capacity = ulog_base_nbytes;
+       memset(src->unused, 0, sizeof(src->unused));
+
+       log->ulog = src;
+
+       return 0;
+}
+
+/*
+ * operation_transient_clean -- cleans pmemcheck address state
+ */
+static int
+operation_transient_clean(void *base, const void *addr, size_t len,
+       unsigned flags)
+{
+       VALGRIND_SET_CLEAN(addr, len);
+
+       return 0;
+}
+
+/*
+ * operation_transient_drain -- noop
+ */
+static void
+operation_transient_drain(void *base)
+{
+}
+
+/*
+ * operation_transient_memcpy -- transient memcpy wrapper
+ */
+static void *
+operation_transient_memcpy(void *base, void *dest, const void *src, size_t len,
+       unsigned flags)
+{
+       return memcpy(dest, src, len);
+}
+
+/*
+ * operation_new -- creates new operation context
+ */
+struct operation_context *
+operation_new(struct ulog *ulog, size_t ulog_base_nbytes,
+       ulog_extend_fn extend, ulog_free_fn ulog_free,
+       const struct pmem_ops *p_ops, enum log_type type)
+{
+       struct operation_context *ctx = Zalloc(sizeof(*ctx));
+       if (ctx == NULL) {
+               ERR("!Zalloc");
+               goto error_ctx_alloc;
+       }
+
+       ctx->ulog = ulog;
+       ctx->ulog_base_nbytes = ulog_base_nbytes;
+       ctx->ulog_capacity = ulog_capacity(ulog,
+               ulog_base_nbytes, p_ops);
+       ctx->extend = extend;
+       ctx->ulog_free = ulog_free;
+       ctx->state = OPERATION_IDLE;
+       VEC_INIT(&ctx->next);
+       ulog_rebuild_next_vec(ulog, &ctx->next, p_ops);
+       ctx->p_ops = p_ops;
+       ctx->type = type;
+       ctx->ulog_any_user_buffer = 0;
+
+       ctx->ulog_curr_offset = 0;
+       ctx->ulog_curr_capacity = 0;
+       ctx->ulog_curr = NULL;
+
+       ctx->t_ops.base = NULL;
+       ctx->t_ops.flush = operation_transient_clean;
+       ctx->t_ops.memcpy = operation_transient_memcpy;
+       ctx->t_ops.drain = operation_transient_drain;
+
+       ctx->s_ops.base = p_ops->base;
+       ctx->s_ops.flush = operation_transient_clean;
+       ctx->s_ops.memcpy = operation_transient_memcpy;
+       ctx->s_ops.drain = operation_transient_drain;
+
+       VECQ_INIT(&ctx->merge_entries);
+
+       if (operation_log_transient_init(&ctx->transient_ops) != 0)
+               goto error_ulog_alloc;
+
+       if (operation_log_persistent_init(&ctx->pshadow_ops,
+           ulog_base_nbytes) != 0)
+               goto error_ulog_alloc;
+
+       return ctx;
+
+error_ulog_alloc:
+       operation_delete(ctx);
+error_ctx_alloc:
+       return NULL;
+}
+
+/*
+ * operation_delete -- deletes operation context
+ */
+void
+operation_delete(struct operation_context *ctx)
+{
+       VECQ_DELETE(&ctx->merge_entries);
+       VEC_DELETE(&ctx->next);
+       Free(ctx->pshadow_ops.ulog);
+       Free(ctx->transient_ops.ulog);
+       Free(ctx);
+}
+
+/*
+ * operation_user_buffer_remove -- removes range from the tree and returns 0
+ */
+static int
+operation_user_buffer_remove(void *base, void *addr)
+{
+       PMEMobjpool *pop = base;
+       if (!pop->ulog_user_buffers.verify)
+               return 0;
+
+       util_mutex_lock(&pop->ulog_user_buffers.lock);
+
+       struct ravl *ravl = pop->ulog_user_buffers.map;
+       enum ravl_predicate predict = RAVL_PREDICATE_EQUAL;
+
+       struct user_buffer_def range;
+       range.addr = addr;
+       range.size = 0;
+
+       struct ravl_node *n = ravl_find(ravl, &range, predict);
+       ASSERTne(n, NULL);
+       ravl_remove(ravl, n);
+
+       util_mutex_unlock(&pop->ulog_user_buffers.lock);
+
+       return 0;
+}
+
+/*
+ * operation_free_logs -- free all logs except first
+ */
+void
+operation_free_logs(struct operation_context *ctx, uint64_t flags)
+{
+       int freed = ulog_free_next(ctx->ulog, ctx->p_ops, ctx->ulog_free,
+                       operation_user_buffer_remove, flags);
+       if (freed) {
+               ctx->ulog_capacity = ulog_capacity(ctx->ulog,
+                       ctx->ulog_base_nbytes, ctx->p_ops);
+               VEC_CLEAR(&ctx->next);
+               ulog_rebuild_next_vec(ctx->ulog, &ctx->next, ctx->p_ops);
+       }
+
+       ASSERTeq(VEC_SIZE(&ctx->next), 0);
+}
+
+/*
+ * operation_merge -- (internal) performs operation on a field
+ */
+static inline void
+operation_merge(struct ulog_entry_base *entry, uint64_t value,
+       ulog_operation_type type)
+{
+       struct ulog_entry_val *e = (struct ulog_entry_val *)entry;
+
+       switch (type) {
+               case ULOG_OPERATION_AND:
+                       e->value &= value;
+                       break;
+               case ULOG_OPERATION_OR:
+                       e->value |= value;
+                       break;
+               case ULOG_OPERATION_SET:
+                       e->value = value;
+                       break;
+               default:
+                       ASSERT(0); /* unreachable */
+       }
+}
+
+/*
+ * operation_try_merge_entry -- tries to merge the incoming log entry with
+ *     existing entries
+ *
+ * Because this requires a reverse foreach, it cannot be implemented using
+ * the on-media ulog log structure since there's no way to find what's
+ * the previous entry in the log. Instead, the last N entries are stored
+ * in a collection and traversed backwards.
+ */
+static int
+operation_try_merge_entry(struct operation_context *ctx,
+       void *ptr, uint64_t value, ulog_operation_type type)
+{
+       int ret = 0;
+       uint64_t offset = OBJ_PTR_TO_OFF(ctx->p_ops->base, ptr);
+
+       struct ulog_entry_val *e;
+       VECQ_FOREACH_REVERSE(e, &ctx->merge_entries) {
+               if (ulog_entry_offset(&e->base) == offset) {
+                       if (ulog_entry_type(&e->base) == type) {
+                               operation_merge(&e->base, value, type);
+                               return 1;
+                       } else {
+                               break;
+                       }
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * operation_merge_entry_add -- adds a new entry to the merge collection,
+ *     keeps capacity at OP_MERGE_SEARCH. Removes old entries in FIFO fashion.
+ */
+static void
+operation_merge_entry_add(struct operation_context *ctx,
+       struct ulog_entry_val *entry)
+{
+       if (VECQ_SIZE(&ctx->merge_entries) == OP_MERGE_SEARCH)
+               (void) VECQ_DEQUEUE(&ctx->merge_entries);
+
+       if (VECQ_ENQUEUE(&ctx->merge_entries, entry) != 0) {
+               /* this is fine, only runtime perf will get slower */
+               LOG(2, "out of memory - unable to track entries");
+       }
+}
+
+/*
+ * operation_add_typed_value -- adds new entry to the current operation, if the
+ *     same ptr address already exists and the operation type is set,
+ *     the new value is not added and the function has no effect.
+ */
+int
+operation_add_typed_entry(struct operation_context *ctx,
+       void *ptr, uint64_t value,
+       ulog_operation_type type, enum operation_log_type log_type)
+{
+       struct operation_log *oplog = log_type == LOG_PERSISTENT ?
+               &ctx->pshadow_ops : &ctx->transient_ops;
+
+       /*
+        * Always make sure to have one extra spare cacheline so that the
+        * ulog log entry creation has enough room for zeroing.
+        */
+       if (oplog->offset + CACHELINE_SIZE == oplog->capacity) {
+               size_t ncapacity = oplog->capacity + ULOG_BASE_SIZE;
+               struct ulog *ulog = Realloc(oplog->ulog,
+                       SIZEOF_ULOG(ncapacity));
+               if (ulog == NULL)
+                       return -1;
+               oplog->capacity += ULOG_BASE_SIZE;
+               oplog->ulog = ulog;
+               oplog->ulog->capacity = oplog->capacity;
+
+               /*
+                * Realloc invalidated the ulog entries that are inside of this
+                * vector, need to clear it to avoid use after free.
+                */
+               VECQ_CLEAR(&ctx->merge_entries);
+       }
+
+       if (log_type == LOG_PERSISTENT &&
+               operation_try_merge_entry(ctx, ptr, value, type) != 0)
+               return 0;
+
+       struct ulog_entry_val *entry = ulog_entry_val_create(
+               oplog->ulog, oplog->offset, ptr, value, type,
+               log_type == LOG_TRANSIENT ? &ctx->t_ops : &ctx->s_ops);
+
+       if (log_type == LOG_PERSISTENT)
+               operation_merge_entry_add(ctx, entry);
+
+       oplog->offset += ulog_entry_size(&entry->base);
+
+       return 0;
+}
+
+/*
+ * operation_add_value -- adds new entry to the current operation with
+ *     entry type autodetected based on the memory location
+ */
+int
+operation_add_entry(struct operation_context *ctx, void *ptr, uint64_t value,
+       ulog_operation_type type)
+{
+       const struct pmem_ops *p_ops = ctx->p_ops;
+       PMEMobjpool *pop = (PMEMobjpool *)p_ops->base;
+
+       int from_pool = OBJ_OFF_IS_VALID(pop,
+               (uintptr_t)ptr - (uintptr_t)p_ops->base);
+
+       return operation_add_typed_entry(ctx, ptr, value, type,
+               from_pool ? LOG_PERSISTENT : LOG_TRANSIENT);
+}
+
+/*
+ * operation_add_buffer -- adds a buffer operation to the log
+ */
+int
+operation_add_buffer(struct operation_context *ctx,
+       void *dest, void *src, size_t size, ulog_operation_type type)
+{
+       size_t real_size = size + sizeof(struct ulog_entry_buf);
+
+       /* if there's no space left in the log, reserve some more */
+       if (ctx->ulog_curr_capacity == 0) {
+               ctx->ulog_curr_gen_num = ctx->ulog->gen_num;
+               if (operation_reserve(ctx, ctx->total_logged + real_size) != 0)
+                       return -1;
+
+               ctx->ulog_curr = ctx->ulog_curr == NULL ? ctx->ulog :
+                       ulog_next(ctx->ulog_curr, ctx->p_ops);
+               ASSERTne(ctx->ulog_curr, NULL);
+               ctx->ulog_curr_offset = 0;
+               ctx->ulog_curr_capacity = ctx->ulog_curr->capacity;
+       }
+
+       size_t curr_size = MIN(real_size, ctx->ulog_curr_capacity);
+       size_t data_size = curr_size - sizeof(struct ulog_entry_buf);
+       size_t entry_size = ALIGN_UP(curr_size, CACHELINE_SIZE);
+
+       /*
+        * To make sure that the log is consistent and contiguous, we need
+        * make sure that the header of the entry that would be located
+        * immediately after this one is zeroed.
+        */
+       struct ulog_entry_base *next_entry = NULL;
+       if (entry_size == ctx->ulog_curr_capacity) {
+               struct ulog *u = ulog_next(ctx->ulog_curr, ctx->p_ops);
+               if (u != NULL)
+                       next_entry = (struct ulog_entry_base *)u->data;
+       } else {
+               size_t next_entry_offset = ctx->ulog_curr_offset + entry_size;
+               next_entry = (struct ulog_entry_base *)(ctx->ulog_curr->data +
+                       next_entry_offset);
+       }
+       if (next_entry != NULL)
+               ulog_clobber_entry(next_entry, ctx->p_ops);
+
+       /* create a persistent log entry */
+       struct ulog_entry_buf *e = ulog_entry_buf_create(ctx->ulog_curr,
+               ctx->ulog_curr_offset,
+               ctx->ulog_curr_gen_num,
+               dest, src, data_size,
+               type, ctx->p_ops);
+       ASSERT(entry_size == ulog_entry_size(&e->base));
+       ASSERT(entry_size <= ctx->ulog_curr_capacity);
+
+       ctx->total_logged += entry_size;
+       ctx->ulog_curr_offset += entry_size;
+       ctx->ulog_curr_capacity -= entry_size;
+
+       /*
+        * Recursively add the data to the log until the entire buffer is
+        * processed.
+        */
+       return size - data_size == 0 ? 0 : operation_add_buffer(ctx,
+                       (char *)dest + data_size,
+                       (char *)src + data_size,
+                       size - data_size, type);
+}
+
+/*
+ * operation_user_buffer_range_cmp -- compares addresses of
+ * user buffers
+ */
+int
+operation_user_buffer_range_cmp(const void *lhs, const void *rhs)
+{
+       const struct user_buffer_def *l = lhs;
+       const struct user_buffer_def *r = rhs;
+
+       if (l->addr > r->addr)
+               return 1;
+       else if (l->addr < r->addr)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * operation_user_buffer_try_insert -- adds a user buffer range to the tree,
+ * if the buffer already exists in the tree function returns -1, otherwise
+ * it returns 0
+ */
+static int
+operation_user_buffer_try_insert(PMEMobjpool *pop,
+       struct user_buffer_def *userbuf)
+{
+       int ret = 0;
+
+       if (!pop->ulog_user_buffers.verify)
+               return ret;
+
+       util_mutex_lock(&pop->ulog_user_buffers.lock);
+
+       void *addr_end = (char *)userbuf->addr + userbuf->size;
+       struct user_buffer_def search;
+       search.addr = addr_end;
+       struct ravl_node *n = ravl_find(pop->ulog_user_buffers.map,
+               &search, RAVL_PREDICATE_LESS_EQUAL);
+       if (n != NULL) {
+               struct user_buffer_def *r = ravl_data(n);
+               void *r_end = (char *)r->addr + r->size;
+
+               if (r_end > userbuf->addr && r->addr < addr_end) {
+                       /* what was found overlaps with what is being added */
+                       ret = -1;
+                       goto out;
+               }
+       }
+
+       if (ravl_emplace_copy(pop->ulog_user_buffers.map, userbuf) == -1) {
+               ASSERTne(errno, EEXIST);
+               ret = -1;
+       }
+
+out:
+       util_mutex_unlock(&pop->ulog_user_buffers.lock);
+       return ret;
+}
+
+/*
+ * operation_user_buffer_verify_align -- verify if the provided buffer can be
+ *     used as a transaction log, and if so - perform necessary alignments
+ */
+int
+operation_user_buffer_verify_align(struct operation_context *ctx,
+               struct user_buffer_def *userbuf)
+{
+       /*
+        * Address of the buffer has to be aligned up, and the size
+        * has to be aligned down, taking into account the number of bytes
+        * the address was incremented by. The remaining size has to be large
+        * enough to contain the header and at least one ulog entry.
+        */
+       uint64_t buffer_offset = OBJ_PTR_TO_OFF(ctx->p_ops->base,
+               userbuf->addr);
+       ptrdiff_t size_diff = (intptr_t)ulog_by_offset(buffer_offset,
+               ctx->p_ops) - (intptr_t)userbuf->addr;
+       ssize_t capacity_unaligned = (ssize_t)userbuf->size - size_diff
+               - (ssize_t)sizeof(struct ulog);
+       if (capacity_unaligned < (ssize_t)CACHELINE_SIZE) {
+               ERR("Capacity insufficient");
+               return -1;
+       }
+
+       size_t capacity_aligned = ALIGN_DOWN((size_t)capacity_unaligned,
+               CACHELINE_SIZE);
+
+       userbuf->addr = ulog_by_offset(buffer_offset, ctx->p_ops);
+       userbuf->size = capacity_aligned + sizeof(struct ulog);
+
+       if (operation_user_buffer_try_insert(ctx->p_ops->base, userbuf)) {
+               ERR("Buffer currently used");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * operation_add_user_buffer -- add user buffer to the ulog
+ */
+void
+operation_add_user_buffer(struct operation_context *ctx,
+               struct user_buffer_def *userbuf)
+{
+       uint64_t buffer_offset = OBJ_PTR_TO_OFF(ctx->p_ops->base,
+               userbuf->addr);
+       size_t capacity = userbuf->size - sizeof(struct ulog);
+
+       ulog_construct(buffer_offset, capacity, ctx->ulog->gen_num,
+                       1, ULOG_USER_OWNED, ctx->p_ops);
+
+       struct ulog *last_log;
+       /* if there is only one log */
+       if (!VEC_SIZE(&ctx->next))
+               last_log = ctx->ulog;
+       else /* get last element from vector */
+               last_log = ulog_by_offset(VEC_BACK(&ctx->next), ctx->p_ops);
+
+       ASSERTne(last_log, NULL);
+       size_t next_size = sizeof(last_log->next);
+       VALGRIND_ADD_TO_TX(&last_log->next, next_size);
+       last_log->next = buffer_offset;
+       pmemops_persist(ctx->p_ops, &last_log->next, next_size);
+
+       VEC_PUSH_BACK(&ctx->next, buffer_offset);
+       ctx->ulog_capacity += capacity;
+       operation_set_any_user_buffer(ctx, 1);
+}
+
+/*
+ * operation_set_auto_reserve -- set auto reserve value for context
+ */
+void
+operation_set_auto_reserve(struct operation_context *ctx, int auto_reserve)
+{
+       ctx->ulog_auto_reserve = auto_reserve;
+}
+
+/*
+ * operation_set_any_user_buffer -- set ulog_any_user_buffer value for context
+ */
+void
+operation_set_any_user_buffer(struct operation_context *ctx,
+       int any_user_buffer)
+{
+       ctx->ulog_any_user_buffer = any_user_buffer;
+}
+
+/*
+ * operation_get_any_user_buffer -- get ulog_any_user_buffer value from context
+ */
+int
+operation_get_any_user_buffer(struct operation_context *ctx)
+{
+       return ctx->ulog_any_user_buffer;
+}
+
+/*
+ * operation_process_persistent_redo -- (internal) process using ulog
+ */
+static void
+operation_process_persistent_redo(struct operation_context *ctx)
+{
+       ASSERTeq(ctx->pshadow_ops.capacity % CACHELINE_SIZE, 0);
+
+       ulog_store(ctx->ulog, ctx->pshadow_ops.ulog,
+               ctx->pshadow_ops.offset, ctx->ulog_base_nbytes,
+               ctx->ulog_capacity,
+               &ctx->next, ctx->p_ops);
+
+       ulog_process(ctx->pshadow_ops.ulog, OBJ_OFF_IS_VALID_FROM_CTX,
+               ctx->p_ops);
+
+       ulog_clobber(ctx->ulog, &ctx->next, ctx->p_ops);
+}
+
+/*
+ * operation_process_persistent_undo -- (internal) process using ulog
+ */
+static void
+operation_process_persistent_undo(struct operation_context *ctx)
+{
+       ASSERTeq(ctx->pshadow_ops.capacity % CACHELINE_SIZE, 0);
+
+       ulog_process(ctx->ulog, OBJ_OFF_IS_VALID_FROM_CTX, ctx->p_ops);
+}
+
+/*
+ * operation_reserve -- (internal) reserves new capacity in persistent ulog log
+ */
+int
+operation_reserve(struct operation_context *ctx, size_t new_capacity)
+{
+       if (new_capacity > ctx->ulog_capacity) {
+               if (ctx->extend == NULL) {
+                       ERR("no extend function present");
+                       return -1;
+               }
+
+               if (ulog_reserve(ctx->ulog,
+                   ctx->ulog_base_nbytes,
+                   ctx->ulog_curr_gen_num,
+                   ctx->ulog_auto_reserve,
+                   &new_capacity, ctx->extend,
+                   &ctx->next, ctx->p_ops) != 0)
+                       return -1;
+               ctx->ulog_capacity = new_capacity;
+       }
+
+       return 0;
+}
+
+/*
+ * operation_init -- initializes runtime state of an operation
+ */
+void
+operation_init(struct operation_context *ctx)
+{
+       struct operation_log *plog = &ctx->pshadow_ops;
+       struct operation_log *tlog = &ctx->transient_ops;
+
+       VALGRIND_ANNOTATE_NEW_MEMORY(ctx, sizeof(*ctx));
+       VALGRIND_ANNOTATE_NEW_MEMORY(tlog->ulog, sizeof(struct ulog) +
+               tlog->capacity);
+       VALGRIND_ANNOTATE_NEW_MEMORY(plog->ulog, sizeof(struct ulog) +
+               plog->capacity);
+       tlog->offset = 0;
+       plog->offset = 0;
+       VECQ_REINIT(&ctx->merge_entries);
+
+       ctx->ulog_curr_offset = 0;
+       ctx->ulog_curr_capacity = 0;
+       ctx->ulog_curr_gen_num = 0;
+       ctx->ulog_curr = NULL;
+       ctx->total_logged = 0;
+       ctx->ulog_auto_reserve = 1;
+       ctx->ulog_any_user_buffer = 0;
+}
+
+/*
+ * operation_start -- initializes and starts a new operation
+ */
+void
+operation_start(struct operation_context *ctx)
+{
+       operation_init(ctx);
+       ASSERTeq(ctx->state, OPERATION_IDLE);
+       ctx->state = OPERATION_IN_PROGRESS;
+}
+
+void
+operation_resume(struct operation_context *ctx)
+{
+       operation_start(ctx);
+       ctx->total_logged = ulog_base_nbytes(ctx->ulog);
+}
+
+/*
+ * operation_cancel -- cancels a running operation
+ */
+void
+operation_cancel(struct operation_context *ctx)
+{
+       ASSERTeq(ctx->state, OPERATION_IN_PROGRESS);
+       ctx->state = OPERATION_IDLE;
+}
+
+/*
+ * operation_process -- processes registered operations
+ *
+ * The order of processing is important: persistent, transient.
+ * This is because the transient entries that reside on persistent memory might
+ * require write to a location that is currently occupied by a valid persistent
+ * state but becomes a transient state after operation is processed.
+ */
+void
+operation_process(struct operation_context *ctx)
+{
+       /*
+        * If there's exactly one persistent entry there's no need to involve
+        * the redo log. We can simply assign the value, the operation will be
+        * atomic.
+        */
+       int redo_process = ctx->type == LOG_TYPE_REDO &&
+               ctx->pshadow_ops.offset != 0;
+       if (redo_process &&
+           ctx->pshadow_ops.offset == sizeof(struct ulog_entry_val)) {
+               struct ulog_entry_base *e = (struct ulog_entry_base *)
+                       ctx->pshadow_ops.ulog->data;
+               ulog_operation_type t = ulog_entry_type(e);
+               if (t == ULOG_OPERATION_SET || t == ULOG_OPERATION_AND ||
+                   t == ULOG_OPERATION_OR) {
+                       ulog_entry_apply(e, 1, ctx->p_ops);
+                       redo_process = 0;
+               }
+       }
+
+       if (redo_process) {
+               operation_process_persistent_redo(ctx);
+               ctx->state = OPERATION_CLEANUP;
+       } else if (ctx->type == LOG_TYPE_UNDO && ctx->total_logged != 0) {
+               operation_process_persistent_undo(ctx);
+               ctx->state = OPERATION_CLEANUP;
+       }
+
+       /* process transient entries with transient memory ops */
+       if (ctx->transient_ops.offset != 0)
+               ulog_process(ctx->transient_ops.ulog, NULL, &ctx->t_ops);
+}
+
+/*
+ * operation_finish -- finalizes the operation
+ */
+void
+operation_finish(struct operation_context *ctx, unsigned flags)
+{
+       ASSERTne(ctx->state, OPERATION_IDLE);
+
+       if (ctx->type == LOG_TYPE_UNDO && ctx->total_logged != 0)
+               ctx->state = OPERATION_CLEANUP;
+
+       if (ctx->ulog_any_user_buffer) {
+               flags |= ULOG_ANY_USER_BUFFER;
+               ctx->state = OPERATION_CLEANUP;
+       }
+
+       if (ctx->state != OPERATION_CLEANUP)
+               goto out;
+
+       if (ctx->type == LOG_TYPE_UNDO) {
+               int ret = ulog_clobber_data(ctx->ulog,
+                       ctx->total_logged, ctx->ulog_base_nbytes,
+                       &ctx->next, ctx->ulog_free,
+                       operation_user_buffer_remove,
+                       ctx->p_ops, flags);
+               if (ret == 0)
+                       goto out;
+       } else if (ctx->type == LOG_TYPE_REDO) {
+               int ret = ulog_free_next(ctx->ulog, ctx->p_ops,
+                       ctx->ulog_free, operation_user_buffer_remove,
+                       flags);
+               if (ret == 0)
+                       goto out;
+       }
+
+       /* clobbering shrunk the ulog */
+       ctx->ulog_capacity = ulog_capacity(ctx->ulog,
+               ctx->ulog_base_nbytes, ctx->p_ops);
+       VEC_CLEAR(&ctx->next);
+       ulog_rebuild_next_vec(ctx->ulog, &ctx->next, ctx->p_ops);
+
+out:
+       ctx->state = OPERATION_IDLE;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/memops.h b/ceph/src/pmdk/src/libpmemobj/memops.h
new file mode 100644 (file)
index 0000000..b05948e
--- /dev/null
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * memops.h -- aggregated memory operations helper definitions
+ */
+
+#ifndef LIBPMEMOBJ_MEMOPS_H
+#define LIBPMEMOBJ_MEMOPS_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "vec.h"
+#include "pmemops.h"
+#include "ulog.h"
+#include "lane.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum operation_log_type {
+       LOG_PERSISTENT, /* log of persistent modifications */
+       LOG_TRANSIENT, /* log of transient memory modifications */
+
+       MAX_OPERATION_LOG_TYPE
+};
+
+enum log_type {
+       LOG_TYPE_UNDO,
+       LOG_TYPE_REDO,
+
+       MAX_LOG_TYPE,
+};
+
+struct user_buffer_def {
+       void *addr;
+       size_t size;
+};
+
+struct operation_context;
+
+struct operation_context *
+operation_new(struct ulog *redo, size_t ulog_base_nbytes,
+       ulog_extend_fn extend, ulog_free_fn ulog_free,
+       const struct pmem_ops *p_ops, enum log_type type);
+
+void operation_init(struct operation_context *ctx);
+void operation_start(struct operation_context *ctx);
+void operation_resume(struct operation_context *ctx);
+
+void operation_delete(struct operation_context *ctx);
+void operation_free_logs(struct operation_context *ctx, uint64_t flags);
+
+int operation_add_buffer(struct operation_context *ctx,
+       void *dest, void *src, size_t size, ulog_operation_type type);
+
+int operation_add_entry(struct operation_context *ctx,
+       void *ptr, uint64_t value, ulog_operation_type type);
+int operation_add_typed_entry(struct operation_context *ctx,
+       void *ptr, uint64_t value,
+       ulog_operation_type type, enum operation_log_type log_type);
+int operation_user_buffer_verify_align(struct operation_context *ctx,
+               struct user_buffer_def *userbuf);
+void operation_add_user_buffer(struct operation_context *ctx,
+               struct user_buffer_def *userbuf);
+void operation_set_auto_reserve(struct operation_context *ctx,
+               int auto_reserve);
+void operation_set_any_user_buffer(struct operation_context *ctx,
+       int any_user_buffer);
+int operation_get_any_user_buffer(struct operation_context *ctx);
+int operation_user_buffer_range_cmp(const void *lhs, const void *rhs);
+
+int operation_reserve(struct operation_context *ctx, size_t new_capacity);
+void operation_process(struct operation_context *ctx);
+void operation_finish(struct operation_context *ctx, unsigned flags);
+void operation_cancel(struct operation_context *ctx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/obj.c b/ceph/src/pmdk/src/libpmemobj/obj.c
new file mode 100644 (file)
index 0000000..13abe2a
--- /dev/null
@@ -0,0 +1,3447 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * obj.c -- transactional object store implementation
+ */
+#include <inttypes.h>
+#include <limits.h>
+#include <wchar.h>
+#include <stdbool.h>
+
+#include "valgrind_internal.h"
+#include "libpmem.h"
+#include "memblock.h"
+#include "critnib.h"
+#include "list.h"
+#include "mmap.h"
+#include "obj.h"
+#include "ctl_global.h"
+#include "ravl.h"
+
+#include "heap_layout.h"
+#include "os.h"
+#include "os_thread.h"
+#include "pmemops.h"
+#include "set.h"
+#include "sync.h"
+#include "tx.h"
+#include "sys_util.h"
+
+/*
+ * The variable from which the config is directly loaded. The string
+ * cannot contain any comments or extraneous white characters.
+ */
+#define OBJ_CONFIG_ENV_VARIABLE "PMEMOBJ_CONF"
+
+/*
+ * The variable that points to a config file from which the config is loaded.
+ */
+#define OBJ_CONFIG_FILE_ENV_VARIABLE "PMEMOBJ_CONF_FILE"
+
+/*
+ * The variable which overwrites a number of lanes available at runtime.
+ */
+#define OBJ_NLANES_ENV_VARIABLE "PMEMOBJ_NLANES"
+
+#define OBJ_X_VALID_FLAGS PMEMOBJ_F_RELAXED
+
+static const struct pool_attr Obj_create_attr = {
+               OBJ_HDR_SIG,
+               OBJ_FORMAT_MAJOR,
+               OBJ_FORMAT_FEAT_DEFAULT,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+static const struct pool_attr Obj_open_attr = {
+               OBJ_HDR_SIG,
+               OBJ_FORMAT_MAJOR,
+               OBJ_FORMAT_FEAT_CHECK,
+               {0}, {0}, {0}, {0}, {0}
+};
+
+static struct critnib *pools_ht; /* hash table used for searching by UUID */
+static struct critnib *pools_tree; /* tree used for searching by address */
+
+int _pobj_cache_invalidate;
+
+#ifndef _WIN32
+
+__thread struct _pobj_pcache _pobj_cached_pool;
+
+/*
+ * pmemobj_direct -- returns the direct pointer of an object
+ */
+void *
+pmemobj_direct(PMEMoid oid)
+{
+       return pmemobj_direct_inline(oid);
+}
+
+#else /* _WIN32 */
+
+/*
+ * XXX - this is a temporary implementation
+ *
+ * Seems like we could still use TLS and simply substitute "__thread" with
+ * "__declspec(thread)", however it's not clear if it would work correctly
+ * with Windows DLL's.
+ * Need to verify that once we have the multi-threaded tests ported.
+ */
+
+struct _pobj_pcache {
+       PMEMobjpool *pop;
+       uint64_t uuid_lo;
+       int invalidate;
+};
+
+static os_once_t Cached_pool_key_once = OS_ONCE_INIT;
+static os_tls_key_t Cached_pool_key;
+
+/*
+ * _Cached_pool_key_alloc -- (internal) allocate pool cache pthread key
+ */
+static void
+_Cached_pool_key_alloc(void)
+{
+       int pth_ret = os_tls_key_create(&Cached_pool_key, free);
+       if (pth_ret)
+               FATAL("!os_tls_key_create");
+}
+
+/*
+ * pmemobj_direct -- returns the direct pointer of an object
+ */
+void *
+pmemobj_direct(PMEMoid oid)
+{
+       if (oid.off == 0 || oid.pool_uuid_lo == 0)
+               return NULL;
+
+       struct _pobj_pcache *pcache = os_tls_get(Cached_pool_key);
+       if (pcache == NULL) {
+               pcache = calloc(sizeof(struct _pobj_pcache), 1);
+               if (pcache == NULL)
+                       FATAL("!pcache malloc");
+               int ret = os_tls_set(Cached_pool_key, pcache);
+               if (ret)
+                       FATAL("!os_tls_set");
+       }
+
+       if (_pobj_cache_invalidate != pcache->invalidate ||
+           pcache->uuid_lo != oid.pool_uuid_lo) {
+               pcache->invalidate = _pobj_cache_invalidate;
+
+               if ((pcache->pop = pmemobj_pool_by_oid(oid)) == NULL) {
+                       pcache->uuid_lo = 0;
+                       return NULL;
+               }
+
+               pcache->uuid_lo = oid.pool_uuid_lo;
+       }
+
+       return (void *)((uintptr_t)pcache->pop + oid.off);
+}
+
+#endif /* _WIN32 */
+
+/*
+ * obj_ctl_init_and_load -- (static) initializes CTL and loads configuration
+ *     from env variable and file
+ */
+static int
+obj_ctl_init_and_load(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       if (pop != NULL && (pop->ctl = ctl_new()) == NULL) {
+               LOG(2, "!ctl_new");
+               return -1;
+       }
+
+       if (pop) {
+               tx_ctl_register(pop);
+               pmalloc_ctl_register(pop);
+               stats_ctl_register(pop);
+               debug_ctl_register(pop);
+       }
+
+       char *env_config = os_getenv(OBJ_CONFIG_ENV_VARIABLE);
+       if (env_config != NULL) {
+               if (ctl_load_config_from_string(pop ? pop->ctl : NULL,
+                               pop, env_config) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "environment variable",
+                               OBJ_CONFIG_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       char *env_config_file = os_getenv(OBJ_CONFIG_FILE_ENV_VARIABLE);
+       if (env_config_file != NULL && env_config_file[0] != '\0') {
+               if (ctl_load_config_from_file(pop ? pop->ctl : NULL,
+                               pop, env_config_file) != 0) {
+                       LOG(2, "unable to parse config stored in %s "
+                               "file (from %s environment variable)",
+                               env_config_file,
+                               OBJ_CONFIG_FILE_ENV_VARIABLE);
+                       goto err;
+               }
+       }
+
+       return 0;
+err:
+       if (pop)
+               ctl_delete(pop->ctl);
+       return -1;
+}
+
+/*
+ * obj_pool_init -- (internal) allocate global structs holding all opened pools
+ *
+ * This is invoked on a first call to pmemobj_open() or pmemobj_create().
+ * Memory is released in library destructor.
+ *
+ * This function needs to be threadsafe.
+ */
+static void
+obj_pool_init(void)
+{
+       LOG(3, NULL);
+
+       struct critnib *c;
+
+       if (pools_ht == NULL) {
+               c = critnib_new();
+               if (c == NULL)
+                       FATAL("!critnib_new for pools_ht");
+               if (!util_bool_compare_and_swap64(&pools_ht, NULL, c))
+                       critnib_delete(c);
+       }
+
+       if (pools_tree == NULL) {
+               c = critnib_new();
+               if (c == NULL)
+                       FATAL("!critnib_new for pools_tree");
+               if (!util_bool_compare_and_swap64(&pools_tree, NULL, c))
+                       critnib_delete(c);
+       }
+}
+
+/*
+ * pmemobj_oid -- return a PMEMoid based on the virtual address
+ *
+ * If the address does not belong to any pool OID_NULL is returned.
+ */
+PMEMoid
+pmemobj_oid(const void *addr)
+{
+       PMEMobjpool *pop = pmemobj_pool_by_ptr(addr);
+       if (pop == NULL)
+               return OID_NULL;
+
+       PMEMoid oid = {pop->uuid_lo, (uintptr_t)addr - (uintptr_t)pop};
+       return oid;
+}
+
+/*
+ * obj_init -- initialization of obj
+ *
+ * Called by constructor.
+ */
+void
+obj_init(void)
+{
+       LOG(3, NULL);
+
+       COMPILE_ERROR_ON(sizeof(struct pmemobjpool) !=
+               POOL_HDR_SIZE + POOL_DESC_SIZE);
+
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_NODRAIN != PMEM_F_MEM_NODRAIN);
+
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_NONTEMPORAL != PMEM_F_MEM_NONTEMPORAL);
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_TEMPORAL != PMEM_F_MEM_TEMPORAL);
+
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_WC != PMEM_F_MEM_WC);
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_WB != PMEM_F_MEM_WB);
+
+       COMPILE_ERROR_ON(PMEMOBJ_F_MEM_NOFLUSH != PMEM_F_MEM_NOFLUSH);
+
+#ifdef _WIN32
+       /* XXX - temporary implementation (see above) */
+       os_once(&Cached_pool_key_once, _Cached_pool_key_alloc);
+#endif
+       /*
+        * Load global config, ignore any issues. They will be caught on the
+        * subsequent call to this function for individual pools.
+        */
+       ctl_global_register();
+
+       if (obj_ctl_init_and_load(NULL))
+               FATAL("error: %s", pmemobj_errormsg());
+
+       lane_info_boot();
+
+       util_remote_init();
+}
+
+/*
+ * obj_fini -- cleanup of obj
+ *
+ * Called by destructor.
+ */
+void
+obj_fini(void)
+{
+       LOG(3, NULL);
+
+       if (pools_ht)
+               critnib_delete(pools_ht);
+       if (pools_tree)
+               critnib_delete(pools_tree);
+       lane_info_destroy();
+       util_remote_fini();
+
+#ifdef _WIN32
+       (void) os_tls_key_delete(Cached_pool_key);
+#endif
+}
+
+/*
+ * obj_drain_empty -- (internal) empty function for drain on non-pmem memory
+ */
+static void
+obj_drain_empty(void)
+{
+       /* do nothing */
+}
+
+/*
+ * obj_msync_nofail -- (internal) pmem_msync wrapper that never fails from
+ * caller's perspective
+ */
+static void
+obj_msync_nofail(const void *addr, size_t size)
+{
+       if (pmem_msync(addr, size))
+               FATAL("!pmem_msync");
+}
+
+/*
+ * obj_nopmem_memcpy -- (internal) memcpy followed by an msync
+ */
+static void *
+obj_nopmem_memcpy(void *dest, const void *src, size_t len, unsigned flags)
+{
+       LOG(15, "dest %p src %p len %zu flags 0x%x", dest, src, len, flags);
+
+       /*
+        * Use pmem_memcpy instead of memcpy, because pmemobj_memcpy is supposed
+        * to guarantee that multiple of 8 byte stores to 8 byte aligned
+        * addresses are fail safe atomic. pmem_memcpy guarantees that, while
+        * libc memcpy does not.
+        */
+       pmem_memcpy(dest, src, len, PMEM_F_MEM_NOFLUSH);
+       obj_msync_nofail(dest, len);
+       return dest;
+}
+
+/*
+ * obj_nopmem_memmove -- (internal) memmove followed by an msync
+ */
+static void *
+obj_nopmem_memmove(void *dest, const void *src, size_t len, unsigned flags)
+{
+       LOG(15, "dest %p src %p len %zu flags 0x%x", dest, src, len, flags);
+
+       /* see comment in obj_nopmem_memcpy */
+       pmem_memmove(dest, src, len, PMEM_F_MEM_NOFLUSH);
+       obj_msync_nofail(dest, len);
+       return dest;
+}
+
+/*
+ * obj_nopmem_memset -- (internal) memset followed by an msync
+ */
+static void *
+obj_nopmem_memset(void *dest, int c, size_t len, unsigned flags)
+{
+       LOG(15, "dest %p c 0x%02x len %zu flags 0x%x", dest, c, len, flags);
+
+       /* see comment in obj_nopmem_memcpy */
+       pmem_memset(dest, c, len, PMEM_F_MEM_NOFLUSH);
+       obj_msync_nofail(dest, len);
+       return dest;
+}
+
+/*
+ * obj_remote_persist -- (internal) remote persist function
+ */
+static int
+obj_remote_persist(PMEMobjpool *pop, const void *addr, size_t len,
+                       unsigned lane, unsigned flags)
+{
+       LOG(15, "pop %p addr %p len %zu lane %u flags %u",
+               pop, addr, len, lane, flags);
+
+       ASSERTne(pop->rpp, NULL);
+
+       uintptr_t offset = (uintptr_t)addr - pop->remote_base;
+
+       unsigned rpmem_flags = 0;
+       if (flags & PMEMOBJ_F_RELAXED)
+               rpmem_flags |= RPMEM_PERSIST_RELAXED;
+
+       int rv = Rpmem_persist(pop->rpp, offset, len, lane, rpmem_flags);
+       if (rv) {
+               ERR("!rpmem_persist(rpp %p offset %zu length %zu lane %u)"
+                       " FATAL ERROR (returned value %i)",
+                       pop->rpp, offset, len, lane, rv);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * XXX - Consider removing obj_norep_*() wrappers to call *_local()
+ * functions directly.  Alternatively, always use obj_rep_*(), even
+ * if there are no replicas.  Verify the performance penalty.
+ */
+
+/*
+ * obj_norep_memcpy -- (internal) memcpy w/o replication
+ */
+static void *
+obj_norep_memcpy(void *ctx, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       return pop->memcpy_local(dest, src, len,
+                                       flags & PMEM_F_MEM_VALID_FLAGS);
+}
+
+/*
+ * obj_norep_memmove -- (internal) memmove w/o replication
+ */
+static void *
+obj_norep_memmove(void *ctx, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       return pop->memmove_local(dest, src, len,
+                                       flags & PMEM_F_MEM_VALID_FLAGS);
+}
+
+/*
+ * obj_norep_memset -- (internal) memset w/o replication
+ */
+static void *
+obj_norep_memset(void *ctx, void *dest, int c, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p c 0x%02x len %zu flags 0x%x", pop, dest, c, len,
+                       flags);
+
+       return pop->memset_local(dest, c, len, flags & PMEM_F_MEM_VALID_FLAGS);
+}
+
+/*
+ * obj_norep_persist -- (internal) persist w/o replication
+ */
+static int
+obj_norep_persist(void *ctx, const void *addr, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       pop->persist_local(addr, len);
+
+       return 0;
+}
+
+/*
+ * obj_norep_flush -- (internal) flush w/o replication
+ */
+static int
+obj_norep_flush(void *ctx, const void *addr, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       pop->flush_local(addr, len);
+
+       return 0;
+}
+
+/*
+ * obj_norep_drain -- (internal) drain w/o replication
+ */
+static void
+obj_norep_drain(void *ctx)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p", pop);
+
+       pop->drain_local();
+}
+
+static void obj_pool_cleanup(PMEMobjpool *pop);
+
+/*
+ * obj_handle_remote_persist_error -- (internal) handle remote persist
+ *                                    fatal error
+ */
+static void
+obj_handle_remote_persist_error(PMEMobjpool *pop)
+{
+       LOG(1, "pop %p", pop);
+
+       ERR("error clean up...");
+       obj_pool_cleanup(pop);
+
+       FATAL("Fatal error of remote persist. Aborting...");
+}
+
+/*
+ * obj_rep_memcpy -- (internal) memcpy with replication
+ */
+static void *
+obj_rep_memcpy(void *ctx, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       unsigned lane = UINT_MAX;
+
+       if (pop->has_remote_replicas)
+               lane = lane_hold(pop, NULL);
+
+       void *ret = pop->memcpy_local(dest, src, len, flags);
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               void *rdest = (char *)rep + (uintptr_t)dest - (uintptr_t)pop;
+               if (rep->rpp == NULL) {
+                       rep->memcpy_local(rdest, src, len,
+                                               flags & PMEM_F_MEM_VALID_FLAGS);
+               } else {
+                       if (rep->persist_remote(rep, rdest, len, lane, flags))
+                               obj_handle_remote_persist_error(pop);
+               }
+               rep = rep->replica;
+       }
+
+       if (pop->has_remote_replicas)
+               lane_release(pop);
+
+       return ret;
+}
+
+/*
+ * obj_rep_memmove -- (internal) memmove with replication
+ */
+static void *
+obj_rep_memmove(void *ctx, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       unsigned lane = UINT_MAX;
+
+       if (pop->has_remote_replicas)
+               lane = lane_hold(pop, NULL);
+
+       void *ret = pop->memmove_local(dest, src, len, flags);
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               void *rdest = (char *)rep + (uintptr_t)dest - (uintptr_t)pop;
+               if (rep->rpp == NULL) {
+                       rep->memmove_local(rdest, src, len,
+                                               flags & PMEM_F_MEM_VALID_FLAGS);
+               } else {
+                       if (rep->persist_remote(rep, rdest, len, lane, flags))
+                               obj_handle_remote_persist_error(pop);
+               }
+               rep = rep->replica;
+       }
+
+       if (pop->has_remote_replicas)
+               lane_release(pop);
+
+       return ret;
+}
+
+/*
+ * obj_rep_memset -- (internal) memset with replication
+ */
+static void *
+obj_rep_memset(void *ctx, void *dest, int c, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p dest %p c 0x%02x len %zu flags 0x%x", pop, dest, c, len,
+                       flags);
+
+       unsigned lane = UINT_MAX;
+
+       if (pop->has_remote_replicas)
+               lane = lane_hold(pop, NULL);
+
+       void *ret = pop->memset_local(dest, c, len, flags);
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               void *rdest = (char *)rep + (uintptr_t)dest - (uintptr_t)pop;
+               if (rep->rpp == NULL) {
+                       rep->memset_local(rdest, c, len,
+                                               flags & PMEM_F_MEM_VALID_FLAGS);
+               } else {
+                       if (rep->persist_remote(rep, rdest, len, lane, flags))
+                               obj_handle_remote_persist_error(pop);
+               }
+               rep = rep->replica;
+       }
+
+       if (pop->has_remote_replicas)
+               lane_release(pop);
+
+       return ret;
+}
+
+/*
+ * obj_rep_persist -- (internal) persist with replication
+ */
+static int
+obj_rep_persist(void *ctx, const void *addr, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       unsigned lane = UINT_MAX;
+
+       if (pop->has_remote_replicas)
+               lane = lane_hold(pop, NULL);
+
+       pop->persist_local(addr, len);
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               void *raddr = (char *)rep + (uintptr_t)addr - (uintptr_t)pop;
+               if (rep->rpp == NULL) {
+                       rep->memcpy_local(raddr, addr, len, 0);
+               } else {
+                       if (rep->persist_remote(rep, raddr, len, lane, flags))
+                               obj_handle_remote_persist_error(pop);
+               }
+               rep = rep->replica;
+       }
+
+       if (pop->has_remote_replicas)
+               lane_release(pop);
+
+       return 0;
+}
+
+/*
+ * obj_rep_flush -- (internal) flush with replication
+ */
+static int
+obj_rep_flush(void *ctx, const void *addr, size_t len, unsigned flags)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       unsigned lane = UINT_MAX;
+
+       if (pop->has_remote_replicas)
+               lane = lane_hold(pop, NULL);
+
+       pop->flush_local(addr, len);
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               void *raddr = (char *)rep + (uintptr_t)addr - (uintptr_t)pop;
+               if (rep->rpp == NULL) {
+                       rep->memcpy_local(raddr, addr, len,
+                               PMEM_F_MEM_NODRAIN);
+               } else {
+                       if (rep->persist_remote(rep, raddr, len, lane, flags))
+                               obj_handle_remote_persist_error(pop);
+               }
+               rep = rep->replica;
+       }
+
+       if (pop->has_remote_replicas)
+               lane_release(pop);
+
+       return 0;
+}
+
+/*
+ * obj_rep_drain -- (internal) drain with replication
+ */
+static void
+obj_rep_drain(void *ctx)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(15, "pop %p", pop);
+
+       pop->drain_local();
+
+       PMEMobjpool *rep = pop->replica;
+       while (rep) {
+               if (rep->rpp == NULL)
+                       rep->drain_local();
+               rep = rep->replica;
+       }
+}
+
+#if VG_MEMCHECK_ENABLED
+/*
+ * Arbitrary value. When there's more undefined regions than MAX_UNDEFS, it's
+ * not worth reporting everything - developer should fix the code.
+ */
+#define MAX_UNDEFS 1000
+
+/*
+ * obj_vg_check_no_undef -- (internal) check whether there are any undefined
+ *                             regions
+ */
+static void
+obj_vg_check_no_undef(struct pmemobjpool *pop)
+{
+       LOG(4, "pop %p", pop);
+
+       struct {
+               void *start, *end;
+       } undefs[MAX_UNDEFS];
+       int num_undefs = 0;
+
+       VALGRIND_DO_DISABLE_ERROR_REPORTING;
+       char *addr_start = pop->addr;
+       char *addr_end = addr_start + pop->set->poolsize;
+
+       while (addr_start < addr_end) {
+               char *noaccess = (char *)VALGRIND_CHECK_MEM_IS_ADDRESSABLE(
+                                       addr_start, addr_end - addr_start);
+               if (noaccess == NULL)
+                       noaccess = addr_end;
+
+               while (addr_start < noaccess) {
+                       char *undefined =
+                               (char *)VALGRIND_CHECK_MEM_IS_DEFINED(
+                                       addr_start, noaccess - addr_start);
+
+                       if (undefined) {
+                               addr_start = undefined;
+
+#ifdef VALGRIND_CHECK_MEM_IS_UNDEFINED
+                               addr_start = (char *)
+                                       VALGRIND_CHECK_MEM_IS_UNDEFINED(
+                                       addr_start, noaccess - addr_start);
+                               if (addr_start == NULL)
+                                       addr_start = noaccess;
+#else
+                               while (addr_start < noaccess &&
+                                               VALGRIND_CHECK_MEM_IS_DEFINED(
+                                                               addr_start, 1))
+                                       addr_start++;
+#endif
+
+                               if (num_undefs < MAX_UNDEFS) {
+                                       undefs[num_undefs].start = undefined;
+                                       undefs[num_undefs].end = addr_start - 1;
+                                       num_undefs++;
+                               }
+                       } else
+                               addr_start = noaccess;
+               }
+
+#ifdef VALGRIND_CHECK_MEM_IS_UNADDRESSABLE
+               addr_start = (char *)VALGRIND_CHECK_MEM_IS_UNADDRESSABLE(
+                               addr_start, addr_end - addr_start);
+               if (addr_start == NULL)
+                       addr_start = addr_end;
+#else
+               while (addr_start < addr_end &&
+                               (char *)VALGRIND_CHECK_MEM_IS_ADDRESSABLE(
+                                               addr_start, 1) == addr_start)
+                       addr_start++;
+#endif
+       }
+       VALGRIND_DO_ENABLE_ERROR_REPORTING;
+
+       if (num_undefs) {
+               /*
+                * How to resolve this error:
+                * If it's part of the free space Valgrind should be told about
+                * it by VALGRIND_DO_MAKE_MEM_NOACCESS request. If it's
+                * allocated - initialize it or use VALGRIND_DO_MAKE_MEM_DEFINED
+                * request.
+                */
+
+               VALGRIND_PRINTF("Part of the pool is left in undefined state on"
+                               " boot. This is pmemobj's bug.\nUndefined"
+                               " regions: [pool address: %p]\n", pop);
+               for (int i = 0; i < num_undefs; ++i)
+                       VALGRIND_PRINTF("   [%p, %p]\n", undefs[i].start,
+                                       undefs[i].end);
+               if (num_undefs == MAX_UNDEFS)
+                       VALGRIND_PRINTF("   ...\n");
+
+               /* Trigger error. */
+               VALGRIND_CHECK_MEM_IS_DEFINED(undefs[0].start, 1);
+       }
+}
+
+/*
+ * obj_vg_boot -- (internal) notify Valgrind about pool objects
+ */
+static void
+obj_vg_boot(struct pmemobjpool *pop)
+{
+       if (!On_memcheck)
+               return;
+
+       LOG(4, "pop %p", pop);
+
+       if (os_getenv("PMEMOBJ_VG_CHECK_UNDEF"))
+               obj_vg_check_no_undef(pop);
+}
+
+#endif
+
+/*
+ * obj_runtime_init_common -- (internal) runtime initialization
+ *
+ * Common routine for create/open and check.
+ */
+static int
+obj_runtime_init_common(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       if ((errno = lane_boot(pop)) != 0) {
+               ERR("!lane_boot");
+               return errno;
+       }
+
+       if ((errno = lane_recover_and_section_boot(pop)) != 0) {
+               ERR("!lane_recover_and_section_boot");
+               return errno;
+       }
+
+       pop->conversion_flags = 0;
+       pmemops_persist(&pop->p_ops,
+               &pop->conversion_flags, sizeof(pop->conversion_flags));
+
+       return 0;
+}
+
+/*
+ * obj_runtime_cleanup_common -- (internal) runtime cleanup
+ *
+ * Common routine for create/open and check
+ */
+static void
+obj_runtime_cleanup_common(PMEMobjpool *pop)
+{
+       lane_section_cleanup(pop);
+       lane_cleanup(pop);
+}
+
+/*
+ * obj_descr_create -- (internal) create obj pool descriptor
+ */
+static int
+obj_descr_create(PMEMobjpool *pop, const char *layout, size_t poolsize)
+{
+       LOG(3, "pop %p layout %s poolsize %zu", pop, layout, poolsize);
+
+       ASSERTeq(poolsize % Pagesize, 0);
+
+       /* opaque info lives at the beginning of mapped memory pool */
+       void *dscp = (void *)((uintptr_t)pop + sizeof(struct pool_hdr));
+
+       /* create the persistent part of pool's descriptor */
+       memset(dscp, 0, OBJ_DSC_P_SIZE);
+       if (layout)
+               strncpy(pop->layout, layout, PMEMOBJ_MAX_LAYOUT - 1);
+       struct pmem_ops *p_ops = &pop->p_ops;
+
+       pop->lanes_offset = OBJ_LANES_OFFSET;
+       pop->nlanes = OBJ_NLANES;
+
+       /* zero all lanes */
+       lane_init_data(pop);
+
+       pop->heap_offset = pop->lanes_offset +
+               pop->nlanes * sizeof(struct lane_layout);
+       pop->heap_offset = (pop->heap_offset + Pagesize - 1) & ~(Pagesize - 1);
+
+       size_t heap_size = pop->set->poolsize - pop->heap_offset;
+
+       /* initialize heap prior to storing the checksum */
+       errno = palloc_init((char *)pop + pop->heap_offset, heap_size,
+               &pop->heap_size, p_ops);
+       if (errno != 0) {
+               ERR("!palloc_init");
+               return -1;
+       }
+
+       util_checksum(dscp, OBJ_DSC_P_SIZE, &pop->checksum, 1, 0);
+
+       /*
+        * store the persistent part of pool's descriptor (2kB)
+        *
+        * It's safe to use PMEMOBJ_F_RELAXED flag because the entire
+        * structure is protected by checksum.
+        */
+       pmemops_xpersist(p_ops, dscp, OBJ_DSC_P_SIZE, PMEMOBJ_F_RELAXED);
+
+       /* initialize run_id, it will be incremented later */
+       pop->run_id = 0;
+       pmemops_persist(p_ops, &pop->run_id, sizeof(pop->run_id));
+
+       pop->root_offset = 0;
+       pmemops_persist(p_ops, &pop->root_offset, sizeof(pop->root_offset));
+       pop->root_size = 0;
+       pmemops_persist(p_ops, &pop->root_size, sizeof(pop->root_size));
+
+       pop->conversion_flags = 0;
+       pmemops_persist(p_ops, &pop->conversion_flags,
+               sizeof(pop->conversion_flags));
+
+       /*
+        * It's safe to use PMEMOBJ_F_RELAXED flag because the reserved
+        * area must be entirely zeroed.
+        */
+       pmemops_memset(p_ops, pop->pmem_reserved, 0,
+               sizeof(pop->pmem_reserved), PMEMOBJ_F_RELAXED);
+
+       return 0;
+}
+
+/*
+ * obj_descr_check -- (internal) validate obj pool descriptor
+ */
+static int
+obj_descr_check(PMEMobjpool *pop, const char *layout, size_t poolsize)
+{
+       LOG(3, "pop %p layout %s poolsize %zu", pop, layout, poolsize);
+
+       void *dscp = (void *)((uintptr_t)pop + sizeof(struct pool_hdr));
+
+       if (pop->rpp) {
+               /* read remote descriptor */
+               if (obj_read_remote(pop->rpp, pop->remote_base, dscp, dscp,
+                               OBJ_DSC_P_SIZE)) {
+                       ERR("!obj_read_remote");
+                       return -1;
+               }
+       }
+
+       if (!util_checksum(dscp, OBJ_DSC_P_SIZE, &pop->checksum, 0, 0)) {
+               ERR("invalid checksum of pool descriptor");
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (layout &&
+           strncmp(pop->layout, layout, PMEMOBJ_MAX_LAYOUT)) {
+               ERR("wrong layout (\"%s\"), "
+                       "pool created with layout \"%s\"",
+                       layout, pop->layout);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (pop->heap_offset % Pagesize) {
+               ERR("unaligned heap: off %" PRIu64, pop->heap_offset);
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * obj_replica_init_local -- (internal) initialize runtime part
+ *                               of the local replicas
+ */
+static int
+obj_replica_init_local(PMEMobjpool *rep, int is_pmem, size_t resvsize)
+{
+       LOG(3, "rep %p is_pmem %d resvsize %zu", rep, is_pmem, resvsize);
+
+       /*
+        * Use some of the memory pool area for run-time info.  This
+        * run-time state is never loaded from the file, it is always
+        * created here, so no need to worry about byte-order.
+        */
+       rep->is_pmem = is_pmem;
+
+       /* init hooks */
+       rep->persist_remote = NULL;
+
+       /*
+        * All replicas, except for master, are ignored as far as valgrind is
+        * concerned. This is to save CPU time and lessen the complexity of
+        * instrumentation.
+        */
+       if (!rep->is_master_replica)
+               VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(rep, resvsize);
+
+       if (rep->is_pmem) {
+               rep->persist_local = pmem_persist;
+               rep->flush_local = pmem_flush;
+               rep->drain_local = pmem_drain;
+               rep->memcpy_local = pmem_memcpy;
+               rep->memmove_local = pmem_memmove;
+               rep->memset_local = pmem_memset;
+       } else {
+               rep->persist_local = obj_msync_nofail;
+               rep->flush_local = obj_msync_nofail;
+               rep->drain_local = obj_drain_empty;
+               rep->memcpy_local = obj_nopmem_memcpy;
+               rep->memmove_local = obj_nopmem_memmove;
+               rep->memset_local = obj_nopmem_memset;
+       }
+
+       return 0;
+}
+
+/*
+ * obj_replica_init_remote -- (internal) initialize runtime part
+ *                                of a remote replica
+ */
+static int
+obj_replica_init_remote(PMEMobjpool *rep, struct pool_set *set,
+                               unsigned repidx, int create)
+{
+       LOG(3, "rep %p set %p repidx %u", rep, set, repidx);
+
+       struct pool_replica *repset = set->replica[repidx];
+
+       ASSERTne(repset->remote->rpp, NULL);
+       ASSERTne(repset->remote->node_addr, NULL);
+       ASSERTne(repset->remote->pool_desc, NULL);
+
+       rep->node_addr = Strdup(repset->remote->node_addr);
+       if (rep->node_addr == NULL)
+               return -1;
+       rep->pool_desc = Strdup(repset->remote->pool_desc);
+       if (rep->pool_desc == NULL) {
+               Free(rep->node_addr);
+               return -1;
+       }
+
+       rep->rpp = repset->remote->rpp;
+
+       /* remote_base - beginning of the remote pool */
+       rep->remote_base = (uintptr_t)rep->addr;
+
+       /* init hooks */
+       rep->persist_remote = obj_remote_persist;
+       rep->persist_local = NULL;
+       rep->flush_local = NULL;
+       rep->drain_local = NULL;
+       rep->memcpy_local = NULL;
+       rep->memmove_local = NULL;
+       rep->memset_local = NULL;
+
+       rep->p_ops.remote.read = obj_read_remote;
+       rep->p_ops.remote.ctx = rep->rpp;
+       rep->p_ops.remote.base = rep->remote_base;
+
+       return 0;
+}
+
+/*
+ * obj_cleanup_remote -- (internal) clean up the remote pools data
+ */
+static void
+obj_cleanup_remote(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       for (; pop != NULL; pop = pop->replica) {
+               if (pop->rpp != NULL) {
+                       Free(pop->node_addr);
+                       Free(pop->pool_desc);
+                       pop->rpp = NULL;
+               }
+       }
+}
+
+/*
+ * obj_replica_init -- (internal) initialize runtime part of the replica
+ */
+static int
+obj_replica_init(PMEMobjpool *rep, struct pool_set *set, unsigned repidx,
+                       int create)
+{
+       struct pool_replica *repset = set->replica[repidx];
+
+       if (repidx == 0) {
+               /* master replica */
+               rep->is_master_replica = 1;
+               rep->has_remote_replicas = set->remote;
+
+               if (set->nreplicas > 1) {
+                       rep->p_ops.persist = obj_rep_persist;
+                       rep->p_ops.flush = obj_rep_flush;
+                       rep->p_ops.drain = obj_rep_drain;
+                       rep->p_ops.memcpy = obj_rep_memcpy;
+                       rep->p_ops.memmove = obj_rep_memmove;
+                       rep->p_ops.memset = obj_rep_memset;
+               } else {
+                       rep->p_ops.persist = obj_norep_persist;
+                       rep->p_ops.flush = obj_norep_flush;
+                       rep->p_ops.drain = obj_norep_drain;
+                       rep->p_ops.memcpy = obj_norep_memcpy;
+                       rep->p_ops.memmove = obj_norep_memmove;
+                       rep->p_ops.memset = obj_norep_memset;
+               }
+               rep->p_ops.base = rep;
+       } else {
+               /* non-master replicas */
+               rep->is_master_replica = 0;
+               rep->has_remote_replicas = 0;
+
+               rep->p_ops.persist = NULL;
+               rep->p_ops.flush = NULL;
+               rep->p_ops.drain = NULL;
+               rep->p_ops.memcpy = NULL;
+               rep->p_ops.memmove = NULL;
+               rep->p_ops.memset = NULL;
+
+               rep->p_ops.base = NULL;
+       }
+
+       rep->is_dev_dax = set->replica[repidx]->part[0].is_dev_dax;
+
+       int ret;
+       if (repset->remote)
+               ret = obj_replica_init_remote(rep, set, repidx, create);
+       else
+               ret = obj_replica_init_local(rep, repset->is_pmem,
+                       set->resvsize);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+/*
+ * obj_replica_fini -- (internal) deinitialize replica
+ */
+static void
+obj_replica_fini(struct pool_replica *repset)
+{
+       PMEMobjpool *rep = repset->part[0].addr;
+
+       if (repset->remote)
+               obj_cleanup_remote(rep);
+}
+
+/*
+ * obj_runtime_init -- (internal) initialize runtime part of the pool header
+ */
+static int
+obj_runtime_init(PMEMobjpool *pop, int rdonly, int boot, unsigned nlanes)
+{
+       LOG(3, "pop %p rdonly %d boot %d", pop, rdonly, boot);
+       struct pmem_ops *p_ops = &pop->p_ops;
+
+       /* run_id is made unique by incrementing the previous value */
+       pop->run_id += 2;
+       if (pop->run_id == 0)
+               pop->run_id += 2;
+       pmemops_persist(p_ops, &pop->run_id, sizeof(pop->run_id));
+
+       /*
+        * Use some of the memory pool area for run-time info.  This
+        * run-time state is never loaded from the file, it is always
+        * created here, so no need to worry about byte-order.
+        */
+       pop->rdonly = rdonly;
+
+       pop->uuid_lo = pmemobj_get_uuid_lo(pop);
+
+       pop->lanes_desc.runtime_nlanes = nlanes;
+
+       pop->tx_params = tx_params_new();
+       if (pop->tx_params == NULL)
+               goto err_tx_params;
+
+       pop->stats = stats_new(pop);
+       if (pop->stats == NULL)
+               goto err_stat;
+
+       pop->user_data = NULL;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(&pop->mutex_head,
+               sizeof(pop->mutex_head));
+       VALGRIND_REMOVE_PMEM_MAPPING(&pop->rwlock_head,
+               sizeof(pop->rwlock_head));
+       VALGRIND_REMOVE_PMEM_MAPPING(&pop->cond_head,
+               sizeof(pop->cond_head));
+       pop->mutex_head = NULL;
+       pop->rwlock_head = NULL;
+       pop->cond_head = NULL;
+
+       if (boot) {
+               if ((errno = obj_runtime_init_common(pop)) != 0)
+                       goto err_boot;
+
+#if VG_MEMCHECK_ENABLED
+               if (On_memcheck) {
+                       /* mark unused part of the pool as not accessible */
+                       void *end = palloc_heap_end(&pop->heap);
+                       VALGRIND_DO_MAKE_MEM_NOACCESS(end,
+                               (char *)pop + pop->set->poolsize - (char *)end);
+               }
+#endif
+
+               obj_pool_init();
+
+               if ((errno = critnib_insert(pools_ht, pop->uuid_lo, pop))) {
+                       ERR("!critnib_insert to pools_ht");
+                       goto err_critnib_insert;
+               }
+
+               if ((errno = critnib_insert(pools_tree, (uint64_t)pop, pop))) {
+                       ERR("!critnib_insert to pools_tree");
+                       goto err_tree_insert;
+               }
+       }
+
+       if (obj_ctl_init_and_load(pop) != 0) {
+               errno = EINVAL;
+               goto err_ctl;
+       }
+
+       util_mutex_init(&pop->ulog_user_buffers.lock);
+       pop->ulog_user_buffers.map = ravl_new_sized(
+               operation_user_buffer_range_cmp,
+               sizeof(struct user_buffer_def));
+       if (pop->ulog_user_buffers.map == NULL) {
+               ERR("!ravl_new_sized");
+               goto err_user_buffers_map;
+       }
+       pop->ulog_user_buffers.verify = 0;
+
+       /*
+        * If possible, turn off all permissions on the pool header page.
+        *
+        * The prototype PMFS doesn't allow this when large pages are in
+        * use. It is not considered an error if this fails.
+        */
+       RANGE_NONE(pop->addr, sizeof(struct pool_hdr), pop->is_dev_dax);
+
+       return 0;
+
+err_user_buffers_map:
+       util_mutex_destroy(&pop->ulog_user_buffers.lock);
+       ctl_delete(pop->ctl);
+err_ctl:;
+       void *n = critnib_remove(pools_tree, (uint64_t)pop);
+       ASSERTne(n, NULL);
+err_tree_insert:
+       critnib_remove(pools_ht, pop->uuid_lo);
+err_critnib_insert:
+       obj_runtime_cleanup_common(pop);
+err_boot:
+       stats_delete(pop, pop->stats);
+err_stat:
+       tx_params_delete(pop->tx_params);
+err_tx_params:
+
+       return -1;
+}
+
+/*
+ * obj_get_nlanes -- get a number of lanes available at runtime. If the value
+ * provided with the PMEMOBJ_NLANES environment variable is greater than 0 and
+ * smaller than OBJ_NLANES constant it returns PMEMOBJ_NLANES. Otherwise it
+ * returns OBJ_NLANES.
+ */
+static unsigned
+obj_get_nlanes(void)
+{
+       LOG(3, NULL);
+
+       char *env_nlanes = os_getenv(OBJ_NLANES_ENV_VARIABLE);
+       if (env_nlanes) {
+               int nlanes = atoi(env_nlanes);
+               if (nlanes <= 0) {
+                       ERR("%s variable must be a positive integer",
+                                       OBJ_NLANES_ENV_VARIABLE);
+                       errno = EINVAL;
+                       goto no_valid_env;
+               }
+
+               return (unsigned)(OBJ_NLANES < nlanes ? OBJ_NLANES : nlanes);
+       }
+
+no_valid_env:
+       return OBJ_NLANES;
+}
+
+/*
+ * pmemobj_createU -- create a transactional memory pool (set)
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMobjpool *
+pmemobj_createU(const char *path, const char *layout,
+               size_t poolsize, mode_t mode)
+{
+       LOG(3, "path %s layout %s poolsize %zu mode %o",
+                       path, layout, poolsize, mode);
+
+       PMEMobjpool *pop;
+       struct pool_set *set;
+
+       /* check length of layout */
+       if (layout && (strlen(layout) >= PMEMOBJ_MAX_LAYOUT)) {
+               ERR("Layout too long");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       /*
+        * A number of lanes available at runtime equals the lowest value
+        * from all reported by remote replicas hosts. In the single host mode
+        * the runtime number of lanes is equal to the total number of lanes
+        * available in the pool or the value provided with PMEMOBJ_NLANES
+        * environment variable whichever is lower.
+        */
+       unsigned runtime_nlanes = obj_get_nlanes();
+
+       struct pool_attr adj_pool_attr = Obj_create_attr;
+
+       /* force set SDS feature */
+       if (SDS_at_create)
+               adj_pool_attr.features.incompat |= POOL_FEAT_SDS;
+       else
+               adj_pool_attr.features.incompat &= ~POOL_FEAT_SDS;
+
+       if (util_pool_create(&set, path, poolsize, PMEMOBJ_MIN_POOL,
+                       PMEMOBJ_MIN_PART, &adj_pool_attr, &runtime_nlanes,
+                       REPLICAS_ENABLED) != 0) {
+               LOG(2, "cannot create pool or pool set");
+               return NULL;
+       }
+
+       ASSERT(set->nreplicas > 0);
+
+       /* pop is master replica from now on */
+       pop = set->replica[0]->part[0].addr;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *repset = set->replica[r];
+               PMEMobjpool *rep = repset->part[0].addr;
+
+               size_t rt_size = (uintptr_t)(rep + 1) - (uintptr_t)&rep->addr;
+               VALGRIND_REMOVE_PMEM_MAPPING(&rep->addr, rt_size);
+
+               memset(&rep->addr, 0, rt_size);
+
+               rep->addr = rep;
+               rep->replica = NULL;
+               rep->rpp = NULL;
+
+               /* initialize replica runtime - is_pmem, funcs, ... */
+               if (obj_replica_init(rep, set, r, 1 /* create */) != 0) {
+                       ERR("initialization of replica #%u failed", r);
+                       goto err;
+               }
+
+               /* link replicas */
+               if (r < set->nreplicas - 1)
+                       rep->replica = set->replica[r + 1]->part[0].addr;
+       }
+
+       pop->set = set;
+
+       /* create pool descriptor */
+       if (obj_descr_create(pop, layout, set->poolsize) != 0) {
+               LOG(2, "creation of pool descriptor failed");
+               goto err;
+       }
+
+       /* initialize runtime parts - lanes, obj stores, ... */
+       if (obj_runtime_init(pop, 0, 1 /* boot */,
+                                       runtime_nlanes) != 0) {
+               ERR("pool initialization failed");
+               goto err;
+       }
+
+       if (util_poolset_chmod(set, mode))
+               goto err;
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "pop %p", pop);
+
+       return pop;
+
+err:
+       LOG(4, "error clean up");
+       int oerrno = errno;
+       if (set->remote)
+               obj_cleanup_remote(pop);
+       util_poolset_close(set, DELETE_CREATED_PARTS);
+       errno = oerrno;
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_create -- create a transactional memory pool (set)
+ */
+PMEMobjpool *
+pmemobj_create(const char *path, const char *layout,
+               size_t poolsize, mode_t mode)
+{
+       PMEMOBJ_API_START();
+
+       PMEMobjpool *pop = pmemobj_createU(path, layout, poolsize, mode);
+
+       PMEMOBJ_API_END();
+       return pop;
+}
+#else
+/*
+ * pmemobj_createW -- create a transactional memory pool (set)
+ */
+PMEMobjpool *
+pmemobj_createW(const wchar_t *path, const wchar_t *layout, size_t poolsize,
+       mode_t mode)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+       char *ulayout = NULL;
+       if (layout != NULL) {
+               ulayout = util_toUTF8(layout);
+               if (ulayout == NULL) {
+                       util_free_UTF8(upath);
+                       return NULL;
+               }
+       }
+       PMEMobjpool *ret = pmemobj_createU(upath, ulayout, poolsize, mode);
+
+       util_free_UTF8(upath);
+       util_free_UTF8(ulayout);
+
+       return ret;
+}
+#endif
+
+/*
+ * obj_check_basic_local -- (internal) basic pool consistency check
+ *                              of a local replica
+ */
+static int
+obj_check_basic_local(PMEMobjpool *pop, size_t mapped_size)
+{
+       LOG(3, "pop %p mapped_size %zu", pop, mapped_size);
+
+       ASSERTeq(pop->rpp, NULL);
+
+       int consistent = 1;
+
+       if (pop->run_id % 2) {
+               ERR("invalid run_id %" PRIu64, pop->run_id);
+               consistent = 0;
+       }
+
+       if ((errno = lane_check(pop)) != 0) {
+               LOG(2, "!lane_check");
+               consistent = 0;
+       }
+
+       /* pop->heap_size can still be 0 at this point */
+       size_t heap_size = mapped_size - pop->heap_offset;
+       errno = palloc_heap_check((char *)pop + pop->heap_offset,
+               heap_size);
+       if (errno != 0) {
+               LOG(2, "!heap_check");
+               consistent = 0;
+       }
+
+       return consistent;
+}
+
+/*
+ * obj_read_remote -- read data from remote replica
+ *
+ * It reads data of size 'length' from the remote replica 'pop'
+ * from address 'addr' and saves it at address 'dest'.
+ */
+int
+obj_read_remote(void *ctx, uintptr_t base, void *dest, void *addr,
+               size_t length)
+{
+       LOG(3, "ctx %p base 0x%lx dest %p addr %p length %zu", ctx, base, dest,
+                       addr, length);
+
+       ASSERTne(ctx, NULL);
+       ASSERT((uintptr_t)addr >= base);
+
+       uintptr_t offset = (uintptr_t)addr - base;
+       if (Rpmem_read(ctx, dest, offset, length, RLANE_DEFAULT)) {
+               ERR("!rpmem_read");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * obj_check_basic_remote -- (internal) basic pool consistency check
+ *                               of a remote replica
+ */
+static int
+obj_check_basic_remote(PMEMobjpool *pop, size_t mapped_size)
+{
+       LOG(3, "pop %p mapped_size %zu", pop, mapped_size);
+
+       ASSERTne(pop->rpp, NULL);
+
+       int consistent = 1;
+
+       /* read pop->run_id */
+       if (obj_read_remote(pop->rpp, pop->remote_base, &pop->run_id,
+                       &pop->run_id, sizeof(pop->run_id))) {
+               ERR("!obj_read_remote");
+               return -1;
+       }
+
+       if (pop->run_id % 2) {
+               ERR("invalid run_id %" PRIu64, pop->run_id);
+               consistent = 0;
+       }
+
+       /* XXX add lane_check_remote */
+
+       /* pop->heap_size can still be 0 at this point */
+       size_t heap_size = mapped_size - pop->heap_offset;
+       if (palloc_heap_check_remote((char *)pop + pop->heap_offset,
+                       heap_size, &pop->p_ops.remote)) {
+               LOG(2, "!heap_check_remote");
+               consistent = 0;
+       }
+
+       return consistent;
+}
+
+/*
+ * obj_check_basic -- (internal) basic pool consistency check
+ *
+ * Used to check if all the replicas are consistent prior to pool recovery.
+ */
+static int
+obj_check_basic(PMEMobjpool *pop, size_t mapped_size)
+{
+       LOG(3, "pop %p mapped_size %zu", pop, mapped_size);
+
+       if (pop->rpp == NULL)
+               return obj_check_basic_local(pop, mapped_size);
+       else
+               return obj_check_basic_remote(pop, mapped_size);
+}
+
+/*
+ * obj_pool_close -- (internal) close the pool set
+ */
+static void
+obj_pool_close(struct pool_set *set)
+{
+       int oerrno = errno;
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       errno = oerrno;
+}
+
+/*
+ * obj_pool_open -- (internal) open the given pool
+ */
+static int
+obj_pool_open(struct pool_set **set, const char *path, unsigned flags,
+       unsigned *nlanes)
+{
+       if (util_pool_open(set, path, PMEMOBJ_MIN_PART, &Obj_open_attr,
+                               nlanes, NULL, flags) != 0) {
+               LOG(2, "cannot open pool or pool set");
+               return -1;
+       }
+
+       ASSERT((*set)->nreplicas > 0);
+
+       /* read-only mode is not supported in libpmemobj */
+       if ((*set)->rdonly) {
+               ERR("read-only mode is not supported");
+               errno = EINVAL;
+               goto err_rdonly;
+       }
+
+       return 0;
+err_rdonly:
+       obj_pool_close(*set);
+       return -1;
+}
+
+/*
+ * obj_replicas_init -- (internal) initialize all replicas
+ */
+static int
+obj_replicas_init(struct pool_set *set)
+{
+       unsigned r;
+       for (r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *repset = set->replica[r];
+               PMEMobjpool *rep = repset->part[0].addr;
+
+               size_t rt_size = (uintptr_t)(rep + 1) - (uintptr_t)&rep->addr;
+
+               VALGRIND_REMOVE_PMEM_MAPPING(&rep->addr, rt_size);
+
+               memset(&rep->addr, 0, rt_size);
+
+               rep->addr = rep;
+               rep->replica = NULL;
+               rep->rpp = NULL;
+
+               /* initialize replica runtime - is_pmem, funcs, ... */
+               if (obj_replica_init(rep, set, r, 0 /* open */) != 0) {
+                       ERR("initialization of replica #%u failed", r);
+                       goto err;
+               }
+
+               /* link replicas */
+               if (r < set->nreplicas - 1)
+                       rep->replica = set->replica[r + 1]->part[0].addr;
+       }
+
+       return 0;
+err:
+       for (unsigned p = 0; p < r; p++)
+               obj_replica_fini(set->replica[p]);
+
+       return -1;
+}
+
+/*
+ * obj_replicas_fini -- (internal) deinitialize all replicas
+ */
+static void
+obj_replicas_fini(struct pool_set *set)
+{
+       int oerrno = errno;
+       for (unsigned r = 0; r < set->nreplicas; r++)
+               obj_replica_fini(set->replica[r]);
+       errno = oerrno;
+}
+
+/*
+ * obj_replicas_check_basic -- (internal) perform basic consistency check
+ * for all replicas
+ */
+static int
+obj_replicas_check_basic(PMEMobjpool *pop)
+{
+       PMEMobjpool *rep;
+       for (unsigned r = 0; r < pop->set->nreplicas; r++) {
+               rep = pop->set->replica[r]->part[0].addr;
+               if (obj_check_basic(rep, pop->set->poolsize) == 0) {
+                       ERR("inconsistent replica #%u", r);
+                       return -1;
+               }
+       }
+
+       /* copy lanes */
+       void *src = (void *)((uintptr_t)pop + pop->lanes_offset);
+       size_t len = pop->nlanes * sizeof(struct lane_layout);
+
+       for (unsigned r = 1; r < pop->set->nreplicas; r++) {
+               rep = pop->set->replica[r]->part[0].addr;
+               void *dst = (void *)((uintptr_t)rep + pop->lanes_offset);
+               if (rep->rpp == NULL) {
+                       rep->memcpy_local(dst, src, len, 0);
+               } else {
+                       if (rep->persist_remote(rep, dst, len,
+                                       RLANE_DEFAULT, 0))
+                               obj_handle_remote_persist_error(pop);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * obj_open_common -- open a transactional memory pool (set)
+ *
+ * This routine takes flags and does all the work
+ * (flag POOL_OPEN_COW - internal calls can map a read-only pool if required).
+ */
+static PMEMobjpool *
+obj_open_common(const char *path, const char *layout, unsigned flags, int boot)
+{
+       LOG(3, "path %s layout %s flags 0x%x", path, layout, flags);
+
+       PMEMobjpool *pop = NULL;
+       struct pool_set *set;
+
+       /*
+        * A number of lanes available at runtime equals the lowest value
+        * from all reported by remote replicas hosts. In the single host mode
+        * the runtime number of lanes is equal to the total number of lanes
+        * available in the pool or the value provided with PMEMOBJ_NLANES
+        * environment variable whichever is lower.
+        */
+       unsigned runtime_nlanes = obj_get_nlanes();
+       if (obj_pool_open(&set, path, flags, &runtime_nlanes))
+               return NULL;
+
+       /* pop is master replica from now on */
+       pop = set->replica[0]->part[0].addr;
+
+       if (obj_replicas_init(set))
+               goto replicas_init;
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *repset = set->replica[r];
+               PMEMobjpool *rep = repset->part[0].addr;
+               /* check descriptor */
+               if (obj_descr_check(rep, layout, set->poolsize) != 0) {
+                       LOG(2, "descriptor check of replica #%u failed", r);
+                       goto err_descr_check;
+               }
+       }
+
+       pop->set = set;
+
+       if (boot) {
+               /* check consistency of 'master' replica */
+               if (obj_check_basic(pop, pop->set->poolsize) == 0) {
+                       goto err_check_basic;
+               }
+       }
+
+       if (set->nreplicas > 1) {
+               if (obj_replicas_check_basic(pop))
+                       goto err_replicas_check_basic;
+       }
+
+       /*
+        * before runtime initialization lanes are unavailable, remote persists
+        * should use RLANE_DEFAULT
+        */
+       pop->lanes_desc.runtime_nlanes = 0;
+
+#if VG_MEMCHECK_ENABLED
+       pop->vg_boot = boot;
+#endif
+       /* initialize runtime parts - lanes, obj stores, ... */
+       if (obj_runtime_init(pop, 0, boot, runtime_nlanes) != 0) {
+               ERR("pool initialization failed");
+               goto err_runtime_init;
+       }
+
+#if VG_MEMCHECK_ENABLED
+       if (boot)
+               obj_vg_boot(pop);
+#endif
+
+       util_poolset_fdclose(set);
+
+       LOG(3, "pop %p", pop);
+
+       return pop;
+
+err_runtime_init:
+err_replicas_check_basic:
+err_check_basic:
+err_descr_check:
+       obj_replicas_fini(set);
+replicas_init:
+       obj_pool_close(set);
+       return NULL;
+}
+
+/*
+ * pmemobj_openU -- open a transactional memory pool
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMobjpool *
+pmemobj_openU(const char *path, const char *layout)
+{
+       LOG(3, "path %s layout %s", path, layout);
+
+       return obj_open_common(path, layout,
+                       COW_at_open ? POOL_OPEN_COW : 0, 1);
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_open -- open a transactional memory pool
+ */
+PMEMobjpool *
+pmemobj_open(const char *path, const char *layout)
+{
+       PMEMOBJ_API_START();
+
+       PMEMobjpool *pop = pmemobj_openU(path, layout);
+
+       PMEMOBJ_API_END();
+       return pop;
+}
+#else
+/*
+ * pmemobj_openW -- open a transactional memory pool
+ */
+PMEMobjpool *
+pmemobj_openW(const wchar_t *path, const wchar_t *layout)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return NULL;
+
+       char *ulayout = NULL;
+       if (layout != NULL) {
+               ulayout = util_toUTF8(layout);
+               if (ulayout == NULL) {
+                       util_free_UTF8(upath);
+                       return NULL;
+               }
+       }
+
+       PMEMobjpool *ret = pmemobj_openU(upath, ulayout);
+       util_free_UTF8(upath);
+       util_free_UTF8(ulayout);
+       return ret;
+}
+#endif
+
+/*
+ * obj_replicas_cleanup -- (internal) free resources allocated for replicas
+ */
+static void
+obj_replicas_cleanup(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+
+               PMEMobjpool *pop = rep->part[0].addr;
+
+               if (pop->rpp != NULL) {
+                       /*
+                        * remote replica will be closed in util_poolset_close
+                        */
+                       pop->rpp = NULL;
+
+                       Free(pop->node_addr);
+                       Free(pop->pool_desc);
+               }
+       }
+}
+
+/*
+ * obj_pool_lock_cleanup -- (internal) Destroy any locks or condition
+ *     variables that were allocated at run time
+ */
+static void
+obj_pool_lock_cleanup(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       PMEMmutex_internal *nextm;
+       for (PMEMmutex_internal *m = pop->mutex_head; m != NULL; m = nextm) {
+               nextm = m->PMEMmutex_next;
+               LOG(4, "mutex %p *mutex %p", &m->PMEMmutex_lock,
+                       m->PMEMmutex_bsd_mutex_p);
+               os_mutex_destroy(&m->PMEMmutex_lock);
+               m->PMEMmutex_next = NULL;
+               m->PMEMmutex_bsd_mutex_p = NULL;
+       }
+       pop->mutex_head = NULL;
+
+       PMEMrwlock_internal *nextr;
+       for (PMEMrwlock_internal *r = pop->rwlock_head; r != NULL; r = nextr) {
+               nextr = r->PMEMrwlock_next;
+               LOG(4, "rwlock %p *rwlock %p", &r->PMEMrwlock_lock,
+                       r->PMEMrwlock_bsd_rwlock_p);
+               os_rwlock_destroy(&r->PMEMrwlock_lock);
+               r->PMEMrwlock_next = NULL;
+               r->PMEMrwlock_bsd_rwlock_p = NULL;
+       }
+       pop->rwlock_head = NULL;
+
+       PMEMcond_internal *nextc;
+       for (PMEMcond_internal *c = pop->cond_head; c != NULL; c = nextc) {
+               nextc = c->PMEMcond_next;
+               LOG(4, "cond %p *cond %p", &c->PMEMcond_cond,
+                       c->PMEMcond_bsd_cond_p);
+               os_cond_destroy(&c->PMEMcond_cond);
+               c->PMEMcond_next = NULL;
+               c->PMEMcond_bsd_cond_p = NULL;
+       }
+       pop->cond_head = NULL;
+}
+/*
+ * obj_pool_cleanup -- (internal) cleanup the pool and unmap
+ */
+static void
+obj_pool_cleanup(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       ravl_delete(pop->ulog_user_buffers.map);
+       util_mutex_destroy(&pop->ulog_user_buffers.lock);
+
+       stats_delete(pop, pop->stats);
+       tx_params_delete(pop->tx_params);
+       ctl_delete(pop->ctl);
+
+       obj_pool_lock_cleanup(pop);
+
+       lane_section_cleanup(pop);
+       lane_cleanup(pop);
+
+       /* unmap all the replicas */
+       obj_replicas_cleanup(pop->set);
+       util_poolset_close(pop->set, DO_NOT_DELETE_PARTS);
+}
+
+/*
+ * pmemobj_close -- close a transactional memory pool
+ */
+void
+pmemobj_close(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+       PMEMOBJ_API_START();
+
+       _pobj_cache_invalidate++;
+
+       if (critnib_remove(pools_ht, pop->uuid_lo) != pop) {
+               ERR("critnib_remove for pools_ht");
+       }
+
+       if (critnib_remove(pools_tree, (uint64_t)pop) != pop)
+               ERR("critnib_remove for pools_tree");
+
+#ifndef _WIN32
+
+       if (_pobj_cached_pool.pop == pop) {
+               _pobj_cached_pool.pop = NULL;
+               _pobj_cached_pool.uuid_lo = 0;
+       }
+
+#else /* _WIN32 */
+
+       struct _pobj_pcache *pcache = os_tls_get(Cached_pool_key);
+       if (pcache != NULL) {
+               if (pcache->pop == pop) {
+                       pcache->pop = NULL;
+                       pcache->uuid_lo = 0;
+               }
+       }
+
+#endif /* _WIN32 */
+
+       obj_pool_cleanup(pop);
+       PMEMOBJ_API_END();
+}
+
+/*
+ * pmemobj_checkU -- transactional memory pool consistency check
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemobj_checkU(const char *path, const char *layout)
+{
+       LOG(3, "path %s layout %s", path, layout);
+
+       PMEMobjpool *pop = obj_open_common(path, layout, POOL_OPEN_COW, 0);
+       if (pop == NULL)
+               return -1;      /* errno set by obj_open_common() */
+
+       int consistent = 1;
+
+       /*
+        * For replicated pools, basic consistency check is performed
+        * in obj_open_common().
+        */
+       if (pop->replica == NULL)
+               consistent = obj_check_basic(pop, pop->set->poolsize);
+
+       if (consistent && (errno = obj_runtime_init_common(pop)) != 0) {
+               LOG(3, "!obj_boot");
+               consistent = 0;
+       }
+
+       if (consistent) {
+               obj_pool_cleanup(pop);
+       } else {
+               stats_delete(pop, pop->stats);
+               tx_params_delete(pop->tx_params);
+               ctl_delete(pop->ctl);
+
+               /* unmap all the replicas */
+               obj_replicas_cleanup(pop->set);
+               util_poolset_close(pop->set, DO_NOT_DELETE_PARTS);
+       }
+
+       if (consistent)
+               LOG(4, "pool consistency check OK");
+
+       return consistent;
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_check -- transactional memory pool consistency check
+ */
+int
+pmemobj_check(const char *path, const char *layout)
+{
+       PMEMOBJ_API_START();
+
+       int ret = pmemobj_checkU(path, layout);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+#else
+/*
+ * pmemobj_checkW -- transactional memory pool consistency check
+ */
+int
+pmemobj_checkW(const wchar_t *path, const wchar_t *layout)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL)
+               return -1;
+
+       char *ulayout = NULL;
+       if (layout != NULL) {
+               ulayout = util_toUTF8(layout);
+               if (ulayout == NULL) {
+                       util_free_UTF8(upath);
+                       return -1;
+               }
+       }
+
+       int ret = pmemobj_checkU(upath, ulayout);
+
+       util_free_UTF8(upath);
+       util_free_UTF8(ulayout);
+
+       return ret;
+}
+#endif
+
+/*
+ * pmemobj_pool_by_oid -- returns the pool handle associated with the oid
+ */
+PMEMobjpool *
+pmemobj_pool_by_oid(PMEMoid oid)
+{
+       LOG(3, "oid.off 0x%016" PRIx64, oid.off);
+
+       /* XXX this is a temporary fix, to be fixed properly later */
+       if (pools_ht == NULL)
+               return NULL;
+
+       return critnib_get(pools_ht, oid.pool_uuid_lo);
+}
+
+/*
+ * pmemobj_pool_by_ptr -- returns the pool handle associated with the address
+ */
+PMEMobjpool *
+pmemobj_pool_by_ptr(const void *addr)
+{
+       LOG(3, "addr %p", addr);
+
+       /* fast path for transactions */
+       PMEMobjpool *pop = tx_get_pop();
+
+       if ((pop != NULL) && OBJ_PTR_FROM_POOL(pop, addr))
+               return pop;
+
+       /* XXX this is a temporary fix, to be fixed properly later */
+       if (pools_tree == NULL)
+               return NULL;
+
+       pop = critnib_find_le(pools_tree, (uint64_t)addr);
+       if (pop == NULL)
+               return NULL;
+
+       size_t pool_size = pop->heap_offset + pop->heap_size;
+       if ((char *)addr >= (char *)pop + pool_size)
+               return NULL;
+
+       return pop;
+}
+
+/*
+ * pmemobj_set_user_data -- sets volatile pointer to the user data for specified
+ * pool
+ */
+void
+pmemobj_set_user_data(PMEMobjpool *pop, void *data)
+{
+       LOG(3, "pop %p data %p", pop, data);
+
+       pop->user_data = data;
+}
+
+/*
+ * pmemobj_get_user_data -- gets volatile pointer to the user data associated
+ * with the specified pool
+ */
+void *
+pmemobj_get_user_data(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       return pop->user_data;
+}
+
+/* arguments for constructor_alloc */
+struct constr_args {
+       int zero_init;
+       pmemobj_constr constructor;
+       void *arg;
+};
+
+/*
+ * constructor_alloc -- (internal) constructor for obj_alloc_construct
+ */
+static int
+constructor_alloc(void *ctx, void *ptr, size_t usable_size, void *arg)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(3, "pop %p ptr %p arg %p", pop, ptr, arg);
+       struct pmem_ops *p_ops = &pop->p_ops;
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       struct constr_args *carg = arg;
+
+       if (carg->zero_init)
+               pmemops_memset(p_ops, ptr, 0, usable_size, 0);
+
+       int ret = 0;
+       if (carg->constructor)
+               ret = carg->constructor(pop, ptr, carg->arg);
+
+       return ret;
+}
+
+/*
+ * obj_alloc_construct -- (internal) allocates a new object with constructor
+ */
+static int
+obj_alloc_construct(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       type_num_t type_num, uint64_t flags,
+       pmemobj_constr constructor, void *arg)
+{
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               errno = ENOMEM;
+               return -1;
+       }
+
+       struct constr_args carg;
+
+       carg.zero_init = flags & POBJ_FLAG_ZERO;
+       carg.constructor = constructor;
+       carg.arg = arg;
+
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       if (oidp)
+               operation_add_entry(ctx, &oidp->pool_uuid_lo, pop->uuid_lo,
+                               ULOG_OPERATION_SET);
+
+       int ret = palloc_operation(&pop->heap, 0,
+                       oidp != NULL ? &oidp->off : NULL, size,
+                       constructor_alloc, &carg, type_num, 0,
+                       CLASS_ID_FROM_FLAG(flags), ARENA_ID_FROM_FLAG(flags),
+                       ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * pmemobj_alloc -- allocates a new object
+ */
+int
+pmemobj_alloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num, pmemobj_constr constructor, void *arg)
+{
+       LOG(3, "pop %p oidp %p size %zu type_num %llx constructor %p arg %p",
+               pop, oidp, size, (unsigned long long)type_num,
+               constructor, arg);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (size == 0) {
+               ERR("allocation with size 0");
+               errno = EINVAL;
+               return -1;
+       }
+
+       PMEMOBJ_API_START();
+       int ret = obj_alloc_construct(pop, oidp, size, type_num,
+                       0, constructor, arg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_xalloc -- allocates with flags
+ */
+int
+pmemobj_xalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+       uint64_t type_num, uint64_t flags,
+       pmemobj_constr constructor, void *arg)
+{
+       LOG(3, "pop %p oidp %p size %zu type_num %llx flags %llx "
+               "constructor %p arg %p",
+               pop, oidp, size, (unsigned long long)type_num,
+               (unsigned long long)flags,
+               constructor, arg);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (size == 0) {
+               ERR("allocation with size 0");
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (flags & ~POBJ_TX_XALLOC_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_TX_XALLOC_VALID_FLAGS);
+               errno = EINVAL;
+               return -1;
+       }
+
+       PMEMOBJ_API_START();
+       int ret = obj_alloc_construct(pop, oidp, size, type_num,
+                       flags, constructor, arg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/* arguments for constructor_realloc and constructor_zrealloc */
+struct carg_realloc {
+       void *ptr;
+       size_t old_size;
+       size_t new_size;
+       int zero_init;
+       type_num_t user_type;
+       pmemobj_constr constructor;
+       void *arg;
+};
+
+/*
+ * pmemobj_zalloc -- allocates a new zeroed object
+ */
+int
+pmemobj_zalloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+               uint64_t type_num)
+{
+       LOG(3, "pop %p oidp %p size %zu type_num %llx",
+                       pop, oidp, size, (unsigned long long)type_num);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (size == 0) {
+               ERR("allocation with size 0");
+               errno = EINVAL;
+               return -1;
+       }
+
+       PMEMOBJ_API_START();
+       int ret = obj_alloc_construct(pop, oidp, size, type_num, POBJ_FLAG_ZERO,
+               NULL, NULL);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * obj_free -- (internal) free an object
+ */
+static void
+obj_free(PMEMobjpool *pop, PMEMoid *oidp)
+{
+       ASSERTne(oidp, NULL);
+
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       operation_add_entry(ctx, &oidp->pool_uuid_lo, 0, ULOG_OPERATION_SET);
+
+       palloc_operation(&pop->heap, oidp->off, &oidp->off, 0, NULL, NULL,
+                       0, 0, 0, 0, ctx);
+
+       pmalloc_operation_release(pop);
+}
+
+/*
+ * constructor_realloc -- (internal) constructor for pmemobj_realloc
+ */
+static int
+constructor_realloc(void *ctx, void *ptr, size_t usable_size, void *arg)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(3, "pop %p ptr %p arg %p", pop, ptr, arg);
+       struct pmem_ops *p_ops = &pop->p_ops;
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       struct carg_realloc *carg = arg;
+
+       if (!carg->zero_init)
+               return 0;
+
+       if (usable_size > carg->old_size) {
+               size_t grow_len = usable_size - carg->old_size;
+               void *new_data_ptr = (void *)((uintptr_t)ptr + carg->old_size);
+
+               pmemops_memset(p_ops, new_data_ptr, 0, grow_len, 0);
+       }
+
+       return 0;
+}
+
+/*
+ * obj_realloc_common -- (internal) common routine for resizing
+ *                          existing objects
+ */
+static int
+obj_realloc_common(PMEMobjpool *pop,
+       PMEMoid *oidp, size_t size, type_num_t type_num, int zero_init)
+{
+       /* if OID is NULL just allocate memory */
+       if (OBJ_OID_IS_NULL(*oidp)) {
+               /* if size is 0 - do nothing */
+               if (size == 0)
+                       return 0;
+
+               return obj_alloc_construct(pop, oidp, size, type_num,
+                               POBJ_FLAG_ZERO, NULL, NULL);
+       }
+
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               errno = ENOMEM;
+               return -1;
+       }
+
+       /* if size is 0 just free */
+       if (size == 0) {
+               obj_free(pop, oidp);
+               return 0;
+       }
+
+       struct carg_realloc carg;
+       carg.ptr = OBJ_OFF_TO_PTR(pop, oidp->off);
+       carg.new_size = size;
+       carg.old_size = pmemobj_alloc_usable_size(*oidp);
+       carg.user_type = type_num;
+       carg.constructor = NULL;
+       carg.arg = NULL;
+       carg.zero_init = zero_init;
+
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       int ret = palloc_operation(&pop->heap, oidp->off, &oidp->off,
+                       size, constructor_realloc, &carg, type_num,
+                       0, 0, 0, ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * constructor_zrealloc_root -- (internal) constructor for pmemobj_root
+ */
+static int
+constructor_zrealloc_root(void *ctx, void *ptr, size_t usable_size, void *arg)
+{
+       PMEMobjpool *pop = ctx;
+       LOG(3, "pop %p ptr %p arg %p", pop, ptr, arg);
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       VALGRIND_ADD_TO_TX(ptr, usable_size);
+
+       struct carg_realloc *carg = arg;
+
+       constructor_realloc(pop, ptr, usable_size, arg);
+       int ret = 0;
+       if (carg->constructor)
+               ret = carg->constructor(pop, ptr, carg->arg);
+
+       VALGRIND_REMOVE_FROM_TX(ptr, usable_size);
+
+       return ret;
+}
+
+/*
+ * pmemobj_realloc -- resizes an existing object
+ */
+int
+pmemobj_realloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+               uint64_t type_num)
+{
+       ASSERTne(oidp, NULL);
+
+       LOG(3, "pop %p oid.off 0x%016" PRIx64 " size %zu type_num %" PRIu64,
+               pop, oidp->off, size, type_num);
+
+       PMEMOBJ_API_START();
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+       ASSERT(OBJ_OID_IS_VALID(pop, *oidp));
+
+       int ret = obj_realloc_common(pop, oidp, size, (type_num_t)type_num, 0);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_zrealloc -- resizes an existing object, any new space is zeroed.
+ */
+int
+pmemobj_zrealloc(PMEMobjpool *pop, PMEMoid *oidp, size_t size,
+               uint64_t type_num)
+{
+       ASSERTne(oidp, NULL);
+
+       LOG(3, "pop %p oid.off 0x%016" PRIx64 " size %zu type_num %" PRIu64,
+               pop, oidp->off, size, type_num);
+
+       PMEMOBJ_API_START();
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+       ASSERT(OBJ_OID_IS_VALID(pop, *oidp));
+
+       int ret = obj_realloc_common(pop, oidp, size, (type_num_t)type_num, 1);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/* arguments for constructor_strdup */
+struct carg_strdup {
+       size_t size;
+       const char *s;
+};
+
+/*
+ * constructor_strdup -- (internal) constructor of pmemobj_strdup
+ */
+static int
+constructor_strdup(PMEMobjpool *pop, void *ptr, void *arg)
+{
+       LOG(3, "pop %p ptr %p arg %p", pop, ptr, arg);
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       struct carg_strdup *carg = arg;
+
+       /* copy string */
+       pmemops_memcpy(&pop->p_ops, ptr, carg->s, carg->size, 0);
+
+       return 0;
+}
+
+/*
+ * pmemobj_strdup -- allocates a new object with duplicate of the string s.
+ */
+int
+pmemobj_strdup(PMEMobjpool *pop, PMEMoid *oidp, const char *s,
+               uint64_t type_num)
+{
+       LOG(3, "pop %p oidp %p string %s type_num %" PRIu64,
+           pop, oidp, s, type_num);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (NULL == s) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       PMEMOBJ_API_START();
+       struct carg_strdup carg;
+       carg.size = (strlen(s) + 1) * sizeof(char);
+       carg.s = s;
+
+       int ret = obj_alloc_construct(pop, oidp, carg.size,
+               (type_num_t)type_num, 0, constructor_strdup, &carg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/* arguments for constructor_wcsdup */
+struct carg_wcsdup {
+       size_t size;
+       const wchar_t *s;
+};
+
+/*
+ * constructor_wcsdup -- (internal) constructor of pmemobj_wcsdup
+ */
+static int
+constructor_wcsdup(PMEMobjpool *pop, void *ptr, void *arg)
+{
+       LOG(3, "pop %p ptr %p arg %p", pop, ptr, arg);
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       struct carg_wcsdup *carg = arg;
+
+       /* copy string */
+       pmemops_memcpy(&pop->p_ops, ptr, carg->s, carg->size, 0);
+
+       return 0;
+}
+
+/*
+ * pmemobj_wcsdup -- allocates a new object with duplicate of the wide character
+ * string s.
+ */
+int
+pmemobj_wcsdup(PMEMobjpool *pop, PMEMoid *oidp, const wchar_t *s,
+       uint64_t type_num)
+{
+       LOG(3, "pop %p oidp %p string %S type_num %" PRIu64,
+                   pop, oidp, s, type_num);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (NULL == s) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       PMEMOBJ_API_START();
+       struct carg_wcsdup carg;
+       carg.size = (wcslen(s) + 1) * sizeof(wchar_t);
+       carg.s = s;
+
+       int ret = obj_alloc_construct(pop, oidp, carg.size,
+               (type_num_t)type_num, 0, constructor_wcsdup, &carg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_free -- frees an existing object
+ */
+void
+pmemobj_free(PMEMoid *oidp)
+{
+       ASSERTne(oidp, NULL);
+
+       LOG(3, "oid.off 0x%016" PRIx64, oidp->off);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       if (oidp->off == 0)
+               return;
+
+       PMEMOBJ_API_START();
+       PMEMobjpool *pop = pmemobj_pool_by_oid(*oidp);
+
+       ASSERTne(pop, NULL);
+       ASSERT(OBJ_OID_IS_VALID(pop, *oidp));
+
+       obj_free(pop, oidp);
+       PMEMOBJ_API_END();
+}
+
+/*
+ * pmemobj_alloc_usable_size -- returns usable size of object
+ */
+size_t
+pmemobj_alloc_usable_size(PMEMoid oid)
+{
+       LOG(3, "oid.off 0x%016" PRIx64, oid.off);
+
+       if (oid.off == 0)
+               return 0;
+
+       PMEMobjpool *pop = pmemobj_pool_by_oid(oid);
+
+       ASSERTne(pop, NULL);
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+
+       return (palloc_usable_size(&pop->heap, oid.off));
+}
+
+/*
+ * pmemobj_memcpy_persist -- pmemobj version of memcpy
+ */
+void *
+pmemobj_memcpy_persist(PMEMobjpool *pop, void *dest, const void *src,
+       size_t len)
+{
+       LOG(15, "pop %p dest %p src %p len %zu", pop, dest, src, len);
+       PMEMOBJ_API_START();
+
+       void *ptr = pmemops_memcpy(&pop->p_ops, dest, src, len, 0);
+
+       PMEMOBJ_API_END();
+       return ptr;
+}
+
+/*
+ * pmemobj_memset_persist -- pmemobj version of memset
+ */
+void *
+pmemobj_memset_persist(PMEMobjpool *pop, void *dest, int c, size_t len)
+{
+       LOG(15, "pop %p dest %p c 0x%02x len %zu", pop, dest, c, len);
+       PMEMOBJ_API_START();
+
+       void *ptr = pmemops_memset(&pop->p_ops, dest, c, len, 0);
+
+       PMEMOBJ_API_END();
+       return ptr;
+}
+
+/*
+ * pmemobj_memcpy -- pmemobj version of memcpy
+ */
+void *
+pmemobj_memcpy(PMEMobjpool *pop, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       PMEMOBJ_API_START();
+
+       void *ptr = pmemops_memcpy(&pop->p_ops, dest, src, len, flags);
+
+       PMEMOBJ_API_END();
+       return ptr;
+}
+
+/*
+ * pmemobj_memmove -- pmemobj version of memmove
+ */
+void *
+pmemobj_memmove(PMEMobjpool *pop, void *dest, const void *src, size_t len,
+               unsigned flags)
+{
+       LOG(15, "pop %p dest %p src %p len %zu flags 0x%x", pop, dest, src, len,
+                       flags);
+
+       PMEMOBJ_API_START();
+
+       void *ptr = pmemops_memmove(&pop->p_ops, dest, src, len, flags);
+
+       PMEMOBJ_API_END();
+       return ptr;
+}
+
+/*
+ * pmemobj_memset -- pmemobj version of memset
+ */
+void *
+pmemobj_memset(PMEMobjpool *pop, void *dest, int c, size_t len, unsigned flags)
+{
+       LOG(15, "pop %p dest %p c 0x%02x len %zu flags 0x%x", pop, dest, c, len,
+                       flags);
+
+       PMEMOBJ_API_START();
+
+       void *ptr = pmemops_memset(&pop->p_ops, dest, c, len, flags);
+
+       PMEMOBJ_API_END();
+       return ptr;
+}
+
+/*
+ * pmemobj_persist -- pmemobj version of pmem_persist
+ */
+void
+pmemobj_persist(PMEMobjpool *pop, const void *addr, size_t len)
+{
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       pmemops_persist(&pop->p_ops, addr, len);
+}
+
+/*
+ * pmemobj_flush -- pmemobj version of pmem_flush
+ */
+void
+pmemobj_flush(PMEMobjpool *pop, const void *addr, size_t len)
+{
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       pmemops_flush(&pop->p_ops, addr, len);
+}
+
+/*
+ * pmemobj_xpersist -- pmemobj version of pmem_persist with additional flags
+ * argument
+ */
+int
+pmemobj_xpersist(PMEMobjpool *pop, const void *addr, size_t len, unsigned flags)
+{
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       if (flags & ~OBJ_X_VALID_FLAGS) {
+               errno = EINVAL;
+               ERR("invalid flags 0x%x", flags);
+               return -1;
+       }
+
+       return pmemops_xpersist(&pop->p_ops, addr, len, flags);
+}
+
+/*
+ * pmemobj_xflush -- pmemobj version of pmem_flush with additional flags
+ * argument
+ */
+int
+pmemobj_xflush(PMEMobjpool *pop, const void *addr, size_t len, unsigned flags)
+{
+       LOG(15, "pop %p addr %p len %zu", pop, addr, len);
+
+       if (flags & ~OBJ_X_VALID_FLAGS) {
+               errno = EINVAL;
+               ERR("invalid flags 0x%x", flags);
+               return -1;
+       }
+
+       return pmemops_xflush(&pop->p_ops, addr, len, flags);
+}
+
+/*
+ * pmemobj_drain -- pmemobj version of pmem_drain
+ */
+void
+pmemobj_drain(PMEMobjpool *pop)
+{
+       LOG(15, "pop %p", pop);
+
+       pmemops_drain(&pop->p_ops);
+}
+
+/*
+ * pmemobj_type_num -- returns type number of object
+ */
+uint64_t
+pmemobj_type_num(PMEMoid oid)
+{
+       LOG(3, "oid.off 0x%016" PRIx64, oid.off);
+
+       ASSERT(!OID_IS_NULL(oid));
+
+       PMEMobjpool *pop = pmemobj_pool_by_oid(oid);
+
+       ASSERTne(pop, NULL);
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+
+       return palloc_extra(&pop->heap, oid.off);
+}
+
+/* arguments for constructor_alloc_root */
+struct carg_root {
+       size_t size;
+       pmemobj_constr constructor;
+       void *arg;
+};
+
+/*
+ * obj_realloc_root -- (internal) reallocate root object
+ */
+static int
+obj_alloc_root(PMEMobjpool *pop, size_t size,
+       pmemobj_constr constructor, void *arg)
+{
+       LOG(3, "pop %p size %zu", pop, size);
+
+       struct carg_realloc carg;
+
+       carg.ptr = OBJ_OFF_TO_PTR(pop, pop->root_offset);
+       carg.old_size = pop->root_size;
+       carg.new_size = size;
+       carg.user_type = POBJ_ROOT_TYPE_NUM;
+       carg.constructor = constructor;
+       carg.zero_init = 1;
+       carg.arg = arg;
+
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       operation_add_entry(ctx, &pop->root_size, size, ULOG_OPERATION_SET);
+
+       int ret = palloc_operation(&pop->heap, pop->root_offset,
+                       &pop->root_offset, size,
+                       constructor_zrealloc_root, &carg,
+                       POBJ_ROOT_TYPE_NUM, OBJ_INTERNAL_OBJECT_MASK,
+                       0, 0, ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * pmemobj_root_size -- returns size of the root object
+ */
+size_t
+pmemobj_root_size(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       if (pop->root_offset && pop->root_size) {
+               return pop->root_size;
+       } else
+               return 0;
+}
+
+/*
+ * pmemobj_root_construct -- returns root object
+ */
+PMEMoid
+pmemobj_root_construct(PMEMobjpool *pop, size_t size,
+       pmemobj_constr constructor, void *arg)
+{
+       LOG(3, "pop %p size %zu constructor %p args %p", pop, size, constructor,
+               arg);
+
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               errno = ENOMEM;
+               return OID_NULL;
+       }
+
+       if (size == 0 && pop->root_offset == 0) {
+               ERR("requested size cannot equals zero");
+               errno = EINVAL;
+               return OID_NULL;
+       }
+
+       PMEMOBJ_API_START();
+
+       PMEMoid root;
+
+       pmemobj_mutex_lock_nofail(pop, &pop->rootlock);
+
+       if (size > pop->root_size &&
+               obj_alloc_root(pop, size, constructor, arg)) {
+               pmemobj_mutex_unlock_nofail(pop, &pop->rootlock);
+               LOG(2, "obj_realloc_root failed");
+               PMEMOBJ_API_END();
+               return OID_NULL;
+       }
+
+       root.pool_uuid_lo = pop->uuid_lo;
+       root.off = pop->root_offset;
+
+       pmemobj_mutex_unlock_nofail(pop, &pop->rootlock);
+
+       PMEMOBJ_API_END();
+       return root;
+}
+
+/*
+ * pmemobj_root -- returns root object
+ */
+PMEMoid
+pmemobj_root(PMEMobjpool *pop, size_t size)
+{
+       LOG(3, "pop %p size %zu", pop, size);
+
+       PMEMOBJ_API_START();
+       PMEMoid oid = pmemobj_root_construct(pop, size, NULL, NULL);
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_first - returns first object of specified type
+ */
+PMEMoid
+pmemobj_first(PMEMobjpool *pop)
+{
+       LOG(3, "pop %p", pop);
+
+       PMEMoid ret = {0, 0};
+
+       uint64_t off = palloc_first(&pop->heap);
+       if (off != 0) {
+               ret.off = off;
+               ret.pool_uuid_lo = pop->uuid_lo;
+
+               if (palloc_flags(&pop->heap, off) & OBJ_INTERNAL_OBJECT_MASK) {
+                       return pmemobj_next(ret);
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * pmemobj_next - returns next object of specified type
+ */
+PMEMoid
+pmemobj_next(PMEMoid oid)
+{
+       LOG(3, "oid.off 0x%016" PRIx64, oid.off);
+
+       PMEMoid curr = oid;
+       if (curr.off == 0)
+               return OID_NULL;
+
+       PMEMobjpool *pop = pmemobj_pool_by_oid(curr);
+       ASSERTne(pop, NULL);
+
+       do {
+               ASSERT(OBJ_OID_IS_VALID(pop, curr));
+               uint64_t next_off = palloc_next(&pop->heap, curr.off);
+
+               if (next_off == 0)
+                       return OID_NULL;
+
+               /* next object exists */
+               curr.off = next_off;
+
+       } while (palloc_flags(&pop->heap, curr.off) & OBJ_INTERNAL_OBJECT_MASK);
+
+       return curr;
+}
+
+/*
+ * pmemobj_reserve -- reserves a single object
+ */
+PMEMoid
+pmemobj_reserve(PMEMobjpool *pop, struct pobj_action *act,
+       size_t size, uint64_t type_num)
+{
+       LOG(3, "pop %p act %p size %zu type_num %llx",
+               pop, act, size,
+               (unsigned long long)type_num);
+
+       PMEMOBJ_API_START();
+       PMEMoid oid = OID_NULL;
+
+       if (palloc_reserve(&pop->heap, size, NULL, NULL, type_num,
+               0, 0, 0, act) != 0) {
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       oid.off = act->heap.offset;
+       oid.pool_uuid_lo = pop->uuid_lo;
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_xreserve -- reserves a single object
+ */
+PMEMoid
+pmemobj_xreserve(PMEMobjpool *pop, struct pobj_action *act,
+       size_t size, uint64_t type_num, uint64_t flags)
+{
+       LOG(3, "pop %p act %p size %zu type_num %llx flags %llx",
+               pop, act, size,
+               (unsigned long long)type_num, (unsigned long long)flags);
+
+       PMEMoid oid = OID_NULL;
+
+       if (flags & ~POBJ_ACTION_XRESERVE_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_ACTION_XRESERVE_VALID_FLAGS);
+               errno = EINVAL;
+               return oid;
+       }
+
+       PMEMOBJ_API_START();
+       struct constr_args carg;
+
+       carg.zero_init = flags & POBJ_FLAG_ZERO;
+       carg.constructor = NULL;
+       carg.arg = NULL;
+
+       if (palloc_reserve(&pop->heap, size, constructor_alloc, &carg,
+               type_num, 0, CLASS_ID_FROM_FLAG(flags),
+               ARENA_ID_FROM_FLAG(flags), act) != 0) {
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       oid.off = act->heap.offset;
+       oid.pool_uuid_lo = pop->uuid_lo;
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_set_value -- creates an action to set a value
+ */
+void
+pmemobj_set_value(PMEMobjpool *pop, struct pobj_action *act,
+       uint64_t *ptr, uint64_t value)
+{
+       palloc_set_value(&pop->heap, act, ptr, value);
+}
+
+/*
+ * pmemobj_defer_free -- creates a deferred free action
+ */
+void
+pmemobj_defer_free(PMEMobjpool *pop, PMEMoid oid, struct pobj_action *act)
+{
+       ASSERT(!OID_IS_NULL(oid));
+       palloc_defer_free(&pop->heap, oid.off, act);
+}
+
+/*
+ * pmemobj_publish -- publishes a collection of actions
+ */
+int
+pmemobj_publish(PMEMobjpool *pop, struct pobj_action *actv, size_t actvcnt)
+{
+       PMEMOBJ_API_START();
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       size_t entries_size = actvcnt * sizeof(struct ulog_entry_val);
+
+       if (operation_reserve(ctx, entries_size) != 0) {
+               PMEMOBJ_API_END();
+               return -1;
+       }
+
+       palloc_publish(&pop->heap, actv, actvcnt, ctx);
+
+       pmalloc_operation_release(pop);
+
+       PMEMOBJ_API_END();
+       return 0;
+}
+
+/*
+ * pmemobj_cancel -- cancels collection of actions
+ */
+void
+pmemobj_cancel(PMEMobjpool *pop, struct pobj_action *actv, size_t actvcnt)
+{
+       PMEMOBJ_API_START();
+       palloc_cancel(&pop->heap, actv, actvcnt);
+       PMEMOBJ_API_END();
+}
+
+/*
+ * pmemobj_defrag -- reallocates provided PMEMoids so that the underlying memory
+ *     is efficiently arranged.
+ */
+int
+pmemobj_defrag(PMEMobjpool *pop, PMEMoid **oidv, size_t oidcnt,
+       struct pobj_defrag_result *result)
+{
+       PMEMOBJ_API_START();
+
+       if (result) {
+               result->relocated = 0;
+               result->total = 0;
+       }
+
+       uint64_t **objv = Malloc(sizeof(uint64_t *) * oidcnt);
+       if (objv == NULL)
+               return -1;
+
+       int ret = 0;
+
+       size_t j = 0;
+       for (size_t i = 0; i < oidcnt; ++i) {
+               if (OID_IS_NULL(*oidv[i]))
+                       continue;
+               if (oidv[i]->pool_uuid_lo != pop->uuid_lo) {
+                       ret = -1;
+                       ERR("Not all PMEMoids belong to the provided pool");
+                       goto out;
+               }
+               objv[j++] = &oidv[i]->off;
+       }
+
+       struct operation_context *ctx = pmalloc_operation_hold(pop);
+
+       ret = palloc_defrag(&pop->heap, objv, j, ctx, result);
+
+       pmalloc_operation_release(pop);
+
+out:
+       Free(objv);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_list_insert -- adds object to a list
+ */
+int
+pmemobj_list_insert(PMEMobjpool *pop, size_t pe_offset, void *head,
+                   PMEMoid dest, int before, PMEMoid oid)
+{
+       LOG(3, "pop %p pe_offset %zu head %p dest.off 0x%016" PRIx64
+           " before %d oid.off 0x%016" PRIx64,
+           pop, pe_offset, head, dest.off, before, oid.off);
+       PMEMOBJ_API_START();
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+       ASSERT(OBJ_OID_IS_VALID(pop, dest));
+
+       ASSERT(pe_offset <= pmemobj_alloc_usable_size(dest)
+                       - sizeof(struct list_entry));
+       ASSERT(pe_offset <= pmemobj_alloc_usable_size(oid)
+                       - sizeof(struct list_entry));
+
+       int ret = list_insert(pop, (ssize_t)pe_offset, head, dest, before, oid);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_list_insert_new -- adds new object to a list
+ */
+PMEMoid
+pmemobj_list_insert_new(PMEMobjpool *pop, size_t pe_offset, void *head,
+                       PMEMoid dest, int before, size_t size,
+                       uint64_t type_num,
+                       pmemobj_constr constructor, void *arg)
+{
+       LOG(3, "pop %p pe_offset %zu head %p dest.off 0x%016" PRIx64
+           " before %d size %zu type_num %" PRIu64,
+           pop, pe_offset, head, dest.off, before, size, type_num);
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+       ASSERT(OBJ_OID_IS_VALID(pop, dest));
+
+       ASSERT(pe_offset <= pmemobj_alloc_usable_size(dest)
+                       - sizeof(struct list_entry));
+       ASSERT(pe_offset <= size - sizeof(struct list_entry));
+
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               errno = ENOMEM;
+               return OID_NULL;
+       }
+
+       PMEMOBJ_API_START();
+       struct constr_args carg;
+
+       carg.constructor = constructor;
+       carg.arg = arg;
+       carg.zero_init = 0;
+
+       PMEMoid retoid = OID_NULL;
+       list_insert_new_user(pop, pe_offset, head, dest, before, size, type_num,
+                       constructor_alloc, &carg, &retoid);
+
+       PMEMOBJ_API_END();
+       return retoid;
+}
+
+/*
+ * pmemobj_list_remove -- removes object from a list
+ */
+int
+pmemobj_list_remove(PMEMobjpool *pop, size_t pe_offset, void *head,
+                   PMEMoid oid, int free)
+{
+       LOG(3, "pop %p pe_offset %zu head %p oid.off 0x%016" PRIx64 " free %d",
+           pop, pe_offset, head, oid.off, free);
+       PMEMOBJ_API_START();
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+
+       ASSERT(pe_offset <= pmemobj_alloc_usable_size(oid)
+                       - sizeof(struct list_entry));
+
+       int ret;
+       if (free)
+               ret = list_remove_free_user(pop, pe_offset, head, &oid);
+       else
+               ret = list_remove(pop, (ssize_t)pe_offset, head, oid);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_list_move -- moves object between lists
+ */
+int
+pmemobj_list_move(PMEMobjpool *pop, size_t pe_old_offset, void *head_old,
+                       size_t pe_new_offset, void *head_new,
+                       PMEMoid dest, int before, PMEMoid oid)
+{
+       LOG(3, "pop %p pe_old_offset %zu pe_new_offset %zu"
+           " head_old %p head_new %p dest.off 0x%016" PRIx64
+           " before %d oid.off 0x%016" PRIx64 "",
+           pop, pe_old_offset, pe_new_offset,
+           head_old, head_new, dest.off, before, oid.off);
+       PMEMOBJ_API_START();
+
+       /* log notice message if used inside a transaction */
+       _POBJ_DEBUG_NOTICE_IN_TX();
+
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+       ASSERT(OBJ_OID_IS_VALID(pop, dest));
+
+       ASSERT(pe_old_offset <= pmemobj_alloc_usable_size(oid)
+                       - sizeof(struct list_entry));
+       ASSERT(pe_new_offset <= pmemobj_alloc_usable_size(oid)
+                       - sizeof(struct list_entry));
+       ASSERT(pe_old_offset <= pmemobj_alloc_usable_size(dest)
+                       - sizeof(struct list_entry));
+       ASSERT(pe_new_offset <= pmemobj_alloc_usable_size(dest)
+                       - sizeof(struct list_entry));
+
+       int ret = list_move(pop, pe_old_offset, head_old,
+                               pe_new_offset, head_new,
+                               dest, before, oid);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_ctl_getU -- programmatically executes a read ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemobj_ctl_getU(PMEMobjpool *pop, const char *name, void *arg)
+{
+       LOG(3, "pop %p name %s arg %p", pop, name, arg);
+       return ctl_query(pop == NULL ? NULL : pop->ctl, pop,
+                       CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_READ, arg);
+}
+
+/*
+ * pmemobj_ctl_setU -- programmatically executes a write ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemobj_ctl_setU(PMEMobjpool *pop, const char *name, void *arg)
+{
+       LOG(3, "pop %p name %s arg %p", pop, name, arg);
+       return ctl_query(pop == NULL ? NULL : pop->ctl, pop,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_WRITE, arg);
+}
+
+/*
+ * pmemobj_ctl_execU -- programmatically executes a runnable ctl query
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmemobj_ctl_execU(PMEMobjpool *pop, const char *name, void *arg)
+{
+       LOG(3, "pop %p name %s arg %p", pop, name, arg);
+       return ctl_query(pop == NULL ? NULL : pop->ctl, pop,
+               CTL_QUERY_PROGRAMMATIC, name, CTL_QUERY_RUNNABLE, arg);
+}
+
+#ifndef _WIN32
+/*
+ * pmemobj_ctl_get -- programmatically executes a read ctl query
+ */
+int
+pmemobj_ctl_get(PMEMobjpool *pop, const char *name, void *arg)
+{
+       return pmemobj_ctl_getU(pop, name, arg);
+}
+
+/*
+ * pmemobj_ctl_set -- programmatically executes a write ctl query
+ */
+int
+pmemobj_ctl_set(PMEMobjpool *pop, const char *name, void *arg)
+{
+       PMEMOBJ_API_START();
+
+       int ret = pmemobj_ctl_setU(pop, name, arg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_ctl_exec -- programmatically executes a runnable ctl query
+ */
+int
+pmemobj_ctl_exec(PMEMobjpool *pop, const char *name, void *arg)
+{
+       PMEMOBJ_API_START();
+
+       int ret =  pmemobj_ctl_execU(pop, name, arg);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+#else
+/*
+ * pmemobj_ctl_getW -- programmatically executes a read ctl query
+ */
+int
+pmemobj_ctl_getW(PMEMobjpool *pop, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemobj_ctl_getU(pop, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemobj_ctl_setW -- programmatically executes a write ctl query
+ */
+int
+pmemobj_ctl_setW(PMEMobjpool *pop, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemobj_ctl_setU(pop, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+
+/*
+ * pmemobj_ctl_execW -- programmatically executes a runnable ctl query
+ */
+int
+pmemobj_ctl_execW(PMEMobjpool *pop, const wchar_t *name, void *arg)
+{
+       char *uname = util_toUTF8(name);
+       if (uname == NULL)
+               return -1;
+
+       int ret = pmemobj_ctl_execU(pop, uname, arg);
+       util_free_UTF8(uname);
+
+       return ret;
+}
+#endif
+
+/*
+ * _pobj_debug_notice -- logs notice message if used inside a transaction
+ */
+void
+_pobj_debug_notice(const char *api_name, const char *file, int line)
+{
+#ifdef DEBUG
+       if (pmemobj_tx_stage() != TX_STAGE_NONE) {
+               if (file)
+                       LOG(4, "Notice: non-transactional API"
+                               " used inside a transaction (%s in %s:%d)",
+                               api_name, file, line);
+               else
+                       LOG(4, "Notice: non-transactional API"
+                               " used inside a transaction (%s)", api_name);
+       }
+#endif /* DEBUG */
+}
+
+#if VG_PMEMCHECK_ENABLED
+/*
+ * pobj_emit_log -- logs library and function names to pmemcheck store log
+ */
+void
+pobj_emit_log(const char *func, int order)
+{
+       util_emit_log("libpmemobj", func, order);
+}
+#endif
+
+#if FAULT_INJECTION
+void
+pmemobj_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at)
+{
+       core_inject_fault_at(type, nth, at);
+}
+
+int
+pmemobj_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/obj.h b/ceph/src/pmdk/src/libpmemobj/obj.h
new file mode 100644 (file)
index 0000000..5269ead
--- /dev/null
@@ -0,0 +1,289 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * obj.h -- internal definitions for obj module
+ */
+
+#ifndef LIBPMEMOBJ_OBJ_H
+#define LIBPMEMOBJ_OBJ_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "lane.h"
+#include "pool_hdr.h"
+#include "pmalloc.h"
+#include "ctl.h"
+#include "sync.h"
+#include "stats.h"
+#include "ctl_debug.h"
+#include "page_size.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "alloc.h"
+#include "fault_injection.h"
+
+#define PMEMOBJ_LOG_PREFIX "libpmemobj"
+#define PMEMOBJ_LOG_LEVEL_VAR "PMEMOBJ_LOG_LEVEL"
+#define PMEMOBJ_LOG_FILE_VAR "PMEMOBJ_LOG_FILE"
+
+/* attributes of the obj memory pool format for the pool header */
+#define OBJ_HDR_SIG "PMEMOBJ"  /* must be 8 bytes including '\0' */
+#define OBJ_FORMAT_MAJOR 6
+
+#define OBJ_FORMAT_FEAT_DEFAULT \
+       {POOL_FEAT_COMPAT_DEFAULT, POOL_FEAT_INCOMPAT_DEFAULT, 0x0000}
+
+#define OBJ_FORMAT_FEAT_CHECK \
+       {POOL_FEAT_COMPAT_VALID, POOL_FEAT_INCOMPAT_VALID, 0x0000}
+
+static const features_t obj_format_feat_default = OBJ_FORMAT_FEAT_CHECK;
+
+/* size of the persistent part of PMEMOBJ pool descriptor */
+#define OBJ_DSC_P_SIZE         2048
+/* size of unused part of the persistent part of PMEMOBJ pool descriptor */
+#define OBJ_DSC_P_UNUSED       (OBJ_DSC_P_SIZE - PMEMOBJ_MAX_LAYOUT - 40)
+
+#define OBJ_LANES_OFFSET       (sizeof(struct pmemobjpool)) /* lanes offset */
+#define OBJ_NLANES             1024    /* number of lanes */
+
+#define OBJ_OFF_TO_PTR(pop, off) ((void *)((uintptr_t)(pop) + (off)))
+#define OBJ_PTR_TO_OFF(pop, ptr) ((uintptr_t)(ptr) - (uintptr_t)(pop))
+#define OBJ_OID_IS_NULL(oid)   ((oid).off == 0)
+#define OBJ_LIST_EMPTY(head)   OBJ_OID_IS_NULL((head)->pe_first)
+#define OBJ_OFF_FROM_HEAP(pop, off)\
+       ((off) >= (pop)->heap_offset &&\
+       (off) < (pop)->heap_offset + (pop)->heap_size)
+#define OBJ_OFF_FROM_LANES(pop, off)\
+       ((off) >= (pop)->lanes_offset &&\
+       (off) < (pop)->lanes_offset +\
+       (pop)->nlanes * sizeof(struct lane_layout))
+
+#define OBJ_PTR_FROM_POOL(pop, ptr)\
+       ((uintptr_t)(ptr) >= (uintptr_t)(pop) &&\
+       (uintptr_t)(ptr) < (uintptr_t)(pop) +\
+       (pop)->heap_offset + (pop)->heap_size)
+
+#define OBJ_OFF_IS_VALID(pop, off)\
+       (OBJ_OFF_FROM_HEAP(pop, off) ||\
+       (OBJ_PTR_TO_OFF(pop, &(pop)->root_offset) == (off)) ||\
+       (OBJ_PTR_TO_OFF(pop, &(pop)->root_size) == (off)) ||\
+       (OBJ_OFF_FROM_LANES(pop, off)))
+
+#define OBJ_PTR_IS_VALID(pop, ptr)\
+       OBJ_OFF_IS_VALID(pop, OBJ_PTR_TO_OFF(pop, ptr))
+
+typedef void (*persist_local_fn)(const void *, size_t);
+typedef void (*flush_local_fn)(const void *, size_t);
+typedef void (*drain_local_fn)(void);
+
+typedef void *(*memcpy_local_fn)(void *dest, const void *src, size_t len,
+               unsigned flags);
+typedef void *(*memmove_local_fn)(void *dest, const void *src, size_t len,
+               unsigned flags);
+typedef void *(*memset_local_fn)(void *dest, int c, size_t len, unsigned flags);
+
+typedef int (*persist_remote_fn)(PMEMobjpool *pop, const void *addr,
+                               size_t len, unsigned lane, unsigned flags);
+
+typedef uint64_t type_num_t;
+
+#define CONVERSION_FLAG_OLD_SET_CACHE ((1ULL) << 0)
+
+/* PMEM_OBJ_POOL_HEAD_SIZE Without the unused and unused2 arrays */
+#define PMEM_OBJ_POOL_HEAD_SIZE 2196
+#define PMEM_OBJ_POOL_UNUSED2_SIZE (PMEM_PAGESIZE \
+                                       - OBJ_DSC_P_UNUSED\
+                                       - PMEM_OBJ_POOL_HEAD_SIZE)
+
+struct pmemobjpool {
+       struct pool_hdr hdr;    /* memory pool header */
+
+       /* persistent part of PMEMOBJ pool descriptor (2kB) */
+       char layout[PMEMOBJ_MAX_LAYOUT];
+       uint64_t lanes_offset;
+       uint64_t nlanes;
+       uint64_t heap_offset;
+       uint64_t unused3;
+       unsigned char unused[OBJ_DSC_P_UNUSED]; /* must be zero */
+       uint64_t checksum;      /* checksum of above fields */
+
+       uint64_t root_offset;
+
+       /* unique runID for this program run - persistent but not checksummed */
+       uint64_t run_id;
+
+       uint64_t root_size;
+
+       /*
+        * These flags can be set from a conversion tool and are set only for
+        * the first recovery of the pool.
+        */
+       uint64_t conversion_flags;
+
+       uint64_t heap_size;
+
+       struct stats_persistent stats_persistent;
+
+       char pmem_reserved[496]; /* must be zeroed */
+
+       /* some run-time state, allocated out of memory pool... */
+       void *addr;             /* mapped region */
+       int is_pmem;            /* true if pool is PMEM */
+       int rdonly;             /* true if pool is opened read-only */
+       struct palloc_heap heap;
+       struct lane_descriptor lanes_desc;
+       uint64_t uuid_lo;
+       int is_dev_dax;         /* true if mapped on device dax */
+
+       struct ctl *ctl;        /* top level node of the ctl tree structure */
+       struct stats *stats;
+
+       struct pool_set *set;           /* pool set info */
+       struct pmemobjpool *replica;    /* next replica */
+
+       /* per-replica functions: pmem or non-pmem */
+       persist_local_fn persist_local; /* persist function */
+       flush_local_fn flush_local;     /* flush function */
+       drain_local_fn drain_local;     /* drain function */
+       memcpy_local_fn memcpy_local; /* persistent memcpy function */
+       memmove_local_fn memmove_local; /* persistent memmove function */
+       memset_local_fn memset_local; /* persistent memset function */
+
+       /* for 'master' replica: with or without data replication */
+       struct pmem_ops p_ops;
+
+       PMEMmutex rootlock;     /* root object lock */
+       int is_master_replica;
+       int has_remote_replicas;
+
+       /* remote replica section */
+       void *rpp;      /* RPMEMpool opaque handle if it is a remote replica */
+       uintptr_t remote_base;  /* beginning of the remote pool */
+       char *node_addr;        /* address of a remote node */
+       char *pool_desc;        /* descriptor of a poolset */
+
+       persist_remote_fn persist_remote; /* remote persist function */
+
+       int vg_boot;
+       int tx_debug_skip_expensive_checks;
+
+       struct tx_parameters *tx_params;
+
+       /*
+        * Locks are dynamically allocated on FreeBSD. Keep track so
+        * we can free them on pmemobj_close.
+        */
+       PMEMmutex_internal *mutex_head;
+       PMEMrwlock_internal *rwlock_head;
+       PMEMcond_internal *cond_head;
+
+       struct {
+               struct ravl *map;
+               os_mutex_t lock;
+               int verify;
+       } ulog_user_buffers;
+
+       void *user_data;
+
+       /* padding to align size of this structure to page boundary */
+       /* sizeof(unused2) == 8192 - offsetof(struct pmemobjpool, unused2) */
+       char unused2[PMEM_OBJ_POOL_UNUSED2_SIZE];
+};
+
+/*
+ * Stored in the 'size' field of oobh header, determines whether the object
+ * is internal or not. Internal objects are skipped in pmemobj iteration
+ * functions.
+ */
+#define OBJ_INTERNAL_OBJECT_MASK ((1ULL) << 15)
+
+#define CLASS_ID_FROM_FLAG(flag)\
+((uint16_t)((flag) >> 48))
+
+#define ARENA_ID_FROM_FLAG(flag)\
+((uint16_t)((flag) >> 32))
+
+/*
+ * pmemobj_get_uuid_lo -- (internal) evaluates XOR sum of least significant
+ * 8 bytes with most significant 8 bytes.
+ */
+static inline uint64_t
+pmemobj_get_uuid_lo(PMEMobjpool *pop)
+{
+       uint64_t uuid_lo = 0;
+
+       for (int i = 0; i < 8; i++) {
+               uuid_lo = (uuid_lo << 8) |
+                       (pop->hdr.poolset_uuid[i] ^
+                               pop->hdr.poolset_uuid[8 + i]);
+       }
+
+       return uuid_lo;
+}
+
+/*
+ * OBJ_OID_IS_VALID -- (internal) checks if 'oid' is valid
+ */
+static inline int
+OBJ_OID_IS_VALID(PMEMobjpool *pop, PMEMoid oid)
+{
+       return OBJ_OID_IS_NULL(oid) ||
+               (oid.pool_uuid_lo == pop->uuid_lo &&
+                   oid.off >= pop->heap_offset &&
+                   oid.off < pop->heap_offset + pop->heap_size);
+}
+
+static inline int
+OBJ_OFF_IS_VALID_FROM_CTX(void *ctx, uint64_t offset)
+{
+       PMEMobjpool *pop = (PMEMobjpool *)ctx;
+       return OBJ_OFF_IS_VALID(pop, offset);
+}
+
+void obj_init(void);
+void obj_fini(void);
+int obj_read_remote(void *ctx, uintptr_t base, void *dest, void *addr,
+               size_t length);
+
+/*
+ * (debug helper macro) logs notice message if used inside a transaction
+ */
+#ifdef DEBUG
+#define _POBJ_DEBUG_NOTICE_IN_TX()\
+       _pobj_debug_notice(__func__, NULL, 0)
+#else
+#define _POBJ_DEBUG_NOTICE_IN_TX() do {} while (0)
+#endif
+
+#if FAULT_INJECTION
+void
+pmemobj_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at);
+
+int
+pmemobj_fault_injection_enabled(void);
+#else
+static inline void
+pmemobj_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       abort();
+}
+
+static inline int
+pmemobj_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/palloc.c b/ceph/src/pmdk/src/libpmemobj/palloc.c
new file mode 100644 (file)
index 0000000..856aba6
--- /dev/null
@@ -0,0 +1,1336 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * palloc.c -- implementation of pmalloc POSIX-like API
+ *
+ * This is the front-end part of the persistent memory allocator. It uses both
+ * transient and persistent representation of the heap to provide memory blocks
+ * in a reasonable time and with an acceptable common-case fragmentation.
+ *
+ * Lock ordering in the entirety of the allocator is simple, but might be hard
+ * to follow at times because locks are, by necessity, externalized.
+ * There are two sets of locks that need to be taken into account:
+ *     - runtime state locks, represented by buckets.
+ *     - persistent state locks, represented by memory block mutexes.
+ *
+ * To properly use them, follow these rules:
+ *     - When nesting, always lock runtime state first.
+ *     Doing the reverse might cause deadlocks in other parts of the code.
+ *
+ *     - When introducing functions that would require runtime state locks,
+ *     always try to move the lock acquiring to the upper most layer. This
+ *     usually means that the functions will simply take "struct bucket" as
+ *     their argument. By doing so most of the locking can happen in
+ *     the frontend part of the allocator and it's easier to follow the first
+ *     rule because all functions in the backend can safely use the persistent
+ *     state locks - the runtime lock, if it is needed, will be already taken
+ *     by the upper layer.
+ *
+ * General lock ordering:
+ *     1. arenas.lock
+ *     2. buckets (sorted by ID)
+ *     3. memory blocks (sorted by lock address)
+ */
+
+#include "valgrind_internal.h"
+#include "heap_layout.h"
+#include "heap.h"
+#include "alloc_class.h"
+#include "out.h"
+#include "sys_util.h"
+#include "palloc.h"
+#include "ravl.h"
+#include "vec.h"
+
+struct pobj_action_internal {
+       /* type of operation (alloc/free vs set) */
+       enum pobj_action_type type;
+
+       /* not used */
+       uint32_t padding;
+
+       /*
+        * Action-specific lock that needs to be taken for the duration of
+        * an action.
+        */
+       os_mutex_t *lock;
+
+       /* action-specific data */
+       union {
+               /* valid only when type == POBJ_ACTION_TYPE_HEAP */
+               struct {
+                       uint64_t offset;
+                       uint64_t usable_size;
+                       enum memblock_state new_state;
+                       struct memory_block m;
+                       struct memory_block_reserved *mresv;
+               };
+
+               /* valid only when type == POBJ_ACTION_TYPE_MEM */
+               struct {
+                       uint64_t *ptr;
+                       uint64_t value;
+               };
+
+               /* padding, not used */
+               uint64_t data2[14];
+       };
+};
+
+/*
+ * palloc_set_value -- creates a new set memory action
+ */
+void
+palloc_set_value(struct palloc_heap *heap, struct pobj_action *act,
+       uint64_t *ptr, uint64_t value)
+{
+       act->type = POBJ_ACTION_TYPE_MEM;
+
+       struct pobj_action_internal *actp = (struct pobj_action_internal *)act;
+       actp->ptr = ptr;
+       actp->value = value;
+       actp->lock = NULL;
+}
+
+/*
+ * alloc_prep_block -- (internal) prepares a memory block for allocation
+ *
+ * Once the block is fully reserved and it's guaranteed that no one else will
+ * be able to write to this memory region it is safe to write the allocation
+ * header and call the object construction function.
+ *
+ * Because the memory block at this stage is only reserved in transient state
+ * there's no need to worry about fail-safety of this method because in case
+ * of a crash the memory will be back in the free blocks collection.
+ */
+static int
+alloc_prep_block(struct palloc_heap *heap, const struct memory_block *m,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       struct pobj_action_internal *out)
+{
+       void *uptr = m->m_ops->get_user_data(m);
+       size_t usize = m->m_ops->get_user_size(m);
+
+       VALGRIND_DO_MEMPOOL_ALLOC(heap->layout, uptr, usize);
+       VALGRIND_DO_MAKE_MEM_UNDEFINED(uptr, usize);
+       VALGRIND_ANNOTATE_NEW_MEMORY(uptr, usize);
+
+       m->m_ops->write_header(m, extra_field, object_flags);
+
+       /*
+        * Set allocated memory with pattern, if debug.heap.alloc_pattern CTL
+        * parameter had been set.
+        */
+       if (unlikely(heap->alloc_pattern > PALLOC_CTL_DEBUG_NO_PATTERN)) {
+               pmemops_memset(&heap->p_ops, uptr, heap->alloc_pattern,
+                       usize, 0);
+               VALGRIND_DO_MAKE_MEM_UNDEFINED(uptr, usize);
+       }
+
+       int ret;
+       if (constructor != NULL &&
+               (ret = constructor(heap->base, uptr, usize, arg)) != 0) {
+
+               /*
+                * If canceled, revert the block back to the free state in vg
+                * machinery.
+                */
+               VALGRIND_DO_MEMPOOL_FREE(heap->layout, uptr);
+
+               return ret;
+       }
+
+       /*
+        * To avoid determining the user data pointer twice this method is also
+        * responsible for calculating the offset of the object in the pool that
+        * will be used to set the offset destination pointer provided by the
+        * caller.
+        */
+       out->offset = HEAP_PTR_TO_OFF(heap, uptr);
+       out->usable_size = usize;
+
+       return 0;
+}
+
+/*
+ * palloc_reservation_create -- creates a volatile reservation of a
+ *     memory block.
+ *
+ * The first step in the allocation of a new block is reserving it in
+ * the transient heap - which is represented by the bucket abstraction.
+ *
+ * To provide optimal scaling for multi-threaded applications and reduce
+ * fragmentation the appropriate bucket is chosen depending on the
+ * current thread context and to which allocation class the requested
+ * size falls into.
+ *
+ * Once the bucket is selected, just enough memory is reserved for the
+ * requested size. The underlying block allocation algorithm
+ * (best-fit, next-fit, ...) varies depending on the bucket container.
+ */
+static int
+palloc_reservation_create(struct palloc_heap *heap, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       uint16_t class_id, uint16_t arena_id,
+       struct pobj_action_internal *out)
+{
+       int err = 0;
+
+       struct memory_block *new_block = &out->m;
+       out->type = POBJ_ACTION_TYPE_HEAP;
+
+       ASSERT(class_id < UINT8_MAX);
+       struct alloc_class *c = class_id == 0 ?
+               heap_get_best_class(heap, size) :
+               alloc_class_by_id(heap_alloc_classes(heap),
+                       (uint8_t)class_id);
+
+       if (c == NULL) {
+               ERR("no allocation class for size %lu bytes", size);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * The caller provided size in bytes, but buckets operate in
+        * 'size indexes' which are multiples of the block size in the
+        * bucket.
+        *
+        * For example, to allocate 500 bytes from a bucket that
+        * provides 256 byte blocks two memory 'units' are required.
+        */
+       ssize_t size_idx = alloc_class_calc_size_idx(c, size);
+       if (size_idx < 0) {
+               ERR("allocation class not suitable for size %lu bytes",
+                       size);
+               errno = EINVAL;
+               return -1;
+       }
+       ASSERT(size_idx <= UINT32_MAX);
+       *new_block = MEMORY_BLOCK_NONE;
+       new_block->size_idx = (uint32_t)size_idx;
+
+       struct bucket *b = heap_bucket_acquire(heap, c->id, arena_id);
+
+       err = heap_get_bestfit_block(heap, b, new_block);
+       if (err != 0)
+               goto out;
+
+       if (alloc_prep_block(heap, new_block, constructor, arg,
+               extra_field, object_flags, out) != 0) {
+               /*
+                * Constructor returned non-zero value which means
+                * the memory block reservation has to be rolled back.
+                */
+               if (new_block->type == MEMORY_BLOCK_HUGE) {
+                       bucket_insert_block(b, new_block);
+               }
+               err = ECANCELED;
+               goto out;
+       }
+
+       /*
+        * Each as of yet unfulfilled reservation needs to be tracked in the
+        * runtime state.
+        * The memory block cannot be put back into the global state unless
+        * there are no active reservations.
+        */
+       if ((out->mresv = b->active_memory_block) != NULL)
+               util_fetch_and_add64(&out->mresv->nresv, 1);
+
+       out->lock = new_block->m_ops->get_lock(new_block);
+       out->new_state = MEMBLOCK_ALLOCATED;
+
+out:
+       heap_bucket_release(heap, b);
+
+       if (err == 0)
+               return 0;
+
+       errno = err;
+       return -1;
+}
+
+/*
+ * palloc_heap_action_exec -- executes a single heap action (alloc, free)
+ */
+static void
+palloc_heap_action_exec(struct palloc_heap *heap,
+       const struct pobj_action_internal *act,
+       struct operation_context *ctx)
+{
+#ifdef DEBUG
+       if (act->m.m_ops->get_state(&act->m) == act->new_state) {
+               ERR("invalid operation or heap corruption");
+               ASSERT(0);
+       }
+#endif /* DEBUG */
+
+       /*
+        * The actual required metadata modifications are chunk-type
+        * dependent, but it always is a modification of a single 8 byte
+        * value - either modification of few bits in a bitmap or
+        * changing a chunk type from free to used or vice versa.
+        */
+       act->m.m_ops->prep_hdr(&act->m, act->new_state, ctx);
+}
+
+/*
+ * palloc_restore_free_chunk_state -- updates the runtime state of a free chunk.
+ *
+ * This function also takes care of coalescing of huge chunks.
+ */
+static void
+palloc_restore_free_chunk_state(struct palloc_heap *heap,
+       struct memory_block *m)
+{
+       if (m->type == MEMORY_BLOCK_HUGE) {
+               struct bucket *b = heap_bucket_acquire(heap,
+                       DEFAULT_ALLOC_CLASS_ID,
+                       HEAP_ARENA_PER_THREAD);
+               if (heap_free_chunk_reuse(heap, b, m) != 0) {
+                       if (errno == EEXIST) {
+                               FATAL(
+                                       "duplicate runtime chunk state, possible double free");
+                       } else {
+                               LOG(2, "unable to track runtime chunk state");
+                       }
+               }
+               heap_bucket_release(heap, b);
+       }
+}
+
+/*
+ * palloc_mem_action_noop -- empty handler for unused memory action funcs
+ */
+static void
+palloc_mem_action_noop(struct palloc_heap *heap,
+       struct pobj_action_internal *act)
+{
+
+}
+
+/*
+ * palloc_reservation_clear -- clears the reservation state of the block,
+ *     discards the associated memory block if possible
+ */
+static void
+palloc_reservation_clear(struct palloc_heap *heap,
+       struct pobj_action_internal *act, int publish)
+{
+       if (act->mresv == NULL)
+               return;
+
+       struct memory_block_reserved *mresv = act->mresv;
+       struct bucket *b = mresv->bucket;
+
+       if (!publish) {
+               util_mutex_lock(&b->lock);
+               struct memory_block *am = &b->active_memory_block->m;
+
+               /*
+                * If a memory block used for the action is the currently active
+                * memory block of the bucket it can be inserted back to the
+                * bucket. This way it will be available for future allocation
+                * requests, improving performance.
+                */
+               if (b->is_active &&
+                   am->chunk_id == act->m.chunk_id &&
+                   am->zone_id == act->m.zone_id) {
+                       ASSERTeq(b->active_memory_block, mresv);
+                       bucket_insert_block(b, &act->m);
+               }
+
+               util_mutex_unlock(&b->lock);
+       }
+
+       if (util_fetch_and_sub64(&mresv->nresv, 1) == 1) {
+               VALGRIND_ANNOTATE_HAPPENS_AFTER(&mresv->nresv);
+               /*
+                * If the memory block used for the action is not currently used
+                * in any bucket nor action it can be discarded (given back to
+                * the heap).
+                */
+               heap_discard_run(heap, &mresv->m);
+               Free(mresv);
+       } else {
+               VALGRIND_ANNOTATE_HAPPENS_BEFORE(&mresv->nresv);
+       }
+}
+
+/*
+ * palloc_heap_action_on_cancel -- restores the state of the heap
+ */
+static void
+palloc_heap_action_on_cancel(struct palloc_heap *heap,
+       struct pobj_action_internal *act)
+{
+       if (act->new_state == MEMBLOCK_FREE)
+               return;
+
+       VALGRIND_DO_MEMPOOL_FREE(heap->layout,
+               act->m.m_ops->get_user_data(&act->m));
+
+       act->m.m_ops->invalidate(&act->m);
+       palloc_restore_free_chunk_state(heap, &act->m);
+
+       palloc_reservation_clear(heap, act, 0 /* publish */);
+}
+
+/*
+ * palloc_heap_action_on_process -- performs finalization steps under a lock
+ *     on the persistent state
+ */
+static void
+palloc_heap_action_on_process(struct palloc_heap *heap,
+       struct pobj_action_internal *act)
+{
+       if (act->new_state == MEMBLOCK_ALLOCATED) {
+               STATS_INC(heap->stats, persistent, heap_curr_allocated,
+                       act->m.m_ops->get_real_size(&act->m));
+               if (act->m.type == MEMORY_BLOCK_RUN) {
+                       STATS_INC(heap->stats, transient, heap_run_allocated,
+                               act->m.m_ops->get_real_size(&act->m));
+               }
+       } else if (act->new_state == MEMBLOCK_FREE) {
+               if (On_memcheck) {
+                       void *ptr = act->m.m_ops->get_user_data(&act->m);
+                       VALGRIND_DO_MEMPOOL_FREE(heap->layout, ptr);
+               } else if (On_pmemcheck) {
+                       /*
+                        * The sync module, responsible for implementations of
+                        * persistent memory resident volatile variables,
+                        * de-registers the pmemcheck pmem mapping at the time
+                        * of initialization. This is done so that usage of
+                        * pmem locks is not reported as an error due to
+                        * missing flushes/stores outside of transaction. But,
+                        * after we freed an object, we need to reestablish
+                        * the pmem mapping, otherwise pmemchek might miss bugs
+                        * that occur in newly allocated memory locations, that
+                        * once were occupied by a lock/volatile variable.
+                        */
+                       void *ptr = act->m.m_ops->get_user_data(&act->m);
+                       size_t size = act->m.m_ops->get_real_size(&act->m);
+                       VALGRIND_REGISTER_PMEM_MAPPING(ptr, size);
+               }
+
+               STATS_SUB(heap->stats, persistent, heap_curr_allocated,
+                       act->m.m_ops->get_real_size(&act->m));
+               if (act->m.type == MEMORY_BLOCK_RUN) {
+                       STATS_SUB(heap->stats, transient, heap_run_allocated,
+                               act->m.m_ops->get_real_size(&act->m));
+               }
+               heap_memblock_on_free(heap, &act->m);
+       }
+}
+
+/*
+ * palloc_heap_action_on_unlock -- performs finalization steps that need to be
+ *     performed without a lock on persistent state
+ */
+static void
+palloc_heap_action_on_unlock(struct palloc_heap *heap,
+       struct pobj_action_internal *act)
+{
+       if (act->new_state == MEMBLOCK_ALLOCATED) {
+               palloc_reservation_clear(heap, act, 1 /* publish */);
+       } else if (act->new_state == MEMBLOCK_FREE) {
+               palloc_restore_free_chunk_state(heap, &act->m);
+       }
+}
+
+/*
+ * palloc_mem_action_exec -- executes a single memory action (set, and, or)
+ */
+static void
+palloc_mem_action_exec(struct palloc_heap *heap,
+       const struct pobj_action_internal *act,
+       struct operation_context *ctx)
+{
+       operation_add_entry(ctx, act->ptr, act->value, ULOG_OPERATION_SET);
+}
+
+static const struct {
+       /*
+        * Translate action into some number of operation_entry'ies.
+        */
+       void (*exec)(struct palloc_heap *heap,
+               const struct pobj_action_internal *act,
+               struct operation_context *ctx);
+
+       /*
+        * Cancel any runtime state changes. Can be called only when action has
+        * not been translated to persistent operation yet.
+        */
+       void (*on_cancel)(struct palloc_heap *heap,
+               struct pobj_action_internal *act);
+
+       /*
+        * Final steps after persistent state has been modified. Performed
+        * under action-specific lock.
+        */
+       void (*on_process)(struct palloc_heap *heap,
+               struct pobj_action_internal *act);
+
+       /*
+        * Final steps after persistent state has been modified. Performed
+        * after action-specific lock has been dropped.
+        */
+       void (*on_unlock)(struct palloc_heap *heap,
+               struct pobj_action_internal *act);
+} action_funcs[POBJ_MAX_ACTION_TYPE] = {
+       [POBJ_ACTION_TYPE_HEAP] = {
+               .exec = palloc_heap_action_exec,
+               .on_cancel = palloc_heap_action_on_cancel,
+               .on_process = palloc_heap_action_on_process,
+               .on_unlock = palloc_heap_action_on_unlock,
+       },
+       [POBJ_ACTION_TYPE_MEM] = {
+               .exec = palloc_mem_action_exec,
+               .on_cancel = palloc_mem_action_noop,
+               .on_process = palloc_mem_action_noop,
+               .on_unlock = palloc_mem_action_noop,
+       }
+};
+
+/*
+ * palloc_action_compare -- compares two actions based on lock address
+ */
+static int
+palloc_action_compare(const void *lhs, const void *rhs)
+{
+       const struct pobj_action_internal *mlhs = lhs;
+       const struct pobj_action_internal *mrhs = rhs;
+       uintptr_t vlhs = (uintptr_t)(mlhs->lock);
+       uintptr_t vrhs = (uintptr_t)(mrhs->lock);
+
+       if (vlhs < vrhs)
+               return -1;
+       if (vlhs > vrhs)
+               return 1;
+
+       return 0;
+}
+
+/*
+ * palloc_exec_actions -- perform the provided free/alloc operations
+ */
+static void
+palloc_exec_actions(struct palloc_heap *heap,
+       struct operation_context *ctx,
+       struct pobj_action_internal *actv,
+       size_t actvcnt)
+{
+       /*
+        * The operations array is sorted so that proper lock ordering is
+        * ensured.
+        */
+       if (actv) {
+               qsort(actv, actvcnt, sizeof(struct pobj_action_internal),
+                       palloc_action_compare);
+       } else {
+               ASSERTeq(actvcnt, 0);
+       }
+
+       struct pobj_action_internal *act;
+       for (size_t i = 0; i < actvcnt; ++i) {
+               act = &actv[i];
+
+               /*
+                * This lock must be held for the duration between the creation
+                * of the allocation metadata updates in the operation context
+                * and the operation processing. This is because a different
+                * thread might operate on the same 8-byte value of the run
+                * bitmap and override allocation performed by this thread.
+                */
+               if (i == 0 || act->lock != actv[i - 1].lock) {
+                       if (act->lock)
+                               util_mutex_lock(act->lock);
+               }
+
+               /* translate action to some number of operation_entry'ies */
+               action_funcs[act->type].exec(heap, act, ctx);
+       }
+
+       /* wait for all allocated object headers to be persistent */
+       pmemops_drain(&heap->p_ops);
+
+       /* perform all persistent memory operations */
+       operation_process(ctx);
+
+       for (size_t i = 0; i < actvcnt; ++i) {
+               act = &actv[i];
+
+               action_funcs[act->type].on_process(heap, act);
+
+               if (i == actvcnt - 1 || act->lock != actv[i + 1].lock) {
+                       if (act->lock)
+                               util_mutex_unlock(act->lock);
+               }
+       }
+
+       for (size_t i = 0; i < actvcnt; ++i) {
+               act = &actv[i];
+
+               action_funcs[act->type].on_unlock(heap, act);
+       }
+
+       operation_finish(ctx, 0);
+}
+
+/*
+ * palloc_reserve -- creates a single reservation
+ */
+int
+palloc_reserve(struct palloc_heap *heap, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       uint16_t class_id, uint16_t arena_id,
+       struct pobj_action *act)
+{
+       COMPILE_ERROR_ON(sizeof(struct pobj_action) !=
+               sizeof(struct pobj_action_internal));
+
+       return palloc_reservation_create(heap, size, constructor, arg,
+               extra_field, object_flags, class_id, arena_id,
+               (struct pobj_action_internal *)act);
+}
+
+/*
+ * palloc_defer_free -- creates an internal deferred free action
+ */
+static void
+palloc_defer_free_create(struct palloc_heap *heap, uint64_t off,
+       struct pobj_action_internal *out)
+{
+       COMPILE_ERROR_ON(sizeof(struct pobj_action) !=
+               sizeof(struct pobj_action_internal));
+
+       out->type = POBJ_ACTION_TYPE_HEAP;
+       out->offset = off;
+       out->m = memblock_from_offset(heap, off);
+
+       /*
+        * For the duration of free we may need to protect surrounding
+        * metadata from being modified.
+        */
+       out->lock = out->m.m_ops->get_lock(&out->m);
+       out->mresv = NULL;
+       out->new_state = MEMBLOCK_FREE;
+}
+
+/*
+ * palloc_defer_free -- creates a deferred free action
+ */
+void
+palloc_defer_free(struct palloc_heap *heap, uint64_t off,
+       struct pobj_action *act)
+{
+       COMPILE_ERROR_ON(sizeof(struct pobj_action) !=
+               sizeof(struct pobj_action_internal));
+
+       palloc_defer_free_create(heap, off, (struct pobj_action_internal *)act);
+}
+
+/*
+ * palloc_cancel -- cancels all reservations in the array
+ */
+void
+palloc_cancel(struct palloc_heap *heap,
+       struct pobj_action *actv, size_t actvcnt)
+{
+       struct pobj_action_internal *act;
+       for (size_t i = 0; i < actvcnt; ++i) {
+               act = (struct pobj_action_internal *)&actv[i];
+               action_funcs[act->type].on_cancel(heap, act);
+       }
+}
+
+/*
+ * palloc_publish -- publishes all reservations in the array
+ */
+void
+palloc_publish(struct palloc_heap *heap,
+       struct pobj_action *actv, size_t actvcnt,
+       struct operation_context *ctx)
+{
+       palloc_exec_actions(heap, ctx,
+               (struct pobj_action_internal *)actv, actvcnt);
+}
+
+/*
+ * palloc_operation -- persistent memory operation. Takes a NULL pointer
+ *     or an existing memory block and modifies it to occupy, at least, 'size'
+ *     number of bytes.
+ *
+ * The malloc, free and realloc routines are implemented in the context of this
+ * common operation which encompasses all of the functionality usually done
+ * separately in those methods.
+ *
+ * The first thing that needs to be done is determining which memory blocks
+ * will be affected by the operation - this varies depending on the whether the
+ * operation will need to modify or free an existing block and/or allocate
+ * a new one.
+ *
+ * Simplified allocation process flow is as follows:
+ *     - reserve a new block in the transient heap
+ *     - prepare the new block
+ *     - create redo log of required modifications
+ *             - chunk metadata
+ *             - offset of the new object
+ *     - commit and process the redo log
+ *
+ * And similarly, the deallocation process:
+ *     - create redo log of required modifications
+ *             - reverse the chunk metadata back to the 'free' state
+ *             - set the destination of the object offset to zero
+ *     - commit and process the redo log
+ * There's an important distinction in the deallocation process - it does not
+ * return the memory block to the transient container. That is done once no more
+ * memory is available.
+ *
+ * Reallocation is a combination of the above, with one additional step
+ * of copying the old content.
+ */
+int
+palloc_operation(struct palloc_heap *heap,
+       uint64_t off, uint64_t *dest_off, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       uint16_t class_id, uint16_t arena_id,
+       struct operation_context *ctx)
+{
+       size_t user_size = 0;
+
+       size_t nops = 0;
+       struct pobj_action_internal ops[2];
+       struct pobj_action_internal *alloc = NULL;
+       struct pobj_action_internal *dealloc = NULL;
+
+       /*
+        * The offset of an existing block can be nonzero which means this
+        * operation is either free or a realloc - either way the offset of the
+        * object needs to be translated into memory block, which is a structure
+        * that all of the heap methods expect.
+        */
+       if (off != 0) {
+               dealloc = &ops[nops++];
+               palloc_defer_free_create(heap, off, dealloc);
+               user_size = dealloc->m.m_ops->get_user_size(&dealloc->m);
+               if (user_size == size) {
+                       operation_cancel(ctx);
+                       return 0;
+               }
+       }
+
+       /* alloc or realloc */
+       if (size != 0) {
+               alloc = &ops[nops++];
+               if (palloc_reservation_create(heap, size, constructor, arg,
+                       extra_field, object_flags,
+                       class_id, arena_id, alloc) != 0) {
+                       operation_cancel(ctx);
+                       return -1;
+               }
+       }
+
+       /* realloc */
+       if (alloc != NULL && dealloc != NULL) {
+               /* copy data to newly allocated memory */
+               size_t old_size = user_size;
+               size_t to_cpy = old_size > size ? size : old_size;
+               VALGRIND_ADD_TO_TX(
+                       HEAP_OFF_TO_PTR(heap, alloc->offset),
+                       to_cpy);
+               pmemops_memcpy(&heap->p_ops,
+                       HEAP_OFF_TO_PTR(heap, alloc->offset),
+                       HEAP_OFF_TO_PTR(heap, off),
+                       to_cpy,
+                       0);
+               VALGRIND_REMOVE_FROM_TX(
+                       HEAP_OFF_TO_PTR(heap, alloc->offset),
+                       to_cpy);
+       }
+
+       /*
+        * If the caller provided a destination value to update, it needs to be
+        * modified atomically alongside the heap metadata, and so the operation
+        * context must be used.
+        */
+       if (dest_off) {
+               operation_add_entry(ctx, dest_off,
+                       alloc ? alloc->offset : 0, ULOG_OPERATION_SET);
+       }
+
+       /* and now actually perform the requested operation! */
+       palloc_exec_actions(heap, ctx, ops, nops);
+
+       return 0;
+}
+
+/*
+ * palloc_offset_compare -- (internal) comparator for sorting by the offset of
+ *     an object.
+ */
+static int
+palloc_offset_compare(const void *lhs, const void *rhs)
+{
+       const uint64_t * const * mlhs = lhs;
+       const uint64_t * const * mrhs = rhs;
+       uintptr_t vlhs = **mlhs;
+       uintptr_t vrhs = **mrhs;
+
+       if (vlhs < vrhs)
+               return 1;
+       if (vlhs > vrhs)
+               return -1;
+
+       return 0;
+}
+
+struct palloc_defrag_entry {
+       uint64_t **offsetp;
+};
+
+/*
+ * palloc_pointer_compare -- (internal) comparator for sorting by the
+ *     pointer of an offset in the tree.
+ */
+static int
+palloc_pointer_compare(const void *lhs, const void *rhs)
+{
+       const struct palloc_defrag_entry *mlhs = lhs;
+       const struct palloc_defrag_entry *mrhs = rhs;
+       uintptr_t vlhs = (uintptr_t)*mlhs->offsetp;
+       uintptr_t vrhs = (uintptr_t)*mrhs->offsetp;
+
+       if (vlhs > vrhs)
+               return 1;
+       if (vlhs < vrhs)
+               return -1;
+
+       return 0;
+}
+
+VEC(pobj_actions, struct pobj_action);
+
+/*
+ * pobj_actions_add -- add a new action to the end of the vector and return
+ *      its slot. Vector must be able to hold the new value. Reallocation is
+ *      forbidden.
+ */
+static struct pobj_action *
+pobj_actions_add(struct pobj_actions *actv)
+{
+       /*
+        * This shouldn't happen unless there's a bug in the calculation
+        * of the maximum number of actions.
+        */
+       if (VEC_SIZE(actv) == VEC_CAPACITY(actv))
+               abort();
+
+       actv->size++;
+
+       return &VEC_BACK(actv);
+}
+
+/*
+ * palloc_defrag -- forces recycling of all available memory, and reallocates
+ *     provided objects so that they have the lowest possible address.
+ */
+int
+palloc_defrag(struct palloc_heap *heap, uint64_t **objv, size_t objcnt,
+       struct operation_context *ctx, struct pobj_defrag_result *result)
+{
+       int ret = -1;
+       /*
+        * Offsets pointers need to be sorted by the offset of the object in
+        * descending order. This gives us two things, a) the defragmentation
+        * process is more likely to move objects to a lower offset, improving
+        * locality and tentatively enabling the heap to shrink, and b) pointers
+        * to the same object are next to each other in the array, so it's easy
+        * to reallocate the object once and simply update all remaining
+        * pointers.
+        */
+       qsort(objv, objcnt, sizeof(uint64_t *), palloc_offset_compare);
+
+       /*
+        * We also need to store pointers to objects in a tree, so that it's
+        * possible to update pointers to other objects on the provided list
+        * that reside in the objects that were already reallocated or
+        * will be reallocated later on in the process.
+        */
+       struct ravl *objvp = ravl_new_sized(palloc_pointer_compare,
+               sizeof(struct palloc_defrag_entry));
+       if (objvp == NULL)
+               goto err_ravl;
+
+       /*
+        * We need to calculate how many pointers to the same object we will
+        * need to update during defrag. This will be used to calculate capacity
+        * for the action vector and the redo log.
+        */
+       size_t longest_object_sequence = 1;
+       size_t current_object_sequence = 1;
+       for (size_t i = 0; i < objcnt; ++i) {
+               if (i != 0 && *objv[i - 1] == *objv[i]) {
+                       current_object_sequence += 1;
+               } else {
+                       if (current_object_sequence > longest_object_sequence)
+                               longest_object_sequence =
+                                       current_object_sequence;
+                       current_object_sequence = 1;
+               }
+
+               struct palloc_defrag_entry e = {&objv[i]};
+               if (ravl_emplace_copy(objvp, &e) != 0)
+                       goto err_objvp;
+       }
+
+       if (current_object_sequence > longest_object_sequence)
+               longest_object_sequence = current_object_sequence;
+
+       heap_force_recycle(heap);
+
+       /*
+        * The number of actions at which the action vector will be processed.
+        */
+       const size_t actions_per_realloc = 3; /* alloc + free + set */
+       const size_t max_actions =
+               LANE_REDO_EXTERNAL_SIZE / sizeof(struct ulog_entry_val)
+               - actions_per_realloc;
+
+       struct pobj_actions actv;
+       VEC_INIT(&actv);
+
+       /*
+        * Vector needs enough capacity to handle the largest
+        * possible sequence of actions. Given that the actions are published
+        * once the max_actions threshold is crossed AND the sequence for the
+        * current object is finished, worst-case capacity is a sum of
+        * max_actions and the largest object sequence - because that sequence
+        * might happen to begin when current object number i == max_action.
+        */
+       size_t actv_required_capacity =
+               max_actions + longest_object_sequence + actions_per_realloc;
+
+       if (VEC_RESERVE(&actv, actv_required_capacity) != 0)
+               goto err;
+
+       /*
+        * Do NOT reallocate action vector after this line, because
+        * prev_reserve can point to the slot in the original vector.
+        */
+
+       struct pobj_action *prev_reserve = NULL;
+       uint64_t prev_offset = 0;
+       for (size_t i = 0; i < objcnt; ++i) {
+               uint64_t *offsetp = objv[i];
+               uint64_t offset = *offsetp;
+
+               /*
+                * We want to keep our redo logs relatively small, and so
+                * actions vector is processed on a regular basis.
+                */
+               if (prev_offset != offset && VEC_SIZE(&actv) >= max_actions) {
+                       /*
+                        * If there are any pointers on the tree to the
+                        * memory actions that are being applied, they need to
+                        * be removed. Future reallocations will already have
+                        * these modifications applied.
+                        */
+                       struct pobj_action *iter;
+                       VEC_FOREACH_BY_PTR(iter, &actv) {
+                               if (iter->type != POBJ_ACTION_TYPE_MEM)
+                                       continue;
+                               struct pobj_action_internal *iteri =
+                                       (struct pobj_action_internal *)iter;
+                               struct palloc_defrag_entry e = {&iteri->ptr};
+                               struct ravl_node *n = ravl_find(objvp, &e,
+                                       RAVL_PREDICATE_EQUAL);
+                               if (n != NULL)
+                                       ravl_remove(objvp, n);
+                       }
+
+                       size_t entries_size =
+                               VEC_SIZE(&actv) * sizeof(struct ulog_entry_val);
+                       if (operation_reserve(ctx, entries_size) != 0)
+                               goto err;
+
+                       palloc_publish(heap, VEC_ARR(&actv), VEC_SIZE(&actv),
+                               ctx);
+
+                       operation_start(ctx);
+                       VEC_CLEAR(&actv);
+               }
+
+               /*
+                * If the previous pointer of this offset was skipped,
+                * skip all pointers for that object.
+                */
+               if (prev_reserve == NULL && prev_offset == offset)
+                       continue;
+
+               /*
+                * If this is an offset to an object that was already
+                * reallocated in the previous iteration, we need to only update
+                * the pointer to the new offset.
+                */
+               if (prev_reserve && prev_offset == offset) {
+                       struct pobj_action *set = pobj_actions_add(&actv);
+
+                       palloc_set_value(heap, set,
+                               offsetp, prev_reserve->heap.offset);
+                       struct pobj_action_internal *seti =
+                               (struct pobj_action_internal *)set;
+
+                       /*
+                        * Since this pointer can reside in an object that will
+                        * be reallocated later on we need to be able to
+                        * find and update it when that happens.
+                        */
+                       struct palloc_defrag_entry e = {&seti->ptr};
+                       struct ravl_node *n = ravl_find(objvp, &e,
+                               RAVL_PREDICATE_EQUAL);
+                       if (n != NULL)
+                               ravl_remove(objvp, n);
+                       /*
+                        * Notice that the tree is ordered by the content of the
+                        * pointer, not the pointer itself. This might look odd,
+                        * but we are inserting a *different* pointer to the
+                        * same pointer to an offset.
+                        */
+                       if (ravl_emplace_copy(objvp, &e) != 0)
+                               goto err;
+
+                       continue;
+               }
+
+               if (result)
+                       result->total++;
+
+               prev_reserve = NULL;
+               prev_offset = offset;
+
+               struct memory_block m = memblock_from_offset(heap, offset);
+
+               if (m.type == MEMORY_BLOCK_HUGE)
+                       continue;
+
+               os_mutex_t *mlock = m.m_ops->get_lock(&m);
+               os_mutex_lock(mlock);
+               unsigned original_fillpct = m.m_ops->fill_pct(&m);
+               os_mutex_unlock(mlock);
+
+               /*
+                * Empirically, 50% fill rate is the sweetspot for moving
+                * objects between runs. Other values tend to produce worse
+                * results.
+                */
+               if (original_fillpct > 50)
+                       continue;
+
+               size_t user_size = m.m_ops->get_user_size(&m);
+
+               struct pobj_action *reserve = pobj_actions_add(&actv);
+
+               if (palloc_reservation_create(heap, user_size,
+                   NULL, NULL,
+                   m.m_ops->get_extra(&m), m.m_ops->get_flags(&m),
+                   0, HEAP_ARENA_PER_THREAD,
+                   (struct pobj_action_internal *)reserve) != 0) {
+                       VEC_POP_BACK(&actv);
+                       continue;
+               }
+
+               uint64_t new_offset = reserve->heap.offset;
+
+               VALGRIND_ADD_TO_TX(
+                       HEAP_OFF_TO_PTR(heap, new_offset),
+                       user_size);
+               pmemops_memcpy(&heap->p_ops,
+                       HEAP_OFF_TO_PTR(heap, new_offset),
+                       HEAP_OFF_TO_PTR(heap, *offsetp),
+                       user_size,
+                       0);
+               VALGRIND_REMOVE_FROM_TX(
+                       HEAP_OFF_TO_PTR(heap, new_offset),
+                       user_size);
+
+               /*
+                * If there is a pointer provided by the user inside of the
+                * object we are in the process of reallocating, we need to
+                * find that pointer and update it to reflect the new location
+                * of PMEMoid.
+                */
+               ptrdiff_t diff = (ptrdiff_t)(new_offset - offset);
+               uint64_t *objptr = (uint64_t *)((uint64_t)heap->base + offset);
+               uint64_t objend = ((uint64_t)objptr + user_size);
+               struct ravl_node *nptr = NULL;
+               enum ravl_predicate p = RAVL_PREDICATE_GREATER_EQUAL;
+               struct palloc_defrag_entry search_entry = {&objptr};
+
+               while ((nptr = ravl_find(objvp, &search_entry, p)) != NULL) {
+                       p = RAVL_PREDICATE_GREATER;
+                       struct palloc_defrag_entry *e = ravl_data(nptr);
+                       uint64_t poffset = (uint64_t)(*e->offsetp);
+
+                       if (poffset >= objend)
+                               break;
+
+                       struct palloc_defrag_entry ne = *e;
+                       ravl_remove(objvp, nptr);
+
+                       objptr = (uint64_t *)poffset;
+
+                       poffset = (uint64_t)((ptrdiff_t)poffset + diff);
+
+                       *ne.offsetp = (uint64_t *)poffset;
+               }
+               offsetp = objv[i];
+
+               struct pobj_action *set = pobj_actions_add(&actv);
+
+               /*
+                * We need to change the pointer in the tree to the pointer
+                * of this new unpublished action, so that it can be updated
+                * later on if needed.
+                */
+               palloc_set_value(heap, set, offsetp, new_offset);
+               struct pobj_action_internal *seti =
+                       (struct pobj_action_internal *)set;
+               struct palloc_defrag_entry e = {&seti->ptr};
+               struct ravl_node *n = ravl_find(objvp, &e,
+                       RAVL_PREDICATE_EQUAL);
+               if (n != NULL)
+                       ravl_remove(objvp, n);
+
+               /* same as above, this is a different pointer to same content */
+               if (ravl_emplace_copy(objvp, &e) != 0)
+                       goto err;
+
+               struct pobj_action *dfree = pobj_actions_add(&actv);
+
+               palloc_defer_free(heap, offset, dfree);
+
+               if (result)
+                       result->relocated++;
+
+               prev_reserve = reserve;
+               prev_offset = offset;
+       }
+
+       if (VEC_SIZE(&actv) != 0) {
+               size_t entries_size =
+                       VEC_SIZE(&actv) * sizeof(struct ulog_entry_val);
+               if (operation_reserve(ctx, entries_size) != 0)
+                       goto err;
+               palloc_publish(heap, VEC_ARR(&actv), VEC_SIZE(&actv), ctx);
+       } else {
+               operation_cancel(ctx);
+       }
+
+       ret = 0;
+
+err:
+       if (ret != 0)
+               palloc_cancel(heap, VEC_ARR(&actv), VEC_SIZE(&actv));
+       VEC_DELETE(&actv);
+err_objvp:
+       ravl_delete(objvp);
+err_ravl:
+       if (ret != 0)
+               operation_cancel(ctx);
+
+       return ret;
+}
+
+/*
+ * palloc_usable_size -- returns the number of bytes in the memory block
+ */
+size_t
+palloc_usable_size(struct palloc_heap *heap, uint64_t off)
+{
+       struct memory_block m = memblock_from_offset(heap, off);
+
+       return m.m_ops->get_user_size(&m);
+}
+
+/*
+ * palloc_extra -- returns allocation extra field
+ */
+uint64_t
+palloc_extra(struct palloc_heap *heap, uint64_t off)
+{
+       struct memory_block m = memblock_from_offset(heap, off);
+
+       return m.m_ops->get_extra(&m);
+}
+
+/*
+ * palloc_flags -- returns allocation flags
+ */
+uint16_t
+palloc_flags(struct palloc_heap *heap, uint64_t off)
+{
+       struct memory_block m = memblock_from_offset(heap, off);
+
+       return m.m_ops->get_flags(&m);
+}
+
+/*
+ * pmalloc_search_cb -- (internal) foreach callback.
+ */
+static int
+pmalloc_search_cb(const struct memory_block *m, void *arg)
+{
+       struct memory_block *out = arg;
+
+       if (MEMORY_BLOCK_EQUALS(*m, *out))
+               return 0; /* skip the same object */
+
+       *out = *m;
+
+       return 1;
+}
+
+/*
+ * palloc_first -- returns the first object from the heap.
+ */
+uint64_t
+palloc_first(struct palloc_heap *heap)
+{
+       struct memory_block search = MEMORY_BLOCK_NONE;
+
+       heap_foreach_object(heap, pmalloc_search_cb,
+               &search, MEMORY_BLOCK_NONE);
+
+       if (MEMORY_BLOCK_IS_NONE(search))
+               return 0;
+
+       void *uptr = search.m_ops->get_user_data(&search);
+
+       return HEAP_PTR_TO_OFF(heap, uptr);
+}
+
+/*
+ * palloc_next -- returns the next object relative to 'off'.
+ */
+uint64_t
+palloc_next(struct palloc_heap *heap, uint64_t off)
+{
+       struct memory_block m = memblock_from_offset(heap, off);
+       struct memory_block search = m;
+
+       heap_foreach_object(heap, pmalloc_search_cb, &search, m);
+
+       if (MEMORY_BLOCK_IS_NONE(search) ||
+               MEMORY_BLOCK_EQUALS(search, m))
+               return 0;
+
+       void *uptr = search.m_ops->get_user_data(&search);
+
+       return HEAP_PTR_TO_OFF(heap, uptr);
+}
+
+/*
+ * palloc_boot -- initializes allocator section
+ */
+int
+palloc_boot(struct palloc_heap *heap, void *heap_start,
+               uint64_t heap_size, uint64_t *sizep,
+               void *base, struct pmem_ops *p_ops, struct stats *stats,
+               struct pool_set *set)
+{
+       return heap_boot(heap, heap_start, heap_size, sizep,
+               base, p_ops, stats, set);
+}
+
+/*
+ * palloc_buckets_init -- initialize buckets
+ */
+int
+palloc_buckets_init(struct palloc_heap *heap)
+{
+       return heap_buckets_init(heap);
+}
+
+/*
+ * palloc_init -- initializes palloc heap
+ */
+int
+palloc_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
+       struct pmem_ops *p_ops)
+{
+       return heap_init(heap_start, heap_size, sizep, p_ops);
+}
+
+/*
+ * palloc_heap_end -- returns first address after heap
+ */
+void *
+palloc_heap_end(struct palloc_heap *h)
+{
+       return heap_end(h);
+}
+
+/*
+ * palloc_heap_check -- verifies heap state
+ */
+int
+palloc_heap_check(void *heap_start, uint64_t heap_size)
+{
+       return heap_check(heap_start, heap_size);
+}
+
+/*
+ * palloc_heap_check_remote -- verifies state of remote replica
+ */
+int
+palloc_heap_check_remote(void *heap_start, uint64_t heap_size,
+       struct remote_ops *ops)
+{
+       return heap_check_remote(heap_start, heap_size, ops);
+}
+
+/*
+ * palloc_heap_cleanup -- cleanups the volatile heap state
+ */
+void
+palloc_heap_cleanup(struct palloc_heap *heap)
+{
+       heap_cleanup(heap);
+}
+
+#if VG_MEMCHECK_ENABLED
+/*
+ * palloc_vg_register_alloc -- (internal) registers allocation header
+ * in Valgrind
+ */
+static int
+palloc_vg_register_alloc(const struct memory_block *m, void *arg)
+{
+       struct palloc_heap *heap = arg;
+
+       m->m_ops->reinit_header(m);
+
+       void *uptr = m->m_ops->get_user_data(m);
+       size_t usize = m->m_ops->get_user_size(m);
+       VALGRIND_DO_MEMPOOL_ALLOC(heap->layout, uptr, usize);
+       VALGRIND_DO_MAKE_MEM_DEFINED(uptr, usize);
+
+       return 0;
+}
+
+/*
+ * palloc_heap_vg_open -- notifies Valgrind about heap layout
+ */
+void
+palloc_heap_vg_open(struct palloc_heap *heap, int objects)
+{
+       heap_vg_open(heap, palloc_vg_register_alloc, heap, objects);
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/palloc.h b/ceph/src/pmdk/src/libpmemobj/palloc.h
new file mode 100644 (file)
index 0000000..f433cd4
--- /dev/null
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * palloc.h -- internal definitions for persistent allocator
+ */
+
+#ifndef LIBPMEMOBJ_PALLOC_H
+#define LIBPMEMOBJ_PALLOC_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "libpmemobj.h"
+#include "memops.h"
+#include "ulog.h"
+#include "valgrind_internal.h"
+#include "stats.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PALLOC_CTL_DEBUG_NO_PATTERN (-1)
+
+struct palloc_heap {
+       struct pmem_ops p_ops;
+       struct heap_layout *layout;
+       struct heap_rt *rt;
+       uint64_t *sizep;
+       uint64_t growsize;
+
+       struct stats *stats;
+       struct pool_set *set;
+
+       void *base;
+
+       int alloc_pattern;
+};
+
+struct memory_block;
+
+typedef int (*palloc_constr)(void *base, void *ptr,
+               size_t usable_size, void *arg);
+
+int palloc_operation(struct palloc_heap *heap, uint64_t off, uint64_t *dest_off,
+       size_t size, palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       uint16_t class_id, uint16_t arena_id,
+       struct operation_context *ctx);
+
+int
+palloc_reserve(struct palloc_heap *heap, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags,
+       uint16_t class_id, uint16_t arena_id,
+       struct pobj_action *act);
+
+void
+palloc_defer_free(struct palloc_heap *heap, uint64_t off,
+       struct pobj_action *act);
+
+void
+palloc_cancel(struct palloc_heap *heap,
+       struct pobj_action *actv, size_t actvcnt);
+
+void
+palloc_publish(struct palloc_heap *heap,
+       struct pobj_action *actv, size_t actvcnt,
+       struct operation_context *ctx);
+
+void
+palloc_set_value(struct palloc_heap *heap, struct pobj_action *act,
+       uint64_t *ptr, uint64_t value);
+
+uint64_t palloc_first(struct palloc_heap *heap);
+uint64_t palloc_next(struct palloc_heap *heap, uint64_t off);
+
+size_t palloc_usable_size(struct palloc_heap *heap, uint64_t off);
+uint64_t palloc_extra(struct palloc_heap *heap, uint64_t off);
+uint16_t palloc_flags(struct palloc_heap *heap, uint64_t off);
+
+int palloc_boot(struct palloc_heap *heap, void *heap_start,
+               uint64_t heap_size, uint64_t *sizep,
+               void *base, struct pmem_ops *p_ops,
+               struct stats *stats, struct pool_set *set);
+
+int palloc_buckets_init(struct palloc_heap *heap);
+
+int palloc_init(void *heap_start, uint64_t heap_size, uint64_t *sizep,
+       struct pmem_ops *p_ops);
+void *palloc_heap_end(struct palloc_heap *h);
+int palloc_heap_check(void *heap_start, uint64_t heap_size);
+int palloc_heap_check_remote(void *heap_start, uint64_t heap_size,
+       struct remote_ops *ops);
+void palloc_heap_cleanup(struct palloc_heap *heap);
+size_t palloc_heap(void *heap_start);
+
+int palloc_defrag(struct palloc_heap *heap, uint64_t **objv, size_t objcnt,
+       struct operation_context *ctx, struct pobj_defrag_result *result);
+
+/* foreach callback, terminates iteration if return value is non-zero */
+typedef int (*object_callback)(const struct memory_block *m, void *arg);
+
+#if VG_MEMCHECK_ENABLED
+void palloc_heap_vg_open(struct palloc_heap *heap, int objects);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/pmalloc.c b/ceph/src/pmdk/src/libpmemobj/pmalloc.c
new file mode 100644 (file)
index 0000000..aa05231
--- /dev/null
@@ -0,0 +1,797 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * pmalloc.c -- implementation of pmalloc POSIX-like API
+ *
+ * This is the front-end part of the persistent memory allocator. It uses both
+ * transient and persistent representation of the heap to provide memory blocks
+ * in a reasonable time and with an acceptable common-case fragmentation.
+ */
+
+#include <inttypes.h>
+#include "valgrind_internal.h"
+#include "heap.h"
+#include "lane.h"
+#include "memblock.h"
+#include "memops.h"
+#include "obj.h"
+#include "out.h"
+#include "palloc.h"
+#include "pmalloc.h"
+#include "alloc_class.h"
+#include "set.h"
+#include "mmap.h"
+
+enum pmalloc_operation_type {
+       OPERATION_INTERNAL, /* used only for single, one-off operations */
+       OPERATION_EXTERNAL, /* used for everything else, incl. large redos */
+
+       MAX_OPERATION_TYPE,
+};
+
+struct lane_alloc_runtime {
+       struct operation_context *ctx[MAX_OPERATION_TYPE];
+};
+
+/*
+ * pmalloc_operation_hold_type -- acquires allocator lane section and returns a
+ *     pointer to its operation context
+ */
+static struct operation_context *
+pmalloc_operation_hold_type(PMEMobjpool *pop, enum pmalloc_operation_type type,
+       int start)
+{
+       struct lane *lane;
+       lane_hold(pop, &lane);
+       struct operation_context *ctx = type == OPERATION_INTERNAL ?
+               lane->internal : lane->external;
+
+       if (start)
+               operation_start(ctx);
+
+       return ctx;
+}
+
+/*
+ * pmalloc_operation_hold_type -- acquires allocator lane section and returns a
+ *     pointer to its operation context without starting
+ */
+struct operation_context *
+pmalloc_operation_hold_no_start(PMEMobjpool *pop)
+{
+       return pmalloc_operation_hold_type(pop, OPERATION_EXTERNAL, 0);
+}
+
+/*
+ * pmalloc_operation_hold -- acquires allocator lane section and returns a
+ *     pointer to its redo log
+ */
+struct operation_context *
+pmalloc_operation_hold(PMEMobjpool *pop)
+{
+       return pmalloc_operation_hold_type(pop, OPERATION_EXTERNAL, 1);
+}
+
+/*
+ * pmalloc_operation_release -- releases allocator lane section
+ */
+void
+pmalloc_operation_release(PMEMobjpool *pop)
+{
+       lane_release(pop);
+}
+
+/*
+ * pmalloc -- allocates a new block of memory
+ *
+ * The pool offset is written persistently into the off variable.
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+pmalloc(PMEMobjpool *pop, uint64_t *off, size_t size,
+       uint64_t extra_field, uint16_t object_flags)
+{
+       struct operation_context *ctx =
+               pmalloc_operation_hold_type(pop, OPERATION_INTERNAL, 1);
+
+       int ret = palloc_operation(&pop->heap, 0, off, size, NULL, NULL,
+               extra_field, object_flags, 0, 0, ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * pmalloc_construct -- allocates a new block of memory with a constructor
+ *
+ * The block offset is written persistently into the off variable, but only
+ * after the constructor function has been called.
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+pmalloc_construct(PMEMobjpool *pop, uint64_t *off, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags, uint16_t class_id)
+{
+       struct operation_context *ctx =
+               pmalloc_operation_hold_type(pop, OPERATION_INTERNAL, 1);
+
+       int ret = palloc_operation(&pop->heap, 0, off, size, constructor, arg,
+                       extra_field, object_flags, class_id, 0, ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * prealloc -- resizes in-place a previously allocated memory block
+ *
+ * The block offset is written persistently into the off variable.
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+int
+prealloc(PMEMobjpool *pop, uint64_t *off, size_t size,
+       uint64_t extra_field, uint16_t object_flags)
+{
+       struct operation_context *ctx =
+               pmalloc_operation_hold_type(pop, OPERATION_INTERNAL, 1);
+
+       int ret = palloc_operation(&pop->heap, *off, off, size, NULL, NULL,
+               extra_field, object_flags, 0, 0, ctx);
+
+       pmalloc_operation_release(pop);
+
+       return ret;
+}
+
+/*
+ * pfree -- deallocates a memory block previously allocated by pmalloc
+ *
+ * A zero value is written persistently into the off variable.
+ *
+ * If successful function returns zero. Otherwise an error number is returned.
+ */
+void
+pfree(PMEMobjpool *pop, uint64_t *off)
+{
+       struct operation_context *ctx =
+               pmalloc_operation_hold_type(pop, OPERATION_INTERNAL, 1);
+
+       int ret = palloc_operation(&pop->heap, *off, off, 0, NULL, NULL,
+               0, 0, 0, 0, ctx);
+       ASSERTeq(ret, 0);
+
+       pmalloc_operation_release(pop);
+}
+
+/*
+ * pmalloc_boot -- global runtime init routine of allocator section
+ */
+int
+pmalloc_boot(PMEMobjpool *pop)
+{
+       int ret = palloc_boot(&pop->heap, (char *)pop + pop->heap_offset,
+                       pop->set->poolsize - pop->heap_offset, &pop->heap_size,
+                       pop, &pop->p_ops,
+                       pop->stats, pop->set);
+       if (ret)
+               return ret;
+
+#if VG_MEMCHECK_ENABLED
+       if (On_memcheck)
+               palloc_heap_vg_open(&pop->heap, pop->vg_boot);
+#endif
+
+       ret = palloc_buckets_init(&pop->heap);
+       if (ret)
+               palloc_heap_cleanup(&pop->heap);
+
+       return ret;
+}
+
+/*
+ * pmalloc_cleanup -- global cleanup routine of allocator section
+ */
+int
+pmalloc_cleanup(PMEMobjpool *pop)
+{
+       palloc_heap_cleanup(&pop->heap);
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(desc) -- creates a new allocation class
+ */
+static int
+CTL_WRITE_HANDLER(desc)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       uint8_t id;
+       struct alloc_class_collection *ac = heap_alloc_classes(&pop->heap);
+       struct pobj_alloc_class_desc *p = arg;
+
+       if (p->unit_size <= 0 || p->unit_size > PMEMOBJ_MAX_ALLOC_SIZE ||
+               p->units_per_block <= 0) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (p->alignment != 0 && p->unit_size % p->alignment != 0) {
+               ERR("unit size must be evenly divisible by alignment");
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (p->alignment > (MEGABYTE * 2)) {
+               ERR("alignment cannot be larger than 2 megabytes");
+               errno = EINVAL;
+               return -1;
+       }
+
+       enum header_type lib_htype = MAX_HEADER_TYPES;
+       switch (p->header_type) {
+               case POBJ_HEADER_LEGACY:
+                       lib_htype = HEADER_LEGACY;
+                       break;
+               case POBJ_HEADER_COMPACT:
+                       lib_htype = HEADER_COMPACT;
+                       break;
+               case POBJ_HEADER_NONE:
+                       lib_htype = HEADER_NONE;
+                       break;
+               case MAX_POBJ_HEADER_TYPES:
+               default:
+                       ERR("invalid header type");
+                       errno = EINVAL;
+                       return -1;
+       }
+
+       if (PMDK_SLIST_EMPTY(indexes)) {
+               if (alloc_class_find_first_free_slot(ac, &id) != 0) {
+                       ERR("no available free allocation class identifier");
+                       errno = EINVAL;
+                       return -1;
+               }
+       } else {
+               struct ctl_index *idx = PMDK_SLIST_FIRST(indexes);
+               ASSERTeq(strcmp(idx->name, "class_id"), 0);
+
+               if (idx->value < 0 || idx->value >= MAX_ALLOCATION_CLASSES) {
+                       ERR("class id outside of the allowed range");
+                       errno = ERANGE;
+                       return -1;
+               }
+
+               id = (uint8_t)idx->value;
+
+               if (alloc_class_reserve(ac, id) != 0) {
+                       ERR("attempted to overwrite an allocation class");
+                       errno = EEXIST;
+                       return -1;
+               }
+       }
+
+       size_t runsize_bytes =
+               CHUNK_ALIGN_UP((p->units_per_block * p->unit_size) +
+               RUN_BASE_METADATA_SIZE);
+
+       /* aligning the buffer might require up-to to 'alignment' bytes */
+       if (p->alignment != 0)
+               runsize_bytes += p->alignment;
+
+       uint32_t size_idx = (uint32_t)(runsize_bytes / CHUNKSIZE);
+       if (size_idx > UINT16_MAX)
+               size_idx = UINT16_MAX;
+
+       struct alloc_class *c = alloc_class_new(id,
+               heap_alloc_classes(&pop->heap), CLASS_RUN,
+               lib_htype, p->unit_size, p->alignment, size_idx);
+       if (c == NULL) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (heap_create_alloc_class_buckets(&pop->heap, c) != 0) {
+               alloc_class_delete(ac, c);
+               return -1;
+       }
+
+       p->class_id = c->id;
+       p->units_per_block = c->rdsc.nallocs;
+
+       return 0;
+}
+
+/*
+ * pmalloc_header_type_parser -- parses the alloc header type argument
+ */
+static int
+pmalloc_header_type_parser(const void *arg, void *dest, size_t dest_size)
+{
+       const char *vstr = arg;
+       enum pobj_header_type *htype = dest;
+       ASSERTeq(dest_size, sizeof(enum pobj_header_type));
+
+       if (strcmp(vstr, "none") == 0) {
+               *htype = POBJ_HEADER_NONE;
+       } else if (strcmp(vstr, "compact") == 0) {
+               *htype = POBJ_HEADER_COMPACT;
+       } else if (strcmp(vstr, "legacy") == 0) {
+               *htype = POBJ_HEADER_LEGACY;
+       } else {
+               ERR("invalid header type");
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * CTL_READ_HANDLER(desc) -- reads the information about allocation class
+ */
+static int
+CTL_READ_HANDLER(desc)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       uint8_t id;
+
+       struct ctl_index *idx = PMDK_SLIST_FIRST(indexes);
+       ASSERTeq(strcmp(idx->name, "class_id"), 0);
+
+       if (idx->value < 0 || idx->value >= MAX_ALLOCATION_CLASSES) {
+               ERR("class id outside of the allowed range");
+               errno = ERANGE;
+               return -1;
+       }
+
+       id = (uint8_t)idx->value;
+
+       struct alloc_class *c = alloc_class_by_id(
+               heap_alloc_classes(&pop->heap), id);
+
+       if (c == NULL) {
+               ERR("class with the given id does not exist");
+               errno = ENOENT;
+               return -1;
+       }
+
+       enum pobj_header_type user_htype = MAX_POBJ_HEADER_TYPES;
+       switch (c->header_type) {
+               case HEADER_LEGACY:
+                       user_htype = POBJ_HEADER_LEGACY;
+                       break;
+               case HEADER_COMPACT:
+                       user_htype = POBJ_HEADER_COMPACT;
+                       break;
+               case HEADER_NONE:
+                       user_htype = POBJ_HEADER_NONE;
+                       break;
+               default:
+                       ASSERT(0); /* unreachable */
+                       break;
+       }
+
+       struct pobj_alloc_class_desc *p = arg;
+       p->units_per_block = c->type == CLASS_HUGE ? 0 : c->rdsc.nallocs;
+       p->header_type = user_htype;
+       p->unit_size = c->unit_size;
+       p->class_id = c->id;
+       p->alignment = c->flags & CHUNK_FLAG_ALIGNED ? c->rdsc.alignment : 0;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(desc) = {
+       .dest_size = sizeof(struct pobj_alloc_class_desc),
+       .parsers = {
+               CTL_ARG_PARSER_STRUCT(struct pobj_alloc_class_desc,
+                       unit_size, ctl_arg_integer),
+               CTL_ARG_PARSER_STRUCT(struct pobj_alloc_class_desc,
+                       alignment, ctl_arg_integer),
+               CTL_ARG_PARSER_STRUCT(struct pobj_alloc_class_desc,
+                       units_per_block, ctl_arg_integer),
+               CTL_ARG_PARSER_STRUCT(struct pobj_alloc_class_desc,
+                       header_type, pmalloc_header_type_parser),
+               CTL_ARG_PARSER_END
+       }
+};
+
+static const struct ctl_node CTL_NODE(class_id)[] = {
+       CTL_LEAF_RW(desc),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(new)[] = {
+       CTL_LEAF_WO(desc),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(alloc_class)[] = {
+       CTL_INDEXED(class_id),
+       CTL_INDEXED(new),
+
+       CTL_NODE_END
+};
+
+/*
+ * CTL_RUNNABLE_HANDLER(extend) -- extends the pool by the given size
+ */
+static int
+CTL_RUNNABLE_HANDLER(extend)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       ssize_t arg_in = *(ssize_t *)arg;
+       if (arg_in < (ssize_t)PMEMOBJ_MIN_PART) {
+               ERR("incorrect size for extend, must be larger than %" PRIu64,
+                       PMEMOBJ_MIN_PART);
+               return -1;
+       }
+
+       struct palloc_heap *heap = &pop->heap;
+       struct bucket *defb = heap_bucket_acquire(heap,
+               DEFAULT_ALLOC_CLASS_ID,
+               HEAP_ARENA_PER_THREAD);
+
+       int ret = heap_extend(heap, defb, (size_t)arg_in) < 0 ? -1 : 0;
+
+       heap_bucket_release(heap, defb);
+
+       return ret;
+}
+
+/*
+ * CTL_READ_HANDLER(granularity) -- reads the current heap grow size
+ */
+static int
+CTL_READ_HANDLER(granularity)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       ssize_t *arg_out = arg;
+
+       *arg_out = (ssize_t)pop->heap.growsize;
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(granularity) -- changes the heap grow size
+ */
+static int
+CTL_WRITE_HANDLER(granularity)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       ssize_t arg_in = *(int *)arg;
+       if (arg_in != 0 && arg_in < (ssize_t)PMEMOBJ_MIN_PART) {
+               ERR("incorrect grow size, must be 0 or larger than %" PRIu64,
+                       PMEMOBJ_MIN_PART);
+               return -1;
+       }
+
+       pop->heap.growsize = (size_t)arg_in;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(granularity) = CTL_ARG_LONG_LONG;
+
+/*
+ * CTL_READ_HANDLER(total) -- reads a number of the arenas
+ */
+static int
+CTL_READ_HANDLER(total)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned *narenas = arg;
+
+       *narenas = heap_get_narenas_total(&pop->heap);
+
+       return 0;
+}
+
+/*
+ * CTL_READ_HANDLER(max) -- reads a max number of the arenas
+ */
+static int
+CTL_READ_HANDLER(max)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned *max = arg;
+
+       *max = heap_get_narenas_max(&pop->heap);
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(max) -- write a max number of the arenas
+ */
+static int
+CTL_WRITE_HANDLER(max)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned size = *(unsigned *)arg;
+
+       int ret = heap_set_narenas_max(&pop->heap, size);
+       if (ret) {
+               LOG(1, "cannot change max arena number");
+               return -1;
+       }
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(max) = CTL_ARG_LONG_LONG;
+
+/*
+ * CTL_READ_HANDLER(automatic) -- reads a number of the automatic arenas
+ */
+static int
+CTL_READ_HANDLER(automatic, narenas)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned *narenas = arg;
+
+       *narenas = heap_get_narenas_auto(&pop->heap);
+
+       return 0;
+}
+
+/*
+ * CTL_READ_HANDLER(arena_id) -- reads the id of the arena
+ * assigned to the calling thread
+ */
+static int
+CTL_READ_HANDLER(arena_id)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned *arena_id = arg;
+
+       *arena_id = heap_get_thread_arena_id(&pop->heap);
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(arena_id) -- assigns the arena to the calling thread
+ */
+static int
+CTL_WRITE_HANDLER(arena_id)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned arena_id = *(unsigned *)arg;
+
+       unsigned narenas = heap_get_narenas_total(&pop->heap);
+
+       /*
+        * check if index is not bigger than number of arenas
+        * or if it is not equal zero
+        */
+       if (arena_id < 1 || arena_id > narenas) {
+               LOG(1, "arena id outside of the allowed range: <1,%u>",
+                       narenas);
+               errno = ERANGE;
+               return -1;
+       }
+
+       heap_set_arena_thread(&pop->heap, arena_id);
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(arena_id) = CTL_ARG_LONG_LONG;
+
+/*
+ * CTL_WRITE_HANDLER(automatic) -- updates automatic status of the arena
+ */
+static int
+CTL_WRITE_HANDLER(automatic)(void *ctx, enum ctl_query_source source,
+               void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       int arg_in = *(int *)arg;
+       unsigned arena_id;
+
+       struct ctl_index *idx = PMDK_SLIST_FIRST(indexes);
+       ASSERTeq(strcmp(idx->name, "arena_id"), 0);
+       arena_id = (unsigned)idx->value;
+
+       unsigned narenas = heap_get_narenas_total(&pop->heap);
+
+       /*
+        * check if index is not bigger than number of arenas
+        * or if it is not equal zero
+        */
+       if (arena_id < 1 || arena_id > narenas) {
+               LOG(1, "arena id outside of the allowed range: <1,%u>",
+                       narenas);
+               errno = ERANGE;
+               return -1;
+       }
+
+       if (arg_in != 0 && arg_in != 1) {
+               LOG(1, "incorrect arena state, must be 0 or 1");
+               return -1;
+       }
+
+       return heap_set_arena_auto(&pop->heap, arena_id, arg_in);
+}
+
+/*
+ * CTL_READ_HANDLER(automatic) -- reads automatic status of the arena
+ */
+static int
+CTL_READ_HANDLER(automatic)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       int *arg_out = arg;
+       unsigned arena_id;
+
+       struct ctl_index *idx = PMDK_SLIST_FIRST(indexes);
+       ASSERTeq(strcmp(idx->name, "arena_id"), 0);
+       arena_id = (unsigned)idx->value;
+
+       unsigned narenas = heap_get_narenas_total(&pop->heap);
+
+       /*
+        * check if index is not bigger than number of arenas
+        * or if it is not equal zero
+        */
+       if (arena_id < 1 || arena_id > narenas) {
+               LOG(1, "arena id outside of the allowed range: <1,%u>",
+                       narenas);
+               errno = ERANGE;
+               return -1;
+       }
+
+       *arg_out = heap_get_arena_auto(&pop->heap, arena_id);
+
+       return 0;
+}
+
+static struct ctl_argument CTL_ARG(automatic) = CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(size)[] = {
+       CTL_LEAF_RW(granularity),
+       CTL_LEAF_RUNNABLE(extend),
+
+       CTL_NODE_END
+};
+
+/*
+ * CTL_READ_HANDLER(size) -- reads usable size of specified arena
+ */
+static int
+CTL_READ_HANDLER(size)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned arena_id;
+       unsigned narenas;
+       size_t *arena_size = arg;
+
+       struct ctl_index *idx = PMDK_SLIST_FIRST(indexes);
+       ASSERTeq(strcmp(idx->name, "arena_id"), 0);
+
+       /* take index of arena */
+       arena_id = (unsigned)idx->value;
+       /* take number of arenas */
+       narenas = heap_get_narenas_total(&pop->heap);
+
+       /*
+        * check if index is not bigger than number of arenas
+        * or if it is not equal zero
+        */
+       if (arena_id < 1 || arena_id > narenas) {
+               LOG(1, "arena id outside of the allowed range: <1,%u>",
+                       narenas);
+               errno = ERANGE;
+               return -1;
+       }
+
+       /* take buckets for arena */
+       struct bucket **buckets;
+       buckets = heap_get_arena_buckets(&pop->heap, arena_id);
+
+       /* calculate number of reservation for arena using buckets */
+       unsigned size = 0;
+       for (int i = 0; i < MAX_ALLOCATION_CLASSES; ++i) {
+               if (buckets[i] != NULL && buckets[i]->is_active)
+                       size += buckets[i]->active_memory_block->m.size_idx;
+       }
+
+       *arena_size = size * CHUNKSIZE;
+
+       return 0;
+}
+
+/*
+ * CTL_RUNNABLE_HANDLER(create) -- create new arena in the heap
+ */
+static int
+CTL_RUNNABLE_HANDLER(create)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+       unsigned *arena_id = arg;
+       struct palloc_heap *heap = &pop->heap;
+
+       int ret = heap_arena_create(heap);
+       if (ret < 0)
+               return -1;
+
+       *arena_id = (unsigned)ret;
+
+       return 0;
+}
+
+static const struct ctl_node CTL_NODE(arena_id)[] = {
+       CTL_LEAF_RO(size),
+       CTL_LEAF_RW(automatic),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(arena)[] = {
+       CTL_INDEXED(arena_id),
+       CTL_LEAF_RUNNABLE(create),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(narenas)[] = {
+       CTL_LEAF_RO(automatic, narenas),
+       CTL_LEAF_RO(total),
+       CTL_LEAF_RW(max),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(thread)[] = {
+       CTL_LEAF_RW(arena_id),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(heap)[] = {
+       CTL_CHILD(alloc_class),
+       CTL_CHILD(arena),
+       CTL_CHILD(size),
+       CTL_CHILD(thread),
+       CTL_CHILD(narenas),
+
+       CTL_NODE_END
+};
+
+/*
+ * pmalloc_ctl_register -- registers ctl nodes for "heap" module
+ */
+void
+pmalloc_ctl_register(PMEMobjpool *pop)
+{
+       CTL_REGISTER_MODULE(pop->ctl, heap);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/pmalloc.h b/ceph/src/pmdk/src/libpmemobj/pmalloc.h
new file mode 100644 (file)
index 0000000..23ebe5b
--- /dev/null
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * pmalloc.h -- internal definitions for persistent malloc
+ */
+
+#ifndef LIBPMEMOBJ_PMALLOC_H
+#define LIBPMEMOBJ_PMALLOC_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "libpmemobj.h"
+#include "memops.h"
+#include "palloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* single operations done in the internal context of the lane */
+
+int pmalloc(PMEMobjpool *pop, uint64_t *off, size_t size,
+       uint64_t extra_field, uint16_t object_flags);
+int pmalloc_construct(PMEMobjpool *pop, uint64_t *off, size_t size,
+       palloc_constr constructor, void *arg,
+       uint64_t extra_field, uint16_t object_flags, uint16_t class_id);
+
+int prealloc(PMEMobjpool *pop, uint64_t *off, size_t size,
+       uint64_t extra_field, uint16_t object_flags);
+
+void pfree(PMEMobjpool *pop, uint64_t *off);
+
+/* external operation to be used together with context-aware palloc funcs */
+
+struct operation_context *pmalloc_operation_hold(PMEMobjpool *pop);
+struct operation_context *pmalloc_operation_hold_no_start(PMEMobjpool *pop);
+void pmalloc_operation_release(PMEMobjpool *pop);
+
+void pmalloc_ctl_register(PMEMobjpool *pop);
+
+int pmalloc_cleanup(PMEMobjpool *pop);
+int pmalloc_boot(PMEMobjpool *pop);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/pmemops.h b/ceph/src/pmdk/src/libpmemobj/pmemops.h
new file mode 100644 (file)
index 0000000..2161903
--- /dev/null
@@ -0,0 +1,104 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+#ifndef LIBPMEMOBJ_PMEMOPS_H
+#define LIBPMEMOBJ_PMEMOPS_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+#include "util.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int (*persist_fn)(void *base, const void *, size_t, unsigned);
+typedef int (*flush_fn)(void *base, const void *, size_t, unsigned);
+typedef void (*drain_fn)(void *base);
+
+typedef void *(*memcpy_fn)(void *base, void *dest, const void *src, size_t len,
+               unsigned flags);
+typedef void *(*memmove_fn)(void *base, void *dest, const void *src, size_t len,
+               unsigned flags);
+typedef void *(*memset_fn)(void *base, void *dest, int c, size_t len,
+               unsigned flags);
+
+typedef int (*remote_read_fn)(void *ctx, uintptr_t base, void *dest, void *addr,
+               size_t length);
+
+struct pmem_ops {
+       /* for 'master' replica: with or without data replication */
+       persist_fn persist;     /* persist function */
+       flush_fn flush;         /* flush function */
+       drain_fn drain;         /* drain function */
+       memcpy_fn memcpy; /* persistent memcpy function */
+       memmove_fn memmove; /* persistent memmove function */
+       memset_fn memset; /* persistent memset function */
+       void *base;
+
+       struct remote_ops {
+               remote_read_fn read;
+
+               void *ctx;
+               uintptr_t base;
+       } remote;
+};
+
+static force_inline int
+pmemops_xpersist(const struct pmem_ops *p_ops, const void *d, size_t s,
+               unsigned flags)
+{
+       return p_ops->persist(p_ops->base, d, s, flags);
+}
+
+static force_inline void
+pmemops_persist(const struct pmem_ops *p_ops, const void *d, size_t s)
+{
+       (void) pmemops_xpersist(p_ops, d, s, 0);
+}
+
+static force_inline int
+pmemops_xflush(const struct pmem_ops *p_ops, const void *d, size_t s,
+               unsigned flags)
+{
+       return p_ops->flush(p_ops->base, d, s, flags);
+}
+
+static force_inline void
+pmemops_flush(const struct pmem_ops *p_ops, const void *d, size_t s)
+{
+       (void) pmemops_xflush(p_ops, d, s, 0);
+}
+
+static force_inline void
+pmemops_drain(const struct pmem_ops *p_ops)
+{
+       p_ops->drain(p_ops->base);
+}
+
+static force_inline void *
+pmemops_memcpy(const struct pmem_ops *p_ops, void *dest,
+               const void *src, size_t len, unsigned flags)
+{
+       return p_ops->memcpy(p_ops->base, dest, src, len, flags);
+}
+
+static force_inline void *
+pmemops_memmove(const struct pmem_ops *p_ops, void *dest,
+               const void *src, size_t len, unsigned flags)
+{
+       return p_ops->memmove(p_ops->base, dest, src, len, flags);
+}
+
+static force_inline void *
+pmemops_memset(const struct pmem_ops *p_ops, void *dest, int c,
+               size_t len, unsigned flags)
+{
+       return p_ops->memset(p_ops->base, dest, c, len, flags);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/recycler.c b/ceph/src/pmdk/src/libpmemobj/recycler.c
new file mode 100644 (file)
index 0000000..3827489
--- /dev/null
@@ -0,0 +1,303 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * recycler.c -- implementation of run recycler
+ */
+
+#include "heap.h"
+#include "recycler.h"
+#include "vec.h"
+#include "out.h"
+#include "util.h"
+#include "sys_util.h"
+#include "ravl.h"
+#include "valgrind_internal.h"
+
+#define THRESHOLD_MUL 4
+
+/*
+ * recycler_element_cmp -- compares two recycler elements
+ */
+static int
+recycler_element_cmp(const void *lhs, const void *rhs)
+{
+       const struct recycler_element *l = lhs;
+       const struct recycler_element *r = rhs;
+
+       int64_t diff = (int64_t)l->max_free_block - (int64_t)r->max_free_block;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->free_space - (int64_t)r->free_space;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->zone_id - (int64_t)r->zone_id;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       diff = (int64_t)l->chunk_id - (int64_t)r->chunk_id;
+       if (diff != 0)
+               return diff > 0 ? 1 : -1;
+
+       return 0;
+}
+
+struct recycler {
+       struct ravl *runs;
+       struct palloc_heap *heap;
+
+       /*
+        * How many unaccounted units there *might* be inside of the memory
+        * blocks stored in the recycler.
+        * The value is not meant to be accurate, but rather a rough measure on
+        * how often should the memory block scores be recalculated.
+        *
+        * Per-chunk unaccounted units are shared for all zones, which might
+        * lead to some unnecessary recalculations.
+        */
+       size_t unaccounted_units[MAX_CHUNK];
+       size_t unaccounted_total;
+       size_t nallocs;
+       size_t *peak_arenas;
+
+       VEC(, struct recycler_element) recalc;
+
+       os_mutex_t lock;
+};
+
+/*
+ * recycler_new -- creates new recycler instance
+ */
+struct recycler *
+recycler_new(struct palloc_heap *heap, size_t nallocs, size_t *peak_arenas)
+{
+       struct recycler *r = Malloc(sizeof(struct recycler));
+       if (r == NULL)
+               goto error_alloc_recycler;
+
+       r->runs = ravl_new_sized(recycler_element_cmp,
+               sizeof(struct recycler_element));
+       if (r->runs == NULL)
+               goto error_alloc_tree;
+
+       r->heap = heap;
+       r->nallocs = nallocs;
+       r->peak_arenas = peak_arenas;
+       r->unaccounted_total = 0;
+       memset(&r->unaccounted_units, 0, sizeof(r->unaccounted_units));
+
+       VEC_INIT(&r->recalc);
+
+       util_mutex_init(&r->lock);
+
+       return r;
+
+error_alloc_tree:
+       Free(r);
+error_alloc_recycler:
+       return NULL;
+}
+
+/*
+ * recycler_delete -- deletes recycler instance
+ */
+void
+recycler_delete(struct recycler *r)
+{
+       VEC_DELETE(&r->recalc);
+
+       util_mutex_destroy(&r->lock);
+       ravl_delete(r->runs);
+       Free(r);
+}
+
+/*
+ * recycler_element_new -- calculates how many free bytes does a run have and
+ *     what's the largest request that the run can handle, returns that as
+ *     recycler element struct
+ */
+struct recycler_element
+recycler_element_new(struct palloc_heap *heap, const struct memory_block *m)
+{
+       /*
+        * Counting of the clear bits can race with a concurrent deallocation
+        * that operates on the same run. This race is benign and has absolutely
+        * no effect on the correctness of this algorithm. Ideally, we would
+        * avoid grabbing the lock, but helgrind gets very confused if we
+        * try to disable reporting for this function.
+        */
+       os_mutex_t *lock = m->m_ops->get_lock(m);
+       util_mutex_lock(lock);
+
+       struct recycler_element e = {
+               .free_space = 0,
+               .max_free_block = 0,
+               .chunk_id = m->chunk_id,
+               .zone_id = m->zone_id,
+       };
+       m->m_ops->calc_free(m, &e.free_space, &e.max_free_block);
+
+       util_mutex_unlock(lock);
+
+       return e;
+}
+
+/*
+ * recycler_put -- inserts new run into the recycler
+ */
+int
+recycler_put(struct recycler *r, const struct memory_block *m,
+       struct recycler_element element)
+{
+       int ret = 0;
+
+       util_mutex_lock(&r->lock);
+
+       ret = ravl_emplace_copy(r->runs, &element);
+
+       util_mutex_unlock(&r->lock);
+
+       return ret;
+}
+
+/*
+ * recycler_get -- retrieves a chunk from the recycler
+ */
+int
+recycler_get(struct recycler *r, struct memory_block *m)
+{
+       int ret = 0;
+
+       util_mutex_lock(&r->lock);
+
+       struct recycler_element e = { .max_free_block = m->size_idx, 0, 0, 0};
+       struct ravl_node *n = ravl_find(r->runs, &e,
+               RAVL_PREDICATE_GREATER_EQUAL);
+       if (n == NULL) {
+               ret = ENOMEM;
+               goto out;
+       }
+
+       struct recycler_element *ne = ravl_data(n);
+       m->chunk_id = ne->chunk_id;
+       m->zone_id = ne->zone_id;
+
+       ravl_remove(r->runs, n);
+
+       struct chunk_header *hdr = heap_get_chunk_hdr(r->heap, m);
+       m->size_idx = hdr->size_idx;
+
+       memblock_rebuild_state(r->heap, m);
+
+out:
+       util_mutex_unlock(&r->lock);
+
+       return ret;
+}
+
+/*
+ * recycler_recalc -- recalculates the scores of runs in the recycler to match
+ *     the updated persistent state
+ */
+struct empty_runs
+recycler_recalc(struct recycler *r, int force)
+{
+       struct empty_runs runs;
+       VEC_INIT(&runs);
+
+       uint64_t units = r->unaccounted_total;
+
+       size_t peak_arenas;
+       util_atomic_load64(r->peak_arenas, &peak_arenas);
+
+       uint64_t recalc_threshold =
+               THRESHOLD_MUL * peak_arenas * r->nallocs;
+
+       if (!force && units < recalc_threshold)
+               return runs;
+
+       if (util_mutex_trylock(&r->lock) != 0)
+               return runs;
+
+       /* If the search is forced, recalculate everything */
+       uint64_t search_limit = force ? UINT64_MAX : units;
+
+       uint64_t found_units = 0;
+       struct memory_block nm = MEMORY_BLOCK_NONE;
+       struct ravl_node *n;
+       struct recycler_element next = {0, 0, 0, 0};
+       enum ravl_predicate p = RAVL_PREDICATE_GREATER_EQUAL;
+       do {
+               if ((n = ravl_find(r->runs, &next, p)) == NULL)
+                       break;
+
+               p = RAVL_PREDICATE_GREATER;
+
+               struct recycler_element *ne = ravl_data(n);
+               next = *ne;
+
+               uint64_t chunk_units = r->unaccounted_units[ne->chunk_id];
+               if (!force && chunk_units == 0)
+                       continue;
+
+               uint32_t existing_free_space = ne->free_space;
+
+               nm.chunk_id = ne->chunk_id;
+               nm.zone_id = ne->zone_id;
+               memblock_rebuild_state(r->heap, &nm);
+
+               struct recycler_element e = recycler_element_new(r->heap, &nm);
+
+               ASSERT(e.free_space >= existing_free_space);
+               uint64_t free_space_diff = e.free_space - existing_free_space;
+               found_units += free_space_diff;
+
+               if (free_space_diff == 0)
+                       continue;
+
+               /*
+                * Decrease the per chunk_id counter by the number of nallocs
+                * found, increased by the blocks potentially freed in the
+                * active memory block. Cap the sub value to prevent overflow.
+                */
+               util_fetch_and_sub64(&r->unaccounted_units[nm.chunk_id],
+                       MIN(chunk_units, free_space_diff + r->nallocs));
+
+               ravl_remove(r->runs, n);
+
+               if (e.free_space == r->nallocs) {
+                       memblock_rebuild_state(r->heap, &nm);
+                       if (VEC_PUSH_BACK(&runs, nm) != 0)
+                               ASSERT(0); /* XXX: fix after refactoring */
+               } else {
+                       VEC_PUSH_BACK(&r->recalc, e);
+               }
+       } while (found_units < search_limit);
+
+       struct recycler_element *e;
+       VEC_FOREACH_BY_PTR(e, &r->recalc) {
+               ravl_emplace_copy(r->runs, e);
+       }
+
+       VEC_CLEAR(&r->recalc);
+
+       util_mutex_unlock(&r->lock);
+
+       util_fetch_and_sub64(&r->unaccounted_total, units);
+
+       return runs;
+}
+
+/*
+ * recycler_inc_unaccounted -- increases the number of unaccounted units in the
+ *     recycler
+ */
+void
+recycler_inc_unaccounted(struct recycler *r, const struct memory_block *m)
+{
+       util_fetch_and_add64(&r->unaccounted_total, m->size_idx);
+       util_fetch_and_add64(&r->unaccounted_units[m->chunk_id],
+               m->size_idx);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/recycler.h b/ceph/src/pmdk/src/libpmemobj/recycler.h
new file mode 100644 (file)
index 0000000..c8c824c
--- /dev/null
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * recycler.h -- internal definitions of run recycler
+ *
+ * This is a container that stores runs that are currently not used by any of
+ * the buckets.
+ */
+
+#ifndef LIBPMEMOBJ_RECYCLER_H
+#define LIBPMEMOBJ_RECYCLER_H 1
+
+#include "memblock.h"
+#include "vec.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct recycler;
+VEC(empty_runs, struct memory_block);
+
+struct recycler_element {
+       uint32_t max_free_block;
+       uint32_t free_space;
+
+       uint32_t chunk_id;
+       uint32_t zone_id;
+};
+
+struct recycler *recycler_new(struct palloc_heap *layout,
+       size_t nallocs, size_t *peak_arenas);
+void recycler_delete(struct recycler *r);
+struct recycler_element recycler_element_new(struct palloc_heap *heap,
+       const struct memory_block *m);
+
+int recycler_put(struct recycler *r, const struct memory_block *m,
+       struct recycler_element element);
+
+int recycler_get(struct recycler *r, struct memory_block *m);
+
+struct empty_runs recycler_recalc(struct recycler *r, int force);
+
+void recycler_inc_unaccounted(struct recycler *r,
+       const struct memory_block *m);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/stats.c b/ceph/src/pmdk/src/libpmemobj/stats.c
new file mode 100644 (file)
index 0000000..a0fc254
--- /dev/null
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2019, Intel Corporation */
+
+/*
+ * stats.c -- implementation of statistics
+ */
+
+#include "obj.h"
+#include "stats.h"
+
+STATS_CTL_HANDLER(persistent, curr_allocated, heap_curr_allocated);
+
+STATS_CTL_HANDLER(transient, run_allocated, heap_run_allocated);
+STATS_CTL_HANDLER(transient, run_active, heap_run_active);
+
+static const struct ctl_node CTL_NODE(heap)[] = {
+       STATS_CTL_LEAF(persistent, curr_allocated),
+       STATS_CTL_LEAF(transient, run_allocated),
+       STATS_CTL_LEAF(transient, run_active),
+
+       CTL_NODE_END
+};
+
+/*
+ * CTL_READ_HANDLER(enabled) -- returns whether or not statistics are enabled
+ */
+static int
+CTL_READ_HANDLER(enabled)(void *ctx,
+       enum ctl_query_source source, void *arg,
+       struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       enum pobj_stats_enabled *arg_out = arg;
+
+       *arg_out = pop->stats->enabled;
+
+       return 0;
+}
+
+/*
+ * stats_enabled_parser -- parses the stats enabled type
+ */
+static int
+stats_enabled_parser(const void *arg, void *dest, size_t dest_size)
+{
+       const char *vstr = arg;
+       enum pobj_stats_enabled *enabled = dest;
+       ASSERTeq(dest_size, sizeof(enum pobj_stats_enabled));
+
+       int bool_out;
+       if (ctl_arg_boolean(arg, &bool_out, sizeof(bool_out)) == 0) {
+               *enabled = bool_out ?
+                       POBJ_STATS_ENABLED_BOTH : POBJ_STATS_DISABLED;
+               return 0;
+       }
+
+       if (strcmp(vstr, "disabled") == 0) {
+               *enabled = POBJ_STATS_DISABLED;
+       } else if (strcmp(vstr, "both") == 0) {
+               *enabled = POBJ_STATS_ENABLED_BOTH;
+       } else if (strcmp(vstr, "persistent") == 0) {
+               *enabled = POBJ_STATS_ENABLED_PERSISTENT;
+       } else if (strcmp(vstr, "transient") == 0) {
+               *enabled = POBJ_STATS_ENABLED_TRANSIENT;
+       } else {
+               ERR("invalid enable type");
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(enabled) -- enables or disables statistics counting
+ */
+static int
+CTL_WRITE_HANDLER(enabled)(void *ctx,
+       enum ctl_query_source source, void *arg,
+       struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       pop->stats->enabled = *(enum pobj_stats_enabled *)arg;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(enabled) = {
+       .dest_size = sizeof(enum pobj_stats_enabled),
+       .parsers = {
+               CTL_ARG_PARSER(sizeof(enum pobj_stats_enabled),
+                       stats_enabled_parser),
+               CTL_ARG_PARSER_END
+       }
+};
+
+static const struct ctl_node CTL_NODE(stats)[] = {
+       CTL_CHILD(heap),
+       CTL_LEAF_RW(enabled),
+
+       CTL_NODE_END
+};
+
+/*
+ * stats_new -- allocates and initializes statistics instance
+ */
+struct stats *
+stats_new(PMEMobjpool *pop)
+{
+       struct stats *s = Malloc(sizeof(*s));
+       if (s == NULL) {
+               ERR("!Malloc");
+               return NULL;
+       }
+
+       s->enabled = POBJ_STATS_ENABLED_TRANSIENT;
+       s->persistent = &pop->stats_persistent;
+       VALGRIND_ADD_TO_GLOBAL_TX_IGNORE(s->persistent, sizeof(*s->persistent));
+       s->transient = Zalloc(sizeof(struct stats_transient));
+       if (s->transient == NULL)
+               goto error_transient_alloc;
+
+       return s;
+
+error_transient_alloc:
+       Free(s);
+       return NULL;
+}
+
+/*
+ * stats_delete -- deletes statistics instance
+ */
+void
+stats_delete(PMEMobjpool *pop, struct stats *s)
+{
+       pmemops_persist(&pop->p_ops, s->persistent,
+       sizeof(struct stats_persistent));
+       Free(s->transient);
+       Free(s);
+}
+
+/*
+ * stats_ctl_register -- registers ctl nodes for statistics
+ */
+void
+stats_ctl_register(PMEMobjpool *pop)
+{
+       CTL_REGISTER_MODULE(pop->ctl, stats);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/stats.h b/ceph/src/pmdk/src/libpmemobj/stats.h
new file mode 100644 (file)
index 0000000..c66a1e8
--- /dev/null
@@ -0,0 +1,108 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * stats.h -- definitions of statistics
+ */
+
+#ifndef LIBPMEMOBJ_STATS_H
+#define LIBPMEMOBJ_STATS_H 1
+
+#include "ctl.h"
+#include "libpmemobj/ctl.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct stats_transient {
+       uint64_t heap_run_allocated;
+       uint64_t heap_run_active;
+};
+
+struct stats_persistent {
+       uint64_t heap_curr_allocated;
+};
+
+struct stats {
+       enum pobj_stats_enabled enabled;
+       struct stats_transient *transient;
+       struct stats_persistent *persistent;
+};
+
+#define STATS_INC(stats, type, name, value) do {\
+       STATS_INC_##type(stats, name, value);\
+} while (0)
+
+#define STATS_INC_transient(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_TRANSIENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_fetch_and_add64((&(stats)->transient->name), (value));\
+} while (0)
+
+#define STATS_INC_persistent(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_PERSISTENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_fetch_and_add64((&(stats)->persistent->name), (value));\
+} while (0)
+
+#define STATS_SUB(stats, type, name, value) do {\
+       STATS_SUB_##type(stats, name, value);\
+} while (0)
+
+#define STATS_SUB_transient(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_TRANSIENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_fetch_and_sub64((&(stats)->transient->name), (value));\
+} while (0)
+
+#define STATS_SUB_persistent(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_PERSISTENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_fetch_and_sub64((&(stats)->persistent->name), (value));\
+} while (0)
+
+#define STATS_SET(stats, type, name, value) do {\
+       STATS_SET_##type(stats, name, value);\
+} while (0)
+
+#define STATS_SET_transient(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_TRANSIENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_atomic_store_explicit64((&(stats)->transient->name),\
+               (value), memory_order_release);\
+} while (0)
+
+#define STATS_SET_persistent(stats, name, value) do {\
+       if ((stats)->enabled == POBJ_STATS_ENABLED_PERSISTENT ||\
+       (stats)->enabled == POBJ_STATS_ENABLED_BOTH)\
+               util_atomic_store_explicit64((&(stats)->persistent->name),\
+               (value), memory_order_release);\
+} while (0)
+
+#define STATS_CTL_LEAF(type, name)\
+{CTL_STR(name), CTL_NODE_LEAF,\
+{CTL_READ_HANDLER(type##_##name), NULL, NULL},\
+NULL, NULL}
+
+#define STATS_CTL_HANDLER(type, name, varname)\
+static int CTL_READ_HANDLER(type##_##name)(void *ctx,\
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)\
+{\
+       PMEMobjpool *pop = ctx;\
+       uint64_t *argv = arg;\
+       util_atomic_load_explicit64(&pop->stats->type->varname,\
+               argv, memory_order_acquire);\
+       return 0;\
+}
+
+void stats_ctl_register(PMEMobjpool *pop);
+
+struct stats *stats_new(PMEMobjpool *pop);
+void stats_delete(PMEMobjpool *pop, struct stats *stats);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/sync.c b/ceph/src/pmdk/src/libpmemobj/sync.c
new file mode 100644 (file)
index 0000000..7a1e897
--- /dev/null
@@ -0,0 +1,642 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2018, Intel Corporation */
+
+/*
+ * sync.c -- persistent memory resident synchronization primitives
+ */
+
+#include <inttypes.h>
+
+#include "obj.h"
+#include "out.h"
+#include "util.h"
+#include "sync.h"
+#include "sys_util.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+#ifdef __FreeBSD__
+#define RECORD_LOCK(init, type, p) \
+       if (init) {\
+               PMEM##type##_internal *head = pop->type##_head;\
+               while (!util_bool_compare_and_swap64(&pop->type##_head, head,\
+                       p)) {\
+                       head = pop->type##_head;\
+               }\
+               p->PMEM##type##_next = head;\
+       }
+#else
+#define RECORD_LOCK(init, type, p)
+#endif
+
+/*
+ * _get_value -- (internal) atomically initialize and return a value.
+ *     Returns -1 on error, 0 if the caller is not the value
+ *     initializer, 1 if the caller is the value initializer.
+ */
+static int
+_get_value(uint64_t pop_runid, volatile uint64_t *runid, void *value, void *arg,
+       int (*init_value)(void *value, void *arg))
+{
+       uint64_t tmp_runid;
+       int initializer = 0;
+
+       while ((tmp_runid = *runid) != pop_runid) {
+               if (tmp_runid == pop_runid - 1)
+                       continue;
+
+               if (!util_bool_compare_and_swap64(runid, tmp_runid,
+                               pop_runid - 1))
+                       continue;
+
+               initializer = 1;
+
+               if (init_value(value, arg)) {
+                       ERR("error initializing lock");
+                       util_fetch_and_and64(runid, 0);
+                       return -1;
+               }
+
+               if (util_bool_compare_and_swap64(runid, pop_runid - 1,
+                               pop_runid) == 0) {
+                       ERR("error setting lock runid");
+                       return -1;
+               }
+       }
+
+       return initializer;
+}
+
+/*
+ * get_mutex -- (internal) atomically initialize, record and return a mutex
+ */
+static inline os_mutex_t *
+get_mutex(PMEMobjpool *pop, PMEMmutex_internal *imp)
+{
+       if (likely(imp->pmemmutex.runid == pop->run_id))
+               return &imp->PMEMmutex_lock;
+
+       volatile uint64_t *runid = &imp->pmemmutex.runid;
+
+       LOG(5, "PMEMmutex %p pop->run_id %" PRIu64 " pmemmutex.runid %" PRIu64,
+               imp, pop->run_id, *runid);
+
+       ASSERTeq((uintptr_t)runid % util_alignof(uint64_t), 0);
+
+       COMPILE_ERROR_ON(sizeof(PMEMmutex) != sizeof(PMEMmutex_internal));
+       COMPILE_ERROR_ON(util_alignof(PMEMmutex) != util_alignof(os_mutex_t));
+
+       VALGRIND_REMOVE_PMEM_MAPPING(imp, _POBJ_CL_SIZE);
+
+       int initializer = _get_value(pop->run_id, runid, &imp->PMEMmutex_lock,
+               NULL, (void *)os_mutex_init);
+       if (initializer == -1) {
+               return NULL;
+       }
+
+       RECORD_LOCK(initializer, mutex, imp);
+
+       return &imp->PMEMmutex_lock;
+}
+
+/*
+ * get_rwlock -- (internal) atomically initialize, record and return a rwlock
+ */
+static inline os_rwlock_t *
+get_rwlock(PMEMobjpool *pop, PMEMrwlock_internal *irp)
+{
+       if (likely(irp->pmemrwlock.runid == pop->run_id))
+               return &irp->PMEMrwlock_lock;
+
+       volatile uint64_t *runid = &irp->pmemrwlock.runid;
+
+       LOG(5, "PMEMrwlock %p pop->run_id %"\
+               PRIu64 " pmemrwlock.runid %" PRIu64,
+               irp, pop->run_id, *runid);
+
+       ASSERTeq((uintptr_t)runid % util_alignof(uint64_t), 0);
+
+       COMPILE_ERROR_ON(sizeof(PMEMrwlock) != sizeof(PMEMrwlock_internal));
+       COMPILE_ERROR_ON(util_alignof(PMEMrwlock)
+               != util_alignof(os_rwlock_t));
+
+       VALGRIND_REMOVE_PMEM_MAPPING(irp, _POBJ_CL_SIZE);
+
+       int initializer = _get_value(pop->run_id, runid, &irp->PMEMrwlock_lock,
+               NULL, (void *)os_rwlock_init);
+       if (initializer == -1) {
+               return NULL;
+       }
+
+       RECORD_LOCK(initializer, rwlock, irp);
+
+       return &irp->PMEMrwlock_lock;
+}
+
+/*
+ * get_cond -- (internal) atomically initialize, record and return a
+ *     condition variable
+ */
+static inline os_cond_t *
+get_cond(PMEMobjpool *pop, PMEMcond_internal *icp)
+{
+       if (likely(icp->pmemcond.runid == pop->run_id))
+               return &icp->PMEMcond_cond;
+
+       volatile uint64_t *runid = &icp->pmemcond.runid;
+
+       LOG(5, "PMEMcond %p pop->run_id %" PRIu64 " pmemcond.runid %" PRIu64,
+               icp, pop->run_id, *runid);
+
+       ASSERTeq((uintptr_t)runid % util_alignof(uint64_t), 0);
+
+       COMPILE_ERROR_ON(sizeof(PMEMcond) != sizeof(PMEMcond_internal));
+       COMPILE_ERROR_ON(util_alignof(PMEMcond) != util_alignof(os_cond_t));
+
+       VALGRIND_REMOVE_PMEM_MAPPING(icp, _POBJ_CL_SIZE);
+
+       int initializer = _get_value(pop->run_id, runid, &icp->PMEMcond_cond,
+               NULL, (void *)os_cond_init);
+       if (initializer == -1) {
+               return NULL;
+       }
+
+       RECORD_LOCK(initializer, cond, icp);
+
+       return &icp->PMEMcond_cond;
+}
+
+/*
+ * pmemobj_mutex_zero -- zero-initialize a pmem resident mutex
+ *
+ * This function is not MT safe.
+ */
+void
+pmemobj_mutex_zero(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       mutexip->pmemmutex.runid = 0;
+       pmemops_persist(&pop->p_ops, &mutexip->pmemmutex.runid,
+                               sizeof(mutexip->pmemmutex.runid));
+}
+
+/*
+ * pmemobj_mutex_lock -- lock a pmem resident mutex
+ *
+ * Atomically initializes and locks a PMEMmutex, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_mutex_lock(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+
+       if (mutex == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+
+       return os_mutex_lock(mutex);
+}
+
+/*
+ * pmemobj_mutex_assert_locked -- checks whether mutex is locked.
+ *
+ * Returns 0 when mutex is locked.
+ */
+int
+pmemobj_mutex_assert_locked(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if (mutex == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+
+       int ret = os_mutex_trylock(mutex);
+       if (ret == EBUSY)
+               return 0;
+       if (ret == 0) {
+               util_mutex_unlock(mutex);
+               /*
+                * There's no good error code for this case. EINVAL is used for
+                * something else here.
+                */
+               return ENODEV;
+       }
+       return ret;
+}
+
+/*
+ * pmemobj_mutex_timedlock -- lock a pmem resident mutex
+ *
+ * Atomically initializes and locks a PMEMmutex, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_mutex_timedlock(PMEMobjpool *pop, PMEMmutex *__restrict mutexp,
+               const struct timespec *__restrict abs_timeout)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if (mutex == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+
+       return os_mutex_timedlock(mutex, abs_timeout);
+}
+
+/*
+ * pmemobj_mutex_trylock -- trylock a pmem resident mutex
+ *
+ * Atomically initializes and trylocks a PMEMmutex, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_mutex_trylock(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if (mutex == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+
+       return os_mutex_trylock(mutex);
+}
+
+/*
+ * pmemobj_mutex_unlock -- unlock a pmem resident mutex
+ */
+int
+pmemobj_mutex_unlock(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       LOG(3, "pop %p mutex %p", pop, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+
+       /* XXX potential performance improvement - move GET to debug version */
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if (mutex == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+
+       return os_mutex_unlock(mutex);
+}
+
+/*
+ * pmemobj_rwlock_zero -- zero-initialize a pmem resident rwlock
+ *
+ * This function is not MT safe.
+ */
+void
+pmemobj_rwlock_zero(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       rwlockip->pmemrwlock.runid = 0;
+       pmemops_persist(&pop->p_ops, &rwlockip->pmemrwlock.runid,
+                               sizeof(rwlockip->pmemrwlock.runid));
+}
+
+/*
+ * pmemobj_rwlock_rdlock -- rdlock a pmem resident mutex
+ *
+ * Atomically initializes and rdlocks a PMEMrwlock, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_rwlock_rdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_rdlock(rwlock);
+}
+
+/*
+ * pmemobj_rwlock_wrlock -- wrlock a pmem resident mutex
+ *
+ * Atomically initializes and wrlocks a PMEMrwlock, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_rwlock_wrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_wrlock(rwlock);
+}
+
+/*
+ * pmemobj_rwlock_timedrdlock -- timedrdlock a pmem resident mutex
+ *
+ * Atomically initializes and timedrdlocks a PMEMrwlock, otherwise behaves as
+ * its POSIX counterpart.
+ */
+int
+pmemobj_rwlock_timedrdlock(PMEMobjpool *pop, PMEMrwlock *__restrict rwlockp,
+                       const struct timespec *__restrict abs_timeout)
+{
+       LOG(3, "pop %p rwlock %p timeout sec %ld nsec %ld", pop, rwlockp,
+               abs_timeout->tv_sec, abs_timeout->tv_nsec);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_timedrdlock(rwlock, abs_timeout);
+}
+
+/*
+ * pmemobj_rwlock_timedwrlock -- timedwrlock a pmem resident mutex
+ *
+ * Atomically initializes and timedwrlocks a PMEMrwlock, otherwise behaves as
+ * its POSIX counterpart.
+ */
+int
+pmemobj_rwlock_timedwrlock(PMEMobjpool *pop, PMEMrwlock *__restrict rwlockp,
+                       const struct timespec *__restrict abs_timeout)
+{
+       LOG(3, "pop %p rwlock %p timeout sec %ld nsec %ld", pop, rwlockp,
+               abs_timeout->tv_sec, abs_timeout->tv_nsec);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_timedwrlock(rwlock, abs_timeout);
+}
+
+/*
+ * pmemobj_rwlock_tryrdlock -- tryrdlock a pmem resident mutex
+ *
+ * Atomically initializes and tryrdlocks a PMEMrwlock, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_rwlock_tryrdlock(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_tryrdlock(rwlock);
+}
+
+/*
+ * pmemobj_rwlock_trywrlock -- trywrlock a pmem resident mutex
+ *
+ * Atomically initializes and trywrlocks a PMEMrwlock, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_rwlock_trywrlock(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_trywrlock(rwlock);
+}
+
+/*
+ * pmemobj_rwlock_unlock -- unlock a pmem resident rwlock
+ */
+int
+pmemobj_rwlock_unlock(PMEMobjpool *pop, PMEMrwlock *rwlockp)
+{
+       LOG(3, "pop %p rwlock %p", pop, rwlockp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(rwlockp));
+
+       /* XXX potential performance improvement - move GET to debug version */
+       PMEMrwlock_internal *rwlockip = (PMEMrwlock_internal *)rwlockp;
+       os_rwlock_t *rwlock = get_rwlock(pop, rwlockip);
+       if (rwlock == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)rwlock % util_alignof(os_rwlock_t), 0);
+
+       return os_rwlock_unlock(rwlock);
+}
+
+/*
+ * pmemobj_cond_zero -- zero-initialize a pmem resident condition variable
+ *
+ * This function is not MT safe.
+ */
+void
+pmemobj_cond_zero(PMEMobjpool *pop, PMEMcond *condp)
+{
+       LOG(3, "pop %p cond %p", pop, condp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(condp));
+
+       PMEMcond_internal *condip = (PMEMcond_internal *)condp;
+       condip->pmemcond.runid = 0;
+       pmemops_persist(&pop->p_ops, &condip->pmemcond.runid,
+                       sizeof(condip->pmemcond.runid));
+}
+
+/*
+ * pmemobj_cond_broadcast -- broadcast a pmem resident condition variable
+ *
+ * Atomically initializes and broadcast a PMEMcond, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_cond_broadcast(PMEMobjpool *pop, PMEMcond *condp)
+{
+       LOG(3, "pop %p cond %p", pop, condp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(condp));
+
+       PMEMcond_internal *condip = (PMEMcond_internal *)condp;
+       os_cond_t *cond = get_cond(pop, condip);
+       if (cond == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)cond % util_alignof(os_cond_t), 0);
+
+       return os_cond_broadcast(cond);
+}
+
+/*
+ * pmemobj_cond_signal -- signal a pmem resident condition variable
+ *
+ * Atomically initializes and signal a PMEMcond, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_cond_signal(PMEMobjpool *pop, PMEMcond *condp)
+{
+       LOG(3, "pop %p cond %p", pop, condp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(condp));
+
+       PMEMcond_internal *condip = (PMEMcond_internal *)condp;
+       os_cond_t *cond = get_cond(pop, condip);
+       if (cond == NULL)
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)cond % util_alignof(os_cond_t), 0);
+
+       return os_cond_signal(cond);
+}
+
+/*
+ * pmemobj_cond_timedwait -- timedwait on a pmem resident condition variable
+ *
+ * Atomically initializes and timedwait on a PMEMcond, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_cond_timedwait(PMEMobjpool *pop, PMEMcond *__restrict condp,
+                       PMEMmutex *__restrict mutexp,
+                       const struct timespec *__restrict abs_timeout)
+{
+       LOG(3, "pop %p cond %p mutex %p abstime sec %ld nsec %ld", pop, condp,
+               mutexp, abs_timeout->tv_sec, abs_timeout->tv_nsec);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+       ASSERTeq(pop, pmemobj_pool_by_ptr(condp));
+
+       PMEMcond_internal *condip = (PMEMcond_internal *)condp;
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_cond_t *cond = get_cond(pop, condip);
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if ((cond == NULL) || (mutex == NULL))
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+       ASSERTeq((uintptr_t)cond % util_alignof(os_cond_t), 0);
+
+       return os_cond_timedwait(cond, mutex, abs_timeout);
+}
+
+/*
+ * pmemobj_cond_wait -- wait on a pmem resident condition variable
+ *
+ * Atomically initializes and wait on a PMEMcond, otherwise behaves as its
+ * POSIX counterpart.
+ */
+int
+pmemobj_cond_wait(PMEMobjpool *pop, PMEMcond *condp,
+                       PMEMmutex *__restrict mutexp)
+{
+       LOG(3, "pop %p cond %p mutex %p", pop, condp, mutexp);
+
+       ASSERTeq(pop, pmemobj_pool_by_ptr(mutexp));
+       ASSERTeq(pop, pmemobj_pool_by_ptr(condp));
+
+       PMEMcond_internal *condip = (PMEMcond_internal *)condp;
+       PMEMmutex_internal *mutexip = (PMEMmutex_internal *)mutexp;
+       os_cond_t *cond = get_cond(pop, condip);
+       os_mutex_t *mutex = get_mutex(pop, mutexip);
+       if ((cond == NULL) || (mutex == NULL))
+               return EINVAL;
+
+       ASSERTeq((uintptr_t)mutex % util_alignof(os_mutex_t), 0);
+       ASSERTeq((uintptr_t)cond % util_alignof(os_cond_t), 0);
+
+       return os_cond_wait(cond, mutex);
+}
+
+/*
+ * pmemobj_volatile -- atomically initialize, record and return a
+ *     generic value
+ */
+void *
+pmemobj_volatile(PMEMobjpool *pop, struct pmemvlt *vlt,
+       void *ptr, size_t size,
+       int (*constr)(void *ptr, void *arg), void *arg)
+{
+       LOG(3, "pop %p vlt %p ptr %p constr %p arg %p", pop, vlt, ptr,
+               constr, arg);
+
+       if (likely(vlt->runid == pop->run_id))
+               return ptr;
+
+       VALGRIND_REMOVE_PMEM_MAPPING(ptr, size);
+
+       VALGRIND_ADD_TO_TX(vlt, sizeof(*vlt));
+       if (_get_value(pop->run_id, &vlt->runid, ptr, arg, constr) < 0) {
+               VALGRIND_REMOVE_FROM_TX(vlt, sizeof(*vlt));
+               return NULL;
+       }
+
+       VALGRIND_REMOVE_FROM_TX(vlt, sizeof(*vlt));
+       VALGRIND_SET_CLEAN(vlt, sizeof(*vlt));
+
+       return ptr;
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/sync.h b/ceph/src/pmdk/src/libpmemobj/sync.h
new file mode 100644 (file)
index 0000000..46aa1bb
--- /dev/null
@@ -0,0 +1,112 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * sync.h -- internal to obj synchronization API
+ */
+
+#ifndef LIBPMEMOBJ_SYNC_H
+#define LIBPMEMOBJ_SYNC_H 1
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "libpmemobj.h"
+#include "out.h"
+#include "os_thread.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * internal definitions of PMEM-locks
+ */
+typedef union padded_pmemmutex {
+       char padding[_POBJ_CL_SIZE];
+       struct {
+               uint64_t runid;
+               union {
+                       os_mutex_t mutex;
+                       struct {
+                               void *bsd_mutex_p;
+                               union padded_pmemmutex *next;
+                       } bsd_u;
+               } mutex_u;
+       } pmemmutex;
+} PMEMmutex_internal;
+#define PMEMmutex_lock pmemmutex.mutex_u.mutex
+#define PMEMmutex_bsd_mutex_p pmemmutex.mutex_u.bsd_u.bsd_mutex_p
+#define PMEMmutex_next pmemmutex.mutex_u.bsd_u.next
+
+typedef union padded_pmemrwlock {
+       char padding[_POBJ_CL_SIZE];
+       struct {
+               uint64_t runid;
+               union {
+                       os_rwlock_t rwlock;
+                       struct {
+                               void *bsd_rwlock_p;
+                               union padded_pmemrwlock *next;
+                       } bsd_u;
+               } rwlock_u;
+       } pmemrwlock;
+} PMEMrwlock_internal;
+#define PMEMrwlock_lock pmemrwlock.rwlock_u.rwlock
+#define PMEMrwlock_bsd_rwlock_p pmemrwlock.rwlock_u.bsd_u.bsd_rwlock_p
+#define PMEMrwlock_next pmemrwlock.rwlock_u.bsd_u.next
+
+typedef union padded_pmemcond {
+       char padding[_POBJ_CL_SIZE];
+       struct {
+               uint64_t runid;
+               union {
+                       os_cond_t cond;
+                       struct {
+                               void *bsd_cond_p;
+                               union padded_pmemcond *next;
+                       } bsd_u;
+               } cond_u;
+       } pmemcond;
+} PMEMcond_internal;
+#define PMEMcond_cond pmemcond.cond_u.cond
+#define PMEMcond_bsd_cond_p pmemcond.cond_u.bsd_u.bsd_cond_p
+#define PMEMcond_next pmemcond.cond_u.bsd_u.next
+
+/*
+ * pmemobj_mutex_lock_nofail -- pmemobj_mutex_lock variant that never
+ * fails from caller perspective. If pmemobj_mutex_lock failed, this function
+ * aborts the program.
+ */
+static inline void
+pmemobj_mutex_lock_nofail(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       int ret = pmemobj_mutex_lock(pop, mutexp);
+       if (ret) {
+               errno = ret;
+               FATAL("!pmemobj_mutex_lock");
+       }
+}
+
+/*
+ * pmemobj_mutex_unlock_nofail -- pmemobj_mutex_unlock variant that never
+ * fails from caller perspective. If pmemobj_mutex_unlock failed, this function
+ * aborts the program.
+ */
+static inline void
+pmemobj_mutex_unlock_nofail(PMEMobjpool *pop, PMEMmutex *mutexp)
+{
+       int ret = pmemobj_mutex_unlock(pop, mutexp);
+       if (ret) {
+               errno = ret;
+               FATAL("!pmemobj_mutex_unlock");
+       }
+}
+
+int pmemobj_mutex_assert_locked(PMEMobjpool *pop, PMEMmutex *mutexp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/tx.c b/ceph/src/pmdk/src/libpmemobj/tx.c
new file mode 100644 (file)
index 0000000..2213dd0
--- /dev/null
@@ -0,0 +1,2375 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * tx.c -- transactions implementation
+ */
+
+#include <inttypes.h>
+#include <wchar.h>
+
+#include "queue.h"
+#include "ravl.h"
+#include "obj.h"
+#include "out.h"
+#include "pmalloc.h"
+#include "tx.h"
+#include "valgrind_internal.h"
+#include "memops.h"
+
+struct tx_data {
+       PMDK_SLIST_ENTRY(tx_data) tx_entry;
+       jmp_buf env;
+       enum pobj_tx_failure_behavior failure_behavior;
+};
+
+struct tx {
+       PMEMobjpool *pop;
+       enum pobj_tx_stage stage;
+       int last_errnum;
+       struct lane *lane;
+       PMDK_SLIST_HEAD(txl, tx_lock_data) tx_locks;
+       PMDK_SLIST_HEAD(txd, tx_data) tx_entries;
+
+       struct ravl *ranges;
+
+       VEC(, struct pobj_action) actions;
+       VEC(, struct user_buffer_def) redo_userbufs;
+       size_t redo_userbufs_capacity;
+
+       pmemobj_tx_callback stage_callback;
+       void *stage_callback_arg;
+
+       int first_snapshot;
+
+       void *user_data;
+};
+
+/*
+ * get_tx -- (internal) returns current transaction
+ *
+ * This function should be used only in high-level functions.
+ */
+static struct tx *
+get_tx()
+{
+       static __thread struct tx tx;
+       return &tx;
+}
+
+struct tx_lock_data {
+       union {
+               PMEMmutex *mutex;
+               PMEMrwlock *rwlock;
+       } lock;
+       enum pobj_tx_param lock_type;
+       PMDK_SLIST_ENTRY(tx_lock_data) tx_lock;
+};
+
+struct tx_alloc_args {
+       uint64_t flags;
+       const void *copy_ptr;
+       size_t copy_size;
+};
+
+#define COPY_ARGS(flags, copy_ptr, copy_size)\
+(struct tx_alloc_args){flags, copy_ptr, copy_size}
+
+#define ALLOC_ARGS(flags)\
+(struct tx_alloc_args){flags, NULL, 0}
+
+struct tx_range_def {
+       uint64_t offset;
+       uint64_t size;
+       uint64_t flags;
+};
+
+/*
+ * tx_range_def_cmp -- compares two snapshot ranges
+ */
+static int
+tx_range_def_cmp(const void *lhs, const void *rhs)
+{
+       const struct tx_range_def *l = lhs;
+       const struct tx_range_def *r = rhs;
+
+       if (l->offset > r->offset)
+               return 1;
+       else if (l->offset < r->offset)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * tx_params_new -- creates a new transactional parameters instance and fills it
+ *     with default values.
+ */
+struct tx_parameters *
+tx_params_new(void)
+{
+       struct tx_parameters *tx_params = Malloc(sizeof(*tx_params));
+       if (tx_params == NULL)
+               return NULL;
+
+       tx_params->cache_size = TX_DEFAULT_RANGE_CACHE_SIZE;
+
+       return tx_params;
+}
+
+/*
+ * tx_params_delete -- deletes transactional parameters instance
+ */
+void
+tx_params_delete(struct tx_parameters *tx_params)
+{
+       Free(tx_params);
+}
+
+static void
+obj_tx_abort(int errnum, int user);
+
+/*
+ * obj_tx_fail_err -- (internal) pmemobj_tx_abort variant that returns
+ * error code
+ */
+static inline int
+obj_tx_fail_err(int errnum, uint64_t flags)
+{
+       if ((flags & POBJ_FLAG_TX_NO_ABORT) == 0)
+               obj_tx_abort(errnum, 0);
+       errno = errnum;
+       return errnum;
+}
+
+/*
+ * obj_tx_fail_null -- (internal) pmemobj_tx_abort variant that returns
+ * null PMEMoid
+ */
+static inline PMEMoid
+obj_tx_fail_null(int errnum, uint64_t flags)
+{
+       if ((flags & POBJ_FLAG_TX_NO_ABORT) == 0)
+               obj_tx_abort(errnum, 0);
+       errno = errnum;
+       return OID_NULL;
+}
+
+/* ASSERT_IN_TX -- checks whether there's open transaction */
+#define ASSERT_IN_TX(tx) do {\
+       if ((tx)->stage == TX_STAGE_NONE)\
+               FATAL("%s called outside of transaction", __func__);\
+} while (0)
+
+/* ASSERT_TX_STAGE_WORK -- checks whether current transaction stage is WORK */
+#define ASSERT_TX_STAGE_WORK(tx) do {\
+       if ((tx)->stage != TX_STAGE_WORK)\
+               FATAL("%s called in invalid stage %d", __func__, (tx)->stage);\
+} while (0)
+
+/*
+ * tx_action_reserve -- (internal) reserve space for the given number of actions
+ */
+static int
+tx_action_reserve(struct tx *tx, size_t n)
+{
+       size_t entries_size = (VEC_SIZE(&tx->actions) + n) *
+               sizeof(struct ulog_entry_val);
+
+       /* take the provided user buffers into account when reserving */
+       entries_size -= MIN(tx->redo_userbufs_capacity, entries_size);
+
+       if (operation_reserve(tx->lane->external, entries_size) != 0)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * tx_action_add -- (internal) reserve space and add a new tx action
+ */
+static struct pobj_action *
+tx_action_add(struct tx *tx)
+{
+       if (tx_action_reserve(tx, 1) != 0)
+               return NULL;
+
+       VEC_INC_BACK(&tx->actions);
+
+       return &VEC_BACK(&tx->actions);
+}
+
+/*
+ * tx_action_remove -- (internal) remove last tx action
+ */
+static void
+tx_action_remove(struct tx *tx)
+{
+       VEC_POP_BACK(&tx->actions);
+}
+
+/*
+ * constructor_tx_alloc -- (internal) constructor for normal alloc
+ */
+static int
+constructor_tx_alloc(void *ctx, void *ptr, size_t usable_size, void *arg)
+{
+       LOG(5, NULL);
+
+       ASSERTne(ptr, NULL);
+       ASSERTne(arg, NULL);
+
+       struct tx_alloc_args *args = arg;
+
+       /* do not report changes to the new object */
+       VALGRIND_ADD_TO_TX(ptr, usable_size);
+
+       if (args->flags & POBJ_FLAG_ZERO)
+               memset(ptr, 0, usable_size);
+
+       if (args->copy_ptr && args->copy_size != 0) {
+               memcpy(ptr, args->copy_ptr, args->copy_size);
+       }
+
+       return 0;
+}
+
+struct tx_range_data {
+       void *begin;
+       void *end;
+       PMDK_SLIST_ENTRY(tx_range_data) tx_range;
+};
+
+PMDK_SLIST_HEAD(txr, tx_range_data);
+
+/*
+ * tx_remove_range -- (internal) removes specified range from ranges list
+ */
+static void
+tx_remove_range(struct txr *tx_ranges, void *begin, void *end)
+{
+       struct tx_range_data *txr = PMDK_SLIST_FIRST(tx_ranges);
+
+       while (txr) {
+               if (begin >= txr->end || end < txr->begin) {
+                       txr = PMDK_SLIST_NEXT(txr, tx_range);
+                       continue;
+               }
+
+               LOG(4, "detected PMEM lock in undo log; "
+                       "range %p-%p, lock %p-%p",
+                       txr->begin, txr->end, begin, end);
+
+               /* split the range into new ones */
+               if (begin > txr->begin) {
+                       struct tx_range_data *txrn = Malloc(sizeof(*txrn));
+                       if (txrn == NULL)
+                               /* we can't do it any other way */
+                               FATAL("!Malloc");
+
+                       txrn->begin = txr->begin;
+                       txrn->end = begin;
+                       LOG(4, "range split; %p-%p", txrn->begin, txrn->end);
+                       PMDK_SLIST_INSERT_HEAD(tx_ranges, txrn, tx_range);
+               }
+
+               if (end < txr->end) {
+                       struct tx_range_data *txrn = Malloc(sizeof(*txrn));
+                       if (txrn == NULL)
+                               /* we can't do it any other way */
+                               FATAL("!Malloc");
+
+                       txrn->begin = end;
+                       txrn->end = txr->end;
+                       LOG(4, "range split; %p-%p", txrn->begin, txrn->end);
+                       PMDK_SLIST_INSERT_HEAD(tx_ranges, txrn, tx_range);
+               }
+
+               struct tx_range_data *next = PMDK_SLIST_NEXT(txr, tx_range);
+               /* remove the original range from the list */
+               PMDK_SLIST_REMOVE(tx_ranges, txr, tx_range_data, tx_range);
+               Free(txr);
+
+               txr = next;
+       }
+}
+/*
+ * tx_restore_range -- (internal) restore a single range from undo log
+ *
+ * If the snapshot contains any PMEM locks that are held by the current
+ * transaction, they won't be overwritten with the saved data to avoid changing
+ * their state.  Those locks will be released in tx_end().
+ */
+static void
+tx_restore_range(PMEMobjpool *pop, struct tx *tx, struct ulog_entry_buf *range)
+{
+       COMPILE_ERROR_ON(sizeof(PMEMmutex) != _POBJ_CL_SIZE);
+       COMPILE_ERROR_ON(sizeof(PMEMrwlock) != _POBJ_CL_SIZE);
+       COMPILE_ERROR_ON(sizeof(PMEMcond) != _POBJ_CL_SIZE);
+
+       struct txr tx_ranges;
+       PMDK_SLIST_INIT(&tx_ranges);
+
+       struct tx_range_data *txr;
+       txr = Malloc(sizeof(*txr));
+       if (txr == NULL) {
+               /* we can't do it any other way */
+               FATAL("!Malloc");
+       }
+
+       uint64_t range_offset = ulog_entry_offset(&range->base);
+
+       txr->begin = OBJ_OFF_TO_PTR(pop, range_offset);
+       txr->end = (char *)txr->begin + range->size;
+       PMDK_SLIST_INSERT_HEAD(&tx_ranges, txr, tx_range);
+
+       struct tx_lock_data *txl;
+
+       /* check if there are any locks within given memory range */
+       PMDK_SLIST_FOREACH(txl, &tx->tx_locks, tx_lock) {
+               void *lock_begin = txl->lock.mutex;
+               /* all PMEM locks have the same size */
+               void *lock_end = (char *)lock_begin + _POBJ_CL_SIZE;
+
+               tx_remove_range(&tx_ranges, lock_begin, lock_end);
+       }
+
+       ASSERT(!PMDK_SLIST_EMPTY(&tx_ranges));
+
+       void *dst_ptr = OBJ_OFF_TO_PTR(pop, range_offset);
+
+       while (!PMDK_SLIST_EMPTY(&tx_ranges)) {
+               txr = PMDK_SLIST_FIRST(&tx_ranges);
+               PMDK_SLIST_REMOVE_HEAD(&tx_ranges, tx_range);
+               /* restore partial range data from snapshot */
+               ASSERT((char *)txr->begin >= (char *)dst_ptr);
+               uint8_t *src = &range->data[
+                               (char *)txr->begin - (char *)dst_ptr];
+               ASSERT((char *)txr->end >= (char *)txr->begin);
+               size_t size = (size_t)((char *)txr->end - (char *)txr->begin);
+               pmemops_memcpy(&pop->p_ops, txr->begin, src, size, 0);
+               Free(txr);
+       }
+}
+
+/*
+ * tx_undo_entry_apply -- applies modifications of a single ulog entry
+ */
+static int
+tx_undo_entry_apply(struct ulog_entry_base *e, void *arg,
+       const struct pmem_ops *p_ops)
+{
+       struct ulog_entry_buf *eb;
+
+       switch (ulog_entry_type(e)) {
+               case ULOG_OPERATION_BUF_CPY:
+                       eb = (struct ulog_entry_buf *)e;
+
+                       tx_restore_range(p_ops->base, get_tx(), eb);
+               break;
+               case ULOG_OPERATION_AND:
+               case ULOG_OPERATION_OR:
+               case ULOG_OPERATION_SET:
+               case ULOG_OPERATION_BUF_SET:
+               default:
+                       ASSERT(0);
+       }
+
+       return 0;
+}
+
+/*
+ * tx_abort_set -- (internal) abort all set operations
+ */
+static void
+tx_abort_set(PMEMobjpool *pop, struct lane *lane)
+{
+       LOG(7, NULL);
+
+       ulog_foreach_entry((struct ulog *)&lane->layout->undo,
+               tx_undo_entry_apply, NULL, &pop->p_ops);
+       pmemops_drain(&pop->p_ops);
+       operation_finish(lane->undo, ULOG_INC_FIRST_GEN_NUM);
+}
+
+/*
+ * tx_flush_range -- (internal) flush one range
+ */
+static void
+tx_flush_range(void *data, void *ctx)
+{
+       PMEMobjpool *pop = ctx;
+       struct tx_range_def *range = data;
+       if (!(range->flags & POBJ_FLAG_NO_FLUSH)) {
+               pmemops_xflush(&pop->p_ops, OBJ_OFF_TO_PTR(pop, range->offset),
+                               range->size, PMEMOBJ_F_RELAXED);
+       }
+       VALGRIND_REMOVE_FROM_TX(OBJ_OFF_TO_PTR(pop, range->offset),
+               range->size);
+}
+
+/*
+ * tx_clean_range -- (internal) clean one range
+ */
+static void
+tx_clean_range(void *data, void *ctx)
+{
+       PMEMobjpool *pop = ctx;
+       struct tx_range_def *range = data;
+       VALGRIND_REMOVE_FROM_TX(OBJ_OFF_TO_PTR(pop, range->offset),
+               range->size);
+       VALGRIND_SET_CLEAN(OBJ_OFF_TO_PTR(pop, range->offset), range->size);
+}
+
+/*
+ * tx_pre_commit -- (internal) do pre-commit operations
+ */
+static void
+tx_pre_commit(struct tx *tx)
+{
+       LOG(5, NULL);
+
+       /* Flush all regions and destroy the whole tree. */
+       ravl_delete_cb(tx->ranges, tx_flush_range, tx->pop);
+       tx->ranges = NULL;
+}
+
+/*
+ * tx_abort -- (internal) abort all allocated objects
+ */
+static void
+tx_abort(PMEMobjpool *pop, struct lane *lane)
+{
+       LOG(7, NULL);
+
+       struct tx *tx = get_tx();
+
+       tx_abort_set(pop, lane);
+
+       ravl_delete_cb(tx->ranges, tx_clean_range, pop);
+       palloc_cancel(&pop->heap,
+               VEC_ARR(&tx->actions), VEC_SIZE(&tx->actions));
+       tx->ranges = NULL;
+}
+
+/*
+ * tx_get_pop -- returns the current transaction's pool handle, NULL if not
+ * within a transaction.
+ */
+PMEMobjpool *
+tx_get_pop(void)
+{
+       return get_tx()->pop;
+}
+
+/*
+ * add_to_tx_and_lock -- (internal) add lock to the transaction and acquire it
+ */
+static int
+add_to_tx_and_lock(struct tx *tx, enum pobj_tx_param type, void *lock)
+{
+       LOG(15, NULL);
+
+       int retval = 0;
+       struct tx_lock_data *txl;
+       /* check if the lock is already on the list */
+       PMDK_SLIST_FOREACH(txl, &tx->tx_locks, tx_lock) {
+               if (memcmp(&txl->lock, &lock, sizeof(lock)) == 0)
+                       return 0;
+       }
+
+       txl = Malloc(sizeof(*txl));
+       if (txl == NULL)
+               return ENOMEM;
+
+       txl->lock_type = type;
+       switch (txl->lock_type) {
+               case TX_PARAM_MUTEX:
+                       txl->lock.mutex = lock;
+                       retval = pmemobj_mutex_lock(tx->pop,
+                               txl->lock.mutex);
+                       if (retval) {
+                               ERR("!pmemobj_mutex_lock");
+                               goto err;
+                       }
+                       break;
+               case TX_PARAM_RWLOCK:
+                       txl->lock.rwlock = lock;
+                       retval = pmemobj_rwlock_wrlock(tx->pop,
+                               txl->lock.rwlock);
+                       if (retval) {
+                               ERR("!pmemobj_rwlock_wrlock");
+                               goto err;
+                       }
+                       break;
+               default:
+                       ERR("Unrecognized lock type");
+                       ASSERT(0);
+                       break;
+       }
+
+       PMDK_SLIST_INSERT_HEAD(&tx->tx_locks, txl, tx_lock);
+       return 0;
+
+err:
+       errno = retval;
+       Free(txl);
+
+       return retval;
+}
+
+/*
+ * release_and_free_tx_locks -- (internal) release and remove all locks from the
+ *                             transaction
+ */
+static void
+release_and_free_tx_locks(struct tx *tx)
+{
+       LOG(15, NULL);
+
+       while (!PMDK_SLIST_EMPTY(&tx->tx_locks)) {
+               struct tx_lock_data *tx_lock = PMDK_SLIST_FIRST(&tx->tx_locks);
+               PMDK_SLIST_REMOVE_HEAD(&tx->tx_locks, tx_lock);
+               switch (tx_lock->lock_type) {
+                       case TX_PARAM_MUTEX:
+                               pmemobj_mutex_unlock(tx->pop,
+                                       tx_lock->lock.mutex);
+                               break;
+                       case TX_PARAM_RWLOCK:
+                               pmemobj_rwlock_unlock(tx->pop,
+                                       tx_lock->lock.rwlock);
+                               break;
+                       default:
+                               ERR("Unrecognized lock type");
+                               ASSERT(0);
+                               break;
+               }
+               Free(tx_lock);
+       }
+}
+
+/*
+ * tx_lane_ranges_insert_def -- (internal) allocates and inserts a new range
+ *     definition into the ranges tree
+ */
+static int
+tx_lane_ranges_insert_def(PMEMobjpool *pop, struct tx *tx,
+       const struct tx_range_def *rdef)
+{
+       LOG(3, "rdef->offset %"PRIu64" rdef->size %"PRIu64,
+               rdef->offset, rdef->size);
+
+       int ret = ravl_emplace_copy(tx->ranges, rdef);
+       if (ret && errno == EEXIST)
+               FATAL("invalid state of ranges tree");
+       return ret;
+}
+
+/*
+ * tx_alloc_common -- (internal) common function for alloc and zalloc
+ */
+static PMEMoid
+tx_alloc_common(struct tx *tx, size_t size, type_num_t type_num,
+               palloc_constr constructor, struct tx_alloc_args args)
+{
+       LOG(3, NULL);
+
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               return obj_tx_fail_null(ENOMEM, args.flags);
+       }
+
+       PMEMobjpool *pop = tx->pop;
+
+       struct pobj_action *action = tx_action_add(tx);
+       if (action == NULL)
+               return obj_tx_fail_null(ENOMEM, args.flags);
+
+       if (palloc_reserve(&pop->heap, size, constructor, &args, type_num, 0,
+               CLASS_ID_FROM_FLAG(args.flags),
+               ARENA_ID_FROM_FLAG(args.flags), action) != 0)
+               goto err_oom;
+
+       /* allocate object to undo log */
+       PMEMoid retoid = OID_NULL;
+       retoid.off = action->heap.offset;
+       retoid.pool_uuid_lo = pop->uuid_lo;
+       size = action->heap.usable_size;
+
+       const struct tx_range_def r = {retoid.off, size, args.flags};
+       if (tx_lane_ranges_insert_def(pop, tx, &r) != 0)
+               goto err_oom;
+
+       return retoid;
+
+err_oom:
+       tx_action_remove(tx);
+       ERR("out of memory");
+       return obj_tx_fail_null(ENOMEM, args.flags);
+}
+
+/*
+ * tx_realloc_common -- (internal) common function for tx realloc
+ */
+static PMEMoid
+tx_realloc_common(struct tx *tx, PMEMoid oid, size_t size, uint64_t type_num,
+       palloc_constr constructor_alloc,
+       palloc_constr constructor_realloc,
+       uint64_t flags)
+{
+       LOG(3, NULL);
+
+       if (size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("requested size too large");
+               return obj_tx_fail_null(ENOMEM, flags);
+       }
+
+       /* if oid is NULL just alloc */
+       if (OBJ_OID_IS_NULL(oid))
+               return tx_alloc_common(tx, size, (type_num_t)type_num,
+                               constructor_alloc, ALLOC_ARGS(flags));
+
+       ASSERT(OBJ_OID_IS_VALID(tx->pop, oid));
+
+       /* if size is 0 just free */
+       if (size == 0) {
+               if (pmemobj_tx_free(oid)) {
+                       ERR("pmemobj_tx_free failed");
+                       return oid;
+               } else {
+                       return OID_NULL;
+               }
+       }
+
+       /* oid is not NULL and size is not 0 so do realloc by alloc and free */
+       void *ptr = OBJ_OFF_TO_PTR(tx->pop, oid.off);
+       size_t old_size = palloc_usable_size(&tx->pop->heap, oid.off);
+
+       size_t copy_size = old_size < size ? old_size : size;
+
+       PMEMoid new_obj = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_realloc, COPY_ARGS(flags, ptr, copy_size));
+
+       if (!OBJ_OID_IS_NULL(new_obj)) {
+               if (pmemobj_tx_free(oid)) {
+                       ERR("pmemobj_tx_free failed");
+                       VEC_POP_BACK(&tx->actions);
+                       return OID_NULL;
+               }
+       }
+
+       return new_obj;
+}
+
+/*
+ * tx_construct_user_buffer -- add user buffer to the ulog
+ */
+static int
+tx_construct_user_buffer(struct tx *tx, void *addr, size_t size,
+               enum pobj_log_type type, int outer_tx, uint64_t flags)
+{
+       if (tx->pop != pmemobj_pool_by_ptr(addr)) {
+               ERR("Buffer from a different pool");
+               goto err;
+       }
+
+       /*
+        * We want to extend a log of a specified type, but if it is
+        * an outer transaction and the first user buffer we need to
+        * free all logs except the first at the beginning.
+        */
+       struct operation_context *ctx = type == TX_LOG_TYPE_INTENT ?
+               tx->lane->external : tx->lane->undo;
+
+       if (outer_tx && !operation_get_any_user_buffer(ctx))
+               operation_free_logs(ctx, ULOG_ANY_USER_BUFFER);
+
+       struct user_buffer_def userbuf = {addr, size};
+       if (operation_user_buffer_verify_align(ctx, &userbuf) != 0)
+               goto err;
+
+       if (type == TX_LOG_TYPE_INTENT) {
+               /*
+                * Redo log context is not used until transaction commit and
+                * cannot be used until then, and so the user buffers have to
+                * be stored and added the operation at commit time.
+                * This is because atomic operations can executed independently
+                * in the same lane as a running transaction.
+                */
+               if (VEC_PUSH_BACK(&tx->redo_userbufs, userbuf) != 0)
+                       goto err;
+               tx->redo_userbufs_capacity +=
+                       userbuf.size - TX_INTENT_LOG_BUFFER_OVERHEAD;
+       } else {
+               operation_add_user_buffer(ctx, &userbuf);
+       }
+
+       return 0;
+
+err:
+       return obj_tx_fail_err(EINVAL, flags);
+}
+
+/*
+ * pmemobj_tx_begin -- initializes new transaction
+ */
+int
+pmemobj_tx_begin(PMEMobjpool *pop, jmp_buf env, ...)
+{
+       LOG(3, NULL);
+
+       int err = 0;
+       struct tx *tx = get_tx();
+
+       enum pobj_tx_failure_behavior failure_behavior = POBJ_TX_FAILURE_ABORT;
+
+       if (tx->stage == TX_STAGE_WORK) {
+               ASSERTne(tx->lane, NULL);
+               if (tx->pop != pop) {
+                       ERR("nested transaction for different pool");
+                       return obj_tx_fail_err(EINVAL, 0);
+               }
+
+               /* inherits this value from the parent transaction */
+               struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+               failure_behavior = txd->failure_behavior;
+
+               VALGRIND_START_TX;
+       } else if (tx->stage == TX_STAGE_NONE) {
+               VALGRIND_START_TX;
+
+               lane_hold(pop, &tx->lane);
+               operation_start(tx->lane->undo);
+
+               VEC_INIT(&tx->actions);
+               VEC_INIT(&tx->redo_userbufs);
+               tx->redo_userbufs_capacity = 0;
+               PMDK_SLIST_INIT(&tx->tx_entries);
+               PMDK_SLIST_INIT(&tx->tx_locks);
+
+               tx->ranges = ravl_new_sized(tx_range_def_cmp,
+                       sizeof(struct tx_range_def));
+
+               tx->pop = pop;
+
+               tx->first_snapshot = 1;
+
+               tx->user_data = NULL;
+       } else {
+               FATAL("Invalid stage %d to begin new transaction", tx->stage);
+       }
+
+       struct tx_data *txd = Malloc(sizeof(*txd));
+       if (txd == NULL) {
+               err = errno;
+               ERR("!Malloc");
+               goto err_abort;
+       }
+
+       tx->last_errnum = 0;
+       if (env != NULL)
+               memcpy(txd->env, env, sizeof(jmp_buf));
+       else
+               memset(txd->env, 0, sizeof(jmp_buf));
+
+       txd->failure_behavior = failure_behavior;
+
+       PMDK_SLIST_INSERT_HEAD(&tx->tx_entries, txd, tx_entry);
+
+       tx->stage = TX_STAGE_WORK;
+
+       /* handle locks */
+       va_list argp;
+       va_start(argp, env);
+       enum pobj_tx_param param_type;
+
+       while ((param_type = va_arg(argp, enum pobj_tx_param)) !=
+                       TX_PARAM_NONE) {
+               if (param_type == TX_PARAM_CB) {
+                       pmemobj_tx_callback cb =
+                                       va_arg(argp, pmemobj_tx_callback);
+                       void *arg = va_arg(argp, void *);
+
+                       if (tx->stage_callback &&
+                                       (tx->stage_callback != cb ||
+                                       tx->stage_callback_arg != arg)) {
+                               FATAL("transaction callback is already set, "
+                                       "old %p new %p old_arg %p new_arg %p",
+                                       tx->stage_callback, cb,
+                                       tx->stage_callback_arg, arg);
+                       }
+
+                       tx->stage_callback = cb;
+                       tx->stage_callback_arg = arg;
+               } else {
+                       err = add_to_tx_and_lock(tx, param_type,
+                               va_arg(argp, void *));
+                       if (err) {
+                               va_end(argp);
+                               goto err_abort;
+                       }
+               }
+       }
+       va_end(argp);
+
+       ASSERT(err == 0);
+       return 0;
+
+err_abort:
+       if (tx->stage == TX_STAGE_WORK)
+               obj_tx_abort(err, 0);
+       else
+               tx->stage = TX_STAGE_ONABORT;
+       return err;
+}
+
+/*
+ * tx_abort_on_failure_flag -- (internal) return 0 or POBJ_FLAG_TX_NO_ABORT
+ * based on transaction setting
+ */
+static uint64_t
+tx_abort_on_failure_flag(struct tx *tx)
+{
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       if (txd->failure_behavior == POBJ_TX_FAILURE_RETURN)
+               return POBJ_FLAG_TX_NO_ABORT;
+       return 0;
+}
+
+/*
+ * pmemobj_tx_xlock -- get lane from pool and add lock to transaction,
+ * with no_abort option
+ */
+int
+pmemobj_tx_xlock(enum pobj_tx_param type, void *lockp, uint64_t flags)
+{
+       struct tx *tx = get_tx();
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XLOCK_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_XLOCK_VALID_FLAGS);
+               return obj_tx_fail_err(EINVAL, flags);
+       }
+
+       int ret = add_to_tx_and_lock(tx, type, lockp);
+       if (ret)
+               return obj_tx_fail_err(ret, flags);
+       return 0;
+}
+
+/*
+ * pmemobj_tx_lock -- get lane from pool and add lock to transaction.
+ */
+int
+pmemobj_tx_lock(enum pobj_tx_param type, void *lockp)
+{
+       return pmemobj_tx_xlock(type, lockp, POBJ_XLOCK_NO_ABORT);
+}
+
+/*
+ * obj_tx_callback -- (internal) executes callback associated with current stage
+ */
+static void
+obj_tx_callback(struct tx *tx)
+{
+       if (!tx->stage_callback)
+               return;
+
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       /* is this the outermost transaction? */
+       if (PMDK_SLIST_NEXT(txd, tx_entry) == NULL)
+               tx->stage_callback(tx->pop, tx->stage, tx->stage_callback_arg);
+}
+
+/*
+ * pmemobj_tx_stage -- returns current transaction stage
+ */
+enum pobj_tx_stage
+pmemobj_tx_stage(void)
+{
+       LOG(3, NULL);
+
+       return get_tx()->stage;
+}
+
+/*
+ * obj_tx_abort -- aborts current transaction
+ */
+static void
+obj_tx_abort(int errnum, int user)
+{
+       LOG(3, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       ASSERT(tx->lane != NULL);
+
+       if (errnum == 0)
+               errnum = ECANCELED;
+
+       tx->stage = TX_STAGE_ONABORT;
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       if (PMDK_SLIST_NEXT(txd, tx_entry) == NULL) {
+               /* this is the outermost transaction */
+
+               /* process the undo log */
+               tx_abort(tx->pop, tx->lane);
+
+               lane_release(tx->pop);
+               tx->lane = NULL;
+       }
+
+       tx->last_errnum = errnum;
+       errno = errnum;
+       if (user)
+               ERR("!explicit transaction abort");
+
+       /* ONABORT */
+       obj_tx_callback(tx);
+
+       if (!util_is_zeroed(txd->env, sizeof(jmp_buf)))
+               longjmp(txd->env, errnum);
+}
+
+/*
+ * pmemobj_tx_abort -- aborts current transaction
+ *
+ * Note: this function should not be called from inside of pmemobj.
+ */
+void
+pmemobj_tx_abort(int errnum)
+{
+       PMEMOBJ_API_START();
+       obj_tx_abort(errnum, 1);
+       PMEMOBJ_API_END();
+}
+
+/*
+ * pmemobj_tx_errno -- returns last transaction error code
+ */
+int
+pmemobj_tx_errno(void)
+{
+       LOG(3, NULL);
+
+       return get_tx()->last_errnum;
+}
+
+static void
+tx_post_commit(struct tx *tx)
+{
+       operation_finish(tx->lane->undo, 0);
+}
+
+/*
+ * pmemobj_tx_commit -- commits current transaction
+ */
+void
+pmemobj_tx_commit(void)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       /* WORK */
+       obj_tx_callback(tx);
+
+       ASSERT(tx->lane != NULL);
+
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       if (PMDK_SLIST_NEXT(txd, tx_entry) == NULL) {
+               /* this is the outermost transaction */
+
+               PMEMobjpool *pop = tx->pop;
+
+               /* pre-commit phase */
+               tx_pre_commit(tx);
+
+               pmemops_drain(&pop->p_ops);
+
+               operation_start(tx->lane->external);
+
+               struct user_buffer_def *userbuf;
+               VEC_FOREACH_BY_PTR(userbuf, &tx->redo_userbufs)
+                       operation_add_user_buffer(tx->lane->external, userbuf);
+
+               palloc_publish(&pop->heap, VEC_ARR(&tx->actions),
+                       VEC_SIZE(&tx->actions), tx->lane->external);
+
+               tx_post_commit(tx);
+
+               lane_release(pop);
+
+               tx->lane = NULL;
+       }
+
+       tx->stage = TX_STAGE_ONCOMMIT;
+
+       /* ONCOMMIT */
+       obj_tx_callback(tx);
+       PMEMOBJ_API_END();
+}
+
+/*
+ * pmemobj_tx_end -- ends current transaction
+ */
+int
+pmemobj_tx_end(void)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       if (tx->stage == TX_STAGE_WORK)
+               FATAL("pmemobj_tx_end called without pmemobj_tx_commit");
+
+       if (tx->pop == NULL)
+               FATAL("pmemobj_tx_end called without pmemobj_tx_begin");
+
+       if (tx->stage_callback &&
+                       (tx->stage == TX_STAGE_ONCOMMIT ||
+                       tx->stage == TX_STAGE_ONABORT)) {
+               tx->stage = TX_STAGE_FINALLY;
+               obj_tx_callback(tx);
+       }
+
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+       PMDK_SLIST_REMOVE_HEAD(&tx->tx_entries, tx_entry);
+
+       Free(txd);
+
+       VALGRIND_END_TX;
+
+       if (PMDK_SLIST_EMPTY(&tx->tx_entries)) {
+               ASSERTeq(tx->lane, NULL);
+
+               release_and_free_tx_locks(tx);
+               tx->pop = NULL;
+               tx->stage = TX_STAGE_NONE;
+               VEC_DELETE(&tx->actions);
+               VEC_DELETE(&tx->redo_userbufs);
+
+               if (tx->stage_callback) {
+                       pmemobj_tx_callback cb = tx->stage_callback;
+                       void *arg = tx->stage_callback_arg;
+
+                       tx->stage_callback = NULL;
+                       tx->stage_callback_arg = NULL;
+
+                       cb(tx->pop, TX_STAGE_NONE, arg);
+               }
+       } else {
+               /* resume the next transaction */
+               tx->stage = TX_STAGE_WORK;
+
+               /* abort called within inner transaction, waterfall the error */
+               if (tx->last_errnum)
+                       obj_tx_abort(tx->last_errnum, 0);
+       }
+
+       return tx->last_errnum;
+}
+
+/*
+ * pmemobj_tx_process -- processes current transaction stage
+ */
+void
+pmemobj_tx_process(void)
+{
+       LOG(5, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+
+       switch (tx->stage) {
+       case TX_STAGE_NONE:
+               break;
+       case TX_STAGE_WORK:
+               pmemobj_tx_commit();
+               break;
+       case TX_STAGE_ONABORT:
+       case TX_STAGE_ONCOMMIT:
+               tx->stage = TX_STAGE_FINALLY;
+               obj_tx_callback(tx);
+               break;
+       case TX_STAGE_FINALLY:
+               tx->stage = TX_STAGE_NONE;
+               break;
+       default:
+               ASSERT(0);
+       }
+}
+
+/*
+ * vg_verify_initialized -- when executed under Valgrind verifies that
+ *   the buffer has been initialized; explicit check at snapshotting time,
+ *   because Valgrind may find it much later when it's impossible to tell
+ *   for which snapshot it triggered
+ */
+static void
+vg_verify_initialized(PMEMobjpool *pop, const struct tx_range_def *def)
+{
+#if VG_MEMCHECK_ENABLED
+       if (!On_memcheck)
+               return;
+
+       VALGRIND_DO_DISABLE_ERROR_REPORTING;
+       char *start = (char *)pop + def->offset;
+       char *uninit = (char *)VALGRIND_CHECK_MEM_IS_DEFINED(start, def->size);
+       if (uninit) {
+               VALGRIND_PRINTF(
+                       "Snapshotting uninitialized data in range <%p,%p> (<offset:0x%lx,size:0x%lx>)\n",
+                       start, start + def->size, def->offset, def->size);
+
+               if (uninit != start)
+                       VALGRIND_PRINTF("Uninitialized data starts at: %p\n",
+                                       uninit);
+
+               VALGRIND_DO_ENABLE_ERROR_REPORTING;
+               VALGRIND_CHECK_MEM_IS_DEFINED(start, def->size);
+       } else {
+               VALGRIND_DO_ENABLE_ERROR_REPORTING;
+       }
+#endif
+}
+
+/*
+ * pmemobj_tx_add_snapshot -- (internal) creates a variably sized snapshot
+ */
+static int
+pmemobj_tx_add_snapshot(struct tx *tx, struct tx_range_def *snapshot)
+{
+       /*
+        * Depending on the size of the block, either allocate an
+        * entire new object or use cache.
+        */
+       void *ptr = OBJ_OFF_TO_PTR(tx->pop, snapshot->offset);
+
+       VALGRIND_ADD_TO_TX(ptr, snapshot->size);
+
+       /* do nothing */
+       if (snapshot->flags & POBJ_XADD_NO_SNAPSHOT)
+               return 0;
+
+       if (!(snapshot->flags & POBJ_XADD_ASSUME_INITIALIZED))
+               vg_verify_initialized(tx->pop, snapshot);
+
+       /*
+        * If we are creating the first snapshot, setup a redo log action to
+        * increment counter in the undo log, so that the log becomes
+        * invalid once the redo log is processed.
+        */
+       if (tx->first_snapshot) {
+               struct pobj_action *action = tx_action_add(tx);
+               if (action == NULL)
+                       return -1;
+
+               uint64_t *n = &tx->lane->layout->undo.gen_num;
+               palloc_set_value(&tx->pop->heap, action,
+                       n, *n + 1);
+
+               tx->first_snapshot = 0;
+       }
+
+       return operation_add_buffer(tx->lane->undo, ptr, ptr, snapshot->size,
+               ULOG_OPERATION_BUF_CPY);
+}
+
+/*
+ * pmemobj_tx_merge_flags -- (internal) common code for merging flags between
+ * two ranges to ensure resultant behavior is correct
+ */
+static void
+pmemobj_tx_merge_flags(struct tx_range_def *dest, struct tx_range_def *merged)
+{
+       /*
+        * POBJ_XADD_NO_FLUSH should only be set in merged range if set in
+        * both ranges
+        */
+       if ((dest->flags & POBJ_XADD_NO_FLUSH) &&
+                               !(merged->flags & POBJ_XADD_NO_FLUSH)) {
+               dest->flags = dest->flags & (~POBJ_XADD_NO_FLUSH);
+       }
+}
+
+/*
+ * pmemobj_tx_add_common -- (internal) common code for adding persistent memory
+ * into the transaction
+ */
+static int
+pmemobj_tx_add_common(struct tx *tx, struct tx_range_def *args)
+{
+       LOG(15, NULL);
+
+       if (args->size > PMEMOBJ_MAX_ALLOC_SIZE) {
+               ERR("snapshot size too large");
+               return obj_tx_fail_err(EINVAL, args->flags);
+       }
+
+       if (args->offset < tx->pop->heap_offset ||
+               (args->offset + args->size) >
+               (tx->pop->heap_offset + tx->pop->heap_size)) {
+               ERR("object outside of heap");
+               return obj_tx_fail_err(EINVAL, args->flags);
+       }
+
+       int ret = 0;
+
+       /*
+        * Search existing ranges backwards starting from the end of the
+        * snapshot.
+        */
+       struct tx_range_def r = *args;
+       struct tx_range_def search = {0, 0, 0};
+       /*
+        * If the range is directly adjacent to an existing one,
+        * they can be merged, so search for less or equal elements.
+        */
+       enum ravl_predicate p = RAVL_PREDICATE_LESS_EQUAL;
+       struct ravl_node *nprev = NULL;
+       while (r.size != 0) {
+               search.offset = r.offset + r.size;
+               struct ravl_node *n = ravl_find(tx->ranges, &search, p);
+               /*
+                * We have to skip searching for LESS_EQUAL because
+                * the snapshot we would find is the one that was just
+                * created.
+                */
+               p = RAVL_PREDICATE_LESS;
+
+               struct tx_range_def *f = n ? ravl_data(n) : NULL;
+
+               size_t fend = f == NULL ? 0: f->offset + f->size;
+               size_t rend = r.offset + r.size;
+               if (fend == 0 || fend < r.offset) {
+                       /*
+                        * If found no range or the found range is not
+                        * overlapping or adjacent on the left side, we can just
+                        * create the entire r.offset + r.size snapshot.
+                        *
+                        * Snapshot:
+                        *      --+-
+                        * Existing ranges:
+                        *      ---- (no ranges)
+                        * or   +--- (no overlap)
+                        * or   ---+ (adjacent on on right side)
+                        */
+                       if (nprev != NULL) {
+                               /*
+                                * But, if we have an existing adjacent snapshot
+                                * on the right side, we can just extend it to
+                                * include the desired range.
+                                */
+                               struct tx_range_def *fprev = ravl_data(nprev);
+                               ASSERTeq(rend, fprev->offset);
+                               fprev->offset -= r.size;
+                               fprev->size += r.size;
+                       } else {
+                               /*
+                                * If we don't have anything adjacent, create
+                                * a new range in the tree.
+                                */
+                               ret = tx_lane_ranges_insert_def(tx->pop,
+                                       tx, &r);
+                               if (ret != 0)
+                                       break;
+                       }
+                       ret = pmemobj_tx_add_snapshot(tx, &r);
+                       break;
+               } else if (fend <= rend) {
+                       /*
+                        * If found range has its end inside of the desired
+                        * snapshot range, we can extend the found range by the
+                        * size leftover on the left side.
+                        *
+                        * Snapshot:
+                        *      --+++--
+                        * Existing ranges:
+                        *      +++---- (overlap on left)
+                        * or   ---+--- (found snapshot is inside)
+                        * or   ---+-++ (inside, and adjacent on the right)
+                        * or   +++++-- (desired snapshot is inside)
+                        *
+                        */
+                       struct tx_range_def snapshot = *args;
+                       snapshot.offset = fend;
+                       /* the side not yet covered by an existing snapshot */
+                       snapshot.size = rend - fend;
+
+                       /* the number of bytes intersecting in both ranges */
+                       size_t intersection = fend - MAX(f->offset, r.offset);
+                       r.size -= intersection + snapshot.size;
+                       f->size += snapshot.size;
+                       pmemobj_tx_merge_flags(f, args);
+
+                       if (snapshot.size != 0) {
+                               ret = pmemobj_tx_add_snapshot(tx, &snapshot);
+                               if (ret != 0)
+                                       break;
+                       }
+
+                       /*
+                        * If there's a snapshot adjacent on right side, merge
+                        * the two ranges together.
+                        */
+                       if (nprev != NULL) {
+                               struct tx_range_def *fprev = ravl_data(nprev);
+                               ASSERTeq(rend, fprev->offset);
+                               f->size += fprev->size;
+                               pmemobj_tx_merge_flags(f, fprev);
+                               ravl_remove(tx->ranges, nprev);
+                       }
+               } else if (fend >= r.offset) {
+                       /*
+                        * If found range has its end extending beyond the
+                        * desired snapshot.
+                        *
+                        * Snapshot:
+                        *      --+++--
+                        * Existing ranges:
+                        *      -----++ (adjacent on the right)
+                        * or   ----++- (overlapping on the right)
+                        * or   ----+++ (overlapping and adjacent on the right)
+                        * or   --+++++ (desired snapshot is inside)
+                        *
+                        * Notice that we cannot create a snapshot based solely
+                        * on this information without risking overwriting an
+                        * existing one. We have to continue iterating, but we
+                        * keep the information about adjacent snapshots in the
+                        * nprev variable.
+                        */
+                       size_t overlap = rend - MAX(f->offset, r.offset);
+                       r.size -= overlap;
+                       pmemobj_tx_merge_flags(f, args);
+               } else {
+                       ASSERT(0);
+               }
+
+               nprev = n;
+       }
+
+       if (ret != 0) {
+               ERR("out of memory");
+               return obj_tx_fail_err(ENOMEM, args->flags);
+       }
+
+       return 0;
+}
+
+/*
+ * pmemobj_tx_add_range_direct -- adds persistent memory range into the
+ *                                     transaction
+ */
+int
+pmemobj_tx_add_range_direct(const void *ptr, size_t size)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       int ret;
+
+       uint64_t flags = tx_abort_on_failure_flag(tx);
+
+       if (!OBJ_PTR_FROM_POOL(tx->pop, ptr)) {
+               ERR("object outside of pool");
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       struct tx_range_def args = {
+               .offset = (uint64_t)((char *)ptr - (char *)tx->pop),
+               .size = size,
+               .flags = flags,
+       };
+
+       ret = pmemobj_tx_add_common(tx, &args);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_tx_xadd_range_direct -- adds persistent memory range into the
+ *                                     transaction
+ */
+int
+pmemobj_tx_xadd_range_direct(const void *ptr, size_t size, uint64_t flags)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       int ret;
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XADD_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64, flags
+                       & ~POBJ_XADD_VALID_FLAGS);
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       if (!OBJ_PTR_FROM_POOL(tx->pop, ptr)) {
+               ERR("object outside of pool");
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       struct tx_range_def args = {
+               .offset = (uint64_t)((char *)ptr - (char *)tx->pop),
+               .size = size,
+               .flags = flags,
+       };
+
+       ret = pmemobj_tx_add_common(tx, &args);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_tx_add_range -- adds persistent memory range into the transaction
+ */
+int
+pmemobj_tx_add_range(PMEMoid oid, uint64_t hoff, size_t size)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       int ret;
+
+       uint64_t flags = tx_abort_on_failure_flag(tx);
+
+       if (oid.pool_uuid_lo != tx->pop->uuid_lo) {
+               ERR("invalid pool uuid");
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+       ASSERT(OBJ_OID_IS_VALID(tx->pop, oid));
+
+       struct tx_range_def args = {
+               .offset = oid.off + hoff,
+               .size = size,
+               .flags = flags,
+       };
+
+       ret = pmemobj_tx_add_common(tx, &args);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_tx_xadd_range -- adds persistent memory range into the transaction
+ */
+int
+pmemobj_tx_xadd_range(PMEMoid oid, uint64_t hoff, size_t size, uint64_t flags)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       int ret;
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XADD_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64, flags
+                       & ~POBJ_XADD_VALID_FLAGS);
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       if (oid.pool_uuid_lo != tx->pop->uuid_lo) {
+               ERR("invalid pool uuid");
+               ret = obj_tx_fail_err(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+       ASSERT(OBJ_OID_IS_VALID(tx->pop, oid));
+
+       struct tx_range_def args = {
+               .offset = oid.off + hoff,
+               .size = size,
+               .flags = flags,
+       };
+
+       ret = pmemobj_tx_add_common(tx, &args);
+
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_tx_alloc -- allocates a new object
+ */
+PMEMoid
+pmemobj_tx_alloc(size_t size, uint64_t type_num)
+{
+       LOG(3, NULL);
+
+       PMEMOBJ_API_START();
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       uint64_t flags = tx_abort_on_failure_flag(tx);
+
+       PMEMoid oid;
+       if (size == 0) {
+               ERR("allocation with size 0");
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       oid = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_tx_alloc, ALLOC_ARGS(flags));
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_tx_zalloc -- allocates a new zeroed object
+ */
+PMEMoid
+pmemobj_tx_zalloc(size_t size, uint64_t type_num)
+{
+       LOG(3, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       uint64_t flags = POBJ_FLAG_ZERO;
+       flags |= tx_abort_on_failure_flag(tx);
+
+       PMEMOBJ_API_START();
+       PMEMoid oid;
+       if (size == 0) {
+               ERR("allocation with size 0");
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       oid = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_tx_alloc, ALLOC_ARGS(flags));
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_tx_xalloc -- allocates a new object
+ */
+PMEMoid
+pmemobj_tx_xalloc(size_t size, uint64_t type_num, uint64_t flags)
+{
+       LOG(3, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       PMEMOBJ_API_START();
+
+       PMEMoid oid;
+       if (size == 0) {
+               ERR("allocation with size 0");
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       if (flags & ~POBJ_TX_XALLOC_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64, flags
+                       & ~(POBJ_TX_XALLOC_VALID_FLAGS));
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       oid = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_tx_alloc, ALLOC_ARGS(flags));
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_tx_realloc -- resizes an existing object
+ */
+PMEMoid
+pmemobj_tx_realloc(PMEMoid oid, size_t size, uint64_t type_num)
+{
+       LOG(3, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       PMEMOBJ_API_START();
+       PMEMoid ret = tx_realloc_common(tx, oid, size, type_num,
+                       constructor_tx_alloc, constructor_tx_alloc, 0);
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_zrealloc -- resizes an existing object, any new space is zeroed.
+ */
+PMEMoid
+pmemobj_tx_zrealloc(PMEMoid oid, size_t size, uint64_t type_num)
+{
+       LOG(3, NULL);
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       PMEMOBJ_API_START();
+       PMEMoid ret = tx_realloc_common(tx, oid, size, type_num,
+                       constructor_tx_alloc, constructor_tx_alloc,
+                       POBJ_FLAG_ZERO);
+       PMEMOBJ_API_END();
+       return ret;
+}
+
+/*
+ * pmemobj_tx_xstrdup -- allocates a new object with duplicate of the string s.
+ */
+PMEMoid
+pmemobj_tx_xstrdup(const char *s, uint64_t type_num, uint64_t flags)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_TX_XALLOC_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_TX_XALLOC_VALID_FLAGS);
+               return obj_tx_fail_null(EINVAL, flags);
+       }
+
+       PMEMOBJ_API_START();
+       PMEMoid oid;
+       if (NULL == s) {
+               ERR("cannot duplicate NULL string");
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       size_t len = strlen(s);
+
+       if (len == 0) {
+               oid = tx_alloc_common(tx, sizeof(char), (type_num_t)type_num,
+                               constructor_tx_alloc,
+                       ALLOC_ARGS(POBJ_XALLOC_ZERO));
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       size_t size = (len + 1) * sizeof(char);
+
+       oid = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_tx_alloc, COPY_ARGS(flags, s, size));
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_tx_strdup -- allocates a new object with duplicate of the string s.
+ */
+PMEMoid
+pmemobj_tx_strdup(const char *s, uint64_t type_num)
+{
+       return pmemobj_tx_xstrdup(s, type_num, 0);
+}
+/*
+ * pmemobj_tx_xwcsdup -- allocates a new object with duplicate of the wide
+ * character string s.
+ */
+PMEMoid
+pmemobj_tx_xwcsdup(const wchar_t *s, uint64_t type_num, uint64_t flags)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_TX_XALLOC_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_TX_XALLOC_VALID_FLAGS);
+               return obj_tx_fail_null(EINVAL, flags);
+       }
+
+       PMEMOBJ_API_START();
+       PMEMoid oid;
+       if (NULL == s) {
+               ERR("cannot duplicate NULL string");
+               oid = obj_tx_fail_null(EINVAL, flags);
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       size_t len = wcslen(s);
+
+       if (len == 0) {
+               oid = tx_alloc_common(tx, sizeof(wchar_t),
+                               (type_num_t)type_num, constructor_tx_alloc,
+                               ALLOC_ARGS(POBJ_XALLOC_ZERO));
+               PMEMOBJ_API_END();
+               return oid;
+       }
+
+       size_t size = (len + 1) * sizeof(wchar_t);
+
+       oid = tx_alloc_common(tx, size, (type_num_t)type_num,
+                       constructor_tx_alloc, COPY_ARGS(flags, s, size));
+
+       PMEMOBJ_API_END();
+       return oid;
+}
+
+/*
+ * pmemobj_tx_wcsdup -- allocates a new object with duplicate of the wide
+ * character string s.
+ */
+PMEMoid
+pmemobj_tx_wcsdup(const wchar_t *s, uint64_t type_num)
+{
+       return pmemobj_tx_xwcsdup(s, type_num, 0);
+}
+
+/*
+ * pmemobj_tx_xfree -- frees an existing object, with no_abort option
+ */
+int
+pmemobj_tx_xfree(PMEMoid oid, uint64_t flags)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XFREE_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_XFREE_VALID_FLAGS);
+               return obj_tx_fail_err(EINVAL, flags);
+       }
+
+       if (OBJ_OID_IS_NULL(oid))
+               return 0;
+
+       PMEMobjpool *pop = tx->pop;
+
+       if (pop->uuid_lo != oid.pool_uuid_lo) {
+               ERR("invalid pool uuid");
+               return obj_tx_fail_err(EINVAL, flags);
+       }
+
+       ASSERT(OBJ_OID_IS_VALID(pop, oid));
+
+       PMEMOBJ_API_START();
+
+       struct pobj_action *action;
+
+       struct tx_range_def range = {oid.off, 0, 0};
+       struct ravl_node *n = ravl_find(tx->ranges, &range,
+               RAVL_PREDICATE_EQUAL);
+
+       /*
+        * If attempting to free an object allocated within the same
+        * transaction, simply cancel the alloc and remove it from the actions.
+        */
+       if (n != NULL) {
+               VEC_FOREACH_BY_PTR(action, &tx->actions) {
+                       if (action->type == POBJ_ACTION_TYPE_HEAP &&
+                               action->heap.offset == oid.off) {
+                               struct tx_range_def *r = ravl_data(n);
+                               void *ptr = OBJ_OFF_TO_PTR(pop, r->offset);
+                               VALGRIND_SET_CLEAN(ptr, r->size);
+                               VALGRIND_REMOVE_FROM_TX(ptr, r->size);
+                               ravl_remove(tx->ranges, n);
+                               palloc_cancel(&pop->heap, action, 1);
+                               VEC_ERASE_BY_PTR(&tx->actions, action);
+                               PMEMOBJ_API_END();
+                               return 0;
+                       }
+               }
+       }
+
+       action = tx_action_add(tx);
+       if (action == NULL) {
+               int ret = obj_tx_fail_err(errno, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       palloc_defer_free(&pop->heap, oid.off, action);
+
+       PMEMOBJ_API_END();
+       return 0;
+}
+
+/*
+ * pmemobj_tx_free -- frees an existing object
+ */
+int
+pmemobj_tx_free(PMEMoid oid)
+{
+       return pmemobj_tx_xfree(oid, 0);
+}
+
+/*
+ * pmemobj_tx_xpublish -- publishes actions inside of a transaction,
+ * with no_abort option
+ */
+int
+pmemobj_tx_xpublish(struct pobj_action *actv, size_t actvcnt, uint64_t flags)
+{
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XPUBLISH_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_XPUBLISH_VALID_FLAGS);
+               return obj_tx_fail_err(EINVAL, flags);
+       }
+
+       PMEMOBJ_API_START();
+
+       if (tx_action_reserve(tx, actvcnt) != 0) {
+               int ret = obj_tx_fail_err(ENOMEM, flags);
+               PMEMOBJ_API_END();
+               return ret;
+       }
+
+       for (size_t i = 0; i < actvcnt; ++i) {
+               VEC_PUSH_BACK(&tx->actions, actv[i]);
+       }
+
+       PMEMOBJ_API_END();
+       return 0;
+}
+
+/*
+ * pmemobj_tx_publish -- publishes actions inside of a transaction
+ */
+int
+pmemobj_tx_publish(struct pobj_action *actv, size_t actvcnt)
+{
+       return pmemobj_tx_xpublish(actv, actvcnt, 0);
+}
+
+/*
+ * pmemobj_tx_xlog_append_buffer -- append user allocated buffer to the ulog
+ */
+int
+pmemobj_tx_xlog_append_buffer(enum pobj_log_type type, void *addr, size_t size,
+               uint64_t flags)
+{
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       flags |= tx_abort_on_failure_flag(tx);
+
+       if (flags & ~POBJ_XLOG_APPEND_BUFFER_VALID_FLAGS) {
+               ERR("unknown flags 0x%" PRIx64,
+                               flags & ~POBJ_XLOG_APPEND_BUFFER_VALID_FLAGS);
+               return obj_tx_fail_err(EINVAL, flags);
+       }
+
+       PMEMOBJ_API_START();
+       int err;
+
+       struct tx_data *td = PMDK_SLIST_FIRST(&tx->tx_entries);
+       err = tx_construct_user_buffer(tx, addr, size, type,
+                       PMDK_SLIST_NEXT(td, tx_entry) == NULL, flags);
+
+       PMEMOBJ_API_END();
+       return err;
+}
+
+/*
+ * pmemobj_tx_log_append_buffer -- append user allocated buffer to the ulog
+ */
+int
+pmemobj_tx_log_append_buffer(enum pobj_log_type type, void *addr, size_t size)
+{
+       return pmemobj_tx_xlog_append_buffer(type, addr, size, 0);
+}
+
+/*
+ * pmemobj_tx_log_auto_alloc -- enable/disable automatic ulog allocation
+ */
+int
+pmemobj_tx_log_auto_alloc(enum pobj_log_type type, int on_off)
+{
+       struct tx *tx = get_tx();
+       ASSERT_TX_STAGE_WORK(tx);
+
+       struct operation_context *ctx = type == TX_LOG_TYPE_INTENT ?
+               tx->lane->external : tx->lane->undo;
+
+       operation_set_auto_reserve(ctx, on_off);
+
+       return 0;
+}
+
+/*
+ * pmemobj_tx_log_snapshots_max_size -- calculates the maximum
+ * size of a buffer which will be able to hold nsizes snapshots,
+ * each of size from sizes array
+ */
+size_t
+pmemobj_tx_log_snapshots_max_size(size_t *sizes, size_t nsizes)
+{
+       LOG(3, NULL);
+
+       /* each buffer has its header */
+       size_t result = TX_SNAPSHOT_LOG_BUFFER_OVERHEAD;
+       for (size_t i = 0; i < nsizes; ++i) {
+               /* check for overflow */
+               if (sizes[i] + TX_SNAPSHOT_LOG_ENTRY_OVERHEAD +
+                               TX_SNAPSHOT_LOG_ENTRY_ALIGNMENT < sizes[i])
+                       goto err_overflow;
+               /* each entry has its header */
+               size_t size =
+                       ALIGN_UP(sizes[i] + TX_SNAPSHOT_LOG_ENTRY_OVERHEAD,
+                               TX_SNAPSHOT_LOG_ENTRY_ALIGNMENT);
+               /* check for overflow */
+               if (result + size < result)
+                       goto err_overflow;
+               /* sum up */
+               result += size;
+       }
+
+       /*
+        * if the result is bigger than a single allocation it must be divided
+        * into multiple allocations where each of them will have its own buffer
+        * header and entry header
+        */
+       size_t allocs_overhead = (result / PMEMOBJ_MAX_ALLOC_SIZE) *
+           (TX_SNAPSHOT_LOG_BUFFER_OVERHEAD + TX_SNAPSHOT_LOG_ENTRY_OVERHEAD);
+       /* check for overflow */
+       if (result + allocs_overhead < result)
+               goto err_overflow;
+       result += allocs_overhead;
+
+       /* SIZE_MAX is a special value */
+       if (result == SIZE_MAX)
+               goto err_overflow;
+
+       return result;
+
+err_overflow:
+       errno = ERANGE;
+       return SIZE_MAX;
+}
+
+/*
+ * pmemobj_tx_log_intents_max_size -- calculates the maximum size of a buffer
+ * which will be able to hold nintents
+ */
+size_t
+pmemobj_tx_log_intents_max_size(size_t nintents)
+{
+       LOG(3, NULL);
+
+       /* check for overflow */
+       if (nintents > SIZE_MAX / TX_INTENT_LOG_ENTRY_OVERHEAD)
+               goto err_overflow;
+       /* each entry has its header */
+       size_t entries_overhead = nintents * TX_INTENT_LOG_ENTRY_OVERHEAD;
+       /* check for overflow */
+       if (entries_overhead + TX_INTENT_LOG_BUFFER_ALIGNMENT
+                       < entries_overhead)
+               goto err_overflow;
+       /* the whole buffer is aligned */
+       size_t result =
+               ALIGN_UP(entries_overhead, TX_INTENT_LOG_BUFFER_ALIGNMENT);
+
+       /* check for overflow */
+       if (result + TX_INTENT_LOG_BUFFER_OVERHEAD < result)
+               goto err_overflow;
+       /* add a buffer overhead */
+       result += TX_INTENT_LOG_BUFFER_OVERHEAD;
+
+       /*
+        * if the result is bigger than a single allocation it must be divided
+        * into multiple allocations where each of them will have its own buffer
+        * header and entry header
+        */
+       size_t allocs_overhead = (result / PMEMOBJ_MAX_ALLOC_SIZE) *
+           (TX_INTENT_LOG_BUFFER_OVERHEAD + TX_INTENT_LOG_ENTRY_OVERHEAD);
+       /* check for overflow */
+       if (result + allocs_overhead < result)
+               goto err_overflow;
+       result += allocs_overhead;
+
+       /* SIZE_MAX is a special value */
+       if (result == SIZE_MAX)
+               goto err_overflow;
+
+       return result;
+
+err_overflow:
+       errno = ERANGE;
+       return SIZE_MAX;
+}
+
+/*
+ * pmemobj_tx_set_user_data -- sets volatile pointer to the user data for the
+ * current transaction
+ */
+void
+pmemobj_tx_set_user_data(void *data)
+{
+       LOG(3, "data %p", data);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+
+       tx->user_data = data;
+}
+
+/*
+ * pmemobj_tx_get_user_data -- gets volatile pointer to the user data associated
+ * with the current transaction
+ */
+void *
+pmemobj_tx_get_user_data(void)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+
+       return tx->user_data;
+}
+
+/*
+ * pmemobj_tx_set_failure_behavior -- enables or disables automatic transaction
+ * abort in case of an error
+ */
+void
+pmemobj_tx_set_failure_behavior(enum pobj_tx_failure_behavior behavior)
+{
+       LOG(3, "behavior %d", behavior);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       txd->failure_behavior = behavior;
+}
+
+/*
+ * pmemobj_tx_get_failure_behavior -- returns enum specifying failure event
+ * for the current transaction.
+ */
+enum pobj_tx_failure_behavior
+pmemobj_tx_get_failure_behavior(void)
+{
+       LOG(3, NULL);
+
+       struct tx *tx = get_tx();
+
+       ASSERT_IN_TX(tx);
+       ASSERT_TX_STAGE_WORK(tx);
+
+       struct tx_data *txd = PMDK_SLIST_FIRST(&tx->tx_entries);
+
+       return txd->failure_behavior;
+}
+
+/*
+ * CTL_READ_HANDLER(size) -- gets the cache size transaction parameter
+ */
+static int
+CTL_READ_HANDLER(size)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       ssize_t *arg_out = arg;
+
+       *arg_out = (ssize_t)pop->tx_params->cache_size;
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(size) -- sets the cache size transaction parameter
+ */
+static int
+CTL_WRITE_HANDLER(size)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       ssize_t arg_in = *(int *)arg;
+
+       if (arg_in < 0 || arg_in > (ssize_t)PMEMOBJ_MAX_ALLOC_SIZE) {
+               errno = EINVAL;
+               ERR("invalid cache size, must be between 0 and max alloc size");
+               return -1;
+       }
+
+       size_t argu = (size_t)arg_in;
+
+       pop->tx_params->cache_size = argu;
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(size) = CTL_ARG_LONG_LONG;
+
+/*
+ * CTL_READ_HANDLER(threshold) -- gets the cache threshold transaction parameter
+ */
+static int
+CTL_READ_HANDLER(threshold)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       LOG(1, "tx.cache.threshold parameter is deprecated");
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(threshold) -- deprecated
+ */
+static int
+CTL_WRITE_HANDLER(threshold)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       LOG(1, "tx.cache.threshold parameter is deprecated");
+
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(threshold) = CTL_ARG_LONG_LONG;
+
+static const struct ctl_node CTL_NODE(cache)[] = {
+       CTL_LEAF_RW(size),
+       CTL_LEAF_RW(threshold),
+
+       CTL_NODE_END
+};
+
+/*
+ * CTL_READ_HANDLER(skip_expensive_checks) -- returns "skip_expensive_checks"
+ * var from pool ctl
+ */
+static int
+CTL_READ_HANDLER(skip_expensive_checks)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       int *arg_out = arg;
+
+       *arg_out = pop->tx_debug_skip_expensive_checks;
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(skip_expensive_checks) -- stores "skip_expensive_checks"
+ * var in pool ctl
+ */
+static int
+CTL_WRITE_HANDLER(skip_expensive_checks)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       int arg_in = *(int *)arg;
+
+       pop->tx_debug_skip_expensive_checks = arg_in;
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(skip_expensive_checks) =
+               CTL_ARG_BOOLEAN;
+
+/*
+ * CTL_READ_HANDLER(verify_user_buffers) -- returns "ulog_user_buffers.verify"
+ * variable from the pool
+ */
+static int
+CTL_READ_HANDLER(verify_user_buffers)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       int *arg_out = arg;
+
+       *arg_out = pop->ulog_user_buffers.verify;
+
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(verify_user_buffers) -- sets "ulog_user_buffers.verify"
+ * variable in the pool
+ */
+static int
+CTL_WRITE_HANDLER(verify_user_buffers)(void *ctx,
+       enum ctl_query_source source, void *arg, struct ctl_indexes *indexes)
+{
+       PMEMobjpool *pop = ctx;
+
+       int arg_in = *(int *)arg;
+
+       pop->ulog_user_buffers.verify = arg_in;
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(verify_user_buffers) =
+               CTL_ARG_BOOLEAN;
+
+static const struct ctl_node CTL_NODE(debug)[] = {
+       CTL_LEAF_RW(skip_expensive_checks),
+       CTL_LEAF_RW(verify_user_buffers),
+
+       CTL_NODE_END
+};
+
+/*
+ * CTL_READ_HANDLER(queue_depth) -- returns the depth of the post commit queue
+ */
+static int
+CTL_READ_HANDLER(queue_depth)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       return 0;
+}
+
+/*
+ * CTL_WRITE_HANDLER(queue_depth) -- sets the depth of the post commit queue
+ */
+static int
+CTL_WRITE_HANDLER(queue_depth)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       return 0;
+}
+
+static const struct ctl_argument CTL_ARG(queue_depth) = CTL_ARG_INT;
+
+/*
+ * CTL_READ_HANDLER(worker) -- launches the post commit worker thread function
+ */
+static int
+CTL_READ_HANDLER(worker)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       return 0;
+}
+
+/*
+ * CTL_READ_HANDLER(stop) -- stops all post commit workers
+ */
+static int
+CTL_READ_HANDLER(stop)(void *ctx, enum ctl_query_source source,
+       void *arg, struct ctl_indexes *indexes)
+{
+       return 0;
+}
+
+static const struct ctl_node CTL_NODE(post_commit)[] = {
+       CTL_LEAF_RW(queue_depth),
+       CTL_LEAF_RO(worker),
+       CTL_LEAF_RO(stop),
+
+       CTL_NODE_END
+};
+
+static const struct ctl_node CTL_NODE(tx)[] = {
+       CTL_CHILD(debug),
+       CTL_CHILD(cache),
+       CTL_CHILD(post_commit),
+
+       CTL_NODE_END
+};
+
+/*
+ * tx_ctl_register -- registers ctl nodes for "tx" module
+ */
+void
+tx_ctl_register(PMEMobjpool *pop)
+{
+       CTL_REGISTER_MODULE(pop->ctl, tx);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/tx.h b/ceph/src/pmdk/src/libpmemobj/tx.h
new file mode 100644 (file)
index 0000000..c6a204e
--- /dev/null
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * tx.h -- internal definitions for transactions
+ */
+
+#ifndef LIBPMEMOBJ_INTERNAL_TX_H
+#define LIBPMEMOBJ_INTERNAL_TX_H 1
+
+#include <stdint.h>
+#include "obj.h"
+#include "ulog.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TX_DEFAULT_RANGE_CACHE_SIZE (1 << 15)
+#define TX_DEFAULT_RANGE_CACHE_THRESHOLD (1 << 12)
+
+#define TX_RANGE_MASK (8ULL - 1)
+#define TX_RANGE_MASK_LEGACY (32ULL - 1)
+
+#define TX_ALIGN_SIZE(s, amask) (((s) + (amask)) & ~(amask))
+
+#define TX_SNAPSHOT_LOG_ENTRY_ALIGNMENT CACHELINE_SIZE
+#define TX_SNAPSHOT_LOG_BUFFER_OVERHEAD sizeof(struct ulog)
+#define TX_SNAPSHOT_LOG_ENTRY_OVERHEAD sizeof(struct ulog_entry_buf)
+
+#define TX_INTENT_LOG_BUFFER_ALIGNMENT CACHELINE_SIZE
+#define TX_INTENT_LOG_BUFFER_OVERHEAD sizeof(struct ulog)
+#define TX_INTENT_LOG_ENTRY_OVERHEAD sizeof(struct ulog_entry_val)
+
+struct tx_parameters {
+       size_t cache_size;
+};
+
+/*
+ * Returns the current transaction's pool handle, NULL if not within
+ * a transaction.
+ */
+PMEMobjpool *tx_get_pop(void);
+
+void tx_ctl_register(PMEMobjpool *pop);
+
+struct tx_parameters *tx_params_new(void);
+void tx_params_delete(struct tx_parameters *tx_params);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmemobj/ulog.c b/ceph/src/pmdk/src/libpmemobj/ulog.c
new file mode 100644 (file)
index 0000000..1f03e2c
--- /dev/null
@@ -0,0 +1,883 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * ulog.c -- unified log implementation
+ */
+
+#include <inttypes.h>
+#include <string.h>
+
+#include "libpmemobj.h"
+#include "pmemops.h"
+#include "ulog.h"
+#include "obj.h"
+#include "out.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+/*
+ * Operation flag at the three most significant bits
+ */
+#define ULOG_OPERATION(op)             ((uint64_t)(op))
+#define ULOG_OPERATION_MASK            ((uint64_t)(0b111ULL << 61ULL))
+#define ULOG_OPERATION_FROM_OFFSET(off)        (ulog_operation_type)\
+       ((off) & ULOG_OPERATION_MASK)
+#define ULOG_OFFSET_MASK               (~(ULOG_OPERATION_MASK))
+
+#define CACHELINE_ALIGN(size) ALIGN_UP(size, CACHELINE_SIZE)
+#define IS_CACHELINE_ALIGNED(ptr)\
+       (((uintptr_t)(ptr) & (CACHELINE_SIZE - 1)) == 0)
+
+/*
+ * ulog_by_offset -- calculates the ulog pointer
+ */
+struct ulog *
+ulog_by_offset(size_t offset, const struct pmem_ops *p_ops)
+{
+       if (offset == 0)
+               return NULL;
+
+       size_t aligned_offset = CACHELINE_ALIGN(offset);
+
+       return (struct ulog *)((char *)p_ops->base + aligned_offset);
+}
+
+/*
+ * ulog_next -- retrieves the pointer to the next ulog
+ */
+struct ulog *
+ulog_next(struct ulog *ulog, const struct pmem_ops *p_ops)
+{
+       return ulog_by_offset(ulog->next, p_ops);
+}
+
+/*
+ * ulog_operation -- returns the type of entry operation
+ */
+ulog_operation_type
+ulog_entry_type(const struct ulog_entry_base *entry)
+{
+       return ULOG_OPERATION_FROM_OFFSET(entry->offset);
+}
+
+/*
+ * ulog_offset -- returns offset
+ */
+uint64_t
+ulog_entry_offset(const struct ulog_entry_base *entry)
+{
+       return entry->offset & ULOG_OFFSET_MASK;
+}
+
+/*
+ * ulog_entry_size -- returns the size of a ulog entry
+ */
+size_t
+ulog_entry_size(const struct ulog_entry_base *entry)
+{
+       struct ulog_entry_buf *eb;
+
+       switch (ulog_entry_type(entry)) {
+               case ULOG_OPERATION_AND:
+               case ULOG_OPERATION_OR:
+               case ULOG_OPERATION_SET:
+                       return sizeof(struct ulog_entry_val);
+               case ULOG_OPERATION_BUF_SET:
+               case ULOG_OPERATION_BUF_CPY:
+                       eb = (struct ulog_entry_buf *)entry;
+                       return CACHELINE_ALIGN(
+                               sizeof(struct ulog_entry_buf) + eb->size);
+               default:
+                       ASSERT(0);
+       }
+
+       return 0;
+}
+
+/*
+ * ulog_entry_valid -- (internal) checks if a ulog entry is valid
+ * Returns 1 if the range is valid, otherwise 0 is returned.
+ */
+static int
+ulog_entry_valid(struct ulog *ulog, const struct ulog_entry_base *entry)
+{
+       if (entry->offset == 0)
+               return 0;
+
+       size_t size;
+       struct ulog_entry_buf *b;
+
+       switch (ulog_entry_type(entry)) {
+               case ULOG_OPERATION_BUF_CPY:
+               case ULOG_OPERATION_BUF_SET:
+                       size = ulog_entry_size(entry);
+                       b = (struct ulog_entry_buf *)entry;
+
+                       uint64_t csum = util_checksum_compute(b, size,
+                                       &b->checksum, 0);
+                       csum = util_checksum_seq(&ulog->gen_num,
+                                       sizeof(ulog->gen_num), csum);
+
+                       if (b->checksum != csum)
+                               return 0;
+                       break;
+               default:
+                       break;
+       }
+
+       return 1;
+}
+
+/*
+ * ulog_construct -- initializes the ulog structure
+ */
+void
+ulog_construct(uint64_t offset, size_t capacity, uint64_t gen_num,
+               int flush, uint64_t flags, const struct pmem_ops *p_ops)
+{
+       struct ulog *ulog = ulog_by_offset(offset, p_ops);
+       ASSERTne(ulog, NULL);
+
+       size_t diff = OBJ_PTR_TO_OFF(p_ops->base, ulog) - offset;
+       if (diff > 0)
+               capacity = ALIGN_DOWN(capacity - diff, CACHELINE_SIZE);
+
+       VALGRIND_ADD_TO_TX(ulog, SIZEOF_ULOG(capacity));
+
+       ulog->capacity = capacity;
+       ulog->checksum = 0;
+       ulog->next = 0;
+       ulog->gen_num = gen_num;
+       ulog->flags = flags;
+       memset(ulog->unused, 0, sizeof(ulog->unused));
+
+       /* we only need to zero out the header of ulog's first entry */
+       size_t zeroed_data = CACHELINE_ALIGN(sizeof(struct ulog_entry_base));
+
+       if (flush) {
+               pmemops_xflush(p_ops, ulog, sizeof(*ulog),
+                       PMEMOBJ_F_RELAXED);
+               pmemops_memset(p_ops, ulog->data, 0, zeroed_data,
+                       PMEMOBJ_F_MEM_NONTEMPORAL |
+                       PMEMOBJ_F_MEM_NODRAIN |
+                       PMEMOBJ_F_RELAXED);
+       } else {
+               /*
+                * We want to avoid replicating zeroes for every ulog of every
+                * lane, to do that, we need to use plain old memset.
+                */
+               memset(ulog->data, 0, zeroed_data);
+       }
+
+       VALGRIND_REMOVE_FROM_TX(ulog, SIZEOF_ULOG(capacity));
+}
+
+/*
+ * ulog_foreach_entry -- iterates over every existing entry in the ulog
+ */
+int
+ulog_foreach_entry(struct ulog *ulog,
+       ulog_entry_cb cb, void *arg, const struct pmem_ops *ops)
+{
+       struct ulog_entry_base *e;
+       int ret = 0;
+
+       for (struct ulog *r = ulog; r != NULL; r = ulog_next(r, ops)) {
+               for (size_t offset = 0; offset < r->capacity; ) {
+                       e = (struct ulog_entry_base *)(r->data + offset);
+                       if (!ulog_entry_valid(ulog, e))
+                               return ret;
+
+                       if ((ret = cb(e, arg, ops)) != 0)
+                               return ret;
+
+                       offset += ulog_entry_size(e);
+               }
+       }
+
+       return ret;
+}
+
+/*
+ * ulog_capacity -- (internal) returns the total capacity of the ulog
+ */
+size_t
+ulog_capacity(struct ulog *ulog, size_t ulog_base_bytes,
+       const struct pmem_ops *p_ops)
+{
+       size_t capacity = ulog_base_bytes;
+
+       /* skip the first one, we count it in 'ulog_base_bytes' */
+       while ((ulog = ulog_next(ulog, p_ops)) != NULL) {
+               capacity += ulog->capacity;
+       }
+
+       return capacity;
+}
+
+/*
+ * ulog_rebuild_next_vec -- rebuilds the vector of next entries
+ */
+void
+ulog_rebuild_next_vec(struct ulog *ulog, struct ulog_next *next,
+       const struct pmem_ops *p_ops)
+{
+       do {
+               if (ulog->next != 0)
+                       VEC_PUSH_BACK(next, ulog->next);
+       } while ((ulog = ulog_next(ulog, p_ops)) != NULL);
+}
+
+/*
+ * ulog_reserve -- reserves new capacity in the ulog
+ */
+int
+ulog_reserve(struct ulog *ulog,
+       size_t ulog_base_nbytes, size_t gen_num,
+       int auto_reserve, size_t *new_capacity,
+       ulog_extend_fn extend, struct ulog_next *next,
+       const struct pmem_ops *p_ops)
+{
+       if (!auto_reserve) {
+               LOG(1, "cannot auto reserve next ulog");
+               return -1;
+       }
+
+       size_t capacity = ulog_base_nbytes;
+
+       uint64_t offset;
+       VEC_FOREACH(offset, next) {
+               ulog = ulog_by_offset(offset, p_ops);
+               ASSERTne(ulog, NULL);
+
+               capacity += ulog->capacity;
+       }
+
+       while (capacity < *new_capacity) {
+               if (extend(p_ops->base, &ulog->next, gen_num) != 0)
+                       return -1;
+               VEC_PUSH_BACK(next, ulog->next);
+               ulog = ulog_next(ulog, p_ops);
+               ASSERTne(ulog, NULL);
+
+               capacity += ulog->capacity;
+       }
+       *new_capacity = capacity;
+
+       return 0;
+}
+
+/*
+ * ulog_checksum -- (internal) calculates ulog checksum
+ */
+static int
+ulog_checksum(struct ulog *ulog, size_t ulog_base_bytes, int insert)
+{
+       return util_checksum(ulog, SIZEOF_ULOG(ulog_base_bytes),
+               &ulog->checksum, insert, 0);
+}
+
+/*
+ * ulog_store -- stores the transient src ulog in the
+ *     persistent dest ulog
+ *
+ * The source and destination ulogs must be cacheline aligned.
+ */
+void
+ulog_store(struct ulog *dest, struct ulog *src, size_t nbytes,
+       size_t ulog_base_nbytes, size_t ulog_total_capacity,
+       struct ulog_next *next, const struct pmem_ops *p_ops)
+{
+       /*
+        * First, store all entries over the base capacity of the ulog in
+        * the next logs.
+        * Because the checksum is only in the first part, we don't have to
+        * worry about failsafety here.
+        */
+       struct ulog *ulog = dest;
+       size_t offset = ulog_base_nbytes;
+
+       /*
+        * Copy at least 8 bytes more than needed. If the user always
+        * properly uses entry creation functions, this will zero-out the
+        * potential leftovers of the previous log. Since all we really need
+        * to zero is the offset, sizeof(struct redo_log_entry_base) is enough.
+        * If the nbytes is aligned, an entire cacheline needs to be
+        * additionally zeroed.
+        * But the checksum must be calculated based solely on actual data.
+        * If the ulog total capacity is equal to the size of the
+        * ulog being stored (nbytes == ulog_total_capacity), then there's
+        * nothing to invalidate because the entire log data will
+        * be overwritten.
+        */
+       size_t checksum_nbytes = MIN(ulog_base_nbytes, nbytes);
+       if (nbytes != ulog_total_capacity)
+               nbytes = CACHELINE_ALIGN(nbytes +
+                       sizeof(struct ulog_entry_base));
+       ASSERT(nbytes <= ulog_total_capacity);
+
+       size_t base_nbytes = MIN(ulog_base_nbytes, nbytes);
+       size_t next_nbytes = nbytes - base_nbytes;
+
+       size_t nlog = 0;
+
+       while (next_nbytes > 0) {
+               ulog = ulog_by_offset(VEC_ARR(next)[nlog++], p_ops);
+               ASSERTne(ulog, NULL);
+
+               size_t copy_nbytes = MIN(next_nbytes, ulog->capacity);
+               next_nbytes -= copy_nbytes;
+
+               ASSERT(IS_CACHELINE_ALIGNED(ulog->data));
+
+               VALGRIND_ADD_TO_TX(ulog->data, copy_nbytes);
+               pmemops_memcpy(p_ops,
+                       ulog->data,
+                       src->data + offset,
+                       copy_nbytes,
+                       PMEMOBJ_F_MEM_WC |
+                       PMEMOBJ_F_MEM_NODRAIN |
+                       PMEMOBJ_F_RELAXED);
+               VALGRIND_REMOVE_FROM_TX(ulog->data, copy_nbytes);
+               offset += copy_nbytes;
+       }
+
+       if (nlog != 0)
+               pmemops_drain(p_ops);
+
+       /*
+        * Then, calculate the checksum and store the first part of the
+        * ulog.
+        */
+       size_t old_capacity = src->capacity;
+       src->capacity = base_nbytes;
+       src->next = VEC_SIZE(next) == 0 ? 0 : VEC_FRONT(next);
+       ulog_checksum(src, checksum_nbytes, 1);
+
+       pmemops_memcpy(p_ops, dest, src,
+               SIZEOF_ULOG(base_nbytes),
+               PMEMOBJ_F_MEM_WC);
+
+       src->capacity = old_capacity;
+}
+
+/*
+ * ulog_entry_val_create -- creates a new log value entry in the ulog
+ *
+ * This function requires at least a cacheline of space to be available in the
+ * ulog.
+ */
+struct ulog_entry_val *
+ulog_entry_val_create(struct ulog *ulog, size_t offset, uint64_t *dest,
+       uint64_t value, ulog_operation_type type,
+       const struct pmem_ops *p_ops)
+{
+       struct ulog_entry_val *e =
+               (struct ulog_entry_val *)(ulog->data + offset);
+
+       struct {
+               struct ulog_entry_val v;
+               struct ulog_entry_base zeroes;
+       } data;
+       COMPILE_ERROR_ON(sizeof(data) != sizeof(data.v) + sizeof(data.zeroes));
+
+       /*
+        * Write a little bit more to the buffer so that the next entry that
+        * resides in the log is erased. This will prevent leftovers from
+        * a previous, clobbered, log from being incorrectly applied.
+        */
+       data.zeroes.offset = 0;
+       data.v.base.offset = (uint64_t)(dest) - (uint64_t)p_ops->base;
+       data.v.base.offset |= ULOG_OPERATION(type);
+       data.v.value = value;
+
+       pmemops_memcpy(p_ops, e, &data, sizeof(data),
+               PMEMOBJ_F_MEM_NOFLUSH | PMEMOBJ_F_RELAXED);
+
+       return e;
+}
+
+/*
+ * ulog_clobber_entry -- zeroes out a single log entry header
+ */
+void
+ulog_clobber_entry(const struct ulog_entry_base *e,
+       const struct pmem_ops *p_ops)
+{
+       static const size_t aligned_entry_size =
+               CACHELINE_ALIGN(sizeof(struct ulog_entry_base));
+
+       VALGRIND_ADD_TO_TX(e, aligned_entry_size);
+       pmemops_memset(p_ops, (char *)e, 0, aligned_entry_size,
+               PMEMOBJ_F_MEM_NONTEMPORAL);
+       VALGRIND_REMOVE_FROM_TX(e, aligned_entry_size);
+}
+
+/*
+ * ulog_entry_buf_create -- atomically creates a buffer entry in the log
+ */
+struct ulog_entry_buf *
+ulog_entry_buf_create(struct ulog *ulog, size_t offset, uint64_t gen_num,
+               uint64_t *dest, const void *src, uint64_t size,
+               ulog_operation_type type, const struct pmem_ops *p_ops)
+{
+       struct ulog_entry_buf *e =
+               (struct ulog_entry_buf *)(ulog->data + offset);
+
+       /*
+        * Depending on the size of the source buffer, we might need to perform
+        * up to three separate copies:
+        *      1. The first cacheline, 24b of metadata and 40b of data
+        * If there's still data to be logged:
+        *      2. The entire remainder of data data aligned down to cacheline,
+        *      for example, if there's 150b left, this step will copy only
+        *      128b.
+        * Now, we are left with between 0 to 63 bytes. If nonzero:
+        *      3. Create a stack allocated cacheline-sized buffer, fill in the
+        *      remainder of the data, and copy the entire cacheline.
+        *
+        * This is done so that we avoid a cache-miss on misaligned writes.
+        */
+
+       struct ulog_entry_buf *b = alloca(CACHELINE_SIZE);
+       b->base.offset = (uint64_t)(dest) - (uint64_t)p_ops->base;
+       b->base.offset |= ULOG_OPERATION(type);
+       b->size = size;
+       b->checksum = 0;
+
+       size_t bdatasize = CACHELINE_SIZE - sizeof(struct ulog_entry_buf);
+       size_t ncopy = MIN(size, bdatasize);
+       memcpy(b->data, src, ncopy);
+       memset(b->data + ncopy, 0, bdatasize - ncopy);
+
+       size_t remaining_size = ncopy > size ? 0 : size - ncopy;
+
+       char *srcof = (char *)src + ncopy;
+       size_t rcopy = ALIGN_DOWN(remaining_size, CACHELINE_SIZE);
+       size_t lcopy = remaining_size - rcopy;
+
+       uint8_t last_cacheline[CACHELINE_SIZE];
+       if (lcopy != 0) {
+               memcpy(last_cacheline, srcof + rcopy, lcopy);
+               memset(last_cacheline + lcopy, 0, CACHELINE_SIZE - lcopy);
+       }
+
+       if (rcopy != 0) {
+               void *dest = e->data + ncopy;
+               ASSERT(IS_CACHELINE_ALIGNED(dest));
+
+               VALGRIND_ADD_TO_TX(dest, rcopy);
+               pmemops_memcpy(p_ops, dest, srcof, rcopy,
+                       PMEMOBJ_F_MEM_NODRAIN | PMEMOBJ_F_MEM_NONTEMPORAL);
+               VALGRIND_REMOVE_FROM_TX(dest, rcopy);
+       }
+
+       if (lcopy != 0) {
+               void *dest = e->data + ncopy + rcopy;
+               ASSERT(IS_CACHELINE_ALIGNED(dest));
+
+               VALGRIND_ADD_TO_TX(dest, CACHELINE_SIZE);
+               pmemops_memcpy(p_ops, dest, last_cacheline, CACHELINE_SIZE,
+                       PMEMOBJ_F_MEM_NODRAIN | PMEMOBJ_F_MEM_NONTEMPORAL);
+               VALGRIND_REMOVE_FROM_TX(dest, CACHELINE_SIZE);
+       }
+
+       b->checksum = util_checksum_seq(b, CACHELINE_SIZE, 0);
+       if (rcopy != 0)
+               b->checksum = util_checksum_seq(srcof, rcopy, b->checksum);
+       if (lcopy != 0)
+               b->checksum = util_checksum_seq(last_cacheline,
+                       CACHELINE_SIZE, b->checksum);
+
+       b->checksum = util_checksum_seq(&gen_num, sizeof(gen_num),
+                       b->checksum);
+
+       ASSERT(IS_CACHELINE_ALIGNED(e));
+
+       VALGRIND_ADD_TO_TX(e, CACHELINE_SIZE);
+       pmemops_memcpy(p_ops, e, b, CACHELINE_SIZE,
+               PMEMOBJ_F_MEM_NODRAIN | PMEMOBJ_F_MEM_NONTEMPORAL);
+       VALGRIND_REMOVE_FROM_TX(e, CACHELINE_SIZE);
+
+       pmemops_drain(p_ops);
+
+       /*
+        * Allow having uninitialized data in the buffer - this requires marking
+        * data as defined so that comparing checksums is not reported as an
+        * error by memcheck.
+        */
+#if VG_MEMCHECK_ENABLED
+       if (On_memcheck) {
+               VALGRIND_MAKE_MEM_DEFINED(e->data, ncopy + rcopy + lcopy);
+               VALGRIND_MAKE_MEM_DEFINED(&e->checksum, sizeof(e->checksum));
+       }
+#endif
+
+       ASSERT(ulog_entry_valid(ulog, &e->base));
+
+       return e;
+}
+
+/*
+ * ulog_entry_apply -- applies modifications of a single ulog entry
+ */
+void
+ulog_entry_apply(const struct ulog_entry_base *e, int persist,
+       const struct pmem_ops *p_ops)
+{
+       ulog_operation_type t = ulog_entry_type(e);
+       uint64_t offset = ulog_entry_offset(e);
+
+       size_t dst_size = sizeof(uint64_t);
+       uint64_t *dst = (uint64_t *)((uintptr_t)p_ops->base + offset);
+
+       struct ulog_entry_val *ev;
+       struct ulog_entry_buf *eb;
+
+       flush_fn f = persist ? p_ops->persist : p_ops->flush;
+
+       switch (t) {
+               case ULOG_OPERATION_AND:
+                       ev = (struct ulog_entry_val *)e;
+
+                       VALGRIND_ADD_TO_TX(dst, dst_size);
+                       *dst &= ev->value;
+                       f(p_ops->base, dst, sizeof(uint64_t),
+                               PMEMOBJ_F_RELAXED);
+               break;
+               case ULOG_OPERATION_OR:
+                       ev = (struct ulog_entry_val *)e;
+
+                       VALGRIND_ADD_TO_TX(dst, dst_size);
+                       *dst |= ev->value;
+                       f(p_ops->base, dst, sizeof(uint64_t),
+                               PMEMOBJ_F_RELAXED);
+               break;
+               case ULOG_OPERATION_SET:
+                       ev = (struct ulog_entry_val *)e;
+
+                       VALGRIND_ADD_TO_TX(dst, dst_size);
+                       *dst = ev->value;
+                       f(p_ops->base, dst, sizeof(uint64_t),
+                               PMEMOBJ_F_RELAXED);
+               break;
+               case ULOG_OPERATION_BUF_SET:
+                       eb = (struct ulog_entry_buf *)e;
+
+                       dst_size = eb->size;
+                       VALGRIND_ADD_TO_TX(dst, dst_size);
+                       pmemops_memset(p_ops, dst, *eb->data, eb->size,
+                               PMEMOBJ_F_RELAXED | PMEMOBJ_F_MEM_NODRAIN);
+               break;
+               case ULOG_OPERATION_BUF_CPY:
+                       eb = (struct ulog_entry_buf *)e;
+
+                       dst_size = eb->size;
+                       VALGRIND_ADD_TO_TX(dst, dst_size);
+                       pmemops_memcpy(p_ops, dst, eb->data, eb->size,
+                               PMEMOBJ_F_RELAXED | PMEMOBJ_F_MEM_NODRAIN);
+               break;
+               default:
+                       ASSERT(0);
+       }
+       VALGRIND_REMOVE_FROM_TX(dst, dst_size);
+}
+
+/*
+ * ulog_process_entry -- (internal) processes a single ulog entry
+ */
+static int
+ulog_process_entry(struct ulog_entry_base *e, void *arg,
+       const struct pmem_ops *p_ops)
+{
+       ulog_entry_apply(e, 0, p_ops);
+
+       return 0;
+}
+/*
+ * ulog_inc_gen_num -- (internal) increments gen num in the ulog
+ */
+static void
+ulog_inc_gen_num(struct ulog *ulog, const struct pmem_ops *p_ops)
+{
+       size_t gns = sizeof(ulog->gen_num);
+
+       VALGRIND_ADD_TO_TX(&ulog->gen_num, gns);
+       ulog->gen_num++;
+
+       if (p_ops)
+               pmemops_persist(p_ops, &ulog->gen_num, gns);
+       else
+               VALGRIND_SET_CLEAN(&ulog->gen_num, gns);
+
+       VALGRIND_REMOVE_FROM_TX(&ulog->gen_num, gns);
+}
+
+/*
+ * ulog_free_by_ptr_next -- free all ulogs starting from the indicated one.
+ * Function returns 1 if any ulog have been freed or unpinned, 0 otherwise.
+ */
+int
+ulog_free_next(struct ulog *u, const struct pmem_ops *p_ops,
+               ulog_free_fn ulog_free, ulog_rm_user_buffer_fn user_buff_remove,
+               uint64_t flags)
+{
+       int ret = 0;
+
+       if (u == NULL)
+               return ret;
+
+       VEC(, uint64_t *) ulogs_internal_except_first;
+       VEC_INIT(&ulogs_internal_except_first);
+
+       /*
+        * last_internal - pointer to a last found ulog allocated
+        * internally by the libpmemobj
+        */
+       struct ulog *last_internal = u;
+       struct ulog *current;
+
+       /* iterate all linked logs and unpin user defined */
+       while ((flags & ULOG_ANY_USER_BUFFER) &&
+               last_internal != NULL && last_internal->next != 0) {
+               current = ulog_by_offset(last_internal->next, p_ops);
+               /*
+                * handle case with user logs one after the other
+                * or mixed user and internal logs
+                */
+               while (current != NULL &&
+                               (current->flags & ULOG_USER_OWNED)) {
+
+                       last_internal->next = current->next;
+                       pmemops_persist(p_ops, &last_internal->next,
+                               sizeof(last_internal->next));
+
+                       user_buff_remove(p_ops->base, current);
+
+                       current = ulog_by_offset(last_internal->next, p_ops);
+                       /* any ulog has been unpinned - set return value to 1 */
+                       ret = 1;
+               }
+               last_internal = ulog_by_offset(last_internal->next, p_ops);
+       }
+
+       while (u->next != 0) {
+               if (VEC_PUSH_BACK(&ulogs_internal_except_first,
+                       &u->next) != 0) {
+                       /* this is fine, it will just use more pmem */
+                       LOG(1, "unable to free transaction logs memory");
+                       goto out;
+               }
+               u = ulog_by_offset(u->next, p_ops);
+       }
+
+       /* free non-user defined logs */
+       uint64_t *ulog_ptr;
+       VEC_FOREACH_REVERSE(ulog_ptr, &ulogs_internal_except_first) {
+               ulog_free(p_ops->base, ulog_ptr);
+               ret = 1;
+       }
+
+out:
+       VEC_DELETE(&ulogs_internal_except_first);
+       return ret;
+}
+
+/*
+ * ulog_clobber -- zeroes the metadata of the ulog
+ */
+void
+ulog_clobber(struct ulog *dest, struct ulog_next *next,
+       const struct pmem_ops *p_ops)
+{
+       struct ulog empty;
+       memset(&empty, 0, sizeof(empty));
+
+       if (next != NULL)
+               empty.next = VEC_SIZE(next) == 0 ? 0 : VEC_FRONT(next);
+       else
+               empty.next = dest->next;
+
+       pmemops_memcpy(p_ops, dest, &empty, sizeof(empty),
+               PMEMOBJ_F_MEM_WC);
+}
+
+/*
+ * ulog_clobber_data -- zeroes out 'nbytes' of data in the logs
+ */
+int
+ulog_clobber_data(struct ulog *ulog_first,
+       size_t nbytes, size_t ulog_base_nbytes,
+       struct ulog_next *next, ulog_free_fn ulog_free,
+       ulog_rm_user_buffer_fn user_buff_remove,
+       const struct pmem_ops *p_ops, unsigned flags)
+{
+       ASSERTne(ulog_first, NULL);
+
+       /* In case of abort we need to increment counter in the first ulog. */
+       if (flags & ULOG_INC_FIRST_GEN_NUM)
+               ulog_inc_gen_num(ulog_first, p_ops);
+
+       /*
+        * In the case of abort or commit, we are not going to free all ulogs,
+        * but rather increment the generation number to be consistent in the
+        * first two ulogs.
+        */
+       size_t second_offset = VEC_SIZE(next) == 0 ? 0 : *VEC_GET(next, 0);
+       struct ulog *ulog_second = ulog_by_offset(second_offset, p_ops);
+       if (ulog_second && !(flags & ULOG_FREE_AFTER_FIRST))
+               /*
+                * We want to keep gen_nums consistent between ulogs.
+                * If the transaction will commit successfully we'll reuse the
+                * second buffer (third and next ones will be freed anyway).
+                * If the application will crash we'll free 2nd ulog on
+                * recovery, which means we'll never read gen_num of the
+                * second ulog in case of an ungraceful shutdown.
+                */
+               ulog_inc_gen_num(ulog_second, NULL);
+
+       /* The ULOG_ANY_USER_BUFFER flag indicates more than one ulog exist */
+       if (flags & ULOG_ANY_USER_BUFFER)
+               ASSERTne(ulog_second, NULL);
+
+       struct ulog *u;
+       /*
+        * only if there was any user buffer it make sense to check
+        * if the second ulog is allocated by user
+        */
+       if ((flags & ULOG_ANY_USER_BUFFER) &&
+               (ulog_second->flags & ULOG_USER_OWNED)) {
+               /*
+                * function ulog_free_next() starts from 'next' ulog,
+                * so to start from the second ulog we need to
+                * pass the first one
+                */
+               u = ulog_first;
+       } else {
+               /*
+                * To make sure that transaction logs do not occupy too
+                * much of space, all of them, expect for the first one,
+                * are freed at the end of the operation. The reasoning for
+                * this is that pmalloc() is a relatively cheap operation for
+                * transactions where many hundreds of kilobytes are being
+                * snapshot, and so, allocating and freeing the buffer for
+                * each transaction is an acceptable overhead for the average
+                * case.
+                */
+               if (flags & ULOG_FREE_AFTER_FIRST)
+                       u = ulog_first;
+               else
+                       u = ulog_second;
+       }
+
+       if (u == NULL)
+               return 0;
+
+       return ulog_free_next(u, p_ops, ulog_free, user_buff_remove, flags);
+}
+
+/*
+ * ulog_process -- process ulog entries
+ */
+void
+ulog_process(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops)
+{
+       LOG(15, "ulog %p", ulog);
+
+#ifdef DEBUG
+       if (check)
+               ulog_check(ulog, check, p_ops);
+#endif
+
+       ulog_foreach_entry(ulog, ulog_process_entry, NULL, p_ops);
+       pmemops_drain(p_ops);
+}
+
+/*
+ * ulog_base_nbytes -- (internal) counts the actual of number of bytes
+ *     occupied by the ulog
+ */
+size_t
+ulog_base_nbytes(struct ulog *ulog)
+{
+       size_t offset = 0;
+       struct ulog_entry_base *e;
+
+       for (offset = 0; offset < ulog->capacity; ) {
+               e = (struct ulog_entry_base *)(ulog->data + offset);
+               if (!ulog_entry_valid(ulog, e))
+                       break;
+
+               offset += ulog_entry_size(e);
+       }
+
+       return offset;
+}
+
+/*
+ * ulog_recovery_needed -- checks if the logs needs recovery
+ */
+int
+ulog_recovery_needed(struct ulog *ulog, int verify_checksum)
+{
+       size_t nbytes = MIN(ulog_base_nbytes(ulog), ulog->capacity);
+       if (nbytes == 0)
+               return 0;
+
+       if (verify_checksum && !ulog_checksum(ulog, nbytes, 0))
+               return 0;
+
+       return 1;
+}
+
+/*
+ * ulog_recover -- recovery of ulog
+ *
+ * The ulog_recover shall be preceded by ulog_check call.
+ */
+void
+ulog_recover(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops)
+{
+       LOG(15, "ulog %p", ulog);
+
+       if (ulog_recovery_needed(ulog, 1)) {
+               ulog_process(ulog, check, p_ops);
+               ulog_clobber(ulog, NULL, p_ops);
+       }
+}
+
+/*
+ * ulog_check_entry --
+ *     (internal) checks consistency of a single ulog entry
+ */
+static int
+ulog_check_entry(struct ulog_entry_base *e,
+       void *arg, const struct pmem_ops *p_ops)
+{
+       uint64_t offset = ulog_entry_offset(e);
+       ulog_check_offset_fn check = arg;
+
+       if (!check(p_ops->base, offset)) {
+               LOG(15, "ulog %p invalid offset %" PRIu64,
+                               e, e->offset);
+               return -1;
+       }
+
+       return offset == 0 ? -1 : 0;
+}
+
+/*
+ * ulog_check -- (internal) check consistency of ulog entries
+ */
+int
+ulog_check(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops)
+{
+       LOG(15, "ulog %p", ulog);
+
+       return ulog_foreach_entry(ulog,
+                       ulog_check_entry, check, p_ops);
+}
diff --git a/ceph/src/pmdk/src/libpmemobj/ulog.h b/ceph/src/pmdk/src/libpmemobj/ulog.h
new file mode 100644 (file)
index 0000000..1dc8d30
--- /dev/null
@@ -0,0 +1,166 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * ulog.h -- unified log public interface
+ */
+
+#ifndef LIBPMEMOBJ_ULOG_H
+#define LIBPMEMOBJ_ULOG_H 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "vec.h"
+#include "pmemops.h"
+
+struct ulog_entry_base {
+       uint64_t offset; /* offset with operation type flag */
+};
+
+/*
+ * ulog_entry_val -- log entry
+ */
+struct ulog_entry_val {
+       struct ulog_entry_base base;
+       uint64_t value; /* value to be applied */
+};
+
+/*
+ * ulog_entry_buf - ulog buffer entry
+ */
+struct ulog_entry_buf {
+       struct ulog_entry_base base; /* offset with operation type flag */
+       uint64_t checksum; /* checksum of the entire log entry */
+       uint64_t size; /* size of the buffer to be modified */
+       uint8_t data[]; /* content to fill in */
+};
+
+#define ULOG_UNUSED ((CACHELINE_SIZE - 40) / 8)
+/*
+ * This structure *must* be located at a cacheline boundary. To achieve this,
+ * the next field is always allocated with extra padding, and then the offset
+ * is additionally aligned.
+ */
+#define ULOG(capacity_bytes) {\
+       /* 64 bytes of metadata */\
+       uint64_t checksum; /* checksum of ulog header and its entries */\
+       uint64_t next; /* offset of ulog extension */\
+       uint64_t capacity; /* capacity of this ulog in bytes */\
+       uint64_t gen_num; /* generation counter */\
+       uint64_t flags; /* ulog flags */\
+       uint64_t unused[ULOG_UNUSED]; /* must be 0 */\
+       uint8_t data[capacity_bytes]; /* N bytes of data */\
+}\
+
+#define SIZEOF_ULOG(base_capacity)\
+(sizeof(struct ulog) + base_capacity)
+
+/*
+ * Ulog buffer allocated by the user must be marked by this flag.
+ * It is important to not free it at the end:
+ * what user has allocated - user should free himself.
+ */
+#define ULOG_USER_OWNED (1U << 0)
+
+/* use this for allocations of aligned ulog extensions */
+#define SIZEOF_ALIGNED_ULOG(base_capacity)\
+ALIGN_UP(SIZEOF_ULOG(base_capacity + (2 * CACHELINE_SIZE)), CACHELINE_SIZE)
+
+struct ulog ULOG(0);
+
+VEC(ulog_next, uint64_t);
+
+typedef uint64_t ulog_operation_type;
+
+#define ULOG_OPERATION_SET             (0b000ULL << 61ULL)
+#define ULOG_OPERATION_AND             (0b001ULL << 61ULL)
+#define ULOG_OPERATION_OR              (0b010ULL << 61ULL)
+#define ULOG_OPERATION_BUF_SET         (0b101ULL << 61ULL)
+#define ULOG_OPERATION_BUF_CPY         (0b110ULL << 61ULL)
+
+#define ULOG_BIT_OPERATIONS (ULOG_OPERATION_AND | ULOG_OPERATION_OR)
+
+/* immediately frees all associated ulog structures */
+#define ULOG_FREE_AFTER_FIRST (1U << 0)
+/* increments gen_num of the first, preallocated, ulog */
+#define ULOG_INC_FIRST_GEN_NUM (1U << 1)
+/* informs if there was any buffer allocated by user in the tx  */
+#define ULOG_ANY_USER_BUFFER (1U << 2)
+
+typedef int (*ulog_check_offset_fn)(void *ctx, uint64_t offset);
+typedef int (*ulog_extend_fn)(void *, uint64_t *, uint64_t);
+typedef int (*ulog_entry_cb)(struct ulog_entry_base *e, void *arg,
+       const struct pmem_ops *p_ops);
+typedef void (*ulog_free_fn)(void *base, uint64_t *next);
+typedef int (*ulog_rm_user_buffer_fn)(void *, void *addr);
+
+struct ulog *ulog_next(struct ulog *ulog, const struct pmem_ops *p_ops);
+
+void ulog_construct(uint64_t offset, size_t capacity, uint64_t gen_num,
+               int flush, uint64_t flags, const struct pmem_ops *p_ops);
+
+size_t ulog_capacity(struct ulog *ulog, size_t ulog_base_bytes,
+       const struct pmem_ops *p_ops);
+void ulog_rebuild_next_vec(struct ulog *ulog, struct ulog_next *next,
+       const struct pmem_ops *p_ops);
+
+int ulog_foreach_entry(struct ulog *ulog,
+       ulog_entry_cb cb, void *arg, const struct pmem_ops *ops);
+
+int ulog_reserve(struct ulog *ulog,
+       size_t ulog_base_nbytes, size_t gen_num,
+       int auto_reserve, size_t *new_capacity_bytes,
+       ulog_extend_fn extend, struct ulog_next *next,
+       const struct pmem_ops *p_ops);
+
+void ulog_store(struct ulog *dest,
+       struct ulog *src, size_t nbytes, size_t ulog_base_nbytes,
+       size_t ulog_total_capacity,
+       struct ulog_next *next, const struct pmem_ops *p_ops);
+
+int ulog_free_next(struct ulog *u, const struct pmem_ops *p_ops,
+               ulog_free_fn ulog_free, ulog_rm_user_buffer_fn user_buff_remove,
+               uint64_t flags);
+void ulog_clobber(struct ulog *dest, struct ulog_next *next,
+       const struct pmem_ops *p_ops);
+int ulog_clobber_data(struct ulog *dest,
+       size_t nbytes, size_t ulog_base_nbytes,
+       struct ulog_next *next, ulog_free_fn ulog_free,
+       ulog_rm_user_buffer_fn user_buff_remove,
+       const struct pmem_ops *p_ops, unsigned flags);
+void ulog_clobber_entry(const struct ulog_entry_base *e,
+       const struct pmem_ops *p_ops);
+
+void ulog_process(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops);
+
+size_t ulog_base_nbytes(struct ulog *ulog);
+int ulog_recovery_needed(struct ulog *ulog, int verify_checksum);
+struct ulog *ulog_by_offset(size_t offset, const struct pmem_ops *p_ops);
+
+uint64_t ulog_entry_offset(const struct ulog_entry_base *entry);
+ulog_operation_type ulog_entry_type(
+       const struct ulog_entry_base *entry);
+
+struct ulog_entry_val *ulog_entry_val_create(struct ulog *ulog,
+       size_t offset, uint64_t *dest, uint64_t value,
+       ulog_operation_type type,
+       const struct pmem_ops *p_ops);
+
+struct ulog_entry_buf *
+ulog_entry_buf_create(struct ulog *ulog, size_t offset,
+       uint64_t gen_num, uint64_t *dest, const void *src, uint64_t size,
+       ulog_operation_type type, const struct pmem_ops *p_ops);
+
+void ulog_entry_apply(const struct ulog_entry_base *e, int persist,
+       const struct pmem_ops *p_ops);
+
+size_t ulog_entry_size(const struct ulog_entry_base *entry);
+
+void ulog_recover(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops);
+int ulog_check(struct ulog *ulog, ulog_check_offset_fn check,
+       const struct pmem_ops *p_ops);
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/Makefile b/ceph/src/pmdk/src/libpmempool/Makefile
new file mode 100644 (file)
index 0000000..0ae33de
--- /dev/null
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# src/libpmempool/Makefile -- Makefile for libpmempool
+#
+
+LIBRARY_NAME = pmempool
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+
+INCS += -I$(TOP)/src/libpmemlog
+INCS += -I$(TOP)/src/libpmemblk
+INCS += -I$(TOP)/src/libpmemobj
+INCS += -I$(TOP)/src/rpmem_common
+INCS += -I$(TOP)/src/librpmem
+INCS += -I$(TOP)/src/libpmem2
+
+vpath %.c ../librpmem
+
+include ../core/pmemcore.inc
+include ../common/pmemcommon.inc
+
+SOURCE +=\
+       libpmempool.c\
+       check.c\
+       check_bad_blocks.c\
+       check_backup.c\
+       check_btt_info.c\
+       check_btt_map_flog.c\
+       check_log.c\
+       check_blk.c\
+       check_pool_hdr.c\
+       check_sds.c\
+       check_util.c\
+       check_write.c\
+       pool.c\
+       replica.c\
+       feature.c\
+       $(RPMEM_COMMON)/rpmem_common.c\
+       rpmem_ssh.c\
+       rpmem_cmd.c\
+       rpmem_util.c\
+       sync.c\
+       transform.c\
+       rm.c
+
+LIBPMEMBLK_PRIV_FUNCS=btt_info_set btt_arena_datasize btt_flog_size\
+       btt_map_size btt_flog_get_valid map_entry_is_initial btt_info_convert2h\
+       btt_info_convert2le btt_flog_convert2h btt_flog_convert2le
+
+include ../Makefile.inc
+
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += -pthread -lpmem $(LIBDL) $(LIBNDCTL_LIBS)
+CFLAGS += -DUSE_LIBDL
+CFLAGS += -DUSE_RPMEM
+
+pmemblk_priv_funcs.o: $(PMEMBLK_PRIV_OBJ)
+       $(OBJCOPY) --localize-hidden $(addprefix -G, $(LIBPMEMBLK_PRIV_FUNCS)) \
+       $< $@
diff --git a/ceph/src/pmdk/src/libpmempool/check.c b/ceph/src/pmdk/src/libpmempool/check.c
new file mode 100644 (file)
index 0000000..62a594b
--- /dev/null
@@ -0,0 +1,232 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * check.c -- functions performing checks in proper order
+ */
+
+#include <stdint.h>
+
+#include "out.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check.h"
+#include "check_util.h"
+
+#define CHECK_RESULT_IS_STOP(result)\
+       ((result) == CHECK_RESULT_ERROR ||\
+               (result) == CHECK_RESULT_INTERNAL_ERROR ||\
+               ((result) == CHECK_RESULT_CANNOT_REPAIR) ||\
+               ((result) == CHECK_RESULT_NOT_CONSISTENT))
+
+struct step {
+       void (*func)(PMEMpoolcheck *);
+       enum pool_type type;
+       bool part;
+};
+
+static const struct step steps[] = {
+       {
+               .type           = POOL_TYPE_ANY,
+               .func           = check_bad_blocks,
+               .part           = true,
+       },
+       {
+               .type           = POOL_TYPE_ANY,
+               .func           = check_backup,
+               .part           = true,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_LOG |
+                                       POOL_TYPE_OBJ,
+               .func           = check_sds,
+               .part           = true,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_LOG |
+                                       POOL_TYPE_OBJ |
+                                       POOL_TYPE_UNKNOWN,
+               .func           = check_pool_hdr,
+               .part           = true,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_LOG |
+                                       POOL_TYPE_OBJ |
+                                       POOL_TYPE_UNKNOWN,
+               .func           = check_pool_hdr_uuids,
+               .part           = true,
+       },
+       {
+               .type           = POOL_TYPE_LOG,
+               .func           = check_log,
+               .part           = false,
+       },
+       {
+               .type           = POOL_TYPE_BLK,
+               .func           = check_blk,
+               .part           = false,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_BTT,
+               .func           = check_btt_info,
+               .part           = false,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_BTT,
+               .func           = check_btt_map_flog,
+               .part           = false,
+       },
+       {
+               .type           = POOL_TYPE_BLK | POOL_TYPE_LOG |
+                                       POOL_TYPE_BTT,
+               .func           = check_write,
+               .part           = false,
+       },
+       {
+               .func           = NULL,
+       },
+};
+
+/*
+ * check_init -- initialize check process
+ */
+int
+check_init(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       if (!(ppc->data = check_data_alloc()))
+               goto error_data_malloc;
+       if (!(ppc->pool = pool_data_alloc(ppc)))
+               goto error_pool_malloc;
+
+       return 0;
+
+error_pool_malloc:
+       check_data_free(ppc->data);
+error_data_malloc:
+       return -1;
+}
+
+#ifdef _WIN32
+void
+convert_status_cache(PMEMpoolcheck *ppc, char *buf, size_t size)
+{
+       cache_to_utf8(ppc->data, buf, size);
+}
+#endif
+
+/*
+ * status_get -- (internal) get next check_status
+ *
+ * The assumed order of check_statuses is: all info messages, error or question.
+ */
+static struct check_status *
+status_get(PMEMpoolcheck *ppc)
+{
+       struct check_status *status = NULL;
+
+       /* clear cache if exists */
+       check_clear_status_cache(ppc->data);
+
+       /* return next info if exists */
+       if ((status = check_pop_info(ppc->data)))
+               return status;
+
+       /* return error if exists */
+       if ((status = check_pop_error(ppc->data)))
+               return status;
+
+       if (ppc->result == CHECK_RESULT_ASK_QUESTIONS) {
+               /*
+                * push answer for previous question and return info if answer
+                * is not valid
+                */
+               if (check_push_answer(ppc))
+                       if ((status = check_pop_info(ppc->data)))
+                               return status;
+
+               /* if has next question ask it */
+               if ((status = check_pop_question(ppc->data)))
+                       return status;
+
+               /* process answers otherwise */
+               ppc->result = CHECK_RESULT_PROCESS_ANSWERS;
+       } else if (CHECK_RESULT_IS_STOP(ppc->result))
+               check_end(ppc->data);
+
+       return NULL;
+}
+
+/*
+ * check_step -- perform single check step
+ */
+struct check_status *
+check_step(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       struct check_status *status = NULL;
+       /* return if we have information or questions to ask or check ended */
+       if ((status = status_get(ppc)) || check_is_end(ppc->data))
+               return status;
+
+       /* get next step and check if exists */
+       const struct step *step = &steps[check_step_get(ppc->data)];
+       if (step->func == NULL) {
+               check_end(ppc->data);
+               return status;
+       }
+
+       /*
+        * step would be performed if pool type is one of the required pool type
+        * and it is not part if parts are excluded from current step
+        */
+       if (!(step->type & ppc->pool->params.type) ||
+                       (ppc->pool->params.is_part && !step->part)) {
+               /* skip test */
+               check_step_inc(ppc->data);
+               return NULL;
+       }
+
+       /* perform step */
+       step->func(ppc);
+
+       /* move on to next step if no questions were generated */
+       if (ppc->result != CHECK_RESULT_ASK_QUESTIONS)
+               check_step_inc(ppc->data);
+
+       /* get current status and return */
+       return status_get(ppc);
+}
+
+/*
+ * check_fini -- stop check process
+ */
+void
+check_fini(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       pool_data_free(ppc->pool);
+       check_data_free(ppc->data);
+}
+
+/*
+ * check_is_end -- return if check has ended
+ */
+int
+check_is_end(struct check_data *data)
+{
+       return check_is_end_util(data);
+}
+
+/*
+ * check_status_get -- extract pmempool_check_status from check_status
+ */
+struct pmempool_check_status *
+check_status_get(struct check_status *status)
+{
+       return check_status_get_util(status);
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check.h b/ceph/src/pmdk/src/libpmempool/check.h
new file mode 100644 (file)
index 0000000..86b2284
--- /dev/null
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * check.h -- internal definitions for logic performing check
+ */
+
+#ifndef CHECK_H
+#define CHECK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int check_init(PMEMpoolcheck *ppc);
+struct check_status *check_step(PMEMpoolcheck *ppc);
+void check_fini(PMEMpoolcheck *ppc);
+
+int check_is_end(struct check_data *data);
+struct pmempool_check_status *check_status_get(struct check_status *status);
+
+#ifdef _WIN32
+void convert_status_cache(PMEMpoolcheck *ppc, char *buf, size_t size);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/check_backup.c b/ceph/src/pmdk/src/libpmempool/check_backup.c
new file mode 100644 (file)
index 0000000..f339bf0
--- /dev/null
@@ -0,0 +1,367 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * check_backup.c -- pre-check backup
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include "out.h"
+#include "file.h"
+#include "os.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum question {
+       Q_OVERWRITE_EXISTING_FILE,
+       Q_OVERWRITE_EXISTING_PARTS
+};
+
+/*
+ * location_release -- (internal) release poolset structure
+ */
+static void
+location_release(location *loc)
+{
+       if (loc->set) {
+               util_poolset_free(loc->set);
+               loc->set = NULL;
+       }
+}
+
+/*
+ * backup_nonpoolset_requirements -- (internal) check backup requirements
+ */
+static int
+backup_nonpoolset_requirements(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, "backup_path %s", ppc->backup_path);
+
+       int exists = util_file_exists(ppc->backup_path);
+       if (exists < 0) {
+               return CHECK_ERR(ppc,
+                               "unable to access the backup destination: %s",
+                               ppc->backup_path);
+       }
+
+       if (!exists) {
+               errno = 0;
+               return 0;
+       }
+
+       if ((size_t)util_file_get_size(ppc->backup_path) !=
+                       ppc->pool->set_file->size) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return CHECK_ERR(ppc,
+                       "destination of the backup does not match the size of the source pool file: %s",
+                       ppc->backup_path);
+       }
+
+       if (CHECK_WITHOUT_FIXING(ppc)) {
+               location_release(loc);
+               loc->step = CHECK_STEP_COMPLETE;
+               return 0;
+       }
+
+       CHECK_ASK(ppc, Q_OVERWRITE_EXISTING_FILE,
+               "destination of the backup already exists.|Do you want to overwrite it?");
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * backup_nonpoolset_overwrite -- (internal) overwrite pool
+ */
+static int
+backup_nonpoolset_overwrite(PMEMpoolcheck *ppc, location *loc,
+       uint32_t question, void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_OVERWRITE_EXISTING_FILE:
+               if (pool_copy(ppc->pool, ppc->backup_path, 1 /* overwrite */)) {
+                       location_release(loc);
+                       ppc->result = CHECK_RESULT_ERROR;
+                       return CHECK_ERR(ppc, "cannot perform backup");
+               }
+
+               location_release(loc);
+               loc->step = CHECK_STEP_COMPLETE;
+               return 0;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * backup_nonpoolset_create -- (internal) create backup
+ */
+static int
+backup_nonpoolset_create(PMEMpoolcheck *ppc, location *loc)
+{
+       CHECK_INFO(ppc, "creating backup file: %s", ppc->backup_path);
+
+       if (pool_copy(ppc->pool, ppc->backup_path, 0)) {
+               location_release(loc);
+               ppc->result = CHECK_RESULT_ERROR;
+               return CHECK_ERR(ppc, "cannot perform backup");
+       }
+
+       location_release(loc);
+       loc->step = CHECK_STEP_COMPLETE;
+       return 0;
+}
+
+/*
+ * backup_poolset_requirements -- (internal) check backup requirements
+ */
+static int
+backup_poolset_requirements(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, "backup_path %s", ppc->backup_path);
+
+       if (ppc->pool->set_file->poolset->nreplicas > 1) {
+               CHECK_INFO(ppc,
+                       "backup of a poolset with multiple replicas is not supported");
+               goto err;
+       }
+
+       if (pool_set_parse(&loc->set, ppc->backup_path)) {
+               CHECK_INFO_ERRNO(ppc, "invalid poolset backup file: %s",
+                       ppc->backup_path);
+               goto err;
+       }
+
+       if (loc->set->nreplicas > 1) {
+               CHECK_INFO(ppc,
+                       "backup to a poolset with multiple replicas is not supported");
+               goto err_poolset;
+       }
+
+       ASSERTeq(loc->set->nreplicas, 1);
+       struct pool_replica *srep = ppc->pool->set_file->poolset->replica[0];
+       struct pool_replica *drep = loc->set->replica[0];
+       if (srep->nparts != drep->nparts) {
+               CHECK_INFO(ppc,
+                       "number of part files in the backup poolset must match number of part files in the source poolset");
+               goto err_poolset;
+       }
+
+       int overwrite_required = 0;
+       for (unsigned p = 0; p < srep->nparts; p++) {
+               int exists = util_file_exists(drep->part[p].path);
+               if (exists < 0) {
+                       CHECK_INFO(ppc,
+                               "unable to access the part of the destination poolset: %s",
+                               ppc->backup_path);
+                       goto err_poolset;
+               }
+
+               if (srep->part[p].filesize != drep->part[p].filesize) {
+                       CHECK_INFO(ppc,
+                               "size of the part %u of the backup poolset does not match source poolset",
+                               p);
+                       goto err_poolset;
+               }
+
+               if (!exists) {
+                       errno = 0;
+                       continue;
+               }
+
+               overwrite_required = true;
+
+               if ((size_t)util_file_get_size(drep->part[p].path) !=
+                               srep->part[p].filesize) {
+                       CHECK_INFO(ppc,
+                               "destination of the backup part does not match size of the source part file: %s",
+                               drep->part[p].path);
+                       goto err_poolset;
+               }
+       }
+
+       if (CHECK_WITHOUT_FIXING(ppc)) {
+               location_release(loc);
+               loc->step = CHECK_STEP_COMPLETE;
+               return 0;
+       }
+
+       if (overwrite_required) {
+               CHECK_ASK(ppc, Q_OVERWRITE_EXISTING_PARTS,
+                       "part files of the destination poolset of the backup already exist.|"
+                       "Do you want to overwrite them?");
+       }
+
+       return check_questions_sequence_validate(ppc);
+
+err_poolset:
+       location_release(loc);
+err:
+       ppc->result = CHECK_RESULT_ERROR;
+       return CHECK_ERR(ppc, "unable to backup poolset");
+}
+
+/*
+ * backup_poolset -- (internal) backup the poolset
+ */
+static int
+backup_poolset(PMEMpoolcheck *ppc, location *loc, int overwrite)
+{
+       struct pool_replica *srep = ppc->pool->set_file->poolset->replica[0];
+       struct pool_replica *drep = loc->set->replica[0];
+       for (unsigned p = 0; p < srep->nparts; p++) {
+               if (overwrite == 0) {
+                       CHECK_INFO(ppc, "creating backup file: %s",
+                               drep->part[p].path);
+               }
+               if (pool_set_part_copy(&drep->part[p], &srep->part[p],
+                               overwrite)) {
+                       location_release(loc);
+                       ppc->result = CHECK_RESULT_ERROR;
+                       CHECK_INFO(ppc, "unable to create backup file");
+                       return CHECK_ERR(ppc, "unable to backup poolset");
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * backup_poolset_overwrite -- (internal) backup poolset with overwrite
+ */
+static int
+backup_poolset_overwrite(PMEMpoolcheck *ppc, location *loc,
+       uint32_t question, void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_OVERWRITE_EXISTING_PARTS:
+               if (backup_poolset(ppc, loc, 1 /* overwrite */)) {
+                       location_release(loc);
+                       ppc->result = CHECK_RESULT_ERROR;
+                       return CHECK_ERR(ppc, "cannot perform backup");
+               }
+
+               location_release(loc);
+               loc->step = CHECK_STEP_COMPLETE;
+               return 0;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * backup_poolset_create -- (internal) backup poolset
+ */
+static int
+backup_poolset_create(PMEMpoolcheck *ppc, location *loc)
+{
+       if (backup_poolset(ppc, loc, 0)) {
+               location_release(loc);
+               ppc->result = CHECK_RESULT_ERROR;
+               return CHECK_ERR(ppc, "cannot perform backup");
+       }
+
+       location_release(loc);
+       loc->step = CHECK_STEP_COMPLETE;
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+       int poolset;
+};
+
+static const struct step steps[] = {
+       {
+               .check          = backup_nonpoolset_requirements,
+               .poolset        = false,
+       },
+       {
+               .fix            = backup_nonpoolset_overwrite,
+               .poolset        = false,
+       },
+       {
+               .check          = backup_nonpoolset_create,
+               .poolset        = false
+       },
+       {
+               .check          = backup_poolset_requirements,
+               .poolset        = true,
+       },
+       {
+               .fix            = backup_poolset_overwrite,
+               .poolset        = true,
+       },
+       {
+               .check          = backup_poolset_create,
+               .poolset        = true
+       },
+       {
+               .check          = NULL,
+               .fix            = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+
+       const struct step *step = &steps[loc->step++];
+
+       if (step->poolset == 0 && ppc->pool->params.is_poolset == 1)
+               return 0;
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (!check_has_answer(ppc->data))
+               return 0;
+
+       if (check_answer_loop(ppc, loc, NULL, 1, step->fix))
+               return -1;
+
+       ppc->result = CHECK_RESULT_CONSISTENT;
+
+       return 0;
+}
+
+/*
+ * check_backup -- perform backup if requested and needed
+ */
+void
+check_backup(PMEMpoolcheck *ppc)
+{
+       LOG(3, "backup_path %s", ppc->backup_path);
+
+       if (ppc->backup_path == NULL)
+               return;
+
+       location *loc = check_get_step_data(ppc->data);
+
+       /* do all checks */
+       while (CHECK_NOT_COMPLETE(loc, steps)) {
+               if (step_exe(ppc, loc))
+                       break;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_bad_blocks.c b/ceph/src/pmdk/src/libpmempool/check_bad_blocks.c
new file mode 100644 (file)
index 0000000..d9d58fb
--- /dev/null
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * check_bad_blocks.c -- pre-check bad_blocks
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include "out.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+#include "set_badblocks.h"
+#include "badblocks.h"
+
+/*
+ * check_bad_blocks -- check poolset for bad_blocks
+ */
+void
+check_bad_blocks(PMEMpoolcheck *ppc)
+{
+       LOG(3, "ppc %p", ppc);
+
+       int ret;
+
+       if (!(ppc->pool->params.features.compat & POOL_FEAT_CHECK_BAD_BLOCKS)) {
+               /* skipping checking poolset for bad blocks */
+               ppc->result = CHECK_RESULT_CONSISTENT;
+               return;
+       }
+
+       if (ppc->pool->set_file->poolset) {
+               ret = badblocks_check_poolset(ppc->pool->set_file->poolset, 0);
+       } else {
+               ret = badblocks_check_file(ppc->pool->set_file->fname);
+       }
+
+       if (ret < 0) {
+               if (errno == ENOTSUP) {
+                       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+                       CHECK_ERR(ppc, BB_NOT_SUPP);
+                       return;
+               }
+
+               ppc->result = CHECK_RESULT_ERROR;
+               CHECK_ERR(ppc, "checking poolset for bad blocks failed -- '%s'",
+                               ppc->path);
+               return;
+       }
+
+       if (ret > 0) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_ERR(ppc,
+                       "poolset contains bad blocks, use 'pmempool info --bad-blocks=yes' to print or 'pmempool sync --bad-blocks' to clear them");
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_blk.c b/ceph/src/pmdk/src/libpmempool/check_blk.c
new file mode 100644 (file)
index 0000000..05e38c3
--- /dev/null
@@ -0,0 +1,237 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * check_blk.c -- check pmemblk
+ */
+
+#include <inttypes.h>
+#include <sys/param.h>
+#include <endian.h>
+
+#include "out.h"
+#include "btt.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum question {
+       Q_BLK_BSIZE,
+};
+
+/*
+ * blk_get_max_bsize -- (internal) return maximum size of block for given file
+ *     size
+ */
+static inline uint32_t
+blk_get_max_bsize(uint64_t fsize)
+{
+       LOG(3, NULL);
+
+       if (fsize == 0)
+               return 0;
+
+       /* default nfree */
+       uint32_t nfree = BTT_DEFAULT_NFREE;
+
+       /* number of blocks must be at least 2 * nfree */
+       uint32_t internal_nlba = 2 * nfree;
+
+       /* compute arena size from file size without pmemblk structure */
+       uint64_t arena_size = fsize - sizeof(struct pmemblk);
+       if (arena_size > BTT_MAX_ARENA)
+               arena_size = BTT_MAX_ARENA;
+       arena_size = btt_arena_datasize(arena_size, nfree);
+
+       /* compute maximum internal LBA size */
+       uint64_t internal_lbasize = (arena_size - BTT_ALIGNMENT) /
+                       internal_nlba - BTT_MAP_ENTRY_SIZE;
+       ASSERT(internal_lbasize <= UINT32_MAX);
+
+       if (internal_lbasize < BTT_MIN_LBA_SIZE)
+               internal_lbasize = BTT_MIN_LBA_SIZE;
+
+       internal_lbasize = roundup(internal_lbasize, BTT_INTERNAL_LBA_ALIGNMENT)
+               - BTT_INTERNAL_LBA_ALIGNMENT;
+
+       return (uint32_t)internal_lbasize;
+}
+
+/*
+ * blk_read -- (internal) read pmemblk header
+ */
+static int
+blk_read(PMEMpoolcheck *ppc)
+{
+       /*
+        * Here we want to read the pmemblk header without the pool_hdr as we've
+        * already done it before.
+        *
+        * Take the pointer to fields right after pool_hdr, compute the size and
+        * offset of remaining fields.
+        */
+       uint8_t *ptr = (uint8_t *)&ppc->pool->hdr.blk;
+       ptr += sizeof(ppc->pool->hdr.blk.hdr);
+
+       size_t size = sizeof(ppc->pool->hdr.blk) -
+               sizeof(ppc->pool->hdr.blk.hdr);
+       uint64_t offset = sizeof(ppc->pool->hdr.blk.hdr);
+
+       if (pool_read(ppc->pool, ptr, size, offset)) {
+               return CHECK_ERR(ppc, "cannot read pmemblk structure");
+       }
+
+       /* endianness conversion */
+       ppc->pool->hdr.blk.bsize = le32toh(ppc->pool->hdr.blk.bsize);
+
+       return 0;
+}
+
+/*
+ * blk_bsize_valid -- (internal) check if block size is valid for given file
+ *     size
+ */
+static int
+blk_bsize_valid(uint32_t bsize, uint64_t fsize)
+{
+       uint32_t max_bsize = blk_get_max_bsize(fsize);
+       return (bsize >= max_bsize);
+}
+
+/*
+ * blk_hdr_check -- (internal) check pmemblk header
+ */
+static int
+blk_hdr_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       CHECK_INFO(ppc, "checking pmemblk header");
+
+       if (blk_read(ppc)) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return -1;
+       }
+
+       /* check for valid BTT Info arena as we can take bsize from it */
+       if (!ppc->pool->bttc.valid)
+               pool_blk_get_first_valid_arena(ppc->pool, &ppc->pool->bttc);
+
+       if (ppc->pool->bttc.valid) {
+               const uint32_t btt_bsize =
+                       ppc->pool->bttc.btt_info.external_lbasize;
+
+               if (ppc->pool->hdr.blk.bsize != btt_bsize) {
+                       CHECK_ASK(ppc, Q_BLK_BSIZE,
+                               "invalid pmemblk.bsize.|Do you want to set "
+                               "pmemblk.bsize to %u from BTT Info?",
+                               btt_bsize);
+               }
+       } else if (!ppc->pool->bttc.zeroed) {
+               if (ppc->pool->hdr.blk.bsize < BTT_MIN_LBA_SIZE ||
+                               blk_bsize_valid(ppc->pool->hdr.blk.bsize,
+                               ppc->pool->set_file->size)) {
+                       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+                       return CHECK_ERR(ppc, "invalid pmemblk.bsize");
+               }
+       }
+
+       if (ppc->result == CHECK_RESULT_CONSISTENT ||
+                       ppc->result == CHECK_RESULT_REPAIRED)
+               CHECK_INFO(ppc, "pmemblk header correct");
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * blk_hdr_fix -- (internal) fix pmemblk header
+ */
+static int
+blk_hdr_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question, void *ctx)
+{
+       LOG(3, NULL);
+
+       uint32_t btt_bsize;
+
+       switch (question) {
+       case Q_BLK_BSIZE:
+               /*
+                * check for valid BTT Info arena as we can take bsize from it
+                */
+               if (!ppc->pool->bttc.valid)
+                       pool_blk_get_first_valid_arena(ppc->pool,
+                               &ppc->pool->bttc);
+               btt_bsize = ppc->pool->bttc.btt_info.external_lbasize;
+               CHECK_INFO(ppc, "setting pmemblk.b_size to 0x%x", btt_bsize);
+               ppc->pool->hdr.blk.bsize = btt_bsize;
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+       enum pool_type type;
+};
+
+static const struct step steps[] = {
+       {
+               .check  = blk_hdr_check,
+               .type   = POOL_TYPE_BLK
+       },
+       {
+               .fix    = blk_hdr_fix,
+               .type   = POOL_TYPE_BLK
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static inline int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+       ASSERTeq(ppc->pool->params.type, POOL_TYPE_BLK);
+
+       const struct step *step = &steps[loc->step++];
+
+       if (!(step->type & ppc->pool->params.type))
+               return 0;
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (blk_read(ppc)) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return -1;
+       }
+
+       return check_answer_loop(ppc, loc, NULL, 1, step->fix);
+}
+
+/*
+ * check_blk -- entry point for pmemblk checks
+ */
+void
+check_blk(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+
+       /* do all checks */
+       while (CHECK_NOT_COMPLETE(loc, steps)) {
+               if (step_exe(ppc, loc))
+                       break;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_btt_info.c b/ceph/src/pmdk/src/libpmempool/check_btt_info.c
new file mode 100644 (file)
index 0000000..2ef14e4
--- /dev/null
@@ -0,0 +1,509 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * check_btt_info.c -- check BTT Info
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <endian.h>
+
+#include "out.h"
+#include "util.h"
+#include "btt.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum question {
+       Q_RESTORE_FROM_BACKUP,
+       Q_REGENERATE,
+       Q_REGENERATE_CHECKSUM,
+       Q_RESTORE_FROM_HEADER
+};
+
+/*
+ * location_release -- (internal) release check_btt_info_loc allocations
+ */
+static void
+location_release(location *loc)
+{
+       free(loc->arenap);
+       loc->arenap = NULL;
+}
+
+/*
+ * btt_info_checksum -- (internal) check BTT Info checksum
+ */
+static int
+btt_info_checksum(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       loc->arenap = calloc(1, sizeof(struct arena));
+       if (!loc->arenap) {
+               ERR("!calloc");
+               ppc->result = CHECK_RESULT_INTERNAL_ERROR;
+               CHECK_ERR(ppc, "cannot allocate memory for arena");
+               goto error_cleanup;
+       }
+
+       /* read the BTT Info header at well known offset */
+       if (pool_read(ppc->pool, &loc->arenap->btt_info,
+                       sizeof(loc->arenap->btt_info), loc->offset)) {
+               CHECK_ERR(ppc, "arena %u: cannot read BTT Info header",
+                       loc->arenap->id);
+               ppc->result = CHECK_RESULT_ERROR;
+               goto error_cleanup;
+       }
+
+       loc->arenap->id = ppc->pool->narenas;
+
+       /* BLK is consistent even without BTT Layout */
+       if (ppc->pool->params.type == POOL_TYPE_BLK) {
+               int is_zeroed = util_is_zeroed((const void *)
+                       &loc->arenap->btt_info, sizeof(loc->arenap->btt_info));
+               if (is_zeroed) {
+                       CHECK_INFO(ppc, "BTT Layout not written");
+                       loc->step = CHECK_STEP_COMPLETE;
+                       ppc->pool->blk_no_layout = 1;
+                       location_release(loc);
+                       check_end(ppc->data);
+                       return 0;
+               }
+       }
+
+       /* check consistency of BTT Info */
+       if (pool_btt_info_valid(&loc->arenap->btt_info)) {
+               CHECK_INFO(ppc, "arena %u: BTT Info header checksum correct",
+                       loc->arenap->id);
+               loc->valid.btti_header = 1;
+       } else if (CHECK_IS_NOT(ppc, REPAIR)) {
+               CHECK_ERR(ppc, "arena %u: BTT Info header checksum incorrect",
+                       loc->arenap->id);
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               check_end(ppc->data);
+               goto error_cleanup;
+       }
+
+       return 0;
+
+error_cleanup:
+       location_release(loc);
+       return -1;
+}
+
+/*
+ * btt_info_backup -- (internal) check BTT Info backup
+ */
+static int
+btt_info_backup(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       /* check BTT Info backup consistency */
+       const size_t btt_info_size = sizeof(ppc->pool->bttc.btt_info);
+       uint64_t btt_info_off = pool_next_arena_offset(ppc->pool, loc->offset) -
+               btt_info_size;
+
+       if (pool_read(ppc->pool, &ppc->pool->bttc.btt_info, btt_info_size,
+                       btt_info_off)) {
+               CHECK_ERR(ppc, "arena %u: cannot read BTT Info backup",
+                       loc->arenap->id);
+               goto error;
+       }
+
+       /* check whether this BTT Info backup is valid */
+       if (pool_btt_info_valid(&ppc->pool->bttc.btt_info)) {
+               loc->valid.btti_backup = 1;
+
+               /* restore BTT Info from backup */
+               if (!loc->valid.btti_header && CHECK_IS(ppc, REPAIR))
+                       CHECK_ASK(ppc, Q_RESTORE_FROM_BACKUP, "arena %u: BTT "
+                               "Info header checksum incorrect.|Restore BTT "
+                               "Info from backup?", loc->arenap->id);
+       }
+
+       /*
+        * if BTT Info backup require repairs it will be fixed in further steps
+        */
+
+       return check_questions_sequence_validate(ppc);
+
+error:
+       ppc->result = CHECK_RESULT_ERROR;
+       location_release(loc);
+       return -1;
+}
+
+/*
+ * btt_info_from_backup_fix -- (internal) fix BTT Info using its backup
+ */
+static int
+btt_info_from_backup_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *ctx)
+{
+       LOG(3, NULL);
+
+       ASSERTeq(ctx, NULL);
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_RESTORE_FROM_BACKUP:
+               CHECK_INFO(ppc,
+                       "arena %u: restoring BTT Info header from backup",
+                       loc->arenap->id);
+
+               memcpy(&loc->arenap->btt_info, &ppc->pool->bttc.btt_info,
+                       sizeof(loc->arenap->btt_info));
+               loc->valid.btti_header = 1;
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * btt_info_gen -- (internal) ask whether try to regenerate BTT Info
+ */
+static int
+btt_info_gen(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (loc->valid.btti_header)
+               return 0;
+
+       ASSERT(CHECK_IS(ppc, REPAIR));
+
+       if (!loc->pool_valid.btti_offset) {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               check_end(ppc->data);
+               return CHECK_ERR(ppc, "can not find any valid BTT Info");
+       }
+
+       CHECK_ASK(ppc, Q_REGENERATE,
+               "arena %u: BTT Info header checksum incorrect.|Do you want to "
+               "regenerate BTT Info?", loc->arenap->id);
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * btt_info_gen_fix -- (internal) fix by regenerating BTT Info
+ */
+static int
+btt_info_gen_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *ctx)
+{
+       LOG(3, NULL);
+
+       ASSERTeq(ctx, NULL);
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_REGENERATE:
+               CHECK_INFO(ppc, "arena %u: regenerating BTT Info header",
+                       loc->arenap->id);
+
+               /*
+                * We do not have valid BTT Info backup so we get first valid
+                * BTT Info and try to calculate BTT Info for current arena
+                */
+               uint64_t arena_size = ppc->pool->set_file->size - loc->offset;
+               if (arena_size > BTT_MAX_ARENA)
+                       arena_size = BTT_MAX_ARENA;
+
+               uint64_t space_left = ppc->pool->set_file->size - loc->offset -
+                       arena_size;
+
+               struct btt_info *bttd = &loc->arenap->btt_info;
+               struct btt_info *btts = &loc->pool_valid.btti;
+
+               btt_info_convert2h(bttd);
+
+               /*
+                * all valid BTT Info structures have the same signature, UUID,
+                * parent UUID, flags, major, minor, external LBA size, internal
+                * LBA size, nfree, info size and data offset
+                */
+               memcpy(bttd->sig, btts->sig, BTTINFO_SIG_LEN);
+               memcpy(bttd->uuid, btts->uuid, BTTINFO_UUID_LEN);
+               memcpy(bttd->parent_uuid, btts->parent_uuid, BTTINFO_UUID_LEN);
+               memset(bttd->unused, 0, BTTINFO_UNUSED_LEN);
+               bttd->flags = btts->flags;
+               bttd->major = btts->major;
+               bttd->minor = btts->minor;
+
+               /* other parameters can be calculated */
+               if (btt_info_set(bttd, btts->external_lbasize, btts->nfree,
+                               arena_size, space_left)) {
+                       CHECK_ERR(ppc, "can not restore BTT Info");
+                       return -1;
+               }
+
+               ASSERTeq(bttd->external_lbasize, btts->external_lbasize);
+               ASSERTeq(bttd->internal_lbasize, btts->internal_lbasize);
+               ASSERTeq(bttd->nfree, btts->nfree);
+               ASSERTeq(bttd->infosize, btts->infosize);
+               ASSERTeq(bttd->dataoff, btts->dataoff);
+               return 0;
+
+       default:
+               ERR("not implemented question id: %u", question);
+               return -1;
+       }
+}
+
+/*
+ * btt_info_checksum_retry -- (internal) check BTT Info checksum
+ */
+static int
+btt_info_checksum_retry(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (loc->valid.btti_header)
+               return 0;
+
+       btt_info_convert2le(&loc->arenap->btt_info);
+
+       /* check consistency of BTT Info */
+       if (pool_btt_info_valid(&loc->arenap->btt_info)) {
+               CHECK_INFO(ppc, "arena %u: BTT Info header checksum correct",
+                       loc->arenap->id);
+               loc->valid.btti_header = 1;
+               return 0;
+       }
+
+       if (CHECK_IS_NOT(ppc, ADVANCED)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_INFO(ppc, REQUIRE_ADVANCED);
+               CHECK_ERR(ppc, "arena %u: BTT Info header checksum incorrect",
+                       loc->arenap->id);
+               check_end(ppc->data);
+               goto error_cleanup;
+       }
+
+       CHECK_ASK(ppc, Q_REGENERATE_CHECKSUM,
+               "arena %u: BTT Info header checksum incorrect.|Do you want to "
+               "regenerate BTT Info checksum?", loc->arenap->id);
+
+       return check_questions_sequence_validate(ppc);
+
+error_cleanup:
+       location_release(loc);
+       return -1;
+}
+
+/*
+ * btt_info_checksum_fix -- (internal) fix by regenerating BTT Info checksum
+ */
+static int
+btt_info_checksum_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *ctx)
+{
+       LOG(3, NULL);
+
+       ASSERTeq(ctx, NULL);
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_REGENERATE_CHECKSUM:
+               util_checksum(&loc->arenap->btt_info, sizeof(struct btt_info),
+                       &loc->arenap->btt_info.checksum, 1, 0);
+               loc->valid.btti_header = 1;
+               break;
+
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * btt_info_backup_checksum -- (internal) check BTT Info backup checksum
+ */
+static int
+btt_info_backup_checksum(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       ASSERT(loc->valid.btti_header);
+
+       if (loc->valid.btti_backup)
+               return 0;
+
+       /* BTT Info backup is not valid so it must be fixed */
+       if (CHECK_IS_NOT(ppc, REPAIR)) {
+               CHECK_ERR(ppc,
+                       "arena %u: BTT Info backup checksum incorrect",
+                       loc->arenap->id);
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               check_end(ppc->data);
+               goto error_cleanup;
+       }
+
+       CHECK_ASK(ppc, Q_RESTORE_FROM_HEADER,
+               "arena %u: BTT Info backup checksum incorrect.|Do you want to "
+               "restore it from BTT Info header?", loc->arenap->id);
+
+       return check_questions_sequence_validate(ppc);
+
+error_cleanup:
+       location_release(loc);
+       return -1;
+}
+
+/*
+ * btt_info_backup_fix -- (internal) prepare restore BTT Info backup from header
+ */
+static int
+btt_info_backup_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *ctx)
+{
+       LOG(3, NULL);
+
+       ASSERTeq(ctx, NULL);
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_RESTORE_FROM_HEADER:
+               /* BTT Info backup would be restored in check_write step */
+               CHECK_INFO(ppc,
+                       "arena %u: restoring BTT Info backup from header",
+                       loc->arenap->id);
+               break;
+
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+};
+
+static const struct step steps[] = {
+       {
+               .check          = btt_info_checksum,
+       },
+       {
+               .check          = btt_info_backup,
+       },
+       {
+               .fix            = btt_info_from_backup_fix,
+       },
+       {
+               .check          = btt_info_gen,
+       },
+       {
+               .fix            = btt_info_gen_fix,
+       },
+       {
+               .check          = btt_info_checksum_retry,
+       },
+       {
+               .fix            = btt_info_checksum_fix,
+       },
+       {
+               .check          = btt_info_backup_checksum,
+       },
+       {
+               .fix            = btt_info_backup_fix,
+       },
+       {
+               .check          = NULL,
+               .fix            = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static inline int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+
+       const struct step *step = &steps[loc->step++];
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (!check_answer_loop(ppc, loc, NULL, 1, step->fix))
+               return 0;
+
+       if (check_has_error(ppc->data))
+               location_release(loc);
+
+       return -1;
+}
+
+/*
+ * check_btt_info -- entry point for btt info check
+ */
+void
+check_btt_info(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+       uint64_t nextoff = 0;
+
+       /* initialize check */
+       if (!loc->offset) {
+               CHECK_INFO(ppc, "checking BTT Info headers");
+               loc->offset = sizeof(struct pool_hdr);
+               if (ppc->pool->params.type == POOL_TYPE_BLK)
+                       loc->offset += ALIGN_UP(sizeof(struct pmemblk) -
+                                       sizeof(struct pool_hdr),
+                                       BLK_FORMAT_DATA_ALIGN);
+
+               loc->pool_valid.btti_offset = pool_get_first_valid_btt(
+                       ppc->pool, &loc->pool_valid.btti, loc->offset, NULL);
+
+               /* Without valid BTT Info we can not proceed */
+               if (!loc->pool_valid.btti_offset) {
+                       if (ppc->pool->params.type == POOL_TYPE_BTT) {
+                               CHECK_ERR(ppc,
+                                       "can not find any valid BTT Info");
+                               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                               check_end(ppc->data);
+                               return;
+                       }
+               } else
+                       btt_info_convert2h(&loc->pool_valid.btti);
+       }
+
+       do {
+               /* jump to next offset */
+               if (ppc->result != CHECK_RESULT_PROCESS_ANSWERS) {
+                       loc->offset += nextoff;
+                       loc->step = 0;
+                       loc->valid.btti_header = 0;
+                       loc->valid.btti_backup = 0;
+               }
+
+               /* do all checks */
+               while (CHECK_NOT_COMPLETE(loc, steps)) {
+                       if (step_exe(ppc, loc) || ppc->pool->blk_no_layout == 1)
+                               return;
+               }
+
+               /* save offset and insert BTT to cache for next steps */
+               loc->arenap->offset = loc->offset;
+               loc->arenap->valid = true;
+               check_insert_arena(ppc, loc->arenap);
+               nextoff = le64toh(loc->arenap->btt_info.nextoff);
+
+       } while (nextoff > 0);
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_btt_map_flog.c b/ceph/src/pmdk/src/libpmempool/check_btt_map_flog.c
new file mode 100644 (file)
index 0000000..4d782ee
--- /dev/null
@@ -0,0 +1,685 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * check_btt_map_flog.c -- check BTT Map and Flog
+ */
+
+#include <stdint.h>
+#include <sys/param.h>
+#include <endian.h>
+
+#include "out.h"
+#include "btt.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum questions {
+       Q_REPAIR_MAP,
+       Q_REPAIR_FLOG,
+};
+
+/*
+ * flog_read -- (internal) read and convert flog from file
+ */
+static int
+flog_read(PMEMpoolcheck *ppc, struct arena *arenap)
+{
+       uint64_t flogoff = arenap->offset + arenap->btt_info.flogoff;
+       arenap->flogsize = btt_flog_size(arenap->btt_info.nfree);
+
+       arenap->flog = malloc(arenap->flogsize);
+       if (!arenap->flog) {
+               ERR("!malloc");
+               goto error_malloc;
+       }
+
+       if (pool_read(ppc->pool, arenap->flog, arenap->flogsize, flogoff))
+               goto error_read;
+
+       uint8_t *ptr = arenap->flog;
+       uint32_t i;
+       for (i = 0; i < arenap->btt_info.nfree; i++) {
+               struct btt_flog *flog = (struct btt_flog *)ptr;
+               btt_flog_convert2h(&flog[0]);
+               btt_flog_convert2h(&flog[1]);
+
+               ptr += BTT_FLOG_PAIR_ALIGN;
+       }
+
+       return 0;
+
+error_read:
+       free(arenap->flog);
+       arenap->flog = NULL;
+
+error_malloc:
+       return -1;
+}
+
+/*
+ * map_read -- (internal) read and convert map from file
+ */
+static int
+map_read(PMEMpoolcheck *ppc, struct arena *arenap)
+{
+       uint64_t mapoff = arenap->offset + arenap->btt_info.mapoff;
+       arenap->mapsize = btt_map_size(arenap->btt_info.external_nlba);
+
+       ASSERT(arenap->mapsize != 0);
+       arenap->map = malloc(arenap->mapsize);
+       if (!arenap->map) {
+               ERR("!malloc");
+               goto error_malloc;
+       }
+
+       if (pool_read(ppc->pool, arenap->map, arenap->mapsize, mapoff)) {
+               goto error_read;
+       }
+
+       uint32_t i;
+       for (i = 0; i < arenap->btt_info.external_nlba; i++)
+               arenap->map[i] = le32toh(arenap->map[i]);
+
+       return 0;
+
+error_read:
+       free(arenap->map);
+       arenap->map = NULL;
+error_malloc:
+       return -1;
+}
+
+/*
+ * list_item -- item for simple list
+ */
+struct list_item {
+       PMDK_LIST_ENTRY(list_item) next;
+       uint32_t val;
+};
+
+/*
+ * list -- simple list for storing numbers
+ */
+struct list {
+       PMDK_LIST_HEAD(listhead, list_item) head;
+       uint32_t count;
+};
+
+/*
+ * list_alloc -- (internal) allocate an empty list
+ */
+static struct list *
+list_alloc(void)
+{
+       struct list *list = malloc(sizeof(struct list));
+       if (!list) {
+               ERR("!malloc");
+               return NULL;
+       }
+       PMDK_LIST_INIT(&list->head);
+       list->count = 0;
+       return list;
+}
+
+/*
+ * list_push -- (internal) insert new element to the list
+ */
+static struct list_item *
+list_push(struct list *list, uint32_t val)
+{
+       struct list_item *item = malloc(sizeof(*item));
+       if (!item) {
+               ERR("!malloc");
+               return NULL;
+       }
+       item->val = val;
+       list->count++;
+       PMDK_LIST_INSERT_HEAD(&list->head, item, next);
+       return item;
+}
+
+/*
+ * list_pop -- (internal) pop element from list head
+ */
+static int
+list_pop(struct list *list, uint32_t *valp)
+{
+       if (!PMDK_LIST_EMPTY(&list->head)) {
+               struct list_item *i = PMDK_LIST_FIRST(&list->head);
+               PMDK_LIST_REMOVE(i, next);
+               if (valp)
+                       *valp = i->val;
+               free(i);
+
+               list->count--;
+
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * list_free -- (internal) free the list
+ */
+static void
+list_free(struct list *list)
+{
+       while (list_pop(list, NULL))
+               ;
+       free(list);
+}
+
+/*
+ * cleanup -- (internal) prepare resources for map and flog check
+ */
+static int
+cleanup(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (loc->list_unmap)
+               list_free(loc->list_unmap);
+       if (loc->list_flog_inval)
+               list_free(loc->list_flog_inval);
+       if (loc->list_inval)
+               list_free(loc->list_inval);
+       if (loc->fbitmap)
+               free(loc->fbitmap);
+       if (loc->bitmap)
+               free(loc->bitmap);
+       if (loc->dup_bitmap)
+               free(loc->dup_bitmap);
+
+       return 0;
+}
+
+/*
+ * init -- (internal) initialize map and flog check
+ */
+static int
+init(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       struct arena *arenap = loc->arenap;
+
+       /* read flog and map entries */
+       if (flog_read(ppc, arenap)) {
+               CHECK_ERR(ppc, "arena %u: cannot read BTT Flog", arenap->id);
+               goto error;
+       }
+
+       if (map_read(ppc, arenap)) {
+               CHECK_ERR(ppc, "arena %u: cannot read BTT Map", arenap->id);
+               goto error;
+       }
+
+       /* create bitmaps for checking duplicated blocks */
+       uint32_t bitmapsize = howmany(arenap->btt_info.internal_nlba, 8);
+       loc->bitmap = calloc(bitmapsize, 1);
+       if (!loc->bitmap) {
+               ERR("!calloc");
+               CHECK_ERR(ppc, "arena %u: cannot allocate memory for blocks "
+                       "bitmap", arenap->id);
+               goto error;
+       }
+
+       loc->dup_bitmap = calloc(bitmapsize, 1);
+       if (!loc->dup_bitmap) {
+               ERR("!calloc");
+               CHECK_ERR(ppc, "arena %u: cannot allocate memory for "
+                       "duplicated blocks bitmap", arenap->id);
+               goto error;
+       }
+
+       loc->fbitmap = calloc(bitmapsize, 1);
+       if (!loc->fbitmap) {
+               ERR("!calloc");
+               CHECK_ERR(ppc, "arena %u: cannot allocate memory for BTT Flog "
+                       "bitmap", arenap->id);
+               goto error;
+       }
+
+       /* list of invalid map entries */
+       loc->list_inval = list_alloc();
+       if (!loc->list_inval) {
+               CHECK_ERR(ppc,
+                       "arena %u: cannot allocate memory for invalid BTT map "
+                       "entries list", arenap->id);
+               goto error;
+       }
+
+       /* list of invalid flog entries */
+       loc->list_flog_inval = list_alloc();
+       if (!loc->list_flog_inval) {
+               CHECK_ERR(ppc,
+                       "arena %u: cannot allocate memory for invalid BTT Flog "
+                       "entries list", arenap->id);
+               goto error;
+       }
+
+       /* list of unmapped blocks */
+       loc->list_unmap = list_alloc();
+       if (!loc->list_unmap) {
+               CHECK_ERR(ppc,
+                       "arena %u: cannot allocate memory for unmaped blocks "
+                       "list", arenap->id);
+               goto error;
+       }
+
+       return 0;
+
+error:
+       ppc->result = CHECK_RESULT_ERROR;
+       cleanup(ppc, loc);
+       return -1;
+}
+
+/*
+ * map_get_postmap_lba -- extract postmap LBA from map entry
+ */
+static inline uint32_t
+map_get_postmap_lba(struct arena *arenap, uint32_t i)
+{
+       uint32_t entry = arenap->map[i];
+
+       /* if map record is in initial state (flags == 0b00) */
+       if (map_entry_is_initial(entry))
+               return i;
+
+       /* read postmap LBA otherwise */
+       return entry & BTT_MAP_ENTRY_LBA_MASK;
+}
+
+/*
+ * map_entry_check -- (internal) check single map entry
+ */
+static int
+map_entry_check(PMEMpoolcheck *ppc, location *loc, uint32_t i)
+{
+       struct arena *arenap = loc->arenap;
+       uint32_t lba = map_get_postmap_lba(arenap, i);
+
+       /* add duplicated and invalid entries to list */
+       if (lba < arenap->btt_info.internal_nlba) {
+               if (util_isset(loc->bitmap, lba)) {
+                       CHECK_INFO(ppc, "arena %u: BTT Map entry %u duplicated "
+                               "at %u", arenap->id, lba, i);
+                       util_setbit(loc->dup_bitmap, lba);
+                       if (!list_push(loc->list_inval, i))
+                               return -1;
+               } else
+                       util_setbit(loc->bitmap, lba);
+       } else {
+               CHECK_INFO(ppc, "arena %u: invalid BTT Map entry at %u",
+                       arenap->id, i);
+               if (!list_push(loc->list_inval, i))
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * flog_entry_check -- (internal) check single flog entry
+ */
+static int
+flog_entry_check(PMEMpoolcheck *ppc, location *loc, uint32_t i,
+       uint8_t **ptr)
+{
+       struct arena *arenap = loc->arenap;
+
+       /* flog entry consists of two btt_flog structures */
+       struct btt_flog *flog = (struct btt_flog *)*ptr;
+
+       int next;
+       struct btt_flog *flog_cur = btt_flog_get_valid(flog, &next);
+
+       /* insert invalid and duplicated indexes to list */
+       if (!flog_cur) {
+               CHECK_INFO(ppc, "arena %u: invalid BTT Flog entry at %u",
+                       arenap->id, i);
+               if (!list_push(loc->list_flog_inval, i))
+                       return -1;
+
+               goto next;
+       }
+
+       uint32_t entry = flog_cur->old_map & BTT_MAP_ENTRY_LBA_MASK;
+       uint32_t new_entry = flog_cur->new_map & BTT_MAP_ENTRY_LBA_MASK;
+
+       /*
+        * Check if lba is in extranal_nlba range, and check if both old_map and
+        * new_map are in internal_nlba range.
+        */
+       if (flog_cur->lba >= arenap->btt_info.external_nlba ||
+                       entry >= arenap->btt_info.internal_nlba ||
+                       new_entry >= arenap->btt_info.internal_nlba) {
+               CHECK_INFO(ppc, "arena %u: invalid BTT Flog entry at %u",
+                       arenap->id, i);
+               if (!list_push(loc->list_flog_inval, i))
+                       return -1;
+
+               goto next;
+       }
+
+       if (util_isset(loc->fbitmap, entry)) {
+               /*
+                * here we have two flog entries which holds the same free block
+                */
+               CHECK_INFO(ppc, "arena %u: duplicated BTT Flog entry at %u\n",
+                       arenap->id, i);
+               if (!list_push(loc->list_flog_inval, i))
+                       return -1;
+       } else if (util_isset(loc->bitmap, entry)) {
+               /* here we have probably an unfinished write */
+               if (util_isset(loc->bitmap, new_entry)) {
+                       /* Both old_map and new_map are already used in map. */
+                       CHECK_INFO(ppc, "arena %u: duplicated BTT Flog entry "
+                               "at %u", arenap->id, i);
+                       util_setbit(loc->dup_bitmap, new_entry);
+                       if (!list_push(loc->list_flog_inval, i))
+                               return -1;
+               } else {
+                       /*
+                        * Unfinished write. Next time pool is opened, the map
+                        * will be updated to new_map.
+                        */
+                       util_setbit(loc->bitmap, new_entry);
+                       util_setbit(loc->fbitmap, entry);
+               }
+       } else {
+               int flog_valid = 1;
+               /*
+                * Either flog entry is in its initial state:
+                * - current_btt_flog entry is first one in pair and
+                * - current_btt_flog.old_map == current_btt_flog.new_map and
+                * - current_btt_flog.seq == 0b01 and
+                * - second flog entry in pair is zeroed
+                * or
+                * current_btt_flog.old_map != current_btt_flog.new_map
+                */
+               if (entry == new_entry)
+                       flog_valid = (next == 1) && (flog_cur->seq == 1) &&
+                               util_is_zeroed((const void *)&flog[1],
+                               sizeof(flog[1]));
+
+               if (flog_valid) {
+                       /* totally fine case */
+                       util_setbit(loc->bitmap, entry);
+                       util_setbit(loc->fbitmap, entry);
+               } else {
+                       CHECK_INFO(ppc, "arena %u: invalid BTT Flog entry at "
+                               "%u", arenap->id, i);
+                       if (!list_push(loc->list_flog_inval, i))
+                               return -1;
+               }
+       }
+
+next:
+       *ptr += BTT_FLOG_PAIR_ALIGN;
+       return 0;
+}
+
+/*
+ * arena_map_flog_check -- (internal) check map and flog
+ */
+static int
+arena_map_flog_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       struct arena *arenap = loc->arenap;
+
+       /* check map entries */
+       uint32_t i;
+       for (i = 0; i < arenap->btt_info.external_nlba; i++) {
+               if (map_entry_check(ppc, loc, i))
+                       goto error_push;
+       }
+
+       /* check flog entries */
+       uint8_t *ptr = arenap->flog;
+       for (i = 0; i < arenap->btt_info.nfree; i++) {
+               if (flog_entry_check(ppc, loc, i, &ptr))
+                       goto error_push;
+       }
+
+       /* check unmapped blocks and insert to list */
+       for (i = 0; i < arenap->btt_info.internal_nlba; i++) {
+               if (!util_isset(loc->bitmap, i)) {
+                       CHECK_INFO(ppc, "arena %u: unmapped block %u",
+                               arenap->id, i);
+                       if (!list_push(loc->list_unmap, i))
+                               goto error_push;
+               }
+       }
+
+       if (loc->list_unmap->count)
+               CHECK_INFO(ppc, "arena %u: number of unmapped blocks: %u",
+                       arenap->id, loc->list_unmap->count);
+       if (loc->list_inval->count)
+               CHECK_INFO(ppc, "arena %u: number of invalid BTT Map entries: "
+                       "%u", arenap->id, loc->list_inval->count);
+       if (loc->list_flog_inval->count)
+               CHECK_INFO(ppc, "arena %u: number of invalid BTT Flog entries: "
+                       "%u", arenap->id, loc->list_flog_inval->count);
+
+       if (CHECK_IS_NOT(ppc, REPAIR) && loc->list_unmap->count > 0) {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               check_end(ppc->data);
+               goto cleanup;
+       }
+
+       /*
+        * We are able to repair if and only if number of unmapped blocks is
+        * equal to sum of invalid map and flog entries.
+        */
+       if (loc->list_unmap->count != (loc->list_inval->count +
+                       loc->list_flog_inval->count)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_ERR(ppc, "arena %u: cannot repair BTT Map and Flog",
+                       arenap->id);
+               goto cleanup;
+       }
+
+       if (CHECK_IS_NOT(ppc, ADVANCED) && loc->list_inval->count +
+                       loc->list_flog_inval->count > 0) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_INFO(ppc, REQUIRE_ADVANCED);
+               CHECK_ERR(ppc, "BTT Map and / or BTT Flog contain invalid "
+                       "entries");
+               check_end(ppc->data);
+               goto cleanup;
+       }
+
+       if (loc->list_inval->count > 0) {
+               CHECK_ASK(ppc, Q_REPAIR_MAP, "Do you want to repair invalid "
+                       "BTT Map entries?");
+       }
+
+       if (loc->list_flog_inval->count > 0) {
+               CHECK_ASK(ppc, Q_REPAIR_FLOG, "Do you want to repair invalid "
+                       "BTT Flog entries?");
+       }
+
+       return check_questions_sequence_validate(ppc);
+
+error_push:
+       CHECK_ERR(ppc, "arena %u: cannot allocate momory for list item",
+                       arenap->id);
+       ppc->result = CHECK_RESULT_ERROR;
+cleanup:
+       cleanup(ppc, loc);
+       return -1;
+}
+
+/*
+ * arena_map_flog_fix -- (internal) fix map and flog
+ */
+static int
+arena_map_flog_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *ctx)
+{
+       LOG(3, NULL);
+
+       ASSERTeq(ctx, NULL);
+       ASSERTne(loc, NULL);
+
+       struct arena *arenap = loc->arenap;
+       uint32_t inval;
+       uint32_t unmap;
+       switch (question) {
+       case Q_REPAIR_MAP:
+               /*
+                * Cause first of duplicated map entries seems valid till we
+                * find second of them we must find all first map entries
+                * pointing to the postmap LBA's we know are duplicated to mark
+                * them with error flag.
+                */
+               for (uint32_t i = 0; i < arenap->btt_info.external_nlba; i++) {
+                       uint32_t lba = map_get_postmap_lba(arenap, i);
+                       if (lba >= arenap->btt_info.internal_nlba)
+                               continue;
+
+                       if (!util_isset(loc->dup_bitmap, lba))
+                               continue;
+
+                       arenap->map[i] = BTT_MAP_ENTRY_ERROR | lba;
+                       util_clrbit(loc->dup_bitmap, lba);
+                       CHECK_INFO(ppc,
+                               "arena %u: storing 0x%x at %u BTT Map entry",
+                               arenap->id, arenap->map[i], i);
+               }
+
+               /*
+                * repair invalid or duplicated map entries by using unmapped
+                * blocks
+                */
+               while (list_pop(loc->list_inval, &inval)) {
+                       if (!list_pop(loc->list_unmap, &unmap)) {
+                               ppc->result = CHECK_RESULT_ERROR;
+                               return -1;
+                       }
+                       arenap->map[inval] = unmap | BTT_MAP_ENTRY_ERROR;
+                       CHECK_INFO(ppc, "arena %u: storing 0x%x at %u BTT Map "
+                               "entry", arenap->id, arenap->map[inval], inval);
+               }
+               break;
+       case Q_REPAIR_FLOG:
+               /* repair invalid flog entries using unmapped blocks */
+               while (list_pop(loc->list_flog_inval, &inval)) {
+                       if (!list_pop(loc->list_unmap, &unmap)) {
+                               ppc->result = CHECK_RESULT_ERROR;
+                               return -1;
+                       }
+
+                       struct btt_flog *flog = (struct btt_flog *)
+                               (arenap->flog + inval * BTT_FLOG_PAIR_ALIGN);
+                       memset(&flog[1], 0, sizeof(flog[1]));
+                       uint32_t entry = unmap | BTT_MAP_ENTRY_ERROR;
+                       flog[0].lba = inval;
+                       flog[0].new_map = entry;
+                       flog[0].old_map = entry;
+                       flog[0].seq = 1;
+
+                       CHECK_INFO(ppc, "arena %u: repairing BTT Flog at %u "
+                               "with free block entry 0x%x", loc->arenap->id,
+                               inval, entry);
+               }
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+};
+
+static const struct step steps[] = {
+       {
+               .check  = init,
+       },
+       {
+               .check  = arena_map_flog_check,
+       },
+       {
+               .fix    = arena_map_flog_fix,
+       },
+       {
+               .check  = cleanup,
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static inline int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+
+       const struct step *step = &steps[loc->step++];
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (!check_answer_loop(ppc, loc, NULL, 1, step->fix))
+               return 0;
+
+       cleanup(ppc, loc);
+       return -1;
+}
+
+/*
+ * check_btt_map_flog -- perform check and fixing of map and flog
+ */
+void
+check_btt_map_flog(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+
+       if (ppc->pool->blk_no_layout)
+               return;
+
+       /* initialize check */
+       if (!loc->arenap && loc->narena == 0 &&
+                       ppc->result != CHECK_RESULT_PROCESS_ANSWERS) {
+               CHECK_INFO(ppc, "checking BTT Map and Flog");
+               loc->arenap = PMDK_TAILQ_FIRST(&ppc->pool->arenas);
+               loc->narena = 0;
+       }
+
+       while (loc->arenap != NULL) {
+               /* add info about checking next arena */
+               if (ppc->result != CHECK_RESULT_PROCESS_ANSWERS &&
+                               loc->step == 0) {
+                       CHECK_INFO(ppc, "arena %u: checking BTT Map and Flog",
+                               loc->narena);
+               }
+
+               /* do all checks */
+               while (CHECK_NOT_COMPLETE(loc, steps)) {
+                       if (step_exe(ppc, loc))
+                               return;
+               }
+
+               /* jump to next arena */
+               loc->arenap = PMDK_TAILQ_NEXT(loc->arenap, next);
+               loc->narena++;
+               loc->step = 0;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_log.c b/ceph/src/pmdk/src/libpmempool/check_log.c
new file mode 100644 (file)
index 0000000..b751859
--- /dev/null
@@ -0,0 +1,209 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * check_log.c -- check pmemlog
+ */
+
+#include <inttypes.h>
+#include <sys/param.h>
+#include <endian.h>
+
+#include "out.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum question {
+       Q_LOG_START_OFFSET,
+       Q_LOG_END_OFFSET,
+       Q_LOG_WRITE_OFFSET,
+};
+
+/*
+ * log_read -- (internal) read pmemlog header
+ */
+static int
+log_read(PMEMpoolcheck *ppc)
+{
+       /*
+        * Here we want to read the pmemlog header without the pool_hdr as we've
+        * already done it before.
+        *
+        * Take the pointer to fields right after pool_hdr, compute the size and
+        * offset of remaining fields.
+        */
+       uint8_t *ptr = (uint8_t *)&ppc->pool->hdr.log;
+       ptr += sizeof(ppc->pool->hdr.log.hdr);
+
+       size_t size = sizeof(ppc->pool->hdr.log) -
+               sizeof(ppc->pool->hdr.log.hdr);
+       uint64_t offset = sizeof(ppc->pool->hdr.log.hdr);
+
+       if (pool_read(ppc->pool, ptr, size, offset))
+               return CHECK_ERR(ppc, "cannot read pmemlog structure");
+
+       /* endianness conversion */
+       log_convert2h(&ppc->pool->hdr.log);
+       return 0;
+}
+
+/*
+ * log_hdr_check -- (internal) check pmemlog header
+ */
+static int
+log_hdr_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       CHECK_INFO(ppc, "checking pmemlog header");
+
+       if (log_read(ppc)) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return -1;
+       }
+
+       /* determine constant values for pmemlog */
+       const uint64_t d_start_offset =
+               roundup(sizeof(ppc->pool->hdr.log), LOG_FORMAT_DATA_ALIGN);
+
+       if (ppc->pool->hdr.log.start_offset != d_start_offset) {
+               if (CHECK_ASK(ppc, Q_LOG_START_OFFSET,
+                               "invalid pmemlog.start_offset: 0x%jx.|Do you "
+                               "want to set pmemlog.start_offset to default "
+                               "0x%jx?",
+                               ppc->pool->hdr.log.start_offset,
+                               d_start_offset))
+                       goto error;
+       }
+
+       if (ppc->pool->hdr.log.end_offset != ppc->pool->set_file->size) {
+               if (CHECK_ASK(ppc, Q_LOG_END_OFFSET,
+                               "invalid pmemlog.end_offset: 0x%jx.|Do you "
+                               "want to set pmemlog.end_offset to 0x%jx?",
+                               ppc->pool->hdr.log.end_offset,
+                               ppc->pool->set_file->size))
+                       goto error;
+       }
+
+       if (ppc->pool->hdr.log.write_offset < d_start_offset ||
+               ppc->pool->hdr.log.write_offset > ppc->pool->set_file->size) {
+               if (CHECK_ASK(ppc, Q_LOG_WRITE_OFFSET,
+                               "invalid pmemlog.write_offset: 0x%jx.|Do you "
+                               "want to set pmemlog.write_offset to "
+                               "pmemlog.end_offset?",
+                               ppc->pool->hdr.log.write_offset))
+                       goto error;
+       }
+
+       if (ppc->result == CHECK_RESULT_CONSISTENT ||
+               ppc->result == CHECK_RESULT_REPAIRED)
+               CHECK_INFO(ppc, "pmemlog header correct");
+
+       return check_questions_sequence_validate(ppc);
+
+error:
+       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+       check_end(ppc->data);
+       return -1;
+}
+
+/*
+ * log_hdr_fix -- (internal) fix pmemlog header
+ */
+static int
+log_hdr_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question, void *ctx)
+{
+       LOG(3, NULL);
+
+       uint64_t d_start_offset;
+
+       switch (question) {
+       case Q_LOG_START_OFFSET:
+               /* determine constant values for pmemlog */
+               d_start_offset = roundup(sizeof(ppc->pool->hdr.log),
+                       LOG_FORMAT_DATA_ALIGN);
+               CHECK_INFO(ppc, "setting pmemlog.start_offset to 0x%jx",
+                       d_start_offset);
+               ppc->pool->hdr.log.start_offset = d_start_offset;
+               break;
+       case Q_LOG_END_OFFSET:
+               CHECK_INFO(ppc, "setting pmemlog.end_offset to 0x%jx",
+                       ppc->pool->set_file->size);
+               ppc->pool->hdr.log.end_offset = ppc->pool->set_file->size;
+                       break;
+       case Q_LOG_WRITE_OFFSET:
+               CHECK_INFO(ppc, "setting pmemlog.write_offset to "
+                       "pmemlog.end_offset");
+               ppc->pool->hdr.log.write_offset = ppc->pool->set_file->size;
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+       enum pool_type type;
+};
+
+static const struct step steps[] = {
+       {
+               .check  = log_hdr_check,
+               .type   = POOL_TYPE_LOG
+       },
+       {
+               .fix    = log_hdr_fix,
+               .type   = POOL_TYPE_LOG
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static inline int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+       ASSERTeq(ppc->pool->params.type, POOL_TYPE_LOG);
+
+       const struct step *step = &steps[loc->step++];
+
+       if (!(step->type & ppc->pool->params.type))
+               return 0;
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (log_read(ppc)) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return -1;
+       }
+
+       return check_answer_loop(ppc, loc, NULL, 1,  step->fix);
+}
+
+/*
+ * check_log -- entry point for pmemlog checks
+ */
+void
+check_log(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+
+       /* do all checks */
+       while (CHECK_NOT_COMPLETE(loc, steps)) {
+               if (step_exe(ppc, loc))
+                       break;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_pool_hdr.c b/ceph/src/pmdk/src/libpmempool/check_pool_hdr.c
new file mode 100644 (file)
index 0000000..9d24855
--- /dev/null
@@ -0,0 +1,1010 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * check_pool_hdr.c -- pool header check
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/mman.h>
+#include <endian.h>
+
+#include "out.h"
+#include "util_pmem.h"
+#include "libpmempool.h"
+#include "libpmem.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "set.h"
+#include "check_util.h"
+
+#define NO_COMMON_POOLSET_UUID "%sno common pool_hdr.poolset_uuid"
+#define INVALID_UUID           "%sinvalid pool_hdr.uuid"
+#define INVALID_CHECKSUM       "%sinvalid pool_hdr.checksum"
+
+enum question {
+       Q_DEFAULT_SIGNATURE,
+       Q_DEFAULT_MAJOR,
+       Q_DEFAULT_COMPAT_FEATURES,
+       Q_DEFAULT_INCOMPAT_FEATURES,
+       Q_DEFAULT_RO_COMPAT_FEATURES,
+       Q_ZERO_UNUSED_AREA,
+       Q_ARCH_FLAGS,
+       Q_CRTIME,
+       Q_CHECKSUM,
+       Q_POOLSET_UUID_SET,
+       Q_POOLSET_UUID_FROM_BTT_INFO,
+       Q_POOLSET_UUID_REGENERATE,
+       Q_UUID_SET,
+       Q_UUID_REGENERATE,
+       Q_NEXT_PART_UUID_SET,
+       Q_PREV_PART_UUID_SET,
+       Q_NEXT_REPL_UUID_SET,
+       Q_PREV_REPL_UUID_SET
+};
+
+/*
+ * pool_hdr_possible_type -- (internal) return possible type of pool
+ */
+static enum pool_type
+pool_hdr_possible_type(PMEMpoolcheck *ppc)
+{
+       if (pool_blk_get_first_valid_arena(ppc->pool, &ppc->pool->bttc))
+               return POOL_TYPE_BLK;
+
+       return POOL_TYPE_UNKNOWN;
+}
+
+/*
+ * pool_hdr_valid -- (internal) return true if pool header is valid
+ */
+static int
+pool_hdr_valid(struct pool_hdr *hdrp)
+{
+       return !util_is_zeroed((void *)hdrp, sizeof(*hdrp)) &&
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum, 0,
+                       POOL_HDR_CSUM_END_OFF(hdrp));
+}
+
+/*
+ * pool_supported -- (internal) check if pool type is supported
+ */
+static int
+pool_supported(enum pool_type type)
+{
+       switch (type) {
+       case POOL_TYPE_LOG:
+               return 1;
+       case POOL_TYPE_BLK:
+               return 1;
+       case POOL_TYPE_OBJ:
+       default:
+               return 0;
+       }
+}
+
+/*
+ * pool_hdr_preliminary_check -- (internal) check pool header checksum and pool
+ *     parameters
+ */
+static int
+pool_hdr_preliminary_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       CHECK_INFO(ppc, "%schecking pool header", loc->prefix);
+
+       if (util_is_zeroed((void *)&loc->hdr, sizeof(loc->hdr))) {
+               if (CHECK_IS_NOT(ppc, REPAIR)) {
+                       check_end(ppc->data);
+                       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                       return CHECK_ERR(ppc, "%sempty pool hdr", loc->prefix);
+               }
+       } else if (loc->hdr_valid) {
+               enum pool_type type = pool_hdr_get_type(&loc->hdr);
+               if (type == POOL_TYPE_UNKNOWN) {
+                       if (CHECK_IS_NOT(ppc, REPAIR)) {
+                               check_end(ppc->data);
+                               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                               return CHECK_ERR(ppc, "%sinvalid signature",
+                                       loc->prefix);
+                       }
+
+                       CHECK_INFO(ppc, "%sinvalid signature", loc->prefix);
+               } else {
+                       /* valid check sum */
+                       CHECK_INFO(ppc, "%spool header correct",
+                               loc->prefix);
+                       loc->step = CHECK_STEP_COMPLETE;
+                       return 0;
+               }
+       } else if (CHECK_IS_NOT(ppc, REPAIR)) {
+               check_end(ppc->data);
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               return CHECK_ERR(ppc, "%sincorrect pool header", loc->prefix);
+       } else {
+               CHECK_INFO(ppc, "%sincorrect pool header", loc->prefix);
+       }
+
+       ASSERT(CHECK_IS(ppc, REPAIR));
+
+       if (ppc->pool->params.type == POOL_TYPE_UNKNOWN) {
+               ppc->pool->params.type = pool_hdr_possible_type(ppc);
+               if (ppc->pool->params.type == POOL_TYPE_UNKNOWN) {
+                       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+                       return CHECK_ERR(ppc, "cannot determine pool type");
+               }
+       }
+
+       if (!pool_supported(ppc->pool->params.type)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               return CHECK_ERR(ppc, "the repair of %s pools is not supported",
+                       pool_get_pool_type_str(ppc->pool->params.type));
+       }
+
+       return 0;
+}
+
+/*
+ * pool_hdr_default_check -- (internal) check some default values in pool header
+ */
+static int
+pool_hdr_default_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       ASSERT(CHECK_IS(ppc, REPAIR));
+
+       struct pool_hdr def_hdr;
+       pool_hdr_default(ppc->pool->params.type, &def_hdr);
+
+       if (memcmp(loc->hdr.signature, def_hdr.signature, POOL_HDR_SIG_LEN)) {
+               CHECK_ASK(ppc, Q_DEFAULT_SIGNATURE,
+                       "%spool_hdr.signature is not valid.|Do you want to set "
+                       "it to %.8s?", loc->prefix, def_hdr.signature);
+       }
+
+       if (loc->hdr.major != def_hdr.major) {
+               CHECK_ASK(ppc, Q_DEFAULT_MAJOR,
+                       "%spool_hdr.major is not valid.|Do you want to set it "
+                       "to default value 0x%x?", loc->prefix, def_hdr.major);
+       }
+
+       features_t unknown = util_get_unknown_features(
+                       loc->hdr.features, def_hdr.features);
+       if (unknown.compat) {
+               CHECK_ASK(ppc, Q_DEFAULT_COMPAT_FEATURES,
+                       "%spool_hdr.features.compat is not valid.|Do you want "
+                       "to set it to default value 0x%x?", loc->prefix,
+                       def_hdr.features.compat);
+       }
+
+       if (unknown.incompat) {
+               CHECK_ASK(ppc, Q_DEFAULT_INCOMPAT_FEATURES,
+                       "%spool_hdr.features.incompat is not valid.|Do you "
+                       "want to set it to default value 0x%x?", loc->prefix,
+                       def_hdr.features.incompat);
+       }
+
+       if (unknown.ro_compat) {
+               CHECK_ASK(ppc, Q_DEFAULT_RO_COMPAT_FEATURES,
+                       "%spool_hdr.features.ro_compat is not valid.|Do you "
+                       "want to set it to default value 0x%x?", loc->prefix,
+                       def_hdr.features.ro_compat);
+       }
+
+       if (!util_is_zeroed(loc->hdr.unused, sizeof(loc->hdr.unused))) {
+               CHECK_ASK(ppc, Q_ZERO_UNUSED_AREA,
+                       "%sunused area is not filled by zeros.|Do you want to "
+                       "fill it up?", loc->prefix);
+       }
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_default_fix -- (internal) fix some default values in pool header
+ */
+static int
+pool_hdr_default_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+       struct pool_hdr def_hdr;
+       pool_hdr_default(ppc->pool->params.type, &def_hdr);
+
+       switch (question) {
+       case Q_DEFAULT_SIGNATURE:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.signature to %.8s",
+                       loc->prefix, def_hdr.signature);
+               memcpy(&loc->hdr.signature, &def_hdr.signature,
+                       POOL_HDR_SIG_LEN);
+               break;
+       case Q_DEFAULT_MAJOR:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.major to 0x%x", loc->prefix,
+                       def_hdr.major);
+               loc->hdr.major = def_hdr.major;
+               break;
+       case Q_DEFAULT_COMPAT_FEATURES:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.features.compat to 0x%x",
+                       loc->prefix, def_hdr.features.compat);
+               loc->hdr.features.compat = def_hdr.features.compat;
+               break;
+       case Q_DEFAULT_INCOMPAT_FEATURES:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.features.incompat to 0x%x",
+                       loc->prefix, def_hdr.features.incompat);
+               loc->hdr.features.incompat = def_hdr.features.incompat;
+               break;
+       case Q_DEFAULT_RO_COMPAT_FEATURES:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.features.ro_compat to 0x%x",
+                       loc->prefix, def_hdr.features.ro_compat);
+               loc->hdr.features.ro_compat = def_hdr.features.ro_compat;
+               break;
+       case Q_ZERO_UNUSED_AREA:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.unused to zeros",
+                       loc->prefix);
+               memset(loc->hdr.unused, 0, sizeof(loc->hdr.unused));
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * pool_hdr_quick_check -- (internal) end check if pool header is valid
+ */
+static int
+pool_hdr_quick_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+       if (pool_hdr_valid(loc->hdrp))
+               loc->step = CHECK_STEP_COMPLETE;
+
+       return 0;
+}
+
+/*
+ * pool_hdr_nondefault -- (internal) validate custom value fields
+ */
+static int
+pool_hdr_nondefault(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (loc->hdr.crtime > (uint64_t)ppc->pool->set_file->mtime) {
+               const char * const error = "%spool_hdr.crtime is not valid";
+               if (CHECK_IS_NOT(ppc, REPAIR)) {
+                       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                       return CHECK_ERR(ppc, error, loc->prefix);
+               } else if (CHECK_IS_NOT(ppc, ADVANCED)) {
+                       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+                       CHECK_INFO(ppc, "%s" REQUIRE_ADVANCED, loc->prefix);
+                       return CHECK_ERR(ppc, error, loc->prefix);
+               }
+
+               CHECK_ASK(ppc, Q_CRTIME,
+                       "%spool_hdr.crtime is not valid.|Do you want to set it "
+                       "to file's modtime [%s]?", loc->prefix,
+                       check_get_time_str(ppc->pool->set_file->mtime));
+       }
+
+       if (loc->valid_part_hdrp &&
+                       memcmp(&loc->valid_part_hdrp->arch_flags,
+                               &loc->hdr.arch_flags,
+                               sizeof(struct arch_flags)) != 0) {
+               const char * const error = "%spool_hdr.arch_flags is not valid";
+               if (CHECK_IS_NOT(ppc, REPAIR)) {
+                       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                       return CHECK_ERR(ppc, error, loc->prefix);
+               }
+
+               CHECK_ASK(ppc, Q_ARCH_FLAGS,
+                       "%spool_hdr.arch_flags is not valid.|Do you want to "
+                       "copy it from a valid part?", loc->prefix);
+       }
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_nondefault_fix -- (internal) fix custom value fields
+ */
+static int
+pool_hdr_nondefault_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+       uint64_t *flags = NULL;
+
+       switch (question) {
+       case Q_CRTIME:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.crtime to file's modtime: "
+                       "%s", loc->prefix,
+                       check_get_time_str(ppc->pool->set_file->mtime));
+               util_convert2h_hdr_nocheck(&loc->hdr);
+               loc->hdr.crtime = (uint64_t)ppc->pool->set_file->mtime;
+               util_convert2le_hdr(&loc->hdr);
+               break;
+       case Q_ARCH_FLAGS:
+               flags = (uint64_t *)&loc->valid_part_hdrp->arch_flags;
+               CHECK_INFO(ppc, "%ssetting pool_hdr.arch_flags to 0x%08" PRIx64
+                               "%08" PRIx64, loc->prefix, flags[0], flags[1]);
+               util_convert2h_hdr_nocheck(&loc->hdr);
+               memcpy(&loc->hdr.arch_flags, &loc->valid_part_hdrp->arch_flags,
+                       sizeof(struct arch_flags));
+               util_convert2le_hdr(&loc->hdr);
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * pool_hdr_poolset_uuid -- (internal) check poolset_uuid field
+ */
+static int
+pool_hdr_poolset_uuid_find(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       /*
+        * If the pool header is valid and there is not other parts or replicas
+        * in the poolset its poolset_uuid is also valid.
+        */
+       if (loc->hdr_valid && loc->single_repl && loc->single_part)
+               return 0;
+
+       if (loc->replica != 0 || loc->part != 0)
+               goto after_lookup;
+
+       /* for blk pool we can take the UUID from BTT Info header */
+       if (ppc->pool->params.type == POOL_TYPE_BLK && ppc->pool->bttc.valid) {
+               loc->valid_puuid = &ppc->pool->bttc.btt_info.parent_uuid;
+               if (uuidcmp(loc->hdr.poolset_uuid, *loc->valid_puuid) != 0) {
+                       CHECK_ASK(ppc, Q_POOLSET_UUID_FROM_BTT_INFO,
+                               "%sinvalid pool_hdr.poolset_uuid.|Do you want "
+                               "to set it to %s from BTT Info?", loc->prefix,
+                               check_get_uuid_str(*loc->valid_puuid));
+                       goto exit_question;
+               }
+       }
+
+       if (loc->single_part && loc->single_repl) {
+               /*
+                * If the pool is not blk pool or BTT Info header is invalid
+                * there is no other way to validate poolset uuid.
+                */
+               return 0;
+       }
+
+       /*
+        * if all valid poolset part files have the same poolset uuid it is
+        * the valid poolset uuid
+        * if all part files have the same poolset uuid it is valid poolset uuid
+        */
+       struct pool_set *poolset = ppc->pool->set_file->poolset;
+       unsigned nreplicas = poolset->nreplicas;
+       uuid_t *common_puuid = loc->valid_puuid;
+       for (unsigned r = 0; r < nreplicas; r++) {
+               struct pool_replica *rep = REP(poolset, r);
+               for (unsigned p = 0; p < rep->nhdrs; p++) {
+                       struct pool_hdr *hdr = HDR(rep, p);
+
+                       /*
+                        * find poolset uuid if it is the same for all part
+                        * files
+                        */
+                       if (common_puuid == NULL) {
+                               if (r == 0 && p == 0) {
+                                       common_puuid = &hdr->poolset_uuid;
+                               }
+                       } else if (uuidcmp(*common_puuid, hdr->poolset_uuid)
+                                       != 0) {
+                               common_puuid = NULL;
+                       }
+
+                       if (!pool_hdr_valid(hdr))
+                               continue;
+
+                       /*
+                        * find poolset uuid if it is the same for all valid
+                        * part files
+                        */
+                       if (loc->valid_puuid == NULL) {
+                               loc->valid_puuid = &hdr->poolset_uuid;
+                       } else if (uuidcmp(*loc->valid_puuid, hdr->poolset_uuid)
+                                       != 0) {
+                               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                               return CHECK_ERR(ppc, "the poolset contains "
+                                       "part files from various poolsets");
+                       }
+               }
+       }
+
+       if (!loc->valid_puuid && common_puuid)
+               loc->valid_puuid = common_puuid;
+
+       if (loc->valid_puuid)
+               goto after_lookup;
+
+       if (CHECK_IS_NOT(ppc, REPAIR)) {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               return CHECK_ERR(ppc, NO_COMMON_POOLSET_UUID, loc->prefix);
+       } else if (CHECK_IS_NOT(ppc, ADVANCED)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_INFO(ppc, "%s" REQUIRE_ADVANCED, loc->prefix);
+               return CHECK_ERR(ppc, NO_COMMON_POOLSET_UUID, loc->prefix);
+       } else {
+               CHECK_ASK(ppc, Q_POOLSET_UUID_REGENERATE, NO_COMMON_POOLSET_UUID
+                       ".|Do you want to regenerate pool_hdr.poolset_uuid?",
+                       loc->prefix);
+               goto exit_question;
+       }
+
+after_lookup:
+       if (loc->valid_puuid) {
+               if (uuidcmp(*loc->valid_puuid, loc->hdr.poolset_uuid) != 0) {
+                       if (CHECK_IS_NOT(ppc, REPAIR)) {
+                               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                               return CHECK_ERR(ppc, "%sinvalid "
+                                       "pool_hdr.poolset_uuid", loc->prefix);
+                       }
+
+                       CHECK_ASK(ppc, Q_POOLSET_UUID_SET, "%sinvalid "
+                               "pool_hdr.poolset_uuid.|Do you want to set "
+                               "it to %s from a valid part file?", loc->prefix,
+                               check_get_uuid_str(*loc->valid_puuid));
+               }
+       }
+
+exit_question:
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_poolset_uuid_fix -- (internal) fix poolset_uuid field
+ */
+static int
+pool_hdr_poolset_uuid_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_POOLSET_UUID_SET:
+       case Q_POOLSET_UUID_FROM_BTT_INFO:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.poolset_uuid to %s",
+                       loc->prefix, check_get_uuid_str(*loc->valid_puuid));
+               memcpy(loc->hdr.poolset_uuid, loc->valid_puuid,
+                       POOL_HDR_UUID_LEN);
+               if (question == Q_POOLSET_UUID_SET)
+                       ppc->pool->uuid_op = UUID_NOT_FROM_BTT;
+               else
+                       ppc->pool->uuid_op = UUID_FROM_BTT;
+               break;
+       case Q_POOLSET_UUID_REGENERATE:
+               if (util_uuid_generate(loc->hdr.poolset_uuid) != 0) {
+                       ppc->result = CHECK_RESULT_INTERNAL_ERROR;
+                       return CHECK_ERR(ppc, "%suuid generation failed",
+                               loc->prefix);
+               }
+               CHECK_INFO(ppc, "%ssetting pool_hdr.pooset_uuid to %s",
+                       loc->prefix,
+                       check_get_uuid_str(loc->hdr.poolset_uuid));
+               ppc->pool->uuid_op = UUID_NOT_FROM_BTT;
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+#define COMPARE_TO_FIRST_PART_ONLY 2
+
+/*
+ * pool_hdr_uuid_find -- (internal) check UUID value
+ */
+static int
+pool_hdr_uuid_find(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       /*
+        * If the pool header is valid and there is not other parts or replicas
+        * in the poolset its uuid is also valid.
+        */
+       if (loc->hdr_valid && loc->single_repl && loc->single_part)
+               return 0;
+
+       int hdrs_valid[] = {
+               loc->next_part_hdr_valid, loc->prev_part_hdr_valid,
+               loc->next_repl_hdr_valid, loc->prev_repl_hdr_valid};
+       uuid_t *uuids[] = {
+               &loc->next_part_hdrp->prev_part_uuid,
+               &loc->prev_part_hdrp->next_part_uuid,
+               &loc->next_repl_hdrp->prev_repl_uuid,
+               &loc->prev_repl_hdrp->next_repl_uuid
+       };
+
+       /*
+        * if all valid poolset part files have the same uuid links to this part
+        * file it is valid uuid
+        * if all links have the same uuid and it is single file pool it is also
+        * the valid uuid
+        */
+       loc->valid_uuid = NULL;
+       if (loc->hdr_valid)
+               loc->valid_uuid = &loc->hdr.uuid;
+       uuid_t *common_uuid = uuids[0];
+
+       COMPILE_ERROR_ON(ARRAY_SIZE(uuids) != ARRAY_SIZE(hdrs_valid));
+       COMPILE_ERROR_ON(COMPARE_TO_FIRST_PART_ONLY >= ARRAY_SIZE(uuids));
+       for (unsigned i = 0; i < ARRAY_SIZE(uuids); ++i) {
+               if (i > 0 && common_uuid != NULL) {
+                       if (uuidcmp(*common_uuid, *uuids[i]) != 0) {
+                               common_uuid = NULL;
+                       }
+               }
+
+               if (i >= COMPARE_TO_FIRST_PART_ONLY && loc->part != 0)
+                       continue;
+
+               if (!hdrs_valid[i])
+                       continue;
+
+               if (!loc->valid_uuid) {
+                       loc->valid_uuid = uuids[i];
+               } else if (uuidcmp(*loc->valid_uuid, *uuids[i]) != 0) {
+                       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                       return CHECK_ERR(ppc, "%sambiguous pool_hdr.uuid",
+                               loc->prefix);
+               }
+       }
+
+       if (!loc->valid_uuid && common_uuid)
+               loc->valid_uuid = common_uuid;
+
+       if (loc->valid_uuid != NULL) {
+               if (uuidcmp(*loc->valid_uuid, loc->hdr.uuid) != 0) {
+                       CHECK_ASK(ppc, Q_UUID_SET, INVALID_UUID ".|Do you want "
+                               "to set it to %s from a valid part file?",
+                               loc->prefix,
+                               check_get_uuid_str(*loc->valid_uuid));
+               }
+       } else if (CHECK_IS(ppc, ADVANCED)) {
+               CHECK_ASK(ppc, Q_UUID_REGENERATE, INVALID_UUID ".|Do you want "
+                               "to regenerate it?", loc->prefix);
+       } else if (CHECK_IS(ppc, REPAIR)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_INFO(ppc, "%s" REQUIRE_ADVANCED, loc->prefix);
+               return CHECK_ERR(ppc, INVALID_UUID, loc->prefix);
+       } else {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               return CHECK_ERR(ppc, INVALID_UUID, loc->prefix);
+       }
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_uuid_fix -- (internal) fix UUID value
+ */
+static int
+pool_hdr_uuid_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_UUID_SET:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.uuid to %s", loc->prefix,
+                       check_get_uuid_str(*loc->valid_uuid));
+               memcpy(loc->hdr.uuid, loc->valid_uuid, POOL_HDR_UUID_LEN);
+               break;
+       case Q_UUID_REGENERATE:
+               if (util_uuid_generate(loc->hdr.uuid) != 0) {
+                       ppc->result = CHECK_RESULT_INTERNAL_ERROR;
+                       return CHECK_ERR(ppc, "%suuid generation failed",
+                               loc->prefix);
+               }
+               CHECK_INFO(ppc, "%ssetting pool_hdr.uuid to %s", loc->prefix,
+                       check_get_uuid_str(loc->hdr.uuid));
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * pool_hdr_uuid_links -- (internal) check UUID links values
+ */
+static int
+pool_hdr_uuid_links(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       /*
+        * If the pool header is valid and there is not other parts or replicas
+        * in the poolset its uuid links are also valid.
+        */
+       if (loc->hdr_valid && loc->single_repl && loc->single_part)
+               return 0;
+
+       uuid_t *links[] = {
+               &loc->hdr.next_part_uuid, &loc->hdr.prev_part_uuid,
+               &loc->hdr.next_repl_uuid, &loc->hdr.prev_repl_uuid};
+       uuid_t *uuids[] = {
+               &loc->next_part_hdrp->uuid, &loc->prev_part_hdrp->uuid,
+               &loc->next_repl_hdrp->uuid, &loc->prev_repl_hdrp->uuid
+       };
+       uint32_t questions[] = {
+               Q_NEXT_PART_UUID_SET, Q_PREV_PART_UUID_SET,
+               Q_NEXT_REPL_UUID_SET, Q_PREV_REPL_UUID_SET
+       };
+       const char *fields[] = {
+               "pool_hdr.next_part_uuid", "pool_hdr.prev_part_uuid",
+               "pool_hdr.next_repl_uuid", "pool_hdr.prev_repl_uuid"
+       };
+
+       COMPILE_ERROR_ON(ARRAY_SIZE(links) != ARRAY_SIZE(uuids));
+       COMPILE_ERROR_ON(ARRAY_SIZE(links) != ARRAY_SIZE(questions));
+       COMPILE_ERROR_ON(ARRAY_SIZE(links) != ARRAY_SIZE(fields));
+       for (uint64_t i = 0; i < ARRAY_SIZE(links); ++i) {
+               if (uuidcmp(*links[i], *uuids[i]) == 0)
+                       continue;
+
+               if (CHECK_IS(ppc, REPAIR)) {
+                       CHECK_ASK(ppc, questions[i],
+                               "%sinvalid %s.|Do you want to set it to a "
+                               "valid value?", loc->prefix, fields[i]);
+               } else {
+                       ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                       return CHECK_ERR(ppc, "%sinvalid %s", loc->prefix,
+                               fields[i]);
+               }
+       }
+
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_uuid_links_fix -- (internal) fix UUID links values
+ */
+static int
+pool_hdr_uuid_links_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_NEXT_PART_UUID_SET:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.next_part_uuid to %s",
+                       loc->prefix,
+                       check_get_uuid_str(loc->next_part_hdrp->uuid));
+               memcpy(loc->hdr.next_part_uuid, loc->next_part_hdrp->uuid,
+                       POOL_HDR_UUID_LEN);
+               break;
+       case Q_PREV_PART_UUID_SET:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.prev_part_uuid to %s",
+                       loc->prefix,
+                       check_get_uuid_str(loc->prev_part_hdrp->uuid));
+               memcpy(loc->hdr.prev_part_uuid, loc->prev_part_hdrp->uuid,
+                       POOL_HDR_UUID_LEN);
+               break;
+       case Q_NEXT_REPL_UUID_SET:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.next_repl_uuid to %s",
+                       loc->prefix,
+                       check_get_uuid_str(loc->next_repl_hdrp->uuid));
+               memcpy(loc->hdr.next_repl_uuid, loc->next_repl_hdrp->uuid,
+                       POOL_HDR_UUID_LEN);
+               break;
+       case Q_PREV_REPL_UUID_SET:
+               CHECK_INFO(ppc, "%ssetting pool_hdr.prev_repl_uuid to %s",
+                       loc->prefix,
+                       check_get_uuid_str(loc->prev_repl_hdrp->uuid));
+               memcpy(loc->hdr.prev_repl_uuid, loc->prev_repl_hdrp->uuid,
+                       POOL_HDR_UUID_LEN);
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+/*
+ * pool_hdr_checksum -- (internal) validate checksum
+ */
+static int
+pool_hdr_checksum(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (loc->hdr_valid)
+               return 0;
+
+       if (CHECK_IS_NOT(ppc, REPAIR)) {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               return CHECK_ERR(ppc, INVALID_CHECKSUM, loc->prefix);
+       } else if (CHECK_IS_NOT(ppc, ADVANCED)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               CHECK_INFO(ppc, "%s" REQUIRE_ADVANCED, loc->prefix);
+               return CHECK_ERR(ppc, INVALID_CHECKSUM, loc->prefix);
+       }
+
+       CHECK_ASK(ppc, Q_CHECKSUM, INVALID_CHECKSUM ".|Do you want to "
+               "regenerate checksum?", loc->prefix);
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * pool_hdr_checksum_fix -- (internal) fix checksum
+ */
+static int
+pool_hdr_checksum_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       ASSERTne(loc, NULL);
+
+       switch (question) {
+       case Q_CHECKSUM:
+               util_checksum(&loc->hdr, sizeof(loc->hdr), &loc->hdr.checksum,
+                       1, POOL_HDR_CSUM_END_OFF(&loc->hdr));
+               CHECK_INFO(ppc, "%ssetting pool_hdr.checksum to 0x%jx",
+                       loc->prefix, le64toh(loc->hdr.checksum));
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+};
+
+static const struct step steps_initial[] = {
+       {
+               .check  = pool_hdr_preliminary_check,
+       },
+       {
+               .check  = pool_hdr_default_check,
+       },
+       {
+               .fix    = pool_hdr_default_fix,
+               .check  = pool_hdr_quick_check,
+       },
+       {
+               .check  = pool_hdr_nondefault,
+       },
+       {
+               .fix    = pool_hdr_nondefault_fix,
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+static const struct step steps_uuids[] = {
+       {
+               .check  = pool_hdr_poolset_uuid_find,
+       },
+       {
+               .fix    = pool_hdr_poolset_uuid_fix,
+       },
+       {
+               .check  = pool_hdr_uuid_find,
+       },
+       {
+               .fix    = pool_hdr_uuid_fix,
+       },
+       {
+               .check  = pool_hdr_uuid_links,
+       },
+       {
+               .fix    = pool_hdr_uuid_links_fix,
+       },
+       {
+               .check  = pool_hdr_checksum,
+       },
+       {
+               .fix    = pool_hdr_checksum_fix,
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static int
+step_exe(PMEMpoolcheck *ppc, const struct step *steps, location *loc,
+       struct pool_replica *rep, unsigned nreplicas)
+{
+       const struct step *step = &steps[loc->step++];
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (!check_has_answer(ppc->data))
+               return 0;
+
+       if (check_answer_loop(ppc, loc, NULL, 1, step->fix))
+               return -1;
+
+       util_convert2le_hdr(&loc->hdr);
+       memcpy(loc->hdrp, &loc->hdr, sizeof(loc->hdr));
+       loc->hdr_valid = pool_hdr_valid(loc->hdrp);
+       util_persist_auto(rep->part[0].is_dev_dax, loc->hdrp,
+                       sizeof(*loc->hdrp));
+
+       util_convert2h_hdr_nocheck(&loc->hdr);
+       loc->pool_hdr_modified = 1;
+
+       /* execute check after fix if available */
+       if (step->check)
+               return step->check(ppc, loc);
+
+       return 0;
+}
+
+/*
+ * init_location_data -- (internal) prepare location information
+ */
+static void
+init_location_data(PMEMpoolcheck *ppc, location *loc)
+{
+       /* prepare prefix for messages */
+       unsigned nfiles = pool_set_files_count(ppc->pool->set_file);
+       if (ppc->result != CHECK_RESULT_PROCESS_ANSWERS) {
+               if (nfiles > 1) {
+                       int ret = util_snprintf(loc->prefix, PREFIX_MAX_SIZE,
+                               "replica %u part %u: ",
+                               loc->replica, loc->part);
+                       if (ret < 0)
+                               FATAL("!snprintf");
+               } else
+                       loc->prefix[0] = '\0';
+               loc->step = 0;
+       }
+
+       /* get neighboring parts and replicas and briefly validate them */
+       const struct pool_set *poolset = ppc->pool->set_file->poolset;
+       loc->single_repl = poolset->nreplicas == 1;
+       loc->single_part = poolset->replica[loc->replica]->nparts == 1;
+
+       struct pool_replica *rep = REP(poolset, loc->replica);
+       struct pool_replica *next_rep = REPN(poolset, loc->replica);
+       struct pool_replica *prev_rep = REPP(poolset, loc->replica);
+
+       loc->hdrp = HDR(rep, loc->part);
+       memcpy(&loc->hdr, loc->hdrp, sizeof(loc->hdr));
+       util_convert2h_hdr_nocheck(&loc->hdr);
+       loc->hdr_valid = pool_hdr_valid(loc->hdrp);
+
+       loc->next_part_hdrp = HDRN(rep, loc->part);
+       loc->prev_part_hdrp = HDRP(rep, loc->part);
+       loc->next_repl_hdrp = HDR(next_rep, 0);
+       loc->prev_repl_hdrp = HDR(prev_rep, 0);
+
+       loc->next_part_hdr_valid = pool_hdr_valid(loc->next_part_hdrp);
+       loc->prev_part_hdr_valid = pool_hdr_valid(loc->prev_part_hdrp);
+       loc->next_repl_hdr_valid = pool_hdr_valid(loc->next_repl_hdrp);
+       loc->prev_repl_hdr_valid = pool_hdr_valid(loc->prev_repl_hdrp);
+
+       if (!loc->valid_part_done || loc->valid_part_replica != loc->replica) {
+               loc->valid_part_hdrp = NULL;
+               for (unsigned p = 0; p < rep->nhdrs; ++p) {
+                       if (pool_hdr_valid(HDR(rep, p))) {
+                               loc->valid_part_hdrp = HDR(rep, p);
+                               break;
+                       }
+               }
+               loc->valid_part_done = true;
+       }
+}
+
+/*
+ * check_pool_hdr -- entry point for pool header checks
+ */
+void
+check_pool_hdr(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+       unsigned nreplicas = ppc->pool->set_file->poolset->nreplicas;
+       struct pool_set *poolset = ppc->pool->set_file->poolset;
+
+       for (; loc->replica < nreplicas; loc->replica++) {
+               struct pool_replica *rep = poolset->replica[loc->replica];
+               for (; loc->part < rep->nhdrs; loc->part++) {
+                       init_location_data(ppc, loc);
+
+                       /* do all checks */
+                       while (CHECK_NOT_COMPLETE(loc, steps_initial)) {
+                               ASSERT(loc->step < ARRAY_SIZE(steps_initial));
+                               if (step_exe(ppc, steps_initial, loc, rep,
+                                               nreplicas))
+                                       return;
+                       }
+               }
+
+               loc->part = 0;
+       }
+
+       memcpy(&ppc->pool->hdr.pool, poolset->replica[0]->part[0].hdr,
+               sizeof(struct pool_hdr));
+
+       if (loc->pool_hdr_modified) {
+               struct pool_hdr hdr;
+               memcpy(&hdr, &ppc->pool->hdr.pool, sizeof(struct pool_hdr));
+               util_convert2h_hdr_nocheck(&hdr);
+               pool_params_from_header(&ppc->pool->params, &hdr);
+       }
+}
+
+/*
+ * check_pool_hdr_uuids -- entry point for pool header links checks
+ */
+void
+check_pool_hdr_uuids(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       location *loc = check_get_step_data(ppc->data);
+       unsigned nreplicas = ppc->pool->set_file->poolset->nreplicas;
+       struct pool_set *poolset = ppc->pool->set_file->poolset;
+
+       for (; loc->replica < nreplicas; loc->replica++) {
+               struct pool_replica *rep = poolset->replica[loc->replica];
+               for (; loc->part < rep->nparts; loc->part++) {
+                       init_location_data(ppc, loc);
+
+                       /* do all checks */
+                       while (CHECK_NOT_COMPLETE(loc, steps_uuids)) {
+                               ASSERT(loc->step < ARRAY_SIZE(steps_uuids));
+                               if (step_exe(ppc, steps_uuids, loc, rep,
+                                               nreplicas))
+                                       return;
+                       }
+               }
+
+               loc->part = 0;
+       }
+
+       memcpy(&ppc->pool->hdr.pool, poolset->replica[0]->part[0].hdr,
+               sizeof(struct pool_hdr));
+
+       if (loc->pool_hdr_modified) {
+               struct pool_hdr hdr;
+               memcpy(&hdr, &ppc->pool->hdr.pool, sizeof(struct pool_hdr));
+               util_convert2h_hdr_nocheck(&hdr);
+               pool_params_from_header(&ppc->pool->params, &hdr);
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_sds.c b/ceph/src/pmdk/src/libpmempool/check_sds.c
new file mode 100644 (file)
index 0000000..520421e
--- /dev/null
@@ -0,0 +1,289 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * check_shutdown_state.c -- shutdown state check
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <sys/mman.h>
+#include <endian.h>
+
+#include "out.h"
+#include "util_pmem.h"
+#include "libpmempool.h"
+#include "libpmem.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "set.h"
+#include "check_util.h"
+
+enum question {
+       Q_RESET_SDS,
+};
+
+#define SDS_CHECK_STR  "checking shutdown state"
+#define SDS_OK_STR     "shutdown state correct"
+#define SDS_DIRTY_STR  "shutdown state is dirty"
+
+#define ADR_FAILURE_STR \
+       "an ADR failure was detected - your pool might be corrupted"
+
+#define ZERO_SDS_STR \
+       "Do you want to zero shutdown state?"
+
+#define RESET_SDS_STR \
+       "Do you want to reset shutdown state at your own risk? " \
+       "If you have more then one replica you will have to " \
+       "synchronize your pool after this operation."
+
+#define SDS_FAIL_MSG(hdrp) \
+       IGNORE_SDS(hdrp) ? SDS_DIRTY_STR : ADR_FAILURE_STR
+
+#define SDS_REPAIR_MSG(hdrp) \
+       IGNORE_SDS(hdrp) \
+               ? SDS_DIRTY_STR ".|" ZERO_SDS_STR \
+               : ADR_FAILURE_STR ".|" RESET_SDS_STR
+
+/*
+ * sds_check_replica -- (internal) check if replica is healthy
+ */
+static int
+sds_check_replica(location *loc)
+{
+       LOG(3, NULL);
+
+       struct pool_replica *rep = REP(loc->set, loc->replica);
+
+       if (rep->remote)
+               return 0;
+
+       /* make a copy of sds as we shouldn't modify a pool */
+       struct shutdown_state old_sds = loc->hdr.sds;
+       struct shutdown_state curr_sds;
+
+       if (IGNORE_SDS(&loc->hdr))
+               return util_is_zeroed(&old_sds, sizeof(old_sds)) ? 0 : -1;
+
+       shutdown_state_init(&curr_sds, NULL);
+
+       /* get current shutdown state */
+       for (unsigned p = 0; p < rep->nparts; ++p) {
+               if (shutdown_state_add_part(&curr_sds,
+                               PART(rep, p)->fd, NULL))
+                       return -1;
+       }
+
+       /* compare current and old shutdown state */
+       return shutdown_state_check(&curr_sds, &old_sds, NULL);
+}
+
+/*
+ * sds_check -- (internal) check shutdown_state
+ */
+static int
+sds_check(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       CHECK_INFO(ppc, "%s" SDS_CHECK_STR, loc->prefix);
+
+       /* shutdown state is valid */
+       if (!sds_check_replica(loc)) {
+               CHECK_INFO(ppc, "%s" SDS_OK_STR, loc->prefix);
+               loc->step = CHECK_STEP_COMPLETE;
+               return 0;
+       }
+
+       /* shutdown state is NOT valid and can NOT be repaired */
+       if (CHECK_IS_NOT(ppc, REPAIR)) {
+               check_end(ppc->data);
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               return CHECK_ERR(ppc, "%s%s", loc->prefix,
+                               SDS_FAIL_MSG(&loc->hdr));
+       }
+
+       /* shutdown state is NOT valid but can be repaired */
+       CHECK_ASK(ppc, Q_RESET_SDS, "%s%s", loc->prefix,
+                       SDS_REPAIR_MSG(&loc->hdr));
+       return check_questions_sequence_validate(ppc);
+}
+
+/*
+ * sds_fix -- (internal) fix shutdown state
+ */
+static int
+sds_fix(PMEMpoolcheck *ppc, location *loc, uint32_t question,
+       void *context)
+{
+       LOG(3, NULL);
+
+       switch (question) {
+       case Q_RESET_SDS:
+               CHECK_INFO(ppc, "%sresetting pool_hdr.sds", loc->prefix);
+               memset(&loc->hdr.sds, 0, sizeof(loc->hdr.sds));
+               ++loc->healthy_replicas;
+               break;
+       default:
+               ERR("not implemented question id: %u", question);
+       }
+       return 0;
+}
+
+struct step {
+       int (*check)(PMEMpoolcheck *, location *);
+       int (*fix)(PMEMpoolcheck *, location *, uint32_t, void *);
+};
+
+static const struct step steps[] = {
+       {
+               .check  = sds_check,
+       },
+       {
+               .fix    = sds_fix,
+       },
+       {
+               .check  = NULL,
+               .fix    = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static int
+step_exe(PMEMpoolcheck *ppc, const struct step *steps, location *loc)
+{
+       const struct step *step = &steps[loc->step++];
+
+       if (!step->fix)
+               return step->check(ppc, loc);
+
+       if (!check_has_answer(ppc->data))
+               return 0;
+
+       if (check_answer_loop(ppc, loc, NULL, 0 /* fail on no */, step->fix))
+               return -1;
+
+       util_convert2le_hdr(&loc->hdr);
+       memcpy(loc->hdrp, &loc->hdr, sizeof(loc->hdr));
+       util_persist_auto(loc->is_dev_dax, loc->hdrp, sizeof(*loc->hdrp));
+
+       util_convert2h_hdr_nocheck(&loc->hdr);
+       loc->pool_hdr_modified = 1;
+
+       return 0;
+}
+
+/*
+ * init_prefix -- prepare prefix for messages
+ */
+static void
+init_prefix(location *loc)
+{
+       if (loc->set->nreplicas > 1) {
+               int ret = util_snprintf(loc->prefix, PREFIX_MAX_SIZE,
+                       "replica %u: ",
+                       loc->replica);
+               if (ret < 0)
+                       FATAL("!snprintf");
+       } else
+               loc->prefix[0] = '\0';
+       loc->step = 0;
+}
+
+/*
+ * init_location_data -- (internal) prepare location information
+ */
+static void
+init_location_data(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERTeq(loc->part, 0);
+
+       loc->set = ppc->pool->set_file->poolset;
+
+       if (ppc->result != CHECK_RESULT_PROCESS_ANSWERS)
+               init_prefix(loc);
+
+       struct pool_replica *rep = REP(loc->set, loc->replica);
+       loc->hdrp = HDR(rep, loc->part);
+       memcpy(&loc->hdr, loc->hdrp, sizeof(loc->hdr));
+       util_convert2h_hdr_nocheck(&loc->hdr);
+       loc->is_dev_dax = PART(rep, 0)->is_dev_dax;
+}
+
+/*
+ * sds_get_healthy_replicas_num -- (internal) get number of healthy replicas
+ */
+static void
+sds_get_healthy_replicas_num(PMEMpoolcheck *ppc, location *loc)
+{
+       const unsigned nreplicas = ppc->pool->set_file->poolset->nreplicas;
+       loc->healthy_replicas = 0;
+       loc->part = 0;
+
+       for (; loc->replica < nreplicas; loc->replica++) {
+               init_location_data(ppc, loc);
+
+               if (!sds_check_replica(loc)) {
+                       ++loc->healthy_replicas; /* healthy replica found */
+               }
+       }
+
+       loc->replica = 0; /* reset replica index */
+}
+
+/*
+ * check_sds -- entry point for shutdown state checks
+ */
+void
+check_sds(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       const unsigned nreplicas = ppc->pool->set_file->poolset->nreplicas;
+       location *loc = check_get_step_data(ppc->data);
+
+       if (!loc->init_done) {
+               sds_get_healthy_replicas_num(ppc, loc);
+
+               if (loc->healthy_replicas == nreplicas) {
+                       /* all replicas have healthy shutdown state */
+                       /* print summary */
+                       for (; loc->replica < nreplicas; loc->replica++) {
+                               init_prefix(loc);
+                               CHECK_INFO(ppc, "%s" SDS_CHECK_STR,
+                                               loc->prefix);
+                               CHECK_INFO(ppc, "%s" SDS_OK_STR, loc->prefix);
+                       }
+                       return;
+               } else if (loc->healthy_replicas > 0) {
+                       ppc->sync_required = true;
+                       return;
+               }
+               loc->init_done = true;
+       }
+
+       /* produce single healthy replica */
+       loc->part = 0;
+       for (; loc->replica < nreplicas; loc->replica++) {
+               init_location_data(ppc, loc);
+
+               while (CHECK_NOT_COMPLETE(loc, steps)) {
+                       ASSERT(loc->step < ARRAY_SIZE(steps));
+                       if (step_exe(ppc, steps, loc))
+                               return;
+               }
+
+               if (loc->healthy_replicas)
+                       break;
+       }
+
+       if (loc->healthy_replicas == 0) {
+               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+               CHECK_ERR(ppc, "cannot complete repair, reverting changes");
+       } else if (loc->healthy_replicas < nreplicas) {
+               ppc->sync_required = true;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_util.c b/ceph/src/pmdk/src/libpmempool/check_util.c
new file mode 100644 (file)
index 0000000..a95967c
--- /dev/null
@@ -0,0 +1,669 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * check_util.c -- check utility functions
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "out.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+#define CHECK_END UINT_MAX
+
+/* separate info part of message from question part of message */
+#define MSG_SEPARATOR  '|'
+
+/* error part of message must have '.' at the end */
+#define MSG_PLACE_OF_SEPARATION        '.'
+#define MAX_MSG_STR_SIZE 8192
+
+#define CHECK_ANSWER_YES       "yes"
+#define CHECK_ANSWER_NO                "no"
+
+#define STR_MAX 256
+#define TIME_STR_FMT "%a %b %d %Y %H:%M:%S"
+
+#define UUID_STR_MAX 37
+
+enum check_answer {
+       PMEMPOOL_CHECK_ANSWER_EMPTY,
+       PMEMPOOL_CHECK_ANSWER_YES,
+       PMEMPOOL_CHECK_ANSWER_NO,
+       PMEMPOOL_CHECK_ANSWER_DEFAULT,
+};
+
+/* queue of check statuses */
+struct check_status {
+       PMDK_TAILQ_ENTRY(check_status) next;
+       struct pmempool_check_status status;
+       unsigned question;
+       enum check_answer answer;
+       char *msg;
+};
+
+PMDK_TAILQ_HEAD(check_status_head, check_status);
+
+/* check control context */
+struct check_data {
+       unsigned step;
+       location step_data;
+
+       struct check_status *error;
+       struct check_status_head infos;
+       struct check_status_head questions;
+       struct check_status_head answers;
+
+       struct check_status *check_status_cache;
+};
+
+/*
+ * check_data_alloc --  allocate and initialize check_data structure
+ */
+struct check_data *
+check_data_alloc(void)
+{
+       LOG(3, NULL);
+
+       struct check_data *data = calloc(1, sizeof(*data));
+       if (data == NULL) {
+               ERR("!calloc");
+               return NULL;
+       }
+
+       PMDK_TAILQ_INIT(&data->infos);
+       PMDK_TAILQ_INIT(&data->questions);
+       PMDK_TAILQ_INIT(&data->answers);
+
+       return data;
+}
+
+/*
+ * check_data_free -- clean and deallocate check_data
+ */
+void
+check_data_free(struct check_data *data)
+{
+       LOG(3, NULL);
+
+       if (data->error != NULL) {
+               free(data->error);
+               data->error = NULL;
+       }
+
+       if (data->check_status_cache != NULL) {
+               free(data->check_status_cache);
+               data->check_status_cache = NULL;
+       }
+
+       while (!PMDK_TAILQ_EMPTY(&data->infos)) {
+               struct check_status *statp = PMDK_TAILQ_FIRST(&data->infos);
+               PMDK_TAILQ_REMOVE(&data->infos, statp, next);
+               free(statp);
+       }
+
+       while (!PMDK_TAILQ_EMPTY(&data->questions)) {
+               struct check_status *statp = PMDK_TAILQ_FIRST(&data->questions);
+               PMDK_TAILQ_REMOVE(&data->questions, statp, next);
+               free(statp);
+       }
+
+       while (!PMDK_TAILQ_EMPTY(&data->answers)) {
+               struct check_status *statp = PMDK_TAILQ_FIRST(&data->answers);
+               PMDK_TAILQ_REMOVE(&data->answers, statp, next);
+               free(statp);
+       }
+
+       free(data);
+}
+
+/*
+ * check_step_get - return current check step number
+ */
+uint32_t
+check_step_get(struct check_data *data)
+{
+       return data->step;
+}
+
+/*
+ * check_step_inc -- move to next step number
+ */
+void
+check_step_inc(struct check_data *data)
+{
+       if (check_is_end_util(data))
+               return;
+
+       ++data->step;
+       memset(&data->step_data, 0, sizeof(location));
+}
+
+/*
+ * check_get_step_data -- return pointer to check step data
+ */
+location *
+check_get_step_data(struct check_data *data)
+{
+       return &data->step_data;
+}
+
+/*
+ * check_end -- mark check as ended
+ */
+void
+check_end(struct check_data *data)
+{
+       LOG(3, NULL);
+
+       data->step = CHECK_END;
+}
+
+/*
+ * check_is_end_util -- return if check has ended
+ */
+int
+check_is_end_util(struct check_data *data)
+{
+       return data->step == CHECK_END;
+}
+
+/*
+ * status_alloc -- (internal) allocate and initialize check_status
+ */
+static inline struct check_status *
+status_alloc(void)
+{
+       struct check_status *status = malloc(sizeof(*status));
+       if (!status)
+               FATAL("!malloc");
+       status->msg = malloc(sizeof(char) * MAX_MSG_STR_SIZE);
+       if (!status->msg) {
+               free(status);
+               FATAL("!malloc");
+       }
+       status->status.str.msg = status->msg;
+       status->answer = PMEMPOOL_CHECK_ANSWER_EMPTY;
+       status->question = CHECK_INVALID_QUESTION;
+       return status;
+}
+
+/*
+ * status_release -- (internal) release check_status
+ */
+static void
+status_release(struct check_status *status)
+{
+#ifdef _WIN32
+       /* dealloc duplicate string after conversion */
+       if (status->status.str.msg != status->msg)
+               free((void *)status->status.str.msg);
+#endif
+       free(status->msg);
+       free(status);
+}
+
+/*
+ * status_msg_info_only -- (internal) separate info part of the message
+ *
+ * If message is in form of "info.|question" it modifies it as follows
+ * "info\0|question"
+ */
+static inline int
+status_msg_info_only(const char *msg)
+{
+       char *sep = strchr(msg, MSG_SEPARATOR);
+       if (sep) {
+               ASSERTne(sep, msg);
+               --sep;
+               ASSERTeq(*sep, MSG_PLACE_OF_SEPARATION);
+               *sep = '\0';
+               return 0;
+       }
+       return -1;
+}
+
+/*
+ * status_msg_info_and_question -- (internal) join info and question
+ *
+ * If message is in form "info.|question" it will replace MSG_SEPARATOR '|' with
+ * space to get "info. question"
+ */
+static inline int
+status_msg_info_and_question(const char *msg)
+{
+       char *sep = strchr(msg, MSG_SEPARATOR);
+       if (sep) {
+               *sep = ' ';
+               return 0;
+       }
+       return -1;
+}
+
+/*
+ * status_push -- (internal) push single status object
+ */
+static int
+status_push(PMEMpoolcheck *ppc, struct check_status *st, uint32_t question)
+{
+       if (st->status.type == PMEMPOOL_CHECK_MSG_TYPE_ERROR) {
+               ASSERTeq(ppc->data->error, NULL);
+               ppc->data->error = st;
+               return -1;
+       } else if (st->status.type == PMEMPOOL_CHECK_MSG_TYPE_INFO) {
+               if (CHECK_IS(ppc, VERBOSE))
+                       PMDK_TAILQ_INSERT_TAIL(&ppc->data->infos, st, next);
+               else
+                       check_status_release(ppc, st);
+               return 0;
+       }
+
+       /* st->status.type == PMEMPOOL_CHECK_MSG_TYPE_QUESTION */
+       if (CHECK_IS_NOT(ppc, REPAIR)) {
+               /* error status */
+               if (status_msg_info_only(st->msg)) {
+                       ERR("no error message for the user");
+                       st->msg[0] = '\0';
+               }
+               st->status.type = PMEMPOOL_CHECK_MSG_TYPE_ERROR;
+               return status_push(ppc, st, question);
+       }
+
+       if (CHECK_IS(ppc, ALWAYS_YES)) {
+               if (!status_msg_info_only(st->msg)) {
+                       /* information status */
+                       st->status.type = PMEMPOOL_CHECK_MSG_TYPE_INFO;
+                       status_push(ppc, st, question);
+                       st = status_alloc();
+               }
+
+               /* answer status */
+               ppc->result = CHECK_RESULT_PROCESS_ANSWERS;
+               st->question = question;
+               st->answer = PMEMPOOL_CHECK_ANSWER_YES;
+               st->status.type = PMEMPOOL_CHECK_MSG_TYPE_QUESTION;
+               PMDK_TAILQ_INSERT_TAIL(&ppc->data->answers, st, next);
+       } else {
+               /* question message */
+               status_msg_info_and_question(st->msg);
+               st->question = question;
+               ppc->result = CHECK_RESULT_ASK_QUESTIONS;
+               st->answer = PMEMPOOL_CHECK_ANSWER_EMPTY;
+               PMDK_TAILQ_INSERT_TAIL(&ppc->data->questions, st, next);
+       }
+
+       return 0;
+}
+
+/*
+ * check_status_create -- create single status, push it to proper queue
+ *
+ * MSG_SEPARATOR character in fmt is treated as message separator. If creating
+ * question but check arguments do not allow to make any changes (asking any
+ * question is pointless) it takes part of message before MSG_SEPARATOR
+ * character and use it to create error message. Character just before separator
+ * must be a MSG_PLACE_OF_SEPARATION character. Return non 0 value if error
+ * status would be created.
+ *
+ * The arg is an additional argument for specified type of status.
+ */
+int
+check_status_create(PMEMpoolcheck *ppc, enum pmempool_check_msg_type type,
+       uint32_t arg, const char *fmt, ...)
+{
+       if (CHECK_IS_NOT(ppc, VERBOSE) && type == PMEMPOOL_CHECK_MSG_TYPE_INFO)
+               return 0;
+
+       struct check_status *st = status_alloc();
+       ASSERT(CHECK_IS(ppc, FORMAT_STR));
+
+       va_list ap;
+       va_start(ap, fmt);
+       int p = vsnprintf(st->msg, MAX_MSG_STR_SIZE, fmt, ap);
+       va_end(ap);
+
+       /* append possible strerror at the end of the message */
+       if (type != PMEMPOOL_CHECK_MSG_TYPE_QUESTION && arg && p > 0) {
+               char buff[UTIL_MAX_ERR_MSG];
+               util_strerror((int)arg, buff, UTIL_MAX_ERR_MSG);
+               int ret = util_snprintf(st->msg + p,
+                               MAX_MSG_STR_SIZE - (size_t)p, ": %s", buff);
+               if (ret < 0) {
+                       ERR("!snprintf");
+                       status_release(st);
+                       return -1;
+               }
+       }
+
+       st->status.type = type;
+
+       return status_push(ppc, st, arg);
+}
+
+/*
+ * check_status_release -- release single status object
+ */
+void
+check_status_release(PMEMpoolcheck *ppc, struct check_status *status)
+{
+       if (status->status.type == PMEMPOOL_CHECK_MSG_TYPE_ERROR)
+               ppc->data->error = NULL;
+
+       status_release(status);
+}
+
+/*
+ * pop_status -- (internal) pop single message from check_status queue
+ */
+static struct check_status *
+pop_status(struct check_data *data, struct check_status_head *queue)
+{
+       if (!PMDK_TAILQ_EMPTY(queue)) {
+               ASSERTeq(data->check_status_cache, NULL);
+               data->check_status_cache = PMDK_TAILQ_FIRST(queue);
+               PMDK_TAILQ_REMOVE(queue, data->check_status_cache, next);
+               return data->check_status_cache;
+       }
+
+       return NULL;
+}
+
+/*
+ * check_pop_question -- pop single question from questions queue
+ */
+struct check_status *
+check_pop_question(struct check_data *data)
+{
+       return pop_status(data, &data->questions);
+}
+
+/*
+ * check_pop_info -- pop single info from information queue
+ */
+struct check_status *
+check_pop_info(struct check_data *data)
+{
+       return pop_status(data, &data->infos);
+}
+
+/*
+ * check_pop_error -- pop error from state
+ */
+struct check_status *
+check_pop_error(struct check_data *data)
+{
+       if (data->error) {
+               ASSERTeq(data->check_status_cache, NULL);
+
+               data->check_status_cache = data->error;
+               data->error = NULL;
+               return data->check_status_cache;
+       }
+
+       return NULL;
+}
+
+#ifdef _WIN32
+void
+cache_to_utf8(struct check_data *data, char *buf, size_t size)
+{
+       if (data->check_status_cache == NULL)
+               return;
+
+       struct check_status *status = data->check_status_cache;
+
+       /* if it was a question, convert it and the answer to utf8 */
+       if (status->status.type == PMEMPOOL_CHECK_MSG_TYPE_QUESTION) {
+               struct pmempool_check_statusW *wstatus =
+                       (struct pmempool_check_statusW *)&status->status;
+               wchar_t *wstring = (wchar_t *)wstatus->str.msg;
+               status->status.str.msg = util_toUTF8(wstring);
+               if (status->status.str.msg == NULL)
+                       FATAL("!malloc");
+               util_free_UTF16(wstring);
+
+               if (util_toUTF8_buff(wstatus->str.answer, buf, size) != 0)
+                       FATAL("Invalid answer conversion %s",
+                               out_get_errormsg());
+               status->status.str.answer = buf;
+       }
+}
+#endif
+
+/*
+ * check_clear_status_cache -- release check_status from cache
+ */
+void
+check_clear_status_cache(struct check_data *data)
+{
+       if (data->check_status_cache) {
+               switch (data->check_status_cache->status.type) {
+               case PMEMPOOL_CHECK_MSG_TYPE_INFO:
+               case PMEMPOOL_CHECK_MSG_TYPE_ERROR:
+                       /*
+                        * Info and error statuses are disposable. After showing
+                        * them to the user we have to release them.
+                        */
+                       status_release(data->check_status_cache);
+                       data->check_status_cache = NULL;
+                       break;
+               case PMEMPOOL_CHECK_MSG_TYPE_QUESTION:
+                       /*
+                        * Question status after being showed to the user carry
+                        * users answer. It must be kept till answer would be
+                        * processed so it can not be released from cache. It
+                        * has to be pushed to the answers queue, processed and
+                        * released after that.
+                        */
+                       break;
+               default:
+                       ASSERT(0);
+               }
+       }
+}
+
+/*
+ * status_answer_push -- (internal) push single answer to answers queue
+ */
+static void
+status_answer_push(struct check_data *data, struct check_status *st)
+{
+       ASSERTeq(st->status.type, PMEMPOOL_CHECK_MSG_TYPE_QUESTION);
+       PMDK_TAILQ_INSERT_TAIL(&data->answers, st, next);
+}
+
+/*
+ * check_push_answer -- process answer and push it to answers queue
+ */
+int
+check_push_answer(PMEMpoolcheck *ppc)
+{
+       if (ppc->data->check_status_cache == NULL)
+               return 0;
+
+       /* check if answer is "yes" or "no" */
+       struct check_status *status = ppc->data->check_status_cache;
+       if (status->status.str.answer != NULL) {
+               if (strcmp(status->status.str.answer, CHECK_ANSWER_YES) == 0)
+                       status->answer = PMEMPOOL_CHECK_ANSWER_YES;
+               else if (strcmp(status->status.str.answer, CHECK_ANSWER_NO)
+                               == 0)
+                       status->answer = PMEMPOOL_CHECK_ANSWER_NO;
+       }
+
+       if (status->answer == PMEMPOOL_CHECK_ANSWER_EMPTY) {
+               /* invalid answer provided */
+               status_answer_push(ppc->data, ppc->data->check_status_cache);
+               ppc->data->check_status_cache = NULL;
+               CHECK_INFO(ppc, "Answer must be either %s or %s",
+                       CHECK_ANSWER_YES, CHECK_ANSWER_NO);
+               return -1;
+       }
+
+       /* push answer */
+       PMDK_TAILQ_INSERT_TAIL(&ppc->data->answers,
+               ppc->data->check_status_cache, next);
+       ppc->data->check_status_cache = NULL;
+
+       return 0;
+}
+/*
+ * check_has_error - check if error exists
+ */
+bool
+check_has_error(struct check_data *data)
+{
+       return data->error != NULL;
+}
+
+/*
+ * check_has_answer - check if any answer exists
+ */
+bool
+check_has_answer(struct check_data *data)
+{
+       return !PMDK_TAILQ_EMPTY(&data->answers);
+}
+
+/*
+ * pop_answer -- (internal) pop single answer from answers queue
+ */
+static struct check_status *
+pop_answer(struct check_data *data)
+{
+       struct check_status *ret = NULL;
+       if (!PMDK_TAILQ_EMPTY(&data->answers)) {
+               ret = PMDK_TAILQ_FIRST(&data->answers);
+               PMDK_TAILQ_REMOVE(&data->answers, ret, next);
+       }
+       return ret;
+}
+
+/*
+ * check_status_get_util -- extract pmempool_check_status from check_status
+ */
+struct pmempool_check_status *
+check_status_get_util(struct check_status *status)
+{
+       return &status->status;
+}
+
+/*
+ * check_answer_loop -- loop through all available answers and process them
+ */
+int
+check_answer_loop(PMEMpoolcheck *ppc, location *data, void *ctx, int fail_on_no,
+       int (*callback)(PMEMpoolcheck *, location *, uint32_t, void *ctx))
+{
+       struct check_status *answer;
+
+       while ((answer = pop_answer(ppc->data)) != NULL) {
+               /* if answer is "no" we cannot fix an issue */
+               if (answer->answer != PMEMPOOL_CHECK_ANSWER_YES) {
+                       if (fail_on_no ||
+                               answer->answer != PMEMPOOL_CHECK_ANSWER_NO) {
+                               CHECK_ERR(ppc,
+                                       "cannot complete repair, reverting changes");
+                               ppc->result = CHECK_RESULT_NOT_CONSISTENT;
+                               goto error;
+                       }
+
+                       ppc->result = CHECK_RESULT_REPAIRED;
+                       check_status_release(ppc, answer);
+                       continue;
+               }
+
+               /* perform fix */
+               if (callback(ppc, data, answer->question, ctx)) {
+                       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+                       goto error;
+               }
+
+               if (ppc->result == CHECK_RESULT_ERROR)
+                       goto error;
+
+               /* fix succeeded */
+               ppc->result = CHECK_RESULT_REPAIRED;
+               check_status_release(ppc, answer);
+       }
+
+       return 0;
+
+error:
+       check_status_release(ppc, answer);
+       return -1;
+}
+
+/*
+ * check_questions_sequence_validate -- generate return value from result
+ *
+ * Sequence of questions can result in one of the following results: CONSISTENT,
+ * REPAIRED, ASK_QUESTIONS of PROCESS_ANSWERS. If result == ASK_QUESTIONS it
+ * returns -1 to indicate existence of unanswered questions.
+ */
+int
+check_questions_sequence_validate(PMEMpoolcheck *ppc)
+{
+       ASSERT(ppc->result == CHECK_RESULT_CONSISTENT ||
+               ppc->result == CHECK_RESULT_ASK_QUESTIONS ||
+               ppc->result == CHECK_RESULT_PROCESS_ANSWERS ||
+               ppc->result == CHECK_RESULT_REPAIRED);
+       if (ppc->result == CHECK_RESULT_ASK_QUESTIONS) {
+               ASSERT(!PMDK_TAILQ_EMPTY(&ppc->data->questions));
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * check_get_time_str -- returns time in human-readable format
+ */
+const char *
+check_get_time_str(time_t time)
+{
+       static char str_buff[STR_MAX] = {0, };
+       struct tm *tm = util_localtime(&time);
+
+       if (tm)
+               strftime(str_buff, STR_MAX, TIME_STR_FMT, tm);
+       else {
+               int ret = util_snprintf(str_buff, STR_MAX, "unknown");
+               if (ret < 0) {
+                       ERR("!snprintf");
+                       return "";
+               }
+       }
+       return str_buff;
+}
+
+/*
+ * check_get_uuid_str -- returns uuid in human readable format
+ */
+const char *
+check_get_uuid_str(uuid_t uuid)
+{
+       static char uuid_str[UUID_STR_MAX] = {0, };
+
+       int ret = util_uuid_to_string(uuid, uuid_str);
+       if (ret != 0) {
+               ERR("failed to covert uuid to string");
+               return "";
+       }
+       return uuid_str;
+}
+
+/*
+ * pmempool_check_insert_arena -- insert arena to list
+ */
+void
+check_insert_arena(PMEMpoolcheck *ppc, struct arena *arenap)
+{
+       PMDK_TAILQ_INSERT_TAIL(&ppc->pool->arenas, arenap, next);
+       ppc->pool->narenas++;
+}
diff --git a/ceph/src/pmdk/src/libpmempool/check_util.h b/ceph/src/pmdk/src/libpmempool/check_util.h
new file mode 100644 (file)
index 0000000..f94dcee
--- /dev/null
@@ -0,0 +1,196 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * check_util.h -- internal definitions check util
+ */
+#ifndef CHECK_UTIL_H
+#define CHECK_UTIL_H
+
+#include <time.h>
+#include <limits.h>
+#include <sys/param.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CHECK_STEP_COMPLETE    UINT_MAX
+#define CHECK_INVALID_QUESTION UINT_MAX
+
+#define REQUIRE_ADVANCED       "the following error can be fixed using " \
+                               "PMEMPOOL_CHECK_ADVANCED flag"
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+/* check control context */
+struct check_data;
+struct arena;
+
+/* queue of check statuses */
+struct check_status;
+
+/* container storing state of all check steps */
+#define PREFIX_MAX_SIZE 30
+typedef struct {
+       unsigned init_done;
+       unsigned step;
+
+       unsigned replica;
+       unsigned part;
+
+       int single_repl;
+       int single_part;
+
+       struct pool_set *set;
+       int is_dev_dax;
+
+       struct pool_hdr *hdrp;
+       /* copy of the pool header in host byte order */
+       struct pool_hdr hdr;
+       int hdr_valid;
+       /*
+        * If pool header has been modified this field indicates that
+        * the pool parameters structure requires refresh.
+        */
+       int pool_hdr_modified;
+
+       unsigned healthy_replicas;
+
+       struct pool_hdr *next_part_hdrp;
+       struct pool_hdr *prev_part_hdrp;
+       struct pool_hdr *next_repl_hdrp;
+       struct pool_hdr *prev_repl_hdrp;
+
+       int next_part_hdr_valid;
+       int prev_part_hdr_valid;
+       int next_repl_hdr_valid;
+       int prev_repl_hdr_valid;
+
+       /* valid poolset uuid */
+       uuid_t *valid_puuid;
+       /* valid part uuid */
+       uuid_t *valid_uuid;
+
+       /* valid part pool header */
+       struct pool_hdr *valid_part_hdrp;
+       int valid_part_done;
+       unsigned valid_part_replica;
+
+       char prefix[PREFIX_MAX_SIZE];
+
+       struct arena *arenap;
+       uint64_t offset;
+       uint32_t narena;
+
+       uint8_t *bitmap;
+       uint8_t *dup_bitmap;
+       uint8_t *fbitmap;
+
+       struct list *list_inval;
+       struct list *list_flog_inval;
+       struct list *list_unmap;
+
+       struct {
+               int btti_header;
+               int btti_backup;
+       } valid;
+
+       struct {
+               struct btt_info btti;
+               uint64_t btti_offset;
+       } pool_valid;
+} location;
+
+/* check steps */
+void check_bad_blocks(PMEMpoolcheck *ppc);
+void check_backup(PMEMpoolcheck *ppc);
+void check_pool_hdr(PMEMpoolcheck *ppc);
+void check_pool_hdr_uuids(PMEMpoolcheck *ppc);
+void check_sds(PMEMpoolcheck *ppc);
+void check_log(PMEMpoolcheck *ppc);
+void check_blk(PMEMpoolcheck *ppc);
+void check_btt_info(PMEMpoolcheck *ppc);
+void check_btt_map_flog(PMEMpoolcheck *ppc);
+void check_write(PMEMpoolcheck *ppc);
+
+struct check_data *check_data_alloc(void);
+void check_data_free(struct check_data *data);
+
+uint32_t check_step_get(struct check_data *data);
+void check_step_inc(struct check_data *data);
+location *check_get_step_data(struct check_data *data);
+
+void check_end(struct check_data *data);
+int check_is_end_util(struct check_data *data);
+
+int check_status_create(PMEMpoolcheck *ppc, enum pmempool_check_msg_type type,
+               uint32_t arg, const char *fmt, ...) FORMAT_PRINTF(4, 5);
+void check_status_release(PMEMpoolcheck *ppc, struct check_status *status);
+void check_clear_status_cache(struct check_data *data);
+struct check_status *check_pop_question(struct check_data *data);
+struct check_status *check_pop_error(struct check_data *data);
+struct check_status *check_pop_info(struct check_data *data);
+bool check_has_error(struct check_data *data);
+bool check_has_answer(struct check_data *data);
+int check_push_answer(PMEMpoolcheck *ppc);
+
+struct pmempool_check_status *check_status_get_util(
+       struct check_status *status);
+int check_status_is(struct check_status *status,
+       enum pmempool_check_msg_type type);
+
+/* create info status */
+#define CHECK_INFO(ppc, ...)\
+       check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_INFO, 0, __VA_ARGS__)
+
+/* create info status and append error message based on errno */
+#define CHECK_INFO_ERRNO(ppc, ...)\
+       check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_INFO,\
+                       (uint32_t)errno, __VA_ARGS__)
+
+/* create error status */
+#define CHECK_ERR(ppc, ...)\
+       check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_ERROR, 0, __VA_ARGS__)
+
+/* create question status */
+#define CHECK_ASK(ppc, question, ...)\
+       check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_QUESTION, question,\
+               __VA_ARGS__)
+
+#define CHECK_NOT_COMPLETE(loc, steps)\
+       ((loc)->step != CHECK_STEP_COMPLETE &&\
+               ((steps)[(loc)->step].check != NULL ||\
+               (steps)[(loc)->step].fix != NULL))
+
+int check_answer_loop(PMEMpoolcheck *ppc, location *data,
+       void *ctx, int fail_on_no,
+       int (*callback)(PMEMpoolcheck *, location *, uint32_t, void *ctx));
+int check_questions_sequence_validate(PMEMpoolcheck *ppc);
+
+const char *check_get_time_str(time_t time);
+const char *check_get_uuid_str(uuid_t uuid);
+const char *check_get_pool_type_str(enum pool_type type);
+
+void check_insert_arena(PMEMpoolcheck *ppc, struct arena *arenap);
+
+#ifdef _WIN32
+void cache_to_utf8(struct check_data *data, char *buf, size_t size);
+#endif
+
+#define CHECK_IS(ppc, flag)\
+       util_flag_isset((ppc)->args.flags, PMEMPOOL_CHECK_ ## flag)
+
+#define CHECK_IS_NOT(ppc, flag)\
+       util_flag_isclr((ppc)->args.flags, PMEMPOOL_CHECK_ ## flag)
+
+#define CHECK_WITHOUT_FIXING(ppc)\
+       CHECK_IS_NOT(ppc, REPAIR) || CHECK_IS(ppc, DRY_RUN)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/check_write.c b/ceph/src/pmdk/src/libpmempool/check_write.c
new file mode 100644 (file)
index 0000000..8321bd1
--- /dev/null
@@ -0,0 +1,246 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * check_write.c -- write fixed data back
+ */
+
+#include <stdint.h>
+#include <endian.h>
+
+#include "out.h"
+#include "btt.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check_util.h"
+
+enum questions {
+       Q_REPAIR_MAP,
+       Q_REPAIR_FLOG,
+};
+
+/*
+ * log_write -- (internal) write all structures for log pool
+ */
+static int
+log_write(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (CHECK_WITHOUT_FIXING(ppc))
+               return 0;
+
+       /* endianness conversion */
+       struct pmemlog *log = &ppc->pool->hdr.log;
+       log_convert2le(log);
+
+       if (pool_write(ppc->pool, log, sizeof(*log), 0)) {
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               return CHECK_ERR(ppc, "writing pmemlog structure failed");
+       }
+
+       return 0;
+}
+
+/*
+ * blk_write_flog -- (internal) convert and write flog to file
+ */
+static int
+blk_write_flog(PMEMpoolcheck *ppc, struct arena *arenap)
+{
+       if (!arenap->flog) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return CHECK_ERR(ppc, "flog is missing");
+       }
+
+       uint64_t flogoff = arenap->offset + arenap->btt_info.flogoff;
+
+       uint8_t *ptr = arenap->flog;
+       uint32_t i;
+       for (i = 0; i < arenap->btt_info.nfree; i++) {
+               struct btt_flog *flog = (struct btt_flog *)ptr;
+               btt_flog_convert2le(&flog[0]);
+               btt_flog_convert2le(&flog[1]);
+               ptr += BTT_FLOG_PAIR_ALIGN;
+       }
+
+       if (pool_write(ppc->pool, arenap->flog, arenap->flogsize, flogoff)) {
+               CHECK_INFO(ppc, "%s", ppc->path);
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               return CHECK_ERR(ppc, "arena %u: writing BTT FLOG failed\n",
+                       arenap->id);
+       }
+
+       return 0;
+}
+
+/*
+ * blk_write_map -- (internal) convert and write map to file
+ */
+static int
+blk_write_map(PMEMpoolcheck *ppc, struct arena *arenap)
+{
+       if (!arenap->map) {
+               ppc->result = CHECK_RESULT_ERROR;
+               return CHECK_ERR(ppc, "map is missing");
+       }
+
+       uint64_t mapoff = arenap->offset + arenap->btt_info.mapoff;
+
+       uint32_t i;
+       for (i = 0; i < arenap->btt_info.external_nlba; i++)
+               arenap->map[i] = htole32(arenap->map[i]);
+
+       if (pool_write(ppc->pool, arenap->map, arenap->mapsize, mapoff)) {
+               CHECK_INFO(ppc, "%s", ppc->path);
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               return CHECK_ERR(ppc, "arena %u: writing BTT map failed\n",
+                       arenap->id);
+       }
+
+       return 0;
+}
+
+/*
+ * blk_write -- (internal) write all structures for blk pool
+ */
+static int
+blk_write(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       if (CHECK_WITHOUT_FIXING(ppc))
+               return 0;
+
+       /* endianness conversion */
+       ppc->pool->hdr.blk.bsize = htole32(ppc->pool->hdr.blk.bsize);
+
+       if (pool_write(ppc->pool, &ppc->pool->hdr.blk,
+                       sizeof(ppc->pool->hdr.blk), 0)) {
+               CHECK_INFO(ppc, "%s", ppc->path);
+               ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+               return CHECK_ERR(ppc, "writing pmemblk structure failed");
+       }
+
+       return 0;
+}
+
+/*
+ * btt_data_write -- (internal) write BTT data
+ */
+static int
+btt_data_write(PMEMpoolcheck *ppc, location *loc)
+{
+       LOG(3, NULL);
+
+       struct arena *arenap;
+
+       PMDK_TAILQ_FOREACH(arenap, &ppc->pool->arenas, next) {
+
+               if (ppc->pool->uuid_op == UUID_NOT_FROM_BTT) {
+                       memcpy(arenap->btt_info.parent_uuid,
+                               ppc->pool->hdr.pool.poolset_uuid,
+                                       sizeof(arenap->btt_info.parent_uuid));
+
+                       util_checksum(&arenap->btt_info,
+                                       sizeof(arenap->btt_info),
+                               &arenap->btt_info.checksum, 1, 0);
+               }
+
+               if (pool_write(ppc->pool, &arenap->btt_info,
+                               sizeof(arenap->btt_info), arenap->offset)) {
+                       CHECK_INFO(ppc, "%s", ppc->path);
+                       CHECK_ERR(ppc, "arena %u: writing BTT Info failed",
+                               arenap->id);
+                       goto error;
+               }
+
+               if (pool_write(ppc->pool, &arenap->btt_info,
+                               sizeof(arenap->btt_info), arenap->offset +
+                               le64toh(arenap->btt_info.infooff))) {
+                       CHECK_INFO(ppc, "%s", ppc->path);
+                       CHECK_ERR(ppc,
+                               "arena %u: writing BTT Info backup failed",
+                               arenap->id);
+                       goto error;
+               }
+
+               if (blk_write_flog(ppc, arenap))
+                       goto error;
+
+               if (blk_write_map(ppc, arenap))
+                       goto error;
+       }
+
+       return 0;
+
+error:
+       ppc->result = CHECK_RESULT_CANNOT_REPAIR;
+       return -1;
+}
+
+struct step {
+       int (*func)(PMEMpoolcheck *, location *loc);
+       enum pool_type type;
+};
+
+static const struct step steps[] = {
+       {
+               .func           = log_write,
+               .type           = POOL_TYPE_LOG,
+       },
+       {
+               .func           = blk_write,
+               .type           = POOL_TYPE_BLK,
+       },
+       {
+               .func           = btt_data_write,
+               .type           = POOL_TYPE_BLK | POOL_TYPE_BTT,
+       },
+       {
+               .func           = NULL,
+       },
+};
+
+/*
+ * step_exe -- (internal) perform single step according to its parameters
+ */
+static inline int
+step_exe(PMEMpoolcheck *ppc, location *loc)
+{
+       ASSERT(loc->step < ARRAY_SIZE(steps));
+
+       const struct step *step = &steps[loc->step++];
+
+       /* check step conditions */
+       if (!(step->type & ppc->pool->params.type))
+               return 0;
+
+       return step->func(ppc, loc);
+}
+
+/*
+ * check_write -- write fixed data back
+ */
+void
+check_write(PMEMpoolcheck *ppc)
+{
+       /*
+        * XXX: Disabling individual checks based on type should be done in the
+        *      step structure. This however requires refactor of the step
+        *      processing code.
+        */
+       if (CHECK_IS_NOT(ppc, REPAIR))
+               return;
+
+       location *loc = (location *)check_get_step_data(ppc->data);
+
+       /* do all steps */
+       while (loc->step != CHECK_STEP_COMPLETE &&
+               steps[loc->step].func != NULL) {
+
+               if (step_exe(ppc, loc))
+                       return;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/feature.c b/ceph/src/pmdk/src/libpmempool/feature.c
new file mode 100644 (file)
index 0000000..eafeab6
--- /dev/null
@@ -0,0 +1,789 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018, Intel Corporation */
+
+/*
+ * feature.c -- implementation of pmempool_feature_(enable|disable|query)()
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+
+#include "libpmempool.h"
+#include "util_pmem.h"
+#include "pool_hdr.h"
+#include "pool.h"
+
+#define RW     0
+#define RDONLY 1
+
+#define FEATURE_INCOMPAT(X) \
+       (features_t)FEAT_INCOMPAT(X)
+
+static const features_t f_singlehdr = FEAT_INCOMPAT(SINGLEHDR);
+static const features_t f_cksum_2k = FEAT_INCOMPAT(CKSUM_2K);
+static const features_t f_sds = FEAT_INCOMPAT(SDS);
+static const features_t f_chkbb = FEAT_COMPAT(CHECK_BAD_BLOCKS);
+
+#define FEAT_INVALID \
+       {UINT32_MAX, UINT32_MAX, UINT32_MAX};
+
+static const features_t f_invalid = FEAT_INVALID;
+
+#define FEATURE_MAXPRINT ((size_t)1024)
+
+/*
+ * buff_concat -- (internal) concat formatted string to string buffer
+ */
+static int
+buff_concat(char *buff, size_t *pos, const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       const size_t size = FEATURE_MAXPRINT - *pos - 1;
+       int ret = vsnprintf(buff + *pos, size, fmt, ap);
+       va_end(ap);
+
+       if (ret < 0) {
+               ERR("vsprintf");
+               return ret;
+       }
+
+       if ((size_t)ret >= size) {
+               ERR("buffer truncated %d >= %zu", ret, size);
+               return -1;
+       }
+
+       *pos += (size_t)ret;
+       return 0;
+}
+
+/*
+ * buff_concat_features -- (internal) concat features string to string buffer
+ */
+static int
+buff_concat_features(char *buff, size_t *pos, features_t f)
+{
+       return buff_concat(buff, pos,
+                       "{compat 0x%x, incompat 0x%x, ro_compat 0x%x}",
+                       f.compat, f.incompat, f.ro_compat);
+}
+
+/*
+ * poolset_close -- (internal) close pool set
+ */
+static void
+poolset_close(struct pool_set *set)
+{
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               ASSERT(!rep->remote);
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       util_unmap_hdr(PART(rep, p));
+               }
+       }
+
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+}
+
+/*
+ * features_check -- (internal) check if features are correct
+ */
+static int
+features_check(features_t *features, struct pool_hdr *hdrp)
+{
+       static char msg[FEATURE_MAXPRINT];
+
+       struct pool_hdr hdr;
+       memcpy(&hdr, hdrp, sizeof(hdr));
+       util_convert2h_hdr_nocheck(&hdr);
+
+       /* (features != f_invlaid) <=> features is set */
+       if (!util_feature_cmp(*features, f_invalid)) {
+               /* features from current and previous headers have to match */
+               if (!util_feature_cmp(*features, hdr.features)) {
+                       size_t pos = 0;
+                       if (buff_concat_features(msg, &pos, hdr.features))
+                               goto err;
+                       if (buff_concat(msg, &pos, "%s", " != "))
+                               goto err;
+                       if (buff_concat_features(msg, &pos, *features))
+                               goto err;
+                       ERR("features mismatch detected: %s", msg);
+                       return -1;
+               } else {
+                       return 0;
+               }
+       }
+
+       features_t unknown = util_get_unknown_features(
+                       hdr.features, (features_t)POOL_FEAT_VALID);
+
+       /* all features are known */
+       if (util_feature_is_zero(unknown)) {
+               memcpy(features, &hdr.features, sizeof(*features));
+               return 0;
+       }
+
+       /* unknown features detected - print error message */
+       size_t pos = 0;
+       if (buff_concat_features(msg, &pos, unknown))
+               goto err;
+       ERR("invalid features detected: %s", msg);
+err:
+       return -1;
+}
+
+/*
+ * get_pool_open_flags -- (internal) generate pool open flags
+ */
+static inline unsigned
+get_pool_open_flags(struct pool_set *set, int rdonly)
+{
+       unsigned flags = 0;
+       if (rdonly == RDONLY && !util_pool_has_device_dax(set))
+               flags = POOL_OPEN_COW;
+       flags |= POOL_OPEN_IGNORE_BAD_BLOCKS;
+       return flags;
+}
+
+/*
+ * get_mmap_flags -- (internal) generate mmap flags
+ */
+static inline int
+get_mmap_flags(struct pool_set_part *part, int rdonly)
+{
+       if (part->is_dev_dax)
+               return MAP_SHARED;
+       else
+               return rdonly ? MAP_PRIVATE : MAP_SHARED;
+}
+
+/*
+ * poolset_open -- (internal) open pool set
+ */
+static struct pool_set *
+poolset_open(const char *path, int rdonly)
+{
+       struct pool_set *set;
+       features_t features = FEAT_INVALID;
+
+       /* read poolset */
+       int ret = util_poolset_create_set(&set, path, 0, 0, true);
+       if (ret < 0) {
+               ERR("cannot open pool set -- '%s'", path);
+               goto err_poolset;
+       }
+       if (set->remote) {
+               ERR("poolsets with remote replicas are not supported");
+               errno = EINVAL;
+               goto err_open;
+       }
+
+       /* open a memory pool */
+       unsigned flags = get_pool_open_flags(set, rdonly);
+       if (util_pool_open_nocheck(set, flags))
+               goto err_open;
+
+       /* map all headers and check features */
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               ASSERT(!rep->remote);
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       struct pool_set_part *part = PART(rep, p);
+                       int mmap_flags = get_mmap_flags(part, rdonly);
+                       if (util_map_hdr(part, mmap_flags, rdonly)) {
+                               part->hdr = NULL;
+                               goto err_map_hdr;
+                       }
+
+                       if (features_check(&features, HDR(rep, p))) {
+                               ERR(
+                                       "invalid features - replica #%d part #%d",
+                                       r, p);
+                               goto err_open;
+                       }
+               }
+       }
+       return set;
+
+err_map_hdr:
+       /* unmap all headers */
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               ASSERT(!rep->remote);
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       util_unmap_hdr(PART(rep, p));
+               }
+       }
+err_open:
+       /* close the memory pool and release pool set structure */
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+err_poolset:
+       return NULL;
+}
+
+/*
+ * get_hdr -- (internal) read header in host byte order
+ */
+static struct pool_hdr *
+get_hdr(struct pool_set *set, unsigned rep, unsigned part)
+{
+       static struct pool_hdr hdr;
+
+       /* copy header */
+       struct pool_hdr *hdrp = HDR(REP(set, rep), part);
+       memcpy(&hdr, hdrp, sizeof(hdr));
+
+       /* convert to host byte order and return */
+       util_convert2h_hdr_nocheck(&hdr);
+       return &hdr;
+}
+
+/*
+ * set_hdr -- (internal) convert header to little-endian, checksum and write
+ */
+static void
+set_hdr(struct pool_set *set, unsigned rep, unsigned part, struct pool_hdr *src)
+{
+       /* convert to little-endian and set new checksum */
+       const size_t skip_off = POOL_HDR_CSUM_END_OFF(src);
+       util_convert2le_hdr(src);
+       util_checksum(src, sizeof(*src), &src->checksum, 1, skip_off);
+
+       /* write header */
+       struct pool_replica *replica = REP(set, rep);
+       struct pool_hdr *dst = HDR(replica, part);
+       memcpy(dst, src, sizeof(*src));
+       util_persist_auto(PART(replica, part)->is_dev_dax, dst, sizeof(*src));
+}
+
+typedef enum {
+       DISABLED,
+       ENABLED
+} fstate_t;
+
+#define FEATURE_IS_ENABLED_STR "feature already enabled: %s"
+#define FEATURE_IS_DISABLED_STR        "feature already disabled: %s"
+
+/*
+ * require_feature_is -- (internal) check if required feature is enabled
+ * (or disabled)
+ */
+static int
+require_feature_is(struct pool_set *set, features_t feature, fstate_t req_state)
+{
+       struct pool_hdr *hdrp = get_hdr((set), 0, 0);
+       fstate_t state = util_feature_is_set(hdrp->features, feature)
+                       ? ENABLED : DISABLED;
+       if (state == req_state)
+               return 1;
+
+       const char *msg = (state == ENABLED)
+                       ? FEATURE_IS_ENABLED_STR : FEATURE_IS_DISABLED_STR;
+       LOG(3, msg, util_feature2str(feature, NULL));
+       return 0;
+}
+
+#define FEATURE_IS_NOT_ENABLED_PRIOR_STR       "enable %s prior to %s %s"
+#define FEATURE_IS_NOT_DISABLED_PRIOR_STR      "disable %s prior to %s %s"
+
+/*
+ * require_other_feature_is -- (internal) check if other feature is enabled
+ * (or disabled) in case the other feature has to be enabled (or disabled)
+ * prior to the main one
+ */
+static int
+require_other_feature_is(struct pool_set *set, features_t other,
+               fstate_t req_state, features_t feature, const char *cause)
+{
+       struct pool_hdr *hdrp = get_hdr((set), 0, 0);
+       fstate_t state = util_feature_is_set(hdrp->features, other)
+                       ? ENABLED : DISABLED;
+       if (state == req_state)
+               return 1;
+
+       const char *msg = (req_state == ENABLED)
+                       ? FEATURE_IS_NOT_ENABLED_PRIOR_STR
+                       : FEATURE_IS_NOT_DISABLED_PRIOR_STR;
+       ERR(msg, util_feature2str(other, NULL),
+                       cause, util_feature2str(feature, NULL));
+       return 0;
+}
+
+/*
+ * feature_set -- (internal) enable (or disable) feature
+ */
+static void
+feature_set(struct pool_set *set, features_t feature, int value)
+{
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               for (unsigned p = 0; p < REP(set, r)->nparts; ++p) {
+                       struct pool_hdr *hdrp = get_hdr(set, r, p);
+                       if (value == ENABLED)
+                               util_feature_enable(&hdrp->features, feature);
+                       else
+                               util_feature_disable(&hdrp->features, feature);
+                       set_hdr(set, r, p, hdrp);
+               }
+       }
+}
+
+/*
+ * query_feature -- (internal) query feature value
+ */
+static int
+query_feature(const char *path, features_t feature)
+{
+       struct pool_set *set = poolset_open(path, RDONLY);
+       if (!set)
+               goto err_open;
+
+       struct pool_hdr *hdrp = get_hdr(set, 0, 0);
+       const int query = util_feature_is_set(hdrp->features, feature);
+
+       poolset_close(set);
+
+       return query;
+
+err_open:
+       return -1;
+}
+
+/*
+ * unsupported_feature -- (internal) report unsupported feature
+ */
+static inline int
+unsupported_feature(features_t feature)
+{
+       ERR("unsupported feature: %s", util_feature2str(feature, NULL));
+       errno = EINVAL;
+       return -1;
+}
+
+/*
+ * enable_singlehdr -- (internal) enable POOL_FEAT_SINGLEHDR
+ */
+static int
+enable_singlehdr(const char *path)
+{
+       return unsupported_feature(f_singlehdr);
+}
+
+/*
+ * disable_singlehdr -- (internal) disable POOL_FEAT_SINGLEHDR
+ */
+static int
+disable_singlehdr(const char *path)
+{
+       return unsupported_feature(f_singlehdr);
+}
+
+/*
+ * query_singlehdr -- (internal) query POOL_FEAT_SINGLEHDR
+ */
+static int
+query_singlehdr(const char *path)
+{
+       return query_feature(path, f_singlehdr);
+}
+
+/*
+ * enable_checksum_2k -- (internal) enable POOL_FEAT_CKSUM_2K
+ */
+static int
+enable_checksum_2k(const char *path)
+{
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+       if (require_feature_is(set, f_cksum_2k, DISABLED))
+               feature_set(set, f_cksum_2k, ENABLED);
+
+       poolset_close(set);
+       return 0;
+}
+
+/*
+ * disable_checksum_2k -- (internal) disable POOL_FEAT_CKSUM_2K
+ */
+static int
+disable_checksum_2k(const char *path)
+{
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+
+       int ret = 0;
+       if (!require_feature_is(set, f_cksum_2k, ENABLED))
+               goto exit;
+
+       /* check if POOL_FEAT_SDS is disabled */
+       if (!require_other_feature_is(set, f_sds, DISABLED,
+                       f_cksum_2k, "disabling")) {
+               ret = -1;
+               goto exit;
+       }
+
+       feature_set(set, f_cksum_2k, DISABLED);
+exit:
+       poolset_close(set);
+       return ret;
+}
+
+/*
+ * query_checksum_2k -- (internal) query POOL_FEAT_CKSUM_2K
+ */
+static int
+query_checksum_2k(const char *path)
+{
+       return query_feature(path, f_cksum_2k);
+}
+
+/*
+ * enable_shutdown_state -- (internal) enable POOL_FEAT_SDS
+ */
+static int
+enable_shutdown_state(const char *path)
+{
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+
+       int ret = 0;
+       if (!require_feature_is(set, f_sds, DISABLED))
+               goto exit;
+
+       /* check if POOL_FEAT_CKSUM_2K is enabled */
+       if (!require_other_feature_is(set, f_cksum_2k, ENABLED,
+                       f_sds, "enabling")) {
+               ret = -1;
+               goto exit;
+       }
+
+       feature_set(set, f_sds, ENABLED);
+
+exit:
+       poolset_close(set);
+       return ret;
+}
+
+/*
+ * reset_shutdown_state -- zero all shutdown structures
+ */
+static void
+reset_shutdown_state(struct pool_set *set)
+{
+       for (unsigned rep = 0; rep < set->nreplicas; ++rep) {
+               for (unsigned part = 0; part < REP(set, rep)->nparts; ++part) {
+                       struct pool_hdr *hdrp = HDR(REP(set, rep), part);
+                       shutdown_state_init(&hdrp->sds, REP(set, rep));
+               }
+       }
+}
+
+/*
+ * disable_shutdown_state -- (internal) disable POOL_FEAT_SDS
+ */
+static int
+disable_shutdown_state(const char *path)
+{
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+
+       if (require_feature_is(set, f_sds, ENABLED)) {
+               feature_set(set, f_sds, DISABLED);
+               reset_shutdown_state(set);
+       }
+
+       poolset_close(set);
+       return 0;
+}
+
+/*
+ * query_shutdown_state -- (internal) query POOL_FEAT_SDS
+ */
+static int
+query_shutdown_state(const char *path)
+{
+       return query_feature(path, f_sds);
+}
+
+/*
+ * enable_badblocks_checking -- (internal) enable POOL_FEAT_CHECK_BAD_BLOCKS
+ */
+static int
+enable_badblocks_checking(const char *path)
+{
+#ifdef _WIN32
+       ERR("bad blocks checking is not supported on Windows");
+       return -1;
+#else
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+
+       if (require_feature_is(set, f_chkbb, DISABLED))
+               feature_set(set, f_chkbb, ENABLED);
+
+       poolset_close(set);
+
+       return 0;
+#endif
+}
+
+/*
+ * disable_badblocks_checking -- (internal) disable POOL_FEAT_CHECK_BAD_BLOCKS
+ */
+static int
+disable_badblocks_checking(const char *path)
+{
+       struct pool_set *set = poolset_open(path, RW);
+       if (!set)
+               return -1;
+
+       int ret = 0;
+       if (!require_feature_is(set, f_chkbb, ENABLED))
+               goto exit;
+
+       feature_set(set, f_chkbb, DISABLED);
+exit:
+       poolset_close(set);
+
+       return ret;
+}
+
+/*
+ * query_badblocks_checking -- (internal) query POOL_FEAT_CHECK_BAD_BLOCKS
+ */
+static int
+query_badblocks_checking(const char *path)
+{
+       return query_feature(path, f_chkbb);
+}
+
+struct feature_funcs {
+       int (*enable)(const char *);
+       int (*disable)(const char *);
+       int (*query)(const char *);
+};
+
+static struct feature_funcs features[] = {
+               {
+                       .enable = enable_singlehdr,
+                       .disable = disable_singlehdr,
+                       .query = query_singlehdr
+               },
+               {
+                       .enable = enable_checksum_2k,
+                       .disable = disable_checksum_2k,
+                       .query = query_checksum_2k
+               },
+               {
+                       .enable = enable_shutdown_state,
+                       .disable = disable_shutdown_state,
+                       .query = query_shutdown_state
+               },
+               {
+                       .enable = enable_badblocks_checking,
+                       .disable = disable_badblocks_checking,
+                       .query = query_badblocks_checking
+               },
+};
+
+#define FEATURE_FUNCS_MAX ARRAY_SIZE(features)
+
+/*
+ * are_flags_valid -- (internal) check if flags are valid
+ */
+static inline int
+are_flags_valid(unsigned flags)
+{
+       if (flags != 0) {
+               ERR("invalid flags: 0x%x", flags);
+               errno = EINVAL;
+               return 0;
+       }
+       return 1;
+}
+
+/*
+ * is_feature_valid -- (internal) check if feature is valid
+ */
+static inline int
+is_feature_valid(uint32_t feature)
+{
+       if (feature >= FEATURE_FUNCS_MAX) {
+               ERR("invalid feature: 0x%x", feature);
+               errno = EINVAL;
+               return 0;
+       }
+       return 1;
+}
+
+/*
+ * pmempool_feature_enableU -- enable pool set feature
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_feature_enableU(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       LOG(3, "path %s feature %x flags %x", path, feature, flags);
+       if (!is_feature_valid(feature))
+               return -1;
+       if (!are_flags_valid(flags))
+               return -1;
+       return features[feature].enable(path);
+}
+
+/*
+ * pmempool_feature_disableU -- disable pool set feature
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_feature_disableU(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       LOG(3, "path %s feature %x flags %x", path, feature, flags);
+       if (!is_feature_valid(feature))
+               return -1;
+       if (!are_flags_valid(flags))
+               return -1;
+       return features[feature].disable(path);
+}
+
+/*
+ * pmempool_feature_queryU -- query pool set feature
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_feature_queryU(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       LOG(3, "path %s feature %x flags %x", path, feature, flags);
+
+       /*
+        * XXX: Windows does not allow function call in a constant expressions
+        */
+#ifndef _WIN32
+#define CHECK_INCOMPAT_MAPPING(FEAT, ENUM) \
+       COMPILE_ERROR_ON( \
+               util_feature2pmempool_feature(FEATURE_INCOMPAT(FEAT)) != ENUM)
+
+       CHECK_INCOMPAT_MAPPING(SINGLEHDR, PMEMPOOL_FEAT_SINGLEHDR);
+       CHECK_INCOMPAT_MAPPING(CKSUM_2K, PMEMPOOL_FEAT_CKSUM_2K);
+       CHECK_INCOMPAT_MAPPING(SDS, PMEMPOOL_FEAT_SHUTDOWN_STATE);
+
+#undef CHECK_INCOMPAT_MAPPING
+#endif
+
+       if (!is_feature_valid(feature))
+               return -1;
+       if (!are_flags_valid(flags))
+               return -1;
+       return features[feature].query(path);
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_feature_enable -- enable pool set feature
+ */
+int
+pmempool_feature_enable(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       return pmempool_feature_enableU(path, feature, flags);
+}
+#else
+/*
+ * pmempool_feature_enableW -- enable pool set feature as widechar
+ */
+int
+pmempool_feature_enableW(const wchar_t *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL) {
+               ERR("Invalid poolest/pool file path.");
+               return -1;
+       }
+
+       int ret = pmempool_feature_enableU(upath, feature, flags);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+#ifndef _WIN32
+/*
+ * pmempool_feature_disable -- disable pool set feature
+ */
+int
+pmempool_feature_disable(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       return pmempool_feature_disableU(path, feature, flags);
+}
+#else
+/*
+ * pmempool_feature_disableW -- disable pool set feature as widechar
+ */
+int
+pmempool_feature_disableW(const wchar_t *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL) {
+               ERR("Invalid poolest/pool file path.");
+               return -1;
+       }
+
+       int ret = pmempool_feature_disableU(upath, feature, flags);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+#ifndef _WIN32
+/*
+ * pmempool_feature_query -- query pool set feature
+ */
+int
+pmempool_feature_query(const char *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       return pmempool_feature_queryU(path, feature, flags);
+}
+#else
+/*
+ * pmempool_feature_queryW -- query pool set feature as widechar
+ */
+int
+pmempool_feature_queryW(const wchar_t *path, enum pmempool_feature feature,
+       unsigned flags)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL) {
+               ERR("Invalid poolest/pool file path.");
+               return -1;
+       }
+
+       int ret = pmempool_feature_queryU(upath, feature, flags);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.c b/ceph/src/pmdk/src/libpmempool/libpmempool.c
new file mode 100644 (file)
index 0000000..054eb8b
--- /dev/null
@@ -0,0 +1,417 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * libpmempool.c -- entry points for libpmempool
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <errno.h>
+#include <sys/param.h>
+
+#include "pmemcommon.h"
+#include "libpmempool.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "check.h"
+
+#ifdef USE_RPMEM
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+#endif
+
+#ifdef _WIN32
+#define ANSWER_BUFFSIZE 256
+#endif
+
+/*
+ * libpmempool_init -- load-time initialization for libpmempool
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+libpmempool_init(void)
+{
+       common_init(PMEMPOOL_LOG_PREFIX, PMEMPOOL_LOG_LEVEL_VAR,
+               PMEMPOOL_LOG_FILE_VAR, PMEMPOOL_MAJOR_VERSION,
+               PMEMPOOL_MINOR_VERSION);
+       LOG(3, NULL);
+#ifdef USE_RPMEM
+       util_remote_init();
+       rpmem_util_cmds_init();
+#endif
+}
+
+/*
+ * libpmempool_fini -- libpmempool cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+libpmempool_fini(void)
+{
+       LOG(3, NULL);
+#ifdef USE_RPMEM
+       util_remote_unload();
+       util_remote_fini();
+       rpmem_util_cmds_fini();
+#endif
+       common_fini();
+}
+
+/*
+ * pmempool_check_versionU -- see if library meets application version
+ *     requirements
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmempool_check_versionU(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != PMEMPOOL_MAJOR_VERSION) {
+               ERR("libpmempool major version mismatch (need %u, found %u)",
+                       major_required, PMEMPOOL_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > PMEMPOOL_MINOR_VERSION) {
+               ERR("libpmempool minor version mismatch (need %u, found %u)",
+                       minor_required, PMEMPOOL_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_check_version -- see if lib meets application version requirements
+ */
+const char *
+pmempool_check_version(unsigned major_required, unsigned minor_required)
+{
+       return pmempool_check_versionU(major_required, minor_required);
+}
+#else
+/*
+ * pmempool_check_versionW -- see if library meets application version
+ *     requirements as widechar
+ */
+const wchar_t *
+pmempool_check_versionW(unsigned major_required, unsigned minor_required)
+{
+       if (pmempool_check_versionU(major_required, minor_required) != NULL)
+               return out_get_errormsgW();
+       else
+               return NULL;
+}
+#endif
+
+/*
+ * pmempool_errormsgU -- return last error message
+ */
+#ifndef _WIN32
+static inline
+#endif
+const char *
+pmempool_errormsgU(void)
+{
+       return out_get_errormsg();
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_errormsg -- return last error message
+ */
+const char *
+pmempool_errormsg(void)
+{
+       return pmempool_errormsgU();
+}
+#else
+/*
+ * pmempool_errormsgW -- return last error message as widechar
+ */
+const wchar_t *
+pmempool_errormsgW(void)
+{
+       return out_get_errormsgW();
+}
+#endif
+
+/*
+ * pmempool_ppc_set_default -- (internal) set default values of check context
+ */
+static void
+pmempool_ppc_set_default(PMEMpoolcheck *ppc)
+{
+       /* all other fields should be zeroed */
+       const PMEMpoolcheck ppc_default = {
+               .args           = {
+                       .pool_type      = PMEMPOOL_POOL_TYPE_DETECT,
+               },
+               .result         = CHECK_RESULT_CONSISTENT,
+       };
+       *ppc = ppc_default;
+}
+
+/*
+ * pmempool_check_initU -- initialize check context
+ */
+#ifndef _WIN32
+static inline
+#endif
+PMEMpoolcheck *
+pmempool_check_initU(struct pmempool_check_argsU *args, size_t args_size)
+{
+       LOG(3, "path %s backup_path %s pool_type %u flags %x", args->path,
+               args->backup_path, args->pool_type, args->flags);
+
+       /*
+        * Currently one size of args structure is supported. The version of the
+        * pmempool_check_args structure can be distinguished based on provided
+        * args_size.
+        */
+       if (args_size < sizeof(struct pmempool_check_args)) {
+               ERR("provided args_size is not supported");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       /*
+        * Dry run does not allow to made changes possibly performed during
+        * repair. Advanced allow to perform more complex repairs. Questions
+        * are ask only if repairs are made. So dry run, advanced and always_yes
+        * can be set only if repair is set.
+        */
+       if (util_flag_isclr(args->flags, PMEMPOOL_CHECK_REPAIR) &&
+                       util_flag_isset(args->flags, PMEMPOOL_CHECK_DRY_RUN |
+                       PMEMPOOL_CHECK_ADVANCED | PMEMPOOL_CHECK_ALWAYS_YES)) {
+               ERR("dry_run, advanced and always_yes are applicable only if "
+                       "repair is set");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       /*
+        * dry run does not modify anything so performing backup is redundant
+        */
+       if (util_flag_isset(args->flags, PMEMPOOL_CHECK_DRY_RUN) &&
+                       args->backup_path != NULL) {
+               ERR("dry run does not allow one to perform backup");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       /*
+        * libpmempool uses str format of communication so it must be set
+        */
+       if (util_flag_isclr(args->flags, PMEMPOOL_CHECK_FORMAT_STR)) {
+               ERR("PMEMPOOL_CHECK_FORMAT_STR flag must be set");
+               errno = EINVAL;
+               return NULL;
+       }
+
+       PMEMpoolcheck *ppc = calloc(1, sizeof(*ppc));
+       if (ppc == NULL) {
+               ERR("!calloc");
+               return NULL;
+       }
+
+       pmempool_ppc_set_default(ppc);
+       memcpy(&ppc->args, args, sizeof(ppc->args));
+       ppc->path = strdup(args->path);
+       if (!ppc->path) {
+               ERR("!strdup");
+               goto error_path_malloc;
+       }
+       ppc->args.path = ppc->path;
+
+       if (args->backup_path != NULL) {
+               ppc->backup_path = strdup(args->backup_path);
+               if (!ppc->backup_path) {
+                       ERR("!strdup");
+                       goto error_backup_path_malloc;
+               }
+               ppc->args.backup_path = ppc->backup_path;
+       }
+
+       if (check_init(ppc) != 0)
+               goto error_check_init;
+
+       return ppc;
+
+error_check_init:
+       /* in case errno not set by any of the used functions set its value */
+       if (errno == 0)
+               errno = EINVAL;
+
+       free(ppc->backup_path);
+error_backup_path_malloc:
+       free(ppc->path);
+error_path_malloc:
+       free(ppc);
+       return NULL;
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_check_init -- initialize check context
+ */
+PMEMpoolcheck *
+pmempool_check_init(struct pmempool_check_args *args, size_t args_size)
+{
+       return pmempool_check_initU(args, args_size);
+}
+#else
+/*
+ * pmempool_check_initW -- initialize check context as widechar
+ */
+PMEMpoolcheck *
+pmempool_check_initW(struct pmempool_check_argsW *args, size_t args_size)
+{
+       char *upath = util_toUTF8(args->path);
+       if (upath == NULL)
+               return NULL;
+       char *ubackup_path = NULL;
+       if (args->backup_path != NULL) {
+               ubackup_path = util_toUTF8(args->backup_path);
+               if (ubackup_path == NULL) {
+                       util_free_UTF8(upath);
+                       return NULL;
+               }
+       }
+
+       struct pmempool_check_argsU uargs = {
+               .path = upath,
+               .backup_path = ubackup_path,
+               .pool_type = args->pool_type,
+               .flags = args->flags
+       };
+
+       PMEMpoolcheck *ret = pmempool_check_initU(&uargs, args_size);
+
+       util_free_UTF8(ubackup_path);
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
+
+/*
+ * pmempool_checkU -- continue check till produce status to consume for caller
+ */
+#ifndef _WIN32
+static inline
+#endif
+struct pmempool_check_statusU *
+pmempool_checkU(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+       ASSERTne(ppc, NULL);
+
+       struct check_status *result;
+       do {
+               result = check_step(ppc);
+
+               if (check_is_end(ppc->data) && result == NULL)
+                       return NULL;
+       } while (result == NULL);
+
+       return check_status_get(result);
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_check -- continue check till produce status to consume for caller
+ */
+struct pmempool_check_status *
+pmempool_check(PMEMpoolcheck *ppc)
+{
+       return pmempool_checkU(ppc);
+}
+#else
+/*
+ * pmempool_checkW -- continue check till produce status to consume for caller
+ */
+struct pmempool_check_statusW *
+pmempool_checkW(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+       ASSERTne(ppc, NULL);
+
+       /* check the cache and convert msg and answer */
+       char buf[ANSWER_BUFFSIZE];
+       memset(buf, 0, ANSWER_BUFFSIZE);
+       convert_status_cache(ppc, buf, ANSWER_BUFFSIZE);
+
+       struct check_status *uresult;
+       do {
+               uresult = check_step(ppc);
+
+               if (check_is_end(ppc->data) && uresult == NULL)
+                       return NULL;
+       } while (uresult == NULL);
+
+       struct pmempool_check_statusU *uret_res = check_status_get(uresult);
+       const wchar_t *wmsg = util_toUTF16(uret_res->str.msg);
+       if (wmsg == NULL)
+               FATAL("!malloc");
+
+       struct pmempool_check_statusW *wret_res =
+               (struct pmempool_check_statusW *)uret_res;
+       /* pointer to old message is freed in next check step */
+       wret_res->str.msg = wmsg;
+       return wret_res;
+}
+#endif
+
+/*
+ * pmempool_check_end -- end check and release check context
+ */
+enum pmempool_check_result
+pmempool_check_end(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+       const enum check_result result = ppc->result;
+       const unsigned sync_required = ppc->sync_required;
+
+       check_fini(ppc);
+       free(ppc->path);
+       free(ppc->backup_path);
+       free(ppc);
+
+       if (sync_required) {
+               switch (result) {
+               case CHECK_RESULT_CONSISTENT:
+               case CHECK_RESULT_REPAIRED:
+                       return PMEMPOOL_CHECK_RESULT_SYNC_REQ;
+               default:
+                       /* other results require fixing prior to sync */
+                       ;
+               }
+       }
+
+       switch (result) {
+               case CHECK_RESULT_CONSISTENT:
+                       return PMEMPOOL_CHECK_RESULT_CONSISTENT;
+
+               case CHECK_RESULT_NOT_CONSISTENT:
+                       return PMEMPOOL_CHECK_RESULT_NOT_CONSISTENT;
+
+               case CHECK_RESULT_REPAIRED:
+                       return PMEMPOOL_CHECK_RESULT_REPAIRED;
+
+               case CHECK_RESULT_CANNOT_REPAIR:
+                       return PMEMPOOL_CHECK_RESULT_CANNOT_REPAIR;
+
+               default:
+                       return PMEMPOOL_CHECK_RESULT_ERROR;
+       }
+}
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.def b/ceph/src/pmdk/src/libpmempool/libpmempool.def
new file mode 100644 (file)
index 0000000..a0edb3d
--- /dev/null
@@ -0,0 +1,32 @@
+;;;; Begin Copyright Notice
+; SPDX-License-Identifier: BSD-3-Clause
+; Copyright 2016, Intel Corporation
+;;;;  End Copyright Notice
+
+LIBRARY libpmempool
+
+VERSION 1.0
+
+EXPORTS
+       pmempool_check_versionU
+       pmempool_check_versionW
+       pmempool_errormsgU
+       pmempool_errormsgW
+       pmempool_check_initU
+       pmempool_check_initW
+       pmempool_checkU
+       pmempool_checkW
+       pmempool_check_end
+       pmempool_syncU
+       pmempool_syncW
+       pmempool_transformU
+       pmempool_transformW
+       pmempool_rmU
+       pmempool_rmW
+       pmempool_feature_enableU
+       pmempool_feature_enableW
+       pmempool_feature_disableU
+       pmempool_feature_disableW
+       pmempool_feature_queryU
+       pmempool_feature_queryW
+       DllMain
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.link.in b/ceph/src/pmdk/src/libpmempool/libpmempool.link.in
new file mode 100644 (file)
index 0000000..c3c0e86
--- /dev/null
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2019, Intel Corporation
+#
+#
+# src/libpmempool.link -- linker link file for libpmempool
+#
+LIBPMEMPOOL_1.0 {
+       global:
+               pmempool_errormsg;
+               pmempool_check_version;
+               pmempool_check_init;
+               pmempool_check;
+               pmempool_check_end;
+               pmempool_transform;
+               pmempool_sync;
+               pmempool_rm;
+               pmempool_feature_enable;
+               pmempool_feature_disable;
+               pmempool_feature_query;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.rc b/ceph/src/pmdk/src/libpmempool/libpmempool.rc
new file mode 100644 (file)
index 0000000..85462b3
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016, Intel Corporation */
+
+/*
+ * libpmempool.rc -- libpmempool resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmempool.dll"
+#define DESCRIPTION "libpmempool - pool management library"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj b/ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj
new file mode 100644 (file)
index 0000000..44359a9
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\core\alloc.h" />
+    <ClInclude Include="..\common\dlsym.h" />
+    <ClInclude Include="..\core\fault_injection.h" />
+    <ClInclude Include="..\common\file.h" />
+    <ClInclude Include="..\core\fs.h" />
+    <ClInclude Include="..\common\mmap.h" />
+    <ClInclude Include="..\core\os.h" />
+    <ClInclude Include="..\common\os_deep.h" />
+    <ClInclude Include="..\core\out.h" />
+    <ClInclude Include="..\common\pmemcommon.h" />
+    <ClInclude Include="..\common\pool_hdr.h" />
+    <ClInclude Include="..\common\set.h" />
+    <ClInclude Include="..\common\sys_util.h" />
+    <ClInclude Include="..\core\util.h" />
+    <ClInclude Include="..\common\uuid.h" />
+    <ClInclude Include="..\common\valgrind_internal.h" />
+    <ClInclude Include="..\include\libpmempool.h" />
+    <ClInclude Include="..\libpmem2\auto_flush.h" />
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h" />
+    <ClInclude Include="..\libpmem2\badblocks.h" />
+    <ClInclude Include="..\libpmemblk\btt.h" />
+    <ClInclude Include="check.h" />
+    <ClInclude Include="check_util.h" />
+    <ClInclude Include="pmempool.h" />
+    <ClInclude Include="pool.h" />
+    <ClInclude Include="replica.h" />
+    <ClInclude Include="..\libpmem2\config.h" />
+    <ClInclude Include="..\libpmem2\pmem2_utils.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\core\alloc.c" />
+    <ClCompile Include="..\common\set_badblocks.c" />
+    <ClCompile Include="..\common\file.c" />
+    <ClCompile Include="..\common\file_windows.c" />
+    <ClCompile Include="..\common\mmap.c" />
+    <ClCompile Include="..\common\mmap_windows.c" />
+    <ClCompile Include="..\core\fs_windows.c" />
+    <ClCompile Include="..\common\bad_blocks.c" />
+    <ClCompile Include="..\common\os_deep_windows.c" />
+    <ClCompile Include="..\core\os_thread_windows.c" />
+    <ClCompile Include="..\core\os_windows.c" />
+    <ClCompile Include="..\core\out.c" />
+    <ClCompile Include="..\common\pool_hdr.c" />
+    <ClCompile Include="..\common\set.c" />
+    <ClCompile Include="..\common\shutdown_state.c" />
+    <ClCompile Include="..\core\util.c" />
+    <ClCompile Include="..\core\util_windows.c" />
+    <ClCompile Include="..\common\uuid.c" />
+    <ClCompile Include="..\common\uuid_windows.c" />
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c" />
+    <ClCompile Include="..\libpmem2\badblocks.c" />
+    <ClCompile Include="..\libpmem2\badblocks_none.c" />
+    <ClCompile Include="..\libpmem2\usc_windows.c" />
+    <ClCompile Include="..\libpmemblk\btt.c" />
+    <ClCompile Include="check.c" />
+    <ClCompile Include="check_bad_blocks.c" />
+    <ClCompile Include="check_backup.c" />
+    <ClCompile Include="check_blk.c" />
+    <ClCompile Include="check_btt_info.c" />
+    <ClCompile Include="check_btt_map_flog.c" />
+    <ClCompile Include="check_log.c" />
+    <ClCompile Include="check_pool_hdr.c" />
+    <ClCompile Include="check_sds.c" />
+    <ClCompile Include="check_util.c" />
+    <ClCompile Include="check_write.c" />
+    <ClCompile Include="feature.c" />
+    <ClCompile Include="libpmempool.c" />
+    <ClCompile Include="libpmempool_main.c" />
+    <ClCompile Include="pool.c" />
+    <ClCompile Include="replica.c" />
+    <ClCompile Include="rm.c" />
+    <ClCompile Include="sync.c" />
+    <ClCompile Include="transform.c" />
+    <ClCompile Include="..\libpmem2\config.c" />
+    <ClCompile Include="..\libpmem2\source.c" />
+    <ClCompile Include="..\libpmem2\source_windows.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils.c" />
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmempool.def" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\libpmemblk\libpmemblk.vcxproj">
+      <Project>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\libpmemlog\libpmemlog.vcxproj">
+      <Project>{0b1818eb-bdc8-4865-964f-db8bf05cfd86}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\libpmemobj\libpmemobj.vcxproj">
+      <Project>{1baa1617-93ae-4196-8a1a-bd492fb18aef}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\libpmem\libpmem.vcxproj">
+      <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\windows\srcversion\srcversion.vcxproj">
+      <Project>{901f04db-e1a5-4a41-8b81-9d31c19acd59}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmempool.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{CF9A0883-6334-44C7-AC29-349468C78E27}</ProjectGuid>
+    <Keyword>DynamicLibrary</Keyword>
+    <ProjectName>libpmempool</ProjectName>
+    <RootNamespace>libpmempool</RootNamespace>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_debug.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\windows\libs_release.props" />
+  </ImportGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\libpmemobj;$(SolutionDir)\libpmemblk;$(SolutionDir)\libpmemlog;$(SolutionDir)\libpmem2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\libpmemobj;$(SolutionDir)\libpmemblk;$(SolutionDir)\libpmemlog;$(SolutionDir)\libpmem2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj.filters b/ceph/src/pmdk/src/libpmempool/libpmempool.vcxproj.filters
new file mode 100644 (file)
index 0000000..ffd1ce2
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="..\libpmemblk\btt.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_backup.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_btt_info.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_btt_map_flog.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_sds.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_write.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\file_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmempool.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="libpmempool_main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\mmap_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\fs_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\out.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pool.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\pool_hdr.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sync.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="rm.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="replica.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\util.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="transform.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\uuid_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\os_thread_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_blk.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="check_log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="feature.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\shutdown_state.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\os_deep_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\set_badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\common\bad_blocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\core\alloc.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\auto_flush_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\config.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\badblocks_none.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\source_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\pmem2_utils_other.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\libpmem2\usc_windows.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\common\mmap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\out.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pmemcommon.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pmempool.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pool.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\pool_hdr.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="replica.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\set.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="check.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="check_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\dlsym.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\file.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\sys_util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\util.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\uuid.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\valgrind_internal.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\include\libpmempool.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmemblk\btt.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fs.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\os.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\common\os_deep.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\alloc.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\core\fault_injection.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\auto_flush_windows.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\badblocks.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\libpmem2\pmem2_utils.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{cd079c79-5441-413e-b2ba-99fed2b0b779}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{9ad93d4f-a9d1-4e38-94a1-77e36acc268f}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="libpmempool.def">
+      <Filter>Source Files</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="libpmempool.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/libpmempool/libpmempool_main.c b/ceph/src/pmdk/src/libpmempool/libpmempool_main.c
new file mode 100644 (file)
index 0000000..61419cd
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2017, Intel Corporation */
+
+/*
+ * libpmempool_main.c -- entry point for libpmempool.dll
+ *
+ * XXX - This is a placeholder.  All the library initialization/cleanup
+ * that is done in library ctors/dtors, as well as TLS initialization
+ * should be moved here.
+ */
+
+#include <stdio.h>
+
+void libpmempool_init(void);
+void libpmempool_fini(void);
+
+int APIENTRY
+DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+       switch (dwReason) {
+       case DLL_PROCESS_ATTACH:
+               libpmempool_init();
+               break;
+
+       case DLL_THREAD_ATTACH:
+       case DLL_THREAD_DETACH:
+               break;
+
+       case DLL_PROCESS_DETACH:
+               libpmempool_fini();
+               break;
+       }
+       return TRUE;
+}
diff --git a/ceph/src/pmdk/src/libpmempool/pmempool.h b/ceph/src/pmdk/src/libpmempool/pmempool.h
new file mode 100644 (file)
index 0000000..710f235
--- /dev/null
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * pmempool.h -- internal definitions for libpmempool
+ */
+
+#ifndef PMEMPOOL_H
+#define PMEMPOOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PMEMPOOL_LOG_PREFIX "libpmempool"
+#define PMEMPOOL_LOG_LEVEL_VAR "PMEMPOOL_LOG_LEVEL"
+#define PMEMPOOL_LOG_FILE_VAR "PMEMPOOL_LOG_FILE"
+
+enum check_result {
+       CHECK_RESULT_CONSISTENT,
+       CHECK_RESULT_NOT_CONSISTENT,
+       CHECK_RESULT_ASK_QUESTIONS,
+       CHECK_RESULT_PROCESS_ANSWERS,
+       CHECK_RESULT_REPAIRED,
+       CHECK_RESULT_CANNOT_REPAIR,
+       CHECK_RESULT_ERROR,
+       CHECK_RESULT_INTERNAL_ERROR
+};
+
+/*
+ * pmempool_check_ctx -- context and arguments for check command
+ */
+struct pmempool_check_ctx {
+       struct pmempool_check_args args;
+       char *path;
+       char *backup_path;
+
+       struct check_data *data;
+       struct pool_data *pool;
+       enum check_result result;
+       unsigned sync_required;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/pool.c b/ceph/src/pmdk/src/libpmempool/pool.c
new file mode 100644 (file)
index 0000000..ad54330
--- /dev/null
@@ -0,0 +1,1123 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * pool.c -- pool processing functions
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <endian.h>
+
+#ifndef _WIN32
+#include <sys/ioctl.h>
+#ifdef __FreeBSD__
+#include <sys/disk.h>
+#define BLKGETSIZE64 DIOCGMEDIASIZE
+#else
+#include <linux/fs.h>
+#endif
+#endif
+
+#include "libpmem.h"
+#include "libpmemlog.h"
+#include "libpmemblk.h"
+#include "libpmempool.h"
+
+#include "out.h"
+#include "pmempool.h"
+#include "pool.h"
+#include "lane.h"
+#include "obj.h"
+#include "btt.h"
+#include "file.h"
+#include "os.h"
+#include "set.h"
+#include "check_util.h"
+#include "util_pmem.h"
+#include "mmap.h"
+
+/* arbitrary size of a maximum file part being read / write at once */
+#define RW_BUFFERING_SIZE (128 * 1024 * 1024)
+
+/*
+ * pool_btt_lseek -- (internal) perform lseek in BTT file mode
+ */
+static inline os_off_t
+pool_btt_lseek(struct pool_data *pool, os_off_t offset, int whence)
+{
+       os_off_t result;
+       if ((result = os_lseek(pool->set_file->fd, offset, whence)) == -1)
+               ERR("!lseek");
+
+       return result;
+}
+
+/*
+ * pool_btt_read -- (internal) perform read in BTT file mode
+ */
+static inline ssize_t
+pool_btt_read(struct pool_data *pool, void *dst, size_t count)
+{
+       size_t total = 0;
+       ssize_t nread;
+       while (count > total &&
+               (nread = util_read(pool->set_file->fd, dst, count - total))) {
+               if (nread == -1) {
+                       ERR("!read");
+                       return total ? (ssize_t)total : -1;
+               }
+
+               dst = (void *)((ssize_t)dst + nread);
+               total += (size_t)nread;
+       }
+
+       return (ssize_t)total;
+}
+
+/*
+ * pool_btt_write -- (internal) perform write in BTT file mode
+ */
+static inline ssize_t
+pool_btt_write(struct pool_data *pool, const void *src, size_t count)
+{
+       ssize_t nwrite = 0;
+       size_t total = 0;
+       while (count > total &&
+               (nwrite = util_write(pool->set_file->fd, src,
+                               count - total))) {
+               if (nwrite == -1) {
+                       ERR("!write");
+                       return total ? (ssize_t)total : -1;
+               }
+
+               src = (void *)((ssize_t)src + nwrite);
+               total += (size_t)nwrite;
+       }
+
+       return (ssize_t)total;
+}
+
+/*
+ * pool_set_read_header -- (internal) read a header of a pool set
+ */
+static int
+pool_set_read_header(const char *fname, struct pool_hdr *hdr)
+{
+       struct pool_set *set;
+       int ret = 0;
+
+       if (util_poolset_read(&set, fname)) {
+               return -1;
+       }
+       /* open the first part set file to read the pool header values */
+       const struct pool_set_part *part = PART(REP(set, 0), 0);
+       int fdp = util_file_open(part->path, NULL, 0, O_RDONLY);
+       if (fdp < 0) {
+               ERR("cannot open poolset part file");
+               ret = -1;
+               goto err_pool_set;
+       }
+
+       /* read the pool header from first pool set file */
+       if (pread(fdp, hdr, sizeof(*hdr), 0) != sizeof(*hdr)) {
+               ERR("cannot read pool header from poolset");
+               ret = -1;
+               goto err_close_part;
+       }
+
+err_close_part:
+       os_close(fdp);
+
+err_pool_set:
+       util_poolset_free(set);
+       return ret;
+}
+
+/*
+ * pool_set_map -- (internal) map poolset
+ */
+static int
+pool_set_map(const char *fname, struct pool_set **poolset, unsigned flags)
+{
+       ASSERTeq(util_is_poolset_file(fname), 1);
+
+       struct pool_hdr hdr;
+       if (pool_set_read_header(fname, &hdr))
+               return -1;
+
+       util_convert2h_hdr_nocheck(&hdr);
+
+       /* parse pool type from first pool set file */
+       enum pool_type type = pool_hdr_get_type(&hdr);
+       if (type == POOL_TYPE_UNKNOWN) {
+               ERR("cannot determine pool type from poolset");
+               return -1;
+       }
+
+       /*
+        * Open the poolset, the values passed to util_pool_open are read
+        * from the first poolset file, these values are then compared with
+        * the values from all headers of poolset files.
+        */
+       struct pool_attr attr;
+       util_pool_hdr2attr(&attr, &hdr);
+       if (util_pool_open(poolset, fname, 0 /* minpartsize */, &attr,
+                               NULL, NULL, flags | POOL_OPEN_IGNORE_SDS |
+                                               POOL_OPEN_IGNORE_BAD_BLOCKS)) {
+               ERR("opening poolset failed");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * pool_params_from_header -- parse pool params from pool header
+ */
+void
+pool_params_from_header(struct pool_params *params, const struct pool_hdr *hdr)
+{
+       memcpy(params->signature, hdr->signature, sizeof(params->signature));
+       memcpy(&params->features, &hdr->features, sizeof(params->features));
+
+       /*
+        * Check if file is a part of pool set by comparing the UUID with the
+        * next part UUID. If it is the same it means the pool consist of a
+        * single file.
+        */
+       int uuid_eq_next = uuidcmp(hdr->uuid, hdr->next_part_uuid);
+       int uuid_eq_prev = uuidcmp(hdr->uuid, hdr->prev_part_uuid);
+       params->is_part = !params->is_poolset && (uuid_eq_next || uuid_eq_prev);
+
+       params->type = pool_hdr_get_type(hdr);
+}
+
+/*
+ * pool_check_type_to_pool_type -- (internal) convert check pool type to
+ *     internal pool type value
+ */
+static enum pool_type
+pool_check_type_to_pool_type(enum pmempool_pool_type check_pool_type)
+{
+       switch (check_pool_type) {
+       case PMEMPOOL_POOL_TYPE_LOG:
+               return POOL_TYPE_LOG;
+       case PMEMPOOL_POOL_TYPE_BLK:
+               return POOL_TYPE_BLK;
+       case PMEMPOOL_POOL_TYPE_OBJ:
+               return POOL_TYPE_OBJ;
+       default:
+               ERR("can not convert pmempool_pool_type %u to pool_type",
+                       check_pool_type);
+               return POOL_TYPE_UNKNOWN;
+       }
+}
+
+/*
+ * pool_parse_params -- parse pool type, file size and block size
+ */
+static int
+pool_params_parse(const PMEMpoolcheck *ppc, struct pool_params *params,
+       int check)
+{
+       LOG(3, NULL);
+       int is_btt = ppc->args.pool_type == PMEMPOOL_POOL_TYPE_BTT;
+
+       params->type = POOL_TYPE_UNKNOWN;
+       params->is_poolset = util_is_poolset_file(ppc->path) == 1;
+
+       int fd = util_file_open(ppc->path, NULL, 0, O_RDONLY);
+       if (fd < 0)
+               return -1;
+
+       int ret = 0;
+
+       os_stat_t stat_buf;
+       ret = os_fstat(fd, &stat_buf);
+       if (ret)
+               goto out_close;
+
+       ASSERT(stat_buf.st_size >= 0);
+
+       params->mode = stat_buf.st_mode;
+
+       struct pool_set *set;
+       void *addr;
+       if (params->is_poolset) {
+               /*
+                * Need to close the poolset because it will be opened with
+                * flock in the following instructions.
+                */
+               os_close(fd);
+               fd = -1;
+
+               if (check) {
+                       if (pool_set_map(ppc->path, &set, 0))
+                               return -1;
+               } else {
+                       ret = util_poolset_create_set(&set, ppc->path,
+                               0, 0, true);
+                       if (ret < 0) {
+                               LOG(2, "cannot open pool set -- '%s'",
+                                       ppc->path);
+                               return -1;
+                       }
+                       if (set->remote) {
+                               ERR("poolsets with remote replicas are not "
+                                       "supported");
+                               return -1;
+                       }
+                       if (util_pool_open_nocheck(set,
+                                               POOL_OPEN_IGNORE_BAD_BLOCKS))
+                               return -1;
+               }
+
+               params->size = set->poolsize;
+               addr = set->replica[0]->part[0].addr;
+
+               /*
+                * XXX mprotect for device dax with length not aligned to its
+                * page granularity causes SIGBUS on the next page fault.
+                * The length argument of this call should be changed to
+                * set->poolsize once the kernel issue is solved.
+                */
+               if (mprotect(addr, set->replica[0]->repsize,
+                       PROT_READ) < 0) {
+                       ERR("!mprotect");
+                       goto out_unmap;
+               }
+               params->is_dev_dax = set->replica[0]->part[0].is_dev_dax;
+               params->is_pmem = set->replica[0]->is_pmem;
+       } else if (is_btt) {
+               params->size = (size_t)stat_buf.st_size;
+#ifndef _WIN32
+               if (params->mode & S_IFBLK)
+                       if (ioctl(fd, BLKGETSIZE64, &params->size)) {
+                               ERR("!ioctl");
+                               goto out_close;
+                       }
+#endif
+               addr = NULL;
+       } else {
+               enum file_type type = util_file_get_type(ppc->path);
+               if (type < 0) {
+                       ret = -1;
+                       goto out_close;
+               }
+
+               ssize_t s = util_file_get_size(ppc->path);
+               if (s < 0) {
+                       ret = -1;
+                       goto out_close;
+               }
+               params->size = (size_t)s;
+               int map_sync;
+               addr = util_map(fd, 0, params->size, MAP_SHARED, 1, 0,
+                       &map_sync);
+               if (addr == NULL) {
+                       ret = -1;
+                       goto out_close;
+               }
+               params->is_dev_dax = type == TYPE_DEVDAX;
+               params->is_pmem = params->is_dev_dax || map_sync ||
+                       pmem_is_pmem(addr, params->size);
+       }
+
+       /* stop processing for BTT device */
+       if (is_btt) {
+               params->type = POOL_TYPE_BTT;
+               params->is_part = false;
+               goto out_close;
+       }
+
+       struct pool_hdr hdr;
+       memcpy(&hdr, addr, sizeof(hdr));
+       util_convert2h_hdr_nocheck(&hdr);
+       pool_params_from_header(params, &hdr);
+
+       if (ppc->args.pool_type != PMEMPOOL_POOL_TYPE_DETECT) {
+               enum pool_type declared_type =
+                       pool_check_type_to_pool_type(ppc->args.pool_type);
+               if ((params->type & ~declared_type) != 0) {
+                       ERR("declared pool type does not match");
+                       errno = EINVAL;
+                       ret = 1;
+                       goto out_unmap;
+               }
+       }
+
+       if (params->type == POOL_TYPE_BLK) {
+               struct pmemblk pbp;
+               memcpy(&pbp, addr, sizeof(pbp));
+               params->blk.bsize = le32toh(pbp.bsize);
+       } else if (params->type == POOL_TYPE_OBJ) {
+               struct pmemobjpool *pop = addr;
+               memcpy(params->obj.layout, pop->layout,
+                       PMEMOBJ_MAX_LAYOUT);
+       }
+
+out_unmap:
+       if (params->is_poolset) {
+               ASSERTeq(fd, -1);
+               ASSERTne(addr, NULL);
+               util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       } else if (!is_btt) {
+               ASSERTne(fd, -1);
+               ASSERTne(addr, NULL);
+               munmap(addr, params->size);
+       }
+out_close:
+       if (fd != -1)
+               os_close(fd);
+       return ret;
+}
+
+/*
+ * pool_set_file_open -- (internal) opens pool set file or regular file
+ */
+static struct pool_set_file *
+pool_set_file_open(const char *fname, struct pool_params *params, int rdonly)
+{
+       LOG(3, NULL);
+
+       struct pool_set_file *file = calloc(1, sizeof(*file));
+       if (!file)
+               return NULL;
+
+       file->fname = strdup(fname);
+       if (!file->fname)
+               goto err;
+
+       const char *path = file->fname;
+
+       if (params->type != POOL_TYPE_BTT) {
+               int ret = util_poolset_create_set(&file->poolset, path,
+                       0, 0, true);
+               if (ret < 0) {
+                       LOG(2, "cannot open pool set -- '%s'", path);
+                       goto err_free_fname;
+               }
+               unsigned flags = (rdonly ? POOL_OPEN_COW : 0) |
+                                       POOL_OPEN_IGNORE_BAD_BLOCKS;
+               if (util_pool_open_nocheck(file->poolset, flags))
+                       goto err_free_fname;
+
+               file->size = file->poolset->poolsize;
+
+               /* get modification time from the first part of first replica */
+               path = file->poolset->replica[0]->part[0].path;
+               file->addr = file->poolset->replica[0]->part[0].addr;
+       } else {
+               int oflag = rdonly ? O_RDONLY : O_RDWR;
+               file->fd = util_file_open(fname, NULL, 0, oflag);
+               file->size = params->size;
+       }
+
+       os_stat_t buf;
+       if (os_stat(path, &buf)) {
+               ERR("%s", path);
+               goto err_close_poolset;
+       }
+
+       file->mtime = buf.st_mtime;
+       file->mode = buf.st_mode;
+       return file;
+
+err_close_poolset:
+       if (params->type != POOL_TYPE_BTT)
+               util_poolset_close(file->poolset, DO_NOT_DELETE_PARTS);
+       else if (file->fd != -1)
+               os_close(file->fd);
+err_free_fname:
+       free(file->fname);
+err:
+       free(file);
+       return NULL;
+}
+
+/*
+ * pool_set_parse -- parse poolset file
+ */
+int
+pool_set_parse(struct pool_set **setp, const char *path)
+{
+       LOG(3, "setp %p path %s", setp, path);
+
+       int fd = os_open(path, O_RDONLY);
+       int ret = 0;
+
+       if (fd < 0)
+               return 1;
+
+       if (util_poolset_parse(setp, path, fd)) {
+               ret = 1;
+               goto err_close;
+       }
+
+err_close:
+       os_close(fd);
+       return ret;
+}
+
+/*
+ * pool_data_alloc -- allocate pool data and open set_file
+ */
+struct pool_data *
+pool_data_alloc(PMEMpoolcheck *ppc)
+{
+       LOG(3, NULL);
+
+       struct pool_data *pool = calloc(1, sizeof(*pool));
+       if (!pool) {
+               ERR("!calloc");
+               return NULL;
+       }
+
+       PMDK_TAILQ_INIT(&pool->arenas);
+       pool->uuid_op = UUID_NOP;
+
+       if (pool_params_parse(ppc, &pool->params, 0))
+               goto error;
+
+       int rdonly = CHECK_IS_NOT(ppc, REPAIR);
+       int prv = CHECK_IS(ppc, DRY_RUN);
+
+       if (prv && pool->params.is_dev_dax) {
+               errno = ENOTSUP;
+               ERR("!cannot perform a dry run on dax device");
+               goto error;
+       }
+
+       pool->set_file = pool_set_file_open(ppc->path, &pool->params, prv);
+       if (pool->set_file == NULL)
+               goto error;
+
+       /*
+        * XXX mprotect for device dax with length not aligned to its
+        * page granularity causes SIGBUS on the next page fault.
+        * The length argument of this call should be changed to
+        * pool->set_file->poolsize once the kernel issue is solved.
+        */
+       if (rdonly && mprotect(pool->set_file->addr,
+               pool->set_file->poolset->replica[0]->repsize,
+               PROT_READ) < 0)
+               goto error;
+
+       if (pool->params.type != POOL_TYPE_BTT) {
+               if (pool_set_file_map_headers(pool->set_file, rdonly, prv))
+                       goto error;
+       }
+
+       return pool;
+
+error:
+       pool_data_free(pool);
+       return NULL;
+}
+
+/*
+ * pool_set_file_close -- (internal) closes pool set file or regular file
+ */
+static void
+pool_set_file_close(struct pool_set_file *file)
+{
+       LOG(3, NULL);
+
+       if (file->poolset)
+               util_poolset_close(file->poolset, DO_NOT_DELETE_PARTS);
+       else if (file->addr) {
+               munmap(file->addr, file->size);
+               os_close(file->fd);
+       } else if (file->fd)
+               os_close(file->fd);
+
+       free(file->fname);
+       free(file);
+}
+
+/*
+ * pool_data_free -- close set_file and release pool data
+ */
+void
+pool_data_free(struct pool_data *pool)
+{
+       LOG(3, NULL);
+
+       if (pool->set_file) {
+               if (pool->params.type != POOL_TYPE_BTT)
+                       pool_set_file_unmap_headers(pool->set_file);
+               pool_set_file_close(pool->set_file);
+       }
+
+       while (!PMDK_TAILQ_EMPTY(&pool->arenas)) {
+               struct arena *arenap = PMDK_TAILQ_FIRST(&pool->arenas);
+               if (arenap->map)
+                       free(arenap->map);
+               if (arenap->flog)
+                       free(arenap->flog);
+
+               PMDK_TAILQ_REMOVE(&pool->arenas, arenap, next);
+               free(arenap);
+       }
+
+       free(pool);
+}
+
+/*
+ * pool_set_file_map -- return mapped address at given offset
+ */
+void *
+pool_set_file_map(struct pool_set_file *file, uint64_t offset)
+{
+       if (file->addr == MAP_FAILED)
+               return NULL;
+
+       return (char *)file->addr + offset;
+}
+
+/*
+ * pool_read -- read from pool set file or regular file
+ *
+ * 'buff' has to be a buffer at least 'nbytes' long
+ * 'off' is an offset from the beginning of the pool
+ */
+int
+pool_read(struct pool_data *pool, void *buff, size_t nbytes, uint64_t off)
+{
+       if (off + nbytes > pool->set_file->size)
+               return -1;
+
+       if (pool->params.type != POOL_TYPE_BTT)
+               memcpy(buff, (char *)pool->set_file->addr + off, nbytes);
+       else {
+               if (pool_btt_lseek(pool, (os_off_t)off, SEEK_SET) == -1)
+                       return -1;
+               if ((size_t)pool_btt_read(pool, buff, nbytes) != nbytes)
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * pool_write -- write to pool set file or regular file
+ *
+ * 'buff' has to be a buffer at least 'nbytes' long
+ * 'off' is an offset from the beginning of the pool
+ */
+int
+pool_write(struct pool_data *pool, const void *buff, size_t nbytes,
+       uint64_t off)
+{
+       if (off + nbytes > pool->set_file->size)
+               return -1;
+
+       if (pool->params.type != POOL_TYPE_BTT) {
+               memcpy((char *)pool->set_file->addr + off, buff, nbytes);
+               util_persist_auto(pool->params.is_pmem,
+                               (char *)pool->set_file->addr + off, nbytes);
+       } else {
+               if (pool_btt_lseek(pool, (os_off_t)off, SEEK_SET) == -1)
+                       return -1;
+               if ((size_t)pool_btt_write(pool, buff, nbytes) != nbytes)
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * pool_copy -- make a copy of the pool
+ */
+int
+pool_copy(struct pool_data *pool, const char *dst_path, int overwrite)
+{
+       struct pool_set_file *file = pool->set_file;
+       int dfd;
+       int exists = util_file_exists(dst_path);
+       if (exists < 0)
+               return -1;
+
+       if (exists) {
+               if (!overwrite) {
+                       errno = EEXIST;
+                       return -1;
+               }
+               dfd = util_file_open(dst_path, NULL, 0, O_RDWR);
+       } else {
+               errno = 0;
+               dfd = util_file_create(dst_path, file->size, 0);
+       }
+       if (dfd < 0)
+               return -1;
+
+       int result = 0;
+       os_stat_t stat_buf;
+       if (os_stat(file->fname, &stat_buf)) {
+               result = -1;
+               goto out_close;
+       }
+
+       if (fchmod(dfd, stat_buf.st_mode)) {
+               result = -1;
+               goto out_close;
+       }
+
+       void *daddr = mmap(NULL, file->size, PROT_READ | PROT_WRITE,
+               MAP_SHARED, dfd, 0);
+       if (daddr == MAP_FAILED) {
+               result = -1;
+               goto out_close;
+       }
+
+       if (pool->params.type != POOL_TYPE_BTT) {
+               void *saddr = pool_set_file_map(file, 0);
+               memcpy(daddr, saddr, file->size);
+               goto out_unmap;
+       }
+
+       void *buf = malloc(RW_BUFFERING_SIZE);
+       if (buf == NULL) {
+               ERR("!malloc");
+               result = -1;
+               goto out_unmap;
+       }
+
+       if (pool_btt_lseek(pool, 0, SEEK_SET) == -1) {
+               result = -1;
+               goto out_free;
+       }
+       ssize_t buf_read = 0;
+       void *dst = daddr;
+       while ((buf_read = pool_btt_read(pool, buf, RW_BUFFERING_SIZE))) {
+               if (buf_read == -1)
+                       break;
+
+               memcpy(dst, buf, (size_t)buf_read);
+               dst  = (void *)((ssize_t)dst + buf_read);
+       }
+
+out_free:
+       free(buf);
+out_unmap:
+       munmap(daddr, file->size);
+out_close:
+       (void) os_close(dfd);
+       return result;
+}
+
+/*
+ * pool_set_part_copy -- make a copy of the poolset part
+ */
+int
+pool_set_part_copy(struct pool_set_part *dpart, struct pool_set_part *spart,
+       int overwrite)
+{
+       LOG(3, "dpart %p spart %p", dpart, spart);
+
+       int result = 0;
+
+       os_stat_t stat_buf;
+       if (os_fstat(spart->fd, &stat_buf)) {
+               ERR("!util_stat");
+               return -1;
+       }
+
+       size_t smapped = 0;
+       void *saddr = pmem_map_file(spart->path, 0, 0, S_IREAD, &smapped, NULL);
+       if (!saddr)
+               return -1;
+
+       size_t dmapped = 0;
+       int is_pmem;
+       void *daddr;
+
+       int exists = util_file_exists(dpart->path);
+       if (exists < 0) {
+               result = -1;
+               goto out_sunmap;
+       }
+
+       if (exists) {
+               if (!overwrite) {
+                       errno = EEXIST;
+                       result = -1;
+                       goto out_sunmap;
+               }
+
+               daddr = pmem_map_file(dpart->path, 0, 0, S_IWRITE, &dmapped,
+                       &is_pmem);
+       } else {
+               errno = 0;
+               daddr = pmem_map_file(dpart->path, dpart->filesize,
+                               PMEM_FILE_CREATE | PMEM_FILE_EXCL,
+                               stat_buf.st_mode, &dmapped, &is_pmem);
+       }
+       if (!daddr) {
+               result = -1;
+               goto out_sunmap;
+       }
+
+#ifdef DEBUG
+       /* provide extra logging in case of wrong dmapped/smapped value */
+       if (dmapped < smapped) {
+               LOG(1, "dmapped < smapped: dmapped = %lu, smapped = %lu",
+                       dmapped, smapped);
+               ASSERT(0);
+       }
+#endif
+
+       if (is_pmem) {
+               pmem_memcpy_persist(daddr, saddr, smapped);
+       } else {
+               memcpy(daddr, saddr, smapped);
+               pmem_msync(daddr, smapped);
+       }
+
+       pmem_unmap(daddr, dmapped);
+out_sunmap:
+       pmem_unmap(saddr, smapped);
+       return result;
+}
+
+/*
+ * pool_memset -- memset pool part described by off and count
+ */
+int
+pool_memset(struct pool_data *pool, uint64_t off, int c, size_t count)
+{
+       int result = 0;
+
+       if (pool->params.type != POOL_TYPE_BTT)
+               memset((char *)off, 0, count);
+       else {
+               if (pool_btt_lseek(pool, (os_off_t)off, SEEK_SET) == -1)
+                       return -1;
+
+               size_t zero_size = min(count, RW_BUFFERING_SIZE);
+               void *buf = malloc(zero_size);
+               if (!buf) {
+                       ERR("!malloc");
+                       return -1;
+               }
+               memset(buf, c, zero_size);
+               ssize_t nwrite = 0;
+               do {
+                       zero_size = min(zero_size, count);
+                       nwrite = pool_btt_write(pool, buf, zero_size);
+                       if (nwrite < 0) {
+                               result = -1;
+                               break;
+                       }
+                       count -= (size_t)nwrite;
+               } while (count > 0);
+
+               free(buf);
+       }
+
+       return result;
+}
+
+/*
+ * pool_set_files_count -- get total number of parts of all replicas
+ */
+unsigned
+pool_set_files_count(struct pool_set_file *file)
+{
+       unsigned ret = 0;
+       unsigned nreplicas = file->poolset->nreplicas;
+       for (unsigned r = 0; r < nreplicas; r++) {
+               struct pool_replica *rep = file->poolset->replica[r];
+               ret += rep->nparts;
+       }
+
+       return ret;
+}
+
+/*
+ * pool_set_file_map_headers -- map headers of each pool set part file
+ */
+int
+pool_set_file_map_headers(struct pool_set_file *file, int rdonly, int prv)
+{
+       if (!file->poolset)
+               return -1;
+
+       for (unsigned r = 0; r < file->poolset->nreplicas; r++) {
+               struct pool_replica *rep = file->poolset->replica[r];
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+                       if (util_map_hdr(part,
+                               prv ? MAP_PRIVATE : MAP_SHARED, rdonly)) {
+                               part->hdr = NULL;
+                               goto err;
+                       }
+               }
+       }
+
+       return 0;
+err:
+       pool_set_file_unmap_headers(file);
+       return -1;
+}
+
+/*
+ * pool_set_file_unmap_headers -- unmap headers of each pool set part file
+ */
+void
+pool_set_file_unmap_headers(struct pool_set_file *file)
+{
+       if (!file->poolset)
+               return;
+       for (unsigned r = 0; r < file->poolset->nreplicas; r++) {
+               struct pool_replica *rep = file->poolset->replica[r];
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+                       util_unmap_hdr(part);
+               }
+       }
+}
+
+/*
+ * pool_get_signature -- (internal) return signature of specified pool type
+ */
+static const char *
+pool_get_signature(enum pool_type type)
+{
+       switch (type) {
+       case POOL_TYPE_LOG:
+               return LOG_HDR_SIG;
+       case POOL_TYPE_BLK:
+               return BLK_HDR_SIG;
+       case POOL_TYPE_OBJ:
+               return OBJ_HDR_SIG;
+       default:
+               return NULL;
+       }
+}
+
+/*
+ * pool_hdr_default -- return default pool header values
+ */
+void
+pool_hdr_default(enum pool_type type, struct pool_hdr *hdrp)
+{
+       memset(hdrp, 0, sizeof(*hdrp));
+       const char *sig = pool_get_signature(type);
+       ASSERTne(sig, NULL);
+
+       memcpy(hdrp->signature, sig, POOL_HDR_SIG_LEN);
+
+       switch (type) {
+       case POOL_TYPE_LOG:
+               hdrp->major = LOG_FORMAT_MAJOR;
+               hdrp->features = log_format_feat_default;
+               break;
+       case POOL_TYPE_BLK:
+               hdrp->major = BLK_FORMAT_MAJOR;
+               hdrp->features = blk_format_feat_default;
+               break;
+       case POOL_TYPE_OBJ:
+               hdrp->major = OBJ_FORMAT_MAJOR;
+               hdrp->features = obj_format_feat_default;
+               break;
+       default:
+               break;
+       }
+}
+
+/*
+ * pool_hdr_get_type -- return pool type based on pool header data
+ */
+enum pool_type
+pool_hdr_get_type(const struct pool_hdr *hdrp)
+{
+       if (memcmp(hdrp->signature, LOG_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return POOL_TYPE_LOG;
+       else if (memcmp(hdrp->signature, BLK_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return POOL_TYPE_BLK;
+       else if (memcmp(hdrp->signature, OBJ_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return POOL_TYPE_OBJ;
+       else
+               return POOL_TYPE_UNKNOWN;
+}
+
+/*
+ * pool_get_pool_type_str -- return human-readable pool type string
+ */
+const char *
+pool_get_pool_type_str(enum pool_type type)
+{
+       switch (type) {
+       case POOL_TYPE_BTT:
+               return "btt";
+       case POOL_TYPE_LOG:
+               return "pmemlog";
+       case POOL_TYPE_BLK:
+               return "pmemblk";
+       case POOL_TYPE_OBJ:
+               return "pmemobj";
+       default:
+               return "unknown";
+       }
+}
+
+/*
+ * pool_set_type -- get pool type of a poolset
+ */
+enum pool_type
+pool_set_type(struct pool_set *set)
+{
+       struct pool_hdr hdr;
+
+       /* open the first part file to read the pool header values */
+       const struct pool_set_part *part = PART(REP(set, 0), 0);
+
+       if (util_file_pread(part->path, &hdr, sizeof(hdr), 0) !=
+                       sizeof(hdr)) {
+               ERR("cannot read pool header from poolset");
+               return POOL_TYPE_UNKNOWN;
+       }
+
+       util_convert2h_hdr_nocheck(&hdr);
+       enum pool_type type = pool_hdr_get_type(&hdr);
+       return type;
+}
+
+/*
+ * pool_btt_info_valid -- check consistency of BTT Info header
+ */
+int
+pool_btt_info_valid(struct btt_info *infop)
+{
+       if (memcmp(infop->sig, BTTINFO_SIG, BTTINFO_SIG_LEN) != 0)
+               return 0;
+
+       return util_checksum(infop, sizeof(*infop), &infop->checksum, 0, 0);
+}
+
+/*
+ * pool_blk_get_first_valid_arena -- get first valid BTT Info in arena
+ */
+int
+pool_blk_get_first_valid_arena(struct pool_data *pool, struct arena *arenap)
+{
+       arenap->zeroed = true;
+       uint64_t offset = pool_get_first_valid_btt(pool, &arenap->btt_info,
+               2 * BTT_ALIGNMENT, &arenap->zeroed);
+
+       if (offset != 0) {
+               arenap->offset = offset;
+               arenap->valid = true;
+               return 1;
+       }
+
+       return 0;
+}
+
+/*
+ * pool_next_arena_offset --  get offset of next arena
+ *
+ * Calculated offset is theoretical. Function does not check if such arena can
+ * exist.
+ */
+uint64_t
+pool_next_arena_offset(struct pool_data *pool, uint64_t offset)
+{
+       uint64_t lastoff = (pool->set_file->size & ~(BTT_ALIGNMENT - 1));
+       uint64_t nextoff = min(offset + BTT_MAX_ARENA, lastoff);
+       return nextoff;
+}
+
+/*
+ * pool_get_first_valid_btt -- return offset to first valid BTT Info
+ *
+ * - Return offset to valid BTT Info header in pool file.
+ * - Start looking from given offset.
+ * - Convert BTT Info header to host endianness.
+ * - Return the BTT Info header by pointer.
+ * - If zeroed pointer provided would check if all checked BTT Info are zeroed
+ *     which is useful for BLK pools
+ */
+uint64_t
+pool_get_first_valid_btt(struct pool_data *pool, struct btt_info *infop,
+       uint64_t offset, bool *zeroed)
+{
+       /* if we have valid arena get BTT Info header from it */
+       if (pool->narenas != 0) {
+               struct arena *arenap = PMDK_TAILQ_FIRST(&pool->arenas);
+               memcpy(infop, &arenap->btt_info, sizeof(*infop));
+               return arenap->offset;
+       }
+
+       const size_t info_size = sizeof(*infop);
+
+       /* theoretical offsets to BTT Info header and backup */
+       uint64_t offsets[2] = {offset, 0};
+
+       while (offsets[0] < pool->set_file->size) {
+               /* calculate backup offset */
+               offsets[1] = pool_next_arena_offset(pool, offsets[0]) -
+                       info_size;
+
+               /* check both offsets: header and backup */
+               for (int i = 0; i < 2; ++i) {
+                       if (pool_read(pool, infop, info_size, offsets[i]))
+                               continue;
+
+                       /* check if all possible BTT Info are zeroed */
+                       if (zeroed)
+                               *zeroed &= util_is_zeroed((const void *)infop,
+                                       info_size);
+
+                       /* check if read BTT Info is valid */
+                       if (pool_btt_info_valid(infop)) {
+                               btt_info_convert2h(infop);
+                               return offsets[i];
+                       }
+               }
+
+               /* jump to next arena */
+               offsets[0] += BTT_MAX_ARENA;
+       }
+
+       return 0;
+}
+
+/*
+ * pool_get_min_size -- return the minimum pool size of a pool of a given type
+ */
+size_t
+pool_get_min_size(enum pool_type type)
+{
+       switch (type) {
+       case POOL_TYPE_LOG:
+               return PMEMLOG_MIN_POOL;
+       case POOL_TYPE_BLK:
+               return PMEMBLK_MIN_POOL;
+       case POOL_TYPE_OBJ:
+               return PMEMOBJ_MIN_POOL;
+       default:
+               ERR("unknown type of a pool");
+               return SIZE_MAX;
+       }
+}
+
+#if FAULT_INJECTION
+void
+pmempool_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at)
+{
+       core_inject_fault_at(type, nth, at);
+}
+
+int
+pmempool_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/pool.h b/ceph/src/pmdk/src/libpmempool/pool.h
new file mode 100644 (file)
index 0000000..3b51e08
--- /dev/null
@@ -0,0 +1,163 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * pool.h -- internal definitions for pool processing functions
+ */
+
+#ifndef POOL_H
+#define POOL_H
+
+#include <stdbool.h>
+#include <sys/types.h>
+
+#include "libpmemobj.h"
+
+#include "queue.h"
+#include "set.h"
+#include "log.h"
+#include "blk.h"
+#include "btt_layout.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "alloc.h"
+#include "fault_injection.h"
+
+enum pool_type {
+       POOL_TYPE_UNKNOWN       = (1 << 0),
+       POOL_TYPE_LOG           = (1 << 1),
+       POOL_TYPE_BLK           = (1 << 2),
+       POOL_TYPE_OBJ           = (1 << 3),
+       POOL_TYPE_BTT           = (1 << 4),
+
+       POOL_TYPE_ANY           = POOL_TYPE_UNKNOWN | POOL_TYPE_LOG |
+               POOL_TYPE_BLK | POOL_TYPE_OBJ | POOL_TYPE_BTT,
+};
+
+struct pool_params {
+       enum pool_type type;
+       char signature[POOL_HDR_SIG_LEN];
+       features_t features;
+       size_t size;
+       mode_t mode;
+       int is_poolset;
+       int is_part;
+       int is_dev_dax;
+       int is_pmem;
+       union {
+               struct {
+                       uint64_t bsize;
+               } blk;
+               struct {
+                       char layout[PMEMOBJ_MAX_LAYOUT];
+               } obj;
+       };
+};
+
+struct pool_set_file {
+       int fd;
+       char *fname;
+       void *addr;
+       size_t size;
+       struct pool_set *poolset;
+       time_t mtime;
+       mode_t mode;
+};
+
+struct arena {
+       PMDK_TAILQ_ENTRY(arena) next;
+       struct btt_info btt_info;
+       uint32_t id;
+       bool valid;
+       bool zeroed;
+       uint64_t offset;
+       uint8_t *flog;
+       size_t flogsize;
+       uint32_t *map;
+       size_t mapsize;
+};
+
+struct pool_data {
+       struct pool_params params;
+       struct pool_set_file *set_file;
+       int blk_no_layout;
+       union {
+               struct pool_hdr pool;
+               struct pmemlog log;
+               struct pmemblk blk;
+       } hdr;
+       enum {
+               UUID_NOP = 0,
+               UUID_FROM_BTT,
+               UUID_NOT_FROM_BTT,
+       } uuid_op;
+       struct arena bttc;
+       PMDK_TAILQ_HEAD(arenashead, arena) arenas;
+       uint32_t narenas;
+};
+
+struct pool_data *pool_data_alloc(PMEMpoolcheck *ppc);
+void pool_data_free(struct pool_data *pool);
+void pool_params_from_header(struct pool_params *params,
+       const struct pool_hdr *hdr);
+
+int pool_set_parse(struct pool_set **setp, const char *path);
+void *pool_set_file_map(struct pool_set_file *file, uint64_t offset);
+int pool_read(struct pool_data *pool, void *buff, size_t nbytes,
+       uint64_t off);
+int pool_write(struct pool_data *pool, const void *buff, size_t nbytes,
+       uint64_t off);
+int pool_copy(struct pool_data *pool, const char *dst_path, int overwrite);
+int pool_set_part_copy(struct pool_set_part *dpart,
+       struct pool_set_part *spart, int overwrite);
+int pool_memset(struct pool_data *pool, uint64_t off, int c, size_t count);
+
+unsigned pool_set_files_count(struct pool_set_file *file);
+int pool_set_file_map_headers(struct pool_set_file *file, int rdonly, int prv);
+void pool_set_file_unmap_headers(struct pool_set_file *file);
+
+void pool_hdr_default(enum pool_type type, struct pool_hdr *hdrp);
+enum pool_type pool_hdr_get_type(const struct pool_hdr *hdrp);
+enum pool_type pool_set_type(struct pool_set *set);
+const char *pool_get_pool_type_str(enum pool_type type);
+
+int pool_btt_info_valid(struct btt_info *infop);
+
+int pool_blk_get_first_valid_arena(struct pool_data *pool,
+       struct arena *arenap);
+int pool_blk_bsize_valid(uint32_t bsize, uint64_t fsize);
+uint64_t pool_next_arena_offset(struct pool_data *pool, uint64_t header_offset);
+uint64_t pool_get_first_valid_btt(struct pool_data *pool,
+       struct btt_info *infop, uint64_t offset, bool *zeroed);
+size_t pool_get_min_size(enum pool_type);
+
+#if FAULT_INJECTION
+void
+pmempool_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                                       const char *at);
+
+int
+pmempool_fault_injection_enabled(void);
+#else
+static inline void
+pmempool_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       abort();
+}
+
+static inline int
+pmempool_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/replica.c b/ceph/src/pmdk/src/libpmempool/replica.c
new file mode 100644 (file)
index 0000000..cf38e74
--- /dev/null
@@ -0,0 +1,2503 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * replica.c -- groups all commands for replica manipulation
+ */
+
+#include "replica.h"
+
+#include <errno.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <libgen.h>
+
+#include "obj.h"
+#include "palloc.h"
+#include "file.h"
+#include "os.h"
+#include "out.h"
+#include "pool_hdr.h"
+#include "set.h"
+#include "util.h"
+#include "uuid.h"
+#include "shutdown_state.h"
+#include "badblocks.h"
+#include "set_badblocks.h"
+
+/*
+ * check_flags_sync -- (internal) check if flags are supported for sync
+ */
+static int
+check_flags_sync(unsigned flags)
+{
+       flags &= ~(PMEMPOOL_SYNC_DRY_RUN | PMEMPOOL_SYNC_FIX_BAD_BLOCKS);
+       return flags > 0;
+}
+
+/*
+ * check_flags_transform -- (internal) check if flags are supported for
+ *                          transform
+ */
+static int
+check_flags_transform(unsigned flags)
+{
+       flags &= ~PMEMPOOL_TRANSFORM_DRY_RUN;
+       return flags > 0;
+}
+
+/*
+ * replica_align_badblock_offset_length -- align offset and length
+ *                                          of the bad block for the given part
+ */
+void
+replica_align_badblock_offset_length(size_t *offset, size_t *length,
+                       struct pool_set *set_in, unsigned repn, unsigned partn)
+{
+       LOG(3, "offset %zu, length %zu, pool_set %p, replica %u, part %u",
+               *offset, *length, set_in, repn, partn);
+
+       size_t alignment = set_in->replica[repn]->part[partn].alignment;
+
+       size_t off = ALIGN_DOWN(*offset, alignment);
+       size_t len = ALIGN_UP(*length + (*offset - off), alignment);
+
+       *offset = off;
+       *length = len;
+}
+
+/*
+ * replica_get_part_data_len -- get data length for given part
+ */
+size_t
+replica_get_part_data_len(struct pool_set *set_in, unsigned repn,
+               unsigned partn)
+{
+       size_t alignment = set_in->replica[repn]->part[partn].alignment;
+       size_t hdrsize = (set_in->options & OPTION_SINGLEHDR) ? 0 : alignment;
+       return ALIGN_DOWN(set_in->replica[repn]->part[partn].filesize,
+               alignment) - ((partn == 0) ? POOL_HDR_SIZE : hdrsize);
+}
+
+/*
+ * replica_get_part_offset -- get part's offset from the beginning of replica
+ */
+uint64_t
+replica_get_part_offset(struct pool_set *set, unsigned repn, unsigned partn)
+{
+       return (uint64_t)set->replica[repn]->part[partn].addr -
+               (uint64_t)set->replica[repn]->part[0].addr;
+}
+
+/*
+ * replica_get_part_data_offset -- get data length before given part
+ */
+uint64_t
+replica_get_part_data_offset(struct pool_set *set, unsigned repn,
+               unsigned partn)
+{
+       if (partn == 0)
+               return POOL_HDR_SIZE;
+
+       return (uint64_t)set->replica[repn]->part[partn].addr -
+               (uint64_t)set->replica[repn]->part[0].addr;
+}
+
+/*
+ * replica_remove_part -- unlink part from replica
+ */
+int
+replica_remove_part(struct pool_set *set, unsigned repn, unsigned partn,
+                       int fix_bad_blocks)
+{
+       LOG(3, "set %p repn %u partn %u fix_bad_blocks %i",
+               set, repn, partn, fix_bad_blocks);
+
+       struct pool_set_part *part = PART(REP(set, repn), partn);
+       if (part->fd != -1) {
+               os_close(part->fd);
+               part->fd = -1;
+       }
+
+       int olderrno = errno;
+       enum file_type type = util_file_get_type(part->path);
+       if (type == OTHER_ERROR)
+               return -1;
+
+       /* if the part is a device dax, clear its bad blocks */
+       if (type == TYPE_DEVDAX && fix_bad_blocks &&
+           badblocks_clear_all(part->path)) {
+               ERR("clearing bad blocks in device dax failed -- '%s'",
+                       part->path);
+               errno = EIO;
+               return -1;
+       }
+
+       if (type == TYPE_NORMAL && util_unlink(part->path)) {
+               ERR("!removing part %u from replica %u failed",
+                               partn, repn);
+               return -1;
+       }
+
+       errno = olderrno;
+       LOG(4, "Removed part %s number %u from replica %u", part->path, partn,
+                       repn);
+       return 0;
+}
+
+/*
+ * create_replica_health_status -- (internal) create helping structure for
+ *                                 storing replica's health status
+ */
+static struct replica_health_status *
+create_replica_health_status(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+
+       unsigned nparts = set->replica[repn]->nparts;
+       struct replica_health_status *replica_hs;
+
+       replica_hs = Zalloc(sizeof(struct replica_health_status)
+                               + nparts * sizeof(struct part_health_status));
+       if (replica_hs == NULL) {
+               ERR("!Zalloc for replica health status");
+               return NULL;
+       }
+
+       replica_hs->nparts = nparts;
+       replica_hs->nhdrs = set->replica[repn]->nhdrs;
+
+       return replica_hs;
+}
+
+/*
+ * replica_part_remove_recovery_file -- remove bad blocks' recovery file
+ */
+static int
+replica_part_remove_recovery_file(struct part_health_status *phs)
+{
+       LOG(3, "phs %p", phs);
+
+       if (phs->recovery_file_name == NULL || phs->recovery_file_exists == 0)
+               return 0;
+
+       if (os_unlink(phs->recovery_file_name) < 0) {
+               ERR("!removing the bad block recovery file failed -- '%s'",
+                       phs->recovery_file_name);
+               return -1;
+       }
+
+       LOG(3, "bad block recovery file removed -- '%s'",
+               phs->recovery_file_name);
+
+       phs->recovery_file_exists = 0;
+
+       return 0;
+}
+
+/*
+ * replica_remove_all_recovery_files -- remove all recovery files
+ */
+int
+replica_remove_all_recovery_files(struct poolset_health_status *set_hs)
+{
+       LOG(3, "set_hs %p", set_hs);
+
+       int ret = 0;
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               struct replica_health_status *rhs = set_hs->replica[r];
+               for (unsigned p = 0; p < rhs->nparts; ++p)
+                       ret |= replica_part_remove_recovery_file(&rhs->part[p]);
+       }
+
+       return ret;
+}
+
+/*
+ * replica_free_poolset_health_status -- free memory allocated for helping
+ *                                       structure
+ */
+void
+replica_free_poolset_health_status(struct poolset_health_status *set_hs)
+{
+       LOG(3, "set_hs %p", set_hs);
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               for (unsigned p = 0; p < rep_hs->nparts; ++p) {
+                       Free(rep_hs->part[p].recovery_file_name);
+                       Free(rep_hs->part[p].bbs.bbv);
+               }
+
+               Free(set_hs->replica[r]);
+       }
+
+       Free(set_hs);
+}
+
+/*
+ * replica_create_poolset_health_status -- create helping structure for storing
+ *                                 poolset's health status
+ */
+int
+replica_create_poolset_health_status(struct pool_set *set,
+               struct poolset_health_status **set_hsp)
+{
+       LOG(3, "set %p, set_hsp %p", set, set_hsp);
+       unsigned nreplicas = set->nreplicas;
+       struct poolset_health_status *set_hs;
+       set_hs = Zalloc(sizeof(struct poolset_health_status) +
+                       nreplicas * sizeof(struct replica_health_status *));
+       if (set_hs == NULL) {
+               ERR("!Zalloc for poolset health state");
+               return -1;
+       }
+       set_hs->nreplicas = nreplicas;
+       for (unsigned i = 0; i < nreplicas; ++i) {
+               struct replica_health_status *replica_hs =
+                               create_replica_health_status(set, i);
+               if (replica_hs == NULL) {
+                       replica_free_poolset_health_status(set_hs);
+                       return -1;
+               }
+               set_hs->replica[i] = replica_hs;
+       }
+       *set_hsp = set_hs;
+       return 0;
+}
+
+/*
+ * replica_is_part_broken -- check if part is marked as broken in the helping
+ *                           structure
+ */
+int
+replica_is_part_broken(unsigned repn, unsigned partn,
+               struct poolset_health_status *set_hs)
+{
+       struct replica_health_status *rhs = REP_HEALTH(set_hs, repn);
+       return (rhs->flags & IS_BROKEN) ||
+               (PART_HEALTH(rhs, partn) & IS_BROKEN);
+}
+
+/*
+ * is_replica_broken -- check if any part in the replica is marked as broken
+ */
+int
+replica_is_replica_broken(unsigned repn, struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u, set_hs %p", repn, set_hs);
+       struct replica_health_status *r_hs = REP_HEALTH(set_hs, repn);
+       if (r_hs->flags & IS_BROKEN)
+               return 1;
+
+       for (unsigned p = 0; p < r_hs->nparts; ++p) {
+               if (replica_is_part_broken(repn, p, set_hs))
+                       return 1;
+       }
+       return 0;
+}
+
+/*
+ * replica_is_replica_consistent -- check if replica is not marked as
+ *                                  inconsistent
+ */
+int
+replica_is_replica_consistent(unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       return !(REP_HEALTH(set_hs, repn)->flags & IS_INCONSISTENT);
+}
+
+/*
+ * replica_has_bad_blocks -- check if replica has bad blocks
+ */
+int
+replica_has_bad_blocks(unsigned repn, struct poolset_health_status *set_hs)
+{
+       return REP_HEALTH(set_hs, repn)->flags & HAS_BAD_BLOCKS;
+}
+
+/*
+ * replica_part_has_bad_blocks -- check if replica's part has bad blocks
+ */
+int
+replica_part_has_bad_blocks(struct part_health_status *phs)
+{
+       return phs->flags & HAS_BAD_BLOCKS;
+}
+
+/*
+ * replica_part_has_corrupted_header -- (internal) check if replica's part
+ *                              has bad blocks in the header (corrupted header)
+ */
+int
+replica_part_has_corrupted_header(unsigned repn, unsigned partn,
+                                       struct poolset_health_status *set_hs)
+{
+       struct replica_health_status *rhs = REP_HEALTH(set_hs, repn);
+       return PART_HEALTH(rhs, partn) & HAS_CORRUPTED_HEADER;
+}
+
+/*
+ * replica_has_corrupted_header -- (internal) check if replica has bad blocks
+ *                                 in the header (corrupted header)
+ */
+static int
+replica_has_corrupted_header(unsigned repn,
+                               struct poolset_health_status *set_hs)
+{
+       return REP_HEALTH(set_hs, repn)->flags & HAS_CORRUPTED_HEADER;
+}
+
+/*
+ * replica_is_replica_healthy -- check if replica is unbroken and consistent
+ */
+int
+replica_is_replica_healthy(unsigned repn, struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u, set_hs %p", repn, set_hs);
+
+       int ret = !replica_is_replica_broken(repn, set_hs) &&
+                       replica_is_replica_consistent(repn, set_hs) &&
+                       !replica_has_bad_blocks(repn, set_hs);
+
+       LOG(4, "return %i", ret);
+
+       return ret;
+}
+
+/*
+ * replica_has_healthy_header -- (internal) check if replica has healthy headers
+ */
+static int
+replica_has_healthy_header(unsigned repn, struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u, set_hs %p", repn, set_hs);
+
+       int ret = !replica_is_replica_broken(repn, set_hs) &&
+                       replica_is_replica_consistent(repn, set_hs) &&
+                       !replica_has_corrupted_header(repn, set_hs);
+
+       LOG(4, "return %i", ret);
+
+       return ret;
+}
+
+/*
+ * replica_is_poolset_healthy -- check if all replicas in a poolset are not
+ *                               marked as broken nor inconsistent in the
+ *                               helping structure
+ */
+int
+replica_is_poolset_healthy(struct poolset_health_status *set_hs)
+{
+       LOG(3, "set_hs %p", set_hs);
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               if (!replica_is_replica_healthy(r, set_hs))
+                       return 0;
+       }
+       return 1;
+}
+
+/*
+ * replica_is_poolset_transformed -- check if the flag indicating a call from
+ *                                   pmempool_transform is on
+ */
+int
+replica_is_poolset_transformed(unsigned flags)
+{
+       return flags & IS_TRANSFORMED;
+}
+
+/*
+ * replica_find_unbroken_part_with_header -- find a part number in a given
+ * replica, which is not marked as broken in the helping structure and contains
+ * a pool header
+ */
+unsigned
+replica_find_unbroken_part(unsigned repn, struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u, set_hs %p", repn, set_hs);
+       for (unsigned p = 0; p < REP_HEALTH(set_hs, repn)->nhdrs; ++p) {
+               if (!replica_is_part_broken(repn, p, set_hs))
+                       return p;
+       }
+       return UNDEF_PART;
+}
+
+/*
+ * replica_find_healthy_replica -- find a replica which is a good source of data
+ */
+unsigned
+replica_find_healthy_replica(struct poolset_health_status *set_hs)
+{
+       LOG(3, "set_hs %p", set_hs);
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               if (replica_is_replica_healthy(r, set_hs)) {
+                       LOG(4, "return %i", r);
+                       return r;
+               }
+       }
+
+       LOG(4, "return %i", UNDEF_REPLICA);
+       return UNDEF_REPLICA;
+}
+
+/*
+ * replica_find_replica_healthy_header -- find a replica with a healthy header
+ */
+unsigned
+replica_find_replica_healthy_header(struct poolset_health_status *set_hs)
+{
+       LOG(3, "set_hs %p", set_hs);
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               if (replica_has_healthy_header(r, set_hs)) {
+                       LOG(4, "return %i", r);
+                       return r;
+               }
+       }
+
+       LOG(4, "return %i", UNDEF_REPLICA);
+       return UNDEF_REPLICA;
+}
+
+/*
+ * replica_check_store_size -- (internal) store size from pool descriptor for
+ * replica
+ */
+static int
+replica_check_store_size(struct pool_set *set,
+       struct poolset_health_status *set_hs, unsigned repn)
+{
+       LOG(3, "set %p, set_hs %p, repn %u", set, set_hs, repn);
+       struct pool_replica *rep = set->replica[repn];
+       struct pmemobjpool pop;
+
+       if (rep->remote) {
+               memcpy(&pop.hdr, rep->part[0].hdr, sizeof(pop.hdr));
+               void *descr = (void *)((uintptr_t)&pop + POOL_HDR_SIZE);
+               if (Rpmem_read(rep->remote->rpp, descr, POOL_HDR_SIZE,
+                       sizeof(pop) - POOL_HDR_SIZE, 0)) {
+                       return -1;
+               }
+       } else {
+               /* round up map size to Mmap align size */
+               if (util_map_part(&rep->part[0], NULL,
+                   ALIGN_UP(sizeof(pop), rep->part[0].alignment),
+                   0, MAP_SHARED, 1)) {
+                       return -1;
+               }
+
+               memcpy(&pop, rep->part[0].addr, sizeof(pop));
+
+               util_unmap_part(&rep->part[0]);
+       }
+
+       void *dscp = (void *)((uintptr_t)&pop + sizeof(pop.hdr));
+
+       if (!util_checksum(dscp, OBJ_DSC_P_SIZE, &pop.checksum, 0,
+                       0)) {
+               set_hs->replica[repn]->flags |= IS_BROKEN;
+               return 0;
+       }
+
+       set_hs->replica[repn]->pool_size = pop.heap_offset + pop.heap_size;
+
+       return 0;
+}
+
+/*
+ * check_store_all_sizes -- (internal) store sizes from pool descriptor for all
+ * healthy replicas
+ */
+static int
+check_store_all_sizes(struct pool_set *set,
+       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (!replica_has_healthy_header(r, set_hs))
+                       continue;
+
+               if (replica_check_store_size(set, set_hs, r))
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * check_and_open_poolset_part_files -- (internal) for each part in a poolset
+ * check if the part files are accessible, and if not, mark it as broken
+ * in a helping structure; then open the part file
+ */
+static int
+check_and_open_poolset_part_files(struct pool_set *set,
+               struct poolset_health_status *set_hs, unsigned flags)
+{
+       LOG(3, "set %p, set_hs %p, flags %u", set, set_hs, flags);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+               if (rep->remote) {
+                       if (util_replica_open_remote(set, r, 0)) {
+                               LOG(1, "cannot open remote replica no %u", r);
+                               return -1;
+                       }
+
+                       unsigned nlanes = REMOTE_NLANES;
+                       int ret = util_poolset_remote_open(rep, r,
+                                       rep->repsize, 0,
+                                       rep->part[0].addr,
+                                       rep->resvsize, &nlanes);
+                       if (ret) {
+                               rep_hs->flags |= IS_BROKEN;
+                               LOG(1, "remote replica #%u marked as BROKEN",
+                                       r);
+                       }
+
+                       continue;
+               }
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = rep->part[p].path;
+                       enum file_type type = util_file_get_type(path);
+
+                       if (type < 0 || os_access(path, R_OK|W_OK) != 0) {
+                               LOG(1, "part file %s is not accessible", path);
+                               errno = 0;
+                               rep_hs->part[p].flags |= IS_BROKEN;
+                               if (is_dry_run(flags))
+                                       continue;
+                       }
+
+                       if (util_part_open(&rep->part[p], 0, 0)) {
+                               if (type == TYPE_DEVDAX) {
+                                       LOG(1,
+                                               "opening part on Device DAX %s failed",
+                                               path);
+                                       return -1;
+                               }
+                               LOG(1, "opening part %s failed", path);
+                               errno = 0;
+                               rep_hs->part[p].flags |= IS_BROKEN;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * map_all_unbroken_headers -- (internal) map all headers in a poolset,
+ *                             skipping those marked as broken in a helping
+ *                             structure
+ */
+static int
+map_all_unbroken_headers(struct pool_set *set,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nhdrs; ++p) {
+                       /* skip broken parts */
+                       if (replica_is_part_broken(r, p, set_hs))
+                               continue;
+
+                       LOG(4, "mapping header for part %u, replica %u", p, r);
+                       if (util_map_hdr(&rep->part[p], MAP_SHARED, 0) != 0) {
+                               LOG(1, "header mapping failed - part #%d", p);
+                               rep_hs->part[p].flags |= IS_BROKEN;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * unmap_all_headers -- (internal) unmap all headers in a poolset
+ */
+static int
+unmap_all_headers(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               util_replica_close(set, r);
+
+               if (rep->remote && rep->remote->rpp) {
+                       Rpmem_close(rep->remote->rpp);
+                       rep->remote->rpp = NULL;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * check_checksums_and_signatures -- (internal) check if checksums
+ *                                   and signatures are correct for parts
+ *                                   in a given replica
+ */
+static int
+check_checksums_and_signatures(struct pool_set *set,
+                               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               struct replica_health_status *rep_hs = REP_HEALTH(set_hs, r);
+
+               /*
+                * Checksums and signatures of remote replicas are checked
+                * during opening them on the remote side by the rpmem daemon.
+                * The local version of remote headers does not contain
+                * such data.
+                */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nhdrs; ++p) {
+
+                       /* skip broken parts */
+                       if (replica_is_part_broken(r, p, set_hs))
+                               continue;
+
+                       /* check part's checksum */
+                       LOG(4, "checking checksum for part %u, replica %u",
+                                       p, r);
+
+                       struct pool_hdr *hdr = HDR(rep, p);
+
+                       if (!util_checksum(hdr, sizeof(*hdr), &hdr->checksum, 0,
+                                       POOL_HDR_CSUM_END_OFF(hdr))) {
+                               ERR("invalid checksum of pool header");
+                               rep_hs->part[p].flags |= IS_BROKEN;
+                       } else if (util_is_zeroed(hdr, sizeof(*hdr))) {
+                                       rep_hs->part[p].flags |= IS_BROKEN;
+                       }
+
+                       enum pool_type type = pool_hdr_get_type(hdr);
+                       if (type == POOL_TYPE_UNKNOWN) {
+                               ERR("invalid signature");
+                               rep_hs->part[p].flags |= IS_BROKEN;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * replica_badblocks_recovery_file_save -- save bad blocks in the bad blocks
+ *                                         recovery file before clearing them
+ */
+static int
+replica_badblocks_recovery_file_save(struct part_health_status *part_hs)
+{
+       LOG(3, "part_health_status %p", part_hs);
+
+       ASSERTeq(part_hs->recovery_file_exists, 1);
+       ASSERTne(part_hs->recovery_file_name, NULL);
+
+       struct badblocks *bbs = &part_hs->bbs;
+       char *path = part_hs->recovery_file_name;
+       int ret = -1;
+
+       int fd = os_open(path, O_WRONLY | O_TRUNC);
+       if (fd < 0) {
+               ERR("!opening bad block recovery file failed -- '%s'", path);
+               return -1;
+       }
+
+       FILE *recovery_file_name = os_fdopen(fd, "w");
+       if (recovery_file_name == NULL) {
+               ERR(
+                       "!opening a file stream for bad block recovery file failed -- '%s'",
+                       path);
+               os_close(fd);
+               return -1;
+       }
+
+       /* save bad blocks */
+       for (unsigned i = 0; i < bbs->bb_cnt; i++) {
+               ASSERT(bbs->bbv[i].length != 0);
+               fprintf(recovery_file_name, "%zu %zu\n",
+                       bbs->bbv[i].offset, bbs->bbv[i].length);
+       }
+
+       if (fflush(recovery_file_name) == EOF) {
+               ERR("!flushing bad block recovery file failed -- '%s'", path);
+               goto exit_error;
+       }
+
+       if (os_fsync(fd) < 0) {
+               ERR("!syncing bad block recovery file failed -- '%s'", path);
+               goto exit_error;
+       }
+
+       /* save the finish flag */
+       fprintf(recovery_file_name, "0 0\n");
+
+       if (fflush(recovery_file_name) == EOF) {
+               ERR("!flushing bad block recovery file failed -- '%s'", path);
+               goto exit_error;
+       }
+
+       if (os_fsync(fd) < 0) {
+               ERR("!syncing bad block recovery file failed -- '%s'", path);
+               goto exit_error;
+       }
+
+       LOG(3, "bad blocks saved in the recovery file -- '%s'", path);
+       ret = 0;
+
+exit_error:
+       os_fclose(recovery_file_name);
+
+       return ret;
+}
+
+/*
+ * replica_part_badblocks_recovery_file_read -- read bad blocks
+ *                                             from the bad block recovery file
+ *                                             for the current part
+ */
+static int
+replica_part_badblocks_recovery_file_read(struct part_health_status *part_hs)
+{
+       LOG(3, "part_health_status %p", part_hs);
+
+       ASSERT(part_hs->recovery_file_exists);
+       ASSERTne(part_hs->recovery_file_name, NULL);
+
+       VEC(bbsvec, struct bad_block) bbv = VEC_INITIALIZER;
+       char *path = part_hs->recovery_file_name;
+       struct bad_block bb;
+       int ret = -1;
+
+       FILE *recovery_file = os_fopen(path, "r");
+       if (!recovery_file) {
+               ERR("!opening the recovery file for reading failed -- '%s'",
+                       path);
+               return -1;
+       }
+
+       unsigned long long min_offset = 0; /* minimum possible offset */
+
+       do {
+               if (fscanf(recovery_file, "%zu %zu\n",
+                               &bb.offset, &bb.length) < 2) {
+                       LOG(1, "incomplete bad block recovery file -- '%s'",
+                               path);
+                       ret = 1;
+                       goto error_exit;
+               }
+
+               if (bb.offset == 0 && bb.length == 0) {
+                       /* finish_flag */
+                       break;
+               }
+
+               /* check if bad blocks build an increasing sequence */
+               if (bb.offset < min_offset) {
+                       ERR(
+                               "wrong format of bad block recovery file (bad blocks are not sorted by the offset in ascending order) -- '%s'",
+                               path);
+                       errno = EINVAL;
+                       ret = -1;
+                       goto error_exit;
+               }
+
+               /* update the minimum possible offset */
+               min_offset = bb.offset + bb.length;
+
+               bb.nhealthy = NO_HEALTHY_REPLICA; /* unknown healthy replica */
+
+               /* add the new bad block to the vector */
+               if (VEC_PUSH_BACK(&bbv, bb))
+                       goto error_exit;
+       } while (1);
+
+       part_hs->bbs.bbv = VEC_ARR(&bbv);
+       part_hs->bbs.bb_cnt = (unsigned)VEC_SIZE(&bbv);
+
+       os_fclose(recovery_file);
+
+       LOG(1, "bad blocks read from the recovery file -- '%s'", path);
+
+       return 0;
+
+error_exit:
+       VEC_DELETE(&bbv);
+       os_fclose(recovery_file);
+       return ret;
+}
+
+/* status returned by the replica_badblocks_recovery_files_check() function */
+enum badblocks_recovery_files_status {
+       RECOVERY_FILES_ERROR = -1,
+       RECOVERY_FILES_DO_NOT_EXIST = 0,
+       RECOVERY_FILES_EXIST_ALL = 1,
+       RECOVERY_FILES_NOT_ALL_EXIST = 2
+};
+
+/*
+ * replica_badblocks_recovery_files_check -- (internal) check if bad blocks
+ *                                           recovery files exist
+ */
+static enum badblocks_recovery_files_status
+replica_badblocks_recovery_files_check(struct pool_set *set,
+                                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       int recovery_file_exists = 0;
+       int recovery_file_does_not_exist = 0;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               if (rep->remote) {
+                       /*
+                        * Bad blocks in remote replicas currently are fixed
+                        * during opening by removing and recreating
+                        * the whole remote replica.
+                        */
+                       continue;
+               }
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = PART(rep, p)->path;
+                       struct part_health_status *part_hs = &rep_hs->part[p];
+
+                       int exists = util_file_exists(path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (!exists) {
+                               /* part file does not exist - skip it */
+                               continue;
+                       }
+
+                       part_hs->recovery_file_name =
+                                       badblocks_recovery_file_alloc(set->path,
+                                                                       r, p);
+                       if (part_hs->recovery_file_name == NULL) {
+                               LOG(1,
+                                       "allocating name of bad block recovery file failed");
+                               return RECOVERY_FILES_ERROR;
+                       }
+
+                       exists = util_file_exists(part_hs->recovery_file_name);
+                       if (exists < 0)
+                               return -1;
+
+                       part_hs->recovery_file_exists = exists;
+
+                       if (part_hs->recovery_file_exists) {
+                               LOG(3, "bad block recovery file exists: %s",
+                                       part_hs->recovery_file_name);
+
+                               recovery_file_exists = 1;
+
+                       } else {
+                               LOG(3,
+                                       "bad block recovery file does not exist: %s",
+                                       part_hs->recovery_file_name);
+
+                               recovery_file_does_not_exist = 1;
+                       }
+               }
+       }
+
+       if (recovery_file_exists) {
+               if (recovery_file_does_not_exist) {
+                       LOG(4, "return RECOVERY_FILES_NOT_ALL_EXIST");
+                       return RECOVERY_FILES_NOT_ALL_EXIST;
+               } else {
+                       LOG(4, "return RECOVERY_FILES_EXIST_ALL");
+                       return RECOVERY_FILES_EXIST_ALL;
+               }
+       }
+
+       LOG(4, "return RECOVERY_FILES_DO_NOT_EXIST");
+       return RECOVERY_FILES_DO_NOT_EXIST;
+}
+
+/*
+ * replica_badblocks_recovery_files_read -- (internal) read bad blocks from all
+ *                                     bad block recovery files for all parts
+ */
+static int
+replica_badblocks_recovery_files_read(struct pool_set *set,
+                                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       int ret;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = PART(rep, p)->path;
+                       struct part_health_status *part_hs = &rep_hs->part[p];
+
+                       int exists = util_file_exists(path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (!exists) {
+                               /* the part does not exist */
+                               continue;
+                       }
+
+                       LOG(1,
+                               "reading bad blocks from the recovery file -- '%s'",
+                               part_hs->recovery_file_name);
+
+                       ret = replica_part_badblocks_recovery_file_read(
+                                                               part_hs);
+                       if (ret < 0) {
+                               LOG(1,
+                                       "reading bad blocks from the recovery file failed -- '%s'",
+                                       part_hs->recovery_file_name);
+                               return -1;
+                       }
+
+                       if (ret > 0) {
+                               LOG(1,
+                                       "incomplete bad block recovery file detected -- '%s'",
+                                       part_hs->recovery_file_name);
+                               return 1;
+                       }
+
+                       if (part_hs->bbs.bb_cnt) {
+                               LOG(3, "part %u contains %u bad blocks -- '%s'",
+                                       p, part_hs->bbs.bb_cnt, path);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * replica_badblocks_recovery_files_create_empty -- (internal) create one empty
+ *                                                  bad block recovery file
+ *                                                  for each part file
+ */
+static int
+replica_badblocks_recovery_files_create_empty(struct pool_set *set,
+                                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       struct part_health_status *part_hs;
+       const char *path;
+       int fd;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       part_hs = &rep_hs->part[p];
+                       path = PART(rep, p)->path;
+
+                       if (!part_hs->recovery_file_name)
+                               continue;
+
+                       fd = os_open(part_hs->recovery_file_name,
+                                       O_RDWR | O_CREAT | O_EXCL,
+                                       0600);
+                       if (fd < 0) {
+                               ERR(
+                                       "!creating an empty bad block recovery file failed -- '%s' (part file '%s')",
+                                       part_hs->recovery_file_name, path);
+                               return -1;
+                       }
+
+                       os_close(fd);
+
+                       char *file_name = Strdup(part_hs->recovery_file_name);
+                       if (file_name == NULL) {
+                               ERR("!Strdup");
+                               return -1;
+                       }
+
+                       char *dir_name = dirname(file_name);
+
+                       /* fsync the file's directory */
+                       if (os_fsync_dir(dir_name) < 0) {
+                               ERR(
+                                       "!syncing the directory of the bad block recovery file failed -- '%s' (part file '%s')",
+                                       dir_name, path);
+                               Free(file_name);
+                               return -1;
+                       }
+
+                       Free(file_name);
+
+                       part_hs->recovery_file_exists = 1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * replica_badblocks_recovery_files_save -- (internal) save bad blocks
+ *                                     in the bad block recovery files
+ */
+static int
+replica_badblocks_recovery_files_save(struct pool_set *set,
+                                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       struct part_health_status *part_hs = &rep_hs->part[p];
+
+                       if (!part_hs->recovery_file_name)
+                               continue;
+
+                       int ret = replica_badblocks_recovery_file_save(part_hs);
+                       if (ret < 0) {
+                               LOG(1,
+                                       "opening bad block recovery file failed -- '%s'",
+                                       part_hs->recovery_file_name);
+                               return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * replica_badblocks_get -- (internal) get all bad blocks and save them
+ *                          in part_hs->bbs structures.
+ *                          Returns 1 if any bad block was found, 0 otherwise.
+ */
+static int
+replica_badblocks_get(struct pool_set *set,
+                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       int bad_blocks_found = 0;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = PART(rep, p)->path;
+                       struct part_health_status *part_hs = &rep_hs->part[p];
+
+                       int exists = util_file_exists(path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (!exists)
+                               continue;
+
+                       int ret = badblocks_get(path, &part_hs->bbs);
+                       if (ret < 0) {
+                               ERR(
+                                       "!checking the pool part for bad blocks failed -- '%s'",
+                                       path);
+                               return -1;
+                       }
+
+                       if (part_hs->bbs.bb_cnt) {
+                               LOG(3, "part %u contains %u bad blocks -- '%s'",
+                                       p, part_hs->bbs.bb_cnt, path);
+
+                               bad_blocks_found = 1;
+                       }
+               }
+       }
+
+       return bad_blocks_found;
+}
+
+/*
+ * check_badblocks_in_header -- (internal) check if bad blocks corrupted
+ *                              the header
+ */
+static int
+check_badblocks_in_header(struct badblocks *bbs)
+{
+       for (unsigned b = 0; b < bbs->bb_cnt; b++)
+               if (bbs->bbv[b].offset < POOL_HDR_SIZE)
+                       return 1;
+
+       return 0;
+}
+
+/*
+ * replica_badblocks_clear -- (internal) clear all bad blocks
+ */
+static int
+replica_badblocks_clear(struct pool_set *set,
+                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       int ret;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               /* XXX: not supported yet */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       const char *path = PART(rep, p)->path;
+                       struct part_health_status *part_hs = &rep_hs->part[p];
+
+                       int exists = util_file_exists(path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (!exists) {
+                               /* the part does not exist */
+                               continue;
+                       }
+
+                       if (part_hs->bbs.bb_cnt == 0) {
+                               /* no bad blocks found */
+                               continue;
+                       }
+
+                       /* bad blocks were found */
+                       part_hs->flags |= HAS_BAD_BLOCKS;
+                       rep_hs->flags |= HAS_BAD_BLOCKS;
+
+                       if (check_badblocks_in_header(&part_hs->bbs)) {
+                               part_hs->flags |= HAS_CORRUPTED_HEADER;
+                               if (p == 0)
+                                       rep_hs->flags |= HAS_CORRUPTED_HEADER;
+                       }
+
+                       ret = badblocks_clear(path, &part_hs->bbs);
+                       if (ret < 0) {
+                               LOG(1,
+                                       "clearing bad blocks in replica failed -- '%s'",
+                                       path);
+                               return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * replica_badblocks_check_or_clear -- (internal) check if replica contains
+ *                                     bad blocks when in dry run
+ *                                     or clear them otherwise
+ */
+static int
+replica_badblocks_check_or_clear(struct pool_set *set,
+                               struct poolset_health_status *set_hs,
+                               int dry_run, int called_from_sync,
+                               int check_bad_blocks, int fix_bad_blocks)
+{
+       LOG(3,
+               "set %p, set_hs %p, dry_run %i, called_from_sync %i, "
+               "check_bad_blocks %i, fix_bad_blocks %i",
+               set, set_hs, dry_run, called_from_sync,
+               check_bad_blocks, fix_bad_blocks);
+
+#define ERR_MSG_BB \
+       "       please read the manual first and use this option\n"\
+       "       ONLY IF you are sure that you know what you are doing"
+
+       enum badblocks_recovery_files_status status;
+       int ret;
+
+       /* check all bad block recovery files */
+       status = replica_badblocks_recovery_files_check(set, set_hs);
+
+       /* phase #1 - error handling */
+       switch (status) {
+       case RECOVERY_FILES_ERROR:
+               LOG(1, "checking bad block recovery files failed");
+               return -1;
+
+       case RECOVERY_FILES_EXIST_ALL:
+       case RECOVERY_FILES_NOT_ALL_EXIST:
+               if (!called_from_sync) {
+                       ERR(
+                               "error: a bad block recovery file exists, run 'pmempool sync --bad-blocks' to fix bad blocks first");
+                       return -1;
+               }
+
+               if (!fix_bad_blocks) {
+                       ERR(
+                               "error: a bad block recovery file exists, but the '--bad-blocks' option is not set\n"
+                               ERR_MSG_BB);
+                       return -1;
+               }
+               break;
+
+       default:
+               break;
+       };
+
+       /*
+        * The pool is checked for bad blocks only if:
+        * 1) compat feature POOL_FEAT_CHECK_BAD_BLOCKS is set
+        *    OR:
+        * 2) the '--bad-blocks' option is set
+        *
+        * Bad blocks are cleared and fixed only if:
+        * - the '--bad-blocks' option is set
+        */
+       if (!fix_bad_blocks && !check_bad_blocks) {
+               LOG(3, "skipping bad blocks checking");
+               return 0;
+       }
+
+       /* phase #2 - reading recovery files */
+       switch (status) {
+       case RECOVERY_FILES_EXIST_ALL:
+               /* read all bad block recovery files */
+               ret = replica_badblocks_recovery_files_read(set, set_hs);
+               if (ret < 0) {
+                       LOG(1, "checking bad block recovery files failed");
+                       return -1;
+               }
+
+               if (ret > 0) {
+                       /* incomplete bad block recovery file was detected */
+
+                       LOG(1,
+                               "warning: incomplete bad block recovery file detected\n"
+                               "         - all recovery files will be removed");
+
+                       /* changing status to RECOVERY_FILES_NOT_ALL_EXIST */
+                       status = RECOVERY_FILES_NOT_ALL_EXIST;
+               }
+               break;
+
+       case RECOVERY_FILES_NOT_ALL_EXIST:
+               LOG(1,
+                       "warning: one of bad block recovery files does not exist\n"
+                       "         - all recovery files will be removed");
+               break;
+
+       default:
+               break;
+       };
+
+       if (status == RECOVERY_FILES_NOT_ALL_EXIST) {
+               /*
+                * At least one of bad block recovery files does not exist,
+                * or an incomplete bad block recovery file was detected,
+                * so all recovery files have to be removed.
+                */
+
+               if (!dry_run) {
+                       LOG(1, "removing all bad block recovery files...");
+                       ret = replica_remove_all_recovery_files(set_hs);
+                       if (ret < 0) {
+                               LOG(1,
+                                       "removing bad block recovery files failed");
+                               return -1;
+                       }
+               } else {
+                       LOG(1, "all bad block recovery files would be removed");
+               }
+
+               /* changing status to RECOVERY_FILES_DO_NOT_EXIST */
+               status = RECOVERY_FILES_DO_NOT_EXIST;
+       }
+
+       if (status == RECOVERY_FILES_DO_NOT_EXIST) {
+               /*
+                * There are no bad block recovery files,
+                * so let's check bad blocks.
+                */
+
+               int bad_blocks_found = replica_badblocks_get(set, set_hs);
+               if (bad_blocks_found < 0) {
+                       if (errno == ENOTSUP) {
+                               LOG(1, BB_NOT_SUPP);
+                               return -1;
+                       }
+
+                       LOG(1, "checking bad blocks failed");
+                       return -1;
+               }
+
+               if (!bad_blocks_found) {
+                       LOG(4, "no bad blocks found");
+                       return 0;
+               }
+
+               /* bad blocks were found */
+
+               if (!called_from_sync) {
+                       ERR(
+                               "error: bad blocks found, run 'pmempool sync --bad-blocks' to fix bad blocks first");
+                       return -1;
+               }
+
+               if (!fix_bad_blocks) {
+                       ERR(
+                               "error: bad blocks found, but the '--bad-blocks' option is not set\n"
+                               ERR_MSG_BB);
+                       return -1;
+               }
+
+               if (dry_run) {
+                       /* dry-run - do nothing */
+                       LOG(1, "warning: bad blocks were found");
+                       return 0;
+               }
+
+               /* create one empty recovery file for each part file */
+               ret = replica_badblocks_recovery_files_create_empty(set,
+                                                               set_hs);
+               if (ret < 0) {
+                       LOG(1,
+                               "creating empty bad block recovery files failed");
+                       return -1;
+               }
+
+               /* save bad blocks in recovery files */
+               ret = replica_badblocks_recovery_files_save(set, set_hs);
+               if (ret < 0) {
+                       LOG(1, "saving bad block recovery files failed");
+                       return -1;
+               }
+       }
+
+       if (dry_run) {
+               /* dry-run - do nothing */
+               LOG(1, "bad blocks would be cleared");
+               return 0;
+       }
+
+       ret = replica_badblocks_clear(set, set_hs);
+       if (ret < 0) {
+               ERR("clearing bad blocks failed");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * check_shutdown_state -- (internal) check if replica has
+ *                        healthy shutdown_state
+ */
+static int
+check_shutdown_state(struct pool_set *set,
+       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {\
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+               struct pool_hdr *hdrp = HDR(rep, 0);
+
+               if (rep->remote)
+                       continue;
+
+               if (hdrp == NULL) {
+                       /* cannot verify shutdown state */
+                       rep_hs->flags |= IS_BROKEN;
+                       continue;
+               }
+
+               struct shutdown_state curr_sds;
+               shutdown_state_init(&curr_sds, NULL);
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       if (PART(rep, p)->fd < 0)
+                               continue;
+
+                       if (shutdown_state_add_part(&curr_sds,
+                                       PART(rep, p)->fd, NULL)) {
+                               rep_hs->flags |= IS_BROKEN;
+                               break;
+                       }
+               }
+
+               if (rep_hs->flags & IS_BROKEN)
+                       continue;
+
+               /* make a copy of sds as we shouldn't modify a pool */
+               struct shutdown_state pool_sds = hdrp->sds;
+
+               if (shutdown_state_check(&curr_sds, &pool_sds, NULL))
+                       rep_hs->flags |= IS_BROKEN;
+
+       }
+       return 0;
+}
+
+/*
+ * check_uuids_between_parts -- (internal) check if uuids between adjacent
+ *                              parts are consistent for a given replica
+ */
+static int
+check_uuids_between_parts(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, set_hs %p", set, repn, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+
+       /* check poolset_uuid consistency between replica's parts */
+       LOG(4, "checking consistency of poolset uuid in replica %u", repn);
+       uuid_t poolset_uuid;
+       int uuid_stored = 0;
+       unsigned part_stored = UNDEF_PART;
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               if (!uuid_stored) {
+                       memcpy(poolset_uuid, HDR(rep, p)->poolset_uuid,
+                                       POOL_HDR_UUID_LEN);
+                       uuid_stored = 1;
+                       part_stored = p;
+                       continue;
+               }
+
+               if (uuidcmp(HDR(rep, p)->poolset_uuid, poolset_uuid)) {
+                       ERR(
+                               "different poolset uuids in parts from the same replica (repn %u, parts %u and %u) - cannot synchronize",
+                               repn, part_stored, p);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+
+       /* check if all uuids for adjacent replicas are the same across parts */
+       LOG(4, "checking consistency of adjacent replicas' uuids in replica %u",
+                       repn);
+       unsigned unbroken_p = UNDEF_PART;
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               if (unbroken_p == UNDEF_PART) {
+                       unbroken_p = p;
+                       continue;
+               }
+
+               struct pool_hdr *hdrp = HDR(rep, p);
+               int prev_differ = uuidcmp(HDR(rep, unbroken_p)->prev_repl_uuid,
+                               hdrp->prev_repl_uuid);
+               int next_differ = uuidcmp(HDR(rep, unbroken_p)->next_repl_uuid,
+                               hdrp->next_repl_uuid);
+
+               if (prev_differ || next_differ) {
+                       ERR(
+                               "different adjacent replica UUID between parts (repn %u, parts %u and %u) - cannot synchronize",
+                               repn, unbroken_p, p);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+
+       /* check parts linkage */
+       LOG(4, "checking parts linkage in replica %u", repn);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               struct pool_hdr *hdrp = HDR(rep, p);
+               struct pool_hdr *next_hdrp = HDRN(rep, p);
+               int next_is_broken = replica_is_part_broken(repn, p + 1,
+                               set_hs);
+
+               if (!next_is_broken) {
+                       int next_decoupled =
+                               uuidcmp(next_hdrp->prev_part_uuid,
+                                       hdrp->uuid) ||
+                               uuidcmp(hdrp->next_part_uuid, next_hdrp->uuid);
+                       if (next_decoupled) {
+                               ERR(
+                                       "two consecutive unbroken parts are not linked to each other (repn %u, parts %u and %u) - cannot synchronize",
+                                       repn, p, p + 1);
+                               errno = EINVAL;
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_replicas_consistency -- (internal) check if all uuids within each
+ *                               replica are consistent
+ */
+static int
+check_replicas_consistency(struct pool_set *set,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (check_uuids_between_parts(set, r, set_hs))
+                       return -1;
+       }
+       return 0;
+}
+
+/*
+ * check_replica_options -- (internal) check if options are consistent in the
+ *                          replica
+ */
+static int
+check_replica_options(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, set_hs %p", set, repn, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+       struct replica_health_status *rep_hs = REP_HEALTH(set_hs, repn);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               struct pool_hdr *hdr = HDR(rep, p);
+               if (((hdr->features.incompat & POOL_FEAT_SINGLEHDR) == 0) !=
+                               ((set->options & OPTION_SINGLEHDR) == 0)) {
+                       LOG(1,
+                               "improper options are set in part %u's header in replica %u",
+                               p, repn);
+                       rep_hs->part[p].flags |= IS_BROKEN;
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_options -- (internal) check if options are consistent in all replicas
+ */
+static int
+check_options(struct pool_set *set, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (check_replica_options(set, r, set_hs))
+                       return -1;
+       }
+       return 0;
+}
+
+/*
+ * check_replica_poolset_uuids - (internal) check if poolset_uuid fields are
+ *                               consistent among all parts of a replica;
+ *                               the replica is initially considered as
+ *                               consistent
+ */
+static int
+check_replica_poolset_uuids(struct pool_set *set, unsigned repn,
+               uuid_t poolset_uuid, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, poolset_uuid %p, set_hs %p", set, repn,
+                       poolset_uuid, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               if (uuidcmp(HDR(rep, p)->poolset_uuid, poolset_uuid)) {
+                       /*
+                        * two internally consistent replicas have
+                        * different poolset_uuid
+                        */
+                       return -1;
+               } else {
+                       /*
+                        * it is sufficient to check only one part
+                        * from internally consistent replica
+                        */
+                       break;
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_poolset_uuids -- (internal) check if poolset_uuid fields are consistent
+ *                        among all internally consistent replicas
+ */
+static int
+check_poolset_uuids(struct pool_set *set,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       /* find a replica with healthy header */
+       unsigned r_h = replica_find_replica_healthy_header(set_hs);
+       if (r_h == UNDEF_REPLICA) {
+               ERR("no healthy replica found");
+               return -1;
+       }
+
+       uuid_t poolset_uuid;
+       memcpy(poolset_uuid, HDR(REP(set, r_h), 0)->poolset_uuid,
+                       POOL_HDR_UUID_LEN);
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               /* skip inconsistent replicas */
+               if (!replica_is_replica_consistent(r, set_hs) || r == r_h)
+                       continue;
+
+               if (check_replica_poolset_uuids(set, r, poolset_uuid, set_hs)) {
+                       ERR(
+                               "inconsistent poolset uuids between replicas %u and %u - cannot synchronize",
+                               r_h, r);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * get_replica_uuid -- (internal) get replica uuid
+ */
+static int
+get_replica_uuid(struct pool_replica *rep, unsigned repn,
+               struct poolset_health_status *set_hs, uuid_t **uuidpp)
+{
+       unsigned nhdrs = rep->nhdrs;
+       if (!replica_is_part_broken(repn, 0, set_hs)) {
+               /* the first part is not broken */
+               *uuidpp = &HDR(rep, 0)->uuid;
+               return 0;
+       } else if (nhdrs > 1 && !replica_is_part_broken(repn, 1, set_hs)) {
+               /* the second part is not broken */
+               *uuidpp = &HDR(rep, 1)->prev_part_uuid;
+               return 0;
+       } else if (nhdrs > 1 &&
+                       !replica_is_part_broken(repn, nhdrs - 1, set_hs)) {
+               /* the last part is not broken */
+               *uuidpp = &HDR(rep, nhdrs - 1)->next_part_uuid;
+               return 0;
+       } else {
+               /* cannot get replica uuid */
+               return -1;
+       }
+}
+
+/*
+ * check_uuids_between_replicas -- (internal) check if uuids between internally
+ *                                 consistent adjacent replicas are consistent
+ */
+static int
+check_uuids_between_replicas(struct pool_set *set,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               /* skip comparing inconsistent pairs of replicas */
+               if (!replica_is_replica_consistent(r, set_hs) ||
+                               !replica_is_replica_consistent(r + 1, set_hs))
+                       continue;
+
+               struct pool_replica *rep = REP(set, r);
+               struct pool_replica *rep_n = REPN(set, r);
+
+               /* get uuids of the two adjacent replicas */
+               uuid_t *rep_uuidp = NULL;
+               uuid_t *rep_n_uuidp = NULL;
+               unsigned r_n = REPN_HEALTHidx(set_hs, r);
+               if (get_replica_uuid(rep, r, set_hs, &rep_uuidp))
+                       LOG(2, "cannot get replica uuid, replica %u", r);
+               if (get_replica_uuid(rep_n, r_n, set_hs, &rep_n_uuidp))
+                       LOG(2, "cannot get replica uuid, replica %u", r_n);
+
+               /*
+                * check if replica uuids are consistent between two adjacent
+                * replicas
+                */
+               unsigned p = replica_find_unbroken_part(r, set_hs);
+               unsigned p_n = replica_find_unbroken_part(r_n, set_hs);
+               if (p_n != UNDEF_PART && rep_uuidp != NULL &&
+                               uuidcmp(*rep_uuidp,
+                                       HDR(rep_n, p_n)->prev_repl_uuid)) {
+                       ERR(
+                               "inconsistent replica uuids between replicas %u and %u",
+                               r, r_n);
+                       return -1;
+               }
+               if (p != UNDEF_PART && rep_n_uuidp != NULL &&
+                               uuidcmp(*rep_n_uuidp,
+                                       HDR(rep, p)->next_repl_uuid)) {
+                       ERR(
+                               "inconsistent replica uuids between replicas %u and %u",
+                               r, r_n);
+                       return -1;
+               }
+
+               /*
+                * check if replica uuids on borders of a broken replica are
+                * consistent
+                */
+               unsigned r_nn = REPN_HEALTHidx(set_hs, r_n);
+               if (set->nreplicas > 1 && p != UNDEF_PART &&
+                               replica_is_replica_broken(r_n, set_hs) &&
+                               replica_is_replica_consistent(r_nn, set_hs)) {
+                       unsigned p_nn =
+                               replica_find_unbroken_part(r_nn, set_hs);
+                       if (p_nn == UNDEF_PART) {
+                               LOG(2,
+                                       "cannot compare uuids on borders of replica %u",
+                                       r);
+                               continue;
+                       }
+                       struct pool_replica *rep_nn = REP(set, r_nn);
+                       if (uuidcmp(HDR(rep, p)->next_repl_uuid,
+                                       HDR(rep_nn, p_nn)->prev_repl_uuid)) {
+                               ERR(
+                                       "inconsistent replica uuids on borders of replica %u",
+                                       r);
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_replica_cycles -- (internal) check if healthy replicas form cycles
+ *     shorter than the number of all replicas
+ */
+static int
+check_replica_cycles(struct pool_set *set,
+       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       unsigned first_healthy;
+       unsigned count_healthy = 0;
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (!replica_is_replica_healthy(r, set_hs)) {
+                       count_healthy = 0;
+                       continue;
+               }
+
+               if (count_healthy == 0)
+                       first_healthy = r;
+
+               ++count_healthy;
+               struct pool_hdr *hdrh =
+                       PART(REP(set, first_healthy), 0)->hdr;
+               struct pool_hdr *hdr = PART(REP(set, r), 0)->hdr;
+               if (uuidcmp(hdrh->uuid, hdr->next_repl_uuid) == 0 &&
+                       count_healthy < set->nreplicas) {
+                       /*
+                        * Healthy replicas form a cycle shorter than
+                        * the number of all replicas; for the user it
+                        * means that:
+                        */
+                       ERR(
+                               "alien replica found (probably coming from a different poolset)");
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_replica_sizes -- (internal) check if all replicas are large
+ *     enough to hold data from a healthy replica
+ */
+static int
+check_replica_sizes(struct pool_set *set, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       ssize_t pool_size = -1;
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               /* skip broken replicas */
+               if (!replica_is_replica_healthy(r, set_hs))
+                       continue;
+
+               /* get the size of a pool in the replica */
+               ssize_t replica_pool_size;
+               if (REP(set, r)->remote)
+                       /* XXX: no way to get the size of a remote pool yet */
+                       replica_pool_size = (ssize_t)set->poolsize;
+               else
+                       replica_pool_size = replica_get_pool_size(set, r);
+
+               if (replica_pool_size < 0) {
+                       LOG(1, "getting pool size from replica %u failed", r);
+                       set_hs->replica[r]->flags |= IS_BROKEN;
+                       continue;
+               }
+
+               /* check if the pool is bigger than minimum size */
+               enum pool_type type = pool_hdr_get_type(HDR(REP(set, r), 0));
+               if ((size_t)replica_pool_size < pool_get_min_size(type)) {
+                       LOG(1,
+                               "pool size from replica %u is smaller than the minimum size allowed for the pool",
+                               r);
+                       set_hs->replica[r]->flags |= IS_BROKEN;
+                       continue;
+               }
+
+               /* check if each replica is big enough to hold the pool data */
+               if (set->poolsize < (size_t)replica_pool_size) {
+                       ERR(
+                               "some replicas are too small to hold synchronized data");
+                       return -1;
+               }
+
+               if (pool_size < 0) {
+                       pool_size = replica_pool_size;
+                       continue;
+               }
+
+               /* check if pools in all healthy replicas are of equal size */
+               if (pool_size != replica_pool_size) {
+                       ERR("pool sizes from different replicas differ");
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * replica_read_features -- (internal) read features from the header
+ */
+static int
+replica_read_features(struct pool_set *set,
+                       struct poolset_health_status *set_hs,
+                       features_t *features)
+{
+       LOG(3, "set %p set_hs %p features %p", set, set_hs, features);
+
+       ASSERTne(features, NULL);
+
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               if (rep->remote) {
+                       if (rep_hs->flags & IS_BROKEN)
+                               continue;
+
+                       struct pool_hdr *hdrp = rep->part[0].hdr;
+                       memcpy(features, &hdrp->features, sizeof(*features));
+
+                       return 0;
+               }
+
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       struct pool_set_part *part = &rep->part[p];
+
+                       if (part->fd == -1)
+                               continue;
+
+                       if (util_map_hdr(part, MAP_SHARED, 0) != 0) {
+                               LOG(1, "header mapping failed");
+                               return -1;
+                       }
+
+                       struct pool_hdr *hdrp = part->hdr;
+                       memcpy(features, &hdrp->features, sizeof(*features));
+
+                       util_unmap_hdr(part);
+
+                       return 0;
+               }
+       }
+
+       /* no healthy replica/part found */
+       return -1;
+}
+
+/*
+ * replica_check_poolset_health -- check if a given poolset can be considered as
+ *                         healthy, and store the status in a helping structure
+ */
+int
+replica_check_poolset_health(struct pool_set *set,
+               struct poolset_health_status **set_hsp,
+               int called_from_sync, unsigned flags)
+{
+       LOG(3, "set %p, set_hsp %p, called_from_sync %i, flags %u",
+               set, set_hsp, called_from_sync, flags);
+
+       if (replica_create_poolset_health_status(set, set_hsp)) {
+               LOG(1, "creating poolset health status failed");
+               return -1;
+       }
+
+       struct poolset_health_status *set_hs = *set_hsp;
+
+       /* check if part files exist and are accessible */
+       if (check_and_open_poolset_part_files(set, set_hs, flags)) {
+               LOG(1, "poolset part files check failed");
+               goto err;
+       }
+
+       features_t features;
+       int check_bad_blks;
+       int fix_bad_blks = called_from_sync && fix_bad_blocks(flags);
+
+       if (fix_bad_blks) {
+               /*
+                * We will fix bad blocks, so we cannot read features here,
+                * because reading could fail, because of bad blocks.
+                * We will read features after having bad blocks fixed.
+                *
+                * Fixing bad blocks implies checking bad blocks.
+                */
+               check_bad_blks = 1;
+       } else {
+               /*
+                * We will not fix bad blocks, so we have to read features here.
+                */
+               if (replica_read_features(set, set_hs, &features)) {
+                       LOG(1, "reading features failed");
+                       goto err;
+               }
+               check_bad_blks = features.compat & POOL_FEAT_CHECK_BAD_BLOCKS;
+       }
+
+       /* check for bad blocks when in dry run or clear them otherwise */
+       if (replica_badblocks_check_or_clear(set, set_hs, is_dry_run(flags),
+                       called_from_sync, check_bad_blks, fix_bad_blks)) {
+               LOG(1, "replica bad_blocks check failed");
+               goto err;
+       }
+
+       /* read features after fixing bad blocks */
+       if (fix_bad_blks && replica_read_features(set, set_hs, &features)) {
+               LOG(1, "reading features failed");
+               goto err;
+       }
+
+       /* set ignore_sds flag basing on features read from the header */
+       set->ignore_sds = !(features.incompat & POOL_FEAT_SDS);
+
+       /* map all headers */
+       map_all_unbroken_headers(set, set_hs);
+
+       /*
+        * Check if checksums and signatures are correct for all parts
+        * in all replicas.
+        */
+       check_checksums_and_signatures(set, set_hs);
+
+       /* check if option flags are consistent */
+       if (check_options(set, set_hs)) {
+               LOG(1, "flags check failed");
+               goto err;
+       }
+
+       if (!set->ignore_sds && check_shutdown_state(set, set_hs)) {
+               LOG(1, "replica shutdown_state check failed");
+               goto err;
+       }
+
+       /* check if uuids in parts across each replica are consistent */
+       if (check_replicas_consistency(set, set_hs)) {
+               LOG(1, "replica consistency check failed");
+               goto err;
+       }
+
+       /* check poolset_uuid values between replicas */
+       if (check_poolset_uuids(set, set_hs)) {
+               LOG(1, "poolset uuids check failed");
+               goto err;
+       }
+
+       /* check if uuids for adjacent replicas are consistent */
+       if (check_uuids_between_replicas(set, set_hs)) {
+               LOG(1, "replica uuids check failed");
+               goto err;
+       }
+
+       /* check if healthy replicas make up another poolset */
+       if (check_replica_cycles(set, set_hs)) {
+               LOG(1, "replica cycles check failed");
+               goto err;
+       }
+
+       /* check if replicas are large enough */
+       if (check_replica_sizes(set, set_hs)) {
+               LOG(1, "replica sizes check failed");
+               goto err;
+       }
+
+       if (check_store_all_sizes(set, set_hs)) {
+               LOG(1, "reading pool sizes failed");
+               goto err;
+       }
+
+       unmap_all_headers(set);
+       util_poolset_fdclose_always(set);
+       return 0;
+
+err:
+       errno = EINVAL;
+       unmap_all_headers(set);
+       util_poolset_fdclose_always(set);
+       replica_free_poolset_health_status(set_hs);
+       return -1;
+}
+
+/*
+ * replica_get_pool_size -- find the effective size (mapped) of a pool based
+ *                          on metadata from given replica
+ */
+ssize_t
+replica_get_pool_size(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_set_part *part = PART(REP(set, repn), 0);
+       int should_close_part = 0;
+       int should_unmap_part = 0;
+       if (part->fd == -1) {
+               if (util_part_open(part, 0, 0))
+                       return -1;
+
+               should_close_part = 1;
+       }
+
+       if (part->addr == NULL) {
+               if (util_map_part(part, NULL,
+                   ALIGN_UP(sizeof(PMEMobjpool), part->alignment), 0,
+                   MAP_SHARED, 1)) {
+                       util_part_fdclose(part);
+                       return -1;
+               }
+               should_unmap_part = 1;
+       }
+
+       PMEMobjpool *pop = (PMEMobjpool *)part->addr;
+       ssize_t ret = (ssize_t)(pop->heap_offset + pop->heap_size);
+
+       if (should_unmap_part)
+               util_unmap_part(part);
+       if (should_close_part)
+               util_part_fdclose(part);
+
+       return ret;
+}
+
+/*
+ * replica_check_part_sizes -- check if all parts are large enough
+ */
+int
+replica_check_part_sizes(struct pool_set *set, size_t min_size)
+{
+       LOG(3, "set %p, min_size %zu", set, min_size);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote != NULL)
+                       /* skip remote replicas */
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       if (PART(rep, p)->filesize < min_size) {
+                               ERR("replica %u, part %u: file is too small",
+                                               r, p);
+                               errno = EINVAL;
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * replica_check_local_part_dir -- check if directory for the part file
+ *                                 exists
+ */
+int
+replica_check_local_part_dir(struct pool_set *set, unsigned repn,
+               unsigned partn)
+{
+       LOG(3, "set %p, repn %u, partn %u", set, repn, partn);
+       char *path = Strdup(PART(REP(set, repn), partn)->path);
+       const char *dir = dirname(path);
+       os_stat_t sb;
+       if (os_stat(dir, &sb) != 0 || !(sb.st_mode & S_IFDIR)) {
+               ERR(
+                       "directory %s for part %u in replica %u does not exist or is not accessible",
+                       path, partn, repn);
+               Free(path);
+               return -1;
+       }
+       Free(path);
+       return 0;
+}
+
+/*
+ * replica_check_part_dirs -- (internal) check if directories for part files
+ *     exist
+ */
+int
+replica_check_part_dirs(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote != NULL)
+                       /* skip remote replicas */
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       if (replica_check_local_part_dir(set, r, p))
+                               return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * replica_open_replica_part_files -- open all part files for a replica
+ */
+int
+replica_open_replica_part_files(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_replica *rep = set->replica[repn];
+       for (unsigned p = 0; p < rep->nparts; ++p) {
+               /* skip already opened files */
+               if (rep->part[p].fd != -1)
+                       continue;
+
+               if (util_part_open(&rep->part[p], 0, 0)) {
+                       LOG(1, "part files open failed for replica %u, part %u",
+                                       repn, p);
+                       errno = EINVAL;
+                       goto err;
+               }
+       }
+       return 0;
+
+err:
+       util_replica_fdclose(set->replica[repn]);
+       return -1;
+}
+
+/*
+ * replica_open_poolset_part_files -- open all part files for a poolset
+ */
+int
+replica_open_poolset_part_files(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (set->replica[r]->remote)
+                       continue;
+               if (replica_open_replica_part_files(set, r)) {
+                       LOG(1, "opening replica %u, part files failed", r);
+                       goto err;
+               }
+       }
+
+       return 0;
+
+err:
+       util_poolset_fdclose_always(set);
+       return -1;
+}
+
+/*
+ * pmempool_syncU -- synchronize replicas within a poolset
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_syncU(const char *poolset, unsigned flags)
+{
+       LOG(3, "poolset %s, flags %u", poolset, flags);
+       ASSERTne(poolset, NULL);
+
+       /* check if poolset has correct signature */
+       if (util_is_poolset_file(poolset) != 1) {
+               ERR("file is not a poolset file");
+               goto err;
+       }
+
+       /* check if flags are supported */
+       if (check_flags_sync(flags)) {
+               ERR("unsupported flags");
+               errno = EINVAL;
+               goto err;
+       }
+
+       /* open poolset file */
+       int fd = util_file_open(poolset, NULL, 0, O_RDONLY);
+       if (fd < 0) {
+               ERR("cannot open a poolset file");
+               goto err;
+       }
+
+       /* fill up pool_set structure */
+       struct pool_set *set = NULL;
+       if (util_poolset_parse(&set, poolset, fd)) {
+               ERR("parsing input poolset failed");
+               goto err_close_file;
+       }
+
+       if (set->nreplicas == 1) {
+               ERR("no replica(s) found in the pool set");
+               errno = EINVAL;
+               goto err_close_file;
+       }
+
+       if (set->remote && util_remote_load()) {
+               ERR("remote replication not available");
+               errno = ENOTSUP;
+               goto err_close_file;
+       }
+
+       /* sync all replicas */
+       if (replica_sync(set, NULL, flags)) {
+               LOG(1, "synchronization failed");
+               goto err_close_all;
+       }
+
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+       os_close(fd);
+       return 0;
+
+err_close_all:
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+
+err_close_file:
+       os_close(fd);
+
+err:
+       if (errno == 0)
+               errno = EINVAL;
+
+       return -1;
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_sync -- synchronize replicas within a poolset
+ */
+int
+pmempool_sync(const char *poolset, unsigned flags)
+{
+       return pmempool_syncU(poolset, flags);
+}
+#else
+/*
+ * pmempool_syncW -- synchronize replicas within a poolset in widechar
+ */
+int
+pmempool_syncW(const wchar_t *poolset, unsigned flags)
+{
+       char *path = util_toUTF8(poolset);
+       if (path == NULL) {
+               ERR("Invalid poolest file path.");
+               return -1;
+       }
+
+       int ret = pmempool_syncU(path, flags);
+
+       util_free_UTF8(path);
+       return ret;
+}
+#endif
+
+/*
+ * pmempool_transformU -- alter poolset structure
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_transformU(const char *poolset_src,
+               const char *poolset_dst, unsigned flags)
+{
+       LOG(3, "poolset_src %s, poolset_dst %s, flags %u", poolset_src,
+                       poolset_dst, flags);
+       ASSERTne(poolset_src, NULL);
+       ASSERTne(poolset_dst, NULL);
+
+       /* check if the source poolset has correct signature */
+       if (util_is_poolset_file(poolset_src) != 1) {
+               ERR("source file is not a poolset file");
+               goto err;
+       }
+
+       /* check if the destination poolset has correct signature */
+       if (util_is_poolset_file(poolset_dst) != 1) {
+               ERR("destination file is not a poolset file");
+               goto err;
+       }
+
+       /* check if flags are supported */
+       if (check_flags_transform(flags)) {
+               ERR("unsupported flags");
+               errno = EINVAL;
+               goto err;
+       }
+
+       /* open the source poolset file */
+       int fd_in = util_file_open(poolset_src, NULL, 0, O_RDONLY);
+       if (fd_in < 0) {
+               ERR("cannot open source poolset file");
+               goto err;
+       }
+
+       /* parse the source poolset file */
+       struct pool_set *set_in = NULL;
+       if (util_poolset_parse(&set_in, poolset_src, fd_in)) {
+               ERR("parsing source poolset failed");
+               os_close(fd_in);
+               goto err;
+       }
+       os_close(fd_in);
+
+       /* open the destination poolset file */
+       int fd_out = util_file_open(poolset_dst, NULL, 0, O_RDONLY);
+       if (fd_out < 0) {
+               ERR("cannot open destination poolset file");
+               goto err;
+       }
+
+       enum del_parts_mode del = DO_NOT_DELETE_PARTS;
+
+       /* parse the destination poolset file */
+       struct pool_set *set_out = NULL;
+       if (util_poolset_parse(&set_out, poolset_dst, fd_out)) {
+               ERR("parsing destination poolset failed");
+               os_close(fd_out);
+               goto err_free_poolin;
+       }
+       os_close(fd_out);
+
+       /* check if the source poolset is of a correct type */
+       enum pool_type ptype = pool_set_type(set_in);
+       if (ptype != POOL_TYPE_OBJ) {
+               errno = EINVAL;
+               ERR("transform is not supported for given pool type: %s",
+                               pool_get_pool_type_str(ptype));
+               goto err_free_poolout;
+       }
+
+       /* load remote library if needed */
+       if (set_in->remote && util_remote_load()) {
+               ERR("remote replication not available");
+               goto err_free_poolout;
+       }
+       if (set_out->remote && util_remote_load()) {
+               ERR("remote replication not available");
+               goto err_free_poolout;
+       }
+
+       del = is_dry_run(flags) ? DO_NOT_DELETE_PARTS : DELETE_CREATED_PARTS;
+
+       /* transform poolset */
+       if (replica_transform(set_in, set_out, flags)) {
+               LOG(1, "transformation failed");
+               goto err_free_poolout;
+       }
+
+       util_poolset_close(set_in, DO_NOT_DELETE_PARTS);
+       util_poolset_close(set_out, DO_NOT_DELETE_PARTS);
+       return 0;
+
+err_free_poolout:
+       util_poolset_close(set_out, del);
+
+err_free_poolin:
+       util_poolset_close(set_in, DO_NOT_DELETE_PARTS);
+
+err:
+       if (errno == 0)
+               errno = EINVAL;
+
+       return -1;
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_transform -- alter poolset structure
+ */
+int
+pmempool_transform(const char *poolset_src,
+       const char *poolset_dst, unsigned flags)
+{
+       return pmempool_transformU(poolset_src, poolset_dst, flags);
+}
+#else
+/*
+ * pmempool_transformW -- alter poolset structure in widechar
+ */
+int
+pmempool_transformW(const wchar_t *poolset_src,
+       const wchar_t *poolset_dst, unsigned flags)
+{
+       char *path_src = util_toUTF8(poolset_src);
+       if (path_src == NULL) {
+               ERR("Invalid source poolest file path.");
+               return -1;
+       }
+
+       char *path_dst = util_toUTF8(poolset_dst);
+       if (path_dst == NULL) {
+               ERR("Invalid destination poolest file path.");
+               Free(path_src);
+               return -1;
+       }
+
+       int ret = pmempool_transformU(path_src, path_dst, flags);
+
+       util_free_UTF8(path_src);
+       util_free_UTF8(path_dst);
+       return ret;
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/replica.h b/ceph/src/pmdk/src/libpmempool/replica.h
new file mode 100644 (file)
index 0000000..06fa5b3
--- /dev/null
@@ -0,0 +1,211 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * replica.h -- module for synchronizing and transforming poolset
+ */
+#ifndef REPLICA_H
+#define REPLICA_H
+
+#include "libpmempool.h"
+#include "pool.h"
+#include "badblocks.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define UNDEF_REPLICA UINT_MAX
+#define UNDEF_PART UINT_MAX
+
+/*
+ * A part marked as broken does not exist or is damaged so that
+ * it cannot be opened and has to be recreated.
+ */
+#define IS_BROKEN              (1U << 0)
+
+/*
+ * A replica marked as inconsistent exists but has inconsistent metadata
+ * (e.g. inconsistent parts or replicas linkage)
+ */
+#define IS_INCONSISTENT                (1U << 1)
+
+/*
+ * A part or replica marked in this way has bad blocks inside.
+ */
+#define HAS_BAD_BLOCKS         (1U << 2)
+
+/*
+ * A part marked in this way has bad blocks in the header
+ */
+#define HAS_CORRUPTED_HEADER   (1U << 3)
+
+/*
+ * A flag which can be passed to sync_replica() to indicate that the function is
+ * called by pmempool_transform
+ */
+#define IS_TRANSFORMED         (1U << 10)
+
+/*
+ * Number of lanes utilized when working with remote replicas
+ */
+#define REMOTE_NLANES  1
+
+/*
+ * Helping structures for storing part's health status
+ */
+struct part_health_status {
+       unsigned flags;
+       struct badblocks bbs;           /* structure with bad blocks */
+       char *recovery_file_name;       /* name of bad block recovery file */
+       int recovery_file_exists;       /* bad block recovery file exists */
+};
+
+/*
+ * Helping structures for storing replica and poolset's health status
+ */
+struct replica_health_status {
+       unsigned nparts;
+       unsigned nhdrs;
+       /* a flag for the replica */
+       unsigned flags;
+       /* effective size of a pool, valid only for healthy replica */
+       size_t pool_size;
+       /* flags for each part */
+       struct part_health_status part[];
+};
+
+struct poolset_health_status {
+       unsigned nreplicas;
+       /* a flag for the poolset */
+       unsigned flags;
+       /* health statuses for each replica */
+       struct replica_health_status *replica[];
+};
+
+/* get index of the (r)th replica health status */
+static inline unsigned
+REP_HEALTHidx(struct poolset_health_status *set, unsigned r)
+{
+       ASSERTne(set->nreplicas, 0);
+       return (set->nreplicas + r) % set->nreplicas;
+}
+
+/* get index of the (r + 1)th replica health status */
+static inline unsigned
+REPN_HEALTHidx(struct poolset_health_status *set, unsigned r)
+{
+       ASSERTne(set->nreplicas, 0);
+       return (set->nreplicas + r + 1) % set->nreplicas;
+}
+
+/* get (p)th part health status */
+static inline unsigned
+PART_HEALTHidx(struct replica_health_status *rep, unsigned p)
+{
+       ASSERTne(rep->nparts, 0);
+       return (rep->nparts + p) % rep->nparts;
+}
+
+/* get (r)th replica health status */
+static inline struct replica_health_status *
+REP_HEALTH(struct poolset_health_status *set, unsigned r)
+{
+       return set->replica[REP_HEALTHidx(set, r)];
+}
+
+/* get (p)th part health status */
+static inline unsigned
+PART_HEALTH(struct replica_health_status *rep, unsigned p)
+{
+       return rep->part[PART_HEALTHidx(rep, p)].flags;
+}
+
+uint64_t replica_get_part_offset(struct pool_set *set,
+               unsigned repn, unsigned partn);
+
+void replica_align_badblock_offset_length(size_t *offset, size_t *length,
+               struct pool_set *set_in, unsigned repn, unsigned partn);
+
+size_t replica_get_part_data_len(struct pool_set *set_in, unsigned repn,
+               unsigned partn);
+uint64_t replica_get_part_data_offset(struct pool_set *set_in, unsigned repn,
+               unsigned part);
+
+/*
+ * is_dry_run -- (internal) check whether only verification mode is enabled
+ */
+static inline bool
+is_dry_run(unsigned flags)
+{
+       /*
+        * PMEMPOOL_SYNC_DRY_RUN and PMEMPOOL_TRANSFORM_DRY_RUN
+        * have to have the same value in order to use this common function.
+        */
+       ASSERT_COMPILE_ERROR_ON(PMEMPOOL_SYNC_DRY_RUN !=
+                               PMEMPOOL_TRANSFORM_DRY_RUN);
+
+       return flags & PMEMPOOL_SYNC_DRY_RUN;
+}
+
+/*
+ * fix_bad_blocks -- (internal) fix bad blocks - it causes reading or creating
+ *                              bad blocks recovery files
+ *                              (depending on if they exist or not)
+ */
+static inline bool
+fix_bad_blocks(unsigned flags)
+{
+       return flags & PMEMPOOL_SYNC_FIX_BAD_BLOCKS;
+}
+
+int replica_remove_all_recovery_files(struct poolset_health_status *set_hs);
+int replica_remove_part(struct pool_set *set, unsigned repn, unsigned partn,
+               int fix_bad_blocks);
+int replica_create_poolset_health_status(struct pool_set *set,
+               struct poolset_health_status **set_hsp);
+void replica_free_poolset_health_status(struct poolset_health_status *set_s);
+int replica_check_poolset_health(struct pool_set *set,
+               struct poolset_health_status **set_hs,
+               int called_from_sync, unsigned flags);
+int replica_is_part_broken(unsigned repn, unsigned partn,
+               struct poolset_health_status *set_hs);
+int replica_has_bad_blocks(unsigned repn, struct poolset_health_status *set_hs);
+int replica_part_has_bad_blocks(struct part_health_status *phs);
+int replica_part_has_corrupted_header(unsigned repn, unsigned partn,
+                               struct poolset_health_status *set_hs);
+unsigned replica_find_unbroken_part(unsigned repn,
+               struct poolset_health_status *set_hs);
+int replica_is_replica_broken(unsigned repn,
+               struct poolset_health_status *set_hs);
+int replica_is_replica_consistent(unsigned repn,
+               struct poolset_health_status *set_hs);
+int replica_is_replica_healthy(unsigned repn,
+               struct poolset_health_status *set_hs);
+
+unsigned replica_find_healthy_replica(
+               struct poolset_health_status *set_hs);
+unsigned replica_find_replica_healthy_header(
+               struct poolset_health_status *set_hs);
+
+int replica_is_poolset_healthy(struct poolset_health_status *set_hs);
+int replica_is_poolset_transformed(unsigned flags);
+ssize_t replica_get_pool_size(struct pool_set *set, unsigned repn);
+int replica_check_part_sizes(struct pool_set *set, size_t min_size);
+int replica_check_part_dirs(struct pool_set *set);
+int replica_check_local_part_dir(struct pool_set *set, unsigned repn,
+               unsigned partn);
+
+int replica_open_replica_part_files(struct pool_set *set, unsigned repn);
+int replica_open_poolset_part_files(struct pool_set *set);
+
+int replica_sync(struct pool_set *set_in, struct poolset_health_status *set_hs,
+               unsigned flags);
+int replica_transform(struct pool_set *set_in, struct pool_set *set_out,
+               unsigned flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/rm.c b/ceph/src/pmdk/src/libpmempool/rm.c
new file mode 100644 (file)
index 0000000..9313e0a
--- /dev/null
@@ -0,0 +1,251 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * rm.c -- implementation of pmempool_rm() function
+ */
+#include <errno.h>
+#include <fcntl.h>
+
+#include "libpmempool.h"
+#include "out.h"
+#include "os.h"
+#include "util.h"
+#include "set.h"
+#include "file.h"
+
+#define PMEMPOOL_RM_ALL_FLAGS (\
+       PMEMPOOL_RM_FORCE |\
+       PMEMPOOL_RM_POOLSET_LOCAL |\
+       PMEMPOOL_RM_POOLSET_REMOTE)
+
+#define ERR_F(f, ...) do {\
+       if (CHECK_FLAG((f), FORCE))\
+               LOG(2, "!(ignored) " __VA_ARGS__);\
+       else\
+               ERR(__VA_ARGS__);\
+} while (0)
+
+#define CHECK_FLAG(f, i) ((f) & PMEMPOOL_RM_##i)
+
+struct cb_args {
+       unsigned flags;
+       int error;
+};
+
+/*
+ * rm_local -- (internal) remove single local file
+ */
+static int
+rm_local(const char *path, unsigned flags, int is_part_file)
+{
+       int ret = util_unlink_flock(path);
+       if (!ret) {
+               LOG(3, "%s: removed", path);
+               return 0;
+       }
+
+       int oerrno = errno;
+       os_stat_t buff;
+       ret = os_stat(path, &buff);
+       if (!ret) {
+               if (S_ISDIR(buff.st_mode)) {
+                       errno = EISDIR;
+                       if (is_part_file)
+                               ERR("%s: removing file failed", path);
+                       else
+                               ERR("removing file failed");
+                       return -1;
+               }
+       }
+
+       errno = oerrno;
+
+       if (is_part_file)
+               ERR_F(flags, "%s: removing file failed", path);
+       else
+               ERR_F(flags, "removing file failed");
+
+       if (CHECK_FLAG(flags, FORCE))
+               return 0;
+
+       return -1;
+}
+
+/*
+ * rm_remote -- (internal) remove remote replica
+ */
+static int
+rm_remote(const char *node, const char *path, unsigned flags)
+{
+       if (!Rpmem_remove) {
+               ERR_F(flags, "cannot remove remote replica"
+                       " -- missing librpmem");
+               return -1;
+       }
+
+       int rpmem_flags = 0;
+       if (CHECK_FLAG(flags, FORCE))
+               rpmem_flags |= RPMEM_REMOVE_FORCE;
+
+       if (CHECK_FLAG(flags, POOLSET_REMOTE))
+               rpmem_flags |= RPMEM_REMOVE_POOL_SET;
+
+       int ret = Rpmem_remove(node, path, rpmem_flags);
+       if (ret) {
+               ERR_F(flags, "%s/%s removing failed", node, path);
+               if (CHECK_FLAG(flags, FORCE))
+                       ret = 0;
+       } else {
+               LOG(3, "%s/%s: removed", node, path);
+       }
+
+       return ret;
+}
+
+/*
+ * rm_cb -- (internal) foreach part callback
+ */
+static int
+rm_cb(struct part_file *pf, void *arg)
+{
+       struct cb_args *args = (struct cb_args *)arg;
+       int ret;
+       if (pf->is_remote) {
+               ret = rm_remote(pf->remote->node_addr, pf->remote->pool_desc,
+                               args->flags);
+       } else {
+               ret = rm_local(pf->part->path, args->flags, 1);
+       }
+
+       if (ret)
+               args->error = ret;
+
+       return 0;
+}
+
+/*
+ * pmempool_rmU -- remove pool files or poolsets
+ */
+#ifndef _WIN32
+static inline
+#endif
+int
+pmempool_rmU(const char *path, unsigned flags)
+{
+       LOG(3, "path %s flags %x", path, flags);
+       int ret;
+
+       if (flags & ~PMEMPOOL_RM_ALL_FLAGS) {
+               ERR("invalid flags specified");
+               errno = EINVAL;
+               return -1;
+       }
+
+       int is_poolset = util_is_poolset_file(path);
+       if (is_poolset < 0) {
+               os_stat_t buff;
+               ret = os_stat(path, &buff);
+               if (!ret) {
+                       if (S_ISDIR(buff.st_mode)) {
+                               errno = EISDIR;
+                               ERR("removing file failed");
+                               return -1;
+                       }
+               }
+               ERR_F(flags, "removing file failed");
+               if (CHECK_FLAG(flags, FORCE))
+                       return 0;
+
+               return -1;
+       }
+
+       if (!is_poolset) {
+               LOG(2, "%s: not a poolset file", path);
+               return rm_local(path, flags, 0);
+       }
+
+       LOG(2, "%s: poolset file", path);
+
+       /* fill up pool_set structure */
+       struct pool_set *set = NULL;
+       int fd = os_open(path, O_RDONLY);
+       if (fd == -1 || util_poolset_parse(&set, path, fd)) {
+               ERR_F(flags, "parsing poolset file failed");
+               if (fd != -1)
+                       os_close(fd);
+               if (CHECK_FLAG(flags, FORCE))
+                       return 0;
+               return -1;
+       }
+       os_close(fd);
+
+       if (set->remote) {
+               /* ignore error - it will be handled in rm_remote() */
+               (void) util_remote_load();
+       }
+
+       util_poolset_free(set);
+
+       struct cb_args args;
+       args.flags = flags;
+       args.error = 0;
+       ret = util_poolset_foreach_part(path, rm_cb, &args);
+       if (ret == -1) {
+               ERR_F(flags, "parsing poolset file failed");
+               if (CHECK_FLAG(flags, FORCE))
+                       return 0;
+
+               return ret;
+       }
+
+       ASSERTeq(ret, 0);
+
+       if (args.error)
+               return args.error;
+
+       if (CHECK_FLAG(flags, POOLSET_LOCAL)) {
+               ret = rm_local(path, flags, 0);
+               if (ret) {
+                       ERR_F(flags, "removing pool set file failed");
+               } else {
+                       LOG(3, "%s: removed", path);
+               }
+
+               if (CHECK_FLAG(flags, FORCE))
+                       return 0;
+
+               return ret;
+       }
+
+       return 0;
+}
+
+#ifndef _WIN32
+/*
+ * pmempool_rm -- remove pool files or poolsets
+ */
+int
+pmempool_rm(const char *path, unsigned flags)
+{
+       return pmempool_rmU(path, flags);
+}
+#else
+/*
+ * pmempool_rmW -- remove pool files or poolsets in widechar
+ */
+int
+pmempool_rmW(const wchar_t *path, unsigned flags)
+{
+       char *upath = util_toUTF8(path);
+       if (upath == NULL) {
+               ERR("Invalid poolest/pool file path.");
+               return -1;
+       }
+
+       int ret = pmempool_rmU(upath, flags);
+
+       util_free_UTF8(upath);
+       return ret;
+}
+#endif
diff --git a/ceph/src/pmdk/src/libpmempool/sync.c b/ceph/src/pmdk/src/libpmempool/sync.c
new file mode 100644 (file)
index 0000000..b7c0cb4
--- /dev/null
@@ -0,0 +1,1646 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * sync.c -- a module for poolset synchronizing
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h>
+
+#include "libpmem.h"
+#include "replica.h"
+#include "out.h"
+#include "os.h"
+#include "util_pmem.h"
+#include "util.h"
+
+#ifdef USE_RPMEM
+#include "rpmem_common.h"
+#include "rpmem_ssh.h"
+#endif
+
+#define BB_DATA_STR "offset 0x%zx, length 0x%zx, nhealthy %i"
+
+/* defines 'struct bb_vec' - the vector of the 'struct bad_block' structures */
+VEC(bb_vec, struct bad_block);
+
+/*
+ * validate_args -- (internal) check whether passed arguments are valid
+ */
+static int
+validate_args(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       ASSERTne(set, NULL);
+
+       /* the checks below help detect use of incorrect poolset file */
+
+       /*
+        * check if all parts in the poolset are large enough
+        * (now replication works only for pmemobj pools)
+        */
+       if (replica_check_part_sizes(set, PMEMOBJ_MIN_POOL)) {
+               LOG(2, "part sizes check failed");
+               goto err;
+       }
+
+       /*
+        * check if all directories for part files exist
+        */
+       if (replica_check_part_dirs(set)) {
+               LOG(2, "part directories check failed");
+               goto err;
+       }
+
+       return 0;
+
+err:
+       if (errno == 0)
+               errno = EINVAL;
+       return -1;
+}
+
+/*
+ * sync_copy_data -- (internal) copy data from the healthy replica
+ *                   to the broken one
+ */
+static int
+sync_copy_data(void *src_addr, void *dst_addr, size_t off, size_t len,
+               struct pool_replica *rep_h,
+               struct pool_replica *rep, const struct pool_set_part *part)
+{
+       LOG(3, "src_addr %p dst_addr %p off %zu len %zu "
+               "rep_h %p rep %p part %p",
+               src_addr, dst_addr, off, len, rep_h, rep, part);
+
+       int ret;
+
+       if (rep->remote) {
+               LOG(10,
+                       "copying data (offset 0x%zx length 0x%zx) to remote node -- '%s' on '%s'",
+                       off, len,
+                       rep->remote->pool_desc,
+                       rep->remote->node_addr);
+
+               ret = Rpmem_persist(rep->remote->rpp, off, len, 0, 0);
+               if (ret) {
+                       LOG(1,
+                               "copying data to remote node failed -- '%s' on '%s'",
+                               rep->remote->pool_desc,
+                               rep->remote->node_addr);
+                       return -1;
+               }
+       } else if (rep_h->remote) {
+               LOG(10,
+                       "reading data (offset 0x%zx length 0x%zx) from remote node -- '%s' on '%s'",
+                       off, len,
+                       rep_h->remote->pool_desc,
+                       rep_h->remote->node_addr);
+
+               ret = Rpmem_read(rep_h->remote->rpp, dst_addr, off, len, 0);
+               if (ret) {
+                       LOG(1,
+                               "reading data from remote node failed -- '%s' on '%s'",
+                               rep_h->remote->pool_desc,
+                               rep_h->remote->node_addr);
+                       return -1;
+               }
+       } else {
+               LOG(10,
+                       "copying data (offset 0x%zx length 0x%zx) from local replica -- '%s'",
+                       off, len, rep_h->part[0].path);
+
+               /* copy all data */
+               memcpy(dst_addr, src_addr, len);
+               util_persist(part->is_dev_dax, dst_addr, len);
+       }
+
+       return 0;
+}
+
+/*
+ * sync_recreate_header -- (internal) recreate the header
+ */
+static int
+sync_recreate_header(struct pool_set *set, unsigned r, unsigned p,
+                       struct pool_hdr *src_hdr)
+{
+       LOG(3, "set %p replica %u part %u src_hdr %p", set, r, p, src_hdr);
+
+       struct pool_attr attr;
+       util_pool_hdr2attr(&attr, src_hdr);
+
+       if (util_header_create(set, r, p, &attr, 1) != 0) {
+               LOG(1, "part headers create failed for replica %u part %u",
+                       r, p);
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * sync_mark_replica_no_badblocks -- (internal) mark replica as not having
+ *                                              bad blocks
+ */
+static void
+sync_mark_replica_no_badblocks(unsigned repn,
+                               struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u set_hs %p", repn, set_hs);
+
+       struct replica_health_status *rhs = REP_HEALTH(set_hs, repn);
+
+       if (rhs->flags & HAS_BAD_BLOCKS) {
+               rhs->flags &= ~HAS_BAD_BLOCKS;
+               LOG(4, "replica %u has no bad blocks now", repn);
+       }
+}
+
+/*
+ * sync_mark_part_no_badblocks -- (internal) mark part as not having bad blocks
+ */
+static void
+sync_mark_part_no_badblocks(unsigned repn, unsigned partn,
+                               struct poolset_health_status *set_hs)
+{
+       LOG(3, "repn %u partn %u set_hs %p", repn, partn, set_hs);
+
+       struct replica_health_status *rhs = REP_HEALTH(set_hs, repn);
+
+       if (rhs->part[PART_HEALTHidx(rhs, partn)].flags & HAS_BAD_BLOCKS) {
+               rhs->part[PART_HEALTHidx(rhs, partn)].flags &= ~HAS_BAD_BLOCKS;
+               LOG(4, "replica %u part %u has no bad blocks now", repn, partn);
+       }
+}
+
+/*
+ * sync_recalc_badblocks -- (internal) recalculate offset and length
+ *                          of bad blocks to absolute ones
+ *                          (relative to the beginning of the pool)
+ */
+static int
+sync_recalc_badblocks(struct pool_set *set,
+                       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p set_hs %p", set, set_hs);
+
+       /* header size for all headers but the first one */
+       size_t hdrsize = (set->options & (OPTION_SINGLEHDR | OPTION_NOHDRS)) ?
+                               0 : Mmap_align;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+
+                       struct part_health_status *phs = &rep_hs->part[p];
+
+                       if (!replica_part_has_bad_blocks(phs)) {
+                               /* skip parts with no bad blocks */
+                               continue;
+                       }
+
+                       ASSERTne(phs->bbs.bb_cnt, 0);
+                       ASSERTne(phs->bbs.bbv, NULL);
+
+                       LOG(10, "Replica %u part %u HAS %u bad blocks",
+                               r, p, phs->bbs.bb_cnt);
+
+                       size_t part_off = replica_get_part_offset(set, r, p);
+
+                       for (unsigned i = 0; i < phs->bbs.bb_cnt; i++) {
+                               LOG(10,
+                                       "relative bad block #%i: offset %zu, length %zu",
+                                       i,
+                                       phs->bbs.bbv[i].offset,
+                                       phs->bbs.bbv[i].length);
+
+                               size_t off = phs->bbs.bbv[i].offset;
+                               size_t len = phs->bbs.bbv[i].length;
+
+                               if (len + off <= hdrsize)
+                                       continue;
+
+                               /* parts #>0 are mapped without the header */
+                               if (p > 0 && hdrsize > 0) {
+                                       if (off >= hdrsize) {
+                                               /*
+                                                * Bad block does not overlap
+                                                * with the header, so only
+                                                * adjust the offset.
+                                                */
+                                               off -= hdrsize;
+                                       } else {
+                                               /*
+                                                * Bad block overlaps
+                                                * with the header,
+                                                * so adjust the length
+                                                * and zero the offset.
+                                                */
+                                               len -= hdrsize - off;
+                                               off = 0;
+                                       }
+                               }
+
+                               replica_align_badblock_offset_length(&off, &len,
+                                                               set, r, p);
+
+                               phs->bbs.bbv[i].offset = part_off + off;
+                               phs->bbs.bbv[i].length = (unsigned)len;
+
+                               LOG(10,
+                                       "absolute bad block #%i: offset 0x%zx, length 0x%zx",
+                                       i,
+                                       phs->bbs.bbv[i].offset,
+                                       phs->bbs.bbv[i].length);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * sync_badblocks_find_healthy_replica -- (internal) look for a healthy replica
+ *                                                   for each bad block
+ *
+ * This function looks for a healthy replica for each bad block. Bad blocks
+ * can overlap across replicas, so each bad block may have to be divided
+ * into smaller parts which can be fixed using different healthy replica.
+ *
+ * Key variables:
+ * - bbv_all[] - array containing all (possibly divided) bad blocks
+ *               from all previous replicas.
+ * - bbv_aux[] - array containing all (possibly divided) bad blocks
+ *               from all previous parts of the current replica merged with
+ *               these bad blocks from bbv_all[] that have offsets less or equal
+ *               the greatest bad block's offset in the previous part.
+ *
+ * This function merges bad blocks from bbv_all[] with bad blocks
+ * from the current part and writes the outcome bad blocks to bbv_aux[].
+ * Only bad blocks with offsets less or equal the greatest bad block's offset
+ * in the current part will be moved from bbv_all[] to bbv_aux[].
+ * The rest of them has to be moved at the end by sync_badblocks_move_vec().
+ *
+ * bbv_aux[] becomes new bbv_all[] and bbv_aux[] is zeroed
+ * before checking the next replica (bbv_all = bbv_aux; bbv_aux = 0).
+ *
+ * For example (all replicas have only one part):
+ * - bbv_all with rep#0: |__----___________----__|
+ * - merged with  rep#1: |____----_______----____|
+ * - gives such bbv_aux: |__11--00_______00--11__|
+ * - merged with  rep#2: |__________---__________|
+ * - gives such bbv_aux: |__112200__000__002211__| (all bad blocks can be fixed)
+ *
+ * where:
+ *   '_' stands for a healthy block (no bad block)
+ *   '-' stands for a bad block with nhealthy == NO_HEALTHY_REPLICA
+ *   'N' stands for a bad block with nhealthy == N (can be fixed using rep#N)
+ */
+static int
+sync_badblocks_find_healthy_replica(struct part_health_status *phs,
+                                       int rep,
+                                       struct bb_vec *pbbv_all,
+                                       struct bb_vec *pbbv_aux,
+                                       unsigned *i_all)
+{
+       LOG(3, "phs %p rep %i pbbv_all %p pbbv_aux %p i_all %i",
+               phs, rep, pbbv_all, pbbv_aux, *i_all);
+
+       struct bad_block bb_add;        /* the element which is being added  */
+       struct bad_block bb_new;        /* a new element */
+       struct bad_block *pbb_all;      /* current element of bbv_all[] */
+
+       unsigned long long beg_prev;
+       unsigned long long end_prev;
+       unsigned long long beg_new;
+       unsigned long long end_new;
+       size_t len_prev;
+       size_t len_new;
+
+       size_t size_all = VEC_SIZE(pbbv_all);
+
+       if (size_all == 0) {
+               /* there were no bad blocks so far, so fill up bbv_aux[] */
+               for (unsigned i = 0; i < phs->bbs.bb_cnt; i++) {
+                       bb_add = phs->bbs.bbv[i];
+
+                       if (rep > 0)
+                               /* bad block can be fixed with replica #0 */
+                               bb_add.nhealthy = 0;
+
+                       if (VEC_PUSH_BACK(pbbv_aux, bb_add))
+                               return -1;
+
+                       LOG(10,
+                               "added bad block (prev-empty): " BB_DATA_STR,
+                               bb_add.offset, bb_add.length, bb_add.nhealthy);
+               }
+       } else {
+               if (*i_all < size_all) {
+                       pbb_all = VEC_GET(pbbv_all, (*i_all)++);
+               } else {
+                       pbb_all = NULL;
+               }
+
+               for (unsigned i = 0; i < phs->bbs.bb_cnt; i++) {
+                       bb_new = phs->bbs.bbv[i];
+
+                       LOG(10,
+                               " * (%u) inserting new bad block: " BB_DATA_STR,
+                               i + 1,
+                               bb_new.offset, bb_new.length, bb_new.nhealthy);
+
+                       if (pbb_all == NULL || pbb_all->length == 0) {
+                               if (*i_all < size_all)
+                                       pbb_all = VEC_GET(pbbv_all, (*i_all)++);
+                               else
+                                       pbb_all = NULL;
+                       }
+
+                       /* all from bbv_all before the bb_new */
+                       while (pbb_all != NULL && pbb_all->offset
+                                                       + pbb_all->length - 1
+                                                       < bb_new.offset) {
+                               if (pbb_all->nhealthy == NO_HEALTHY_REPLICA)
+                                       /* can be fixed with this replica */
+                                       pbb_all->nhealthy = rep;
+
+                               if (VEC_PUSH_BACK(pbbv_aux, *pbb_all))
+                                       return -1;
+
+                               LOG(10,
+                                       "added bad block (prev-before): "
+                                       BB_DATA_STR,
+                                       pbb_all->offset, pbb_all->length,
+                                       pbb_all->nhealthy);
+
+                               if (*i_all < size_all) {
+                                       pbb_all = VEC_GET(pbbv_all, (*i_all)++);
+                               } else {
+                                       pbb_all = NULL;
+                                       break;
+                               }
+                       }
+
+                       beg_new = bb_new.offset;
+                       len_new = bb_new.length;
+                       end_new = beg_new + len_new - 1;
+
+                       /* all pbb_all overlapping with the bb_new */
+                       while (len_new > 0 && pbb_all != NULL) {
+
+                               beg_prev = pbb_all->offset;
+                               len_prev = pbb_all->length;
+                               end_prev = beg_prev + len_prev - 1;
+
+                               /* check if new overlaps with prev */
+                               if (end_prev < beg_new || end_new < beg_prev)
+                                       break;
+
+                               /*
+                                * 1st part: non-overlapping part
+                                * of pbb_all or bb_new
+                                */
+                               if (beg_prev < beg_new) {
+                                       /* non-overlapping part of pbb_all */
+                                       bb_add.offset = beg_prev;
+                                       bb_add.length = (unsigned)
+                                                       (beg_new - beg_prev);
+
+                                       if (pbb_all->nhealthy !=
+                                                       NO_HEALTHY_REPLICA) {
+                                               bb_add.nhealthy =
+                                                       pbb_all->nhealthy;
+                                       } else {
+                                               /*
+                                                * It can be fixed with
+                                                * this replica.
+                                                */
+                                               bb_add.nhealthy = rep;
+                                       }
+
+                                       if (VEC_PUSH_BACK(pbbv_aux, bb_add))
+                                               return -1;
+
+                                       LOG(10,
+                                               "added bad block (prev-only): "
+                                               BB_DATA_STR,
+                                               bb_add.offset, bb_add.length,
+                                               bb_add.nhealthy);
+
+                                       beg_prev += bb_add.length;
+                                       len_prev -= bb_add.length;
+
+                               } else if (beg_new < beg_prev) {
+                                       /* non-overlapping part of bb_new */
+                                       bb_add.offset = beg_new;
+                                       bb_add.length = (unsigned)
+                                                       (beg_prev - beg_new);
+
+                                       if (rep == 0) {
+                                               bb_add.nhealthy =
+                                                       NO_HEALTHY_REPLICA;
+                                       } else {
+                                               /*
+                                                * It can be fixed with any
+                                                * previous replica, so let's
+                                                * choose replia #0.
+                                                */
+                                               bb_add.nhealthy = 0;
+                                       }
+
+                                       if (VEC_PUSH_BACK(pbbv_aux, bb_add))
+                                               return -1;
+
+                                       LOG(10,
+                                               "added bad block (new-only): "
+                                               BB_DATA_STR,
+                                               bb_add.offset, bb_add.length,
+                                               bb_add.nhealthy);
+
+                                       beg_new += bb_add.length;
+                                       len_new -= bb_add.length;
+                               }
+
+                               /*
+                                * 2nd part: overlapping part
+                                * of pbb_all and bb_new
+                                */
+                               if (len_prev <= len_new) {
+                                       bb_add.offset = beg_prev;
+                                       bb_add.length = len_prev;
+
+                                       beg_new += len_prev;
+                                       len_new -= len_prev;
+
+                                       /* whole pbb_all was added */
+                                       len_prev = 0;
+                               } else {
+                                       bb_add.offset = beg_new;
+                                       bb_add.length = len_new;
+
+                                       beg_prev += len_new;
+                                       len_prev -= len_new;
+
+                                       /* whole bb_new was added */
+                                       len_new = 0;
+                               }
+
+                               bb_add.nhealthy = pbb_all->nhealthy;
+
+                               if (VEC_PUSH_BACK(pbbv_aux, bb_add))
+                                       return -1;
+
+                               LOG(10,
+                                       "added bad block (common): "
+                                       BB_DATA_STR,
+                                       bb_add.offset, bb_add.length,
+                                       bb_add.nhealthy);
+
+                               /* update pbb_all */
+                               pbb_all->offset = beg_prev;
+                               pbb_all->length = len_prev;
+
+                               if (len_prev == 0) {
+                                       if (*i_all < size_all)
+                                               pbb_all = VEC_GET(pbbv_all,
+                                                               (*i_all)++);
+                                       else
+                                               pbb_all = NULL;
+                               }
+                       }
+
+                       /* the rest of the bb_new */
+                       if (len_new > 0) {
+                               bb_add.offset = beg_new;
+                               bb_add.length = len_new;
+
+                               if (rep > 0)
+                                       /* it can be fixed with replica #0 */
+                                       bb_add.nhealthy = 0;
+                               else
+                                       bb_add.nhealthy = NO_HEALTHY_REPLICA;
+
+                               if (VEC_PUSH_BACK(pbbv_aux, bb_add))
+                                       return -1;
+
+                               LOG(10,
+                                       "added bad block (new-rest): "
+                                       BB_DATA_STR,
+                                       bb_add.offset, bb_add.length,
+                                       bb_add.nhealthy);
+                       }
+               }
+
+               if (pbb_all != NULL && pbb_all->length > 0 && *i_all > 0)
+                       /* this pbb_all will be used again in the next part */
+                       (*i_all)--;
+       }
+
+       return 0;
+}
+
+/*
+ * sync_badblocks_assign_healthy_replica -- (internal) assign healthy replica
+ *                                                   for each bad block
+ */
+static int
+sync_badblocks_assign_healthy_replica(struct part_health_status *phs,
+                                       int rep,
+                                       struct bb_vec *pbbv_all,
+                                       unsigned *i_all)
+{
+       LOG(3, "phs %p rep %i pbbv_all %p i_all %i",
+               phs, rep, pbbv_all, *i_all);
+
+       struct bad_block bb_new;        /* a new element */
+       struct bad_block bb_old;        /* an old element */
+       struct bad_block *pbb_all;      /* current element of bbv_all[] */
+
+       size_t length_left;
+
+       struct bb_vec bbv_new = VEC_INITIALIZER;
+
+       size_t size_all = VEC_SIZE(pbbv_all);
+       pbb_all = VEC_GET(pbbv_all, *i_all);
+
+       for (unsigned i = 0; i < phs->bbs.bb_cnt; i++) {
+               bb_old = phs->bbs.bbv[i];
+
+               LOG(10,
+                       "assigning old bad block: " BB_DATA_STR,
+                       bb_old.offset, bb_old.length, bb_old.nhealthy);
+
+               /*
+                * Skip all bad blocks from bbv_all with offsets
+                * less than the offset of the current bb_old.
+                */
+               while (pbb_all->offset < bb_old.offset) {
+                       /* (*i_all) has to be less than (size_all - 1) */
+                       ASSERT(*i_all < size_all - 1);
+                       pbb_all = VEC_GET(pbbv_all, ++(*i_all));
+               }
+
+               bb_new.offset = bb_old.offset;
+               length_left = bb_old.length;
+
+               while (length_left > 0) {
+                       LOG(10,
+                               "checking saved bad block: " BB_DATA_STR,
+                               pbb_all->offset, pbb_all->length,
+                               pbb_all->nhealthy);
+
+                       ASSERTeq(pbb_all->offset, bb_new.offset);
+                       ASSERT(pbb_all->length <= length_left);
+
+                       bb_new.length = pbb_all->length;
+                       bb_new.nhealthy = pbb_all->nhealthy;
+
+                       if (VEC_PUSH_BACK(&bbv_new, bb_new))
+                               goto error_exit;
+
+                       LOG(10,
+                               "added new bad block: " BB_DATA_STR,
+                               bb_new.offset, bb_new.length, bb_new.nhealthy);
+
+                       bb_new.offset += bb_new.length;
+                       length_left -= bb_new.length;
+
+                       if (length_left == 0)
+                               continue;
+
+                       /* (*i_all) has to be less than (size_all - 1) */
+                       ASSERT(*i_all < size_all - 1);
+                       pbb_all = VEC_GET(pbbv_all, ++(*i_all));
+               }
+       }
+
+       Free(phs->bbs.bbv);
+       phs->bbs.bbv = VEC_ARR(&bbv_new);
+       phs->bbs.bb_cnt = (unsigned)VEC_SIZE(&bbv_new);
+
+       LOG(10, "added %u new bad blocks", phs->bbs.bb_cnt);
+
+       return 0;
+
+error_exit:
+       VEC_DELETE(&bbv_new);
+       return -1;
+}
+
+/*
+ * sync_badblocks_move_vec -- (internal) move bad blocks from vector pbbv_all
+ *                                       to vector pbbv_aux
+ */
+static int
+sync_badblocks_move_vec(struct bb_vec *pbbv_all,
+                       struct bb_vec *pbbv_aux,
+                       unsigned i_all,
+                       unsigned rep)
+{
+       LOG(3, "pbbv_all %p pbbv_aux %p i_all %u rep  %u",
+               pbbv_all, pbbv_aux, i_all, rep);
+
+       size_t size_all = VEC_SIZE(pbbv_all);
+       struct bad_block *pbb_all;
+
+       while (i_all < size_all) {
+               pbb_all = VEC_GET(pbbv_all, i_all++);
+
+               if (pbb_all->length == 0)
+                       continue;
+
+               if (pbb_all->nhealthy == NO_HEALTHY_REPLICA && rep > 0)
+                       /* it can be fixed using the last replica */
+                       pbb_all->nhealthy = (int)rep;
+
+               if (VEC_PUSH_BACK(pbbv_aux, *pbb_all))
+                       return -1;
+
+               LOG(10,
+                       "added bad block (prev-after): " BB_DATA_STR,
+                       pbb_all->offset, pbb_all->length,
+                       pbb_all->nhealthy);
+       }
+
+       return 0;
+}
+
+/*
+ * sync_check_bad_blocks_overlap -- (internal) check if there are uncorrectable
+ *                                  bad blocks (bad blocks overlapping
+ *                                  in all replicas)
+ */
+static int
+sync_check_bad_blocks_overlap(struct pool_set *set,
+                               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p set_hs %p", set, set_hs);
+
+       struct bb_vec bbv_all = VEC_INITIALIZER;
+       struct bb_vec bbv_aux = VEC_INITIALIZER;
+
+       int ret = -1;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               unsigned i_all = 0;     /* index in bbv_all */
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       struct part_health_status *phs = &rep_hs->part[p];
+
+                       if (!replica_part_has_bad_blocks(phs)) {
+                               /* skip parts with no bad blocks */
+                               continue;
+                       }
+
+                       ASSERTne(phs->bbs.bb_cnt, 0);
+                       ASSERTne(phs->bbs.bbv, NULL);
+
+                       LOG(10, "Replica %u part %u HAS %u bad blocks",
+                               r, p, phs->bbs.bb_cnt);
+
+                       /*
+                        * This function merges bad blocks from bbv_all
+                        * with bad blocks from the current part
+                        * and writes the outcome bad blocks to bbv_aux.
+                        * Only bad blocks with offsets less or equal
+                        * the greatest bad block's offset in the current part
+                        * will be moved from bbv_all to bbv_aux.
+                        * The rest of them has to be moved at the end
+                        * by sync_badblocks_move_vec() below.
+                        */
+                       if (sync_badblocks_find_healthy_replica(phs, (int)r,
+                                                       &bbv_all, &bbv_aux,
+                                                       &i_all))
+                               goto exit;
+               }
+
+               /*
+                * Move the rest of bad blocks from bbv_all to bbv_aux
+                * (for more details see the comment above).
+                * All these bad blocks can be fixed using the last replica 'r'.
+                */
+               if (sync_badblocks_move_vec(&bbv_all, &bbv_aux, i_all, r))
+                       return -1;
+
+               /* bbv_aux becomes a new bbv_all */
+               VEC_MOVE(&bbv_all, &bbv_aux);
+               i_all = 0;
+       }
+
+       ret = 0;
+
+       /* check if there is an uncorrectable bad block */
+       size_t size_all = VEC_SIZE(&bbv_all);
+       for (unsigned i = 0; i < size_all; i++) {
+               struct bad_block *pbb_all = VEC_GET(&bbv_all, i);
+               if (pbb_all->nhealthy == NO_HEALTHY_REPLICA) {
+                       ret = 1; /* this bad block cannot be fixed */
+
+                       LOG(1,
+                               "uncorrectable bad block found: offset 0x%zx, length 0x%zx",
+                               pbb_all->offset, pbb_all->length);
+
+                       goto exit;
+               }
+       }
+
+       /*
+        * All bad blocks can be fixed,
+        * so assign healthy replica for each of them.
+        */
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               if (!replica_has_bad_blocks(r, set_hs)) {
+                       /* skip replicas with no bad blocks */
+                       continue;
+               }
+
+               unsigned i_all = 0;     /* index in bbv_all */
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       struct part_health_status *phs = &rep_hs->part[p];
+
+                       if (!replica_part_has_bad_blocks(phs)) {
+                               /* skip parts with no bad blocks */
+                               continue;
+                       }
+
+                       if (sync_badblocks_assign_healthy_replica(phs, (int)r,
+                                                               &bbv_all,
+                                                               &i_all))
+                               goto exit;
+               }
+       }
+
+exit:
+       VEC_DELETE(&bbv_aux);
+       VEC_DELETE(&bbv_all);
+
+       return ret;
+}
+
+/*
+ * sync_badblocks_data -- (internal) clear bad blocks in replica
+ */
+static int
+sync_badblocks_data(struct pool_set *set, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+
+       struct pool_replica *rep_h;
+
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               struct replica_health_status *rep_hs = set_hs->replica[r];
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+
+                       struct part_health_status *phs = &rep_hs->part[p];
+
+                       if (!replica_part_has_bad_blocks(phs)) {
+                               /* skip parts with no bad blocks */
+                               continue;
+                       }
+
+                       ASSERTne(phs->bbs.bb_cnt, 0);
+                       ASSERTne(phs->bbs.bbv, NULL);
+
+                       const struct pool_set_part *part = &rep->part[p];
+                       size_t part_off = replica_get_part_offset(set, r, p);
+
+                       for (unsigned i = 0; i < phs->bbs.bb_cnt; i++) {
+                               size_t off = phs->bbs.bbv[i].offset - part_off;
+                               size_t len = phs->bbs.bbv[i].length;
+
+                               ASSERT(phs->bbs.bbv[i].nhealthy >= 0);
+
+                               rep_h = REP(set,
+                                       (unsigned)phs->bbs.bbv[i].nhealthy);
+
+                               void *src_addr = ADDR_SUM(rep_h->part[0].addr,
+                                                               part_off + off);
+                               void *dst_addr = ADDR_SUM(part->addr, off);
+
+                               if (sync_copy_data(src_addr, dst_addr,
+                                                       part_off + off, len,
+                                                       rep_h, rep, part))
+                                       return -1;
+                       }
+
+                       /* free array of bad blocks */
+                       Free(phs->bbs.bbv);
+                       phs->bbs.bbv = NULL;
+
+                       /* mark part as having no bad blocks */
+                       sync_mark_part_no_badblocks(r, p, set_hs);
+               }
+
+               /* mark replica as having no bad blocks */
+               sync_mark_replica_no_badblocks(r, set_hs);
+       }
+
+       LOG(1, "all bad blocks have been fixed");
+
+       if (replica_remove_all_recovery_files(set_hs)) {
+               LOG(1, "removing bad block recovery files failed");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * recreate_broken_parts -- (internal) create parts in place of the broken ones
+ */
+static int
+recreate_broken_parts(struct pool_set *set,
+                       struct poolset_health_status *set_hs,
+                       int fix_bad_blocks)
+{
+       LOG(3, "set %p set_hs %p fix_bad_blocks %i",
+               set, set_hs, fix_bad_blocks);
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               if (set->replica[r]->remote)
+                       continue;
+
+               struct pool_replica *broken_r = set->replica[r];
+
+               for (unsigned p = 0; p < set_hs->replica[r]->nparts; ++p) {
+                       /* skip unbroken parts */
+                       if (!replica_is_part_broken(r, p, set_hs))
+                               continue;
+
+                       /* remove parts from broken replica */
+                       if (replica_remove_part(set, r, p, fix_bad_blocks)) {
+                               LOG(2, "cannot remove part");
+                               return -1;
+                       }
+
+                       /* create removed part and open it */
+                       if (util_part_open(&broken_r->part[p], 0,
+                                               1 /* create */)) {
+                               LOG(2, "cannot open/create parts");
+                               return -1;
+                       }
+
+                       sync_mark_part_no_badblocks(r, p, set_hs);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * fill_struct_part_uuids -- (internal) set part uuids in pool_set structure
+ */
+static void
+fill_struct_part_uuids(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, set_hs %p", set, repn, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_hdr *hdrp;
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip broken parts */
+               if (replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               hdrp = HDR(rep, p);
+               memcpy(rep->part[p].uuid, hdrp->uuid, POOL_HDR_UUID_LEN);
+       }
+}
+
+/*
+ * is_uuid_already_used -- (internal) check if given uuid is assigned to
+ *                         any of the earlier replicas
+ */
+static int
+is_uuid_already_used(uuid_t uuid, struct pool_set *set, unsigned repn)
+{
+       for (unsigned r = 0; r < repn; ++r) {
+               if (uuidcmp(uuid, PART(REP(set, r), 0)->uuid) == 0)
+                       return 1;
+       }
+       return 0;
+}
+
+/*
+ * fill_struct_broken_part_uuids -- (internal) set part uuids in pool_set
+ *                                  structure
+ */
+static int
+fill_struct_broken_part_uuids(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs, unsigned flags)
+{
+       LOG(3, "set %p, repn %u, set_hs %p, flags %u", set, repn, set_hs,
+                       flags);
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_hdr *hdrp;
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               /* skip unbroken parts */
+               if (!replica_is_part_broken(repn, p, set_hs))
+                       continue;
+
+               /* check if part was damaged or was added by transform */
+               if (replica_is_poolset_transformed(flags)) {
+                       /* generate new uuid for this part */
+                       if (util_uuid_generate(rep->part[p].uuid) < 0) {
+                               ERR("cannot generate pool set part UUID");
+                               errno = EINVAL;
+                               return -1;
+                       }
+                       continue;
+               }
+
+               if (!replica_is_part_broken(repn, p - 1, set_hs) &&
+                               !(set->options & OPTION_SINGLEHDR)) {
+                       /* try to get part uuid from the previous part */
+                       hdrp = HDRP(rep, p);
+                       memcpy(rep->part[p].uuid, hdrp->next_part_uuid,
+                                       POOL_HDR_UUID_LEN);
+               } else if (!replica_is_part_broken(repn, p + 1, set_hs) &&
+                               !(set->options & OPTION_SINGLEHDR)) {
+                       /* try to get part uuid from the next part */
+                       hdrp = HDRN(rep, p);
+                       memcpy(rep->part[p].uuid, hdrp->prev_part_uuid,
+                                       POOL_HDR_UUID_LEN);
+               } else if (p == 0 &&
+                       !replica_is_part_broken(repn - 1, 0, set_hs)) {
+                       /* try to get part uuid from the previous replica */
+                       hdrp = HDR(REPP(set, repn), 0);
+                       if (is_uuid_already_used(hdrp->next_repl_uuid, set,
+                                       repn)) {
+                               ERR(
+                                       "repeated uuid - some replicas were created with a different poolset file");
+                               errno = EINVAL;
+                               return -1;
+                       }
+                       memcpy(rep->part[p].uuid, hdrp->next_repl_uuid,
+                                               POOL_HDR_UUID_LEN);
+               } else if (p == 0 &&
+                       !replica_is_part_broken(repn + 1, 0, set_hs)) {
+                       /* try to get part uuid from the next replica */
+                       hdrp = HDR(REPN(set, repn), 0);
+                       if (is_uuid_already_used(hdrp->prev_repl_uuid, set,
+                                       repn)) {
+                               ERR(
+                                       "repeated uuid - some replicas were created with a different poolset file");
+                               errno = EINVAL;
+                               return -1;
+                       }
+                       memcpy(rep->part[p].uuid, hdrp->prev_repl_uuid,
+                                               POOL_HDR_UUID_LEN);
+               } else {
+                       /* generate new uuid for this part */
+                       if (util_uuid_generate(rep->part[p].uuid) < 0) {
+                               ERR("cannot generate pool set part UUID");
+                               errno = EINVAL;
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * fill_struct_uuids -- (internal) fill fields in pool_set needed for further
+ *                      altering of uuids
+ */
+static int
+fill_struct_uuids(struct pool_set *set, unsigned src_replica,
+               struct poolset_health_status *set_hs, unsigned flags)
+{
+       LOG(3, "set %p, src_replica %u, set_hs %p, flags %u", set, src_replica,
+                       set_hs, flags);
+
+       /* set poolset uuid */
+       struct pool_hdr *src_hdr0 = HDR(REP(set, src_replica), 0);
+       memcpy(set->uuid, src_hdr0->poolset_uuid, POOL_HDR_UUID_LEN);
+
+       /* set unbroken parts' uuids */
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               fill_struct_part_uuids(set, r, set_hs);
+       }
+
+       /* set broken parts' uuids */
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (fill_struct_broken_part_uuids(set, r, set_hs, flags))
+                       return -1;
+       }
+       return 0;
+}
+
+/*
+ * create_headers_for_broken_parts -- (internal) create headers for all new
+ *                                    parts created in place of the broken ones
+ */
+static int
+create_headers_for_broken_parts(struct pool_set *set, unsigned src_replica,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, src_replica %u, set_hs %p", set, src_replica, set_hs);
+
+       struct pool_hdr *src_hdr = HDR(REP(set, src_replica), 0);
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               /* skip unbroken replicas */
+               if (!replica_is_replica_broken(r, set_hs) &&
+                   !replica_has_bad_blocks(r, set_hs))
+                       continue;
+
+               for (unsigned p = 0; p < set_hs->replica[r]->nhdrs; p++) {
+                       /* skip unbroken parts */
+                       if (!replica_is_part_broken(r, p, set_hs) &&
+                           !replica_part_has_corrupted_header(r, p, set_hs))
+                               continue;
+
+                       if (sync_recreate_header(set, r, p, src_hdr))
+                               return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * copy_data_to_broken_parts -- (internal) copy data to all parts created
+ *                              in place of the broken ones
+ */
+static int
+copy_data_to_broken_parts(struct pool_set *set, unsigned healthy_replica,
+               unsigned flags, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, healthy_replica %u, flags %u, set_hs %p", set,
+                       healthy_replica, flags, set_hs);
+
+       /* get pool size from healthy replica */
+       size_t poolsize = set->poolsize;
+
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               /* skip unbroken and consistent replicas */
+               if (replica_is_replica_healthy(r, set_hs))
+                       continue;
+
+               struct pool_replica *rep = REP(set, r);
+               struct pool_replica *rep_h = REP(set, healthy_replica);
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       /* skip unbroken parts from consistent replicas */
+                       if (!replica_is_part_broken(r, p, set_hs) &&
+                               replica_is_replica_consistent(r, set_hs))
+                               continue;
+
+                       const struct pool_set_part *part = &rep->part[p];
+
+                       size_t off = replica_get_part_data_offset(set, r, p);
+                       size_t len = replica_get_part_data_len(set, r, p);
+
+                       /* do not allow copying too much data */
+                       if (off >= poolsize)
+                               continue;
+
+                       if (off + len > poolsize || rep->remote)
+                               len = poolsize - off;
+
+                       /*
+                        * First part of replica is mapped
+                        * with header
+                        */
+                       size_t fpoff = (p == 0) ? POOL_HDR_SIZE : 0;
+                       void *src_addr = ADDR_SUM(rep_h->part[0].addr, off);
+                       void *dst_addr = ADDR_SUM(part->addr, fpoff);
+
+                       if (sync_copy_data(src_addr, dst_addr, off, len,
+                                               rep_h, rep, part))
+                               return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * grant_created_parts_perm -- (internal) set RW permission rights to all
+ *                            the parts created in place of the broken ones
+ */
+static int
+grant_created_parts_perm(struct pool_set *set, unsigned src_repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, src_repn %u, set_hs %p", set, src_repn, set_hs);
+
+       /* choose the default permissions */
+       mode_t def_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
+
+       /* get permissions of the first part of the source replica */
+       mode_t src_mode;
+       os_stat_t sb;
+       if (REP(set, src_repn)->remote) {
+               src_mode = def_mode;
+       } else if (os_stat(PART(REP(set, src_repn), 0)->path, &sb) != 0) {
+               ERR("cannot check file permissions of %s (replica %u, part %u)",
+                               PART(REP(set, src_repn), 0)->path, src_repn, 0);
+               src_mode = def_mode;
+       } else {
+               src_mode = sb.st_mode;
+       }
+
+       /* set permissions to all recreated parts */
+       for (unsigned r = 0; r < set_hs->nreplicas; ++r) {
+               /* skip unbroken replicas */
+               if (!replica_is_replica_broken(r, set_hs))
+                       continue;
+
+               if (set->replica[r]->remote)
+                       continue;
+
+               for (unsigned p = 0; p < set_hs->replica[r]->nparts; p++) {
+                       /* skip parts which were not created */
+                       if (!PART(REP(set, r), p)->created)
+                               continue;
+
+                       LOG(4, "setting permissions for part %u, replica %u",
+                                       p, r);
+
+                       /* set rights to those of existing part files */
+                       if (os_chmod(PART(REP(set, r), p)->path, src_mode)) {
+                               ERR(
+                                       "cannot set permission rights for created parts: replica %u, part %u",
+                                       r, p);
+                               errno = EPERM;
+                               return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * update_parts_linkage -- (internal) set uuids linking recreated parts within
+ *                         a replica
+ */
+static int
+update_parts_linkage(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, set_hs %p", set, repn, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               struct pool_hdr *hdrp = HDR(rep, p);
+               struct pool_hdr *prev_hdrp = HDRP(rep, p);
+               struct pool_hdr *next_hdrp = HDRN(rep, p);
+
+               /* set uuids in the current part */
+               memcpy(hdrp->prev_part_uuid, PARTP(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+               memcpy(hdrp->next_part_uuid, PARTN(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum,
+                       1, POOL_HDR_CSUM_END_OFF(hdrp));
+
+               /* set uuids in the previous part */
+               memcpy(prev_hdrp->next_part_uuid, PART(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(prev_hdrp, sizeof(*prev_hdrp),
+                       &prev_hdrp->checksum, 1,
+                       POOL_HDR_CSUM_END_OFF(prev_hdrp));
+
+               /* set uuids in the next part */
+               memcpy(next_hdrp->prev_part_uuid, PART(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(next_hdrp, sizeof(*next_hdrp),
+                       &next_hdrp->checksum, 1,
+                       POOL_HDR_CSUM_END_OFF(next_hdrp));
+
+               /* store pool's header */
+               util_persist(PART(rep, p)->is_dev_dax, hdrp, sizeof(*hdrp));
+               util_persist(PARTP(rep, p)->is_dev_dax, prev_hdrp,
+                               sizeof(*prev_hdrp));
+               util_persist(PARTN(rep, p)->is_dev_dax, next_hdrp,
+                               sizeof(*next_hdrp));
+
+       }
+       return 0;
+}
+
+/*
+ * update_replicas_linkage -- (internal) update uuids linking replicas
+ */
+static int
+update_replicas_linkage(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_replica *prev_r = REPP(set, repn);
+       struct pool_replica *next_r = REPN(set, repn);
+
+       ASSERT(rep->nparts > 0);
+       ASSERT(prev_r->nparts > 0);
+       ASSERT(next_r->nparts > 0);
+
+       /* set uuids in the current replica */
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               struct pool_hdr *hdrp = HDR(rep, p);
+               memcpy(hdrp->prev_repl_uuid, PART(prev_r, 0)->uuid,
+                               POOL_HDR_UUID_LEN);
+               memcpy(hdrp->next_repl_uuid, PART(next_r, 0)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum,
+                       1, POOL_HDR_CSUM_END_OFF(hdrp));
+
+               /* store pool's header */
+               util_persist(PART(rep, p)->is_dev_dax, hdrp, sizeof(*hdrp));
+       }
+
+       /* set uuids in the previous replica */
+       for (unsigned p = 0; p < prev_r->nhdrs; ++p) {
+               struct pool_hdr *prev_hdrp = HDR(prev_r, p);
+               memcpy(prev_hdrp->next_repl_uuid, PART(rep, 0)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(prev_hdrp, sizeof(*prev_hdrp),
+                       &prev_hdrp->checksum, 1,
+                       POOL_HDR_CSUM_END_OFF(prev_hdrp));
+
+               /* store pool's header */
+               util_persist(PART(prev_r, p)->is_dev_dax, prev_hdrp,
+                               sizeof(*prev_hdrp));
+       }
+
+       /* set uuids in the next replica */
+       for (unsigned p = 0; p < next_r->nhdrs; ++p) {
+               struct pool_hdr *next_hdrp = HDR(next_r, p);
+
+               memcpy(next_hdrp->prev_repl_uuid, PART(rep, 0)->uuid,
+                               POOL_HDR_UUID_LEN);
+               util_checksum(next_hdrp, sizeof(*next_hdrp),
+                       &next_hdrp->checksum, 1,
+                       POOL_HDR_CSUM_END_OFF(next_hdrp));
+
+               /* store pool's header */
+               util_persist(PART(next_r, p)->is_dev_dax, next_hdrp,
+                               sizeof(*next_hdrp));
+       }
+
+       return 0;
+}
+
+/*
+ * update_poolset_uuids -- (internal) update poolset uuid in recreated parts
+ */
+static int
+update_poolset_uuids(struct pool_set *set, unsigned repn,
+               struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, repn %u, set_hs %p", set, repn, set_hs);
+       struct pool_replica *rep = REP(set, repn);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               struct pool_hdr *hdrp = HDR(rep, p);
+               memcpy(hdrp->poolset_uuid, set->uuid, POOL_HDR_UUID_LEN);
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum,
+                       1, POOL_HDR_CSUM_END_OFF(hdrp));
+
+               /* store pool's header */
+               util_persist(PART(rep, p)->is_dev_dax, hdrp, sizeof(*hdrp));
+       }
+       return 0;
+}
+
+/*
+ * update_remote_headers -- (internal) update headers of existing remote
+ *                          replicas
+ */
+static int
+update_remote_headers(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               /* skip local or just created replicas */
+               if (REP(set, r)->remote == NULL ||
+                               PART(REP(set, r), 0)->created == 1)
+                       continue;
+
+               if (util_update_remote_header(set, r)) {
+                       LOG(1,
+                           "updating header of a remote replica no. %u failed",
+                           r);
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * update_uuids -- (internal) set all uuids that might have changed or be unset
+ *                 after recreating parts
+ */
+static int
+update_uuids(struct pool_set *set, struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               if (!replica_is_replica_healthy(r, set_hs))
+                       update_parts_linkage(set, r, set_hs);
+
+               update_replicas_linkage(set, r);
+               update_poolset_uuids(set, r, set_hs);
+       }
+
+       if (update_remote_headers(set))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * remove_remote -- (internal) remove remote pool
+ */
+static int
+remove_remote(const char *target, const char *pool_set)
+{
+       LOG(3, "target %s, pool_set %s", target, pool_set);
+#ifdef USE_RPMEM
+       struct rpmem_target_info *info = rpmem_target_parse(target);
+       if (!info)
+               goto err_parse;
+
+       struct rpmem_ssh *ssh = rpmem_ssh_exec(info, "--remove",
+                       pool_set, "--force", NULL);
+       if (!ssh) {
+               goto err_ssh_exec;
+       }
+
+       if (rpmem_ssh_monitor(ssh, 0))
+               goto err_ssh_monitor;
+
+       int ret = rpmem_ssh_close(ssh);
+       rpmem_target_free(info);
+
+       return ret;
+err_ssh_monitor:
+       rpmem_ssh_close(ssh);
+err_ssh_exec:
+       rpmem_target_free(info);
+err_parse:
+       return -1;
+#else
+       FATAL("remote replication not supported");
+       return -1;
+#endif
+}
+
+/*
+ * open_remote_replicas -- (internal) open all unbroken remote replicas
+ */
+static int
+open_remote_replicas(struct pool_set *set,
+       struct poolset_health_status *set_hs)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (!rep->remote)
+                       continue;
+               if (!replica_is_replica_healthy(r, set_hs))
+                       continue;
+
+               unsigned nlanes = REMOTE_NLANES;
+               int ret = util_poolset_remote_replica_open(set, r,
+                               set->poolsize, 0, &nlanes);
+               if (ret) {
+                       LOG(1, "Opening '%s' on '%s' failed",
+                                       rep->remote->pool_desc,
+                                       rep->remote->node_addr);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * create_remote_replicas -- (internal) recreate all broken replicas
+ */
+static int
+create_remote_replicas(struct pool_set *set,
+       struct poolset_health_status *set_hs, unsigned flags)
+{
+       LOG(3, "set %p, set_hs %p", set, set_hs);
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               if (!rep->remote)
+                       continue;
+               if (replica_is_replica_healthy(r, set_hs))
+                       continue;
+
+               if (!replica_is_poolset_transformed(flags)) {
+                       /* ignore errors from remove operation */
+                       remove_remote(rep->remote->node_addr,
+                                       rep->remote->pool_desc);
+               }
+
+               unsigned nlanes = REMOTE_NLANES;
+               int ret = util_poolset_remote_replica_open(set, r,
+                               set->poolsize, 1, &nlanes);
+               if (ret) {
+                       LOG(1, "Creating '%s' on '%s' failed",
+                                       rep->remote->pool_desc,
+                                       rep->remote->node_addr);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * sync_replica -- synchronize data across replicas within a poolset
+ */
+int
+replica_sync(struct pool_set *set, struct poolset_health_status *s_hs,
+               unsigned flags)
+{
+       LOG(3, "set %p, flags %u", set, flags);
+       int ret = 0;
+       struct poolset_health_status *set_hs = NULL;
+
+       /* check if we already know the poolset health status */
+       if (s_hs == NULL) {
+               /* validate poolset before checking its health */
+               if (validate_args(set))
+                       return -1;
+
+               /* examine poolset's health */
+               if (replica_check_poolset_health(set, &set_hs,
+                                               1 /* called from sync */,
+                                               flags)) {
+                       LOG(1, "poolset health check failed");
+                       return -1;
+               }
+
+               /* check if poolset is broken; if not, nothing to do */
+               if (replica_is_poolset_healthy(set_hs)) {
+                       LOG(1, "poolset is healthy");
+                       goto out;
+               }
+       } else {
+               set_hs = s_hs;
+       }
+
+       /* find a replica with healthy header; it will be the source of data */
+       unsigned healthy_replica = replica_find_healthy_replica(set_hs);
+       unsigned healthy_header = healthy_replica;
+       if (healthy_header == UNDEF_REPLICA) {
+               healthy_header = replica_find_replica_healthy_header(set_hs);
+               if (healthy_header == UNDEF_REPLICA) {
+                       ERR("no healthy replica found");
+                       errno = EINVAL;
+                       ret = -1;
+                       goto out;
+               }
+       }
+
+       /* in dry-run mode we can stop here */
+       if (is_dry_run(flags)) {
+               LOG(1, "Sync in dry-run mode finished successfully");
+               goto out;
+       }
+
+       /* recreate broken parts */
+       if (recreate_broken_parts(set, set_hs, fix_bad_blocks(flags))) {
+               ERR("recreating broken parts failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* open all part files */
+       if (replica_open_poolset_part_files(set)) {
+               ERR("opening poolset part files failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* map all replicas */
+       if (util_poolset_open(set)) {
+               ERR("opening poolset failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* this is required for opening remote pools */
+       set->poolsize = set_hs->replica[healthy_header]->pool_size;
+       LOG(3, "setting the pool size (%zu) from replica #%u",
+               set->poolsize, healthy_header);
+
+       /* open all remote replicas */
+       if (open_remote_replicas(set, set_hs)) {
+               ERR("opening remote replicas failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* recalculate offset and length of bad blocks */
+       if (sync_recalc_badblocks(set, set_hs)) {
+               LOG(1, "syncing bad blocks data failed");
+               ret = -1;
+               goto out;
+       }
+
+       /*
+        * Check if there are uncorrectable bad blocks
+        * (bad blocks overlapping in all replicas).
+        */
+       int status = sync_check_bad_blocks_overlap(set, set_hs);
+       if (status == -1) {
+               LOG(1, "checking bad blocks failed");
+               ret = -1;
+               goto out;
+       }
+
+       if (status == 1) {
+               ERR(
+                       "a part of the pool has uncorrectable errors in all replicas");
+               errno = EINVAL;
+               ret = -1;
+               goto out;
+       }
+
+       LOG(3, "bad blocks do not overlap");
+
+       /* sync data in bad blocks */
+       if (sync_badblocks_data(set, set_hs)) {
+               LOG(1, "syncing bad blocks data failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* find one good replica; it will be the source of data */
+       healthy_replica = replica_find_healthy_replica(set_hs);
+       if (healthy_replica == UNDEF_REPLICA) {
+               ERR("no healthy replica found");
+               errno = EINVAL;
+               ret = -1;
+               goto out;
+       }
+
+       /* update uuid fields in the set structure with part headers */
+       if (fill_struct_uuids(set, healthy_replica, set_hs, flags)) {
+               ERR("gathering uuids failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* create headers for broken parts */
+       if (create_headers_for_broken_parts(set, healthy_replica, set_hs)) {
+               ERR("creating headers for broken parts failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* create all remote replicas */
+       if (create_remote_replicas(set, set_hs, flags)) {
+               ERR("creating remote replicas failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* check and copy data if possible */
+       if (copy_data_to_broken_parts(set, healthy_replica,
+                       flags, set_hs)) {
+               ERR("copying data to broken parts failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* update uuids of replicas and parts */
+       if (update_uuids(set, set_hs)) {
+               ERR("updating uuids failed");
+               ret = -1;
+               goto out;
+       }
+
+       /* grant permissions to all created parts */
+       if (grant_created_parts_perm(set, healthy_replica, set_hs)) {
+               ERR("granting permissions to created parts failed");
+               ret = -1;
+       }
+
+out:
+       if (s_hs == NULL)
+               replica_free_poolset_health_status(set_hs);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/libpmempool/transform.c b/ceph/src/pmdk/src/libpmempool/transform.c
new file mode 100644 (file)
index 0000000..5d777de
--- /dev/null
@@ -0,0 +1,1017 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * transform.c -- a module for poolset transforming
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <dirent.h>
+#include <assert.h>
+
+#include "replica.h"
+#include "out.h"
+#include "file.h"
+#include "os.h"
+#include "libpmem.h"
+#include "util_pmem.h"
+
+/*
+ * poolset_compare_status - a helping structure for gathering corresponding
+ *                          replica numbers when comparing poolsets
+ */
+struct poolset_compare_status
+{
+       unsigned nreplicas;
+       unsigned flags;
+       unsigned replica[];
+};
+
+/*
+ * type of transform operation to be done
+ */
+enum transform_op {
+       NOT_TRANSFORMABLE,
+       ADD_REPLICAS,
+       RM_REPLICAS,
+       ADD_HDRS,
+       RM_HDRS,
+};
+
+/*
+ * check_if_part_used_once -- (internal) check if the part is used only once in
+ *                            the rest of the poolset
+ */
+static int
+check_if_part_used_once(struct pool_set *set, unsigned repn, unsigned partn)
+{
+       LOG(3, "set %p, repn %u, partn %u", set, repn, partn);
+       struct pool_replica *rep = REP(set, repn);
+       char *path = util_part_realpath(PART(rep, partn)->path);
+       if (path == NULL) {
+               LOG(1, "cannot get absolute path for %s, replica %u, part %u",
+                               PART(rep, partn)->path, repn, partn);
+               errno = 0;
+               path = strdup(PART(rep, partn)->path);
+               if (path == NULL) {
+                       ERR("!strdup");
+                       return -1;
+               }
+       }
+       int ret = 0;
+       for (unsigned r = repn; r < set->nreplicas; ++r) {
+               struct pool_replica *repr = set->replica[r];
+               /* skip remote replicas */
+               if (repr->remote != NULL)
+                       continue;
+
+               /* avoid superfluous comparisons */
+               unsigned i = (r == repn) ? partn + 1 : 0;
+               for (unsigned p = i; p < repr->nparts; ++p) {
+                       char *pathp = util_part_realpath(PART(repr, p)->path);
+                       if (pathp == NULL) {
+                               if (errno != ENOENT) {
+                                       ERR("realpath failed for %s, errno %d",
+                                               PART(repr, p)->path, errno);
+                                       ret = -1;
+                                       goto out;
+                               }
+                               LOG(1, "cannot get absolute path for %s,"
+                                               " replica %u, part %u",
+                                               PART(rep, partn)->path, repn,
+                                               partn);
+                               pathp = strdup(PART(repr, p)->path);
+                               errno = 0;
+                       }
+                       int result = util_compare_file_inodes(path, pathp);
+                       if (result == 0) {
+                               /* same file used multiple times */
+                               ERR("some part file's path is"
+                                               " used multiple times");
+                               ret = -1;
+                               errno = EINVAL;
+                               free(pathp);
+                               goto out;
+                       } else if (result < 0) {
+                               ERR("comparing file inodes failed for %s and"
+                                               " %s", path, pathp);
+                               ret = -1;
+                               free(pathp);
+                               goto out;
+                       }
+                       free(pathp);
+               }
+       }
+out:
+       free(path);
+       return ret;
+}
+
+/*
+ * check_if_remote_replica_used_once -- (internal) check if remote replica is
+ *                                      used only once in the rest of the
+ *                                      poolset
+ */
+static int
+check_if_remote_replica_used_once(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct remote_replica *rep = REP(set, repn)->remote;
+       ASSERTne(rep, NULL);
+       for (unsigned r = repn + 1; r < set->nreplicas; ++r) {
+               /* skip local replicas */
+               if (REP(set, r)->remote == NULL)
+                       continue;
+
+               struct remote_replica *repr = REP(set, r)->remote;
+               /* XXX: add comparing resolved addresses of the nodes */
+               if (strcmp(rep->node_addr, repr->node_addr) == 0 &&
+                               strcmp(rep->pool_desc, repr->pool_desc) == 0) {
+                       ERR("remote replica %u is used multiple times", repn);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_paths -- (internal) check if directories for part files exist
+ *                and if paths for part files do not repeat in the poolset
+ */
+static int
+check_paths(struct pool_set *set)
+{
+       LOG(3, "set %p", set);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = set->replica[r];
+               if (rep->remote != NULL) {
+                       if (check_if_remote_replica_used_once(set, r))
+                               return -1;
+               } else {
+                       for (unsigned p = 0; p < rep->nparts; ++p) {
+                               if (replica_check_local_part_dir(set, r, p))
+                                       return -1;
+
+                               if (check_if_part_used_once(set, r, p))
+                                       return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * validate_args -- (internal) check whether passed arguments are valid
+ */
+static int
+validate_args(struct pool_set *set_in, struct pool_set *set_out)
+{
+       LOG(3, "set_in %p, set_out %p", set_in, set_out);
+
+       if (set_in->directory_based) {
+               ERR("transform of directory poolsets is not supported");
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * check if all parts in the target poolset are large enough
+        * (now replication works only for pmemobj pools)
+        */
+       if (replica_check_part_sizes(set_out, PMEMOBJ_MIN_POOL)) {
+               ERR("part sizes check failed");
+               return -1;
+       }
+
+       /*
+        * check if all directories for part files exist and if part files
+        * do not reoccur in the poolset
+        */
+       if (check_paths(set_out))
+               return -1;
+
+       /*
+        * check if set_out has enough size, i.e. if the target poolset
+        * structure has enough capacity to accommodate the effective size of
+        * the source poolset
+        */
+       ssize_t master_pool_size = replica_get_pool_size(set_in, 0);
+       if (master_pool_size < 0) {
+               ERR("getting pool size from master replica failed");
+               return -1;
+       }
+
+       if (set_out->poolsize < (size_t)master_pool_size) {
+               ERR("target poolset is too small");
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * create poolset_compare_status -- (internal) create structure for gathering
+ *                                  status of poolset comparison
+ */
+static int
+create_poolset_compare_status(struct pool_set *set,
+               struct poolset_compare_status **set_sp)
+{
+       LOG(3, "set %p, set_sp %p", set, set_sp);
+       struct poolset_compare_status *set_s;
+       set_s = Zalloc(sizeof(struct poolset_compare_status)
+                               + set->nreplicas * sizeof(unsigned));
+       if (set_s == NULL) {
+               ERR("!Zalloc for poolset status");
+               return -1;
+       }
+       for (unsigned r = 0; r < set->nreplicas; ++r)
+               set_s->replica[r] = UNDEF_REPLICA;
+
+       set_s->nreplicas = set->nreplicas;
+       *set_sp = set_s;
+       return 0;
+}
+
+/*
+ * compare_parts -- (internal) check if two parts can be considered the same
+ */
+static int
+compare_parts(struct pool_set_part *p1, struct pool_set_part *p2)
+{
+       LOG(3, "p1 %p, p2 %p", p1, p2);
+       LOG(4, "p1->path: %s, p1->filesize: %lu", p1->path, p1->filesize);
+       LOG(4, "p2->path: %s, p2->filesize: %lu", p2->path, p2->filesize);
+       return strcmp(p1->path, p2->path) || (p1->filesize != p2->filesize);
+}
+
+/*
+ * compare_replicas -- (internal) check if two replicas are different
+ */
+static int
+compare_replicas(struct pool_replica *r1, struct pool_replica *r2)
+{
+       LOG(3, "r1 %p, r2 %p", r1, r2);
+       LOG(4, "r1->nparts: %u, r2->nparts: %u", r1->nparts, r2->nparts);
+       /* both replicas are local */
+       if (r1->remote == NULL && r2->remote == NULL) {
+               if (r1->nparts != r2->nparts)
+                       return 1;
+
+               for (unsigned p = 0; p < r1->nparts; ++p) {
+                       if (compare_parts(&r1->part[p], &r2->part[p]))
+                               return 1;
+               }
+               return 0;
+       }
+       /* both replicas are remote */
+       if (r1->remote != NULL && r2->remote != NULL) {
+               return strcmp(r1->remote->node_addr, r2->remote->node_addr) ||
+                       strcmp(r1->remote->pool_desc, r2->remote->pool_desc);
+       }
+       /* a remote and a local replicas */
+       return 1;
+}
+
+/*
+ * check_compare_poolsets_status -- (internal) find different replicas between
+ *                                  two poolsets; for each replica which has
+ *                                  a counterpart in the other poolset store
+ *                                  the other replica's number in a helping
+ *                                  structure
+ */
+static int
+check_compare_poolsets_status(struct pool_set *set_in,
+               struct pool_set *set_out,
+               struct poolset_compare_status *set_in_s,
+               struct poolset_compare_status *set_out_s)
+{
+       LOG(3, "set_in %p, set_out %p, set_in_s %p, set_out_s %p", set_in,
+                       set_out, set_in_s, set_out_s);
+       for (unsigned ri = 0; ri < set_in->nreplicas; ++ri) {
+               struct pool_replica *rep_in = REP(set_in, ri);
+               for (unsigned ro = 0; ro < set_out->nreplicas; ++ro) {
+                       struct pool_replica *rep_out = REP(set_out, ro);
+                       LOG(1, "comparing rep_in %u with rep_out %u", ri, ro);
+                       /* skip different replicas */
+                       if (compare_replicas(rep_in, rep_out))
+                               continue;
+
+                       if (set_in_s->replica[ri] != UNDEF_REPLICA ||
+                                       set_out_s->replica[ro]
+                                               != UNDEF_REPLICA) {
+                               /* there are more than one counterparts */
+                               ERR("there are more then one corresponding"
+                                               " replicas; cannot transform");
+                               errno = EINVAL;
+                               return -1;
+                       }
+
+                       set_in_s->replica[ri] = ro;
+                       set_out_s->replica[ro] = ri;
+               }
+       }
+       return 0;
+}
+
+/*
+ * check_compare_poolset_options -- (internal) check poolset options
+ */
+static int
+check_compare_poolsets_options(struct pool_set *set_in,
+               struct pool_set *set_out,
+               struct poolset_compare_status *set_in_s,
+               struct poolset_compare_status *set_out_s)
+{
+       if (set_in->options & OPTION_SINGLEHDR)
+               set_in_s->flags |= OPTION_SINGLEHDR;
+
+       if (set_out->options & OPTION_SINGLEHDR)
+               set_out_s->flags |= OPTION_SINGLEHDR;
+
+       if ((set_in->options & OPTION_NOHDRS) ||
+                       (set_out->options & OPTION_NOHDRS)) {
+               errno = EINVAL;
+               ERR(
+               "the NOHDRS poolset option is not supported in local poolset files");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * compare_poolsets -- (internal) compare two poolsets; for each replica which
+ *                     has a counterpart in the other poolset store the other
+ *                     replica's number in a helping structure
+ */
+static int
+compare_poolsets(struct pool_set *set_in, struct pool_set *set_out,
+               struct poolset_compare_status **set_in_s,
+               struct poolset_compare_status **set_out_s)
+{
+       LOG(3, "set_in %p, set_out %p, set_in_s %p, set_out_s %p", set_in,
+                       set_out, set_in_s, set_out_s);
+       if (create_poolset_compare_status(set_in, set_in_s))
+               return -1;
+
+       if (create_poolset_compare_status(set_out, set_out_s))
+               goto err_free_in;
+
+       if (check_compare_poolsets_status(set_in, set_out, *set_in_s,
+                       *set_out_s))
+               goto err_free_out;
+
+       if (check_compare_poolsets_options(set_in, set_out, *set_in_s,
+                       *set_out_s))
+               goto err_free_out;
+
+       return 0;
+
+err_free_out:
+       Free(*set_out_s);
+err_free_in:
+       Free(*set_in_s);
+       return -1;
+}
+
+/*
+ * replica_counterpart -- (internal) returns index of a counterpart replica
+ */
+static unsigned
+replica_counterpart(unsigned repn,
+               struct poolset_compare_status *set_s)
+{
+       return set_s->replica[repn];
+}
+
+/*
+ * are_poolsets_transformable -- (internal) check if poolsets can be transformed
+ *                               one into the other; also gather info about
+ *                               replicas's health
+ */
+static enum transform_op
+identify_transform_operation(struct poolset_compare_status *set_in_s,
+               struct poolset_compare_status *set_out_s,
+               struct poolset_health_status *set_in_hs,
+               struct poolset_health_status *set_out_hs)
+{
+       LOG(3, "set_in_s %p, set_out_s %p", set_in_s, set_out_s);
+
+       int has_replica_to_keep = 0;
+       int is_removing_replicas = 0;
+       int is_adding_replicas = 0;
+
+       /* check if there are replicas to be removed */
+       for (unsigned r = 0; r < set_in_s->nreplicas; ++r) {
+               unsigned c = replica_counterpart(r, set_in_s);
+               if (c != UNDEF_REPLICA) {
+                       LOG(2, "replica %u has a counterpart %u", r,
+                                       set_in_s->replica[r]);
+                       has_replica_to_keep = 1;
+                       REP_HEALTH(set_out_hs, c)->pool_size =
+                                       REP_HEALTH(set_in_hs, r)->pool_size;
+               } else {
+                       LOG(2, "replica %u has no counterpart", r);
+                       is_removing_replicas = 1;
+               }
+       }
+
+       /* make sure we have at least one replica to keep */
+       if (!has_replica_to_keep) {
+               ERR("there must be at least one replica left");
+               return NOT_TRANSFORMABLE;
+       }
+
+       /* check if there are replicas to be added */
+       for (unsigned r = 0; r < set_out_s->nreplicas; ++r) {
+               if (replica_counterpart(r, set_out_s) == UNDEF_REPLICA) {
+                       LOG(2, "Replica %u from output set has no counterpart",
+                                       r);
+                       if (is_removing_replicas) {
+                               ERR(
+                               "adding and removing replicas at the same time is not allowed");
+                               return NOT_TRANSFORMABLE;
+                       }
+
+                       REP_HEALTH(set_out_hs, r)->flags |= IS_BROKEN;
+                       is_adding_replicas = 1;
+               }
+       }
+
+       /* check if there is anything to do */
+       if (!is_removing_replicas && !is_adding_replicas &&
+                       (set_in_s->flags & OPTION_SINGLEHDR) ==
+                               (set_out_s->flags & OPTION_SINGLEHDR)) {
+               ERR("both poolsets are equal");
+               return NOT_TRANSFORMABLE;
+       }
+
+       /* allow changing the SINGLEHDR option only as the sole operation */
+       if ((is_removing_replicas || is_adding_replicas) &&
+                       (set_in_s->flags & OPTION_SINGLEHDR) !=
+                               (set_out_s->flags & OPTION_SINGLEHDR)) {
+               ERR(
+               "cannot add/remove replicas and change the SINGLEHDR option at the same time");
+               return NOT_TRANSFORMABLE;
+       }
+
+       if (is_removing_replicas)
+               return RM_REPLICAS;
+
+       if (is_adding_replicas)
+               return ADD_REPLICAS;
+
+       if (set_out_s->flags & OPTION_SINGLEHDR)
+               return RM_HDRS;
+
+       if (set_in_s->flags & OPTION_SINGLEHDR)
+               return ADD_HDRS;
+
+       ASSERT(0);
+       return NOT_TRANSFORMABLE;
+}
+
+/*
+ * do_added_parts_exist -- (internal) check if any part of the replicas that are
+ *                         to be added (marked as broken) already exists
+ */
+static int
+do_added_parts_exist(struct pool_set *set,
+               struct poolset_health_status *set_hs)
+{
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               /* skip unbroken (i.e. not being added) replicas */
+               if (!replica_is_replica_broken(r, set_hs))
+                       continue;
+
+               struct pool_replica *rep = REP(set, r);
+
+               /* skip remote replicas */
+               if (rep->remote)
+                       continue;
+
+               for (unsigned p = 0; p < rep->nparts; ++p) {
+                       /* check if part file exists */
+                       int oerrno = errno;
+                       int exists = util_file_exists(rep->part[p].path);
+                       if (exists < 0)
+                               return -1;
+
+                       if (exists && !rep->part[p].is_dev_dax) {
+                               LOG(1, "part file %s exists",
+                                               rep->part[p].path);
+                               return 1;
+                       }
+                       errno = oerrno;
+               }
+       }
+       return 0;
+}
+
+/*
+ * delete_replicas -- (internal) delete replicas which do not have their
+ *                    counterpart set in the helping status structure
+ */
+static int
+delete_replicas(struct pool_set *set, struct poolset_compare_status *set_s)
+{
+       LOG(3, "set %p, set_s %p", set, set_s);
+       for (unsigned r = 0; r < set->nreplicas; ++r) {
+               struct pool_replica *rep = REP(set, r);
+               if (replica_counterpart(r, set_s) == UNDEF_REPLICA) {
+                       if (!rep->remote) {
+                               if (util_replica_close_local(rep, r,
+                                               DELETE_ALL_PARTS))
+                                       return -1;
+                       } else {
+                               if (util_replica_close_remote(rep, r,
+                                               DELETE_ALL_PARTS))
+                                       return -1;
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * copy_replica_data_fw -- (internal) copy data between replicas of two
+ *                         poolsets, starting from the beginning of the
+ *                         second part
+ */
+static void
+copy_replica_data_fw(struct pool_set *set_dst, struct pool_set *set_src,
+               unsigned repn)
+{
+       LOG(3, "set_in %p, set_out %p, repn %u", set_src, set_dst, repn);
+       ssize_t pool_size = replica_get_pool_size(set_src, repn);
+       if (pool_size < 0) {
+               LOG(1, "getting pool size from replica %u failed", repn);
+               pool_size = (ssize_t)set_src->poolsize;
+       }
+
+       size_t len = (size_t)pool_size - POOL_HDR_SIZE -
+                       replica_get_part_data_len(set_src, repn, 0);
+       void *src = PART(REP(set_src, repn), 1)->addr;
+       void *dst = PART(REP(set_dst, repn), 1)->addr;
+       size_t count = len / POOL_HDR_SIZE;
+       while (count-- > 0) {
+               pmem_memcpy_persist(dst, src, POOL_HDR_SIZE);
+               src = ADDR_SUM(src, POOL_HDR_SIZE);
+               dst = ADDR_SUM(dst, POOL_HDR_SIZE);
+       }
+}
+
+/*
+ * copy_replica_data_bw -- (internal) copy data between replicas of two
+ *                         poolsets, starting from the end of the pool
+ */
+static void
+copy_replica_data_bw(struct pool_set *set_dst, struct pool_set *set_src,
+               unsigned repn)
+{
+       LOG(3, "set_in %p, set_out %p, repn %u", set_src, set_dst, repn);
+       ssize_t pool_size = replica_get_pool_size(set_src, repn);
+       if (pool_size < 0) {
+               LOG(1, "getting pool size from replica %u failed", repn);
+               pool_size = (ssize_t)set_src->poolsize;
+       }
+
+       size_t len = (size_t)pool_size - POOL_HDR_SIZE -
+                       replica_get_part_data_len(set_src, repn, 0);
+       size_t count = len / POOL_HDR_SIZE;
+       void *src = ADDR_SUM(PART(REP(set_src, repn), 1)->addr, len);
+       void *dst = ADDR_SUM(PART(REP(set_dst, repn), 1)->addr, len);
+       while (count-- > 0) {
+               src = ADDR_SUM(src, -(ssize_t)POOL_HDR_SIZE);
+               dst = ADDR_SUM(dst, -(ssize_t)POOL_HDR_SIZE);
+               pmem_memcpy_persist(dst, src, POOL_HDR_SIZE);
+       }
+}
+
+/*
+ * create_missing_headers -- (internal) create headers for all parts but the
+ *                           first one
+ */
+static int
+create_missing_headers(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_hdr *src_hdr = HDR(REP(set, repn), 0);
+       for (unsigned p = 1; p < set->replica[repn]->nhdrs; ++p) {
+               struct pool_attr attr;
+               util_pool_hdr2attr(&attr, src_hdr);
+               attr.features.incompat &= (uint32_t)(~POOL_FEAT_SINGLEHDR);
+               if (util_header_create(set, repn, p, &attr, 1) != 0) {
+                       LOG(1, "part headers create failed for"
+                                       " replica %u part %u", repn, p);
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * update_replica_header -- (internal) update field values in the first header
+ *                          in the replica
+ */
+static void
+update_replica_header(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_set_part *part = PART(REP(set, repn), 0);
+       struct pool_hdr *hdr = (struct pool_hdr *)part->hdr;
+       if (set->options & OPTION_SINGLEHDR) {
+               hdr->features.incompat |= POOL_FEAT_SINGLEHDR;
+               memcpy(hdr->next_part_uuid, hdr->uuid, POOL_HDR_UUID_LEN);
+               memcpy(hdr->prev_part_uuid, hdr->uuid, POOL_HDR_UUID_LEN);
+       } else {
+               hdr->features.incompat &= (uint32_t)(~POOL_FEAT_SINGLEHDR);
+
+       }
+       util_checksum(hdr, sizeof(*hdr), &hdr->checksum, 1,
+               POOL_HDR_CSUM_END_OFF(hdr));
+       util_persist_auto(rep->is_pmem, hdr, sizeof(*hdr));
+}
+
+/*
+ * fill_replica_struct_uuids -- (internal) gather all uuids required for the
+ *                              replica in the helper structure
+ */
+static int
+fill_replica_struct_uuids(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_replica *rep = REP(set, repn);
+       memcpy(PART(rep, 0)->uuid, HDR(rep, 0)->uuid, POOL_HDR_UUID_LEN);
+       for (unsigned p = 1; p < rep->nhdrs; ++p) {
+               if (util_uuid_generate(rep->part[p].uuid) < 0) {
+                       ERR("cannot generate part UUID");
+                       errno = EINVAL;
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * update_uuids -- (internal) update uuids in all headers in the replica
+ */
+static void
+update_uuids(struct pool_set *set, unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set, repn);
+       struct pool_replica *rep = REP(set, repn);
+       struct pool_hdr *hdr0 = HDR(rep, 0);
+       for (unsigned p = 0; p < rep->nhdrs; ++p) {
+               struct pool_hdr *hdrp = HDR(rep, p);
+               memcpy(hdrp->next_part_uuid, PARTN(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+               memcpy(hdrp->prev_part_uuid, PARTP(rep, p)->uuid,
+                               POOL_HDR_UUID_LEN);
+
+               /* Avoid calling memcpy() on identical regions */
+               if (p != 0) {
+                       memcpy(hdrp->next_repl_uuid, hdr0->next_repl_uuid,
+                                       POOL_HDR_UUID_LEN);
+                       memcpy(hdrp->prev_repl_uuid, hdr0->prev_repl_uuid,
+                                       POOL_HDR_UUID_LEN);
+                       memcpy(hdrp->poolset_uuid, hdr0->poolset_uuid,
+                                       POOL_HDR_UUID_LEN);
+               }
+
+               util_checksum(hdrp, sizeof(*hdrp), &hdrp->checksum, 1,
+                       POOL_HDR_CSUM_END_OFF(hdrp));
+               util_persist(PART(rep, p)->is_dev_dax, hdrp, sizeof(*hdrp));
+       }
+}
+
+/*
+ * copy_part_fds -- (internal) copy poolset part file descriptors between
+ *                  two poolsets
+ */
+static void
+copy_part_fds(struct pool_set *set_dst, struct pool_set *set_src)
+{
+       ASSERTeq(set_src->nreplicas, set_dst->nreplicas);
+       for (unsigned r = 0; r < set_dst->nreplicas; ++r) {
+               ASSERTeq(REP(set_src, r)->nparts, REP(set_dst, r)->nparts);
+               for (unsigned p = 0; p < REP(set_dst, r)->nparts; ++p) {
+                       PART(REP(set_dst, r), p)->fd =
+                                       PART(REP(set_src, r), p)->fd;
+               }
+       }
+
+}
+
+/*
+ * remove_hdrs_replica -- (internal) remove headers from the replica
+ */
+static int
+remove_hdrs_replica(struct pool_set *set_in, struct pool_set *set_out,
+               unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set_in, repn);
+       int ret = 0;
+
+       /* open all part files of the input replica */
+       if (replica_open_replica_part_files(set_in, repn)) {
+               LOG(1, "opening replica %u, part files failed", repn);
+               ret = -1;
+               goto out;
+       }
+
+       /* share part file descriptors between poolset structures */
+       copy_part_fds(set_out, set_in);
+
+       /* map the whole input replica */
+       if (util_replica_open(set_in, repn, MAP_SHARED)) {
+               LOG(1, "opening input replica failed: replica %u", repn);
+               ret = -1;
+               goto out_close;
+       }
+
+       /* map the whole output replica */
+       if (util_replica_open(set_out, repn, MAP_SHARED)) {
+               LOG(1, "opening output replica failed: replica %u", repn);
+               ret = -1;
+               goto out_unmap_in;
+       }
+
+       /* move data between the two mappings of the replica */
+       if (REP(set_in, repn)->nparts > 1)
+               copy_replica_data_fw(set_out, set_in, repn);
+
+       /* make changes to the first part's header */
+       update_replica_header(set_out, repn);
+
+       util_replica_close(set_out, repn);
+out_unmap_in:
+       util_replica_close(set_in, repn);
+out_close:
+       util_replica_fdclose(REP(set_in, repn));
+out:
+       return ret;
+}
+
+/*
+ * add_hdrs_replica -- (internal) add lacking headers to the replica
+ *
+ * when the operation fails and returns -1, the replica remains untouched
+ */
+static int
+add_hdrs_replica(struct pool_set *set_in, struct pool_set *set_out,
+               unsigned repn)
+{
+       LOG(3, "set %p, repn %u", set_in, repn);
+       int ret = 0;
+
+       /* open all part files of the input replica */
+       if (replica_open_replica_part_files(set_in, repn)) {
+               LOG(1, "opening replica %u, part files failed", repn);
+               ret = -1;
+               goto out;
+       }
+
+       /* share part file descriptors between poolset structures */
+       copy_part_fds(set_out, set_in);
+
+       /* map the whole input replica */
+       if (util_replica_open(set_in, repn, MAP_SHARED)) {
+               LOG(1, "opening input replica failed: replica %u", repn);
+               ret = -1;
+               goto out_close;
+       }
+
+       /* map the whole output replica */
+       if (util_replica_open(set_out, repn, MAP_SHARED)) {
+               LOG(1, "opening output replica failed: replica %u", repn);
+               ret = -1;
+               goto out_unmap_in;
+       }
+
+       /* generate new uuids for lacking headers */
+       if (fill_replica_struct_uuids(set_out, repn)) {
+               LOG(1, "generating lacking uuids for parts failed: replica %u",
+                               repn);
+               ret = -1;
+               goto out_unmap_out;
+       }
+
+       /* copy data between the two mappings of the replica */
+       if (REP(set_in, repn)->nparts > 1)
+               copy_replica_data_bw(set_out, set_in, repn);
+
+       /* create the missing headers */
+       if (create_missing_headers(set_out, repn)) {
+               LOG(1, "creating lacking headers failed: replica %u", repn);
+               /*
+                * copy the data back, so we could fall back to the original
+                * state
+                */
+               if (REP(set_in, repn)->nparts > 1)
+                       copy_replica_data_fw(set_in, set_out, repn);
+               ret = -1;
+               goto out_unmap_out;
+       }
+
+       /* make changes to the first part's header */
+       update_replica_header(set_out, repn);
+
+       /* store new uuids in all headers and update linkage in the replica */
+       update_uuids(set_out, repn);
+
+out_unmap_out:
+       util_replica_close(set_out, repn);
+out_unmap_in:
+       util_replica_close(set_in, repn);
+out_close:
+       util_replica_fdclose(REP(set_in, repn));
+out:
+       return ret;
+}
+
+/*
+ * remove_hdrs -- (internal) transform a poolset without the SINGLEHDR option
+ *                (with headers) into a poolset with the SINGLEHDR option
+ *                (without headers)
+ */
+static int
+remove_hdrs(struct pool_set *set_in, struct pool_set *set_out,
+               struct poolset_health_status *set_in_hs, unsigned flags)
+{
+       LOG(3, "set_in %p, set_out %p, set_in_hs %p, flags %u",
+                       set_in, set_out, set_in_hs, flags);
+       for (unsigned r = 0; r < set_in->nreplicas; ++r) {
+               if (remove_hdrs_replica(set_in, set_out, r)) {
+                       LOG(1, "removing headers from replica %u failed", r);
+                       /* mark all previous replicas as damaged */
+                       while (--r < set_in->nreplicas)
+                               REP_HEALTH(set_in_hs, r)->flags |= IS_BROKEN;
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * add_hdrs -- (internal) transform a poolset with the SINGLEHDR option (without
+ *             headers) into a poolset without the SINGLEHDR option (with
+ *             headers)
+ */
+static int
+add_hdrs(struct pool_set *set_in, struct pool_set *set_out,
+               struct poolset_health_status *set_in_hs,
+               unsigned flags)
+{
+       LOG(3, "set_in %p, set_out %p, set_in_hs %p, flags %u",
+                       set_in, set_out, set_in_hs, flags);
+       for (unsigned r = 0; r < set_in->nreplicas; ++r) {
+               if (add_hdrs_replica(set_in, set_out, r)) {
+                       LOG(1, "adding headers to replica %u failed", r);
+                       /* mark all previous replicas as damaged */
+                       while (--r < set_in->nreplicas)
+                               REP_HEALTH(set_in_hs, r)->flags |= IS_BROKEN;
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * transform_replica -- transforming one poolset into another
+ */
+int
+replica_transform(struct pool_set *set_in, struct pool_set *set_out,
+               unsigned flags)
+{
+       LOG(3, "set_in %p, set_out %p", set_in, set_out);
+
+       int ret = 0;
+       /* validate user arguments */
+       if (validate_args(set_in, set_out))
+               return -1;
+
+       /* check if the source poolset is healthy */
+       struct poolset_health_status *set_in_hs = NULL;
+       if (replica_check_poolset_health(set_in, &set_in_hs,
+                                       0 /* called from transform */, flags)) {
+               ERR("source poolset health check failed");
+               return -1;
+       }
+
+       if (!replica_is_poolset_healthy(set_in_hs)) {
+               ERR("source poolset is broken");
+               ret = -1;
+               errno = EINVAL;
+               goto free_hs_in;
+       }
+
+       /* copy value of the ignore_sds flag from the input poolset */
+       set_out->ignore_sds = set_in->ignore_sds;
+
+       struct poolset_health_status *set_out_hs = NULL;
+       if (replica_create_poolset_health_status(set_out, &set_out_hs)) {
+               ERR("creating poolset health status failed");
+               ret = -1;
+               goto free_hs_in;
+       }
+
+       /* check if the poolsets are transformable */
+       struct poolset_compare_status *set_in_cs = NULL;
+       struct poolset_compare_status *set_out_cs = NULL;
+       if (compare_poolsets(set_in, set_out, &set_in_cs, &set_out_cs)) {
+               ERR("comparing poolsets failed");
+               ret = -1;
+               goto free_hs_out;
+       }
+
+       enum transform_op operation = identify_transform_operation(set_in_cs,
+                       set_out_cs, set_in_hs, set_out_hs);
+
+       if (operation == NOT_TRANSFORMABLE) {
+               LOG(1, "poolsets are not transformable");
+               ret = -1;
+               errno = EINVAL;
+               goto free_cs;
+       }
+
+       if (operation == RM_HDRS) {
+               if (!is_dry_run(flags) &&
+                               remove_hdrs(set_in, set_out, set_in_hs,
+                                               flags)) {
+                       ERR("removing headers failed; falling back to the "
+                                       "input poolset");
+                       if (replica_sync(set_in, set_in_hs,
+                                       flags | IS_TRANSFORMED)) {
+                               LOG(1, "falling back to the input poolset "
+                                               "failed");
+                       } else {
+                               LOG(1, "falling back to the input poolset "
+                                               "succeeded");
+                       }
+                       ret = -1;
+               }
+               goto free_cs;
+       }
+
+       if (operation == ADD_HDRS) {
+               if (!is_dry_run(flags) &&
+                               add_hdrs(set_in, set_out, set_in_hs, flags)) {
+                       ERR("adding headers failed; falling back to the "
+                                       "input poolset");
+                       if (replica_sync(set_in, set_in_hs,
+                                       flags | IS_TRANSFORMED)) {
+                               LOG(1, "falling back to the input poolset "
+                                               "failed");
+                       } else {
+                               LOG(1, "falling back to the input poolset "
+                                               "succeeded");
+                       }
+                       ret = -1;
+               }
+               goto free_cs;
+       }
+
+       if (operation == ADD_REPLICAS) {
+               /*
+                * check if any of the parts that are to be added already exists
+                */
+               if (do_added_parts_exist(set_out, set_out_hs)) {
+                       ERR("some parts being added already exist");
+                       ret = -1;
+                       errno = EINVAL;
+                       goto free_cs;
+               }
+       }
+
+       /* signal that sync is called by transform */
+       if (replica_sync(set_out, set_out_hs, flags | IS_TRANSFORMED)) {
+               ret = -1;
+               goto free_cs;
+       }
+
+       if (operation == RM_REPLICAS) {
+               if (!is_dry_run(flags) && delete_replicas(set_in, set_in_cs))
+                       ret = -1;
+       }
+
+free_cs:
+       Free(set_in_cs);
+       Free(set_out_cs);
+free_hs_out:
+       replica_free_poolset_health_status(set_out_hs);
+free_hs_in:
+       replica_free_poolset_health_status(set_in_hs);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/librpmem/Makefile b/ceph/src/pmdk/src/librpmem/Makefile
new file mode 100644 (file)
index 0000000..eeb1ee0
--- /dev/null
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# src/librpmem/Makefile -- Makefile for librpmem
+#
+include ../common.inc
+
+vpath %.c ../rpmem_common
+
+ifeq ($(BUILD_RPMEM),y)
+LIBRARY_NAME = rpmem
+LIBRARY_SO_VERSION = 1
+LIBRARY_VERSION = 0.0
+SOURCE = $(COMMON)/alloc.c\
+       $(COMMON)/os_posix.c\
+       $(COMMON)/os_thread_posix.c\
+       $(COMMON)/out.c\
+       $(COMMON)/util.c\
+       $(COMMON)/util_posix.c\
+       librpmem.c\
+       rpmem.c\
+       rpmem_obc.c\
+       rpmem_cmd.c\
+       rpmem_ssh.c\
+       rpmem_common.c\
+       rpmem_util.c\
+       rpmem_fip_common.c\
+       rpmem_fip.c
+
+else
+$(info NOTE: Skipping librpmem because $(BUILD_RPMEM_INFO))
+endif
+
+include ../Makefile.inc
+
+ifeq ($(BUILD_RPMEM),y)
+LIBS += -pthread
+LIBS += $(LIBFABRIC_LIBS)
+CFLAGS += $(LIBFABRIC_CFLAGS)
+CFLAGS += -I. -I../rpmem_common
+CFLAGS += -DRPMEMC_LOG_RPMEM
+endif
diff --git a/ceph/src/pmdk/src/librpmem/README b/ceph/src/pmdk/src/librpmem/README
new file mode 100644 (file)
index 0000000..a68cb72
--- /dev/null
@@ -0,0 +1,7 @@
+This directory contains a librpmem library which provides
+remote access to persistent memory over RDMA.
+
+** DEPENDENCIES: **
+The librpmem library depends on libfabric (version >= 1.4.2) library:
+
+https://github.com/ofiwg/libfabric
diff --git a/ceph/src/pmdk/src/librpmem/librpmem.c b/ceph/src/pmdk/src/librpmem/librpmem.c
new file mode 100644 (file)
index 0000000..0a0c548
--- /dev/null
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * librpmem.c -- entry points for librpmem
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "librpmem.h"
+
+#include "rpmem.h"
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+#include "rpmem_fip.h"
+#include "util.h"
+#include "out.h"
+
+/*
+ * librpmem_init -- load-time initialization for librpmem
+ *
+ * Called automatically by the run-time loader.
+ */
+ATTR_CONSTRUCTOR
+void
+librpmem_init(void)
+{
+       util_init();
+       out_init(RPMEM_LOG_PREFIX, RPMEM_LOG_LEVEL_VAR, RPMEM_LOG_FILE_VAR,
+                       RPMEM_MAJOR_VERSION, RPMEM_MINOR_VERSION);
+       LOG(3, NULL);
+       rpmem_util_cmds_init();
+
+       rpmem_util_get_env_max_nlanes(&Rpmem_max_nlanes);
+       rpmem_util_get_env_wq_size(&Rpmem_wq_size);
+}
+
+/*
+ * librpmem_fini -- librpmem cleanup routine
+ *
+ * Called automatically when the process terminates.
+ */
+ATTR_DESTRUCTOR
+void
+librpmem_fini(void)
+{
+       LOG(3, NULL);
+       rpmem_util_cmds_fini();
+       out_fini();
+}
+
+/*
+ * rpmem_check_version -- see if library meets application version requirements
+ */
+const char *
+rpmem_check_version(unsigned major_required, unsigned minor_required)
+{
+       LOG(3, "major_required %u minor_required %u",
+                       major_required, minor_required);
+
+       if (major_required != RPMEM_MAJOR_VERSION) {
+               ERR("librpmem major version mismatch (need %u, found %u)",
+                       major_required, RPMEM_MAJOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       if (minor_required > RPMEM_MINOR_VERSION) {
+               ERR("librpmem minor version mismatch (need %u, found %u)",
+                       minor_required, RPMEM_MINOR_VERSION);
+               return out_get_errormsg();
+       }
+
+       return NULL;
+}
+
+/*
+ * rpmem_errormsg -- return the last error message
+ */
+const char *
+rpmem_errormsg(void)
+{
+       return out_get_errormsg();
+}
diff --git a/ceph/src/pmdk/src/librpmem/librpmem.link.in b/ceph/src/pmdk/src/librpmem/librpmem.link.in
new file mode 100644 (file)
index 0000000..779f288
--- /dev/null
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2019, Intel Corporation
+#
+#
+# src/librpmem/librpmem.link -- linker link file for librpmem
+#
+LIBRPMEM_1.0 {
+       global:
+               rpmem_create;
+               rpmem_open;
+               rpmem_set_attr;
+               rpmem_close;
+               rpmem_remove;
+               rpmem_flush;
+               rpmem_drain;
+               rpmem_persist;
+               rpmem_deep_persist;
+               rpmem_read;
+               rpmem_check_version;
+               rpmem_errormsg;
+               fault_injection;
+       local:
+               *;
+};
diff --git a/ceph/src/pmdk/src/librpmem/rpmem.c b/ceph/src/pmdk/src/librpmem/rpmem.c
new file mode 100644 (file)
index 0000000..f2181d3
--- /dev/null
@@ -0,0 +1,914 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem.c -- main source file for librpmem
+ */
+#include <stdlib.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <errno.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include "librpmem.h"
+#include "out.h"
+#include "os.h"
+#include "os_thread.h"
+#include "util.h"
+#include "rpmem.h"
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+#include "rpmem_obc.h"
+#include "rpmem_fip.h"
+#include "rpmem_fip_common.h"
+#include "rpmem_ssh.h"
+#include "rpmem_proto.h"
+
+#define RPMEM_REMOVE_FLAGS_ALL (\
+       RPMEM_REMOVE_FORCE |    \
+       RPMEM_REMOVE_POOL_SET   \
+)
+
+#define RPMEM_CHECK_FORK() do {\
+if (Rpmem_fork_unsafe) {\
+       ERR("libfabric is initialized without fork() support");\
+       return NULL;\
+}\
+} while (0)
+
+static os_once_t Rpmem_fork_unsafe_key_once = OS_ONCE_INIT;
+
+/*
+ * rpmem_pool -- remote pool context
+ */
+struct rpmem_pool {
+       struct rpmem_obc *obc;          /* out-of-band connection handle */
+       struct rpmem_fip *fip;          /* fabric provider handle */
+       struct rpmem_target_info *info;
+       char fip_service[NI_MAXSERV];
+       enum rpmem_provider provider;
+       size_t max_wq_size;             /* max WQ size supported by provider */
+       os_thread_t monitor;
+       int closing;
+       int no_headers;
+       /*
+        * Last error code, need to be volatile because it can
+        * be accessed by multiple threads.
+        */
+       volatile int error;
+};
+
+/*
+ * env_get_bool -- parse value of specified environment variable as a bool
+ *
+ * Return values:
+ *  0 - defined, valp has value
+ *  1 - not defined
+ * -1 - parsing error
+ */
+static int
+env_get_bool(const char *name, int *valp)
+{
+       LOG(3, "name %s, valp %p", name, valp);
+
+       const char *env = os_getenv(name);
+       if (!env)
+               return 1;
+
+       char *endptr;
+       errno = 0;
+       long val = strtol(env, &endptr, 10);
+       if (*endptr != '\0' || errno)
+               goto err;
+
+       if (val < INT_MIN || val > INT_MAX)
+               goto err;
+
+       *valp = (int)val;
+
+       return 0;
+err:
+       RPMEM_LOG(ERR, "!parsing '%s' environment variable failed", name);
+       return -1;
+}
+
+/*
+ * rpmem_get_provider -- set provider based on node address and environment
+ */
+static int
+rpmem_set_provider(RPMEMpool *rpp, const char *node)
+{
+       LOG(3, "rpp %p, node %s", rpp, node);
+
+       struct rpmem_fip_probe probe;
+       enum rpmem_provider prov = RPMEM_PROV_UNKNOWN;
+
+       int ret = rpmem_fip_probe_get(node, &probe);
+       if (ret)
+               return -1;
+
+       /*
+        * The sockets provider can be used only if specified environment
+        * variable is set to 1.
+        */
+       if (rpmem_fip_probe(probe, RPMEM_PROV_LIBFABRIC_SOCKETS)) {
+               int enable;
+               ret = env_get_bool(RPMEM_PROV_SOCKET_ENV, &enable);
+               if (!ret && enable) {
+                       prov = RPMEM_PROV_LIBFABRIC_SOCKETS;
+               }
+       }
+
+       /*
+        * The verbs provider is enabled by default. If appropriate
+        * environment variable is set to 0, the verbs provider is disabled.
+        *
+        * The verbs provider has higher priority than sockets provider.
+        */
+       if (rpmem_fip_probe(probe, RPMEM_PROV_LIBFABRIC_VERBS)) {
+               int enable;
+               ret = env_get_bool(RPMEM_PROV_VERBS_ENV, &enable);
+               if (ret == 1 || (!ret && enable))
+                       prov = RPMEM_PROV_LIBFABRIC_VERBS;
+       }
+
+       if (prov == RPMEM_PROV_UNKNOWN)
+               return -1;
+
+       RPMEM_ASSERT(prov < MAX_RPMEM_PROV);
+       rpp->max_wq_size = probe.max_wq_size[prov];
+       rpp->provider = prov;
+
+       return 0;
+}
+
+/*
+ * rpmem_monitor_thread -- connection monitor background thread
+ */
+static void *
+rpmem_monitor_thread(void *arg)
+{
+       LOG(3, "arg %p", arg);
+
+       RPMEMpool *rpp = arg;
+
+       int ret = rpmem_obc_monitor(rpp->obc, 0);
+       if (ret && !rpp->closing) {
+               RPMEM_LOG(ERR, "unexpected data received");
+               rpp->error = errno;
+       }
+
+       return NULL;
+}
+
+/*
+ * rpmem_common_init -- common routine for initialization
+ */
+static RPMEMpool *
+rpmem_common_init(const char *target)
+{
+       LOG(3, "target %s", target);
+
+       int ret;
+
+       RPMEMpool *rpp = calloc(1, sizeof(*rpp));
+       if (!rpp) {
+               ERR("!calloc");
+               goto err_malloc_rpmem;
+       }
+
+       rpp->info = rpmem_target_parse(target);
+       if (!rpp->info) {
+               ERR("!parsing target node address failed");
+               goto err_target_split;
+       }
+
+       ret = rpmem_set_provider(rpp, rpp->info->node);
+       if (ret) {
+               errno = ENOMEDIUM;
+               ERR("cannot find provider");
+               goto err_provider;
+       }
+
+       RPMEM_LOG(NOTICE, "provider: %s", rpmem_provider_to_str(rpp->provider));
+
+       if (rpp->provider == RPMEM_PROV_LIBFABRIC_SOCKETS) {
+               /* libfabric's sockets provider does not support IPv6 */
+               RPMEM_LOG(NOTICE, "forcing using IPv4");
+               rpp->info->flags |= RPMEM_FLAGS_USE_IPV4;
+       }
+
+       rpp->obc = rpmem_obc_init();
+       if (!rpp->obc) {
+               ERR("!out-of-band connection initialization failed");
+               goto err_obc_init;
+       }
+
+       RPMEM_LOG(INFO, "establishing out-of-band connection");
+
+       ret = rpmem_obc_connect(rpp->obc, rpp->info);
+       if (ret) {
+               ERR("!out-of-band connection failed");
+               goto err_obc_connect;
+       }
+
+       RPMEM_LOG(NOTICE, "out-of-band connection established");
+
+       return rpp;
+err_obc_connect:
+       rpmem_obc_fini(rpp->obc);
+err_obc_init:
+err_provider:
+       rpmem_target_free(rpp->info);
+err_target_split:
+       free(rpp);
+err_malloc_rpmem:
+       return NULL;
+}
+
+/*
+ * rpmem_common_fini -- common routing for deinitialization
+ */
+static void
+rpmem_common_fini(RPMEMpool *rpp, int join)
+{
+       LOG(3, "rpp %p, join %d", rpp, join);
+
+       rpmem_obc_disconnect(rpp->obc);
+
+       if (join) {
+               int ret = os_thread_join(&rpp->monitor, NULL);
+               if (ret) {
+                       errno = ret;
+                       ERR("joining monitor thread failed");
+               }
+       }
+
+       rpmem_obc_fini(rpp->obc);
+
+       rpmem_target_free(rpp->info);
+       free(rpp);
+}
+
+/*
+ * rpmem_common_fip_init -- common routine for initializing fabric provider
+ */
+static int
+rpmem_common_fip_init(RPMEMpool *rpp, struct rpmem_req_attr *req,
+       struct rpmem_resp_attr *resp, void *pool_addr, size_t pool_size,
+       unsigned *nlanes, size_t buff_size)
+{
+       LOG(3, "rpp %p, req %p, resp %p, pool_addr %p, pool_size %zu, nlanes "
+                       "%p", rpp, req, resp, pool_addr, pool_size, nlanes);
+
+       int ret;
+
+       struct rpmem_fip_attr fip_attr = {
+               .provider       = req->provider,
+               .max_wq_size    = rpp->max_wq_size,
+               .persist_method = resp->persist_method,
+               .laddr          = pool_addr,
+               .size           = pool_size,
+               .buff_size      = buff_size,
+               .nlanes         = min(*nlanes, resp->nlanes),
+               .raddr          = (void *)resp->raddr,
+               .rkey           = resp->rkey,
+       };
+
+       ret = util_snprintf(rpp->fip_service, sizeof(rpp->fip_service),
+                       "%u", resp->port);
+       if (ret < 0) {
+               ERR("!snprintf");
+               goto err_port;
+       }
+
+       rpp->fip = rpmem_fip_init(rpp->info->node, rpp->fip_service,
+                       &fip_attr, nlanes);
+       if (!rpp->fip) {
+               ERR("!in-band connection initialization failed");
+               ret = -1;
+               goto err_fip_init;
+       }
+
+       RPMEM_LOG(NOTICE, "final nlanes: %u", *nlanes);
+       RPMEM_LOG(INFO, "establishing in-band connection");
+
+       ret = rpmem_fip_connect(rpp->fip);
+       if (ret) {
+               ERR("!establishing in-band connection failed");
+               goto err_fip_connect;
+       }
+
+       RPMEM_LOG(NOTICE, "in-band connection established");
+
+       return 0;
+err_fip_connect:
+       rpmem_fip_fini(rpp->fip);
+err_fip_init:
+err_port:
+       return ret;
+}
+
+/*
+ * rpmem_common_fip_fini -- common routine for deinitializing fabric provider
+ */
+static void
+rpmem_common_fip_fini(RPMEMpool *rpp)
+{
+       LOG(3, "rpp %p", rpp);
+
+       RPMEM_LOG(INFO, "closing in-band connection");
+
+       rpmem_fip_fini(rpp->fip);
+
+       RPMEM_LOG(NOTICE, "in-band connection closed");
+}
+
+/*
+ * rpmem_log_args -- log input arguments for rpmem_create and rpmem_open
+ */
+static void
+rpmem_log_args(const char *req, const char *target, const char *pool_set_name,
+       void *pool_addr, size_t pool_size, unsigned nlanes)
+{
+       LOG(3, "req %s, target %s, pool_set_name %s, pool_addr %p, pool_size "
+                       "%zu, nlanes %d", req, target, pool_set_name, pool_addr,
+                       pool_size, nlanes);
+
+       RPMEM_LOG(NOTICE, "%s request:", req);
+       RPMEM_LOG(NOTICE, "\ttarget: %s", target);
+       RPMEM_LOG(NOTICE, "\tpool set: %s", pool_set_name);
+       RPMEM_LOG(INFO, "\tpool addr: %p", pool_addr);
+       RPMEM_LOG(INFO, "\tpool size: %lu", pool_size);
+       RPMEM_LOG(NOTICE, "\tnlanes: %u", nlanes);
+}
+
+/*
+ * rpmem_log_resp -- log response attributes
+ */
+static void
+rpmem_log_resp(const char *req, const struct rpmem_resp_attr *resp)
+{
+       LOG(3, "req %s, resp %p", req, resp);
+
+       RPMEM_LOG(NOTICE, "%s request response:", req);
+       RPMEM_LOG(NOTICE, "\tnlanes: %u", resp->nlanes);
+       RPMEM_LOG(NOTICE, "\tport: %u", resp->port);
+       RPMEM_LOG(NOTICE, "\tpersist method: %s",
+                       rpmem_persist_method_to_str(resp->persist_method));
+       RPMEM_LOG(NOTICE, "\tremote addr: 0x%" PRIx64, resp->raddr);
+}
+
+/*
+ * rpmem_check_args -- validate user's arguments
+ */
+static int
+rpmem_check_args(void *pool_addr, size_t pool_size, unsigned *nlanes)
+{
+       LOG(3, "pool_addr %p, pool_size %zu, nlanes %p", pool_addr, pool_size,
+                       nlanes);
+
+       if (!pool_addr) {
+               errno = EINVAL;
+               ERR("invalid pool address");
+               return -1;
+       }
+
+       if (!IS_PAGE_ALIGNED((uintptr_t)pool_addr)) {
+               errno = EINVAL;
+               ERR("Pool address must be aligned to page size (%llu)",
+                               Pagesize);
+               return -1;
+       }
+
+       if (!IS_PAGE_ALIGNED(pool_size)) {
+               errno = EINVAL;
+               ERR("Pool size must be aligned to page size (%llu)",
+                               Pagesize);
+               return -1;
+       }
+
+       if (!pool_size) {
+               errno = EINVAL;
+               ERR("invalid pool size");
+               return -1;
+       }
+
+       if (!nlanes) {
+               errno = EINVAL;
+               ERR("lanes pointer cannot be NULL");
+               return -1;
+       }
+
+       if (!(*nlanes)) {
+               errno = EINVAL;
+               ERR("number of lanes must be positive");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_create -- create remote pool on target node
+ *
+ * target        -- target node in format [<user>@]<target_name>[:<port>]
+ * pool_set_name -- remote pool set name
+ * pool_addr     -- local pool memory address which will be replicated
+ * pool_size     -- required pool size
+ * nlanes        -- number of lanes
+ * create_attr   -- pool attributes used for creating the pool on remote node
+ */
+RPMEMpool *
+rpmem_create(const char *target, const char *pool_set_name,
+       void *pool_addr, size_t pool_size, unsigned *nlanes,
+       const struct rpmem_pool_attr *create_attr)
+{
+       LOG(3, "target %s, pool_set_name %s, pool_addr %p, pool_size %zu, "
+                       "nlanes %p, create_attr %p", target, pool_set_name,
+                       pool_addr, pool_size, nlanes, create_attr);
+
+       os_once(&Rpmem_fork_unsafe_key_once, &rpmem_fip_probe_fork_safety);
+       RPMEM_CHECK_FORK();
+
+       rpmem_log_args("create", target, pool_set_name,
+                       pool_addr, pool_size, *nlanes);
+
+       if (rpmem_check_args(pool_addr, pool_size, nlanes))
+               return NULL;
+
+       RPMEMpool *rpp = rpmem_common_init(target);
+       if (!rpp)
+               goto err_common_init;
+
+       size_t buff_size = RPMEM_DEF_BUFF_SIZE;
+       struct rpmem_req_attr req = {
+               .pool_size      = pool_size,
+               .nlanes         = min(*nlanes, Rpmem_max_nlanes),
+               .provider       = rpp->provider,
+               .pool_desc      = pool_set_name,
+               .buff_size      = buff_size,
+       };
+
+       struct rpmem_resp_attr resp;
+       int ret = rpmem_obc_create(rpp->obc, &req, &resp, create_attr);
+       if (ret) {
+               RPMEM_LOG(ERR, "!create request failed");
+               goto err_obc_create;
+       }
+
+       if (create_attr == NULL ||
+                       util_is_zeroed(create_attr, sizeof(*create_attr)))
+               rpp->no_headers = 1;
+
+       rpmem_log_resp("create", &resp);
+
+       ret = rpmem_common_fip_init(rpp, &req, &resp,
+                       pool_addr, pool_size, nlanes, buff_size);
+       if (ret)
+               goto err_fip_init;
+
+       ret = os_thread_create(&rpp->monitor, NULL, rpmem_monitor_thread, rpp);
+       if (ret) {
+               errno = ret;
+               ERR("!starting monitor thread");
+               goto err_monitor;
+       }
+
+       return rpp;
+err_monitor:
+       rpmem_common_fip_fini(rpp);
+err_fip_init:
+       rpmem_obc_close(rpp->obc, RPMEM_CLOSE_FLAGS_REMOVE);
+err_obc_create:
+       rpmem_common_fini(rpp, 0);
+err_common_init:
+       return NULL;
+}
+
+/*
+ * rpmem_open -- open remote pool on target node
+ *
+ * target        -- target node in format [<user>@]<target_name>[:<port>]
+ * pool_set_name -- remote pool set name
+ * pool_addr     -- local pool memory address which will be replicated
+ * pool_size     -- required pool size
+ * nlanes        -- number of lanes
+ * open_attr     -- pool attributes, received from remote host
+ */
+RPMEMpool *
+rpmem_open(const char *target, const char *pool_set_name,
+       void *pool_addr, size_t pool_size, unsigned *nlanes,
+       struct rpmem_pool_attr *open_attr)
+{
+       LOG(3, "target %s, pool_set_name %s, pool_addr %p, pool_size %zu, "
+                       "nlanes %p, create_attr %p", target, pool_set_name,
+                       pool_addr, pool_size, nlanes, open_attr);
+
+       os_once(&Rpmem_fork_unsafe_key_once, &rpmem_fip_probe_fork_safety);
+       RPMEM_CHECK_FORK();
+
+       rpmem_log_args("open", target, pool_set_name,
+                       pool_addr, pool_size, *nlanes);
+
+       if (rpmem_check_args(pool_addr, pool_size, nlanes))
+               return NULL;
+
+       RPMEMpool *rpp = rpmem_common_init(target);
+       if (!rpp)
+               goto err_common_init;
+
+       size_t buff_size = RPMEM_DEF_BUFF_SIZE;
+       struct rpmem_req_attr req = {
+               .pool_size      = pool_size,
+               .nlanes         = min(*nlanes, Rpmem_max_nlanes),
+               .provider       = rpp->provider,
+               .pool_desc      = pool_set_name,
+               .buff_size      = buff_size,
+       };
+
+       struct rpmem_resp_attr resp;
+
+       int ret = rpmem_obc_open(rpp->obc, &req, &resp, open_attr);
+       if (ret) {
+               RPMEM_LOG(ERR, "!open request failed");
+               goto err_obc_create;
+       }
+
+       if (open_attr == NULL || util_is_zeroed(open_attr, sizeof(*open_attr)))
+               rpp->no_headers = 1;
+
+       rpmem_log_resp("open", &resp);
+
+       ret = rpmem_common_fip_init(rpp, &req, &resp,
+                       pool_addr, pool_size, nlanes, buff_size);
+       if (ret)
+               goto err_fip_init;
+
+       ret = os_thread_create(&rpp->monitor, NULL, rpmem_monitor_thread, rpp);
+       if (ret) {
+               errno = ret;
+               ERR("!starting monitor thread");
+               goto err_monitor;
+       }
+
+       return rpp;
+err_monitor:
+       rpmem_common_fip_fini(rpp);
+err_fip_init:
+       rpmem_obc_close(rpp->obc, 0);
+err_obc_create:
+       rpmem_common_fini(rpp, 0);
+err_common_init:
+       return NULL;
+}
+
+/*
+ * rpmem_close -- close remote pool on target node
+ */
+int
+rpmem_close(RPMEMpool *rpp)
+{
+       LOG(3, "rpp %p", rpp);
+
+       RPMEM_LOG(INFO, "closing out-of-band connection");
+
+       util_fetch_and_or32(&rpp->closing, 1);
+
+       rpmem_fip_close(rpp->fip);
+
+       int ret = rpmem_obc_close(rpp->obc, 0);
+       if (ret)
+               ERR("!close request failed");
+
+       RPMEM_LOG(NOTICE, "out-of-band connection closed");
+
+       rpmem_common_fip_fini(rpp);
+       rpmem_common_fini(rpp, 1);
+
+       return ret;
+}
+
+/*
+ * rpmem_flush -- flush to target node operation
+ *
+ * rpp           -- remote pool handle
+ * offset        -- offset in pool
+ * length        -- length of flush operation
+ * lane          -- lane number
+ * flags         -- additional flags
+ */
+int
+rpmem_flush(RPMEMpool *rpp, size_t offset, size_t length,
+       unsigned lane, unsigned flags)
+{
+       LOG(3, "rpp %p, offset %zu, length %zu, lane %d, flags 0x%x",
+                       rpp, offset, length, lane, flags);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       if (flags & RPMEM_FLUSH_FLAGS_MASK) {
+               ERR("invalid flags (0x%x)", flags);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (rpp->no_headers == 0 && offset < RPMEM_HDR_SIZE) {
+               ERR("offset (%zu) in pool is less than %d bytes", offset,
+                               RPMEM_HDR_SIZE);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * By default use RDMA SEND flush mode which has atomicity
+        * guarantees. For relaxed flush use RDMA WRITE.
+        */
+       unsigned mode = RPMEM_PERSIST_SEND;
+       if (flags & RPMEM_FLUSH_RELAXED)
+               mode = RPMEM_FLUSH_WRITE;
+
+       int ret = rpmem_fip_flush(rpp->fip, offset, length, lane, mode);
+       if (unlikely(ret)) {
+               LOG(2, "flush operation failed");
+               rpp->error = ret;
+               errno = rpp->error;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_drain -- drain on target node operation
+ *
+ * rpp           -- remote pool handle
+ * lane          -- lane number
+ * flags         -- additional flags
+ */
+int
+rpmem_drain(RPMEMpool *rpp, unsigned lane, unsigned flags)
+{
+       LOG(3, "rpp %p, lane %d, flags 0x%x", rpp, lane, flags);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       if (flags != 0) {
+               ERR("invalid flags (0x%x)", flags);
+               errno = EINVAL;
+               return -1;
+       }
+
+       int ret = rpmem_fip_drain(rpp->fip, lane);
+       if (unlikely(ret)) {
+               LOG(2, "drain operation failed");
+               rpp->error = ret;
+               errno = rpp->error;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_persist -- persist operation on target node
+ *
+ * rpp           -- remote pool handle
+ * offset        -- offset in pool
+ * length        -- length of persist operation
+ * lane          -- lane number
+ */
+int
+rpmem_persist(RPMEMpool *rpp, size_t offset, size_t length,
+       unsigned lane, unsigned flags)
+{
+       LOG(3, "rpp %p, offset %zu, length %zu, lane %d, flags 0x%x",
+                       rpp, offset, length, lane, flags);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       if (flags & RPMEM_PERSIST_FLAGS_MASK) {
+               ERR("invalid flags (0x%x)", flags);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (rpp->no_headers == 0 && offset < RPMEM_HDR_SIZE) {
+               ERR("offset (%zu) in pool is less than %d bytes", offset,
+                               RPMEM_HDR_SIZE);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * By default use RDMA SEND persist mode which has atomicity
+        * guarantees. For relaxed persist use RDMA WRITE.
+        */
+       unsigned mode = RPMEM_PERSIST_SEND;
+       if (flags & RPMEM_PERSIST_RELAXED)
+               mode = RPMEM_FLUSH_WRITE;
+
+       int ret = rpmem_fip_persist(rpp->fip, offset, length,
+                       lane, mode);
+       if (unlikely(ret)) {
+               LOG(2, "persist operation failed");
+               rpp->error = ret;
+               errno = rpp->error;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_deep_persist -- deep flush operation on target node
+ *
+ * rpp           -- remote pool handle
+ * offset        -- offset in pool
+ * length        -- length of deep flush operation
+ * lane          -- lane number
+ */
+int
+rpmem_deep_persist(RPMEMpool *rpp, size_t offset, size_t length, unsigned lane)
+{
+       LOG(3, "rpp %p, offset %zu, length %zu, lane %d", rpp, offset, length,
+                       lane);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       if (offset < RPMEM_HDR_SIZE) {
+               ERR("offset (%zu) in pool is less than %d bytes", offset,
+                               RPMEM_HDR_SIZE);
+               errno = EINVAL;
+               return -1;
+       }
+
+       int ret = rpmem_fip_persist(rpp->fip, offset, length,
+                       lane, RPMEM_DEEP_PERSIST);
+       if (unlikely(ret)) {
+               ERR("persist operation failed");
+               rpp->error = ret;
+               errno = rpp->error;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_read -- read data from remote pool:
+ *
+ * rpp           -- remote pool handle
+ * buff          -- output buffer
+ * offset        -- offset in pool
+ * length        -- length of read operation
+ */
+int
+rpmem_read(RPMEMpool *rpp, void *buff, size_t offset,
+       size_t length, unsigned lane)
+{
+       LOG(3, "rpp %p, buff %p, offset %zu, length %zu, lane %d", rpp, buff,
+                       offset, length, lane);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       if (rpp->no_headers == 0 && offset < RPMEM_HDR_SIZE)
+               LOG(1, "reading from pool at offset (%zu) less than %d bytes",
+                               offset, RPMEM_HDR_SIZE);
+
+       int ret = rpmem_fip_read(rpp->fip, buff, length, offset, lane);
+       if (unlikely(ret)) {
+               errno = ret;
+               ERR("!read operation failed");
+               rpp->error = ret;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_set_attr -- overwrite pool attributes on the remote node
+ *
+ * rpp           -- remote pool handle
+ * attr          -- new pool attributes for the pool on remote node
+ */
+int
+rpmem_set_attr(RPMEMpool *rpp, const struct rpmem_pool_attr *attr)
+{
+       LOG(3, "rpp %p, attr %p", rpp, attr);
+
+       if (unlikely(rpp->error)) {
+               errno = rpp->error;
+               return -1;
+       }
+
+       int ret = rpmem_obc_set_attr(rpp->obc, attr);
+       if (ret) {
+               RPMEM_LOG(ERR, "!set attributes request failed");
+       }
+       return ret;
+}
+
+/*
+ * rpmem_remove -- remove pool from remote node
+ *
+ * target        -- target node in format [<user>@]<target_name>[:<port>]
+ * pool_set_name -- remote pool set name
+ * flags         -- bitwise OR of one or more of the following flags:
+ *  - RPMEM_REMOVE_FORCE
+ *  - RPMEM_REMOVE_POOL_SET
+ */
+int
+rpmem_remove(const char *target, const char *pool_set, int flags)
+{
+       LOG(3, "target %s, pool_set %s, flags %d", target, pool_set, flags);
+
+       if (flags & ~(RPMEM_REMOVE_FLAGS_ALL)) {
+               ERR("invalid flags specified");
+               errno = EINVAL;
+               return -1;
+       }
+
+       struct rpmem_target_info *info = rpmem_target_parse(target);
+       if (!info) {
+               ERR("!parsing target node address failed");
+               goto err_target;
+       }
+
+       const char *argv[5];
+       argv[0] = "--remove";
+       argv[1] = pool_set;
+       const char **cur = &argv[2];
+
+       if (flags & RPMEM_REMOVE_FORCE)
+               *cur++ = "--force";
+
+       if (flags & RPMEM_REMOVE_POOL_SET)
+               *cur++ = "--pool-set";
+
+       *cur = NULL;
+
+       struct rpmem_ssh *ssh = rpmem_ssh_execv(info, argv);
+       if (!ssh) {
+               ERR("!executing ssh command failed");
+               goto err_ssh_exec;
+       }
+
+       int ret;
+
+       ret = rpmem_ssh_monitor(ssh, 0);
+       if (ret) {
+               ERR("!waiting for remote command failed");
+               goto err_ssh_monitor;
+       }
+
+       ret = rpmem_ssh_close(ssh);
+       if (ret) {
+               errno = ret;
+               ERR("remote command failed");
+               goto err_ssh_close;
+       }
+
+       rpmem_target_free(info);
+
+       return 0;
+err_ssh_monitor:
+       rpmem_ssh_close(ssh);
+err_ssh_close:
+err_ssh_exec:
+       rpmem_target_free(info);
+err_target:
+       return -1;
+}
+
+#if FAULT_INJECTION
+void
+rpmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       return core_inject_fault_at(type, nth, at);
+}
+
+int
+rpmem_fault_injection_enabled(void)
+{
+       return core_fault_injection_enabled();
+}
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem.h b/ceph/src/pmdk/src/librpmem/rpmem.h
new file mode 100644 (file)
index 0000000..d65da27
--- /dev/null
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem.h -- internal definitions for librpmem
+ */
+#include "alloc.h"
+#include "fault_injection.h"
+
+#define RPMEM_LOG_PREFIX "librpmem"
+#define RPMEM_LOG_LEVEL_VAR "RPMEM_LOG_LEVEL"
+#define RPMEM_LOG_FILE_VAR "RPMEM_LOG_FILE"
+
+#if FAULT_INJECTION
+void
+rpmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at);
+
+int
+rpmem_fault_injection_enabled(void);
+#else
+static inline void
+rpmem_inject_fault_at(enum pmem_allocation_type type, int nth,
+                                               const char *at)
+{
+       abort();
+}
+
+static inline int
+rpmem_fault_injection_enabled(void)
+{
+       return 0;
+}
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_cmd.c b/ceph/src/pmdk/src/librpmem/rpmem_cmd.c
new file mode 100644 (file)
index 0000000..f38260a
--- /dev/null
@@ -0,0 +1,239 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_cmd.c -- simple interface for running an executable in child process
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <errno.h>
+
+#include "util.h"
+#include "out.h"
+#include "os.h"
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+#include "rpmem_cmd.h"
+
+/*
+ * rpmem_cmd_init -- initialize command
+ */
+struct rpmem_cmd *
+rpmem_cmd_init(void)
+{
+       struct rpmem_cmd *cmd = calloc(1, sizeof(*cmd));
+       if (!cmd) {
+               RPMEM_LOG(ERR, "allocating command buffer");
+               goto err_alloc_cmd;
+       }
+
+       return cmd;
+err_alloc_cmd:
+       return NULL;
+}
+
+/*
+ * rpmem_cmd_fini -- deinitialize command
+ */
+void
+rpmem_cmd_fini(struct rpmem_cmd *cmd)
+{
+       for (int i = 0; i < cmd->args.argc; i++)
+               free(cmd->args.argv[i]);
+       free(cmd->args.argv);
+       free(cmd);
+}
+
+/*
+ * rpmem_cmd_push -- push back command's argument
+ */
+int
+rpmem_cmd_push(struct rpmem_cmd *cmd, const char *arg)
+{
+       size_t argv_count = (size_t)cmd->args.argc + 2;
+       char **argv = realloc(cmd->args.argv, argv_count * sizeof(char *));
+       if (!argv) {
+               RPMEM_LOG(ERR, "reallocating command argv");
+               goto err_realloc;
+       }
+
+       cmd->args.argv = argv;
+
+       char *arg_dup = strdup(arg);
+       if (!arg_dup) {
+               RPMEM_LOG(ERR, "allocating argument");
+               goto err_strdup;
+       }
+
+       cmd->args.argv[cmd->args.argc] = arg_dup;
+       cmd->args.argc++;
+       cmd->args.argv[cmd->args.argc] = NULL;
+
+       return 0;
+err_strdup:
+err_realloc:
+       return -1;
+}
+
+/*
+ * rpmem_cmd_log -- print executing command
+ */
+static void
+rpmem_cmd_log(struct rpmem_cmd *cmd)
+{
+       RPMEM_ASSERT(cmd->args.argc > 0);
+
+       size_t size = 0;
+       for (int i = 0; i < cmd->args.argc; i++) {
+               size += strlen(cmd->args.argv[i]) + 1;
+       }
+
+       char *buff = malloc(size);
+       if (!buff) {
+               RPMEM_LOG(ERR, "allocating log buffer for command");
+               return;
+       }
+
+       size_t pos = 0;
+
+       for (int i = 0; pos < size && i < cmd->args.argc; i++) {
+               int ret = util_snprintf(&buff[pos], size - pos, "%s%s",
+                               cmd->args.argv[i], i == cmd->args.argc - 1 ?
+                               "" : " ");
+               if (ret < 0) {
+                       RPMEM_LOG(ERR, "!snprintf");
+                       goto out;
+               }
+
+               pos += (size_t)ret;
+       }
+
+       RPMEM_LOG(INFO, "executing command '%s'", buff);
+
+out:
+       free(buff);
+}
+
+/*
+ * rpmem_cmd_run -- run command and connect with stdin, stdout and stderr
+ * using unix sockets.
+ *
+ * The communication with child process is done via socketpairs on
+ * stdin, stdout and stderr. The socketpairs are used instead of pipes
+ * because reading from disconnected pipe causes a SIGPIPE signal.
+ * When using socketpair it is possible to read data using recv(3)
+ * function with MSG_NOSIGNAL flag, which doesn't send a signal.
+ */
+int
+rpmem_cmd_run(struct rpmem_cmd *cmd)
+{
+       int fd_in[2];
+       int fd_out[2];
+       int fd_err[2];
+
+       rpmem_cmd_log(cmd);
+
+       /* socketpair for stdin */
+       int ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd_in);
+       if (ret < 0) {
+               RPMEM_LOG(ERR, "creating pipe for stdin");
+               goto err_pipe_in;
+       }
+
+       /* parent process stdin socket */
+       cmd->fd_in = fd_in[1];
+
+       /* socketpair for stdout */
+       ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd_out);
+       if (ret < 0) {
+               RPMEM_LOG(ERR, "creating pipe for stdout");
+               goto err_pipe_out;
+       }
+
+       /* parent process stdout socket */
+       cmd->fd_out = fd_out[0];
+
+       /* socketpair for stderr */
+       ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd_err);
+       if (ret < 0) {
+               RPMEM_LOG(ERR, "creating pipe for stderr");
+               goto err_pipe_err;
+       }
+
+       /* socketpair for stderr */
+       cmd->fd_err = fd_err[0];
+
+       cmd->pid = fork();
+
+       if (cmd->pid == -1) {
+               RPMEM_LOG(ERR, "forking command");
+               goto err_fork;
+       }
+
+       if (!cmd->pid) {
+               dup2(fd_in[0], 0);
+               dup2(fd_out[1], 1);
+               dup2(fd_err[1], 2);
+
+               execvp(cmd->args.argv[0], cmd->args.argv);
+               exit(EXIT_FAILURE);
+       }
+
+       os_close(fd_in[0]);
+       os_close(fd_out[1]);
+       os_close(fd_err[1]);
+
+       return 0;
+err_fork:
+       os_close(fd_err[0]);
+       os_close(fd_err[1]);
+err_pipe_err:
+       os_close(fd_out[0]);
+       os_close(fd_out[1]);
+err_pipe_out:
+       os_close(fd_in[0]);
+       os_close(fd_in[1]);
+err_pipe_in:
+       return -1;
+}
+
+/*
+ * rpmem_cmd_wait -- wait for process to change state
+ */
+int
+rpmem_cmd_wait(struct rpmem_cmd *cmd, int *status)
+{
+       if (cmd->pid <= 0) {
+               RPMEM_LOG(ERR, "wrong PID: %i", cmd->pid);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (waitpid(cmd->pid, status, 0) != cmd->pid) {
+               RPMEM_LOG(ERR, "!waitpid failed");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_cmd_term -- close child process's unix sockets
+ */
+void
+rpmem_cmd_term(struct rpmem_cmd *cmd)
+{
+       os_close(cmd->fd_in);
+       os_close(cmd->fd_out);
+       os_close(cmd->fd_err);
+
+       RPMEM_ASSERT(cmd->pid > 0);
+}
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_cmd.h b/ceph/src/pmdk/src/librpmem/rpmem_cmd.h
new file mode 100644 (file)
index 0000000..0a16dd2
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_cmd.h -- helper module for invoking separate process
+ */
+
+#ifndef RPMEM_CMD_H
+#define RPMEM_CMD_H 1
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rpmem_cmd {
+       int fd_in;      /* stdin */
+       int fd_out;     /* stdout */
+       int fd_err;     /* stderr */
+       struct {
+               char **argv;
+               int argc;
+       } args;         /* command arguments */
+       pid_t pid;      /* pid of process */
+};
+
+struct rpmem_cmd *rpmem_cmd_init(void);
+int rpmem_cmd_push(struct rpmem_cmd *cmd, const char *arg);
+int rpmem_cmd_run(struct rpmem_cmd *cmd);
+void rpmem_cmd_term(struct rpmem_cmd *cmd);
+int rpmem_cmd_wait(struct rpmem_cmd *cmd, int *status);
+void rpmem_cmd_fini(struct rpmem_cmd *cmd);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_fip.c b/ceph/src/pmdk/src/librpmem/rpmem_fip.c
new file mode 100644 (file)
index 0000000..fe9e2eb
--- /dev/null
@@ -0,0 +1,1987 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_fip.c -- rpmem libfabric provider module source file
+ */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <limits.h>
+
+#include <rdma/fabric.h>
+#include <rdma/fi_domain.h>
+#include <rdma/fi_endpoint.h>
+#include <rdma/fi_cm.h>
+#include <rdma/fi_errno.h>
+#include <rdma/fi_rma.h>
+
+#include "out.h"
+#include "util.h"
+#include "os_thread.h"
+#include "os.h"
+#include "rpmem_common.h"
+#include "rpmem_fip_common.h"
+#include "rpmem_proto.h"
+#include "rpmem_util.h"
+#include "rpmem_fip_msg.h"
+#include "rpmem_fip.h"
+#include "valgrind_internal.h"
+
+#define RPMEM_FI_ERR(e, fmt, args...)\
+       ERR(fmt ": %s", ## args, fi_strerror((e)))
+
+#define RPMEM_FI_CLOSE(f, fmt, args...) (\
+{\
+       int oerrno = errno;\
+       int ret = fi_close(&(f)->fid);\
+       if (ret)\
+               RPMEM_FI_ERR(ret, fmt, ## args);\
+       errno = oerrno;\
+       ret;\
+})
+
+#define LANE_ALIGN_SIZE 64
+#define LANE_ALIGN __attribute__((aligned(LANE_ALIGN_SIZE)))
+
+#define RPMEM_RAW_BUFF_SIZE 4096
+#define RPMEM_RAW_SIZE 8
+
+typedef ssize_t (*rpmem_fip_flush_fn)(struct rpmem_fip *fip, size_t offset,
+               size_t len, unsigned lane, unsigned flags);
+
+typedef int (*rpmem_fip_drain_fn)(struct rpmem_fip *fip, unsigned lane);
+
+typedef ssize_t (*rpmem_fip_persist_fn)(struct rpmem_fip *fip, size_t offset,
+               size_t len, unsigned lane, unsigned flags);
+
+typedef int (*rpmem_fip_init_fn)(struct rpmem_fip *fip);
+typedef void (*rpmem_fip_fini_fn)(struct rpmem_fip *fip);
+
+typedef ssize_t (*cq_read_fn)(struct fid_cq *cq, void *buf, size_t count);
+
+static ssize_t
+cq_read_infinite(struct fid_cq *cq, void *buf, size_t count)
+{
+       return fi_cq_sread(cq, buf, count, NULL, -1);
+}
+
+/*
+ * rpmem_fip_ops -- operations specific for persistency method
+ */
+struct rpmem_fip_ops {
+       rpmem_fip_flush_fn flush;
+       rpmem_fip_drain_fn drain;
+       rpmem_fip_persist_fn persist;
+       rpmem_fip_init_fn lanes_init;
+       rpmem_fip_init_fn lanes_init_mem;
+       rpmem_fip_fini_fn lanes_fini;
+       rpmem_fip_init_fn lanes_post;
+};
+
+/*
+ * rpmem_fip_lane -- base lane structure
+ */
+struct rpmem_fip_lane {
+       struct fid_ep *ep;      /* endpoint */
+       struct fid_cq *cq;      /* completion queue */
+       uint64_t event;
+       size_t wq_elems;        /* # of elements in work queue */
+       int wq_is_flushing;     /* work queue is during flush */
+};
+
+/*
+ * rpmem_fip_plane -- persist operation's lane
+ */
+struct rpmem_fip_plane {
+       struct rpmem_fip_lane base;     /* base lane structure */
+       struct rpmem_fip_rma write;     /* WRITE message */
+       struct rpmem_fip_rma write_cq;  /* WRITE message with completion */
+       struct rpmem_fip_rma read;      /* READ message */
+       struct rpmem_fip_msg send;      /* SEND message */
+       struct rpmem_fip_msg recv;      /* RECV message */
+} LANE_ALIGN;
+
+/*
+ * rpmem_fip_rlane -- read operation's lane
+ */
+struct rpmem_fip_rlane {
+       struct rpmem_fip_lane base;     /* base lane structure */
+       struct rpmem_fip_rma read;      /* READ message */
+};
+
+struct rpmem_fip {
+       struct fi_info *fi; /* fabric interface information */
+       struct fid_fabric *fabric; /* fabric domain */
+       struct fid_domain *domain; /* fabric protection domain */
+       struct fid_eq *eq; /* event queue */
+
+       int closing; /* closing connections in progress */
+
+       size_t cq_size; /* completion queue size */
+
+       uint64_t raddr; /* remote memory base address */
+       uint64_t rkey;  /* remote memory protection key */
+       void *laddr;    /* local memory base address */
+       size_t size;    /* memory size */
+       struct fid_mr *mr; /* local memory region */
+       void *mr_desc;  /* local memory descriptor */
+
+       enum rpmem_persist_method persist_method;
+       const struct rpmem_fip_ops *ops;
+
+       unsigned nlanes;
+       size_t buff_size;
+       struct rpmem_fip_plane *lanes;
+
+       os_thread_t monitor;
+
+       void *pmsg;     /* persist message buffer */
+       size_t pmsg_size;
+       struct fid_mr *pmsg_mr;         /* persist message memory region */
+       void *pmsg_mr_desc;             /* persist message memory descriptor */
+
+       struct rpmem_msg_persist_resp *pres; /* persist response buffer */
+       struct fid_mr *pres_mr;         /* persist response memory region */
+       void *pres_mr_desc;             /* persist response memory descriptor */
+
+       void *raw_buff;                 /* READ-after-WRITE buffer */
+       struct fid_mr *raw_mr;          /* RAW memory region */
+       void *raw_mr_desc;              /* RAW memory descriptor */
+
+       cq_read_fn cq_read;             /* CQ read function */
+};
+
+/*
+ * rpmem_fip_is_closing -- (internal) atomically reads and returns the
+ * closing flag
+ */
+static inline int
+rpmem_fip_is_closing(struct rpmem_fip *fip)
+{
+       int ret;
+       util_atomic_load_explicit32(&fip->closing, &ret, memory_order_acquire);
+       return ret;
+}
+
+/*
+ * rpmem_fip_set_closing -- (internal) atomically set the closing flag
+ */
+static inline void
+rpmem_fip_set_closing(struct rpmem_fip *fip)
+{
+       /*
+        * load and store without barriers should be good enough here.
+        * fetch_and_or are used as workaround for helgrind issue.
+        */
+       util_fetch_and_or32(&fip->closing, 1);
+}
+
+/*
+ * rpmem_fip_lane_begin -- (internal) initialize list of events for lane
+ */
+static inline void
+rpmem_fip_lane_begin(struct rpmem_fip_lane *lanep, uint64_t event)
+{
+       lanep->event = event;
+}
+
+/*
+ * rpmem_fip_lane_init -- (internal) initialize single lane
+ */
+static int
+rpmem_fip_lane_init(struct rpmem_fip *fip, struct rpmem_fip_lane *lanep)
+{
+       int ret;
+
+       struct fi_cq_attr cq_attr = {
+               .size = fip->cq_size,
+               .flags = 0,
+               .format = FI_CQ_FORMAT_MSG,
+               .wait_obj = FI_WAIT_UNSPEC,
+               .signaling_vector = 0,
+               .wait_cond = FI_CQ_COND_NONE,
+               .wait_set = NULL,
+       };
+
+       /* create a completion queue */
+       ret = fi_cq_open(fip->domain, &cq_attr, &lanep->cq, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "opening completion queue");
+               goto err_cq_open;
+       }
+
+       /* create an endpoint */
+       ret = fi_endpoint(fip->domain, fip->fi, &lanep->ep, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "allocating endpoint");
+               goto err_endpoint;
+       }
+
+       /*
+        * Bind an event queue to an endpoint to get
+        * connection-related events for the endpoint.
+        */
+       ret = fi_ep_bind(lanep->ep, &fip->eq->fid, 0);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "binding event queue to endpoint");
+               goto err_ep_bind_eq;
+       }
+
+       /*
+        * Bind a completion queue to an endpoint to get completion
+        * events of specified inbound/outbound operations.
+        *
+        * FI_SELECTIVE_COMPLETION means all inbound/outbound operations
+        * must explicitly specify if the completion event should be
+        * generated or not using FI_COMPLETION flag.
+        *
+        * The completion events received are highly related to the
+        * persistency method used and are configured in lanes
+        * initialization specified for persistency method utilized.
+        */
+       ret = fi_ep_bind(lanep->ep, &lanep->cq->fid,
+                       FI_RECV | FI_TRANSMIT | FI_SELECTIVE_COMPLETION);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "binding completion queue to endpoint");
+               goto err_ep_bind_cq;
+       }
+
+       /*
+        * Enable endpoint so it is possible to post inbound/outbound
+        * operations if required.
+        */
+       ret = fi_enable(lanep->ep);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "activating endpoint");
+               goto err_fi_enable;
+       }
+
+       return 0;
+err_fi_enable:
+err_ep_bind_cq:
+err_ep_bind_eq:
+err_endpoint:
+       RPMEM_FI_CLOSE(lanep->cq, "closing completion queue");
+err_cq_open:
+       return -1;
+}
+
+/*
+ * rpmem_fip_lane_fini -- (internal) deinitialize single lane
+ */
+static int
+rpmem_fip_lane_fini(struct rpmem_fip_lane *lanep)
+{
+       int ret;
+       int lret = 0;
+
+       ret = RPMEM_FI_CLOSE(lanep->ep, "closing endpoint");
+       if (ret)
+               lret = ret;
+
+       ret = RPMEM_FI_CLOSE(lanep->cq, "closing completion queue");
+       if (ret)
+               lret = ret;
+
+       return lret;
+}
+
+/*
+ * rpmem_fip_lane_wait -- (internal) wait for specific event on completion queue
+ */
+static int
+rpmem_fip_lane_wait(struct rpmem_fip *fip, struct rpmem_fip_lane *lanep,
+       uint64_t e)
+{
+       ssize_t sret = 0;
+       struct fi_cq_err_entry err;
+       const char *str_err;
+       int ret = 0;
+       struct fi_cq_msg_entry cq_entry;
+
+       while (lanep->event & e) {
+               if (unlikely(rpmem_fip_is_closing(fip)))
+                       return ECONNRESET;
+
+               sret = fip->cq_read(lanep->cq, &cq_entry, 1);
+
+               if (unlikely(sret == -FI_EAGAIN) || sret == 0)
+                       continue;
+
+               if (unlikely(sret < 0)) {
+                       ret = (int)sret;
+                       goto err_cq_read;
+               }
+
+               lanep->event &= ~cq_entry.flags;
+       }
+
+       return 0;
+err_cq_read:
+       sret = fi_cq_readerr(lanep->cq, &err, 0);
+       if (sret < 0) {
+               RPMEM_FI_ERR((int)sret, "error reading from completion queue: "
+                       "cannot read error from event queue");
+               goto err;
+       }
+
+       str_err = fi_cq_strerror(lanep->cq, err.prov_errno, NULL, NULL, 0);
+       RPMEM_LOG(ERR, "error reading from completion queue: %s", str_err);
+err:
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_set_nlanes -- (internal) set maximum number of lanes supported
+ */
+static void
+rpmem_fip_set_nlanes(struct rpmem_fip *fip, unsigned nlanes)
+{
+       size_t max_nlanes = rpmem_fip_max_nlanes(fip->fi);
+       RPMEM_ASSERT(max_nlanes < UINT_MAX);
+
+       fip->nlanes = min((unsigned)max_nlanes, nlanes);
+}
+
+/*
+ * rpmem_fip_getinfo -- (internal) get fabric interface information
+ */
+static int
+rpmem_fip_getinfo(struct rpmem_fip *fip, const char *node, const char *service,
+       enum rpmem_provider provider, size_t max_wq_size,
+       enum rpmem_persist_method pm)
+{
+       int ret = -1;
+       struct fi_info *hints = rpmem_fip_get_hints(provider);
+       if (!hints) {
+               RPMEM_LOG(ERR, "!getting fabric interface information hints");
+               goto err_hints;
+       }
+
+       /*
+        * WQ size is:
+        * - >= size required by persist method (pm_wq_size)
+        * - >= size forced by environment variable (Rpmem_wq_size)
+        * - but it has to be <= max_wq_size reported by provider
+        */
+       size_t pm_wq_size = rpmem_fip_wq_size(pm, RPMEM_FIP_NODE_CLIENT);
+       hints->tx_attr->size =
+                       min(
+                               max(pm_wq_size, Rpmem_wq_size),
+                               max_wq_size);
+
+       hints->rx_attr->size = rpmem_fip_rx_size(pm, RPMEM_FIP_NODE_CLIENT);
+
+       /* get maximum available */
+       ret = fi_getinfo(RPMEM_FIVERSION, node, service, 0, hints, &fip->fi);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "getting fabric interface information");
+               goto err_fi_getinfo;
+       }
+
+       rpmem_fip_print_info(fip->fi);
+
+       /* fallback to free the hints */
+err_fi_getinfo:
+       fi_freeinfo(hints);
+err_hints:
+       return ret;
+}
+
+/*
+ * rpmem_fip_init_fabric_res -- (internal) initialize common fabric resources
+ */
+static int
+rpmem_fip_init_fabric_res(struct rpmem_fip *fip)
+{
+       int ret;
+       ret = fi_fabric(fip->fi->fabric_attr, &fip->fabric, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "opening fabric domain");
+               goto err_fi_fabric;
+       }
+
+       ret = fi_domain(fip->fabric, fip->fi, &fip->domain, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "opening fabric access domain");
+               goto err_fi_domain;
+       }
+
+       struct fi_eq_attr eq_attr = {
+               .size = 0, /* use default value */
+               .flags = 0,
+               .wait_obj = FI_WAIT_UNSPEC,
+               .signaling_vector = 0,
+               .wait_set = NULL,
+       };
+
+       ret = fi_eq_open(fip->fabric, &eq_attr, &fip->eq, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "opening event queue");
+               goto err_eq_open;
+       }
+
+       return 0;
+err_eq_open:
+       RPMEM_FI_CLOSE(fip->domain, "closing fabric access domain");
+err_fi_domain:
+       RPMEM_FI_CLOSE(fip->fabric, "closing fabric domain");
+err_fi_fabric:
+       return ret;
+}
+
+/*
+ * rpmem_fip_fini_fabric_res -- (internal) deinitialize common fabric resources
+ */
+static void
+rpmem_fip_fini_fabric_res(struct rpmem_fip *fip)
+{
+       RPMEM_FI_CLOSE(fip->eq, "closing event queue");
+       RPMEM_FI_CLOSE(fip->domain, "closing fabric access domain");
+       RPMEM_FI_CLOSE(fip->fabric, "closing fabric domain");
+}
+
+/*
+ * rpmem_fip_init_memory -- (internal) initialize common memory resources
+ */
+static int
+rpmem_fip_init_memory(struct rpmem_fip *fip)
+{
+       ASSERTne(Pagesize, 0);
+       int ret;
+
+       /*
+        * Register local memory space. The local memory will be used
+        * with WRITE operation in rpmem_fip_persist function thus
+        * the FI_WRITE access flag.
+        */
+       ret = fi_mr_reg(fip->domain, fip->laddr, fip->size,
+                       FI_WRITE, 0, 0, 0, &fip->mr, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "registrating memory");
+               return ret;
+       }
+
+       /* get local memory descriptor */
+       fip->mr_desc = fi_mr_desc(fip->mr);
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_fini_memory -- (internal) deinitialize common memory resources
+ */
+static void
+rpmem_fip_fini_memory(struct rpmem_fip *fip)
+{
+       RPMEM_FI_CLOSE(fip->mr, "unregistering memory");
+}
+
+/*
+ * rpmem_fip_lanes_init_common -- (internal) initialize common lanes resources
+ */
+static int
+rpmem_fip_lanes_init_common(struct rpmem_fip *fip)
+{
+       int ret;
+
+       ret = posix_memalign((void **)&fip->lanes, LANE_ALIGN_SIZE,
+               fip->nlanes * sizeof(*fip->lanes));
+       if (ret) {
+               RPMEM_LOG(ERR, "!allocating lanes");
+               goto err_alloc_lanes;
+       }
+       memset(fip->lanes, 0, fip->nlanes * sizeof(*fip->lanes));
+
+       unsigned i;
+       for (i = 0; i < fip->nlanes; i++) {
+               ret = rpmem_fip_lane_init(fip, &fip->lanes[i].base);
+               if (ret)
+                       goto err_lane_init;
+
+       }
+
+       return 0;
+err_lane_init:
+       for (unsigned j = 0; j < i; j++)
+               rpmem_fip_lane_fini(&fip->lanes[i].base);
+       free(fip->lanes);
+err_alloc_lanes:
+       return -1;
+}
+
+/*
+ * rpmem_fip_lanes_fini_common -- (internal) deinitialize common lanes
+ * resrouces
+ */
+static int
+rpmem_fip_lanes_fini_common(struct rpmem_fip *fip)
+{
+       int lret = 0;
+       int ret;
+
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               ret = rpmem_fip_lane_fini(&fip->lanes[i].base);
+               if (ret)
+                       lret = ret;
+       }
+
+       free(fip->lanes);
+
+       return lret;
+}
+
+/*
+ * rpmem_fip_lanes_init -- (internal) initialize lanes
+ */
+static int
+rpmem_fip_lanes_init(struct rpmem_fip *fip)
+{
+       int ret;
+
+       ret = rpmem_fip_lanes_init_common(fip);
+       if (ret)
+               return ret;
+
+       ret = fip->ops->lanes_init(fip);
+       if (ret)
+               goto err_init_lanes;
+
+       return 0;
+err_init_lanes:
+       rpmem_fip_lanes_fini_common(fip);
+       return ret;
+}
+
+/*
+ * rpmem_fip_lane_connect -- (internal) connect on a single lane
+ */
+static int
+rpmem_fip_lane_connect(struct rpmem_fip *fip, struct rpmem_fip_lane *lanep)
+{
+       struct fi_eq_cm_entry entry;
+       int ret;
+
+       ret = fi_connect(lanep->ep, fip->fi->dest_addr, NULL, 0);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "initiating connection request");
+               return ret;
+       }
+
+       return rpmem_fip_read_eq_check(fip->eq, &entry, FI_CONNECTED,
+                       &lanep->ep->fid,
+                       RPMEM_CONNECT_TIMEOUT);
+}
+
+/*
+ * rpmem_fip_lanes_connect -- (internal) establish connections on all lanes
+ */
+static int
+rpmem_fip_lanes_connect(struct rpmem_fip *fip)
+{
+       int ret;
+
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               struct rpmem_fip_lane *lanep = &fip->lanes[i].base;
+               ret = rpmem_fip_lane_connect(fip, lanep);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_lanes_shutdown -- shutdown all endpoints
+ */
+static int
+rpmem_fip_lanes_shutdown(struct rpmem_fip *fip)
+{
+       int ret;
+       int lret = 0;
+
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               ret = fi_shutdown(fip->lanes[i].base.ep, 0);
+               if (ret) {
+                       RPMEM_FI_ERR(ret, "disconnecting endpoint");
+                       lret = ret;
+               }
+       }
+
+       return lret;
+}
+
+/*
+ * rpmem_fip_lane_prep_write -- (internal) choose right WRITE structure
+ * according to flags and prepare for collecting its completion
+ */
+static inline struct rpmem_fip_rma *
+rpmem_fip_lane_prep_write(struct rpmem_fip_plane *lanep, unsigned flags)
+{
+       if (flags & RPMEM_COMPLETION) {
+               rpmem_fip_lane_begin(&lanep->base, FI_WRITE);
+               return &lanep->write_cq;
+       }
+
+       return &lanep->write;
+}
+
+/*
+ * rpmem_fip_monitor_thread -- (internal) monitor in-band connection
+ */
+static void *
+rpmem_fip_monitor_thread(void *arg)
+{
+       struct rpmem_fip *fip = (struct rpmem_fip *)arg;
+       struct fi_eq_cm_entry entry;
+       uint32_t event;
+       int ret;
+
+       while (!rpmem_fip_is_closing(fip)) {
+               ret = rpmem_fip_read_eq(fip->eq, &entry, &event,
+                               RPMEM_MONITOR_TIMEOUT);
+               if (unlikely(ret == 0) && event == FI_SHUTDOWN) {
+                       RPMEM_LOG(ERR, "event queue got FI_SHUTDOWN");
+
+                       /* mark in-band connection as closing */
+                       rpmem_fip_set_closing(fip);
+
+                       for (unsigned i = 0; i < fip->nlanes; i++) {
+                               fi_cq_signal(fip->lanes[i].base.cq);
+                       }
+               }
+       }
+
+       return NULL;
+}
+
+/*
+ * rpmem_fip_monitor_init -- (internal) initialize in-band monitor
+ */
+static int
+rpmem_fip_monitor_init(struct rpmem_fip *fip)
+{
+       errno = os_thread_create(&fip->monitor, NULL, rpmem_fip_monitor_thread,
+                       fip);
+       if (errno) {
+               RPMEM_LOG(ERR, "!connenction monitor thread");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_monitor_fini -- (internal) finalize in-band monitor
+ */
+static int
+rpmem_fip_monitor_fini(struct rpmem_fip *fip)
+{
+       rpmem_fip_set_closing(fip);
+
+       int ret = os_thread_join(&fip->monitor, NULL);
+       if (ret) {
+               RPMEM_LOG(ERR, "joining monitor thread failed");
+       }
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_init_lanes_common -- (internal) initialize lanes
+ */
+static int
+rpmem_fip_init_lanes_common(struct rpmem_fip *fip)
+{
+       ASSERTne(Pagesize, 0);
+
+       int ret = 0;
+
+       /* allocate persist messages buffer */
+       fip->pmsg_size = roundup(sizeof(struct rpmem_msg_persist) +
+                       fip->buff_size, (size_t)64);
+       size_t msg_size = fip->nlanes * fip->pmsg_size;
+       msg_size = PAGE_ALIGNED_UP_SIZE(msg_size);
+       errno = posix_memalign((void **)&fip->pmsg, Pagesize, msg_size);
+       if (errno) {
+               RPMEM_LOG(ERR, "!allocating messages buffer");
+               ret = -1;
+               goto err_malloc_pmsg;
+       }
+
+       /*
+        * Register persist messages buffer. The persist messages
+        * are sent to daemon thus the FI_SEND access flag.
+        */
+       ret = fi_mr_reg(fip->domain, fip->pmsg, msg_size, FI_SEND,
+                       0, 0, 0, &fip->pmsg_mr, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "registering messages buffer");
+               goto err_fi_mr_reg_pmsg;
+       }
+
+       /* get persist messages buffer local descriptor */
+       fip->pmsg_mr_desc = fi_mr_desc(fip->pmsg_mr);
+
+       /* allocate persist response messages buffer */
+       size_t msg_resp_size = fip->nlanes *
+                               sizeof(struct rpmem_msg_persist_resp);
+       msg_resp_size = PAGE_ALIGNED_UP_SIZE(msg_resp_size);
+       errno = posix_memalign((void **)&fip->pres, Pagesize, msg_resp_size);
+       if (errno) {
+               RPMEM_LOG(ERR, "!allocating messages response buffer");
+               ret = -1;
+               goto err_malloc_pres;
+       }
+
+       /*
+        * Register persist messages response buffer. The persist response
+        * messages are received from daemon thus the FI_RECV access flag.
+        */
+       ret = fi_mr_reg(fip->domain, fip->pres, msg_resp_size, FI_RECV,
+                       0, 0, 0, &fip->pres_mr, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "registering messages response buffer");
+               goto err_fi_mr_reg_pres;
+       }
+
+       /* get persist response messages buffer local descriptor */
+       fip->pres_mr_desc = fi_mr_desc(fip->pres_mr);
+
+       return 0;
+err_fi_mr_reg_pres:
+       free(fip->pres);
+err_malloc_pres:
+       RPMEM_FI_CLOSE(fip->pmsg_mr, "unregistering messages buffer");
+err_fi_mr_reg_pmsg:
+       free(fip->pmsg);
+err_malloc_pmsg:
+       return ret;
+}
+
+/*
+ * rpmem_fip_get_pmsg -- return persist message buffer
+ */
+static inline struct rpmem_msg_persist *
+rpmem_fip_get_pmsg(struct rpmem_fip *fip, size_t idx)
+{
+       return (struct rpmem_msg_persist *)
+               ((uintptr_t)fip->pmsg + idx * fip->pmsg_size);
+}
+
+/*
+ * rpmem_fip_init_mem_lanes_gpspm -- initialize lanes rma structures
+ */
+static int
+rpmem_fip_init_mem_lanes_gpspm(struct rpmem_fip *fip)
+{
+       /*
+        * Initialize all required structures for:
+        * WRITE, SEND and RECV operations.
+        *
+        * If the completion is required the FI_COMPLETION flag and
+        * appropriate context should be used.
+        *
+        * In GPSPM only the RECV and SEND completions are required.
+        *
+        * For RECV the context is RECV operation structure used for
+        * fi_recvmsg(3) function call.
+        *
+        * For SEND the context is lane structure.
+        *
+        * The received buffer contains a lane id which is used
+        * to obtain a lane which must be signaled that operation
+        * has been completed.
+        */
+       unsigned i;
+       for (i = 0; i < fip->nlanes; i++) {
+               /* WRITE */
+               rpmem_fip_rma_init(&fip->lanes[i].write,
+                               fip->mr_desc, 0,
+                               fip->rkey,
+                               &fip->lanes[i],
+                               0);
+
+               /* SEND */
+               rpmem_fip_msg_init(&fip->lanes[i].send,
+                               fip->pmsg_mr_desc, 0,
+                               &fip->lanes[i],
+                               rpmem_fip_get_pmsg(fip, i),
+                               0 /* size must be provided when sending msg */,
+                               FI_COMPLETION);
+
+               /* RECV */
+               rpmem_fip_msg_init(&fip->lanes[i].recv,
+                               fip->pres_mr_desc, 0,
+                               &fip->lanes[i].recv,
+                               &fip->pres[i],
+                               sizeof(fip->pres[i]),
+                               FI_COMPLETION);
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_fini_lanes_common -- (internal) deinitialize lanes for GPSPM
+ */
+static void
+rpmem_fip_fini_lanes_common(struct rpmem_fip *fip)
+{
+       RPMEM_FI_CLOSE(fip->pmsg_mr, "unregistering messages buffer");
+       RPMEM_FI_CLOSE(fip->pres_mr, "unregistering messages "
+                       "response buffer");
+       free(fip->pmsg);
+       free(fip->pres);
+}
+
+/*
+ * rpmem_fip_init_lanes_apm -- (internal) initialize lanes for APM
+ */
+static int
+rpmem_fip_init_lanes_apm(struct rpmem_fip *fip)
+{
+       ASSERTne(Pagesize, 0);
+       int ret;
+
+       ret = rpmem_fip_init_lanes_common(fip);
+       if (ret)
+               goto err_init_lanes_common;
+
+       ASSERT(IS_PAGE_ALIGNED(RPMEM_RAW_BUFF_SIZE));
+       errno = posix_memalign((void **)&fip->raw_buff, Pagesize,
+                       RPMEM_RAW_BUFF_SIZE);
+       if (errno) {
+               RPMEM_LOG(ERR, "!allocating APM RAW buffer");
+               goto err_malloc_raw;
+       }
+
+       /* register read-after-write buffer */
+       ret = fi_mr_reg(fip->domain, fip->raw_buff, RPMEM_RAW_BUFF_SIZE,
+                       FI_REMOTE_WRITE, 0, 0, 0, &fip->raw_mr, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "registering APM read buffer");
+               goto err_fi_raw_mr;
+       }
+
+       /* get read-after-write buffer local descriptor */
+       fip->raw_mr_desc = fi_mr_desc(fip->raw_mr);
+
+       return 0;
+err_fi_raw_mr:
+       free(fip->raw_buff);
+err_malloc_raw:
+       rpmem_fip_fini_lanes_common(fip);
+err_init_lanes_common:
+       return -1;
+}
+
+/*
+ * rpmem_fip_init_mem_lanes_apm -- initialize lanes rma structures
+ */
+static int
+rpmem_fip_init_mem_lanes_apm(struct rpmem_fip *fip)
+{
+       /*
+        * Initialize all required structures for:
+        * WRITE and READ operations.
+        *
+        * If the completion is required the FI_COMPLETION flag and
+        * appropriate context should be used.
+        *
+        * In APM only the READ completion is required.
+        * The context is a lane structure.
+        */
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+
+               /* WRITE */
+               rpmem_fip_rma_init(&fip->lanes[i].write,
+                               fip->mr_desc, 0,
+                               fip->rkey,
+                               &fip->lanes[i],
+                               0);
+
+               /* WRITE + FI_COMPLETION */
+               rpmem_fip_rma_init(&fip->lanes[i].write_cq,
+                               fip->mr_desc, 0,
+                               fip->rkey,
+                               &fip->lanes[i],
+                               FI_COMPLETION);
+
+               /* READ */
+               rpmem_fip_rma_init(&fip->lanes[i].read,
+                               fip->raw_mr_desc, 0,
+                               fip->rkey,
+                               &fip->lanes[i],
+                               FI_COMPLETION);
+
+               /* SEND */
+               rpmem_fip_msg_init(&fip->lanes[i].send,
+                               fip->pmsg_mr_desc, 0,
+                               &fip->lanes[i],
+                               rpmem_fip_get_pmsg(fip, i),
+                               fip->pmsg_size,
+                               FI_COMPLETION);
+
+               /* RECV */
+               rpmem_fip_msg_init(&fip->lanes[i].recv,
+                               fip->pres_mr_desc, 0,
+                               &fip->lanes[i].recv,
+                               &fip->pres[i],
+                               sizeof(fip->pres[i]),
+                               FI_COMPLETION);
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_fini_lanes_apm -- (internal) deinitialize lanes for APM
+ */
+static void
+rpmem_fip_fini_lanes_apm(struct rpmem_fip *fip)
+{
+       RPMEM_FI_CLOSE(fip->raw_mr, "unregistering APM read buffer");
+       free(fip->raw_buff);
+
+       rpmem_fip_fini_lanes_common(fip);
+}
+
+/*
+ * rpmem_fip_wq_inc -- (internal) increment number of elements in WQ
+ */
+static inline void
+rpmem_fip_wq_inc(struct rpmem_fip_plane *lanep)
+{
+       ++lanep->base.wq_elems;
+}
+
+/*
+ * rpmem_fip_wq_set_empty -- (internal) zero number of elements in WQ
+ */
+static inline void
+rpmem_fip_wq_set_empty(struct rpmem_fip_plane *lanep)
+{
+       RPMEM_ASSERT(!lanep->base.wq_is_flushing);
+       lanep->base.wq_elems = 0;
+}
+
+/*
+ * rpmem_fip_wq_require_flush -- (internal) is WQ almost full
+ */
+static inline int
+rpmem_fip_wq_require_flush(struct rpmem_fip *fip, struct rpmem_fip_plane *lanep)
+{
+       RPMEM_ASSERT(lanep->base.wq_elems < fip->fi->tx_attr->size);
+
+       return lanep->base.wq_elems + 1 == fip->fi->tx_attr->size;
+}
+
+/*
+ * rpmem_fip_wq_is_flushing -- (internal) is WQ flush started
+ */
+static inline int
+rpmem_fip_wq_is_flushing(struct rpmem_fip_plane *lanep)
+{
+       return lanep->base.wq_is_flushing;
+}
+
+/*
+ * rpmem_fip_wq_set_flushing -- (internal) mark WQ flush start
+ */
+static inline void
+rpmem_fip_wq_set_flushing(struct rpmem_fip_plane *lanep)
+{
+       lanep->base.wq_is_flushing = 1;
+}
+
+/*
+ * if WQ is almost full last WRITE has to report its completion
+ * otherwise it is unknown when subsequent commands can be posted
+ */
+#define RPMEM_FIP_WQ_FLUSH_REQ RPMEM_COMPLETION
+
+/*
+ * rpmem_fip_wq_flush_wait -- (internal) wait for WRITE completion
+ * to make sure WQ can accept subsequent commands
+ */
+static inline int
+rpmem_fip_wq_flush_wait(struct rpmem_fip *fip, struct rpmem_fip_plane *lanep)
+{
+       RPMEM_ASSERT(lanep->base.wq_elems == fip->fi->tx_attr->size);
+       RPMEM_ASSERT(lanep->base.wq_is_flushing);
+
+       /* wait for WRITE completion */
+       int ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_WRITE);
+       if (unlikely(ret)) {
+               LOG(2, "waiting for WRITE completion failed");
+               return ret;
+       }
+
+       /* when WRITE completion is reaped WQ is empty */
+       lanep->base.wq_is_flushing = 0;
+       rpmem_fip_wq_set_empty(lanep);
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_wq_inc_and_flush -- (internal) increment number of elements in WQ
+ * and flush it
+ */
+static inline int
+rpmem_fip_wq_inc_and_flush(struct rpmem_fip *fip, struct rpmem_fip_plane *lanep)
+{
+       rpmem_fip_wq_inc(lanep);
+       rpmem_fip_wq_set_flushing(lanep);
+
+       return rpmem_fip_wq_flush_wait(fip, lanep);
+}
+
+/*
+ * rpmem_fip_wq_flush_check -- (internal) check if WQ requires flush or it is
+ * during flushing and handle each case
+ */
+static inline int
+rpmem_fip_wq_flush_check(struct rpmem_fip *fip, struct rpmem_fip_plane *lanep,
+       unsigned *flags)
+{
+       if (rpmem_fip_wq_is_flushing(lanep))
+               return rpmem_fip_wq_flush_wait(fip, lanep);
+
+       if (rpmem_fip_wq_require_flush(fip, lanep))
+               *flags |= RPMEM_FIP_WQ_FLUSH_REQ;
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_get_wq_size -- get WQ size (for validation purposes only)
+ */
+inline size_t
+rpmem_fip_get_wq_size(struct rpmem_fip *fip)
+{
+       RPMEM_ASSERT(fip);
+       RPMEM_ASSERT(fip->fi);
+       RPMEM_ASSERT(fip->fi->tx_attr);
+
+       return fip->fi->tx_attr->size;
+}
+
+/*
+ * rpmem_fip_flush_raw -- (internal) perform flush operation using rma WRITE
+ */
+static int
+rpmem_fip_flush_raw(struct rpmem_fip *fip, size_t offset, size_t len,
+               unsigned lane, unsigned flags)
+{
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+
+       int ret;
+       void *laddr = (void *)((uintptr_t)fip->laddr + offset);
+       uint64_t raddr = fip->raddr + offset;
+
+       struct rpmem_fip_rma *write = rpmem_fip_lane_prep_write(lanep, flags);
+
+       /* WRITE for requested memory region */
+       ret = rpmem_fip_writemsg(lanep->base.ep, write, laddr, len, raddr);
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR(ret, "RMA write");
+               return ret;
+       }
+
+       if (flags & RPMEM_FIP_WQ_FLUSH_REQ)
+               rpmem_fip_wq_set_flushing(lanep);
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_drain_raw -- (internal) perform drain operation using rma READ
+ */
+static int
+rpmem_fip_drain_raw(struct rpmem_fip *fip, unsigned lane)
+{
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+       int ret;
+
+       rpmem_fip_lane_begin(&lanep->base, FI_READ);
+
+       /* READ to read-after-write buffer */
+       ret = rpmem_fip_readmsg(lanep->base.ep, &lanep->read, fip->raw_buff,
+                       RPMEM_RAW_SIZE, fip->raddr);
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR(ret, "RMA read");
+               return ret;
+       }
+
+       /* wait for READ completion */
+       ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_READ);
+       if (unlikely(ret)) {
+               ERR("waiting for READ completion failed");
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_persist_raw -- (internal) perform persist operation using
+ * READ after WRITE mechanism
+ */
+static int
+rpmem_fip_persist_raw(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       int ret;
+
+       ret = rpmem_fip_flush_raw(fip, offset, len, lane, flags);
+       if (unlikely(ret))
+               return ret;
+
+       /* flush WQ prior to posting subsequent message */
+       if (flags & RPMEM_FIP_WQ_FLUSH_REQ) {
+               struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+               ret = rpmem_fip_wq_inc_and_flush(fip, lanep);
+               if (unlikely(ret))
+                       return ret;
+       }
+
+       return rpmem_fip_drain_raw(fip, lane);
+}
+
+/*
+ * rpmem_fip_post_resp -- (internal) post persist response message buffer
+ */
+static inline int
+rpmem_fip_post_resp(struct rpmem_fip *fip,
+       struct rpmem_fip_plane *lanep)
+{
+       int ret = rpmem_fip_recvmsg(lanep->base.ep, &lanep->recv);
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR(ret, "posting recv buffer");
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_persist_saw -- (internal) perform persist operation using
+ * SEND after WRITE mechanism
+ */
+static int
+rpmem_fip_persist_saw(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+       void *laddr = (void *)((uintptr_t)fip->laddr + offset);
+       uint64_t raddr = fip->raddr + offset;
+       struct rpmem_msg_persist *msg;
+       int ret;
+
+       ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_SEND);
+       if (unlikely(ret)) {
+               ERR("waiting for SEND completion failed");
+               return ret;
+       }
+
+       struct rpmem_fip_rma *write = rpmem_fip_lane_prep_write(lanep, flags);
+
+       /* WRITE for requested memory region */
+       ret = rpmem_fip_writemsg(lanep->base.ep, write, laddr, len, raddr);
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR((int)ret, "RMA write");
+               return ret;
+       }
+
+       /* flush WQ prior to posting subsequent message */
+       if (flags & RPMEM_FIP_WQ_FLUSH_REQ) {
+               ret = rpmem_fip_wq_inc_and_flush(fip, lanep);
+               if (unlikely(ret))
+                       return ret;
+       }
+
+       rpmem_fip_lane_begin(&lanep->base, FI_RECV | FI_SEND);
+
+       /* SEND persist message */
+       msg = rpmem_fip_msg_get_pmsg(&lanep->send);
+       msg->flags = (flags & RPMEM_FLUSH_PERSIST_MASK);
+       msg->lane = lane;
+       msg->addr = raddr;
+       msg->size = len;
+
+       ret = rpmem_fip_sendmsg(lanep->base.ep, &lanep->send, sizeof(*msg));
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR(ret, "MSG send");
+               return ret;
+       }
+
+       /* wait for persist operation completion */
+       ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_RECV);
+       if (unlikely(ret)) {
+               ERR("waiting for RECV completion failed");
+               return ret;
+       }
+
+       ret = rpmem_fip_post_resp(fip, lanep);
+       if (unlikely(ret)) {
+               ERR("posting RECV buffer failed");
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_persist_send -- (internal) perform persist operation using
+ * RDMA SEND operation with data inlined in the message buffer.
+ */
+static int
+rpmem_fip_persist_send(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       RPMEM_ASSERT(len <= fip->buff_size);
+
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+       void *laddr = (void *)((uintptr_t)fip->laddr + offset);
+       uint64_t raddr = fip->raddr + offset;
+       struct rpmem_msg_persist *msg;
+       int ret;
+
+       ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_SEND);
+       if (unlikely(ret)) {
+               ERR("waiting for SEND completion failed");
+               return ret;
+       }
+
+       rpmem_fip_lane_begin(&lanep->base, FI_RECV | FI_SEND);
+
+       /* SEND persist message */
+       msg = rpmem_fip_msg_get_pmsg(&lanep->send);
+       msg->flags = flags;
+       msg->lane = lane;
+       msg->addr = raddr;
+       msg->size = len;
+
+       memcpy(msg->data, laddr, len);
+
+       ret = rpmem_fip_sendmsg(lanep->base.ep, &lanep->send,
+                       sizeof(*msg) + len);
+       if (unlikely(ret)) {
+               RPMEM_FI_ERR(ret, "MSG send");
+               return ret;
+       }
+
+       /* wait for persist operation completion */
+       ret = rpmem_fip_lane_wait(fip, &lanep->base, FI_RECV);
+       if (unlikely(ret)) {
+               ERR("waiting for RECV completion failed");
+               return ret;
+       }
+
+       ret = rpmem_fip_post_resp(fip, lanep);
+       if (unlikely(ret)) {
+               ERR("posting RECV buffer failed");
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_persist_gpspm_sockets -- (internal) perform persist operation
+ * for GPSPM - sockets provider implementation which doesn't use the
+ * inline persist operation
+ */
+static ssize_t
+rpmem_fip_persist_gpspm_sockets(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       unsigned mode = flags & RPMEM_FLUSH_PERSIST_MASK;
+       if (mode == RPMEM_PERSIST_SEND)
+               flags = (flags & ~RPMEM_FLUSH_PERSIST_MASK) | RPMEM_FLUSH_WRITE;
+
+       int ret = rpmem_fip_wq_flush_check(fip, &fip->lanes[lane], &flags);
+       if (unlikely(ret))
+               return -abs(ret);
+
+       /* Limit len to the max value of the return type. */
+       len = min(len, SSIZE_MAX);
+
+       ret = rpmem_fip_persist_saw(fip, offset, len, lane, flags);
+       if (ret)
+               return -abs(ret);
+
+       rpmem_fip_wq_set_empty(&fip->lanes[lane]);
+
+       return (ssize_t)len;
+}
+
+/*
+ * rpmem_fip_persist_apm_sockets -- (internal) perform persist operation
+ * for APM - sockets provider implementation which doesn't use the
+ * inline persist operation
+ */
+static ssize_t
+rpmem_fip_persist_apm_sockets(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       /* Limit len to the max value of the return type. */
+       len = min(len, SSIZE_MAX);
+
+       int ret = rpmem_fip_wq_flush_check(fip, &fip->lanes[lane], &flags);
+       if (unlikely(ret))
+               return -abs(ret);
+
+       ret = rpmem_fip_persist_raw(fip, offset, len, lane, flags);
+       if (unlikely(ret))
+               return -abs(ret);
+
+       rpmem_fip_wq_set_empty(&fip->lanes[lane]);
+
+       return (ssize_t)len;
+}
+
+/*
+ * rpmem_fip_persist_gpspm -- (internal) perform persist operation for GPSPM
+ */
+static ssize_t
+rpmem_fip_persist_gpspm(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       /* Limit len to the max value of the return type. */
+       len = min(len, SSIZE_MAX);
+       unsigned mode = flags & RPMEM_FLUSH_PERSIST_MASK;
+
+       int ret = rpmem_fip_wq_flush_check(fip, &fip->lanes[lane], &flags);
+       if (unlikely(ret))
+               return -abs(ret);
+
+       if (mode == RPMEM_PERSIST_SEND) {
+               len = min(len, fip->buff_size);
+               ret = rpmem_fip_persist_send(fip, offset, len, lane, flags);
+       } else {
+               ret = rpmem_fip_persist_saw(fip, offset, len, lane, flags);
+       }
+
+       if (ret)
+               return -abs(ret);
+
+       rpmem_fip_wq_set_empty(&fip->lanes[lane]);
+
+       return (ssize_t)len;
+}
+
+/*
+ * rpmem_fip_drain_nop -- (internal) perform drain operation as NOP
+ */
+static int
+rpmem_fip_drain_nop(struct rpmem_fip *fip, unsigned lane)
+{
+       (void) fip;
+       (void) lane;
+       return 0;
+}
+
+/*
+ * rpmem_fip_flush_apm -- (internal) perform flush operation for APM
+ */
+static ssize_t
+rpmem_fip_flush_apm(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+       int ret;
+
+       /* Limit len to the max value of the return type. */
+       len = min(len, SSIZE_MAX);
+       unsigned mode = flags & RPMEM_FLUSH_PERSIST_MASK;
+
+       ret = rpmem_fip_wq_flush_check(fip, lanep, &flags);
+       if (unlikely(ret))
+               return ret;
+
+       if (mode == RPMEM_PERSIST_SEND) {
+               /*
+                * XXX: Probably posting Send in the flush and waiting for the
+                * response in the drain will give some performance gains.
+                */
+               len = min(len, fip->buff_size);
+               ret = rpmem_fip_persist_send(fip, offset, len, lane, flags);
+       } else {
+               ret = rpmem_fip_flush_raw(fip, offset, len, lane, flags);
+       }
+
+       if (ret)
+               return -abs(ret);
+
+       rpmem_fip_wq_inc(lanep);
+
+       return (ssize_t)len;
+}
+
+/*
+ * rpmem_fip_drain_apm -- (internal) perform drain operation for APM
+ */
+static int
+rpmem_fip_drain_apm(struct rpmem_fip *fip, unsigned lane)
+{
+       struct rpmem_fip_plane *lanep = &fip->lanes[lane];
+       int ret;
+
+       if (unlikely(rpmem_fip_wq_is_flushing(lanep))) {
+               ret = rpmem_fip_wq_flush_wait(fip, lanep);
+               if (unlikely(ret))
+                       return ret;
+       }
+
+       ret = rpmem_fip_drain_raw(fip, lane);
+       /* successful drain means WQ is empty */
+       if (likely(!ret))
+               rpmem_fip_wq_set_empty(lanep);
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_persist_apm -- (internal) perform persist operation for APM
+ */
+static ssize_t
+rpmem_fip_persist_apm(struct rpmem_fip *fip, size_t offset,
+       size_t len, unsigned lane, unsigned flags)
+{
+       /* Limit len to the max value of the return type. */
+       len = min(len, SSIZE_MAX);
+       unsigned mode = flags & RPMEM_FLUSH_PERSIST_MASK;
+
+       int ret = rpmem_fip_wq_flush_check(fip, &fip->lanes[lane], &flags);
+       if (unlikely(ret))
+               return -abs(ret);
+
+       if (unlikely(mode == RPMEM_DEEP_PERSIST))
+               ret = rpmem_fip_persist_saw(fip, offset, len, lane, flags);
+       else if (mode == RPMEM_PERSIST_SEND) {
+               len = min(len, fip->buff_size);
+               ret = rpmem_fip_persist_send(fip, offset, len, lane, flags);
+       } else {
+               ret = rpmem_fip_persist_raw(fip, offset, len, lane, flags);
+       }
+
+       if (unlikely(ret))
+               return -abs(ret);
+
+       rpmem_fip_wq_set_empty(&fip->lanes[lane]);
+
+       return (ssize_t)len;
+}
+
+/*
+ * rpmem_fip_post_lanes_common -- (internal) post all persist response message
+ * buffers
+ */
+static int
+rpmem_fip_post_lanes_common(struct rpmem_fip *fip)
+{
+       int ret = 0;
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               ret = rpmem_fip_post_resp(fip, &fip->lanes[i]);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_ops -- some operations specific for persistency method used
+ *
+ * Note: GPSPM flush is emulated by persist whereas drain is a nop.
+ *
+ * Probably splitting Send-after-Write into two stages (flush + drain)
+ * will give some performance gains for GPSPM mode.
+ */
+static const struct rpmem_fip_ops
+rpmem_fip_ops[MAX_RPMEM_PROV][MAX_RPMEM_PM] = {
+       [RPMEM_PROV_LIBFABRIC_VERBS] = {
+               [RPMEM_PM_GPSPM] = {
+                       .flush = rpmem_fip_persist_gpspm,
+                       .drain = rpmem_fip_drain_nop,
+                       .persist = rpmem_fip_persist_gpspm,
+                       .lanes_init = rpmem_fip_init_lanes_common,
+                       .lanes_init_mem = rpmem_fip_init_mem_lanes_gpspm,
+                       .lanes_fini = rpmem_fip_fini_lanes_common,
+                       .lanes_post = rpmem_fip_post_lanes_common,
+               },
+               [RPMEM_PM_APM] = {
+                       .flush = rpmem_fip_flush_apm,
+                       .drain = rpmem_fip_drain_apm,
+                       .persist = rpmem_fip_persist_apm,
+                       .lanes_init = rpmem_fip_init_lanes_apm,
+                       .lanes_init_mem = rpmem_fip_init_mem_lanes_apm,
+                       .lanes_fini = rpmem_fip_fini_lanes_apm,
+                       .lanes_post = rpmem_fip_post_lanes_common,
+               },
+       },
+       [RPMEM_PROV_LIBFABRIC_SOCKETS] = {
+               [RPMEM_PM_GPSPM] = {
+                       .flush = rpmem_fip_persist_gpspm_sockets,
+                       .drain = rpmem_fip_drain_nop,
+                       .persist = rpmem_fip_persist_gpspm_sockets,
+                       .lanes_init = rpmem_fip_init_lanes_common,
+                       .lanes_init_mem = rpmem_fip_init_mem_lanes_gpspm,
+                       .lanes_fini = rpmem_fip_fini_lanes_common,
+                       .lanes_post = rpmem_fip_post_lanes_common,
+               },
+               [RPMEM_PM_APM] = {
+                       .flush = rpmem_fip_flush_apm,
+                       .drain = rpmem_fip_drain_apm,
+                       .persist = rpmem_fip_persist_apm_sockets,
+                       .lanes_init = rpmem_fip_init_lanes_apm,
+                       .lanes_init_mem = rpmem_fip_init_mem_lanes_apm,
+                       .lanes_fini = rpmem_fip_fini_lanes_apm,
+                       .lanes_post = rpmem_fip_post_lanes_common,
+               },
+       }
+};
+
+/*
+ * rpmem_fip_set_attr -- (internal) set required attributes
+ */
+static void
+rpmem_fip_set_attr(struct rpmem_fip *fip, struct rpmem_fip_attr *attr)
+{
+       fip->raddr = (uint64_t)attr->raddr;
+       fip->rkey = attr->rkey;
+       fip->laddr = attr->laddr;
+       fip->size = attr->size;
+       fip->buff_size = attr->buff_size;
+       fip->persist_method = attr->persist_method;
+
+       rpmem_fip_set_nlanes(fip, attr->nlanes);
+
+       /* one for read operation */
+       fip->cq_size = rpmem_fip_cq_size(fip->persist_method,
+                       RPMEM_FIP_NODE_CLIENT);
+
+       fip->ops = &rpmem_fip_ops[attr->provider][fip->persist_method];
+}
+
+/*
+ * rpmem_fip_init -- initialize fabric provider
+ */
+struct rpmem_fip *
+rpmem_fip_init(const char *node, const char *service,
+       struct rpmem_fip_attr *attr, unsigned *nlanes)
+{
+       int ret;
+
+       struct rpmem_fip *fip = calloc(1, sizeof(*fip));
+       if (!fip) {
+               RPMEM_LOG(ERR, "!allocating fabric handle");
+               return NULL;
+       }
+
+       ret = rpmem_fip_getinfo(fip, node, service,
+               attr->provider, attr->max_wq_size, attr->persist_method);
+       if (ret)
+               goto err_getinfo;
+
+       fip->cq_read = attr->provider == RPMEM_PROV_LIBFABRIC_VERBS ?
+               fi_cq_read : cq_read_infinite;
+
+       rpmem_fip_set_attr(fip, attr);
+
+       *nlanes = fip->nlanes;
+
+       ret = rpmem_fip_init_fabric_res(fip);
+       if (ret)
+               goto err_init_fabric_res;
+
+       ret = rpmem_fip_lanes_init(fip);
+       if (ret)
+               goto err_init_lanes;
+
+       return fip;
+err_init_lanes:
+       rpmem_fip_fini_fabric_res(fip);
+err_init_fabric_res:
+       fi_freeinfo(fip->fi);
+err_getinfo:
+       free(fip);
+       return NULL;
+}
+
+/*
+ * rpmem_fip_fini -- deinitialize fabric provider
+ */
+void
+rpmem_fip_fini(struct rpmem_fip *fip)
+{
+       fip->ops->lanes_fini(fip);
+       rpmem_fip_lanes_fini_common(fip);
+       rpmem_fip_fini_fabric_res(fip);
+       fi_freeinfo(fip->fi);
+       free(fip);
+}
+
+/*
+ * rpmem_fip_connect -- connect to remote peer
+ */
+int
+rpmem_fip_connect(struct rpmem_fip *fip)
+{
+       int ret;
+
+       ret = rpmem_fip_lanes_connect(fip);
+       if (ret)
+               goto err_lanes_connect;
+
+       ret = rpmem_fip_monitor_init(fip);
+       if (ret)
+               goto err_monitor;
+
+       ret = rpmem_fip_init_memory(fip);
+       if (ret)
+               goto err_init_memory;
+
+       ret = fip->ops->lanes_init_mem(fip);
+       if (ret)
+               goto err_init_lanes_mem;
+
+       ret = fip->ops->lanes_post(fip);
+       if (ret)
+               goto err_lanes_post;
+
+       return 0;
+err_lanes_post:
+err_init_lanes_mem:
+       rpmem_fip_fini_memory(fip);
+err_init_memory:
+       rpmem_fip_monitor_fini(fip);
+err_monitor:
+       rpmem_fip_lanes_shutdown(fip);
+err_lanes_connect:
+       return ret;
+}
+
+/*
+ * rpmem_fip_close -- close connection to remote peer
+ */
+int
+rpmem_fip_close(struct rpmem_fip *fip)
+{
+       int ret;
+       int lret = 0;
+
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               goto close_monitor;
+
+       rpmem_fip_fini_memory(fip);
+
+       ret = rpmem_fip_lanes_shutdown(fip);
+       if (ret)
+               lret = ret;
+
+close_monitor:
+       /* close fip monitor */
+       ret = rpmem_fip_monitor_fini(fip);
+       if (ret)
+               lret = ret;
+
+       return lret;
+}
+
+/*
+ * rpmem_fip_flush -- perform remote flush operation
+ */
+int
+rpmem_fip_flush(struct rpmem_fip *fip, size_t offset, size_t len,
+       unsigned lane, unsigned flags)
+{
+       RPMEM_ASSERT((flags & RPMEM_FLUSH_PERSIST_MASK) <= RPMEM_PERSIST_MAX);
+       RPMEM_ASSERT(flags != RPMEM_DEEP_PERSIST);
+
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       RPMEM_ASSERT(lane < fip->nlanes);
+       if (unlikely(lane >= fip->nlanes))
+               return EINVAL; /* it will be passed to errno */
+
+       if (unlikely(offset >= fip->size || offset + len > fip->size))
+               return EINVAL; /* it will be passed to errno */
+
+       if (unlikely(len == 0))
+               return 0;
+
+       int ret = 0;
+       while (len > 0) {
+               size_t tmplen = min(len, fip->fi->ep_attr->max_msg_size);
+
+               ssize_t r = fip->ops->flush(fip, offset, tmplen, lane, flags);
+               if (r < 0) {
+                       RPMEM_LOG(ERR, "flush operation failed");
+                       ret = (int)r;
+                       goto err;
+               }
+
+               tmplen = (size_t)r;
+
+               offset += tmplen;
+               len -= tmplen;
+       }
+err:
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_drain -- perform remote drain operation
+ */
+int
+rpmem_fip_drain(struct rpmem_fip *fip, unsigned lane)
+{
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       RPMEM_ASSERT(lane < fip->nlanes);
+       if (unlikely(lane >= fip->nlanes))
+               return EINVAL; /* it will be passed to errno */
+
+       int ret = fip->ops->drain(fip, lane);
+
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_persist -- perform remote persist operation
+ */
+int
+rpmem_fip_persist(struct rpmem_fip *fip, size_t offset, size_t len,
+       unsigned lane, unsigned flags)
+{
+       RPMEM_ASSERT((flags & RPMEM_FLUSH_PERSIST_MASK) <= RPMEM_PERSIST_MAX);
+
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       RPMEM_ASSERT(lane < fip->nlanes);
+       if (unlikely(lane >= fip->nlanes))
+               return EINVAL; /* it will be passed to errno */
+
+       if (unlikely(offset >= fip->size || offset + len > fip->size))
+               return EINVAL; /* it will be passed to errno */
+
+       if (unlikely(len == 0))
+               return 0;
+
+       int ret = 0;
+       while (len > 0) {
+               size_t tmplen = min(len, fip->fi->ep_attr->max_msg_size);
+
+               ssize_t r = fip->ops->persist(fip, offset, tmplen, lane, flags);
+               if (r < 0) {
+                       RPMEM_LOG(ERR, "persist operation failed");
+                       ret = (int)r;
+                       goto err;
+               }
+               tmplen = (size_t)r;
+
+               offset += tmplen;
+               len -= tmplen;
+       }
+err:
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_read -- perform read operation
+ */
+int
+rpmem_fip_read(struct rpmem_fip *fip, void *buff, size_t len,
+       size_t off, unsigned lane)
+{
+       int ret;
+
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       RPMEM_ASSERT(lane < fip->nlanes);
+       if (unlikely(lane >= fip->nlanes))
+               return EINVAL; /* it will be passed to errno */
+
+       if (unlikely(len == 0)) {
+               return 0;
+       }
+
+       size_t rd_buff_len = len < fip->fi->ep_attr->max_msg_size ?
+               len : fip->fi->ep_attr->max_msg_size;
+
+       void *rd_buff;          /* buffer for read operation */
+       struct fid_mr *rd_mr;   /* read buffer memory region */
+       void *rd_mr_desc;       /* read buffer memory descriptor */
+       struct rpmem_fip_rlane rd_lane;
+
+       /* allocate buffer for read operation */
+       errno = posix_memalign((void **)&rd_buff, Pagesize,
+                       rd_buff_len);
+       if (errno) {
+               RPMEM_LOG(ERR, "!allocating read buffer");
+               ret = errno;
+               goto err_malloc_rd_buff;
+       }
+
+       /*
+        * Register buffer for read operation.
+        * The read operation utilizes READ operation thus
+        * the FI_REMOTE_WRITE flag.
+        */
+       ret = fi_mr_reg(fip->domain, rd_buff,
+                       rd_buff_len, FI_REMOTE_WRITE,
+                       0, 0, 0, &rd_mr, NULL);
+       if (ret) {
+               RPMEM_FI_ERR(ret, "registrating read buffer");
+               goto err_rd_mr;
+       }
+
+       /* get read buffer local memory descriptor */
+       rd_mr_desc = fi_mr_desc(rd_mr);
+
+       /*
+        * Initialize READ message. The completion is required in order
+        * to signal thread that READ operation has been completed.
+        */
+       rpmem_fip_rma_init(&rd_lane.read, rd_mr_desc, 0,
+                       fip->rkey, &rd_lane, FI_COMPLETION);
+
+       size_t rd = 0;
+       uint8_t *cbuff = buff;
+       struct rpmem_fip_lane *lanep = &fip->lanes[lane].base;
+
+       while (rd < len) {
+               size_t rd_len = len - rd < rd_buff_len ?
+                               len - rd : rd_buff_len;
+               size_t rd_off = off + rd;
+               uint64_t raddr = fip->raddr + rd_off;
+
+               rpmem_fip_lane_begin(lanep, FI_READ);
+
+               ret = rpmem_fip_readmsg(lanep->ep, &rd_lane.read,
+                               rd_buff, rd_len, raddr);
+               if (ret) {
+                       RPMEM_FI_ERR(ret, "RMA read");
+                       goto err_readmsg;
+               }
+
+               VALGRIND_DO_MAKE_MEM_DEFINED(rd_buff, rd_len);
+
+               ret = rpmem_fip_lane_wait(fip, lanep, FI_READ);
+               if (ret) {
+                       ERR("error when processing read request");
+                       goto err_lane_wait;
+               }
+
+               memcpy(&cbuff[rd], rd_buff, rd_len);
+
+               rd += rd_len;
+       }
+
+       ret = 0;
+err_lane_wait:
+err_readmsg:
+       RPMEM_FI_CLOSE(rd_mr, "unregistering memory");
+err_rd_mr:
+       free(rd_buff);
+err_malloc_rd_buff:
+       if (unlikely(rpmem_fip_is_closing(fip)))
+               return ECONNRESET; /* it will be passed to errno */
+
+       return ret;
+}
+
+/*
+ * parse_bool -- convert string value to boolean
+ */
+static int
+parse_bool(const char *str_value)
+{
+       if (strcmp(str_value, "0") == 0 ||
+                       strcasecmp(str_value, "false") == 0 ||
+                       strcasecmp(str_value, "no") == 0 ||
+                       strcasecmp(str_value, "off") == 0) {
+               return 0;
+       }
+
+       if (strcmp(str_value, "1") == 0 ||
+                       strcasecmp(str_value, "true") == 0 ||
+                       strcasecmp(str_value, "yes") == 0 ||
+                       strcasecmp(str_value, "on") == 0) {
+               return 1;
+       }
+
+       return -1;
+}
+
+/*
+ * rpmem_fip_param_get -- read environment variable in the libfabric way
+ *
+ * - If parameter does not exist the output value is not changed.
+ * - If the environment variable is not set the output value is not changed.
+ * - If the environment variable is set and its value is not correct the output
+ * value is set to error value.
+ * - If the environment variable is set and its value is correct the output
+ * value is set according to the environment variable value.
+ */
+static void
+rpmem_fip_param_get(const char *var_name, int *value)
+{
+       struct fi_param *params;
+       int count;
+       int ret = fi_getparams(&params, &count);
+       if (ret != FI_SUCCESS) {
+               RPMEM_FI_ERR(ret, "getting fabric parameters list");
+               return;
+       }
+
+       for (int i = 0; i < count; ++i) {
+               if (strcmp(params[i].name, var_name) != 0)
+                       continue;
+               if (!params[i].value) {
+                       break;
+               }
+               *value = parse_bool(params[i].value);
+               break;
+       }
+
+       fi_freeparams(params);
+}
+
+#define LIBFABRIC_FORK_UNSAFE_VAR "FI_FORK_UNSAFE"
+
+/*
+ * rpmem_fip_probe_fork_safety -- probe if libfabric is fork safe
+ */
+void
+rpmem_fip_probe_fork_safety(void)
+{
+       int *fork_unsafe = &Rpmem_fork_unsafe; /* false by default */
+       rpmem_fip_param_get(LIBFABRIC_FORK_UNSAFE_VAR, fork_unsafe);
+}
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_fip.h b/ceph/src/pmdk/src/librpmem/rpmem_fip.h
new file mode 100644 (file)
index 0000000..406b61d
--- /dev/null
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_fip.h -- rpmem libfabric provider module header file
+ */
+
+#ifndef RPMEM_FIP_H
+#define RPMEM_FIP_H
+
+#include <stdint.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rpmem_fip;
+
+struct rpmem_fip_attr {
+       enum rpmem_provider provider;
+       size_t max_wq_size;
+       enum rpmem_persist_method persist_method;
+       void *laddr;
+       size_t size;
+       size_t buff_size;
+       unsigned nlanes;
+       void *raddr;
+       uint64_t rkey;
+};
+
+struct rpmem_fip *rpmem_fip_init(const char *node, const char *service,
+               struct rpmem_fip_attr *attr, unsigned *nlanes);
+void rpmem_fip_fini(struct rpmem_fip *fip);
+
+int rpmem_fip_connect(struct rpmem_fip *fip);
+int rpmem_fip_close(struct rpmem_fip *fip);
+int rpmem_fip_process_start(struct rpmem_fip *fip);
+int rpmem_fip_process_stop(struct rpmem_fip *fip);
+
+int rpmem_fip_flush(struct rpmem_fip *fip, size_t offset, size_t len,
+               unsigned lane, unsigned flags);
+
+int rpmem_fip_drain(struct rpmem_fip *fip, unsigned lane);
+
+int rpmem_fip_persist(struct rpmem_fip *fip, size_t offset, size_t len,
+               unsigned lane, unsigned flags);
+
+int rpmem_fip_read(struct rpmem_fip *fip, void *buff,
+               size_t len, size_t off, unsigned lane);
+void rpmem_fip_probe_fork_safety(void);
+
+size_t rpmem_fip_get_wq_size(struct rpmem_fip *fip);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_obc.c b/ceph/src/pmdk/src/librpmem/rpmem_obc.c
new file mode 100644 (file)
index 0000000..ace16d7
--- /dev/null
@@ -0,0 +1,677 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * rpmem_obc.c -- rpmem out-of-band connection client source file
+ */
+
+#include <stdlib.h>
+#include <netdb.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "librpmem.h"
+#include "rpmem.h"
+#include "rpmem_common.h"
+#include "rpmem_obc.h"
+#include "rpmem_proto.h"
+#include "rpmem_util.h"
+#include "rpmem_ssh.h"
+#include "out.h"
+#include "sys_util.h"
+#include "util.h"
+
+/*
+ * rpmem_obc -- rpmem out-of-band client connection handle
+ */
+struct rpmem_obc {
+       struct rpmem_ssh *ssh;
+};
+
+/*
+ * rpmem_obc_is_connected -- (internal) return non-zero value if client is
+ * connected
+ */
+static inline int
+rpmem_obc_is_connected(struct rpmem_obc *rpc)
+{
+       return rpc->ssh != NULL;
+}
+
+/*
+ * rpmem_obc_check_ibc_attr -- (internal) check in-band connection
+ * attributes
+ */
+static int
+rpmem_obc_check_ibc_attr(struct rpmem_msg_ibc_attr *ibc)
+{
+       if (ibc->port == 0 || ibc->port > UINT16_MAX) {
+               ERR("invalid port number received -- %u", ibc->port);
+               errno = EPROTO;
+               return -1;
+       }
+
+       if (ibc->persist_method != RPMEM_PM_GPSPM &&
+               ibc->persist_method != RPMEM_PM_APM) {
+               ERR("invalid persistency method received -- %u",
+                               ibc->persist_method);
+               errno = EPROTO;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_check_port -- (internal) verify target node port number
+ */
+static int
+rpmem_obc_check_port(const struct rpmem_target_info *info)
+{
+       if (!(info->flags & RPMEM_HAS_SERVICE))
+               return 0;
+
+       if (*info->service == '\0') {
+               ERR("invalid port number -- '%s'", info->service);
+               goto err;
+       }
+
+       errno = 0;
+       char *endptr;
+       long port = strtol(info->service, &endptr, 10);
+       if (errno || *endptr != '\0') {
+               ERR("invalid port number -- '%s'", info->service);
+               goto err;
+       }
+
+       if (port < 1) {
+               ERR("port number must be positive -- '%s'", info->service);
+               goto err;
+       }
+
+       if (port > UINT16_MAX) {
+               ERR("port number too large -- '%s'", info->service);
+               goto err;
+       }
+
+       return 0;
+err:
+       errno = EINVAL;
+       return -1;
+}
+
+/*
+ * rpmem_obc_close_conn -- (internal) close connection
+ */
+static void
+rpmem_obc_close_conn(struct rpmem_obc *rpc)
+{
+       rpmem_ssh_close(rpc->ssh);
+
+       (void) util_fetch_and_and64(&rpc->ssh, 0);
+}
+
+/*
+ * rpmem_obc_init_msg_hdr -- (internal) initialize message header
+ */
+static void
+rpmem_obc_set_msg_hdr(struct rpmem_msg_hdr *hdrp,
+       enum rpmem_msg_type type, size_t size)
+{
+       hdrp->type = type;
+       hdrp->size = size;
+}
+
+/*
+ * rpmem_obc_set_pool_desc -- (internal) fill the pool descriptor field
+ */
+static void
+rpmem_obc_set_pool_desc(struct rpmem_msg_pool_desc *pool_desc,
+       const char *desc, size_t size)
+{
+       RPMEM_ASSERT(size <= UINT32_MAX);
+       RPMEM_ASSERT(size > 0);
+
+       pool_desc->size = (uint32_t)size;
+       memcpy(pool_desc->desc, desc, size);
+       pool_desc->desc[size - 1] = '\0';
+}
+
+/*
+ * rpmem_obc_alloc_create_msg -- (internal) allocate and fill create request
+ * message
+ */
+static struct rpmem_msg_create *
+rpmem_obc_alloc_create_msg(const struct rpmem_req_attr *req,
+       const struct rpmem_pool_attr *pool_attr, size_t *msg_sizep)
+{
+       size_t pool_desc_size = strlen(req->pool_desc) + 1;
+       size_t msg_size = sizeof(struct rpmem_msg_create) + pool_desc_size;
+       struct rpmem_msg_create *msg = malloc(msg_size);
+       if (!msg) {
+               ERR("!cannot allocate create request message");
+               return NULL;
+       }
+
+       rpmem_obc_set_msg_hdr(&msg->hdr, RPMEM_MSG_TYPE_CREATE, msg_size);
+
+       msg->c.major = RPMEM_PROTO_MAJOR;
+       msg->c.minor = RPMEM_PROTO_MINOR;
+       msg->c.pool_size = req->pool_size;
+       msg->c.nlanes = req->nlanes;
+       msg->c.provider = req->provider;
+       msg->c.buff_size = req->buff_size;
+
+       rpmem_obc_set_pool_desc(&msg->pool_desc,
+                       req->pool_desc, pool_desc_size);
+
+       if (pool_attr) {
+               pack_rpmem_pool_attr(pool_attr, &msg->pool_attr);
+       } else {
+               RPMEM_LOG(INFO, "using zeroed pool attributes");
+               memset(&msg->pool_attr, 0, sizeof(msg->pool_attr));
+       }
+
+       *msg_sizep = msg_size;
+       return msg;
+}
+
+/*
+ * rpmem_obc_check_req -- (internal) check request attributes
+ */
+static int
+rpmem_obc_check_req(const struct rpmem_req_attr *req)
+{
+       if (req->provider >= MAX_RPMEM_PROV) {
+               ERR("invalid provider specified -- %u", req->provider);
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_obj_check_hdr_resp -- (internal) check response message header
+ */
+static int
+rpmem_obc_check_hdr_resp(struct rpmem_msg_hdr_resp *resp,
+       enum rpmem_msg_type type, size_t size)
+{
+       if (resp->type != type) {
+               ERR("invalid message type received -- %u", resp->type);
+               errno = EPROTO;
+               return -1;
+       }
+
+       if (resp->size != size) {
+               ERR("invalid message size received -- %lu", resp->size);
+               errno = EPROTO;
+               return -1;
+       }
+
+       if (resp->status >= MAX_RPMEM_ERR) {
+               ERR("invalid status received -- %u", resp->status);
+               errno = EPROTO;
+               return -1;
+       }
+
+       if (resp->status) {
+               enum rpmem_err status = (enum rpmem_err)resp->status;
+               ERR("%s", rpmem_util_proto_errstr(status));
+               errno = rpmem_util_proto_errno(status);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_check_create_resp -- (internal) check create response message
+ */
+static int
+rpmem_obc_check_create_resp(struct rpmem_msg_create_resp *resp)
+{
+       if (rpmem_obc_check_hdr_resp(&resp->hdr, RPMEM_MSG_TYPE_CREATE_RESP,
+                       sizeof(struct rpmem_msg_create_resp)))
+               return -1;
+
+       if (rpmem_obc_check_ibc_attr(&resp->ibc))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_get_res -- (internal) read response attributes
+ */
+static void
+rpmem_obc_get_res(struct rpmem_resp_attr *res,
+       struct rpmem_msg_ibc_attr *ibc)
+{
+       res->port = (unsigned short)ibc->port;
+       res->rkey = ibc->rkey;
+       res->raddr = ibc->raddr;
+       res->persist_method =
+               (enum rpmem_persist_method)ibc->persist_method;
+       res->nlanes = ibc->nlanes;
+}
+
+/*
+ * rpmem_obc_alloc_open_msg -- (internal) allocate and fill open request message
+ */
+static struct rpmem_msg_open *
+rpmem_obc_alloc_open_msg(const struct rpmem_req_attr *req,
+       const struct rpmem_pool_attr *pool_attr, size_t *msg_sizep)
+{
+       size_t pool_desc_size = strlen(req->pool_desc) + 1;
+       size_t msg_size = sizeof(struct rpmem_msg_open) + pool_desc_size;
+       struct rpmem_msg_open *msg = malloc(msg_size);
+       if (!msg) {
+               ERR("!cannot allocate open request message");
+               return NULL;
+       }
+
+       rpmem_obc_set_msg_hdr(&msg->hdr, RPMEM_MSG_TYPE_OPEN, msg_size);
+
+       msg->c.major = RPMEM_PROTO_MAJOR;
+       msg->c.minor = RPMEM_PROTO_MINOR;
+       msg->c.pool_size = req->pool_size;
+       msg->c.nlanes = req->nlanes;
+       msg->c.provider = req->provider;
+       msg->c.buff_size = req->buff_size;
+
+       rpmem_obc_set_pool_desc(&msg->pool_desc,
+                       req->pool_desc, pool_desc_size);
+
+       *msg_sizep = msg_size;
+       return msg;
+}
+
+/*
+ * rpmem_obc_check_open_resp -- (internal) check open response message
+ */
+static int
+rpmem_obc_check_open_resp(struct rpmem_msg_open_resp *resp)
+{
+       if (rpmem_obc_check_hdr_resp(&resp->hdr, RPMEM_MSG_TYPE_OPEN_RESP,
+                       sizeof(struct rpmem_msg_open_resp)))
+               return -1;
+
+       if (rpmem_obc_check_ibc_attr(&resp->ibc))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_check_close_resp -- (internal) check close response message
+ */
+static int
+rpmem_obc_check_close_resp(struct rpmem_msg_close_resp *resp)
+{
+       if (rpmem_obc_check_hdr_resp(&resp->hdr, RPMEM_MSG_TYPE_CLOSE_RESP,
+                       sizeof(struct rpmem_msg_close_resp)))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_check_set_attr_resp -- (internal) check set attributes response
+ * message
+ */
+static int
+rpmem_obc_check_set_attr_resp(struct rpmem_msg_set_attr_resp *resp)
+{
+       if (rpmem_obc_check_hdr_resp(&resp->hdr, RPMEM_MSG_TYPE_SET_ATTR_RESP,
+                       sizeof(struct rpmem_msg_set_attr_resp)))
+               return -1;
+
+       return 0;
+}
+
+/*
+ * rpmem_obc_init -- initialize rpmem obc handle
+ */
+struct rpmem_obc *
+rpmem_obc_init(void)
+{
+       struct rpmem_obc *rpc = calloc(1, sizeof(*rpc));
+       if (!rpc) {
+               RPMEM_LOG(ERR, "!allocation of rpmem obc failed");
+               return NULL;
+       }
+
+       return rpc;
+}
+
+/*
+ * rpmem_obc_fini -- destroy rpmem obc handle
+ *
+ * This function must be called with connection already closed - after calling
+ * the rpmem_obc_disconnect or after receiving relevant value from
+ * rpmem_obc_monitor.
+ */
+void
+rpmem_obc_fini(struct rpmem_obc *rpc)
+{
+       free(rpc);
+}
+
+/*
+ * rpmem_obc_connect -- connect to target node
+ *
+ * Connects to target node, the target must be in the following format:
+ * <addr>[:<port>]. If the port number is not specified the default
+ * ssh port will be used. The <addr> is translated into IP address.
+ *
+ * Returns an error if connection is already established.
+ */
+int
+rpmem_obc_connect(struct rpmem_obc *rpc, const struct rpmem_target_info *info)
+{
+       if (rpmem_obc_is_connected(rpc)) {
+               errno = EALREADY;
+               goto err_notconnected;
+       }
+
+       if (rpmem_obc_check_port(info))
+               goto err_port;
+
+       rpc->ssh = rpmem_ssh_open(info);
+       if (!rpc->ssh)
+               goto err_ssh_open;
+
+       return 0;
+err_ssh_open:
+err_port:
+err_notconnected:
+       return -1;
+}
+
+/*
+ * rpmem_obc_disconnect -- close the connection to target node
+ *
+ * Returns error if socket is not connected.
+ */
+int
+rpmem_obc_disconnect(struct rpmem_obc *rpc)
+{
+       if (rpmem_obc_is_connected(rpc)) {
+               rpmem_obc_close_conn(rpc);
+               return 0;
+       }
+
+       errno = ENOTCONN;
+       return -1;
+}
+
+/*
+ * rpmem_obc_monitor -- monitor connection with target node
+ *
+ * The nonblock variable indicates whether this function should return
+ * immediately (= 1) or may block (= 0).
+ *
+ * If the function detects that socket was closed by remote peer it is
+ * closed on local side and set to -1, so there is no need to call
+ * rpmem_obc_disconnect function. Please take a look at functions'
+ * descriptions to see which functions cannot be used if the connection
+ * has been already closed.
+ *
+ * This function expects there is no data pending on socket, if any data
+ * is pending this function returns an error and sets errno to EPROTO.
+ *
+ * Return values:
+ * 0   - not connected
+ * 1   - connected
+ * < 0 - error
+ */
+int
+rpmem_obc_monitor(struct rpmem_obc *rpc, int nonblock)
+{
+       if (!rpmem_obc_is_connected(rpc))
+               return 0;
+
+       return rpmem_ssh_monitor(rpc->ssh, nonblock);
+}
+
+/*
+ * rpmem_obc_create -- perform create request operation
+ *
+ * Returns error if connection has not been established yet.
+ */
+int
+rpmem_obc_create(struct rpmem_obc *rpc,
+       const struct rpmem_req_attr *req,
+       struct rpmem_resp_attr *res,
+       const struct rpmem_pool_attr *pool_attr)
+{
+       if (!rpmem_obc_is_connected(rpc)) {
+               ERR("out-of-band connection not established");
+               errno = ENOTCONN;
+               goto err_notconnected;
+       }
+
+       if (rpmem_obc_check_req(req))
+               goto err_req;
+
+       size_t msg_size;
+       struct rpmem_msg_create *msg =
+               rpmem_obc_alloc_create_msg(req, pool_attr, &msg_size);
+       if (!msg)
+               goto err_alloc_msg;
+
+       RPMEM_LOG(INFO, "sending create request message");
+
+       rpmem_hton_msg_create(msg);
+       if (rpmem_ssh_send(rpc->ssh, msg, msg_size)) {
+               ERR("!sending create request message failed");
+               goto err_msg_send;
+       }
+
+       RPMEM_LOG(NOTICE, "create request message sent");
+       RPMEM_LOG(INFO, "receiving create request response");
+
+       struct rpmem_msg_create_resp resp;
+       if (rpmem_ssh_recv(rpc->ssh, &resp,
+                       sizeof(resp))) {
+               ERR("!receiving create request response failed");
+               goto err_msg_recv;
+       }
+
+       RPMEM_LOG(NOTICE, "create request response received");
+
+       rpmem_ntoh_msg_create_resp(&resp);
+
+       if (rpmem_obc_check_create_resp(&resp))
+               goto err_msg_resp;
+
+       rpmem_obc_get_res(res, &resp.ibc);
+
+       free(msg);
+       return 0;
+err_msg_resp:
+err_msg_recv:
+err_msg_send:
+       free(msg);
+err_alloc_msg:
+err_req:
+err_notconnected:
+       return -1;
+}
+
+/*
+ * rpmem_obc_open -- perform open request operation
+ *
+ * Returns error if connection is not already established.
+ */
+int
+rpmem_obc_open(struct rpmem_obc *rpc,
+       const struct rpmem_req_attr *req,
+       struct rpmem_resp_attr *res,
+       struct rpmem_pool_attr *pool_attr)
+{
+       if (!rpmem_obc_is_connected(rpc)) {
+               ERR("out-of-band connection not established");
+               errno = ENOTCONN;
+               goto err_notconnected;
+       }
+
+       if (rpmem_obc_check_req(req))
+               goto err_req;
+
+       size_t msg_size;
+       struct rpmem_msg_open *msg =
+               rpmem_obc_alloc_open_msg(req, pool_attr, &msg_size);
+       if (!msg)
+               goto err_alloc_msg;
+
+       RPMEM_LOG(INFO, "sending open request message");
+
+       rpmem_hton_msg_open(msg);
+       if (rpmem_ssh_send(rpc->ssh, msg, msg_size)) {
+               ERR("!sending open request message failed");
+               goto err_msg_send;
+       }
+
+       RPMEM_LOG(NOTICE, "open request message sent");
+       RPMEM_LOG(INFO, "receiving open request response");
+
+       struct rpmem_msg_open_resp resp;
+       if (rpmem_ssh_recv(rpc->ssh, &resp, sizeof(resp))) {
+               ERR("!receiving open request response failed");
+               goto err_msg_recv;
+       }
+
+       RPMEM_LOG(NOTICE, "open request response received");
+
+       rpmem_ntoh_msg_open_resp(&resp);
+
+       if (rpmem_obc_check_open_resp(&resp))
+               goto err_msg_resp;
+
+       rpmem_obc_get_res(res, &resp.ibc);
+       if (pool_attr)
+               unpack_rpmem_pool_attr(&resp.pool_attr, pool_attr);
+
+       free(msg);
+       return 0;
+err_msg_resp:
+err_msg_recv:
+err_msg_send:
+       free(msg);
+err_alloc_msg:
+err_req:
+err_notconnected:
+       return -1;
+}
+
+/*
+ * rpmem_obc_set_attr -- perform set attributes request operation
+ *
+ * Returns error if connection is not already established.
+ */
+int
+rpmem_obc_set_attr(struct rpmem_obc *rpc,
+       const struct rpmem_pool_attr *pool_attr)
+{
+       if (!rpmem_obc_is_connected(rpc)) {
+               ERR("out-of-band connection not established");
+               errno = ENOTCONN;
+               goto err_notconnected;
+       }
+
+       struct rpmem_msg_set_attr msg;
+       rpmem_obc_set_msg_hdr(&msg.hdr, RPMEM_MSG_TYPE_SET_ATTR, sizeof(msg));
+       if (pool_attr) {
+               memcpy(&msg.pool_attr, pool_attr, sizeof(msg.pool_attr));
+       } else {
+               RPMEM_LOG(INFO, "using zeroed pool attributes");
+               memset(&msg.pool_attr, 0, sizeof(msg.pool_attr));
+       }
+
+       RPMEM_LOG(INFO, "sending set attributes request message");
+
+       rpmem_hton_msg_set_attr(&msg);
+       if (rpmem_ssh_send(rpc->ssh, &msg, sizeof(msg))) {
+               ERR("!sending set attributes request message failed");
+               goto err_msg_send;
+       }
+
+       RPMEM_LOG(NOTICE, "set attributes request message sent");
+       RPMEM_LOG(INFO, "receiving set attributes request response");
+
+       struct rpmem_msg_set_attr_resp resp;
+       if (rpmem_ssh_recv(rpc->ssh, &resp,
+                       sizeof(resp))) {
+               ERR("!receiving set attributes request response failed");
+               goto err_msg_recv;
+       }
+
+       RPMEM_LOG(NOTICE, "set attributes request response received");
+
+       rpmem_ntoh_msg_set_attr_resp(&resp);
+
+       if (rpmem_obc_check_set_attr_resp(&resp))
+               goto err_msg_resp;
+
+       return 0;
+err_msg_resp:
+err_msg_recv:
+err_msg_send:
+err_notconnected:
+       return -1;
+}
+
+/*
+ * rpmem_obc_close -- perform close request operation
+ *
+ * Returns error if connection is not already established.
+ *
+ * NOTE: this function does not close the connection, but sends close request
+ * message to remote node and receives a response. The connection must be
+ * closed using rpmem_obc_disconnect function.
+ */
+int
+rpmem_obc_close(struct rpmem_obc *rpc, int flags)
+{
+       if (!rpmem_obc_is_connected(rpc)) {
+               errno = ENOTCONN;
+               return -1;
+       }
+
+       struct rpmem_msg_close msg;
+       rpmem_obc_set_msg_hdr(&msg.hdr, RPMEM_MSG_TYPE_CLOSE, sizeof(msg));
+       msg.flags = (uint32_t)flags;
+
+       RPMEM_LOG(INFO, "sending close request message");
+
+       rpmem_hton_msg_close(&msg);
+       if (rpmem_ssh_send(rpc->ssh, &msg, sizeof(msg))) {
+               RPMEM_LOG(ERR, "!sending close request failed");
+               return -1;
+       }
+
+       RPMEM_LOG(NOTICE, "close request message sent");
+       RPMEM_LOG(INFO, "receiving close request response");
+
+       struct rpmem_msg_close_resp resp;
+       if (rpmem_ssh_recv(rpc->ssh, &resp,
+                       sizeof(resp))) {
+               RPMEM_LOG(ERR, "!receiving close request response failed");
+               return -1;
+       }
+
+       RPMEM_LOG(NOTICE, "close request response received");
+
+       rpmem_ntoh_msg_close_resp(&resp);
+
+       if (rpmem_obc_check_close_resp(&resp))
+               return -1;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_obc.h b/ceph/src/pmdk/src/librpmem/rpmem_obc.h
new file mode 100644 (file)
index 0000000..c372baa
--- /dev/null
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_obc.h -- rpmem out-of-band connection client header file
+ */
+
+#ifndef RPMEM_OBC_H
+#define RPMEM_OBC_H 1
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "librpmem.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rpmem_obc;
+
+struct rpmem_obc *rpmem_obc_init(void);
+void rpmem_obc_fini(struct rpmem_obc *rpc);
+
+int rpmem_obc_connect(struct rpmem_obc *rpc,
+               const struct rpmem_target_info *info);
+int rpmem_obc_disconnect(struct rpmem_obc *rpc);
+
+int rpmem_obc_monitor(struct rpmem_obc *rpc, int nonblock);
+
+int rpmem_obc_create(struct rpmem_obc *rpc,
+               const struct rpmem_req_attr *req,
+               struct rpmem_resp_attr *res,
+               const struct rpmem_pool_attr *pool_attr);
+int rpmem_obc_open(struct rpmem_obc *rpc,
+               const struct rpmem_req_attr *req,
+               struct rpmem_resp_attr *res,
+               struct rpmem_pool_attr *pool_attr);
+int rpmem_obc_set_attr(struct rpmem_obc *rpc,
+               const struct rpmem_pool_attr *pool_attr);
+int rpmem_obc_close(struct rpmem_obc *rpc, int flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_ssh.c b/ceph/src/pmdk/src/librpmem/rpmem_ssh.c
new file mode 100644 (file)
index 0000000..7157958
--- /dev/null
@@ -0,0 +1,442 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_ssh.c -- rpmem ssh transport layer source file
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "util.h"
+#include "os.h"
+#include "out.h"
+#include "rpmem_common.h"
+#include "rpmem_ssh.h"
+#include "rpmem_cmd.h"
+#include "rpmem_util.h"
+
+#define ERR_BUFF_LEN   4095
+
+/* +1 in order to be sure it is always null-terminated */
+static char error_str[ERR_BUFF_LEN + 1];
+
+struct rpmem_ssh {
+       struct rpmem_cmd *cmd;
+};
+
+/*
+ * get_ssh -- return ssh command name
+ */
+static const char *
+get_ssh(void)
+{
+       char *cmd = os_getenv(RPMEM_SSH_ENV);
+       if (!cmd)
+               cmd = RPMEM_DEF_SSH;
+
+       return cmd;
+}
+
+/*
+ * get_user_at_node -- returns string containing user@node
+ */
+static char *
+get_user_at_node(const struct rpmem_target_info *info)
+{
+       char *user_at_node = NULL;
+
+       if (info->flags & RPMEM_HAS_USER) {
+               size_t ulen = strlen(info->user);
+               size_t nlen = strlen(info->node);
+               size_t len = ulen + 1 + nlen + 1;
+               user_at_node = malloc(len);
+               if (!user_at_node)
+                       goto err_malloc;
+               int ret = util_snprintf(user_at_node, len, "%s@%s",
+                               info->user, info->node);
+               if (ret < 0)
+                       goto err_printf;
+       } else {
+               user_at_node = strdup(info->node);
+               if (!user_at_node)
+                       goto err_malloc;
+       }
+
+       return user_at_node;
+err_printf:
+       free(user_at_node);
+err_malloc:
+       return NULL;
+}
+
+/*
+ * get_cmd -- return an RPMEM_CMD with appended list of arguments
+ */
+static char *
+get_cmd(const char **argv)
+{
+       const char *env_cmd = rpmem_util_cmd_get();
+       char *cmd = strdup(env_cmd);
+       if (!cmd)
+               return NULL;
+
+       size_t cmd_len = strlen(cmd) + 1;
+
+       const char *arg;
+       while ((arg = *argv++) != NULL) {
+               size_t len = strlen(arg);
+               size_t new_cmd_len = cmd_len + len + 1;
+               char *tmp = realloc(cmd, new_cmd_len);
+               if (!tmp)
+                       goto err;
+
+               cmd = tmp;
+
+               /* append the argument to the command */
+               cmd[cmd_len - 1] = ' ';
+               memcpy(&cmd[cmd_len], arg, len);
+               cmd[cmd_len + len] = '\0';
+
+               cmd_len = new_cmd_len;
+       }
+
+       return cmd;
+err:
+       free(cmd);
+       return NULL;
+}
+
+/*
+ * valist_to_argv -- convert va_list to argv array
+ */
+static const char **
+valist_to_argv(va_list args)
+{
+       const char **argv = malloc(sizeof(const char *));
+       if (!argv)
+               return NULL;
+
+       argv[0] = NULL;
+       size_t nargs = 0;
+
+       const char *arg;
+       while ((arg = va_arg(args, const char *)) != NULL) {
+               nargs++;
+               const char **tmp = realloc(argv,
+                               (nargs + 1) * sizeof(const char *));
+               if (!tmp)
+                       goto err;
+
+               argv = tmp;
+               argv[nargs - 1] = arg;
+               argv[nargs] = NULL;
+       }
+
+       return argv;
+err:
+       free(argv);
+       return NULL;
+}
+
+/*
+ * rpmem_ssh_execv -- open ssh connection and run $RPMEMD_CMD with
+ * additional NULL-terminated list of arguments.
+ */
+struct rpmem_ssh *
+rpmem_ssh_execv(const struct rpmem_target_info *info, const char **argv)
+{
+       struct rpmem_ssh *rps = calloc(1, sizeof(*rps));
+       if (!rps)
+               goto err_zalloc;
+
+       char *user_at_node = get_user_at_node(info);
+       if (!user_at_node)
+               goto err_user_node;
+
+       rps->cmd = rpmem_cmd_init();
+       if (!rps->cmd)
+               goto err_cmd_init;
+
+       char *cmd = get_cmd(argv);
+       if (!cmd)
+               goto err_cmd;
+
+       int ret = rpmem_cmd_push(rps->cmd, get_ssh());
+       if (ret)
+               goto err_push;
+
+       if (info->flags & RPMEM_HAS_SERVICE) {
+               /* port number is optional */
+               ret = rpmem_cmd_push(rps->cmd, "-p");
+               if (ret)
+                       goto err_push;
+               ret = rpmem_cmd_push(rps->cmd, info->service);
+               if (ret)
+                       goto err_push;
+       }
+
+       /*
+        * Disable allocating pseudo-terminal in order to transfer binary
+        * data safely.
+        */
+       ret = rpmem_cmd_push(rps->cmd, "-T");
+       if (ret)
+               goto err_push;
+
+       if (info->flags & RPMEM_FLAGS_USE_IPV4) {
+               ret = rpmem_cmd_push(rps->cmd, "-4");
+               if (ret)
+                       goto err_push;
+       }
+
+       /* fail if password required for authentication */
+       ret = rpmem_cmd_push(rps->cmd, "-oBatchMode=yes");
+       if (ret)
+               goto err_push;
+
+       ret = rpmem_cmd_push(rps->cmd, user_at_node);
+       if (ret)
+               goto err_push;
+
+       ret = rpmem_cmd_push(rps->cmd, cmd);
+       if (ret)
+               goto err_push;
+
+       ret = rpmem_cmd_run(rps->cmd);
+       if (ret)
+               goto err_run;
+
+       free(user_at_node);
+       free(cmd);
+
+       return rps;
+err_run:
+err_push:
+       free(cmd);
+err_cmd:
+       rpmem_cmd_fini(rps->cmd);
+err_cmd_init:
+       free(user_at_node);
+err_user_node:
+       free(rps);
+err_zalloc:
+       return NULL;
+}
+
+/*
+ * rpmem_ssh_exec -- open ssh connection and run $RPMEMD_CMD with
+ * additional NULL-terminated list of arguments.
+ */
+struct rpmem_ssh *
+rpmem_ssh_exec(const struct rpmem_target_info *info, ...)
+{
+       struct rpmem_ssh *ssh;
+
+       va_list args;
+       va_start(args, info);
+
+       const char **argv = valist_to_argv(args);
+       if (argv)
+               ssh = rpmem_ssh_execv(info, argv);
+       else
+               ssh = NULL;
+
+       va_end(args);
+
+       free(argv);
+
+       return ssh;
+}
+
+/*
+ * rpmem_ssh_open -- open ssh connection with specified node and wait for status
+ */
+struct rpmem_ssh *
+rpmem_ssh_open(const struct rpmem_target_info *info)
+{
+       struct rpmem_ssh *ssh = rpmem_ssh_exec(info, NULL);
+       if (!ssh)
+               return NULL;
+
+       /*
+        * Read initial status from invoked command.
+        * This is for synchronization purposes and to make it possible
+        * to inform client that command's initialization failed.
+        */
+       int32_t status;
+       int ret = rpmem_ssh_recv(ssh, &status, sizeof(status));
+       if (ret) {
+               if (ret == 1 || errno == ECONNRESET)
+                       ERR("%s", rpmem_ssh_strerror(ssh, errno));
+               else
+                       ERR("!%s", info->node);
+               goto err_recv_status;
+       }
+
+       if (status) {
+               ERR("%s: unexpected status received -- '%d'",
+                               info->node, status);
+               errno = status;
+               goto err_status;
+       }
+
+       RPMEM_LOG(INFO, "received status: %u", status);
+
+       return ssh;
+err_recv_status:
+err_status:
+       rpmem_ssh_close(ssh);
+       return NULL;
+}
+
+/*
+ * rpmem_ssh_close -- close ssh connection
+ */
+int
+rpmem_ssh_close(struct rpmem_ssh *rps)
+{
+       int ret, rv;
+
+       rpmem_cmd_term(rps->cmd);
+       rv = rpmem_cmd_wait(rps->cmd, &ret);
+       if (rv)
+               return rv;
+
+       rpmem_cmd_fini(rps->cmd);
+       free(rps);
+
+       if (WIFEXITED(ret))
+               return WEXITSTATUS(ret);
+
+       if (WIFSIGNALED(ret)) {
+               ERR("signal received -- %d", WTERMSIG(ret));
+               return -1;
+       }
+
+       ERR("exit status -- %d", WEXITSTATUS(ret));
+
+       return -1;
+}
+
+/*
+ * rpmem_ssh_send -- send data using ssh transport layer
+ *
+ * The data is encoded using base64.
+ */
+int
+rpmem_ssh_send(struct rpmem_ssh *rps, const void *buff, size_t len)
+{
+       int ret = rpmem_xwrite(rps->cmd->fd_in, buff, len, MSG_NOSIGNAL);
+       if (ret == 1) {
+               errno = ECONNRESET;
+       } else if (ret < 0) {
+               if (errno == EPIPE)
+                       errno = ECONNRESET;
+       }
+
+       return ret;
+}
+
+/*
+ * rpmem_ssh_recv -- receive data using ssh transport layer
+ *
+ * The received data is decoded using base64.
+ */
+int
+rpmem_ssh_recv(struct rpmem_ssh *rps, void *buff, size_t len)
+{
+       int ret = rpmem_xread(rps->cmd->fd_out, buff,
+                       len, MSG_NOSIGNAL);
+       if (ret == 1) {
+               errno = ECONNRESET;
+       } else if (ret < 0) {
+               if (errno == EPIPE)
+                       errno = ECONNRESET;
+       }
+
+       return ret;
+}
+
+/*
+ * rpmem_ssh_monitor -- check connection state of ssh
+ *
+ * Return value:
+ * 0  - disconnected
+ * 1  - connected
+ * <0 - error
+ */
+int
+rpmem_ssh_monitor(struct rpmem_ssh *rps, int nonblock)
+{
+       uint32_t buff;
+       int flags = MSG_PEEK;
+       if (nonblock)
+               flags |= MSG_DONTWAIT;
+
+       int ret = rpmem_xread(rps->cmd->fd_out, &buff, sizeof(buff), flags);
+
+       if (!ret) {
+               errno = EPROTO;
+               return -1;
+       }
+
+       if (ret < 0) {
+               if (errno == EAGAIN || errno == EWOULDBLOCK)
+                       return 1;
+               else
+                       return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_ssh_strerror -- read error using stderr channel
+ */
+const char *
+rpmem_ssh_strerror(struct rpmem_ssh *rps, int oerrno)
+{
+       size_t len = 0;
+       ssize_t ret;
+       while ((ret = read(rps->cmd->fd_err, error_str + len,
+                       ERR_BUFF_LEN - len))) {
+               if (ret < 0)
+                       return "reading error string failed";
+
+               len += (size_t)ret;
+       }
+       error_str[len] = '\0';
+
+       if (len == 0) {
+               int ret;
+               if (oerrno) {
+                       char buff[UTIL_MAX_ERR_MSG];
+                       util_strerror(oerrno, buff, UTIL_MAX_ERR_MSG);
+                       ret = util_snprintf(error_str, ERR_BUFF_LEN,
+                               "%s", buff);
+               } else {
+                       ret = util_snprintf(error_str, ERR_BUFF_LEN,
+                               "unknown error");
+               }
+               if (ret < 0)
+                       FATAL("!snprintf");
+       } else {
+               /* get rid of new line and carriage return chars */
+               char *cr = strchr(error_str, '\r');
+               if (cr)
+                       *cr = '\0';
+
+               char *nl = strchr(error_str, '\n');
+               if (nl)
+                       *nl = '\0';
+       }
+
+       return error_str;
+}
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_ssh.h b/ceph/src/pmdk/src/librpmem/rpmem_ssh.h
new file mode 100644 (file)
index 0000000..97a76cc
--- /dev/null
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_ssh.h -- rpmem ssh transport layer header file
+ */
+#ifndef RPMEM_SSH_H
+#define RPMEM_SSH_H 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rpmem_ssh;
+
+struct rpmem_ssh *rpmem_ssh_open(const struct rpmem_target_info *info);
+struct rpmem_ssh *rpmem_ssh_exec(const struct rpmem_target_info *info, ...);
+struct rpmem_ssh *rpmem_ssh_execv(const struct rpmem_target_info *info,
+               const char **argv);
+int rpmem_ssh_close(struct rpmem_ssh *rps);
+
+int rpmem_ssh_send(struct rpmem_ssh *rps, const void *buff, size_t len);
+int rpmem_ssh_recv(struct rpmem_ssh *rps, void *buff, size_t len);
+int rpmem_ssh_monitor(struct rpmem_ssh *rps, int nonblock);
+
+const char *rpmem_ssh_strerror(struct rpmem_ssh *rps, int oerrno);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_util.c b/ceph/src/pmdk/src/librpmem/rpmem_util.c
new file mode 100644 (file)
index 0000000..6709d72
--- /dev/null
@@ -0,0 +1,239 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * rpmem_util.c -- util functions for librpmem source file
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdint.h>
+
+#include "out.h"
+#include "os.h"
+#include "librpmem.h"
+#include "rpmem_proto.h"
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+
+static const struct rpmem_err_str_errno {
+       int err;
+       const char *str;
+} rpmem_err_str_errno[MAX_RPMEM_ERR] = {
+       [RPMEM_SUCCESS] = {
+               .err    = 0,
+               .str    = "Success",
+       },
+       [RPMEM_ERR_BADPROTO] = {
+               .err    = EPROTONOSUPPORT,
+               .str    = "Protocol version number mismatch",
+       },
+       [RPMEM_ERR_BADNAME] = {
+               .err    = EINVAL,
+               .str    = "Invalid pool descriptor",
+       },
+       [RPMEM_ERR_BADSIZE] = {
+               .err    = EFBIG,
+               .str    = "Invalid pool size",
+       },
+       [RPMEM_ERR_BADNLANES] = {
+               .err    = EINVAL,
+               .str    = "Invalid number of lanes",
+       },
+       [RPMEM_ERR_BADPROVIDER] = {
+               .err    = EINVAL,
+               .str    = "Invalid provider",
+       },
+       [RPMEM_ERR_FATAL] = {
+               .err    = EREMOTEIO,
+               .str    = "Fatal error",
+       },
+       [RPMEM_ERR_FATAL_CONN] = {
+               .err    = ECONNABORTED,
+               .str    = "Fatal in-band connection error",
+       },
+       [RPMEM_ERR_BUSY] = {
+               .err    = EBUSY,
+               .str    = "Pool already in use",
+       },
+       [RPMEM_ERR_EXISTS] = {
+               .err    = EEXIST,
+               .str    = "Pool already exists",
+       },
+       [RPMEM_ERR_PROVNOSUP] = {
+               .err    = EMEDIUMTYPE,
+               .str    = "Provider not supported",
+       },
+       [RPMEM_ERR_NOEXIST] = {
+               .err    = ENOENT,
+               .str    = "Pool set or its part doesn't exist or it is "
+                               "unavailable",
+       },
+       [RPMEM_ERR_NOACCESS] = {
+               .err    = EACCES,
+               .str    = "Pool set permission denied",
+       },
+       [RPMEM_ERR_POOL_CFG] = {
+               .err    = EINVAL,
+               .str    = "Invalid pool set configuration",
+       },
+};
+
+static char *Rpmem_cmds;
+static char **Rpmem_cmd_arr;
+static size_t Rpmem_current_cmd;
+static size_t Rpmem_ncmds;
+
+#define RPMEM_CMD_SEPARATOR '|'
+
+/*
+ * rpmem_util_proto_errstr -- return error string for error code
+ */
+const char *
+rpmem_util_proto_errstr(enum rpmem_err err)
+{
+       RPMEM_ASSERT(err < MAX_RPMEM_ERR);
+
+       const char *ret = rpmem_err_str_errno[err].str;
+       RPMEM_ASSERT(ret);
+
+       return ret;
+}
+
+/*
+ * rpmem_util_proto_errno -- return appropriate errno value for error code
+ */
+int
+rpmem_util_proto_errno(enum rpmem_err err)
+{
+       RPMEM_ASSERT(err < MAX_RPMEM_ERR);
+
+       return rpmem_err_str_errno[err].err;
+}
+
+/*
+ * rpmem_util_cmds_inc -- increase size of array for rpmem commands
+ */
+static void
+rpmem_util_cmds_inc(void)
+{
+       Rpmem_ncmds++;
+       Rpmem_cmd_arr = realloc(Rpmem_cmd_arr,
+                       Rpmem_ncmds * sizeof(*Rpmem_cmd_arr));
+       if (!Rpmem_cmd_arr)
+               RPMEM_FATAL("!realloc");
+
+}
+
+/*
+ * rpmem_util_cmds_init -- read a RPMEM_CMD from the environment variable
+ */
+void
+rpmem_util_cmds_init(void)
+{
+       char *cmd = os_getenv(RPMEM_CMD_ENV);
+       if (!cmd)
+               cmd = RPMEM_DEF_CMD;
+
+       Rpmem_cmds = strdup(cmd);
+       if (!Rpmem_cmds)
+               RPMEM_FATAL("!strdup");
+
+       char *next = Rpmem_cmds;
+       while (next) {
+               rpmem_util_cmds_inc();
+               Rpmem_cmd_arr[Rpmem_ncmds - 1] = next;
+
+               next = strchr(next, RPMEM_CMD_SEPARATOR);
+               if (next) {
+                       *next = '\0';
+                       next++;
+               }
+       }
+}
+
+/*
+ * rpmem_util_env_fini -- release RPMEM_CMD copy
+ */
+void
+rpmem_util_cmds_fini(void)
+{
+       RPMEM_ASSERT(Rpmem_cmds);
+       RPMEM_ASSERT(Rpmem_cmd_arr);
+       RPMEM_ASSERT(Rpmem_current_cmd < Rpmem_ncmds);
+
+       free(Rpmem_cmds);
+       Rpmem_cmds = NULL;
+
+       free(Rpmem_cmd_arr);
+       Rpmem_cmd_arr = NULL;
+
+       Rpmem_ncmds = 0;
+       Rpmem_current_cmd = 0;
+}
+
+/*
+ * rpmem_util_cmd_get -- get a next command from RPMEM_CMD
+ *
+ * RPMEM_CMD can contain multiple commands separated by RPMEM_CMD_SEPARATOR.
+ * Commands from RPMEM_CMD are read sequentially and used to establish out of
+ * band connections to remote nodes in the order read from a poolset file.
+ *
+ */
+const char *
+rpmem_util_cmd_get(void)
+{
+       RPMEM_ASSERT(Rpmem_cmds);
+       RPMEM_ASSERT(Rpmem_cmd_arr);
+       RPMEM_ASSERT(Rpmem_current_cmd < Rpmem_ncmds);
+
+       char *ret = Rpmem_cmd_arr[Rpmem_current_cmd];
+
+       Rpmem_current_cmd = (Rpmem_current_cmd + 1) % Rpmem_ncmds;
+
+       return ret;
+}
+
+/*
+ * rpmem_util_get_env_uint -- read the unsigned value from environment
+ */
+static void
+rpmem_util_get_env_uint(const char *env, unsigned *pval)
+{
+       char *env_val = os_getenv(env);
+       if (env_val && env_val[0] != '\0') {
+               char *endptr;
+               errno = 0;
+
+               long val = strtol(env_val, &endptr, 10);
+
+               if (endptr[0] != '\0' || val <= 0 ||
+                       (errno == ERANGE &&
+                       (val == LONG_MAX || val == LONG_MIN))) {
+                       RPMEM_LOG(ERR, "%s variable must be a positive integer",
+                                       env);
+               } else {
+                       *pval = val < UINT_MAX ? (unsigned)val: UINT_MAX;
+               }
+       }
+}
+
+/*
+ * rpmem_util_get_env_max_nlanes -- read the maximum number of lanes from
+ * RPMEM_MAX_NLANES
+ */
+void
+rpmem_util_get_env_max_nlanes(unsigned *max_nlanes)
+{
+       rpmem_util_get_env_uint(RPMEM_MAX_NLANES_ENV, max_nlanes);
+}
+
+/*
+ * rpmem_util_get_env_wq_size -- read the required WQ size from env
+ */
+void
+rpmem_util_get_env_wq_size(unsigned *wq_size)
+{
+       rpmem_util_get_env_uint(RPMEM_WQ_SIZE_ENV, wq_size);
+}
diff --git a/ceph/src/pmdk/src/librpmem/rpmem_util.h b/ceph/src/pmdk/src/librpmem/rpmem_util.h
new file mode 100644 (file)
index 0000000..d6006d8
--- /dev/null
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_util.h -- util functions for librpmem header file
+ */
+
+#ifndef RPMEM_UTIL_H
+#define RPMEM_UTIL_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+       LERR = 1,
+       LWARN = 2,
+       LNOTICE = 3,
+       LINFO = 4,
+       _LDBG = 10,
+};
+
+#define RPMEM_LOG(level, fmt, args...) LOG(L##level, fmt, ## args)
+#define RPMEM_DBG(fmt, args...) LOG(_LDBG, fmt, ## args)
+#define RPMEM_FATAL(fmt, args...) FATAL(fmt, ## args)
+#define RPMEM_ASSERT(cond)     ASSERT(cond)
+
+#define RPMEM_PERSIST_FLAGS_ALL                RPMEM_PERSIST_RELAXED
+#define RPMEM_PERSIST_FLAGS_MASK       ((unsigned)(~RPMEM_PERSIST_FLAGS_ALL))
+
+#define RPMEM_FLUSH_FLAGS_ALL          RPMEM_FLUSH_RELAXED
+#define RPMEM_FLUSH_FLAGS_MASK         ((unsigned)(~RPMEM_FLUSH_FLAGS_ALL))
+
+const char *rpmem_util_proto_errstr(enum rpmem_err err);
+int rpmem_util_proto_errno(enum rpmem_err err);
+
+void rpmem_util_cmds_init(void);
+void rpmem_util_cmds_fini(void);
+const char *rpmem_util_cmd_get(void);
+void rpmem_util_get_env_max_nlanes(unsigned *max_nlanes);
+void rpmem_util_get_env_wq_size(unsigned *wq_size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/libvmem/README.md b/ceph/src/pmdk/src/libvmem/README.md
new file mode 100644 (file)
index 0000000..97deea1
--- /dev/null
@@ -0,0 +1,2 @@
+This library has been moved to a
+[separate repository](https://github.com/pmem/vmem).
diff --git a/ceph/src/pmdk/src/libvmmalloc/README.md b/ceph/src/pmdk/src/libvmmalloc/README.md
new file mode 100644 (file)
index 0000000..97deea1
--- /dev/null
@@ -0,0 +1,2 @@
+This library has been moved to a
+[separate repository](https://github.com/pmem/vmem).
diff --git a/ceph/src/pmdk/src/rpmem_common/Makefile b/ceph/src/pmdk/src/rpmem_common/Makefile
new file mode 100644 (file)
index 0000000..006de39
--- /dev/null
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2016, Intel Corporation
+
+#
+# src/rpmem_common/Makefile -- Makefile for rpmem_common
+#
+
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))../..
+HEADERS = $(wildcard *.h)
+
+include $(TOP)/src/common.inc
+
+ifneq ($(filter 1 2, $(CSTYLEON)),)
+TMP_HEADERS := $(addsuffix tmp, $(HEADERS))
+endif
+
+all: $(TMP_HEADERS)
+
+cstyle:
+       $(CSTYLE) *.[ch]
+
+%.htmp: %.h
+       $(call check-cstyle, $<, $@)
+
+clean:
+       $(RM) $(TMP_HEADERS)
+
+clobber: clean
+
+sparse:
+ifeq ($(BUILD_RPMEM),y)
+       $(sparse-c)
+endif
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_common.c b/ceph/src/pmdk/src/rpmem_common/rpmem_common.c
new file mode 100644 (file)
index 0000000..db4f4f2
--- /dev/null
@@ -0,0 +1,314 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_common.c -- common definitions for librpmem and rpmemd
+ */
+
+#include <unistd.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+
+#include "util.h"
+#include "rpmem_common.h"
+#include "rpmem_proto.h"
+#include "rpmem_common_log.h"
+#include "os.h"
+
+unsigned Rpmem_max_nlanes = UINT_MAX;
+
+/*
+ * work queue of size 50 gives best performance of consecutive rpmem_flush
+ * operations with smallest used resources. Default value obtained empirically.
+ */
+unsigned Rpmem_wq_size = 50;
+
+/*
+ * If set, indicates libfabric does not support fork() and consecutive calls to
+ * rpmem_create/rpmem_open must fail.
+ */
+int Rpmem_fork_unsafe;
+
+/*
+ * rpmem_xwrite -- send entire buffer or fail
+ *
+ * Returns 1 if send returned 0.
+ */
+int
+rpmem_xwrite(int fd, const void *buf, size_t len, int flags)
+{
+       size_t wr = 0;
+       const uint8_t *cbuf = buf;
+       while (wr < len) {
+               ssize_t sret;
+               if (!flags)
+                       sret = write(fd, &cbuf[wr], len - wr);
+               else
+                       sret = send(fd, &cbuf[wr], len - wr, flags);
+
+               if (sret == 0)
+                       return 1;
+
+               if (sret < 0)
+                       return (int)sret;
+
+               wr += (size_t)sret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_xread -- read entire buffer or fail
+ *
+ * Returns 1 if recv returned 0.
+ */
+int
+rpmem_xread(int fd, void *buf, size_t len, int flags)
+{
+       size_t rd = 0;
+       uint8_t *cbuf = buf;
+       while (rd < len) {
+               ssize_t sret;
+
+               if (!flags)
+                       sret = read(fd, &cbuf[rd], len - rd);
+               else
+                       sret = recv(fd, &cbuf[rd], len - rd, flags);
+
+               if (sret == 0) {
+                       RPMEMC_DBG(ERR, "recv/read returned 0");
+                       return 1;
+               }
+
+               if (sret < 0)
+                       return (int)sret;
+
+               rd += (size_t)sret;
+       }
+
+       return 0;
+}
+
+static const char *pm2str[MAX_RPMEM_PM] = {
+       [RPMEM_PM_APM] = "Appliance Persistency Method",
+       [RPMEM_PM_GPSPM] = "General Purpose Server Persistency Method",
+};
+
+/*
+ * rpmem_persist_method_to_str -- convert enum rpmem_persist_method to string
+ */
+const char *
+rpmem_persist_method_to_str(enum rpmem_persist_method pm)
+{
+       if (pm >= MAX_RPMEM_PM)
+               return NULL;
+
+       return pm2str[pm];
+}
+
+static const char *provider2str[MAX_RPMEM_PROV] = {
+       [RPMEM_PROV_LIBFABRIC_VERBS] = "verbs",
+       [RPMEM_PROV_LIBFABRIC_SOCKETS] = "sockets",
+};
+
+/*
+ * rpmem_provider_from_str -- convert string to enum rpmem_provider
+ *
+ * Returns RPMEM_PROV_UNKNOWN if provider is not known.
+ */
+enum rpmem_provider
+rpmem_provider_from_str(const char *str)
+{
+       for (enum rpmem_provider p = 0; p < MAX_RPMEM_PROV; p++) {
+               if (provider2str[p] && strcmp(str, provider2str[p]) == 0)
+                       return p;
+       }
+
+       return RPMEM_PROV_UNKNOWN;
+}
+
+/*
+ * rpmem_provider_to_str -- convert enum rpmem_provider to string
+ */
+const char *
+rpmem_provider_to_str(enum rpmem_provider provider)
+{
+       if (provider >= MAX_RPMEM_PROV)
+               return NULL;
+
+       return provider2str[provider];
+}
+
+/*
+ * rpmem_get_ip_str -- converts socket address to string
+ */
+const char *
+rpmem_get_ip_str(const struct sockaddr *addr)
+{
+       static char str[INET6_ADDRSTRLEN + NI_MAXSERV + 1];
+       char ip[INET6_ADDRSTRLEN];
+       struct sockaddr_in *in4;
+       struct sockaddr_in6 *in6;
+
+       switch (addr->sa_family) {
+       case AF_INET:
+               in4 = (struct sockaddr_in *)addr;
+               if (!inet_ntop(AF_INET, &in4->sin_addr, ip, sizeof(ip)))
+                       return NULL;
+               if (util_snprintf(str, sizeof(str), "%s:%u",
+                               ip, ntohs(in4->sin_port)) < 0)
+                       return NULL;
+               break;
+       case AF_INET6:
+               in6 = (struct sockaddr_in6 *)addr;
+               if (!inet_ntop(AF_INET6, &in6->sin6_addr, ip, sizeof(ip)))
+                       return NULL;
+               if (util_snprintf(str, sizeof(str), "%s:%u",
+                               ip, ntohs(in6->sin6_port)) < 0)
+                       return NULL;
+               break;
+       default:
+               return NULL;
+       }
+
+       return str;
+}
+
+/*
+ * rpmem_target_parse -- parse target info
+ */
+struct rpmem_target_info *
+rpmem_target_parse(const char *target)
+{
+       struct rpmem_target_info *info = calloc(1, sizeof(*info));
+       if (!info)
+               return NULL;
+
+       char *str = strdup(target);
+       if (!str)
+               goto err_strdup;
+
+       char *tmp = strchr(str, '@');
+       if (tmp) {
+               *tmp = '\0';
+               info->flags |= RPMEM_HAS_USER;
+               strncpy(info->user, str, sizeof(info->user) - 1);
+               tmp++;
+       } else {
+               tmp = str;
+       }
+
+       if (*tmp == '[') {
+               tmp++;
+               /* IPv6 */
+               char *end = strchr(tmp, ']');
+               if (!end) {
+                       errno = EINVAL;
+                       goto err_ipv6;
+               }
+
+               *end = '\0';
+               strncpy(info->node, tmp, sizeof(info->node) - 1);
+               tmp = end + 1;
+
+               end = strchr(tmp, ':');
+               if (end) {
+                       *end = '\0';
+                       end++;
+                       info->flags |= RPMEM_HAS_SERVICE;
+                       strncpy(info->service, end, sizeof(info->service) - 1);
+               }
+       } else {
+               char *first = strchr(tmp, ':');
+               char *last = strrchr(tmp, ':');
+               if (first == last) {
+                       /* IPv4 - one colon */
+                       if (first) {
+                               *first = '\0';
+                               first++;
+                               info->flags |= RPMEM_HAS_SERVICE;
+                               strncpy(info->service, first,
+                                               sizeof(info->service) - 1);
+                       }
+               }
+
+               strncpy(info->node, tmp, sizeof(info->node) - 1);
+       }
+
+       if (*info->node == '\0') {
+               errno = EINVAL;
+               goto err_node;
+       }
+
+       free(str);
+
+       /* make sure that user, node and service are NULL-terminated */
+       info->user[sizeof(info->user) - 1] = '\0';
+       info->node[sizeof(info->node) - 1] = '\0';
+       info->service[sizeof(info->service) - 1] = '\0';
+
+       return info;
+err_node:
+err_ipv6:
+       free(str);
+err_strdup:
+       free(info);
+       return NULL;
+}
+
+/*
+ * rpmem_target_free -- free target info
+ */
+void
+rpmem_target_free(struct rpmem_target_info *info)
+{
+       free(info);
+}
+
+/*
+ * rpmem_get_ssh_conn_addr -- returns an address which the ssh connection is
+ * established on
+ *
+ * This function utilizes the SSH_CONNECTION environment variable to retrieve
+ * the server IP address. See ssh(1) for details.
+ */
+char *
+rpmem_get_ssh_conn_addr(void)
+{
+       char *ssh_conn = os_getenv("SSH_CONNECTION");
+       if (!ssh_conn) {
+               RPMEMC_LOG(ERR, "SSH_CONNECTION variable is not set");
+               return NULL;
+       }
+
+       char *sp = strchr(ssh_conn, ' ');
+       if (!sp)
+               goto err_fmt;
+
+       char *addr = strchr(sp + 1, ' ');
+       if (!addr)
+               goto err_fmt;
+
+       addr++;
+
+       sp = strchr(addr, ' ');
+       if (!sp)
+               goto err_fmt;
+
+       *sp = '\0';
+
+       return addr;
+err_fmt:
+       RPMEMC_LOG(ERR, "invalid format of SSH_CONNECTION variable");
+       return NULL;
+}
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_common.h b/ceph/src/pmdk/src/rpmem_common/rpmem_common.h
new file mode 100644 (file)
index 0000000..20d1833
--- /dev/null
@@ -0,0 +1,139 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_common.h -- common definitions for librpmem and rpmemd
+ */
+
+#ifndef RPMEM_COMMON_H
+#define RPMEM_COMMON_H 1
+
+/*
+ * Values for SO_KEEPALIVE socket option
+ */
+
+#define RPMEM_CMD_ENV  "RPMEM_CMD"
+#define RPMEM_SSH_ENV  "RPMEM_SSH"
+#define RPMEM_DEF_CMD  "rpmemd"
+#define RPMEM_DEF_SSH  "ssh"
+#define RPMEM_PROV_SOCKET_ENV  "RPMEM_ENABLE_SOCKETS"
+#define RPMEM_PROV_VERBS_ENV   "RPMEM_ENABLE_VERBS"
+#define RPMEM_MAX_NLANES_ENV   "RPMEM_MAX_NLANES"
+#define RPMEM_WQ_SIZE_ENV      "RPMEM_WORK_QUEUE_SIZE"
+#define RPMEM_ACCEPT_TIMEOUT 30000
+#define RPMEM_CONNECT_TIMEOUT 30000
+#define RPMEM_MONITOR_TIMEOUT 1000
+
+#include <stdint.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * rpmem_err -- error codes
+ */
+enum rpmem_err {
+       RPMEM_SUCCESS           = 0,
+       RPMEM_ERR_BADPROTO      = 1,
+       RPMEM_ERR_BADNAME       = 2,
+       RPMEM_ERR_BADSIZE       = 3,
+       RPMEM_ERR_BADNLANES     = 4,
+       RPMEM_ERR_BADPROVIDER   = 5,
+       RPMEM_ERR_FATAL         = 6,
+       RPMEM_ERR_FATAL_CONN    = 7,
+       RPMEM_ERR_BUSY          = 8,
+       RPMEM_ERR_EXISTS        = 9,
+       RPMEM_ERR_PROVNOSUP     = 10,
+       RPMEM_ERR_NOEXIST       = 11,
+       RPMEM_ERR_NOACCESS      = 12,
+       RPMEM_ERR_POOL_CFG      = 13,
+
+       MAX_RPMEM_ERR,
+};
+
+/*
+ * rpmem_persist_method -- remote persist operation method
+ */
+enum rpmem_persist_method {
+       RPMEM_PM_GPSPM  = 1,    /* General Purpose Server Persistency Method */
+       RPMEM_PM_APM    = 2,    /* Appliance Persistency Method */
+
+       MAX_RPMEM_PM,
+};
+
+const char *rpmem_persist_method_to_str(enum rpmem_persist_method pm);
+
+/*
+ * rpmem_provider -- supported providers
+ */
+enum rpmem_provider {
+       RPMEM_PROV_UNKNOWN = 0,
+       RPMEM_PROV_LIBFABRIC_VERBS      = 1,
+       RPMEM_PROV_LIBFABRIC_SOCKETS    = 2,
+
+       MAX_RPMEM_PROV,
+};
+
+enum rpmem_provider rpmem_provider_from_str(const char *str);
+const char *rpmem_provider_to_str(enum rpmem_provider provider);
+
+/*
+ * rpmem_req_attr -- arguments for open/create request
+ */
+struct rpmem_req_attr {
+       size_t pool_size;
+       unsigned nlanes;
+       size_t buff_size;
+       enum rpmem_provider provider;
+       const char *pool_desc;
+};
+
+/*
+ * rpmem_resp_attr -- return arguments from open/create request
+ */
+struct rpmem_resp_attr {
+       unsigned short port;
+       uint64_t rkey;
+       uint64_t raddr;
+       unsigned nlanes;
+       enum rpmem_persist_method persist_method;
+};
+
+#define RPMEM_HAS_USER         0x1
+#define RPMEM_HAS_SERVICE      0x2
+#define RPMEM_FLAGS_USE_IPV4   0x4
+#define RPMEM_MAX_USER         (32 + 1)   /* see useradd(8) + 1 for '\0' */
+#define RPMEM_MAX_NODE         (255 + 1)  /* see gethostname(2) + 1 for '\0' */
+#define RPMEM_MAX_SERVICE      (NI_MAXSERV + 1)  /* + 1 for '\0' */
+#define RPMEM_HDR_SIZE         4096
+#define RPMEM_CLOSE_FLAGS_REMOVE 0x1
+#define RPMEM_DEF_BUFF_SIZE    8192
+
+struct rpmem_target_info {
+       char user[RPMEM_MAX_USER];
+       char node[RPMEM_MAX_NODE];
+       char service[RPMEM_MAX_SERVICE];
+       unsigned flags;
+};
+
+extern unsigned Rpmem_max_nlanes;
+extern unsigned Rpmem_wq_size;
+extern int Rpmem_fork_unsafe;
+
+int rpmem_b64_write(int sockfd, const void *buf, size_t len, int flags);
+int rpmem_b64_read(int sockfd, void *buf, size_t len, int flags);
+const char *rpmem_get_ip_str(const struct sockaddr *addr);
+struct rpmem_target_info *rpmem_target_parse(const char *target);
+void rpmem_target_free(struct rpmem_target_info *info);
+int rpmem_xwrite(int fd, const void *buf, size_t len, int flags);
+int rpmem_xread(int fd, void *buf, size_t len, int flags);
+char *rpmem_get_ssh_conn_addr(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_common_log.h b/ceph/src/pmdk/src/rpmem_common/rpmem_common_log.h
new file mode 100644 (file)
index 0000000..c245a8e
--- /dev/null
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_common_log.h -- common log macros for librpmem and rpmemd
+ */
+
+#if defined(RPMEMC_LOG_RPMEM) && defined(RPMEMC_LOG_RPMEMD)
+
+#error Both RPMEMC_LOG_RPMEM and RPMEMC_LOG_RPMEMD defined
+
+#elif !defined(RPMEMC_LOG_RPMEM) && !defined(RPMEMC_LOG_RPMEMD)
+
+#define RPMEMC_LOG(level, fmt, args...) do {} while (0)
+#define RPMEMC_DBG(level, fmt, args...) do {} while (0)
+#define RPMEMC_FATAL(fmt, args...)     do {} while (0)
+#define RPMEMC_ASSERT(cond)            do {} while (0)
+
+#elif defined(RPMEMC_LOG_RPMEM)
+
+#include "out.h"
+#include "rpmem_util.h"
+
+#define RPMEMC_LOG(level, fmt, args...) RPMEM_LOG(level, fmt, ## args)
+#define RPMEMC_DBG(level, fmt, args...) RPMEM_DBG(fmt, ## args)
+#define RPMEMC_FATAL(fmt, args...)     RPMEM_FATAL(fmt, ## args)
+#define RPMEMC_ASSERT(cond)            RPMEM_ASSERT(cond)
+
+#else
+
+#include "rpmemd_log.h"
+
+#define RPMEMC_LOG(level, fmt, args...) RPMEMD_LOG(level, fmt, ## args)
+#define RPMEMC_DBG(level, fmt, args...) RPMEMD_DBG(fmt, ## args)
+#define RPMEMC_FATAL(fmt, args...)     RPMEMD_FATAL(fmt, ## args)
+#define RPMEMC_ASSERT(cond)            RPMEMD_ASSERT(cond)
+
+#endif
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.c b/ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.c
new file mode 100644 (file)
index 0000000..dbb2d5a
--- /dev/null
@@ -0,0 +1,332 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * rpmem_common.c -- common definitions for librpmem and rpmemd
+ */
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+#include <errno.h>
+
+#include "rpmem_common.h"
+#include "rpmem_fip_common.h"
+#include "rpmem_proto.h"
+
+#include "rpmem_common_log.h"
+
+#include "valgrind_internal.h"
+
+#include <rdma/fi_errno.h>
+
+/*
+ * rpmem_fip_get_hints -- return fabric interface information hints
+ */
+struct fi_info *
+rpmem_fip_get_hints(enum rpmem_provider provider)
+{
+       RPMEMC_ASSERT(provider < MAX_RPMEM_PROV);
+
+       struct fi_info *hints = fi_allocinfo();
+       if (!hints) {
+               RPMEMC_LOG(ERR, "!fi_allocinfo");
+               return NULL;
+       }
+
+       /* connection-oriented endpoint */
+       hints->ep_attr->type = FI_EP_MSG;
+
+       /*
+        * Basic memory registration mode indicates that MR attributes
+        * (rkey, lkey) are selected by provider.
+        */
+       hints->domain_attr->mr_mode = FI_MR_BASIC;
+
+       /*
+        * FI_THREAD_SAFE indicates MT applications can access any
+        * resources through interface without any restrictions
+        */
+       hints->domain_attr->threading = FI_THREAD_SAFE;
+
+       /*
+        * FI_MSG - SEND and RECV
+        * FI_RMA - WRITE and READ
+        */
+       hints->caps = FI_MSG | FI_RMA;
+
+       /* must register locally accessed buffers */
+       hints->mode = FI_CONTEXT | FI_LOCAL_MR | FI_RX_CQ_DATA;
+
+       /* READ-after-WRITE and SEND-after-WRITE message ordering required */
+       hints->tx_attr->msg_order = FI_ORDER_RAW | FI_ORDER_SAW;
+
+       hints->addr_format = FI_SOCKADDR;
+
+       if (provider != RPMEM_PROV_UNKNOWN) {
+               const char *prov_name = rpmem_provider_to_str(provider);
+               RPMEMC_ASSERT(prov_name != NULL);
+
+               hints->fabric_attr->prov_name = strdup(prov_name);
+               if (!hints->fabric_attr->prov_name) {
+                       RPMEMC_LOG(ERR, "!strdup(provider)");
+                       goto err_strdup;
+               }
+       }
+
+       return hints;
+err_strdup:
+       fi_freeinfo(hints);
+       return NULL;
+}
+
+/*
+ * rpmem_fip_probe_get -- return list of available providers
+ */
+int
+rpmem_fip_probe_get(const char *target, struct rpmem_fip_probe *probe)
+{
+       struct fi_info *hints = rpmem_fip_get_hints(RPMEM_PROV_UNKNOWN);
+       if (!hints)
+               return -1;
+
+       int ret;
+       struct fi_info *fi;
+       ret = fi_getinfo(RPMEM_FIVERSION, target, NULL, 0, hints, &fi);
+       if (ret) {
+               goto err_getinfo;
+       }
+
+       if (probe) {
+               memset(probe, 0, sizeof(*probe));
+
+               struct fi_info *prov = fi;
+               while (prov) {
+                       enum rpmem_provider p = rpmem_provider_from_str(
+                                       prov->fabric_attr->prov_name);
+                       if (p == RPMEM_PROV_UNKNOWN) {
+                               prov = prov->next;
+                               continue;
+                       }
+
+                       probe->providers |= (1U << p);
+                       probe->max_wq_size[p] = prov->tx_attr->size;
+                       prov = prov->next;
+               }
+       }
+
+       fi_freeinfo(fi);
+err_getinfo:
+       fi_freeinfo(hints);
+       return ret;
+}
+
+/*
+ * rpmem_fip_read_eq -- read event queue entry with specified timeout
+ */
+int
+rpmem_fip_read_eq(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
+       uint32_t *event, int timeout)
+{
+       int ret;
+       ssize_t sret;
+       struct fi_eq_err_entry err;
+
+       sret = fi_eq_sread(eq, event, entry, sizeof(*entry), timeout, 0);
+       VALGRIND_DO_MAKE_MEM_DEFINED(&sret, sizeof(sret));
+
+       if (timeout != -1 && (sret == -FI_ETIMEDOUT || sret == -FI_EAGAIN)) {
+               errno = ETIMEDOUT;
+               return 1;
+       }
+
+       if (sret < 0 || (size_t)sret != sizeof(*entry)) {
+               if (sret < 0)
+                       ret = (int)sret;
+               else
+                       ret = -1;
+
+               sret = fi_eq_readerr(eq, &err, 0);
+               if (sret < 0) {
+                       errno = EIO;
+                       RPMEMC_LOG(ERR, "error reading from event queue: "
+                               "cannot read error from event queue: %s",
+                               fi_strerror((int)sret));
+               } else if (sret > 0) {
+                       RPMEMC_ASSERT(sret == sizeof(err));
+                       errno = -err.prov_errno;
+                       RPMEMC_LOG(ERR, "error reading from event queue: %s",
+                                       fi_eq_strerror(eq, err.prov_errno,
+                                               NULL, NULL, 0));
+               }
+
+               return ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_read_eq -- read event queue entry and expect specified event
+ * and fid
+ *
+ * Returns:
+ * 1 - timeout
+ * 0 - success
+ * otherwise - error
+ */
+int
+rpmem_fip_read_eq_check(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
+       uint32_t exp_event, fid_t exp_fid, int timeout)
+{
+       uint32_t event;
+       int ret = rpmem_fip_read_eq(eq, entry, &event, timeout);
+       if (ret)
+               return ret;
+
+       if (event != exp_event || entry->fid != exp_fid) {
+               errno = EIO;
+               RPMEMC_LOG(ERR, "unexpected event received (%u) "
+                               "expected (%u)%s", event, exp_event,
+                               entry->fid != exp_fid ?
+                               " invalid endpoint" : "");
+
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmem_fip_lane_attr -- lane attributes
+ *
+ * This structure describes how many SQ, RQ and CQ entries are
+ * required for a single lane.
+ *
+ * NOTE:
+ * - WRITE, READ and SEND requests are placed in SQ,
+ * - RECV requests are placed in RQ.
+ */
+struct rpmem_fip_lane_attr {
+       size_t n_per_sq; /* number of entries per lane in send queue  */
+       size_t n_per_rq; /* number of entries per lane in receive queue */
+       size_t n_per_cq; /* number of entries per lane in completion queue */
+};
+
+/* queues size required by remote persist operation methods */
+static const struct rpmem_fip_lane_attr
+rpmem_fip_lane_attrs[MAX_RPMEM_FIP_NODE][MAX_RPMEM_PM] = {
+       [RPMEM_FIP_NODE_CLIENT][RPMEM_PM_GPSPM] = {
+               .n_per_sq = 2, /* WRITE + SEND */
+               .n_per_rq = 1, /* RECV */
+               .n_per_cq = 3,
+       },
+       [RPMEM_FIP_NODE_CLIENT][RPMEM_PM_APM] = {
+               /* WRITE + READ for persist, WRITE + SEND for deep persist */
+               .n_per_sq = 2, /* WRITE + SEND */
+               .n_per_rq = 1, /* RECV */
+               .n_per_cq = 3,
+       },
+       [RPMEM_FIP_NODE_SERVER][RPMEM_PM_GPSPM] = {
+               .n_per_sq = 1, /* SEND */
+               .n_per_rq = 1, /* RECV */
+               .n_per_cq = 3,
+       },
+       [RPMEM_FIP_NODE_SERVER][RPMEM_PM_APM] = {
+               .n_per_sq = 1, /* SEND */
+               .n_per_rq = 1, /* RECV */
+               .n_per_cq = 3,
+       },
+};
+
+/*
+ * rpmem_fip_cq_size -- returns completion queue size based on
+ * persist method and node type
+ */
+size_t
+rpmem_fip_cq_size(enum rpmem_persist_method pm, enum rpmem_fip_node node)
+{
+       RPMEMC_ASSERT(pm < MAX_RPMEM_PM);
+       RPMEMC_ASSERT(node < MAX_RPMEM_FIP_NODE);
+
+       const struct rpmem_fip_lane_attr *attr =
+                       &rpmem_fip_lane_attrs[node][pm];
+       return attr->n_per_cq ? : 1;
+}
+
+/*
+ * rpmem_fip_wq_size -- returns submission queue (transmit queue) size based
+ * on persist method and node type
+ */
+size_t
+rpmem_fip_wq_size(enum rpmem_persist_method pm, enum rpmem_fip_node node)
+{
+       RPMEMC_ASSERT(pm < MAX_RPMEM_PM);
+       RPMEMC_ASSERT(node < MAX_RPMEM_FIP_NODE);
+
+       const struct rpmem_fip_lane_attr *attr =
+                       &rpmem_fip_lane_attrs[node][pm];
+       return attr->n_per_sq ? : 1;
+}
+
+/*
+ * rpmem_fip_rx_size -- returns receive queue size based
+ * on persist method and node type
+ */
+size_t
+rpmem_fip_rx_size(enum rpmem_persist_method pm, enum rpmem_fip_node node)
+{
+       RPMEMC_ASSERT(pm < MAX_RPMEM_PM);
+       RPMEMC_ASSERT(node < MAX_RPMEM_FIP_NODE);
+
+       const struct rpmem_fip_lane_attr *attr =
+                       &rpmem_fip_lane_attrs[node][pm];
+       return attr->n_per_rq ? : 1;
+}
+
+/*
+ * rpmem_fip_max_nlanes -- returns maximum number of lanes
+ */
+size_t
+rpmem_fip_max_nlanes(struct fi_info *fi)
+{
+       return min(min(fi->domain_attr->tx_ctx_cnt,
+                       fi->domain_attr->rx_ctx_cnt),
+                       fi->domain_attr->cq_cnt);
+}
+
+/*
+ * rpmem_fip_print_info -- print some useful info about fabric interface
+ */
+void
+rpmem_fip_print_info(struct fi_info *fi)
+{
+       RPMEMC_LOG(INFO, "libfabric version: %s",
+                       fi_tostr(fi, FI_TYPE_VERSION));
+
+       char *str = fi_tostr(fi, FI_TYPE_INFO);
+       char *buff = strdup(str);
+       if (!buff) {
+               RPMEMC_LOG(ERR, "!allocating string buffer for "
+                               "libfabric interface information");
+               return;
+       }
+
+       RPMEMC_LOG(INFO, "libfabric interface info:");
+
+       char *nl;
+       char *last = buff;
+       while (last != NULL) {
+               nl = strchr(last, '\n');
+               if (nl) {
+                       *nl = '\0';
+                       nl++;
+               }
+
+               RPMEMC_LOG(INFO, "%s", last);
+
+               last = nl;
+       }
+
+       free(buff);
+}
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.h b/ceph/src/pmdk/src/rpmem_common/rpmem_fip_common.h
new file mode 100644 (file)
index 0000000..6eb801b
--- /dev/null
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_fip_common.h -- common definitions for librpmem and rpmemd
+ */
+
+#ifndef RPMEM_FIP_COMMON_H
+#define RPMEM_FIP_COMMON_H 1
+
+#include <string.h>
+#include <netinet/in.h>
+
+#include <rdma/fabric.h>
+#include <rdma/fi_cm.h>
+#include <rdma/fi_rma.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define RPMEM_FIVERSION FI_VERSION(1, 4)
+#define RPMEM_FIP_CQ_WAIT_MS   100
+
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#define max(a, b) ((a) > (b) ? (a) : (b))
+
+/*
+ * rpmem_fip_node -- client or server node type
+ */
+enum rpmem_fip_node {
+       RPMEM_FIP_NODE_CLIENT,
+       RPMEM_FIP_NODE_SERVER,
+
+       MAX_RPMEM_FIP_NODE,
+};
+
+/*
+ * rpmem_fip_probe -- list of providers
+ */
+struct rpmem_fip_probe {
+       unsigned providers;
+       size_t max_wq_size[MAX_RPMEM_PROV];
+};
+
+/*
+ * rpmem_fip_probe -- returns true if specified provider is available
+ */
+static inline int
+rpmem_fip_probe(struct rpmem_fip_probe probe, enum rpmem_provider provider)
+{
+       return (probe.providers & (1U << provider)) != 0;
+}
+
+/*
+ * rpmem_fip_probe_any -- returns true if any provider is available
+ */
+static inline int
+rpmem_fip_probe_any(struct rpmem_fip_probe probe)
+{
+       return probe.providers != 0;
+}
+
+int rpmem_fip_probe_get(const char *target, struct rpmem_fip_probe *probe);
+
+struct fi_info *rpmem_fip_get_hints(enum rpmem_provider provider);
+
+int rpmem_fip_read_eq_check(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
+       uint32_t exp_event, fid_t exp_fid, int timeout);
+
+int rpmem_fip_read_eq(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
+               uint32_t *event, int timeout);
+
+size_t rpmem_fip_cq_size(enum rpmem_persist_method pm,
+       enum rpmem_fip_node node);
+size_t rpmem_fip_wq_size(enum rpmem_persist_method pm,
+       enum rpmem_fip_node node);
+size_t rpmem_fip_rx_size(enum rpmem_persist_method pm,
+       enum rpmem_fip_node node);
+
+size_t rpmem_fip_max_nlanes(struct fi_info *fi);
+
+void rpmem_fip_print_info(struct fi_info *fi);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_fip_lane.h b/ceph/src/pmdk/src/rpmem_common/rpmem_fip_lane.h
new file mode 100644 (file)
index 0000000..c0c6bac
--- /dev/null
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_fip_lane.h -- rpmem fabric provider lane definition
+ */
+
+#include <sched.h>
+#include <stdint.h>
+#include "sys_util.h"
+/*
+ * rpmem_fip_lane -- basic lane structure
+ *
+ * This structure consist of a synchronization object and a return value.
+ * It is possible to wait on the lane for specified event. The event can be
+ * signalled by another thread which can pass the return value if required.
+ *
+ * The sync variable can store up to 64 different events, each event on
+ * separate bit.
+ */
+struct rpmem_fip_lane {
+       os_spinlock_t lock;
+       int ret;
+       uint64_t sync;
+};
+
+/*
+ * rpmem_fip_lane_init -- initialize basic lane structure
+ */
+static inline int
+rpmem_fip_lane_init(struct rpmem_fip_lane *lanep)
+{
+       lanep->ret = 0;
+       lanep->sync = 0;
+
+       return util_spin_init(&lanep->lock, PTHREAD_PROCESS_PRIVATE);
+}
+
+/*
+ * rpmem_fip_lane_fini -- deinitialize basic lane structure
+ */
+static inline void
+rpmem_fip_lane_fini(struct rpmem_fip_lane *lanep)
+{
+       util_spin_destroy(&lanep->lock);
+}
+
+/*
+ * rpmem_fip_lane_busy -- return true if lane has pending events
+ */
+static inline int
+rpmem_fip_lane_busy(struct rpmem_fip_lane *lanep)
+{
+       util_spin_lock(&lanep->lock);
+       int ret = lanep->sync != 0;
+       util_spin_unlock(&lanep->lock);
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_lane_begin -- begin waiting for specified event(s)
+ */
+static inline void
+rpmem_fip_lane_begin(struct rpmem_fip_lane *lanep, uint64_t sig)
+{
+       util_spin_lock(&lanep->lock);
+       lanep->ret = 0;
+       lanep->sync |= sig;
+       util_spin_unlock(&lanep->lock);
+}
+
+static inline int
+rpmem_fip_lane_is_busy(struct rpmem_fip_lane *lanep, uint64_t sig)
+{
+       util_spin_lock(&lanep->lock);
+       int ret = (lanep->sync & sig) != 0;
+       util_spin_unlock(&lanep->lock);
+
+       return ret;
+}
+
+static inline int
+rpmem_fip_lane_ret(struct rpmem_fip_lane *lanep)
+{
+       util_spin_lock(&lanep->lock);
+       int ret = lanep->ret;
+       util_spin_unlock(&lanep->lock);
+
+       return ret;
+}
+
+/*
+ * rpmem_fip_lane_wait -- wait for specified event(s)
+ */
+static inline int
+rpmem_fip_lane_wait(struct rpmem_fip_lane *lanep, uint64_t sig)
+{
+       while (rpmem_fip_lane_is_busy(lanep, sig))
+               sched_yield();
+
+       return rpmem_fip_lane_ret(lanep);
+}
+
+/*
+ * rpmem_fip_lane_signal -- signal lane about specified event
+ */
+static inline void
+rpmem_fip_lane_signal(struct rpmem_fip_lane *lanep, uint64_t sig)
+{
+       util_spin_lock(&lanep->lock);
+       lanep->sync &= ~sig;
+       util_spin_unlock(&lanep->lock);
+}
+
+/*
+ * rpmem_fip_lane_signal -- signal lane about specified event and store
+ * return value
+ */
+static inline void
+rpmem_fip_lane_sigret(struct rpmem_fip_lane *lanep, uint64_t sig, int ret)
+{
+       util_spin_lock(&lanep->lock);
+       lanep->ret = ret;
+       lanep->sync &= ~sig;
+       util_spin_unlock(&lanep->lock);
+}
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_fip_msg.h b/ceph/src/pmdk/src/rpmem_common/rpmem_fip_msg.h
new file mode 100644 (file)
index 0000000..7e587de
--- /dev/null
@@ -0,0 +1,146 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_fip_msg.h -- simple wrappers for fi_rma(3) and fi_msg(3) functions
+ */
+
+#ifndef RPMEM_FIP_MSG_H
+#define RPMEM_FIP_MSG_H 1
+
+#include <rdma/fi_rma.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * rpmem_fip_rma -- helper struct for RMA operation
+ */
+struct rpmem_fip_rma {
+       struct fi_msg_rma msg;  /* message structure */
+       struct iovec msg_iov;   /* IO vector buffer */
+       struct fi_rma_iov rma_iov; /* RMA IO vector buffer */
+       void *desc;             /* local memory descriptor */
+       uint64_t flags;         /* RMA operation flags */
+};
+
+/*
+ * rpmem_fip_msg -- helper struct for MSG operation
+ */
+struct rpmem_fip_msg {
+       struct fi_msg msg;      /* message structure */
+       struct iovec iov;       /* IO vector buffer */
+       void *desc;             /* local memory descriptor */
+       uint64_t flags;         /* MSG operation flags */
+};
+
+/*
+ * rpmem_fip_rma_init -- initialize RMA helper struct
+ */
+static inline void
+rpmem_fip_rma_init(struct rpmem_fip_rma *rma, void *desc,
+       fi_addr_t addr, uint64_t rkey, void *context, uint64_t flags)
+{
+       memset(rma, 0, sizeof(*rma));
+       rma->desc = desc;
+       rma->flags = flags;
+       rma->rma_iov.key = rkey;
+       rma->msg.context = context;
+       rma->msg.addr = addr;
+       rma->msg.desc = &rma->desc;
+       rma->msg.rma_iov = &rma->rma_iov;
+       rma->msg.rma_iov_count = 1;
+       rma->msg.msg_iov = &rma->msg_iov;
+       rma->msg.iov_count = 1;
+}
+
+/*
+ * rpmem_fip_msg_init -- initialize MSG helper struct
+ */
+static inline void
+rpmem_fip_msg_init(struct rpmem_fip_msg *msg, void *desc, fi_addr_t addr,
+       void *context, void *buff, size_t len, uint64_t flags)
+{
+       memset(msg, 0, sizeof(*msg));
+       msg->desc = desc;
+       msg->flags = flags;
+       msg->iov.iov_base = buff;
+       msg->iov.iov_len = len;
+       msg->msg.context = context;
+       msg->msg.addr = addr;
+       msg->msg.desc = &msg->desc;
+       msg->msg.msg_iov = &msg->iov;
+       msg->msg.iov_count = 1;
+}
+
+/*
+ * rpmem_fip_writemsg -- wrapper for fi_writemsg
+ */
+static inline int
+rpmem_fip_writemsg(struct fid_ep *ep, struct rpmem_fip_rma *rma,
+       const void *buff, size_t len, uint64_t addr)
+{
+       rma->rma_iov.addr = addr;
+       rma->rma_iov.len = len;
+       rma->msg_iov.iov_base = (void *)buff;
+       rma->msg_iov.iov_len = len;
+       return (int)fi_writemsg(ep, &rma->msg, rma->flags);
+}
+
+/*
+ * rpmem_fip_readmsg -- wrapper for fi_readmsg
+ */
+static inline int
+rpmem_fip_readmsg(struct fid_ep *ep, struct rpmem_fip_rma *rma,
+       void *buff, size_t len, uint64_t addr)
+{
+       rma->rma_iov.addr = addr;
+       rma->rma_iov.len = len;
+       rma->msg_iov.iov_base = buff;
+       rma->msg_iov.iov_len = len;
+       return (int)fi_readmsg(ep, &rma->msg, rma->flags);
+}
+
+/*
+ * rpmem_fip_sendmsg -- wrapper for fi_sendmsg
+ */
+static inline int
+rpmem_fip_sendmsg(struct fid_ep *ep, struct rpmem_fip_msg *msg, size_t len)
+{
+       msg->iov.iov_len = len;
+       return (int)fi_sendmsg(ep, &msg->msg, msg->flags);
+}
+
+/*
+ * rpmem_fip_recvmsg -- wrapper for fi_recvmsg
+ */
+static inline int
+rpmem_fip_recvmsg(struct fid_ep *ep, struct rpmem_fip_msg *msg)
+{
+       return (int)fi_recvmsg(ep, &msg->msg, msg->flags);
+}
+
+/*
+ * rpmem_fip_msg_get_pmsg -- returns message buffer as a persist message
+ */
+static inline struct rpmem_msg_persist *
+rpmem_fip_msg_get_pmsg(struct rpmem_fip_msg *msg)
+{
+       return (struct rpmem_msg_persist *)msg->iov.iov_base;
+}
+
+/*
+ * rpmem_fip_msg_get_pres -- returns message buffer as a persist response
+ */
+static inline struct rpmem_msg_persist_resp *
+rpmem_fip_msg_get_pres(struct rpmem_fip_msg *msg)
+{
+       return (struct rpmem_msg_persist_resp *)msg->iov.iov_base;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/rpmem_common/rpmem_proto.h b/ceph/src/pmdk/src/rpmem_common/rpmem_proto.h
new file mode 100644 (file)
index 0000000..b07b8aa
--- /dev/null
@@ -0,0 +1,545 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmem_proto.h -- rpmem protocol definitions
+ */
+
+#ifndef RPMEM_PROTO_H
+#define RPMEM_PROTO_H 1
+
+#include <stdint.h>
+#include <endian.h>
+
+#include "librpmem.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PACKED __attribute__((packed))
+
+#define RPMEM_PROTO            "tcp"
+#define RPMEM_PROTO_MAJOR      0
+#define RPMEM_PROTO_MINOR      1
+#define RPMEM_SIG_SIZE         8
+#define RPMEM_UUID_SIZE                16
+#define RPMEM_PROV_SIZE                32
+#define RPMEM_USER_SIZE                16
+
+/*
+ * rpmem_msg_type -- type of messages
+ */
+enum rpmem_msg_type {
+       RPMEM_MSG_TYPE_CREATE           = 1, /* create request */
+       RPMEM_MSG_TYPE_CREATE_RESP      = 2, /* create request response */
+       RPMEM_MSG_TYPE_OPEN             = 3, /* open request */
+       RPMEM_MSG_TYPE_OPEN_RESP        = 4, /* open request response */
+       RPMEM_MSG_TYPE_CLOSE            = 5, /* close request */
+       RPMEM_MSG_TYPE_CLOSE_RESP       = 6, /* close request response */
+       RPMEM_MSG_TYPE_SET_ATTR         = 7, /* set attributes request */
+       /* set attributes request response */
+       RPMEM_MSG_TYPE_SET_ATTR_RESP    = 8,
+       MAX_RPMEM_MSG_TYPE,
+};
+
+/*
+ * rpmem_pool_attr_packed -- a packed version
+ */
+struct rpmem_pool_attr_packed {
+       char signature[RPMEM_POOL_HDR_SIG_LEN]; /* pool signature */
+       uint32_t major; /* format major version number */
+       uint32_t compat_features; /* mask: compatible "may" features */
+       uint32_t incompat_features; /* mask: "must support" features */
+       uint32_t ro_compat_features; /* mask: force RO if unsupported */
+       unsigned char poolset_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* pool uuid */
+       unsigned char uuid[RPMEM_POOL_HDR_UUID_LEN]; /* first part uuid */
+       unsigned char next_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* next pool uuid */
+       unsigned char prev_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* prev pool uuid */
+       unsigned char user_flags[RPMEM_POOL_USER_FLAGS_LEN]; /* user flags */
+} PACKED;
+
+/*
+ * rpmem_msg_ibc_attr -- in-band connection attributes
+ *
+ * Used by create request response and open request response.
+ * Contains essential information to proceed with in-band connection
+ * initialization.
+ */
+struct rpmem_msg_ibc_attr {
+       uint32_t port;                  /* RDMA connection port */
+       uint32_t persist_method;        /* persist method */
+       uint64_t rkey;                  /* remote key */
+       uint64_t raddr;                 /* remote address */
+       uint32_t nlanes;                /* number of lanes */
+} PACKED;
+
+/*
+ * rpmem_msg_pool_desc -- remote pool descriptor
+ */
+struct rpmem_msg_pool_desc {
+       uint32_t size;          /* size of pool descriptor */
+       uint8_t desc[0];        /* pool descriptor, null-terminated string */
+} PACKED;
+
+/*
+ * rpmem_msg_hdr -- message header which consists of type and size of message
+ *
+ * The type must be one of the rpmem_msg_type values.
+ */
+struct rpmem_msg_hdr {
+       uint32_t type;                  /* type of message */
+       uint64_t size;                  /* size of message */
+       uint8_t body[0];
+} PACKED;
+
+/*
+ * rpmem_msg_hdr_resp -- message response header which consists of type, size
+ * and status.
+ *
+ * The type must be one of the rpmem_msg_type values.
+ */
+struct rpmem_msg_hdr_resp {
+       uint32_t status;                /* response status */
+       uint32_t type;                  /* type of message */
+       uint64_t size;                  /* size of message */
+} PACKED;
+
+/*
+ * rpmem_msg_common -- common fields for open/create messages
+ */
+struct rpmem_msg_common {
+       uint16_t major;                 /* protocol version major number */
+       uint16_t minor;                 /* protocol version minor number */
+       uint64_t pool_size;             /* minimum required size of a pool */
+       uint32_t nlanes;                /* number of lanes used by initiator */
+       uint32_t provider;              /* provider */
+       uint64_t buff_size;             /* buffer size for inline persist */
+} PACKED;
+
+/*
+ * rpmem_msg_create -- create request message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_CREATE.
+ * The size of message must be set to
+ *     sizeof(struct rpmem_msg_create) + pool_desc_size
+ */
+struct rpmem_msg_create {
+       struct rpmem_msg_hdr hdr;       /* message header */
+       struct rpmem_msg_common c;
+       struct rpmem_pool_attr_packed pool_attr;        /* pool attributes */
+       struct rpmem_msg_pool_desc pool_desc;   /* pool descriptor */
+} PACKED;
+
+/*
+ * rpmem_msg_create_resp -- create request response message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_CREATE_RESP.
+ * The size of message must be set to sizeof(struct rpmem_msg_create_resp).
+ */
+struct rpmem_msg_create_resp {
+       struct rpmem_msg_hdr_resp hdr;  /* message header */
+       struct rpmem_msg_ibc_attr ibc;  /* in-band connection attributes */
+} PACKED;
+
+/*
+ * rpmem_msg_open -- open request message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_OPEN.
+ * The size of message must be set to
+ *     sizeof(struct rpmem_msg_open) + pool_desc_size
+ */
+struct rpmem_msg_open {
+       struct rpmem_msg_hdr hdr;       /* message header */
+       struct rpmem_msg_common c;
+       struct rpmem_msg_pool_desc pool_desc;   /* pool descriptor */
+} PACKED;
+
+/*
+ * rpmem_msg_open_resp -- open request response message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_OPEN_RESP.
+ * The size of message must be set to sizeof(struct rpmem_msg_open_resp)
+ */
+struct rpmem_msg_open_resp {
+       struct rpmem_msg_hdr_resp hdr;  /* message header */
+       struct rpmem_msg_ibc_attr ibc;  /* in-band connection attributes */
+       struct rpmem_pool_attr_packed pool_attr; /* pool attributes */
+} PACKED;
+
+/*
+ * rpmem_msg_close -- close request message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_CLOSE
+ * The size of message must be set to sizeof(struct rpmem_msg_close)
+ */
+struct rpmem_msg_close {
+       struct rpmem_msg_hdr hdr;       /* message header */
+       uint32_t flags;                         /* flags */
+} PACKED;
+
+/*
+ * rpmem_msg_close_resp -- close request response message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_CLOSE_RESP
+ * The size of message must be set to sizeof(struct rpmem_msg_close_resp)
+ */
+struct rpmem_msg_close_resp {
+       struct rpmem_msg_hdr_resp hdr;  /* message header */
+       /* no more fields */
+} PACKED;
+
+#define RPMEM_FLUSH_WRITE      0U      /* flush / persist using RDMA WRITE */
+#define RPMEM_DEEP_PERSIST     1U      /* deep persist operation */
+#define RPMEM_PERSIST_SEND     2U      /* persist using RDMA SEND */
+#define RPMEM_COMPLETION       4U      /* schedule command with a completion */
+
+/* the two least significant bits are reserved for mode of persist */
+#define RPMEM_FLUSH_PERSIST_MASK       0x3U
+
+#define RPMEM_PERSIST_MAX              2U /* maximum valid persist value */
+
+/*
+ * rpmem_msg_persist -- remote persist message
+ */
+struct rpmem_msg_persist {
+       uint32_t flags; /* lane flags */
+       uint32_t lane;  /* lane identifier */
+       uint64_t addr;  /* remote memory address */
+       uint64_t size;  /* remote memory size */
+       uint8_t data[];
+};
+
+/*
+ * rpmem_msg_persist_resp -- remote persist response message
+ */
+struct rpmem_msg_persist_resp {
+       uint32_t flags; /* lane flags */
+       uint32_t lane;  /* lane identifier */
+};
+
+/*
+ * rpmem_msg_set_attr -- set attributes request message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_SET_ATTR.
+ * The size of message must be set to sizeof(struct rpmem_msg_set_attr)
+ */
+struct rpmem_msg_set_attr {
+       struct rpmem_msg_hdr hdr;       /* message header */
+       struct rpmem_pool_attr_packed pool_attr;        /* pool attributes */
+} PACKED;
+
+/*
+ * rpmem_msg_set_attr_resp -- set attributes request response message
+ *
+ * The type of message must be set to RPMEM_MSG_TYPE_SET_ATTR_RESP.
+ * The size of message must be set to sizeof(struct rpmem_msg_set_attr_resp).
+ */
+struct rpmem_msg_set_attr_resp {
+       struct rpmem_msg_hdr_resp hdr;  /* message header */
+} PACKED;
+
+/*
+ * XXX Begin: Suppress gcc conversion warnings for FreeBSD be*toh macros.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+/*
+ * rpmem_ntoh_msg_ibc_attr -- convert rpmem_msg_ibc attr to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_ibc_attr(struct rpmem_msg_ibc_attr *ibc)
+{
+       ibc->port = be32toh(ibc->port);
+       ibc->persist_method = be32toh(ibc->persist_method);
+       ibc->rkey = be64toh(ibc->rkey);
+       ibc->raddr = be64toh(ibc->raddr);
+}
+
+/*
+ * rpmem_ntoh_msg_pool_desc -- convert rpmem_msg_pool_desc to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_pool_desc(struct rpmem_msg_pool_desc *pool_desc)
+{
+       pool_desc->size = be32toh(pool_desc->size);
+}
+
+/*
+ * rpmem_ntoh_pool_attr -- convert rpmem_pool_attr to host byte order
+ */
+static inline void
+rpmem_ntoh_pool_attr(struct rpmem_pool_attr_packed *attr)
+{
+       attr->major = be32toh(attr->major);
+       attr->ro_compat_features = be32toh(attr->ro_compat_features);
+       attr->incompat_features = be32toh(attr->incompat_features);
+       attr->compat_features = be32toh(attr->compat_features);
+}
+
+/*
+ * rpmem_ntoh_msg_hdr -- convert rpmem_msg_hdr to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_hdr(struct rpmem_msg_hdr *hdrp)
+{
+       hdrp->type = be32toh(hdrp->type);
+       hdrp->size = be64toh(hdrp->size);
+}
+
+/*
+ * rpmem_hton_msg_hdr -- convert rpmem_msg_hdr to network byte order
+ */
+static inline void
+rpmem_hton_msg_hdr(struct rpmem_msg_hdr *hdrp)
+{
+       rpmem_ntoh_msg_hdr(hdrp);
+}
+
+/*
+ * rpmem_ntoh_msg_hdr_resp -- convert rpmem_msg_hdr_resp to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_hdr_resp(struct rpmem_msg_hdr_resp *hdrp)
+{
+       hdrp->status = be32toh(hdrp->status);
+       hdrp->type = be32toh(hdrp->type);
+       hdrp->size = be64toh(hdrp->size);
+}
+
+/*
+ * rpmem_hton_msg_hdr_resp -- convert rpmem_msg_hdr_resp to network byte order
+ */
+static inline void
+rpmem_hton_msg_hdr_resp(struct rpmem_msg_hdr_resp *hdrp)
+{
+       rpmem_ntoh_msg_hdr_resp(hdrp);
+}
+
+/*
+ * rpmem_ntoh_msg_common -- convert rpmem_msg_common to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_common(struct rpmem_msg_common *msg)
+{
+       msg->major = be16toh(msg->major);
+       msg->minor = be16toh(msg->minor);
+       msg->pool_size = be64toh(msg->pool_size);
+       msg->nlanes = be32toh(msg->nlanes);
+       msg->provider = be32toh(msg->provider);
+       msg->buff_size = be64toh(msg->buff_size);
+}
+
+/*
+ * rpmem_hton_msg_common -- convert rpmem_msg_common to network byte order
+ */
+static inline void
+rpmem_hton_msg_common(struct rpmem_msg_common *msg)
+{
+       rpmem_ntoh_msg_common(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_create -- convert rpmem_msg_create to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_create(struct rpmem_msg_create *msg)
+{
+       rpmem_ntoh_msg_hdr(&msg->hdr);
+       rpmem_ntoh_msg_common(&msg->c);
+       rpmem_ntoh_pool_attr(&msg->pool_attr);
+       rpmem_ntoh_msg_pool_desc(&msg->pool_desc);
+}
+
+/*
+ * rpmem_hton_msg_create -- convert rpmem_msg_create to network byte order
+ */
+static inline void
+rpmem_hton_msg_create(struct rpmem_msg_create *msg)
+{
+       rpmem_ntoh_msg_create(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_create_resp -- convert rpmem_msg_create_resp to host byte
+ * order
+ */
+static inline void
+rpmem_ntoh_msg_create_resp(struct rpmem_msg_create_resp *msg)
+{
+       rpmem_ntoh_msg_hdr_resp(&msg->hdr);
+       rpmem_ntoh_msg_ibc_attr(&msg->ibc);
+}
+
+/*
+ * rpmem_hton_msg_create_resp -- convert rpmem_msg_create_resp to network byte
+ * order
+ */
+static inline void
+rpmem_hton_msg_create_resp(struct rpmem_msg_create_resp *msg)
+{
+       rpmem_ntoh_msg_create_resp(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_open -- convert rpmem_msg_open to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_open(struct rpmem_msg_open *msg)
+{
+       rpmem_ntoh_msg_hdr(&msg->hdr);
+       rpmem_ntoh_msg_common(&msg->c);
+       rpmem_ntoh_msg_pool_desc(&msg->pool_desc);
+}
+/*
+ * XXX End: Suppress gcc conversion warnings for FreeBSD be*toh macros
+ */
+#pragma GCC diagnostic pop
+/*
+ * rpmem_hton_msg_open -- convert rpmem_msg_open to network byte order
+ */
+static inline void
+rpmem_hton_msg_open(struct rpmem_msg_open *msg)
+{
+       rpmem_ntoh_msg_open(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_open_resp -- convert rpmem_msg_open_resp to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_open_resp(struct rpmem_msg_open_resp *msg)
+{
+       rpmem_ntoh_msg_hdr_resp(&msg->hdr);
+       rpmem_ntoh_msg_ibc_attr(&msg->ibc);
+       rpmem_ntoh_pool_attr(&msg->pool_attr);
+}
+
+/*
+ * rpmem_hton_msg_open_resp -- convert rpmem_msg_open_resp to network byte order
+ */
+static inline void
+rpmem_hton_msg_open_resp(struct rpmem_msg_open_resp *msg)
+{
+       rpmem_ntoh_msg_open_resp(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_set_attr -- convert rpmem_msg_set_attr to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_set_attr(struct rpmem_msg_set_attr *msg)
+{
+       rpmem_ntoh_msg_hdr(&msg->hdr);
+       rpmem_ntoh_pool_attr(&msg->pool_attr);
+}
+
+/*
+ * rpmem_hton_msg_set_attr -- convert rpmem_msg_set_attr to network byte order
+ */
+static inline void
+rpmem_hton_msg_set_attr(struct rpmem_msg_set_attr *msg)
+{
+       rpmem_ntoh_msg_set_attr(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_set_attr_resp -- convert rpmem_msg_set_attr_resp to host byte
+ * order
+ */
+static inline void
+rpmem_ntoh_msg_set_attr_resp(struct rpmem_msg_set_attr_resp *msg)
+{
+       rpmem_ntoh_msg_hdr_resp(&msg->hdr);
+}
+
+/*
+ * rpmem_hton_msg_set_attr_resp -- convert rpmem_msg_set_attr_resp to network
+ *     byte order
+ */
+static inline void
+rpmem_hton_msg_set_attr_resp(struct rpmem_msg_set_attr_resp *msg)
+{
+       rpmem_hton_msg_hdr_resp(&msg->hdr);
+}
+
+/*
+ * rpmem_ntoh_msg_close -- convert rpmem_msg_close to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_close(struct rpmem_msg_close *msg)
+{
+       rpmem_ntoh_msg_hdr(&msg->hdr);
+}
+
+/*
+ * rpmem_hton_msg_close -- convert rpmem_msg_close to network byte order
+ */
+static inline void
+rpmem_hton_msg_close(struct rpmem_msg_close *msg)
+{
+       rpmem_ntoh_msg_close(msg);
+}
+
+/*
+ * rpmem_ntoh_msg_close_resp -- convert rpmem_msg_close_resp to host byte order
+ */
+static inline void
+rpmem_ntoh_msg_close_resp(struct rpmem_msg_close_resp *msg)
+{
+       rpmem_ntoh_msg_hdr_resp(&msg->hdr);
+}
+
+/*
+ * rpmem_hton_msg_close_resp -- convert rpmem_msg_close_resp to network byte
+ * order
+ */
+static inline void
+rpmem_hton_msg_close_resp(struct rpmem_msg_close_resp *msg)
+{
+       rpmem_ntoh_msg_close_resp(msg);
+}
+
+/*
+ * pack_rpmem_pool_attr -- copy pool attributes to a packed structure
+ */
+static inline void
+pack_rpmem_pool_attr(const struct rpmem_pool_attr *src,
+               struct rpmem_pool_attr_packed *dst)
+{
+       memcpy(dst->signature, src->signature, sizeof(src->signature));
+       dst->major = src->major;
+       dst->compat_features = src->compat_features;
+       dst->incompat_features = src->incompat_features;
+       dst->ro_compat_features = src->ro_compat_features;
+       memcpy(dst->poolset_uuid, src->poolset_uuid, sizeof(dst->poolset_uuid));
+       memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
+       memcpy(dst->next_uuid, src->next_uuid, sizeof(dst->next_uuid));
+       memcpy(dst->prev_uuid, src->prev_uuid, sizeof(dst->prev_uuid));
+       memcpy(dst->user_flags, src->user_flags, sizeof(dst->user_flags));
+}
+
+/*
+ * unpack_rpmem_pool_attr -- copy pool attributes to an unpacked structure
+ */
+static inline void
+unpack_rpmem_pool_attr(const struct rpmem_pool_attr_packed *src,
+               struct rpmem_pool_attr *dst)
+{
+       memcpy(dst->signature, src->signature, sizeof(src->signature));
+       dst->major = src->major;
+       dst->compat_features = src->compat_features;
+       dst->incompat_features = src->incompat_features;
+       dst->ro_compat_features = src->ro_compat_features;
+       memcpy(dst->poolset_uuid, src->poolset_uuid, sizeof(dst->poolset_uuid));
+       memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
+       memcpy(dst->next_uuid, src->next_uuid, sizeof(dst->next_uuid));
+       memcpy(dst->prev_uuid, src->prev_uuid, sizeof(dst->prev_uuid));
+       memcpy(dst->user_flags, src->user_flags, sizeof(dst->user_flags));
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ceph/src/pmdk/src/tools/Makefile b/ceph/src/pmdk/src/tools/Makefile
new file mode 100644 (file)
index 0000000..f94bcb7
--- /dev/null
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2018, Intel Corporation
+#
+# Makefile -- top Makefile for tools
+#
+
+TOP = ../..
+
+TESTCONFIG=$(TOP)/src/test/testconfig.sh
+
+TARGETS = pmempool rpmemd daxio pmreorder
+SCOPEDIRS=$(TARGETS)
+SCOPEFILES=$(foreach dir, $(SCOPEDIRS), $(shell find $(dir) -name *.[ch] ))
+
+all    : TARGET = all
+check  : TARGET = check
+test   : TARGET = test
+clean  : TARGET = clean
+clobber: TARGET = clobber
+cstyle : TARGET = cstyle
+format : TARGET = format
+install: TARGET = install
+uninstall: TARGET = uninstall
+sync-remotes: TARGET = sync-remotes
+sparse: TARGET = sparse
+
+all clean clobber cstyle install uninstall check format test sparse: $(TARGETS)
+
+$(TESTCONFIG):
+
+sync-remotes: $(TARGETS) $(TESTCONFIG)
+
+$(TARGETS):
+       $(MAKE) -C $@ $(TARGET)
+
+clean:
+       $(RM) TAGS cscope.in.out cscope.out cscope.po.out
+
+clobber: clean
+
+cscope:
+       cscope -q -b $(SCOPEFILES)
+       ctags -e $(SCOPEFILES)
+
+.PHONY: all clean clobber cstyle format install uninstall common cscope sync-remotes $(TARGETS)
diff --git a/ceph/src/pmdk/src/tools/Makefile.inc b/ceph/src/pmdk/src/tools/Makefile.inc
new file mode 100644 (file)
index 0000000..4713952
--- /dev/null
@@ -0,0 +1,342 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+#
+# src/tools/Makefile.inc -- Makefile include for all tools
+#
+
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))../..
+
+include $(TOP)/src/common.inc
+
+INSTALL_TARGET ?= y
+
+INCS += -I.
+INCS += -I$(TOP)/src/include
+INCS += $(OS_INCS)
+CFLAGS += -std=gnu99
+CFLAGS += -Wall
+CFLAGS += -Werror
+CFLAGS += -Wmissing-prototypes
+CFLAGS += -Wpointer-arith
+CFLAGS += -Wsign-conversion
+CFLAGS += -Wsign-compare
+
+ifeq ($(WCONVERSION_AVAILABLE), y)
+CFLAGS += -Wconversion
+endif
+
+CFLAGS += -fno-common
+
+CFLAGS += -DSRCVERSION='"$(SRCVERSION)"'
+
+ifeq ($(OS_DIMM),ndctl)
+CFLAGS += -DSDS_ENABLED
+endif
+
+ifeq ($(IS_ICC), n)
+CFLAGS += -Wunused-macros
+CFLAGS += -Wmissing-field-initializers
+endif
+
+ifeq ($(WUNREACHABLE_CODE_RETURN_AVAILABLE), y)
+CFLAGS += -Wunreachable-code-return
+endif
+
+ifeq ($(WMISSING_VARIABLE_DECLARATIONS_AVAILABLE), y)
+CFLAGS += -Wmissing-variable-declarations
+endif
+
+ifeq ($(WFLOAT_EQUAL_AVAILABLE), y)
+CFLAGS += -Wfloat-equal
+endif
+
+ifeq ($(WSWITCH_DEFAULT_AVAILABLE), y)
+CFLAGS += -Wswitch-default
+endif
+
+ifeq ($(WCAST_FUNCTION_TYPE_AVAILABLE), y)
+CFLAGS += -Wcast-function-type
+endif
+
+ifeq ($(DEBUG),1)
+CFLAGS += -ggdb $(EXTRA_CFLAGS_DEBUG)
+else
+CFLAGS += -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $(EXTRA_CFLAGS_RELEASE)
+endif
+
+ifeq ($(VALGRIND),0)
+CFLAGS += -DVALGRIND_ENABLED=0
+CXXFLAGS += -DVALGRIND_ENABLED=0
+endif
+
+ifeq ($(FAULT_INJECTION),1)
+CFLAGS += -DFAULT_INJECTION=1
+CXXFLAGS += -DFAULT_INJECTION=1
+endif
+
+ifneq ($(SANITIZE),)
+CFLAGS += -fsanitize=$(SANITIZE)
+LDFLAGS += -fsanitize=$(SANITIZE)
+endif
+LDFLAGS += $(OS_LIBS)
+
+CFLAGS += $(EXTRA_CFLAGS)
+
+LDFLAGS += -Wl,-z,relro -Wl,--warn-common -Wl,--fatal-warnings $(EXTRA_LDFLAGS)
+ifeq ($(DEBUG),1)
+LDFLAGS += -L$(TOP)/src/debug
+else
+LDFLAGS += -L$(TOP)/src/nondebug
+endif
+TARGET_DIR=$(DESTDIR)$(bindir)
+BASH_COMP_FILES ?=
+BASH_COMP_DESTDIR = $(DESTDIR)$(bashcompdir)
+
+ifneq ($(DEBUG),1)
+TARGET_STATIC_NONDEBUG=$(TARGET).static-nondebug
+endif
+TARGET_STATIC_DEBUG=$(TARGET).static-debug
+
+LIBSDIR=$(TOP)/src
+LIBSDIR_DEBUG=$(LIBSDIR)/debug
+LIBSDIR_NONDEBUG=$(LIBSDIR)/nondebug
+
+ifneq ($(DEBUG),)
+LIBSDIR_PRIV=$(LIBSDIR_DEBUG)
+else
+LIBSDIR_PRIV=$(LIBSDIR_NONDEBUG)
+endif
+
+PMEMLOG_PRIV_OBJ=$(LIBSDIR_PRIV)/libpmemlog/libpmemlog_unscoped.o
+PMEMOBJ_PRIV_OBJ=$(LIBSDIR_PRIV)/libpmemobj/libpmemobj_unscoped.o
+PMEMBLK_PRIV_OBJ=$(LIBSDIR_PRIV)/libpmemblk/libpmemblk_unscoped.o
+
+LIBS += $(LIBUUID)
+
+ifeq ($(LIBRT_NEEDED), y)
+LIBS += -lrt
+endif
+
+ifeq ($(TOOLS_COMMON), y)
+LIBPMEMCOMMON=y
+endif
+
+ifeq ($(LIBPMEMCOMMON), y)
+DYNAMIC_LIBS += -lpmemcommon
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmemcommon.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmemcommon.a
+CFLAGS += -I$(TOP)/src/common
+LIBPMEMCORE=y
+endif
+
+ifeq ($(LIBPMEMCORE), y)
+DYNAMIC_LIBS += -lpmemcore
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmemcore.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmemcore.a
+CFLAGS += -I$(TOP)/src/core
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += $(LIBNDCTL_LIBS)
+endif
+
+ifeq ($(LIBPMEMPOOL), y)
+LIBPMEM=y
+DYNAMIC_LIBS += -lpmempool
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmempool.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmempool.a
+endif
+
+ifeq ($(LIBPMEMBLK), y)
+LIBPMEM=y
+DYNAMIC_LIBS += -lpmemblk
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmemblk.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmemblk.a
+endif
+
+ifeq ($(LIBPMEMLOG), y)
+LIBPMEM=y
+DYNAMIC_LIBS += -lpmemlog
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmemlog.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmemlog.a
+endif
+
+ifeq ($(LIBPMEMOBJ), y)
+LIBPMEM=y
+DYNAMIC_LIBS += -lpmemobj
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmemobj.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmemobj.a
+endif
+
+ifeq ($(LIBPMEM),y)
+DYNAMIC_LIBS += -lpmem
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmem.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmem.a
+endif
+
+ifeq ($(LIBPMEM2),y)
+DYNAMIC_LIBS += -lpmem2
+STATIC_DEBUG_LIBS += $(LIBSDIR_DEBUG)/libpmem2.a
+STATIC_NONDEBUG_LIBS += $(LIBSDIR_NONDEBUG)/libpmem2.a
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += $(LIBNDCTL_LIBS)
+endif
+
+# If any of these libraries is required, we need to link libpthread
+ifneq ($(LIBPMEMCORE)$(LIBPMEMCOMMON)$(LIBPMEM)$(LIBPMEM2)$(LIBPMEMPOOL)$(LIBPMEMBLK)$(LIBPMEMLOG)$(LIBPMEMOBJ),)
+LIBS += -pthread
+endif
+
+# If any of these libraries is required, we need to link libdl
+ifneq ($(LIBPMEMCOMMON)$(LIBPMEMPOOL)$(LIBPMEMOBJ),)
+LIBS += $(LIBDL)
+endif
+
+ifeq ($(TOOLS_COMMON), y)
+vpath %.c $(TOP)/src/tools/pmempool
+
+OBJS += common.o output.o
+
+CFLAGS += -I$(TOP)/src/core
+CFLAGS += -I$(TOP)/src/common
+CFLAGS += -I$(TOP)/src/libpmemlog
+CFLAGS += -I$(TOP)/src/libpmemblk
+CFLAGS += -I$(TOP)/src/libpmemobj
+CFLAGS += -I$(TOP)/src/tools/pmempool
+CFLAGS += $(UNIX98_CFLAGS)
+
+endif
+
+ifneq ($(LIBPMEMLOG_PRIV),)
+OBJS += pmemlog_priv.o
+endif
+
+ifneq ($(LIBPMEMOBJ_PRIV),)
+OBJS += pmemobj_priv.o
+endif
+
+ifneq ($(LIBPMEMBLK_PRIV),)
+OBJS += pmemblk_priv.o
+endif
+
+ifneq ($(HEADERS),)
+ifneq ($(filter 1 2, $(CSTYLEON)),)
+TMP_HEADERS := $(addsuffix tmp, $(HEADERS))
+endif
+endif
+
+ifeq ($(COVERAGE),1)
+CFLAGS += $(GCOV_CFLAGS)
+LDFLAGS += $(GCOV_LDFLAGS)
+LIBS += $(GCOV_LIBS)
+endif
+
+MAKEFILE_DEPS=$(TOP)/src/tools/Makefile.inc $(TOP)/src/common.inc
+
+ifneq ($(TARGET),)
+all: $(TARGET) $(TARGET_STATIC_NONDEBUG) $(TARGET_STATIC_DEBUG)
+else
+all:
+endif
+
+SYNC_FILE=.synced
+
+clean:
+       $(RM) $(OBJS) $(CLEAN_FILES) $(SYNC_FILE) $(TMP_HEADERS)
+
+clobber: clean
+ifneq ($(TARGET),)
+       $(RM) $(TARGET)
+       $(RM) $(TARGET_STATIC_NONDEBUG)
+       $(RM) $(TARGET_STATIC_DEBUG)
+       $(RM) -r .deps
+endif
+
+install: all
+ifeq ($(INSTALL_TARGET),y)
+ifneq ($(TARGET),)
+       install -d $(TARGET_DIR)
+       install -p -m 0755 $(TARGET) $(TARGET_DIR)
+endif
+ifneq ($(BASH_COMP_FILES),)
+       install -d $(BASH_COMP_DESTDIR)
+       install -p -m 0644 $(BASH_COMP_FILES) $(BASH_COMP_DESTDIR)
+endif
+endif
+
+uninstall:
+ifeq ($(INSTALL_TARGET),y)
+ifneq ($(TARGET),)
+       $(RM) $(TARGET_DIR)/$(TARGET)
+endif
+ifneq ($(BASH_COMP_FILES),)
+       $(RM) $(BASH_COMP_DESTDIR)/$(BASH_COMP_FILES)
+endif
+endif
+
+%.gz: %
+       gzip -nc ./$< > $@
+
+%.txt: %
+       man ./$< > $@
+
+$(TARGET) $(TARGET_STATIC_DEBUG) $(TARGET_STATIC_NONDEBUG): $(TMP_HEADERS) $(OBJS) $(MAKEFILE_DEPS)
+
+$(TARGET_STATIC_DEBUG): $(STATIC_DEBUG_LIBS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(STATIC_DEBUG_LIBS) $(LIBS)
+
+$(TARGET_STATIC_NONDEBUG): $(STATIC_NONDEBUG_LIBS)
+       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(STATIC_NONDEBUG_LIBS) $(LIBS)
+
+$(TARGET):
+       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(DYNAMIC_LIBS) $(LIBS)
+
+$(PMEMLOG_PRIV_OBJ):
+       $(MAKE) -C $(LIBSDIR) libpmemlog
+
+pmemlog_priv.o: $(PMEMLOG_PRIV_OBJ)
+       $(OBJCOPY) --localize-hidden $(addprefix -G, $(LIBPMEMLOG_PRIV)) $< $@
+
+$(PMEMOBJ_PRIV_OBJ):
+       $(MAKE) -C $(LIBSDIR) libpmemobj
+
+pmemobj_priv.o: $(PMEMOBJ_PRIV_OBJ)
+       $(OBJCOPY) --localize-hidden $(addprefix -G, $(LIBPMEMOBJ_PRIV)) $< $@
+
+$(PMEMBLK_PRIV_OBJ):
+       $(MAKE) -C $(LIBSDIR) libpmemblk
+
+pmemblk_priv.o: $(PMEMBLK_PRIV_OBJ)
+       $(OBJCOPY) --localize-hidden $(addprefix -G, $(LIBPMEMBLK_PRIV)) $< $@
+
+objdir=.
+
+%.o: %.c $(MAKEFILE_DEPS)
+       $(call check-cstyle, $<)
+       @mkdir -p .deps
+       $(CC) -MD $(CFLAGS) $(INCS) -c -o $@ $(call coverage-path, $<)
+       $(call check-os, $@, $<)
+       $(create-deps)
+
+%.htmp: %.h
+       $(call check-cstyle, $<, $@)
+
+test check pcheck: all
+
+TESTCONFIG=$(TOP)/src/test/testconfig.sh
+DIR_SYNC=$(TOP)/src/test/.sync-dir
+
+$(TESTCONFIG):
+
+sync-remotes: all $(SYNC_FILE)
+
+$(SYNC_FILE): $(TARGET) $(TESTCONFIG)
+ifeq ($(SCP_TO_REMOTE_NODES), y)
+       cp $(TARGET) $(DIR_SYNC)
+       @touch $(SYNC_FILE)
+endif
+
+sparse:
+       $(if $(TARGET), $(sparse-c))
+
+.PHONY: all clean clobber install uninstall test check pcheck
+
+-include .deps/*.P
diff --git a/ceph/src/pmdk/src/tools/daxio/Makefile b/ceph/src/pmdk/src/tools/daxio/Makefile
new file mode 100644 (file)
index 0000000..9fc70dc
--- /dev/null
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+#
+# Makefile -- top Makefile for daxio
+#
+
+TOP = ../../..
+include $(TOP)/src/common.inc
+
+INCS += -I$(TOP)/src/libpmem2
+
+ifeq ($(NDCTL_ENABLE),y)
+
+SCP_TO_REMOTE_NODES = y
+
+TARGET = daxio
+OBJS = daxio.o
+
+LIBPMEM=y
+LIBPMEMCOMMON=y
+
+CFLAGS += $(LIBNDCTL_CFLAGS)
+LIBS += $(LIBNDCTL_LIBS)
+
+MANPAGES = $(TOP)/doc/daxio.1
+
+# XXX: to be done
+# BASH_COMP_FILES = daxio.sh
+
+else
+$(info NOTE: Skipping daxio because ndctl is not available)
+endif
+
+include ../Makefile.inc
+
+.PHONY: test check
diff --git a/ceph/src/pmdk/src/tools/daxio/README b/ceph/src/pmdk/src/tools/daxio/README
new file mode 100644 (file)
index 0000000..91af280
--- /dev/null
@@ -0,0 +1,47 @@
+Persistent Memory Development Kit
+
+This is src/tools/daxio/README.
+
+This file contains the high-level description of daxio utility.
+
+The main purpose of daxio is to perform I/O on Device DAX devices or zero
+a Device DAX device.  Since the standard I/O APIs (read/write) cannot be used
+with Device DAX, data transfer is performed on a memory-mapped device.
+The daxio may be used to dump Device DAX data to a file, restore data from
+a backup copy, or move/copy data to another device.
+
+There must be at least one Device DAX device involved either as the input
+or output.  If input or output is not specified, it will default to stdin
+or stdout respectively.
+
+No length specified will default to input file/device length or to the
+output file/device length, if input is a special char file or stdin.
+
+For a Device DAX device, daxio will attempt to clear badblocks within range
+of writes before performing the I/O.
+
+3. Source code
+--------------
+
+The source code of daxio is located in daxio directory.
+
+By default daxio is installed in $(DESTDIR)/usr/bin directory.
+You can change it by passing $(TOOLSDIR) variable to "make install".
+For example, the following command will install daxio in ~/bin directory:
+       $ make install DESTDIR=~ TOOLSDIR=/bin
+
+See the top-level README file for detailed information about building and
+installation.
+
+4. Packaging
+------------
+
+The daxio utility is provided in separate packages. Both rpm and dpkg
+packages are built automatically with other packages.
+
+See the top-level README file for detailed information about building packages.
+
+5. Versioning
+-------------
+
+The versioning of daxio utility is the same as all PMDK libraries.
diff --git a/ceph/src/pmdk/src/tools/daxio/daxio.c b/ceph/src/pmdk/src/tools/daxio/daxio.c
new file mode 100644 (file)
index 0000000..66cd0b7
--- /dev/null
@@ -0,0 +1,607 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * daxio.c -- simple app for reading and writing data from/to
+ *            Device DAX device using mmap instead of file I/O API
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <limits.h>
+#include <string.h>
+
+#include <ndctl/libndctl.h>
+#include <ndctl/libdaxctl.h>
+#include <libpmem.h>
+
+#include "util.h"
+#include "os.h"
+#include "badblocks.h"
+
+#define ALIGN_UP(size, align) (((size) + (align) - 1) & ~((align) - 1))
+#define ALIGN_DOWN(size, align) ((size) & ~((align) - 1))
+
+#define ERR(fmt, ...)\
+do {\
+       fprintf(stderr, "daxio: " fmt, ##__VA_ARGS__);\
+} while (0)
+
+#define FAIL(func)\
+do {\
+       fprintf(stderr, "daxio: %s:%d: %s: %s\n",\
+               __func__, __LINE__, func, strerror(errno));\
+} while (0)
+
+#define USAGE_MESSAGE \
+"Usage: daxio [option] ...\n"\
+"Valid options:\n"\
+"   -i, --input=FILE                - input device/file (default stdin)\n"\
+"   -o, --output=FILE               - output device/file (default stdout)\n"\
+"   -k, --skip=BYTES                - skip offset for input (default 0)\n"\
+"   -s, --seek=BYTES                - seek offset for output (default 0)\n"\
+"   -l, --len=BYTES                 - total length to perform the I/O\n"\
+"   -b, --clear-bad-blocks=<yes|no> - clear bad blocks (default: yes)\n"\
+"   -z, --zero                      - zeroing the device\n"\
+"   -h. --help                      - print this help\n"\
+"   -V, --version                   - display version of daxio\n"
+
+struct daxio_device {
+       char *path;
+       int fd;
+       size_t size;            /* actual file/device size */
+       int is_devdax;
+
+       /* Device DAX only */
+       size_t align;           /* internal device alignment */
+       char *addr;             /* mapping base address */
+       size_t maplen;          /* mapping length */
+       size_t offset;          /* seek or skip */
+
+       unsigned major;
+       unsigned minor;
+       struct ndctl_ctx *ndctl_ctx;
+       struct ndctl_region *region;    /* parent region */
+};
+
+/*
+ * daxio_context -- context and arguments
+ */
+struct daxio_context {
+       size_t len;     /* total length of I/O */
+       int zero;
+       int clear_bad_blocks;
+       struct daxio_device src;
+       struct daxio_device dst;
+};
+
+/*
+ * default context
+ */
+static struct daxio_context Ctx = {
+       SIZE_MAX,       /* len */
+       0,              /* zero */
+       1,              /* clear_bad_blocks */
+       { NULL, -1, SIZE_MAX, 0, 0, NULL, 0, 0, 0, 0, NULL, NULL },
+       { NULL, -1, SIZE_MAX, 0, 0, NULL, 0, 0, 0, 0, NULL, NULL },
+};
+
+/*
+ * print_version -- print daxio version
+ */
+static void
+print_version(void)
+{
+       printf("%s\n", SRCVERSION);
+}
+
+/*
+ * print_usage -- print short description of usage
+ */
+static void
+print_usage(void)
+{
+       fprintf(stderr, USAGE_MESSAGE);
+}
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"input",                       required_argument,      NULL,   'i'},
+       {"output",                      required_argument,      NULL,   'o'},
+       {"skip",                        required_argument,      NULL,   'k'},
+       {"seek",                        required_argument,      NULL,   's'},
+       {"len",                         required_argument,      NULL,   'l'},
+       {"clear-bad-blocks",            required_argument,      NULL,   'b'},
+       {"zero",                        no_argument,            NULL,   'z'},
+       {"help",                        no_argument,            NULL,   'h'},
+       {"version",                     no_argument,            NULL,   'V'},
+       {NULL,                          0,                      NULL,    0 },
+};
+
+/*
+ * parse_args -- (internal) parse command line arguments
+ */
+static int
+parse_args(struct daxio_context *ctx, int argc, char * const argv[])
+{
+       int opt;
+       size_t offset;
+       size_t len;
+
+       while ((opt = getopt_long(argc, argv, "i:o:k:s:l:b:zhV",
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'i':
+                       ctx->src.path = optarg;
+                       break;
+               case 'o':
+                       ctx->dst.path = optarg;
+                       break;
+               case 'k':
+                       if (util_parse_size(optarg, &offset)) {
+                               ERR("'%s' -- invalid input offset\n", optarg);
+                               return -1;
+                       }
+                       ctx->src.offset = offset;
+                       break;
+               case 's':
+                       if (util_parse_size(optarg, &offset)) {
+                               ERR("'%s' -- invalid output offset\n", optarg);
+                               return -1;
+                       }
+                       ctx->dst.offset = offset;
+                       break;
+               case 'l':
+                       if (util_parse_size(optarg, &len)) {
+                               ERR("'%s' -- invalid length\n", optarg);
+                               return -1;
+                       }
+                       ctx->len = len;
+                       break;
+               case 'z':
+                       ctx->zero = 1;
+                       break;
+               case 'b':
+                       if (strcmp(optarg, "no") == 0) {
+                               ctx->clear_bad_blocks = 0;
+                       } else if (strcmp(optarg, "yes") == 0) {
+                               ctx->clear_bad_blocks = 1;
+                       } else {
+                               ERR(
+                                       "'%s' -- invalid argument of the '--clear-bad-blocks' option\n",
+                                       optarg);
+                               return -1;
+                       }
+                       break;
+               case 'h':
+                       print_usage();
+                       exit(EXIT_SUCCESS);
+               case 'V':
+                       print_version();
+                       exit(EXIT_SUCCESS);
+               default:
+                       print_usage();
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * validate_args -- (internal) validate command line arguments
+ */
+static int
+validate_args(struct daxio_context *ctx)
+{
+       if (ctx->zero && ctx->dst.path == NULL) {
+               ERR("zeroing flag specified but no output file provided\n");
+               return -1;
+       }
+
+       if (!ctx->zero && ctx->src.path == NULL && ctx->dst.path == NULL) {
+               ERR("an input file and/or an output file must be provided\n");
+               return -1;
+       }
+
+       /* if no input file provided, use stdin */
+       if (ctx->src.path == NULL) {
+               if (ctx->src.offset != 0) {
+                       ERR(
+                       "skip offset specified but no input file provided\n");
+                       return -1;
+               }
+               ctx->src.fd = STDIN_FILENO;
+               ctx->src.path = "STDIN";
+       }
+
+       /* if no output file provided, use stdout */
+       if (ctx->dst.path == NULL) {
+               if (ctx->dst.offset != 0) {
+                       ERR(
+                       "seek offset specified but no output file provided\n");
+                       return -1;
+               }
+               ctx->dst.fd = STDOUT_FILENO;
+               ctx->dst.path = "STDOUT";
+       }
+
+       return 0;
+}
+
+/*
+ * match_dev_dax -- (internal) find Device DAX by major/minor device number
+ */
+static int
+match_dev_dax(struct daxio_device *dev, struct daxctl_region *dax_region)
+{
+       struct daxctl_dev *d;
+
+       daxctl_dev_foreach(dax_region, d) {
+               if (dev->major == (unsigned)daxctl_dev_get_major(d) &&
+                   dev->minor == (unsigned)daxctl_dev_get_minor(d)) {
+                       dev->size = daxctl_dev_get_size(d);
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * find_dev_dax -- (internal) check if device is Device DAX
+ *
+ * If there is matching Device DAX, find its region, size and alignment.
+ */
+static int
+find_dev_dax(struct ndctl_ctx *ndctl_ctx, struct daxio_device *dev)
+{
+       struct ndctl_bus *bus = NULL;
+       struct ndctl_region *region = NULL;
+       struct ndctl_dax *dax = NULL;
+       struct daxctl_region *dax_region = NULL;
+
+       ndctl_bus_foreach(ndctl_ctx, bus) {
+               ndctl_region_foreach(bus, region) {
+                       ndctl_dax_foreach(region, dax) {
+                               dax_region = ndctl_dax_get_daxctl_region(dax);
+                               if (match_dev_dax(dev, dax_region)) {
+                                       dev->is_devdax = 1;
+                                       dev->align = ndctl_dax_get_align(dax);
+                                       dev->region = region;
+                                       return 1;
+                               }
+                       }
+               }
+       }
+
+       /* try with dax regions */
+       struct daxctl_ctx *daxctl_ctx;
+       if (daxctl_new(&daxctl_ctx))
+               return 0;
+
+       int ret = 0;
+       daxctl_region_foreach(daxctl_ctx, dax_region) {
+               if (match_dev_dax(dev, dax_region)) {
+                       dev->is_devdax = 1;
+                       dev->align = daxctl_region_get_align(dax_region);
+                       dev->region = region;
+                       ret = 1;
+                       goto end;
+               }
+       }
+
+end:
+       daxctl_unref(daxctl_ctx);
+       return ret;
+}
+
+/*
+ * setup_device -- (internal) open/mmap file/device
+ */
+static int
+setup_device(struct ndctl_ctx *ndctl_ctx, struct daxio_device *dev, int is_dst,
+               int clear_bad_blocks)
+{
+       int ret;
+       int flags = O_RDWR;
+       int prot = is_dst ? PROT_WRITE : PROT_READ;
+
+       if (dev->fd != -1) {
+               dev->size = SIZE_MAX;
+               return 0;       /* stdin/stdout */
+       }
+
+       /* try to open file/device (if exists) */
+       dev->fd = os_open(dev->path, flags, S_IRUSR|S_IWUSR);
+       if (dev->fd == -1) {
+               ret = errno;
+               if (ret == ENOENT && is_dst) {
+                       /* file does not exist - create it */
+                       flags = O_CREAT|O_WRONLY|O_TRUNC;
+                       dev->size = SIZE_MAX;
+                       dev->fd = os_open(dev->path, flags, S_IRUSR|S_IWUSR);
+                       if (dev->fd == -1) {
+                               FAIL("open");
+                               return -1;
+                       }
+                       return 0;
+               } else {
+                       ERR("failed to open '%s': %s\n", dev->path,
+                               strerror(errno));
+                       return -1;
+               }
+       }
+
+       struct stat stbuf;
+       ret = fstat(dev->fd, &stbuf);
+       if (ret == -1) {
+               FAIL("stat");
+               return -1;
+       }
+
+       /* check if this is regular file or device */
+       if (S_ISREG(stbuf.st_mode)) {
+               if (is_dst)
+                       dev->size = SIZE_MAX;
+               else
+                       dev->size = (size_t)stbuf.st_size;
+       } else if (S_ISBLK(stbuf.st_mode)) {
+               dev->size = (size_t)stbuf.st_size;
+       } else if (S_ISCHR(stbuf.st_mode)) {
+               dev->size = SIZE_MAX;
+               dev->major = major(stbuf.st_rdev);
+               dev->minor = minor(stbuf.st_rdev);
+       } else {
+               return -1;
+       }
+
+       /* check if this is Device DAX */
+       if (S_ISCHR(stbuf.st_mode))
+               find_dev_dax(ndctl_ctx, dev);
+
+       if (!dev->is_devdax)
+               return 0;
+
+       if (is_dst && clear_bad_blocks) {
+               /* XXX - clear only badblocks in range bound by offset/len */
+               if (badblocks_clear_all(dev->path)) {
+                       ERR("failed to clear bad blocks on \"%s\"\n"
+                           "       Probably you have not enough permissions to do that.\n"
+                           "       You can choose one of three options now:\n"
+                           "       1) run 'daxio' with 'sudo' or as 'root',\n"
+                           "       2) turn off clearing bad blocks using\n"
+                           "          the '-b/--clear-bad-blocks=no' option or\n"
+                           "       3) change permissions of some resource files -\n"
+                           "          - for details see the description of the CHECK_BAD_BLOCKS\n"
+                           "          compat feature in the pmempool-feature(1) man page.\n",
+                               dev->path);
+                       return -1;
+               }
+       }
+
+       if (dev->align == ULONG_MAX) {
+               ERR("cannot determine device alignment for \"%s\"\n",
+                               dev->path);
+               return -1;
+       }
+
+       if (dev->offset > dev->size) {
+               ERR("'%zu' -- offset beyond device size (%zu)\n",
+                               dev->offset, dev->size);
+               return -1;
+       }
+
+       /* align len/offset to the internal device alignment */
+       dev->maplen = ALIGN_UP(dev->size, dev->align);
+       size_t offset = ALIGN_DOWN(dev->offset, dev->align);
+       dev->offset = dev->offset - offset;
+       dev->maplen = dev->maplen - offset;
+
+       dev->addr = mmap(NULL, dev->maplen, prot, MAP_SHARED, dev->fd,
+                       (off_t)offset);
+       if (dev->addr == MAP_FAILED) {
+               FAIL("mmap");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * setup_devices -- (internal) open/mmap input and output
+ */
+static int
+setup_devices(struct ndctl_ctx *ndctl_ctx, struct daxio_context *ctx)
+{
+       if (!ctx->zero &&
+           setup_device(ndctl_ctx, &ctx->src, 0, ctx->clear_bad_blocks))
+               return -1;
+       return setup_device(ndctl_ctx, &ctx->dst, 1, ctx->clear_bad_blocks);
+}
+
+/*
+ * adjust_io_len -- (internal) calculate I/O length if not specified
+ */
+static void
+adjust_io_len(struct daxio_context *ctx)
+{
+       size_t src_len = ctx->src.maplen - ctx->src.offset;
+       size_t dst_len = ctx->dst.maplen - ctx->dst.offset;
+       size_t max_len = SIZE_MAX;
+
+       if (ctx->zero)
+               assert(ctx->dst.is_devdax);
+       else
+               assert(ctx->src.is_devdax || ctx->dst.is_devdax);
+
+       if (ctx->src.is_devdax)
+               max_len = src_len;
+       if (ctx->dst.is_devdax)
+               max_len = max_len < dst_len ? max_len : dst_len;
+
+       /* if length is specified and is not bigger than mmapped region */
+       if (ctx->len != SIZE_MAX && ctx->len <= max_len)
+               return;
+
+       /* adjust len to device size */
+       ctx->len = max_len;
+}
+
+/*
+ * cleanup_device -- (internal) unmap/close file/device
+ */
+static void
+cleanup_device(struct daxio_device *dev)
+{
+       if (dev->addr)
+               (void) munmap(dev->addr, dev->maplen);
+       if (dev->path && dev->fd != -1)
+               (void) close(dev->fd);
+}
+
+/*
+ * cleanup_devices -- (internal) unmap/close input and output
+ */
+static void
+cleanup_devices(struct daxio_context *ctx)
+{
+       cleanup_device(&ctx->dst);
+       if (!ctx->zero)
+               cleanup_device(&ctx->src);
+}
+
+/*
+ * do_io -- (internal) write data to device/file
+ */
+static int
+do_io(struct ndctl_ctx *ndctl_ctx, struct daxio_context *ctx)
+{
+       ssize_t cnt = 0;
+
+       assert(ctx->src.is_devdax || ctx->dst.is_devdax);
+
+       if (ctx->zero) {
+               if (ctx->dst.offset > ctx->dst.maplen) {
+                       ERR("output offset larger than device size");
+                       return -1;
+               }
+               if (ctx->dst.offset + ctx->len > ctx->dst.maplen) {
+                       ERR("output offset beyond device size");
+                       return -1;
+               }
+
+               char *dst_addr = ctx->dst.addr + ctx->dst.offset;
+               pmem_memset_persist(dst_addr, 0, ctx->len);
+               cnt = (ssize_t)ctx->len;
+       } else if (ctx->src.is_devdax && ctx->dst.is_devdax) {
+               /* memcpy between src and dst */
+               char *src_addr = ctx->src.addr + ctx->src.offset;
+               char *dst_addr = ctx->dst.addr + ctx->dst.offset;
+               pmem_memcpy_persist(dst_addr, src_addr, ctx->len);
+               cnt = (ssize_t)ctx->len;
+       } else if (ctx->src.is_devdax) {
+               /* write to file directly from mmap'ed src */
+               char *src_addr = ctx->src.addr + ctx->src.offset;
+               if (ctx->dst.offset) {
+                       if (lseek(ctx->dst.fd, (off_t)ctx->dst.offset,
+                                       SEEK_SET) < 0) {
+                               FAIL("lseek");
+                               goto err;
+                       }
+               }
+               do {
+                       ssize_t wcnt = write(ctx->dst.fd, src_addr + cnt,
+                                       ctx->len - (size_t)cnt);
+                       if (wcnt == -1) {
+                               FAIL("write");
+                               goto err;
+                       }
+                       cnt += wcnt;
+               } while ((size_t)cnt < ctx->len);
+       } else if (ctx->dst.is_devdax) {
+               /* read from file directly to mmap'ed dst */
+               char *dst_addr = ctx->dst.addr + ctx->dst.offset;
+               if (ctx->src.offset) {
+                       if (lseek(ctx->src.fd, (off_t)ctx->src.offset,
+                                       SEEK_SET) < 0) {
+                               FAIL("lseek");
+                               return -1;
+                       }
+               }
+               do {
+                       ssize_t rcnt = read(ctx->src.fd, dst_addr + cnt,
+                                       ctx->len - (size_t)cnt);
+                       if (rcnt == -1) {
+                               FAIL("read");
+                               goto err;
+                       }
+                       /* end of file */
+                       if (rcnt == 0)
+                               break;
+                       cnt = cnt + rcnt;
+               } while ((size_t)cnt < ctx->len);
+
+               pmem_persist(dst_addr, (size_t)cnt);
+
+               if ((size_t)cnt != ctx->len)
+                       ERR("requested size %zu larger than source\n",
+                                       ctx->len);
+       }
+
+       ERR("copied %zd bytes to device \"%s\"\n", cnt, ctx->dst.path);
+       return 0;
+
+err:
+       ERR("failed to perform I/O\n");
+       return -1;
+}
+
+int
+main(int argc, char **argv)
+{
+       struct ndctl_ctx *ndctl_ctx;
+       int ret = EXIT_SUCCESS;
+
+       if (parse_args(&Ctx, argc, argv))
+               return EXIT_FAILURE;
+
+       if (validate_args(&Ctx))
+               return EXIT_FAILURE;
+
+       if (ndctl_new(&ndctl_ctx))
+               return EXIT_FAILURE;
+
+       if (setup_devices(ndctl_ctx, &Ctx)) {
+               ret = EXIT_FAILURE;
+               goto err;
+       }
+
+       if (!Ctx.src.is_devdax && !Ctx.dst.is_devdax) {
+               ERR("neither input nor output is device dax\n");
+               ret = EXIT_FAILURE;
+               goto err;
+       }
+
+       adjust_io_len(&Ctx);
+
+       if (do_io(ndctl_ctx, &Ctx))
+               ret = EXIT_FAILURE;
+
+err:
+       cleanup_devices(&Ctx);
+       ndctl_unref(ndctl_ctx);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/Makefile b/ceph/src/pmdk/src/tools/pmempool/Makefile
new file mode 100644 (file)
index 0000000..ba314a4
--- /dev/null
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+#
+# Makefile -- top Makefile for pmempool
+#
+SCP_TO_REMOTE_NODES = y
+
+vpath %.c ../../libpmemobj/
+vpath %.c ../../librpmem/
+vpath %.c ../../rpmem_common/
+
+TARGET = pmempool
+
+OBJS = pmempool.o\
+       info.o info_blk.o info_log.o info_obj.o ulog.o\
+       create.o dump.o check.o rm.o convert.o synchronize.o transform.o\
+       rpmem_ssh.o rpmem_cmd.o rpmem_util.o rpmem_common.o feature.o
+
+LIBPMEM=y
+LIBPMEMBLK=y
+LIBPMEMOBJ=y
+LIBPMEMLOG=y
+LIBPMEMPOOL=y
+TOOLS_COMMON=y
+
+LIBPMEMOBJ_PRIV=memblock_from_offset alloc_class_by_id\
+       memblock_rebuild_state alloc_class_by_run\
+       heap_run_foreach_object alloc_class_collection_new\
+       alloc_class_collection_delete
+
+LIBPMEMBLK_PRIV=btt_init btt_write btt_fini btt_info_convert2h\
+       btt_info_convert2le btt_flog_convert2h btt_flog_convert2le
+
+INCS += -I$(TOP)/src/common
+INCS += -I$(TOP)/src/rpmem_common
+INCS += -I$(TOP)/src/libpmem2
+INCS += -I$(TOP)/src/librpmem
+INCS += -I$(TOP)/src/libpmemlog
+INCS += -I$(TOP)/src/libpmemblk
+INCS += -I$(TOP)/src/libpmemobj
+
+CFLAGS += -DUSE_RPMEM
+
+MANPAGES = $(TOP)/doc/pmempool.1\
+           $(TOP)/doc/pmempool-info.1\
+          $(TOP)/doc/pmempool-create.1\
+          $(TOP)/doc/pmempool-check.1\
+          $(TOP)/doc/pmempool-dump.1\
+          $(TOP)/doc/pmempool-rm.1\
+          $(TOP)/doc/pmempool-convert.1\
+          $(TOP)/doc/pmempool-sync.1\
+          $(TOP)/doc/pmempool-transform.1
+
+BASH_COMP_FILES = bash_completion/pmempool
+
+include ../Makefile.inc
+
+.PHONY: test check
diff --git a/ceph/src/pmdk/src/tools/pmempool/README b/ceph/src/pmdk/src/tools/pmempool/README
new file mode 100644 (file)
index 0000000..e1c7e97
--- /dev/null
@@ -0,0 +1,306 @@
+Persistent Memory Development Kit
+
+This is src/tools/pmempool/README.
+
+This file contains the high-level description of pmempool utility.
+
+       1. Introduction
+       2. Subcommands
+          2.1. info
+          2.2. check
+          2.3. create
+          2.4. dump
+          2.5. rm
+          2.6. sync
+          2.7. transform
+          2.8. convert
+       3. Source code
+       4. Packaging
+       5. Versioning
+
+1. Introduction
+---------------
+
+The main purpose of pmempool is to provide a user with set of utilities for
+off-line analysis and manipulation of pools created by pmem libraries. The
+pmempool is a generic command which consists of subcommands for specific
+purposes. Some of commands are required to work without any impact on processed
+pool, but some of them may create new or modify existing one.
+
+The pmempool may be useful for troubleshooting and may be used by system
+administrators and by software developers work on applications based on
+Persistent Memory Development Kit. The latter may find these tools useful for testing and debugging
+purposes also.
+
+Currently there is a following set of commands available:
+
+       * info          - Prints information and statistics in human-readable
+                         format about specified pool.
+
+       * check         - Checks pool's consistency and repairs pool if it is
+                         not consistent.
+
+       * create        - Creates a pool of specified type with additional
+                         properties specific for this type of pool.
+
+       * dump          - Dumps usable data from pool in hexadecimal or binary
+                         format.
+
+       * rm            - Removes pool file or all pool files listed in poolset
+                         configuration file.
+
+       * sync          - Synchronizes replicas within a poolset.
+
+       * transform     - Modifies internal structure of a poolset.
+
+       * convert       - Updates the pool to the latest available
+                         layout version.
+
+This file contains high-level description of available commands and their
+features. For details about usage and available command line arguments please
+refer to specific manual pages. There is one common manual page with description
+of all commands - pmempool(1) and manual pages which describe all commands
+in detail:
+       pmempool-info(1)
+       pmempool-check(1)
+       pmempool-create(1)
+       pmempool-dump(1)
+       pmempool-rm(1)
+       pmempool-sync(1)
+       pmempool-transform(1)
+       pmempool-convert(1)
+
+Subsequent sections contain detailed description of each command, information
+about the source code, packaging and versioning scheme.
+
+2. Subcommands
+--------------
+
+The pmempool application contains number of commands which perform specific
+operations on pool. The following subsections contain detailed description of
+existing commands.
+
+2.1. info
+---------
+
+The pmempool invoked with *info* command analyzes the existing pool created
+by PMDK libraries. The main task of this command is to print all usable
+information from pool headers and user data in human readable format. It
+automatically recognizes pool type by parsing and analyzing pool header. The
+recognition is done by checking the signature in pool header. The main
+intention of *info* command is to present internal data structures as they are
+stored in file - not for checking consistency. For this purpose there is *check*
+command available.
+
+The pmempool with *info* command analyzes a pool file as long as it is possible
+regarding correctness of internal meta-data (correct offsets, sizes etc.). If it
+is not possible to analyze rest of file, pmempool exits with an error code and
+prints an appropriate error message.
+
+Currently there is lack of interprocess synchronization for pool files, so the
+pmempool with *info* command should be invoked off-line. Using pmempool on
+pool file which may be modified by another process may lead to stopping
+processing the file.
+
+There is a set of common features for all pool types and a set of features
+specific for particular pool type.
+All features are described below.
+
+** Common features
+
+ * The basic function of *info* command is to print information about the
+   most important internal data structures from specific pool. By default this
+   is done by invoking pmempool with *info* command and one or more files.
+
+ * It is possible to print basic statistics about the pool by passing
+   appropriate command line argument.
+
+ * The type of pool is recognized automatically. The exact list of headers and
+   internal meta-data depends on pool's type. All information is displayed in
+   human-readable format.
+
+ * The pool header may be corrupted and automatic recognition of pool's type
+   will fail. In order to analyze a pool file as a pool of specific type it is
+   possible to force that by specifying the desired pool type using appropriate
+   command line argument.
+
+ * Headers and internal meta-data are displayed in human-readable format by
+   default. However it is possible to display them in mixed format which
+   consists of hexadecimal dump of headers and parsed data in human-readable
+   format.
+
+ * By default only non-volatile fields from internal structures are displayed.
+   In order to display volatile fields you should increase the verbosity level.
+
+ * By default all sizes are displayed in bytes unit. It is possible to print
+   them in more human-readable formats with appropriate units
+   (e.g. 4k, 8M, 16G).
+
+** Features for *log* pool type
+
+ * By default pmempool with *info* command displays the pool header, log pool
+   type specific header and statistics. It is possible to print data in
+   hexadecimal format by passing appropriate command line option.
+
+ * It is possible to walk through the usable data using fixed data chunk size.
+   This feature uses similar approach as pmemlog_walk() function. For details
+   please refer to libpmemlog(7).
+
+** Features for *blk* pool type
+
+ * By default pmempool with *info* command displays the pool header, blk pool
+   type specific header, BTT Info header and statistics.
+
+ * It is possible to print more headers and internal data by passing specific
+   command line options. It is possible to print the following sections:
+   BTT Map entries, BTT FLOG, BTT Info backup and data blocks.
+
+ * It is possible to print specific range of blocks in both absolute or relative
+   manner (e.g. display blocks from 10 to 1000, display 10 blocks starting from
+   block number 1000)
+
+ * By default when displaying data blocks all blocks are displayed. However it
+   is possible to skip blocks marked with zero or error flags, or to skip blocks
+   which are not marked by any flag. Skipping blocks has impact on blocks ranges
+   (e.g. display 10 blocks marked with error flag in the range from 0 to 10000)
+
+2.2. check
+----------
+
+The pmempool invoked with *check* command checks existing pool's consistency.
+If the pool is consistent pmempool exits with exit code 0. Otherwise nonzero
+error code is returned and appropriate message is displayed.
+
+In addition it may also try to fix some common known errors upon explicit demand
+of user. In this case a pool file will be opened in read-write mode so the user
+should be aware of modifications made by pmempool application.
+
+Below is the description of available features:
+
+ * By default pmempool with *check* command prints brief description about
+   encountered error(s) and proper error value is returned. If there is no error
+   nothing is printed and exit code is 0.
+
+ * If an error is encountered while checking a consistency of a pool it is
+   possible to try to fix all errors. In this case the pool file will be opened
+   in read-write mode.
+
+ * User may request to _not_ modify pool's file when trying to repair it but
+   just to report what would be done if the repair was performed.
+
+ * When repairing a pool user may request to create backup before any
+   modification is made. If it is not possible to create full backup of existing
+   pool, the process will terminate.
+
+2.3. create
+-----------
+
+The pmempool invoked with *create* command creates a pool file of specific
+type and size. Depending on pool's type it is possible to provide more desired
+properties of a pool.
+
+Below is the description of available features:
+
+ * The main feature is to create pool of specified type and size. Therefore
+   it is required to pass at least two command line arguments.
+
+ * User may want to create a pool file with size of the whole partition. This is
+   possible by passing proper command line argument.
+
+ * It is possible to create a pool with the same parameters as another pool
+   passed in command line arguments - it may be considered as cloning the pool.
+
+2.4. dump
+---------
+
+The pmempool invoked with *dump* command dumps usable data from specified
+pool. This may be dumped either in hexadecimal or binary format.
+
+Below is the description of available features:
+
+ * The main feature is to dump all data from a pool file. In case of dumping
+   data to terminal by default data is dumped in hexadecimal format. In case
+   of redirecting standard output to a file data will be dumped in binary format.
+
+ * It is possible to specify the format of dumped data to either hexadecimal or
+   binary.
+
+ * By default data is dumped to standard output. However it is possible to
+   specify a file name to dump data into.
+
+ * In case of pmem blk pool type it is possible to set range of blocks in either
+   absolute or relative manner.
+
+ * In case of pmem log pool type it is possible to set size of chunk and range
+   of chunks to dump in either absolute or relative manner.
+
+2.5. rm
+-------
+
+The pmempool *rm* command is a simple helper utility which removes pool files
+created using either PMDK libraries or pmempool *create* command.
+
+ * The main feature is to parse the poolset configuration file and remove all
+   listed pool files.
+
+ * It is possible to run the pmempool *rm* command in interactive mode, where
+   before removing each file the user must confirm the removal operation.
+
+ * The command line interface is similar to interface provided by standard,
+   system *rm* command.
+
+2.6. sync
+---------
+
+The pmempool *sync* synchronize data between replicas within a poolset.
+
+The command has the following features:
+
+ * Metadata in a poolset are checked for consistency.
+
+ * Missing or damaged parts are recreated.
+
+2.7. transform
+--------------
+
+The pmempool *transform* command modifies internal structure of a poolset.
+
+Available features of the command:
+
+ * Adding replicas.
+
+ * Removing replicas.
+
+2.8. convert
+--------------
+
+The pmempool invoked with the *convert* command performs a conversion of the
+specified pool to the newest layout supported by this tool. Currently only
+libpmemobj pools are supported. It is advised to have a backup of the pool
+before conversion.
+
+3. Source code
+--------------
+
+The source code of pmempool is located in pmempool directory.
+
+By default pmempool is installed in $(DESTDIR)/usr/bin directory.
+You can change it by passing $(TOOLSDIR) variable to "make install".
+For example, the following command will install pmempool in ~/bin directory:
+       $ make install DESTDIR=~ TOOLSDIR=/bin
+
+See the top-level README file for detailed information about building and
+installation.
+
+4. Packaging
+------------
+
+The pmempool application is provided in separate packages. Both rpm and dpkg
+packages are built automatically with other packages.
+
+See the top-level README file for detailed information about building packages.
+
+5. Versioning
+-------------
+
+The versioning of pmempool application is the same as all PMDK libraries.
diff --git a/ceph/src/pmdk/src/tools/pmempool/bash_completion/pmempool b/ceph/src/pmdk/src/tools/pmempool/bash_completion/pmempool
new file mode 100644 (file)
index 0000000..ef82bb8
--- /dev/null
@@ -0,0 +1,168 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2017, Intel Corporation
+
+#
+# pmempool -- bash completion script for pmempool
+#
+
+#
+# _pmempool_gen -- generates result for completion
+# Arguments:
+# $1 - values
+# $2 - current string
+# $3 - prefix for results
+_pmempool_gen()
+{
+       COMPREPLAY=()
+       local values=$1
+       local cur=$2
+       local prefix=$3
+       local i=${#COMPREPLY[@]}
+       for v in $values
+       do
+               [[ "$v" == "$cur"* ]] && COMPREPLY[i++]="$prefix$v"
+       done
+}
+
+#
+# _pmempool_get_cmds -- returns available pmempool commands
+#
+_pmempool_get_cmds()
+{
+       echo -n $(pmempool --help | grep -e '^\S\+\s\+-' |\
+                       grep -o '^\S\+' | sed '/help/d')
+}
+
+#
+# _pmempool_get_opts -- returns available options for specified command
+# Arguments:
+# $1 - command
+#
+_pmempool_get_opts()
+{
+       local c=$1
+       local opts=$(pmempool ${c} --help | grep -o -e "-., --\S\+" |\
+                       grep -o -e "--\S\+")
+       echo "$opts"
+}
+
+#
+# _pmempool_get_values -- returns available values for specified option
+# Arguments:
+# $1 - command
+# $2 - option
+# $3 - values delimiter
+# $4 - current values, will be removed from result
+#
+_pmempool_get_values()
+{
+       local cmd=$1
+       local opt=$2
+       local delim=$3
+       local curvals=$4
+       local vals=$(pmempool ${cmd} --help |\
+                       grep -o -e "${opt}\s\+\S\+${delim}\S\+" |\
+                       sed "s/${opt}\s\+\(\S\+${delim}\S\+\)/\1/" |\
+                       sed "s/${delim}/ /g")
+       if [ -n "$curvals" ]
+       then
+               local OLD_IFS=$IFS
+               IFS=","
+               for v in $curvals
+               do
+                       vals=$(echo $vals | sed "s/$v//g")
+               done
+               IFS=$OLD_IFS
+       fi
+       echo "${vals}"
+}
+
+#
+# _pmempool_get_cmd -- returns command name if exist in specified array
+# Arguments:
+# $1 - command name
+# $2 - list of available commands
+#
+_pmempool_get_cmd()
+{
+       local cmd=$1
+       local cmds=$2
+
+       [[ ${cmds} =~ ${cmd} ]] && echo -n ${cmd}
+}
+
+#
+# _pmempool_get_used_values -- returns already used values
+# Arguments:
+# $1 - current string
+# $2 - values delimiter
+#
+_pmempool_get_used_values()
+{
+       local cur=$1
+       local delim=$2
+       local used=$(echo $cur | rev | cut -d $delim -s -f1 --complement | rev)
+       [ -n "$used" ] && used="$used$delim"
+       echo "$used"
+}
+
+#
+# _pmempool_get_current_value -- returns current value string
+# Arguments:
+# $1 - current string
+# $2 - values delimiter
+#
+_pmempool_get_current_value()
+{
+       local cur=$1
+       local delim=$2
+       echo $cur | rev | cut -d $delim -f1 | rev
+}
+
+_pmempool()
+{
+       local cur prev opts
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       cmds=$(_pmempool_get_cmds)
+       cmds_all="$cmds help"
+       opts_pool_types="blk log obj"
+       cmd=$(_pmempool_get_cmd "${COMP_WORDS[1]}" "$cmds_all")
+
+       if [[ ${cur} == -* ]]
+       then
+               local opts=$(_pmempool_get_opts $cmd)
+               _pmempool_gen "$opts" "$cur"
+       elif [[ ${prev} == --* ]]
+       then
+               local used=$(_pmempool_get_used_values "$cur" ",")
+               local _cur=$(_pmempool_get_current_value "$cur" ",")
+               local values=$(_pmempool_get_values ${cmd} ${prev} "," $used)
+               if [ -n "${values}" ]
+               then
+                       # values separated by ',' may contain multiple values
+                       _pmempool_gen "$values" "$_cur" "$used"
+               else
+                       # values separated by '|' may contain only one value
+                       values=$(_pmempool_get_values $cmd $prev "|")
+                       _pmempool_gen "$values" "$cur"
+               fi
+       elif [[ $cmd == create ]]
+       then
+               case "${COMP_WORDS[@]}" in
+                       *blk*|*log*|*obj*|*--inherit*)
+                               ;;
+                       *)
+                               _pmempool_gen "$opts_pool_types" "$cur"
+                               ;;
+               esac
+       elif [[ ${prev} == help ]]
+       then
+               _pmempool_gen "$cmds" "$cur"
+       elif [[ ${prev} == pmempool ]]
+       then
+               _pmempool_gen "$cmds_all" "$cur"
+       fi
+}
+
+complete -o default -F _pmempool pmempool
diff --git a/ceph/src/pmdk/src/tools/pmempool/check.c b/ceph/src/pmdk/src/tools/pmempool/check.c
new file mode 100644 (file)
index 0000000..4523c93
--- /dev/null
@@ -0,0 +1,315 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * check.c -- pmempool check command source file
+ */
+#include <getopt.h>
+#include <stdlib.h>
+
+#include "common.h"
+#include "check.h"
+#include "output.h"
+#include "set.h"
+#include "file.h"
+
+#include "libpmempool.h"
+
+typedef enum
+{
+       CHECK_RESULT_CONSISTENT,
+       CHECK_RESULT_NOT_CONSISTENT,
+       CHECK_RESULT_REPAIRED,
+       CHECK_RESULT_CANNOT_REPAIR,
+       CHECK_RESULT_SYNC_REQ,
+       CHECK_RESULT_ERROR
+} check_result_t;
+
+/*
+ * pmempool_check_context -- context and arguments for check command
+ */
+struct pmempool_check_context {
+       int verbose;            /* verbosity level */
+       char *fname;            /* file name */
+       struct pool_set_file *pfile;
+       bool repair;            /* do repair */
+       bool backup;            /* do backup */
+       bool advanced;          /* do advanced repairs */
+       char *backup_fname;     /* backup file name */
+       bool exec;              /* do execute */
+       char ans;               /* default answer on all questions or '?' */
+};
+
+/*
+ * pmempool_check_default -- default arguments for check command
+ */
+static const struct pmempool_check_context pmempool_check_default = {
+       .verbose        = 1,
+       .fname          = NULL,
+       .repair         = false,
+       .backup         = false,
+       .backup_fname   = NULL,
+       .advanced       = false,
+       .exec           = true,
+       .ans            = '?',
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Check consistency of a pool\n"
+"\n"
+"Common options:\n"
+"  -r, --repair         try to repair a pool file if possible\n"
+"  -y, --yes            answer yes to all questions\n"
+"  -d, --dry-run        don't execute, just show what would be done\n"
+"  -b, --backup <file>  create backup of a pool file before executing\n"
+"  -a, --advanced       perform advanced repairs\n"
+"  -q, --quiet          be quiet and don't print any messages\n"
+"  -v, --verbose        increase verbosity level\n"
+"  -h, --help           display this help and exit\n"
+"\n"
+"For complete documentation see %s-check(1) manual page.\n"
+;
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"repair",      no_argument,            NULL,   'r'},
+       {"yes",         no_argument,            NULL,   'y'},
+       {"dry-run",     no_argument,            NULL,   'd'},
+       {"no-exec",     no_argument,            NULL,   'N'}, /* deprecated */
+       {"backup",      required_argument,      NULL,   'b'},
+       {"advanced",    no_argument,            NULL,   'a'},
+       {"quiet",       no_argument,            NULL,   'q'},
+       {"verbose",     no_argument,            NULL,   'v'},
+       {"help",        no_argument,            NULL,   'h'},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * print_usage -- print short description of application's usage
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s check [<args>] <file>\n", appname);
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_check_help -- print help message for check command
+ */
+void
+pmempool_check_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * pmempool_check_parse_args -- parse command line arguments
+ */
+static int
+pmempool_check_parse_args(struct pmempool_check_context *pcp,
+               const char *appname, int argc, char *argv[])
+{
+       int opt;
+       while ((opt = getopt_long(argc, argv, "ahvrdNb:qy",
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'r':
+                       pcp->repair = true;
+                       break;
+               case 'y':
+                       pcp->ans = 'y';
+                       break;
+               case 'd':
+               case 'N':
+                       pcp->exec = false;
+                       break;
+               case 'b':
+                       pcp->backup = true;
+                       pcp->backup_fname = optarg;
+                       break;
+               case 'a':
+                       pcp->advanced = true;
+                       break;
+               case 'q':
+                       pcp->verbose = 0;
+                       break;
+               case 'v':
+                       pcp->verbose = 2;
+                       break;
+               case 'h':
+                       pmempool_check_help(appname);
+                       exit(EXIT_SUCCESS);
+               default:
+                       print_usage(appname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (optind < argc) {
+               pcp->fname = argv[optind];
+       } else {
+               print_usage(appname);
+               exit(EXIT_FAILURE);
+       }
+
+       if (!pcp->repair && !pcp->exec) {
+               outv_err("'-N' option requires '-r'\n");
+               exit(EXIT_FAILURE);
+       }
+
+       if (!pcp->repair && pcp->backup) {
+               outv_err("'-b' option requires '-r'\n");
+               exit(EXIT_FAILURE);
+       }
+
+       return 0;
+}
+
+static check_result_t pmempool_check_2_check_res_t[] =
+{
+       [PMEMPOOL_CHECK_RESULT_CONSISTENT] = CHECK_RESULT_CONSISTENT,
+       [PMEMPOOL_CHECK_RESULT_NOT_CONSISTENT] = CHECK_RESULT_NOT_CONSISTENT,
+       [PMEMPOOL_CHECK_RESULT_REPAIRED] = CHECK_RESULT_REPAIRED,
+       [PMEMPOOL_CHECK_RESULT_CANNOT_REPAIR] = CHECK_RESULT_CANNOT_REPAIR,
+       [PMEMPOOL_CHECK_RESULT_SYNC_REQ] = CHECK_RESULT_SYNC_REQ,
+       [PMEMPOOL_CHECK_RESULT_ERROR] = CHECK_RESULT_ERROR,
+};
+
+static const char *
+check_ask(const char *msg)
+{
+       char answer = ask_Yn('?', "%s", msg);
+
+       switch (answer) {
+       case 'y':
+               return "yes";
+       case 'n':
+               return "no";
+       default:
+               return "?";
+       }
+}
+
+static check_result_t
+pmempool_check_perform(struct pmempool_check_context *pc)
+{
+       struct pmempool_check_args args = {
+               .path   = pc->fname,
+               .backup_path    = pc->backup_fname,
+               .pool_type      = PMEMPOOL_POOL_TYPE_DETECT,
+               .flags          = PMEMPOOL_CHECK_FORMAT_STR
+       };
+
+       if (pc->repair)
+               args.flags |= PMEMPOOL_CHECK_REPAIR;
+       if (!pc->exec)
+               args.flags |= PMEMPOOL_CHECK_DRY_RUN;
+       if (pc->advanced)
+               args.flags |= PMEMPOOL_CHECK_ADVANCED;
+       if (pc->ans == 'y')
+               args.flags |= PMEMPOOL_CHECK_ALWAYS_YES;
+       if (pc->verbose == 2)
+               args.flags |= PMEMPOOL_CHECK_VERBOSE;
+
+       PMEMpoolcheck *ppc = pmempool_check_init(&args, sizeof(args));
+
+       if (ppc == NULL)
+               return CHECK_RESULT_ERROR;
+
+       struct pmempool_check_status *status = NULL;
+       while ((status = pmempool_check(ppc)) != NULL) {
+               switch (status->type) {
+               case PMEMPOOL_CHECK_MSG_TYPE_ERROR:
+                       outv(1, "%s\n", status->str.msg);
+                       break;
+               case PMEMPOOL_CHECK_MSG_TYPE_INFO:
+                       outv(2, "%s\n", status->str.msg);
+                       break;
+               case PMEMPOOL_CHECK_MSG_TYPE_QUESTION:
+                       status->str.answer = check_ask(status->str.msg);
+                       break;
+               default:
+                       pmempool_check_end(ppc);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       enum pmempool_check_result ret = pmempool_check_end(ppc);
+
+       return pmempool_check_2_check_res_t[ret];
+}
+
+/*
+ * pmempool_check_func -- main function for check command
+ */
+int
+pmempool_check_func(const char *appname, int argc, char *argv[])
+{
+       int ret = 0;
+       check_result_t res = CHECK_RESULT_CONSISTENT;
+       struct pmempool_check_context pc = pmempool_check_default;
+
+       /* parse command line arguments */
+       ret = pmempool_check_parse_args(&pc, appname, argc, argv);
+       if (ret)
+               return ret;
+
+       /* set verbosity level */
+       out_set_vlevel(pc.verbose);
+
+       res = pmempool_check_perform(&pc);
+
+       switch (res) {
+       case CHECK_RESULT_CONSISTENT:
+               outv(2, "%s: consistent\n", pc.fname);
+               ret = 0;
+               break;
+       case CHECK_RESULT_NOT_CONSISTENT:
+               outv(1, "%s: not consistent\n", pc.fname);
+               ret = -1;
+               break;
+       case CHECK_RESULT_REPAIRED:
+               outv(1, "%s: repaired\n", pc.fname);
+               ret = 0;
+               break;
+       case CHECK_RESULT_CANNOT_REPAIR:
+               outv(1, "%s: cannot repair\n", pc.fname);
+               ret = -1;
+               break;
+       case CHECK_RESULT_SYNC_REQ:
+               outv(1, "%s: sync required\n", pc.fname);
+               ret = 0;
+               break;
+       case CHECK_RESULT_ERROR:
+               if (errno)
+                       outv_err("%s\n", strerror(errno));
+               if (pc.repair)
+                       outv_err("repairing failed\n");
+               else
+                       outv_err("checking consistency failed\n");
+               ret = -1;
+               break;
+       default:
+               outv_err("status unknown\n");
+               ret = -1;
+               break;
+       }
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/check.h b/ceph/src/pmdk/src/tools/pmempool/check.h
new file mode 100644 (file)
index 0000000..93bd2a8
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * check.h -- pmempool check command header file
+ */
+
+int pmempool_check_func(const char *appname, int argc, char *argv[]);
+void pmempool_check_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/common.c b/ceph/src/pmdk/src/tools/pmempool/common.c
new file mode 100644 (file)
index 0000000..6d5bf2d
--- /dev/null
@@ -0,0 +1,1382 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * common.c -- definitions of common functions
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <string.h>
+#include <err.h>
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <ctype.h>
+#include <assert.h>
+#include <getopt.h>
+#include <unistd.h>
+#include <endian.h>
+
+#include "common.h"
+
+#include "output.h"
+#include "libpmem.h"
+#include "libpmemblk.h"
+#include "libpmemlog.h"
+#include "libpmemobj.h"
+#include "btt.h"
+#include "file.h"
+#include "os.h"
+#include "set.h"
+#include "out.h"
+#include "mmap.h"
+#include "util_pmem.h"
+#include "set_badblocks.h"
+#include "util.h"
+
+#define REQ_BUFF_SIZE  2048U
+#define Q_BUFF_SIZE    8192
+typedef const char *(*enum_to_str_fn)(int);
+
+/*
+ * pmem_pool_type -- return pool type based on first two pages.
+ * If pool header's content suggests that pool may be BTT device
+ * (first page zeroed and no correct signature for pool header),
+ * signature from second page is checked to prove that it's BTT device layout.
+ */
+pmem_pool_type_t
+pmem_pool_type(const void *base_pool_addr)
+{
+       struct pool_hdr *hdrp = (struct pool_hdr *)base_pool_addr;
+
+       if (util_is_zeroed(hdrp, DEFAULT_HDR_SIZE)) {
+               return util_get_pool_type_second_page(base_pool_addr);
+       }
+
+       pmem_pool_type_t type = pmem_pool_type_parse_hdr(hdrp);
+       if (type != PMEM_POOL_TYPE_UNKNOWN)
+               return type;
+       else
+               return util_get_pool_type_second_page(base_pool_addr);
+}
+
+/*
+ * pmem_pool_checksum -- return true if checksum is correct
+ * based on first two pages
+ */
+int
+pmem_pool_checksum(const void *base_pool_addr)
+{
+       /* check whether it's btt device -> first page zeroed */
+       if (util_is_zeroed(base_pool_addr, DEFAULT_HDR_SIZE)) {
+               struct btt_info bttinfo;
+               void *sec_page_addr = (char *)base_pool_addr + DEFAULT_HDR_SIZE;
+               memcpy(&bttinfo, sec_page_addr, sizeof(bttinfo));
+               btt_info_convert2h(&bttinfo);
+               return util_checksum(&bttinfo, sizeof(bttinfo),
+                       &bttinfo.checksum, 0, 0);
+       } else {
+               /* it's not btt device - first page contains header */
+               struct pool_hdr hdrp;
+               memcpy(&hdrp, base_pool_addr, sizeof(hdrp));
+               return util_checksum(&hdrp, sizeof(hdrp),
+                       &hdrp.checksum, 0, POOL_HDR_CSUM_END_OFF(&hdrp));
+       }
+}
+
+/*
+ * pmem_pool_type_parse_hdr -- return pool type based only on signature
+ */
+pmem_pool_type_t
+pmem_pool_type_parse_hdr(const struct pool_hdr *hdrp)
+{
+       if (memcmp(hdrp->signature, LOG_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return PMEM_POOL_TYPE_LOG;
+       else if (memcmp(hdrp->signature, BLK_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return PMEM_POOL_TYPE_BLK;
+       else if (memcmp(hdrp->signature, OBJ_HDR_SIG, POOL_HDR_SIG_LEN) == 0)
+               return PMEM_POOL_TYPE_OBJ;
+       else
+               return PMEM_POOL_TYPE_UNKNOWN;
+}
+
+/*
+ * pmem_pool_type_parse_str -- returns pool type from command line arg
+ */
+pmem_pool_type_t
+pmem_pool_type_parse_str(const char *str)
+{
+       if (strcmp(str, "blk") == 0) {
+               return PMEM_POOL_TYPE_BLK;
+       } else if (strcmp(str, "log") == 0) {
+               return PMEM_POOL_TYPE_LOG;
+       } else if (strcmp(str, "obj") == 0) {
+               return PMEM_POOL_TYPE_OBJ;
+       } else if (strcmp(str, "btt") == 0) {
+               return PMEM_POOL_TYPE_BTT;
+       } else {
+               return PMEM_POOL_TYPE_UNKNOWN;
+       }
+}
+
+/*
+ * util_get_pool_type_second_page -- return type based on second page content
+ */
+pmem_pool_type_t
+util_get_pool_type_second_page(const void *pool_base_addr)
+{
+       struct btt_info bttinfo;
+
+       void *sec_page_addr = (char *)pool_base_addr + DEFAULT_HDR_SIZE;
+       memcpy(&bttinfo, sec_page_addr, sizeof(bttinfo));
+       btt_info_convert2h(&bttinfo);
+
+       if (util_is_zeroed(&bttinfo, sizeof(bttinfo)))
+               return PMEM_POOL_TYPE_UNKNOWN;
+
+       if (memcmp(bttinfo.sig, BTTINFO_SIG, BTTINFO_SIG_LEN) == 0)
+               return PMEM_POOL_TYPE_BTT;
+
+       return PMEM_POOL_TYPE_UNKNOWN;
+}
+
+/*
+ * util_parse_mode -- parse file mode from octal string
+ */
+int
+util_parse_mode(const char *str, mode_t *mode)
+{
+       mode_t m = 0;
+       int digits = 0;
+
+       /* skip leading zeros */
+       while (*str == '0')
+               str++;
+
+       /* parse at most 3 octal digits */
+       while (digits < 3 && *str != '\0') {
+               if (*str < '0' || *str > '7')
+                       return -1;
+               m = (mode_t)(m << 3) | (mode_t)(*str - '0');
+               digits++;
+               str++;
+       }
+
+       /* more than 3 octal digits */
+       if (digits == 3 && *str != '\0')
+               return -1;
+
+       if (mode)
+               *mode = m;
+
+       return 0;
+}
+
+static void
+util_range_limit(struct range *rangep, struct range limit)
+{
+       if (rangep->first < limit.first)
+               rangep->first = limit.first;
+       if (rangep->last > limit.last)
+               rangep->last = limit.last;
+}
+
+/*
+ * util_parse_range_from -- parse range string as interval from specified number
+ */
+static int
+util_parse_range_from(char *str, struct range *rangep, struct range entire)
+{
+       size_t str_len = strlen(str);
+       if (str[str_len - 1] != '-')
+               return -1;
+
+       str[str_len - 1] = '\0';
+
+       if (util_parse_size(str, (size_t *)&rangep->first))
+               return -1;
+
+       rangep->last = entire.last;
+       util_range_limit(rangep, entire);
+
+       return 0;
+}
+
+/*
+ * util_parse_range_to -- parse range string as interval to specified number
+ */
+static int
+util_parse_range_to(char *str, struct range *rangep, struct range entire)
+{
+
+       if (str[0] != '-' || str[1] == '\0')
+               return -1;
+
+       if (util_parse_size(str + 1, (size_t *)&rangep->last))
+               return -1;
+
+       rangep->first = entire.first;
+       util_range_limit(rangep, entire);
+
+       return 0;
+}
+
+/*
+ * util_parse_range_number -- parse range string as a single number
+ */
+static int
+util_parse_range_number(char *str, struct range *rangep, struct range entire)
+{
+       if (util_parse_size(str, (size_t *)&rangep->first) != 0)
+               return -1;
+       rangep->last = rangep->first;
+       if (rangep->first > entire.last ||
+           rangep->last < entire.first)
+               return -1;
+       util_range_limit(rangep, entire);
+       return 0;
+}
+
+/*
+ * util_parse_range -- parse single range string
+ */
+static int
+util_parse_range(char *str, struct range *rangep, struct range entire)
+{
+       char *dash = strchr(str, '-');
+       if (!dash)
+               return util_parse_range_number(str, rangep, entire);
+
+       /* '-' at the beginning */
+       if (dash == str)
+               return util_parse_range_to(str, rangep, entire);
+
+       /* '-' at the end */
+       if (dash[1] == '\0')
+               return util_parse_range_from(str, rangep, entire);
+
+       *dash = '\0';
+       dash++;
+
+       if (util_parse_size(str, (size_t *)&rangep->first))
+               return -1;
+
+       if (util_parse_size(dash, (size_t *)&rangep->last))
+               return -1;
+
+       if (rangep->first > rangep->last) {
+               uint64_t tmp = rangep->first;
+               rangep->first = rangep->last;
+               rangep->last = tmp;
+       }
+
+       util_range_limit(rangep, entire);
+
+       return 0;
+}
+
+/*
+ * util_ranges_overlap -- return 1 if two ranges are overlapped
+ */
+static int
+util_ranges_overlap(struct range *rangep1, struct range *rangep2)
+{
+       if (rangep1->last + 1 < rangep2->first ||
+           rangep2->last + 1 < rangep1->first)
+               return 0;
+       else
+               return 1;
+}
+
+/*
+ * util_ranges_add -- create and add range
+ */
+int
+util_ranges_add(struct ranges *rangesp, struct range range)
+{
+       struct range *rangep = malloc(sizeof(struct range));
+       if (!rangep)
+               err(1, "Cannot allocate memory for range\n");
+       memcpy(rangep, &range, sizeof(*rangep));
+
+       struct range *curp, *next;
+       uint64_t first = rangep->first;
+       uint64_t last = rangep->last;
+
+       curp = PMDK_LIST_FIRST(&rangesp->head);
+       while (curp) {
+               next = PMDK_LIST_NEXT(curp, next);
+               if (util_ranges_overlap(curp, rangep)) {
+                       PMDK_LIST_REMOVE(curp, next);
+                       if (curp->first < first)
+                               first = curp->first;
+                       if (curp->last > last)
+                               last = curp->last;
+                       free(curp);
+               }
+               curp = next;
+       }
+
+       rangep->first = first;
+       rangep->last = last;
+
+       PMDK_LIST_FOREACH(curp, &rangesp->head, next) {
+               if (curp->first < rangep->first) {
+                       PMDK_LIST_INSERT_AFTER(curp, rangep, next);
+                       return 0;
+               }
+       }
+
+       PMDK_LIST_INSERT_HEAD(&rangesp->head, rangep, next);
+
+       return 0;
+}
+
+/*
+ * util_ranges_contain -- return 1 if ranges contain the number n
+ */
+int
+util_ranges_contain(const struct ranges *rangesp, uint64_t n)
+{
+       struct range *curp  = NULL;
+       PMDK_LIST_FOREACH(curp, &rangesp->head, next) {
+               if (curp->first <= n && n <= curp->last)
+                       return 1;
+       }
+
+       return 0;
+}
+
+/*
+ * util_ranges_empty -- return 1 if ranges are empty
+ */
+int
+util_ranges_empty(const struct ranges *rangesp)
+{
+       return PMDK_LIST_EMPTY(&rangesp->head);
+}
+
+/*
+ * util_ranges_clear -- clear list of ranges
+ */
+void
+util_ranges_clear(struct ranges *rangesp)
+{
+       while (!PMDK_LIST_EMPTY(&rangesp->head)) {
+               struct range *rangep = PMDK_LIST_FIRST(&rangesp->head);
+               PMDK_LIST_REMOVE(rangep, next);
+               free(rangep);
+       }
+}
+
+/*
+ * util_parse_ranges -- parser ranges from string
+ *
+ * The valid formats of range are:
+ * - 'n-m' -- from n to m
+ * - '-m'  -- from minimum passed in entirep->first to m
+ * - 'n-'  -- from n to maximum passed in entirep->last
+ * - 'n'   -- n'th byte/block
+ * Multiple ranges may be separated by comma:
+ * 'n1-m1,n2-,-m3,n4'
+ */
+int
+util_parse_ranges(const char *ptr, struct ranges *rangesp, struct range entire)
+{
+       if (ptr == NULL)
+               return util_ranges_add(rangesp, entire);
+
+       char *dup = strdup(ptr);
+       if (!dup)
+               err(1, "Cannot allocate memory for ranges");
+       char *str = dup;
+       int ret = 0;
+       char *next = str;
+       do {
+               str = next;
+               next = strchr(str, ',');
+               if (next != NULL) {
+                       *next = '\0';
+                       next++;
+               }
+               struct range range;
+               if (util_parse_range(str, &range, entire)) {
+                       ret = -1;
+                       goto out;
+               } else if (util_ranges_add(rangesp, range)) {
+                       ret = -1;
+                       goto out;
+               }
+       } while (next != NULL);
+out:
+       free(dup);
+       return ret;
+}
+
+/*
+ * pmem_pool_get_min_size -- return minimum size of pool for specified type
+ */
+uint64_t
+pmem_pool_get_min_size(pmem_pool_type_t type)
+{
+       switch (type) {
+       case PMEM_POOL_TYPE_LOG:
+               return PMEMLOG_MIN_POOL;
+       case PMEM_POOL_TYPE_BLK:
+               return PMEMBLK_MIN_POOL;
+       case PMEM_POOL_TYPE_OBJ:
+               return PMEMOBJ_MIN_POOL;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+/*
+ * util_poolset_map -- map poolset
+ */
+int
+util_poolset_map(const char *fname, struct pool_set **poolset, int rdonly)
+{
+       if (util_is_poolset_file(fname) != 1) {
+               int ret = util_poolset_create_set(poolset, fname, 0, 0, true);
+               if (ret < 0) {
+                       outv_err("cannot open pool set -- '%s'", fname);
+                       return -1;
+               }
+               unsigned flags = (rdonly ? POOL_OPEN_COW : 0) |
+                                       POOL_OPEN_IGNORE_BAD_BLOCKS;
+               return util_pool_open_nocheck(*poolset, flags);
+       }
+
+       /* open poolset file */
+       int fd = util_file_open(fname, NULL, 0, O_RDONLY);
+       if (fd < 0)
+               return -1;
+
+       struct pool_set *set;
+
+       /* parse poolset file */
+       if (util_poolset_parse(&set, fname, fd)) {
+               outv_err("parsing poolset file failed\n");
+               os_close(fd);
+               return -1;
+       }
+       set->ignore_sds = true;
+       os_close(fd);
+
+       /* read the pool header from first pool set file */
+       const char *part0_path = PART(REP(set, 0), 0)->path;
+       struct pool_hdr hdr;
+       if (util_file_pread(part0_path, &hdr, sizeof(hdr), 0) !=
+                       sizeof(hdr)) {
+               outv_err("cannot read pool header from poolset\n");
+               goto err_pool_set;
+       }
+
+       util_poolset_free(set);
+
+       util_convert2h_hdr_nocheck(&hdr);
+
+       /* parse pool type from first pool set file */
+       pmem_pool_type_t type = pmem_pool_type_parse_hdr(&hdr);
+       if (type == PMEM_POOL_TYPE_UNKNOWN) {
+               outv_err("cannot determine pool type from poolset\n");
+               return -1;
+       }
+
+       /*
+        * Just use one thread - there is no need for multi-threaded access
+        * to remote pool.
+        */
+       unsigned nlanes = 1;
+
+       /*
+        * Open the poolset, the values passed to util_pool_open are read
+        * from the first poolset file, these values are then compared with
+        * the values from all headers of poolset files.
+        */
+       struct pool_attr attr;
+       util_pool_hdr2attr(&attr, &hdr);
+       unsigned flags = (rdonly ? POOL_OPEN_COW : 0) | POOL_OPEN_IGNORE_SDS |
+                               POOL_OPEN_IGNORE_BAD_BLOCKS;
+       if (util_pool_open(poolset, fname, 0 /* minpartsize */,
+                       &attr, &nlanes, NULL, flags)) {
+               outv_err("opening poolset failed\n");
+               return -1;
+       }
+
+       return 0;
+
+err_pool_set:
+       util_poolset_free(set);
+       return -1;
+}
+
+/*
+ * pmem_pool_parse_params -- parse pool type, file size and block size
+ */
+int
+pmem_pool_parse_params(const char *fname, struct pmem_pool_params *paramsp,
+               int check)
+{
+       paramsp->type = PMEM_POOL_TYPE_UNKNOWN;
+       char pool_str_addr[POOL_HDR_DESC_SIZE];
+
+       enum file_type type = util_file_get_type(fname);
+       if (type < 0)
+               return -1;
+
+       int is_poolset = util_is_poolset_file(fname);
+       if (is_poolset < 0)
+               return -1;
+
+       paramsp->is_poolset = is_poolset;
+       int fd = util_file_open(fname, NULL, 0, O_RDONLY);
+       if (fd < 0)
+               return -1;
+
+       /* get file size and mode */
+       os_stat_t stat_buf;
+       if (os_fstat(fd, &stat_buf)) {
+               os_close(fd);
+               return -1;
+       }
+
+       int ret = 0;
+
+       assert(stat_buf.st_size >= 0);
+       paramsp->size = (uint64_t)stat_buf.st_size;
+       paramsp->mode = stat_buf.st_mode;
+
+       void *addr = NULL;
+       struct pool_set *set = NULL;
+       if (paramsp->is_poolset) {
+               /* close the file */
+               os_close(fd);
+               fd = -1;
+
+               if (check) {
+                       if (util_poolset_map(fname, &set, 0)) {
+                               ret = -1;
+                               goto out_close;
+                       }
+               } else {
+                       ret = util_poolset_create_set(&set, fname, 0, 0, true);
+                       if (ret < 0) {
+                               outv_err("cannot open pool set -- '%s'", fname);
+                               ret = -1;
+                               goto out_close;
+                       }
+                       if (util_pool_open_nocheck(set,
+                                               POOL_OPEN_IGNORE_BAD_BLOCKS)) {
+                               ret = -1;
+                               goto out_close;
+                       }
+               }
+
+               paramsp->size = set->poolsize;
+               addr = set->replica[0]->part[0].addr;
+
+               /*
+                * XXX mprotect for device dax with length not aligned to its
+                * page granularity causes SIGBUS on the next page fault.
+                * The length argument of this call should be changed to
+                * set->poolsize once the kernel issue is solved.
+                */
+               if (mprotect(addr, set->replica[0]->repsize,
+                       PROT_READ) < 0) {
+                       outv_err("!mprotect");
+                       goto out_close;
+               }
+       } else {
+               /* read first two pages */
+               if (type == TYPE_DEVDAX) {
+                       addr = util_file_map_whole(fname);
+                       if (addr == NULL) {
+                               ret = -1;
+                               goto out_close;
+                       }
+               } else {
+                       ssize_t num = read(fd, pool_str_addr,
+                                       POOL_HDR_DESC_SIZE);
+                       if (num < (ssize_t)POOL_HDR_DESC_SIZE) {
+                               outv_err("!read");
+                               ret = -1;
+                               goto out_close;
+                       }
+                       addr = pool_str_addr;
+               }
+       }
+
+       struct pool_hdr hdr;
+       memcpy(&hdr, addr, sizeof(hdr));
+
+       util_convert2h_hdr_nocheck(&hdr);
+
+       memcpy(paramsp->signature, hdr.signature, sizeof(paramsp->signature));
+
+       /*
+        * Check if file is a part of pool set by comparing
+        * the UUID with the next part UUID. If it is the same
+        * it means the pool consist of a single file.
+        */
+       paramsp->is_part = !paramsp->is_poolset &&
+               (memcmp(hdr.uuid, hdr.next_part_uuid, POOL_HDR_UUID_LEN) ||
+               memcmp(hdr.uuid, hdr.prev_part_uuid, POOL_HDR_UUID_LEN) ||
+               memcmp(hdr.uuid, hdr.next_repl_uuid, POOL_HDR_UUID_LEN) ||
+               memcmp(hdr.uuid, hdr.prev_repl_uuid, POOL_HDR_UUID_LEN));
+
+       if (check)
+               paramsp->type = pmem_pool_type(addr);
+       else
+               paramsp->type = pmem_pool_type_parse_hdr(addr);
+
+       paramsp->is_checksum_ok = pmem_pool_checksum(addr);
+
+       if (paramsp->type == PMEM_POOL_TYPE_BLK) {
+               struct pmemblk *pbp = addr;
+               paramsp->blk.bsize = le32toh(pbp->bsize);
+       } else if (paramsp->type == PMEM_POOL_TYPE_OBJ) {
+               struct pmemobjpool *pop = addr;
+               memcpy(paramsp->obj.layout, pop->layout, PMEMOBJ_MAX_LAYOUT);
+       }
+
+       if (paramsp->is_poolset)
+               util_poolset_close(set, DO_NOT_DELETE_PARTS);
+
+out_close:
+       if (fd >= 0)
+               (void) os_close(fd);
+       return ret;
+}
+
+/*
+ * util_check_memory -- check if memory contains single value
+ */
+int
+util_check_memory(const uint8_t *buff, size_t len, uint8_t val)
+{
+       size_t i;
+       for (i = 0; i < len; i++) {
+               if (buff[i] != val)
+                       return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_ask_yes_no -- prints the question,
+ * takes user answer and returns validated value
+ */
+static char
+pmempool_ask_yes_no(char def_ans, const char *answers, const char *qbuff)
+{
+       char ret = INV_ANS;
+       printf("%s", qbuff);
+       size_t len = strlen(answers);
+       size_t i;
+
+       char def_anslo = (char)tolower(def_ans);
+       printf(" [");
+       for (i = 0; i < len; i++) {
+               char anslo = (char)tolower(answers[i]);
+               printf("%c", anslo == def_anslo ?
+                               toupper(anslo) : anslo);
+               if (i != len - 1)
+                       printf("/");
+       }
+       printf("] ");
+
+       char *line_of_answer = util_readline(stdin);
+
+       if (line_of_answer == NULL) {
+               outv_err("input is empty");
+               return '?';
+       }
+
+       char first_letter = line_of_answer[0];
+       line_of_answer[0] = (char)tolower(first_letter);
+
+       if (strcmp(line_of_answer, "yes\n") == 0) {
+               if (strchr(answers, 'y') != NULL)
+                       ret = 'y';
+       }
+
+       if (strcmp(line_of_answer, "no\n") == 0) {
+               if (strchr(answers, 'n') != NULL)
+                       ret = 'n';
+       }
+
+       if (strlen(line_of_answer) == 2 &&
+                       line_of_answer[1] == '\n') {
+               if (strchr(answers, line_of_answer[0]) != NULL)
+                       ret = line_of_answer[0];
+       }
+
+       if (strlen(line_of_answer) == 1 &&
+                       line_of_answer[0] == '\n') {
+               ret = def_ans;
+       }
+
+       Free(line_of_answer);
+       return ret;
+}
+
+/*
+ * ask -- keep asking for answer until it gets valid input
+ */
+char
+ask(char op, char *answers, char def_ans, const char *fmt, va_list ap)
+{
+       char qbuff[Q_BUFF_SIZE];
+       char ret = INV_ANS;
+       int is_tty = 0;
+       if (op != '?')
+               return op;
+
+       int p = vsnprintf(qbuff, Q_BUFF_SIZE, fmt, ap);
+       if (p < 0) {
+               outv_err("vsnprintf");
+               exit(EXIT_FAILURE);
+       }
+       if (p >= Q_BUFF_SIZE) {
+               outv_err("vsnprintf: output was truncated");
+               exit(EXIT_FAILURE);
+       }
+
+       is_tty = isatty(fileno(stdin));
+
+       while ((ret = pmempool_ask_yes_no(def_ans, answers, qbuff)) == INV_ANS)
+               ;
+
+       if (!is_tty)
+               printf("%c\n", ret);
+
+       return ret;
+}
+
+char
+ask_Yn(char op, const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       char ret = ask(op, "yn", 'y', fmt, ap);
+       va_end(ap);
+       return ret;
+}
+
+char
+ask_yN(char op, const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       char ret = ask(op, "yn", 'n', fmt, ap);
+       va_end(ap);
+       return ret;
+}
+
+/*
+ * util_parse_enum -- parse single enum and store to bitmap
+ */
+static int
+util_parse_enum(const char *str, int first, int max, uint64_t *bitmap,
+               enum_to_str_fn enum_to_str)
+{
+       for (int i = first; i < max; i++) {
+               if (strcmp(str, enum_to_str(i)) == 0) {
+                       *bitmap |= (uint64_t)1<<i;
+                       return 0;
+               }
+       }
+
+       return -1;
+}
+
+/*
+ * util_parse_enums -- parse enums and store to bitmap
+ */
+static int
+util_parse_enums(const char *str, int first, int max, uint64_t *bitmap,
+               enum_to_str_fn enum_to_str)
+{
+       char *dup = strdup(str);
+       if (!dup)
+               err(1, "Cannot allocate memory for enum str");
+
+       char *ptr = dup;
+       int ret = 0;
+       char *comma;
+       do {
+               comma = strchr(ptr, ',');
+               if (comma) {
+                       *comma = '\0';
+                       comma++;
+               }
+
+               if ((ret = util_parse_enum(ptr, first, max,
+                               bitmap, enum_to_str))) {
+                       goto out;
+               }
+
+               ptr = comma;
+       } while (ptr);
+out:
+       free(dup);
+       return ret;
+}
+
+/*
+ * util_parse_chunk_types -- parse chunk types strings
+ */
+int
+util_parse_chunk_types(const char *str, uint64_t *types)
+{
+       assert(MAX_CHUNK_TYPE < 8 * sizeof(*types));
+       return util_parse_enums(str, 0, MAX_CHUNK_TYPE, types,
+                       (enum_to_str_fn)out_get_chunk_type_str);
+}
+
+/*
+ * util_options_alloc -- allocate and initialize options structure
+ */
+struct options *
+util_options_alloc(const struct option *options,
+               size_t nopts, const struct option_requirement *req)
+{
+       struct options *opts = calloc(1, sizeof(*opts));
+       if (!opts)
+               err(1, "Cannot allocate memory for options structure");
+
+       opts->opts = options;
+       opts->noptions = nopts;
+       opts->req = req;
+       size_t bitmap_size = howmany(nopts, 8);
+       opts->bitmap = calloc(bitmap_size, 1);
+       if (!opts->bitmap)
+               err(1, "Cannot allocate memory for options bitmap");
+
+       return opts;
+}
+
+/*
+ * util_options_free -- free options structure
+ */
+void
+util_options_free(struct options *opts)
+{
+       free(opts->bitmap);
+       free(opts);
+}
+
+/*
+ * util_opt_get_index -- return index of specified option in global
+ * array of options
+ */
+static int
+util_opt_get_index(const struct options *opts, int opt)
+{
+       const struct option *lopt = &opts->opts[0];
+       int ret = 0;
+       while (lopt->name) {
+               if ((lopt->val & ~OPT_MASK) == opt)
+                       return ret;
+               lopt++;
+               ret++;
+       }
+       return -1;
+}
+
+/*
+ * util_opt_get_req -- get required option for specified option
+ */
+static struct option_requirement *
+util_opt_get_req(const struct options *opts, int opt, pmem_pool_type_t type)
+{
+       size_t n = 0;
+       struct option_requirement *ret = NULL;
+       struct option_requirement *tmp = NULL;
+       const struct option_requirement *req = &opts->req[0];
+       while (req->opt) {
+               if (req->opt == opt && (req->type & type)) {
+                       n++;
+                       tmp = realloc(ret, n * sizeof(*ret));
+                       if (!tmp)
+                               err(1, "Cannot allocate memory for"
+                                       " option requirements");
+                       ret = tmp;
+                       ret[n - 1] = *req;
+               }
+               req++;
+       }
+
+       if (ret) {
+               tmp = realloc(ret, (n + 1) * sizeof(*ret));
+               if (!tmp)
+                       err(1, "Cannot allocate memory for"
+                               " option requirements");
+               ret = tmp;
+               memset(&ret[n], 0, sizeof(*ret));
+       }
+
+       return ret;
+}
+
+/*
+ * util_opt_check_requirements -- check if requirements has been fulfilled
+ */
+static int
+util_opt_check_requirements(const struct options *opts,
+               const struct option_requirement *req)
+{
+       int count = 0;
+       int set = 0;
+       uint64_t tmp;
+       while ((tmp = req->req) != 0) {
+               while (tmp) {
+                       int req_idx =
+                               util_opt_get_index(opts, tmp & OPT_REQ_MASK);
+
+                       if (req_idx >= 0 && util_isset(opts->bitmap, req_idx)) {
+                               set++;
+                               break;
+                       }
+
+                       tmp >>= OPT_REQ_SHIFT;
+               }
+               req++;
+               count++;
+       }
+
+       return count != set;
+}
+
+/*
+ * util_opt_print_requirements -- print requirements for specified option
+ */
+static void
+util_opt_print_requirements(const struct options *opts,
+               const struct option_requirement *req)
+{
+       char buff[REQ_BUFF_SIZE];
+       unsigned n = 0;
+       uint64_t tmp;
+       const struct option *opt =
+               &opts->opts[util_opt_get_index(opts, req->opt)];
+       int sn;
+
+       sn = util_snprintf(&buff[n], REQ_BUFF_SIZE - n,
+                       "option [-%c|--%s] requires: ", opt->val, opt->name);
+       assert(sn >= 0);
+       if (sn >= 0)
+               n += (unsigned)sn;
+
+       size_t rc = 0;
+       while ((tmp = req->req) != 0) {
+               if (rc != 0) {
+                       sn = util_snprintf(&buff[n], REQ_BUFF_SIZE - n,
+                                       " and ");
+                       assert(sn >= 0);
+                       if (sn >= 0)
+                               n += (unsigned)sn;
+               }
+
+               size_t c = 0;
+               while (tmp) {
+                       sn = util_snprintf(&buff[n], REQ_BUFF_SIZE - n,
+                                       c == 0 ? "[" : "|");
+                       assert(sn >= 0);
+                       if (sn >= 0)
+                               n += (unsigned)sn;
+
+                       int req_opt_ind =
+                               util_opt_get_index(opts, tmp & OPT_REQ_MASK);
+                       const struct option *req_option =
+                               &opts->opts[req_opt_ind];
+
+                       sn = util_snprintf(&buff[n], REQ_BUFF_SIZE - n,
+                               "-%c|--%s", req_option->val, req_option->name);
+                       assert(sn >= 0);
+                       if (sn >= 0)
+                               n += (unsigned)sn;
+
+                       tmp >>= OPT_REQ_SHIFT;
+                       c++;
+               }
+               sn = util_snprintf(&buff[n], REQ_BUFF_SIZE - n, "]");
+               assert(sn >= 0);
+               if (sn >= 0)
+                       n += (unsigned)sn;
+
+               req++;
+               rc++;
+       }
+
+       outv_err("%s\n", buff);
+}
+
+/*
+ * util_opt_verify_requirements -- verify specified requirements for options
+ */
+static int
+util_opt_verify_requirements(const struct options *opts, size_t index,
+               pmem_pool_type_t type)
+{
+       const struct option *opt = &opts->opts[index];
+       int val = opt->val & ~OPT_MASK;
+       struct option_requirement *req;
+
+       if ((req = util_opt_get_req(opts, val, type)) == NULL)
+               return 0;
+
+       int ret = 0;
+
+       if (util_opt_check_requirements(opts, req)) {
+               ret = -1;
+               util_opt_print_requirements(opts, req);
+       }
+
+       free(req);
+       return ret;
+}
+
+/*
+ * util_opt_verify_type -- check if used option matches pool type
+ */
+static int
+util_opt_verify_type(const struct options *opts, pmem_pool_type_t type,
+               size_t index)
+{
+       const struct option *opt = &opts->opts[index];
+       int val = opt->val & ~OPT_MASK;
+       int opt_type = opt->val;
+       opt_type >>= OPT_SHIFT;
+       if (!(opt_type & (1<<type))) {
+               outv_err("'--%s|-%c' -- invalid option specified"
+                       " for pool type '%s'\n",
+                       opt->name, val,
+                       out_get_pool_type_str(type));
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * util_options_getopt -- wrapper for getopt_long which sets bitmap
+ */
+int
+util_options_getopt(int argc, char *argv[], const char *optstr,
+               const struct options *opts)
+{
+       int opt = getopt_long(argc, argv, optstr, opts->opts, NULL);
+       if (opt == -1 || opt == '?')
+               return opt;
+
+       opt &= ~OPT_MASK;
+       int option_index = util_opt_get_index(opts, opt);
+       assert(option_index >= 0);
+
+       util_setbit((uint8_t *)opts->bitmap, (unsigned)option_index);
+
+       return opt;
+}
+
+/*
+ * util_options_verify -- verify options
+ */
+int
+util_options_verify(const struct options *opts, pmem_pool_type_t type)
+{
+       for (size_t i = 0; i < opts->noptions; i++) {
+               if (util_isset(opts->bitmap, i)) {
+                       if (util_opt_verify_type(opts, type, i))
+                               return -1;
+
+                       if (opts->req)
+                               if (util_opt_verify_requirements(opts, i, type))
+                                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * util_heap_max_zone -- get number of zones
+ */
+unsigned
+util_heap_max_zone(size_t size)
+{
+       unsigned max_zone = 0;
+       size -= sizeof(struct heap_header);
+
+       while (size >= ZONE_MIN_SIZE) {
+               max_zone++;
+               size -= size <= ZONE_MAX_SIZE ? size : ZONE_MAX_SIZE;
+       }
+
+       return max_zone;
+}
+
+/*
+ * pool_set_file_open -- opens pool set file or regular file
+ */
+struct pool_set_file *
+pool_set_file_open(const char *fname,
+               int rdonly, int check)
+{
+       struct pool_set_file *file = calloc(1, sizeof(*file));
+       if (!file)
+               return NULL;
+
+       file->replica = 0;
+       file->fname = strdup(fname);
+       if (!file->fname)
+               goto err;
+
+       os_stat_t buf;
+       if (os_stat(fname, &buf)) {
+               warn("%s", fname);
+               goto err_free_fname;
+       }
+
+       file->mtime = buf.st_mtime;
+       file->mode = buf.st_mode;
+       if (S_ISBLK(file->mode))
+               file->fileio = true;
+
+       if (file->fileio) {
+               /* Simple file open for BTT device */
+               int fd = util_file_open(fname, NULL, 0, O_RDONLY);
+               if (fd < 0) {
+                       outv_err("util_file_open failed\n");
+                       goto err_free_fname;
+               }
+
+               os_off_t seek_size = os_lseek(fd, 0, SEEK_END);
+               if (seek_size == -1) {
+                       outv_err("lseek SEEK_END failed\n");
+                       os_close(fd);
+                       goto err_free_fname;
+               }
+
+               file->size = (size_t)seek_size;
+               file->fd = fd;
+       } else {
+               /*
+                * The check flag indicates whether the headers from each pool
+                * set file part should be checked for valid values.
+                */
+               if (check) {
+                       if (util_poolset_map(file->fname,
+                                       &file->poolset, rdonly))
+                               goto err_free_fname;
+               } else {
+                       int ret = util_poolset_create_set(&file->poolset,
+                               file->fname, 0, 0, true);
+
+                       if (ret < 0) {
+                               outv_err("cannot open pool set -- '%s'",
+                                       file->fname);
+                               goto err_free_fname;
+                       }
+                       unsigned flags = (rdonly ? POOL_OPEN_COW : 0) |
+                                               POOL_OPEN_IGNORE_BAD_BLOCKS;
+                       if (util_pool_open_nocheck(file->poolset, flags))
+                               goto err_free_fname;
+               }
+
+               /* get modification time from the first part of first replica */
+               const char *path = file->poolset->replica[0]->part[0].path;
+               if (os_stat(path, &buf)) {
+                       warn("%s", path);
+                       goto err_close_poolset;
+               }
+               file->size = file->poolset->poolsize;
+               file->addr = file->poolset->replica[0]->part[0].addr;
+       }
+       return file;
+
+err_close_poolset:
+       util_poolset_close(file->poolset, DO_NOT_DELETE_PARTS);
+err_free_fname:
+       free(file->fname);
+err:
+       free(file);
+       return NULL;
+}
+
+/*
+ * pool_set_file_close -- closes pool set file or regular file
+ */
+void
+pool_set_file_close(struct pool_set_file *file)
+{
+       if (!file->fileio) {
+               if (file->poolset)
+                       util_poolset_close(file->poolset, DO_NOT_DELETE_PARTS);
+               else if (file->addr) {
+                       munmap(file->addr, file->size);
+                       os_close(file->fd);
+               }
+       }
+       free(file->fname);
+       free(file);
+}
+
+/*
+ * pool_set_file_read -- read from pool set file or regular file
+ *
+ * 'buff' has to be a buffer at least 'nbytes' long
+ * 'off' is an offset from the beginning of the file
+ */
+int
+pool_set_file_read(struct pool_set_file *file, void *buff,
+               size_t nbytes, uint64_t off)
+{
+       if (off + nbytes > file->size)
+               return -1;
+
+       if (file->fileio) {
+               ssize_t num = pread(file->fd, buff, nbytes, (os_off_t)off);
+               if (num < (ssize_t)nbytes)
+                       return -1;
+       } else {
+               memcpy(buff, (char *)file->addr + off, nbytes);
+       }
+       return 0;
+}
+
+/*
+ * pool_set_file_write -- write to pool set file or regular file
+ *
+ * 'buff' has to be a buffer at least 'nbytes' long
+ * 'off' is an offset from the beginning of the file
+ */
+int
+pool_set_file_write(struct pool_set_file *file, void *buff,
+               size_t nbytes, uint64_t off)
+{
+       enum file_type type = util_file_get_type(file->fname);
+       if (type < 0)
+               return -1;
+
+       if (off + nbytes > file->size)
+               return -1;
+
+       if (file->fileio) {
+               ssize_t num = pwrite(file->fd, buff, nbytes, (os_off_t)off);
+               if (num < (ssize_t)nbytes)
+                       return -1;
+       } else {
+               memcpy((char *)file->addr + off, buff, nbytes);
+               util_persist_auto(type == TYPE_DEVDAX, (char *)file->addr + off,
+                                       nbytes);
+       }
+       return 0;
+}
+
+/*
+ * pool_set_file_set_replica -- change replica for pool set file
+ */
+int
+pool_set_file_set_replica(struct pool_set_file *file, size_t replica)
+{
+       if (!replica)
+               return 0;
+
+       if (!file->poolset)
+               return -1;
+
+       if (replica >= file->poolset->nreplicas)
+               return -1;
+
+       if (file->poolset->replica[replica]->remote) {
+               outv_err("reading from remote replica not supported");
+               return -1;
+       }
+
+       file->replica = replica;
+       file->addr = file->poolset->replica[replica]->part[0].addr;
+
+       return 0;
+}
+
+/*
+ * pool_set_file_nreplicas -- return number of replicas
+ */
+size_t
+pool_set_file_nreplicas(struct pool_set_file *file)
+{
+       return file->poolset->nreplicas;
+}
+
+/*
+ * pool_set_file_map -- return mapped address at given offset
+ */
+void *
+pool_set_file_map(struct pool_set_file *file, uint64_t offset)
+{
+       if (file->addr == MAP_FAILED)
+               return NULL;
+       return (char *)file->addr + offset;
+}
+
+/*
+ * pool_set_file_persist -- propagates and persists changes to a memory range
+ *
+ * 'addr' points to the beginning of data in the master replica that has to be
+ *        propagated
+ * 'len' is the number of bytes to be propagated to other replicas
+ */
+void
+pool_set_file_persist(struct pool_set_file *file, const void *addr, size_t len)
+{
+       uintptr_t offset = (uintptr_t)((char *)addr -
+               (char *)file->poolset->replica[0]->part[0].addr);
+
+       for (unsigned r = 1; r < file->poolset->nreplicas; ++r) {
+               struct pool_replica *rep = file->poolset->replica[r];
+               void *dst = (char *)rep->part[0].addr + offset;
+               memcpy(dst, addr, len);
+               util_persist(rep->is_pmem, dst, len);
+       }
+       struct pool_replica *rep = file->poolset->replica[0];
+       util_persist(rep->is_pmem, (void *)addr, len);
+}
+
+/*
+ * util_pool_clear_badblocks -- clear badblocks in a pool (set or a single file)
+ */
+int
+util_pool_clear_badblocks(const char *path, int create)
+{
+       LOG(3, "path %s create %i", path, create);
+
+       struct pool_set *setp;
+
+       /* do not check minsize */
+       int ret = util_poolset_create_set(&setp, path, 0, 0,
+                                               POOL_OPEN_IGNORE_SDS);
+       if (ret < 0) {
+               LOG(2, "cannot open pool set -- '%s'", path);
+               return -1;
+       }
+
+       if (badblocks_clear_poolset(setp, create)) {
+               outv_err("clearing bad blocks in the pool set failed -- '%s'",
+                       path);
+               errno = EIO;
+               return -1;
+       }
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/common.h b/ceph/src/pmdk/src/tools/pmempool/common.h
new file mode 100644 (file)
index 0000000..3c792a5
--- /dev/null
@@ -0,0 +1,203 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * common.h -- declarations of common functions
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdarg.h>
+#include <stdbool.h>
+
+#include "queue.h"
+#include "log.h"
+#include "blk.h"
+#include "libpmemobj.h"
+#include "lane.h"
+#include "ulog.h"
+#include "memops.h"
+#include "pmalloc.h"
+#include "list.h"
+#include "obj.h"
+#include "memblock.h"
+#include "heap_layout.h"
+#include "tx.h"
+#include "heap.h"
+#include "btt_layout.h"
+#include "page_size.h"
+
+/* XXX - modify Linux makefiles to generate srcversion.h and remove #ifdef */
+#ifdef _WIN32
+#include "srcversion.h"
+#endif
+
+#define COUNT_OF(x) (sizeof(x) / sizeof(0[x]))
+
+#define OPT_SHIFT 12
+#define OPT_MASK (~((1 << OPT_SHIFT) - 1))
+#define OPT_LOG (1 << (PMEM_POOL_TYPE_LOG + OPT_SHIFT))
+#define OPT_BLK (1 << (PMEM_POOL_TYPE_BLK + OPT_SHIFT))
+#define OPT_OBJ (1 << (PMEM_POOL_TYPE_OBJ + OPT_SHIFT))
+#define OPT_BTT (1 << (PMEM_POOL_TYPE_BTT + OPT_SHIFT))
+#define OPT_ALL (OPT_LOG | OPT_BLK | OPT_OBJ | OPT_BTT)
+
+#define OPT_REQ_SHIFT  8
+#define OPT_REQ_MASK   ((1 << OPT_REQ_SHIFT) - 1)
+#define _OPT_REQ(c, n) ((c) << (OPT_REQ_SHIFT * (n)))
+#define OPT_REQ0(c) _OPT_REQ(c, 0)
+#define OPT_REQ1(c) _OPT_REQ(c, 1)
+#define OPT_REQ2(c) _OPT_REQ(c, 2)
+#define OPT_REQ3(c) _OPT_REQ(c, 3)
+#define OPT_REQ4(c) _OPT_REQ(c, 4)
+#define OPT_REQ5(c) _OPT_REQ(c, 5)
+#define OPT_REQ6(c) _OPT_REQ(c, 6)
+#define OPT_REQ7(c) _OPT_REQ(c, 7)
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define FOREACH_RANGE(range, ranges)\
+       PMDK_LIST_FOREACH(range, &(ranges)->head, next)
+
+#define PLIST_OFF_TO_PTR(pop, off)\
+((off) == 0 ? NULL : (void *)((uintptr_t)(pop) + (off) - OBJ_OOB_SIZE))
+
+#define ENTRY_TO_ALLOC_HDR(entry)\
+((void *)((uintptr_t)(entry) - sizeof(struct allocation_header)))
+
+#define OBJH_FROM_PTR(ptr)\
+((void *)((uintptr_t)(ptr) - sizeof(struct legacy_object_header)))
+
+#define DEFAULT_HDR_SIZE       PMEM_PAGESIZE
+#define DEFAULT_DESC_SIZE      PMEM_PAGESIZE
+#define POOL_HDR_DESC_SIZE     (DEFAULT_HDR_SIZE + DEFAULT_DESC_SIZE)
+
+#define PTR_TO_ALLOC_HDR(ptr)\
+((void *)((uintptr_t)(ptr) -\
+       sizeof(struct legacy_object_header)))
+
+#define OBJH_TO_PTR(objh)\
+((void *)((uintptr_t)(objh) + sizeof(struct legacy_object_header)))
+
+/* invalid answer for ask_* functions */
+#define INV_ANS        '\0'
+
+#define FORMAT_PRINTF(a, b) __attribute__((__format__(__printf__, (a), (b))))
+
+/*
+ * pmem_pool_type_t -- pool types
+ */
+typedef enum {
+       PMEM_POOL_TYPE_LOG      = 0x01,
+       PMEM_POOL_TYPE_BLK      = 0x02,
+       PMEM_POOL_TYPE_OBJ      = 0x04,
+       PMEM_POOL_TYPE_BTT      = 0x08,
+       PMEM_POOL_TYPE_ALL      = 0x0f,
+       PMEM_POOL_TYPE_UNKNOWN  = 0x80,
+} pmem_pool_type_t;
+
+struct option_requirement {
+       int opt;
+       pmem_pool_type_t type;
+       uint64_t req;
+};
+
+struct options {
+       const struct option *opts;
+       size_t noptions;
+       char *bitmap;
+       const struct option_requirement *req;
+};
+
+struct pmem_pool_params {
+       pmem_pool_type_t type;
+       char signature[POOL_HDR_SIG_LEN];
+       uint64_t size;
+       mode_t mode;
+       int is_poolset;
+       int is_part;
+       int is_checksum_ok;
+       union {
+               struct {
+                       uint64_t bsize;
+               } blk;
+               struct {
+                       char layout[PMEMOBJ_MAX_LAYOUT];
+               } obj;
+       };
+};
+
+struct pool_set_file {
+       int fd;
+       char *fname;
+       void *addr;
+       size_t size;
+       struct pool_set *poolset;
+       size_t replica;
+       time_t mtime;
+       mode_t mode;
+       bool fileio;
+};
+
+struct pool_set_file *pool_set_file_open(const char *fname,
+               int rdonly, int check);
+void pool_set_file_close(struct pool_set_file *file);
+int pool_set_file_read(struct pool_set_file *file, void *buff,
+               size_t nbytes, uint64_t off);
+int pool_set_file_write(struct pool_set_file *file, void *buff,
+               size_t nbytes, uint64_t off);
+int pool_set_file_set_replica(struct pool_set_file *file, size_t replica);
+size_t pool_set_file_nreplicas(struct pool_set_file *file);
+void *pool_set_file_map(struct pool_set_file *file, uint64_t offset);
+void pool_set_file_persist(struct pool_set_file *file,
+               const void *addr, size_t len);
+
+struct range {
+       PMDK_LIST_ENTRY(range) next;
+       uint64_t first;
+       uint64_t last;
+};
+
+struct ranges {
+       PMDK_LIST_HEAD(rangeshead, range) head;
+};
+
+pmem_pool_type_t pmem_pool_type_parse_hdr(const struct pool_hdr *hdrp);
+pmem_pool_type_t pmem_pool_type(const void *base_pool_addr);
+int pmem_pool_checksum(const void *base_pool_addr);
+pmem_pool_type_t pmem_pool_type_parse_str(const char *str);
+uint64_t pmem_pool_get_min_size(pmem_pool_type_t type);
+int pmem_pool_parse_params(const char *fname, struct pmem_pool_params *paramsp,
+               int check);
+int util_poolset_map(const char *fname, struct pool_set **poolset, int rdonly);
+struct options *util_options_alloc(const struct option *options,
+               size_t nopts, const struct option_requirement *req);
+void util_options_free(struct options *opts);
+int util_options_verify(const struct options *opts, pmem_pool_type_t type);
+int util_options_getopt(int argc, char *argv[], const char *optstr,
+               const struct options *opts);
+pmem_pool_type_t util_get_pool_type_second_page(const void *pool_base_addr);
+int util_parse_mode(const char *str, mode_t *mode);
+int util_parse_ranges(const char *str, struct ranges *rangesp,
+               struct range entire);
+int util_ranges_add(struct ranges *rangesp, struct range range);
+void util_ranges_clear(struct ranges *rangesp);
+int util_ranges_contain(const struct ranges *rangesp, uint64_t n);
+int util_ranges_empty(const struct ranges *rangesp);
+int util_check_memory(const uint8_t *buff, size_t len, uint8_t val);
+int util_parse_chunk_types(const char *str, uint64_t *types);
+int util_parse_lane_sections(const char *str, uint64_t *types);
+char ask(char op, char *answers, char def_ans, const char *fmt, va_list ap);
+char ask_Yn(char op, const char *fmt, ...) FORMAT_PRINTF(2, 3);
+char ask_yN(char op, const char *fmt, ...) FORMAT_PRINTF(2, 3);
+unsigned util_heap_max_zone(size_t size);
+
+int util_pool_clear_badblocks(const char *path, int create);
+
+static const struct range ENTIRE_UINT64 = {
+       { NULL, NULL }, /* range */
+       0,              /* first */
+       UINT64_MAX      /* last */
+};
diff --git a/ceph/src/pmdk/src/tools/pmempool/convert.c b/ceph/src/pmdk/src/tools/pmempool/convert.c
new file mode 100644 (file)
index 0000000..db59030
--- /dev/null
@@ -0,0 +1,111 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * convert.c -- pmempool convert command source file
+ */
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "convert.h"
+#include "os.h"
+
+#ifdef _WIN32
+static const char *delimiter = ";";
+static const char *convert_bin = "\\pmdk-convert.exe";
+#else
+static const char *delimiter = ":";
+static const char *convert_bin = "/pmdk-convert";
+#endif // _WIN32
+
+static int
+pmempool_convert_get_path(char *p, size_t max_len)
+{
+       char *path = strdup(os_getenv("PATH"));
+       if (!path) {
+               perror("strdup");
+               return -1;
+       }
+
+       char *dir = strtok(path, delimiter);
+
+       while (dir) {
+               size_t length = strlen(dir) + strlen(convert_bin) + 1;
+               if (length > max_len) {
+                       fprintf(stderr, "very long dir in PATH, ignoring\n");
+                       continue;
+               }
+
+               strcpy(p, dir);
+               strcat(p, convert_bin);
+
+               if (os_access(p, F_OK) == 0) {
+                       free(path);
+                       return 0;
+               }
+
+               dir = strtok(NULL, delimiter);
+       }
+
+       free(path);
+       return -1;
+}
+
+/*
+ * pmempool_convert_help -- print help message for convert command. This is
+ * help message from pmdk-convert tool.
+ */
+void
+pmempool_convert_help(const char *appname)
+{
+       char path[4096];
+       if (pmempool_convert_get_path(path, sizeof(path))) {
+               fprintf(stderr,
+                       "pmdk-convert is not installed. Please install it.\n");
+               exit(1);
+       }
+
+       char *args[] = { path, "-h", NULL };
+
+       os_execv(path, args);
+
+       perror("execv");
+       exit(1);
+}
+
+/*
+ * pmempool_convert_func -- main function for convert command.
+ * It invokes pmdk-convert tool.
+ */
+int
+pmempool_convert_func(const char *appname, int argc, char *argv[])
+{
+       char path[4096];
+       if (pmempool_convert_get_path(path, sizeof(path))) {
+               fprintf(stderr,
+                       "pmdk-convert is not installed. Please install it.\n");
+               exit(1);
+       }
+
+       char **args = malloc(((size_t)argc + 1) * sizeof(*args));
+       if (!args) {
+               perror("malloc");
+               exit(1);
+       }
+
+       args[0] = path;
+       for (int i = 1; i < argc; ++i)
+               args[i] = argv[i];
+       args[argc] = NULL;
+
+       os_execv(args[0], args);
+
+       perror("execv");
+       free(args);
+       exit(1);
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/convert.h b/ceph/src/pmdk/src/tools/pmempool/convert.h
new file mode 100644 (file)
index 0000000..f520603
--- /dev/null
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * convert.h -- pmempool convert command header file
+ */
+
+#include <sys/types.h>
+
+int pmempool_convert_func(const char *appname, int argc, char *argv[]);
+void pmempool_convert_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/create.c b/ceph/src/pmdk/src/tools/pmempool/create.c
new file mode 100644 (file)
index 0000000..30f8f3e
--- /dev/null
@@ -0,0 +1,668 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * create.c -- pmempool create command source file
+ */
+#include <stdio.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <errno.h>
+#include <libgen.h>
+#include <err.h>
+#include "common.h"
+#include "file.h"
+#include "create.h"
+#include "os.h"
+
+#include "set.h"
+#include "output.h"
+#include "libpmemblk.h"
+#include "libpmemlog.h"
+#include "libpmempool.h"
+
+#define DEFAULT_MODE   0664
+/*
+ * pmempool_create -- context and args for create command
+ */
+struct pmempool_create {
+       int verbose;
+       char *fname;
+       int fexists;
+       char *inherit_fname;
+       int max_size;
+       char *str_type;
+       struct pmem_pool_params params;
+       struct pmem_pool_params inherit_params;
+       char *str_size;
+       char *str_mode;
+       char *str_bsize;
+       uint64_t csize;
+       int write_btt_layout;
+       int force;
+       char *layout;
+       struct options *opts;
+       int clearbadblocks;
+};
+
+/*
+ * pmempool_create_default -- default args for create command
+ */
+static const struct pmempool_create pmempool_create_default = {
+       .verbose        = 0,
+       .fname          = NULL,
+       .fexists        = 0,
+       .inherit_fname  = NULL,
+       .max_size       = 0,
+       .str_type       = NULL,
+       .str_bsize      = NULL,
+       .csize          = 0,
+       .write_btt_layout = 0,
+       .force          = 0,
+       .layout         = NULL,
+       .clearbadblocks = 0,
+       .params         = {
+               .type   = PMEM_POOL_TYPE_UNKNOWN,
+               .size   = 0,
+               .mode   = DEFAULT_MODE,
+       }
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Create pmem pool of specified size, type and name\n"
+"\n"
+"Common options:\n"
+"  -s, --size  <size>   size of pool\n"
+"  -M, --max-size       use maximum available space on file system\n"
+"  -m, --mode <octal>   set permissions to <octal> (the default is 0664)\n"
+"  -i, --inherit <file> take required parameters from specified pool file\n"
+"  -b, --clear-bad-blocks clear bad blocks in existing files\n"
+"  -f, --force          remove the pool first\n"
+"  -v, --verbose        increase verbosity level\n"
+"  -h, --help           display this help and exit\n"
+"\n"
+"Options for PMEMBLK:\n"
+"  -w, --write-layout force writing the BTT layout\n"
+"\n"
+"Options for PMEMOBJ:\n"
+"  -l, --layout <name>  layout name stored in pool's header\n"
+"\n"
+"For complete documentation see %s-create(1) manual page.\n"
+;
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"size",        required_argument,      NULL,   's' | OPT_ALL},
+       {"verbose",     no_argument,            NULL,   'v' | OPT_ALL},
+       {"help",        no_argument,            NULL,   'h' | OPT_ALL},
+       {"max-size",    no_argument,            NULL,   'M' | OPT_ALL},
+       {"inherit",     required_argument,      NULL,   'i' | OPT_ALL},
+       {"mode",        required_argument,      NULL,   'm' | OPT_ALL},
+       {"write-layout", no_argument,           NULL,   'w' | OPT_BLK},
+       {"layout",      required_argument,      NULL,   'l' | OPT_OBJ},
+       {"force",       no_argument,            NULL,   'f' | OPT_ALL},
+       {"clear-bad-blocks", no_argument,               NULL,   'b' | OPT_ALL},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * print_usage -- print application usage short description
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s create [<args>] <blk|log|obj> [<bsize>] <file>\n",
+                       appname);
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_create_help -- print help message for create command
+ */
+void
+pmempool_create_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * pmempool_create_obj -- create pmem obj pool
+ */
+static int
+pmempool_create_obj(struct pmempool_create *pcp)
+{
+       PMEMobjpool *pop = pmemobj_create(pcp->fname, pcp->layout,
+                       pcp->params.size, pcp->params.mode);
+       if (!pop) {
+               outv_err("'%s' -- %s\n", pcp->fname, pmemobj_errormsg());
+               return -1;
+       }
+
+       pmemobj_close(pop);
+
+       return 0;
+}
+
+/*
+ * pmempool_create_blk -- create pmem blk pool
+ */
+static int
+pmempool_create_blk(struct pmempool_create *pcp)
+{
+       ASSERTne(pcp->params.blk.bsize, 0);
+
+       int ret = 0;
+
+       PMEMblkpool *pbp = pmemblk_create(pcp->fname, pcp->params.blk.bsize,
+                       pcp->params.size, pcp->params.mode);
+       if (!pbp) {
+               outv_err("'%s' -- %s\n", pcp->fname, pmemblk_errormsg());
+               return -1;
+       }
+
+       if (pcp->write_btt_layout) {
+               outv(1, "Writing BTT layout using block %d.\n",
+                               pcp->write_btt_layout);
+
+               if (pmemblk_set_error(pbp, 0) || pmemblk_set_zero(pbp, 0)) {
+                       outv_err("writing BTT layout to block 0 failed\n");
+                       ret = -1;
+               }
+       }
+
+       pmemblk_close(pbp);
+
+       return ret;
+}
+
+/*
+ * pmempool_create_log -- create pmem log pool
+ */
+static int
+pmempool_create_log(struct pmempool_create *pcp)
+{
+       PMEMlogpool *plp = pmemlog_create(pcp->fname,
+                                       pcp->params.size, pcp->params.mode);
+
+       if (!plp) {
+               outv_err("'%s' -- %s\n", pcp->fname, pmemlog_errormsg());
+               return -1;
+       }
+
+       pmemlog_close(plp);
+
+       return 0;
+}
+
+/*
+ * pmempool_get_max_size -- return maximum allowed size of file
+ */
+#ifndef _WIN32
+static int
+pmempool_get_max_size(const char *fname, uint64_t *sizep)
+{
+       struct statvfs buf;
+       int ret = 0;
+       char *name = strdup(fname);
+       if (name == NULL) {
+               return -1;
+       }
+
+       char *dir = dirname(name);
+
+       if (statvfs(dir, &buf))
+               ret = -1;
+       else
+               *sizep = buf.f_bsize * buf.f_bavail;
+
+       free(name);
+
+       return ret;
+}
+#else
+static int
+pmempool_get_max_size(const char *fname, uint64_t *sizep)
+{
+       int ret = 0;
+       ULARGE_INTEGER freespace;
+       char *name = strdup(fname);
+       if (name == NULL) {
+               return -1;
+       }
+
+       char *dir = dirname(name);
+       wchar_t *str = util_toUTF16(dir);
+       if (str == NULL) {
+               free(name);
+               return -1;
+       }
+       if (GetDiskFreeSpaceExW(str, &freespace, NULL, NULL) == 0)
+               ret = -1;
+       else
+               *sizep = freespace.QuadPart;
+
+       free(str);
+       free(name);
+
+       return ret;
+}
+#endif
+
+/*
+ * print_pool_params -- print some parameters of a pool
+ */
+static void
+print_pool_params(struct pmem_pool_params *params)
+{
+       outv(1, "\ttype  : %s\n", out_get_pool_type_str(params->type));
+       outv(1, "\tsize  : %s\n", out_get_size_str(params->size, 2));
+       outv(1, "\tmode  : 0%o\n", params->mode);
+       switch (params->type) {
+       case PMEM_POOL_TYPE_BLK:
+               outv(1, "\tbsize : %s\n",
+                       out_get_size_str(params->blk.bsize, 0));
+               break;
+       case PMEM_POOL_TYPE_OBJ:
+               outv(1, "\tlayout: '%s'\n", params->obj.layout);
+               break;
+       default:
+               break;
+       }
+}
+
+/*
+ * inherit_pool_params -- inherit pool parameters from specified file
+ */
+static int
+inherit_pool_params(struct pmempool_create *pcp)
+{
+       outv(1, "Parsing pool: '%s'\n", pcp->inherit_fname);
+
+       /*
+        * If no type string passed, --inherit option must be passed
+        * so parse file and get required parameters.
+        */
+       if (pmem_pool_parse_params(pcp->inherit_fname,
+                       &pcp->inherit_params, 1)) {
+               if (errno)
+                       perror(pcp->inherit_fname);
+               else
+                       outv_err("%s: cannot determine type of pool\n",
+                               pcp->inherit_fname);
+               return -1;
+       }
+
+       if (PMEM_POOL_TYPE_UNKNOWN == pcp->inherit_params.type) {
+               outv_err("'%s' -- unknown pool type\n",
+                               pcp->inherit_fname);
+               return -1;
+       }
+
+       print_pool_params(&pcp->inherit_params);
+
+       return 0;
+}
+
+/*
+ * pmempool_create_parse_args -- parse command line args
+ */
+static int
+pmempool_create_parse_args(struct pmempool_create *pcp, const char *appname,
+               int argc, char *argv[], struct options *opts)
+{
+       int opt, ret;
+       while ((opt = util_options_getopt(argc, argv, "vhi:s:Mm:l:wfb",
+                       opts)) != -1) {
+               switch (opt) {
+               case 'v':
+                       pcp->verbose = 1;
+                       break;
+               case 'h':
+                       pmempool_create_help(appname);
+                       exit(EXIT_SUCCESS);
+               case 's':
+                       pcp->str_size = optarg;
+                       ret = util_parse_size(optarg,
+                           (size_t *)&pcp->params.size);
+                       if (ret || pcp->params.size == 0) {
+                               outv_err("invalid size value specified '%s'\n",
+                                               optarg);
+                               return -1;
+                       }
+                       break;
+               case 'M':
+                       pcp->max_size = 1;
+                       break;
+               case 'm':
+                       pcp->str_mode = optarg;
+                       if (util_parse_mode(optarg, &pcp->params.mode)) {
+                               outv_err("invalid mode value specified '%s'\n",
+                                               optarg);
+                               return -1;
+                       }
+                       break;
+               case 'i':
+                       pcp->inherit_fname = optarg;
+                       break;
+               case 'w':
+                       pcp->write_btt_layout = 1;
+                       break;
+               case 'l':
+                       pcp->layout = optarg;
+                       break;
+               case 'f':
+                       pcp->force = 1;
+                       break;
+               case 'b':
+                       pcp->clearbadblocks = 1;
+                       break;
+               default:
+                       print_usage(appname);
+                       return -1;
+               }
+       }
+
+       /* check for <type>, <bsize> and <file> strings */
+       if (optind + 2 < argc) {
+               pcp->str_type = argv[optind];
+               pcp->str_bsize = argv[optind + 1];
+               pcp->fname = argv[optind + 2];
+       } else if (optind + 1 < argc) {
+               pcp->str_type = argv[optind];
+               pcp->fname = argv[optind + 1];
+       } else if (optind < argc) {
+               pcp->fname = argv[optind];
+               pcp->str_type = NULL;
+       } else {
+               print_usage(appname);
+               return -1;
+       }
+
+       return 0;
+}
+
+static int
+allocate_max_size_available_file(const char *name_of_file, mode_t mode,
+               os_off_t max_size)
+{
+       int fd = os_open(name_of_file, O_CREAT | O_EXCL | O_RDWR, mode);
+       if (fd == -1) {
+               outv_err("!open '%s' failed", name_of_file);
+               return -1;
+       }
+
+       os_off_t offset = 0;
+       os_off_t length = max_size - (max_size % (os_off_t)Pagesize);
+       int ret;
+       do {
+               ret = os_posix_fallocate(fd, offset, length);
+               if (ret == 0)
+                       offset += length;
+               else if (ret != ENOSPC) {
+                       os_close(fd);
+                       if (os_unlink(name_of_file) == -1)
+                               outv_err("!unlink '%s' failed", name_of_file);
+                       errno = ret;
+                       outv_err("!space allocation for '%s' failed",
+                                       name_of_file);
+                       return -1;
+               }
+
+               length /= 2;
+               length -= (length % (os_off_t)Pagesize);
+       } while (length > (os_off_t)Pagesize);
+
+       os_close(fd);
+
+       return 0;
+}
+
+/*
+ * pmempool_create_func -- main function for create command
+ */
+int
+pmempool_create_func(const char *appname, int argc, char *argv[])
+{
+       int ret = 0;
+       struct pmempool_create pc = pmempool_create_default;
+       pc.opts = util_options_alloc(long_options, sizeof(long_options) /
+                       sizeof(long_options[0]), NULL);
+
+       /* parse command line arguments */
+       ret = pmempool_create_parse_args(&pc, appname, argc, argv, pc.opts);
+       if (ret)
+               exit(EXIT_FAILURE);
+
+       /* set verbosity level */
+       out_set_vlevel(pc.verbose);
+
+       umask(0);
+
+       int exists = util_file_exists(pc.fname);
+       if (exists < 0)
+               return -1;
+
+       pc.fexists = exists;
+       int is_poolset = util_is_poolset_file(pc.fname) == 1;
+
+       if (pc.inherit_fname)  {
+               if (inherit_pool_params(&pc)) {
+                       outv_err("parsing pool '%s' failed\n",
+                                       pc.inherit_fname);
+                       return -1;
+               }
+       }
+
+       /*
+        * Parse pool type and other parameters if --inherit option
+        * passed. It is possible to either pass --inherit option
+        * or pool type string in command line arguments. This is
+        * validated here.
+        */
+       if (pc.str_type) {
+               /* parse pool type string if passed in command line arguments */
+               pc.params.type = pmem_pool_type_parse_str(pc.str_type);
+               if (PMEM_POOL_TYPE_UNKNOWN == pc.params.type) {
+                       outv_err("'%s' -- unknown pool type\n", pc.str_type);
+                       return -1;
+               }
+
+               if (PMEM_POOL_TYPE_BLK == pc.params.type) {
+                       if (pc.str_bsize == NULL) {
+                               outv_err("blk pool requires <bsize> "
+                                       "argument\n");
+                               return -1;
+                       }
+                       if (util_parse_size(pc.str_bsize,
+                                       (size_t *)&pc.params.blk.bsize)) {
+                               outv_err("cannot parse '%s' as block size\n",
+                                               pc.str_bsize);
+                               return -1;
+                       }
+               }
+
+               if (PMEM_POOL_TYPE_OBJ == pc.params.type && pc.layout != NULL) {
+                       size_t max_layout = PMEMOBJ_MAX_LAYOUT;
+
+                       if (strlen(pc.layout) >= max_layout) {
+                               outv_err(
+                                               "Layout name is too long, maximum number of characters (including the terminating null byte) is %zu\n",
+                                               max_layout);
+                               return -1;
+                       }
+
+                       size_t len = sizeof(pc.params.obj.layout);
+                       strncpy(pc.params.obj.layout, pc.layout, len);
+                       pc.params.obj.layout[len - 1] = '\0';
+               }
+       } else if (pc.inherit_fname) {
+               pc.params.type = pc.inherit_params.type;
+       } else {
+               /* neither pool type string nor --inherit options passed */
+               print_usage(appname);
+               return -1;
+       }
+
+       if (util_options_verify(pc.opts, pc.params.type))
+               return -1;
+
+       if (pc.params.type != PMEM_POOL_TYPE_BLK && pc.str_bsize != NULL) {
+               outv_err("invalid option specified for %s pool type"
+                               " -- block size\n",
+                       out_get_pool_type_str(pc.params.type));
+               return -1;
+       }
+
+       if (is_poolset) {
+               if (pc.params.size) {
+                       outv_err("-s|--size cannot be used with "
+                                       "poolset file\n");
+                       return -1;
+               }
+
+               if (pc.max_size) {
+                       outv_err("-M|--max-size cannot be used with "
+                                       "poolset file\n");
+                       return -1;
+               }
+       }
+
+       if (pc.params.size && pc.max_size) {
+               outv_err("-M|--max-size option cannot be used with -s|--size"
+                               " option\n");
+               return -1;
+       }
+
+       if (pc.inherit_fname)  {
+               if (!pc.str_size && !pc.max_size)
+                       pc.params.size = pc.inherit_params.size;
+               if (!pc.str_mode)
+                       pc.params.mode = pc.inherit_params.mode;
+               switch (pc.params.type) {
+               case PMEM_POOL_TYPE_BLK:
+                       if (!pc.str_bsize)
+                               pc.params.blk.bsize =
+                                       pc.inherit_params.blk.bsize;
+                       break;
+               case PMEM_POOL_TYPE_OBJ:
+                       if (!pc.layout) {
+                               memcpy(pc.params.obj.layout,
+                                       pc.inherit_params.obj.layout,
+                                       sizeof(pc.params.obj.layout));
+                       } else {
+                               size_t len = sizeof(pc.params.obj.layout);
+                               strncpy(pc.params.obj.layout, pc.layout,
+                                               len - 1);
+                               pc.params.obj.layout[len - 1] = '\0';
+                       }
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       /*
+        * If neither --size nor --inherit options passed, check
+        * for --max-size option - if not passed use minimum pool size.
+        */
+       uint64_t min_size = pmem_pool_get_min_size(pc.params.type);
+       if (pc.params.size == 0) {
+               if (pc.max_size) {
+                       outv(1, "Maximum size option passed "
+                               "- getting available space of file system.\n");
+                       ret = pmempool_get_max_size(pc.fname,
+                                       &pc.params.size);
+                       if (ret) {
+                               outv_err("cannot get available space of fs\n");
+                               return -1;
+                       }
+                       if (pc.params.size == 0) {
+                               outv_err("No space left on device\n");
+                               return -1;
+                       }
+                       outv(1, "Available space is %s\n",
+                               out_get_size_str(pc.params.size, 2));
+                       if (allocate_max_size_available_file(pc.fname,
+                                       pc.params.mode,
+                                       (os_off_t)pc.params.size))
+                               return -1;
+                       /*
+                        * We are going to create pool based
+                        * on file size instead of the pc.params.size.
+                        */
+                       pc.params.size = 0;
+               } else {
+                       if (!pc.fexists) {
+                               outv(1, "No size option passed "
+                                       "- picking minimum pool size.\n");
+                               pc.params.size = min_size;
+                       }
+               }
+       } else {
+               if (pc.params.size < min_size) {
+                       outv_err("size must be >= %lu bytes\n", min_size);
+                       return -1;
+               }
+       }
+
+       if (pc.force)
+               pmempool_rm(pc.fname, PMEMPOOL_RM_FORCE);
+
+       outv(1, "Creating pool: %s\n", pc.fname);
+       print_pool_params(&pc.params);
+
+       if (pc.clearbadblocks) {
+               int ret = util_pool_clear_badblocks(pc.fname,
+                                               1 /* ignore non-existing */);
+               if (ret) {
+                       outv_err("'%s' -- clearing bad blocks failed\n",
+                                       pc.fname);
+                       return -1;
+               }
+       }
+
+       switch (pc.params.type) {
+       case PMEM_POOL_TYPE_BLK:
+               ret = pmempool_create_blk(&pc);
+               break;
+       case PMEM_POOL_TYPE_LOG:
+               ret = pmempool_create_log(&pc);
+               break;
+       case PMEM_POOL_TYPE_OBJ:
+               ret = pmempool_create_obj(&pc);
+               break;
+       default:
+               ret = -1;
+               break;
+       }
+
+       if (ret) {
+               outv_err("creating pool file failed\n");
+               if (!pc.fexists)
+                       util_unlink(pc.fname);
+       }
+
+       util_options_free(pc.opts);
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/create.h b/ceph/src/pmdk/src/tools/pmempool/create.h
new file mode 100644 (file)
index 0000000..21d083a
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * create.h -- pmempool create command header file
+ */
+
+int pmempool_create_func(const char *appname, int argc, char *argv[]);
+void pmempool_create_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/dump.c b/ceph/src/pmdk/src/tools/pmempool/dump.c
new file mode 100644 (file)
index 0000000..3c7b074
--- /dev/null
@@ -0,0 +1,391 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * create.c -- pmempool create command source file
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <err.h>
+#include "common.h"
+#include "dump.h"
+#include "output.h"
+#include "os.h"
+#include "libpmemblk.h"
+#include "libpmemlog.h"
+
+#define VERBOSE_DEFAULT        1
+
+/*
+ * pmempool_dump -- context and arguments for dump command
+ */
+struct pmempool_dump {
+       char *fname;
+       char *ofname;
+       char *range;
+       FILE *ofh;
+       int hex;
+       uint64_t bsize;
+       struct ranges ranges;
+       size_t chunksize;
+       uint64_t chunkcnt;
+};
+
+/*
+ * pmempool_dump_default -- default arguments and context values
+ */
+static const struct pmempool_dump pmempool_dump_default = {
+       .fname          = NULL,
+       .ofname         = NULL,
+       .range          = NULL,
+       .ofh            = NULL,
+       .hex            = 1,
+       .bsize          = 0,
+       .chunksize      = 0,
+       .chunkcnt       = 0,
+};
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"output",      required_argument,      NULL,   'o' | OPT_ALL},
+       {"binary",      no_argument,            NULL,   'b' | OPT_ALL},
+       {"range",       required_argument,      NULL,   'r' | OPT_ALL},
+       {"chunk",       required_argument,      NULL,   'c' | OPT_LOG},
+       {"help",        no_argument,            NULL,   'h' | OPT_ALL},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Dump user data from pool\n"
+"\n"
+"Available options:\n"
+"  -o, --output <file>  output file name\n"
+"  -b, --binary         dump data in binary format\n"
+"  -r, --range <range>  range of bytes/blocks/data chunks\n"
+"  -c, --chunk <size>   size of chunk for PMEMLOG pool\n"
+"  -h, --help           display this help and exit\n"
+"\n"
+"For complete documentation see %s-dump(1) manual page.\n"
+;
+
+/*
+ * print_usage -- print application usage short description
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s dump [<args>] <file>\n", appname);
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_dump_help -- print help message for dump command
+ */
+void
+pmempool_dump_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * pmempool_dump_log_process_chunk -- callback for pmemlog_walk
+ */
+static int
+pmempool_dump_log_process_chunk(const void *buf, size_t len, void *arg)
+{
+       struct pmempool_dump *pdp = (struct pmempool_dump *)arg;
+
+       if (len == 0)
+               return 0;
+
+       struct range *curp = NULL;
+       if (pdp->chunksize) {
+               PMDK_LIST_FOREACH(curp, &pdp->ranges.head, next) {
+                       if (pdp->chunkcnt >= curp->first &&
+                           pdp->chunkcnt <= curp->last &&
+                           pdp->chunksize <= len) {
+                               if (pdp->hex) {
+                                       outv_hexdump(VERBOSE_DEFAULT,
+                                               buf, pdp->chunksize,
+                                               pdp->chunksize * pdp->chunkcnt,
+                                               0);
+                               } else {
+                                       if (fwrite(buf, pdp->chunksize,
+                                                       1, pdp->ofh) != 1)
+                                               err(1, "%s", pdp->ofname);
+                               }
+                       }
+               }
+               pdp->chunkcnt++;
+       } else {
+               PMDK_LIST_FOREACH(curp, &pdp->ranges.head, next) {
+                       if (curp->first >= len)
+                               continue;
+                       uint8_t *ptr = (uint8_t *)buf + curp->first;
+                       if (curp->last >= len)
+                               curp->last = len - 1;
+                       uint64_t count = curp->last - curp->first + 1;
+                       if (pdp->hex) {
+                               outv_hexdump(VERBOSE_DEFAULT, ptr,
+                                               count, curp->first, 0);
+                       } else {
+                               if (fwrite(ptr, count, 1, pdp->ofh) != 1)
+                                       err(1, "%s", pdp->ofname);
+                       }
+               }
+       }
+
+       return 1;
+}
+
+/*
+ * pmempool_dump_parse_range -- parse range passed by arguments
+ */
+static int
+pmempool_dump_parse_range(struct pmempool_dump *pdp, size_t max)
+{
+       struct range entire;
+       memset(&entire, 0, sizeof(entire));
+
+       entire.last = max;
+
+       if (util_parse_ranges(pdp->range, &pdp->ranges, entire)) {
+               outv_err("invalid range value specified"
+                               " -- '%s'\n", pdp->range);
+               return -1;
+       }
+
+       if (PMDK_LIST_EMPTY(&pdp->ranges.head))
+               util_ranges_add(&pdp->ranges, entire);
+
+       return 0;
+}
+
+/*
+ * pmempool_dump_log -- dump data from pmem log pool
+ */
+static int
+pmempool_dump_log(struct pmempool_dump *pdp)
+{
+       PMEMlogpool *plp = pmemlog_open(pdp->fname);
+       if (!plp) {
+               warn("%s", pdp->fname);
+               return -1;
+       }
+
+       os_off_t off = pmemlog_tell(plp);
+       if (off < 0) {
+               warn("%s", pdp->fname);
+               pmemlog_close(plp);
+               return -1;
+       }
+
+       if (off == 0)
+               goto end;
+
+       size_t max = (size_t)off - 1;
+       if (pdp->chunksize)
+               max /= pdp->chunksize;
+
+       if (pmempool_dump_parse_range(pdp, max))
+               return -1;
+
+       pdp->chunkcnt = 0;
+       pmemlog_walk(plp, pdp->chunksize, pmempool_dump_log_process_chunk, pdp);
+
+end:
+       pmemlog_close(plp);
+
+       return 0;
+}
+
+/*
+ * pmempool_dump_blk -- dump data from pmem blk pool
+ */
+static int
+pmempool_dump_blk(struct pmempool_dump *pdp)
+{
+       PMEMblkpool *pbp = pmemblk_open(pdp->fname, pdp->bsize);
+       if (!pbp) {
+               warn("%s", pdp->fname);
+               return -1;
+       }
+
+       if (pmempool_dump_parse_range(pdp, pmemblk_nblock(pbp) - 1))
+               return -1;
+
+       uint8_t *buff = malloc(pdp->bsize);
+       if (!buff)
+               err(1, "Cannot allocate memory for pmemblk block buffer");
+
+       int ret = 0;
+
+       uint64_t i;
+       struct range *curp = NULL;
+       PMDK_LIST_FOREACH(curp, &pdp->ranges.head, next) {
+               assert((os_off_t)curp->last >= 0);
+               for (i = curp->first; i <= curp->last; i++) {
+                       if (pmemblk_read(pbp, buff, (os_off_t)i)) {
+                               ret = -1;
+                               outv_err("reading block number %lu "
+                                       "failed\n", i);
+                               break;
+                       }
+
+                       if (pdp->hex) {
+                               uint64_t offset = i * pdp->bsize;
+                               outv_hexdump(VERBOSE_DEFAULT, buff,
+                                               pdp->bsize, offset, 0);
+                       } else {
+                               if (fwrite(buff, pdp->bsize, 1,
+                                                       pdp->ofh) != 1) {
+                                       warn("write");
+                                       ret = -1;
+                                       break;
+                               }
+                       }
+               }
+       }
+
+       free(buff);
+       pmemblk_close(pbp);
+
+       return ret;
+}
+
+static const struct option_requirement option_requirements[] = {
+       { 0,  0, 0}
+};
+
+/*
+ * pmempool_dump_func -- dump command main function
+ */
+int
+pmempool_dump_func(const char *appname, int argc, char *argv[])
+{
+       struct pmempool_dump pd = pmempool_dump_default;
+       PMDK_LIST_INIT(&pd.ranges.head);
+       out_set_vlevel(VERBOSE_DEFAULT);
+
+       struct options *opts = util_options_alloc(long_options,
+                               sizeof(long_options) / sizeof(long_options[0]),
+                               option_requirements);
+       int ret = 0;
+       long long chunksize;
+       int opt;
+       while ((opt = util_options_getopt(argc, argv,
+                       "ho:br:c:", opts)) != -1) {
+               switch (opt) {
+               case 'o':
+                       pd.ofname = optarg;
+                       break;
+               case 'b':
+                       pd.hex = 0;
+                       break;
+               case 'r':
+                       pd.range = optarg;
+                       break;
+               case 'c':
+                       chunksize = atoll(optarg);
+                       if (chunksize <= 0) {
+                               outv_err("invalid chunk size specified '%s'\n",
+                                               optarg);
+                               exit(EXIT_FAILURE);
+                       }
+                       pd.chunksize = (size_t)chunksize;
+                       break;
+               case 'h':
+                       pmempool_dump_help(appname);
+                       exit(EXIT_SUCCESS);
+               default:
+                       print_usage(appname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (optind < argc) {
+               pd.fname = argv[optind];
+       } else {
+               print_usage(appname);
+               exit(EXIT_FAILURE);
+       }
+
+       if (pd.ofname == NULL) {
+               /* use standard output by default */
+               pd.ofh = stdout;
+       } else {
+               pd.ofh = os_fopen(pd.ofname, "wb");
+               if (!pd.ofh) {
+                       warn("%s", pd.ofname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       /* set output stream - stdout or file passed by -o option */
+       out_set_stream(pd.ofh);
+
+       struct pmem_pool_params params;
+       /* parse pool type and block size for pmem blk pool */
+       pmem_pool_parse_params(pd.fname, &params, 1);
+
+       ret = util_options_verify(opts, params.type);
+       if (ret)
+               goto out;
+
+       switch (params.type) {
+       case PMEM_POOL_TYPE_LOG:
+               ret = pmempool_dump_log(&pd);
+               break;
+       case PMEM_POOL_TYPE_BLK:
+               pd.bsize = params.blk.bsize;
+               ret = pmempool_dump_blk(&pd);
+               break;
+       case PMEM_POOL_TYPE_OBJ:
+               outv_err("%s: PMEMOBJ pool not supported\n", pd.fname);
+               ret = -1;
+               goto out;
+       case PMEM_POOL_TYPE_UNKNOWN:
+               outv_err("%s: unknown pool type -- '%s'\n", pd.fname,
+                               params.signature);
+               ret = -1;
+               goto out;
+       default:
+               outv_err("%s: cannot determine type of pool\n", pd.fname);
+               ret = -1;
+               goto out;
+       }
+
+       if (ret)
+               outv_err("%s: dumping pool file failed\n", pd.fname);
+
+out:
+       if (pd.ofh != stdout)
+               fclose(pd.ofh);
+
+       util_ranges_clear(&pd.ranges);
+
+       util_options_free(opts);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/dump.h b/ceph/src/pmdk/src/tools/pmempool/dump.h
new file mode 100644 (file)
index 0000000..1b0e704
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * dump.h -- pmempool dump command header file
+ */
+
+int pmempool_dump_func(const char *appname, int argc, char *argv[]);
+void pmempool_dump_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/feature.c b/ceph/src/pmdk/src/tools/pmempool/feature.c
new file mode 100644 (file)
index 0000000..8f199de
--- /dev/null
@@ -0,0 +1,207 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018-2019, Intel Corporation */
+
+/*
+ * feature.c -- pmempool feature command source file
+ */
+#include <getopt.h>
+#include <stdlib.h>
+
+#include "common.h"
+#include "feature.h"
+#include "output.h"
+#include "libpmempool.h"
+
+/* operations over features */
+enum feature_op {
+       undefined,
+       enable,
+       disable,
+       query
+};
+
+/*
+ * feature_ctx -- context and arguments for feature command
+ */
+struct feature_ctx {
+       int verbose;
+       const char *fname;
+       enum feature_op op;
+       enum pmempool_feature feature;
+       unsigned flags;
+};
+
+/*
+ * pmempool_feature_default -- default arguments for feature command
+ */
+static const struct feature_ctx pmempool_feature_default = {
+       .verbose        = 0,
+       .fname          = NULL,
+       .op             = undefined,
+       .feature        = UINT32_MAX,
+       .flags          = 0
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Toggle or query a pool feature\n"
+"\n"
+"For complete documentation see %s-feature(1) manual page.\n"
+;
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"enable",      required_argument,      NULL,   'e'},
+       {"disable",     required_argument,      NULL,   'd'},
+       {"query",       required_argument,      NULL,   'q'},
+       {"verbose",     no_argument,            NULL,   'v'},
+       {"help",        no_argument,            NULL,   'h'},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * print_usage -- print short description of application's usage
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s feature [<args>] <file>\n", appname);
+       printf(
+               "feature: SINGLEHDR, CKSUM_2K, SHUTDOWN_STATE, CHECK_BAD_BLOCKS\n");
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_feature_help -- print help message for feature command
+ */
+void
+pmempool_feature_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * feature_perform -- perform operation over function
+ */
+static int
+feature_perform(struct feature_ctx *pfp)
+{
+       int ret;
+
+       switch (pfp->op) {
+       case enable:
+               return pmempool_feature_enable(pfp->fname, pfp->feature,
+                               pfp->flags);
+       case disable:
+               return pmempool_feature_disable(pfp->fname, pfp->feature,
+                               pfp->flags);
+       case query:
+               ret = pmempool_feature_query(pfp->fname, pfp->feature,
+                               pfp->flags);
+               if (ret < 0)
+                       return 1;
+               printf("%d", ret);
+               return 0;
+       default:
+               outv_err("Invalid option.");
+               return -1;
+       }
+}
+
+/*
+ * set_op -- set operation
+ */
+static void
+set_op(const char *appname, struct feature_ctx *pfp, enum feature_op op,
+               const char *feature)
+{
+       /* only one operation allowed */
+       if (pfp->op != undefined)
+               goto misuse;
+       pfp->op = op;
+
+       /* parse feature name */
+       uint32_t fval = util_str2pmempool_feature(feature);
+       if (fval == UINT32_MAX)
+               goto misuse;
+       pfp->feature = (enum pmempool_feature)fval;
+       return;
+
+misuse:
+       print_usage(appname);
+       exit(EXIT_FAILURE);
+}
+
+/*
+ * parse_args -- parse command line arguments
+ */
+static int
+parse_args(struct feature_ctx *pfp, const char *appname,
+               int argc, char *argv[])
+{
+       int opt;
+       while ((opt = getopt_long(argc, argv, "vhe:d:q:h",
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'e':
+                       set_op(appname, pfp, enable, optarg);
+                       break;
+               case 'd':
+                       set_op(appname, pfp, disable, optarg);
+                       break;
+               case 'q':
+                       set_op(appname, pfp, query, optarg);
+                       break;
+               case 'v':
+                       pfp->verbose = 2;
+                       break;
+               case 'h':
+                       pmempool_feature_help(appname);
+                       exit(EXIT_SUCCESS);
+               default:
+                       print_usage(appname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (optind >= argc) {
+               print_usage(appname);
+               exit(EXIT_FAILURE);
+       }
+       pfp->fname = argv[optind];
+       return 0;
+}
+
+/*
+ * pmempool_feature_func -- main function for feature command
+ */
+int
+pmempool_feature_func(const char *appname, int argc, char *argv[])
+{
+       struct feature_ctx pf = pmempool_feature_default;
+       int ret = 0;
+
+       /* parse command line arguments */
+       ret = parse_args(&pf, appname, argc, argv);
+       if (ret)
+               return ret;
+
+       /* set verbosity level */
+       out_set_vlevel(pf.verbose);
+
+       return feature_perform(&pf);
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/feature.h b/ceph/src/pmdk/src/tools/pmempool/feature.h
new file mode 100644 (file)
index 0000000..216f61d
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * feature.h -- pmempool feature command header file
+ */
+
+int pmempool_feature_func(const char *appname, int argc, char *argv[]);
+void pmempool_feature_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/info.c b/ceph/src/pmdk/src/tools/pmempool/info.c
new file mode 100644 (file)
index 0000000..58dac13
--- /dev/null
@@ -0,0 +1,1034 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * info.c -- pmempool info command main source file
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include <err.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <assert.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include "common.h"
+#include "output.h"
+#include "out.h"
+#include "info.h"
+#include "set.h"
+#include "file.h"
+#include "badblocks.h"
+#include "set_badblocks.h"
+
+#define DEFAULT_CHUNK_TYPES\
+       ((1<<CHUNK_TYPE_FREE)|\
+       (1<<CHUNK_TYPE_USED)|\
+       (1<<CHUNK_TYPE_RUN))
+
+#define GET_ALIGNMENT(ad, x)\
+(1 + (((ad) >> (ALIGNMENT_DESC_BITS * (x))) & ((1 << ALIGNMENT_DESC_BITS) - 1)))
+
+#define UNDEF_REPLICA UINT_MAX
+#define UNDEF_PART UINT_MAX
+
+/*
+ * Default arguments
+ */
+static const struct pmempool_info_args pmempool_info_args_default = {
+       /*
+        * Picked experimentally based on used fields names.
+        * This should be at least the number of characters of
+        * the longest field name.
+        */
+       .col_width      = 24,
+       .human          = false,
+       .force          = false,
+       .badblocks      = PRINT_BAD_BLOCKS_NOT_SET,
+       .type           = PMEM_POOL_TYPE_UNKNOWN,
+       .vlevel         = VERBOSE_DEFAULT,
+       .vdata          = VERBOSE_SILENT,
+       .vhdrdump       = VERBOSE_SILENT,
+       .vstats         = VERBOSE_SILENT,
+       .log            = {
+               .walk           = 0,
+       },
+       .blk            = {
+               .vmap           = VERBOSE_SILENT,
+               .vflog          = VERBOSE_SILENT,
+               .vbackup        = VERBOSE_SILENT,
+               .skip_zeros     = false,
+               .skip_error     = false,
+               .skip_no_flag   = false,
+       },
+       .obj            = {
+               .vlanes         = VERBOSE_SILENT,
+               .vroot          = VERBOSE_SILENT,
+               .vobjects       = VERBOSE_SILENT,
+               .valloc         = VERBOSE_SILENT,
+               .voobhdr        = VERBOSE_SILENT,
+               .vheap          = VERBOSE_SILENT,
+               .vzonehdr       = VERBOSE_SILENT,
+               .vchunkhdr      = VERBOSE_SILENT,
+               .vbitmap        = VERBOSE_SILENT,
+               .lanes_recovery = false,
+               .ignore_empty_obj = false,
+               .chunk_types    = DEFAULT_CHUNK_TYPES,
+               .replica        = 0,
+       },
+};
+
+/*
+ * long-options -- structure holding long options.
+ */
+static const struct option long_options[] = {
+       {"version",     no_argument,            NULL, 'V' | OPT_ALL},
+       {"verbose",     no_argument,            NULL, 'v' | OPT_ALL},
+       {"help",        no_argument,            NULL, 'h' | OPT_ALL},
+       {"human",       no_argument,            NULL, 'n' | OPT_ALL},
+       {"force",       required_argument,      NULL, 'f' | OPT_ALL},
+       {"data",        no_argument,            NULL, 'd' | OPT_ALL},
+       {"headers-hex", no_argument,            NULL, 'x' | OPT_ALL},
+       {"stats",       no_argument,            NULL, 's' | OPT_ALL},
+       {"range",       required_argument,      NULL, 'r' | OPT_ALL},
+       {"bad-blocks",  required_argument,      NULL, 'k' | OPT_ALL},
+       {"walk",        required_argument,      NULL, 'w' | OPT_LOG},
+       {"skip-zeros",  no_argument,            NULL, 'z' | OPT_BLK | OPT_BTT},
+       {"skip-error",  no_argument,            NULL, 'e' | OPT_BLK | OPT_BTT},
+       {"skip-no-flag", no_argument,           NULL, 'u' | OPT_BLK | OPT_BTT},
+       {"map",         no_argument,            NULL, 'm' | OPT_BLK | OPT_BTT},
+       {"flog",        no_argument,            NULL, 'g' | OPT_BLK | OPT_BTT},
+       {"backup",      no_argument,            NULL, 'B' | OPT_BLK | OPT_BTT},
+       {"lanes",       no_argument,            NULL, 'l' | OPT_OBJ},
+       {"recovery",    no_argument,            NULL, 'R' | OPT_OBJ},
+       {"section",     required_argument,      NULL, 'S' | OPT_OBJ},
+       {"object-store", no_argument,           NULL, 'O' | OPT_OBJ},
+       {"types",       required_argument,      NULL, 't' | OPT_OBJ},
+       {"no-empty",    no_argument,            NULL, 'E' | OPT_OBJ},
+       {"alloc-header", no_argument,           NULL, 'A' | OPT_OBJ},
+       {"oob-header",  no_argument,            NULL, 'a' | OPT_OBJ},
+       {"root",        no_argument,            NULL, 'o' | OPT_OBJ},
+       {"heap",        no_argument,            NULL, 'H' | OPT_OBJ},
+       {"zones",       no_argument,            NULL, 'Z' | OPT_OBJ},
+       {"chunks",      no_argument,            NULL, 'C' | OPT_OBJ},
+       {"chunk-type",  required_argument,      NULL, 'T' | OPT_OBJ},
+       {"bitmap",      no_argument,            NULL, 'b' | OPT_OBJ},
+       {"replica",     required_argument,      NULL, 'p' | OPT_OBJ},
+       {NULL,          0,                      NULL,  0 },
+};
+
+static const struct option_requirement option_requirements[] = {
+       {
+               .opt    = 'r',
+               .type   = PMEM_POOL_TYPE_LOG,
+               .req    = OPT_REQ0('d')
+       },
+       {
+               .opt    = 'r',
+               .type   = PMEM_POOL_TYPE_BLK | PMEM_POOL_TYPE_BTT,
+               .req    = OPT_REQ0('d') | OPT_REQ1('m')
+       },
+       {
+               .opt    = 'z',
+               .type   = PMEM_POOL_TYPE_BLK | PMEM_POOL_TYPE_BTT,
+               .req    = OPT_REQ0('d') | OPT_REQ1('m')
+       },
+       {
+               .opt    = 'e',
+               .type   = PMEM_POOL_TYPE_BLK | PMEM_POOL_TYPE_BTT,
+               .req    = OPT_REQ0('d') | OPT_REQ1('m')
+       },
+       {
+               .opt    = 'u',
+               .type   = PMEM_POOL_TYPE_BLK | PMEM_POOL_TYPE_BTT,
+               .req    = OPT_REQ0('d') | OPT_REQ1('m')
+       },
+       {
+               .opt    = 'r',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('Z') |
+                       OPT_REQ2('C') | OPT_REQ3('l'),
+       },
+       {
+               .opt    = 'R',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('l')
+       },
+       {
+               .opt    = 'S',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('l')
+       },
+       {
+               .opt    = 'E',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O')
+       },
+       {
+               .opt    = 'T',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('C')
+       },
+       {
+               .opt    = 'b',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('H')
+       },
+       {
+               .opt    = 'b',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('C')
+       },
+       {
+               .opt    = 'A',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('l') | OPT_REQ2('o')
+       },
+       {
+               .opt    = 'a',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('l') | OPT_REQ2('o')
+       },
+       {
+               .opt    = 't',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('s'),
+       },
+       {
+               .opt    = 'C',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('H') | OPT_REQ2('s'),
+       },
+       {
+               .opt    = 'Z',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('H') | OPT_REQ2('s'),
+       },
+       {
+               .opt    = 'd',
+               .type   = PMEM_POOL_TYPE_OBJ,
+               .req    = OPT_REQ0('O') | OPT_REQ1('o'),
+       },
+       { 0,  0, 0}
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Show information about pmem pool from specified file.\n"
+"\n"
+"Common options:\n"
+"  -h, --help                      Print this help and exit.\n"
+"  -V, --version                   Print version and exit.\n"
+"  -v, --verbose                   Increase verbisity level.\n"
+"  -f, --force blk|log|obj|btt     Force parsing a pool of specified type.\n"
+"  -n, --human                     Print sizes in human readable format.\n"
+"  -x, --headers-hex               Hexdump all headers.\n"
+"  -d, --data                      Dump log data and blocks.\n"
+"  -s, --stats                     Print statistics.\n"
+"  -r, --range <range>             Range of blocks/chunks/objects.\n"
+"  -k, --bad-blocks=<yes|no>       Print bad blocks.\n"
+"\n"
+"Options for PMEMLOG:\n"
+"  -w, --walk <size>               Chunk size.\n"
+"\n"
+"Options for PMEMBLK:\n"
+"  -m, --map                       Print BTT Map entries.\n"
+"  -g, --flog                      Print BTT FLOG entries.\n"
+"  -B, --backup                    Print BTT Info header backup.\n"
+"  -z, --skip-zeros                Skip blocks marked with zero flag.\n"
+"  -e, --skip-error                Skip blocks marked with error flag.\n"
+"  -u, --skip-no-flag              Skip blocks not marked with any flag.\n"
+"\n"
+"Options for PMEMOBJ:\n"
+"  -l, --lanes [<range>]           Print lanes from specified range.\n"
+"  -R, --recovery                  Print only lanes which need recovery.\n"
+"  -S, --section tx,allocator,list Print only specified sections.\n"
+"  -O, --object-store              Print object store.\n"
+"  -t, --types <range>             Specify objects' type numbers range.\n"
+"  -E, --no-empty                  Print only non-empty object store lists.\n"
+"  -o, --root                      Print root object information\n"
+"  -A, --alloc-header              Print allocation header for objects in\n"
+"                                  object store.\n"
+"  -a, --oob-header                Print OOB header\n"
+"  -H, --heap                      Print heap header.\n"
+"  -Z, --zones [<range>]           Print zones header. If range is specified\n"
+"                                  and --object|-O option is specified prints\n"
+"                                  objects from specified zones only.\n"
+"  -C, --chunks [<range>]          Print zones header. If range is specified\n"
+"                                  and --object|-O option is specified prints\n"
+"                                  objects from specified zones only.\n"
+"  -T, --chunk-type used,free,run,footer\n"
+"                                  Print only specified type(s) of chunk.\n"
+"                                  [requires --chunks|-C]\n"
+"  -b, --bitmap                    Print chunk run's bitmap in graphical\n"
+"                                  format. [requires --chunks|-C]\n"
+"  -p, --replica <num>             Print info from specified replica\n"
+"For complete documentation see %s-info(1) manual page.\n"
+;
+
+/*
+ * print_usage -- print application usage short description
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s info [<args>] <file>\n", appname);
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_info_help -- print application usage detailed description
+ */
+void
+pmempool_info_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * parse_args -- parse command line arguments
+ *
+ * Parse command line arguments and store them in pmempool_info_args
+ * structure.
+ * Terminates process if invalid arguments passed.
+ */
+static int
+parse_args(const char *appname, int argc, char *argv[],
+               struct pmempool_info_args *argsp,
+               struct options *opts)
+{
+       int opt;
+
+       if (argc == 1) {
+               print_usage(appname);
+
+               return -1;
+       }
+
+       struct ranges *rangesp = &argsp->ranges;
+       while ((opt = util_options_getopt(argc, argv,
+                       "vhnf:ezuF:L:c:dmxVw:gBsr:lRS:OECZHT:bot:aAp:k:",
+                       opts)) != -1) {
+
+               switch (opt) {
+               case 'v':
+                       argsp->vlevel = VERBOSE_MAX;
+                       break;
+               case 'V':
+                       print_version(appname);
+                       exit(EXIT_SUCCESS);
+               case 'h':
+                       pmempool_info_help(appname);
+                       exit(EXIT_SUCCESS);
+               case 'n':
+                       argsp->human = true;
+                       break;
+               case 'f':
+                       argsp->type = pmem_pool_type_parse_str(optarg);
+                       if (argsp->type == PMEM_POOL_TYPE_UNKNOWN) {
+                               outv_err("'%s' -- unknown pool type\n", optarg);
+                               return -1;
+                       }
+                       argsp->force = true;
+                       break;
+               case 'k':
+                       if (strcmp(optarg, "no") == 0) {
+                               argsp->badblocks = PRINT_BAD_BLOCKS_NO;
+                       } else if (strcmp(optarg, "yes") == 0) {
+                               argsp->badblocks = PRINT_BAD_BLOCKS_YES;
+                       } else {
+                               outv_err(
+                                       "'%s' -- invalid argument of the '-k/--bad-blocks' option\n",
+                                       optarg);
+                               return -1;
+                       }
+                       break;
+               case 'e':
+                       argsp->blk.skip_error = true;
+                       break;
+               case 'z':
+                       argsp->blk.skip_zeros = true;
+                       break;
+               case 'u':
+                       argsp->blk.skip_no_flag = true;
+                       break;
+               case 'r':
+                       if (util_parse_ranges(optarg, rangesp,
+                                       ENTIRE_UINT64)) {
+                               outv_err("'%s' -- cannot parse range(s)\n",
+                                               optarg);
+                               return -1;
+                       }
+
+                       if (rangesp == &argsp->ranges)
+                               argsp->use_range = 1;
+
+                       break;
+               case 'd':
+                       argsp->vdata = VERBOSE_DEFAULT;
+                       break;
+               case 'm':
+                       argsp->blk.vmap = VERBOSE_DEFAULT;
+                       break;
+               case 'g':
+                       argsp->blk.vflog = VERBOSE_DEFAULT;
+                       break;
+               case 'B':
+                       argsp->blk.vbackup = VERBOSE_DEFAULT;
+                       break;
+               case 'x':
+                       argsp->vhdrdump = VERBOSE_DEFAULT;
+                       break;
+               case 's':
+                       argsp->vstats = VERBOSE_DEFAULT;
+                       break;
+               case 'w':
+                       argsp->log.walk = (size_t)atoll(optarg);
+                       if (argsp->log.walk == 0) {
+                               outv_err("'%s' -- invalid chunk size\n",
+                                       optarg);
+                               return -1;
+                       }
+                       break;
+               case 'l':
+                       argsp->obj.vlanes = VERBOSE_DEFAULT;
+                       rangesp = &argsp->obj.lane_ranges;
+                       break;
+               case 'R':
+                       argsp->obj.lanes_recovery = true;
+                       break;
+               case 'O':
+                       argsp->obj.vobjects = VERBOSE_DEFAULT;
+                       rangesp = &argsp->ranges;
+                       break;
+               case 'a':
+                       argsp->obj.voobhdr = VERBOSE_DEFAULT;
+                       break;
+               case 'A':
+                       argsp->obj.valloc = VERBOSE_DEFAULT;
+                       break;
+               case 'E':
+                       argsp->obj.ignore_empty_obj = true;
+                       break;
+               case 'Z':
+                       argsp->obj.vzonehdr = VERBOSE_DEFAULT;
+                       rangesp = &argsp->obj.zone_ranges;
+                       break;
+               case 'C':
+                       argsp->obj.vchunkhdr = VERBOSE_DEFAULT;
+                       rangesp = &argsp->obj.chunk_ranges;
+                       break;
+               case 'H':
+                       argsp->obj.vheap = VERBOSE_DEFAULT;
+                       break;
+               case 'T':
+                       argsp->obj.chunk_types = 0;
+                       if (util_parse_chunk_types(optarg,
+                                       &argsp->obj.chunk_types) ||
+                               (argsp->obj.chunk_types &
+                               (1 << CHUNK_TYPE_UNKNOWN))) {
+                               outv_err("'%s' -- cannot parse chunk type(s)\n",
+                                               optarg);
+                               return -1;
+                       }
+                       break;
+               case 'o':
+                       argsp->obj.vroot = VERBOSE_DEFAULT;
+                       break;
+               case 't':
+                       if (util_parse_ranges(optarg,
+                               &argsp->obj.type_ranges, ENTIRE_UINT64)) {
+                               outv_err("'%s' -- cannot parse range(s)\n",
+                                               optarg);
+                               return -1;
+                       }
+                       break;
+               case 'b':
+                       argsp->obj.vbitmap = VERBOSE_DEFAULT;
+                       break;
+               case 'p':
+               {
+                       char *endptr;
+                       int olderrno = errno;
+                       errno = 0;
+                       long long ll = strtoll(optarg, &endptr, 10);
+                       if ((endptr && *endptr != '\0') || errno) {
+                               outv_err("'%s' -- invalid replica number",
+                                               optarg);
+                               return -1;
+                       }
+                       errno = olderrno;
+                       argsp->obj.replica = (size_t)ll;
+                       break;
+               }
+               default:
+                       print_usage(appname);
+                       return -1;
+               }
+       }
+
+       if (optind < argc) {
+               argsp->file = argv[optind];
+       } else {
+               print_usage(appname);
+               return -1;
+       }
+
+       if (!argsp->use_range)
+               util_ranges_add(&argsp->ranges, ENTIRE_UINT64);
+
+       if (util_ranges_empty(&argsp->obj.type_ranges))
+               util_ranges_add(&argsp->obj.type_ranges, ENTIRE_UINT64);
+
+       if (util_ranges_empty(&argsp->obj.lane_ranges))
+               util_ranges_add(&argsp->obj.lane_ranges, ENTIRE_UINT64);
+
+       if (util_ranges_empty(&argsp->obj.zone_ranges))
+               util_ranges_add(&argsp->obj.zone_ranges, ENTIRE_UINT64);
+
+       if (util_ranges_empty(&argsp->obj.chunk_ranges))
+               util_ranges_add(&argsp->obj.chunk_ranges, ENTIRE_UINT64);
+
+       return 0;
+}
+
+/*
+ * pmempool_info_read -- read data from file
+ */
+int
+pmempool_info_read(struct pmem_info *pip, void *buff, size_t nbytes,
+               uint64_t off)
+{
+       return pool_set_file_read(pip->pfile, buff, nbytes, off);
+}
+
+/*
+ * pmempool_info_badblocks -- (internal) prints info about file badblocks
+ */
+static int
+pmempool_info_badblocks(struct pmem_info *pip, const char *file_name, int v)
+{
+       int ret;
+
+       if (pip->args.badblocks != PRINT_BAD_BLOCKS_YES)
+               return 0;
+
+       struct badblocks *bbs = badblocks_new();
+       if (bbs == NULL)
+               return -1;
+
+       ret = badblocks_get(file_name, bbs);
+       if (ret) {
+               if (errno == ENOTSUP) {
+                       outv(v, BB_NOT_SUPP "\n");
+                       ret = -1;
+                       goto exit_free;
+               }
+
+               outv_err("checking bad blocks failed -- '%s'", file_name);
+               goto exit_free;
+       }
+
+       if (bbs->bb_cnt == 0 || bbs->bbv == NULL)
+               goto exit_free;
+
+       outv(v, "bad blocks:\n");
+       outv(v, "\toffset\t\tlength\n");
+
+       unsigned b;
+       for (b = 0; b < bbs->bb_cnt; b++) {
+               outv(v, "\t%zu\t\t%zu\n",
+                       B2SEC(bbs->bbv[b].offset),
+                       B2SEC(bbs->bbv[b].length));
+       }
+
+exit_free:
+       badblocks_delete(bbs);
+
+       return ret;
+}
+
+/*
+ * pmempool_info_part -- (internal) print info about poolset part
+ */
+static int
+pmempool_info_part(struct pmem_info *pip, unsigned repn, unsigned partn, int v)
+{
+       /* get path of the part file */
+       const char *path = NULL;
+       if (repn != UNDEF_REPLICA && partn != UNDEF_PART) {
+               outv(v, "part %u:\n", partn);
+               struct pool_set_part *part =
+                       &pip->pfile->poolset->replica[repn]->part[partn];
+               path = part->path;
+       } else {
+               outv(v, "Part file:\n");
+               path = pip->file_name;
+       }
+       outv_field(v, "path", "%s", path);
+
+       enum file_type type = util_file_get_type(path);
+       if (type < 0)
+               return -1;
+
+       const char *type_str = type == TYPE_DEVDAX ? "device dax" :
+                               "regular file";
+       outv_field(v, "type", "%s", type_str);
+
+       /* get size of the part file */
+       ssize_t size = util_file_get_size(path);
+       if (size < 0) {
+               outv_err("couldn't get size of %s", path);
+               return -1;
+       }
+       outv_field(v, "size", "%s", out_get_size_str((size_t)size,
+                       pip->args.human));
+
+       /* get alignment of device dax */
+       if (type == TYPE_DEVDAX) {
+               size_t alignment = util_file_device_dax_alignment(path);
+               outv_field(v, "alignment", "%s", out_get_size_str(alignment,
+                               pip->args.human));
+       }
+
+       /* look for bad blocks */
+       if (pmempool_info_badblocks(pip, path, VERBOSE_DEFAULT)) {
+               outv_err("Unable to retrieve badblock info");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_info_directory -- (internal) print information about directory
+ */
+static void
+pmempool_info_directory(struct pool_set_directory *d,
+       int v)
+{
+       outv(v, "Directory %s:\n", d->path);
+       outv_field(v, "reservation size", "%lu", d->resvsize);
+}
+
+/*
+ * pmempool_info_replica -- (internal) print info about replica
+ */
+static int
+pmempool_info_replica(struct pmem_info *pip, unsigned repn, int v)
+{
+       struct pool_replica *rep = pip->pfile->poolset->replica[repn];
+       outv(v, "Replica %u%s - %s", repn,
+               repn == 0 ? " (master)" : "",
+               rep->remote == NULL ? "local" : "remote");
+
+       if (rep->remote) {
+               outv(v, ":\n");
+               outv_field(v, "node", "%s", rep->remote->node_addr);
+               outv_field(v, "pool set", "%s", rep->remote->pool_desc);
+
+               return 0;
+       }
+
+       outv(v, ", %u part(s):\n", rep->nparts);
+       for (unsigned p = 0; p < rep->nparts; ++p) {
+               if (pmempool_info_part(pip, repn, p, v))
+                       return -1;
+       }
+
+       if (pip->pfile->poolset->directory_based) {
+               size_t nd = VEC_SIZE(&rep->directory);
+               outv(v, "%lu %s:\n", nd, nd == 1 ? "Directory" : "Directories");
+               struct pool_set_directory *d;
+               VEC_FOREACH_BY_PTR(d, &rep->directory) {
+                       pmempool_info_directory(d, v);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_info_poolset -- (internal) print info about poolset structure
+ */
+static int
+pmempool_info_poolset(struct pmem_info *pip, int v)
+{
+       ASSERTeq(pip->params.is_poolset, 1);
+       if (pip->pfile->poolset->directory_based)
+               outv(v, "Directory-based Poolset structure:\n");
+       else
+               outv(v, "Poolset structure:\n");
+
+       outv_field(v, "Number of replicas", "%u",
+                       pip->pfile->poolset->nreplicas);
+       for (unsigned r = 0; r < pip->pfile->poolset->nreplicas; ++r) {
+               if (pmempool_info_replica(pip, r, v))
+                       return -1;
+       }
+
+       if (pip->pfile->poolset->options > 0) {
+               outv_title(v, "Poolset options");
+               if (pip->pfile->poolset->options & OPTION_SINGLEHDR)
+                       outv(v, "%s", "SINGLEHDR\n");
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_info_pool_hdr -- (internal) print pool header information
+ */
+static int
+pmempool_info_pool_hdr(struct pmem_info *pip, int v)
+{
+       static const char *alignment_desc_str[] = {
+               "  char",
+               "  short",
+               "  int",
+               "  long",
+               "  long long",
+               "  size_t",
+               "  os_off_t",
+               "  float",
+               "  double",
+               "  long double",
+               "  void *",
+       };
+       static const size_t alignment_desc_n =
+               sizeof(alignment_desc_str) / sizeof(alignment_desc_str[0]);
+
+       int ret = 0;
+       struct pool_hdr *hdr = malloc(sizeof(struct pool_hdr));
+       if (!hdr)
+               err(1, "Cannot allocate memory for pool_hdr");
+
+       if (pmempool_info_read(pip, hdr, sizeof(*hdr), 0)) {
+               outv_err("cannot read pool header\n");
+               free(hdr);
+               return -1;
+       }
+
+       struct arch_flags arch_flags;
+       util_get_arch_flags(&arch_flags);
+
+       outv_title(v, "POOL Header");
+       outv_hexdump(pip->args.vhdrdump, hdr, sizeof(*hdr), 0, 1);
+
+       util_convert2h_hdr_nocheck(hdr);
+
+       outv_field(v, "Signature", "%.*s%s", POOL_HDR_SIG_LEN,
+                       hdr->signature,
+                       pip->params.is_part ?
+                       " [part file]" : "");
+       outv_field(v, "Major", "%d", hdr->major);
+       outv_field(v, "Mandatory features", "%s",
+                       out_get_incompat_features_str(hdr->features.incompat));
+       outv_field(v, "Not mandatory features", "0x%x", hdr->features.compat);
+       outv_field(v, "Forced RO", "0x%x", hdr->features.ro_compat);
+       outv_field(v, "Pool set UUID", "%s",
+                               out_get_uuid_str(hdr->poolset_uuid));
+       outv_field(v, "UUID", "%s", out_get_uuid_str(hdr->uuid));
+       outv_field(v, "Previous part UUID", "%s",
+                               out_get_uuid_str(hdr->prev_part_uuid));
+       outv_field(v, "Next part UUID", "%s",
+                               out_get_uuid_str(hdr->next_part_uuid));
+       outv_field(v, "Previous replica UUID", "%s",
+                               out_get_uuid_str(hdr->prev_repl_uuid));
+       outv_field(v, "Next replica UUID", "%s",
+                               out_get_uuid_str(hdr->next_repl_uuid));
+       outv_field(v, "Creation Time", "%s",
+                       out_get_time_str((time_t)hdr->crtime));
+
+       uint64_t ad = hdr->arch_flags.alignment_desc;
+       uint64_t cur_ad = arch_flags.alignment_desc;
+
+       outv_field(v, "Alignment Descriptor", "%s",
+                       out_get_alignment_desc_str(ad, cur_ad));
+
+       for (size_t i = 0; i < alignment_desc_n; i++) {
+               uint64_t a = GET_ALIGNMENT(ad, i);
+               if (ad == cur_ad) {
+                       outv_field(v + 1, alignment_desc_str[i],
+                                       "%2lu", a);
+               } else {
+                       uint64_t av = GET_ALIGNMENT(cur_ad, i);
+                       if (a == av) {
+                               outv_field(v + 1, alignment_desc_str[i],
+                                       "%2lu [OK]", a);
+                       } else {
+                               outv_field(v + 1, alignment_desc_str[i],
+                                       "%2lu [wrong! should be %2lu]", a, av);
+                       }
+               }
+       }
+
+       outv_field(v, "Class", "%s",
+                       out_get_arch_machine_class_str(
+                               hdr->arch_flags.machine_class));
+       outv_field(v, "Data", "%s",
+                       out_get_arch_data_str(hdr->arch_flags.data));
+       outv_field(v, "Machine", "%s",
+                       out_get_arch_machine_str(hdr->arch_flags.machine));
+       outv_field(v, "Last shutdown", "%s",
+                       out_get_last_shutdown_str(hdr->sds.dirty));
+       outv_field(v, "Checksum", "%s", out_get_checksum(hdr, sizeof(*hdr),
+                       &hdr->checksum, POOL_HDR_CSUM_END_OFF(hdr)));
+
+       free(hdr);
+
+       return ret;
+}
+
+/*
+ * pmempool_info_file -- print info about single file
+ */
+static int
+pmempool_info_file(struct pmem_info *pip, const char *file_name)
+{
+       int ret = 0;
+
+       pip->file_name = file_name;
+
+       /*
+        * If force flag is set 'types' fields _must_ hold
+        * single pool type - this is validated when processing
+        * command line arguments.
+        */
+       if (pip->args.force) {
+               pip->type = pip->args.type;
+       } else {
+               if (pmem_pool_parse_params(file_name, &pip->params, 1)) {
+                       if (errno)
+                               perror(file_name);
+                       else
+                               outv_err("%s: cannot determine type of pool\n",
+                                       file_name);
+                       return -1;
+               }
+
+               pip->type = pip->params.type;
+       }
+
+       if (PMEM_POOL_TYPE_UNKNOWN == pip->type) {
+               outv_err("%s: unknown pool type -- '%s'\n", file_name,
+                               pip->params.signature);
+               return -1;
+       } else if (!pip->args.force && !pip->params.is_checksum_ok) {
+               outv_err("%s: invalid checksum\n", file_name);
+               return -1;
+       } else {
+               if (util_options_verify(pip->opts, pip->type))
+                       return -1;
+
+               pip->pfile = pool_set_file_open(file_name, 0, !pip->args.force);
+               if (!pip->pfile) {
+                       perror(file_name);
+                       return -1;
+               }
+
+               /* check if we should check and print bad blocks */
+               if (pip->args.badblocks == PRINT_BAD_BLOCKS_NOT_SET) {
+                       struct pool_hdr hdr;
+                       if (pmempool_info_read(pip, &hdr, sizeof(hdr), 0)) {
+                               outv_err("cannot read pool header\n");
+                               goto out_close;
+                       }
+                       util_convert2h_hdr_nocheck(&hdr);
+                       if (hdr.features.compat & POOL_FEAT_CHECK_BAD_BLOCKS)
+                               pip->args.badblocks = PRINT_BAD_BLOCKS_YES;
+                       else
+                               pip->args.badblocks = PRINT_BAD_BLOCKS_NO;
+               }
+
+               if (pip->type != PMEM_POOL_TYPE_BTT) {
+                       struct pool_set *ps = pip->pfile->poolset;
+                       for (unsigned r = 0; r < ps->nreplicas; ++r) {
+                               if (ps->replica[r]->remote == NULL &&
+                                       mprotect(ps->replica[r]->part[0].addr,
+                                       ps->replica[r]->repsize,
+                                       PROT_READ) < 0) {
+                                       outv_err(
+                                       "%s: failed to change pool protection",
+                                       pip->pfile->fname);
+
+                                       ret = -1;
+                                       goto out_close;
+                               }
+                       }
+               }
+
+               if (pip->args.obj.replica) {
+                       size_t nreplicas = pool_set_file_nreplicas(pip->pfile);
+                       if (nreplicas == 1) {
+                               outv_err("only master replica available");
+                               ret = -1;
+                               goto out_close;
+                       }
+
+                       if (pip->args.obj.replica >= nreplicas) {
+                               outv_err("replica number out of range"
+                                       " (valid range is: 0-%" PRIu64 ")",
+                                       nreplicas - 1);
+                               ret = -1;
+                               goto out_close;
+                       }
+
+                       if (pool_set_file_set_replica(pip->pfile,
+                               pip->args.obj.replica)) {
+                               outv_err("setting replica number failed");
+                               ret = -1;
+                               goto out_close;
+                       }
+               }
+
+               /* hdr info is not present in btt device */
+               if (pip->type != PMEM_POOL_TYPE_BTT) {
+                       if (pip->params.is_poolset &&
+                                       pmempool_info_poolset(pip,
+                                                       VERBOSE_DEFAULT)) {
+                               ret = -1;
+                               goto out_close;
+                       }
+                       if (!pip->params.is_poolset &&
+                                       pmempool_info_part(pip, UNDEF_REPLICA,
+                                               UNDEF_PART, VERBOSE_DEFAULT)) {
+                               ret = -1;
+                               goto out_close;
+                       }
+                       if (pmempool_info_pool_hdr(pip, VERBOSE_DEFAULT)) {
+                               ret = -1;
+                               goto out_close;
+                       }
+               }
+
+               if (pip->params.is_part) {
+                       ret = 0;
+                       goto out_close;
+               }
+
+               switch (pip->type) {
+               case PMEM_POOL_TYPE_LOG:
+                       ret = pmempool_info_log(pip);
+                       break;
+               case PMEM_POOL_TYPE_BLK:
+                       ret = pmempool_info_blk(pip);
+                       break;
+               case PMEM_POOL_TYPE_OBJ:
+                       ret = pmempool_info_obj(pip);
+                       break;
+               case PMEM_POOL_TYPE_BTT:
+                       ret = pmempool_info_btt(pip);
+                       break;
+               case PMEM_POOL_TYPE_UNKNOWN:
+               default:
+                       ret = -1;
+                       break;
+               }
+out_close:
+               pool_set_file_close(pip->pfile);
+       }
+
+       return ret;
+}
+
+/*
+ * pmempool_info_alloc -- allocate pmem info context
+ */
+static struct pmem_info *
+pmempool_info_alloc(void)
+{
+       struct pmem_info *pip = malloc(sizeof(struct pmem_info));
+       if (!pip)
+               err(1, "Cannot allocate memory for pmempool info context");
+
+       if (pip) {
+               memset(pip, 0, sizeof(*pip));
+
+               /* set default command line parameters */
+               memcpy(&pip->args, &pmempool_info_args_default,
+                               sizeof(pip->args));
+               pip->opts = util_options_alloc(long_options,
+                               sizeof(long_options) /
+                               sizeof(long_options[0]),
+                               option_requirements);
+
+               PMDK_LIST_INIT(&pip->args.ranges.head);
+               PMDK_LIST_INIT(&pip->args.obj.type_ranges.head);
+               PMDK_LIST_INIT(&pip->args.obj.lane_ranges.head);
+               PMDK_LIST_INIT(&pip->args.obj.zone_ranges.head);
+               PMDK_LIST_INIT(&pip->args.obj.chunk_ranges.head);
+               PMDK_TAILQ_INIT(&pip->obj.stats.type_stats);
+       }
+
+       return pip;
+}
+
+/*
+ * pmempool_info_free -- free pmem info context
+ */
+static void
+pmempool_info_free(struct pmem_info *pip)
+{
+       if (pip->obj.stats.zone_stats) {
+               for (uint64_t i = 0; i < pip->obj.stats.n_zones; ++i)
+                       VEC_DELETE(&pip->obj.stats.zone_stats[i].class_stats);
+
+               free(pip->obj.stats.zone_stats);
+       }
+       util_options_free(pip->opts);
+       util_ranges_clear(&pip->args.ranges);
+       util_ranges_clear(&pip->args.obj.type_ranges);
+       util_ranges_clear(&pip->args.obj.zone_ranges);
+       util_ranges_clear(&pip->args.obj.chunk_ranges);
+       util_ranges_clear(&pip->args.obj.lane_ranges);
+
+       while (!PMDK_TAILQ_EMPTY(&pip->obj.stats.type_stats)) {
+               struct pmem_obj_type_stats *type =
+                       PMDK_TAILQ_FIRST(&pip->obj.stats.type_stats);
+               PMDK_TAILQ_REMOVE(&pip->obj.stats.type_stats, type, next);
+               free(type);
+       }
+
+       free(pip);
+}
+
+int
+pmempool_info_func(const char *appname, int argc, char *argv[])
+{
+       int ret = 0;
+       struct pmem_info *pip = pmempool_info_alloc();
+
+       /* read command line arguments */
+       if ((ret = parse_args(appname, argc, argv, &pip->args,
+                                       pip->opts)) == 0) {
+               /* set some output format values */
+               out_set_vlevel(pip->args.vlevel);
+               out_set_col_width(pip->args.col_width);
+
+               ret = pmempool_info_file(pip, pip->args.file);
+       }
+
+       pmempool_info_free(pip);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/info.h b/ceph/src/pmdk/src/tools/pmempool/info.h
new file mode 100644 (file)
index 0000000..62c2e83
--- /dev/null
@@ -0,0 +1,166 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * info.h -- pmempool info command header file
+ */
+
+#include "vec.h"
+
+/*
+ * Verbose levels used in application:
+ *
+ * VERBOSE_DEFAULT:
+ * Default value for application's verbosity level.
+ * This is also set for data structures which should be
+ * printed without any command line argument.
+ *
+ * VERBOSE_MAX:
+ * Maximum value for application's verbosity level.
+ * This value is used when -v command line argument passed.
+ *
+ * VERBOSE_SILENT:
+ * This value is higher than VERBOSE_MAX and it is used only
+ * for verbosity levels of data structures which should _not_ be
+ * printed without specified command line arguments.
+ */
+#define VERBOSE_SILENT 0
+#define VERBOSE_DEFAULT        1
+#define VERBOSE_MAX    2
+
+/*
+ * print_bb_e -- printing bad blocks options
+ */
+enum print_bb_e {
+       PRINT_BAD_BLOCKS_NOT_SET,
+       PRINT_BAD_BLOCKS_NO,
+       PRINT_BAD_BLOCKS_YES,
+
+       PRINT_BAD_BLOCKS_MAX
+};
+
+/*
+ * pmempool_info_args -- structure for storing command line arguments
+ */
+struct pmempool_info_args {
+       char *file;             /* input file */
+       unsigned col_width;     /* column width for printing fields */
+       bool human;             /* sizes in human-readable formats */
+       bool force;             /* force parsing pool */
+       enum print_bb_e badblocks; /* print bad blocks */
+       pmem_pool_type_t type;  /* forced pool type */
+       bool use_range;         /* use range for blocks */
+       struct ranges ranges;   /* range of block/chunks to dump */
+       int vlevel;             /* verbosity level */
+       int vdata;              /* verbosity level for data dump */
+       int vhdrdump;           /* verbosity level for headers hexdump */
+       int vstats;             /* verbosity level for statistics */
+       struct {
+               size_t walk;            /* data chunk size */
+       } log;
+       struct {
+               int vmap;       /* verbosity level for BTT Map */
+               int vflog;      /* verbosity level for BTT FLOG */
+               int vbackup;    /* verbosity level for BTT Info backup */
+               bool skip_zeros; /* skip blocks marked with zero flag */
+               bool skip_error; /* skip blocks marked with error flag */
+               bool skip_no_flag; /* skip blocks not marked with any flag */
+       } blk;
+       struct {
+               int vlanes;             /* verbosity level for lanes */
+               int vroot;
+               int vobjects;
+               int valloc;
+               int voobhdr;
+               int vheap;
+               int vzonehdr;
+               int vchunkhdr;
+               int vbitmap;
+               bool lanes_recovery;
+               bool ignore_empty_obj;
+               uint64_t chunk_types;
+               size_t replica;
+               struct ranges lane_ranges;
+               struct ranges type_ranges;
+               struct ranges zone_ranges;
+               struct ranges chunk_ranges;
+       } obj;
+};
+
+/*
+ * pmem_blk_stats -- structure with statistics for pmemblk
+ */
+struct pmem_blk_stats {
+       uint32_t total;         /* number of processed blocks */
+       uint32_t zeros;         /* number of blocks marked by zero flag */
+       uint32_t errors;        /* number of blocks marked by error flag */
+       uint32_t noflag;        /* number of blocks not marked with any flag */
+};
+
+struct pmem_obj_class_stats {
+       uint64_t n_units;
+       uint64_t n_used;
+       uint64_t unit_size;
+       uint64_t alignment;
+       uint32_t nallocs;
+       uint16_t flags;
+};
+
+struct pmem_obj_zone_stats {
+       uint64_t n_chunks;
+       uint64_t n_chunks_type[MAX_CHUNK_TYPE];
+       uint64_t size_chunks;
+       uint64_t size_chunks_type[MAX_CHUNK_TYPE];
+       VEC(, struct pmem_obj_class_stats) class_stats;
+};
+
+struct pmem_obj_type_stats {
+       PMDK_TAILQ_ENTRY(pmem_obj_type_stats) next;
+       uint64_t type_num;
+       uint64_t n_objects;
+       uint64_t n_bytes;
+};
+
+struct pmem_obj_stats {
+       uint64_t n_total_objects;
+       uint64_t n_total_bytes;
+       uint64_t n_zones;
+       uint64_t n_zones_used;
+       struct pmem_obj_zone_stats *zone_stats;
+       PMDK_TAILQ_HEAD(obj_type_stats_head, pmem_obj_type_stats) type_stats;
+};
+
+/*
+ * pmem_info -- context for pmeminfo application
+ */
+struct pmem_info {
+       const char *file_name;  /* current file name */
+       struct pool_set_file *pfile;
+       struct pmempool_info_args args; /* arguments parsed from command line */
+       struct options *opts;
+       struct pool_set *poolset;
+       pmem_pool_type_t type;
+       struct pmem_pool_params params;
+       struct {
+               struct pmem_blk_stats stats;
+       } blk;
+       struct {
+               struct pmemobjpool *pop;
+               struct palloc_heap *heap;
+               struct alloc_class_collection *alloc_classes;
+               size_t size;
+               struct pmem_obj_stats stats;
+               uint64_t uuid_lo;
+               uint64_t objid;
+       } obj;
+};
+
+int pmempool_info_func(const char *appname, int argc, char *argv[]);
+void pmempool_info_help(const char *appname);
+
+int pmempool_info_read(struct pmem_info *pip, void *buff,
+               size_t nbytes, uint64_t off);
+int pmempool_info_blk(struct pmem_info *pip);
+int pmempool_info_log(struct pmem_info *pip);
+int pmempool_info_obj(struct pmem_info *pip);
+int pmempool_info_btt(struct pmem_info *pip);
diff --git a/ceph/src/pmdk/src/tools/pmempool/info_blk.c b/ceph/src/pmdk/src/tools/pmempool/info_blk.c
new file mode 100644 (file)
index 0000000..61d64cc
--- /dev/null
@@ -0,0 +1,567 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * info_blk.c -- pmempool info command source file for blk pool
+ */
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <err.h>
+#include <sys/param.h>
+#include <endian.h>
+
+#include "os.h"
+#include "common.h"
+#include "output.h"
+#include "info.h"
+#include "btt.h"
+
+/*
+ * pmempool_info_get_range -- get blocks/data chunk range
+ *
+ * Get range based on command line arguments and maximum value.
+ * Return value:
+ * 0 - range is empty
+ * 1 - range is not empty
+ */
+static int
+pmempool_info_get_range(struct pmem_info *pip, struct range *rangep,
+               struct range *curp, uint32_t max, uint64_t offset)
+{
+       /* not using range */
+       if (!pip->args.use_range) {
+               rangep->first = 0;
+               rangep->last = max;
+
+               return 1;
+       }
+
+       if (curp->first > offset + max)
+               return 0;
+
+       if (curp->first >= offset)
+               rangep->first = curp->first - offset;
+       else
+               rangep->first = 0;
+
+       if (curp->last < offset)
+               return 0;
+
+       if (curp->last <= offset + max)
+               rangep->last = curp->last - offset;
+       else
+               rangep->last = max;
+
+       return 1;
+}
+
+/*
+ * info_blk_skip_block -- get action type for block/data chunk
+ *
+ * Return value indicating whether processing block/data chunk
+ * should be skipped.
+ *
+ * Return values:
+ *  0 - continue processing
+ *  1 - skip current block
+ */
+static int
+info_blk_skip_block(struct pmem_info *pip, int is_zero,
+               int is_error)
+{
+       if (pip->args.blk.skip_no_flag && !is_zero && !is_error)
+               return 1;
+
+       if (is_zero && pip->args.blk.skip_zeros)
+               return 1;
+
+       if (is_error && pip->args.blk.skip_error)
+               return 1;
+
+       return 0;
+}
+
+/*
+ * info_btt_data -- print block data and corresponding flags from map
+ */
+static int
+info_btt_data(struct pmem_info *pip, int v, struct btt_info *infop,
+               uint64_t arena_off, uint64_t offset, uint64_t *countp)
+{
+       if (!outv_check(v))
+               return 0;
+
+       int ret = 0;
+
+       size_t mapsize = infop->external_nlba * BTT_MAP_ENTRY_SIZE;
+       uint32_t *map = malloc(mapsize);
+       if (!map)
+               err(1, "Cannot allocate memory for BTT map");
+
+       uint8_t *block_buff = malloc(infop->external_lbasize);
+       if (!block_buff)
+               err(1, "Cannot allocate memory for pmemblk block buffer");
+
+       /* read btt map area */
+       if (pmempool_info_read(pip, (uint8_t *)map, mapsize,
+                               arena_off + infop->mapoff)) {
+               outv_err("wrong BTT Map size or offset\n");
+               ret = -1;
+               goto error;
+       }
+
+       uint64_t i;
+       struct range *curp = NULL;
+       struct range range;
+       FOREACH_RANGE(curp, &pip->args.ranges) {
+               if (pmempool_info_get_range(pip, &range, curp,
+                                       infop->external_nlba - 1, offset) == 0)
+                       continue;
+               for (i = range.first; i <= range.last; i++) {
+                       uint32_t map_entry = le32toh(map[i]);
+                       int is_init = (map_entry & ~BTT_MAP_ENTRY_LBA_MASK)
+                               == 0;
+                       int is_zero = (map_entry & ~BTT_MAP_ENTRY_LBA_MASK)
+                               == BTT_MAP_ENTRY_ZERO || is_init;
+                       int is_error = (map_entry & ~BTT_MAP_ENTRY_LBA_MASK)
+                               == BTT_MAP_ENTRY_ERROR;
+
+                       uint64_t blockno = is_init ? i :
+                                       map_entry & BTT_MAP_ENTRY_LBA_MASK;
+
+                       if (info_blk_skip_block(pip,
+                                               is_zero, is_error))
+                               continue;
+
+                       /* compute block's data address */
+                       uint64_t block_off = arena_off + infop->dataoff +
+                               blockno * infop->internal_lbasize;
+
+                       if (pmempool_info_read(pip, block_buff,
+                                       infop->external_lbasize, block_off)) {
+                               outv_err("cannot read %lu block\n", i);
+                               ret = -1;
+                               goto error;
+                       }
+
+                       if (*countp == 0)
+                               outv_title(v, "PMEM BLK blocks data");
+
+                       /*
+                        * Print block number, offset and flags
+                        * from map entry.
+                        */
+                       outv(v, "Block %10lu: offset: %s\n",
+                               offset + i,
+                               out_get_btt_map_entry(map_entry));
+
+                       /* dump block's data */
+                       outv_hexdump(v, block_buff, infop->external_lbasize,
+                                       block_off, 1);
+
+                       *countp = *countp + 1;
+               }
+       }
+error:
+       free(map);
+       free(block_buff);
+       return ret;
+}
+
+/*
+ * info_btt_map -- print all map entries
+ */
+static int
+info_btt_map(struct pmem_info *pip, int v,
+               struct btt_info *infop, uint64_t arena_off,
+               uint64_t offset, uint64_t *count)
+{
+       if (!outv_check(v) && !outv_check(pip->args.vstats))
+               return 0;
+
+       int ret = 0;
+       size_t mapsize = infop->external_nlba * BTT_MAP_ENTRY_SIZE;
+
+       uint32_t *map = malloc(mapsize);
+       if (!map)
+               err(1, "Cannot allocate memory for BTT map");
+
+       /* read btt map area */
+       if (pmempool_info_read(pip, (uint8_t *)map, mapsize,
+                               arena_off + infop->mapoff)) {
+               outv_err("wrong BTT Map size or offset\n");
+               ret = -1;
+               goto error;
+       }
+
+       uint32_t arena_count = 0;
+
+       uint64_t i;
+       struct range *curp = NULL;
+       struct range range;
+       FOREACH_RANGE(curp, &pip->args.ranges) {
+               if (pmempool_info_get_range(pip, &range, curp,
+                                       infop->external_nlba - 1, offset) == 0)
+                       continue;
+               for (i = range.first; i <= range.last; i++) {
+                       uint32_t entry = le32toh(map[i]);
+                       int is_zero = (entry & ~BTT_MAP_ENTRY_LBA_MASK) ==
+                               BTT_MAP_ENTRY_ZERO ||
+                               (entry & ~BTT_MAP_ENTRY_LBA_MASK) == 0;
+                       int is_error = (entry & ~BTT_MAP_ENTRY_LBA_MASK) ==
+                               BTT_MAP_ENTRY_ERROR;
+
+                       if (info_blk_skip_block(pip,
+                                       is_zero, is_error) == 0) {
+                               if (arena_count == 0)
+                                       outv_title(v, "PMEM BLK BTT Map");
+
+                               if (is_zero)
+                                       pip->blk.stats.zeros++;
+                               if (is_error)
+                                       pip->blk.stats.errors++;
+                               if (!is_zero && !is_error)
+                                       pip->blk.stats.noflag++;
+
+                               pip->blk.stats.total++;
+
+                               arena_count++;
+                               (*count)++;
+
+                               outv(v, "%010lu: %s\n", offset + i,
+                                       out_get_btt_map_entry(entry));
+                       }
+               }
+       }
+error:
+       free(map);
+       return ret;
+}
+
+/*
+ * info_btt_flog -- print all flog entries
+ */
+static int
+info_btt_flog(struct pmem_info *pip, int v,
+               struct btt_info *infop, uint64_t arena_off)
+{
+       if (!outv_check(v))
+               return 0;
+
+       int ret = 0;
+       struct btt_flog *flogp = NULL;
+       struct btt_flog *flogpp = NULL;
+       uint64_t flog_size = infop->nfree *
+               roundup(2 * sizeof(struct btt_flog), BTT_FLOG_PAIR_ALIGN);
+       flog_size = roundup(flog_size, BTT_ALIGNMENT);
+       uint8_t *buff = malloc(flog_size);
+       if (!buff)
+               err(1, "Cannot allocate memory for FLOG entries");
+
+       if (pmempool_info_read(pip, buff, flog_size,
+                               arena_off + infop->flogoff)) {
+               outv_err("cannot read BTT FLOG");
+               ret = -1;
+               goto error;
+       }
+
+       outv_title(v, "PMEM BLK BTT FLOG");
+
+       uint8_t *ptr = buff;
+       uint32_t i;
+       for (i = 0; i < infop->nfree; i++) {
+               flogp = (struct btt_flog *)ptr;
+               flogpp = flogp + 1;
+
+               btt_flog_convert2h(flogp);
+               btt_flog_convert2h(flogpp);
+
+               outv(v, "%010d:\n", i);
+               outv_field(v, "LBA", "0x%08x", flogp->lba);
+               outv_field(v, "Old map", "0x%08x: %s", flogp->old_map,
+                       out_get_btt_map_entry(flogp->old_map));
+               outv_field(v, "New map", "0x%08x: %s", flogp->new_map,
+                       out_get_btt_map_entry(flogp->new_map));
+               outv_field(v, "Seq", "0x%x", flogp->seq);
+
+               outv_field(v, "LBA'", "0x%08x", flogpp->lba);
+               outv_field(v, "Old map'", "0x%08x: %s", flogpp->old_map,
+                       out_get_btt_map_entry(flogpp->old_map));
+               outv_field(v, "New map'", "0x%08x: %s", flogpp->new_map,
+                       out_get_btt_map_entry(flogpp->new_map));
+               outv_field(v, "Seq'", "0x%x", flogpp->seq);
+
+               ptr += BTT_FLOG_PAIR_ALIGN;
+       }
+error:
+       free(buff);
+       return ret;
+}
+
+/*
+ * info_btt_stats -- print btt related statistics
+ */
+static void
+info_btt_stats(struct pmem_info *pip, int v)
+{
+       if (pip->blk.stats.total > 0) {
+               outv_title(v, "PMEM BLK Statistics");
+               double perc_zeros = (double)pip->blk.stats.zeros /
+                       (double)pip->blk.stats.total * 100.0;
+               double perc_errors = (double)pip->blk.stats.errors /
+                       (double)pip->blk.stats.total * 100.0;
+               double perc_noflag = (double)pip->blk.stats.noflag /
+                       (double)pip->blk.stats.total * 100.0;
+
+               outv_field(v, "Total blocks", "%u", pip->blk.stats.total);
+               outv_field(v, "Zeroed blocks", "%u [%s]", pip->blk.stats.zeros,
+                               out_get_percentage(perc_zeros));
+               outv_field(v, "Error blocks", "%u [%s]", pip->blk.stats.errors,
+                               out_get_percentage(perc_errors));
+               outv_field(v, "Blocks without flag", "%u [%s]",
+                               pip->blk.stats.noflag,
+                               out_get_percentage(perc_noflag));
+       }
+}
+
+/*
+ * info_btt_info -- print btt_info structure fields
+ */
+static int
+info_btt_info(struct pmem_info *pip, int v, struct btt_info *infop)
+{
+       outv_field(v, "Signature", "%.*s", BTTINFO_SIG_LEN, infop->sig);
+
+       outv_field(v, "UUID of container", "%s",
+                       out_get_uuid_str(infop->parent_uuid));
+
+       outv_field(v, "Flags", "0x%x", infop->flags);
+       outv_field(v, "Major", "%d", infop->major);
+       outv_field(v, "Minor", "%d", infop->minor);
+       outv_field(v, "External LBA size", "%s",
+                       out_get_size_str(infop->external_lbasize,
+                               pip->args.human));
+       outv_field(v, "External LBA count", "%u", infop->external_nlba);
+       outv_field(v, "Internal LBA size", "%s",
+                       out_get_size_str(infop->internal_lbasize,
+                               pip->args.human));
+       outv_field(v, "Internal LBA count", "%u", infop->internal_nlba);
+       outv_field(v, "Free blocks", "%u", infop->nfree);
+       outv_field(v, "Info block size", "%s",
+               out_get_size_str(infop->infosize, pip->args.human));
+       outv_field(v, "Next arena offset", "0x%lx", infop->nextoff);
+       outv_field(v, "Arena data offset", "0x%lx", infop->dataoff);
+       outv_field(v, "Area map offset", "0x%lx", infop->mapoff);
+       outv_field(v, "Area flog offset", "0x%lx", infop->flogoff);
+       outv_field(v, "Info block backup offset", "0x%lx", infop->infooff);
+       outv_field(v, "Checksum", "%s", out_get_checksum(infop,
+                       sizeof(*infop), &infop->checksum, 0));
+
+       return 0;
+}
+
+/*
+ * info_btt_layout -- print information about BTT layout
+ */
+static int
+info_btt_layout(struct pmem_info *pip, os_off_t btt_off)
+{
+       int ret = 0;
+
+       if (btt_off <= 0) {
+               outv_err("wrong BTT layout offset\n");
+               return -1;
+       }
+
+       struct btt_info *infop = NULL;
+
+       infop = malloc(sizeof(struct btt_info));
+       if (!infop)
+               err(1, "Cannot allocate memory for BTT Info structure");
+
+       int narena = 0;
+       uint64_t cur_lba = 0;
+       uint64_t count_data = 0;
+       uint64_t count_map = 0;
+       uint64_t offset = (uint64_t)btt_off;
+       uint64_t nextoff = 0;
+
+       do {
+               /* read btt info area */
+               if (pmempool_info_read(pip, infop, sizeof(*infop), offset)) {
+                       ret = -1;
+                       outv_err("cannot read BTT Info header\n");
+                       goto err;
+               }
+
+               if (util_check_memory((uint8_t *)infop,
+                                       sizeof(*infop), 0) == 0) {
+                       outv(1, "\n<No BTT layout>\n");
+                       break;
+               }
+
+               outv(1, "\n[ARENA %d]", narena);
+               outv_title(1, "PMEM BLK BTT Info Header");
+               outv_hexdump(pip->args.vhdrdump, infop,
+                               sizeof(*infop), offset, 1);
+
+               btt_info_convert2h(infop);
+
+               nextoff = infop->nextoff;
+
+               /* print btt info fields */
+               if (info_btt_info(pip, 1, infop)) {
+                       ret = -1;
+                       goto err;
+               }
+
+               /* dump blocks data */
+               if (info_btt_data(pip, pip->args.vdata,
+                                       infop, offset, cur_lba, &count_data)) {
+                       ret = -1;
+                       goto err;
+               }
+
+               /* print btt map entries and get statistics */
+               if (info_btt_map(pip, pip->args.blk.vmap, infop,
+                                       offset, cur_lba, &count_map)) {
+                       ret = -1;
+                       goto err;
+               }
+
+               /* print flog entries */
+               if (info_btt_flog(pip, pip->args.blk.vflog, infop,
+                                       offset)) {
+                       ret = -1;
+                       goto err;
+               }
+
+               /* increment LBA's counter before reading info backup */
+               cur_lba += infop->external_nlba;
+
+               /* read btt info backup area */
+               if (pmempool_info_read(pip, infop, sizeof(*infop),
+                       offset + infop->infooff)) {
+                       outv_err("wrong BTT Info Backup size or offset\n");
+                       ret = -1;
+                       goto err;
+               }
+
+               outv_title(pip->args.blk.vbackup,
+                               "PMEM BLK BTT Info Header Backup");
+               if (outv_check(pip->args.blk.vbackup))
+                       outv_hexdump(pip->args.vhdrdump, infop,
+                               sizeof(*infop),
+                               offset + infop->infooff, 1);
+
+               btt_info_convert2h(infop);
+               info_btt_info(pip, pip->args.blk.vbackup, infop);
+
+               offset += nextoff;
+               narena++;
+
+       } while (nextoff > 0);
+
+       info_btt_stats(pip, pip->args.vstats);
+
+err:
+       if (infop)
+               free(infop);
+
+       return ret;
+}
+
+/*
+ * info_blk_descriptor -- print pmemblk descriptor
+ */
+static void
+info_blk_descriptor(struct pmem_info *pip, int v, struct pmemblk *pbp)
+{
+       size_t pmemblk_size;
+
+#ifdef DEBUG
+       pmemblk_size = offsetof(struct pmemblk, write_lock);
+#else
+       pmemblk_size = sizeof(*pbp);
+#endif
+
+       outv_title(v, "PMEM BLK Header");
+       /* dump pmemblk header without pool_hdr */
+       outv_hexdump(pip->args.vhdrdump, (uint8_t *)pbp + sizeof(pbp->hdr),
+               pmemblk_size - sizeof(pbp->hdr), sizeof(pbp->hdr), 1);
+       outv_field(v, "Block size", "%s",
+                       out_get_size_str(pbp->bsize, pip->args.human));
+       outv_field(v, "Is zeroed", pbp->is_zeroed ? "true" : "false");
+}
+
+/*
+ * pmempool_info_blk -- print information about block type pool
+ */
+int
+pmempool_info_blk(struct pmem_info *pip)
+{
+       int ret;
+       struct pmemblk *pbp = malloc(sizeof(struct pmemblk));
+       if (!pbp)
+               err(1, "Cannot allocate memory for pmemblk structure");
+
+       if (pmempool_info_read(pip, pbp, sizeof(struct pmemblk), 0)) {
+               outv_err("cannot read pmemblk header\n");
+               free(pbp);
+               return -1;
+       }
+
+       info_blk_descriptor(pip, VERBOSE_DEFAULT, pbp);
+
+       ssize_t btt_off = (char *)pbp->data - (char *)pbp->addr;
+       ret = info_btt_layout(pip, btt_off);
+
+       free(pbp);
+
+       return ret;
+}
+
+/*
+ * pmempool_info_btt -- print information about btt device
+ */
+int
+pmempool_info_btt(struct pmem_info *pip)
+{
+       int ret;
+       outv(1, "\nBTT Device");
+       ret = info_btt_layout(pip, DEFAULT_HDR_SIZE);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/info_log.c b/ceph/src/pmdk/src/tools/pmempool/info_log.c
new file mode 100644 (file)
index 0000000..8345e4a
--- /dev/null
@@ -0,0 +1,160 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * info_log.c -- pmempool info command source file for log pool
+ */
+#include <stdbool.h>
+#include <stdlib.h>
+#include <err.h>
+#include <sys/mman.h>
+
+#include "common.h"
+#include "output.h"
+#include "info.h"
+
+/*
+ * info_log_data -- print used data from log pool
+ */
+static int
+info_log_data(struct pmem_info *pip, int v, struct pmemlog *plp)
+{
+       if (!outv_check(v))
+               return 0;
+
+       uint64_t size_used = plp->write_offset - plp->start_offset;
+
+       if (size_used == 0)
+               return 0;
+
+       uint8_t *addr = pool_set_file_map(pip->pfile, plp->start_offset);
+       if (addr == MAP_FAILED) {
+               warn("%s", pip->file_name);
+               outv_err("cannot read pmem log data\n");
+               return -1;
+       }
+
+       if (pip->args.log.walk == 0) {
+               outv_title(v, "PMEMLOG data");
+               struct range *curp = NULL;
+               PMDK_LIST_FOREACH(curp, &pip->args.ranges.head, next) {
+                       uint8_t *ptr = addr + curp->first;
+                       if (curp->last >= size_used)
+                               curp->last = size_used - 1;
+                       uint64_t count = curp->last - curp->first + 1;
+                       outv_hexdump(v, ptr, count, curp->first +
+                                       plp->start_offset, 1);
+                       size_used -= count;
+                       if (!size_used)
+                               break;
+               }
+       } else {
+
+               /*
+                * Walk through used data with fixed chunk size
+                * passed by user.
+                */
+               uint64_t nchunks = size_used / pip->args.log.walk;
+
+               outv_title(v, "PMEMLOG data [chunks: total = %lu size = %ld]",
+                               nchunks, pip->args.log.walk);
+
+               struct range *curp = NULL;
+               PMDK_LIST_FOREACH(curp, &pip->args.ranges.head, next) {
+                       uint64_t i;
+                       for (i = curp->first; i <= curp->last &&
+                                       i < nchunks; i++) {
+                               outv(v, "Chunk %10lu:\n", i);
+                               outv_hexdump(v, addr + i * pip->args.log.walk,
+                                       pip->args.log.walk,
+                                       plp->start_offset +
+                                       i * pip->args.log.walk,
+                                       1);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * info_logs_stats -- print log type pool statistics
+ */
+static void
+info_log_stats(struct pmem_info *pip, int v, struct pmemlog *plp)
+{
+       uint64_t size_total = plp->end_offset - plp->start_offset;
+       uint64_t size_used = plp->write_offset - plp->start_offset;
+       uint64_t size_avail = size_total - size_used;
+
+       if (size_total == 0)
+               return;
+
+       double perc_used = (double)size_used / (double)size_total * 100.0;
+       double perc_avail =  100.0 - perc_used;
+
+       outv_title(v, "PMEM LOG Statistics");
+       outv_field(v, "Total", "%s",
+                       out_get_size_str(size_total, pip->args.human));
+       outv_field(v, "Available", "%s [%s]",
+                       out_get_size_str(size_avail, pip->args.human),
+                       out_get_percentage(perc_avail));
+       outv_field(v, "Used", "%s [%s]",
+                       out_get_size_str(size_used, pip->args.human),
+                       out_get_percentage(perc_used));
+
+}
+
+/*
+ * info_log_descriptor -- print pmemlog descriptor and return 1 if
+ * write offset is valid
+ */
+static int
+info_log_descriptor(struct pmem_info *pip, int v, struct pmemlog *plp)
+{
+       outv_title(v, "PMEM LOG Header");
+
+       /* dump pmemlog header without pool_hdr */
+       outv_hexdump(pip->args.vhdrdump, (uint8_t *)plp + sizeof(plp->hdr),
+                       sizeof(*plp) - sizeof(plp->hdr),
+                       sizeof(plp->hdr), 1);
+
+       log_convert2h(plp);
+
+       int write_offset_valid = plp->write_offset >= plp->start_offset &&
+                               plp->write_offset <= plp->end_offset;
+       outv_field(v, "Start offset", "0x%lx", plp->start_offset);
+       outv_field(v, "Write offset", "0x%lx [%s]", plp->write_offset,
+                       write_offset_valid ? "OK":"ERROR");
+       outv_field(v, "End offset", "0x%lx", plp->end_offset);
+
+       return write_offset_valid;
+}
+
+/*
+ * pmempool_info_log -- print information about log type pool
+ */
+int
+pmempool_info_log(struct pmem_info *pip)
+{
+       int ret = 0;
+
+       struct pmemlog *plp = malloc(sizeof(struct pmemlog));
+       if (!plp)
+               err(1, "Cannot allocate memory for pmemlog structure");
+
+       if (pmempool_info_read(pip, plp, sizeof(struct pmemlog), 0)) {
+               outv_err("cannot read pmemlog header\n");
+               free(plp);
+               return -1;
+       }
+
+       if (info_log_descriptor(pip, VERBOSE_DEFAULT, plp)) {
+               info_log_stats(pip, pip->args.vstats, plp);
+               ret = info_log_data(pip, pip->args.vdata, plp);
+       }
+
+       free(plp);
+
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/info_obj.c b/ceph/src/pmdk/src/tools/pmempool/info_obj.c
new file mode 100644 (file)
index 0000000..6dc13d3
--- /dev/null
@@ -0,0 +1,962 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2019, Intel Corporation */
+
+/*
+ * info_obj.c -- pmempool info command source file for obj pool
+ */
+#include <stdlib.h>
+#include <stdbool.h>
+#include <err.h>
+#include <signal.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <assert.h>
+#include <inttypes.h>
+
+#include "alloc_class.h"
+
+#include "set.h"
+#include "common.h"
+#include "output.h"
+#include "info.h"
+#include "util.h"
+
+#define BITMAP_BUFF_SIZE 1024
+
+#define OFF_TO_PTR(pop, off) ((void *)((uintptr_t)(pop) + (off)))
+
+#define PTR_TO_OFF(pop, ptr) ((uintptr_t)(ptr) - (uintptr_t)(pop))
+
+/*
+ * lane_need_recovery -- return 1 if lane section needs recovery
+ */
+static int
+lane_need_recovery(struct pmem_info *pip, struct lane_layout *lane)
+{
+       return ulog_recovery_needed((struct ulog *)&lane->external, 1) ||
+               ulog_recovery_needed((struct ulog *)&lane->internal, 1) ||
+               ulog_recovery_needed((struct ulog *)&lane->undo, 0);
+}
+
+#define RUN_BITMAP_SEPARATOR_DISTANCE 8
+
+/*
+ * get_bitmap_str -- get bitmap single value string
+ */
+static const char *
+get_bitmap_str(uint64_t val, unsigned values)
+{
+       static char buff[BITMAP_BUFF_SIZE];
+
+       unsigned j = 0;
+       for (unsigned i = 0; i < values && j < BITMAP_BUFF_SIZE - 3; i++) {
+               buff[j++] = ((val & ((uint64_t)1 << i)) ? 'x' : '.');
+               if ((i + 1) % RUN_BITMAP_SEPARATOR_DISTANCE == 0)
+                       buff[j++] = ' ';
+       }
+
+       buff[j] = '\0';
+
+       return buff;
+}
+
+/*
+ * pmem_obj_stats_get_type -- get stats for specified type number
+ */
+static struct pmem_obj_type_stats *
+pmem_obj_stats_get_type(struct pmem_obj_stats *stats, uint64_t type_num)
+{
+       struct pmem_obj_type_stats *type;
+       struct pmem_obj_type_stats *type_dest = NULL;
+       PMDK_TAILQ_FOREACH(type, &stats->type_stats, next) {
+               if (type->type_num == type_num)
+                       return type;
+
+               if (!type_dest && type->type_num > type_num)
+                       type_dest = type;
+       }
+
+       type = calloc(1, sizeof(*type));
+       if (!type) {
+               outv_err("cannot allocate memory for type stats\n");
+               exit(EXIT_FAILURE);
+       }
+
+       type->type_num = type_num;
+       if (type_dest)
+               PMDK_TAILQ_INSERT_BEFORE(type_dest, type, next);
+       else
+               PMDK_TAILQ_INSERT_TAIL(&stats->type_stats, type, next);
+
+       return type;
+}
+
+struct info_obj_redo_args {
+       int v;
+       size_t i;
+       struct pmem_info *pip;
+};
+
+/*
+ * info_obj_redo_entry - print redo log entry info
+ */
+static int
+info_obj_redo_entry(struct ulog_entry_base *e, void *arg,
+       const struct pmem_ops *p_ops)
+{
+       struct info_obj_redo_args *a = arg;
+       struct ulog_entry_val *ev;
+       struct ulog_entry_buf *eb;
+
+       switch (ulog_entry_type(e)) {
+               case ULOG_OPERATION_AND:
+               case ULOG_OPERATION_OR:
+               case ULOG_OPERATION_SET:
+                       ev = (struct ulog_entry_val *)e;
+
+                       outv(a->v, "%010zu: "
+                               "Offset: 0x%016jx "
+                               "Value: 0x%016jx ",
+                               a->i++,
+                               ulog_entry_offset(e),
+                               ev->value);
+                       break;
+               case ULOG_OPERATION_BUF_CPY:
+               case ULOG_OPERATION_BUF_SET:
+                       eb = (struct ulog_entry_buf *)e;
+
+                       outv(a->v, "%010zu: "
+                               "Offset: 0x%016jx "
+                               "Size: %s ",
+                               a->i++,
+                               ulog_entry_offset(e),
+                               out_get_size_str(eb->size,
+                                       a->pip->args.human));
+                       break;
+               default:
+                       ASSERT(0); /* unreachable */
+       }
+
+       return 0;
+}
+
+/*
+ * info_obj_redo -- print ulog log entries
+ */
+static void
+info_obj_ulog(struct pmem_info *pip, int v, struct ulog *ulog,
+       const struct pmem_ops *ops)
+{
+       outv_title(v, "Log entries");
+
+       struct info_obj_redo_args args = {v, 0, pip};
+       ulog_foreach_entry(ulog, info_obj_redo_entry, &args, ops);
+}
+
+/*
+ * info_obj_alloc_hdr -- print allocation header
+ */
+static void
+info_obj_alloc_hdr(struct pmem_info *pip, int v,
+       const struct memory_block *m)
+{
+       outv_title(v, "Allocation Header");
+
+       outv_field(v, "Size", "%s", out_get_size_str(m->m_ops->get_user_size(m),
+                               pip->args.human));
+       outv_field(v, "Extra", "%lu", m->m_ops->get_extra(m));
+       outv_field(v, "Flags", "0x%x", m->m_ops->get_flags(m));
+}
+
+/*
+ * info_obj_object_hdr -- print object headers and data
+ */
+static void
+info_obj_object_hdr(struct pmem_info *pip, int v, int vid,
+       const struct memory_block *m, uint64_t id)
+{
+       struct pmemobjpool *pop = pip->obj.pop;
+
+       void *data = m->m_ops->get_user_data(m);
+
+       outv_nl(vid);
+       outv_field(vid, "Object", "%lu", id);
+       outv_field(vid, "Offset", "0x%016lx", PTR_TO_OFF(pop, data));
+
+       int vahdr = v && pip->args.obj.valloc;
+       int voobh = v && pip->args.obj.voobhdr;
+
+       outv_indent(vahdr || voobh, 1);
+
+       info_obj_alloc_hdr(pip, vahdr, m);
+
+       outv_hexdump(v && pip->args.vdata, data,
+                       m->m_ops->get_real_size(m),
+                       PTR_TO_OFF(pip->obj.pop, data), 1);
+
+       outv_indent(vahdr || voobh, -1);
+
+}
+
+/*
+ * info_obj_lane_section -- print lane's section
+ */
+static void
+info_obj_lane(struct pmem_info *pip, int v, struct lane_layout *lane)
+{
+       struct pmem_ops p_ops;
+       p_ops.base = pip->obj.pop;
+
+       outv_title(v, "Undo Log");
+       outv_indent(v, 1);
+       info_obj_ulog(pip, v, (struct ulog *)&lane->undo, &p_ops);
+       outv_indent(v, -1);
+
+       outv_nl(v);
+       outv_title(v, "Internal Undo Log");
+       outv_indent(v, 1);
+       info_obj_ulog(pip, v, (struct ulog *)&lane->internal, &p_ops);
+       outv_indent(v, -1);
+
+       outv_title(v, "External Undo Log");
+       outv_indent(v, 1);
+       info_obj_ulog(pip, v, (struct ulog *)&lane->external, &p_ops);
+       outv_indent(v, -1);
+}
+
+/*
+ * info_obj_lanes -- print lanes structures
+ */
+static void
+info_obj_lanes(struct pmem_info *pip)
+{
+       int v = pip->args.obj.vlanes;
+
+       if (!outv_check(v))
+               return;
+
+       struct pmemobjpool *pop = pip->obj.pop;
+       /*
+        * Iterate through all lanes from specified range and print
+        * specified sections.
+        */
+       struct lane_layout *lanes = (void *)((char *)pip->obj.pop +
+                       pop->lanes_offset);
+       struct range *curp = NULL;
+       FOREACH_RANGE(curp, &pip->args.obj.lane_ranges) {
+               for (uint64_t i = curp->first;
+                       i <= curp->last && i < pop->nlanes; i++) {
+
+                       /* For -R check print lane only if needs recovery */
+                       if (pip->args.obj.lanes_recovery &&
+                               !lane_need_recovery(pip, &lanes[i]))
+                               continue;
+
+                       outv_title(v, "Lane %" PRIu64, i);
+
+                       outv_indent(v, 1);
+
+                       info_obj_lane(pip, v, &lanes[i]);
+
+                       outv_indent(v, -1);
+               }
+       }
+}
+
+/*
+ * info_obj_heap -- print pmemobj heap headers
+ */
+static void
+info_obj_heap(struct pmem_info *pip)
+{
+       int v = pip->args.obj.vheap;
+       struct pmemobjpool *pop = pip->obj.pop;
+       struct heap_layout *layout = OFF_TO_PTR(pop, pop->heap_offset);
+       struct heap_header *heap = &layout->header;
+
+       outv(v, "\nPMEMOBJ Heap Header:\n");
+       outv_hexdump(v && pip->args.vhdrdump, heap, sizeof(*heap),
+                       pop->heap_offset, 1);
+
+       outv_field(v, "Signature", "%s", heap->signature);
+       outv_field(v, "Major", "%ld", heap->major);
+       outv_field(v, "Minor", "%ld", heap->minor);
+       outv_field(v, "Chunk size", "%s",
+                       out_get_size_str(heap->chunksize, pip->args.human));
+       outv_field(v, "Chunks per zone", "%ld", heap->chunks_per_zone);
+       outv_field(v, "Checksum", "%s", out_get_checksum(heap, sizeof(*heap),
+                       &heap->checksum, 0));
+}
+
+/*
+ * info_obj_zone -- print information about zone
+ */
+static void
+info_obj_zone_hdr(struct pmem_info *pip, int v, struct zone_header *zone)
+{
+       outv_hexdump(v && pip->args.vhdrdump, zone, sizeof(*zone),
+                       PTR_TO_OFF(pip->obj.pop, zone), 1);
+       outv_field(v, "Magic", "%s", out_get_zone_magic_str(zone->magic));
+       outv_field(v, "Size idx", "%u", zone->size_idx);
+}
+
+/*
+ * info_obj_object -- print information about object
+ */
+static void
+info_obj_object(struct pmem_info *pip, const struct memory_block *m,
+       uint64_t objid)
+{
+       if (!util_ranges_contain(&pip->args.ranges, objid))
+               return;
+
+       uint64_t type_num = m->m_ops->get_extra(m);
+
+       if (!util_ranges_contain(&pip->args.obj.type_ranges, type_num))
+               return;
+
+       uint64_t real_size = m->m_ops->get_real_size(m);
+       pip->obj.stats.n_total_objects++;
+       pip->obj.stats.n_total_bytes += real_size;
+
+       struct pmem_obj_type_stats *type_stats =
+               pmem_obj_stats_get_type(&pip->obj.stats, type_num);
+
+       type_stats->n_objects++;
+       type_stats->n_bytes += real_size;
+
+       int vid = pip->args.obj.vobjects;
+       int v = pip->args.obj.vobjects;
+
+       outv_indent(v, 1);
+       info_obj_object_hdr(pip, v, vid, m, objid);
+       outv_indent(v, -1);
+}
+
+/*
+ * info_obj_run_bitmap -- print chunk run's bitmap
+ */
+static void
+info_obj_run_bitmap(int v, struct run_bitmap *b)
+{
+       /* print only used values for lower verbosity */
+       uint32_t i;
+       for (i = 0; i < b->nbits / RUN_BITS_PER_VALUE; i++)
+               outv(v, "%s\n", get_bitmap_str(b->values[i],
+                                       RUN_BITS_PER_VALUE));
+
+       unsigned mod = b->nbits % RUN_BITS_PER_VALUE;
+       if (mod != 0) {
+               outv(v, "%s\n", get_bitmap_str(b->values[i], mod));
+       }
+}
+
+/*
+ * info_obj_memblock_is_root -- (internal) checks whether the object is root
+ */
+static int
+info_obj_memblock_is_root(struct pmem_info *pip, const struct memory_block *m)
+{
+       uint64_t roff = pip->obj.pop->root_offset;
+       if (roff == 0)
+               return 0;
+
+       struct memory_block rm = memblock_from_offset(pip->obj.heap, roff);
+
+       return MEMORY_BLOCK_EQUALS(*m, rm);
+}
+
+/*
+ * info_obj_run_cb -- (internal) run object callback
+ */
+static int
+info_obj_run_cb(const struct memory_block *m, void *arg)
+{
+       struct pmem_info *pip = arg;
+
+       if (info_obj_memblock_is_root(pip, m))
+               return 0;
+
+       info_obj_object(pip, m, pip->obj.objid++);
+
+       return 0;
+}
+
+static struct pmem_obj_class_stats *
+info_obj_class_stats_get_or_insert(struct pmem_obj_zone_stats *stats,
+       uint64_t unit_size, uint64_t alignment,
+       uint32_t nallocs, uint16_t flags)
+{
+       struct pmem_obj_class_stats *cstats;
+       VEC_FOREACH_BY_PTR(cstats, &stats->class_stats) {
+               if (cstats->alignment == alignment &&
+                   cstats->flags == flags &&
+                   cstats->nallocs == nallocs &&
+                   cstats->unit_size == unit_size)
+                       return cstats;
+       }
+
+       struct pmem_obj_class_stats s = {0, 0, unit_size,
+               alignment, nallocs, flags};
+
+       if (VEC_PUSH_BACK(&stats->class_stats, s) != 0)
+               return NULL;
+
+       return &VEC_BACK(&stats->class_stats);
+}
+
+/*
+ * info_obj_chunk -- print chunk info
+ */
+static void
+info_obj_chunk(struct pmem_info *pip, uint64_t c, uint64_t z,
+       struct chunk_header *chunk_hdr, struct chunk *chunk,
+       struct pmem_obj_zone_stats *stats)
+{
+       int v = pip->args.obj.vchunkhdr;
+       outv(v, "\n");
+       outv_field(v, "Chunk", "%lu", c);
+
+       struct pmemobjpool *pop = pip->obj.pop;
+
+       outv_hexdump(v && pip->args.vhdrdump, chunk_hdr, sizeof(*chunk_hdr),
+                       PTR_TO_OFF(pop, chunk_hdr), 1);
+
+       outv_field(v, "Type", "%s", out_get_chunk_type_str(chunk_hdr->type));
+       outv_field(v, "Flags", "0x%x %s", chunk_hdr->flags,
+                       out_get_chunk_flags(chunk_hdr->flags));
+       outv_field(v, "Size idx", "%u", chunk_hdr->size_idx);
+
+       struct memory_block m = MEMORY_BLOCK_NONE;
+       m.zone_id = (uint32_t)z;
+       m.chunk_id = (uint32_t)c;
+       m.size_idx = (uint32_t)chunk_hdr->size_idx;
+       memblock_rebuild_state(pip->obj.heap, &m);
+
+       if (chunk_hdr->type == CHUNK_TYPE_USED ||
+               chunk_hdr->type == CHUNK_TYPE_FREE) {
+               VEC_FRONT(&stats->class_stats).n_units +=
+                       chunk_hdr->size_idx;
+
+               if (chunk_hdr->type == CHUNK_TYPE_USED) {
+                       VEC_FRONT(&stats->class_stats).n_used +=
+                               chunk_hdr->size_idx;
+
+                       /* skip root object */
+                       if (!info_obj_memblock_is_root(pip, &m)) {
+                               info_obj_object(pip, &m, pip->obj.objid++);
+                       }
+               }
+       } else if (chunk_hdr->type == CHUNK_TYPE_RUN) {
+               struct chunk_run *run = (struct chunk_run *)chunk;
+
+               outv_hexdump(v && pip->args.vhdrdump, run,
+                               sizeof(run->hdr.block_size) +
+                               sizeof(run->hdr.alignment),
+                               PTR_TO_OFF(pop, run), 1);
+
+               struct run_bitmap bitmap;
+               m.m_ops->get_bitmap(&m, &bitmap);
+
+               struct pmem_obj_class_stats *cstats =
+                       info_obj_class_stats_get_or_insert(stats,
+                       run->hdr.block_size, run->hdr.alignment, bitmap.nbits,
+                       chunk_hdr->flags);
+               if (cstats == NULL) {
+                       outv_err("out of memory, can't allocate statistics");
+                       return;
+               }
+
+               outv_field(v, "Block size", "%s",
+                               out_get_size_str(run->hdr.block_size,
+                                       pip->args.human));
+
+               uint32_t units = bitmap.nbits;
+               uint32_t free_space = 0;
+               uint32_t max_free_block = 0;
+               m.m_ops->calc_free(&m, &free_space, &max_free_block);
+               uint32_t used = units - free_space;
+
+               cstats->n_units += units;
+               cstats->n_used += used;
+
+               outv_field(v, "Bitmap", "%u / %u", used, units);
+
+               info_obj_run_bitmap(v && pip->args.obj.vbitmap, &bitmap);
+
+               m.m_ops->iterate_used(&m, info_obj_run_cb, pip);
+       }
+}
+
+/*
+ * info_obj_zone_chunks -- print chunk headers from specified zone
+ */
+static void
+info_obj_zone_chunks(struct pmem_info *pip, struct zone *zone, uint64_t z,
+       struct pmem_obj_zone_stats *stats)
+{
+       VEC_INIT(&stats->class_stats);
+
+       struct pmem_obj_class_stats default_class_stats = {0, 0,
+               CHUNKSIZE, 0, 0, 0};
+       VEC_PUSH_BACK(&stats->class_stats, default_class_stats);
+
+       uint64_t c = 0;
+       while (c < zone->header.size_idx) {
+               enum chunk_type type = zone->chunk_headers[c].type;
+               uint64_t size_idx = zone->chunk_headers[c].size_idx;
+               if (util_ranges_contain(&pip->args.obj.chunk_ranges, c)) {
+                       if (pip->args.obj.chunk_types & (1ULL << type)) {
+                               stats->n_chunks++;
+                               stats->n_chunks_type[type]++;
+
+                               stats->size_chunks += size_idx;
+                               stats->size_chunks_type[type] += size_idx;
+
+                               info_obj_chunk(pip, c, z,
+                                       &zone->chunk_headers[c],
+                                       &zone->chunks[c], stats);
+
+                       }
+
+                       if (size_idx > 1 && type != CHUNK_TYPE_RUN &&
+                               pip->args.obj.chunk_types &
+                               (1 << CHUNK_TYPE_FOOTER)) {
+                               size_t f = c + size_idx - 1;
+                               info_obj_chunk(pip, f, z,
+                                       &zone->chunk_headers[f],
+                                       &zone->chunks[f], stats);
+                       }
+               }
+
+               c += size_idx;
+       }
+}
+
+/*
+ * info_obj_root_obj -- print root object
+ */
+static void
+info_obj_root_obj(struct pmem_info *pip)
+{
+       int v = pip->args.obj.vroot;
+
+       struct pmemobjpool *pop = pip->obj.pop;
+       if (!pop->root_offset) {
+               outv(v, "\nNo root object...\n");
+               return;
+       }
+
+       outv_title(v, "Root object");
+       outv_field(v, "Offset", "0x%016zx", pop->root_offset);
+       uint64_t root_size = pop->root_size;
+       outv_field(v, "Size", "%s",
+                       out_get_size_str(root_size, pip->args.human));
+
+       struct memory_block m = memblock_from_offset(
+                       pip->obj.heap, pop->root_offset);
+
+       /* do not print object id and offset for root object */
+       info_obj_object_hdr(pip, v, VERBOSE_SILENT, &m, 0);
+}
+
+/*
+ * info_obj_zones -- print zones and chunks
+ */
+static void
+info_obj_zones_chunks(struct pmem_info *pip)
+{
+       if (!outv_check(pip->args.obj.vheap) &&
+               !outv_check(pip->args.vstats) &&
+               !outv_check(pip->args.obj.vobjects))
+               return;
+
+       struct pmemobjpool *pop = pip->obj.pop;
+       struct heap_layout *layout = OFF_TO_PTR(pop, pop->heap_offset);
+       size_t maxzone = util_heap_max_zone(pop->heap_size);
+       pip->obj.stats.n_zones = maxzone;
+       pip->obj.stats.zone_stats = calloc(maxzone,
+                       sizeof(struct pmem_obj_zone_stats));
+       if (!pip->obj.stats.zone_stats)
+               err(1, "Cannot allocate memory for zone stats");
+
+       for (size_t i = 0; i < maxzone; i++) {
+               struct zone *zone = ZID_TO_ZONE(layout, i);
+
+               if (util_ranges_contain(&pip->args.obj.zone_ranges, i)) {
+                       int vvv = pip->args.obj.vheap &&
+                               (pip->args.obj.vzonehdr ||
+                               pip->args.obj.vchunkhdr);
+
+                       outv_title(vvv, "Zone %zu", i);
+
+                       if (zone->header.magic == ZONE_HEADER_MAGIC)
+                               pip->obj.stats.n_zones_used++;
+
+                       info_obj_zone_hdr(pip, pip->args.obj.vheap &&
+                                       pip->args.obj.vzonehdr,
+                                       &zone->header);
+
+                       outv_indent(vvv, 1);
+                       info_obj_zone_chunks(pip, zone, i,
+                                       &pip->obj.stats.zone_stats[i]);
+                       outv_indent(vvv, -1);
+               }
+       }
+}
+
+/*
+ * info_obj_descriptor -- print pmemobj descriptor
+ */
+static void
+info_obj_descriptor(struct pmem_info *pip)
+{
+       int v = VERBOSE_DEFAULT;
+
+       if (!outv_check(v))
+               return;
+
+       outv(v, "\nPMEM OBJ Header:\n");
+       struct pmemobjpool *pop = pip->obj.pop;
+
+       uint8_t *hdrptr = (uint8_t *)pop + sizeof(pop->hdr);
+       size_t hdrsize = sizeof(*pop) - sizeof(pop->hdr);
+       size_t hdroff = sizeof(pop->hdr);
+       outv_hexdump(pip->args.vhdrdump, hdrptr, hdrsize, hdroff, 1);
+
+       /* check if layout is zeroed */
+       char *layout = util_check_memory((uint8_t *)pop->layout,
+                       sizeof(pop->layout), 0) ?
+                       pop->layout : "(null)";
+
+       /* address for checksum */
+       void *dscp = (void *)((uintptr_t)(pop) + sizeof(struct pool_hdr));
+
+       outv_field(v, "Layout", "%s", layout);
+       outv_field(v, "Lanes offset", "0x%lx", pop->lanes_offset);
+       outv_field(v, "Number of lanes", "%lu", pop->nlanes);
+       outv_field(v, "Heap offset", "0x%lx", pop->heap_offset);
+       outv_field(v, "Heap size", "%lu", pop->heap_size);
+       outv_field(v, "Checksum", "%s", out_get_checksum(dscp, OBJ_DSC_P_SIZE,
+                       &pop->checksum, 0));
+       outv_field(v, "Root offset", "0x%lx", pop->root_offset);
+
+       /* run id with -v option */
+       outv_field(v + 1, "Run id", "%lu", pop->run_id);
+}
+
+/*
+ * info_obj_stats_objjects -- print objects' statistics
+ */
+static void
+info_obj_stats_objects(struct pmem_info *pip, int v,
+       struct pmem_obj_stats *stats)
+{
+       outv_field(v, "Number of objects", "%lu",
+                       stats->n_total_objects);
+       outv_field(v, "Number of bytes", "%s", out_get_size_str(
+                       stats->n_total_bytes, pip->args.human));
+
+       outv_title(v, "Objects by type");
+
+       outv_indent(v, 1);
+       struct pmem_obj_type_stats *type_stats;
+       PMDK_TAILQ_FOREACH(type_stats, &pip->obj.stats.type_stats, next) {
+               if (!type_stats->n_objects)
+                       continue;
+
+               double n_objects_perc = 100.0 *
+                       (double)type_stats->n_objects /
+                       (double)stats->n_total_objects;
+               double n_bytes_perc = 100.0 *
+                       (double)type_stats->n_bytes /
+                       (double)stats->n_total_bytes;
+
+               outv_nl(v);
+               outv_field(v, "Type number", "%lu", type_stats->type_num);
+               outv_field(v, "Number of objects", "%lu [%s]",
+                       type_stats->n_objects,
+                       out_get_percentage(n_objects_perc));
+               outv_field(v, "Number of bytes", "%s [%s]",
+                       out_get_size_str(
+                               type_stats->n_bytes,
+                               pip->args.human),
+                       out_get_percentage(n_bytes_perc));
+       }
+       outv_indent(v, -1);
+}
+
+/*
+ * info_boj_stats_alloc_classes -- print allocation classes' statistics
+ */
+static void
+info_obj_stats_alloc_classes(struct pmem_info *pip, int v,
+       struct pmem_obj_zone_stats *stats)
+{
+       uint64_t total_bytes = 0;
+       uint64_t total_used = 0;
+
+       outv_indent(v, 1);
+
+       struct pmem_obj_class_stats *cstats;
+       VEC_FOREACH_BY_PTR(cstats, &stats->class_stats) {
+               if (cstats->n_units == 0)
+                       continue;
+
+               double used_perc = 100.0 *
+                       (double)cstats->n_used / (double)cstats->n_units;
+
+               outv_nl(v);
+               outv_field(v, "Unit size", "%s", out_get_size_str(
+                                       cstats->unit_size, pip->args.human));
+               outv_field(v, "Units", "%lu", cstats->n_units);
+               outv_field(v, "Used units", "%lu [%s]",
+                               cstats->n_used,
+                               out_get_percentage(used_perc));
+
+               uint64_t bytes = cstats->unit_size *
+                       cstats->n_units;
+               uint64_t used = cstats->unit_size *
+                       cstats->n_used;
+
+               total_bytes += bytes;
+               total_used += used;
+
+               double used_bytes_perc = 100.0 * (double)used / (double)bytes;
+
+               outv_field(v, "Bytes", "%s",
+                               out_get_size_str(bytes, pip->args.human));
+               outv_field(v, "Used bytes", "%s [%s]",
+                               out_get_size_str(used, pip->args.human),
+                               out_get_percentage(used_bytes_perc));
+       }
+
+       outv_indent(v, -1);
+
+       double used_bytes_perc = total_bytes ? 100.0 *
+               (double)total_used / (double)total_bytes : 0.0;
+
+       outv_nl(v);
+       outv_field(v, "Total bytes", "%s",
+                       out_get_size_str(total_bytes, pip->args.human));
+       outv_field(v, "Total used bytes", "%s [%s]",
+                       out_get_size_str(total_used, pip->args.human),
+                       out_get_percentage(used_bytes_perc));
+
+}
+
+/*
+ * info_obj_stats_chunks -- print chunks' statistics
+ */
+static void
+info_obj_stats_chunks(struct pmem_info *pip, int v,
+       struct pmem_obj_zone_stats *stats)
+{
+       outv_field(v, "Number of chunks", "%lu", stats->n_chunks);
+
+       outv_indent(v, 1);
+       for (unsigned type = 0; type < MAX_CHUNK_TYPE; type++) {
+               double type_perc = 100.0 *
+                       (double)stats->n_chunks_type[type] /
+                       (double)stats->n_chunks;
+               if (stats->n_chunks_type[type]) {
+                       outv_field(v, out_get_chunk_type_str(type),
+                               "%lu [%s]",
+                               stats->n_chunks_type[type],
+                               out_get_percentage(type_perc));
+               }
+       }
+       outv_indent(v, -1);
+
+       outv_nl(v);
+       outv_field(v, "Total chunks size", "%s", out_get_size_str(
+                               stats->size_chunks, pip->args.human));
+
+       outv_indent(v, 1);
+       for (unsigned type = 0; type < MAX_CHUNK_TYPE; type++) {
+               double type_perc = 100.0 *
+                       (double)stats->size_chunks_type[type] /
+                       (double)stats->size_chunks;
+               if (stats->size_chunks_type[type]) {
+                       outv_field(v, out_get_chunk_type_str(type),
+                               "%lu [%s]",
+                               stats->size_chunks_type[type],
+                               out_get_percentage(type_perc));
+               }
+
+       }
+       outv_indent(v, -1);
+}
+
+/*
+ * info_obj_add_zone_stats -- add stats to total
+ */
+static void
+info_obj_add_zone_stats(struct pmem_obj_zone_stats *total,
+       struct pmem_obj_zone_stats *stats)
+{
+       total->n_chunks += stats->n_chunks;
+       total->size_chunks += stats->size_chunks;
+
+       for (int type = 0; type < MAX_CHUNK_TYPE; type++) {
+               total->n_chunks_type[type] +=
+                       stats->n_chunks_type[type];
+               total->size_chunks_type[type] +=
+                       stats->size_chunks_type[type];
+       }
+
+       struct pmem_obj_class_stats *cstats;
+       VEC_FOREACH_BY_PTR(cstats, &stats->class_stats) {
+               struct pmem_obj_class_stats *ctotal =
+               info_obj_class_stats_get_or_insert(total, cstats->unit_size,
+                       cstats->alignment, cstats->nallocs, cstats->flags);
+               if (ctotal == NULL) {
+                       outv_err("out of memory, can't allocate statistics");
+                       return;
+               }
+               ctotal->n_units += cstats->n_units;
+               ctotal->n_used += cstats->n_used;
+       }
+}
+
+/*
+ * info_obj_stats_zones -- print zones' statistics
+ */
+static void
+info_obj_stats_zones(struct pmem_info *pip, int v, struct pmem_obj_stats *stats,
+       struct pmem_obj_zone_stats *total)
+{
+       double used_zones_perc = 100.0 * (double)stats->n_zones_used /
+               (double)stats->n_zones;
+
+       outv_field(v, "Number of zones", "%lu", stats->n_zones);
+       outv_field(v, "Number of used zones", "%lu [%s]", stats->n_zones_used,
+                       out_get_percentage(used_zones_perc));
+
+       outv_indent(v, 1);
+       for (uint64_t i = 0; i < stats->n_zones_used; i++) {
+               outv_title(v, "Zone %" PRIu64, i);
+
+               struct pmem_obj_zone_stats *zstats = &stats->zone_stats[i];
+
+               info_obj_stats_chunks(pip, v, zstats);
+
+               outv_title(v, "Zone's allocation classes");
+               info_obj_stats_alloc_classes(pip, v, zstats);
+
+               info_obj_add_zone_stats(total, zstats);
+       }
+       outv_indent(v, -1);
+}
+
+/*
+ * info_obj_stats -- print statistics
+ */
+static void
+info_obj_stats(struct pmem_info *pip)
+{
+       int v = pip->args.vstats;
+
+       if (!outv_check(v))
+               return;
+
+       struct pmem_obj_stats *stats = &pip->obj.stats;
+       struct pmem_obj_zone_stats total;
+       memset(&total, 0, sizeof(total));
+
+       outv_title(v, "Statistics");
+
+       outv_title(v, "Objects");
+       info_obj_stats_objects(pip, v, stats);
+
+       outv_title(v, "Heap");
+       info_obj_stats_zones(pip, v, stats, &total);
+
+       if (stats->n_zones_used > 1) {
+               outv_title(v, "Total zone's statistics");
+               outv_title(v, "Chunks statistics");
+               info_obj_stats_chunks(pip, v, &total);
+
+               outv_title(v, "Allocation classes");
+               info_obj_stats_alloc_classes(pip, v, &total);
+       }
+       VEC_DELETE(&total.class_stats);
+}
+
+static struct pmem_info *Pip;
+#ifndef _WIN32
+static void
+info_obj_sa_sigaction(int signum, siginfo_t *info, void *context)
+{
+       uintptr_t offset = (uintptr_t)info->si_addr - (uintptr_t)Pip->obj.pop;
+       outv_err("Invalid offset 0x%lx\n", offset);
+       exit(EXIT_FAILURE);
+}
+
+static struct sigaction info_obj_sigaction = {
+       .sa_sigaction = info_obj_sa_sigaction,
+       .sa_flags = SA_SIGINFO
+};
+#else
+#define CALL_FIRST 1
+
+static LONG CALLBACK
+exception_handler(_In_ PEXCEPTION_POINTERS ExceptionInfo)
+{
+       PEXCEPTION_RECORD record = ExceptionInfo->ExceptionRecord;
+       if (record->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) {
+               return EXCEPTION_CONTINUE_SEARCH;
+       }
+       uintptr_t offset = (uintptr_t)record->ExceptionInformation[1] -
+               (uintptr_t)Pip->obj.pop;
+       outv_err("Invalid offset 0x%lx\n", offset);
+       exit(EXIT_FAILURE);
+}
+#endif
+
+/*
+ * info_obj -- print information about obj pool type
+ */
+int
+pmempool_info_obj(struct pmem_info *pip)
+{
+       pip->obj.pop = pool_set_file_map(pip->pfile, 0);
+       if (pip->obj.pop == NULL)
+               return -1;
+
+       pip->obj.size = pip->pfile->size;
+
+       struct palloc_heap *heap = calloc(1, sizeof(*heap));
+       if (heap == NULL)
+               err(1, "Cannot allocate memory for heap data");
+
+       heap->layout = OFF_TO_PTR(pip->obj.pop, pip->obj.pop->heap_offset);
+       heap->base = pip->obj.pop;
+       pip->obj.alloc_classes = alloc_class_collection_new();
+       pip->obj.heap = heap;
+
+       Pip = pip;
+#ifndef _WIN32
+       if (sigaction(SIGSEGV, &info_obj_sigaction, NULL)) {
+#else
+       if (AddVectoredExceptionHandler(CALL_FIRST, exception_handler) ==
+               NULL) {
+#endif
+               perror("sigaction");
+               return -1;
+       }
+
+       pip->obj.uuid_lo = pmemobj_get_uuid_lo(pip->obj.pop);
+
+       info_obj_descriptor(pip);
+       info_obj_lanes(pip);
+       info_obj_root_obj(pip);
+       info_obj_heap(pip);
+       info_obj_zones_chunks(pip);
+       info_obj_stats(pip);
+
+       free(heap);
+       alloc_class_collection_delete(pip->obj.alloc_classes);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/output.c b/ceph/src/pmdk/src/tools/pmempool/output.c
new file mode 100644 (file)
index 0000000..ba960fa
--- /dev/null
@@ -0,0 +1,844 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * output.c -- definitions of output printing related functions
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdint.h>
+#include <ctype.h>
+#include <err.h>
+#include <endian.h>
+#include <inttypes.h>
+#include <float.h>
+#include "feature.h"
+#include "common.h"
+#include "output.h"
+
+#define _STR(s)        #s
+#define STR(s) _STR(s)
+#define TIME_STR_FMT "%a %b %d %Y %H:%M:%S"
+#define UUID_STR_MAX 37
+#define HEXDUMP_ROW_WIDTH 16
+/*
+ * 2 chars + space per byte +
+ * space after 8 bytes and terminating NULL
+ */
+#define HEXDUMP_ROW_HEX_LEN (HEXDUMP_ROW_WIDTH * 3 + 1 + 1)
+/* 1 printable char per byte + terminating NULL */
+#define HEXDUMP_ROW_ASCII_LEN (HEXDUMP_ROW_WIDTH + 1)
+#define SEPARATOR_CHAR '-'
+#define MAX_INDENT 32
+#define INDENT_CHAR ' '
+
+static char out_indent_str[MAX_INDENT + 1];
+static int out_indent_level;
+static int out_vlevel;
+static unsigned out_column_width = 20;
+static FILE *out_fh;
+static const char *out_prefix;
+
+#define STR_MAX 256
+
+/*
+ * outv_check -- verify verbosity level
+ */
+int
+outv_check(int vlevel)
+{
+       return vlevel && (out_vlevel >= vlevel);
+}
+
+/*
+ * out_set_col_width -- set column width
+ *
+ * See: outv_field() function
+ */
+void
+out_set_col_width(unsigned col_width)
+{
+       out_column_width = col_width;
+}
+
+/*
+ * out_set_vlevel -- set verbosity level
+ */
+void
+out_set_vlevel(int vlevel)
+{
+       out_vlevel = vlevel;
+       if (out_fh == NULL)
+               out_fh = stdout;
+}
+
+/*
+ * out_set_prefix -- set prefix to output format
+ */
+void
+out_set_prefix(const char *prefix)
+{
+       out_prefix = prefix;
+}
+
+/*
+ * out_set_stream -- set output stream
+ */
+void
+out_set_stream(FILE *stream)
+{
+       out_fh = stream;
+
+       memset(out_indent_str, INDENT_CHAR, MAX_INDENT);
+}
+
+/*
+ * outv_err -- print error message
+ */
+void
+outv_err(const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+       outv_err_vargs(fmt, ap);
+       va_end(ap);
+}
+
+/*
+ * outv_err_vargs -- print error message
+ */
+void
+outv_err_vargs(const char *fmt, va_list ap)
+{
+       char *_str = strdup(fmt);
+       if (!_str)
+               err(1, "strdup");
+       char *str = _str;
+
+       fprintf(stderr, "error: ");
+       int errstr = str[0] == '!';
+       if (errstr)
+               str++;
+
+       char *nl = strchr(str, '\n');
+       if (nl)
+               *nl = '\0';
+
+       vfprintf(stderr, str, ap);
+       if (errstr)
+               fprintf(stderr, ": %s", strerror(errno));
+       fprintf(stderr, "\n");
+
+       free(_str);
+}
+
+/*
+ * outv_indent -- change indentation level by factor
+ */
+void
+outv_indent(int vlevel, int i)
+{
+       if (!outv_check(vlevel))
+               return;
+
+       out_indent_str[out_indent_level] = INDENT_CHAR;
+       out_indent_level += i;
+       if (out_indent_level < 0)
+               out_indent_level = 0;
+       if (out_indent_level > MAX_INDENT)
+               out_indent_level = MAX_INDENT;
+
+       out_indent_str[out_indent_level] = '\0';
+}
+
+/*
+ * _out_prefix -- print prefix if defined
+ */
+static void
+_out_prefix(void)
+{
+       if (out_prefix)
+               fprintf(out_fh, "%s: ", out_prefix);
+}
+
+/*
+ * _out_indent -- print indent
+ */
+static void
+_out_indent(void)
+{
+       fprintf(out_fh, "%s", out_indent_str);
+}
+
+/*
+ * outv -- print message taking into account verbosity level
+ */
+void
+outv(int vlevel, const char *fmt, ...)
+{
+       va_list ap;
+
+       if (!outv_check(vlevel))
+               return;
+
+       _out_prefix();
+       _out_indent();
+       va_start(ap, fmt);
+       vfprintf(out_fh, fmt, ap);
+       va_end(ap);
+}
+
+/*
+ * outv_nl -- print new line without indentation
+ */
+void
+outv_nl(int vlevel)
+{
+       if (!outv_check(vlevel))
+               return;
+
+       _out_prefix();
+       fprintf(out_fh, "\n");
+}
+
+void
+outv_title(int vlevel, const char *fmt, ...)
+{
+       va_list ap;
+       if (!outv_check(vlevel))
+               return;
+
+       fprintf(out_fh, "\n");
+       _out_prefix();
+       _out_indent();
+       va_start(ap, fmt);
+       vfprintf(out_fh, fmt, ap);
+       va_end(ap);
+       fprintf(out_fh, ":\n");
+}
+
+/*
+ * outv_field -- print field name and value in specified format
+ *
+ * Field name will have fixed width which can be changed by
+ * out_set_column_width() function.
+ * vlevel - verbosity level
+ * field  - field name
+ * fmt    - format form value
+ */
+void
+outv_field(int vlevel, const char *field, const char *fmt, ...)
+{
+       va_list ap;
+
+       if (!outv_check(vlevel))
+               return;
+
+       _out_prefix();
+       _out_indent();
+       va_start(ap, fmt);
+       fprintf(out_fh, "%-*s : ", out_column_width, field);
+       vfprintf(out_fh, fmt, ap);
+       fprintf(out_fh, "\n");
+       va_end(ap);
+}
+
+/*
+ * out_get_percentage -- return percentage string
+ */
+const char *
+out_get_percentage(double perc)
+{
+       static char str_buff[STR_MAX] = {0, };
+       int ret = 0;
+
+       if (perc > 0.0 && perc < 0.0001) {
+               ret = util_snprintf(str_buff, STR_MAX, "%e %%", perc);
+               if (ret < 0)
+                       return "";
+       } else {
+               int decimal = 0;
+               if (perc >= 100.0 || perc < DBL_EPSILON)
+                       decimal = 0;
+               else
+                       decimal = 6;
+
+               ret = util_snprintf(str_buff, STR_MAX, "%.*f %%", decimal,
+                               perc);
+               if (ret < 0)
+                       return "";
+       }
+
+       return str_buff;
+}
+
+/*
+ * out_get_size_str -- return size string
+ *
+ * human - if 1 return size in human-readable format
+ *         if 2 return size in bytes and human-readable format
+ * otherwise return size in bytes.
+ */
+const char *
+out_get_size_str(uint64_t size, int human)
+{
+       static char str_buff[STR_MAX] = {0, };
+       char units[] = {
+               'K', 'M', 'G', 'T', '\0'
+       };
+       const int nunits = sizeof(units) / sizeof(units[0]);
+       int ret = 0;
+
+       if (!human) {
+               ret = util_snprintf(str_buff, STR_MAX, "%"PRIu64, size);
+       } else {
+               int i = -1;
+               double dsize = (double)size;
+               uint64_t csize = size;
+
+               while (csize >= 1024 && i < nunits) {
+                       csize /= 1024;
+                       dsize /= 1024.0;
+                       i++;
+               }
+
+               if (i >= 0 && i < nunits)
+                       if (human == 1)
+                               ret = util_snprintf(str_buff, STR_MAX,
+                                               "%.1f%c", dsize, units[i]);
+                       else
+                               ret = util_snprintf(str_buff, STR_MAX,
+                                               "%.1f%c [%" PRIu64"]", dsize,
+                                               units[i], size);
+               else
+                       ret = util_snprintf(str_buff, STR_MAX, "%"PRIu64,
+                                       size);
+       }
+
+       if (ret < 0)
+               return "";
+
+       return str_buff;
+}
+
+/*
+ * out_get_uuid_str -- returns uuid in human readable format
+ */
+const char *
+out_get_uuid_str(uuid_t uuid)
+{
+       static char uuid_str[UUID_STR_MAX] = {0, };
+
+       int ret = util_uuid_to_string(uuid, uuid_str);
+       if (ret != 0) {
+               outv(2, "failed to covert uuid to string");
+               return NULL;
+       }
+       return uuid_str;
+}
+
+/*
+ * out_get_time_str -- returns time in human readable format
+ */
+const char *
+out_get_time_str(time_t time)
+{
+       static char str_buff[STR_MAX] = {0, };
+       struct tm *tm = util_localtime(&time);
+
+       if (tm) {
+               strftime(str_buff, STR_MAX, TIME_STR_FMT, tm);
+       } else {
+               int ret = util_snprintf(str_buff, STR_MAX, "unknown");
+               if (ret < 0)
+                       return "";
+       }
+
+       return str_buff;
+}
+
+/*
+ * out_get_ascii_str -- get string with printable ASCII dump buffer
+ *
+ * Convert non-printable ASCII characters to dot '.'
+ * See: util_get_printable_ascii() function.
+ */
+static int
+out_get_ascii_str(char *str, size_t str_len, const uint8_t *datap, size_t len)
+{
+       int c = 0;
+       size_t i;
+       char pch;
+
+       if (str_len < len)
+               return -1;
+
+       for (i = 0; i < len; i++) {
+               pch = util_get_printable_ascii((char)datap[i]);
+               int t = util_snprintf(str + c, str_len - (size_t)c, "%c", pch);
+               if (t < 0)
+                       return -1;
+               c += t;
+       }
+
+       return c;
+}
+
+/*
+ * out_get_hex_str -- get string with hexadecimal dump of buffer
+ *
+ * Hexadecimal bytes in format %02x, each one followed by space,
+ * additional space after every 8th byte.
+ */
+static int
+out_get_hex_str(char *str, size_t str_len, const uint8_t *datap, size_t len)
+{
+       int c = 0;
+       size_t i;
+       int t;
+
+       if (str_len < (3 * len + 1))
+               return -1;
+
+       for (i = 0; i < len; i++) {
+               /* add space after n*8 byte */
+               if (i && (i % 8) == 0) {
+                       t = util_snprintf(str + c, str_len - (size_t)c, " ");
+                       if (t < 0)
+                               return -1;
+                       c += t;
+               }
+               t = util_snprintf(str + c, str_len - (size_t)c, "%02x ",
+                               datap[i]);
+               if (t < 0)
+                       return -1;
+               c += t;
+       }
+
+       return c;
+}
+
+/*
+ * outv_hexdump -- print buffer in canonical hex+ASCII format
+ *
+ * Print offset in hexadecimal,
+ * sixteen space-separated, two column, hexadecimal bytes,
+ * followed by the same sixteen bytes converted to printable ASCII characters
+ * enclosed in '|' characters.
+ */
+void
+outv_hexdump(int vlevel, const void *addr, size_t len, size_t offset, int sep)
+{
+       if (!outv_check(vlevel) || len <= 0)
+               return;
+
+       const uint8_t *datap = (uint8_t *)addr;
+       uint8_t row_hex_str[HEXDUMP_ROW_HEX_LEN] = {0, };
+       uint8_t row_ascii_str[HEXDUMP_ROW_ASCII_LEN] = {0, };
+       size_t curr = 0;
+       size_t prev = 0;
+       int repeated = 0;
+       int n = 0;
+
+       while (len) {
+               size_t curr_len = min(len, HEXDUMP_ROW_WIDTH);
+
+               /*
+                * Check if current row is the same as the previous one
+                * don't check it for first and last rows.
+                */
+               if (len != curr_len && curr &&
+                               !memcmp(datap + prev, datap + curr, curr_len)) {
+                       if (!repeated) {
+                               /* print star only for the first repeated */
+                               fprintf(out_fh, "*\n");
+                               repeated = 1;
+                       }
+               } else {
+                       repeated = 0;
+
+                       /* row with hexadecimal bytes */
+                       int rh = out_get_hex_str((char *)row_hex_str,
+                               HEXDUMP_ROW_HEX_LEN, datap + curr, curr_len);
+                       /* row with printable ascii chars */
+                       int ra = out_get_ascii_str((char *)row_ascii_str,
+                               HEXDUMP_ROW_ASCII_LEN, datap + curr, curr_len);
+
+                       if (ra && rh)
+                               n = fprintf(out_fh, "%08zx  %-*s|%-*s|\n",
+                                       curr + offset,
+                                       HEXDUMP_ROW_HEX_LEN, row_hex_str,
+                                       HEXDUMP_ROW_WIDTH, row_ascii_str);
+                       prev = curr;
+               }
+
+               len -= curr_len;
+               curr += curr_len;
+       }
+
+       if (sep && n) {
+               while (--n)
+                       fprintf(out_fh, "%c", SEPARATOR_CHAR);
+               fprintf(out_fh, "\n");
+       }
+}
+
+/*
+ * out_get_checksum -- return checksum string with result
+ */
+const char *
+out_get_checksum(void *addr, size_t len, uint64_t *csump, size_t skip_off)
+{
+       static char str_buff[STR_MAX] = {0, };
+       int ret = 0;
+
+       uint64_t csum = util_checksum_compute(addr, len, csump, skip_off);
+
+       if (*csump == htole64(csum))
+               ret = util_snprintf(str_buff, STR_MAX, "0x%" PRIx64" [OK]",
+                       le64toh(csum));
+       else
+               ret = util_snprintf(str_buff, STR_MAX,
+                       "0x%" PRIx64 " [wrong! should be: 0x%" PRIx64 "]",
+                       le64toh(*csump), le64toh(csum));
+
+       if (ret < 0)
+               return "";
+
+       return str_buff;
+}
+
+/*
+ * out_get_btt_map_entry -- return BTT map entry with flags strings
+ */
+const char *
+out_get_btt_map_entry(uint32_t map)
+{
+       static char str_buff[STR_MAX] = {0, };
+
+       int is_init = (map & ~BTT_MAP_ENTRY_LBA_MASK) == 0;
+       int is_zero = (map & ~BTT_MAP_ENTRY_LBA_MASK) ==
+               BTT_MAP_ENTRY_ZERO;
+       int is_error = (map & ~BTT_MAP_ENTRY_LBA_MASK) ==
+               BTT_MAP_ENTRY_ERROR;
+       int is_normal = (map & ~BTT_MAP_ENTRY_LBA_MASK) ==
+               BTT_MAP_ENTRY_NORMAL;
+
+       uint32_t lba = map & BTT_MAP_ENTRY_LBA_MASK;
+
+       int ret = util_snprintf(str_buff, STR_MAX, "0x%08x state: %s", lba,
+                       is_init ? "init" :
+                       is_zero ? "zero" :
+                       is_error ? "error" :
+                       is_normal ? "normal" : "unknown");
+
+       if (ret < 0)
+               return "";
+
+       return str_buff;
+}
+
+/*
+ * out_get_pool_type_str -- get pool type string
+ */
+const char *
+out_get_pool_type_str(pmem_pool_type_t type)
+{
+       switch (type) {
+       case PMEM_POOL_TYPE_LOG:
+               return "log";
+       case PMEM_POOL_TYPE_BLK:
+               return "blk";
+       case PMEM_POOL_TYPE_OBJ:
+               return "obj";
+       case PMEM_POOL_TYPE_BTT:
+               return "btt";
+       default:
+               return "unknown";
+       }
+}
+
+/*
+ * out_get_pool_signature -- return signature of specified pool type
+ */
+const char *
+out_get_pool_signature(pmem_pool_type_t type)
+{
+       switch (type) {
+       case PMEM_POOL_TYPE_LOG:
+               return LOG_HDR_SIG;
+       case PMEM_POOL_TYPE_BLK:
+               return BLK_HDR_SIG;
+       case PMEM_POOL_TYPE_OBJ:
+               return OBJ_HDR_SIG;
+       default:
+               return NULL;
+       }
+}
+
+/*
+ * out_get_chunk_type_str -- get chunk type string
+ */
+const char *
+out_get_chunk_type_str(enum chunk_type type)
+{
+       switch (type) {
+       case CHUNK_TYPE_FOOTER:
+               return "footer";
+       case CHUNK_TYPE_FREE:
+               return "free";
+       case CHUNK_TYPE_USED:
+               return "used";
+       case CHUNK_TYPE_RUN:
+               return "run";
+       case CHUNK_TYPE_UNKNOWN:
+       default:
+               return "unknown";
+       }
+}
+
+/*
+ * out_get_chunk_flags -- get names of set flags for chunk header
+ */
+const char *
+out_get_chunk_flags(uint16_t flags)
+{
+       if (flags & CHUNK_FLAG_COMPACT_HEADER)
+               return "compact header";
+       else if (flags & CHUNK_FLAG_HEADER_NONE)
+               return "header none";
+
+       return "";
+}
+
+/*
+ * out_get_zone_magic_str -- get zone magic string with additional
+ * information about correctness of the magic value
+ */
+const char *
+out_get_zone_magic_str(uint32_t magic)
+{
+       static char str_buff[STR_MAX] = {0, };
+
+       const char *correct = NULL;
+       switch (magic) {
+       case 0:
+               correct = "uninitialized";
+               break;
+       case ZONE_HEADER_MAGIC:
+               correct = "OK";
+               break;
+       default:
+               correct = "wrong! should be " STR(ZONE_HEADER_MAGIC);
+               break;
+       }
+
+       int ret = util_snprintf(str_buff, STR_MAX, "0x%08x [%s]", magic,
+                       correct);
+
+       if (ret < 0)
+               return "";
+
+       return str_buff;
+}
+
+/*
+ * out_get_pmemoid_str -- get PMEMoid string
+ */
+const char *
+out_get_pmemoid_str(PMEMoid oid, uint64_t uuid_lo)
+{
+       static char str_buff[STR_MAX] = {0, };
+       int free_cor = 0;
+       int ret = 0;
+       char *correct = "OK";
+       if (oid.pool_uuid_lo && oid.pool_uuid_lo != uuid_lo) {
+               ret = util_snprintf(str_buff, STR_MAX,
+                       "wrong! should be 0x%016"PRIx64, uuid_lo);
+               if (ret < 0)
+                       err(1, "snprintf: %d", ret);
+               correct = strdup(str_buff);
+               if (!correct)
+                       err(1, "Cannot allocate memory for PMEMoid string\n");
+               free_cor = 1;
+       }
+
+       ret = util_snprintf(str_buff, STR_MAX,
+                       "off: 0x%016"PRIx64" pool_uuid_lo: 0x%016"
+                       PRIx64" [%s]", oid.off, oid.pool_uuid_lo, correct);
+
+       if (free_cor)
+               free(correct);
+
+       if (ret < 0)
+               err(1, "snprintf: %d", ret);
+
+       return str_buff;
+}
+
+/*
+ * out_get_arch_machine_class_str -- get a string representation of the machine
+ * class
+ */
+const char *
+out_get_arch_machine_class_str(uint8_t machine_class)
+{
+
+       switch (machine_class) {
+       case PMDK_MACHINE_CLASS_64:
+               return "64";
+       default:
+               return "unknown";
+       }
+}
+
+/*
+ * out_get_arch_data_str -- get a string representation of the data endianness
+ */
+const char *
+out_get_arch_data_str(uint8_t data)
+{
+       switch (data) {
+       case PMDK_DATA_LE:
+               return "2's complement, little endian";
+       case PMDK_DATA_BE:
+               return "2's complement, big endian";
+       default:
+               return "unknown";
+       }
+}
+
+/*
+ * out_get_arch_machine_str -- get a string representation of the machine type
+ */
+const char *
+out_get_arch_machine_str(uint16_t machine)
+{
+       static char str_buff[STR_MAX] = {0, };
+       switch (machine) {
+       case PMDK_MACHINE_X86_64:
+               return "AMD X86-64";
+       case PMDK_MACHINE_AARCH64:
+               return "Aarch64";
+       case PMDK_MACHINE_PPC64:
+               return "PPC64";
+       default:
+               break;
+       }
+
+       int ret = util_snprintf(str_buff, STR_MAX, "unknown %u", machine);
+       if (ret < 0)
+               return "unknown";
+       return str_buff;
+}
+
+/*
+ * out_get_last_shutdown_str -- get a string representation of the finish state
+ */
+const char *
+out_get_last_shutdown_str(uint8_t dirty)
+{
+       if (dirty)
+               return "dirty";
+       else
+               return "clean";
+}
+
+/*
+ * out_get_alignment_descr_str -- get alignment descriptor string
+ */
+const char *
+out_get_alignment_desc_str(uint64_t ad, uint64_t valid_ad)
+{
+       static char str_buff[STR_MAX] = {0, };
+       int ret = 0;
+
+       if (ad == valid_ad)
+               ret = util_snprintf(str_buff, STR_MAX, "0x%016"PRIx64"[OK]",
+                               ad);
+       else
+               ret = util_snprintf(str_buff, STR_MAX, "0x%016"PRIx64" "
+                       "[wrong! should be 0x%016"PRIx64"]", ad, valid_ad);
+
+       if (ret < 0)
+               return "";
+
+       return str_buff;
+}
+
+/*
+ * out_concat -- concatenate the new element to the list of strings
+ *
+ * If concatenation is successful it increments current position in the output
+ * string and number of elements in the list. Elements are separated with ", ".
+ */
+static int
+out_concat(char *str_buff, int *curr, int *count, const char *str)
+{
+       ASSERTne(str_buff, NULL);
+       ASSERTne(curr, NULL);
+       ASSERTne(str, NULL);
+
+       const char *separator = (count != NULL && *count > 0) ? ", " : "";
+       int ret = util_snprintf(str_buff + *curr,
+               (size_t)(STR_MAX - *curr), "%s%s", separator, str);
+       if (ret < 0)
+               return -1;
+       *curr += ret;
+       if (count)
+               ++(*count);
+       return 0;
+}
+
+/*
+ * out_get_incompat_features_str -- (internal) get a string with names of
+ *                                  incompatibility flags
+ */
+const char *
+out_get_incompat_features_str(uint32_t incompat)
+{
+       static char str_buff[STR_MAX] = {0};
+       features_t features = {POOL_FEAT_ZERO, incompat, POOL_FEAT_ZERO};
+       int ret = 0;
+
+       if (incompat == 0) {
+               /* print the value only */
+               return "0x0";
+       } else {
+               /* print the value and the left square bracket */
+               ret = util_snprintf(str_buff, STR_MAX, "0x%x [", incompat);
+               if (ret < 0) {
+                       ERR("snprintf for incompat features: %d", ret);
+                       return "<error>";
+               }
+
+               /* print names of known options */
+               int count = 0;
+               int curr = ret;
+               features_t found;
+               const char *feat;
+
+               while (((feat = util_feature2str(features, &found))) != NULL) {
+                       util_feature_disable(&features, found);
+                       ret = out_concat(str_buff, &curr, &count, feat);
+                       if (ret < 0)
+                               return "";
+               }
+
+               /* check if any unknown flags are set */
+               if (!util_feature_is_zero(features)) {
+                       if (out_concat(str_buff, &curr, &count,
+                                       "?UNKNOWN_FLAG?"))
+                               return "";
+               }
+
+               /* print the right square bracket */
+               if (out_concat(str_buff, &curr, NULL, "]"))
+                       return "";
+       }
+       return str_buff;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/output.h b/ceph/src/pmdk/src/tools/pmempool/output.h
new file mode 100644 (file)
index 0000000..4b6460f
--- /dev/null
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * output.h -- declarations of output printing related functions
+ */
+
+#include <time.h>
+#include <stdint.h>
+#include <stdio.h>
+
+void out_set_vlevel(int vlevel);
+void out_set_stream(FILE *stream);
+void out_set_prefix(const char *prefix);
+void out_set_col_width(unsigned col_width);
+void outv_err(const char *fmt, ...) FORMAT_PRINTF(1, 2);
+void out_err(const char *file, int line, const char *func,
+               const char *fmt, ...) FORMAT_PRINTF(4, 5);
+void outv_err_vargs(const char *fmt, va_list ap);
+void outv_indent(int vlevel, int i);
+void outv(int vlevel, const char *fmt, ...) FORMAT_PRINTF(2, 3);
+void outv_nl(int vlevel);
+int outv_check(int vlevel);
+void outv_title(int vlevel, const char *fmt, ...) FORMAT_PRINTF(2, 3);
+void outv_field(int vlevel, const char *field, const char *fmt,
+               ...) FORMAT_PRINTF(3, 4);
+void outv_hexdump(int vlevel, const void *addr, size_t len, size_t offset,
+               int sep);
+const char *out_get_uuid_str(uuid_t uuid);
+const char *out_get_time_str(time_t time);
+const char *out_get_size_str(uint64_t size, int human);
+const char *out_get_percentage(double percentage);
+const char *out_get_checksum(void *addr, size_t len, uint64_t *csump,
+               uint64_t skip_off);
+const char *out_get_btt_map_entry(uint32_t map);
+const char *out_get_pool_type_str(pmem_pool_type_t type);
+const char *out_get_pool_signature(pmem_pool_type_t type);
+const char *out_get_tx_state_str(uint64_t state);
+const char *out_get_chunk_type_str(enum chunk_type type);
+const char *out_get_chunk_flags(uint16_t flags);
+const char *out_get_zone_magic_str(uint32_t magic);
+const char *out_get_pmemoid_str(PMEMoid oid, uint64_t uuid_lo);
+const char *out_get_arch_machine_class_str(uint8_t machine_class);
+const char *out_get_arch_data_str(uint8_t data);
+const char *out_get_arch_machine_str(uint16_t machine);
+const char *out_get_last_shutdown_str(uint8_t dirty);
+const char *out_get_alignment_desc_str(uint64_t ad, uint64_t cur_ad);
+const char *out_get_incompat_features_str(uint32_t incompat);
diff --git a/ceph/src/pmdk/src/tools/pmempool/pmempool.c b/ceph/src/pmdk/src/tools/pmempool/pmempool.c
new file mode 100644 (file)
index 0000000..077294f
--- /dev/null
@@ -0,0 +1,302 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * pmempool.c -- pmempool main source file
+ */
+
+#include <stdio.h>
+#include <libgen.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include "common.h"
+#include "output.h"
+#include "info.h"
+#include "create.h"
+#include "dump.h"
+#include "check.h"
+#include "rm.h"
+#include "convert.h"
+#include "synchronize.h"
+#include "transform.h"
+#include "feature.h"
+#include "set.h"
+#include "pmemcommon.h"
+
+#ifndef _WIN32
+#include "rpmem_common.h"
+#include "rpmem_util.h"
+#endif
+
+#define APPNAME        "pmempool"
+
+#define PMEMPOOL_TOOL_LOG_PREFIX "pmempool"
+#define PMEMPOOL_TOOL_LOG_LEVEL_VAR "PMEMPOOL_TOOL_LOG_LEVEL"
+#define PMEMPOOL_TOOL_LOG_FILE_VAR "PMEMPOOL_TOOL_LOG_FILE"
+
+/*
+ * command -- struct for pmempool commands definition
+ */
+struct command {
+       const char *name;
+       const char *brief;
+       int (*func)(const char *, int, char *[]);
+       void (*help)(const char *);
+};
+
+static const struct command *get_command(const char *cmd_str);
+static void print_help(const char *appname);
+
+/*
+ * long_options -- pmempool command line arguments
+ */
+static const struct option long_options[] = {
+       {"version",     no_argument,    NULL,   'V'},
+       {"help",        no_argument,    NULL,   'h'},
+       {NULL,          0,              NULL,    0 },
+};
+
+/*
+ * help_help -- prints help message for help command
+ */
+static void
+help_help(const char *appname)
+{
+       printf("Usage: %s help <command>\n", appname);
+}
+
+/*
+ * help_func -- prints help message for specified command
+ */
+static int
+help_func(const char *appname, int argc, char *argv[])
+{
+       if (argc > 1) {
+               char *cmd_str = argv[1];
+               const struct command *cmdp = get_command(cmd_str);
+
+               if (cmdp && cmdp->help) {
+                       cmdp->help(appname);
+                       return 0;
+               } else {
+                       outv_err("No help text for '%s' command\n", cmd_str);
+                       return -1;
+               }
+       } else {
+               print_help(appname);
+               return -1;
+       }
+}
+
+/*
+ * commands -- definition of all pmempool commands
+ */
+static const struct command commands[] = {
+       {
+               .name = "info",
+               .brief = "print information and statistics about a pool",
+               .func = pmempool_info_func,
+               .help = pmempool_info_help,
+       },
+       {
+               .name = "create",
+               .brief = "create a pool",
+               .func = pmempool_create_func,
+               .help = pmempool_create_help,
+       },
+       {
+               .name = "dump",
+               .brief = "dump user data from a pool",
+               .func = pmempool_dump_func,
+               .help = pmempool_dump_help,
+       },
+       {
+               .name = "check",
+               .brief = "check consistency of a pool",
+               .func = pmempool_check_func,
+               .help = pmempool_check_help,
+       },
+       {
+               .name = "rm",
+               .brief = "remove pool or poolset",
+               .func = pmempool_rm_func,
+               .help = pmempool_rm_help,
+       },
+       {
+               .name = "convert",
+               .brief = "perform pool layout conversion",
+               .func = pmempool_convert_func,
+               .help = pmempool_convert_help,
+       },
+       {
+               .name = "sync",
+               .brief = "synchronize data between replicas",
+               .func = pmempool_sync_func,
+               .help = pmempool_sync_help,
+       },
+       {
+               .name = "transform",
+               .brief = "modify internal structure of a poolset",
+               .func = pmempool_transform_func,
+               .help = pmempool_transform_help,
+       },
+       {
+               .name = "feature",
+               .brief = "toggle / query pool features",
+               .func = pmempool_feature_func,
+               .help = pmempool_feature_help,
+       },
+       {
+               .name = "help",
+               .brief = "print help text about a command",
+               .func = help_func,
+               .help = help_help,
+       },
+};
+
+/*
+ * number of pmempool commands
+ */
+#define COMMANDS_NUMBER        (sizeof(commands) / sizeof(commands[0]))
+
+/*
+ * print_version -- prints pmempool version message
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * print_usage -- prints pmempool usage message
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("usage: %s [--version] [--help] <command> [<args>]\n", appname);
+}
+
+/*
+ * print_help -- prints pmempool help message
+ */
+static void
+print_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf("\n");
+       printf("Options:\n");
+       printf("  -V, --version        display version\n");
+       printf("  -h, --help           display this help and exit\n");
+       printf("\n");
+       printf("The available commands are:\n");
+       unsigned i;
+       for (i = 0; i < COMMANDS_NUMBER; i++) {
+               const char *format = (strlen(commands[i].name) / 8)
+                               ? "%s\t- %s\n" : "%s\t\t- %s\n";
+               printf(format, commands[i].name, commands[i].brief);
+       }
+       printf("\n");
+       printf("For complete documentation see %s(1) manual page.\n", appname);
+}
+
+/*
+ * get_command -- returns command for specified command name
+ */
+static const struct command *
+get_command(const char *cmd_str)
+{
+       unsigned i;
+       for (i = 0; i < COMMANDS_NUMBER; i++) {
+               if (strcmp(cmd_str, commands[i].name) == 0)
+                       return &commands[i];
+       }
+
+       return NULL;
+}
+
+int
+main(int argc, char *argv[])
+{
+       int opt;
+       int option_index;
+       int ret = 0;
+#ifdef _WIN32
+       util_suppress_errmsg();
+       wchar_t **wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
+       for (int i = 0; i < argc; i++) {
+               argv[i] = util_toUTF8(wargv[i]);
+               if (argv[i] == NULL) {
+                       for (i--; i >= 0; i--)
+                               free(argv[i]);
+                       outv_err("Error during arguments conversion\n");
+                       return 1;
+               }
+       }
+#endif
+
+       common_init(PMEMPOOL_TOOL_LOG_PREFIX,
+                       PMEMPOOL_TOOL_LOG_LEVEL_VAR,
+                       PMEMPOOL_TOOL_LOG_FILE_VAR,
+                       0 /* major version */,
+                       0 /* minor version */);
+
+#ifndef _WIN32
+       util_remote_init();
+       rpmem_util_cmds_init();
+#endif
+
+       if (argc < 2) {
+               print_usage(APPNAME);
+               goto end;
+       }
+
+       while ((opt = getopt_long(2, argv, "Vh",
+                       long_options, &option_index)) != -1) {
+               switch (opt) {
+               case 'V':
+                       print_version(APPNAME);
+                       goto end;
+               case 'h':
+                       print_help(APPNAME);
+                       goto end;
+               default:
+                       print_usage(APPNAME);
+                       ret = 1;
+                       goto end;
+               }
+       }
+
+       char *cmd_str = argv[optind];
+
+       const struct command *cmdp = get_command(cmd_str);
+
+       if (cmdp) {
+               ret = cmdp->func(APPNAME, argc - 1, argv + 1);
+       } else {
+               outv_err("'%s' -- unknown command\n", cmd_str);
+               ret = 1;
+       }
+
+end:
+
+#ifndef _WIN32
+       util_remote_fini();
+       rpmem_util_cmds_fini();
+#endif
+
+       common_fini();
+
+#ifdef _WIN32
+       for (int i = argc; i > 0; i--)
+               free(argv[i - 1]);
+#endif
+       if (ret)
+               return 1;
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/pmempool.rc b/ceph/src/pmdk/src/tools/pmempool/pmempool.rc
new file mode 100644 (file)
index 0000000..19b8de3
Binary files /dev/null and b/ceph/src/pmdk/src/tools/pmempool/pmempool.rc differ
diff --git a/ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj b/ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj
new file mode 100644 (file)
index 0000000..15eaf83
--- /dev/null
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\libpmemblk\btt.c" />
+    <ClCompile Include="..\..\libpmemobj\alloc_class.c" />
+    <ClCompile Include="..\..\libpmemobj\bucket.c" />
+    <ClCompile Include="..\..\libpmemobj\container_ravl.c" />
+    <ClCompile Include="..\..\libpmemobj\container_seglists.c" />
+    <ClCompile Include="..\..\libpmemobj\critnib.c" />
+    <ClCompile Include="..\..\libpmemobj\heap.c" />
+    <ClCompile Include="..\..\libpmemobj\lane.c" />
+    <ClCompile Include="..\..\libpmemobj\list.c" />
+    <ClCompile Include="..\..\libpmemobj\memblock.c" />
+    <ClCompile Include="..\..\libpmemobj\memops.c" />
+    <ClCompile Include="..\..\libpmemobj\palloc.c" />
+    <ClCompile Include="..\..\libpmemobj\pmalloc.c" />
+    <ClCompile Include="..\..\common\ravl.c" />
+    <ClCompile Include="..\..\libpmemobj\recycler.c" />
+    <ClCompile Include="..\..\libpmemobj\sync.c" />
+    <ClCompile Include="..\..\libpmemobj\ulog.c" />
+    <ClCompile Include="..\..\libpmem2/badblocks.c" />
+    <ClCompile Include="check.c" />
+    <ClCompile Include="common.c" />
+    <ClCompile Include="convert.c" />
+    <ClCompile Include="create.c" />
+    <ClCompile Include="dump.c" />
+    <ClCompile Include="feature.c" />
+    <ClCompile Include="info.c" />
+    <ClCompile Include="info_blk.c" />
+    <ClCompile Include="info_log.c" />
+    <ClCompile Include="info_obj.c" />
+    <ClCompile Include="output.c" />
+    <ClCompile Include="pmempool.c" />
+    <ClCompile Include="rm.c" />
+    <ClCompile Include="synchronize.c" />
+    <ClCompile Include="transform.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="check.h" />
+    <ClInclude Include="common.h" />
+    <ClInclude Include="convert.h" />
+    <ClInclude Include="create.h" />
+    <ClInclude Include="dump.h" />
+    <ClInclude Include="feature.h" />
+    <ClInclude Include="info.h" />
+    <ClInclude Include="output.h" />
+    <ClInclude Include="rm.h" />
+    <ClInclude Include="synchronize.h" />
+    <ClInclude Include="transform.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\common\libpmemcommon.vcxproj">
+      <Project>{492baa3d-0d5d-478e-9765-500463ae69aa}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\libpmemblk\libpmemblk.vcxproj">
+      <Project>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\libpmemlog\libpmemlog.vcxproj">
+      <Project>{0b1818eb-bdc8-4865-964f-db8bf05cfd86}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\libpmemobj\libpmemobj.vcxproj">
+      <Project>{1baa1617-93ae-4196-8a1a-bd492fb18aef}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\libpmempool\libpmempool.vcxproj">
+      <Project>{cf9a0883-6334-44c7-ac29-349468c78e27}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\libpmem\libpmem.vcxproj">
+      <Project>{9e9e3d25-2139-4a5d-9200-18148ddead45}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\windows\getopt\getopt.vcxproj">
+      <Project>{9186eac4-2f34-4f17-b940-6585d7869bcd}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="pmempool.rc" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>pmempool</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LongPathSupport.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LongPathSupport.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <IncludePath>$(SolutionDir)\core;$(SolutionDir)\common;$(SolutionDir)\test\unittest;$(SolutionDir)\windows\include;$(SolutionDir)\include;$(SolutionDir)\windows\getopt;$(SolutionDir)\libpmemlog;$(SolutionDir)\libpmemblk;$(SolutionDir)\libpmemobj;$(SolutionDir)\libpmem2;$(IncludePath)</IncludePath>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <IncludePath>$(SolutionDir)\core;$(SolutionDir)\common;$(SolutionDir)\test\unittest;$(SolutionDir)\windows\include;$(SolutionDir)\include;$(SolutionDir)\windows\getopt;$(SolutionDir)\libpmemlog;$(SolutionDir)\libpmemblk;$(SolutionDir)\libpmemobj;$(SolutionDir)\libpmem2;$(IncludePath)</IncludePath>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>PMDK_UTF8_API;SDS_ENABLED; NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsC</CompileAs>
+      <PreprocessToFile>false</PreprocessToFile>
+      <TreatWarningAsError>true</TreatWarningAsError>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
+      <GenerateDebugInformation>Debug</GenerateDebugInformation>
+    </Link>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>PMDK_UTF8_API;SDS_ENABLED; NTDDI_VERSION=NTDDI_WIN10_RS1;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <CompileAs>CompileAsC</CompileAs>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <PreprocessToFile>false</PreprocessToFile>
+      <TreatWarningAsError>true</TreatWarningAsError>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
+      <GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
+    </Link>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj.filters b/ceph/src/pmdk/src/tools/pmempool/pmempool.vcxproj.filters
new file mode 100644 (file)
index 0000000..f4f60a9
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="libs">
+      <UniqueIdentifier>{c91552dc-7579-447b-ad7f-7b2307c52502}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="check.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="convert.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="create.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="dump.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="feature.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="info.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="info_blk.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="info_log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="info_obj.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pmempool.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="rm.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="synchronize.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="transform.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="common.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="output.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\alloc_class.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemblk\btt.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\bucket.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\container_ravl.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\container_seglists.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\critnib.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\lane.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\list.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\memblock.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\memops.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\palloc.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\pmalloc.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\common\ravl.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\recycler.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\sync.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\ulog.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmemobj\heap.c">
+      <Filter>libs</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\libpmem2/badblocks.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="check.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="common.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="convert.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="create.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="dump.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="feature.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="info.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="output.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="rm.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="synchronize.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="transform.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="pmempool.rc">
+      <Filter>Source Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/tools/pmempool/rm.c b/ceph/src/pmdk/src/tools/pmempool/rm.c
new file mode 100644 (file)
index 0000000..0f21403
--- /dev/null
@@ -0,0 +1,372 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2014-2018, Intel Corporation */
+
+/*
+ * rm.c -- pmempool rm command main source file
+ */
+
+#include <stdlib.h>
+#include <getopt.h>
+#include <unistd.h>
+#include <err.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+#include "os.h"
+#include "out.h"
+#include "common.h"
+#include "output.h"
+#include "file.h"
+#include "rm.h"
+#include "set.h"
+
+#ifdef USE_RPMEM
+#include "librpmem.h"
+#endif
+
+enum ask_type {
+       ASK_SOMETIMES,  /* ask before removing write-protected files */
+       ASK_ALWAYS,     /* always ask */
+       ASK_NEVER,      /* never ask */
+};
+
+/* verbosity level */
+static int vlevel;
+/* force remove and ignore errors */
+static int force;
+/* poolset files options */
+#define RM_POOLSET_NONE                (0)
+#define RM_POOLSET_LOCAL       (1 << 0)
+#define RM_POOLSET_REMOTE      (1 << 1)
+#define RM_POOLSET_ALL         (RM_POOLSET_LOCAL | RM_POOLSET_REMOTE)
+static int rm_poolset_mode;
+/* mode of interaction */
+static enum ask_type ask_mode;
+/* indicates whether librpmem is available */
+static int rpmem_avail;
+
+/* help message */
+static const char * const help_str =
+"Remove pool file or all files from poolset\n"
+"\n"
+"Available options:\n"
+"  -h, --help           Print this help message.\n"
+"  -v, --verbose        Be verbose.\n"
+"  -s, --only-pools     Remove only pool files (default).\n"
+"  -a, --all            Remove all poolset files - local and remote.\n"
+"  -l, --local          Remove local poolset files\n"
+"  -r, --remote         Remove remote poolset files\n"
+"  -f, --force          Ignore nonexisting files.\n"
+"  -i, --interactive    Prompt before every single removal.\n"
+"\n"
+"For complete documentation see %s-rm(1) manual page.\n";
+
+/* short options string */
+static const char *optstr = "hvsfialr";
+/* long options */
+static const struct option long_options[] = {
+       {"help",        no_argument,            NULL, 'h'},
+       {"verbose",     no_argument,            NULL, 'v'},
+       {"only-pools",  no_argument,            NULL, 's'},
+       {"all",         no_argument,            NULL, 'a'},
+       {"local",       no_argument,            NULL, 'l'},
+       {"remote",      no_argument,            NULL, 'r'},
+       {"force",       no_argument,            NULL, 'f'},
+       {"interactive", no_argument,            NULL, 'i'},
+       {NULL,          0,                      NULL,  0 },
+};
+
+/*
+ * print_usage -- print usage message
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("Usage: %s rm [<args>] <files>\n", appname);
+}
+
+/*
+ * pmempool_rm_help -- print help message
+ */
+void
+pmempool_rm_help(const char *appname)
+{
+       print_usage(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * rm_file -- remove single file
+ */
+static int
+rm_file(const char *file)
+{
+       int write_protected = os_access(file, W_OK) != 0;
+       char cask = 'y';
+       switch (ask_mode) {
+       case ASK_ALWAYS:
+               cask = '?';
+               break;
+       case ASK_NEVER:
+               cask = 'y';
+               break;
+       case ASK_SOMETIMES:
+               cask = write_protected ? '?' : 'y';
+               break;
+       default:
+               outv_err("unknown state");
+               return 1;
+       }
+
+       const char *pre_msg = write_protected ? "write-protected " : "";
+       char ans = ask_Yn(cask, "remove %sfile '%s' ?", pre_msg, file);
+       if (ans == 'y') {
+               if (util_unlink(file)) {
+                       outv_err("cannot remove file '%s'", file);
+                       return 1;
+               }
+
+               outv(1, "removed '%s'\n", file);
+       }
+
+       return 0;
+}
+
+/*
+ * remove_remote -- (internal) remove remote pool
+ */
+static int
+remove_remote(const char *target, const char *pool_set)
+{
+#ifdef USE_RPMEM
+       char cask = 'y';
+       switch (ask_mode) {
+       case ASK_ALWAYS:
+               cask = '?';
+               break;
+       case ASK_NEVER:
+       case ASK_SOMETIMES:
+               cask = 'y';
+               break;
+       default:
+               outv_err("unknown state");
+               return 1;
+       }
+
+       char ans = ask_Yn(cask, "remove remote pool '%s' on '%s'?",
+               pool_set, target);
+       if (ans == INV_ANS)
+               outv(1, "invalid answer\n");
+
+       if (ans != 'y')
+               return 0;
+
+       if (!rpmem_avail) {
+               if (force) {
+                       outv(1, "cannot remove '%s' on '%s' -- "
+                               "librpmem not available", pool_set, target);
+                       return 0;
+               }
+
+               outv_err("!cannot remove '%s' on '%s' -- "
+                       "librpmem not available", pool_set, target);
+               return 1;
+       }
+
+       int flags = 0;
+       if (rm_poolset_mode & RM_POOLSET_REMOTE)
+               flags |= RPMEM_REMOVE_POOL_SET;
+       if (force)
+               flags |= RPMEM_REMOVE_FORCE;
+
+       int ret = Rpmem_remove(target, pool_set, flags);
+       if (ret) {
+               if (force) {
+                       ret = 0;
+                       outv(1, "cannot remove '%s' on '%s'",
+                                       pool_set, target);
+               } else {
+                       /*
+                        * Callback cannot return < 0 value because it
+                        * is interpretted as error in parsing poolset file.
+                        */
+                       ret = 1;
+                       outv_err("!cannot remove '%s' on '%s'",
+                                       pool_set, target);
+               }
+       } else {
+               outv(1, "removed '%s' on '%s'\n",
+                               pool_set, target);
+       }
+
+       return ret;
+#else
+       outv_err("remote replication not supported");
+       return 1;
+#endif
+}
+
+/*
+ * rm_poolset_cb -- (internal) callback for removing replicas
+ */
+static int
+rm_poolset_cb(struct part_file *pf, void *arg)
+{
+       int *error = (int *)arg;
+       int ret;
+       if (pf->is_remote) {
+               ret = remove_remote(pf->remote->node_addr,
+                                       pf->remote->pool_desc);
+       } else {
+               const char *part_file = pf->part->path;
+
+               outv(2, "part file   : %s\n", part_file);
+
+               int exists = util_file_exists(part_file);
+               if (exists < 0)
+                       ret = 1;
+               else if (!exists) {
+                       /*
+                        * Ignore not accessible file if force
+                        * flag is set.
+                        */
+                       if (force)
+                               return 0;
+
+                       ret = 1;
+                       outv_err("!cannot remove file '%s'", part_file);
+               } else {
+                       ret = rm_file(part_file);
+               }
+       }
+
+       if (ret)
+               *error = ret;
+
+       return 0;
+}
+
+/*
+ * rm_poolset -- remove files parsed from poolset file
+ */
+static int
+rm_poolset(const char *file)
+{
+       int error = 0;
+       int ret = util_poolset_foreach_part(file, rm_poolset_cb, &error);
+       if (ret == -1) {
+               outv_err("parsing poolset failed: %s\n",
+                               out_get_errormsg());
+               return ret;
+       }
+
+       if (error && !force) {
+               outv_err("!removing '%s' failed\n", file);
+               return error;
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_rm_func -- main function for rm command
+ */
+int
+pmempool_rm_func(const char *appname, int argc, char *argv[])
+{
+       /* by default do not remove any poolset files */
+       rm_poolset_mode = RM_POOLSET_NONE;
+
+       int opt;
+       while ((opt = getopt_long(argc, argv, optstr,
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'h':
+                       pmempool_rm_help(appname);
+                       return 0;
+               case 'v':
+                       vlevel++;
+                       break;
+               case 's':
+                       rm_poolset_mode = RM_POOLSET_NONE;
+                       break;
+               case 'a':
+                       rm_poolset_mode |= RM_POOLSET_ALL;
+                       break;
+               case 'l':
+                       rm_poolset_mode |= RM_POOLSET_LOCAL;
+                       break;
+               case 'r':
+                       rm_poolset_mode |= RM_POOLSET_REMOTE;
+                       break;
+               case 'f':
+                       force = 1;
+                       ask_mode = ASK_NEVER;
+                       break;
+               case 'i':
+                       ask_mode = ASK_ALWAYS;
+                       break;
+               default:
+                       print_usage(appname);
+                       return 1;
+               }
+       }
+
+       out_set_vlevel(vlevel);
+
+       if (optind == argc) {
+               print_usage(appname);
+               return 1;
+       }
+
+#ifdef USE_RPMEM
+       /*
+        * Try to load librpmem, if loading failed -
+        * assume it is not available.
+        */
+       util_remote_init();
+       rpmem_avail = !util_remote_load();
+#endif
+
+       int lret = 0;
+       for (int i = optind; i < argc; i++) {
+               char *file = argv[i];
+               /* check if file exists and we can read it */
+               int exists = os_access(file, F_OK | R_OK) == 0;
+               if (!exists) {
+                       /* ignore not accessible file if force flag is set */
+                       if (force)
+                               continue;
+
+                       outv_err("!cannot remove '%s'", file);
+                       lret = 1;
+                       continue;
+               }
+
+               int is_poolset = util_is_poolset_file(file);
+               if (is_poolset < 0) {
+                       outv(1, "%s: cannot determine type of file", file);
+                       if (force)
+                               continue;
+               }
+
+               if (is_poolset)
+                       outv(2, "poolset file: %s\n", file);
+               else
+                       outv(2, "pool file   : %s\n", file);
+
+               int ret;
+               if (is_poolset) {
+                       ret = rm_poolset(file);
+                       if (!ret && (rm_poolset_mode & RM_POOLSET_LOCAL))
+                               ret = rm_file(file);
+               } else {
+                       ret = rm_file(file);
+               }
+
+               if (ret)
+                       lret = ret;
+       }
+
+       return lret;
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/rm.h b/ceph/src/pmdk/src/tools/pmempool/rm.h
new file mode 100644 (file)
index 0000000..5191574
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2014-2020, Intel Corporation */
+
+/*
+ * rm.h -- pmempool rm command header file
+ */
+
+void pmempool_rm_help(const char *appname);
+int pmempool_rm_func(const char *appname, int argc, char *argv[]);
diff --git a/ceph/src/pmdk/src/tools/pmempool/synchronize.c b/ceph/src/pmdk/src/tools/pmempool/synchronize.c
new file mode 100644 (file)
index 0000000..7015336
--- /dev/null
@@ -0,0 +1,157 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * synchronize.c -- pmempool sync command source file
+ */
+
+#include "synchronize.h"
+
+#include <stdio.h>
+#include <libgen.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include <sys/mman.h>
+#include <endian.h>
+#include "common.h"
+#include "output.h"
+#include "libpmempool.h"
+
+/*
+ * pmempool_sync_context -- context and arguments for sync command
+ */
+struct pmempool_sync_context {
+       unsigned flags;         /* flags which modify the command execution */
+       char *poolset_file;     /* a path to a poolset file */
+};
+
+/*
+ * pmempool_sync_default -- default arguments for sync command
+ */
+static const struct pmempool_sync_context pmempool_sync_default = {
+       .flags          = 0,
+       .poolset_file   = NULL,
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Check consistency of a pool\n"
+"\n"
+"Common options:\n"
+"  -b, --bad-blocks     fix bad blocks - it requires creating or reading special recovery files\n"
+"  -d, --dry-run        do not apply changes, only check for viability of synchronization\n"
+"  -v, --verbose        increase verbosity level\n"
+"  -h, --help           display this help and exit\n"
+"\n"
+"For complete documentation see %s-sync(1) manual page.\n"
+;
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"bad-blocks",  no_argument,            NULL,   'b'},
+       {"dry-run",     no_argument,            NULL,   'd'},
+       {"help",        no_argument,            NULL,   'h'},
+       {"verbose",     no_argument,            NULL,   'v'},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * print_usage -- (internal) print application usage short description
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("usage: %s sync [<options>] <poolset_file>\n", appname);
+}
+
+/*
+ * print_version -- (internal) print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_sync_help -- print help message for the sync command
+ */
+void
+pmempool_sync_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * pmempool_sync_parse_args -- (internal) parse command line arguments
+ */
+static int
+pmempool_sync_parse_args(struct pmempool_sync_context *ctx, const char *appname,
+               int argc, char *argv[])
+{
+       int opt;
+       while ((opt = getopt_long(argc, argv, "bdhv",
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'd':
+                       ctx->flags |= PMEMPOOL_SYNC_DRY_RUN;
+                       break;
+               case 'b':
+                       ctx->flags |= PMEMPOOL_SYNC_FIX_BAD_BLOCKS;
+                       break;
+               case 'h':
+                       pmempool_sync_help(appname);
+                       exit(EXIT_SUCCESS);
+               case 'v':
+                       out_set_vlevel(1);
+                       break;
+               default:
+                       print_usage(appname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (optind < argc) {
+               ctx->poolset_file = argv[optind];
+       } else {
+               print_usage(appname);
+               exit(EXIT_FAILURE);
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_sync_func -- main function for the sync command
+ */
+int
+pmempool_sync_func(const char *appname, int argc, char *argv[])
+{
+       int ret = 0;
+       struct pmempool_sync_context ctx = pmempool_sync_default;
+
+       /* parse command line arguments */
+       if ((ret = pmempool_sync_parse_args(&ctx, appname, argc, argv)))
+               return ret;
+
+       ret = pmempool_sync(ctx.poolset_file, ctx.flags);
+
+       if (ret) {
+               outv_err("failed to synchronize: %s\n", pmempool_errormsg());
+               if (errno)
+                       outv_err("%s\n", strerror(errno));
+               return -1;
+       } else {
+               outv(1, "%s: synchronized\n", ctx.poolset_file);
+               return 0;
+       }
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/synchronize.h b/ceph/src/pmdk/src/tools/pmempool/synchronize.h
new file mode 100644 (file)
index 0000000..32c044d
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * synchronize.h -- pmempool sync command header file
+ */
+
+int pmempool_sync_func(const char *appname, int argc, char *argv[]);
+void pmempool_sync_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmempool/transform.c b/ceph/src/pmdk/src/tools/pmempool/transform.c
new file mode 100644 (file)
index 0000000..a749880
--- /dev/null
@@ -0,0 +1,160 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2018, Intel Corporation */
+
+/*
+ * transform.c -- pmempool transform command source file
+ */
+
+#include <stdio.h>
+#include <libgen.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <stdbool.h>
+#include <sys/mman.h>
+#include <endian.h>
+#include "common.h"
+#include "output.h"
+#include "transform.h"
+#include "libpmempool.h"
+
+/*
+ * pmempool_transform_context -- context and arguments for transform command
+ */
+struct pmempool_transform_context {
+       unsigned flags;         /* flags which modify the command execution */
+       char *poolset_file_src; /* a path to a source poolset file */
+       char *poolset_file_dst; /* a path to a target poolset file */
+};
+
+/*
+ * pmempool_transform_default -- default arguments for transform command
+ */
+static const struct pmempool_transform_context pmempool_transform_default = {
+       .flags                  = 0,
+       .poolset_file_src       = NULL,
+       .poolset_file_dst       = NULL,
+};
+
+/*
+ * help_str -- string for help message
+ */
+static const char * const help_str =
+"Modify internal structure of a poolset\n"
+"\n"
+"Common options:\n"
+"  -d, --dry-run        do not apply changes, only check for viability of"
+" transformation\n"
+"  -v, --verbose        increase verbosity level\n"
+"  -h, --help           display this help and exit\n"
+"\n"
+"For complete documentation see %s-transform(1) manual page.\n"
+;
+
+/*
+ * long_options -- command line options
+ */
+static const struct option long_options[] = {
+       {"dry-run",     no_argument,            NULL,   'd'},
+       {"help",        no_argument,            NULL,   'h'},
+       {"verbose",     no_argument,            NULL,   'v'},
+       {NULL,          0,                      NULL,    0 },
+};
+
+/*
+ * print_usage -- print application usage short description
+ */
+static void
+print_usage(const char *appname)
+{
+       printf("usage: %s transform [<options>] <poolset_file_src>"
+                       " <poolset_file_dst>\n", appname);
+}
+
+/*
+ * print_version -- print version string
+ */
+static void
+print_version(const char *appname)
+{
+       printf("%s %s\n", appname, SRCVERSION);
+}
+
+/*
+ * pmempool_transform_help -- print help message for the transform command
+ */
+void
+pmempool_transform_help(const char *appname)
+{
+       print_usage(appname);
+       print_version(appname);
+       printf(help_str, appname);
+}
+
+/*
+ * pmempool_check_parse_args -- parse command line arguments
+ */
+static int
+pmempool_transform_parse_args(struct pmempool_transform_context *ctx,
+               const char *appname, int argc, char *argv[])
+{
+       int opt;
+       while ((opt = getopt_long(argc, argv, "dhv",
+                       long_options, NULL)) != -1) {
+               switch (opt) {
+               case 'd':
+                       ctx->flags = PMEMPOOL_TRANSFORM_DRY_RUN;
+                       break;
+               case 'h':
+                       pmempool_transform_help(appname);
+                       exit(EXIT_SUCCESS);
+               case 'v':
+                       out_set_vlevel(1);
+                       break;
+               default:
+                       print_usage(appname);
+                       exit(EXIT_FAILURE);
+               }
+       }
+
+       if (optind + 1 < argc) {
+               ctx->poolset_file_src = argv[optind];
+               ctx->poolset_file_dst = argv[optind + 1];
+       } else {
+               print_usage(appname);
+               exit(EXIT_FAILURE);
+       }
+
+       return 0;
+}
+
+/*
+ * pmempool_transform_func -- main function for the transform command
+ */
+int
+pmempool_transform_func(const char *appname, int argc, char *argv[])
+{
+       int ret;
+       struct pmempool_transform_context ctx = pmempool_transform_default;
+
+       /* parse command line arguments */
+       if ((ret = pmempool_transform_parse_args(&ctx, appname, argc, argv)))
+               return ret;
+
+       ret = pmempool_transform(ctx.poolset_file_src, ctx.poolset_file_dst,
+                       ctx.flags);
+
+       if (ret) {
+               if (errno)
+                       outv_err("%s\n", strerror(errno));
+               outv_err("failed to transform %s -> %s: %s\n",
+                               ctx.poolset_file_src, ctx.poolset_file_dst,
+                               pmempool_errormsg());
+               return -1;
+       } else {
+               outv(1, "%s -> %s: transformed\n", ctx.poolset_file_src,
+                               ctx.poolset_file_dst);
+               return 0;
+       }
+}
diff --git a/ceph/src/pmdk/src/tools/pmempool/transform.h b/ceph/src/pmdk/src/tools/pmempool/transform.h
new file mode 100644 (file)
index 0000000..6f0192f
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * transform.h -- pmempool transform command header file
+ */
+
+int pmempool_transform_func(const char *appname, int argc, char *argv[]);
+void pmempool_transform_help(const char *appname);
diff --git a/ceph/src/pmdk/src/tools/pmreorder/Makefile b/ceph/src/pmdk/src/tools/pmreorder/Makefile
new file mode 100644 (file)
index 0000000..f6bcc4d
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+#
+# Makefile -- Makefile for pmreorder
+#
+
+include ../Makefile.inc
+
+FLAKE8 := $(shell flake8 --version 2>/dev/null)
+
+cstyle:
+ifdef FLAKE8
+       flake8 .
+else
+       @echo "Flake8 not found. Python files check skipped."
+endif
diff --git a/ceph/src/pmdk/src/tools/pmreorder/binaryoutputhandler.py b/ceph/src/pmdk/src/tools/pmreorder/binaryoutputhandler.py
new file mode 100644 (file)
index 0000000..868ccb4
--- /dev/null
@@ -0,0 +1,218 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+import utils
+from reorderexceptions import InconsistentFileException
+
+
+class BinaryOutputHandler:
+    """
+    Handle :class:`BinaryFile` objects.
+
+    Creates and aggregates :class:`BinaryFile` objects for ease of use.
+    Implements methods for batch handling of aggregated files.
+
+    :ivar _files: A list of registered files, most recent last.
+    :type _files: list
+    """
+
+    def __init__(self, checker):
+        """
+        Binary handler constructor.
+
+        :param checker: consistency checker object
+        :type checker: ConsistencyCheckerBase
+        """
+        self._files = []
+        self._checker = checker
+
+    def add_file(self, file, map_base, size):
+        """
+        Create and append a mapped file to :attr:`_files`.
+
+        :param file: Full path of the mapped file to be added.
+        :type file: str
+        :param map_base: Base address of the mapped file.
+        :type map_base: int
+        :param size: Size of the file.
+        :type size: int
+        :return: None
+        """
+        self._files.append(BinaryFile(file, map_base, size, self._checker))
+
+    def remove_file(self, file):
+        """Remove file from :attr:`_files`.
+
+        :param file: File to be removed.
+        :type file: str
+        :return: None
+        """
+        for bf in self._files:
+            if bf.file_name is file:
+                self._files.remove(bf)
+
+    def do_store(self, store_op):
+        """
+        Perform a store to the given file.
+
+        The file is chosen based on the address and size
+        of the store.
+
+        :param store_op: The store operation to be performed.
+        :type store_op: Store
+        :return: None
+        :raises: Generic exception - to be precised later.
+        """
+        store_ok = False
+        for bf in self._files:
+            if utils.range_cmp(store_op, bf) == 0:
+                bf.do_store(store_op)
+                store_ok = True
+        if not store_ok:
+            raise OSError(
+                          "No suitable file found for store {}"
+                          .format(store_op))
+
+    def do_revert(self, store_op):
+        """
+        Reverts a store made to a file.
+
+        Performing a revert on a store that has not been made
+        previously yields undefined behavior.
+
+        :param store_op: The store to be reverted.
+        :type store_op: Store
+        :return: None
+        :raises: Generic exception - to be precised later.
+        """
+        revert_ok = False
+        for bf in self._files:
+            if utils.range_cmp(store_op, bf) == 0:
+                bf.do_revert(store_op)
+                revert_ok = True
+        if not revert_ok:
+            raise OSError(
+                          "No suitable file found for store {}"
+                          .format(store_op))
+
+    def check_consistency(self):
+        """
+        Checks consistency of each registered file.
+
+        :return: None
+        :raises: Generic exception - to be precised later.
+        """
+        for bf in self._files:
+            if not bf.check_consistency():
+                raise InconsistentFileException(
+                          "File {} inconsistent".format(bf))
+
+
+class BinaryFile(utils.Rangeable):
+    """Binary file handler.
+
+    It is a handler for binary file operations. Internally it
+    uses mmap to write to and read from the file.
+
+    :ivar _file_name: Full path of the mapped file.
+    :type _file_name: str
+    :ivar _map_base: Base address of the mapped file.
+    :type _map_base: int
+    :ivar _map_max: Max address of the mapped file.
+    :type _map_max: int
+    :ivar _file_map: Memory mapped from the file.
+    :type _file_map: mmap.mmap
+    :ivar _checker: consistency checker object
+    :type _checker: ConsistencyCheckerBase
+    """
+
+    def __init__(self, file_name, map_base, size, checker):
+        """
+        Initializes the binary file handler.
+
+        :param file_name: Full path of the mapped file to be added.
+        :type file_name: str
+        :param map_base: Base address of the mapped file.
+        :type map_base: int
+        :param size: Size of the file.
+        :type size: int
+        :param checker: consistency checker object
+        :type checker: ConsistencyCheckerBase
+        :return: None
+        """
+        self._file_name = file_name
+        self._map_base = map_base
+        self._map_max = map_base + size
+        # TODO consider mmaping only necessary parts on demand
+        self._file_map = utils.memory_map(file_name)
+        self._checker = checker
+
+    def __str__(self):
+        return self._file_name
+
+    def do_store(self, store_op):
+        """
+        Perform the store on the file.
+
+        The store records the old value for reverting.
+
+        :param store_op: The store to be performed.
+        :type store_op: Store
+        :return: None
+        """
+        base_off = store_op.get_base_address() - self._map_base
+        max_off = store_op.get_max_address() - self._map_base
+        # read and save old value
+        store_op.old_value = bytes(self._file_map[base_off:max_off])
+        # write out the new value
+        self._file_map[base_off:max_off] = store_op.new_value
+        self._file_map.flush(base_off & ~4095, 4096)
+
+    def do_revert(self, store_op):
+        """
+        Reverts the store.
+
+        Write back the old value recorded while doing the store.
+        Reverting a store which has not been made previously has
+        undefined behavior.
+
+        :param store_op: The store to be reverted.
+        :type store_op: Store
+        :return: None
+        """
+        base_off = store_op.get_base_address() - self._map_base
+        max_off = store_op.get_max_address() - self._map_base
+        # write out the old value
+        self._file_map[base_off:max_off] = store_op.old_value
+        self._file_map.flush(base_off & ~4095, 4096)
+
+    def check_consistency(self):
+        """
+        Check consistency of the file.
+
+        :return: True if consistent, False otherwise.
+        :rtype: bool
+        """
+        return self._checker.check_consistency(self._file_name) == 0
+
+    def get_base_address(self):
+        """
+        Returns the base address of the file.
+
+        Overrides from :class:`utils.Rangeable`.
+
+        :return: The base address of the mapping passed to the constructor.
+        :rtype: int
+        """
+        return self._map_base
+
+    def get_max_address(self):
+        """
+        Get max address of the file mapping.
+
+        Overrides from :class:`utils.Rangeable`.
+
+        :return: The max address of the mapping.
+        :rtype: int
+        """
+        return self._map_max
diff --git a/ceph/src/pmdk/src/tools/pmreorder/consistencycheckwrap.py b/ceph/src/pmdk/src/tools/pmreorder/consistencycheckwrap.py
new file mode 100644 (file)
index 0000000..91fa46a
--- /dev/null
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+from sys import exit
+from os import path
+from ctypes import cdll, c_char_p, c_int
+import os
+
+checkers = ["prog", "lib"]
+
+
+class ConsistencyCheckerBase:
+    """
+    Base class for consistency checker classes.
+    Checker of each type should implement check_consistency method.
+    """
+    def check_consistency(self, filename):
+        pass
+
+
+class LibChecker(ConsistencyCheckerBase):
+    """
+    Allows registration of a consistency checking function and verifying
+    the consistency of a file.
+
+    The function has to be in a shared library. It is then used to check
+    consistency of an arbitrary file. The function has to take a file name
+    as the only parameter and return an int: 0 for inconsistent, 1 for
+    consistent. The prototype of the function::
+
+        int func_name(const char* file_name)
+    """
+
+    def __init__(self, library_name, func_name):
+        """
+        Loads the consistency checking function from the given library.
+
+        :param library_name: The full name of the library.
+        :type library_name: str
+        :param func_name: The name of the consistency
+                          checking function within the library.
+        :type func_name: str
+        :return: None
+        """
+        self._lib_func = getattr(cdll.LoadLibrary(library_name), func_name)
+        self._lib_func.argtypes = [c_char_p]
+        self._lib_func.restype = c_int
+
+    def check_consistency(self, filename):
+        """
+        Checks the consistency of a given file
+        using the previously loaded function.
+
+        :param filename: The full name of the file to be checked.
+        :type filename: str
+        :return: 1 if file is consistent, 0 otherwise.
+        :rtype: int
+        :raises: Generic exception, when no function has been loaded.
+        """
+        if self._lib_func is None:
+            raise RuntimeError("Consistency check function not loaded")
+        return self._lib_func(filename)
+
+
+class ProgChecker(ConsistencyCheckerBase):
+    """
+    Allows registration of a consistency checking program and verifying
+    the consistency of a file.
+    """
+
+    def __init__(self, bin_path, bin_args):
+        self._bin_path = bin_path
+        self._bin_cmd = bin_args
+
+    def check_consistency(self, filename):
+        """
+        Checks the consistency of a given file
+        using the previously loaded function.
+
+        :param filename: The full name of the file to be checked.
+        :type filename: str
+        :return: 1 if file is consistent, 0 otherwise.
+        :rtype: int
+        :raises: Generic exception, when no function has been loaded.
+        """
+        if self._bin_path is None or self._bin_cmd is None:
+            raise RuntimeError("consistency check handle not set")
+        return os.system(self._bin_path + " " + self._bin_cmd + " " + filename)
+
+
+def get_checker(checker_type, checker_path_args, name):
+
+    checker_path_args = checker_path_args.split(" ", 1)
+    checker_path = checker_path_args[0]
+
+    # check for params
+    if len(checker_path_args) > 1:
+        args = checker_path_args[1]
+    else:
+        args = ""
+
+    if not path.exists(checker_path):
+        print("Invalid path:" + checker_path)
+        exit(1)
+
+    checker = None
+    if checker_type == "prog":
+        checker = ProgChecker(checker_path, args)
+    elif checker_type == "lib":
+        checker = LibChecker(checker_path, name)
+
+    return checker
diff --git a/ceph/src/pmdk/src/tools/pmreorder/loggingfacility.py b/ceph/src/pmdk/src/tools/pmreorder/loggingfacility.py
new file mode 100644 (file)
index 0000000..c6f2fab
--- /dev/null
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+import logging
+
+log_levels = ["debug", "info", "warning", "error", "critical"]
+
+
+class LoggingBase:
+    def debug(self, text):
+        pass
+
+    def info(self, text):
+        pass
+
+    def warning(self, text):
+        pass
+
+    def error(self, text):
+        pass
+
+    def critical(self, text):
+        pass
+
+
+class DefaultFileLogger(LoggingBase):
+    def __init__(self, name="pmreorder", **kwargs):
+        logging.basicConfig(**kwargs)
+        self.__logger = logging.getLogger(name)
+
+    def debug(self, text):
+        self.__logger.debug(text)
+
+    def info(self, text):
+        self.__logger.info(text)
+
+    def warning(self, text):
+        self.__logger.warning(text)
+
+    def error(self, text):
+        self.__logger.error(text)
+
+    def critical(self, text):
+        self.__logger.critical(text)
+
+
+class DefaultPrintLogger(LoggingBase):
+
+    def debug(self, text):
+        print("DEBUG:", text)
+
+    def info(self, text):
+        print("INFO:", text)
+
+    def warning(self, text):
+        print("WARNING:", text)
+
+    def error(self, text):
+        print("ERROR:", text)
+
+    def critical(self, text):
+        print("CRITICAL:", text)
+
+
+def get_logger(log_output, log_level=None):
+    logger = None
+    # check if log_level is valid
+    log_level = "warning" if log_level is None else log_level
+    numeric_level = getattr(logging, log_level.upper())
+    if not isinstance(numeric_level, int):
+        raise ValueError('Invalid log level: {}'.format(log_level.upper()))
+
+    if log_output is None:
+        logger = DefaultPrintLogger()
+    else:
+        logger = DefaultFileLogger(filename=log_output, level=numeric_level)
+    return logger
diff --git a/ceph/src/pmdk/src/tools/pmreorder/markerparser.py b/ceph/src/pmdk/src/tools/pmreorder/markerparser.py
new file mode 100644 (file)
index 0000000..c9e41c2
--- /dev/null
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+
+import os
+import json
+
+
+class MarkerParser:
+    """
+    Parse marker config file and command line arg provided by user
+    via -x parameter.
+    """
+    def marker_file_parser(self, macros):
+        """
+        Parse markers passed by file.
+        They should be in json format:
+        { "MARKER_NAME"="ENGINE_TYPE" } and separated by commas.
+        """
+        markers = {}
+        try:
+            with open(macros) as config_file:
+                markers = json.load(config_file)
+        except json.decoder.JSONDecodeError:
+            print("Invalid config macros file format: ", macros,
+                  "Use: {\"MARKER_NAME1\"=\"ENGINE_TYPE1\","
+                  "\"MARKER_NAME2\"=\"ENGINE_TYPE2\"}")
+
+        return markers
+
+    def marker_cli_parser(self, macros):
+        """
+        Parse markers passed by cli.
+        They should be in specific format:
+        MARKER_NAME=ENGINE_TYPE and separated by commas.
+        """
+        try:
+            markers_array = macros.split(",")
+            return dict(pair.split('=') for pair in markers_array)
+        except ValueError:
+            print("Invalid extended macros format: ", macros,
+                  "Use: MARKER_NAME1=ENGINE_TYPE1,MARKER_NAME2=ENGINE_TYPE2")
+
+    def get_markers(self, markerset):
+        """
+        Parse markers based on their format.
+        """
+        if markerset is not None:
+            if os.path.exists(markerset):
+                return self.marker_file_parser(markerset)
+            else:
+                return self.marker_cli_parser(markerset)
diff --git a/ceph/src/pmdk/src/tools/pmreorder/memoryoperations.py b/ceph/src/pmdk/src/tools/pmreorder/memoryoperations.py
new file mode 100644 (file)
index 0000000..509ab7e
--- /dev/null
@@ -0,0 +1,413 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+from utils import Rangeable
+from utils import range_cmp
+from utils import StackTrace
+from sys import byteorder
+
+
+class BaseOperation:
+    """
+    Base class for all memory operations.
+    """
+    pass
+
+
+class Fence(BaseOperation):
+    """
+    Describes a fence operation.
+
+    The exact type of the memory barrier is not important,
+    it is interpreted as an SFENCE or MFENCE.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New Fence object.
+            :rtype: Fence
+            """
+            return Fence()
+
+
+class Store(BaseOperation, Rangeable):
+    """
+    Describes a store operation.
+
+    :ivar address: The virtual address at which to store the new value.
+    :type address: int
+    :ivar new_value: The new value to be written.
+    :type new_value: bytearray
+    :ivar size: The size of the store in bytes.
+    :type size: int
+    :ivar old_value: The old value read from the file.
+    :type old_value: bytearray
+    :ivar flushed: Indicates whether the store has been flushed.
+    :type flushed: bool
+    """
+    def __init__(self, values):
+        """
+        Initializes the object based on the describing string.
+
+        :param values: Pre-formatted string describing the store.
+        :type values: str
+        :return: None
+        """
+        params = values.split(";")
+        # calculate the offset given the registered file mapping
+        self.address = int(params[1], 16)
+        self.size = int(params[3], 16)
+        self.new_value = \
+            int(params[2], 16).to_bytes(self.size, byteorder=byteorder)
+        if len(params) > 4:
+            self.trace = StackTrace(params[4:])
+        else:
+            self.trace = StackTrace(["No trace available", ])
+        self.old_value = None
+        self.flushed = False
+
+    def __str__(self):
+        return "addr: " + hex(self.address) + " size " + \
+            str(self.size) + " value " + str(self.new_value)
+
+    def get_base_address(self):
+        """
+        Override from :class:`utils.Rangeable`.
+
+        :return: Virtual address of the store.
+        :rtype: int
+        """
+        return self.address
+
+    def get_max_address(self):
+        """
+        Override from :class:`utils.Rangeable`.
+
+        :return: Virtual address of the first byte after the store.
+        :rtype: int
+        """
+        return self.address + self.size
+
+    class Factory():
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Pre-formatted string describing the store.
+            :type values: str
+            :return: New Store object.
+            :rtype: Store
+            """
+            return Store(values)
+
+
+class FlushBase(BaseOperation, Rangeable):
+    """
+    Base class for flush operations.
+    """
+    def is_in_flush(self, store_op):
+        """
+        Check if a given store is within the flush.
+
+        :param store_op: Store operation to check.
+        :return: True if store is in flush, false otherwise.
+        :rtype: bool
+        """
+        raise NotImplementedError
+
+
+class Flush(FlushBase):
+    """
+    Describes a flush operation.
+
+    Examples of flush instructions are CLFLUSH, CLFLUSHOPT or CLWB.
+
+    :ivar _address: Virtual address of the flush.
+    :type _address: int
+    :ivar _size: The size of the flush in bytes (should be cache line aligned).
+    :type _size: int
+    """
+    def __init__(self, values):
+        """
+        Initializes the object based on the describing string.
+
+        :param values: Pre-formatted string describing the flush.
+        :type values: str
+        :return: None
+        """
+        params = values.split(";")
+        self._address = int(params[1], 16)
+        self._size = int(params[2], 16)
+
+    def is_in_flush(self, store_op):
+        """
+        Override from :class:`FlushBase`.
+
+        :param store_op: Store operation to check.
+        :return: True if store is in flush, false otherwise.
+        :rtype: bool
+        """
+        if range_cmp(store_op, self) == 0:
+            return True
+        else:
+            return False
+
+    def get_base_address(self):
+        """
+        Override from :class:`utils.Rangeable`.
+
+        :return: Virtual address of the flush.
+        :rtype: int
+        """
+        return self._address
+
+    def get_max_address(self):
+        """
+        Override from :class:`utils.Rangeable`.
+
+        :return: Virtual address of the first byte after the flush.
+        :rtype: int
+        """
+        return self._address + self._size
+
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Pre-formatted string describing the flush.
+            :type values: str
+            :return: New Flush object.
+            :rtype: Flush
+            """
+            return Flush(values)
+
+
+class ReorderBase(BaseOperation):
+    """
+    Base class for all reorder type classes.
+    """
+    pass
+
+
+class NoReorderDoCheck(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing the whole sequence of stores
+    between barriers.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New NoReorderDoCheck object.
+            :rtype: NoReorderDoCheck
+            """
+            return NoReorderDoCheck()
+
+
+class ReorderFull(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing all possible sequences of stores
+    between barriers.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New ReorderFull object.
+            :rtype: ReorderFull
+            """
+            return ReorderFull()
+
+
+class ReorderAccumulative(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing all
+    possible accumulative sequences of stores
+    between barriers.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New ReorderAccumulative object.
+            :rtype: ReorderAccumulative
+            """
+            return ReorderAccumulative()
+
+
+class ReorderReverseAccumulative(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing all
+    possible reverted accumulative sequences of stores
+    between barriers.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New ReorderReverseAccumulative object.
+            :rtype: ReorderReverseAccumulative
+            """
+            return ReorderReverseAccumulative()
+
+
+class NoReorderNoCheck(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing the whole sequence of stores
+    between barriers. It additionally marks that no consistency checking
+    is to be made.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New NoReorderNoCheck object.
+            :rtype: NoReorderNoCheck
+            """
+            return NoReorderNoCheck()
+
+
+class ReorderDefault(ReorderBase):
+    """
+    Describes the default reordering engine to be used.
+
+    This marker class triggers default reordering.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: ReorderDefault object.
+            :rtype: ReorderDefault
+            """
+            return ReorderDefault()
+
+
+class ReorderPartial(ReorderBase):
+    """
+    Describes the type of reordering engine to be used.
+
+    This marker class triggers writing a subset of all possible
+    sequences of stores between barriers.
+
+    The type of partial reordering is chosen at runtime. Not yet
+    implemented.
+    """
+    class Factory:
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Ignored.
+            :type values: str
+            :return: New ReorderPartial object.
+            :rtype: ReorderPartial
+            """
+            return ReorderPartial()
+
+
+class Register_file(BaseOperation):
+    """
+    Describes the file to be mapped into processes address space.
+
+    :ivar name: The full name of the file.
+    :type name: str
+    :ivar address: The base address where the file was mapped.
+    :type address: int
+    :ivar size: The size of the mapping.
+    :type size: int
+    :ivar offset: The start offset of the mapping within the file.
+    :type offset: int
+    """
+    def __init__(self, values):
+        """
+        Initializes the object based on the describing string.
+
+        :param values: Pre-formatted string describing the flush.
+        :type values: str
+        :return: None
+        """
+        params = values.split(";")
+        self.name = params[1]
+        self.address = int(params[2], 16)
+        self.size = int(params[3], 16)
+        self.offset = int(params[4], 16)
+
+    class Factory():
+        """
+        Internal factory class to be used in dynamic object creation.
+        """
+        def create(self, values):
+            """
+            Factory object creation method.
+
+            :param values: Pre-formatted string
+                           describing the file registration.
+            :type values: str
+            :return: New Register_file object.
+            :rtype: Register_file
+            """
+            return Register_file(values)
diff --git a/ceph/src/pmdk/src/tools/pmreorder/operationfactory.py b/ceph/src/pmdk/src/tools/pmreorder/operationfactory.py
new file mode 100644 (file)
index 0000000..81362ac
--- /dev/null
@@ -0,0 +1,145 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2019, Intel Corporation
+
+import memoryoperations
+from reorderexceptions import NotSupportedOperationException
+
+
+class OperationFactory:
+    """
+    An abstract memory operation factory.
+
+    This object factory puts special constraints on names of classes.
+    It creates objects based on log in string format, as such the
+    classes have to start with a capital letter and the rest of the
+    name has to be in lowercase. For example::
+
+        STORE -> Store
+        FULL_REORDER -> Full_reorder
+
+    The object to be created has to have and internal **Factory** class
+    with a :func:`create` method taking a string parameter. For example see
+    :class:`memoryoperations.Store`.
+
+    :cvar __factories: The registered object factories.
+    :type __factories: dict
+    """
+    __factories = {}
+    __suffix = ['.BEGIN', '.END']
+    memoryoperations.BaseOperation()
+
+    @staticmethod
+    def add_factory(id_, operation_factory):
+        """
+        Explicitly register an object factory.
+
+        This method should be used when the factory cannot be inferred
+        from the name of the object to be created.
+
+        :param id_: The id under which this factory is to be registered
+            in the dictionary.
+        :type id_: str
+        :param operation_factory: The operation factory to be registered.
+        :return: None
+        """
+        OperationFactory.__factories[id_] = operation_factory
+
+    @staticmethod
+    def create_operation(string_operation, markers, stack):
+
+        def check_marker_format(marker):
+            """
+            Checks if marker has proper suffix.
+            """
+            for s in OperationFactory.__suffix:
+                if marker.endswith(s):
+                    return
+
+            raise NotSupportedOperationException(
+                        "Incorrect marker format {}, suffix is missing."
+                        .format(marker))
+
+        def check_pair_consistency(stack, marker):
+            """
+            Checks if markers do not cross.
+            You can pop from stack only if end
+            marker match previous one.
+
+            Example OK:
+                MACRO1.BEGIN
+                    MACRO2.BEGIN
+                    MACRO2.END
+                MACRO1.END
+
+            Example NOT OK:
+                MACRO1.BEGIN
+                    MACRO2.BEGIN
+                MACRO1.END
+                    MACRO2.END
+            """
+            top = stack[-1][0]
+            if top.endswith(OperationFactory.__suffix[0]):
+                top = top[:-len(OperationFactory.__suffix[0])]
+            if marker.endswith(OperationFactory.__suffix[-1]):
+                marker = marker[:-len(OperationFactory.__suffix[-1])]
+
+            if top != marker:
+                raise NotSupportedOperationException(
+                        "Cannot cross markers: {0}, {1}"
+                        .format(top, marker))
+
+        """
+        Creates the object based on the pre-formatted string.
+
+        The string needs to be in the specific format. Each specific value
+        in the string has to be separated with a `;`. The first field
+        has to be the name of the operation, the rest are operation
+        specific values.
+
+        :param string_operation: The string describing the operation.
+        :param markers: The dict describing the pair marker-engine.
+        :param stack: The stack describing the order of engine changes.
+        :return: The specific object instantiated based on the string.
+        """
+        id_ = string_operation.split(";")[0]
+        id_case_sensitive = id_.lower().capitalize()
+
+        # checks if id_ is one of memoryoperation classes
+        mem_ops = getattr(memoryoperations, id_case_sensitive, None)
+
+        # if class is not one of memoryoperations
+        # it means it can be user defined marker
+        if mem_ops is None:
+            check_marker_format(id_)
+            # if id_ is section BEGIN
+            if id_.endswith(OperationFactory.__suffix[0]):
+                # BEGIN defined by user
+                marker_name = id_.partition('.')[0]
+                if markers is not None and marker_name in markers:
+                    engine = markers[marker_name]
+                    try:
+                        mem_ops = getattr(memoryoperations, engine)
+                    except AttributeError:
+                        raise NotSupportedOperationException(
+                                "Not supported reorder engine: {}"
+                                .format(engine))
+                # BEGIN but not defined by user
+                else:
+                    mem_ops = stack[-1][1]
+
+                if issubclass(mem_ops, memoryoperations.ReorderBase):
+                    stack.append((id_, mem_ops))
+
+            # END section
+            elif id_.endswith(OperationFactory.__suffix[-1]):
+                check_pair_consistency(stack, id_)
+                stack.pop()
+                mem_ops = stack[-1][1]
+
+        # here we have proper memory operation to perform,
+        # it can be Store, Fence, ReorderDefault etc.
+        id_ = mem_ops.__name__
+        if id_ not in OperationFactory.__factories:
+            OperationFactory.__factories[id_] = mem_ops.Factory()
+
+        return OperationFactory.__factories[id_].create(string_operation)
diff --git a/ceph/src/pmdk/src/tools/pmreorder/opscontext.py b/ceph/src/pmdk/src/tools/pmreorder/opscontext.py
new file mode 100644 (file)
index 0000000..a134c4d
--- /dev/null
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+from operationfactory import OperationFactory
+from binaryoutputhandler import BinaryOutputHandler
+import reorderengines
+import memoryoperations
+from itertools import repeat
+
+
+class OpsContext:
+    """
+    Holds the context of the performed operations.
+
+    :ivar _operations: The operations to be performed, based on the log file.
+    :type _operations: list of strings
+    :ivar reorder_engine: The reordering engine used at the moment.
+    :type one of the reorderengine Class
+    :ivar default_engine: The default reordering engine.
+    :type default_engine: One of the reorderengines Class
+    :ivar test_on_barrier: Check consistency on barrier.
+    :type test_on_barrier: bool
+    :ivar default_barrier: Default consistency barrier status.
+    :type default_barrier: bool
+    :ivar file_handler: The file handler used.
+    """
+    def __init__(self, log_file, checker, logger, arg_engine, markers):
+        """
+        Splits the operations in the log file and sets the instance variables
+        to default values.
+
+        :param log_file: The full name of the log file.
+        :type log_file: str
+        :return: None
+        """
+        # TODO reading the whole file at once is rather naive
+        # change in the future
+        self._operations = open(log_file).read().split("|")
+        engine = reorderengines.get_engine(arg_engine)
+        self.reorder_engine = engine
+        self.test_on_barrier = engine.test_on_barrier
+        self.default_engine = self.reorder_engine
+        self.default_barrier = self.default_engine.test_on_barrier
+        self.file_handler = BinaryOutputHandler(checker)
+        self.checker = checker
+        self.logger = logger
+        self.markers = markers
+        self.stack_engines = [('START', getattr(memoryoperations, arg_engine))]
+
+    # TODO this should probably be made a generator
+    def extract_operations(self):
+        """
+        Creates specific operation objects based on the labels available
+        in the split log file.
+
+        :return: list of subclasses of :class:`memoryoperations.BaseOperation`
+        """
+        stop_index = start_index = 0
+
+        for i, elem in enumerate(self._operations):
+            if "START" in elem:
+                start_index = i
+            elif "STOP" in elem:
+                stop_index = i
+
+        return list(map(OperationFactory.create_operation,
+                        self._operations[start_index + 1:stop_index],
+                        repeat(self.markers), repeat(self.stack_engines)))
diff --git a/ceph/src/pmdk/src/tools/pmreorder/pmreorder.py b/ceph/src/pmdk/src/tools/pmreorder/pmreorder.py
new file mode 100644 (file)
index 0000000..e0f3e53
--- /dev/null
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2019, Intel Corporation
+
+import argparse
+import statemachine
+import opscontext
+import consistencycheckwrap
+import loggingfacility
+import markerparser
+import sys
+import reorderengines
+
+
+def main():
+    pmreorder_version = "unknown"
+
+    '''
+    Argv[1] should be given in order to use -v or --version flag. It is passed
+    from the installed script. We check whether argv[1] was given and if it's
+    not any of regular parameters we use it as a version of pmreorder and
+    remove it from the arguments list.
+    '''
+    if len(sys.argv) > 1 and sys.argv[1][0] != "-":
+        pmreorder_version = sys.argv[1]
+        del sys.argv[1]
+
+    # TODO unicode support
+    # TODO parameterize reorder engine type
+    parser = argparse.ArgumentParser(description="Store reordering tool")
+    parser.add_argument("-l", "--logfile",
+                        required=True,
+                        help="the pmemcheck log file to process")
+    parser.add_argument("-c", "--checker",
+                        choices=consistencycheckwrap.checkers,
+                        default=consistencycheckwrap.checkers[0],
+                        help="choose consistency checker type")
+    parser.add_argument("-p", "--path",
+                        required=True,
+                        help="path to the consistency checker and arguments",
+                        nargs='+')
+    parser.add_argument("-n", "--name",
+                        help="consistency check function " +
+                        "for the 'lib' checker")
+    parser.add_argument("-o", "--output",
+                        help="set the logger output file")
+    parser.add_argument("-e", "--output-level",
+                        choices=loggingfacility.log_levels,
+                        help="set the output log level")
+    parser.add_argument("-x", "--extended-macros",
+                        help="list of pairs MARKER=ENGINE or " +
+                        "json config file")
+    parser.add_argument("-v", "--version",
+                        help="print version of the pmreorder",
+                        action="version",
+                        version="%(prog)s " + pmreorder_version)
+    engines_keys = list(reorderengines.engines.keys())
+    parser.add_argument("-r", "--default-engine",
+                        help="set default reorder engine " +
+                        "default=NoReorderNoChecker",
+                        choices=engines_keys,
+                        default=engines_keys[0])
+    args = parser.parse_args()
+    logger = loggingfacility.get_logger(
+                                        args.output,
+                                        args.output_level)
+    checker = consistencycheckwrap.get_checker(
+                                               args.checker,
+                                               ' '.join(args.path),
+                                               args.name)
+
+    markers = markerparser.MarkerParser().get_markers(args.extended_macros)
+
+    # create the script context
+    context = opscontext.OpsContext(
+                                    args.logfile,
+                                    checker,
+                                    logger,
+                                    args.default_engine,
+                                    markers)
+
+    # init and run the state machine
+    a = statemachine.StateMachine(statemachine.InitState(context))
+    if a.run_all(context.extract_operations()) is False:
+        sys.exit(1)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/ceph/src/pmdk/src/tools/pmreorder/reorderengines.py b/ceph/src/pmdk/src/tools/pmreorder/reorderengines.py
new file mode 100644 (file)
index 0000000..75a70ea
--- /dev/null
@@ -0,0 +1,341 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+
+from itertools import combinations
+from itertools import permutations
+from itertools import islice
+from itertools import chain
+from random import sample
+from functools import partial
+from reorderexceptions import NotSupportedOperationException
+import collections
+
+
+class FullReorderEngine:
+    def __init__(self):
+        self.test_on_barrier = True
+    """
+    Realizes a full reordering of stores within a given list.
+    Example:
+        input: (a, b, c)
+        output:
+               ()
+               ('a',)
+               ('b',)
+               ('c',)
+               ('a', 'b')
+               ('a', 'c')
+               ('b', 'a')
+               ('b', 'c')
+               ('c', 'a')
+               ('c', 'b')
+               ('a', 'b', 'c')
+               ('a', 'c', 'b')
+               ('b', 'a', 'c')
+               ('b', 'c', 'a')
+               ('c', 'a', 'b')
+               ('c', 'b', 'a')
+    """
+    def generate_sequence(self, store_list):
+        """
+        Generates all possible combinations of all possible lengths,
+        based on the operations in the list.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields all combinations of stores.
+        :rtype: iterable
+        """
+        for length in range(0, len(store_list) + 1):
+            for permutation in permutations(store_list, length):
+                yield permutation
+
+
+class AccumulativeReorderEngine:
+    def __init__(self):
+        self.test_on_barrier = True
+    """
+    Realizes an accumulative reorder of stores within a given list.
+    Example:
+        input: (a, b, c)
+        output:
+               ()
+               ('a')
+               ('a', 'b')
+               ('a', 'b', 'c')
+    """
+    def generate_sequence(self, store_list):
+        """
+        Generates all accumulative lists,
+        based on the operations in the store list.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields all accumulative combinations of stores.
+        :rtype: iterable
+        """
+
+        for i in range(0, len(store_list) + 1):
+            out_list = [store_list[i] for i in range(0, i)]
+            yield out_list
+
+
+class AccumulativeReverseReorderEngine:
+    def __init__(self):
+        self.test_on_barrier = True
+    """
+    Realizes an accumulative reorder of stores
+    within a given list in reverse order.
+    Example:
+        input: (a, b, c)
+        output:
+               ()
+               ('c')
+               ('c', 'b')
+               ('c', 'b', 'a')
+    """
+    def generate_sequence(self, store_list):
+        """
+        Reverse all elements order and
+        generates all accumulative lists.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields all accumulative combinations of stores.
+        :rtype: iterable
+        """
+        store_list = list(reversed(store_list))
+        for i in range(len(store_list) + 1):
+            yield [store_list[j] for j in range(i)]
+
+
+class SlicePartialReorderEngine:
+    """
+    Generates a slice of the full reordering of stores within a given list.
+    Example:
+        input: (a, b, c), start = 2, stop = None, step = 2
+        output:
+               ('b')
+               ('a', 'b')
+               ('b', 'c')
+    """
+    def __init__(self, start, stop, step=1):
+        """
+        Initializes the generator with the provided parameters.
+
+        :param start: Number of preceding elements to be skipped.
+        :param stop: The element at which the slice is to stop.
+        :param step: How many values are skipped between successive calls.
+        """
+        self._start = start
+        self._stop = stop
+        self._step = step
+        self.test_on_barrier = True
+
+    def generate_sequence(self, store_list):
+        """
+        This generator yields a slice of all possible combinations.
+
+        The result may be a set of combinations of different lengths,
+        depending on the slice parameters provided at object creation.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields a slice of all combinations of stores.
+        :rtype: iterable
+        """
+        for sl in islice(chain(*map(lambda x: combinations(store_list, x),
+                         range(0, len(store_list) + 1))),
+                         self._start, self._stop, self._step):
+            yield sl
+
+
+class FilterPartialReorderEngine:
+    """
+    Generates a filtered set of the combinations
+    without duplication of stores within a given list.
+    Example:
+        input: (a, b, c), filter = filter_min_elem, kwarg1 = 2
+        output:
+               (a, b)
+               (a, c)
+               (b, c)
+               (a, b, c)
+
+        input: (a, b, c), filter = filter_max_elem, kwarg1 = 2
+        output:
+               ()
+               (a)
+               (b)
+               (c)
+               (a, b)
+               (a, c)
+               (b, c)
+
+        input: (a, b, c), filter = filter_between_elem, kwarg1 = 2, kwarg2 = 2
+        output:
+               (a, b)
+               (a, c)
+               (b, c)
+    """
+    def __init__(self, func, **kwargs):
+        """
+        Initializes the generator with the provided parameters.
+
+        :param func: The filter function.
+        :param **kwargs: Arguments to the filter function.
+        """
+        self._filter = func
+        self._filter_kwargs = kwargs
+        self.test_on_barrier = True
+
+    @staticmethod
+    def filter_min_elem(store_list, **kwargs):
+        """
+        Filter stores list if number of element is less than kwarg1
+        """
+        if (len(store_list) < kwargs["kwarg1"]):
+            return False
+        return True
+
+    @staticmethod
+    def filter_max_elem(store_list, **kwargs):
+        """
+        Filter stores list if number of element is greater than kwarg1.
+        """
+        if (len(store_list) > kwargs["kwarg1"]):
+            return False
+        return True
+
+    @staticmethod
+    def filter_between_elem(store_list, **kwargs):
+        """
+        Filter stores list if number of element is
+        greater or equal kwarg1 and less or equal kwarg2.
+        """
+        store_len = len(store_list)
+        if (store_len >= kwargs["kwarg1"] and store_len <= kwargs["kwarg2"]):
+            return True
+        return False
+
+    def generate_sequence(self, store_list):
+        """
+        This generator yields a filtered set of combinations.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields a filtered set of combinations.
+        :rtype: iterable
+        """
+        filter_fun = getattr(self, self._filter, None)
+        for elem in filter(
+                       partial(filter_fun, **self._filter_kwargs), chain(
+                           *map(lambda x: combinations(store_list, x), range(
+                               0, len(store_list) + 1)))):
+            yield elem
+
+
+class RandomPartialReorderEngine:
+    """
+    Generates a random sequence of combinations of stores.
+    Example:
+        input: (a, b, c), max_seq = 3
+        output:
+               ('b', 'c')
+               ('b',)
+               ('a', 'b', 'c')
+    """
+    def __init__(self, max_seq=3):
+        """
+        Initializes the generator with the provided parameters.
+
+        :param max_seq: The number of combinations to be generated.
+        """
+        self.test_on_barrier = True
+        self._max_seq = max_seq
+
+    def generate_sequence(self, store_list):
+        """
+        This generator yields a random sequence of combinations.
+        Number of combinations without replacement has to be limited to
+        1000 because of exponential growth of elements.
+        Example:
+            for 10 element from 80 -> 1646492110120 combinations
+            for 20 element from 80 -> 3.5353161422122E+18 combinations
+            for 40 element from 80 -> 1.0750720873334E+23 combinations
+        :param store_list: The list of stores to be reordered.
+        :type store_list: list of :class:`memoryoperations.Store`
+        :return: Yields a random sequence of combinations.
+        :rtype: iterable
+        """
+        population = list(chain(*map(
+                          lambda x: islice(combinations(store_list, x), 1000),
+                          range(0, len(store_list) + 1))))
+        population_size = len(population)
+        for elem in sample(population, self._max_seq if self._max_seq <=
+                           population_size else population_size):
+            yield elem
+
+
+class NoReorderEngine:
+    def __init__(self):
+        self.test_on_barrier = True
+    """
+    A NULL reorder engine.
+    Example:
+        input: (a, b, c)
+        output: (a, b, c)
+    """
+    def generate_sequence(self, store_list):
+        """
+        This generator does not modify the provided store list.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: The list of :class:`memoryoperations.Store`
+        :return: The unmodified list of stores.
+        :rtype: iterable
+        """
+        return [store_list]
+
+
+class NoCheckerEngine:
+    def __init__(self):
+        self.test_on_barrier = False
+    """
+    A NULL reorder engine.
+    Example:
+        input: (a, b, c)
+        output: (a, b, c)
+    """
+    def generate_sequence(self, store_list):
+        """
+        This generator does not modify the provided store list
+        and does not do the check.
+
+        :param store_list: The list of stores to be reordered.
+        :type store_list: The list of :class:`memoryoperations.Store`
+        :return: The unmodified list of stores.
+        :rtype: iterable
+        """
+        return [store_list]
+
+
+def get_engine(engine):
+    if engine in engines:
+        reorder_engine = engines[engine]()
+    else:
+        raise NotSupportedOperationException(
+                  "Not supported reorder engine: {}"
+                  .format(engine))
+
+    return reorder_engine
+
+
+engines = collections.OrderedDict([
+           ('NoReorderNoCheck', NoCheckerEngine),
+           ('ReorderFull', FullReorderEngine),
+           ('NoReorderDoCheck', NoReorderEngine),
+           ('ReorderAccumulative', AccumulativeReorderEngine),
+           ('ReorderReverseAccumulative', AccumulativeReverseReorderEngine),
+           ('ReorderPartial', RandomPartialReorderEngine)])
diff --git a/ceph/src/pmdk/src/tools/pmreorder/reorderexceptions.py b/ceph/src/pmdk/src/tools/pmreorder/reorderexceptions.py
new file mode 100644 (file)
index 0000000..6c38415
--- /dev/null
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+
+class InconsistentFileException(Exception):
+    pass
+
+
+class NotSupportedOperationException(Exception):
+    pass
diff --git a/ceph/src/pmdk/src/tools/pmreorder/statemachine.py b/ceph/src/pmdk/src/tools/pmreorder/statemachine.py
new file mode 100644 (file)
index 0000000..9df52c3
--- /dev/null
@@ -0,0 +1,364 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+import memoryoperations as memops
+import reorderengines
+from reorderexceptions import InconsistentFileException
+from reorderexceptions import NotSupportedOperationException
+
+
+class State:
+    """
+    The base class of all states.
+
+    :ivar _context: The reordering context.
+    :type _context: opscontext.OpsContext
+    :ivar trans_stores: The list of unflushed stores.
+    :type trans_stores: list of :class:`memoryoperations.Store`
+    """
+    trans_stores = []
+
+    def __init__(self, context):
+        """
+        Default state constructor.
+
+        :param context: The context of the reordering.
+        :type context: opscontext.OpsContext
+        """
+        self._context = context
+
+    def next(self, in_op):
+        """
+        Go to the next state based on the input.
+
+        :Note:
+            The next state might in fact be the same state.
+
+        :param in_op: The state switch trigger operation.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: The next state.
+        :rtype: subclass of :class:`State`
+        """
+        raise NotImplementedError
+
+    def run(self, in_op):
+        """
+        Perform the required operation in this state.
+
+        :param in_op: The operation to be performed in this state.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: None
+        """
+        raise NotImplementedError
+
+
+class InitState(State):
+    """
+    The initial no-op state.
+    """
+    def __init__(self, context):
+        """
+        Saves the reordering context.
+
+        :param context: The reordering context.
+        :type context: opscontext.OpsContext
+        """
+        super(InitState, self).__init__(context)
+
+    def next(self, in_op):
+        """
+        Switch to the next valid state.
+
+        :param in_op: Ignored.
+        :return: The next valid state.
+        :rtype: CollectingState
+        """
+        return CollectingState(self._context)
+
+    def run(self, in_op):
+        """
+        Does nothing.
+
+        :param in_op: Ignored.
+        :return: always True
+        """
+        return True
+
+
+class CollectingState(State):
+    """
+    Collects appropriate operations.
+
+    This state mostly aggregates stores and flushes. It also
+    validates which stores will be made persistent and passes
+    them on to the next state.
+
+    :ivar _ops_list: The list of collected stores.
+    :type _ops_list: list of :class:`memoryoperations.Store`
+    :ivar _inner_state: The internal state of operations.
+    :type _inner_state: str
+    """
+    def __init__(self, context):
+        """
+        Saves the reordering context.
+
+        :param context: The reordering context.
+        :type context: opscontext.OpsContext
+        """
+        super(CollectingState, self).__init__(context)
+        self._ops_list = []
+        self._ops_list += State.trans_stores
+        self._inner_state = "init"
+
+    def next(self, in_op):
+        """
+        Switch to the next valid state.
+
+        :param in_op: The state switch trigger operation.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: The next state.
+        :rtype: subclass of :class:`State`
+        """
+        if isinstance(in_op, memops.Fence) and \
+                self._inner_state == "flush":
+            return ReplayingState(self._ops_list, self._context)
+        else:
+            return self
+
+    def run(self, in_op):
+        """
+        Perform operations in this state.
+
+        Based on the type of operation, different handling is employed.
+        The recognized and handled types of operations are:
+
+            * :class:`memoryoperations.ReorderBase`
+            * :class:`memoryoperations.FlushBase`
+            * :class:`memoryoperations.Store`
+            * :class:`memoryoperations.Register_file`
+
+        :param in_op: The operation to be performed in this state.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: always True
+        """
+        self.move_inner_state(in_op)
+        if isinstance(in_op, memops.ReorderBase):
+            self.substitute_reorder(in_op)
+        elif isinstance(in_op, memops.FlushBase):
+            self.flush_stores(in_op)
+        elif isinstance(in_op, memops.Store):
+            self._ops_list.append(in_op)
+        elif isinstance(in_op, memops.Register_file):
+            self.reg_file(in_op)
+
+        return True
+
+    def substitute_reorder(self, order_ops):
+        """
+        Changes the reordering engine based on the log marker class.
+
+        :param order_ops: The reordering marker class.
+        :type order_ops: subclass of :class:`memoryoperations.ReorderBase`
+        :return: None
+        """
+        if isinstance(order_ops, memops.ReorderFull):
+            self._context.reorder_engine = \
+                reorderengines.FullReorderEngine()
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.ReorderPartial):
+            # TODO add macro in valgrind or
+            # parameter inside the tool to support parameters?
+            self._context.reorder_engine = \
+                 reorderengines.RandomPartialReorderEngine(3)
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.ReorderAccumulative):
+            self._context.reorder_engine = \
+                reorderengines.AccumulativeReorderEngine()
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.ReorderReverseAccumulative):
+            self._context.reorder_engine = \
+                reorderengines.AccumulativeReverseReorderEngine()
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.NoReorderDoCheck):
+            self._context.reorder_engine = reorderengines.NoReorderEngine()
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.NoReorderNoCheck):
+            self._context.reorder_engine = reorderengines.NoCheckerEngine()
+            self._context.test_on_barrier = \
+                self._context.reorder_engine.test_on_barrier
+        elif isinstance(order_ops, memops.ReorderDefault):
+            self._context.reorder_engine = self._context.default_engine
+            self._context.test_on_barrier = self._context.default_barrier
+        else:
+            raise NotSupportedOperationException(
+                                   "Not supported reorder engine: {}"
+                                   .format(order_ops))
+
+    def flush_stores(self, flush_op):
+        """
+        Marks appropriate stores as flushed.
+
+        Does not align the flush, the log is expected to have the
+        flushes properly aligned.
+
+        :param flush_op: The flush operation marker.
+        :type flush_op: subclass of :class:`memoryoperations.FlushBase`
+        :return: None
+        """
+        for st in self._ops_list:
+            if flush_op.is_in_flush(st):
+                st.flushed = True
+
+    def reg_file(self, file_op):
+        """
+        Register a new file mapped into virtual memory.
+
+        :param file_op: File registration operation marker.
+        :type file_op: memoryoperations.Register_file
+        :return: None
+        """
+        self._context.file_handler.add_file(file_op.name,
+                                            file_op.address,
+                                            file_op.size)
+
+    def move_inner_state(self, in_op):
+        """
+        Tracks the internal state of the collection.
+
+        The collected stores need to be processed only at specific moments -
+        after full persistent memory barriers (flush-fence).
+
+        :param in_op: The performed operation.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: None
+        """
+        if isinstance(in_op, memops.Store) and \
+                self._inner_state == "init":
+            self._inner_state = "dirty"
+        elif isinstance(in_op, memops.FlushBase) and \
+                self._inner_state == "dirty":
+            self._inner_state = "flush"
+        elif isinstance(in_op, memops.Fence) and \
+                self._inner_state == "flush":
+            self._inner_state = "fence"
+        elif isinstance(in_op, memops.Flush) and \
+                self._inner_state == "init":
+            self._inner_state = "flush"
+
+
+class ReplayingState(State):
+    """
+    Replays all collected stores according to the reordering context.
+
+    :ivar _ops_list: The list of stores to be reordered and replayed.
+    :type _ops_list: list of :class:`memoryoperations.Store`
+    """
+    def __init__(self, in_ops_list, context):
+        """
+
+        :param in_ops_list:
+        :param context:
+        :return:
+        """
+        super(ReplayingState, self).__init__(context)
+        self._ops_list = in_ops_list
+
+    def next(self, in_op):
+        """
+        Switches to the collecting state regardless of the input.
+
+        :param in_op: Ignored.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: The next state.
+        :rtype: CollectingState
+        """
+        return CollectingState(self._context)
+
+    def run(self, in_op):
+        """
+        Perform operations in this state.
+
+        The replaying state performs reordering and if necessary checks
+        the consistency of the registered files. The decisions and
+        type of reordering to be used is defined by the context.
+
+        :param in_op: The operation to be performed in this state.
+        :type in_op: subclass of :class:`memoryoperations.BaseOperation`
+        :return: State of consistency check.
+        """
+        # specifies consistency state of sequence
+        consistency = True
+
+        # consider only flushed stores
+        flushed_stores = list(filter(lambda x: x.flushed, self._ops_list))
+
+        # not-flushed stores should be passed to next state
+        State.trans_stores = list(filter(lambda x: x.flushed is False,
+                                         self._ops_list))
+
+        if self._context.test_on_barrier:
+            for seq in self._context.reorder_engine.generate_sequence(
+                                                              flushed_stores):
+                for op in seq:
+                    # do stores
+                    self._context.file_handler.do_store(op)
+                # check consistency of all files
+                try:
+                    self._context.file_handler.check_consistency()
+                except InconsistentFileException as e:
+                    consistency = False
+                    self._context.logger.warning(e)
+                    stacktrace = "Call trace:\n"
+                    for num, op in enumerate(seq):
+                        stacktrace += "Store [{}]:\n".format(num)
+                        stacktrace += str(op.trace)
+                    self._context.logger.warning(stacktrace)
+
+                for op in reversed(seq):
+                    # revert the changes
+                    self._context.file_handler.do_revert(op)
+        # write all flushed stores
+        for op in flushed_stores:
+            self._context.file_handler.do_store(op)
+
+        return consistency
+
+
+class StateMachine:
+    """
+    The state machine driver.
+
+    :ivar _curr_state: The current state.
+    :type _curr_state: subclass of :class:`State`
+    """
+    def __init__(self, init_state):
+        """
+        Initialize the state machine with a specified state.
+
+        :param init_state: The initial state to be used.
+        :type init_state: subclass of :class:`State`
+        """
+        self._curr_state = init_state
+
+    def run_all(self, operations):
+        """
+        Starts the state machine.
+
+        :param operations: The operations to be performed by the state
+            machine.
+        :type operations: list of :class:`memoryoperations.BaseOperation`
+        :return: None
+        """
+        all_consistent = True
+        for ops in operations:
+            self._curr_state = self._curr_state.next(ops)
+            check = self._curr_state.run(ops)
+            if check is False:
+                all_consistent = check
+
+        return all_consistent
diff --git a/ceph/src/pmdk/src/tools/pmreorder/utils.py b/ceph/src/pmdk/src/tools/pmreorder/utils.py
new file mode 100644 (file)
index 0000000..6ee6e67
--- /dev/null
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+
+import os
+import mmap
+
+
+class Rangeable:
+    """
+    Interface for all rangeable objects.
+
+    All rangeable objects must be able to return their base and max
+    addresses.
+    """
+    def get_base_address(self):
+        """
+        Getter for the base address of the object.
+
+        :return: The base address of the object.
+        :rtype: int
+        """
+        raise NotImplementedError
+
+    def get_max_address(self):
+        """
+        Getter for the max address of the object.
+
+        :return: The max address of the object.
+        :rtype: int
+        """
+        raise NotImplementedError
+
+
+class StackTrace:
+    def __init__(self, trace=None):
+        self.trace = trace
+
+    def __str__(self):
+        ret = ""
+        if self.trace is not None:
+            for line in self.trace:
+                ret += "    by\t{}\n".format(line)
+        return ret
+
+
+def memory_map(filename, size=0, access=mmap.ACCESS_WRITE, offset=0):
+    """
+    Memory map a file.
+
+    :Warning:
+        `offset` has to be a non-negative multiple of PAGESIZE or
+        ALLOCATIONGRANULARITY
+
+    :param filename: The file to be mapped.
+    :type filename: str
+    :param size: Number of bytes to be mapped. If is equal 0, the
+        whole file at the moment of the call will be mapped.
+    :type size: int
+    :param offset: The offset within the file to be mapped.
+    :type offset: int
+    :param access: The type of access provided to mmap.
+    :return: The mapped file.
+    :rtype: mmap.mmap
+    """
+    fd = os.open(filename, os.O_RDWR)
+    m_file = mmap.mmap(fd, size, access=access, offset=offset)
+    os.close(fd)
+    return m_file
+
+
+def range_cmp(lhs, rhs):
+    """
+    A range compare function.
+
+    :param lhs: The left hand side of the comparison.
+    :type lhs: Rangeable
+    :param rhs: The right hand side of the comparison.
+    :type rhs: Rangeable
+    :return: -1 if lhs is before rhs, 1 when after and 0 on overlap.
+    :rtype: int
+
+    The comparison function may be explained as::
+
+        Will return -1:
+        |___lhs___|
+                        |___rhs___|
+
+        Will return +1:
+        |___rhs___|
+                        |___lhs___|
+
+        Will return 0:
+        |___lhs___|
+               |___rhs___|
+    """
+    if lhs.get_max_address() <= rhs.get_base_address():
+        return -1
+    elif lhs.get_base_address() >= rhs.get_max_address():
+        return 1
+    else:
+        return 0
diff --git a/ceph/src/pmdk/src/tools/rpmemd/Makefile b/ceph/src/pmdk/src/tools/rpmemd/Makefile
new file mode 100644 (file)
index 0000000..f0cdced
--- /dev/null
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+#
+# Makefile -- top Makefile for rpmemd
+#
+
+vpath %.c ../../rpmem_common/
+
+TOP = ../../..
+include $(TOP)/src/common.inc
+
+ifeq ($(BUILD_RPMEM),y)
+SCP_TO_REMOTE_NODES = y
+TARGET = rpmemd
+OBJS = rpmemd.o\
+       rpmemd_log.o\
+       rpmemd_config.o\
+       rpmem_common.o\
+       rpmemd_obc.o\
+       rpmemd_db.o\
+       rpmemd_fip.o\
+       rpmem_fip_common.o\
+       rpmemd_util.o
+
+LIBPMEM=y
+TOOLS_COMMON=y
+LIBPMEMBLK_PRIV=btt_info_convert2h
+
+INCS += -I$(TOP)/src/rpmem_common
+CFLAGS += -DRPMEMC_LOG_RPMEMD
+ifneq ($(DEBUG),)
+CFLAGS += -DDEBUG
+endif
+CFLAGS += $(LIBFABRIC_CFLAGS)
+
+LIBS += -pthread
+LIBS += $(LIBFABRIC_LIBS)
+
+INSTALL_TARGET=y
+
+else
+$(info NOTE: Skipping rpmemd because $(BUILD_RPMEM_INFO))
+endif
+
+include ../Makefile.inc
+
+.PHONY: test check
diff --git a/ceph/src/pmdk/src/tools/rpmemd/README b/ceph/src/pmdk/src/tools/rpmemd/README
new file mode 100644 (file)
index 0000000..ffba03d
--- /dev/null
@@ -0,0 +1,8 @@
+This directory contains a tool which supports remote access
+to persistent memory over RDMA on server side.
+
+** DEPENDENCIES: **
+The rpmemd depends on libfabric library:
+
+https://github.com/ofiwg/libfabric
+
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd.c
new file mode 100644 (file)
index 0000000..8a4b9ed
--- /dev/null
@@ -0,0 +1,803 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd.c -- rpmemd main source file
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include "librpmem.h"
+#include "rpmemd.h"
+#include "rpmemd_log.h"
+#include "rpmemd_config.h"
+#include "rpmem_common.h"
+#include "rpmemd_fip.h"
+#include "rpmemd_obc.h"
+#include "rpmemd_db.h"
+#include "rpmemd_util.h"
+#include "pool_hdr.h"
+#include "os.h"
+#include "os_thread.h"
+#include "util.h"
+#include "uuid.h"
+#include "set.h"
+
+/*
+ * rpmemd -- rpmem handle
+ */
+struct rpmemd {
+       struct rpmemd_obc *obc; /* out-of-band connection handle */
+       struct rpmemd_db *db;   /* pool set database handle */
+       struct rpmemd_db_pool *pool; /* pool handle */
+       char *pool_desc;        /* pool descriptor */
+       struct rpmemd_fip *fip; /* fabric provider handle */
+       struct rpmemd_config config; /* configuration */
+       enum rpmem_persist_method persist_method;
+       int closing;            /* set when closing connection */
+       int created;            /* pool created */
+       os_thread_t fip_thread;
+       int fip_running;
+};
+
+#ifdef DEBUG
+/*
+ * bool2str -- convert bool to yes/no string
+ */
+static inline const char *
+bool2str(int v)
+{
+       return v ? "yes" : "no";
+}
+#endif
+
+/*
+ * str_or_null -- return null string instead of NULL pointer
+ */
+static inline const char *
+_str(const char *str)
+{
+       if (!str)
+               return "(null)";
+       return str;
+}
+
+/*
+ * uuid2str -- convert uuid to string
+ */
+static const char *
+uuid2str(const uuid_t uuid)
+{
+       static char uuid_str[64] = {0, };
+
+       int ret = util_uuid_to_string(uuid, uuid_str);
+       if (ret != 0) {
+               return "(error)";
+       }
+
+       return uuid_str;
+}
+
+/*
+ * rpmemd_get_pm -- returns persist method based on configuration
+ */
+static enum rpmem_persist_method
+rpmemd_get_pm(struct rpmemd_config *config)
+{
+       enum rpmem_persist_method ret = RPMEM_PM_GPSPM;
+
+       if (config->persist_apm)
+               ret = RPMEM_PM_APM;
+
+       return ret;
+}
+
+/*
+ * rpmemd_db_get_status -- convert error number to status for db operation
+ */
+static int
+rpmemd_db_get_status(int err)
+{
+       switch (err) {
+       case EEXIST:
+               return RPMEM_ERR_EXISTS;
+       case EACCES:
+               return RPMEM_ERR_NOACCESS;
+       case ENOENT:
+               return RPMEM_ERR_NOEXIST;
+       case EWOULDBLOCK:
+               return RPMEM_ERR_BUSY;
+       case EBADF:
+               return RPMEM_ERR_BADNAME;
+       case EINVAL:
+               return RPMEM_ERR_POOL_CFG;
+       default:
+               return RPMEM_ERR_FATAL;
+       }
+}
+
+/*
+ * rpmemd_check_pool -- verify pool parameters
+ */
+static int
+rpmemd_check_pool(struct rpmemd *rpmemd, const struct rpmem_req_attr *req,
+       int *status)
+{
+       if (rpmemd->pool->pool_size < RPMEM_MIN_POOL) {
+               RPMEMD_LOG(ERR, "invalid pool size -- must be >= %zu",
+                               RPMEM_MIN_POOL);
+               *status = RPMEM_ERR_POOL_CFG;
+               return -1;
+       }
+
+       if (rpmemd->pool->pool_size < req->pool_size) {
+               RPMEMD_LOG(ERR, "requested size is too big");
+               *status = RPMEM_ERR_BADSIZE;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_deep_persist -- perform deep persist operation
+ */
+static int
+rpmemd_deep_persist(const void *addr, size_t size, void *ctx)
+{
+       struct rpmemd *rpmemd = (struct rpmemd *)ctx;
+       return util_replica_deep_persist(addr, size, rpmemd->pool->set, 0);
+}
+
+/*
+ * rpmemd_common_fip_init -- initialize fabric provider
+ */
+static int
+rpmemd_common_fip_init(struct rpmemd *rpmemd, const struct rpmem_req_attr *req,
+       struct rpmem_resp_attr *resp, int *status)
+{
+       /* register the whole pool with header in RDMA */
+       void *addr = (void *)((uintptr_t)rpmemd->pool->pool_addr);
+       struct rpmemd_fip_attr fip_attr = {
+               .addr           = addr,
+               .size           = req->pool_size,
+               .nlanes         = req->nlanes,
+               .nthreads       = rpmemd->config.nthreads,
+               .provider       = req->provider,
+               .persist_method = rpmemd->persist_method,
+               .deep_persist   = rpmemd_deep_persist,
+               .ctx            = rpmemd,
+               .buff_size      = req->buff_size,
+       };
+
+       const int is_pmem = rpmemd_db_pool_is_pmem(rpmemd->pool);
+       if (rpmemd_apply_pm_policy(&fip_attr.persist_method,
+                       &fip_attr.persist,
+                       &fip_attr.memcpy_persist,
+                       is_pmem)) {
+               *status = RPMEM_ERR_FATAL;
+               goto err_fip_init;
+       }
+
+       const char *node = rpmem_get_ssh_conn_addr();
+       enum rpmem_err err;
+
+       rpmemd->fip = rpmemd_fip_init(node, NULL, &fip_attr, resp, &err);
+       if (!rpmemd->fip) {
+               *status = (int)err;
+               goto err_fip_init;
+       }
+
+       return 0;
+err_fip_init:
+       return -1;
+}
+
+/*
+ * rpmemd_print_req_attr -- print request attributes
+ */
+static void
+rpmemd_print_req_attr(const struct rpmem_req_attr *req)
+{
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "pool descriptor: '%s'",
+                       _str(req->pool_desc));
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "pool size: %lu", req->pool_size);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "nlanes: %u", req->nlanes);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "provider: %s",
+                       rpmem_provider_to_str(req->provider));
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "buff_size: %lu", req->buff_size);
+}
+
+/*
+ * rpmemd_print_pool_attr -- print pool attributes
+ */
+static void
+rpmemd_print_pool_attr(const struct rpmem_pool_attr *attr)
+{
+       if (attr == NULL) {
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "NULL");
+       } else {
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "signature: '%s'",
+                               _str(attr->signature));
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "major: %u", attr->major);
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "compat_features: 0x%x",
+                               attr->compat_features);
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "incompat_features: 0x%x",
+                               attr->incompat_features);
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "ro_compat_features: 0x%x",
+                               attr->ro_compat_features);
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "poolset_uuid: %s",
+                               uuid2str(attr->poolset_uuid));
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "uuid: %s",
+                               uuid2str(attr->uuid));
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "next_uuid: %s",
+                               uuid2str(attr->next_uuid));
+               RPMEMD_LOG(INFO, RPMEMD_LOG_INDENT "prev_uuid: %s",
+                       uuid2str(attr->prev_uuid));
+       }
+}
+
+/*
+ * rpmemd_print_resp_attr -- print response attributes
+ */
+static void
+rpmemd_print_resp_attr(const struct rpmem_resp_attr *attr)
+{
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "port: %u", attr->port);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "rkey: 0x%lx", attr->rkey);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "raddr: 0x%lx", attr->raddr);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "nlanes: %u", attr->nlanes);
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "persist method: %s",
+                       rpmem_persist_method_to_str(attr->persist_method));
+}
+
+/*
+ * rpmemd_fip_thread -- background thread for establishing in-band connection
+ */
+static void *
+rpmemd_fip_thread(void *arg)
+{
+       struct rpmemd *rpmemd = (struct rpmemd *)arg;
+       int ret;
+
+       RPMEMD_LOG(INFO, "waiting for in-band connection");
+
+       ret = rpmemd_fip_accept(rpmemd->fip, RPMEM_ACCEPT_TIMEOUT);
+       if (ret)
+               goto err_accept;
+
+       RPMEMD_LOG(NOTICE, "in-band connection established");
+
+       ret = rpmemd_fip_process_start(rpmemd->fip);
+       if (ret)
+               goto err_process_start;
+
+       return NULL;
+err_process_start:
+       rpmemd_fip_close(rpmemd->fip);
+err_accept:
+       return (void *)(uintptr_t)ret;
+}
+
+/*
+ * rpmemd_fip_start_thread -- start background thread for establishing
+ * in-band connection
+ */
+static int
+rpmemd_fip_start_thread(struct rpmemd *rpmemd)
+{
+       errno = os_thread_create(&rpmemd->fip_thread, NULL,
+                       rpmemd_fip_thread, rpmemd);
+       if (errno) {
+               RPMEMD_LOG(ERR, "!creating in-band thread");
+               goto err_os_thread_create;
+       }
+
+       rpmemd->fip_running = 1;
+
+       return 0;
+err_os_thread_create:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_stop_thread -- stop background thread for in-band connection
+ */
+static int
+rpmemd_fip_stop_thread(struct rpmemd *rpmemd)
+{
+       RPMEMD_ASSERT(rpmemd->fip_running);
+       void *tret;
+       errno = os_thread_join(&rpmemd->fip_thread, &tret);
+       if (errno)
+               RPMEMD_LOG(ERR, "!waiting for in-band thread");
+
+       int ret = (int)(uintptr_t)tret;
+       if (ret)
+               RPMEMD_LOG(ERR, "in-band thread failed -- '%d'", ret);
+
+       return ret;
+}
+
+/*
+ * rpmemd_fip-stop -- stop in-band thread and stop processing thread
+ */
+static int
+rpmemd_fip_stop(struct rpmemd *rpmemd)
+{
+       int ret;
+
+       int fip_ret = rpmemd_fip_stop_thread(rpmemd);
+       if (fip_ret) {
+               RPMEMD_LOG(ERR, "!in-band thread failed");
+       }
+
+       if (!fip_ret) {
+               ret = rpmemd_fip_process_stop(rpmemd->fip);
+               if (ret) {
+                       RPMEMD_LOG(ERR, "!stopping fip process failed");
+               }
+       }
+
+       rpmemd->fip_running = 0;
+
+       return fip_ret;
+}
+
+/*
+ * rpmemd_close_pool -- close pool and remove it if required
+ */
+static int
+rpmemd_close_pool(struct rpmemd *rpmemd, int remove)
+{
+       int ret = 0;
+
+       RPMEMD_LOG(NOTICE, "closing pool");
+       rpmemd_db_pool_close(rpmemd->db, rpmemd->pool);
+       RPMEMD_LOG(INFO, "pool closed");
+
+       if (remove) {
+               RPMEMD_LOG(NOTICE, "removing '%s'", rpmemd->pool_desc);
+               ret = rpmemd_db_pool_remove(rpmemd->db,
+                               rpmemd->pool_desc, 0, 0);
+               if (ret) {
+                       RPMEMD_LOG(ERR, "!removing pool '%s' failed",
+                                       rpmemd->pool_desc);
+               } else {
+                       RPMEMD_LOG(INFO, "removed '%s'", rpmemd->pool_desc);
+               }
+       }
+
+       free(rpmemd->pool_desc);
+
+       return ret;
+}
+
+/*
+ * rpmemd_req_cleanup -- cleanup in-band connection and all resources allocated
+ * during open/create requests
+ */
+static void
+rpmemd_req_cleanup(struct rpmemd *rpmemd)
+{
+       if (!rpmemd->fip_running)
+               return;
+
+       int ret;
+
+       ret = rpmemd_fip_stop(rpmemd);
+       if (!ret) {
+               rpmemd_fip_close(rpmemd->fip);
+               rpmemd_fip_fini(rpmemd->fip);
+       }
+
+       int remove = rpmemd->created && ret;
+       rpmemd_close_pool(rpmemd, remove);
+}
+
+/*
+ * rpmemd_req_create -- handle create request
+ */
+static int
+rpmemd_req_create(struct rpmemd_obc *obc, void *arg,
+       const struct rpmem_req_attr *req,
+       const struct rpmem_pool_attr *pool_attr)
+{
+       RPMEMD_ASSERT(arg != NULL);
+       RPMEMD_LOG(NOTICE, "create request:");
+       rpmemd_print_req_attr(req);
+       RPMEMD_LOG(NOTICE, "pool attributes:");
+       rpmemd_print_pool_attr(pool_attr);
+
+       struct rpmemd *rpmemd = (struct rpmemd *)arg;
+
+       int ret;
+       int status = 0;
+       int err_send = 1;
+       struct rpmem_resp_attr resp;
+       memset(&resp, 0, sizeof(resp));
+
+       if (rpmemd->pool) {
+               RPMEMD_LOG(ERR, "pool already opened");
+               ret = -1;
+               status = RPMEM_ERR_FATAL;
+               goto err_pool_opened;
+       }
+
+       rpmemd->pool_desc = strdup(req->pool_desc);
+       if (!rpmemd->pool_desc) {
+               RPMEMD_LOG(ERR, "!allocating pool descriptor");
+               ret = -1;
+               status = RPMEM_ERR_FATAL;
+               goto err_strdup;
+       }
+
+       rpmemd->pool = rpmemd_db_pool_create(rpmemd->db,
+                       req->pool_desc, 0, pool_attr);
+       if (!rpmemd->pool) {
+               ret = -1;
+               status = rpmemd_db_get_status(errno);
+               goto err_pool_create;
+       }
+
+       rpmemd->created = 1;
+
+       ret = rpmemd_check_pool(rpmemd, req, &status);
+       if (ret)
+               goto err_pool_check;
+
+       ret = rpmemd_common_fip_init(rpmemd, req, &resp, &status);
+       if (ret)
+               goto err_fip_init;
+
+       RPMEMD_LOG(NOTICE, "create request response: (status = %u)", status);
+       if (!status)
+               rpmemd_print_resp_attr(&resp);
+       ret = rpmemd_obc_create_resp(obc, status, &resp);
+       if (ret)
+               goto err_create_resp;
+
+       ret = rpmemd_fip_start_thread(rpmemd);
+       if (ret)
+               goto err_fip_start;
+
+       return 0;
+err_fip_start:
+err_create_resp:
+       err_send = 0;
+       rpmemd_fip_fini(rpmemd->fip);
+err_fip_init:
+err_pool_check:
+       rpmemd_db_pool_close(rpmemd->db, rpmemd->pool);
+       rpmemd_db_pool_remove(rpmemd->db, req->pool_desc, 0, 0);
+err_pool_create:
+       free(rpmemd->pool_desc);
+err_strdup:
+err_pool_opened:
+       if (err_send)
+               ret = rpmemd_obc_create_resp(obc, status, &resp);
+       rpmemd->closing = 1;
+       return ret;
+}
+
+/*
+ * rpmemd_req_open -- handle open request
+ */
+static int
+rpmemd_req_open(struct rpmemd_obc *obc, void *arg,
+       const struct rpmem_req_attr *req)
+{
+       RPMEMD_ASSERT(arg != NULL);
+       RPMEMD_LOG(NOTICE, "open request:");
+       rpmemd_print_req_attr(req);
+       struct rpmemd *rpmemd = (struct rpmemd *)arg;
+
+       int ret;
+       int status = 0;
+       int err_send = 1;
+       struct rpmem_resp_attr resp;
+       memset(&resp, 0, sizeof(resp));
+
+       struct rpmem_pool_attr pool_attr;
+       memset(&pool_attr, 0, sizeof(pool_attr));
+
+       if (rpmemd->pool) {
+               RPMEMD_LOG(ERR, "pool already opened");
+               ret = -1;
+               status = RPMEM_ERR_FATAL;
+               goto err_pool_opened;
+       }
+
+       rpmemd->pool_desc = strdup(req->pool_desc);
+       if (!rpmemd->pool_desc) {
+               RPMEMD_LOG(ERR, "!allocating pool descriptor");
+               ret = -1;
+               status = RPMEM_ERR_FATAL;
+               goto err_strdup;
+       }
+
+       rpmemd->pool = rpmemd_db_pool_open(rpmemd->db,
+                       req->pool_desc, 0, &pool_attr);
+       if (!rpmemd->pool) {
+               ret = -1;
+               status = rpmemd_db_get_status(errno);
+               goto err_pool_open;
+       }
+
+       RPMEMD_LOG(NOTICE, "pool attributes:");
+       rpmemd_print_pool_attr(&pool_attr);
+
+       ret = rpmemd_check_pool(rpmemd, req, &status);
+       if (ret)
+               goto err_pool_check;
+
+       ret = rpmemd_common_fip_init(rpmemd, req, &resp, &status);
+       if (ret)
+               goto err_fip_init;
+
+       RPMEMD_LOG(NOTICE, "open request response: (status = %u)", status);
+       if (!status)
+               rpmemd_print_resp_attr(&resp);
+
+       ret = rpmemd_obc_open_resp(obc, status, &resp, &pool_attr);
+       if (ret)
+               goto err_open_resp;
+
+       ret = rpmemd_fip_start_thread(rpmemd);
+       if (ret)
+               goto err_fip_start;
+
+       return 0;
+err_fip_start:
+err_open_resp:
+       err_send = 0;
+       rpmemd_fip_fini(rpmemd->fip);
+err_fip_init:
+err_pool_check:
+       rpmemd_db_pool_close(rpmemd->db, rpmemd->pool);
+err_pool_open:
+       free(rpmemd->pool_desc);
+err_strdup:
+err_pool_opened:
+       if (err_send)
+               ret = rpmemd_obc_open_resp(obc, status, &resp, &pool_attr);
+       rpmemd->closing = 1;
+       return ret;
+}
+
+/*
+ * rpmemd_req_close -- handle close request
+ */
+static int
+rpmemd_req_close(struct rpmemd_obc *obc, void *arg, int flags)
+{
+       RPMEMD_ASSERT(arg != NULL);
+       RPMEMD_LOG(NOTICE, "close request");
+
+       struct rpmemd *rpmemd = (struct rpmemd *)arg;
+
+       rpmemd->closing = 1;
+
+       int ret;
+       int status = 0;
+
+       if (!rpmemd->pool) {
+               RPMEMD_LOG(ERR, "pool not opened");
+               status = RPMEM_ERR_FATAL;
+               return rpmemd_obc_close_resp(obc, status);
+       }
+
+       ret = rpmemd_fip_stop(rpmemd);
+       if (ret) {
+               status = RPMEM_ERR_FATAL;
+       } else {
+               rpmemd_fip_close(rpmemd->fip);
+               rpmemd_fip_fini(rpmemd->fip);
+       }
+
+       int remove = rpmemd->created &&
+                       (status || (flags & RPMEM_CLOSE_FLAGS_REMOVE));
+       if (rpmemd_close_pool(rpmemd, remove))
+               RPMEMD_LOG(ERR, "closing pool failed");
+
+       RPMEMD_LOG(NOTICE, "close request response (status = %u)", status);
+       ret = rpmemd_obc_close_resp(obc, status);
+
+       return ret;
+}
+
+/*
+ * rpmemd_req_set_attr -- handle set attributes request
+ */
+static int
+rpmemd_req_set_attr(struct rpmemd_obc *obc, void *arg,
+       const struct rpmem_pool_attr *pool_attr)
+{
+       RPMEMD_ASSERT(arg != NULL);
+       RPMEMD_LOG(NOTICE, "set attributes request");
+       struct rpmemd *rpmemd = (struct rpmemd *)arg;
+       RPMEMD_ASSERT(rpmemd->pool != NULL);
+
+       int ret;
+       int status = 0;
+       int err_send = 1;
+
+       ret = rpmemd_db_pool_set_attr(rpmemd->pool, pool_attr);
+       if (ret) {
+               ret = -1;
+               status = rpmemd_db_get_status(errno);
+               goto err_set_attr;
+       }
+
+       RPMEMD_LOG(NOTICE, "new pool attributes:");
+       rpmemd_print_pool_attr(pool_attr);
+
+       ret = rpmemd_obc_set_attr_resp(obc, status);
+       if (ret)
+               goto err_set_attr_resp;
+
+       return ret;
+err_set_attr_resp:
+       err_send = 0;
+err_set_attr:
+       if (err_send)
+               ret = rpmemd_obc_set_attr_resp(obc, status);
+       return ret;
+}
+
+static struct rpmemd_obc_requests rpmemd_req = {
+       .create         = rpmemd_req_create,
+       .open           = rpmemd_req_open,
+       .close          = rpmemd_req_close,
+       .set_attr       = rpmemd_req_set_attr,
+};
+
+/*
+ * rpmemd_print_info -- print basic info and configuration
+ */
+static void
+rpmemd_print_info(struct rpmemd *rpmemd)
+{
+       RPMEMD_LOG(NOTICE, "ssh connection: %s",
+                       _str(os_getenv("SSH_CONNECTION")));
+       RPMEMD_LOG(NOTICE, "user: %s", _str(os_getenv("USER")));
+       RPMEMD_LOG(NOTICE, "configuration");
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "pool set directory: '%s'",
+                       _str(rpmemd->config.poolset_dir));
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "persist method: %s",
+                       rpmem_persist_method_to_str(rpmemd->persist_method));
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "number of threads: %lu",
+                       rpmemd->config.nthreads);
+       RPMEMD_DBG(RPMEMD_LOG_INDENT "persist APM: %s",
+                       bool2str(rpmemd->config.persist_apm));
+       RPMEMD_DBG(RPMEMD_LOG_INDENT "persist GPSPM: %s",
+                       bool2str(rpmemd->config.persist_general));
+       RPMEMD_DBG(RPMEMD_LOG_INDENT "use syslog: %s",
+                       bool2str(rpmemd->config.use_syslog));
+       RPMEMD_DBG(RPMEMD_LOG_INDENT "log file: %s",
+                       _str(rpmemd->config.log_file));
+       RPMEMD_DBG(RPMEMD_LOG_INDENT "log level: %s",
+                       rpmemd_log_level_to_str(rpmemd->config.log_level));
+}
+
+int
+main(int argc, char *argv[])
+{
+       util_init();
+
+       int send_status = 1;
+       int ret = 1;
+
+       struct rpmemd *rpmemd = calloc(1, sizeof(*rpmemd));
+       if (!rpmemd) {
+               RPMEMD_LOG(ERR, "!calloc");
+               goto err_rpmemd;
+       }
+
+       rpmemd->obc = rpmemd_obc_init(STDIN_FILENO, STDOUT_FILENO);
+       if (!rpmemd->obc) {
+               RPMEMD_LOG(ERR, "out-of-band connection initialization");
+               goto err_obc;
+       }
+
+       if (rpmemd_log_init(DAEMON_NAME, NULL, 0)) {
+               RPMEMD_LOG(ERR, "logging subsystem initialization failed");
+               goto err_log_init;
+       }
+
+       if (rpmemd_config_read(&rpmemd->config, argc, argv) != 0) {
+               RPMEMD_LOG(ERR, "reading configuration failed");
+               goto err_config;
+       }
+
+       rpmemd_log_close();
+       rpmemd_log_level = rpmemd->config.log_level;
+       if (rpmemd_log_init(DAEMON_NAME, rpmemd->config.log_file,
+                               rpmemd->config.use_syslog)) {
+               RPMEMD_LOG(ERR, "logging subsystem initialization"
+                       " failed (%s, %d)", rpmemd->config.log_file,
+                       rpmemd->config.use_syslog);
+               goto err_log_init_config;
+       }
+
+       RPMEMD_LOG(INFO, "%s version %s", DAEMON_NAME, SRCVERSION);
+       rpmemd->persist_method = rpmemd_get_pm(&rpmemd->config);
+
+       rpmemd->db = rpmemd_db_init(rpmemd->config.poolset_dir, 0666);
+       if (!rpmemd->db) {
+               RPMEMD_LOG(ERR, "!pool set db initialization");
+               goto err_db_init;
+       }
+
+       if (rpmemd->config.rm_poolset) {
+               RPMEMD_LOG(INFO, "removing '%s'",
+                               rpmemd->config.rm_poolset);
+               if (rpmemd_db_pool_remove(rpmemd->db,
+                               rpmemd->config.rm_poolset,
+                               rpmemd->config.force,
+                               rpmemd->config.pool_set)) {
+                       RPMEMD_LOG(ERR, "removing '%s' failed",
+                                       rpmemd->config.rm_poolset);
+                       ret = errno;
+               } else {
+                       RPMEMD_LOG(NOTICE, "removed '%s'",
+                                       rpmemd->config.rm_poolset);
+                       ret = 0;
+               }
+               send_status = 0;
+               goto out_rm;
+       }
+
+       ret = rpmemd_obc_status(rpmemd->obc, 0);
+       if (ret) {
+               RPMEMD_LOG(ERR, "writing status failed");
+               goto err_status;
+       }
+
+       rpmemd_print_info(rpmemd);
+
+       while (!ret) {
+               ret = rpmemd_obc_process(rpmemd->obc, &rpmemd_req, rpmemd);
+               if (ret) {
+                       RPMEMD_LOG(ERR, "out-of-band connection"
+                                       " process failed");
+                       goto err;
+               }
+
+               if (rpmemd->closing)
+                       break;
+       }
+
+       rpmemd_db_fini(rpmemd->db);
+       rpmemd_config_free(&rpmemd->config);
+       rpmemd_log_close();
+       rpmemd_obc_fini(rpmemd->obc);
+       free(rpmemd);
+
+       return 0;
+err:
+       rpmemd_req_cleanup(rpmemd);
+err_status:
+out_rm:
+       rpmemd_db_fini(rpmemd->db);
+err_db_init:
+err_log_init_config:
+       rpmemd_config_free(&rpmemd->config);
+err_config:
+       rpmemd_log_close();
+err_log_init:
+       if (send_status) {
+               if (rpmemd_obc_status(rpmemd->obc, (uint32_t)errno))
+                       RPMEMD_LOG(ERR, "writing status failed");
+       }
+       rpmemd_obc_fini(rpmemd->obc);
+err_obc:
+       free(rpmemd);
+err_rpmemd:
+       return ret;
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd.h
new file mode 100644 (file)
index 0000000..8fda7db
--- /dev/null
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd.h -- rpmemd main header file
+ */
+
+#define DAEMON_NAME    "rpmemd"
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.c
new file mode 100644 (file)
index 0000000..a544cd1
--- /dev/null
@@ -0,0 +1,640 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_config.c -- rpmemd config source file
+ */
+
+#include <pwd.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <inttypes.h>
+
+#include "rpmemd.h"
+#include "rpmemd_log.h"
+#include "rpmemd_config.h"
+#include "os.h"
+
+#define CONFIG_LINE_SIZE_INIT  50
+#define INVALID_CHAR_POS       UINT64_MAX
+
+struct rpmemd_special_chars_pos {
+       uint64_t equal_char;
+       uint64_t comment_char;
+       uint64_t EOL_char;
+};
+
+enum rpmemd_option {
+       RPD_OPT_LOG_FILE,
+       RPD_OPT_POOLSET_DIR,
+       RPD_OPT_PERSIST_APM,
+       RPD_OPT_PERSIST_GENERAL,
+       RPD_OPT_USE_SYSLOG,
+       RPD_OPT_LOG_LEVEL,
+       RPD_OPT_RM_POOLSET,
+
+       RPD_OPT_MAX_VALUE,
+       RPD_OPT_INVALID                 = UINT64_MAX,
+};
+
+static const char *optstr = "c:hVr:fst:";
+
+/*
+ * options -- cl and config file options
+ */
+static const struct option options[] = {
+{"config",             required_argument,      NULL, 'c'},
+{"help",               no_argument,            NULL, 'h'},
+{"version",            no_argument,            NULL, 'V'},
+{"log-file",           required_argument,      NULL, RPD_OPT_LOG_FILE},
+{"poolset-dir",                required_argument,      NULL, RPD_OPT_POOLSET_DIR},
+{"persist-apm",                no_argument,            NULL, RPD_OPT_PERSIST_APM},
+{"persist-general",    no_argument,            NULL, RPD_OPT_PERSIST_GENERAL},
+{"use-syslog",         no_argument,            NULL, RPD_OPT_USE_SYSLOG},
+{"log-level",          required_argument,      NULL, RPD_OPT_LOG_LEVEL},
+{"remove",             required_argument,      NULL, 'r'},
+{"force",              no_argument,            NULL, 'f'},
+{"pool-set",           no_argument,            NULL, 's'},
+{"nthreads",           required_argument,      NULL, 't'},
+{NULL,                 0,                      NULL,  0},
+};
+
+#define VALUE_INDENT   "                                        "
+
+static const char * const help_str =
+"\n"
+"Options:\n"
+"  -c, --config <path>           configuration file location\n"
+"  -r, --remove <poolset>        remove pool described by given poolset file\n"
+"  -f, --force                   ignore errors when removing a pool\n"
+"  -t, --nthreads <num>          number of processing threads\n"
+"  -h, --help                    display help message and exit\n"
+"  -V, --version                 display target daemon version and exit\n"
+"      --log-file <path>         log file location\n"
+"      --poolset-dir <path>      pool set files directory\n"
+"      --persist-apm             enable Appliance Persistency Method\n"
+"      --persist-general         enable General Server Persistency Mechanism\n"
+"      --use-syslog              use syslog(3) for logging messages\n"
+"      --log-level <level>       set log level value\n"
+VALUE_INDENT "err     error conditions\n"
+VALUE_INDENT "warn    warning conditions\n"
+VALUE_INDENT "notice  normal, but significant, condition\n"
+VALUE_INDENT "info    informational message\n"
+VALUE_INDENT "debug   debug-level message\n"
+"\n"
+"For complete documentation see %s(1) manual page.";
+
+/*
+ * print_version -- (internal) prints version message
+ */
+static void
+print_version(void)
+{
+       RPMEMD_LOG(ERR, "%s version %s", DAEMON_NAME, SRCVERSION);
+}
+
+/*
+ * print_usage -- (internal) prints usage message
+ */
+static void
+print_usage(const char *name)
+{
+       RPMEMD_LOG(ERR, "usage: %s [--version] [--help] [<args>]",
+               name);
+}
+
+/*
+ * print_help -- (internal) prints help message
+ */
+static void
+print_help(const char *name)
+{
+       print_usage(name);
+       print_version();
+       RPMEMD_LOG(ERR, help_str, DAEMON_NAME);
+}
+
+/*
+ * parse_config_string -- (internal) parse string value
+ */
+static inline char *
+parse_config_string(const char *value)
+{
+       if (strlen(value) == 0) {
+               errno = EINVAL;
+               return NULL;
+       }
+       char *output = strdup(value);
+       if (output == NULL)
+               RPMEMD_FATAL("!strdup");
+       return output;
+}
+
+/*
+ * parse_config_bool -- (internal) parse yes / no flag
+ */
+static inline int
+parse_config_bool(bool *config_value, const char *value)
+{
+       if (value == NULL)
+               *config_value = true;
+       else if (strcmp("yes", value) == 0)
+               *config_value = true;
+       else if (strcmp("no", value) == 0)
+               *config_value = false;
+       else {
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * set_option -- (internal) set single config option
+ */
+static int
+set_option(enum rpmemd_option option, const char *value,
+       struct rpmemd_config *config)
+{
+       int ret = 0;
+
+       switch (option) {
+       case RPD_OPT_LOG_FILE:
+               free(config->log_file);
+               config->log_file = parse_config_string(value);
+               if (config->log_file == NULL)
+                       return -1;
+               else
+                       config->use_syslog = false;
+               break;
+       case RPD_OPT_POOLSET_DIR:
+               free(config->poolset_dir);
+               config->poolset_dir = parse_config_string(value);
+               if (config->poolset_dir == NULL)
+                       return -1;
+               break;
+       case RPD_OPT_PERSIST_APM:
+               ret = parse_config_bool(&config->persist_apm, value);
+               break;
+       case RPD_OPT_PERSIST_GENERAL:
+               ret = parse_config_bool(&config->persist_general, value);
+               break;
+       case RPD_OPT_USE_SYSLOG:
+               ret = parse_config_bool(&config->use_syslog, value);
+               break;
+       case RPD_OPT_LOG_LEVEL:
+               config->log_level = rpmemd_log_level_from_str(value);
+               if (config->log_level == MAX_RPD_LOG) {
+                       errno = EINVAL;
+                       return -1;
+               }
+               break;
+       default:
+               errno = EINVAL;
+               return -1;
+       }
+
+       return ret;
+}
+
+/*
+ * get_config_line -- (internal) read single line from file
+ */
+static int
+get_config_line(FILE *file, char **line, uint64_t *line_max,
+       uint8_t *line_max_increased, struct rpmemd_special_chars_pos *pos)
+{
+       uint8_t line_complete = 0;
+       uint64_t line_length = 0;
+       char *line_part = *line;
+       do {
+               char *ret = fgets(line_part,
+                       (int)(*line_max - line_length), file);
+               if (ret == NULL)
+                       return 0;
+               for (uint64_t i = 0; i < *line_max; ++i) {
+                       if (line_part[i] == '\n')
+                               line_complete = 1;
+                       else if (line_part[i] == '\0') {
+                               line_length += i;
+                               if (line_length + 1 < *line_max)
+                                       line_complete = 1;
+                               break;
+                       } else if (line_part[i] == '#' &&
+                               pos->comment_char == UINT64_MAX)
+                               pos->comment_char = line_length + i;
+                       else if (line_part[i] == '=' &&
+                               pos->equal_char == UINT64_MAX)
+                               pos->equal_char = line_length + i;
+               }
+               if (line_complete == 0) {
+                       *line = realloc(*line, sizeof(char) * (*line_max) * 2);
+                       if (*line == NULL) {
+                               RPMEMD_FATAL("!realloc");
+                       }
+                       line_part = *line + *line_max - 1;
+                       line_length = *line_max - 1;
+                       *line_max *= 2;
+                       *line_max_increased = 1;
+               }
+       } while (line_complete != 1);
+
+       pos->EOL_char = line_length;
+       return 0;
+}
+
+/*
+ * trim_line_element -- (internal) remove white characters
+ */
+static char *
+trim_line_element(char *line, uint64_t start, uint64_t end)
+{
+       for (; start <= end; ++start) {
+               if (!isspace(line[start]))
+                       break;
+       }
+
+       for (; end > start; --end) {
+               if (!isspace(line[end - 1]))
+                       break;
+       }
+
+       if (start == end)
+               return NULL;
+
+       line[end] = '\0';
+       return &line[start];
+}
+
+/*
+ * parse_config_key -- (internal) lookup config key
+ */
+static enum rpmemd_option
+parse_config_key(const char *key)
+{
+       for (int i = 0; options[i].name != 0; ++i) {
+               if (strcmp(key, options[i].name) == 0)
+                       return (enum rpmemd_option)options[i].val;
+       }
+
+       return RPD_OPT_INVALID;
+}
+
+/*
+ * parse_config_line -- (internal) parse single config line
+ *
+ * Return newly written option flag. Store possible errors in errno.
+ */
+static int
+parse_config_line(char *line, struct rpmemd_special_chars_pos *pos,
+       struct rpmemd_config *config, uint64_t disabled)
+{
+       if (pos->comment_char < pos->equal_char)
+               pos->equal_char = INVALID_CHAR_POS;
+
+       uint64_t end_of_content = pos->comment_char != INVALID_CHAR_POS ?
+               pos->comment_char : pos->EOL_char;
+
+       if (pos->equal_char == INVALID_CHAR_POS) {
+               char *leftover = trim_line_element(line, 0, end_of_content);
+               if (leftover != NULL) {
+                       errno = EINVAL;
+                       return -1;
+               } else {
+                       return 0;
+               }
+       }
+
+       char *key_name = trim_line_element(line, 0, pos->equal_char);
+       char *value = trim_line_element(line, pos->equal_char + 1,
+               end_of_content);
+
+       if (key_name == NULL || value == NULL) {
+               errno = EINVAL;
+               return -1;
+       }
+
+       enum rpmemd_option key = parse_config_key(key_name);
+       if (key != RPD_OPT_INVALID) {
+               if ((disabled & (uint64_t)(1 << key)) == 0)
+                       if (set_option(key, value, config) != 0)
+                               return -1;
+       } else {
+               errno = EINVAL;
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * parse_config_file -- (internal) parse config file
+ */
+static int
+parse_config_file(const char *filename, struct rpmemd_config *config,
+       uint64_t disabled, int required)
+{
+       RPMEMD_ASSERT(filename != NULL);
+
+       FILE *file = os_fopen(filename, "r");
+       if (file == NULL) {
+               if (required) {
+                       RPMEMD_LOG(ERR, "!%s", filename);
+                       goto error_fopen;
+               } else {
+                       goto optional_config_missing;
+               }
+       }
+
+       uint8_t line_max_increased = 0;
+       uint64_t line_max = CONFIG_LINE_SIZE_INIT;
+       uint64_t line_num = 1;
+       char *line = (char *)malloc(sizeof(char) * line_max);
+       if (line == NULL) {
+               RPMEMD_LOG(ERR, "!malloc");
+               goto error_malloc_line;
+       }
+
+       char *line_copy = (char *)malloc(sizeof(char) * line_max);
+       if (line_copy == NULL) {
+               RPMEMD_LOG(ERR, "!malloc");
+               goto error_malloc_line_copy;
+       }
+
+       struct rpmemd_special_chars_pos pos;
+
+       do {
+               memset(&pos, 0xff, sizeof(pos));
+               if (get_config_line(file, &line, &line_max,
+                       &line_max_increased, &pos) != 0)
+                       goto error;
+
+               if (line_max_increased) {
+                       char *line_new = (char *)realloc(line_copy,
+                               sizeof(char) * line_max);
+                       if (line_new == NULL) {
+                               RPMEMD_LOG(ERR, "!malloc");
+                               goto error;
+                       }
+                       line_copy = line_new;
+                       line_max_increased = 0;
+               }
+
+               if (pos.EOL_char != INVALID_CHAR_POS) {
+                       strcpy(line_copy, line);
+                       int ret = parse_config_line(line_copy, &pos, config,
+                                       disabled);
+                       if (ret != 0) {
+                               size_t len = strlen(line);
+                               if (len > 0 && line[len - 1] == '\n')
+                                       line[len - 1] = '\0';
+                               RPMEMD_LOG(ERR, "Invalid config file line at "
+                                       "%s:%lu\n%s",
+                                       filename, line_num, line);
+                               goto error;
+                       }
+               }
+               ++line_num;
+       } while (pos.EOL_char != INVALID_CHAR_POS);
+
+       free(line_copy);
+       free(line);
+       fclose(file);
+optional_config_missing:
+       return 0;
+
+error:
+       free(line_copy);
+error_malloc_line_copy:
+       free(line);
+error_malloc_line:
+       fclose(file);
+error_fopen:
+       return -1;
+}
+
+/*
+ * parse_cl_args -- (internal) parse command line arguments
+ */
+static void
+parse_cl_args(int argc, char *argv[], struct rpmemd_config *config,
+               const char **config_file, uint64_t *cl_options)
+{
+       RPMEMD_ASSERT(argv != NULL);
+       RPMEMD_ASSERT(config != NULL);
+
+       int opt;
+       int option_index = 0;
+
+       while ((opt = getopt_long(argc, argv, optstr, options,
+               &option_index)) != -1) {
+
+               switch (opt) {
+               case 'c':
+                       (*config_file) = optarg;
+                       break;
+               case 'r':
+                       config->rm_poolset = optarg;
+                       break;
+               case 'f':
+                       config->force = true;
+                       break;
+               case 's':
+                       config->pool_set = true;
+                       break;
+               case 't':
+                       errno = 0;
+                       char *endptr;
+                       config->nthreads = strtoul(optarg, &endptr, 10);
+                       if (errno || *endptr != '\0') {
+                               RPMEMD_LOG(ERR,
+                                       "invalid number of threads -- '%s'",
+                                       optarg);
+                               exit(-1);
+                       }
+                       break;
+               case 'h':
+                       print_help(argv[0]);
+                       exit(0);
+               case 'V':
+                       print_version();
+                       exit(0);
+                       break;
+               default:
+                       if (set_option((enum rpmemd_option)opt, optarg, config)
+                                       == 0) {
+                               *cl_options |= (UINT64_C(1) << opt);
+                       } else {
+                               print_usage(argv[0]);
+                               exit(-1);
+                       }
+               }
+       }
+}
+
+/*
+ * get_home_dir -- (internal) return user home directory
+ *
+ * Function will lookup user home directory in order:
+ * 1. HOME environment variable
+ * 2. Password file entry using real user ID
+ */
+static void
+get_home_dir(char *str, size_t size)
+{
+       char *home = os_getenv(HOME_ENV);
+       if (home) {
+               int r = util_snprintf(str, size, "%s", home);
+               if (r < 0)
+                       RPMEMD_FATAL("!snprintf");
+       } else {
+               uid_t uid = getuid();
+               struct passwd *pw = getpwuid(uid);
+               if (pw == NULL)
+                       RPMEMD_FATAL("!getpwuid");
+
+               int r = util_snprintf(str, size, "%s", pw->pw_dir);
+               if (r < 0)
+                       RPMEMD_FATAL("!snprintf");
+       }
+}
+
+/*
+ * concat_dir_and_file_name -- (internal) concatenate directory and file name
+ * into single string path
+ */
+static void
+concat_dir_and_file_name(char *path, size_t size, const char *dir,
+       const char *file)
+{
+       int r = util_snprintf(path, size, "%s/%s", dir, file);
+       if (r < 0)
+               RPMEMD_FATAL("!snprintf");
+}
+
+/*
+ * str_replace_home -- (internal) replace $HOME string with user home directory
+ *
+ * If function does not find $HOME string it will return haystack untouched.
+ * Otherwise it will allocate new string with $HOME replaced with provided
+ * home_dir path. haystack will be released and newly created string returned.
+ */
+static char *
+str_replace_home(char *haystack, const char *home_dir)
+{
+       const size_t placeholder_len = strlen(HOME_STR_PLACEHOLDER);
+       const size_t home_len = strlen(home_dir);
+       size_t haystack_len = strlen(haystack);
+
+       char *pos = strstr(haystack, HOME_STR_PLACEHOLDER);
+       if (!pos)
+               return haystack;
+
+       const char *after = pos + placeholder_len;
+       if (isalnum(*after))
+               return haystack;
+
+       haystack_len += home_len - placeholder_len + 1;
+       char *buf = malloc(sizeof(char) * haystack_len);
+       if (!buf)
+               RPMEMD_FATAL("!malloc");
+
+       *pos = '\0';
+       int r = util_snprintf(buf, haystack_len, "%s%s%s", haystack, home_dir,
+               after);
+       if (r < 0)
+               RPMEMD_FATAL("!snprintf");
+
+       free(haystack);
+       return buf;
+}
+
+/*
+ * config_set_default -- (internal) load default config
+ */
+static void
+config_set_default(struct rpmemd_config *config, const char *poolset_dir)
+{
+       config->log_file = strdup(RPMEMD_DEFAULT_LOG_FILE);
+       if (!config->log_file)
+               RPMEMD_FATAL("!strdup");
+
+       config->poolset_dir = strdup(poolset_dir);
+       if (!config->poolset_dir)
+               RPMEMD_FATAL("!strdup");
+
+       config->persist_apm     = false;
+       config->persist_general = true;
+       config->use_syslog      = true;
+       config->max_lanes       = RPMEM_DEFAULT_MAX_LANES;
+       config->log_level       = RPD_LOG_ERR;
+       config->rm_poolset      = NULL;
+       config->force           = false;
+       config->nthreads        = RPMEM_DEFAULT_NTHREADS;
+}
+
+/*
+ * rpmemd_config_read -- read config from cl and config files
+ *
+ * cl param overwrites configuration from any config file. Config file are read
+ * in order:
+ * 1. Global config file
+ * 2. User config file
+ * or
+ * cl provided config file
+ */
+int
+rpmemd_config_read(struct rpmemd_config *config, int argc, char *argv[])
+{
+       const char *cl_config_file = NULL;
+       char user_config_file[PATH_MAX];
+       char home_dir[PATH_MAX];
+       uint64_t cl_options = 0;
+
+       get_home_dir(home_dir, PATH_MAX);
+       config_set_default(config, home_dir);
+       parse_cl_args(argc, argv, config, &cl_config_file, &cl_options);
+
+       if (cl_config_file) {
+               if (parse_config_file(cl_config_file, config, cl_options, 1)) {
+                       rpmemd_config_free(config);
+                       return 1;
+               }
+       } else {
+               if (parse_config_file(RPMEMD_GLOBAL_CONFIG_FILE, config,
+                               cl_options, 0)) {
+                       rpmemd_config_free(config);
+                       return 1;
+               }
+
+               concat_dir_and_file_name(user_config_file, PATH_MAX, home_dir,
+                       RPMEMD_USER_CONFIG_FILE);
+               if (parse_config_file(user_config_file, config, cl_options,
+                               0)) {
+                       rpmemd_config_free(config);
+                       return 1;
+               }
+       }
+
+       config->poolset_dir = str_replace_home(config->poolset_dir, home_dir);
+       return 0;
+}
+
+/*
+ * rpmemd_config_free -- rpmemd config release
+ */
+void
+rpmemd_config_free(struct rpmemd_config *config)
+{
+       free(config->log_file);
+       free(config->poolset_dir);
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_config.h
new file mode 100644 (file)
index 0000000..5308659
--- /dev/null
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_config.h -- internal definitions for rpmemd config
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifndef RPMEMD_DEFAULT_LOG_FILE
+#define RPMEMD_DEFAULT_LOG_FILE ("/var/log/" DAEMON_NAME ".log")
+#endif
+
+#ifndef RPMEMD_GLOBAL_CONFIG_FILE
+#define RPMEMD_GLOBAL_CONFIG_FILE ("/etc/" DAEMON_NAME "/" DAEMON_NAME\
+       ".conf")
+#endif
+
+#define RPMEMD_USER_CONFIG_FILE ("." DAEMON_NAME ".conf")
+
+#define RPMEM_DEFAULT_MAX_LANES        1024
+
+#define RPMEM_DEFAULT_NTHREADS 0
+
+#define HOME_ENV "HOME"
+
+#define HOME_STR_PLACEHOLDER ("$" HOME_ENV)
+
+struct rpmemd_config {
+       char *log_file;
+       char *poolset_dir;
+       const char *rm_poolset;
+       bool force;
+       bool pool_set;
+       bool persist_apm;
+       bool persist_general;
+       bool use_syslog;
+       uint64_t max_lanes;
+       enum rpmemd_log_level log_level;
+       size_t nthreads;
+};
+
+int rpmemd_config_read(struct rpmemd_config *config, int argc, char *argv[]);
+void rpmemd_config_free(struct rpmemd_config *config);
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.c
new file mode 100644 (file)
index 0000000..63fa787
--- /dev/null
@@ -0,0 +1,635 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_db.c -- rpmemd database of pool set files
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/file.h>
+#include <sys/mman.h>
+
+#include "queue.h"
+#include "set.h"
+#include "os.h"
+#include "out.h"
+#include "file.h"
+#include "sys_util.h"
+
+#include "librpmem.h"
+#include "rpmemd_db.h"
+#include "rpmemd_log.h"
+
+/*
+ * struct rpmemd_db -- pool set database structure
+ */
+struct rpmemd_db {
+       os_mutex_t lock;
+       char *root_dir;
+       mode_t mode;
+};
+
+/*
+ * declaration of the 'struct list_head' type
+ */
+PMDK_LIST_HEAD(list_head, rpmemd_db_entry);
+
+/*
+ * struct rpmemd_db_entry -- entry in the pool set list
+ */
+struct rpmemd_db_entry {
+       PMDK_LIST_ENTRY(rpmemd_db_entry) next;
+       char *pool_desc;
+       struct pool_set *set;
+};
+
+/*
+ * rpmemd_db_init -- initialize the rpmem database of pool set files
+ */
+struct rpmemd_db *
+rpmemd_db_init(const char *root_dir, mode_t mode)
+{
+       if (root_dir[0] != '/') {
+               RPMEMD_LOG(ERR, "root directory is not an absolute path"
+                               " -- '%s'", root_dir);
+               errno = EINVAL;
+               return NULL;
+       }
+       struct rpmemd_db *db = calloc(1, sizeof(*db));
+       if (!db) {
+               RPMEMD_LOG(ERR, "!allocating the rpmem database structure");
+               return NULL;
+       }
+
+       db->root_dir = strdup(root_dir);
+       if (!db->root_dir) {
+               RPMEMD_LOG(ERR, "!allocating the root dir path");
+               free(db);
+               return NULL;
+       }
+
+       db->mode = mode;
+
+       util_mutex_init(&db->lock);
+
+       return db;
+}
+
+/*
+ * rpmemd_db_concat -- (internal) concatenate two paths
+ */
+static char *
+rpmemd_db_concat(const char *path1, const char *path2)
+{
+       size_t len1 = strlen(path1);
+       size_t len2 = strlen(path2);
+       size_t new_len = len1 + len2 + 2; /* +1 for '/' in snprintf() */
+
+       if (path1[0] != '/') {
+               RPMEMD_LOG(ERR, "the first path is not an absolute one -- '%s'",
+                               path1);
+               errno = EINVAL;
+               return NULL;
+       }
+       if (path2[0] == '/') {
+               RPMEMD_LOG(ERR, "the second path is not a relative one -- '%s'",
+                               path2);
+               /* set to EBADF to distinguish this case from other errors */
+               errno = EBADF;
+               return NULL;
+       }
+
+       char *new_str = malloc(new_len);
+       if (new_str == NULL) {
+               RPMEMD_LOG(ERR, "!allocating path buffer");
+               return NULL;
+       }
+
+       int ret = util_snprintf(new_str, new_len, "%s/%s", path1, path2);
+       if (ret < 0) {
+               RPMEMD_LOG(ERR, "!snprintf");
+               free(new_str);
+               errno = EINVAL;
+               return NULL;
+       }
+
+       return new_str;
+}
+
+/*
+ * rpmemd_db_get_path -- (internal) get the full path of the pool set file
+ */
+static char *
+rpmemd_db_get_path(struct rpmemd_db *db, const char *pool_desc)
+{
+       return rpmemd_db_concat(db->root_dir, pool_desc);
+}
+
+/*
+ * rpmemd_db_pool_madvise -- (internal) workaround device dax alignment issue
+ */
+static int
+rpmemd_db_pool_madvise(struct pool_set *set)
+{
+       /*
+        * This is a workaround for an issue with using device dax with
+        * libibverbs. The problem is that we use ibv_fork_init(3) which
+        * makes all registered memory being madvised with MADV_DONTFORK
+        * flag. In libpmemobj the remote replication is performed without
+        * pool header (first 4k). In such case the address passed to
+        * madvise(2) is aligned to 4k, but device dax can require different
+        * alignment (default is 2MB). This workaround madvises the entire
+        * memory region before registering it by ibv_reg_mr(3).
+        */
+       const struct pool_set_part *part = &set->replica[0]->part[0];
+       if (part->is_dev_dax) {
+               int ret = os_madvise(part->addr, part->filesize,
+                       MADV_DONTFORK);
+               if (ret) {
+                       ERR("!madvise");
+                       return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * rpmemd_get_attr -- (internal) get pool attributes from remote pool attributes
+ */
+static void
+rpmemd_get_attr(struct pool_attr *attr, const struct rpmem_pool_attr *rattr)
+{
+       LOG(3, "attr %p, rattr %p", attr, rattr);
+       memcpy(attr->signature, rattr->signature, POOL_HDR_SIG_LEN);
+       attr->major = rattr->major;
+       attr->features.compat = rattr->compat_features;
+       attr->features.incompat = rattr->incompat_features;
+       attr->features.ro_compat = rattr->ro_compat_features;
+       memcpy(attr->poolset_uuid, rattr->poolset_uuid, POOL_HDR_UUID_LEN);
+       memcpy(attr->first_part_uuid, rattr->uuid, POOL_HDR_UUID_LEN);
+       memcpy(attr->prev_repl_uuid, rattr->prev_uuid, POOL_HDR_UUID_LEN);
+       memcpy(attr->next_repl_uuid, rattr->next_uuid, POOL_HDR_UUID_LEN);
+       memcpy(attr->arch_flags, rattr->user_flags, POOL_HDR_ARCH_LEN);
+}
+
+/*
+ * rpmemd_db_pool_create -- create a new pool set
+ */
+struct rpmemd_db_pool *
+rpmemd_db_pool_create(struct rpmemd_db *db, const char *pool_desc,
+                       size_t pool_size, const struct rpmem_pool_attr *rattr)
+{
+       RPMEMD_ASSERT(db != NULL);
+
+       util_mutex_lock(&db->lock);
+
+       struct rpmemd_db_pool *prp = NULL;
+       struct pool_set *set;
+       char *path;
+       int ret;
+
+       prp = malloc(sizeof(struct rpmemd_db_pool));
+       if (!prp) {
+               RPMEMD_LOG(ERR, "!allocating pool set db entry");
+               goto err_unlock;
+       }
+
+       path = rpmemd_db_get_path(db, pool_desc);
+       if (!path) {
+               goto err_free_prp;
+       }
+
+       struct pool_attr attr;
+       struct pool_attr *pattr = NULL;
+       if (rattr != NULL) {
+               rpmemd_get_attr(&attr, rattr);
+               pattr = &attr;
+       }
+
+       ret = util_pool_create_uuids(&set, path, 0, RPMEM_MIN_POOL,
+                       RPMEM_MIN_PART, pattr, NULL, REPLICAS_DISABLED,
+                       POOL_REMOTE);
+       if (ret) {
+               RPMEMD_LOG(ERR, "!cannot create pool set -- '%s'", path);
+               goto err_free_path;
+       }
+
+       ret = util_poolset_chmod(set, db->mode);
+       if (ret) {
+               RPMEMD_LOG(ERR, "!cannot change pool set mode bits to 0%o",
+                               db->mode);
+       }
+
+       if (rpmemd_db_pool_madvise(set))
+               goto err_poolset_close;
+
+       /* mark as opened */
+       prp->pool_addr = set->replica[0]->part[0].addr;
+       prp->pool_size = set->poolsize;
+       prp->set = set;
+
+       free(path);
+       util_mutex_unlock(&db->lock);
+
+       return prp;
+
+err_poolset_close:
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+err_free_path:
+       free(path);
+err_free_prp:
+       free(prp);
+err_unlock:
+       util_mutex_unlock(&db->lock);
+       return NULL;
+}
+
+/*
+ * rpmemd_db_pool_open -- open a pool set
+ */
+struct rpmemd_db_pool *
+rpmemd_db_pool_open(struct rpmemd_db *db, const char *pool_desc,
+                       size_t pool_size, struct rpmem_pool_attr *rattr)
+{
+       RPMEMD_ASSERT(db != NULL);
+       RPMEMD_ASSERT(rattr != NULL);
+
+       util_mutex_lock(&db->lock);
+
+       struct rpmemd_db_pool *prp = NULL;
+       struct pool_set *set;
+       char *path;
+       int ret;
+
+       prp = malloc(sizeof(struct rpmemd_db_pool));
+       if (!prp) {
+               RPMEMD_LOG(ERR, "!allocating pool set db entry");
+               goto err_unlock;
+       }
+
+       path = rpmemd_db_get_path(db, pool_desc);
+       if (!path) {
+               goto err_free_prp;
+       }
+
+       ret = util_pool_open_remote(&set, path, 0, RPMEM_MIN_PART, rattr);
+       if (ret) {
+               RPMEMD_LOG(ERR, "!cannot open pool set -- '%s'", path);
+               goto err_free_path;
+       }
+
+       if (rpmemd_db_pool_madvise(set))
+               goto err_poolset_close;
+
+       /* mark as opened */
+       prp->pool_addr = set->replica[0]->part[0].addr;
+       prp->pool_size = set->poolsize;
+       prp->set = set;
+
+       free(path);
+       util_mutex_unlock(&db->lock);
+
+       return prp;
+
+err_poolset_close:
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+err_free_path:
+       free(path);
+err_free_prp:
+       free(prp);
+err_unlock:
+       util_mutex_unlock(&db->lock);
+       return NULL;
+}
+
+/*
+ * rpmemd_db_pool_close -- close a pool set
+ */
+void
+rpmemd_db_pool_close(struct rpmemd_db *db, struct rpmemd_db_pool *prp)
+{
+       RPMEMD_ASSERT(db != NULL);
+
+       util_mutex_lock(&db->lock);
+
+       util_poolset_close(prp->set, DO_NOT_DELETE_PARTS);
+       free(prp);
+
+       util_mutex_unlock(&db->lock);
+}
+
+/*
+ * rpmemd_db_pool_set_attr -- overwrite pool attributes
+ */
+int
+rpmemd_db_pool_set_attr(struct rpmemd_db_pool *prp,
+       const struct rpmem_pool_attr *rattr)
+{
+       RPMEMD_ASSERT(prp != NULL);
+       RPMEMD_ASSERT(prp->set != NULL);
+       RPMEMD_ASSERT(prp->set->nreplicas == 1);
+
+       return util_replica_set_attr(prp->set->replica[0], rattr);
+}
+
+struct rm_cb_args {
+       int force;
+       int ret;
+};
+
+/*
+ * rm_poolset_cb -- (internal) callback for removing part files
+ */
+static int
+rm_poolset_cb(struct part_file *pf, void *arg)
+{
+       struct rm_cb_args *args = (struct rm_cb_args *)arg;
+       if (pf->is_remote) {
+               RPMEMD_LOG(ERR, "removing remote replica not supported");
+               return -1;
+       }
+
+       int ret = util_unlink_flock(pf->part->path);
+       if (!args->force && ret) {
+               RPMEMD_LOG(ERR, "!unlink -- '%s'", pf->part->path);
+               args->ret = ret;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_db_pool_remove -- remove a pool set
+ */
+int
+rpmemd_db_pool_remove(struct rpmemd_db *db, const char *pool_desc,
+       int force, int pool_set)
+{
+       RPMEMD_ASSERT(db != NULL);
+       RPMEMD_ASSERT(pool_desc != NULL);
+
+       util_mutex_lock(&db->lock);
+
+       struct rm_cb_args args;
+       args.force = force;
+       args.ret = 0;
+       char *path;
+
+       path = rpmemd_db_get_path(db, pool_desc);
+       if (!path) {
+               args.ret = -1;
+               goto err_unlock;
+       }
+
+       int ret = util_poolset_foreach_part(path, rm_poolset_cb, &args);
+       if (!force && ret) {
+               RPMEMD_LOG(ERR, "!removing '%s' failed", path);
+               args.ret = ret;
+               goto err_free_path;
+       }
+
+       if (pool_set)
+               os_unlink(path);
+
+err_free_path:
+       free(path);
+err_unlock:
+       util_mutex_unlock(&db->lock);
+       return args.ret;
+}
+
+/*
+ * rpmemd_db_fini -- deinitialize the rpmem database of pool set files
+ */
+void
+rpmemd_db_fini(struct rpmemd_db *db)
+{
+       RPMEMD_ASSERT(db != NULL);
+
+       util_mutex_destroy(&db->lock);
+       free(db->root_dir);
+       free(db);
+}
+
+/*
+ * rpmemd_db_check_dups_set -- (internal) check for duplicates in the database
+ */
+static inline int
+rpmemd_db_check_dups_set(struct pool_set *set, const char *path)
+{
+       for (unsigned r = 0; r < set->nreplicas; r++) {
+               struct pool_replica *rep = set->replica[r];
+               for (unsigned p = 0; p < rep->nparts; p++) {
+                       if (strcmp(path, rep->part[p].path) == 0)
+                               return -1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * rpmemd_db_check_dups -- (internal) check for duplicates in the database
+ */
+static int
+rpmemd_db_check_dups(struct list_head *head, struct rpmemd_db *db,
+                       const char *pool_desc, struct pool_set *set)
+{
+       struct rpmemd_db_entry *edb;
+
+       PMDK_LIST_FOREACH(edb, head, next) {
+               for (unsigned r = 0; r < edb->set->nreplicas; r++) {
+                       struct pool_replica *rep = edb->set->replica[r];
+                       for (unsigned p = 0; p < rep->nparts; p++) {
+                               if (rpmemd_db_check_dups_set(set,
+                                                       rep->part[p].path)) {
+                                       RPMEMD_LOG(ERR, "part file '%s' from "
+                                               "pool set '%s' duplicated in "
+                                               "pool set '%s'",
+                                               rep->part[p].path,
+                                               pool_desc,
+                                               edb->pool_desc);
+                                       errno = EEXIST;
+                                       return -1;
+                               }
+
+                       }
+               }
+       }
+       return 0;
+}
+
+/*
+ * rpmemd_db_add -- (internal) add an entry for a given set to the database
+ */
+static struct rpmemd_db_entry *
+rpmemd_db_add(struct list_head *head, struct rpmemd_db *db,
+                       const char *pool_desc, struct pool_set *set)
+{
+       struct rpmemd_db_entry *edb;
+
+       edb = calloc(1, sizeof(*edb));
+       if (!edb) {
+               RPMEMD_LOG(ERR, "!allocating database entry");
+               goto err_calloc;
+       }
+
+       edb->set = set;
+       edb->pool_desc = strdup(pool_desc);
+       if (!edb->pool_desc) {
+               RPMEMD_LOG(ERR, "!allocating path for database entry");
+               goto err_strdup;
+       }
+
+       PMDK_LIST_INSERT_HEAD(head, edb, next);
+
+       return edb;
+
+err_strdup:
+       free(edb);
+err_calloc:
+       return NULL;
+}
+
+/*
+ * new_paths -- (internal) create two new paths
+ */
+static int
+new_paths(const char *dir, const char *name, const char *old_desc,
+               char **path, char **new_desc)
+{
+       *path = rpmemd_db_concat(dir, name);
+       if (!(*path))
+               return -1;
+
+       if (old_desc[0] != 0)
+               *new_desc = rpmemd_db_concat(old_desc, name);
+       else {
+               *new_desc = strdup(name);
+               if (!(*new_desc)) {
+                       RPMEMD_LOG(ERR, "!allocating new descriptor");
+               }
+       }
+       if (!(*new_desc)) {
+               free(*path);
+               return -1;
+       }
+       return 0;
+}
+
+/*
+ * rpmemd_db_check_dir_r -- (internal) recursively check given directory
+ *                          for duplicates
+ */
+static int
+rpmemd_db_check_dir_r(struct list_head *head, struct rpmemd_db *db,
+                       const char *dir, char *pool_desc)
+{
+       char *new_dir, *new_desc, *full_path;
+       struct dirent *dentry;
+       struct pool_set *set = NULL;
+       DIR *dirp;
+       int ret = 0;
+
+       dirp = opendir(dir);
+       if (dirp == NULL) {
+               RPMEMD_LOG(ERR, "cannot open the directory -- %s", dir);
+               return -1;
+       }
+
+       while ((dentry = readdir(dirp)) != NULL) {
+               if (strcmp(dentry->d_name, ".") == 0 ||
+                   strcmp(dentry->d_name, "..") == 0)
+                       continue;
+
+               if (dentry->d_type == DT_DIR) { /* directory */
+                       if (new_paths(dir, dentry->d_name, pool_desc,
+                                       &new_dir, &new_desc))
+                               goto err_closedir;
+
+                       /* call recursively for a new directory */
+                       ret = rpmemd_db_check_dir_r(head, db, new_dir,
+                                                       new_desc);
+                       free(new_dir);
+                       free(new_desc);
+                       if (ret)
+                               goto err_closedir;
+                       continue;
+
+               }
+
+               if (new_paths(dir, dentry->d_name, pool_desc,
+                               &full_path, &new_desc)) {
+                       goto err_closedir;
+               }
+               if (util_poolset_read(&set, full_path)) {
+                       RPMEMD_LOG(ERR, "!error reading pool set file -- %s",
+                                       full_path);
+                       goto err_free_paths;
+               }
+               if (rpmemd_db_check_dups(head, db, new_desc, set)) {
+                       RPMEMD_LOG(ERR, "!duplicate found in pool set file"
+                                       " -- %s", full_path);
+                       goto err_free_set;
+               }
+               if (rpmemd_db_add(head, db, new_desc, set) == NULL) {
+                       goto err_free_set;
+               }
+
+               free(new_desc);
+               free(full_path);
+       }
+
+       closedir(dirp);
+       return 0;
+
+err_free_set:
+       util_poolset_close(set, DO_NOT_DELETE_PARTS);
+err_free_paths:
+       free(new_desc);
+       free(full_path);
+err_closedir:
+       closedir(dirp);
+       return -1;
+}
+
+/*
+ * rpmemd_db_check_dir -- check given directory for duplicates
+ */
+int
+rpmemd_db_check_dir(struct rpmemd_db *db)
+{
+       RPMEMD_ASSERT(db != NULL);
+
+       util_mutex_lock(&db->lock);
+
+       struct list_head head;
+       PMDK_LIST_INIT(&head);
+
+       int ret = rpmemd_db_check_dir_r(&head, db, db->root_dir, "");
+
+       while (!PMDK_LIST_EMPTY(&head)) {
+               struct rpmemd_db_entry *edb = PMDK_LIST_FIRST(&head);
+               PMDK_LIST_REMOVE(edb, next);
+               util_poolset_close(edb->set, DO_NOT_DELETE_PARTS);
+               free(edb->pool_desc);
+               free(edb);
+       }
+
+       util_mutex_unlock(&db->lock);
+
+       return ret;
+}
+
+/*
+ * rpmemd_db_pool_is_pmem -- true if pool is in PMEM
+ */
+int
+rpmemd_db_pool_is_pmem(struct rpmemd_db_pool *pool)
+{
+       return REP(pool->set, 0)->is_pmem;
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_db.h
new file mode 100644 (file)
index 0000000..17d087b
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_db.h -- internal definitions for rpmemd database of pool set files
+ */
+
+struct rpmemd_db;
+struct rpmem_pool_attr;
+
+/*
+ * struct rpmemd_db_pool -- remote pool context
+ */
+struct rpmemd_db_pool {
+       void *pool_addr;
+       size_t pool_size;
+       struct pool_set *set;
+};
+
+struct rpmemd_db *rpmemd_db_init(const char *root_dir, mode_t mode);
+struct rpmemd_db_pool *rpmemd_db_pool_create(struct rpmemd_db *db,
+       const char *pool_desc, size_t pool_size,
+       const struct rpmem_pool_attr *rattr);
+struct rpmemd_db_pool *rpmemd_db_pool_open(struct rpmemd_db *db,
+       const char *pool_desc, size_t pool_size, struct rpmem_pool_attr *rattr);
+int rpmemd_db_pool_remove(struct rpmemd_db *db, const char *pool_desc,
+               int force, int pool_set);
+int rpmemd_db_pool_set_attr(struct rpmemd_db_pool *prp,
+       const struct rpmem_pool_attr *rattr);
+void rpmemd_db_pool_close(struct rpmemd_db *db, struct rpmemd_db_pool *prp);
+void rpmemd_db_fini(struct rpmemd_db *db);
+int rpmemd_db_check_dir(struct rpmemd_db *db);
+int rpmemd_db_pool_is_pmem(struct rpmemd_db_pool *pool);
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.c
new file mode 100644 (file)
index 0000000..3e4ff52
--- /dev/null
@@ -0,0 +1,1216 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_fip.c -- rpmemd libfabric provider module source file
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <rdma/fabric.h>
+#include <rdma/fi_domain.h>
+#include <rdma/fi_endpoint.h>
+#include <rdma/fi_cm.h>
+#include <rdma/fi_errno.h>
+
+#include "rpmemd_log.h"
+
+#include "rpmem_common.h"
+#include "rpmem_proto.h"
+#include "rpmem_fip_msg.h"
+#include "rpmem_fip_common.h"
+#include "rpmemd_fip.h"
+
+#include "os_thread.h"
+#include "util.h"
+#include "valgrind_internal.h"
+
+#define RPMEMD_FI_ERR(e, fmt, args...)\
+       RPMEMD_LOG(ERR, fmt ": %s", ## args, fi_strerror((e)))
+
+#define RPMEMD_FI_CLOSE(f, fmt, args...) (\
+{\
+       int ret = fi_close(&(f)->fid);\
+       if (ret)\
+               RPMEMD_FI_ERR(ret, fmt, ## args);\
+       ret;\
+})
+
+/*
+ * rpmem_fip_lane -- base lane structure
+ */
+struct rpmem_fip_lane {
+       struct fid_ep *ep;
+       struct fid_cq *cq;
+};
+
+/*
+ * rpmemd_fip_lane -- daemon's lane
+ */
+struct rpmemd_fip_lane {
+       struct rpmem_fip_lane base;     /* lane base structure */
+       struct rpmem_fip_msg recv;      /* RECV message */
+       struct rpmem_fip_msg send;      /* SEND message */
+       struct rpmem_msg_persist_resp resp; /* persist response msg buffer */
+       int send_posted;                /* send buffer has been posted */
+       int recv_posted;                /* recv buffer has been posted */
+};
+
+/*
+ * rpmemd_fip_thread -- thread context
+ */
+struct rpmemd_fip_thread {
+       struct rpmemd_fip *fip;         /* main context */
+       os_thread_t thread;             /* thread structure */
+       struct fid_cq *cq;              /* per-thread completion queue */
+       struct rpmemd_fip_lane **lanes; /* lanes processed by this thread */
+       size_t nlanes;  /* number of lanes processed by this thread */
+};
+
+/*
+ * rpmemd_fip -- main context of rpmemd_fip
+ */
+struct rpmemd_fip {
+       struct fi_info *fi;             /* fabric interface information */
+       struct fid_fabric *fabric;      /* fabric domain */
+       struct fid_domain *domain;      /* fabric protection domain */
+       struct fid_eq *eq;              /* event queue */
+       struct fid_pep *pep;            /* passive endpoint - listener */
+       struct fid_mr *mr;              /* memory region for pool */
+
+       int (*persist)(const void *addr, size_t len);   /* persist function */
+       void *(*memcpy_persist)(void *pmemdest, const void *src, size_t len);
+       int (*deep_persist)(const void *addr, size_t len, void *ctx);
+       void *ctx;
+       void *addr;                     /* pool's address */
+       size_t size;                    /* size of the pool */
+       enum rpmem_persist_method persist_method;
+
+       volatile int closing;   /* flag for closing background threads */
+       unsigned nlanes;        /* number of lanes */
+       size_t nthreads;        /* number of threads for processing */
+       size_t cq_size; /* size of completion queue */
+       size_t lanes_per_thread; /* number of lanes per thread */
+       size_t buff_size;       /* size of buffer for inlined data */
+
+       struct rpmemd_fip_lane *lanes;
+       struct rpmem_fip_lane rd_lane; /* lane for read operation */
+
+       void *pmsg;                     /* persist message buffer */
+       size_t pmsg_size; /* persist message buffer size including alignment */
+       struct fid_mr *pmsg_mr;         /* persist message memory region */
+       void *pmsg_mr_desc;             /* persist message local descriptor */
+
+       struct rpmem_msg_persist_resp *pres; /* persist response buffer */
+       struct fid_mr *pres_mr;         /* persist response memory region */
+       void *pres_mr_desc;             /* persist response local descriptor */
+
+       struct rpmemd_fip_thread *threads;
+};
+
+/*
+ * rpmemd_fip_get_pmsg -- return persist message buffer
+ */
+static inline struct rpmem_msg_persist *
+rpmemd_fip_get_pmsg(struct rpmemd_fip *fip, size_t idx)
+{
+       return (struct rpmem_msg_persist *)
+               ((uintptr_t)fip->pmsg + idx * fip->pmsg_size);
+}
+
+/*
+ * rpmemd_fip_getinfo -- obtain fabric interface information
+ */
+static int
+rpmemd_fip_getinfo(struct rpmemd_fip *fip, const char *service,
+       const char *node, enum rpmem_provider provider)
+{
+       int ret;
+
+       struct fi_info *hints = rpmem_fip_get_hints(provider);
+       if (!hints) {
+               RPMEMD_LOG(ERR, "getting fabric interface hints");
+               ret = -1;
+               goto err_fi_get_hints;
+       }
+
+       ret = fi_getinfo(RPMEM_FIVERSION, node, service, FI_SOURCE,
+                       hints, &fip->fi);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "getting fabric interface information");
+               goto err_fi_getinfo;
+       }
+
+       rpmem_fip_print_info(fip->fi);
+
+       fi_freeinfo(hints);
+       return 0;
+err_fi_getinfo:
+       fi_freeinfo(hints);
+err_fi_get_hints:
+       return ret;
+}
+
+/*
+ * rpmemd_fip_set_resp -- fill the response structure
+ */
+static int
+rpmemd_fip_set_resp(struct rpmemd_fip *fip, struct rpmem_resp_attr *resp)
+{
+       int ret;
+       if (fip->fi->addr_format == FI_SOCKADDR_IN) {
+               struct sockaddr_in addr_in;
+               size_t addrlen = sizeof(addr_in);
+
+               ret = fi_getname(&fip->pep->fid, &addr_in, &addrlen);
+               if (ret) {
+                       RPMEMD_FI_ERR(ret, "getting local endpoint address");
+                       goto err_fi_getname;
+               }
+
+               if (!addr_in.sin_port) {
+                       RPMEMD_LOG(ERR, "dynamic allocation of port failed");
+                       goto err_port;
+               }
+
+               resp->port = htons(addr_in.sin_port);
+       } else if (fip->fi->addr_format == FI_SOCKADDR_IN6) {
+               struct sockaddr_in6 addr_in6;
+               size_t addrlen = sizeof(addr_in6);
+
+               ret = fi_getname(&fip->pep->fid, &addr_in6, &addrlen);
+               if (ret) {
+                       RPMEMD_FI_ERR(ret, "getting local endpoint address");
+                       goto err_fi_getname;
+               }
+
+               if (!addr_in6.sin6_port) {
+                       RPMEMD_LOG(ERR, "dynamic allocation of port failed");
+                       goto err_port;
+               }
+
+               resp->port = htons(addr_in6.sin6_port);
+       } else {
+               RPMEMD_LOG(ERR, "invalid address format");
+               return -1;
+       }
+
+       resp->rkey = fi_mr_key(fip->mr);
+       resp->persist_method = fip->persist_method;
+       resp->raddr = (uint64_t)fip->addr;
+       resp->nlanes = fip->nlanes;
+
+       return 0;
+err_port:
+err_fi_getname:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_init_fabric_res -- initialize common fabric's resources
+ */
+static int
+rpmemd_fip_init_fabric_res(struct rpmemd_fip *fip)
+{
+       int ret;
+       ret = fi_fabric(fip->fi->fabric_attr, &fip->fabric, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "opening fabric domain");
+               goto err_fi_fabric;
+       }
+
+       ret = fi_domain(fip->fabric, fip->fi, &fip->domain, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "opening fabric access domain");
+               goto err_fi_domain;
+       }
+
+       struct fi_eq_attr eq_attr = {
+               .size = 0,      /* use default */
+               .flags = 0,
+               .wait_obj = FI_WAIT_UNSPEC,
+               .signaling_vector = 0,
+               .wait_set = NULL,
+       };
+
+       ret = fi_eq_open(fip->fabric, &eq_attr, &fip->eq, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "opening event queue");
+               goto err_eq_open;
+       }
+
+       ret = fi_passive_ep(fip->fabric, fip->fi, &fip->pep, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "allocating passive endpoint");
+               goto err_pep;
+       }
+
+       ret = fi_pep_bind(fip->pep, &fip->eq->fid, 0);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "binding event queue to passive endpoint");
+               goto err_pep_bind_eq;
+       }
+
+       return 0;
+err_pep_bind_eq:
+       RPMEMD_FI_CLOSE(fip->pep, "closing passive endpoint");
+err_pep:
+       RPMEMD_FI_CLOSE(fip->eq, "closing event queue");
+err_eq_open:
+       RPMEMD_FI_CLOSE(fip->domain, "closing fabric access domain");
+err_fi_domain:
+       RPMEMD_FI_CLOSE(fip->fabric, "closing fabric domain");
+err_fi_fabric:
+       return ret;
+}
+
+/*
+ * rpmemd_fip_fini_fabric_res -- deinitialize common fabric resources
+ */
+static void
+rpmemd_fip_fini_fabric_res(struct rpmemd_fip *fip)
+{
+       RPMEMD_FI_CLOSE(fip->pep, "closing passive endpoint");
+       RPMEMD_FI_CLOSE(fip->eq, "closing event queue");
+       RPMEMD_FI_CLOSE(fip->domain, "closing fabric access domain");
+       RPMEMD_FI_CLOSE(fip->fabric, "closing fabric domain");
+}
+
+/*
+ * rpmemd_fip_init_memory -- initialize memory pool's resources
+ */
+static int
+rpmemd_fip_init_memory(struct rpmemd_fip *fip)
+{
+       int ret;
+
+       /*
+        * Register memory region with appropriate access bits:
+        * - FI_REMOTE_READ  - remote peer can issue READ operation,
+        * - FI_REMOTE_WRITE - remote peer can issue WRITE operation,
+        */
+       ret = fi_mr_reg(fip->domain, fip->addr, fip->size,
+                       FI_REMOTE_READ | FI_REMOTE_WRITE, 0, 0, 0,
+                       &fip->mr, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "registering memory");
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_fip_fini_memory -- deinitialize memory pool's resources
+ */
+static void
+rpmemd_fip_fini_memory(struct rpmemd_fip *fip)
+{
+       RPMEMD_FI_CLOSE(fip->mr, "unregistering memory");
+}
+
+/*
+ * rpmemd_fip_init_ep -- initialize active endpoint
+ */
+static int
+rpmemd_fip_init_ep(struct rpmemd_fip *fip, struct fi_info *info,
+       struct rpmem_fip_lane *lanep)
+{
+       int ret;
+
+       info->tx_attr->size = rpmem_fip_wq_size(fip->persist_method,
+                       RPMEM_FIP_NODE_SERVER);
+
+       info->rx_attr->size = rpmem_fip_rx_size(fip->persist_method,
+                       RPMEM_FIP_NODE_SERVER);
+
+       /* create an endpoint from fabric interface info */
+       ret = fi_endpoint(fip->domain, info, &lanep->ep, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "allocating endpoint");
+               goto err_endpoint;
+       }
+
+       /* bind event queue to the endpoint */
+       ret = fi_ep_bind(lanep->ep, &fip->eq->fid, 0);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "binding event queue to endpoint");
+               goto err_bind_eq;
+       }
+
+       /*
+        * Bind completion queue to the endpoint.
+        * Use a single completion queue for outbound and inbound work
+        * requests. Use selective completion implies adding FI_COMPLETE
+        * flag to each WR which needs a completion.
+        */
+       ret = fi_ep_bind(lanep->ep, &lanep->cq->fid,
+                       FI_RECV | FI_TRANSMIT | FI_SELECTIVE_COMPLETION);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "binding completion queue to endpoint");
+               goto err_bind_cq;
+       }
+
+       /* enable the endpoint */
+       ret = fi_enable(lanep->ep);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "enabling endpoint");
+               goto err_enable;
+       }
+
+       return 0;
+err_enable:
+err_bind_cq:
+err_bind_eq:
+       RPMEMD_FI_CLOSE(lanep->ep, "closing endpoint");
+err_endpoint:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_fini_ep -- close endpoint
+ */
+static int
+rpmemd_fip_fini_ep(struct rpmem_fip_lane *lanep)
+{
+       return RPMEMD_FI_CLOSE(lanep->ep, "closing endpoint");
+}
+
+/*
+ * rpmemd_fip_post_msg -- post RECV buffer
+ */
+static inline int
+rpmemd_fip_post_msg(struct rpmemd_fip_lane *lanep)
+{
+       int ret = rpmem_fip_recvmsg(lanep->base.ep, &lanep->recv);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "posting recv buffer");
+               return ret;
+       }
+
+       lanep->recv_posted = 1;
+
+       return 0;
+}
+
+/*
+ * rpmemd_fip_post_resp -- post SEND buffer
+ */
+static inline int
+rpmemd_fip_post_resp(struct rpmemd_fip_lane *lanep)
+{
+       int ret = rpmem_fip_sendmsg(lanep->base.ep, &lanep->send,
+                       sizeof(struct rpmem_msg_persist_resp));
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "posting send buffer");
+               return ret;
+       }
+
+       lanep->send_posted = 1;
+
+       return 0;
+}
+
+/*
+ * rpmemd_fip_post_common -- post all RECV messages
+ */
+static int
+rpmemd_fip_post_common(struct rpmemd_fip *fip, struct rpmemd_fip_lane *lanep)
+{
+       int ret = rpmem_fip_recvmsg(lanep->base.ep, &lanep->recv);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "posting recv buffer");
+               return ret;
+       }
+
+       lanep->recv_posted = 1;
+
+       return 0;
+}
+
+/*
+ * rpmemd_fip_lanes_init -- initialize all lanes
+ */
+static int
+rpmemd_fip_lanes_init(struct rpmemd_fip *fip)
+{
+
+       fip->lanes = calloc(fip->nlanes, sizeof(*fip->lanes));
+       if (!fip->lanes) {
+               RPMEMD_ERR("!allocating lanes");
+               goto err_alloc;
+       }
+
+       return 0;
+err_alloc:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_fini_lanes -- deinitialize all lanes
+ */
+static void
+rpmemd_fip_fini_lanes(struct rpmemd_fip *fip)
+{
+       free(fip->lanes);
+}
+
+/*
+ * rpmemd_fip_init_common -- initialize common resources
+ */
+static int
+rpmemd_fip_init_common(struct rpmemd_fip *fip)
+{
+       int ret;
+
+       /* allocate persist message buffer */
+       size_t msg_size = fip->nlanes * fip->pmsg_size;
+       fip->pmsg = malloc(msg_size);
+       if (!fip->pmsg) {
+               RPMEMD_LOG(ERR, "!allocating messages buffer");
+               goto err_msg_malloc;
+       }
+
+       /* register persist message buffer */
+       ret = fi_mr_reg(fip->domain, fip->pmsg, msg_size, FI_RECV,
+                       0, 0, 0, &fip->pmsg_mr, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "registering messages buffer");
+               goto err_mr_reg_msg;
+       }
+
+       /* get persist message buffer's local descriptor */
+       fip->pmsg_mr_desc = fi_mr_desc(fip->pmsg_mr);
+
+       /* allocate persist response message buffer */
+       size_t msg_resp_size = fip->nlanes *
+               sizeof(struct rpmem_msg_persist_resp);
+       fip->pres = malloc(msg_resp_size);
+       if (!fip->pres) {
+               RPMEMD_FI_ERR(ret, "allocating messages response buffer");
+               goto err_msg_resp_malloc;
+       }
+
+       /* register persist response message buffer */
+       ret = fi_mr_reg(fip->domain, fip->pres, msg_resp_size, FI_SEND,
+                       0, 0, 0, &fip->pres_mr, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "registering messages "
+                               "response buffer");
+               goto err_mr_reg_msg_resp;
+       }
+
+       /* get persist message buffer's local descriptor */
+       fip->pres_mr_desc = fi_mr_desc(fip->pres_mr);
+
+       /* initialize lanes */
+       unsigned i;
+       for (i = 0; i < fip->nlanes; i++) {
+               struct rpmemd_fip_lane *lanep = &fip->lanes[i];
+
+               /* initialize RECV message */
+               rpmem_fip_msg_init(&lanep->recv,
+                               fip->pmsg_mr_desc, 0,
+                               lanep,
+                               rpmemd_fip_get_pmsg(fip, i),
+                               fip->pmsg_size,
+                               FI_COMPLETION);
+
+               /* initialize SEND message */
+               rpmem_fip_msg_init(&lanep->send,
+                               fip->pres_mr_desc, 0,
+                               lanep,
+                               &fip->pres[i],
+                               sizeof(fip->pres[i]),
+                               FI_COMPLETION);
+       }
+
+       return 0;
+err_mr_reg_msg_resp:
+       free(fip->pres);
+err_msg_resp_malloc:
+       RPMEMD_FI_CLOSE(fip->pmsg_mr,
+                       "unregistering messages buffer");
+err_mr_reg_msg:
+       free(fip->pmsg);
+err_msg_malloc:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_fini_common -- deinitialize common resources and return last
+ * error code
+ */
+static int
+rpmemd_fip_fini_common(struct rpmemd_fip *fip)
+{
+       int lret = 0;
+       int ret;
+
+       ret = RPMEMD_FI_CLOSE(fip->pmsg_mr,
+                       "unregistering messages buffer");
+       if (ret)
+               lret = ret;
+
+       ret = RPMEMD_FI_CLOSE(fip->pres_mr,
+                       "unregistering messages response buffer");
+       if (ret)
+               lret = ret;
+
+       free(fip->pmsg);
+       free(fip->pres);
+
+       return lret;
+}
+
+/*
+ * rpmemd_fip_check_pmsg -- verify persist message
+ */
+static inline int
+rpmemd_fip_check_pmsg(struct rpmemd_fip *fip, struct rpmem_msg_persist *pmsg)
+{
+       if (pmsg->lane >= fip->nlanes) {
+               RPMEMD_LOG(ERR, "invalid lane number -- %u", pmsg->lane);
+               return -1;
+       }
+
+       uintptr_t raddr = pmsg->addr;
+       uintptr_t laddr = (uintptr_t)fip->addr;
+
+       if (raddr < laddr || raddr + pmsg->size > laddr + fip->size) {
+               RPMEMD_LOG(ERR, "invalid address or size requested "
+                       "for persist operation (0x%lx, %lu)",
+                       raddr, pmsg->size);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_fip_process_send -- process FI_SEND completion
+ */
+static int
+rpmemd_fip_process_send(struct rpmemd_fip *fip, struct rpmemd_fip_lane *lanep)
+{
+       lanep->send_posted = 0;
+
+       if (lanep->recv_posted)
+               return 0;
+
+       struct rpmem_msg_persist_resp *pres =
+               rpmem_fip_msg_get_pres(&lanep->send);
+
+       *pres = lanep->resp;
+
+       int ret;
+
+       /* post lane's RECV buffer */
+       ret = rpmemd_fip_post_msg(lanep);
+       if (unlikely(ret))
+               goto err;
+
+       /* post lane's SEND buffer */
+       ret = rpmemd_fip_post_resp(lanep);
+err:
+       return ret;
+}
+
+/*
+ * rpmemd_fip_process_recv -- process FI_RECV completion
+ */
+static int
+rpmemd_fip_process_recv(struct rpmemd_fip *fip, struct rpmemd_fip_lane *lanep)
+{
+       int ret = 0;
+
+       lanep->recv_posted = 0;
+
+       /*
+        * Get persist message and persist message response from appropriate
+        * buffers. The persist message is in lane's RECV buffer and the
+        * persist response message in lane's SEND buffer.
+        */
+       struct rpmem_msg_persist *pmsg = rpmem_fip_msg_get_pmsg(&lanep->recv);
+       VALGRIND_DO_MAKE_MEM_DEFINED(pmsg, sizeof(*pmsg));
+
+       /* verify persist message */
+       ret = rpmemd_fip_check_pmsg(fip, pmsg);
+       if (unlikely(ret))
+               goto err;
+       unsigned mode = pmsg->flags & RPMEM_FLUSH_PERSIST_MASK;
+
+       if (mode == RPMEM_DEEP_PERSIST) {
+               fip->deep_persist((void *)pmsg->addr, pmsg->size, fip->ctx);
+       } else if (mode == RPMEM_PERSIST_SEND) {
+               fip->memcpy_persist((void *)pmsg->addr, pmsg->data, pmsg->size);
+       } else {
+               fip->persist((void *)pmsg->addr, pmsg->size);
+       }
+
+       struct rpmem_msg_persist_resp *pres = lanep->send_posted ?
+               &lanep->resp : rpmem_fip_msg_get_pres(&lanep->send);
+
+       /* return back the lane id */
+       pres->lane = pmsg->lane;
+
+       if (!lanep->send_posted) {
+               /* post lane's RECV buffer */
+               ret = rpmemd_fip_post_msg(lanep);
+               if (unlikely(ret))
+                       goto err;
+
+               /* post lane's SEND buffer */
+               ret = rpmemd_fip_post_resp(lanep);
+       }
+
+err:
+       return ret;
+}
+
+/*
+ * rpmemd_fip_cq_read -- wait for specific events on completion queue
+ */
+static int
+rpmemd_fip_cq_read(struct rpmemd_fip *fip, struct fid_cq *cq,
+       struct rpmemd_fip_lane **lanep, uint64_t *event, uint64_t event_mask)
+{
+       struct fi_cq_err_entry err;
+       struct fi_cq_msg_entry cq_entry;
+       const char *str_err;
+       ssize_t sret;
+       int ret;
+
+       while (!fip->closing) {
+               sret = fi_cq_sread(cq, &cq_entry, 1, NULL,
+                               RPMEM_FIP_CQ_WAIT_MS);
+
+               if (unlikely(fip->closing))
+                       break;
+
+               if (unlikely(sret == -FI_EAGAIN || sret == 0))
+                       continue;
+
+               if (unlikely(sret < 0)) {
+                       ret = (int)sret;
+                       goto err_cq_read;
+               }
+
+               if (!(cq_entry.flags & event_mask)) {
+                       RPMEMD_LOG(ERR, "unexpected event received %lx",
+                                       cq_entry.flags);
+                       ret = -1;
+                       goto err;
+               }
+
+               if (!cq_entry.op_context) {
+                       RPMEMD_LOG(ERR, "null context received");
+                       ret = -1;
+                       goto err;
+               }
+
+               *event = cq_entry.flags & event_mask;
+               *lanep = cq_entry.op_context;
+
+               return 0;
+       }
+
+       return 0;
+err_cq_read:
+       sret = fi_cq_readerr(cq, &err, 0);
+       if (sret < 0) {
+               RPMEMD_FI_ERR((int)sret, "error reading from completion queue: "
+                       "cannot read error from completion queue");
+               goto err;
+       }
+
+       str_err = fi_cq_strerror(cq, err.prov_errno, NULL, NULL, 0);
+       RPMEMD_LOG(ERR, "error reading from completion queue: %s", str_err);
+err:
+       return ret;
+}
+
+/*
+ * rpmemd_fip_thread -- thread callback which processes persist
+ * operation
+ */
+static void *
+rpmemd_fip_thread(void *arg)
+{
+       struct rpmemd_fip_thread *thread = arg;
+       struct rpmemd_fip *fip = thread->fip;
+       struct rpmemd_fip_lane *lanep = NULL;
+       uint64_t event = 0;
+       int ret = 0;
+
+       while (!fip->closing) {
+               ret = rpmemd_fip_cq_read(fip, thread->cq, &lanep, &event,
+                       FI_SEND|FI_RECV);
+               if (ret)
+                       goto err;
+
+               if (unlikely(fip->closing))
+                       break;
+
+               RPMEMD_ASSERT(lanep != NULL);
+               if (event & FI_RECV)
+                       ret = rpmemd_fip_process_recv(fip, lanep);
+               else if (event & FI_SEND)
+                       ret = rpmemd_fip_process_send(fip, lanep);
+               if (ret)
+                       goto err;
+       }
+
+       return 0;
+err:
+       return (void *)(uintptr_t)ret;
+}
+
+/*
+ * rpmemd_fip_get_def_nthreads -- get default number of threads for given
+ * persistency method
+ */
+static size_t
+rpmemd_fip_get_def_nthreads(struct rpmemd_fip *fip)
+{
+       RPMEMD_ASSERT(fip->nlanes > 0);
+       switch (fip->persist_method) {
+       case RPMEM_PM_APM:
+       case RPMEM_PM_GPSPM:
+               return fip->nlanes;
+       default:
+               RPMEMD_ASSERT(0);
+               return 0;
+       }
+}
+
+/*
+ * rpmemd_fip_set_attr -- save required attributes in rpmemd_fip handle
+ */
+static void
+rpmemd_fip_set_attr(struct rpmemd_fip *fip, struct rpmemd_fip_attr *attr)
+{
+       fip->addr = attr->addr;
+       fip->size = attr->size;
+       fip->persist_method = attr->persist_method;
+       fip->persist = attr->persist;
+       fip->memcpy_persist = attr->memcpy_persist;
+       fip->deep_persist = attr->deep_persist;
+       fip->ctx = attr->ctx;
+       fip->buff_size = attr->buff_size;
+       fip->pmsg_size = roundup(sizeof(struct rpmem_msg_persist) +
+                       fip->buff_size, (size_t)64);
+
+       size_t max_nlanes = rpmem_fip_max_nlanes(fip->fi);
+       RPMEMD_ASSERT(max_nlanes < UINT_MAX);
+       fip->nlanes = min((unsigned)max_nlanes, attr->nlanes);
+
+       if (attr->nthreads) {
+               fip->nthreads = attr->nthreads;
+       } else {
+               /* use default */
+               fip->nthreads = rpmemd_fip_get_def_nthreads(fip);
+       }
+
+       fip->lanes_per_thread = (fip->nlanes - 1) / fip->nthreads + 1;
+       size_t cq_size_per_lane = rpmem_fip_cq_size(fip->persist_method,
+                       RPMEM_FIP_NODE_SERVER);
+
+       fip->cq_size = fip->lanes_per_thread * cq_size_per_lane;
+
+       RPMEMD_ASSERT(fip->persist_method < MAX_RPMEM_PM);
+}
+
+/*
+ * rpmemd_fip_init_thread -- init worker thread
+ */
+static int
+rpmemd_fip_init_thread(struct rpmemd_fip *fip, struct rpmemd_fip_thread *thread)
+{
+       thread->fip = fip;
+       thread->lanes = malloc(fip->lanes_per_thread * sizeof(*thread->lanes));
+       if (!thread->lanes) {
+               RPMEMD_LOG(ERR, "!allocating thread lanes");
+               goto err_alloc_lanes;
+       }
+
+       struct fi_cq_attr cq_attr = {
+               .size = fip->cq_size,
+               .flags = 0,
+               .format = FI_CQ_FORMAT_MSG, /* need context and flags */
+               .wait_obj = FI_WAIT_UNSPEC,
+               .signaling_vector = 0,
+               .wait_cond = FI_CQ_COND_NONE,
+               .wait_set = NULL,
+       };
+
+       int ret = fi_cq_open(fip->domain, &cq_attr, &thread->cq, NULL);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "opening completion queue");
+               goto err_cq_open;
+       }
+
+       return 0;
+err_cq_open:
+       free(thread->lanes);
+err_alloc_lanes:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_fini_thread -- deinitialize worker thread
+ */
+static void
+rpmemd_fip_fini_thread(struct rpmemd_fip *fip, struct rpmemd_fip_thread *thread)
+{
+       RPMEMD_FI_CLOSE(thread->cq, "closing completion queue");
+       free(thread->lanes);
+}
+
+/*
+ * rpmemd_fip_init_threads -- initialize worker threads
+ */
+static int
+rpmemd_fip_init_threads(struct rpmemd_fip *fip)
+{
+       RPMEMD_ASSERT(fip->lanes != NULL);
+       RPMEMD_ASSERT(fip->nthreads > 0);
+
+       fip->threads = calloc(fip->nthreads, sizeof(*fip->threads));
+       if (!fip->threads) {
+               RPMEMD_LOG(ERR, "!allocating threads");
+               goto err_alloc_threads;
+       }
+
+       int ret;
+       size_t i;
+       for (i = 0; i < fip->nthreads; i++) {
+               ret = rpmemd_fip_init_thread(fip, &fip->threads[i]);
+               if (ret) {
+                       RPMEMD_LOG(ERR, "!initializing thread %zu", i);
+                       goto err_init_thread;
+               }
+       }
+
+       for (size_t i = 0; i < fip->nlanes; i++) {
+               size_t w = i % fip->nthreads;
+               struct rpmemd_fip_thread *thread = &fip->threads[w];
+               fip->lanes[i].base.cq = thread->cq;
+               thread->lanes[thread->nlanes++] = &fip->lanes[i];
+       }
+
+       return 0;
+err_init_thread:
+       for (size_t j = 0; j < i; j++)
+               rpmemd_fip_fini_thread(fip, &fip->threads[j]);
+       free(fip->threads);
+err_alloc_threads:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_fini_threads -- deinitialize worker threads
+ */
+static void
+rpmemd_fip_fini_threads(struct rpmemd_fip *fip)
+{
+       for (size_t i = 0; i < fip->nthreads; i++)
+               rpmemd_fip_fini_thread(fip, &fip->threads[i]);
+       free(fip->threads);
+}
+
+/*
+ * rpmemd_fip_init -- initialize fabric provider
+ */
+struct rpmemd_fip *
+rpmemd_fip_init(const char *node, const char *service,
+       struct rpmemd_fip_attr *attr, struct rpmem_resp_attr *resp,
+       enum rpmem_err *err)
+{
+       int ret;
+
+       RPMEMD_ASSERT(resp);
+       RPMEMD_ASSERT(err);
+       RPMEMD_ASSERT(attr);
+       RPMEMD_ASSERT(attr->persist);
+
+       struct rpmemd_fip *fip = calloc(1, sizeof(*fip));
+       if (!fip) {
+               RPMEMD_LOG(ERR, "!allocating fabric handle");
+               *err = RPMEM_ERR_FATAL;
+               return NULL;
+       }
+
+       ret = rpmemd_fip_getinfo(fip, service, node, attr->provider);
+       if (ret) {
+               *err = RPMEM_ERR_BADPROVIDER;
+               goto err_getinfo;
+       }
+
+       rpmemd_fip_set_attr(fip, attr);
+
+       ret = rpmemd_fip_init_fabric_res(fip);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_init_fabric_res;
+       }
+
+       ret = rpmemd_fip_init_memory(fip);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_init_memory;
+       }
+
+       ret = rpmemd_fip_lanes_init(fip);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_init_lanes;
+       }
+
+       ret = rpmemd_fip_init_threads(fip);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_init_threads;
+       }
+
+       ret = rpmemd_fip_init_common(fip);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_init;
+       }
+
+       ret = fi_listen(fip->pep);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL_CONN;
+               goto err_fi_listen;
+       }
+
+       ret = rpmemd_fip_set_resp(fip, resp);
+       if (ret) {
+               *err = RPMEM_ERR_FATAL;
+               goto err_set_resp;
+       }
+
+       return fip;
+err_set_resp:
+       RPMEMD_FI_CLOSE(fip->pep, "closing passive endpoint");
+err_fi_listen:
+       rpmemd_fip_fini_common(fip);
+err_init:
+       rpmemd_fip_fini_threads(fip);
+err_init_threads:
+       rpmemd_fip_fini_lanes(fip);
+err_init_lanes:
+       rpmemd_fip_fini_memory(fip);
+err_init_memory:
+       rpmemd_fip_fini_fabric_res(fip);
+err_init_fabric_res:
+       fi_freeinfo(fip->fi);
+err_getinfo:
+       free(fip);
+       return NULL;
+}
+
+/*
+ * rpmemd_fip_fini -- deinitialize fabric provider
+ */
+void
+rpmemd_fip_fini(struct rpmemd_fip *fip)
+{
+       rpmemd_fip_fini_common(fip);
+       rpmemd_fip_fini_threads(fip);
+       rpmemd_fip_fini_lanes(fip);
+       rpmemd_fip_fini_memory(fip);
+       rpmemd_fip_fini_fabric_res(fip);
+       fi_freeinfo(fip->fi);
+       free(fip);
+}
+
+/*
+ * rpmemd_fip_accept_one -- accept a single connection
+ */
+static int
+rpmemd_fip_accept_one(struct rpmemd_fip *fip,
+       struct fi_info *info, struct rpmemd_fip_lane *lanep)
+{
+       int ret;
+
+       ret = rpmemd_fip_init_ep(fip, info, &lanep->base);
+       if (ret)
+               goto err_init_ep;
+
+       ret = rpmemd_fip_post_common(fip, lanep);
+       if (ret)
+               goto err_post;
+
+       ret = fi_accept(lanep->base.ep, NULL, 0);
+       if (ret) {
+               RPMEMD_FI_ERR(ret, "accepting connection request");
+               goto err_accept;
+       }
+
+       fi_freeinfo(info);
+
+       return 0;
+err_accept:
+err_post:
+       rpmemd_fip_fini_ep(&lanep->base);
+err_init_ep:
+       fi_freeinfo(info);
+       return -1;
+}
+
+/*
+ * rpmemd_fip_accept -- accept a single connection request
+ */
+int
+rpmemd_fip_accept(struct rpmemd_fip *fip, int timeout)
+{
+       int ret;
+       struct fi_eq_cm_entry entry;
+       uint32_t event;
+       unsigned nreq = 0; /* number of connection requests */
+       unsigned ncon = 0; /* number of connected endpoints */
+       int connecting = 1;
+
+       while (connecting && (nreq < fip->nlanes || ncon < fip->nlanes)) {
+               ret = rpmem_fip_read_eq(fip->eq, &entry,
+                               &event, timeout);
+               if (ret)
+                       goto err_read_eq;
+
+               switch (event) {
+               case FI_CONNREQ:
+                       ret = rpmemd_fip_accept_one(fip, entry.info,
+                                       &fip->lanes[nreq]);
+                       if (ret)
+                               goto err_accept_one;
+                       nreq++;
+                       break;
+               case FI_CONNECTED:
+                       ncon++;
+                       break;
+               case FI_SHUTDOWN:
+                       connecting = 0;
+                       break;
+               default:
+                       RPMEMD_ERR("unexpected event received (%u)", event);
+                       goto err_read_eq;
+
+               }
+       }
+
+       return 0;
+err_accept_one:
+err_read_eq:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_wait_close -- wait specified time for connection closed event
+ */
+int
+rpmemd_fip_wait_close(struct rpmemd_fip *fip, int timeout)
+{
+       struct fi_eq_cm_entry entry;
+       int lret = 0;
+       uint32_t event;
+       int ret;
+
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               ret = rpmem_fip_read_eq(fip->eq, &entry, &event, timeout);
+               if (ret)
+                       lret = ret;
+               if (event != FI_SHUTDOWN) {
+                       RPMEMD_ERR("unexpected event received "
+                               "(is %u expected %u)",
+                               event, FI_SHUTDOWN);
+                       errno = EINVAL;
+                       lret = -1;
+               }
+       }
+
+       return lret;
+}
+
+/*
+ * rpmemd_fip_close -- close the connection
+ */
+int
+rpmemd_fip_close(struct rpmemd_fip *fip)
+{
+       int lret = 0;
+       int ret;
+
+       for (unsigned i = 0; i < fip->nlanes; i++) {
+               ret = rpmemd_fip_fini_ep(&fip->lanes[i].base);
+               if (ret)
+                       lret = ret;
+       }
+
+       return lret;
+}
+
+/*
+ * rpmemd_fip_process_start -- start processing
+ */
+int
+rpmemd_fip_process_start(struct rpmemd_fip *fip)
+{
+       unsigned i;
+       for (i = 0; i < fip->nthreads; i++) {
+               errno = os_thread_create(&fip->threads[i].thread, NULL,
+                               rpmemd_fip_thread, &fip->threads[i]);
+               if (errno) {
+                       RPMEMD_ERR("!running thread thread");
+                       goto err_thread_create;
+               }
+       }
+
+       return 0;
+err_thread_create:
+       return -1;
+}
+
+/*
+ * rpmemd_fip_process_stop -- stop processing
+ */
+int
+rpmemd_fip_process_stop(struct rpmemd_fip *fip)
+{
+       /* this stops all threads */
+       util_fetch_and_or32(&fip->closing, 1);
+       int ret;
+       int lret = 0;
+
+       for (size_t i = 0; i < fip->nthreads; i++) {
+               struct rpmemd_fip_thread *thread = &fip->threads[i];
+               ret = fi_cq_signal(thread->cq);
+               if (ret) {
+                       RPMEMD_FI_ERR(ret, "sending signal to CQ");
+                       lret = ret;
+               }
+               void *tret;
+               errno = os_thread_join(&thread->thread, &tret);
+               if (errno) {
+                       RPMEMD_LOG(ERR, "!joining cq thread");
+                       lret = -1;
+               } else {
+                       ret = (int)(uintptr_t)tret;
+                       if (ret) {
+                               RPMEMD_LOG(ERR,
+                                       "cq thread failed with code -- %d",
+                                       ret);
+                               lret = ret;
+                       }
+               }
+       }
+
+       return lret;
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_fip.h
new file mode 100644 (file)
index 0000000..ba45204
--- /dev/null
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_fip.h -- rpmemd libfabric provider module header file
+ */
+
+#include <stddef.h>
+
+struct rpmemd_fip;
+
+struct rpmemd_fip_attr {
+       void *addr;
+       size_t size;
+       unsigned nlanes;
+       size_t nthreads;
+       size_t buff_size;
+       enum rpmem_provider provider;
+       enum rpmem_persist_method persist_method;
+       int (*persist)(const void *addr, size_t len);
+       void *(*memcpy_persist)(void *pmemdest, const void *src, size_t len);
+       int (*deep_persist)(const void *addr, size_t len, void *ctx);
+       void *ctx;
+};
+
+struct rpmemd_fip *rpmemd_fip_init(const char *node,
+               const char *service,
+               struct rpmemd_fip_attr *attr,
+               struct rpmem_resp_attr *resp,
+               enum rpmem_err *err);
+void rpmemd_fip_fini(struct rpmemd_fip *fip);
+
+int rpmemd_fip_accept(struct rpmemd_fip *fip, int timeout);
+int rpmemd_fip_process_start(struct rpmemd_fip *fip);
+int rpmemd_fip_process_stop(struct rpmemd_fip *fip);
+int rpmemd_fip_wait_close(struct rpmemd_fip *fip, int timeout);
+int rpmemd_fip_close(struct rpmemd_fip *fip);
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.c
new file mode 100644 (file)
index 0000000..75330c8
--- /dev/null
@@ -0,0 +1,250 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_log.c -- rpmemd logging functions definitions
+ */
+#include <errno.h>
+#include <stdio.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#include "rpmemd_log.h"
+#include "os.h"
+#include "valgrind_internal.h"
+
+#define RPMEMD_SYSLOG_OPTS     (LOG_NDELAY | LOG_PID)
+#define RPMEMD_SYSLOG_FACILITY (LOG_USER)
+#define RPMEMD_DEFAULT_FH      stderr
+#define RPMEMD_MAX_MSG         ((size_t)8192)
+#define RPMEMD_MAX_PREFIX      ((size_t)256)
+
+enum rpmemd_log_level rpmemd_log_level;
+static char *rpmemd_ident;
+static int rpmemd_use_syslog;
+static FILE *rpmemd_log_file;
+static char rpmemd_prefix_buff[RPMEMD_MAX_PREFIX];
+
+static const char *rpmemd_log_level_str[MAX_RPD_LOG] = {
+       [RPD_LOG_ERR]           = "err",
+       [RPD_LOG_WARN]          = "warn",
+       [RPD_LOG_NOTICE]        = "notice",
+       [RPD_LOG_INFO]          = "info",
+       [_RPD_LOG_DBG]          = "debug",
+};
+
+static int rpmemd_level2prio[MAX_RPD_LOG] = {
+       [RPD_LOG_ERR]           = LOG_ERR,
+       [RPD_LOG_WARN]          = LOG_WARNING,
+       [RPD_LOG_NOTICE]        = LOG_NOTICE,
+       [RPD_LOG_INFO]          = LOG_INFO,
+       [_RPD_LOG_DBG]          = LOG_DEBUG,
+};
+
+/*
+ * rpmemd_log_basename -- similar to POSIX basename, but without handling for
+ * trailing slashes.
+ */
+static const char *
+rpmemd_log_basename(const char *fname)
+{
+       const char *s;
+
+       if (fname == NULL)
+               return "(null)";
+       s = strrchr(fname, '/');
+       if (s != NULL)
+               return s + 1;
+       else
+               return fname;
+}
+
+/*
+ * rpmemd_log_level_from_str -- converts string to log level value
+ */
+enum rpmemd_log_level
+rpmemd_log_level_from_str(const char *str)
+{
+       if (!str)
+               return MAX_RPD_LOG;
+
+       for (enum rpmemd_log_level level = 0; level < MAX_RPD_LOG; level++) {
+               if (strcmp(rpmemd_log_level_str[level], str) == 0)
+                       return level;
+       }
+
+       return MAX_RPD_LOG;
+}
+
+/*
+ * rpmemd_log_level_to_str -- converts log level enum to string
+ */
+const char *
+rpmemd_log_level_to_str(enum rpmemd_log_level level)
+{
+       if (level >= MAX_RPD_LOG)
+               return NULL;
+       return rpmemd_log_level_str[level];
+}
+
+/*
+ * rpmemd_log_init -- inititalize logging subsystem
+ *
+ * ident      - string prepended to every message
+ * use_syslog - use syslog instead of standard output
+ */
+int
+rpmemd_log_init(const char *ident, const char *fname, int use_syslog)
+{
+       rpmemd_use_syslog = use_syslog;
+
+       if (rpmemd_use_syslog) {
+               openlog(rpmemd_ident, RPMEMD_SYSLOG_OPTS,
+                               RPMEMD_SYSLOG_FACILITY);
+       } else {
+               rpmemd_ident = strdup(ident);
+               if (!rpmemd_ident) {
+                       perror("strdup");
+                       return -1;
+               }
+
+               if (fname) {
+                       rpmemd_log_file = os_fopen(fname, "a");
+                       if (!rpmemd_log_file) {
+                               perror(fname);
+                               free(rpmemd_ident);
+                               rpmemd_ident = NULL;
+                               return -1;
+                       }
+               } else {
+                       rpmemd_log_file = RPMEMD_DEFAULT_FH;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_log_close -- deinitialize logging subsystem
+ */
+void
+rpmemd_log_close(void)
+{
+       if (rpmemd_use_syslog) {
+               closelog();
+       } else {
+               if (rpmemd_log_file != RPMEMD_DEFAULT_FH)
+                       fclose(rpmemd_log_file);
+               rpmemd_log_file = NULL;
+
+               free(rpmemd_ident);
+               rpmemd_ident = NULL;
+       }
+}
+
+/*
+ * rpmemd_prefix -- set prefix for every message
+ */
+int
+rpmemd_prefix(const char *fmt, ...)
+{
+       if (!fmt) {
+               rpmemd_prefix_buff[0] = '\0';
+               return 0;
+       }
+
+       va_list ap;
+       va_start(ap, fmt);
+       int ret = vsnprintf(rpmemd_prefix_buff, RPMEMD_MAX_PREFIX,
+                       fmt, ap);
+       va_end(ap);
+       if (ret < 0)
+               return -1;
+
+       return 0;
+}
+
+/*
+ * rpmemd_log -- main logging function
+ */
+void
+rpmemd_log(enum rpmemd_log_level level, const char *fname, int lineno,
+       const char *fmt, ...)
+{
+       if (!rpmemd_use_syslog && level > rpmemd_log_level)
+               return;
+
+       char buff[RPMEMD_MAX_MSG];
+
+       size_t cnt = 0;
+       int ret;
+       if (fname) {
+               ret = util_snprintf(&buff[cnt], RPMEMD_MAX_MSG - cnt,
+                               "[%s:%d] ", rpmemd_log_basename(fname), lineno);
+               if (ret < 0)
+                       RPMEMD_FATAL("snprintf failed: %d", errno);
+
+               cnt += (size_t)ret;
+       }
+       if (rpmemd_prefix_buff[0]) {
+               ret = util_snprintf(&buff[cnt], RPMEMD_MAX_MSG - cnt,
+                               "%s ", rpmemd_prefix_buff);
+               if (ret < 0)
+                       RPMEMD_FATAL("snprintf failed: %d", errno);
+
+               cnt += (size_t)ret;
+       }
+
+       const char *errorstr = "";
+       const char *prefix = "";
+       const char *suffix = "\n";
+       if (fmt) {
+               if (*fmt == '!') {
+                       fmt++;
+                       errorstr = strerror(errno);
+                       prefix = ": ";
+               }
+
+               va_list ap;
+               va_start(ap, fmt);
+               ret = vsnprintf(&buff[cnt], RPMEMD_MAX_MSG - cnt, fmt, ap);
+               va_end(ap);
+
+               if (ret < 0)
+                       RPMEMD_FATAL("vsnprintf failed");
+               if ((unsigned)ret >= RPMEMD_MAX_MSG - cnt)
+                       RPMEMD_FATAL("overflow(3): %d >= %lu", ret,
+                                       RPMEMD_MAX_MSG - cnt);
+
+               cnt += (size_t)ret;
+
+               ret = util_snprintf(&buff[cnt], RPMEMD_MAX_MSG - cnt,
+                               "%s%s%s", prefix, errorstr, suffix);
+               if (ret < 0)
+                       RPMEMD_FATAL("snprintf failed: %d", errno);
+
+               cnt += (size_t)ret;
+       }
+       buff[cnt] = 0;
+
+       if (rpmemd_use_syslog) {
+               int prio = rpmemd_level2prio[level];
+               syslog(prio, "%s", buff);
+       } else {
+               /* to suppress drd false-positive */
+               /* XXX: confirm real nature of this issue: pmem/issues#863 */
+#ifdef SUPPRESS_FPUTS_DRD_ERROR
+               VALGRIND_ANNOTATE_IGNORE_READS_BEGIN();
+               VALGRIND_ANNOTATE_IGNORE_WRITES_BEGIN();
+#endif
+               fprintf(rpmemd_log_file, "%s", buff);
+               fflush(rpmemd_log_file);
+#ifdef SUPPRESS_FPUTS_DRD_ERROR
+               VALGRIND_ANNOTATE_IGNORE_READS_END();
+               VALGRIND_ANNOTATE_IGNORE_WRITES_END();
+#endif
+       }
+
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_log.h
new file mode 100644 (file)
index 0000000..d989567
--- /dev/null
@@ -0,0 +1,75 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_log.h -- rpmemd logging functions declarations
+ */
+
+#include <string.h>
+#include "util.h"
+
+#define FORMAT_PRINTF(a, b) __attribute__((__format__(__printf__, (a), (b))))
+
+/*
+ * The tab character is not allowed in rpmemd log,
+ * because it is not well handled by syslog.
+ * Please use RPMEMD_LOG_INDENT instead.
+ */
+#define RPMEMD_LOG_INDENT "    "
+
+#ifdef DEBUG
+#define RPMEMD_LOG(level, fmt, arg...) do {\
+       COMPILE_ERROR_ON(strchr(fmt, '\t') != 0);\
+       rpmemd_log(RPD_LOG_##level, __FILE__, __LINE__, fmt, ## arg);\
+} while (0)
+#else
+#define RPMEMD_LOG(level, fmt, arg...) do {\
+       COMPILE_ERROR_ON(strchr(fmt, '\t') != 0);\
+       rpmemd_log(RPD_LOG_##level, NULL, 0, fmt, ## arg);\
+} while (0)
+#endif
+
+#ifdef DEBUG
+#define RPMEMD_DBG(fmt, arg...) do {\
+       COMPILE_ERROR_ON(strchr(fmt, '\t') != 0);\
+       rpmemd_log(_RPD_LOG_DBG, __FILE__, __LINE__, fmt, ## arg);\
+} while (0)
+#else
+#define RPMEMD_DBG(fmt, arg...) do {} while (0)
+#endif
+
+#define RPMEMD_ERR(fmt, arg...) do {\
+       RPMEMD_LOG(ERR, fmt, ## arg);\
+} while (0)
+
+#define RPMEMD_FATAL(fmt, arg...) do {\
+       RPMEMD_LOG(ERR, fmt, ## arg);\
+       abort();\
+} while (0)
+
+#define RPMEMD_ASSERT(cond) do {\
+       if (!(cond)) {\
+               rpmemd_log(RPD_LOG_ERR, __FILE__, __LINE__,\
+                       "assertion fault: %s", #cond);\
+               abort();\
+       }\
+} while (0)
+
+enum rpmemd_log_level {
+       RPD_LOG_ERR,
+       RPD_LOG_WARN,
+       RPD_LOG_NOTICE,
+       RPD_LOG_INFO,
+       _RPD_LOG_DBG,   /* disallow to use this with LOG macro */
+       MAX_RPD_LOG,
+};
+
+enum rpmemd_log_level rpmemd_log_level_from_str(const char *str);
+const char *rpmemd_log_level_to_str(enum rpmemd_log_level level);
+
+extern enum rpmemd_log_level rpmemd_log_level;
+int rpmemd_log_init(const char *ident, const char *fname, int use_syslog);
+void rpmemd_log_close(void);
+int rpmemd_prefix(const char *fmt, ...) FORMAT_PRINTF(1, 2);
+void rpmemd_log(enum rpmemd_log_level level, const char *fname,
+               int lineno, const char *fmt, ...) FORMAT_PRINTF(4, 5);
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.c
new file mode 100644 (file)
index 0000000..a505767
--- /dev/null
@@ -0,0 +1,548 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2016-2019, Intel Corporation */
+
+/*
+ * rpmemd_obc.c -- rpmemd out-of-band connection definitions
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <stdint.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#include <netdb.h>
+
+#include "librpmem.h"
+#include "rpmemd_log.h"
+#include "rpmem_proto.h"
+#include "rpmem_common.h"
+#include "rpmemd_obc.h"
+
+struct rpmemd_obc {
+       int fd_in;
+       int fd_out;
+};
+
+/*
+ * rpmemd_obc_check_proto_ver -- check protocol version
+ */
+static int
+rpmemd_obc_check_proto_ver(unsigned major, unsigned minor)
+{
+       if (major != RPMEM_PROTO_MAJOR ||
+           minor != RPMEM_PROTO_MINOR) {
+               RPMEMD_LOG(ERR, "unsupported protocol version -- %u.%u",
+                               major, minor);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_check_msg_hdr -- check message header
+ */
+static int
+rpmemd_obc_check_msg_hdr(struct rpmem_msg_hdr *hdrp)
+{
+       switch (hdrp->type) {
+       case RPMEM_MSG_TYPE_OPEN:
+       case RPMEM_MSG_TYPE_CREATE:
+       case RPMEM_MSG_TYPE_CLOSE:
+       case RPMEM_MSG_TYPE_SET_ATTR:
+               /* all messages from obc to server are fine */
+               break;
+       default:
+               RPMEMD_LOG(ERR, "invalid message type -- %u", hdrp->type);
+               return -1;
+       }
+
+       if (hdrp->size < sizeof(struct rpmem_msg_hdr)) {
+               RPMEMD_LOG(ERR, "invalid message size -- %lu", hdrp->size);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_check_pool_desc -- check pool descriptor
+ */
+static int
+rpmemd_obc_check_pool_desc(struct rpmem_msg_hdr *hdrp, size_t msg_size,
+       struct rpmem_msg_pool_desc *pool_desc)
+{
+       size_t body_size = msg_size + pool_desc->size;
+       if (hdrp->size != body_size) {
+               RPMEMD_LOG(ERR, "message and pool descriptor size mismatch "
+                       "-- is %lu should be %lu", hdrp->size, body_size);
+               return -1;
+       }
+
+       if (pool_desc->size < 2) {
+               RPMEMD_LOG(ERR, "invalid pool descriptor size -- %u "
+                               "(must be >= 2)", pool_desc->size);
+               return -1;
+       }
+
+       if (pool_desc->desc[pool_desc->size - 1] != '\0') {
+               RPMEMD_LOG(ERR, "invalid pool descriptor "
+                       "(must be null-terminated string)");
+               return -1;
+       }
+
+       size_t len = strlen((char *)pool_desc->desc) + 1;
+
+       if (pool_desc->size != len) {
+               RPMEMD_LOG(ERR, "invalid pool descriptor size -- is %lu "
+                               "should be %u", len, pool_desc->size);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_check_provider -- check provider value
+ */
+static int
+rpmemd_obc_check_provider(uint32_t provider)
+{
+       if (provider == 0 || provider >= MAX_RPMEM_PROV) {
+               RPMEMD_LOG(ERR, "invalid provider -- %u", provider);
+               return -1;
+       }
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_ntoh_check_msg_create -- convert and check create request message
+ */
+static int
+rpmemd_obc_ntoh_check_msg_create(struct rpmem_msg_hdr *hdrp)
+{
+       int ret;
+       struct rpmem_msg_create *msg = (struct rpmem_msg_create *)hdrp;
+
+       rpmem_ntoh_msg_create(msg);
+
+       ret = rpmemd_obc_check_proto_ver(msg->c.major, msg->c.minor);
+       if (ret)
+               return ret;
+
+       ret = rpmemd_obc_check_pool_desc(hdrp, sizeof(*msg), &msg->pool_desc);
+       if (ret)
+               return ret;
+
+       ret = rpmemd_obc_check_provider(msg->c.provider);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_ntoh_check_msg_open -- convert and check open request message
+ */
+static int
+rpmemd_obc_ntoh_check_msg_open(struct rpmem_msg_hdr *hdrp)
+{
+       int ret;
+       struct rpmem_msg_open *msg = (struct rpmem_msg_open *)hdrp;
+
+       rpmem_ntoh_msg_open(msg);
+
+       ret = rpmemd_obc_check_proto_ver(msg->c.major, msg->c.minor);
+       if (ret)
+               return ret;
+
+       ret = rpmemd_obc_check_pool_desc(hdrp, sizeof(*msg), &msg->pool_desc);
+       if (ret)
+               return ret;
+
+       ret = rpmemd_obc_check_provider(msg->c.provider);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+/*
+ * rpmemd_obc_ntoh_check_msg_close -- convert and check close request message
+ */
+static int
+rpmemd_obc_ntoh_check_msg_close(struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_close *msg = (struct rpmem_msg_close *)hdrp;
+
+       rpmem_ntoh_msg_close(msg);
+
+       /* nothing to do */
+       return 0;
+}
+
+/*
+ * rpmemd_obc_ntoh_check_msg_set_attr -- convert and check set attributes
+ * request message
+ */
+static int
+rpmemd_obc_ntoh_check_msg_set_attr(struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_set_attr *msg = (struct rpmem_msg_set_attr *)hdrp;
+
+       rpmem_ntoh_msg_set_attr(msg);
+
+       /* nothing to do */
+       return 0;
+}
+
+typedef int (*rpmemd_obc_ntoh_check_msg_fn)(struct rpmem_msg_hdr *hdrp);
+
+static rpmemd_obc_ntoh_check_msg_fn rpmemd_obc_ntoh_check_msg[] = {
+       [RPMEM_MSG_TYPE_CREATE]         = rpmemd_obc_ntoh_check_msg_create,
+       [RPMEM_MSG_TYPE_OPEN]           = rpmemd_obc_ntoh_check_msg_open,
+       [RPMEM_MSG_TYPE_CLOSE]          = rpmemd_obc_ntoh_check_msg_close,
+       [RPMEM_MSG_TYPE_SET_ATTR]       = rpmemd_obc_ntoh_check_msg_set_attr,
+};
+
+/*
+ * rpmemd_obc_process_create -- process create request
+ */
+static int
+rpmemd_obc_process_create(struct rpmemd_obc *obc,
+       struct rpmemd_obc_requests *req_cb, void *arg,
+       struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_create *msg = (struct rpmem_msg_create *)hdrp;
+       struct rpmem_req_attr req = {
+               .pool_size = msg->c.pool_size,
+               .nlanes = (unsigned)msg->c.nlanes,
+               .pool_desc = (char *)msg->pool_desc.desc,
+               .provider = (enum rpmem_provider)msg->c.provider,
+               .buff_size = msg->c.buff_size,
+       };
+
+       struct rpmem_pool_attr *rattr = NULL;
+       struct rpmem_pool_attr rpmem_attr;
+       unpack_rpmem_pool_attr(&msg->pool_attr, &rpmem_attr);
+       if (!util_is_zeroed(&rpmem_attr, sizeof(rpmem_attr)))
+               rattr = &rpmem_attr;
+
+       return req_cb->create(obc, arg, &req, rattr);
+}
+
+/*
+ * rpmemd_obc_process_open -- process open request
+ */
+static int
+rpmemd_obc_process_open(struct rpmemd_obc *obc,
+       struct rpmemd_obc_requests *req_cb, void *arg,
+       struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_open *msg = (struct rpmem_msg_open *)hdrp;
+       struct rpmem_req_attr req = {
+               .pool_size = msg->c.pool_size,
+               .nlanes = (unsigned)msg->c.nlanes,
+               .pool_desc = (const char *)msg->pool_desc.desc,
+               .provider = (enum rpmem_provider)msg->c.provider,
+               .buff_size = msg->c.buff_size,
+       };
+
+       return req_cb->open(obc, arg, &req);
+}
+
+/*
+ * rpmemd_obc_process_close -- process close request
+ */
+static int
+rpmemd_obc_process_close(struct rpmemd_obc *obc,
+       struct rpmemd_obc_requests *req_cb, void *arg,
+       struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_close *msg = (struct rpmem_msg_close *)hdrp;
+       return req_cb->close(obc, arg, (int)msg->flags);
+}
+
+/*
+ * rpmemd_obc_process_set_attr -- process set attributes request
+ */
+static int
+rpmemd_obc_process_set_attr(struct rpmemd_obc *obc,
+       struct rpmemd_obc_requests *req_cb, void *arg,
+       struct rpmem_msg_hdr *hdrp)
+{
+       struct rpmem_msg_set_attr *msg = (struct rpmem_msg_set_attr *)hdrp;
+       struct rpmem_pool_attr *rattr = NULL;
+       struct rpmem_pool_attr rpmem_attr;
+       unpack_rpmem_pool_attr(&msg->pool_attr, &rpmem_attr);
+       if (!util_is_zeroed(&rpmem_attr, sizeof(rpmem_attr)))
+               rattr = &rpmem_attr;
+
+       return req_cb->set_attr(obc, arg, rattr);
+}
+
+typedef int (*rpmemd_obc_process_fn)(struct rpmemd_obc *obc,
+               struct rpmemd_obc_requests *req_cb, void *arg,
+               struct rpmem_msg_hdr *hdrp);
+
+static rpmemd_obc_process_fn rpmemd_obc_process_cb[] = {
+       [RPMEM_MSG_TYPE_CREATE]         = rpmemd_obc_process_create,
+       [RPMEM_MSG_TYPE_OPEN]           = rpmemd_obc_process_open,
+       [RPMEM_MSG_TYPE_CLOSE]          = rpmemd_obc_process_close,
+       [RPMEM_MSG_TYPE_SET_ATTR]       = rpmemd_obc_process_set_attr,
+};
+
+/*
+ * rpmemd_obc_recv -- wrapper for read and decode data function
+ */
+static inline int
+rpmemd_obc_recv(struct rpmemd_obc *obc, void *buff, size_t len)
+{
+       return rpmem_xread(obc->fd_in, buff, len, 0);
+}
+
+/*
+ * rpmemd_obc_send -- wrapper for encode and write data function
+ */
+static inline int
+rpmemd_obc_send(struct rpmemd_obc *obc, const void *buff, size_t len)
+{
+       return rpmem_xwrite(obc->fd_out, buff, len, 0);
+}
+
+/*
+ * rpmemd_obc_msg_recv -- receive and check request message
+ *
+ * Return values:
+ * 0   - success
+ * < 0 - error
+ * 1   - obc disconnected
+ */
+static int
+rpmemd_obc_msg_recv(struct rpmemd_obc *obc,
+       struct rpmem_msg_hdr **hdrpp)
+{
+       struct rpmem_msg_hdr hdr;
+       struct rpmem_msg_hdr nhdr;
+       struct rpmem_msg_hdr *hdrp;
+       int ret;
+
+       ret = rpmemd_obc_recv(obc, &nhdr, sizeof(nhdr));
+       if (ret == 1) {
+               RPMEMD_LOG(NOTICE, "out-of-band connection disconnected");
+               return 1;
+       }
+
+       if (ret < 0) {
+               RPMEMD_LOG(ERR, "!receiving message header failed");
+               return ret;
+       }
+
+       memcpy(&hdr, &nhdr, sizeof(hdr));
+       rpmem_ntoh_msg_hdr(&hdr);
+
+       ret = rpmemd_obc_check_msg_hdr(&hdr);
+       if (ret) {
+               RPMEMD_LOG(ERR, "parsing message header failed");
+               return ret;
+       }
+
+       hdrp = malloc(hdr.size);
+       if (!hdrp) {
+               RPMEMD_LOG(ERR, "!allocating message buffer failed");
+               return -1;
+       }
+
+       memcpy(hdrp, &nhdr, sizeof(*hdrp));
+
+       size_t body_size = hdr.size - sizeof(hdr);
+       ret = rpmemd_obc_recv(obc, hdrp->body, body_size);
+       if (ret) {
+               RPMEMD_LOG(ERR, "!receiving message body failed");
+               goto err_recv_body;
+       }
+
+       ret = rpmemd_obc_ntoh_check_msg[hdr.type](hdrp);
+       if (ret) {
+               RPMEMD_LOG(ERR, "parsing message body failed");
+               goto err_body;
+       }
+
+       *hdrpp = hdrp;
+       return 0;
+err_body:
+err_recv_body:
+       free(hdrp);
+       return -1;
+}
+
+/*
+ * rpmemd_obc_init -- initialize rpmemd
+ */
+struct rpmemd_obc *
+rpmemd_obc_init(int fd_in, int fd_out)
+{
+       struct rpmemd_obc *obc = calloc(1, sizeof(*obc));
+       if (!obc) {
+               RPMEMD_LOG(ERR, "!allocating obc failed");
+               goto err_calloc;
+       }
+
+       obc->fd_in = fd_in;
+       obc->fd_out = fd_out;
+
+       return obc;
+err_calloc:
+       return NULL;
+}
+
+/*
+ * rpmemd_obc_fini -- destroy obc
+ */
+void
+rpmemd_obc_fini(struct rpmemd_obc *obc)
+{
+       free(obc);
+}
+
+/*
+ * rpmemd_obc_status -- sends initial status to the client
+ */
+int
+rpmemd_obc_status(struct rpmemd_obc *obc, uint32_t status)
+{
+       return rpmemd_obc_send(obc, &status, sizeof(status));
+}
+
+/*
+ * rpmemd_obc_process -- wait for and process a message from client
+ *
+ * Return values:
+ * 0   - success
+ * < 0 - error
+ * 1   - client disconnected
+ */
+int
+rpmemd_obc_process(struct rpmemd_obc *obc,
+       struct rpmemd_obc_requests *req_cb, void *arg)
+{
+       RPMEMD_ASSERT(req_cb != NULL);
+       RPMEMD_ASSERT(req_cb->create != NULL);
+       RPMEMD_ASSERT(req_cb->open != NULL);
+       RPMEMD_ASSERT(req_cb->close != NULL);
+       RPMEMD_ASSERT(req_cb->set_attr != NULL);
+
+       struct rpmem_msg_hdr *hdrp = NULL;
+       int ret;
+
+       ret = rpmemd_obc_msg_recv(obc, &hdrp);
+       if (ret)
+               return ret;
+
+       RPMEMD_ASSERT(hdrp != NULL);
+
+       ret = rpmemd_obc_process_cb[hdrp->type](obc, req_cb, arg, hdrp);
+
+       free(hdrp);
+
+       return ret;
+}
+
+/*
+ * rpmemd_obc_create_resp -- send create request response message
+ */
+int
+rpmemd_obc_create_resp(struct rpmemd_obc *obc,
+       int status, const struct rpmem_resp_attr *res)
+{
+       struct rpmem_msg_create_resp resp = {
+               .hdr = {
+                       .type   = RPMEM_MSG_TYPE_CREATE_RESP,
+                       .size   = sizeof(struct rpmem_msg_create_resp),
+                       .status = (uint32_t)status,
+               },
+               .ibc = {
+                       .port   = res->port,
+                       .rkey   = res->rkey,
+                       .raddr  = res->raddr,
+                       .persist_method = res->persist_method,
+                       .nlanes = res->nlanes,
+               },
+       };
+
+       rpmem_hton_msg_create_resp(&resp);
+
+       return rpmemd_obc_send(obc, &resp, sizeof(resp));
+}
+
+/*
+ * rpmemd_obc_open_resp -- send open request response message
+ */
+int
+rpmemd_obc_open_resp(struct rpmemd_obc *obc,
+       int status, const struct rpmem_resp_attr *res,
+       const struct rpmem_pool_attr *pool_attr)
+{
+       struct rpmem_msg_open_resp resp = {
+               .hdr = {
+                       .type   = RPMEM_MSG_TYPE_OPEN_RESP,
+                       .size   = sizeof(struct rpmem_msg_open_resp),
+                       .status = (uint32_t)status,
+               },
+               .ibc = {
+                       .port   = res->port,
+                       .rkey   = res->rkey,
+                       .raddr  = res->raddr,
+                       .persist_method = res->persist_method,
+                       .nlanes = res->nlanes,
+               },
+       };
+
+       pack_rpmem_pool_attr(pool_attr, &resp.pool_attr);
+       rpmem_hton_msg_open_resp(&resp);
+
+       return rpmemd_obc_send(obc, &resp, sizeof(resp));
+}
+
+/*
+ * rpmemd_obc_close_resp -- send close request response message
+ */
+int
+rpmemd_obc_close_resp(struct rpmemd_obc *obc,
+       int status)
+{
+       struct rpmem_msg_close_resp resp = {
+               .hdr = {
+                       .type   = RPMEM_MSG_TYPE_CLOSE_RESP,
+                       .size   = sizeof(struct rpmem_msg_close_resp),
+                       .status = (uint32_t)status,
+               },
+       };
+
+       rpmem_hton_msg_close_resp(&resp);
+
+       return rpmemd_obc_send(obc, &resp, sizeof(resp));
+}
+
+/*
+ * rpmemd_obc_set_attr_resp -- send set attributes request response message
+ */
+int
+rpmemd_obc_set_attr_resp(struct rpmemd_obc *obc, int status)
+{
+       struct rpmem_msg_set_attr_resp resp = {
+               .hdr = {
+                       .type   = RPMEM_MSG_TYPE_SET_ATTR_RESP,
+                       .size   = sizeof(struct rpmem_msg_set_attr_resp),
+                       .status = (uint32_t)status,
+               },
+       };
+
+       rpmem_hton_msg_set_attr_resp(&resp);
+
+       return rpmemd_obc_send(obc, &resp, sizeof(resp));
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_obc.h
new file mode 100644 (file)
index 0000000..78c8f8a
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * rpmemd_obc.h -- rpmemd out-of-band connection declarations
+ */
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+struct rpmemd_obc;
+
+struct rpmemd_obc_requests {
+       int (*create)(struct rpmemd_obc *obc, void *arg,
+                       const struct rpmem_req_attr *req,
+                       const struct rpmem_pool_attr *pool_attr);
+       int (*open)(struct rpmemd_obc *obc, void *arg,
+                       const struct rpmem_req_attr *req);
+       int (*close)(struct rpmemd_obc *obc, void *arg, int flags);
+       int (*set_attr)(struct rpmemd_obc *obc, void *arg,
+                       const struct rpmem_pool_attr *pool_attr);
+};
+
+struct rpmemd_obc *rpmemd_obc_init(int fd_in, int fd_out);
+void rpmemd_obc_fini(struct rpmemd_obc *obc);
+
+int rpmemd_obc_status(struct rpmemd_obc *obc, uint32_t status);
+
+int rpmemd_obc_process(struct rpmemd_obc *obc,
+               struct rpmemd_obc_requests *req_cb, void *arg);
+
+int rpmemd_obc_create_resp(struct rpmemd_obc *obc,
+               int status, const struct rpmem_resp_attr *res);
+int rpmemd_obc_open_resp(struct rpmemd_obc *obc,
+               int status, const struct rpmem_resp_attr *res,
+               const struct rpmem_pool_attr *pool_attr);
+int rpmemd_obc_set_attr_resp(struct rpmemd_obc *obc, int status);
+int rpmemd_obc_close_resp(struct rpmemd_obc *obc,
+               int status);
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.c b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.c
new file mode 100644 (file)
index 0000000..db149e9
--- /dev/null
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2017-2018, Intel Corporation */
+
+/*
+ * rpmemd_util.c -- rpmemd utility functions definitions
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "libpmem.h"
+#include "rpmem_common.h"
+#include "rpmemd_log.h"
+#include "rpmemd_util.h"
+
+/*
+ * rpmemd_pmem_persist -- pmem_persist wrapper required to unify function
+ * pointer type with pmem_msync
+ */
+int
+rpmemd_pmem_persist(const void *addr, size_t len)
+{
+       pmem_persist(addr, len);
+       return 0;
+}
+
+/*
+ * rpmemd_flush_fatal -- APM specific flush function which should never be
+ * called because APM does not require flushes
+ */
+int
+rpmemd_flush_fatal(const void *addr, size_t len)
+{
+       RPMEMD_FATAL("rpmemd_flush_fatal should never be called");
+}
+
+/*
+ * rpmemd_persist_to_str -- convert persist function pointer to string
+ */
+static const char *
+rpmemd_persist_to_str(int (*persist)(const void *addr, size_t len))
+{
+       if (persist == rpmemd_pmem_persist) {
+               return "pmem_persist";
+       } else if (persist == pmem_msync) {
+               return "pmem_msync";
+       } else if (persist == rpmemd_flush_fatal) {
+               return "none";
+       } else {
+               return NULL;
+       }
+}
+
+/*
+ * rpmem_print_pm_policy -- print persistency method policy
+ */
+static void
+rpmem_print_pm_policy(enum rpmem_persist_method persist_method,
+               int (*persist)(const void *addr, size_t len))
+{
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "persist method: %s",
+                       rpmem_persist_method_to_str(persist_method));
+       RPMEMD_LOG(NOTICE, RPMEMD_LOG_INDENT "persist flush: %s",
+                       rpmemd_persist_to_str(persist));
+}
+
+/*
+ * rpmem_memcpy_msync -- memcpy and msync
+ */
+static void *
+rpmem_memcpy_msync(void *pmemdest, const void *src, size_t len)
+{
+       void *ret = pmem_memcpy(pmemdest, src, len, PMEM_F_MEM_NOFLUSH);
+       pmem_msync(pmemdest, len);
+
+       return ret;
+}
+
+/*
+ * rpmemd_apply_pm_policy -- choose the persistency method and the flush
+ * function according to the pool type and the persistency method read from the
+ * config
+ */
+int
+rpmemd_apply_pm_policy(enum rpmem_persist_method *persist_method,
+       int (**persist)(const void *addr, size_t len),
+       void *(**memcpy_persist)(void *pmemdest, const void *src, size_t len),
+       const int is_pmem)
+{
+       switch (*persist_method) {
+       case RPMEM_PM_APM:
+               if (is_pmem) {
+                       *persist_method = RPMEM_PM_APM;
+                       *persist = rpmemd_flush_fatal;
+               } else {
+                       *persist_method = RPMEM_PM_GPSPM;
+                       *persist = pmem_msync;
+               }
+               break;
+       case RPMEM_PM_GPSPM:
+               *persist_method = RPMEM_PM_GPSPM;
+               *persist = is_pmem ? rpmemd_pmem_persist : pmem_msync;
+               break;
+       default:
+               RPMEMD_FATAL("invalid persist method: %d", *persist_method);
+               return -1;
+       }
+
+       /* this is for RPMEM_PERSIST_INLINE */
+       if (is_pmem)
+               *memcpy_persist = pmem_memcpy_persist;
+       else
+               *memcpy_persist = rpmem_memcpy_msync;
+
+       RPMEMD_LOG(NOTICE, "persistency policy:");
+       rpmem_print_pm_policy(*persist_method, *persist);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.h b/ceph/src/pmdk/src/tools/rpmemd/rpmemd_util.h
new file mode 100644 (file)
index 0000000..6f18178
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * rpmemd_util.h -- rpmemd utility functions declarations
+ */
+
+int rpmemd_pmem_persist(const void *addr, size_t len);
+int rpmemd_flush_fatal(const void *addr, size_t len);
+int rpmemd_apply_pm_policy(enum rpmem_persist_method *persist_method,
+       int (**persist)(const void *addr, size_t len),
+       void *(**memcpy_persist)(void *pmemdest, const void *src, size_t len),
+       const int is_pmem);
diff --git a/ceph/src/pmdk/src/windows/README b/ceph/src/pmdk/src/windows/README
new file mode 100644 (file)
index 0000000..18067ab
--- /dev/null
@@ -0,0 +1,19 @@
+Persistent Memory Development Kit
+
+This is src/windows/README.
+
+This directory contains the Windows-specific source for the PMDK.
+
+The subdirectory "include" contains header files that have no equivalents
+on Windows OS, when building PMDK using VC++ compiler.
+Some of those files are empty, which is a cheap trick to avoid preprocessor
+errors when including non-existing files.  This way we don't need a lot
+of preprocessor conditionals in all the source code files.
+
+The "platform.h" file contains definitions of all the basic types and macros
+that are not available under VC++.  When building PMDK with Visual Studio,
+"platform.h" file is included to each source file using "/FI" (forced include)
+option.
+
+The subdirectory "getopt" contains a windows implementation of getopt and
+getopt_long
diff --git a/ceph/src/pmdk/src/windows/getopt/.cstyleignore b/ceph/src/pmdk/src/windows/getopt/.cstyleignore
new file mode 100644 (file)
index 0000000..760e0cd
--- /dev/null
@@ -0,0 +1,2 @@
+getopt.c
+getopt.h
diff --git a/ceph/src/pmdk/src/windows/getopt/LICENSE.txt b/ceph/src/pmdk/src/windows/getopt/LICENSE.txt
new file mode 100644 (file)
index 0000000..340303a
--- /dev/null
@@ -0,0 +1,24 @@
+Copyright (c) 2012, Kim Gräsman
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Kim Gräsman nor the
+      names of contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/ceph/src/pmdk/src/windows/getopt/README b/ceph/src/pmdk/src/windows/getopt/README
new file mode 100644 (file)
index 0000000..437e7a5
--- /dev/null
@@ -0,0 +1,9 @@
+Persistent Memory Development Kit
+
+This is src/windows/getopt/README.
+
+This is directory contains windows getopt implementation downloaded from:
+
+       https://github.com/kimgr/getopt_port
+
+with changes applied to compile it with "compile as c code(/TC)" option.
diff --git a/ceph/src/pmdk/src/windows/getopt/getopt.c b/ceph/src/pmdk/src/windows/getopt/getopt.c
new file mode 100644 (file)
index 0000000..16e52cd
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * *Copyright (c) 2012, Kim Gräsman
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Kim Gräsman nor the
+ *       names of contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "getopt.h"
+
+#include <stddef.h>
+#include <string.h>
+#include <stdio.h>
+
+char* optarg;
+int optopt;
+/* The variable optind [...] shall be initialized to 1 by the system. */
+int optind = 1;
+int opterr;
+
+static char* optcursor = NULL;
+static char *first = NULL;
+
+/* rotates argv array */
+static void rotate(char **argv, int argc) {
+  if (argc <= 1)
+    return;
+  char *tmp = argv[0];
+  memmove(argv, argv + 1, (argc - 1) * sizeof(char *));
+  argv[argc - 1] = tmp;
+}
+
+/* Implemented based on [1] and [2] for optional arguments.
+   optopt is handled FreeBSD-style, per [3].
+   Other GNU and FreeBSD extensions are purely accidental.
+
+[1] https://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
+[2] https://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
+[3] https://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE
+*/
+int getopt(int argc, char* const argv[], const char* optstring) {
+  int optchar = -1;
+  const char* optdecl = NULL;
+
+  optarg = NULL;
+  opterr = 0;
+  optopt = 0;
+
+  /* Unspecified, but we need it to avoid overrunning the argv bounds. */
+  if (optind >= argc)
+    goto no_more_optchars;
+
+  /* If, when getopt() is called argv[optind] is a null pointer, getopt()
+     shall return -1 without changing optind. */
+  if (argv[optind] == NULL)
+    goto no_more_optchars;
+
+  /* If, when getopt() is called *argv[optind] is not the character '-',
+     permute argv to move non options to the end */
+  if (*argv[optind] != '-') {
+    if (argc - optind <= 1)
+      goto no_more_optchars;
+
+    if (!first)
+      first = argv[optind];
+
+    do {
+      rotate((char **)(argv + optind), argc - optind);
+    } while (*argv[optind] != '-' && argv[optind] != first);
+
+    if (argv[optind] == first)
+      goto no_more_optchars;
+  }
+
+  /* If, when getopt() is called argv[optind] points to the string "-",
+     getopt() shall return -1 without changing optind. */
+  if (strcmp(argv[optind], "-") == 0)
+    goto no_more_optchars;
+
+  /* If, when getopt() is called argv[optind] points to the string "--",
+     getopt() shall return -1 after incrementing optind. */
+  if (strcmp(argv[optind], "--") == 0) {
+    ++optind;
+    if (first) {
+      do {
+        rotate((char **)(argv + optind), argc - optind);
+      } while (argv[optind] != first);
+    }
+    goto no_more_optchars;
+  }
+
+  if (optcursor == NULL || *optcursor == '\0')
+    optcursor = argv[optind] + 1;
+
+  optchar = *optcursor;
+
+  /* FreeBSD: The variable optopt saves the last known option character
+     returned by getopt(). */
+  optopt = optchar;
+
+  /* The getopt() function shall return the next option character (if one is
+     found) from argv that matches a character in optstring, if there is
+     one that matches. */
+  optdecl = strchr(optstring, optchar);
+  if (optdecl) {
+    /* [I]f a character is followed by a colon, the option takes an
+       argument. */
+    if (optdecl[1] == ':') {
+      optarg = ++optcursor;
+      if (*optarg == '\0') {
+        /* GNU extension: Two colons mean an option takes an
+           optional arg; if there is text in the current argv-element
+           (i.e., in the same word as the option name itself, for example,
+           "-oarg"), then it is returned in optarg, otherwise optarg is set
+           to zero. */
+        if (optdecl[2] != ':') {
+          /* If the option was the last character in the string pointed to by
+             an element of argv, then optarg shall contain the next element
+             of argv, and optind shall be incremented by 2. If the resulting
+             value of optind is greater than argc, this indicates a missing
+             option-argument, and getopt() shall return an error indication.
+
+             Otherwise, optarg shall point to the string following the
+             option character in that element of argv, and optind shall be
+             incremented by 1.
+          */
+          if (++optind < argc) {
+            optarg = argv[optind];
+          } else {
+            /* If it detects a missing option-argument, it shall return the
+               colon character ( ':' ) if the first character of optstring
+               was a colon, or a question-mark character ( '?' ) otherwise.
+            */
+            optarg = NULL;
+            fprintf(stderr, "%s: option requires an argument -- '%c'\n", argv[0], optchar);
+            optchar = (optstring[0] == ':') ? ':' : '?';
+          }
+        } else {
+          optarg = NULL;
+        }
+      }
+      optcursor = NULL;
+    }
+  } else {
+    fprintf(stderr,"%s: invalid option -- '%c'\n", argv[0], optchar);
+    /* If getopt() encounters an option character that is not contained in
+       optstring, it shall return the question-mark ( '?' ) character. */
+    optchar = '?';
+  }
+
+  if (optcursor == NULL || *++optcursor == '\0')
+    ++optind;
+
+  return optchar;
+
+no_more_optchars:
+  optcursor = NULL;
+  first = NULL;
+  return -1;
+}
+
+/* Implementation based on [1].
+
+[1] https://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
+*/
+int getopt_long(int argc, char* const argv[], const char* optstring,
+  const struct option* longopts, int* longindex) {
+  const struct option* o = longopts;
+  const struct option* match = NULL;
+  int num_matches = 0;
+  size_t argument_name_length = 0;
+  const char* current_argument = NULL;
+  int retval = -1;
+
+  optarg = NULL;
+  optopt = 0;
+
+  if (optind >= argc)
+    return -1;
+
+  /* If, when getopt() is called argv[optind] is a null pointer, getopt_long()
+  shall return -1 without changing optind. */
+  if (argv[optind] == NULL)
+    goto no_more_optchars;
+
+  /* If, when getopt_long() is called *argv[optind] is not the character '-',
+  permute argv to move non options to the end */
+  if (*argv[optind] != '-') {
+    if (argc - optind <= 1)
+      goto no_more_optchars;
+
+    if (!first)
+      first = argv[optind];
+
+    do {
+      rotate((char **)(argv + optind), argc - optind);
+    } while (*argv[optind] != '-' && argv[optind] != first);
+
+    if (argv[optind] == first)
+      goto no_more_optchars;
+  }
+
+  if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
+    return getopt(argc, argv, optstring);
+
+  /* It's an option; starts with -- and is longer than two chars. */
+  current_argument = argv[optind] + 2;
+  argument_name_length = strcspn(current_argument, "=");
+  for (; o->name; ++o) {
+    if (strncmp(o->name, current_argument, argument_name_length) == 0) {
+      match = o;
+      ++num_matches;
+      if (strlen(o->name) == argument_name_length) {
+        /* found match is exactly the one which we are looking for */
+        num_matches = 1;
+        break;
+      }
+    }
+  }
+
+  if (num_matches == 1) {
+    /* If longindex is not NULL, it points to a variable which is set to the
+       index of the long option relative to longopts. */
+    if (longindex)
+      *longindex = (int)(match - longopts);
+
+    /* If flag is NULL, then getopt_long() shall return val.
+       Otherwise, getopt_long() returns 0, and flag shall point to a variable
+       which shall be set to val if the option is found, but left unchanged if
+       the option is not found. */
+    if (match->flag)
+      *(match->flag) = match->val;
+
+    retval = match->flag ? 0 : match->val;
+
+    if (match->has_arg != no_argument) {
+      optarg = strchr(argv[optind], '=');
+      if (optarg != NULL)
+        ++optarg;
+
+      if (match->has_arg == required_argument) {
+        /* Only scan the next argv for required arguments. Behavior is not
+           specified, but has been observed with Ubuntu and Mac OSX. */
+        if (optarg == NULL && ++optind < argc) {
+          optarg = argv[optind];
+        }
+
+        if (optarg == NULL)
+          retval = ':';
+      }
+    } else if (strchr(argv[optind], '=')) {
+      /* An argument was provided to a non-argument option.
+         I haven't seen this specified explicitly, but both GNU and BSD-based
+         implementations show this behavior.
+      */
+      retval = '?';
+    }
+  } else {
+    /* Unknown option or ambiguous match. */
+    retval = '?';
+    if (num_matches == 0) {
+      fprintf(stderr, "%s: unrecognized option -- '%s'\n", argv[0], argv[optind]);
+    } else {
+      fprintf(stderr, "%s: option '%s' is ambiguous\n", argv[0], argv[optind]);
+    }
+  }
+
+  ++optind;
+  return retval;
+
+no_more_optchars:
+  first = NULL;
+  return -1;
+}
diff --git a/ceph/src/pmdk/src/windows/getopt/getopt.h b/ceph/src/pmdk/src/windows/getopt/getopt.h
new file mode 100644 (file)
index 0000000..bb9ee4e
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * *Copyright (c) 2012, Kim Gräsman
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Kim Gräsman nor the
+ *       names of contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef INCLUDED_GETOPT_PORT_H
+#define INCLUDED_GETOPT_PORT_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+extern char* optarg;
+extern int optind, opterr, optopt;
+
+struct option {
+  const char* name;
+  int has_arg;
+  int* flag;
+  int val;
+};
+
+int getopt(int argc, char* const argv[], const char* optstring);
+
+int getopt_long(int argc, char* const argv[],
+  const char* optstring, const struct option* longopts, int* longindex);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // INCLUDED_GETOPT_PORT_H
diff --git a/ceph/src/pmdk/src/windows/getopt/getopt.vcxproj b/ceph/src/pmdk/src/windows/getopt/getopt.vcxproj
new file mode 100644 (file)
index 0000000..350ea37
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{9186EAC4-2F34-4F17-B940-6585D7869BCD}</ProjectGuid>
+    <RootNamespace>getopt</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>
+      </SDLCheck>
+      <CompileAs>CompileAsC</CompileAs>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <PreprocessorDefinitions>NTDDI_VERSION=NTDDI_WIN10_RS1;_DEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4819</DisableSpecificWarnings>
+    </ClCompile>
+    <Lib>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>
+      </SDLCheck>
+      <CompileAs>CompileAsC</CompileAs>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <PreprocessorDefinitions>NTDDI_VERSION=NTDDI_WIN10_RS1;NDEBUG;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+    <Lib>
+      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="getopt.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="getopt.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/windows/getopt/getopt.vcxproj.filters b/ceph/src/pmdk/src/windows/getopt/getopt.vcxproj.filters
new file mode 100644 (file)
index 0000000..0db0b79
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="getopt.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="getopt.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/windows/include/.cstyleignore b/ceph/src/pmdk/src/windows/include/.cstyleignore
new file mode 100644 (file)
index 0000000..ad7ade0
--- /dev/null
@@ -0,0 +1 @@
+srcversion.h
diff --git a/ceph/src/pmdk/src/windows/include/dirent.h b/ceph/src/pmdk/src/windows/include/dirent.h
new file mode 100644 (file)
index 0000000..ecc069a
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * fake dirent.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/endian.h b/ceph/src/pmdk/src/windows/include/endian.h
new file mode 100644 (file)
index 0000000..29b7e10
--- /dev/null
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * endian.h -- convert values between host and big-/little-endian byte order
+ */
+
+#ifndef ENDIAN_H
+#define ENDIAN_H 1
+
+/*
+ * XXX: On Windows we can assume little-endian architecture
+ */
+#include <intrin.h>
+
+#define htole16(a) (a)
+#define htole32(a) (a)
+#define htole64(a) (a)
+
+#define le16toh(a) (a)
+#define le32toh(a) (a)
+#define le64toh(a) (a)
+
+#define htobe16(x) _byteswap_ushort(x)
+#define htobe32(x) _byteswap_ulong(x)
+#define htobe64(x) _byteswap_uint64(x)
+
+#define be16toh(x)  _byteswap_ushort(x)
+#define be32toh(x)  _byteswap_ulong(x)
+#define be64toh(x)  _byteswap_uint64(x)
+
+#endif /* ENDIAN_H */
diff --git a/ceph/src/pmdk/src/windows/include/err.h b/ceph/src/pmdk/src/windows/include/err.h
new file mode 100644 (file)
index 0000000..f9d2afd
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * err.h - error and warning messages
+ */
+
+#ifndef ERR_H
+#define ERR_H 1
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+/*
+ * err - windows implementation of unix err function
+ */
+__declspec(noreturn) static void
+err(int eval, const char *fmt, ...)
+{
+       va_list vl;
+       va_start(vl, fmt);
+       vfprintf(stderr, fmt, vl);
+       va_end(vl);
+       exit(eval);
+}
+
+/*
+ * warn - windows implementation of unix warn function
+ */
+static void
+warn(const char *fmt, ...)
+{
+       va_list vl;
+       va_start(vl, fmt);
+       fprintf(stderr, "Warning: ");
+       vfprintf(stderr, fmt, vl);
+       va_end(vl);
+}
+
+#endif /* ERR_H */
diff --git a/ceph/src/pmdk/src/windows/include/features.h b/ceph/src/pmdk/src/windows/include/features.h
new file mode 100644 (file)
index 0000000..fe34393
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * fake features.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/libgen.h b/ceph/src/pmdk/src/windows/include/libgen.h
new file mode 100644 (file)
index 0000000..932081f
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * fake libgen.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/linux/limits.h b/ceph/src/pmdk/src/windows/include/linux/limits.h
new file mode 100644 (file)
index 0000000..c14ca5c
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * linux/limits.h -- fake header file
+ */
+
+/*
+ * XXX - The only purpose of this empty file is to avoid preprocessor
+ * errors when including a Linux-specific header file that has no equivalent
+ * on Windows.  With this cheap trick, we don't need a lot of preprocessor
+ * conditionals in all the source code files.
+ *
+ * In the future, this will be addressed in some other way.
+ */
diff --git a/ceph/src/pmdk/src/windows/include/platform.h b/ceph/src/pmdk/src/windows/include/platform.h
new file mode 100644 (file)
index 0000000..54b1395
--- /dev/null
@@ -0,0 +1,226 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * platform.h -- dirty hacks to compile Linux code on Windows using VC++
+ *
+ * This is included to each source file using "/FI" (forced include) option.
+ *
+ * XXX - it is a subject for refactoring
+ */
+
+#ifndef PLATFORM_H
+#define PLATFORM_H 1
+
+#pragma warning(disable : 4996)
+#pragma warning(disable : 4200) /* allow flexible array member */
+#pragma warning(disable : 4819) /* non unicode characters */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Prevent PMDK compilation for 32-bit platforms */
+#if defined(_WIN32) && !defined(_WIN64)
+#error "32-bit builds of PMDK are not supported!"
+#endif
+
+#define _CRT_RAND_S            /* rand_s() */
+
+#include <windows.h>
+#include <stdint.h>
+#include <time.h>
+#include <io.h>
+#include <process.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <malloc.h>
+#include <signal.h>
+#include <intrin.h>
+#include <direct.h>
+
+/* use uuid_t definition from util.h */
+#ifdef uuid_t
+#undef uuid_t
+#endif
+
+/* a few trivial substitutions */
+#define PATH_MAX MAX_PATH
+#define __thread __declspec(thread)
+#define __func__ __FUNCTION__
+#ifdef _DEBUG
+#define DEBUG
+#endif
+
+/*
+ * The inline keyword is available only in VC++.
+ * https://msdn.microsoft.com/en-us/library/bw1hbe6y.aspx
+ */
+#ifndef __cplusplus
+#define inline __inline
+#endif
+
+/* XXX - no equivalents in VC++ */
+#define __attribute__(a)
+#define __builtin_constant_p(cnd) 0
+
+/*
+ * missing definitions
+ */
+
+/* errno.h */
+#define ELIBACC 79 /* cannot access a needed shared library */
+
+/* sys/stat.h */
+#define S_IRUSR S_IREAD
+#define S_IWUSR S_IWRITE
+#define S_IRGRP S_IRUSR
+#define S_IWGRP S_IWUSR
+
+#define O_SYNC 0
+
+typedef int mode_t;
+
+#define fchmod(fd, mode) 0     /* XXX - dummy */
+#define setlinebuf(fp) setvbuf(fp, NULL, _IOLBF, BUFSIZ);
+
+/* unistd.h */
+typedef long long os_off_t;
+typedef long long ssize_t;
+
+int setenv(const char *name, const char *value, int overwrite);
+int unsetenv(const char *name);
+
+/* fcntl.h */
+int posix_fallocate(int fd, os_off_t offset, os_off_t len);
+
+/* string.h */
+#define strtok_r strtok_s
+
+/* time.h */
+#define CLOCK_MONOTONIC 1
+#define CLOCK_REALTIME 2
+
+int clock_gettime(int id, struct timespec *ts);
+
+/* signal.h */
+typedef unsigned long long sigset_t; /* one bit for each signal */
+C_ASSERT(NSIG <= sizeof(sigset_t) * 8);
+
+struct sigaction {
+       void (*sa_handler) (int signum);
+       /* void (*sa_sigaction)(int, siginfo_t *, void *); */
+       sigset_t sa_mask;
+       int sa_flags;
+       void (*sa_restorer) (void);
+};
+
+__inline int
+sigemptyset(sigset_t *set)
+{
+       *set = 0;
+       return 0;
+}
+
+__inline int
+sigfillset(sigset_t *set)
+{
+       *set = ~0;
+       return 0;
+}
+
+__inline int
+sigaddset(sigset_t *set, int signum)
+{
+       if (signum <= 0 || signum >= NSIG) {
+               errno = EINVAL;
+               return -1;
+       }
+       *set |= (1ULL << (signum - 1));
+       return 0;
+}
+
+__inline int
+sigdelset(sigset_t *set, int signum)
+{
+       if (signum <= 0 || signum >= NSIG) {
+               errno = EINVAL;
+               return -1;
+       }
+       *set &= ~(1ULL << (signum - 1));
+       return 0;
+}
+
+__inline int
+sigismember(const sigset_t *set, int signum)
+{
+       if (signum <= 0 || signum >= NSIG) {
+               errno = EINVAL;
+               return -1;
+       }
+       return ((*set & (1ULL << (signum - 1))) ? 1 : 0);
+}
+
+/* sched.h */
+
+/*
+ * sched_yield -- yield the processor
+ */
+__inline int
+sched_yield(void)
+{
+       SwitchToThread();
+       return 0;               /* always succeeds */
+}
+
+/*
+ * helper macros for library ctor/dtor function declarations
+ */
+#define MSVC_CONSTR(func) \
+void func(void); \
+__pragma(comment(linker, "/include:_" #func)) \
+__pragma(section(".CRT$XCU", read)) \
+__declspec(allocate(".CRT$XCU")) \
+const void (WINAPI *_##func)(void) = (const void (WINAPI *)(void))func;
+
+#define MSVC_DESTR(func) \
+void func(void); \
+static void _##func##_reg(void) { atexit(func); }; \
+MSVC_CONSTR(_##func##_reg)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PLATFORM_H */
diff --git a/ceph/src/pmdk/src/windows/include/sched.h b/ceph/src/pmdk/src/windows/include/sched.h
new file mode 100644 (file)
index 0000000..8303bb2
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2017-2020, Intel Corporation */
+
+/*
+ * fake sched.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/strings.h b/ceph/src/pmdk/src/windows/include/strings.h
new file mode 100644 (file)
index 0000000..33fb468
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * fake strings.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/sys/file.h b/ceph/src/pmdk/src/windows/include/sys/file.h
new file mode 100644 (file)
index 0000000..4cbce49
--- /dev/null
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * sys/file.h -- file locking
+ */
diff --git a/ceph/src/pmdk/src/windows/include/sys/mman.h b/ceph/src/pmdk/src/windows/include/sys/mman.h
new file mode 100644 (file)
index 0000000..5feb2e3
--- /dev/null
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * sys/mman.h -- memory-mapped files for Windows
+ */
+
+#ifndef SYS_MMAN_H
+#define SYS_MMAN_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PROT_NONE      0x0
+#define PROT_READ      0x1
+#define PROT_WRITE     0x2
+#define PROT_EXEC      0x4
+
+#define MAP_SHARED     0x1
+#define MAP_PRIVATE    0x2
+
+#define MAP_FIXED      0x10
+#define MAP_ANONYMOUS  0x20
+#define MAP_ANON       MAP_ANONYMOUS
+
+#define MAP_NORESERVE  0x04000
+
+#define MS_ASYNC       1
+#define MS_SYNC                4
+#define MS_INVALIDATE  2
+
+#define MAP_FAILED ((void *)(-1))
+
+void *mmap(void *addr, size_t len, int prot, int flags,
+       int fd, os_off_t offset);
+int munmap(void *addr, size_t len);
+int msync(void *addr, size_t len, int flags);
+
+int mprotect(void *addr, size_t len, int prot);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SYS_MMAN_H */
diff --git a/ceph/src/pmdk/src/windows/include/sys/mount.h b/ceph/src/pmdk/src/windows/include/sys/mount.h
new file mode 100644 (file)
index 0000000..80dc93e
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * fake sys/mount.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/sys/param.h b/ceph/src/pmdk/src/windows/include/sys/param.h
new file mode 100644 (file)
index 0000000..7200cfd
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * sys/param.h -- a few useful macros
+ */
+
+#ifndef SYS_PARAM_H
+#define SYS_PARAM_H 1
+
+#define roundup(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
+#define howmany(x, y)  (((x) + ((y) - 1)) / (y))
+
+#define BPB 8  /* bits per byte */
+
+#define setbit(b, i)   ((b)[(i) / BPB] |= 1 << ((i) % BPB))
+#define isset(b, i)    ((b)[(i) / BPB] & (1 << ((i) % BPB)))
+#define isclr(b, i)    (((b)[(i) / BPB] & (1 << ((i) % BPB))) == 0)
+
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#endif /* SYS_PARAM_H */
diff --git a/ceph/src/pmdk/src/windows/include/sys/resource.h b/ceph/src/pmdk/src/windows/include/sys/resource.h
new file mode 100644 (file)
index 0000000..77a36ed
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2018-2020, Intel Corporation */
+
+/*
+ * fake sys/resource.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/sys/statvfs.h b/ceph/src/pmdk/src/windows/include/sys/statvfs.h
new file mode 100644 (file)
index 0000000..3a52b7c
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2016-2020, Intel Corporation */
+
+/*
+ * fake statvfs.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/sys/uio.h b/ceph/src/pmdk/src/windows/include/sys/uio.h
new file mode 100644 (file)
index 0000000..4addf6a
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * sys/uio.h -- definition of iovec structure
+ */
+
+#ifndef SYS_UIO_H
+#define SYS_UIO_H 1
+
+#include <pmemcompat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SYS_UIO_H */
diff --git a/ceph/src/pmdk/src/windows/include/sys/wait.h b/ceph/src/pmdk/src/windows/include/sys/wait.h
new file mode 100644 (file)
index 0000000..1becec5
--- /dev/null
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * fake sys/wait.h
+ */
diff --git a/ceph/src/pmdk/src/windows/include/unistd.h b/ceph/src/pmdk/src/windows/include/unistd.h
new file mode 100644 (file)
index 0000000..9dc41f8
--- /dev/null
@@ -0,0 +1,136 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+
+/*
+ * unistd.h -- compatibility layer for POSIX operating system API
+ */
+
+#ifndef UNISTD_H
+#define UNISTD_H 1
+
+#include <stdio.h>
+
+#define _SC_PAGESIZE 0
+#define _SC_NPROCESSORS_ONLN 1
+
+#define R_OK 04
+#define W_OK 02
+#define X_OK 00 /* execute permission doesn't exist on Windows */
+#define F_OK 00
+
+/*
+ * sysconf -- get configuration information at run time
+ */
+static __inline long
+sysconf(int p)
+{
+       SYSTEM_INFO si;
+       int ret = 0;
+
+       switch (p) {
+       case _SC_PAGESIZE:
+               GetSystemInfo(&si);
+               return si.dwPageSize;
+
+       case _SC_NPROCESSORS_ONLN:
+               for (int i = 0; i < GetActiveProcessorGroupCount(); i++) {
+                       ret += GetActiveProcessorCount(i);
+               }
+               return ret;
+
+       default:
+               return 0;
+       }
+
+}
+
+#define getpid _getpid
+
+/*
+ * pread -- read from a file descriptor at given offset
+ */
+static ssize_t
+pread(int fd, void *buf, size_t count, os_off_t offset)
+{
+       __int64 position = _lseeki64(fd, 0, SEEK_CUR);
+       _lseeki64(fd, offset, SEEK_SET);
+       int ret = _read(fd, buf, (unsigned)count);
+       _lseeki64(fd, position, SEEK_SET);
+       return ret;
+}
+
+/*
+ * pwrite -- write to a file descriptor at given offset
+ */
+static ssize_t
+pwrite(int fd, const void *buf, size_t count, os_off_t offset)
+{
+       __int64 position = _lseeki64(fd, 0, SEEK_CUR);
+       _lseeki64(fd, offset, SEEK_SET);
+       int ret = _write(fd, buf, (unsigned)count);
+       _lseeki64(fd, position, SEEK_SET);
+       return ret;
+}
+
+#define S_ISBLK(x) 0 /* BLK devices not exist on Windows */
+
+/*
+ * basename -- parse pathname and return filename component
+ */
+static char *
+basename(char *path)
+{
+       char fname[_MAX_FNAME];
+       char ext[_MAX_EXT];
+       _splitpath(path, NULL, NULL, fname, ext);
+
+       sprintf(path, "%s%s", fname, ext);
+
+       return path;
+}
+
+/*
+ * dirname -- parse pathname and return directory component
+ */
+static char *
+dirname(char *path)
+{
+       if (path == NULL)
+               return ".";
+
+       size_t len = strlen(path);
+       if (len == 0)
+               return ".";
+
+       char *end = path + len;
+
+       /* strip trailing forslashes and backslashes */
+       while ((--end) > path) {
+               if (*end != '\\' && *end != '/') {
+                       *(end + 1) = '\0';
+                       break;
+               }
+       }
+
+       /* strip basename */
+       while ((--end) > path) {
+               if (*end == '\\' || *end == '/') {
+                       *end = '\0';
+                       break;
+               }
+       }
+
+       if (end != path) {
+               return path;
+               /* handle edge cases */
+       } else if (*end == '\\' || *end == '/') {
+               *(end + 1) = '\0';
+       } else {
+               *end++ = '.';
+               *end = '\0';
+       }
+
+       return path;
+}
+
+#endif /* UNISTD_H */
diff --git a/ceph/src/pmdk/src/windows/include/win_mmap.h b/ceph/src/pmdk/src/windows/include/win_mmap.h
new file mode 100644 (file)
index 0000000..4e2250f
--- /dev/null
@@ -0,0 +1,81 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright 2015-2020, Intel Corporation */
+/*
+ * Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * win_mmap.h -- (internal) tracks the regions mapped by mmap
+ */
+
+#ifndef WIN_MMAP_H
+#define WIN_MMAP_H 1
+
+#include "queue.h"
+
+#define roundup(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
+#define rounddown(x, y)        (((x) / (y)) * (y))
+
+void win_mmap_init(void);
+void win_mmap_fini(void);
+
+/* allocation/mmap granularity */
+extern unsigned long long Mmap_align;
+
+typedef enum FILE_MAPPING_TRACKER_FLAGS {
+       FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED = 0x0001,
+
+       /*
+        * This should hold the value of all flags ORed for debug purpose.
+        */
+       FILE_MAPPING_TRACKER_FLAGS_MASK =
+               FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED
+} FILE_MAPPING_TRACKER_FLAGS;
+
+/*
+ * this structure tracks the file mappings outstanding per file handle
+ */
+typedef struct FILE_MAPPING_TRACKER {
+       PMDK_SORTEDQ_ENTRY(FILE_MAPPING_TRACKER) ListEntry;
+       HANDLE FileHandle;
+       HANDLE FileMappingHandle;
+       void *BaseAddress;
+       void *EndAddress;
+       DWORD Access;
+       os_off_t Offset;
+       size_t FileLen;
+       FILE_MAPPING_TRACKER_FLAGS Flags;
+} FILE_MAPPING_TRACKER, *PFILE_MAPPING_TRACKER;
+
+extern SRWLOCK FileMappingQLock;
+extern PMDK_SORTEDQ_HEAD(FMLHead, FILE_MAPPING_TRACKER) FileMappingQHead;
+
+#endif /* WIN_MMAP_H */
diff --git a/ceph/src/pmdk/src/windows/libs_debug.props b/ceph/src/pmdk/src/windows/libs_debug.props
new file mode 100644 (file)
index 0000000..32d4306
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir>
+    <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(SolutionDir)\core;$(SolutionDir)\$(TargetName)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>PMDK_UTF8_API;SDS_ENABLED;NTDDI_VERSION=NTDDI_WIN10_RS4;_CRT_SECURE_NO_WARNINGS;_WINDLL;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <CompileAs>CompileAsC</CompileAs>
+      <BrowseInformation>true</BrowseInformation>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <WarningLevel>Level3</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <ExceptionHandling>false</ExceptionHandling>
+    </ClCompile>
+    <Link>
+      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
+      <AdditionalDependencies>shlwapi.lib;ntdll.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>$(TargetName).def</ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <GenerateMapFile>true</GenerateMapFile>
+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
+    </Link>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\common;$(SolutionDir)\windows\include</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/windows/libs_release.props b/ceph/src/pmdk/src/windows/libs_release.props
new file mode 100644 (file)
index 0000000..20728c2
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\libs\</OutDir>
+    <ExecutablePath>$(FrameworkSDKdir)bin\$(TargetPlatformVersion)\$(Platform);$(ExecutablePath)</ExecutablePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(SolutionDir)\core;$(SolutionDir)\$(TargetName)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>PMDK_UTF8_API;SDS_ENABLED;NTDDI_VERSION=NTDDI_WIN10_RS4;_CRT_SECURE_NO_WARNINGS;_WINDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <CompileAs>CompileAsC</CompileAs>
+      <BrowseInformation>true</BrowseInformation>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <WarningLevel>Level3</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <ExceptionHandling>false</ExceptionHandling>
+      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
+    </ClCompile>
+    <Link>
+      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
+      <AdditionalDependencies>shlwapi.lib;ntdll.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>$(TargetName).def</ModuleDefinitionFile>
+      <GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
+      <GenerateMapFile>false</GenerateMapFile>
+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
+    </Link>
+    <ResourceCompile>
+      <PreprocessorDefinitions>
+      </PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\common;$(SolutionDir)\windows\include</AdditionalIncludeDirectories>
+    </ResourceCompile>
+  </ItemDefinitionGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/windows/srcversion/srcversion.vcxproj b/ceph/src/pmdk/src/windows/srcversion/srcversion.vcxproj
new file mode 100644 (file)
index 0000000..29f1dbf
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\utils\SRCVERSION.ps1" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{901F04DB-E1A5-4A41-8B81-9D31C19ACD59}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>srcversion</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;WINAPI_PARTITION_SYSTEM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <CompileAs>CompileAsC</CompileAs>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies />
+    </Link>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+    <CustomBuildStep>
+      <Command>powershell.exe -ExecutionPolicy Bypass -file "$(SolutionDir)..\utils\SRCVERSION.ps1" $(SRCVERSION)</Command>
+      <Outputs>__NON_EXISTENT_FILE__</Outputs>
+      <Message>generate srcversion.h</Message>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <PreprocessorDefinitions>NDEBUG;_CONSOLE;WINAPI_PARTITION_SYSTEM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>platform.h</ForcedIncludeFiles>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <CompileAs>CompileAsC</CompileAs>
+      <Optimization>MaxSpeed</Optimization>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies />
+    </Link>
+    <PreBuildEvent>
+      <Command>
+      </Command>
+    </PreBuildEvent>
+    <CustomBuildStep>
+      <Command>powershell.exe -ExecutionPolicy Bypass -file "$(SolutionDir)..\utils\SRCVERSION.ps1" $(SRCVERSION)</Command>
+      <Outputs>__NON_EXISTENT_FILE__</Outputs>
+      <Message>generate srcversion.h</Message>
+    </CustomBuildStep>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/ceph/src/pmdk/src/windows/win_mmap.c b/ceph/src/pmdk/src/windows/win_mmap.c
new file mode 100644 (file)
index 0000000..1f1585d
--- /dev/null
@@ -0,0 +1,1132 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2015-2019, Intel Corporation */
+/*
+ * Copyright (c) 2015-2017, Microsoft Corporation. All rights reserved.
+ * Copyright (c) 2016, Hewlett Packard Enterprise Development LP
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *
+ *     * Neither the name of the copyright holder nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * win_mmap.c -- memory-mapped files for Windows
+ */
+
+/*
+ * XXX - The initial approach to PMDK for Windows port was to minimize the
+ * amount of changes required in the core part of the library, and to avoid
+ * preprocessor conditionals, if possible.  For that reason, some of the
+ * Linux system calls that have no equivalents on Windows have been emulated
+ * using Windows API.
+ * Note that it was not a goal to fully emulate POSIX-compliant behavior
+ * of mentioned functions.  They are used only internally, so current
+ * implementation is just good enough to satisfy PMDK needs and to make it
+ * work on Windows.
+ *
+ * This is a subject for change in the future.  Likely, all these functions
+ * will be replaced with "util_xxx" wrappers with OS-specific implementation
+ * for Linux and Windows.
+ *
+ * Known issues:
+ * - on Windows, mapping granularity/alignment is 64KB, not 4KB;
+ * - mprotect() behavior and protection flag handling in mmap() is slightly
+ *   different than on Linux (see comments below).
+ */
+
+#include <sys/mman.h>
+#include "mmap.h"
+#include "util.h"
+#include "out.h"
+#include "win_mmap.h"
+
+/* uncomment for more debug information on mmap trackers */
+/* #define MMAP_DEBUG_INFO */
+
+NTSTATUS
+NtFreeVirtualMemory(_In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress,
+       _Inout_ PSIZE_T RegionSize, _In_ ULONG FreeType);
+
+/*
+ * XXX Unify the Linux and Windows code and replace this structure with
+ * the map tracking list defined in mmap.h.
+ */
+SRWLOCK FileMappingQLock = SRWLOCK_INIT;
+struct FMLHead FileMappingQHead =
+       PMDK_SORTEDQ_HEAD_INITIALIZER(FileMappingQHead);
+
+/*
+ * mmap_file_mapping_comparer -- (internal) compares the two file mapping
+ * trackers
+ */
+static LONG_PTR
+mmap_file_mapping_comparer(PFILE_MAPPING_TRACKER a, PFILE_MAPPING_TRACKER b)
+{
+       return ((LONG_PTR)a->BaseAddress - (LONG_PTR)b->BaseAddress);
+}
+
+#ifdef MMAP_DEBUG_INFO
+/*
+ * mmap_info -- (internal) dump info about all the mapping trackers
+ */
+static void
+mmap_info(void)
+{
+       LOG(4, NULL);
+
+       AcquireSRWLockShared(&FileMappingQLock);
+
+       PFILE_MAPPING_TRACKER mt;
+       for (mt = PMDK_SORTEDQ_FIRST(&FileMappingQHead);
+               mt != (void *)&FileMappingQHead;
+               mt = PMDK_SORTEDQ_NEXT(mt, ListEntry)) {
+
+               LOG(4, "FH %08x FMH %08x AD %p-%p (%zu) "
+                       "OF %08x FL %zu AC %d F %d",
+                       mt->FileHandle,
+                       mt->FileMappingHandle,
+                       mt->BaseAddress,
+                       mt->EndAddress,
+                       (char *)mt->EndAddress - (char *)mt->BaseAddress,
+                       mt->Offset,
+                       mt->FileLen,
+                       mt->Access,
+                       mt->Flags);
+       }
+
+       ReleaseSRWLockShared(&FileMappingQLock);
+}
+#endif
+
+/*
+ * mmap_reserve -- (internal) reserve virtual address range
+ */
+static void *
+mmap_reserve(void *addr, size_t len)
+{
+       LOG(4, "addr %p len %zu", addr, len);
+
+       ASSERTeq((uintptr_t)addr % Mmap_align, 0);
+       ASSERTeq(len % Mmap_align, 0);
+
+       void *reserved_addr = VirtualAlloc(addr, len,
+                               MEM_RESERVE, PAGE_NOACCESS);
+       if (reserved_addr == NULL) {
+               ERR("cannot find a contiguous region - "
+                       "addr: %p, len: %lx, gle: 0x%08x",
+                       addr, len, GetLastError());
+               errno = ENOMEM;
+               return MAP_FAILED;
+       }
+
+       return reserved_addr;
+}
+
+/*
+ * mmap_unreserve -- (internal) frees the range that's previously reserved
+ */
+static int
+mmap_unreserve(void *addr, size_t len)
+{
+       LOG(4, "addr %p len %zu", addr, len);
+
+       ASSERTeq((uintptr_t)addr % Mmap_align, 0);
+       ASSERTeq(len % Mmap_align, 0);
+
+       size_t bytes_returned;
+       MEMORY_BASIC_INFORMATION basic_info;
+
+       bytes_returned = VirtualQuery(addr, &basic_info, sizeof(basic_info));
+
+       if (bytes_returned != sizeof(basic_info)) {
+               ERR("cannot query the virtual address properties of the range "
+                       "- addr: %p, len: %d", addr, len);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (basic_info.State == MEM_RESERVE) {
+               DWORD nt_status;
+               void *release_addr = addr;
+               size_t release_size = len;
+               nt_status = NtFreeVirtualMemory(GetCurrentProcess(),
+                       &release_addr, &release_size, MEM_RELEASE);
+               if (nt_status != 0) {
+                       ERR("cannot release the reserved virtual space - "
+                               "addr: %p, len: %d, nt_status: 0x%08x",
+                               addr, len, nt_status);
+                       errno = EINVAL;
+                       return -1;
+               }
+               ASSERTeq(release_addr, addr);
+               ASSERTeq(release_size, len);
+               LOG(4, "freed reservation - addr: %p, size: %d", release_addr,
+                       release_size);
+       } else {
+               LOG(4, "range not reserved - addr: %p, size: %d", addr, len);
+       }
+
+       return 0;
+}
+
+/*
+ * win_mmap_init -- initialization of file mapping tracker
+ */
+void
+win_mmap_init(void)
+{
+       AcquireSRWLockExclusive(&FileMappingQLock);
+       PMDK_SORTEDQ_INIT(&FileMappingQHead);
+       ReleaseSRWLockExclusive(&FileMappingQLock);
+}
+
+/*
+ * win_mmap_fini -- file mapping tracker cleanup routine
+ */
+void
+win_mmap_fini(void)
+{
+       /*
+        * Let's make sure that no one is in the middle of updating the
+        * list by grabbing the lock.
+        */
+       AcquireSRWLockExclusive(&FileMappingQLock);
+
+       while (!PMDK_SORTEDQ_EMPTY(&FileMappingQHead)) {
+               PFILE_MAPPING_TRACKER mt;
+               mt = (PFILE_MAPPING_TRACKER)PMDK_SORTEDQ_FIRST(
+                               &FileMappingQHead);
+
+               PMDK_SORTEDQ_REMOVE(&FileMappingQHead, mt, ListEntry);
+
+               if (mt->BaseAddress != NULL)
+                       UnmapViewOfFile(mt->BaseAddress);
+
+               size_t release_size =
+                       (char *)mt->EndAddress - (char *)mt->BaseAddress;
+               /*
+                * Free reservation after file mapping (if reservation was
+                * bigger than length of mapped file)
+                */
+               void *release_addr = (char *)mt->BaseAddress + mt->FileLen;
+               mmap_unreserve(release_addr, release_size - mt->FileLen);
+
+               if (mt->FileMappingHandle != NULL)
+                       CloseHandle(mt->FileMappingHandle);
+
+               if (mt->FileHandle != NULL)
+                       CloseHandle(mt->FileHandle);
+
+               free(mt);
+       }
+       ReleaseSRWLockExclusive(&FileMappingQLock);
+}
+
+#define PROT_ALL (PROT_READ|PROT_WRITE|PROT_EXEC)
+
+/*
+ * mmap -- map file into memory
+ *
+ * XXX - If read-only mapping was created initially, it is not possible
+ * to change protection to R/W, even if the file itself was open in R/W mode.
+ * To workaround that, we could modify mmap() to create R/W mapping first,
+ * then change the protection to R/O.  This way, it should be possible
+ * to elevate permissions later.
+ */
+void *
+mmap(void *addr, size_t len, int prot, int flags, int fd, os_off_t offset)
+{
+       LOG(4, "addr %p len %zu prot %d flags %d fd %d offset %ju",
+               addr, len, prot, flags, fd, offset);
+
+       if (len == 0) {
+               ERR("invalid length: %zu", len);
+               errno = EINVAL;
+               return MAP_FAILED;
+       }
+
+       if ((prot & ~PROT_ALL) != 0) {
+               ERR("invalid flags: 0x%08x", flags);
+               /* invalid protection flags */
+               errno = EINVAL;
+               return MAP_FAILED;
+       }
+
+       if (((flags & MAP_PRIVATE) && (flags & MAP_SHARED)) ||
+           ((flags & (MAP_PRIVATE | MAP_SHARED)) == 0)) {
+               ERR("neither MAP_PRIVATE or MAP_SHARED is set, or both: 0x%08x",
+                       flags);
+               errno = EINVAL;
+               return MAP_FAILED;
+       }
+
+       /* XXX shall we use SEC_LARGE_PAGES flag? */
+       DWORD protect = 0;
+       DWORD access = 0;
+
+       /* on x86, PROT_WRITE implies PROT_READ */
+       if (prot & PROT_WRITE) {
+               if (flags & MAP_PRIVATE) {
+                       access = FILE_MAP_COPY;
+                       if (prot & PROT_EXEC)
+                               protect = PAGE_EXECUTE_WRITECOPY;
+                       else
+                               protect = PAGE_WRITECOPY;
+               } else {
+                       /* FILE_MAP_ALL_ACCESS == FILE_MAP_WRITE */
+                       access = FILE_MAP_ALL_ACCESS;
+                       if (prot & PROT_EXEC)
+                               protect = PAGE_EXECUTE_READWRITE;
+                       else
+                               protect = PAGE_READWRITE;
+               }
+       } else if (prot & PROT_READ) {
+               access = FILE_MAP_READ;
+               if (prot & PROT_EXEC)
+                       protect = PAGE_EXECUTE_READ;
+               else
+                       protect = PAGE_READONLY;
+       } else {
+               /* XXX - PAGE_NOACCESS is not supported by CreateFileMapping */
+               ERR("PAGE_NOACCESS is not supported");
+               errno = ENOTSUP;
+               return MAP_FAILED;
+       }
+
+       if (((uintptr_t)addr % Mmap_align) != 0) {
+               if ((flags & MAP_FIXED) == 0) {
+                       /* ignore invalid hint if no MAP_FIXED flag is set */
+                       addr = NULL;
+               } else {
+                       ERR("hint address is not well-aligned: %p", addr);
+                       errno = EINVAL;
+                       return MAP_FAILED;
+               }
+       }
+
+       if ((offset % Mmap_align) != 0) {
+               ERR("offset is not well-aligned: %ju", offset);
+               errno = EINVAL;
+               return MAP_FAILED;
+       }
+
+       if ((flags & MAP_FIXED) != 0) {
+               /*
+                * Free any reservations that the caller might have, also we
+                * have to unmap any existing mappings in this region as per
+                * mmap's manual.
+                * XXX - Ideally we should unmap only if the prot and flags
+                * are similar, we are deferring it as we don't rely on it
+                * yet.
+                */
+               int ret = munmap(addr, len);
+               if (ret != 0) {
+                       ERR("!munmap: addr %p len %zu", addr, len);
+                       return MAP_FAILED;
+               }
+       }
+
+       size_t len_align = roundup(len, Mmap_align);
+       size_t filelen;
+       size_t filelen_align;
+       HANDLE fh;
+       if (flags & MAP_ANON) {
+               /*
+                * In our implementation we are choosing to ignore fd when
+                * MAP_ANON is set, instead of failing.
+                */
+               fh = INVALID_HANDLE_VALUE;
+
+               /* ignore/override offset */
+               offset = 0;
+               filelen = len;
+               filelen_align = len_align;
+
+               if ((flags & MAP_NORESERVE) != 0) {
+                       /*
+                        * For anonymous mappings the meaning of MAP_NORESERVE
+                        * flag is pretty much the same as SEC_RESERVE.
+                        */
+                       protect |= SEC_RESERVE;
+               }
+       } else {
+               LARGE_INTEGER filesize;
+
+               if (fd == -1) {
+                       ERR("invalid file descriptor: %d", fd);
+                       errno = EBADF;
+                       return MAP_FAILED;
+               }
+
+               /*
+                * We need to keep file handle open for proper
+                * implementation of msync() and to hold the file lock.
+                */
+               if (!DuplicateHandle(GetCurrentProcess(),
+                               (HANDLE)_get_osfhandle(fd),
+                               GetCurrentProcess(), &fh,
+                               0, FALSE, DUPLICATE_SAME_ACCESS)) {
+                       ERR("cannot duplicate handle - fd: %d, gle: 0x%08x",
+                                       fd, GetLastError());
+                       errno = ENOMEM;
+                       return MAP_FAILED;
+               }
+
+               /*
+                * If we are asked to map more than the file size, map till the
+                * file size and reserve the following.
+                */
+
+               if (!GetFileSizeEx(fh, &filesize)) {
+                       ERR("cannot query the file size - fh: %d, gle: 0x%08x",
+                               fd, GetLastError());
+                       CloseHandle(fh);
+                       return MAP_FAILED;
+               }
+
+               if (offset >= (os_off_t)filesize.QuadPart) {
+                       errno = EINVAL;
+                       ERR("offset is beyond the file size");
+                       CloseHandle(fh);
+                       return MAP_FAILED;
+               }
+
+               /* calculate length of the mapped portion of the file */
+               filelen = filesize.QuadPart - offset;
+               if (filelen > len)
+                       filelen = len;
+               filelen_align = roundup(filelen, Mmap_align);
+
+               if ((offset + len) > (size_t)filesize.QuadPart) {
+                       /*
+                        * Reserve virtual address for the rest of range we need
+                        * to map, and free a portion in the beginning for this
+                        * allocation.
+                        */
+                       void *reserved_addr = mmap_reserve(addr, len_align);
+                       if (reserved_addr == MAP_FAILED) {
+                               ERR("cannot reserve region");
+                               CloseHandle(fh);
+                               return MAP_FAILED;
+                       }
+
+                       if (addr != reserved_addr && (flags & MAP_FIXED) != 0) {
+                               ERR("cannot find a contiguous region - "
+                                       "addr: %p, len: %lx, gle: 0x%08x",
+                                       addr, len, GetLastError());
+                               if (mmap_unreserve(reserved_addr,
+                                               len_align) != 0) {
+                                       ASSERT(FALSE);
+                                       ERR("cannot free reserved region");
+                               }
+                               errno = ENOMEM;
+                               CloseHandle(fh);
+                               return MAP_FAILED;
+                       }
+
+                       addr = reserved_addr;
+                       if (mmap_unreserve(reserved_addr, filelen_align) != 0) {
+                               ASSERT(FALSE);
+                               ERR("cannot free reserved region");
+                               CloseHandle(fh);
+                               return MAP_FAILED;
+                       }
+               }
+       }
+
+       HANDLE fmh = CreateFileMapping(fh,
+                       NULL, /* security attributes */
+                       protect,
+                       (DWORD) ((filelen + offset) >> 32),
+                       (DWORD) ((filelen + offset) & 0xFFFFFFFF),
+                       NULL);
+
+       if (fmh == NULL) {
+               DWORD gle = GetLastError();
+               ERR("CreateFileMapping, gle: 0x%08x", gle);
+               if (gle == ERROR_ACCESS_DENIED)
+                       errno = EACCES;
+               else
+                       errno = EINVAL; /* XXX */
+               CloseHandle(fh);
+               return MAP_FAILED;
+       }
+
+       void *base = MapViewOfFileEx(fmh,
+                       access,
+                       (DWORD) (offset >> 32),
+                       (DWORD) (offset & 0xFFFFFFFF),
+                       filelen,
+                       addr); /* hint address */
+
+       if (base == NULL) {
+               if (addr == NULL || (flags & MAP_FIXED) != 0) {
+                       ERR("MapViewOfFileEx, gle: 0x%08x", GetLastError());
+                       errno = EINVAL;
+                       CloseHandle(fh);
+                       CloseHandle(fmh);
+                       return MAP_FAILED;
+               }
+
+               /* try again w/o hint */
+               base = MapViewOfFileEx(fmh,
+                               access,
+                               (DWORD) (offset >> 32),
+                               (DWORD) (offset & 0xFFFFFFFF),
+                               filelen,
+                               NULL); /* no hint address */
+       }
+
+       if (base == NULL) {
+               ERR("MapViewOfFileEx, gle: 0x%08x", GetLastError());
+               errno = ENOMEM;
+               CloseHandle(fh);
+               CloseHandle(fmh);
+               return MAP_FAILED;
+       }
+
+       /*
+        * We will track the file mapping handle on a lookaside list so that
+        * we don't have to modify the fact that we only return back the base
+        * address rather than a more elaborate structure.
+        */
+
+       PFILE_MAPPING_TRACKER mt =
+               malloc(sizeof(struct FILE_MAPPING_TRACKER));
+
+       if (mt == NULL) {
+               ERR("!malloc");
+               CloseHandle(fh);
+               CloseHandle(fmh);
+               return MAP_FAILED;
+       }
+
+       mt->Flags = 0;
+       mt->FileHandle = fh;
+       mt->FileMappingHandle = fmh;
+       mt->BaseAddress = base;
+       mt->EndAddress = (void *)((char *)base + len_align);
+       mt->Access = access;
+       mt->Offset = offset;
+       mt->FileLen = filelen_align;
+
+       /*
+        * XXX: Use the QueryVirtualMemoryInformation when available in the new
+        * SDK.  If the file is DAX mapped say so in the FILE_MAPPING_TRACKER
+        * Flags.
+        */
+       DWORD filesystemFlags;
+       if (fh == INVALID_HANDLE_VALUE) {
+               LOG(4, "anonymous mapping - not DAX mapped - handle: %p", fh);
+       } else if (GetVolumeInformationByHandleW(fh, NULL, 0, NULL, NULL,
+                               &filesystemFlags, NULL, 0)) {
+               if (filesystemFlags & FILE_DAX_VOLUME) {
+                       mt->Flags |= FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED;
+               } else {
+                       LOG(4, "file is not DAX mapped - handle: %p", fh);
+               }
+       } else {
+               ERR("failed to query volume information : %08x",
+                       GetLastError());
+       }
+
+       AcquireSRWLockExclusive(&FileMappingQLock);
+
+       PMDK_SORTEDQ_INSERT(&FileMappingQHead, mt, ListEntry,
+                       FILE_MAPPING_TRACKER, mmap_file_mapping_comparer);
+
+       ReleaseSRWLockExclusive(&FileMappingQLock);
+
+#ifdef MMAP_DEBUG_INFO
+       mmap_info();
+#endif
+
+       return base;
+}
+
+/*
+ * mmap_split -- (internal) replace existing mapping with another one(s)
+ *
+ * Unmaps the region between [begin,end].  If it's in a middle of the existing
+ * mapping, it results in two new mappings and duplicated file/mapping handles.
+ */
+static int
+mmap_split(PFILE_MAPPING_TRACKER mt, void *begin, void *end)
+{
+       LOG(4, "begin %p end %p", begin, end);
+
+       ASSERTeq((uintptr_t)begin % Mmap_align, 0);
+       ASSERTeq((uintptr_t)end % Mmap_align, 0);
+
+       PFILE_MAPPING_TRACKER mtb = NULL;
+       PFILE_MAPPING_TRACKER mte = NULL;
+       HANDLE fh = mt->FileHandle;
+       HANDLE fmh = mt->FileMappingHandle;
+       size_t len;
+
+       /*
+        * In this routine we copy flags from mt to the two subsets that we
+        * create.  All flags may not be appropriate to propagate so let's
+        * assert about the flags we know, if some one adds a new flag in the
+        * future they would know about this copy and take appropricate action.
+        */
+       C_ASSERT(FILE_MAPPING_TRACKER_FLAGS_MASK == 1);
+
+       /*
+        * 1)    b    e           b     e
+        *    xxxxxxxxxxxxx => xxx.......xxxx  -  mtb+mte
+        * 2)       b     e           b     e
+        *    xxxxxxxxxxxxx => xxxxxxx.......  -  mtb
+        * 3) b     e          b      e
+        *    xxxxxxxxxxxxx => ........xxxxxx  -  mte
+        * 4) b           e    b            e
+        *    xxxxxxxxxxxxx => ..............  -  <none>
+        */
+
+       if (begin > mt->BaseAddress) {
+               /* case #1/2 */
+               /* new mapping at the beginning */
+               mtb = malloc(sizeof(struct FILE_MAPPING_TRACKER));
+               if (mtb == NULL) {
+                       ERR("!malloc");
+                       goto err;
+               }
+
+               mtb->Flags = mt->Flags;
+               mtb->FileHandle = fh;
+               mtb->FileMappingHandle = fmh;
+               mtb->BaseAddress = mt->BaseAddress;
+               mtb->EndAddress = begin;
+               mtb->Access = mt->Access;
+               mtb->Offset = mt->Offset;
+
+               len = (char *)begin - (char *)mt->BaseAddress;
+               mtb->FileLen = len >= mt->FileLen ? mt->FileLen : len;
+       }
+
+       if (end < mt->EndAddress) {
+               /* case #1/3 */
+               /* new mapping at the end */
+               mte = malloc(sizeof(struct FILE_MAPPING_TRACKER));
+               if (mte == NULL) {
+                       ERR("!malloc");
+                       goto err;
+               }
+
+               if (!mtb) {
+                       /* case #3 */
+                       mte->FileHandle = fh;
+                       mte->FileMappingHandle = fmh;
+               } else {
+                       /* case #1 - need to duplicate handles */
+                       mte->FileHandle = NULL;
+                       mte->FileMappingHandle = NULL;
+
+                       if (!DuplicateHandle(GetCurrentProcess(), fh,
+                                       GetCurrentProcess(),
+                                       &mte->FileHandle,
+                                       0, FALSE, DUPLICATE_SAME_ACCESS)) {
+                               ERR("DuplicateHandle, gle: 0x%08x",
+                                       GetLastError());
+                               goto err;
+                       }
+
+                       if (!DuplicateHandle(GetCurrentProcess(), fmh,
+                                       GetCurrentProcess(),
+                                       &mte->FileMappingHandle,
+                                       0, FALSE, DUPLICATE_SAME_ACCESS)) {
+                               ERR("DuplicateHandle, gle: 0x%08x",
+                                       GetLastError());
+                               goto err;
+                       }
+               }
+
+               mte->Flags = mt->Flags;
+               mte->BaseAddress = end;
+               mte->EndAddress = mt->EndAddress;
+               mte->Access = mt->Access;
+               mte->Offset = mt->Offset +
+                       ((char *)mte->BaseAddress - (char *)mt->BaseAddress);
+
+               len = (char *)end - (char *)mt->BaseAddress;
+               mte->FileLen = len >= mt->FileLen ? 0 : mt->FileLen - len;
+       }
+
+       if (mt->FileLen > 0 && UnmapViewOfFile(mt->BaseAddress) == FALSE) {
+               ERR("UnmapViewOfFile, gle: 0x%08x", GetLastError());
+               goto err;
+       }
+
+       len = (char *)mt->EndAddress - (char *)mt->BaseAddress;
+       if (len > mt->FileLen) {
+               void *addr = (char *)mt->BaseAddress + mt->FileLen;
+               mmap_unreserve(addr, len - mt->FileLen);
+       }
+
+       if (!mtb && !mte) {
+               /* case #4 */
+               CloseHandle(fmh);
+               CloseHandle(fh);
+       }
+
+       /*
+        * free entry for the original mapping
+        */
+       PMDK_SORTEDQ_REMOVE(&FileMappingQHead, mt, ListEntry);
+       free(mt);
+
+       if (mtb) {
+               len = (char *)mtb->EndAddress - (char *)mtb->BaseAddress;
+               if (len > mtb->FileLen) {
+                       void *addr = (char *)mtb->BaseAddress + mtb->FileLen;
+                       void *raddr = mmap_reserve(addr, len - mtb->FileLen);
+                       if (raddr == MAP_FAILED) {
+                               ERR("cannot find a contiguous region - "
+                                       "addr: %p, len: %lx, gle: 0x%08x",
+                                       addr, len, GetLastError());
+                               goto err;
+                       }
+               }
+
+               if (mtb->FileLen > 0) {
+                       void *base = MapViewOfFileEx(mtb->FileMappingHandle,
+                               mtb->Access,
+                               (DWORD) (mtb->Offset >> 32),
+                               (DWORD) (mtb->Offset & 0xFFFFFFFF),
+                               mtb->FileLen,
+                               mtb->BaseAddress); /* hint address */
+
+                       if (base == NULL) {
+                               ERR("MapViewOfFileEx, gle: 0x%08x",
+                                               GetLastError());
+                               goto err;
+                       }
+               }
+
+               PMDK_SORTEDQ_INSERT(&FileMappingQHead, mtb, ListEntry,
+                       FILE_MAPPING_TRACKER, mmap_file_mapping_comparer);
+       }
+
+       if (mte) {
+               len = (char *)mte->EndAddress - (char *)mte->BaseAddress;
+               if (len > mte->FileLen) {
+                       void *addr = (char *)mte->BaseAddress + mte->FileLen;
+                       void *raddr = mmap_reserve(addr, len - mte->FileLen);
+                       if (raddr == MAP_FAILED) {
+                               ERR("cannot find a contiguous region - "
+                                       "addr: %p, len: %lx, gle: 0x%08x",
+                                       addr, len, GetLastError());
+                               goto err;
+                       }
+               }
+
+               if (mte->FileLen > 0) {
+                       void *base = MapViewOfFileEx(mte->FileMappingHandle,
+                               mte->Access,
+                               (DWORD) (mte->Offset >> 32),
+                               (DWORD) (mte->Offset & 0xFFFFFFFF),
+                               mte->FileLen,
+                               mte->BaseAddress); /* hint address */
+
+                       if (base == NULL) {
+                               ERR("MapViewOfFileEx, gle: 0x%08x",
+                                               GetLastError());
+                               goto err_mte;
+                       }
+               }
+
+               PMDK_SORTEDQ_INSERT(&FileMappingQHead, mte, ListEntry,
+                       FILE_MAPPING_TRACKER, mmap_file_mapping_comparer);
+       }
+
+       return 0;
+
+err:
+       if (mtb) {
+               ASSERTeq(mtb->FileMappingHandle, fmh);
+               ASSERTeq(mtb->FileHandle, fh);
+               CloseHandle(mtb->FileMappingHandle);
+               CloseHandle(mtb->FileHandle);
+
+               len = (char *)mtb->EndAddress - (char *)mtb->BaseAddress;
+               if (len > mtb->FileLen) {
+                       void *addr = (char *)mtb->BaseAddress + mtb->FileLen;
+                       mmap_unreserve(addr, len - mtb->FileLen);
+               }
+       }
+
+err_mte:
+       if (mte) {
+               if (mte->FileMappingHandle)
+                       CloseHandle(mte->FileMappingHandle);
+               if (mte->FileHandle)
+                       CloseHandle(mte->FileHandle);
+
+               len = (char *)mte->EndAddress - (char *)mte->BaseAddress;
+               if (len > mte->FileLen) {
+                       void *addr = (char *)mte->BaseAddress + mte->FileLen;
+                       mmap_unreserve(addr, len - mte->FileLen);
+               }
+       }
+
+       free(mtb);
+       free(mte);
+       return -1;
+}
+
+/*
+ * munmap -- delete mapping
+ */
+int
+munmap(void *addr, size_t len)
+{
+       LOG(4, "addr %p len %zu", addr, len);
+
+       if (((uintptr_t)addr % Mmap_align) != 0) {
+               ERR("address is not well-aligned: %p", addr);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (len == 0) {
+               ERR("invalid length: %zu", len);
+               errno = EINVAL;
+               return -1;
+       }
+
+       int retval = -1;
+
+       if (len > UINTPTR_MAX - (uintptr_t)addr) {
+               /* limit len to not get beyond address space */
+               len = UINTPTR_MAX - (uintptr_t)addr;
+       }
+
+       void *begin = addr;
+       void *end = (void *)((char *)addr + len);
+
+       AcquireSRWLockExclusive(&FileMappingQLock);
+
+       PFILE_MAPPING_TRACKER mt;
+       PFILE_MAPPING_TRACKER next;
+       for (mt = PMDK_SORTEDQ_FIRST(&FileMappingQHead);
+               mt != (void *)&FileMappingQHead;
+               mt = next) {
+
+               /*
+                * Pick the next entry before we split there by delete the
+                * this one (NOTE: mmap_spilt could delete this entry).
+                */
+               next = PMDK_SORTEDQ_NEXT(mt, ListEntry);
+
+               if (mt->BaseAddress >= end) {
+                       LOG(4, "ignoring all mapped ranges beyond given range");
+                       break;
+               }
+
+               if (mt->EndAddress <= begin) {
+                       LOG(4, "skipping a mapped range before given range");
+                       continue;
+               }
+
+               void *begin2 = begin > mt->BaseAddress ?
+                               begin : mt->BaseAddress;
+               void *end2 = end < mt->EndAddress ?
+                               end : mt->EndAddress;
+
+               size_t len2 = (char *)end2 - (char *)begin2;
+
+               void *align_end = (void *)roundup((uintptr_t)end2, Mmap_align);
+               if (mmap_split(mt, begin2, align_end) != 0) {
+                       LOG(2, "mapping split failed");
+                       goto err;
+               }
+
+               if (len > len2) {
+                       len -= len2;
+               } else {
+                       len = 0;
+                       break;
+               }
+       }
+
+       /*
+        * If we didn't find any mapped regions in our list attempt to free
+        * as if the entire range is reserved.
+        *
+        * XXX: We don't handle a range having few mapped regions and few
+        * reserved regions.
+        */
+       if (len > 0)
+               mmap_unreserve(addr, roundup(len, Mmap_align));
+
+       retval = 0;
+
+err:
+       ReleaseSRWLockExclusive(&FileMappingQLock);
+
+       if (retval == -1)
+               errno = EINVAL;
+
+#ifdef MMAP_DEBUG_INFO
+       mmap_info();
+#endif
+
+       return retval;
+}
+
+#define MS_ALL (MS_SYNC|MS_ASYNC|MS_INVALIDATE)
+
+/*
+ * msync -- synchronize a file with a memory map
+ */
+int
+msync(void *addr, size_t len, int flags)
+{
+       LOG(4, "addr %p len %zu flags %d", addr, len, flags);
+
+       if ((flags & ~MS_ALL) != 0) {
+               ERR("invalid flags: 0x%08x", flags);
+               errno = EINVAL;
+               return -1;
+       }
+
+       /*
+        * XXX - On Linux it is allowed to call msync() without MS_SYNC
+        * nor MS_ASYNC.
+        */
+       if (((flags & MS_SYNC) && (flags & MS_ASYNC)) ||
+           ((flags & (MS_SYNC | MS_ASYNC)) == 0)) {
+               ERR("neither MS_SYNC or MS_ASYNC is set, or both: 0x%08x",
+                       flags);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (((uintptr_t)addr % Pagesize) != 0) {
+               ERR("address is not page-aligned: %p", addr);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (len == 0) {
+               LOG(4, "zero-length region - do nothing");
+               return 0; /* do nothing */
+       }
+
+       if (len > UINTPTR_MAX - (uintptr_t)addr) {
+               /* limit len to not get beyond address space */
+               len = UINTPTR_MAX - (uintptr_t)addr;
+       }
+
+       int retval = -1;
+
+       void *begin = addr;
+       void *end = (void *)((char *)addr + len);
+
+       AcquireSRWLockShared(&FileMappingQLock);
+
+       PFILE_MAPPING_TRACKER mt;
+       PMDK_SORTEDQ_FOREACH(mt, &FileMappingQHead, ListEntry) {
+               if (mt->BaseAddress >= end) {
+                       LOG(4, "ignoring all mapped ranges beyond given range");
+                       break;
+               }
+               if (mt->EndAddress <= begin) {
+                       LOG(4, "skipping a mapped range before given range");
+                       continue;
+               }
+
+               void *begin2 = begin > mt->BaseAddress ?
+                       begin : mt->BaseAddress;
+               void *end2 = end < mt->EndAddress ?
+                       end : mt->EndAddress;
+
+               size_t len2 = (char *)end2 - (char *)begin2;
+
+               /* do nothing for anonymous mappings */
+               if (mt->FileHandle != INVALID_HANDLE_VALUE) {
+                       if (FlushViewOfFile(begin2, len2) == FALSE) {
+                               ERR("FlushViewOfFile, gle: 0x%08x",
+                                       GetLastError());
+                               errno = ENOMEM;
+                               goto err;
+                       }
+
+                       if (FlushFileBuffers(mt->FileHandle) == FALSE) {
+                               ERR("FlushFileBuffers, gle: 0x%08x",
+                                       GetLastError());
+                               errno = EINVAL;
+                               goto err;
+                       }
+               }
+
+               if (len > len2) {
+                       len -= len2;
+               } else {
+                       len = 0;
+                       break;
+               }
+       }
+
+       if (len > 0) {
+               ERR("indicated memory (or part of it) was not mapped");
+               errno = ENOMEM;
+       } else {
+               retval = 0;
+       }
+
+err:
+       ReleaseSRWLockShared(&FileMappingQLock);
+       return retval;
+}
+
+#define PROT_ALL (PROT_READ|PROT_WRITE|PROT_EXEC)
+
+/*
+ * mprotect -- set protection on a region of memory
+ *
+ * XXX - If the memory range passed to mprotect() includes invalid pages,
+ * returned status will indicate error, and errno is set to ENOMEM.
+ * However, the protection change is actually applied to all the valid pages,
+ * ignoring the rest.
+ * This is different than on Linux, where it stops on the first invalid page.
+ */
+int
+mprotect(void *addr, size_t len, int prot)
+{
+       LOG(4, "addr %p len %zu prot %d", addr, len, prot);
+
+       if (((uintptr_t)addr % Pagesize) != 0) {
+               ERR("address is not page-aligned: %p", addr);
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (len == 0) {
+               LOG(4, "zero-length region - do nothing");
+               return 0; /* do nothing */
+       }
+
+       if (len > UINTPTR_MAX - (uintptr_t)addr) {
+               len = UINTPTR_MAX - (uintptr_t)addr;
+               LOG(4, "limit len to %zu to not get beyond address space", len);
+       }
+
+       DWORD protect = 0;
+
+       if ((prot & PROT_READ) && (prot & PROT_WRITE)) {
+               protect |= PAGE_READWRITE;
+               if (prot & PROT_EXEC)
+                       protect |= PAGE_EXECUTE_READWRITE;
+       } else if (prot & PROT_READ) {
+               protect |= PAGE_READONLY;
+               if (prot & PROT_EXEC)
+                       protect |= PAGE_EXECUTE_READ;
+       } else {
+               protect |= PAGE_NOACCESS;
+       }
+
+       int retval = -1;
+
+       void *begin = addr;
+       void *end = (void *)((char *)addr + len);
+
+       AcquireSRWLockShared(&FileMappingQLock);
+
+       PFILE_MAPPING_TRACKER mt;
+       PMDK_SORTEDQ_FOREACH(mt, &FileMappingQHead, ListEntry) {
+               if (mt->BaseAddress >= end) {
+                       LOG(4, "ignoring all mapped ranges beyond given range");
+                       break;
+               }
+               if (mt->EndAddress <= begin) {
+                       LOG(4, "skipping a mapped range before given range");
+                       continue;
+               }
+
+               void *begin2 = begin > mt->BaseAddress ?
+                               begin : mt->BaseAddress;
+               void *end2 = end < mt->EndAddress ?
+                               end : mt->EndAddress;
+
+               /*
+                * protect of region to VirtualProtection must be compatible
+                * with the access protection specified for this region
+                * when the view was mapped using MapViewOfFileEx
+                */
+               if (mt->Access == FILE_MAP_COPY) {
+                       if (protect & PAGE_READWRITE) {
+                               protect &= ~PAGE_READWRITE;
+                               protect |= PAGE_WRITECOPY;
+                       } else if (protect & PAGE_EXECUTE_READWRITE) {
+                               protect &= ~PAGE_EXECUTE_READWRITE;
+                               protect |= PAGE_EXECUTE_WRITECOPY;
+                       }
+               }
+
+               size_t len2 = (char *)end2 - (char *)begin2;
+
+               DWORD oldprot = 0;
+               BOOL ret;
+               ret = VirtualProtect(begin2, len2, protect, &oldprot);
+               if (ret == FALSE) {
+                       DWORD gle = GetLastError();
+                       ERR("VirtualProtect, gle: 0x%08x", gle);
+                       /* translate error code */
+                       switch (gle) {
+                               case ERROR_INVALID_PARAMETER:
+                                       errno = EACCES;
+                                       break;
+                               case ERROR_INVALID_ADDRESS:
+                                       errno = ENOMEM;
+                                       break;
+                               default:
+                                       errno = EINVAL;
+                                       break;
+                       }
+                       goto err;
+               }
+
+               if (len > len2) {
+                       len -= len2;
+               } else {
+                       len = 0;
+                       break;
+               }
+       }
+
+       if (len > 0) {
+               ERR("indicated memory (or part of it) was not mapped");
+               errno = ENOMEM;
+       } else {
+               retval = 0;
+       }
+
+err:
+       ReleaseSRWLockShared(&FileMappingQLock);
+       return retval;
+}
diff --git a/ceph/src/pmdk/utils/CHECK_WHITESPACE.PS1 b/ceph/src/pmdk/utils/CHECK_WHITESPACE.PS1
new file mode 100644 (file)
index 0000000..5ffeedc
--- /dev/null
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2017, Intel Corporation
+#
+# CHECK_WHITESPACE.PS1 -- script to check coding style
+#
+# XXX - integrate with VS projects and execute for each build
+#
+
+$scriptdir = Split-Path -Parent $PSCommandPath
+$rootdir = $scriptdir + "\.."
+$whitepace = $rootdir + "\utils\check_whitespace"
+
+If ( Get-Command -Name perl -ErrorAction SilentlyContinue ) {
+       &perl $whitepace -g
+       if ($LASTEXITCODE -ne 0) {
+                       Exit $LASTEXITCODE
+       }
+} else {
+       Write-Output "Cannot execute check_whitespace - perl is missing"
+}
diff --git a/ceph/src/pmdk/utils/CREATE-ZIP.PS1 b/ceph/src/pmdk/utils/CREATE-ZIP.PS1
new file mode 100644 (file)
index 0000000..902cb07
--- /dev/null
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2019, Intel Corporation
+#
+# CREATE-ZIP.PS1 -- script to create release zip package
+#
+
+#
+# parameter handling
+#
+[CmdletBinding(PositionalBinding=$false)]
+Param(
+    [alias("b")]
+    $build = "debug",
+    [alias("v")]
+    $version = "0",
+    [alias("e")]
+    $extended = "0"
+    )
+
+$scriptdir = Split-Path -Parent $PSCommandPath
+$rootdir = $scriptdir + "\..\"
+
+$builddir = $rootdir + "\src\x64\"
+$zipdir = $builddir + "\pmdk\"
+
+if ($version -eq "0") {
+    $git = Get-Command -Name git -ErrorAction SilentlyContinue
+    if ($git) {
+        $version = $(git describe)
+    } else {
+        $version = "0"
+    }
+}
+
+$zipfile = $builddir + "\pmdk-" + $version + "-win-x64-" + $build + ".zip"
+
+Remove-Item $zipdir -Force -Recurse -ea si
+Get-ChildItem | Where-Object {$_.Name -Match "pmdk-.*-win-x64.zip"} | Remove-Item -Force -ea si
+New-Item -ItemType directory -Path ( $zipdir) -Force | Out-Null
+New-Item -ItemType directory -Path ( $zipdir + "\bin\") -Force | Out-Null
+New-Item -ItemType directory -Path ( $zipdir + "\lib\") -Force | Out-Null
+
+$libs = @("libpmem", "libpmemblk", "libpmemlog", "libpmemobj", "libpmempool")
+$apps = @("pmempool")
+$apps_extended =  @("pmempool", "pmemalloc", "pmemdetect", "pmemspoil", "pmemwrite")
+
+if ($extended -eq "1") {
+    $apps = $apps_extended
+}
+
+foreach ($lib in $libs) {
+    Copy-Item ($builddir + $build + "\libs\" + $lib + ".dll") ($zipdir + "\bin\")
+    foreach ($ex in @(".lib", ".pdb")) {
+        Copy-Item ($builddir + $build + "\libs\" + $lib + $ex) ($zipdir + "\lib\")
+    }
+}
+foreach ($app in $apps) {
+       if ($app -eq "pmempool") {
+               Copy-Item ($builddir + $build + "\libs\" + $app + ".exe") ($zipdir + "\bin\")
+               Copy-Item ($builddir + $build + "\libs\" + $app + ".pdb") ($zipdir + "\lib\")
+       } else {
+               Copy-Item ($builddir + $build + "\tests\" + $app + ".exe") ($zipdir + "\bin\")
+               Copy-Item ($builddir + $build + "\tests\" + $app + ".pdb") ($zipdir + "\lib\")
+       }
+}
+
+Copy-Item -Recurse ($rootdir + "src\include") ($zipdir)
+Remove-Item -Force ($zipdir + "include\.cstyleignore")
+Remove-Item -Force ($zipdir + "include\README")
+Remove-Item -Force ($zipdir + "include\librpmem.h")
+Copy-Item ($rootdir + "README.md") ($zipdir)
+Copy-Item ($rootdir + "LICENSE") ($zipdir)
+Copy-Item ($rootdir + "ChangeLog") ($zipdir)
+
+Add-Type -Assembly System.IO.Compression.FileSystem
+$comprlevel = [System.IO.Compression.CompressionLevel]::Optimal
+
+if (Test-Path  ($zipdir)) {
+    [System.IO.Compression.ZipFile]::CreateFromDirectory($zipdir, $zipfile,
+        $comprlevel, $true)
+}
+
+Remove-Item $zipdir -Force -Recurse -ea si
diff --git a/ceph/src/pmdk/utils/CSTYLE.ps1 b/ceph/src/pmdk/utils/CSTYLE.ps1
new file mode 100644 (file)
index 0000000..42b22b3
--- /dev/null
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2017, Intel Corporation
+#
+# CSTYLE.ps1 -- script to check coding style
+#
+# XXX - integrate with VS projects and execute for each build
+#
+
+$scriptdir = Split-Path -Parent $PSCommandPath
+$rootdir = $scriptdir + "\.."
+$cstyle = $rootdir + "\utils\cstyle"
+$checkdir = $rootdir
+
+# XXX - *.cpp/*.hpp files not supported yet
+$include = @( "*.c", "*.h" )
+
+If ( Get-Command -Name perl -ErrorAction SilentlyContinue ) {
+       Get-ChildItem -Path $checkdir -Recurse -Include $include | `
+    Where-Object { $_.FullName -notlike "*jemalloc*" } | `
+    ForEach-Object {
+        $IGNORE = $_.DirectoryName + "\.cstyleignore"
+        if(Test-Path $IGNORE) {
+            if((Select-String $_.Name $IGNORE)) {
+                return
+            }
+        }
+        $_
+    } | ForEach-Object {
+               Write-Output $_.FullName
+               & perl $cstyle $_.FullName
+               if ($LASTEXITCODE -ne 0) {
+            Exit $LASTEXITCODE
+        }
+    }
+} else {
+       Write-Output "Cannot execute cstyle - perl is missing"
+}
diff --git a/ceph/src/pmdk/utils/Makefile b/ceph/src/pmdk/utils/Makefile
new file mode 100644 (file)
index 0000000..1435288
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+rwildcard=$(strip $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)\
+       $(filter $(subst *,%,$2),$d)))
+
+SCRIPTS = $(call rwildcard,,*.sh)
+
+cstyle:
+       ./check-shebang.sh $(SCRIPTS)
+
+.PHONY: cstyle
diff --git a/ceph/src/pmdk/utils/README b/ceph/src/pmdk/utils/README
new file mode 100644 (file)
index 0000000..07a762c
--- /dev/null
@@ -0,0 +1,5 @@
+Persistent Memory Development Kit
+
+This is utils/README.
+
+The scripts found here are used during library development.
diff --git a/ceph/src/pmdk/utils/SRCVERSION.ps1 b/ceph/src/pmdk/utils/SRCVERSION.ps1
new file mode 100644 (file)
index 0000000..8e6e436
--- /dev/null
@@ -0,0 +1,158 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# SRCVERSION.PS1 -- script to create SCRVERSION macro and generate srcversion.h
+#
+
+#
+# Windows dll versioning supports only fixed number of fields. The most
+# important are MAJOR, MINOR and REVISION. We have 3-compoment releases
+# (e.g. 1.5.1) with release candidates, so we have to encode this information
+# into this fixed number of fields. That's why we abuse REVISION to encode both
+# 3rd component and rc status.
+# REVISION = 3RDCOMP * 1000 + (!is_rc) * 100 + rc.
+#
+# Examples:
+# +---------------------+-----+-----+--------+-----+------+-------+----------+
+# |git describe --long  |MAJOR|MINOR|REVISION|BUILD|BUGFIX|PRIVATE|PRERELEASE|
+# +---------------------+-----+-----+--------+-----+------+-------+----------+
+# |1.5-rc2-0-12345678   |    1|    5|       2|    0| false|  false|      true|
+# |1.5-rc3-6-12345678   |    1|    5|       3|    6| false|   true|      true|
+# |1.5-0-12345678       |    1|    5|     100|    0| false|  false|     false|
+# |1.5-6-123345678      |    1|    5|     100|    6| false|   true|     false|
+# |1.5.2-rc1-0-12345678 |    1|    5|    2001|    0|  true|  false|      true|
+# |1.5.2-rc4-6-12345678 |    1|    5|    2004|    6|  true|   true|      true|
+# |1.5.2-0-12345678     |    1|    5|    2100|    0|  true|  false|     false|
+# |1.5.2-6-12345678     |    1|    5|    2100|    6|  true|   true|     false|
+# +---------------------+-----+-----+--------+-----+------+-------+----------+
+#
+
+$scriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
+$file_path = $scriptPath + "\..\src\windows\include\srcversion.h"
+$git_version_file = $scriptPath + "\..\GIT_VERSION"
+$version_file = $scriptPath + "\..\VERSION"
+$git = Get-Command -Name git -ErrorAction SilentlyContinue
+
+if (Test-Path $file_path) {
+    $old_src_version = Get-Content $file_path | `
+        Where-Object { $_ -like '#define SRCVERSION*' }
+} else {
+    $old_src_version = ""
+}
+
+$git_version = ""
+$git_version_hash = ""
+
+if (Test-Path $git_version_file) {
+    $git_version = Get-Content $git_version_file
+    if ($git_version -eq "`$Format:%h`$") {
+        $git_version = ""
+    } else {
+        $git_version_hash = $git_version
+    }
+}
+
+$PRERELEASE = $false
+$BUGFIX = $false
+$PRIVATE = $true
+$CUSTOM = $false
+
+if ($null -ne $args[0]) {
+    $version = $args[0]
+    $ver_array = $version.split("-+")
+} elseif (Test-Path $version_file) {
+    $version = Get-Content $version_file
+    $ver_array = $version.split("-+")
+} elseif ($git_version_hash -ne "") {
+    $MAJOR = 0
+    $MINOR = 0
+    $REVISION = 0
+    $BUILD = 0
+
+    $version = $git_version_hash
+    $CUSTOM = $true
+    $version_custom_msg = "#define VERSION_CUSTOM_MSG `"$git_version_hash`""
+} elseif ($null -ne $git) {
+    $version = $(git describe)
+    $ver_array = $(git describe --long).split("-+")
+} else {
+    $MAJOR = 0
+    $MINOR = 0
+    $REVISION = 0
+    $BUILD = 0
+
+    $version = "UNKNOWN_VERSION"
+    $CUSTOM = $true
+    $version_custom_msg = "#define VERSION_CUSTOM_MSG `"UNKNOWN_VERSION`""
+}
+
+if ($null -ne $ver_array) {
+    $ver_dots = $ver_array[0].split(".")
+    $MAJOR = $ver_dots[0]
+    $MINOR = $ver_dots[1]
+    if ($ver_dots.length -ge 3) {
+        $REV = $ver_dots[2]
+        $BUGFIX = $true
+    } else {
+        $REV = 0
+    }
+
+    $REVISION = 1000 * $REV
+    $BUILD = $ver_array[$ver_array.length - 2]
+
+    if ($ver_array.length -eq 4) {
+        # <MAJOR>.<MINOR>[.<BUGFIX>]-<SUFFIX><REVISION>-<BUILD>-<HASH>
+
+        if ($ver_array[1].StartsWith("rc")) {
+            # <MAJOR>.<MINOR>[.<BUGFIX>]-rc<REVISION>-<BUILD>-<HASH>
+            $REVISION += $ver_array[1].Substring("rc".Length)
+            $PRERELEASE = $true
+            $version = "$($ver_array[0])-$($ver_array[1])+git$($ver_array[2]).$($ver_array[3])"
+        } else {
+            # <MAJOR>.<MINOR>[.<BUGFIX>]-<SOMETHING>-<BUILD>-<HASH>
+            throw "Unknown version format"
+        }
+    } else {
+        # <MAJOR>.<MINOR>[.<BUGFIX>]-<BUILD>-<HASH>
+        $REVISION += 100
+        $version = "$($ver_array[0])+git$($ver_array[1]).$($ver_array[2])"
+    }
+
+    if ($BUILD -eq 0) {
+        # it is not a (pre)release build
+        $PRIVATE = $false
+    }
+}
+
+$src_version = "#define SRCVERSION `"$version`""
+
+if ($old_src_version -eq $src_version) {
+    exit 0
+}
+
+Write-Output "updating source version: $version"
+Write-Output $src_version > $file_path
+
+Write-Output "#ifdef RC_INVOKED" >> $file_path
+
+Write-Output "#define MAJOR $MAJOR" >> $file_path
+Write-Output "#define MINOR $MINOR" >> $file_path
+Write-Output "#define REVISION $REVISION" >> $file_path
+Write-Output "#define BUILD $BUILD" >> $file_path
+
+if ($PRERELEASE) {
+    Write-Output "#define PRERELEASE 1"  >> $file_path
+}
+if ($BUGFIX) {
+    Write-Output "#define BUGFIX 1"  >> $file_path
+}
+if ($PRIVATE) {
+    Write-Output "#define PRIVATE 1"  >> $file_path
+}
+if ($CUSTOM) {
+    Write-Output "#define CUSTOM 1"  >> $file_path
+    Write-Output $version_custom_msg  >> $file_path
+}
+
+Write-Output "#endif" >> $file_path
diff --git a/ceph/src/pmdk/utils/build-dpkg.sh b/ceph/src/pmdk/utils/build-dpkg.sh
new file mode 100755 (executable)
index 0000000..cb96f41
--- /dev/null
@@ -0,0 +1,836 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# build-dpkg.sh - Script for building deb packages
+#
+
+set -e
+
+SCRIPT_DIR=$(dirname $0)
+source $SCRIPT_DIR/pkg-common.sh
+
+#
+# usage -- print usage message and exit
+#
+usage()
+{
+       [ "$1" ] && echo Error: $1
+       cat >&2 <<EOF
+Usage: $0 [ -h ] -t version-tag -s source-dir -w working-dir -o output-dir
+       [ -e build-experimental ] [ -c run-check ]
+       [ -n with-ndctl ] [ -f testconfig-file ]
+
+-h                     print this help message
+-t version-tag         source version tag
+-s source-dir          source directory
+-w working-dir         working directory
+-o output-dir          output directory
+-e build-experimental  build experimental packages
+-c run-check           run package check
+-n with-ndctl          build with libndctl
+-f testconfig-file     custom testconfig.sh
+EOF
+       exit 1
+}
+
+#
+# command-line argument processing...
+#
+args=`getopt he:c:r:n:t:d:s:w:o:f: $*`
+[ $? != 0 ] && usage
+set -- $args
+for arg
+do
+       receivetype=auto
+       case "$arg"
+       in
+       -e)
+               EXPERIMENTAL="$2"
+               shift 2
+               ;;
+       -c)
+               BUILD_PACKAGE_CHECK="$2"
+               shift 2
+               ;;
+       -f)
+               TEST_CONFIG_FILE="$2"
+               shift 2
+               ;;
+       -r)
+               BUILD_RPMEM="$2"
+               shift 2
+               ;;
+       -n)
+               NDCTL_ENABLE="$2"
+               shift 2
+               ;;
+       -t)
+               PACKAGE_VERSION_TAG="$2"
+               shift 2
+               ;;
+       -s)
+               SOURCE="$2"
+               shift 2
+               ;;
+       -w)
+               WORKING_DIR="$2"
+               shift 2
+               ;;
+       -o)
+               OUT_DIR="$2"
+               shift 2
+               ;;
+       --)
+               shift
+               break
+               ;;
+       esac
+done
+
+# check for mandatory arguments
+if [ -z "$PACKAGE_VERSION_TAG" -o -z "$SOURCE" -o -z "$WORKING_DIR" -o -z "$OUT_DIR" ]
+then
+       error "Mandatory arguments missing"
+       usage
+fi
+
+PMEM2_INSTALL="y"
+
+PREFIX=usr
+LIB_DIR=$PREFIX/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
+INC_DIR=$PREFIX/include
+MAN1_DIR=$PREFIX/share/man/man1
+MAN3_DIR=$PREFIX/share/man/man3
+MAN5_DIR=$PREFIX/share/man/man5
+MAN7_DIR=$PREFIX/share/man/man7
+
+DOC_DIR=$PREFIX/share/doc
+if [ "$EXTRA_CFLAGS_RELEASE" = "" ]; then
+       export EXTRA_CFLAGS_RELEASE="-ggdb -fno-omit-frame-pointer"
+fi
+
+LIBFABRIC_MIN_VERSION=1.4.2
+NDCTL_MIN_VERSION=60.1
+
+function convert_changelog() {
+       while read line
+       do
+               if [[ $line =~ $REGEX_DATE_AUTHOR ]]
+               then
+                       DATE="${BASH_REMATCH[1]}"
+                       AUTHOR="${BASH_REMATCH[2]}"
+                       echo "  * ${DATE} ${AUTHOR}"
+               elif [[ $line =~ $REGEX_MESSAGE_START ]]
+               then
+                       MESSAGE="${BASH_REMATCH[1]}"
+                       echo "  - ${MESSAGE}"
+               elif [[ $line =~ $REGEX_MESSAGE ]]
+               then
+                       MESSAGE="${BASH_REMATCH[1]}"
+                       echo "    ${MESSAGE}"
+               fi
+       done < $1
+}
+
+function rpmem_install_triggers_overrides() {
+cat << EOF > debian/librpmem.install
+$LIB_DIR/librpmem.so.*
+EOF
+
+cat << EOF > debian/librpmem.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+librpmem: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/librpmem-dev.install
+$LIB_DIR/pmdk_debug/librpmem.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/librpmem.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/librpmem.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/librpmem.so
+$LIB_DIR/pkgconfig/librpmem.pc
+$INC_DIR/librpmem.h
+$MAN7_DIR/librpmem.7
+$MAN3_DIR/rpmem_*.3
+EOF
+
+cat << EOF > debian/librpmem-dev.triggers
+interest man-db
+EOF
+
+cat << EOF > debian/librpmem-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+EOF
+
+cat << EOF > debian/rpmemd.install
+usr/bin/rpmemd
+$MAN1_DIR/rpmemd.1
+EOF
+
+cat << EOF > debian/rpmemd.triggers
+interest man-db
+EOF
+
+cat << EOF > debian/rpmemd.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+EOF
+}
+
+function append_rpmem_control() {
+cat << EOF >> $CONTROL_FILE
+
+Package: librpmem
+Architecture: any
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory remote access support library
+ librpmem provides low-level support for remote access to persistent memory
+ (pmem) utilizing RDMA-capable RNICs. The library can be used to replicate
+ remotely a memory region over RDMA protocol. It utilizes appropriate
+ persistency mechanism based on remote node’s platform capabilities. The
+ librpmem utilizes the ssh client to authenticate a user on remote node and for
+ encryption of connection’s out-of-band configuration data.
+ .
+ This library is for applications that use remote persistent memory directly,
+ without the help of any library-supplied transactions or memory allocation.
+ Higher-level libraries that build on libpmem are available and are recommended
+ for most applications.
+
+Package: librpmem-dev
+Section: libdevel
+Architecture: any
+Depends: librpmem (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for librpmem
+ librpmem provides low-level support for remote access to persistent memory
+ (pmem) utilizing RDMA-capable RNICs.
+ .
+ This package contains libraries and header files used for linking programs
+ against librpmem.
+
+Package: rpmemd
+Section: misc
+Architecture: any
+Priority: optional
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: rpmem daemon
+ Daemon for Remote Persistent Memory support.
+EOF
+}
+
+function libpmem2_install_triggers_overrides() {
+cat << EOF > debian/libpmem2.install
+$LIB_DIR/libpmem2.so.*
+EOF
+
+cat << EOF > debian/libpmem2.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmem2: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmem2-dev.install
+$LIB_DIR/pmdk_debug/libpmem2.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmem2.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmem2.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmem2.so
+$LIB_DIR/pkgconfig/libpmem2.pc
+$INC_DIR/libpmem2.h
+$MAN7_DIR/libpmem2.7
+$MAN3_DIR/pmem2_*.3
+EOF
+
+cat << EOF > debian/libpmem2-dev.triggers
+interest man-db
+EOF
+
+cat << EOF > debian/libpmem2-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+EOF
+}
+
+function append_libpmem2_control() {
+cat << EOF >> $CONTROL_FILE
+
+Package: libpmem2
+Architecture: any
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory low level support library
+ libpmem2 provides low level persistent memory support. In particular, support
+ for the persistent memory instructions for flushing changes to pmem is
+ provided.
+
+Package: libpmem2-dev
+Section: libdevel
+Architecture: any
+Depends: libpmem2 (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmem2
+ libpmem2 provides low level persistent memory support. In particular, support
+ for the persistent memory instructions for flushing changes to pmem is
+ provided.
+EOF
+}
+
+function daxio_install_triggers_overrides() {
+cat << EOF > debian/daxio.install
+usr/bin/daxio
+$MAN1_DIR/daxio.1
+EOF
+
+cat << EOF > debian/daxio.triggers
+interest man-db
+EOF
+
+cat << EOF > debian/daxio.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+EOF
+}
+
+function append_daxio_control() {
+cat << EOF >> $CONTROL_FILE
+
+Package: daxio
+Section: misc
+Architecture: any
+Priority: optional
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: dd-like tool to read/write to a devdax device
+ The daxio utility performs I/O on Device DAX devices or zeroes a Device
+ DAX device.  Since the standard I/O APIs (read/write) cannot be used
+ with Device DAX, data transfer is performed on a memory-mapped device.
+ The daxio may be used to dump Device DAX data to a file, restore data from
+ a backup copy, move/copy data to another device or to erase data from
+ a device.
+EOF
+}
+
+if [ "${BUILD_PACKAGE_CHECK}" == "y" ]
+then
+CHECK_CMD="
+override_dh_auto_test:
+       dh_auto_test
+       if [ -f $TEST_CONFIG_FILE ]; then\
+               cp $TEST_CONFIG_FILE src/test/testconfig.sh;\
+       else\
+               echo 'PMEM_FS_DIR=/tmp' > src/test/testconfig.sh; \
+               echo 'PMEM_FS_DIR_FORCE_PMEM=1' >> src/test/testconfig.sh; \
+               echo 'TEST_BUILD=\"debug nondebug\"' >> src/test/testconfig.sh; \
+               echo 'TEST_FS=\"pmem any none\"' >> src/test/testconfig.sh; \
+       fi
+       make pcheck ${PCHECK_OPTS}
+"
+else
+CHECK_CMD="
+override_dh_auto_test:
+
+"
+fi
+
+check_tool debuild
+check_tool dch
+check_file $SCRIPT_DIR/pkg-config.sh
+
+source $SCRIPT_DIR/pkg-config.sh
+
+PACKAGE_VERSION=$(get_version $PACKAGE_VERSION_TAG)
+PACKAGE_RELEASE=1
+PACKAGE_SOURCE=${PACKAGE_NAME}-${PACKAGE_VERSION}
+PACKAGE_TARBALL_ORIG=${PACKAGE_NAME}_${PACKAGE_VERSION}.orig.tar.gz
+MAGIC_INSTALL=utils/magic-install.sh
+MAGIC_UNINSTALL=utils/magic-uninstall.sh
+CONTROL_FILE=debian/control
+
+[ -d $WORKING_DIR ] || mkdir $WORKING_DIR
+[ -d $OUT_DIR ] || mkdir $OUT_DIR
+
+OLD_DIR=$PWD
+
+cd $WORKING_DIR
+
+check_dir $SOURCE
+
+mv $SOURCE $PACKAGE_SOURCE
+tar zcf $PACKAGE_TARBALL_ORIG $PACKAGE_SOURCE
+
+cd $PACKAGE_SOURCE
+
+rm -rf debian
+mkdir debian
+
+# Generate compat file
+cat << EOF > debian/compat
+9
+EOF
+
+# Generate control file
+cat << EOF > $CONTROL_FILE
+Source: $PACKAGE_NAME
+Maintainer: $PACKAGE_MAINTAINER
+Section: libs
+Priority: optional
+Standards-version: 4.1.4
+Build-Depends: debhelper (>= 9)
+Homepage: https://pmem.io/pmdk/
+
+Package: libpmem
+Architecture: any
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory low level support library
+ libpmem provides low level persistent memory support. In particular, support
+ for the persistent memory instructions for flushing changes to pmem is
+ provided.
+
+Package: libpmem-dev
+Section: libdevel
+Architecture: any
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmem
+ libpmem provides low level persistent memory support. In particular, support
+ for the persistent memory instructions for flushing changes to pmem is
+ provided.
+
+Package: libpmemblk
+Architecture: any
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory block array support library
+ libpmemblk implements a pmem-resident array of blocks, all the same size, where
+ a block is updated atomically with respect to power failure or program
+ interruption (no torn blocks).
+
+Package: libpmemblk-dev
+Section: libdevel
+Architecture: any
+Depends: libpmemblk (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmemblk
+ libpmemblk implements a pmem-resident array of blocks, all the same size, where
+ a block is updated atomically with respect to power failure or program
+ interruption (no torn blocks).
+
+Package: libpmemlog
+Architecture: any
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory log file support library
+ libpmemlog implements a pmem-resident log file.
+
+Package: libpmemlog-dev
+Section: libdevel
+Architecture: any
+Depends: libpmemlog (=\${binary:Version}), libpmem-dev,  \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmemlog
+ libpmemlog implements a pmem-resident log file.
+
+Package: libpmemobj
+Architecture: any
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory object store support library
+ libpmemobj turns a persistent memory file into a flexible object store,
+ supporting transactions, memory management, locking, lists, and a number of
+ other features.
+
+Package: libpmemobj-dev
+Section: libdevel
+Architecture: any
+Depends: libpmemobj (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmemobj
+ libpmemobj turns a persistent memory file into a flexible object store,
+ supporting transactions, memory management, locking, lists, and a number of
+ other features.
+ .
+ This package contains libraries and header files used for linking programs
+ against libpmemobj.
+
+Package: libpmempool
+Architecture: any
+Depends: libpmem (=\${binary:Version}), \${shlibs:Depends}, \${misc:Depends}
+Description: Persistent Memory pool management support library
+ libpmempool provides a set of utilities for management, diagnostics and repair
+ of persistent memory pools. A pool in this context means a pmemobj pool,
+ pmemblk pool, pmemlog pool or BTT layout, independent of the underlying
+ storage. The libpmempool is for applications that need high reliability or
+ built-in troubleshooting. It may be useful for testing and debugging purposes
+ also.
+
+Package: libpmempool-dev
+Section: libdevel
+Architecture: any
+Depends: libpmempool (=\${binary:Version}), libpmem-dev, \${shlibs:Depends}, \${misc:Depends}
+Description: Development files for libpmempool
+ libpmempool provides a set of utilities for management, diagnostics and repair
+ of persistent memory pools.
+ .
+ This package contains libraries and header files used for linking programs
+ against libpmempool.
+
+Package: $PACKAGE_NAME-dbg
+Section: debug
+Priority: optional
+Architecture: any
+Depends: libpmem (=\${binary:Version}), libpmemblk (=\${binary:Version}), libpmemlog (=\${binary:Version}), libpmemobj (=\${binary:Version}), libpmempool (=\${binary:Version}), \${misc:Depends}
+Description: Debug symbols for PMDK libraries
+ Debug symbols for all PMDK libraries.
+
+Package: pmempool
+Section: misc
+Architecture: any
+Priority: optional
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: utility for management and off-line analysis of PMDK memory pools
+ This utility is a standalone tool that manages Persistent Memory pools
+ created by PMDK libraries. It provides a set of utilities for
+ administration and diagnostics of Persistent Memory pools. Pmempool may be
+ useful for troubleshooting by system administrators and users of the
+ applications based on PMDK libraries.
+
+Package: pmreorder
+Section: misc
+Architecture: any
+Priority: optional
+Depends: \${shlibs:Depends}, \${misc:Depends}
+Description: tool to parse and replay pmemcheck logs
+ Pmreorder is tool that parses and replays log of operations collected by
+ pmemcheck -- a  atandalone tool which is a collection of python scripts designed
+ to parse and replay operations logged by pmemcheck - a persistent memory
+ checking tool. Pmreorder performs the store reordering between persistent
+ memory barriers - a sequence of flush-fence operations. It uses a
+ consistency checking routine provided in the command line options to check
+ whether files are in a consistent state.
+EOF
+
+cp LICENSE debian/copyright
+
+if [ -n "$NDCTL_ENABLE" ]; then
+       pass_ndctl_enable="NDCTL_ENABLE=$NDCTL_ENABLE"
+else
+       pass_ndctl_enable=""
+fi
+
+cat << EOF > debian/rules
+#!/usr/bin/make -f
+#export DH_VERBOSE=1
+%:
+       dh \$@
+
+override_dh_strip:
+       dh_strip --dbg-package=$PACKAGE_NAME-dbg
+
+override_dh_auto_build:
+       dh_auto_build -- EXPERIMENTAL=${EXPERIMENTAL} prefix=/$PREFIX libdir=/$LIB_DIR includedir=/$INC_DIR docdir=/$DOC_DIR man1dir=/$MAN1_DIR man3dir=/$MAN3_DIR man5dir=/$MAN5_DIR man7dir=/$MAN7_DIR sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 ${pass_ndctl_enable} SRCVERSION=$SRCVERSION PMEM2_INSTALL=${PMEM2_INSTALL}
+
+override_dh_auto_install:
+       dh_auto_install -- EXPERIMENTAL=${EXPERIMENTAL} prefix=/$PREFIX libdir=/$LIB_DIR includedir=/$INC_DIR docdir=/$DOC_DIR man1dir=/$MAN1_DIR man3dir=/$MAN3_DIR man5dir=/$MAN5_DIR man7dir=/$MAN7_DIR sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 ${pass_ndctl_enable} SRCVERSION=$SRCVERSION PMEM2_INSTALL=${PMEM2_INSTALL}
+       find -path './debian/*usr/share/man/man*/*.gz' -exec gunzip {} \;
+
+override_dh_install:
+       mkdir -p debian/tmp/usr/share/pmdk/
+       cp utils/pmdk.magic debian/tmp/usr/share/pmdk/
+       dh_install
+
+${CHECK_CMD}
+EOF
+
+chmod +x debian/rules
+
+mkdir debian/source
+
+ITP_BUG_EXCUSE="# This is our first package but we do not want to upload it yet.
+# Please refer to Debian Developer's Reference section 5.1 (New packages) for details:
+# https://www.debian.org/doc/manuals/developers-reference/pkgs.html#newpackage"
+
+cat << EOF > debian/source/format
+3.0 (quilt)
+EOF
+
+cat << EOF > debian/libpmem.install
+$LIB_DIR/libpmem.so.*
+usr/share/pmdk/pmdk.magic
+$MAN5_DIR/poolset.5
+EOF
+
+cat $MAGIC_INSTALL > debian/libpmem.postinst
+sed -i '1s/.*/\#\!\/bin\/bash/' debian/libpmem.postinst
+echo $'\n#DEBHELPER#\n' >> debian/libpmem.postinst
+cat $MAGIC_UNINSTALL > debian/libpmem.prerm
+sed -i '1s/.*/\#\!\/bin\/bash/' debian/libpmem.prerm
+echo $'\n#DEBHELPER#\n' >> debian/libpmem.prerm
+
+cat << EOF > debian/libpmem.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmem: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmem-dev.install
+$LIB_DIR/pmdk_debug/libpmem.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmem.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmem.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmem.so
+$LIB_DIR/pkgconfig/libpmem.pc
+$INC_DIR/libpmem.h
+$MAN7_DIR/libpmem.7
+$MAN3_DIR/pmem_*.3
+EOF
+
+cat << EOF > debian/libpmem-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+# pmdk provides second set of libraries for debugging.
+# These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
+# Related issue: https://github.com/pmem/issues/issues/841
+libpmem-dev: package-has-unnecessary-activation-of-ldconfig-trigger
+
+EOF
+
+cat << EOF > debian/libpmemblk.install
+$LIB_DIR/libpmemblk.so.*
+EOF
+
+cat << EOF > debian/libpmemblk.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmemblk: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmemblk-dev.install
+$LIB_DIR/pmdk_debug/libpmemblk.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemblk.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemblk.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmemblk.so
+$LIB_DIR/pkgconfig/libpmemblk.pc
+$INC_DIR/libpmemblk.h
+$MAN7_DIR/libpmemblk.7
+$MAN3_DIR/pmemblk_*.3
+EOF
+
+cat << EOF > debian/libpmemblk-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+# pmdk provides second set of libraries for debugging.
+# These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
+# Related issue: https://github.com/pmem/issues/issues/841
+libpmemblk-dev: package-has-unnecessary-activation-of-ldconfig-trigger
+EOF
+
+cat << EOF > debian/libpmemlog.install
+$LIB_DIR/libpmemlog.so.*
+EOF
+
+cat << EOF > debian/libpmemlog.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmemlog: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmemlog-dev.install
+$LIB_DIR/pmdk_debug/libpmemlog.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemlog.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemlog.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmemlog.so
+$LIB_DIR/pkgconfig/libpmemlog.pc
+$INC_DIR/libpmemlog.h
+$MAN7_DIR/libpmemlog.7
+$MAN3_DIR/pmemlog_*.3
+EOF
+
+cat << EOF > debian/libpmemlog-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+# pmdk provides second set of libraries for debugging.
+# These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
+# Related issue: https://github.com/pmem/issues/issues/841
+libpmemlog-dev: package-has-unnecessary-activation-of-ldconfig-trigger
+EOF
+
+cat << EOF > debian/libpmemobj.install
+$LIB_DIR/libpmemobj.so.*
+EOF
+
+cat << EOF > debian/libpmemobj.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmemobj: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmemobj-dev.install
+$LIB_DIR/pmdk_debug/libpmemobj.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemobj.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmemobj.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmemobj.so
+$LIB_DIR/pkgconfig/libpmemobj.pc
+$INC_DIR/libpmemobj.h
+$INC_DIR/libpmemobj/*.h
+$MAN7_DIR/libpmemobj.7
+$MAN3_DIR/pmemobj_*.3
+$MAN3_DIR/pobj_*.3
+$MAN3_DIR/oid_*.3
+$MAN3_DIR/toid*.3
+$MAN3_DIR/direct_*.3
+$MAN3_DIR/d_r*.3
+$MAN3_DIR/tx_*.3
+EOF
+
+cat << EOF > debian/libpmemobj-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+# pmdk provides second set of libraries for debugging.
+# These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
+# Related issue: https://github.com/pmem/issues/issues/841
+libpmemobj-dev: package-has-unnecessary-activation-of-ldconfig-trigger
+EOF
+
+cat << EOF > debian/libpmempool.install
+$LIB_DIR/libpmempool.so.*
+EOF
+
+cat << EOF > debian/libpmempool.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+libpmempool: package-name-doesnt-match-sonames
+EOF
+
+cat << EOF > debian/libpmempool-dev.install
+$LIB_DIR/pmdk_debug/libpmempool.a $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmempool.so $LIB_DIR/pmdk_dbg/
+$LIB_DIR/pmdk_debug/libpmempool.so.* $LIB_DIR/pmdk_dbg/
+$LIB_DIR/libpmempool.so
+$LIB_DIR/pkgconfig/libpmempool.pc
+$INC_DIR/libpmempool.h
+$MAN7_DIR/libpmempool.7
+$MAN3_DIR/pmempool_*.3
+EOF
+
+cat << EOF > debian/libpmempool-dev.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+# The following warnings are triggered by a bug in debhelper:
+# https://bugs.debian.org/204975
+postinst-has-useless-call-to-ldconfig
+postrm-has-useless-call-to-ldconfig
+# We do not want to compile with -O2 for debug version
+hardening-no-fortify-functions $LIB_DIR/pmdk_dbg/*
+# pmdk provides second set of libraries for debugging.
+# These are in /usr/lib/$arch/pmdk_dbg/, but still trigger ldconfig.
+# Related issue: https://github.com/pmem/issues/issues/841
+libpmempool-dev: package-has-unnecessary-activation-of-ldconfig-trigger
+EOF
+
+cat << EOF > debian/$PACKAGE_NAME-dbg.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+EOF
+
+cat << EOF > debian/pmempool.install
+usr/bin/pmempool
+$MAN1_DIR/pmempool.1
+$MAN1_DIR/pmempool-*.1
+usr/share/bash-completion/completions/pmempool
+EOF
+
+cat << EOF > debian/pmempool.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+EOF
+
+cat << EOF > debian/pmreorder.install
+usr/bin/pmreorder
+usr/share/pmreorder/*.py
+$MAN1_DIR/pmreorder.1
+EOF
+
+cat << EOF > debian/pmreorder.lintian-overrides
+$ITP_BUG_EXCUSE
+new-package-should-close-itp-bug
+EOF
+
+# librpmem & rpmemd
+if [ "${BUILD_RPMEM}" = "y" -a "${RPMEM_DPKG}" = "y" ]
+then
+       append_rpmem_control;
+       rpmem_install_triggers_overrides;
+fi
+
+# libpmem2
+if [ "${PMEM2_INSTALL}" == "y" ]
+then
+       append_libpmem2_control;
+       libpmem2_install_triggers_overrides;
+fi
+
+# daxio
+if [ "${NDCTL_ENABLE}" != "n" ]
+then
+       append_daxio_control;
+       daxio_install_triggers_overrides;
+fi
+
+# Convert ChangeLog to debian format
+CHANGELOG_TMP=changelog.tmp
+dch --create --empty --package $PACKAGE_NAME -v $PACKAGE_VERSION-$PACKAGE_RELEASE -M -c $CHANGELOG_TMP
+touch debian/changelog
+head -n1 $CHANGELOG_TMP >> debian/changelog
+echo "" >> debian/changelog
+convert_changelog ChangeLog >> debian/changelog
+echo "" >> debian/changelog
+tail -n1 $CHANGELOG_TMP >> debian/changelog
+rm $CHANGELOG_TMP
+
+# This is our first release but we do
+debuild --preserve-envvar=EXTRA_CFLAGS_RELEASE \
+       --preserve-envvar=EXTRA_CFLAGS_DEBUG \
+       --preserve-envvar=EXTRA_CFLAGS \
+       --preserve-envvar=EXTRA_CXXFLAGS \
+       --preserve-envvar=EXTRA_LDFLAGS \
+       --preserve-envvar=NDCTL_ENABLE \
+       -us -uc -b
+
+cd $OLD_DIR
+
+find $WORKING_DIR -name "*.deb"\
+               -or -name "*.dsc"\
+               -or -name "*.changes"\
+               -or -name "*.orig.tar.gz"\
+               -or -name "*.debian.tar.gz" | while read FILE
+do
+       mv -v $FILE $OUT_DIR/
+done
+
+exit 0
diff --git a/ceph/src/pmdk/utils/build-rpm.sh b/ceph/src/pmdk/utils/build-rpm.sh
new file mode 100755 (executable)
index 0000000..759a1fe
--- /dev/null
@@ -0,0 +1,263 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+#
+# build-rpm.sh - Script for building rpm packages
+#
+
+set -e
+
+SCRIPT_DIR=$(dirname $0)
+source $SCRIPT_DIR/pkg-common.sh
+
+check_tool rpmbuild
+check_file $SCRIPT_DIR/pkg-config.sh
+source $SCRIPT_DIR/pkg-config.sh
+
+#
+# usage -- print usage message and exit
+#
+usage()
+{
+       [ "$1" ] && echo Error: $1
+       cat >&2 <<EOF
+Usage: $0 [ -h ] -t version-tag -s source-dir -w working-dir -o output-dir
+       [ -d distro ] [ -e build-experimental ] [ -c run-check ]
+       [ -r build-rpmem ] [ -n with-ndctl ] [ -f testconfig-file ]
+
+-h                     print this help message
+-t version-tag         source version tag
+-s source-dir          source directory
+-w working-dir         working directory
+-o output-dir          output directory
+-d distro              Linux distro name
+-e build-experimental  build experimental packages
+-c run-check           run package check
+-r build-rpmem         build librpmem and rpmemd packages
+-n with-ndctl          build with libndctl
+-f testconfig-file     custom testconfig.sh
+EOF
+       exit 1
+}
+
+#
+# command-line argument processing...
+#
+args=`getopt he:c:r:n:t:d:s:w:o:f: $*`
+[ $? != 0 ] && usage
+set -- $args
+for arg
+do
+       receivetype=auto
+       case "$arg"
+       in
+       -e)
+               EXPERIMENTAL="$2"
+               shift 2
+               ;;
+       -c)
+               BUILD_PACKAGE_CHECK="$2"
+               shift 2
+               ;;
+       -f)
+               TEST_CONFIG_FILE="$2"
+               shift 2
+               ;;
+       -r)
+               BUILD_RPMEM="$2"
+               shift 2
+               ;;
+       -n)
+               NDCTL_ENABLE="$2"
+               shift 2
+               ;;
+       -t)
+               PACKAGE_VERSION_TAG="$2"
+               shift 2
+               ;;
+       -s)
+               SOURCE="$2"
+               shift 2
+               ;;
+       -w)
+               WORKING_DIR="$2"
+               shift 2
+               ;;
+       -o)
+               OUT_DIR="$2"
+               shift 2
+               ;;
+       -d)
+               DISTRO="$2"
+               shift 2
+               ;;
+       --)
+               shift
+               break
+               ;;
+       esac
+done
+
+# check for mandatory arguments
+if [ -z "$PACKAGE_VERSION_TAG" -o -z "$SOURCE" -o -z "$WORKING_DIR" -o -z "$OUT_DIR" ]
+then
+       error "Mandatory arguments missing"
+       usage
+fi
+
+# detected distro or defined in cmd
+if [ -z "${DISTRO}" ]
+then
+       OS=$(get_os)
+       if [ "$OS" != "1" ]
+       then
+               echo "Detected OS: $OS"
+               DISTRO=$OS
+       else
+               error "Unknown distribution"
+               exit 1
+       fi
+fi
+
+if [ "$EXTRA_CFLAGS_RELEASE" = "" ]; then
+       export EXTRA_CFLAGS_RELEASE="-ggdb -fno-omit-frame-pointer"
+fi
+
+PMEM2_INSTALL="y"
+
+LIBFABRIC_MIN_VERSION=1.4.2
+NDCTL_MIN_VERSION=60.1
+
+RPMBUILD_OPTS=( )
+PACKAGE_VERSION=$(get_version $PACKAGE_VERSION_TAG)
+
+if [ -z "$PACKAGE_VERSION" ]
+then
+       error "Can not parse version from '${PACKAGE_VERSION_TAG}'"
+       exit 1
+fi
+
+PACKAGE_SOURCE=${PACKAGE_NAME}-${PACKAGE_VERSION}
+SOURCE=$PACKAGE_NAME
+PACKAGE_TARBALL=$PACKAGE_SOURCE.tar.gz
+RPM_SPEC_FILE=$PACKAGE_SOURCE/$PACKAGE_NAME.spec
+MAGIC_INSTALL=$PACKAGE_SOURCE/utils/magic-install.sh
+MAGIC_UNINSTALL=$PACKAGE_SOURCE/utils/magic-uninstall.sh
+OLDPWD=$PWD
+
+[ -d $WORKING_DIR ] || mkdir -v $WORKING_DIR
+[ -d $OUT_DIR ] || mkdir $OUT_DIR
+
+cd $WORKING_DIR
+
+check_dir $SOURCE
+mv $SOURCE $PACKAGE_SOURCE
+
+if [ "$DISTRO" = "SLES_like" ]
+then
+       RPM_LICENSE="BSD-3-Clause"
+       RPM_GROUP_SYS_BASE="System\/Base"
+       RPM_GROUP_SYS_LIBS="System\/Libraries"
+       RPM_GROUP_DEV_LIBS="Development\/Libraries\/C and C++"
+       RPM_PKG_NAME_SUFFIX="1"
+       RPM_MAKE_FLAGS="BINDIR=""%_bindir"" NORPATH=1"
+       RPM_MAKE_INSTALL="%fdupes %{buildroot}\/%{_prefix}"
+else
+       RPM_LICENSE="BSD"
+       RPM_GROUP_SYS_BASE="System Environment\/Base"
+       RPM_GROUP_SYS_LIBS="System Environment\/Libraries"
+       RPM_GROUP_DEV_LIBS="Development\/Libraries"
+       RPM_PKG_NAME_SUFFIX=""
+       RPM_MAKE_FLAGS="NORPATH=1"
+       RPM_MAKE_INSTALL=""
+fi
+
+#
+# Create parametrized spec file required by rpmbuild.
+# Most of variables are set in pkg-config.sh file in order to
+# keep descriptive values separately from this script.
+#
+sed -e "s/__VERSION__/$PACKAGE_VERSION/g" \
+       -e "s/__LICENSE__/$RPM_LICENSE/g" \
+       -e "s/__PACKAGE_MAINTAINER__/$PACKAGE_MAINTAINER/g" \
+       -e "s/__PACKAGE_SUMMARY__/$PACKAGE_SUMMARY/g" \
+       -e "s/__GROUP_SYS_BASE__/$RPM_GROUP_SYS_BASE/g" \
+       -e "s/__GROUP_SYS_LIBS__/$RPM_GROUP_SYS_LIBS/g" \
+       -e "s/__GROUP_DEV_LIBS__/$RPM_GROUP_DEV_LIBS/g" \
+       -e "s/__PKG_NAME_SUFFIX__/$RPM_PKG_NAME_SUFFIX/g" \
+       -e "s/__MAKE_FLAGS__/$RPM_MAKE_FLAGS/g" \
+       -e "s/__MAKE_INSTALL_FDUPES__/$RPM_MAKE_INSTALL/g" \
+       -e "s/__LIBFABRIC_MIN_VER__/$LIBFABRIC_MIN_VERSION/g" \
+       -e "s/__NDCTL_MIN_VER__/$NDCTL_MIN_VERSION/g" \
+       $OLDPWD/$SCRIPT_DIR/pmdk.spec.in > $RPM_SPEC_FILE
+
+if [ "$DISTRO" = "SLES_like" ]
+then
+       sed -i '/^#.*bugzilla.redhat/d' $RPM_SPEC_FILE
+fi
+
+# do not split on space
+IFS=$'\n'
+
+# experimental features
+if [ "${EXPERIMENTAL}" = "y" ]
+then
+       # no experimental features for now
+       RPMBUILD_OPTS+=( )
+fi
+
+# libpmem2
+if [ "${PMEM2_INSTALL}" == "y" ]
+then
+       RPMBUILD_OPTS+=(--define "_pmem2_install 1")
+fi
+
+# librpmem & rpmemd
+if [ "${BUILD_RPMEM}" = "y" ]
+then
+       RPMBUILD_OPTS+=(--with fabric)
+else
+       RPMBUILD_OPTS+=(--without fabric)
+fi
+
+# daxio & RAS
+if [ "${NDCTL_ENABLE}" = "n" ]
+then
+       RPMBUILD_OPTS+=(--without ndctl)
+else
+       RPMBUILD_OPTS+=(--with ndctl)
+fi
+
+# use specified testconfig file or default
+if [[( -n "${TEST_CONFIG_FILE}") && ( -f "$TEST_CONFIG_FILE" ) ]]
+then
+       echo "Test config file: $TEST_CONFIG_FILE"
+       RPMBUILD_OPTS+=(--define "_testconfig $TEST_CONFIG_FILE")
+else
+       echo -e "Test config file $TEST_CONFIG_FILE does not exist.\n"\
+               "Default test config will be used."
+fi
+
+# run make check or not
+if [ "${BUILD_PACKAGE_CHECK}" == "n" ]
+then
+       RPMBUILD_OPTS+=(--define "_skip_check 1")
+fi
+
+tar zcf $PACKAGE_TARBALL $PACKAGE_SOURCE
+
+# Create directory structure for rpmbuild
+mkdir -v BUILD SPECS
+
+echo "opts: ${RPMBUILD_OPTS[@]}"
+
+rpmbuild --define "_topdir `pwd`"\
+       --define "_rpmdir ${OUT_DIR}"\
+       --define "_srcrpmdir ${OUT_DIR}"\
+        -ta $PACKAGE_TARBALL \
+        ${RPMBUILD_OPTS[@]}
+
+echo "Building rpm packages done"
+
+exit 0
diff --git a/ceph/src/pmdk/utils/check-area.sh b/ceph/src/pmdk/utils/check-area.sh
new file mode 100755 (executable)
index 0000000..911556b
--- /dev/null
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+#
+# Finds applicable area name for specified commit id.
+#
+
+if [ -z "$1" ]; then
+       echo "Missing commit id argument."
+       exit 1
+fi
+
+files=$(git show $1 --format=oneline --name-only | grep -v -e "$1")
+
+git show -q $1 | cat
+
+echo
+echo "Modified files:"
+echo "$files"
+
+function categorize() {
+       category=$1
+       shift
+       cat_files=`echo "$files" | grep $*`
+
+       if [ -n "${cat_files}" ]; then
+               echo "$category"
+               files=`echo "$files" | grep -v $*`
+       fi
+}
+
+echo
+echo "Areas computed basing on the list of modified files: (see utils/check-area.sh for full algorithm)"
+
+categorize core      -e "^src/core/"
+categorize pmem      -e "^src/libpmem/"     -e "^src/include/libpmem.h"
+categorize pmem2     -e "^src/libpmem2/"    -e "^src/include/libpmem2.h"
+categorize rpmem     -e "^src/librpmem/"    -e "^src/include/librpmem.h" -e "^src/tools/rpmemd/" -e "^src/rpmem_common/"
+categorize log       -e "^src/libpmemlog/"  -e "^src/include/libpmemlog.h"
+categorize blk       -e "^src/libpmemblk/"  -e "^src/include/libpmemblk.h"
+categorize obj       -e "^src/libpmemobj/"  -e "^src/include/libpmemobj.h" -e "^src/include/libpmemobj/"
+categorize pool      -e "^src/libpmempool/" -e "^src/include/libpmempool.h" -e "^src/tools/pmempool/"
+categorize benchmark -e "^src/benchmarks/"
+categorize examples  -e "^src/examples/"
+categorize daxio     -e "^src/tools/daxio/"
+categorize pmreorder -e "^src/tools/pmreorder/"
+categorize test      -e "^src/test/"
+categorize doc       -e "^doc/" -e ".md\$" -e "^ChangeLog" -e "README"
+categorize common    -e "^src/common/" \
+                       -e "^utils/" \
+                       -e ".inc\$" \
+                       -e ".yml\$" \
+                       -e ".gitattributes" \
+                       -e ".gitignore" \
+                       -e "^.mailmap\$" \
+                       -e "^src/PMDK.sln\$" \
+                       -e "Makefile\$" \
+                       -e "^src/freebsd/" \
+                       -e "^src/windows/" \
+                       -e "^src/include/pmemcompat.h"
+
+echo
+echo "If the above list contains more than 1 entry, please consider splitting"
+echo "your change into more commits, unless those changes don't make sense "
+echo "individually (they do not build, tests do not pass, etc)."
+echo "For example, it's perfectly fine to use 'obj' prefix for one commit that"
+echo "changes libpmemobj source code, its tests and documentation."
+
+if [ -n "$files" ]; then
+       echo
+       echo "Uncategorized files:"
+       echo "$files"
+fi
diff --git a/ceph/src/pmdk/utils/check-commit.sh b/ceph/src/pmdk/utils/check-commit.sh
new file mode 100755 (executable)
index 0000000..3985e40
--- /dev/null
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# Used to check whether all the commit messages in a pull request
+# follow the GIT/PMDK guidelines.
+#
+# usage: ./check-commit.sh commit
+#
+
+if [ -z "$1" ]; then
+       echo "Usage: check-commit.sh commit-id"
+       exit 1
+fi
+
+echo "Checking $1"
+
+subject=$(git log --format="%s" -n 1 $1)
+
+if [[ $subject =~ ^Merge.* ]]; then
+       # skip
+       exit 0
+fi
+
+if [[ $subject =~ ^Revert.* ]]; then
+       # skip
+       exit 0
+fi
+
+# valid area names
+AREAS="pmem\|pmem2\|rpmem\|log\|blk\|obj\|pool\|test\|benchmark\|examples\|doc\|core\|common\|daxio\|pmreorder"
+
+prefix=$(echo $subject | sed -n "s/^\($AREAS\)\:.*/\1/p")
+
+if [ "$prefix" = "" ]; then
+       echo "FAIL: subject line in commit message does not contain valid area name"
+       echo
+       `dirname $0`/check-area.sh $1
+       exit 1
+fi
+
+commit_len=$(git log --format="%s%n%b" -n 1 $1 | wc -L)
+
+if [ $commit_len -gt 73 ]; then
+       echo "FAIL: commit message exceeds 72 chars per line (commit_len)"
+       echo
+       git log -n 1 $1 | cat
+       exit 1
+fi
diff --git a/ceph/src/pmdk/utils/check-commits.sh b/ceph/src/pmdk/utils/check-commits.sh
new file mode 100755 (executable)
index 0000000..762db22
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# Used to check whether all the commit messages in a pull request
+# follow the GIT/PMDK guidelines.
+#
+# usage: ./check-commits.sh [range]
+#
+
+if [ -z "$1" ]; then
+       # on CI run this check only for pull requests
+       if [ -n "$CI_REPO_SLUG" ]; then
+               if [[ "$CI_REPO_SLUG" != "$GITHUB_REPO" \
+                       || $CI_EVENT_TYPE != "pull_request" ]];
+               then
+                       echo "SKIP: $0 can only be executed for pull requests to $GITHUB_REPO"
+                       exit 0
+               fi
+       fi
+       # CI_COMMIT_RANGE can be invalid for force pushes - use another
+       # method to determine the list of commits
+       if [[ $(git rev-list $CI_COMMIT_RANGE 2>/dev/null) || -n "$CI_COMMIT_RANGE" ]]; then
+               MERGE_BASE=$(echo $CI_COMMIT_RANGE | cut -d. -f1)
+               [ -z $MERGE_BASE ] && \
+                       MERGE_BASE=$(git log --pretty="%cN:%H" | grep GitHub | head -n1 | cut -d: -f2)
+               RANGE=$MERGE_BASE..$CI_COMMIT
+       else
+               MERGE_BASE=$(git log --pretty="%cN:%H" | grep GitHub | head -n1 | cut -d: -f2)
+               RANGE=$MERGE_BASE..HEAD
+       fi
+else
+       RANGE="$1"
+fi
+
+COMMITS=$(git log --pretty=%H $RANGE)
+
+set -e
+
+for commit in $COMMITS; do
+       `dirname $0`/check-commit.sh $commit
+done
diff --git a/ceph/src/pmdk/utils/check-manpage b/ceph/src/pmdk/utils/check-manpage
new file mode 100755 (executable)
index 0000000..d0c0d4d
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019, Intel Corporation
+
+# check-manpage -- a tool to check a single man page against errors
+#
+# While it can handle multiple files, it's recommended to use
+# check-manpages instead.
+set -e
+
+check_link()
+{
+       [ $(wc -l <"$file") = 1 ] ||
+               { echo ".so link isn't the only line" && return; }
+       link=$(cat "$file")
+       link=${link#.so }
+       [ "${link##*/}" = "$link" ] ||
+               grep -q '^\.so man\([0-9]\)/[a-z0-9+_-]\+\.\1$' "$file" ||
+               { echo ".so link directory is not matching manX" && return; }
+       [ -e "${link##*/}" ] ||
+               { echo ".so link target doesn't exist: ${link##*/}" && return; }
+}
+
+for m in "$@"; do
+       dir="$(dirname $m)"
+       file="$(basename $m)"
+       [ -n "$dir" ] && pushd "$dir" >/dev/null
+
+       if grep -q '^\.so' "$file"; then
+               err=$(check_link)
+               [ -z "$err" ] || {
+                       echo >&2 "$file: $err"
+                       FAILED=1
+               }
+               popd >/dev/null 2>/dev/null
+               continue
+       fi
+
+       # man can emit warnings and errors.  Even non-fatal errors are normally
+       # suppressed if a pager is in use (ie, all interactive usage).  Common
+       # messages include an unknown macro, an unbreakable line, etc.
+       err=$(MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z "$file" 2>&1 >/dev/null|
+               grep -v 'cannot adjust line' || true)
+       [ -z "$err" ] || {
+               echo >&2 "$file: $err"
+               FAILED=1
+       }
+
+       # If a "NAME" section exists, call lexgrog to see if it's properly
+       # formatted.
+       if grep -q '^\.SH NAME' "$file"; then
+               if ! lexgrog "$file" >/dev/null; then
+                       # lexgrog doesn't give any interesting messages.
+                       echo 2>&1 "lexgrog failed on $file"
+                       FAILED=1
+               fi
+       fi
+
+       popd >/dev/null 2>/dev/null
+done
+
+exit $FAILED
diff --git a/ceph/src/pmdk/utils/check-manpages b/ceph/src/pmdk/utils/check-manpages
new file mode 100755 (executable)
index 0000000..415db12
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019-2020, Intel Corporation
+
+# check-manpages -- a tool to test against some manpage errors
+
+MANS="$*"
+[ -n "$MANS" ] || MANS="$(find doc -name '*.1' -o -name '*.3' -o -name '*.5' -o -name '*.7')"
+[ -n "$MANS" ] || { echo >&2 "No man pages given, and none found in doc/"; exit 1;}
+
+for page in $MANS;do
+       if [ "${page/rpmem/}" != "$page" ] && [ "$BUILD_RPMEM" != "y" ]; then
+               continue
+       fi
+       echo $page
+done | xargs -P `nproc` -n1 -- utils/check-manpage
diff --git a/ceph/src/pmdk/utils/check-os.sh b/ceph/src/pmdk/utils/check-os.sh
new file mode 100755 (executable)
index 0000000..64d371c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2019, Intel Corporation
+
+#
+# Used to check if there are no banned functions in .o file
+#
+# usage: ./check-os.sh [os.h path] [.o file] [.c file]
+
+EXCLUDE="os_posix|os_thread_posix"
+if [[ $2 =~ $EXCLUDE ]]; then
+       echo "skip $2"
+       exit 0
+fi
+
+symbols=$(nm --demangle --undefined-only --format=posix $2 | sed 's/ U *//g')
+functions=$(cat $1 | tr '\n' '|')
+functions=${functions%?} # remove trailing | character
+out=$(
+       for sym in $symbols
+       do
+               grep -wE $functions <<<"$sym"
+       done | sed 's/$/\(\)/g')
+
+[[ ! -z $out ]] &&
+       echo -e "`pwd`/$3:1: non wrapped function(s):\n$out\nplease use os wrappers" &&
+       rm -f $2 && # remove .o file as it don't match requirements
+       exit 1
+
+exit 0
diff --git a/ceph/src/pmdk/utils/check-shebang.sh b/ceph/src/pmdk/utils/check-shebang.sh
new file mode 100755 (executable)
index 0000000..1051d17
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2019, Intel Corporation
+#
+# utils/check-shebang.sh -- interpreter directive check script
+#
+set -e
+
+err_count=0
+
+for file in $@ ; do
+        [ ! -f $file ] && continue
+       SHEBANG=`head -n1 $file | cut -d" " -f1`
+       [ "${SHEBANG:0:2}" != "#!" ] && continue
+       if [ "$SHEBANG" != "#!/usr/bin/env" -a $SHEBANG != "#!/bin/sh" ]; then
+               INTERP=`echo $SHEBANG | rev | cut -d"/" -f1 | rev`
+               echo "$file:1: error: invalid interpreter directive:" >&2
+               echo "  (is: \"$SHEBANG\", should be: \"#!/usr/bin/env $INTERP\")" >&2
+               ((err_count+=1))
+       fi
+done
+
+if [ "$err_count" == "0" ]; then
+       echo "Interpreter directives are OK."
+else
+       echo "Found $err_count errors in interpreter directives!" >&2
+       err_count=1
+fi
+
+exit $err_count
diff --git a/ceph/src/pmdk/utils/check_license/check-headers.sh b/ceph/src/pmdk/utils/check_license/check-headers.sh
new file mode 100755 (executable)
index 0000000..f79453b
--- /dev/null
@@ -0,0 +1,192 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+# check-headers.sh - check copyright and license in source files
+
+SELF=$0
+
+function usage() {
+       echo "Usage: $SELF <source_root_path> <license_tag> [-h|-v|-a]"
+       echo "   -h, --help      this help message"
+       echo "   -v, --verbose   verbose mode"
+       echo "   -a, --all       check all files (only modified files are checked by default)"
+}
+
+if [ "$#" -lt 2 ]; then
+       usage >&2
+       exit 2
+fi
+
+SOURCE_ROOT=$1
+shift
+LICENSE=$1
+shift
+
+PATTERN=`mktemp`
+TMP=`mktemp`
+TMP2=`mktemp`
+TEMPFILE=`mktemp`
+rm -f $PATTERN $TMP $TMP2
+
+if [ "$1" == "-h" -o "$1" == "--help" ]; then
+       usage
+       exit 0
+fi
+
+export GIT="git -C ${SOURCE_ROOT}"
+$GIT rev-parse || exit 1
+
+if [ -f $SOURCE_ROOT/.git/shallow ]; then
+       SHALLOW_CLONE=1
+       echo
+       echo "Warning: This is a shallow clone. Checking dates in copyright headers"
+       echo "         will be skipped in case of files that have no history."
+       echo
+else
+       SHALLOW_CLONE=0
+fi
+
+VERBOSE=0
+CHECK_ALL=0
+while [ "$1" != "" ]; do
+       case $1 in
+       -v|--verbose)
+               VERBOSE=1
+               ;;
+       -a|--all)
+               CHECK_ALL=1
+               ;;
+       esac
+       shift
+done
+
+if [ $CHECK_ALL -eq 0 ]; then
+       CURRENT_COMMIT=$($GIT log --pretty=%H -1)
+       MERGE_BASE=$($GIT merge-base HEAD origin/master 2>/dev/null)
+       [ -z $MERGE_BASE ] && \
+               MERGE_BASE=$($GIT log --pretty="%cN:%H" | grep GitHub | head -n1 | cut -d: -f2)
+       [ -z $MERGE_BASE -o "$CURRENT_COMMIT" = "$MERGE_BASE" ] && \
+               CHECK_ALL=1
+fi
+
+if [ $CHECK_ALL -eq 1 ]; then
+       echo "Checking copyright headers of all files..."
+       GIT_COMMAND="ls-tree -r --name-only HEAD"
+else
+       if [ $VERBOSE -eq 1 ]; then
+               echo
+               echo "Warning: will check copyright headers of modified files only,"
+               echo "         in order to check all files issue the following command:"
+               echo "         $ $SELF <source_root_path> <license_tag> -a"
+               echo "         (e.g.: $ $SELF $SOURCE_ROOT $LICENSE -a)"
+               echo
+       fi
+       echo "Checking copyright headers of modified files only..."
+       GIT_COMMAND="diff --name-only $MERGE_BASE $CURRENT_COMMIT"
+fi
+
+FILES=$($GIT $GIT_COMMAND | ${SOURCE_ROOT}/utils/check_license/file-exceptions.sh | \
+       grep    -E -e '*\.[chs]$' -e '*\.[ch]pp$' -e '*\.sh$' \
+                  -e '*\.py$' -e '*\.link$' -e 'Makefile*' -e 'TEST*' \
+                  -e '/common.inc$' -e '/match$' -e '/check_whitespace$' \
+                  -e 'LICENSE$' -e 'CMakeLists.txt$' -e '*\.cmake$' | \
+       xargs)
+
+RV=0
+for file in $FILES ; do
+       # The src_path is a path which should be used in every command except git.
+       # git is called with -C flag so filepaths should be relative to SOURCE_ROOT
+       src_path="${SOURCE_ROOT}/$file"
+       [ ! -f $src_path ] && continue
+       # ensure that file is UTF-8 encoded
+       ENCODING=`file -b --mime-encoding $src_path`
+       iconv -f $ENCODING -t "UTF-8" $src_path > $TEMPFILE
+
+       if ! grep -q "SPDX-License-Identifier: $LICENSE" $src_path; then
+               echo "$src_path:1: no $LICENSE SPDX tag found " >&2
+               RV=1
+       elif [[ $file == *.c ]] || [[ $file == *.cpp ]]; then
+               if ! grep -q -e "\/\/ SPDX-License-Identifier: $LICENSE" $src_path; then
+                       echo "$src_path:1: wrong format of $LICENSE SPDX tag" >&2
+                       RV=1
+               fi
+       elif [[ $file == *.h ]] || [[ $file == *.hpp ]]; then
+               if ! grep -q -e "\/\* SPDX-License-Identifier: $LICENSE \*\/" $src_path; then
+                       echo "$src_path:1: wrong format of $LICENSE SPDX tag" >&2
+                       RV=1
+               fi
+       elif [[ $file != LICENSE ]]; then
+               if ! grep -q -e "# SPDX-License-Identifier: $LICENSE" $src_path; then
+                       echo "$src_path:1: wrong format of $LICENSE SPDX tag" >&2
+                       RV=1
+               fi
+       fi
+
+       if [ $SHALLOW_CLONE -eq 0 ]; then
+               $GIT log --no-merges --format="%ai %aE" -- $file | sort > $TMP
+       else
+               # mark the grafted commits (commits with no parents)
+               $GIT log --no-merges --format="%ai %aE grafted-%p-commit" -- $file | sort > $TMP
+       fi
+
+       # skip checking dates for non-Intel commits
+       [[ ! $(tail -n1 $TMP) =~ "@intel.com" ]] && continue
+
+       # skip checking dates for new files
+       [ $(cat $TMP | wc -l) -le 1 ] && continue
+
+       # grep out the grafted commits (commits with no parents)
+       # and skip checking dates for non-Intel commits
+       grep -v -e "grafted--commit" $TMP | grep -e "@intel.com" > $TMP2
+
+       [ $(cat $TMP2 | wc -l) -eq 0 ] && continue
+
+       FIRST=`head -n1 $TMP2`
+       LAST=` tail -n1 $TMP2`
+
+       YEARS=`sed '
+/Copyright [0-9-]\+.*, Intel Corporation/!d
+s/.*Copyright \([0-9]\+\)-\([0-9]\+\),.*/\1-\2/
+s/.*Copyright \([0-9]\+\),.*/\1-\1/' $src_path`
+       if [ -z "$YEARS" ]; then
+               echo >&2 "$src_path:1: No copyright years found"
+               RV=1
+               continue
+       fi
+
+       HEADER_FIRST=`echo $YEARS | cut -d"-" -f1`
+       HEADER_LAST=` echo $YEARS | cut -d"-" -f2`
+
+       COMMIT_FIRST=`echo $FIRST | cut -d"-" -f1`
+       COMMIT_LAST=` echo $LAST  | cut -d"-" -f1`
+       if [ "$COMMIT_FIRST" != "" -a "$COMMIT_LAST" != "" ]; then
+               if [ $HEADER_LAST -lt $COMMIT_LAST ]; then
+                       if [ $HEADER_FIRST -lt $COMMIT_FIRST ]; then
+                               COMMIT_FIRST=$HEADER_FIRST
+                       fi
+                       COMMIT_LAST=`date +%G`
+                       if [ $COMMIT_FIRST -eq $COMMIT_LAST ]; then
+                               NEW=$COMMIT_LAST
+                       else
+                               NEW=$COMMIT_FIRST-$COMMIT_LAST
+                       fi
+                       echo "$file:1: error: wrong copyright date: (is: $YEARS, should be: $NEW)" >&2
+                       RV=1
+               fi
+       else
+               echo "$file:1: unknown commit dates" >&2
+               RV=1
+       fi
+done
+rm -f $TMP $TMP2 $TEMPFILE
+
+$(dirname "$0")/check-ms-license.pl $FILES
+
+# check if error found
+if [ $RV -eq 0 ]; then
+       echo "Copyright headers are OK."
+else
+       echo "Error(s) in copyright headers found!" >&2
+fi
+exit $RV
diff --git a/ceph/src/pmdk/utils/check_license/check-ms-license.pl b/ceph/src/pmdk/utils/check_license/check-ms-license.pl
new file mode 100755 (executable)
index 0000000..fae3c94
--- /dev/null
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -w
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020, Intel Corporation
+
+use Digest::MD5 "md5_hex";
+
+my $BSD3 = <<EndText;
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    * Neither the name of the copyright holder nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+EndText
+
+# a runaway sed job may alter this file too
+md5_hex($BSD3) eq "066df8826723b6db407a931e5d6084f4"
+       or die "Text of BSD3 license has been corrupted.\n";
+
+my $err = 0;
+
+$BSD3 =~ s/^/ /mg;             # indent the text
+$BSD3 =~ s/\n \n/\n\n/sg;      # except for empty lines
+
+undef $/;
+for my $f (@ARGV) {
+       next unless -f $f;
+       open F, '<', $f or die "Can't read 「$f」\n";
+       $_ = <F>;
+       close F;
+       next unless /Copyright.*(Microsoft Corporation|FUJITSU)/;
+
+       s/^ \*//mg;
+       s/^#//mg;
+       if (index($_, $BSD3) == -1) {
+               $err = 1;
+               print STDERR "Outside copyright but no/wrong license text in $f\n";
+       }
+}
+
+exit $err
diff --git a/ceph/src/pmdk/utils/check_license/file-exceptions.sh b/ceph/src/pmdk/utils/check_license/file-exceptions.sh
new file mode 100755 (executable)
index 0000000..a3bdb74
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+# file-exceptions.sh - filter out files not checked for copyright and license
+
+grep -v -E -e '/queue.h$' -e '/getopt.h$' -e '/getopt.c$' -e 'src/core/valgrind/' -e '/testconfig\...$'
diff --git a/ceph/src/pmdk/utils/check_sdk_version.py b/ceph/src/pmdk/utils/check_sdk_version.py
new file mode 100755 (executable)
index 0000000..7dc134f
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019-2020, Intel Corporation
+
+import argparse
+import os
+from subprocess import check_output, CalledProcessError
+import sys
+import shlex
+from xml.dom import minidom
+from xml.parsers.expat import ExpatError
+
+VALID_SDK_VERSION = '10.0.17134.0'
+
+
+def get_vcxproj_files(root_dir, ignored):
+    """Get a list ".vcxproj" files under PMDK directory."""
+    to_format = []
+    command = 'git ls-files *.vcxproj'
+    try:
+        output = check_output(shlex.split(command),
+                              cwd=root_dir).decode("UTF-8")
+    except CalledProcessError as e:
+        sys.exit('Error: "' + command + '" failed with returncode: ' +
+                 str(e.returncode))
+
+    for line in output.splitlines():
+        if not line:
+            continue
+        file_path = os.path.join(root_dir, line)
+        if os.path.isfile(file_path):
+            to_format.append(file_path)
+
+    return to_format
+
+
+def get_sdk_version(file):
+    """
+    Get Windows SDK version from modified/new files from the current
+    pull request.
+    """
+    tag = 'WindowsTargetPlatformVersion'
+    try:
+        xml_file = minidom.parse(file)
+    except ExpatError as e:
+        sys.exit('Error: "' + file + '" is incorrect.\n' + str(e))
+    version_list = xml_file.getElementsByTagName(tag)
+    if len(version_list) != 1:
+        sys.exit('Error: the amount of tags "' + tag + '" is other than 1.')
+    version = version_list[0].firstChild.data
+
+    return version
+
+
+def main():
+    parser = argparse.ArgumentParser(prog='check_sdk_version.py',
+        description='The script checks Windows SDK version in .vcxproj files.')
+    parser.add_argument('-d', '--directory',
+                        help='Directory of PMDK tree.', required=True)
+    args = parser.parse_args()
+    current_directory = args.directory
+    if not os.path.isdir(current_directory):
+        sys.exit('"' + current_directory + '" is not a directory.')
+
+    files = get_vcxproj_files(current_directory, '')
+    if not files:
+        sys.exit(0)
+    for file in files:
+        sdk_version = get_sdk_version(file)
+        if sdk_version != VALID_SDK_VERSION:
+            sys.exit('Wrong Windows SDK version: ' + sdk_version +
+                     ' in file: "' + file + '". Please use: ' + VALID_SDK_VERSION)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/ceph/src/pmdk/utils/check_whitespace b/ceph/src/pmdk/utils/check_whitespace
new file mode 100755 (executable)
index 0000000..083b3e8
--- /dev/null
@@ -0,0 +1,210 @@
+#!/usr/bin/env perl
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2015-2020, Intel Corporation
+
+#
+# check_whitespace -- scrub source tree for whitespace errors
+#
+
+use strict;
+use warnings;
+
+use File::Basename;
+use File::Find;
+use Encode;
+use v5.16;
+
+my $Me = $0;
+$Me =~ s,.*/,,;
+
+$SIG{HUP} = $SIG{INT} = $SIG{TERM} = $SIG{__DIE__} = sub {
+       die @_ if $^S;
+
+       my $errstr = shift;
+
+       die "$Me: ERROR: $errstr";
+};
+
+my $Errcount = 0;
+
+#
+# err -- emit error, keep total error count
+#
+sub err {
+       warn @_, "\n";
+       $Errcount++;
+}
+
+#
+# decode_file_as_string -- slurp an entire file into memory and decode
+#
+sub decode_file_as_string {
+       my ($full, $file) = @_;
+       my $fh;
+       open($fh, '<', $full) or die "$full $!\n";
+
+       local $/;
+       $_ = <$fh>;
+       close $fh;
+
+       # check known encodings or die
+       my $decoded;
+       my @encodings = ("UTF-8", "UTF-16", "UTF-16LE", "UTF-16BE");
+
+       foreach my $enc (@encodings) {
+               eval { $decoded = decode( $enc, $_, Encode::FB_CROAK ) };
+
+               if (!$@) {
+                       $decoded =~ s/\R/\n/g;
+                       return $decoded;
+               }
+       }
+
+       die "$Me: ERROR: Unknown file encoding";
+}
+
+#
+# check_whitespace -- run the checks on the given file
+#
+sub check_whitespace {
+       my ($full, $file) = @_;
+
+       my $line = 0;
+       my $eol;
+       my $nf = 0;
+       my $fstr = decode_file_as_string($full, $file);
+       my $empty = 0;
+       my $is_python = $full =~ /\.py$/;
+
+       for (split /^/, $fstr) {
+               $line++;
+               if (!$is_python && /^$/) {
+                       $empty++;
+                       if ($empty > 1) {
+                               err("$full:$line: ERROR duplicated empty line");
+                       }
+               } else {
+                       $empty = 0;
+               }
+
+               $eol = /[\n]/s;
+               if (/^\.nf$/) {
+                       err("$full:$line: ERROR: nested .nf") if $nf;
+                       $nf = 1;
+               } elsif (/^\.fi$/) {
+                       $nf = 0;
+               } elsif ($nf == 0) {
+                       chomp;
+                       err("$full:$line: ERROR: trailing whitespace") if /\s$/;
+                       err("$full:$line: ERROR: spaces before tabs") if / \t/;
+               }
+       }
+
+       err("$full:$line: .nf without .fi") if $nf;
+       err("$full:$line: noeol") unless $eol;
+}
+
+sub check_whitespace_with_exc {
+       my ($full) = @_;
+
+       $_ = $full;
+
+       return 0 if /^[.\/]*src\/common\/queue\.h/;
+       return 0 if /^[.\/]*src\/core\/valgrind\/.*\.h/;
+
+       $_ = basename($full);
+
+       return 0 unless /^(README.*|LICENSE.*|Makefile.*|CMakeLists.txt|.gitignore|TEST.*|RUNTESTS|check_whitespace|.*\.([chp13s]|sh|map|cpp|hpp|inc|PS1|ps1|py|md|cmake))$/;
+       return 0 if -z;
+
+       check_whitespace($full, $_);
+       return 1;
+}
+
+my $verbose = 0;
+my $force = 0;
+my $recursive = 0;
+
+sub check {
+       my ($file) = @_;
+       my $r;
+
+       if ($force) {
+               $r = check_whitespace($file, basename($file));
+       } else {
+               $r = check_whitespace_with_exc($file);
+       }
+
+       if ($verbose) {
+               if ($r == 0) {
+                       printf("skipped $file\n");
+               } else {
+                       printf("checked $file\n");
+               }
+       }
+}
+
+my @files = ();
+
+foreach my $arg (@ARGV) {
+       if ($arg eq '-v') {
+               $verbose = 1;
+               next;
+       }
+       if ($arg eq '-f') {
+               $force = 1;
+               next;
+       }
+       if ($arg eq '-r') {
+               $recursive = 1;
+               next;
+       }
+       if ($arg eq '-g') {
+               @files = `git ls-tree -r --name-only HEAD`;
+               chomp(@files);
+               next;
+       }
+       if ($arg eq '-h') {
+               printf "Options:
+     -g - check all files tracked by git
+     -r dir - recursively check all files in specified directory
+     -v verbose - print whether file was checked or not
+     -f force - disable blacklist\n";
+               exit 1;
+       }
+
+       if ($recursive == 1) {
+               find(sub {
+                       my $full = $File::Find::name;
+
+                       if (!$force &&
+                          ($full eq './.git' ||
+                           $full eq './src/debug' ||
+                           $full eq './src/nondebug' ||
+                           $full eq './rpmbuild' ||
+                           $full eq './dpkgbuild')) {
+                               $File::Find::prune = 1;
+                               return;
+                       }
+
+                       return unless -f;
+
+                       push @files, $full;
+               }, $arg);
+
+               $recursive = 0;
+               next;
+       }
+
+       push @files, $arg;
+}
+
+if (!@files) {
+       printf "Empty file list!\n";
+}
+
+foreach (@files) {
+       check($_);
+}
+
+exit $Errcount;
diff --git a/ceph/src/pmdk/utils/copy-source.sh b/ceph/src/pmdk/utils/copy-source.sh
new file mode 100755 (executable)
index 0000000..5bb2d58
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+#
+# utils/copy-source.sh -- copy source files (from HEAD) to 'path_to_dir/pmdk'
+# directory whether in git repository or not.
+#
+# usage: ./copy-source.sh [path_to_dir] [srcversion]
+
+set -e
+
+DESTDIR="$1"
+SRCVERSION=$2
+
+if [ -d .git ]; then
+       if [ -n "$(git status --porcelain)" ]; then
+               echo "Error: Working directory is dirty: $(git status --porcelain)"
+               exit 1
+       fi
+else
+       echo "Warning: You are not in git repository, working directory might be dirty."
+fi
+
+mkdir -p "$DESTDIR"/pmdk
+echo -n $SRCVERSION > "$DESTDIR"/pmdk/.version
+
+if [ -d .git ]; then
+       git archive HEAD | tar -x -C "$DESTDIR"/pmdk
+else
+       find . \
+       -maxdepth 1 \
+       -not -name $(basename "$DESTDIR") \
+       -not -name . \
+       -exec cp -r "{}" "$DESTDIR"/pmdk \;
+fi
diff --git a/ceph/src/pmdk/utils/cstyle b/ceph/src/pmdk/utils/cstyle
new file mode 100755 (executable)
index 0000000..5221a2d
--- /dev/null
@@ -0,0 +1,1037 @@
+#!/usr/bin/env perl
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# Portions copyright 2017, Intel Corporation.
+#
+# @(#)cstyle 1.58 98/09/09 (from shannon)
+#ident "%Z%%M% %I%     %E% SMI"
+#
+# cstyle - check for some common stylistic errors.
+#
+#      cstyle is a sort of "lint" for C coding style.
+#      It attempts to check for the style used in the
+#      kernel, sometimes known as "Bill Joy Normal Form".
+#
+#      There's a lot this can't check for, like proper indentation
+#      of code blocks.  There's also a lot more this could check for.
+#
+#      A note to the non perl literate:
+#
+#              perl regular expressions are pretty much like egrep
+#              regular expressions, with the following special symbols
+#
+#              \s      any space character
+#              \S      any non-space character
+#              \w      any "word" character [a-zA-Z0-9_]
+#              \W      any non-word character
+#              \d      a digit [0-9]
+#              \D      a non-digit
+#              \b      word boundary (between \w and \W)
+#              \B      non-word boundary
+#
+
+require 5.0;
+use IO::File;
+use Getopt::Std;
+use strict;
+use warnings;
+
+my $usage =
+"usage: cstyle [-chpvCP] [-o constructs] file ...
+       -c      check continuation indentation inside functions
+       -h      perform heuristic checks that are sometimes wrong
+       -p      perform some of the more picky checks
+       -v      verbose
+       -C      don't check anything in header block comments
+       -P      check for use of non-POSIX types
+       -o constructs
+               allow a comma-separated list of optional constructs:
+                   doxygen     allow doxygen-style block comments (/** /*!)
+                   splint      allow splint-style lint comments (/*@ ... @*/)
+";
+
+my %opts;
+
+if (!getopts("cho:pvCP", \%opts)) {
+       print $usage;
+       exit 2;
+}
+
+my $check_continuation = $opts{'c'};
+my $heuristic = $opts{'h'};
+my $picky = $opts{'p'};
+my $verbose = $opts{'v'};
+my $ignore_hdr_comment = $opts{'C'};
+my $check_posix_types = $opts{'P'};
+
+my $doxygen_comments = 0;
+my $splint_comments = 0;
+
+if (defined($opts{'o'})) {
+       for my $x (split /,/, $opts{'o'}) {
+               if ($x eq "doxygen") {
+                       $doxygen_comments = 1;
+               } elsif ($x eq "splint") {
+                       $splint_comments = 1;
+               } else {
+                       print "cstyle: unrecognized construct \"$x\"\n";
+                       print $usage;
+                       exit 2;
+               }
+       }
+}
+
+my ($filename, $line, $prev);          # shared globals
+
+my $fmt;
+my $hdr_comment_start;
+
+if ($verbose) {
+       $fmt = "%s:%d: %s\n%s\n";
+} else {
+       $fmt = "%s:%d: %s\n";
+}
+
+if ($doxygen_comments) {
+       # doxygen comments look like "/*!" or "/**"; allow them.
+       $hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
+} else {
+       $hdr_comment_start = qr/^\s*\/\*$/;
+}
+
+# Note, following must be in single quotes so that \s and \w work right.
+my $typename = '(int|char|short|long|unsigned|float|double' .
+    '|\w+_t|struct\s+\w+|union\s+\w+|FILE|BOOL)';
+
+# mapping of old types to POSIX compatible types
+my %old2posix = (
+       'unchar' => 'uchar_t',
+       'ushort' => 'ushort_t',
+       'uint' => 'uint_t',
+       'ulong' => 'ulong_t',
+       'u_int' => 'uint_t',
+       'u_short' => 'ushort_t',
+       'u_long' => 'ulong_t',
+       'u_char' => 'uchar_t',
+       'quad' => 'quad_t'
+);
+
+my $lint_re = qr/\/\*(?:
+       ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
+       CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
+       FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
+       PROTOLIB[0-9]*|SCANFLIKE[0-9]*|CSTYLED.*?
+    )\*\//x;
+
+my $splint_re = qr/\/\*@.*?@\*\//x;
+
+my $warlock_re = qr/\/\*\s*(?:
+       VARIABLES\ PROTECTED\ BY|
+       MEMBERS\ PROTECTED\ BY|
+       ALL\ MEMBERS\ PROTECTED\ BY|
+       READ-ONLY\ VARIABLES:|
+       READ-ONLY\ MEMBERS:|
+       VARIABLES\ READABLE\ WITHOUT\ LOCK:|
+       MEMBERS\ READABLE\ WITHOUT\ LOCK:|
+       LOCKS\ COVERED\ BY|
+       LOCK\ UNNEEDED\ BECAUSE|
+       LOCK\ NEEDED:|
+       LOCK\ HELD\ ON\ ENTRY:|
+       READ\ LOCK\ HELD\ ON\ ENTRY:|
+       WRITE\ LOCK\ HELD\ ON\ ENTRY:|
+       LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
+       READ\ LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
+       WRITE\ LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
+       LOCK\ RELEASED\ AS\ SIDE\ EFFECT:|
+       LOCK\ UPGRADED\ AS\ SIDE\ EFFECT:|
+       LOCK\ DOWNGRADED\ AS\ SIDE\ EFFECT:|
+       FUNCTIONS\ CALLED\ THROUGH\ POINTER|
+       FUNCTIONS\ CALLED\ THROUGH\ MEMBER|
+       LOCK\ ORDER:
+    )/x;
+
+my $err_stat = 0;              # exit status
+
+if ($#ARGV >= 0) {
+       foreach my $arg (@ARGV) {
+               my $fh = new IO::File $arg, "r";
+               if (!defined($fh)) {
+                       printf "%s: can not open\n", $arg;
+               } else {
+                       &cstyle($arg, $fh);
+                       close $fh;
+               }
+       }
+} else {
+       &cstyle("<stdin>", *STDIN);
+}
+exit $err_stat;
+
+my $no_errs = 0;               # set for CSTYLED-protected lines
+
+sub err($) {
+       my ($error) = @_;
+       unless ($no_errs) {
+               if ($verbose) {
+                       printf $fmt, $filename, $., $error, $line;
+               } else {
+                       printf $fmt, $filename, $., $error;
+               }
+               $err_stat = 1;
+       }
+}
+
+sub err_prefix($$) {
+       my ($prevline, $error) = @_;
+       my $out = $prevline."\n".$line;
+       unless ($no_errs) {
+               printf $fmt, $filename, $., $error, $out;
+               $err_stat = 1;
+       }
+}
+
+sub err_prev($) {
+       my ($error) = @_;
+       unless ($no_errs) {
+               printf $fmt, $filename, $. - 1, $error, $prev;
+               $err_stat = 1;
+       }
+}
+
+sub cstyle($$) {
+
+my ($fn, $filehandle) = @_;
+$filename = $fn;                       # share it globally
+
+my $in_cpp = 0;
+my $next_in_cpp = 0;
+
+my $in_comment = 0;
+my $in_header_comment = 0;
+my $comment_done = 0;
+my $in_warlock_comment = 0;
+my $in_function = 0;
+my $in_function_header = 0;
+my $in_declaration = 0;
+my $note_level = 0;
+my $nextok = 0;
+my $nocheck = 0;
+
+my $in_string = 0;
+
+my ($okmsg, $comment_prefix);
+
+$line = '';
+$prev = '';
+reset_indent();
+
+line: while (<$filehandle>) {
+       s/\r?\n$//;     # strip return and newline
+
+       # save the original line, then remove all text from within
+       # double or single quotes, we do not want to check such text.
+
+       $line = $_;
+
+       #
+       # C allows strings to be continued with a backslash at the end of
+       # the line.  We translate that into a quoted string on the previous
+       # line followed by an initial quote on the next line.
+       #
+       # (we assume that no-one will use backslash-continuation with character
+       # constants)
+       #
+       $_ = '"' . $_           if ($in_string && !$nocheck && !$in_comment);
+
+       #
+       # normal strings and characters
+       #
+       s/'([^\\']|\\[^xX0]|\\0[0-9]*|\\[xX][0-9a-fA-F]*)'/''/g;
+       s/"([^\\"]|\\.)*"/\"\"/g;
+
+       #
+       # detect string continuation
+       #
+       if ($nocheck || $in_comment) {
+               $in_string = 0;
+       } else {
+               #
+               # Now that all full strings are replaced with "", we check
+               # for unfinished strings continuing onto the next line.
+               #
+               $in_string =
+                   (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
+                   s/^("")*"([^\\"]|\\.)*\\$/""/);
+       }
+
+       #
+       # figure out if we are in a cpp directive
+       #
+       $in_cpp = $next_in_cpp || /^\s*#/;      # continued or started
+       $next_in_cpp = $in_cpp && /\\$/;        # only if continued
+
+       # strip off trailing backslashes, which appear in long macros
+       s/\s*\\$//;
+
+       # an /* END CSTYLED */ comment ends a no-check block.
+       if ($nocheck) {
+               if (/\/\* *END *CSTYLED *\*\//) {
+                       $nocheck = 0;
+               } else {
+                       reset_indent();
+                       next line;
+               }
+       }
+
+       # a /*CSTYLED*/ comment indicates that the next line is ok.
+       if ($nextok) {
+               if ($okmsg) {
+                       err($okmsg);
+               }
+               $nextok = 0;
+               $okmsg = 0;
+               if (/\/\* *CSTYLED.*\*\//) {
+                       /^.*\/\* *CSTYLED *(.*) *\*\/.*$/;
+                       $okmsg = $1;
+                       $nextok = 1;
+               }
+               $no_errs = 1;
+       } elsif ($no_errs) {
+               $no_errs = 0;
+       }
+
+       # check length of line.
+       # first, a quick check to see if there is any chance of being too long.
+       if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
+               # yes, there is a chance.
+               # replace tabs with spaces and check again.
+               my $eline = $line;
+               1 while $eline =~
+                   s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
+               if (length($eline) > 80) {
+                       # allow long line if it is user visible string
+                       # find if line start from " or L" and ends
+                       # with " + 2 optional characters
+                       # (these characters can be i.e. '");' '" \' or '",' etc...)
+                       if($eline =~ /^ *L?".*"[^"]{0,2}$/) {
+                               # check if entire line is one string literal
+                               $eline =~ s/^ *L?"//;
+                               $eline =~ s/"[^"]{0,2}$//;
+
+                               if($eline =~ /[^\\]"|[^\\](\\\\)+"/) {
+                                       err("line > 80 characters");
+                               }
+                       } else {
+                               err("line > 80 characters");
+                       }
+               }
+       }
+
+       # ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
+       if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
+               s/[^()]//g;                       # eliminate all non-parens
+               $note_level += s/\(//g - length;  # update paren nest level
+               next;
+       }
+
+       # a /* BEGIN CSTYLED */ comment starts a no-check block.
+       if (/\/\* *BEGIN *CSTYLED *\*\//) {
+               $nocheck = 1;
+       }
+
+       # a /*CSTYLED*/ comment indicates that the next line is ok.
+       if (/\/\* *CSTYLED.*\*\//) {
+               /^.*\/\* *CSTYLED *(.*) *\*\/.*$/;
+               $okmsg = $1;
+               $nextok = 1;
+       }
+       if (/\/\/ *CSTYLED/) {
+               /^.*\/\/ *CSTYLED *(.*)$/;
+               $okmsg = $1;
+               $nextok = 1;
+       }
+
+       # universal checks; apply to everything
+       if (/\t +\t/) {
+               err("spaces between tabs");
+       }
+       if (/ \t+ /) {
+               err("tabs between spaces");
+       }
+       if (/\s$/) {
+               err("space or tab at end of line");
+       }
+       if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
+               err("comment preceded by non-blank");
+       }
+
+       # is this the beginning or ending of a function?
+       # (not if "struct foo\n{\n")
+       if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
+               $in_function = 1;
+               $in_declaration = 1;
+               $in_function_header = 0;
+               $prev = $line;
+               next line;
+       }
+       if (/^}\s*(\/\*.*\*\/\s*)*$/) {
+               if ($prev =~ /^\s*return\s*;/) {
+                       err_prev("unneeded return at end of function");
+               }
+               $in_function = 0;
+               reset_indent();         # we don't check between functions
+               $prev = $line;
+               next line;
+       }
+       if (/^\w*\($/) {
+               $in_function_header = 1;
+       }
+
+       if ($in_warlock_comment && /\*\//) {
+               $in_warlock_comment = 0;
+               $prev = $line;
+               next line;
+       }
+
+       # a blank line terminates the declarations within a function.
+       # XXX - but still a problem in sub-blocks.
+       if ($in_declaration && /^$/) {
+               $in_declaration = 0;
+       }
+
+       if ($comment_done) {
+               $in_comment = 0;
+               $in_header_comment = 0;
+               $comment_done = 0;
+       }
+       # does this looks like the start of a block comment?
+       if (/$hdr_comment_start/) {
+               if (!/^\t*\/\*/) {
+                       err("block comment not indented by tabs");
+               }
+               $in_comment = 1;
+               /^(\s*)\//;
+               $comment_prefix = $1;
+               if ($comment_prefix eq "") {
+                       $in_header_comment = 1;
+               }
+               $prev = $line;
+               next line;
+       }
+       # are we still in the block comment?
+       if ($in_comment) {
+               if (/^$comment_prefix \*\/$/) {
+                       $comment_done = 1;
+               } elsif (/\*\//) {
+                       $comment_done = 1;
+                       err("improper block comment close")
+                           unless ($ignore_hdr_comment && $in_header_comment);
+               } elsif (!/^$comment_prefix \*[ \t]/ &&
+                   !/^$comment_prefix \*$/) {
+                       err("improper block comment")
+                           unless ($ignore_hdr_comment && $in_header_comment);
+               }
+       }
+
+       if ($in_header_comment && $ignore_hdr_comment) {
+               $prev = $line;
+               next line;
+       }
+
+       # check for errors that might occur in comments and in code.
+
+       # allow spaces to be used to draw pictures in header and block comments.
+       if (/[^ ]     / && !/".*     .*"/ && !$in_header_comment && !$in_comment) {
+               err("spaces instead of tabs");
+       }
+       if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
+           (!/^    \w/ || $in_function != 0)) {
+               err("indent by spaces instead of tabs");
+       }
+       if (/^\t+ [^ \t\*]/ || /^\t+  \S/ || /^\t+   \S/) {
+               err("continuation line not indented by 4 spaces");
+       }
+       if (/$warlock_re/ && !/\*\//) {
+               $in_warlock_comment = 1;
+               $prev = $line;
+               next line;
+       }
+       if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
+               err("improper first line of block comment");
+       }
+
+       if ($in_comment) {      # still in comment, don't do further checks
+               $prev = $line;
+               next line;
+       }
+
+       if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
+           !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+               err("missing blank after open comment");
+       }
+       if (/\S\*\/[^)]|\S\*\/$/ &&
+           !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+               err("missing blank before close comment");
+       }
+       if (/\/\/\S/) {         # C++ comments
+               err("missing blank after start comment");
+       }
+       # check for unterminated single line comments, but allow them when
+       # they are used to comment out the argument list of a function
+       # declaration.
+       if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
+               err("unterminated single line comment");
+       }
+
+       if (/^(#else|#endif|#include)(.*)$/) {
+               $prev = $line;
+               if ($picky) {
+                       my $directive = $1;
+                       my $clause = $2;
+                       # Enforce ANSI rules for #else and #endif: no noncomment
+                       # identifiers are allowed after #endif or #else.  Allow
+                       # C++ comments since they seem to be a fact of life.
+                       if ((($1 eq "#endif") || ($1 eq "#else")) &&
+                           ($clause ne "") &&
+                           (!($clause =~ /^\s+\/\*.*\*\/$/)) &&
+                           (!($clause =~ /^\s+\/\/.*$/))) {
+                               err("non-comment text following " .
+                                   "$directive (or malformed $directive " .
+                                   "directive)");
+                       }
+               }
+               next line;
+       }
+
+       #
+       # delete any comments and check everything else.  Note that
+       # ".*?" is a non-greedy match, so that we don't get confused by
+       # multiple comments on the same line.
+       #
+       s/\/\*.*?\*\//\x01/g;
+       s/\/\/.*$/\x01/;                # C++ comments
+
+       # delete any trailing whitespace; we have already checked for that.
+       s/\s*$//;
+
+       # following checks do not apply to text in comments.
+
+       if (/[^ \t\+]\+[^\+=]/ || /[^\+]\+[^ \+=]/) {
+               err("missing space around + operator");
+       }
+       if (/[^ \t]\+=/ || /\+=[^ ]/) {
+               err("missing space around += operator");
+       }
+       if (/[^ \t\-]\-[^\->]/ && !/\(\w+\)\-\w/ && !/[\(\[]\-[\w \t]+[\)\],]/) {
+               err("missing space before - operator");
+       }
+       if (/[^\-]\-[^ \-=>]/ && !/\(\-\w+\)/ &&
+               !/(return|case|=|>|<|\?|:|,|^[ \t]+)[ \t]+\-[\w\(]/ && !/(\([^\)]+\)|\[|\()\-[\w\(\]]/) {
+               err("missing space after - operator");
+       }
+       if (/(return|case|=|\?|:|,|\[)[ \t]+\-[ \t]/ || /[\(\[]\-[ \t]/) {
+               err("extra space after - operator");
+       }
+       if (/[ \t]\+\+ /) {
+               err("extra space before or after ++ operator");
+       }
+       if (/[ \t]\-\- /) {
+               err("extra space before or after -- operator");
+       }
+       if (/[^ \t]\-=/ || /\-=[^ ]/) {
+               err("missing space around -= operator");
+       }
+       if (/[^ \t][\%\/]/ || /[\%\/][^ =]/ || /[\%\/]=[^ ]/) {
+               err("missing space around one of operators: % %= / /=");
+       }
+       if (/[^ \t]\*=/ || /\*=[^ ]/) {
+               err("missing space around *= operator");
+       }
+       if (/[^ \t\(\)\*\[]\*/) {
+               err("missing space before * operator");
+       }
+       if (/\*[^ =\*\w\(,]/ && !/\(.+ \*+\)/ && !/\*\[\]/ &&
+           !/\*\-\-\w/ && !/\*\+\+\w/ && !/\*\)/) {
+               err("missing space after * operator");
+       }
+       if (/[^<>\s][!<>=]=/ || /[^<>][!<>=]=[^\s,]/ ||
+           (/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
+           (/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
+           /[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
+               err("missing space around relational operator");
+       }
+       if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
+           (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
+           (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
+               # XXX - should only check this for C++ code
+               # XXX - there are probably other forms that should be allowed
+               if (!/\soperator=/) {
+                       err("missing space around assignment operator");
+               }
+       }
+       if (/[,;]\S/ && !/\bfor \(;;\)/) {
+               err("comma or semicolon followed by non-blank");
+       }
+       # allow "for" statements to have empty "while" clauses
+       if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
+               err("comma or semicolon preceded by blank");
+       }
+       if (/^\s*(&&|\|\|)/) {
+               err("improper boolean continuation");
+       }
+       if (/\S   *(&&|\|\|)/ || /(&&|\|\|)   *\S/) {
+               err("more than one space around boolean operator");
+       }
+       if (/\b(for|if|while|switch|return|case)\(/) {
+               err("missing space between keyword and paren");
+       }
+       if (/(\b(for|if|while|switch|return)\b.*){2,}/ && !/^#define/) {
+               # multiple "case" and "sizeof" allowed
+               err("more than one keyword on line");
+       }
+       if (/\b(for|if|while|switch|return|case)\s\s+\(/ &&
+           !/^#if\s+\(/) {
+               err("extra space between keyword and paren");
+       }
+       # try to detect "func (x)" but not "if (x)" or
+       # "#define foo (x)" or "int (*func)();"
+       if (/\w\s\(/) {
+               my $s = $_;
+               # strip off all keywords on the line
+               s/\b(for|if|while|switch|return|case)\s\(/XXX(/g;
+               s/\b(sizeof|typeof|__typeof__)\s*\(/XXX(/g;
+               s/#elif\s\(/XXX(/g;
+               s/^#define\s+\w+\s+\(/XXX(/;
+               # do not match things like "void (*f)();"
+               # or "typedef void (func_t)();"
+               s/\w\s\(+\*/XXX(*/g;
+               s/\b($typename|void)\s+\(+/XXX(/og;
+               s/\btypedef\s($typename|void)\s+\(+/XXX(/og;
+               # do not match "__attribute__ ((format (...)))"
+               s/\b__attribute__\s*\(\(format\s*\(/__attribute__((XXX(/g;
+               if (/\w\s\(/) {
+                       err("extra space between function name and left paren");
+               }
+               $_ = $s;
+       }
+       # try to detect "int foo(x)", but not "extern int foo(x);"
+       # XXX - this still trips over too many legitimate things,
+       # like "int foo(x,\n\ty);"
+#              if (/^(\w+(\s|\*)+)+\w+\(/ && !/\)[;,](\s|\x01)*$/ &&
+#                  !/^(extern|static)\b/) {
+#                      err("return type of function not on separate line");
+#              }
+       # this is a close approximation
+       if (/^(\w+(\s|\*)+)+\w+\(.*\)(\s|\x01)*$/ &&
+           !/^(extern|static)\b/) {
+               err("return type of function not on separate line");
+       }
+       if (/^#define\t/ || /^#ifdef\t/ || /^#ifndef\t/) {
+               err("#define/ifdef/ifndef followed by tab instead of space");
+       }
+       if (/^#define\s\s+/ || /^#ifdef\s\s+/ || /^#ifndef\s\s+/) {
+               err("#define/ifdef/ifndef followed by more than one space");
+       }
+       # AON C-style doesn't require this.
+       #if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
+       #       err("unparenthesized return expression");
+       #}
+       if (/\bsizeof\b/ && !/\bsizeof\s*\(.*\)/) {
+               err("unparenthesized sizeof expression");
+       }
+       if (/\b(sizeof|typeof)\b/ && /\b(sizeof|typeof)\s+\(.*\)/) {
+               err("spaces between sizeof/typeof expression and paren");
+       }
+       if (/\(\s/) {
+               err("whitespace after left paren");
+       }
+       # allow "for" statements to have empty "continue" clauses
+       if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) {
+               err("whitespace before right paren");
+       }
+       if (/^\s*\(void\)[^ ]/) {
+               err("missing space after (void) cast");
+       }
+       if (/\S\{/ && !/\{\{/ && !/\(struct \w+\)\{/) {
+               err("missing space before left brace");
+       }
+       if ($in_function && /^\s+{/ &&
+           ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
+               err("left brace starting a line");
+       }
+       if (/}(else|while)/) {
+               err("missing space after right brace");
+       }
+       if (/}\s\s+(else|while)/) {
+               err("extra space after right brace");
+       }
+       if (/\b_VOID\b|\bVOID\b|\bSTATIC\b/) {
+               err("obsolete use of VOID or STATIC");
+       }
+       if (/\b($typename|void)\*/o) {
+               err("missing space between type name and *");
+       }
+       if (/^\s+#/) {
+               err("preprocessor statement not in column 1");
+       }
+       if (/^#\s/) {
+               err("blank after preprocessor #");
+       }
+       if (/!\s*(strcmp|strncmp|bcmp)\s*\(/) {
+               err("don't use boolean ! with comparison functions");
+       }
+       if (/^\S+\([\S\s]*\)\s*{/) {
+               err("brace of function definition not at beginning of line");
+       }
+       if (/static\s+\S+\s*=\s*(0|NULL)\s*;/) {
+               err("static variable initialized with 0 or NULL");
+       }
+       if (/typedef[\S\s]+\*\s*\w+\s*;/) {
+               err("typedefed pointer type");
+       }
+       if (/unsigned\s+int\s/) {
+               err("'unsigned int' instead of just 'unsigned'");
+       }
+       if (/long\s+long\s+int\s/) {
+               err("'long long int' instead of just 'long long'");
+       } elsif (/long\s+int\s/) {
+               err("'long int' instead of just 'long'");
+       }
+
+       #
+       # We completely ignore, for purposes of indentation:
+       #  * lines outside of functions
+       #  * preprocessor lines
+       #
+       if ($check_continuation && $in_function && !$in_cpp) {
+               process_indent($_);
+       }
+       if ($picky) {
+               # try to detect spaces after casts, but allow (e.g.)
+               # "sizeof (int) + 1", "void (*funcptr)(int) = foo;", and
+               # "int foo(int) __NORETURN;"
+               if ((/^\($typename( \*+)?\)\s/o ||
+                   /\W\($typename( \*+)?\)\s/o) &&
+                   !/sizeof\($typename( \*)?\)\s/o &&
+                   !/\($typename( \*+)?\)\s+=[^=]/o) {
+                       err("space after cast");
+               }
+               if (/\b($typename|void)\s*\*\s/o &&
+                   !/\b($typename|void)\s*\*\s+const\b/o) {
+                       err("unary * followed by space");
+               }
+       }
+       if ($check_posix_types) {
+               # try to detect old non-POSIX types.
+               # POSIX requires all non-standard typedefs to end in _t,
+               # but historically these have been used.
+               if (/\b(unchar|ushort|uint|ulong|u_int|u_short|u_long|u_char|quad)\b/) {
+                       err("non-POSIX typedef $1 used: use $old2posix{$1} instead");
+               }
+       }
+       if ($heuristic) {
+               # cannot check this everywhere due to "struct {\n...\n} foo;"
+               if ($in_function && !$in_declaration &&
+                   /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|\x01)*$/ &&
+                   !/} (else|while)/ && !/}}/) {
+                       err("possible bad text following right brace");
+               }
+               # cannot check this because sub-blocks in
+               # the middle of code are ok
+               if ($in_function && /^\s+{/) {
+                       err("possible left brace starting a line");
+               }
+       }
+       if (/^\s*else\W/) {
+               if ($prev =~ /^\s*}$/) {
+                       err_prefix($prev,
+                           "else and right brace should be on same line");
+               }
+       }
+       $prev = $line;
+}
+
+if ($prev eq "") {
+       err("last line in file is blank");
+}
+
+}
+
+#
+# Continuation-line checking
+#
+# The rest of this file contains the code for the continuation checking
+# engine.  It's a pretty simple state machine which tracks the expression
+# depth (unmatched '('s and '['s).
+#
+# Keep in mind that the argument to process_indent() has already been heavily
+# processed; all comments have been replaced by control-A, and the contents of
+# strings and character constants have been elided.
+#
+
+my $cont_in;           # currently inside of a continuation
+my $cont_off;          # skipping an initializer or definition
+my $cont_noerr;                # suppress cascading errors
+my $cont_start;                # the line being continued
+my $cont_base;         # the base indentation
+my $cont_first;                # this is the first line of a statement
+my $cont_multiseg;     # this continuation has multiple segments
+
+my $cont_special;      # this is a C statement (if, for, etc.)
+my $cont_macro;                # this is a macro
+my $cont_case;         # this is a multi-line case
+
+my @cont_paren;                # the stack of unmatched ( and [s we've seen
+
+sub
+reset_indent()
+{
+       $cont_in = 0;
+       $cont_off = 0;
+}
+
+sub
+delabel($)
+{
+       #
+       # replace labels with tabs.  Note that there may be multiple
+       # labels on a line.
+       #
+       local $_ = $_[0];
+
+       while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
+               my ($pre_tabs, $label, $rest) = ($1, $2, $3);
+               $_ = $pre_tabs;
+               while ($label =~ s/^([^\t]*)(\t+)//) {
+                       $_ .= "\t" x (length($2) + length($1) / 8);
+               }
+               $_ .= ("\t" x (length($label) / 8)).$rest;
+       }
+
+       return ($_);
+}
+
+sub
+process_indent($)
+{
+       require strict;
+       local $_ = $_[0];                       # preserve the global $_
+
+       s/\x01//g;      # No comments
+       s/\s+$//;       # Strip trailing whitespace
+
+       return                  if (/^$/);      # skip empty lines
+
+       # regexps used below; keywords taking (), macros, and continued cases
+       my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
+       my $macro = '[A-Z_][A-Z_0-9]*\(';
+       my $case = 'case\b[^:]*$';
+
+       # skip over enumerations, array definitions, initializers, etc.
+       if ($cont_off <= 0 && !/^\s*$special/ &&
+           (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*))\{/ ||
+           (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
+               $cont_in = 0;
+               $cont_off = tr/{/{/ - tr/}/}/;
+               return;
+       }
+       if ($cont_off) {
+               $cont_off += tr/{/{/ - tr/}/}/;
+               return;
+       }
+
+       if (!$cont_in) {
+               $cont_start = $line;
+
+               if (/^\t* /) {
+                       err("non-continuation indented 4 spaces");
+                       $cont_noerr = 1;                # stop reporting
+               }
+               $_ = delabel($_);       # replace labels with tabs
+
+               # check if the statement is complete
+               return          if (/^\s*\}?$/);
+               return          if (/^\s*\}?\s*else\s*\{?$/);
+               return          if (/^\s*do\s*\{?$/);
+               return          if (/{$/);
+               return          if (/}[,;]?$/);
+
+               # Allow macros on their own lines
+               return          if (/^\s*[A-Z_][A-Z_0-9]*$/);
+
+               # cases we don't deal with, generally non-kosher
+               if (/{/) {
+                       err("stuff after {");
+                       return;
+               }
+
+               # Get the base line, and set up the state machine
+               /^(\t*)/;
+               $cont_base = $1;
+               $cont_in = 1;
+               @cont_paren = ();
+               $cont_first = 1;
+               $cont_multiseg = 0;
+
+               # certain things need special processing
+               $cont_special = /^\s*$special/? 1 : 0;
+               $cont_macro = /^\s*$macro/? 1 : 0;
+               $cont_case = /^\s*$case/? 1 : 0;
+       } else {
+               $cont_first = 0;
+
+               # Strings may be pulled back to an earlier (half-)tabstop
+               unless ($cont_noerr || /^$cont_base    / ||
+                   (/^\t*(?:    )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
+                       err_prefix($cont_start,
+                           "continuation should be indented 4 spaces");
+               }
+       }
+
+       my $rest = $_;                  # keeps the remainder of the line
+
+       #
+       # The split matches 0 characters, so that each 'special' character
+       # is processed separately.  Parens and brackets are pushed and
+       # popped off the @cont_paren stack.  For normal processing, we wait
+       # until a ; or { terminates the statement.  "special" processing
+       # (if/for/while/switch) is allowed to stop when the stack empties,
+       # as is macro processing.  Case statements are terminated with a :
+       # and an empty paren stack.
+       #
+       foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
+               next            if (length($_) == 0);
+
+               # rest contains the remainder of the line
+               my $rxp = "[^\Q$_\E]*\Q$_\E";
+               $rest =~ s/^$rxp//;
+
+               if (/\(/ || /\[/) {
+                       push @cont_paren, $_;
+               } elsif (/\)/ || /\]/) {
+                       my $cur = $_;
+                       tr/\)\]/\(\[/;
+
+                       my $old = (pop @cont_paren);
+                       if (!defined($old)) {
+                               err("unexpected '$cur'");
+                               $cont_in = 0;
+                               last;
+                       } elsif ($old ne $_) {
+                               err("'$cur' mismatched with '$old'");
+                               $cont_in = 0;
+                               last;
+                       }
+
+                       #
+                       # If the stack is now empty, do special processing
+                       # for if/for/while/switch and macro statements.
+                       #
+                       next            if (@cont_paren != 0);
+                       if ($cont_special) {
+                               if ($rest =~ /^\s*{?$/) {
+                                       $cont_in = 0;
+                                       last;
+                               }
+                               if ($rest =~ /^\s*;$/) {
+                                       err("empty if/for/while body ".
+                                           "not on its own line");
+                                       $cont_in = 0;
+                                       last;
+                               }
+                               if (!$cont_first && $cont_multiseg == 1) {
+                                       err_prefix($cont_start,
+                                           "multiple statements continued ".
+                                           "over multiple lines");
+                                       $cont_multiseg = 2;
+                               } elsif ($cont_multiseg == 0) {
+                                       $cont_multiseg = 1;
+                               }
+                               # We've finished this section, start
+                               # processing the next.
+                               goto section_ended;
+                       }
+                       if ($cont_macro) {
+                               if ($rest =~ /^$/) {
+                                       $cont_in = 0;
+                                       last;
+                               }
+                       }
+               } elsif (/\;/) {
+                       if ($cont_case) {
+                               err("unexpected ;");
+                       } elsif (!$cont_special) {
+                               err("unexpected ;")     if (@cont_paren != 0);
+                               if (!$cont_first && $cont_multiseg == 1) {
+                                       err_prefix($cont_start,
+                                           "multiple statements continued ".
+                                           "over multiple lines");
+                                       $cont_multiseg = 2;
+                               } elsif ($cont_multiseg == 0) {
+                                       $cont_multiseg = 1;
+                               }
+                               if ($rest =~ /^$/) {
+                                       $cont_in = 0;
+                                       last;
+                               }
+                               if ($rest =~ /^\s*special/) {
+                                       err("if/for/while/switch not started ".
+                                           "on its own line");
+                               }
+                               goto section_ended;
+                       }
+               } elsif (/\{/) {
+                       err("{ while in parens/brackets") if (@cont_paren != 0);
+                       err("stuff after {")            if ($rest =~ /[^\s}]/);
+                       $cont_in = 0;
+                       last;
+               } elsif (/\}/) {
+                       err("} while in parens/brackets") if (@cont_paren != 0);
+                       if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
+                               if ($rest =~ /^$/) {
+                                       err("unexpected }");
+                               } else {
+                                       err("stuff after }");
+                               }
+                               $cont_in = 0;
+                               last;
+                       }
+               } elsif (/\:/ && $cont_case && @cont_paren == 0) {
+                       err("stuff after multi-line case") if ($rest !~ /$^/);
+                       $cont_in = 0;
+                       last;
+               }
+               next;
+section_ended:
+               # End of a statement or if/while/for loop.  Reset
+               # cont_special and cont_macro based on the rest of the
+               # line.
+               $cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
+               $cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
+               $cont_case = 0;
+               next;
+       }
+       $cont_noerr = 0                 if (!$cont_in);
+}
diff --git a/ceph/src/pmdk/utils/docker/0001-travis-fix-travisci_build_coverity_scan.sh.patch b/ceph/src/pmdk/utils/docker/0001-travis-fix-travisci_build_coverity_scan.sh.patch
new file mode 100644 (file)
index 0000000..9738942
--- /dev/null
@@ -0,0 +1,27 @@
+From b5179dc4822eaab192361da05aa95d98f523960f Mon Sep 17 00:00:00 2001
+From: Lukasz Dorau <lukasz.dorau@intel.com>
+Date: Mon, 7 May 2018 12:05:40 +0200
+Subject: [PATCH] travis: fix travisci_build_coverity_scan.sh
+
+---
+ travisci_build_coverity_scan.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/travisci_build_coverity_scan.sh b/travisci_build_coverity_scan.sh
+index ad9d4afcf..562b08bcc 100644
+--- a/travisci_build_coverity_scan.sh
++++ b/travisci_build_coverity_scan.sh
+@@ -92,8 +92,8 @@ response=$(curl \
+   --form description="Travis CI build" \
+   $UPLOAD_URL)
+ status_code=$(echo "$response" | sed -n '$p')
+-if [ "$status_code" != "201" ]; then
++if [ "$status_code" != "200" ]; then
+   TEXT=$(echo "$response" | sed '$d')
+-  echo -e "\033[33;1mCoverity Scan upload failed: $TEXT.\033[0m"
++  echo -e "\033[33;1mCoverity Scan upload failed: $response.\033[0m"
+   exit 1
+ fi
+-- 
+2.13.6
+
diff --git a/ceph/src/pmdk/utils/docker/README b/ceph/src/pmdk/utils/docker/README
new file mode 100644 (file)
index 0000000..b4a2713
--- /dev/null
@@ -0,0 +1,19 @@
+Persistent Memory Development Kit
+
+This is utils/docker/README.
+
+Scripts in this directory let Travis CI run a Docker container with ubuntu-
+or fedora-based environment and build PMDK project inside it.
+
+'build-local.sh' can be used to build PMDK locally.
+
+'build-CI.sh' is used for building PMDK on Travis and GitHub Actions CIs
+
+NOTE:
+If you commit changes to any Dockerfile or shell script in the 'images'
+subdirectory and then do git-rebase before pushing your commits to the
+repository, make sure that you do not squash the commit which is the head in
+your repository. This will let Travis and GitHub Actions CIs recreate
+Docker images used during the build before the build. Otherwise the not-updated
+Docker image will be pulled from the Docker Hub and used during the build on
+Travis and GitHub Actions CIs.
diff --git a/ceph/src/pmdk/utils/docker/build-CI.sh b/ceph/src/pmdk/utils/docker/build-CI.sh
new file mode 100755 (executable)
index 0000000..1b75d3b
--- /dev/null
@@ -0,0 +1,143 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# build-CI.sh - runs a Docker container from a Docker image with environment
+#                   prepared for building PMDK project and starts building PMDK.
+#
+# This script is used for building PMDK on Travis and GitHub Actions CIs.
+#
+
+set -e
+
+source $(dirname $0)/set-ci-vars.sh
+source $(dirname $0)/set-vars.sh
+source $(dirname $0)/valid-branches.sh
+
+if [[ "$CI_EVENT_TYPE" != "cron" && "$CI_BRANCH" != "coverity_scan" \
+       && "$COVERITY" -eq 1 ]]; then
+       echo "INFO: Skip Coverity scan job if build is triggered neither by " \
+               "'cron' nor by a push to 'coverity_scan' branch"
+       exit 0
+fi
+
+if [[ ( "$CI_EVENT_TYPE" == "cron" || "$CI_BRANCH" == "coverity_scan" )\
+       && "$COVERITY" -ne 1 ]]; then
+       echo "INFO: Skip regular jobs if build is triggered either by 'cron'" \
+               " or by a push to 'coverity_scan' branch"
+       exit 0
+fi
+
+if [[ -z "$OS" || -z "$OS_VER" ]]; then
+       echo "ERROR: The variables OS and OS_VER have to be set properly " \
+               "(eg. OS=ubuntu, OS_VER=16.04)."
+       exit 1
+fi
+
+if [[ -z "$HOST_WORKDIR" ]]; then
+       echo "ERROR: The variable HOST_WORKDIR has to contain a path to " \
+               "the root of the PMDK project on the host machine"
+       exit 1
+fi
+
+if [[ -z "$TEST_BUILD" ]]; then
+       TEST_BUILD=all
+fi
+
+imageName=${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
+containerName=pmdk-${OS}-${OS_VER}
+
+if [[ $MAKE_PKG -eq 0 ]] ; then command="./run-build.sh"; fi
+if [[ $MAKE_PKG -eq 1 ]] ; then command="./run-build-package.sh"; fi
+if [[ $COVERAGE -eq 1 ]] ; then command="./run-coverage.sh"; ci_env=`bash <(curl -s https://codecov.io/env)`; fi
+
+if [[ ( "$CI_EVENT_TYPE" == "cron" || "$CI_BRANCH" == "coverity_scan" )\
+       && "$COVERITY" -eq 1 ]]; then
+       command="./run-coverity.sh"
+fi
+
+if [ -n "$DNS_SERVER" ]; then DNS_SETTING=" --dns=$DNS_SERVER "; fi
+if [[ -f $CI_FILE_SKIP_BUILD_PKG_CHECK ]]; then BUILD_PACKAGE_CHECK=n; else BUILD_PACKAGE_CHECK=y; fi
+if [ -z "$NDCTL_ENABLE" ]; then ndctl_enable=; else ndctl_enable="--env NDCTL_ENABLE=$NDCTL_ENABLE"; fi
+if [[ $UBSAN -eq 1 ]]; then for x in C CPP LD; do declare EXTRA_${x}FLAGS=-fsanitize=undefined; done; fi
+
+# Only run doc update on $GITHUB_REPO master or stable branch
+if [[ -z "${CI_BRANCH}" || -z "${TARGET_BRANCHES[${CI_BRANCH}]}" || "$CI_EVENT_TYPE" == "pull_request" || "$CI_REPO_SLUG" != "${GITHUB_REPO}" ]]; then
+       AUTO_DOC_UPDATE=0
+fi
+
+# Check if we are running on a CI (Travis or GitHub Actions)
+[ -n "$GITHUB_ACTIONS" -o -n "$TRAVIS" ] && CI_RUN="YES" || CI_RUN="NO"
+
+# We have a blacklist only for ppc64le arch
+if [[ "$CI_CPU_ARCH" == ppc64le ]] ; then BLACKLIST_FILE=../../utils/docker/ppc64le.blacklist; fi
+
+# docker on travis + ppc64le runs inside an LXD container and for security
+# limits what can be done inside it, and as such, `docker run` fails with
+# > the input device is not a TTY
+# when using -t because of limited permissions to /dev imposed by LXD.
+if [[ -n "$TRAVIS" && "$CI_CPU_ARCH" == ppc64le ]] || [[ -n "$GITHUB_ACTIONS" ]]; then
+       TTY=''
+else
+       TTY='-t'
+fi
+
+WORKDIR=/pmdk
+SCRIPTSDIR=$WORKDIR/utils/docker
+
+# Run a container with
+#  - environment variables set (--env)
+#  - host directory containing PMDK source mounted (-v)
+#  - a tmpfs /tmp with the necessary size and permissions (--tmpfs)*
+#  - working directory set (-w)
+#
+# * We need a tmpfs /tmp inside docker but we cannot run it with --privileged
+#   and do it from inside, so we do using this docker-run option.
+#   By default --tmpfs add nosuid,nodev,noexec to the mount flags, we don't
+#   want that and just to make sure we add the usually default rw,relatime just
+#   in case docker change the defaults.
+docker run --rm --name=$containerName -i $TTY \
+       $DNS_SETTING \
+       $ci_env \
+       --env http_proxy=$http_proxy \
+       --env https_proxy=$https_proxy \
+       --env AUTO_DOC_UPDATE=$AUTO_DOC_UPDATE \
+       --env CC=$PMDK_CC \
+       --env CXX=$PMDK_CXX \
+       --env VALGRIND=$VALGRIND \
+       --env EXTRA_CFLAGS=$EXTRA_CFLAGS \
+       --env EXTRA_CXXFLAGS=$EXTRA_CXXFLAGS \
+       --env EXTRA_LDFLAGS=$EXTRA_LDFLAGS \
+       --env REMOTE_TESTS=$REMOTE_TESTS \
+       --env TEST_BUILD=$TEST_BUILD \
+       --env WORKDIR=$WORKDIR \
+       --env EXPERIMENTAL=$EXPERIMENTAL \
+       --env BUILD_PACKAGE_CHECK=$BUILD_PACKAGE_CHECK \
+       --env SCRIPTSDIR=$SCRIPTSDIR \
+       --env TRAVIS=$TRAVIS \
+       --env CI_COMMIT_RANGE=$CI_COMMIT_RANGE \
+       --env CI_COMMIT=$CI_COMMIT \
+       --env CI_REPO_SLUG=$CI_REPO_SLUG \
+       --env CI_BRANCH=$CI_BRANCH \
+       --env CI_EVENT_TYPE=$CI_EVENT_TYPE \
+       --env DOC_UPDATE_GITHUB_TOKEN=$DOC_UPDATE_GITHUB_TOKEN \
+       --env COVERITY_SCAN_TOKEN=$COVERITY_SCAN_TOKEN \
+       --env COVERITY_SCAN_NOTIFICATION_EMAIL=$COVERITY_SCAN_NOTIFICATION_EMAIL \
+       --env FAULT_INJECTION=$FAULT_INJECTION \
+       --env GITHUB_ACTIONS=$GITHUB_ACTIONS \
+       --env GITHUB_HEAD_REF=$GITHUB_HEAD_REF \
+       --env GITHUB_REPO=$GITHUB_REPO \
+       --env GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+       --env GITHUB_REF=$GITHUB_REF \
+       --env GITHUB_RUN_ID=$GITHUB_RUN_ID \
+       --env GITHUB_SHA=$GITHUB_SHA \
+       --env CI_RUN=$CI_RUN \
+       --env SRC_CHECKERS=$SRC_CHECKERS \
+       --env BLACKLIST_FILE=$BLACKLIST_FILE \
+       $ndctl_enable \
+       --tmpfs /tmp:rw,relatime,suid,dev,exec,size=6G \
+       -v $HOST_WORKDIR:$WORKDIR \
+       -v /etc/localtime:/etc/localtime \
+       -w $SCRIPTSDIR \
+       $imageName $command
diff --git a/ceph/src/pmdk/utils/docker/build-local.sh b/ceph/src/pmdk/utils/docker/build-local.sh
new file mode 100755 (executable)
index 0000000..0fa5b21
--- /dev/null
@@ -0,0 +1,111 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2020, Intel Corporation
+
+#
+# build-local.sh - runs a Docker container from a Docker image with environment
+#                  prepared for building PMDK project and starts building PMDK.
+#
+# This script is for building PMDK locally (not on CI).
+#
+# Notes:
+# - run this script from its location or set the variable 'HOST_WORKDIR' to
+#   where the root of the PMDK project is on the host machine.
+# - set variables 'OS' and 'OS_VER' properly to a system you want to build PMDK
+#   on (for proper values take a look on the list of Dockerfiles at the
+#   utils/docker/images directory), eg. OS=ubuntu, OS_VER=16.04.
+# - set 'KEEP_TEST_CONFIG' variable to 1 if you do not want the tests to be
+#   reconfigured (your current test configuration will be preserved and used).
+# - tests with Device Dax are not supported by pcheck yet, so do not provide
+#   these devices in your configuration.
+#
+
+set -e
+
+# Environment variables that can be customized (default values are after dash):
+export KEEP_CONTAINER=${KEEP_CONTAINER:-0}
+export KEEP_TEST_CONFIG=${KEEP_TEST_CONFIG:-0}
+export TEST_BUILD=${TEST_BUILD:-all}
+export REMOTE_TESTS=${REMOTE_TESTS:-1}
+export MAKE_PKG=${MAKE_PKG:-0}
+export EXTRA_CFLAGS=${EXTRA_CFLAGS}
+export EXTRA_CXXFLAGS=${EXTRA_CXXFLAGS:-}
+export PMDK_CC=${PMDK_CC:-gcc}
+export PMDK_CXX=${PMDK_CXX:-g++}
+export EXPERIMENTAL=${EXPERIMENTAL:-n}
+export VALGRIND=${VALGRIND:-1}
+export DOCKERHUB_REPO=${DOCKERHUB_REPO:-pmem/pmdk}
+export GITHUB_REPO=${GITHUB_REPO:-pmem/pmdk}
+
+if [[ -z "$OS" || -z "$OS_VER" ]]; then
+       echo "ERROR: The variables OS and OS_VER have to be set " \
+               "(eg. OS=ubuntu, OS_VER=16.04)."
+       exit 1
+fi
+
+if [[ -z "$HOST_WORKDIR" ]]; then
+       HOST_WORKDIR=$(readlink -f ../..)
+fi
+
+if [[ "$KEEP_CONTAINER" != "1" ]]; then
+       RM_SETTING=" --rm"
+fi
+
+imageName=${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
+containerName=pmdk-${OS}-${OS_VER}
+
+if [[ $MAKE_PKG -eq 1 ]] ; then
+       command="./run-build-package.sh"
+else
+       command="./run-build.sh"
+fi
+
+if [ -n "$DNS_SERVER" ]; then DNS_SETTING=" --dns=$DNS_SERVER "; fi
+if [ -z "$NDCTL_ENABLE" ]; then ndctl_enable=; else ndctl_enable="--env NDCTL_ENABLE=$NDCTL_ENABLE"; fi
+
+WORKDIR=/pmdk
+SCRIPTSDIR=$WORKDIR/utils/docker
+
+# Check if we are running on a CI (Travis or GitHub Actions)
+[ -n "$GITHUB_ACTIONS" -o -n "$TRAVIS" ] && CI_RUN="YES" || CI_RUN="NO"
+
+echo Building ${OS}-${OS_VER}
+
+# Run a container with
+#  - environment variables set (--env)
+#  - host directory containing PMDK source mounted (-v)
+#  - a tmpfs /tmp with the necessary size and permissions (--tmpfs)*
+#  - working directory set (-w)
+#
+# * We need a tmpfs /tmp inside docker but we cannot run it with --privileged
+#   and do it from inside, so we do using this docker-run option.
+#   By default --tmpfs add nosuid,nodev,noexec to the mount flags, we don't
+#   want that and just to make sure we add the usually default rw,relatime just
+#   in case docker change the defaults.
+docker run --name=$containerName -ti \
+       $RM_SETTING \
+       $DNS_SETTING \
+       --env http_proxy=$http_proxy \
+       --env https_proxy=$https_proxy \
+       --env CC=$PMDK_CC \
+       --env CXX=$PMDK_CXX \
+       --env VALGRIND=$VALGRIND \
+       --env EXTRA_CFLAGS=$EXTRA_CFLAGS \
+       --env EXTRA_CXXFLAGS=$EXTRA_CXXFLAGS \
+       --env EXTRA_LDFLAGS=$EXTRA_LDFLAGS \
+       --env REMOTE_TESTS=$REMOTE_TESTS \
+       --env CONFIGURE_TESTS=$CONFIGURE_TESTS \
+       --env TEST_BUILD=$TEST_BUILD \
+       --env WORKDIR=$WORKDIR \
+       --env EXPERIMENTAL=$EXPERIMENTAL \
+       --env SCRIPTSDIR=$SCRIPTSDIR \
+       --env KEEP_TEST_CONFIG=$KEEP_TEST_CONFIG \
+       --env CI_RUN=$CI_RUN \
+       --env BLACKLIST_FILE=$BLACKLIST_FILE \
+       $ndctl_enable \
+       --tmpfs /tmp:rw,relatime,suid,dev,exec,size=6G \
+       -v $HOST_WORKDIR:$WORKDIR \
+       -v /etc/localtime:/etc/localtime \
+       $DAX_SETTING \
+       -w $SCRIPTSDIR \
+       $imageName $command
diff --git a/ceph/src/pmdk/utils/docker/configure-tests.sh b/ceph/src/pmdk/utils/docker/configure-tests.sh
new file mode 100755 (executable)
index 0000000..23148ed
--- /dev/null
@@ -0,0 +1,105 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# configure-tests.sh - is called inside a Docker container; configures tests
+#                      and ssh server for use during build of PMDK project.
+#
+
+set -e
+
+# Configure tests
+cat << EOF > $WORKDIR/src/test/testconfig.sh
+LONGDIR=LoremipsumdolorsitametconsecteturadipiscingelitVivamuslacinianibhattortordictumsollicitudinNullamvariusvestibulumligulaetegestaselitsemperidMaurisultriciesligulaeuipsumtinciduntluctusMorbimaximusvariusdolorid
+# this path is ~3000 characters long
+DIRSUFFIX="$LONGDIR/$LONGDIR/$LONGDIR/$LONGDIR/$LONGDIR"
+NON_PMEM_FS_DIR=/tmp
+PMEM_FS_DIR=/tmp
+PMEM_FS_DIR_FORCE_PMEM=1
+TEST_BUILD="debug nondebug"
+ENABLE_SUDO_TESTS=y
+TM=1
+EOF
+
+# Configure remote tests
+if [[ $REMOTE_TESTS -eq 1 ]]; then
+       echo "Configuring remote tests"
+       cat << EOF >> $WORKDIR/src/test/testconfig.sh
+NODE[0]=127.0.0.1
+NODE_WORKING_DIR[0]=/tmp/node0
+NODE_ADDR[0]=127.0.0.1
+NODE_ENV[0]="PMEM_IS_PMEM_FORCE=1"
+NODE[1]=127.0.0.1
+NODE_WORKING_DIR[1]=/tmp/node1
+NODE_ADDR[1]=127.0.0.1
+NODE_ENV[1]="PMEM_IS_PMEM_FORCE=1"
+NODE[2]=127.0.0.1
+NODE_WORKING_DIR[2]=/tmp/node2
+NODE_ADDR[2]=127.0.0.1
+NODE_ENV[2]="PMEM_IS_PMEM_FORCE=1"
+NODE[3]=127.0.0.1
+NODE_WORKING_DIR[3]=/tmp/node3
+NODE_ADDR[3]=127.0.0.1
+NODE_ENV[3]="PMEM_IS_PMEM_FORCE=1"
+TEST_BUILD="debug nondebug"
+TEST_PROVIDERS=sockets
+EOF
+
+       mkdir -p ~/.ssh/cm
+
+       cat << EOF >> ~/.ssh/config
+Host 127.0.0.1
+       StrictHostKeyChecking no
+       ControlPath ~/.ssh/cm/%r@%h:%p
+       ControlMaster auto
+       ControlPersist 10m
+EOF
+
+       if [ ! -f /etc/ssh/ssh_host_rsa_key ]
+       then
+               (echo $USERPASS | sudo -S ssh-keygen -t rsa -C $USER@$HOSTNAME -P '' -f /etc/ssh/ssh_host_rsa_key)
+       fi
+       echo $USERPASS | sudo -S sh -c 'cat /etc/ssh/ssh_host_rsa_key.pub >> /etc/ssh/authorized_keys'
+       ssh-keygen -t rsa -C $USER@$HOSTNAME -P '' -f ~/.ssh/id_rsa
+       cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+       chmod -R 700 ~/.ssh
+       chmod 640 ~/.ssh/authorized_keys
+       chmod 600 ~/.ssh/config
+
+       # Start ssh service
+       echo $USERPASS | sudo -S $START_SSH_COMMAND
+
+       ssh 127.0.0.1 exit 0
+else
+       echo "Skipping remote tests"
+       echo
+       echo "Removing all libfabric.pc files in order to simulate that libfabric is not installed:"
+       find /usr -name "libfabric.pc" 2>/dev/null || true
+       echo $USERPASS | sudo -S sh -c 'find /usr -name "libfabric.pc" -exec rm -f {} + 2>/dev/null'
+fi
+
+# Configure python tests
+       cat << EOF >> $WORKDIR/src/test/testconfig.py
+config = {
+       'unittest_log_level': 1,
+       'cacheline_fs_dir': '/tmp',
+       'force_cacheline': True,
+       'page_fs_dir': '/tmp',
+       'force_page': False,
+       'byte_fs_dir': '/tmp',
+       'force_byte': True,
+       'tm': True,
+       'test_type': 'check',
+       'granularity': 'all',
+       'fs_dir_force_pmem': 0,
+       'keep_going': False,
+       'timeout': '3m',
+       'build': ['debug', 'release'],
+       'force_enable': None,
+       'device_dax_path': [],
+       'fail_on_skip': False,
+       'enable_admin_tests': True
+   }
+EOF
+
diff --git a/ceph/src/pmdk/utils/docker/images/0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch b/ceph/src/pmdk/utils/docker/images/0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch
new file mode 100644 (file)
index 0000000..7377d07
--- /dev/null
@@ -0,0 +1,37 @@
+From d633d3b0a5f03be280efb80a69b9d5ed4e9c4d56 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C5=81ukasz=20Stolarczuk?= <lukasz.stolarczuk@intel.com>
+Date: Tue, 14 Jul 2020 13:58:34 +0200
+Subject: [PATCH] fix generating gcov files and turn-off verbose log
+
+---
+ codecov | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/codecov b/codecov
+index e702ecd..0a2f4d8 100755
+--- a/codecov
++++ b/codecov
+@@ -1108,9 +1108,9 @@ then
+     if [ "$ft_gcovout" = "0" ];
+     then
+       # suppress gcov output
+-      bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" >/dev/null 2>&1 || true
++      bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -execdir $gcov_exe -pb $gcov_arg {} \;" >/dev/null 2>&1 || true
+     else
+-      bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" || true
++      bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -execdir $gcov_exe -pb $gcov_arg {} \;" || true
+     fi
+   else
+     say "${e}==>${x} gcov disabled"
+@@ -1425,7 +1425,7 @@ do
+       report_len=$(wc -c < "$file")
+       if [ "$report_len" -ne 0 ];
+       then
+-        say "    ${g}+${x} $file ${e}bytes=$(echo "$report_len" | tr -d ' ')${x}"
++        #say "    ${g}+${x} $file ${e}bytes=$(echo "$report_len" | tr -d ' ')${x}"
+         # append to to upload
+         _filename=$(basename "$file")
+         if [ "${_filename##*.}" = 'gcov' ];
+-- 
+2.25.1
+
diff --git a/ceph/src/pmdk/utils/docker/images/Dockerfile.fedora-31 b/ceph/src/pmdk/utils/docker/images/Dockerfile.fedora-31
new file mode 100644 (file)
index 0000000..a699fee
--- /dev/null
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# Dockerfile - a 'recipe' for Docker to build an image of fedora-based
+#              environment for building the PMDK project.
+#
+
+# Pull base image
+FROM fedora:31
+MAINTAINER piotr.balcer@intel.com
+
+# libfabric (optional if libfabric-dev >= 1.4.2 is installed)
+ENV FABRIC_DEPS "\
+       autoconf \
+       automake \
+       libtool \
+       wget"
+
+ENV VALGRIND_DEPS "\
+       autoconf \
+       automake \
+       file \
+       findutils \
+       git"
+
+# pmdk base
+ENV BASE_DEPS "\
+       git \
+       daxctl-devel \
+       make \
+       ndctl-devel \
+       pkgconfig"
+
+# benchmarks (optional)
+ENV BENCH_DEPS "\
+       glib2-devel"
+
+# examples (optional)
+ENV EXAMPLES_DEPS "\
+       fuse \
+       fuse-devel \
+       ncurses-devel \
+       libuv-devel"
+
+# documentation (optional)
+ENV DOC_DEPS "\
+       pandoc"
+
+# tests
+ENV TESTS_DEPS "\
+       bc \
+       gdb \
+       libunwind-devel \
+       ndctl \
+       openssh-server \
+       strace"
+
+# packaging
+ENV PACKAGING_DEPS "\
+       rpm-build \
+       rpm-build-libs \
+       rpmdevtools"
+
+# Coverity
+ENV COVERITY_DEPS "\
+       gcc \
+       wget"
+
+# misc
+ENV MISC_DEPS "\
+       clang \
+       hub \
+       lbzip2 \
+       man \
+       python3-flake8 \
+       rsync \
+       shadow-utils \
+       sudo \
+       tar \
+       which \
+       xmlto"
+
+# Copy install valgrind script
+COPY install-valgrind.sh install-valgrind.sh
+
+# Copy install libfabric script
+COPY install-libfabric.sh install-libfabric.sh
+
+RUN dnf update -y && dnf install -y \
+       $FABRIC_DEPS \
+       $VALGRIND_DEPS \
+       $BASE_DEPS \
+       $BENCH_DEPS \
+       $EXAMPLES_DEPS \
+       $DOC_DEPS \
+       $TESTS_DEPS \
+       $PACKAGING_DEPS \
+       $COVERITY_DEPS \
+       $MISC_DEPS \
+       $TESTS_DEPS \
+       && ./install-valgrind.sh fedora \
+       && ./install-libfabric.sh fedora \
+       && dnf clean all
+
+# Add user
+ENV USER pmdkuser
+ENV USERPASS pmdkpass
+RUN useradd -m $USER
+RUN echo "$USER:$USERPASS" | chpasswd
+RUN gpasswd wheel -a $USER
+RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+USER $USER
+
+# Set required environment variables
+ENV OS fedora
+ENV OS_VER 31
+ENV START_SSH_COMMAND /usr/sbin/sshd
+ENV PACKAGE_MANAGER rpm
+ENV NOTTY 1
diff --git a/ceph/src/pmdk/utils/docker/images/Dockerfile.ubuntu-19.10 b/ceph/src/pmdk/utils/docker/images/Dockerfile.ubuntu-19.10
new file mode 100644 (file)
index 0000000..9b61f89
--- /dev/null
@@ -0,0 +1,121 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
+#              environment for building the PMDK project.
+#
+
+# Pull base image
+FROM ubuntu:19.10
+MAINTAINER piotr.balcer@intel.com
+
+ENV DEBIAN_FRONTEND noninteractive
+
+# Additional parameters to build docker without building components
+ARG SKIP_SCRIPTS_DOWNLOAD
+
+# libfabric (optional if libfabric-dev >= 1.4.2 is installed)
+ENV FABRIC_DEPS "autoconf \
+       automake \
+       build-essential \
+       libtool \
+       unzip \
+       wget"
+
+ENV VALGRIND_DEPS "autoconf \
+       automake \
+       build-essential \
+       git"
+
+# pmdk base
+ENV BASE_DEPS "build-essential \
+       git \
+       libdaxctl-dev \
+       libndctl-dev \
+       pkg-config"
+
+# benchmarks (optional)
+ENV BENCH_DEPS libglib2.0-dev
+
+# examples (optional)
+ENV EXAMPLES_DEPS "libfuse-dev \
+       libncurses5-dev \
+       libuv1-dev"
+
+# documentation (optional)
+ENV DOC_DEPS pandoc
+
+# tests
+ENV TESTS_DEPS "bc \
+       gdb \
+       libc6-dbg \
+       libunwind-dev \
+       ndctl \
+       python3 \
+       ssh \
+       strace"
+
+# packaging
+ENV PACKAGING_DEPS "debhelper \
+       devscripts \
+       fakeroot"
+
+# CodeCov
+ENV CODECOV_DEPS curl
+
+# Coverity
+ENV COVERITY_DEPS ruby gcc g++ wget
+
+# misc
+ENV MISC_DEPS "clang \
+       clang-format \
+       flake8 \
+       sudo \
+       whois"
+
+# Copy install valgrind script
+COPY install-valgrind.sh install-valgrind.sh
+
+# Copy install libfabric script
+COPY install-libfabric.sh install-libfabric.sh
+
+# Copy codecov patch and script to download scripts required in run-*.sh
+COPY download-scripts.sh download-scripts.sh
+COPY 0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch \
+       0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch
+
+# Update the Apt cache and install basic tools
+RUN apt-get update && apt-get dist-upgrade -y \
+       && apt-get install -y --no-install-recommends \
+       $FABRIC_DEPS \
+       $VALGRIND_DEPS \
+       $BASE_DEPS \
+       $BENCH_DEPS \
+       $EXAMPLES_DEPS \
+       $DOC_DEPS \
+       $TESTS_DEPS \
+       $PACKAGING_DEPS \
+       $CODECOV_DEPS \
+       $COVERITY_DEPS \
+       $MISC_DEPS \
+       && ./install-valgrind.sh ubuntu \
+       && ./install-libfabric.sh \
+       && ./download-scripts.sh \
+       && rm -rf /var/lib/apt/lists/*
+
+# Add user
+ENV USER pmdkuser
+ENV USERPASS pmdkpass
+RUN useradd -m $USER -g sudo -p `mkpasswd $USERPASS`
+RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+
+# switch user
+USER $USER
+
+# Set required environment variables
+ENV OS ubuntu
+ENV OS_VER 19.10
+ENV START_SSH_COMMAND service ssh start
+ENV PACKAGE_MANAGER dpkg
+ENV NOTTY 1
diff --git a/ceph/src/pmdk/utils/docker/images/README b/ceph/src/pmdk/utils/docker/images/README
new file mode 100644 (file)
index 0000000..0b8c551
--- /dev/null
@@ -0,0 +1,6 @@
+Persistent Memory Development Kit
+
+This is utils/docker/images/README.
+
+Scripts in this directory let you prepare Docker images for building
+PMDK project under specified OS (ubuntu, fedora).
diff --git a/ceph/src/pmdk/utils/docker/images/build-image.sh b/ceph/src/pmdk/utils/docker/images/build-image.sh
new file mode 100755 (executable)
index 0000000..b9e7a2a
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# build-image.sh <OS-VER> <ARCH> - prepares a Docker image with <OS>-based
+#                environment intended for the <ARCH> CPU architecture
+#                designed for building PMDK project, according to
+#                the Dockerfile.<OS-VER> file located in the same directory.
+#
+# The script can be run locally.
+#
+
+set -e
+
+OS_VER=$1
+CPU_ARCH=$2
+
+function usage {
+       echo "Usage:"
+       echo "    build-image.sh <OS-VER> <ARCH>"
+       echo "where:"
+       echo "  <OS-VER> - can be for example 'ubuntu-19.10' provided "\
+               "a Dockerfile named 'Dockerfile.ubuntu-19.10' "\
+               "exists in the current directory and"
+       echo "  <ARCH> - is a CPU architecture, for example 'x86_64'"
+}
+
+# Check if two first arguments are not empty
+if [[ -z "$2" ]]; then
+       usage
+       exit 1
+fi
+
+# Check if the file Dockerfile.OS-VER exists
+if [[ ! -f "Dockerfile.$OS_VER" ]]; then
+       echo "Error: Dockerfile.$OS_VER does not exist."
+       echo
+       usage
+       exit 1
+fi
+
+if [[ -z "${DOCKERHUB_REPO}" ]]; then
+       echo "Error: DOCKERHUB_REPO environment variable is not set"
+       exit 1
+fi
+
+# Build a Docker image tagged with ${DOCKERHUB_REPO}:OS-VER-ARCH
+tag=${DOCKERHUB_REPO}:1.10-${OS_VER}-${CPU_ARCH}
+docker build -t $tag \
+       --build-arg http_proxy=$http_proxy \
+       --build-arg https_proxy=$https_proxy \
+       -f Dockerfile.$OS_VER .
diff --git a/ceph/src/pmdk/utils/docker/images/download-scripts.sh b/ceph/src/pmdk/utils/docker/images/download-scripts.sh
new file mode 100755 (executable)
index 0000000..fae37b4
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020, Intel Corporation
+
+#
+# download-scripts.sh - downloads specific version of codecov's bash
+#              script to generate and upload reports. It's useful,
+#              since unverified version may break coverage results.
+#
+
+set -e
+
+# master: Merge pull request #342 from codecov/revert-proj-name-..., 18.08.2020
+CODECOV_VERSION="e877c1280cc6e902101fb5df2981ed1c962da7f0"
+
+if [ "${SKIP_SCRIPTS_DOWNLOAD}" ]; then
+       echo "Variable 'SKIP_SCRIPTS_DOWNLOAD' is set; skipping scripts' download"
+       exit
+fi
+
+mkdir -p /opt/scripts
+
+# Download codecov's bash script
+git clone https://github.com/codecov/codecov-bash
+cd codecov-bash
+git checkout $CODECOV_VERSION
+
+git apply ../0001-fix-generating-gcov-files-and-turn-off-verbose-log.patch
+mv -v codecov /opt/scripts/codecov
+
+cd ..
+rm -rf codecov-bash
diff --git a/ceph/src/pmdk/utils/docker/images/install-libfabric.sh b/ceph/src/pmdk/utils/docker/images/install-libfabric.sh
new file mode 100755 (executable)
index 0000000..355f245
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# install-libfabric.sh - installs a customized version of libfabric
+#
+
+set -e
+
+OS=$1
+
+# Keep in sync with requirements in src/common.inc.
+libfabric_ver=1.4.2
+libfabric_url=https://github.com/ofiwg/libfabric/archive
+libfabric_dir=libfabric-$libfabric_ver
+libfabric_tarball=v${libfabric_ver}.zip
+wget "${libfabric_url}/${libfabric_tarball}"
+unzip $libfabric_tarball
+
+cd $libfabric_dir
+
+# XXX HACK HACK HACK
+# Disable use of spin locks in libfabric.
+#
+# spinlocks do not play well (IOW at all) with cpu-constrained environments,
+# like GitHub Actions, and this leads to timeouts of some PMDK's tests.
+# This change speeds up pmempool_sync_remote/TEST28-31 by a factor of 20-30.
+#
+perl -pi -e 's/have_spinlock=1/have_spinlock=0/' configure.ac
+# XXX HACK HACK HACK
+
+./autogen.sh
+./configure --prefix=/usr --enable-sockets
+make -j$(nproc)
+make -j$(nproc) install
+
+cd ..
+rm -f ${libfabric_tarball}
+rm -rf ${libfabric_dir}
diff --git a/ceph/src/pmdk/utils/docker/images/install-libndctl.sh b/ceph/src/pmdk/utils/docker/images/install-libndctl.sh
new file mode 100755 (executable)
index 0000000..fc8cee3
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2019, Intel Corporation
+
+#
+# install-libndctl.sh - installs libndctl
+#
+
+set -e
+
+OS=$2
+
+echo "==== clone ndctl repo ===="
+git clone https://github.com/pmem/ndctl.git
+cd ndctl
+git checkout $1
+
+if [ "$OS" = "fedora" ]; then
+
+echo "==== setup rpmbuild tree ===="
+rpmdev-setuptree
+
+RPMDIR=$HOME/rpmbuild/
+VERSION=$(./git-version)
+SPEC=./rhel/ndctl.spec
+
+echo "==== create source tarball ====="
+git archive --format=tar --prefix="ndctl-${VERSION}/" HEAD | gzip > "$RPMDIR/SOURCES/ndctl-${VERSION}.tar.gz"
+
+echo "==== build ndctl ===="
+./autogen.sh
+./configure --disable-docs
+make -j$(nproc)
+
+echo "==== build ndctl packages ===="
+rpmbuild -ba $SPEC
+
+echo "==== install ndctl packages ===="
+RPM_ARCH=$(uname -m)
+rpm -i $RPMDIR/RPMS/$RPM_ARCH/*.rpm
+
+echo "==== cleanup ===="
+rm -rf $RPMDIR
+
+else
+
+echo "==== build ndctl ===="
+./autogen.sh
+./configure --disable-docs
+make -j$(nproc)
+
+echo "==== install ndctl ===="
+make -j$(nproc) install
+
+echo "==== cleanup ===="
+
+fi
+
+cd ..
+rm -rf ndctl
diff --git a/ceph/src/pmdk/utils/docker/images/install-valgrind.sh b/ceph/src/pmdk/utils/docker/images/install-valgrind.sh
new file mode 100755 (executable)
index 0000000..97babcb
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# install-valgrind.sh - installs valgrind for persistent memory
+#
+
+set -e
+
+OS=$1
+
+install_upstream_from_distro() {
+  case "$OS" in
+    fedora) dnf install -y valgrind ;;
+    ubuntu) apt-get install -y --no-install-recommends valgrind ;;
+    *) return 1 ;;
+  esac
+}
+
+install_upstream_3_16_1() {
+  git clone git://sourceware.org/git/valgrind.git
+  cd valgrind
+  # valgrind v3.16.1 upstream
+  git checkout VALGRIND_3_16_BRANCH
+  ./autogen.sh
+  ./configure
+  make -j$(nproc)
+  make -j$(nproc) install
+  cd ..
+  rm -rf valgrind
+}
+
+install_custom-pmem_from_source() {
+  git clone https://github.com/pmem/valgrind.git
+  cd valgrind
+  # valgrind v3.15 with pmemcheck
+  # 2020.04.01 Merge pull request #78 from marcinslusarz/opt3
+  git checkout 759686fd66cc0105df8311cfe676b0b2f9e89196
+  ./autogen.sh
+  ./configure
+  make -j$(nproc)
+  make -j$(nproc) install
+  cd ..
+  rm -rf valgrind
+}
+
+ARCH=$(uname -m)
+case "$ARCH" in
+  ppc64le) install_upstream_3_16_1 ;;
+  *) install_custom-pmem_from_source ;;
+esac
diff --git a/ceph/src/pmdk/utils/docker/images/push-image.sh b/ceph/src/pmdk/utils/docker/images/push-image.sh
new file mode 100755 (executable)
index 0000000..03b9352
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# push-image.sh - pushes the Docker image to the Docker Hub.
+#
+# The script utilizes $DOCKERHUB_USER and $DOCKERHUB_PASSWORD variables
+# to log in to Docker Hub. The variables can be set in the Travis project's
+# configuration for automated builds.
+#
+
+set -e
+
+source $(dirname $0)/../set-ci-vars.sh
+
+if [[ -z "$OS" ]]; then
+       echo "OS environment variable is not set"
+       exit 1
+fi
+
+if [[ -z "$OS_VER" ]]; then
+       echo "OS_VER environment variable is not set"
+       exit 1
+fi
+
+if [[ -z "$CI_CPU_ARCH" ]]; then
+       echo "CI_CPU_ARCH environment variable is not set"
+       exit 1
+fi
+
+if [[ -z "${DOCKERHUB_REPO}" ]]; then
+       echo "DOCKERHUB_REPO environment variable is not set"
+       exit 1
+fi
+
+TAG="1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}"
+
+# Check if the image tagged with pmdk/OS-VER exists locally
+if [[ ! $(docker images -a | awk -v pattern="^${DOCKERHUB_REPO}:${TAG}\$" \
+       '$1":"$2 ~ pattern') ]]
+then
+       echo "ERROR: Docker image tagged ${DOCKERHUB_REPO}:${TAG} does not exists locally."
+       exit 1
+fi
+
+# Log in to the Docker Hub
+docker login -u="$DOCKERHUB_USER" -p="$DOCKERHUB_PASSWORD"
+
+# Push the image to the repository
+docker push ${DOCKERHUB_REPO}:${TAG}
diff --git a/ceph/src/pmdk/utils/docker/ppc64le.blacklist b/ceph/src/pmdk/utils/docker/ppc64le.blacklist
new file mode 100644 (file)
index 0000000..6002ad9
--- /dev/null
@@ -0,0 +1,19 @@
+ex_librpmem_basic
+ex_librpmem_hello
+ex_librpmem_manpage
+libpmempool_rm_remote
+obj_basic_integration
+obj_check_remote
+obj_ctl_debug
+obj_mem
+obj_memcheck_register
+obj_pmalloc_mt
+obj_rpmem_basic_integration
+obj_rpmem_heap_interrupt
+obj_rpmem_heap_state
+obj_ulog_size
+pmempool_create
+pmempool_sync_remote
+pmempool_transform_remote
+rpmem_basic
+rpmem_fip
diff --git a/ceph/src/pmdk/utils/docker/prepare-for-build.sh b/ceph/src/pmdk/utils/docker/prepare-for-build.sh
new file mode 100755 (executable)
index 0000000..f18c18c
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# prepare-for-build.sh - is called inside a Docker container; prepares
+#                        the environment inside a Docker container for
+#                        running build of PMDK project.
+#
+
+set -e
+
+# This should be run only on CIs
+if [ "$CI_RUN" == "YES" ]; then
+       # Make sure $WORKDIR has correct access rights
+       # - set them to the current UID and GID
+       echo $USERPASS | sudo -S chown -R $(id -u).$(id -g) $WORKDIR
+fi
+
+# Configure tests (e.g. ssh for remote tests) unless the current configuration
+# should be preserved
+KEEP_TEST_CONFIG=${KEEP_TEST_CONFIG:-0}
+if [[ "$KEEP_TEST_CONFIG" == 0 ]]; then
+       ./configure-tests.sh
+fi
diff --git a/ceph/src/pmdk/utils/docker/pull-or-rebuild-image.sh b/ceph/src/pmdk/utils/docker/pull-or-rebuild-image.sh
new file mode 100755 (executable)
index 0000000..a3a23cd
--- /dev/null
@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# pull-or-rebuild-image.sh - rebuilds the Docker image used in the
+#                            current Travis build if necessary.
+#
+# The script rebuilds the Docker image if the Dockerfile for the current
+# OS version (Dockerfile.${OS}-${OS_VER}) or any .sh script from the directory
+# with Dockerfiles were modified and committed.
+#
+# If the Travis build is not of the "pull_request" type (i.e. in case of
+# merge after pull_request) and it succeed, the Docker image should be pushed
+# to the Docker Hub repository. An empty file is created to signal that to
+# further scripts.
+#
+# If the Docker image does not have to be rebuilt, it will be pulled from
+# Docker Hub.
+#
+
+set -e
+
+source $(dirname $0)/set-ci-vars.sh
+source $(dirname $0)/set-vars.sh
+
+if [[ "$CI_EVENT_TYPE" != "cron" && "$CI_BRANCH" != "coverity_scan" \
+       && "$COVERITY" -eq 1 ]]; then
+       echo "INFO: Skip Coverity scan job if build is triggered neither by " \
+               "'cron' nor by a push to 'coverity_scan' branch"
+       exit 0
+fi
+
+if [[ ( "$CI_EVENT_TYPE" == "cron" || "$CI_BRANCH" == "coverity_scan" )\
+       && "$COVERITY" -ne 1 ]]; then
+       echo "INFO: Skip regular jobs if build is triggered either by 'cron'" \
+               " or by a push to 'coverity_scan' branch"
+       exit 0
+fi
+
+if [[ -z "$OS" || -z "$OS_VER" ]]; then
+       echo "ERROR: The variables OS and OS_VER have to be set properly " \
+             "(eg. OS=ubuntu, OS_VER=16.04)."
+       exit 1
+fi
+
+if [[ -z "$HOST_WORKDIR" ]]; then
+       echo "ERROR: The variable HOST_WORKDIR has to contain a path to " \
+               "the root of the PMDK project on the host machine"
+       exit 1
+fi
+
+# Find all the commits for the current build
+if [ -n "$CI_COMMIT_RANGE" ]; then
+       commits=$(git rev-list $CI_COMMIT_RANGE)
+else
+       commits=$CI_COMMIT
+fi
+
+echo "Commits in the commit range:"
+for commit in $commits; do echo $commit; done
+
+# Get the list of files modified by the commits
+files=$(for commit in $commits; do git diff-tree --no-commit-id --name-only \
+       -r $commit; done | sort -u)
+echo "Files modified within the commit range:"
+for file in $files; do echo $file; done
+
+# Path to directory with Dockerfiles and image building scripts
+images_dir_name=images
+base_dir=utils/docker/$images_dir_name
+
+# Check if committed file modifications require the Docker image to be rebuilt
+for file in $files; do
+       # Check if modified files are relevant to the current build
+       if [[ $file =~ ^($base_dir)\/Dockerfile\.($OS)-($OS_VER)$ ]] \
+               || [[ $file =~ ^($base_dir)\/.*\.sh$ ]]
+       then
+               # Rebuild Docker image for the current OS version
+               echo "Rebuilding the Docker image for the Dockerfile.$OS-$OS_VER"
+               pushd $images_dir_name
+               ./build-image.sh ${OS}-${OS_VER} ${CI_CPU_ARCH}
+               popd
+
+               # Check if the image has to be pushed to Docker Hub
+               # (i.e. the build is triggered by commits to the $GITHUB_REPO
+               # repository's stable-* or master branch, and the Travis build is not
+               # of the "pull_request" type). In that case, create the empty
+               # file.
+               if [[ "$CI_REPO_SLUG" == "$GITHUB_REPO" \
+                       && ($CI_BRANCH == stable-* || $CI_BRANCH == devel-* || $CI_BRANCH == master) \
+                       && $CI_EVENT_TYPE != "pull_request" \
+                       && $PUSH_IMAGE == "1" ]]
+               then
+                       echo "The image will be pushed to Docker Hub"
+                       touch $CI_FILE_PUSH_IMAGE_TO_REPO
+               else
+                       echo "Skip pushing the image to Docker Hub"
+               fi
+
+               if [[ $PUSH_IMAGE == "1" ]]
+               then
+                       echo "Skip build package check if image has to be pushed"
+                       touch $CI_FILE_SKIP_BUILD_PKG_CHECK
+               fi
+               exit 0
+       fi
+done
+
+# Getting here means rebuilding the Docker image is not required.
+# Pull the image from Docker Hub.
+docker pull ${DOCKERHUB_REPO}:1.10-${OS}-${OS_VER}-${CI_CPU_ARCH}
diff --git a/ceph/src/pmdk/utils/docker/run-build-package.sh b/ceph/src/pmdk/utils/docker/run-build-package.sh
new file mode 100755 (executable)
index 0000000..5141904
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2019, Intel Corporation
+
+#
+# run-build-package.sh - is called inside a Docker container; prepares
+#                        the environment and starts a build of PMDK project.
+#
+
+set -e
+
+# Prepare build enviromnent
+./prepare-for-build.sh
+
+# Create fake tag, so that package has proper 'version' field
+git config user.email "test@package.com"
+git config user.name "test package"
+git tag -a 1.4.99 -m "1.4" HEAD~1 || true
+
+# Build all and run tests
+cd $WORKDIR
+export PCHECK_OPTS="-j2 BLACKLIST_FILE=${BLACKLIST_FILE}"
+make -j$(nproc) $PACKAGE_MANAGER
+
+# Install packages
+if [[ "$PACKAGE_MANAGER" == "dpkg" ]]; then
+       cd $PACKAGE_MANAGER
+       echo $USERPASS | sudo -S dpkg --install *.deb
+else
+       RPM_ARCH=$(uname -m)
+       cd $PACKAGE_MANAGER/$RPM_ARCH
+       echo $USERPASS | sudo -S rpm --install *.rpm
+fi
+
+# Compile and run standalone test
+cd $WORKDIR/utils/docker/test_package
+make -j$(nproc) LIBPMEMOBJ_MIN_VERSION=1.4
+./test_package testfile1
+
+# Use pmreorder installed in the system
+pmreorder_version="$(pmreorder -v)"
+pmreorder_pattern="pmreorder\.py .+$"
+(echo "$pmreorder_version" | grep -Ev "$pmreorder_pattern") && echo "pmreorder version failed" && exit 1
+
+touch testfile2
+touch logfile1
+pmreorder -p testfile2 -l logfile1
diff --git a/ceph/src/pmdk/utils/docker/run-build.sh b/ceph/src/pmdk/utils/docker/run-build.sh
new file mode 100755 (executable)
index 0000000..78edf09
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+
+#
+# run-build.sh - is called inside a Docker container; prepares the environment
+#                and starts a build of PMDK project.
+#
+
+set -e
+
+# Prepare build environment
+./prepare-for-build.sh
+
+# Build all and run tests
+cd $WORKDIR
+if [ "$SRC_CHECKERS" != "0" ]; then
+       make -j$(nproc) check-license
+       make -j$(nproc) cstyle
+fi
+
+make -j$(nproc)
+make -j$(nproc) test
+# do not change -j2 to -j$(nproc) in case of tests (make check/pycheck)
+make -j2 pcheck TEST_BUILD=$TEST_BUILD
+# do not change -j2 to -j$(nproc) in case of tests (make check/pycheck)
+make -j2 pycheck
+make -j$(nproc) DESTDIR=/tmp source
+
+# Create PR with generated docs
+if [[ "$AUTO_DOC_UPDATE" == "1" ]]; then
+       echo "Running auto doc update"
+       ./utils/docker/run-doc-update.sh
+fi
diff --git a/ceph/src/pmdk/utils/docker/run-coverage.sh b/ceph/src/pmdk/utils/docker/run-coverage.sh
new file mode 100755 (executable)
index 0000000..b6f7ed0
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2020, Intel Corporation
+
+#
+# run-coverage.sh - is called inside a Docker container; runs tests
+#                   to measure code coverage and sends report to codecov.io
+#
+
+set -e
+
+# Get and prepare PMDK source
+./prepare-for-build.sh
+
+# Hush error messages, mainly from Valgrind
+export UT_DUMP_LINES=0
+
+# Skip printing mismatched files for tests with Valgrind
+export UT_VALGRIND_SKIP_PRINT_MISMATCHED=1
+
+# Build all and run tests
+cd $WORKDIR
+make -j$(nproc) COVERAGE=1
+make -j$(nproc) test COVERAGE=1
+
+# XXX: unfortunately valgrind raports issues in coverage instrumentation
+# which we have to ignore (-k flag), also there is dependency between
+# local and remote tests (which cannot be easily removed) we have to
+# run local and remote tests separately
+cd src/test
+# do not change -j2 to -j$(nproc) in case of tests (make check/pycheck)
+make -kj2 pcheck-local-quiet TEST_BUILD=debug || true
+make check-remote-quiet TEST_BUILD=debug || true
+# do not change -j2 to -j$(nproc) in case of tests (make check/pycheck)
+make -j2 pycheck TEST_BUILD=debug || true
+cd ../..
+
+# prepare flag for codecov report to differentiate builds
+flag=tests
+[ -n "$GITHUB_ACTIONS" ] && flag=GHA
+[ -n "$TRAVIS" ] && flag=Travis
+
+# run gcov exe, using codecov's bash (remove parsed coverage files, set flag and exit 1 if not successful)
+/opt/scripts/codecov -c -F ${flag} -Z
+
+printf "check for any leftover gcov files\n"
+leftover_files=$(find . -name "*.gcov" | wc -l)
+if [[ $leftover_files > 0 ]]; then
+       # display found files and exit with error (they all should be parsed)
+       find . -name "*.gcov"
+       return 1
+fi
diff --git a/ceph/src/pmdk/utils/docker/run-coverity.sh b/ceph/src/pmdk/utils/docker/run-coverity.sh
new file mode 100755 (executable)
index 0000000..140fa75
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2020, Intel Corporation
+
+#
+# run-coverity.sh - runs the Coverity scan build
+#
+
+set -e
+
+if [[ "$CI_REPO_SLUG" != "$GITHUB_REPO" \
+   && ( "$COVERITY_SCAN_NOTIFICATION_EMAIL" == "" \
+     || "$COVERITY_SCAN_TOKEN" == "" ) ]]; then
+       echo
+       echo "Skipping Coverity build:"\
+               "COVERITY_SCAN_TOKEN=\"$COVERITY_SCAN_TOKEN\" or"\
+               "COVERITY_SCAN_NOTIFICATION_EMAIL="\
+               "\"$COVERITY_SCAN_NOTIFICATION_EMAIL\" is not set"
+       exit 0
+fi
+
+# Prepare build environment
+./prepare-for-build.sh
+
+CERT_FILE=/etc/ssl/certs/ca-certificates.crt
+TEMP_CF=$(mktemp)
+cp $CERT_FILE $TEMP_CF
+
+# Download Coverity certificate
+echo -n | openssl s_client -connect scan.coverity.com:443 | \
+       sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | \
+       tee -a $TEMP_CF
+
+echo $USERPASS | sudo -S mv $TEMP_CF $CERT_FILE
+
+export COVERITY_SCAN_PROJECT_NAME="$CI_REPO_SLUG"
+[[ "$CI_EVENT_TYPE" == "cron" ]] \
+       && export COVERITY_SCAN_BRANCH_PATTERN="master" \
+       || export COVERITY_SCAN_BRANCH_PATTERN="coverity_scan"
+export COVERITY_SCAN_BUILD_COMMAND="make -j$(nproc) all"
+
+cd $WORKDIR
+
+#
+# Run the Coverity scan
+#
+
+# The 'travisci_build_coverity_scan.sh' script requires the following
+# environment variables to be set:
+# - TRAVIS_BRANCH - has to contain the name of the current branch
+# - TRAVIS_PULL_REQUEST - has to be set to 'true' in case of pull requests
+#
+export TRAVIS_BRANCH=${CI_BRANCH}
+[ "${CI_EVENT_TYPE}" == "pull_request" ] && export TRAVIS_PULL_REQUEST="true"
+
+# XXX: Patch the Coverity script.
+# Recently, this script regularly exits with an error, even though
+# the build is successfully submitted.  Probably because the status code
+# is missing in response, or it's not 201.
+# Changes:
+# 1) change the expected status code to 200 and
+# 2) print the full response string.
+#
+# This change should be reverted when the Coverity script is fixed.
+#
+# The previous version was:
+# curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | bash
+
+wget https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh
+patch < utils/docker/0001-travis-fix-travisci_build_coverity_scan.sh.patch
+bash ./travisci_build_coverity_scan.sh
diff --git a/ceph/src/pmdk/utils/docker/run-doc-update.sh b/ceph/src/pmdk/utils/docker/run-doc-update.sh
new file mode 100755 (executable)
index 0000000..132315e
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019-2020, Intel Corporation
+
+set -e
+
+source `dirname $0`/valid-branches.sh
+
+BOT_NAME="pmem-bot"
+USER_NAME="pmem"
+REPO_NAME="pmdk"
+
+ORIGIN="https://${DOC_UPDATE_GITHUB_TOKEN}@github.com/${BOT_NAME}/${REPO_NAME}"
+UPSTREAM="https://github.com/${USER_NAME}/${REPO_NAME}"
+# master or stable-* branch
+TARGET_BRANCH=${CI_BRANCH}
+VERSION=${TARGET_BRANCHES[$TARGET_BRANCH]}
+
+if [ -z $VERSION ]; then
+       echo "Target location for branch $TARGET_BRANCH is not defined."
+       exit 1
+fi
+
+# Clone bot repo
+git clone ${ORIGIN}
+cd ${REPO_NAME}
+git remote add upstream ${UPSTREAM}
+
+git config --local user.name ${BOT_NAME}
+git config --local user.email "pmem-bot@intel.com"
+
+git remote update
+git checkout -B ${TARGET_BRANCH} upstream/${TARGET_BRANCH}
+
+# Copy man & PR web md
+cd  ./doc
+make -j$(nproc) web
+cd ..
+
+mv ./doc/web_linux ../
+mv ./doc/web_windows ../
+mv ./doc/generated/libs_map.yml ../
+
+# Checkout gh-pages and copy docs
+GH_PAGES_NAME="gh-pages-for-${TARGET_BRANCH}"
+git checkout -B $GH_PAGES_NAME upstream/gh-pages
+git clean -dfx
+
+rsync -a ../web_linux/ ./manpages/linux/${VERSION}/
+rsync -a ../web_windows/ ./manpages/windows/${VERSION}/ \
+       --exclude='librpmem'    \
+       --exclude='rpmemd' --exclude='pmreorder'        \
+       --exclude='daxio'
+
+rm -r ../web_linux
+rm -r ../web_windows
+
+if [ $TARGET_BRANCH = "master" ]; then
+       [ ! -d _data ] && mkdir _data
+       cp ../libs_map.yml _data
+fi
+
+# Add and push changes.
+# git commit command may fail if there is nothing to commit.
+# In that case we want to force push anyway (there might be open pull request
+# with changes which were reverted).
+git add -A
+git commit -m "doc: automatic gh-pages docs update" && true
+git push -f ${ORIGIN} $GH_PAGES_NAME
+
+GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN} hub pull-request -f \
+       -b ${USER_NAME}:gh-pages \
+       -h ${BOT_NAME}:${GH_PAGES_NAME} \
+       -m "doc: automatic gh-pages docs update" && true
+
+exit 0
diff --git a/ceph/src/pmdk/utils/docker/set-ci-vars.sh b/ceph/src/pmdk/utils/docker/set-ci-vars.sh
new file mode 100755 (executable)
index 0000000..af41a75
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/env bash
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2020, Intel Corporation
+
+#
+# set-ci-vars.sh -- set CI variables common for both:
+#                   Travis and GitHub Actions CIs
+#
+
+set -e
+
+function get_commit_range_from_last_merge {
+       # get commit id of the last merge
+       LAST_MERGE=$(git log --merges --pretty=%H -1)
+       LAST_COMMIT=$(git log --pretty=%H -1)
+       if [ "$LAST_MERGE" == "$LAST_COMMIT" ]; then
+               # GitHub Actions commits its own merge in case of pull requests
+               # so the first merge commit has to be skipped.
+               LAST_MERGE=$(git log --merges --pretty=%H -2 | tail -n1)
+       fi
+       if [ "$LAST_MERGE" == "" ]; then
+               # possible in case of shallow clones
+               # or new repos with no merge commits yet
+               # - pick up the first commit
+               LAST_MERGE=$(git log --pretty=%H | tail -n1)
+       fi
+       COMMIT_RANGE="$LAST_MERGE..HEAD"
+       # make sure it works now
+       if ! git rev-list $COMMIT_RANGE >/dev/null; then
+               COMMIT_RANGE=""
+       fi
+       echo $COMMIT_RANGE
+}
+
+COMMIT_RANGE_FROM_LAST_MERGE=$(get_commit_range_from_last_merge)
+
+if [ -n "$TRAVIS" ]; then
+       CI_COMMIT=$TRAVIS_COMMIT
+       CI_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}"
+       CI_BRANCH=$TRAVIS_BRANCH
+       CI_EVENT_TYPE=$TRAVIS_EVENT_TYPE
+       CI_REPO_SLUG=$TRAVIS_REPO_SLUG
+
+       # CI_COMMIT_RANGE is usually invalid for force pushes - fix it when used
+       # with non-upstream repository
+       if [ -n "$CI_COMMIT_RANGE" -a "$CI_REPO_SLUG" != "$GITHUB_REPO" ]; then
+               if ! git rev-list $CI_COMMIT_RANGE; then
+                       CI_COMMIT_RANGE=$COMMIT_RANGE_FROM_LAST_MERGE
+               fi
+       fi
+
+       case "$TRAVIS_CPU_ARCH" in
+       "amd64")
+               CI_CPU_ARCH="x86_64"
+               ;;
+       *)
+               CI_CPU_ARCH=$TRAVIS_CPU_ARCH
+               ;;
+       esac
+
+elif [ -n "$GITHUB_ACTIONS" ]; then
+       CI_COMMIT=$GITHUB_SHA
+       CI_COMMIT_RANGE=$COMMIT_RANGE_FROM_LAST_MERGE
+       CI_BRANCH=$(echo $GITHUB_REF | cut -d'/' -f3)
+       CI_REPO_SLUG=$GITHUB_REPOSITORY
+       CI_CPU_ARCH="x86_64" # GitHub Actions supports only x86_64
+
+       case "$GITHUB_EVENT_NAME" in
+       "schedule")
+               CI_EVENT_TYPE="cron"
+               ;;
+       *)
+               CI_EVENT_TYPE=$GITHUB_EVENT_NAME
+               ;;
+       esac
+
+else
+       CI_COMMIT=$(git log --pretty=%H -1)
+       CI_COMMIT_RANGE=$COMMIT_RANGE_FROM_LAST_MERGE
+       CI_CPU_ARCH="x86_64"
+fi
+
+export CI_COMMIT=$CI_COMMIT
+export CI_COMMIT_RANGE=$CI_COMMIT_RANGE
+export CI_BRANCH=$CI_BRANCH
+export CI_EVENT_TYPE=$CI_EVENT_TYPE
+export CI_REPO_SLUG=$CI_REPO_SLUG
+export CI_CPU_ARCH=$CI_CPU_ARCH
+
+echo CI_COMMIT=$CI_COMMIT
+echo CI_COMMIT_RANGE=$CI_COMMIT_RANGE
+echo CI_BRANCH=$CI_BRANCH
+echo CI_EVENT_TYPE=$CI_EVENT_TYPE
+echo CI_REPO_SLUG=$CI_REPO_SLUG
+echo CI_CPU_ARCH=$CI_CPU_ARCH
diff --git a/ceph/src/pmdk/utils/docker/set-vars.sh b/ceph/src/pmdk/utils/docker/set-vars.sh
new file mode 100755 (executable)
index 0000000..9a531a8
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019, Intel Corporation
+
+#
+# set-vars.sh - set required environment variables
+#
+
+set -e
+
+export CI_FILE_PUSH_IMAGE_TO_REPO=/tmp/push_image_to_repo_flag
+export CI_FILE_SKIP_BUILD_PKG_CHECK=/tmp/skip_build_package_check
diff --git a/ceph/src/pmdk/utils/docker/test_package/Makefile b/ceph/src/pmdk/utils/docker/test_package/Makefile
new file mode 100644 (file)
index 0000000..f5970aa
--- /dev/null
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+check_package = $(shell pkg-config $(1) && echo y || echo n)
+
+HAS_LIBPMEMOBJ := $(call check_package, libpmemobj --atleast-version $(LIBPMEMOBJ_MIN_VERSION) --print-errors)
+
+LIBS += $(shell pkg-config --libs libpmemobj)
+CFLAGS += $(shell pkg-config --cflags libpmemobj)
+
+ifeq ($(HAS_LIBPMEMOBJ),n)
+$(error libpmemobj(version >= $(LIBPMEMOBJ_MIN_VERSION)) is missing)
+endif
+
+test_package: test_package.c
+       $(CC) test_package.c $(LIBS) $(CFLAGS) -o $@
+
+clean:
+       rm -f test_package
+
+.PHONY: clean
diff --git a/ceph/src/pmdk/utils/docker/test_package/README b/ceph/src/pmdk/utils/docker/test_package/README
new file mode 100644 (file)
index 0000000..de81a6a
--- /dev/null
@@ -0,0 +1,6 @@
+Persistent Memory Development Kit
+
+This is utils/docker/test_package/README.
+
+This directory contains simple application which uses libpmemobj.
+It can be used to test whether libpmemobj was installed properly.
diff --git a/ceph/src/pmdk/utils/docker/test_package/test_package.c b/ceph/src/pmdk/utils/docker/test_package/test_package.c
new file mode 100644 (file)
index 0000000..cf1e7eb
--- /dev/null
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/* Copyright 2018, Intel Corporation */
+
+#include <libpmemobj.h>
+#include <stdio.h>
+#include <sys/stat.h>
+
+#define LAYOUT_NAME "test"
+
+struct my_root {
+       int foo;
+};
+
+int
+main(int argc, char *argv[])
+{
+       if (argc < 2) {
+               printf("usage: %s file-name\n", argv[0]);
+               return 1;
+       }
+
+       const char *path = argv[1];
+
+       PMEMobjpool *pop = pmemobj_create(path, LAYOUT_NAME,
+                       PMEMOBJ_MIN_POOL, S_IWUSR | S_IRUSR);
+
+       if (pop == NULL) {
+               printf("failed to create pool\n");
+               return 1;
+       }
+
+       PMEMoid root = pmemobj_root(pop, sizeof(struct my_root));
+       struct my_root *rootp = pmemobj_direct(root);
+
+       rootp->foo = 10;
+       pmemobj_persist(pop, &rootp->foo, sizeof(rootp->foo));
+
+       pmemobj_close(pop);
+
+       return 0;
+}
diff --git a/ceph/src/pmdk/utils/docker/valid-branches.sh b/ceph/src/pmdk/utils/docker/valid-branches.sh
new file mode 100755 (executable)
index 0000000..b111c2a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018-2020, Intel Corporation
+
+declare -A TARGET_BRANCHES=(           \
+               ["master"]="master"     \
+               ["stable-1.5"]="v1.5"   \
+               ["stable-1.6"]="v1.6"   \
+               ["stable-1.7"]="v1.7"   \
+               ["stable-1.8"]="v1.8"   \
+               ["stable-1.9"]="v1.9"   \
+       )
diff --git a/ceph/src/pmdk/utils/get_aliases.sh b/ceph/src/pmdk/utils/get_aliases.sh
new file mode 100755 (executable)
index 0000000..87978e2
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2020, Intel Corporation
+#
+
+#
+# get_aliases.sh -- generate map of manuals functions and libraries
+#
+# usage: run from /pmdk/doc/generated location without parameters:
+# ./../../utils/get_aliases.sh
+#
+# This script searches manpages from section 7 then
+# takes all functions from each section using specified pattern
+# and at the end to every function it assign real markdown file
+# representation based on *.gz file content
+#
+# Generated libs_map.yml file is used on gh-pages
+# to handle functions and their aliases
+#
+
+list=("$@")
+man_child=("$@")
+
+function search_aliases {
+children=$1
+parent=$2
+for i in ${children[@]}
+do
+       if [ -e ../$parent/$i ]
+       then
+               echo "Man: $i"
+               content=$(head -c 150 ../$parent/$i)
+               if [[ "$content" == ".so "* ]] ;
+               then
+                       content=$(basename ${content#".so"})
+                       i="${i%.*}"
+                       echo "  $i: $content" >> $map_file
+               else
+                       r="${i%.*}"
+                       echo "  $r: $i" >> $map_file
+               fi
+       fi
+done
+}
+
+function list_pages {
+       parent="${1%.*}"
+       list=("$@")
+       man_child=("$@")
+
+       if [ "$parent" == "libpmem" ]; then
+               man_child=($(ls -1 ../libpmem | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "libpmem2" ]; then
+               man_child=($(ls -1 ../libpmem2 | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "libpmemblk" ]; then
+               man_child=($(ls -1 ../libpmemblk | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "libpmemlog" ]; then
+               man_child=($(ls -1 ../libpmemlog | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "libpmemobj" ]; then
+               man_child=($(ls -1 ../libpmemobj | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "libpmempool" ]; then
+               man_child=($(ls -1 ../libpmempool | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ "$parent" == "librpmem" ]; then
+               man_child=($(ls -1 ../librpmem | grep -e ".*\.3$"))
+               echo -n "- $parent: " >> $map_file
+               echo "${man_child[@]}" >> $map_file
+       fi
+
+       if [ ${#man_child[@]} -ne 0 ]
+       then
+               list=${man_child[@]}
+               search_aliases "${list[@]}" "$parent"
+       fi
+}
+
+man7=($(ls -1 ../*/ | grep -e ".*\.7$"))
+
+map_file=libs_map.yml
+[ -e $map_file ] && rm $map_file
+touch $map_file
+
+for i in "${man7[@]}"
+do
+echo "Library: $i"
+       list_pages $i
+done
diff --git a/ceph/src/pmdk/utils/git-years b/ceph/src/pmdk/utils/git-years
new file mode 100755 (executable)
index 0000000..d54018d
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019, Intel Corporation
+
+# git-years -- calculate the range of years for a given file from git
+
+git log --pretty='%aI %aE' "$@"|grep '@intel\.com'|cut -d- -f1|sort|
+       sed '$p;2,$d'|uniq|tr '\n' -|sed 's/-$//'
diff --git a/ceph/src/pmdk/utils/libpmem.pc.in b/ceph/src/pmdk/utils/libpmem.pc.in
new file mode 100644 (file)
index 0000000..850b281
--- /dev/null
@@ -0,0 +1,9 @@
+includedir=${prefix}/include
+
+Name: libpmem
+Description: libpmem library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires:
+Libs: -L${libdir} -lpmem
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/libpmem2.pc.in b/ceph/src/pmdk/utils/libpmem2.pc.in
new file mode 100644 (file)
index 0000000..d4ddc90
--- /dev/null
@@ -0,0 +1,9 @@
+includedir=${prefix}/include
+
+Name: libpmem2
+Description: libpmem2 library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires:
+Libs: -L${libdir} -lpmem2
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/libpmemblk.pc.in b/ceph/src/pmdk/utils/libpmemblk.pc.in
new file mode 100644 (file)
index 0000000..5b0ffbf
--- /dev/null
@@ -0,0 +1,9 @@
+includedir=${prefix}/include
+
+Name: libpmemblk
+Description: libpmemblk library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires.private: libpmem${rasdeps}
+Libs: -L${libdir} -lpmemblk
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/libpmemlog.pc.in b/ceph/src/pmdk/utils/libpmemlog.pc.in
new file mode 100644 (file)
index 0000000..f165843
--- /dev/null
@@ -0,0 +1,9 @@
+includedir=${prefix}/include
+
+Name: libpmemlog
+Description: libpmemlog library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires.private: libpmem${rasdeps}
+Libs: -L${libdir} -lpmemlog
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/libpmemobj.pc.in b/ceph/src/pmdk/utils/libpmemobj.pc.in
new file mode 100644 (file)
index 0000000..12c396e
--- /dev/null
@@ -0,0 +1,10 @@
+includedir=${prefix}/include
+
+Name: libpmemobj
+Description: libpmemobj library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires.private: libpmem${rasdeps}
+Libs: -L${libdir} -lpmemobj
+Libs.private: -ldl
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/libpmempool.pc.in b/ceph/src/pmdk/utils/libpmempool.pc.in
new file mode 100644 (file)
index 0000000..660938a
--- /dev/null
@@ -0,0 +1,10 @@
+includedir=${prefix}/include
+
+Name: libpmempool
+Description: libpmempool library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires.private: libpmem${rasdeps}
+Libs: -L${libdir} -lpmempool
+Libs.private: -ldl
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/librpmem.pc.in b/ceph/src/pmdk/utils/librpmem.pc.in
new file mode 100644 (file)
index 0000000..50bf1bb
--- /dev/null
@@ -0,0 +1,9 @@
+includedir=${prefix}/include
+
+Name: librpmem
+Description: librpmem library from PMDK project
+Version: ${version}
+URL: https://pmem.io/pmdk
+Requires:
+Libs: -L${libdir} -lrpmem
+Cflags: -I${includedir}
diff --git a/ceph/src/pmdk/utils/magic-install.sh b/ceph/src/pmdk/utils/magic-install.sh
new file mode 100644 (file)
index 0000000..3c65bab
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2017, Intel Corporation
+#
+# magic-install.sh -- Script for installing magic script
+#
+set -e
+
+if ! grep -q "File: pmdk" /etc/magic
+then
+       echo "Appending PMDK magic to /etc/magic"
+       cat /usr/share/pmdk/pmdk.magic >> /etc/magic
+else
+       echo "PMDK magic already exists"
+fi
diff --git a/ceph/src/pmdk/utils/magic-uninstall.sh b/ceph/src/pmdk/utils/magic-uninstall.sh
new file mode 100644 (file)
index 0000000..6733c7e
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2017, Intel Corporation
+#
+# magic-uninstall.sh -- Script for uninstalling magic script
+#
+set -e
+
+HDR_LOCAL=$(grep "File: pmdk" /etc/magic)
+HDR_PKG=$(grep "File: pmdk" /usr/share/pmdk/pmdk.magic)
+
+if [[ $HDR_LOCAL == $HDR_PKG ]]
+then
+       echo "Removing PMDK magic from /etc/magic"
+       HDR_LINE=$(grep -n "File: pmdk" /etc/magic | cut -f1 -d:)
+       HDR_PKG_LINE=$(grep -n "File: pmdk" /usr/share/pmdk/pmdk.magic | cut -f1 -d:)
+       HDR_LINES=$(cat /usr/share/pmdk/pmdk.magic | wc -l)
+       HDR_FIRST=$(($HDR_LINE - $HDR_PKG_LINE + 1))
+       HDR_LAST=$(($HDR_FIRST + $HDR_LINES))
+       sed -i "${HDR_FIRST},${HDR_LAST}d" /etc/magic
+fi
diff --git a/ceph/src/pmdk/utils/md2man.sh b/ceph/src/pmdk/utils/md2man.sh
new file mode 100755 (executable)
index 0000000..941bd3c
--- /dev/null
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+#
+
+#
+# md2man.sh -- convert markdown to groff man pages
+#
+# usage: md2man.sh file template outfile
+#
+# This script converts markdown file into groff man page using pandoc.
+# It performs some pre- and post-processing for better results:
+# - uses m4 to preprocess OS-specific directives. See doc/macros.man.
+# - parse input file for YAML metadata block and read man page title,
+#   section and version
+# - cut-off metadata block and license
+# - unindent code blocks
+# - cut-off windows and web specific parts of documentation
+#
+# If the TESTOPTS variable is set, generates a preprocessed markdown file
+# with the header stripped off for testing purposes.
+#
+
+set -e
+set -o pipefail
+
+filename=$1
+template=$2
+outfile=$3
+title=`sed -n 's/^title:\ _MP(*\([A-Za-z0-9_-]*\).*$/\1/p' $filename`
+section=`sed -n 's/^title:.*\([0-9]\))$/\1/p' $filename`
+version=`sed -n 's/^date:\ *\(.*\)$/\1/p' $filename`
+
+if [ "$TESTOPTS" != "" ]; then
+       m4 $TESTOPTS macros.man $filename | sed -n -e '/# NAME #/,$p' > $outfile
+else
+       OPTS=
+
+if [ "$WIN32" == 1 ]; then
+       OPTS="$OPTS -DWIN32"
+else
+       OPTS="$OPTS -UWIN32"
+fi
+
+if [ "$(uname -s)" == "FreeBSD" ]; then
+       OPTS="$OPTS -DFREEBSD"
+else
+       OPTS="$OPTS -UFREEBSD"
+fi
+
+if [ "$WEB" == 1 ]; then
+       OPTS="$OPTS -DWEB"
+       mkdir -p "$(dirname $outfile)"
+       m4 $OPTS macros.man $filename | sed -n -e '/---/,$p' > $outfile
+else
+       SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
+       COPYRIGHT=$(grep -rwI "\[comment]: <> (Copyright" $filename |\
+               sed "s/\[comment\]: <> (\([^)]*\))/\1/")
+       dt=$(date -u -d "@$SOURCE_DATE_EPOCH" +%F 2>/dev/null ||
+               date -u -r "$SOURCE_DATE_EPOCH" +%F 2>/dev/null || date -u +%F)
+       m4 $OPTS macros.man $filename | sed -n -e '/# NAME #/,$p' |\
+               pandoc -s -t man -o $outfile --template=$template \
+               -V title=$title -V section=$section \
+               -V date="$dt" -V version="$version" \
+               -V copyright="$COPYRIGHT"
+fi
+fi
diff --git a/ceph/src/pmdk/utils/os-banned b/ceph/src/pmdk/utils/os-banned
new file mode 100644 (file)
index 0000000..57d1625
--- /dev/null
@@ -0,0 +1,63 @@
+pthread_once
+pthread_key_create
+pthread_key_delete
+pthread_setspecific
+pthread_getspecific
+pthread_mutex_init
+pthread_mutex_destroy
+pthread_mutex_lock
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutex_timedlock
+pthread_rwlock_init
+pthread_rwlock_destroy
+pthread_rwlock_rdlock
+pthread_rwlock_wrlock
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_timedrdlock
+pthread_rwlock_timedwrlock
+pthread_spin_init
+pthread_spin_destroy
+pthread_spin_lock
+pthread_spin_unlock
+pthread_spin_trylock
+pthread_cond_init
+pthread_cond_destroy
+pthread_cond_broadcast
+pthread_cond_signal
+pthread_cond_timedwait
+pthread_cond_wait
+pthread_create
+pthread_join
+cpu_zero
+cpu_set
+pthread_setaffinity_np
+pthread_atfork
+sem_init
+sem_destroy
+sem_wait
+sem_trywait
+sem_post
+fsync
+fsync_dir
+open
+stat
+unlink
+access
+fopen
+fdopen
+chmod
+mkstemp
+posix_fallocate
+ftruncate
+flock
+writev
+clock_gettime
+rand_r
+unsetenv
+setenv
+getenv
+strsignal
+execv
diff --git a/ceph/src/pmdk/utils/pkg-common.sh b/ceph/src/pmdk/utils/pkg-common.sh
new file mode 100644 (file)
index 0000000..f3711bc
--- /dev/null
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2019, Intel Corporation
+
+#
+# pkg-common.sh - common functions and variables for building packages
+#
+
+export LC_ALL="C"
+
+function error() {
+       echo -e "error: $@"
+}
+
+function check_dir() {
+       if [ ! -d $1 ]
+       then
+               error "Directory '$1' does not exist."
+               exit 1
+       fi
+}
+
+function check_file() {
+       if [ ! -f $1 ]
+       then
+               error "File '$1' does not exist."
+               exit 1
+       fi
+}
+
+function check_tool() {
+       local tool=$1
+       if [ -z "$(which $tool 2>/dev/null)" ]
+       then
+               error "'${tool}' not installed or not in PATH"
+               exit 1
+       fi
+}
+
+function get_version() {
+       echo -n $1 | sed "s/-rc/~rc/"
+}
+
+function get_os() {
+       if [ -f /etc/os-release ]
+       then
+               local OS=$(cat /etc/os-release | grep -m1 -o -P '(?<=NAME=).*($)')
+               [[ "$OS" =~ SLES|openSUSE ]] && echo -n "SLES_like" ||
+               ([[ "$OS" =~ "Fedora"|"Red Hat"|"CentOS" ]] && echo -n "RHEL_like" || echo 1)
+       else
+               echo 1
+       fi
+}
+
+REGEX_DATE_AUTHOR="([a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{4})\s*(.*)"
+REGEX_MESSAGE_START="\s*\*\s*(.*)"
+REGEX_MESSAGE="\s*(\S.*)"
diff --git a/ceph/src/pmdk/utils/pkg-config.sh b/ceph/src/pmdk/utils/pkg-config.sh
new file mode 100644 (file)
index 0000000..7186fa2
--- /dev/null
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2014-2020, Intel Corporation
+
+# Name of package
+PACKAGE_NAME="pmdk"
+
+# Name and email of package maintainer
+PACKAGE_MAINTAINER="Piotr Balcer <piotr.balcer@intel.com>"
+
+# Brief description of the package
+PACKAGE_SUMMARY="Persistent Memory Development Kit"
+
+# Full description of the package
+PACKAGE_DESCRIPTION="The collection of libraries and utilities for Persistent Memory Programming"
+
+# Website
+PACKAGE_URL="https://pmem.io/pmdk"
diff --git a/ceph/src/pmdk/utils/pmdk.magic b/ceph/src/pmdk/utils/pmdk.magic
new file mode 100644 (file)
index 0000000..7409ba1
--- /dev/null
@@ -0,0 +1,15 @@
+
+#------------------------------------------------------------------------------
+# $File: pmdk,v 1.2 2017/12/11 20:00:00
+# pmdk: file(1) magic for Persistent Memory Development Kit pool files
+#
+# The PMDK specific format of pool files.
+#
+# PMEM signature
+0      string                  PMEM
+>4     string                  POOLSET         Persistent Memory Poolset file
+>>11   search                  REPLICA         with replica
+# Pool type signature
+>4     regex                   LOG|BLK|OBJ     Persistent Memory Pool file, type: %s,
+# Major version number
+>>8    lelong                  >0              version 0x%x
diff --git a/ceph/src/pmdk/utils/pmdk.spec.in b/ceph/src/pmdk/utils/pmdk.spec.in
new file mode 100644 (file)
index 0000000..094e9d0
--- /dev/null
@@ -0,0 +1,710 @@
+
+# rpmbuild options:
+#   --with | --without fabric
+#   --with | --without ndctl
+#   --define _testconfig <path to custom testconfig.sh>
+#   --define _skip_check 1
+
+# do not terminate build if files in the $RPM_BUILD_ROOT
+# directory are not found in the %files (without rpmem case)
+%define _unpackaged_files_terminate_build 0
+
+# disable 'make check' on suse
+%if %{defined suse_version}
+       %define _skip_check 1
+       %define dist .suse%{suse_version}
+%endif
+
+# libfabric v1.4.2 is available on:
+#   openSUSE Tumbleweed, Leap 15.0, Leap 42.3; SLE 12 SP3, 15
+#   Fedora >=27; RHEL >=7.5
+%if (0%{?suse_version} > 1315) || (0%{?fedora} >= 27) || (0%{?rhel} >= 7)
+%bcond_without fabric
+%else
+%bcond_with fabric
+%endif
+
+%bcond_without ndctl
+
+%define min_libfabric_ver __LIBFABRIC_MIN_VER__
+%define min_ndctl_ver __NDCTL_MIN_VER__
+
+Name:          pmdk
+Version:       __VERSION__
+Release:       1%{?dist}
+Summary:       __PACKAGE_SUMMARY__
+Packager:      __PACKAGE_MAINTAINER__
+Group:         __GROUP_SYS_LIBS__
+License:       __LICENSE__
+URL:           https://pmem.io/pmdk
+
+Source0:       %{name}-%{version}.tar.gz
+
+BuildRequires: gcc
+BuildRequires: make
+BuildRequires: glibc-devel
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: man
+BuildRequires: pkgconfig
+BuildRequires: gdb
+
+# fdupes package is available only on 'openSUSE Tumbleweed' and 'openSUSE Leap 15.1'
+%if (0%{?suse_version} > 1500) || (0%{?sles_version} >= 150100 && 0%{?is_opensuse})
+BuildRequires: fdupes
+%endif
+
+%if %{with ndctl}
+%if %{defined suse_version}
+BuildRequires: libndctl-devel >= %{min_ndctl_ver}
+%else
+BuildRequires: ndctl-devel >= %{min_ndctl_ver}
+BuildRequires: daxctl-devel >= %{min_ndctl_ver}
+%endif
+%endif
+
+%if %{with fabric}
+BuildRequires: libfabric-devel >= %{min_libfabric_ver}
+%endif
+
+
+# Debug variants of the libraries should be filtered out of the provides.
+%global __provides_exclude_from ^%{_libdir}/pmdk_debug/.*\\.so.*$
+
+# By design, PMDK does not support any 32-bit architecture.
+# Due to dependency on xmmintrin.h and some inline assembly, it can be
+# compiled only for x86_64 at the moment.
+# Other 64-bit architectures could also be supported, if only there is
+# a request for that, and if somebody provides the arch-specific
+# implementation of the low-level routines for flushing to persistent
+# memory.
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=1340634
+# https://bugzilla.redhat.com/show_bug.cgi?id=1340635
+# https://bugzilla.redhat.com/show_bug.cgi?id=1340636
+# https://bugzilla.redhat.com/show_bug.cgi?id=1340637
+
+ExclusiveArch: x86_64 ppc64le
+
+%description
+The Persistent Memory Development Kit is a collection of libraries for
+using memory-mapped persistence, optimized specifically for persistent memory.
+
+
+%package -n libpmem2__PKG_NAME_SUFFIX__
+Summary: Low-level persistent memory support library
+Group: __GROUP_SYS_LIBS__
+%description -n libpmem2__PKG_NAME_SUFFIX__
+The libpmem2 provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+%files -n libpmem2__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%dir %{_datadir}/pmdk
+%{_libdir}/libpmem2.so.*
+%{_datadir}/pmdk/pmdk.magic
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmem2-devel
+Summary: Development files for the low-level persistent memory library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmem2__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmem2-devel
+The libpmem2 provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+This library is provided for software which tracks every store to
+pmem and needs to flush those changes to durability. Most developers
+will find higher level libraries like libpmemobj to be much more
+convenient.
+
+%files -n libpmem2-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmem2.so
+%{_libdir}/pkgconfig/libpmem2.pc
+%{_includedir}/libpmem2.h
+%{_mandir}/man7/libpmem2.7.gz
+%{_mandir}/man3/pmem2_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmem2-debug
+Summary: Debug variant of the low-level persistent memory library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmem2__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmem2-debug
+The libpmem provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmem2-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmem2.so
+%{_libdir}/pmdk_debug/libpmem2.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+
+%package -n libpmem__PKG_NAME_SUFFIX__
+Summary: Low-level persistent memory support library
+Group: __GROUP_SYS_LIBS__
+%description -n libpmem__PKG_NAME_SUFFIX__
+The libpmem provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+%files -n libpmem__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%dir %{_datadir}/pmdk
+%{_libdir}/libpmem.so.*
+%{_datadir}/pmdk/pmdk.magic
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmem-devel
+Summary: Development files for the low-level persistent memory library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmem-devel
+The libpmem provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+This library is provided for software which tracks every store to
+pmem and needs to flush those changes to durability. Most developers
+will find higher level libraries like libpmemobj to be much more
+convenient.
+
+%files -n libpmem-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmem.so
+%{_libdir}/pkgconfig/libpmem.pc
+%{_includedir}/libpmem.h
+%{_mandir}/man7/libpmem.7.gz
+%{_mandir}/man3/pmem_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmem-debug
+Summary: Debug variant of the low-level persistent memory library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmem-debug
+The libpmem provides low level persistent memory support. In particular,
+support for the persistent memory instructions for flushing changes
+to pmem is provided.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmem-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmem.so
+%{_libdir}/pmdk_debug/libpmem.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemblk__PKG_NAME_SUFFIX__
+Summary: Persistent Memory Resident Array of Blocks library
+Group: __GROUP_SYS_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+%description -n libpmemblk__PKG_NAME_SUFFIX__
+The libpmemblk implements a pmem-resident array of blocks, all the same
+size, where a block is updated atomically with respect to power
+failure or program interruption (no torn blocks).
+
+%files -n libpmemblk__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%{_libdir}/libpmemblk.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemblk-devel
+Summary: Development files for the Persistent Memory Resident Array of Blocks library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemblk__PKG_NAME_SUFFIX__ = %{version}-%{release}
+Requires: libpmem-devel = %{version}-%{release}
+%description -n libpmemblk-devel
+The libpmemblk implements a pmem-resident array of blocks, all the same
+size, where a block is updated atomically with respect to power
+failure or program interruption (no torn blocks).
+
+For example, a program keeping a cache of fixed-size objects in pmem
+might find this library useful. This library is provided for cases
+requiring large arrays of objects at least 512 bytes each. Most
+developers will find higher level libraries like libpmemobj to be
+more generally useful.
+
+%files -n libpmemblk-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmemblk.so
+%{_libdir}/pkgconfig/libpmemblk.pc
+%{_includedir}/libpmemblk.h
+%{_mandir}/man7/libpmemblk.7.gz
+%{_mandir}/man5/poolset.5.gz
+%{_mandir}/man3/pmemblk_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemblk-debug
+Summary: Debug variant of the Persistent Memory Resident Array of Blocks library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemblk__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmemblk-debug
+The libpmemblk implements a pmem-resident array of blocks, all the same
+size, where a block is updated atomically with respect to power
+failure or program interruption (no torn blocks).
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmemblk-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmemblk.so
+%{_libdir}/pmdk_debug/libpmemblk.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemlog__PKG_NAME_SUFFIX__
+Summary: Persistent Memory Resident Log File library
+Group: __GROUP_SYS_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+%description -n libpmemlog__PKG_NAME_SUFFIX__
+The libpmemlog library provides a pmem-resident log file. This is
+useful for programs like databases that append frequently to a log
+file.
+
+%files -n libpmemlog__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%{_libdir}/libpmemlog.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemlog-devel
+Summary: Development files for the Persistent Memory Resident Log File library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemlog__PKG_NAME_SUFFIX__ = %{version}-%{release}
+Requires: libpmem-devel = %{version}-%{release}
+%description -n libpmemlog-devel
+The libpmemlog library provides a pmem-resident log file. This
+library is provided for cases requiring an append-mostly file to
+record variable length entries. Most developers will find higher
+level libraries like libpmemobj to be more generally useful.
+
+%files -n libpmemlog-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmemlog.so
+%{_libdir}/pkgconfig/libpmemlog.pc
+%{_includedir}/libpmemlog.h
+%{_mandir}/man7/libpmemlog.7.gz
+%{_mandir}/man5/poolset.5.gz
+%{_mandir}/man3/pmemlog_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemlog-debug
+Summary: Debug variant of the Persistent Memory Resident Log File library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemlog__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmemlog-debug
+The libpmemlog library provides a pmem-resident log file. This
+library is provided for cases requiring an append-mostly file to
+record variable length entries. Most developers will find higher
+level libraries like libpmemobj to be more generally useful.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmemlog-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmemlog.so
+%{_libdir}/pmdk_debug/libpmemlog.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemobj__PKG_NAME_SUFFIX__
+Summary: Persistent Memory Transactional Object Store library
+Group: __GROUP_SYS_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+%description -n libpmemobj__PKG_NAME_SUFFIX__
+The libpmemobj library provides a transactional object store,
+providing memory allocation, transactions, and general facilities for
+persistent memory programming.
+
+%files -n libpmemobj__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%{_libdir}/libpmemobj.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemobj-devel
+Summary: Development files for the Persistent Memory Transactional Object Store library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemobj__PKG_NAME_SUFFIX__ = %{version}-%{release}
+Requires: libpmem-devel = %{version}-%{release}
+%description -n libpmemobj-devel
+The libpmemobj library provides a transactional object store,
+providing memory allocation, transactions, and general facilities for
+persistent memory programming. Developers new to persistent memory
+probably want to start with this library.
+
+%files -n libpmemobj-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmemobj.so
+%{_libdir}/pkgconfig/libpmemobj.pc
+%{_includedir}/libpmemobj.h
+%{_includedir}/libpmemobj/*.h
+%{_mandir}/man7/libpmemobj.7.gz
+%{_mandir}/man5/poolset.5.gz
+%{_mandir}/man3/pmemobj_*.3.gz
+%{_mandir}/man3/pobj_*.3.gz
+%{_mandir}/man3/oid_*.3.gz
+%{_mandir}/man3/toid*.3.gz
+%{_mandir}/man3/direct_*.3.gz
+%{_mandir}/man3/d_r*.3.gz
+%{_mandir}/man3/tx_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmemobj-debug
+Summary: Debug variant of the Persistent Memory Transactional Object Store library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmemobj__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmemobj-debug
+The libpmemobj library provides a transactional object store,
+providing memory allocation, transactions, and general facilities for
+persistent memory programming. Developers new to persistent memory
+probably want to start with this library.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmemobj-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmemobj.so
+%{_libdir}/pmdk_debug/libpmemobj.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmempool__PKG_NAME_SUFFIX__
+Summary: Persistent Memory pool management library
+Group: __GROUP_SYS_LIBS__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+%description -n libpmempool__PKG_NAME_SUFFIX__
+The libpmempool library provides a set of utilities for off-line
+administration, analysis, diagnostics and repair of persistent memory
+pools created by libpmemlog, libpemblk and libpmemobj libraries.
+
+%files -n libpmempool__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%{_libdir}/libpmempool.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmempool-devel
+Summary: Development files for Persistent Memory pool management library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmempool__PKG_NAME_SUFFIX__ = %{version}-%{release}
+Requires: libpmem-devel = %{version}-%{release}
+%description -n libpmempool-devel
+The libpmempool library provides a set of utilities for off-line
+administration, analysis, diagnostics and repair of persistent memory
+pools created by libpmemlog, libpemblk and libpmemobj libraries.
+
+%files -n libpmempool-devel
+%defattr(-,root,root,-)
+%{_libdir}/libpmempool.so
+%{_libdir}/pkgconfig/libpmempool.pc
+%{_includedir}/libpmempool.h
+%{_mandir}/man7/libpmempool.7.gz
+%{_mandir}/man5/poolset.5.gz
+%{_mandir}/man3/pmempool_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n libpmempool-debug
+Summary: Debug variant of the Persistent Memory pool management library
+Group: __GROUP_DEV_LIBS__
+Requires: libpmempool__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n libpmempool-debug
+The libpmempool library provides a set of utilities for off-line
+administration, analysis, diagnostics and repair of persistent memory
+pools created by libpmemlog, libpemblk and libpmemobj libraries.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n libpmempool-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/libpmempool.so
+%{_libdir}/pmdk_debug/libpmempool.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%if %{with fabric}
+
+%package -n librpmem__PKG_NAME_SUFFIX__
+Summary: Remote Access to Persistent Memory library
+Group: __GROUP_SYS_LIBS__
+Requires: libfabric >= %{min_libfabric_ver}
+%if %{defined suse_version}
+Requires: openssh
+%else
+Requires: openssh-clients
+%endif
+%description -n librpmem__PKG_NAME_SUFFIX__
+The librpmem library provides low-level support for remote access
+to persistent memory utilizing RDMA-capable NICs. It can be used
+to replicate persistent memory regions over RDMA protocol.
+
+%files -n librpmem__PKG_NAME_SUFFIX__
+%defattr(-,root,root,-)
+%{_libdir}/librpmem.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n librpmem-devel
+Summary: Development files for the Remote Access to Persistent Memory library
+Group: __GROUP_DEV_LIBS__
+Requires: librpmem__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n librpmem-devel
+The librpmem library provides low-level support for remote access
+to persistent memory utilizing RDMA-capable NICs. It can be used
+to replicate persistent memory regions over RDMA protocol.
+
+This sub-package contains libraries and header files for developing
+applications that want to specifically make use of librpmem.
+
+%files -n librpmem-devel
+%defattr(-,root,root,-)
+%{_libdir}/librpmem.so
+%{_libdir}/pkgconfig/librpmem.pc
+%{_includedir}/librpmem.h
+%{_mandir}/man7/librpmem.7.gz
+%{_mandir}/man3/rpmem_*.3.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n librpmem-debug
+Summary: Debug variant of the Remote Access to Persistent Memory library
+Group: __GROUP_DEV_LIBS__
+Requires: librpmem__PKG_NAME_SUFFIX__ = %{version}-%{release}
+%description -n librpmem-debug
+The librpmem library provides low-level support for remote access
+to persistent memory utilizing RDMA-capable NICs. It can be used
+to replicate persistent memory regions over RDMA protocol.
+
+This sub-package contains debug variant of the library, providing
+run-time assertions and trace points. The typical way to access the
+debug version is to set the environment variable LD_LIBRARY_PATH to
+/usr/lib64/pmdk_debug.
+
+%files -n librpmem-debug
+%defattr(-,root,root,-)
+%dir %{_libdir}/pmdk_debug
+%{_libdir}/pmdk_debug/librpmem.so
+%{_libdir}/pmdk_debug/librpmem.so.*
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%package -n rpmemd
+Group: __GROUP_SYS_BASE__
+Summary: Target node process executed by librpmem
+Requires: libfabric >= %{min_libfabric_ver}
+%description -n rpmemd
+The rpmemd process is executed on a target node by librpmem library
+and facilitates access to persistent memory over RDMA.
+
+%files -n rpmemd
+%{_bindir}/rpmemd
+%{_mandir}/man1/rpmemd.1.gz
+
+# end of "if _with_fabric"
+%endif
+
+%package -n pmempool
+Summary: Utilities for Persistent Memory
+Group: __GROUP_SYS_BASE__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+Requires: libpmemlog__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+Requires: libpmemblk__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+Requires: libpmemobj__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+Requires: libpmempool__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+Obsoletes: nvml-tools < %{version}-%{release}
+%description -n pmempool
+The pmempool is a standalone utility for management and off-line analysis
+of Persistent Memory pools created by PMDK libraries. It provides a set
+of utilities for administration and diagnostics of Persistent Memory pools.
+The pmempool may be useful for troubleshooting by system administrators
+and users of the applications based on PMDK libraries.
+
+%files -n pmempool
+%{_bindir}/pmempool
+%{_mandir}/man1/pmempool.1.gz
+%{_mandir}/man1/pmempool-*.1.gz
+%config(noreplace) %{_sysconfdir}/bash_completion.d/pmempool
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+%package -n pmreorder
+Summary: Consistency Checker for Persistent Memory
+Group: __GROUP_SYS_BASE__
+%description -n pmreorder
+The pmreorder tool is a collection of python scripts designed to parse
+and replay operations logged by pmemcheck - a persistent memory checking tool.
+Pmreorder performs the store reordering between persistent memory barriers -
+a sequence of flush-fence operations. It uses a consistency checking routine
+provided in the command line options to check whether files are in a consistent state.
+
+%files -n pmreorder
+%{_bindir}/pmreorder
+%{_datadir}/pmreorder/*.py
+%{_mandir}/man1/pmreorder.1.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+
+%if %{with ndctl}
+
+%package -n daxio
+Summary: Perform I/O on Device DAX devices or zero a Device DAX device
+Group: __GROUP_SYS_BASE__
+Requires: libpmem__PKG_NAME_SUFFIX__ >= %{version}-%{release}
+%description -n daxio
+The daxio utility performs I/O on Device DAX devices or zero
+a Device DAX device.  Since the standard I/O APIs (read/write) cannot be used
+with Device DAX, data transfer is performed on a memory-mapped device.
+The daxio may be used to dump Device DAX data to a file, restore data from
+a backup copy, move/copy data to another device or to erase data from
+a device.
+
+%files -n daxio
+%{_bindir}/daxio
+%{_mandir}/man1/daxio.1.gz
+%license LICENSE
+%doc ChangeLog CONTRIBUTING.md README.md
+
+# end of "if _with_ndctl"
+%endif
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+# For debug build default flags may be overridden to disable compiler
+# optimizations.
+CFLAGS="%{optflags}" \
+LDFLAGS="%{?__global_ldflags}" \
+make %{?_smp_mflags} \
+%if %{without ndctl}
+       NDCTL_ENABLE=n \
+%endif
+       __MAKE_FLAGS__
+
+
+# Override LIB_AR with empty string to skip installation of static libraries
+%install
+make install DESTDIR=%{buildroot} \
+%if %{without ndctl}
+        NDCTL_ENABLE=n \
+%endif
+       LIB_AR= \
+       prefix=%{_prefix} \
+       libdir=%{_libdir} \
+       includedir=%{_includedir} \
+       mandir=%{_mandir} \
+       bindir=%{_bindir} \
+       sysconfdir=%{_sysconfdir} \
+       docdir=%{_docdir}
+mkdir -p %{buildroot}%{_datadir}/pmdk
+cp utils/pmdk.magic %{buildroot}%{_datadir}/pmdk/
+__MAKE_INSTALL_FDUPES__
+
+
+%check
+%if 0%{?_skip_check} == 1
+       echo "Check skipped"
+%else
+       %if %{defined _testconfig}
+               cp %{_testconfig} src/test/testconfig.sh
+       %else
+               echo "PMEM_FS_DIR=/tmp" > src/test/testconfig.sh
+               echo "PMEM_FS_DIR_FORCE_PMEM=1" >> src/test/testconfig.sh
+               echo 'TEST_BUILD="debug nondebug"' >> src/test/testconfig.sh
+               echo 'TEST_FS="pmem any none"' >> src/test/testconfig.sh
+       %endif
+       make \
+%if %{without ndctl}
+        NDCTL_ENABLE=n \
+%endif
+       check
+%endif
+
+%post   -n libpmem__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n libpmem__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%post   -n libpmemblk__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n libpmemblk__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%post   -n libpmemlog__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n libpmemlog__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%post   -n libpmemobj__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n libpmemobj__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%post   -n libpmempool__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n libpmempool__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+
+%if %{with fabric}
+%post   -n librpmem__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%postun -n librpmem__PKG_NAME_SUFFIX__ -p /sbin/ldconfig
+%endif
+
+%if 0%{?__debug_package} == 0
+%debug_package
+%endif
+
+
+%changelog
diff --git a/ceph/src/pmdk/utils/ps_analyze.ps1 b/ceph/src/pmdk/utils/ps_analyze.ps1
new file mode 100644 (file)
index 0000000..b0e6bfe
--- /dev/null
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017, Intel Corporation
+#
+# ps_analyze -- script to analyze ps1 files
+#
+
+Write-Output "Starting PSScript analyzing ..."
+
+$scriptdir = Split-Path -Parent $PSCommandPath
+$rootdir = $scriptdir + "\.."
+$detected = 0
+
+$include = @("*.ps1" )
+Get-ChildItem -Path $rootdir -Recurse -Include $include  | `
+    Where-Object { $_.FullName -notlike "*test*" } | `
+    ForEach-Object {
+        $analyze_result = Invoke-ScriptAnalyzer -Path $_.FullName
+        if ($analyze_result) {
+            $detected = $detected + $analyze_result.Count
+            Write-Output $_.FullName
+            Write-Output $analyze_result
+        }
+    }
+
+if ($detected) {
+    Write-Output "PSScriptAnalyzer FAILED. Issues detected: $detected"
+    Exit 1
+} else {
+    Write-Output "PSScriptAnalyzer PASSED. No issue detected."
+    Exit 0
+}
diff --git a/ceph/src/pmdk/utils/sort_solution b/ceph/src/pmdk/utils/sort_solution
new file mode 100755 (executable)
index 0000000..c14f57e
--- /dev/null
@@ -0,0 +1,128 @@
+#!/usr/bin/perl
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016, Intel Corporation
+
+#
+# sort_solution -- sort visual studio solution projects lists
+#
+
+use strict;
+use warnings;
+# install libtext-diff-perl or perl-Text-Diff
+use Text::Diff;
+
+use Cwd 'abs_path';
+use File::Basename;
+use File::Compare;
+
+
+sub help {
+       print "Usage: sort_solution [check|sort]\n";
+       exit;
+}
+
+sub sort_global_section {
+       my ($solution_fh, $temp_fh, $section_name) = @_;
+       my $line = "";
+       my @array;
+
+       while (defined($line = <$solution_fh>) && ($line !~ $section_name)) {
+               print $temp_fh $line;
+       }
+       print $temp_fh $line;
+
+       while (defined($line = <$solution_fh>) && ($line !~ "EndGlobalSection")) {
+               push @array, $line;
+       }
+
+       @array = sort @array;
+
+       foreach (@array) {
+               print $temp_fh $_;
+       }
+
+       print $temp_fh $line; # print EndGlobalSection line
+}
+
+my $num_args = $#ARGV + 1;
+if ($num_args != 1) {
+       help;
+}
+my $arg = $ARGV[0];
+
+if($arg ne "check" && $arg ne "sort") {
+       help;
+}
+my $filename = dirname(abs_path($0)).'/../src/PMDK.sln';
+my $tempfile = dirname(abs_path($0)).'/../src/temp.sln';
+
+open(my $temp_fh, '>', $tempfile)
+       or die "Could not open file '$tempfile' $!";
+open(my $solution_fh, '<:crlf', $filename)
+       or die "Could not open file '$filename' $!";
+
+my $line;
+
+# Read a header of file
+while (defined($line = <$solution_fh>) && ($line !~ "^Project")) {
+       print $temp_fh $line;
+}
+
+my @part1;
+my $buff;
+my $guid;
+
+# Read the projects list with project dependencies
+do {
+       if($line =~ "^Project") {
+               $buff = $line;
+               $guid = (split(/\,/, $line))[2];
+       } elsif($line =~ "^EndProject") {
+               $buff .= $line;
+               my %table = (
+                       guid => $guid,
+                       buff => $buff,
+               );
+               push @part1, \%table;
+       } else {
+               $buff .= $line;
+       }
+
+} while (defined($line = <$solution_fh>) && $line ne "Global\n");
+
+# sort the project list by a project GIUD and write to the tempfile
+@part1 = sort { $a->{guid} cmp $b->{guid} } @part1;
+
+foreach (@part1) {
+       my %hash = %$_;
+       print $temp_fh $hash{"buff"};
+}
+print $temp_fh $line; # EndProject line
+
+sort_global_section $solution_fh, $temp_fh, "ProjectConfigurationPlatforms";
+
+sort_global_section $solution_fh, $temp_fh, "NestedProjects";
+
+# read solution file to the end and copy it to the temp file
+while (defined($line = <$solution_fh>)){
+       print $temp_fh $line;
+}
+
+close($temp_fh);
+close($solution_fh);
+
+if($arg eq "check") {
+       my $diff = diff $filename => $tempfile;
+       if ($diff eq "") {
+               unlink $tempfile;
+               exit;
+       }
+
+       print "PMDK solution file is not sorted, " .
+               "please use sort_solution script before pushing your changes\n";
+       unlink $tempfile;
+       exit 1;
+} else {
+       unlink $filename or die "Cannot replace solution file $!";
+       rename $tempfile, $filename;
+}
diff --git a/ceph/src/pmdk/utils/style_check.sh b/ceph/src/pmdk/utils/style_check.sh
new file mode 100755 (executable)
index 0000000..c9d44e2
--- /dev/null
@@ -0,0 +1,137 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2016-2020, Intel Corporation
+#
+# utils/style_check.sh -- common style checking script
+#
+set -e
+
+ARGS=("$@")
+CSTYLE_ARGS=()
+CLANG_ARGS=()
+FLAKE8_ARGS=()
+CHECK_TYPE=$1
+
+[ -z "$clang_format_bin" ] && which clang-format-9 >/dev/null &&
+       clang_format_bin=clang-format-9
+[ -z "$clang_format_bin" ] && which clang-format >/dev/null &&
+       clang_format_bin=clang-format
+[ -z "$clang_format_bin" ] && clang_format_bin=clang-format
+
+#
+# print script usage
+#
+function usage() {
+       echo "$0 <check|format> [C/C++ files]"
+}
+
+#
+# require clang-format version 9.0
+#
+function check_clang_version() {
+       set +e
+       which ${clang_format_bin} &> /dev/null && ${clang_format_bin} --version |\
+       grep "version 9\.0"\
+       &> /dev/null
+       if [ $? -ne 0 ]; then
+               echo "SKIP: requires clang-format version 9.0"
+               exit 0
+       fi
+       set -e
+}
+
+#
+# run old cstyle check
+#
+function run_cstyle() {
+       if [ $# -eq 0 ]; then
+               return
+       fi
+
+       ${cstyle_bin} -pP $@
+}
+
+#
+# generate diff with clang-format rules
+#
+function run_clang_check() {
+       if [ $# -eq 0 ]; then
+               return
+       fi
+       check_clang_version
+
+       for file in $@
+       do
+               LINES=$(${clang_format_bin} -style=file $file |\
+                               git diff --no-index $file - | wc -l)
+               if [ $LINES -ne 0 ]; then
+                       ${clang_format_bin} -style=file $file | git diff --no-index $file -
+               fi
+       done
+}
+
+#
+# in-place format according to clang-format rules
+#
+function run_clang_format() {
+       if [ $# -eq 0 ]; then
+               return
+       fi
+       check_clang_version
+
+       ${clang_format_bin} -style=file -i $@
+}
+
+function run_flake8() {
+       if [ $# -eq 0 ]; then
+               return
+       fi
+       ${flake8_bin} --exclude=testconfig.py,envconfig.py $@
+}
+
+for ((i=1; i<$#; i++)) {
+
+       IGNORE="$(dirname ${ARGS[$i]})/.cstyleignore"
+       if [ -e $IGNORE ]; then
+               if grep -q ${ARGS[$i]} $IGNORE ; then
+                       echo "SKIP ${ARGS[$i]}"
+                       continue
+               fi
+       fi
+       case ${ARGS[$i]} in
+               *.[ch]pp)
+                       CLANG_ARGS+="${ARGS[$i]} "
+                       ;;
+
+               *.[ch])
+                       CSTYLE_ARGS+="${ARGS[$i]} "
+                       ;;
+
+               *.py)
+                       FLAKE8_ARGS+="${ARGS[$i]} "
+                       ;;
+
+               *)
+                       echo "Unknown argument"
+                       exit 1
+                       ;;
+       esac
+}
+
+case $CHECK_TYPE in
+       check)
+               run_cstyle ${CSTYLE_ARGS}
+               run_clang_check ${CLANG_ARGS}
+               run_flake8 ${FLAKE8_ARGS}
+               ;;
+
+       format)
+               run_clang_format ${CLANG_ARGS}
+               ;;
+
+       *)
+               echo "Invalid parameters"
+               usage
+               exit 1
+               ;;
+esac
diff --git a/ceph/src/pmdk/utils/version.sh b/ceph/src/pmdk/utils/version.sh
new file mode 100755 (executable)
index 0000000..fd751c9
--- /dev/null
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2017-2020, Intel Corporation
+#
+# utils/version.sh -- determine project's version
+#
+set -e
+
+if [ -f "$1/VERSION" ]; then
+       cat "$1/VERSION"
+       exit 0
+fi
+
+if [ -f $1/GIT_VERSION ]; then
+       echo -n "\$Format:%h\$" | cmp -s $1/GIT_VERSION - && true
+       if [ $? -eq 0 ]; then
+               PARSE_GIT_VERSION=0
+       else
+               PARSE_GIT_VERSION=1
+       fi
+else
+       PARSE_GIT_VERSION=0
+fi
+
+LATEST_RELEASE=$(cat $1/ChangeLog | grep "* Version" | cut -d " " -f 3 | sort -rd | head -n1)
+
+if [ $PARSE_GIT_VERSION -eq 1 ]; then
+       GIT_VERSION_HASH=$(cat $1/GIT_VERSION)
+
+       if [ -n "$GIT_VERSION_HASH" ]; then
+               echo "$LATEST_RELEASE+git.$GIT_VERSION_HASH"
+               exit 0
+       fi
+fi
+
+cd "$1"
+
+GIT_DESCRIBE=$(git describe 2>/dev/null) && true
+if [ -n "$GIT_DESCRIBE" ]; then
+       # 1.5-19-gb8f78a329 -> 1.5+git19.gb8f78a329
+       # 1.5-rc1-19-gb8f78a329 -> 1.5-rc1+git19.gb8f78a329
+       echo "$GIT_DESCRIBE" | sed "s/\([0-9.]*\)-rc\([0-9]*\)-\([0-9]*\)-\([0-9a-g]*\)/\1-rc\2+git\3.\4/" | sed "s/\([0-9.]*\)-\([0-9]*\)-\([0-9a-g]*\)/\1+git\2.\3/"
+       exit 0
+fi
+
+# try commit it, git describe can fail when there are no tags (e.g. with shallow clone, like on Travis)
+GIT_COMMIT=$(git log -1 --format=%h) && true
+if [ -n "$GIT_COMMIT" ]; then
+       echo "$LATEST_RELEASE+git.$GIT_COMMIT"
+       exit 0
+fi
+
+cd - >/dev/null
+
+# If nothing works, try to get version from directory name
+VER=$(basename `realpath "$1"` | sed 's/pmdk[-]*\([0-9a-z.+-]*\).*/\1/')
+if [ -n "$VER" ]; then
+       echo "$VER"
+       exit 0
+fi
+
+exit 1
index cc13a4001b6f1cd404a04e030f06e0b2592b524e..a8dd2451fcc3cd35854cd3536343329ad9f23dd5 100644 (file)
@@ -1127,8 +1127,12 @@ def validate(args: List[str],
 
             # no arg, but not required?  Continue consuming mysig
             # in case there are later required args
-            if myarg in (None, []) and not desc.req:
-                break
+            if myarg in (None, []):
+                if not desc.req:
+                    break
+                # did we already get this argument (as a named arg, earlier?)
+                if desc.name in d:
+                    break
 
             # A keyword argument?
             if myarg:
index 833faf1aa0846982f6ce92b068b5759b1d1ca6e7..4756f69aa724b086e77e1c7b162d4488b44637e8 100644 (file)
@@ -22,4 +22,12 @@ install(DIRECTORY
   REGEX "rook/rook-client-python.*" EXCLUDE
   REGEX "osd_perf_query/.*" EXCLUDE
   REGEX "tox.ini" EXCLUDE
-  REGEX "requirements.txt" EXCLUDE)
+  REGEX "requirements.*\.txt" EXCLUDE
+  REGEX "constraints.*\.txt" EXCLUDE
+  REGEX "node_modules" EXCLUDE
+  REGEX "cypress.*" EXCLUDE
+  REGEX "\.coveragerc" EXCLUDE
+  REGEX "\.editorconfig" EXCLUDE
+  REGEX "\..*lintrc" EXCLUDE
+  REGEX "\.browserslistrc" EXCLUDE
+  REGEX "\.prettier*" EXCLUDE)
index d0509b66124eea5118c764feb609f52fc1c4f271..5c69e1fc09a477d39e1d4ccf42da2a400c857a23 100644 (file)
@@ -14,6 +14,7 @@ from ceph.utils import str_to_datetime, datetime_to_str, datetime_now
 from orchestrator import OrchestratorError, HostSpec, OrchestratorEvent, service_to_daemon_types
 
 from .utils import resolve_ip
+from .migrations import queue_migrate_nfs_spec
 
 if TYPE_CHECKING:
     from .module import CephadmOrchestrator
@@ -92,8 +93,16 @@ class Inventory:
             raise OrchestratorError('host %s does not exist' % host)
 
     def add_host(self, spec: HostSpec) -> None:
-        self._inventory[spec.hostname] = spec.to_json()
-        self.save()
+        if spec.hostname in self._inventory:
+            # addr
+            if self.get_addr(spec.hostname) != spec.addr:
+                self.set_addr(spec.hostname, spec.addr)
+            # labels
+            for label in spec.labels:
+                self.add_label(spec.hostname, label)
+        else:
+            self._inventory[spec.hostname] = spec.to_json()
+            self.save()
 
     def rm_host(self, host: str) -> None:
         self.assert_host(host)
@@ -207,6 +216,12 @@ class SpecStore():
             service_name = k[len(SPEC_STORE_PREFIX):]
             try:
                 j = cast(Dict[str, dict], json.loads(v))
+                if (
+                        (self.mgr.migration_current or 0) < 3
+                        and j['spec'].get('service_type') == 'nfs'
+                ):
+                    self.mgr.log.debug(f'found legacy nfs spec {j}')
+                    queue_migrate_nfs_spec(self.mgr, j)
                 spec = ServiceSpec.from_json(j['spec'])
                 created = str_to_datetime(cast(str, j['created']))
                 self._specs[service_name] = spec
@@ -595,6 +610,17 @@ class HostCache():
         self.registry_login_queue.add(host)
         self.last_client_files[host] = {}
 
+    def refresh_all_host_info(self, host):
+        # type: (str) -> None
+
+        self.last_host_check.pop(host, None)
+        self.daemon_refresh_queue.append(host)
+        self.registry_login_queue.add(host)
+        self.device_refresh_queue.append(host)
+        self.last_facts_update.pop(host, None)
+        self.osdspec_previews_refresh_queue.append(host)
+        self.last_autotune.pop(host, None)
+
     def invalidate_host_daemons(self, host):
         # type: (str) -> None
         self.daemon_refresh_queue.append(host)
@@ -719,6 +745,13 @@ class HostCache():
                     return dd
         raise orchestrator.OrchestratorError(f'Unable to find {daemon_name} daemon(s)')
 
+    def has_daemon(self, daemon_name: str) -> bool:
+        try:
+            self.get_daemon(daemon_name)
+        except orchestrator.OrchestratorError:
+            return False
+        return True
+
     def get_daemons_with_volatile_status(self) -> Iterator[Tuple[str, Dict[str, orchestrator.DaemonDescription]]]:
         def alter(host: str, dd_orig: orchestrator.DaemonDescription) -> orchestrator.DaemonDescription:
             dd = copy(dd_orig)
index 07b249df78fbe2a3e27102aa8b6f13a4d58531db..941ede3666de3ece6c64a3cd0e70ed9ed4b61d46 100644 (file)
@@ -1,15 +1,18 @@
+import json
 import logging
-from typing import TYPE_CHECKING, Iterator
+from typing import TYPE_CHECKING, Iterator, Optional, Dict, Any
 
 from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, HostPlacementSpec
 from cephadm.schedule import HostAssignment
+import rados
 
+from mgr_module import NFS_POOL_NAME
 from orchestrator import OrchestratorError, DaemonDescription
 
 if TYPE_CHECKING:
     from .module import CephadmOrchestrator
 
-LAST_MIGRATION = 2
+LAST_MIGRATION = 3
 
 logger = logging.getLogger(__name__)
 
@@ -29,12 +32,15 @@ class Migrations:
         # upgrade code, while an old upgrade is still in progress), naming of daemons,
         # fs-layout of the daemons, etc.
         if self.mgr.migration_current is None:
-            self.set(0)
+            self.set(LAST_MIGRATION)
+
+        v = mgr.get_store('nfs_migration_queue')
+        self.nfs_migration_queue = json.loads(v) if v else []
 
         # for some migrations, we don't need to do anything except for
         # setting migration_current = 1.
         # let's try to shortcut things here.
-        self.migrate()
+        self.migrate(True)
 
     def set(self, val: int) -> None:
         self.mgr.set_module_option('migration_current', val)
@@ -49,7 +55,7 @@ class Migrations:
             raise OrchestratorError(
                 "cephadm migration still ongoing. Please wait, until the migration is complete.")
 
-    def migrate(self) -> None:
+    def migrate(self, startup: bool = False) -> None:
         if self.mgr.migration_current == 0:
             if self.migrate_0_1():
                 self.set(1)
@@ -58,6 +64,10 @@ class Migrations:
             if self.migrate_1_2():
                 self.set(2)
 
+        if self.mgr.migration_current == 2 and not startup:
+            if self.migrate_2_3():
+                self.set(3)
+
     def migrate_0_1(self) -> bool:
         """
         Migration 0 -> 1
@@ -161,3 +171,107 @@ class Migrations:
             self.mgr.spec_store.finally_rm(old)
 
         return True
+
+    def migrate_2_3(self) -> bool:
+        if self.nfs_migration_queue:
+            from nfs.cluster import create_ganesha_pool
+
+            create_ganesha_pool(self.mgr)
+            for service_id, pool, ns in self.nfs_migration_queue:
+                if pool != '.nfs':
+                    self.migrate_nfs_spec(service_id, pool, ns)
+            self.nfs_migration_queue = []
+            self.mgr.log.info('Done migrating all NFS services')
+        return True
+
+    def migrate_nfs_spec(self, service_id: str, pool: str, ns: Optional[str]) -> None:
+        renamed = False
+        if service_id.startswith('ganesha-'):
+            service_id = service_id[8:]
+            renamed = True
+
+        self.mgr.log.info(
+            f'Migrating nfs.{service_id} from legacy pool {pool} namespace {ns}'
+        )
+
+        # read exports
+        ioctx = self.mgr.rados.open_ioctx(pool)
+        if ns is not None:
+            ioctx.set_namespace(ns)
+        object_iterator = ioctx.list_objects()
+        exports = []
+        while True:
+            try:
+                obj = object_iterator.__next__()
+                if obj.key.startswith('export-'):
+                    self.mgr.log.debug(f'reading {obj.key}')
+                    exports.append(obj.read().decode())
+            except StopIteration:
+                break
+        self.mgr.log.info(f'Found {len(exports)} exports for legacy nfs.{service_id}')
+
+        # copy grace file
+        if service_id != ns:
+            try:
+                grace = ioctx.read("grace")
+                new_ioctx = self.mgr.rados.open_ioctx(NFS_POOL_NAME)
+                new_ioctx.set_namespace(service_id)
+                new_ioctx.write_full("grace", grace)
+                self.mgr.log.info('Migrated nfs-ganesha grace file')
+            except rados.ObjectNotFound:
+                self.mgr.log.debug('failed to read old grace file; skipping')
+
+        if renamed and f'nfs.ganesha-{service_id}' in self.mgr.spec_store:
+            # rename from nfs.ganesha-* to nfs.*.  This will destroy old daemons and
+            # deploy new ones.
+            self.mgr.log.info(f'Replacing nfs.ganesha-{service_id} with nfs.{service_id}')
+            spec = self.mgr.spec_store[f'nfs.ganesha-{service_id}'].spec
+            self.mgr.spec_store.rm(f'nfs.ganesha-{service_id}')
+            spec.service_id = service_id
+            self.mgr.spec_store.save(spec, True)
+        else:
+            # redeploy all ganesha daemons to ensures that the daemon
+            # cephx are correct AND container configs are set up properly
+            daemons = [d.name() for d in self.mgr.cache.get_daemons_by_service(f'nfs.{service_id}')]
+            self.mgr.log.info(f'Removing old nfs.{service_id} daemons {daemons}')
+            self.mgr.remove_daemons(daemons)
+
+            # re-save service spec (without pool and namespace properties!)
+            spec = self.mgr.spec_store[f'nfs.{service_id}'].spec
+            self.mgr.spec_store.save(spec)
+
+        # import exports
+        for export in exports:
+            ex = ''
+            for line in export.splitlines():
+                if (
+                        line.startswith('        secret_access_key =')
+                        or line.startswith('        user_id =')
+                ):
+                    continue
+                ex += line + '\n'
+            self.mgr.log.debug(f'importing export: {ex}')
+            ret, out, err = self.mgr.mon_command({
+                'prefix': 'nfs export apply',
+                'cluster_id': service_id
+            }, inbuf=ex)
+            if ret:
+                self.mgr.log.warning(f'Failed to migrate export ({ret}): {err}\nExport was:\n{ex}')
+        self.mgr.log.info(f'Done migrating nfs.{service_id}')
+
+
+def queue_migrate_nfs_spec(mgr: "CephadmOrchestrator", spec_dict: Dict[Any, Any]) -> None:
+    """
+    After 16.2.5 we dropped the NFSServiceSpec pool and namespace properties.
+    Queue up a migration to process later, once we are sure that RADOS is available
+    and so on.
+    """
+    service_id = spec_dict['spec']['service_id']
+    args = spec_dict['spec'].get('spec', {})
+    pool = args.pop('pool', 'nfs-ganesha')
+    ns = args.pop('namespace', service_id)
+    queued = mgr.get_store('nfs_migration_queue') or '[]'
+    ls = json.loads(queued)
+    ls.append([service_id, pool, ns])
+    mgr.set_store('nfs_migration_queue', json.dumps(ls))
+    mgr.log.info(f'Queued nfs.{service_id} for migration')
index 88d670ecc07e06ff7169dcf92d0de6f3ee73a34f..235b16682c7847d46f4520b9d3f84fb31619f6f1 100644 (file)
@@ -24,7 +24,7 @@ from prettytable import PrettyTable
 from ceph.deployment import inventory
 from ceph.deployment.drive_group import DriveGroupSpec
 from ceph.deployment.service_spec import \
-    NFSServiceSpec, ServiceSpec, PlacementSpec, assert_valid_host, \
+    ServiceSpec, PlacementSpec, assert_valid_host, \
     HostPlacementSpec, IngressSpec
 from ceph.utils import str_to_datetime, datetime_to_str, datetime_now
 from cephadm.serve import CephadmServe
@@ -59,7 +59,7 @@ from .schedule import HostAssignment
 from .inventory import Inventory, SpecStore, HostCache, EventStore, ClientKeyringStore, ClientKeyringSpec
 from .upgrade import CephadmUpgrade
 from .template import TemplateMgr
-from .utils import CEPH_TYPES, GATEWAY_TYPES, forall_hosts, cephadmNoImage
+from .utils import CEPH_IMAGE_TYPES, forall_hosts, cephadmNoImage
 from .configchecks import CephadmConfigChecks
 
 try:
@@ -309,6 +309,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             default=None,
             desc='Custom repository password'
         ),
+        Option(
+            'registry_insecure',
+            type='bool',
+            default=False,
+            desc='Registry is to be considered insecure (no TLS available). Only for development purposes.'
+        ),
         Option(
             'use_repo_digest',
             type='bool',
@@ -345,6 +351,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             default=10 * 60,
             desc='how frequently to autotune daemon memory'
         ),
+        Option(
+            'max_osd_draining_count',
+            type='int',
+            default=10,
+            desc='max number of osds that will be drained simultaneously when osds are removed'
+        ),
     ]
 
     def __init__(self, *args: Any, **kwargs: Any):
@@ -390,10 +402,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             self.registry_url: Optional[str] = None
             self.registry_username: Optional[str] = None
             self.registry_password: Optional[str] = None
+            self.registry_insecure: bool = False
             self.use_repo_digest = True
             self.default_registry = ''
             self.autotune_memory_target_ratio = 0.0
             self.autotune_interval = 0
+            self.apply_spec_fails: List[Tuple[str, str]] = []
+            self.max_osd_draining_count = 10
 
         self._cons: Dict[str, Tuple[remoto.backends.BaseConnection,
                                     remoto.backends.LegacyModuleExecute]] = {}
@@ -1348,8 +1363,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
     def _get_container_image(self, daemon_name: str) -> Optional[str]:
         daemon_type = daemon_name.split('.', 1)[0]  # type: ignore
         image: Optional[str] = None
-        if daemon_type in CEPH_TYPES or \
-                daemon_type in GATEWAY_TYPES:
+        if daemon_type in CEPH_IMAGE_TYPES:
             # get container image
             image = str(self.get_foreign_ceph_option(
                 utils.name_to_config_section(daemon_name),
@@ -1414,6 +1428,11 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         ]
 
     def _check_valid_addr(self, host: str, addr: str) -> str:
+        # make sure mgr is not resolving own ip
+        if addr in self.get_mgr_id():
+            raise OrchestratorError(
+                "Can not automatically resolve ip address of host where active mgr is running. Please explicitly provide the address.")
+
         # make sure hostname is resolvable before trying to make a connection
         try:
             ip_addr = utils.resolve_ip(addr)
@@ -1442,11 +1461,13 @@ Then run the following:
             addr=addr,
             error_ok=True, no_fsid=True)
         if code:
+            msg = 'check-host failed:\n' + '\n'.join(err)
             # err will contain stdout and stderr, so we filter on the message text to
             # only show the errors
             errors = [_i.replace("ERROR: ", "") for _i in err if _i.startswith('ERROR')]
-            raise OrchestratorError('Host %s (%s) failed check(s): %s' % (
-                host, addr, errors))
+            if errors:
+                msg = f'Host {host} ({addr}) failed check(s): {errors}'
+            raise OrchestratorError(msg)
         return ip_addr
 
     def _add_host(self, spec):
@@ -1461,6 +1482,9 @@ Then run the following:
         if spec.addr == spec.hostname and ip_addr:
             spec.addr = ip_addr
 
+        if spec.hostname in self.inventory and self.inventory.get_addr(spec.hostname) != spec.addr:
+            self.cache.refresh_all_host_info(spec.hostname)
+
         # prime crush map?
         if spec.location:
             self.check_mon_command({
@@ -1474,6 +1498,8 @@ Then run the following:
             self.cache.prime_empty_host(spec.hostname)
         self.inventory.add_host(spec)
         self.offline_hosts_remove(spec.hostname)
+        if spec.status == 'maintenance':
+            self._set_maintenance_healthcheck()
         self.event.set()  # refresh stray health check
         self.log.info('Added host %s' % spec.hostname)
         return "Added host '{}' with addr '{}'".format(spec.hostname, spec.addr)
@@ -1536,7 +1562,7 @@ Then run the following:
 
                 if d.daemon_type != 'osd':
                     self.cephadm_services[str(d.daemon_type)].pre_remove(d)
-                    self.cephadm_services[str(d.daemon_type)].post_remove(d)
+                    self.cephadm_services[str(d.daemon_type)].post_remove(d, is_failed_deploy=False)
                 else:
                     cmd_args = {
                         'prefix': 'osd purge-actual',
@@ -1578,6 +1604,19 @@ Then run the following:
         """
         return list(self.inventory.all_specs())
 
+    @handle_orch_error
+    def get_facts(self, hostname: Optional[str] = None) -> List[Dict[str, Any]]:
+        """
+        Return a list of hosts metadata(gather_facts) managed by the orchestrator.
+
+        Notes:
+          - skip async: manager reads from cache.
+        """
+        if hostname:
+            return [self.cache.get_facts(hostname)]
+
+        return [self.cache.get_facts(hostname) for hostname in self.cache.get_hosts()]
+
     @handle_orch_error
     def add_host_label(self, host: str, label: str) -> str:
         self.inventory.add_label(host, label)
@@ -1644,15 +1683,11 @@ Then run the following:
 
         in_maintenance = self.inventory.get_host_with_state("maintenance")
         if not in_maintenance:
-            del self.health_checks["HOST_IN_MAINTENANCE"]
+            self.remove_health_warning('HOST_IN_MAINTENANCE')
         else:
             s = "host is" if len(in_maintenance) == 1 else "hosts are"
-            self.health_checks["HOST_IN_MAINTENANCE"] = {
-                "severity": "warning",
-                "summary": f"{len(in_maintenance)} {s} in maintenance mode",
-                "detail": [f"{h} is in maintenance" for h in in_maintenance],
-            }
-        self.set_health_checks(self.health_checks)
+            self.set_health_warning("HOST_IN_MAINTENANCE", f"{len(in_maintenance)} {s} in maintenance mode", 1, [
+                                    f"{h} is in maintenance" for h in in_maintenance])
 
     @handle_orch_error
     @host_exists()
@@ -1694,7 +1729,8 @@ Then run the following:
             _out, _err, _code = CephadmServe(self)._run_cephadm(hostname, cephadmNoImage, "host-maintenance",
                                                                 ["enter"],
                                                                 error_ok=True)
-            if _out:
+            returned_msg = _err[0].split('\n')[-1]
+            if returned_msg.startswith('failed') or returned_msg.startswith('ERROR'):
                 raise OrchestratorError(
                     f"Failed to place {hostname} into maintenance for cluster {self._cluster_fsid}")
 
@@ -1721,7 +1757,6 @@ Then run the following:
         self.inventory.save()
 
         self._set_maintenance_healthcheck()
-
         return f'Daemons for Ceph cluster {self._cluster_fsid} stopped on host {hostname}. Host {hostname} moved to maintenance mode'
 
     @handle_orch_error
@@ -1745,7 +1780,8 @@ Then run the following:
         outs, errs, _code = CephadmServe(self)._run_cephadm(hostname, cephadmNoImage, 'host-maintenance',
                                                             ['exit'],
                                                             error_ok=True)
-        if outs:
+        returned_msg = errs[0].split('\n')[-1]
+        if returned_msg.startswith('failed') or returned_msg.startswith('ERROR'):
             raise OrchestratorError(
                 f"Failed to exit maintenance state for host {hostname}, cluster {self._cluster_fsid}")
 
@@ -1818,9 +1854,6 @@ Then run the following:
                 virtual_ip=spec.get_virtual_ip(),
                 ports=spec.get_port_start(),
             )
-            if service_type == 'nfs':
-                spec = cast(NFSServiceSpec, spec)
-                sm[nm].rados_config_location = spec.rados_config_location()
             if spec.service_type == 'ingress':
                 # ingress has 2 daemons running per host
                 sm[nm].size *= 2
@@ -1957,10 +1990,10 @@ Then run the following:
             if action != 'redeploy':
                 raise OrchestratorError(
                     f'Cannot execute {action} with new image. `action` needs to be `redeploy`')
-            if daemon_type not in CEPH_TYPES and daemon_type not in GATEWAY_TYPES:
+            if daemon_type not in CEPH_IMAGE_TYPES:
                 raise OrchestratorError(
                     f'Cannot redeploy {daemon_type}.{daemon_id} with a new image: Supported '
-                    f'types are: {", ".join(CEPH_TYPES + GATEWAY_TYPES)}')
+                    f'types are: {", ".join(CEPH_IMAGE_TYPES)}')
 
             self.check_mon_command({
                 'prefix': 'config set',
@@ -2021,7 +2054,7 @@ Then run the following:
         return self._remove_daemons(args)
 
     @handle_orch_error
-    def remove_service(self, service_name: str) -> str:
+    def remove_service(self, service_name: str, force: bool = False) -> str:
         self.log.info('Remove service %s' % service_name)
         self._trigger_preview_refresh(service_name=service_name)
         if service_name in self.spec_store:
@@ -2029,9 +2062,9 @@ Then run the following:
                 return f'Unable to remove {service_name} service.\n' \
                        f'Note, you might want to mark the {service_name} service as "unmanaged"'
 
-        # Report list of affected OSDs
-        osds_msg = {}
-        if service_name.startswith('osd.'):
+        # Report list of affected OSDs?
+        if not force and service_name.startswith('osd.'):
+            osds_msg = {}
             for h, dm in self.cache.get_daemons_with_volatile_status():
                 osds_to_remove = []
                 for name, dd in dm.items():
@@ -2039,23 +2072,17 @@ Then run the following:
                         osds_to_remove.append(str(dd.daemon_id))
                 if osds_to_remove:
                     osds_msg[h] = osds_to_remove
-
-        found = self.spec_store.rm(service_name) or osds_msg
-        if found:
-            self._kick_serve_loop()
             if osds_msg:
-                return f'The service {service_name} will be deleted once the following OSDs: {osds_msg} ' \
-                       f'will be deleted manually.'
-            else:
-                return f'Removed service {service_name}'
-        else:
-            # must be idempotent: still a success.
-            try:
-                self.cache.get_daemon(service_name)
-                return (f'Failed to remove service <{service_name}>. "{service_name}" is the name of a daemon, not a service. '
-                        + 'Running service names can be found with "ceph orch ls"')
-            except OrchestratorError:
-                return f'Failed to remove service. <{service_name}> was not found. Running service names can be found with "ceph orch ls"'
+                msg = ''
+                for h, ls in osds_msg.items():
+                    msg += f'\thost {h}: {" ".join([f"osd.{id}" for id in ls])}'
+                raise OrchestratorError(f'If {service_name} is removed then the following OSDs will remain, --force to proceed anyway\n{msg}')
+
+        found = self.spec_store.rm(service_name)
+        if found and service_name.startswith('osd.'):
+            self.spec_store.finally_rm(service_name)
+        self._kick_serve_loop()
+        return f'Removed service {service_name}'
 
     @handle_orch_error
     def get_inventory(self, host_filter: Optional[orchestrator.InventoryFilter] = None, refresh: bool = False) -> List[orchestrator.InventoryHost]:
@@ -2090,15 +2117,88 @@ Then run the following:
 
     @handle_orch_error
     def zap_device(self, host: str, path: str) -> str:
+        """Zap a device on a managed host.
+
+        Use ceph-volume zap to return a device to an unused/free state
+
+        Args:
+            host (str): hostname of the cluster host
+            path (str): device path
+
+        Raises:
+            OrchestratorError: host is not a cluster host
+            OrchestratorError: host is in maintenance and therefore unavailable
+            OrchestratorError: device path not found on the host
+            OrchestratorError: device is known to a different ceph cluster
+            OrchestratorError: device holds active osd
+            OrchestratorError: device cache hasn't been populated yet..
+
+        Returns:
+            str: output from the zap command
+        """
+
         self.log.info('Zap device %s:%s' % (host, path))
+
+        if host not in self.inventory.keys():
+            raise OrchestratorError(
+                f"Host '{host}' is not a member of the cluster")
+
+        host_info = self.inventory._inventory.get(host, {})
+        if host_info.get('status', '').lower() == 'maintenance':
+            raise OrchestratorError(
+                f"Host '{host}' is in maintenance mode, which prevents any actions against it.")
+
+        if host not in self.cache.devices:
+            raise OrchestratorError(
+                f"Host '{host} hasn't been scanned yet to determine it's inventory. Please try again later.")
+
+        host_devices = self.cache.devices[host]
+        path_found = False
+        osd_id_list: List[str] = []
+
+        for dev in host_devices:
+            if dev.path == path:
+                # match, so look a little deeper
+                if dev.lvs:
+                    for lv in cast(List[Dict[str, str]], dev.lvs):
+                        if lv.get('osd_id', ''):
+                            lv_fsid = lv.get('cluster_fsid')
+                            if lv_fsid != self._cluster_fsid:
+                                raise OrchestratorError(
+                                    f"device {path} has lv's from a different Ceph cluster ({lv_fsid})")
+                            osd_id_list.append(lv.get('osd_id', ''))
+                path_found = True
+                break
+        if not path_found:
+            raise OrchestratorError(
+                f"Device path '{path}' not found on host '{host}'")
+
+        if osd_id_list:
+            dev_name = os.path.basename(path)
+            active_osds: List[str] = []
+            for osd_id in osd_id_list:
+                metadata = self.get_metadata('osd', str(osd_id))
+                if metadata:
+                    if metadata.get('hostname', '') == host and dev_name in metadata.get('devices', '').split(','):
+                        active_osds.append("osd." + osd_id)
+            if active_osds:
+                raise OrchestratorError(
+                    f"Unable to zap: device '{path}' on {host} has {len(active_osds)} active "
+                    f"OSD{'s' if len(active_osds) > 1 else ''}"
+                    f" ({', '.join(active_osds)}). Use 'ceph orch osd rm' first.")
+
         out, err, code = CephadmServe(self)._run_cephadm(
             host, 'osd', 'ceph-volume',
             ['--', 'lvm', 'zap', '--destroy', path],
             error_ok=True)
+
         self.cache.invalidate_host_devices(host)
         if code:
             raise OrchestratorError('Zap failed: %s' % '\n'.join(out + err))
-        return '\n'.join(out + err)
+        msg = f'zap successful for {path} on {host}'
+        self.log.info(msg)
+
+        return msg + '\n'
 
     @handle_orch_error
     def blink_device_light(self, ident_fault: str, on: bool, locs: List[orchestrator.DeviceLightLoc]) -> List[str]:
@@ -2244,6 +2344,8 @@ Then run the following:
                 return []
             daemons = self.cache.get_daemons_by_service(spec.service_name())
             deps = [d.name() for d in daemons if d.daemon_type == 'haproxy']
+        elif daemon_type == 'iscsi':
+            deps = [self.get_mgr_ip()]
         else:
             need = {
                 'prometheus': ['mgr', 'alertmanager', 'node-exporter', 'ingress'],
@@ -2353,6 +2455,20 @@ Then run the following:
 
         return self._apply_service_spec(cast(ServiceSpec, spec))
 
+    def set_health_warning(self, name: str, summary: str, count: int, detail: List[str]) -> None:
+        self.health_checks[name] = {
+            'severity': 'warning',
+            'summary': summary,
+            'count': count,
+            'detail': detail,
+        }
+        self.set_health_checks(self.health_checks)
+
+    def remove_health_warning(self, name: str) -> None:
+        if name in self.health_checks:
+            del self.health_checks[name]
+            self.set_health_checks(self.health_checks)
+
     def _plan(self, spec: ServiceSpec) -> dict:
         if spec.service_type == 'osd':
             return {'service_name': spec.service_name(),
@@ -2563,7 +2679,7 @@ Then run the following:
             for name, dd in dm.items():
                 if image_info.image_id == dd.container_image_id:
                     r['up_to_date'].append(dd.name())
-                elif dd.daemon_type in (CEPH_TYPES + GATEWAY_TYPES):
+                elif dd.daemon_type in CEPH_IMAGE_TYPES:
                     r['needs_update'][dd.name()] = {
                         'current_name': dd.container_image_name,
                         'current_id': dd.container_image_id,
@@ -2581,6 +2697,10 @@ Then run the following:
     def upgrade_status(self) -> orchestrator.UpgradeStatusSpec:
         return self.upgrade.upgrade_status()
 
+    @handle_orch_error
+    def upgrade_ls(self, image: Optional[str], tags: bool) -> Dict[Any, Any]:
+        return self.upgrade.upgrade_ls(image, tags)
+
     @handle_orch_error
     def upgrade_start(self, image: str, version: str) -> str:
         if self.inventory.get_host_with_state("maintenance"):
@@ -2602,7 +2722,8 @@ Then run the following:
     @handle_orch_error
     def remove_osds(self, osd_ids: List[str],
                     replace: bool = False,
-                    force: bool = False) -> str:
+                    force: bool = False,
+                    zap: bool = False) -> str:
         """
         Takes a list of OSDs and schedules them for removal.
         The function that takes care of the actual removal is
@@ -2623,6 +2744,7 @@ Then run the following:
                 self.to_remove_osds.enqueue(OSD(osd_id=int(daemon.daemon_id),
                                                 replace=replace,
                                                 force=force,
+                                                zap=zap,
                                                 hostname=daemon.hostname,
                                                 process_started_at=datetime_now(),
                                                 remove_util=self.to_remove_osds.rm_util))
diff --git a/ceph/src/pybind/mgr/cephadm/registry.py b/ceph/src/pybind/mgr/cephadm/registry.py
new file mode 100644 (file)
index 0000000..7b293a4
--- /dev/null
@@ -0,0 +1,61 @@
+import requests
+from typing import List, Dict, Tuple
+from requests import Response
+
+
+class Registry:
+
+    def __init__(self, url: str):
+        self._url: str = url
+
+    @property
+    def api_domain(self) -> str:
+        if self._url == 'docker.io':
+            return 'registry-1.docker.io'
+        return self._url
+
+    def get_token(self, response: Response) -> str:
+        realm, params = self.parse_www_authenticate(response.headers['Www-Authenticate'])
+        r = requests.get(realm, params=params)
+        r.raise_for_status()
+        ret = r.json()
+        if 'access_token' in ret:
+            return ret['access_token']
+        if 'token' in ret:
+            return ret['token']
+        raise ValueError(f'Unknown token reply {ret}')
+
+    def parse_www_authenticate(self, text: str) -> Tuple[str, Dict[str, str]]:
+        # 'Www-Authenticate': 'Bearer realm="https://auth.docker.io/token",service="registry.docker.io",scope="repository:ceph/ceph:pull"'
+        r: Dict[str, str] = {}
+        for token in text.split(','):
+            key, value = token.split('=', 1)
+            r[key] = value.strip('"')
+        realm = r.pop('Bearer realm')
+        return realm, r
+
+    def get_tags(self, image: str) -> List[str]:
+        tags = []
+        headers = {'Accept': 'application/json'}
+        url = f'https://{self.api_domain}/v2/{image}/tags/list'
+        while True:
+            r = requests.get(url, headers=headers)
+            if r.status_code == 401:
+                if 'Authorization' in headers:
+                    raise ValueError('failed authentication')
+                token = self.get_token(r)
+                headers['Authorization'] = f'Bearer {token}'
+                continue
+            r.raise_for_status()
+
+            new_tags = r.json()['tags']
+            tags.extend(new_tags)
+
+            if 'Link' not in r.headers:
+                break
+
+            # strip < > brackets off and prepend the domain
+            url = f'https://{self.api_domain}' + r.headers['Link'].split(';')[0][1:-1]
+            continue
+
+        return tags
index 8f4f02e5e4b325ed51c13f3d1f041c07e277a014..9ee0a5e3c970f4e48bc148f3015a88c510107a7a 100644 (file)
@@ -104,9 +104,9 @@ class DaemonPlacement(NamedTuple):
         if self.name and self.name != dd.daemon_id:
             return False
         if self.ports:
-            if self.ports != dd.ports:
+            if self.ports != dd.ports and dd.ports:
                 return False
-            if self.ip != dd.ip:
+            if self.ip != dd.ip and dd.ip:
                 return False
         return True
 
@@ -361,8 +361,8 @@ class HostAssignment(object):
     def find_ip_on_host(self, hostname: str, subnets: List[str]) -> Optional[str]:
         for subnet in subnets:
             ips: List[str] = []
-            for iface, ips in self.networks.get(hostname, {}).get(subnet, {}).items():
-                ips.extend(ips)
+            for iface, iface_ips in self.networks.get(hostname, {}).get(subnet, {}).items():
+                ips.extend(iface_ips)
             if ips:
                 return sorted(ips)[0]
         return None
index 1a307f958cb81a182b3d5e5355b1b4ad69888a7b..35092793a3339f6999d174cd7e3c883925a85edd 100644 (file)
@@ -127,17 +127,9 @@ class CephadmServe:
 
     def _update_paused_health(self) -> None:
         if self.mgr.paused:
-            self.mgr.health_checks['CEPHADM_PAUSED'] = {
-                'severity': 'warning',
-                'summary': 'cephadm background work is paused',
-                'count': 1,
-                'detail': ["'ceph orch resume' to resume"],
-            }
-            self.mgr.set_health_checks(self.mgr.health_checks)
+            self.mgr.set_health_warning('CEPHADM_PAUSED', 'cephadm background work is paused', 1, ["'ceph orch resume' to resume"])
         else:
-            if 'CEPHADM_PAUSED' in self.mgr.health_checks:
-                del self.mgr.health_checks['CEPHADM_PAUSED']
-                self.mgr.set_health_checks(self.mgr.health_checks)
+            self.mgr.remove_health_warning('CEPHADM_PAUSED')
 
     def _autotune_host_memory(self, host: str) -> None:
         total_mem = self.mgr.cache.get_facts(host).get('memory_total_kb', 0)
@@ -331,31 +323,16 @@ class CephadmServe:
 
         self.mgr.config_checker.run_checks()
 
-        health_changed = False
         for k in [
                 'CEPHADM_HOST_CHECK_FAILED',
                 'CEPHADM_FAILED_DAEMON',
                 'CEPHADM_REFRESH_FAILED',
         ]:
-            if k in self.mgr.health_checks:
-                del self.mgr.health_checks[k]
-                health_changed = True
+            self.mgr.remove_health_warning(k)
         if bad_hosts:
-            self.mgr.health_checks['CEPHADM_HOST_CHECK_FAILED'] = {
-                'severity': 'warning',
-                'summary': '%d hosts fail cephadm check' % len(bad_hosts),
-                'count': len(bad_hosts),
-                'detail': bad_hosts,
-            }
-            health_changed = True
+            self.mgr.set_health_warning('CEPHADM_HOST_CHECK_FAILED', f'{len(bad_hosts)} hosts fail cephadm check', len(bad_hosts), bad_hosts)
         if failures:
-            self.mgr.health_checks['CEPHADM_REFRESH_FAILED'] = {
-                'severity': 'warning',
-                'summary': 'failed to probe daemons or devices',
-                'count': len(failures),
-                'detail': failures,
-            }
-            health_changed = True
+            self.mgr.set_health_warning('CEPHADM_REFRESH_FAILED', 'failed to probe daemons or devices', len(failures), failures)
         failed_daemons = []
         for dd in self.mgr.cache.get_daemons():
             if dd.status is not None and dd.status == DaemonDescriptionStatus.error:
@@ -363,15 +340,7 @@ class CephadmServe:
                     dd.name(), dd.hostname, dd.status_desc
                 ))
         if failed_daemons:
-            self.mgr.health_checks['CEPHADM_FAILED_DAEMON'] = {
-                'severity': 'warning',
-                'summary': '%d failed cephadm daemon(s)' % len(failed_daemons),
-                'count': len(failed_daemons),
-                'detail': failed_daemons,
-            }
-            health_changed = True
-        if health_changed:
-            self.mgr.set_health_checks(self.mgr.health_checks)
+            self.mgr.set_health_warning('CEPHADM_FAILED_DAEMON', f'{len(failed_daemons)} failed cephadm daemon(s)', len(failed_daemons), failed_daemons)
 
     def _check_host(self, host: str) -> Optional[str]:
         if host not in self.mgr.inventory:
@@ -472,7 +441,7 @@ class CephadmServe:
 
         with_lsm = self.mgr.get_module_option('device_enhanced_scan')
         inventory_args = ['--', 'inventory',
-                          '--format=json',
+                          '--format=json-pretty',
                           '--filter-for-batch']
         if with_lsm:
             inventory_args.insert(-1, "--with-lsm")
@@ -524,10 +493,10 @@ class CephadmServe:
         self.log.debug('_check_for_strays')
         for k in ['CEPHADM_STRAY_HOST',
                   'CEPHADM_STRAY_DAEMON']:
-            if k in self.mgr.health_checks:
-                del self.mgr.health_checks[k]
+            self.mgr.remove_health_warning(k)
         if self.mgr.warn_on_stray_hosts or self.mgr.warn_on_stray_daemons:
             ls = self.mgr.list_servers()
+            self.log.debug(ls)
             managed = self.mgr.cache.get_daemon_names()
             host_detail = []     # type: List[str]
             host_num_daemons = 0
@@ -570,53 +539,54 @@ class CephadmServe:
                         'stray host %s has %d stray daemons: %s' % (
                             host, len(missing_names), missing_names))
             if self.mgr.warn_on_stray_hosts and host_detail:
-                self.mgr.health_checks['CEPHADM_STRAY_HOST'] = {
-                    'severity': 'warning',
-                    'summary': '%d stray host(s) with %s daemon(s) '
-                    'not managed by cephadm' % (
-                        len(host_detail), host_num_daemons),
-                    'count': len(host_detail),
-                    'detail': host_detail,
-                }
+                self.mgr.set_health_warning('CEPHADM_STRAY_HOST', f'{len(host_detail)} stray host(s) with {host_num_daemons} daemon(s) not managed by cephadm', len(host_detail), host_detail)
             if self.mgr.warn_on_stray_daemons and daemon_detail:
-                self.mgr.health_checks['CEPHADM_STRAY_DAEMON'] = {
-                    'severity': 'warning',
-                    'summary': '%d stray daemon(s) not managed by cephadm' % (
-                        len(daemon_detail)),
-                    'count': len(daemon_detail),
-                    'detail': daemon_detail,
-                }
-        self.mgr.set_health_checks(self.mgr.health_checks)
+                self.mgr.set_health_warning('CEPHADM_STRAY_DAEMON', f'{len(daemon_detail)} stray daemon(s) not managed by cephadm', len(daemon_detail), daemon_detail)
 
     def _apply_all_services(self) -> bool:
         r = False
         specs = []  # type: List[ServiceSpec]
         for sn, spec in self.mgr.spec_store.active_specs.items():
             specs.append(spec)
+        for name in ['CEPHADM_APPLY_SPEC_FAIL', 'CEPHADM_DAEMON_PLACE_FAIL']:
+            self.mgr.remove_health_warning(name)
+        self.mgr.apply_spec_fails = []
         for spec in specs:
             try:
                 if self._apply_service(spec):
                     r = True
             except Exception as e:
-                self.log.exception('Failed to apply %s spec %s: %s' % (
-                    spec.service_name(), spec, e))
+                msg = f'Failed to apply {spec.service_name()} spec {spec}: {str(e)}'
+                self.log.exception(msg)
                 self.mgr.events.for_service(spec, 'ERROR', 'Failed to apply: ' + str(e))
+                self.mgr.apply_spec_fails.append((spec.service_name(), str(e)))
+                warnings = []
+                for x in self.mgr.apply_spec_fails:
+                    warnings.append(f'{x[0]}: {x[1]}')
+                self.mgr.set_health_warning('CEPHADM_APPLY_SPEC_FAIL',
+                                            f"Failed to apply {len(self.mgr.apply_spec_fails)} service(s): {','.join(x[0] for x in self.mgr.apply_spec_fails)}",
+                                            len(self.mgr.apply_spec_fails),
+                                            warnings)
 
         return r
 
     def _apply_service_config(self, spec: ServiceSpec) -> None:
         if spec.config:
             section = utils.name_to_config_section(spec.service_name())
+            for name in ['CEPHADM_INVALID_CONFIG_OPTION', 'CEPHADM_FAILED_SET_OPTION']:
+                self.mgr.remove_health_warning(name)
+            invalid_config_options = []
+            options_failed_to_set = []
             for k, v in spec.config.items():
                 try:
                     current = self.mgr.get_foreign_ceph_option(section, k)
                 except KeyError:
-                    self.log.warning(
-                        f'Ignoring invalid {spec.service_name()} config option {k}'
-                    )
+                    msg = f'Ignoring invalid {spec.service_name()} config option {k}'
+                    self.log.warning(msg)
                     self.mgr.events.for_service(
                         spec, OrchestratorEvent.ERROR, f'Invalid config option {k}'
                     )
+                    invalid_config_options.append(msg)
                     continue
                 if current != v:
                     self.log.debug(f'setting [{section}] {k} = {v}')
@@ -628,9 +598,14 @@ class CephadmServe:
                             'who': section,
                         })
                     except MonCommandFailed as e:
-                        self.log.warning(
-                            f'Failed to set {spec.service_name()} option {k}: {e}'
-                        )
+                        msg = f'Failed to set {spec.service_name()} option {k}: {e}'
+                        self.log.warning(msg)
+                        options_failed_to_set.append(msg)
+
+            if invalid_config_options:
+                self.mgr.set_health_warning('CEPHADM_INVALID_CONFIG_OPTION', f'Ignoring {len(invalid_config_options)} invalid config option(s)', len(invalid_config_options), invalid_config_options)
+            if options_failed_to_set:
+                self.mgr.set_health_warning('CEPHADM_FAILED_SET_OPTION', f'Failed to set {len(options_failed_to_set)} option(s)', len(options_failed_to_set), options_failed_to_set)
 
     def _apply_service(self, spec: ServiceSpec) -> bool:
         """
@@ -706,9 +681,17 @@ class CephadmServe:
                 'status', '').lower() not in ['maintenance', 'offline'] and d.hostname not in self.mgr.offline_hosts)]
             self.log.debug('Add %s, remove %s' % (slots_to_add, daemons_to_remove))
         except OrchestratorError as e:
-            self.log.error('Failed to apply %s spec %s: %s' % (
-                spec.service_name(), spec, e))
+            msg = f'Failed to apply {spec.service_name()} spec {spec}: {str(e)}'
+            self.log.error(msg)
             self.mgr.events.for_service(spec, 'ERROR', 'Failed to apply: ' + str(e))
+            self.mgr.apply_spec_fails.append((spec.service_name(), str(e)))
+            warnings = []
+            for x in self.mgr.apply_spec_fails:
+                warnings.append(f'{x[0]}: {x[1]}')
+            self.mgr.set_health_warning('CEPHADM_APPLY_SPEC_FAIL',
+                                        f"Failed to apply {len(self.mgr.apply_spec_fails)} service(s): {','.join(x[0] for x in self.mgr.apply_spec_fails)}",
+                                        len(self.mgr.apply_spec_fails),
+                                        warnings)
             return False
 
         r = None
@@ -782,6 +765,7 @@ class CephadmServe:
                 svc.fence_old_ranks(spec, rank_map, len(all_slots))
 
             # create daemons
+            daemon_place_fails = []
             for slot in slots_to_add:
                 # first remove daemon on conflicting port?
                 if slot.ports:
@@ -830,6 +814,7 @@ class CephadmServe:
                            f"on {slot.hostname}: {e}")
                     self.mgr.events.for_service(spec, 'ERROR', msg)
                     self.mgr.log.error(msg)
+                    daemon_place_fails.append(msg)
                     # only return "no change" if no one else has already succeeded.
                     # later successes will also change to True
                     if r is None:
@@ -846,6 +831,9 @@ class CephadmServe:
                 )
                 daemons.append(sd)
 
+            if daemon_place_fails:
+                self.mgr.set_health_warning('CEPHADM_DAEMON_PLACE_FAIL', f'Failed to place {len(daemon_place_fails)} daemon(s)', len(daemon_place_fails), daemon_place_fails)
+
             # remove any?
             def _ok_to_stop(remove_daemons: List[orchestrator.DaemonDescription]) -> bool:
                 daemon_ids = [d.daemon_id for d in remove_daemons]
@@ -954,8 +942,12 @@ class CephadmServe:
 
         # do daemon post actions
         for daemon_type, daemon_descs in daemons_post.items():
-            if daemon_type in self.mgr.requires_post_actions:
-                self.mgr.requires_post_actions.remove(daemon_type)
+            run_post = False
+            for d in daemon_descs:
+                if d.name() in self.mgr.requires_post_actions:
+                    self.mgr.requires_post_actions.remove(d.name())
+                    run_post = True
+            if run_post:
                 self.mgr._get_cephadm_service(daemon_type_to_service(
                     daemon_type)).daemon_check_post(daemon_descs)
 
@@ -1077,7 +1069,7 @@ class CephadmServe:
                             DaemonDescriptionStatus.running, 'starting')
                         self.mgr.cache.add_daemon(daemon_spec.host, sd)
                         if daemon_spec.daemon_type in REQUIRES_POST_ACTIONS:
-                            self.mgr.requires_post_actions.add(daemon_spec.daemon_type)
+                            self.mgr.requires_post_actions.add(daemon_spec.name())
                     self.mgr.cache.invalidate_host_daemons(daemon_spec.host)
 
                 self.mgr.cache.update_daemon_config_deps(
@@ -1098,7 +1090,7 @@ class CephadmServe:
                     # we have to clean up the daemon. E.g. keyrings.
                     servict_type = daemon_type_to_service(daemon_spec.daemon_type)
                     dd = daemon_spec.to_daemon_description(DaemonDescriptionStatus.error, 'failed')
-                    self.mgr.cephadm_services[servict_type].post_remove(dd)
+                    self.mgr.cephadm_services[servict_type].post_remove(dd, is_failed_deploy=True)
                 raise
 
     def _remove_daemon(self, name: str, host: str) -> str:
@@ -1126,7 +1118,8 @@ class CephadmServe:
                 self.mgr.cache.rm_daemon(host, name)
             self.mgr.cache.invalidate_host_daemons(host)
 
-            self.mgr.cephadm_services[daemon_type_to_service(daemon_type)].post_remove(daemon)
+            self.mgr.cephadm_services[daemon_type_to_service(
+                daemon_type)].post_remove(daemon, is_failed_deploy=False)
 
             return "Removed {} from host '{}'".format(name, host)
 
@@ -1275,7 +1268,11 @@ class CephadmServe:
             self._registry_login(host, self.mgr.registry_url,
                                  self.mgr.registry_username, self.mgr.registry_password)
 
-        j = self._run_cephadm_json(host, '', 'pull', [], image=image_name, no_fsid=True)
+        pullargs: List[str] = []
+        if self.mgr.registry_insecure:
+            pullargs.append("--insecure")
+
+        j = self._run_cephadm_json(host, '', 'pull', pullargs, image=image_name, no_fsid=True)
 
         r = ContainerInspectInfo(
             j['image_id'],
index 7a7d6b4073a5e99ea587955189c12ebbfac018b7..65dd7b0f7027b9d6c59c0ebbadaea0290e249b77 100644 (file)
@@ -10,6 +10,7 @@ from mgr_module import HandleCommandResult, MonCommandFailed
 
 from ceph.deployment.service_spec import ServiceSpec, RGWSpec
 from ceph.deployment.utils import is_ipv6, unwrap_ipv6
+from mgr_util import build_url
 from orchestrator import OrchestratorError, DaemonDescription, DaemonDescriptionStatus
 from orchestrator._interface import daemon_type_to_service
 from cephadm import utils
@@ -401,7 +402,7 @@ class CephadmService(metaclass=ABCMeta):
         assert self.TYPE == daemon_type_to_service(daemon.daemon_type)
         logger.debug(f'Pre remove daemon {self.TYPE}.{daemon.daemon_id}')
 
-    def post_remove(self, daemon: DaemonDescription) -> None:
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
         """
         Called after the daemon is removed.
         """
@@ -429,8 +430,8 @@ class CephService(CephadmService):
 
         return cephadm_config, []
 
-    def post_remove(self, daemon: DaemonDescription) -> None:
-        super().post_remove(daemon)
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
+        super().post_remove(daemon, is_failed_deploy=is_failed_deploy)
         self.remove_keyring(daemon)
 
     def get_auth_entity(self, daemon_id: str, host: str = "") -> AuthEntity:
@@ -483,9 +484,7 @@ class CephService(CephadmService):
         daemon_id: str = daemon.daemon_id
         host: str = daemon.hostname
 
-        if daemon_id == 'mon':
-            # do not remove the mon keyring
-            return
+        assert daemon.daemon_type != 'mon'
 
         entity = self.get_auth_entity(daemon_id, host=host)
 
@@ -586,6 +585,11 @@ class MonService(CephService):
             'name': daemon_id,
         })
 
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
+        # Do not remove the mon keyring.
+        # super().post_remove(daemon)
+        pass
+
 
 class MgrService(CephService):
     TYPE = 'mgr'
@@ -818,25 +822,27 @@ class RgwService(CephService):
         if ftype == 'beast':
             if spec.ssl:
                 if daemon_spec.ip:
-                    args.append(f"ssl_endpoint={daemon_spec.ip}:{port}")
+                    args.append(
+                        f"ssl_endpoint={build_url(host=daemon_spec.ip, port=port).lstrip('/')}")
                 else:
                     args.append(f"ssl_port={port}")
                 args.append(f"ssl_certificate=config://rgw/cert/{spec.service_name()}")
             else:
                 if daemon_spec.ip:
-                    args.append(f"endpoint={daemon_spec.ip}:{port}")
+                    args.append(f"endpoint={build_url(host=daemon_spec.ip, port=port).lstrip('/')}")
                 else:
                     args.append(f"port={port}")
         elif ftype == 'civetweb':
             if spec.ssl:
                 if daemon_spec.ip:
-                    args.append(f"port={daemon_spec.ip}:{port}s")  # note the 's' suffix on port
+                    # note the 's' suffix on port
+                    args.append(f"port={build_url(host=daemon_spec.ip, port=port).lstrip('/')}s")
                 else:
                     args.append(f"port={port}s")  # note the 's' suffix on port
                 args.append(f"ssl_certificate=config://rgw/cert/{spec.service_name()}")
             else:
                 if daemon_spec.ip:
-                    args.append(f"port={daemon_spec.ip}:{port}")
+                    args.append(f"port={build_url(host=daemon_spec.ip, port=port).lstrip('/')}")
                 else:
                     args.append(f"port={port}")
         frontend = f'{ftype} {" ".join(args)}'
@@ -877,8 +883,8 @@ class RgwService(CephService):
         })
         self.mgr.trigger_connect_dashboard_rgw()
 
-    def post_remove(self, daemon: DaemonDescription) -> None:
-        super().post_remove(daemon)
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
+        super().post_remove(daemon, is_failed_deploy=is_failed_deploy)
         self.mgr.check_mon_command({
             'prefix': 'config rm',
             'who': utils.name_to_config_section(daemon.name()),
index 6f4429e23f9d0be99c4501857a13611da3ba0403..4bc9f903e252358131b0805303dafb367f71d347 100644 (file)
@@ -193,7 +193,7 @@ class IngressService(CephService):
         deps = sorted([d.name() for d in daemons if d.daemon_type == 'haproxy'])
 
         host = daemon_spec.host
-        hosts = sorted(list(set([str(d.hostname) for d in daemons])))
+        hosts = sorted(list(set([host] + [str(d.hostname) for d in daemons])))
 
         # interface
         bare_ip = str(spec.virtual_ip).split('/')[0]
index 3eecb07e943977e1854b0c68f320724357d2933a..fa54fa053a4f54b16f28f5cfb8d10731cb2e637a 100644 (file)
@@ -58,17 +58,23 @@ class IscsiService(CephService):
                 'val': key_data,
             })
 
+        # add active mgr ip address to trusted list so dashboard can access
+        trusted_ip_list = spec.trusted_ip_list if spec.trusted_ip_list else ''
+        if trusted_ip_list:
+            trusted_ip_list += ','
+        trusted_ip_list += self.mgr.get_mgr_ip()
+
         context = {
             'client_name': '{}.{}'.format(utils.name_to_config_section('iscsi'), igw_id),
+            'trusted_ip_list': trusted_ip_list,
             'spec': spec
         }
         igw_conf = self.mgr.template.render('services/iscsi/iscsi-gateway.cfg.j2', context)
 
         daemon_spec.keyring = keyring
         daemon_spec.extra_files = {'iscsi-gateway.cfg': igw_conf}
-
         daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
-
+        daemon_spec.deps = [self.mgr.get_mgr_ip()]
         return daemon_spec
 
     def config_dashboard(self, daemon_descrs: List[DaemonDescription]) -> None:
@@ -144,7 +150,7 @@ class IscsiService(CephService):
         warn_message = f'It is presumed safe to stop {names}'
         return HandleCommandResult(0, warn_message, '')
 
-    def post_remove(self, daemon: DaemonDescription) -> None:
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
         """
         Called after the daemon is removed.
         """
index d86c5a8803a6dd33553bdea3d79663aa23776f35..3ec2a66789e391421ad1f0dbb792f13003a24f6d 100644 (file)
@@ -2,6 +2,7 @@ import errno
 import logging
 import os
 from typing import List, Any, Tuple, Dict, Optional, cast
+from urllib.parse import urlparse
 
 from mgr_module import HandleCommandResult
 
@@ -32,7 +33,8 @@ class GrafanaService(CephadmService):
             assert dd.hostname is not None
             addr = dd.ip if dd.ip else self._inventory_get_addr(dd.hostname)
             port = dd.ports[0] if dd.ports else 9095
-            prom_services.append(addr + ':' + str(port))
+            prom_services.append(build_url(scheme='http', host=addr, port=port))
+
             deps.append(dd.name())
         grafana_data_sources = self.mgr.template.render(
             'services/grafana/ceph-dashboard.yml.j2', {'hosts': prom_services})
@@ -130,8 +132,9 @@ class AlertmanagerService(CephadmService):
         url = mgr_map.get('services', {}).get('dashboard', None)
         if url:
             dashboard_urls.append(url)
-            proto = url.split('/')[0]
-            port = url.split('/')[2].split(':')[1]
+            p_result = urlparse(url)
+            proto = p_result.scheme
+            port = p_result.port
         # scan all mgrs to generate deps and to get standbys too.
         # assume that they are all on the same port as the active mgr.
         for dd in self.mgr.cache.get_daemons_by_service('mgr'):
@@ -144,8 +147,7 @@ class AlertmanagerService(CephadmService):
                 continue
             assert dd.hostname is not None
             addr = self.mgr.inventory.get_addr(dd.hostname)
-            dashboard_urls.append('%s//%s:%s/' % (proto, addr.split(':')[0],
-                                                  port))
+            dashboard_urls.append(build_url(scheme=proto, host=addr, port=port))
 
         context = {
             'dashboard_urls': dashboard_urls,
@@ -154,12 +156,12 @@ class AlertmanagerService(CephadmService):
         yml = self.mgr.template.render('services/alertmanager/alertmanager.yml.j2', context)
 
         peers = []
-        port = '9094'
+        port = 9094
         for dd in self.mgr.cache.get_daemons_by_service('alertmanager'):
             assert dd.hostname is not None
             deps.append(dd.name())
             addr = self.mgr.inventory.get_addr(dd.hostname)
-            peers.append(addr.split(':')[0] + ':' + port)
+            peers.append(build_url(host=addr, port=port).lstrip('/'))
         return {
             "files": {
                 "alertmanager.yml": yml
@@ -179,7 +181,7 @@ class AlertmanagerService(CephadmService):
         assert dd.hostname is not None
         addr = dd.ip if dd.ip else self._inventory_get_addr(dd.hostname)
         port = dd.ports[0] if dd.ports else self.DEFAULT_SERVICE_PORT
-        service_url = 'http://{}:{}'.format(addr, port)
+        service_url = build_url(scheme='http', host=addr, port=port)
         self._set_service_url_on_dashboard(
             'AlertManager',
             'dashboard get-alertmanager-api-host',
@@ -233,11 +235,10 @@ class PrometheusService(CephadmService):
         port = None
         t = mgr_map.get('services', {}).get('prometheus', None)
         if t:
+            p_result = urlparse(t)
             t = t.split('/')[2]
             mgr_scrape_list.append(t)
-            port = '9283'
-            if ':' in t:
-                port = t.split(':')[1]
+            port = p_result.port or 9283
         # scan all mgrs to generate deps and to get standbys too.
         # assume that they are all on the same port as the active mgr.
         for dd in self.mgr.cache.get_daemons_by_service('mgr'):
@@ -250,7 +251,7 @@ class PrometheusService(CephadmService):
                 continue
             assert dd.hostname is not None
             addr = self.mgr.inventory.get_addr(dd.hostname)
-            mgr_scrape_list.append(addr.split(':')[0] + ':' + port)
+            mgr_scrape_list.append(build_url(host=addr, port=port).lstrip('/'))
 
         # scrape node exporters
         nodes = []
@@ -258,10 +259,10 @@ class PrometheusService(CephadmService):
             assert dd.hostname is not None
             deps.append(dd.name())
             addr = dd.ip if dd.ip else self.mgr.inventory.get_addr(dd.hostname)
-            port = str(dd.ports[0]) if dd.ports else '9100'
+            port = dd.ports[0] if dd.ports else 9100
             nodes.append({
                 'hostname': dd.hostname,
-                'url': addr.split(':')[0] + ':' + port
+                'url': build_url(host=addr, port=port).lstrip('/')
             })
 
         # scrape alert managers
@@ -270,8 +271,8 @@ class PrometheusService(CephadmService):
             assert dd.hostname is not None
             deps.append(dd.name())
             addr = dd.ip if dd.ip else self.mgr.inventory.get_addr(dd.hostname)
-            port = str(dd.ports[0]) if dd.ports else '9093'
-            alertmgr_targets.append("'{}:{}'".format(addr.split(':')[0], port))
+            port = dd.ports[0] if dd.ports else 9093
+            alertmgr_targets.append("'{}'".format(build_url(host=addr, port=port).lstrip('/')))
 
         # scrape haproxies
         haproxy_targets = []
@@ -283,7 +284,7 @@ class PrometheusService(CephadmService):
                 if dd.daemon_type == 'haproxy':
                     addr = self.mgr.inventory.get_addr(dd.hostname)
                     haproxy_targets.append({
-                        "url": f"'{addr.split(':')[0]}:{spec.monitor_port}'",
+                        "url": f"'{build_url(host=addr, port=spec.monitor_port).lstrip('/')}'",
                         "service": dd.service_name(),
                     })
 
@@ -322,7 +323,7 @@ class PrometheusService(CephadmService):
         assert dd.hostname is not None
         addr = dd.ip if dd.ip else self._inventory_get_addr(dd.hostname)
         port = dd.ports[0] if dd.ports else self.DEFAULT_SERVICE_PORT
-        service_url = 'http://{}:{}'.format(addr, port)
+        service_url = build_url(scheme='http', host=addr, port=port)
         self._set_service_url_on_dashboard(
             'Prometheus',
             'dashboard get-prometheus-api-host',
index bacfc7d202887bdae4a2c193e8a800ba9cd53dd0..ee53283bd9c185aa135a3d06efdde6ba62316346 100644 (file)
@@ -6,6 +6,7 @@ import tempfile
 from typing import Dict, Tuple, Any, List, cast, Optional
 
 from mgr_module import HandleCommandResult
+from mgr_module import NFS_POOL_NAME as POOL_NAME
 
 from ceph.deployment.service_spec import ServiceSpec, NFSServiceSpec
 
@@ -58,8 +59,7 @@ class NFSService(CephService):
         from nfs.cluster import create_ganesha_pool
 
         assert self.TYPE == spec.service_type
-        assert spec.pool
-        create_ganesha_pool(self.mgr, spec.pool)
+        create_ganesha_pool(self.mgr)
 
     def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonDeploySpec:
         assert self.TYPE == daemon_spec.daemon_type
@@ -98,10 +98,10 @@ class NFSService(CephService):
             context = {
                 "user": rados_user,
                 "nodeid": nodeid,
-                "pool": spec.pool,
-                "namespace": spec.namespace if spec.namespace else '',
+                "pool": POOL_NAME,
+                "namespace": spec.service_id,
                 "rgw_user": rgw_user,
-                "url": spec.rados_config_location(),
+                "url": f'rados://{POOL_NAME}/{spec.service_id}/{spec.rados_config_name()}',
                 # fall back to default NFS port if not present in daemon_spec
                 "port": daemon_spec.ports[0] if daemon_spec.ports else 2049,
                 "bind_addr": daemon_spec.ip if daemon_spec.ip else '',
@@ -111,9 +111,8 @@ class NFSService(CephService):
         # generate the cephadm config json
         def get_cephadm_config() -> Dict[str, Any]:
             config: Dict[str, Any] = {}
-            config['pool'] = spec.pool
-            if spec.namespace:
-                config['namespace'] = spec.namespace
+            config['pool'] = POOL_NAME
+            config['namespace'] = spec.service_id
             config['userid'] = rados_user
             config['extra_args'] = ['-N', 'NIV_EVENT']
             config['files'] = {
@@ -144,10 +143,9 @@ class NFSService(CephService):
             'rados',
             '-n', f"mgr.{self.mgr.get_mgr_id()}",
             '-k', str(self.mgr.get_ceph_option('keyring')),
-            '-p', cast(str, spec.pool),
+            '-p', POOL_NAME,
+            '--namespace', cast(str, spec.service_id),
         ]
-        if spec.namespace:
-            cmd += ['--namespace', spec.namespace]
         result = subprocess.run(
             cmd + ['get', objname, '-'],
             stdout=subprocess.PIPE, stderr=subprocess.PIPE,
@@ -171,9 +169,7 @@ class NFSService(CephService):
         spec = cast(NFSServiceSpec, self.mgr.spec_store[daemon_spec.service_name].spec)
         entity: AuthEntity = self.get_auth_entity(daemon_id)
 
-        osd_caps = 'allow rw pool=%s' % (spec.pool)
-        if spec.namespace:
-            osd_caps = '%s namespace=%s' % (osd_caps, spec.namespace)
+        osd_caps = 'allow rw pool=%s namespace=%s' % (POOL_NAME, spec.service_id)
 
         logger.info('Creating key for %s' % entity)
         keyring = self.get_keyring_with_caps(entity,
@@ -205,7 +201,7 @@ class NFSService(CephService):
         entity = AuthEntity(f'client.{tmp_id}')
         keyring = self.get_keyring_with_caps(
             entity,
-            ['mon', 'allow r', 'osd', f'allow rwx pool {spec.pool}']
+            ['mon', 'allow r', 'osd', f'allow rwx pool {POOL_NAME}']
         )
         tmp_keyring = tempfile.NamedTemporaryFile(mode='w', prefix='mgr-grace-keyring')
         os.fchmod(tmp_keyring.fileno(), 0o600)
@@ -220,11 +216,10 @@ class NFSService(CephService):
                 'ganesha-rados-grace',
                 '--cephconf', tmp_conf.name,
                 '--userid', tmp_id,
-                '--pool', cast(str, spec.pool),
+                '--pool', POOL_NAME,
+                '--ns', cast(str, spec.service_id),
+                action, nodeid,
             ]
-            if spec.namespace:
-                cmd += ['--ns', spec.namespace]
-            cmd += [action, nodeid]
             self.mgr.log.debug(cmd)
             result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                     timeout=10)
@@ -251,8 +246,8 @@ class NFSService(CephService):
             'entity': entity,
         })
 
-    def post_remove(self, daemon: DaemonDescription) -> None:
-        super().post_remove(daemon)
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
+        super().post_remove(daemon, is_failed_deploy=is_failed_deploy)
         self.remove_rgw_keyring(daemon)
 
     def ok_to_stop(self,
@@ -283,11 +278,10 @@ class NFSService(CephService):
             'rados',
             '-n', f"mgr.{self.mgr.get_mgr_id()}",
             '-k', str(self.mgr.get_ceph_option('keyring')),
-            '-p', cast(str, spec.pool),
+            '-p', POOL_NAME,
+            '--namespace', cast(str, spec.service_id),
+            'rm', 'grace',
         ]
-        if spec.namespace:
-            cmd += ['--namespace', spec.namespace]
-        cmd += ['rm', 'grace']
         subprocess.run(
             cmd,
             stdout=subprocess.PIPE,
index 3c30a413980210f4077ad35d47622fb2322b0f87..5e7e26fc15c543ffee5500febbe6f688da93089d 100644 (file)
@@ -14,7 +14,7 @@ import orchestrator
 from cephadm.serve import CephadmServe
 from cephadm.utils import forall_hosts
 from ceph.utils import datetime_now
-from orchestrator import OrchestratorError
+from orchestrator import OrchestratorError, DaemonDescription
 from mgr_module import MonCommandFailed
 
 from cephadm.services.cephadmservice import CephadmDaemonDeploySpec, CephService
@@ -204,12 +204,14 @@ class OSDService(CephService):
         [
           {'data': {<metadata>},
            'osdspec': <name of osdspec>,
-           'host': <name of host>
+           'host': <name of host>,
+           'notes': <notes>
            },
 
            {'data': ...,
             'osdspec': ..,
-            'host': ..
+            'host': ...,
+            'notes': ...
            }
         ]
 
@@ -246,10 +248,16 @@ class OSDService(CephService):
                     except ValueError:
                         logger.exception('Cannot decode JSON: \'%s\'' % ' '.join(out))
                         concat_out = {}
-
+                    notes = []
+                    if osdspec.data_devices is not None and osdspec.data_devices.limit and len(concat_out) < osdspec.data_devices.limit:
+                        found = len(concat_out)
+                        limit = osdspec.data_devices.limit
+                        notes.append(
+                            f'NOTE: Did not find enough disks matching filter on host {host} to reach data device limit (Found: {found} | Limit: {limit})')
                     ret_all.append({'data': concat_out,
                                     'osdspec': osdspec.service_id,
-                                    'host': host})
+                                    'host': host,
+                                    'notes': notes})
         return ret_all
 
     def resolve_hosts_for_osdspecs(self,
@@ -306,6 +314,13 @@ class OSDService(CephService):
     def get_osdspec_affinity(self, osd_id: str) -> str:
         return self.mgr.get('osd_metadata').get(osd_id, {}).get('osdspec_affinity', '')
 
+    def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None:
+        # Do not remove the osd.N keyring, if we failed to deploy the OSD, because
+        # we cannot recover from it. The OSD keys are created by ceph-volume and not by
+        # us.
+        if not is_failed_deploy:
+            super().post_remove(daemon, is_failed_deploy=is_failed_deploy)
+
 
 class OsdIdClaims(object):
     """
@@ -397,7 +412,7 @@ class RemoveUtil(object):
         while not self.ok_to_stop(osds):
             if len(osds) <= 1:
                 # can't even stop one OSD, aborting
-                self.mgr.log.info(
+                self.mgr.log.debug(
                     "Can't even stop one OSD. Cluster is probably busy. Retrying later..")
                 return []
 
@@ -417,7 +432,7 @@ class RemoveUtil(object):
             'prefix': "osd ok-to-stop",
             'ids': [str(osd.osd_id) for osd in osds]
         }
-        return self._run_mon_cmd(cmd_args)
+        return self._run_mon_cmd(cmd_args, error_ok=True)
 
     def set_osd_flag(self, osds: List["OSD"], flag: str) -> bool:
         base_cmd = f"osd {flag}"
@@ -460,11 +475,24 @@ class RemoveUtil(object):
         self.mgr.log.info(f"{osd} weight is now {weight}")
         return True
 
+    def zap_osd(self, osd: "OSD") -> str:
+        "Zaps all devices that are associated with an OSD"
+        if osd.hostname is not None:
+            out, err, code = CephadmServe(self.mgr)._run_cephadm(
+                osd.hostname, 'osd', 'ceph-volume',
+                ['--', 'lvm', 'zap', '--destroy', '--osd-id', str(osd.osd_id)],
+                error_ok=True)
+            self.mgr.cache.invalidate_host_devices(osd.hostname)
+            if code:
+                raise OrchestratorError('Zap failed: %s' % '\n'.join(out + err))
+            return '\n'.join(out + err)
+        raise OrchestratorError(f"Failed to zap OSD {osd.osd_id} because host was unknown")
+
     def safe_to_destroy(self, osd_ids: List[int]) -> bool:
         """ Queries the safe-to-destroy flag for OSDs """
         cmd_args = {'prefix': 'osd safe-to-destroy',
                     'ids': [str(x) for x in osd_ids]}
-        return self._run_mon_cmd(cmd_args)
+        return self._run_mon_cmd(cmd_args, error_ok=True)
 
     def destroy_osd(self, osd_id: int) -> bool:
         """ Destroys an OSD (forcefully) """
@@ -482,14 +510,15 @@ class RemoveUtil(object):
         }
         return self._run_mon_cmd(cmd_args)
 
-    def _run_mon_cmd(self, cmd_args: dict) -> bool:
+    def _run_mon_cmd(self, cmd_args: dict, error_ok: bool = False) -> bool:
         """
         Generic command to run mon_command and evaluate/log the results
         """
         ret, out, err = self.mgr.mon_command(cmd_args)
         if ret != 0:
             self.mgr.log.debug(f"ran {cmd_args} with mon_command")
-            self.mgr.log.error(f"cmd: {cmd_args.get('prefix')} failed with: {err}. (errno:{ret})")
+            if not error_ok:
+                self.mgr.log.error(f"cmd: {cmd_args.get('prefix')} failed with: {err}. (errno:{ret})")
             return False
         self.mgr.log.debug(f"cmd: {cmd_args.get('prefix')} returns: {out}")
         return True
@@ -514,7 +543,7 @@ class OSD:
                  replace: bool = False,
                  force: bool = False,
                  hostname: Optional[str] = None,
-                 ):
+                 zap: bool = False):
         # the ID of the OSD
         self.osd_id = osd_id
 
@@ -551,6 +580,9 @@ class OSD:
 
         self.original_weight: Optional[float] = None
 
+        # Whether devices associated with the OSD should be zapped (DATA ERASED)
+        self.zap = zap
+
     def start(self) -> None:
         if self.started:
             logger.debug(f"Already started draining {self}")
@@ -621,6 +653,9 @@ class OSD:
     def destroy(self) -> bool:
         return self.rm_util.destroy_osd(self.osd_id)
 
+    def do_zap(self) -> str:
+        return self.rm_util.zap_osd(self)
+
     def purge(self) -> bool:
         return self.rm_util.purge_osd(self.osd_id)
 
@@ -649,6 +684,7 @@ class OSD:
         out['stopped'] = self.stopped
         out['replace'] = self.replace
         out['force'] = self.force
+        out['zap'] = self.zap
         out['hostname'] = self.hostname  # type: ignore
 
         for k in ['drain_started_at', 'drain_stopped_at', 'drain_done_at', 'process_started_at']:
@@ -706,10 +742,10 @@ class OSDRemovalQueue(object):
         self.cleanup()
 
         # find osds that are ok-to-stop and not yet draining
-        ok_to_stop_osds = self.rm_util.find_osd_stop_threshold(self.idling_osds())
-        if ok_to_stop_osds:
+        ready_to_drain_osds = self._ready_to_drain_osds()
+        if ready_to_drain_osds:
             # start draining those
-            _ = [osd.start_draining() for osd in ok_to_stop_osds]
+            _ = [osd.start_draining() for osd in ready_to_drain_osds]
 
         all_osds = self.all_osds()
 
@@ -741,8 +777,12 @@ class OSDRemovalQueue(object):
 
             # stop and remove daemon
             assert osd.hostname is not None
-            CephadmServe(self.mgr)._remove_daemon(f'osd.{osd.osd_id}', osd.hostname)
-            logger.info(f"Successfully removed {osd} on {osd.hostname}")
+
+            if self.mgr.cache.has_daemon(f'osd.{osd.osd_id}'):
+                CephadmServe(self.mgr)._remove_daemon(f'osd.{osd.osd_id}', osd.hostname)
+                logger.info(f"Successfully removed {osd} on {osd.hostname}")
+            else:
+                logger.info(f"Daemon {osd} on {osd.hostname} was already removed")
 
             if osd.replace:
                 # mark destroyed in osdmap
@@ -757,6 +797,12 @@ class OSDRemovalQueue(object):
                     raise orchestrator.OrchestratorError(f"Could not purge {osd}")
                 logger.info(f"Successfully purged {osd} on {osd.hostname}")
 
+            if osd.zap:
+                # throws an exception if the zap fails
+                logger.info(f"Zapping devices for {osd} on {osd.hostname}")
+                osd.do_zap()
+                logger.info(f"Successfully zapped devices for {osd} on {osd.hostname}")
+
             logger.debug(f"Removing {osd} from the queue.")
 
         # self could change while this is processing (osds get added from the CLI)
@@ -772,6 +818,18 @@ class OSDRemovalQueue(object):
             for osd in self._not_in_cluster():
                 self.osds.remove(osd)
 
+    def _ready_to_drain_osds(self) -> List["OSD"]:
+        """
+        Returns OSDs that are ok to stop and not yet draining. Only returns as many OSDs as can
+        be accomodated by the 'max_osd_draining_count' config value, considering the number of OSDs
+        that are already draining.
+        """
+        draining_limit = max(1, self.mgr.max_osd_draining_count)
+        num_already_draining = len(self.draining_osds())
+        num_to_start_draining = max(0, draining_limit - num_already_draining)
+        stoppable_osds = self.rm_util.find_osd_stop_threshold(self.idling_osds())
+        return [] if stoppable_osds is None else stoppable_osds[:num_to_start_draining]
+
     def _save_to_store(self) -> None:
         osd_queue = [osd.to_json() for osd in self.osds]
         logger.debug(f"Saving {osd_queue} to store")
index 03c1479721b82b64327c8b409ed6ed7827638a24..6ce27cdf728bebc0f3a9c2f2fcc7e8caaa40bea3 100644 (file)
@@ -22,5 +22,5 @@ receivers:
 - name: 'ceph-dashboard'
   webhook_configs:
 {% for url in dashboard_urls %}
-  - url: '{{ url }}api/prometheus_receiver'
+  - url: '{{ url }}/api/prometheus_receiver'
 {% endfor %}
index 8946cac0a09895c919636bd57179d0644c55cbca..170e6f246f6df6f40b37c705c2c1541913b5ef11 100644 (file)
@@ -1,17 +1,17 @@
 # {{ cephadm_managed }}
 deleteDatasources:
-{% for host in hosts %} 
+{% for host in hosts %}
   - name: 'Dashboard{{ loop.index }}'
     orgId: 1
 {% endfor %}
 
 datasources:
-{% for host in hosts %} 
+{% for host in hosts %}
   - name: 'Dashboard{{ loop.index }}'
     type: 'prometheus'
     access: 'proxy'
     orgId: 1
-    url: 'http://{{ host }}'
+    url: '{{ host }}'
     basicAuth: false
     isDefault: {{ 'true' if loop.first else 'false' }}
     editable: false
index 2bc13451d65d8a1f6abad4bbdc73de802cd13b3f..c2582ace7af350d8c9bb67e8dd74fa25be45c61d 100644 (file)
@@ -2,7 +2,7 @@
 [config]
 cluster_client_name = {{ client_name }}
 pool = {{ spec.pool }}
-trusted_ip_list = {{ spec.trusted_ip_list|default("''", true) }}
+trusted_ip_list = {{ trusted_ip_list|default("''", true) }}
 minimum_gateways = 1
 api_port = {{ spec.api_port|default("''", true) }}
 api_user = {{ spec.api_user|default("''", true) }}
index 6fb47945427f7b07144a7a7e285287c06d22c41c..9d6e15f1c4f7111036384e269898f16501069732 100644 (file)
@@ -9,14 +9,6 @@ NFS_CORE_PARAM {
 {% endif %}
 }
 
-MDCACHE {
-        Dir_Chunk = 0;
-}
-
-EXPORT_DEFAULTS {
-        Attr_Expiration_Time = 0;
-}
-
 NFSv4 {
         Delegations = false;
         RecoveryBackend = 'rados_cluster';
index 11983737bcacf0fe2d48b15c781c51c4e7e7fb56..6a31395291fa12a036b68b760f9542f84d3e2487 100644 (file)
@@ -56,6 +56,14 @@ def with_cephadm_module(module_options=None, store=None):
                 'modified': datetime_to_str(datetime_now()),
                 'fsid': 'foobar',
             })
+        if '_ceph_get/mgr_map' not in store:
+            m.mock_store_set('_ceph_get', 'mgr_map', {
+                'services': {
+                    'dashboard': 'http://[::1]:8080',
+                    'prometheus': 'http://[::1]:8081'
+                },
+                'modules': ['dashboard', 'prometheus'],
+            })
         for k, v in store.items():
             m._ceph_set_store(k, v)
 
@@ -70,7 +78,7 @@ def wait(m, c):
 
 
 @contextmanager
-def with_host(m: CephadmOrchestrator, name, addr='1.2.3.4', refresh_hosts=True):
+def with_host(m: CephadmOrchestrator, name, addr='1::4', refresh_hosts=True):
     # type: (CephadmOrchestrator, str) -> None
     with mock.patch("cephadm.utils.resolve_ip", return_value=addr):
         wait(m, m.add_host(HostSpec(hostname=name)))
index 6a11c36dc3c1e35420cba564dfd9393cd71e1100..1230a1f48a7bd99dc51c1833c7827b1c8e9d047d 100644 (file)
@@ -3,8 +3,6 @@ from contextlib import contextmanager
 
 import pytest
 
-import yaml
-
 from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection
 from cephadm.serve import CephadmServe
 from cephadm.services.osd import OSD, OSDRemovalQueue, OsdIdClaims
@@ -86,19 +84,19 @@ class TestCephadm(object):
     def test_host(self, cephadm_module):
         assert wait(cephadm_module, cephadm_module.get_hosts()) == []
         with with_host(cephadm_module, 'test'):
-            assert wait(cephadm_module, cephadm_module.get_hosts()) == [HostSpec('test', '1.2.3.4')]
+            assert wait(cephadm_module, cephadm_module.get_hosts()) == [HostSpec('test', '1::4')]
 
             # Be careful with backward compatibility when changing things here:
             assert json.loads(cephadm_module.get_store('inventory')) == \
-                {"test": {"hostname": "test", "addr": "1.2.3.4", "labels": [], "status": ""}}
+                {"test": {"hostname": "test", "addr": "1::4", "labels": [], "status": ""}}
 
             with with_host(cephadm_module, 'second', '1.2.3.5'):
                 assert wait(cephadm_module, cephadm_module.get_hosts()) == [
-                    HostSpec('test', '1.2.3.4'),
+                    HostSpec('test', '1::4'),
                     HostSpec('second', '1.2.3.5')
                 ]
 
-            assert wait(cephadm_module, cephadm_module.get_hosts()) == [HostSpec('test', '1.2.3.4')]
+            assert wait(cephadm_module, cephadm_module.get_hosts()) == [HostSpec('test', '1::4')]
         assert wait(cephadm_module, cephadm_module.get_hosts()) == []
 
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('[]'))
@@ -115,6 +113,7 @@ class TestCephadm(object):
                     out = dd.to_json()
                     del out['daemon_id']
                     del out['events']
+                    del out['daemon_name']
                     return out
 
                 assert [remove_id_events(dd) for dd in wait(cephadm_module, c)] == [
@@ -371,38 +370,6 @@ class TestCephadm(object):
                     + '"keyring": "", "files": {"config": "[mon.test]\\npublic network = 127.0.0.0/8\\n"}}',
                     image='')
 
-    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
-    def test_monitoring_ports(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
-        _run_cephadm.return_value = ('{}', '', 0)
-
-        with with_host(cephadm_module, 'test'):
-
-            yaml_str = """service_type: alertmanager
-service_name: alertmanager
-placement:
-    count: 1
-spec:
-    port: 4200
-"""
-            yaml_file = yaml.safe_load(yaml_str)
-            spec = ServiceSpec.from_json(yaml_file)
-
-            with mock.patch("cephadm.services.monitoring.AlertmanagerService.generate_config", return_value=({}, [])):
-                with with_service(cephadm_module, spec):
-
-                    CephadmServe(cephadm_module)._check_daemons()
-
-                    _run_cephadm.assert_called_with(
-                        'test', 'alertmanager.test', 'deploy', [
-                            '--name', 'alertmanager.test',
-                            '--meta-json', '{"service_name": "alertmanager", "ports": [4200, 9094], "ip": null, "deployed_by": [], "rank": null, "rank_generation": null}',
-                            '--config-json', '-',
-                            '--tcp-ports', '4200 9094',
-                            '--reconfig'
-                        ],
-                        stdin='{}',
-                        image='')
-
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     def test_daemon_check_post(self, cephadm_module: CephadmOrchestrator):
         with with_host(cephadm_module, 'test'):
@@ -421,9 +388,69 @@ spec:
                 with mock.patch("cephadm.module.CephadmOrchestrator.mon_command") as _mon_cmd:
                     CephadmServe(cephadm_module)._check_daemons()
                     _mon_cmd.assert_any_call(
-                        {'prefix': 'dashboard set-grafana-api-url', 'value': 'https://1.2.3.4:3000'},
+                        {'prefix': 'dashboard set-grafana-api-url', 'value': 'https://[1::4]:3000'},
                         None)
 
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
+    @mock.patch("cephadm.module.CephadmOrchestrator.get_mgr_ip", lambda _: '1.2.3.4')
+    def test_iscsi_post_actions_with_missing_daemon_in_cache(self, cephadm_module: CephadmOrchestrator):
+        # https://tracker.ceph.com/issues/52866
+        with with_host(cephadm_module, 'test1'):
+            with with_host(cephadm_module, 'test2'):
+                with with_service(cephadm_module, IscsiServiceSpec(service_id='foobar', pool='pool', placement=PlacementSpec(host_pattern='*')), CephadmOrchestrator.apply_iscsi, 'test'):
+
+                    CephadmServe(cephadm_module)._apply_all_services()
+                    assert len(cephadm_module.cache.get_daemons_by_type('iscsi')) == 2
+
+                    # get a deamons from postaction list (ARRGH sets!!)
+                    tempset = cephadm_module.requires_post_actions.copy()
+                    tempdeamon1 = tempset.pop()
+                    tempdeamon2 = tempset.pop()
+
+                    # make sure post actions has 2 daemons in it
+                    assert len(cephadm_module.requires_post_actions) == 2
+
+                    # replicate a host cache that is not in sync when check_daemons is called
+                    tempdd1 = cephadm_module.cache.get_daemon(tempdeamon1)
+                    tempdd2 = cephadm_module.cache.get_daemon(tempdeamon2)
+                    host = 'test1'
+                    if 'test1' not in tempdeamon1:
+                        host = 'test2'
+                    cephadm_module.cache.rm_daemon(host, tempdeamon1)
+
+                    # Make sure, _check_daemons does a redeploy due to monmap change:
+                    cephadm_module.mock_store_set('_ceph_get', 'mon_map', {
+                        'modified': datetime_to_str(datetime_now()),
+                        'fsid': 'foobar',
+                    })
+                    cephadm_module.notify('mon_map', None)
+                    cephadm_module.mock_store_set('_ceph_get', 'mgr_map', {
+                        'modules': ['dashboard']
+                    })
+
+                    with mock.patch("cephadm.module.IscsiService.config_dashboard") as _cfg_db:
+                        CephadmServe(cephadm_module)._check_daemons()
+                        _cfg_db.assert_called_once_with([tempdd2])
+
+                        # post actions still has the other deamon in it and will run next _check_deamons
+                        assert len(cephadm_module.requires_post_actions) == 1
+
+                        # post actions was missed for a daemon
+                        assert tempdeamon1 in cephadm_module.requires_post_actions
+
+                        # put the daemon back in the cache
+                        cephadm_module.cache.add_daemon(host, tempdd1)
+
+                        _cfg_db.reset_mock()
+                        # replicate serve loop running again
+                        CephadmServe(cephadm_module)._check_daemons()
+
+                        # post actions should have been called again
+                        _cfg_db.asset_called()
+
+                        # post actions is now empty
+                        assert len(cephadm_module.requires_post_actions) == 0
+
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('[]'))
     def test_mon_add(self, cephadm_module):
         with with_host(cephadm_module, 'test'):
@@ -700,6 +727,28 @@ spec:
             out = wait(cephadm_module, c)
             assert out == "Created no osd(s) on host test; already created?"
 
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
+    @mock.patch('cephadm.services.osd.OSDService._run_ceph_volume_command')
+    @mock.patch('cephadm.services.osd.OSDService.driveselection_to_ceph_volume')
+    @mock.patch('cephadm.services.osd.OsdIdClaims.refresh', lambda _: None)
+    @mock.patch('cephadm.services.osd.OsdIdClaims.get', lambda _: {})
+    def test_limit_not_reached(self, d_to_cv, _run_cv_cmd, cephadm_module):
+        with with_host(cephadm_module, 'test'):
+            dg = DriveGroupSpec(placement=PlacementSpec(host_pattern='test'),
+                                data_devices=DeviceSelection(limit=5, rotational=1),
+                                service_id='not_enough')
+
+            disks_found = [
+                '[{"data": "/dev/vdb", "data_size": "50.00 GB", "encryption": "None"}, {"data": "/dev/vdc", "data_size": "50.00 GB", "encryption": "None"}]']
+            d_to_cv.return_value = 'foo'
+            _run_cv_cmd.return_value = (disks_found, '', 0)
+            preview = cephadm_module.osd_service.generate_previews([dg], 'test')
+
+            for osd in preview:
+                assert 'notes' in osd
+                assert osd['notes'] == [
+                    'NOTE: Did not find enough disks matching filter on host test to reach data device limit (Found: 2 | Limit: 5)']
+
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     def test_prepare_drivegroup(self, cephadm_module):
         with with_host(cephadm_module, 'test'):
@@ -840,23 +889,98 @@ spec:
                 with with_daemon(cephadm_module, spec, 'test'):
                     pass
 
+    @pytest.mark.parametrize(
+        "entity,success,spec",
+        [
+            ('mgr.x', True, ServiceSpec(
+                service_type='mgr',
+                placement=PlacementSpec(hosts=[HostPlacementSpec('test', '', 'x')], count=1),
+                unmanaged=True)
+            ),  # noqa: E124
+            ('client.rgw.x', True, ServiceSpec(
+                service_type='rgw',
+                service_id='id',
+                placement=PlacementSpec(hosts=[HostPlacementSpec('test', '', 'x')], count=1),
+                unmanaged=True)
+            ),  # noqa: E124
+            ('client.nfs.x', True, ServiceSpec(
+                service_type='nfs',
+                service_id='id',
+                placement=PlacementSpec(hosts=[HostPlacementSpec('test', '', 'x')], count=1),
+                unmanaged=True)
+            ),  # noqa: E124
+            ('mon.', False, ServiceSpec(
+                service_type='mon',
+                placement=PlacementSpec(
+                    hosts=[HostPlacementSpec('test', '127.0.0.0/24', 'x')], count=1),
+                unmanaged=True)
+            ),  # noqa: E124
+        ]
+    )
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
-    def test_daemon_add_fail(self, _run_cephadm, cephadm_module):
+    @mock.patch("cephadm.services.nfs.NFSService.run_grace_tool", mock.MagicMock())
+    @mock.patch("cephadm.services.nfs.NFSService.purge", mock.MagicMock())
+    @mock.patch("cephadm.services.nfs.NFSService.create_rados_config_obj", mock.MagicMock())
+    def test_daemon_add_fail(self, _run_cephadm, entity, success, spec, cephadm_module):
         _run_cephadm.return_value = '{}', '', 0
         with with_host(cephadm_module, 'test'):
-            spec = ServiceSpec(
-                service_type='mgr',
-                placement=PlacementSpec(hosts=[HostPlacementSpec('test', '', 'x')], count=1),
-                unmanaged=True
-            )
             with with_service(cephadm_module, spec):
                 _run_cephadm.side_effect = OrchestratorError('fail')
                 with pytest.raises(OrchestratorError):
                     wait(cephadm_module, cephadm_module.add_daemon(spec))
-                cephadm_module.assert_issued_mon_command({
-                    'prefix': 'auth rm',
-                    'entity': 'mgr.x',
-                })
+                if success:
+                    cephadm_module.assert_issued_mon_command({
+                        'prefix': 'auth rm',
+                        'entity': entity,
+                    })
+                else:
+                    with pytest.raises(AssertionError):
+                        cephadm_module.assert_issued_mon_command({
+                            'prefix': 'auth rm',
+                            'entity': entity,
+                        })
+
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_daemon_place_fail_health_warning(self, _run_cephadm, cephadm_module):
+        _run_cephadm.return_value = ('{}', '', 0)
+        with with_host(cephadm_module, 'test'):
+            _run_cephadm.side_effect = OrchestratorError('fail')
+            ps = PlacementSpec(hosts=['test:0.0.0.0=a'], count=1)
+            r = CephadmServe(cephadm_module)._apply_service(ServiceSpec('mgr', placement=ps))
+            assert not r
+            assert cephadm_module.health_checks.get('CEPHADM_DAEMON_PLACE_FAIL') is not None
+            assert cephadm_module.health_checks['CEPHADM_DAEMON_PLACE_FAIL']['count'] == 1
+            assert 'Failed to place 1 daemon(s)' in cephadm_module.health_checks['CEPHADM_DAEMON_PLACE_FAIL']['summary']
+            assert 'Failed while placing mgr.a on test: fail' in cephadm_module.health_checks['CEPHADM_DAEMON_PLACE_FAIL']['detail']
+
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_apply_spec_fail_health_warning(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+        with with_host(cephadm_module, 'test'):
+            CephadmServe(cephadm_module)._apply_all_services()
+            ps = PlacementSpec(hosts=['fail'], count=1)
+            r = CephadmServe(cephadm_module)._apply_service(ServiceSpec('mgr', placement=ps))
+            assert not r
+            assert cephadm_module.apply_spec_fails
+            assert cephadm_module.health_checks.get('CEPHADM_APPLY_SPEC_FAIL') is not None
+            assert cephadm_module.health_checks['CEPHADM_APPLY_SPEC_FAIL']['count'] == 1
+            assert 'Failed to apply 1 service(s)' in cephadm_module.health_checks['CEPHADM_APPLY_SPEC_FAIL']['summary']
+
+    @mock.patch("cephadm.module.CephadmOrchestrator.get_foreign_ceph_option")
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_invalid_config_option_health_warning(self, _run_cephadm, get_foreign_ceph_option, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+        with with_host(cephadm_module, 'test'):
+            ps = PlacementSpec(hosts=['test:0.0.0.0=a'], count=1)
+            get_foreign_ceph_option.side_effect = KeyError
+            CephadmServe(cephadm_module)._apply_service_config(
+                ServiceSpec('mgr', placement=ps, config={'test': 'foo'}))
+            assert cephadm_module.health_checks.get('CEPHADM_INVALID_CONFIG_OPTION') is not None
+            assert cephadm_module.health_checks['CEPHADM_INVALID_CONFIG_OPTION']['count'] == 1
+            assert 'Ignoring 1 invalid config option(s)' in cephadm_module.health_checks[
+                'CEPHADM_INVALID_CONFIG_OPTION']['summary']
+            assert 'Ignoring invalid mgr config option test' in cephadm_module.health_checks[
+                'CEPHADM_INVALID_CONFIG_OPTION']['detail']
 
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     @mock.patch("cephadm.services.nfs.NFSService.run_grace_tool", mock.MagicMock())
@@ -867,8 +991,6 @@ spec:
             ps = PlacementSpec(hosts=['test'], count=1)
             spec = NFSServiceSpec(
                 service_id='name',
-                pool='pool',
-                namespace='namespace',
                 placement=ps)
             unmanaged_spec = ServiceSpec.from_json(spec.to_json())
             unmanaged_spec.unmanaged = True
@@ -882,6 +1004,7 @@ spec:
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     @mock.patch("subprocess.run", None)
     @mock.patch("cephadm.module.CephadmOrchestrator.rados", mock.MagicMock())
+    @mock.patch("cephadm.module.CephadmOrchestrator.get_mgr_ip", lambda _: '1::4')
     def test_iscsi(self, cephadm_module):
         with with_host(cephadm_module, 'test'):
             ps = PlacementSpec(hosts=['test'], count=1)
@@ -985,8 +1108,6 @@ spec:
             ), CephadmOrchestrator.apply_rgw),
             (NFSServiceSpec(
                 service_id='name',
-                pool='pool',
-                namespace='namespace'
             ), CephadmOrchestrator.apply_nfs),
             (IscsiServiceSpec(
                 service_id='name',
@@ -1092,12 +1213,12 @@ spec:
             assert "Host 'test' not found" in err
 
             out = wait(cephadm_module, cephadm_module.get_hosts())[0].to_json()
-            assert out == HostSpec('test', '1.2.3.4', status='Offline').to_json()
+            assert out == HostSpec('test', '1::4', status='Offline').to_json()
 
             _get_connection.side_effect = None
             assert CephadmServe(cephadm_module)._check_host('test') is None
             out = wait(cephadm_module, cephadm_module.get_hosts())[0].to_json()
-            assert out == HostSpec('test', '1.2.3.4').to_json()
+            assert out == HostSpec('test', '1::4').to_json()
 
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
     def test_dont_touch_offline_or_maintenance_host_daemons(self, cephadm_module):
@@ -1134,6 +1255,71 @@ spec:
                             assert len(cephadm_module.cache.get_daemons_by_type('mgr')) == 3
                             assert len(cephadm_module.cache.get_daemons_by_type('crash')) == 1
 
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    @mock.patch("cephadm.CephadmOrchestrator._host_ok_to_stop")
+    @mock.patch("cephadm.module.HostCache.get_daemon_types")
+    @mock.patch("cephadm.module.HostCache.get_hosts")
+    def test_maintenance_enter_success(self, _hosts, _get_daemon_types, _host_ok, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        hostname = 'host1'
+        _run_cephadm.return_value = [''], ['something\nsuccess - systemd target xxx disabled'], 0
+        _host_ok.return_value = 0, 'it is okay'
+        _get_daemon_types.return_value = ['crash']
+        _hosts.return_value = [hostname, 'other_host']
+        cephadm_module.inventory.add_host(HostSpec(hostname))
+        # should not raise an error
+        retval = cephadm_module.enter_host_maintenance(hostname)
+        assert retval.result_str().startswith('Daemons for Ceph cluster')
+        assert not retval.exception_str
+        assert cephadm_module.inventory._inventory[hostname]['status'] == 'maintenance'
+
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    @mock.patch("cephadm.CephadmOrchestrator._host_ok_to_stop")
+    @mock.patch("cephadm.module.HostCache.get_daemon_types")
+    @mock.patch("cephadm.module.HostCache.get_hosts")
+    def test_maintenance_enter_failure(self, _hosts, _get_daemon_types, _host_ok, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        hostname = 'host1'
+        _run_cephadm.return_value = [''], ['something\nfailed - disable the target'], 0
+        _host_ok.return_value = 0, 'it is okay'
+        _get_daemon_types.return_value = ['crash']
+        _hosts.return_value = [hostname, 'other_host']
+        cephadm_module.inventory.add_host(HostSpec(hostname))
+        # should raise an error which will get stored in OrchResult object
+        retval = cephadm_module.enter_host_maintenance(hostname)
+        assert retval.exception_str
+        assert not retval.result_str()
+        assert not cephadm_module.inventory._inventory[hostname]['status']
+
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    @mock.patch("cephadm.module.HostCache.get_daemon_types")
+    @mock.patch("cephadm.module.HostCache.get_hosts")
+    def test_maintenance_exit_success(self, _hosts, _get_daemon_types, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        hostname = 'host1'
+        _run_cephadm.return_value = [''], [
+            'something\nsuccess - systemd target xxx enabled and started'], 0
+        _get_daemon_types.return_value = ['crash']
+        _hosts.return_value = [hostname, 'other_host']
+        cephadm_module.inventory.add_host(HostSpec(hostname, status='maintenance'))
+        # should not raise an error
+        retval = cephadm_module.exit_host_maintenance(hostname)
+        assert retval.result_str().startswith('Ceph cluster')
+        assert not retval.exception_str
+        assert not cephadm_module.inventory._inventory[hostname]['status']
+
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    @mock.patch("cephadm.module.HostCache.get_daemon_types")
+    @mock.patch("cephadm.module.HostCache.get_hosts")
+    def test_maintenance_exit_failure(self, _hosts, _get_daemon_types, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        hostname = 'host1'
+        _run_cephadm.return_value = [''], ['something\nfailed - unable to enable the target'], 0
+        _get_daemon_types.return_value = ['crash']
+        _hosts.return_value = [hostname, 'other_host']
+        cephadm_module.inventory.add_host(HostSpec(hostname, status='maintenance'))
+        # should raise an error which will get stored in OrchResult object
+        retval = cephadm_module.exit_host_maintenance(hostname)
+        assert retval.exception_str
+        assert not retval.result_str()
+        assert cephadm_module.inventory._inventory[hostname]['status'] == 'maintenance'
+
     def test_stale_connections(self, cephadm_module):
         class Connection(object):
             """
@@ -1322,10 +1508,10 @@ Traceback (most recent call last):
 
             assert _run_cephadm.mock_calls == [
                 mock.call('test', 'osd', 'ceph-volume',
-                          ['--', 'inventory', '--format=json', '--filter-for-batch'], image='',
+                          ['--', 'inventory', '--format=json-pretty', '--filter-for-batch'], image='',
                           no_fsid=False),
                 mock.call('test', 'osd', 'ceph-volume',
-                          ['--', 'inventory', '--format=json'], image='',
+                          ['--', 'inventory', '--format=json-pretty'], image='',
                           no_fsid=False),
             ]
 
@@ -1365,6 +1551,46 @@ Traceback (most recent call last):
                           stdin=mock.ANY, image=''),
             ]
 
+    @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_osd_activate_datadevice_fail(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+        with with_host(cephadm_module, 'test', refresh_hosts=False):
+            cephadm_module.mock_store_set('_ceph_get', 'osd_map', {
+                'osds': [
+                    {
+                        'osd': 1,
+                        'up_from': 0,
+                        'uuid': 'uuid'
+                    }
+                ]
+            })
+
+            ceph_volume_lvm_list = {
+                '1': [{
+                    'tags': {
+                        'ceph.cluster_fsid': cephadm_module._cluster_fsid,
+                        'ceph.osd_fsid': 'uuid'
+                    },
+                    'type': 'data'
+                }]
+            }
+            _run_cephadm.reset_mock(return_value=True)
+
+            def _r_c(*args, **kwargs):
+                if 'ceph-volume' in args:
+                    return (json.dumps(ceph_volume_lvm_list), '', 0)
+                else:
+                    assert 'deploy' in args
+                    raise OrchestratorError("let's fail somehow")
+            _run_cephadm.side_effect = _r_c
+            assert cephadm_module._osd_activate(
+                ['test']).stderr == "let's fail somehow"
+            with pytest.raises(AssertionError):
+                cephadm_module.assert_issued_mon_command({
+                    'prefix': 'auth rm',
+                    'entity': 'osd.1',
+                })
+
     @mock.patch("cephadm.serve.CephadmServe._run_cephadm")
     def test_osd_activate_datadevice_dbdevice(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
         _run_cephadm.return_value = ('{}', '', 0)
diff --git a/ceph/src/pybind/mgr/cephadm/tests/test_facts.py b/ceph/src/pybind/mgr/cephadm/tests/test_facts.py
new file mode 100644 (file)
index 0000000..79e6db0
--- /dev/null
@@ -0,0 +1,12 @@
+import pytest
+
+from ..inventory import HostCache
+from ..import CephadmOrchestrator
+
+
+@pytest.fixture()
+def test_facts():
+    facts = {'node-1.ceph.com', {'bios_version': 'F2', 'cpu_cores': 16}}
+    HostCache.facts = facts
+    ret_facts = CephadmOrchestrator.get_facts('node-1.ceph.com')
+    assert ret_facts == [{'bios_version': 'F2', 'cpu_cores': 16}]
index 168e44e749c2789b2c0819c8c3ad59312c97c48c..fa90ae70c08179df10c6c7b5d6235d73ef1499f2 100644 (file)
@@ -48,7 +48,7 @@ def test_migrate_scheduler(cephadm_module: CephadmOrchestrator):
 
             cephadm_module.migration_current = 0
             cephadm_module.migration.migrate()
-            assert cephadm_module.migration_current == 2
+            assert cephadm_module.migration_current >= 2
 
             out = [o.spec.placement for o in wait(
                 cephadm_module, cephadm_module.describe_service())]
@@ -78,7 +78,7 @@ def test_migrate_service_id_mon_one(cephadm_module: CephadmOrchestrator):
 
         cephadm_module.migration_current = 1
         cephadm_module.migration.migrate()
-        assert cephadm_module.migration_current == 2
+        assert cephadm_module.migration_current >= 2
 
         assert len(cephadm_module.spec_store.all_specs) == 1
         assert cephadm_module.spec_store.all_specs['mon'] == ServiceSpec(
@@ -121,7 +121,7 @@ def test_migrate_service_id_mon_two(cephadm_module: CephadmOrchestrator):
 
         cephadm_module.migration_current = 1
         cephadm_module.migration.migrate()
-        assert cephadm_module.migration_current == 2
+        assert cephadm_module.migration_current >= 2
 
         assert len(cephadm_module.spec_store.all_specs) == 1
         assert cephadm_module.spec_store.all_specs['mon'] == ServiceSpec(
@@ -149,3 +149,69 @@ def test_migrate_service_id_mds_one(cephadm_module: CephadmOrchestrator):
 
         # there is nothing to migrate, as the spec is gone now.
         assert len(cephadm_module.spec_store.all_specs) == 0
+
+
+@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('[]'))
+def test_migrate_nfs_initial(cephadm_module: CephadmOrchestrator):
+    with with_host(cephadm_module, 'host1'):
+        cephadm_module.set_store(
+            SPEC_STORE_PREFIX + 'mds',
+            json.dumps({
+                'spec': {
+                    'service_type': 'nfs',
+                    'service_id': 'foo',
+                    'placement': {
+                        'hosts': ['host1']
+                    },
+                    'spec': {
+                        'pool': 'mypool',
+                        'namespace': 'foons',
+                    },
+                },
+                'created': datetime_to_str(datetime_now()),
+            }, sort_keys=True),
+        )
+        cephadm_module.migration_current = 1
+        cephadm_module.spec_store.load()
+
+        ls = json.loads(cephadm_module.get_store('nfs_migration_queue'))
+        assert ls == [['foo', 'mypool', 'foons']]
+
+        cephadm_module.migration.migrate(True)
+        assert cephadm_module.migration_current == 2
+
+        cephadm_module.migration.migrate()
+        assert cephadm_module.migration_current == 3
+
+
+@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('[]'))
+def test_migrate_nfs_initial_octopus(cephadm_module: CephadmOrchestrator):
+    with with_host(cephadm_module, 'host1'):
+        cephadm_module.set_store(
+            SPEC_STORE_PREFIX + 'mds',
+            json.dumps({
+                'spec': {
+                    'service_type': 'nfs',
+                    'service_id': 'ganesha-foo',
+                    'placement': {
+                        'hosts': ['host1']
+                    },
+                    'spec': {
+                        'pool': 'mypool',
+                        'namespace': 'foons',
+                    },
+                },
+                'created': datetime_to_str(datetime_now()),
+            }, sort_keys=True),
+        )
+        cephadm_module.migration_current = 1
+        cephadm_module.spec_store.load()
+
+        ls = json.loads(cephadm_module.get_store('nfs_migration_queue'))
+        assert ls == [['ganesha-foo', 'mypool', 'foons']]
+
+        cephadm_module.migration.migrate(True)
+        assert cephadm_module.migration_current == 2
+
+        cephadm_module.migration.migrate()
+        assert cephadm_module.migration_current == 3
index cffdcaf03fbcbed85095218b8deca730f9476505..6685fcb2a6003d2ee105f0ed9f1b171ed89e3cbb 100644 (file)
@@ -3,6 +3,7 @@ import json
 from cephadm.services.osd import OSDRemovalQueue, OSD
 import pytest
 from tests import mock
+from .fixtures import with_cephadm_module
 from datetime import datetime
 
 
@@ -54,13 +55,42 @@ class TestOSDRemoval:
         # rm_util.process_removal_queue()
         pass
 
+    @pytest.mark.parametrize(
+        "max_osd_draining_count, draining_osds, idling_osds, ok_to_stop, expected",
+        [
+            # drain one at a time, one already draining
+            (1, [1], [1], [True], 0),
+            # drain one at a time, none draining yet
+            (1, [], [1, 2, 3], [True, True, True], 1),
+            # drain one at a time, one already draining, none ok-to-stop
+            (1, [1], [1], [False], 0),
+            # drain one at a time, none draining, one ok-to-stop
+            (1, [], [1, 2, 3], [False, False, True], 1),
+            # drain three at a time, one already draining, all ok-to-stop
+            (3, [1], [1, 2, 3], [True, True, True], 2),
+            # drain two at a time, none already draining, none ok-to-stop
+            (2, [], [1, 2, 3], [False, False, False], 0),
+            # drain two at a time, none already draining, none idling
+            (2, [], [], [], 0),
+        ]
+    )
+    def test_ready_to_drain_osds(self, max_osd_draining_count, draining_osds, idling_osds, ok_to_stop, expected):
+        with with_cephadm_module({'max_osd_draining_count': max_osd_draining_count}) as m:
+            with mock.patch("cephadm.services.osd.OSDRemovalQueue.draining_osds", return_value=draining_osds):
+                with mock.patch("cephadm.services.osd.OSDRemovalQueue.idling_osds", return_value=idling_osds):
+                    with mock.patch("cephadm.services.osd.RemoveUtil.ok_to_stop", side_effect=ok_to_stop):
+                        removal_queue = OSDRemovalQueue(m)
+                        assert len(removal_queue._ready_to_drain_osds()) == expected
+
     def test_ok_to_stop(self, rm_util):
         rm_util.ok_to_stop([MockOSD(1)])
-        rm_util._run_mon_cmd.assert_called_with({'prefix': 'osd ok-to-stop', 'ids': ['1']})
+        rm_util._run_mon_cmd.assert_called_with({'prefix': 'osd ok-to-stop', 'ids': ['1']},
+                                                error_ok=True)
 
     def test_safe_to_destroy(self, rm_util):
         rm_util.safe_to_destroy([1])
-        rm_util._run_mon_cmd.assert_called_with({'prefix': 'osd safe-to-destroy', 'ids': ['1']})
+        rm_util._run_mon_cmd.assert_called_with({'prefix': 'osd safe-to-destroy',
+                                                 'ids': ['1']}, error_ok=True)
 
     def test_destroy_osd(self, rm_util):
         rm_util.destroy_osd(1)
@@ -81,6 +111,7 @@ class TestOSDRemoval:
                 "stopped": False,
                 "replace": False,
                 "force": False,
+                "zap": False,
                 "nodename": "node2",
                 "drain_started_at": "2020-09-14T11:41:53.960463",
                 "drain_stopped_at": None,
index 9a9571409d5a79748fc488261879c0acad33590a..e4f8efa0784362e03ae537c13e1a406e50c48685 100644 (file)
@@ -830,8 +830,7 @@ def test_node_assignment(service_type, placement, hosts, daemons, rank_map, post
         service_id = 'mynfs'
         spec = ServiceSpec(service_type=service_type,
                            service_id=service_id,
-                           placement=placement,
-                           pool='foo')
+                           placement=placement)
 
     if not spec:
         spec = ServiceSpec(service_type=service_type,
index 2c32dffd9738ab8a4e595c80b4fa7f9f62d32496..bccb2dc50b06062ebeb117904d38ede41576caef 100644 (file)
@@ -1,7 +1,12 @@
+from textwrap import dedent
+import json
+import yaml
+
 import pytest
 
 from unittest.mock import MagicMock, call, patch
 
+from cephadm.serve import CephadmServe
 from cephadm.services.cephadmservice import MonService, MgrService, MdsService, RgwService, \
     RbdMirrorService, CrashService, CephadmDaemonDeploySpec
 from cephadm.services.iscsi import IscsiService
@@ -10,7 +15,10 @@ from cephadm.services.osd import OSDService
 from cephadm.services.monitoring import GrafanaService, AlertmanagerService, PrometheusService, \
     NodeExporterService
 from cephadm.services.exporter import CephadmExporter
-from ceph.deployment.service_spec import IscsiServiceSpec
+from cephadm.module import CephadmOrchestrator
+from ceph.deployment.service_spec import IscsiServiceSpec, MonitoringSpec, AlertManagerSpec, \
+    ServiceSpec, RGWSpec
+from cephadm.tests.fixtures import with_host, with_service, _run_cephadm
 
 from orchestrator import OrchestratorError
 from orchestrator._interface import DaemonDescription
@@ -42,6 +50,9 @@ class FakeMgr:
     def get_minimal_ceph_conf(self) -> str:
         return ''
 
+    def get_mgr_ip(self) -> str:
+        return '1.2.3.4'
+
 
 class TestCephadmService:
     def test_set_service_url_on_dashboard(self):
@@ -223,3 +234,229 @@ class TestISCSIService:
                                        'https://user:password@[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:5000')
 
         assert dashboard_expected_call in self.mgr.check_mon_command.mock_calls
+
+
+class TestMonitoring:
+    @patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_alertmanager_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+
+        with with_host(cephadm_module, 'test'):
+            with with_service(cephadm_module, AlertManagerSpec()):
+
+                y = dedent("""
+                # This file is generated by cephadm.
+                # See https://prometheus.io/docs/alerting/configuration/ for documentation.
+
+                global:
+                  resolve_timeout: 5m
+
+                route:
+                  receiver: 'default'
+                  routes:
+                    - group_by: ['alertname']
+                      group_wait: 10s
+                      group_interval: 10s
+                      repeat_interval: 1h
+                      receiver: 'ceph-dashboard'
+
+                receivers:
+                - name: 'default'
+                  webhook_configs:
+                - name: 'ceph-dashboard'
+                  webhook_configs:
+                  - url: 'http://[::1]:8080/api/prometheus_receiver'
+                """).lstrip()
+
+                _run_cephadm.assert_called_with(
+                    'test',
+                    'alertmanager.test',
+                    'deploy',
+                    [
+                        '--name', 'alertmanager.test',
+                        '--meta-json', '{"service_name": "alertmanager", "ports": [9093, 9094], "ip": null, "deployed_by": [], "rank": null, "rank_generation": null}',
+                        '--config-json', '-', '--tcp-ports', '9093 9094'
+                    ],
+                    stdin=json.dumps({"files": {"alertmanager.yml": y}, "peers": []}),
+                    image='')\
+
+
+    @patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_prometheus_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+
+        with with_host(cephadm_module, 'test'):
+            with with_service(cephadm_module, MonitoringSpec('node-exporter')) as _, \
+                    with_service(cephadm_module, MonitoringSpec('prometheus')) as _:
+
+                y = dedent("""
+                # This file is generated by cephadm.
+                global:
+                  scrape_interval: 10s
+                  evaluation_interval: 10s
+                rule_files:
+                  - /etc/prometheus/alerting/*
+                scrape_configs:
+                  - job_name: 'ceph'
+                    honor_labels: true
+                    static_configs:
+                    - targets:
+                      - '[::1]:8081'
+
+                  - job_name: 'node'
+                    static_configs:
+                    - targets: ['[1::4]:9100']
+                      labels:
+                        instance: 'test'
+
+                """).lstrip()
+
+                _run_cephadm.assert_called_with(
+                    'test',
+                    'prometheus.test',
+                    'deploy',
+                    [
+                        '--name', 'prometheus.test',
+                        '--meta-json',
+                        '{"service_name": "prometheus", "ports": [9095], "ip": null, "deployed_by": [], "rank": null, "rank_generation": null}',
+                        '--config-json', '-',
+                        '--tcp-ports', '9095'
+                    ],
+                    stdin=json.dumps({"files": {"prometheus.yml": y}}),
+                    image='')
+
+    @patch("cephadm.serve.CephadmServe._run_cephadm")
+    @patch("cephadm.module.CephadmOrchestrator.get_mgr_ip", lambda _: '1::4')
+    @patch("cephadm.services.monitoring.verify_tls", lambda *_: None)
+    def test_grafana_config(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+
+        with with_host(cephadm_module, 'test'):
+            cephadm_module.set_store('grafana_crt', 'c')
+            cephadm_module.set_store('grafana_key', 'k')
+            with with_service(cephadm_module, MonitoringSpec('prometheus')) as _, \
+                    with_service(cephadm_module, MonitoringSpec('grafana')) as _:
+                files = {
+                    'grafana.ini': dedent("""
+                        # This file is generated by cephadm.
+                        [users]
+                          default_theme = light
+                        [auth.anonymous]
+                          enabled = true
+                          org_name = 'Main Org.'
+                          org_role = 'Viewer'
+                        [server]
+                          domain = 'bootstrap.storage.lab'
+                          protocol = https
+                          cert_file = /etc/grafana/certs/cert_file
+                          cert_key = /etc/grafana/certs/cert_key
+                          http_port = 3000
+                          http_addr = 
+                        [security]
+                          admin_user = admin
+                          admin_password = admin
+                          allow_embedding = true""").lstrip(),  # noqa: W291
+                    'provisioning/datasources/ceph-dashboard.yml': dedent("""
+                        # This file is generated by cephadm.
+                        deleteDatasources:
+                          - name: 'Dashboard1'
+                            orgId: 1
+
+                        datasources:
+                          - name: 'Dashboard1'
+                            type: 'prometheus'
+                            access: 'proxy'
+                            orgId: 1
+                            url: 'http://[1::4]:9095'
+                            basicAuth: false
+                            isDefault: true
+                            editable: false
+                        """).lstrip(),
+                    'certs/cert_file': dedent("""
+                        # generated by cephadm
+                        c""").lstrip(),
+                    'certs/cert_key': dedent("""
+                        # generated by cephadm
+                        k""").lstrip(),
+                }
+
+                _run_cephadm.assert_called_with(
+                    'test',
+                    'grafana.test',
+                    'deploy',
+                    [
+                        '--name', 'grafana.test',
+                        '--meta-json',
+                        '{"service_name": "grafana", "ports": [3000], "ip": null, "deployed_by": [], "rank": null, "rank_generation": null}',
+                        '--config-json', '-', '--tcp-ports', '3000'],
+                    stdin=json.dumps({"files": files}),
+                    image='')
+
+    @patch("cephadm.serve.CephadmServe._run_cephadm")
+    def test_monitoring_ports(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+        _run_cephadm.return_value = ('{}', '', 0)
+
+        with with_host(cephadm_module, 'test'):
+
+            yaml_str = """service_type: alertmanager
+service_name: alertmanager
+placement:
+    count: 1
+spec:
+    port: 4200
+"""
+            yaml_file = yaml.safe_load(yaml_str)
+            spec = ServiceSpec.from_json(yaml_file)
+
+            with patch("cephadm.services.monitoring.AlertmanagerService.generate_config", return_value=({}, [])):
+                with with_service(cephadm_module, spec):
+
+                    CephadmServe(cephadm_module)._check_daemons()
+
+                    _run_cephadm.assert_called_with(
+                        'test', 'alertmanager.test', 'deploy', [
+                            '--name', 'alertmanager.test',
+                            '--meta-json', '{"service_name": "alertmanager", "ports": [4200, 9094], "ip": null, "deployed_by": [], "rank": null, "rank_generation": null}',
+                            '--config-json', '-',
+                            '--tcp-ports', '4200 9094',
+                            '--reconfig'
+                        ],
+                        stdin='{}',
+                        image='')
+
+
+class TestRGWService:
+
+    @pytest.mark.parametrize(
+        "frontend, ssl, expected",
+        [
+            ('beast', False, 'beast endpoint=[fd00:fd00:fd00:3000::1]:80'),
+            ('beast', True,
+             'beast ssl_endpoint=[fd00:fd00:fd00:3000::1]:443 ssl_certificate=config://rgw/cert/rgw.foo'),
+            ('civetweb', False, 'civetweb port=[fd00:fd00:fd00:3000::1]:80'),
+            ('civetweb', True,
+             'civetweb port=[fd00:fd00:fd00:3000::1]:443s ssl_certificate=config://rgw/cert/rgw.foo'),
+        ]
+    )
+    @patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('{}'))
+    def test_rgw_update(self, frontend, ssl, expected, cephadm_module: CephadmOrchestrator):
+        with with_host(cephadm_module, 'host1'):
+            cephadm_module.cache.update_host_devices_networks(
+                'host1',
+                dls=cephadm_module.cache.devices['host1'],
+                nets={
+                    'fd00:fd00:fd00:3000::/64': {
+                        'if0': ['fd00:fd00:fd00:3000::1']
+                    }
+                })
+            s = RGWSpec(service_id="foo",
+                        networks=['fd00:fd00:fd00:3000::/64'],
+                        ssl=ssl,
+                        rgw_frontend_type=frontend)
+            with with_service(cephadm_module, s) as dds:
+                _, f, _ = cephadm_module.check_mon_command({
+                    'prefix': 'config get',
+                    'who': f'client.{dds[0]}',
+                    'key': 'rgw_frontends',
+                })
+                assert f == expected
index d46cbfe7f17ff3c454a26a1d093f03476ddc646a..23fcf9c2367a0c925e1ffccb6cacca9bd776003e 100644 (file)
@@ -284,6 +284,7 @@ def test_dd_octopus(dd_json):
                   'last_configured']:
             if k in j:
                 j[k] = j[k].rstrip('Z')
+        del j['daemon_name']
         return j
 
     assert dd_json == convert_to_old_style_json(
index fad632687e2c388e47db3bd3c7c8e7d8842efc8e..d11960ba9dba47325a37a2511cb49213335159b4 100644 (file)
@@ -2,9 +2,10 @@ import json
 import logging
 import time
 import uuid
-from typing import TYPE_CHECKING, Optional, Dict, List, Tuple
+from typing import TYPE_CHECKING, Optional, Dict, List, Tuple, Any
 
 import orchestrator
+from cephadm.registry import Registry
 from cephadm.serve import CephadmServe
 from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
 from cephadm.utils import ceph_release_to_major, name_to_config_section, CEPH_UPGRADE_ORDER, MONITORING_STACK_TYPES
@@ -16,6 +17,9 @@ if TYPE_CHECKING:
 
 logger = logging.getLogger(__name__)
 
+# from ceph_fs.h
+CEPH_MDSMAP_ALLOW_STANDBY_REPLAY = (1 << 5)
+
 
 def normalize_image_digest(digest: str, default_registry: str) -> str:
     # normal case:
@@ -41,6 +45,7 @@ class UpgradeState:
                  error: Optional[str] = None,
                  paused: Optional[bool] = None,
                  fs_original_max_mds: Optional[Dict[str, int]] = None,
+                 fs_original_allow_standby_replay: Optional[Dict[str, bool]] = None
                  ):
         self._target_name: str = target_name  # Use CephadmUpgrade.target_image instead.
         self.progress_id: str = progress_id
@@ -50,6 +55,7 @@ class UpgradeState:
         self.error: Optional[str] = error
         self.paused: bool = paused or False
         self.fs_original_max_mds: Optional[Dict[str, int]] = fs_original_max_mds
+        self.fs_original_allow_standby_replay: Optional[Dict[str, bool]] = fs_original_allow_standby_replay
 
     def to_json(self) -> dict:
         return {
@@ -59,6 +65,7 @@ class UpgradeState:
             'target_digests': self.target_digests,
             'target_version': self.target_version,
             'fs_original_max_mds': self.fs_original_max_mds,
+            'fs_original_allow_standby_replay': self.fs_original_allow_standby_replay,
             'error': self.error,
             'paused': self.paused,
         }
@@ -176,6 +183,37 @@ class CephadmUpgrade:
 
         return None
 
+    def upgrade_ls(self, image: Optional[str], tags: bool) -> Dict:
+        if not image:
+            image = self.mgr.container_image_base
+        reg_name, bare_image = image.split('/', 1)
+        reg = Registry(reg_name)
+        versions = []
+        r: Dict[Any, Any] = {
+            "image": image,
+            "registry": reg_name,
+            "bare_image": bare_image,
+        }
+        ls = reg.get_tags(bare_image)
+        if not tags:
+            for t in ls:
+                if t[0] != 'v':
+                    continue
+                v = t[1:].split('.')
+                if len(v) != 3:
+                    continue
+                if '-' in v[2]:
+                    continue
+                versions.append('.'.join(v))
+            r["versions"] = sorted(
+                versions,
+                key=lambda k: list(map(int, k.split('.'))),
+                reverse=True
+            )
+        else:
+            r["tags"] = sorted(ls)
+        return r
+
     def upgrade_start(self, image: str, version: str) -> str:
         if self.mgr.mode != 'root':
             raise OrchestratorError('upgrade is not supported in %s mode' % (
@@ -356,42 +394,43 @@ class CephadmUpgrade:
         target_major: str,
         need_upgrade: List[DaemonDescription]
     ) -> bool:
-        # are any daemons running a different major version?
-        scale_down = False
-        for name, info in self.mgr.get("mds_metadata").items():
-            version = info.get("ceph_version_short")
-            major_version = None
-            if version:
-                major_version = version.split('.')[0]
-            if not major_version:
-                self.mgr.log.info('Upgrade: mds.%s version is not known, will retry' % name)
-                time.sleep(5)
-                return False
-            if int(major_version) < int(target_major):
-                scale_down = True
-
-        if not scale_down:
-            self.mgr.log.debug('Upgrade: All MDS daemons run same major version')
-            return True
-
         # scale down all filesystems to 1 MDS
         assert self.upgrade_state
         if not self.upgrade_state.fs_original_max_mds:
             self.upgrade_state.fs_original_max_mds = {}
+        if not self.upgrade_state.fs_original_allow_standby_replay:
+            self.upgrade_state.fs_original_allow_standby_replay = {}
         fsmap = self.mgr.get("fs_map")
         continue_upgrade = True
-        for i in fsmap.get('filesystems', []):
-            fs = i["mdsmap"]
-            fs_id = i["id"]
-            fs_name = fs["fs_name"]
+        for fs in fsmap.get('filesystems', []):
+            fscid = fs["id"]
+            mdsmap = fs["mdsmap"]
+            fs_name = mdsmap["fs_name"]
+
+            # disable allow_standby_replay?
+            if mdsmap['flags'] & CEPH_MDSMAP_ALLOW_STANDBY_REPLAY:
+                self.mgr.log.info('Upgrade: Disabling standby-replay for filesystem %s' % (
+                    fs_name
+                ))
+                if fscid not in self.upgrade_state.fs_original_allow_standby_replay:
+                    self.upgrade_state.fs_original_allow_standby_replay[fscid] = True
+                    self._save_upgrade_state()
+                ret, out, err = self.mgr.check_mon_command({
+                    'prefix': 'fs set',
+                    'fs_name': fs_name,
+                    'var': 'allow_standby_replay',
+                    'val': '0',
+                })
+                continue_upgrade = False
+                continue
 
             # scale down this filesystem?
-            if fs["max_mds"] > 1:
+            if mdsmap["max_mds"] > 1:
                 self.mgr.log.info('Upgrade: Scaling down filesystem %s' % (
                     fs_name
                 ))
-                if fs_id not in self.upgrade_state.fs_original_max_mds:
-                    self.upgrade_state.fs_original_max_mds[fs_id] = fs['max_mds']
+                if fscid not in self.upgrade_state.fs_original_max_mds:
+                    self.upgrade_state.fs_original_max_mds[fscid] = mdsmap['max_mds']
                     self._save_upgrade_state()
                 ret, out, err = self.mgr.check_mon_command({
                     'prefix': 'fs set',
@@ -402,21 +441,31 @@ class CephadmUpgrade:
                 continue_upgrade = False
                 continue
 
-            if len(fs['info']) > 1:
-                self.mgr.log.info('Upgrade: Waiting for fs %s to scale down to 1 MDS' % (fs_name))
+            if not (mdsmap['in'] == [0] and len(mdsmap['up']) <= 1):
+                self.mgr.log.info('Upgrade: Waiting for fs %s to scale down to reach 1 MDS' % (fs_name))
                 time.sleep(10)
                 continue_upgrade = False
                 continue
 
-            lone_mds = list(fs['info'].values())[0]
-            if lone_mds['state'] != 'up:active':
-                self.mgr.log.info('Upgrade: Waiting for mds.%s to be up:active (currently %s)' % (
-                    lone_mds['name'],
-                    lone_mds['state'],
-                ))
-                time.sleep(10)
-                continue_upgrade = False
-                continue
+            if len(mdsmap['up']) == 0:
+                self.mgr.log.warning("Upgrade: No mds is up; continuing upgrade procedure to poke things in the right direction")
+                # This can happen because the current version MDS have
+                # incompatible compatsets; the mons will not do any promotions.
+                # We must upgrade to continue.
+            elif len(mdsmap['up']) > 0:
+                mdss = list(mdsmap['info'].values())
+                assert len(mdss) == 1
+                lone_mds = mdss[0]
+                if lone_mds['state'] != 'up:active':
+                    self.mgr.log.info('Upgrade: Waiting for mds.%s to be up:active (currently %s)' % (
+                        lone_mds['name'],
+                        lone_mds['state'],
+                    ))
+                    time.sleep(10)
+                    continue_upgrade = False
+                    continue
+            else:
+                assert False
 
         return continue_upgrade
 
@@ -438,9 +487,9 @@ class CephadmUpgrade:
 
         # find fs this mds daemon belongs to
         fsmap = self.mgr.get("fs_map")
-        for i in fsmap.get('filesystems', []):
-            fs = i["mdsmap"]
-            fs_name = fs["fs_name"]
+        for fs in fsmap.get('filesystems', []):
+            mdsmap = fs["mdsmap"]
+            fs_name = mdsmap["fs_name"]
 
             assert mds_daemon.daemon_id
             if fs_name != mds_daemon.service_name().split('.', 1)[1]:
@@ -452,7 +501,7 @@ class CephadmUpgrade:
                 [daemon for daemon in self.mgr.cache.get_daemons_by_service(mds_daemon.service_name())])
 
             # standby mds daemons for this fs?
-            if fs["max_mds"] < mds_count:
+            if mdsmap["max_mds"] < mds_count:
                 return True
             return False
 
@@ -528,6 +577,18 @@ class CephadmUpgrade:
 
         image_settings = self.get_distinct_container_image_settings()
 
+        # Older monitors (pre-v16.2.5) asserted that FSMap::compat ==
+        # MDSMap::compat for all fs. This is no longer the case beginning in
+        # v16.2.5. We must disable the sanity checks during upgrade.
+        # N.B.: we don't bother confirming the operator has not already
+        # disabled this or saving the config value.
+        self.mgr.check_mon_command({
+            'prefix': 'config set',
+            'name': 'mon_mds_skip_sanity',
+            'value': '1',
+            'who': 'mon',
+        })
+
         daemons = [d for d in self.mgr.cache.get_daemons() if d.daemon_type in CEPH_UPGRADE_ORDER]
         done = 0
         for daemon_type in CEPH_UPGRADE_ORDER:
@@ -771,24 +832,43 @@ class CephadmUpgrade:
                     })
 
             # complete mds upgrade?
-            if daemon_type == 'mds' and self.upgrade_state.fs_original_max_mds:
-                for i in self.mgr.get("fs_map")['filesystems']:
-                    fs_id = i["id"]
-                    fs_name = i['mdsmap']['fs_name']
-                    new_max = self.upgrade_state.fs_original_max_mds.get(fs_id)
-                    if new_max:
-                        self.mgr.log.info('Upgrade: Scaling up filesystem %s max_mds to %d' % (
-                            fs_name, new_max
-                        ))
-                        ret, _, err = self.mgr.check_mon_command({
-                            'prefix': 'fs set',
-                            'fs_name': fs_name,
-                            'var': 'max_mds',
-                            'val': str(new_max),
-                        })
-
-                self.upgrade_state.fs_original_max_mds = {}
-                self._save_upgrade_state()
+            if daemon_type == 'mds':
+                if self.upgrade_state.fs_original_max_mds:
+                    for fs in self.mgr.get("fs_map")['filesystems']:
+                        fscid = fs["id"]
+                        fs_name = fs['mdsmap']['fs_name']
+                        new_max = self.upgrade_state.fs_original_max_mds.get(fscid, 1)
+                        if new_max > 1:
+                            self.mgr.log.info('Upgrade: Scaling up filesystem %s max_mds to %d' % (
+                                fs_name, new_max
+                            ))
+                            ret, _, err = self.mgr.check_mon_command({
+                                'prefix': 'fs set',
+                                'fs_name': fs_name,
+                                'var': 'max_mds',
+                                'val': str(new_max),
+                            })
+
+                    self.upgrade_state.fs_original_max_mds = {}
+                    self._save_upgrade_state()
+                if self.upgrade_state.fs_original_allow_standby_replay:
+                    for fs in self.mgr.get("fs_map")['filesystems']:
+                        fscid = fs["id"]
+                        fs_name = fs['mdsmap']['fs_name']
+                        asr = self.upgrade_state.fs_original_allow_standby_replay.get(fscid, False)
+                        if asr:
+                            self.mgr.log.info('Upgrade: Enabling allow_standby_replay on filesystem %s' % (
+                                fs_name
+                            ))
+                            ret, _, err = self.mgr.check_mon_command({
+                                'prefix': 'fs set',
+                                'fs_name': fs_name,
+                                'var': 'allow_standby_replay',
+                                'val': '1'
+                            })
+
+                    self.upgrade_state.fs_original_allow_standby_replay = {}
+                    self._save_upgrade_state()
 
         # clean up
         logger.info('Upgrade: Finalizing container_image settings')
@@ -801,6 +881,12 @@ class CephadmUpgrade:
                 'who': name_to_config_section(daemon_type),
             })
 
+        self.mgr.check_mon_command({
+            'prefix': 'config rm',
+            'name': 'mon_mds_skip_sanity',
+            'who': 'mon',
+        })
+
         logger.info('Upgrade: Complete!')
         if self.upgrade_state.progress_id:
             self.mgr.remote('progress', 'complete',
index be7ef49ba9f25ea98d545650023cdf443748f38b..99e1683ed0376fc6fb645f9af535944903d0fceb 100644 (file)
@@ -24,8 +24,11 @@ class CephadmNoImage(Enum):
 CEPH_TYPES = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror', 'cephfs-mirror']
 GATEWAY_TYPES = ['iscsi', 'nfs']
 MONITORING_STACK_TYPES = ['node-exporter', 'prometheus', 'alertmanager', 'grafana']
+
 CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES + MONITORING_STACK_TYPES
 
+# these daemon types use the ceph container image
+CEPH_IMAGE_TYPES = CEPH_TYPES + ['iscsi', 'nfs']
 
 # Used for _run_cephadm used for check-host etc that don't require an --image parameter
 cephadmNoImage = CephadmNoImage.token
index 94c0a568277c8427c5ef9254d157b252503de3b3..9b3432213a016baf9327ed5132aef48e2b726710 100644 (file)
@@ -134,5 +134,8 @@ add_dependencies(tests mgr-dashboard-frontend-build)
 
 if(WITH_TESTS)
   include(AddCephTest)
-  add_tox_test(mgr-dashboard TOX_ENVS py3 lint check openapi-check)
+  add_tox_test(mgr-dashboard-py3 TOX_ENVS py3)
+  add_tox_test(mgr-dashboard-lint TOX_ENVS lint)
+  add_tox_test(mgr-dashboard-check TOX_ENVS check)
+  add_tox_test(mgr-dashboard-openapi TOX_ENVS openapi-check)
 endif()
index 34485327e3535bac9d49194c191d7f60362c7360..feefda948163cb1962046b81c50b5c27adb1e44a 100644 (file)
@@ -9,8 +9,6 @@ import os
 
 import cherrypy
 
-DEFAULT_VERSION = '1.0'
-
 if 'COVERAGE_ENABLED' in os.environ:
     import coverage  # pylint: disable=import-error
     __cov = coverage.Coverage(config_file="{}/.coveragerc".format(os.path.dirname(__file__)),
index 4bad63bc5973c64002e673ddba12a6fc56a06e08..2c451f7864c100e5186f625a44c3aca9a4dce4ac 100755 (executable)
@@ -8,17 +8,18 @@ chmod +x /root/bin/cephadm
 mkdir -p /etc/ceph
 mon_ip=$(ifconfig eth0  | grep 'inet ' | awk '{ print $2}')
 
-cephadm bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --allow-fqdn-hostname --dashboard-password-noupdate --shared_ceph_folder /mnt/{{ ceph_dev_folder }}
+cephadm bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --allow-fqdn-hostname --skip-monitoring-stack --dashboard-password-noupdate --shared_ceph_folder /mnt/{{ ceph_dev_folder }}
 
 fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
+cephadm_shell="cephadm shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
 
 {% for number in range(1, nodes) %}
   ssh-copy-id -f -i /etc/ceph/ceph.pub  -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}.{{ domain }}
   {% if expanded_cluster is defined %}
-    cephadm shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch host add {{ prefix }}-node-0{{ number }}.{{ domain }}
+    ${cephadm_shell} ceph orch host add {{ prefix }}-node-0{{ number }}.{{ domain }}
   {% endif %}
 {% endfor %}
 
 {% if expanded_cluster is defined %}
-  cephadm shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch apply osd --all-available-devices
+  ${cephadm_shell} ceph orch apply osd --all-available-devices
 {% endif %}
index 7daf2301d351f3b07de90d01bf44495d42ef8166..7a5b090ee461e71d7b90ff890db5beaad610c088 100644 (file)
-# -*- coding: utf-8 -*-
-# pylint: disable=protected-access,too-many-branches,too-many-lines
-from __future__ import absolute_import
-
-import collections
-import importlib
-import inspect
-import json
-import logging
-import os
-import pkgutil
-import re
-import sys
-from functools import wraps
-from urllib.parse import unquote
-
-# pylint: disable=wrong-import-position
-import cherrypy
-# pylint: disable=import-error
-from ceph_argparse import ArgumentFormat  # type: ignore
-
-from .. import DEFAULT_VERSION
-from ..api.doc import SchemaInput, SchemaType
-from ..exceptions import DashboardException, PermissionNotValid, ScopeNotValid
-from ..plugins import PLUGIN_MANAGER
-from ..security import Permission, Scope
-from ..services.auth import AuthManager, JwtManager
-from ..tools import TaskManager, get_request_body_params, getargspec
-
-try:
-    from typing import Any, List, Optional
-except ImportError:
-    pass  # For typing only
-
-
-def EndpointDoc(description="", group="", parameters=None, responses=None):  # noqa: N802
-    if not isinstance(description, str):
-        raise Exception("%s has been called with a description that is not a string: %s"
-                        % (EndpointDoc.__name__, description))
-    if not isinstance(group, str):
-        raise Exception("%s has been called with a groupname that is not a string: %s"
-                        % (EndpointDoc.__name__, group))
-    if parameters and not isinstance(parameters, dict):
-        raise Exception("%s has been called with parameters that is not a dict: %s"
-                        % (EndpointDoc.__name__, parameters))
-    if responses and not isinstance(responses, dict):
-        raise Exception("%s has been called with responses that is not a dict: %s"
-                        % (EndpointDoc.__name__, responses))
-
-    if not parameters:
-        parameters = {}
-
-    def _split_param(name, p_type, description, optional=False, default_value=None, nested=False):
-        param = {
-            'name': name,
-            'description': description,
-            'required': not optional,
-            'nested': nested,
-        }
-        if default_value:
-            param['default'] = default_value
-        if isinstance(p_type, type):
-            param['type'] = p_type
-        else:
-            nested_params = _split_parameters(p_type, nested=True)
-            if nested_params:
-                param['type'] = type(p_type)
-                param['nested_params'] = nested_params
-            else:
-                param['type'] = p_type
-        return param
-
-    #  Optional must be set to True in order to set default value and parameters format must be:
-    # 'name: (type or nested parameters, description, [optional], [default value])'
-    def _split_dict(data, nested):
-        splitted = []
-        for name, props in data.items():
-            if isinstance(name, str) and isinstance(props, tuple):
-                if len(props) == 2:
-                    param = _split_param(name, props[0], props[1], nested=nested)
-                elif len(props) == 3:
-                    param = _split_param(name, props[0], props[1], optional=props[2], nested=nested)
-                if len(props) == 4:
-                    param = _split_param(name, props[0], props[1], props[2], props[3], nested)
-                splitted.append(param)
-            else:
-                raise Exception(
-                    """Parameter %s in %s has not correct format. Valid formats are:
-                    <name>: (<type>, <description>, [optional], [default value])
-                    <name>: (<[type]>, <description>, [optional], [default value])
-                    <name>: (<[nested parameters]>, <description>, [optional], [default value])
-                    <name>: (<{nested parameters}>, <description>, [optional], [default value])"""
-                    % (name, EndpointDoc.__name__))
-        return splitted
-
-    def _split_list(data, nested):
-        splitted = []  # type: List[Any]
-        for item in data:
-            splitted.extend(_split_parameters(item, nested))
-        return splitted
-
-    # nested = True means parameters are inside a dict or array
-    def _split_parameters(data, nested=False):
-        param_list = []  # type: List[Any]
-        if isinstance(data, dict):
-            param_list.extend(_split_dict(data, nested))
-        elif isinstance(data, (list, tuple)):
-            param_list.extend(_split_list(data, True))
-        return param_list
-
-    resp = {}
-    if responses:
-        for status_code, response_body in responses.items():
-            schema_input = SchemaInput()
-            schema_input.type = SchemaType.ARRAY if \
-                isinstance(response_body, list) else SchemaType.OBJECT
-            schema_input.params = _split_parameters(response_body)
-
-            resp[str(status_code)] = schema_input
-
-    def _wrapper(func):
-        func.doc_info = {
-            'summary': description,
-            'tag': group,
-            'parameters': _split_parameters(parameters),
-            'response': resp
-        }
-        return func
-
-    return _wrapper
-
-
-class ControllerDoc(object):
-    def __init__(self, description="", group=""):
-        self.tag = group
-        self.tag_descr = description
-
-    def __call__(self, cls):
-        cls.doc_info = {
-            'tag': self.tag,
-            'tag_descr': self.tag_descr
-        }
-        return cls
-
-
-class Controller(object):
-    def __init__(self, path, base_url=None, security_scope=None, secure=True):
-        if security_scope and not Scope.valid_scope(security_scope):
-            raise ScopeNotValid(security_scope)
-        self.path = path
-        self.base_url = base_url
-        self.security_scope = security_scope
-        self.secure = secure
-
-        if self.path and self.path[0] != "/":
-            self.path = "/" + self.path
-
-        if self.base_url is None:
-            self.base_url = ""
-        elif self.base_url == "/":
-            self.base_url = ""
-
-        if self.base_url == "" and self.path == "":
-            self.base_url = "/"
-
-    def __call__(self, cls):
-        cls._cp_controller_ = True
-        cls._cp_path_ = "{}{}".format(self.base_url, self.path)
-        cls._security_scope = self.security_scope
-
-        config = {
-            'tools.dashboard_exception_handler.on': True,
-            'tools.authenticate.on': self.secure,
-        }
-        if not hasattr(cls, '_cp_config'):
-            cls._cp_config = {}
-        cls._cp_config.update(config)
-        return cls
-
-
-class ApiController(Controller):
-    def __init__(self, path, security_scope=None, secure=True):
-        super(ApiController, self).__init__(path, base_url="/api",
-                                            security_scope=security_scope,
-                                            secure=secure)
-
-    def __call__(self, cls):
-        cls = super(ApiController, self).__call__(cls)
-        cls._api_endpoint = True
-        return cls
-
-
-class UiApiController(Controller):
-    def __init__(self, path, security_scope=None, secure=True):
-        super(UiApiController, self).__init__(path, base_url="/ui-api",
-                                              security_scope=security_scope,
-                                              secure=secure)
-
-    def __call__(self, cls):
-        cls = super(UiApiController, self).__call__(cls)
-        cls._api_endpoint = False
-        return cls
-
-
-def Endpoint(method=None, path=None, path_params=None, query_params=None,  # noqa: N802
-             json_response=True, proxy=False, xml=False, version=DEFAULT_VERSION):
-
-    if method is None:
-        method = 'GET'
-    elif not isinstance(method, str) or \
-            method.upper() not in ['GET', 'POST', 'DELETE', 'PUT']:
-        raise TypeError("Possible values for method are: 'GET', 'POST', "
-                        "'DELETE', or 'PUT'")
-
-    method = method.upper()
-
-    if method in ['GET', 'DELETE']:
-        if path_params is not None:
-            raise TypeError("path_params should not be used for {} "
-                            "endpoints. All function params are considered"
-                            " path parameters by default".format(method))
-
-    if path_params is None:
-        if method in ['POST', 'PUT']:
-            path_params = []
-
-    if query_params is None:
-        query_params = []
-
-    def _wrapper(func):
-        if method in ['POST', 'PUT']:
-            func_params = _get_function_params(func)
-            for param in func_params:
-                if param['name'] in path_params and not param['required']:
-                    raise TypeError("path_params can only reference "
-                                    "non-optional function parameters")
-
-        if func.__name__ == '__call__' and path is None:
-            e_path = ""
-        else:
-            e_path = path
-
-        if e_path is not None:
-            e_path = e_path.strip()
-            if e_path and e_path[0] != "/":
-                e_path = "/" + e_path
-            elif e_path == "/":
-                e_path = ""
-
-        func._endpoint = {
-            'method': method,
-            'path': e_path,
-            'path_params': path_params,
-            'query_params': query_params,
-            'json_response': json_response,
-            'proxy': proxy,
-            'xml': xml,
-            'version': version
-        }
-        return func
-    return _wrapper
-
-
-def Proxy(path=None):  # noqa: N802
-    if path is None:
-        path = ""
-    elif path == "/":
-        path = ""
-    path += "/{path:.*}"
-    return Endpoint(path=path, proxy=True)
-
-
-def load_controllers():
-    logger = logging.getLogger('controller.load')
-    # setting sys.path properly when not running under the mgr
-    controllers_dir = os.path.dirname(os.path.realpath(__file__))
-    dashboard_dir = os.path.dirname(controllers_dir)
-    mgr_dir = os.path.dirname(dashboard_dir)
-    logger.debug("controllers_dir=%s", controllers_dir)
-    logger.debug("dashboard_dir=%s", dashboard_dir)
-    logger.debug("mgr_dir=%s", mgr_dir)
-    if mgr_dir not in sys.path:
-        sys.path.append(mgr_dir)
-
-    controllers = []
-    mods = [mod for _, mod, _ in pkgutil.iter_modules([controllers_dir])]
-    logger.debug("mods=%s", mods)
-    for mod_name in mods:
-        mod = importlib.import_module('.controllers.{}'.format(mod_name),
-                                      package='dashboard')
-        for _, cls in mod.__dict__.items():
-            # Controllers MUST be derived from the class BaseController.
-            if inspect.isclass(cls) and issubclass(cls, BaseController) and \
-                    hasattr(cls, '_cp_controller_'):
-                if cls._cp_path_.startswith(':'):
-                    # invalid _cp_path_ value
-                    logger.error("Invalid url prefix '%s' for controller '%s'",
-                                 cls._cp_path_, cls.__name__)
-                    continue
-                controllers.append(cls)
-
-    for clist in PLUGIN_MANAGER.hook.get_controllers() or []:
-        controllers.extend(clist)
-
-    return controllers
-
-
-ENDPOINT_MAP = collections.defaultdict(list)  # type: dict
-
-
-def generate_controller_routes(endpoint, mapper, base_url):
-    inst = endpoint.inst
-    ctrl_class = endpoint.ctrl
-
-    if endpoint.proxy:
-        conditions = None
-    else:
-        conditions = dict(method=[endpoint.method])
-
-    # base_url can be empty or a URL path that starts with "/"
-    # we will remove the trailing "/" if exists to help with the
-    # concatenation with the endpoint url below
-    if base_url.endswith("/"):
-        base_url = base_url[:-1]
-
-    endp_url = endpoint.url
-
-    if endp_url.find("/", 1) == -1:
-        parent_url = "{}{}".format(base_url, endp_url)
-    else:
-        parent_url = "{}{}".format(base_url, endp_url[:endp_url.find("/", 1)])
-
-    # parent_url might be of the form "/.../{...}" where "{...}" is a path parameter
-    # we need to remove the path parameter definition
-    parent_url = re.sub(r'(?:/\{[^}]+\})$', '', parent_url)
-    if not parent_url:  # root path case
-        parent_url = "/"
-
-    url = "{}{}".format(base_url, endp_url)
-
-    logger = logging.getLogger('controller')
-    logger.debug("Mapped [%s] to %s:%s restricted to %s",
-                 url, ctrl_class.__name__, endpoint.action,
-                 endpoint.method)
-
-    ENDPOINT_MAP[endpoint.url].append(endpoint)
-
-    name = ctrl_class.__name__ + ":" + endpoint.action
-    mapper.connect(name, url, controller=inst, action=endpoint.action,
-                   conditions=conditions)
-
-    # adding route with trailing slash
-    name += "/"
-    url += "/"
-    mapper.connect(name, url, controller=inst, action=endpoint.action,
-                   conditions=conditions)
-
-    return parent_url
-
-
-def generate_routes(url_prefix):
-    mapper = cherrypy.dispatch.RoutesDispatcher()
-    ctrls = load_controllers()
-
-    parent_urls = set()
-
-    endpoint_list = []
-    for ctrl in ctrls:
-        inst = ctrl()
-        for endpoint in ctrl.endpoints():
-            endpoint.inst = inst
-            endpoint_list.append(endpoint)
-
-    endpoint_list = sorted(endpoint_list, key=lambda e: e.url)
-    for endpoint in endpoint_list:
-        parent_urls.add(generate_controller_routes(endpoint, mapper,
-                                                   "{}".format(url_prefix)))
-
-    logger = logging.getLogger('controller')
-    logger.debug("list of parent paths: %s", parent_urls)
-    return mapper, parent_urls
-
-
-def json_error_page(status, message, traceback, version):
-    cherrypy.response.headers['Content-Type'] = 'application/json'
-    return json.dumps(dict(status=status, detail=message, traceback=traceback,
-                           version=version))
-
-
-def _get_function_params(func):
-    """
-    Retrieves the list of parameters declared in function.
-    Each parameter is represented as dict with keys:
-      * name (str): the name of the parameter
-      * required (bool): whether the parameter is required or not
-      * default (obj): the parameter's default value
-    """
-    fspec = getargspec(func)
-
-    func_params = []
-    nd = len(fspec.args) if not fspec.defaults else -len(fspec.defaults)
-    for param in fspec.args[1:nd]:
-        func_params.append({'name': param, 'required': True})
-
-    if fspec.defaults:
-        for param, val in zip(fspec.args[nd:], fspec.defaults):
-            func_params.append({
-                'name': param,
-                'required': False,
-                'default': val
-            })
-
-    return func_params
-
-
-class Task(object):
-    def __init__(self, name, metadata, wait_for=5.0, exception_handler=None):
-        self.name = name
-        if isinstance(metadata, list):
-            self.metadata = {e[1:-1]: e for e in metadata}
-        else:
-            self.metadata = metadata
-        self.wait_for = wait_for
-        self.exception_handler = exception_handler
-
-    def _gen_arg_map(self, func, args, kwargs):
-        arg_map = {}
-        params = _get_function_params(func)
-
-        args = args[1:]  # exclude self
-        for idx, param in enumerate(params):
-            if idx < len(args):
-                arg_map[param['name']] = args[idx]
-            else:
-                if param['name'] in kwargs:
-                    arg_map[param['name']] = kwargs[param['name']]
-                else:
-                    assert not param['required'], "{0} is required".format(param['name'])
-                    arg_map[param['name']] = param['default']
-
-            if param['name'] in arg_map:
-                # This is not a type error. We are using the index here.
-                arg_map[idx+1] = arg_map[param['name']]
-
-        return arg_map
-
-    def __call__(self, func):
-        @wraps(func)
-        def wrapper(*args, **kwargs):
-            arg_map = self._gen_arg_map(func, args, kwargs)
-            metadata = {}
-            for k, v in self.metadata.items():
-                if isinstance(v, str) and v and v[0] == '{' and v[-1] == '}':
-                    param = v[1:-1]
-                    try:
-                        pos = int(param)
-                        metadata[k] = arg_map[pos]
-                    except ValueError:
-                        if param.find('.') == -1:
-                            metadata[k] = arg_map[param]
-                        else:
-                            path = param.split('.')
-                            metadata[k] = arg_map[path[0]]
-                            for i in range(1, len(path)):
-                                metadata[k] = metadata[k][path[i]]
-                else:
-                    metadata[k] = v
-            task = TaskManager.run(self.name, metadata, func, args, kwargs,
-                                   exception_handler=self.exception_handler)
-            try:
-                status, value = task.wait(self.wait_for)
-            except Exception as ex:
-                if task.ret_value:
-                    # exception was handled by task.exception_handler
-                    if 'status' in task.ret_value:
-                        status = task.ret_value['status']
-                    else:
-                        status = getattr(ex, 'status', 500)
-                    cherrypy.response.status = status
-                    return task.ret_value
-                raise ex
-            if status == TaskManager.VALUE_EXECUTING:
-                cherrypy.response.status = 202
-                return {'name': self.name, 'metadata': metadata}
-            return value
-        return wrapper
-
-
-class BaseController(object):
-    """
-    Base class for all controllers providing API endpoints.
-    """
-
-    class Endpoint(object):
-        """
-        An instance of this class represents an endpoint.
-        """
-
-        def __init__(self, ctrl, func):
-            self.ctrl = ctrl
-            self.inst = None
-            self.func = func
-
-            if not self.config['proxy']:
-                setattr(self.ctrl, func.__name__, self.function)
-
-        @property
-        def config(self):
-            func = self.func
-            while not hasattr(func, '_endpoint'):
-                if hasattr(func, "__wrapped__"):
-                    func = func.__wrapped__
-                else:
-                    return None
-            return func._endpoint
-
-        @property
-        def function(self):
-            return self.ctrl._request_wrapper(self.func, self.method,
-                                              self.config['json_response'],
-                                              self.config['xml'],
-                                              self.config['version'])
-
-        @property
-        def method(self):
-            return self.config['method']
-
-        @property
-        def proxy(self):
-            return self.config['proxy']
-
-        @property
-        def url(self):
-            ctrl_path = self.ctrl.get_path()
-            if ctrl_path == "/":
-                ctrl_path = ""
-            if self.config['path'] is not None:
-                url = "{}{}".format(ctrl_path, self.config['path'])
-            else:
-                url = "{}/{}".format(ctrl_path, self.func.__name__)
-
-            ctrl_path_params = self.ctrl.get_path_param_names(
-                self.config['path'])
-            path_params = [p['name'] for p in self.path_params
-                           if p['name'] not in ctrl_path_params]
-            path_params = ["{{{}}}".format(p) for p in path_params]
-            if path_params:
-                url += "/{}".format("/".join(path_params))
-
-            return url
-
-        @property
-        def action(self):
-            return self.func.__name__
-
-        @property
-        def path_params(self):
-            ctrl_path_params = self.ctrl.get_path_param_names(
-                self.config['path'])
-            func_params = _get_function_params(self.func)
-
-            if self.method in ['GET', 'DELETE']:
-                assert self.config['path_params'] is None
-
-                return [p for p in func_params if p['name'] in ctrl_path_params
-                        or (p['name'] not in self.config['query_params']
-                            and p['required'])]
-
-            # elif self.method in ['POST', 'PUT']:
-            return [p for p in func_params if p['name'] in ctrl_path_params
-                    or p['name'] in self.config['path_params']]
-
-        @property
-        def query_params(self):
-            if self.method in ['GET', 'DELETE']:
-                func_params = _get_function_params(self.func)
-                path_params = [p['name'] for p in self.path_params]
-                return [p for p in func_params if p['name'] not in path_params]
-
-            # elif self.method in ['POST', 'PUT']:
-            func_params = _get_function_params(self.func)
-            return [p for p in func_params
-                    if p['name'] in self.config['query_params']]
-
-        @property
-        def body_params(self):
-            func_params = _get_function_params(self.func)
-            path_params = [p['name'] for p in self.path_params]
-            query_params = [p['name'] for p in self.query_params]
-            return [p for p in func_params
-                    if p['name'] not in path_params
-                    and p['name'] not in query_params]
-
-        @property
-        def group(self):
-            return self.ctrl.__name__
-
-        @property
-        def is_api(self):
-            # changed from hasattr to getattr: some ui-based api inherit _api_endpoint
-            return getattr(self.ctrl, '_api_endpoint', False)
-
-        @property
-        def is_secure(self):
-            return self.ctrl._cp_config['tools.authenticate.on']
-
-        def __repr__(self):
-            return "Endpoint({}, {}, {})".format(self.url, self.method,
-                                                 self.action)
-
-    def __init__(self):
-        logger = logging.getLogger('controller')
-        logger.info('Initializing controller: %s -> %s',
-                    self.__class__.__name__, self._cp_path_)  # type: ignore
-        super(BaseController, self).__init__()
-
-    def _has_permissions(self, permissions, scope=None):
-        if not self._cp_config['tools.authenticate.on']:  # type: ignore
-            raise Exception("Cannot verify permission in non secured "
-                            "controllers")
-
-        if not isinstance(permissions, list):
-            permissions = [permissions]
-
-        if scope is None:
-            scope = getattr(self, '_security_scope', None)
-        if scope is None:
-            raise Exception("Cannot verify permissions without scope security"
-                            " defined")
-        username = JwtManager.LOCAL_USER.username
-        return AuthManager.authorize(username, scope, permissions)
-
-    @classmethod
-    def get_path_param_names(cls, path_extension=None):
-        if path_extension is None:
-            path_extension = ""
-        full_path = cls._cp_path_[1:] + path_extension  # type: ignore
-        path_params = []
-        for step in full_path.split('/'):
-            param = None
-            if not step:
-                continue
-            if step[0] == ':':
-                param = step[1:]
-            elif step[0] == '{' and step[-1] == '}':
-                param, _, _ = step[1:-1].partition(':')
-            if param:
-                path_params.append(param)
-        return path_params
-
-    @classmethod
-    def get_path(cls):
-        return cls._cp_path_  # type: ignore
-
-    @classmethod
-    def endpoints(cls):
-        """
-        This method iterates over all the methods decorated with ``@endpoint``
-        and creates an Endpoint object for each one of the methods.
-
-        :return: A list of endpoint objects
-        :rtype: list[BaseController.Endpoint]
-        """
-        result = []
-        for _, func in inspect.getmembers(cls, predicate=callable):
-            if hasattr(func, '_endpoint'):
-                result.append(cls.Endpoint(cls, func))
-        return result
-
-    @staticmethod
-    def _request_wrapper(func, method, json_response, xml,  # pylint: disable=unused-argument
-                         version):
-        @wraps(func)
-        def inner(*args, **kwargs):
-            req_version = None
-            for key, value in kwargs.items():
-                if isinstance(value, str):
-                    kwargs[key] = unquote(value)
-
-            # Process method arguments.
-            params = get_request_body_params(cherrypy.request)
-            kwargs.update(params)
-
-            if version is not None:
-                accept_header = cherrypy.request.headers.get('Accept')
-                if accept_header and accept_header.startswith('application/vnd.ceph.api.v'):
-                    req_match = re.search(r"\d\.\d", accept_header)
-                    if req_match:
-                        req_version = req_match[0]
-                else:
-                    raise cherrypy.HTTPError(415, "Unable to find version in request header")
-
-                if req_version and req_version == version:
-                    ret = func(*args, **kwargs)
-                else:
-                    raise cherrypy.HTTPError(415,
-                                             "Incorrect version: "
-                                             "{} requested but {} is expected"
-                                             "".format(req_version, version))
-            else:
-                ret = func(*args, **kwargs)
-            if isinstance(ret, bytes):
-                ret = ret.decode('utf-8')
-            if xml:
-                if version:
-                    cherrypy.response.headers['Content-Type'] = \
-                        'application/vnd.ceph.api.v{}+xml'.format(version)
-                else:
-                    cherrypy.response.headers['Content-Type'] = 'application/xml'
-                return ret.encode('utf8')
-            if json_response:
-                if version:
-                    cherrypy.response.headers['Content-Type'] = \
-                        'application/vnd.ceph.api.v{}+json'.format(version)
-                else:
-                    cherrypy.response.headers['Content-Type'] = 'application/json'
-                ret = json.dumps(ret).encode('utf8')
-            return ret
-        return inner
-
-    @property
-    def _request(self):
-        return self.Request(cherrypy.request)
-
-    class Request(object):
-        def __init__(self, cherrypy_req):
-            self._creq = cherrypy_req
-
-        @property
-        def scheme(self):
-            return self._creq.scheme
-
-        @property
-        def host(self):
-            base = self._creq.base
-            base = base[len(self.scheme)+3:]
-            return base[:base.find(":")] if ":" in base else base
-
-        @property
-        def port(self):
-            base = self._creq.base
-            base = base[len(self.scheme)+3:]
-            default_port = 443 if self.scheme == 'https' else 80
-            return int(base[base.find(":")+1:]) if ":" in base else default_port
-
-        @property
-        def path_info(self):
-            return self._creq.path_info
-
-
-class RESTController(BaseController):
-    """
-    Base class for providing a RESTful interface to a resource.
-
-    To use this class, simply derive a class from it and implement the methods
-    you want to support.  The list of possible methods are:
-
-    * list()
-    * bulk_set(data)
-    * create(data)
-    * bulk_delete()
-    * get(key)
-    * set(data, key)
-    * singleton_set(data)
-    * delete(key)
-
-    Test with curl:
-
-    curl -H "Content-Type: application/json" -X POST \
-         -d '{"username":"xyz","password":"xyz"}'  https://127.0.0.1:8443/foo
-    curl https://127.0.0.1:8443/foo
-    curl https://127.0.0.1:8443/foo/0
-
-    """
-
-    # resource id parameter for using in get, set, and delete methods
-    # should be overridden by subclasses.
-    # to specify a composite id (two parameters) use '/'. e.g., "param1/param2".
-    # If subclasses don't override this property we try to infer the structure
-    # of the resource ID.
-    RESOURCE_ID = None  # type: Optional[str]
-
-    _permission_map = {
-        'GET': Permission.READ,
-        'POST': Permission.CREATE,
-        'PUT': Permission.UPDATE,
-        'DELETE': Permission.DELETE
-    }
-
-    _method_mapping = collections.OrderedDict([
-        ('list', {'method': 'GET', 'resource': False, 'status': 200, 'version': DEFAULT_VERSION}),
-        ('create', {'method': 'POST', 'resource': False, 'status': 201, 'version': DEFAULT_VERSION}),  # noqa E501 #pylint: disable=line-too-long
-        ('bulk_set', {'method': 'PUT', 'resource': False, 'status': 200, 'version': DEFAULT_VERSION}),  # noqa E501 #pylint: disable=line-too-long
-        ('bulk_delete', {'method': 'DELETE', 'resource': False, 'status': 204, 'version': DEFAULT_VERSION}),  # noqa E501 #pylint: disable=line-too-long
-        ('get', {'method': 'GET', 'resource': True, 'status': 200, 'version': DEFAULT_VERSION}),
-        ('delete', {'method': 'DELETE', 'resource': True, 'status': 204, 'version': DEFAULT_VERSION}),  # noqa E501 #pylint: disable=line-too-long
-        ('set', {'method': 'PUT', 'resource': True, 'status': 200, 'version': DEFAULT_VERSION}),
-        ('singleton_set', {'method': 'PUT', 'resource': False, 'status': 200, 'version': DEFAULT_VERSION})  # noqa E501 #pylint: disable=line-too-long
-    ])
-
-    @classmethod
-    def infer_resource_id(cls):
-        if cls.RESOURCE_ID is not None:
-            return cls.RESOURCE_ID.split('/')
-        for k, v in cls._method_mapping.items():
-            func = getattr(cls, k, None)
-            while hasattr(func, "__wrapped__"):
-                func = func.__wrapped__
-            if v['resource'] and func:
-                path_params = cls.get_path_param_names()
-                params = _get_function_params(func)
-                return [p['name'] for p in params
-                        if p['required'] and p['name'] not in path_params]
-        return None
-
-    @classmethod
-    def endpoints(cls):
-        result = super(RESTController, cls).endpoints()
-        res_id_params = cls.infer_resource_id()
-
-        for _, func in inspect.getmembers(cls, predicate=callable):
-            no_resource_id_params = False
-            status = 200
-            method = None
-            query_params = None
-            path = ""
-            version = DEFAULT_VERSION
-            sec_permissions = hasattr(func, '_security_permissions')
-            permission = None
-
-            if func.__name__ in cls._method_mapping:
-                meth = cls._method_mapping[func.__name__]  # type: dict
-
-                if meth['resource']:
-                    if not res_id_params:
-                        no_resource_id_params = True
-                    else:
-                        path_params = ["{{{}}}".format(p) for p in res_id_params]
-                        path += "/{}".format("/".join(path_params))
-
-                status = meth['status']
-                method = meth['method']
-                if hasattr(func, "__method_map_method__"):
-                    version = func.__method_map_method__['version']
-                if not sec_permissions:
-                    permission = cls._permission_map[method]
-
-            elif hasattr(func, "__collection_method__"):
-                if func.__collection_method__['path']:
-                    path = func.__collection_method__['path']
-                else:
-                    path = "/{}".format(func.__name__)
-                status = func.__collection_method__['status']
-                method = func.__collection_method__['method']
-                query_params = func.__collection_method__['query_params']
-                version = func.__collection_method__['version']
-                if not sec_permissions:
-                    permission = cls._permission_map[method]
-
-            elif hasattr(func, "__resource_method__"):
-                if not res_id_params:
-                    no_resource_id_params = True
-                else:
-                    path_params = ["{{{}}}".format(p) for p in res_id_params]
-                    path += "/{}".format("/".join(path_params))
-                    if func.__resource_method__['path']:
-                        path += func.__resource_method__['path']
-                    else:
-                        path += "/{}".format(func.__name__)
-                status = func.__resource_method__['status']
-                method = func.__resource_method__['method']
-                version = func.__resource_method__['version']
-                query_params = func.__resource_method__['query_params']
-                if not sec_permissions:
-                    permission = cls._permission_map[method]
-
-            else:
-                continue
-
-            if no_resource_id_params:
-                raise TypeError("Could not infer the resource ID parameters for"
-                                " method {} of controller {}. "
-                                "Please specify the resource ID parameters "
-                                "using the RESOURCE_ID class property"
-                                .format(func.__name__, cls.__name__))
-
-            if method in ['GET', 'DELETE']:
-                params = _get_function_params(func)
-                if res_id_params is None:
-                    res_id_params = []
-                if query_params is None:
-                    query_params = [p['name'] for p in params
-                                    if p['name'] not in res_id_params]
-
-            func = cls._status_code_wrapper(func, status)
-            endp_func = Endpoint(method, path=path,
-                                 query_params=query_params, version=version)(func)
-            if permission:
-                _set_func_permissions(endp_func, [permission])
-            result.append(cls.Endpoint(cls, endp_func))
-
-        return result
-
-    @classmethod
-    def _status_code_wrapper(cls, func, status_code):
-        @wraps(func)
-        def wrapper(*vpath, **params):
-            cherrypy.response.status = status_code
-            return func(*vpath, **params)
-
-        return wrapper
-
-    @staticmethod
-    def Resource(method=None, path=None, status=None, query_params=None,  # noqa: N802
-                 version=DEFAULT_VERSION):
-        if not method:
-            method = 'GET'
-
-        if status is None:
-            status = 200
-
-        def _wrapper(func):
-            func.__resource_method__ = {
-                'method': method,
-                'path': path,
-                'status': status,
-                'query_params': query_params,
-                'version': version
-            }
-            return func
-        return _wrapper
-
-    @staticmethod
-    def MethodMap(resource=False, status=None, version=DEFAULT_VERSION):  # noqa: N802
-
-        if status is None:
-            status = 200
-
-        def _wrapper(func):
-            func.__method_map_method__ = {
-                'resource': resource,
-                'status': status,
-                'version': version
-            }
-            return func
-        return _wrapper
-
-    @staticmethod
-    def Collection(method=None, path=None, status=None, query_params=None,  # noqa: N802
-                   version=DEFAULT_VERSION):
-        if not method:
-            method = 'GET'
-
-        if status is None:
-            status = 200
-
-        def _wrapper(func):
-            func.__collection_method__ = {
-                'method': method,
-                'path': path,
-                'status': status,
-                'query_params': query_params,
-                'version': version
-            }
-            return func
-        return _wrapper
-
-
-class ControllerAuthMixin(object):
-    @staticmethod
-    def _delete_token_cookie(token):
-        cherrypy.response.cookie['token'] = token
-        cherrypy.response.cookie['token']['expires'] = 0
-        cherrypy.response.cookie['token']['max-age'] = 0
-
-    @staticmethod
-    def _set_token_cookie(url_prefix, token):
-        cherrypy.response.cookie['token'] = token
-        if url_prefix == 'https':
-            cherrypy.response.cookie['token']['secure'] = True
-        cherrypy.response.cookie['token']['HttpOnly'] = True
-        cherrypy.response.cookie['token']['path'] = '/'
-        cherrypy.response.cookie['token']['SameSite'] = 'Strict'
-
-
-# Role-based access permissions decorators
-
-def _set_func_permissions(func, permissions):
-    if not isinstance(permissions, list):
-        permissions = [permissions]
-
-    for perm in permissions:
-        if not Permission.valid_permission(perm):
-            logger = logging.getLogger('controller.set_func_perms')
-            logger.debug("Invalid security permission: %s\n "
-                         "Possible values: %s", perm,
-                         Permission.all_permissions())
-            raise PermissionNotValid(perm)
-
-    if not hasattr(func, '_security_permissions'):
-        func._security_permissions = permissions
-    else:
-        permissions.extend(func._security_permissions)
-        func._security_permissions = list(set(permissions))
-
-
-def ReadPermission(func):  # noqa: N802
-    """
-    :raises PermissionNotValid: If the permission is missing.
-    """
-    _set_func_permissions(func, Permission.READ)
-    return func
-
-
-def CreatePermission(func):  # noqa: N802
-    """
-    :raises PermissionNotValid: If the permission is missing.
-    """
-    _set_func_permissions(func, Permission.CREATE)
-    return func
-
-
-def DeletePermission(func):  # noqa: N802
-    """
-    :raises PermissionNotValid: If the permission is missing.
-    """
-    _set_func_permissions(func, Permission.DELETE)
-    return func
-
-
-def UpdatePermission(func):  # noqa: N802
-    """
-    :raises PermissionNotValid: If the permission is missing.
-    """
-    _set_func_permissions(func, Permission.UPDATE)
-    return func
-
-
-# Empty request body decorator
-
-def allow_empty_body(func):  # noqa: N802
-    """
-    The POST/PUT request methods decorated with ``@allow_empty_body``
-    are allowed to send empty request body.
-    """
-    try:
-        func._cp_config['tools.json_in.force'] = False
-    except (AttributeError, KeyError):
-        func._cp_config = {'tools.json_in.force': False}
-    return func
-
-
-def validate_ceph_type(validations, component=''):
-    def decorator(func):
-        @wraps(func)
-        def validate_args(*args, **kwargs):
-            input_values = kwargs
-            for key, ceph_type in validations:
-                try:
-                    ceph_type.valid(input_values[key])
-                except ArgumentFormat as e:
-                    raise DashboardException(msg=e,
-                                             code='ceph_type_not_valid',
-                                             component=component)
-            return func(*args, **kwargs)
-        return validate_args
-    return decorator
+from ._api_router import APIRouter
+from ._auth import ControllerAuthMixin
+from ._base_controller import BaseController
+from ._docs import APIDoc, EndpointDoc
+from ._endpoint import Endpoint, Proxy
+from ._helpers import ENDPOINT_MAP, allow_empty_body, \
+    generate_controller_routes, json_error_page, validate_ceph_type
+from ._permissions import CreatePermission, DeletePermission, ReadPermission, UpdatePermission
+from ._rest_controller import RESTController
+from ._router import Router
+from ._task import Task
+from ._ui_router import UIRouter
+
+__all__ = [
+    'BaseController',
+    'RESTController',
+    'Router',
+    'UIRouter',
+    'APIRouter',
+    'Endpoint',
+    'Proxy',
+    'Task',
+    'ControllerAuthMixin',
+    'EndpointDoc',
+    'APIDoc',
+    'allow_empty_body',
+    'ENDPOINT_MAP',
+    'generate_controller_routes',
+    'json_error_page',
+    'validate_ceph_type',
+    'CreatePermission',
+    'ReadPermission',
+    'UpdatePermission',
+    'DeletePermission'
+]
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_api_router.py b/ceph/src/pybind/mgr/dashboard/controllers/_api_router.py
new file mode 100644 (file)
index 0000000..dbd45ac
--- /dev/null
@@ -0,0 +1,13 @@
+from ._router import Router
+
+
+class APIRouter(Router):
+    def __init__(self, path, security_scope=None, secure=True):
+        super().__init__(path, base_url="/api",
+                         security_scope=security_scope,
+                         secure=secure)
+
+    def __call__(self, cls):
+        cls = super().__call__(cls)
+        cls._api_endpoint = True
+        return cls
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_auth.py b/ceph/src/pybind/mgr/dashboard/controllers/_auth.py
new file mode 100644 (file)
index 0000000..0015a75
--- /dev/null
@@ -0,0 +1,18 @@
+import cherrypy
+
+
+class ControllerAuthMixin:
+    @staticmethod
+    def _delete_token_cookie(token):
+        cherrypy.response.cookie['token'] = token
+        cherrypy.response.cookie['token']['expires'] = 0
+        cherrypy.response.cookie['token']['max-age'] = 0
+
+    @staticmethod
+    def _set_token_cookie(url_prefix, token):
+        cherrypy.response.cookie['token'] = token
+        if url_prefix == 'https':
+            cherrypy.response.cookie['token']['secure'] = True
+        cherrypy.response.cookie['token']['HttpOnly'] = True
+        cherrypy.response.cookie['token']['path'] = '/'
+        cherrypy.response.cookie['token']['SameSite'] = 'Strict'
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_base_controller.py b/ceph/src/pybind/mgr/dashboard/controllers/_base_controller.py
new file mode 100644 (file)
index 0000000..4fcc844
--- /dev/null
@@ -0,0 +1,314 @@
+import inspect
+import json
+import logging
+from functools import wraps
+from typing import ClassVar, List, Optional, Type
+from urllib.parse import unquote
+
+import cherrypy
+
+from ..plugins import PLUGIN_MANAGER
+from ..services.auth import AuthManager, JwtManager
+from ..tools import get_request_body_params
+from ._helpers import _get_function_params
+from ._version import APIVersion
+
+logger = logging.getLogger(__name__)
+
+
+class BaseController:
+    """
+    Base class for all controllers providing API endpoints.
+    """
+
+    _registry: ClassVar[List[Type['BaseController']]] = []
+    _routed = False
+
+    def __init_subclass__(cls, skip_registry: bool = False, **kwargs) -> None:
+        super().__init_subclass__(**kwargs)  # type: ignore
+        if not skip_registry:
+            BaseController._registry.append(cls)
+
+    @classmethod
+    def load_controllers(cls):
+        import importlib
+        from pathlib import Path
+
+        path = Path(__file__).parent
+        logger.debug('Controller import path: %s', path)
+        modules = [
+            f.stem for f in path.glob('*.py') if
+            not f.name.startswith('_') and f.is_file() and not f.is_symlink()]
+        logger.debug('Controller files found: %r', modules)
+
+        for module in modules:
+            importlib.import_module(f'{__package__}.{module}')
+
+        # pylint: disable=protected-access
+        controllers = [
+            controller for controller in BaseController._registry if
+            controller._routed
+        ]
+
+        for clist in PLUGIN_MANAGER.hook.get_controllers() or []:
+            controllers.extend(clist)
+
+        return controllers
+
+    class Endpoint:
+        """
+        An instance of this class represents an endpoint.
+        """
+
+        def __init__(self, ctrl, func):
+            self.ctrl = ctrl
+            self.inst = None
+            self.func = func
+
+            if not self.config['proxy']:
+                setattr(self.ctrl, func.__name__, self.function)
+
+        @property
+        def config(self):
+            func = self.func
+            while not hasattr(func, '_endpoint'):
+                if hasattr(func, "__wrapped__"):
+                    func = func.__wrapped__
+                else:
+                    return None
+            return func._endpoint  # pylint: disable=protected-access
+
+        @property
+        def function(self):
+            # pylint: disable=protected-access
+            return self.ctrl._request_wrapper(self.func, self.method,
+                                              self.config['json_response'],
+                                              self.config['xml'],
+                                              self.config['version'])
+
+        @property
+        def method(self):
+            return self.config['method']
+
+        @property
+        def proxy(self):
+            return self.config['proxy']
+
+        @property
+        def url(self):
+            ctrl_path = self.ctrl.get_path()
+            if ctrl_path == "/":
+                ctrl_path = ""
+            if self.config['path'] is not None:
+                url = "{}{}".format(ctrl_path, self.config['path'])
+            else:
+                url = "{}/{}".format(ctrl_path, self.func.__name__)
+
+            ctrl_path_params = self.ctrl.get_path_param_names(
+                self.config['path'])
+            path_params = [p['name'] for p in self.path_params
+                           if p['name'] not in ctrl_path_params]
+            path_params = ["{{{}}}".format(p) for p in path_params]
+            if path_params:
+                url += "/{}".format("/".join(path_params))
+
+            return url
+
+        @property
+        def action(self):
+            return self.func.__name__
+
+        @property
+        def path_params(self):
+            ctrl_path_params = self.ctrl.get_path_param_names(
+                self.config['path'])
+            func_params = _get_function_params(self.func)
+
+            if self.method in ['GET', 'DELETE']:
+                assert self.config['path_params'] is None
+
+                return [p for p in func_params if p['name'] in ctrl_path_params
+                        or (p['name'] not in self.config['query_params']
+                            and p['required'])]
+
+            # elif self.method in ['POST', 'PUT']:
+            return [p for p in func_params if p['name'] in ctrl_path_params
+                    or p['name'] in self.config['path_params']]
+
+        @property
+        def query_params(self):
+            if self.method in ['GET', 'DELETE']:
+                func_params = _get_function_params(self.func)
+                path_params = [p['name'] for p in self.path_params]
+                return [p for p in func_params if p['name'] not in path_params]
+
+            # elif self.method in ['POST', 'PUT']:
+            func_params = _get_function_params(self.func)
+            return [p for p in func_params
+                    if p['name'] in self.config['query_params']]
+
+        @property
+        def body_params(self):
+            func_params = _get_function_params(self.func)
+            path_params = [p['name'] for p in self.path_params]
+            query_params = [p['name'] for p in self.query_params]
+            return [p for p in func_params
+                    if p['name'] not in path_params
+                    and p['name'] not in query_params]
+
+        @property
+        def group(self):
+            return self.ctrl.__name__
+
+        @property
+        def is_api(self):
+            # changed from hasattr to getattr: some ui-based api inherit _api_endpoint
+            return getattr(self.ctrl, '_api_endpoint', False)
+
+        @property
+        def is_secure(self):
+            return self.ctrl._cp_config['tools.authenticate.on']  # pylint: disable=protected-access
+
+        def __repr__(self):
+            return "Endpoint({}, {}, {})".format(self.url, self.method,
+                                                 self.action)
+
+    def __init__(self):
+        logger.info('Initializing controller: %s -> %s',
+                    self.__class__.__name__, self._cp_path_)  # type: ignore
+        super().__init__()
+
+    def _has_permissions(self, permissions, scope=None):
+        if not self._cp_config['tools.authenticate.on']:  # type: ignore
+            raise Exception("Cannot verify permission in non secured "
+                            "controllers")
+
+        if not isinstance(permissions, list):
+            permissions = [permissions]
+
+        if scope is None:
+            scope = getattr(self, '_security_scope', None)
+        if scope is None:
+            raise Exception("Cannot verify permissions without scope security"
+                            " defined")
+        username = JwtManager.LOCAL_USER.username
+        return AuthManager.authorize(username, scope, permissions)
+
+    @classmethod
+    def get_path_param_names(cls, path_extension=None):
+        if path_extension is None:
+            path_extension = ""
+        full_path = cls._cp_path_[1:] + path_extension  # type: ignore
+        path_params = []
+        for step in full_path.split('/'):
+            param = None
+            if not step:
+                continue
+            if step[0] == ':':
+                param = step[1:]
+            elif step[0] == '{' and step[-1] == '}':
+                param, _, _ = step[1:-1].partition(':')
+            if param:
+                path_params.append(param)
+        return path_params
+
+    @classmethod
+    def get_path(cls):
+        return cls._cp_path_  # type: ignore
+
+    @classmethod
+    def endpoints(cls):
+        """
+        This method iterates over all the methods decorated with ``@endpoint``
+        and creates an Endpoint object for each one of the methods.
+
+        :return: A list of endpoint objects
+        :rtype: list[BaseController.Endpoint]
+        """
+        result = []
+        for _, func in inspect.getmembers(cls, predicate=callable):
+            if hasattr(func, '_endpoint'):
+                result.append(cls.Endpoint(cls, func))
+        return result
+
+    @staticmethod
+    def _request_wrapper(func, method, json_response, xml,  # pylint: disable=unused-argument
+                         version: Optional[APIVersion]):
+        # pylint: disable=too-many-branches
+        @wraps(func)
+        def inner(*args, **kwargs):
+            client_version = None
+            for key, value in kwargs.items():
+                if isinstance(value, str):
+                    kwargs[key] = unquote(value)
+
+            # Process method arguments.
+            params = get_request_body_params(cherrypy.request)
+            kwargs.update(params)
+
+            if version is not None:
+                try:
+                    client_version = APIVersion.from_mime_type(
+                        cherrypy.request.headers['Accept'])
+                except Exception:
+                    raise cherrypy.HTTPError(
+                        415, "Unable to find version in request header")
+
+                if version.supports(client_version):
+                    ret = func(*args, **kwargs)
+                else:
+                    raise cherrypy.HTTPError(
+                        415,
+                        f"Incorrect version: endpoint is '{version!s}', "
+                        f"client requested '{client_version!s}'"
+                    )
+
+            else:
+                ret = func(*args, **kwargs)
+            if isinstance(ret, bytes):
+                ret = ret.decode('utf-8')
+            if xml:
+                if version:
+                    cherrypy.response.headers['Content-Type'] = \
+                        'application/vnd.ceph.api.v{}+xml'.format(version)
+                else:
+                    cherrypy.response.headers['Content-Type'] = 'application/xml'
+                return ret.encode('utf8')
+            if json_response:
+                if version:
+                    cherrypy.response.headers['Content-Type'] = \
+                        'application/vnd.ceph.api.v{}+json'.format(version)
+                else:
+                    cherrypy.response.headers['Content-Type'] = 'application/json'
+                ret = json.dumps(ret).encode('utf8')
+            return ret
+        return inner
+
+    @property
+    def _request(self):
+        return self.Request(cherrypy.request)
+
+    class Request(object):
+        def __init__(self, cherrypy_req):
+            self._creq = cherrypy_req
+
+        @property
+        def scheme(self):
+            return self._creq.scheme
+
+        @property
+        def host(self):
+            base = self._creq.base
+            base = base[len(self.scheme)+3:]
+            return base[:base.find(":")] if ":" in base else base
+
+        @property
+        def port(self):
+            base = self._creq.base
+            base = base[len(self.scheme)+3:]
+            default_port = 443 if self.scheme == 'https' else 80
+            return int(base[base.find(":")+1:]) if ":" in base else default_port
+
+        @property
+        def path_info(self):
+            return self._creq.path_info
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_docs.py b/ceph/src/pybind/mgr/dashboard/controllers/_docs.py
new file mode 100644 (file)
index 0000000..5bd7a5a
--- /dev/null
@@ -0,0 +1,128 @@
+from typing import Any, Dict, List, Optional, Tuple, Union
+
+from ..api.doc import SchemaInput, SchemaType
+
+
+class EndpointDoc:  # noqa: N802
+    DICT_TYPE = Union[Dict[str, Any], Dict[int, Any]]
+
+    def __init__(self, description: str = "", group: str = "",
+                 parameters: Optional[Union[DICT_TYPE, List[Any], Tuple[Any, ...]]] = None,
+                 responses: Optional[DICT_TYPE] = None) -> None:
+        self.description = description
+        self.group = group
+        self.parameters = parameters
+        self.responses = responses
+
+        self.validate_args()
+
+        if not self.parameters:
+            self.parameters = {}  # type: ignore
+
+        self.resp = {}
+        if self.responses:
+            for status_code, response_body in self.responses.items():
+                schema_input = SchemaInput()
+                schema_input.type = SchemaType.ARRAY if \
+                    isinstance(response_body, list) else SchemaType.OBJECT
+                schema_input.params = self._split_parameters(response_body)
+
+                self.resp[str(status_code)] = schema_input
+
+    def validate_args(self) -> None:
+        if not isinstance(self.description, str):
+            raise Exception("%s has been called with a description that is not a string: %s"
+                            % (EndpointDoc.__name__, self.description))
+        if not isinstance(self.group, str):
+            raise Exception("%s has been called with a groupname that is not a string: %s"
+                            % (EndpointDoc.__name__, self.group))
+        if self.parameters and not isinstance(self.parameters, dict):
+            raise Exception("%s has been called with parameters that is not a dict: %s"
+                            % (EndpointDoc.__name__, self.parameters))
+        if self.responses and not isinstance(self.responses, dict):
+            raise Exception("%s has been called with responses that is not a dict: %s"
+                            % (EndpointDoc.__name__, self.responses))
+
+    def _split_param(self, name: str, p_type: Union[type, DICT_TYPE, List[Any], Tuple[Any, ...]],
+                     description: str, optional: bool = False, default_value: Any = None,
+                     nested: bool = False) -> Dict[str, Any]:
+        param = {
+            'name': name,
+            'description': description,
+            'required': not optional,
+            'nested': nested,
+        }
+        if default_value:
+            param['default'] = default_value
+        if isinstance(p_type, type):
+            param['type'] = p_type
+        else:
+            nested_params = self._split_parameters(p_type, nested=True)
+            if nested_params:
+                param['type'] = type(p_type)
+                param['nested_params'] = nested_params
+            else:
+                param['type'] = p_type
+        return param
+
+    #  Optional must be set to True in order to set default value and parameters format must be:
+    # 'name: (type or nested parameters, description, [optional], [default value])'
+    def _split_dict(self, data: DICT_TYPE, nested: bool) -> List[Any]:
+        splitted = []
+        for name, props in data.items():
+            if isinstance(name, str) and isinstance(props, tuple):
+                if len(props) == 2:
+                    param = self._split_param(name, props[0], props[1], nested=nested)
+                elif len(props) == 3:
+                    param = self._split_param(
+                        name, props[0], props[1], optional=props[2], nested=nested)
+                if len(props) == 4:
+                    param = self._split_param(name, props[0], props[1], props[2], props[3], nested)
+                splitted.append(param)
+            else:
+                raise Exception(
+                    """Parameter %s in %s has not correct format. Valid formats are:
+                    <name>: (<type>, <description>, [optional], [default value])
+                    <name>: (<[type]>, <description>, [optional], [default value])
+                    <name>: (<[nested parameters]>, <description>, [optional], [default value])
+                    <name>: (<{nested parameters}>, <description>, [optional], [default value])"""
+                    % (name, EndpointDoc.__name__))
+        return splitted
+
+    def _split_list(self, data: Union[List[Any], Tuple[Any, ...]], nested: bool) -> List[Any]:
+        splitted = []  # type: List[Any]
+        for item in data:
+            splitted.extend(self._split_parameters(item, nested))
+        return splitted
+
+    # nested = True means parameters are inside a dict or array
+    def _split_parameters(self, data: Optional[Union[DICT_TYPE, List[Any], Tuple[Any, ...]]],
+                          nested: bool = False) -> List[Any]:
+        param_list = []  # type: List[Any]
+        if isinstance(data, dict):
+            param_list.extend(self._split_dict(data, nested))
+        elif isinstance(data, (list, tuple)):
+            param_list.extend(self._split_list(data, True))
+        return param_list
+
+    def __call__(self, func: Any) -> Any:
+        func.doc_info = {
+            'summary': self.description,
+            'tag': self.group,
+            'parameters': self._split_parameters(self.parameters),
+            'response': self.resp
+        }
+        return func
+
+
+class APIDoc(object):
+    def __init__(self, description="", group=""):
+        self.tag = group
+        self.tag_descr = description
+
+    def __call__(self, cls):
+        cls.doc_info = {
+            'tag': self.tag,
+            'tag_descr': self.tag_descr
+        }
+        return cls
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_endpoint.py b/ceph/src/pybind/mgr/dashboard/controllers/_endpoint.py
new file mode 100644 (file)
index 0000000..fccab89
--- /dev/null
@@ -0,0 +1,82 @@
+from typing import Optional
+
+from ._helpers import _get_function_params
+from ._version import APIVersion
+
+
+class Endpoint:
+
+    def __init__(self, method=None, path=None, path_params=None, query_params=None,  # noqa: N802
+                 json_response=True, proxy=False, xml=False,
+                 version: Optional[APIVersion] = APIVersion.DEFAULT):
+        if method is None:
+            method = 'GET'
+        elif not isinstance(method, str) or \
+                method.upper() not in ['GET', 'POST', 'DELETE', 'PUT']:
+            raise TypeError("Possible values for method are: 'GET', 'POST', "
+                            "'DELETE', or 'PUT'")
+
+        method = method.upper()
+
+        if method in ['GET', 'DELETE']:
+            if path_params is not None:
+                raise TypeError("path_params should not be used for {} "
+                                "endpoints. All function params are considered"
+                                " path parameters by default".format(method))
+
+        if path_params is None:
+            if method in ['POST', 'PUT']:
+                path_params = []
+
+        if query_params is None:
+            query_params = []
+
+        self.method = method
+        self.path = path
+        self.path_params = path_params
+        self.query_params = query_params
+        self.json_response = json_response
+        self.proxy = proxy
+        self.xml = xml
+        self.version = version
+
+    def __call__(self, func):
+        if self.method in ['POST', 'PUT']:
+            func_params = _get_function_params(func)
+            for param in func_params:
+                if param['name'] in self.path_params and not param['required']:
+                    raise TypeError("path_params can only reference "
+                                    "non-optional function parameters")
+
+        if func.__name__ == '__call__' and self.path is None:
+            e_path = ""
+        else:
+            e_path = self.path
+
+        if e_path is not None:
+            e_path = e_path.strip()
+            if e_path and e_path[0] != "/":
+                e_path = "/" + e_path
+            elif e_path == "/":
+                e_path = ""
+
+        func._endpoint = {
+            'method': self.method,
+            'path': e_path,
+            'path_params': self.path_params,
+            'query_params': self.query_params,
+            'json_response': self.json_response,
+            'proxy': self.proxy,
+            'xml': self.xml,
+            'version': self.version
+        }
+        return func
+
+
+def Proxy(path=None):  # noqa: N802
+    if path is None:
+        path = ""
+    elif path == "/":
+        path = ""
+    path += "/{path:.*}"
+    return Endpoint(path=path, proxy=True)
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_helpers.py b/ceph/src/pybind/mgr/dashboard/controllers/_helpers.py
new file mode 100644 (file)
index 0000000..5ec49ee
--- /dev/null
@@ -0,0 +1,127 @@
+import collections
+import json
+import logging
+import re
+from functools import wraps
+
+import cherrypy
+from ceph_argparse import ArgumentFormat  # pylint: disable=import-error
+
+from ..exceptions import DashboardException
+from ..tools import getargspec
+
+logger = logging.getLogger(__name__)
+
+
+ENDPOINT_MAP = collections.defaultdict(list)  # type: dict
+
+
+def _get_function_params(func):
+    """
+    Retrieves the list of parameters declared in function.
+    Each parameter is represented as dict with keys:
+      * name (str): the name of the parameter
+      * required (bool): whether the parameter is required or not
+      * default (obj): the parameter's default value
+    """
+    fspec = getargspec(func)
+
+    func_params = []
+    nd = len(fspec.args) if not fspec.defaults else -len(fspec.defaults)
+    for param in fspec.args[1:nd]:
+        func_params.append({'name': param, 'required': True})
+
+    if fspec.defaults:
+        for param, val in zip(fspec.args[nd:], fspec.defaults):
+            func_params.append({
+                'name': param,
+                'required': False,
+                'default': val
+            })
+
+    return func_params
+
+
+def generate_controller_routes(endpoint, mapper, base_url):
+    inst = endpoint.inst
+    ctrl_class = endpoint.ctrl
+
+    if endpoint.proxy:
+        conditions = None
+    else:
+        conditions = dict(method=[endpoint.method])
+
+    # base_url can be empty or a URL path that starts with "/"
+    # we will remove the trailing "/" if exists to help with the
+    # concatenation with the endpoint url below
+    if base_url.endswith("/"):
+        base_url = base_url[:-1]
+
+    endp_url = endpoint.url
+
+    if endp_url.find("/", 1) == -1:
+        parent_url = "{}{}".format(base_url, endp_url)
+    else:
+        parent_url = "{}{}".format(base_url, endp_url[:endp_url.find("/", 1)])
+
+    # parent_url might be of the form "/.../{...}" where "{...}" is a path parameter
+    # we need to remove the path parameter definition
+    parent_url = re.sub(r'(?:/\{[^}]+\})$', '', parent_url)
+    if not parent_url:  # root path case
+        parent_url = "/"
+
+    url = "{}{}".format(base_url, endp_url)
+
+    logger.debug("Mapped [%s] to %s:%s restricted to %s",
+                 url, ctrl_class.__name__, endpoint.action,
+                 endpoint.method)
+
+    ENDPOINT_MAP[endpoint.url].append(endpoint)
+
+    name = ctrl_class.__name__ + ":" + endpoint.action
+    mapper.connect(name, url, controller=inst, action=endpoint.action,
+                   conditions=conditions)
+
+    # adding route with trailing slash
+    name += "/"
+    url += "/"
+    mapper.connect(name, url, controller=inst, action=endpoint.action,
+                   conditions=conditions)
+
+    return parent_url
+
+
+def json_error_page(status, message, traceback, version):
+    cherrypy.response.headers['Content-Type'] = 'application/json'
+    return json.dumps(dict(status=status, detail=message, traceback=traceback,
+                           version=version))
+
+
+def allow_empty_body(func):  # noqa: N802
+    """
+    The POST/PUT request methods decorated with ``@allow_empty_body``
+    are allowed to send empty request body.
+    """
+    # pylint: disable=protected-access
+    try:
+        func._cp_config['tools.json_in.force'] = False
+    except (AttributeError, KeyError):
+        func._cp_config = {'tools.json_in.force': False}
+    return func
+
+
+def validate_ceph_type(validations, component=''):
+    def decorator(func):
+        @wraps(func)
+        def validate_args(*args, **kwargs):
+            input_values = kwargs
+            for key, ceph_type in validations:
+                try:
+                    ceph_type.valid(input_values[key])
+                except ArgumentFormat as e:
+                    raise DashboardException(msg=e,
+                                             code='ceph_type_not_valid',
+                                             component=component)
+            return func(*args, **kwargs)
+        return validate_args
+    return decorator
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_permissions.py b/ceph/src/pybind/mgr/dashboard/controllers/_permissions.py
new file mode 100644 (file)
index 0000000..eb190c9
--- /dev/null
@@ -0,0 +1,60 @@
+"""
+Role-based access permissions decorators
+"""
+import logging
+
+from ..exceptions import PermissionNotValid
+from ..security import Permission
+
+logger = logging.getLogger(__name__)
+
+
+def _set_func_permissions(func, permissions):
+    if not isinstance(permissions, list):
+        permissions = [permissions]
+
+    for perm in permissions:
+        if not Permission.valid_permission(perm):
+            logger.debug("Invalid security permission: %s\n "
+                         "Possible values: %s", perm,
+                         Permission.all_permissions())
+            raise PermissionNotValid(perm)
+
+    # pylint: disable=protected-access
+    if not hasattr(func, '_security_permissions'):
+        func._security_permissions = permissions
+    else:
+        permissions.extend(func._security_permissions)
+        func._security_permissions = list(set(permissions))
+
+
+def ReadPermission(func):  # noqa: N802
+    """
+    :raises PermissionNotValid: If the permission is missing.
+    """
+    _set_func_permissions(func, Permission.READ)
+    return func
+
+
+def CreatePermission(func):  # noqa: N802
+    """
+    :raises PermissionNotValid: If the permission is missing.
+    """
+    _set_func_permissions(func, Permission.CREATE)
+    return func
+
+
+def DeletePermission(func):  # noqa: N802
+    """
+    :raises PermissionNotValid: If the permission is missing.
+    """
+    _set_func_permissions(func, Permission.DELETE)
+    return func
+
+
+def UpdatePermission(func):  # noqa: N802
+    """
+    :raises PermissionNotValid: If the permission is missing.
+    """
+    _set_func_permissions(func, Permission.UPDATE)
+    return func
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_rest_controller.py b/ceph/src/pybind/mgr/dashboard/controllers/_rest_controller.py
new file mode 100644 (file)
index 0000000..03e124f
--- /dev/null
@@ -0,0 +1,249 @@
+import collections
+import inspect
+from functools import wraps
+from typing import Optional
+
+import cherrypy
+
+from ..security import Permission
+from ._base_controller import BaseController
+from ._endpoint import Endpoint
+from ._helpers import _get_function_params
+from ._permissions import _set_func_permissions
+from ._version import APIVersion
+
+
+class RESTController(BaseController, skip_registry=True):
+    """
+    Base class for providing a RESTful interface to a resource.
+
+    To use this class, simply derive a class from it and implement the methods
+    you want to support.  The list of possible methods are:
+
+    * list()
+    * bulk_set(data)
+    * create(data)
+    * bulk_delete()
+    * get(key)
+    * set(data, key)
+    * singleton_set(data)
+    * delete(key)
+
+    Test with curl:
+
+    curl -H "Content-Type: application/json" -X POST \
+         -d '{"username":"xyz","password":"xyz"}'  https://127.0.0.1:8443/foo
+    curl https://127.0.0.1:8443/foo
+    curl https://127.0.0.1:8443/foo/0
+
+    """
+
+    # resource id parameter for using in get, set, and delete methods
+    # should be overridden by subclasses.
+    # to specify a composite id (two parameters) use '/'. e.g., "param1/param2".
+    # If subclasses don't override this property we try to infer the structure
+    # of the resource ID.
+    RESOURCE_ID: Optional[str] = None
+
+    _permission_map = {
+        'GET': Permission.READ,
+        'POST': Permission.CREATE,
+        'PUT': Permission.UPDATE,
+        'DELETE': Permission.DELETE
+    }
+
+    _method_mapping = collections.OrderedDict([
+        ('list', {'method': 'GET', 'resource': False, 'status': 200, 'version': APIVersion.DEFAULT}),  # noqa E501 #pylint: disable=line-too-long
+        ('create', {'method': 'POST', 'resource': False, 'status': 201, 'version': APIVersion.DEFAULT}),  # noqa E501 #pylint: disable=line-too-long
+        ('bulk_set', {'method': 'PUT', 'resource': False, 'status': 200, 'version': APIVersion.DEFAULT}),  # noqa E501 #pylint: disable=line-too-long
+        ('bulk_delete', {'method': 'DELETE', 'resource': False, 'status': 204, 'version': APIVersion.DEFAULT}),  # noqa E501 #pylint: disable=line-too-long
+        ('get', {'method': 'GET', 'resource': True, 'status': 200, 'version': APIVersion.DEFAULT}),
+        ('delete', {'method': 'DELETE', 'resource': True, 'status': 204, 'version': APIVersion.DEFAULT}),  # noqa E501 #pylint: disable=line-too-long
+        ('set', {'method': 'PUT', 'resource': True, 'status': 200, 'version': APIVersion.DEFAULT}),
+        ('singleton_set', {'method': 'PUT', 'resource': False, 'status': 200, 'version': APIVersion.DEFAULT})  # noqa E501 #pylint: disable=line-too-long
+    ])
+
+    @classmethod
+    def infer_resource_id(cls):
+        if cls.RESOURCE_ID is not None:
+            return cls.RESOURCE_ID.split('/')
+        for k, v in cls._method_mapping.items():
+            func = getattr(cls, k, None)
+            while hasattr(func, "__wrapped__"):
+                func = func.__wrapped__
+            if v['resource'] and func:
+                path_params = cls.get_path_param_names()
+                params = _get_function_params(func)
+                return [p['name'] for p in params
+                        if p['required'] and p['name'] not in path_params]
+        return None
+
+    @classmethod
+    def endpoints(cls):
+        result = super().endpoints()
+        res_id_params = cls.infer_resource_id()
+
+        for _, func in inspect.getmembers(cls, predicate=callable):
+            endpoint_params = {
+                'no_resource_id_params': False,
+                'status': 200,
+                'method': None,
+                'query_params': None,
+                'path': '',
+                'version': APIVersion.DEFAULT,
+                'sec_permissions': hasattr(func, '_security_permissions'),
+                'permission': None,
+            }
+
+            if func.__name__ in cls._method_mapping:
+                cls._update_endpoint_params_method_map(
+                    func, res_id_params, endpoint_params)
+
+            elif hasattr(func, "__collection_method__"):
+                cls._update_endpoint_params_collection_map(func, endpoint_params)
+
+            elif hasattr(func, "__resource_method__"):
+                cls._update_endpoint_params_resource_method(
+                    res_id_params, endpoint_params, func)
+
+            else:
+                continue
+
+            if endpoint_params['no_resource_id_params']:
+                raise TypeError("Could not infer the resource ID parameters for"
+                                " method {} of controller {}. "
+                                "Please specify the resource ID parameters "
+                                "using the RESOURCE_ID class property"
+                                .format(func.__name__, cls.__name__))
+
+            if endpoint_params['method'] in ['GET', 'DELETE']:
+                params = _get_function_params(func)
+                if res_id_params is None:
+                    res_id_params = []
+                if endpoint_params['query_params'] is None:
+                    endpoint_params['query_params'] = [p['name'] for p in params  # type: ignore
+                                                       if p['name'] not in res_id_params]
+
+            func = cls._status_code_wrapper(func, endpoint_params['status'])
+            endp_func = Endpoint(endpoint_params['method'], path=endpoint_params['path'],
+                                 query_params=endpoint_params['query_params'],
+                                 version=endpoint_params['version'])(func)  # type: ignore
+            if endpoint_params['permission']:
+                _set_func_permissions(endp_func, [endpoint_params['permission']])
+            result.append(cls.Endpoint(cls, endp_func))
+
+        return result
+
+    @classmethod
+    def _update_endpoint_params_resource_method(cls, res_id_params, endpoint_params, func):
+        if not res_id_params:
+            endpoint_params['no_resource_id_params'] = True
+        else:
+            path_params = ["{{{}}}".format(p) for p in res_id_params]
+            endpoint_params['path'] += "/{}".format("/".join(path_params))
+            if func.__resource_method__['path']:
+                endpoint_params['path'] += func.__resource_method__['path']
+            else:
+                endpoint_params['path'] += "/{}".format(func.__name__)
+        endpoint_params['status'] = func.__resource_method__['status']
+        endpoint_params['method'] = func.__resource_method__['method']
+        endpoint_params['version'] = func.__resource_method__['version']
+        endpoint_params['query_params'] = func.__resource_method__['query_params']
+        if not endpoint_params['sec_permissions']:
+            endpoint_params['permission'] = cls._permission_map[endpoint_params['method']]
+
+    @classmethod
+    def _update_endpoint_params_collection_map(cls, func, endpoint_params):
+        if func.__collection_method__['path']:
+            endpoint_params['path'] = func.__collection_method__['path']
+        else:
+            endpoint_params['path'] = "/{}".format(func.__name__)
+        endpoint_params['status'] = func.__collection_method__['status']
+        endpoint_params['method'] = func.__collection_method__['method']
+        endpoint_params['query_params'] = func.__collection_method__['query_params']
+        endpoint_params['version'] = func.__collection_method__['version']
+        if not endpoint_params['sec_permissions']:
+            endpoint_params['permission'] = cls._permission_map[endpoint_params['method']]
+
+    @classmethod
+    def _update_endpoint_params_method_map(cls, func, res_id_params, endpoint_params):
+        meth = cls._method_mapping[func.__name__]  # type: dict
+
+        if meth['resource']:
+            if not res_id_params:
+                endpoint_params['no_resource_id_params'] = True
+            else:
+                path_params = ["{{{}}}".format(p) for p in res_id_params]
+                endpoint_params['path'] += "/{}".format("/".join(path_params))
+
+        endpoint_params['status'] = meth['status']
+        endpoint_params['method'] = meth['method']
+        if hasattr(func, "__method_map_method__"):
+            endpoint_params['version'] = func.__method_map_method__['version']
+        if not endpoint_params['sec_permissions']:
+            endpoint_params['permission'] = cls._permission_map[endpoint_params['method']]
+
+    @classmethod
+    def _status_code_wrapper(cls, func, status_code):
+        @wraps(func)
+        def wrapper(*vpath, **params):
+            cherrypy.response.status = status_code
+            return func(*vpath, **params)
+
+        return wrapper
+
+    @staticmethod
+    def Resource(method=None, path=None, status=None, query_params=None,  # noqa: N802
+                 version: Optional[APIVersion] = APIVersion.DEFAULT):
+        if not method:
+            method = 'GET'
+
+        if status is None:
+            status = 200
+
+        def _wrapper(func):
+            func.__resource_method__ = {
+                'method': method,
+                'path': path,
+                'status': status,
+                'query_params': query_params,
+                'version': version
+            }
+            return func
+        return _wrapper
+
+    @staticmethod
+    def MethodMap(resource=False, status=None,
+                  version: Optional[APIVersion] = APIVersion.DEFAULT):  # noqa: N802
+
+        if status is None:
+            status = 200
+
+        def _wrapper(func):
+            func.__method_map_method__ = {
+                'resource': resource,
+                'status': status,
+                'version': version
+            }
+            return func
+        return _wrapper
+
+    @staticmethod
+    def Collection(method=None, path=None, status=None, query_params=None,  # noqa: N802
+                   version: Optional[APIVersion] = APIVersion.DEFAULT):
+        if not method:
+            method = 'GET'
+
+        if status is None:
+            status = 200
+
+        def _wrapper(func):
+            func.__collection_method__ = {
+                'method': method,
+                'path': path,
+                'status': status,
+                'query_params': query_params,
+                'version': version
+            }
+            return func
+        return _wrapper
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_router.py b/ceph/src/pybind/mgr/dashboard/controllers/_router.py
new file mode 100644 (file)
index 0000000..ad67532
--- /dev/null
@@ -0,0 +1,69 @@
+import logging
+
+import cherrypy
+
+from ..exceptions import ScopeNotValid
+from ..security import Scope
+from ._base_controller import BaseController
+from ._helpers import generate_controller_routes
+
+logger = logging.getLogger(__name__)
+
+
+class Router(object):
+    def __init__(self, path, base_url=None, security_scope=None, secure=True):
+        if security_scope and not Scope.valid_scope(security_scope):
+            raise ScopeNotValid(security_scope)
+        self.path = path
+        self.base_url = base_url
+        self.security_scope = security_scope
+        self.secure = secure
+
+        if self.path and self.path[0] != "/":
+            self.path = "/" + self.path
+
+        if self.base_url is None:
+            self.base_url = ""
+        elif self.base_url == "/":
+            self.base_url = ""
+
+        if self.base_url == "" and self.path == "":
+            self.base_url = "/"
+
+    def __call__(self, cls):
+        cls._routed = True
+        cls._cp_path_ = "{}{}".format(self.base_url, self.path)
+        cls._security_scope = self.security_scope
+
+        config = {
+            'tools.dashboard_exception_handler.on': True,
+            'tools.authenticate.on': self.secure,
+        }
+        if not hasattr(cls, '_cp_config'):
+            cls._cp_config = {}
+        cls._cp_config.update(config)
+        return cls
+
+    @classmethod
+    def generate_routes(cls, url_prefix):
+        controllers = BaseController.load_controllers()
+        logger.debug("controllers=%r", controllers)
+
+        mapper = cherrypy.dispatch.RoutesDispatcher()
+
+        parent_urls = set()
+
+        endpoint_list = []
+        for ctrl in controllers:
+            inst = ctrl()
+            for endpoint in ctrl.endpoints():
+                endpoint.inst = inst
+                endpoint_list.append(endpoint)
+
+        endpoint_list = sorted(endpoint_list, key=lambda e: e.url)
+        for endpoint in endpoint_list:
+            parent_urls.add(generate_controller_routes(endpoint, mapper,
+                                                       "{}".format(url_prefix)))
+
+        logger.debug("list of parent paths: %s", parent_urls)
+        return mapper, parent_urls
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_task.py b/ceph/src/pybind/mgr/dashboard/controllers/_task.py
new file mode 100644 (file)
index 0000000..33399e8
--- /dev/null
@@ -0,0 +1,79 @@
+from functools import wraps
+
+import cherrypy
+
+from ..tools import TaskManager
+from ._helpers import _get_function_params
+
+
+class Task:
+    def __init__(self, name, metadata, wait_for=5.0, exception_handler=None):
+        self.name = name
+        if isinstance(metadata, list):
+            self.metadata = {e[1:-1]: e for e in metadata}
+        else:
+            self.metadata = metadata
+        self.wait_for = wait_for
+        self.exception_handler = exception_handler
+
+    def _gen_arg_map(self, func, args, kwargs):
+        arg_map = {}
+        params = _get_function_params(func)
+
+        args = args[1:]  # exclude self
+        for idx, param in enumerate(params):
+            if idx < len(args):
+                arg_map[param['name']] = args[idx]
+            else:
+                if param['name'] in kwargs:
+                    arg_map[param['name']] = kwargs[param['name']]
+                else:
+                    assert not param['required'], "{0} is required".format(param['name'])
+                    arg_map[param['name']] = param['default']
+
+            if param['name'] in arg_map:
+                # This is not a type error. We are using the index here.
+                arg_map[idx+1] = arg_map[param['name']]
+
+        return arg_map
+
+    def __call__(self, func):
+        @wraps(func)
+        def wrapper(*args, **kwargs):
+            arg_map = self._gen_arg_map(func, args, kwargs)
+            metadata = {}
+            for k, v in self.metadata.items():
+                if isinstance(v, str) and v and v[0] == '{' and v[-1] == '}':
+                    param = v[1:-1]
+                    try:
+                        pos = int(param)
+                        metadata[k] = arg_map[pos]
+                    except ValueError:
+                        if param.find('.') == -1:
+                            metadata[k] = arg_map[param]
+                        else:
+                            path = param.split('.')
+                            metadata[k] = arg_map[path[0]]
+                            for i in range(1, len(path)):
+                                metadata[k] = metadata[k][path[i]]
+                else:
+                    metadata[k] = v
+            task = TaskManager.run(self.name, metadata, func, args, kwargs,
+                                   exception_handler=self.exception_handler)
+            try:
+                status, value = task.wait(self.wait_for)
+            except Exception as ex:
+                if task.ret_value:
+                    # exception was handled by task.exception_handler
+                    if 'status' in task.ret_value:
+                        status = task.ret_value['status']
+                    else:
+                        status = getattr(ex, 'status', 500)
+                    cherrypy.response.status = status
+                    return task.ret_value
+                raise ex
+            if status == TaskManager.VALUE_EXECUTING:
+                cherrypy.response.status = 202
+                return {'name': self.name, 'metadata': metadata}
+            return value
+        return wrapper
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_ui_router.py b/ceph/src/pybind/mgr/dashboard/controllers/_ui_router.py
new file mode 100644 (file)
index 0000000..7454afa
--- /dev/null
@@ -0,0 +1,13 @@
+from ._router import Router
+
+
+class UIRouter(Router):
+    def __init__(self, path, security_scope=None, secure=True):
+        super().__init__(path, base_url="/ui-api",
+                         security_scope=security_scope,
+                         secure=secure)
+
+    def __call__(self, cls):
+        cls = super().__call__(cls)
+        cls._api_endpoint = False
+        return cls
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/_version.py b/ceph/src/pybind/mgr/dashboard/controllers/_version.py
new file mode 100644 (file)
index 0000000..3e7331c
--- /dev/null
@@ -0,0 +1,75 @@
+import re
+from typing import NamedTuple
+
+
+class APIVersion(NamedTuple):
+    """
+    >>> APIVersion(1,0)
+    APIVersion(major=1, minor=0)
+
+    >>> APIVersion._make([1,0])
+    APIVersion(major=1, minor=0)
+
+    >>> f'{APIVersion(1, 0)!r}'
+    'APIVersion(major=1, minor=0)'
+    """
+    major: int
+    minor: int
+
+    DEFAULT = ...  # type: ignore
+    EXPERIMENTAL = ...  # type: ignore
+    NONE = ...  # type: ignore
+
+    __MIME_TYPE_REGEX = re.compile(  # type: ignore
+        r'^application/vnd\.ceph\.api\.v(\d+\.\d+)\+json$')
+
+    @classmethod
+    def from_string(cls, version_string: str) -> 'APIVersion':
+        """
+        >>> APIVersion.from_string("1.0")
+        APIVersion(major=1, minor=0)
+        """
+        return cls._make(int(s) for s in version_string.split('.'))
+
+    @classmethod
+    def from_mime_type(cls, mime_type: str) -> 'APIVersion':
+        """
+        >>> APIVersion.from_mime_type('application/vnd.ceph.api.v1.0+json')
+        APIVersion(major=1, minor=0)
+
+        """
+        return cls.from_string(cls.__MIME_TYPE_REGEX.match(mime_type).group(1))
+
+    def __str__(self):
+        """
+        >>> f'{APIVersion(1, 0)}'
+        '1.0'
+        """
+        return f'{self.major}.{self.minor}'
+
+    def to_mime_type(self, subtype='json'):
+        """
+        >>> APIVersion(1, 0).to_mime_type(subtype='xml')
+        'application/vnd.ceph.api.v1.0+xml'
+        """
+        return f'application/vnd.ceph.api.v{self!s}+{subtype}'
+
+    def supports(self, client_version: "APIVersion") -> bool:
+        """
+        >>> APIVersion(1, 1).supports(APIVersion(1, 0))
+        True
+
+        >>> APIVersion(1, 0).supports(APIVersion(1, 1))
+        False
+
+        >>> APIVersion(2, 0).supports(APIVersion(1, 1))
+        False
+        """
+        return (self.major == client_version.major
+                and client_version.minor <= self.minor)
+
+
+# Sentinel Values
+APIVersion.DEFAULT = APIVersion(1, 0)  # type: ignore
+APIVersion.EXPERIMENTAL = APIVersion(0, 1)  # type: ignore
+APIVersion.NONE = APIVersion(0, 0)  # type: ignore
index 2e45b7c92e1840c23392c5dd37d22c9ff1350f8f..2d1290efb88caf06525d743cedcd44c6773d8852 100644 (file)
@@ -8,9 +8,9 @@ import sys
 from .. import mgr
 from ..exceptions import InvalidCredentialsError, UserDoesNotExist
 from ..services.auth import AuthManager, JwtManager
+from ..services.cluster import ClusterModel
 from ..settings import Settings
-from . import ApiController, ControllerAuthMixin, ControllerDoc, EndpointDoc, \
-    RESTController, allow_empty_body
+from . import APIDoc, APIRouter, ControllerAuthMixin, EndpointDoc, RESTController, allow_empty_body
 
 # Python 3.8 introduced `samesite` attribute:
 # https://docs.python.org/3/library/http.cookies.html#morsel-objects
@@ -29,8 +29,8 @@ AUTH_CHECK_SCHEMA = {
 }
 
 
-@ApiController('/auth', secure=False)
-@ControllerDoc("Initiate a session with Ceph", "Auth")
+@APIRouter('/auth', secure=False)
+@APIDoc("Initiate a session with Ceph", "Auth")
 class Auth(RESTController, ControllerAuthMixin):
     """
     Provide authenticates and returns JWT token.
@@ -119,4 +119,5 @@ class Auth(RESTController, ControllerAuthMixin):
                 }
         return {
             'login_url': self._get_login_url(),
+            'cluster_status': ClusterModel.from_db().dict()['status']
         }
index 0a196913c2fe7415e4d15d18ae082fb096d5a464..d32cbe4bcfab6b307b285c5e865126b5f685f884 100644 (file)
@@ -11,8 +11,7 @@ from ..security import Scope
 from ..services.ceph_service import CephService
 from ..services.cephfs import CephFS as CephFS_
 from ..tools import ViewCache
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController, \
-    UiApiController, allow_empty_body
+from . import APIDoc, APIRouter, EndpointDoc, RESTController, UIRouter, allow_empty_body
 
 GET_QUOTAS_SCHEMA = {
     'max_bytes': (int, ''),
@@ -20,11 +19,11 @@ GET_QUOTAS_SCHEMA = {
 }
 
 
-@ApiController('/cephfs', Scope.CEPHFS)
-@ControllerDoc("Cephfs Management API", "Cephfs")
+@APIRouter('/cephfs', Scope.CEPHFS)
+@APIDoc("Cephfs Management API", "Cephfs")
 class CephFS(RESTController):
     def __init__(self):  # pragma: no cover
-        super(CephFS, self).__init__()
+        super().__init__()
 
         # Stateful instances of CephFSClients, hold cached results.  Key to
         # dict is FSCID
@@ -490,8 +489,8 @@ class CephFSClients(object):
         return CephService.send_command('mds', 'session ls', srv_spec='{0}:0'.format(self.fscid))
 
 
-@UiApiController('/cephfs', Scope.CEPHFS)
-@ControllerDoc("Dashboard UI helper function; not part of the public API", "CephFSUi")
+@UIRouter('/cephfs', Scope.CEPHFS)
+@APIDoc("Dashboard UI helper function; not part of the public API", "CephFSUi")
 class CephFsUi(CephFS):
     RESOURCE_ID = 'fs_id'
 
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/cluster.py b/ceph/src/pybind/mgr/dashboard/controllers/cluster.py
new file mode 100644 (file)
index 0000000..d8170e6
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+from ..security import Scope
+from ..services.cluster import ClusterModel
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
+from ._version import APIVersion
+
+
+@APIRouter('/cluster', Scope.CONFIG_OPT)
+@APIDoc("Get Cluster Details", "Cluster")
+class Cluster(RESTController):
+    @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
+    @EndpointDoc("Get the cluster status")
+    def list(self):
+        return ClusterModel.from_db().dict()
+
+    @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
+    @EndpointDoc("Update the cluster status",
+                 parameters={'status': (str, 'Cluster Status')})
+    def singleton_set(self, status: str):
+        ClusterModel(status).to_db()
index 8b0829b8402646fc36a80982ac2f789f192679b8..1cfd06059e6051bddde714e3dd0b0c9191fe139f 100644 (file)
@@ -7,7 +7,7 @@ from .. import mgr
 from ..exceptions import DashboardException
 from ..security import Scope
 from ..services.ceph_service import CephService
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
 
 FILTER_SCHEMA = [{
     "name": (str, 'Name of the config option'),
@@ -28,8 +28,8 @@ FILTER_SCHEMA = [{
 }]
 
 
-@ApiController('/cluster_conf', Scope.CONFIG_OPT)
-@ControllerDoc("Manage Cluster Configurations", "ClusterConfiguration")
+@APIRouter('/cluster_conf', Scope.CONFIG_OPT)
+@APIDoc("Manage Cluster Configurations", "ClusterConfiguration")
 class ClusterConfiguration(RESTController):
 
     def _append_config_option_values(self, options):
index 73485ac2df1d11e0d11246166d14338714d3162d..0310ab1c3d985c97f712353f97a3b5086fe97c36 100644 (file)
@@ -1,3 +1,4 @@
+
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
@@ -6,8 +7,7 @@ from cherrypy import NotFound
 from .. import mgr
 from ..security import Scope
 from ..services.ceph_service import CephService
-from . import ApiController, ControllerDoc, Endpoint, EndpointDoc, \
-    ReadPermission, RESTController, UiApiController
+from . import APIDoc, APIRouter, Endpoint, EndpointDoc, ReadPermission, RESTController, UIRouter
 
 LIST_SCHEMA = {
     "rule_id": (int, 'Rule ID'),
@@ -20,8 +20,8 @@ LIST_SCHEMA = {
 }
 
 
-@ApiController('/crush_rule', Scope.POOL)
-@ControllerDoc("Crush Rule Management API", "CrushRule")
+@APIRouter('/crush_rule', Scope.POOL)
+@APIDoc("Crush Rule Management API", "CrushRule")
 class CrushRule(RESTController):
     @EndpointDoc("List Crush Rule Configuration",
                  responses={200: LIST_SCHEMA})
@@ -48,8 +48,8 @@ class CrushRule(RESTController):
         CephService.send_command('mon', 'osd crush rule rm', name=name)
 
 
-@UiApiController('/crush_rule', Scope.POOL)
-@ControllerDoc("Dashboard UI helper function; not part of the public API", "CrushRuleUi")
+@UIRouter('/crush_rule', Scope.POOL)
+@APIDoc("Dashboard UI helper function; not part of the public API", "CrushRuleUi")
 class CrushRuleUi(CrushRule):
     @Endpoint()
     @ReadPermission
index 331f2479a69b1d34c0e884c7108c8a04b0bcfb13..da040f86f89acbc34a977b20764635503a5e64b4 100644 (file)
@@ -2,20 +2,21 @@
 from __future__ import absolute_import
 
 import logging
-from typing import Any, Dict, List, Union
+from typing import Any, Dict, List, Optional, Union
 
 import cherrypy
 
-from .. import DEFAULT_VERSION, mgr
+from .. import mgr
 from ..api.doc import Schema, SchemaInput, SchemaType
-from . import ENDPOINT_MAP, BaseController, Controller, Endpoint
+from . import ENDPOINT_MAP, BaseController, Endpoint, Router
+from ._version import APIVersion
 
 NO_DESCRIPTION_AVAILABLE = "*No description available*"
 
 logger = logging.getLogger('controllers.docs')
 
 
-@Controller('/docs', secure=False)
+@Router('/docs', secure=False)
 class Docs(BaseController):
 
     @classmethod
@@ -185,7 +186,8 @@ class Docs(BaseController):
         return schema.as_dict()
 
     @classmethod
-    def _gen_responses(cls, method, resp_object=None, version=None):
+    def _gen_responses(cls, method, resp_object=None,
+                       version: Optional[APIVersion] = None):
         resp: Dict[str, Dict[str, Union[str, Any]]] = {
             '400': {
                 "description": "Operation exception. Please check the "
@@ -205,37 +207,38 @@ class Docs(BaseController):
         }
 
         if not version:
-            version = DEFAULT_VERSION
+            version = APIVersion.DEFAULT
 
         if method.lower() == 'get':
             resp['200'] = {'description': "OK",
-                           'content': {'application/vnd.ceph.api.v{}+json'.format(version):
+                           'content': {version.to_mime_type():
                                        {'type': 'object'}}}
         if method.lower() == 'post':
             resp['201'] = {'description': "Resource created.",
-                           'content': {'application/vnd.ceph.api.v{}+json'.format(version):
+                           'content': {version.to_mime_type():
                                        {'type': 'object'}}}
         if method.lower() == 'put':
             resp['200'] = {'description': "Resource updated.",
-                           'content': {'application/vnd.ceph.api.v{}+json'.format(version):
+                           'content': {version.to_mime_type():
                                        {'type': 'object'}}}
         if method.lower() == 'delete':
             resp['204'] = {'description': "Resource deleted.",
-                           'content': {'application/vnd.ceph.api.v{}+json'.format(version):
+                           'content': {version.to_mime_type():
                                        {'type': 'object'}}}
         if method.lower() in ['post', 'put', 'delete']:
             resp['202'] = {'description': "Operation is still executing."
                                           " Please check the task queue.",
-                           'content': {'application/vnd.ceph.api.v{}+json'.format(version):
+                           'content': {version.to_mime_type():
                                        {'type': 'object'}}}
 
         if resp_object:
             for status_code, response_body in resp_object.items():
                 if status_code in resp:
-                    resp[status_code].update({
-                        'content': {
-                            'application/vnd.ceph.api.v{}+json'.format(version): {
-                                'schema': cls._gen_schema_for_content(response_body)}}})
+                    resp[status_code].update(
+                        {'content':
+                         {version.to_mime_type():
+                          {'schema': cls._gen_schema_for_content(response_body)}
+                          }})
 
         return resp
 
@@ -287,7 +290,7 @@ class Docs(BaseController):
                 func = endpoint.func
 
                 summary = ''
-                version = ''
+                version = None
                 resp = {}
                 p_info = []
 
@@ -465,8 +468,6 @@ if __name__ == "__main__":
 
     import yaml
 
-    from . import generate_routes
-
     def fix_null_descr(obj):
         """
         A hot fix for errors caused by null description values when generating
@@ -476,7 +477,7 @@ if __name__ == "__main__":
         return {k: fix_null_descr(v) for k, v in obj.items() if v is not None} \
             if isinstance(obj, dict) else obj
 
-    generate_routes("/api")
+    Router.generate_routes("/api")
     try:
         with open(sys.argv[1], 'w') as f:
             # pylint: disable=protected-access
index 4b8264ef0bd5c7e78c7f378eb114384b9939c84a..c5fb449d61e256eeb93bd46d93b770e2c8f01406 100644 (file)
@@ -6,8 +6,7 @@ from cherrypy import NotFound
 from .. import mgr
 from ..security import Scope
 from ..services.ceph_service import CephService
-from . import ApiController, ControllerDoc, Endpoint, EndpointDoc, \
-    ReadPermission, RESTController, UiApiController
+from . import APIDoc, APIRouter, Endpoint, EndpointDoc, ReadPermission, RESTController, UIRouter
 
 LIST_CODE__SCHEMA = {
     "crush-failure-domain": (str, ''),
@@ -19,8 +18,8 @@ LIST_CODE__SCHEMA = {
 }
 
 
-@ApiController('/erasure_code_profile', Scope.POOL)
-@ControllerDoc("Erasure Code Profile Management API", "ErasureCodeProfile")
+@APIRouter('/erasure_code_profile', Scope.POOL)
+@APIDoc("Erasure Code Profile Management API", "ErasureCodeProfile")
 class ErasureCodeProfile(RESTController):
     """
     create() supports additional key-value arguments that are passed to the
@@ -47,8 +46,8 @@ class ErasureCodeProfile(RESTController):
         CephService.send_command('mon', 'osd erasure-code-profile rm', name=name)
 
 
-@UiApiController('/erasure_code_profile', Scope.POOL)
-@ControllerDoc("Dashboard UI helper function; not part of the public API", "ErasureCodeProfileUi")
+@UIRouter('/erasure_code_profile', Scope.POOL)
+@APIDoc("Dashboard UI helper function; not part of the public API", "ErasureCodeProfileUi")
 class ErasureCodeProfileUi(ErasureCodeProfile):
     @Endpoint()
     @ReadPermission
index 421e36c02e744cb5a1c74b85691f539e94bba7f4..77372c6556b2bbec09711f83dd640c472a31bea9 100644 (file)
@@ -2,12 +2,12 @@ from __future__ import absolute_import
 
 import logging
 
-from . import BaseController, Endpoint, UiApiController
+from . import BaseController, Endpoint, UIRouter
 
 logger = logging.getLogger('frontend.error')
 
 
-@UiApiController('/logging', secure=False)
+@UIRouter('/logging', secure=False)
 class FrontendLogging(BaseController):
 
     @Endpoint('POST', path='js-error')
index 94fe53d0f9774ef65838a364b6e00b6dbb61cf76..e200984ea4abbf70ae6d232863c6d57f297a38c7 100644 (file)
@@ -6,16 +6,16 @@ from ..exceptions import DashboardException
 from ..grafana import GrafanaRestClient, push_local_dashboards
 from ..security import Scope
 from ..settings import Settings
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, UpdatePermission
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, UpdatePermission
 
 URL_SCHEMA = {
     "instance": (str, "grafana instance")
 }
 
 
-@ApiController('/grafana', Scope.GRAFANA)
-@ControllerDoc("Grafana Management API", "Grafana")
+@APIRouter('/grafana', Scope.GRAFANA)
+@APIDoc("Grafana Management API", "Grafana")
 class Grafana(BaseController):
     @Endpoint()
     @ReadPermission
index 0ae0a5bf08b17d875dc6bece78ed819fbf488a9b..ed7e575de63c2ae80999a2ae74ec7bfc980b0212 100644 (file)
@@ -10,7 +10,7 @@ from ..services.ceph_service import CephService
 from ..services.iscsi_cli import IscsiGatewaysConfig
 from ..services.iscsi_client import IscsiClient
 from ..tools import partial_dict
-from . import ApiController, BaseController, ControllerDoc, Endpoint, EndpointDoc
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc
 from .host import get_hosts
 
 HEALTH_MINIMAL_SCHEMA = ({
@@ -275,11 +275,11 @@ class HealthData(object):
         return CephService.get_scrub_status()
 
 
-@ApiController('/health')
-@ControllerDoc("Display Detailed Cluster health Status", "Health")
+@APIRouter('/health')
+@APIDoc("Display Detailed Cluster health Status", "Health")
 class Health(BaseController):
     def __init__(self):
-        super(Health, self).__init__()
+        super().__init__()
         self.health_full = HealthData(self._has_permissions, minimal=False)
         self.health_minimal = HealthData(self._has_permissions, minimal=True)
 
index cb4a4a5a18533188387c292e2bb648a5a468ddc2..eec811495e707fc8abbc0698e09c3011798ef9d8 100644 (file)
@@ -15,7 +15,7 @@ import cherrypy
 from cherrypy.lib.static import serve_file
 
 from .. import mgr
-from . import BaseController, Controller, Endpoint, Proxy, UiApiController
+from . import BaseController, Endpoint, Proxy, Router, UIRouter
 
 logger = logging.getLogger("controllers.home")
 
@@ -52,10 +52,10 @@ class LanguageMixin(object):
         self.DEFAULT_LANGUAGE = config['config']['locale']
         self.DEFAULT_LANGUAGE_PATH = os.path.join(mgr.get_frontend_path(),
                                                   self.DEFAULT_LANGUAGE)
-        super(LanguageMixin, self).__init__()
+        super().__init__()
 
 
-@Controller("/", secure=False)
+@Router("/", secure=False)
 class HomeController(BaseController, LanguageMixin):
     LANG_TAG_SEQ_RE = re.compile(r'\s*([^,]+)\s*,?\s*')
     LANG_TAG_RE = re.compile(
@@ -135,7 +135,7 @@ class HomeController(BaseController, LanguageMixin):
         return serve_file(full_path)
 
 
-@UiApiController("/langs", secure=False)
+@UIRouter("/langs", secure=False)
 class LangsController(BaseController, LanguageMixin):
     @Endpoint('GET')
     def __call__(self):
index a13b1eb20f6a3754c141c5c8eb56a10344331729..18931ce342dcef9735f8a1c8186c4794ed17d126 100644 (file)
@@ -16,10 +16,11 @@ from ..security import Scope
 from ..services.ceph_service import CephService
 from ..services.exception import handle_orchestrator_error
 from ..services.orchestrator import OrchClient, OrchFeature
-from ..tools import TaskManager, str_to_bool
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, RESTController, Task, UiApiController, \
-    UpdatePermission, allow_empty_body
+from ..tools import TaskManager, merge_list_of_dicts_by_key, str_to_bool
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, RESTController, Task, UIRouter, UpdatePermission, \
+    allow_empty_body
+from ._version import APIVersion
 from .orchestrator import raise_if_no_orchestrator
 
 LIST_HOST_SCHEMA = {
@@ -154,10 +155,17 @@ def merge_hosts_by_hostname(ceph_hosts, orch_hosts):
     return hosts
 
 
-def get_hosts(from_ceph=True, from_orchestrator=True):
+def get_hosts(sources=None):
     """
     Get hosts from various sources.
     """
+    from_ceph = True
+    from_orchestrator = True
+    if sources:
+        _sources = sources.split(',')
+        from_ceph = 'ceph' in _sources
+        from_orchestrator = 'orchestrator' in _sources
+
     ceph_hosts = []
     if from_ceph:
         ceph_hosts = [
@@ -165,7 +173,6 @@ def get_hosts(from_ceph=True, from_orchestrator=True):
                 server, {
                     'addr': '',
                     'labels': [],
-                    'service_type': '',
                     'sources': {
                         'ceph': True,
                         'orchestrator': False
@@ -267,25 +274,42 @@ def add_host(hostname: str, addr: Optional[str] = None,
         orch_client.hosts.enter_maintenance(hostname)
 
 
-@ApiController('/host', Scope.HOSTS)
-@ControllerDoc("Get Host Details", "Host")
+@APIRouter('/host', Scope.HOSTS)
+@APIDoc("Get Host Details", "Host")
 class Host(RESTController):
     @EndpointDoc("List Host Specifications",
                  parameters={
                      'sources': (str, 'Host Sources'),
+                     'facts': (bool, 'Host Facts')
                  },
                  responses={200: LIST_HOST_SCHEMA})
-    def list(self, sources=None):
-        if sources is None:
-            return get_hosts()
-        _sources = sources.split(',')
-        from_ceph = 'ceph' in _sources
-        from_orchestrator = 'orchestrator' in _sources
-        return get_hosts(from_ceph, from_orchestrator)
+    @RESTController.MethodMap(version=APIVersion(1, 1))
+    def list(self, sources=None, facts=False):
+        hosts = get_hosts(sources)
+        orch = OrchClient.instance()
+        if str_to_bool(facts):
+            if orch.available():
+                if not orch.get_missing_features(['get_facts']):
+                    hosts_facts = orch.hosts.get_facts()
+                    return merge_list_of_dicts_by_key(hosts, hosts_facts, 'hostname')
 
-    @raise_if_no_orchestrator([OrchFeature.HOST_LIST, OrchFeature.HOST_CREATE])
+                raise DashboardException(
+                    code='invalid_orchestrator_backend',  # pragma: no cover
+                    msg="Please enable the cephadm orchestrator backend "
+                    "(try `ceph orch set backend cephadm`)",
+                    component='orchestrator',
+                    http_status_code=400)
+
+            raise DashboardException(code='orchestrator_status_unavailable',  # pragma: no cover
+                                     msg="Please configure and enable the orchestrator if you "
+                                         "really want to gather facts from hosts",
+                                     component='orchestrator',
+                                     http_status_code=400)
+        return hosts
+
+    @raise_if_no_orchestrator([OrchFeature.HOST_LIST, OrchFeature.HOST_ADD])
     @handle_orchestrator_error('host')
-    @host_task('create', {'hostname': '{hostname}'})
+    @host_task('add', {'hostname': '{hostname}'})
     @EndpointDoc('',
                  parameters={
                      'hostname': (str, 'Hostname'),
@@ -294,16 +318,16 @@ class Host(RESTController):
                      'status': (str, 'Host Status'),
                  },
                  responses={200: None, 204: None})
-    @RESTController.MethodMap(version='0.1')
+    @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
     def create(self, hostname: str,
                addr: Optional[str] = None,
                labels: Optional[List[str]] = None,
                status: Optional[str] = None):  # pragma: no cover - requires realtime env
         add_host(hostname, addr, labels, status)
 
-    @raise_if_no_orchestrator([OrchFeature.HOST_LIST, OrchFeature.HOST_DELETE])
+    @raise_if_no_orchestrator([OrchFeature.HOST_LIST, OrchFeature.HOST_REMOVE])
     @handle_orchestrator_error('host')
-    @host_task('delete', {'hostname': '{hostname}'})
+    @host_task('remove', {'hostname': '{hostname}'})
     @allow_empty_body
     def delete(self, hostname):  # pragma: no cover - requires realtime env
         orch_client = OrchClient.instance()
@@ -407,7 +431,7 @@ class Host(RESTController):
                      'force': (bool, 'Force Enter Maintenance')
                  },
                  responses={200: None, 204: None})
-    @RESTController.MethodMap(version='0.1')
+    @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
     def set(self, hostname: str, update_labels: bool = False,
             labels: List[str] = None, maintenance: bool = False,
             force: bool = False):
@@ -449,7 +473,7 @@ class Host(RESTController):
                 orch.hosts.add_label(hostname, label)
 
 
-@UiApiController('/host', Scope.HOSTS)
+@UIRouter('/host', Scope.HOSTS)
 class HostUi(BaseController):
     @Endpoint('GET')
     @ReadPermission
index 687daa91966f7e1db9894cc62c34d061a3f5adaf..9135f5abc8f44a802133c713a40ed394ebe4409c 100644 (file)
@@ -22,9 +22,8 @@ from ..services.iscsi_config import IscsiGatewayDoesNotExist
 from ..services.rbd import format_bitmask
 from ..services.tcmu_service import TcmuService
 from ..tools import TaskManager, str_to_bool
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, RESTController, Task, UiApiController, \
-    UpdatePermission
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, RESTController, Task, UIRouter, UpdatePermission
 
 try:
     from typing import Any, Dict, List, no_type_check
@@ -39,7 +38,7 @@ ISCSI_SCHEMA = {
 }
 
 
-@UiApiController('/iscsi', Scope.ISCSI)
+@UIRouter('/iscsi', Scope.ISCSI)
 class IscsiUi(BaseController):
 
     REQUIRED_CEPH_ISCSI_CONFIG_MIN_VERSION = 10
@@ -196,8 +195,8 @@ class IscsiUi(BaseController):
         }
 
 
-@ApiController('/iscsi', Scope.ISCSI)
-@ControllerDoc("Iscsi Management API", "Iscsi")
+@APIRouter('/iscsi', Scope.ISCSI)
+@APIDoc("Iscsi Management API", "Iscsi")
 class Iscsi(BaseController):
     @Endpoint('GET', 'discoveryauth')
     @ReadPermission
@@ -253,8 +252,8 @@ def iscsi_target_task(name, metadata, wait_for=2.0):
     return Task("iscsi/target/{}".format(name), metadata, wait_for)
 
 
-@ApiController('/iscsi/target', Scope.ISCSI)
-@ControllerDoc("Get Iscsi Target Details", "IscsiTarget")
+@APIRouter('/iscsi/target', Scope.ISCSI)
+@APIDoc("Get Iscsi Target Details", "IscsiTarget")
 class IscsiTarget(RESTController):
 
     def list(self):
index 97995110746f347433200f8b1cb2aeda4bb68f03..cc217ce0d0bbf19a36ef10d34acd8d21295a812f 100644 (file)
@@ -6,7 +6,7 @@ import collections
 from ..security import Scope
 from ..services.ceph_service import CephService
 from ..tools import NotificationQueue
-from . import ApiController, BaseController, ControllerDoc, Endpoint, EndpointDoc, ReadPermission
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, ReadPermission
 
 LOG_BUFFER_SIZE = 30
 
@@ -31,11 +31,11 @@ LOGS_SCHEMA = {
 }
 
 
-@ApiController('/logs', Scope.LOG)
-@ControllerDoc("Logs Management API", "Logs")
+@APIRouter('/logs', Scope.LOG)
+@APIDoc("Logs Management API", "Logs")
 class Logs(BaseController):
     def __init__(self):
-        super(Logs, self).__init__()
+        super().__init__()
         self._log_initialized = False
         self.log_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE)
         self.audit_buffer = collections.deque(maxlen=LOG_BUFFER_SIZE)
index b614612d0b72dd056662d575f8cd477ac237f3d7..50a4c71e8eccd8502f66c78154771e7891424c23 100644 (file)
@@ -6,7 +6,7 @@ from ..security import Scope
 from ..services.ceph_service import CephService
 from ..services.exception import handle_send_command_error
 from ..tools import find_object_in_list, str_to_bool
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController, allow_empty_body
+from . import APIDoc, APIRouter, EndpointDoc, RESTController, allow_empty_body
 
 MGR_MODULE_SCHEMA = ([{
     "name": (str, "Module Name"),
@@ -31,8 +31,8 @@ MGR_MODULE_SCHEMA = ([{
 }])
 
 
-@ApiController('/mgr/module', Scope.CONFIG_OPT)
-@ControllerDoc("Get details of MGR Module", "MgrModule")
+@APIRouter('/mgr/module', Scope.CONFIG_OPT)
+@APIDoc("Get details of MGR Module", "MgrModule")
 class MgrModules(RESTController):
     ignore_modules = ['selftest']
 
index b61fcd4f393e26e45039e107f1395fc50caf01f1..c880859d2470648a2bf4c9c25e108e674a8238ac 100644 (file)
@@ -5,7 +5,7 @@ import json
 
 from .. import mgr
 from ..security import Scope
-from . import ApiController, BaseController, ControllerDoc, Endpoint, EndpointDoc, ReadPermission
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, ReadPermission
 
 MONITOR_SCHEMA = {
     "mon_status": ({
@@ -99,8 +99,8 @@ MONITOR_SCHEMA = {
 }
 
 
-@ApiController('/monitor', Scope.MONITOR)
-@ControllerDoc("Get Monitor Details", "Monitor")
+@APIRouter('/monitor', Scope.MONITOR)
+@APIDoc("Get Monitor Details", "Monitor")
 class Monitor(BaseController):
     @Endpoint()
     @ReadPermission
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/nfs.py b/ceph/src/pybind/mgr/dashboard/controllers/nfs.py
new file mode 100644 (file)
index 0000000..9985ba1
--- /dev/null
@@ -0,0 +1,288 @@
+# -*- coding: utf-8 -*-
+from __future__ import absolute_import
+
+import json
+import logging
+import os
+from functools import partial
+from typing import Any, Dict, List, Optional
+
+import cephfs
+from mgr_module import NFS_GANESHA_SUPPORTED_FSALS
+
+from .. import mgr
+from ..security import Scope
+from ..services.cephfs import CephFS
+from ..services.exception import DashboardException, serialize_dashboard_exception
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, RESTController, Task, UIRouter
+from ._version import APIVersion
+
+logger = logging.getLogger('controllers.nfs')
+
+
+class NFSException(DashboardException):
+    def __init__(self, msg):
+        super(NFSException, self).__init__(component="nfs", msg=msg)
+
+
+# documentation helpers
+EXPORT_SCHEMA = {
+    'export_id': (int, 'Export ID'),
+    'path': (str, 'Export path'),
+    'cluster_id': (str, 'Cluster identifier'),
+    'pseudo': (str, 'Pseudo FS path'),
+    'access_type': (str, 'Export access type'),
+    'squash': (str, 'Export squash policy'),
+    'security_label': (str, 'Security label'),
+    'protocols': ([int], 'List of protocol types'),
+    'transports': ([str], 'List of transport types'),
+    'fsal': ({
+        'name': (str, 'name of FSAL'),
+        'fs_name': (str, 'CephFS filesystem name', True),
+        'sec_label_xattr': (str, 'Name of xattr for security label', True),
+        'user_id': (str, 'User id', True)
+    }, 'FSAL configuration'),
+    'clients': ([{
+        'addresses': ([str], 'list of IP addresses'),
+        'access_type': (str, 'Client access type'),
+        'squash': (str, 'Client squash policy')
+    }], 'List of client configurations'),
+}
+
+
+CREATE_EXPORT_SCHEMA = {
+    'path': (str, 'Export path'),
+    'cluster_id': (str, 'Cluster identifier'),
+    'pseudo': (str, 'Pseudo FS path'),
+    'access_type': (str, 'Export access type'),
+    'squash': (str, 'Export squash policy'),
+    'security_label': (str, 'Security label'),
+    'protocols': ([int], 'List of protocol types'),
+    'transports': ([str], 'List of transport types'),
+    'fsal': ({
+        'name': (str, 'name of FSAL'),
+        'fs_name': (str, 'CephFS filesystem name', True),
+        'sec_label_xattr': (str, 'Name of xattr for security label', True)
+    }, 'FSAL configuration'),
+    'clients': ([{
+        'addresses': ([str], 'list of IP addresses'),
+        'access_type': (str, 'Client access type'),
+        'squash': (str, 'Client squash policy')
+    }], 'List of client configurations')
+}
+
+
+# pylint: disable=not-callable
+def NfsTask(name, metadata, wait_for):  # noqa: N802
+    def composed_decorator(func):
+        return Task("nfs/{}".format(name), metadata, wait_for,
+                    partial(serialize_dashboard_exception,
+                            include_http_status=True))(func)
+    return composed_decorator
+
+
+@APIRouter('/nfs-ganesha', Scope.NFS_GANESHA)
+@APIDoc("NFS-Ganesha Cluster Management API", "NFS-Ganesha")
+class NFSGanesha(RESTController):
+
+    @EndpointDoc("Status of NFS-Ganesha management feature",
+                 responses={200: {
+                     'available': (bool, "Is API available?"),
+                     'message': (str, "Error message")
+                 }})
+    @Endpoint()
+    @ReadPermission
+    def status(self):
+        status = {'available': True, 'message': None}
+        try:
+            mgr.remote('nfs', 'cluster_ls')
+        except ImportError as error:
+            logger.exception(error)
+            status['available'] = False
+            status['message'] = str(error)  # type: ignore
+
+        return status
+
+
+@APIRouter('/nfs-ganesha/cluster', Scope.NFS_GANESHA)
+@APIDoc(group="NFS-Ganesha")
+class NFSGaneshaCluster(RESTController):
+    @ReadPermission
+    @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
+    def list(self):
+        return mgr.remote('nfs', 'cluster_ls')
+
+
+@APIRouter('/nfs-ganesha/export', Scope.NFS_GANESHA)
+@APIDoc(group="NFS-Ganesha")
+class NFSGaneshaExports(RESTController):
+    RESOURCE_ID = "cluster_id/export_id"
+
+    @staticmethod
+    def _get_schema_export(export: Dict[str, Any]) -> Dict[str, Any]:
+        """
+        Method that avoids returning export info not exposed in the export schema
+        e.g., rgw user access/secret keys.
+        """
+        schema_fsal_info = {}
+        for key in export['fsal'].keys():
+            if key in EXPORT_SCHEMA['fsal'][0].keys():  # type: ignore
+                schema_fsal_info[key] = export['fsal'][key]
+        export['fsal'] = schema_fsal_info
+        return export
+
+    @EndpointDoc("List all NFS-Ganesha exports",
+                 responses={200: [EXPORT_SCHEMA]})
+    def list(self) -> List[Dict[str, Any]]:
+        exports = []
+        for export in mgr.remote('nfs', 'export_ls'):
+            exports.append(self._get_schema_export(export))
+
+        return exports
+
+    @NfsTask('create', {'path': '{path}', 'fsal': '{fsal.name}',
+                        'cluster_id': '{cluster_id}'}, 2.0)
+    @EndpointDoc("Creates a new NFS-Ganesha export",
+                 parameters=CREATE_EXPORT_SCHEMA,
+                 responses={201: EXPORT_SCHEMA})
+    @RESTController.MethodMap(version=APIVersion(2, 0))  # type: ignore
+    def create(self, path, cluster_id, pseudo, access_type,
+               squash, security_label, protocols, transports, fsal, clients) -> Dict[str, Any]:
+        export_mgr = mgr.remote('nfs', 'fetch_nfs_export_obj')
+        if export_mgr.get_export_by_pseudo(cluster_id, pseudo):
+            raise DashboardException(msg=f'Pseudo {pseudo} is already in use.',
+                                     component='nfs')
+        if hasattr(fsal, 'user_id'):
+            fsal.pop('user_id')  # mgr/nfs does not let you customize user_id
+        raw_ex = {
+            'path': path,
+            'pseudo': pseudo,
+            'cluster_id': cluster_id,
+            'access_type': access_type,
+            'squash': squash,
+            'security_label': security_label,
+            'protocols': protocols,
+            'transports': transports,
+            'fsal': fsal,
+            'clients': clients
+        }
+        ret, _, err = export_mgr.apply_export(cluster_id, json.dumps(raw_ex))
+        if ret == 0:
+            return self._get_schema_export(
+                export_mgr.get_export_by_pseudo(cluster_id, pseudo))
+        raise NFSException(f"Export creation failed {err}")
+
+    @EndpointDoc("Get an NFS-Ganesha export",
+                 parameters={
+                     'cluster_id': (str, 'Cluster identifier'),
+                     'export_id': (str, "Export ID")
+                 },
+                 responses={200: EXPORT_SCHEMA})
+    def get(self, cluster_id, export_id) -> Optional[Dict[str, Any]]:
+        export_id = int(export_id)
+        export = mgr.remote('nfs', 'export_get', cluster_id, export_id)
+        if export:
+            export = self._get_schema_export(export)
+
+        return export
+
+    @NfsTask('edit', {'cluster_id': '{cluster_id}', 'export_id': '{export_id}'},
+             2.0)
+    @EndpointDoc("Updates an NFS-Ganesha export",
+                 parameters=dict(export_id=(int, "Export ID"),
+                                 **CREATE_EXPORT_SCHEMA),
+                 responses={200: EXPORT_SCHEMA})
+    @RESTController.MethodMap(version=APIVersion(2, 0))  # type: ignore
+    def set(self, cluster_id, export_id, path, pseudo, access_type,
+            squash, security_label, protocols, transports, fsal, clients) -> Dict[str, Any]:
+
+        if hasattr(fsal, 'user_id'):
+            fsal.pop('user_id')  # mgr/nfs does not let you customize user_id
+        raw_ex = {
+            'path': path,
+            'pseudo': pseudo,
+            'cluster_id': cluster_id,
+            'export_id': export_id,
+            'access_type': access_type,
+            'squash': squash,
+            'security_label': security_label,
+            'protocols': protocols,
+            'transports': transports,
+            'fsal': fsal,
+            'clients': clients
+        }
+
+        export_mgr = mgr.remote('nfs', 'fetch_nfs_export_obj')
+        ret, _, err = export_mgr.apply_export(cluster_id, json.dumps(raw_ex))
+        if ret == 0:
+            return self._get_schema_export(
+                export_mgr.get_export_by_pseudo(cluster_id, pseudo))
+        raise NFSException(f"Failed to update export: {err}")
+
+    @NfsTask('delete', {'cluster_id': '{cluster_id}',
+                        'export_id': '{export_id}'}, 2.0)
+    @EndpointDoc("Deletes an NFS-Ganesha export",
+                 parameters={
+                     'cluster_id': (str, 'Cluster identifier'),
+                     'export_id': (int, "Export ID")
+                 })
+    @RESTController.MethodMap(version=APIVersion(2, 0))  # type: ignore
+    def delete(self, cluster_id, export_id):
+        export_id = int(export_id)
+
+        export = mgr.remote('nfs', 'export_get', cluster_id, export_id)
+        if not export:
+            raise DashboardException(
+                http_status_code=404,
+                msg=f'Export with id {export_id} not found.',
+                component='nfs')
+        mgr.remote('nfs', 'export_rm', cluster_id, export['pseudo'])
+
+
+@UIRouter('/nfs-ganesha', Scope.NFS_GANESHA)
+class NFSGaneshaUi(BaseController):
+    @Endpoint('GET', '/fsals')
+    @ReadPermission
+    def fsals(self):
+        return NFS_GANESHA_SUPPORTED_FSALS
+
+    @Endpoint('GET', '/lsdir')
+    @ReadPermission
+    def lsdir(self, fs_name, root_dir=None, depth=1):  # pragma: no cover
+        if root_dir is None:
+            root_dir = "/"
+        if not root_dir.startswith('/'):
+            root_dir = '/{}'.format(root_dir)
+        root_dir = os.path.normpath(root_dir)
+
+        try:
+            depth = int(depth)
+            error_msg = ''
+            if depth < 0:
+                error_msg = '`depth` must be greater or equal to 0.'
+            if depth > 5:
+                logger.warning("Limiting depth to maximum value of 5: "
+                               "input depth=%s", depth)
+                depth = 5
+        except ValueError:
+            error_msg = '`depth` must be an integer.'
+        finally:
+            if error_msg:
+                raise DashboardException(code=400,
+                                         component='nfs',
+                                         msg=error_msg)
+
+        try:
+            cfs = CephFS(fs_name)
+            paths = [root_dir]
+            paths.extend([p['path'].rstrip('/')
+                          for p in cfs.ls_dir(root_dir, depth)])
+        except (cephfs.ObjectNotFound, cephfs.PermissionError):
+            paths = []
+        return {'paths': paths}
+
+    @Endpoint('GET', '/cephfs/filesystems')
+    @ReadPermission
+    def filesystems(self):
+        return CephFS.list_filesystems()
diff --git a/ceph/src/pybind/mgr/dashboard/controllers/nfsganesha.py b/ceph/src/pybind/mgr/dashboard/controllers/nfsganesha.py
deleted file mode 100644 (file)
index 91d0792..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import absolute_import
-
-import logging
-import os
-from functools import partial
-
-import cephfs
-import cherrypy
-
-from ..security import Scope
-from ..services.cephfs import CephFS
-from ..services.cephx import CephX
-from ..services.exception import DashboardException, serialize_dashboard_exception
-from ..services.ganesha import Ganesha, GaneshaConf, NFSException
-from ..services.rgw_client import NoCredentialsException, \
-    NoRgwDaemonsException, RequestException, RgwClient
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, RESTController, Task, UiApiController
-
-logger = logging.getLogger('controllers.ganesha')
-
-
-# documentation helpers
-EXPORT_SCHEMA = {
-    'export_id': (int, 'Export ID'),
-    'path': (str, 'Export path'),
-    'cluster_id': (str, 'Cluster identifier'),
-    'daemons': ([str], 'List of NFS Ganesha daemons identifiers'),
-    'pseudo': (str, 'Pseudo FS path'),
-    'tag': (str, 'NFSv3 export tag'),
-    'access_type': (str, 'Export access type'),
-    'squash': (str, 'Export squash policy'),
-    'security_label': (str, 'Security label'),
-    'protocols': ([int], 'List of protocol types'),
-    'transports': ([str], 'List of transport types'),
-    'fsal': ({
-        'name': (str, 'name of FSAL'),
-        'user_id': (str, 'CephX user id', True),
-        'filesystem': (str, 'CephFS filesystem ID', True),
-        'sec_label_xattr': (str, 'Name of xattr for security label', True),
-        'rgw_user_id': (str, 'RGW user id', True)
-    }, 'FSAL configuration'),
-    'clients': ([{
-        'addresses': ([str], 'list of IP addresses'),
-        'access_type': (str, 'Client access type'),
-        'squash': (str, 'Client squash policy')
-    }], 'List of client configurations'),
-}
-
-
-CREATE_EXPORT_SCHEMA = {
-    'path': (str, 'Export path'),
-    'cluster_id': (str, 'Cluster identifier'),
-    'daemons': ([str], 'List of NFS Ganesha daemons identifiers'),
-    'pseudo': (str, 'Pseudo FS path'),
-    'tag': (str, 'NFSv3 export tag'),
-    'access_type': (str, 'Export access type'),
-    'squash': (str, 'Export squash policy'),
-    'security_label': (str, 'Security label'),
-    'protocols': ([int], 'List of protocol types'),
-    'transports': ([str], 'List of transport types'),
-    'fsal': ({
-        'name': (str, 'name of FSAL'),
-        'user_id': (str, 'CephX user id', True),
-        'filesystem': (str, 'CephFS filesystem ID', True),
-        'sec_label_xattr': (str, 'Name of xattr for security label', True),
-        'rgw_user_id': (str, 'RGW user id', True)
-    }, 'FSAL configuration'),
-    'clients': ([{
-        'addresses': ([str], 'list of IP addresses'),
-        'access_type': (str, 'Client access type'),
-        'squash': (str, 'Client squash policy')
-    }], 'List of client configurations'),
-    'reload_daemons': (bool,
-                       'Trigger reload of NFS-Ganesha daemons configuration',
-                       True)
-}
-
-
-# pylint: disable=not-callable
-def NfsTask(name, metadata, wait_for):  # noqa: N802
-    def composed_decorator(func):
-        return Task("nfs/{}".format(name), metadata, wait_for,
-                    partial(serialize_dashboard_exception,
-                            include_http_status=True))(func)
-    return composed_decorator
-
-
-@ApiController('/nfs-ganesha', Scope.NFS_GANESHA)
-@ControllerDoc("NFS-Ganesha Management API", "NFS-Ganesha")
-class NFSGanesha(RESTController):
-
-    @EndpointDoc("Status of NFS-Ganesha management feature",
-                 responses={200: {
-                     'available': (bool, "Is API available?"),
-                     'message': (str, "Error message")
-                 }})
-    @Endpoint()
-    @ReadPermission
-    def status(self):
-        status = {'available': True, 'message': None}
-        try:
-            Ganesha.get_ganesha_clusters()
-        except NFSException as e:
-            status['message'] = str(e)  # type: ignore
-            status['available'] = False
-
-        return status
-
-
-@ApiController('/nfs-ganesha/export', Scope.NFS_GANESHA)
-@ControllerDoc(group="NFS-Ganesha")
-class NFSGaneshaExports(RESTController):
-    RESOURCE_ID = "cluster_id/export_id"
-
-    @EndpointDoc("List all NFS-Ganesha exports",
-                 responses={200: [EXPORT_SCHEMA]})
-    def list(self):
-        result = []
-        for cluster_id in Ganesha.get_ganesha_clusters():
-            result.extend(
-                [export.to_dict()
-                 for export in GaneshaConf.instance(cluster_id).list_exports()])
-        return result
-
-    @NfsTask('create', {'path': '{path}', 'fsal': '{fsal.name}',
-                        'cluster_id': '{cluster_id}'}, 2.0)
-    @EndpointDoc("Creates a new NFS-Ganesha export",
-                 parameters=CREATE_EXPORT_SCHEMA,
-                 responses={201: EXPORT_SCHEMA})
-    def create(self, path, cluster_id, daemons, pseudo, tag, access_type,
-               squash, security_label, protocols, transports, fsal, clients,
-               reload_daemons=True):
-        if fsal['name'] not in Ganesha.fsals_available():
-            raise NFSException("Cannot create this export. "
-                               "FSAL '{}' cannot be managed by the dashboard."
-                               .format(fsal['name']))
-
-        ganesha_conf = GaneshaConf.instance(cluster_id)
-        ex_id = ganesha_conf.create_export({
-            'path': path,
-            'pseudo': pseudo,
-            'cluster_id': cluster_id,
-            'daemons': daemons,
-            'tag': tag,
-            'access_type': access_type,
-            'squash': squash,
-            'security_label': security_label,
-            'protocols': protocols,
-            'transports': transports,
-            'fsal': fsal,
-            'clients': clients
-        })
-        if reload_daemons:
-            ganesha_conf.reload_daemons(daemons)
-        return ganesha_conf.get_export(ex_id).to_dict()
-
-    @EndpointDoc("Get an NFS-Ganesha export",
-                 parameters={
-                     'cluster_id': (str, 'Cluster identifier'),
-                     'export_id': (int, "Export ID")
-                 },
-                 responses={200: EXPORT_SCHEMA})
-    def get(self, cluster_id, export_id):
-        export_id = int(export_id)
-        ganesha_conf = GaneshaConf.instance(cluster_id)
-        if not ganesha_conf.has_export(export_id):
-            raise cherrypy.HTTPError(404)
-        return ganesha_conf.get_export(export_id).to_dict()
-
-    @NfsTask('edit', {'cluster_id': '{cluster_id}', 'export_id': '{export_id}'},
-             2.0)
-    @EndpointDoc("Updates an NFS-Ganesha export",
-                 parameters=dict(export_id=(int, "Export ID"),
-                                 **CREATE_EXPORT_SCHEMA),
-                 responses={200: EXPORT_SCHEMA})
-    def set(self, cluster_id, export_id, path, daemons, pseudo, tag, access_type,
-            squash, security_label, protocols, transports, fsal, clients,
-            reload_daemons=True):
-        export_id = int(export_id)
-        ganesha_conf = GaneshaConf.instance(cluster_id)
-
-        if not ganesha_conf.has_export(export_id):
-            raise cherrypy.HTTPError(404)  # pragma: no cover - the handling is too obvious
-
-        if fsal['name'] not in Ganesha.fsals_available():
-            raise NFSException("Cannot make modifications to this export. "
-                               "FSAL '{}' cannot be managed by the dashboard."
-                               .format(fsal['name']))
-
-        old_export = ganesha_conf.update_export({
-            'export_id': export_id,
-            'path': path,
-            'cluster_id': cluster_id,
-            'daemons': daemons,
-            'pseudo': pseudo,
-            'tag': tag,
-            'access_type': access_type,
-            'squash': squash,
-            'security_label': security_label,
-            'protocols': protocols,
-            'transports': transports,
-            'fsal': fsal,
-            'clients': clients
-        })
-        daemons = list(daemons)
-        for d_id in old_export.daemons:
-            if d_id not in daemons:
-                daemons.append(d_id)
-        if reload_daemons:
-            ganesha_conf.reload_daemons(daemons)
-        return ganesha_conf.get_export(export_id).to_dict()
-
-    @NfsTask('delete', {'cluster_id': '{cluster_id}',
-                        'export_id': '{export_id}'}, 2.0)
-    @EndpointDoc("Deletes an NFS-Ganesha export",
-                 parameters={
-                     'cluster_id': (str, 'Cluster identifier'),
-                     'export_id': (int, "Export ID"),
-                     'reload_daemons': (bool,
-                                        'Trigger reload of NFS-Ganesha daemons'
-                                        ' configuration',
-                                        True)
-                 })
-    def delete(self, cluster_id, export_id, reload_daemons=True):
-        export_id = int(export_id)
-        ganesha_conf = GaneshaConf.instance(cluster_id)
-
-        if not ganesha_conf.has_export(export_id):
-            raise cherrypy.HTTPError(404)  # pragma: no cover - the handling is too obvious
-        export = ganesha_conf.remove_export(export_id)
-        if reload_daemons:
-            ganesha_conf.reload_daemons(export.daemons)
-
-
-@ApiController('/nfs-ganesha/daemon', Scope.NFS_GANESHA)
-@ControllerDoc(group="NFS-Ganesha")
-class NFSGaneshaService(RESTController):
-
-    @EndpointDoc("List NFS-Ganesha daemons information",
-                 responses={200: [{
-                     'daemon_id': (str, 'Daemon identifier'),
-                     'cluster_id': (str, 'Cluster identifier'),
-                     'cluster_type': (str, 'Cluster type'),
-                     'status': (int, 'Status of daemon', True),
-                     'desc': (str, 'Status description', True)
-                 }]})
-    def list(self):
-        result = []
-        for cluster_id in Ganesha.get_ganesha_clusters():
-            result.extend(GaneshaConf.instance(cluster_id).list_daemons())
-        return result
-
-
-@UiApiController('/nfs-ganesha', Scope.NFS_GANESHA)
-class NFSGaneshaUi(BaseController):
-    @Endpoint('GET', '/cephx/clients')
-    @ReadPermission
-    def cephx_clients(self):
-        return list(CephX.list_clients())
-
-    @Endpoint('GET', '/fsals')
-    @ReadPermission
-    def fsals(self):
-        return Ganesha.fsals_available()
-
-    @Endpoint('GET', '/lsdir')
-    @ReadPermission
-    def lsdir(self, fs_name, root_dir=None, depth=1):  # pragma: no cover
-        if root_dir is None:
-            root_dir = "/"
-        if not root_dir.startswith('/'):
-            root_dir = '/{}'.format(root_dir)
-        root_dir = os.path.normpath(root_dir)
-
-        try:
-            depth = int(depth)
-            error_msg = ''
-            if depth < 0:
-                error_msg = '`depth` must be greater or equal to 0.'
-            if depth > 5:
-                logger.warning("Limiting depth to maximum value of 5: "
-                               "input depth=%s", depth)
-                depth = 5
-        except ValueError:
-            error_msg = '`depth` must be an integer.'
-        finally:
-            if error_msg:
-                raise DashboardException(code=400,
-                                         component='nfsganesha',
-                                         msg=error_msg)
-
-        try:
-            cfs = CephFS(fs_name)
-            paths = [root_dir]
-            paths.extend([p['path'].rstrip('/')
-                          for p in cfs.ls_dir(root_dir, depth)])
-        except (cephfs.ObjectNotFound, cephfs.PermissionError):
-            paths = []
-        return {'paths': paths}
-
-    @Endpoint('GET', '/cephfs/filesystems')
-    @ReadPermission
-    def filesystems(self):
-        return CephFS.list_filesystems()
-
-    @Endpoint('GET', '/rgw/buckets')
-    @ReadPermission
-    def buckets(self, user_id=None):
-        try:
-            return RgwClient.instance(user_id).get_buckets()
-        except (DashboardException, NoCredentialsException, RequestException,
-                NoRgwDaemonsException):
-            return []
-
-    @Endpoint('GET', '/clusters')
-    @ReadPermission
-    def clusters(self):
-        return Ganesha.get_ganesha_clusters()
index 085870a0f4aac7bbbda82e87dc3d71e6c530bf18..03eeaadbc0904346a6df27c3ec24cf72cd8307be 100644 (file)
@@ -5,7 +5,7 @@ from functools import wraps
 
 from ..exceptions import DashboardException
 from ..services.orchestrator import OrchClient
-from . import ApiController, ControllerDoc, Endpoint, EndpointDoc, ReadPermission, RESTController
+from . import APIDoc, APIRouter, Endpoint, EndpointDoc, ReadPermission, RESTController
 
 STATUS_SCHEMA = {
     "available": (bool, "Orchestrator status"),
@@ -36,8 +36,8 @@ def raise_if_no_orchestrator(features=None):
     return inner
 
 
-@ApiController('/orchestrator')
-@ControllerDoc("Orchestrator Management API", "Orchestrator")
+@APIRouter('/orchestrator')
+@APIDoc("Orchestrator Management API", "Orchestrator")
 class Orchestrator(RESTController):
 
     @Endpoint()
index 1c6b2d26aeba11494cba796ec668492f809b94b9..95b6e7a04dc7517c18b6f76d4fc98c2a7d8dfa2c 100644 (file)
@@ -16,9 +16,9 @@ from ..services.ceph_service import CephService, SendCommandError
 from ..services.exception import handle_orchestrator_error, handle_send_command_error
 from ..services.orchestrator import OrchClient, OrchFeature
 from ..tools import str_to_bool
-from . import ApiController, ControllerDoc, CreatePermission, \
-    DeletePermission, Endpoint, EndpointDoc, ReadPermission, RESTController, \
-    Task, UpdatePermission, allow_empty_body
+from . import APIDoc, APIRouter, CreatePermission, DeletePermission, Endpoint, \
+    EndpointDoc, ReadPermission, RESTController, Task, UpdatePermission, \
+    allow_empty_body
 from .orchestrator import raise_if_no_orchestrator
 
 logger = logging.getLogger('controllers.osd')
@@ -51,8 +51,8 @@ def osd_task(name, metadata, wait_for=2.0):
     return Task("osd/{}".format(name), metadata, wait_for)
 
 
-@ApiController('/osd', Scope.OSD)
-@ControllerDoc('OSD management API', 'OSD')
+@APIRouter('/osd', Scope.OSD)
+@APIDoc('OSD management API', 'OSD')
 class Osd(RESTController):
     def list(self):
         osds = self.get_osd_map()
@@ -396,8 +396,8 @@ class Osd(RESTController):
         return CephService.send_command('mon', 'device ls-by-daemon', who='osd.{}'.format(svc_id))
 
 
-@ApiController('/osd/flags', Scope.OSD)
-@ControllerDoc(group='OSD')
+@APIRouter('/osd/flags', Scope.OSD)
+@APIDoc(group='OSD')
 class OsdFlagsController(RESTController):
     @staticmethod
     def _osd_flags():
index dff109dff256ae0663af1cc80f058192142c8881..7c272c6a801b5c3f6bb347bcaf86165e98545b1c 100644 (file)
@@ -6,7 +6,7 @@ import cherrypy
 from .. import mgr
 from ..security import Scope
 from ..services.ceph_service import CephService
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
 
 PERF_SCHEMA = {
     "mon.a": ({
@@ -32,50 +32,50 @@ class PerfCounter(RESTController):
             raise cherrypy.HTTPError(404, "{0} not found".format(error))
 
 
-@ApiController('perf_counters/mds', Scope.CEPHFS)
-@ControllerDoc("Mds Perf Counters Management API", "MdsPerfCounter")
+@APIRouter('perf_counters/mds', Scope.CEPHFS)
+@APIDoc("Mds Perf Counters Management API", "MdsPerfCounter")
 class MdsPerfCounter(PerfCounter):
     service_type = 'mds'
 
 
-@ApiController('perf_counters/mon', Scope.MONITOR)
-@ControllerDoc("Mon Perf Counters Management API", "MonPerfCounter")
+@APIRouter('perf_counters/mon', Scope.MONITOR)
+@APIDoc("Mon Perf Counters Management API", "MonPerfCounter")
 class MonPerfCounter(PerfCounter):
     service_type = 'mon'
 
 
-@ApiController('perf_counters/osd', Scope.OSD)
-@ControllerDoc("OSD Perf Counters Management API", "OsdPerfCounter")
+@APIRouter('perf_counters/osd', Scope.OSD)
+@APIDoc("OSD Perf Counters Management API", "OsdPerfCounter")
 class OsdPerfCounter(PerfCounter):
     service_type = 'osd'
 
 
-@ApiController('perf_counters/rgw', Scope.RGW)
-@ControllerDoc("Rgw Perf Counters Management API", "RgwPerfCounter")
+@APIRouter('perf_counters/rgw', Scope.RGW)
+@APIDoc("Rgw Perf Counters Management API", "RgwPerfCounter")
 class RgwPerfCounter(PerfCounter):
     service_type = 'rgw'
 
 
-@ApiController('perf_counters/rbd-mirror', Scope.RBD_MIRRORING)
-@ControllerDoc("Rgw Mirroring Perf Counters Management API", "RgwMirrorPerfCounter")
+@APIRouter('perf_counters/rbd-mirror', Scope.RBD_MIRRORING)
+@APIDoc("Rgw Mirroring Perf Counters Management API", "RgwMirrorPerfCounter")
 class RbdMirrorPerfCounter(PerfCounter):
     service_type = 'rbd-mirror'
 
 
-@ApiController('perf_counters/mgr', Scope.MANAGER)
-@ControllerDoc("Mgr Perf Counters Management API", "MgrPerfCounter")
+@APIRouter('perf_counters/mgr', Scope.MANAGER)
+@APIDoc("Mgr Perf Counters Management API", "MgrPerfCounter")
 class MgrPerfCounter(PerfCounter):
     service_type = 'mgr'
 
 
-@ApiController('perf_counters/tcmu-runner', Scope.ISCSI)
-@ControllerDoc("Tcmu Runner Perf Counters Management API", "TcmuRunnerPerfCounter")
+@APIRouter('perf_counters/tcmu-runner', Scope.ISCSI)
+@APIDoc("Tcmu Runner Perf Counters Management API", "TcmuRunnerPerfCounter")
 class TcmuRunnerPerfCounter(PerfCounter):
     service_type = 'tcmu-runner'
 
 
-@ApiController('perf_counters')
-@ControllerDoc("Perf Counters Management API", "PerfCounters")
+@APIRouter('perf_counters')
+@APIDoc("Perf Counters Management API", "PerfCounters")
 class PerfCounters(RESTController):
     @EndpointDoc("Display Perf Counters",
                  responses={200: PERF_SCHEMA})
index 32ec6c198f8799476cefca9ff9331f7dcb2e90cb..3ad1aa95f6d6841515a0a2801c61ae862001b926 100644 (file)
@@ -12,8 +12,8 @@ from ..services.ceph_service import CephService
 from ..services.exception import handle_send_command_error
 from ..services.rbd import RbdConfiguration
 from ..tools import TaskManager, str_to_bool
-from . import ApiController, ControllerDoc, Endpoint, EndpointDoc, \
-    ReadPermission, RESTController, Task, UiApiController
+from . import APIDoc, APIRouter, Endpoint, EndpointDoc, ReadPermission, \
+    RESTController, Task, UIRouter
 
 POOL_SCHEMA = ([{
     "pool": (int, "pool id"),
@@ -90,8 +90,8 @@ def pool_task(name, metadata, wait_for=2.0):
     return Task("pool/{}".format(name), metadata, wait_for)
 
 
-@ApiController('/pool', Scope.POOL)
-@ControllerDoc("Get pool details by pool name", "Pool")
+@APIRouter('/pool', Scope.POOL)
+@APIDoc("Get pool details by pool name", "Pool")
 class Pool(RESTController):
 
     @staticmethod
@@ -284,8 +284,8 @@ class Pool(RESTController):
         return RbdConfiguration(pool_name).list()
 
 
-@UiApiController('/pool', Scope.POOL)
-@ControllerDoc("Dashboard UI helper function; not part of the public API", "PoolUi")
+@UIRouter('/pool', Scope.POOL)
+@APIDoc("Dashboard UI helper function; not part of the public API", "PoolUi")
 class PoolUi(Pool):
     @Endpoint()
     @ReadPermission
index a06778f9a595a2ab0c9ce8546b5299d00d43c31a..057c92dd8f9cd4fdf020f02e9d3cd90e9a54934d 100644 (file)
@@ -9,10 +9,10 @@ import requests
 from ..exceptions import DashboardException
 from ..security import Scope
 from ..settings import Settings
-from . import ApiController, BaseController, Controller, ControllerDoc, Endpoint, RESTController
+from . import APIDoc, APIRouter, BaseController, Endpoint, RESTController, Router
 
 
-@Controller('/api/prometheus_receiver', secure=False)
+@Router('/api/prometheus_receiver', secure=False)
 class PrometheusReceiver(BaseController):
     """
     The receiver is needed in order to receive alert notifications (reports)
@@ -60,8 +60,8 @@ class PrometheusRESTController(RESTController):
         raise DashboardException(content, http_status_code=400, component='prometheus')
 
 
-@ApiController('/prometheus', Scope.PROMETHEUS)
-@ControllerDoc("Prometheus Management API", "Prometheus")
+@APIRouter('/prometheus', Scope.PROMETHEUS)
+@APIDoc("Prometheus Management API", "Prometheus")
 class Prometheus(PrometheusRESTController):
     def list(self, **params):
         return self.alert_proxy('GET', '/alerts', params)
@@ -83,8 +83,8 @@ class Prometheus(PrometheusRESTController):
         return self.alert_proxy('DELETE', '/silence/' + s_id) if s_id else None
 
 
-@ApiController('/prometheus/notifications', Scope.PROMETHEUS)
-@ControllerDoc("Prometheus Notifications Management API", "PrometheusNotifications")
+@APIRouter('/prometheus/notifications', Scope.PROMETHEUS)
+@APIDoc("Prometheus Notifications Management API", "PrometheusNotifications")
 class PrometheusNotifications(RESTController):
 
     def list(self, **params):
index 57fe06a00a65a5538ea63dcddd72f07646384992..39c5b59edc16e5788cbe401e34780301bb5cc0df 100644 (file)
@@ -19,9 +19,8 @@ from ..services.rbd import RbdConfiguration, RbdService, RbdSnapshotService, \
     format_bitmask, format_features, parse_image_spec, rbd_call, \
     rbd_image_call
 from ..tools import ViewCache, str_to_bool
-from . import ApiController, ControllerDoc, CreatePermission, \
-    DeletePermission, EndpointDoc, RESTController, Task, UpdatePermission, \
-    allow_empty_body
+from . import APIDoc, APIRouter, CreatePermission, DeletePermission, \
+    EndpointDoc, RESTController, Task, UpdatePermission, allow_empty_body
 
 logger = logging.getLogger(__name__)
 
@@ -67,8 +66,8 @@ def _sort_features(features, enable=True):
     features.sort(key=key_func, reverse=not enable)
 
 
-@ApiController('/block/image', Scope.RBD_IMAGE)
-@ControllerDoc("RBD Management API", "Rbd")
+@APIRouter('/block/image', Scope.RBD_IMAGE)
+@APIDoc("RBD Management API", "Rbd")
 class Rbd(RESTController):
 
     # set of image features that can be enable on existing images
@@ -265,8 +264,8 @@ class Rbd(RESTController):
         return rbd_call(pool_name, namespace, rbd_inst.trash_move, image_name, delay)
 
 
-@ApiController('/block/image/{image_spec}/snap', Scope.RBD_IMAGE)
-@ControllerDoc("RBD Snapshot Management API", "RbdSnapshot")
+@APIRouter('/block/image/{image_spec}/snap', Scope.RBD_IMAGE)
+@APIDoc("RBD Snapshot Management API", "RbdSnapshot")
 class RbdSnapshot(RESTController):
 
     RESOURCE_ID = "snapshot_name"
@@ -356,8 +355,8 @@ class RbdSnapshot(RESTController):
         rbd_call(pool_name, namespace, _parent_clone)
 
 
-@ApiController('/block/image/trash', Scope.RBD_IMAGE)
-@ControllerDoc("RBD Trash Management API", "RbdTrash")
+@APIRouter('/block/image/trash', Scope.RBD_IMAGE)
+@APIDoc("RBD Trash Management API", "RbdTrash")
 class RbdTrash(RESTController):
     RESOURCE_ID = "image_id_spec"
 
@@ -448,8 +447,8 @@ class RbdTrash(RESTController):
                         int(str_to_bool(force)))
 
 
-@ApiController('/block/pool/{pool_name}/namespace', Scope.RBD_IMAGE)
-@ControllerDoc("RBD Namespace Management API", "RbdNamespace")
+@APIRouter('/block/pool/{pool_name}/namespace', Scope.RBD_IMAGE)
+@APIDoc("RBD Namespace Management API", "RbdNamespace")
 class RbdNamespace(RESTController):
 
     def __init__(self):
index 0c41d71375cfbec591f6484c385ac9b555145fab..a472fbd49e499e440af933a3887757095ec7f84e 100644 (file)
@@ -15,9 +15,8 @@ from ..services.ceph_service import CephService
 from ..services.exception import handle_rados_error, handle_rbd_error, serialize_dashboard_exception
 from ..services.rbd import rbd_call
 from ..tools import ViewCache
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, RESTController, Task, UpdatePermission, \
-    allow_empty_body
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, RESTController, Task, UpdatePermission, allow_empty_body
 
 try:
     from typing import no_type_check
@@ -359,8 +358,8 @@ RBDM_SUMMARY_SCHEMA = {
 }
 
 
-@ApiController('/block/mirroring', Scope.RBD_MIRRORING)
-@ControllerDoc("RBD Mirroring Management API", "RbdMirroring")
+@APIRouter('/block/mirroring', Scope.RBD_MIRRORING)
+@APIDoc("RBD Mirroring Management API", "RbdMirroring")
 class RbdMirroring(BaseController):
 
     @Endpoint(method='GET', path='site_name')
@@ -382,8 +381,8 @@ class RbdMirroring(BaseController):
         return {'site_name': rbd.RBD().mirror_site_name_get(mgr.rados)}
 
 
-@ApiController('/block/mirroring/summary', Scope.RBD_MIRRORING)
-@ControllerDoc("RBD Mirroring Summary Management API", "RbdMirroringSummary")
+@APIRouter('/block/mirroring/summary', Scope.RBD_MIRRORING)
+@APIDoc("RBD Mirroring Summary Management API", "RbdMirroringSummary")
 class RbdMirroringSummary(BaseController):
 
     @Endpoint()
@@ -400,8 +399,8 @@ class RbdMirroringSummary(BaseController):
                 'content_data': content_data}
 
 
-@ApiController('/block/mirroring/pool', Scope.RBD_MIRRORING)
-@ControllerDoc("RBD Mirroring Pool Mode Management API", "RbdMirroringPoolMode")
+@APIRouter('/block/mirroring/pool', Scope.RBD_MIRRORING)
+@APIDoc("RBD Mirroring Pool Mode Management API", "RbdMirroringPoolMode")
 class RbdMirroringPoolMode(RESTController):
 
     RESOURCE_ID = "pool_name"
@@ -442,9 +441,8 @@ class RbdMirroringPoolMode(RESTController):
         return rbd_call(pool_name, None, _edit, mirror_mode)
 
 
-@ApiController('/block/mirroring/pool/{pool_name}/bootstrap',
-               Scope.RBD_MIRRORING)
-@ControllerDoc("RBD Mirroring Pool Bootstrap Management API", "RbdMirroringPoolBootstrap")
+@APIRouter('/block/mirroring/pool/{pool_name}/bootstrap', Scope.RBD_MIRRORING)
+@APIDoc("RBD Mirroring Pool Bootstrap Management API", "RbdMirroringPoolBootstrap")
 class RbdMirroringPoolBootstrap(BaseController):
 
     @Endpoint(method='POST', path='token')
@@ -476,8 +474,8 @@ class RbdMirroringPoolBootstrap(BaseController):
         return {}
 
 
-@ApiController('/block/mirroring/pool/{pool_name}/peer', Scope.RBD_MIRRORING)
-@ControllerDoc("RBD Mirroring Pool Peer Management API", "RbdMirroringPoolPeer")
+@APIRouter('/block/mirroring/pool/{pool_name}/peer', Scope.RBD_MIRRORING)
+@APIDoc("RBD Mirroring Pool Peer Management API", "RbdMirroringPoolPeer")
 class RbdMirroringPoolPeer(RESTController):
 
     RESOURCE_ID = "peer_uuid"
index c5ba6384fa2eda7c7dfce880812230515dc171cd..5f599b96c941689f3d0d45fcdae23d61e4d20644 100644 (file)
@@ -13,11 +13,12 @@ from ..services.auth import AuthManager, JwtManager
 from ..services.ceph_service import CephService
 from ..services.rgw_client import NoRgwDaemonsException, RgwClient
 from ..tools import json_str_to_object, str_to_bool
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, ReadPermission, RESTController, allow_empty_body
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    ReadPermission, RESTController, allow_empty_body
+from ._version import APIVersion
 
 try:
-    from typing import Any, List, Optional
+    from typing import Any, Dict, List, Optional, Union
 except ImportError:  # pragma: no cover
     pass  # Just for type checking
 
@@ -41,8 +42,8 @@ RGW_USER_SCHEMA = {
 }
 
 
-@ApiController('/rgw', Scope.RGW)
-@ControllerDoc("RGW Management API", "Rgw")
+@APIRouter('/rgw', Scope.RGW)
+@APIDoc("RGW Management API", "Rgw")
 class Rgw(BaseController):
     @Endpoint()
     @ReadPermission
@@ -79,8 +80,8 @@ class Rgw(BaseController):
         return status
 
 
-@ApiController('/rgw/daemon', Scope.RGW)
-@ControllerDoc("RGW Daemon Management API", "RgwDaemon")
+@APIRouter('/rgw/daemon', Scope.RGW)
+@APIDoc("RGW Daemon Management API", "RgwDaemon")
 class RgwDaemon(RESTController):
     @EndpointDoc("Display RGW Daemons",
                  responses={200: [RGW_DAEMON_SCHEMA]})
@@ -101,6 +102,7 @@ class RgwDaemon(RESTController):
                     'service_map_id': service['id'],
                     'version': metadata['ceph_version'],
                     'server_hostname': hostname,
+                    'realm_name': metadata['realm_name'],
                     'zonegroup_name': metadata['zonegroup_name'],
                     'zone_name': metadata['zone_name'],
                     'default': instance.daemon.name == metadata['id']
@@ -150,21 +152,23 @@ class RgwRESTController(RESTController):
             raise DashboardException(e, http_status_code=http_status_code, component='rgw')
 
 
-@ApiController('/rgw/site', Scope.RGW)
-@ControllerDoc("RGW Site Management API", "RgwSite")
+@APIRouter('/rgw/site', Scope.RGW)
+@APIDoc("RGW Site Management API", "RgwSite")
 class RgwSite(RgwRESTController):
     def list(self, query=None, daemon_name=None):
         if query == 'placement-targets':
             return RgwClient.admin_instance(daemon_name=daemon_name).get_placement_targets()
         if query == 'realms':
             return RgwClient.admin_instance(daemon_name=daemon_name).get_realms()
+        if query == 'default-realm':
+            return RgwClient.admin_instance(daemon_name=daemon_name).get_default_realm()
 
         # @TODO: for multisite: by default, retrieve cluster topology/map.
         raise DashboardException(http_status_code=501, component='rgw', msg='Not Implemented')
 
 
-@ApiController('/rgw/bucket', Scope.RGW)
-@ControllerDoc("RGW Bucket Management API", "RgwBucket")
+@APIRouter('/rgw/bucket', Scope.RGW)
+@APIDoc("RGW Bucket Management API", "RgwBucket")
 class RgwBucket(RgwRESTController):
     def _append_bid(self, bucket):
         """
@@ -232,9 +236,12 @@ class RgwBucket(RgwRESTController):
             bucket_name = '{}:{}'.format(tenant, bucket_name)
         return bucket_name
 
-    def list(self, stats=False, daemon_name=None):
-        # type: (bool, Optional[str]) -> List[Any]
-        query_params = '?stats' if str_to_bool(stats) else ''
+    @RESTController.MethodMap(version=APIVersion(1, 1))  # type: ignore
+    def list(self, stats: bool = False, daemon_name: Optional[str] = None,
+             uid: Optional[str] = None) -> List[Union[str, Dict[str, Any]]]:
+        query_params = f'?stats={str_to_bool(stats)}'
+        if uid and uid.strip():
+            query_params = f'{query_params}&uid={uid.strip()}'
         result = self.proxy(daemon_name, 'GET', 'bucket{}'.format(query_params))
 
         if stats:
@@ -325,8 +332,8 @@ class RgwBucket(RgwRESTController):
         }, json_response=False)
 
 
-@ApiController('/rgw/user', Scope.RGW)
-@ControllerDoc("RGW User Management API", "RgwUser")
+@APIRouter('/rgw/user', Scope.RGW)
+@APIDoc("RGW User Management API", "RgwUser")
 class RgwUser(RgwRESTController):
     def _append_uid(self, user):
         """
index 32404237c4a7c17bf3dafdc5632df53f7de3f7b3..197c037647387b7663d08ed2e79a1bf7ad13e44c 100644 (file)
@@ -9,8 +9,7 @@ from ..exceptions import DashboardException, RoleAlreadyExists, \
 from ..security import Permission
 from ..security import Scope as SecurityScope
 from ..services.access_control import SYSTEM_ROLES
-from . import ApiController, ControllerDoc, CreatePermission, EndpointDoc, \
-    RESTController, UiApiController
+from . import APIDoc, APIRouter, CreatePermission, EndpointDoc, RESTController, UIRouter
 
 ROLE_SCHEMA = [{
     "name": (str, "Role Name"),
@@ -22,8 +21,8 @@ ROLE_SCHEMA = [{
 }]
 
 
-@ApiController('/role', SecurityScope.USER)
-@ControllerDoc("Role Management API", "Role")
+@APIRouter('/role', SecurityScope.USER)
+@APIDoc("Role Management API", "Role")
 class Role(RESTController):
     @staticmethod
     def _role_to_dict(role):
@@ -139,7 +138,7 @@ class Role(RESTController):
                             role.get('scopes_permissions'))
 
 
-@UiApiController('/scope', SecurityScope.USER)
+@UIRouter('/scope', SecurityScope.USER)
 class Scope(RESTController):
     def list(self):
         return SecurityScope.all_scopes()
index fb8278068b1a61a43bca095180cbb5e84b5ebe31..6de8cf0df73d12179dde435d2fe14316fce5c0f8 100644 (file)
@@ -16,10 +16,10 @@ from .. import mgr
 from ..exceptions import UserDoesNotExist
 from ..services.auth import JwtManager
 from ..tools import prepare_url_prefix
-from . import BaseController, Controller, ControllerAuthMixin, Endpoint, allow_empty_body
+from . import BaseController, ControllerAuthMixin, Endpoint, Router, allow_empty_body
 
 
-@Controller('/auth/saml2', secure=False)
+@Router('/auth/saml2', secure=False)
 class Saml2(BaseController, ControllerAuthMixin):
 
     @staticmethod
index b3c3ab94798bf4c4788ec29cb68057c7823fb74b..d3ba882a1d92633ab143fc86df0008f0751e6657 100644 (file)
@@ -7,8 +7,8 @@ from ..exceptions import DashboardException
 from ..security import Scope
 from ..services.exception import handle_orchestrator_error
 from ..services.orchestrator import OrchClient, OrchFeature
-from . import ApiController, ControllerDoc, CreatePermission, \
-    DeletePermission, Endpoint, ReadPermission, RESTController, Task
+from . import APIDoc, APIRouter, CreatePermission, DeletePermission, Endpoint, \
+    ReadPermission, RESTController, Task
 from .orchestrator import raise_if_no_orchestrator
 
 
@@ -16,8 +16,8 @@ def service_task(name, metadata, wait_for=2.0):
     return Task("service/{}".format(name), metadata, wait_for)
 
 
-@ApiController('/service', Scope.HOSTS)
-@ControllerDoc("Service Management API", "Service")
+@APIRouter('/service', Scope.HOSTS)
+@APIDoc("Service Management API", "Service")
 class Service(RESTController):
 
     @Endpoint()
index 7d9ca9fb316a60e279347c94d49f4bfbe8c6e2a4..5df9ab1c90fdedac1b928c6f54395c9f452da73c 100644 (file)
@@ -8,7 +8,7 @@ import cherrypy
 from ..security import Scope
 from ..settings import Options
 from ..settings import Settings as SettingsModule
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController, UiApiController
+from . import APIDoc, APIRouter, EndpointDoc, RESTController, UIRouter
 
 SETTINGS_SCHEMA = [{
     "name": (str, 'Settings Name'),
@@ -18,8 +18,8 @@ SETTINGS_SCHEMA = [{
 }]
 
 
-@ApiController('/settings', Scope.CONFIG_OPT)
-@ControllerDoc("Settings Management API", "Settings")
+@APIRouter('/settings', Scope.CONFIG_OPT)
+@APIDoc("Settings Management API", "Settings")
 class Settings(RESTController):
     """
     Enables to manage the settings of the dashboard (not the Ceph cluster).
@@ -104,7 +104,7 @@ class Settings(RESTController):
                 setattr(SettingsModule, self._to_native(name), value)
 
 
-@UiApiController('/standard_settings')
+@UIRouter('/standard_settings')
 class StandardSettings(RESTController):
     def list(self):
         """
index 4e240b9770bd022be848b35919f89aaf1c7202e5..25e4669965323f93396efb7382b7baf765b91c86 100644 (file)
@@ -9,7 +9,7 @@ from ..exceptions import ViewCacheNoDataException
 from ..security import Permission, Scope
 from ..services import progress
 from ..tools import TaskManager
-from . import ApiController, BaseController, ControllerDoc, Endpoint, EndpointDoc
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc
 
 SUMMARY_SCHEMA = {
     "health_status": (str, ""),
@@ -38,8 +38,8 @@ SUMMARY_SCHEMA = {
 }
 
 
-@ApiController('/summary')
-@ControllerDoc("Get Ceph Summary Details", "Summary")
+@APIRouter('/summary')
+@APIDoc("Get Ceph Summary Details", "Summary")
 class Summary(BaseController):
     def _health_status(self):
         health_data = mgr.get("health")
index 16c5017822e308c4adb40de4c365b159c0036863..14e763b752aa84df665a456d0bca8a20393c95ec 100644 (file)
@@ -3,7 +3,7 @@ from __future__ import absolute_import
 
 from ..services import progress
 from ..tools import TaskManager
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
 
 TASK_SCHEMA = {
     "executing_tasks": (str, "ongoing executing tasks"),
@@ -23,8 +23,8 @@ TASK_SCHEMA = {
 }
 
 
-@ApiController('/task')
-@ControllerDoc("Task Management API", "Task")
+@APIRouter('/task')
+@APIDoc("Task Management API", "Task")
 class Task(RESTController):
     @EndpointDoc("Display Tasks",
                  parameters={
index 9e3d3e1cbb06c283812c5002ebe8df0053b1a661..b1f714bc38e0ad5915add11ed01ab29448324e2f 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 from .. import mgr
 from ..exceptions import DashboardException
 from ..security import Scope
-from . import ApiController, ControllerDoc, EndpointDoc, RESTController
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
 
 REPORT_SCHEMA = {
     "report": ({
@@ -201,8 +201,8 @@ REPORT_SCHEMA = {
 }
 
 
-@ApiController('/telemetry', Scope.CONFIG_OPT)
-@ControllerDoc("Display Telemetry Report", "Telemetry")
+@APIRouter('/telemetry', Scope.CONFIG_OPT)
+@APIDoc("Display Telemetry Report", "Telemetry")
 class Telemetry(RESTController):
 
     @RESTController.Collection('GET')
index 8d340fedccb4a3fd9861c0d021546873741c3daf..53df8eab90b1f645054acf6b1a1dcd6682f632ae 100644 (file)
@@ -13,8 +13,8 @@ from ..exceptions import DashboardException, PasswordPolicyException, \
 from ..security import Scope
 from ..services.access_control import SYSTEM_ROLES, PasswordPolicy
 from ..services.auth import JwtManager
-from . import ApiController, BaseController, ControllerDoc, Endpoint, \
-    EndpointDoc, RESTController, allow_empty_body, validate_ceph_type
+from . import APIDoc, APIRouter, BaseController, Endpoint, EndpointDoc, \
+    RESTController, allow_empty_body, validate_ceph_type
 
 USER_SCHEMA = ([{
     "username": (str, 'Username of the user'),
@@ -47,8 +47,8 @@ def validate_password_policy(password, username=None, old_password=None):
                                  component='user')
 
 
-@ApiController('/user', Scope.USER)
-@ControllerDoc("Display User Details", "User")
+@APIRouter('/user', Scope.USER)
+@APIDoc("Display User Details", "User")
 class User(RESTController):
 
     @staticmethod
@@ -158,8 +158,8 @@ class User(RESTController):
         return User._user_to_dict(user)
 
 
-@ApiController('/user')
-@ControllerDoc("Get User Password Policy Details", "UserPasswordPolicy")
+@APIRouter('/user')
+@APIDoc("Get User Password Policy Details", "UserPasswordPolicy")
 class UserPasswordPolicy(RESTController):
 
     @Endpoint('POST')
@@ -191,8 +191,8 @@ class UserPasswordPolicy(RESTController):
         return result
 
 
-@ApiController('/user/{username}')
-@ControllerDoc("Change User Password", "UserChangePassword")
+@APIRouter('/user/{username}')
+@APIDoc("Change User Password", "UserChangePassword")
 class UserChangePassword(BaseController):
 
     @Endpoint('POST')
index 5b1ec7ebdcd67c13a19ee22382c0501877ec0323..3a3dac350acb197e4b81fe13733f027bd946f2fb 100644 (file)
@@ -77,7 +77,6 @@
               "optimization": true,
               "outputHashing": "all",
               "sourceMap": false,
-              "extractCss": true,
               "namedChunks": false,
               "extractLicenses": true,
               "vendorChunk": false,
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/applitools.config.js b/ceph/src/pybind/mgr/dashboard/frontend/applitools.config.js
new file mode 100644 (file)
index 0000000..342a356
--- /dev/null
@@ -0,0 +1,14 @@
+module.exports = {
+  appName: 'Ceph Dashboard',
+  apiKey: process.env.APPLITOOLS_API_KEY,
+  browser: [
+    { width: 1920, height: 1080, name: 'chrome' },
+    { width: 1920, height: 1080, name: 'firefox' },
+    { width: 800, height: 600, name: 'chrome' },
+    { width: 800, height: 600, name: 'firefox' }
+  ],
+  showLogs: true,
+  saveDebugData: true,
+  failCypressOnDiff: true,
+  concurrency: 4
+};
index cf8832bb9bbc07ac98d10d67821facf87847d350..5c89359db790e64ba0c22dd4099ec782feb5a328 100644 (file)
@@ -13,7 +13,7 @@ describe('Images page', () => {
     // Need pool for image testing
     pools.navigateTo('create');
     pools.create(poolName, 8, 'rbd');
-    pools.exist(poolName, true);
+    pools.existTableCell(poolName);
   });
 
   after(() => {
@@ -21,7 +21,7 @@ describe('Images page', () => {
     pools.navigateTo();
     pools.delete(poolName);
     pools.navigateTo();
-    pools.exist(poolName, false);
+    pools.existTableCell(poolName, false);
   });
 
   beforeEach(() => {
index ddee817e18ef1232baf21395347679455d739d63..120956579d8d188feccf9f8f0a10eb49acf725e2 100644 (file)
@@ -32,7 +32,7 @@ describe('Mirroring page', () => {
       pools.navigateTo('create'); // Need pool for mirroring testing
       pools.create(poolName, 8, 'rbd');
       pools.navigateTo();
-      pools.exist(poolName, true);
+      pools.existTableCell(poolName, true);
     });
 
     it('tests editing mode for pools', () => {
index f9bc8d43f5d453bf0322478ec0a7aa9907023f2b..d022d59cfa9a2ea85e8f1396bd92eaca42c54292 100644 (file)
@@ -31,6 +31,7 @@ describe('Configuration page', () => {
 
     beforeEach(() => {
       configuration.clearTableSearchInput();
+      configuration.getTableCount('found').as('configFound');
     });
 
     after(() => {
@@ -49,14 +50,29 @@ describe('Configuration page', () => {
       );
     });
 
-    it('should show only modified configurations', () => {
+    it('should verify modified filter is applied properly', () => {
+      configuration.filterTable('Modified', 'no');
+      configuration.getTableCount('found').as('unmodifiedConfigs');
+
+      // Modified filter value to yes
       configuration.filterTable('Modified', 'yes');
-      configuration.getTableCount('found').should('eq', 2);
-    });
+      configuration.getTableCount('found').as('modifiedConfigs');
+
+      cy.get('@configFound').then((configFound) => {
+        cy.get('@unmodifiedConfigs').then((unmodifiedConfigs) => {
+          const modifiedConfigs = Number(configFound) - Number(unmodifiedConfigs);
+          configuration.getTableCount('found').should('eq', modifiedConfigs);
+        });
+      });
 
-    it('should hide all modified configurations', () => {
+      // Modified filter value to no
       configuration.filterTable('Modified', 'no');
-      configuration.getTableCount('found').should('gt', 1);
+      cy.get('@configFound').then((configFound) => {
+        cy.get('@modifiedConfigs').then((modifiedConfigs) => {
+          const unmodifiedConfigs = Number(configFound) - Number(modifiedConfigs);
+          configuration.getTableCount('found').should('eq', unmodifiedConfigs);
+        });
+      });
     });
   });
 });
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/create-cluster.po.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/create-cluster.po.ts
new file mode 100644 (file)
index 0000000..52be703
--- /dev/null
@@ -0,0 +1,70 @@
+import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
+import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
+import { PageHelper } from 'cypress/integration/page-helper.po';
+import { NotificationSidebarPageHelper } from 'cypress/integration/ui/notification.po';
+
+const pages = {
+  index: { url: '#/expand-cluster', id: 'cd-create-cluster' }
+};
+export class CreateClusterWizardHelper extends PageHelper {
+  pages = pages;
+
+  createCluster() {
+    cy.get('cd-create-cluster').should('contain.text', 'Please expand your cluster first');
+    cy.get('[name=expand-cluster]').click();
+    cy.get('cd-wizard').should('exist');
+  }
+
+  doSkip() {
+    cy.get('[name=skip-cluster-creation]').click();
+    cy.contains('cd-modal button', 'Continue').click();
+
+    cy.get('cd-dashboard').should('exist');
+    const notification = new NotificationSidebarPageHelper();
+    notification.open();
+    notification.getNotifications().should('contain', 'Cluster expansion skipped by user');
+  }
+
+  createOSD(deviceType: 'hdd' | 'ssd') {
+    // Click Primary devices Add button
+    cy.get('cd-osd-devices-selection-groups[name="Primary"]').as('primaryGroups');
+    cy.get('@primaryGroups').find('button').click();
+
+    // Select all devices with `deviceType`
+    cy.get('cd-osd-devices-selection-modal').within(() => {
+      cy.get('.modal-footer .tc_submitButton').as('addButton').should('be.disabled');
+      this.filterTable('Type', deviceType);
+      this.getTableCount('total').should('be.gte', 1);
+      cy.get('@addButton').click();
+    });
+  }
+}
+
+export class CreateClusterHostPageHelper extends HostsPageHelper {
+  pages = {
+    index: { url: '#/expand-cluster', id: 'cd-wizard' },
+    add: { url: '', id: 'cd-host-form' }
+  };
+
+  columnIndex = {
+    hostname: 1,
+    labels: 2,
+    status: 3,
+    services: 0
+  };
+}
+
+export class CreateClusterServicePageHelper extends ServicesPageHelper {
+  pages = {
+    index: { url: '#/expand-cluster', id: 'cd-wizard' },
+    create: { url: '', id: 'cd-service-form' }
+  };
+
+  columnIndex = {
+    service_name: 1,
+    placement: 2,
+    running: 0,
+    size: 0,
+    last_refresh: 0
+  };
+}
index 6752fe9e7870cb511c98f8ff9ff073137ceeeb6e..86ea0ffbac01b1778e4fee26d63c969352151f29 100644 (file)
@@ -2,7 +2,7 @@ import { PageHelper } from '../page-helper.po';
 
 const pages = {
   index: { url: '#/hosts', id: 'cd-hosts' },
-  create: { url: '#/hosts/create', id: 'cd-host-form' }
+  add: { url: '#/hosts/(modal:add)', id: 'cd-host-form' }
 };
 
 export class HostsPageHelper extends PageHelper {
@@ -41,33 +41,35 @@ export class HostsPageHelper extends PageHelper {
       });
   }
 
-  @PageHelper.restrictTo(pages.index.url)
-  clickHostTab(hostname: string, tabName: string) {
-    this.getExpandCollapseElement(hostname).click();
-    cy.get('cd-host-details').within(() => {
-      this.getTab(tabName).click();
-    });
-  }
-
-  @PageHelper.restrictTo(pages.create.url)
-  add(hostname: string, exist?: boolean, maintenance?: boolean) {
-    cy.get(`${this.pages.create.id}`).within(() => {
+  add(hostname: string, exist?: boolean, maintenance?: boolean, labels: string[] = []) {
+    cy.get(`${this.pages.add.id}`).within(() => {
       cy.get('#hostname').type(hostname);
       if (maintenance) {
         cy.get('label[for=maintenance]').click();
       }
-      cy.get('cd-submit-button').click();
+      if (exist) {
+        cy.get('#hostname').should('have.class', 'ng-invalid');
+      }
     });
-    if (exist) {
-      cy.get('#hostname').should('have.class', 'ng-invalid');
-    } else {
-      // back to host list
-      cy.get(`${this.pages.index.id}`);
+
+    if (labels.length) {
+      this.selectPredefinedLabels(labels);
+    }
+
+    cy.get('cd-submit-button').click();
+    // back to host list
+    cy.get(`${this.pages.index.id}`);
+  }
+
+  selectPredefinedLabels(labels: string[]) {
+    cy.get('a[data-testid=select-menu-edit]').click();
+    for (const label of labels) {
+      cy.get('.popover-body div.select-menu-item-content').contains(label).click();
     }
   }
 
-  @PageHelper.restrictTo(pages.index.url)
   checkExist(hostname: string, exist: boolean) {
+    this.clearTableSearchInput();
     this.getTableCell(this.columnIndex.hostname, hostname).should(($elements) => {
       const hosts = $elements.map((_, el) => el.textContent).get();
       if (exist) {
@@ -78,13 +80,11 @@ export class HostsPageHelper extends PageHelper {
     });
   }
 
-  @PageHelper.restrictTo(pages.index.url)
   delete(hostname: string) {
-    super.delete(hostname, this.columnIndex.hostname);
+    super.delete(hostname, this.columnIndex.hostname, 'hosts');
   }
 
   // Add or remove labels on a host, then verify labels in the table
-  @PageHelper.restrictTo(pages.index.url)
   editLabels(hostname: string, labels: string[], add: boolean) {
     this.getTableCell(this.columnIndex.hostname, hostname).click();
     this.clickActionButton('edit');
@@ -104,7 +104,10 @@ export class HostsPageHelper extends PageHelper {
       }
     }
     cy.get('cd-modal cd-submit-button').click();
+    this.checkLabelExists(hostname, labels, add);
+  }
 
+  checkLabelExists(hostname: string, labels: string[], add: boolean) {
     // Verify labels are added or removed from Labels column
     // First find row with hostname, then find labels in the row
     this.getTableCell(this.columnIndex.hostname, hostname)
index 731275e26d1c15a2d3812423b7218be19a962fac..9868b89aedbc5489298b34355d7a092078a44a06 100644 (file)
@@ -45,7 +45,7 @@ describe('Logs page', () => {
       pools.navigateTo('create');
       pools.create(poolname, 8);
       pools.navigateTo();
-      pools.exist(poolname, true);
+      pools.existTableCell(poolname, true);
       logs.checkAuditForPoolFunction(poolname, 'create', hour, minute);
     });
 
index 55763285e290efadc111765b477a08b1a293a52a..50bd6121ce5fac38beea77ef8a677b52c5b31468 100644 (file)
@@ -2,7 +2,7 @@ import { PageHelper } from '../page-helper.po';
 
 const pages = {
   index: { url: '#/services', id: 'cd-services' },
-  create: { url: '#/services/create', id: 'cd-service-form' }
+  create: { url: '#/services/(modal:create)', id: 'cd-service-form' }
 };
 
 export class ServicesPageHelper extends PageHelper {
@@ -16,6 +16,12 @@ export class ServicesPageHelper extends PageHelper {
     last_refresh: 6
   };
 
+  serviceDetailColumnIndex = {
+    hostname: 1,
+    daemonType: 2,
+    status: 8
+  };
+
   check_for_service() {
     this.getTableCount('total').should('not.be.eq', 0);
   }
@@ -24,19 +30,34 @@ export class ServicesPageHelper extends PageHelper {
     return this.selectOption('service_type', serviceType);
   }
 
-  @PageHelper.restrictTo(pages.create.url)
-  addService(serviceType: string, exist?: boolean) {
+  clickServiceTab(serviceName: string, tabName: string) {
+    this.getExpandCollapseElement(serviceName).click();
+    cy.get('cd-service-details').within(() => {
+      this.getTab(tabName).click();
+    });
+  }
+
+  addService(serviceType: string, exist?: boolean, count = '1') {
     cy.get(`${this.pages.create.id}`).within(() => {
       this.selectServiceType(serviceType);
-      if (serviceType === 'rgw') {
-        cy.get('#service_id').type('rgw.foo');
-        cy.get('#count').type('1');
-      } else if (serviceType === 'ingress') {
-        this.selectOption('backend_service', 'rgw.rgw.foo');
-        cy.get('#service_id').should('have.value', 'rgw.rgw.foo');
-        cy.get('#virtual_ip').type('192.168.20.1/24');
-        cy.get('#frontend_port').type('8081');
-        cy.get('#monitor_port').type('8082');
+      switch (serviceType) {
+        case 'rgw':
+          cy.get('#service_id').type('foo');
+          cy.get('#count').type(count);
+          break;
+
+        case 'ingress':
+          this.selectOption('backend_service', 'rgw.foo');
+          cy.get('#service_id').should('have.value', 'rgw.foo');
+          cy.get('#virtual_ip').type('192.168.20.1/24');
+          cy.get('#frontend_port').type('8081');
+          cy.get('#monitor_port').type('8082');
+          break;
+
+        case 'nfs':
+          cy.get('#service_id').type('testnfs');
+          cy.get('#count').type(count);
+          break;
       }
 
       cy.get('cd-submit-button').click();
@@ -49,7 +70,36 @@ export class ServicesPageHelper extends PageHelper {
     }
   }
 
-  @PageHelper.restrictTo(pages.index.url)
+  editService(name: string, count: string) {
+    this.navigateEdit(name, true, false);
+    cy.get(`${this.pages.create.id}`).within(() => {
+      cy.get('#service_type').should('be.disabled');
+      cy.get('#service_id').should('be.disabled');
+      cy.get('#count').clear().type(count);
+      cy.get('cd-submit-button').click();
+    });
+  }
+
+  checkServiceStatus(daemon: string) {
+    this.getTableCell(this.serviceDetailColumnIndex.daemonType, daemon)
+      .parent()
+      .find(`datatable-body-cell:nth-child(${this.serviceDetailColumnIndex.status}) .badge`)
+      .should(($ele) => {
+        const status = $ele.toArray().map((v) => v.innerText);
+        expect(status).to.include('running');
+      });
+  }
+
+  expectPlacementCount(serviceName: string, expectedCount: string) {
+    this.getTableCell(this.columnIndex.service_name, serviceName)
+      .parent()
+      .find(`datatable-body-cell:nth-child(${this.columnIndex.placement})`)
+      .should(($ele) => {
+        const running = $ele.text().split(';');
+        expect(running).to.include(`count:${expectedCount}`);
+      });
+  }
+
   checkExist(serviceName: string, exist: boolean) {
     this.getTableCell(this.columnIndex.service_name, serviceName).should(($elements) => {
       const services = $elements.map((_, el) => el.textContent).get();
@@ -61,8 +111,7 @@ export class ServicesPageHelper extends PageHelper {
     });
   }
 
-  @PageHelper.restrictTo(pages.index.url)
-  deleteService(serviceName: string, wait: number) {
+  deleteService(serviceName: string) {
     const getRow = this.getTableCell.bind(this, this.columnIndex.service_name);
     getRow(serviceName).click();
 
@@ -75,10 +124,6 @@ export class ServicesPageHelper extends PageHelper {
 
     // Wait for modal to close
     cy.get('cd-modal').should('not.exist');
-
-    // wait for delete operation to complete: tearing down the service daemons
-    cy.wait(wait);
-
     this.checkExist(serviceName, false);
   }
 }
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts-force-maintenance.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts-force-maintenance.e2e-spec.ts
deleted file mode 100644 (file)
index 9a176e6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-import { HostsPageHelper } from '../cluster/hosts.po';
-
-describe('Hosts page', () => {
-  const hosts = new HostsPageHelper();
-
-  beforeEach(() => {
-    cy.login();
-    Cypress.Cookies.preserveOnce('token');
-    hosts.navigateTo();
-  });
-
-  describe('when Orchestrator is available', () => {
-    beforeEach(function () {
-      cy.fixture('orchestrator/inventory.json').as('hosts');
-      cy.fixture('orchestrator/services.json').as('services');
-    });
-
-    it('should force enter host into maintenance', function () {
-      const hostname = Cypress._.sample(this.hosts).name;
-      const hostnameList = new Array();
-      this.hosts.array.forEach((host: any) => {
-        hostnameList.push(host.hostname);
-      });
-      const serviceList = new Array();
-      this.services.forEach((service: any) => {
-        if (hostname === service.hostname) {
-          serviceList.push(service.daemon_type);
-        }
-      });
-
-      let enterMaintenance = true;
-
-      // Force maintenance might throw out error if host are less than 3.
-      if (hostnameList.length < 3) {
-        enterMaintenance = false;
-      }
-
-      serviceList.forEach((service: string) => {
-        if (service !== 'rgw' && (service === 'mgr' || service === 'alertmanager')) {
-          enterMaintenance = false;
-        }
-      });
-
-      if (enterMaintenance) {
-        hosts.maintenance(hostname, true, true);
-      }
-    });
-  });
-});
index cf85642a1b1d2ef997d10bb9e65f1bed895998a5..5344fcaed3bedf60968ad167066d0c1740f84747 100644 (file)
@@ -17,23 +17,35 @@ describe('Hosts page', () => {
 
     it('should not add an exsiting host', function () {
       const hostname = Cypress._.sample(this.hosts).name;
-      hosts.navigateTo('create');
+      hosts.navigateTo('add');
       hosts.add(hostname, true);
     });
 
-    it('should delete a host and add it back', function () {
-      const host = Cypress._.last(this.hosts)['name'];
-      hosts.delete(host);
+    it('should drain and delete a host and then add it back', function () {
+      const hostname = Cypress._.last(this.hosts)['name'];
+
+      // should drain the host first before deleting
+      hosts.editLabels(hostname, ['_no_schedule'], true);
+      hosts.clickTab('cd-host-details', hostname, 'Daemons');
+      cy.get('cd-host-details').within(() => {
+        // draining will take some time to complete.
+        // since we don't know how many daemons will be
+        // running in this host in future putting the wait
+        // to 15s
+        cy.wait(15000);
+        hosts.getTableCount('total').should('be.eq', 0);
+      });
+      hosts.delete(hostname);
 
       // add it back
-      hosts.navigateTo('create');
-      hosts.add(host);
-      hosts.checkExist(host, true);
+      hosts.navigateTo('add');
+      hosts.add(hostname);
+      hosts.checkExist(hostname, true);
     });
 
     it('should display inventory', function () {
       for (const host of this.hosts) {
-        hosts.clickHostTab(host.name, 'Physical Disks');
+        hosts.clickTab('cd-host-details', host.name, 'Physical Disks');
         cy.get('cd-host-details').within(() => {
           hosts.getTableCount('total').should('be.gte', 0);
         });
@@ -42,7 +54,7 @@ describe('Hosts page', () => {
 
     it('should display daemons', function () {
       for (const host of this.hosts) {
-        hosts.clickHostTab(host.name, 'Daemons');
+        hosts.clickTab('cd-host-details', host.name, 'Daemons');
         cy.get('cd-host-details').within(() => {
           hosts.getTableCount('total').should('be.gte', 0);
         });
index 43e8aee595d8cf9b25ae105c6b4d7c382680fec7..f26228510f5e99e8fdbc123bef45652f3978b41f 100644 (file)
@@ -16,7 +16,7 @@ describe('Hosts page', () => {
 
     it('should display correct inventory', function () {
       for (const host of this.hosts) {
-        hosts.clickHostTab(host.name, 'Physical Disks');
+        hosts.clickTab('cd-host-details', host.name, 'Physical Disks');
         cy.get('cd-host-details').within(() => {
           hosts.getTableCount('total').should('be.eq', host.devices.length);
         });
index 24a1b89178d25f1179fb72b3b695ff0a7791f9fb..a64e3bc8c020fca69f36cdd57890beee5d85ffb6 100644 (file)
@@ -12,7 +12,7 @@ describe('Physical Disks page', () => {
   it('should have correct devices', () => {
     cy.fixture('orchestrator/inventory.json').then((hosts) => {
       const totalDiskCount = Cypress._.sumBy(hosts, 'devices.length');
-      inventory.getTableCount('total').should('be.eq', totalDiskCount);
+      inventory.expectTableCount('total', totalDiskCount);
       for (const host of hosts) {
         inventory.filterTable('Hostname', host['name']);
         inventory.getTableCount('found').should('be.eq', host.devices.length);
index dec84d73562d8a423094b66979de97607c86a29b..fb5e6ac8923aae825fae4f71c27f587255881224 100644 (file)
@@ -2,6 +2,7 @@ import { ServicesPageHelper } from '../cluster/services.po';
 
 describe('Services page', () => {
   const services = new ServicesPageHelper();
+  const serviceName = 'rgw.foo';
 
   beforeEach(() => {
     cy.login();
@@ -14,16 +15,22 @@ describe('Services page', () => {
       services.navigateTo('create');
       services.addService('rgw');
 
-      services.checkExist('rgw.rgw.foo', true);
+      services.checkExist(serviceName, true);
+    });
+
+    it('should edit a service', () => {
+      const count = '2';
+      services.editService(serviceName, count);
+      services.expectPlacementCount(serviceName, count);
     });
 
     it('should create and delete an ingress service', () => {
       services.navigateTo('create');
       services.addService('ingress');
 
-      services.checkExist('ingress.rgw.rgw.foo', true);
+      services.checkExist('ingress.rgw.foo', true);
 
-      services.deleteService('ingress.rgw.rgw.foo', 5000);
+      services.deleteService('ingress.rgw.foo');
     });
   });
 });
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-create-cluster-welcome-page.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-create-cluster-welcome-page.e2e-spec.ts
new file mode 100644 (file)
index 0000000..02ebb18
--- /dev/null
@@ -0,0 +1,19 @@
+import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
+
+describe('Create cluster page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+  });
+
+  it('should open the wizard when Expand Cluster is clicked', () => {
+    createCluster.createCluster();
+  });
+
+  it('should skip to dashboard landing page when Skip is clicked', () => {
+    createCluster.doSkip();
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-hosts.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/01-hosts.e2e-spec.ts
deleted file mode 100644 (file)
index b1c8ad0..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
-
-describe('Hosts page', () => {
-  const hosts = new HostsPageHelper();
-  const hostnames = ['ceph-node-00.cephlab.com', 'ceph-node-01.cephlab.com'];
-  const addHost = (hostname: string, exist?: boolean, maintenance?: boolean) => {
-    hosts.navigateTo('create');
-    hosts.add(hostname, exist, maintenance);
-    hosts.checkExist(hostname, true);
-  };
-
-  beforeEach(() => {
-    cy.login();
-    Cypress.Cookies.preserveOnce('token');
-    hosts.navigateTo();
-  });
-
-  describe('when Orchestrator is available', () => {
-    it('should display inventory', function () {
-      hosts.clickHostTab(hostnames[0], 'Physical Disks');
-      cy.get('cd-host-details').within(() => {
-        hosts.getTableCount('total').should('be.gte', 0);
-      });
-    });
-
-    it('should display daemons', function () {
-      hosts.clickHostTab(hostnames[0], 'Daemons');
-      cy.get('cd-host-details').within(() => {
-        hosts.getTableCount('total').should('be.gte', 0);
-      });
-    });
-
-    it('should edit host labels', function () {
-      const labels = ['foo', 'bar'];
-      hosts.editLabels(hostnames[0], labels, true);
-      hosts.editLabels(hostnames[0], labels, false);
-    });
-
-    it('should not add an existing host', function () {
-      hosts.navigateTo('create');
-      hosts.add(hostnames[0], true);
-    });
-
-    it('should add a host in maintenance mode', function () {
-      addHost(hostnames[1], false, true);
-    });
-
-    it('should delete a host and add it back', function () {
-      hosts.delete(hostnames[1]);
-      addHost(hostnames[1], false, true);
-    });
-
-    it('should exit host from maintenance', function () {
-      hosts.maintenance(hostnames[1], true);
-    });
-  });
-});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/02-create-cluster-add-host.e2e-spec.ts
new file mode 100644 (file)
index 0000000..33f0922
--- /dev/null
@@ -0,0 +1,71 @@
+import {
+  CreateClusterHostPageHelper,
+  CreateClusterWizardHelper
+} from 'cypress/integration/cluster/create-cluster.po';
+
+describe('Create cluster add host page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+  const createClusterHostPage = new CreateClusterHostPageHelper();
+  const hostnames = [
+    'ceph-node-00.cephlab.com',
+    'ceph-node-01.cephlab.com',
+    'ceph-node-02.cephlab.com',
+    'ceph-node-[01-02].cephlab.com'
+  ];
+  const addHost = (hostname: string, exist?: boolean, pattern?: boolean, labels: string[] = []) => {
+    cy.get('.btn.btn-accent').first().click({ force: true });
+    createClusterHostPage.add(hostname, exist, false, labels);
+    if (!pattern) {
+      createClusterHostPage.checkExist(hostname, true);
+    }
+  };
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+  });
+
+  it('should check if title contains Add Hosts', () => {
+    cy.get('.nav-link').should('contain.text', 'Add Hosts');
+
+    cy.get('.title').should('contain.text', 'Add Hosts');
+  });
+
+  it('should check existing host and add new hosts', () => {
+    createClusterHostPage.checkExist(hostnames[0], true);
+
+    addHost(hostnames[1], false);
+    addHost(hostnames[2], false);
+    createClusterHostPage.delete(hostnames[1]);
+    createClusterHostPage.delete(hostnames[2]);
+    addHost(hostnames[3], false, true);
+  });
+
+  it('should delete a host', () => {
+    createClusterHostPage.delete(hostnames[1]);
+  });
+
+  it('should add a host with some predefined labels and verify it', () => {
+    const labels = ['mon', 'mgr', 'rgw', 'osd'];
+    addHost(hostnames[1], false, false, labels);
+    createClusterHostPage.checkLabelExists(hostnames[1], labels, true);
+  });
+
+  it('should verify "_no_schedule" label is added', () => {
+    createClusterHostPage.checkLabelExists(hostnames[1], ['_no_schedule'], true);
+    createClusterHostPage.checkLabelExists(hostnames[2], ['_no_schedule'], true);
+  });
+
+  it('should not add an existing host', () => {
+    cy.get('.btn.btn-accent').first().click({ force: true });
+    createClusterHostPage.add(hostnames[0], true);
+  });
+
+  it('should edit host labels', () => {
+    const labels = ['foo', 'bar'];
+    createClusterHostPage.editLabels(hostnames[0], labels, true);
+    createClusterHostPage.editLabels(hostnames[0], labels, false);
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/03-create-cluster-create-osds.e2e-spec.ts
new file mode 100644 (file)
index 0000000..c8d93b4
--- /dev/null
@@ -0,0 +1,40 @@
+import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
+import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
+
+const osds = new OSDsPageHelper();
+
+describe('Create cluster create osds page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+    cy.get('.nav-link').contains('Create OSDs').click();
+  });
+
+  it('should check if title contains Create OSDs', () => {
+    cy.get('.title').should('contain.text', 'Create OSDs');
+  });
+
+  describe('when Orchestrator is available', () => {
+    it('should create OSDs', () => {
+      osds.navigateTo();
+      osds.getTableCount('total').as('initOSDCount');
+
+      createCluster.navigateTo();
+      createCluster.createCluster();
+      cy.get('.nav-link').contains('Create OSDs').click();
+
+      createCluster.createOSD('hdd');
+
+      // Go to the Review section and Expand the cluster
+      // because the drive group spec is only stored
+      // in frontend and will be lost when refreshed
+      cy.get('.nav-link').contains('Review').click();
+      cy.get('button[aria-label="Next"]').click();
+      cy.get('cd-dashboard').should('exist');
+    });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/04-create-cluster-create-services.e2e-spec.ts
new file mode 100644 (file)
index 0000000..aec174a
--- /dev/null
@@ -0,0 +1,46 @@
+import {
+  CreateClusterServicePageHelper,
+  CreateClusterWizardHelper
+} from 'cypress/integration/cluster/create-cluster.po';
+
+describe('Create cluster create services page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+  const createClusterServicePage = new CreateClusterServicePageHelper();
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+    cy.get('.nav-link').contains('Create Services').click();
+  });
+
+  it('should check if title contains Create Services', () => {
+    cy.get('.title').should('contain.text', 'Create Services');
+  });
+
+  describe('when Orchestrator is available', () => {
+    const serviceName = 'rgw.foo';
+
+    it('should create an rgw service', () => {
+      cy.get('.btn.btn-accent').first().click({ force: true });
+
+      createClusterServicePage.addService('rgw', false, '2');
+      createClusterServicePage.checkExist(serviceName, true);
+    });
+
+    it('should edit a service', () => {
+      const count = '3';
+      createClusterServicePage.editService(serviceName, count);
+      createClusterServicePage.expectPlacementCount(serviceName, count);
+    });
+
+    it('should create and delete an ingress service', () => {
+      cy.get('.btn.btn-accent').first().click({ force: true });
+
+      createClusterServicePage.addService('ingress');
+      createClusterServicePage.checkExist('ingress.rgw.foo', true);
+      createClusterServicePage.deleteService('ingress.rgw.foo');
+    });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/05-create-cluster-review.e2e-spec.ts
new file mode 100644 (file)
index 0000000..4115222
--- /dev/null
@@ -0,0 +1,76 @@
+import {
+  CreateClusterHostPageHelper,
+  CreateClusterWizardHelper
+} from 'cypress/integration/cluster/create-cluster.po';
+
+describe('Create Cluster Review page', () => {
+  const createCluster = new CreateClusterWizardHelper();
+  const createClusterHostPage = new CreateClusterHostPageHelper();
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    createCluster.navigateTo();
+    createCluster.createCluster();
+
+    cy.get('.nav-link').contains('Review').click();
+  });
+
+  describe('navigation link test', () => {
+    it('should check if active nav-link is of Review section', () => {
+      cy.get('.nav-link.active').should('contain.text', 'Review');
+    });
+  });
+
+  describe('fields check', () => {
+    it('should check cluster resources table is present', () => {
+      // check for table header 'Cluster Resources'
+      createCluster.getLegends().its(0).should('have.text', 'Cluster Resources');
+
+      // check for fields in table
+      createCluster.getStatusTables().should('contain.text', 'Hosts');
+      createCluster.getStatusTables().should('contain.text', 'Storage Capacity');
+      createCluster.getStatusTables().should('contain.text', 'CPUs');
+      createCluster.getStatusTables().should('contain.text', 'Memory');
+    });
+
+    it('should check Hosts by Services and Host Details tables are present', () => {
+      // check for there to be two tables
+      createCluster.getDataTables().should('have.length', 2);
+
+      // check for table header 'Hosts by Services'
+      createCluster.getLegends().its(1).should('have.text', 'Hosts by Services');
+
+      // check for table header 'Host Details'
+      createCluster.getLegends().its(2).should('have.text', 'Host Details');
+
+      // verify correct columns on Hosts by Services table
+      createCluster.getDataTableHeaders(0).contains('Services');
+
+      createCluster.getDataTableHeaders(0).contains('Number of Hosts');
+
+      // verify correct columns on Host Details table
+      createCluster.getDataTableHeaders(1).contains('Hostname');
+
+      createCluster.getDataTableHeaders(1).contains('Labels');
+
+      createCluster.getDataTableHeaders(1).contains('CPUs');
+
+      createCluster.getDataTableHeaders(1).contains('Cores');
+
+      createCluster.getDataTableHeaders(1).contains('Total Memory');
+
+      createCluster.getDataTableHeaders(1).contains('Raw Capacity');
+
+      createCluster.getDataTableHeaders(1).contains('HDDs');
+
+      createCluster.getDataTableHeaders(1).contains('Flash');
+
+      createCluster.getDataTableHeaders(1).contains('NICs');
+    });
+
+    it('should check default host name is present', () => {
+      createClusterHostPage.check_for_host();
+    });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/06-cluster-check.e2e-spec.ts
new file mode 100644 (file)
index 0000000..ac21714
--- /dev/null
@@ -0,0 +1,90 @@
+import { CreateClusterWizardHelper } from 'cypress/integration/cluster/create-cluster.po';
+import { HostsPageHelper } from 'cypress/integration/cluster/hosts.po';
+import { OSDsPageHelper } from 'cypress/integration/cluster/osds.po';
+import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
+
+describe('when cluster creation is completed', () => {
+  const createCluster = new CreateClusterWizardHelper();
+  const services = new ServicesPageHelper();
+  const serviceName = 'rgw.foo';
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+  });
+
+  it('should redirect to dashboard landing page after cluster creation', () => {
+    createCluster.navigateTo();
+    createCluster.createCluster();
+
+    cy.get('.nav-link').contains('Review').click();
+    cy.get('button[aria-label="Next"]').click();
+    cy.get('cd-dashboard').should('exist');
+  });
+
+  describe('Hosts page', () => {
+    const hosts = new HostsPageHelper();
+    const hostnames = [
+      'ceph-node-00.cephlab.com',
+      'ceph-node-01.cephlab.com',
+      'ceph-node-02.cephlab.com'
+    ];
+
+    beforeEach(() => {
+      hosts.navigateTo();
+    });
+
+    it('should have removed "_no_schedule" label', () => {
+      for (const hostname of hostnames) {
+        hosts.checkLabelExists(hostname, ['_no_schedule'], false);
+      }
+    });
+
+    it('should display inventory', () => {
+      hosts.clickTab('cd-host-details', hostnames[1], 'Physical Disks');
+      cy.get('cd-host-details').within(() => {
+        hosts.getTableCount('total').should('be.gte', 0);
+      });
+    });
+
+    it('should display daemons', () => {
+      hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
+      cy.get('cd-host-details').within(() => {
+        hosts.getTableCount('total').should('be.gte', 0);
+      });
+    });
+
+    it('should check if rgw service is running', () => {
+      hosts.clickTab('cd-host-details', hostnames[1], 'Daemons');
+      cy.get('cd-host-details').within(() => {
+        services.checkServiceStatus('rgw');
+      });
+    });
+
+    it('should force maintenance and exit', { retries: 1 }, () => {
+      hosts.maintenance(hostnames[1], true, true);
+    });
+  });
+
+  describe('OSDs page', () => {
+    const osds = new OSDsPageHelper();
+
+    beforeEach(() => {
+      osds.navigateTo();
+    });
+
+    it('should check if osds are created', { retries: 1 }, () => {
+      osds.getTableCount('total').should('be.gte', 1);
+    });
+  });
+
+  describe('Services page', () => {
+    beforeEach(() => {
+      services.navigateTo();
+    });
+
+    it('should check if services are created', () => {
+      services.checkExist(serviceName, true);
+    });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/07-nfs-exports.e2e-spec.ts
new file mode 100644 (file)
index 0000000..2d92075
--- /dev/null
@@ -0,0 +1,81 @@
+import { ServicesPageHelper } from 'cypress/integration/cluster/services.po';
+import { NFSPageHelper } from 'cypress/integration/orchestrator/workflow/nfs/nfs-export.po';
+import { BucketsPageHelper } from 'cypress/integration/rgw/buckets.po';
+
+describe('nfsExport page', () => {
+  const nfsExport = new NFSPageHelper();
+  const services = new ServicesPageHelper();
+  const buckets = new BucketsPageHelper();
+  const bucketName = 'e2e.nfs.bucket';
+  // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
+  // const fsPseudo = '/fsPseudo';
+  const rgwPseudo = '/rgwPseudo';
+  const editPseudo = '/editPseudo';
+  const backends = ['CephFS', 'Object Gateway'];
+  const squash = 'no_root_squash';
+  const client: object = { addresses: '192.168.0.10' };
+
+  beforeEach(() => {
+    cy.login();
+    Cypress.Cookies.preserveOnce('token');
+    nfsExport.navigateTo();
+  });
+
+  describe('breadcrumb test', () => {
+    it('should open and show breadcrumb', () => {
+      nfsExport.expectBreadcrumbText('NFS');
+    });
+  });
+
+  describe('Create, edit and delete', () => {
+    it('should create an NFS cluster', () => {
+      services.navigateTo('create');
+
+      services.addService('nfs');
+
+      services.checkExist('nfs.testnfs', true);
+      services.getExpandCollapseElement().click();
+      services.checkServiceStatus('nfs');
+    });
+
+    it('should create a nfs-export with RGW backend', () => {
+      buckets.navigateTo('create');
+      buckets.create(bucketName, 'dashboard', 'default-placement');
+
+      nfsExport.navigateTo();
+      nfsExport.existTableCell(rgwPseudo, false);
+      nfsExport.navigateTo('create');
+      nfsExport.create(backends[1], squash, client, rgwPseudo, bucketName);
+      nfsExport.existTableCell(rgwPseudo);
+    });
+
+    // @TODO: uncomment this when a CephFS volume can be created through Dashboard.
+    // it('should create a nfs-export with CephFS backend', () => {
+    //   nfsExport.navigateTo();
+    //   nfsExport.existTableCell(fsPseudo, false);
+    //   nfsExport.navigateTo('create');
+    //   nfsExport.create(backends[0], squash, client, fsPseudo);
+    //   nfsExport.existTableCell(fsPseudo);
+    // });
+
+    it('should show Clients', () => {
+      nfsExport.clickTab('cd-nfs-details', rgwPseudo, 'Clients (1)');
+      cy.get('cd-nfs-details').within(() => {
+        nfsExport.getTableCount('total').should('be.gte', 0);
+      });
+    });
+
+    it('should edit an export', () => {
+      nfsExport.editExport(rgwPseudo, editPseudo);
+
+      nfsExport.existTableCell(editPseudo);
+    });
+
+    it('should delete exports and bucket', () => {
+      nfsExport.delete(editPseudo);
+
+      buckets.navigateTo();
+      buckets.delete(bucketName);
+    });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/nfs/nfs-export.po.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/workflow/nfs/nfs-export.po.ts
new file mode 100644 (file)
index 0000000..03b3bb1
--- /dev/null
@@ -0,0 +1,50 @@
+import { PageHelper } from 'cypress/integration/page-helper.po';
+
+const pages = {
+  index: { url: '#/nfs', id: 'cd-nfs-list' },
+  create: { url: '#/nfs/create', id: 'cd-nfs-form' }
+};
+
+export class NFSPageHelper extends PageHelper {
+  pages = pages;
+
+  @PageHelper.restrictTo(pages.create.url)
+  create(backend: string, squash: string, client: object, pseudo: string, rgwPath?: string) {
+    this.selectOption('cluster_id', 'testnfs');
+    // select a storage backend
+    this.selectOption('name', backend);
+    if (backend === 'CephFS') {
+      this.selectOption('fs_name', 'myfs');
+
+      cy.get('#security_label').click({ force: true });
+    } else {
+      cy.get('input[data-testid=rgw_path]').type(rgwPath);
+    }
+
+    cy.get('input[name=pseudo]').type(pseudo);
+    this.selectOption('squash', squash);
+
+    // Add clients
+    cy.get('button[name=add_client]').click({ force: true });
+    cy.get('input[name=addresses]').type(client['addresses']);
+
+    // Check if we can remove clients and add it again
+    cy.get('span[name=remove_client]').click({ force: true });
+    cy.get('button[name=add_client]').click({ force: true });
+    cy.get('input[name=addresses]').type(client['addresses']);
+
+    cy.get('cd-submit-button').click();
+  }
+
+  editExport(pseudo: string, editPseudo: string) {
+    this.navigateEdit(pseudo);
+
+    cy.get('input[name=pseudo]').clear().type(editPseudo);
+
+    cy.get('cd-submit-button').click();
+
+    // Click the export and check its details table for updated content
+    this.getExpandCollapseElement(editPseudo).click();
+    cy.get('.active.tab-pane').should('contain.text', editPseudo);
+  }
+}
index 7b099fd98acf21fd73daa9f7c285f4b8a12407b1..85a536f05a9a1da12add503278a50a81608aecab 100644 (file)
@@ -52,14 +52,16 @@ export abstract class PageHelper {
   /**
    * Navigates to the edit page
    */
-  navigateEdit(name: string, select = true) {
+  navigateEdit(name: string, select = true, breadcrumb = true) {
     if (select) {
       this.navigateTo();
       this.getFirstTableCell(name).click();
     }
     cy.contains('Creating...').should('not.exist');
     cy.contains('button', 'Edit').click();
-    this.expectBreadcrumbText('Edit');
+    if (breadcrumb) {
+      this.expectBreadcrumbText('Edit');
+    }
   }
 
   /**
@@ -74,7 +76,7 @@ export abstract class PageHelper {
   }
 
   getTab(tabName: string) {
-    return cy.contains('.nav.nav-tabs li', new RegExp(`^${tabName}$`));
+    return cy.contains('.nav.nav-tabs li', tabName);
   }
 
   getTabText(index: number) {
@@ -85,6 +87,19 @@ export abstract class PageHelper {
     return this.getTabs().its('length');
   }
 
+  /**
+   * Helper method to navigate/click a tab inside the expanded table row.
+   * @param selector The selector of the expanded table row.
+   * @param name The name of the row which should expand.
+   * @param tabName Name of the tab to be navigated/clicked.
+   */
+  clickTab(selector: string, name: string, tabName: string) {
+    this.getExpandCollapseElement(name).click();
+    cy.get(selector).within(() => {
+      this.getTab(tabName).click();
+    });
+  }
+
   /**
    * Helper method to select an option inside a select element.
    * This method will also expect that the option was set.
@@ -190,6 +205,11 @@ export abstract class PageHelper {
     );
   }
 
+  existTableCell(name: string, oughtToBePresent = true) {
+    const waitRule = oughtToBePresent ? 'be.visible' : 'not.exist';
+    this.getFirstTableCell(name).should(waitRule);
+  }
+
   getExpandCollapseElement(content?: string) {
     this.waitDataTableToLoad();
 
@@ -206,7 +226,7 @@ export abstract class PageHelper {
   getDataTableHeaders(index = 0) {
     this.waitDataTableToLoad();
 
-    return cy.get('.datatable-header').its(index).find('.datatable-header-cell-label');
+    return cy.get('.datatable-header').its(index).find('.datatable-header-cell');
   }
 
   /**
@@ -256,19 +276,22 @@ export abstract class PageHelper {
    * @param name The string to search in table cells.
    * @param columnIndex If provided, search string in columnIndex column.
    */
-  delete(name: string, columnIndex?: number) {
+  delete(name: string, columnIndex?: number, section?: string) {
     // Selects row
     const getRow = columnIndex
       ? this.getTableCell.bind(this, columnIndex)
       : this.getFirstTableCell.bind(this);
     getRow(name).click();
+    let action: string;
+    section === 'hosts' ? (action = 'remove') : (action = 'delete');
 
-    // Clicks on table Delete button
-    this.clickActionButton('delete');
+    // Clicks on table Delete/Remove button
+    this.clickActionButton(action);
 
-    // Confirms deletion
+    // Convert action to SentenceCase and Confirms deletion
+    const actionUpperCase = action.charAt(0).toUpperCase() + action.slice(1);
     cy.get('cd-modal .custom-control-label').click();
-    cy.contains('cd-modal button', 'Delete').click();
+    cy.contains('cd-modal button', actionUpperCase).click();
 
     // Wait for modal to close
     cy.get('cd-modal').should('not.exist');
index e5a28bfd4e20c24c3dc8dec3f15497db4fac18d3..b4c3c75ac5b853d5165870be8601701a51aac468 100644 (file)
@@ -30,19 +30,19 @@ describe('Pools page', () => {
 
   describe('Create, update and destroy', () => {
     it('should create a pool', () => {
-      pools.exist(poolName, false);
+      pools.existTableCell(poolName, false);
       pools.navigateTo('create');
       pools.create(poolName, 8, 'rbd');
-      pools.exist(poolName, true);
+      pools.existTableCell(poolName);
     });
 
     it('should edit a pools placement group', () => {
-      pools.exist(poolName, true);
+      pools.existTableCell(poolName);
       pools.edit_pool_pg(poolName, 32);
     });
 
     it('should show updated configuration field values', () => {
-      pools.exist(poolName, true);
+      pools.existTableCell(poolName);
       const bpsLimit = '4 B/s';
       pools.edit_pool_configuration(poolName, bpsLimit);
     });
index ccf858b41206d9bdcf233ad3a05fe567b6628209..98cee470eda993bdde355243cbf78e527aa757ae 100644 (file)
@@ -13,12 +13,6 @@ export class PoolPageHelper extends PageHelper {
     return expect((n & (n - 1)) === 0, `Placement groups ${n} are not a power of 2`).to.be.true;
   }
 
-  @PageHelper.restrictTo(pages.index.url)
-  exist(name: string, oughtToBePresent = true) {
-    const waitRule = oughtToBePresent ? 'be.visible' : 'not.exist';
-    this.getFirstTableCell(name).should(waitRule);
-  }
-
   @PageHelper.restrictTo(pages.create.url)
   create(name: string, placement_groups: number, ...apps: string[]) {
     cy.get('input[name=name]').clear().type(name);
index 7ded71f59a92953553c16959a9255127c689b63d..a4266f989e0833bfee93021067fa5cb2ffd8cd3a 100644 (file)
@@ -109,7 +109,7 @@ export class UsersPageHelper extends PageHelper {
     // creating this user to edit for the test
     this.navigateTo('create');
     this.create(tenant, uname, 'xxx', 'xxx@xxx', '50');
-
+    const name = tenant + '$' + uname;
     this.navigateEdit(name);
 
     // put invalid email to make field invalid
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/dashboard.vrt-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/dashboard.vrt-spec.ts
new file mode 100644 (file)
index 0000000..b83d16d
--- /dev/null
@@ -0,0 +1,22 @@
+import { LoginPageHelper } from '../ui/login.po';
+
+describe('Dashboard Landing Page', () => {
+  const login = new LoginPageHelper();
+
+  beforeEach(() => {
+    cy.eyesOpen({
+      testName: 'Dashboard Component'
+    });
+  });
+
+  afterEach(() => {
+    cy.eyesClose();
+  });
+
+  it('should take screenshot of dashboard landing page', () => {
+    login.navigateTo();
+    login.doLogin();
+    cy.get('.card-text').should('be.visible');
+    cy.eyesCheckWindow({ tag: 'Dashboard landing page', ignore: { selector: '.card-text' } });
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/login.vrt-spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/visualTests/login.vrt-spec.ts
new file mode 100644 (file)
index 0000000..ea74f1d
--- /dev/null
@@ -0,0 +1,19 @@
+describe('Login Page', () => {
+  beforeEach(() => {
+    cy.visit('#/login');
+    cy.eyesOpen({
+      appName: 'Ceph',
+      testName: 'Login Component Check'
+    });
+  });
+
+  afterEach(() => {
+    cy.eyesClose();
+  });
+
+  it('types login credentials and takes screenshot', () => {
+    cy.get('[name=username]').type('admin');
+    cy.get('#password').type('admin');
+    cy.eyesCheckWindow({ tag: 'Login Screen with credentials typed' });
+  });
+});
index 0f9934c9897bdf056a02b01347d0e1bb9967cc2e..ce29463bb6c60e939e4552078451bfed22068fa4 100644 (file)
@@ -6,3 +6,5 @@ module.exports = (on, _config) => {
     }
   });
 };
+
+require('@applitools/eyes-cypress')(module);
index 60fa7a746c043cba2f39e5f45040e09865c576a6..a4c8ff332c49613d9f6bbbfce9ca84d2f2385f4a 100644 (file)
@@ -7,6 +7,7 @@ declare global {
   }
 }
 
+import { CdHelperClass } from '~/app/shared/classes/cd-helper.class';
 import { Permissions } from '~/app/shared/models/permissions';
 
 let auth: any;
@@ -27,7 +28,7 @@ Cypress.Commands.add('login', () => {
     cy.request({
       method: 'POST',
       url: 'api/auth',
-      headers: { Accept: 'application/vnd.ceph.api.v1.0+json' },
+      headers: { Accept: CdHelperClass.cdVersionHeader('1', '0') },
       body: { username: username, password: password }
     }).then((resp) => {
       auth = resp.body;
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/cypress/support/eyes-index.d.ts b/ceph/src/pybind/mgr/dashboard/frontend/cypress/support/eyes-index.d.ts
new file mode 100644 (file)
index 0000000..59fc1ec
--- /dev/null
@@ -0,0 +1 @@
+import '@applitools/eyes-cypress';
index 750acb7eafc86499e0f1d29e30462e612da5837b..f87d13efadcf00e693cec5f9e3f4a20eb6c88fb0 100644 (file)
@@ -1,3 +1,5 @@
+import '@applitools/eyes-cypress/commands';
+
 import './commands';
 
 afterEach(() => {
index f46471f2c044450a03aed36c6875bb7371411785..90f899b57f639d643df7ae0d2eaf67b77ddf4c70 100644 (file)
@@ -8,7 +8,8 @@
   "compilerOptions": {
     "sourceMap": false,
     "types": [
-      "cypress"
+      "cypress",
+      "@applitools/eyes-cypress"
     ],
     "target": "es6"
   }
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.6da7b376fa1a8a3df154.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.6da7b376fa1a8a3df154.js
deleted file mode 100644 (file)
index 2a05359..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{aAWM:function(e,t,a){"use strict";a.d(t,"a",(function(){return M}));var i=a("uIqm"),o=a("PhyI"),s=a("8Y7J");let n=(()=>{class e{transform(e){return{0:"global",1:"pool",2:"image"}[e]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"rbdConfigurationSource",type:e,pure:!0}),e})();var r=a("aXbf"),c=a("o8EM"),l=a("SVse"),b=a("IzCI"),d=a("dEH0"),p=a("BQkM");const m=["configurationSourceTpl"],u=["configurationValueTpl"],f=["poolConfTable"];function h(e,t){1&e&&(s.Sb(0,"span"),s.Wb(1,6),s.Rb())}function g(e,t){1&e&&(s.Sb(0,"strong"),s.Wb(1,7),s.Rb())}function S(e,t){1&e&&(s.Sb(0,"strong"),s.Wb(1,8),s.Rb())}function v(e,t){1&e&&(s.Sb(0,"div",4),s.Mc(1,h,2,0,"span",5),s.Mc(2,g,2,0,"strong",5),s.Mc(3,S,2,0,"strong",5),s.Rb()),2&e&&(s.pc("ngSwitch",t.value),s.yb(1),s.pc("ngSwitchCase","global"),s.yb(1),s.pc("ngSwitchCase","image"),s.yb(1),s.pc("ngSwitchCase","pool"))}function y(e,t){if(1&e&&(s.Sb(0,"span"),s.Oc(1),s.jc(2,"dimlessBinaryPerSecond"),s.Rb()),2&e){const e=s.ic().value;s.yb(1),s.Pc(s.kc(2,1,e))}}function R(e,t){if(1&e&&(s.Sb(0,"span"),s.Oc(1),s.jc(2,"milliseconds"),s.Rb()),2&e){const e=s.ic().value;s.yb(1),s.Pc(s.kc(2,1,e))}}function w(e,t){if(1&e&&(s.Sb(0,"span"),s.Oc(1),s.jc(2,"iops"),s.Rb()),2&e){const e=s.ic().value;s.yb(1),s.Pc(s.kc(2,1,e))}}function _(e,t){if(1&e&&(s.Sb(0,"span"),s.Oc(1),s.Rb()),2&e){const e=s.ic().value;s.yb(1),s.Pc(e)}}function k(e,t){if(1&e&&(s.Sb(0,"div",4),s.Mc(1,y,3,3,"span",5),s.Mc(2,R,3,3,"span",5),s.Mc(3,w,3,3,"span",5),s.Mc(4,_,2,1,"span",9),s.Rb()),2&e){const e=t.row,a=s.ic();s.pc("ngSwitch",e.type),s.yb(1),s.pc("ngSwitchCase",a.typeField.bps),s.yb(1),s.pc("ngSwitchCase",a.typeField.milliseconds),s.yb(1),s.pc("ngSwitchCase",a.typeField.iops)}}let M=(()=>{class e{constructor(e,t){this.formatterService=e,this.rbdConfigurationService=t,this.sourceField=o.a,this.typeField=o.b}ngOnInit(){this.poolConfigurationColumns=[{prop:"displayName",name:"Name"},{prop:"description",name:"Description"},{prop:"name",name:"Key"},{prop:"source",name:"Source",cellTemplate:this.configurationSourceTpl,pipe:new n},{prop:"value",name:"Value",cellTemplate:this.configurationValueTpl}]}ngOnChanges(){this.data&&(this.data=this.data.filter(e=>this.rbdConfigurationService.getOptionFields().map(e=>e.name).includes(e.name)))}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(r.a),s.Mb(c.a))},e.\u0275cmp=s.Gb({type:e,selectors:[["cd-rbd-configuration-table"]],viewQuery:function(e,t){var a;1&e&&(s.Jc(m,!0),s.Jc(u,!0),s.Jc(f,!0)),2&e&&(s.zc(a=s.hc())&&(t.configurationSourceTpl=a.first),s.zc(a=s.hc())&&(t.configurationValueTpl=a.first),s.zc(a=s.hc())&&(t.poolConfTable=a.first))},inputs:{data:"data"},features:[s.wb],decls:6,vars:2,consts:function(){return[["identifier","name",3,"data","columns"],["poolConfTable",""],["configurationSourceTpl",""],["configurationValueTpl",""],[3,"ngSwitch"],[4,"ngSwitchCase"],"Global","Image","Pool",[4,"ngSwitchDefault"]]},template:function(e,t){1&e&&(s.Nb(0,"cd-table",0,1),s.Mc(2,v,4,4,"ng-template",null,2,s.Nc),s.Mc(4,k,5,4,"ng-template",null,3,s.Nc)),2&e&&s.pc("data",t.data)("columns",t.poolConfigurationColumns)},directives:[i.a,l.t,l.u,l.v],pipes:[b.a,d.a,p.a],styles:[""]}),e})()},"k/xb":function(e,t,a){"use strict";a.r(t),a.d(t,"BlockModule",(function(){return pn})),a.d(t,"RoutedBlockModule",(function(){return un}));var i=a("SVse"),o=a("s7LF"),s=a("iInd"),n=a("ohO+"),r=a("G0yt"),c=a("zWsK"),l=a("sne2"),b=a("Vhfg"),d=a("PCNd"),p=a("LvDl"),m=a.n(p),u=a("cp0P"),f=a("mrSG"),h=a("IheW"),g=a("xTzq"),S=a("8Y7J");let v=(()=>{let e=class{constructor(e){this.http=e}listTargets(){return this.http.get("api/iscsi/target")}getTarget(e){return this.http.get("api/iscsi/target/"+e)}updateTarget(e,t){return this.http.put("api/iscsi/target/"+e,t,{observe:"response"})}status(){return this.http.get("ui-api/iscsi/status")}settings(){return this.http.get("ui-api/iscsi/settings")}version(){return this.http.get("ui-api/iscsi/version")}portals(){return this.http.get("ui-api/iscsi/portals")}createTarget(e){return this.http.post("api/iscsi/target",e,{observe:"response"})}deleteTarget(e){return this.http.delete("api/iscsi/target/"+e,{observe:"response"})}getDiscovery(){return this.http.get("api/iscsi/discoveryauth")}updateDiscovery(e){return this.http.put("api/iscsi/discoveryauth",e)}overview(){return this.http.get("ui-api/iscsi/overview")}};return e.\u0275fac=function(t){return new(t||e)(S.dc(h.b))},e.\u0275prov=S.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b])],e),e})();var y=a("lJxs"),R=a("jVDg"),w=a("o8EM");let _=(()=>{let e=class{constructor(e,t){this.http=e,this.rbdConfigurationService=t}isRBDPool(e){return-1!==m.a.indexOf(e.application_metadata,"rbd")&&!e.pool_name.includes("/")}create(e){return this.http.post("api/block/image",e,{observe:"response"})}delete(e){return this.http.delete("api/block/image/"+e.toStringEncoded(),{observe:"response"})}update(e,t){return this.http.put("api/block/image/"+e.toStringEncoded(),t,{observe:"response"})}get(e){return this.http.get("api/block/image/"+e.toStringEncoded())}list(){return this.http.get("api/block/image").pipe(Object(y.a)(e=>e.map(e=>(e.value.map(e=>e.configuration?(e.configuration.map(e=>Object.assign(e,this.rbdConfigurationService.getOptionByName(e.name))),e):e),e))))}copy(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/copy`,t,{observe:"response"})}flatten(e){return this.http.post(`api/block/image/${e.toStringEncoded()}/flatten`,null,{observe:"response"})}defaultFeatures(){return this.http.get("api/block/image/default_features")}cloneFormatVersion(){return this.http.get("api/block/image/clone_format_version")}createSnapshot(e,t){const a={snapshot_name:t};return this.http.post(`api/block/image/${e.toStringEncoded()}/snap`,a,{observe:"response"})}renameSnapshot(e,t,a){const i={new_snap_name:a};return this.http.put(`api/block/image/${e.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}protectSnapshot(e,t,a){const i={is_protected:a};return this.http.put(`api/block/image/${e.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}rollbackSnapshot(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/snap/${t}/rollback`,null,{observe:"response"})}cloneSnapshot(e,t,a){return this.http.post(`api/block/image/${e.toStringEncoded()}/snap/${t}/clone`,a,{observe:"response"})}deleteSnapshot(e,t){return this.http.delete(`api/block/image/${e.toStringEncoded()}/snap/${t}`,{observe:"response"})}listTrash(){return this.http.get("api/block/image/trash/")}createNamespace(e,t){return this.http.post(`api/block/pool/${e}/namespace`,{namespace:t},{observe:"response"})}listNamespaces(e){return this.http.get(`api/block/pool/${e}/namespace/`)}deleteNamespace(e,t){return this.http.delete(`api/block/pool/${e}/namespace/${t}`,{observe:"response"})}moveTrash(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/move_trash`,{delay:t},{observe:"response"})}purgeTrash(e){return this.http.post("api/block/image/trash/purge/?pool_name="+e,null,{observe:"response"})}restoreTrash(e,t){return this.http.post(`api/block/image/trash/${e.toStringEncoded()}/restore`,{new_image_name:t},{observe:"response"})}removeTrash(e,t=!1){return this.http.delete(`api/block/image/trash/${e.toStringEncoded()}/?force=${t}`,{observe:"response"})}};return e.\u0275fac=function(t){return new(t||e)(S.dc(h.b),S.dc(w.a))},e.\u0275prov=S.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),Object(f.b)([Object(f.e)(1,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[R.a,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"createSnapshot",null),Object(f.b)([Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[R.a,String,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"renameSnapshot",null),Object(f.b)([Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[R.a,String,Boolean]),Object(f.d)("design:returntype",void 0)],e.prototype,"protectSnapshot",null),Object(f.b)([Object(f.e)(1,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[R.a,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"restoreTrash",null),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b,w.a])],e),e})();var k=a("DNAf"),M=a("a96k"),N=a("oxzT"),I=a("spCT"),$=a("QFaf"),T=a("1Ni5"),F=a("kvvV"),P=a("JK/P"),z=a("kn/O"),E=a("ajRT"),C=a("NwgZ"),D=a("ocLN"),O=a("ANnk"),A=a("f69J"),x=a("6+kj");function V(e,t){if(1&e&&(S.Sb(0,"option",6),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("ngValue",e),S.yb(1),S.Pc(e)}}function W(e,t){if(1&e&&(S.Sb(0,"select",5),S.Nb(1,"option",6),S.Mc(2,V,2,2,"option",7),S.Rb()),2&e){const e=S.ic();S.qc("id",e.setting),S.qc("name",e.setting),S.pc("formControlName",e.setting),S.yb(1),S.pc("ngValue",null),S.yb(1),S.pc("ngForOf",e.limits.values)}}function q(e,t){if(1&e&&S.Nb(0,"input",10),2&e){const e=S.ic(2);S.pc("formControlName",e.setting)}}function B(e,t){if(1&e&&S.Nb(0,"input",11),2&e){const e=S.ic(2);S.pc("formControlName",e.setting)}}function G(e,t){if(1&e&&(S.Qb(0),S.Nb(1,"br"),S.Sb(2,"div",12),S.Nb(3,"input",13),S.Sb(4,"label",14),S.Oc(5,"Yes"),S.Rb(),S.Rb(),S.Sb(6,"div",12),S.Nb(7,"input",13),S.Sb(8,"label",14),S.Oc(9,"No"),S.Rb(),S.Rb(),S.Pb()),2&e){const e=S.ic(2);S.yb(3),S.pc("id",e.setting+"True")("value",!0)("formControlName",e.setting),S.yb(1),S.pc("for",e.setting+"True"),S.yb(3),S.pc("id",e.setting+"False")("value",!1)("formControlName",e.setting),S.yb(1),S.pc("for",e.setting+"False")}}function L(e,t){if(1&e&&(S.Sb(0,"span"),S.Mc(1,q,1,1,"input",8),S.Mc(2,B,1,1,"input",9),S.Mc(3,G,10,8,"ng-container",3),S.Rb()),2&e){const e=S.ic();S.yb(1),S.pc("ngIf","int"===e.limits.type),S.yb(1),S.pc("ngIf","str"===e.limits.type),S.yb(1),S.pc("ngIf","bool"===e.limits.type)}}function j(e,t){if(1&e&&(S.Sb(0,"span",15),S.Qb(1),S.Wb(2,16),S.Pb(),S.Rb()),2&e){const e=S.ic();S.yb(2),S.ac(e.limits.min),S.Xb(2)}}function Q(e,t){if(1&e&&(S.Sb(0,"span",15),S.Qb(1),S.Wb(2,17),S.Pb(),S.Rb()),2&e){const e=S.ic();S.yb(2),S.ac(e.limits.max),S.Xb(2)}}let U=(()=>{class e{ngOnInit(){const e=[];"min"in this.limits&&e.push(o.A.min(this.limits.min)),"max"in this.limits&&e.push(o.A.max(this.limits.max)),this.settingsForm.get(this.setting).setValidators(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-setting"]],inputs:{settingsForm:"settingsForm",formDir:"formDir",setting:"setting",limits:"limits"},decls:7,vars:7,consts:function(){return[[1,"form-group",3,"formGroup"],[1,"col-form-label",3,"for"],["class","form-control custom-select",3,"id","name","formControlName",4,"ngIf"],[4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"form-control","custom-select",3,"id","name","formControlName"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["type","number","class","form-control",3,"formControlName",4,"ngIf"],["type","text","class","form-control",3,"formControlName",4,"ngIf"],["type","number",1,"form-control",3,"formControlName"],["type","text",1,"form-control",3,"formControlName"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio",1,"custom-control-input",3,"id","value","formControlName"],[1,"custom-control-label",3,"for"],[1,"invalid-feedback"],"Must be greater than or equal to " + "\ufffd0\ufffd" + ".","Must be less than or equal to " + "\ufffd0\ufffd" + "."]},template:function(e,t){1&e&&(S.Sb(0,"div",0),S.Sb(1,"label",1),S.Oc(2),S.Rb(),S.Mc(3,W,3,5,"select",2),S.Mc(4,L,4,3,"span",3),S.Mc(5,j,3,1,"span",4),S.Mc(6,Q,3,1,"span",4),S.Rb()),2&e&&(S.pc("formGroup",t.settingsForm),S.yb(1),S.qc("for",t.setting),S.yb(1),S.Pc(t.setting),S.yb(1),S.pc("ngIf","enum"===t.limits.type),S.yb(1),S.pc("ngIf","enum"!==t.limits.type),S.yb(1),S.pc("ngIf",t.settingsForm.showError(t.setting,t.formDir,"min")),S.yb(1),S.pc("ngIf",t.settingsForm.showError(t.setting,t.formDir,"max")))},directives:[D.a,o.r,o.k,C.a,i.r,O.a,o.z,A.a,o.q,o.i,o.u,o.B,i.q,o.v,o.d,o.w],styles:[""]}),e})();var Y=a("uYzU");function K(e,t){1&e&&(S.Sb(0,"span",29),S.Wb(1,30),S.Rb())}function J(e,t){if(1&e&&(S.Sb(0,"span"),S.Sb(1,"legend",10),S.Wb(2,21),S.Rb(),S.Sb(3,"div",12),S.Sb(4,"div",13),S.Sb(5,"label",22),S.Wb(6,23),S.Rb(),S.Nb(7,"input",24),S.Mc(8,K,2,0,"span",25),S.Rb(),S.Rb(),S.Sb(9,"div",12),S.Sb(10,"div",13),S.Sb(11,"label",26),S.Wb(12,27),S.Rb(),S.Nb(13,"input",28),S.Rb(),S.Rb(),S.Rb()),2&e){const e=S.ic(),t=S.Ac(9);S.yb(8),S.pc("ngIf",e.settingsForm.showError("lun",t,"required"))}}function X(e,t){if(1&e&&(S.Sb(0,"option",31),S.Oc(1),S.jc(2,"iscsiBackstore"),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e),S.yb(1),S.Pc(S.kc(2,2,e))}}function H(e,t){if(1&e&&(S.Sb(0,"div",12),S.Sb(1,"div",13),S.Nb(2,"cd-iscsi-setting",33),S.Rb(),S.Rb()),2&e){const e=t.$implicit,a=S.ic(2).$implicit,i=S.ic(),o=S.Ac(9);S.yb(2),S.pc("settingsForm",i.settingsForm)("formDir",o)("setting",e.key)("limits",i.getDiskControlLimits(a,e.key))}}function Z(e,t){if(1&e&&(S.Qb(0),S.Mc(1,H,3,4,"div",32),S.jc(2,"keyvalue"),S.Pb()),2&e){const e=S.ic().$implicit,t=S.ic();S.yb(1),S.pc("ngForOf",S.kc(2,1,t.disk_default_controls[e]))}}function ee(e,t){if(1&e&&(S.Qb(0),S.Mc(1,Z,3,3,"ng-container",9),S.Pb()),2&e){const e=t.$implicit,a=S.ic();S.yb(1),S.pc("ngIf",a.settingsForm.value.backstore===e)}}let te=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.iscsiService=t,this.actionLabels=a}ngOnInit(){const e={backstore:new o.h(this.imagesSettings[this.image].backstore),lun:new o.h(this.imagesSettings[this.image].lun),wwn:new o.h(this.imagesSettings[this.image].wwn)};m.a.forEach(this.backstores,t=>{const a=this.imagesSettings[this.image][t]||{};m.a.forIn(this.disk_default_controls[t],(t,i)=>{e[i]=new o.h(a[i])})}),this.settingsForm=new $.a(e)}getDiskControlLimits(e,t){return this.disk_controls_limits?this.disk_controls_limits[e][t]:{type:"int"}}save(){const e=this.settingsForm.controls.backstore.value,t=this.settingsForm.controls.lun.value,a=this.settingsForm.controls.wwn.value,i={};m.a.forIn(this.settingsForm.controls,(t,a)=>{""!==t.value&&null!==t.value&&a in this.disk_default_controls[this.settingsForm.value.backstore]&&(i[a]=t.value,m.a.forEach(this.backstores,i=>{i!==e&&a in(this.imagesSettings[this.image][i]||{})&&(this.imagesSettings[this.image][i][a]=t.value)}))}),this.imagesSettings[this.image].backstore=e,this.imagesSettings[this.image].lun=t,this.imagesSettings[this.image].wwn=a,this.imagesSettings[this.image][e]=i,this.imagesSettings=Object.assign({},this.imagesSettings),this.control.updateValueAndValidity({emitEvent:!1}),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(v),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-image-settings-modal"]],decls:25,vars:8,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Configure",[1,"modal-content"],["name","settingsForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],"Changing these parameters from their default values is usually not necessary.",[4,"ngIf"],[1,"cd-header"],"Settings",[1,"form-group","row"],[1,"col-sm-12"],[1,"col-form-label"],"Backstore",["id","backstore","name","backstore","formControlName","backstore",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],"Identifier",["for","lun",1,"col-form-label","required"],"lun",["type","number","id","lun","name","lun","formControlName","lun",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","wwn",1,"col-form-label"],"wwn",["type","text","id","wwn","name","wwn","formControlName","wwn",1,"form-control"],[1,"invalid-feedback"],"This field is required.",[3,"value"],["class","form-group row",4,"ngFor","ngForOf"],[3,"settingsForm","formDir","setting","limits"]]},template:function(e,t){1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Qb(2),S.Wb(3,2),S.Pb(),S.Oc(4,"\xa0 "),S.Sb(5,"small"),S.Oc(6),S.Rb(),S.Pb(),S.Qb(7,3),S.Sb(8,"form",4,5),S.Sb(10,"div",6),S.Sb(11,"p",7),S.Wb(12,8),S.Rb(),S.Mc(13,J,14,1,"span",9),S.Sb(14,"legend",10),S.Wb(15,11),S.Rb(),S.Sb(16,"div",12),S.Sb(17,"div",13),S.Sb(18,"label",14),S.Wb(19,15),S.Rb(),S.Sb(20,"select",16),S.Mc(21,X,3,4,"option",17),S.Rb(),S.Rb(),S.Rb(),S.Mc(22,ee,2,1,"ng-container",18),S.Rb(),S.Sb(23,"div",19),S.Sb(24,"cd-form-button-panel",20),S.gc("submitActionEvent",(function(){return t.save()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e&&(S.pc("modalRef",t.activeModal),S.yb(6),S.Pc(t.image),S.yb(2),S.pc("formGroup",t.settingsForm),S.yb(5),S.pc("ngIf",t.api_version>=1),S.yb(8),S.pc("ngForOf",t.backstores),S.yb(1),S.pc("ngForOf",t.backstores),S.yb(2),S.pc("form",t.settingsForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.C,o.r,o.k,C.a,i.r,D.a,O.a,o.z,A.a,o.q,o.i,i.q,x.a,o.v,o.d,o.u,o.B,U],pipes:[Y.a,i.k],styles:[""]}),e})();function ae(e,t){if(1&e&&(S.Sb(0,"div",12),S.Sb(1,"div",13),S.Nb(2,"cd-iscsi-setting",14),S.Rb(),S.Rb()),2&e){const e=t.$implicit,a=S.ic(),i=S.Ac(5);S.yb(2),S.pc("settingsForm",a.settingsForm)("formDir",i)("setting",e.key)("limits",a.getTargetControlLimits(e.key))}}let ie=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.iscsiService=t,this.actionLabels=a}ngOnInit(){const e={};m.a.forIn(this.target_default_controls,(t,a)=>{e[a]=new o.h(this.target_controls.value[a])}),this.settingsForm=new $.a(e)}save(){const e={};m.a.forIn(this.settingsForm.controls,(t,a)=>{""!==t.value&&null!==t.value&&(e[a]=t.value)}),this.target_controls.setValue(e),this.activeModal.close()}getTargetControlLimits(e){return this.target_controls_limits?this.target_controls_limits[e]:["Yes","No"].includes(this.target_default_controls[e])?{type:"bool"}:{type:"int"}}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(v),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-iqn-settings-modal"]],decls:13,vars:7,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Advanced Settings",[1,"modal-content"],["name","settingsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],"Changing these parameters from their default values is usually not necessary.",["class","form-group row",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"form-group","row"],[1,"col-sm-12"],[3,"settingsForm","formDir","setting","limits"]]},template:function(e,t){1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p",7),S.Wb(8,8),S.Rb(),S.Mc(9,ae,3,4,"div",9),S.jc(10,"keyvalue"),S.Rb(),S.Sb(11,"div",10),S.Sb(12,"cd-form-button-panel",11),S.gc("submitActionEvent",(function(){return t.save()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e&&(S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.settingsForm),S.yb(5),S.pc("ngForOf",S.kc(10,5,t.settingsForm.controls)),S.yb(3),S.pc("form",t.settingsForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.C,o.r,o.k,C.a,i.q,x.a,D.a,U],pipes:[i.k],styles:[""]}),e})();var oe=a("zc8c");let se=(()=>{class e{constructor(e){this.ngControl=e}onInput(e){this.setValue(e)}setValue(e){e=m.a.isString(e)?e.trim():e,this.ngControl.control.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(o.p))},e.\u0275dir=S.Hb({type:e,selectors:[["","cdTrim",""]],hostBindings:function(e,t){1&e&&S.gc("input",(function(e){return t.onInput(e.target.value)}))}}),e})();var ne=a("wnGv"),re=a("D4zM"),ce=a("cEzo"),le=a("8xTl");function be(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,42),S.Rb())}function de(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,43),S.Rb())}function pe(e,t){1&e&&(S.Sb(0,"span",41),S.Qb(1),S.Wb(2,44),S.Pb(),S.Nb(3,"br"),S.Qb(4),S.Wb(5,45),S.Pb(),S.Nb(6,"br"),S.Sb(7,"a",46),S.Wb(8,47),S.Rb(),S.Rb())}function me(e,t){1&e&&(S.Sb(0,"span",48),S.Wb(1,49),S.Rb())}const ue=function(e){return[e]};function fe(e,t){if(1&e){const e=S.Tb();S.Qb(0),S.Sb(1,"div",50),S.Nb(2,"input",51),S.Sb(3,"span",14),S.Sb(4,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.index,i=t.$implicit;return S.ic(2).removePortal(a,i)})),S.Nb(5,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Pb()}if(2&e){const e=t.$implicit,a=S.ic(2);S.yb(2),S.pc("value",e),S.yb(3),S.pc("ngClass",S.uc(2,ue,a.icons.destroy))}}function he(e,t){if(1&e&&(S.Sb(0,"span",41),S.Wb(1,53),S.Rb()),2&e){const e=S.ic(2);S.yb(1),S.ac(e.minimum_gateways),S.Xb(1)}}function ge(e,t){if(1&e&&(S.Sb(0,"div",56),S.Oc(1),S.Rb()),2&e){const e=S.ic().$implicit,t=S.ic(2);S.yb(1),S.Qc("lun: ",t.imagesSettings[e].lun,"")}}function Se(e,t){if(1&e&&(S.Qb(0),S.Wb(1,57),S.jc(2,"iscsiBackstore"),S.Pb()),2&e){const e=S.ic().$implicit,t=S.ic(2);S.yb(2),S.ac(S.kc(2,1,t.imagesSettings[e].backstore)),S.Xb(1)}}function ve(e,t){1&e&&(S.Qb(0),S.Wb(1,58),S.Pb())}function ye(e,t){if(1&e){const e=S.Tb();S.Qb(0),S.Sb(1,"div",50),S.Nb(2,"input",51),S.Sb(3,"span",14),S.Mc(4,ge,2,1,"div",54),S.Sb(5,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.$implicit;return S.ic(2).imageSettingsModal(a)})),S.Nb(6,"i",16),S.Rb(),S.Sb(7,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.index,i=t.$implicit;return S.ic(2).removeImage(a,i)})),S.Nb(8,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Sb(9,"span",48),S.Mc(10,Se,3,3,"ng-container",55),S.Mc(11,ve,2,0,"ng-container",55),S.Rb(),S.Pb()}if(2&e){const e=t.$implicit,a=S.ic(2);S.yb(2),S.pc("value",e),S.yb(2),S.pc("ngIf",a.api_version>=1),S.yb(2),S.pc("ngClass",S.uc(6,ue,a.icons.deepCheck)),S.yb(2),S.pc("ngClass",S.uc(8,ue,a.icons.destroy)),S.yb(2),S.pc("ngIf",a.backstores.length>1),S.yb(1),S.pc("ngIf",a.hasAdvancedSettings(a.imagesSettings[e][a.imagesSettings[e].backstore]))}}function Re(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,59),S.Rb())}function we(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,60),S.Rb())}function _e(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,78),S.Rb())}function ke(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,79),S.Rb())}function Me(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,80),S.Rb())}function Ne(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,81),S.Rb())}function Ie(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,82),S.Rb())}function $e(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,83),S.Rb())}function Te(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,84),S.Rb())}function Fe(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,85),S.Rb())}function Pe(e,t){if(1&e&&(S.Sb(0,"div",61),S.Sb(1,"div",8),S.Sb(2,"label",62),S.Qb(3),S.Wb(4,63),S.Pb(),S.Rb(),S.Sb(5,"div",11),S.Nb(6,"input",64),S.Mc(7,_e,2,0,"span",17),S.Mc(8,ke,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(9,"div",8),S.Sb(10,"label",65),S.Qb(11),S.Wb(12,66),S.Pb(),S.Rb(),S.Sb(13,"div",11),S.Sb(14,"div",12),S.Nb(15,"input",67),S.Sb(16,"span",14),S.Nb(17,"button",68),S.Nb(18,"cd-copy-2-clipboard-button",69),S.Rb(),S.Rb(),S.Mc(19,Me,2,0,"span",17),S.Mc(20,Ne,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(21,"div",8),S.Sb(22,"label",70),S.Qb(23),S.Wb(24,71),S.Pb(),S.Rb(),S.Sb(25,"div",11),S.Nb(26,"input",72),S.Mc(27,Ie,2,0,"span",17),S.Mc(28,$e,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(29,"div",8),S.Sb(30,"label",73),S.Qb(31),S.Wb(32,74),S.Pb(),S.Rb(),S.Sb(33,"div",11),S.Sb(34,"div",12),S.Nb(35,"input",75),S.Sb(36,"span",14),S.Nb(37,"button",76),S.Nb(38,"cd-copy-2-clipboard-button",77),S.Rb(),S.Rb(),S.Mc(39,Te,2,0,"span",17),S.Mc(40,Fe,2,0,"span",17),S.Rb(),S.Rb(),S.Rb()),2&e){S.ic();const e=S.Ac(2),t=S.ic();S.yb(7),S.pc("ngIf",t.targetForm.showError("user",e,"required")),S.yb(1),S.pc("ngIf",t.targetForm.showError("user",e,"pattern")),S.yb(11),S.pc("ngIf",t.targetForm.showError("password",e,"required")),S.yb(1),S.pc("ngIf",t.targetForm.showError("password",e,"pattern")),S.yb(7),S.pc("ngIf",t.targetForm.showError("mutual_user",e,"required")),S.yb(1),S.pc("ngIf",t.targetForm.showError("mutual_user",e,"pattern")),S.yb(11),S.pc("ngIf",t.targetForm.showError("mutual_password",e,"required")),S.yb(1),S.pc("ngIf",t.targetForm.showError("mutual_password",e,"pattern"))}}function ze(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,115),S.Rb())}function Ee(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,116),S.Rb())}function Ce(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,117),S.Rb())}function De(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,118),S.Rb())}function Oe(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,119),S.Rb())}function Ae(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,120),S.Rb())}function xe(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,121),S.Rb())}function Ve(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,122),S.Rb())}function We(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,123),S.Rb())}function qe(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,124),S.Rb())}function Be(e,t){1&e&&(S.Sb(0,"span",41),S.Wb(1,125),S.Rb())}function Ge(e,t){if(1&e){const e=S.Tb();S.Qb(0),S.Sb(1,"div",50),S.Nb(2,"input",51),S.Sb(3,"span",14),S.Sb(4,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.index,i=t.$implicit,o=S.ic(),s=o.$implicit,n=o.index;return S.ic(3).removeInitiatorImage(s,a,n,i)})),S.Nb(5,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Pb()}if(2&e){const e=t.$implicit,a=S.ic(4);S.yb(2),S.pc("value",e),S.yb(3),S.pc("ngClass",S.uc(2,ue,a.icons.destroy))}}function Le(e,t){1&e&&(S.Sb(0,"span"),S.Wb(1,126),S.Rb())}function je(e,t){if(1&e&&(S.Sb(0,"div",22),S.Sb(1,"div",23),S.Sb(2,"cd-select",127),S.Nb(3,"i",25),S.Qb(4),S.Wb(5,128),S.Pb(),S.Rb(),S.Rb(),S.Rb()),2&e){const e=S.ic(),t=e.$implicit,a=e.index,i=S.ic(3);S.yb(2),S.pc("data",t.getValue("luns"))("options",i.imagesInitiatorSelections[a])("messages",i.messages.initiatorImage),S.yb(1),S.pc("ngClass",S.uc(4,ue,i.icons.add))}}function Qe(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",92),S.Sb(1,"div",5),S.Qb(2),S.Wb(3,93),S.Pb(),S.Oc(4),S.Sb(5,"button",94),S.gc("click",(function(){S.Dc(e);const a=t.index;return S.ic(3).removeInitiator(a)})),S.Nb(6,"i",25),S.Rb(),S.Rb(),S.Sb(7,"div",7),S.Sb(8,"div",8),S.Sb(9,"label",95),S.Wb(10,96),S.Rb(),S.Sb(11,"div",11),S.Sb(12,"input",97),S.gc("blur",(function(){return S.Dc(e),S.ic(3).updatedInitiatorSelector()})),S.Rb(),S.Mc(13,ze,2,0,"span",17),S.Mc(14,Ee,2,0,"span",17),S.Mc(15,Ce,2,0,"span",17),S.Rb(),S.Rb(),S.Qb(16,61),S.Sb(17,"div",8),S.Sb(18,"label",98),S.Wb(19,99),S.Rb(),S.Sb(20,"div",11),S.Nb(21,"input",100),S.Mc(22,De,2,0,"span",17),S.Mc(23,Oe,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(24,"div",8),S.Sb(25,"label",101),S.Wb(26,102),S.Rb(),S.Sb(27,"div",11),S.Sb(28,"div",12),S.Nb(29,"input",103),S.Sb(30,"span",14),S.Nb(31,"button",104),S.Nb(32,"cd-copy-2-clipboard-button",105),S.Rb(),S.Rb(),S.Mc(33,Ae,2,0,"span",17),S.Mc(34,xe,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(35,"div",8),S.Sb(36,"label",106),S.Qb(37),S.Wb(38,107),S.Pb(),S.Rb(),S.Sb(39,"div",11),S.Nb(40,"input",108),S.Mc(41,Ve,2,0,"span",17),S.Mc(42,We,2,0,"span",17),S.Rb(),S.Rb(),S.Sb(43,"div",8),S.Sb(44,"label",109),S.Wb(45,110),S.Rb(),S.Sb(46,"div",11),S.Sb(47,"div",12),S.Nb(48,"input",111),S.Sb(49,"span",14),S.Nb(50,"button",104),S.Nb(51,"cd-copy-2-clipboard-button",105),S.Rb(),S.Rb(),S.Mc(52,qe,2,0,"span",17),S.Mc(53,Be,2,0,"span",17),S.Rb(),S.Rb(),S.Pb(),S.Sb(54,"div",8),S.Sb(55,"label",112),S.Wb(56,113),S.Rb(),S.Sb(57,"div",11),S.Mc(58,Ge,6,4,"ng-container",21),S.Mc(59,Le,2,0,"span",55),S.Mc(60,je,6,6,"div",114),S.Rb(),S.Rb(),S.Rb(),S.Rb()}if(2&e){const e=t.$implicit,a=t.index;S.ic(2);const i=S.Ac(2),o=S.ic();S.pc("formGroupName",a),S.yb(4),S.Qc(": ",e.getValue("client_iqn")," "),S.yb(2),S.pc("ngClass",S.uc(25,ue,o.icons.destroy)),S.yb(7),S.pc("ngIf",e.showError("client_iqn",i,"notUnique")),S.yb(1),S.pc("ngIf",e.showError("client_iqn",i,"required")),S.yb(1),S.pc("ngIf",e.showError("client_iqn",i,"pattern")),S.yb(6),S.pc("id","user"+a),S.yb(1),S.pc("ngIf",e.showError("user",i,"required")),S.yb(1),S.pc("ngIf",e.showError("user",i,"pattern")),S.yb(6),S.pc("id","password"+a),S.yb(2),S.pc("cdPasswordButton","password"+a),S.yb(1),S.pc("source","password"+a),S.yb(1),S.pc("ngIf",e.showError("password",i,"required")),S.yb(1),S.pc("ngIf",e.showError("password",i,"pattern")),S.yb(6),S.pc("id","mutual_user"+a),S.yb(1),S.pc("ngIf",e.showError("mutual_user",i,"required")),S.yb(1),S.pc("ngIf",e.showError("mutual_user",i,"pattern")),S.yb(6),S.pc("id","mutual_password"+a),S.yb(2),S.pc("cdPasswordButton","mutual_password"+a),S.yb(1),S.pc("source","mutual_password"+a),S.yb(1),S.pc("ngIf",e.showError("mutual_password",i,"required")),S.yb(1),S.pc("ngIf",e.showError("mutual_password",i,"pattern")),S.yb(5),S.pc("ngForOf",e.getValue("luns")),S.yb(1),S.pc("ngIf",e.getValue("cdIsInGroup")),S.yb(1),S.pc("ngIf",!e.getValue("cdIsInGroup"))}}function Ue(e,t){1&e&&(S.Sb(0,"span",48),S.Wb(1,129),S.Rb())}function Ye(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",8),S.Sb(1,"label",86),S.Wb(2,87),S.Rb(),S.Sb(3,"div",88),S.Mc(4,Qe,61,27,"div",89),S.Sb(5,"div",22),S.Sb(6,"div",23),S.Mc(7,Ue,2,0,"span",18),S.Sb(8,"button",90),S.gc("click",(function(){return S.Dc(e),S.ic(2).addInitiator(),!1})),S.Nb(9,"i",25),S.Qb(10),S.Wb(11,91),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Nb(12,"hr"),S.Rb(),S.Rb()}if(2&e){const e=S.ic(2);S.yb(4),S.pc("ngForOf",e.initiators.controls),S.yb(3),S.pc("ngIf",0===e.initiators.controls.length),S.yb(2),S.pc("ngClass",S.uc(3,ue,e.icons.add))}}function Ke(e,t){if(1&e){const e=S.Tb();S.Qb(0),S.Sb(1,"div",50),S.Nb(2,"input",51),S.Sb(3,"span",14),S.Sb(4,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.index,i=S.ic(),o=i.$implicit,s=i.index;return S.ic(3).removeGroupInitiator(o,a,s)})),S.Nb(5,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Pb()}if(2&e){const e=t.$implicit,a=S.ic(4);S.yb(2),S.pc("value",e),S.yb(3),S.pc("ngClass",S.uc(2,ue,a.icons.destroy))}}function Je(e,t){if(1&e){const e=S.Tb();S.Qb(0),S.Sb(1,"div",50),S.Nb(2,"input",51),S.Sb(3,"span",14),S.Sb(4,"button",52),S.gc("click",(function(){S.Dc(e);const a=t.index,i=S.ic(),o=i.$implicit,s=i.index;return S.ic(3).removeGroupDisk(o,a,s)})),S.Nb(5,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Pb()}if(2&e){const e=t.$implicit,a=S.ic(4);S.yb(2),S.pc("value",e),S.yb(3),S.pc("ngClass",S.uc(2,ue,a.icons.destroy))}}function Xe(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",92),S.Sb(1,"div",5),S.Qb(2),S.Wb(3,133),S.Pb(),S.Oc(4),S.Sb(5,"button",94),S.gc("click",(function(){S.Dc(e);const a=t.index;return S.ic(3).removeGroup(a)})),S.Nb(6,"i",25),S.Rb(),S.Rb(),S.Sb(7,"div",7),S.Sb(8,"div",8),S.Sb(9,"label",134),S.Wb(10,135),S.Rb(),S.Sb(11,"div",11),S.Nb(12,"input",136),S.Rb(),S.Rb(),S.Sb(13,"div",8),S.Sb(14,"label",137),S.Qb(15),S.Wb(16,138),S.Pb(),S.Rb(),S.Sb(17,"div",11),S.Mc(18,Ke,6,4,"ng-container",21),S.Sb(19,"div",22),S.Sb(20,"div",23),S.Sb(21,"cd-select",24),S.gc("selection",(function(a){S.Dc(e);const i=t.index;return S.ic(3).onGroupMemberSelection(a,i)})),S.Nb(22,"i",25),S.Qb(23),S.Wb(24,139),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Nb(25,"hr"),S.Rb(),S.Rb(),S.Sb(26,"div",8),S.Sb(27,"label",28),S.Qb(28),S.Wb(29,140),S.Pb(),S.Rb(),S.Sb(30,"div",11),S.Mc(31,Je,6,4,"ng-container",21),S.Sb(32,"div",22),S.Sb(33,"div",23),S.Sb(34,"cd-select",127),S.Nb(35,"i",25),S.Qb(36),S.Wb(37,141),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Nb(38,"hr"),S.Rb(),S.Rb(),S.Rb(),S.Rb()}if(2&e){const e=t.$implicit,a=t.index,i=S.ic(3);S.pc("formGroupName",a),S.yb(4),S.Qc(": ",e.getValue("group_id")," "),S.yb(2),S.pc("ngClass",S.uc(13,ue,i.icons.destroy)),S.yb(12),S.pc("ngForOf",e.getValue("members")),S.yb(3),S.pc("data",e.getValue("members"))("options",i.groupMembersSelections[a])("messages",i.messages.groupInitiator),S.yb(1),S.pc("ngClass",S.uc(15,ue,i.icons.add)),S.yb(9),S.pc("ngForOf",e.getValue("disks")),S.yb(3),S.pc("data",e.getValue("disks"))("options",i.groupDiskSelections[a])("messages",i.messages.initiatorImage),S.yb(1),S.pc("ngClass",S.uc(17,ue,i.icons.add))}}function He(e,t){1&e&&(S.Sb(0,"span",48),S.Wb(1,142),S.Rb())}function Ze(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",8),S.Sb(1,"label",86),S.Wb(2,130),S.Rb(),S.Sb(3,"div",131),S.Mc(4,Xe,39,19,"div",89),S.Sb(5,"div",22),S.Sb(6,"div",23),S.Mc(7,He,2,0,"span",18),S.Sb(8,"button",90),S.gc("click",(function(){return S.Dc(e),S.ic(2).addGroup(),!1})),S.Nb(9,"i",25),S.Qb(10),S.Wb(11,132),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Rb(),S.Rb()}if(2&e){const e=S.ic(2);S.yb(4),S.pc("ngForOf",e.groups.controls),S.yb(3),S.pc("ngIf",0===e.groups.controls.length),S.yb(2),S.pc("ngClass",S.uc(3,ue,e.icons.add))}}function et(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",1),S.Sb(1,"form",2,3),S.Sb(3,"div",4),S.Sb(4,"div",5),S.Wb(5,6),S.jc(6,"titlecase"),S.jc(7,"upperFirst"),S.Rb(),S.Sb(8,"div",7),S.Sb(9,"div",8),S.Sb(10,"label",9),S.Wb(11,10),S.Rb(),S.Sb(12,"div",11),S.Sb(13,"div",12),S.Nb(14,"input",13),S.Sb(15,"span",14),S.Sb(16,"button",15),S.gc("click",(function(){return S.Dc(e),S.ic().targetSettingsModal()})),S.Nb(17,"i",16),S.Rb(),S.Rb(),S.Rb(),S.Mc(18,be,2,0,"span",17),S.Mc(19,de,2,0,"span",17),S.Mc(20,pe,9,0,"span",17),S.Mc(21,me,2,0,"span",18),S.Nb(22,"hr"),S.Rb(),S.Rb(),S.Sb(23,"div",8),S.Sb(24,"label",19),S.Wb(25,20),S.Rb(),S.Sb(26,"div",11),S.Mc(27,fe,6,4,"ng-container",21),S.Sb(28,"div",22),S.Sb(29,"div",23),S.Sb(30,"cd-select",24),S.gc("selection",(function(t){return S.Dc(e),S.ic().onPortalSelection(t)})),S.Nb(31,"i",25),S.Qb(32),S.Wb(33,26),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Nb(34,"input",27),S.Mc(35,he,2,1,"span",17),S.Nb(36,"hr"),S.Rb(),S.Rb(),S.Sb(37,"div",8),S.Sb(38,"label",28),S.Wb(39,29),S.Rb(),S.Sb(40,"div",11),S.Mc(41,ye,12,10,"ng-container",21),S.Nb(42,"input",30),S.Mc(43,Re,2,0,"span",17),S.Mc(44,we,2,0,"span",17),S.Sb(45,"div",22),S.Sb(46,"div",23),S.Sb(47,"cd-select",24),S.gc("selection",(function(t){return S.Dc(e),S.ic().onImageSelection(t)})),S.Nb(48,"i",25),S.Qb(49),S.Wb(50,31),S.Pb(),S.Rb(),S.Rb(),S.Rb(),S.Nb(51,"hr"),S.Rb(),S.Rb(),S.Sb(52,"div",8),S.Sb(53,"div",32),S.Sb(54,"div",33),S.Nb(55,"input",34),S.Sb(56,"label",35),S.Wb(57,36),S.Rb(),S.Rb(),S.Nb(58,"hr"),S.Rb(),S.Rb(),S.Mc(59,Pe,41,8,"div",37),S.Mc(60,Ye,13,5,"div",38),S.Mc(61,Ze,12,5,"div",38),S.Rb(),S.Sb(62,"div",39),S.Sb(63,"cd-form-button-panel",40),S.gc("submitActionEvent",(function(){return S.Dc(e),S.ic().submit()})),S.jc(64,"titlecase"),S.jc(65,"upperFirst"),S.Rb(),S.Rb(),S.Rb(),S.Rb(),S.Rb()}if(2&e){const e=S.Ac(2),t=S.ic();S.yb(1),S.pc("formGroup",t.targetForm),S.yb(6),S.ac(S.kc(6,26,t.action))(S.kc(7,28,t.resource)),S.Xb(5),S.yb(10),S.pc("ngClass",S.uc(34,ue,t.icons.deepCheck)),S.yb(1),S.pc("ngIf",t.targetForm.showError("target_iqn",e,"required")),S.yb(1),S.pc("ngIf",t.targetForm.showError("target_iqn",e,"pattern")),S.yb(1),S.pc("ngIf",t.targetForm.showError("target_iqn",e,"iqn")),S.yb(1),S.pc("ngIf",t.hasAdvancedSettings(t.targetForm.getValue("target_controls"))),S.yb(6),S.pc("ngForOf",t.portals.value),S.yb(3),S.pc("data",t.portals.value)("options",t.portalsSelections)("messages",t.messages.portals),S.yb(1),S.pc("ngClass",S.uc(36,ue,t.icons.add)),S.yb(4),S.pc("ngIf",t.targetForm.showError("portals",e,"minGateways")),S.yb(6),S.pc("ngForOf",t.targetForm.getValue("disks")),S.yb(2),S.pc("ngIf",t.targetForm.showError("disks",e,"dupLunId")),S.yb(1),S.pc("ngIf",t.targetForm.showError("disks",e,"dupWwn")),S.yb(3),S.pc("data",t.disks.value)("options",t.imagesSelections)("messages",t.messages.images),S.yb(1),S.pc("ngClass",S.uc(38,ue,t.icons.add)),S.yb(11),S.pc("ngIf",t.cephIscsiConfigVersion>10&&!t.targetForm.getValue("acl_enabled")),S.yb(1),S.pc("ngIf",t.targetForm.getValue("acl_enabled")),S.yb(1),S.pc("ngIf",t.targetForm.getValue("acl_enabled")),S.yb(2),S.pc("form",t.targetForm)("submitText",S.kc(64,30,t.action)+" "+S.kc(65,32,t.resource))}}let tt=(()=>{class e extends I.a{constructor(e,t,a,i,o,s,n){super(),this.iscsiService=e,this.modalService=t,this.rbdService=a,this.router=i,this.route=o,this.taskWrapper=s,this.actionLabels=n,this.api_version=0,this.minimum_gateways=1,this.icons=N.a,this.isEdit=!1,this.portalsSelections=[],this.imagesInitiatorSelections=[],this.groupDiskSelections=[],this.groupMembersSelections=[],this.imagesSettings={},this.messages={portals:new k.a({noOptions:"There are no portals available."}),images:new k.a({noOptions:"There are no images available."}),initiatorImage:new k.a({noOptions:"There are no images available. Please make sure you add an image to the target."}),groupInitiator:new k.a({noOptions:"There are no initiators available. Please make sure you add an initiator to the target."})},this.IQN_REGEX=/^iqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+)*$/,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.resource="target"}ngOnInit(){const e=[this.iscsiService.listTargets(),this.rbdService.list(),this.iscsiService.portals(),this.iscsiService.settings(),this.iscsiService.version()];this.router.url.startsWith("/block/iscsi/targets/edit")&&(this.isEdit=!0,this.route.params.subscribe(t=>{this.target_iqn=decodeURIComponent(t.target_iqn),e.push(this.iscsiService.getTarget(this.target_iqn))})),this.action=this.isEdit?this.actionLabels.EDIT:this.actionLabels.CREATE,Object(u.a)(e).subscribe(e=>{const t=m()(e[0]).filter(e=>e.target_iqn!==this.target_iqn).flatMap(e=>e.disks).map(e=>`${e.pool}/${e.image}`).value();"api_version"in e[3]&&(this.api_version=e[3].api_version),this.minimum_gateways=e[3].config.minimum_gateways,this.target_default_controls=e[3].target_default_controls,this.target_controls_limits=e[3].target_controls_limits,this.disk_default_controls=e[3].disk_default_controls,this.disk_controls_limits=e[3].disk_controls_limits,this.backstores=e[3].backstores,this.default_backstore=e[3].default_backstore,this.unsupported_rbd_features=e[3].unsupported_rbd_features,this.required_rbd_features=e[3].required_rbd_features,this.imagesAll=m()(e[1]).flatMap(e=>e.value).filter(e=>!e.namespace&&-1===t.indexOf(`${e.pool_name}/${e.name}`)&&0!==this.getValidBackstores(e).length).value(),this.imagesSelections=this.imagesAll.map(e=>new M.a(!1,`${e.pool_name}/${e.name}`,""));const a=[];e[2].forEach(e=>{e.ip_addresses.forEach(t=>{a.push(new M.a(!1,e.name+":"+t,""))})}),this.portalsSelections=[...a],this.cephIscsiConfigVersion=e[4].ceph_iscsi_config_version,this.createForm(),e[5]&&this.resolveModel(e[5]),this.loadingReady()})}createForm(){if(this.targetForm=new $.a({target_iqn:new o.h("iqn.2001-07.com.ceph:"+Date.now(),{validators:[o.A.required,o.A.pattern(this.IQN_REGEX)]}),target_controls:new o.h({}),portals:new o.h([],{validators:[T.a.custom("minGateways",e=>m.a.uniq(e.map(e=>e.split(":")[0])).length<Math.max(1,this.minimum_gateways))]}),disks:new o.h([],{validators:[T.a.custom("dupLunId",e=>{const t=this.getLunIds(e);return t.length!==m.a.uniq(t).length}),T.a.custom("dupWwn",e=>{const t=this.getWwns(e);return t.length!==m.a.uniq(t).length})]}),initiators:new o.e([]),groups:new o.e([]),acl_enabled:new o.h(!1)}),this.cephIscsiConfigVersion>10){const e=new $.a({user:new o.h(""),password:new o.h(""),mutual_user:new o.h(""),mutual_password:new o.h("")});this.setAuthValidator(e),this.targetForm.addControl("auth",e)}}resolveModel(e){this.targetForm.patchValue({target_iqn:e.target_iqn,target_controls:e.target_controls,acl_enabled:e.acl_enabled}),this.cephIscsiConfigVersion>10&&this.targetForm.patchValue({auth:e.auth});const t=[];m.a.forEach(e.portals,e=>{t.push(`${e.host}:${e.ip}`)}),this.targetForm.patchValue({portals:t});const a=[];m.a.forEach(e.disks,e=>{const t=`${e.pool}/${e.image}`;a.push(t),this.imagesSettings[t]={backstore:e.backstore},this.imagesSettings[t][e.backstore]=e.controls,"lun"in e&&(this.imagesSettings[t].lun=e.lun),"wwn"in e&&(this.imagesSettings[t].wwn=e.wwn),this.onImageSelection({option:{name:t,selected:!0}})}),this.targetForm.patchValue({disks:a}),m.a.forEach(e.clients,e=>{const t=this.addInitiator();e.luns=m.a.map(e.luns,e=>`${e.pool}/${e.image}`),t.patchValue(e)}),e.groups.forEach((e,t)=>{const a=this.addGroup();e.disks=m.a.map(e.disks,e=>`${e.pool}/${e.image}`),a.patchValue(e),m.a.forEach(e.members,e=>{this.onGroupMemberSelection({option:new M.a(!0,e,"")},t)})})}hasAdvancedSettings(e){return Object.values(e).length>0}get portals(){return this.targetForm.get("portals")}onPortalSelection(){this.portals.setValue(this.portals.value)}removePortal(e,t){return this.portalsSelections.forEach(e=>{e.name===t&&(e.selected=!1)}),this.portals.value.splice(e,1),this.portals.setValue(this.portals.value),!1}get disks(){return this.targetForm.get("disks")}removeImage(e,t){return this.imagesSelections.forEach(e=>{e.name===t&&(e.selected=!1)}),this.disks.value.splice(e,1),this.removeImageRefs(t),this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1}),!1}removeImageRefs(e){this.initiators.controls.forEach(t=>{const a=t.value.luns.filter(t=>t!==e);t.get("luns").setValue(a)}),this.groups.controls.forEach(t=>{const a=t.value.disks.filter(t=>t!==e);t.get("disks").setValue(a)}),m.a.forEach(this.imagesInitiatorSelections,(t,a)=>{this.imagesInitiatorSelections[a]=t.filter(t=>t.name!==e)}),m.a.forEach(this.groupDiskSelections,(t,a)=>{this.groupDiskSelections[a]=t.filter(t=>t.name!==e)})}getDefaultBackstore(e){let t=this.default_backstore;const a=this.getImageById(e);return this.validFeatures(a,this.default_backstore)||this.backstores.forEach(e=>{e!==this.default_backstore&&this.validFeatures(a,e)&&(t=e)}),t}isLunIdInUse(e,t){const a=this.disks.value.filter(e=>e!==t);return this.getLunIds(a).includes(e)}getLunIds(e){return m.a.map(e,e=>this.imagesSettings[e].lun)}nextLunId(e){const t=this.disks.value.filter(t=>t!==e),a=this.getLunIds(t);let i=0;for(;a.includes(i);)i++;return i}getWwns(e){return m.a.map(e,e=>this.imagesSettings[e].wwn).filter(e=>m.a.isString(e)&&""!==e)}onImageSelection(e){const t=e.option;if(t.selected){if(this.imagesSettings[t.name])this.isLunIdInUse(this.imagesSettings[t.name].lun,t.name)&&(this.imagesSettings[t.name].lun=this.nextLunId(t.name));else{const e=this.getDefaultBackstore(t.name);this.imagesSettings[t.name]={backstore:e,lun:this.nextLunId(t.name)},this.imagesSettings[t.name][e]={}}m.a.forEach(this.imagesInitiatorSelections,(e,a)=>{e.push(new M.a(!1,t.name,"")),this.imagesInitiatorSelections[a]=[...e]}),m.a.forEach(this.groupDiskSelections,(e,a)=>{e.push(new M.a(!1,t.name,"")),this.groupDiskSelections[a]=[...e]})}else this.removeImageRefs(t.name);this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1})}get initiators(){return this.targetForm.get("initiators")}addInitiator(){const e=new $.a({client_iqn:new o.h("",{validators:[o.A.required,T.a.custom("notUnique",e=>{const t=this.initiators.controls.reduce((function(e,t){return e.concat(t.value.client_iqn)}),[]);return t.indexOf(e)!==t.lastIndexOf(e)}),o.A.pattern(this.IQN_REGEX)]}),auth:new $.a({user:new o.h(""),password:new o.h(""),mutual_user:new o.h(""),mutual_password:new o.h("")}),luns:new o.h([]),cdIsInGroup:new o.h(!1)});this.setAuthValidator(e),this.initiators.push(e),m.a.forEach(this.groupMembersSelections,(e,t)=>{e.push(new M.a(!1,"","")),this.groupMembersSelections[t]=[...e]});const t=m.a.map(this.targetForm.getValue("disks"),e=>new M.a(!1,e,""));return this.imagesInitiatorSelections.push(t),e}setAuthValidator(e){T.a.validateIf(e.get("user"),()=>e.getValue("password")||e.getValue("mutual_user")||e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[e.get("password"),e.get("mutual_user"),e.get("mutual_password")]),T.a.validateIf(e.get("password"),()=>e.getValue("user")||e.getValue("mutual_user")||e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[e.get("user"),e.get("mutual_user"),e.get("mutual_password")]),T.a.validateIf(e.get("mutual_user"),()=>e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[e.get("user"),e.get("password"),e.get("mutual_password")]),T.a.validateIf(e.get("mutual_password"),()=>e.getValue("mutual_user"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[e.get("user"),e.get("password"),e.get("mutual_user")])}removeInitiator(e){const t=this.initiators.value[e];this.initiators.removeAt(e),m.a.forEach(this.groupMembersSelections,(t,a)=>{t.splice(e,1),this.groupMembersSelections[a]=[...t]}),this.groups.controls.forEach(e=>{const a=e.value.members.filter(e=>e!==t.client_iqn);e.get("members").setValue(a)}),this.imagesInitiatorSelections.splice(e,1)}updatedInitiatorSelector(){this.initiators.controls.forEach(e=>{e.get("client_iqn").updateValueAndValidity({emitEvent:!1})}),m.a.forEach(this.groupMembersSelections,(e,t)=>{m.a.forEach(e,(e,t)=>{const a=e.name;e.name=this.initiators.controls[t].value.client_iqn,this.groups.controls.forEach(t=>{const i=t.value.members,o=i.indexOf(a);-1!==o&&(i[o]=e.name),t.get("members").setValue(i)})}),this.groupMembersSelections[t]=[...this.groupMembersSelections[t]]})}removeInitiatorImage(e,t,a,i){const o=e.getValue("luns");return o.splice(t,1),e.patchValue({luns:o}),this.imagesInitiatorSelections[a].forEach(e=>{e.name===i&&(e.selected=!1)}),!1}get groups(){return this.targetForm.get("groups")}addGroup(){const e=new $.a({group_id:new o.h("",{validators:[o.A.required]}),members:new o.h([]),disks:new o.h([])});this.groups.push(e);const t=m.a.map(this.targetForm.getValue("disks"),e=>new M.a(!1,e,""));this.groupDiskSelections.push(t);const a=m.a.map(this.initiators.value,e=>new M.a(!1,e.client_iqn,"",!e.cdIsInGroup));return this.groupMembersSelections.push(a),e}removeGroup(e){this.groups.removeAt(e),this.groupMembersSelections[e].filter(e=>e.selected).forEach(t=>{t.selected=!1,this.onGroupMemberSelection({option:t},e)}),this.groupMembersSelections.splice(e,1),this.groupDiskSelections.splice(e,1)}onGroupMemberSelection(e,t){const a=e.option;let i=[];if(!a.selected){const e=this.groupDiskSelections[t].filter(e=>e.selected);i=e.map(e=>e.name)}this.initiators.controls.forEach((e,t)=>{e.value.client_iqn===a.name&&(e.patchValue({luns:i}),e.get("cdIsInGroup").setValue(a.selected),m.a.forEach(this.groupMembersSelections,e=>{e[t].enabled=!a.selected}),this.imagesInitiatorSelections[t].forEach(e=>{e.selected=i.includes(e.name)}))})}removeGroupInitiator(e,t,a){const i=e.getValue("members")[t];e.getValue("members").splice(t,1),this.onGroupMemberSelection({option:new M.a(!1,i,"")},a)}removeGroupDisk(e,t,a){const i=e.getValue("disks")[t];e.getValue("disks").splice(t,1),this.groupDiskSelections[a].forEach(e=>{e.name===i&&(e.selected=!1)}),this.groupDiskSelections[a]=[...this.groupDiskSelections[a]]}submit(){const e=m.a.cloneDeep(this.targetForm.value),t={target_iqn:this.targetForm.getValue("target_iqn"),target_controls:this.targetForm.getValue("target_controls"),acl_enabled:this.targetForm.getValue("acl_enabled"),portals:[],disks:[],clients:[],groups:[]};if(this.cephIscsiConfigVersion>10){const e=this.targetForm.get("auth");e.getValue("user")||e.get("user").setValue(""),e.getValue("password")||e.get("password").setValue(""),e.getValue("mutual_user")||e.get("mutual_user").setValue(""),e.getValue("mutual_password")||e.get("mutual_password").setValue("");const a=this.targetForm.getValue("acl_enabled");t.auth={user:a?"":e.getValue("user"),password:a?"":e.getValue("password"),mutual_user:a?"":e.getValue("mutual_user"),mutual_password:a?"":e.getValue("mutual_password")}}let a;e.disks.forEach(e=>{const a=e.split("/"),i=this.imagesSettings[e].backstore;t.disks.push({pool:a[0],image:a[1],backstore:i,controls:this.imagesSettings[e][i],lun:this.imagesSettings[e].lun,wwn:this.imagesSettings[e].wwn})}),e.portals.forEach(e=>{const a=e.indexOf(":");t.portals.push({host:e.substring(0,a),ip:e.substring(a+1)})}),t.acl_enabled&&(e.initiators.forEach(e=>{e.auth.user||(e.auth.user=""),e.auth.password||(e.auth.password=""),e.auth.mutual_user||(e.auth.mutual_user=""),e.auth.mutual_password||(e.auth.mutual_password=""),delete e.cdIsInGroup;const t=[];e.luns.forEach(e=>{const a=e.split("/");t.push({pool:a[0],image:a[1]})}),e.luns=t}),t.clients=e.initiators),t.acl_enabled&&(e.groups.forEach(e=>{const t=[];e.disks.forEach(e=>{const a=e.split("/");t.push({pool:a[0],image:a[1]})}),e.disks=t}),t.groups=e.groups),this.isEdit?(t.new_target_iqn=t.target_iqn,t.target_iqn=this.target_iqn,a=this.taskWrapper.wrapTaskAroundCall({task:new F.a("iscsi/target/edit",{target_iqn:t.target_iqn}),call:this.iscsiService.updateTarget(this.target_iqn,t)})):a=this.taskWrapper.wrapTaskAroundCall({task:new F.a("iscsi/target/create",{target_iqn:t.target_iqn}),call:this.iscsiService.createTarget(t)}),a.subscribe({error:()=>{this.targetForm.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/block/iscsi/targets"])})}targetSettingsModal(){const e={target_controls:this.targetForm.get("target_controls"),target_default_controls:this.target_default_controls,target_controls_limits:this.target_controls_limits};this.modalRef=this.modalService.show(ie,e)}imageSettingsModal(e){const t={imagesSettings:this.imagesSettings,image:e,api_version:this.api_version,disk_default_controls:this.disk_default_controls,disk_controls_limits:this.disk_controls_limits,backstores:this.getValidBackstores(this.getImageById(e)),control:this.targetForm.get("disks")};this.modalRef=this.modalService.show(te,t)}validFeatures(e,t){const a=e.features,i=this.required_rbd_features[t];return(a&i)===i&&0==(a&this.unsupported_rbd_features[t])}getImageById(e){return this.imagesAll.find(t=>e===`${t.pool_name}/${t.name}`)}getValidBackstores(e){return this.backstores.filter(t=>this.validFeatures(e,t))}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(v),S.Mb(P.a),S.Mb(_),S.Mb(s.e),S.Mb(s.a),S.Mb(z.a),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-form"]],features:[S.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","targetForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","target_iqn",1,"cd-col-form-label","required"],"Target IQN",[1,"cd-col-form-input"],[1,"input-group"],["type","text","id","target_iqn","name","target_iqn","formControlName","target_iqn","cdTrim","",1,"form-control"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["class","form-text text-muted",4,"ngIf"],["for","portals",1,"cd-col-form-label","required"],"Portals",[4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],["elemClass","btn btn-light float-right",3,"data","options","messages","selection"],[3,"ngClass"],"Add portal",["type","hidden","id","portals","name","portals","formControlName","portals",1,"form-control"],["for","disks",1,"cd-col-form-label"],"Images",["type","hidden","id","disks","name","disks","formControlName","disks",1,"form-control"],"Add image",[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","acl_enabled","name","acl_enabled","id","acl_enabled",1,"custom-control-input"],["for","acl_enabled",1,"custom-control-label"],"ACL authentication",["formGroupName","auth",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","IQN has wrong pattern.","An IQN has the following notation 'iqn.$year-$month.$reversedAddress:$definedName'","For example: iqn.2016-06.org.dashboard:storage:disk.sn-a8675309",["target","_blank","href","https://en.wikipedia.org/wiki/ISCSI#Addressing"],"More information",[1,"form-text","text-muted"],"This target has modified advanced settings.",[1,"input-group","cd-mb"],["type","text","disabled","",1,"cd-form-control",3,"value"],["type","button",1,"btn","btn-light",3,"click"],"At least " + "\ufffd0\ufffd" + " gateways are required.",["class","input-group-text",4,"ngIf"],[4,"ngIf"],[1,"input-group-text"],"Backstore: " + "\ufffd0\ufffd" + ".\xA0","This image has modified settings.","Duplicated LUN numbers.","Duplicated WWN.",["formGroupName","auth"],["for","target_user",1,"cd-col-form-label"],"User",["type","text","autocomplete","off","id","target_user","name","target_user","formControlName","user",1,"form-control"],["for","target_password",1,"cd-col-form-label"],"Password",["type","password","autocomplete","new-password","id","target_password","name","target_password","formControlName","password",1,"form-control"],["type","button","cdPasswordButton","target_password",1,"btn","btn-light"],["source","target_password"],["for","target_mutual_user",1,"cd-col-form-label"],"Mutual User",["type","text","autocomplete","off","id","target_mutual_user","name","target_mutual_user","formControlName","mutual_user",1,"form-control"],["for","target_mutual_password",1,"cd-col-form-label"],"Mutual Password",["type","password","autocomplete","new-password","id","target_mutual_password","name","target_mutual_password","formControlName","mutual_password",1,"form-control"],["type","button","cdPasswordButton","target_mutual_password",1,"btn","btn-light"],["source","target_mutual_password"],"This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.","This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",["for","initiators",1,"cd-col-form-label"],"Initiators",["formArrayName","initiators",1,"cd-col-form-input"],["class","card mb-2",3,"formGroupName",4,"ngFor","ngForOf"],[1,"btn","btn-light","float-right",3,"click"],"Add initiator",[1,"card","mb-2",3,"formGroupName"],"Initiator",["type","button",1,"close",3,"click"],["for","client_iqn",1,"cd-col-form-label","required"],"Client IQN",["type","text","formControlName","client_iqn","cdTrim","",1,"form-control",3,"blur"],["for","user",1,"cd-col-form-label"],"User",["formControlName","user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","password",1,"cd-col-form-label"],"Password",["formControlName","password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["type","button",1,"btn","btn-light",3,"cdPasswordButton"],[3,"source"],["for","mutual_user",1,"cd-col-form-label"],"Mutual User",["formControlName","mutual_user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","mutual_password",1,"cd-col-form-label"],"Mutual Password",["formControlName","mutual_password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["for","luns",1,"cd-col-form-label"],"Images",["class","row",4,"ngIf"],"Initiator IQN needs to be unique.","This field is required.","IQN has wrong pattern.","This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.","This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.","Initiator belongs to a group. Images will be configure in the group.",["elemClass","btn btn-light float-right",3,"data","options","messages"],"Add image","No items added.","Groups",["formArrayName","groups",1,"cd-col-form-input"],"Add group","Group",["for","group_id",1,"cd-col-form-label","required"],"Name",["type","text","formControlName","group_id",1,"form-control"],["for","members",1,"cd-col-form-label"],"Initiators","Add initiator","Images","Add image","No items added."]},template:function(e,t){1&e&&S.Mc(0,et,66,40,"div",0),2&e&&S.pc("cdFormLoading",t.loading)},directives:[oe.a,o.C,o.r,o.k,C.a,D.a,O.a,o.d,A.a,o.q,o.i,se,i.p,i.r,i.q,ne.a,o.b,x.a,o.l,re.a,ce.a,o.f],pipes:[i.A,le.a,Y.a],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),e})();var at=a("+fVR"),it=a("0+/T"),ot=a("uIqm"),st=a("x38r"),nt=a("vCyI"),rt=a("FFMq"),ct=a("G1/K"),lt=a("aexS"),bt=a("VTlA"),dt=a("mtw6"),pt=a("9nlD");function mt(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,31),S.Rb())}function ut(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,32),S.Rb())}function ft(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,33),S.Rb())}function ht(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,34),S.Rb())}function gt(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,35),S.Rb())}function St(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,36),S.Rb())}function vt(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,37),S.Rb())}function yt(e,t){1&e&&(S.Sb(0,"span",30),S.Wb(1,38),S.Rb())}let Rt=(()=>{class e{constructor(e,t,a,i,o){this.authStorageService=e,this.activeModal=t,this.actionLabels=a,this.iscsiService=i,this.notificationService=o,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.permission=this.authStorageService.getPermissions().iscsi}ngOnInit(){this.hasPermission=this.permission.update,this.createForm(),this.iscsiService.getDiscovery().subscribe(e=>{this.discoveryForm.patchValue(e)})}createForm(){this.discoveryForm=new $.a({user:new o.h({value:"",disabled:!this.hasPermission}),password:new o.h({value:"",disabled:!this.hasPermission}),mutual_user:new o.h({value:"",disabled:!this.hasPermission}),mutual_password:new o.h({value:"",disabled:!this.hasPermission})}),T.a.validateIf(this.discoveryForm.get("user"),()=>this.discoveryForm.getValue("password")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),T.a.validateIf(this.discoveryForm.get("password"),()=>this.discoveryForm.getValue("user")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),T.a.validateIf(this.discoveryForm.get("mutual_user"),()=>this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_password")]),T.a.validateIf(this.discoveryForm.get("mutual_password"),()=>this.discoveryForm.getValue("mutual_user"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user")])}submitAction(){this.iscsiService.updateDiscovery(this.discoveryForm.value).subscribe(()=>{this.notificationService.show(dt.a.success,"Updated discovery authentication"),this.activeModal.close()},()=>{this.discoveryForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(r.a),S.Mb(l.b),S.Mb(v),S.Mb(pt.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-discovery-modal"]],decls:46,vars:13,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Discovery Authentication",[1,"modal-content"],["name","discoveryForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],"User",[1,"cd-col-form-input"],["id","user","formControlName","user","type","text","autocomplete","off",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","password",1,"cd-col-form-label"],"Password",[1,"input-group"],["id","password","formControlName","password","type","password","autocomplete","new-password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-light"],["source","password"],["for","mutual_user",1,"cd-col-form-label"],"Mutual User",["id","mutual_user","formControlName","mutual_user","type","text","autocomplete","off",1,"form-control"],["for","mutual_password",1,"cd-col-form-label"],"Mutual Password",["id","mutual_password","formControlName","mutual_password","type","password","autocomplete","new-password",1,"form-control"],["type","button","cdPasswordButton","mutual_password",1,"btn","btn-light"],["source","mutual_password"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.","This field is required.","User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.","This field is required.","Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"div",7),S.Sb(8,"label",8),S.Wb(9,9),S.Rb(),S.Sb(10,"div",10),S.Nb(11,"input",11),S.Mc(12,mt,2,0,"span",12),S.Mc(13,ut,2,0,"span",12),S.Rb(),S.Rb(),S.Sb(14,"div",7),S.Sb(15,"label",13),S.Wb(16,14),S.Rb(),S.Sb(17,"div",10),S.Sb(18,"div",15),S.Nb(19,"input",16),S.Sb(20,"span",17),S.Nb(21,"button",18),S.Nb(22,"cd-copy-2-clipboard-button",19),S.Rb(),S.Rb(),S.Mc(23,ft,2,0,"span",12),S.Mc(24,ht,2,0,"span",12),S.Rb(),S.Rb(),S.Sb(25,"div",7),S.Sb(26,"label",20),S.Qb(27),S.Wb(28,21),S.Pb(),S.Rb(),S.Sb(29,"div",10),S.Nb(30,"input",22),S.Mc(31,gt,2,0,"span",12),S.Mc(32,St,2,0,"span",12),S.Rb(),S.Rb(),S.Sb(33,"div",7),S.Sb(34,"label",23),S.Wb(35,24),S.Rb(),S.Sb(36,"div",10),S.Sb(37,"div",15),S.Nb(38,"input",25),S.Sb(39,"span",17),S.Nb(40,"button",26),S.Nb(41,"cd-copy-2-clipboard-button",27),S.Rb(),S.Rb(),S.Mc(42,vt,2,0,"span",12),S.Mc(43,yt,2,0,"span",12),S.Rb(),S.Rb(),S.Rb(),S.Sb(44,"div",28),S.Sb(45,"cd-form-button-panel",29),S.gc("submitActionEvent",(function(){return t.submitAction()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.discoveryForm),S.yb(8),S.pc("ngIf",t.discoveryForm.showError("user",e,"required")),S.yb(1),S.pc("ngIf",t.discoveryForm.showError("user",e,"pattern")),S.yb(10),S.pc("ngIf",t.discoveryForm.showError("password",e,"required")),S.yb(1),S.pc("ngIf",t.discoveryForm.showError("password",e,"pattern")),S.yb(7),S.pc("ngIf",t.discoveryForm.showError("mutual_user",e,"required")),S.yb(1),S.pc("ngIf",t.discoveryForm.showError("mutual_user",e,"pattern")),S.yb(10),S.pc("ngIf",t.discoveryForm.showError("mutual_password",e,"required")),S.yb(1),S.pc("ngIf",t.discoveryForm.showError("mutual_password",e,"pattern")),S.yb(2),S.pc("form",t.discoveryForm)("showSubmit",t.hasPermission)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.C,o.r,o.k,C.a,D.a,O.a,o.d,A.a,o.q,o.i,i.r,re.a,ce.a,x.a],styles:[""]}),e})(),wt=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(s.e))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-tabs"]],decls:8,vars:1,consts:function(){return[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/iscsi/overview"],["ngbNavLink",""],"Overview",["ngbNavItem","/block/iscsi/targets"],"Targets"]},template:function(e,t){1&e&&(S.Sb(0,"ul",0,1),S.gc("navChange",(function(e){return t.router.navigate([e.nextId])})),S.Sb(2,"li",2),S.Sb(3,"a",3),S.Wb(4,4),S.Rb(),S.Rb(),S.Sb(5,"li",5),S.Sb(6,"a",3),S.Wb(7,6),S.Rb(),S.Rb(),S.Rb()),2&e&&S.pc("activeId",t.router.url)},directives:[r.p,r.r,r.s],styles:[""]}),e})();var _t=a("/NlG"),kt=a("6qls"),Mt=a("S7zO"),Nt=a("iExv");const It=["highlightTpl"],$t=["detailTable"],Tt=["tree"],Ft=function(){return["logged_in"]},Pt=function(){return["logged_out"]},zt=function(e,t){return{"badge-success":e,"badge-danger":t}};function Et(e,t){if(1&e&&(S.Nb(0,"i"),S.Sb(1,"span"),S.Oc(2),S.Rb(),S.Oc(3," \xa0 "),S.Sb(4,"span",8),S.Oc(5),S.Rb()),2&e){const e=t.$implicit;S.Ab(e.data.cdIcon),S.yb(2),S.Pc(e.data.name),S.yb(2),S.pc("ngClass",S.vc(7,zt,S.tc(5,Ft).includes(e.data.status),S.tc(6,Pt).includes(e.data.status))),S.yb(1),S.Qc(" ",e.data.status," ")}}function Ct(e,t){if(1&e&&(S.Sb(0,"div",9),S.Sb(1,"legend"),S.Oc(2),S.Rb(),S.Nb(3,"cd-table",10,11),S.Rb()),2&e){const e=S.ic();S.yb(2),S.Pc(e.title),S.yb(1),S.pc("data",e.data)("columns",e.columns)("limit",0)}}function Dt(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Rb()),2&e){const e=S.ic().value;S.yb(1),S.Pc(e)}}function Ot(e,t){if(1&e&&(S.Sb(0,"strong"),S.Oc(1),S.Rb()),2&e){const e=S.ic().value;S.yb(1),S.Pc(e)}}function At(e,t){if(1&e&&(S.Mc(0,Dt,2,1,"span",12),S.Mc(1,Ot,2,1,"strong",12)),2&e){const e=t.row;S.pc("ngIf",void 0===e.default||e.default===e.current),S.yb(1),S.pc("ngIf",void 0!==e.default&&e.default!==e.current)}}let xt=(()=>{class e{constructor(e,t){this.iscsiBackstorePipe=e,this.booleanTextPipe=t,this.icons=N.a,this.metadata={},this.nodes=[],this.treeOptions={useVirtualScroll:!0,actionMapping:{mouse:{click:this.onNodeSelected.bind(this)}}}}set content(e){this.detailTable=e,e&&e.updateColumns()}ngOnInit(){this.columns=[{prop:"displayName",name:"Name",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"current",name:"Current",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"default",name:"Default",flexGrow:1,cellTemplate:this.highlightTpl}]}ngOnChanges(){this.selection&&(this.selectedItem=this.selection,this.generateTree()),this.data=void 0}generateTree(){const e=m.a.cloneDeep(this.selectedItem.target_controls);this.cephIscsiConfigVersion>10&&m.a.extend(e,m.a.cloneDeep(this.selectedItem.auth)),this.metadata={root:e};const t={target:{expanded:m.a.join(this.selectedItem.cdExecuting?[N.a.large,N.a.spinner,N.a.spin]:[N.a.large,N.a.bullseye]," ")},initiators:{expanded:m.a.join([N.a.large,N.a.user]," "),leaf:m.a.join([N.a.user]," ")},groups:{expanded:m.a.join([N.a.large,N.a.users]," "),leaf:m.a.join([N.a.users]," ")},disks:{expanded:m.a.join([N.a.large,N.a.disk]," "),leaf:m.a.join([N.a.disk]," ")},portals:{expanded:m.a.join([N.a.large,N.a.server]," "),leaf:m.a.join([N.a.server]," ")}},a=[];m.a.forEach(this.selectedItem.disks,e=>{const i="disk_"+e.pool+"_"+e.image;this.metadata[i]={controls:e.controls,backstore:e.backstore},["wwn","lun"].forEach(t=>{t in e&&(this.metadata[i][t]=e[t])}),a.push({name:`${e.pool}/${e.image}`,cdId:i,cdIcon:t.disks.leaf})});const i=[];m.a.forEach(this.selectedItem.portals,e=>{i.push({name:`${e.host}:${e.ip}`,cdIcon:t.portals.leaf})});const o=[];m.a.forEach(this.selectedItem.clients,e=>{const a=m.a.cloneDeep(e.auth);e.info&&(m.a.extend(a,e.info),delete a.state,m.a.forEach(Object.keys(e.info.state),t=>{a[t.toLowerCase()]=e.info.state[t]})),this.metadata["client_"+e.client_iqn]=a;const i=[];e.luns.forEach(e=>{i.push({name:`${e.pool}/${e.image}`,cdId:"disk_"+e.pool+"_"+e.image,cdIcon:t.disks.leaf})});let s="";e.info&&(s=Object.keys(e.info.state).includes("LOGGED_IN")?"logged_in":"logged_out"),o.push({name:e.client_iqn,status:s,cdId:"client_"+e.client_iqn,children:i,cdIcon:t.initiators.leaf})});const s=[];m.a.forEach(this.selectedItem.groups,e=>{const a=[];e.disks.forEach(e=>{a.push({name:`${e.pool}/${e.image}`,cdId:"disk_"+e.pool+"_"+e.image,cdIcon:t.disks.leaf})});const i=[];e.members.forEach(e=>{i.push({name:e,cdId:"client_"+e})}),s.push({name:e.group_id,cdIcon:t.groups.leaf,children:[{name:"Disks",children:a,cdIcon:t.disks.expanded},{name:"Initiators",children:i,cdIcon:t.initiators.expanded}]})}),this.nodes=[{name:this.selectedItem.target_iqn,cdId:"root",isExpanded:!0,cdIcon:t.target.expanded,children:[{name:"Disks",isExpanded:!0,children:a,cdIcon:t.disks.expanded},{name:"Portals",isExpanded:!0,children:i,cdIcon:t.portals.expanded},{name:"Initiators",isExpanded:!0,children:o,cdIcon:t.initiators.expanded},{name:"Groups",isExpanded:!0,children:s,cdIcon:t.groups.expanded}]}]}format(e){return"boolean"==typeof e?this.booleanTextPipe.transform(e):e}onNodeSelected(e,t){var a,i,o,s;if(n.a.ACTIVATE(e,t,!0),t.data.cdId){this.title=t.data.name;const e=this.metadata[t.data.cdId]||{};"root"===t.data.cdId?(null===(a=this.detailTable)||void 0===a||a.toggleColumn({prop:"default",isHidden:!0}),this.data=m.a.map(this.settings.target_default_controls,(t,a)=>({displayName:a,default:t=this.format(t),current:m.a.isUndefined(e[a])?t:this.format(e[a])})),this.cephIscsiConfigVersion>10&&["user","password","mutual_user","mutual_password"].forEach(t=>{this.data.push({displayName:t,default:null,current:e[t]})})):t.data.cdId.toString().startsWith("disk_")?(null===(i=this.detailTable)||void 0===i||i.toggleColumn({prop:"default",isHidden:!0}),this.data=m.a.map(this.settings.disk_default_controls[e.backstore],(t,a)=>({displayName:a,default:t=this.format(t),current:m.a.isUndefined(e.controls[a])?t:this.format(e.controls[a])})),this.data.push({displayName:"backstore",default:this.iscsiBackstorePipe.transform(this.settings.default_backstore),current:this.iscsiBackstorePipe.transform(e.backstore)}),["wwn","lun"].forEach(t=>{t in e&&this.data.push({displayName:t,default:void 0,current:e[t]})})):(null===(o=this.detailTable)||void 0===o||o.toggleColumn({prop:"default",isHidden:!1}),this.data=m.a.map(e,(e,t)=>({displayName:t,default:void 0,current:this.format(e)})))}else this.data=void 0;null===(s=this.detailTable)||void 0===s||s.updateColumns()}onUpdateData(){this.tree.treeModel.expandAll()}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(Y.a),S.Mb(Nt.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-details"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(It,!0),S.Tc($t,!0),S.Tc(Tt,!0)),2&e&&(S.zc(a=S.hc())&&(t.highlightTpl=a.first),S.zc(a=S.hc())&&(t.content=a.first),S.zc(a=S.hc())&&(t.tree=a.first))},inputs:{selection:"selection",settings:"settings",cephIscsiConfigVersion:"cephIscsiConfigVersion"},features:[S.wb],decls:11,vars:3,consts:function(){return[[1,"row"],[1,"col-6"],"iSCSI Topology",[3,"nodes","options","updateData"],["tree",""],["treeNodeTemplate",""],["class","col-6 metadata",4,"ngIf"],["highlightTpl",""],[1,"badge",3,"ngClass"],[1,"col-6","metadata"],["columnMode","flex",3,"data","columns","limit"],["detailTable",""],[4,"ngIf"]]},template:function(e,t){1&e&&(S.Sb(0,"div",0),S.Sb(1,"div",1),S.Sb(2,"legend"),S.Wb(3,2),S.Rb(),S.Sb(4,"tree-root",3,4),S.gc("updateData",(function(){return t.onUpdateData()})),S.Mc(6,Et,6,10,"ng-template",null,5,S.Nc),S.Rb(),S.Rb(),S.Mc(8,Ct,5,4,"div",6),S.Rb(),S.Mc(9,At,2,2,"ng-template",null,7,S.Nc)),2&e&&(S.yb(4),S.pc("nodes",t.nodes)("options",t.treeOptions),S.yb(4),S.pc("ngIf",t.data))},directives:[n.b,i.r,i.p,ot.a],styles:[""]}),e})();function Vt(e,t){if(1&e&&(S.Qb(0),S.Nb(1,"br"),S.Sb(2,"span"),S.Wb(3,7),S.Rb(),S.Sb(4,"pre"),S.Oc(5),S.Rb(),S.Pb()),2&e){const e=S.ic(2);S.yb(5),S.Pc(e.status)}}function Wt(e,t){if(1&e&&(S.Sb(0,"cd-alert-panel",2),S.Yb(1,3),S.Qb(2),S.cc(3,4),S.Nb(4,"cd-doc",5),S.Zb(),S.Pb(),S.Mc(5,Vt,6,1,"ng-container",6),S.Rb()),2&e){const e=S.ic();S.yb(5),S.pc("ngIf",e.status)}}function qt(e,t){if(1&e&&S.Nb(0,"cd-iscsi-target-details",16),2&e){const e=S.ic(2);S.pc("cephIscsiConfigVersion",e.cephIscsiConfigVersion)("selection",e.expandedRow)("settings",e.settings)}}const Bt=function(e){return[e]};function Gt(e,t){if(1&e){const e=S.Tb();S.Sb(0,"cd-table",8,9),S.gc("fetchData",(function(){return S.Dc(e),S.ic().getTargets()}))("setExpandedRow",(function(t){return S.Dc(e),S.ic().setExpandedRow(t)}))("updateSelection",(function(t){return S.Dc(e),S.ic().updateSelection(t)})),S.Sb(2,"div",10),S.Nb(3,"cd-table-actions",11),S.Sb(4,"button",12),S.gc("click",(function(){return S.Dc(e),S.ic().configureDiscoveryAuth()})),S.Nb(5,"i",13),S.Qb(6),S.Wb(7,14),S.Pb(),S.Rb(),S.Rb(),S.Mc(8,qt,1,3,"cd-iscsi-target-details",15),S.Rb()}if(2&e){const e=S.ic();S.pc("data",e.targets)("columns",e.columns)("hasDetails",!0)("autoReload",!1)("status",e.tableStatus),S.yb(3),S.pc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),S.yb(2),S.pc("ngClass",S.uc(10,Bt,e.icons.key)),S.yb(3),S.pc("ngIf",e.expandedRow)}}let Lt=(()=>{class e extends at.a{constructor(e,t,a,i,o,s,n,r,c){super(c),this.authStorageService=e,this.iscsiService=t,this.joinPipe=a,this.taskListService=i,this.notAvailablePipe=o,this.modalService=s,this.taskWrapper=n,this.actionLabels=r,this.ngZone=c,this.available=void 0,this.selection=new nt.a,this.targets=[],this.icons=N.a,this.builders={"iscsi/target/create":e=>({target_iqn:e.target_iqn})},this.permission=this.authStorageService.getPermissions().iscsi,this.tableActions=[{permission:"create",icon:N.a.add,routerLink:()=>"/block/iscsi/targets/create",name:this.actionLabels.CREATE},{permission:"update",icon:N.a.edit,routerLink:()=>"/block/iscsi/targets/edit/"+this.selection.first().target_iqn,name:this.actionLabels.EDIT,disable:()=>this.getEditDisableDesc()},{permission:"delete",icon:N.a.destroy,click:()=>this.deleteIscsiTargetModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Target",prop:"target_iqn",flexGrow:2,cellTransformation:st.a.executing},{name:"Portals",prop:"cdPortals",pipe:this.joinPipe,flexGrow:2},{name:"Images",prop:"cdImages",pipe:this.joinPipe,flexGrow:2},{name:"# Sessions",prop:"info.num_sessions",pipe:this.notAvailablePipe,flexGrow:1}],this.iscsiService.status().subscribe(e=>{this.available=e.available,e.available||(this.status=e.message)})}getTargets(){this.available&&(this.setTableRefreshTimeout(),this.iscsiService.version().subscribe(e=>{this.cephIscsiConfigVersion=e.ceph_iscsi_config_version}),this.taskListService.init(()=>this.iscsiService.listTargets(),e=>this.prepareResponse(e),e=>this.targets=e,()=>this.onFetchError(),this.taskFilter,this.itemFilter,this.builders),this.iscsiService.settings().subscribe(e=>{this.settings=e}))}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}getEditDisableDesc(){const e=this.selection.first();return e&&(null==e?void 0:e.cdExecuting)?e.cdExecuting:e&&m.a.isUndefined(null==e?void 0:e.info)?"Unavailable gateway(s)":!e}getDeleteDisableDesc(){var e;const t=this.selection.first();return(null==t?void 0:t.cdExecuting)?t.cdExecuting:t&&m.a.isUndefined(null==t?void 0:t.info)?"Unavailable gateway(s)":t&&(null===(e=null==t?void 0:t.info)||void 0===e?void 0:e.num_sessions)?"Target has active sessions":!t}prepareResponse(e){return e.forEach(e=>{e.cdPortals=e.portals.map(e=>`${e.host}:${e.ip}`),e.cdImages=e.disks.map(e=>`${e.pool}/${e.image}`)}),e}onFetchError(){this.table.reset()}itemFilter(e,t){return e.target_iqn===t.metadata.target_iqn}taskFilter(e){return["iscsi/target/create","iscsi/target/edit","iscsi/target/delete"].includes(e.name)}updateSelection(e){this.selection=e}deleteIscsiTargetModal(){const e=this.selection.first().target_iqn;this.modalRef=this.modalService.show(it.a,{itemDescription:"iSCSI target",itemNames:[e],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.a("iscsi/target/delete",{target_iqn:e}),call:this.iscsiService.deleteTarget(e)})})}configureDiscoveryAuth(){this.modalService.show(Rt)}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(v),S.Mb(rt.a),S.Mb(bt.a),S.Mb(ct.a),S.Mb(P.a),S.Mb(z.a),S.Mb(l.b),S.Mb(S.A))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi-target-list"]],viewQuery:function(e,t){var a;1&e&&S.Tc(ot.a,!0),2&e&&S.zc(a=S.hc())&&(t.table=a.first)},features:[S.xb([bt.a]),S.vb],decls:3,vars:2,consts:function(){return[["type","info",4,"ngIf",6,"title"],["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection",4,"ngIf"],["type","info",6,"title"],["title","iSCSI Targets not available"],"Please consult the " + "\ufffd#4\ufffd" + "" + "\ufffd/#4\ufffd" + " on how to configure and enable the iSCSI Targets management functionality.",["section","iscsi"],[4,"ngIf"],"Available information:",["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],"Discovery authentication",["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings",4,"ngIf"],["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings"]]},template:function(e,t){1&e&&(S.Nb(0,"cd-iscsi-tabs"),S.Mc(1,Wt,6,1,"cd-alert-panel",0),S.Mc(2,Gt,9,12,"cd-table",1)),2&e&&(S.yb(1),S.pc("ngIf",!1===t.available),S.yb(1),S.pc("ngIf",!0===t.available))},directives:[wt,i.r,_t.a,kt.a,ot.a,Mt.a,O.a,i.p,xt],styles:[""]}),e})();var jt=a("o4+5"),Qt=a("dgut"),Ut=a("Dwqy");const Yt=["iscsiSparklineTpl"],Kt=["iscsiPerSecondTpl"],Jt=["iscsiRelativeDateTpl"];function Xt(e,t){if(1&e&&(S.Sb(0,"span"),S.Nb(1,"cd-sparkline",9),S.Rb()),2&e){const e=S.ic(),t=e.value,a=e.row;S.yb(1),S.pc("data",t)("isBinary",a.cdIsBinary)}}function Ht(e,t){1&e&&(S.Sb(0,"span",10),S.Oc(1," n/a "),S.Rb())}function Zt(e,t){if(1&e&&(S.Mc(0,Xt,2,2,"span",7),S.Mc(1,Ht,2,0,"span",8)),2&e){const e=t.row;S.pc("ngIf","user:rbd"===e.backstore),S.yb(1),S.pc("ngIf","user:rbd"!==e.backstore)}}function ea(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Rb()),2&e){const e=S.ic().value;S.yb(1),S.Qc(" ",e," /s ")}}function ta(e,t){1&e&&(S.Sb(0,"span",10),S.Oc(1," n/a "),S.Rb())}function aa(e,t){if(1&e&&(S.Mc(0,ea,2,1,"span",7),S.Mc(1,ta,2,0,"span",8)),2&e){const e=t.row;S.pc("ngIf","user:rbd"===e.backstore),S.yb(1),S.pc("ngIf","user:rbd"!==e.backstore)}}function ia(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.jc(2,"notAvailable"),S.jc(3,"relativeDate"),S.Rb()),2&e){const e=S.ic().value;S.yb(1),S.Qc(" ",S.kc(2,1,S.kc(3,3,e))," ")}}function oa(e,t){1&e&&(S.Sb(0,"span",10),S.Oc(1," n/a "),S.Rb())}function sa(e,t){if(1&e&&(S.Mc(0,ia,4,5,"span",7),S.Mc(1,oa,2,0,"span",8)),2&e){const e=t.row;S.pc("ngIf","user:rbd"===e.backstore),S.yb(1),S.pc("ngIf","user:rbd"!==e.backstore)}}let na=(()=>{class e{constructor(e,t,a){this.iscsiService=e,this.dimlessPipe=t,this.iscsiBackstorePipe=a,this.gateways=[],this.images=[]}ngOnInit(){this.gatewaysColumns=[{name:"Name",prop:"name"},{name:"State",prop:"state",flexGrow:1,cellTransformation:st.a.badge,customTemplateConfig:{map:{up:{class:"badge-success"},down:{class:"badge-danger"}}}},{name:"# Targets",prop:"num_targets"},{name:"# Sessions",prop:"num_sessions"}],this.imagesColumns=[{name:"Pool",prop:"pool"},{name:"Image",prop:"image"},{name:"Backstore",prop:"backstore",pipe:this.iscsiBackstorePipe},{name:"Read Bytes",prop:"stats_history.rd_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Write Bytes",prop:"stats_history.wr_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Read Ops",prop:"stats.rd",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"Write Ops",prop:"stats.wr",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"A/O Since",prop:"optimized_since",cellTemplate:this.iscsiRelativeDateTpl}]}refresh(){this.iscsiService.overview().subscribe(e=>{this.gateways=e.gateways,this.images=e.images,this.images.map(e=>(e.stats_history&&(e.stats_history.rd_bytes=e.stats_history.rd_bytes.map(e=>e[1]),e.stats_history.wr_bytes=e.stats_history.wr_bytes.map(e=>e[1])),e.cdIsBinary=!0,e))})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(v),S.Mb(jt.a),S.Mb(Y.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-iscsi"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(Yt,!0),S.Jc(Kt,!0),S.Jc(Jt,!0)),2&e&&(S.zc(a=S.hc())&&(t.iscsiSparklineTpl=a.first),S.zc(a=S.hc())&&(t.iscsiPerSecondTpl=a.first),S.zc(a=S.hc())&&(t.iscsiRelativeDateTpl=a.first))},decls:13,vars:4,consts:function(){return["Gateways",[3,"data","columns","fetchData"],"Images",[3,"data","columns"],["iscsiSparklineTpl",""],["iscsiPerSecondTpl",""],["iscsiRelativeDateTpl",""],[4,"ngIf"],["class","text-muted",4,"ngIf"],[3,"data","isBinary"],[1,"text-muted"]]},template:function(e,t){1&e&&(S.Nb(0,"cd-iscsi-tabs"),S.Sb(1,"legend"),S.Wb(2,0),S.Rb(),S.Sb(3,"cd-table",1),S.gc("fetchData",(function(){return t.refresh()})),S.Rb(),S.Sb(4,"legend"),S.Wb(5,2),S.Rb(),S.Nb(6,"cd-table",3),S.Mc(7,Zt,2,2,"ng-template",null,4,S.Nc),S.Mc(9,aa,2,2,"ng-template",null,5,S.Nc),S.Mc(11,sa,2,2,"ng-template",null,6,S.Nc)),2&e&&(S.yb(3),S.pc("data",t.gateways)("columns",t.gatewaysColumns),S.yb(3),S.pc("data",t.images)("columns",t.imagesColumns))},directives:[wt,ot.a,i.r,Qt.a],pipes:[ct.a,Ut.a],styles:[""]}),e})(),ra=(()=>{class e{}return e.\u0275mod=S.Kb({type:e}),e.\u0275inj=S.Jb({factory:function(t){return new(t||e)},imports:[[i.c,d.a,r.t,s.i,o.m,o.x,r.A]]}),e})();var ca=a("quSY"),la=a("2Vo4"),ba=a("pLZG"),da=a("lOp/");let pa=(()=>{let e=class{constructor(e,t){this.http=e,this.timerService=t,this.REFRESH_INTERVAL=3e4,this.summaryDataSource=new la.a(null),this.summaryData$=this.summaryDataSource.asObservable()}startPolling(){return this.timerService.get(()=>this.retrieveSummaryObservable(),this.REFRESH_INTERVAL).subscribe(this.retrieveSummaryObserver())}refresh(){return this.retrieveSummaryObservable().subscribe(this.retrieveSummaryObserver())}retrieveSummaryObservable(){return this.http.get("api/block/mirroring/summary")}retrieveSummaryObserver(){return e=>{this.summaryDataSource.next(e)}}subscribeSummary(e,t){return this.summaryData$.pipe(Object(ba.a)(e=>!!e)).subscribe(e,t)}getPool(e){return this.http.get("api/block/mirroring/pool/"+e)}updatePool(e,t){return this.http.put("api/block/mirroring/pool/"+e,t,{observe:"response"})}getSiteName(){return this.http.get("api/block/mirroring/site_name")}setSiteName(e){return this.http.put("api/block/mirroring/site_name",{site_name:e},{observe:"response"})}createBootstrapToken(e){return this.http.post(`api/block/mirroring/pool/${e}/bootstrap/token`,{})}importBootstrapToken(e,t,a){return this.http.post(`api/block/mirroring/pool/${e}/bootstrap/peer`,{direction:t,token:a},{observe:"response"})}getPeer(e,t){return this.http.get(`api/block/mirroring/pool/${e}/peer/${t}`)}addPeer(e,t){return this.http.post(`api/block/mirroring/pool/${e}/peer`,t,{observe:"response"})}updatePeer(e,t,a){return this.http.put(`api/block/mirroring/pool/${e}/peer/${t}`,a,{observe:"response"})}deletePeer(e,t){return this.http.delete(`api/block/mirroring/pool/${e}/peer/${t}`,{observe:"response"})}};return e.\u0275fac=function(t){return new(t||e)(S.dc(h.b),S.dc(da.a))},e.\u0275prov=S.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),Object(f.b)([Object(f.e)(0,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[String]),Object(f.d)("design:returntype",void 0)],e.prototype,"setSiteName",null),Object(f.b)([Object(f.e)(1,g.b),Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[String,String,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"importBootstrapToken",null),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b,da.a])],e),e})();var ma=a("GyhO"),ua=a("vkgz"),fa=a("NJ9Y"),ha=a("IZUe"),ga=a("sb0X"),Sa=a("Z21x");function va(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,29),S.Rb())}function ya(e,t){if(1&e&&(S.Sb(0,"div",30),S.Nb(1,"input",31),S.Sb(2,"label",32),S.Oc(3),S.Rb(),S.Rb()),2&e){const e=t.$implicit;S.yb(1),S.qc("id",e.name),S.qc("name",e.name),S.qc("formControlName",e.name),S.yb(1),S.qc("for",e.name),S.yb(1),S.Pc(e.name)}}function Ra(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,33),S.Rb())}let wa=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.rbdMirroringService=t,this.taskWrapper=a,this.pools=[],this.createForm()}createForm(){this.createBootstrapForm=new $.a({siteName:new o.h("",{validators:[o.A.required]}),pools:new o.j({},{validators:[this.validatePools()]}),token:new o.h("",{})})}ngOnInit(){this.createBootstrapForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(e=>{this.createBootstrapForm.get("siteName").setValue(e.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.pools=e.content_data.pools.reduce((e,t)=>(e.push({name:t.name,mirror_mode:t.mirror_mode}),e),[]);const t=this.createBootstrapForm.get("pools");m.a.each(this.pools,e=>{const a=e.name,i="disabled"===e.mirror_mode,s=t.controls[a];s?i&&s.disabled?s.enable():!i&&s.enabled&&(s.disable(),s.setValue(!0)):t.addControl(a,new o.h({value:!i,disabled:!i}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return e=>{let t=0;return m.a.each(e.controls,e=>{!0===e.value&&++t}),t>0?null:{requirePool:!0}}}generate(){this.createBootstrapForm.get("token").setValue("");let e="";const t=[],a=this.createBootstrapForm.get("pools");m.a.each(a.controls,(a,i)=>{!0===a.value&&(e=i,a.disabled||t.push(i))});const i={mirror_mode:"image"},o=Object(ma.a)(this.rbdMirroringService.setSiteName(this.createBootstrapForm.getValue("siteName")),Object(u.a)(t.map(e=>this.rbdMirroringService.updatePool(e,i))),this.rbdMirroringService.createBootstrapToken(e).pipe(Object(ua.a)(e=>this.createBootstrapForm.get("token").setValue(e.token)))).pipe(Object(fa.a)()),s=()=>{this.rbdMirroringService.refresh(),this.createBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/mirroring/bootstrap/create",{}),call:o}).subscribe({error:s,complete:s})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(pa),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-bootstrap-create-modal"]],decls:35,vars:6,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Create Bootstrap Token",[1,"modal-content"],["name","createBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],"To create a bootstrap token which can be imported by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, and click\xA0 " + "\ufffd#10\ufffd" + "Generate" + "\ufffd/#10\ufffd" + ".",[1,"form-group"],["for","siteName",1,"col-form-label","required"],"Site Name",["type","text","id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],"Pools",["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"mb-4","float-right",3,"form","submitAction"],"Generate",["for","token",1,"col-form-label"],"Token",["id","token","formControlName","token","readonly","",1,"form-control","resize-vertical",6,"placeholder"],["placeholder","Generated token..."],["source","token",1,"float-right"],[1,"modal-footer"],[3,"backAction",6,"name"],["name","Close"],[1,"invalid-feedback"],"This field is required.",[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],"At least one pool is required."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.Qb(8),S.cc(9,7),S.Nb(10,"kbd"),S.Zb(),S.Pb(),S.Rb(),S.Sb(11,"div",8),S.Sb(12,"label",9),S.Wb(13,10),S.Rb(),S.Sb(14,"input",11),S.Yb(15,12),S.Rb(),S.Mc(16,va,2,0,"span",13),S.Rb(),S.Sb(17,"div",14),S.Sb(18,"label",15),S.Wb(19,16),S.Rb(),S.Mc(20,ya,4,5,"div",17),S.Mc(21,Ra,2,0,"span",13),S.Rb(),S.Sb(22,"cd-submit-button",18),S.gc("submitAction",(function(){return t.generate()})),S.Wb(23,19),S.Rb(),S.Sb(24,"div",8),S.Sb(25,"label",20),S.Sb(26,"span"),S.Wb(27,21),S.Rb(),S.Rb(),S.Sb(28,"textarea",22),S.Yb(29,23),S.Oc(30,"          "),S.Rb(),S.Rb(),S.Nb(31,"cd-copy-2-clipboard-button",24),S.Rb(),S.Sb(32,"div",25),S.Sb(33,"cd-back-button",26),S.Yb(34,27),S.gc("backAction",(function(){return t.activeModal.close()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.createBootstrapForm),S.yb(12),S.pc("ngIf",t.createBootstrapForm.showError("siteName",e,"required")),S.yb(4),S.pc("ngForOf",t.pools),S.yb(1),S.pc("ngIf",t.createBootstrapForm.showError("pools",e,"requirePool")),S.yb(1),S.pc("form",t.createBootstrapForm)}},directives:[E.a,o.C,o.r,C.a,o.k,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.r,o.l,i.q,ga.a,ce.a,Sa.a,o.b],styles:[".form-group.ng-invalid[_ngcontent-%COMP%]   .invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),e})();function _a(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,29),S.Rb())}function ka(e,t){if(1&e&&(S.Sb(0,"option",30),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e.key),S.yb(1),S.Pc(e.desc)}}function Ma(e,t){if(1&e&&(S.Sb(0,"div",31),S.Nb(1,"input",32),S.Sb(2,"label",33),S.Oc(3),S.Rb(),S.Rb()),2&e){const e=t.$implicit;S.yb(1),S.qc("id",e.name),S.qc("name",e.name),S.qc("formControlName",e.name),S.yb(1),S.qc("for",e.name),S.yb(1),S.Pc(e.name)}}function Na(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,34),S.Rb())}function Ia(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,35),S.Rb())}function $a(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,36),S.Rb())}let Ta=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.pools=[],this.directions=[{key:"rx-tx",desc:"Bidirectional"},{key:"rx",desc:"Unidirectional (receive-only)"}],this.createForm()}createForm(){this.importBootstrapForm=new $.a({siteName:new o.h("",{validators:[o.A.required]}),direction:new o.h("rx-tx",{}),pools:new o.j({},{validators:[this.validatePools()]}),token:new o.h("",{validators:[o.A.required,this.validateToken()]})})}ngOnInit(){this.rbdMirroringService.getSiteName().subscribe(e=>{this.importBootstrapForm.get("siteName").setValue(e.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.pools=e.content_data.pools.reduce((e,t)=>(e.push({name:t.name,mirror_mode:t.mirror_mode}),e),[]);const t=this.importBootstrapForm.get("pools");m.a.each(this.pools,e=>{const a=e.name,i="disabled"===e.mirror_mode,s=t.controls[a];s?i&&s.disabled?s.enable():!i&&s.enabled&&(s.disable(),s.setValue(!0)):t.addControl(a,new o.h({value:!i,disabled:!i}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return e=>{let t=0;return m.a.each(e.controls,e=>{!0===e.value&&++t}),t>0?null:{requirePool:!0}}}validateToken(){return e=>{try{if(JSON.parse(atob(e.value)))return null}catch(t){}return{invalidToken:!0}}}import(){const e=[],t=[],a=this.importBootstrapForm.get("pools");m.a.each(a.controls,(a,i)=>{!0===a.value&&(e.push(i),a.disabled||t.push(i))});const i={mirror_mode:"image"};let o=Object(ma.a)(this.rbdMirroringService.setSiteName(this.importBootstrapForm.getValue("siteName")),Object(u.a)(t.map(e=>this.rbdMirroringService.updatePool(e,i))));o=e.reduce((e,t)=>Object(ma.a)(e,this.rbdMirroringService.importBootstrapToken(t,this.importBootstrapForm.getValue("direction"),this.importBootstrapForm.getValue("token"))),o).pipe(Object(fa.a)());const s=()=>{this.rbdMirroringService.refresh(),this.importBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/mirroring/bootstrap/import",{}),call:o}).subscribe({error:s,complete:()=>{s(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(l.b),S.Mb(pa),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-bootstrap-import-modal"]],decls:38,vars:10,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Import Bootstrap Token",[1,"modal-content"],["name","importBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],"To import a bootstrap token which was created by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, provide the generated token, and click\xA0" + "\ufffd#10\ufffd" + "Import" + "\ufffd/#10\ufffd" + ".",[1,"form-group"],["for","siteName",1,"col-form-label","required"],"Site Name",["type","text","id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","direction",1,"col-form-label"],"Direction",["id","direction","name","direction","formControlName","direction",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],"Pools",["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["for","token",1,"col-form-label","required"],"Token",["id","token","formControlName","token",1,"form-control","resize-vertical",6,"placeholder"],["placeholder","Generated token..."],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.",[3,"value"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],"At least one pool is required.","This field is required.","The token is invalid."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.Qb(8),S.cc(9,7),S.Nb(10,"kbd"),S.Zb(),S.Pb(),S.Rb(),S.Sb(11,"div",8),S.Sb(12,"label",9),S.Wb(13,10),S.Rb(),S.Sb(14,"input",11),S.Yb(15,12),S.Rb(),S.Mc(16,_a,2,0,"span",13),S.Rb(),S.Sb(17,"div",8),S.Sb(18,"label",14),S.Sb(19,"span"),S.Wb(20,15),S.Rb(),S.Rb(),S.Sb(21,"select",16),S.Mc(22,ka,2,2,"option",17),S.Rb(),S.Rb(),S.Sb(23,"div",18),S.Sb(24,"label",19),S.Wb(25,20),S.Rb(),S.Mc(26,Ma,4,5,"div",21),S.Mc(27,Na,2,0,"span",13),S.Rb(),S.Sb(28,"div",8),S.Sb(29,"label",22),S.Wb(30,23),S.Rb(),S.Sb(31,"textarea",24),S.Yb(32,25),S.Oc(33,"          "),S.Rb(),S.Mc(34,Ia,2,0,"span",13),S.Mc(35,$a,2,0,"span",13),S.Rb(),S.Rb(),S.Sb(36,"div",26),S.Sb(37,"cd-form-button-panel",27),S.gc("submitActionEvent",(function(){return t.import()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.importBootstrapForm),S.yb(12),S.pc("ngIf",t.importBootstrapForm.showError("siteName",e,"required")),S.yb(6),S.pc("ngForOf",t.directions),S.yb(4),S.pc("ngForOf",t.pools),S.yb(1),S.pc("ngIf",t.importBootstrapForm.showError("pools",e,"requirePool")),S.yb(7),S.pc("ngIf",t.importBootstrapForm.showError("token",e,"required")),S.yb(1),S.pc("ngIf",t.importBootstrapForm.showError("token",e,"invalidToken")),S.yb(2),S.pc("form",t.importBootstrapForm)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.C,o.r,C.a,o.k,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.r,o.z,i.q,o.l,x.a,o.u,o.B,o.b],styles:[""]}),e})(),Fa=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.createForm()}createForm(){this.editSiteNameForm=new $.a({siteName:new o.h("",{})})}ngOnInit(){this.editSiteNameForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(e=>{this.editSiteNameForm.get("siteName").setValue(e.site_name)})}update(){this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/mirroring/site_name/edit",{}),call:this.rbdMirroringService.setSiteName(this.editSiteNameForm.getValue("siteName"))}).subscribe({error:()=>this.editSiteNameForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(l.b),S.Mb(pa),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-edit-site-mode-modal"]],decls:18,vars:4,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Edit site name",[1,"modal-content"],["name","editSiteNameForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],"Edit the site name and click\xA0 " + "\ufffd#10\ufffd" + "Update" + "\ufffd/#10\ufffd" + ".",[1,"form-group"],["for","siteName",1,"col-form-label","required"],"Site Name",["type","text","id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.Qb(8),S.cc(9,7),S.Nb(10,"kbd"),S.Zb(),S.Pb(),S.Rb(),S.Sb(11,"div",8),S.Sb(12,"label",9),S.Wb(13,10),S.Rb(),S.Sb(14,"input",11),S.Yb(15,12),S.Rb(),S.Rb(),S.Rb(),S.Sb(16,"div",13),S.Sb(17,"cd-form-button-panel",14),S.gc("submitActionEvent",(function(){return t.update()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e&&(S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.editSiteNameForm),S.yb(13),S.pc("form",t.editSiteNameForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.C,o.r,C.a,o.k,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,x.a],styles:[""]}),e})();var Pa=a("VxPD"),za=a("85J/");let Ea=(()=>{class e{transform(e){return"warning"===e?"badge badge-warning":"error"===e?"badge badge-danger":"success"===e?"badge badge-success":"badge badge-info"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=S.Lb({name:"mirrorHealthColor",type:e,pure:!0}),e})();const Ca=["healthTmpl"];function Da(e,t){if(1&e&&(S.Sb(0,"span",2),S.jc(1,"mirrorHealthColor"),S.Oc(2),S.Rb()),2&e){const e=t.value;S.pc("ngClass",S.kc(1,2,t.row.health_color)),S.yb(2),S.Pc(e)}}let Oa=(()=>{class e{constructor(e,t){this.rbdMirroringService=e,this.cephShortVersionPipe=t,this.tableStatus=new Pa.a}ngOnInit(){this.columns=[{prop:"instance_id",name:"Instance",flexGrow:2},{prop:"id",name:"ID",flexGrow:2},{prop:"server_hostname",name:"Hostname",flexGrow:2},{prop:"version",name:"Version",pipe:this.cephShortVersionPipe,flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.data=e.content_data.daemons,this.tableStatus=new Pa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(pa),S.Mb(za.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-mirroring-daemons"]],viewQuery:function(e,t){var a;1&e&&S.Jc(Ca,!0),2&e&&S.zc(a=S.hc())&&(t.healthTmpl=a.first)},decls:3,vars:4,consts:[["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],["healthTmpl",""],[3,"ngClass"]],template:function(e,t){1&e&&(S.Sb(0,"cd-table",0),S.gc("fetchData",(function(){return t.refresh()})),S.Rb(),S.Mc(1,Da,3,4,"ng-template",null,1,S.Nc)),2&e&&S.pc("data",t.data)("columns",t.columns)("autoReload",-1)("status",t.tableStatus)},directives:[ot.a,i.p],pipes:[Ea],styles:[""]}),e})();var Aa=a("HDdC");class xa{}function Va(e,t){if(1&e&&(S.Sb(0,"option",16),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e.id),S.yb(1),S.Pc(e.name)}}function Wa(e,t){1&e&&(S.Sb(0,"span",17),S.Wb(1,18),S.Rb())}let qa=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.bsConfig={containerClass:"theme-default"},this.peerExists=!1,this.mirrorModes=[{id:"disabled",name:"Disabled"},{id:"pool",name:"Pool"},{id:"image",name:"Image"}],this.createForm()}createForm(){this.editModeForm=new $.a({mirrorMode:new o.h("",{validators:[o.A.required,this.validateMode.bind(this)]})})}ngOnInit(){this.pattern=""+this.poolName,this.rbdMirroringService.getPool(this.poolName).subscribe(e=>{this.setResponse(e)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.peerExists=!1;const t=e.content_data.pools.find(e=>this.poolName===e.name);this.peerExists=t&&t.peer_uuids.length})}ngOnDestroy(){this.subs.unsubscribe()}validateMode(e){return"disabled"===e.value&&this.peerExists?{cannotDisable:{value:e.value}}:null}setResponse(e){this.editModeForm.get("mirrorMode").setValue(e.mirror_mode)}update(){const e=new xa;e.mirror_mode=this.editModeForm.getValue("mirrorMode"),this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/mirroring/pool/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePool(this.poolName,e)}).subscribe({error:()=>this.editModeForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(l.b),S.Mb(pa),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-pool-edit-mode-modal"]],decls:21,vars:7,consts:function(){var e,t;return e="Edit pool mirror mode",t="To edit the mirror mode for pool\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ", select a new mode from the list and click\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Update" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","editModeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t=S.bc(t),[1,"form-group"],["for","mirrorMode",1,"col-form-label"],"Mode",["id","mirrorMode","name","mirrorMode","formControlName","mirrorMode",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],"Peer clusters must be removed prior to disabling mirror."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.Qb(8),S.cc(9,7),S.Nb(10,"kbd"),S.Nb(11,"kbd"),S.Zb(),S.Pb(),S.Rb(),S.Sb(12,"div",8),S.Sb(13,"label",9),S.Sb(14,"span"),S.Wb(15,10),S.Rb(),S.Rb(),S.Sb(16,"select",11),S.Mc(17,Va,2,2,"option",12),S.Rb(),S.Mc(18,Wa,2,0,"span",13),S.Rb(),S.Rb(),S.Sb(19,"div",14),S.Sb(20,"cd-form-button-panel",15),S.gc("submitActionEvent",(function(){return t.update()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.editModeForm),S.yb(7),S.ac(t.poolName),S.Xb(9),S.yb(6),S.pc("ngForOf",t.mirrorModes),S.yb(1),S.pc("ngIf",t.editModeForm.showError("mirrorMode",e,"cannotDisable")),S.yb(2),S.pc("form",t.editModeForm)("submitText",t.actionLabels.UPDATE)}},directives:[E.a,o.C,o.r,C.a,o.k,D.a,O.a,o.z,A.a,o.q,o.i,i.q,i.r,x.a,o.u,o.B],styles:[""]}),e})();class Ba{}function Ga(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,29),S.Rb())}function La(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,30),S.Rb())}function ja(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,31),S.Rb())}function Qa(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,32),S.Rb())}function Ua(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,33),S.Rb())}function Ya(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,34),S.Rb())}let Ka=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.bsConfig={containerClass:"theme-default"},this.createForm()}createForm(){this.editPeerForm=new $.a({clusterName:new o.h("",{validators:[o.A.required,this.validateClusterName]}),clientID:new o.h("",{validators:[o.A.required,this.validateClientID]}),monAddr:new o.h("",{validators:[this.validateMonAddr]}),key:new o.h("",{validators:[this.validateKey]})})}ngOnInit(){this.pattern=`${this.poolName}/${this.peerUUID}`,"edit"===this.mode&&this.rbdMirroringService.getPeer(this.poolName,this.peerUUID).subscribe(e=>{this.setResponse(e)})}validateClusterName(e){if(!e.value.match(/^[\w\-_]*$/))return{invalidClusterName:{value:e.value}}}validateClientID(e){if(!e.value.match(/^(?!client\.)[\w\-_.]*$/))return{invalidClientID:{value:e.value}}}validateMonAddr(e){if(!e.value.match(/^[,; ]*([\w.\-_\[\]]+(:[\d]+)?[,; ]*)*$/))return{invalidMonAddr:{value:e.value}}}validateKey(e){try{if(""===e.value||atob(e.value))return null}catch(t){}return{invalidKey:{value:e.value}}}setResponse(e){this.response=e,this.editPeerForm.get("clusterName").setValue(e.cluster_name),this.editPeerForm.get("clientID").setValue(e.client_id),this.editPeerForm.get("monAddr").setValue(e.mon_host),this.editPeerForm.get("key").setValue(e.key)}update(){const e=new Ba;let t;e.cluster_name=this.editPeerForm.getValue("clusterName"),e.client_id=this.editPeerForm.getValue("clientID"),e.mon_host=this.editPeerForm.getValue("monAddr"),e.key=this.editPeerForm.getValue("key"),t=this.taskWrapper.wrapTaskAroundCall("edit"===this.mode?{task:new F.a("rbd/mirroring/peer/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePeer(this.poolName,this.peerUUID,e)}:{task:new F.a("rbd/mirroring/peer/add",{pool_name:this.poolName}),call:this.rbdMirroringService.addPeer(this.poolName,e)}),t.subscribe({error:()=>this.editPeerForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(l.b),S.Mb(pa),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-pool-edit-peer-modal"]],decls:42,vars:13,consts:function(){var e,t,a,i;return e="{VAR_SELECT, select, edit {Edit} other {Add}}",e=S.bc(e,{VAR_SELECT:"\ufffd0\ufffd"}),t="" + e + " pool mirror peer",a="{VAR_SELECT, select, edit {Edit} other {Add}}",a=S.bc(a,{VAR_SELECT:"\ufffd0\ufffd"}),i="" + a + " the pool mirror peer attributes for pool " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " and click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Submit" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["name","editPeerForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],i=S.bc(i),[1,"form-group"],["for","clusterName",1,"col-form-label","required"],"Cluster Name",["type","text","id","clusterName","name","clusterName","formControlName","clusterName","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","clientID",1,"col-form-label","required"],"CephX ID",["type","text","id","clientID","name","clientID","formControlName","clientID",1,"form-control",6,"placeholder"],["placeholder","CephX ID..."],["for","monAddr",1,"col-form-label"],"Monitor Addresses",["type","text","id","monAddr","name","monAddr","formControlName","monAddr",1,"form-control",6,"placeholder"],["placeholder","Comma-delimited addresses..."],["for","key",1,"col-form-label"],"CephX Key",["type","text","id","key","name","key","formControlName","key",1,"form-control",6,"placeholder"],["placeholder","Base64-encoded key..."],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The cluster name is not valid.","This field is required.","The CephX ID is not valid.","The monitory address is not valid.","CephX key must be base64 encoded."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Sb(1,"span",1),S.Wb(2,2),S.Rb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.Sb(8,"span"),S.cc(9,7),S.Nb(10,"kbd"),S.Nb(11,"kbd"),S.Zb(),S.Rb(),S.Rb(),S.Sb(12,"div",8),S.Sb(13,"label",9),S.Wb(14,10),S.Rb(),S.Sb(15,"input",11),S.Yb(16,12),S.Rb(),S.Mc(17,Ga,2,0,"span",13),S.Mc(18,La,2,0,"span",13),S.Rb(),S.Sb(19,"div",8),S.Sb(20,"label",14),S.Wb(21,15),S.Rb(),S.Sb(22,"input",16),S.Yb(23,17),S.Rb(),S.Mc(24,ja,2,0,"span",13),S.Mc(25,Qa,2,0,"span",13),S.Rb(),S.Sb(26,"div",8),S.Sb(27,"label",18),S.Sb(28,"span"),S.Wb(29,19),S.Rb(),S.Rb(),S.Sb(30,"input",20),S.Yb(31,21),S.Rb(),S.Mc(32,Ua,2,0,"span",13),S.Rb(),S.Sb(33,"div",8),S.Sb(34,"label",22),S.Sb(35,"span"),S.Wb(36,23),S.Rb(),S.Rb(),S.Sb(37,"input",24),S.Yb(38,25),S.Rb(),S.Mc(39,Ya,2,0,"span",13),S.Rb(),S.Rb(),S.Sb(40,"div",26),S.Sb(41,"cd-form-button-panel",27),S.gc("submitActionEvent",(function(){return t.update()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(2),S.ac(t.mode),S.Xb(2),S.yb(2),S.pc("formGroup",t.editPeerForm),S.yb(7),S.ac(t.mode)(t.poolName),S.Xb(9),S.yb(6),S.pc("ngIf",t.editPeerForm.showError("clusterName",e,"required")),S.yb(1),S.pc("ngIf",t.editPeerForm.showError("clusterName",e,"invalidClusterName")),S.yb(6),S.pc("ngIf",t.editPeerForm.showError("clientID",e,"required")),S.yb(1),S.pc("ngIf",t.editPeerForm.showError("clientID",e,"invalidClientID")),S.yb(7),S.pc("ngIf",t.editPeerForm.showError("monAddr",e,"invalidMonAddr")),S.yb(7),S.pc("ngIf",t.editPeerForm.showError("key",e,"invalidKey")),S.yb(2),S.pc("form",t.editPeerForm)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.C,o.r,C.a,o.k,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.r,x.a],styles:[""]}),e})();const Ja=["healthTmpl"];function Xa(e,t){if(1&e&&(S.Sb(0,"span",3),S.jc(1,"mirrorHealthColor"),S.Oc(2),S.Rb()),2&e){const e=t.value;S.pc("ngClass",S.kc(1,2,t.row.health_color)),S.yb(2),S.Pc(e)}}let Ha=(()=>{class e{constructor(e,t,a,i){this.authStorageService=e,this.rbdMirroringService=t,this.modalService=a,this.taskWrapper=i,this.selection=new nt.a,this.tableStatus=new Pa.a,this.data=[],this.permission=this.authStorageService.getPermissions().rbdMirroring;const o={permission:"update",icon:N.a.edit,click:()=>this.editModeModal(),name:"Edit Mode",canBePrimary:()=>!0},s={permission:"create",icon:N.a.add,name:"Add Peer",click:()=>this.editPeersModal("add"),disable:()=>!this.selection.first()||"disabled"===this.selection.first().mirror_mode,visible:()=>!this.getPeerUUID(),canBePrimary:()=>!1},n={permission:"update",icon:N.a.exchange,name:"Edit Peer",click:()=>this.editPeersModal("edit"),visible:()=>!!this.getPeerUUID()},r={permission:"delete",icon:N.a.destroy,name:"Delete Peer",click:()=>this.deletePeersModal(),visible:()=>!!this.getPeerUUID()};this.tableActions=[o,s,n,r]}ngOnInit(){this.columns=[{prop:"name",name:"Name",flexGrow:2},{prop:"mirror_mode",name:"Mode",flexGrow:2},{prop:"leader_id",name:"Leader",flexGrow:2},{prop:"image_local_count",name:"# Local",flexGrow:2},{prop:"image_remote_count",name:"# Remote",flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.data=e.content_data.pools,this.tableStatus=new Pa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}editModeModal(){const e={poolName:this.selection.first().name};this.modalRef=this.modalService.show(qa,e)}editPeersModal(e){const t={poolName:this.selection.first().name,mode:e};"edit"===e&&(t.peerUUID=this.getPeerUUID()),this.modalRef=this.modalService.show(Ka,t)}deletePeersModal(){const e=this.selection.first().name,t=this.getPeerUUID();this.modalRef=this.modalService.show(it.a,{itemDescription:"mirror peer",itemNames:[`${e} (${t})`],submitActionObservable:()=>new Aa.a(a=>{this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/mirroring/peer/delete",{pool_name:e}),call:this.rbdMirroringService.deletePeer(e,t)}).subscribe({error:e=>a.error(e),complete:()=>{this.rbdMirroringService.refresh(),a.complete()}})})})}getPeerUUID(){const e=this.selection.first(),t=this.data.find(t=>e&&e.name===t.name);if(t&&t.peer_uuids)return t.peer_uuids[0]}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(pa),S.Mb(P.a),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-mirroring-pools"]],viewQuery:function(e,t){var a;1&e&&S.Jc(Ja,!0),2&e&&S.zc(a=S.hc())&&(t.healthTmpl=a.first)},decls:4,vars:7,consts:[["columnMode","flex","identifier","name","forceIdentifier","true","selectionType","single",3,"data","columns","autoReload","status","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["healthTmpl",""],[3,"ngClass"]],template:function(e,t){1&e&&(S.Sb(0,"cd-table",0),S.gc("fetchData",(function(){return t.refresh()}))("updateSelection",(function(e){return t.updateSelection(e)})),S.Nb(1,"cd-table-actions",1),S.Rb(),S.Mc(2,Xa,3,4,"ng-template",null,2,S.Nc)),2&e&&(S.pc("data",t.data)("columns",t.columns)("autoReload",-1)("status",t.tableStatus),S.yb(1),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ot.a,Mt.a,i.p],pipes:[Ea],styles:[""]}),e})();var Za=a("JP8w");const ei=["stateTmpl"],ti=["syncTmpl"],ai=["progressTmpl"];function ii(e,t){if(1&e){const e=S.Tb();S.Sb(0,"cd-table",14),S.gc("fetchData",(function(){return S.Dc(e),S.ic().refresh()})),S.Rb()}if(2&e){const e=S.ic();S.pc("data",e.image_error.data)("columns",e.image_error.columns)("autoReload",-1)("status",e.tableStatus)}}function oi(e,t){if(1&e){const e=S.Tb();S.Sb(0,"cd-table",14),S.gc("fetchData",(function(){return S.Dc(e),S.ic().refresh()})),S.Rb()}if(2&e){const e=S.ic();S.pc("data",e.image_syncing.data)("columns",e.image_syncing.columns)("autoReload",-1)("status",e.tableStatus)}}function si(e,t){if(1&e){const e=S.Tb();S.Sb(0,"cd-table",14),S.gc("fetchData",(function(){return S.Dc(e),S.ic().refresh()})),S.Rb()}if(2&e){const e=S.ic();S.pc("data",e.image_ready.data)("columns",e.image_ready.columns)("autoReload",-1)("status",e.tableStatus)}}function ni(e,t){if(1&e&&(S.Sb(0,"span",15),S.jc(1,"mirrorHealthColor"),S.Oc(2),S.Rb()),2&e){const e=t.value;S.pc("ngClass",S.kc(1,2,t.row.state_color)),S.yb(2),S.Pc(e)}}function ri(e,t){1&e&&(S.Sb(0,"span",16),S.Wb(1,17),S.Rb())}function ci(e,t){1&e&&S.Nb(0,"ngb-progressbar",18),2&e&&S.pc("value",t.value)("showValue",!0)}let li=(()=>{class e{constructor(e){this.rbdMirroringService=e,this.image_error={data:[],columns:{}},this.image_syncing={data:[],columns:{}},this.image_ready={data:[],columns:{}},this.tableStatus=new Pa.a}ngOnInit(){this.image_error.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Issue",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.image_syncing.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"progress",name:"Progress",cellTemplate:this.progressTmpl,flexGrow:2},{prop:"state",name:"State",cellTemplate:this.syncTmpl,flexGrow:1}],this.image_ready.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Description",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.image_error.data=e.content_data.image_error,this.image_syncing.data=e.content_data.image_syncing,this.image_ready.data=e.content_data.image_ready,this.tableStatus=new Pa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(pa))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-mirroring-images"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(ei,!0),S.Jc(ti,!0),S.Jc(ai,!0)),2&e&&(S.zc(a=S.hc())&&(t.stateTmpl=a.first),S.zc(a=S.hc())&&(t.syncTmpl=a.first),S.zc(a=S.hc())&&(t.progressTmpl=a.first))},decls:21,vars:1,consts:function(){return[["ngbNav","","cdStatefulTab","image-list",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","issues"],["ngbNavLink",""],"Issues",["ngbNavContent",""],["ngbNavItem","syncing"],"Syncing",["ngbNavItem","ready"],"Ready",[3,"ngbNavOutlet"],["stateTmpl",""],["syncTmpl",""],["progressTmpl",""],["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],[3,"ngClass"],[1,"badge","badge-info"],"Syncing",["type","info",3,"value","showValue"]]},template:function(e,t){if(1&e&&(S.Sb(0,"ul",0,1),S.Sb(2,"li",2),S.Sb(3,"a",3),S.Wb(4,4),S.Rb(),S.Mc(5,ii,1,4,"ng-template",5),S.Rb(),S.Sb(6,"li",6),S.Sb(7,"a",3),S.Wb(8,7),S.Rb(),S.Mc(9,oi,1,4,"ng-template",5),S.Rb(),S.Sb(10,"li",8),S.Sb(11,"a",3),S.Wb(12,9),S.Rb(),S.Mc(13,si,1,4,"ng-template",5),S.Rb(),S.Rb(),S.Nb(14,"div",10),S.Mc(15,ni,3,4,"ng-template",null,11,S.Nc),S.Mc(17,ri,2,0,"ng-template",null,12,S.Nc),S.Mc(19,ci,1,2,"ng-template",null,13,S.Nc)),2&e){const e=S.Ac(1);S.yb(14),S.pc("ngbNavOutlet",e)}},directives:[r.p,Za.a,r.r,r.s,r.q,r.u,ot.a,i.p,r.z],pipes:[Ea],styles:[""]}),e})(),bi=(()=>{class e{constructor(e,t,a){this.authStorageService=e,this.rbdMirroringService=t,this.modalService=a,this.selection=new nt.a,this.peersExist=!0,this.subs=new ca.a,this.permission=this.authStorageService.getPermissions().rbdMirroring;const i={permission:"update",icon:N.a.edit,click:()=>this.editSiteNameModal(),name:"Edit Site Name",canBePrimary:()=>!0,disable:()=>!1},o={permission:"update",icon:N.a.upload,click:()=>this.createBootstrapModal(),name:"Create Bootstrap Token",disable:()=>!1},s={permission:"update",icon:N.a.download,click:()=>this.importBootstrapModal(),name:"Import Bootstrap Token",disable:()=>this.peersExist};this.tableActions=[i,o,s]}ngOnInit(){this.subs.add(this.rbdMirroringService.startPolling()),this.subs.add(this.rbdMirroringService.subscribeSummary(e=>{this.status=e.content_data.status,this.siteName=e.site_name,this.peersExist=!!e.content_data.pools.find(e=>e.peer_uuids.length>0)}))}ngOnDestroy(){this.subs.unsubscribe()}editSiteNameModal(){this.modalRef=this.modalService.show(Fa,{siteName:this.siteName})}createBootstrapModal(){this.modalRef=this.modalService.show(wa,{siteName:this.siteName})}importBootstrapModal(){this.modalRef=this.modalService.show(Ta,{siteName:this.siteName})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(pa),S.Mb(P.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-mirroring"]],decls:21,vars:4,consts:function(){return[[1,"row"],[1,"col-md-12"],"Site Name:",[1,"table-actions","float-right",3,"permission","selection","tableActions"],[1,"col-sm-6"],"Daemons","Pools","Images"]},template:function(e,t){1&e&&(S.Sb(0,"div",0),S.Sb(1,"div",1),S.Sb(2,"span"),S.Sb(3,"strong"),S.Wb(4,2),S.Rb(),S.Oc(5),S.Rb(),S.Nb(6,"cd-table-actions",3),S.Rb(),S.Rb(),S.Sb(7,"div",0),S.Sb(8,"div",4),S.Sb(9,"legend"),S.Wb(10,5),S.Rb(),S.Nb(11,"cd-mirroring-daemons"),S.Rb(),S.Sb(12,"div",4),S.Sb(13,"legend"),S.Wb(14,6),S.Rb(),S.Nb(15,"cd-mirroring-pools"),S.Rb(),S.Rb(),S.Sb(16,"div",0),S.Sb(17,"div",1),S.Sb(18,"legend"),S.Wb(19,7),S.Rb(),S.Nb(20,"cd-mirroring-images"),S.Rb(),S.Rb()),2&e&&(S.yb(5),S.Qc(" ",t.siteName,""),S.yb(1),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Mt.a,Oa,Ha,li],styles:[""]}),e})();var di=a("jtHE"),pi=a("SxV6"),mi=a("eIep"),ui=a("Ekvf"),fi=a("PhyI"),hi=a("Fgil"),gi=a("aXbf");class Si{}var vi=function(e){return e[e.V1=1]="V1",e[e.V2=2]="V2",e}({});class yi{constructor(){this.features=[]}}class Ri{constructor(){this.features=[]}}class wi extends class{}{constructor(){super(...arguments),this.features=[]}}class _i{constructor(){this.features=[]}}var ki=function(e){return e.editing="editing",e.cloning="cloning",e.copying="copying",e}({}),Mi=a("EmSq"),Ni=a("rFfW"),Ii=a("p4Cf");function $i(e,t){if(1&e&&(S.Sb(0,"div",9),S.Sb(1,"label",57),S.Wb(2,58),S.jc(3,"titlecase"),S.Rb(),S.Sb(4,"div",12),S.Nb(5,"input",59),S.Nb(6,"hr"),S.Rb(),S.Rb()),2&e){const e=S.ic(2);S.yb(3),S.ac(S.kc(3,1,e.action)),S.Xb(2)}}function Ti(e,t){1&e&&(S.Sb(0,"span",60),S.Qb(1),S.Wb(2,61),S.Pb(),S.Rb())}function Fi(e,t){1&e&&(S.Sb(0,"span",60),S.Qb(1),S.Wb(2,62),S.Pb(),S.Rb())}function Pi(e,t){1&e&&S.Nb(0,"input",63)}function zi(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,66),S.Rb()),2&e&&S.pc("ngValue",null)}function Ei(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,67),S.Rb()),2&e&&S.pc("ngValue",null)}function Ci(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,68),S.Rb()),2&e&&S.pc("ngValue",null)}function Di(e,t){if(1&e&&(S.Sb(0,"option",69),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e.pool_name),S.yb(1),S.Pc(e.pool_name)}}function Oi(e,t){if(1&e&&(S.Sb(0,"select",64),S.Mc(1,zi,2,1,"option",65),S.Mc(2,Ei,2,1,"option",65),S.Mc(3,Ci,2,1,"option",65),S.Mc(4,Di,2,2,"option",45),S.Rb()),2&e){const e=S.ic(2);S.yb(1),S.pc("ngIf",null===e.pools),S.yb(1),S.pc("ngIf",null!==e.pools&&0===e.pools.length),S.yb(1),S.pc("ngIf",null!==e.pools&&e.pools.length>0),S.yb(1),S.pc("ngForOf",e.pools)}}function Ai(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,70),S.Rb())}const xi=function(e,t){return[e,t]};function Vi(e,t){if(1&e&&(S.Sb(0,"div",9),S.Sb(1,"div",20),S.Nb(2,"i",71),S.Rb(),S.Rb()),2&e){const e=S.ic(2);S.yb(2),S.pc("ngClass",S.vc(1,xi,e.icons.spinner,e.icons.spin))}}function Wi(e,t){1&e&&S.Nb(0,"input",75)}function qi(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,77),S.Rb()),2&e&&S.pc("ngValue",null)}function Bi(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,78),S.Rb()),2&e&&S.pc("ngValue",null)}function Gi(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,79),S.Rb()),2&e&&S.pc("ngValue",null)}function Li(e,t){if(1&e&&(S.Sb(0,"option",69),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e),S.yb(1),S.Pc(e)}}function ji(e,t){if(1&e&&(S.Sb(0,"select",76),S.Mc(1,qi,2,1,"option",65),S.Mc(2,Bi,2,1,"option",65),S.Mc(3,Gi,2,1,"option",65),S.Mc(4,Li,2,2,"option",45),S.Rb()),2&e){const e=S.ic(3);S.yb(1),S.pc("ngIf",null===e.pools),S.yb(1),S.pc("ngIf",null!==e.pools&&0===e.pools.length),S.yb(1),S.pc("ngIf",null!==e.pools&&e.pools.length>0),S.yb(1),S.pc("ngForOf",e.namespaces)}}function Qi(e,t){if(1&e&&(S.Sb(0,"div",9),S.Sb(1,"label",72),S.Oc(2," Namespace "),S.Rb(),S.Sb(3,"div",12),S.Mc(4,Wi,1,0,"input",73),S.Mc(5,ji,5,4,"select",74),S.Rb(),S.Rb()),2&e){const e=S.ic(2);S.yb(4),S.pc("ngIf","editing"===e.mode||!e.poolPermission.read),S.yb(1),S.pc("ngIf","editing"!==e.mode&&e.poolPermission.read)}}function Ui(e,t){1&e&&(S.Sb(0,"cd-helper"),S.Sb(1,"span"),S.Wb(2,80),S.Rb(),S.Rb())}function Yi(e,t){1&e&&S.Nb(0,"input",87)}function Ki(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,89),S.Rb()),2&e&&S.pc("ngValue",null)}function Ji(e,t){1&e&&(S.Sb(0,"option",49),S.Wb(1,90),S.Rb()),2&e&&S.pc("ngValue",null)}function Xi(e,t){1&e&&(S.Sb(0,"option",49),S.Oc(1,"-- Select a data pool -- "),S.Rb()),2&e&&S.pc("ngValue",null)}function Hi(e,t){if(1&e&&(S.Sb(0,"option",69),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e.pool_name),S.yb(1),S.Pc(e.pool_name)}}function Zi(e,t){if(1&e){const e=S.Tb();S.Sb(0,"select",88),S.gc("change",(function(t){return S.Dc(e),S.ic(3).onDataPoolChange(t.target.value)})),S.Mc(1,Ki,2,1,"option",65),S.Mc(2,Ji,2,1,"option",65),S.Mc(3,Xi,2,1,"option",65),S.Mc(4,Hi,2,2,"option",45),S.Rb()}if(2&e){const e=S.ic(3);S.yb(1),S.pc("ngIf",null===e.dataPools),S.yb(1),S.pc("ngIf",null!==e.dataPools&&0===e.dataPools.length),S.yb(1),S.pc("ngIf",null!==e.dataPools&&e.dataPools.length>0),S.yb(1),S.pc("ngForOf",e.dataPools)}}function eo(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,91),S.Rb())}const to=function(e){return{required:e}};function ao(e,t){if(1&e&&(S.Sb(0,"div",9),S.Sb(1,"label",81),S.Sb(2,"span",71),S.Wb(3,82),S.Rb(),S.Sb(4,"cd-helper",83),S.Yb(5,84),S.Rb(),S.Rb(),S.Sb(6,"div",12),S.Mc(7,Yi,1,0,"input",85),S.Mc(8,Zi,5,4,"select",86),S.Mc(9,eo,2,0,"span",14),S.Rb(),S.Rb()),2&e){S.ic();const e=S.Ac(2),t=S.ic();S.yb(2),S.pc("ngClass",S.uc(4,to,"editing"!==t.mode)),S.yb(5),S.pc("ngIf","editing"===t.mode||!t.poolPermission.read),S.yb(1),S.pc("ngIf","editing"!==t.mode&&t.poolPermission.read),S.yb(1),S.pc("ngIf",t.rbdForm.showError("dataPool",e,"required"))}}function io(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,92),S.Rb())}function oo(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,93),S.Rb())}function so(e,t){if(1&e&&S.Nb(0,"cd-helper",97),2&e){const e=S.ic().$implicit;S.qc("html",e.helperHtml)}}function no(e,t){if(1&e&&(S.Sb(0,"div",21),S.Nb(1,"input",94),S.Sb(2,"label",95),S.Oc(3),S.Rb(),S.Mc(4,so,1,1,"cd-helper",96),S.Rb()),2&e){const e=t.$implicit;S.yb(1),S.qc("id",e.key),S.qc("name",e.key),S.qc("formControlName",e.key),S.yb(1),S.qc("for",e.key),S.yb(1),S.Pc(e.desc),S.yb(1),S.pc("ngIf",e.helperHtml)}}function ro(e,t){if(1&e){const e=S.Tb();S.Sb(0,"a",98),S.gc("click",(function(){return S.Dc(e),S.ic(2).advancedEnabled=!0,!1})),S.Wb(1,99),S.Rb()}}function co(e,t){if(1&e&&(S.Sb(0,"option",69),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e),S.yb(1),S.Pc(e)}}function lo(e,t){if(1&e&&(S.Sb(0,"option",69),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e),S.yb(1),S.Pc(e)}}function bo(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,100),S.Rb())}function po(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,101),S.Rb())}function mo(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,102),S.Rb())}function uo(e,t){1&e&&(S.Sb(0,"span",60),S.Wb(1,103),S.Rb())}function fo(e,t){if(1&e){const e=S.Tb();S.Sb(0,"div",1),S.Sb(1,"form",2,3),S.Sb(3,"div",4),S.Sb(4,"div",5),S.Wb(5,6),S.jc(6,"titlecase"),S.jc(7,"upperFirst"),S.Rb(),S.Sb(8,"div",7),S.Mc(9,$i,7,3,"div",8),S.Sb(10,"div",9),S.Sb(11,"label",10),S.Wb(12,11),S.Rb(),S.Sb(13,"div",12),S.Nb(14,"input",13),S.Mc(15,Ti,3,0,"span",14),S.Mc(16,Fi,3,0,"span",14),S.Rb(),S.Rb(),S.Sb(17,"div",15),S.gc("change",(function(t){return S.Dc(e),S.ic().onPoolChange(t.target.value)})),S.Sb(18,"label",16),S.Wb(19,17),S.Rb(),S.Sb(20,"div",12),S.Mc(21,Pi,1,0,"input",18),S.Mc(22,Oi,5,4,"select",19),S.Mc(23,Ai,2,0,"span",14),S.Rb(),S.Rb(),S.Mc(24,Vi,3,4,"div",8),S.Mc(25,Qi,6,2,"div",8),S.Sb(26,"div",9),S.Sb(27,"div",20),S.Sb(28,"div",21),S.Sb(29,"input",22),S.gc("change",(function(){return S.Dc(e),S.ic().onUseDataPoolChange()})),S.Rb(),S.Sb(30,"label",23),S.Wb(31,24),S.Rb(),S.Mc(32,Ui,3,0,"cd-helper",25),S.Rb(),S.Rb(),S.Rb(),S.Mc(33,ao,10,6,"div",8),S.Sb(34,"div",9),S.Sb(35,"label",26),S.Wb(36,27),S.Rb(),S.Sb(37,"div",12),S.Sb(38,"input",28),S.Yb(39,29),S.Rb(),S.Mc(40,io,2,0,"span",14),S.Mc(41,oo,2,0,"span",14),S.Rb(),S.Rb(),S.Sb(42,"div",30),S.Sb(43,"label",31),S.Wb(44,32),S.Rb(),S.Sb(45,"div",12),S.Mc(46,no,5,6,"div",33),S.Rb(),S.Rb(),S.Sb(47,"div",34),S.Sb(48,"div",35),S.Mc(49,ro,2,0,"a",36),S.Rb(),S.Rb(),S.Sb(50,"div",37),S.Sb(51,"legend",38),S.Wb(52,39),S.Rb(),S.Sb(53,"div",40),S.Sb(54,"h4",38),S.Wb(55,41),S.Rb(),S.Sb(56,"div",9),S.Sb(57,"label",42),S.Wb(58,43),S.Rb(),S.Sb(59,"div",12),S.Sb(60,"select",44),S.Mc(61,co,2,2,"option",45),S.Rb(),S.Rb(),S.Rb(),S.Sb(62,"div",9),S.Sb(63,"label",46),S.Wb(64,47),S.Rb(),S.Sb(65,"div",12),S.Sb(66,"select",48),S.Sb(67,"option",49),S.Wb(68,50),S.Rb(),S.Mc(69,lo,2,2,"option",45),S.Rb(),S.Mc(70,bo,2,0,"span",14),S.Mc(71,po,2,0,"span",14),S.Rb(),S.Rb(),S.Sb(72,"div",9),S.Sb(73,"label",51),S.Wb(74,52),S.Rb(),S.Sb(75,"div",12),S.Nb(76,"input",53),S.Mc(77,mo,2,0,"span",14),S.Mc(78,uo,2,0,"span",14),S.Rb(),S.Rb(),S.Rb(),S.Sb(79,"cd-rbd-configuration-form",54),S.gc("changes",(function(t){return S.Dc(e),S.ic().getDirtyConfigurationValues=t})),S.Rb(),S.Rb(),S.Rb(),S.Sb(80,"div",55),S.Sb(81,"cd-form-button-panel",56),S.gc("submitActionEvent",(function(){return S.Dc(e),S.ic().submit()})),S.jc(82,"titlecase"),S.jc(83,"upperFirst"),S.Rb(),S.Rb(),S.Rb(),S.Rb(),S.Rb()}if(2&e){const e=S.Ac(2),t=S.ic();S.yb(1),S.pc("formGroup",t.rbdForm),S.yb(6),S.ac(S.kc(6,32,t.action))(S.kc(7,34,t.resource)),S.Xb(5),S.yb(2),S.pc("ngIf",t.rbdForm.getValue("parent")),S.yb(6),S.pc("ngIf",t.rbdForm.showError("name",e,"required")),S.yb(1),S.pc("ngIf",t.rbdForm.showError("name",e,"pattern")),S.yb(2),S.pc("ngClass",S.uc(40,to,"editing"!==t.mode)),S.yb(3),S.pc("ngIf","editing"===t.mode||!t.poolPermission.read),S.yb(1),S.pc("ngIf","editing"!==t.mode&&t.poolPermission.read),S.yb(1),S.pc("ngIf",t.rbdForm.showError("pool",e,"required")),S.yb(1),S.pc("ngIf","editing"!==t.mode&&t.rbdForm.getValue("pool")&&null===t.namespaces),S.yb(1),S.pc("ngIf","editing"===t.mode&&t.rbdForm.getValue("namespace")||"editing"!==t.mode&&(t.namespaces&&t.namespaces.length>0||!t.poolPermission.read)),S.yb(7),S.pc("ngIf",t.allDataPools.length<=1),S.yb(1),S.pc("ngIf",t.rbdForm.getValue("useDataPool")),S.yb(7),S.pc("ngIf",t.rbdForm.showError("size",e,"required")),S.yb(1),S.pc("ngIf",t.rbdForm.showError("size",e,"invalidSizeObject")),S.yb(5),S.pc("ngForOf",t.featuresList),S.yb(3),S.pc("ngIf",!t.advancedEnabled),S.yb(1),S.pc("hidden",!t.advancedEnabled),S.yb(11),S.pc("ngForOf",t.objectSizes),S.yb(2),S.pc("ngClass",S.uc(42,to,t.rbdForm.getValue("stripingCount"))),S.yb(4),S.pc("ngValue",null),S.yb(2),S.pc("ngForOf",t.objectSizes),S.yb(1),S.pc("ngIf",t.rbdForm.showError("stripingUnit",e,"required")),S.yb(1),S.pc("ngIf",t.rbdForm.showError("stripingUnit",e,"invalidStripingUnit")),S.yb(2),S.pc("ngClass",S.uc(44,to,t.rbdForm.getValue("stripingUnit"))),S.yb(4),S.pc("ngIf",t.rbdForm.showError("stripingCount",e,"required")),S.yb(1),S.pc("ngIf",t.rbdForm.showError("stripingCount",e,"min")),S.yb(1),S.pc("form",t.rbdForm)("initializeData",t.initializeConfigData),S.yb(2),S.pc("form",e)("submitText",S.kc(82,36,t.action)+" "+S.kc(83,38,t.resource))}}let ho=(()=>{class e extends I.a{constructor(e,t,a,i,o,s,n,r,c){super(),this.authStorageService=e,this.route=t,this.poolService=a,this.rbdService=i,this.formatter=o,this.taskWrapper=s,this.dimlessBinaryPipe=n,this.actionLabels=r,this.router=c,this.namespaces=[],this.namespacesByPoolCache={},this.pools=null,this.allPools=null,this.dataPools=null,this.allDataPools=[],this.featuresList=[],this.initializeConfigData=new di.a(1),this.advancedEnabled=!1,this.rbdFormMode=ki,this.defaultObjectSize="4 MiB",this.objectSizes=["4 KiB","8 KiB","16 KiB","32 KiB","64 KiB","128 KiB","256 KiB","512 KiB","1 MiB","2 MiB","4 MiB","8 MiB","16 MiB","32 MiB"],this.rbdImage=new di.a(1),this.icons=N.a,this.routerUrl=this.router.url,this.poolPermission=this.authStorageService.getPermissions().pool,this.resource="RBD",this.features={"deep-flatten":{desc:"Deep flatten",requires:null,allowEnable:!1,allowDisable:!0},layering:{desc:"Layering",requires:null,allowEnable:!1,allowDisable:!1},"exclusive-lock":{desc:"Exclusive lock",requires:null,allowEnable:!0,allowDisable:!0},"object-map":{desc:"Object map (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},journaling:{desc:"Journaling (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},"fast-diff":{desc:"Fast diff (interlocked with object-map)",requires:"object-map",allowEnable:!0,allowDisable:!0,interlockedWith:"object-map",initDisabled:!0}},this.featuresList=this.objToArray(this.features),this.createForm()}objToArray(e){return m.a.map(e,(e,t)=>Object.assign(e,{key:t}))}createForm(){this.rbdForm=new $.a({parent:new o.h(""),name:new o.h("",{validators:[o.A.required,o.A.pattern(/^[^@/]+?$/)]}),pool:new o.h(null,{validators:[o.A.required]}),namespace:new o.h(null),useDataPool:new o.h(!1),dataPool:new o.h(null),size:new o.h(null,{updateOn:"blur"}),obj_size:new o.h(this.defaultObjectSize),features:new $.a(this.featuresList.reduce((e,t)=>(e[t.key]=new o.h({value:!1,disabled:!!t.initDisabled}),e),{})),stripingUnit:new o.h(null),stripingCount:new o.h(null,{updateOn:"blur"})},this.validateRbdForm(this.formatter))}disableForEdit(){this.rbdForm.get("parent").disable(),this.rbdForm.get("pool").disable(),this.rbdForm.get("namespace").disable(),this.rbdForm.get("useDataPool").disable(),this.rbdForm.get("dataPool").disable(),this.rbdForm.get("obj_size").disable(),this.rbdForm.get("stripingUnit").disable(),this.rbdForm.get("stripingCount").disable(),this.rbdImage.subscribe(e=>{e.image_format===vi.V1&&(this.rbdForm.get("deep-flatten").disable(),this.rbdForm.get("layering").disable(),this.rbdForm.get("exclusive-lock").disable())})}disableForClone(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}disableForCopy(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}ngOnInit(){this.prepareFormForAction(),this.gatherNeededData().subscribe(this.handleExternalData.bind(this))}prepareFormForAction(){const e=this.routerUrl;e.startsWith("/block/rbd/edit")?(this.mode=this.rbdFormMode.editing,this.action=this.actionLabels.EDIT,this.disableForEdit()):e.startsWith("/block/rbd/clone")?(this.mode=this.rbdFormMode.cloning,this.disableForClone(),this.action=this.actionLabels.CLONE):e.startsWith("/block/rbd/copy")?(this.mode=this.rbdFormMode.copying,this.action=this.actionLabels.COPY,this.disableForCopy()):this.action=this.actionLabels.CREATE,m.a.each(this.features,e=>{this.rbdForm.get("features").get(e.key).valueChanges.subscribe(t=>this.featureFormUpdate(e.key,t))})}gatherNeededData(){const e={};return this.mode?this.route.params.subscribe(t=>{const a=R.a.fromString(decodeURIComponent(t.image_spec));t.snap&&(this.snapName=decodeURIComponent(t.snap)),e.rbd=this.rbdService.get(a)}):e.defaultFeatures=this.rbdService.defaultFeatures(),this.mode!==this.rbdFormMode.editing&&this.poolPermission.read&&(e.pools=this.poolService.list(["pool_name","type","flags_names","application_metadata"])),Object(u.a)(e)}handleExternalData(e){if(this.handlePoolData(e.pools),e.defaultFeatures&&this.setFeatures(e.defaultFeatures),e.rbd){const t=e.rbd;this.setResponse(t,this.snapName),this.rbdImage.next(t)}this.loadingReady()}handlePoolData(e){if(!e)return;const t=[],a=[];for(const i of e)this.rbdService.isRBDPool(i)&&("replicated"===i.type?(t.push(i),a.push(i)):"erasure"===i.type&&-1!==i.flags_names.indexOf("ec_overwrites")&&a.push(i));if(this.pools=t,this.allPools=t,this.dataPools=a,this.allDataPools=a,1===this.pools.length){const e=this.pools[0].pool_name;this.rbdForm.get("pool").setValue(e),this.onPoolChange(e)}this.allDataPools.length<=1&&this.rbdForm.get("useDataPool").disable()}onPoolChange(e){const t=this.rbdForm.get("dataPool");t.value===e&&t.setValue(null),this.dataPools=this.allDataPools?this.allDataPools.filter(t=>t.pool_name!==e):[],this.namespaces=null,e in this.namespacesByPoolCache?this.namespaces=this.namespacesByPoolCache[e]:this.rbdService.listNamespaces(e).subscribe(t=>{t=t.map(e=>e.namespace),this.namespacesByPoolCache[e]=t,this.namespaces=t}),this.rbdForm.get("namespace").setValue(null)}onUseDataPoolChange(){this.rbdForm.getValue("useDataPool")||(this.rbdForm.get("dataPool").setValue(null),this.onDataPoolChange(null))}onDataPoolChange(e){const t=this.allPools.filter(t=>t.pool_name!==e);this.rbdForm.getValue("pool")===e&&this.rbdForm.get("pool").setValue(null),this.pools=t}validateRbdForm(e){return t=>{const a=t.get("useDataPool"),i=t.get("dataPool");let o=null;a.value&&null==i.value&&(o={required:!0}),i.setErrors(o);const s=t.get("size"),n=t.get("obj_size"),r=e.toBytes(null!=n.value?n.value:this.defaultObjectSize),c=t.get("stripingCount"),l=null!=c.value?c.value:1;let b=null;null===s.value?b={required:!0}:l*r>e.toBytes(s.value)&&(b={invalidSizeObject:!0}),s.setErrors(b);const d=t.get("stripingUnit");let p=null;null===d.value&&null!==c.value?p={required:!0}:null!==d.value&&e.toBytes(d.value)>r&&(p={invalidStripingUnit:!0}),d.setErrors(p);let m=null;return null===c.value&&null!==d.value?m={required:!0}:l<1&&(m={min:!0}),c.setErrors(m),null}}deepBoxCheck(e,t){this.getDependentChildFeatures(e).forEach(e=>{const a=this.rbdForm.get(e.key);t?a.enable({emitEvent:!1}):(a.disable({emitEvent:!1}),a.setValue(!1,{emitEvent:!1}),this.deepBoxCheck(e.key,t));const i=this.rbdForm.get("features");this.mode===this.rbdFormMode.editing&&i.get(e.key).enabled&&((-1===this.response.features_name.indexOf(e.key)||e.allowDisable)&&(-1!==this.response.features_name.indexOf(e.key)||e.allowEnable)||i.get(e.key).disable())})}getDependentChildFeatures(e){return m.a.filter(this.features,t=>t.requires===e)||[]}interlockCheck(e,t){const a=this.featuresList.find(t=>t.key===e);if(this.response){const e=null!=a.interlockedWith,t=this.featuresList.find(e=>e.interlockedWith===a.key),i=!!this.response.features_name.find(e=>e===a.key);if(e){if(i!==!!this.response.features_name.find(e=>e===a.interlockedWith))return}else if(t&&!!this.response.features_name.find(e=>e===t.key)!==i)return}t?m.a.filter(this.features,t=>t.interlockedWith===e).forEach(e=>this.rbdForm.get(e.key).setValue(!0,{emitEvent:!1})):a.interlockedWith&&this.rbdForm.get("features").get(a.interlockedWith).setValue(!1)}featureFormUpdate(e,t){if(t){const t=this.features[e].requires;if(t&&!this.rbdForm.getValue(t))return void this.rbdForm.get("features."+e).setValue(!1)}this.deepBoxCheck(e,t),this.interlockCheck(e,t)}setFeatures(e){const t=this.rbdForm.get("features");m.a.forIn(this.features,a=>{-1!==e.indexOf(a.key)&&t.get(a.key).setValue(!0),this.featureFormUpdate(a.key,t.get(a.key).value)})}setResponse(e,t){this.response=e;const a=new R.a(e.pool_name,e.namespace,e.name).toString();if(this.mode===this.rbdFormMode.cloning)this.rbdForm.get("parent").setValue(`${a}@${t}`);else if(this.mode===this.rbdFormMode.copying)t?this.rbdForm.get("parent").setValue(`${a}@${t}`):this.rbdForm.get("parent").setValue(""+a);else if(e.parent){const t=e.parent;this.rbdForm.get("parent").setValue(`${t.pool_name}/${t.image_name}@${t.snap_name}`)}this.mode===this.rbdFormMode.editing&&this.rbdForm.get("name").setValue(e.name),this.rbdForm.get("pool").setValue(e.pool_name),this.onPoolChange(e.pool_name),this.rbdForm.get("namespace").setValue(e.namespace),e.data_pool&&(this.rbdForm.get("useDataPool").setValue(!0),this.rbdForm.get("dataPool").setValue(e.data_pool)),this.rbdForm.get("size").setValue(this.dimlessBinaryPipe.transform(e.size)),this.rbdForm.get("obj_size").setValue(this.dimlessBinaryPipe.transform(e.obj_size)),this.setFeatures(e.features_name),this.rbdForm.get("stripingUnit").setValue(this.dimlessBinaryPipe.transform(e.stripe_unit)),this.rbdForm.get("stripingCount").setValue(e.stripe_count),this.initializeConfigData.next({initialData:this.response.configuration,sourceType:fi.a.image})}createRequest(){const e=new wi;return e.pool_name=this.rbdForm.getValue("pool"),e.namespace=this.rbdForm.getValue("namespace"),e.name=this.rbdForm.getValue("name"),e.size=this.formatter.toBytes(this.rbdForm.getValue("size")),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(),e}addObjectSizeAndStripingToRequest(e){e.obj_size=this.formatter.toBytes(this.rbdForm.getValue("obj_size")),m.a.forIn(this.features,t=>{this.rbdForm.getValue(t.key)&&e.features.push(t.key)}),e.stripe_unit=this.formatter.toBytes(this.rbdForm.getValue("stripingUnit")),e.stripe_count=this.rbdForm.getValue("stripingCount"),e.data_pool=this.rbdForm.getValue("dataPool")}createAction(){const e=this.createRequest();return this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/create",{pool_name:e.pool_name,namespace:e.namespace,image_name:e.name}),call:this.rbdService.create(e)})}editRequest(){const e=new _i;return e.name=this.rbdForm.getValue("name"),e.size=this.formatter.toBytes(this.rbdForm.getValue("size")),m.a.forIn(this.features,t=>{this.rbdForm.getValue(t.key)&&e.features.push(t.key)}),e.configuration=this.getDirtyConfigurationValues(),e}cloneRequest(){const e=new yi;return e.child_pool_name=this.rbdForm.getValue("pool"),e.child_namespace=this.rbdForm.getValue("namespace"),e.child_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(!0,fi.a.image),e}editAction(){const e=new R.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/edit",{image_spec:e.toString()}),call:this.rbdService.update(e,this.editRequest())})}cloneAction(){const e=this.cloneRequest(),t=new R.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/clone",{parent_image_spec:t.toString(),parent_snap_name:this.snapName,child_pool_name:e.child_pool_name,child_namespace:e.child_namespace,child_image_name:e.child_image_name}),call:this.rbdService.cloneSnapshot(t,this.snapName,e)})}copyRequest(){const e=new Ri;return this.snapName&&(e.snapshot_name=this.snapName),e.dest_pool_name=this.rbdForm.getValue("pool"),e.dest_namespace=this.rbdForm.getValue("namespace"),e.dest_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(!0,fi.a.image),e}copyAction(){const e=this.copyRequest(),t=new R.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/copy",{src_image_spec:t.toString(),dest_pool_name:e.dest_pool_name,dest_namespace:e.dest_namespace,dest_image_name:e.dest_image_name}),call:this.rbdService.copy(t,e)})}submit(){this.mode||this.rbdImage.next("create"),this.rbdImage.pipe(Object(pi.a)(),Object(mi.a)(()=>this.mode===this.rbdFormMode.editing?this.editAction():this.mode===this.rbdFormMode.cloning?this.cloneAction():this.mode===this.rbdFormMode.copying?this.copyAction():this.createAction())).subscribe(()=>{},()=>this.rbdForm.setErrors({cdSubmitButton:!0}),()=>this.router.navigate(["/block/rbd"]))}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(s.a),S.Mb(ui.a),S.Mb(_),S.Mb(gi.a),S.Mb(z.a),S.Mb(hi.a),S.Mb(l.b),S.Mb(s.e))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-form"]],features:[S.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","rbdForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],"Name",[1,"cd-col-form-input"],["type","text","placeholder","Name...","id","name","name","name","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"form-group","row",3,"change"],["for","pool",1,"cd-col-form-label",3,"ngClass"],"Pool",["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","useDataPool","name","useDataPool","formControlName","useDataPool",1,"custom-control-input",3,"change"],["for","useDataPool",1,"custom-control-label"],"Use a dedicated data pool",[4,"ngIf"],["for","size",1,"cd-col-form-label","required"],"Size",["id","size","name","size","type","text","formControlName","size","defaultUnit","GiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 10GiB"],["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],"Features",["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"row"],[1,"col-sm-12"],["class","float-right margin-right-md","href","",3,"click",4,"ngIf"],[3,"hidden"],[1,"cd-header"],"Advanced",[1,"col-md-12"],"Striping",["for","size",1,"cd-col-form-label"],"Object size",["id","obj_size","name","obj_size","formControlName","obj_size",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["for","stripingUnit",1,"cd-col-form-label",3,"ngClass"],"Stripe unit",["id","stripingUnit","name","stripingUnit","formControlName","stripingUnit",1,"form-control","custom-select"],[3,"ngValue"],"-- Select stripe unit --",["for","stripingCount",1,"cd-col-form-label",3,"ngClass"],"Stripe count",["id","stripingCount","name","stripingCount","formControlName","stripingCount","type","number",1,"form-control"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","name",1,"cd-col-form-label"],"" + "\ufffd0\ufffd" + " from",["type","text","id","parent","name","parent","formControlName","parent",1,"form-control"],[1,"invalid-feedback"],"This field is required.","'/' and '@' are not allowed.",["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],"Loading...","-- No rbd pools available --","-- Select a pool --",[3,"value"],"This field is required.",[3,"ngClass"],["for","pool",1,"cd-col-form-label"],["class","form-control","type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",4,"ngIf"],["id","namespace","name","namespace","class","form-control custom-select","formControlName","namespace",4,"ngIf"],["type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",1,"form-control"],["id","namespace","name","namespace","formControlName","namespace",1,"form-control","custom-select"],"Loading...","-- No namespaces available --","-- Select a namespace --","You need more than one pool with the rbd application label use to use a dedicated data pool.",["for","dataPool",1,"cd-col-form-label"],"Data pool",[6,"html"],["html","Dedicated pool that stores the object-data of the RBD."],["class","form-control","type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",4,"ngIf"],["id","dataPool","name","dataPool","class","form-control custom-select","formControlName","dataPool",3,"change",4,"ngIf"],["type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control"],["id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control","custom-select",3,"change"],"Loading...","-- No data pools available --","This field is required.","This field is required.","You have to increase the size.",["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],[3,"html",4,"ngIf"],[3,"html"],["href","",1,"float-right","margin-right-md",3,"click"],"Advanced...","This field is required because stripe count is defined!","Stripe unit is greater than object size.","This field is required because stripe unit is defined!","Stripe count must be greater than 0."]},template:function(e,t){1&e&&S.Mc(0,fo,84,46,"div",0),2&e&&S.pc("cdFormLoading",t.loading)},directives:[oe.a,o.C,o.r,o.k,C.a,i.r,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.p,o.b,Mi.a,o.l,i.q,o.z,o.u,o.B,o.v,Ni.a,x.a,Ii.a],pipes:[i.A,le.a],styles:[""]}),e})();var go=a("OLbh"),So=a("yJti"),vo=a("EgGo"),yo=a("wd/R"),Ro=a.n(yo),wo=a("2EZI"),_o=a("MAOJ");function ko(e,t){1&e&&(S.Sb(0,"div",19),S.Sb(1,"span"),S.Wb(2,20),S.Rb(),S.Rb())}function Mo(e,t){1&e&&(S.Sb(0,"span",21),S.Wb(1,22),S.Rb())}function No(e,t){1&e&&(S.Sb(0,"span",21),S.Wb(1,23),S.Rb())}function Io(e,t){if(1&e&&S.Nb(0,"cd-date-time-picker",24),2&e){const e=S.ic();S.pc("control",e.moveForm.get("expiresAt"))}}let $o=(()=>{class e{constructor(e,t,a,i,o){this.rbdService=e,this.activeModal=t,this.actionLabels=a,this.fb=i,this.taskWrapper=o,this.createForm()}createForm(){this.moveForm=this.fb.group({expiresAt:["",[T.a.custom("format",e=>!(""===e||Ro()(e,"YYYY-MM-DD HH:mm:ss").isValid())),T.a.custom("expired",e=>Ro()().isAfter(e))]]})}ngOnInit(){this.imageSpec=new R.a(this.poolName,this.namespace,this.imageName),this.imageSpecStr=this.imageSpec.toString(),this.pattern=`${this.poolName}/${this.imageName}`}moveImage(){let e=0;const t=this.moveForm.getValue("expiresAt");t&&(e=Ro()(t,"YYYY-MM-DD HH:mm:ss").diff(Ro()(),"seconds",!0)),e<0&&(e=0),this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/trash/move",{image_spec:this.imageSpecStr}),call:this.rbdService.moveTrash(this.imageSpec,e)}).subscribe({complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(_),S.Mb(r.a),S.Mb(l.b),S.Mb(wo.a),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-trash-move-modal"]],decls:24,vars:9,consts:function(){var e,t;return e="Move an image to trash",t="To move " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " to trash, click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Move" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ". Optionally, you can pick an expiration date.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","moveForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],["class","alert alert-warning","role","alert",4,"ngIf"],t=S.bc(t),[1,"form-group"],["for","expiresAt",1,"col-form-label"],"Protection expires at",["type","text","formControlName","expiresAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress",6,"placeholder"],["p","ngbPopover"],["placeholder","NOT PROTECTED"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["popContent",""],["role","alert",1,"alert","alert-warning"],"This image contains snapshot(s), which will prevent it from being removed after moved to trash.",[1,"invalid-feedback"],"Wrong date format. Please use \"YYYY-MM-DD HH:mm:ss\".","Protection has already expired. Please pick a future date or leave it empty.",[3,"control"]]},template:function(e,t){if(1&e){const e=S.Tb();S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Mc(7,ko,3,0,"div",7),S.Sb(8,"p"),S.cc(9,8),S.Nb(10,"kbd"),S.Nb(11,"kbd"),S.Zb(),S.Rb(),S.Sb(12,"div",9),S.Sb(13,"label",10),S.Wb(14,11),S.Rb(),S.Sb(15,"input",12,13),S.Yb(17,14),S.gc("click",(function(){return S.Dc(e),S.Ac(16).open()}))("keypress",(function(){return S.Dc(e),S.Ac(16).close()})),S.Rb(),S.Mc(18,Mo,2,0,"span",15),S.Mc(19,No,2,0,"span",15),S.Rb(),S.Rb(),S.Sb(20,"div",16),S.Sb(21,"cd-form-button-panel",17),S.gc("submitActionEvent",(function(){return t.moveImage()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb(),S.Mc(22,Io,1,1,"ng-template",null,18,S.Nc)}if(2&e){const e=S.Ac(5),a=S.Ac(23);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.moveForm),S.yb(3),S.pc("ngIf",t.hasSnapshots),S.yb(4),S.ac(t.imageSpecStr),S.Xb(9),S.yb(4),S.pc("ngbPopover",a),S.yb(3),S.pc("ngIf",t.moveForm.showError("expiresAt",e,"format")),S.yb(1),S.pc("ngIf",t.moveForm.showError("expiresAt",e,"expired")),S.yb(2),S.pc("form",t.moveForm)("submitText",t.actionLabels.MOVE)}},directives:[E.a,o.C,o.r,o.k,C.a,i.r,D.a,O.a,o.d,A.a,o.q,o.i,r.w,x.a,_o.a],styles:[""]}),e})();function To(e,t){1&e&&(S.Sb(0,"li",10),S.Sb(1,"a",3),S.Wb(2,11),S.Rb(),S.Rb())}let Fo=(()=>{class e{constructor(e,t){this.authStorageService=e,this.router=t,this.grafanaPermission=this.authStorageService.getPermissions().grafana}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(s.e))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-tabs"]],decls:12,vars:2,consts:function(){return[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/rbd"],["ngbNavLink",""],"Images",["ngbNavItem","/block/rbd/namespaces"],"Namespaces",["ngbNavItem","/block/rbd/trash"],"Trash",["ngbNavItem","/block/rbd/performance",4,"ngIf"],["ngbNavItem","/block/rbd/performance"],"Overall Performance"]},template:function(e,t){1&e&&(S.Sb(0,"ul",0,1),S.gc("navChange",(function(e){return t.router.navigate([e.nextId])})),S.Sb(2,"li",2),S.Sb(3,"a",3),S.Wb(4,4),S.Rb(),S.Rb(),S.Sb(5,"li",5),S.Sb(6,"a",3),S.Wb(7,6),S.Rb(),S.Rb(),S.Sb(8,"li",7),S.Sb(9,"a",3),S.Wb(10,8),S.Rb(),S.Rb(),S.Mc(11,To,3,0,"li",9),S.Rb()),2&e&&(S.pc("activeId",t.router.url),S.yb(11),S.pc("ngIf",t.grafanaPermission.read))},directives:[r.p,r.r,r.s,i.r],styles:[""]}),e})();var Po=a("LRne"),zo=a("nQ07"),Eo=a("QTAa"),Co=a("a0VL"),Do=a("mSOc"),Oo=a("VXsX"),Ao=a("XNiG");function xo(e,t){1&e&&(S.Sb(0,"span",15),S.Wb(1,16),S.Rb())}let Vo=(()=>{class e{constructor(e,t,a,i,o){this.activeModal=e,this.rbdService=t,this.taskManagerService=a,this.notificationService=i,this.actionLabels=o,this.editing=!1,this.onSubmit=new Ao.a,this.action=this.actionLabels.CREATE,this.resource="RBD Snapshot",this.createForm()}createForm(){this.snapshotForm=new $.a({snapshotName:new o.h("",{validators:[o.A.required]})})}setSnapName(e){this.snapName=e,this.snapshotForm.get("snapshotName").setValue(e)}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.RENAME:this.actionLabels.CREATE}editAction(){const e=this.snapshotForm.getValue("snapshotName"),t=new R.a(this.poolName,this.namespace,this.imageName),a=new F.a;a.name="rbd/snap/edit",a.metadata={image_spec:t.toString(),snapshot_name:e},this.rbdService.renameSnapshot(t,this.snapName,e).toPromise().then(()=>{this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)}),this.activeModal.close(),this.onSubmit.next(this.snapName)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}createAction(){const e=this.snapshotForm.getValue("snapshotName"),t=new R.a(this.poolName,this.namespace,this.imageName),a=new F.a;a.name="rbd/snap/create",a.metadata={image_spec:t.toString(),snapshot_name:e},this.rbdService.createSnapshot(t,e).toPromise().then(()=>{this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)}),this.activeModal.close(),this.onSubmit.next(e)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}submit(){this.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(_),S.Mb(Oo.a),S.Mb(pt.a),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-snapshot-form-modal"]],decls:19,vars:15,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["name","snapshotForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","snapshotName",1,"cd-col-form-label","required"],"Name",[1,"cd-col-form-input"],["type","text","placeholder","Snapshot name...","id","snapshotName","name","snapshotName","formControlName","snapshotName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.jc(3,"titlecase"),S.jc(4,"upperFirst"),S.Pb(),S.Qb(5,3),S.Sb(6,"form",4,5),S.Sb(8,"div",6),S.Sb(9,"div",7),S.Sb(10,"label",8),S.Wb(11,9),S.Rb(),S.Sb(12,"div",10),S.Nb(13,"input",11),S.Mc(14,xo,2,0,"span",12),S.Rb(),S.Rb(),S.Rb(),S.Sb(15,"div",13),S.Sb(16,"cd-form-button-panel",14),S.gc("submitActionEvent",(function(){return t.submit()})),S.jc(17,"titlecase"),S.jc(18,"upperFirst"),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(7);S.pc("modalRef",t.activeModal),S.yb(4),S.ac(S.kc(3,7,t.action))(S.kc(4,9,t.resource)),S.Xb(2),S.yb(2),S.pc("formGroup",t.snapshotForm),S.yb(8),S.pc("ngIf",t.snapshotForm.showError("snapshotName",e,"required")),S.yb(2),S.pc("form",t.snapshotForm)("submitText",S.kc(17,11,t.action)+" "+S.kc(18,13,t.resource))}},directives:[E.a,o.C,o.r,o.k,C.a,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.r,x.a],pipes:[i.A,le.a],styles:[""]}),e})();class Wo{constructor(e,t,a){this.featuresName=t,this.cloneFormatVersion=1,a.cloneFormatVersion().subscribe(e=>{this.cloneFormatVersion=e}),this.create={permission:"create",icon:N.a.add,name:e.CREATE},this.rename={permission:"update",icon:N.a.edit,name:e.RENAME},this.protect={permission:"update",icon:N.a.lock,visible:e=>e.hasSingleSelection&&!e.first().is_protected,name:e.PROTECT},this.unprotect={permission:"update",icon:N.a.unlock,visible:e=>e.hasSingleSelection&&e.first().is_protected,name:e.UNPROTECT},this.clone={permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>this.getCloneDisableDesc(e,this.featuresName),icon:N.a.clone,name:e.CLONE},this.copy={permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>!e.hasSingleSelection||e.first().cdExecuting,icon:N.a.copy,name:e.COPY},this.rollback={permission:"update",icon:N.a.undo,name:e.ROLLBACK},this.deleteSnap={permission:"delete",icon:N.a.destroy,disable:e=>{const t=e.first();return!e.hasSingleSelection||t.cdExecuting||t.is_protected},name:e.DELETE},this.ordering=[this.create,this.rename,this.protect,this.unprotect,this.clone,this.copy,this.rollback,this.deleteSnap]}getCloneDisableDesc(e,t){return!(e.hasSingleSelection&&!e.first().cdExecuting)||((null==t?void 0:t.includes("layering"))?1===this.cloneFormatVersion&&!e.first().is_protected&&"Snapshot must be protected in order to clone.":"Parent image must support Layering")}}class qo{}const Bo=["nameTpl"],Go=["rollbackTpl"];function Lo(e,t){if(1&e&&(S.Qb(0),S.Wb(1,3),S.Pb(),S.Sb(2,"strong"),S.Oc(3),S.Rb(),S.Oc(4,".\n")),2&e){const e=t.$implicit;S.yb(3),S.Qc(" ",e.snapName,"")}}let jo=(()=>{class e{constructor(e,t,a,i,o,s,n,r,c,l,b){this.authStorageService=e,this.modalService=t,this.dimlessBinaryPipe=a,this.cdDatePipe=i,this.rbdService=o,this.taskManagerService=s,this.notificationService=n,this.summaryService=r,this.taskListService=c,this.actionLabels=l,this.cdr=b,this.snapshots=[],this.selection=new nt.a,this.builders={"rbd/snap/create":e=>{const t=new qo;return t.name=e.snapshot_name,t}},this.permission=this.authStorageService.getPermissions().rbdImage}ngOnInit(){this.columns=[{name:"Name",prop:"name",cellTransformation:st.a.executing,flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"State",prop:"is_protected",flexGrow:1,cellTransformation:st.a.badge,customTemplateConfig:{map:{true:{value:"PROTECTED",class:"badge-success"},false:{value:"UNPROTECTED",class:"badge-info"}}}},{name:"Created",prop:"timestamp",flexGrow:1,pipe:this.cdDatePipe}],this.imageSpec=new R.a(this.poolName,this.namespace,this.rbdName),this.rbdTableActions=new Wo(this.actionLabels,this.featuresName,this.rbdService),this.rbdTableActions.create.click=()=>this.openCreateSnapshotModal(),this.rbdTableActions.rename.click=()=>this.openEditSnapshotModal(),this.rbdTableActions.protect.click=()=>this.toggleProtection(),this.rbdTableActions.unprotect.click=()=>this.toggleProtection();const e=()=>this.selection.first()&&`${this.imageSpec.toStringEncoded()}/${encodeURIComponent(this.selection.first().name)}`;this.rbdTableActions.clone.routerLink=()=>"/block/rbd/clone/"+e(),this.rbdTableActions.copy.routerLink=()=>"/block/rbd/copy/"+e(),this.rbdTableActions.rollback.click=()=>this.rollbackModal(),this.rbdTableActions.deleteSnap.click=()=>this.deleteSnapshotModal(),this.tableActions=this.rbdTableActions.ordering,this.taskListService.init(()=>Object(Po.a)(this.snapshots),null,e=>{zo.a.updateChanged(this,{data:e})&&(this.cdr.detectChanges(),this.data=[...this.data])},()=>{zo.a.updateChanged(this,{data:this.snapshots})&&(this.cdr.detectChanges(),this.data=[...this.data])},e=>["rbd/snap/create","rbd/snap/delete","rbd/snap/edit","rbd/snap/rollback"].includes(e.name)&&this.imageSpec.toString()===e.metadata.image_spec,(e,t)=>e.name===t.metadata.snapshot_name,this.builders)}ngOnChanges(){this.columns&&(this.imageSpec=new R.a(this.poolName,this.namespace,this.rbdName),this.rbdTableActions&&(this.rbdTableActions.featuresName=this.featuresName),this.taskListService.fetch())}openSnapshotModal(e,t=null){this.modalRef=this.modalService.show(Vo),this.modalRef.componentInstance.poolName=this.poolName,this.modalRef.componentInstance.imageName=this.rbdName,this.modalRef.componentInstance.namespace=this.namespace,t?this.modalRef.componentInstance.setEditing():t=`${this.rbdName}_${Ro()().toISOString(!0)}`,this.modalRef.componentInstance.setSnapName(t),this.modalRef.componentInstance.onSubmit.subscribe(t=>{const a=new Eo.a;a.name=e,a.metadata={image_spec:this.imageSpec.toString(),snapshot_name:t},this.summaryService.addRunningTask(a)})}openCreateSnapshotModal(){this.openSnapshotModal("rbd/snap/create")}openEditSnapshotModal(){this.openSnapshotModal("rbd/snap/edit",this.selection.first().name)}toggleProtection(){const e=this.selection.first().name,t=this.selection.first().is_protected,a=new F.a;a.name="rbd/snap/edit";const i=new R.a(this.poolName,this.namespace,this.rbdName);a.metadata={image_spec:i.toString(),snapshot_name:e},this.rbdService.protectSnapshot(i,e,!t).toPromise().then(()=>{const e=new Eo.a;e.name=a.name,e.metadata=a.metadata,this.summaryService.addRunningTask(e),this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)})})}_asyncTask(e,t,a){const i=new F.a;i.name=t,i.metadata={image_spec:new R.a(this.poolName,this.namespace,this.rbdName).toString(),snapshot_name:a};const o=new R.a(this.poolName,this.namespace,this.rbdName);this.rbdService[e](o,a).toPromise().then(()=>{const e=new Eo.a;e.name=i.name,e.metadata=i.metadata,this.summaryService.addRunningTask(e),this.modalRef.close(),this.taskManagerService.subscribe(e.name,e.metadata,e=>{this.notificationService.notifyTask(e)})}).catch(()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}rollbackModal(){const e=this.selection.selected[0].name,t=new R.a(this.poolName,this.namespace,this.rbdName).toString(),a={titleText:"RBD snapshot rollback",buttonText:"Rollback",bodyTpl:this.rollbackTpl,bodyData:{snapName:`${t}@${e}`},onSubmit:()=>{this._asyncTask("rollbackSnapshot","rbd/snap/rollback",e)}};this.modalRef=this.modalService.show(go.a,a)}deleteSnapshotModal(){const e=this.selection.selected[0].name;this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD snapshot",itemNames:[e],submitAction:()=>this._asyncTask("deleteSnapshot","rbd/snap/delete",e)})}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(P.a),S.Mb(hi.a),S.Mb(Co.a),S.Mb(_),S.Mb(Oo.a),S.Mb(pt.a),S.Mb(Do.a),S.Mb(bt.a),S.Mb(l.b),S.Mb(S.h))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-snapshot-list"]],viewQuery:function(e,t){var a;1&e&&(S.Tc(Bo,!0),S.Jc(Go,!0)),2&e&&(S.zc(a=S.hc())&&(t.nameTpl=a.first),S.zc(a=S.hc())&&(t.rollbackTpl=a.first))},inputs:{snapshots:"snapshots",featuresName:"featuresName",poolName:"poolName",namespace:"namespace",rbdName:"rbdName"},features:[S.xb([bt.a]),S.wb],decls:4,vars:5,consts:function(){return[["columnMode","flex","selectionType","single",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["rollbackTpl",""],"You are about to rollback"]},template:function(e,t){1&e&&(S.Sb(0,"cd-table",0),S.gc("updateSelection",(function(e){return t.updateSelection(e)})),S.Nb(1,"cd-table-actions",1),S.Rb(),S.Mc(2,Lo,5,1,"ng-template",null,2,S.Nc)),2&e&&(S.pc("data",t.data)("columns",t.columns),S.yb(1),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ot.a,Mt.a],styles:[""],changeDetection:0}),e})();var Qo=a("aAWM"),Uo=a("insk"),Yo=a("nSDx");const Ko=["poolConfigurationSourceTpl"];function Jo(e,t){1&e&&(S.Qb(0),S.cc(1,3),S.Nb(2,"strong"),S.Zb(),S.Pb())}function Xo(e,t){if(1&e&&(S.Sb(0,"span"),S.Sb(1,"span",38),S.Oc(2),S.Rb(),S.Rb()),2&e){const e=t.$implicit;S.yb(2),S.Pc(e)}}function Ho(e,t){if(1&e&&(S.Sb(0,"span"),S.Sb(1,"span",39),S.Wb(2,40),S.Rb(),S.Rb()),2&e){S.ic(3);const e=S.Ac(1);S.yb(1),S.pc("ngbTooltip",e)}}function Zo(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.jc(2,"dimlessBinary"),S.Rb()),2&e){const e=S.ic(3);S.yb(1),S.Qc(" ",S.kc(2,1,e.selection.disk_usage)," ")}}function es(e,t){if(1&e&&(S.Sb(0,"span"),S.Sb(1,"span",39),S.Wb(2,41),S.Rb(),S.Rb()),2&e){S.ic(3);const e=S.Ac(1);S.yb(1),S.pc("ngbTooltip",e)}}function ts(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.jc(2,"dimlessBinary"),S.Rb()),2&e){const e=S.ic(3);S.yb(1),S.Qc(" ",S.kc(2,1,e.selection.total_disk_usage)," ")}}function as(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Rb()),2&e){const e=S.ic(4);S.yb(1),S.Qc("/",e.selection.parent.pool_namespace,"")}}function is(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Mc(2,as,2,1,"span",1),S.Oc(3),S.Rb()),2&e){const e=S.ic(3);S.yb(1),S.Pc(e.selection.parent.pool_name),S.yb(1),S.pc("ngIf",e.selection.parent.pool_namespace),S.yb(1),S.Rc("/",e.selection.parent.image_name,"@",e.selection.parent.snap_name,"")}}function os(e,t){1&e&&(S.Sb(0,"span"),S.Oc(1,"-"),S.Rb())}function ss(e,t){if(1&e&&(S.Sb(0,"table",17),S.Sb(1,"tbody"),S.Sb(2,"tr"),S.Sb(3,"td",18),S.Wb(4,19),S.Rb(),S.Sb(5,"td",20),S.Oc(6),S.Rb(),S.Rb(),S.Sb(7,"tr"),S.Sb(8,"td",21),S.Wb(9,22),S.Rb(),S.Sb(10,"td"),S.Oc(11),S.Rb(),S.Rb(),S.Sb(12,"tr"),S.Sb(13,"td",21),S.Wb(14,23),S.Rb(),S.Sb(15,"td"),S.Oc(16),S.jc(17,"empty"),S.Rb(),S.Rb(),S.Sb(18,"tr"),S.Sb(19,"td",21),S.Wb(20,24),S.Rb(),S.Sb(21,"td"),S.Oc(22),S.jc(23,"cdDate"),S.Rb(),S.Rb(),S.Sb(24,"tr"),S.Sb(25,"td",21),S.Wb(26,25),S.Rb(),S.Sb(27,"td"),S.Oc(28),S.jc(29,"dimlessBinary"),S.Rb(),S.Rb(),S.Sb(30,"tr"),S.Sb(31,"td",21),S.Wb(32,26),S.Rb(),S.Sb(33,"td"),S.Oc(34),S.jc(35,"dimless"),S.Rb(),S.Rb(),S.Sb(36,"tr"),S.Sb(37,"td",21),S.Wb(38,27),S.Rb(),S.Sb(39,"td"),S.Oc(40),S.jc(41,"dimlessBinary"),S.Rb(),S.Rb(),S.Sb(42,"tr"),S.Sb(43,"td",21),S.Wb(44,28),S.Rb(),S.Sb(45,"td"),S.Mc(46,Xo,3,1,"span",29),S.Rb(),S.Rb(),S.Sb(47,"tr"),S.Sb(48,"td",21),S.Wb(49,30),S.Rb(),S.Sb(50,"td"),S.Mc(51,Ho,3,1,"span",1),S.Mc(52,Zo,3,3,"span",1),S.Rb(),S.Rb(),S.Sb(53,"tr"),S.Sb(54,"td",21),S.Wb(55,31),S.Rb(),S.Sb(56,"td"),S.Mc(57,es,3,1,"span",1),S.Mc(58,ts,3,3,"span",1),S.Rb(),S.Rb(),S.Sb(59,"tr"),S.Sb(60,"td",21),S.Wb(61,32),S.Rb(),S.Sb(62,"td"),S.Oc(63),S.jc(64,"dimlessBinary"),S.Rb(),S.Rb(),S.Sb(65,"tr"),S.Sb(66,"td",21),S.Wb(67,33),S.Rb(),S.Sb(68,"td"),S.Oc(69),S.Rb(),S.Rb(),S.Sb(70,"tr"),S.Sb(71,"td",21),S.Wb(72,34),S.Rb(),S.Sb(73,"td"),S.Mc(74,is,4,4,"span",1),S.Mc(75,os,2,0,"span",1),S.Rb(),S.Rb(),S.Sb(76,"tr"),S.Sb(77,"td",21),S.Wb(78,35),S.Rb(),S.Sb(79,"td"),S.Oc(80),S.Rb(),S.Rb(),S.Sb(81,"tr"),S.Sb(82,"td",21),S.Wb(83,36),S.Rb(),S.Sb(84,"td"),S.Oc(85),S.Rb(),S.Rb(),S.Sb(86,"tr"),S.Sb(87,"td",21),S.Wb(88,37),S.Rb(),S.Sb(89,"td"),S.Oc(90),S.Rb(),S.Rb(),S.Rb(),S.Rb()),2&e){const e=S.ic(2);S.yb(6),S.Pc(e.selection.name),S.yb(5),S.Pc(e.selection.pool_name),S.yb(5),S.Pc(S.kc(17,19,e.selection.data_pool)),S.yb(6),S.Pc(S.kc(23,21,e.selection.timestamp)),S.yb(6),S.Pc(S.kc(29,23,e.selection.size)),S.yb(6),S.Pc(S.kc(35,25,e.selection.num_objs)),S.yb(6),S.Pc(S.kc(41,27,e.selection.obj_size)),S.yb(6),S.pc("ngForOf",e.selection.features_name),S.yb(5),S.pc("ngIf",-1===(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),S.yb(1),S.pc("ngIf",-1!==(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),S.yb(5),S.pc("ngIf",-1===(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),S.yb(1),S.pc("ngIf",-1!==(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),S.yb(5),S.Pc(S.kc(64,29,e.selection.stripe_unit)),S.yb(6),S.Pc(e.selection.stripe_count),S.yb(5),S.pc("ngIf",e.selection.parent),S.yb(1),S.pc("ngIf",!e.selection.parent),S.yb(5),S.Pc(e.selection.block_name_prefix),S.yb(5),S.Pc(e.selection.order),S.yb(5),S.Pc(e.selection.image_format)}}function ns(e,t){if(1&e&&S.Nb(0,"cd-rbd-snapshot-list",42),2&e){const e=S.ic(2);S.pc("snapshots",e.selection.snapshots)("featuresName",e.selection.features_name)("poolName",e.selection.pool_name)("namespace",e.selection.namespace)("rbdName",e.selection.name)}}function rs(e,t){if(1&e&&S.Nb(0,"cd-rbd-configuration-table",43),2&e){const e=S.ic(2);S.pc("data",e.selection.configuration)}}function cs(e,t){if(1&e&&S.Nb(0,"cd-grafana",44),2&e){const e=S.ic(2);S.pc("grafanaPath",e.rbdDashboardUrl)}}function ls(e,t){if(1&e&&(S.Qb(0),S.Sb(1,"ul",4,5),S.Sb(3,"li",6),S.Sb(4,"a",7),S.Wb(5,8),S.Rb(),S.Mc(6,ss,91,31,"ng-template",9),S.Rb(),S.Sb(7,"li",10),S.Sb(8,"a",7),S.Wb(9,11),S.Rb(),S.Mc(10,ns,1,5,"ng-template",9),S.Rb(),S.Sb(11,"li",12),S.Sb(12,"a",7),S.Wb(13,13),S.Rb(),S.Mc(14,rs,1,1,"ng-template",9),S.Rb(),S.Sb(15,"li",14),S.Sb(16,"a",7),S.Wb(17,15),S.Rb(),S.Mc(18,cs,1,1,"ng-template",9),S.Rb(),S.Rb(),S.Nb(19,"div",16),S.Pb()),2&e){const e=S.Ac(2);S.yb(19),S.pc("ngbNavOutlet",e)}}function bs(e,t){1&e&&(S.Qb(0),S.Sb(1,"cd-alert-panel",45),S.Wb(2,46),S.Rb(),S.Pb())}function ds(e,t){1&e&&(S.Qb(0),S.Sb(1,"strong",49),S.Yb(2,50),S.Wb(3,51),S.Rb(),S.Pb())}function ps(e,t){1&e&&(S.Sb(0,"span",49),S.Yb(1,52),S.Wb(2,53),S.Rb())}function ms(e,t){if(1&e&&(S.Mc(0,ds,4,0,"ng-container",47),S.Mc(1,ps,3,0,"ng-template",null,48,S.Nc)),2&e){const e=t.value,a=S.Ac(2);S.pc("ngIf",+e)("ngIfElse",a)}}let us=(()=>{class e{ngOnChanges(){this.selection&&(this.rbdDashboardUrl=`rbd-details?var-Pool=${this.selection.pool_name}&var-Image=${this.selection.name}`)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-details"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(Ko,!0),S.Jc(r.p,!0)),2&e&&(S.zc(a=S.hc())&&(t.poolConfigurationSourceTpl=a.first),S.zc(a=S.hc())&&(t.nav=a.first))},inputs:{selection:"selection",images:"images"},features:[S.wb],decls:6,vars:2,consts:function(){return[["usageNotAvailableTooltipTpl",""],[4,"ngIf"],["poolConfigurationSourceTpl",""],"Only available for RBD images with " + "\ufffd#2\ufffd" + "fast-diff" + "\ufffd/#2\ufffd" + " enabled",["ngbNav","","cdStatefulTab","rbd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","snapshots"],"Snapshots",["ngbNavItem","configuration"],"Configuration",["ngbNavItem","performance"],"Performance",[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],"Name",[1,"w-75"],[1,"bold"],"Pool","Data Pool","Created","Size","Objects","Object size","Features",[4,"ngFor","ngForOf"],"Provisioned","Total provisioned","Striping unit","Striping count","Parent","Block name prefix","Order","Format Version",[1,"badge","badge-dark","mr-2"],["placement","top",1,"form-text","text-muted",3,"ngbTooltip"],"N/A","N/A",[3,"snapshots","featuresName","poolName","namespace","rbdName"],[3,"data"],["uid","YhCYGcuZz","grafanaStyle","one",3,"grafanaPath"],["type","warning"],"Information can not be displayed for RBD in status 'Removing'.",[4,"ngIf","ngIfElse"],["global",""],[6,"ngbTooltip"],["ngbTooltip","This setting overrides the global value"],"Image",["ngbTooltip","This is the global value. No value for this option has been set for this image."],"Global"]},template:function(e,t){1&e&&(S.Mc(0,Jo,3,0,"ng-template",null,0,S.Nc),S.Mc(2,ls,20,1,"ng-container",1),S.Mc(3,bs,3,0,"ng-container",1),S.Mc(4,ms,3,2,"ng-template",null,2,S.Nc)),2&e&&(S.yb(2),S.pc("ngIf",t.selection&&"REMOVING"!==t.selection.source),S.yb(1),S.pc("ngIf",t.selection&&"REMOVING"===t.selection.source))},directives:[i.r,r.p,Za.a,r.r,r.s,r.q,r.u,i.q,r.D,jo,Qo.a,Uo.a,_t.a],pipes:[Yo.a,Co.a,hi.a,jt.a],styles:[""]}),e})();const fs=["usageTpl"],hs=["parentTpl"],gs=["nameTpl"],Ss=["flattenTpl"],vs=["deleteTpl"],ys=["removingStatTpl"];function Rs(e,t){1&e&&S.Nb(0,"div",9),2&e&&S.pc("innerHtml","Only available for RBD images with <strong>fast-diff</strong> enabled",S.Ec)}function ws(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Rb()),2&e){const e=S.ic(2).value;S.yb(1),S.Qc("/",e.pool_namespace,"")}}function _s(e,t){if(1&e&&(S.Sb(0,"span"),S.Oc(1),S.Mc(2,ws,2,1,"span",10),S.Oc(3),S.Rb()),2&e){const e=S.ic().value;S.yb(1),S.Pc(e.pool_name),S.yb(1),S.pc("ngIf",e.pool_namespace),S.yb(1),S.Rc("/",e.image_name,"@",e.snap_name,"")}}function ks(e,t){1&e&&(S.Sb(0,"span"),S.Oc(1,"-"),S.Rb())}function Ms(e,t){if(1&e&&(S.Mc(0,_s,4,4,"span",10),S.Mc(1,ks,2,0,"span",10)),2&e){const e=t.value;S.pc("ngIf",e),S.yb(1),S.pc("ngIf",!e)}}function Ns(e,t){if(1&e&&(S.Oc(0," You are about to flatten "),S.Sb(1,"strong"),S.Oc(2),S.Rb(),S.Oc(3,". "),S.Nb(4,"br"),S.Nb(5,"br"),S.Oc(6," All blocks will be copied from parent "),S.Sb(7,"strong"),S.Oc(8),S.Rb(),S.Oc(9," to child "),S.Sb(10,"strong"),S.Oc(11),S.Rb(),S.Oc(12,".\n")),2&e){const e=t.$implicit;S.yb(2),S.Pc(e.child),S.yb(6),S.Pc(e.parent),S.yb(3),S.Pc(e.child)}}function Is(e,t){if(1&e&&(S.Sb(0,"li"),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.yb(1),S.Pc(e)}}function $s(e,t){if(1&e&&(S.Qb(0),S.Sb(1,"span"),S.Wb(2,14),S.Rb(),S.Sb(3,"ul"),S.Mc(4,Is,2,1,"li",15),S.Rb(),S.Pb()),2&e){const e=S.ic(2).snapshots;S.yb(4),S.pc("ngForOf",e)}}function Ts(e,t){if(1&e&&(S.Sb(0,"div",12),S.Sb(1,"span"),S.Wb(2,13),S.Rb(),S.Nb(3,"br"),S.Mc(4,$s,5,1,"ng-container",10),S.Rb()),2&e){const e=S.ic().snapshots;S.yb(4),S.pc("ngIf",e.length>0)}}function Fs(e,t){1&e&&S.Mc(0,Ts,5,1,"div",11),2&e&&S.pc("ngIf",t.hasSnapshots)}const Ps=function(e,t){return[e,t]};function zs(e,t){if(1&e&&S.Nb(0,"i",17),2&e){const e=S.ic(2);S.pc("ngClass",S.vc(1,Ps,e.icons.spinner,e.icons.spin))}}function Es(e,t){if(1&e&&(S.Sb(0,"span",17),S.Oc(1),S.Rb()),2&e){const e=S.ic(),t=e.column,a=e.row;S.pc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.executingClass?t.customTemplateConfig.executingClass:"text-muted italic"),S.yb(1),S.Qc(" (",a.cdExecuting,") ")}}function Cs(e,t){if(1&e&&(S.Sb(0,"i",19),S.Yb(1,20),S.Rb()),2&e){const e=S.ic(2);S.Bb("",e.icons.warning," warn")}}function Ds(e,t){if(1&e&&(S.Mc(0,zs,1,4,"i",16),S.Sb(1,"span",17),S.Oc(2),S.Rb(),S.Mc(3,Es,2,2,"span",16),S.Mc(4,Cs,2,3,"i",18)),2&e){const e=t.column,a=t.value,i=t.row;S.pc("ngIf",i.cdExecuting),S.yb(1),S.pc("ngClass",null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.valueClass),S.yb(1),S.Qc(" ",a," "),S.yb(1),S.pc("ngIf",i.cdExecuting),S.yb(1),S.pc("ngIf",i.source&&"REMOVING"===i.source)}}let Os=(()=>{class e extends at.a{constructor(e,t,a,i,o,s,n,r,c){super(),this.authStorageService=e,this.rbdService=t,this.dimlessBinaryPipe=a,this.dimlessPipe=i,this.modalService=o,this.taskWrapper=s,this.taskListService=n,this.urlBuilder=r,this.actionLabels=c,this.tableStatus=new Pa.a,this.selection=new nt.a,this.icons=N.a,this.builders={"rbd/create":e=>this.createRbdFromTask(e.pool_name,e.namespace,e.image_name),"rbd/delete":e=>this.createRbdFromTaskImageSpec(e.image_spec),"rbd/clone":e=>this.createRbdFromTask(e.child_pool_name,e.child_namespace,e.child_image_name),"rbd/copy":e=>this.createRbdFromTask(e.dest_pool_name,e.dest_namespace,e.dest_image_name)},this.permission=this.authStorageService.getPermissions().rbdImage;const l=()=>this.selection.first()&&new R.a(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name).toStringEncoded();this.tableActions=[{permission:"create",icon:N.a.add,routerLink:()=>this.urlBuilder.getCreate(),canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:N.a.edit,routerLink:()=>this.urlBuilder.getEdit(l()),name:this.actionLabels.EDIT,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)},{permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||!!e.first().cdExecuting,icon:N.a.copy,routerLink:()=>"/block/rbd/copy/"+l(),name:this.actionLabels.COPY},{permission:"update",disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||e.first().cdExecuting||!e.first().parent,icon:N.a.flatten,click:()=>this.flattenRbdModal(),name:this.actionLabels.FLATTEN},{permission:"delete",icon:N.a.destroy,click:()=>this.deleteRbdModal(),name:this.actionLabels.DELETE,disable:e=>this.getDeleteDisableDesc(e)},{permission:"delete",icon:N.a.trash,click:()=>this.trashRbdModal(),name:this.actionLabels.TRASH,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||e.first().image_format===vi.V1}]}createRbdFromTaskImageSpec(e){const t=R.a.fromString(e);return this.createRbdFromTask(t.poolName,t.namespace,t.imageName)}createRbdFromTask(e,t,a){const i=new Si;return i.id="-1",i.unique_id="-1",i.name=a,i.namespace=t,i.pool_name=e,i.image_format=vi.V2,i}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:2,cellTemplate:this.removingStatTpl},{name:"Pool",prop:"pool_name",flexGrow:2},{name:"Namespace",prop:"namespace",flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Objects",prop:"num_objs",flexGrow:1,cellClass:"text-right",pipe:this.dimlessPipe},{name:"Object size",prop:"obj_size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe},{name:"Total provisioned",prop:"total_disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe},{name:"Parent",prop:"parent",flexGrow:2,cellTemplate:this.parentTpl}],this.taskListService.init(()=>this.rbdService.list(),e=>this.prepareResponse(e),e=>this.images=e,()=>this.onFetchError(),e=>["rbd/clone","rbd/copy","rbd/create","rbd/delete","rbd/edit","rbd/flatten","rbd/trash/move"].includes(e.name),(e,t)=>{let a;switch(t.name){case"rbd/copy":a=new R.a(t.metadata.dest_pool_name,t.metadata.dest_namespace,t.metadata.dest_image_name).toString();break;case"rbd/clone":a=new R.a(t.metadata.child_pool_name,t.metadata.child_namespace,t.metadata.child_image_name).toString();break;case"rbd/create":a=new R.a(t.metadata.pool_name,t.metadata.namespace,t.metadata.image_name).toString();break;default:a=t.metadata.image_spec}return a===new R.a(e.pool_name,e.namespace,e.name).toString()},this.builders)}onFetchError(){this.table.reset(),this.tableStatus=new Pa.a(So.a.ValueException)}prepareResponse(e){let t=[];const a={};let i;if(e.forEach(e=>{m.a.isUndefined(a[e.status])&&(a[e.status]=[]),a[e.status].push(e.pool_name),t=t.concat(e.value)}),a[So.a.ValueException]?i=So.a.ValueException:a[So.a.ValueStale]?i=So.a.ValueStale:a[So.a.ValueNone]&&(i=So.a.ValueNone),i){const e=(a[i].length>1?"pools ":"pool ")+a[i].join();this.tableStatus=new Pa.a(i,e)}else this.tableStatus=new Pa.a;return t}updateSelection(e){this.selection=e}deleteRbdModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().name,i=new R.a(e,t,a);this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD",itemNames:[i],bodyTemplate:this.deleteTpl,bodyContext:{hasSnapshots:this.hasSnapshots(),snapshots:this.listProtectedSnapshots()},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/delete",{image_spec:i.toString()}),call:this.rbdService.delete(i)})})}trashRbdModal(){const e={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,hasSnapshots:this.hasSnapshots()};this.modalRef=this.modalService.show($o,e)}flattenRbd(e){this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/flatten",{image_spec:e.toString()}),call:this.rbdService.flatten(e)}).subscribe({complete:()=>{this.modalRef.close()}})}flattenRbdModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().name,i=this.selection.first().parent,o=new R.a(i.pool_name,i.pool_namespace,i.image_name),s=new R.a(e,t,a),n={titleText:"RBD flatten",buttonText:"Flatten",bodyTpl:this.flattenTpl,bodyData:{parent:`${o}@${i.snap_name}`,child:s.toString()},onSubmit:()=>{this.flattenRbd(s)}};this.modalRef=this.modalService.show(go.a,n)}hasSnapshots(){return(this.selection.first().snapshots||[]).length>0}hasClonedSnapshots(e){return(e.snapshots||[]).some(e=>e.children&&e.children.length>0)}listProtectedSnapshots(){return this.selection.first().snapshots.reduce((e,t)=>(t.is_protected&&e.push(t.name),e),[])}getDeleteDisableDesc(e){const t=e.first();return t&&this.hasClonedSnapshots(t)?"This RBD has cloned snapshots. Please delete related RBDs before deleting this RBD.":this.getInvalidNameDisable(e)||this.hasClonedSnapshots(e.first())}getInvalidNameDisable(e){var t;const a=e.first();return(null===(t=null==a?void 0:a.name)||void 0===t?void 0:t.match(/[@/]/))?"This RBD image has an invalid name and can't be managed by ceph.":!e.first()||!e.hasSingleSelection}getRemovingStatusDesc(e){const t=e.first();return"REMOVING"===(null==t?void 0:t.source)&&"Action not possible for an RBD in status 'Removing'"}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(_),S.Mb(hi.a),S.Mb(jt.a),S.Mb(P.a),S.Mb(z.a),S.Mb(bt.a),S.Mb(vo.a),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-list"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(ot.a,!0),S.Tc(fs,!0),S.Jc(hs,!0),S.Tc(gs,!0),S.Jc(Ss,!0),S.Jc(vs,!0),S.Jc(ys,!0)),2&e&&(S.zc(a=S.hc())&&(t.table=a.first),S.zc(a=S.hc())&&(t.usageTpl=a.first),S.zc(a=S.hc())&&(t.parentTpl=a.first),S.zc(a=S.hc())&&(t.nameTpl=a.first),S.zc(a=S.hc())&&(t.flattenTpl=a.first),S.zc(a=S.hc())&&(t.deleteTpl=a.first),S.zc(a=S.hc())&&(t.removingStatTpl=a.first))},features:[S.xb([bt.a,{provide:vo.a,useValue:new vo.a("block/rbd")}]),S.vb],decls:15,vars:10,consts:function(){return[["columnMode","flex","identifier","unique_id","forceIdentifier","true","selectionType","single",3,"data","columns","searchableObjects","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["usageNotAvailableTooltipTpl",""],["parentTpl",""],["flattenTpl",""],["deleteTpl",""],["removingStatTpl",""],[3,"innerHtml"],[4,"ngIf"],["class","alert alert-warning","role","alert",4,"ngIf"],["role","alert",1,"alert","alert-warning"],"Deleting this image will also delete all its snapshots.","The following snapshots are currently protected and will be removed:",[4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[3,"class",4,"ngIf",6,"title"],[6,"title"],["title","RBD in status 'Removing'"]]},template:function(e,t){1&e&&(S.Nb(0,"cd-rbd-tabs"),S.Sb(1,"cd-table",0,1),S.gc("fetchData",(function(){return t.taskListService.fetch()}))("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)})),S.Nb(3,"cd-table-actions",2),S.Nb(4,"cd-rbd-details",3),S.Rb(),S.Mc(5,Rs,1,1,"ng-template",null,4,S.Nc),S.Mc(7,Ms,2,2,"ng-template",null,5,S.Nc),S.Mc(9,Ns,13,3,"ng-template",null,6,S.Nc),S.Mc(11,Fs,1,1,"ng-template",null,7,S.Nc),S.Mc(13,Ds,5,5,"ng-template",null,8,S.Nc)),2&e&&(S.yb(1),S.pc("data",t.images)("columns",t.columns)("searchableObjects",!0)("hasDetails",!0)("status",t.tableStatus)("autoReload",-1),S.yb(2),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),S.yb(1),S.pc("selection",t.expandedRow))},directives:[Fo,ot.a,Mt.a,us,i.r,i.q,i.p],styles:[".warn[_ngcontent-%COMP%]{color:#ffc200}"]}),e})();function As(e,t){1&e&&S.Nb(0,"input",19)}function xs(e,t){1&e&&(S.Sb(0,"option",23),S.Wb(1,24),S.Rb()),2&e&&S.pc("ngValue",null)}function Vs(e,t){1&e&&(S.Sb(0,"option",23),S.Wb(1,25),S.Rb()),2&e&&S.pc("ngValue",null)}function Ws(e,t){1&e&&(S.Sb(0,"option",23),S.Wb(1,26),S.Rb()),2&e&&S.pc("ngValue",null)}function qs(e,t){if(1&e&&(S.Sb(0,"option",27),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e.pool_name),S.yb(1),S.Pc(e.pool_name)}}function Bs(e,t){if(1&e&&(S.Sb(0,"select",20),S.Mc(1,xs,2,1,"option",21),S.Mc(2,Vs,2,1,"option",21),S.Mc(3,Ws,2,1,"option",21),S.Mc(4,qs,2,2,"option",22),S.Rb()),2&e){const e=S.ic();S.yb(1),S.pc("ngIf",null===e.pools),S.yb(1),S.pc("ngIf",null!==e.pools&&0===e.pools.length),S.yb(1),S.pc("ngIf",null!==e.pools&&e.pools.length>0),S.yb(1),S.pc("ngForOf",e.pools)}}function Gs(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,29),S.Rb())}function Ls(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,30),S.Rb())}function js(e,t){1&e&&(S.Sb(0,"span",28),S.Wb(1,31),S.Rb())}let Qs=(()=>{class e{constructor(e,t,a,i,o,s){this.activeModal=e,this.actionLabels=t,this.authStorageService=a,this.notificationService=i,this.poolService=o,this.rbdService=s,this.pools=null,this.editing=!1,this.poolPermission=this.authStorageService.getPermissions().pool,this.createForm()}createForm(){this.namespaceForm=new $.a({pool:new o.h(""),namespace:new o.h("")},this.validator(),this.asyncValidator())}validator(){return e=>{const t=e.get("pool"),a=e.get("namespace");let i=null;t.value||(i={required:!0}),t.setErrors(i);let o=null;return a.value||(o={required:!0}),a.setErrors(o),null}}asyncValidator(){return e=>new Promise(t=>{const a=e.get("pool"),i=e.get("namespace");this.rbdService.listNamespaces(a.value).subscribe(e=>{if(e.some(e=>e.namespace===i.value)){const e={namespaceExists:!0};i.setErrors(e),t(e)}else t(null)})})}ngOnInit(){this.onSubmit=new Ao.a,this.poolPermission.read&&this.poolService.list(["pool_name","type","application_metadata"]).then(e=>{const t=[];for(const a of e)this.rbdService.isRBDPool(a)&&"replicated"===a.type&&t.push(a);if(this.pools=t,1===this.pools.length){const e=this.pools[0].pool_name;this.namespaceForm.get("pool").setValue(e)}})}submit(){const e=this.namespaceForm.getValue("pool"),t=this.namespaceForm.getValue("namespace"),a=new F.a;a.name="rbd/namespace/create",a.metadata={pool:e,namespace:t},this.rbdService.createNamespace(e,t).toPromise().then(()=>{this.notificationService.show(dt.a.success,"Created namespace '" + e + "/" + t + "'"),this.activeModal.close(),this.onSubmit.next()}).catch(()=>{this.namespaceForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(r.a),S.Mb(l.b),S.Mb(lt.a),S.Mb(pt.a),S.Mb(ui.a),S.Mb(_))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-namespace-form-modal"]],decls:23,vars:9,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Create Namespace",[1,"modal-content"],["name","namespaceForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","pool",1,"cd-col-form-label","required"],"Pool",[1,"cd-col-form-input"],["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","namespace",1,"cd-col-form-label","required"],"Name",["type","text","placeholder","Namespace name...","id","namespace","name","namespace","formControlName","namespace","autofocus","",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],"Loading...","-- No rbd pools available --","-- Select a pool --",[3,"value"],[1,"invalid-feedback"],"This field is required.","This field is required.","Namespace already exists."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"div",7),S.Sb(8,"label",8),S.Wb(9,9),S.Rb(),S.Sb(10,"div",10),S.Mc(11,As,1,0,"input",11),S.Mc(12,Bs,5,4,"select",12),S.Mc(13,Gs,2,0,"span",13),S.Rb(),S.Rb(),S.Sb(14,"div",7),S.Sb(15,"label",14),S.Wb(16,15),S.Rb(),S.Sb(17,"div",10),S.Nb(18,"input",16),S.Mc(19,Ls,2,0,"span",13),S.Mc(20,js,2,0,"span",13),S.Rb(),S.Rb(),S.Rb(),S.Sb(21,"div",17),S.Sb(22,"cd-form-button-panel",18),S.gc("submitActionEvent",(function(){return t.submit()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.namespaceForm),S.yb(7),S.pc("ngIf",!t.poolPermission.read),S.yb(1),S.pc("ngIf",t.poolPermission.read),S.yb(1),S.pc("ngIf",t.namespaceForm.showError("pool",e,"required")),S.yb(6),S.pc("ngIf",t.namespaceForm.showError("namespace",e,"required")),S.yb(1),S.pc("ngIf",t.namespaceForm.showError("namespace",e,"namespaceExists")),S.yb(2),S.pc("form",t.namespaceForm)("submitText",t.actionLabels.CREATE)}},directives:[E.a,o.C,o.r,o.k,C.a,D.a,i.r,O.a,o.d,A.a,o.q,o.i,ha.a,x.a,o.z,i.q,o.u,o.B],styles:[""]}),e})(),Us=(()=>{class e{constructor(e,t,a,i,o,s){this.authStorageService=e,this.rbdService=t,this.poolService=a,this.modalService=i,this.notificationService=o,this.actionLabels=s,this.selection=new nt.a,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"create",icon:N.a.add,click:()=>this.createModal(),name:this.actionLabels.CREATE},{permission:"delete",icon:N.a.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Pool",prop:"pool",flexGrow:1},{name:"Total images",prop:"num_images",flexGrow:1}],this.refresh()}refresh(){this.poolService.list(["pool_name","type","application_metadata"]).then(e=>{e=e.filter(e=>this.rbdService.isRBDPool(e)&&"replicated"===e.type);const t=[];e.forEach(e=>{t.push(this.rbdService.listNamespaces(e.pool_name))}),t.length>0?Object(u.a)(t).subscribe(t=>{const a=[];for(let i=0;i<t.length;i++){const o=e[i].pool_name;t[i].forEach(e=>{a.push({id:`${o}/${e.namespace}`,pool:o,namespace:e.namespace,num_images:e.num_images})})}this.namespaces=a}):this.namespaces=[]})}updateSelection(e){this.selection=e}createModal(){this.modalRef=this.modalService.show(Qs),this.modalRef.componentInstance.onSubmit.subscribe(()=>{this.refresh()})}deleteModal(){const e=this.selection.first().pool,t=this.selection.first().namespace;this.modalRef=this.modalService.show(it.a,{itemDescription:"Namespace",itemNames:[`${e}/${t}`],submitAction:()=>this.rbdService.deleteNamespace(e,t).subscribe(()=>{this.notificationService.show(dt.a.success,"Deleted namespace '" + e + "/" + t + "'"),this.modalRef.close(),this.refresh()},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})})}getDeleteDisableDesc(){var e;const t=this.selection.first();return(null==t?void 0:t.num_images)>0?"Namespace contains images":!(null===(e=this.selection)||void 0===e?void 0:e.first())}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(_),S.Mb(ui.a),S.Mb(P.a),S.Mb(pt.a),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-namespace-list"]],features:[S.xb([bt.a])],decls:4,vars:5,consts:[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(S.Nb(0,"cd-rbd-tabs"),S.Sb(1,"cd-table",0),S.gc("fetchData",(function(){return t.refresh()}))("updateSelection",(function(e){return t.updateSelection(e)})),S.Sb(2,"div",1),S.Nb(3,"cd-table-actions",2),S.Rb(),S.Rb()),2&e&&(S.yb(1),S.pc("data",t.namespaces)("columns",t.columns),S.yb(2),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Fo,ot.a,Mt.a],styles:[""]}),e})(),Ys=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-performance"]],decls:2,vars:1,consts:[["uid","41FrpeUiz","grafanaStyle","two",3,"grafanaPath"]],template:function(e,t){1&e&&(S.Nb(0,"cd-rbd-tabs"),S.Nb(1,"cd-grafana",0)),2&e&&(S.yb(1),S.pc("grafanaPath","rbd-overview?"))},directives:[Fo,Uo.a],styles:[""]}),e})();function Ks(e,t){1&e&&(S.Sb(0,"input",15),S.Yb(1,16),S.Rb())}function Js(e,t){if(1&e&&(S.Sb(0,"option",21),S.Oc(1),S.Rb()),2&e){const e=t.$implicit;S.pc("value",e),S.yb(1),S.Pc(e)}}function Xs(e,t){if(1&e&&(S.Sb(0,"select",17),S.Sb(1,"option",18),S.Wb(2,19),S.Rb(),S.Mc(3,Js,2,2,"option",20),S.Rb()),2&e){const e=S.ic();S.yb(3),S.pc("ngForOf",e.pools)}}let Hs=(()=>{class e{constructor(e,t,a,i,o,s,n){this.authStorageService=e,this.rbdService=t,this.activeModal=a,this.actionLabels=i,this.fb=o,this.poolService=s,this.taskWrapper=n,this.poolPermission=this.authStorageService.getPermissions().pool}createForm(){this.purgeForm=this.fb.group({poolName:""})}ngOnInit(){this.poolPermission.read&&this.poolService.list(["pool_name","application_metadata"]).then(e=>{this.pools=e.filter(e=>e.application_metadata.includes("rbd")).map(e=>e.pool_name)}),this.createForm()}purge(){const e=this.purgeForm.getValue("poolName")||"";this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/trash/purge",{pool_name:e}),call:this.rbdService.purgeTrash(e)}).subscribe({error:()=>{this.purgeForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(_),S.Mb(r.a),S.Mb(l.b),S.Mb(wo.a),S.Mb(ui.a),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-trash-purge-modal"]],decls:18,vars:6,consts:function(){var e,t;return e="Purge Trash",t="To purge, select\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "All" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + "\xA0 or one pool and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Purge" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".\xA0",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","purgeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t=S.bc(t),[1,"form-group"],[1,"col-form-label","mx-auto"],"Pool:",["class","form-control","type","text","formControlName","poolName",4,"ngIf",6,"placeholder"],["id","poolName","name","poolName","class","form-control custom-select","formControlName","poolName",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","formControlName","poolName",1,"form-control",6,"placeholder"],["placeholder","Pool name..."],["id","poolName","name","poolName","formControlName","poolName",1,"form-control","custom-select"],["value",""],"All",[3,"value",4,"ngFor","ngForOf"],[3,"value"]]},template:function(e,t){1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.cc(8,7),S.Nb(9,"kbd"),S.Nb(10,"kbd"),S.Zb(),S.Rb(),S.Sb(11,"div",8),S.Sb(12,"label",9),S.Wb(13,10),S.Rb(),S.Mc(14,Ks,2,0,"input",11),S.Mc(15,Xs,4,1,"select",12),S.Rb(),S.Rb(),S.Sb(16,"div",13),S.Sb(17,"cd-form-button-panel",14),S.gc("submitActionEvent",(function(){return t.purge()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e&&(S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.purgeForm),S.yb(10),S.pc("ngIf",!t.poolPermission.read),S.yb(1),S.pc("ngIf",t.poolPermission.read),S.yb(2),S.pc("form",t.purgeForm)("submitText",t.actionLabels.PURGE))},directives:[E.a,o.C,o.r,o.k,C.a,D.a,i.r,x.a,O.a,o.d,A.a,o.q,o.i,o.z,o.u,o.B,i.q],styles:[""]}),e})();function Zs(e,t){1&e&&(S.Sb(0,"span",15),S.Wb(1,16),S.Rb())}let en=(()=>{class e{constructor(e,t,a,i,o){this.rbdService=e,this.activeModal=t,this.actionLabels=a,this.fb=i,this.taskWrapper=o}ngOnInit(){this.imageSpec=new R.a(this.poolName,this.namespace,this.imageName).toString(),this.restoreForm=this.fb.group({name:this.imageName})}restore(){const e=this.restoreForm.getValue("name"),t=new R.a(this.poolName,this.namespace,this.imageId);this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/trash/restore",{image_id_spec:t.toString(),new_image_name:e}),call:this.rbdService.restoreTrash(t,e)}).subscribe({error:()=>{this.restoreForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(_),S.Mb(r.a),S.Mb(l.b),S.Mb(wo.a),S.Mb(z.a))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-trash-restore-modal"]],decls:18,vars:7,consts:function(){var e,t;return e="Restore Image",t="To restore\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "" + "\ufffd0\ufffd" + "@" + "\ufffd1\ufffd" + "" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ",\xA0 type the image's new name and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Restore" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","restoreForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t=S.bc(t),[1,"form-group"],["for","name",1,"col-form-label"],"New Name",["type","text","name","name","id","name","autocomplete","off","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required."]},template:function(e,t){if(1&e&&(S.Sb(0,"cd-modal",0),S.Qb(1,1),S.Wb(2,2),S.Pb(),S.Qb(3,3),S.Sb(4,"form",4,5),S.Sb(6,"div",6),S.Sb(7,"p"),S.cc(8,7),S.Nb(9,"kbd"),S.Nb(10,"kbd"),S.Zb(),S.Rb(),S.Sb(11,"div",8),S.Sb(12,"label",9),S.Wb(13,10),S.Rb(),S.Nb(14,"input",11),S.Mc(15,Zs,2,0,"span",12),S.Rb(),S.Rb(),S.Sb(16,"div",13),S.Sb(17,"cd-form-button-panel",14),S.gc("submitActionEvent",(function(){return t.restore()})),S.Rb(),S.Rb(),S.Rb(),S.Pb(),S.Rb()),2&e){const e=S.Ac(5);S.pc("modalRef",t.activeModal),S.yb(4),S.pc("formGroup",t.restoreForm),S.yb(6),S.ac(t.imageSpec)(t.imageId),S.Xb(8),S.yb(5),S.pc("ngIf",t.restoreForm.showError("name",e,"required")),S.yb(2),S.pc("form",t.restoreForm)("submitText",t.actionLabels.RESTORE)}},directives:[E.a,o.C,o.r,o.k,C.a,D.a,O.a,o.d,A.a,o.q,o.i,ha.a,i.r,x.a],styles:[""]}),e})();const tn=["expiresTpl"],an=["deleteTpl"],on=function(e){return[e]};function sn(e,t){if(1&e){const e=S.Tb();S.Sb(0,"button",6),S.gc("click",(function(){return S.Dc(e),S.ic().purgeModal()})),S.Nb(1,"i",7),S.Qb(2),S.Wb(3,8),S.Pb(),S.Rb()}if(2&e){const e=S.ic();S.pc("disabled",e.disablePurgeBtn),S.yb(1),S.pc("ngClass",S.uc(2,on,e.icons.destroy))}}function nn(e,t){1&e&&(S.Qb(0),S.Wb(1,10),S.Pb())}function rn(e,t){1&e&&(S.Qb(0),S.Wb(1,11),S.Pb())}function cn(e,t){if(1&e&&(S.Mc(0,nn,2,0,"ng-container",9),S.Mc(1,rn,2,0,"ng-container",9),S.Oc(2),S.jc(3,"cdDate")),2&e){const e=t.row,a=t.value;S.pc("ngIf",e.cdIsExpired),S.yb(1),S.pc("ngIf",!e.cdIsExpired),S.yb(1),S.Qc(" ",S.kc(3,3,a),"\n")}}function ln(e,t){if(1&e&&(S.Sb(0,"p",13),S.Sb(1,"strong"),S.Qb(2),S.Wb(3,14),S.jc(4,"cdDate"),S.Pb(),S.Rb(),S.Rb()),2&e){const e=S.ic().expiresAt;S.yb(4),S.ac(S.kc(4,1,e)),S.Xb(3)}}function bn(e,t){1&e&&S.Mc(0,ln,5,3,"p",12),2&e&&S.pc("ngIf",!t.isExpired)}let dn=(()=>{class e{constructor(e,t,a,i,o,s,n){this.authStorageService=e,this.rbdService=t,this.modalService=a,this.cdDatePipe=i,this.taskListService=o,this.taskWrapper=s,this.actionLabels=n,this.icons=N.a,this.executingTasks=[],this.selection=new nt.a,this.tableStatus=new Pa.a,this.disablePurgeBtn=!0,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"update",icon:N.a.undo,click:()=>this.restoreModal(),name:this.actionLabels.RESTORE},{permission:"delete",icon:N.a.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"ID",prop:"id",flexGrow:1,cellTransformation:st.a.executing},{name:"Name",prop:"name",flexGrow:1},{name:"Pool",prop:"pool_name",flexGrow:1},{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Status",prop:"deferment_end_time",flexGrow:1,cellTemplate:this.expiresTpl},{name:"Deleted At",prop:"deletion_time",flexGrow:1,pipe:this.cdDatePipe}],this.taskListService.init(()=>this.rbdService.listTrash(),e=>this.prepareResponse(e),e=>this.images=e,()=>this.onFetchError(),e=>["rbd/trash/remove","rbd/trash/restore"].includes(e.name),(e,t)=>new R.a(e.pool_name,e.namespace,e.id).toString()===t.metadata.image_id_spec,void 0)}prepareResponse(e){let t=[];const a={};let i;if(e.forEach(e=>{m.a.isUndefined(a[e.status])&&(a[e.status]=[]),a[e.status].push(e.pool_name),t=t.concat(e.value),this.disablePurgeBtn=!t.length}),a[3]?i=3:a[1]?i=1:a[2]&&(i=2),i){const e=(a[i].length>1?"pools ":"pool ")+a[i].join();this.tableStatus=new Pa.a(i,e)}else this.tableStatus=new Pa.a;return t.forEach(e=>{e.cdIsExpired=Ro()().isAfter(e.deferment_end_time)}),t}onFetchError(){this.table.reset(),this.tableStatus=new Pa.a(So.a.ValueException)}updateSelection(e){this.selection=e}restoreModal(){const e={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,imageId:this.selection.first().id};this.modalRef=this.modalService.show(en,e)}deleteModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().id,i=this.selection.first().deferment_end_time,o=Ro()().isAfter(i),s=new R.a(e,t,a);this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD",itemNames:[s],bodyTemplate:this.deleteTpl,bodyContext:{expiresAt:i,isExpired:o},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.a("rbd/trash/remove",{image_id_spec:s.toString()}),call:this.rbdService.removeTrash(s,!0)})})}purgeModal(){this.modalService.show(Hs)}}return e.\u0275fac=function(t){return new(t||e)(S.Mb(lt.a),S.Mb(_),S.Mb(P.a),S.Mb(Co.a),S.Mb(bt.a),S.Mb(z.a),S.Mb(l.b))},e.\u0275cmp=S.Gb({type:e,selectors:[["cd-rbd-trash-list"]],viewQuery:function(e,t){var a;1&e&&(S.Jc(ot.a,!0),S.Jc(tn,!0),S.Jc(an,!0)),2&e&&(S.zc(a=S.hc())&&(t.table=a.first),S.zc(a=S.hc())&&(t.expiresTpl=a.first),S.zc(a=S.hc())&&(t.deleteTpl=a.first))},features:[S.xb([bt.a])],decls:9,vars:8,consts:function(){return[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","status","autoReload","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["class","btn btn-light","type","button",3,"disabled","click",4,"ngIf"],["expiresTpl",""],["deleteTpl",""],["type","button",1,"btn","btn-light",3,"disabled","click"],["aria-hidden","true",3,"ngClass"],"Purge Trash",[4,"ngIf"],"Expired at","Protected until",["class","text-danger",4,"ngIf"],[1,"text-danger"],"This image is protected until " + "\ufffd0\ufffd" + "."]},template:function(e,t){1&e&&(S.Nb(0,"cd-rbd-tabs"),S.Sb(1,"cd-table",0),S.gc("fetchData",(function(){return t.taskListService.fetch()}))("updateSelection",(function(e){return t.updateSelection(e)})),S.Sb(2,"div",1),S.Nb(3,"cd-table-actions",2),S.Mc(4,sn,4,4,"button",3),S.Rb(),S.Rb(),S.Mc(5,cn,4,5,"ng-template",null,4,S.Nc),S.Mc(7,bn,1,1,"ng-template",null,5,S.Nc)),2&e&&(S.yb(1),S.pc("data",t.images)("columns",t.columns)("status",t.tableStatus)("autoReload",-1),S.yb(2),S.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),S.yb(1),S.pc("ngIf",t.permission.delete))},directives:[Fo,ot.a,Mt.a,i.r,O.a,i.p],pipes:[Co.a],styles:[""]}),e})(),pn=(()=>{class e{}return e.\u0275mod=S.Kb({type:e}),e.\u0275inj=S.Jb({factory:function(t){return new(t||e)},imports:[[i.c,ra,o.m,o.x,r.t,r.y,r.F,c.a,d.a,s.i,n.c]]}),e})();const mn=[{path:"",redirectTo:"rbd",pathMatch:"full"},{path:"rbd",canActivate:[b.a],data:{breadcrumbs:"Images"},children:[{path:"",component:Os},{path:"namespaces",component:Us,data:{breadcrumbs:"Namespaces"}},{path:"trash",component:dn,data:{breadcrumbs:"Trash"}},{path:"performance",component:Ys,data:{breadcrumbs:"Overall Performance"}},{path:l.e.CREATE,component:ho,data:{breadcrumbs:l.a.CREATE}},{path:l.e.EDIT+"/:image_spec",component:ho,data:{breadcrumbs:l.a.EDIT}},{path:l.e.CLONE+"/:image_spec/:snap",component:ho,data:{breadcrumbs:l.a.CLONE}},{path:l.e.COPY+"/:image_spec",component:ho,data:{breadcrumbs:l.a.COPY}},{path:l.e.COPY+"/:image_spec/:snap",component:ho,data:{breadcrumbs:l.a.COPY}}]},{path:"mirroring",component:bi,canActivate:[b.a],data:{breadcrumbs:"Mirroring"}},{path:"iscsi",canActivate:[b.a],data:{breadcrumbs:"iSCSI"},children:[{path:"",redirectTo:"overview",pathMatch:"full"},{path:"overview",component:na,data:{breadcrumbs:"Overview"}},{path:"targets",data:{breadcrumbs:"Targets"},children:[{path:"",component:Lt},{path:l.e.CREATE,component:tt,data:{breadcrumbs:l.a.CREATE}},{path:l.e.EDIT+"/:target_iqn",component:tt,data:{breadcrumbs:l.a.EDIT}}]}]}];let un=(()=>{class e{}return e.\u0275mod=S.Kb({type:e}),e.\u0275inj=S.Jb({factory:function(t){return new(t||e)},imports:[[pn,s.i.forChild(mn)]]}),e})()},nQ07:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var i=a("LvDl"),o=a.n(i);class s{static updateChanged(e,t){let a=!1;return Object.keys(t).forEach(i=>{const s=t[i];o.a.isEqual(s,e[i])||(e[i]=s,a=!0)}),a}}},rFfW:function(e,t,a){"use strict";a.d(t,"a",(function(){return P}));var i=a("8Y7J"),o=a("s7LF"),s=a("LvDl"),n=a.n(s),r=a("jtHE"),c=a("oxzT"),l=a("QFaf"),b=a("PhyI"),d=a("aXbf"),p=a("o8EM"),m=a("NwgZ"),u=a("SVse"),f=a("ocLN"),h=a("p4Cf"),g=a("ANnk"),S=a("f69J");let v=(()=>{class e{constructor(e,t){this.control=e,this.formatter=t}setValue(e){const t=this.formatter.toMilliseconds(e);this.control.control.setValue(t+" ms")}ngOnInit(){this.setValue(this.control.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.control.value))}onUpdate(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(o.p),i.Mb(d.a))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdMilliseconds",""]],hostBindings:function(e,t){1&e&&i.gc("blur",(function(e){return t.onUpdate(e.target.value)}))},inputs:{ngDataReady:"ngDataReady"}}),e})();var y=a("IzCI");let R=(()=>{class e{constructor(e,t,a,o){this.elementRef=e,this.control=t,this.dimlessBinaryPerSecondPipe=a,this.formatter=o,this.ngModelChange=new i.o,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.el.value))}setValue(e){/^[\d.]+$/.test(e)&&(e+=this.defaultUnit||"m");const t=this.formatter.toBytes(e,0),a=this.round(t);this.el.value=this.dimlessBinaryPerSecondPipe.transform(a),null!==t?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(e){if(null!==e&&0!==e){if(!n.a.isUndefined(this.minBytes)&&e<this.minBytes)return this.minBytes;if(!n.a.isUndefined(this.maxBytes)&&e>this.maxBytes)return this.maxBytes;if(!n.a.isUndefined(this.roundPower)){const t=Math.round(Math.log(e)/Math.log(this.roundPower));return Math.pow(this.roundPower,t)}}return e}onBlur(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(o.p),i.Mb(y.a),i.Mb(d.a))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdDimlessBinaryPerSecond",""]],hostBindings:function(e,t){1&e&&i.gc("blur",(function(e){return t.onBlur(e.target.value)}))},inputs:{ngDataReady:"ngDataReady",minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),e})(),w=(()=>{class e{constructor(e,t){this.formatter=e,this.ngControl=t}setValue(e){const t=this.formatter.toIops(e);this.ngControl.control.setValue(t+" IOPS")}ngOnInit(){this.setValue(this.ngControl.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.ngControl.value))}onUpdate(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(d.a),i.Mb(o.p))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdIops",""]],hostBindings:function(e,t){1&e&&i.gc("blur",(function(e){return t.onUpdate(e.target.value)}))},inputs:{ngDataReady:"ngDataReady"}}),e})();function _(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"input",19),i.Pb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(1),i.pc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function k(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"input",20),i.Pb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(1),i.pc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function M(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"input",21),i.Pb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(1),i.pc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function N(e,t){1&e&&(i.Sb(0,"span",22),i.Wb(1,23),i.Rb())}const I=function(e){return{active:e}},$=function(e){return[e]};function T(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",11),i.Oc(2),i.Sb(3,"cd-helper"),i.Oc(4),i.Rb(),i.Rb(),i.Sb(5,"div"),i.Sb(6,"div",12),i.Qb(7,13),i.Mc(8,_,2,4,"ng-container",14),i.Mc(9,k,2,4,"ng-container",14),i.Mc(10,M,2,4,"ng-container",14),i.Pb(),i.Sb(11,"span",15),i.Sb(12,"button",16),i.Yb(13,17),i.gc("click",(function(){i.Dc(e);const a=t.$implicit;return i.ic(2).reset(a.name)})),i.Nb(14,"i",7),i.Rb(),i.Rb(),i.Rb(),i.Mc(15,N,2,0,"span",18),i.Rb(),i.Rb()}if(2&e){const e=t.$implicit,a=i.ic().$implicit,o=i.ic(),s=i.Ac(1);i.yb(1),i.pc("for",e.name),i.yb(1),i.Pc(e.displayName),i.yb(2),i.Pc(e.description),i.yb(1),i.Bb("cd-col-form-input ",a.heading,""),i.yb(2),i.pc("ngSwitch",e.type),i.yb(1),i.pc("ngSwitchCase",o.configurationType.milliseconds),i.yb(1),i.pc("ngSwitchCase",o.configurationType.bps),i.yb(1),i.pc("ngSwitchCase",o.configurationType.iops),i.yb(2),i.pc("ngClass",i.uc(13,I,o.isDisabled(e.name))),i.yb(2),i.pc("ngClass",i.uc(15,$,o.icons.erase)),i.yb(1),i.pc("ngIf",o.form.showError("configuration."+e.name,s,"min"))}}function F(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",4),i.Sb(1,"h4",5),i.Sb(2,"span",6),i.gc("click",(function(){i.Dc(e);const a=t.$implicit;return i.ic().toggleSectionVisibility(a.class)})),i.Oc(3),i.Nb(4,"i",7),i.Rb(),i.Rb(),i.Sb(5,"div",8),i.Mc(6,T,16,17,"div",9),i.Rb(),i.Rb()}if(2&e){const e=t.$implicit,a=i.ic();i.yb(3),i.Qc(" ",e.heading," "),i.yb(1),i.pc("ngClass",a.sectionVisibility[e.class]?a.icons.minusCircle:a.icons.addCircle),i.yb(1),i.Ab(e.class),i.pc("hidden",!a.sectionVisibility[e.class]),i.yb(1),i.pc("ngForOf",e.options)}}let P=(()=>{class e{constructor(e,t){this.formatterService=e,this.rbdConfigurationService=t,this.initializeData=new r.a(1),this.changes=new i.o,this.icons=c.a,this.ngDataReady=new i.o,this.configurationType=b.b,this.sectionVisibility={}}ngOnInit(){const e=this.createConfigurationFormGroup();this.form.addControl("configuration",e),e.valueChanges.subscribe(()=>{this.changes.emit(this.getDirtyValues.bind(this))}),this.initializeData&&this.initializeData.subscribe(e=>{this.initialData=e.initialData;const t=e.sourceType;this.rbdConfigurationService.getWritableOptionFields().forEach(a=>{const i=e.initialData.filter(e=>e.name===a.name).pop();i&&i.source===t&&this.form.get("configuration."+a.name).setValue(i.value)}),this.ngDataReady.emit()}),this.rbdConfigurationService.getWritableSections().forEach(e=>this.sectionVisibility[e.class]=!1)}getDirtyValues(e=!1,t){if(e&&!t)throw new Error("ProgrammingError: If local values shall be included, a proper localFieldType argument has to be provided, too");const a={};return this.rbdConfigurationService.getWritableOptionFields().forEach(i=>{const o=this.form.get("configuration").get(i.name);this.initialData&&this.initialData[i.name]===o.value||(o.dirty||e&&o.source===t)&&(a[i.name]=null===o.value?o.value:i.type===b.b.bps?this.formatterService.toBytes(o.value):i.type===b.b.milliseconds?this.formatterService.toMilliseconds(o.value):i.type===b.b.iops?this.formatterService.toIops(o.value):o.value)}),a}createConfigurationFormGroup(){const e=new l.a({});return this.rbdConfigurationService.getWritableOptionFields().forEach(t=>{let a;if(t.type!==b.b.milliseconds&&t.type!==b.b.iops&&t.type!==b.b.bps)throw new Error(`Type ${t.type} is unknown, you may need to add it to RbdConfiguration class`);{let e=0;n.a.forEach(this.initialData,a=>{a.name===t.name&&(e=a.value)}),a=new o.h(e,o.A.min(0))}e.addControl(t.name,a)}),e}reset(e){const t=this.form.get("configuration").get(e);t.disabled?(t.setValue(t.previousValue||0),t.enable(),t.previousValue||t.markAsPristine()):(t.previousValue=t.value,t.setValue(null),t.markAsDirty(),t.disable())}isDisabled(e){return this.form.get("configuration").get(e).disabled}toggleSectionVisibility(e){this.sectionVisibility[e]=!this.sectionVisibility[e]}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(d.a),i.Mb(p.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-rbd-configuration-form"]],inputs:{form:"form",initializeData:"initializeData"},outputs:{changes:"changes"},decls:5,vars:2,consts:function(){return[[3,"formGroup"],["cfgFormGroup",""],"RBD Configuration",["class","col-12",4,"ngFor","ngForOf"],[1,"col-12"],[1,"cd-header"],[1,"collapsible",3,"click"],["aria-hidden","true",3,"ngClass"],[3,"hidden"],["class","form-group row",4,"ngFor","ngForOf"],[1,"form-group","row"],[1,"cd-col-form-label",3,"for"],[1,"input-group"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"input-group-append"],["type","button","data-toggle","button",1,"btn","btn-light",3,"ngClass","click",6,"title"],["title","Remove the local configuration value. The parent configuration value will be inherited and used instead."],["class","invalid-feedback",4,"ngIf"],["type","text","cdMilliseconds","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","defaultUnit","b","cdDimlessBinaryPerSecond","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","cdIops","",1,"form-control",3,"id","name","formControlName","ngDataReady"],[1,"invalid-feedback"],"The minimum value is 0"]},template:function(e,t){1&e&&(i.Sb(0,"fieldset",0,1),i.Sb(2,"legend"),i.Wb(3,2),i.Rb(),i.Mc(4,F,7,7,"div",3),i.Rb()),2&e&&(i.pc("formGroup",t.form.get("configuration")),i.yb(4),i.pc("ngForOf",t.rbdConfigurationService.sections))},directives:[o.r,o.k,m.a,u.q,u.p,f.a,h.a,u.t,u.u,g.a,u.r,o.d,S.a,v,o.q,o.i,R,w],styles:[".collapsible[_ngcontent-%COMP%]{cursor:pointer;user-select:none}"]}),e})()}}]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.e0a29c1d4fcf893cf11d.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/1.e0a29c1d4fcf893cf11d.js
new file mode 100644 (file)
index 0000000..b6ed0b7
--- /dev/null
@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{aAWM:function(e,t,a){"use strict";a.d(t,"a",function(){return X});var i=a("uIqm"),o=a("PhyI"),s=a("8Y7J");let n=(()=>{class e{transform(e){return{0:"global",1:"pool",2:"image"}[e]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"rbdConfigurationSource",type:e,pure:!0}),e})();var c=a("aXbf"),r=a("o8EM"),l=a("SVse"),b=a("IzCI"),d=a("dEH0"),u=a("BQkM");const m=["configurationSourceTpl"],p=["configurationValueTpl"],f=["poolConfTable"];function h(e,t){1&e&&(s.Xb(0,"span"),s.bc(1,6),s.Wb())}function g(e,t){1&e&&(s.Xb(0,"strong"),s.bc(1,7),s.Wb())}function v(e,t){1&e&&(s.Xb(0,"strong"),s.bc(1,8),s.Wb())}function S(e,t){1&e&&(s.Xb(0,"div",4),s.Pc(1,h,2,0,"span",5),s.Pc(2,g,2,0,"strong",5),s.Pc(3,v,2,0,"strong",5),s.Wb()),2&e&&(s.uc("ngSwitch",t.value),s.Db(1),s.uc("ngSwitchCase","global"),s.Db(1),s.uc("ngSwitchCase","image"),s.Db(1),s.uc("ngSwitchCase","pool"))}function D(e,t){if(1&e&&(s.Xb(0,"span"),s.Rc(1),s.oc(2,"dimlessBinaryPerSecond"),s.Wb()),2&e){const e=s.nc().value;s.Db(1),s.Sc(s.pc(2,1,e))}}function w(e,t){if(1&e&&(s.Xb(0,"span"),s.Rc(1),s.oc(2,"milliseconds"),s.Wb()),2&e){const e=s.nc().value;s.Db(1),s.Sc(s.pc(2,1,e))}}function _(e,t){if(1&e&&(s.Xb(0,"span"),s.Rc(1),s.oc(2,"iops"),s.Wb()),2&e){const e=s.nc().value;s.Db(1),s.Sc(s.pc(2,1,e))}}function W(e,t){if(1&e&&(s.Xb(0,"span"),s.Rc(1),s.Wb()),2&e){const e=s.nc().value;s.Db(1),s.Sc(e)}}function y(e,t){if(1&e&&(s.Xb(0,"div",4),s.Pc(1,D,3,3,"span",5),s.Pc(2,w,3,3,"span",5),s.Pc(3,_,3,3,"span",5),s.Pc(4,W,2,1,"span",9),s.Wb()),2&e){const e=t.row,a=s.nc();s.uc("ngSwitch",e.type),s.Db(1),s.uc("ngSwitchCase",a.typeField.bps),s.Db(1),s.uc("ngSwitchCase",a.typeField.milliseconds),s.Db(1),s.uc("ngSwitchCase",a.typeField.iops)}}let X=(()=>{class e{constructor(e,t){this.formatterService=e,this.rbdConfigurationService=t,this.sourceField=o.a,this.typeField=o.b}ngOnInit(){this.poolConfigurationColumns=[{prop:"displayName",name:"Name"},{prop:"description",name:"Description"},{prop:"name",name:"Key"},{prop:"source",name:"Source",cellTemplate:this.configurationSourceTpl,pipe:new n},{prop:"value",name:"Value",cellTemplate:this.configurationValueTpl}]}ngOnChanges(){this.data&&(this.data=this.data.filter(e=>this.rbdConfigurationService.getOptionFields().map(e=>e.name).includes(e.name)))}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(c.a),s.Rb(r.a))},e.\u0275cmp=s.Lb({type:e,selectors:[["cd-rbd-configuration-table"]],viewQuery:function(e,t){if(1&e&&(s.Wc(m,3),s.Wc(p,3),s.Wc(f,3)),2&e){let e;s.Ec(e=s.mc())&&(t.configurationSourceTpl=e.first),s.Ec(e=s.mc())&&(t.configurationValueTpl=e.first),s.Ec(e=s.mc())&&(t.poolConfTable=e.first)}},inputs:{data:"data"},features:[s.Bb],decls:6,vars:2,consts:function(){let e,t,a;return e="Global",t="Image",a="Pool",[["identifier","name",3,"data","columns"],["poolConfTable",""],["configurationSourceTpl",""],["configurationValueTpl",""],[3,"ngSwitch"],[4,"ngSwitchCase"],e,t,a,[4,"ngSwitchDefault"]]},template:function(e,t){1&e&&(s.Sb(0,"cd-table",0,1),s.Pc(2,S,4,4,"ng-template",null,2,s.Qc),s.Pc(4,y,5,4,"ng-template",null,3,s.Qc)),2&e&&s.uc("data",t.data)("columns",t.poolConfigurationColumns)},directives:[i.a,l.t,l.u,l.v],pipes:[b.a,d.a,u.a],styles:[""]}),e})()},"k/xb":function(e,t,a){"use strict";a.r(t),a.d(t,"BlockModule",function(){return Dn}),a.d(t,"RoutedBlockModule",function(){return _n});var i=a("SVse"),o=a("s7LF"),s=a("iInd"),n=a("ohO+"),c=a("G0yt"),r=a("zWsK"),l=a("sne2"),b=a("Vhfg"),d=a("PCNd"),u=a("LvDl"),m=a.n(u),p=a("cp0P"),f=a("mrSG"),h=a("IheW"),g=a("xTzq"),v=a("8Y7J");let S=(()=>{let e=class{constructor(e){this.http=e}listTargets(){return this.http.get("api/iscsi/target")}getTarget(e){return this.http.get(`api/iscsi/target/${e}`)}updateTarget(e,t){return this.http.put(`api/iscsi/target/${e}`,t,{observe:"response"})}status(){return this.http.get("ui-api/iscsi/status")}settings(){return this.http.get("ui-api/iscsi/settings")}version(){return this.http.get("ui-api/iscsi/version")}portals(){return this.http.get("ui-api/iscsi/portals")}createTarget(e){return this.http.post("api/iscsi/target",e,{observe:"response"})}deleteTarget(e){return this.http.delete(`api/iscsi/target/${e}`,{observe:"response"})}getDiscovery(){return this.http.get("api/iscsi/discoveryauth")}updateDiscovery(e){return this.http.put("api/iscsi/discoveryauth",e)}overview(){return this.http.get("ui-api/iscsi/overview")}};return e.\u0275fac=function(t){return new(t||e)(v.ic(h.b))},e.\u0275prov=v.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b])],e),e})();var D=a("lJxs"),w=a("jVDg"),_=a("o8EM");let W=(()=>{let e=class{constructor(e,t){this.http=e,this.rbdConfigurationService=t}isRBDPool(e){return-1!==m.a.indexOf(e.application_metadata,"rbd")&&!e.pool_name.includes("/")}create(e){return this.http.post("api/block/image",e,{observe:"response"})}delete(e){return this.http.delete(`api/block/image/${e.toStringEncoded()}`,{observe:"response"})}update(e,t){return this.http.put(`api/block/image/${e.toStringEncoded()}`,t,{observe:"response"})}get(e){return this.http.get(`api/block/image/${e.toStringEncoded()}`)}list(){return this.http.get("api/block/image").pipe(Object(D.a)(e=>e.map(e=>(e.value.map(e=>e.configuration?(e.configuration.map(e=>Object.assign(e,this.rbdConfigurationService.getOptionByName(e.name))),e):e),e))))}copy(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/copy`,t,{observe:"response"})}flatten(e){return this.http.post(`api/block/image/${e.toStringEncoded()}/flatten`,null,{observe:"response"})}defaultFeatures(){return this.http.get("api/block/image/default_features")}cloneFormatVersion(){return this.http.get("api/block/image/clone_format_version")}createSnapshot(e,t){const a={snapshot_name:t};return this.http.post(`api/block/image/${e.toStringEncoded()}/snap`,a,{observe:"response"})}renameSnapshot(e,t,a){const i={new_snap_name:a};return this.http.put(`api/block/image/${e.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}protectSnapshot(e,t,a){const i={is_protected:a};return this.http.put(`api/block/image/${e.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}rollbackSnapshot(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/snap/${t}/rollback`,null,{observe:"response"})}cloneSnapshot(e,t,a){return this.http.post(`api/block/image/${e.toStringEncoded()}/snap/${t}/clone`,a,{observe:"response"})}deleteSnapshot(e,t){return this.http.delete(`api/block/image/${e.toStringEncoded()}/snap/${t}`,{observe:"response"})}listTrash(){return this.http.get("api/block/image/trash/")}createNamespace(e,t){return this.http.post(`api/block/pool/${e}/namespace`,{namespace:t},{observe:"response"})}listNamespaces(e){return this.http.get(`api/block/pool/${e}/namespace/`)}deleteNamespace(e,t){return this.http.delete(`api/block/pool/${e}/namespace/${t}`,{observe:"response"})}moveTrash(e,t){return this.http.post(`api/block/image/${e.toStringEncoded()}/move_trash`,{delay:t},{observe:"response"})}purgeTrash(e){return this.http.post(`api/block/image/trash/purge/?pool_name=${e}`,null,{observe:"response"})}restoreTrash(e,t){return this.http.post(`api/block/image/trash/${e.toStringEncoded()}/restore`,{new_image_name:t},{observe:"response"})}removeTrash(e,t=!1){return this.http.delete(`api/block/image/trash/${e.toStringEncoded()}/?force=${t}`,{observe:"response"})}};return e.\u0275fac=function(t){return new(t||e)(v.ic(h.b),v.ic(_.a))},e.\u0275prov=v.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),Object(f.b)([Object(f.e)(1,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[w.a,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"createSnapshot",null),Object(f.b)([Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[w.a,String,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"renameSnapshot",null),Object(f.b)([Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[w.a,String,Boolean]),Object(f.d)("design:returntype",void 0)],e.prototype,"protectSnapshot",null),Object(f.b)([Object(f.e)(1,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[w.a,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"restoreTrash",null),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b,_.a])],e),e})();var y=a("DNAf"),X=a("a96k"),I=a("oxzT"),k=a("spCT"),P=a("QFaf"),$=a("1Ni5"),T=a("kvvV"),F=a("JK/P"),R=a("kn/O"),E=a("ajRT"),z=a("NwgZ"),N=a("ocLN"),C=a("ANnk"),V=a("f69J"),A=a("6+kj");function x(e,t){if(1&e&&(v.Xb(0,"option",6),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("ngValue",e),v.Db(1),v.Sc(e)}}function O(e,t){if(1&e&&(v.Xb(0,"select",5),v.Sb(1,"option",6),v.Pc(2,x,2,2,"option",7),v.Wb()),2&e){const e=v.nc();v.vc("id",e.setting),v.vc("name",e.setting),v.uc("formControlName",e.setting),v.Db(1),v.uc("ngValue",null),v.Db(1),v.uc("ngForOf",e.limits.values)}}function M(e,t){if(1&e&&v.Sb(0,"input",10),2&e){const e=v.nc(2);v.uc("formControlName",e.setting)}}function B(e,t){if(1&e&&v.Sb(0,"input",11),2&e){const e=v.nc(2);v.uc("formControlName",e.setting)}}function q(e,t){if(1&e&&(v.Vb(0),v.Sb(1,"br"),v.Xb(2,"div",12),v.Sb(3,"input",13),v.Xb(4,"label",14),v.Rc(5,"Yes"),v.Wb(),v.Wb(),v.Xb(6,"div",12),v.Sb(7,"input",13),v.Xb(8,"label",14),v.Rc(9,"No"),v.Wb(),v.Wb(),v.Ub()),2&e){const e=v.nc(2);v.Db(3),v.uc("id",e.setting+"True")("value",!0)("formControlName",e.setting),v.Db(1),v.uc("for",e.setting+"True"),v.Db(3),v.uc("id",e.setting+"False")("value",!1)("formControlName",e.setting),v.Db(1),v.uc("for",e.setting+"False")}}function L(e,t){if(1&e&&(v.Xb(0,"span"),v.Pc(1,M,1,1,"input",8),v.Pc(2,B,1,1,"input",9),v.Pc(3,q,10,8,"ng-container",3),v.Wb()),2&e){const e=v.nc();v.Db(1),v.uc("ngIf","int"===e.limits.type),v.Db(1),v.uc("ngIf","str"===e.limits.type),v.Db(1),v.uc("ngIf","bool"===e.limits.type)}}function G(e,t){if(1&e&&(v.Xb(0,"span",15),v.Vb(1),v.bc(2,16),v.Ub(),v.Wb()),2&e){const e=v.nc();v.Db(2),v.fc(e.limits.min),v.cc(2)}}function U(e,t){if(1&e&&(v.Xb(0,"span",15),v.Vb(1),v.bc(2,17),v.Ub(),v.Wb()),2&e){const e=v.nc();v.Db(2),v.fc(e.limits.max),v.cc(2)}}let j=(()=>{class e{ngOnInit(){const e=[];"min"in this.limits&&e.push(o.A.min(this.limits.min)),"max"in this.limits&&e.push(o.A.max(this.limits.max)),this.settingsForm.get(this.setting).setValidators(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-setting"]],inputs:{settingsForm:"settingsForm",formDir:"formDir",setting:"setting",limits:"limits"},decls:7,vars:7,consts:function(){let e,t;return e="Must be greater than or equal to " + "\ufffd0\ufffd" + ".",t="Must be less than or equal to " + "\ufffd0\ufffd" + ".",[[1,"form-group",3,"formGroup"],[1,"col-form-label",3,"for"],["class","form-control custom-select",3,"id","name","formControlName",4,"ngIf"],[4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"form-control","custom-select",3,"id","name","formControlName"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["type","number","class","form-control",3,"formControlName",4,"ngIf"],["type","text","class","form-control",3,"formControlName",4,"ngIf"],["type","number",1,"form-control",3,"formControlName"],["type","text",1,"form-control",3,"formControlName"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio",1,"custom-control-input",3,"id","value","formControlName"],[1,"custom-control-label",3,"for"],[1,"invalid-feedback"],e,t]},template:function(e,t){1&e&&(v.Xb(0,"div",0),v.Xb(1,"label",1),v.Rc(2),v.Wb(),v.Pc(3,O,3,5,"select",2),v.Pc(4,L,4,3,"span",3),v.Pc(5,G,3,1,"span",4),v.Pc(6,U,3,1,"span",4),v.Wb()),2&e&&(v.uc("formGroup",t.settingsForm),v.Db(1),v.vc("for",t.setting),v.Db(1),v.Sc(t.setting),v.Db(1),v.uc("ngIf","enum"===t.limits.type),v.Db(1),v.uc("ngIf","enum"!==t.limits.type),v.Db(1),v.uc("ngIf",t.settingsForm.showError(t.setting,t.formDir,"min")),v.Db(1),v.uc("ngIf",t.settingsForm.showError(t.setting,t.formDir,"max")))},directives:[N.a,o.r,o.k,z.a,i.r,C.a,o.z,V.a,o.q,o.i,o.u,o.C,i.q,o.v,o.d,o.w],styles:[""]}),e})();var Q=a("uYzU");function Y(e,t){1&e&&(v.Xb(0,"span",29),v.bc(1,30),v.Wb())}function K(e,t){if(1&e&&(v.Xb(0,"span"),v.Xb(1,"legend",10),v.bc(2,21),v.Wb(),v.Xb(3,"div",12),v.Xb(4,"div",13),v.Xb(5,"label",22),v.bc(6,23),v.Wb(),v.Sb(7,"input",24),v.Pc(8,Y,2,0,"span",25),v.Wb(),v.Wb(),v.Xb(9,"div",12),v.Xb(10,"div",13),v.Xb(11,"label",26),v.bc(12,27),v.Wb(),v.Sb(13,"input",28),v.Wb(),v.Wb(),v.Wb()),2&e){const e=v.nc(),t=v.Fc(9);v.Db(8),v.uc("ngIf",e.settingsForm.showError("lun",t,"required"))}}function H(e,t){if(1&e&&(v.Xb(0,"option",31),v.Rc(1),v.oc(2,"iscsiBackstore"),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e),v.Db(1),v.Sc(v.pc(2,2,e))}}function J(e,t){if(1&e&&(v.Xb(0,"div",12),v.Xb(1,"div",13),v.Sb(2,"cd-iscsi-setting",33),v.Wb(),v.Wb()),2&e){const e=t.$implicit,a=v.nc(2).$implicit,i=v.nc(),o=v.Fc(9);v.Db(2),v.uc("settingsForm",i.settingsForm)("formDir",o)("setting",e.key)("limits",i.getDiskControlLimits(a,e.key))}}function Z(e,t){if(1&e&&(v.Vb(0),v.Pc(1,J,3,4,"div",32),v.oc(2,"keyvalue"),v.Ub()),2&e){const e=v.nc().$implicit,t=v.nc();v.Db(1),v.uc("ngForOf",v.pc(2,1,t.disk_default_controls[e]))}}function ee(e,t){if(1&e&&(v.Vb(0),v.Pc(1,Z,3,3,"ng-container",9),v.Ub()),2&e){const e=t.$implicit,a=v.nc();v.Db(1),v.uc("ngIf",a.settingsForm.value.backstore===e)}}let te=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.iscsiService=t,this.actionLabels=a}ngOnInit(){const e={backstore:new o.h(this.imagesSettings[this.image].backstore),lun:new o.h(this.imagesSettings[this.image].lun),wwn:new o.h(this.imagesSettings[this.image].wwn)};m.a.forEach(this.backstores,t=>{const a=this.imagesSettings[this.image][t]||{};m.a.forIn(this.disk_default_controls[t],(t,i)=>{e[i]=new o.h(a[i])})}),this.settingsForm=new P.a(e)}getDiskControlLimits(e,t){return this.disk_controls_limits?this.disk_controls_limits[e][t]:{type:"int"}}save(){const e=this.settingsForm.controls.backstore.value,t=this.settingsForm.controls.lun.value,a=this.settingsForm.controls.wwn.value,i={};m.a.forIn(this.settingsForm.controls,(t,a)=>{""!==t.value&&null!==t.value&&a in this.disk_default_controls[this.settingsForm.value.backstore]&&(i[a]=t.value,m.a.forEach(this.backstores,i=>{i!==e&&a in(this.imagesSettings[this.image][i]||{})&&(this.imagesSettings[this.image][i][a]=t.value)}))}),this.imagesSettings[this.image].backstore=e,this.imagesSettings[this.image].lun=t,this.imagesSettings[this.image].wwn=a,this.imagesSettings[this.image][e]=i,this.imagesSettings=Object.assign({},this.imagesSettings),this.control.updateValueAndValidity({emitEvent:!1}),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(S),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-image-settings-modal"]],decls:25,vars:8,consts:function(){let e,t,a,i,o,s,n,c;return e="Configure",t="Changing these parameters from their default values is usually not necessary.",a="Settings",i="Backstore",o="Identifier",s="lun",n="wwn",c="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","settingsForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],t,[4,"ngIf"],[1,"cd-header"],a,[1,"form-group","row"],[1,"col-sm-12"],[1,"col-form-label"],i,["id","backstore","name","backstore","formControlName","backstore",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],o,["for","lun",1,"col-form-label","required"],s,["type","number","id","lun","name","lun","formControlName","lun",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","wwn",1,"col-form-label"],n,["type","text","id","wwn","name","wwn","formControlName","wwn",1,"form-control"],[1,"invalid-feedback"],c,[3,"value"],["class","form-group row",4,"ngFor","ngForOf"],[3,"settingsForm","formDir","setting","limits"]]},template:function(e,t){1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.Vb(2),v.bc(3,2),v.Ub(),v.Rc(4,"\xa0 "),v.Xb(5,"small"),v.Rc(6),v.Wb(),v.Ub(),v.Vb(7,3),v.Xb(8,"form",4,5),v.Xb(10,"div",6),v.Xb(11,"p",7),v.bc(12,8),v.Wb(),v.Pc(13,K,14,1,"span",9),v.Xb(14,"legend",10),v.bc(15,11),v.Wb(),v.Xb(16,"div",12),v.Xb(17,"div",13),v.Xb(18,"label",14),v.bc(19,15),v.Wb(),v.Xb(20,"select",16),v.Pc(21,H,3,4,"option",17),v.Wb(),v.Wb(),v.Wb(),v.Pc(22,ee,2,1,"ng-container",18),v.Wb(),v.Xb(23,"div",19),v.Xb(24,"cd-form-button-panel",20),v.lc("submitActionEvent",function(){return t.save()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e&&(v.uc("modalRef",t.activeModal),v.Db(6),v.Sc(t.image),v.Db(2),v.uc("formGroup",t.settingsForm),v.Db(5),v.uc("ngIf",t.api_version>=1),v.Db(8),v.uc("ngForOf",t.backstores),v.Db(1),v.uc("ngForOf",t.backstores),v.Db(2),v.uc("form",t.settingsForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.B,o.r,o.k,z.a,i.r,N.a,C.a,o.z,V.a,o.q,o.i,i.q,A.a,o.v,o.d,o.u,o.C,j],pipes:[Q.a,i.k],styles:[""]}),e})();function ae(e,t){if(1&e&&(v.Xb(0,"div",12),v.Xb(1,"div",13),v.Sb(2,"cd-iscsi-setting",14),v.Wb(),v.Wb()),2&e){const e=t.$implicit,a=v.nc(),i=v.Fc(5);v.Db(2),v.uc("settingsForm",a.settingsForm)("formDir",i)("setting",e.key)("limits",a.getTargetControlLimits(e.key))}}let ie=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.iscsiService=t,this.actionLabels=a}ngOnInit(){const e={};m.a.forIn(this.target_default_controls,(t,a)=>{e[a]=new o.h(this.target_controls.value[a])}),this.settingsForm=new P.a(e)}save(){const e={};m.a.forIn(this.settingsForm.controls,(t,a)=>{""!==t.value&&null!==t.value&&(e[a]=t.value)}),this.target_controls.setValue(e),this.activeModal.close()}getTargetControlLimits(e){return this.target_controls_limits?this.target_controls_limits[e]:["Yes","No"].includes(this.target_default_controls[e])?{type:"bool"}:{type:"int"}}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(S),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-iqn-settings-modal"]],decls:13,vars:7,consts:function(){let e,t;return e="Advanced Settings",t="Changing these parameters from their default values is usually not necessary.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","settingsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],t,["class","form-group row",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"form-group","row"],[1,"col-sm-12"],[3,"settingsForm","formDir","setting","limits"]]},template:function(e,t){1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p",7),v.bc(8,8),v.Wb(),v.Pc(9,ae,3,4,"div",9),v.oc(10,"keyvalue"),v.Wb(),v.Xb(11,"div",10),v.Xb(12,"cd-form-button-panel",11),v.lc("submitActionEvent",function(){return t.save()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e&&(v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.settingsForm),v.Db(5),v.uc("ngForOf",v.pc(10,5,t.settingsForm.controls)),v.Db(3),v.uc("form",t.settingsForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.B,o.r,o.k,z.a,i.q,A.a,N.a,j],pipes:[i.k],styles:[""]}),e})();var oe=a("zc8c");let se=(()=>{class e{constructor(e){this.ngControl=e}onInput(e){this.setValue(e)}setValue(e){e=m.a.isString(e)?e.trim():e,this.ngControl.control.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(o.p))},e.\u0275dir=v.Mb({type:e,selectors:[["","cdTrim",""]],hostBindings:function(e,t){1&e&&v.lc("input",function(e){return t.onInput(e.target.value)})}}),e})();var ne=a("wnGv"),ce=a("D4zM"),re=a("cEzo"),le=a("8xTl");function be(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,42),v.Wb())}function de(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,43),v.Wb())}function ue(e,t){1&e&&(v.Xb(0,"span",41),v.Vb(1),v.bc(2,44),v.Ub(),v.Sb(3,"br"),v.Vb(4),v.bc(5,45),v.Ub(),v.Sb(6,"br"),v.Xb(7,"a",46),v.bc(8,47),v.Wb(),v.Wb())}function me(e,t){1&e&&(v.Xb(0,"span",48),v.bc(1,49),v.Wb())}const pe=function(e){return[e]};function fe(e,t){if(1&e){const e=v.Yb();v.Vb(0),v.Xb(1,"div",50),v.Sb(2,"input",51),v.Xb(3,"span",14),v.Xb(4,"button",52),v.lc("click",function(){v.Ic(e);const a=t.index,i=t.$implicit;return v.nc(2).removePortal(a,i)}),v.Sb(5,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Ub()}if(2&e){const e=t.$implicit,a=v.nc(2);v.Db(2),v.uc("value",e),v.Db(3),v.uc("ngClass",v.zc(2,pe,a.icons.destroy))}}function he(e,t){if(1&e&&(v.Xb(0,"span",41),v.bc(1,53),v.Wb()),2&e){const e=v.nc(2);v.Db(1),v.fc(e.minimum_gateways),v.cc(1)}}function ge(e,t){if(1&e&&(v.Xb(0,"div",56),v.Rc(1),v.Wb()),2&e){const e=v.nc().$implicit,t=v.nc(2);v.Db(1),v.Tc("lun: ",t.imagesSettings[e].lun,"")}}function ve(e,t){if(1&e&&(v.Vb(0),v.bc(1,57),v.oc(2,"iscsiBackstore"),v.Ub()),2&e){const e=v.nc().$implicit,t=v.nc(2);v.Db(2),v.fc(v.pc(2,1,t.imagesSettings[e].backstore)),v.cc(1)}}function Se(e,t){1&e&&(v.Vb(0),v.bc(1,58),v.Ub())}function De(e,t){if(1&e){const e=v.Yb();v.Vb(0),v.Xb(1,"div",50),v.Sb(2,"input",51),v.Xb(3,"span",14),v.Pc(4,ge,2,1,"div",54),v.Xb(5,"button",52),v.lc("click",function(){v.Ic(e);const a=t.$implicit;return v.nc(2).imageSettingsModal(a)}),v.Sb(6,"i",16),v.Wb(),v.Xb(7,"button",52),v.lc("click",function(){v.Ic(e);const a=t.index,i=t.$implicit;return v.nc(2).removeImage(a,i)}),v.Sb(8,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Xb(9,"span",48),v.Pc(10,ve,3,3,"ng-container",55),v.Pc(11,Se,2,0,"ng-container",55),v.Wb(),v.Ub()}if(2&e){const e=t.$implicit,a=v.nc(2);v.Db(2),v.uc("value",e),v.Db(2),v.uc("ngIf",a.api_version>=1),v.Db(2),v.uc("ngClass",v.zc(6,pe,a.icons.deepCheck)),v.Db(2),v.uc("ngClass",v.zc(8,pe,a.icons.destroy)),v.Db(2),v.uc("ngIf",a.backstores.length>1),v.Db(1),v.uc("ngIf",a.hasAdvancedSettings(a.imagesSettings[e][a.imagesSettings[e].backstore]))}}function we(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,59),v.Wb())}function _e(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,60),v.Wb())}function We(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,78),v.Wb())}function ye(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,79),v.Wb())}function Xe(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,80),v.Wb())}function Ie(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,81),v.Wb())}function ke(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,82),v.Wb())}function Pe(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,83),v.Wb())}function $e(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,84),v.Wb())}function Te(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,85),v.Wb())}function Fe(e,t){if(1&e&&(v.Xb(0,"div",61),v.Xb(1,"div",8),v.Xb(2,"label",62),v.Vb(3),v.bc(4,63),v.Ub(),v.Wb(),v.Xb(5,"div",11),v.Sb(6,"input",64),v.Pc(7,We,2,0,"span",17),v.Pc(8,ye,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(9,"div",8),v.Xb(10,"label",65),v.Vb(11),v.bc(12,66),v.Ub(),v.Wb(),v.Xb(13,"div",11),v.Xb(14,"div",12),v.Sb(15,"input",67),v.Xb(16,"span",14),v.Sb(17,"button",68),v.Sb(18,"cd-copy-2-clipboard-button",69),v.Wb(),v.Wb(),v.Pc(19,Xe,2,0,"span",17),v.Pc(20,Ie,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(21,"div",8),v.Xb(22,"label",70),v.Vb(23),v.bc(24,71),v.Ub(),v.Wb(),v.Xb(25,"div",11),v.Sb(26,"input",72),v.Pc(27,ke,2,0,"span",17),v.Pc(28,Pe,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(29,"div",8),v.Xb(30,"label",73),v.Vb(31),v.bc(32,74),v.Ub(),v.Wb(),v.Xb(33,"div",11),v.Xb(34,"div",12),v.Sb(35,"input",75),v.Xb(36,"span",14),v.Sb(37,"button",76),v.Sb(38,"cd-copy-2-clipboard-button",77),v.Wb(),v.Wb(),v.Pc(39,$e,2,0,"span",17),v.Pc(40,Te,2,0,"span",17),v.Wb(),v.Wb(),v.Wb()),2&e){v.nc();const e=v.Fc(2),t=v.nc();v.Db(7),v.uc("ngIf",t.targetForm.showError("user",e,"required")),v.Db(1),v.uc("ngIf",t.targetForm.showError("user",e,"pattern")),v.Db(11),v.uc("ngIf",t.targetForm.showError("password",e,"required")),v.Db(1),v.uc("ngIf",t.targetForm.showError("password",e,"pattern")),v.Db(7),v.uc("ngIf",t.targetForm.showError("mutual_user",e,"required")),v.Db(1),v.uc("ngIf",t.targetForm.showError("mutual_user",e,"pattern")),v.Db(11),v.uc("ngIf",t.targetForm.showError("mutual_password",e,"required")),v.Db(1),v.uc("ngIf",t.targetForm.showError("mutual_password",e,"pattern"))}}function Re(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,115),v.Wb())}function Ee(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,116),v.Wb())}function ze(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,117),v.Wb())}function Ne(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,118),v.Wb())}function Ce(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,119),v.Wb())}function Ve(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,120),v.Wb())}function Ae(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,121),v.Wb())}function xe(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,122),v.Wb())}function Oe(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,123),v.Wb())}function Me(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,124),v.Wb())}function Be(e,t){1&e&&(v.Xb(0,"span",41),v.bc(1,125),v.Wb())}function qe(e,t){if(1&e){const e=v.Yb();v.Vb(0),v.Xb(1,"div",50),v.Sb(2,"input",51),v.Xb(3,"span",14),v.Xb(4,"button",52),v.lc("click",function(){v.Ic(e);const a=t.index,i=t.$implicit,o=v.nc(),s=o.$implicit,n=o.index;return v.nc(3).removeInitiatorImage(s,a,n,i)}),v.Sb(5,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Ub()}if(2&e){const e=t.$implicit,a=v.nc(4);v.Db(2),v.uc("value",e),v.Db(3),v.uc("ngClass",v.zc(2,pe,a.icons.destroy))}}function Le(e,t){1&e&&(v.Xb(0,"span"),v.bc(1,126),v.Wb())}function Ge(e,t){if(1&e&&(v.Xb(0,"div",22),v.Xb(1,"div",23),v.Xb(2,"cd-select",127),v.Sb(3,"i",25),v.Vb(4),v.bc(5,128),v.Ub(),v.Wb(),v.Wb(),v.Wb()),2&e){const e=v.nc(),t=e.$implicit,a=e.index,i=v.nc(3);v.Db(2),v.uc("data",t.getValue("luns"))("options",i.imagesInitiatorSelections[a])("messages",i.messages.initiatorImage),v.Db(1),v.uc("ngClass",v.zc(4,pe,i.icons.add))}}function Ue(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",92),v.Xb(1,"div",5),v.Vb(2),v.bc(3,93),v.Ub(),v.Rc(4),v.Xb(5,"button",94),v.lc("click",function(){v.Ic(e);const a=t.index;return v.nc(3).removeInitiator(a)}),v.Sb(6,"i",25),v.Wb(),v.Wb(),v.Xb(7,"div",7),v.Xb(8,"div",8),v.Xb(9,"label",95),v.bc(10,96),v.Wb(),v.Xb(11,"div",11),v.Xb(12,"input",97),v.lc("blur",function(){return v.Ic(e),v.nc(3).updatedInitiatorSelector()}),v.Wb(),v.Pc(13,Re,2,0,"span",17),v.Pc(14,Ee,2,0,"span",17),v.Pc(15,ze,2,0,"span",17),v.Wb(),v.Wb(),v.Vb(16,61),v.Xb(17,"div",8),v.Xb(18,"label",98),v.bc(19,99),v.Wb(),v.Xb(20,"div",11),v.Sb(21,"input",100),v.Pc(22,Ne,2,0,"span",17),v.Pc(23,Ce,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(24,"div",8),v.Xb(25,"label",101),v.bc(26,102),v.Wb(),v.Xb(27,"div",11),v.Xb(28,"div",12),v.Sb(29,"input",103),v.Xb(30,"span",14),v.Sb(31,"button",104),v.Sb(32,"cd-copy-2-clipboard-button",105),v.Wb(),v.Wb(),v.Pc(33,Ve,2,0,"span",17),v.Pc(34,Ae,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(35,"div",8),v.Xb(36,"label",106),v.Vb(37),v.bc(38,107),v.Ub(),v.Wb(),v.Xb(39,"div",11),v.Sb(40,"input",108),v.Pc(41,xe,2,0,"span",17),v.Pc(42,Oe,2,0,"span",17),v.Wb(),v.Wb(),v.Xb(43,"div",8),v.Xb(44,"label",109),v.bc(45,110),v.Wb(),v.Xb(46,"div",11),v.Xb(47,"div",12),v.Sb(48,"input",111),v.Xb(49,"span",14),v.Sb(50,"button",104),v.Sb(51,"cd-copy-2-clipboard-button",105),v.Wb(),v.Wb(),v.Pc(52,Me,2,0,"span",17),v.Pc(53,Be,2,0,"span",17),v.Wb(),v.Wb(),v.Ub(),v.Xb(54,"div",8),v.Xb(55,"label",112),v.bc(56,113),v.Wb(),v.Xb(57,"div",11),v.Pc(58,qe,6,4,"ng-container",21),v.Pc(59,Le,2,0,"span",55),v.Pc(60,Ge,6,6,"div",114),v.Wb(),v.Wb(),v.Wb(),v.Wb()}if(2&e){const e=t.$implicit,a=t.index;v.nc(2);const i=v.Fc(2),o=v.nc();v.uc("formGroup",e),v.Db(4),v.Tc(": ",e.getValue("client_iqn")," "),v.Db(2),v.uc("ngClass",v.zc(25,pe,o.icons.destroy)),v.Db(7),v.uc("ngIf",e.showError("client_iqn",i,"notUnique")),v.Db(1),v.uc("ngIf",e.showError("client_iqn",i,"required")),v.Db(1),v.uc("ngIf",e.showError("client_iqn",i,"pattern")),v.Db(6),v.uc("id","user"+a),v.Db(1),v.uc("ngIf",e.showError("user",i,"required")),v.Db(1),v.uc("ngIf",e.showError("user",i,"pattern")),v.Db(6),v.uc("id","password"+a),v.Db(2),v.uc("cdPasswordButton","password"+a),v.Db(1),v.uc("source","password"+a),v.Db(1),v.uc("ngIf",e.showError("password",i,"required")),v.Db(1),v.uc("ngIf",e.showError("password",i,"pattern")),v.Db(6),v.uc("id","mutual_user"+a),v.Db(1),v.uc("ngIf",e.showError("mutual_user",i,"required")),v.Db(1),v.uc("ngIf",e.showError("mutual_user",i,"pattern")),v.Db(6),v.uc("id","mutual_password"+a),v.Db(2),v.uc("cdPasswordButton","mutual_password"+a),v.Db(1),v.uc("source","mutual_password"+a),v.Db(1),v.uc("ngIf",e.showError("mutual_password",i,"required")),v.Db(1),v.uc("ngIf",e.showError("mutual_password",i,"pattern")),v.Db(5),v.uc("ngForOf",e.getValue("luns")),v.Db(1),v.uc("ngIf",e.getValue("cdIsInGroup")),v.Db(1),v.uc("ngIf",!e.getValue("cdIsInGroup"))}}function je(e,t){1&e&&(v.Xb(0,"span",48),v.bc(1,129),v.Wb())}function Qe(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",8),v.Xb(1,"label",86),v.bc(2,87),v.Wb(),v.Xb(3,"div",88),v.Pc(4,Ue,61,27,"div",89),v.Xb(5,"div",22),v.Xb(6,"div",23),v.Pc(7,je,2,0,"span",18),v.Xb(8,"button",90),v.lc("click",function(){return v.Ic(e),v.nc(2).addInitiator(),!1}),v.Sb(9,"i",25),v.Vb(10),v.bc(11,91),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Sb(12,"hr"),v.Wb(),v.Wb()}if(2&e){const e=v.nc(2);v.Db(4),v.uc("ngForOf",e.initiators.controls),v.Db(3),v.uc("ngIf",0===e.initiators.controls.length),v.Db(2),v.uc("ngClass",v.zc(3,pe,e.icons.add))}}function Ye(e,t){if(1&e){const e=v.Yb();v.Vb(0),v.Xb(1,"div",50),v.Sb(2,"input",51),v.Xb(3,"span",14),v.Xb(4,"button",52),v.lc("click",function(){v.Ic(e);const a=t.index,i=v.nc(),o=i.$implicit,s=i.index;return v.nc(3).removeGroupInitiator(o,a,s)}),v.Sb(5,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Ub()}if(2&e){const e=t.$implicit,a=v.nc(4);v.Db(2),v.uc("value",e),v.Db(3),v.uc("ngClass",v.zc(2,pe,a.icons.destroy))}}function Ke(e,t){if(1&e){const e=v.Yb();v.Vb(0),v.Xb(1,"div",50),v.Sb(2,"input",51),v.Xb(3,"span",14),v.Xb(4,"button",52),v.lc("click",function(){v.Ic(e);const a=t.index,i=v.nc(),o=i.$implicit,s=i.index;return v.nc(3).removeGroupDisk(o,a,s)}),v.Sb(5,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Ub()}if(2&e){const e=t.$implicit,a=v.nc(4);v.Db(2),v.uc("value",e),v.Db(3),v.uc("ngClass",v.zc(2,pe,a.icons.destroy))}}function He(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",92),v.Xb(1,"div",5),v.Vb(2),v.bc(3,133),v.Ub(),v.Rc(4),v.Xb(5,"button",94),v.lc("click",function(){v.Ic(e);const a=t.index;return v.nc(3).removeGroup(a)}),v.Sb(6,"i",25),v.Wb(),v.Wb(),v.Xb(7,"div",7),v.Xb(8,"div",8),v.Xb(9,"label",134),v.bc(10,135),v.Wb(),v.Xb(11,"div",11),v.Sb(12,"input",136),v.Wb(),v.Wb(),v.Xb(13,"div",8),v.Xb(14,"label",137),v.Vb(15),v.bc(16,138),v.Ub(),v.Wb(),v.Xb(17,"div",11),v.Pc(18,Ye,6,4,"ng-container",21),v.Xb(19,"div",22),v.Xb(20,"div",23),v.Xb(21,"cd-select",24),v.lc("selection",function(a){v.Ic(e);const i=t.index;return v.nc(3).onGroupMemberSelection(a,i)}),v.Sb(22,"i",25),v.Vb(23),v.bc(24,139),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Sb(25,"hr"),v.Wb(),v.Wb(),v.Xb(26,"div",8),v.Xb(27,"label",28),v.Vb(28),v.bc(29,140),v.Ub(),v.Wb(),v.Xb(30,"div",11),v.Pc(31,Ke,6,4,"ng-container",21),v.Xb(32,"div",22),v.Xb(33,"div",23),v.Xb(34,"cd-select",127),v.Sb(35,"i",25),v.Vb(36),v.bc(37,141),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Sb(38,"hr"),v.Wb(),v.Wb(),v.Wb(),v.Wb()}if(2&e){const e=t.$implicit,a=t.index,i=v.nc(3);v.uc("formGroup",e),v.Db(4),v.Tc(": ",e.getValue("group_id")," "),v.Db(2),v.uc("ngClass",v.zc(13,pe,i.icons.destroy)),v.Db(12),v.uc("ngForOf",e.getValue("members")),v.Db(3),v.uc("data",e.getValue("members"))("options",i.groupMembersSelections[a])("messages",i.messages.groupInitiator),v.Db(1),v.uc("ngClass",v.zc(15,pe,i.icons.add)),v.Db(9),v.uc("ngForOf",e.getValue("disks")),v.Db(3),v.uc("data",e.getValue("disks"))("options",i.groupDiskSelections[a])("messages",i.messages.initiatorImage),v.Db(1),v.uc("ngClass",v.zc(17,pe,i.icons.add))}}function Je(e,t){1&e&&(v.Xb(0,"span",48),v.bc(1,142),v.Wb())}function Ze(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",8),v.Xb(1,"label",86),v.bc(2,130),v.Wb(),v.Xb(3,"div",131),v.Pc(4,He,39,19,"div",89),v.Xb(5,"div",22),v.Xb(6,"div",23),v.Pc(7,Je,2,0,"span",18),v.Xb(8,"button",90),v.lc("click",function(){return v.Ic(e),v.nc(2).addGroup(),!1}),v.Sb(9,"i",25),v.Vb(10),v.bc(11,132),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Wb(),v.Wb()}if(2&e){const e=v.nc(2);v.Db(4),v.uc("ngForOf",e.groups.controls),v.Db(3),v.uc("ngIf",0===e.groups.controls.length),v.Db(2),v.uc("ngClass",v.zc(3,pe,e.icons.add))}}function et(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",1),v.Xb(1,"form",2,3),v.Xb(3,"div",4),v.Xb(4,"div",5),v.bc(5,6),v.oc(6,"titlecase"),v.oc(7,"upperFirst"),v.Wb(),v.Xb(8,"div",7),v.Xb(9,"div",8),v.Xb(10,"label",9),v.bc(11,10),v.Wb(),v.Xb(12,"div",11),v.Xb(13,"div",12),v.Sb(14,"input",13),v.Xb(15,"span",14),v.Xb(16,"button",15),v.lc("click",function(){return v.Ic(e),v.nc().targetSettingsModal()}),v.Sb(17,"i",16),v.Wb(),v.Wb(),v.Wb(),v.Pc(18,be,2,0,"span",17),v.Pc(19,de,2,0,"span",17),v.Pc(20,ue,9,0,"span",17),v.Pc(21,me,2,0,"span",18),v.Sb(22,"hr"),v.Wb(),v.Wb(),v.Xb(23,"div",8),v.Xb(24,"label",19),v.bc(25,20),v.Wb(),v.Xb(26,"div",11),v.Pc(27,fe,6,4,"ng-container",21),v.Xb(28,"div",22),v.Xb(29,"div",23),v.Xb(30,"cd-select",24),v.lc("selection",function(t){return v.Ic(e),v.nc().onPortalSelection(t)}),v.Sb(31,"i",25),v.Vb(32),v.bc(33,26),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Sb(34,"input",27),v.Pc(35,he,2,1,"span",17),v.Sb(36,"hr"),v.Wb(),v.Wb(),v.Xb(37,"div",8),v.Xb(38,"label",28),v.bc(39,29),v.Wb(),v.Xb(40,"div",11),v.Pc(41,De,12,10,"ng-container",21),v.Sb(42,"input",30),v.Pc(43,we,2,0,"span",17),v.Pc(44,_e,2,0,"span",17),v.Xb(45,"div",22),v.Xb(46,"div",23),v.Xb(47,"cd-select",24),v.lc("selection",function(t){return v.Ic(e),v.nc().onImageSelection(t)}),v.Sb(48,"i",25),v.Vb(49),v.bc(50,31),v.Ub(),v.Wb(),v.Wb(),v.Wb(),v.Sb(51,"hr"),v.Wb(),v.Wb(),v.Xb(52,"div",8),v.Xb(53,"div",32),v.Xb(54,"div",33),v.Sb(55,"input",34),v.Xb(56,"label",35),v.bc(57,36),v.Wb(),v.Wb(),v.Sb(58,"hr"),v.Wb(),v.Wb(),v.Pc(59,Fe,41,8,"div",37),v.Pc(60,Qe,13,5,"div",38),v.Pc(61,Ze,12,5,"div",38),v.Wb(),v.Xb(62,"div",39),v.Xb(63,"cd-form-button-panel",40),v.lc("submitActionEvent",function(){return v.Ic(e),v.nc().submit()}),v.oc(64,"titlecase"),v.oc(65,"upperFirst"),v.Wb(),v.Wb(),v.Wb(),v.Wb(),v.Wb()}if(2&e){const e=v.Fc(2),t=v.nc();v.Db(1),v.uc("formGroup",t.targetForm),v.Db(6),v.fc(v.pc(6,26,t.action))(v.pc(7,28,t.resource)),v.cc(5),v.Db(10),v.uc("ngClass",v.zc(34,pe,t.icons.deepCheck)),v.Db(1),v.uc("ngIf",t.targetForm.showError("target_iqn",e,"required")),v.Db(1),v.uc("ngIf",t.targetForm.showError("target_iqn",e,"pattern")),v.Db(1),v.uc("ngIf",t.targetForm.showError("target_iqn",e,"iqn")),v.Db(1),v.uc("ngIf",t.hasAdvancedSettings(t.targetForm.getValue("target_controls"))),v.Db(6),v.uc("ngForOf",t.portals.value),v.Db(3),v.uc("data",t.portals.value)("options",t.portalsSelections)("messages",t.messages.portals),v.Db(1),v.uc("ngClass",v.zc(36,pe,t.icons.add)),v.Db(4),v.uc("ngIf",t.targetForm.showError("portals",e,"minGateways")),v.Db(6),v.uc("ngForOf",t.targetForm.getValue("disks")),v.Db(2),v.uc("ngIf",t.targetForm.showError("disks",e,"dupLunId")),v.Db(1),v.uc("ngIf",t.targetForm.showError("disks",e,"dupWwn")),v.Db(3),v.uc("data",t.disks.value)("options",t.imagesSelections)("messages",t.messages.images),v.Db(1),v.uc("ngClass",v.zc(38,pe,t.icons.add)),v.Db(11),v.uc("ngIf",t.cephIscsiConfigVersion>10&&!t.targetForm.getValue("acl_enabled")),v.Db(1),v.uc("ngIf",t.targetForm.getValue("acl_enabled")),v.Db(1),v.uc("ngIf",t.targetForm.getValue("acl_enabled")),v.Db(2),v.uc("form",t.targetForm)("submitText",v.pc(64,30,t.action)+" "+v.pc(65,32,t.resource))}}let tt=(()=>{class e extends k.a{constructor(e,t,a,i,o,s,n){super(),this.iscsiService=e,this.modalService=t,this.rbdService=a,this.router=i,this.route=o,this.taskWrapper=s,this.actionLabels=n,this.api_version=0,this.minimum_gateways=1,this.icons=I.a,this.isEdit=!1,this.portalsSelections=[],this.imagesInitiatorSelections=[],this.groupDiskSelections=[],this.groupMembersSelections=[],this.imagesSettings={},this.messages={portals:new y.a({noOptions:"There are no portals available."}),images:new y.a({noOptions:"There are no images available."}),initiatorImage:new y.a({noOptions:"There are no images available. Please make sure you add an image to the target."}),groupInitiator:new y.a({noOptions:"There are no initiators available. Please make sure you add an initiator to the target."})},this.IQN_REGEX=/^iqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+)*$/,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.resource="target"}ngOnInit(){const e=[this.iscsiService.listTargets(),this.rbdService.list(),this.iscsiService.portals(),this.iscsiService.settings(),this.iscsiService.version()];this.router.url.startsWith("/block/iscsi/targets/edit")&&(this.isEdit=!0,this.route.params.subscribe(t=>{this.target_iqn=decodeURIComponent(t.target_iqn),e.push(this.iscsiService.getTarget(this.target_iqn))})),this.action=this.isEdit?this.actionLabels.EDIT:this.actionLabels.CREATE,Object(p.a)(e).subscribe(e=>{const t=m()(e[0]).filter(e=>e.target_iqn!==this.target_iqn).flatMap(e=>e.disks).map(e=>`${e.pool}/${e.image}`).value();"api_version"in e[3]&&(this.api_version=e[3].api_version),this.minimum_gateways=e[3].config.minimum_gateways,this.target_default_controls=e[3].target_default_controls,this.target_controls_limits=e[3].target_controls_limits,this.disk_default_controls=e[3].disk_default_controls,this.disk_controls_limits=e[3].disk_controls_limits,this.backstores=e[3].backstores,this.default_backstore=e[3].default_backstore,this.unsupported_rbd_features=e[3].unsupported_rbd_features,this.required_rbd_features=e[3].required_rbd_features,this.imagesAll=m()(e[1]).flatMap(e=>e.value).filter(e=>!e.namespace&&-1===t.indexOf(`${e.pool_name}/${e.name}`)&&0!==this.getValidBackstores(e).length).value(),this.imagesSelections=this.imagesAll.map(e=>new X.a(!1,`${e.pool_name}/${e.name}`,""));const a=[];e[2].forEach(e=>{e.ip_addresses.forEach(t=>{a.push(new X.a(!1,e.name+":"+t,""))})}),this.portalsSelections=[...a],this.cephIscsiConfigVersion=e[4].ceph_iscsi_config_version,this.createForm(),e[5]&&this.resolveModel(e[5]),this.loadingReady()})}createForm(){if(this.targetForm=new P.a({target_iqn:new o.h("iqn.2001-07.com.ceph:"+Date.now(),{validators:[o.A.required,o.A.pattern(this.IQN_REGEX)]}),target_controls:new o.h({}),portals:new o.h([],{validators:[$.a.custom("minGateways",e=>m.a.uniq(e.map(e=>e.split(":")[0])).length<Math.max(1,this.minimum_gateways))]}),disks:new o.h([],{validators:[$.a.custom("dupLunId",e=>{const t=this.getLunIds(e);return t.length!==m.a.uniq(t).length}),$.a.custom("dupWwn",e=>{const t=this.getWwns(e);return t.length!==m.a.uniq(t).length})]}),initiators:new o.e([]),groups:new o.e([]),acl_enabled:new o.h(!1)}),this.cephIscsiConfigVersion>10){const e=new P.a({user:new o.h(""),password:new o.h(""),mutual_user:new o.h(""),mutual_password:new o.h("")});this.setAuthValidator(e),this.targetForm.addControl("auth",e)}}resolveModel(e){this.targetForm.patchValue({target_iqn:e.target_iqn,target_controls:e.target_controls,acl_enabled:e.acl_enabled}),this.cephIscsiConfigVersion>10&&this.targetForm.patchValue({auth:e.auth});const t=[];m.a.forEach(e.portals,e=>{t.push(`${e.host}:${e.ip}`)}),this.targetForm.patchValue({portals:t});const a=[];m.a.forEach(e.disks,e=>{const t=`${e.pool}/${e.image}`;a.push(t),this.imagesSettings[t]={backstore:e.backstore},this.imagesSettings[t][e.backstore]=e.controls,"lun"in e&&(this.imagesSettings[t].lun=e.lun),"wwn"in e&&(this.imagesSettings[t].wwn=e.wwn),this.onImageSelection({option:{name:t,selected:!0}})}),this.targetForm.patchValue({disks:a}),m.a.forEach(e.clients,e=>{const t=this.addInitiator();e.luns=m.a.map(e.luns,e=>`${e.pool}/${e.image}`),t.patchValue(e)}),e.groups.forEach((e,t)=>{const a=this.addGroup();e.disks=m.a.map(e.disks,e=>`${e.pool}/${e.image}`),a.patchValue(e),m.a.forEach(e.members,e=>{this.onGroupMemberSelection({option:new X.a(!0,e,"")},t)})})}hasAdvancedSettings(e){return Object.values(e).length>0}get portals(){return this.targetForm.get("portals")}onPortalSelection(){this.portals.setValue(this.portals.value)}removePortal(e,t){return this.portalsSelections.forEach(e=>{e.name===t&&(e.selected=!1)}),this.portals.value.splice(e,1),this.portals.setValue(this.portals.value),!1}get disks(){return this.targetForm.get("disks")}removeImage(e,t){return this.imagesSelections.forEach(e=>{e.name===t&&(e.selected=!1)}),this.disks.value.splice(e,1),this.removeImageRefs(t),this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1}),!1}removeImageRefs(e){this.initiators.controls.forEach(t=>{const a=t.value.luns.filter(t=>t!==e);t.get("luns").setValue(a)}),this.groups.controls.forEach(t=>{const a=t.value.disks.filter(t=>t!==e);t.get("disks").setValue(a)}),m.a.forEach(this.imagesInitiatorSelections,(t,a)=>{this.imagesInitiatorSelections[a]=t.filter(t=>t.name!==e)}),m.a.forEach(this.groupDiskSelections,(t,a)=>{this.groupDiskSelections[a]=t.filter(t=>t.name!==e)})}getDefaultBackstore(e){let t=this.default_backstore;const a=this.getImageById(e);return this.validFeatures(a,this.default_backstore)||this.backstores.forEach(e=>{e!==this.default_backstore&&this.validFeatures(a,e)&&(t=e)}),t}isLunIdInUse(e,t){const a=this.disks.value.filter(e=>e!==t);return this.getLunIds(a).includes(e)}getLunIds(e){return m.a.map(e,e=>this.imagesSettings[e].lun)}nextLunId(e){const t=this.disks.value.filter(t=>t!==e),a=this.getLunIds(t);let i=0;for(;a.includes(i);)i++;return i}getWwns(e){return m.a.map(e,e=>this.imagesSettings[e].wwn).filter(e=>m.a.isString(e)&&""!==e)}onImageSelection(e){const t=e.option;if(t.selected){if(this.imagesSettings[t.name])this.isLunIdInUse(this.imagesSettings[t.name].lun,t.name)&&(this.imagesSettings[t.name].lun=this.nextLunId(t.name));else{const e=this.getDefaultBackstore(t.name);this.imagesSettings[t.name]={backstore:e,lun:this.nextLunId(t.name)},this.imagesSettings[t.name][e]={}}m.a.forEach(this.imagesInitiatorSelections,(e,a)=>{e.push(new X.a(!1,t.name,"")),this.imagesInitiatorSelections[a]=[...e]}),m.a.forEach(this.groupDiskSelections,(e,a)=>{e.push(new X.a(!1,t.name,"")),this.groupDiskSelections[a]=[...e]})}else this.removeImageRefs(t.name);this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1})}get initiators(){return this.targetForm.get("initiators")}addInitiator(){const e=new P.a({client_iqn:new o.h("",{validators:[o.A.required,$.a.custom("notUnique",e=>{const t=this.initiators.controls.reduce(function(e,t){return e.concat(t.value.client_iqn)},[]);return t.indexOf(e)!==t.lastIndexOf(e)}),o.A.pattern(this.IQN_REGEX)]}),auth:new P.a({user:new o.h(""),password:new o.h(""),mutual_user:new o.h(""),mutual_password:new o.h("")}),luns:new o.h([]),cdIsInGroup:new o.h(!1)});this.setAuthValidator(e),this.initiators.push(e),m.a.forEach(this.groupMembersSelections,(e,t)=>{e.push(new X.a(!1,"","")),this.groupMembersSelections[t]=[...e]});const t=m.a.map(this.targetForm.getValue("disks"),e=>new X.a(!1,e,""));return this.imagesInitiatorSelections.push(t),e}setAuthValidator(e){$.a.validateIf(e.get("user"),()=>e.getValue("password")||e.getValue("mutual_user")||e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[e.get("password"),e.get("mutual_user"),e.get("mutual_password")]),$.a.validateIf(e.get("password"),()=>e.getValue("user")||e.getValue("mutual_user")||e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[e.get("user"),e.get("mutual_user"),e.get("mutual_password")]),$.a.validateIf(e.get("mutual_user"),()=>e.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[e.get("user"),e.get("password"),e.get("mutual_password")]),$.a.validateIf(e.get("mutual_password"),()=>e.getValue("mutual_user"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[e.get("user"),e.get("password"),e.get("mutual_user")])}removeInitiator(e){const t=this.initiators.value[e];this.initiators.removeAt(e),m.a.forEach(this.groupMembersSelections,(t,a)=>{t.splice(e,1),this.groupMembersSelections[a]=[...t]}),this.groups.controls.forEach(e=>{const a=e.value.members.filter(e=>e!==t.client_iqn);e.get("members").setValue(a)}),this.imagesInitiatorSelections.splice(e,1)}updatedInitiatorSelector(){this.initiators.controls.forEach(e=>{e.get("client_iqn").updateValueAndValidity({emitEvent:!1})}),m.a.forEach(this.groupMembersSelections,(e,t)=>{m.a.forEach(e,(e,t)=>{const a=e.name;e.name=this.initiators.controls[t].value.client_iqn,this.groups.controls.forEach(t=>{const i=t.value.members,o=i.indexOf(a);-1!==o&&(i[o]=e.name),t.get("members").setValue(i)})}),this.groupMembersSelections[t]=[...this.groupMembersSelections[t]]})}removeInitiatorImage(e,t,a,i){const o=e.getValue("luns");return o.splice(t,1),e.patchValue({luns:o}),this.imagesInitiatorSelections[a].forEach(e=>{e.name===i&&(e.selected=!1)}),!1}get groups(){return this.targetForm.get("groups")}addGroup(){const e=new P.a({group_id:new o.h("",{validators:[o.A.required]}),members:new o.h([]),disks:new o.h([])});this.groups.push(e);const t=m.a.map(this.targetForm.getValue("disks"),e=>new X.a(!1,e,""));this.groupDiskSelections.push(t);const a=m.a.map(this.initiators.value,e=>new X.a(!1,e.client_iqn,"",!e.cdIsInGroup));return this.groupMembersSelections.push(a),e}removeGroup(e){this.groups.removeAt(e),this.groupMembersSelections[e].filter(e=>e.selected).forEach(t=>{t.selected=!1,this.onGroupMemberSelection({option:t},e)}),this.groupMembersSelections.splice(e,1),this.groupDiskSelections.splice(e,1)}onGroupMemberSelection(e,t){const a=e.option;let i=[];if(!a.selected){const e=this.groupDiskSelections[t].filter(e=>e.selected);i=e.map(e=>e.name)}this.initiators.controls.forEach((e,t)=>{e.value.client_iqn===a.name&&(e.patchValue({luns:i}),e.get("cdIsInGroup").setValue(a.selected),m.a.forEach(this.groupMembersSelections,e=>{e[t].enabled=!a.selected}),this.imagesInitiatorSelections[t].forEach(e=>{e.selected=i.includes(e.name)}))})}removeGroupInitiator(e,t,a){const i=e.getValue("members")[t];e.getValue("members").splice(t,1),this.onGroupMemberSelection({option:new X.a(!1,i,"")},a)}removeGroupDisk(e,t,a){const i=e.getValue("disks")[t];e.getValue("disks").splice(t,1),this.groupDiskSelections[a].forEach(e=>{e.name===i&&(e.selected=!1)}),this.groupDiskSelections[a]=[...this.groupDiskSelections[a]]}submit(){const e=m.a.cloneDeep(this.targetForm.value),t={target_iqn:this.targetForm.getValue("target_iqn"),target_controls:this.targetForm.getValue("target_controls"),acl_enabled:this.targetForm.getValue("acl_enabled"),portals:[],disks:[],clients:[],groups:[]};if(this.cephIscsiConfigVersion>10){const e=this.targetForm.get("auth");e.getValue("user")||e.get("user").setValue(""),e.getValue("password")||e.get("password").setValue(""),e.getValue("mutual_user")||e.get("mutual_user").setValue(""),e.getValue("mutual_password")||e.get("mutual_password").setValue("");const a=this.targetForm.getValue("acl_enabled");t.auth={user:a?"":e.getValue("user"),password:a?"":e.getValue("password"),mutual_user:a?"":e.getValue("mutual_user"),mutual_password:a?"":e.getValue("mutual_password")}}let a;e.disks.forEach(e=>{const a=e.split("/"),i=this.imagesSettings[e].backstore;t.disks.push({pool:a[0],image:a[1],backstore:i,controls:this.imagesSettings[e][i],lun:this.imagesSettings[e].lun,wwn:this.imagesSettings[e].wwn})}),e.portals.forEach(e=>{const a=e.indexOf(":");t.portals.push({host:e.substring(0,a),ip:e.substring(a+1)})}),t.acl_enabled&&(e.initiators.forEach(e=>{e.auth.user||(e.auth.user=""),e.auth.password||(e.auth.password=""),e.auth.mutual_user||(e.auth.mutual_user=""),e.auth.mutual_password||(e.auth.mutual_password=""),delete e.cdIsInGroup;const t=[];e.luns.forEach(e=>{const a=e.split("/");t.push({pool:a[0],image:a[1]})}),e.luns=t}),t.clients=e.initiators),t.acl_enabled&&(e.groups.forEach(e=>{const t=[];e.disks.forEach(e=>{const a=e.split("/");t.push({pool:a[0],image:a[1]})}),e.disks=t}),t.groups=e.groups),this.isEdit?(t.new_target_iqn=t.target_iqn,t.target_iqn=this.target_iqn,a=this.taskWrapper.wrapTaskAroundCall({task:new T.a("iscsi/target/edit",{target_iqn:t.target_iqn}),call:this.iscsiService.updateTarget(this.target_iqn,t)})):a=this.taskWrapper.wrapTaskAroundCall({task:new T.a("iscsi/target/create",{target_iqn:t.target_iqn}),call:this.iscsiService.createTarget(t)}),a.subscribe({error:()=>{this.targetForm.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/block/iscsi/targets"])})}targetSettingsModal(){const e={target_controls:this.targetForm.get("target_controls"),target_default_controls:this.target_default_controls,target_controls_limits:this.target_controls_limits};this.modalRef=this.modalService.show(ie,e)}imageSettingsModal(e){const t={imagesSettings:this.imagesSettings,image:e,api_version:this.api_version,disk_default_controls:this.disk_default_controls,disk_controls_limits:this.disk_controls_limits,backstores:this.getValidBackstores(this.getImageById(e)),control:this.targetForm.get("disks")};this.modalRef=this.modalService.show(te,t)}validFeatures(e,t){const a=e.features,i=this.required_rbd_features[t];return(a&i)===i&&0==(a&this.unsupported_rbd_features[t])}getImageById(e){return this.imagesAll.find(t=>e===`${t.pool_name}/${t.name}`)}getValidBackstores(e){return this.backstores.filter(t=>this.validFeatures(e,t))}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(S),v.Rb(F.a),v.Rb(W),v.Rb(s.e),v.Rb(s.a),v.Rb(R.a),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-form"]],features:[v.Ab],decls:1,vars:1,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d,u,m,p,f,h,g,v,S,D,w,_,W,y,X,I,k,P,$,T,F,R,E,z,N,C,V,A,x,O,M,B,q,L,G,U,j,Q,Y,K,H,J,Z,ee,te,ae,ie,oe,se,ne,ce;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Target IQN",a="Portals",i="Add portal",o="Images",s="Add image",n="ACL authentication",c="This field is required.",r="IQN has wrong pattern.",l="An IQN has the following notation 'iqn.$year-$month.$reversedAddress:$definedName'",b="For example: iqn.2016-06.org.dashboard:storage:disk.sn-a8675309",d="More information",u="This target has modified advanced settings.",m="At least " + "\ufffd0\ufffd" + " gateways are required.",p="Backstore: " + "\ufffd0\ufffd" + ".\xA0",f="This image has modified settings.",h="Duplicated LUN numbers.",g="Duplicated WWN.",v="User",S="Password",D="Mutual User",w="Mutual Password",_="This field is required.",W="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",y="This field is required.",X="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",I="This field is required.",k="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",P="This field is required.",$="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",T="Initiators",F="Add initiator",R="Initiator",E="Client IQN",z="User",N="Password",C="Mutual User",V="Mutual Password",A="Images",x="Initiator IQN needs to be unique.",O="This field is required.",M="IQN has wrong pattern.",B="This field is required.",q="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",L="This field is required.",G="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",U="This field is required.",j="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",Q="This field is required.",Y="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",K="Initiator belongs to a group. Images will be configure in the group.",H="Add image",J="No items added.",Z="Groups",ee="Add group",te="Group",ae="Name",ie="Initiators",oe="Add initiator",se="Images",ne="Add image",ce="No items added.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","targetForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","target_iqn",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],[1,"input-group"],["type","text","id","target_iqn","name","target_iqn","formControlName","target_iqn","cdTrim","",1,"form-control"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["class","form-text text-muted",4,"ngIf"],["for","portals",1,"cd-col-form-label","required"],a,[4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],["elemClass","btn btn-light float-right",3,"data","options","messages","selection"],[3,"ngClass"],i,["type","hidden","id","portals","name","portals","formControlName","portals",1,"form-control"],["for","disks",1,"cd-col-form-label"],o,["type","hidden","id","disks","name","disks","formControlName","disks",1,"form-control"],s,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","acl_enabled","name","acl_enabled","id","acl_enabled",1,"custom-control-input"],["for","acl_enabled",1,"custom-control-label"],n,["formGroupName","auth",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],c,r,l,b,["target","_blank","href","https://en.wikipedia.org/wiki/ISCSI#Addressing"],d,[1,"form-text","text-muted"],u,[1,"input-group","cd-mb"],["type","text","disabled","",1,"cd-form-control",3,"value"],["type","button",1,"btn","btn-light",3,"click"],m,["class","input-group-text",4,"ngIf"],[4,"ngIf"],[1,"input-group-text"],p,f,h,g,["formGroupName","auth"],["for","target_user",1,"cd-col-form-label"],v,["type","text","autocomplete","off","id","target_user","name","target_user","formControlName","user",1,"form-control"],["for","target_password",1,"cd-col-form-label"],S,["type","password","autocomplete","new-password","id","target_password","name","target_password","formControlName","password",1,"form-control"],["type","button","cdPasswordButton","target_password",1,"btn","btn-light"],["source","target_password"],["for","target_mutual_user",1,"cd-col-form-label"],D,["type","text","autocomplete","off","id","target_mutual_user","name","target_mutual_user","formControlName","mutual_user",1,"form-control"],["for","target_mutual_password",1,"cd-col-form-label"],w,["type","password","autocomplete","new-password","id","target_mutual_password","name","target_mutual_password","formControlName","mutual_password",1,"form-control"],["type","button","cdPasswordButton","target_mutual_password",1,"btn","btn-light"],["source","target_mutual_password"],_,W,y,X,I,k,P,$,["for","initiators",1,"cd-col-form-label"],T,["formArrayName","initiators",1,"cd-col-form-input"],["class","card mb-2",3,"formGroup",4,"ngFor","ngForOf"],[1,"btn","btn-light","float-right",3,"click"],F,[1,"card","mb-2",3,"formGroup"],R,["type","button",1,"close",3,"click"],["for","client_iqn",1,"cd-col-form-label","required"],E,["type","text","formControlName","client_iqn","cdTrim","",1,"form-control",3,"blur"],["for","user",1,"cd-col-form-label"],z,["formControlName","user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","password",1,"cd-col-form-label"],N,["formControlName","password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["type","button",1,"btn","btn-light",3,"cdPasswordButton"],[3,"source"],["for","mutual_user",1,"cd-col-form-label"],C,["formControlName","mutual_user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","mutual_password",1,"cd-col-form-label"],V,["formControlName","mutual_password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["for","luns",1,"cd-col-form-label"],A,["class","row",4,"ngIf"],x,O,M,B,q,L,G,U,j,Q,Y,K,["elemClass","btn btn-light float-right",3,"data","options","messages"],H,J,Z,["formArrayName","groups",1,"cd-col-form-input"],ee,te,["for","group_id",1,"cd-col-form-label","required"],ae,["type","text","formControlName","group_id",1,"form-control"],["for","members",1,"cd-col-form-label"],ie,oe,se,ne,ce]},template:function(e,t){1&e&&v.Pc(0,et,66,40,"div",0),2&e&&v.uc("cdFormLoading",t.loading)},directives:[oe.a,o.B,o.r,o.k,z.a,N.a,C.a,o.d,V.a,o.q,o.i,se,i.p,i.r,i.q,ne.a,o.b,A.a,o.l,ce.a,re.a,o.f],pipes:[i.A,le.a,Q.a],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),e})();var at=a("+fVR"),it=a("0+/T"),ot=a("uIqm"),st=a("x38r"),nt=a("vCyI"),ct=a("FFMq"),rt=a("G1/K"),lt=a("aexS"),bt=a("VTlA"),dt=a("mtw6"),ut=a("9nlD");function mt(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,31),v.Wb())}function pt(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,32),v.Wb())}function ft(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,33),v.Wb())}function ht(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,34),v.Wb())}function gt(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,35),v.Wb())}function vt(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,36),v.Wb())}function St(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,37),v.Wb())}function Dt(e,t){1&e&&(v.Xb(0,"span",30),v.bc(1,38),v.Wb())}let wt=(()=>{class e{constructor(e,t,a,i,o){this.authStorageService=e,this.activeModal=t,this.actionLabels=a,this.iscsiService=i,this.notificationService=o,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.permission=this.authStorageService.getPermissions().iscsi}ngOnInit(){this.hasPermission=this.permission.update,this.createForm(),this.iscsiService.getDiscovery().subscribe(e=>{this.discoveryForm.patchValue(e)})}createForm(){this.discoveryForm=new P.a({user:new o.h({value:"",disabled:!this.hasPermission}),password:new o.h({value:"",disabled:!this.hasPermission}),mutual_user:new o.h({value:"",disabled:!this.hasPermission}),mutual_password:new o.h({value:"",disabled:!this.hasPermission})}),$.a.validateIf(this.discoveryForm.get("user"),()=>this.discoveryForm.getValue("password")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),$.a.validateIf(this.discoveryForm.get("password"),()=>this.discoveryForm.getValue("user")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),$.a.validateIf(this.discoveryForm.get("mutual_user"),()=>this.discoveryForm.getValue("mutual_password"),[o.A.required],[o.A.pattern(this.USER_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_password")]),$.a.validateIf(this.discoveryForm.get("mutual_password"),()=>this.discoveryForm.getValue("mutual_user"),[o.A.required],[o.A.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user")])}submitAction(){this.iscsiService.updateDiscovery(this.discoveryForm.value).subscribe(()=>{this.notificationService.show(dt.a.success,"Updated discovery authentication"),this.activeModal.close()},()=>{this.discoveryForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(c.a),v.Rb(l.b),v.Rb(S),v.Rb(ut.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-discovery-modal"]],decls:46,vars:13,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d,u;return e="Discovery Authentication",t="User",a="Password",i="Mutual User",o="Mutual Password",s="This field is required.",n="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",c="This field is required.",r="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",l="This field is required.",b="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",d="This field is required.",u="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","discoveryForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],t,[1,"cd-col-form-input"],["id","user","formControlName","user","type","text","autocomplete","off",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","password",1,"cd-col-form-label"],a,[1,"input-group"],["id","password","formControlName","password","type","password","autocomplete","new-password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-light"],["source","password"],["for","mutual_user",1,"cd-col-form-label"],i,["id","mutual_user","formControlName","mutual_user","type","text","autocomplete","off",1,"form-control"],["for","mutual_password",1,"cd-col-form-label"],o,["id","mutual_password","formControlName","mutual_password","type","password","autocomplete","new-password",1,"form-control"],["type","button","cdPasswordButton","mutual_password",1,"btn","btn-light"],["source","mutual_password"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"invalid-feedback"],s,n,c,r,l,b,d,u]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"div",7),v.Xb(8,"label",8),v.bc(9,9),v.Wb(),v.Xb(10,"div",10),v.Sb(11,"input",11),v.Pc(12,mt,2,0,"span",12),v.Pc(13,pt,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(14,"div",7),v.Xb(15,"label",13),v.bc(16,14),v.Wb(),v.Xb(17,"div",10),v.Xb(18,"div",15),v.Sb(19,"input",16),v.Xb(20,"span",17),v.Sb(21,"button",18),v.Sb(22,"cd-copy-2-clipboard-button",19),v.Wb(),v.Wb(),v.Pc(23,ft,2,0,"span",12),v.Pc(24,ht,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(25,"div",7),v.Xb(26,"label",20),v.Vb(27),v.bc(28,21),v.Ub(),v.Wb(),v.Xb(29,"div",10),v.Sb(30,"input",22),v.Pc(31,gt,2,0,"span",12),v.Pc(32,vt,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(33,"div",7),v.Xb(34,"label",23),v.bc(35,24),v.Wb(),v.Xb(36,"div",10),v.Xb(37,"div",15),v.Sb(38,"input",25),v.Xb(39,"span",17),v.Sb(40,"button",26),v.Sb(41,"cd-copy-2-clipboard-button",27),v.Wb(),v.Wb(),v.Pc(42,St,2,0,"span",12),v.Pc(43,Dt,2,0,"span",12),v.Wb(),v.Wb(),v.Wb(),v.Xb(44,"div",28),v.Xb(45,"cd-form-button-panel",29),v.lc("submitActionEvent",function(){return t.submitAction()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.discoveryForm),v.Db(8),v.uc("ngIf",t.discoveryForm.showError("user",e,"required")),v.Db(1),v.uc("ngIf",t.discoveryForm.showError("user",e,"pattern")),v.Db(10),v.uc("ngIf",t.discoveryForm.showError("password",e,"required")),v.Db(1),v.uc("ngIf",t.discoveryForm.showError("password",e,"pattern")),v.Db(7),v.uc("ngIf",t.discoveryForm.showError("mutual_user",e,"required")),v.Db(1),v.uc("ngIf",t.discoveryForm.showError("mutual_user",e,"pattern")),v.Db(10),v.uc("ngIf",t.discoveryForm.showError("mutual_password",e,"required")),v.Db(1),v.uc("ngIf",t.discoveryForm.showError("mutual_password",e,"pattern")),v.Db(2),v.uc("form",t.discoveryForm)("showSubmit",t.hasPermission)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.B,o.r,o.k,z.a,N.a,C.a,o.d,V.a,o.q,o.i,i.r,ce.a,re.a,A.a],styles:[""]}),e})(),_t=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(s.e))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-tabs"]],decls:8,vars:1,consts:function(){let e,t;return e="Overview",t="Targets",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/iscsi/overview"],["ngbNavLink",""],e,["ngbNavItem","/block/iscsi/targets"],t]},template:function(e,t){1&e&&(v.Xb(0,"ul",0,1),v.lc("navChange",function(e){return t.router.navigate([e.nextId])}),v.Xb(2,"li",2),v.Xb(3,"a",3),v.bc(4,4),v.Wb(),v.Wb(),v.Xb(5,"li",5),v.Xb(6,"a",3),v.bc(7,6),v.Wb(),v.Wb(),v.Wb()),2&e&&v.uc("activeId",t.router.url)},directives:[c.p,c.r,c.s],styles:[""]}),e})();var Wt=a("/NlG"),yt=a("6qls"),Xt=a("S7zO"),It=a("iExv");const kt=["highlightTpl"],Pt=["detailTable"],$t=["tree"],Tt=function(){return["logged_in"]},Ft=function(){return["logged_out"]},Rt=function(e,t){return{"badge-success":e,"badge-danger":t}};function Et(e,t){if(1&e&&(v.Sb(0,"i"),v.Xb(1,"span"),v.Rc(2),v.Wb(),v.Rc(3," \xa0 "),v.Xb(4,"span",8),v.Rc(5),v.Wb()),2&e){const e=t.$implicit;v.Fb(e.data.cdIcon),v.Db(2),v.Sc(e.data.name),v.Db(2),v.uc("ngClass",v.Ac(7,Rt,v.yc(5,Tt).includes(e.data.status),v.yc(6,Ft).includes(e.data.status))),v.Db(1),v.Tc(" ",e.data.status," ")}}function zt(e,t){if(1&e&&(v.Xb(0,"div",9),v.Xb(1,"legend"),v.Rc(2),v.Wb(),v.Sb(3,"cd-table",10,11),v.Wb()),2&e){const e=v.nc();v.Db(2),v.Sc(e.title),v.Db(1),v.uc("data",e.data)("columns",e.columns)("limit",0)}}function Nt(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Wb()),2&e){const e=v.nc().value;v.Db(1),v.Sc(e)}}function Ct(e,t){if(1&e&&(v.Xb(0,"strong"),v.Rc(1),v.Wb()),2&e){const e=v.nc().value;v.Db(1),v.Sc(e)}}function Vt(e,t){if(1&e&&(v.Pc(0,Nt,2,1,"span",12),v.Pc(1,Ct,2,1,"strong",12)),2&e){const e=t.row;v.uc("ngIf",void 0===e.default||e.default===e.current),v.Db(1),v.uc("ngIf",void 0!==e.default&&e.default!==e.current)}}let At=(()=>{class e{constructor(e,t){this.iscsiBackstorePipe=e,this.booleanTextPipe=t,this.icons=I.a,this.metadata={},this.nodes=[],this.treeOptions={useVirtualScroll:!0,actionMapping:{mouse:{click:this.onNodeSelected.bind(this)}}}}set content(e){this.detailTable=e,e&&e.updateColumns()}ngOnInit(){this.columns=[{prop:"displayName",name:"Name",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"current",name:"Current",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"default",name:"Default",flexGrow:1,cellTemplate:this.highlightTpl}]}ngOnChanges(){this.selection&&(this.selectedItem=this.selection,this.generateTree()),this.data=void 0}generateTree(){const e=m.a.cloneDeep(this.selectedItem.target_controls);this.cephIscsiConfigVersion>10&&m.a.extend(e,m.a.cloneDeep(this.selectedItem.auth)),this.metadata={root:e};const t={target:{expanded:m.a.join(this.selectedItem.cdExecuting?[I.a.large,I.a.spinner,I.a.spin]:[I.a.large,I.a.bullseye]," ")},initiators:{expanded:m.a.join([I.a.large,I.a.user]," "),leaf:m.a.join([I.a.user]," ")},groups:{expanded:m.a.join([I.a.large,I.a.users]," "),leaf:m.a.join([I.a.users]," ")},disks:{expanded:m.a.join([I.a.large,I.a.disk]," "),leaf:m.a.join([I.a.disk]," ")},portals:{expanded:m.a.join([I.a.large,I.a.server]," "),leaf:m.a.join([I.a.server]," ")}},a=[];m.a.forEach(this.selectedItem.disks,e=>{const i="disk_"+e.pool+"_"+e.image;this.metadata[i]={controls:e.controls,backstore:e.backstore},["wwn","lun"].forEach(t=>{t in e&&(this.metadata[i][t]=e[t])}),a.push({name:`${e.pool}/${e.image}`,cdId:i,cdIcon:t.disks.leaf})});const i=[];m.a.forEach(this.selectedItem.portals,e=>{i.push({name:`${e.host}:${e.ip}`,cdIcon:t.portals.leaf})});const o=[];m.a.forEach(this.selectedItem.clients,e=>{const a=m.a.cloneDeep(e.auth);e.info&&(m.a.extend(a,e.info),delete a.state,m.a.forEach(Object.keys(e.info.state),t=>{a[t.toLowerCase()]=e.info.state[t]})),this.metadata["client_"+e.client_iqn]=a;const i=[];e.luns.forEach(e=>{i.push({name:`${e.pool}/${e.image}`,cdId:"disk_"+e.pool+"_"+e.image,cdIcon:t.disks.leaf})});let s="";e.info&&(s=Object.keys(e.info.state).includes("LOGGED_IN")?"logged_in":"logged_out"),o.push({name:e.client_iqn,status:s,cdId:"client_"+e.client_iqn,children:i,cdIcon:t.initiators.leaf})});const s=[];m.a.forEach(this.selectedItem.groups,e=>{const a=[];e.disks.forEach(e=>{a.push({name:`${e.pool}/${e.image}`,cdId:"disk_"+e.pool+"_"+e.image,cdIcon:t.disks.leaf})});const i=[];e.members.forEach(e=>{i.push({name:e,cdId:"client_"+e})}),s.push({name:e.group_id,cdIcon:t.groups.leaf,children:[{name:"Disks",children:a,cdIcon:t.disks.expanded},{name:"Initiators",children:i,cdIcon:t.initiators.expanded}]})}),this.nodes=[{name:this.selectedItem.target_iqn,cdId:"root",isExpanded:!0,cdIcon:t.target.expanded,children:[{name:"Disks",isExpanded:!0,children:a,cdIcon:t.disks.expanded},{name:"Portals",isExpanded:!0,children:i,cdIcon:t.portals.expanded},{name:"Initiators",isExpanded:!0,children:o,cdIcon:t.initiators.expanded},{name:"Groups",isExpanded:!0,children:s,cdIcon:t.groups.expanded}]}]}format(e){return"boolean"==typeof e?this.booleanTextPipe.transform(e):e}onNodeSelected(e,t){var a,i,o,s;if(n.a.ACTIVATE(e,t,!0),t.data.cdId){this.title=t.data.name;const e=this.metadata[t.data.cdId]||{};"root"===t.data.cdId?(null===(a=this.detailTable)||void 0===a||a.toggleColumn({prop:"default",isHidden:!0}),this.data=m.a.map(this.settings.target_default_controls,(t,a)=>({displayName:a,default:t=this.format(t),current:m.a.isUndefined(e[a])?t:this.format(e[a])})),this.cephIscsiConfigVersion>10&&["user","password","mutual_user","mutual_password"].forEach(t=>{this.data.push({displayName:t,default:null,current:e[t]})})):t.data.cdId.toString().startsWith("disk_")?(null===(i=this.detailTable)||void 0===i||i.toggleColumn({prop:"default",isHidden:!0}),this.data=m.a.map(this.settings.disk_default_controls[e.backstore],(t,a)=>({displayName:a,default:t=this.format(t),current:m.a.isUndefined(e.controls[a])?t:this.format(e.controls[a])})),this.data.push({displayName:"backstore",default:this.iscsiBackstorePipe.transform(this.settings.default_backstore),current:this.iscsiBackstorePipe.transform(e.backstore)}),["wwn","lun"].forEach(t=>{t in e&&this.data.push({displayName:t,default:void 0,current:e[t]})})):(null===(o=this.detailTable)||void 0===o||o.toggleColumn({prop:"default",isHidden:!1}),this.data=m.a.map(e,(e,t)=>({displayName:t,default:void 0,current:this.format(e)})))}else this.data=void 0;null===(s=this.detailTable)||void 0===s||s.updateColumns()}onUpdateData(){this.tree.treeModel.expandAll()}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(Q.a),v.Rb(It.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-details"]],viewQuery:function(e,t){if(1&e&&(v.Wc(kt,3),v.Wc(Pt,1),v.Wc($t,1)),2&e){let e;v.Ec(e=v.mc())&&(t.highlightTpl=e.first),v.Ec(e=v.mc())&&(t.content=e.first),v.Ec(e=v.mc())&&(t.tree=e.first)}},inputs:{selection:"selection",settings:"settings",cephIscsiConfigVersion:"cephIscsiConfigVersion"},features:[v.Bb],decls:11,vars:3,consts:function(){let e;return e="iSCSI Topology",[[1,"row"],[1,"col-6"],e,[3,"nodes","options","updateData"],["tree",""],["treeNodeTemplate",""],["class","col-6 metadata",4,"ngIf"],["highlightTpl",""],[1,"badge",3,"ngClass"],[1,"col-6","metadata"],["columnMode","flex",3,"data","columns","limit"],["detailTable",""],[4,"ngIf"]]},template:function(e,t){1&e&&(v.Xb(0,"div",0),v.Xb(1,"div",1),v.Xb(2,"legend"),v.bc(3,2),v.Wb(),v.Xb(4,"tree-root",3,4),v.lc("updateData",function(){return t.onUpdateData()}),v.Pc(6,Et,6,10,"ng-template",null,5,v.Qc),v.Wb(),v.Wb(),v.Pc(8,zt,5,4,"div",6),v.Wb(),v.Pc(9,Vt,2,2,"ng-template",null,7,v.Qc)),2&e&&(v.Db(4),v.uc("nodes",t.nodes)("options",t.treeOptions),v.Db(4),v.uc("ngIf",t.data))},directives:[n.b,i.r,i.p,ot.a],styles:[""]}),e})();function xt(e,t){if(1&e&&(v.Vb(0),v.Sb(1,"br"),v.Xb(2,"span"),v.bc(3,6),v.Wb(),v.Xb(4,"pre"),v.Rc(5),v.Wb(),v.Ub()),2&e){const e=v.nc(2);v.Db(5),v.Sc(e.status)}}function Ot(e,t){if(1&e&&(v.Xb(0,"cd-alert-panel",2),v.Vb(1),v.hc(2,3),v.Sb(3,"cd-doc",4),v.ec(),v.Ub(),v.Pc(4,xt,6,1,"ng-container",5),v.Wb()),2&e){const e=v.nc();v.Db(4),v.uc("ngIf",e.status)}}function Mt(e,t){if(1&e&&v.Sb(0,"cd-iscsi-target-details",15),2&e){const e=v.nc(2);v.uc("cephIscsiConfigVersion",e.cephIscsiConfigVersion)("selection",e.expandedRow)("settings",e.settings)}}const Bt=function(e){return[e]};function qt(e,t){if(1&e){const e=v.Yb();v.Xb(0,"cd-table",7,8),v.lc("fetchData",function(){return v.Ic(e),v.nc().getTargets()})("setExpandedRow",function(t){return v.Ic(e),v.nc().setExpandedRow(t)})("updateSelection",function(t){return v.Ic(e),v.nc().updateSelection(t)}),v.Xb(2,"div",9),v.Sb(3,"cd-table-actions",10),v.Xb(4,"button",11),v.lc("click",function(){return v.Ic(e),v.nc().configureDiscoveryAuth()}),v.Sb(5,"i",12),v.Vb(6),v.bc(7,13),v.Ub(),v.Wb(),v.Wb(),v.Pc(8,Mt,1,3,"cd-iscsi-target-details",14),v.Wb()}if(2&e){const e=v.nc();v.uc("data",e.targets)("columns",e.columns)("hasDetails",!0)("autoReload",!1)("status",e.tableStatus),v.Db(3),v.uc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),v.Db(2),v.uc("ngClass",v.zc(10,Bt,e.icons.key)),v.Db(3),v.uc("ngIf",e.expandedRow)}}let Lt=(()=>{class e extends at.a{constructor(e,t,a,i,o,s,n,c,r){super(r),this.authStorageService=e,this.iscsiService=t,this.joinPipe=a,this.taskListService=i,this.notAvailablePipe=o,this.modalService=s,this.taskWrapper=n,this.actionLabels=c,this.ngZone=r,this.available=void 0,this.selection=new nt.a,this.targets=[],this.icons=I.a,this.builders={"iscsi/target/create":e=>({target_iqn:e.target_iqn})},this.permission=this.authStorageService.getPermissions().iscsi,this.tableActions=[{permission:"create",icon:I.a.add,routerLink:()=>"/block/iscsi/targets/create",name:this.actionLabels.CREATE},{permission:"update",icon:I.a.edit,routerLink:()=>`/block/iscsi/targets/edit/${this.selection.first().target_iqn}`,name:this.actionLabels.EDIT,disable:()=>this.getEditDisableDesc()},{permission:"delete",icon:I.a.destroy,click:()=>this.deleteIscsiTargetModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Target",prop:"target_iqn",flexGrow:2,cellTransformation:st.a.executing},{name:"Portals",prop:"cdPortals",pipe:this.joinPipe,flexGrow:2},{name:"Images",prop:"cdImages",pipe:this.joinPipe,flexGrow:2},{name:"# Sessions",prop:"info.num_sessions",pipe:this.notAvailablePipe,flexGrow:1}],this.iscsiService.status().subscribe(e=>{this.available=e.available,e.available||(this.status=e.message)})}getTargets(){this.available&&(this.setTableRefreshTimeout(),this.iscsiService.version().subscribe(e=>{this.cephIscsiConfigVersion=e.ceph_iscsi_config_version}),this.taskListService.init(()=>this.iscsiService.listTargets(),e=>this.prepareResponse(e),e=>this.targets=e,()=>this.onFetchError(),this.taskFilter,this.itemFilter,this.builders),this.iscsiService.settings().subscribe(e=>{this.settings=e}))}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}getEditDisableDesc(){const e=this.selection.first();return e&&(null==e?void 0:e.cdExecuting)?e.cdExecuting:e&&m.a.isUndefined(null==e?void 0:e.info)?"Unavailable gateway(s)":!e}getDeleteDisableDesc(){var e;const t=this.selection.first();return(null==t?void 0:t.cdExecuting)?t.cdExecuting:t&&m.a.isUndefined(null==t?void 0:t.info)?"Unavailable gateway(s)":t&&(null===(e=null==t?void 0:t.info)||void 0===e?void 0:e.num_sessions)?"Target has active sessions":!t}prepareResponse(e){return e.forEach(e=>{e.cdPortals=e.portals.map(e=>`${e.host}:${e.ip}`),e.cdImages=e.disks.map(e=>`${e.pool}/${e.image}`)}),e}onFetchError(){this.table.reset()}itemFilter(e,t){return e.target_iqn===t.metadata.target_iqn}taskFilter(e){return["iscsi/target/create","iscsi/target/edit","iscsi/target/delete"].includes(e.name)}updateSelection(e){this.selection=e}deleteIscsiTargetModal(){const e=this.selection.first().target_iqn;this.modalRef=this.modalService.show(it.a,{itemDescription:"iSCSI target",itemNames:[e],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new T.a("iscsi/target/delete",{target_iqn:e}),call:this.iscsiService.deleteTarget(e)})})}configureDiscoveryAuth(){this.modalService.show(wt)}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(S),v.Rb(ct.a),v.Rb(bt.a),v.Rb(rt.a),v.Rb(F.a),v.Rb(R.a),v.Rb(l.b),v.Rb(v.D))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi-target-list"]],viewQuery:function(e,t){if(1&e&&v.Wc(ot.a,1),2&e){let e;v.Ec(e=v.mc())&&(t.table=e.first)}},features:[v.Cb([bt.a]),v.Ab],decls:3,vars:2,consts:function(){let e,t,a,i;return e="iSCSI Targets not available",t="Please consult the " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + " on how to configure and enable the iSCSI Targets management functionality.",a="Available information:",i="Discovery authentication",[["type","info","title",e,4,"ngIf"],["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection",4,"ngIf"],["type","info","title",e],t,["section","iscsi"],[4,"ngIf"],a,["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],i,["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings",4,"ngIf"],["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings"]]},template:function(e,t){1&e&&(v.Sb(0,"cd-iscsi-tabs"),v.Pc(1,Ot,5,1,"cd-alert-panel",0),v.Pc(2,qt,9,12,"cd-table",1)),2&e&&(v.Db(1),v.uc("ngIf",!1===t.available),v.Db(1),v.uc("ngIf",!0===t.available))},directives:[_t,i.r,Wt.a,yt.a,ot.a,Xt.a,C.a,i.p,At],styles:[""]}),e})();var Gt=a("o4+5"),Ut=a("dgut"),jt=a("Dwqy");const Qt=["iscsiSparklineTpl"],Yt=["iscsiPerSecondTpl"],Kt=["iscsiRelativeDateTpl"];function Ht(e,t){if(1&e&&(v.Xb(0,"span"),v.Sb(1,"cd-sparkline",9),v.Wb()),2&e){const e=v.nc(),t=e.value,a=e.row;v.Db(1),v.uc("data",t)("isBinary",a.cdIsBinary)}}function Jt(e,t){1&e&&(v.Xb(0,"span",10),v.Rc(1," n/a "),v.Wb())}function Zt(e,t){if(1&e&&(v.Pc(0,Ht,2,2,"span",7),v.Pc(1,Jt,2,0,"span",8)),2&e){const e=t.row;v.uc("ngIf","user:rbd"===e.backstore),v.Db(1),v.uc("ngIf","user:rbd"!==e.backstore)}}function ea(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Wb()),2&e){const e=v.nc().value;v.Db(1),v.Tc(" ",e," /s ")}}function ta(e,t){1&e&&(v.Xb(0,"span",10),v.Rc(1," n/a "),v.Wb())}function aa(e,t){if(1&e&&(v.Pc(0,ea,2,1,"span",7),v.Pc(1,ta,2,0,"span",8)),2&e){const e=t.row;v.uc("ngIf","user:rbd"===e.backstore),v.Db(1),v.uc("ngIf","user:rbd"!==e.backstore)}}function ia(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.oc(2,"notAvailable"),v.oc(3,"relativeDate"),v.Wb()),2&e){const e=v.nc().value;v.Db(1),v.Tc(" ",v.pc(2,1,v.pc(3,3,e))," ")}}function oa(e,t){1&e&&(v.Xb(0,"span",10),v.Rc(1," n/a "),v.Wb())}function sa(e,t){if(1&e&&(v.Pc(0,ia,4,5,"span",7),v.Pc(1,oa,2,0,"span",8)),2&e){const e=t.row;v.uc("ngIf","user:rbd"===e.backstore),v.Db(1),v.uc("ngIf","user:rbd"!==e.backstore)}}let na=(()=>{class e{constructor(e,t,a){this.iscsiService=e,this.dimlessPipe=t,this.iscsiBackstorePipe=a,this.gateways=[],this.images=[]}ngOnInit(){this.gatewaysColumns=[{name:"Name",prop:"name"},{name:"State",prop:"state",flexGrow:1,cellTransformation:st.a.badge,customTemplateConfig:{map:{up:{class:"badge-success"},down:{class:"badge-danger"}}}},{name:"# Targets",prop:"num_targets"},{name:"# Sessions",prop:"num_sessions"}],this.imagesColumns=[{name:"Pool",prop:"pool"},{name:"Image",prop:"image"},{name:"Backstore",prop:"backstore",pipe:this.iscsiBackstorePipe},{name:"Read Bytes",prop:"stats_history.rd_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Write Bytes",prop:"stats_history.wr_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Read Ops",prop:"stats.rd",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"Write Ops",prop:"stats.wr",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"A/O Since",prop:"optimized_since",cellTemplate:this.iscsiRelativeDateTpl}]}refresh(){this.iscsiService.overview().subscribe(e=>{this.gateways=e.gateways,this.images=e.images,this.images.map(e=>(e.stats_history&&(e.stats_history.rd_bytes=e.stats_history.rd_bytes.map(e=>e[1]),e.stats_history.wr_bytes=e.stats_history.wr_bytes.map(e=>e[1])),e.cdIsBinary=!0,e))})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(S),v.Rb(Gt.a),v.Rb(Q.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-iscsi"]],viewQuery:function(e,t){if(1&e&&(v.Wc(Qt,3),v.Wc(Yt,3),v.Wc(Kt,3)),2&e){let e;v.Ec(e=v.mc())&&(t.iscsiSparklineTpl=e.first),v.Ec(e=v.mc())&&(t.iscsiPerSecondTpl=e.first),v.Ec(e=v.mc())&&(t.iscsiRelativeDateTpl=e.first)}},decls:13,vars:4,consts:function(){let e,t;return e="Gateways",t="Images",[e,[3,"data","columns","fetchData"],t,[3,"data","columns"],["iscsiSparklineTpl",""],["iscsiPerSecondTpl",""],["iscsiRelativeDateTpl",""],[4,"ngIf"],["class","text-muted",4,"ngIf"],[3,"data","isBinary"],[1,"text-muted"]]},template:function(e,t){1&e&&(v.Sb(0,"cd-iscsi-tabs"),v.Xb(1,"legend"),v.bc(2,0),v.Wb(),v.Xb(3,"cd-table",1),v.lc("fetchData",function(){return t.refresh()}),v.Wb(),v.Xb(4,"legend"),v.bc(5,2),v.Wb(),v.Sb(6,"cd-table",3),v.Pc(7,Zt,2,2,"ng-template",null,4,v.Qc),v.Pc(9,aa,2,2,"ng-template",null,5,v.Qc),v.Pc(11,sa,2,2,"ng-template",null,6,v.Qc)),2&e&&(v.Db(3),v.uc("data",t.gateways)("columns",t.gatewaysColumns),v.Db(3),v.uc("data",t.images)("columns",t.imagesColumns))},directives:[_t,ot.a,i.r,Ut.a],pipes:[rt.a,jt.a],styles:[""]}),e})(),ca=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=v.Pb({type:e}),e.\u0275inj=v.Ob({imports:[[i.c,d.a,c.t,s.i,o.m,o.x,c.A]]}),e})();var ra=a("quSY"),la=a("2Vo4"),ba=a("pLZG"),da=a("lOp/");let ua=(()=>{let e=class{constructor(e,t){this.http=e,this.timerService=t,this.REFRESH_INTERVAL=3e4,this.summaryDataSource=new la.a(null),this.summaryData$=this.summaryDataSource.asObservable()}startPolling(){return this.timerService.get(()=>this.retrieveSummaryObservable(),this.REFRESH_INTERVAL).subscribe(this.retrieveSummaryObserver())}refresh(){return this.retrieveSummaryObservable().subscribe(this.retrieveSummaryObserver())}retrieveSummaryObservable(){return this.http.get("api/block/mirroring/summary")}retrieveSummaryObserver(){return e=>{this.summaryDataSource.next(e)}}subscribeSummary(e,t){return this.summaryData$.pipe(Object(ba.a)(e=>!!e)).subscribe(e,t)}getPool(e){return this.http.get(`api/block/mirroring/pool/${e}`)}updatePool(e,t){return this.http.put(`api/block/mirroring/pool/${e}`,t,{observe:"response"})}getSiteName(){return this.http.get("api/block/mirroring/site_name")}setSiteName(e){return this.http.put("api/block/mirroring/site_name",{site_name:e},{observe:"response"})}createBootstrapToken(e){return this.http.post(`api/block/mirroring/pool/${e}/bootstrap/token`,{})}importBootstrapToken(e,t,a){return this.http.post(`api/block/mirroring/pool/${e}/bootstrap/peer`,{direction:t,token:a},{observe:"response"})}getPeer(e,t){return this.http.get(`api/block/mirroring/pool/${e}/peer/${t}`)}addPeer(e,t){return this.http.post(`api/block/mirroring/pool/${e}/peer`,t,{observe:"response"})}updatePeer(e,t,a){return this.http.put(`api/block/mirroring/pool/${e}/peer/${t}`,a,{observe:"response"})}deletePeer(e,t){return this.http.delete(`api/block/mirroring/pool/${e}/peer/${t}`,{observe:"response"})}};return e.\u0275fac=function(t){return new(t||e)(v.ic(h.b),v.ic(da.a))},e.\u0275prov=v.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),Object(f.b)([Object(f.e)(0,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[String]),Object(f.d)("design:returntype",void 0)],e.prototype,"setSiteName",null),Object(f.b)([Object(f.e)(1,g.b),Object(f.e)(2,g.b),Object(f.d)("design:type",Function),Object(f.d)("design:paramtypes",[String,String,String]),Object(f.d)("design:returntype",void 0)],e.prototype,"importBootstrapToken",null),e=Object(f.b)([g.a,Object(f.d)("design:paramtypes",[h.b,da.a])],e),e})();var ma=a("GyhO"),pa=a("vkgz"),fa=a("NJ9Y"),ha=a("IZUe"),ga=a("sb0X"),va=a("Z21x");function Sa(e,t){1&e&&(v.Xb(0,"span",25),v.bc(1,26),v.Wb())}function Da(e,t){if(1&e&&(v.Xb(0,"div",27),v.Sb(1,"input",28),v.Xb(2,"label",29),v.Rc(3),v.Wb(),v.Wb()),2&e){const e=t.$implicit;v.Db(1),v.vc("id",e.name),v.vc("name",e.name),v.vc("formControlName",e.name),v.Db(1),v.vc("for",e.name),v.Db(1),v.Sc(e.name)}}function wa(e,t){1&e&&(v.Xb(0,"span",25),v.bc(1,30),v.Wb())}let _a=(()=>{class e{constructor(e,t,a){this.activeModal=e,this.rbdMirroringService=t,this.taskWrapper=a,this.pools=[],this.createForm()}createForm(){this.createBootstrapForm=new P.a({siteName:new o.h("",{validators:[o.A.required]}),pools:new o.j({},{validators:[this.validatePools()]}),token:new o.h("",{})})}ngOnInit(){this.createBootstrapForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(e=>{this.createBootstrapForm.get("siteName").setValue(e.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.pools=e.content_data.pools.reduce((e,t)=>(e.push({name:t.name,mirror_mode:t.mirror_mode}),e),[]);const t=this.createBootstrapForm.get("pools");m.a.each(this.pools,e=>{const a=e.name,i="disabled"===e.mirror_mode,s=t.controls[a];s?i&&s.disabled?s.enable():!i&&s.enabled&&(s.disable(),s.setValue(!0)):t.addControl(a,new o.h({value:!i,disabled:!i}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return e=>{let t=0;return m.a.each(e.controls,e=>{!0===e.value&&++t}),t>0?null:{requirePool:!0}}}generate(){this.createBootstrapForm.get("token").setValue("");let e="";const t=[],a=this.createBootstrapForm.get("pools");m.a.each(a.controls,(a,i)=>{!0===a.value&&(e=i,a.disabled||t.push(i))});const i={mirror_mode:"image"},o=Object(ma.a)(this.rbdMirroringService.setSiteName(this.createBootstrapForm.getValue("siteName")),Object(p.a)(t.map(e=>this.rbdMirroringService.updatePool(e,i))),this.rbdMirroringService.createBootstrapToken(e).pipe(Object(pa.a)(e=>this.createBootstrapForm.get("token").setValue(e.token)))).pipe(Object(fa.a)()),s=()=>{this.rbdMirroringService.refresh(),this.createBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/mirroring/bootstrap/create",{}),call:o}).subscribe({error:s,complete:s})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(ua),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-bootstrap-create-modal"]],decls:32,vars:6,consts:function(){let e,t,a,i,o,s,n,c,r,l,b;return e="Create Bootstrap Token",t="To create a bootstrap token which can be imported by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, and click\xA0 " + "\ufffd#10\ufffd" + "Generate" + "\ufffd/#10\ufffd" + ".",a="Site Name",i="Name...",o="Pools",s="Generate",n="Token",c="Generated token...",r="Close",l="This field is required.",b="At least one pool is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","createBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],a,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],o,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"mb-4","float-right",3,"form","submitAction"],s,["for","token",1,"col-form-label"],n,["placeholder",c,"id","token","formControlName","token","readonly","",1,"form-control","resize-vertical"],["source","token",1,"float-right"],[1,"modal-footer"],["name",r,3,"backAction"],[1,"invalid-feedback"],l,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],b]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.Vb(8),v.hc(9,7),v.Sb(10,"kbd"),v.ec(),v.Ub(),v.Wb(),v.Xb(11,"div",8),v.Xb(12,"label",9),v.bc(13,10),v.Wb(),v.Sb(14,"input",11),v.Pc(15,Sa,2,0,"span",12),v.Wb(),v.Xb(16,"div",13),v.Xb(17,"label",14),v.bc(18,15),v.Wb(),v.Pc(19,Da,4,5,"div",16),v.Pc(20,wa,2,0,"span",12),v.Wb(),v.Xb(21,"cd-submit-button",17),v.lc("submitAction",function(){return t.generate()}),v.bc(22,18),v.Wb(),v.Xb(23,"div",8),v.Xb(24,"label",19),v.Xb(25,"span"),v.bc(26,20),v.Wb(),v.Wb(),v.Xb(27,"textarea",21),v.Rc(28,"          "),v.Wb(),v.Wb(),v.Sb(29,"cd-copy-2-clipboard-button",22),v.Wb(),v.Xb(30,"div",23),v.Xb(31,"cd-back-button",24),v.lc("backAction",function(){return t.activeModal.close()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.createBootstrapForm),v.Db(11),v.uc("ngIf",t.createBootstrapForm.showError("siteName",e,"required")),v.Db(4),v.uc("ngForOf",t.pools),v.Db(1),v.uc("ngIf",t.createBootstrapForm.showError("pools",e,"requirePool")),v.Db(1),v.uc("form",t.createBootstrapForm)}},directives:[E.a,o.B,o.r,z.a,o.k,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.r,o.l,i.q,ga.a,re.a,va.a,o.b],styles:[".form-group.ng-invalid[_ngcontent-%COMP%]   .invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),e})();function Wa(e,t){1&e&&(v.Xb(0,"span",26),v.bc(1,27),v.Wb())}function ya(e,t){if(1&e&&(v.Xb(0,"option",28),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e.key),v.Db(1),v.Sc(e.desc)}}function Xa(e,t){if(1&e&&(v.Xb(0,"div",29),v.Sb(1,"input",30),v.Xb(2,"label",31),v.Rc(3),v.Wb(),v.Wb()),2&e){const e=t.$implicit;v.Db(1),v.vc("id",e.name),v.vc("name",e.name),v.vc("formControlName",e.name),v.Db(1),v.vc("for",e.name),v.Db(1),v.Sc(e.name)}}function Ia(e,t){1&e&&(v.Xb(0,"span",26),v.bc(1,32),v.Wb())}function ka(e,t){1&e&&(v.Xb(0,"span",26),v.bc(1,33),v.Wb())}function Pa(e,t){1&e&&(v.Xb(0,"span",26),v.bc(1,34),v.Wb())}let $a=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.pools=[],this.directions=[{key:"rx-tx",desc:"Bidirectional"},{key:"rx",desc:"Unidirectional (receive-only)"}],this.createForm()}createForm(){this.importBootstrapForm=new P.a({siteName:new o.h("",{validators:[o.A.required]}),direction:new o.h("rx-tx",{}),pools:new o.j({},{validators:[this.validatePools()]}),token:new o.h("",{validators:[o.A.required,this.validateToken()]})})}ngOnInit(){this.rbdMirroringService.getSiteName().subscribe(e=>{this.importBootstrapForm.get("siteName").setValue(e.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.pools=e.content_data.pools.reduce((e,t)=>(e.push({name:t.name,mirror_mode:t.mirror_mode}),e),[]);const t=this.importBootstrapForm.get("pools");m.a.each(this.pools,e=>{const a=e.name,i="disabled"===e.mirror_mode,s=t.controls[a];s?i&&s.disabled?s.enable():!i&&s.enabled&&(s.disable(),s.setValue(!0)):t.addControl(a,new o.h({value:!i,disabled:!i}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return e=>{let t=0;return m.a.each(e.controls,e=>{!0===e.value&&++t}),t>0?null:{requirePool:!0}}}validateToken(){return e=>{try{if(JSON.parse(atob(e.value)))return null}catch(t){}return{invalidToken:!0}}}import(){const e=[],t=[],a=this.importBootstrapForm.get("pools");m.a.each(a.controls,(a,i)=>{!0===a.value&&(e.push(i),a.disabled||t.push(i))});const i={mirror_mode:"image"};let o=Object(ma.a)(this.rbdMirroringService.setSiteName(this.importBootstrapForm.getValue("siteName")),Object(p.a)(t.map(e=>this.rbdMirroringService.updatePool(e,i))));o=e.reduce((e,t)=>Object(ma.a)(e,this.rbdMirroringService.importBootstrapToken(t,this.importBootstrapForm.getValue("direction"),this.importBootstrapForm.getValue("token"))),o).pipe(Object(fa.a)());const s=()=>{this.rbdMirroringService.refresh(),this.importBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/mirroring/bootstrap/import",{}),call:o}).subscribe({error:s,complete:()=>{s(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(l.b),v.Rb(ua),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-bootstrap-import-modal"]],decls:36,vars:10,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d;return e="Import Bootstrap Token",t="To import a bootstrap token which was created by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, provide the generated token, and click\xA0" + "\ufffd#10\ufffd" + "Import" + "\ufffd/#10\ufffd" + ".",a="Site Name",i="Name...",o="Direction",s="Pools",n="Token",c="Generated token...",r="This field is required.",l="At least one pool is required.",b="This field is required.",d="The token is invalid.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","importBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],a,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","direction",1,"col-form-label"],o,["id","direction","name","direction","formControlName","direction",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],s,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["for","token",1,"col-form-label","required"],n,["placeholder",c,"id","token","formControlName","token",1,"form-control","resize-vertical"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],r,[3,"value"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],l,b,d]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.Vb(8),v.hc(9,7),v.Sb(10,"kbd"),v.ec(),v.Ub(),v.Wb(),v.Xb(11,"div",8),v.Xb(12,"label",9),v.bc(13,10),v.Wb(),v.Sb(14,"input",11),v.Pc(15,Wa,2,0,"span",12),v.Wb(),v.Xb(16,"div",8),v.Xb(17,"label",13),v.Xb(18,"span"),v.bc(19,14),v.Wb(),v.Wb(),v.Xb(20,"select",15),v.Pc(21,ya,2,2,"option",16),v.Wb(),v.Wb(),v.Xb(22,"div",17),v.Xb(23,"label",18),v.bc(24,19),v.Wb(),v.Pc(25,Xa,4,5,"div",20),v.Pc(26,Ia,2,0,"span",12),v.Wb(),v.Xb(27,"div",8),v.Xb(28,"label",21),v.bc(29,22),v.Wb(),v.Xb(30,"textarea",23),v.Rc(31,"          "),v.Wb(),v.Pc(32,ka,2,0,"span",12),v.Pc(33,Pa,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(34,"div",24),v.Xb(35,"cd-form-button-panel",25),v.lc("submitActionEvent",function(){return t.import()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.importBootstrapForm),v.Db(11),v.uc("ngIf",t.importBootstrapForm.showError("siteName",e,"required")),v.Db(6),v.uc("ngForOf",t.directions),v.Db(4),v.uc("ngForOf",t.pools),v.Db(1),v.uc("ngIf",t.importBootstrapForm.showError("pools",e,"requirePool")),v.Db(6),v.uc("ngIf",t.importBootstrapForm.showError("token",e,"required")),v.Db(1),v.uc("ngIf",t.importBootstrapForm.showError("token",e,"invalidToken")),v.Db(2),v.uc("form",t.importBootstrapForm)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.B,o.r,z.a,o.k,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.r,o.z,i.q,o.l,A.a,o.u,o.C,o.b],styles:[""]}),e})(),Ta=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.createForm()}createForm(){this.editSiteNameForm=new P.a({siteName:new o.h("",{})})}ngOnInit(){this.editSiteNameForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(e=>{this.editSiteNameForm.get("siteName").setValue(e.site_name)})}update(){this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/mirroring/site_name/edit",{}),call:this.rbdMirroringService.setSiteName(this.editSiteNameForm.getValue("siteName"))}).subscribe({error:()=>this.editSiteNameForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(l.b),v.Rb(ua),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-edit-site-mode-modal"]],decls:17,vars:4,consts:function(){let e,t,a,i;return e="Edit site name",t="Edit the site name and click\xA0 " + "\ufffd#10\ufffd" + "Update" + "\ufffd/#10\ufffd" + ".",a="Site Name",i="Name...",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","editSiteNameForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],a,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.Vb(8),v.hc(9,7),v.Sb(10,"kbd"),v.ec(),v.Ub(),v.Wb(),v.Xb(11,"div",8),v.Xb(12,"label",9),v.bc(13,10),v.Wb(),v.Sb(14,"input",11),v.Wb(),v.Wb(),v.Xb(15,"div",12),v.Xb(16,"cd-form-button-panel",13),v.lc("submitActionEvent",function(){return t.update()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e&&(v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.editSiteNameForm),v.Db(12),v.uc("form",t.editSiteNameForm)("submitText",t.actionLabels.UPDATE))},directives:[E.a,o.B,o.r,z.a,o.k,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,A.a],styles:[""]}),e})();var Fa=a("VxPD"),Ra=a("85J/");let Ea=(()=>{class e{transform(e){return"warning"===e?"badge badge-warning":"error"===e?"badge badge-danger":"success"===e?"badge badge-success":"badge badge-info"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=v.Qb({name:"mirrorHealthColor",type:e,pure:!0}),e})();const za=["healthTmpl"];function Na(e,t){if(1&e&&(v.Xb(0,"span",2),v.oc(1,"mirrorHealthColor"),v.Rc(2),v.Wb()),2&e){const e=t.value;v.uc("ngClass",v.pc(1,2,t.row.health_color)),v.Db(2),v.Sc(e)}}let Ca=(()=>{class e{constructor(e,t){this.rbdMirroringService=e,this.cephShortVersionPipe=t,this.tableStatus=new Fa.a}ngOnInit(){this.columns=[{prop:"instance_id",name:"Instance",flexGrow:2},{prop:"id",name:"ID",flexGrow:2},{prop:"server_hostname",name:"Hostname",flexGrow:2},{prop:"version",name:"Version",pipe:this.cephShortVersionPipe,flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.data=e.content_data.daemons,this.tableStatus=new Fa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(ua),v.Rb(Ra.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-mirroring-daemons"]],viewQuery:function(e,t){if(1&e&&v.Wc(za,3),2&e){let e;v.Ec(e=v.mc())&&(t.healthTmpl=e.first)}},decls:3,vars:4,consts:[["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],["healthTmpl",""],[3,"ngClass"]],template:function(e,t){1&e&&(v.Xb(0,"cd-table",0),v.lc("fetchData",function(){return t.refresh()}),v.Wb(),v.Pc(1,Na,3,4,"ng-template",null,1,v.Qc)),2&e&&v.uc("data",t.data)("columns",t.columns)("autoReload",-1)("status",t.tableStatus)},directives:[ot.a,i.p],pipes:[Ea],styles:[""]}),e})();var Va=a("HDdC");class Aa{}function xa(e,t){if(1&e&&(v.Xb(0,"option",16),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e.id),v.Db(1),v.Sc(e.name)}}function Oa(e,t){1&e&&(v.Xb(0,"span",17),v.bc(1,18),v.Wb())}let Ma=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.bsConfig={containerClass:"theme-default"},this.peerExists=!1,this.mirrorModes=[{id:"disabled",name:"Disabled"},{id:"pool",name:"Pool"},{id:"image",name:"Image"}],this.createForm()}createForm(){this.editModeForm=new P.a({mirrorMode:new o.h("",{validators:[o.A.required,this.validateMode.bind(this)]})})}ngOnInit(){this.pattern=`${this.poolName}`,this.rbdMirroringService.getPool(this.poolName).subscribe(e=>{this.setResponse(e)}),this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.peerExists=!1;const t=e.content_data.pools.find(e=>this.poolName===e.name);this.peerExists=t&&t.peer_uuids.length})}ngOnDestroy(){this.subs.unsubscribe()}validateMode(e){return"disabled"===e.value&&this.peerExists?{cannotDisable:{value:e.value}}:null}setResponse(e){this.editModeForm.get("mirrorMode").setValue(e.mirror_mode)}update(){const e=new Aa;e.mirror_mode=this.editModeForm.getValue("mirrorMode"),this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/mirroring/pool/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePool(this.poolName,e)}).subscribe({error:()=>this.editModeForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(l.b),v.Rb(ua),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-pool-edit-mode-modal"]],decls:21,vars:7,consts:function(){let e,t,a,i;return e="Edit pool mirror mode",t="To edit the mirror mode for pool\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ", select a new mode from the list and click\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Update" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",t=v.gc(t),a="Mode",i="Peer clusters must be removed prior to disabling mirror.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","editModeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","mirrorMode",1,"col-form-label"],a,["id","mirrorMode","name","mirrorMode","formControlName","mirrorMode",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],i]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.Vb(8),v.hc(9,7),v.Sb(10,"kbd"),v.Sb(11,"kbd"),v.ec(),v.Ub(),v.Wb(),v.Xb(12,"div",8),v.Xb(13,"label",9),v.Xb(14,"span"),v.bc(15,10),v.Wb(),v.Wb(),v.Xb(16,"select",11),v.Pc(17,xa,2,2,"option",12),v.Wb(),v.Pc(18,Oa,2,0,"span",13),v.Wb(),v.Wb(),v.Xb(19,"div",14),v.Xb(20,"cd-form-button-panel",15),v.lc("submitActionEvent",function(){return t.update()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.editModeForm),v.Db(7),v.fc(t.poolName),v.cc(9),v.Db(6),v.uc("ngForOf",t.mirrorModes),v.Db(1),v.uc("ngIf",t.editModeForm.showError("mirrorMode",e,"cannotDisable")),v.Db(2),v.uc("form",t.editModeForm)("submitText",t.actionLabels.UPDATE)}},directives:[E.a,o.B,o.r,z.a,o.k,N.a,C.a,o.z,V.a,o.q,o.i,i.q,i.r,A.a,o.u,o.C],styles:[""]}),e})();class Ba{}function qa(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,25),v.Wb())}function La(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,26),v.Wb())}function Ga(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,27),v.Wb())}function Ua(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,28),v.Wb())}function ja(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,29),v.Wb())}function Qa(e,t){1&e&&(v.Xb(0,"span",24),v.bc(1,30),v.Wb())}let Ya=(()=>{class e{constructor(e,t,a,i){this.activeModal=e,this.actionLabels=t,this.rbdMirroringService=a,this.taskWrapper=i,this.bsConfig={containerClass:"theme-default"},this.createForm()}createForm(){this.editPeerForm=new P.a({clusterName:new o.h("",{validators:[o.A.required,this.validateClusterName]}),clientID:new o.h("",{validators:[o.A.required,this.validateClientID]}),monAddr:new o.h("",{validators:[this.validateMonAddr]}),key:new o.h("",{validators:[this.validateKey]})})}ngOnInit(){this.pattern=`${this.poolName}/${this.peerUUID}`,"edit"===this.mode&&this.rbdMirroringService.getPeer(this.poolName,this.peerUUID).subscribe(e=>{this.setResponse(e)})}validateClusterName(e){if(!e.value.match(/^[\w\-_]*$/))return{invalidClusterName:{value:e.value}}}validateClientID(e){if(!e.value.match(/^(?!client\.)[\w\-_.]*$/))return{invalidClientID:{value:e.value}}}validateMonAddr(e){if(!e.value.match(/^[,; ]*([\w.\-_\[\]]+(:[\d]+)?[,; ]*)*$/))return{invalidMonAddr:{value:e.value}}}validateKey(e){try{if(""===e.value||atob(e.value))return null}catch(t){}return{invalidKey:{value:e.value}}}setResponse(e){this.response=e,this.editPeerForm.get("clusterName").setValue(e.cluster_name),this.editPeerForm.get("clientID").setValue(e.client_id),this.editPeerForm.get("monAddr").setValue(e.mon_host),this.editPeerForm.get("key").setValue(e.key)}update(){const e=new Ba;let t;e.cluster_name=this.editPeerForm.getValue("clusterName"),e.client_id=this.editPeerForm.getValue("clientID"),e.mon_host=this.editPeerForm.getValue("monAddr"),e.key=this.editPeerForm.getValue("key"),t=this.taskWrapper.wrapTaskAroundCall("edit"===this.mode?{task:new T.a("rbd/mirroring/peer/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePeer(this.poolName,this.peerUUID,e)}:{task:new T.a("rbd/mirroring/peer/add",{pool_name:this.poolName}),call:this.rbdMirroringService.addPeer(this.poolName,e)}),t.subscribe({error:()=>this.editPeerForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(l.b),v.Rb(ua),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-pool-edit-peer-modal"]],decls:38,vars:13,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d,u,m,p,f,h,g;return e="{VAR_SELECT, select, edit {Edit} other {Add}}",e=v.gc(e,{VAR_SELECT:"\ufffd0\ufffd"}),t="" + e + " pool mirror peer",a="{VAR_SELECT, select, edit {Edit} other {Add}}",a=v.gc(a,{VAR_SELECT:"\ufffd0\ufffd"}),i="" + a + " the pool mirror peer attributes for pool " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " and click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Submit" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",i=v.gc(i),o="Cluster Name",s="Name...",n="CephX ID",c="CephX ID...",r="Monitor Addresses",l="Comma-delimited addresses...",b="CephX Key",d="Base64-encoded key...",u="This field is required.",m="The cluster name is not valid.",p="This field is required.",f="The CephX ID is not valid.",h="The monitory address is not valid.",g="CephX key must be base64 encoded.",[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["name","editPeerForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],i,[1,"form-group"],["for","clusterName",1,"col-form-label","required"],o,["type","text","placeholder",s,"id","clusterName","name","clusterName","formControlName","clusterName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","clientID",1,"col-form-label","required"],n,["type","text","placeholder",c,"id","clientID","name","clientID","formControlName","clientID",1,"form-control"],["for","monAddr",1,"col-form-label"],r,["type","text","placeholder",l,"id","monAddr","name","monAddr","formControlName","monAddr",1,"form-control"],["for","key",1,"col-form-label"],b,["type","text","placeholder",d,"id","key","name","key","formControlName","key",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],u,m,p,f,h,g]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Xb(1,"span",1),v.bc(2,2),v.Wb(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.Xb(8,"span"),v.hc(9,7),v.Sb(10,"kbd"),v.Sb(11,"kbd"),v.ec(),v.Wb(),v.Wb(),v.Xb(12,"div",8),v.Xb(13,"label",9),v.bc(14,10),v.Wb(),v.Sb(15,"input",11),v.Pc(16,qa,2,0,"span",12),v.Pc(17,La,2,0,"span",12),v.Wb(),v.Xb(18,"div",8),v.Xb(19,"label",13),v.bc(20,14),v.Wb(),v.Sb(21,"input",15),v.Pc(22,Ga,2,0,"span",12),v.Pc(23,Ua,2,0,"span",12),v.Wb(),v.Xb(24,"div",8),v.Xb(25,"label",16),v.Xb(26,"span"),v.bc(27,17),v.Wb(),v.Wb(),v.Sb(28,"input",18),v.Pc(29,ja,2,0,"span",12),v.Wb(),v.Xb(30,"div",8),v.Xb(31,"label",19),v.Xb(32,"span"),v.bc(33,20),v.Wb(),v.Wb(),v.Sb(34,"input",21),v.Pc(35,Qa,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(36,"div",22),v.Xb(37,"cd-form-button-panel",23),v.lc("submitActionEvent",function(){return t.update()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(2),v.fc(t.mode),v.cc(2),v.Db(2),v.uc("formGroup",t.editPeerForm),v.Db(7),v.fc(t.mode)(t.poolName),v.cc(9),v.Db(5),v.uc("ngIf",t.editPeerForm.showError("clusterName",e,"required")),v.Db(1),v.uc("ngIf",t.editPeerForm.showError("clusterName",e,"invalidClusterName")),v.Db(5),v.uc("ngIf",t.editPeerForm.showError("clientID",e,"required")),v.Db(1),v.uc("ngIf",t.editPeerForm.showError("clientID",e,"invalidClientID")),v.Db(6),v.uc("ngIf",t.editPeerForm.showError("monAddr",e,"invalidMonAddr")),v.Db(6),v.uc("ngIf",t.editPeerForm.showError("key",e,"invalidKey")),v.Db(2),v.uc("form",t.editPeerForm)("submitText",t.actionLabels.SUBMIT)}},directives:[E.a,o.B,o.r,z.a,o.k,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.r,A.a],styles:[""]}),e})();const Ka=["healthTmpl"];function Ha(e,t){if(1&e&&(v.Xb(0,"span",3),v.oc(1,"mirrorHealthColor"),v.Rc(2),v.Wb()),2&e){const e=t.value;v.uc("ngClass",v.pc(1,2,t.row.health_color)),v.Db(2),v.Sc(e)}}let Ja=(()=>{class e{constructor(e,t,a,i){this.authStorageService=e,this.rbdMirroringService=t,this.modalService=a,this.taskWrapper=i,this.selection=new nt.a,this.tableStatus=new Fa.a,this.data=[],this.permission=this.authStorageService.getPermissions().rbdMirroring;const o={permission:"update",icon:I.a.edit,click:()=>this.editModeModal(),name:"Edit Mode",canBePrimary:()=>!0},s={permission:"create",icon:I.a.add,name:"Add Peer",click:()=>this.editPeersModal("add"),disable:()=>!this.selection.first()||"disabled"===this.selection.first().mirror_mode,visible:()=>!this.getPeerUUID(),canBePrimary:()=>!1},n={permission:"update",icon:I.a.exchange,name:"Edit Peer",click:()=>this.editPeersModal("edit"),visible:()=>!!this.getPeerUUID()},c={permission:"delete",icon:I.a.destroy,name:"Delete Peer",click:()=>this.deletePeersModal(),visible:()=>!!this.getPeerUUID()};this.tableActions=[o,s,n,c]}ngOnInit(){this.columns=[{prop:"name",name:"Name",flexGrow:2},{prop:"mirror_mode",name:"Mode",flexGrow:2},{prop:"leader_id",name:"Leader",flexGrow:2},{prop:"image_local_count",name:"# Local",flexGrow:2},{prop:"image_remote_count",name:"# Remote",flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.data=e.content_data.pools,this.tableStatus=new Fa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}editModeModal(){const e={poolName:this.selection.first().name};this.modalRef=this.modalService.show(Ma,e)}editPeersModal(e){const t={poolName:this.selection.first().name,mode:e};"edit"===e&&(t.peerUUID=this.getPeerUUID()),this.modalRef=this.modalService.show(Ya,t)}deletePeersModal(){const e=this.selection.first().name,t=this.getPeerUUID();this.modalRef=this.modalService.show(it.a,{itemDescription:"mirror peer",itemNames:[`${e} (${t})`],submitActionObservable:()=>new Va.a(a=>{this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/mirroring/peer/delete",{pool_name:e}),call:this.rbdMirroringService.deletePeer(e,t)}).subscribe({error:e=>a.error(e),complete:()=>{this.rbdMirroringService.refresh(),a.complete()}})})})}getPeerUUID(){const e=this.selection.first(),t=this.data.find(t=>e&&e.name===t.name);if(t&&t.peer_uuids)return t.peer_uuids[0]}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(ua),v.Rb(F.a),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-mirroring-pools"]],viewQuery:function(e,t){if(1&e&&v.Wc(Ka,3),2&e){let e;v.Ec(e=v.mc())&&(t.healthTmpl=e.first)}},decls:4,vars:7,consts:[["columnMode","flex","identifier","name","forceIdentifier","true","selectionType","single",3,"data","columns","autoReload","status","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["healthTmpl",""],[3,"ngClass"]],template:function(e,t){1&e&&(v.Xb(0,"cd-table",0),v.lc("fetchData",function(){return t.refresh()})("updateSelection",function(e){return t.updateSelection(e)}),v.Sb(1,"cd-table-actions",1),v.Wb(),v.Pc(2,Ha,3,4,"ng-template",null,2,v.Qc)),2&e&&(v.uc("data",t.data)("columns",t.columns)("autoReload",-1)("status",t.tableStatus),v.Db(1),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ot.a,Xt.a,i.p],pipes:[Ea],styles:[""]}),e})();var Za=a("JP8w");const ei=["stateTmpl"],ti=["syncTmpl"],ai=["progressTmpl"];function ii(e,t){if(1&e){const e=v.Yb();v.Xb(0,"cd-table",14),v.lc("fetchData",function(){return v.Ic(e),v.nc().refresh()}),v.Wb()}if(2&e){const e=v.nc();v.uc("data",e.image_error.data)("columns",e.image_error.columns)("autoReload",-1)("status",e.tableStatus)}}function oi(e,t){if(1&e){const e=v.Yb();v.Xb(0,"cd-table",14),v.lc("fetchData",function(){return v.Ic(e),v.nc().refresh()}),v.Wb()}if(2&e){const e=v.nc();v.uc("data",e.image_syncing.data)("columns",e.image_syncing.columns)("autoReload",-1)("status",e.tableStatus)}}function si(e,t){if(1&e){const e=v.Yb();v.Xb(0,"cd-table",14),v.lc("fetchData",function(){return v.Ic(e),v.nc().refresh()}),v.Wb()}if(2&e){const e=v.nc();v.uc("data",e.image_ready.data)("columns",e.image_ready.columns)("autoReload",-1)("status",e.tableStatus)}}function ni(e,t){if(1&e&&(v.Xb(0,"span",15),v.oc(1,"mirrorHealthColor"),v.Rc(2),v.Wb()),2&e){const e=t.value;v.uc("ngClass",v.pc(1,2,t.row.state_color)),v.Db(2),v.Sc(e)}}function ci(e,t){1&e&&(v.Xb(0,"span",16),v.bc(1,17),v.Wb())}function ri(e,t){1&e&&v.Sb(0,"ngb-progressbar",18),2&e&&v.uc("value",t.value)("showValue",!0)}let li=(()=>{class e{constructor(e){this.rbdMirroringService=e,this.image_error={data:[],columns:{}},this.image_syncing={data:[],columns:{}},this.image_ready={data:[],columns:{}},this.tableStatus=new Fa.a}ngOnInit(){this.image_error.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Issue",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.image_syncing.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"progress",name:"Progress",cellTemplate:this.progressTmpl,flexGrow:2},{prop:"state",name:"State",cellTemplate:this.syncTmpl,flexGrow:1}],this.image_ready.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Description",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(e=>{this.image_error.data=e.content_data.image_error,this.image_syncing.data=e.content_data.image_syncing,this.image_ready.data=e.content_data.image_ready,this.tableStatus=new Fa.a(e.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(ua))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-mirroring-images"]],viewQuery:function(e,t){if(1&e&&(v.Wc(ei,3),v.Wc(ti,3),v.Wc(ai,3)),2&e){let e;v.Ec(e=v.mc())&&(t.stateTmpl=e.first),v.Ec(e=v.mc())&&(t.syncTmpl=e.first),v.Ec(e=v.mc())&&(t.progressTmpl=e.first)}},decls:21,vars:1,consts:function(){let e,t,a,i;return e="Issues",t="Syncing",a="Ready",i="Syncing",[["ngbNav","","cdStatefulTab","image-list",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","issues"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","syncing"],t,["ngbNavItem","ready"],a,[3,"ngbNavOutlet"],["stateTmpl",""],["syncTmpl",""],["progressTmpl",""],["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],[3,"ngClass"],[1,"badge","badge-info"],i,["type","info",3,"value","showValue"]]},template:function(e,t){if(1&e&&(v.Xb(0,"ul",0,1),v.Xb(2,"li",2),v.Xb(3,"a",3),v.bc(4,4),v.Wb(),v.Pc(5,ii,1,4,"ng-template",5),v.Wb(),v.Xb(6,"li",6),v.Xb(7,"a",3),v.bc(8,7),v.Wb(),v.Pc(9,oi,1,4,"ng-template",5),v.Wb(),v.Xb(10,"li",8),v.Xb(11,"a",3),v.bc(12,9),v.Wb(),v.Pc(13,si,1,4,"ng-template",5),v.Wb(),v.Wb(),v.Sb(14,"div",10),v.Pc(15,ni,3,4,"ng-template",null,11,v.Qc),v.Pc(17,ci,2,0,"ng-template",null,12,v.Qc),v.Pc(19,ri,1,2,"ng-template",null,13,v.Qc)),2&e){const e=v.Fc(1);v.Db(14),v.uc("ngbNavOutlet",e)}},directives:[c.p,Za.a,c.r,c.s,c.q,c.u,ot.a,i.p,c.z],pipes:[Ea],styles:[""]}),e})(),bi=(()=>{class e{constructor(e,t,a){this.authStorageService=e,this.rbdMirroringService=t,this.modalService=a,this.selection=new nt.a,this.peersExist=!0,this.subs=new ra.a,this.permission=this.authStorageService.getPermissions().rbdMirroring;const i={permission:"update",icon:I.a.edit,click:()=>this.editSiteNameModal(),name:"Edit Site Name",canBePrimary:()=>!0,disable:()=>!1},o={permission:"update",icon:I.a.upload,click:()=>this.createBootstrapModal(),name:"Create Bootstrap Token",disable:()=>!1},s={permission:"update",icon:I.a.download,click:()=>this.importBootstrapModal(),name:"Import Bootstrap Token",disable:()=>this.peersExist};this.tableActions=[i,o,s]}ngOnInit(){this.subs.add(this.rbdMirroringService.startPolling()),this.subs.add(this.rbdMirroringService.subscribeSummary(e=>{this.status=e.content_data.status,this.siteName=e.site_name,this.peersExist=!!e.content_data.pools.find(e=>e.peer_uuids.length>0)}))}ngOnDestroy(){this.subs.unsubscribe()}editSiteNameModal(){this.modalRef=this.modalService.show(Ta,{siteName:this.siteName})}createBootstrapModal(){this.modalRef=this.modalService.show(_a,{siteName:this.siteName})}importBootstrapModal(){this.modalRef=this.modalService.show($a,{siteName:this.siteName})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(ua),v.Rb(F.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-mirroring"]],decls:21,vars:4,consts:function(){let e,t,a,i;return e="Site Name:",t="Daemons",a="Pools",i="Images",[[1,"row"],[1,"col-md-12"],e,[1,"table-actions","float-right",3,"permission","selection","tableActions"],[1,"col-sm-6"],t,a,i]},template:function(e,t){1&e&&(v.Xb(0,"div",0),v.Xb(1,"div",1),v.Xb(2,"span"),v.Xb(3,"strong"),v.bc(4,2),v.Wb(),v.Rc(5),v.Wb(),v.Sb(6,"cd-table-actions",3),v.Wb(),v.Wb(),v.Xb(7,"div",0),v.Xb(8,"div",4),v.Xb(9,"legend"),v.bc(10,5),v.Wb(),v.Sb(11,"cd-mirroring-daemons"),v.Wb(),v.Xb(12,"div",4),v.Xb(13,"legend"),v.bc(14,6),v.Wb(),v.Sb(15,"cd-mirroring-pools"),v.Wb(),v.Wb(),v.Xb(16,"div",0),v.Xb(17,"div",1),v.Xb(18,"legend"),v.bc(19,7),v.Wb(),v.Sb(20,"cd-mirroring-images"),v.Wb(),v.Wb()),2&e&&(v.Db(5),v.Tc(" ",t.siteName,""),v.Db(1),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Xt.a,Ca,Ja,li],styles:[""]}),e})();var di=a("jtHE"),ui=a("SxV6"),mi=a("eIep"),pi=a("Ekvf"),fi=a("PhyI"),hi=a("Fgil"),gi=a("aXbf");class vi{}var Si=function(e){return e[e.V1=1]="V1",e[e.V2=2]="V2",e}({});class Di{constructor(){this.features=[]}}class wi{constructor(){this.features=[]}}class _i extends class{}{constructor(){super(...arguments),this.features=[]}}class Wi{constructor(){this.features=[]}}var yi=function(e){return e.editing="editing",e.cloning="cloning",e.copying="copying",e}({}),Xi=a("EmSq"),Ii=a("rFfW"),ki=a("p4Cf");function Pi(e,t){if(1&e&&(v.Xb(0,"div",9),v.Xb(1,"label",56),v.bc(2,57),v.oc(3,"titlecase"),v.Wb(),v.Xb(4,"div",12),v.Sb(5,"input",58),v.Sb(6,"hr"),v.Wb(),v.Wb()),2&e){const e=v.nc(2);v.Db(3),v.fc(v.pc(3,1,e.action)),v.cc(2)}}function $i(e,t){1&e&&(v.Xb(0,"span",59),v.Vb(1),v.bc(2,60),v.Ub(),v.Wb())}function Ti(e,t){1&e&&(v.Xb(0,"span",59),v.Vb(1),v.bc(2,61),v.Ub(),v.Wb())}function Fi(e,t){1&e&&v.Sb(0,"input",62)}function Ri(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,65),v.Wb()),2&e&&v.uc("ngValue",null)}function Ei(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,66),v.Wb()),2&e&&v.uc("ngValue",null)}function zi(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,67),v.Wb()),2&e&&v.uc("ngValue",null)}function Ni(e,t){if(1&e&&(v.Xb(0,"option",68),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e.pool_name),v.Db(1),v.Sc(e.pool_name)}}function Ci(e,t){if(1&e&&(v.Xb(0,"select",63),v.Pc(1,Ri,2,1,"option",64),v.Pc(2,Ei,2,1,"option",64),v.Pc(3,zi,2,1,"option",64),v.Pc(4,Ni,2,2,"option",44),v.Wb()),2&e){const e=v.nc(2);v.Db(1),v.uc("ngIf",null===e.pools),v.Db(1),v.uc("ngIf",null!==e.pools&&0===e.pools.length),v.Db(1),v.uc("ngIf",null!==e.pools&&e.pools.length>0),v.Db(1),v.uc("ngForOf",e.pools)}}function Vi(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,69),v.Wb())}const Ai=function(e,t){return[e,t]};function xi(e,t){if(1&e&&(v.Xb(0,"div",9),v.Xb(1,"div",20),v.Sb(2,"i",70),v.Wb(),v.Wb()),2&e){const e=v.nc(2);v.Db(2),v.uc("ngClass",v.Ac(1,Ai,e.icons.spinner,e.icons.spin))}}function Oi(e,t){1&e&&v.Sb(0,"input",74)}function Mi(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,76),v.Wb()),2&e&&v.uc("ngValue",null)}function Bi(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,77),v.Wb()),2&e&&v.uc("ngValue",null)}function qi(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,78),v.Wb()),2&e&&v.uc("ngValue",null)}function Li(e,t){if(1&e&&(v.Xb(0,"option",68),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e),v.Db(1),v.Sc(e)}}function Gi(e,t){if(1&e&&(v.Xb(0,"select",75),v.Pc(1,Mi,2,1,"option",64),v.Pc(2,Bi,2,1,"option",64),v.Pc(3,qi,2,1,"option",64),v.Pc(4,Li,2,2,"option",44),v.Wb()),2&e){const e=v.nc(3);v.Db(1),v.uc("ngIf",null===e.pools),v.Db(1),v.uc("ngIf",null!==e.pools&&0===e.pools.length),v.Db(1),v.uc("ngIf",null!==e.pools&&e.pools.length>0),v.Db(1),v.uc("ngForOf",e.namespaces)}}function Ui(e,t){if(1&e&&(v.Xb(0,"div",9),v.Xb(1,"label",71),v.Rc(2," Namespace "),v.Wb(),v.Xb(3,"div",12),v.Pc(4,Oi,1,0,"input",72),v.Pc(5,Gi,5,4,"select",73),v.Wb(),v.Wb()),2&e){const e=v.nc(2);v.Db(4),v.uc("ngIf","editing"===e.mode||!e.poolPermission.read),v.Db(1),v.uc("ngIf","editing"!==e.mode&&e.poolPermission.read)}}function ji(e,t){1&e&&(v.Xb(0,"cd-helper"),v.Xb(1,"span"),v.bc(2,79),v.Wb(),v.Wb())}function Qi(e,t){1&e&&v.Sb(0,"input",85)}function Yi(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,87),v.Wb()),2&e&&v.uc("ngValue",null)}function Ki(e,t){1&e&&(v.Xb(0,"option",48),v.bc(1,88),v.Wb()),2&e&&v.uc("ngValue",null)}function Hi(e,t){1&e&&(v.Xb(0,"option",48),v.Rc(1,"-- Select a data pool -- "),v.Wb()),2&e&&v.uc("ngValue",null)}function Ji(e,t){if(1&e&&(v.Xb(0,"option",68),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e.pool_name),v.Db(1),v.Sc(e.pool_name)}}function Zi(e,t){if(1&e){const e=v.Yb();v.Xb(0,"select",86),v.lc("change",function(t){return v.Ic(e),v.nc(3).onDataPoolChange(t.target.value)}),v.Pc(1,Yi,2,1,"option",64),v.Pc(2,Ki,2,1,"option",64),v.Pc(3,Hi,2,1,"option",64),v.Pc(4,Ji,2,2,"option",44),v.Wb()}if(2&e){const e=v.nc(3);v.Db(1),v.uc("ngIf",null===e.dataPools),v.Db(1),v.uc("ngIf",null!==e.dataPools&&0===e.dataPools.length),v.Db(1),v.uc("ngIf",null!==e.dataPools&&e.dataPools.length>0),v.Db(1),v.uc("ngForOf",e.dataPools)}}function eo(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,89),v.Wb())}const to=function(e){return{required:e}};function ao(e,t){if(1&e&&(v.Xb(0,"div",9),v.Xb(1,"label",80),v.Xb(2,"span",70),v.bc(3,81),v.Wb(),v.Sb(4,"cd-helper",82),v.Wb(),v.Xb(5,"div",12),v.Pc(6,Qi,1,0,"input",83),v.Pc(7,Zi,5,4,"select",84),v.Pc(8,eo,2,0,"span",14),v.Wb(),v.Wb()),2&e){v.nc();const e=v.Fc(2),t=v.nc();v.Db(2),v.uc("ngClass",v.zc(4,to,"editing"!==t.mode)),v.Db(4),v.uc("ngIf","editing"===t.mode||!t.poolPermission.read),v.Db(1),v.uc("ngIf","editing"!==t.mode&&t.poolPermission.read),v.Db(1),v.uc("ngIf",t.rbdForm.showError("dataPool",e,"required"))}}function io(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,90),v.Wb())}function oo(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,91),v.Wb())}function so(e,t){if(1&e&&v.Sb(0,"cd-helper",95),2&e){const e=v.nc().$implicit;v.vc("html",e.helperHtml)}}function no(e,t){if(1&e&&(v.Xb(0,"div",21),v.Sb(1,"input",92),v.Xb(2,"label",93),v.Rc(3),v.Wb(),v.Pc(4,so,1,1,"cd-helper",94),v.Wb()),2&e){const e=t.$implicit;v.Db(1),v.vc("id",e.key),v.vc("name",e.key),v.vc("formControlName",e.key),v.Db(1),v.vc("for",e.key),v.Db(1),v.Sc(e.desc),v.Db(1),v.uc("ngIf",e.helperHtml)}}function co(e,t){if(1&e){const e=v.Yb();v.Xb(0,"a",96),v.lc("click",function(){return v.Ic(e),v.nc(2).advancedEnabled=!0,!1}),v.bc(1,97),v.Wb()}}function ro(e,t){if(1&e&&(v.Xb(0,"option",68),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e),v.Db(1),v.Sc(e)}}function lo(e,t){if(1&e&&(v.Xb(0,"option",68),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e),v.Db(1),v.Sc(e)}}function bo(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,98),v.Wb())}function uo(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,99),v.Wb())}function mo(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,100),v.Wb())}function po(e,t){1&e&&(v.Xb(0,"span",59),v.bc(1,101),v.Wb())}function fo(e,t){if(1&e){const e=v.Yb();v.Xb(0,"div",1),v.Xb(1,"form",2,3),v.Xb(3,"div",4),v.Xb(4,"div",5),v.bc(5,6),v.oc(6,"titlecase"),v.oc(7,"upperFirst"),v.Wb(),v.Xb(8,"div",7),v.Pc(9,Pi,7,3,"div",8),v.Xb(10,"div",9),v.Xb(11,"label",10),v.bc(12,11),v.Wb(),v.Xb(13,"div",12),v.Sb(14,"input",13),v.Pc(15,$i,3,0,"span",14),v.Pc(16,Ti,3,0,"span",14),v.Wb(),v.Wb(),v.Xb(17,"div",15),v.lc("change",function(t){return v.Ic(e),v.nc().onPoolChange(t.target.value)}),v.Xb(18,"label",16),v.bc(19,17),v.Wb(),v.Xb(20,"div",12),v.Pc(21,Fi,1,0,"input",18),v.Pc(22,Ci,5,4,"select",19),v.Pc(23,Vi,2,0,"span",14),v.Wb(),v.Wb(),v.Pc(24,xi,3,4,"div",8),v.Pc(25,Ui,6,2,"div",8),v.Xb(26,"div",9),v.Xb(27,"div",20),v.Xb(28,"div",21),v.Xb(29,"input",22),v.lc("change",function(){return v.Ic(e),v.nc().onUseDataPoolChange()}),v.Wb(),v.Xb(30,"label",23),v.bc(31,24),v.Wb(),v.Pc(32,ji,3,0,"cd-helper",25),v.Wb(),v.Wb(),v.Wb(),v.Pc(33,ao,9,6,"div",8),v.Xb(34,"div",9),v.Xb(35,"label",26),v.bc(36,27),v.Wb(),v.Xb(37,"div",12),v.Sb(38,"input",28),v.Pc(39,io,2,0,"span",14),v.Pc(40,oo,2,0,"span",14),v.Wb(),v.Wb(),v.Xb(41,"div",29),v.Xb(42,"label",30),v.bc(43,31),v.Wb(),v.Xb(44,"div",12),v.Pc(45,no,5,6,"div",32),v.Wb(),v.Wb(),v.Xb(46,"div",33),v.Xb(47,"div",34),v.Pc(48,co,2,0,"a",35),v.Wb(),v.Wb(),v.Xb(49,"div",36),v.Xb(50,"legend",37),v.bc(51,38),v.Wb(),v.Xb(52,"div",39),v.Xb(53,"h4",37),v.bc(54,40),v.Wb(),v.Xb(55,"div",9),v.Xb(56,"label",41),v.bc(57,42),v.Wb(),v.Xb(58,"div",12),v.Xb(59,"select",43),v.Pc(60,ro,2,2,"option",44),v.Wb(),v.Wb(),v.Wb(),v.Xb(61,"div",9),v.Xb(62,"label",45),v.bc(63,46),v.Wb(),v.Xb(64,"div",12),v.Xb(65,"select",47),v.Xb(66,"option",48),v.bc(67,49),v.Wb(),v.Pc(68,lo,2,2,"option",44),v.Wb(),v.Pc(69,bo,2,0,"span",14),v.Pc(70,uo,2,0,"span",14),v.Wb(),v.Wb(),v.Xb(71,"div",9),v.Xb(72,"label",50),v.bc(73,51),v.Wb(),v.Xb(74,"div",12),v.Sb(75,"input",52),v.Pc(76,mo,2,0,"span",14),v.Pc(77,po,2,0,"span",14),v.Wb(),v.Wb(),v.Wb(),v.Xb(78,"cd-rbd-configuration-form",53),v.lc("changes",function(t){return v.Ic(e),v.nc().getDirtyConfigurationValues=t}),v.Wb(),v.Wb(),v.Wb(),v.Xb(79,"div",54),v.Xb(80,"cd-form-button-panel",55),v.lc("submitActionEvent",function(){return v.Ic(e),v.nc().submit()}),v.oc(81,"titlecase"),v.oc(82,"upperFirst"),v.Wb(),v.Wb(),v.Wb(),v.Wb(),v.Wb()}if(2&e){const e=v.Fc(2),t=v.nc();v.Db(1),v.uc("formGroup",t.rbdForm),v.Db(6),v.fc(v.pc(6,32,t.action))(v.pc(7,34,t.resource)),v.cc(5),v.Db(2),v.uc("ngIf",t.rbdForm.getValue("parent")),v.Db(6),v.uc("ngIf",t.rbdForm.showError("name",e,"required")),v.Db(1),v.uc("ngIf",t.rbdForm.showError("name",e,"pattern")),v.Db(2),v.uc("ngClass",v.zc(40,to,"editing"!==t.mode)),v.Db(3),v.uc("ngIf","editing"===t.mode||!t.poolPermission.read),v.Db(1),v.uc("ngIf","editing"!==t.mode&&t.poolPermission.read),v.Db(1),v.uc("ngIf",t.rbdForm.showError("pool",e,"required")),v.Db(1),v.uc("ngIf","editing"!==t.mode&&t.rbdForm.getValue("pool")&&null===t.namespaces),v.Db(1),v.uc("ngIf","editing"===t.mode&&t.rbdForm.getValue("namespace")||"editing"!==t.mode&&(t.namespaces&&t.namespaces.length>0||!t.poolPermission.read)),v.Db(7),v.uc("ngIf",t.allDataPools.length<=1),v.Db(1),v.uc("ngIf",t.rbdForm.getValue("useDataPool")),v.Db(6),v.uc("ngIf",t.rbdForm.showError("size",e,"required")),v.Db(1),v.uc("ngIf",t.rbdForm.showError("size",e,"invalidSizeObject")),v.Db(5),v.uc("ngForOf",t.featuresList),v.Db(3),v.uc("ngIf",!t.advancedEnabled),v.Db(1),v.uc("hidden",!t.advancedEnabled),v.Db(11),v.uc("ngForOf",t.objectSizes),v.Db(2),v.uc("ngClass",v.zc(42,to,t.rbdForm.getValue("stripingCount"))),v.Db(4),v.uc("ngValue",null),v.Db(2),v.uc("ngForOf",t.objectSizes),v.Db(1),v.uc("ngIf",t.rbdForm.showError("stripingUnit",e,"required")),v.Db(1),v.uc("ngIf",t.rbdForm.showError("stripingUnit",e,"invalidStripingUnit")),v.Db(2),v.uc("ngClass",v.zc(44,to,t.rbdForm.getValue("stripingUnit"))),v.Db(4),v.uc("ngIf",t.rbdForm.showError("stripingCount",e,"required")),v.Db(1),v.uc("ngIf",t.rbdForm.showError("stripingCount",e,"min")),v.Db(1),v.uc("form",t.rbdForm)("initializeData",t.initializeConfigData),v.Db(2),v.uc("form",e)("submitText",v.pc(81,36,t.action)+" "+v.pc(82,38,t.resource))}}let ho=(()=>{class e extends k.a{constructor(e,t,a,i,o,s,n,c,r){super(),this.authStorageService=e,this.route=t,this.poolService=a,this.rbdService=i,this.formatter=o,this.taskWrapper=s,this.dimlessBinaryPipe=n,this.actionLabels=c,this.router=r,this.namespaces=[],this.namespacesByPoolCache={},this.pools=null,this.allPools=null,this.dataPools=null,this.allDataPools=[],this.featuresList=[],this.initializeConfigData=new di.a(1),this.advancedEnabled=!1,this.rbdFormMode=yi,this.defaultObjectSize="4 MiB",this.objectSizes=["4 KiB","8 KiB","16 KiB","32 KiB","64 KiB","128 KiB","256 KiB","512 KiB","1 MiB","2 MiB","4 MiB","8 MiB","16 MiB","32 MiB"],this.rbdImage=new di.a(1),this.icons=I.a,this.routerUrl=this.router.url,this.poolPermission=this.authStorageService.getPermissions().pool,this.resource="RBD",this.features={"deep-flatten":{desc:"Deep flatten",requires:null,allowEnable:!1,allowDisable:!0},layering:{desc:"Layering",requires:null,allowEnable:!1,allowDisable:!1},"exclusive-lock":{desc:"Exclusive lock",requires:null,allowEnable:!0,allowDisable:!0},"object-map":{desc:"Object map (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},journaling:{desc:"Journaling (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},"fast-diff":{desc:"Fast diff (interlocked with object-map)",requires:"object-map",allowEnable:!0,allowDisable:!0,interlockedWith:"object-map",initDisabled:!0}},this.featuresList=this.objToArray(this.features),this.createForm()}objToArray(e){return m.a.map(e,(e,t)=>Object.assign(e,{key:t}))}createForm(){this.rbdForm=new P.a({parent:new o.h(""),name:new o.h("",{validators:[o.A.required,o.A.pattern(/^[^@/]+?$/)]}),pool:new o.h(null,{validators:[o.A.required]}),namespace:new o.h(null),useDataPool:new o.h(!1),dataPool:new o.h(null),size:new o.h(null,{updateOn:"blur"}),obj_size:new o.h(this.defaultObjectSize),features:new P.a(this.featuresList.reduce((e,t)=>(e[t.key]=new o.h({value:!1,disabled:!!t.initDisabled}),e),{})),stripingUnit:new o.h(null),stripingCount:new o.h(null,{updateOn:"blur"})},this.validateRbdForm(this.formatter))}disableForEdit(){this.rbdForm.get("parent").disable(),this.rbdForm.get("pool").disable(),this.rbdForm.get("namespace").disable(),this.rbdForm.get("useDataPool").disable(),this.rbdForm.get("dataPool").disable(),this.rbdForm.get("obj_size").disable(),this.rbdForm.get("stripingUnit").disable(),this.rbdForm.get("stripingCount").disable(),this.rbdImage.subscribe(e=>{e.image_format===Si.V1&&(this.rbdForm.get("deep-flatten").disable(),this.rbdForm.get("layering").disable(),this.rbdForm.get("exclusive-lock").disable())})}disableForClone(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}disableForCopy(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}ngOnInit(){this.prepareFormForAction(),this.gatherNeededData().subscribe(this.handleExternalData.bind(this))}prepareFormForAction(){const e=this.routerUrl;e.startsWith("/block/rbd/edit")?(this.mode=this.rbdFormMode.editing,this.action=this.actionLabels.EDIT,this.disableForEdit()):e.startsWith("/block/rbd/clone")?(this.mode=this.rbdFormMode.cloning,this.disableForClone(),this.action=this.actionLabels.CLONE):e.startsWith("/block/rbd/copy")?(this.mode=this.rbdFormMode.copying,this.action=this.actionLabels.COPY,this.disableForCopy()):this.action=this.actionLabels.CREATE,m.a.each(this.features,e=>{this.rbdForm.get("features").get(e.key).valueChanges.subscribe(t=>this.featureFormUpdate(e.key,t))})}gatherNeededData(){const e={};return this.mode?this.route.params.subscribe(t=>{const a=w.a.fromString(decodeURIComponent(t.image_spec));t.snap&&(this.snapName=decodeURIComponent(t.snap)),e.rbd=this.rbdService.get(a)}):e.defaultFeatures=this.rbdService.defaultFeatures(),this.mode!==this.rbdFormMode.editing&&this.poolPermission.read&&(e.pools=this.poolService.list(["pool_name","type","flags_names","application_metadata"])),Object(p.a)(e)}handleExternalData(e){if(this.handlePoolData(e.pools),e.defaultFeatures&&this.setFeatures(e.defaultFeatures),e.rbd){const t=e.rbd;this.setResponse(t,this.snapName),this.rbdImage.next(t)}this.loadingReady()}handlePoolData(e){if(!e)return;const t=[],a=[];for(const i of e)this.rbdService.isRBDPool(i)&&("replicated"===i.type?(t.push(i),a.push(i)):"erasure"===i.type&&-1!==i.flags_names.indexOf("ec_overwrites")&&a.push(i));if(this.pools=t,this.allPools=t,this.dataPools=a,this.allDataPools=a,1===this.pools.length){const e=this.pools[0].pool_name;this.rbdForm.get("pool").setValue(e),this.onPoolChange(e)}this.allDataPools.length<=1&&this.rbdForm.get("useDataPool").disable()}onPoolChange(e){const t=this.rbdForm.get("dataPool");t.value===e&&t.setValue(null),this.dataPools=this.allDataPools?this.allDataPools.filter(t=>t.pool_name!==e):[],this.namespaces=null,e in this.namespacesByPoolCache?this.namespaces=this.namespacesByPoolCache[e]:this.rbdService.listNamespaces(e).subscribe(t=>{t=t.map(e=>e.namespace),this.namespacesByPoolCache[e]=t,this.namespaces=t}),this.rbdForm.get("namespace").setValue(null)}onUseDataPoolChange(){this.rbdForm.getValue("useDataPool")||(this.rbdForm.get("dataPool").setValue(null),this.onDataPoolChange(null))}onDataPoolChange(e){const t=this.allPools.filter(t=>t.pool_name!==e);this.rbdForm.getValue("pool")===e&&this.rbdForm.get("pool").setValue(null),this.pools=t}validateRbdForm(e){return t=>{const a=t.get("useDataPool"),i=t.get("dataPool");let o=null;a.value&&null==i.value&&(o={required:!0}),i.setErrors(o);const s=t.get("size"),n=t.get("obj_size"),c=e.toBytes(null!=n.value?n.value:this.defaultObjectSize),r=t.get("stripingCount"),l=null!=r.value?r.value:1;let b=null;null===s.value?b={required:!0}:l*c>e.toBytes(s.value)&&(b={invalidSizeObject:!0}),s.setErrors(b);const d=t.get("stripingUnit");let u=null;null===d.value&&null!==r.value?u={required:!0}:null!==d.value&&e.toBytes(d.value)>c&&(u={invalidStripingUnit:!0}),d.setErrors(u);let m=null;return null===r.value&&null!==d.value?m={required:!0}:l<1&&(m={min:!0}),r.setErrors(m),null}}deepBoxCheck(e,t){this.getDependentChildFeatures(e).forEach(e=>{const a=this.rbdForm.get(e.key);t?a.enable({emitEvent:!1}):(a.disable({emitEvent:!1}),a.setValue(!1,{emitEvent:!1}),this.deepBoxCheck(e.key,t));const i=this.rbdForm.get("features");this.mode===this.rbdFormMode.editing&&i.get(e.key).enabled&&((-1===this.response.features_name.indexOf(e.key)||e.allowDisable)&&(-1!==this.response.features_name.indexOf(e.key)||e.allowEnable)||i.get(e.key).disable())})}getDependentChildFeatures(e){return m.a.filter(this.features,t=>t.requires===e)||[]}interlockCheck(e,t){const a=this.featuresList.find(t=>t.key===e);if(this.response){const e=null!=a.interlockedWith,t=this.featuresList.find(e=>e.interlockedWith===a.key),i=!!this.response.features_name.find(e=>e===a.key);if(e){if(i!==!!this.response.features_name.find(e=>e===a.interlockedWith))return}else if(t&&!!this.response.features_name.find(e=>e===t.key)!==i)return}t?m.a.filter(this.features,t=>t.interlockedWith===e).forEach(e=>this.rbdForm.get(e.key).setValue(!0,{emitEvent:!1})):a.interlockedWith&&this.rbdForm.get("features").get(a.interlockedWith).setValue(!1)}featureFormUpdate(e,t){if(t){const t=this.features[e].requires;if(t&&!this.rbdForm.getValue(t))return void this.rbdForm.get(`features.${e}`).setValue(!1)}this.deepBoxCheck(e,t),this.interlockCheck(e,t)}setFeatures(e){const t=this.rbdForm.get("features");m.a.forIn(this.features,a=>{-1!==e.indexOf(a.key)&&t.get(a.key).setValue(!0),this.featureFormUpdate(a.key,t.get(a.key).value)})}setResponse(e,t){this.response=e;const a=new w.a(e.pool_name,e.namespace,e.name).toString();if(this.mode===this.rbdFormMode.cloning)this.rbdForm.get("parent").setValue(`${a}@${t}`);else if(this.mode===this.rbdFormMode.copying)t?this.rbdForm.get("parent").setValue(`${a}@${t}`):this.rbdForm.get("parent").setValue(`${a}`);else if(e.parent){const t=e.parent;this.rbdForm.get("parent").setValue(`${t.pool_name}/${t.image_name}@${t.snap_name}`)}this.mode===this.rbdFormMode.editing&&this.rbdForm.get("name").setValue(e.name),this.rbdForm.get("pool").setValue(e.pool_name),this.onPoolChange(e.pool_name),this.rbdForm.get("namespace").setValue(e.namespace),e.data_pool&&(this.rbdForm.get("useDataPool").setValue(!0),this.rbdForm.get("dataPool").setValue(e.data_pool)),this.rbdForm.get("size").setValue(this.dimlessBinaryPipe.transform(e.size)),this.rbdForm.get("obj_size").setValue(this.dimlessBinaryPipe.transform(e.obj_size)),this.setFeatures(e.features_name),this.rbdForm.get("stripingUnit").setValue(this.dimlessBinaryPipe.transform(e.stripe_unit)),this.rbdForm.get("stripingCount").setValue(e.stripe_count),this.initializeConfigData.next({initialData:this.response.configuration,sourceType:fi.a.image})}createRequest(){const e=new _i;return e.pool_name=this.rbdForm.getValue("pool"),e.namespace=this.rbdForm.getValue("namespace"),e.name=this.rbdForm.getValue("name"),e.size=this.formatter.toBytes(this.rbdForm.getValue("size")),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(),e}addObjectSizeAndStripingToRequest(e){e.obj_size=this.formatter.toBytes(this.rbdForm.getValue("obj_size")),m.a.forIn(this.features,t=>{this.rbdForm.getValue(t.key)&&e.features.push(t.key)}),e.stripe_unit=this.formatter.toBytes(this.rbdForm.getValue("stripingUnit")),e.stripe_count=this.rbdForm.getValue("stripingCount"),e.data_pool=this.rbdForm.getValue("dataPool")}createAction(){const e=this.createRequest();return this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/create",{pool_name:e.pool_name,namespace:e.namespace,image_name:e.name}),call:this.rbdService.create(e)})}editRequest(){const e=new Wi;return e.name=this.rbdForm.getValue("name"),e.size=this.formatter.toBytes(this.rbdForm.getValue("size")),m.a.forIn(this.features,t=>{this.rbdForm.getValue(t.key)&&e.features.push(t.key)}),e.configuration=this.getDirtyConfigurationValues(),e}cloneRequest(){const e=new Di;return e.child_pool_name=this.rbdForm.getValue("pool"),e.child_namespace=this.rbdForm.getValue("namespace"),e.child_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(!0,fi.a.image),e}editAction(){const e=new w.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/edit",{image_spec:e.toString()}),call:this.rbdService.update(e,this.editRequest())})}cloneAction(){const e=this.cloneRequest(),t=new w.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/clone",{parent_image_spec:t.toString(),parent_snap_name:this.snapName,child_pool_name:e.child_pool_name,child_namespace:e.child_namespace,child_image_name:e.child_image_name}),call:this.rbdService.cloneSnapshot(t,this.snapName,e)})}copyRequest(){const e=new wi;return this.snapName&&(e.snapshot_name=this.snapName),e.dest_pool_name=this.rbdForm.getValue("pool"),e.dest_namespace=this.rbdForm.getValue("namespace"),e.dest_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(e),e.configuration=this.getDirtyConfigurationValues(!0,fi.a.image),e}copyAction(){const e=this.copyRequest(),t=new w.a(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/copy",{src_image_spec:t.toString(),dest_pool_name:e.dest_pool_name,dest_namespace:e.dest_namespace,dest_image_name:e.dest_image_name}),call:this.rbdService.copy(t,e)})}submit(){this.mode||this.rbdImage.next("create"),this.rbdImage.pipe(Object(ui.a)(),Object(mi.a)(()=>this.mode===this.rbdFormMode.editing?this.editAction():this.mode===this.rbdFormMode.cloning?this.cloneAction():this.mode===this.rbdFormMode.copying?this.copyAction():this.createAction())).subscribe(()=>{},()=>this.rbdForm.setErrors({cdSubmitButton:!0}),()=>this.router.navigate(["/block/rbd"]))}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(s.a),v.Rb(pi.a),v.Rb(W),v.Rb(gi.a),v.Rb(R.a),v.Rb(hi.a),v.Rb(l.b),v.Rb(s.e))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-form"]],features:[v.Ab],decls:1,vars:1,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d,u,m,p,f,h,g,v,S,D,w,_,W,y,X,I,k,P,$,T,F,R,E,z,N;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",a="Pool",i="Use a dedicated data pool",o="Size",s="e.g., 10GiB",n="Features",c="Advanced",r="Striping",l="Object size",b="Stripe unit",d="-- Select stripe unit --",u="Stripe count",m="" + "\ufffd0\ufffd" + " from",p="This field is required.",f="'/' and '@' are not allowed.",h="Loading...",g="-- No rbd pools available --",v="-- Select a pool --",S="This field is required.",D="Loading...",w="-- No namespaces available --",_="-- Select a namespace --",W="You need more than one pool with the rbd application label use to use a dedicated data pool.",y="Data pool",X="Dedicated pool that stores the object-data of the RBD.",I="Loading...",k="-- No data pools available --",P="This field is required.",$="This field is required.",T="You have to increase the size.",F="Advanced...",R="This field is required because stripe count is defined!",E="Stripe unit is greater than object size.",z="This field is required because stripe unit is defined!",N="Stripe count must be greater than 0.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","rbdForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["type","text","placeholder","Name...","id","name","name","name","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"form-group","row",3,"change"],["for","pool",1,"cd-col-form-label",3,"ngClass"],a,["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","useDataPool","name","useDataPool","formControlName","useDataPool",1,"custom-control-input",3,"change"],["for","useDataPool",1,"custom-control-label"],i,[4,"ngIf"],["for","size",1,"cd-col-form-label","required"],o,["id","size","name","size","type","text","formControlName","size","placeholder",s,"defaultUnit","GiB","cdDimlessBinary","",1,"form-control"],["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],n,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"row"],[1,"col-sm-12"],["class","float-right margin-right-md","href","",3,"click",4,"ngIf"],[3,"hidden"],[1,"cd-header"],c,[1,"col-md-12"],r,["for","size",1,"cd-col-form-label"],l,["id","obj_size","name","obj_size","formControlName","obj_size",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["for","stripingUnit",1,"cd-col-form-label",3,"ngClass"],b,["id","stripingUnit","name","stripingUnit","formControlName","stripingUnit",1,"form-control","custom-select"],[3,"ngValue"],d,["for","stripingCount",1,"cd-col-form-label",3,"ngClass"],u,["id","stripingCount","name","stripingCount","formControlName","stripingCount","type","number",1,"form-control"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","name",1,"cd-col-form-label"],m,["type","text","id","parent","name","parent","formControlName","parent",1,"form-control"],[1,"invalid-feedback"],p,f,["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],h,g,v,[3,"value"],S,[3,"ngClass"],["for","pool",1,"cd-col-form-label"],["class","form-control","type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",4,"ngIf"],["id","namespace","name","namespace","class","form-control custom-select","formControlName","namespace",4,"ngIf"],["type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",1,"form-control"],["id","namespace","name","namespace","formControlName","namespace",1,"form-control","custom-select"],D,w,_,W,["for","dataPool",1,"cd-col-form-label"],y,["html",X],["class","form-control","type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",4,"ngIf"],["id","dataPool","name","dataPool","class","form-control custom-select","formControlName","dataPool",3,"change",4,"ngIf"],["type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control"],["id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control","custom-select",3,"change"],I,k,P,$,T,["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],[3,"html",4,"ngIf"],[3,"html"],["href","",1,"float-right","margin-right-md",3,"click"],F,R,E,z,N]},template:function(e,t){1&e&&v.Pc(0,fo,83,46,"div",0),2&e&&v.uc("cdFormLoading",t.loading)},directives:[oe.a,o.B,o.r,o.k,z.a,i.r,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.p,o.b,Xi.a,o.l,i.q,o.z,o.u,o.C,o.v,Ii.a,A.a,ki.a],pipes:[i.A,le.a],styles:[""]}),e})();var go=a("OLbh"),vo=a("yJti"),So=a("EgGo"),Do=a("wd/R"),wo=a.n(Do),_o=a("2EZI"),Wo=a("MAOJ");function yo(e,t){1&e&&(v.Xb(0,"div",18),v.Xb(1,"span"),v.bc(2,19),v.Wb(),v.Wb())}function Xo(e,t){1&e&&(v.Xb(0,"span",20),v.bc(1,21),v.Wb())}function Io(e,t){1&e&&(v.Xb(0,"span",20),v.bc(1,22),v.Wb())}function ko(e,t){if(1&e&&v.Sb(0,"cd-date-time-picker",23),2&e){const e=v.nc();v.uc("control",e.moveForm.get("expiresAt"))}}let Po=(()=>{class e{constructor(e,t,a,i,o){this.rbdService=e,this.activeModal=t,this.actionLabels=a,this.fb=i,this.taskWrapper=o,this.createForm()}createForm(){this.moveForm=this.fb.group({expiresAt:["",[$.a.custom("format",e=>!(""===e||wo()(e,"YYYY-MM-DD HH:mm:ss").isValid())),$.a.custom("expired",e=>wo()().isAfter(e))]]})}ngOnInit(){this.imageSpec=new w.a(this.poolName,this.namespace,this.imageName),this.imageSpecStr=this.imageSpec.toString(),this.pattern=`${this.poolName}/${this.imageName}`}moveImage(){let e=0;const t=this.moveForm.getValue("expiresAt");t&&(e=wo()(t,"YYYY-MM-DD HH:mm:ss").diff(wo()(),"seconds",!0)),e<0&&(e=0),this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/trash/move",{image_spec:this.imageSpecStr}),call:this.rbdService.moveTrash(this.imageSpec,e)}).subscribe({complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(W),v.Rb(c.a),v.Rb(l.b),v.Rb(_o.a),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-trash-move-modal"]],decls:23,vars:9,consts:function(){let e,t,a,i,o,s,n;return e="Move an image to trash",t="To move " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " to trash, click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Move" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ". Optionally, you can pick an expiration date.",t=v.gc(t),a="Protection expires at",i="NOT PROTECTED",o="This image contains snapshot(s), which will prevent it from being removed after moved to trash.",s="Wrong date format. Please use \"YYYY-MM-DD HH:mm:ss\".",n="Protection has already expired. Please pick a future date or leave it empty.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","moveForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],["class","alert alert-warning","role","alert",4,"ngIf"],t,[1,"form-group"],["for","expiresAt",1,"col-form-label"],a,["type","text","placeholder",i,"formControlName","expiresAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["p","ngbPopover"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["popContent",""],["role","alert",1,"alert","alert-warning"],o,[1,"invalid-feedback"],s,n,[3,"control"]]},template:function(e,t){if(1&e){const e=v.Yb();v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Pc(7,yo,3,0,"div",7),v.Xb(8,"p"),v.hc(9,8),v.Sb(10,"kbd"),v.Sb(11,"kbd"),v.ec(),v.Wb(),v.Xb(12,"div",9),v.Xb(13,"label",10),v.bc(14,11),v.Wb(),v.Xb(15,"input",12,13),v.lc("click",function(){return v.Ic(e),v.Fc(16).open()})("keypress",function(){return v.Ic(e),v.Fc(16).close()}),v.Wb(),v.Pc(17,Xo,2,0,"span",14),v.Pc(18,Io,2,0,"span",14),v.Wb(),v.Wb(),v.Xb(19,"div",15),v.Xb(20,"cd-form-button-panel",16),v.lc("submitActionEvent",function(){return t.moveImage()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb(),v.Pc(21,ko,1,1,"ng-template",null,17,v.Qc)}if(2&e){const e=v.Fc(5),a=v.Fc(22);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.moveForm),v.Db(3),v.uc("ngIf",t.hasSnapshots),v.Db(4),v.fc(t.imageSpecStr),v.cc(9),v.Db(4),v.uc("ngbPopover",a),v.Db(2),v.uc("ngIf",t.moveForm.showError("expiresAt",e,"format")),v.Db(1),v.uc("ngIf",t.moveForm.showError("expiresAt",e,"expired")),v.Db(2),v.uc("form",t.moveForm)("submitText",t.actionLabels.MOVE)}},directives:[E.a,o.B,o.r,o.k,z.a,i.r,N.a,C.a,o.d,V.a,o.q,o.i,c.w,A.a,Wo.a],styles:[""]}),e})();function $o(e,t){1&e&&(v.Xb(0,"li",10),v.Xb(1,"a",3),v.bc(2,11),v.Wb(),v.Wb())}let To=(()=>{class e{constructor(e,t){this.authStorageService=e,this.router=t,this.grafanaPermission=this.authStorageService.getPermissions().grafana}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(s.e))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-tabs"]],decls:12,vars:2,consts:function(){let e,t,a,i;return e="Images",t="Namespaces",a="Trash",i="Overall Performance",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/rbd"],["ngbNavLink",""],e,["ngbNavItem","/block/rbd/namespaces"],t,["ngbNavItem","/block/rbd/trash"],a,["ngbNavItem","/block/rbd/performance",4,"ngIf"],["ngbNavItem","/block/rbd/performance"],i]},template:function(e,t){1&e&&(v.Xb(0,"ul",0,1),v.lc("navChange",function(e){return t.router.navigate([e.nextId])}),v.Xb(2,"li",2),v.Xb(3,"a",3),v.bc(4,4),v.Wb(),v.Wb(),v.Xb(5,"li",5),v.Xb(6,"a",3),v.bc(7,6),v.Wb(),v.Wb(),v.Xb(8,"li",7),v.Xb(9,"a",3),v.bc(10,8),v.Wb(),v.Wb(),v.Pc(11,$o,3,0,"li",9),v.Wb()),2&e&&(v.uc("activeId",t.router.url),v.Db(11),v.uc("ngIf",t.grafanaPermission.read))},directives:[c.p,c.r,c.s,i.r],styles:[""]}),e})();var Fo=a("LRne"),Ro=a("nQ07"),Eo=a("QTAa"),zo=a("a0VL"),No=a("mSOc"),Co=a("VXsX"),Vo=a("XNiG");function Ao(e,t){1&e&&(v.Xb(0,"span",15),v.bc(1,16),v.Wb())}let xo=(()=>{class e{constructor(e,t,a,i,o){this.activeModal=e,this.rbdService=t,this.taskManagerService=a,this.notificationService=i,this.actionLabels=o,this.editing=!1,this.onSubmit=new Vo.a,this.action=this.actionLabels.CREATE,this.resource="RBD Snapshot",this.createForm()}createForm(){this.snapshotForm=new P.a({snapshotName:new o.h("",{validators:[o.A.required]})})}setSnapName(e){this.snapName=e,this.snapshotForm.get("snapshotName").setValue(e)}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.RENAME:this.actionLabels.CREATE}editAction(){const e=this.snapshotForm.getValue("snapshotName"),t=new w.a(this.poolName,this.namespace,this.imageName),a=new T.a;a.name="rbd/snap/edit",a.metadata={image_spec:t.toString(),snapshot_name:e},this.rbdService.renameSnapshot(t,this.snapName,e).toPromise().then(()=>{this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)}),this.activeModal.close(),this.onSubmit.next(this.snapName)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}createAction(){const e=this.snapshotForm.getValue("snapshotName"),t=new w.a(this.poolName,this.namespace,this.imageName),a=new T.a;a.name="rbd/snap/create",a.metadata={image_spec:t.toString(),snapshot_name:e},this.rbdService.createSnapshot(t,e).toPromise().then(()=>{this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)}),this.activeModal.close(),this.onSubmit.next(e)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}submit(){this.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(W),v.Rb(Co.a),v.Rb(ut.a),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-snapshot-form-modal"]],decls:19,vars:15,consts:function(){let e,t,a;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",a="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","snapshotForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","snapshotName",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["type","text","placeholder","Snapshot name...","id","snapshotName","name","snapshotName","formControlName","snapshotName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],a]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.oc(3,"titlecase"),v.oc(4,"upperFirst"),v.Ub(),v.Vb(5,3),v.Xb(6,"form",4,5),v.Xb(8,"div",6),v.Xb(9,"div",7),v.Xb(10,"label",8),v.bc(11,9),v.Wb(),v.Xb(12,"div",10),v.Sb(13,"input",11),v.Pc(14,Ao,2,0,"span",12),v.Wb(),v.Wb(),v.Wb(),v.Xb(15,"div",13),v.Xb(16,"cd-form-button-panel",14),v.lc("submitActionEvent",function(){return t.submit()}),v.oc(17,"titlecase"),v.oc(18,"upperFirst"),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(7);v.uc("modalRef",t.activeModal),v.Db(4),v.fc(v.pc(3,7,t.action))(v.pc(4,9,t.resource)),v.cc(2),v.Db(2),v.uc("formGroup",t.snapshotForm),v.Db(8),v.uc("ngIf",t.snapshotForm.showError("snapshotName",e,"required")),v.Db(2),v.uc("form",t.snapshotForm)("submitText",v.pc(17,11,t.action)+" "+v.pc(18,13,t.resource))}},directives:[E.a,o.B,o.r,o.k,z.a,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.r,A.a],pipes:[i.A,le.a],styles:[""]}),e})();class Oo{constructor(e,t,a){this.featuresName=t,this.cloneFormatVersion=1,a.cloneFormatVersion().subscribe(e=>{this.cloneFormatVersion=e}),this.create={permission:"create",icon:I.a.add,name:e.CREATE},this.rename={permission:"update",icon:I.a.edit,name:e.RENAME},this.protect={permission:"update",icon:I.a.lock,visible:e=>e.hasSingleSelection&&!e.first().is_protected,name:e.PROTECT},this.unprotect={permission:"update",icon:I.a.unlock,visible:e=>e.hasSingleSelection&&e.first().is_protected,name:e.UNPROTECT},this.clone={permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>this.getCloneDisableDesc(e,this.featuresName),icon:I.a.clone,name:e.CLONE},this.copy={permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>!e.hasSingleSelection||e.first().cdExecuting,icon:I.a.copy,name:e.COPY},this.rollback={permission:"update",icon:I.a.undo,name:e.ROLLBACK},this.deleteSnap={permission:"delete",icon:I.a.destroy,disable:e=>{const t=e.first();return!e.hasSingleSelection||t.cdExecuting||t.is_protected},name:e.DELETE},this.ordering=[this.create,this.rename,this.protect,this.unprotect,this.clone,this.copy,this.rollback,this.deleteSnap]}getCloneDisableDesc(e,t){return!(e.hasSingleSelection&&!e.first().cdExecuting)||((null==t?void 0:t.includes("layering"))?1===this.cloneFormatVersion&&!e.first().is_protected&&"Snapshot must be protected in order to clone.":"Parent image must support Layering")}}class Mo{}const Bo=["nameTpl"],qo=["rollbackTpl"];function Lo(e,t){if(1&e&&(v.Vb(0),v.bc(1,3),v.Ub(),v.Xb(2,"strong"),v.Rc(3),v.Wb(),v.Rc(4,".\n")),2&e){const e=t.$implicit;v.Db(3),v.Tc(" ",e.snapName,"")}}let Go=(()=>{class e{constructor(e,t,a,i,o,s,n,c,r,l,b){this.authStorageService=e,this.modalService=t,this.dimlessBinaryPipe=a,this.cdDatePipe=i,this.rbdService=o,this.taskManagerService=s,this.notificationService=n,this.summaryService=c,this.taskListService=r,this.actionLabels=l,this.cdr=b,this.snapshots=[],this.selection=new nt.a,this.builders={"rbd/snap/create":e=>{const t=new Mo;return t.name=e.snapshot_name,t}},this.permission=this.authStorageService.getPermissions().rbdImage}ngOnInit(){this.columns=[{name:"Name",prop:"name",cellTransformation:st.a.executing,flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"State",prop:"is_protected",flexGrow:1,cellTransformation:st.a.badge,customTemplateConfig:{map:{true:{value:"PROTECTED",class:"badge-success"},false:{value:"UNPROTECTED",class:"badge-info"}}}},{name:"Created",prop:"timestamp",flexGrow:1,pipe:this.cdDatePipe}],this.imageSpec=new w.a(this.poolName,this.namespace,this.rbdName),this.rbdTableActions=new Oo(this.actionLabels,this.featuresName,this.rbdService),this.rbdTableActions.create.click=()=>this.openCreateSnapshotModal(),this.rbdTableActions.rename.click=()=>this.openEditSnapshotModal(),this.rbdTableActions.protect.click=()=>this.toggleProtection(),this.rbdTableActions.unprotect.click=()=>this.toggleProtection();const e=()=>this.selection.first()&&`${this.imageSpec.toStringEncoded()}/${encodeURIComponent(this.selection.first().name)}`;this.rbdTableActions.clone.routerLink=()=>`/block/rbd/clone/${e()}`,this.rbdTableActions.copy.routerLink=()=>`/block/rbd/copy/${e()}`,this.rbdTableActions.rollback.click=()=>this.rollbackModal(),this.rbdTableActions.deleteSnap.click=()=>this.deleteSnapshotModal(),this.tableActions=this.rbdTableActions.ordering,this.taskListService.init(()=>Object(Fo.a)(this.snapshots),null,e=>{Ro.a.updateChanged(this,{data:e})&&(this.cdr.detectChanges(),this.data=[...this.data])},()=>{Ro.a.updateChanged(this,{data:this.snapshots})&&(this.cdr.detectChanges(),this.data=[...this.data])},e=>["rbd/snap/create","rbd/snap/delete","rbd/snap/edit","rbd/snap/rollback"].includes(e.name)&&this.imageSpec.toString()===e.metadata.image_spec,(e,t)=>e.name===t.metadata.snapshot_name,this.builders)}ngOnChanges(){this.columns&&(this.imageSpec=new w.a(this.poolName,this.namespace,this.rbdName),this.rbdTableActions&&(this.rbdTableActions.featuresName=this.featuresName),this.taskListService.fetch())}openSnapshotModal(e,t=null){this.modalRef=this.modalService.show(xo),this.modalRef.componentInstance.poolName=this.poolName,this.modalRef.componentInstance.imageName=this.rbdName,this.modalRef.componentInstance.namespace=this.namespace,t?this.modalRef.componentInstance.setEditing():t=`${this.rbdName}_${wo()().toISOString(!0)}`,this.modalRef.componentInstance.setSnapName(t),this.modalRef.componentInstance.onSubmit.subscribe(t=>{const a=new Eo.a;a.name=e,a.metadata={image_spec:this.imageSpec.toString(),snapshot_name:t},this.summaryService.addRunningTask(a)})}openCreateSnapshotModal(){this.openSnapshotModal("rbd/snap/create")}openEditSnapshotModal(){this.openSnapshotModal("rbd/snap/edit",this.selection.first().name)}toggleProtection(){const e=this.selection.first().name,t=this.selection.first().is_protected,a=new T.a;a.name="rbd/snap/edit";const i=new w.a(this.poolName,this.namespace,this.rbdName);a.metadata={image_spec:i.toString(),snapshot_name:e},this.rbdService.protectSnapshot(i,e,!t).toPromise().then(()=>{const e=new Eo.a;e.name=a.name,e.metadata=a.metadata,this.summaryService.addRunningTask(e),this.taskManagerService.subscribe(a.name,a.metadata,e=>{this.notificationService.notifyTask(e)})})}_asyncTask(e,t,a){const i=new T.a;i.name=t,i.metadata={image_spec:new w.a(this.poolName,this.namespace,this.rbdName).toString(),snapshot_name:a};const o=new w.a(this.poolName,this.namespace,this.rbdName);this.rbdService[e](o,a).toPromise().then(()=>{const e=new Eo.a;e.name=i.name,e.metadata=i.metadata,this.summaryService.addRunningTask(e),this.modalRef.close(),this.taskManagerService.subscribe(e.name,e.metadata,e=>{this.notificationService.notifyTask(e)})}).catch(()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}rollbackModal(){const e=this.selection.selected[0].name,t=new w.a(this.poolName,this.namespace,this.rbdName).toString(),a={titleText:"RBD snapshot rollback",buttonText:"Rollback",bodyTpl:this.rollbackTpl,bodyData:{snapName:`${t}@${e}`},onSubmit:()=>{this._asyncTask("rollbackSnapshot","rbd/snap/rollback",e)}};this.modalRef=this.modalService.show(go.a,a)}deleteSnapshotModal(){const e=this.selection.selected[0].name;this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD snapshot",itemNames:[e],submitAction:()=>this._asyncTask("deleteSnapshot","rbd/snap/delete",e)})}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(F.a),v.Rb(hi.a),v.Rb(zo.a),v.Rb(W),v.Rb(Co.a),v.Rb(ut.a),v.Rb(No.a),v.Rb(bt.a),v.Rb(l.b),v.Rb(v.i))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-snapshot-list"]],viewQuery:function(e,t){if(1&e&&(v.Wc(Bo,1),v.Wc(qo,3)),2&e){let e;v.Ec(e=v.mc())&&(t.nameTpl=e.first),v.Ec(e=v.mc())&&(t.rollbackTpl=e.first)}},inputs:{snapshots:"snapshots",featuresName:"featuresName",poolName:"poolName",namespace:"namespace",rbdName:"rbdName"},features:[v.Cb([bt.a]),v.Bb],decls:4,vars:5,consts:function(){let e;return e="You are about to rollback",[["columnMode","flex","selectionType","single",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["rollbackTpl",""],e]},template:function(e,t){1&e&&(v.Xb(0,"cd-table",0),v.lc("updateSelection",function(e){return t.updateSelection(e)}),v.Sb(1,"cd-table-actions",1),v.Wb(),v.Pc(2,Lo,5,1,"ng-template",null,2,v.Qc)),2&e&&(v.uc("data",t.data)("columns",t.columns),v.Db(1),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ot.a,Xt.a],styles:[""],changeDetection:0}),e})();var Uo=a("aAWM"),jo=a("insk"),Qo=a("nSDx");const Yo=["poolConfigurationSourceTpl"];function Ko(e,t){1&e&&(v.Vb(0),v.hc(1,3),v.Sb(2,"strong"),v.ec(),v.Ub())}function Ho(e,t){if(1&e&&(v.Xb(0,"span"),v.Xb(1,"span",38),v.Rc(2),v.Wb(),v.Wb()),2&e){const e=t.$implicit;v.Db(2),v.Sc(e)}}function Jo(e,t){if(1&e&&(v.Xb(0,"span"),v.Xb(1,"span",39),v.bc(2,40),v.Wb(),v.Wb()),2&e){v.nc(3);const e=v.Fc(1);v.Db(1),v.uc("ngbTooltip",e)}}function Zo(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.oc(2,"dimlessBinary"),v.Wb()),2&e){const e=v.nc(3);v.Db(1),v.Tc(" ",v.pc(2,1,e.selection.disk_usage)," ")}}function es(e,t){if(1&e&&(v.Xb(0,"span"),v.Xb(1,"span",39),v.bc(2,41),v.Wb(),v.Wb()),2&e){v.nc(3);const e=v.Fc(1);v.Db(1),v.uc("ngbTooltip",e)}}function ts(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.oc(2,"dimlessBinary"),v.Wb()),2&e){const e=v.nc(3);v.Db(1),v.Tc(" ",v.pc(2,1,e.selection.total_disk_usage)," ")}}function as(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Wb()),2&e){const e=v.nc(4);v.Db(1),v.Tc("/",e.selection.parent.pool_namespace,"")}}function is(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Pc(2,as,2,1,"span",1),v.Rc(3),v.Wb()),2&e){const e=v.nc(3);v.Db(1),v.Sc(e.selection.parent.pool_name),v.Db(1),v.uc("ngIf",e.selection.parent.pool_namespace),v.Db(1),v.Uc("/",e.selection.parent.image_name,"@",e.selection.parent.snap_name,"")}}function os(e,t){1&e&&(v.Xb(0,"span"),v.Rc(1,"-"),v.Wb())}function ss(e,t){if(1&e&&(v.Xb(0,"table",17),v.Xb(1,"tbody"),v.Xb(2,"tr"),v.Xb(3,"td",18),v.bc(4,19),v.Wb(),v.Xb(5,"td",20),v.Rc(6),v.Wb(),v.Wb(),v.Xb(7,"tr"),v.Xb(8,"td",21),v.bc(9,22),v.Wb(),v.Xb(10,"td"),v.Rc(11),v.Wb(),v.Wb(),v.Xb(12,"tr"),v.Xb(13,"td",21),v.bc(14,23),v.Wb(),v.Xb(15,"td"),v.Rc(16),v.oc(17,"empty"),v.Wb(),v.Wb(),v.Xb(18,"tr"),v.Xb(19,"td",21),v.bc(20,24),v.Wb(),v.Xb(21,"td"),v.Rc(22),v.oc(23,"cdDate"),v.Wb(),v.Wb(),v.Xb(24,"tr"),v.Xb(25,"td",21),v.bc(26,25),v.Wb(),v.Xb(27,"td"),v.Rc(28),v.oc(29,"dimlessBinary"),v.Wb(),v.Wb(),v.Xb(30,"tr"),v.Xb(31,"td",21),v.bc(32,26),v.Wb(),v.Xb(33,"td"),v.Rc(34),v.oc(35,"dimless"),v.Wb(),v.Wb(),v.Xb(36,"tr"),v.Xb(37,"td",21),v.bc(38,27),v.Wb(),v.Xb(39,"td"),v.Rc(40),v.oc(41,"dimlessBinary"),v.Wb(),v.Wb(),v.Xb(42,"tr"),v.Xb(43,"td",21),v.bc(44,28),v.Wb(),v.Xb(45,"td"),v.Pc(46,Ho,3,1,"span",29),v.Wb(),v.Wb(),v.Xb(47,"tr"),v.Xb(48,"td",21),v.bc(49,30),v.Wb(),v.Xb(50,"td"),v.Pc(51,Jo,3,1,"span",1),v.Pc(52,Zo,3,3,"span",1),v.Wb(),v.Wb(),v.Xb(53,"tr"),v.Xb(54,"td",21),v.bc(55,31),v.Wb(),v.Xb(56,"td"),v.Pc(57,es,3,1,"span",1),v.Pc(58,ts,3,3,"span",1),v.Wb(),v.Wb(),v.Xb(59,"tr"),v.Xb(60,"td",21),v.bc(61,32),v.Wb(),v.Xb(62,"td"),v.Rc(63),v.oc(64,"dimlessBinary"),v.Wb(),v.Wb(),v.Xb(65,"tr"),v.Xb(66,"td",21),v.bc(67,33),v.Wb(),v.Xb(68,"td"),v.Rc(69),v.Wb(),v.Wb(),v.Xb(70,"tr"),v.Xb(71,"td",21),v.bc(72,34),v.Wb(),v.Xb(73,"td"),v.Pc(74,is,4,4,"span",1),v.Pc(75,os,2,0,"span",1),v.Wb(),v.Wb(),v.Xb(76,"tr"),v.Xb(77,"td",21),v.bc(78,35),v.Wb(),v.Xb(79,"td"),v.Rc(80),v.Wb(),v.Wb(),v.Xb(81,"tr"),v.Xb(82,"td",21),v.bc(83,36),v.Wb(),v.Xb(84,"td"),v.Rc(85),v.Wb(),v.Wb(),v.Xb(86,"tr"),v.Xb(87,"td",21),v.bc(88,37),v.Wb(),v.Xb(89,"td"),v.Rc(90),v.Wb(),v.Wb(),v.Wb(),v.Wb()),2&e){const e=v.nc(2);v.Db(6),v.Sc(e.selection.name),v.Db(5),v.Sc(e.selection.pool_name),v.Db(5),v.Sc(v.pc(17,19,e.selection.data_pool)),v.Db(6),v.Sc(v.pc(23,21,e.selection.timestamp)),v.Db(6),v.Sc(v.pc(29,23,e.selection.size)),v.Db(6),v.Sc(v.pc(35,25,e.selection.num_objs)),v.Db(6),v.Sc(v.pc(41,27,e.selection.obj_size)),v.Db(6),v.uc("ngForOf",e.selection.features_name),v.Db(5),v.uc("ngIf",-1===(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),v.Db(1),v.uc("ngIf",-1!==(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),v.Db(5),v.uc("ngIf",-1===(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),v.Db(1),v.uc("ngIf",-1!==(null==e.selection.features_name?null:e.selection.features_name.indexOf("fast-diff"))),v.Db(5),v.Sc(v.pc(64,29,e.selection.stripe_unit)),v.Db(6),v.Sc(e.selection.stripe_count),v.Db(5),v.uc("ngIf",e.selection.parent),v.Db(1),v.uc("ngIf",!e.selection.parent),v.Db(5),v.Sc(e.selection.block_name_prefix),v.Db(5),v.Sc(e.selection.order),v.Db(5),v.Sc(e.selection.image_format)}}function ns(e,t){if(1&e&&v.Sb(0,"cd-rbd-snapshot-list",42),2&e){const e=v.nc(2);v.uc("snapshots",e.selection.snapshots)("featuresName",e.selection.features_name)("poolName",e.selection.pool_name)("namespace",e.selection.namespace)("rbdName",e.selection.name)}}function cs(e,t){if(1&e&&v.Sb(0,"cd-rbd-configuration-table",43),2&e){const e=v.nc(2);v.uc("data",e.selection.configuration)}}function rs(e,t){if(1&e&&v.Sb(0,"cd-grafana",44),2&e){const e=v.nc(2);v.uc("grafanaPath",e.rbdDashboardUrl)}}function ls(e,t){if(1&e&&(v.Vb(0),v.Xb(1,"ul",4,5),v.Xb(3,"li",6),v.Xb(4,"a",7),v.bc(5,8),v.Wb(),v.Pc(6,ss,91,31,"ng-template",9),v.Wb(),v.Xb(7,"li",10),v.Xb(8,"a",7),v.bc(9,11),v.Wb(),v.Pc(10,ns,1,5,"ng-template",9),v.Wb(),v.Xb(11,"li",12),v.Xb(12,"a",7),v.bc(13,13),v.Wb(),v.Pc(14,cs,1,1,"ng-template",9),v.Wb(),v.Xb(15,"li",14),v.Xb(16,"a",7),v.bc(17,15),v.Wb(),v.Pc(18,rs,1,1,"ng-template",9),v.Wb(),v.Wb(),v.Sb(19,"div",16),v.Ub()),2&e){const e=v.Fc(2);v.Db(19),v.uc("ngbNavOutlet",e)}}function bs(e,t){1&e&&(v.Vb(0),v.Xb(1,"cd-alert-panel",45),v.bc(2,46),v.Wb(),v.Ub())}function ds(e,t){1&e&&(v.Vb(0),v.Xb(1,"strong",49),v.bc(2,50),v.Wb(),v.Ub())}function us(e,t){1&e&&(v.Xb(0,"span",51),v.bc(1,52),v.Wb())}function ms(e,t){if(1&e&&(v.Pc(0,ds,3,0,"ng-container",47),v.Pc(1,us,2,0,"ng-template",null,48,v.Qc)),2&e){const e=t.value,a=v.Fc(2);v.uc("ngIf",+e)("ngIfElse",a)}}let ps=(()=>{class e{ngOnChanges(){this.selection&&(this.rbdDashboardUrl=`rbd-details?var-Pool=${this.selection.pool_name}&var-Image=${this.selection.name}`)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-details"]],viewQuery:function(e,t){if(1&e&&(v.Wc(Yo,3),v.Wc(c.p,3)),2&e){let e;v.Ec(e=v.mc())&&(t.poolConfigurationSourceTpl=e.first),v.Ec(e=v.mc())&&(t.nav=e.first)}},inputs:{selection:"selection",images:"images"},features:[v.Bb],decls:6,vars:2,consts:function(){let e,t,a,i,o,s,n,c,r,l,b,d,u,m,p,f,h,g,v,S,D,w,_,W,y,X,I,k;return e="Only available for RBD images with " + "\ufffd#2\ufffd" + "fast-diff" + "\ufffd/#2\ufffd" + " enabled",t="Details",a="Snapshots",i="Configuration",o="Performance",s="Name",n="Pool",c="Data Pool",r="Created",l="Size",b="Objects",d="Object size",u="Features",m="Provisioned",p="Total provisioned",f="Striping unit",h="Striping count",g="Parent",v="Block name prefix",S="Order",D="Format Version",w="N/A",_="N/A",W="Information can not be displayed for RBD in status 'Removing'.",y="This setting overrides the global value",X="Image",I="This is the global value. No value for this option has been set for this image.",k="Global",[["usageNotAvailableTooltipTpl",""],[4,"ngIf"],["poolConfigurationSourceTpl",""],e,["ngbNav","","cdStatefulTab","rbd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],t,["ngbNavContent",""],["ngbNavItem","snapshots"],a,["ngbNavItem","configuration"],i,["ngbNavItem","performance"],o,[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],s,[1,"w-75"],[1,"bold"],n,c,r,l,b,d,u,[4,"ngFor","ngForOf"],m,p,f,h,g,v,S,D,[1,"badge","badge-dark","mr-2"],["placement","top",1,"form-text","text-muted",3,"ngbTooltip"],w,_,[3,"snapshots","featuresName","poolName","namespace","rbdName"],[3,"data"],["uid","YhCYGcuZz","grafanaStyle","one",3,"grafanaPath"],["type","warning"],W,[4,"ngIf","ngIfElse"],["global",""],["ngbTooltip",y],X,["ngbTooltip",I],k]},template:function(e,t){1&e&&(v.Pc(0,Ko,3,0,"ng-template",null,0,v.Qc),v.Pc(2,ls,20,1,"ng-container",1),v.Pc(3,bs,3,0,"ng-container",1),v.Pc(4,ms,3,2,"ng-template",null,2,v.Qc)),2&e&&(v.Db(2),v.uc("ngIf",t.selection&&"REMOVING"!==t.selection.source),v.Db(1),v.uc("ngIf",t.selection&&"REMOVING"===t.selection.source))},directives:[i.r,c.p,Za.a,c.r,c.s,c.q,c.u,i.q,c.D,Go,Uo.a,jo.a,Wt.a],pipes:[Qo.a,zo.a,hi.a,Gt.a],styles:[""]}),e})();const fs=["usageTpl"],hs=["parentTpl"],gs=["nameTpl"],vs=["flattenTpl"],Ss=["deleteTpl"],Ds=["removingStatTpl"],ws=["provisionedNotAvailableTooltipTpl"],_s=["totalProvisionedNotAvailableTooltipTpl"];function Ws(e,t){1&e&&v.Sb(0,"div",11),2&e&&v.uc("innerHtml","Only available for RBD images with <strong>fast-diff</strong> enabled",v.Jc)}function ys(e,t){if(1&e&&(v.Xb(0,"span",14),v.bc(1,15),v.Wb()),2&e){v.nc(2);const e=v.Fc(6);v.uc("ngbTooltip",e)}}function Xs(e,t){if(1&e&&(v.bc(0,16),v.oc(1,"dimlessBinary")),2&e){const e=v.nc().row;v.Db(1),v.fc(v.pc(1,1,e.disk_usage)),v.cc(0)}}function Is(e,t){if(1&e&&(v.Pc(0,ys,2,1,"span",12),v.Pc(1,Xs,2,3,"ng-template",null,13,v.Qc)),2&e){const e=t.row,a=v.Fc(2);v.uc("ngIf",null===e.disk_usage)("ngIfElse",a)}}function ks(e,t){if(1&e&&(v.Xb(0,"span",14),v.bc(1,18),v.Wb()),2&e){v.nc(2);const e=v.Fc(6);v.uc("ngbTooltip",e)}}function Ps(e,t){if(1&e&&(v.bc(0,19),v.oc(1,"dimlessBinary")),2&e){const e=v.nc().row;v.Db(1),v.fc(v.pc(1,1,e.total_disk_usage)),v.cc(0)}}function $s(e,t){if(1&e&&(v.Pc(0,ks,2,1,"span",12),v.Pc(1,Ps,2,3,"ng-template",null,17,v.Qc)),2&e){const e=t.row,a=v.Fc(2);v.uc("ngIf",null===e.total_disk_usage)("ngIfElse",a)}}function Ts(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Wb()),2&e){const e=v.nc(2).value;v.Db(1),v.Tc("/",e.pool_namespace,"")}}function Fs(e,t){if(1&e&&(v.Xb(0,"span"),v.Rc(1),v.Pc(2,Ts,2,1,"span",20),v.Rc(3),v.Wb()),2&e){const e=v.nc().value;v.Db(1),v.Sc(e.pool_name),v.Db(1),v.uc("ngIf",e.pool_namespace),v.Db(1),v.Uc("/",e.image_name,"@",e.snap_name,"")}}function Rs(e,t){1&e&&(v.Xb(0,"span"),v.Rc(1,"-"),v.Wb())}function Es(e,t){if(1&e&&(v.Pc(0,Fs,4,4,"span",20),v.Pc(1,Rs,2,0,"span",20)),2&e){const e=t.value;v.uc("ngIf",e),v.Db(1),v.uc("ngIf",!e)}}function zs(e,t){if(1&e&&(v.Rc(0," You are about to flatten "),v.Xb(1,"strong"),v.Rc(2),v.Wb(),v.Rc(3,". "),v.Sb(4,"br"),v.Sb(5,"br"),v.Rc(6," All blocks will be copied from parent "),v.Xb(7,"strong"),v.Rc(8),v.Wb(),v.Rc(9," to child "),v.Xb(10,"strong"),v.Rc(11),v.Wb(),v.Rc(12,".\n")),2&e){const e=t.$implicit;v.Db(2),v.Sc(e.child),v.Db(6),v.Sc(e.parent),v.Db(3),v.Sc(e.child)}}function Ns(e,t){if(1&e&&(v.Xb(0,"li"),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.Db(1),v.Sc(e)}}function Cs(e,t){if(1&e&&(v.Vb(0),v.Xb(1,"span"),v.bc(2,24),v.Wb(),v.Xb(3,"ul"),v.Pc(4,Ns,2,1,"li",25),v.Wb(),v.Ub()),2&e){const e=v.nc(2).snapshots;v.Db(4),v.uc("ngForOf",e)}}function Vs(e,t){if(1&e&&(v.Xb(0,"div",22),v.Xb(1,"span"),v.bc(2,23),v.Wb(),v.Sb(3,"br"),v.Pc(4,Cs,5,1,"ng-container",20),v.Wb()),2&e){const e=v.nc().snapshots;v.Db(4),v.uc("ngIf",e.length>0)}}function As(e,t){1&e&&v.Pc(0,Vs,5,1,"div",21),2&e&&v.uc("ngIf",t.hasSnapshots)}const xs=function(e,t){return[e,t]};function Os(e,t){if(1&e&&v.Sb(0,"i",27),2&e){const e=v.nc(2);v.uc("ngClass",v.Ac(1,xs,e.icons.spinner,e.icons.spin))}}function Ms(e,t){if(1&e&&(v.Xb(0,"span",27),v.Rc(1),v.Wb()),2&e){const e=v.nc(),t=e.column,a=e.row;v.uc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.executingClass?t.customTemplateConfig.executingClass:"text-muted italic"),v.Db(1),v.Tc(" (",a.cdExecuting,") ")}}function Bs(e,t){if(1&e&&v.Sb(0,"i",29),2&e){const e=v.nc(2);v.Gb("",e.icons.warning," warn")}}function qs(e,t){if(1&e&&(v.Pc(0,Os,1,4,"i",26),v.Xb(1,"span",27),v.Rc(2),v.Wb(),v.Pc(3,Ms,2,2,"span",26),v.Pc(4,Bs,1,3,"i",28)),2&e){const e=t.column,a=t.value,i=t.row;v.uc("ngIf",i.cdExecuting),v.Db(1),v.uc("ngClass",null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.valueClass),v.Db(1),v.Tc(" ",a," "),v.Db(1),v.uc("ngIf",i.cdExecuting),v.Db(1),v.uc("ngIf",i.source&&"REMOVING"===i.source)}}let Ls=(()=>{class e extends at.a{constructor(e,t,a,i,o,s,n,c,r){super(),this.authStorageService=e,this.rbdService=t,this.dimlessBinaryPipe=a,this.dimlessPipe=i,this.modalService=o,this.taskWrapper=s,this.taskListService=n,this.urlBuilder=c,this.actionLabels=r,this.tableStatus=new Fa.a,this.selection=new nt.a,this.icons=I.a,this.builders={"rbd/create":e=>this.createRbdFromTask(e.pool_name,e.namespace,e.image_name),"rbd/delete":e=>this.createRbdFromTaskImageSpec(e.image_spec),"rbd/clone":e=>this.createRbdFromTask(e.child_pool_name,e.child_namespace,e.child_image_name),"rbd/copy":e=>this.createRbdFromTask(e.dest_pool_name,e.dest_namespace,e.dest_image_name)},this.permission=this.authStorageService.getPermissions().rbdImage;const l=()=>this.selection.first()&&new w.a(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name).toStringEncoded();this.tableActions=[{permission:"create",icon:I.a.add,routerLink:()=>this.urlBuilder.getCreate(),canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:I.a.edit,routerLink:()=>this.urlBuilder.getEdit(l()),name:this.actionLabels.EDIT,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)},{permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||!!e.first().cdExecuting,icon:I.a.copy,routerLink:()=>`/block/rbd/copy/${l()}`,name:this.actionLabels.COPY},{permission:"update",disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||e.first().cdExecuting||!e.first().parent,icon:I.a.flatten,click:()=>this.flattenRbdModal(),name:this.actionLabels.FLATTEN},{permission:"delete",icon:I.a.destroy,click:()=>this.deleteRbdModal(),name:this.actionLabels.DELETE,disable:e=>this.getDeleteDisableDesc(e)},{permission:"delete",icon:I.a.trash,click:()=>this.trashRbdModal(),name:this.actionLabels.TRASH,disable:e=>this.getRemovingStatusDesc(e)||this.getInvalidNameDisable(e)||e.first().image_format===Si.V1}]}createRbdFromTaskImageSpec(e){const t=w.a.fromString(e);return this.createRbdFromTask(t.poolName,t.namespace,t.imageName)}createRbdFromTask(e,t,a){const i=new vi;return i.id="-1",i.unique_id="-1",i.name=a,i.namespace=t,i.pool_name=e,i.image_format=Si.V2,i}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:2,cellTemplate:this.removingStatTpl},{name:"Pool",prop:"pool_name",flexGrow:2},{name:"Namespace",prop:"namespace",flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Objects",prop:"num_objs",flexGrow:1,cellClass:"text-right",pipe:this.dimlessPipe},{name:"Object size",prop:"obj_size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,cellTemplate:this.provisionedNotAvailableTooltipTpl},{name:"Total provisioned",prop:"total_disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,cellTemplate:this.totalProvisionedNotAvailableTooltipTpl},{name:"Parent",prop:"parent",flexGrow:2,cellTemplate:this.parentTpl}],this.taskListService.init(()=>this.rbdService.list(),e=>this.prepareResponse(e),e=>this.images=e,()=>this.onFetchError(),e=>["rbd/clone","rbd/copy","rbd/create","rbd/delete","rbd/edit","rbd/flatten","rbd/trash/move"].includes(e.name),(e,t)=>{let a;switch(t.name){case"rbd/copy":a=new w.a(t.metadata.dest_pool_name,t.metadata.dest_namespace,t.metadata.dest_image_name).toString();break;case"rbd/clone":a=new w.a(t.metadata.child_pool_name,t.metadata.child_namespace,t.metadata.child_image_name).toString();break;case"rbd/create":a=new w.a(t.metadata.pool_name,t.metadata.namespace,t.metadata.image_name).toString();break;default:a=t.metadata.image_spec}return a===new w.a(e.pool_name,e.namespace,e.name).toString()},this.builders)}onFetchError(){this.table.reset(),this.tableStatus=new Fa.a(vo.a.ValueException)}prepareResponse(e){let t=[];const a={};let i;if(e.forEach(e=>{m.a.isUndefined(a[e.status])&&(a[e.status]=[]),a[e.status].push(e.pool_name),t=t.concat(e.value)}),a[vo.a.ValueException]?i=vo.a.ValueException:a[vo.a.ValueStale]?i=vo.a.ValueStale:a[vo.a.ValueNone]&&(i=vo.a.ValueNone),i){const e=(a[i].length>1?"pools ":"pool ")+a[i].join();this.tableStatus=new Fa.a(i,e)}else this.tableStatus=new Fa.a;return t}updateSelection(e){this.selection=e}deleteRbdModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().name,i=new w.a(e,t,a);this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD",itemNames:[i],bodyTemplate:this.deleteTpl,bodyContext:{hasSnapshots:this.hasSnapshots(),snapshots:this.listProtectedSnapshots()},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/delete",{image_spec:i.toString()}),call:this.rbdService.delete(i)})})}trashRbdModal(){const e={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,hasSnapshots:this.hasSnapshots()};this.modalRef=this.modalService.show(Po,e)}flattenRbd(e){this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/flatten",{image_spec:e.toString()}),call:this.rbdService.flatten(e)}).subscribe({complete:()=>{this.modalRef.close()}})}flattenRbdModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().name,i=this.selection.first().parent,o=new w.a(i.pool_name,i.pool_namespace,i.image_name),s=new w.a(e,t,a),n={titleText:"RBD flatten",buttonText:"Flatten",bodyTpl:this.flattenTpl,bodyData:{parent:`${o}@${i.snap_name}`,child:s.toString()},onSubmit:()=>{this.flattenRbd(s)}};this.modalRef=this.modalService.show(go.a,n)}hasSnapshots(){return(this.selection.first().snapshots||[]).length>0}hasClonedSnapshots(e){return(e.snapshots||[]).some(e=>e.children&&e.children.length>0)}listProtectedSnapshots(){return this.selection.first().snapshots.reduce((e,t)=>(t.is_protected&&e.push(t.name),e),[])}getDeleteDisableDesc(e){const t=e.first();return t&&this.hasClonedSnapshots(t)?"This RBD has cloned snapshots. Please delete related RBDs before deleting this RBD.":this.getInvalidNameDisable(e)||this.hasClonedSnapshots(e.first())}getInvalidNameDisable(e){var t;const a=e.first();return(null===(t=null==a?void 0:a.name)||void 0===t?void 0:t.match(/[@/]/))?"This RBD image has an invalid name and can't be managed by ceph.":!e.first()||!e.hasSingleSelection}getRemovingStatusDesc(e){const t=e.first();return"REMOVING"===(null==t?void 0:t.source)&&"Action not possible for an RBD in status 'Removing'"}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(W),v.Rb(hi.a),v.Rb(Gt.a),v.Rb(F.a),v.Rb(R.a),v.Rb(bt.a),v.Rb(So.a),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-list"]],viewQuery:function(e,t){if(1&e&&(v.Wc(ot.a,3),v.Wc(fs,1),v.Wc(hs,3),v.Wc(gs,1),v.Wc(vs,3),v.Wc(Ss,3),v.Wc(Ds,3),v.Wc(ws,3),v.Wc(_s,3)),2&e){let e;v.Ec(e=v.mc())&&(t.table=e.first),v.Ec(e=v.mc())&&(t.usageTpl=e.first),v.Ec(e=v.mc())&&(t.parentTpl=e.first),v.Ec(e=v.mc())&&(t.nameTpl=e.first),v.Ec(e=v.mc())&&(t.flattenTpl=e.first),v.Ec(e=v.mc())&&(t.deleteTpl=e.first),v.Ec(e=v.mc())&&(t.removingStatTpl=e.first),v.Ec(e=v.mc())&&(t.provisionedNotAvailableTooltipTpl=e.first),v.Ec(e=v.mc())&&(t.totalProvisionedNotAvailableTooltipTpl=e.first)}},features:[v.Cb([bt.a,{provide:So.a,useValue:new So.a("block/rbd")}]),v.Ab],decls:19,vars:10,consts:function(){let e,t,a,i,o,s,n;return e="N/A",t="" + "\ufffd0\ufffd" + "",a="N/A",i="" + "\ufffd0\ufffd" + "",o="Deleting this image will also delete all its snapshots.",s="The following snapshots are currently protected and will be removed:",n="RBD in status 'Removing'",[["columnMode","flex","identifier","unique_id","forceIdentifier","true","selectionType","single",3,"data","columns","searchableObjects","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["usageNotAvailableTooltipTpl",""],["provisionedNotAvailableTooltipTpl",""],["totalProvisionedNotAvailableTooltipTpl",""],["parentTpl",""],["flattenTpl",""],["deleteTpl",""],["removingStatTpl",""],[3,"innerHtml"],["placement","top",3,"ngbTooltip",4,"ngIf","ngIfElse"],["provisioned",""],["placement","top",3,"ngbTooltip"],e,t,["totalProvisioned",""],a,i,[4,"ngIf"],["class","alert alert-warning","role","alert",4,"ngIf"],["role","alert",1,"alert","alert-warning"],o,s,[4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["title",n,3,"class",4,"ngIf"],["title",n]]},template:function(e,t){1&e&&(v.Sb(0,"cd-rbd-tabs"),v.Xb(1,"cd-table",0,1),v.lc("fetchData",function(){return t.taskListService.fetch()})("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)}),v.Sb(3,"cd-table-actions",2),v.Sb(4,"cd-rbd-details",3),v.Wb(),v.Pc(5,Ws,1,1,"ng-template",null,4,v.Qc),v.Pc(7,Is,3,2,"ng-template",null,5,v.Qc),v.Pc(9,$s,3,2,"ng-template",null,6,v.Qc),v.Pc(11,Es,2,2,"ng-template",null,7,v.Qc),v.Pc(13,zs,13,3,"ng-template",null,8,v.Qc),v.Pc(15,As,1,1,"ng-template",null,9,v.Qc),v.Pc(17,qs,5,5,"ng-template",null,10,v.Qc)),2&e&&(v.Db(1),v.uc("data",t.images)("columns",t.columns)("searchableObjects",!0)("hasDetails",!0)("status",t.tableStatus)("autoReload",-1),v.Db(2),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),v.Db(1),v.uc("selection",t.expandedRow))},directives:[To,ot.a,Xt.a,ps,i.r,c.D,i.q,i.p],pipes:[hi.a],styles:[".warn[_ngcontent-%COMP%]{color:#ffc200}"]}),e})();function Gs(e,t){1&e&&v.Sb(0,"input",19)}function Us(e,t){1&e&&(v.Xb(0,"option",23),v.bc(1,24),v.Wb()),2&e&&v.uc("ngValue",null)}function js(e,t){1&e&&(v.Xb(0,"option",23),v.bc(1,25),v.Wb()),2&e&&v.uc("ngValue",null)}function Qs(e,t){1&e&&(v.Xb(0,"option",23),v.bc(1,26),v.Wb()),2&e&&v.uc("ngValue",null)}function Ys(e,t){if(1&e&&(v.Xb(0,"option",27),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e.pool_name),v.Db(1),v.Sc(e.pool_name)}}function Ks(e,t){if(1&e&&(v.Xb(0,"select",20),v.Pc(1,Us,2,1,"option",21),v.Pc(2,js,2,1,"option",21),v.Pc(3,Qs,2,1,"option",21),v.Pc(4,Ys,2,2,"option",22),v.Wb()),2&e){const e=v.nc();v.Db(1),v.uc("ngIf",null===e.pools),v.Db(1),v.uc("ngIf",null!==e.pools&&0===e.pools.length),v.Db(1),v.uc("ngIf",null!==e.pools&&e.pools.length>0),v.Db(1),v.uc("ngForOf",e.pools)}}function Hs(e,t){1&e&&(v.Xb(0,"span",28),v.bc(1,29),v.Wb())}function Js(e,t){1&e&&(v.Xb(0,"span",28),v.bc(1,30),v.Wb())}function Zs(e,t){1&e&&(v.Xb(0,"span",28),v.bc(1,31),v.Wb())}let en=(()=>{class e{constructor(e,t,a,i,o,s){this.activeModal=e,this.actionLabels=t,this.authStorageService=a,this.notificationService=i,this.poolService=o,this.rbdService=s,this.pools=null,this.editing=!1,this.poolPermission=this.authStorageService.getPermissions().pool,this.createForm()}createForm(){this.namespaceForm=new P.a({pool:new o.h(""),namespace:new o.h("")},this.validator(),this.asyncValidator())}validator(){return e=>{const t=e.get("pool"),a=e.get("namespace");let i=null;t.value||(i={required:!0}),t.setErrors(i);let o=null;return a.value||(o={required:!0}),a.setErrors(o),null}}asyncValidator(){return e=>new Promise(t=>{const a=e.get("pool"),i=e.get("namespace");this.rbdService.listNamespaces(a.value).subscribe(e=>{if(e.some(e=>e.namespace===i.value)){const e={namespaceExists:!0};i.setErrors(e),t(e)}else t(null)})})}ngOnInit(){this.onSubmit=new Vo.a,this.poolPermission.read&&this.poolService.list(["pool_name","type","application_metadata"]).then(e=>{const t=[];for(const a of e)this.rbdService.isRBDPool(a)&&"replicated"===a.type&&t.push(a);if(this.pools=t,1===this.pools.length){const e=this.pools[0].pool_name;this.namespaceForm.get("pool").setValue(e)}})}submit(){const e=this.namespaceForm.getValue("pool"),t=this.namespaceForm.getValue("namespace"),a=new T.a;a.name="rbd/namespace/create",a.metadata={pool:e,namespace:t},this.rbdService.createNamespace(e,t).toPromise().then(()=>{this.notificationService.show(dt.a.success,"Created namespace '" + e + "/" + t + "'"),this.activeModal.close(),this.onSubmit.next()}).catch(()=>{this.namespaceForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(c.a),v.Rb(l.b),v.Rb(lt.a),v.Rb(ut.a),v.Rb(pi.a),v.Rb(W))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-namespace-form-modal"]],decls:23,vars:9,consts:function(){let e,t,a,i,o,s,n,c,r;return e="Create Namespace",t="Pool",a="Name",i="Loading...",o="-- No rbd pools available --",s="-- Select a pool --",n="This field is required.",c="This field is required.",r="Namespace already exists.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","namespaceForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","pool",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","namespace",1,"cd-col-form-label","required"],a,["type","text","placeholder","Namespace name...","id","namespace","name","namespace","formControlName","namespace","autofocus","",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],i,o,s,[3,"value"],[1,"invalid-feedback"],n,c,r]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"div",7),v.Xb(8,"label",8),v.bc(9,9),v.Wb(),v.Xb(10,"div",10),v.Pc(11,Gs,1,0,"input",11),v.Pc(12,Ks,5,4,"select",12),v.Pc(13,Hs,2,0,"span",13),v.Wb(),v.Wb(),v.Xb(14,"div",7),v.Xb(15,"label",14),v.bc(16,15),v.Wb(),v.Xb(17,"div",10),v.Sb(18,"input",16),v.Pc(19,Js,2,0,"span",13),v.Pc(20,Zs,2,0,"span",13),v.Wb(),v.Wb(),v.Wb(),v.Xb(21,"div",17),v.Xb(22,"cd-form-button-panel",18),v.lc("submitActionEvent",function(){return t.submit()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.namespaceForm),v.Db(7),v.uc("ngIf",!t.poolPermission.read),v.Db(1),v.uc("ngIf",t.poolPermission.read),v.Db(1),v.uc("ngIf",t.namespaceForm.showError("pool",e,"required")),v.Db(6),v.uc("ngIf",t.namespaceForm.showError("namespace",e,"required")),v.Db(1),v.uc("ngIf",t.namespaceForm.showError("namespace",e,"namespaceExists")),v.Db(2),v.uc("form",t.namespaceForm)("submitText",t.actionLabels.CREATE)}},directives:[E.a,o.B,o.r,o.k,z.a,N.a,i.r,C.a,o.d,V.a,o.q,o.i,ha.a,A.a,o.z,i.q,o.u,o.C],styles:[""]}),e})(),tn=(()=>{class e{constructor(e,t,a,i,o,s){this.authStorageService=e,this.rbdService=t,this.poolService=a,this.modalService=i,this.notificationService=o,this.actionLabels=s,this.selection=new nt.a,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"create",icon:I.a.add,click:()=>this.createModal(),name:this.actionLabels.CREATE},{permission:"delete",icon:I.a.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Pool",prop:"pool",flexGrow:1},{name:"Total images",prop:"num_images",flexGrow:1}],this.refresh()}refresh(){this.poolService.list(["pool_name","type","application_metadata"]).then(e=>{e=e.filter(e=>this.rbdService.isRBDPool(e)&&"replicated"===e.type);const t=[];e.forEach(e=>{t.push(this.rbdService.listNamespaces(e.pool_name))}),t.length>0?Object(p.a)(t).subscribe(t=>{const a=[];for(let i=0;i<t.length;i++){const o=e[i].pool_name;t[i].forEach(e=>{a.push({id:`${o}/${e.namespace}`,pool:o,namespace:e.namespace,num_images:e.num_images})})}this.namespaces=a}):this.namespaces=[]})}updateSelection(e){this.selection=e}createModal(){this.modalRef=this.modalService.show(en),this.modalRef.componentInstance.onSubmit.subscribe(()=>{this.refresh()})}deleteModal(){const e=this.selection.first().pool,t=this.selection.first().namespace;this.modalRef=this.modalService.show(it.a,{itemDescription:"Namespace",itemNames:[`${e}/${t}`],submitAction:()=>this.rbdService.deleteNamespace(e,t).subscribe(()=>{this.notificationService.show(dt.a.success,"Deleted namespace '" + e + "/" + t + "'"),this.modalRef.close(),this.refresh()},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})})}getDeleteDisableDesc(){var e;const t=this.selection.first();return(null==t?void 0:t.num_images)>0?"Namespace contains images":!(null===(e=this.selection)||void 0===e?void 0:e.first())}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(W),v.Rb(pi.a),v.Rb(F.a),v.Rb(ut.a),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-namespace-list"]],features:[v.Cb([bt.a])],decls:4,vars:5,consts:[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(v.Sb(0,"cd-rbd-tabs"),v.Xb(1,"cd-table",0),v.lc("fetchData",function(){return t.refresh()})("updateSelection",function(e){return t.updateSelection(e)}),v.Xb(2,"div",1),v.Sb(3,"cd-table-actions",2),v.Wb(),v.Wb()),2&e&&(v.Db(1),v.uc("data",t.namespaces)("columns",t.columns),v.Db(2),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[To,ot.a,Xt.a],styles:[""]}),e})(),an=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-performance"]],decls:2,vars:1,consts:[["uid","41FrpeUiz","grafanaStyle","two",3,"grafanaPath"]],template:function(e,t){1&e&&(v.Sb(0,"cd-rbd-tabs"),v.Sb(1,"cd-grafana",0)),2&e&&(v.Db(1),v.uc("grafanaPath","rbd-overview?"))},directives:[To,jo.a],styles:[""]}),e})();function on(e,t){1&e&&v.Sb(0,"input",15)}function sn(e,t){if(1&e&&(v.Xb(0,"option",20),v.Rc(1),v.Wb()),2&e){const e=t.$implicit;v.uc("value",e),v.Db(1),v.Sc(e)}}function nn(e,t){if(1&e&&(v.Xb(0,"select",16),v.Xb(1,"option",17),v.bc(2,18),v.Wb(),v.Pc(3,sn,2,2,"option",19),v.Wb()),2&e){const e=v.nc();v.Db(3),v.uc("ngForOf",e.pools)}}let cn=(()=>{class e{constructor(e,t,a,i,o,s,n){this.authStorageService=e,this.rbdService=t,this.activeModal=a,this.actionLabels=i,this.fb=o,this.poolService=s,this.taskWrapper=n,this.poolPermission=this.authStorageService.getPermissions().pool}createForm(){this.purgeForm=this.fb.group({poolName:""})}ngOnInit(){this.poolPermission.read&&this.poolService.list(["pool_name","application_metadata"]).then(e=>{this.pools=e.filter(e=>e.application_metadata.includes("rbd")).map(e=>e.pool_name)}),this.createForm()}purge(){const e=this.purgeForm.getValue("poolName")||"";this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/trash/purge",{pool_name:e}),call:this.rbdService.purgeTrash(e)}).subscribe({error:()=>{this.purgeForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(W),v.Rb(c.a),v.Rb(l.b),v.Rb(_o.a),v.Rb(pi.a),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-trash-purge-modal"]],decls:18,vars:6,consts:function(){let e,t,a,i,o;return e="Purge Trash",t="To purge, select\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "All" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + "\xA0 or one pool and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Purge" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".\xA0",t=v.gc(t),a="Pool:",i="Pool name...",o="All",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","purgeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],[1,"col-form-label","mx-auto"],a,["class","form-control","type","text","placeholder",i,"formControlName","poolName",4,"ngIf"],["id","poolName","name","poolName","class","form-control custom-select","formControlName","poolName",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","placeholder",i,"formControlName","poolName",1,"form-control"],["id","poolName","name","poolName","formControlName","poolName",1,"form-control","custom-select"],["value",""],o,[3,"value",4,"ngFor","ngForOf"],[3,"value"]]},template:function(e,t){1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.hc(8,7),v.Sb(9,"kbd"),v.Sb(10,"kbd"),v.ec(),v.Wb(),v.Xb(11,"div",8),v.Xb(12,"label",9),v.bc(13,10),v.Wb(),v.Pc(14,on,1,0,"input",11),v.Pc(15,nn,4,1,"select",12),v.Wb(),v.Wb(),v.Xb(16,"div",13),v.Xb(17,"cd-form-button-panel",14),v.lc("submitActionEvent",function(){return t.purge()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e&&(v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.purgeForm),v.Db(10),v.uc("ngIf",!t.poolPermission.read),v.Db(1),v.uc("ngIf",t.poolPermission.read),v.Db(2),v.uc("form",t.purgeForm)("submitText",t.actionLabels.PURGE))},directives:[E.a,o.B,o.r,o.k,z.a,N.a,i.r,A.a,C.a,o.d,V.a,o.q,o.i,o.z,o.u,o.C,i.q],styles:[""]}),e})();function rn(e,t){1&e&&(v.Xb(0,"span",15),v.bc(1,16),v.Wb())}let ln=(()=>{class e{constructor(e,t,a,i,o){this.rbdService=e,this.activeModal=t,this.actionLabels=a,this.fb=i,this.taskWrapper=o}ngOnInit(){this.imageSpec=new w.a(this.poolName,this.namespace,this.imageName).toString(),this.restoreForm=this.fb.group({name:this.imageName})}restore(){const e=this.restoreForm.getValue("name"),t=new w.a(this.poolName,this.namespace,this.imageId);this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/trash/restore",{image_id_spec:t.toString(),new_image_name:e}),call:this.rbdService.restoreTrash(t,e)}).subscribe({error:()=>{this.restoreForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(W),v.Rb(c.a),v.Rb(l.b),v.Rb(_o.a),v.Rb(R.a))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-trash-restore-modal"]],decls:18,vars:7,consts:function(){let e,t,a,i;return e="Restore Image",t="To restore\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "" + "\ufffd0\ufffd" + "@" + "\ufffd1\ufffd" + "" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ",\xA0 type the image's new name and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Restore" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".",t=v.gc(t),a="New Name",i="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","restoreForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","name",1,"col-form-label"],a,["type","text","name","name","id","name","autocomplete","off","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],i]},template:function(e,t){if(1&e&&(v.Xb(0,"cd-modal",0),v.Vb(1,1),v.bc(2,2),v.Ub(),v.Vb(3,3),v.Xb(4,"form",4,5),v.Xb(6,"div",6),v.Xb(7,"p"),v.hc(8,7),v.Sb(9,"kbd"),v.Sb(10,"kbd"),v.ec(),v.Wb(),v.Xb(11,"div",8),v.Xb(12,"label",9),v.bc(13,10),v.Wb(),v.Sb(14,"input",11),v.Pc(15,rn,2,0,"span",12),v.Wb(),v.Wb(),v.Xb(16,"div",13),v.Xb(17,"cd-form-button-panel",14),v.lc("submitActionEvent",function(){return t.restore()}),v.Wb(),v.Wb(),v.Wb(),v.Ub(),v.Wb()),2&e){const e=v.Fc(5);v.uc("modalRef",t.activeModal),v.Db(4),v.uc("formGroup",t.restoreForm),v.Db(6),v.fc(t.imageSpec)(t.imageId),v.cc(8),v.Db(5),v.uc("ngIf",t.restoreForm.showError("name",e,"required")),v.Db(2),v.uc("form",t.restoreForm)("submitText",t.actionLabels.RESTORE)}},directives:[E.a,o.B,o.r,o.k,z.a,N.a,C.a,o.d,V.a,o.q,o.i,ha.a,i.r,A.a],styles:[""]}),e})();const bn=["expiresTpl"],dn=["deleteTpl"],un=function(e){return[e]};function mn(e,t){if(1&e){const e=v.Yb();v.Xb(0,"button",6),v.lc("click",function(){return v.Ic(e),v.nc().purgeModal()}),v.Sb(1,"i",7),v.Vb(2),v.bc(3,8),v.Ub(),v.Wb()}if(2&e){const e=v.nc();v.uc("disabled",e.disablePurgeBtn),v.Db(1),v.uc("ngClass",v.zc(2,un,e.icons.destroy))}}function pn(e,t){1&e&&(v.Vb(0),v.bc(1,10),v.Ub())}function fn(e,t){1&e&&(v.Vb(0),v.bc(1,11),v.Ub())}function hn(e,t){if(1&e&&(v.Pc(0,pn,2,0,"ng-container",9),v.Pc(1,fn,2,0,"ng-container",9),v.Rc(2),v.oc(3,"cdDate")),2&e){const e=t.row,a=t.value;v.uc("ngIf",e.cdIsExpired),v.Db(1),v.uc("ngIf",!e.cdIsExpired),v.Db(1),v.Tc(" ",v.pc(3,3,a),"\n")}}function gn(e,t){if(1&e&&(v.Xb(0,"p",13),v.Xb(1,"strong"),v.Vb(2),v.bc(3,14),v.oc(4,"cdDate"),v.Ub(),v.Wb(),v.Wb()),2&e){const e=v.nc().expiresAt;v.Db(4),v.fc(v.pc(4,1,e)),v.cc(3)}}function vn(e,t){1&e&&v.Pc(0,gn,5,3,"p",12),2&e&&v.uc("ngIf",!t.isExpired)}let Sn=(()=>{class e{constructor(e,t,a,i,o,s,n){this.authStorageService=e,this.rbdService=t,this.modalService=a,this.cdDatePipe=i,this.taskListService=o,this.taskWrapper=s,this.actionLabels=n,this.icons=I.a,this.executingTasks=[],this.selection=new nt.a,this.tableStatus=new Fa.a,this.disablePurgeBtn=!0,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"update",icon:I.a.undo,click:()=>this.restoreModal(),name:this.actionLabels.RESTORE},{permission:"delete",icon:I.a.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"ID",prop:"id",flexGrow:1,cellTransformation:st.a.executing},{name:"Name",prop:"name",flexGrow:1},{name:"Pool",prop:"pool_name",flexGrow:1},{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Status",prop:"deferment_end_time",flexGrow:1,cellTemplate:this.expiresTpl},{name:"Deleted At",prop:"deletion_time",flexGrow:1,pipe:this.cdDatePipe}],this.taskListService.init(()=>this.rbdService.listTrash(),e=>this.prepareResponse(e),e=>this.images=e,()=>this.onFetchError(),e=>["rbd/trash/remove","rbd/trash/restore"].includes(e.name),(e,t)=>new w.a(e.pool_name,e.namespace,e.id).toString()===t.metadata.image_id_spec,void 0)}prepareResponse(e){let t=[];const a={};let i;if(e.forEach(e=>{m.a.isUndefined(a[e.status])&&(a[e.status]=[]),a[e.status].push(e.pool_name),t=t.concat(e.value),this.disablePurgeBtn=!t.length}),a[3]?i=3:a[1]?i=1:a[2]&&(i=2),i){const e=(a[i].length>1?"pools ":"pool ")+a[i].join();this.tableStatus=new Fa.a(i,e)}else this.tableStatus=new Fa.a;return t.forEach(e=>{e.cdIsExpired=wo()().isAfter(e.deferment_end_time)}),t}onFetchError(){this.table.reset(),this.tableStatus=new Fa.a(vo.a.ValueException)}updateSelection(e){this.selection=e}restoreModal(){const e={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,imageId:this.selection.first().id};this.modalRef=this.modalService.show(ln,e)}deleteModal(){const e=this.selection.first().pool_name,t=this.selection.first().namespace,a=this.selection.first().id,i=this.selection.first().deferment_end_time,o=wo()().isAfter(i),s=new w.a(e,t,a);this.modalRef=this.modalService.show(it.a,{itemDescription:"RBD",itemNames:[s],bodyTemplate:this.deleteTpl,bodyContext:{expiresAt:i,isExpired:o},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new T.a("rbd/trash/remove",{image_id_spec:s.toString()}),call:this.rbdService.removeTrash(s,!0)})})}purgeModal(){this.modalService.show(cn)}}return e.\u0275fac=function(t){return new(t||e)(v.Rb(lt.a),v.Rb(W),v.Rb(F.a),v.Rb(zo.a),v.Rb(bt.a),v.Rb(R.a),v.Rb(l.b))},e.\u0275cmp=v.Lb({type:e,selectors:[["cd-rbd-trash-list"]],viewQuery:function(e,t){if(1&e&&(v.Wc(ot.a,3),v.Wc(bn,3),v.Wc(dn,3)),2&e){let e;v.Ec(e=v.mc())&&(t.table=e.first),v.Ec(e=v.mc())&&(t.expiresTpl=e.first),v.Ec(e=v.mc())&&(t.deleteTpl=e.first)}},features:[v.Cb([bt.a])],decls:9,vars:8,consts:function(){let e,t,a,i;return e="Purge Trash",t="Expired at",a="Protected until",i="This image is protected until " + "\ufffd0\ufffd" + ".",[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","status","autoReload","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["class","btn btn-light","type","button",3,"disabled","click",4,"ngIf"],["expiresTpl",""],["deleteTpl",""],["type","button",1,"btn","btn-light",3,"disabled","click"],["aria-hidden","true",3,"ngClass"],e,[4,"ngIf"],t,a,["class","text-danger",4,"ngIf"],[1,"text-danger"],i]},template:function(e,t){1&e&&(v.Sb(0,"cd-rbd-tabs"),v.Xb(1,"cd-table",0),v.lc("fetchData",function(){return t.taskListService.fetch()})("updateSelection",function(e){return t.updateSelection(e)}),v.Xb(2,"div",1),v.Sb(3,"cd-table-actions",2),v.Pc(4,mn,4,4,"button",3),v.Wb(),v.Wb(),v.Pc(5,hn,4,5,"ng-template",null,4,v.Qc),v.Pc(7,vn,1,1,"ng-template",null,5,v.Qc)),2&e&&(v.Db(1),v.uc("data",t.images)("columns",t.columns)("status",t.tableStatus)("autoReload",-1),v.Db(2),v.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),v.Db(1),v.uc("ngIf",t.permission.delete))},directives:[To,ot.a,Xt.a,i.r,C.a,i.p],pipes:[zo.a],styles:[""]}),e})(),Dn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=v.Pb({type:e}),e.\u0275inj=v.Ob({imports:[[i.c,ca,o.m,o.x,c.t,c.y,c.F,r.a,d.a,s.i,n.c]]}),e})();const wn=[{path:"",redirectTo:"rbd",pathMatch:"full"},{path:"rbd",canActivate:[b.a],data:{breadcrumbs:"Images"},children:[{path:"",component:Ls},{path:"namespaces",component:tn,data:{breadcrumbs:"Namespaces"}},{path:"trash",component:Sn,data:{breadcrumbs:"Trash"}},{path:"performance",component:an,data:{breadcrumbs:"Overall Performance"}},{path:l.e.CREATE,component:ho,data:{breadcrumbs:l.a.CREATE}},{path:`${l.e.EDIT}/:image_spec`,component:ho,data:{breadcrumbs:l.a.EDIT}},{path:`${l.e.CLONE}/:image_spec/:snap`,component:ho,data:{breadcrumbs:l.a.CLONE}},{path:`${l.e.COPY}/:image_spec`,component:ho,data:{breadcrumbs:l.a.COPY}},{path:`${l.e.COPY}/:image_spec/:snap`,component:ho,data:{breadcrumbs:l.a.COPY}}]},{path:"mirroring",component:bi,canActivate:[b.a],data:{breadcrumbs:"Mirroring"}},{path:"iscsi",canActivate:[b.a],data:{breadcrumbs:"iSCSI"},children:[{path:"",redirectTo:"overview",pathMatch:"full"},{path:"overview",component:na,data:{breadcrumbs:"Overview"}},{path:"targets",data:{breadcrumbs:"Targets"},children:[{path:"",component:Lt},{path:l.e.CREATE,component:tt,data:{breadcrumbs:l.a.CREATE}},{path:`${l.e.EDIT}/:target_iqn`,component:tt,data:{breadcrumbs:l.a.EDIT}}]}]}];let _n=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=v.Pb({type:e}),e.\u0275inj=v.Ob({imports:[[Dn,s.i.forChild(wn)]]}),e})()},rFfW:function(e,t,a){"use strict";a.d(t,"a",function(){return F});var i=a("8Y7J"),o=a("s7LF"),s=a("LvDl"),n=a.n(s),c=a("jtHE"),r=a("oxzT"),l=a("QFaf"),b=a("PhyI"),d=a("aXbf"),u=a("o8EM"),m=a("NwgZ"),p=a("SVse"),f=a("ocLN"),h=a("p4Cf"),g=a("ANnk"),v=a("f69J");let S=(()=>{class e{constructor(e,t){this.control=e,this.formatter=t}setValue(e){const t=this.formatter.toMilliseconds(e);this.control.control.setValue(`${t} ms`)}ngOnInit(){this.setValue(this.control.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.control.value))}onUpdate(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(o.p),i.Rb(d.a))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdMilliseconds",""]],hostBindings:function(e,t){1&e&&i.lc("blur",function(e){return t.onUpdate(e.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),e})();var D=a("IzCI");let w=(()=>{class e{constructor(e,t,a,o){this.elementRef=e,this.control=t,this.dimlessBinaryPerSecondPipe=a,this.formatter=o,this.ngModelChange=new i.p,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.el.value))}setValue(e){/^[\d.]+$/.test(e)&&(e+=this.defaultUnit||"m");const t=this.formatter.toBytes(e,0),a=this.round(t);this.el.value=this.dimlessBinaryPerSecondPipe.transform(a),null!==t?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(e){if(null!==e&&0!==e){if(!n.a.isUndefined(this.minBytes)&&e<this.minBytes)return this.minBytes;if(!n.a.isUndefined(this.maxBytes)&&e>this.maxBytes)return this.maxBytes;if(!n.a.isUndefined(this.roundPower)){const t=Math.round(Math.log(e)/Math.log(this.roundPower));return Math.pow(this.roundPower,t)}}return e}onBlur(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(o.p),i.Rb(D.a),i.Rb(d.a))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdDimlessBinaryPerSecond",""]],hostBindings:function(e,t){1&e&&i.lc("blur",function(e){return t.onBlur(e.target.value)})},inputs:{ngDataReady:"ngDataReady",minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),e})(),_=(()=>{class e{constructor(e,t){this.formatter=e,this.ngControl=t}setValue(e){const t=this.formatter.toIops(e);this.ngControl.control.setValue(`${t} IOPS`)}ngOnInit(){this.setValue(this.ngControl.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.ngControl.value))}onUpdate(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(d.a),i.Rb(o.p))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdIops",""]],hostBindings:function(e,t){1&e&&i.lc("blur",function(e){return t.onUpdate(e.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),e})();function W(e,t){if(1&e&&(i.Vb(0),i.Sb(1,"input",18),i.Ub()),2&e){const e=i.nc().$implicit,t=i.nc(2);i.Db(1),i.uc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function y(e,t){if(1&e&&(i.Vb(0),i.Sb(1,"input",19),i.Ub()),2&e){const e=i.nc().$implicit,t=i.nc(2);i.Db(1),i.uc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function X(e,t){if(1&e&&(i.Vb(0),i.Sb(1,"input",20),i.Ub()),2&e){const e=i.nc().$implicit,t=i.nc(2);i.Db(1),i.uc("id",e.name)("name",e.name)("formControlName",e.name)("ngDataReady",t.ngDataReady)}}function I(e,t){1&e&&(i.Xb(0,"span",21),i.bc(1,22),i.Wb())}const k=function(e){return{active:e}},P=function(e){return[e]};function $(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",10),i.Xb(1,"label",11),i.Rc(2),i.Xb(3,"cd-helper"),i.Rc(4),i.Wb(),i.Wb(),i.Xb(5,"div"),i.Xb(6,"div",12),i.Vb(7,13),i.Pc(8,W,2,4,"ng-container",14),i.Pc(9,y,2,4,"ng-container",14),i.Pc(10,X,2,4,"ng-container",14),i.Ub(),i.Xb(11,"span",15),i.Xb(12,"button",16),i.lc("click",function(){i.Ic(e);const a=t.$implicit;return i.nc(2).reset(a.name)}),i.Sb(13,"i",7),i.Wb(),i.Wb(),i.Wb(),i.Pc(14,I,2,0,"span",17),i.Wb(),i.Wb()}if(2&e){const e=t.$implicit,a=i.nc().$implicit,o=i.nc(),s=i.Fc(1);i.Db(1),i.uc("for",e.name),i.Db(1),i.Sc(e.displayName),i.Db(2),i.Sc(e.description),i.Db(1),i.Gb("cd-col-form-input ",a.heading,""),i.Db(2),i.uc("ngSwitch",e.type),i.Db(1),i.uc("ngSwitchCase",o.configurationType.milliseconds),i.Db(1),i.uc("ngSwitchCase",o.configurationType.bps),i.Db(1),i.uc("ngSwitchCase",o.configurationType.iops),i.Db(2),i.uc("ngClass",i.zc(13,k,o.isDisabled(e.name))),i.Db(1),i.uc("ngClass",i.zc(15,P,o.icons.erase)),i.Db(1),i.uc("ngIf",o.form.showError("configuration."+e.name,s,"min"))}}function T(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",4),i.Xb(1,"h4",5),i.Xb(2,"span",6),i.lc("click",function(){i.Ic(e);const a=t.$implicit;return i.nc().toggleSectionVisibility(a.class)}),i.Rc(3),i.Sb(4,"i",7),i.Wb(),i.Wb(),i.Xb(5,"div",8),i.Pc(6,$,15,17,"div",9),i.Wb(),i.Wb()}if(2&e){const e=t.$implicit,a=i.nc();i.Db(3),i.Tc(" ",e.heading," "),i.Db(1),i.uc("ngClass",a.sectionVisibility[e.class]?a.icons.minusCircle:a.icons.addCircle),i.Db(1),i.Fb(e.class),i.uc("hidden",!a.sectionVisibility[e.class]),i.Db(1),i.uc("ngForOf",e.options)}}let F=(()=>{class e{constructor(e,t){this.formatterService=e,this.rbdConfigurationService=t,this.initializeData=new c.a(1),this.changes=new i.p,this.icons=r.a,this.ngDataReady=new i.p,this.configurationType=b.b,this.sectionVisibility={}}ngOnInit(){const e=this.createConfigurationFormGroup();this.form.addControl("configuration",e),e.valueChanges.subscribe(()=>{this.changes.emit(this.getDirtyValues.bind(this))}),this.initializeData&&this.initializeData.subscribe(e=>{this.initialData=e.initialData;const t=e.sourceType;this.rbdConfigurationService.getWritableOptionFields().forEach(a=>{const i=e.initialData.filter(e=>e.name===a.name).pop();i&&i.source===t&&this.form.get(`configuration.${a.name}`).setValue(i.value)}),this.ngDataReady.emit()}),this.rbdConfigurationService.getWritableSections().forEach(e=>this.sectionVisibility[e.class]=!1)}getDirtyValues(e=!1,t){if(e&&!t)throw new Error("ProgrammingError: If local values shall be included, a proper localFieldType argument has to be provided, too");const a={};return this.rbdConfigurationService.getWritableOptionFields().forEach(i=>{const o=this.form.get("configuration").get(i.name);this.initialData&&this.initialData[i.name]===o.value||(o.dirty||e&&o.source===t)&&(a[i.name]=null===o.value?o.value:i.type===b.b.bps?this.formatterService.toBytes(o.value):i.type===b.b.milliseconds?this.formatterService.toMilliseconds(o.value):i.type===b.b.iops?this.formatterService.toIops(o.value):o.value)}),a}createConfigurationFormGroup(){const e=new l.a({});return this.rbdConfigurationService.getWritableOptionFields().forEach(t=>{let a;if(t.type!==b.b.milliseconds&&t.type!==b.b.iops&&t.type!==b.b.bps)throw new Error(`Type ${t.type} is unknown, you may need to add it to RbdConfiguration class`);{let e=0;n.a.forEach(this.initialData,a=>{a.name===t.name&&(e=a.value)}),a=new o.h(e,o.A.min(0))}e.addControl(t.name,a)}),e}reset(e){const t=this.form.get("configuration").get(e);t.disabled?(t.setValue(t.previousValue||0),t.enable(),t.previousValue||t.markAsPristine()):(t.previousValue=t.value,t.setValue(null),t.markAsDirty(),t.disable())}isDisabled(e){return this.form.get("configuration").get(e).disabled}toggleSectionVisibility(e){this.sectionVisibility[e]=!this.sectionVisibility[e]}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(d.a),i.Rb(u.a))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-rbd-configuration-form"]],inputs:{form:"form",initializeData:"initializeData"},outputs:{changes:"changes"},decls:5,vars:2,consts:function(){let e,t,a;return e="RBD Configuration",t="Remove the local configuration value. The parent configuration value will be inherited and used instead.",a="The minimum value is 0",[[3,"formGroup"],["cfgFormGroup",""],e,["class","col-12",4,"ngFor","ngForOf"],[1,"col-12"],[1,"cd-header"],[1,"collapsible",3,"click"],["aria-hidden","true",3,"ngClass"],[3,"hidden"],["class","form-group row",4,"ngFor","ngForOf"],[1,"form-group","row"],[1,"cd-col-form-label",3,"for"],[1,"input-group"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"input-group-append"],["type","button","data-toggle","button","title",t,1,"btn","btn-light",3,"ngClass","click"],["class","invalid-feedback",4,"ngIf"],["type","text","cdMilliseconds","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","defaultUnit","b","cdDimlessBinaryPerSecond","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","cdIops","",1,"form-control",3,"id","name","formControlName","ngDataReady"],[1,"invalid-feedback"],a]},template:function(e,t){1&e&&(i.Xb(0,"fieldset",0,1),i.Xb(2,"legend"),i.bc(3,2),i.Wb(),i.Pc(4,T,7,7,"div",3),i.Wb()),2&e&&(i.uc("formGroup",t.form.get("configuration")),i.Db(4),i.uc("ngForOf",t.rbdConfigurationService.sections))},directives:[o.r,o.k,m.a,p.q,p.p,f.a,h.a,p.t,p.u,g.a,p.r,o.d,v.a,S,o.q,o.i,w,_],styles:[".collapsible[_ngcontent-%COMP%]{cursor:pointer;user-select:none}"]}),e})()}}]);
\ No newline at end of file
index fee0b2df55b45b7a1b062d638c1e08db8c0e0ecd..780e8c65be7984219369d46f7bc7517608d3d91d 100644 (file)
@@ -66,6 +66,211 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
 
+@juggle/resize-observer
+Apache-2.0
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2019 JUGGLE LTD
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
 @ng-bootstrap/ng-bootstrap
 MIT
 The MIT License (MIT)
@@ -142,6 +347,56 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 
 
+balanced-match
+MIT
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+brace-expansion
+MIT
+MIT License
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
 can-use-dom
 MIT
 The MIT License (MIT)
@@ -181,6 +436,28 @@ The above copyright notice and this permission notice shall be included in all c
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
+concat-map
+MIT
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
 core-js
 MIT
 Copyright (c) 2014-2021 Denis Pushkarev
@@ -204,30 +481,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 
 
-css-loader
-MIT
-Copyright JS Foundation and other contributors
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
 detect-browser
 MIT
 The MIT License (MIT)
@@ -676,31 +929,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 
 
-resize-observer-polyfill
-MIT
-The MIT License (MIT)
-
-Copyright (c) 2016 Denis Rul
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-
 rxjs
 Apache-2.0
                                Apache License
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.0a363eda73eafe0c0332.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.0a363eda73eafe0c0332.js
deleted file mode 100644 (file)
index 5c8c75c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"5azF":function(e,t,i){"use strict";i.r(t),i.d(t,"PoolModule",(function(){return ta})),i.d(t,"RoutedPoolModule",(function(){return aa}));var a=i("SVse"),o=i("s7LF"),s=i("iInd"),c=i("G0yt"),n=i("sne2"),l=i("PCNd"),r=i("k/xb"),b=i("kJI8"),d=i("LvDl"),u=i.n(d),f=i("jtHE"),p=i("WE5d"),h=i("st4c"),m=i("8Y7J"),g=i("IheW");let S=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/erasure_code_profile",this.formTooltips={k:"Each object is split in data-chunks parts, each stored on a different OSD.",m:"Compute coding chunks for each object and store them on different OSDs.\n      The number of coding chunks is also the number of OSDs that can be down without losing data.",plugins:{jerasure:{description:"The jerasure plugin is the most generic and flexible plugin,\n          it is also the default for Ceph erasure coded pools.",technique:"The more flexible technique is reed_sol_van : it is enough to set k\n          and m. The cauchy_good technique can be faster but you need to chose the packetsize\n          carefully. All of reed_sol_r6_op, liberation, blaum_roth, liber8tion are RAID6 equivalents\n          in the sense that they can only be configured with m=2.",packetSize:"The encoding will be done on packets of bytes size at a time.\n          Choosing the right packet size is difficult.\n          The jerasure documentation contains extensive information on this topic."},lrc:{description:"With the jerasure plugin, when an erasure coded object is stored on\n          multiple OSDs, recovering from the loss of one OSD requires reading from all the others.\n          For instance if jerasure is configured with k=8 and m=4, losing one OSD requires reading\n          from the eleven others to repair.\n\n          The lrc erasure code plugin creates local parity chunks to be able to recover using\n          less OSDs. For instance if lrc is configured with k=8, m=4 and l=4, it will create\n          an additional parity chunk for every four OSDs. When a single OSD is lost, it can be\n          recovered with only four OSDs instead of eleven.",l:"Group the coding and data chunks into sets of size locality. For instance,\n          for k=4 and m=2, when locality=3 two groups of three are created. Each set can\n          be recovered without reading chunks from another set.",crushLocality:"The type of the crush bucket in which each set of chunks defined\n          by l will be stored. For instance, if it is set to rack, each group of l chunks will be\n          placed in a different rack. It is used to create a CRUSH rule step such as step choose\n          rack. If it is not set, no such grouping is done."},isa:{description:"The isa plugin encapsulates the ISA library. It only runs on Intel processors.",technique:"The ISA plugin comes in two Reed Solomon forms.\n          If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy."},shec:{description:"The shec plugin encapsulates the multiple SHEC library.\n          It allows ceph to recover data more efficiently than Reed Solomon codes.",c:"The number of parity chunks each of which includes each data chunk in its\n          calculation range. The number is used as a durability estimator. For instance, if c=2,\n          2 OSDs can be down without losing data."},clay:{description:"CLAY (short for coupled-layer) codes are erasure codes designed to\n          bring about significant savings in terms of network bandwidth and disk IO when a failed\n          node/OSD/rack is being repaired.",d:"Number of OSDs requested to send data during recovery of a single chunk.\n          d needs to be chosen such that k+1 <= d <= k+m-1. The larger the d, the better\n          the savings.",scalar_mds:"scalar_mds specifies the plugin that is used as a building block\n          in the layered construction. It can be one of jerasure, isa, shec.",technique:"technique specifies the technique that will be picked\n          within the 'scalar_mds' plugin specified. Supported techniques\n          are 'reed_sol_van', 'reed_sol_r6_op', 'cauchy_orig',\n          'cauchy_good', 'liber8tion' for jerasure, 'reed_sol_van',\n          'cauchy' for isa and 'single', 'multiple' for shec."}},crushRoot:"The name of the crush bucket used for the first step of the CRUSH rule.\n      For instance step take default.",crushFailureDomain:"Ensure that no two chunks are in a bucket with the same failure\n      domain. For instance, if the failure domain is host no two chunks will be stored on the same\n      host. It is used to create a CRUSH rule step such as step chooseleaf host.",crushDeviceClass:"Restrict placement to devices of a specific class\n      (e.g., ssd or hdd), using the crush device class names in the CRUSH map.",directory:"Set the directory name from which the erasure code plugin is loaded."}}list(){return this.http.get(this.apiPath)}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(m.dc(g.b))},e.\u0275prov=m.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var R=i("Ekvf");class v{constructor(){this.nodes=[],this.idTree={},this.allDevices=[],this.buckets=[],this.failureDomains={},this.failureDomainKeys=[],this.devices=[],this.deviceCount=0}static searchFailureDomains(e,t){return this.getFailureDomains(this.search(e,t))}static search(e,t){const[i,a]=t.split("~"),o=e.find(e=>["name","id","type"].some(t=>e[t]===i));return o?(e=this.getSubNodes(o,this.createIdTreeFromNodes(e)),a&&(e=this.filterNodesByDeviceType(e,a)),e):[]}static createIdTreeFromNodes(e){const t={};return e.forEach(e=>{t[e.id]=e}),t}static getSubNodes(e,t){let i=[e];return e.children?(e.children.forEach(e=>{i=i.concat(this.getSubNodes(t[e],t))}),i):i}static filterNodesByDeviceType(e,t){let i,a=e.filter(e=>e.device_class&&e.device_class!==t).map(e=>e.id),o=a;do{i=!1,e=e.filter(e=>!a.includes(e.id));const t=[];e.forEach(e=>{e.children&&e.children.every(e=>a.includes(e))&&(t.push(e.id),i=!0)}),i&&(a=t,o=o.concat(t))}while(i);return(e=u.a.cloneDeep(e)).map(e=>e.children?(e.children=e.children.filter(e=>!o.includes(e)),e):e)}static getFailureDomains(e){const t={};return e.forEach(e=>{const i=e.type;t[i]||(t[i]=[]),t[i].push(e)}),t}initCrushNodeSelection(e,t,i,a){this.nodes=e,this.idTree=v.createIdTreeFromNodes(e),e.forEach(e=>{this.idTree[e.id]=e}),this.buckets=u.a.sortBy(e.filter(e=>e.children),"name"),this.controls={root:t,failure:i,device:a},this.preSelectRoot(),this.controls.root.valueChanges.subscribe(()=>this.onRootChange()),this.controls.failure.valueChanges.subscribe(()=>this.onFailureDomainChange()),this.controls.device.valueChanges.subscribe(()=>this.onDeviceChange())}preSelectRoot(){const e=this.nodes.find(e=>"root"===e.type);this.silentSet(this.controls.root,e),this.onRootChange()}silentSet(e,t){e.setValue(t,{emitEvent:!1})}onRootChange(){const e=v.getSubNodes(this.controls.root.value,this.idTree),t=v.getFailureDomains(e);Object.keys(t).forEach(e=>{t[e].length<=1&&delete t[e]}),this.failureDomains=t,this.failureDomainKeys=Object.keys(t).sort(),this.updateFailureDomain()}updateFailureDomain(){let e=this.getIncludedCustomValue(this.controls.failure,Object.keys(this.failureDomains));""===e&&(e=this.setMostCommonDomain(this.controls.failure)),this.updateDevices(e)}getIncludedCustomValue(e,t){return e.dirty&&t.includes(e.value)?e.value:""}setMostCommonDomain(e){let t={n:0,type:""};return Object.keys(this.failureDomains).forEach(e=>{const i=this.failureDomains[e].length;t.n<i&&(t={n:i,type:e})}),this.silentSet(e,t.type),t.type}onFailureDomainChange(){this.updateDevices()}updateDevices(e=this.controls.failure.value){const t=u.a.flatten(this.failureDomains[e].map(e=>v.getSubNodes(e,this.idTree)));this.allDevices=t.filter(e=>e.device_class).map(e=>e.device_class),this.devices=u.a.uniq(this.allDevices).sort();const i=1===this.devices.length?this.devices[0]:this.getIncludedCustomValue(this.controls.device,this.devices);this.silentSet(this.controls.device,i),this.onDeviceChange(i)}onDeviceChange(e=this.controls.device.value){this.deviceCount=""===e?this.allDevices.length:this.allDevices.filter(t=>t===e).length}}var y=i("0+/T"),z=i("a96k"),C=i("oxzT"),I=i("spCT"),N=i("QFaf"),_=i("1Ni5"),M=i("PhyI"),T=i("kvvV"),w=i("Fgil"),$=i("aexS"),D=i("aXbf"),E=i("JK/P"),k=i("kn/O"),P=i("2EZI"),x=i("ajRT"),A=i("NwgZ"),O=i("ocLN"),V=i("ANnk"),W=i("f69J"),F=i("IZUe"),L=i("p4Cf"),q=i("6+kj"),B=i("8xTl");function U(e,t){1&e&&(m.Sb(0,"span",30),m.Wb(1,31),m.Rb())}function G(e,t){1&e&&(m.Sb(0,"span",30),m.Wb(1,32),m.Rb())}function j(e,t){1&e&&(m.Sb(0,"span",30),m.Wb(1,33),m.Rb())}function Q(e,t){1&e&&(m.Sb(0,"option",26),m.Wb(1,34),m.Rb())}function J(e,t){if(1&e&&(m.Sb(0,"option",35),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e.name," ")}}function K(e,t){1&e&&(m.Sb(0,"span",30),m.Wb(1,36),m.Rb())}function Y(e,t){1&e&&(m.Sb(0,"option",26),m.Wb(1,37),m.Rb())}function X(e,t){if(1&e&&(m.Sb(0,"option",35),m.Oc(1),m.Rb()),2&e){const e=t.$implicit,i=m.ic();m.pc("ngValue",e),m.yb(1),m.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function H(e,t){1&e&&(m.Sb(0,"span",30),m.Wb(1,38),m.Rb())}function Z(e,t){if(1&e&&(m.Sb(0,"option",35),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e," ")}}let ee=(()=>{class e extends v{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.crushRuleService=a,this.actionLabels=o,this.submitAction=new m.o,this.tooltips=this.crushRuleService.formTooltips,this.action=this.actionLabels.CREATE,this.resource="Crush Rule",this.createForm()}createForm(){this.form=this.formBuilder.group({name:["",[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),_.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],root:null,failure_domain:"",device_class:""})}ngOnInit(){this.crushRuleService.getInfo().subscribe(({names:e,nodes:t})=>{this.initCrushNodeSelection(t,this.form.get("root"),this.form.get("failure_domain"),this.form.get("device_class")),this.names=e})}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=u.a.cloneDeep(this.form.value);e.root=e.root.name,""===e.device_class&&delete e.device_class,this.taskWrapper.wrapTaskAroundCall({task:new T.a("crushRule/create",e),call:this.crushRuleService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(P.a),m.Mb(c.a),m.Mb(k.a),m.Mb(h.a),m.Mb(n.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-crush-rule-form-modal"]],outputs:{submitAction:"submitAction"},features:[m.vb],decls:55,vars:27,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],"Name",[1,"required"],[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","root",1,"cd-col-form-label"],"Root",[3,"html"],["id","root","name","root","formControlName","root",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","failure_domain",1,"cd-col-form-label"],"Failure domain type",["id","failure_domain","name","failure_domain","formControlName","failure_domain",1,"form-control","custom-select"],["for","device_class",1,"cd-col-form-label"],"Device class",["id","device_class","name","device_class","formControlName","device_class",1,"form-control","custom-select"],["ngValue",""],"Let Ceph decide",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The name can only consist of alphanumeric characters, dashes and underscores.","The chosen erasure code profile name is already in use.","Loading...",[3,"ngValue"],"This field is required!","Loading...","This field is required!"]},template:function(e,t){if(1&e&&(m.Sb(0,"cd-modal",0),m.Qb(1,1),m.Wb(2,2),m.jc(3,"titlecase"),m.jc(4,"upperFirst"),m.Pb(),m.Qb(5,3),m.Sb(6,"form",4,5),m.Sb(8,"div",6),m.Sb(9,"div",7),m.Sb(10,"label",8),m.Qb(11),m.Wb(12,9),m.Pb(),m.Nb(13,"span",10),m.Rb(),m.Sb(14,"div",11),m.Nb(15,"input",12),m.Mc(16,U,2,0,"span",13),m.Mc(17,G,2,0,"span",13),m.Mc(18,j,2,0,"span",13),m.Rb(),m.Rb(),m.Sb(19,"div",7),m.Sb(20,"label",14),m.Qb(21),m.Wb(22,15),m.Pb(),m.Nb(23,"cd-helper",16),m.Nb(24,"span",10),m.Rb(),m.Sb(25,"div",11),m.Sb(26,"select",17),m.Mc(27,Q,2,0,"option",18),m.Mc(28,J,2,2,"option",19),m.Rb(),m.Mc(29,K,2,0,"span",13),m.Rb(),m.Rb(),m.Sb(30,"div",7),m.Sb(31,"label",20),m.Qb(32),m.Wb(33,21),m.Pb(),m.Nb(34,"cd-helper",16),m.Nb(35,"span",10),m.Rb(),m.Sb(36,"div",11),m.Sb(37,"select",22),m.Mc(38,Y,2,0,"option",18),m.Mc(39,X,2,3,"option",19),m.Rb(),m.Mc(40,H,2,0,"span",13),m.Rb(),m.Rb(),m.Sb(41,"div",7),m.Sb(42,"label",23),m.Qb(43),m.Wb(44,24),m.Pb(),m.Nb(45,"cd-helper",16),m.Rb(),m.Sb(46,"div",11),m.Sb(47,"select",25),m.Sb(48,"option",26),m.Wb(49,27),m.Rb(),m.Mc(50,Z,2,2,"option",19),m.Rb(),m.Rb(),m.Rb(),m.Rb(),m.Sb(51,"div",28),m.Sb(52,"cd-form-button-panel",29),m.gc("submitActionEvent",(function(){return t.onSubmit()})),m.jc(53,"titlecase"),m.jc(54,"upperFirst"),m.Rb(),m.Rb(),m.Rb(),m.Pb(),m.Rb()),2&e){const e=m.Ac(7);m.pc("modalRef",t.activeModal),m.yb(4),m.ac(m.kc(3,19,t.action))(m.kc(4,21,t.resource)),m.Xb(2),m.yb(2),m.pc("formGroup",t.form),m.yb(10),m.pc("ngIf",t.form.showError("name",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"pattern")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"uniqueName")),m.yb(5),m.pc("html",t.tooltips.root),m.yb(4),m.pc("ngIf",!t.buckets),m.yb(1),m.pc("ngForOf",t.buckets),m.yb(1),m.pc("ngIf",t.form.showError("root",e,"required")),m.yb(5),m.pc("html",t.tooltips.failure_domain),m.yb(4),m.pc("ngIf",!t.failureDomains),m.yb(1),m.pc("ngForOf",t.failureDomainKeys),m.yb(1),m.pc("ngIf",t.form.showError("failure_domain",e,"required")),m.yb(5),m.pc("html",t.tooltips.device_class),m.yb(5),m.pc("ngForOf",t.devices),m.yb(2),m.pc("form",t.form)("submitText",m.kc(53,23,t.action)+" "+m.kc(54,25,t.resource))}},directives:[x.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,L.a,o.z,a.q,o.u,o.B,q.a],pipes:[a.A,B.a],styles:[""]}),e})();class te{}function ie(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,47),m.Rb())}function ae(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,48),m.Rb())}function oe(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,49),m.Rb())}function se(e,t){1&e&&(m.Sb(0,"option",37),m.Wb(1,50),m.Rb())}function ce(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e," ")}}function ne(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,52),m.Rb())}function le(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,53),m.Rb())}function re(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,54),m.Rb())}function be(e,t){if(1&e&&(m.Sb(0,"span",46),m.Wb(1,55),m.Rb()),2&e){const e=m.ic();m.yb(1),m.ac(e.deviceCount),m.Xb(1)}}function de(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,56),m.Rb())}function ue(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,57),m.Rb())}function fe(e,t){if(1&e&&(m.Sb(0,"span",39),m.Wb(1,58),m.Rb()),2&e){const e=m.ic();m.yb(1),m.ac(e.lrcMultiK),m.Xb(1)}}function pe(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,59),m.Rb())}function he(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,60),m.Rb())}function me(e,t){if(1&e&&(m.Sb(0,"span",46),m.Wb(1,61),m.Rb()),2&e){const e=m.ic();m.yb(1),m.ac(e.deviceCount),m.Xb(1)}}function ge(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,65),m.Rb())}function Se(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,66),m.Rb())}function Re(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",62),m.Sb(2,"span",14),m.Wb(3,63),m.Rb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Nb(6,"input",64),m.Mc(7,ge,2,0,"span",12),m.Mc(8,Se,2,0,"span",12),m.Rb(),m.Rb()),2&e){const e=m.ic(),t=m.Ac(7);m.yb(4),m.pc("html",e.tooltips.plugins.shec.c),m.yb(3),m.pc("ngIf",e.form.showError("c",t,"min")),m.yb(1),m.pc("ngIf",e.form.showError("c",t,"cGreaterM"))}}function ve(e,t){1&e&&(m.Sb(0,"span",39),m.Wb(1,76),m.Rb())}function ye(e,t){if(1&e&&(m.Sb(0,"span",39),m.Wb(1,77),m.Rb()),2&e){const e=m.ic(3);m.yb(1),m.ac(e.getDMin())(e.getDMax()),m.Xb(1)}}function ze(e,t){if(1&e&&(m.Sb(0,"span",39),m.Wb(1,78),m.Rb()),2&e){const e=m.ic(3);m.yb(1),m.ac(e.getDMax()),m.Xb(1)}}function Ce(e,t){if(1&e&&(m.Qb(0),m.Mc(1,ye,2,2,"span",23),m.Mc(2,ze,2,1,"span",23),m.Pb()),2&e){const e=m.ic(2);m.yb(1),m.pc("ngIf",e.getDMin()<e.getDMax()),m.yb(1),m.pc("ngIf",e.getDMin()===e.getDMax())}}function Ie(e,t){if(1&e&&(m.Sb(0,"span",46),m.Wb(1,79),m.Rb()),2&e){const e=m.ic(2);m.yb(1),m.ac(e.getDMin()),m.Xb(1)}}function Ne(e,t){if(1&e&&(m.Sb(0,"span",46),m.Wb(1,80),m.Rb()),2&e){const e=m.ic(2);m.yb(1),m.ac(e.getDMax()),m.Xb(1)}}function _e(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",7),m.Sb(1,"label",67),m.Sb(2,"span",14),m.Wb(3,68),m.Rb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Sb(6,"div",69),m.Nb(7,"input",70),m.Sb(8,"span",71),m.Sb(9,"button",72),m.Yb(10,73),m.gc("click",(function(){return m.Dc(e),m.ic().toggleDCalc()})),m.Nb(11,"i",74),m.Rb(),m.Rb(),m.Rb(),m.Mc(12,ve,2,0,"span",23),m.Mc(13,Ce,3,2,"ng-container",75),m.Mc(14,Ie,2,1,"span",12),m.Mc(15,Ne,2,1,"span",12),m.Rb(),m.Rb()}if(2&e){const e=m.ic(),t=m.Ac(7);m.yb(4),m.pc("html",e.tooltips.plugins.clay.d),m.yb(7),m.pc("ngClass",e.dCalc?e.icons.unlock:e.icons.lock),m.yb(1),m.pc("ngIf",e.dCalc),m.yb(1),m.pc("ngIf",!e.dCalc),m.yb(1),m.pc("ngIf",e.form.showError("d",t,"dMin")),m.yb(1),m.pc("ngIf",e.form.showError("d",t,"dMax"))}}function Me(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,85),m.Rb())}function Te(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,86),m.Rb())}function we(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,87),m.Rb())}function $e(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",81),m.Sb(2,"span",14),m.Wb(3,82),m.Rb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Nb(6,"input",83),m.Mc(7,Me,2,0,"span",12),m.Mc(8,Te,2,0,"span",12),m.Mc(9,we,2,0,"span",12),m.Sb(10,"span",39),m.Wb(11,84),m.Rb(),m.Rb(),m.Rb()),2&e){const e=m.ic(),t=m.Ac(7);m.yb(4),m.pc("html",e.tooltips.plugins.lrc.l),m.yb(3),m.pc("ngIf",e.form.showError("l",t,"required")),m.yb(1),m.pc("ngIf",e.form.showError("l",t,"min")),m.yb(1),m.pc("ngIf",e.form.showError("l",t,"unequal")),m.yb(2),m.ac(e.lrcGroups),m.Xb(11)}}function De(e,t){1&e&&(m.Sb(0,"option",37),m.Wb(1,88),m.Rb())}function Ee(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit,i=m.ic();m.pc("ngValue",e),m.yb(1),m.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function ke(e,t){1&e&&(m.Sb(0,"option",37),m.Wb(1,92),m.Rb())}function Pe(e,t){1&e&&(m.Sb(0,"option",37),m.Wb(1,93),m.Rb())}function xe(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit,i=m.ic(2);m.pc("ngValue",e),m.yb(1),m.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function Ae(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",89),m.Qb(2),m.Wb(3,90),m.Pb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Sb(6,"select",91),m.Mc(7,ke,2,0,"option",18),m.Mc(8,Pe,2,0,"option",18),m.Mc(9,xe,2,3,"option",19),m.Rb(),m.Rb(),m.Rb()),2&e){const e=m.ic();m.yb(4),m.pc("html",e.tooltips.plugins.lrc.crushLocality),m.yb(3),m.pc("ngIf",!e.failureDomains),m.yb(1),m.pc("ngIf",e.failureDomainKeys.length>0),m.yb(1),m.pc("ngForOf",e.failureDomainKeys)}}function Oe(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e," ")}}const Ve=function(e,t,i){return[e,t,i]};function We(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",94),m.Qb(2),m.Wb(3,95),m.Pb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Sb(6,"select",96),m.Mc(7,Oe,2,2,"option",19),m.Rb(),m.Rb(),m.Rb()),2&e){const e=m.ic();m.yb(4),m.pc("html",e.tooltips.plugins.clay.scalar_mds),m.yb(3),m.pc("ngForOf",m.wc(2,Ve,e.PLUGIN.JERASURE,e.PLUGIN.ISA,e.PLUGIN.SHEC))}}function Fe(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e," ")}}function Le(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",97),m.Qb(2),m.Wb(3,98),m.Pb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Sb(6,"select",99),m.Mc(7,Fe,2,2,"option",19),m.Rb(),m.Rb(),m.Rb()),2&e){const e=m.ic();m.yb(4),m.pc("html",e.tooltips.plugins[e.plugin].technique),m.yb(3),m.pc("ngForOf",e.techniques)}}function qe(e,t){1&e&&(m.Sb(0,"span",46),m.Wb(1,103),m.Rb())}function Be(e,t){if(1&e&&(m.Sb(0,"div",7),m.Sb(1,"label",100),m.Qb(2),m.Wb(3,101),m.Pb(),m.Nb(4,"cd-helper",16),m.Rb(),m.Sb(5,"div",10),m.Nb(6,"input",102),m.Mc(7,qe,2,0,"span",12),m.Rb(),m.Rb()),2&e){const e=m.ic(),t=m.Ac(7);m.yb(4),m.pc("html",e.tooltips.plugins.jerasure.packetSize),m.yb(3),m.pc("ngIf",e.form.showError("packetSize",t,"min"))}}function Ue(e,t){1&e&&(m.Sb(0,"option",37),m.Wb(1,104),m.Rb())}function Ge(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e.name," ")}}function je(e,t){if(1&e&&(m.Sb(0,"option",51),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e," ")}}let Qe=(()=>{class e extends v{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.ecpService=a,this.actionLabels=o,this.submitAction=new m.o,this.tooltips=this.ecpService.formTooltips,this.PLUGIN={LRC:"lrc",SHEC:"shec",CLAY:"clay",JERASURE:"jerasure",ISA:"isa"},this.plugin=this.PLUGIN.JERASURE,this.icons=C.a,this.action=this.actionLabels.CREATE,this.resource="EC Profile",this.createForm(),this.setJerasureDefaults()}createForm(){this.form=this.formBuilder.group({name:[null,[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),_.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],plugin:[this.PLUGIN.JERASURE,[o.A.required]],k:[4,[o.A.required,o.A.min(2),_.a.custom("max",()=>this.baseValueValidation(!0)),_.a.custom("unequal",e=>this.lrcDataValidation(e)),_.a.custom("kLowerM",e=>this.shecDataValidation(e))]],m:[2,[o.A.required,o.A.min(1),_.a.custom("max",()=>this.baseValueValidation())]],crushFailureDomain:"",crushRoot:null,crushDeviceClass:"",directory:"",technique:"reed_sol_van",packetSize:[2048,[o.A.min(1)]],l:[3,[o.A.required,o.A.min(1),_.a.custom("unequal",e=>this.lrcLocalityValidation(e))]],crushLocality:"",c:[2,[o.A.required,o.A.min(1),_.a.custom("cGreaterM",e=>this.shecDurabilityValidation(e))]],d:[5,[o.A.required,_.a.custom("dMin",e=>this.dMinValidation(e)),_.a.custom("dMax",e=>this.dMaxValidation(e))]],scalar_mds:[this.PLUGIN.JERASURE,[o.A.required]]}),this.toggleDCalc(),this.form.get("k").valueChanges.subscribe(()=>this.updateValidityOnChange(["m","l","d"])),this.form.get("m").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","l","c","d"])),this.form.get("l").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","m"])),this.form.get("plugin").valueChanges.subscribe(e=>this.onPluginChange(e)),this.form.get("scalar_mds").valueChanges.subscribe(()=>this.setClayDefaultsForScalar())}baseValueValidation(e=!1){return this.validValidation(()=>this.getKMSum()>this.deviceCount&&this.form.getValue("k")>this.form.getValue("m")===e)}validValidation(e,t){return!((!this.form||t)&&this.plugin!==t)&&e()}getKMSum(){return this.form.getValue("k")+this.form.getValue("m")}lrcDataValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m"),i=this.form.getValue("l"),a=e+t;return this.lrcMultiK=e/(a/i),e%(a/i)!=0},"lrc")}shecDataValidation(e){return this.validValidation(()=>this.form.getValue("m")>e,"shec")}lrcLocalityValidation(e){return this.validValidation(()=>{const t=this.getKMSum();return this.lrcGroups=e>0?t/e:0,e>0&&t%e!=0},"lrc")}shecDurabilityValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m");return e>t},"shec")}dMinValidation(e){return this.validValidation(()=>this.getDMin()>e,"clay")}getDMin(){return this.form.getValue("k")+1}dMaxValidation(e){return this.validValidation(()=>e>this.getDMax(),"clay")}getDMax(){const e=this.form.getValue("m");return this.form.getValue("k")+e-1}toggleDCalc(){this.dCalc=!this.dCalc,this.form.get("d")[this.dCalc?"disable":"enable"](),this.calculateD()}calculateD(){this.plugin===this.PLUGIN.CLAY&&this.dCalc&&this.form.silentSet("d",this.getDMax())}updateValidityOnChange(e){e.forEach(e=>{"d"===e&&this.calculateD(),this.form.get(e).updateValueAndValidity({emitEvent:!1})})}onPluginChange(e){this.plugin=e,e===this.PLUGIN.JERASURE?this.setJerasureDefaults():e===this.PLUGIN.LRC?this.setLrcDefaults():e===this.PLUGIN.ISA?this.setIsaDefaults():e===this.PLUGIN.SHEC?this.setShecDefaults():e===this.PLUGIN.CLAY&&this.setClayDefaults(),this.updateValidityOnChange(["m"])}setJerasureDefaults(){this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liberation","blaum_roth","liber8tion"],this.setDefaults({k:4,m:2,technique:"reed_sol_van"})}setLrcDefaults(){this.setDefaults({k:4,m:2,l:3})}setIsaDefaults(){this.techniques=["reed_sol_van","cauchy"],this.setDefaults({k:7,m:3,technique:"reed_sol_van"})}setShecDefaults(){this.setDefaults({k:4,m:3,c:2})}setClayDefaults(){this.setDefaults({k:4,m:2,scalar_mds:this.PLUGIN.JERASURE}),this.setClayDefaultsForScalar()}setClayDefaultsForScalar(){const e=this.form.getValue("scalar_mds");let t="reed_sol_van";e===this.PLUGIN.JERASURE?this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liber8tion"]:e===this.PLUGIN.ISA?this.techniques=["reed_sol_van","cauchy"]:(t="single",this.techniques=["single","multiple"]),this.setDefaults({technique:t})}setDefaults(e){Object.keys(e).forEach(t=>{const i=this.form.get(t),a=i.value;i.pristine||"technique"===t&&!this.techniques.includes(a)||"k"===t&&[4,7].includes(a)||"m"===t&&[2,3].includes(a)?i.setValue(e[t]):i.updateValueAndValidity()})}ngOnInit(){this.ecpService.getInfo().subscribe(({plugins:e,names:t,directory:i,nodes:a})=>{this.initCrushNodeSelection(a,this.form.get("crushRoot"),this.form.get("crushFailureDomain"),this.form.get("crushDeviceClass")),this.plugins=e,this.names=t,this.form.silentSet("directory",i),this.preValidateNumericInputFields()})}preValidateNumericInputFields(){const e=["k","m","l","c","d"].map(e=>this.form.get(e));e.forEach(e=>{e.markAsTouched(),e.markAsDirty()}),e[1].updateValueAndValidity()}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=this.createJson();this.taskWrapper.wrapTaskAroundCall({task:new T.a("ecp/create",{name:e.name}),call:this.ecpService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}createJson(){const e={technique:[this.PLUGIN.ISA,this.PLUGIN.JERASURE,this.PLUGIN.CLAY],packetSize:[this.PLUGIN.JERASURE],l:[this.PLUGIN.LRC],crushLocality:[this.PLUGIN.LRC],c:[this.PLUGIN.SHEC],d:[this.PLUGIN.CLAY],scalar_mds:[this.PLUGIN.CLAY]},t=new te,i=this.form.getValue("plugin");return Object.keys(this.form.controls).filter(t=>{const a=e[t],o=this.form.getValue(t);return(a&&a.includes(i)||!a)&&o&&""!==o}).forEach(e=>{this.extendJson(e,t)}),t}extendJson(e,t){const i=this.form.getValue(e);t[{crushFailureDomain:"crush-failure-domain",crushRoot:"crush-root",crushDeviceClass:"crush-device-class",packetSize:"packetsize",crushLocality:"crush-locality"}[e]||e]="crushRoot"===e?i.name:i}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(P.a),m.Mb(c.a),m.Mb(k.a),m.Mb(S),m.Mb(n.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-erasure-code-profile-form-modal"]],outputs:{submitAction:"submitAction"},features:[m.vb],decls:98,vars:53,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],"Name",[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","plugin",1,"cd-col-form-label"],[1,"required"],"Plugin",[3,"html"],["id","plugin","name","plugin","formControlName","plugin",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","k",1,"cd-col-form-label"],"Data chunks (k)",["type","number","id","k","name","k","ng-model","$ctrl.erasureCodeProfile.k","placeholder","Data chunks...","formControlName","k",1,"form-control"],["class","form-text text-muted",4,"ngIf"],["for","m",1,"cd-col-form-label"],"Coding chunks (m)",["type","number","id","m","name","m","placeholder","Coding chunks...","formControlName","m",1,"form-control"],["class","form-group row",4,"ngIf"],["for","crushFailureDomain",1,"cd-col-form-label"],"Crush failure domain",["id","crushFailureDomain","name","crushFailureDomain","formControlName","crushFailureDomain",1,"form-control","custom-select"],["for","crushRoot",1,"cd-col-form-label"],"Crush root",["id","crushRoot","name","crushRoot","formControlName","crushRoot",1,"form-control","custom-select"],["for","crushDeviceClass",1,"cd-col-form-label"],"Crush device class",["id","crushDeviceClass","name","crushDeviceClass","formControlName","crushDeviceClass",1,"form-control","custom-select"],["ngValue",""],"Let Ceph decide",[1,"form-text","text-muted"],"Available OSDs: " + "\ufffd0\ufffd" + "",["for","directory",1,"cd-col-form-label"],"Directory",["type","text","id","directory","name","directory","placeholder","Path...","formControlName","directory",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The name can only consist of alphanumeric characters, dashes and underscores.","The chosen erasure code profile name is already in use.","Loading...",[3,"ngValue"],"This field is required!","This field is required!","Must be equal to or greater than 2.","Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".","For an equal distribution k has to be a multiple of (k+m)/l.","K has to be equal to or greater than m in order to recover data correctly through c.","Distribution factor: " + "\ufffd0\ufffd" + "","This field is required!","Must be equal to or greater than 1.","Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".",["for","c",1,"cd-col-form-label"],"Durability estimator (c)",["type","number","id","c","name","c","placeholder","Coding chunks...","formControlName","c",1,"form-control"],"Must be equal to or greater than 1.","C has to be equal to or lower than m as m defines the amount of chunks that can be used.",["for","d",1,"cd-col-form-label"],"Helper chunks (d)",[1,"input-group"],["type","number","id","d","name","d","placeholder","Helper chunks...","formControlName","d",1,"form-control"],[1,"input-group-append"],["id","d-calc-btn","type","button",1,"btn","btn-light",3,"click",6,"ngbTooltip"],["ngbTooltip","Set d manually or use the plugin's default calculation that maximizes d."],["aria-hidden","true",3,"ngClass"],[4,"ngIf"],"D is automatically updated on k and m changes","D can be set from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + "","D can only be set to " + "\ufffd0\ufffd" + "","D has to be greater than k (" + "\ufffd0\ufffd" + ").","D has to be lower than k + m (" + "\ufffd0\ufffd" + ").",["for","l",1,"cd-col-form-label"],"Locality (l)",["type","number","id","l","name","l","placeholder","Coding chunks...","formControlName","l",1,"form-control"],"Locality groups: " + "\ufffd0\ufffd" + "","This field is required!","Must be equal to or greater than 1.","Can't split up chunks (k+m) correctly with the current locality.","Loading...",["for","crushLocality",1,"cd-col-form-label"],"Crush Locality",["id","crushLocality","name","crushLocality","formControlName","crushLocality",1,"form-control","custom-select"],"Loading...","None",["for","scalar_mds",1,"cd-col-form-label"],"Scalar mds",["id","scalar_mds","name","scalar_mds","formControlName","scalar_mds",1,"form-control","custom-select"],["for","technique",1,"cd-col-form-label"],"Technique",["id","technique","name","technique","formControlName","technique",1,"form-control","custom-select"],["for","packetSize",1,"cd-col-form-label"],"Packetsize",["type","number","id","packetSize","name","packetSize","placeholder","Packetsize...","formControlName","packetSize",1,"form-control"],"Must be equal to or greater than 1.","Loading..."]},template:function(e,t){if(1&e&&(m.Sb(0,"cd-modal",0),m.Qb(1,1),m.Wb(2,2),m.jc(3,"titlecase"),m.jc(4,"upperFirst"),m.Pb(),m.Qb(5,3),m.Sb(6,"form",4,5),m.Sb(8,"div",6),m.Sb(9,"div",7),m.Sb(10,"label",8),m.Wb(11,9),m.Rb(),m.Sb(12,"div",10),m.Nb(13,"input",11),m.Mc(14,ie,2,0,"span",12),m.Mc(15,ae,2,0,"span",12),m.Mc(16,oe,2,0,"span",12),m.Rb(),m.Rb(),m.Sb(17,"div",7),m.Sb(18,"label",13),m.Sb(19,"span",14),m.Wb(20,15),m.Rb(),m.Nb(21,"cd-helper",16),m.Rb(),m.Sb(22,"div",10),m.Sb(23,"select",17),m.Mc(24,se,2,0,"option",18),m.Mc(25,ce,2,2,"option",19),m.Rb(),m.Mc(26,ne,2,0,"span",12),m.Rb(),m.Rb(),m.Sb(27,"div",7),m.Sb(28,"label",20),m.Sb(29,"span",14),m.Wb(30,21),m.Rb(),m.Nb(31,"cd-helper",16),m.Rb(),m.Sb(32,"div",10),m.Nb(33,"input",22),m.Mc(34,le,2,0,"span",12),m.Mc(35,re,2,0,"span",12),m.Mc(36,be,2,1,"span",12),m.Mc(37,de,2,0,"span",12),m.Mc(38,ue,2,0,"span",12),m.Mc(39,fe,2,1,"span",23),m.Rb(),m.Rb(),m.Sb(40,"div",7),m.Sb(41,"label",24),m.Sb(42,"span",14),m.Wb(43,25),m.Rb(),m.Nb(44,"cd-helper",16),m.Rb(),m.Sb(45,"div",10),m.Nb(46,"input",26),m.Mc(47,pe,2,0,"span",12),m.Mc(48,he,2,0,"span",12),m.Mc(49,me,2,1,"span",12),m.Rb(),m.Rb(),m.Mc(50,Re,9,3,"div",27),m.Mc(51,_e,16,6,"div",27),m.Mc(52,$e,12,5,"div",27),m.Sb(53,"div",7),m.Sb(54,"label",28),m.Qb(55),m.Wb(56,29),m.Pb(),m.Nb(57,"cd-helper",16),m.Rb(),m.Sb(58,"div",10),m.Sb(59,"select",30),m.Mc(60,De,2,0,"option",18),m.Mc(61,Ee,2,3,"option",19),m.Rb(),m.Rb(),m.Rb(),m.Mc(62,Ae,10,4,"div",27),m.Mc(63,We,8,6,"div",27),m.Mc(64,Le,8,2,"div",27),m.Mc(65,Be,8,2,"div",27),m.Sb(66,"div",7),m.Sb(67,"label",31),m.Qb(68),m.Wb(69,32),m.Pb(),m.Nb(70,"cd-helper",16),m.Rb(),m.Sb(71,"div",10),m.Sb(72,"select",33),m.Mc(73,Ue,2,0,"option",18),m.Mc(74,Ge,2,2,"option",19),m.Rb(),m.Rb(),m.Rb(),m.Sb(75,"div",7),m.Sb(76,"label",34),m.Qb(77),m.Wb(78,35),m.Pb(),m.Nb(79,"cd-helper",16),m.Rb(),m.Sb(80,"div",10),m.Sb(81,"select",36),m.Sb(82,"option",37),m.Wb(83,38),m.Rb(),m.Mc(84,je,2,2,"option",19),m.Rb(),m.Sb(85,"span",39),m.Wb(86,40),m.Rb(),m.Rb(),m.Rb(),m.Sb(87,"div",7),m.Sb(88,"label",41),m.Qb(89),m.Wb(90,42),m.Pb(),m.Nb(91,"cd-helper",16),m.Rb(),m.Sb(92,"div",10),m.Nb(93,"input",43),m.Rb(),m.Rb(),m.Rb(),m.Sb(94,"div",44),m.Sb(95,"cd-form-button-panel",45),m.gc("submitActionEvent",(function(){return t.onSubmit()})),m.jc(96,"titlecase"),m.jc(97,"upperFirst"),m.Rb(),m.Rb(),m.Rb(),m.Pb(),m.Rb()),2&e){const e=m.Ac(7);m.pc("modalRef",t.activeModal),m.yb(4),m.ac(m.kc(3,41,t.action))(m.kc(4,43,t.resource)),m.Xb(2),m.yb(2),m.pc("formGroup",t.form),m.yb(8),m.pc("ngIf",t.form.showError("name",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"pattern")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"uniqueName")),m.yb(5),m.pc("html",t.tooltips.plugins[t.plugin].description),m.yb(3),m.pc("ngIf",!t.plugins),m.yb(1),m.pc("ngForOf",t.plugins),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"required")),m.yb(5),m.pc("html",t.tooltips.k),m.yb(3),m.pc("ngIf",t.form.showError("k",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("k",e,"min")),m.yb(1),m.pc("ngIf",t.form.showError("k",e,"max")),m.yb(1),m.pc("ngIf",t.form.showError("k",e,"unequal")),m.yb(1),m.pc("ngIf",t.form.showError("k",e,"kLowerM")),m.yb(1),m.pc("ngIf","lrc"===t.plugin),m.yb(5),m.pc("html",t.tooltips.m),m.yb(3),m.pc("ngIf",t.form.showError("m",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("m",e,"min")),m.yb(1),m.pc("ngIf",t.form.showError("m",e,"max")),m.yb(1),m.pc("ngIf","shec"===t.plugin),m.yb(1),m.pc("ngIf","clay"===t.plugin),m.yb(1),m.pc("ngIf",t.plugin===t.PLUGIN.LRC),m.yb(5),m.pc("html",t.tooltips.crushFailureDomain),m.yb(3),m.pc("ngIf",!t.failureDomains),m.yb(1),m.pc("ngForOf",t.failureDomainKeys),m.yb(1),m.pc("ngIf",t.plugin===t.PLUGIN.LRC),m.yb(1),m.pc("ngIf",t.PLUGIN.CLAY===t.plugin),m.yb(1),m.pc("ngIf",m.wc(49,Ve,t.PLUGIN.JERASURE,t.PLUGIN.ISA,t.PLUGIN.CLAY).includes(t.plugin)),m.yb(1),m.pc("ngIf",t.plugin===t.PLUGIN.JERASURE),m.yb(5),m.pc("html",t.tooltips.crushRoot),m.yb(3),m.pc("ngIf",!t.buckets),m.yb(1),m.pc("ngForOf",t.buckets),m.yb(5),m.pc("html",t.tooltips.crushDeviceClass),m.yb(5),m.pc("ngForOf",t.devices),m.yb(2),m.ac(t.deviceCount),m.Xb(86),m.yb(5),m.pc("html",t.tooltips.directory),m.yb(4),m.pc("form",t.form)("submitText",m.kc(96,45,t.action)+" "+m.kc(97,47,t.resource))}},directives:[x.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,L.a,o.z,a.q,o.v,o.u,o.B,q.a,c.D,a.p],pipes:[a.A,B.a],styles:[""]}),e})();var Je=i("DNAf");class Ke{constructor(){this.erasureInfo=!1,this.crushInfo=!1,this.pgs=1,this.poolTypes=["erasure","replicated"],this.applications={selected:[],default:["cephfs","rbd","rgw"],available:[],validators:[o.A.pattern("[A-Za-z0-9_]+"),o.A.maxLength(128)],messages:new Je.a({empty:"No applications added",selectionLimit:{text:"Applications limit reached",tooltip:"A pool can only have up to four applications definitions."},customValidations:{pattern:"Allowed characters '_a-zA-Z0-9'",maxlength:"Maximum length is 128 characters"},filter:"Filter or add applications'",add:"Add application"})}}}var Ye=i("zc8c"),Xe=i("ppaS"),He=i("EmSq"),Ze=i("rFfW"),et=i("6qls"),tt=i("FSuO");const it=["crushInfoTabs"],at=["crushDeletionBtn"],ot=["ecpInfoTabs"],st=["ecpDeletionBtn"];function ct(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,43),m.Rb())}function nt(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,44),m.Rb())}function lt(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,45),m.Rb())}function rt(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,46),m.Rb())}function bt(e,t){if(1&e&&(m.Sb(0,"option",47),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("value",e),m.yb(1),m.Qc(" ",e," ")}}function dt(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,48),m.Rb())}function ut(e,t){if(1&e&&(m.Sb(0,"option",47),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("value",e),m.yb(1),m.Qc(" ",e," ")}}function ft(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,60),m.Rb())}function pt(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,61),m.Rb())}function ht(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,62),m.Rb())}function mt(e,t){1&e&&(m.Sb(0,"span",56),m.Wb(1,63),m.Rb())}function gt(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",8),m.Sb(1,"label",53),m.Wb(2,54),m.Rb(),m.Sb(3,"div",11),m.Sb(4,"input",55),m.gc("focus",(function(){return m.Dc(e),m.ic(3).externalPgChange=!1}))("blur",(function(){return m.Dc(e),m.ic(3).alignPgs()})),m.Rb(),m.Mc(5,ft,2,0,"span",14),m.Mc(6,pt,2,0,"span",14),m.Mc(7,ht,2,0,"span",14),m.Sb(8,"span",56),m.Sb(9,"cd-doc",57),m.Yb(10,58),m.Rb(),m.Rb(),m.Mc(11,mt,2,0,"span",59),m.Rb(),m.Rb()}if(2&e){m.ic(2);const e=m.Ac(2),t=m.ic();m.yb(5),m.pc("ngIf",t.form.showError("pgNum",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("pgNum",e,"min")),m.yb(1),m.pc("ngIf",t.form.showError("pgNum",e,"34")),m.yb(4),m.pc("ngIf",t.externalPgChange)}}function St(e,t){if(1&e&&(m.Sb(0,"span",42),m.Sb(1,"ul",68),m.Sb(2,"li"),m.Wb(3,69),m.Rb(),m.Sb(4,"li"),m.Wb(5,70),m.Rb(),m.Rb(),m.Rb()),2&e){const e=m.ic(4);m.yb(3),m.ac(e.getMinSize()),m.Xb(3),m.yb(2),m.ac(e.getMaxSize()),m.Xb(5)}}function Rt(e,t){if(1&e&&(m.Sb(0,"span",42),m.Wb(1,71),m.Rb()),2&e){const e=m.ic(4);m.yb(1),m.ac(e.getMinSize())(e.getMaxSize()),m.Xb(1)}}function vt(e,t){1&e&&(m.Sb(0,"span",72),m.Wb(1,73),m.Rb())}function yt(e,t){if(1&e&&(m.Sb(0,"div",8),m.Sb(1,"label",64),m.Wb(2,65),m.Rb(),m.Sb(3,"div",11),m.Nb(4,"input",66),m.Mc(5,St,6,2,"span",14),m.Mc(6,Rt,2,2,"span",14),m.Mc(7,vt,2,0,"span",67),m.Rb(),m.Rb()),2&e){m.ic(2);const e=m.Ac(2),t=m.ic();m.yb(4),m.pc("max",t.getMaxSize())("min",t.getMinSize()),m.yb(1),m.pc("ngIf",t.form.showError("size",e)),m.yb(1),m.pc("ngIf",t.form.showError("size",e)),m.yb(1),m.pc("ngIf",1===t.form.getValue("size"))}}function zt(e,t){1&e&&(m.Sb(0,"div",8),m.Sb(1,"label",74),m.Wb(2,75),m.Rb(),m.Sb(3,"div",11),m.Sb(4,"div",76),m.Nb(5,"input",77),m.Sb(6,"label",78),m.Wb(7,79),m.Rb(),m.Rb(),m.Rb(),m.Rb())}function Ct(e,t){if(1&e&&(m.Sb(0,"div"),m.Sb(1,"div",8),m.Sb(2,"label",49),m.Wb(3,50),m.Rb(),m.Sb(4,"div",11),m.Sb(5,"select",51),m.Mc(6,ut,2,2,"option",20),m.Rb(),m.Rb(),m.Rb(),m.Mc(7,gt,12,4,"div",52),m.Mc(8,yt,8,5,"div",52),m.Mc(9,zt,8,0,"div",52),m.Rb()),2&e){const e=m.ic(2);m.yb(6),m.pc("ngForOf",e.pgAutoscaleModes),m.yb(1),m.pc("ngIf","on"!==e.form.getValue("pgAutoscaleMode")),m.yb(1),m.pc("ngIf",e.isReplicated),m.yb(1),m.pc("ngIf",e.info.is_all_bluestore&&e.isErasure)}}function It(e,t){1&e&&(m.Sb(0,"option",18),m.Wb(1,94),m.Rb())}function Nt(e,t){1&e&&(m.Sb(0,"option",95),m.Wb(1,96),m.Rb()),2&e&&m.pc("ngValue",null)}function _t(e,t){1&e&&(m.Sb(0,"option",95),m.Wb(1,97),m.Rb()),2&e&&m.pc("ngValue",null)}function Mt(e,t){if(1&e&&(m.Sb(0,"option",95),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e.name," ")}}const Tt=function(e){return[e]};function wt(e,t){if(1&e){const e=m.Tb();m.Sb(0,"button",98),m.gc("click",(function(){return m.Dc(e),m.ic(4).addErasureCodeProfile()})),m.Nb(1,"i",90),m.Rb()}if(2&e){const e=m.ic(4);m.yb(1),m.pc("ngClass",m.uc(1,Tt,e.icons.add))}}function $t(e,t){if(1&e){const e=m.Tb();m.Sb(0,"button",99,100),m.Yb(2,101),m.gc("click",(function(){return m.Dc(e),m.ic(4).deleteErasureCodeProfile()})),m.Nb(3,"i",90),m.Rb()}if(2&e){const e=m.ic(4);m.yb(3),m.pc("ngClass",m.uc(1,Tt,e.icons.trash))}}const Dt=function(){return["name"]};function Et(e,t){if(1&e&&m.Nb(0,"cd-table-key-value",112),2&e){const e=m.ic(5);m.pc("renderObjects",!0)("hideKeys",m.tc(4,Dt))("data",e.form.getValue("erasureProfile"))("autoReload",!1)}}function kt(e,t){1&e&&(m.Sb(0,"span"),m.Wb(1,115),m.Rb())}function Pt(e,t){if(1&e&&(m.Sb(0,"li"),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.yb(1),m.Qc(" ",e," ")}}function xt(e,t){if(1&e&&(m.Sb(0,"ul"),m.Mc(1,Pt,2,1,"li",116),m.Rb()),2&e){const e=m.ic(6);m.yb(1),m.pc("ngForOf",e.ecpUsage)}}function At(e,t){if(1&e&&(m.Mc(0,kt,2,0,"ng-template",null,113,m.Nc),m.Mc(2,xt,2,1,"ul",114)),2&e){const e=m.Ac(1),t=m.ic(5);m.yb(2),m.pc("ngIf",t.ecpUsage)("ngIfElse",e)}}function Ot(e,t){if(1&e&&(m.Sb(0,"span",102),m.Sb(1,"ul",103,104),m.Sb(3,"li",105),m.Sb(4,"a",106),m.Wb(5,107),m.Rb(),m.Mc(6,Et,1,5,"ng-template",108),m.Rb(),m.Sb(7,"li",109),m.Sb(8,"a",106),m.Wb(9,110),m.Rb(),m.Mc(10,At,3,2,"ng-template",108),m.Rb(),m.Rb(),m.Nb(11,"div",111),m.Rb()),2&e){const e=m.Ac(2);m.yb(11),m.pc("ngbNavOutlet",e)}}const Vt=function(e){return{active:e}};function Wt(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",8),m.Sb(1,"label",81),m.Wb(2,82),m.Rb(),m.Sb(3,"div",11),m.Sb(4,"div",83),m.Sb(5,"select",84),m.Mc(6,It,2,0,"option",85),m.Mc(7,Nt,2,1,"option",86),m.Mc(8,_t,2,1,"option",86),m.Mc(9,Mt,2,2,"option",87),m.Rb(),m.Sb(10,"span",88),m.Sb(11,"button",89),m.gc("click",(function(){m.Dc(e);const t=m.ic(3);return t.data.erasureInfo=!t.data.erasureInfo})),m.Nb(12,"i",90),m.Rb(),m.Mc(13,wt,2,3,"button",91),m.Mc(14,$t,4,3,"button",92),m.Rb(),m.Rb(),m.Mc(15,Ot,12,1,"span",93),m.Rb(),m.Rb()}if(2&e){const e=m.ic(3);m.yb(6),m.pc("ngIf",!e.ecProfiles),m.yb(1),m.pc("ngIf",e.ecProfiles&&0===e.ecProfiles.length),m.yb(1),m.pc("ngIf",e.ecProfiles&&e.ecProfiles.length>0),m.yb(1),m.pc("ngForOf",e.ecProfiles),m.yb(2),m.pc("ngClass",m.uc(9,Vt,e.data.erasureInfo)),m.yb(1),m.pc("ngClass",m.uc(11,Tt,e.icons.questionCircle)),m.yb(1),m.pc("ngIf",!e.editing),m.yb(1),m.pc("ngIf",!e.editing),m.yb(1),m.pc("ngIf",e.data.erasureInfo&&e.form.getValue("erasureProfile"))}}function Ft(e,t){1&e&&(m.Sb(0,"div",8),m.Sb(1,"label",117),m.Wb(2,118),m.Rb(),m.Sb(3,"div",11),m.Sb(4,"span",56),m.Wb(5,119),m.Rb(),m.Rb(),m.Rb())}function Lt(e,t){1&e&&(m.Sb(0,"span",56),m.Sb(1,"span"),m.Wb(2,122),m.Rb(),m.Oc(3,"\xa0 "),m.Rb())}function qt(e,t){if(1&e&&(m.Sb(0,"option",95),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("ngValue",e),m.yb(1),m.Qc(" ",e.rule_name," ")}}function Bt(e,t){if(1&e){const e=m.Tb();m.Sb(0,"button",98),m.gc("click",(function(){return m.Dc(e),m.ic(5).addCrushRule()})),m.Nb(1,"i",90),m.Rb()}if(2&e){const e=m.ic(5);m.yb(1),m.pc("ngClass",m.uc(1,Tt,e.icons.add))}}function Ut(e,t){if(1&e){const e=m.Tb();m.Sb(0,"button",99,128),m.Yb(2,129),m.gc("click",(function(){return m.Dc(e),m.ic(5).deleteCrushRule()})),m.Nb(3,"i",90),m.Rb()}if(2&e){const e=m.ic(5);m.yb(3),m.pc("ngClass",m.uc(1,Tt,e.icons.trash))}}const Gt=function(){return["steps","ruleset","type","rule_name"]};function jt(e,t){if(1&e&&m.Nb(0,"cd-table-key-value",112),2&e){const e=m.ic(6);m.pc("renderObjects",!1)("hideKeys",m.tc(4,Gt))("data",e.form.getValue("crushRule"))("autoReload",!1)}}function Qt(e,t){if(1&e&&(m.Sb(0,"li"),m.Oc(1),m.Rb()),2&e){const e=t.$implicit,i=m.ic(7);m.yb(1),m.Qc(" ",i.describeCrushStep(e)," ")}}function Jt(e,t){if(1&e&&(m.Sb(0,"ol"),m.Mc(1,Qt,2,1,"li",116),m.Rb()),2&e){const e=m.ic(6);m.yb(1),m.pc("ngForOf",e.form.get("crushRule").value.steps)}}function Kt(e,t){1&e&&(m.Sb(0,"span"),m.Wb(1,138),m.Rb())}function Yt(e,t){if(1&e&&(m.Sb(0,"li"),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.yb(1),m.Qc(" ",e," ")}}function Xt(e,t){if(1&e&&(m.Sb(0,"ul"),m.Mc(1,Yt,2,1,"li",116),m.Rb()),2&e){const e=m.ic(7);m.yb(1),m.pc("ngForOf",e.crushUsage)}}function Ht(e,t){if(1&e&&(m.Mc(0,Kt,2,0,"ng-template",null,137,m.Nc),m.Mc(2,Xt,2,1,"ul",114)),2&e){const e=m.Ac(1),t=m.ic(6);m.yb(2),m.pc("ngIf",t.crushUsage)("ngIfElse",e)}}function Zt(e,t){if(1&e&&(m.Sb(0,"div",130),m.Sb(1,"ul",103,131),m.Sb(3,"li",132),m.Sb(4,"a",106),m.Wb(5,133),m.Rb(),m.Mc(6,jt,1,5,"ng-template",108),m.Rb(),m.Sb(7,"li",134),m.Sb(8,"a",106),m.Wb(9,135),m.Rb(),m.Mc(10,Jt,2,1,"ng-template",108),m.Rb(),m.Sb(11,"li",109),m.Sb(12,"a",106),m.Wb(13,136),m.Rb(),m.Mc(14,Ht,3,2,"ng-template",108),m.Rb(),m.Rb(),m.Nb(15,"div",111),m.Rb()),2&e){const e=m.Ac(2);m.yb(15),m.pc("ngbNavOutlet",e)}}function ei(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,139),m.Rb())}function ti(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,140),m.Rb())}function ii(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div"),m.Sb(1,"div",83),m.Sb(2,"select",123),m.Sb(3,"option",95),m.Wb(4,124),m.Rb(),m.Mc(5,qt,2,2,"option",87),m.Rb(),m.Sb(6,"span",88),m.Sb(7,"button",125),m.Yb(8,126),m.gc("click",(function(){m.Dc(e);const t=m.ic(4);return t.data.crushInfo=!t.data.crushInfo})),m.Nb(9,"i",90),m.Rb(),m.Mc(10,Bt,2,3,"button",91),m.Mc(11,Ut,4,3,"button",92),m.Rb(),m.Rb(),m.Mc(12,Zt,16,1,"div",127),m.Mc(13,ei,2,0,"span",14),m.Mc(14,ti,2,0,"span",14),m.Rb()}if(2&e){m.ic(3);const e=m.Ac(2),t=m.ic();m.yb(3),m.pc("ngValue",null),m.yb(2),m.pc("ngForOf",t.current.rules),m.yb(2),m.pc("ngClass",m.uc(9,Vt,t.data.crushInfo)),m.yb(2),m.pc("ngClass",m.uc(11,Tt,t.icons.questionCircle)),m.yb(1),m.pc("ngIf",t.isReplicated&&!t.editing),m.yb(1),m.pc("ngIf",t.isReplicated&&!t.editing),m.yb(1),m.pc("ngIf",t.data.crushInfo&&t.form.getValue("crushRule")),m.yb(1),m.pc("ngIf",t.form.showError("crushRule",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("crushRule",e,"tooFewOsds"))}}function ai(e,t){if(1&e&&(m.Sb(0,"div",8),m.Sb(1,"label",117),m.Wb(2,120),m.Rb(),m.Sb(3,"div",11),m.Mc(4,Lt,4,0,"ng-template",null,121,m.Nc),m.Mc(6,ii,15,13,"div",114),m.Rb(),m.Rb()),2&e){const e=m.Ac(5),t=m.ic(3);m.yb(6),m.pc("ngIf",t.current.rules.length>0)("ngIfElse",e)}}function oi(e,t){if(1&e&&(m.Sb(0,"div"),m.Sb(1,"legend"),m.Wb(2,80),m.Rb(),m.Mc(3,Wt,16,13,"div",52),m.Mc(4,Ft,6,0,"div",52),m.Mc(5,ai,7,2,"div",52),m.Rb()),2&e){const e=m.ic(2);m.yb(3),m.pc("ngIf",e.isErasure),m.yb(1),m.pc("ngIf",e.isErasure&&!e.editing),m.yb(1),m.pc("ngIf",e.isReplicated||e.editing)}}function si(e,t){if(1&e&&(m.Sb(0,"option",47),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("value",e),m.yb(1),m.Qc(" ",e," ")}}function ci(e,t){1&e&&(m.Sb(0,"option",18),m.Wb(1,161),m.Rb())}function ni(e,t){1&e&&(m.Sb(0,"option",18),m.Wb(1,162),m.Rb())}function li(e,t){if(1&e&&(m.Sb(0,"option",47),m.Oc(1),m.Rb()),2&e){const e=t.$implicit;m.pc("value",e),m.yb(1),m.Qc(" ",e," ")}}function ri(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,163),m.Rb())}function bi(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,164),m.Rb())}function di(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,165),m.Rb())}function ui(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,166),m.Rb())}function fi(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,167),m.Rb())}function pi(e,t){if(1&e&&(m.Sb(0,"div"),m.Sb(1,"div",8),m.Sb(2,"label",146),m.Wb(3,147),m.Rb(),m.Sb(4,"div",11),m.Sb(5,"select",148),m.Mc(6,ci,2,0,"option",85),m.Mc(7,ni,2,0,"option",85),m.Mc(8,li,2,2,"option",20),m.Rb(),m.Rb(),m.Rb(),m.Sb(9,"div",8),m.Sb(10,"label",149),m.Wb(11,150),m.Rb(),m.Sb(12,"div",11),m.Sb(13,"input",151),m.Yb(14,152),m.Rb(),m.Mc(15,ri,2,0,"span",14),m.Mc(16,bi,2,0,"span",14),m.Rb(),m.Rb(),m.Sb(17,"div",8),m.Sb(18,"label",153),m.Wb(19,154),m.Rb(),m.Sb(20,"div",11),m.Sb(21,"input",155),m.Yb(22,156),m.Rb(),m.Mc(23,di,2,0,"span",14),m.Mc(24,ui,2,0,"span",14),m.Rb(),m.Rb(),m.Sb(25,"div",8),m.Sb(26,"label",157),m.Wb(27,158),m.Rb(),m.Sb(28,"div",11),m.Sb(29,"input",159),m.Yb(30,160),m.Rb(),m.Mc(31,fi,2,0,"span",14),m.Rb(),m.Rb(),m.Rb()),2&e){m.ic(2);const e=m.Ac(2),t=m.ic();m.yb(6),m.pc("ngIf",!t.info.compression_algorithms),m.yb(1),m.pc("ngIf",t.info.compression_algorithms&&0===t.info.compression_algorithms.length),m.yb(1),m.pc("ngForOf",t.info.compression_algorithms),m.yb(7),m.pc("ngIf",t.form.showError("minBlobSize",e,"min")),m.yb(1),m.pc("ngIf",t.form.showError("minBlobSize",e,"maximum")),m.yb(7),m.pc("ngIf",t.form.showError("maxBlobSize",e,"min")),m.yb(1),m.pc("ngIf",t.form.showError("maxBlobSize",e,"minimum")),m.yb(7),m.pc("ngIf",t.form.showError("ratio",e,"min")||t.form.showError("ratio",e,"max"))}}function hi(e,t){if(1&e&&(m.Sb(0,"div",141),m.Sb(1,"legend"),m.Wb(2,142),m.Rb(),m.Sb(3,"div",8),m.Sb(4,"label",143),m.Wb(5,144),m.Rb(),m.Sb(6,"div",11),m.Sb(7,"select",145),m.Mc(8,si,2,2,"option",20),m.Rb(),m.Rb(),m.Rb(),m.Mc(9,pi,32,8,"div",21),m.Rb()),2&e){const e=m.ic(2);m.yb(8),m.pc("ngForOf",e.info.compression_modes),m.yb(1),m.pc("ngIf",e.hasCompressionEnabled())}}function mi(e,t){1&e&&(m.Sb(0,"span",42),m.Wb(1,168),m.Rb())}function gi(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",1),m.Sb(1,"form",2,3),m.Sb(3,"div",4),m.Sb(4,"div",5),m.Wb(5,6),m.jc(6,"titlecase"),m.jc(7,"upperFirst"),m.Rb(),m.Sb(8,"div",7),m.Sb(9,"div",8),m.Sb(10,"label",9),m.Wb(11,10),m.Rb(),m.Sb(12,"div",11),m.Sb(13,"input",12),m.Yb(14,13),m.Rb(),m.Mc(15,ct,2,0,"span",14),m.Mc(16,nt,2,0,"span",14),m.Mc(17,lt,2,0,"span",14),m.Mc(18,rt,2,0,"span",14),m.Rb(),m.Rb(),m.Sb(19,"div",8),m.Sb(20,"label",15),m.Wb(21,16),m.Rb(),m.Sb(22,"div",11),m.Sb(23,"select",17),m.Sb(24,"option",18),m.Wb(25,19),m.Rb(),m.Mc(26,bt,2,2,"option",20),m.Rb(),m.Mc(27,dt,2,0,"span",14),m.Rb(),m.Rb(),m.Mc(28,Ct,10,4,"div",21),m.Sb(29,"div",8),m.Sb(30,"label",22),m.Wb(31,23),m.Rb(),m.Sb(32,"div",11),m.Sb(33,"cd-select-badges",24),m.gc("selection",(function(){return m.Dc(e),m.ic().appSelection()})),m.Rb(),m.Rb(),m.Rb(),m.Mc(34,oi,6,3,"div",21),m.Mc(35,hi,10,2,"div",25),m.Sb(36,"div"),m.Sb(37,"legend"),m.Wb(38,26),m.Rb(),m.Sb(39,"div",8),m.Sb(40,"label",27),m.Qb(41),m.Wb(42,28),m.Pb(),m.Sb(43,"cd-helper"),m.Sb(44,"span"),m.Wb(45,29),m.Rb(),m.Nb(46,"br"),m.Sb(47,"span"),m.Wb(48,30),m.Rb(),m.Rb(),m.Rb(),m.Sb(49,"div",11),m.Sb(50,"input",31),m.Yb(51,32),m.Rb(),m.Rb(),m.Rb(),m.Sb(52,"div",8),m.Sb(53,"label",33),m.Qb(54),m.Wb(55,34),m.Pb(),m.Sb(56,"cd-helper"),m.Sb(57,"span"),m.Wb(58,35),m.Rb(),m.Nb(59,"br"),m.Sb(60,"span"),m.Wb(61,36),m.Rb(),m.Rb(),m.Rb(),m.Sb(62,"div",11),m.Nb(63,"input",37),m.Mc(64,mi,2,0,"span",14),m.Rb(),m.Rb(),m.Rb(),m.Sb(65,"div",38),m.Sb(66,"cd-rbd-configuration-form",39),m.gc("changes",(function(t){return m.Dc(e),m.ic().currentConfigurationValues=t()})),m.Rb(),m.Rb(),m.Rb(),m.Sb(67,"div",40),m.Sb(68,"cd-form-button-panel",41),m.gc("submitActionEvent",(function(){return m.Dc(e),m.ic().submit()})),m.jc(69,"titlecase"),m.jc(70,"upperFirst"),m.Rb(),m.Rb(),m.Rb(),m.Rb(),m.Rb()}if(2&e){const e=m.Ac(2),t=m.ic();m.yb(1),m.pc("formGroup",t.form),m.yb(6),m.ac(m.kc(6,24,t.action))(m.kc(7,26,t.resource)),m.Xb(5),m.yb(8),m.pc("ngIf",t.form.showError("name",e,"required")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"uniqueName")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"rbdPool")),m.yb(1),m.pc("ngIf",t.form.showError("name",e,"pattern")),m.yb(8),m.pc("ngForOf",t.data.poolTypes),m.yb(1),m.pc("ngIf",t.form.showError("poolType",e,"required")),m.yb(1),m.pc("ngIf",t.isReplicated||t.isErasure),m.yb(5),m.pc("customBadges",!0)("customBadgeValidators",t.data.applications.validators)("messages",t.data.applications.messages)("data",t.data.applications.selected)("options",t.data.applications.available)("selectionLimit",4),m.yb(1),m.pc("ngIf",t.isErasure||t.isReplicated),m.yb(1),m.pc("ngIf",t.info.is_all_bluestore),m.yb(29),m.pc("ngIf",t.form.showError("max_objects",e,"min")),m.yb(1),m.pc("hidden",t.isErasure||-1===t.data.applications.selected.indexOf("rbd")),m.yb(1),m.pc("form",t.form)("initializeData",t.initializeConfigData),m.yb(2),m.pc("form",t.form)("submitText",m.kc(69,28,t.action)+" "+m.kc(70,30,t.resource))}}let Si=(()=>{class e extends I.a{constructor(e,t,i,a,o,s,c,l,r,b,d){super(),this.dimlessBinaryPipe=e,this.route=t,this.router=i,this.modalService=a,this.poolService=o,this.authStorageService=s,this.formatter=c,this.taskWrapper=l,this.ecpService=r,this.crushRuleService=b,this.actionLabels=d,this.editing=!1,this.isReplicated=!1,this.isErasure=!1,this.data=new Ke,this.externalPgChange=!1,this.current={rules:[]},this.initializeConfigData=new f.a(1),this.currentConfigurationValues={},this.icons=C.a,this.crushUsage=void 0,this.ecpUsage=void 0,this.editing=this.router.url.startsWith("/pool/"+n.e.EDIT),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.resource="pool",this.authenticate(),this.createForm()}authenticate(){if(this.permission=this.authStorageService.getPermissions().pool,!this.permission.read||!this.permission.update&&this.editing||!this.permission.create&&!this.editing)throw new p.b}createForm(){const e=new N.a({mode:new o.h("none"),algorithm:new o.h(""),minBlobSize:new o.h("",{updateOn:"blur"}),maxBlobSize:new o.h("",{updateOn:"blur"}),ratio:new o.h("",{updateOn:"blur"})});this.form=new N.a({name:new o.h("",{validators:[o.A.pattern(/^[.A-Za-z0-9_/-]+$/),o.A.required,_.a.custom("rbdPool",()=>this.form&&this.form.getValue("name").includes("/")&&this.data&&-1!==this.data.applications.selected.indexOf("rbd"))]}),poolType:new o.h("",{validators:[o.A.required]}),crushRule:new o.h(null,{validators:[_.a.custom("tooFewOsds",e=>this.info&&e&&this.info.osd_count<e.min_size),_.a.custom("required",e=>this.isReplicated&&this.info.crush_rules_replicated.length>0&&!e)]}),size:new o.h("",{updateOn:"blur"}),erasureProfile:new o.h(null),pgNum:new o.h("",{validators:[o.A.required,o.A.min(1)]}),pgAutoscaleMode:new o.h(null),ecOverwrites:new o.h(!1),compression:e,max_bytes:new o.h(""),max_objects:new o.h(0,{validators:[o.A.min(0)]})},[_.a.custom("form",()=>null)])}ngOnInit(){this.poolService.getInfo().subscribe(e=>{this.initInfo(e),this.editing?this.initEditMode():(this.setAvailableApps(),this.loadingReady()),this.listenToChanges(),this.setComplexValidators()})}initInfo(e){this.pgAutoscaleModes=e.pg_autoscale_modes,this.form.silentSet("pgAutoscaleMode",e.pg_autoscale_default_mode),this.form.silentSet("algorithm",e.bluestore_compression_algorithm),this.info=e,this.initEcp(e.erasure_code_profiles)}initEcp(e){this.setListControlStatus("erasureProfile",e),this.ecProfiles=e}setListControlStatus(e,t){const i=this.form.get(e),a=i.value;1!==t.length||a&&u.a.isEqual(a,t[0])?0===t.length&&a&&i.setValue(null):i.setValue(t[0]),t.length<=1?i.enabled&&i.disable():i.disabled&&i.enable()}initEditMode(){this.disableForEdit(),this.routeParamsSubscribe=this.route.params.subscribe(e=>this.poolService.get(e.name).subscribe(e=>{this.data.pool=e,this.initEditFormData(e),this.loadingReady()}))}disableForEdit(){["poolType","crushRule","size","erasureProfile","ecOverwrites"].forEach(e=>this.form.get(e).disable())}initEditFormData(e){this.initializeConfigData.next({initialData:e.configuration,sourceType:M.a.pool}),this.poolTypeChange(e.type);const t=this.info.crush_rules_replicated.concat(this.info.crush_rules_erasure),i={name:e.pool_name,poolType:e.type,crushRule:t.find(t=>t.rule_name===e.crush_rule),size:e.size,erasureProfile:this.ecProfiles.find(t=>t.name===e.erasure_code_profile),pgAutoscaleMode:e.pg_autoscale_mode,pgNum:e.pg_num,ecOverwrites:e.flags_names.includes("ec_overwrites"),mode:e.options.compression_mode,algorithm:e.options.compression_algorithm,minBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_min_blob_size),maxBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_max_blob_size),ratio:e.options.compression_required_ratio,max_bytes:this.dimlessBinaryPipe.transform(e.quota_max_bytes),max_objects:e.quota_max_objects};Object.keys(i).forEach(e=>{const t=i[e];u.a.isUndefined(t)||""===t||this.form.silentSet(e,t)}),this.data.pgs=this.form.getValue("pgNum"),this.setAvailableApps(this.data.applications.default.concat(e.application_metadata)),this.data.applications.selected=e.application_metadata}setAvailableApps(e=this.data.applications.default){this.data.applications.available=u.a.uniq(e.sort()).map(e=>new z.a(!1,e,""))}listenToChanges(){this.listenToChangesDuringAddEdit(),this.editing||this.listenToChangesDuringAdd()}listenToChangesDuringAddEdit(){this.form.get("pgNum").valueChanges.subscribe(e=>{const t=e-this.data.pgs;1===Math.abs(t)&&2!==e?this.doPgPowerJump(t):this.data.pgs=e})}doPgPowerJump(e){const t=this.calculatePgPower()+e;this.setPgs(-1===e?Math.round(t):Math.floor(t))}calculatePgPower(e=this.form.getValue("pgNum")){return Math.log(e)/Math.log(2)}setPgs(e){const t=Math.pow(2,e<0?0:e);this.data.pgs=t,this.form.silentSet("pgNum",t)}listenToChangesDuringAdd(){this.form.get("poolType").valueChanges.subscribe(e=>{this.poolTypeChange(e)}),this.form.get("crushRule").valueChanges.subscribe(e=>{this.crushDeletionBtn&&this.crushDeletionBtn.isOpen()&&this.crushDeletionBtn.close(),e&&(this.setCorrectMaxSize(e),this.crushRuleIsUsedBy(e.rule_name),this.replicatedRuleChange(),this.pgCalc())}),this.form.get("size").valueChanges.subscribe(()=>{this.pgCalc()}),this.form.get("erasureProfile").valueChanges.subscribe(e=>{this.ecpDeletionBtn&&this.ecpDeletionBtn.isOpen()&&this.ecpDeletionBtn.close(),e&&(this.ecpIsUsedBy(e.name),this.pgCalc())}),this.form.get("mode").valueChanges.subscribe(()=>{["minBlobSize","maxBlobSize","ratio"].forEach(e=>{this.form.get(e).updateValueAndValidity({emitEvent:!1})})}),this.form.get("minBlobSize").valueChanges.subscribe(()=>{this.form.get("maxBlobSize").updateValueAndValidity({emitEvent:!1})}),this.form.get("maxBlobSize").valueChanges.subscribe(()=>{this.form.get("minBlobSize").updateValueAndValidity({emitEvent:!1})})}poolTypeChange(e){if("replicated"===e?this.setTypeBooleans(!0,!1):this.setTypeBooleans(!1,"erasure"===e),!e||!this.info)return void(this.current.rules=[]);const t=this.info["crush_rules_"+e]||[];this.current.rules=t,this.editing||(this.isReplicated&&this.setListControlStatus("crushRule",t),this.replicatedRuleChange(),this.pgCalc())}setTypeBooleans(e,t){this.isReplicated=e,this.isErasure=t}replicatedRuleChange(){if(!this.isReplicated)return;const e=this.form.get("size");let t=this.form.getValue("size")||3;const i=this.getMinSize(),a=this.getMaxSize();t<i?t=i:t>a&&(t=a),t!==e.value&&this.form.silentSet("size",t)}getMinSize(){if(!this.info||this.info.osd_count<1)return 0;const e=this.form.getValue("crushRule");return e?e.min_size:1}getMaxSize(){const e=this.form.getValue("crushRule");return this.info?e?e.usable_size:Math.min(this.info.osd_count,3):0}pgCalc(){const e=this.form.getValue("poolType");if(!this.info||this.form.get("pgNum").dirty||!e)return;const t=100*this.info.osd_count,i=this.isReplicated?this.replicatedPgCalc(t):this.erasurePgCalc(t);if(!i)return;const a=this.data.pgs;this.alignPgs(i),this.externalPgChange||(this.externalPgChange=a!==this.data.pgs)}setCorrectMaxSize(e=this.form.getValue("crushRule")){if(!e)return;const t=v.searchFailureDomains(this.info.nodes,e.steps[0].item_name)[e.steps[1].type];e.usable_size=Math.min(t?t.length:e.max_size,e.max_size)}replicatedPgCalc(e){const t=this.form.get("size"),i=t.value;return t.valid&&i>0?e/i:0}erasurePgCalc(e){const t=this.form.get("erasureProfile"),i=t.value;return(t.valid||t.disabled)&&i?e/(i.k+i.m):0}alignPgs(e=this.form.getValue("pgNum")){this.setPgs(Math.round(this.calculatePgPower(e<1?1:e)))}setComplexValidators(){this.editing?this.form.get("name").setValidators([this.form.get("name").validator,_.a.custom("uniqueName",e=>this.data.pool&&this.info&&-1!==this.info.pool_names.indexOf(e)&&this.info.pool_names.indexOf(e)!==this.info.pool_names.indexOf(this.data.pool.pool_name))]):(_.a.validateIf(this.form.get("size"),()=>this.isReplicated,[_.a.custom("min",e=>this.form.getValue("size")&&e<this.getMinSize()),_.a.custom("max",e=>this.form.getValue("size")&&this.getMaxSize()<e)]),this.form.get("name").setValidators([this.form.get("name").validator,_.a.custom("uniqueName",e=>this.info&&-1!==this.info.pool_names.indexOf(e))])),this.setCompressionValidators()}setCompressionValidators(){_.a.validateIf(this.form.get("minBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),_.a.custom("maximum",e=>this.oddBlobSize(e,this.form.getValue("maxBlobSize")))]),_.a.validateIf(this.form.get("maxBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),_.a.custom("minimum",e=>this.oddBlobSize(this.form.getValue("minBlobSize"),e))]),_.a.validateIf(this.form.get("ratio"),()=>this.hasCompressionEnabled(),[o.A.min(0),o.A.max(1)])}oddBlobSize(e,t){const i=this.formatter.toBytes(e),a=this.formatter.toBytes(t);return Boolean(i&&a&&i>=a)}hasCompressionEnabled(){return this.form.getValue("mode")&&"none"!==this.form.get("mode").value.toLowerCase()}describeCrushStep(e){return[e.op.replace("_"," "),e.item_name||"",e.type?e.num+" type "+e.type:""].join(" ")}addErasureCodeProfile(){this.addModal(Qe,e=>this.reloadECPs(e))}addModal(e,t){this.hideOpenTooltips(),this.modalService.show(e).componentInstance.submitAction.subscribe(e=>{t(e.name)})}hideOpenTooltips(){const e=e=>e&&e.isOpen()&&e.close();e(this.ecpDeletionBtn),e(this.crushDeletionBtn)}reloadECPs(e){this.reloadList({newItemName:e,getInfo:()=>this.ecpService.list(),initInfo:e=>this.initEcp(e),findNewItem:()=>this.ecProfiles.find(t=>t.name===e),controlName:"erasureProfile"})}reloadList({newItemName:e,getInfo:t,initInfo:i,findNewItem:a,controlName:o}){this.modalSubscription&&this.modalSubscription.unsubscribe(),t().subscribe(t=>{if(i(t),!e)return;const s=a();s&&this.form.get(o).setValue(s)})}deleteErasureCodeProfile(){this.deletionModal({value:this.form.getValue("erasureProfile"),usage:this.ecpUsage,deletionBtn:this.ecpDeletionBtn,dataName:"erasureInfo",getTabs:()=>this.ecpInfoTabs,tabPosition:"used-by-pools",nameAttribute:"name",itemDescription:"erasure code profile",reloadFn:()=>this.reloadECPs(),deleteFn:e=>this.ecpService.delete(e),taskName:"ecp/delete"})}deletionModal({value:e,usage:t,deletionBtn:i,dataName:a,getTabs:o,tabPosition:s,nameAttribute:c,itemDescription:n,reloadFn:l,deleteFn:r,taskName:b}){if(!e)return;if(t)return i.toggle(),this.data[a]=!0,void setTimeout(()=>{const e=o();e&&e.select(s)},50);const d=e[c];this.modalService.show(y.a,{itemDescription:n,itemNames:[d],submitActionObservable:()=>{const e=r(d);return e.subscribe(()=>l()),this.taskWrapper.wrapTaskAroundCall({task:new T.a(b,{name:d}),call:e})}})}addCrushRule(){this.addModal(ee,e=>this.reloadCrushRules(e))}reloadCrushRules(e){this.reloadList({newItemName:e,getInfo:()=>this.poolService.getInfo(),initInfo:e=>{this.initInfo(e),this.poolTypeChange("replicated")},findNewItem:()=>this.info.crush_rules_replicated.find(t=>t.rule_name===e),controlName:"crushRule"})}deleteCrushRule(){this.deletionModal({value:this.form.getValue("crushRule"),usage:this.crushUsage,deletionBtn:this.crushDeletionBtn,dataName:"crushInfo",getTabs:()=>this.crushInfoTabs,tabPosition:"used-by-pools",nameAttribute:"rule_name",itemDescription:"crush rule",reloadFn:()=>this.reloadCrushRules(),deleteFn:e=>this.crushRuleService.delete(e),taskName:"crushRule/delete"})}crushRuleIsUsedBy(e){this.crushUsage=e?this.info.used_rules[e]:void 0}ecpIsUsedBy(e){this.ecpUsage=e?this.info.used_profiles[e]:void 0}submit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e={pool:this.form.getValue("name")};this.assignFormFields(e,[{externalFieldName:"pool_type",formControlName:"poolType"},{externalFieldName:"pg_autoscale_mode",formControlName:"pgAutoscaleMode",editable:!0},{externalFieldName:"pg_num",formControlName:"pgNum",replaceFn:e=>"on"===this.form.getValue("pgAutoscaleMode")?1:e,editable:!0},this.isReplicated?{externalFieldName:"size",formControlName:"size"}:{externalFieldName:"erasure_code_profile",formControlName:"erasureProfile",attr:"name"},{externalFieldName:"rule_name",formControlName:"crushRule",replaceFn:e=>this.isReplicated?e&&e.rule_name:void 0},{externalFieldName:"quota_max_bytes",formControlName:"max_bytes",replaceFn:this.formatter.toBytes,editable:!0,resetValue:this.editing?0:void 0},{externalFieldName:"quota_max_objects",formControlName:"max_objects",editable:!0,resetValue:this.editing?0:void 0}]),this.info.is_all_bluestore&&(this.assignFormField(e,{externalFieldName:"flags",formControlName:"ecOverwrites",replaceFn:()=>this.isErasure?["ec_overwrites"]:void 0}),"none"!==this.form.getValue("mode")?this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:e=>this.hasCompressionEnabled()&&e},{externalFieldName:"compression_algorithm",formControlName:"algorithm",editable:!0},{externalFieldName:"compression_min_blob_size",formControlName:"minBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_max_blob_size",formControlName:"maxBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_required_ratio",formControlName:"ratio",editable:!0,resetValue:0}]):this.editing&&this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:()=>"unset"},{externalFieldName:"srcpool",formControlName:"name",editable:!0,replaceFn:()=>this.data.pool.pool_name}]));const t=this.data.applications.selected;(t.length>0||this.editing)&&(e.application_metadata=t),this.isReplicated&&!u.a.isEmpty(this.currentConfigurationValues)&&(e.configuration=this.currentConfigurationValues),this.triggerApiTask(e)}assignFormFields(e,t){t.forEach(t=>this.assignFormField(e,t))}assignFormField(e,{externalFieldName:t,formControlName:i,attr:a,replaceFn:o,editable:s,resetValue:c}){if(this.editing&&(!s||this.form.get(i).pristine))return;const n=this.form.getValue(i);let l=o?o(n):a?u.a.get(n,a):n;if(!n||!l){if(!s||u.a.isUndefined(c))return;l=c}e[t]=l}triggerApiTask(e){this.taskWrapper.wrapTaskAroundCall({task:new T.a("pool/"+(this.editing?n.e.EDIT:n.e.CREATE),{pool_name:e.hasOwnProperty("srcpool")?e.srcpool:e.pool}),call:this.poolService[this.editing?n.e.UPDATE:n.e.CREATE](e)}).subscribe({error:e=>{u.a.isObject(e.error)&&"34"===e.error.code&&this.form.get("pgNum").setErrors({34:!0}),this.form.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/pool"])})}appSelection(){this.form.get("name").updateValueAndValidity({emitEvent:!1,onlySelf:!0})}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(w.a),m.Mb(s.a),m.Mb(s.e),m.Mb(E.a),m.Mb(R.a),m.Mb($.a),m.Mb(D.a),m.Mb(k.a),m.Mb(S),m.Mb(h.a),m.Mb(n.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-pool-form"]],viewQuery:function(e,t){var i;1&e&&(m.Tc(it,!0),m.Tc(at,!0),m.Tc(ot,!0),m.Tc(st,!0)),2&e&&(m.zc(i=m.hc())&&(t.crushInfoTabs=i.first),m.zc(i=m.hc())&&(t.crushDeletionBtn=i.first),m.zc(i=m.hc())&&(t.ecpInfoTabs=i.first),m.zc(i=m.hc())&&(t.ecpDeletionBtn=i.first))},features:[m.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],"Name",[1,"cd-col-form-input"],["id","name","name","name","type","text","formControlName","name","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","poolType",1,"cd-col-form-label","required"],"Pool type",["id","poolType","formControlName","poolType","name","poolType",1,"form-control","custom-select"],["ngValue",""],"-- Select a pool type --",[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["for","applications",1,"cd-col-form-label"],"Applications",["id","applications",3,"customBadges","customBadgeValidators","messages","data","options","selectionLimit","selection"],["formGroupName","compression",4,"ngIf"],"Quotas",["for","max_bytes",1,"cd-col-form-label"],"Max bytes","Leave it blank or specify 0 to disable this quota.","A valid quota should be greater than 0.",["id","max_bytes","name","max_bytes","type","text","formControlName","max_bytes","defaultUnit","GiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 10GiB"],["for","max_objects",1,"cd-col-form-label"],"Max objects","Leave it blank or specify 0 to disable this quota.","A valid quota should be greater than 0.",["id","max_objects","min","0","name","max_objects","type","number","formControlName","max_objects",1,"form-control"],[3,"hidden"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The chosen Ceph pool name is already in use.","It's not possible to create an RBD pool with '/' in the name. Please change the name or remove 'rbd' from the applications list.","Pool name can only contain letters, numbers, '.', '-', '_' or '/'.",[3,"value"],"This field is required!",["for","pgAutoscaleMode",1,"cd-col-form-label"],"PG Autoscale",["id","pgAutoscaleMode","name","pgAutoscaleMode","formControlName","pgAutoscaleMode",1,"form-control","custom-select"],["class","form-group row",4,"ngIf"],["for","pgNum",1,"cd-col-form-label","required"],"Placement groups",["id","pgNum","name","pgNum","formControlName","pgNum","min","1","type","number","required","",1,"form-control",3,"focus","blur"],[1,"form-text","text-muted"],["section","pgs",6,"docText"],["docText","Calculation help"],["class","form-text text-muted",4,"ngIf"],"This field is required!","At least one placement group is needed!","Your cluster can't handle this many PGs. Please recalculate the PG amount needed.","The current PGs settings were calculated for you, you should make sure the values suit your needs before submit.",["for","size",1,"cd-col-form-label","required"],"Replicated size",["id","size","name","size","type","number","formControlName","size",1,"form-control",3,"max","min"],["class","text-warning-dark",4,"ngIf"],[1,"list-inline"],"Minimum: " + "\ufffd0\ufffd" + "","Maximum: " + "\ufffd0\ufffd" + "","The size specified is out of range. A value from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + " is usable.",[1,"text-warning-dark"],"A size of 1 will not create a replication of the object. The 'Replicated size' includes the object itself.",[1,"cd-col-form-label"],"Flags",[1,"custom-control","custom-checkbox"],["type","checkbox","id","ec-overwrites","formControlName","ecOverwrites",1,"custom-control-input"],["for","ec-overwrites",1,"custom-control-label"],"EC Overwrites","CRUSH",["for","erasureProfile",1,"cd-col-form-label"],"Erasure code profile",[1,"input-group"],["id","erasureProfile","name","erasureProfile","formControlName","erasureProfile",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"ngClass","click"],["aria-hidden","true",3,"ngClass"],["class","btn btn-light","type","button",3,"click",4,"ngIf"],["class","btn btn-light","type","button","triggers","manual",3,"click",4,"ngIf",6,"ngbTooltip"],["class","form-text text-muted","id","ecp-info-block",4,"ngIf"],"Loading...",[3,"ngValue"],"-- No erasure code profile available --","-- Select an erasure code profile --",["type","button",1,"btn","btn-light",3,"click"],["type","button","triggers","manual",1,"btn","btn-light",3,"click",6,"ngbTooltip"],["ecpDeletionBtn","ngbTooltip"],["ngbTooltip","This profile can't be deleted as it is in use."],["id","ecp-info-block",1,"form-text","text-muted"],["ngbNav","",1,"nav-tabs"],["ecpInfoTabs","ngbNav"],["ngbNavItem","ecp-info"],["ngbNavLink",""],"Profile",["ngbNavContent",""],["ngbNavItem","used-by-pools"],"Used by pools",[3,"ngbNavOutlet"],[3,"renderObjects","hideKeys","data","autoReload"],["ecpIsNotUsed",""],[4,"ngIf","ngIfElse"],"Profile is not in use.",[4,"ngFor","ngForOf"],["for","crushRule",1,"cd-col-form-label"],"Crush ruleset","A new crush ruleset will be implicitly created.","Crush ruleset",["noRules",""],"There are no rules.",["id","crushRule","formControlName","crushRule","name","crushSet",1,"form-control","custom-select"],"-- Select a crush rule --",["id","crush-info-button","type","button",1,"btn","btn-light",3,"ngClass","click",6,"ngbTooltip"],["ngbTooltip","Placement and\n                            replication strategies or distribution policies that allow to\n                            specify how CRUSH places data replicas."],["class","form-text text-muted","id","crush-info-block",4,"ngIf"],["crushDeletionBtn","ngbTooltip"],["ngbTooltip","This rule can't be deleted as it is in use."],["id","crush-info-block",1,"form-text","text-muted"],["crushInfoTabs","ngbNav"],["ngbNavItem","crush-rule-info"],"Crush rule",["ngbNavItem","crush-rule-steps"],"Crush steps","Used by pools",["ruleIsNotUsed",""],"Rule is not in use.","This field is required!","The rule can't be used in the current cluster as it has too few OSDs to meet the minimum required OSD by this rule.",["formGroupName","compression"],"Compression",["for","mode",1,"cd-col-form-label"],"Mode",["id","mode","name","mode","formControlName","mode",1,"form-control","custom-select"],["for","algorithm",1,"cd-col-form-label"],"Algorithm",["id","algorithm","name","algorithm","formControlName","algorithm",1,"form-control","custom-select"],["for","minBlobSize",1,"cd-col-form-label"],"Minimum blob size",["id","minBlobSize","name","minBlobSize","formControlName","minBlobSize","type","text","min","0","defaultUnit","KiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 128KiB"],["for","maxBlobSize",1,"cd-col-form-label"],"Maximum blob size",["id","maxBlobSize","type","text","min","0","formControlName","maxBlobSize","defaultUnit","KiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 512KiB"],["for","ratio",1,"cd-col-form-label"],"Ratio",["id","ratio","name","ratio","formControlName","ratio","type","number","min","0","max","1","step","0.1",1,"form-control",6,"placeholder"],["placeholder","Compression ratio"],"Loading...","-- No erasure compression algorithm available --","Value should be greater than 0","Value should be less than the maximum blob size","Value should be greater than 0","Value should be greater than the minimum blob size","Value should be between 0.0 and 1.0","The value should be greater or equal to 0"]},template:function(e,t){1&e&&m.Mc(0,gi,71,32,"div",0),2&e&&m.pc("cdFormLoading",t.loading)},directives:[Ye.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,o.z,o.u,o.B,a.q,Xe.a,L.a,He.a,o.v,Ze.a,q.a,o.y,et.a,o.b,a.p,c.D,c.p,c.r,c.s,c.q,c.u,tt.a,o.l],pipes:[a.A,B.a],styles:[""]}),e})();var Ri=i("5+tZ"),vi=i("d+Og"),yi=i("MuvH"),zi=i("+fVR"),Ci=i("VxPD"),Ii=i("uIqm"),Ni=i("x38r"),_i=i("yJti"),Mi=i("vCyI"),Ti=i("o4+5"),wi=i("VTlA"),$i=i("EgGo");class Di{constructor(e){this.pool_name=e}}var Ei=i("S7zO"),ki=i("nQ07"),Pi=(i("jKX/"),i("JP8w")),xi=i("insk"),Ai=i("aAWM");function Oi(e,t){if(1&e&&m.Nb(0,"cd-table-key-value",12),2&e){const e=m.ic(2);m.pc("renderObjects",!0)("data",e.poolDetails)("autoReload",!1)}}function Vi(e,t){if(1&e&&m.Nb(0,"cd-grafana",15),2&e){const e=m.ic(3);m.rc("grafanaPath","ceph-pool-detail?var-pool_name=",e.selection.pool_name,"")}}function Wi(e,t){1&e&&(m.Sb(0,"li",13),m.Sb(1,"a",5),m.Wb(2,14),m.Rb(),m.Mc(3,Vi,1,1,"ng-template",7),m.Rb())}function Fi(e,t){if(1&e&&m.Nb(0,"cd-rbd-configuration-table",18),2&e){const e=m.ic(3);m.pc("data",e.selectedPoolConfiguration)}}function Li(e,t){1&e&&(m.Sb(0,"li",16),m.Sb(1,"a",5),m.Wb(2,17),m.Rb(),m.Mc(3,Fi,1,1,"ng-template",7),m.Rb())}function qi(e,t){if(1&e&&m.Nb(0,"cd-table",21),2&e){const e=m.ic(3);m.pc("data",e.cacheTiers)("columns",e.cacheTierColumns)("autoSave",!1)}}function Bi(e,t){1&e&&(m.Sb(0,"li",19),m.Sb(1,"a",5),m.Wb(2,20),m.Rb(),m.Mc(3,qi,1,3,"ng-template",7),m.Rb())}function Ui(e,t){if(1&e&&(m.Qb(0,1),m.Sb(1,"ul",2,3),m.Sb(3,"li",4),m.Sb(4,"a",5),m.Wb(5,6),m.Rb(),m.Mc(6,Oi,1,3,"ng-template",7),m.Rb(),m.Mc(7,Wi,4,0,"li",8),m.Mc(8,Li,4,0,"li",9),m.Mc(9,Bi,4,0,"li",10),m.Rb(),m.Nb(10,"div",11),m.Pb()),2&e){const e=m.Ac(2),t=m.ic();m.yb(7),m.pc("ngIf",t.permissions.grafana.read),m.yb(1),m.pc("ngIf","replicated"===t.selection.type),m.yb(1),m.pc("ngIf",(null==t.selection.tiers?null:t.selection.tiers.length)>0),m.yb(1),m.pc("ngbNavOutlet",e)}}let Gi=(()=>{class e{constructor(e){this.poolService=e,this.cacheTierColumns=[],this.omittedPoolAttributes=["cdExecuting","cdIsBinary","stats"],this.cacheTierColumns=[{prop:"pool_name",name:"Name",flexGrow:3},{prop:"cache_mode",name:"Cache Mode",flexGrow:2},{prop:"cache_min_evict_age",name:"Min Evict Age",flexGrow:2},{prop:"cache_min_flush_age",name:"Min Flush Age",flexGrow:2},{prop:"target_max_bytes",name:"Target Max Bytes",flexGrow:2},{prop:"target_max_objects",name:"Target Max Objects",flexGrow:2}]}ngOnChanges(){this.selection&&(this.poolService.getConfiguration(this.selection.pool_name).subscribe(e=>{ki.a.updateChanged(this,{selectedPoolConfiguration:e})}),ki.a.updateChanged(this,{poolDetails:u.a.omit(this.selection,this.omittedPoolAttributes)}))}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(R.a))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-pool-details"]],inputs:{cacheTiers:"cacheTiers",permissions:"permissions",selection:"selection"},features:[m.wb],decls:1,vars:1,consts:function(){return[["cdTableDetail","",4,"ngIf"],["cdTableDetail",""],["ngbNav","","cdStatefulTab","pool-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","performance-details",4,"ngIf"],["ngbNavItem","configuration",4,"ngIf"],["ngbNavItem","cache-tiers-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"renderObjects","data","autoReload"],["ngbNavItem","performance-details"],"Performance Details",["uid","-xyV8KCiz","grafanaStyle","three",3,"grafanaPath"],["ngbNavItem","configuration"],"Configuration",[3,"data"],["ngbNavItem","cache-tiers-details"],"Cache Tiers Details",["columnMode","flex",3,"data","columns","autoSave"]]},template:function(e,t){1&e&&m.Mc(0,Ui,11,4,"ng-container",0),2&e&&m.pc("ngIf",t.selection)},directives:[a.r,c.p,Pi.a,c.r,c.s,c.q,c.u,tt.a,xi.a,Ai.a,Ii.a],styles:[""],changeDetection:0}),e})();var ji=i("GgAd");const Qi=["poolUsageTpl"],Ji=["poolConfigurationSourceTpl"];function Ki(e,t){if(1&e){const e=m.Tb();m.Sb(0,"cd-table",9,10),m.gc("fetchData",(function(){return m.Dc(e),m.ic().taskListService.fetch()}))("setExpandedRow",(function(t){return m.Dc(e),m.ic().setExpandedRow(t)}))("updateSelection",(function(t){return m.Dc(e),m.ic().updateSelection(t)})),m.Nb(2,"cd-table-actions",11),m.Nb(3,"cd-pool-details",12),m.Rb()}if(2&e){const e=m.ic();m.pc("data",e.pools)("columns",e.columns)("hasDetails",!0)("status",e.tableStatus)("autoReload",-1),m.yb(2),m.pc("permission",e.permissions.pool)("selection",e.selection)("tableActions",e.tableActions),m.yb(1),m.pc("selection",e.expandedRow)("permissions",e.permissions)("cacheTiers",e.cacheTiers)}}function Yi(e,t){1&e&&m.Nb(0,"cd-grafana",14),2&e&&m.pc("grafanaPath","ceph-pools-overview?")}function Xi(e,t){1&e&&(m.Sb(0,"li",2),m.Sb(1,"a",3),m.Wb(2,13),m.Rb(),m.Mc(3,Yi,1,1,"ng-template",5),m.Rb())}function Hi(e,t){if(1&e&&m.Nb(0,"cd-usage-bar",16),2&e){const e=m.ic().row;m.pc("total",e.stats.bytes_used.latest+e.stats.avail_raw.latest)("used",e.stats.bytes_used.latest)}}function Zi(e,t){if(1&e&&m.Mc(0,Hi,1,2,"cd-usage-bar",15),2&e){const e=t.row;m.pc("ngIf",null==e.stats||null==e.stats.avail_raw?null:e.stats.avail_raw.latest)}}let ea=(()=>{class e extends zi.a{constructor(e,t,i,a,o,s,c,n,l,r,b){super(),this.poolService=e,this.taskWrapper=t,this.ecpService=i,this.authStorageService=a,this.taskListService=o,this.modalService=s,this.pgCategoryService=c,this.dimlessPipe=n,this.urlBuilder=l,this.configurationService=r,this.actionLabels=b,this.selection=new Mi.a,this.executingTasks=[],this.tableStatus=new Ci.a,this.cacheTiers=[],this.monAllowPoolDelete=!1,this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{permission:"create",icon:C.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"update",icon:C.a.edit,routerLink:()=>this.urlBuilder.getEdit(encodeURIComponent(this.selection.first().pool_name)),name:this.actionLabels.EDIT},{permission:"delete",icon:C.a.destroy,click:()=>this.deletePoolModal(),name:this.actionLabels.DELETE,disable:this.getDisableDesc.bind(this)}],this.permissions.configOpt.read&&this.configurationService.get("mon_allow_pool_delete").subscribe(e=>{if(u.a.has(e,"value")){const t=u.a.find(e.value,e=>"mon"===e.section)||{value:!1};this.monAllowPoolDelete="true"===t.value}})}ngOnInit(){const e=(e,t,i)=>u.a.get(t,e)>u.a.get(i,e)?1:-1;this.columns=[{prop:"pool_name",name:"Name",flexGrow:4,cellTransformation:Ni.a.executing},{prop:"data_protection",name:"Data Protection",cellTransformation:Ni.a.badge,customTemplateConfig:{class:"badge-background-gray"},flexGrow:1.3},{prop:"application_metadata",name:"Applications",cellTransformation:Ni.a.badge,customTemplateConfig:{class:"badge-background-primary"},flexGrow:1.5},{prop:"pg_status",name:"PG Status",flexGrow:1.2,cellClass:({row:e,column:t,value:i})=>this.getPgStatusCellClass(e,t,i)},{prop:"crush_rule",name:"Crush Ruleset",isHidden:!0,flexGrow:2},{name:"Usage",prop:"usage",cellTemplate:this.poolUsageTpl,flexGrow:1.2},{prop:"stats.rd_bytes.rates",name:"Read bytes",comparator:(t,i,a,o)=>e("stats.rd_bytes.latest",a,o),cellTransformation:Ni.a.sparkline,flexGrow:1.5},{prop:"stats.wr_bytes.rates",name:"Write bytes",comparator:(t,i,a,o)=>e("stats.wr_bytes.latest",a,o),cellTransformation:Ni.a.sparkline,flexGrow:1.5},{prop:"stats.rd.rate",name:"Read ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Ni.a.perSecond},{prop:"stats.wr.rate",name:"Write ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Ni.a.perSecond}],this.taskListService.init(()=>this.ecpService.list().pipe(Object(Ri.a)(e=>(this.ecProfileList=e,this.poolService.getList()))),void 0,e=>{this.pools=this.transformPoolsData(e),this.tableStatus=new Ci.a},()=>{this.table.reset(),this.tableStatus=new Ci.a(_i.a.ValueException)},e=>e.name.startsWith("pool/"),(e,t)=>t.metadata.pool_name===e.pool_name,{default:e=>new Di(e.pool_name)})}updateSelection(e){this.selection=e}deletePoolModal(){const e=this.selection.first().pool_name;this.modalService.show(y.a,{itemDescription:"Pool",itemNames:[e],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new T.a("pool/"+n.e.DELETE,{pool_name:e}),call:this.poolService.delete(e)})})}getPgStatusCellClass(e,t,i){return{"text-right":!0,["pg-"+this.pgCategoryService.getTypeByStates(i)]:!0}}getErasureCodeProfile(e){let t="";return u.a.forEach(this.ecProfileList,i=>{i.name===e&&(t=`EC: ${i.k}+${i.m}`)}),t}transformPoolsData(e){const t=["bytes_used","max_avail","avail_raw","percent_used","rd_bytes","wr_bytes","rd","wr"],i={latest:0,rate:0,rates:[]};return u.a.forEach(e,e=>{e.pg_status=this.transformPgStatus(e.pg_status);const a={};u.a.forEach(t,t=>{a[t]=e.stats&&e.stats[t]?e.stats[t]:i}),e.stats=a,e.usage=a.percent_used.latest,e.cdExecuting||e.pg_num+e.pg_placement_num===e.pg_num_target+e.pg_placement_num_target||(e.cdExecuting="Updating"),["rd_bytes","wr_bytes"].forEach(t=>{e.stats[t].rates=e.stats[t].rates.map(e=>e[1])}),e.cdIsBinary=!0,"erasure"===e.type&&(e.data_protection=this.getErasureCodeProfile(e.erasure_code_profile)),"replicated"===e.type&&(e.data_protection="replica: \xd7"+e.size)}),e}transformPgStatus(e){const t=[];return u.a.forEach(e,(e,i)=>{t.push(`${e} ${i}`)}),t.join(", ")}getSelectionTiers(){if(void 0!==this.expandedRow){const e=this.expandedRow.tiers;this.cacheTiers=this.pools.filter(t=>e.includes(t.pool))}}getDisableDesc(){var e;return!(null===(e=this.selection)||void 0===e?void 0:e.hasSelection)||!this.monAllowPoolDelete&&"Pool deletion is disabled by the mon_allow_pool_delete configuration setting."}setExpandedRow(e){super.setExpandedRow(e),this.getSelectionTiers()}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(R.a),m.Mb(k.a),m.Mb(S),m.Mb($.a),m.Mb(wi.a),m.Mb(E.a),m.Mb(vi.a),m.Mb(Ti.a),m.Mb($i.a),m.Mb(yi.a),m.Mb(n.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-pool-list"]],viewQuery:function(e,t){var i;1&e&&(m.Tc(Ii.a,!0),m.Jc(Qi,!0),m.Tc(Ji,!0)),2&e&&(m.zc(i=m.hc())&&(t.table=i.first),m.zc(i=m.hc())&&(t.poolUsageTpl=i.first),m.zc(i=m.hc())&&(t.poolConfigurationSourceTpl=i.first))},features:[m.xb([wi.a,{provide:$i.a,useValue:new $i.a("pool")}]),m.vb],decls:10,vars:2,consts:function(){return[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],"Pools List",["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["poolUsageTpl",""],["id","pool-list","selectionType","single",3,"data","columns","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],["id","pool-list-actions",1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","","id","pool-list-details",3,"selection","permissions","cacheTiers"],"Overall Performance",["uid","z99hzWtmk","grafanaStyle","two",3,"grafanaPath"],["decimals","2",3,"total","used",4,"ngIf"],["decimals","2",3,"total","used"]]},template:function(e,t){if(1&e&&(m.Sb(0,"ul",0,1),m.Sb(2,"li",2),m.Sb(3,"a",3),m.Wb(4,4),m.Rb(),m.Mc(5,Ki,4,11,"ng-template",5),m.Rb(),m.Mc(6,Xi,4,0,"li",6),m.Rb(),m.Nb(7,"div",7),m.Mc(8,Zi,1,1,"ng-template",null,8,m.Nc)),2&e){const e=m.Ac(1);m.yb(6),m.pc("ngIf",t.permissions.grafana.read),m.yb(1),m.pc("ngbNavOutlet",e)}},directives:[c.p,c.r,c.s,c.q,a.r,c.u,Ii.a,Ei.a,Gi,xi.a,ji.a],styles:["cd-pool-list .pg-clean{color:#0b0}  cd-pool-list .pg-working{color:#2b99a8}  cd-pool-list .pg-warning{color:#ffc200}  cd-pool-list .pg-unknown{color:#ef5c55}"]}),e})(),ta=(()=>{class e{}return e.\u0275mod=m.Kb({type:e}),e.\u0275inj=m.Jb({factory:function(t){return new(t||e)},imports:[[b.a,a.c,c.t,l.a,s.i,o.x,c.F,r.BlockModule]]}),e})();const ia=[{path:"",component:ea},{path:n.e.CREATE,component:Si,data:{breadcrumbs:n.a.CREATE}},{path:n.e.EDIT+"/:name",component:Si,data:{breadcrumbs:n.a.EDIT}}];let aa=(()=>{class e{}return e.\u0275mod=m.Kb({type:e}),e.\u0275inj=m.Jb({factory:function(t){return new(t||e)},imports:[[ta,s.i.forChild(ia)]]}),e})()}}]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.f6931a7617fe7f8fd244.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.f6931a7617fe7f8fd244.js
new file mode 100644 (file)
index 0000000..94fe9fa
--- /dev/null
@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"5azF":function(e,t,i){"use strict";i.r(t),i.d(t,"PoolModule",function(){return ta}),i.d(t,"RoutedPoolModule",function(){return aa});var a=i("SVse"),o=i("s7LF"),c=i("iInd"),s=i("G0yt"),n=i("sne2"),l=i("PCNd"),r=i("k/xb"),b=i("kJI8"),u=i("LvDl"),d=i.n(u),f=i("jtHE"),m=i("WE5d"),h=i("st4c"),p=i("8Y7J"),g=i("IheW");let v=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/erasure_code_profile",this.formTooltips={k:"Each object is split in data-chunks parts, each stored on a different OSD.",m:"Compute coding chunks for each object and store them on different OSDs.\n      The number of coding chunks is also the number of OSDs that can be down without losing data.",plugins:{jerasure:{description:"The jerasure plugin is the most generic and flexible plugin,\n          it is also the default for Ceph erasure coded pools.",technique:"The more flexible technique is reed_sol_van : it is enough to set k\n          and m. The cauchy_good technique can be faster but you need to chose the packetsize\n          carefully. All of reed_sol_r6_op, liberation, blaum_roth, liber8tion are RAID6 equivalents\n          in the sense that they can only be configured with m=2.",packetSize:"The encoding will be done on packets of bytes size at a time.\n          Choosing the right packet size is difficult.\n          The jerasure documentation contains extensive information on this topic."},lrc:{description:"With the jerasure plugin, when an erasure coded object is stored on\n          multiple OSDs, recovering from the loss of one OSD requires reading from all the others.\n          For instance if jerasure is configured with k=8 and m=4, losing one OSD requires reading\n          from the eleven others to repair.\n\n          The lrc erasure code plugin creates local parity chunks to be able to recover using\n          less OSDs. For instance if lrc is configured with k=8, m=4 and l=4, it will create\n          an additional parity chunk for every four OSDs. When a single OSD is lost, it can be\n          recovered with only four OSDs instead of eleven.",l:"Group the coding and data chunks into sets of size locality. For instance,\n          for k=4 and m=2, when locality=3 two groups of three are created. Each set can\n          be recovered without reading chunks from another set.",crushLocality:"The type of the crush bucket in which each set of chunks defined\n          by l will be stored. For instance, if it is set to rack, each group of l chunks will be\n          placed in a different rack. It is used to create a CRUSH rule step such as step choose\n          rack. If it is not set, no such grouping is done."},isa:{description:"The isa plugin encapsulates the ISA library. It only runs on Intel processors.",technique:"The ISA plugin comes in two Reed Solomon forms.\n          If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy."},shec:{description:"The shec plugin encapsulates the multiple SHEC library.\n          It allows ceph to recover data more efficiently than Reed Solomon codes.",c:"The number of parity chunks each of which includes each data chunk in its\n          calculation range. The number is used as a durability estimator. For instance, if c=2,\n          2 OSDs can be down without losing data."},clay:{description:"CLAY (short for coupled-layer) codes are erasure codes designed to\n          bring about significant savings in terms of network bandwidth and disk IO when a failed\n          node/OSD/rack is being repaired.",d:"Number of OSDs requested to send data during recovery of a single chunk.\n          d needs to be chosen such that k+1 <= d <= k+m-1. The larger the d, the better\n          the savings.",scalar_mds:"scalar_mds specifies the plugin that is used as a building block\n          in the layered construction. It can be one of jerasure, isa, shec.",technique:"technique specifies the technique that will be picked\n          within the 'scalar_mds' plugin specified. Supported techniques\n          are 'reed_sol_van', 'reed_sol_r6_op', 'cauchy_orig',\n          'cauchy_good', 'liber8tion' for jerasure, 'reed_sol_van',\n          'cauchy' for isa and 'single', 'multiple' for shec."}},crushRoot:"The name of the crush bucket used for the first step of the CRUSH rule.\n      For instance step take default.",crushFailureDomain:"Ensure that no two chunks are in a bucket with the same failure\n      domain. For instance, if the failure domain is host no two chunks will be stored on the same\n      host. It is used to create a CRUSH rule step such as step chooseleaf host.",crushDeviceClass:"Restrict placement to devices of a specific class\n      (e.g., ssd or hdd), using the crush device class names in the CRUSH map.",directory:"Set the directory name from which the erasure code plugin is loaded."}}list(){return this.http.get(this.apiPath)}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(p.ic(g.b))},e.\u0275prov=p.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var D=i("Ekvf");class W{constructor(){this.nodes=[],this.idTree={},this.allDevices=[],this.buckets=[],this.failureDomains={},this.failureDomainKeys=[],this.devices=[],this.deviceCount=0}static searchFailureDomains(e,t){return this.getFailureDomains(this.search(e,t))}static search(e,t){const[i,a]=t.split("~"),o=e.find(e=>["name","id","type"].some(t=>e[t]===i));return o?(e=this.getSubNodes(o,this.createIdTreeFromNodes(e)),a&&(e=this.filterNodesByDeviceType(e,a)),e):[]}static createIdTreeFromNodes(e){const t={};return e.forEach(e=>{t[e.id]=e}),t}static getSubNodes(e,t){let i=[e];return e.children?(e.children.forEach(e=>{i=i.concat(this.getSubNodes(t[e],t))}),i):i}static filterNodesByDeviceType(e,t){let i,a=e.filter(e=>e.device_class&&e.device_class!==t).map(e=>e.id),o=a;do{i=!1,e=e.filter(e=>!a.includes(e.id));const t=[];e.forEach(e=>{e.children&&e.children.every(e=>a.includes(e))&&(t.push(e.id),i=!0)}),i&&(a=t,o=o.concat(t))}while(i);return(e=d.a.cloneDeep(e)).map(e=>e.children?(e.children=e.children.filter(e=>!o.includes(e)),e):e)}static getFailureDomains(e){const t={};return e.forEach(e=>{const i=e.type;t[i]||(t[i]=[]),t[i].push(e)}),t}initCrushNodeSelection(e,t,i,a){this.nodes=e,this.idTree=W.createIdTreeFromNodes(e),e.forEach(e=>{this.idTree[e.id]=e}),this.buckets=d.a.sortBy(e.filter(e=>e.children),"name"),this.controls={root:t,failure:i,device:a},this.preSelectRoot(),this.controls.root.valueChanges.subscribe(()=>this.onRootChange()),this.controls.failure.valueChanges.subscribe(()=>this.onFailureDomainChange()),this.controls.device.valueChanges.subscribe(()=>this.onDeviceChange())}preSelectRoot(){const e=this.nodes.find(e=>"root"===e.type);this.silentSet(this.controls.root,e),this.onRootChange()}silentSet(e,t){e.setValue(t,{emitEvent:!1})}onRootChange(){const e=W.getSubNodes(this.controls.root.value,this.idTree),t=W.getFailureDomains(e);Object.keys(t).forEach(e=>{t[e].length<=1&&delete t[e]}),this.failureDomains=t,this.failureDomainKeys=Object.keys(t).sort(),this.updateFailureDomain()}updateFailureDomain(){let e=this.getIncludedCustomValue(this.controls.failure,Object.keys(this.failureDomains));""===e&&(e=this.setMostCommonDomain(this.controls.failure)),this.updateDevices(e)}getIncludedCustomValue(e,t){return e.dirty&&t.includes(e.value)?e.value:""}setMostCommonDomain(e){let t={n:0,type:""};return Object.keys(this.failureDomains).forEach(e=>{const i=this.failureDomains[e].length;t.n<i&&(t={n:i,type:e})}),this.silentSet(e,t.type),t.type}onFailureDomainChange(){this.updateDevices()}updateDevices(e=this.controls.failure.value){const t=d.a.flatten(this.failureDomains[e].map(e=>W.getSubNodes(e,this.idTree)));this.allDevices=t.filter(e=>e.device_class).map(e=>e.device_class),this.devices=d.a.uniq(this.allDevices).sort();const i=1===this.devices.length?this.devices[0]:this.getIncludedCustomValue(this.controls.device,this.devices);this.silentSet(this.controls.device,i),this.onDeviceChange(i)}onDeviceChange(e=this.controls.device.value){this.deviceCount=""===e?this.allDevices.length:this.allDevices.filter(t=>t===e).length}}var I=i("0+/T"),z=i("a96k"),P=i("oxzT"),C=i("spCT"),X=i("QFaf"),S=i("1Ni5"),y=i("PhyI"),_=i("kvvV"),N=i("Fgil"),$=i("aexS"),T=i("aXbf"),w=i("JK/P"),E=i("kn/O"),R=i("2EZI"),k=i("ajRT"),x=i("NwgZ"),A=i("ocLN"),V=i("ANnk"),F=i("f69J"),O=i("IZUe"),L=i("p4Cf"),q=i("6+kj"),M=i("8xTl");function B(e,t){1&e&&(p.Xb(0,"span",30),p.bc(1,31),p.Wb())}function U(e,t){1&e&&(p.Xb(0,"span",30),p.bc(1,32),p.Wb())}function G(e,t){1&e&&(p.Xb(0,"span",30),p.bc(1,33),p.Wb())}function j(e,t){1&e&&(p.Xb(0,"option",26),p.bc(1,34),p.Wb())}function J(e,t){if(1&e&&(p.Xb(0,"option",35),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e.name," ")}}function K(e,t){1&e&&(p.Xb(0,"span",30),p.bc(1,36),p.Wb())}function Y(e,t){1&e&&(p.Xb(0,"option",26),p.bc(1,37),p.Wb())}function H(e,t){if(1&e&&(p.Xb(0,"option",35),p.Rc(1),p.Wb()),2&e){const e=t.$implicit,i=p.nc();p.uc("ngValue",e),p.Db(1),p.Uc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function Q(e,t){1&e&&(p.Xb(0,"span",30),p.bc(1,38),p.Wb())}function Z(e,t){if(1&e&&(p.Xb(0,"option",35),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e," ")}}let ee=(()=>{class e extends W{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.crushRuleService=a,this.actionLabels=o,this.submitAction=new p.p,this.tooltips=this.crushRuleService.formTooltips,this.action=this.actionLabels.CREATE,this.resource="Crush Rule",this.createForm()}createForm(){this.form=this.formBuilder.group({name:["",[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),S.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],root:null,failure_domain:"",device_class:""})}ngOnInit(){this.crushRuleService.getInfo().subscribe(({names:e,nodes:t})=>{this.initCrushNodeSelection(t,this.form.get("root"),this.form.get("failure_domain"),this.form.get("device_class")),this.names=e})}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=d.a.cloneDeep(this.form.value);e.root=e.root.name,""===e.device_class&&delete e.device_class,this.taskWrapper.wrapTaskAroundCall({task:new _.a("crushRule/create",e),call:this.crushRuleService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}}return e.\u0275fac=function(t){return new(t||e)(p.Rb(R.a),p.Rb(s.a),p.Rb(E.a),p.Rb(h.a),p.Rb(n.b))},e.\u0275cmp=p.Lb({type:e,selectors:[["cd-crush-rule-form-modal"]],outputs:{submitAction:"submitAction"},features:[p.Ab],decls:55,vars:27,consts:function(){let e,t,i,a,o,c,s,n,l,r,b,u,d;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",i="Root",a="Failure domain type",o="Device class",c="Let Ceph decide",s="This field is required!",n="The name can only consist of alphanumeric characters, dashes and underscores.",l="The chosen erasure code profile name is already in use.",r="Loading...",b="This field is required!",u="Loading...",d="This field is required!",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],t,[1,"required"],[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","root",1,"cd-col-form-label"],i,[3,"html"],["id","root","name","root","formControlName","root",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","failure_domain",1,"cd-col-form-label"],a,["id","failure_domain","name","failure_domain","formControlName","failure_domain",1,"form-control","custom-select"],["for","device_class",1,"cd-col-form-label"],o,["id","device_class","name","device_class","formControlName","device_class",1,"form-control","custom-select"],["ngValue",""],c,[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],s,n,l,r,[3,"ngValue"],b,u,d]},template:function(e,t){if(1&e&&(p.Xb(0,"cd-modal",0),p.Vb(1,1),p.bc(2,2),p.oc(3,"titlecase"),p.oc(4,"upperFirst"),p.Ub(),p.Vb(5,3),p.Xb(6,"form",4,5),p.Xb(8,"div",6),p.Xb(9,"div",7),p.Xb(10,"label",8),p.Vb(11),p.bc(12,9),p.Ub(),p.Sb(13,"span",10),p.Wb(),p.Xb(14,"div",11),p.Sb(15,"input",12),p.Pc(16,B,2,0,"span",13),p.Pc(17,U,2,0,"span",13),p.Pc(18,G,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(19,"div",7),p.Xb(20,"label",14),p.Vb(21),p.bc(22,15),p.Ub(),p.Sb(23,"cd-helper",16),p.Sb(24,"span",10),p.Wb(),p.Xb(25,"div",11),p.Xb(26,"select",17),p.Pc(27,j,2,0,"option",18),p.Pc(28,J,2,2,"option",19),p.Wb(),p.Pc(29,K,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(30,"div",7),p.Xb(31,"label",20),p.Vb(32),p.bc(33,21),p.Ub(),p.Sb(34,"cd-helper",16),p.Sb(35,"span",10),p.Wb(),p.Xb(36,"div",11),p.Xb(37,"select",22),p.Pc(38,Y,2,0,"option",18),p.Pc(39,H,2,3,"option",19),p.Wb(),p.Pc(40,Q,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(41,"div",7),p.Xb(42,"label",23),p.Vb(43),p.bc(44,24),p.Ub(),p.Sb(45,"cd-helper",16),p.Wb(),p.Xb(46,"div",11),p.Xb(47,"select",25),p.Xb(48,"option",26),p.bc(49,27),p.Wb(),p.Pc(50,Z,2,2,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Wb(),p.Xb(51,"div",28),p.Xb(52,"cd-form-button-panel",29),p.lc("submitActionEvent",function(){return t.onSubmit()}),p.oc(53,"titlecase"),p.oc(54,"upperFirst"),p.Wb(),p.Wb(),p.Wb(),p.Ub(),p.Wb()),2&e){const e=p.Fc(7);p.uc("modalRef",t.activeModal),p.Db(4),p.fc(p.pc(3,19,t.action))(p.pc(4,21,t.resource)),p.cc(2),p.Db(2),p.uc("formGroup",t.form),p.Db(10),p.uc("ngIf",t.form.showError("name",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"pattern")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"uniqueName")),p.Db(5),p.uc("html",t.tooltips.root),p.Db(4),p.uc("ngIf",!t.buckets),p.Db(1),p.uc("ngForOf",t.buckets),p.Db(1),p.uc("ngIf",t.form.showError("root",e,"required")),p.Db(5),p.uc("html",t.tooltips.failure_domain),p.Db(4),p.uc("ngIf",!t.failureDomains),p.Db(1),p.uc("ngForOf",t.failureDomainKeys),p.Db(1),p.uc("ngIf",t.form.showError("failure_domain",e,"required")),p.Db(5),p.uc("html",t.tooltips.device_class),p.Db(5),p.uc("ngForOf",t.devices),p.Db(2),p.uc("form",t.form)("submitText",p.pc(53,23,t.action)+" "+p.pc(54,25,t.resource))}},directives:[k.a,o.B,o.r,x.a,o.k,A.a,V.a,o.d,F.a,o.q,o.i,O.a,a.r,L.a,o.z,a.q,o.u,o.C,q.a],pipes:[a.A,M.a],styles:[""]}),e})();class te{}function ie(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,47),p.Wb())}function ae(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,48),p.Wb())}function oe(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,49),p.Wb())}function ce(e,t){1&e&&(p.Xb(0,"option",37),p.bc(1,50),p.Wb())}function se(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e," ")}}function ne(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,52),p.Wb())}function le(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,53),p.Wb())}function re(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,54),p.Wb())}function be(e,t){if(1&e&&(p.Xb(0,"span",46),p.bc(1,55),p.Wb()),2&e){const e=p.nc();p.Db(1),p.fc(e.deviceCount),p.cc(1)}}function ue(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,56),p.Wb())}function de(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,57),p.Wb())}function fe(e,t){if(1&e&&(p.Xb(0,"span",39),p.bc(1,58),p.Wb()),2&e){const e=p.nc();p.Db(1),p.fc(e.lrcMultiK),p.cc(1)}}function me(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,59),p.Wb())}function he(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,60),p.Wb())}function pe(e,t){if(1&e&&(p.Xb(0,"span",46),p.bc(1,61),p.Wb()),2&e){const e=p.nc();p.Db(1),p.fc(e.deviceCount),p.cc(1)}}function ge(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,65),p.Wb())}function ve(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,66),p.Wb())}function De(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",62),p.Xb(2,"span",14),p.bc(3,63),p.Wb(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Sb(6,"input",64),p.Pc(7,ge,2,0,"span",12),p.Pc(8,ve,2,0,"span",12),p.Wb(),p.Wb()),2&e){const e=p.nc(),t=p.Fc(7);p.Db(4),p.uc("html",e.tooltips.plugins.shec.c),p.Db(3),p.uc("ngIf",e.form.showError("c",t,"min")),p.Db(1),p.uc("ngIf",e.form.showError("c",t,"cGreaterM"))}}function We(e,t){1&e&&(p.Xb(0,"span",39),p.bc(1,75),p.Wb())}function Ie(e,t){if(1&e&&(p.Xb(0,"span",39),p.bc(1,76),p.Wb()),2&e){const e=p.nc(3);p.Db(1),p.fc(e.getDMin())(e.getDMax()),p.cc(1)}}function ze(e,t){if(1&e&&(p.Xb(0,"span",39),p.bc(1,77),p.Wb()),2&e){const e=p.nc(3);p.Db(1),p.fc(e.getDMax()),p.cc(1)}}function Pe(e,t){if(1&e&&(p.Vb(0),p.Pc(1,Ie,2,2,"span",23),p.Pc(2,ze,2,1,"span",23),p.Ub()),2&e){const e=p.nc(2);p.Db(1),p.uc("ngIf",e.getDMin()<e.getDMax()),p.Db(1),p.uc("ngIf",e.getDMin()===e.getDMax())}}function Ce(e,t){if(1&e&&(p.Xb(0,"span",46),p.bc(1,78),p.Wb()),2&e){const e=p.nc(2);p.Db(1),p.fc(e.getDMin()),p.cc(1)}}function Xe(e,t){if(1&e&&(p.Xb(0,"span",46),p.bc(1,79),p.Wb()),2&e){const e=p.nc(2);p.Db(1),p.fc(e.getDMax()),p.cc(1)}}function Se(e,t){if(1&e){const e=p.Yb();p.Xb(0,"div",7),p.Xb(1,"label",67),p.Xb(2,"span",14),p.bc(3,68),p.Wb(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Xb(6,"div",69),p.Sb(7,"input",70),p.Xb(8,"span",71),p.Xb(9,"button",72),p.lc("click",function(){return p.Ic(e),p.nc().toggleDCalc()}),p.Sb(10,"i",73),p.Wb(),p.Wb(),p.Wb(),p.Pc(11,We,2,0,"span",23),p.Pc(12,Pe,3,2,"ng-container",74),p.Pc(13,Ce,2,1,"span",12),p.Pc(14,Xe,2,1,"span",12),p.Wb(),p.Wb()}if(2&e){const e=p.nc(),t=p.Fc(7);p.Db(4),p.uc("html",e.tooltips.plugins.clay.d),p.Db(6),p.uc("ngClass",e.dCalc?e.icons.unlock:e.icons.lock),p.Db(1),p.uc("ngIf",e.dCalc),p.Db(1),p.uc("ngIf",!e.dCalc),p.Db(1),p.uc("ngIf",e.form.showError("d",t,"dMin")),p.Db(1),p.uc("ngIf",e.form.showError("d",t,"dMax"))}}function ye(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,84),p.Wb())}function _e(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,85),p.Wb())}function Ne(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,86),p.Wb())}function $e(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",80),p.Xb(2,"span",14),p.bc(3,81),p.Wb(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Sb(6,"input",82),p.Pc(7,ye,2,0,"span",12),p.Pc(8,_e,2,0,"span",12),p.Pc(9,Ne,2,0,"span",12),p.Xb(10,"span",39),p.bc(11,83),p.Wb(),p.Wb(),p.Wb()),2&e){const e=p.nc(),t=p.Fc(7);p.Db(4),p.uc("html",e.tooltips.plugins.lrc.l),p.Db(3),p.uc("ngIf",e.form.showError("l",t,"required")),p.Db(1),p.uc("ngIf",e.form.showError("l",t,"min")),p.Db(1),p.uc("ngIf",e.form.showError("l",t,"unequal")),p.Db(2),p.fc(e.lrcGroups),p.cc(11)}}function Te(e,t){1&e&&(p.Xb(0,"option",37),p.bc(1,87),p.Wb())}function we(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit,i=p.nc();p.uc("ngValue",e),p.Db(1),p.Uc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function Ee(e,t){1&e&&(p.Xb(0,"option",37),p.bc(1,91),p.Wb())}function Re(e,t){1&e&&(p.Xb(0,"option",37),p.bc(1,92),p.Wb())}function ke(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit,i=p.nc(2);p.uc("ngValue",e),p.Db(1),p.Uc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function xe(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",88),p.Vb(2),p.bc(3,89),p.Ub(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Xb(6,"select",90),p.Pc(7,Ee,2,0,"option",18),p.Pc(8,Re,2,0,"option",18),p.Pc(9,ke,2,3,"option",19),p.Wb(),p.Wb(),p.Wb()),2&e){const e=p.nc();p.Db(4),p.uc("html",e.tooltips.plugins.lrc.crushLocality),p.Db(3),p.uc("ngIf",!e.failureDomains),p.Db(1),p.uc("ngIf",e.failureDomainKeys.length>0),p.Db(1),p.uc("ngForOf",e.failureDomainKeys)}}function Ae(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e," ")}}const Ve=function(e,t,i){return[e,t,i]};function Fe(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",93),p.Vb(2),p.bc(3,94),p.Ub(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Xb(6,"select",95),p.Pc(7,Ae,2,2,"option",19),p.Wb(),p.Wb(),p.Wb()),2&e){const e=p.nc();p.Db(4),p.uc("html",e.tooltips.plugins.clay.scalar_mds),p.Db(3),p.uc("ngForOf",p.Bc(2,Ve,e.PLUGIN.JERASURE,e.PLUGIN.ISA,e.PLUGIN.SHEC))}}function Oe(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e," ")}}function Le(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",96),p.Vb(2),p.bc(3,97),p.Ub(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Xb(6,"select",98),p.Pc(7,Oe,2,2,"option",19),p.Wb(),p.Wb(),p.Wb()),2&e){const e=p.nc();p.Db(4),p.uc("html",e.tooltips.plugins[e.plugin].technique),p.Db(3),p.uc("ngForOf",e.techniques)}}function qe(e,t){1&e&&(p.Xb(0,"span",46),p.bc(1,102),p.Wb())}function Me(e,t){if(1&e&&(p.Xb(0,"div",7),p.Xb(1,"label",99),p.Vb(2),p.bc(3,100),p.Ub(),p.Sb(4,"cd-helper",16),p.Wb(),p.Xb(5,"div",10),p.Sb(6,"input",101),p.Pc(7,qe,2,0,"span",12),p.Wb(),p.Wb()),2&e){const e=p.nc(),t=p.Fc(7);p.Db(4),p.uc("html",e.tooltips.plugins.jerasure.packetSize),p.Db(3),p.uc("ngIf",e.form.showError("packetSize",t,"min"))}}function Be(e,t){1&e&&(p.Xb(0,"option",37),p.bc(1,103),p.Wb())}function Ue(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e.name," ")}}function Ge(e,t){if(1&e&&(p.Xb(0,"option",51),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e," ")}}let je=(()=>{class e extends W{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.ecpService=a,this.actionLabels=o,this.submitAction=new p.p,this.tooltips=this.ecpService.formTooltips,this.PLUGIN={LRC:"lrc",SHEC:"shec",CLAY:"clay",JERASURE:"jerasure",ISA:"isa"},this.plugin=this.PLUGIN.JERASURE,this.icons=P.a,this.action=this.actionLabels.CREATE,this.resource="EC Profile",this.createForm(),this.setJerasureDefaults()}createForm(){this.form=this.formBuilder.group({name:[null,[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),S.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],plugin:[this.PLUGIN.JERASURE,[o.A.required]],k:[4,[o.A.required,o.A.min(2),S.a.custom("max",()=>this.baseValueValidation(!0)),S.a.custom("unequal",e=>this.lrcDataValidation(e)),S.a.custom("kLowerM",e=>this.shecDataValidation(e))]],m:[2,[o.A.required,o.A.min(1),S.a.custom("max",()=>this.baseValueValidation())]],crushFailureDomain:"",crushRoot:null,crushDeviceClass:"",directory:"",technique:"reed_sol_van",packetSize:[2048,[o.A.min(1)]],l:[3,[o.A.required,o.A.min(1),S.a.custom("unequal",e=>this.lrcLocalityValidation(e))]],crushLocality:"",c:[2,[o.A.required,o.A.min(1),S.a.custom("cGreaterM",e=>this.shecDurabilityValidation(e))]],d:[5,[o.A.required,S.a.custom("dMin",e=>this.dMinValidation(e)),S.a.custom("dMax",e=>this.dMaxValidation(e))]],scalar_mds:[this.PLUGIN.JERASURE,[o.A.required]]}),this.toggleDCalc(),this.form.get("k").valueChanges.subscribe(()=>this.updateValidityOnChange(["m","l","d"])),this.form.get("m").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","l","c","d"])),this.form.get("l").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","m"])),this.form.get("plugin").valueChanges.subscribe(e=>this.onPluginChange(e)),this.form.get("scalar_mds").valueChanges.subscribe(()=>this.setClayDefaultsForScalar())}baseValueValidation(e=!1){return this.validValidation(()=>this.getKMSum()>this.deviceCount&&this.form.getValue("k")>this.form.getValue("m")===e)}validValidation(e,t){return!((!this.form||t)&&this.plugin!==t)&&e()}getKMSum(){return this.form.getValue("k")+this.form.getValue("m")}lrcDataValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m"),i=this.form.getValue("l"),a=e+t;return this.lrcMultiK=e/(a/i),e%(a/i)!=0},"lrc")}shecDataValidation(e){return this.validValidation(()=>this.form.getValue("m")>e,"shec")}lrcLocalityValidation(e){return this.validValidation(()=>{const t=this.getKMSum();return this.lrcGroups=e>0?t/e:0,e>0&&t%e!=0},"lrc")}shecDurabilityValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m");return e>t},"shec")}dMinValidation(e){return this.validValidation(()=>this.getDMin()>e,"clay")}getDMin(){return this.form.getValue("k")+1}dMaxValidation(e){return this.validValidation(()=>e>this.getDMax(),"clay")}getDMax(){const e=this.form.getValue("m");return this.form.getValue("k")+e-1}toggleDCalc(){this.dCalc=!this.dCalc,this.form.get("d")[this.dCalc?"disable":"enable"](),this.calculateD()}calculateD(){this.plugin===this.PLUGIN.CLAY&&this.dCalc&&this.form.silentSet("d",this.getDMax())}updateValidityOnChange(e){e.forEach(e=>{"d"===e&&this.calculateD(),this.form.get(e).updateValueAndValidity({emitEvent:!1})})}onPluginChange(e){this.plugin=e,e===this.PLUGIN.JERASURE?this.setJerasureDefaults():e===this.PLUGIN.LRC?this.setLrcDefaults():e===this.PLUGIN.ISA?this.setIsaDefaults():e===this.PLUGIN.SHEC?this.setShecDefaults():e===this.PLUGIN.CLAY&&this.setClayDefaults(),this.updateValidityOnChange(["m"])}setJerasureDefaults(){this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liberation","blaum_roth","liber8tion"],this.setDefaults({k:4,m:2,technique:"reed_sol_van"})}setLrcDefaults(){this.setDefaults({k:4,m:2,l:3})}setIsaDefaults(){this.techniques=["reed_sol_van","cauchy"],this.setDefaults({k:7,m:3,technique:"reed_sol_van"})}setShecDefaults(){this.setDefaults({k:4,m:3,c:2})}setClayDefaults(){this.setDefaults({k:4,m:2,scalar_mds:this.PLUGIN.JERASURE}),this.setClayDefaultsForScalar()}setClayDefaultsForScalar(){const e=this.form.getValue("scalar_mds");let t="reed_sol_van";e===this.PLUGIN.JERASURE?this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liber8tion"]:e===this.PLUGIN.ISA?this.techniques=["reed_sol_van","cauchy"]:(t="single",this.techniques=["single","multiple"]),this.setDefaults({technique:t})}setDefaults(e){Object.keys(e).forEach(t=>{const i=this.form.get(t),a=i.value;i.pristine||"technique"===t&&!this.techniques.includes(a)||"k"===t&&[4,7].includes(a)||"m"===t&&[2,3].includes(a)?i.setValue(e[t]):i.updateValueAndValidity()})}ngOnInit(){this.ecpService.getInfo().subscribe(({plugins:e,names:t,directory:i,nodes:a})=>{this.initCrushNodeSelection(a,this.form.get("crushRoot"),this.form.get("crushFailureDomain"),this.form.get("crushDeviceClass")),this.plugins=e,this.names=t,this.form.silentSet("directory",i),this.preValidateNumericInputFields()})}preValidateNumericInputFields(){const e=["k","m","l","c","d"].map(e=>this.form.get(e));e.forEach(e=>{e.markAsTouched(),e.markAsDirty()}),e[1].updateValueAndValidity()}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=this.createJson();this.taskWrapper.wrapTaskAroundCall({task:new _.a("ecp/create",{name:e.name}),call:this.ecpService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}createJson(){const e={technique:[this.PLUGIN.ISA,this.PLUGIN.JERASURE,this.PLUGIN.CLAY],packetSize:[this.PLUGIN.JERASURE],l:[this.PLUGIN.LRC],crushLocality:[this.PLUGIN.LRC],c:[this.PLUGIN.SHEC],d:[this.PLUGIN.CLAY],scalar_mds:[this.PLUGIN.CLAY]},t=new te,i=this.form.getValue("plugin");return Object.keys(this.form.controls).filter(t=>{const a=e[t],o=this.form.getValue(t);return(a&&a.includes(i)||!a)&&o&&""!==o}).forEach(e=>{this.extendJson(e,t)}),t}extendJson(e,t){const i=this.form.getValue(e);t[{crushFailureDomain:"crush-failure-domain",crushRoot:"crush-root",crushDeviceClass:"crush-device-class",packetSize:"packetsize",crushLocality:"crush-locality"}[e]||e]="crushRoot"===e?i.name:i}}return e.\u0275fac=function(t){return new(t||e)(p.Rb(R.a),p.Rb(s.a),p.Rb(E.a),p.Rb(v),p.Rb(n.b))},e.\u0275cmp=p.Lb({type:e,selectors:[["cd-erasure-code-profile-form-modal"]],outputs:{submitAction:"submitAction"},features:[p.Ab],decls:98,vars:53,consts:function(){let e,t,i,a,o,c,s,n,l,r,b,u,d,f,m,h,p,g,v,D,W,I,z,P,C,X,S,y,_,N,$,T,w,E,R,k,x,A,V,F,O,L,q,M,B,U,G,j,J;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",i="Plugin",a="Data chunks (k)",o="Coding chunks (m)",c="Crush failure domain",s="Crush root",n="Crush device class",l="Let Ceph decide",r="Available OSDs: " + "\ufffd0\ufffd" + "",b="Directory",u="This field is required!",d="The name can only consist of alphanumeric characters, dashes and underscores.",f="The chosen erasure code profile name is already in use.",m="Loading...",h="This field is required!",p="This field is required!",g="Must be equal to or greater than 2.",v="Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".",D="For an equal distribution k has to be a multiple of (k+m)/l.",W="K has to be equal to or greater than m in order to recover data correctly through c.",I="Distribution factor: " + "\ufffd0\ufffd" + "",z="This field is required!",P="Must be equal to or greater than 1.",C="Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".",X="Durability estimator (c)",S="Must be equal to or greater than 1.",y="C has to be equal to or lower than m as m defines the amount of chunks that can be used.",_="Helper chunks (d)",N="Set d manually or use the plugin's default calculation that maximizes d.",$="D is automatically updated on k and m changes",T="D can be set from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + "",w="D can only be set to " + "\ufffd0\ufffd" + "",E="D has to be greater than k (" + "\ufffd0\ufffd" + ").",R="D has to be lower than k + m (" + "\ufffd0\ufffd" + ").",k="Locality (l)",x="Locality groups: " + "\ufffd0\ufffd" + "",A="This field is required!",V="Must be equal to or greater than 1.",F="Can't split up chunks (k+m) correctly with the current locality.",O="Loading...",L="Crush Locality",q="Loading...",M="None",B="Scalar mds",U="Technique",G="Packetsize",j="Must be equal to or greater than 1.",J="Loading...",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],t,[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","plugin",1,"cd-col-form-label"],[1,"required"],i,[3,"html"],["id","plugin","name","plugin","formControlName","plugin",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","k",1,"cd-col-form-label"],a,["type","number","id","k","name","k","ng-model","$ctrl.erasureCodeProfile.k","placeholder","Data chunks...","formControlName","k",1,"form-control"],["class","form-text text-muted",4,"ngIf"],["for","m",1,"cd-col-form-label"],o,["type","number","id","m","name","m","placeholder","Coding chunks...","formControlName","m",1,"form-control"],["class","form-group row",4,"ngIf"],["for","crushFailureDomain",1,"cd-col-form-label"],c,["id","crushFailureDomain","name","crushFailureDomain","formControlName","crushFailureDomain",1,"form-control","custom-select"],["for","crushRoot",1,"cd-col-form-label"],s,["id","crushRoot","name","crushRoot","formControlName","crushRoot",1,"form-control","custom-select"],["for","crushDeviceClass",1,"cd-col-form-label"],n,["id","crushDeviceClass","name","crushDeviceClass","formControlName","crushDeviceClass",1,"form-control","custom-select"],["ngValue",""],l,[1,"form-text","text-muted"],r,["for","directory",1,"cd-col-form-label"],b,["type","text","id","directory","name","directory","placeholder","Path...","formControlName","directory",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],u,d,f,m,[3,"ngValue"],h,p,g,v,D,W,I,z,P,C,["for","c",1,"cd-col-form-label"],X,["type","number","id","c","name","c","placeholder","Coding chunks...","formControlName","c",1,"form-control"],S,y,["for","d",1,"cd-col-form-label"],_,[1,"input-group"],["type","number","id","d","name","d","placeholder","Helper chunks...","formControlName","d",1,"form-control"],[1,"input-group-append"],["id","d-calc-btn","ngbTooltip",N,"type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],[4,"ngIf"],$,T,w,E,R,["for","l",1,"cd-col-form-label"],k,["type","number","id","l","name","l","placeholder","Coding chunks...","formControlName","l",1,"form-control"],x,A,V,F,O,["for","crushLocality",1,"cd-col-form-label"],L,["id","crushLocality","name","crushLocality","formControlName","crushLocality",1,"form-control","custom-select"],q,M,["for","scalar_mds",1,"cd-col-form-label"],B,["id","scalar_mds","name","scalar_mds","formControlName","scalar_mds",1,"form-control","custom-select"],["for","technique",1,"cd-col-form-label"],U,["id","technique","name","technique","formControlName","technique",1,"form-control","custom-select"],["for","packetSize",1,"cd-col-form-label"],G,["type","number","id","packetSize","name","packetSize","placeholder","Packetsize...","formControlName","packetSize",1,"form-control"],j,J]},template:function(e,t){if(1&e&&(p.Xb(0,"cd-modal",0),p.Vb(1,1),p.bc(2,2),p.oc(3,"titlecase"),p.oc(4,"upperFirst"),p.Ub(),p.Vb(5,3),p.Xb(6,"form",4,5),p.Xb(8,"div",6),p.Xb(9,"div",7),p.Xb(10,"label",8),p.bc(11,9),p.Wb(),p.Xb(12,"div",10),p.Sb(13,"input",11),p.Pc(14,ie,2,0,"span",12),p.Pc(15,ae,2,0,"span",12),p.Pc(16,oe,2,0,"span",12),p.Wb(),p.Wb(),p.Xb(17,"div",7),p.Xb(18,"label",13),p.Xb(19,"span",14),p.bc(20,15),p.Wb(),p.Sb(21,"cd-helper",16),p.Wb(),p.Xb(22,"div",10),p.Xb(23,"select",17),p.Pc(24,ce,2,0,"option",18),p.Pc(25,se,2,2,"option",19),p.Wb(),p.Pc(26,ne,2,0,"span",12),p.Wb(),p.Wb(),p.Xb(27,"div",7),p.Xb(28,"label",20),p.Xb(29,"span",14),p.bc(30,21),p.Wb(),p.Sb(31,"cd-helper",16),p.Wb(),p.Xb(32,"div",10),p.Sb(33,"input",22),p.Pc(34,le,2,0,"span",12),p.Pc(35,re,2,0,"span",12),p.Pc(36,be,2,1,"span",12),p.Pc(37,ue,2,0,"span",12),p.Pc(38,de,2,0,"span",12),p.Pc(39,fe,2,1,"span",23),p.Wb(),p.Wb(),p.Xb(40,"div",7),p.Xb(41,"label",24),p.Xb(42,"span",14),p.bc(43,25),p.Wb(),p.Sb(44,"cd-helper",16),p.Wb(),p.Xb(45,"div",10),p.Sb(46,"input",26),p.Pc(47,me,2,0,"span",12),p.Pc(48,he,2,0,"span",12),p.Pc(49,pe,2,1,"span",12),p.Wb(),p.Wb(),p.Pc(50,De,9,3,"div",27),p.Pc(51,Se,15,6,"div",27),p.Pc(52,$e,12,5,"div",27),p.Xb(53,"div",7),p.Xb(54,"label",28),p.Vb(55),p.bc(56,29),p.Ub(),p.Sb(57,"cd-helper",16),p.Wb(),p.Xb(58,"div",10),p.Xb(59,"select",30),p.Pc(60,Te,2,0,"option",18),p.Pc(61,we,2,3,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Pc(62,xe,10,4,"div",27),p.Pc(63,Fe,8,6,"div",27),p.Pc(64,Le,8,2,"div",27),p.Pc(65,Me,8,2,"div",27),p.Xb(66,"div",7),p.Xb(67,"label",31),p.Vb(68),p.bc(69,32),p.Ub(),p.Sb(70,"cd-helper",16),p.Wb(),p.Xb(71,"div",10),p.Xb(72,"select",33),p.Pc(73,Be,2,0,"option",18),p.Pc(74,Ue,2,2,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Xb(75,"div",7),p.Xb(76,"label",34),p.Vb(77),p.bc(78,35),p.Ub(),p.Sb(79,"cd-helper",16),p.Wb(),p.Xb(80,"div",10),p.Xb(81,"select",36),p.Xb(82,"option",37),p.bc(83,38),p.Wb(),p.Pc(84,Ge,2,2,"option",19),p.Wb(),p.Xb(85,"span",39),p.bc(86,40),p.Wb(),p.Wb(),p.Wb(),p.Xb(87,"div",7),p.Xb(88,"label",41),p.Vb(89),p.bc(90,42),p.Ub(),p.Sb(91,"cd-helper",16),p.Wb(),p.Xb(92,"div",10),p.Sb(93,"input",43),p.Wb(),p.Wb(),p.Wb(),p.Xb(94,"div",44),p.Xb(95,"cd-form-button-panel",45),p.lc("submitActionEvent",function(){return t.onSubmit()}),p.oc(96,"titlecase"),p.oc(97,"upperFirst"),p.Wb(),p.Wb(),p.Wb(),p.Ub(),p.Wb()),2&e){const e=p.Fc(7);p.uc("modalRef",t.activeModal),p.Db(4),p.fc(p.pc(3,41,t.action))(p.pc(4,43,t.resource)),p.cc(2),p.Db(2),p.uc("formGroup",t.form),p.Db(8),p.uc("ngIf",t.form.showError("name",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"pattern")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"uniqueName")),p.Db(5),p.uc("html",t.tooltips.plugins[t.plugin].description),p.Db(3),p.uc("ngIf",!t.plugins),p.Db(1),p.uc("ngForOf",t.plugins),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"required")),p.Db(5),p.uc("html",t.tooltips.k),p.Db(3),p.uc("ngIf",t.form.showError("k",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("k",e,"min")),p.Db(1),p.uc("ngIf",t.form.showError("k",e,"max")),p.Db(1),p.uc("ngIf",t.form.showError("k",e,"unequal")),p.Db(1),p.uc("ngIf",t.form.showError("k",e,"kLowerM")),p.Db(1),p.uc("ngIf","lrc"===t.plugin),p.Db(5),p.uc("html",t.tooltips.m),p.Db(3),p.uc("ngIf",t.form.showError("m",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("m",e,"min")),p.Db(1),p.uc("ngIf",t.form.showError("m",e,"max")),p.Db(1),p.uc("ngIf","shec"===t.plugin),p.Db(1),p.uc("ngIf","clay"===t.plugin),p.Db(1),p.uc("ngIf",t.plugin===t.PLUGIN.LRC),p.Db(5),p.uc("html",t.tooltips.crushFailureDomain),p.Db(3),p.uc("ngIf",!t.failureDomains),p.Db(1),p.uc("ngForOf",t.failureDomainKeys),p.Db(1),p.uc("ngIf",t.plugin===t.PLUGIN.LRC),p.Db(1),p.uc("ngIf",t.PLUGIN.CLAY===t.plugin),p.Db(1),p.uc("ngIf",p.Bc(49,Ve,t.PLUGIN.JERASURE,t.PLUGIN.ISA,t.PLUGIN.CLAY).includes(t.plugin)),p.Db(1),p.uc("ngIf",t.plugin===t.PLUGIN.JERASURE),p.Db(5),p.uc("html",t.tooltips.crushRoot),p.Db(3),p.uc("ngIf",!t.buckets),p.Db(1),p.uc("ngForOf",t.buckets),p.Db(5),p.uc("html",t.tooltips.crushDeviceClass),p.Db(5),p.uc("ngForOf",t.devices),p.Db(2),p.fc(t.deviceCount),p.cc(86),p.Db(5),p.uc("html",t.tooltips.directory),p.Db(4),p.uc("form",t.form)("submitText",p.pc(96,45,t.action)+" "+p.pc(97,47,t.resource))}},directives:[k.a,o.B,o.r,x.a,o.k,A.a,V.a,o.d,F.a,o.q,o.i,O.a,a.r,L.a,o.z,a.q,o.v,o.u,o.C,q.a,s.D,a.p],pipes:[a.A,M.a],styles:[""]}),e})();var Je=i("DNAf");class Ke{constructor(){this.erasureInfo=!1,this.crushInfo=!1,this.pgs=1,this.poolTypes=["erasure","replicated"],this.applications={selected:[],default:["cephfs","rbd","rgw"],available:[],validators:[o.A.pattern("[A-Za-z0-9_]+"),o.A.maxLength(128)],messages:new Je.a({empty:"No applications added",selectionLimit:{text:"Applications limit reached",tooltip:"A pool can only have up to four applications definitions."},customValidations:{pattern:"Allowed characters '_a-zA-Z0-9'",maxlength:"Maximum length is 128 characters"},filter:"Filter or add applications'",add:"Add application"})}}}var Ye=i("zc8c"),He=i("ppaS"),Qe=i("EmSq"),Ze=i("rFfW"),et=i("6qls"),tt=i("FSuO");const it=["crushInfoTabs"],at=["crushDeletionBtn"],ot=["ecpInfoTabs"],ct=["ecpDeletionBtn"];function st(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,41),p.Wb())}function nt(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,42),p.Wb())}function lt(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,43),p.Wb())}function rt(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,44),p.Wb())}function bt(e,t){if(1&e&&(p.Xb(0,"option",45),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("value",e),p.Db(1),p.Tc(" ",e," ")}}function ut(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,46),p.Wb())}function dt(e,t){if(1&e&&(p.Xb(0,"option",45),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("value",e),p.Db(1),p.Tc(" ",e," ")}}function ft(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,57),p.Wb())}function mt(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,58),p.Wb())}function ht(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,59),p.Wb())}function pt(e,t){1&e&&(p.Xb(0,"span",54),p.bc(1,60),p.Wb())}function gt(e,t){if(1&e){const e=p.Yb();p.Xb(0,"div",8),p.Xb(1,"label",51),p.bc(2,52),p.Wb(),p.Xb(3,"div",11),p.Xb(4,"input",53),p.lc("focus",function(){return p.Ic(e),p.nc(3).externalPgChange=!1})("blur",function(){return p.Ic(e),p.nc(3).alignPgs()}),p.Wb(),p.Pc(5,ft,2,0,"span",13),p.Pc(6,mt,2,0,"span",13),p.Pc(7,ht,2,0,"span",13),p.Xb(8,"span",54),p.Sb(9,"cd-doc",55),p.Wb(),p.Pc(10,pt,2,0,"span",56),p.Wb(),p.Wb()}if(2&e){p.nc(2);const e=p.Fc(2),t=p.nc();p.Db(5),p.uc("ngIf",t.form.showError("pgNum",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("pgNum",e,"min")),p.Db(1),p.uc("ngIf",t.form.showError("pgNum",e,"34")),p.Db(3),p.uc("ngIf",t.externalPgChange)}}function vt(e,t){if(1&e&&(p.Xb(0,"span",40),p.Xb(1,"ul",65),p.Xb(2,"li"),p.bc(3,66),p.Wb(),p.Xb(4,"li"),p.bc(5,67),p.Wb(),p.Wb(),p.Wb()),2&e){const e=p.nc(4);p.Db(3),p.fc(e.getMinSize()),p.cc(3),p.Db(2),p.fc(e.getMaxSize()),p.cc(5)}}function Dt(e,t){if(1&e&&(p.Xb(0,"span",40),p.bc(1,68),p.Wb()),2&e){const e=p.nc(4);p.Db(1),p.fc(e.getMinSize())(e.getMaxSize()),p.cc(1)}}function Wt(e,t){1&e&&(p.Xb(0,"span",69),p.bc(1,70),p.Wb())}function It(e,t){if(1&e&&(p.Xb(0,"div",8),p.Xb(1,"label",61),p.bc(2,62),p.Wb(),p.Xb(3,"div",11),p.Sb(4,"input",63),p.Pc(5,vt,6,2,"span",13),p.Pc(6,Dt,2,2,"span",13),p.Pc(7,Wt,2,0,"span",64),p.Wb(),p.Wb()),2&e){p.nc(2);const e=p.Fc(2),t=p.nc();p.Db(4),p.uc("max",t.getMaxSize())("min",t.getMinSize()),p.Db(1),p.uc("ngIf",t.form.showError("size",e)),p.Db(1),p.uc("ngIf",t.form.showError("size",e)),p.Db(1),p.uc("ngIf",1===t.form.getValue("size"))}}function zt(e,t){1&e&&(p.Xb(0,"div",8),p.Xb(1,"label",71),p.bc(2,72),p.Wb(),p.Xb(3,"div",11),p.Xb(4,"div",73),p.Sb(5,"input",74),p.Xb(6,"label",75),p.bc(7,76),p.Wb(),p.Wb(),p.Wb(),p.Wb())}function Pt(e,t){if(1&e&&(p.Xb(0,"div"),p.Xb(1,"div",8),p.Xb(2,"label",47),p.bc(3,48),p.Wb(),p.Xb(4,"div",11),p.Xb(5,"select",49),p.Pc(6,dt,2,2,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Pc(7,gt,11,4,"div",50),p.Pc(8,It,8,5,"div",50),p.Pc(9,zt,8,0,"div",50),p.Wb()),2&e){const e=p.nc(2);p.Db(6),p.uc("ngForOf",e.pgAutoscaleModes),p.Db(1),p.uc("ngIf","on"!==e.form.getValue("pgAutoscaleMode")),p.Db(1),p.uc("ngIf",e.isReplicated),p.Db(1),p.uc("ngIf",e.info.is_all_bluestore&&e.isErasure)}}function Ct(e,t){1&e&&(p.Xb(0,"option",17),p.bc(1,91),p.Wb())}function Xt(e,t){1&e&&(p.Xb(0,"option",92),p.bc(1,93),p.Wb()),2&e&&p.uc("ngValue",null)}function St(e,t){1&e&&(p.Xb(0,"option",92),p.bc(1,94),p.Wb()),2&e&&p.uc("ngValue",null)}function yt(e,t){if(1&e&&(p.Xb(0,"option",92),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e.name," ")}}const _t=function(e){return[e]};function Nt(e,t){if(1&e){const e=p.Yb();p.Xb(0,"button",95),p.lc("click",function(){return p.Ic(e),p.nc(4).addErasureCodeProfile()}),p.Sb(1,"i",87),p.Wb()}if(2&e){const e=p.nc(4);p.Db(1),p.uc("ngClass",p.zc(1,_t,e.icons.add))}}function $t(e,t){if(1&e){const e=p.Yb();p.Xb(0,"button",96,97),p.lc("click",function(){return p.Ic(e),p.nc(4).deleteErasureCodeProfile()}),p.Sb(2,"i",87),p.Wb()}if(2&e){const e=p.nc(4);p.Db(2),p.uc("ngClass",p.zc(1,_t,e.icons.trash))}}const Tt=function(){return["name"]};function wt(e,t){if(1&e&&p.Sb(0,"cd-table-key-value",108),2&e){const e=p.nc(5);p.uc("renderObjects",!0)("hideKeys",p.yc(4,Tt))("data",e.form.getValue("erasureProfile"))("autoReload",!1)}}function Et(e,t){1&e&&(p.Xb(0,"span"),p.bc(1,111),p.Wb())}function Rt(e,t){if(1&e&&(p.Xb(0,"li"),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.Db(1),p.Tc(" ",e," ")}}function kt(e,t){if(1&e&&(p.Xb(0,"ul"),p.Pc(1,Rt,2,1,"li",112),p.Wb()),2&e){const e=p.nc(6);p.Db(1),p.uc("ngForOf",e.ecpUsage)}}function xt(e,t){if(1&e&&(p.Pc(0,Et,2,0,"ng-template",null,109,p.Qc),p.Pc(2,kt,2,1,"ul",110)),2&e){const e=p.Fc(1),t=p.nc(5);p.Db(2),p.uc("ngIf",t.ecpUsage)("ngIfElse",e)}}function At(e,t){if(1&e&&(p.Xb(0,"span",98),p.Xb(1,"ul",99,100),p.Xb(3,"li",101),p.Xb(4,"a",102),p.bc(5,103),p.Wb(),p.Pc(6,wt,1,5,"ng-template",104),p.Wb(),p.Xb(7,"li",105),p.Xb(8,"a",102),p.bc(9,106),p.Wb(),p.Pc(10,xt,3,2,"ng-template",104),p.Wb(),p.Wb(),p.Sb(11,"div",107),p.Wb()),2&e){const e=p.Fc(2);p.Db(11),p.uc("ngbNavOutlet",e)}}const Vt=function(e){return{active:e}};function Ft(e,t){if(1&e){const e=p.Yb();p.Xb(0,"div",8),p.Xb(1,"label",78),p.bc(2,79),p.Wb(),p.Xb(3,"div",11),p.Xb(4,"div",80),p.Xb(5,"select",81),p.Pc(6,Ct,2,0,"option",82),p.Pc(7,Xt,2,1,"option",83),p.Pc(8,St,2,1,"option",83),p.Pc(9,yt,2,2,"option",84),p.Wb(),p.Xb(10,"span",85),p.Xb(11,"button",86),p.lc("click",function(){p.Ic(e);const t=p.nc(3);return t.data.erasureInfo=!t.data.erasureInfo}),p.Sb(12,"i",87),p.Wb(),p.Pc(13,Nt,2,3,"button",88),p.Pc(14,$t,3,3,"button",89),p.Wb(),p.Wb(),p.Pc(15,At,12,1,"span",90),p.Wb(),p.Wb()}if(2&e){const e=p.nc(3);p.Db(6),p.uc("ngIf",!e.ecProfiles),p.Db(1),p.uc("ngIf",e.ecProfiles&&0===e.ecProfiles.length),p.Db(1),p.uc("ngIf",e.ecProfiles&&e.ecProfiles.length>0),p.Db(1),p.uc("ngForOf",e.ecProfiles),p.Db(2),p.uc("ngClass",p.zc(9,Vt,e.data.erasureInfo)),p.Db(1),p.uc("ngClass",p.zc(11,_t,e.icons.questionCircle)),p.Db(1),p.uc("ngIf",!e.editing),p.Db(1),p.uc("ngIf",!e.editing),p.Db(1),p.uc("ngIf",e.data.erasureInfo&&e.form.getValue("erasureProfile"))}}function Ot(e,t){1&e&&(p.Xb(0,"div",8),p.Xb(1,"label",113),p.bc(2,114),p.Wb(),p.Xb(3,"div",11),p.Xb(4,"span",54),p.bc(5,115),p.Wb(),p.Wb(),p.Wb())}function Lt(e,t){1&e&&(p.Xb(0,"span",54),p.Xb(1,"span"),p.bc(2,118),p.Wb(),p.Rc(3,"\xa0 "),p.Wb())}function qt(e,t){if(1&e&&(p.Xb(0,"option",92),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("ngValue",e),p.Db(1),p.Tc(" ",e.rule_name," ")}}function Mt(e,t){if(1&e){const e=p.Yb();p.Xb(0,"button",95),p.lc("click",function(){return p.Ic(e),p.nc(5).addCrushRule()}),p.Sb(1,"i",87),p.Wb()}if(2&e){const e=p.nc(5);p.Db(1),p.uc("ngClass",p.zc(1,_t,e.icons.add))}}function Bt(e,t){if(1&e){const e=p.Yb();p.Xb(0,"button",124,125),p.lc("click",function(){return p.Ic(e),p.nc(5).deleteCrushRule()}),p.Sb(2,"i",87),p.Wb()}if(2&e){const e=p.nc(5);p.Db(2),p.uc("ngClass",p.zc(1,_t,e.icons.trash))}}const Ut=function(){return["steps","ruleset","type","rule_name"]};function Gt(e,t){if(1&e&&p.Sb(0,"cd-table-key-value",108),2&e){const e=p.nc(6);p.uc("renderObjects",!1)("hideKeys",p.yc(4,Ut))("data",e.form.getValue("crushRule"))("autoReload",!1)}}function jt(e,t){if(1&e&&(p.Xb(0,"li"),p.Rc(1),p.Wb()),2&e){const e=t.$implicit,i=p.nc(7);p.Db(1),p.Tc(" ",i.describeCrushStep(e)," ")}}function Jt(e,t){if(1&e&&(p.Xb(0,"ol"),p.Pc(1,jt,2,1,"li",112),p.Wb()),2&e){const e=p.nc(6);p.Db(1),p.uc("ngForOf",e.form.get("crushRule").value.steps)}}function Kt(e,t){1&e&&(p.Xb(0,"span"),p.bc(1,134),p.Wb())}function Yt(e,t){if(1&e&&(p.Xb(0,"li"),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.Db(1),p.Tc(" ",e," ")}}function Ht(e,t){if(1&e&&(p.Xb(0,"ul"),p.Pc(1,Yt,2,1,"li",112),p.Wb()),2&e){const e=p.nc(7);p.Db(1),p.uc("ngForOf",e.crushUsage)}}function Qt(e,t){if(1&e&&(p.Pc(0,Kt,2,0,"ng-template",null,133,p.Qc),p.Pc(2,Ht,2,1,"ul",110)),2&e){const e=p.Fc(1),t=p.nc(6);p.Db(2),p.uc("ngIf",t.crushUsage)("ngIfElse",e)}}function Zt(e,t){if(1&e&&(p.Xb(0,"div",126),p.Xb(1,"ul",99,127),p.Xb(3,"li",128),p.Xb(4,"a",102),p.bc(5,129),p.Wb(),p.Pc(6,Gt,1,5,"ng-template",104),p.Wb(),p.Xb(7,"li",130),p.Xb(8,"a",102),p.bc(9,131),p.Wb(),p.Pc(10,Jt,2,1,"ng-template",104),p.Wb(),p.Xb(11,"li",105),p.Xb(12,"a",102),p.bc(13,132),p.Wb(),p.Pc(14,Qt,3,2,"ng-template",104),p.Wb(),p.Wb(),p.Sb(15,"div",107),p.Wb()),2&e){const e=p.Fc(2);p.Db(15),p.uc("ngbNavOutlet",e)}}function ei(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,135),p.Wb())}function ti(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,136),p.Wb())}function ii(e,t){if(1&e){const e=p.Yb();p.Xb(0,"div"),p.Xb(1,"div",80),p.Xb(2,"select",119),p.Xb(3,"option",92),p.bc(4,120),p.Wb(),p.Pc(5,qt,2,2,"option",84),p.Wb(),p.Xb(6,"span",85),p.Xb(7,"button",121),p.lc("click",function(){p.Ic(e);const t=p.nc(4);return t.data.crushInfo=!t.data.crushInfo}),p.Sb(8,"i",87),p.Wb(),p.Pc(9,Mt,2,3,"button",88),p.Pc(10,Bt,3,3,"button",122),p.Wb(),p.Wb(),p.Pc(11,Zt,16,1,"div",123),p.Pc(12,ei,2,0,"span",13),p.Pc(13,ti,2,0,"span",13),p.Wb()}if(2&e){p.nc(3);const e=p.Fc(2),t=p.nc();p.Db(3),p.uc("ngValue",null),p.Db(2),p.uc("ngForOf",t.current.rules),p.Db(2),p.uc("ngClass",p.zc(9,Vt,t.data.crushInfo)),p.Db(1),p.uc("ngClass",p.zc(11,_t,t.icons.questionCircle)),p.Db(1),p.uc("ngIf",t.isReplicated&&!t.editing),p.Db(1),p.uc("ngIf",t.isReplicated&&!t.editing),p.Db(1),p.uc("ngIf",t.data.crushInfo&&t.form.getValue("crushRule")),p.Db(1),p.uc("ngIf",t.form.showError("crushRule",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("crushRule",e,"tooFewOsds"))}}function ai(e,t){if(1&e&&(p.Xb(0,"div",8),p.Xb(1,"label",113),p.bc(2,116),p.Wb(),p.Xb(3,"div",11),p.Pc(4,Lt,4,0,"ng-template",null,117,p.Qc),p.Pc(6,ii,14,13,"div",110),p.Wb(),p.Wb()),2&e){const e=p.Fc(5),t=p.nc(3);p.Db(6),p.uc("ngIf",t.current.rules.length>0)("ngIfElse",e)}}function oi(e,t){if(1&e&&(p.Xb(0,"div"),p.Xb(1,"legend"),p.bc(2,77),p.Wb(),p.Pc(3,Ft,16,13,"div",50),p.Pc(4,Ot,6,0,"div",50),p.Pc(5,ai,7,2,"div",50),p.Wb()),2&e){const e=p.nc(2);p.Db(3),p.uc("ngIf",e.isErasure),p.Db(1),p.uc("ngIf",e.isErasure&&!e.editing),p.Db(1),p.uc("ngIf",e.isReplicated||e.editing)}}function ci(e,t){if(1&e&&(p.Xb(0,"option",45),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("value",e),p.Db(1),p.Tc(" ",e," ")}}function si(e,t){1&e&&(p.Xb(0,"option",17),p.bc(1,154),p.Wb())}function ni(e,t){1&e&&(p.Xb(0,"option",17),p.bc(1,155),p.Wb())}function li(e,t){if(1&e&&(p.Xb(0,"option",45),p.Rc(1),p.Wb()),2&e){const e=t.$implicit;p.uc("value",e),p.Db(1),p.Tc(" ",e," ")}}function ri(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,156),p.Wb())}function bi(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,157),p.Wb())}function ui(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,158),p.Wb())}function di(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,159),p.Wb())}function fi(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,160),p.Wb())}function mi(e,t){if(1&e&&(p.Xb(0,"div"),p.Xb(1,"div",8),p.Xb(2,"label",142),p.bc(3,143),p.Wb(),p.Xb(4,"div",11),p.Xb(5,"select",144),p.Pc(6,si,2,0,"option",82),p.Pc(7,ni,2,0,"option",82),p.Pc(8,li,2,2,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Xb(9,"div",8),p.Xb(10,"label",145),p.bc(11,146),p.Wb(),p.Xb(12,"div",11),p.Sb(13,"input",147),p.Pc(14,ri,2,0,"span",13),p.Pc(15,bi,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(16,"div",8),p.Xb(17,"label",148),p.bc(18,149),p.Wb(),p.Xb(19,"div",11),p.Sb(20,"input",150),p.Pc(21,ui,2,0,"span",13),p.Pc(22,di,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(23,"div",8),p.Xb(24,"label",151),p.bc(25,152),p.Wb(),p.Xb(26,"div",11),p.Sb(27,"input",153),p.Pc(28,fi,2,0,"span",13),p.Wb(),p.Wb(),p.Wb()),2&e){p.nc(2);const e=p.Fc(2),t=p.nc();p.Db(6),p.uc("ngIf",!t.info.compression_algorithms),p.Db(1),p.uc("ngIf",t.info.compression_algorithms&&0===t.info.compression_algorithms.length),p.Db(1),p.uc("ngForOf",t.info.compression_algorithms),p.Db(6),p.uc("ngIf",t.form.showError("minBlobSize",e,"min")),p.Db(1),p.uc("ngIf",t.form.showError("minBlobSize",e,"maximum")),p.Db(6),p.uc("ngIf",t.form.showError("maxBlobSize",e,"min")),p.Db(1),p.uc("ngIf",t.form.showError("maxBlobSize",e,"minimum")),p.Db(6),p.uc("ngIf",t.form.showError("ratio",e,"min")||t.form.showError("ratio",e,"max"))}}function hi(e,t){if(1&e&&(p.Xb(0,"div",137),p.Xb(1,"legend"),p.bc(2,138),p.Wb(),p.Xb(3,"div",8),p.Xb(4,"label",139),p.bc(5,140),p.Wb(),p.Xb(6,"div",11),p.Xb(7,"select",141),p.Pc(8,ci,2,2,"option",19),p.Wb(),p.Wb(),p.Wb(),p.Pc(9,mi,29,8,"div",20),p.Wb()),2&e){const e=p.nc(2);p.Db(8),p.uc("ngForOf",e.info.compression_modes),p.Db(1),p.uc("ngIf",e.hasCompressionEnabled())}}function pi(e,t){1&e&&(p.Xb(0,"span",40),p.bc(1,161),p.Wb())}function gi(e,t){if(1&e){const e=p.Yb();p.Xb(0,"div",1),p.Xb(1,"form",2,3),p.Xb(3,"div",4),p.Xb(4,"div",5),p.bc(5,6),p.oc(6,"titlecase"),p.oc(7,"upperFirst"),p.Wb(),p.Xb(8,"div",7),p.Xb(9,"div",8),p.Xb(10,"label",9),p.bc(11,10),p.Wb(),p.Xb(12,"div",11),p.Sb(13,"input",12),p.Pc(14,st,2,0,"span",13),p.Pc(15,nt,2,0,"span",13),p.Pc(16,lt,2,0,"span",13),p.Pc(17,rt,2,0,"span",13),p.Wb(),p.Wb(),p.Xb(18,"div",8),p.Xb(19,"label",14),p.bc(20,15),p.Wb(),p.Xb(21,"div",11),p.Xb(22,"select",16),p.Xb(23,"option",17),p.bc(24,18),p.Wb(),p.Pc(25,bt,2,2,"option",19),p.Wb(),p.Pc(26,ut,2,0,"span",13),p.Wb(),p.Wb(),p.Pc(27,Pt,10,4,"div",20),p.Xb(28,"div",8),p.Xb(29,"label",21),p.bc(30,22),p.Wb(),p.Xb(31,"div",11),p.Xb(32,"cd-select-badges",23),p.lc("selection",function(){return p.Ic(e),p.nc().appSelection()}),p.Wb(),p.Wb(),p.Wb(),p.Pc(33,oi,6,3,"div",20),p.Pc(34,hi,10,2,"div",24),p.Xb(35,"div"),p.Xb(36,"legend"),p.bc(37,25),p.Wb(),p.Xb(38,"div",8),p.Xb(39,"label",26),p.Vb(40),p.bc(41,27),p.Ub(),p.Xb(42,"cd-helper"),p.Xb(43,"span"),p.bc(44,28),p.Wb(),p.Sb(45,"br"),p.Xb(46,"span"),p.bc(47,29),p.Wb(),p.Wb(),p.Wb(),p.Xb(48,"div",11),p.Sb(49,"input",30),p.Wb(),p.Wb(),p.Xb(50,"div",8),p.Xb(51,"label",31),p.Vb(52),p.bc(53,32),p.Ub(),p.Xb(54,"cd-helper"),p.Xb(55,"span"),p.bc(56,33),p.Wb(),p.Sb(57,"br"),p.Xb(58,"span"),p.bc(59,34),p.Wb(),p.Wb(),p.Wb(),p.Xb(60,"div",11),p.Sb(61,"input",35),p.Pc(62,pi,2,0,"span",13),p.Wb(),p.Wb(),p.Wb(),p.Xb(63,"div",36),p.Xb(64,"cd-rbd-configuration-form",37),p.lc("changes",function(t){return p.Ic(e),p.nc().currentConfigurationValues=t()}),p.Wb(),p.Wb(),p.Wb(),p.Xb(65,"div",38),p.Xb(66,"cd-form-button-panel",39),p.lc("submitActionEvent",function(){return p.Ic(e),p.nc().submit()}),p.oc(67,"titlecase"),p.oc(68,"upperFirst"),p.Wb(),p.Wb(),p.Wb(),p.Wb(),p.Wb()}if(2&e){const e=p.Fc(2),t=p.nc();p.Db(1),p.uc("formGroup",t.form),p.Db(6),p.fc(p.pc(6,24,t.action))(p.pc(7,26,t.resource)),p.cc(5),p.Db(7),p.uc("ngIf",t.form.showError("name",e,"required")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"uniqueName")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"rbdPool")),p.Db(1),p.uc("ngIf",t.form.showError("name",e,"pattern")),p.Db(8),p.uc("ngForOf",t.data.poolTypes),p.Db(1),p.uc("ngIf",t.form.showError("poolType",e,"required")),p.Db(1),p.uc("ngIf",t.isReplicated||t.isErasure),p.Db(5),p.uc("customBadges",!0)("customBadgeValidators",t.data.applications.validators)("messages",t.data.applications.messages)("data",t.data.applications.selected)("options",t.data.applications.available)("selectionLimit",4),p.Db(1),p.uc("ngIf",t.isErasure||t.isReplicated),p.Db(1),p.uc("ngIf",t.info.is_all_bluestore),p.Db(28),p.uc("ngIf",t.form.showError("max_objects",e,"min")),p.Db(1),p.uc("hidden",t.isErasure||-1===t.data.applications.selected.indexOf("rbd")),p.Db(1),p.uc("form",t.form)("initializeData",t.initializeConfigData),p.Db(2),p.uc("form",t.form)("submitText",p.pc(67,28,t.action)+" "+p.pc(68,30,t.resource))}}let vi=(()=>{class e extends C.a{constructor(e,t,i,a,o,c,s,l,r,b,u){super(),this.dimlessBinaryPipe=e,this.route=t,this.router=i,this.modalService=a,this.poolService=o,this.authStorageService=c,this.formatter=s,this.taskWrapper=l,this.ecpService=r,this.crushRuleService=b,this.actionLabels=u,this.editing=!1,this.isReplicated=!1,this.isErasure=!1,this.data=new Ke,this.externalPgChange=!1,this.current={rules:[]},this.initializeConfigData=new f.a(1),this.currentConfigurationValues={},this.icons=P.a,this.crushUsage=void 0,this.ecpUsage=void 0,this.editing=this.router.url.startsWith(`/pool/${n.e.EDIT}`),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.resource="pool",this.authenticate(),this.createForm()}authenticate(){if(this.permission=this.authStorageService.getPermissions().pool,!this.permission.read||!this.permission.update&&this.editing||!this.permission.create&&!this.editing)throw new m.b}createForm(){const e=new X.a({mode:new o.h("none"),algorithm:new o.h(""),minBlobSize:new o.h("",{updateOn:"blur"}),maxBlobSize:new o.h("",{updateOn:"blur"}),ratio:new o.h("",{updateOn:"blur"})});this.form=new X.a({name:new o.h("",{validators:[o.A.pattern(/^[.A-Za-z0-9_/-]+$/),o.A.required,S.a.custom("rbdPool",()=>this.form&&this.form.getValue("name").includes("/")&&this.data&&-1!==this.data.applications.selected.indexOf("rbd"))]}),poolType:new o.h("",{validators:[o.A.required]}),crushRule:new o.h(null,{validators:[S.a.custom("tooFewOsds",e=>this.info&&e&&this.info.osd_count<e.min_size),S.a.custom("required",e=>this.isReplicated&&this.info.crush_rules_replicated.length>0&&!e)]}),size:new o.h("",{updateOn:"blur"}),erasureProfile:new o.h(null),pgNum:new o.h("",{validators:[o.A.required,o.A.min(1)]}),pgAutoscaleMode:new o.h(null),ecOverwrites:new o.h(!1),compression:e,max_bytes:new o.h(""),max_objects:new o.h(0,{validators:[o.A.min(0)]})},[S.a.custom("form",()=>null)])}ngOnInit(){this.poolService.getInfo().subscribe(e=>{this.initInfo(e),this.editing?this.initEditMode():(this.setAvailableApps(),this.loadingReady()),this.listenToChanges(),this.setComplexValidators()})}initInfo(e){this.pgAutoscaleModes=e.pg_autoscale_modes,this.form.silentSet("pgAutoscaleMode",e.pg_autoscale_default_mode),this.form.silentSet("algorithm",e.bluestore_compression_algorithm),this.info=e,this.initEcp(e.erasure_code_profiles)}initEcp(e){this.setListControlStatus("erasureProfile",e),this.ecProfiles=e}setListControlStatus(e,t){const i=this.form.get(e),a=i.value;1!==t.length||a&&d.a.isEqual(a,t[0])?0===t.length&&a&&i.setValue(null):i.setValue(t[0]),t.length<=1?i.enabled&&i.disable():i.disabled&&i.enable()}initEditMode(){this.disableForEdit(),this.routeParamsSubscribe=this.route.params.subscribe(e=>this.poolService.get(e.name).subscribe(e=>{this.data.pool=e,this.initEditFormData(e),this.loadingReady()}))}disableForEdit(){["poolType","crushRule","size","erasureProfile","ecOverwrites"].forEach(e=>this.form.get(e).disable())}initEditFormData(e){this.initializeConfigData.next({initialData:e.configuration,sourceType:y.a.pool}),this.poolTypeChange(e.type);const t=this.info.crush_rules_replicated.concat(this.info.crush_rules_erasure),i={name:e.pool_name,poolType:e.type,crushRule:t.find(t=>t.rule_name===e.crush_rule),size:e.size,erasureProfile:this.ecProfiles.find(t=>t.name===e.erasure_code_profile),pgAutoscaleMode:e.pg_autoscale_mode,pgNum:e.pg_num,ecOverwrites:e.flags_names.includes("ec_overwrites"),mode:e.options.compression_mode,algorithm:e.options.compression_algorithm,minBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_min_blob_size),maxBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_max_blob_size),ratio:e.options.compression_required_ratio,max_bytes:this.dimlessBinaryPipe.transform(e.quota_max_bytes),max_objects:e.quota_max_objects};Object.keys(i).forEach(e=>{const t=i[e];d.a.isUndefined(t)||""===t||this.form.silentSet(e,t)}),this.data.pgs=this.form.getValue("pgNum"),this.setAvailableApps(this.data.applications.default.concat(e.application_metadata)),this.data.applications.selected=e.application_metadata}setAvailableApps(e=this.data.applications.default){this.data.applications.available=d.a.uniq(e.sort()).map(e=>new z.a(!1,e,""))}listenToChanges(){this.listenToChangesDuringAddEdit(),this.editing||this.listenToChangesDuringAdd()}listenToChangesDuringAddEdit(){this.form.get("pgNum").valueChanges.subscribe(e=>{const t=e-this.data.pgs;1===Math.abs(t)&&2!==e?this.doPgPowerJump(t):this.data.pgs=e})}doPgPowerJump(e){const t=this.calculatePgPower()+e;this.setPgs(-1===e?Math.round(t):Math.floor(t))}calculatePgPower(e=this.form.getValue("pgNum")){return Math.log(e)/Math.log(2)}setPgs(e){const t=Math.pow(2,e<0?0:e);this.data.pgs=t,this.form.silentSet("pgNum",t)}listenToChangesDuringAdd(){this.form.get("poolType").valueChanges.subscribe(e=>{this.poolTypeChange(e)}),this.form.get("crushRule").valueChanges.subscribe(e=>{this.crushDeletionBtn&&this.crushDeletionBtn.isOpen()&&this.crushDeletionBtn.close(),e&&(this.setCorrectMaxSize(e),this.crushRuleIsUsedBy(e.rule_name),this.replicatedRuleChange(),this.pgCalc())}),this.form.get("size").valueChanges.subscribe(()=>{this.pgCalc()}),this.form.get("erasureProfile").valueChanges.subscribe(e=>{this.ecpDeletionBtn&&this.ecpDeletionBtn.isOpen()&&this.ecpDeletionBtn.close(),e&&(this.ecpIsUsedBy(e.name),this.pgCalc())}),this.form.get("mode").valueChanges.subscribe(()=>{["minBlobSize","maxBlobSize","ratio"].forEach(e=>{this.form.get(e).updateValueAndValidity({emitEvent:!1})})}),this.form.get("minBlobSize").valueChanges.subscribe(()=>{this.form.get("maxBlobSize").updateValueAndValidity({emitEvent:!1})}),this.form.get("maxBlobSize").valueChanges.subscribe(()=>{this.form.get("minBlobSize").updateValueAndValidity({emitEvent:!1})})}poolTypeChange(e){if("replicated"===e?this.setTypeBooleans(!0,!1):this.setTypeBooleans(!1,"erasure"===e),!e||!this.info)return void(this.current.rules=[]);const t=this.info["crush_rules_"+e]||[];this.current.rules=t,this.editing||(this.isReplicated&&this.setListControlStatus("crushRule",t),this.replicatedRuleChange(),this.pgCalc())}setTypeBooleans(e,t){this.isReplicated=e,this.isErasure=t}replicatedRuleChange(){if(!this.isReplicated)return;const e=this.form.get("size");let t=this.form.getValue("size")||3;const i=this.getMinSize(),a=this.getMaxSize();t<i?t=i:t>a&&(t=a),t!==e.value&&this.form.silentSet("size",t)}getMinSize(){if(!this.info||this.info.osd_count<1)return 0;const e=this.form.getValue("crushRule");return e?e.min_size:1}getMaxSize(){const e=this.form.getValue("crushRule");return this.info?e?e.usable_size:Math.min(this.info.osd_count,3):0}pgCalc(){const e=this.form.getValue("poolType");if(!this.info||this.form.get("pgNum").dirty||!e)return;const t=100*this.info.osd_count,i=this.isReplicated?this.replicatedPgCalc(t):this.erasurePgCalc(t);if(!i)return;const a=this.data.pgs;this.alignPgs(i),this.externalPgChange||(this.externalPgChange=a!==this.data.pgs)}setCorrectMaxSize(e=this.form.getValue("crushRule")){if(!e)return;const t=W.searchFailureDomains(this.info.nodes,e.steps[0].item_name)[e.steps[1].type];e.usable_size=Math.min(t?t.length:e.max_size,e.max_size)}replicatedPgCalc(e){const t=this.form.get("size"),i=t.value;return t.valid&&i>0?e/i:0}erasurePgCalc(e){const t=this.form.get("erasureProfile"),i=t.value;return(t.valid||t.disabled)&&i?e/(i.k+i.m):0}alignPgs(e=this.form.getValue("pgNum")){this.setPgs(Math.round(this.calculatePgPower(e<1?1:e)))}setComplexValidators(){this.editing?this.form.get("name").setValidators([this.form.get("name").validator,S.a.custom("uniqueName",e=>this.data.pool&&this.info&&-1!==this.info.pool_names.indexOf(e)&&this.info.pool_names.indexOf(e)!==this.info.pool_names.indexOf(this.data.pool.pool_name))]):(S.a.validateIf(this.form.get("size"),()=>this.isReplicated,[S.a.custom("min",e=>this.form.getValue("size")&&e<this.getMinSize()),S.a.custom("max",e=>this.form.getValue("size")&&this.getMaxSize()<e)]),this.form.get("name").setValidators([this.form.get("name").validator,S.a.custom("uniqueName",e=>this.info&&-1!==this.info.pool_names.indexOf(e))])),this.setCompressionValidators()}setCompressionValidators(){S.a.validateIf(this.form.get("minBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),S.a.custom("maximum",e=>this.oddBlobSize(e,this.form.getValue("maxBlobSize")))]),S.a.validateIf(this.form.get("maxBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),S.a.custom("minimum",e=>this.oddBlobSize(this.form.getValue("minBlobSize"),e))]),S.a.validateIf(this.form.get("ratio"),()=>this.hasCompressionEnabled(),[o.A.min(0),o.A.max(1)])}oddBlobSize(e,t){const i=this.formatter.toBytes(e),a=this.formatter.toBytes(t);return Boolean(i&&a&&i>=a)}hasCompressionEnabled(){return this.form.getValue("mode")&&"none"!==this.form.get("mode").value.toLowerCase()}describeCrushStep(e){return[e.op.replace("_"," "),e.item_name||"",e.type?e.num+" type "+e.type:""].join(" ")}addErasureCodeProfile(){this.addModal(je,e=>this.reloadECPs(e))}addModal(e,t){this.hideOpenTooltips(),this.modalService.show(e).componentInstance.submitAction.subscribe(e=>{t(e.name)})}hideOpenTooltips(){const e=e=>e&&e.isOpen()&&e.close();e(this.ecpDeletionBtn),e(this.crushDeletionBtn)}reloadECPs(e){this.reloadList({newItemName:e,getInfo:()=>this.ecpService.list(),initInfo:e=>this.initEcp(e),findNewItem:()=>this.ecProfiles.find(t=>t.name===e),controlName:"erasureProfile"})}reloadList({newItemName:e,getInfo:t,initInfo:i,findNewItem:a,controlName:o}){this.modalSubscription&&this.modalSubscription.unsubscribe(),t().subscribe(t=>{if(i(t),!e)return;const c=a();c&&this.form.get(o).setValue(c)})}deleteErasureCodeProfile(){this.deletionModal({value:this.form.getValue("erasureProfile"),usage:this.ecpUsage,deletionBtn:this.ecpDeletionBtn,dataName:"erasureInfo",getTabs:()=>this.ecpInfoTabs,tabPosition:"used-by-pools",nameAttribute:"name",itemDescription:"erasure code profile",reloadFn:()=>this.reloadECPs(),deleteFn:e=>this.ecpService.delete(e),taskName:"ecp/delete"})}deletionModal({value:e,usage:t,deletionBtn:i,dataName:a,getTabs:o,tabPosition:c,nameAttribute:s,itemDescription:n,reloadFn:l,deleteFn:r,taskName:b}){if(!e)return;if(t)return i.toggle(),this.data[a]=!0,void setTimeout(()=>{const e=o();e&&e.select(c)},50);const u=e[s];this.modalService.show(I.a,{itemDescription:n,itemNames:[u],submitActionObservable:()=>{const e=r(u);return e.subscribe(()=>l()),this.taskWrapper.wrapTaskAroundCall({task:new _.a(b,{name:u}),call:e})}})}addCrushRule(){this.addModal(ee,e=>this.reloadCrushRules(e))}reloadCrushRules(e){this.reloadList({newItemName:e,getInfo:()=>this.poolService.getInfo(),initInfo:e=>{this.initInfo(e),this.poolTypeChange("replicated")},findNewItem:()=>this.info.crush_rules_replicated.find(t=>t.rule_name===e),controlName:"crushRule"})}deleteCrushRule(){this.deletionModal({value:this.form.getValue("crushRule"),usage:this.crushUsage,deletionBtn:this.crushDeletionBtn,dataName:"crushInfo",getTabs:()=>this.crushInfoTabs,tabPosition:"used-by-pools",nameAttribute:"rule_name",itemDescription:"crush rule",reloadFn:()=>this.reloadCrushRules(),deleteFn:e=>this.crushRuleService.delete(e),taskName:"crushRule/delete"})}crushRuleIsUsedBy(e){this.crushUsage=e?this.info.used_rules[e]:void 0}ecpIsUsedBy(e){this.ecpUsage=e?this.info.used_profiles[e]:void 0}submit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e={pool:this.form.getValue("name")};this.assignFormFields(e,[{externalFieldName:"pool_type",formControlName:"poolType"},{externalFieldName:"pg_autoscale_mode",formControlName:"pgAutoscaleMode",editable:!0},{externalFieldName:"pg_num",formControlName:"pgNum",replaceFn:e=>"on"===this.form.getValue("pgAutoscaleMode")?1:e,editable:!0},this.isReplicated?{externalFieldName:"size",formControlName:"size"}:{externalFieldName:"erasure_code_profile",formControlName:"erasureProfile",attr:"name"},{externalFieldName:"rule_name",formControlName:"crushRule",replaceFn:e=>this.isReplicated?e&&e.rule_name:void 0},{externalFieldName:"quota_max_bytes",formControlName:"max_bytes",replaceFn:this.formatter.toBytes,editable:!0,resetValue:this.editing?0:void 0},{externalFieldName:"quota_max_objects",formControlName:"max_objects",editable:!0,resetValue:this.editing?0:void 0}]),this.info.is_all_bluestore&&(this.assignFormField(e,{externalFieldName:"flags",formControlName:"ecOverwrites",replaceFn:()=>this.isErasure?["ec_overwrites"]:void 0}),"none"!==this.form.getValue("mode")?this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:e=>this.hasCompressionEnabled()&&e},{externalFieldName:"compression_algorithm",formControlName:"algorithm",editable:!0},{externalFieldName:"compression_min_blob_size",formControlName:"minBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_max_blob_size",formControlName:"maxBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_required_ratio",formControlName:"ratio",editable:!0,resetValue:0}]):this.editing&&this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:()=>"unset"},{externalFieldName:"srcpool",formControlName:"name",editable:!0,replaceFn:()=>this.data.pool.pool_name}]));const t=this.data.applications.selected;(t.length>0||this.editing)&&(e.application_metadata=t),this.isReplicated&&!d.a.isEmpty(this.currentConfigurationValues)&&(e.configuration=this.currentConfigurationValues),this.triggerApiTask(e)}assignFormFields(e,t){t.forEach(t=>this.assignFormField(e,t))}assignFormField(e,{externalFieldName:t,formControlName:i,attr:a,replaceFn:o,editable:c,resetValue:s}){if(this.editing&&(!c||this.form.get(i).pristine))return;const n=this.form.getValue(i);let l=o?o(n):a?d.a.get(n,a):n;if(!n||!l){if(!c||d.a.isUndefined(s))return;l=s}e[t]=l}triggerApiTask(e){this.taskWrapper.wrapTaskAroundCall({task:new _.a("pool/"+(this.editing?n.e.EDIT:n.e.CREATE),{pool_name:e.hasOwnProperty("srcpool")?e.srcpool:e.pool}),call:this.poolService[this.editing?n.e.UPDATE:n.e.CREATE](e)}).subscribe({error:e=>{d.a.isObject(e.error)&&"34"===e.error.code&&this.form.get("pgNum").setErrors({34:!0}),this.form.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/pool"])})}appSelection(){this.form.get("name").updateValueAndValidity({emitEvent:!1,onlySelf:!0})}}return e.\u0275fac=function(t){return new(t||e)(p.Rb(N.a),p.Rb(c.a),p.Rb(c.e),p.Rb(w.a),p.Rb(D.a),p.Rb($.a),p.Rb(T.a),p.Rb(E.a),p.Rb(v),p.Rb(h.a),p.Rb(n.b))},e.\u0275cmp=p.Lb({type:e,selectors:[["cd-pool-form"]],viewQuery:function(e,t){if(1&e&&(p.Wc(it,1),p.Wc(at,1),p.Wc(ot,1),p.Wc(ct,1)),2&e){let e;p.Ec(e=p.mc())&&(t.crushInfoTabs=e.first),p.Ec(e=p.mc())&&(t.crushDeletionBtn=e.first),p.Ec(e=p.mc())&&(t.ecpInfoTabs=e.first),p.Ec(e=p.mc())&&(t.ecpDeletionBtn=e.first)}},features:[p.Ab],decls:1,vars:1,consts:function(){let e,t,i,a,o,c,s,n,l,r,b,u,d,f,m,h,p,g,v,D,W,I,z,P,C,X,S,y,_,N,$,T,w,E,R,k,x,A,V,F,O,L,q,M,B,U,G,j,J,K,Y,H,Q,Z,ee,te,ie,ae,oe,ce,se,ne,le,re,be,ue,de,fe,me,he,pe,ge;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",i="Name...",a="Pool type",o="-- Select a pool type --",c="Applications",s="Quotas",n="Max bytes",l="Leave it blank or specify 0 to disable this quota.",r="A valid quota should be greater than 0.",b="e.g., 10GiB",u="Max objects",d="Leave it blank or specify 0 to disable this quota.",f="A valid quota should be greater than 0.",m="This field is required!",h="The chosen Ceph pool name is already in use.",p="It's not possible to create an RBD pool with '/' in the name. Please change the name or remove 'rbd' from the applications list.",g="Pool name can only contain letters, numbers, '.', '-', '_' or '/'.",v="This field is required!",D="PG Autoscale",W="Placement groups",I="Calculation help",z="This field is required!",P="At least one placement group is needed!",C="Your cluster can't handle this many PGs. Please recalculate the PG amount needed.",X="The current PGs settings were calculated for you, you should make sure the values suit your needs before submit.",S="Replicated size",y="Minimum: " + "\ufffd0\ufffd" + "",_="Maximum: " + "\ufffd0\ufffd" + "",N="The size specified is out of range. A value from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + " is usable.",$="A size of 1 will not create a replication of the object. The 'Replicated size' includes the object itself.",T="Flags",w="EC Overwrites",E="CRUSH",R="Erasure code profile",k="This profile can't be deleted as it is in use.",x="Loading...",A="-- No erasure code profile available --",V="-- Select an erasure code profile --",F="Profile",O="Used by pools",L="Profile is not in use.",q="Crush ruleset",M="A new crush ruleset will be implicitly created.",B="Crush ruleset",U="There are no rules.",G="-- Select a crush rule --",j="Placement and\n                            replication strategies or distribution policies that allow to\n                            specify how CRUSH places data replicas.",J="This rule can't be deleted as it is in use.",K="Crush rule",Y="Crush steps",H="Used by pools",Q="Rule is not in use.",Z="This field is required!",ee="The rule can't be used in the current cluster as it has too few OSDs to meet the minimum required OSD by this rule.",te="Compression",ie="Mode",ae="Algorithm",oe="Minimum blob size",ce="e.g., 128KiB",se="Maximum blob size",ne="e.g., 512KiB",le="Ratio",re="Compression ratio",be="Loading...",ue="-- No erasure compression algorithm available --",de="Value should be greater than 0",fe="Value should be less than the maximum blob size",me="Value should be greater than 0",he="Value should be greater than the minimum blob size",pe="Value should be between 0.0 and 1.0",ge="The value should be greater or equal to 0",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["id","name","name","name","type","text","placeholder",i,"formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","poolType",1,"cd-col-form-label","required"],a,["id","poolType","formControlName","poolType","name","poolType",1,"form-control","custom-select"],["ngValue",""],o,[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["for","applications",1,"cd-col-form-label"],c,["id","applications",3,"customBadges","customBadgeValidators","messages","data","options","selectionLimit","selection"],["formGroupName","compression",4,"ngIf"],s,["for","max_bytes",1,"cd-col-form-label"],n,l,r,["id","max_bytes","name","max_bytes","type","text","formControlName","max_bytes","placeholder",b,"defaultUnit","GiB","cdDimlessBinary","",1,"form-control"],["for","max_objects",1,"cd-col-form-label"],u,d,f,["id","max_objects","min","0","name","max_objects","type","number","formControlName","max_objects",1,"form-control"],[3,"hidden"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],m,h,p,g,[3,"value"],v,["for","pgAutoscaleMode",1,"cd-col-form-label"],D,["id","pgAutoscaleMode","name","pgAutoscaleMode","formControlName","pgAutoscaleMode",1,"form-control","custom-select"],["class","form-group row",4,"ngIf"],["for","pgNum",1,"cd-col-form-label","required"],W,["id","pgNum","name","pgNum","formControlName","pgNum","min","1","type","number","required","",1,"form-control",3,"focus","blur"],[1,"form-text","text-muted"],["section","pgs","docText",I],["class","form-text text-muted",4,"ngIf"],z,P,C,X,["for","size",1,"cd-col-form-label","required"],S,["id","size","name","size","type","number","formControlName","size",1,"form-control",3,"max","min"],["class","text-warning-dark",4,"ngIf"],[1,"list-inline"],y,_,N,[1,"text-warning-dark"],$,[1,"cd-col-form-label"],T,[1,"custom-control","custom-checkbox"],["type","checkbox","id","ec-overwrites","formControlName","ecOverwrites",1,"custom-control-input"],["for","ec-overwrites",1,"custom-control-label"],w,E,["for","erasureProfile",1,"cd-col-form-label"],R,[1,"input-group"],["id","erasureProfile","name","erasureProfile","formControlName","erasureProfile",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"ngClass","click"],["aria-hidden","true",3,"ngClass"],["class","btn btn-light","type","button",3,"click",4,"ngIf"],["class","btn btn-light","type","button","ngbTooltip",k,"triggers","manual",3,"click",4,"ngIf"],["class","form-text text-muted","id","ecp-info-block",4,"ngIf"],x,[3,"ngValue"],A,V,["type","button",1,"btn","btn-light",3,"click"],["type","button","ngbTooltip",k,"triggers","manual",1,"btn","btn-light",3,"click"],["ecpDeletionBtn","ngbTooltip"],["id","ecp-info-block",1,"form-text","text-muted"],["ngbNav","",1,"nav-tabs"],["ecpInfoTabs","ngbNav"],["ngbNavItem","ecp-info"],["ngbNavLink",""],F,["ngbNavContent",""],["ngbNavItem","used-by-pools"],O,[3,"ngbNavOutlet"],[3,"renderObjects","hideKeys","data","autoReload"],["ecpIsNotUsed",""],[4,"ngIf","ngIfElse"],L,[4,"ngFor","ngForOf"],["for","crushRule",1,"cd-col-form-label"],q,M,B,["noRules",""],U,["id","crushRule","formControlName","crushRule","name","crushSet",1,"form-control","custom-select"],G,["id","crush-info-button","type","button","ngbTooltip",j,1,"btn","btn-light",3,"ngClass","click"],["class","btn btn-light","type","button","ngbTooltip",J,"triggers","manual",3,"click",4,"ngIf"],["class","form-text text-muted","id","crush-info-block",4,"ngIf"],["type","button","ngbTooltip",J,"triggers","manual",1,"btn","btn-light",3,"click"],["crushDeletionBtn","ngbTooltip"],["id","crush-info-block",1,"form-text","text-muted"],["crushInfoTabs","ngbNav"],["ngbNavItem","crush-rule-info"],K,["ngbNavItem","crush-rule-steps"],Y,H,["ruleIsNotUsed",""],Q,Z,ee,["formGroupName","compression"],te,["for","mode",1,"cd-col-form-label"],ie,["id","mode","name","mode","formControlName","mode",1,"form-control","custom-select"],["for","algorithm",1,"cd-col-form-label"],ae,["id","algorithm","name","algorithm","formControlName","algorithm",1,"form-control","custom-select"],["for","minBlobSize",1,"cd-col-form-label"],oe,["id","minBlobSize","name","minBlobSize","formControlName","minBlobSize","type","text","min","0","placeholder",ce,"defaultUnit","KiB","cdDimlessBinary","",1,"form-control"],["for","maxBlobSize",1,"cd-col-form-label"],se,["id","maxBlobSize","type","text","min","0","formControlName","maxBlobSize","placeholder",ne,"defaultUnit","KiB","cdDimlessBinary","",1,"form-control"],["for","ratio",1,"cd-col-form-label"],le,["id","ratio","name","ratio","formControlName","ratio","type","number","min","0","max","1","step","0.1","placeholder",re,1,"form-control"],be,ue,de,fe,me,he,pe,ge]},template:function(e,t){1&e&&p.Pc(0,gi,69,32,"div",0),2&e&&p.uc("cdFormLoading",t.loading)},directives:[Ye.a,o.B,o.r,x.a,o.k,A.a,V.a,o.d,F.a,o.q,o.i,O.a,a.r,o.z,o.u,o.C,a.q,He.a,L.a,Qe.a,o.v,Ze.a,q.a,o.y,et.a,o.b,a.p,s.D,s.p,s.r,s.s,s.q,s.u,tt.a,o.l],pipes:[a.A,M.a],styles:[""]}),e})();var Di=i("5+tZ"),Wi=i("d+Og"),Ii=i("MuvH"),zi=i("+fVR"),Pi=i("VxPD"),Ci=i("uIqm"),Xi=i("x38r"),Si=i("yJti"),yi=i("vCyI"),_i=i("o4+5"),Ni=i("VTlA"),$i=i("EgGo");class Ti{constructor(e){this.pool_name=e}}var wi=i("S7zO"),Ei=i("nQ07"),Ri=(i("jKX/"),i("JP8w")),ki=i("insk"),xi=i("aAWM");function Ai(e,t){if(1&e&&p.Sb(0,"cd-table-key-value",12),2&e){const e=p.nc(2);p.uc("renderObjects",!0)("data",e.poolDetails)("autoReload",!1)}}function Vi(e,t){if(1&e&&p.Sb(0,"cd-grafana",15),2&e){const e=p.nc(3);p.wc("grafanaPath","ceph-pool-detail?var-pool_name=",e.selection.pool_name,"")}}function Fi(e,t){1&e&&(p.Xb(0,"li",13),p.Xb(1,"a",5),p.bc(2,14),p.Wb(),p.Pc(3,Vi,1,1,"ng-template",7),p.Wb())}function Oi(e,t){if(1&e&&p.Sb(0,"cd-rbd-configuration-table",18),2&e){const e=p.nc(3);p.uc("data",e.selectedPoolConfiguration)}}function Li(e,t){1&e&&(p.Xb(0,"li",16),p.Xb(1,"a",5),p.bc(2,17),p.Wb(),p.Pc(3,Oi,1,1,"ng-template",7),p.Wb())}function qi(e,t){if(1&e&&p.Sb(0,"cd-table",21),2&e){const e=p.nc(3);p.uc("data",e.cacheTiers)("columns",e.cacheTierColumns)("autoSave",!1)}}function Mi(e,t){1&e&&(p.Xb(0,"li",19),p.Xb(1,"a",5),p.bc(2,20),p.Wb(),p.Pc(3,qi,1,3,"ng-template",7),p.Wb())}function Bi(e,t){if(1&e&&(p.Vb(0,1),p.Xb(1,"ul",2,3),p.Xb(3,"li",4),p.Xb(4,"a",5),p.bc(5,6),p.Wb(),p.Pc(6,Ai,1,3,"ng-template",7),p.Wb(),p.Pc(7,Fi,4,0,"li",8),p.Pc(8,Li,4,0,"li",9),p.Pc(9,Mi,4,0,"li",10),p.Wb(),p.Sb(10,"div",11),p.Ub()),2&e){const e=p.Fc(2),t=p.nc();p.Db(7),p.uc("ngIf",t.permissions.grafana.read),p.Db(1),p.uc("ngIf","replicated"===t.selection.type),p.Db(1),p.uc("ngIf",(null==t.selection.tiers?null:t.selection.tiers.length)>0),p.Db(1),p.uc("ngbNavOutlet",e)}}let Ui=(()=>{class e{constructor(e){this.poolService=e,this.cacheTierColumns=[],this.omittedPoolAttributes=["cdExecuting","cdIsBinary","stats"],this.cacheTierColumns=[{prop:"pool_name",name:"Name",flexGrow:3},{prop:"cache_mode",name:"Cache Mode",flexGrow:2},{prop:"cache_min_evict_age",name:"Min Evict Age",flexGrow:2},{prop:"cache_min_flush_age",name:"Min Flush Age",flexGrow:2},{prop:"target_max_bytes",name:"Target Max Bytes",flexGrow:2},{prop:"target_max_objects",name:"Target Max Objects",flexGrow:2}]}ngOnChanges(){this.selection&&(this.poolService.getConfiguration(this.selection.pool_name).subscribe(e=>{Ei.a.updateChanged(this,{selectedPoolConfiguration:e})}),Ei.a.updateChanged(this,{poolDetails:d.a.omit(this.selection,this.omittedPoolAttributes)}))}}return e.\u0275fac=function(t){return new(t||e)(p.Rb(D.a))},e.\u0275cmp=p.Lb({type:e,selectors:[["cd-pool-details"]],inputs:{cacheTiers:"cacheTiers",permissions:"permissions",selection:"selection"},features:[p.Bb],decls:1,vars:1,consts:function(){let e,t,i,a;return e="Details",t="Performance Details",i="Configuration",a="Cache Tiers Details",[["cdTableDetail","",4,"ngIf"],["cdTableDetail",""],["ngbNav","","cdStatefulTab","pool-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","performance-details",4,"ngIf"],["ngbNavItem","configuration",4,"ngIf"],["ngbNavItem","cache-tiers-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"renderObjects","data","autoReload"],["ngbNavItem","performance-details"],t,["uid","-xyV8KCiz","grafanaStyle","three",3,"grafanaPath"],["ngbNavItem","configuration"],i,[3,"data"],["ngbNavItem","cache-tiers-details"],a,["columnMode","flex",3,"data","columns","autoSave"]]},template:function(e,t){1&e&&p.Pc(0,Bi,11,4,"ng-container",0),2&e&&p.uc("ngIf",t.selection)},directives:[a.r,s.p,Ri.a,s.r,s.s,s.q,s.u,tt.a,ki.a,xi.a,Ci.a],styles:[""],changeDetection:0}),e})();var Gi=i("GgAd");const ji=["poolUsageTpl"],Ji=["poolConfigurationSourceTpl"];function Ki(e,t){if(1&e){const e=p.Yb();p.Xb(0,"cd-table",9,10),p.lc("fetchData",function(){return p.Ic(e),p.nc().taskListService.fetch()})("setExpandedRow",function(t){return p.Ic(e),p.nc().setExpandedRow(t)})("updateSelection",function(t){return p.Ic(e),p.nc().updateSelection(t)}),p.Sb(2,"cd-table-actions",11),p.Sb(3,"cd-pool-details",12),p.Wb()}if(2&e){const e=p.nc();p.uc("data",e.pools)("columns",e.columns)("hasDetails",!0)("status",e.tableStatus)("autoReload",-1),p.Db(2),p.uc("permission",e.permissions.pool)("selection",e.selection)("tableActions",e.tableActions),p.Db(1),p.uc("selection",e.expandedRow)("permissions",e.permissions)("cacheTiers",e.cacheTiers)}}function Yi(e,t){1&e&&p.Sb(0,"cd-grafana",14),2&e&&p.uc("grafanaPath","ceph-pools-overview?")}function Hi(e,t){1&e&&(p.Xb(0,"li",2),p.Xb(1,"a",3),p.bc(2,13),p.Wb(),p.Pc(3,Yi,1,1,"ng-template",5),p.Wb())}function Qi(e,t){if(1&e&&p.Sb(0,"cd-usage-bar",16),2&e){const e=p.nc().row;p.uc("total",e.stats.bytes_used.latest+e.stats.avail_raw.latest)("used",e.stats.bytes_used.latest)}}function Zi(e,t){if(1&e&&p.Pc(0,Qi,1,2,"cd-usage-bar",15),2&e){const e=t.row;p.uc("ngIf",null==e.stats||null==e.stats.avail_raw?null:e.stats.avail_raw.latest)}}let ea=(()=>{class e extends zi.a{constructor(e,t,i,a,o,c,s,n,l,r,b){super(),this.poolService=e,this.taskWrapper=t,this.ecpService=i,this.authStorageService=a,this.taskListService=o,this.modalService=c,this.pgCategoryService=s,this.dimlessPipe=n,this.urlBuilder=l,this.configurationService=r,this.actionLabels=b,this.selection=new yi.a,this.executingTasks=[],this.tableStatus=new Pi.a,this.cacheTiers=[],this.monAllowPoolDelete=!1,this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{permission:"create",icon:P.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"update",icon:P.a.edit,routerLink:()=>this.urlBuilder.getEdit(encodeURIComponent(this.selection.first().pool_name)),name:this.actionLabels.EDIT},{permission:"delete",icon:P.a.destroy,click:()=>this.deletePoolModal(),name:this.actionLabels.DELETE,disable:this.getDisableDesc.bind(this)}],this.permissions.configOpt.read&&this.configurationService.get("mon_allow_pool_delete").subscribe(e=>{if(d.a.has(e,"value")){const t=d.a.find(e.value,e=>"mon"===e.section)||{value:!1};this.monAllowPoolDelete="true"===t.value}})}ngOnInit(){const e=(e,t,i)=>d.a.get(t,e)>d.a.get(i,e)?1:-1;this.columns=[{prop:"pool_name",name:"Name",flexGrow:4,cellTransformation:Xi.a.executing},{prop:"data_protection",name:"Data Protection",cellTransformation:Xi.a.badge,customTemplateConfig:{class:"badge-background-gray"},flexGrow:1.3},{prop:"application_metadata",name:"Applications",cellTransformation:Xi.a.badge,customTemplateConfig:{class:"badge-background-primary"},flexGrow:1.5},{prop:"pg_status",name:"PG Status",flexGrow:1.2,cellClass:({row:e,column:t,value:i})=>this.getPgStatusCellClass(e,t,i)},{prop:"crush_rule",name:"Crush Ruleset",isHidden:!0,flexGrow:2},{name:"Usage",prop:"usage",cellTemplate:this.poolUsageTpl,flexGrow:1.2},{prop:"stats.rd_bytes.rates",name:"Read bytes",comparator:(t,i,a,o)=>e("stats.rd_bytes.latest",a,o),cellTransformation:Xi.a.sparkline,flexGrow:1.5},{prop:"stats.wr_bytes.rates",name:"Write bytes",comparator:(t,i,a,o)=>e("stats.wr_bytes.latest",a,o),cellTransformation:Xi.a.sparkline,flexGrow:1.5},{prop:"stats.rd.rate",name:"Read ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Xi.a.perSecond},{prop:"stats.wr.rate",name:"Write ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Xi.a.perSecond}],this.taskListService.init(()=>this.ecpService.list().pipe(Object(Di.a)(e=>(this.ecProfileList=e,this.poolService.getList()))),void 0,e=>{this.pools=this.transformPoolsData(e),this.tableStatus=new Pi.a},()=>{this.table.reset(),this.tableStatus=new Pi.a(Si.a.ValueException)},e=>e.name.startsWith("pool/"),(e,t)=>t.metadata.pool_name===e.pool_name,{default:e=>new Ti(e.pool_name)})}updateSelection(e){this.selection=e}deletePoolModal(){const e=this.selection.first().pool_name;this.modalService.show(I.a,{itemDescription:"Pool",itemNames:[e],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new _.a(`pool/${n.e.DELETE}`,{pool_name:e}),call:this.poolService.delete(e)})})}getPgStatusCellClass(e,t,i){return{"text-right":!0,[`pg-${this.pgCategoryService.getTypeByStates(i)}`]:!0}}getErasureCodeProfile(e){let t="";return d.a.forEach(this.ecProfileList,i=>{i.name===e&&(t=`EC: ${i.k}+${i.m}`)}),t}transformPoolsData(e){const t=["bytes_used","max_avail","avail_raw","percent_used","rd_bytes","wr_bytes","rd","wr"],i={latest:0,rate:0,rates:[]};return d.a.forEach(e,e=>{e.pg_status=this.transformPgStatus(e.pg_status);const a={};d.a.forEach(t,t=>{a[t]=e.stats&&e.stats[t]?e.stats[t]:i}),e.stats=a,e.usage=a.percent_used.latest,e.cdExecuting||e.pg_num+e.pg_placement_num===e.pg_num_target+e.pg_placement_num_target||(e.cdExecuting="Updating"),["rd_bytes","wr_bytes"].forEach(t=>{e.stats[t].rates=e.stats[t].rates.map(e=>e[1])}),e.cdIsBinary=!0,"erasure"===e.type&&(e.data_protection=this.getErasureCodeProfile(e.erasure_code_profile)),"replicated"===e.type&&(e.data_protection=`replica: \xd7${e.size}`)}),e}transformPgStatus(e){const t=[];return d.a.forEach(e,(e,i)=>{t.push(`${e} ${i}`)}),t.join(", ")}getSelectionTiers(){if(void 0!==this.expandedRow){const e=this.expandedRow.tiers;this.cacheTiers=this.pools.filter(t=>e.includes(t.pool))}}getDisableDesc(){var e;return!(null===(e=this.selection)||void 0===e?void 0:e.hasSelection)||!this.monAllowPoolDelete&&"Pool deletion is disabled by the mon_allow_pool_delete configuration setting."}setExpandedRow(e){super.setExpandedRow(e),this.getSelectionTiers()}}return e.\u0275fac=function(t){return new(t||e)(p.Rb(D.a),p.Rb(E.a),p.Rb(v),p.Rb($.a),p.Rb(Ni.a),p.Rb(w.a),p.Rb(Wi.a),p.Rb(_i.a),p.Rb($i.a),p.Rb(Ii.a),p.Rb(n.b))},e.\u0275cmp=p.Lb({type:e,selectors:[["cd-pool-list"]],viewQuery:function(e,t){if(1&e&&(p.Wc(Ci.a,1),p.Wc(ji,3),p.Wc(Ji,1)),2&e){let e;p.Ec(e=p.mc())&&(t.table=e.first),p.Ec(e=p.mc())&&(t.poolUsageTpl=e.first),p.Ec(e=p.mc())&&(t.poolConfigurationSourceTpl=e.first)}},features:[p.Cb([Ni.a,{provide:$i.a,useValue:new $i.a("pool")}]),p.Ab],decls:10,vars:2,consts:function(){let e,t;return e="Pools List",t="Overall Performance",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["poolUsageTpl",""],["id","pool-list","selectionType","single",3,"data","columns","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],["id","pool-list-actions",1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","","id","pool-list-details",3,"selection","permissions","cacheTiers"],t,["uid","z99hzWtmk","grafanaStyle","two",3,"grafanaPath"],["decimals","2",3,"total","used",4,"ngIf"],["decimals","2",3,"total","used"]]},template:function(e,t){if(1&e&&(p.Xb(0,"ul",0,1),p.Xb(2,"li",2),p.Xb(3,"a",3),p.bc(4,4),p.Wb(),p.Pc(5,Ki,4,11,"ng-template",5),p.Wb(),p.Pc(6,Hi,4,0,"li",6),p.Wb(),p.Sb(7,"div",7),p.Pc(8,Zi,1,1,"ng-template",null,8,p.Qc)),2&e){const e=p.Fc(1);p.Db(6),p.uc("ngIf",t.permissions.grafana.read),p.Db(1),p.uc("ngbNavOutlet",e)}},directives:[s.p,s.r,s.s,s.q,a.r,s.u,Ci.a,wi.a,Ui,ki.a,Gi.a],styles:["cd-pool-list .pg-clean{color:#0b0}  cd-pool-list .pg-working{color:#2b99a8}  cd-pool-list .pg-warning{color:#ffc200}  cd-pool-list .pg-unknown{color:#ef5c55}"]}),e})(),ta=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=p.Pb({type:e}),e.\u0275inj=p.Ob({imports:[[b.a,a.c,s.t,l.a,c.i,o.x,s.F,r.BlockModule]]}),e})();const ia=[{path:"",component:ea},{path:n.e.CREATE,component:vi,data:{breadcrumbs:n.a.CREATE}},{path:`${n.e.EDIT}/:name`,component:vi,data:{breadcrumbs:n.a.EDIT}}];let aa=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=p.Pb({type:e}),e.\u0275inj=p.Ob({imports:[[ta,c.i.forChild(ia)]]}),e})()}}]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.115992dc55f8e1abedbc.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.115992dc55f8e1abedbc.js
deleted file mode 100644 (file)
index 1a0986f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{OkK6:function(e,t,c){"use strict";c.r(t),c.d(t,"RgwModule",(function(){return ja})),c.d(t,"RoutedRgwModule",(function(){return Va}));var a=c("SVse"),i=c("s7LF"),s=c("iInd"),b=c("G0yt"),o=c("zWsK"),n=c("sne2"),r=c("PCNd"),l=c("G6Q+"),u=c("LvDl"),d=c.n(u),f=c("cp0P"),m=c("LRne"),p=c("PqYM"),g=c("lJxs"),h=c("aGrj"),y=c("mrSG"),S=c("IheW"),_=c("CqXF"),R=c("JIr8"),k=c("9xzX"),v=c("xTzq"),w=c("8Y7J");let z=(()=>{let e=class{constructor(e,t){this.http=e,this.rgwDaemonService=t,this.url="api/rgw/bucket"}list(){return this.rgwDaemonService.request(e=>(e=e.append("stats","true"),this.http.get(this.url,{params:e})))}get(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}`,{params:t}))}create(e,t,c,a,i,s,b){return this.rgwDaemonService.request(o=>this.http.post(this.url,null,{params:new S.e({fromObject:{bucket:e,uid:t,zonegroup:c,placement_target:a,lock_enabled:String(i),lock_mode:s,lock_retention_period_days:b,daemon_name:o.get("daemon_name")}})}))}update(e,t,c,a,i,s,b,o,n){return this.rgwDaemonService.request(r=>(r=(r=(r=(r=(r=(r=(r=(r=r.append("bucket_id",t)).append("uid",c)).append("versioning_state",a)).append("mfa_delete",i)).append("mfa_token_serial",s)).append("mfa_token_pin",b)).append("lock_mode",o)).append("lock_retention_period_days",n),this.http.put(`${this.url}/${e}`,null,{params:r})))}delete(e,t=!0){return this.rgwDaemonService.request(c=>(c=c.append("purge_objects",t?"true":"false"),this.http.delete(`${this.url}/${e}`,{params:c})))}exists(e){return this.get(e).pipe(Object(_.a)(!0),Object(R.a)(e=>(d.a.isFunction(e.preventDefault)&&e.preventDefault(),Object(m.a)(!1))))}getLockDays(e){return e.lock_retention_period_years>0?Math.floor(365.242*e.lock_retention_period_years):e.lock_retention_period_days||0}};return e.\u0275fac=function(t){return new(t||e)(w.dc(S.b),w.dc(k.a))},e.\u0275prov=w.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(y.b)([v.a,Object(y.d)("design:paramtypes",[S.b,k.a])],e),e})(),I=(()=>{let e=class{constructor(e,t){this.http=e,this.rgwDaemonService=t,this.url="api/rgw/site"}get(e){return this.rgwDaemonService.request(t=>(e&&(t=t.append("query",e)),this.http.get(this.url,{params:t})))}};return e.\u0275fac=function(t){return new(t||e)(w.dc(S.b),w.dc(k.a))},e.\u0275prov=w.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(y.b)([v.a,Object(y.d)("design:paramtypes",[S.b,k.a])],e),e})();var x=c("P8lu"),M=c("oxzT"),$=c("mtw6"),q=c("spCT"),N=c("2EZI"),T=c("1Ni5"),E=c("9nlD"),A=function(e){return e.ENABLED="Enabled",e.DISABLED="Disabled",e}({}),C=function(e){return e.ENABLED="Enabled",e.SUSPENDED="Suspended",e}({}),F=c("zc8c"),W=c("NwgZ"),O=c("ocLN"),D=c("ANnk"),j=c("f69J"),P=c("IZUe"),V=c("p4Cf"),B=c("6+kj"),L=c("8xTl");function U(e,t){1&e&&(w.Sb(0,"div",9),w.Sb(1,"label",36),w.Wb(2,37),w.Rb(),w.Sb(3,"div",12),w.Nb(4,"input",38),w.Rb(),w.Rb())}function G(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,40),w.Rb())}function K(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,41),w.Rb())}function Q(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,42),w.Rb())}function J(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,43),w.Rb())}function Z(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,44),w.Rb())}function X(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,45),w.Rb())}function Y(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,46),w.Rb())}function H(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,47),w.Rb())}function ee(e,t){1&e&&(w.Sb(0,"option",48),w.Wb(1,49),w.Rb()),2&e&&w.pc("ngValue",null)}function te(e,t){1&e&&(w.Sb(0,"option",48),w.Wb(1,50),w.Rb()),2&e&&w.pc("ngValue",null)}function ce(e,t){if(1&e&&(w.Sb(0,"option",51),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e),w.yb(1),w.Pc(e)}}function ae(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,52),w.Rb())}function ie(e,t){1&e&&(w.Sb(0,"option",48),w.Wb(1,54),w.Rb()),2&e&&w.pc("ngValue",null)}function se(e,t){1&e&&(w.Sb(0,"option",48),w.Wb(1,55),w.Rb()),2&e&&w.pc("ngValue",null)}function be(e,t){if(1&e&&(w.Sb(0,"option",51),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e.name),w.yb(1),w.Pc(e.description)}}function oe(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,56),w.Rb())}function ne(e,t){if(1&e&&(w.Sb(0,"select",53),w.Mc(1,ie,2,1,"option",19),w.Mc(2,se,2,1,"option",19),w.Mc(3,be,2,2,"option",20),w.Rb(),w.Mc(4,oe,2,0,"span",15)),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(1),w.pc("ngIf",null===t.placementTargets),w.yb(1),w.pc("ngIf",null!==t.placementTargets),w.yb(1),w.pc("ngForOf",t.placementTargets),w.yb(1),w.pc("ngIf",t.bucketForm.showError("placement-target",e,"required"))}}function re(e,t){1&e&&(w.Qb(0),w.Nb(1,"input",57),w.Pb())}function le(e,t){if(1&e){const e=w.Tb();w.Sb(0,"fieldset"),w.Sb(1,"legend",26),w.Wb(2,58),w.Rb(),w.Sb(3,"div",9),w.Sb(4,"div",28),w.Sb(5,"div",29),w.Sb(6,"input",59),w.gc("change",(function(){return w.Dc(e),w.ic(2).setMfaDeleteValidators()})),w.Rb(),w.Sb(7,"label",60),w.Wb(8,61),w.Rb(),w.Sb(9,"cd-helper"),w.Sb(10,"span"),w.Wb(11,62),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb()}}function ue(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,71),w.Rb())}function de(e,t){if(1&e&&(w.Sb(0,"div",9),w.Sb(1,"label",68),w.Wb(2,69),w.Rb(),w.Sb(3,"div",12),w.Nb(4,"input",70),w.Mc(5,ue,2,0,"span",15),w.Rb(),w.Rb()),2&e){w.ic(2);const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.bucketForm.showError("mfa-token-serial",e,"required"))}}function fe(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,75),w.Rb())}function me(e,t){if(1&e&&(w.Sb(0,"div",9),w.Sb(1,"label",72),w.Wb(2,73),w.Rb(),w.Sb(3,"div",12),w.Nb(4,"input",74),w.Mc(5,fe,2,0,"span",15),w.Rb(),w.Rb()),2&e){w.ic(2);const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.bucketForm.showError("mfa-token-pin",e,"required"))}}function pe(e,t){if(1&e){const e=w.Tb();w.Sb(0,"fieldset"),w.Sb(1,"legend",26),w.Wb(2,63),w.Rb(),w.Sb(3,"div",9),w.Sb(4,"div",28),w.Sb(5,"div",29),w.Sb(6,"input",64),w.gc("change",(function(){return w.Dc(e),w.ic(2).setMfaDeleteValidators()})),w.Rb(),w.Sb(7,"label",65),w.Wb(8,66),w.Rb(),w.Sb(9,"cd-helper"),w.Sb(10,"span"),w.Wb(11,67),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(12,de,6,1,"div",8),w.Mc(13,me,6,1,"div",8),w.Rb()}if(2&e){const e=w.ic(2);w.yb(12),w.pc("ngIf",e.areMfaCredentialsRequired()),w.yb(1),w.pc("ngIf",e.areMfaCredentialsRequired())}}function ge(e,t){1&e&&(w.Sb(0,"div",9),w.Sb(1,"label",76),w.Wb(2,77),w.Rb(),w.Sb(3,"div",12),w.Sb(4,"select",78),w.Sb(5,"option",79),w.Wb(6,80),w.Rb(),w.Sb(7,"option",81),w.Wb(8,82),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function he(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,87),w.Rb())}function ye(e,t){1&e&&(w.Sb(0,"span",39),w.Wb(1,88),w.Rb())}function Se(e,t){if(1&e&&(w.Sb(0,"div",9),w.Sb(1,"label",83),w.Qb(2),w.Wb(3,84),w.Pb(),w.Sb(4,"cd-helper"),w.Wb(5,85),w.Rb(),w.Rb(),w.Sb(6,"div",12),w.Nb(7,"input",86),w.Mc(8,he,2,0,"span",15),w.Mc(9,ye,2,0,"span",15),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(8),w.pc("ngIf",t.bucketForm.showError("lock_retention_period_days",e,"pattern")),w.yb(1),w.pc("ngIf",t.bucketForm.showError("lock_retention_period_days",e,"lockDays"))}}const _e=function(e){return{required:e}};function Re(e,t){if(1&e){const e=w.Tb();w.Sb(0,"div",1),w.Sb(1,"form",2,3),w.Sb(3,"div",4),w.Sb(4,"div",5),w.Wb(5,6),w.jc(6,"titlecase"),w.jc(7,"upperFirst"),w.Rb(),w.Sb(8,"div",7),w.Mc(9,U,5,0,"div",8),w.Sb(10,"div",9),w.Sb(11,"label",10),w.Wb(12,11),w.Rb(),w.Sb(13,"div",12),w.Sb(14,"input",13),w.Yb(15,14),w.Rb(),w.Mc(16,G,2,0,"span",15),w.Mc(17,K,2,0,"span",15),w.Mc(18,Q,2,0,"span",15),w.Mc(19,J,2,0,"span",15),w.Mc(20,Z,2,0,"span",15),w.Mc(21,X,2,0,"span",15),w.Mc(22,Y,2,0,"span",15),w.Mc(23,H,2,0,"span",15),w.Rb(),w.Rb(),w.Sb(24,"div",9),w.Sb(25,"label",16),w.Wb(26,17),w.Rb(),w.Sb(27,"div",12),w.Sb(28,"select",18),w.Mc(29,ee,2,1,"option",19),w.Mc(30,te,2,1,"option",19),w.Mc(31,ce,2,2,"option",20),w.Rb(),w.Mc(32,ae,2,0,"span",15),w.Rb(),w.Rb(),w.Sb(33,"div",9),w.Sb(34,"label",21),w.Wb(35,22),w.Rb(),w.Sb(36,"div",12),w.Mc(37,ne,5,4,"ng-template",null,23,w.Nc),w.Mc(39,re,2,0,"ng-container",24),w.Rb(),w.Rb(),w.Mc(40,le,12,0,"fieldset",25),w.Mc(41,pe,14,2,"fieldset",25),w.Sb(42,"fieldset"),w.Sb(43,"legend",26),w.Wb(44,27),w.Rb(),w.Sb(45,"div",9),w.Sb(46,"div",28),w.Sb(47,"div",29),w.Nb(48,"input",30),w.Sb(49,"label",31),w.Wb(50,32),w.Rb(),w.Sb(51,"cd-helper"),w.Sb(52,"span"),w.Wb(53,33),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(54,ge,9,0,"div",8),w.Mc(55,Se,10,2,"div",8),w.Rb(),w.Rb(),w.Sb(56,"div",34),w.Sb(57,"cd-form-button-panel",35),w.gc("submitActionEvent",(function(){return w.Dc(e),w.ic().submit()})),w.jc(58,"titlecase"),w.jc(59,"upperFirst"),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.Ac(2),t=w.Ac(38),c=w.ic();w.yb(1),w.pc("formGroup",c.bucketForm),w.yb(6),w.ac(w.kc(6,29,c.action))(w.kc(7,31,c.resource)),w.Xb(5),w.yb(2),w.pc("ngIf",c.editing),w.yb(2),w.pc("ngClass",w.uc(37,_e,!c.editing)),w.yb(3),w.pc("readonly",c.editing)("autofocus",!c.editing),w.yb(2),w.pc("ngIf",c.bucketForm.showError("bid",e,"required")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"bucketNameInvalid")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"bucketNameExists")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"containsUpperCase")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"lowerCaseOrNumber")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"ipAddress")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"onlyLowerCaseAndNumbers")),w.yb(1),w.pc("ngIf",c.bucketForm.showError("bid",e,"shouldBeInRange")),w.yb(5),w.pc("autofocus",c.editing),w.yb(1),w.pc("ngIf",null===c.owners),w.yb(1),w.pc("ngIf",null!==c.owners),w.yb(1),w.pc("ngForOf",c.owners),w.yb(1),w.pc("ngIf",c.bucketForm.showError("owner",e,"required")),w.yb(2),w.pc("ngClass",w.uc(39,_e,!c.editing)),w.yb(5),w.pc("ngIf",c.editing)("ngIfElse",t),w.yb(1),w.pc("ngIf",c.editing),w.yb(1),w.pc("ngIf",c.editing),w.yb(13),w.pc("ngIf",c.bucketForm.getValue("lock_enabled")),w.yb(1),w.pc("ngIf",c.bucketForm.getValue("lock_enabled")),w.yb(2),w.pc("form",c.bucketForm)("submitText",w.kc(58,33,c.action)+" "+w.kc(59,35,c.resource))}}let ke=(()=>{class e extends q.a{constructor(e,t,c,a,i,s,b,o){super(),this.route=e,this.router=t,this.formBuilder=c,this.rgwBucketService=a,this.rgwSiteService=i,this.rgwUserService=s,this.notificationService=b,this.actionLabels=o,this.editing=!1,this.owners=null,this.placementTargets=[],this.isVersioningAlreadyEnabled=!1,this.isMfaDeleteAlreadyEnabled=!1,this.icons=M.a,this.editing=this.router.url.startsWith("/rgw/bucket/"+n.e.EDIT),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.resource="bucket",this.createForm()}get isVersioningEnabled(){return this.bucketForm.getValue("versioning")}get isMfaDeleteEnabled(){return this.bucketForm.getValue("mfa-delete")}createForm(){const e=this,t=T.a.custom("lockDays",()=>{if(!e.bucketForm||!d.a.get(e.bucketForm.getRawValue(),"lock_enabled"))return!1;const t=Number(e.bucketForm.getValue("lock_retention_period_days"));return!Number.isInteger(t)||0===t});this.bucketForm=this.formBuilder.group({id:[null],bid:[null,[i.A.required],this.editing?[]:[this.bucketNameValidator()]],owner:[null,[i.A.required]],"placement-target":[null,this.editing?[]:[i.A.required]],versioning:[null],"mfa-delete":[null],"mfa-token-serial":[""],"mfa-token-pin":[""],lock_enabled:[{value:!1,disabled:this.editing}],lock_mode:["COMPLIANCE"],lock_retention_period_days:[0,[T.a.number(!1),t]]})}ngOnInit(){const e={owners:this.rgwUserService.enumerate()};this.editing||(e.getPlacementTargets=this.rgwSiteService.get("placement-targets")),this.route.params.subscribe(t=>{if(t.hasOwnProperty("bid")){const c=decodeURIComponent(t.bid);e.getBid=this.rgwBucketService.get(c)}Object(f.a)(e).subscribe(e=>{if(this.owners=e.owners.sort(),e.getPlacementTargets){const t=e.getPlacementTargets;this.zonegroup=t.zonegroup,d.a.forEach(t.placement_targets,e=>{e.description=`${e.name} (${"pool"}: ${e.data_pool})`,this.placementTargets.push(e)}),1===this.placementTargets.length&&this.bucketForm.get("placement-target").setValue(this.placementTargets[0].name)}if(e.getBid){const t=e.getBid,c=d.a.clone(this.bucketForm.getRawValue());let a=d.a.pick(t,d.a.keys(c));a.lock_retention_period_days=this.rgwBucketService.getLockDays(t),a["placement-target"]=t.placement_rule,a.versioning=t.versioning===C.ENABLED,a["mfa-delete"]=t.mfa_delete===A.ENABLED,a=d.a.merge(c,a),this.bucketForm.setValue(a),this.editing&&(this.isVersioningAlreadyEnabled=this.isVersioningEnabled,this.isMfaDeleteAlreadyEnabled=this.isMfaDeleteEnabled,this.setMfaDeleteValidators(),a.lock_enabled&&this.bucketForm.controls.versioning.disable())}this.loadingReady()})})}goToListView(){this.router.navigate(["/rgw/bucket"])}submit(){if(this.bucketForm.pristine)return void this.goToListView();const e=this.bucketForm.value;if(this.editing){const t=this.getVersioningStatus(),c=this.getMfaDeleteStatus();this.rgwBucketService.update(e.bid,e.id,e.owner,t,c,e["mfa-token-serial"],e["mfa-token-pin"],e.lock_mode,e.lock_retention_period_days).subscribe(()=>{this.notificationService.show($.a.success,"Updated Object Gateway bucket '" + e.bid + "'."),this.goToListView()},()=>{this.bucketForm.setErrors({cdSubmitButton:!0})})}else this.rgwBucketService.create(e.bid,e.owner,this.zonegroup,e["placement-target"],e.lock_enabled,e.lock_mode,e.lock_retention_period_days).subscribe(()=>{this.notificationService.show($.a.success,"Created Object Gateway bucket '" + e.bid + "'"),this.goToListView()},()=>{this.bucketForm.setErrors({cdSubmitButton:!0})})}bucketNameValidator(){return e=>{if(e.pristine||""===e.value)return Object(m.a)(null);const t=[];let c;return t.push(()=>{const e=this.bucketForm.get("bid").value;let t=!0;return(/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(e)||/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i.test(e))&&(c="ipAddress",t=!1),t}),t.push(e=>!!d.a.inRange(e.length,3,64)||(c="shouldBeInRange",!1)),t.push(e=>{const t=d.a.split(e,".");return d.a.every(t,t=>t!==d.a.toLower(t)||t.includes("_")?(c="containsUpperCase",!1):/^\S*$/.test(e)&&/[0-9a-z-]/.test(t)?d.a.every([0,t.length-1],e=>(c="lowerCaseOrNumber",/[a-z]/.test(t[e])||d.a.isInteger(d.a.parseInt(t[e])))):(c="onlyLowerCaseAndNumbers",!1))}),d.a.every(t,t=>t(e.value))?Object(p.a)().pipe(Object(h.a)(this.rgwBucketService.exists.call(this.rgwBucketService,e.value)),Object(g.a)(e=>e?{bucketNameExists:!0}:null)):Object(p.a)().pipe(Object(g.a)(()=>{switch(c){case"onlyLowerCaseAndNumbers":return{onlyLowerCaseAndNumbers:!0};case"shouldBeInRange":return{shouldBeInRange:!0};case"ipAddress":return{ipAddress:!0};case"containsUpperCase":return{containsUpperCase:!0};case"lowerCaseOrNumber":return{lowerCaseOrNumber:!0};default:return{bucketNameInvalid:!0}}}))}}areMfaCredentialsRequired(){return this.isMfaDeleteEnabled!==this.isMfaDeleteAlreadyEnabled||this.isMfaDeleteAlreadyEnabled&&this.isVersioningEnabled!==this.isVersioningAlreadyEnabled}setMfaDeleteValidators(){const e=this.bucketForm.get("mfa-token-serial"),t=this.bucketForm.get("mfa-token-pin");this.areMfaCredentialsRequired()?(e.setValidators(i.A.required),t.setValidators(i.A.required)):(e.setValidators(null),t.setValidators(null)),e.updateValueAndValidity(),t.updateValueAndValidity()}getVersioningStatus(){return this.isVersioningEnabled?C.ENABLED:C.SUSPENDED}getMfaDeleteStatus(){return this.isMfaDeleteEnabled?A.ENABLED:A.DISABLED}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(s.a),w.Mb(s.e),w.Mb(N.a),w.Mb(z),w.Mb(I),w.Mb(x.a),w.Mb(E.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-bucket-form"]],features:[w.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","bucketForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","bid",1,"cd-col-form-label",3,"ngClass"],"Name",[1,"cd-col-form-input"],["id","bid","name","bid","type","text","formControlName","bid",1,"form-control",3,"readonly","autofocus",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","owner",1,"cd-col-form-label","required"],"Owner",["id","owner","name","owner","formControlName","owner",1,"form-control","custom-select",3,"autofocus"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["for","placement-target",1,"cd-col-form-label",3,"ngClass"],"Placement target",["placementTargetSelect",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"cd-header"],"Locking",[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","lock_enabled","formControlName","lock_enabled","type","checkbox",1,"custom-control-input"],["for","lock_enabled",1,"custom-control-label"],"Enabled","Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket.",[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","id",1,"cd-col-form-label"],"Id",["id","id","name","id","type","text","formControlName","id","readonly","",1,"form-control"],[1,"invalid-feedback"],"This field is required.","The value is not valid.","The chosen name is already in use.","Bucket names must not contain uppercase characters or underscores.","Each label must start and end with a lowercase letter or a number.","Bucket names cannot be formatted as IP address.","Bucket names can only contain lowercase letters, numbers, and hyphens.","Bucket names must be 3 to 63 characters long.",[3,"ngValue"],"Loading...","-- Select a user --",[3,"value"],"This field is required.",["id","placement-target","name","placement-target","formControlName","placement-target",1,"form-control","custom-select"],"Loading...","-- Select a placement target --","This field is required.",["id","placement-target","name","placement-target","formControlName","placement-target","type","text","readonly","",1,"form-control"],"Versioning",["type","checkbox","id","versioning","name","versioning","formControlName","versioning",1,"custom-control-input",3,"change"],["for","versioning",1,"custom-control-label"],"Enabled","Enables versioning for the objects in the bucket.","Multi-Factor Authentication",["type","checkbox","id","mfa-delete","name","mfa-delete","formControlName","mfa-delete",1,"custom-control-input",3,"change"],["for","mfa-delete",1,"custom-control-label"],"Delete enabled","Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state.",["for","mfa-token-serial",1,"cd-col-form-label"],"Token Serial Number",["type","text","id","mfa-token-serial","name","mfa-token-serial","formControlName","mfa-token-serial",1,"form-control"],"This field is required.",["for","mfa-token-pin",1,"cd-col-form-label"],"Token PIN",["type","text","id","mfa-token-pin","name","mfa-token-pin","formControlName","mfa-token-pin",1,"form-control"],"This field is required.",["for","lock_mode",1,"cd-col-form-label"],"Mode",["formControlName","lock_mode","name","lock_mode","id","lock_mode",1,"form-control","custom-select"],["value","COMPLIANCE"],"Compliance",["value","GOVERNANCE"],"Governance",["for","lock_retention_period_days",1,"cd-col-form-label"],"Days","The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.",["type","number","id","lock_retention_period_days","formControlName","lock_retention_period_days","min","0",1,"form-control"],"The entered value must be a positive integer.","Retention Days must be a positive integer."]},template:function(e,t){1&e&&w.Mc(0,Re,60,41,"div",0),2&e&&w.pc("cdFormLoading",t.loading)},directives:[F.a,i.C,i.r,W.a,i.k,a.r,O.a,a.p,D.a,i.d,j.a,i.q,i.i,P.a,i.z,a.q,i.b,V.a,B.a,i.u,i.B,i.v],pipes:[a.A,L.a],styles:[""]}),e})();var ve=c("HDdC"),we=c("+fVR"),ze=c("0+/T"),Ie=c("uIqm"),xe=c("vCyI"),Me=c("Fgil"),$e=c("o4+5"),qe=c("aexS"),Ne=c("JK/P"),Te=c("EgGo"),Ee=c("S7zO"),Ae=c("a0VL"),Ce=c("iExv");function Fe(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,24),w.Rb())}function We(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.jc(2,"dimless"),w.Rb()),2&e){const e=w.ic(3);w.yb(1),w.Qc(" ",w.kc(2,1,e.selection.bucket_quota.max_size)," ")}}function Oe(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,25),w.Rb())}function De(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.Rb()),2&e){const e=w.ic(3);w.yb(1),w.Qc(" ",e.selection.bucket_quota.max_objects," ")}}function je(e,t){if(1&e&&(w.Sb(0,"div"),w.Sb(1,"legend"),w.Wb(2,20),w.Rb(),w.Sb(3,"table",1),w.Sb(4,"tbody"),w.Sb(5,"tr"),w.Sb(6,"td",2),w.Wb(7,21),w.Rb(),w.Sb(8,"td",4),w.Oc(9),w.jc(10,"booleanText"),w.Rb(),w.Rb(),w.Sb(11,"tr"),w.Sb(12,"td",5),w.Wb(13,22),w.Rb(),w.Mc(14,Fe,2,0,"td",0),w.Mc(15,We,3,3,"td",0),w.Rb(),w.Sb(16,"tr"),w.Sb(17,"td",5),w.Wb(18,23),w.Rb(),w.Mc(19,Oe,2,0,"td",0),w.Mc(20,De,2,1,"td",0),w.Rb(),w.Rb(),w.Rb(),w.Rb()),2&e){const e=w.ic(2);w.yb(9),w.Pc(w.kc(10,5,e.selection.bucket_quota.enabled)),w.yb(5),w.pc("ngIf",e.selection.bucket_quota.max_size<=-1),w.yb(1),w.pc("ngIf",e.selection.bucket_quota.max_size>-1),w.yb(4),w.pc("ngIf",e.selection.bucket_quota.max_objects<=-1),w.yb(1),w.pc("ngIf",e.selection.bucket_quota.max_objects>-1)}}function Pe(e,t){if(1&e&&(w.Qb(0),w.Sb(1,"tr"),w.Sb(2,"td",5),w.Wb(3,26),w.Rb(),w.Sb(4,"td"),w.Oc(5),w.Rb(),w.Rb(),w.Sb(6,"tr"),w.Sb(7,"td",5),w.Wb(8,27),w.Rb(),w.Sb(9,"td"),w.Oc(10),w.Rb(),w.Rb(),w.Pb()),2&e){const e=w.ic(2);w.yb(5),w.Pc(e.selection.lock_mode),w.yb(5),w.Pc(e.selection.lock_retention_period_days)}}function Ve(e,t){if(1&e&&(w.Qb(0),w.Sb(1,"table",1),w.Sb(2,"tbody"),w.Sb(3,"tr"),w.Sb(4,"td",2),w.Wb(5,3),w.Rb(),w.Sb(6,"td",4),w.Oc(7),w.Rb(),w.Rb(),w.Sb(8,"tr"),w.Sb(9,"td",5),w.Wb(10,6),w.Rb(),w.Sb(11,"td"),w.Oc(12),w.Rb(),w.Rb(),w.Sb(13,"tr"),w.Sb(14,"td",5),w.Wb(15,7),w.Rb(),w.Sb(16,"td"),w.Oc(17),w.Rb(),w.Rb(),w.Sb(18,"tr"),w.Sb(19,"td",5),w.Wb(20,8),w.Rb(),w.Sb(21,"td"),w.Oc(22),w.Rb(),w.Rb(),w.Sb(23,"tr"),w.Sb(24,"td",5),w.Wb(25,9),w.Rb(),w.Sb(26,"td"),w.Oc(27),w.Rb(),w.Rb(),w.Sb(28,"tr"),w.Sb(29,"td",5),w.Wb(30,10),w.Rb(),w.Sb(31,"td"),w.Oc(32),w.Rb(),w.Rb(),w.Sb(33,"tr"),w.Sb(34,"td",5),w.Wb(35,11),w.Rb(),w.Sb(36,"td"),w.Oc(37),w.Rb(),w.Rb(),w.Sb(38,"tr"),w.Sb(39,"td",5),w.Wb(40,12),w.Rb(),w.Sb(41,"td"),w.Oc(42),w.Rb(),w.Rb(),w.Sb(43,"tr"),w.Sb(44,"td",5),w.Wb(45,13),w.Rb(),w.Sb(46,"td"),w.Oc(47),w.Rb(),w.Rb(),w.Sb(48,"tr"),w.Sb(49,"td",5),w.Wb(50,14),w.Rb(),w.Sb(51,"td"),w.Oc(52),w.jc(53,"cdDate"),w.Rb(),w.Rb(),w.Sb(54,"tr"),w.Sb(55,"td",5),w.Wb(56,15),w.Rb(),w.Sb(57,"td"),w.Oc(58),w.Rb(),w.Rb(),w.Sb(59,"tr"),w.Sb(60,"td",5),w.Wb(61,16),w.Rb(),w.Sb(62,"td"),w.Oc(63),w.Rb(),w.Rb(),w.Sb(64,"tr"),w.Sb(65,"td",5),w.Wb(66,17),w.Rb(),w.Sb(67,"td"),w.Oc(68),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(69,je,21,7,"div",0),w.Sb(70,"legend"),w.Wb(71,18),w.Rb(),w.Sb(72,"table",1),w.Sb(73,"tbody"),w.Sb(74,"tr"),w.Sb(75,"td",2),w.Wb(76,19),w.Rb(),w.Sb(77,"td",4),w.Oc(78),w.jc(79,"booleanText"),w.Rb(),w.Rb(),w.Mc(80,Pe,11,2,"ng-container",0),w.Rb(),w.Rb(),w.Pb()),2&e){const e=w.ic();w.yb(7),w.Pc(e.selection.bid),w.yb(5),w.Pc(e.selection.id),w.yb(5),w.Pc(e.selection.owner),w.yb(5),w.Pc(e.selection.index_type),w.yb(5),w.Pc(e.selection.placement_rule),w.yb(5),w.Pc(e.selection.marker),w.yb(5),w.Pc(e.selection.max_marker),w.yb(5),w.Pc(e.selection.ver),w.yb(5),w.Pc(e.selection.master_ver),w.yb(5),w.Pc(w.kc(53,16,e.selection.mtime)),w.yb(6),w.Pc(e.selection.zonegroup),w.yb(5),w.Pc(e.selection.versioning),w.yb(5),w.Pc(e.selection.mfa_delete),w.yb(1),w.pc("ngIf",e.selection.bucket_quota),w.yb(9),w.Pc(w.kc(79,18,e.selection.lock_enabled)),w.yb(2),w.pc("ngIf",e.selection.lock_enabled)}}let Be=(()=>{class e{constructor(e){this.rgwBucketService=e}ngOnChanges(){this.selection&&this.rgwBucketService.get(this.selection.bid).subscribe(e=>{e.lock_retention_period_days=this.rgwBucketService.getLockDays(e),this.selection=e})}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(z))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-bucket-details"]],inputs:{selection:"selection"},features:[w.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],"Name",[1,"w-75"],[1,"bold"],"ID","Owner","Index type","Placement rule","Marker","Maximum marker","Version","Master version","Modification time","Zonegroup","Versioning","MFA Delete","Locking","Enabled","Bucket quota","Enabled","Maximum size","Maximum objects","Unlimited","Unlimited","Mode","Days"]},template:function(e,t){1&e&&w.Mc(0,Ve,81,20,"ng-container",0),2&e&&w.pc("ngIf",t.selection)},directives:[a.r],pipes:[Ae.a,Ce.a,$e.a],styles:["table[_ngcontent-%COMP%]{table-layout:fixed}table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{word-wrap:break-word}"]}),e})();var Le=c("GgAd");const Ue=["bucketSizeTpl"],Ge=["bucketObjectTpl"];function Ke(e,t){if(1&e&&w.Nb(0,"cd-usage-bar",8),2&e){const e=w.ic().row;w.pc("total",e.bucket_quota.max_size)("used",e.bucket_size)}}function Qe(e,t){1&e&&w.Wb(0,9)}function Je(e,t){if(1&e&&(w.Mc(0,Ke,1,2,"cd-usage-bar",6),w.Mc(1,Qe,1,0,"ng-template",null,7,w.Nc)),2&e){const e=t.row,c=w.Ac(2);w.pc("ngIf",e.bucket_quota.max_size>0&&e.bucket_quota.enabled)("ngIfElse",c)}}function Ze(e,t){if(1&e&&w.Nb(0,"cd-usage-bar",12),2&e){const e=w.ic().row;w.pc("total",e.bucket_quota.max_objects)("used",e.num_objects)("isBinary",!1)}}function Xe(e,t){1&e&&w.Wb(0,13)}function Ye(e,t){if(1&e&&(w.Mc(0,Ze,1,3,"cd-usage-bar",10),w.Mc(1,Xe,1,0,"ng-template",null,11,w.Nc)),2&e){const e=t.row,c=w.Ac(2);w.pc("ngIf",e.bucket_quota.max_objects>0&&e.bucket_quota.enabled)("ngIfElse",c)}}let He=(()=>{class e extends we.a{constructor(e,t,c,a,i,s,b,o){super(o),this.authStorageService=e,this.dimlessBinaryPipe=t,this.dimlessPipe=c,this.rgwBucketService=a,this.modalService=i,this.urlBuilder=s,this.actionLabels=b,this.ngZone=o,this.columns=[],this.buckets=[],this.selection=new xe.a}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Name",prop:"bid",flexGrow:2},{name:"Owner",prop:"owner",flexGrow:2.5},{name:"Used Capacity",prop:"bucket_size",flexGrow:.6,pipe:this.dimlessBinaryPipe},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.bucketSizeTpl,flexGrow:.8},{name:"Objects",prop:"num_objects",flexGrow:.6,pipe:this.dimlessPipe},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.bucketObjectTpl,flexGrow:.8}];const e=()=>this.selection.first()&&""+encodeURIComponent(this.selection.first().bid);this.tableActions=[{permission:"create",icon:M.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection},{permission:"update",icon:M.a.edit,routerLink:()=>this.urlBuilder.getEdit(e()),name:this.actionLabels.EDIT},{permission:"delete",icon:M.a.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:e=>e.hasMultiSelection}],this.setTableRefreshTimeout()}transformBucketData(){d.a.forEach(this.buckets,e=>{const t=e.bucket_quota.max_size,c=e.bucket_quota.max_objects;e.bucket_size=0,e.num_objects=0,d.a.isEmpty(e.usage)||(e.bucket_size=e.usage["rgw.main"].size_actual,e.num_objects=e.usage["rgw.main"].num_objects),e.size_usage=t>0?e.bucket_size/t:void 0,e.object_usage=c>0?e.num_objects/c:void 0})}getBucketList(e){this.setTableRefreshTimeout(),this.rgwBucketService.list().subscribe(e=>{this.buckets=e,this.transformBucketData()},()=>{e.error()})}updateSelection(e){this.selection=e}deleteAction(){this.modalService.show(ze.a,{itemDescription:this.selection.hasSingleSelection?"bucket":"buckets",itemNames:this.selection.selected.map(e=>e.bid),submitActionObservable:()=>new ve.a(e=>{Object(f.a)(this.selection.selected.map(e=>this.rgwBucketService.delete(e.bid))).subscribe({error:t=>{e.error(t),this.table.refreshBtn()},complete:()=>{e.complete(),this.table.refreshBtn()}})})})}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(qe.a),w.Mb(Me.a),w.Mb($e.a),w.Mb(z),w.Mb(Ne.a),w.Mb(Te.a),w.Mb(n.b),w.Mb(w.A))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-bucket-list"]],viewQuery:function(e,t){var c;1&e&&(w.Jc(Ie.a,!0),w.Jc(Ue,!0),w.Jc(Ge,!0)),2&e&&(w.zc(c=w.hc())&&(t.table=c.first),w.zc(c=w.hc())&&(t.bucketSizeTpl=c.first),w.zc(c=w.hc())&&(t.bucketObjectTpl=c.first))},features:[w.xb([{provide:Te.a,useValue:new Te.a("rgw/bucket")}]),w.vb],decls:8,vars:9,consts:function(){return[["columnMode","flex","selectionType","multiClick","identifier","bid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["bucketSizeTpl",""],["bucketObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],"No Limit",[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],"No Limit"]},template:function(e,t){1&e&&(w.Sb(0,"cd-table",0,1),w.gc("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)}))("fetchData",(function(e){return t.getBucketList(e)})),w.Nb(2,"cd-table-actions",2),w.Nb(3,"cd-rgw-bucket-details",3),w.Rb(),w.Mc(4,Je,3,2,"ng-template",null,4,w.Nc),w.Mc(6,Ye,3,2,"ng-template",null,5,w.Nc)),2&e&&(w.pc("autoReload",!1)("data",t.buckets)("columns",t.columns)("hasDetails",!0)("status",t.tableStatus),w.yb(2),w.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),w.yb(1),w.pc("selection",t.expandedRow))},directives:[Ie.a,Ee.a,Be,a.r,Le.a],styles:[""]}),e})();var et=c("IzEk"),tt=c("85J/"),ct=c("JP8w"),at=c("FSuO"),it=c("b5OY"),st=c("insk");function bt(e,t){if(1&e){const e=w.Tb();w.Sb(0,"cd-table-key-value",11),w.gc("fetchData",(function(){return w.Dc(e),w.ic(2).getMetaData()})),w.Rb()}if(2&e){const e=w.ic(2);w.pc("data",e.metadata)}}function ot(e,t){if(1&e&&w.Nb(0,"cd-table-performance-counter",12),2&e){const e=w.ic(2);w.pc("serviceId",e.serviceMapId)}}function nt(e,t){if(1&e&&w.Nb(0,"cd-grafana",15),2&e){const e=w.ic(3);w.pc("grafanaPath","rgw-instance-detail?var-rgw_servers=rgw."+e.serviceId)}}function rt(e,t){1&e&&(w.Sb(0,"li",13),w.Sb(1,"a",4),w.Wb(2,14),w.Rb(),w.Mc(3,nt,1,1,"ng-template",6),w.Rb())}function lt(e,t){if(1&e&&(w.Qb(0),w.Sb(1,"ul",1,2),w.Sb(3,"li",3),w.Sb(4,"a",4),w.Wb(5,5),w.Rb(),w.Mc(6,bt,1,1,"ng-template",6),w.Rb(),w.Sb(7,"li",7),w.Sb(8,"a",4),w.Wb(9,8),w.Rb(),w.Mc(10,ot,1,1,"ng-template",6),w.Rb(),w.Mc(11,rt,4,0,"li",9),w.Rb(),w.Nb(12,"div",10),w.Pb()),2&e){const e=w.Ac(2),t=w.ic();w.yb(11),w.pc("ngIf",t.grafanaPermission.read),w.yb(1),w.pc("ngbNavOutlet",e)}}let ut=(()=>{class e{constructor(e,t){this.rgwDaemonService=e,this.authStorageService=t,this.serviceId="",this.serviceMapId="",this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){this.selection&&(this.serviceId=this.selection.id,this.serviceMapId=this.selection.service_map_id)}getMetaData(){d.a.isEmpty(this.serviceId)||this.rgwDaemonService.get(this.serviceId).subscribe(e=>{this.metadata=e.rgw_metadata})}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(k.a),w.Mb(qe.a))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-daemon-details"]],inputs:{selection:"selection"},features:[w.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-daemon-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","performance-counters"],"Performance Counters",["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"data","fetchData"],["serviceType","rgw",3,"serviceId"],["ngbNavItem","performance-details"],"Performance Details",["uid","x5ARzZtmk","grafanaStyle","one",3,"grafanaPath"]]},template:function(e,t){1&e&&w.Mc(0,lt,13,2,"ng-container",0),2&e&&w.pc("ngIf",t.selection)},directives:[a.r,b.p,ct.a,b.r,b.s,b.q,b.u,at.a,it.a,st.a],styles:[""]}),e})();function dt(e,t){if(1&e){const e=w.Tb();w.Sb(0,"cd-table",8),w.gc("setExpandedRow",(function(t){return w.Dc(e),w.ic().setExpandedRow(t)}))("fetchData",(function(t){return w.Dc(e),w.ic().getDaemonList(t)})),w.Nb(1,"cd-rgw-daemon-details",9),w.Rb()}if(2&e){const e=w.ic();w.pc("data",e.daemons)("columns",e.columns)("hasDetails",!0),w.yb(1),w.pc("selection",e.expandedRow)}}function ft(e,t){1&e&&w.Nb(0,"cd-grafana",11),2&e&&w.pc("grafanaPath","rgw-overview?")}function mt(e,t){1&e&&(w.Sb(0,"li",2),w.Sb(1,"a",3),w.Wb(2,10),w.Rb(),w.Mc(3,ft,1,1,"ng-template",5),w.Rb())}function pt(e,t){1&e&&w.Nb(0,"cd-grafana",13),2&e&&w.pc("grafanaPath","radosgw-sync-overview?")}function gt(e,t){1&e&&(w.Sb(0,"li",2),w.Sb(1,"a",3),w.Wb(2,12),w.Rb(),w.Mc(3,pt,1,1,"ng-template",5),w.Rb())}let ht=(()=>{class e extends we.a{constructor(e,t,c,a){super(),this.rgwDaemonService=e,this.authStorageService=t,this.cephShortVersionPipe=c,this.rgwSiteService=a,this.columns=[],this.daemons=[]}ngOnInit(){this.grafanaPermission=this.authStorageService.getPermissions().grafana,this.columns=[{name:"ID",prop:"id",flexGrow:2},{name:"Hostname",prop:"server_hostname",flexGrow:2},{name:"Zone Group",prop:"zonegroup_name",flexGrow:2},{name:"Zone",prop:"zone_name",flexGrow:2},{name:"Version",prop:"version",flexGrow:1,pipe:this.cephShortVersionPipe}],this.rgwSiteService.get("realms").subscribe(e=>this.isMultiSite=e.length>0)}getDaemonList(e){this.rgwDaemonService.daemons$.pipe(Object(et.a)(1)).subscribe(e=>{this.daemons=e},()=>{e.error()})}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(k.a),w.Mb(qe.a),w.Mb(tt.a),w.Mb(I))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-daemon-list"]],features:[w.vb],decls:9,vars:3,consts:function(){return[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],"Daemons List",["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["columnMode","flex",3,"data","columns","hasDetails","setExpandedRow","fetchData"],["cdTableDetail","",3,"selection"],"Overall Performance",["uid","WAkugZpiz","grafanaStyle","two",3,"grafanaPath"],"Sync Performance",["uid","rgw-sync-overview","grafanaStyle","two",3,"grafanaPath"]]},template:function(e,t){if(1&e&&(w.Sb(0,"ul",0,1),w.Sb(2,"li",2),w.Sb(3,"a",3),w.Wb(4,4),w.Rb(),w.Mc(5,dt,2,4,"ng-template",5),w.Rb(),w.Mc(6,mt,4,0,"li",6),w.Mc(7,gt,4,0,"li",6),w.Rb(),w.Nb(8,"div",7)),2&e){const e=w.Ac(1);w.yb(6),w.pc("ngIf",t.grafanaPermission.read),w.yb(1),w.pc("ngIf",t.grafanaPermission.read&&t.isMultiSite),w.yb(1),w.pc("ngbNavOutlet",e)}},directives:[b.p,b.r,b.s,b.q,a.r,b.u,Ie.a,ut,st.a],styles:[""]}),e})();var yt=c("GyhO"),St=c("aXbf"),_t=function(e){return e.USERS="users",e.BUCKETS="buckets",e.METADATA="metadata",e.USAGE="usage",e.ZONE="zone",e}({});let Rt=(()=>{class e{static getAll(){return Object.values(e.capabilities)}}return e.capabilities=_t,e})();var kt=c("ajRT");function vt(e,t){1&e&&w.Nb(0,"input",22),2&e&&w.pc("readonly",!0)}function wt(e,t){1&e&&(w.Sb(0,"option",17),w.Wb(1,25),w.Rb()),2&e&&w.pc("ngValue",null)}function zt(e,t){if(1&e&&(w.Sb(0,"option",26),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e),w.yb(1),w.Pc(e)}}function It(e,t){if(1&e&&(w.Sb(0,"select",23),w.Mc(1,wt,2,1,"option",24),w.Mc(2,zt,2,2,"option",19),w.Rb()),2&e){const e=w.ic();w.yb(1),w.pc("ngIf",null!==e.types),w.yb(1),w.pc("ngForOf",e.types)}}function xt(e,t){1&e&&(w.Sb(0,"span",27),w.Wb(1,28),w.Rb())}function Mt(e,t){if(1&e&&(w.Sb(0,"option",26),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e),w.yb(1),w.Qc(" ",e," ")}}function $t(e,t){1&e&&(w.Sb(0,"span",27),w.Wb(1,29),w.Rb())}const qt=function(e){return{required:e}},Nt=function(){return["read","write","*"]};let Tt=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.activeModal=t,this.actionLabels=c,this.submitAction=new w.o,this.editing=!0,this.types=[],this.resource="capability",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({type:[null,[i.A.required]],perm:[null,[i.A.required]]})}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.ADD}setValues(e,t){this.formGroup.setValue({type:e,perm:t})}setCapabilities(e){const t=[];e.forEach(e=>{t.push(e.type)}),this.types=[],Rt.getAll().forEach(e=>{-1===d.a.indexOf(t,e)&&this.types.push(e)})}onSubmit(){this.submitAction.emit(this.formGroup.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(N.a),w.Mb(b.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-capability-modal"]],outputs:{submitAction:"submitAction"},decls:29,vars:24,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","type",1,"cd-col-form-label",3,"ngClass"],"Type",[1,"cd-col-form-input"],["id","type","class","form-control","type","text","formControlName","type",3,"readonly",4,"ngIf"],["id","type","class","form-control custom-select","formControlName","type","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],"Permission",["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],"-- Select a permission --",[3,"value",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["id","type","type","text","formControlName","type",1,"form-control",3,"readonly"],["id","type","formControlName","type","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],"-- Select a type --",[3,"value"],[1,"invalid-feedback"],"This field is required.","This field is required."]},template:function(e,t){if(1&e&&(w.Sb(0,"cd-modal",0),w.Qb(1,1),w.Wb(2,2),w.jc(3,"titlecase"),w.jc(4,"upperFirst"),w.Pb(),w.Qb(5,3),w.Sb(6,"form",4,5),w.Sb(8,"div",6),w.Sb(9,"div",7),w.Sb(10,"label",8),w.Wb(11,9),w.Rb(),w.Sb(12,"div",10),w.Mc(13,vt,1,1,"input",11),w.Mc(14,It,3,2,"select",12),w.Mc(15,xt,2,0,"span",13),w.Rb(),w.Rb(),w.Sb(16,"div",7),w.Sb(17,"label",14),w.Wb(18,15),w.Rb(),w.Sb(19,"div",10),w.Sb(20,"select",16),w.Sb(21,"option",17),w.Wb(22,18),w.Rb(),w.Mc(23,Mt,2,2,"option",19),w.Rb(),w.Mc(24,$t,2,0,"span",13),w.Rb(),w.Rb(),w.Rb(),w.Sb(25,"div",20),w.Sb(26,"cd-form-button-panel",21),w.gc("submitActionEvent",(function(){return t.onSubmit()})),w.jc(27,"titlecase"),w.jc(28,"upperFirst"),w.Rb(),w.Rb(),w.Rb(),w.Pb(),w.Rb()),2&e){const e=w.Ac(7);w.pc("modalRef",t.activeModal),w.yb(4),w.ac(w.kc(3,13,t.action))(w.kc(4,15,t.resource)),w.Xb(2),w.yb(2),w.pc("formGroup",t.formGroup),w.yb(4),w.pc("ngClass",w.uc(21,qt,!t.editing)),w.yb(3),w.pc("ngIf",t.editing),w.yb(1),w.pc("ngIf",!t.editing),w.yb(1),w.pc("ngIf",t.formGroup.showError("type",e,"required")),w.yb(6),w.pc("ngValue",null),w.yb(2),w.pc("ngForOf",w.tc(23,Nt)),w.yb(1),w.pc("ngIf",t.formGroup.showError("perm",e,"required")),w.yb(2),w.pc("form",t.formGroup)("submitText",w.kc(27,17,t.action)+" "+w.kc(28,19,t.resource))}},directives:[kt.a,i.C,i.r,W.a,i.k,O.a,a.p,a.r,D.a,i.z,j.a,i.q,i.i,i.u,i.B,a.q,B.a,i.d,P.a],pipes:[a.A,L.a],styles:[""]}),e})();var Et=c("D4zM"),At=c("cEzo");function Ct(e,t){1&e&&w.Nb(0,"input",17),2&e&&w.pc("readonly",!0)}function Ft(e,t){1&e&&(w.Sb(0,"option",21),w.Wb(1,22),w.Rb()),2&e&&w.pc("ngValue",null)}function Wt(e,t){if(1&e&&(w.Sb(0,"option",23),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e),w.yb(1),w.Pc(e)}}function Ot(e,t){if(1&e&&(w.Sb(0,"select",18),w.Mc(1,Ft,2,1,"option",19),w.Mc(2,Wt,2,2,"option",20),w.Rb()),2&e){const e=w.ic();w.yb(1),w.pc("ngIf",null!==e.userCandidates),w.yb(1),w.pc("ngForOf",e.userCandidates)}}function Dt(e,t){1&e&&(w.Sb(0,"span",24),w.Wb(1,25),w.Rb())}function jt(e,t){1&e&&(w.Sb(0,"div",7),w.Sb(1,"div",26),w.Sb(2,"div",27),w.Nb(3,"input",28),w.Sb(4,"label",29),w.Wb(5,30),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function Pt(e,t){1&e&&(w.Sb(0,"span",24),w.Wb(1,38),w.Rb())}const Vt=function(e){return{required:e}};function Bt(e,t){if(1&e&&(w.Sb(0,"div",7),w.Sb(1,"label",31),w.Wb(2,32),w.Rb(),w.Sb(3,"div",10),w.Sb(4,"div",33),w.Nb(5,"input",34),w.Sb(6,"span",35),w.Nb(7,"button",36),w.Nb(8,"cd-copy-2-clipboard-button",37),w.Rb(),w.Rb(),w.Mc(9,Pt,2,0,"span",13),w.Rb(),w.Rb()),2&e){const e=w.ic(),t=w.Ac(7);w.yb(1),w.pc("ngClass",w.uc(3,Vt,!e.viewing)),w.yb(4),w.pc("readonly",e.viewing),w.yb(4),w.pc("ngIf",e.formGroup.showError("access_key",t,"required"))}}function Lt(e,t){1&e&&(w.Sb(0,"span",24),w.Wb(1,44),w.Rb())}function Ut(e,t){if(1&e&&(w.Sb(0,"div",7),w.Sb(1,"label",39),w.Wb(2,40),w.Rb(),w.Sb(3,"div",10),w.Sb(4,"div",33),w.Nb(5,"input",41),w.Sb(6,"span",35),w.Nb(7,"button",42),w.Nb(8,"cd-copy-2-clipboard-button",43),w.Rb(),w.Rb(),w.Mc(9,Lt,2,0,"span",13),w.Rb(),w.Rb()),2&e){const e=w.ic(),t=w.Ac(7);w.yb(1),w.pc("ngClass",w.uc(3,Vt,!e.viewing)),w.yb(4),w.pc("readonly",e.viewing),w.yb(4),w.pc("ngIf",e.formGroup.showError("secret_key",t,"required"))}}let Gt=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.activeModal=t,this.actionLabels=c,this.submitAction=new w.o,this.viewing=!0,this.userCandidates=[],this.resource="S3 Key",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({user:[null,[i.A.required]],generate_key:[!0],access_key:[null,[T.a.requiredIf({generate_key:!1})]],secret_key:[null,[T.a.requiredIf({generate_key:!1})]]})}setViewing(e=!0){this.viewing=e,this.action=this.viewing?this.actionLabels.SHOW:this.actionLabels.CREATE}setValues(e,t,c){this.formGroup.setValue({user:e,generate_key:d.a.isEmpty(t),access_key:t,secret_key:c})}setUserCandidates(e){this.userCandidates=e}onSubmit(){this.submitAction.emit(this.formGroup.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(N.a),w.Mb(b.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-s3-key-modal"]],outputs:{submitAction:"submitAction"},decls:23,vars:24,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label",3,"ngClass"],"Username",[1,"cd-col-form-input"],["id","user","class","form-control","type","text","formControlName","user",3,"readonly",4,"ngIf"],["id","user","class","form-control custom-select","formControlName","user","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],["id","user","type","text","formControlName","user",1,"form-control",3,"readonly"],["id","user","formControlName","user","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],"-- Select a username --",[3,"value"],[1,"invalid-feedback"],"This field is required.",[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],"Auto-generate key",["for","access_key",1,"cd-col-form-label",3,"ngClass"],"Access key",[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control",3,"readonly"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],"This field is required.",["for","secret_key",1,"cd-col-form-label",3,"ngClass"],"Secret key",["id","secret_key","type","password","formControlName","secret_key",1,"form-control",3,"readonly"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],"This field is required."]},template:function(e,t){if(1&e&&(w.Sb(0,"cd-modal",0),w.Qb(1,1),w.Wb(2,2),w.jc(3,"titlecase"),w.jc(4,"upperFirst"),w.Pb(),w.Qb(5,3),w.Sb(6,"form",4,5),w.Sb(8,"div",6),w.Sb(9,"div",7),w.Sb(10,"label",8),w.Wb(11,9),w.Rb(),w.Sb(12,"div",10),w.Mc(13,Ct,1,1,"input",11),w.Mc(14,Ot,3,2,"select",12),w.Mc(15,Dt,2,0,"span",13),w.Rb(),w.Rb(),w.Mc(16,jt,6,0,"div",14),w.Mc(17,Bt,10,5,"div",14),w.Mc(18,Ut,10,5,"div",14),w.Rb(),w.Sb(19,"div",15),w.Sb(20,"cd-form-button-panel",16),w.gc("submitActionEvent",(function(){return t.onSubmit()})),w.jc(21,"titlecase"),w.jc(22,"upperFirst"),w.Rb(),w.Rb(),w.Rb(),w.Pb(),w.Rb()),2&e){const e=w.Ac(7);w.pc("modalRef",t.activeModal),w.yb(4),w.ac(w.kc(3,14,t.action))(w.kc(4,16,t.resource)),w.Xb(2),w.yb(2),w.pc("formGroup",t.formGroup),w.yb(4),w.pc("ngClass",w.uc(22,Vt,!t.viewing)),w.yb(3),w.pc("ngIf",t.viewing),w.yb(1),w.pc("ngIf",!t.viewing),w.yb(1),w.pc("ngIf",t.formGroup.showError("user",e,"required")),w.yb(1),w.pc("ngIf",!t.viewing),w.yb(1),w.pc("ngIf",!t.formGroup.getValue("generate_key")),w.yb(1),w.pc("ngIf",!t.formGroup.getValue("generate_key")),w.yb(2),w.pc("form",t.formGroup)("submitText",w.kc(21,18,t.action)+" "+w.kc(22,20,t.resource))("showSubmit",!t.viewing)}},directives:[kt.a,i.C,i.r,W.a,i.k,O.a,a.p,a.r,B.a,D.a,i.d,j.a,i.q,i.i,i.z,P.a,a.q,i.u,i.B,i.b,Et.a,At.a],pipes:[a.A,L.a],styles:[""]}),e})();class Kt{}function Qt(e,t){1&e&&(w.Sb(0,"span",29),w.Wb(1,30),w.Rb())}function Jt(e,t){1&e&&(w.Sb(0,"span",29),w.Wb(1,31),w.Rb())}function Zt(e,t){if(1&e&&(w.Sb(0,"option",32),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.pc("value",e),w.yb(1),w.Qc(" ",e," ")}}function Xt(e,t){1&e&&(w.Sb(0,"span",29),w.Wb(1,33),w.Rb())}function Yt(e,t){1&e&&(w.Sb(0,"span",29),w.Wb(1,48),w.Rb())}function Ht(e,t){if(1&e&&(w.Sb(0,"div",7),w.Sb(1,"label",41),w.Wb(2,42),w.Rb(),w.Sb(3,"div",10),w.Sb(4,"div",43),w.Nb(5,"input",44),w.Sb(6,"span",45),w.Nb(7,"button",46),w.Nb(8,"cd-copy-2-clipboard-button",47),w.Rb(),w.Rb(),w.Mc(9,Yt,2,0,"span",15),w.Rb(),w.Rb()),2&e){const e=w.ic(2),t=w.Ac(7);w.yb(9),w.pc("ngIf",e.formGroup.showError("secret_key",t,"required"))}}function ec(e,t){if(1&e&&(w.Sb(0,"fieldset"),w.Sb(1,"legend"),w.Wb(2,34),w.Rb(),w.Sb(3,"div",7),w.Sb(4,"div",35),w.Sb(5,"div",36),w.Nb(6,"input",37),w.Sb(7,"label",38),w.Wb(8,39),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(9,Ht,10,1,"div",40),w.Rb()),2&e){const e=w.ic();w.yb(9),w.pc("ngIf",!e.editing&&!e.formGroup.getValue("generate_secret"))}}const tc=function(e){return{required:e}},cc=function(){return["read","write"]};let ac=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.bsModalRef=t,this.actionLabels=c,this.submitAction=new w.o,this.editing=!0,this.subusers=[],this.resource="Subuser",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({uid:[null],subuid:[null,[i.A.required,this.subuserValidator()]],perm:[null,[i.A.required]],generate_secret:[!0],secret_key:[null,[T.a.requiredIf({generate_secret:!1})]]})}subuserValidator(){const e=this;return t=>e.editing||Object(T.b)(t.value)?null:e.subusers.some(c=>d.a.isEqual(e.getSubuserName(c.id),t.value))?{subuserIdExists:!0}:null}getSubuserName(e){if(d.a.isEmpty(e))return e;const t=e.match(/([^:]+)(:(.+))?/);return d.a.isUndefined(t[3])?t[1]:t[3]}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE}setValues(e,t="",c=""){this.formGroup.setValue({uid:e,subuid:this.getSubuserName(t),perm:c,generate_secret:!0,secret_key:null})}setSubusers(e){this.subusers=e}onSubmit(){const e=this.formGroup.value,t=new Kt;t.id=`${e.uid}:${e.subuid}`,t.permissions=e.perm,t.generate_secret=e.generate_secret,t.secret_key=e.secret_key,this.submitAction.emit(t),this.bsModalRef.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(N.a),w.Mb(b.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-subuser-modal"]],outputs:{submitAction:"submitAction"},decls:39,vars:26,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","uid",1,"cd-col-form-label"],"Username",[1,"cd-col-form-input"],["id","uid","type","text","formControlName","uid",1,"form-control",3,"readonly"],["for","subuid",1,"cd-col-form-label",3,"ngClass"],"Subuser",["id","subuid","type","text","formControlName","subuid","autofocus","",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],"Permission",["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],"-- Select a permission --",[3,"value",4,"ngFor","ngForOf"],["value","read-write"],"read, write",["value","full-control"],"full",[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The chosen subuser ID is already in use.",[3,"value"],"This field is required.","Swift key",[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_secret","type","checkbox","formControlName","generate_secret",1,"custom-control-input"],["for","generate_secret",1,"custom-control-label"],"Auto-generate secret",["class","form-group row",4,"ngIf"],["for","secret_key",1,"cd-col-form-label","required"],"Secret key",[1,"input-group"],["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],"This field is required."]},template:function(e,t){if(1&e&&(w.Sb(0,"cd-modal",0),w.Qb(1,1),w.Wb(2,2),w.jc(3,"titlecase"),w.jc(4,"upperFirst"),w.Pb(),w.Qb(5,3),w.Sb(6,"form",4,5),w.Sb(8,"div",6),w.Sb(9,"div",7),w.Sb(10,"label",8),w.Wb(11,9),w.Rb(),w.Sb(12,"div",10),w.Nb(13,"input",11),w.Rb(),w.Rb(),w.Sb(14,"div",7),w.Sb(15,"label",12),w.Wb(16,13),w.Rb(),w.Sb(17,"div",10),w.Nb(18,"input",14),w.Mc(19,Qt,2,0,"span",15),w.Mc(20,Jt,2,0,"span",15),w.Rb(),w.Rb(),w.Sb(21,"div",7),w.Sb(22,"label",16),w.Wb(23,17),w.Rb(),w.Sb(24,"div",10),w.Sb(25,"select",18),w.Sb(26,"option",19),w.Wb(27,20),w.Rb(),w.Mc(28,Zt,2,2,"option",21),w.Sb(29,"option",22),w.Wb(30,23),w.Rb(),w.Sb(31,"option",24),w.Wb(32,25),w.Rb(),w.Rb(),w.Mc(33,Xt,2,0,"span",15),w.Rb(),w.Rb(),w.Mc(34,ec,10,1,"fieldset",26),w.Rb(),w.Sb(35,"div",27),w.Sb(36,"cd-form-button-panel",28),w.gc("submitActionEvent",(function(){return t.onSubmit()})),w.jc(37,"titlecase"),w.jc(38,"upperFirst"),w.Rb(),w.Rb(),w.Rb(),w.Pb(),w.Rb()),2&e){const e=w.Ac(7);w.pc("modalRef",t.bsModalRef),w.yb(4),w.ac(w.kc(3,15,t.action))(w.kc(4,17,t.resource)),w.Xb(2),w.yb(2),w.pc("formGroup",t.formGroup),w.yb(7),w.pc("readonly",!0),w.yb(2),w.pc("ngClass",w.uc(23,tc,!t.editing)),w.yb(3),w.pc("readonly",t.editing),w.yb(1),w.pc("ngIf",t.formGroup.showError("subuid",e,"required")),w.yb(1),w.pc("ngIf",t.formGroup.showError("subuid",e,"subuserIdExists")),w.yb(6),w.pc("ngValue",null),w.yb(2),w.pc("ngForOf",w.tc(25,cc)),w.yb(5),w.pc("ngIf",t.formGroup.showError("perm",e,"required")),w.yb(1),w.pc("ngIf",!t.editing),w.yb(2),w.pc("form",t.formGroup)("submitText",w.kc(37,19,t.action)+" "+w.kc(38,21,t.resource))}},directives:[kt.a,i.C,i.r,W.a,i.k,O.a,D.a,i.d,j.a,i.q,i.i,a.p,P.a,a.r,i.z,i.u,i.B,a.q,B.a,i.b,Et.a,At.a],pipes:[a.A,L.a],styles:[""]}),e})();var ic=c("Z21x");let sc=(()=>{class e{constructor(e,t){this.activeModal=e,this.actionLabels=t,this.resource="Swift Key",this.action=this.actionLabels.SHOW}setValues(e,t){this.user=e,this.secret_key=t}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(b.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-swift-key-modal"]],decls:24,vars:11,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + " ",[1,"modal-content"],[1,"modal-body"],["novalidate",""],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],"Username",[1,"cd-col-form-input"],["id","user","name","user","type","text",1,"form-control",3,"readonly","ngModel","ngModelChange"],["for","secret_key",1,"cd-col-form-label"],"Secret key",[1,"input-group"],["id","secret_key","name","secret_key","type","password",1,"form-control",3,"ngModel","readonly","ngModelChange"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],[1,"modal-footer"],[3,"backAction"]]},template:function(e,t){1&e&&(w.Sb(0,"cd-modal",0),w.Qb(1,1),w.Wb(2,2),w.jc(3,"titlecase"),w.jc(4,"upperFirst"),w.Pb(),w.Qb(5,3),w.Sb(6,"div",4),w.Sb(7,"form",5),w.Sb(8,"div",6),w.Sb(9,"label",7),w.Wb(10,8),w.Rb(),w.Sb(11,"div",9),w.Sb(12,"input",10),w.gc("ngModelChange",(function(e){return t.user=e})),w.Rb(),w.Rb(),w.Rb(),w.Sb(13,"div",6),w.Sb(14,"label",11),w.Wb(15,12),w.Rb(),w.Sb(16,"div",9),w.Sb(17,"div",13),w.Sb(18,"input",14),w.gc("ngModelChange",(function(e){return t.secret_key=e})),w.Rb(),w.Sb(19,"span",15),w.Nb(20,"button",16),w.Nb(21,"cd-copy-2-clipboard-button",17),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Sb(22,"div",18),w.Sb(23,"cd-back-button",19),w.gc("backAction",(function(){return t.activeModal.close()})),w.Rb(),w.Rb(),w.Pb(),w.Rb()),2&e&&(w.pc("modalRef",t.activeModal),w.yb(4),w.ac(w.kc(3,7,t.action))(w.kc(4,9,t.resource)),w.Xb(2),w.yb(8),w.pc("readonly",!0)("ngModel",t.user),w.yb(6),w.pc("ngModel",t.secret_key)("readonly",!0))},directives:[kt.a,i.C,i.r,i.s,O.a,D.a,i.d,j.a,i.q,i.t,Et.a,At.a,ic.a],pipes:[a.A,L.a],styles:[""]}),e})();var bc=c("EmSq");function oc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,50),w.Rb())}function nc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,51),w.Rb())}function rc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,52),w.Rb())}function lc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,56),w.Rb())}function uc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,57),w.Rb())}function dc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",53),w.Wb(2,54),w.Rb(),w.Sb(3,"div",11),w.Nb(4,"input",55),w.Mc(5,lc,2,0,"span",13),w.Mc(6,uc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(4),w.pc("readonly",t.editing),w.yb(1),w.pc("ngIf",t.userForm.showError("tenant",e,"pattern")),w.yb(1),w.pc("ngIf",t.userForm.showError("tenant",e,"notUnique"))}}function fc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,58),w.Rb())}function mc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,59),w.Rb())}function pc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,60),w.Rb())}function gc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,63),w.Rb())}function hc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,64),w.Rb())}function yc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Nb(1,"label",61),w.Sb(2,"div",11),w.Nb(3,"input",62),w.Mc(4,gc,2,0,"span",13),w.Mc(5,hc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(4),w.pc("ngIf",t.userForm.showError("max_buckets",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("max_buckets",e,"min"))}}function Sc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,76),w.Rb())}function _c(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",69),w.Wb(2,70),w.Rb(),w.Sb(3,"div",11),w.Sb(4,"div",71),w.Nb(5,"input",72),w.Sb(6,"span",73),w.Nb(7,"button",74),w.Nb(8,"cd-copy-2-clipboard-button",75),w.Rb(),w.Rb(),w.Mc(9,Sc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic(2);const e=w.Ac(2),t=w.ic();w.yb(9),w.pc("ngIf",t.userForm.showError("access_key",e,"required"))}}function Rc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,82),w.Rb())}function kc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",77),w.Wb(2,78),w.Rb(),w.Sb(3,"div",11),w.Sb(4,"div",71),w.Nb(5,"input",79),w.Sb(6,"span",73),w.Nb(7,"button",80),w.Nb(8,"cd-copy-2-clipboard-button",81),w.Rb(),w.Rb(),w.Mc(9,Rc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic(2);const e=w.Ac(2),t=w.ic();w.yb(9),w.pc("ngIf",t.userForm.showError("secret_key",e,"required"))}}function vc(e,t){if(1&e&&(w.Sb(0,"fieldset"),w.Sb(1,"legend"),w.Wb(2,65),w.Rb(),w.Sb(3,"div",8),w.Sb(4,"div",14),w.Sb(5,"div",15),w.Nb(6,"input",66),w.Sb(7,"label",67),w.Wb(8,68),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(9,_c,10,1,"div",19),w.Mc(10,kc,10,1,"div",19),w.Rb()),2&e){const e=w.ic(2);w.yb(9),w.pc("ngIf",!e.editing&&!e.userForm.getValue("generate_key")),w.yb(1),w.pc("ngIf",!e.editing&&!e.userForm.getValue("generate_key"))}}function wc(e,t){1&e&&(w.Sb(0,"span",92),w.Sb(1,"span",93),w.Wb(2,94),w.Rb(),w.Rb())}const zc=function(e){return[e]};function Ic(e,t){if(1&e){const e=w.Tb();w.Sb(0,"span"),w.Sb(1,"div",71),w.Sb(2,"div",95),w.Sb(3,"span",96),w.Nb(4,"i"),w.Rb(),w.Rb(),w.Nb(5,"input",97),w.Sb(6,"div",98),w.Sb(7,"span",96),w.Nb(8,"i"),w.Rb(),w.Rb(),w.Nb(9,"input",97),w.Sb(10,"span",73),w.Sb(11,"button",99),w.Yb(12,100),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).showSubuserModal(c)})),w.Nb(13,"i",89),w.Rb(),w.Sb(14,"button",101),w.Yb(15,102),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).deleteSubuser(c)})),w.Nb(16,"i",89),w.Rb(),w.Rb(),w.Rb(),w.Nb(17,"span",93),w.Rb()}if(2&e){const e=t.$implicit,c=w.ic(3);w.yb(4),w.Ab(c.icons.user),w.yb(1),w.qc("value",e.id),w.yb(3),w.Ab(c.icons.share),w.yb(1),w.qc("value","full-control"===e.permissions?"full":e.permissions),w.yb(4),w.pc("ngClass",w.uc(10,zc,c.icons.edit)),w.yb(3),w.pc("ngClass",w.uc(12,zc,c.icons.destroy))}}function xc(e,t){if(1&e){const e=w.Tb();w.Sb(0,"fieldset"),w.Sb(1,"legend"),w.Wb(2,83),w.Rb(),w.Sb(3,"div",84),w.Sb(4,"div",14),w.Mc(5,wc,3,0,"span",85),w.Mc(6,Ic,18,14,"span",86),w.Sb(7,"div",84),w.Sb(8,"div",87),w.Sb(9,"button",88),w.gc("click",(function(){return w.Dc(e),w.ic(2).showSubuserModal()})),w.Nb(10,"i",89),w.Qb(11),w.Wb(12,90),w.jc(13,"titlecase"),w.jc(14,"upperFirst"),w.Pb(),w.Rb(),w.Rb(),w.Rb(),w.Nb(15,"span",91),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.ic(2);w.yb(5),w.pc("ngIf",0===e.subusers.length),w.yb(1),w.pc("ngForOf",e.subusers),w.yb(4),w.pc("ngClass",w.uc(9,zc,e.icons.add)),w.yb(4),w.ac(w.kc(13,5,e.actionLabels.CREATE))(w.kc(14,7,e.subuserLabel)),w.Xb(12)}}function Mc(e,t){1&e&&(w.Sb(0,"span",92),w.Sb(1,"span",93),w.Wb(2,108),w.Rb(),w.Rb())}function $c(e,t){if(1&e){const e=w.Tb();w.Sb(0,"span"),w.Sb(1,"div",71),w.Sb(2,"div",95),w.Sb(3,"div",96),w.Nb(4,"i"),w.Rb(),w.Rb(),w.Nb(5,"input",97),w.Sb(6,"span",73),w.Sb(7,"button",109),w.Yb(8,110),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).showS3KeyModal(c)})),w.Nb(9,"i",89),w.Rb(),w.Sb(10,"button",111),w.Yb(11,112),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).deleteS3Key(c)})),w.Nb(12,"i",89),w.Rb(),w.Rb(),w.Rb(),w.Nb(13,"span",93),w.Rb()}if(2&e){const e=t.$implicit,c=w.ic(3);w.yb(4),w.Ab(c.icons.key),w.yb(1),w.qc("value",e.user),w.yb(4),w.pc("ngClass",w.uc(6,zc,c.icons.show)),w.yb(3),w.pc("ngClass",w.uc(8,zc,c.icons.destroy))}}function qc(e,t){1&e&&(w.Sb(0,"span",92),w.Sb(1,"span",93),w.Wb(2,113),w.Rb(),w.Rb())}function Nc(e,t){if(1&e){const e=w.Tb();w.Sb(0,"span"),w.Sb(1,"div",71),w.Sb(2,"div",95),w.Sb(3,"span",96),w.Nb(4,"i"),w.Rb(),w.Rb(),w.Nb(5,"input",97),w.Sb(6,"span",73),w.Sb(7,"button",114),w.Yb(8,115),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).showSwiftKeyModal(c)})),w.Nb(9,"i",89),w.Rb(),w.Rb(),w.Rb(),w.Nb(10,"span",93),w.Rb()}if(2&e){const e=t.$implicit,c=w.ic(3);w.yb(4),w.Ab(c.icons.key),w.yb(1),w.qc("value",e.user),w.yb(4),w.pc("ngClass",w.uc(5,zc,c.icons.show))}}function Tc(e,t){if(1&e){const e=w.Tb();w.Sb(0,"fieldset"),w.Sb(1,"legend"),w.Wb(2,103),w.Rb(),w.Sb(3,"div",8),w.Sb(4,"label",61),w.Wb(5,104),w.Rb(),w.Sb(6,"div",11),w.Mc(7,Mc,3,0,"span",85),w.Mc(8,$c,14,10,"span",86),w.Sb(9,"div",84),w.Sb(10,"div",87),w.Sb(11,"button",105),w.gc("click",(function(){return w.Dc(e),w.ic(2).showS3KeyModal()})),w.Nb(12,"i",89),w.Qb(13),w.Wb(14,106),w.jc(15,"titlecase"),w.jc(16,"upperFirst"),w.Pb(),w.Rb(),w.Rb(),w.Rb(),w.Nb(17,"span",91),w.Rb(),w.Nb(18,"hr"),w.Rb(),w.Sb(19,"div",8),w.Sb(20,"label",61),w.Wb(21,107),w.Rb(),w.Sb(22,"div",11),w.Mc(23,qc,3,0,"span",85),w.Mc(24,Nc,11,7,"span",86),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.ic(2);w.yb(7),w.pc("ngIf",0===e.s3Keys.length),w.yb(1),w.pc("ngForOf",e.s3Keys),w.yb(4),w.pc("ngClass",w.uc(11,zc,e.icons.add)),w.yb(4),w.ac(w.kc(15,7,e.actionLabels.CREATE))(w.kc(16,9,e.s3keyLabel)),w.Xb(14),w.yb(7),w.pc("ngIf",0===e.swiftKeys.length),w.yb(1),w.pc("ngForOf",e.swiftKeys)}}function Ec(e,t){1&e&&(w.Sb(0,"span",92),w.Sb(1,"span",93),w.Wb(2,120),w.Rb(),w.Rb())}function Ac(e,t){if(1&e){const e=w.Tb();w.Sb(0,"span"),w.Sb(1,"div",71),w.Sb(2,"span",95),w.Sb(3,"div",96),w.Nb(4,"i"),w.Rb(),w.Rb(),w.Nb(5,"input",97),w.Sb(6,"span",73),w.Sb(7,"button",121),w.Yb(8,122),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).showCapabilityModal(c)})),w.Nb(9,"i",89),w.Rb(),w.Sb(10,"button",123),w.Yb(11,124),w.gc("click",(function(){w.Dc(e);const c=t.index;return w.ic(3).deleteCapability(c)})),w.Nb(12,"i",89),w.Rb(),w.Rb(),w.Rb(),w.Nb(13,"span",93),w.Rb()}if(2&e){const e=t.$implicit,c=w.ic(3);w.yb(4),w.Ab(c.icons.share),w.yb(1),w.sc("value","",e.type,":",e.perm,""),w.yb(4),w.pc("ngClass",w.uc(7,zc,c.icons.edit)),w.yb(3),w.pc("ngClass",w.uc(9,zc,c.icons.destroy))}}function Cc(e,t){if(1&e){const e=w.Tb();w.Sb(0,"fieldset"),w.Sb(1,"legend"),w.Wb(2,116),w.Rb(),w.Sb(3,"div",8),w.Sb(4,"div",14),w.Mc(5,Ec,3,0,"span",85),w.Mc(6,Ac,14,11,"span",86),w.Sb(7,"div",84),w.Sb(8,"div",87),w.Sb(9,"button",117),w.Yb(10,118),w.gc("click",(function(){return w.Dc(e),w.ic(2).showCapabilityModal()})),w.jc(11,"pipeFunction"),w.jc(12,"pipeFunction"),w.Nb(13,"i",89),w.Qb(14),w.Wb(15,119),w.jc(16,"titlecase"),w.jc(17,"upperFirst"),w.Pb(),w.Rb(),w.Rb(),w.Rb(),w.Nb(18,"span",91),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.ic(2);w.yb(5),w.pc("ngIf",0===e.capabilities.length),w.yb(1),w.pc("ngForOf",e.capabilities),w.yb(3),w.pc("disabled",w.lc(11,7,e.capabilities,e.hasAllCapabilities))("disableTooltip",!w.lc(12,10,e.capabilities,e.hasAllCapabilities)),w.yb(4),w.pc("ngClass",w.uc(17,zc,e.icons.add)),w.yb(4),w.ac(w.kc(16,13,e.actionLabels.ADD))(w.kc(17,15,e.capabilityLabel)),w.Xb(15)}}function Fc(e,t){1&e&&(w.Sb(0,"div",8),w.Sb(1,"div",14),w.Sb(2,"div",15),w.Nb(3,"input",125),w.Sb(4,"label",126),w.Wb(5,127),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function Wc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,131),w.Rb())}function Oc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,132),w.Rb())}function Dc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",128),w.Wb(2,129),w.Rb(),w.Sb(3,"div",11),w.Nb(4,"input",130),w.Mc(5,Wc,2,0,"span",13),w.Mc(6,Oc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.userForm.showError("user_quota_max_size",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("user_quota_max_size",e,"quotaMaxSize"))}}function jc(e,t){1&e&&(w.Sb(0,"div",8),w.Sb(1,"div",14),w.Sb(2,"div",15),w.Nb(3,"input",133),w.Sb(4,"label",134),w.Wb(5,135),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function Pc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,139),w.Rb())}function Vc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,140),w.Rb())}function Bc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",136),w.Wb(2,137),w.Rb(),w.Sb(3,"div",11),w.Nb(4,"input",138),w.Mc(5,Pc,2,0,"span",13),w.Mc(6,Vc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.userForm.showError("user_quota_max_objects",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("user_quota_max_objects",e,"min"))}}function Lc(e,t){1&e&&(w.Sb(0,"div",8),w.Sb(1,"div",14),w.Sb(2,"div",15),w.Nb(3,"input",141),w.Sb(4,"label",142),w.Wb(5,143),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function Uc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,147),w.Rb())}function Gc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,148),w.Rb())}function Kc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",144),w.Wb(2,145),w.Rb(),w.Sb(3,"div",11),w.Nb(4,"input",146),w.Mc(5,Uc,2,0,"span",13),w.Mc(6,Gc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.userForm.showError("bucket_quota_max_size",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("bucket_quota_max_size",e,"quotaMaxSize"))}}function Qc(e,t){1&e&&(w.Sb(0,"div",8),w.Sb(1,"div",14),w.Sb(2,"div",15),w.Nb(3,"input",149),w.Sb(4,"label",150),w.Wb(5,151),w.Rb(),w.Rb(),w.Rb(),w.Rb())}function Jc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,155),w.Rb())}function Zc(e,t){1&e&&(w.Sb(0,"span",49),w.Wb(1,156),w.Rb())}function Xc(e,t){if(1&e&&(w.Sb(0,"div",8),w.Sb(1,"label",152),w.Wb(2,153),w.Rb(),w.Sb(3,"div",11),w.Nb(4,"input",154),w.Mc(5,Jc,2,0,"span",13),w.Mc(6,Zc,2,0,"span",13),w.Rb(),w.Rb()),2&e){w.ic();const e=w.Ac(2),t=w.ic();w.yb(5),w.pc("ngIf",t.userForm.showError("bucket_quota_max_objects",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("bucket_quota_max_objects",e,"min"))}}const Yc=function(e){return{required:e}};function Hc(e,t){if(1&e){const e=w.Tb();w.Sb(0,"div",1),w.Sb(1,"form",2,3),w.Sb(3,"div",4),w.Sb(4,"div",5),w.Wb(5,6),w.jc(6,"titlecase"),w.jc(7,"upperFirst"),w.Rb(),w.Sb(8,"div",7),w.Sb(9,"div",8),w.Sb(10,"label",9),w.Wb(11,10),w.Rb(),w.Sb(12,"div",11),w.Nb(13,"input",12),w.Mc(14,oc,2,0,"span",13),w.Mc(15,nc,2,0,"span",13),w.Mc(16,rc,2,0,"span",13),w.Rb(),w.Rb(),w.Sb(17,"div",8),w.Sb(18,"div",14),w.Sb(19,"div",15),w.Sb(20,"input",16),w.gc("click",(function(){return w.Dc(e),w.ic().updateFieldsWhenTenanted()})),w.Rb(),w.Sb(21,"label",17),w.Wb(22,18),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(23,dc,7,3,"div",19),w.Sb(24,"div",8),w.Sb(25,"label",20),w.Wb(26,21),w.Rb(),w.Sb(27,"div",11),w.Nb(28,"input",22),w.Mc(29,fc,2,0,"span",13),w.Rb(),w.Rb(),w.Sb(30,"div",8),w.Sb(31,"label",23),w.Wb(32,24),w.Rb(),w.Sb(33,"div",11),w.Nb(34,"input",25),w.Mc(35,mc,2,0,"span",13),w.Mc(36,pc,2,0,"span",13),w.Rb(),w.Rb(),w.Sb(37,"div",8),w.Sb(38,"label",26),w.Wb(39,27),w.Rb(),w.Sb(40,"div",11),w.Sb(41,"select",28),w.gc("change",(function(t){return w.Dc(e),w.ic().onMaxBucketsModeChange(t.target.value)})),w.Sb(42,"option",29),w.Wb(43,30),w.Rb(),w.Sb(44,"option",31),w.Wb(45,32),w.Rb(),w.Sb(46,"option",33),w.Wb(47,34),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(48,yc,6,2,"div",19),w.Sb(49,"div",8),w.Sb(50,"div",14),w.Sb(51,"div",15),w.Nb(52,"input",35),w.Sb(53,"label",36),w.Wb(54,37),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(55,vc,11,2,"fieldset",38),w.Mc(56,xc,16,11,"fieldset",38),w.Mc(57,Tc,25,13,"fieldset",38),w.Mc(58,Cc,19,19,"fieldset",38),w.Sb(59,"fieldset"),w.Sb(60,"legend"),w.Wb(61,39),w.Rb(),w.Sb(62,"div",8),w.Sb(63,"div",14),w.Sb(64,"div",15),w.Nb(65,"input",40),w.Sb(66,"label",41),w.Wb(67,42),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(68,Fc,6,0,"div",19),w.Mc(69,Dc,7,2,"div",19),w.Mc(70,jc,6,0,"div",19),w.Mc(71,Bc,7,2,"div",19),w.Rb(),w.Sb(72,"fieldset"),w.Sb(73,"legend"),w.Wb(74,43),w.Rb(),w.Sb(75,"div",8),w.Sb(76,"div",14),w.Sb(77,"div",15),w.Nb(78,"input",44),w.Sb(79,"label",45),w.Wb(80,46),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Mc(81,Lc,6,0,"div",19),w.Mc(82,Kc,7,2,"div",19),w.Mc(83,Qc,6,0,"div",19),w.Mc(84,Xc,7,2,"div",19),w.Rb(),w.Rb(),w.Sb(85,"div",47),w.Sb(86,"cd-form-button-panel",48),w.gc("submitActionEvent",(function(){return w.Dc(e),w.ic().onSubmit()})),w.jc(87,"titlecase"),w.jc(88,"upperFirst"),w.Rb(),w.Rb(),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.Ac(2),t=w.ic();w.yb(1),w.pc("formGroup",t.userForm),w.yb(6),w.ac(w.kc(6,29,t.action))(w.kc(7,31,t.resource)),w.Xb(5),w.yb(3),w.pc("ngClass",w.uc(37,Yc,!t.editing)),w.yb(3),w.pc("readonly",t.editing),w.yb(1),w.pc("ngIf",t.userForm.showError("user_id",e,"required")),w.yb(1),w.pc("ngIf",t.userForm.showError("user_id",e,"pattern")),w.yb(1),w.pc("ngIf",!t.userForm.getValue("show_tenant")&&t.userForm.showError("user_id",e,"notUnique")),w.yb(4),w.pc("readonly",!0),w.yb(3),w.pc("ngIf",t.userForm.getValue("show_tenant")),w.yb(2),w.pc("ngClass",w.uc(39,Yc,!t.editing)),w.yb(4),w.pc("ngIf",t.userForm.showError("display_name",e,"required")),w.yb(6),w.pc("ngIf",t.userForm.showError("email",e,"email")),w.yb(1),w.pc("ngIf",t.userForm.showError("email",e,"notUnique")),w.yb(12),w.pc("ngIf",1==t.userForm.get("max_buckets_mode").value),w.yb(7),w.pc("ngIf",!t.editing),w.yb(1),w.pc("ngIf",t.editing),w.yb(1),w.pc("ngIf",t.editing),w.yb(1),w.pc("ngIf",t.editing),w.yb(10),w.pc("ngIf",t.userForm.controls.user_quota_enabled.value),w.yb(1),w.pc("ngIf",t.userForm.controls.user_quota_enabled.value&&!t.userForm.getValue("user_quota_max_size_unlimited")),w.yb(1),w.pc("ngIf",t.userForm.controls.user_quota_enabled.value),w.yb(1),w.pc("ngIf",t.userForm.controls.user_quota_enabled.value&&!t.userForm.getValue("user_quota_max_objects_unlimited")),w.yb(10),w.pc("ngIf",t.userForm.controls.bucket_quota_enabled.value),w.yb(1),w.pc("ngIf",t.userForm.controls.bucket_quota_enabled.value&&!t.userForm.getValue("bucket_quota_max_size_unlimited")),w.yb(1),w.pc("ngIf",t.userForm.controls.bucket_quota_enabled.value),w.yb(1),w.pc("ngIf",t.userForm.controls.bucket_quota_enabled.value&&!t.userForm.getValue("bucket_quota_max_objects_unlimited")),w.yb(2),w.pc("form",t.userForm)("submitText",w.kc(87,33,t.action)+" "+w.kc(88,35,t.resource))}}let ea=(()=>{class e extends q.a{constructor(e,t,c,a,i,s,b){super(),this.formBuilder=e,this.route=t,this.router=c,this.rgwUserService=a,this.modalService=i,this.notificationService=s,this.actionLabels=b,this.editing=!1,this.submitObservables=[],this.icons=M.a,this.subusers=[],this.s3Keys=[],this.swiftKeys=[],this.capabilities=[],this.showTenant=!1,this.previousTenant=null,this.resource="user",this.subuserLabel="subuser",this.s3keyLabel="S3 Key",this.capabilityLabel="capability",this.editing=this.router.url.startsWith("/rgw/user/"+n.e.EDIT),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.createForm()}createForm(){this.userForm=this.formBuilder.group({user_id:[null,[i.A.required,i.A.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[T.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("tenant"))]],show_tenant:[this.editing],tenant:[null,[i.A.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[T.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("user_id"),!0)]],display_name:[null,[i.A.required]],email:[null,[T.a.email],[T.a.unique(this.rgwUserService.emailExists,this.rgwUserService)]],max_buckets_mode:[1],max_buckets:[1e3,[T.a.requiredIf({max_buckets_mode:"1"}),T.a.number(!1),i.A.min(1)]],suspended:[!1],generate_key:[!0],access_key:[null,[T.a.requiredIf({generate_key:!1})]],secret_key:[null,[T.a.requiredIf({generate_key:!1})]],user_quota_enabled:[!1],user_quota_max_size_unlimited:[!0],user_quota_max_size:[null,[T.a.composeIf({user_quota_enabled:!0,user_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],user_quota_max_objects_unlimited:[!0],user_quota_max_objects:[null,[i.A.min(0),T.a.requiredIf({user_quota_enabled:!0,user_quota_max_objects_unlimited:!1})]],bucket_quota_enabled:[!1],bucket_quota_max_size_unlimited:[!0],bucket_quota_max_size:[null,[T.a.composeIf({bucket_quota_enabled:!0,bucket_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],bucket_quota_max_objects_unlimited:[!0],bucket_quota_max_objects:[null,[i.A.min(0),T.a.requiredIf({bucket_quota_enabled:!0,bucket_quota_max_objects_unlimited:!1})]]})}ngOnInit(){this.route.params.subscribe(e=>{if(!e.hasOwnProperty("uid"))return void this.loadingReady();const t=decodeURIComponent(e.uid),c=[];c.push(this.rgwUserService.get(t)),c.push(this.rgwUserService.getQuota(t)),Object(f.a)(c).subscribe(e=>{const t=d.a.clone(this.userForm.value);let c=d.a.pick(e[0],d.a.keys(this.userForm.value));switch(c.max_buckets){case-1:c.max_buckets_mode=-1,c.max_buckets="";break;case 0:c.max_buckets_mode=0,c.max_buckets="";break;default:c.max_buckets_mode=1}["user","bucket"].forEach(t=>{const a=e[1][t+"_quota"];c[t+"_quota_enabled"]=a.enabled,a.max_size<0?(c[t+"_quota_max_size_unlimited"]=!0,c[t+"_quota_max_size"]=null):(c[t+"_quota_max_size_unlimited"]=!1,c[t+"_quota_max_size"]=a.max_size+" B"),a.max_objects<0?(c[t+"_quota_max_objects_unlimited"]=!0,c[t+"_quota_max_objects"]=null):(c[t+"_quota_max_objects_unlimited"]=!1,c[t+"_quota_max_objects"]=a.max_objects)}),c=d.a.merge(t,c),this.userForm.setValue(c),this.subusers=e[0].subusers,this.s3Keys=e[0].keys,this.swiftKeys=e[0].swift_keys;const a={"read, write":"*"};e[0].caps.forEach(e=>{e.perm in a&&(e.perm=a[e.perm])}),this.capabilities=e[0].caps,this.loadingReady()},()=>{this.loadingError()})})}goToListView(){this.router.navigate(["/rgw/user"])}onSubmit(){let e;if(this.userForm.pristine)return void this.goToListView();const t=this.getUID();if(this.editing){if(this._isGeneralDirty()){const e=this._getUpdateArgs();this.submitObservables.push(this.rgwUserService.update(t,e))}e="Updated Object Gateway user '" + t + "'"}else{const c=this._getCreateArgs();this.submitObservables.push(this.rgwUserService.create(c)),e="Created Object Gateway user '" + t + "'"}if(this._isUserQuotaDirty()){const e=this._getUserQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}if(this._isBucketQuotaDirty()){const e=this._getBucketQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}Object(yt.a)(...this.submitObservables).subscribe({error:()=>{this.userForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.notificationService.show($.a.success,e),this.goToListView()}})}updateFieldsWhenTenanted(){this.showTenant=this.userForm.getValue("show_tenant"),this.showTenant?(this.userForm.get("user_id").markAsTouched(),this.previousTenant=this.userForm.get("tenant").value,this.userForm.get("tenant").patchValue(null)):(this.userForm.get("user_id").markAsUntouched(),this.userForm.get("tenant").patchValue(this.previousTenant))}getUID(){var e;let t=this.userForm.getValue("user_id");const c=null===(e=this.userForm)||void 0===e?void 0:e.getValue("tenant");return c&&c.length>0&&(t=`${this.userForm.getValue("tenant")}$${t}`),t}quotaMaxSizeValidator(e){return Object(T.b)(e.value)?null:null===RegExp("^(\\d+(\\.\\d+)?)\\s*(B|K(B|iB)?|M(B|iB)?|G(B|iB)?|T(B|iB)?)?$","i").exec(e.value)||(new St.a).toBytes(e.value)<1024?{quotaMaxSize:!0}:null}setSubuser(e,t){const c={"full-control":"full","read-write":"readwrite"},a=this.getUID();this.submitObservables.push(this.rgwUserService.createSubuser(a,{subuser:e.id,access:e.permissions in c?c[e.permissions]:e.permissions,key_type:"swift",secret_key:e.secret_key,generate_secret:e.generate_secret?"true":"false"})),d.a.isNumber(t)?this.subusers[t]=e:(this.subusers.push(e),this.swiftKeys.push({user:e.id,secret_key:e.generate_secret?"Apply your changes first...":e.secret_key})),this.userForm.markAsDirty()}deleteSubuser(e){const t=this.subusers[e];this.submitObservables.push(this.rgwUserService.deleteSubuser(this.getUID(),t.id)),this.s3Keys=this.s3Keys.filter(e=>e.user!==t.id),this.swiftKeys=this.swiftKeys.filter(e=>e.user!==t.id),this.subusers.splice(e,1),this.userForm.markAsDirty()}setCapability(e,t){const c=this.getUID();if(d.a.isNumber(t)){const a=this.capabilities[t];this.submitObservables.push(this.rgwUserService.deleteCapability(c,a.type,a.perm)),this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities[t]=e}else this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities=[...this.capabilities,e];this.userForm.markAsDirty()}deleteCapability(e){const t=this.capabilities[e];this.submitObservables.push(this.rgwUserService.deleteCapability(this.getUID(),t.type,t.perm)),this.capabilities.splice(e,1),this.capabilities=[...this.capabilities],this.userForm.markAsDirty()}hasAllCapabilities(e){return!d.a.difference(Rt.getAll(),d.a.map(e,"type")).length}setS3Key(e,t){if(d.a.isNumber(t));else{const t=e.user.match(/([^:]+)(:(.+))?/),c=t[1],a={subuser:t[2]?t[3]:"",generate_key:e.generate_key?"true":"false"};"false"===a.generate_key&&(d.a.isNil(e.access_key)||(a.access_key=e.access_key),d.a.isNil(e.secret_key)||(a.secret_key=e.secret_key)),this.submitObservables.push(this.rgwUserService.addS3Key(c,a)),this.s3Keys.push({user:e.user,access_key:e.generate_key?"Apply your changes first...":e.access_key,secret_key:e.generate_key?"Apply your changes first...":e.secret_key})}this.userForm.markAsDirty()}deleteS3Key(e){const t=this.s3Keys[e];this.submitObservables.push(this.rgwUserService.deleteS3Key(this.getUID(),t.access_key)),this.s3Keys.splice(e,1),this.userForm.markAsDirty()}showSubuserModal(e){const t=this.getUID(),c=this.modalService.show(ac);if(d.a.isNumber(e)){const a=this.subusers[e];c.componentInstance.setEditing(),c.componentInstance.setValues(t,a.id,a.permissions)}else c.componentInstance.setEditing(!1),c.componentInstance.setValues(t),c.componentInstance.setSubusers(this.subusers);c.componentInstance.submitAction.subscribe(t=>{this.setSubuser(t,e)})}showS3KeyModal(e){const t=this.modalService.show(Gt);if(d.a.isNumber(e)){const c=this.s3Keys[e];t.componentInstance.setViewing(),t.componentInstance.setValues(c.user,c.access_key,c.secret_key)}else{const e=this._getS3KeyUserCandidates();t.componentInstance.setViewing(!1),t.componentInstance.setUserCandidates(e),t.componentInstance.submitAction.subscribe(e=>{this.setS3Key(e)})}}showSwiftKeyModal(e){const t=this.modalService.show(sc),c=this.swiftKeys[e];t.componentInstance.setValues(c.user,c.secret_key)}showCapabilityModal(e){const t=this.modalService.show(Tt);if(d.a.isNumber(e)){const c=this.capabilities[e];t.componentInstance.setEditing(),t.componentInstance.setValues(c.type,c.perm)}else t.componentInstance.setEditing(!1),t.componentInstance.setCapabilities(this.capabilities);t.componentInstance.submitAction.subscribe(t=>{this.setCapability(t,e)})}_isGeneralDirty(){return["display_name","email","max_buckets_mode","max_buckets","suspended"].some(e=>this.userForm.get(e).dirty)}_isUserQuotaDirty(){return["user_quota_enabled","user_quota_max_size_unlimited","user_quota_max_size","user_quota_max_objects_unlimited","user_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_isBucketQuotaDirty(){return["bucket_quota_enabled","bucket_quota_max_size_unlimited","bucket_quota_max_size","bucket_quota_max_objects_unlimited","bucket_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_getCreateArgs(){const e={uid:this.getUID(),display_name:this.userForm.getValue("display_name"),suspended:this.userForm.getValue("suspended"),email:"",max_buckets:this.userForm.getValue("max_buckets"),generate_key:this.userForm.getValue("generate_key"),access_key:"",secret_key:""},t=this.userForm.getValue("email");d.a.isString(t)&&t.length>0&&d.a.merge(e,{email:t}),this.userForm.getValue("generate_key")||d.a.merge(e,{generate_key:!1,access_key:this.userForm.getValue("access_key"),secret_key:this.userForm.getValue("secret_key")});const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&d.a.merge(e,{max_buckets:c}),e}_getUpdateArgs(){const e={},t=["display_name","email","max_buckets","suspended"];for(const a of t)e[a]=this.userForm.getValue(a);const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&(e.max_buckets=c),e}_getUserQuotaArgs(){const e={quota_type:"user",enabled:this.userForm.getValue("user_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("user_quota_max_size_unlimited")){const t=(new St.a).toBytes(this.userForm.getValue("user_quota_max_size"));e.max_size_kb=(t/1024).toFixed(0)}return this.userForm.getValue("user_quota_max_objects_unlimited")||(e.max_objects=this.userForm.getValue("user_quota_max_objects")),e}_getBucketQuotaArgs(){const e={quota_type:"bucket",enabled:this.userForm.getValue("bucket_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("bucket_quota_max_size_unlimited")){const t=(new St.a).toBytes(this.userForm.getValue("bucket_quota_max_size"));e.max_size_kb=(t/1024).toFixed(0)}return this.userForm.getValue("bucket_quota_max_objects_unlimited")||(e.max_objects=this.userForm.getValue("bucket_quota_max_objects")),e}_getS3KeyUserCandidates(){let e=[];const t=this.getUID();return d.a.isString(t)&&!d.a.isEmpty(t)&&e.push(t),this.subusers.forEach(t=>{e.push(t.id)}),this.s3Keys.forEach(t=>{e.push(t.user)}),e=d.a.uniq(e),e}onMaxBucketsModeChange(e){"1"===e&&(this.userForm.get("max_buckets").valid||this.userForm.patchValue({max_buckets:1e3}))}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(N.a),w.Mb(s.a),w.Mb(s.e),w.Mb(x.a),w.Mb(Ne.a),w.Mb(E.a),w.Mb(n.b))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-form"]],features:[w.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","user_id",1,"cd-col-form-label",3,"ngClass"],"User ID",[1,"cd-col-form-input"],["id","user_id","type","text","formControlName","user_id",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","show_tenant","type","checkbox","formControlName","show_tenant",1,"custom-control-input",3,"readonly","click"],["for","show_tenant",1,"custom-control-label"],"Show Tenant",["class","form-group row",4,"ngIf"],["for","display_name",1,"cd-col-form-label",3,"ngClass"],"Full name",["id","display_name","type","text","formControlName","display_name",1,"form-control"],["for","email",1,"cd-col-form-label"],"Email address",["id","email","type","text","formControlName","email",1,"form-control"],["for","max_buckets_mode",1,"cd-col-form-label"],"Max. buckets",["formControlName","max_buckets_mode","name","max_buckets_mode","id","max_buckets_mode",1,"form-control","custom-select",3,"change"],["value","-1"],"Disabled",["value","0"],"Unlimited",["value","1"],"Custom",["id","suspended","type","checkbox","formControlName","suspended",1,"custom-control-input"],["for","suspended",1,"custom-control-label"],"Suspended",[4,"ngIf"],"User quota",["id","user_quota_enabled","type","checkbox","formControlName","user_quota_enabled",1,"custom-control-input"],["for","user_quota_enabled",1,"custom-control-label"],"Enabled","Bucket quota",["id","bucket_quota_enabled","type","checkbox","formControlName","bucket_quota_enabled",1,"custom-control-input"],["for","bucket_quota_enabled",1,"custom-control-label"],"Enabled",[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The value is not valid.","The chosen user ID is already in use.",["for","tenant",1,"cd-col-form-label"],"Tenant",["id","tenant","type","text","formControlName","tenant","autofocus","",1,"form-control",3,"readonly"],"The value is not valid.","The chosen user ID exists in this tenant.","This field is required.","This is not a valid email address.","The chosen email address is already in use.",[1,"cd-col-form-label"],["id","max_buckets","type","number","formControlName","max_buckets","min","1",1,"form-control"],"This field is required.","The entered value must be >= 1.","S3 key",["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],"Auto-generate key",["for","access_key",1,"cd-col-form-label","required"],"Access key",[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],"This field is required.",["for","secret_key",1,"cd-col-form-label","required"],"Secret key",["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],"This field is required.","Subusers",[1,"row"],["class","no-border",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"col-12"],["type","button",1,"btn","btn-light","float-right","tc_addSubuserButton",3,"click"],[3,"ngClass"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"help-block"],[1,"no-border"],[1,"form-text","text-muted"],"There are no subusers.",[1,"input-group-prepend"],[1,"input-group-text"],["type","text","readonly","",1,"cd-form-control",3,"value"],[1,"input-group-prepend","border-left-0","border-right-0"],["type","button",1,"btn","btn-light","tc_showSubuserButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Edit"],["type","button",1,"btn","btn-light","tc_deleteSubuserButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Delete"],"Keys","S3",["type","button",1,"btn","btn-light","float-right","tc_addS3KeyButton",3,"click"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "","Swift","There are no keys.",["type","button",1,"btn","btn-light","tc_showS3KeyButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Show"],["type","button",1,"btn","btn-light","tc_deleteS3KeyButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Delete"],"There are no keys.",["type","button",1,"btn","btn-light","tc_showSwiftKeyButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Show"],"Capabilities",["type","button","triggers","pointerenter:pointerleave",1,"btn","btn-light","float-right","tc_addCapButton",3,"disabled","disableTooltip","click",6,"ngbTooltip"],["ngbTooltip","All capabilities are already added."],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "","There are no capabilities.",["type","button",1,"btn","btn-light","tc_editCapButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Edit"],["type","button",1,"btn","btn-light","tc_deleteCapButton",3,"click",6,"ngbTooltip"],["ngbTooltip","Delete"],["id","user_quota_max_size_unlimited","type","checkbox","formControlName","user_quota_max_size_unlimited",1,"custom-control-input"],["for","user_quota_max_size_unlimited",1,"custom-control-label"],"Unlimited size",["for","user_quota_max_size",1,"cd-col-form-label","required"],"Max. size",["id","user_quota_max_size","type","text","formControlName","user_quota_max_size","cdDimlessBinary","",1,"form-control"],"This field is required.","The value is not valid.",["id","user_quota_max_objects_unlimited","type","checkbox","formControlName","user_quota_max_objects_unlimited",1,"custom-control-input"],["for","user_quota_max_objects_unlimited",1,"custom-control-label"],"Unlimited objects",["for","user_quota_max_objects",1,"cd-col-form-label","required"],"Max. objects",["id","user_quota_max_objects","type","number","formControlName","user_quota_max_objects",1,"form-control"],"This field is required.","The entered value must be >= 0.",["id","bucket_quota_max_size_unlimited","type","checkbox","formControlName","bucket_quota_max_size_unlimited",1,"custom-control-input"],["for","bucket_quota_max_size_unlimited",1,"custom-control-label"],"Unlimited size",["for","bucket_quota_max_size",1,"cd-col-form-label","required"],"Max. size",["id","bucket_quota_max_size","type","text","formControlName","bucket_quota_max_size","cdDimlessBinary","",1,"form-control"],"This field is required.","The value is not valid.",["id","bucket_quota_max_objects_unlimited","type","checkbox","formControlName","bucket_quota_max_objects_unlimited",1,"custom-control-input"],["for","bucket_quota_max_objects_unlimited",1,"custom-control-label"],"Unlimited objects",["for","bucket_quota_max_objects",1,"cd-col-form-label","required"],"Max. objects",["id","bucket_quota_max_objects","type","number","formControlName","bucket_quota_max_objects",1,"form-control"],"This field is required.","The entered value must be >= 0."]},template:function(e,t){1&e&&w.Mc(0,Hc,89,41,"div",0),2&e&&w.pc("cdFormLoading",t.loading)},directives:[F.a,i.C,i.r,W.a,i.k,O.a,a.p,D.a,i.d,j.a,i.q,i.i,a.r,i.b,i.z,i.u,i.B,B.a,P.a,i.v,Et.a,At.a,a.q,b.D,bc.a],pipes:[a.A,L.a,o.b],styles:[""]}),e})();var ta=c("x38r"),ca=c("TJUb");const aa=["accessKeyTpl"],ia=["secretKeyTpl"];function sa(e,t){if(1&e&&(w.Sb(0,"tr"),w.Sb(1,"td",15),w.Wb(2,20),w.Rb(),w.Sb(3,"td"),w.Oc(4),w.Rb(),w.Rb()),2&e){const e=w.ic(4);w.yb(4),w.Pc(e.user.email)}}function ba(e,t){if(1&e&&(w.Sb(0,"div"),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.yb(1),w.Rc(" ",e.id," (",e.permissions,") ")}}function oa(e,t){if(1&e&&(w.Sb(0,"tr"),w.Sb(1,"td",15),w.Wb(2,21),w.Rb(),w.Sb(3,"td"),w.Mc(4,ba,2,2,"div",22),w.Rb(),w.Rb()),2&e){const e=w.ic(4);w.yb(4),w.pc("ngForOf",e.user.subusers)}}function na(e,t){if(1&e&&(w.Sb(0,"div"),w.Oc(1),w.Rb()),2&e){const e=t.$implicit;w.yb(1),w.Rc(" ",e.type," (",e.perm,") ")}}function ra(e,t){if(1&e&&(w.Sb(0,"tr"),w.Sb(1,"td",15),w.Wb(2,23),w.Rb(),w.Sb(3,"td"),w.Mc(4,na,2,2,"div",22),w.Rb(),w.Rb()),2&e){const e=w.ic(4);w.yb(4),w.pc("ngForOf",e.user.caps)}}function la(e,t){1&e&&(w.Sb(0,"td"),w.Oc(1,"-"),w.Rb())}function ua(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,28),w.Rb())}function da(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.jc(2,"dimlessBinary"),w.Rb()),2&e){const e=w.ic(5);w.yb(1),w.Qc(" ",w.kc(2,1,e.user.user_quota.max_size)," ")}}function fa(e,t){1&e&&(w.Sb(0,"td"),w.Oc(1,"-"),w.Rb())}function ma(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,29),w.Rb())}function pa(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.Rb()),2&e){const e=w.ic(5);w.yb(1),w.Qc(" ",e.user.user_quota.max_objects," ")}}function ga(e,t){if(1&e&&(w.Sb(0,"div"),w.Sb(1,"legend"),w.Wb(2,24),w.Rb(),w.Sb(3,"table",9),w.Sb(4,"tbody"),w.Sb(5,"tr"),w.Sb(6,"td",10),w.Wb(7,25),w.Rb(),w.Sb(8,"td",12),w.Oc(9),w.jc(10,"booleanText"),w.Rb(),w.Rb(),w.Sb(11,"tr"),w.Sb(12,"td",15),w.Wb(13,26),w.Rb(),w.Mc(14,la,2,0,"td",0),w.Mc(15,ua,2,0,"td",0),w.Mc(16,da,3,3,"td",0),w.Rb(),w.Sb(17,"tr"),w.Sb(18,"td",15),w.Wb(19,27),w.Rb(),w.Mc(20,fa,2,0,"td",0),w.Mc(21,ma,2,0,"td",0),w.Mc(22,pa,2,1,"td",0),w.Rb(),w.Rb(),w.Rb(),w.Rb()),2&e){const e=w.ic(4);w.yb(9),w.Pc(w.kc(10,7,e.user.user_quota.enabled)),w.yb(5),w.pc("ngIf",!e.user.user_quota.enabled),w.yb(1),w.pc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size<=-1),w.yb(1),w.pc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size>-1),w.yb(4),w.pc("ngIf",!e.user.user_quota.enabled),w.yb(1),w.pc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects<=-1),w.yb(1),w.pc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects>-1)}}function ha(e,t){1&e&&(w.Sb(0,"td"),w.Oc(1,"-"),w.Rb())}function ya(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,34),w.Rb())}function Sa(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.jc(2,"dimlessBinary"),w.Rb()),2&e){const e=w.ic(5);w.yb(1),w.Qc(" ",w.kc(2,1,e.user.bucket_quota.max_size)," ")}}function _a(e,t){1&e&&(w.Sb(0,"td"),w.Oc(1,"-"),w.Rb())}function Ra(e,t){1&e&&(w.Sb(0,"td"),w.Wb(1,35),w.Rb())}function ka(e,t){if(1&e&&(w.Sb(0,"td"),w.Oc(1),w.Rb()),2&e){const e=w.ic(5);w.yb(1),w.Qc(" ",e.user.bucket_quota.max_objects," ")}}function va(e,t){if(1&e&&(w.Sb(0,"div"),w.Sb(1,"legend"),w.Wb(2,30),w.Rb(),w.Sb(3,"table",9),w.Sb(4,"tbody"),w.Sb(5,"tr"),w.Sb(6,"td",10),w.Wb(7,31),w.Rb(),w.Sb(8,"td",12),w.Oc(9),w.jc(10,"booleanText"),w.Rb(),w.Rb(),w.Sb(11,"tr"),w.Sb(12,"td",15),w.Wb(13,32),w.Rb(),w.Mc(14,ha,2,0,"td",0),w.Mc(15,ya,2,0,"td",0),w.Mc(16,Sa,3,3,"td",0),w.Rb(),w.Sb(17,"tr"),w.Sb(18,"td",15),w.Wb(19,33),w.Rb(),w.Mc(20,_a,2,0,"td",0),w.Mc(21,Ra,2,0,"td",0),w.Mc(22,ka,2,1,"td",0),w.Rb(),w.Rb(),w.Rb(),w.Rb()),2&e){const e=w.ic(4);w.yb(9),w.Pc(w.kc(10,7,e.user.bucket_quota.enabled)),w.yb(5),w.pc("ngIf",!e.user.bucket_quota.enabled),w.yb(1),w.pc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size<=-1),w.yb(1),w.pc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size>-1),w.yb(4),w.pc("ngIf",!e.user.bucket_quota.enabled),w.yb(1),w.pc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects<=-1),w.yb(1),w.pc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects>-1)}}function wa(e,t){if(1&e&&(w.Sb(0,"div"),w.Sb(1,"table",9),w.Sb(2,"tbody"),w.Sb(3,"tr"),w.Sb(4,"td",10),w.Wb(5,11),w.Rb(),w.Sb(6,"td",12),w.Oc(7),w.Rb(),w.Rb(),w.Sb(8,"tr"),w.Sb(9,"td",10),w.Wb(10,13),w.Rb(),w.Sb(11,"td",12),w.Oc(12),w.Rb(),w.Rb(),w.Sb(13,"tr"),w.Sb(14,"td",10),w.Wb(15,14),w.Rb(),w.Sb(16,"td",12),w.Oc(17),w.Rb(),w.Rb(),w.Sb(18,"tr"),w.Sb(19,"td",15),w.Wb(20,16),w.Rb(),w.Sb(21,"td"),w.Oc(22),w.Rb(),w.Rb(),w.Mc(23,sa,5,1,"tr",0),w.Sb(24,"tr"),w.Sb(25,"td",15),w.Wb(26,17),w.Rb(),w.Sb(27,"td"),w.Oc(28),w.jc(29,"booleanText"),w.Rb(),w.Rb(),w.Sb(30,"tr"),w.Sb(31,"td",15),w.Wb(32,18),w.Rb(),w.Sb(33,"td"),w.Oc(34),w.jc(35,"booleanText"),w.Rb(),w.Rb(),w.Sb(36,"tr"),w.Sb(37,"td",15),w.Wb(38,19),w.Rb(),w.Sb(39,"td"),w.Oc(40),w.jc(41,"map"),w.Rb(),w.Rb(),w.Mc(42,oa,5,1,"tr",0),w.Mc(43,ra,5,1,"tr",0),w.Rb(),w.Rb(),w.Mc(44,ga,23,9,"div",0),w.Mc(45,va,23,9,"div",0),w.Rb()),2&e){const e=w.ic(3);w.yb(7),w.Pc(e.user.tenant),w.yb(5),w.Pc(e.user.user_id),w.yb(5),w.Pc(e.user.uid),w.yb(5),w.Pc(e.user.display_name),w.yb(1),w.pc("ngIf",null==e.user.email?null:e.user.email.length),w.yb(5),w.Pc(w.kc(29,12,e.user.suspended)),w.yb(6),w.Pc(w.kc(35,14,"true"===e.user.system)),w.yb(6),w.Pc(w.lc(41,16,e.user.max_buckets,e.maxBucketsMap)),w.yb(2),w.pc("ngIf",e.user.subusers&&e.user.subusers.length),w.yb(1),w.pc("ngIf",e.user.caps&&e.user.caps.length),w.yb(1),w.pc("ngIf",e.user.user_quota),w.yb(1),w.pc("ngIf",e.user.bucket_quota)}}function za(e,t){if(1&e&&w.Mc(0,wa,46,19,"div",0),2&e){const e=w.ic(2);w.pc("ngIf",e.user)}}const Ia=function(e){return[e]};function xa(e,t){if(1&e){const e=w.Tb();w.Sb(0,"cd-table",38),w.gc("updateSelection",(function(t){return w.Dc(e),w.ic(3).updateKeysSelection(t)})),w.Sb(1,"div",39),w.Sb(2,"div",40),w.Sb(3,"button",41),w.gc("click",(function(){return w.Dc(e),w.ic(3).showKeyModal()})),w.Nb(4,"i",42),w.Qb(5),w.Wb(6,43),w.Pb(),w.Rb(),w.Rb(),w.Rb(),w.Rb()}if(2&e){const e=w.ic(3);w.pc("data",e.keys)("columns",e.keysColumns),w.yb(3),w.pc("disabled",!e.keysSelection.hasSingleSelection),w.yb(1),w.pc("ngClass",w.uc(4,Ia,e.icons.show))}}function Ma(e,t){1&e&&(w.Sb(0,"li",36),w.Sb(1,"a",4),w.Wb(2,37),w.Rb(),w.Mc(3,xa,7,6,"ng-template",6),w.Rb())}function $a(e,t){if(1&e&&(w.Qb(0),w.Sb(1,"ul",1,2),w.Sb(3,"li",3),w.Sb(4,"a",4),w.Wb(5,5),w.Rb(),w.Mc(6,za,1,1,"ng-template",6),w.Rb(),w.Mc(7,Ma,4,0,"li",7),w.Rb(),w.Nb(8,"div",8),w.Pb()),2&e){const e=w.Ac(2),t=w.ic();w.yb(7),w.pc("ngIf",t.keys.length),w.yb(1),w.pc("ngbNavOutlet",e)}}let qa=(()=>{class e{constructor(e,t){this.rgwUserService=e,this.modalService=t,this.keys=[],this.keysColumns=[],this.keysSelection=new xe.a,this.icons=M.a}ngOnInit(){this.keysColumns=[{name:"Username",prop:"username",flexGrow:1},{name:"Type",prop:"type",flexGrow:1}],this.maxBucketsMap={"-1":"Disabled",0:"Unlimited"}}ngOnChanges(){this.selection&&(this.user=this.selection,this.user.subusers=d.a.sortBy(this.user.subusers,"id"),this.user.caps=d.a.sortBy(this.user.caps,"type"),this.rgwUserService.getQuota(this.user.uid).subscribe(e=>{d.a.extend(this.user,e)}),this.keys=[],this.user.keys&&this.user.keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"S3",username:e.user,ref:e})}),this.user.swift_keys&&this.user.swift_keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"Swift",username:e.user,ref:e})}),this.keys=d.a.sortBy(this.keys,"user"))}updateKeysSelection(e){this.keysSelection=e}showKeyModal(){const e=this.keysSelection.first(),t=this.modalService.show("S3"===e.type?Gt:sc);switch(e.type){case"S3":t.componentInstance.setViewing(),t.componentInstance.setValues(e.ref.user,e.ref.access_key,e.ref.secret_key);break;case"Swift":t.componentInstance.setValues(e.ref.user,e.ref.secret_key)}}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(x.a),w.Mb(Ne.a))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-details"]],viewQuery:function(e,t){var c;1&e&&(w.Tc(aa,!0),w.Tc(ia,!0)),2&e&&(w.zc(c=w.hc())&&(t.accessKeyTpl=c.first),w.zc(c=w.hc())&&(t.secretKeyTpl=c.first))},inputs:{selection:"selection"},features:[w.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-user-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","keys",4,"ngIf"],[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],"Tenant",[1,"w-75"],"User ID","Username",[1,"bold"],"Full name","Suspended","System","Maximum buckets","Email address","Subusers",[4,"ngFor","ngForOf"],"Capabilities","User quota","Enabled","Maximum size","Maximum objects","Unlimited","Unlimited","Bucket quota","Enabled","Maximum size","Maximum objects","Unlimited","Unlimited",["ngbNavItem","keys"],"Keys",["columnMode","flex","selectionType","multi","forceIdentifier","true",3,"data","columns","updateSelection"],[1,"table-actions"],["dropdown","",1,"btn-group"],["type","button",1,"btn","btn-accent",3,"disabled","click"],[3,"ngClass"],"Show"]},template:function(e,t){1&e&&w.Mc(0,$a,9,2,"ng-container",0),2&e&&w.pc("ngIf",t.selection)},directives:[a.r,b.p,ct.a,b.r,b.s,b.q,b.u,a.q,Ie.a,D.a,a.p],pipes:[Ce.a,ca.a,Me.a],styles:[""]}),e})();const Na=["userSizeTpl"],Ta=["userObjectTpl"];function Ea(e,t){if(1&e&&w.Nb(0,"cd-usage-bar",8),2&e){const e=w.ic().row;w.pc("total",e.user_quota.max_size)("used",e.stats.size_actual)}}function Aa(e,t){1&e&&w.Wb(0,9)}function Ca(e,t){if(1&e&&(w.Mc(0,Ea,1,2,"cd-usage-bar",6),w.Mc(1,Aa,1,0,"ng-template",null,7,w.Nc)),2&e){const e=t.row,c=w.Ac(2);w.pc("ngIf",e.user_quota.max_size>0&&e.user_quota.enabled)("ngIfElse",c)}}function Fa(e,t){if(1&e&&w.Nb(0,"cd-usage-bar",12),2&e){const e=w.ic().row;w.pc("total",e.user_quota.max_objects)("used",e.stats.num_objects)("isBinary",!1)}}function Wa(e,t){1&e&&w.Wb(0,13)}function Oa(e,t){if(1&e&&(w.Mc(0,Fa,1,3,"cd-usage-bar",10),w.Mc(1,Wa,1,0,"ng-template",null,11,w.Nc)),2&e){const e=t.row,c=w.Ac(2);w.pc("ngIf",e.user_quota.max_objects>0&&e.user_quota.enabled)("ngIfElse",c)}}let Da=(()=>{class e extends we.a{constructor(e,t,c,a,i,s){super(s),this.authStorageService=e,this.rgwUserService=t,this.modalService=c,this.urlBuilder=a,this.actionLabels=i,this.ngZone=s,this.columns=[],this.users=[],this.selection=new xe.a}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Username",prop:"uid",flexGrow:1},{name:"Tenant",prop:"tenant",flexGrow:1},{name:"Full name",prop:"display_name",flexGrow:1},{name:"Email address",prop:"email",flexGrow:1},{name:"Suspended",prop:"suspended",flexGrow:1,cellClass:"text-center",cellTransformation:ta.a.checkIcon},{name:"Max. buckets",prop:"max_buckets",flexGrow:1,cellTransformation:ta.a.map,customTemplateConfig:{"-1":"Disabled",0:"Unlimited"}},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.userSizeTpl,flexGrow:.8},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.userObjectTpl,flexGrow:.8}];const e=()=>this.selection.first()&&""+encodeURIComponent(this.selection.first().uid);this.tableActions=[{permission:"create",icon:M.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection},{permission:"update",icon:M.a.edit,routerLink:()=>this.urlBuilder.getEdit(e()),name:this.actionLabels.EDIT},{permission:"delete",icon:M.a.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:e=>e.hasMultiSelection}],this.setTableRefreshTimeout()}getUserList(e){this.setTableRefreshTimeout(),this.rgwUserService.list().subscribe(e=>{this.users=e},()=>{e.error()})}updateSelection(e){this.selection=e}deleteAction(){this.modalService.show(ze.a,{itemDescription:this.selection.hasSingleSelection?"user":"users",itemNames:this.selection.selected.map(e=>e.uid),submitActionObservable:()=>new ve.a(e=>{Object(f.a)(this.selection.selected.map(e=>this.rgwUserService.delete(e.uid))).subscribe({error:t=>{e.error(t),this.table.refreshBtn()},complete:()=>{e.complete(),this.table.refreshBtn()}})})})}}return e.\u0275fac=function(t){return new(t||e)(w.Mb(qe.a),w.Mb(x.a),w.Mb(Ne.a),w.Mb(Te.a),w.Mb(n.b),w.Mb(w.A))},e.\u0275cmp=w.Gb({type:e,selectors:[["cd-rgw-user-list"]],viewQuery:function(e,t){var c;1&e&&(w.Jc(Ie.a,!0),w.Jc(Na,!0),w.Jc(Ta,!0)),2&e&&(w.zc(c=w.hc())&&(t.table=c.first),w.zc(c=w.hc())&&(t.userSizeTpl=c.first),w.zc(c=w.hc())&&(t.userObjectTpl=c.first))},features:[w.xb([{provide:Te.a,useValue:new Te.a("rgw/user")}]),w.vb],decls:8,vars:9,consts:function(){return[["columnMode","flex","selectionType","multiClick","identifier","uid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["userSizeTpl",""],["userObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],"No Limit",[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],"No Limit"]},template:function(e,t){1&e&&(w.Sb(0,"cd-table",0,1),w.gc("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)}))("fetchData",(function(e){return t.getUserList(e)})),w.Nb(2,"cd-table-actions",2),w.Nb(3,"cd-rgw-user-details",3),w.Rb(),w.Mc(4,Ca,3,2,"ng-template",null,4,w.Nc),w.Mc(6,Oa,3,2,"ng-template",null,5,w.Nc)),2&e&&(w.pc("autoReload",!1)("data",t.users)("columns",t.columns)("hasDetails",!0)("status",t.tableStatus),w.yb(2),w.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),w.yb(1),w.pc("selection",t.expandedRow))},directives:[Ie.a,Ee.a,qa,a.r,Le.a],styles:[""]}),e})(),ja=(()=>{class e{}return e.\u0275mod=w.Kb({type:e}),e.\u0275inj=w.Jb({factory:function(t){return new(t||e)},imports:[[a.c,r.a,i.m,i.x,l.a,b.t,s.i,b.F,o.a]]}),e})();const Pa=[{path:""},{path:"daemon",component:ht,data:{breadcrumbs:"Daemons"}},{path:"user",data:{breadcrumbs:"Users"},children:[{path:"",component:Da},{path:n.e.CREATE,component:ea,data:{breadcrumbs:n.a.CREATE}},{path:n.e.EDIT+"/:uid",component:ea,data:{breadcrumbs:n.a.EDIT}}]},{path:"bucket",data:{breadcrumbs:"Buckets"},children:[{path:"",component:He},{path:n.e.CREATE,component:ke,data:{breadcrumbs:n.a.CREATE}},{path:n.e.EDIT+"/:bid",component:ke,data:{breadcrumbs:n.a.EDIT}}]}];let Va=(()=>{class e{}return e.\u0275mod=w.Kb({type:e}),e.\u0275inj=w.Jb({factory:function(t){return new(t||e)},imports:[[ja,s.i.forChild(Pa)]]}),e})()}}]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.e0fafffe422f8212d682.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/6.e0fafffe422f8212d682.js
new file mode 100644 (file)
index 0000000..f184186
--- /dev/null
@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{OkK6:function(e,t,c){"use strict";c.r(t),c.d(t,"RgwModule",function(){return Na}),c.d(t,"RoutedRgwModule",function(){return Oa});var a=c("SVse"),i=c("s7LF"),s=c("iInd"),b=c("G0yt"),o=c("zWsK"),n=c("sne2"),r=c("PCNd"),l=c("G6Q+"),u=c("LvDl"),d=c.n(u),f=c("cp0P"),m=c("6HA4"),p=c("eCU+"),g=c("mrSG"),h=c("IheW"),_=c("LRne"),v=c("5+tZ"),y=c("CqXF"),W=c("JIr8"),k=c("9xzX"),X=c("xTzq"),w=c("8Y7J");let D=(()=>{let e=class{constructor(e,t){this.http=e,this.rgwDaemonService=t,this.url="api/rgw/user"}list(){return this.enumerate().pipe(Object(v.a)(e=>e.length>0?Object(f.a)(e.map(e=>this.get(e))):Object(_.a)([])))}enumerate(){return this.rgwDaemonService.request(e=>this.http.get(this.url,{params:e}))}enumerateEmail(){return this.rgwDaemonService.request(e=>this.http.get(`${this.url}/get_emails`,{params:e}))}get(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}`,{params:t}))}getQuota(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}/quota`,{params:t}))}create(e){return this.rgwDaemonService.request(t=>(d.a.keys(e).forEach(c=>{t=t.append(c,e[c])}),this.http.post(this.url,null,{params:t})))}update(e,t){return this.rgwDaemonService.request(c=>(d.a.keys(t).forEach(e=>{c=c.append(e,t[e])}),this.http.put(`${this.url}/${e}`,null,{params:c})))}updateQuota(e,t){return this.rgwDaemonService.request(c=>(d.a.keys(t).forEach(e=>{c=c.append(e,t[e])}),this.http.put(`${this.url}/${e}/quota`,null,{params:c})))}delete(e){return this.rgwDaemonService.request(t=>this.http.delete(`${this.url}/${e}`,{params:t}))}createSubuser(e,t){return this.rgwDaemonService.request(c=>(d.a.keys(t).forEach(e=>{c=c.append(e,t[e])}),this.http.post(`${this.url}/${e}/subuser`,null,{params:c})))}deleteSubuser(e,t){return this.rgwDaemonService.request(c=>this.http.delete(`${this.url}/${e}/subuser/${t}`,{params:c}))}addCapability(e,t,c){return this.rgwDaemonService.request(a=>(a=(a=a.append("type",t)).append("perm",c),this.http.post(`${this.url}/${e}/capability`,null,{params:a})))}deleteCapability(e,t,c){return this.rgwDaemonService.request(a=>(a=(a=a.append("type",t)).append("perm",c),this.http.delete(`${this.url}/${e}/capability`,{params:a})))}addS3Key(e,t){return this.rgwDaemonService.request(c=>(c=c.append("key_type","s3"),d.a.keys(t).forEach(e=>{c=c.append(e,t[e])}),this.http.post(`${this.url}/${e}/key`,null,{params:c})))}deleteS3Key(e,t){return this.rgwDaemonService.request(c=>(c=(c=c.append("key_type","s3")).append("access_key",t),this.http.delete(`${this.url}/${e}/key`,{params:c})))}exists(e){return this.get(e).pipe(Object(y.a)(!0),Object(W.a)(e=>(d.a.isFunction(e.preventDefault)&&e.preventDefault(),Object(_.a)(!1))))}emailExists(e){return e=decodeURIComponent(e),this.enumerateEmail().pipe(Object(v.a)(t=>{const c=d.a.indexOf(t,e);return Object(_.a)(-1!==c)}))}};return e.\u0275fac=function(t){return new(t||e)(w.ic(h.b),w.ic(k.a))},e.\u0275prov=w.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(g.b)([X.a,Object(g.d)("design:paramtypes",[h.b,k.a])],e),e})();var S=c("oxzT"),z=c("mtw6"),I=c("spCT"),$=c("2EZI"),x=c("1Ni5"),q=c("9nlD"),E=function(e){return e.ENABLED="Enabled",e.DISABLED="Disabled",e}({}),F=function(e){return e.ENABLED="Enabled",e.SUSPENDED="Suspended",e}({}),P=c("zc8c"),T=c("NwgZ"),C=c("ocLN"),R=c("ANnk"),A=c("f69J"),N=c("IZUe"),V=c("p4Cf"),O=c("6+kj"),B=c("8xTl");function L(e,t){1&e&&(w.Xb(0,"div",9),w.Xb(1,"label",35),w.bc(2,36),w.Wb(),w.Xb(3,"div",12),w.Sb(4,"input",37),w.Wb(),w.Wb())}function j(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,39),w.Wb())}function U(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,40),w.Wb())}function M(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,41),w.Wb())}function G(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,42),w.Wb())}function K(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,43),w.Wb())}function Q(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,44),w.Wb())}function Y(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,45),w.Wb())}function Z(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,46),w.Wb())}function J(e,t){1&e&&(w.Xb(0,"option",47),w.bc(1,48),w.Wb()),2&e&&w.uc("ngValue",null)}function H(e,t){1&e&&(w.Xb(0,"option",47),w.bc(1,49),w.Wb()),2&e&&w.uc("ngValue",null)}function ee(e,t){if(1&e&&(w.Xb(0,"option",50),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e),w.Db(1),w.Sc(e)}}function te(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,51),w.Wb())}function ce(e,t){1&e&&(w.Xb(0,"option",47),w.bc(1,53),w.Wb()),2&e&&w.uc("ngValue",null)}function ae(e,t){1&e&&(w.Xb(0,"option",47),w.bc(1,54),w.Wb()),2&e&&w.uc("ngValue",null)}function ie(e,t){if(1&e&&(w.Xb(0,"option",50),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e.name),w.Db(1),w.Sc(e.description)}}function se(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,55),w.Wb())}function be(e,t){if(1&e&&(w.Xb(0,"select",52),w.Pc(1,ce,2,1,"option",18),w.Pc(2,ae,2,1,"option",18),w.Pc(3,ie,2,2,"option",19),w.Wb(),w.Pc(4,se,2,0,"span",14)),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(1),w.uc("ngIf",null===t.placementTargets),w.Db(1),w.uc("ngIf",null!==t.placementTargets),w.Db(1),w.uc("ngForOf",t.placementTargets),w.Db(1),w.uc("ngIf",t.bucketForm.showError("placement-target",e,"required"))}}function oe(e,t){1&e&&(w.Vb(0),w.Sb(1,"input",56),w.Ub())}function ne(e,t){if(1&e){const e=w.Yb();w.Xb(0,"fieldset"),w.Xb(1,"legend",25),w.bc(2,57),w.Wb(),w.Xb(3,"div",9),w.Xb(4,"div",27),w.Xb(5,"div",28),w.Xb(6,"input",58),w.lc("change",function(){return w.Ic(e),w.nc(2).setMfaDeleteValidators()}),w.Wb(),w.Xb(7,"label",59),w.bc(8,60),w.Wb(),w.Xb(9,"cd-helper"),w.Xb(10,"span"),w.bc(11,61),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb()}}function re(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,70),w.Wb())}function le(e,t){if(1&e&&(w.Xb(0,"div",9),w.Xb(1,"label",67),w.bc(2,68),w.Wb(),w.Xb(3,"div",12),w.Sb(4,"input",69),w.Pc(5,re,2,0,"span",14),w.Wb(),w.Wb()),2&e){w.nc(2);const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.bucketForm.showError("mfa-token-serial",e,"required"))}}function ue(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,74),w.Wb())}function de(e,t){if(1&e&&(w.Xb(0,"div",9),w.Xb(1,"label",71),w.bc(2,72),w.Wb(),w.Xb(3,"div",12),w.Sb(4,"input",73),w.Pc(5,ue,2,0,"span",14),w.Wb(),w.Wb()),2&e){w.nc(2);const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.bucketForm.showError("mfa-token-pin",e,"required"))}}function fe(e,t){if(1&e){const e=w.Yb();w.Xb(0,"fieldset"),w.Xb(1,"legend",25),w.bc(2,62),w.Wb(),w.Xb(3,"div",9),w.Xb(4,"div",27),w.Xb(5,"div",28),w.Xb(6,"input",63),w.lc("change",function(){return w.Ic(e),w.nc(2).setMfaDeleteValidators()}),w.Wb(),w.Xb(7,"label",64),w.bc(8,65),w.Wb(),w.Xb(9,"cd-helper"),w.Xb(10,"span"),w.bc(11,66),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(12,le,6,1,"div",8),w.Pc(13,de,6,1,"div",8),w.Wb()}if(2&e){const e=w.nc(2);w.Db(12),w.uc("ngIf",e.areMfaCredentialsRequired()),w.Db(1),w.uc("ngIf",e.areMfaCredentialsRequired())}}function me(e,t){1&e&&(w.Xb(0,"div",9),w.Xb(1,"label",75),w.bc(2,76),w.Wb(),w.Xb(3,"div",12),w.Xb(4,"select",77),w.Xb(5,"option",78),w.bc(6,79),w.Wb(),w.Xb(7,"option",80),w.bc(8,81),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function pe(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,86),w.Wb())}function ge(e,t){1&e&&(w.Xb(0,"span",38),w.bc(1,87),w.Wb())}function he(e,t){if(1&e&&(w.Xb(0,"div",9),w.Xb(1,"label",82),w.Vb(2),w.bc(3,83),w.Ub(),w.Xb(4,"cd-helper"),w.bc(5,84),w.Wb(),w.Wb(),w.Xb(6,"div",12),w.Sb(7,"input",85),w.Pc(8,pe,2,0,"span",14),w.Pc(9,ge,2,0,"span",14),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(8),w.uc("ngIf",t.bucketForm.showError("lock_retention_period_days",e,"pattern")),w.Db(1),w.uc("ngIf",t.bucketForm.showError("lock_retention_period_days",e,"lockDays"))}}const _e=function(e){return{required:e}};function ve(e,t){if(1&e){const e=w.Yb();w.Xb(0,"div",1),w.Xb(1,"form",2,3),w.Xb(3,"div",4),w.Xb(4,"div",5),w.bc(5,6),w.oc(6,"titlecase"),w.oc(7,"upperFirst"),w.Wb(),w.Xb(8,"div",7),w.Pc(9,L,5,0,"div",8),w.Xb(10,"div",9),w.Xb(11,"label",10),w.bc(12,11),w.Wb(),w.Xb(13,"div",12),w.Sb(14,"input",13),w.Pc(15,j,2,0,"span",14),w.Pc(16,U,2,0,"span",14),w.Pc(17,M,2,0,"span",14),w.Pc(18,G,2,0,"span",14),w.Pc(19,K,2,0,"span",14),w.Pc(20,Q,2,0,"span",14),w.Pc(21,Y,2,0,"span",14),w.Pc(22,Z,2,0,"span",14),w.Wb(),w.Wb(),w.Xb(23,"div",9),w.Xb(24,"label",15),w.bc(25,16),w.Wb(),w.Xb(26,"div",12),w.Xb(27,"select",17),w.Pc(28,J,2,1,"option",18),w.Pc(29,H,2,1,"option",18),w.Pc(30,ee,2,2,"option",19),w.Wb(),w.Pc(31,te,2,0,"span",14),w.Wb(),w.Wb(),w.Xb(32,"div",9),w.Xb(33,"label",20),w.bc(34,21),w.Wb(),w.Xb(35,"div",12),w.Pc(36,be,5,4,"ng-template",null,22,w.Qc),w.Pc(38,oe,2,0,"ng-container",23),w.Wb(),w.Wb(),w.Pc(39,ne,12,0,"fieldset",24),w.Pc(40,fe,14,2,"fieldset",24),w.Xb(41,"fieldset"),w.Xb(42,"legend",25),w.bc(43,26),w.Wb(),w.Xb(44,"div",9),w.Xb(45,"div",27),w.Xb(46,"div",28),w.Sb(47,"input",29),w.Xb(48,"label",30),w.bc(49,31),w.Wb(),w.Xb(50,"cd-helper"),w.Xb(51,"span"),w.bc(52,32),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(53,me,9,0,"div",8),w.Pc(54,he,10,2,"div",8),w.Wb(),w.Wb(),w.Xb(55,"div",33),w.Xb(56,"cd-form-button-panel",34),w.lc("submitActionEvent",function(){return w.Ic(e),w.nc().submit()}),w.oc(57,"titlecase"),w.oc(58,"upperFirst"),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.Fc(2),t=w.Fc(37),c=w.nc();w.Db(1),w.uc("formGroup",c.bucketForm),w.Db(6),w.fc(w.pc(6,29,c.action))(w.pc(7,31,c.resource)),w.cc(5),w.Db(2),w.uc("ngIf",c.editing),w.Db(2),w.uc("ngClass",w.zc(37,_e,!c.editing)),w.Db(3),w.uc("readonly",c.editing)("autofocus",!c.editing),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"required")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"bucketNameInvalid")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"bucketNameNotAllowed")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"containsUpperCase")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"lowerCaseOrNumber")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"ipAddress")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"onlyLowerCaseAndNumbers")),w.Db(1),w.uc("ngIf",c.bucketForm.showError("bid",e,"shouldBeInRange")),w.Db(5),w.uc("autofocus",c.editing),w.Db(1),w.uc("ngIf",null===c.owners),w.Db(1),w.uc("ngIf",null!==c.owners),w.Db(1),w.uc("ngForOf",c.owners),w.Db(1),w.uc("ngIf",c.bucketForm.showError("owner",e,"required")),w.Db(2),w.uc("ngClass",w.zc(39,_e,!c.editing)),w.Db(5),w.uc("ngIf",c.editing)("ngIfElse",t),w.Db(1),w.uc("ngIf",c.editing),w.Db(1),w.uc("ngIf",c.editing),w.Db(13),w.uc("ngIf",c.bucketForm.getValue("lock_enabled")),w.Db(1),w.uc("ngIf",c.bucketForm.getValue("lock_enabled")),w.Db(2),w.uc("form",c.bucketForm)("submitText",w.pc(57,33,c.action)+" "+w.pc(58,35,c.resource))}}let ye=(()=>{class e extends I.a{constructor(e,t,c,a,i,s,b,o){super(),this.route=e,this.router=t,this.formBuilder=c,this.rgwBucketService=a,this.rgwSiteService=i,this.rgwUserService=s,this.notificationService=b,this.actionLabels=o,this.editing=!1,this.owners=null,this.placementTargets=[],this.isVersioningAlreadyEnabled=!1,this.isMfaDeleteAlreadyEnabled=!1,this.icons=S.a,this.editing=this.router.url.startsWith(`/rgw/bucket/${n.e.EDIT}`),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.resource="bucket",this.createForm()}get isVersioningEnabled(){return this.bucketForm.getValue("versioning")}get isMfaDeleteEnabled(){return this.bucketForm.getValue("mfa-delete")}createForm(){const e=this,t=x.a.custom("lockDays",()=>{if(!e.bucketForm||!d.a.get(e.bucketForm.getRawValue(),"lock_enabled"))return!1;const t=Number(e.bucketForm.getValue("lock_retention_period_days"));return!Number.isInteger(t)||0===t});this.bucketForm=this.formBuilder.group({id:[null],bid:[null,[i.A.required],this.editing?[]:[x.a.bucketName(),x.a.bucketExistence(!1,this.rgwBucketService)]],owner:[null,[i.A.required]],"placement-target":[null,this.editing?[]:[i.A.required]],versioning:[null],"mfa-delete":[null],"mfa-token-serial":[""],"mfa-token-pin":[""],lock_enabled:[{value:!1,disabled:this.editing}],lock_mode:["COMPLIANCE"],lock_retention_period_days:[0,[x.a.number(!1),t]]})}ngOnInit(){const e={owners:this.rgwUserService.enumerate()};this.editing||(e.getPlacementTargets=this.rgwSiteService.get("placement-targets")),this.route.params.subscribe(t=>{if(t.hasOwnProperty("bid")){const c=decodeURIComponent(t.bid);e.getBid=this.rgwBucketService.get(c)}Object(f.a)(e).subscribe(e=>{if(this.owners=e.owners.sort(),e.getPlacementTargets){const t=e.getPlacementTargets;this.zonegroup=t.zonegroup,d.a.forEach(t.placement_targets,e=>{e.description=`${e.name} (${"pool"}: ${e.data_pool})`,this.placementTargets.push(e)}),1===this.placementTargets.length&&this.bucketForm.get("placement-target").setValue(this.placementTargets[0].name)}if(e.getBid){const t=e.getBid,c=d.a.clone(this.bucketForm.getRawValue());let a=d.a.pick(t,d.a.keys(c));a.lock_retention_period_days=this.rgwBucketService.getLockDays(t),a["placement-target"]=t.placement_rule,a.versioning=t.versioning===F.ENABLED,a["mfa-delete"]=t.mfa_delete===E.ENABLED,a=d.a.merge(c,a),this.bucketForm.setValue(a),this.editing&&(this.isVersioningAlreadyEnabled=this.isVersioningEnabled,this.isMfaDeleteAlreadyEnabled=this.isMfaDeleteEnabled,this.setMfaDeleteValidators(),a.lock_enabled&&this.bucketForm.controls.versioning.disable())}this.loadingReady()})})}goToListView(){this.router.navigate(["/rgw/bucket"])}submit(){if(this.bucketForm.pristine)return void this.goToListView();const e=this.bucketForm.value;if(this.editing){const t=this.getVersioningStatus(),c=this.getMfaDeleteStatus();this.rgwBucketService.update(e.bid,e.id,e.owner,t,c,e["mfa-token-serial"],e["mfa-token-pin"],e.lock_mode,e.lock_retention_period_days).subscribe(()=>{this.notificationService.show(z.a.success,"Updated Object Gateway bucket '" + e.bid + "'."),this.goToListView()},()=>{this.bucketForm.setErrors({cdSubmitButton:!0})})}else this.rgwBucketService.create(e.bid,e.owner,this.zonegroup,e["placement-target"],e.lock_enabled,e.lock_mode,e.lock_retention_period_days).subscribe(()=>{this.notificationService.show(z.a.success,"Created Object Gateway bucket '" + e.bid + "'"),this.goToListView()},()=>{this.bucketForm.setErrors({cdSubmitButton:!0})})}areMfaCredentialsRequired(){return this.isMfaDeleteEnabled!==this.isMfaDeleteAlreadyEnabled||this.isMfaDeleteAlreadyEnabled&&this.isVersioningEnabled!==this.isVersioningAlreadyEnabled}setMfaDeleteValidators(){const e=this.bucketForm.get("mfa-token-serial"),t=this.bucketForm.get("mfa-token-pin");this.areMfaCredentialsRequired()?(e.setValidators(i.A.required),t.setValidators(i.A.required)):(e.setValidators(null),t.setValidators(null)),e.updateValueAndValidity(),t.updateValueAndValidity()}getVersioningStatus(){return this.isVersioningEnabled?F.ENABLED:F.SUSPENDED}getMfaDeleteStatus(){return this.isMfaDeleteEnabled?E.ENABLED:E.DISABLED}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(s.a),w.Rb(s.e),w.Rb($.a),w.Rb(m.a),w.Rb(p.a),w.Rb(D),w.Rb(q.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-bucket-form"]],features:[w.Ab],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k,X,w,D,S,z,I,$,x,q,E,F,P,T,C,R,A,N;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",c="Name...",a="Owner",i="Placement target",s="Locking",b="Enabled",o="Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket.",n="Id",r="This field is required.",l="Bucket names can only contain lowercase letters, numbers, periods and hyphens.",u="The chosen name is already in use.",d="Bucket names must not contain uppercase characters or underscores.",f="Each label must start and end with a lowercase letter or a number.",m="Bucket names cannot be formatted as IP address.",p="Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens.",g="Bucket names must be 3 to 63 characters long.",h="Loading...",_="-- Select a user --",v="This field is required.",y="Loading...",W="-- Select a placement target --",k="This field is required.",X="Versioning",w="Enabled",D="Enables versioning for the objects in the bucket.",S="Multi-Factor Authentication",z="Delete enabled",I="Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state.",$="Token Serial Number",x="This field is required.",q="Token PIN",E="This field is required.",F="Mode",P="Compliance",T="Governance",C="Days",R="The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.",A="The entered value must be a positive integer.",N="Retention Days must be a positive integer.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","bucketForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","bid",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["id","bid","name","bid","type","text","placeholder",c,"formControlName","bid",1,"form-control",3,"readonly","autofocus"],["class","invalid-feedback",4,"ngIf"],["for","owner",1,"cd-col-form-label","required"],a,["id","owner","name","owner","formControlName","owner",1,"form-control","custom-select",3,"autofocus"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["for","placement-target",1,"cd-col-form-label",3,"ngClass"],i,["placementTargetSelect",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"cd-header"],s,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","lock_enabled","formControlName","lock_enabled","type","checkbox",1,"custom-control-input"],["for","lock_enabled",1,"custom-control-label"],b,o,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","id",1,"cd-col-form-label"],n,["id","id","name","id","type","text","formControlName","id","readonly","",1,"form-control"],[1,"invalid-feedback"],r,l,u,d,f,m,p,g,[3,"ngValue"],h,_,[3,"value"],v,["id","placement-target","name","placement-target","formControlName","placement-target",1,"form-control","custom-select"],y,W,k,["id","placement-target","name","placement-target","formControlName","placement-target","type","text","readonly","",1,"form-control"],X,["type","checkbox","id","versioning","name","versioning","formControlName","versioning",1,"custom-control-input",3,"change"],["for","versioning",1,"custom-control-label"],w,D,S,["type","checkbox","id","mfa-delete","name","mfa-delete","formControlName","mfa-delete",1,"custom-control-input",3,"change"],["for","mfa-delete",1,"custom-control-label"],z,I,["for","mfa-token-serial",1,"cd-col-form-label"],$,["type","text","id","mfa-token-serial","name","mfa-token-serial","formControlName","mfa-token-serial",1,"form-control"],x,["for","mfa-token-pin",1,"cd-col-form-label"],q,["type","text","id","mfa-token-pin","name","mfa-token-pin","formControlName","mfa-token-pin",1,"form-control"],E,["for","lock_mode",1,"cd-col-form-label"],F,["formControlName","lock_mode","name","lock_mode","id","lock_mode",1,"form-control","custom-select"],["value","COMPLIANCE"],P,["value","GOVERNANCE"],T,["for","lock_retention_period_days",1,"cd-col-form-label"],C,R,["type","number","id","lock_retention_period_days","formControlName","lock_retention_period_days","min","0",1,"form-control"],A,N]},template:function(e,t){1&e&&w.Pc(0,ve,59,41,"div",0),2&e&&w.uc("cdFormLoading",t.loading)},directives:[P.a,i.B,i.r,T.a,i.k,a.r,C.a,a.p,R.a,i.d,A.a,i.q,i.i,N.a,i.z,a.q,i.b,V.a,O.a,i.u,i.C,i.v],pipes:[a.A,B.a],styles:[""]}),e})();var We=c("HDdC"),ke=c("+fVR"),Xe=c("0+/T"),we=c("uIqm"),De=c("vCyI"),Se=c("Fgil"),ze=c("o4+5"),Ie=c("aexS"),$e=c("JK/P"),xe=c("EgGo"),qe=c("S7zO"),Ee=c("a0VL"),Fe=c("iExv");function Pe(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,24),w.Wb())}function Te(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.oc(2,"dimless"),w.Wb()),2&e){const e=w.nc(3);w.Db(1),w.Tc(" ",w.pc(2,1,e.selection.bucket_quota.max_size)," ")}}function Ce(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,25),w.Wb())}function Re(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.Wb()),2&e){const e=w.nc(3);w.Db(1),w.Tc(" ",e.selection.bucket_quota.max_objects," ")}}function Ae(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"legend"),w.bc(2,20),w.Wb(),w.Xb(3,"table",1),w.Xb(4,"tbody"),w.Xb(5,"tr"),w.Xb(6,"td",2),w.bc(7,21),w.Wb(),w.Xb(8,"td",4),w.Rc(9),w.oc(10,"booleanText"),w.Wb(),w.Wb(),w.Xb(11,"tr"),w.Xb(12,"td",5),w.bc(13,22),w.Wb(),w.Pc(14,Pe,2,0,"td",0),w.Pc(15,Te,3,3,"td",0),w.Wb(),w.Xb(16,"tr"),w.Xb(17,"td",5),w.bc(18,23),w.Wb(),w.Pc(19,Ce,2,0,"td",0),w.Pc(20,Re,2,1,"td",0),w.Wb(),w.Wb(),w.Wb(),w.Wb()),2&e){const e=w.nc(2);w.Db(9),w.Sc(w.pc(10,5,e.selection.bucket_quota.enabled)),w.Db(5),w.uc("ngIf",e.selection.bucket_quota.max_size<=-1),w.Db(1),w.uc("ngIf",e.selection.bucket_quota.max_size>-1),w.Db(4),w.uc("ngIf",e.selection.bucket_quota.max_objects<=-1),w.Db(1),w.uc("ngIf",e.selection.bucket_quota.max_objects>-1)}}function Ne(e,t){if(1&e&&(w.Vb(0),w.Xb(1,"tr"),w.Xb(2,"td",5),w.bc(3,26),w.Wb(),w.Xb(4,"td"),w.Rc(5),w.Wb(),w.Wb(),w.Xb(6,"tr"),w.Xb(7,"td",5),w.bc(8,27),w.Wb(),w.Xb(9,"td"),w.Rc(10),w.Wb(),w.Wb(),w.Ub()),2&e){const e=w.nc(2);w.Db(5),w.Sc(e.selection.lock_mode),w.Db(5),w.Sc(e.selection.lock_retention_period_days)}}function Ve(e,t){if(1&e&&(w.Vb(0),w.Xb(1,"table",1),w.Xb(2,"tbody"),w.Xb(3,"tr"),w.Xb(4,"td",2),w.bc(5,3),w.Wb(),w.Xb(6,"td",4),w.Rc(7),w.Wb(),w.Wb(),w.Xb(8,"tr"),w.Xb(9,"td",5),w.bc(10,6),w.Wb(),w.Xb(11,"td"),w.Rc(12),w.Wb(),w.Wb(),w.Xb(13,"tr"),w.Xb(14,"td",5),w.bc(15,7),w.Wb(),w.Xb(16,"td"),w.Rc(17),w.Wb(),w.Wb(),w.Xb(18,"tr"),w.Xb(19,"td",5),w.bc(20,8),w.Wb(),w.Xb(21,"td"),w.Rc(22),w.Wb(),w.Wb(),w.Xb(23,"tr"),w.Xb(24,"td",5),w.bc(25,9),w.Wb(),w.Xb(26,"td"),w.Rc(27),w.Wb(),w.Wb(),w.Xb(28,"tr"),w.Xb(29,"td",5),w.bc(30,10),w.Wb(),w.Xb(31,"td"),w.Rc(32),w.Wb(),w.Wb(),w.Xb(33,"tr"),w.Xb(34,"td",5),w.bc(35,11),w.Wb(),w.Xb(36,"td"),w.Rc(37),w.Wb(),w.Wb(),w.Xb(38,"tr"),w.Xb(39,"td",5),w.bc(40,12),w.Wb(),w.Xb(41,"td"),w.Rc(42),w.Wb(),w.Wb(),w.Xb(43,"tr"),w.Xb(44,"td",5),w.bc(45,13),w.Wb(),w.Xb(46,"td"),w.Rc(47),w.Wb(),w.Wb(),w.Xb(48,"tr"),w.Xb(49,"td",5),w.bc(50,14),w.Wb(),w.Xb(51,"td"),w.Rc(52),w.oc(53,"cdDate"),w.Wb(),w.Wb(),w.Xb(54,"tr"),w.Xb(55,"td",5),w.bc(56,15),w.Wb(),w.Xb(57,"td"),w.Rc(58),w.Wb(),w.Wb(),w.Xb(59,"tr"),w.Xb(60,"td",5),w.bc(61,16),w.Wb(),w.Xb(62,"td"),w.Rc(63),w.Wb(),w.Wb(),w.Xb(64,"tr"),w.Xb(65,"td",5),w.bc(66,17),w.Wb(),w.Xb(67,"td"),w.Rc(68),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(69,Ae,21,7,"div",0),w.Xb(70,"legend"),w.bc(71,18),w.Wb(),w.Xb(72,"table",1),w.Xb(73,"tbody"),w.Xb(74,"tr"),w.Xb(75,"td",2),w.bc(76,19),w.Wb(),w.Xb(77,"td",4),w.Rc(78),w.oc(79,"booleanText"),w.Wb(),w.Wb(),w.Pc(80,Ne,11,2,"ng-container",0),w.Wb(),w.Wb(),w.Ub()),2&e){const e=w.nc();w.Db(7),w.Sc(e.selection.bid),w.Db(5),w.Sc(e.selection.id),w.Db(5),w.Sc(e.selection.owner),w.Db(5),w.Sc(e.selection.index_type),w.Db(5),w.Sc(e.selection.placement_rule),w.Db(5),w.Sc(e.selection.marker),w.Db(5),w.Sc(e.selection.max_marker),w.Db(5),w.Sc(e.selection.ver),w.Db(5),w.Sc(e.selection.master_ver),w.Db(5),w.Sc(w.pc(53,16,e.selection.mtime)),w.Db(6),w.Sc(e.selection.zonegroup),w.Db(5),w.Sc(e.selection.versioning),w.Db(5),w.Sc(e.selection.mfa_delete),w.Db(1),w.uc("ngIf",e.selection.bucket_quota),w.Db(9),w.Sc(w.pc(79,18,e.selection.lock_enabled)),w.Db(2),w.uc("ngIf",e.selection.lock_enabled)}}let Oe=(()=>{class e{constructor(e){this.rgwBucketService=e}ngOnChanges(){this.selection&&this.rgwBucketService.get(this.selection.bid).subscribe(e=>{e.lock_retention_period_days=this.rgwBucketService.getLockDays(e),this.selection=e})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(m.a))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-bucket-details"]],inputs:{selection:"selection"},features:[w.Bb],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k;return e="Name",t="ID",c="Owner",a="Index type",i="Placement rule",s="Marker",b="Maximum marker",o="Version",n="Master version",r="Modification time",l="Zonegroup",u="Versioning",d="MFA Delete",f="Locking",m="Enabled",p="Bucket quota",g="Enabled",h="Maximum size",_="Maximum objects",v="Unlimited",y="Unlimited",W="Mode",k="Days",[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],e,[1,"w-75"],[1,"bold"],t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k]},template:function(e,t){1&e&&w.Pc(0,Ve,81,20,"ng-container",0),2&e&&w.uc("ngIf",t.selection)},directives:[a.r],pipes:[Ee.a,Fe.a,ze.a],styles:["table[_ngcontent-%COMP%]{table-layout:fixed}table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{word-wrap:break-word}"]}),e})();var Be=c("GgAd");const Le=["bucketSizeTpl"],je=["bucketObjectTpl"];function Ue(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",8),2&e){const e=w.nc().row;w.uc("total",e.bucket_quota.max_size)("used",e.bucket_size)}}function Me(e,t){1&e&&w.bc(0,9)}function Ge(e,t){if(1&e&&(w.Pc(0,Ue,1,2,"cd-usage-bar",6),w.Pc(1,Me,1,0,"ng-template",null,7,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.bucket_quota.max_size>0&&e.bucket_quota.enabled)("ngIfElse",c)}}function Ke(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",12),2&e){const e=w.nc().row;w.uc("total",e.bucket_quota.max_objects)("used",e.num_objects)("isBinary",!1)}}function Qe(e,t){1&e&&w.bc(0,13)}function Ye(e,t){if(1&e&&(w.Pc(0,Ke,1,3,"cd-usage-bar",10),w.Pc(1,Qe,1,0,"ng-template",null,11,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.bucket_quota.max_objects>0&&e.bucket_quota.enabled)("ngIfElse",c)}}let Ze=(()=>{class e extends ke.a{constructor(e,t,c,a,i,s,b,o){super(o),this.authStorageService=e,this.dimlessBinaryPipe=t,this.dimlessPipe=c,this.rgwBucketService=a,this.modalService=i,this.urlBuilder=s,this.actionLabels=b,this.ngZone=o,this.columns=[],this.buckets=[],this.selection=new De.a}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Name",prop:"bid",flexGrow:2},{name:"Owner",prop:"owner",flexGrow:2.5},{name:"Used Capacity",prop:"bucket_size",flexGrow:.6,pipe:this.dimlessBinaryPipe},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.bucketSizeTpl,flexGrow:.8},{name:"Objects",prop:"num_objects",flexGrow:.6,pipe:this.dimlessPipe},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.bucketObjectTpl,flexGrow:.8}];const e=()=>this.selection.first()&&`${encodeURIComponent(this.selection.first().bid)}`;this.tableActions=[{permission:"create",icon:S.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection},{permission:"update",icon:S.a.edit,routerLink:()=>this.urlBuilder.getEdit(e()),name:this.actionLabels.EDIT},{permission:"delete",icon:S.a.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:e=>e.hasMultiSelection}],this.setTableRefreshTimeout()}transformBucketData(){d.a.forEach(this.buckets,e=>{const t=e.bucket_quota.max_size,c=e.bucket_quota.max_objects;e.bucket_size=0,e.num_objects=0,d.a.isEmpty(e.usage)||(e.bucket_size=e.usage["rgw.main"].size_actual,e.num_objects=e.usage["rgw.main"].num_objects),e.size_usage=t>0?e.bucket_size/t:void 0,e.object_usage=c>0?e.num_objects/c:void 0})}getBucketList(e){this.setTableRefreshTimeout(),this.rgwBucketService.list(!0).subscribe(e=>{this.buckets=e,this.transformBucketData()},()=>{e.error()})}updateSelection(e){this.selection=e}deleteAction(){this.modalService.show(Xe.a,{itemDescription:this.selection.hasSingleSelection?"bucket":"buckets",itemNames:this.selection.selected.map(e=>e.bid),submitActionObservable:()=>new We.a(e=>{Object(f.a)(this.selection.selected.map(e=>this.rgwBucketService.delete(e.bid))).subscribe({error:t=>{e.error(t),this.table.refreshBtn()},complete:()=>{e.complete(),this.table.refreshBtn()}})})})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(Ie.a),w.Rb(Se.a),w.Rb(ze.a),w.Rb(m.a),w.Rb($e.a),w.Rb(xe.a),w.Rb(n.b),w.Rb(w.D))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-bucket-list"]],viewQuery:function(e,t){if(1&e&&(w.Wc(we.a,3),w.Wc(Le,3),w.Wc(je,3)),2&e){let e;w.Ec(e=w.mc())&&(t.table=e.first),w.Ec(e=w.mc())&&(t.bucketSizeTpl=e.first),w.Ec(e=w.mc())&&(t.bucketObjectTpl=e.first)}},features:[w.Cb([{provide:xe.a,useValue:new xe.a("rgw/bucket")}]),w.Ab],decls:8,vars:9,consts:function(){let e,t;return e="No Limit",t="No Limit",[["columnMode","flex","selectionType","multiClick","identifier","bid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["bucketSizeTpl",""],["bucketObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],e,[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],t]},template:function(e,t){1&e&&(w.Xb(0,"cd-table",0,1),w.lc("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)})("fetchData",function(e){return t.getBucketList(e)}),w.Sb(2,"cd-table-actions",2),w.Sb(3,"cd-rgw-bucket-details",3),w.Wb(),w.Pc(4,Ge,3,2,"ng-template",null,4,w.Qc),w.Pc(6,Ye,3,2,"ng-template",null,5,w.Qc)),2&e&&(w.uc("autoReload",!1)("data",t.buckets)("columns",t.columns)("hasDetails",!0)("status",t.tableStatus),w.Db(2),w.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),w.Db(1),w.uc("selection",t.expandedRow))},directives:[we.a,qe.a,Oe,a.r,Be.a],styles:[""]}),e})();var Je=c("85J/"),He=c("JP8w"),et=c("FSuO"),tt=c("b5OY"),ct=c("insk");function at(e,t){if(1&e){const e=w.Yb();w.Xb(0,"cd-table-key-value",11),w.lc("fetchData",function(){return w.Ic(e),w.nc(2).getMetaData()}),w.Wb()}if(2&e){const e=w.nc(2);w.uc("data",e.metadata)}}function it(e,t){if(1&e&&w.Sb(0,"cd-table-performance-counter",12),2&e){const e=w.nc(2);w.uc("serviceId",e.serviceMapId)}}function st(e,t){if(1&e&&w.Sb(0,"cd-grafana",15),2&e){const e=w.nc(3);w.uc("grafanaPath","rgw-instance-detail?var-rgw_servers=rgw."+e.serviceId)}}function bt(e,t){1&e&&(w.Xb(0,"li",13),w.Xb(1,"a",4),w.bc(2,14),w.Wb(),w.Pc(3,st,1,1,"ng-template",6),w.Wb())}function ot(e,t){if(1&e&&(w.Vb(0),w.Xb(1,"ul",1,2),w.Xb(3,"li",3),w.Xb(4,"a",4),w.bc(5,5),w.Wb(),w.Pc(6,at,1,1,"ng-template",6),w.Wb(),w.Xb(7,"li",7),w.Xb(8,"a",4),w.bc(9,8),w.Wb(),w.Pc(10,it,1,1,"ng-template",6),w.Wb(),w.Pc(11,bt,4,0,"li",9),w.Wb(),w.Sb(12,"div",10),w.Ub()),2&e){const e=w.Fc(2),t=w.nc();w.Db(11),w.uc("ngIf",t.grafanaPermission.read),w.Db(1),w.uc("ngbNavOutlet",e)}}let nt=(()=>{class e{constructor(e,t){this.rgwDaemonService=e,this.authStorageService=t,this.serviceId="",this.serviceMapId="",this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){this.selection&&(this.serviceId=this.selection.id,this.serviceMapId=this.selection.service_map_id)}getMetaData(){d.a.isEmpty(this.serviceId)||this.rgwDaemonService.get(this.serviceId).subscribe(e=>{this.metadata=e.rgw_metadata})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(k.a),w.Rb(Ie.a))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-daemon-details"]],inputs:{selection:"selection"},features:[w.Bb],decls:1,vars:1,consts:function(){let e,t,c;return e="Details",t="Performance Counters",c="Performance Details",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-daemon-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","performance-counters"],t,["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"data","fetchData"],["serviceType","rgw",3,"serviceId"],["ngbNavItem","performance-details"],c,["uid","x5ARzZtmk","grafanaStyle","one",3,"grafanaPath"]]},template:function(e,t){1&e&&w.Pc(0,ot,13,2,"ng-container",0),2&e&&w.uc("ngIf",t.selection)},directives:[a.r,b.p,He.a,b.r,b.s,b.q,b.u,et.a,tt.a,ct.a],styles:[""]}),e})();function rt(e,t){if(1&e){const e=w.Yb();w.Xb(0,"cd-table",8),w.lc("setExpandedRow",function(t){return w.Ic(e),w.nc().setExpandedRow(t)})("fetchData",function(t){return w.Ic(e),w.nc().getDaemonList(t)}),w.Sb(1,"cd-rgw-daemon-details",9),w.Wb()}if(2&e){const e=w.nc();w.uc("data",e.daemons)("columns",e.columns)("hasDetails",!0),w.Db(1),w.uc("selection",e.expandedRow)}}function lt(e,t){1&e&&w.Sb(0,"cd-grafana",11),2&e&&w.uc("grafanaPath","rgw-overview?")}function ut(e,t){1&e&&(w.Xb(0,"li",2),w.Xb(1,"a",3),w.bc(2,10),w.Wb(),w.Pc(3,lt,1,1,"ng-template",5),w.Wb())}function dt(e,t){1&e&&w.Sb(0,"cd-grafana",13),2&e&&w.uc("grafanaPath","radosgw-sync-overview?")}function ft(e,t){1&e&&(w.Xb(0,"li",2),w.Xb(1,"a",3),w.bc(2,12),w.Wb(),w.Pc(3,dt,1,1,"ng-template",5),w.Wb())}let mt=(()=>{class e extends ke.a{constructor(e,t,c,a){super(),this.rgwDaemonService=e,this.authStorageService=t,this.cephShortVersionPipe=c,this.rgwSiteService=a,this.columns=[],this.daemons=[],this.updateDaemons=e=>{this.daemons=e}}ngOnInit(){this.grafanaPermission=this.authStorageService.getPermissions().grafana,this.columns=[{name:"ID",prop:"id",flexGrow:2},{name:"Hostname",prop:"server_hostname",flexGrow:2},{name:"Zone",prop:"zone_name",flexGrow:2},{name:"Zone Group",prop:"zonegroup_name",flexGrow:2},{name:"Realm",prop:"realm_name",flexGrow:2},{name:"Version",prop:"version",flexGrow:1,pipe:this.cephShortVersionPipe}],this.rgwSiteService.get("realms").subscribe(e=>this.isMultiSite=e.length>0)}getDaemonList(e){this.rgwDaemonService.list().subscribe(this.updateDaemons,()=>{e.error()})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(k.a),w.Rb(Ie.a),w.Rb(Je.a),w.Rb(p.a))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-daemon-list"]],features:[w.Ab],decls:9,vars:3,consts:function(){let e,t,c;return e="Daemons List",t="Overall Performance",c="Sync Performance",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["columnMode","flex",3,"data","columns","hasDetails","setExpandedRow","fetchData"],["cdTableDetail","",3,"selection"],t,["uid","WAkugZpiz","grafanaStyle","two",3,"grafanaPath"],c,["uid","rgw-sync-overview","grafanaStyle","two",3,"grafanaPath"]]},template:function(e,t){if(1&e&&(w.Xb(0,"ul",0,1),w.Xb(2,"li",2),w.Xb(3,"a",3),w.bc(4,4),w.Wb(),w.Pc(5,rt,2,4,"ng-template",5),w.Wb(),w.Pc(6,ut,4,0,"li",6),w.Pc(7,ft,4,0,"li",6),w.Wb(),w.Sb(8,"div",7)),2&e){const e=w.Fc(1);w.Db(6),w.uc("ngIf",t.grafanaPermission.read),w.Db(1),w.uc("ngIf",t.grafanaPermission.read&&t.isMultiSite),w.Db(1),w.uc("ngbNavOutlet",e)}},directives:[b.p,b.r,b.s,b.q,a.r,b.u,we.a,nt,ct.a],styles:[""]}),e})();var pt=c("GyhO"),gt=c("aXbf"),ht=function(e){return e.USERS="users",e.BUCKETS="buckets",e.METADATA="metadata",e.USAGE="usage",e.ZONE="zone",e}({});let _t=(()=>{class e{static getAll(){return Object.values(e.capabilities)}}return e.capabilities=ht,e})();var vt=c("ajRT");function yt(e,t){1&e&&w.Sb(0,"input",22),2&e&&w.uc("readonly",!0)}function Wt(e,t){1&e&&(w.Xb(0,"option",17),w.bc(1,25),w.Wb()),2&e&&w.uc("ngValue",null)}function kt(e,t){if(1&e&&(w.Xb(0,"option",26),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e),w.Db(1),w.Sc(e)}}function Xt(e,t){if(1&e&&(w.Xb(0,"select",23),w.Pc(1,Wt,2,1,"option",24),w.Pc(2,kt,2,2,"option",19),w.Wb()),2&e){const e=w.nc();w.Db(1),w.uc("ngIf",null!==e.types),w.Db(1),w.uc("ngForOf",e.types)}}function wt(e,t){1&e&&(w.Xb(0,"span",27),w.bc(1,28),w.Wb())}function Dt(e,t){if(1&e&&(w.Xb(0,"option",26),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e),w.Db(1),w.Tc(" ",e," ")}}function St(e,t){1&e&&(w.Xb(0,"span",27),w.bc(1,29),w.Wb())}const zt=function(e){return{required:e}},It=function(){return["read","write","*"]};let $t=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.activeModal=t,this.actionLabels=c,this.submitAction=new w.p,this.editing=!0,this.types=[],this.resource="capability",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({type:[null,[i.A.required]],perm:[null,[i.A.required]]})}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.ADD}setValues(e,t){this.formGroup.setValue({type:e,perm:t})}setCapabilities(e){const t=[];e.forEach(e=>{t.push(e.type)}),this.types=[],_t.getAll().forEach(e=>{-1===d.a.indexOf(t,e)&&this.types.push(e)})}onSubmit(){this.submitAction.emit(this.formGroup.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Rb($.a),w.Rb(b.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-capability-modal"]],outputs:{submitAction:"submitAction"},decls:29,vars:24,consts:function(){let e,t,c,a,i,s,b;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Type",c="Permission",a="-- Select a permission --",i="-- Select a type --",s="This field is required.",b="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","type",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["id","type","class","form-control","type","text","formControlName","type",3,"readonly",4,"ngIf"],["id","type","class","form-control custom-select","formControlName","type","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],c,["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],a,[3,"value",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["id","type","type","text","formControlName","type",1,"form-control",3,"readonly"],["id","type","formControlName","type","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],i,[3,"value"],[1,"invalid-feedback"],s,b]},template:function(e,t){if(1&e&&(w.Xb(0,"cd-modal",0),w.Vb(1,1),w.bc(2,2),w.oc(3,"titlecase"),w.oc(4,"upperFirst"),w.Ub(),w.Vb(5,3),w.Xb(6,"form",4,5),w.Xb(8,"div",6),w.Xb(9,"div",7),w.Xb(10,"label",8),w.bc(11,9),w.Wb(),w.Xb(12,"div",10),w.Pc(13,yt,1,1,"input",11),w.Pc(14,Xt,3,2,"select",12),w.Pc(15,wt,2,0,"span",13),w.Wb(),w.Wb(),w.Xb(16,"div",7),w.Xb(17,"label",14),w.bc(18,15),w.Wb(),w.Xb(19,"div",10),w.Xb(20,"select",16),w.Xb(21,"option",17),w.bc(22,18),w.Wb(),w.Pc(23,Dt,2,2,"option",19),w.Wb(),w.Pc(24,St,2,0,"span",13),w.Wb(),w.Wb(),w.Wb(),w.Xb(25,"div",20),w.Xb(26,"cd-form-button-panel",21),w.lc("submitActionEvent",function(){return t.onSubmit()}),w.oc(27,"titlecase"),w.oc(28,"upperFirst"),w.Wb(),w.Wb(),w.Wb(),w.Ub(),w.Wb()),2&e){const e=w.Fc(7);w.uc("modalRef",t.activeModal),w.Db(4),w.fc(w.pc(3,13,t.action))(w.pc(4,15,t.resource)),w.cc(2),w.Db(2),w.uc("formGroup",t.formGroup),w.Db(4),w.uc("ngClass",w.zc(21,zt,!t.editing)),w.Db(3),w.uc("ngIf",t.editing),w.Db(1),w.uc("ngIf",!t.editing),w.Db(1),w.uc("ngIf",t.formGroup.showError("type",e,"required")),w.Db(6),w.uc("ngValue",null),w.Db(2),w.uc("ngForOf",w.yc(23,It)),w.Db(1),w.uc("ngIf",t.formGroup.showError("perm",e,"required")),w.Db(2),w.uc("form",t.formGroup)("submitText",w.pc(27,17,t.action)+" "+w.pc(28,19,t.resource))}},directives:[vt.a,i.B,i.r,T.a,i.k,C.a,a.p,a.r,R.a,i.z,A.a,i.q,i.i,i.u,i.C,a.q,O.a,i.d,N.a],pipes:[a.A,B.a],styles:[""]}),e})();var xt=c("D4zM"),qt=c("cEzo");function Et(e,t){1&e&&w.Sb(0,"input",17),2&e&&w.uc("readonly",!0)}function Ft(e,t){1&e&&(w.Xb(0,"option",21),w.bc(1,22),w.Wb()),2&e&&w.uc("ngValue",null)}function Pt(e,t){if(1&e&&(w.Xb(0,"option",23),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e),w.Db(1),w.Sc(e)}}function Tt(e,t){if(1&e&&(w.Xb(0,"select",18),w.Pc(1,Ft,2,1,"option",19),w.Pc(2,Pt,2,2,"option",20),w.Wb()),2&e){const e=w.nc();w.Db(1),w.uc("ngIf",null!==e.userCandidates),w.Db(1),w.uc("ngForOf",e.userCandidates)}}function Ct(e,t){1&e&&(w.Xb(0,"span",24),w.bc(1,25),w.Wb())}function Rt(e,t){1&e&&(w.Xb(0,"div",7),w.Xb(1,"div",26),w.Xb(2,"div",27),w.Sb(3,"input",28),w.Xb(4,"label",29),w.bc(5,30),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function At(e,t){1&e&&(w.Xb(0,"span",24),w.bc(1,38),w.Wb())}const Nt=function(e){return{required:e}};function Vt(e,t){if(1&e&&(w.Xb(0,"div",7),w.Xb(1,"label",31),w.bc(2,32),w.Wb(),w.Xb(3,"div",10),w.Xb(4,"div",33),w.Sb(5,"input",34),w.Xb(6,"span",35),w.Sb(7,"button",36),w.Sb(8,"cd-copy-2-clipboard-button",37),w.Wb(),w.Wb(),w.Pc(9,At,2,0,"span",13),w.Wb(),w.Wb()),2&e){const e=w.nc(),t=w.Fc(7);w.Db(1),w.uc("ngClass",w.zc(3,Nt,!e.viewing)),w.Db(4),w.uc("readonly",e.viewing),w.Db(4),w.uc("ngIf",e.formGroup.showError("access_key",t,"required"))}}function Ot(e,t){1&e&&(w.Xb(0,"span",24),w.bc(1,44),w.Wb())}function Bt(e,t){if(1&e&&(w.Xb(0,"div",7),w.Xb(1,"label",39),w.bc(2,40),w.Wb(),w.Xb(3,"div",10),w.Xb(4,"div",33),w.Sb(5,"input",41),w.Xb(6,"span",35),w.Sb(7,"button",42),w.Sb(8,"cd-copy-2-clipboard-button",43),w.Wb(),w.Wb(),w.Pc(9,Ot,2,0,"span",13),w.Wb(),w.Wb()),2&e){const e=w.nc(),t=w.Fc(7);w.Db(1),w.uc("ngClass",w.zc(3,Nt,!e.viewing)),w.Db(4),w.uc("readonly",e.viewing),w.Db(4),w.uc("ngIf",e.formGroup.showError("secret_key",t,"required"))}}let Lt=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.activeModal=t,this.actionLabels=c,this.submitAction=new w.p,this.viewing=!0,this.userCandidates=[],this.resource="S3 Key",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({user:[null,[i.A.required]],generate_key:[!0],access_key:[null,[x.a.requiredIf({generate_key:!1})]],secret_key:[null,[x.a.requiredIf({generate_key:!1})]]})}setViewing(e=!0){this.viewing=e,this.action=this.viewing?this.actionLabels.SHOW:this.actionLabels.CREATE}setValues(e,t,c){this.formGroup.setValue({user:e,generate_key:d.a.isEmpty(t),access_key:t,secret_key:c})}setUserCandidates(e){this.userCandidates=e}onSubmit(){this.submitAction.emit(this.formGroup.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Rb($.a),w.Rb(b.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-s3-key-modal"]],outputs:{submitAction:"submitAction"},decls:23,vars:24,consts:function(){let e,t,c,a,i,s,b,o,n;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Username",c="-- Select a username --",a="This field is required.",i="Auto-generate key",s="Access key",b="This field is required.",o="Secret key",n="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["id","user","class","form-control","type","text","formControlName","user",3,"readonly",4,"ngIf"],["id","user","class","form-control custom-select","formControlName","user","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],["id","user","type","text","formControlName","user",1,"form-control",3,"readonly"],["id","user","formControlName","user","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],c,[3,"value"],[1,"invalid-feedback"],a,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],i,["for","access_key",1,"cd-col-form-label",3,"ngClass"],s,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control",3,"readonly"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],b,["for","secret_key",1,"cd-col-form-label",3,"ngClass"],o,["id","secret_key","type","password","formControlName","secret_key",1,"form-control",3,"readonly"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],n]},template:function(e,t){if(1&e&&(w.Xb(0,"cd-modal",0),w.Vb(1,1),w.bc(2,2),w.oc(3,"titlecase"),w.oc(4,"upperFirst"),w.Ub(),w.Vb(5,3),w.Xb(6,"form",4,5),w.Xb(8,"div",6),w.Xb(9,"div",7),w.Xb(10,"label",8),w.bc(11,9),w.Wb(),w.Xb(12,"div",10),w.Pc(13,Et,1,1,"input",11),w.Pc(14,Tt,3,2,"select",12),w.Pc(15,Ct,2,0,"span",13),w.Wb(),w.Wb(),w.Pc(16,Rt,6,0,"div",14),w.Pc(17,Vt,10,5,"div",14),w.Pc(18,Bt,10,5,"div",14),w.Wb(),w.Xb(19,"div",15),w.Xb(20,"cd-form-button-panel",16),w.lc("submitActionEvent",function(){return t.onSubmit()}),w.oc(21,"titlecase"),w.oc(22,"upperFirst"),w.Wb(),w.Wb(),w.Wb(),w.Ub(),w.Wb()),2&e){const e=w.Fc(7);w.uc("modalRef",t.activeModal),w.Db(4),w.fc(w.pc(3,14,t.action))(w.pc(4,16,t.resource)),w.cc(2),w.Db(2),w.uc("formGroup",t.formGroup),w.Db(4),w.uc("ngClass",w.zc(22,Nt,!t.viewing)),w.Db(3),w.uc("ngIf",t.viewing),w.Db(1),w.uc("ngIf",!t.viewing),w.Db(1),w.uc("ngIf",t.formGroup.showError("user",e,"required")),w.Db(1),w.uc("ngIf",!t.viewing),w.Db(1),w.uc("ngIf",!t.formGroup.getValue("generate_key")),w.Db(1),w.uc("ngIf",!t.formGroup.getValue("generate_key")),w.Db(2),w.uc("form",t.formGroup)("submitText",w.pc(21,18,t.action)+" "+w.pc(22,20,t.resource))("showSubmit",!t.viewing)}},directives:[vt.a,i.B,i.r,T.a,i.k,C.a,a.p,a.r,O.a,R.a,i.d,A.a,i.q,i.i,i.z,N.a,a.q,i.u,i.C,i.b,xt.a,qt.a],pipes:[a.A,B.a],styles:[""]}),e})();class jt{}function Ut(e,t){1&e&&(w.Xb(0,"span",29),w.bc(1,30),w.Wb())}function Mt(e,t){1&e&&(w.Xb(0,"span",29),w.bc(1,31),w.Wb())}function Gt(e,t){if(1&e&&(w.Xb(0,"option",32),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.uc("value",e),w.Db(1),w.Tc(" ",e," ")}}function Kt(e,t){1&e&&(w.Xb(0,"span",29),w.bc(1,33),w.Wb())}function Qt(e,t){1&e&&(w.Xb(0,"span",29),w.bc(1,48),w.Wb())}function Yt(e,t){if(1&e&&(w.Xb(0,"div",7),w.Xb(1,"label",41),w.bc(2,42),w.Wb(),w.Xb(3,"div",10),w.Xb(4,"div",43),w.Sb(5,"input",44),w.Xb(6,"span",45),w.Sb(7,"button",46),w.Sb(8,"cd-copy-2-clipboard-button",47),w.Wb(),w.Wb(),w.Pc(9,Qt,2,0,"span",15),w.Wb(),w.Wb()),2&e){const e=w.nc(2),t=w.Fc(7);w.Db(9),w.uc("ngIf",e.formGroup.showError("secret_key",t,"required"))}}function Zt(e,t){if(1&e&&(w.Xb(0,"fieldset"),w.Xb(1,"legend"),w.bc(2,34),w.Wb(),w.Xb(3,"div",7),w.Xb(4,"div",35),w.Xb(5,"div",36),w.Sb(6,"input",37),w.Xb(7,"label",38),w.bc(8,39),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(9,Yt,10,1,"div",40),w.Wb()),2&e){const e=w.nc();w.Db(9),w.uc("ngIf",!e.editing&&!e.formGroup.getValue("generate_secret"))}}const Jt=function(e){return{required:e}},Ht=function(){return["read","write"]};let ec=(()=>{class e{constructor(e,t,c){this.formBuilder=e,this.bsModalRef=t,this.actionLabels=c,this.submitAction=new w.p,this.editing=!0,this.subusers=[],this.resource="Subuser",this.createForm()}createForm(){this.formGroup=this.formBuilder.group({uid:[null],subuid:[null,[i.A.required,this.subuserValidator()]],perm:[null,[i.A.required]],generate_secret:[!0],secret_key:[null,[x.a.requiredIf({generate_secret:!1})]]})}subuserValidator(){const e=this;return t=>e.editing||Object(x.b)(t.value)?null:e.subusers.some(c=>d.a.isEqual(e.getSubuserName(c.id),t.value))?{subuserIdExists:!0}:null}getSubuserName(e){if(d.a.isEmpty(e))return e;const t=e.match(/([^:]+)(:(.+))?/);return d.a.isUndefined(t[3])?t[1]:t[3]}setEditing(e=!0){this.editing=e,this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE}setValues(e,t="",c=""){this.formGroup.setValue({uid:e,subuid:this.getSubuserName(t),perm:c,generate_secret:!0,secret_key:null})}setSubusers(e){this.subusers=e}onSubmit(){const e=this.formGroup.value,t=new jt;t.id=`${e.uid}:${e.subuid}`,t.permissions=e.perm,t.generate_secret=e.generate_secret,t.secret_key=e.secret_key,this.submitAction.emit(t),this.bsModalRef.close()}}return e.\u0275fac=function(t){return new(t||e)(w.Rb($.a),w.Rb(b.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-subuser-modal"]],outputs:{submitAction:"submitAction"},decls:39,vars:26,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Username",c="Subuser",a="Permission",i="-- Select a permission --",s="read, write",b="full",o="This field is required.",n="The chosen subuser ID is already in use.",r="This field is required.",l="Swift key",u="Auto-generate secret",d="Secret key",f="This field is required.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","uid",1,"cd-col-form-label"],t,[1,"cd-col-form-input"],["id","uid","type","text","formControlName","uid",1,"form-control",3,"readonly"],["for","subuid",1,"cd-col-form-label",3,"ngClass"],c,["id","subuid","type","text","formControlName","subuid","autofocus","",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],a,["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],i,[3,"value",4,"ngFor","ngForOf"],["value","read-write"],s,["value","full-control"],b,[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],o,n,[3,"value"],r,l,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_secret","type","checkbox","formControlName","generate_secret",1,"custom-control-input"],["for","generate_secret",1,"custom-control-label"],u,["class","form-group row",4,"ngIf"],["for","secret_key",1,"cd-col-form-label","required"],d,[1,"input-group"],["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],f]},template:function(e,t){if(1&e&&(w.Xb(0,"cd-modal",0),w.Vb(1,1),w.bc(2,2),w.oc(3,"titlecase"),w.oc(4,"upperFirst"),w.Ub(),w.Vb(5,3),w.Xb(6,"form",4,5),w.Xb(8,"div",6),w.Xb(9,"div",7),w.Xb(10,"label",8),w.bc(11,9),w.Wb(),w.Xb(12,"div",10),w.Sb(13,"input",11),w.Wb(),w.Wb(),w.Xb(14,"div",7),w.Xb(15,"label",12),w.bc(16,13),w.Wb(),w.Xb(17,"div",10),w.Sb(18,"input",14),w.Pc(19,Ut,2,0,"span",15),w.Pc(20,Mt,2,0,"span",15),w.Wb(),w.Wb(),w.Xb(21,"div",7),w.Xb(22,"label",16),w.bc(23,17),w.Wb(),w.Xb(24,"div",10),w.Xb(25,"select",18),w.Xb(26,"option",19),w.bc(27,20),w.Wb(),w.Pc(28,Gt,2,2,"option",21),w.Xb(29,"option",22),w.bc(30,23),w.Wb(),w.Xb(31,"option",24),w.bc(32,25),w.Wb(),w.Wb(),w.Pc(33,Kt,2,0,"span",15),w.Wb(),w.Wb(),w.Pc(34,Zt,10,1,"fieldset",26),w.Wb(),w.Xb(35,"div",27),w.Xb(36,"cd-form-button-panel",28),w.lc("submitActionEvent",function(){return t.onSubmit()}),w.oc(37,"titlecase"),w.oc(38,"upperFirst"),w.Wb(),w.Wb(),w.Wb(),w.Ub(),w.Wb()),2&e){const e=w.Fc(7);w.uc("modalRef",t.bsModalRef),w.Db(4),w.fc(w.pc(3,15,t.action))(w.pc(4,17,t.resource)),w.cc(2),w.Db(2),w.uc("formGroup",t.formGroup),w.Db(7),w.uc("readonly",!0),w.Db(2),w.uc("ngClass",w.zc(23,Jt,!t.editing)),w.Db(3),w.uc("readonly",t.editing),w.Db(1),w.uc("ngIf",t.formGroup.showError("subuid",e,"required")),w.Db(1),w.uc("ngIf",t.formGroup.showError("subuid",e,"subuserIdExists")),w.Db(6),w.uc("ngValue",null),w.Db(2),w.uc("ngForOf",w.yc(25,Ht)),w.Db(5),w.uc("ngIf",t.formGroup.showError("perm",e,"required")),w.Db(1),w.uc("ngIf",!t.editing),w.Db(2),w.uc("form",t.formGroup)("submitText",w.pc(37,19,t.action)+" "+w.pc(38,21,t.resource))}},directives:[vt.a,i.B,i.r,T.a,i.k,C.a,R.a,i.d,A.a,i.q,i.i,a.p,N.a,a.r,i.z,i.u,i.C,a.q,O.a,i.b,xt.a,qt.a],pipes:[a.A,B.a],styles:[""]}),e})();var tc=c("Z21x");let cc=(()=>{class e{constructor(e,t){this.activeModal=e,this.actionLabels=t,this.resource="Swift Key",this.action=this.actionLabels.SHOW}setValues(e,t){this.user=e,this.secret_key=t}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(b.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-swift-key-modal"]],decls:24,vars:11,consts:function(){let e,t,c;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Username",c="Secret key",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],[1,"modal-body"],["novalidate",""],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],t,[1,"cd-col-form-input"],["id","user","name","user","type","text",1,"form-control",3,"readonly","ngModel","ngModelChange"],["for","secret_key",1,"cd-col-form-label"],c,[1,"input-group"],["id","secret_key","name","secret_key","type","password",1,"form-control",3,"ngModel","readonly","ngModelChange"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],[1,"modal-footer"],[3,"backAction"]]},template:function(e,t){1&e&&(w.Xb(0,"cd-modal",0),w.Vb(1,1),w.bc(2,2),w.oc(3,"titlecase"),w.oc(4,"upperFirst"),w.Ub(),w.Vb(5,3),w.Xb(6,"div",4),w.Xb(7,"form",5),w.Xb(8,"div",6),w.Xb(9,"label",7),w.bc(10,8),w.Wb(),w.Xb(11,"div",9),w.Xb(12,"input",10),w.lc("ngModelChange",function(e){return t.user=e}),w.Wb(),w.Wb(),w.Wb(),w.Xb(13,"div",6),w.Xb(14,"label",11),w.bc(15,12),w.Wb(),w.Xb(16,"div",9),w.Xb(17,"div",13),w.Xb(18,"input",14),w.lc("ngModelChange",function(e){return t.secret_key=e}),w.Wb(),w.Xb(19,"span",15),w.Sb(20,"button",16),w.Sb(21,"cd-copy-2-clipboard-button",17),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Xb(22,"div",18),w.Xb(23,"cd-back-button",19),w.lc("backAction",function(){return t.activeModal.close()}),w.Wb(),w.Wb(),w.Ub(),w.Wb()),2&e&&(w.uc("modalRef",t.activeModal),w.Db(4),w.fc(w.pc(3,7,t.action))(w.pc(4,9,t.resource)),w.cc(2),w.Db(8),w.uc("readonly",!0)("ngModel",t.user),w.Db(6),w.uc("ngModel",t.secret_key)("readonly",!0))},directives:[vt.a,i.B,i.r,i.s,C.a,R.a,i.d,A.a,i.q,i.t,xt.a,qt.a,tc.a],pipes:[a.A,B.a],styles:[""]}),e})();var ac=c("EmSq");function ic(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,50),w.Wb())}function sc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,51),w.Wb())}function bc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,52),w.Wb())}function oc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,56),w.Wb())}function nc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,57),w.Wb())}function rc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",53),w.bc(2,54),w.Wb(),w.Xb(3,"div",11),w.Sb(4,"input",55),w.Pc(5,oc,2,0,"span",13),w.Pc(6,nc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(4),w.uc("readonly",t.editing),w.Db(1),w.uc("ngIf",t.userForm.showError("tenant",e,"pattern")),w.Db(1),w.uc("ngIf",t.userForm.showError("tenant",e,"notUnique"))}}function lc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,58),w.Wb())}function uc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,59),w.Wb())}function dc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,60),w.Wb())}function fc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,63),w.Wb())}function mc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,64),w.Wb())}function pc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Sb(1,"label",61),w.Xb(2,"div",11),w.Sb(3,"input",62),w.Pc(4,fc,2,0,"span",13),w.Pc(5,mc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(4),w.uc("ngIf",t.userForm.showError("max_buckets",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("max_buckets",e,"min"))}}function gc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,76),w.Wb())}function hc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",69),w.bc(2,70),w.Wb(),w.Xb(3,"div",11),w.Xb(4,"div",71),w.Sb(5,"input",72),w.Xb(6,"span",73),w.Sb(7,"button",74),w.Sb(8,"cd-copy-2-clipboard-button",75),w.Wb(),w.Wb(),w.Pc(9,gc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc(2);const e=w.Fc(2),t=w.nc();w.Db(9),w.uc("ngIf",t.userForm.showError("access_key",e,"required"))}}function _c(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,82),w.Wb())}function vc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",77),w.bc(2,78),w.Wb(),w.Xb(3,"div",11),w.Xb(4,"div",71),w.Sb(5,"input",79),w.Xb(6,"span",73),w.Sb(7,"button",80),w.Sb(8,"cd-copy-2-clipboard-button",81),w.Wb(),w.Wb(),w.Pc(9,_c,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc(2);const e=w.Fc(2),t=w.nc();w.Db(9),w.uc("ngIf",t.userForm.showError("secret_key",e,"required"))}}function yc(e,t){if(1&e&&(w.Xb(0,"fieldset"),w.Xb(1,"legend"),w.bc(2,65),w.Wb(),w.Xb(3,"div",8),w.Xb(4,"div",14),w.Xb(5,"div",15),w.Sb(6,"input",66),w.Xb(7,"label",67),w.bc(8,68),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(9,hc,10,1,"div",19),w.Pc(10,vc,10,1,"div",19),w.Wb()),2&e){const e=w.nc(2);w.Db(9),w.uc("ngIf",!e.editing&&!e.userForm.getValue("generate_key")),w.Db(1),w.uc("ngIf",!e.editing&&!e.userForm.getValue("generate_key"))}}function Wc(e,t){1&e&&(w.Xb(0,"span",92),w.Xb(1,"span",93),w.bc(2,94),w.Wb(),w.Wb())}const kc=function(e){return[e]};function Xc(e,t){if(1&e){const e=w.Yb();w.Xb(0,"span"),w.Xb(1,"div",71),w.Xb(2,"div",95),w.Xb(3,"span",96),w.Sb(4,"i"),w.Wb(),w.Wb(),w.Sb(5,"input",97),w.Xb(6,"div",98),w.Xb(7,"span",96),w.Sb(8,"i"),w.Wb(),w.Wb(),w.Sb(9,"input",97),w.Xb(10,"span",73),w.Xb(11,"button",99),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).showSubuserModal(c)}),w.Sb(12,"i",89),w.Wb(),w.Xb(13,"button",100),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).deleteSubuser(c)}),w.Sb(14,"i",89),w.Wb(),w.Wb(),w.Wb(),w.Sb(15,"span",93),w.Wb()}if(2&e){const e=t.$implicit,c=w.nc(3);w.Db(4),w.Fb(c.icons.user),w.Db(1),w.vc("value",e.id),w.Db(3),w.Fb(c.icons.share),w.Db(1),w.vc("value","full-control"===e.permissions?"full":e.permissions),w.Db(3),w.uc("ngClass",w.zc(10,kc,c.icons.edit)),w.Db(2),w.uc("ngClass",w.zc(12,kc,c.icons.destroy))}}function wc(e,t){if(1&e){const e=w.Yb();w.Xb(0,"fieldset"),w.Xb(1,"legend"),w.bc(2,83),w.Wb(),w.Xb(3,"div",84),w.Xb(4,"div",14),w.Pc(5,Wc,3,0,"span",85),w.Pc(6,Xc,16,14,"span",86),w.Xb(7,"div",84),w.Xb(8,"div",87),w.Xb(9,"button",88),w.lc("click",function(){return w.Ic(e),w.nc(2).showSubuserModal()}),w.Sb(10,"i",89),w.Vb(11),w.bc(12,90),w.oc(13,"titlecase"),w.oc(14,"upperFirst"),w.Ub(),w.Wb(),w.Wb(),w.Wb(),w.Sb(15,"span",91),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.nc(2);w.Db(5),w.uc("ngIf",0===e.subusers.length),w.Db(1),w.uc("ngForOf",e.subusers),w.Db(4),w.uc("ngClass",w.zc(9,kc,e.icons.add)),w.Db(4),w.fc(w.pc(13,5,e.actionLabels.CREATE))(w.pc(14,7,e.subuserLabel)),w.cc(12)}}function Dc(e,t){1&e&&(w.Xb(0,"span",92),w.Xb(1,"span",93),w.bc(2,106),w.Wb(),w.Wb())}function Sc(e,t){if(1&e){const e=w.Yb();w.Xb(0,"span"),w.Xb(1,"div",71),w.Xb(2,"div",95),w.Xb(3,"div",96),w.Sb(4,"i"),w.Wb(),w.Wb(),w.Sb(5,"input",97),w.Xb(6,"span",73),w.Xb(7,"button",107),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).showS3KeyModal(c)}),w.Sb(8,"i",89),w.Wb(),w.Xb(9,"button",108),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).deleteS3Key(c)}),w.Sb(10,"i",89),w.Wb(),w.Wb(),w.Wb(),w.Sb(11,"span",93),w.Wb()}if(2&e){const e=t.$implicit,c=w.nc(3);w.Db(4),w.Fb(c.icons.key),w.Db(1),w.vc("value",e.user),w.Db(3),w.uc("ngClass",w.zc(6,kc,c.icons.show)),w.Db(2),w.uc("ngClass",w.zc(8,kc,c.icons.destroy))}}function zc(e,t){1&e&&(w.Xb(0,"span",92),w.Xb(1,"span",93),w.bc(2,109),w.Wb(),w.Wb())}function Ic(e,t){if(1&e){const e=w.Yb();w.Xb(0,"span"),w.Xb(1,"div",71),w.Xb(2,"div",95),w.Xb(3,"span",96),w.Sb(4,"i"),w.Wb(),w.Wb(),w.Sb(5,"input",97),w.Xb(6,"span",73),w.Xb(7,"button",110),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).showSwiftKeyModal(c)}),w.Sb(8,"i",89),w.Wb(),w.Wb(),w.Wb(),w.Sb(9,"span",93),w.Wb()}if(2&e){const e=t.$implicit,c=w.nc(3);w.Db(4),w.Fb(c.icons.key),w.Db(1),w.vc("value",e.user),w.Db(3),w.uc("ngClass",w.zc(5,kc,c.icons.show))}}function $c(e,t){if(1&e){const e=w.Yb();w.Xb(0,"fieldset"),w.Xb(1,"legend"),w.bc(2,101),w.Wb(),w.Xb(3,"div",8),w.Xb(4,"label",61),w.bc(5,102),w.Wb(),w.Xb(6,"div",11),w.Pc(7,Dc,3,0,"span",85),w.Pc(8,Sc,12,10,"span",86),w.Xb(9,"div",84),w.Xb(10,"div",87),w.Xb(11,"button",103),w.lc("click",function(){return w.Ic(e),w.nc(2).showS3KeyModal()}),w.Sb(12,"i",89),w.Vb(13),w.bc(14,104),w.oc(15,"titlecase"),w.oc(16,"upperFirst"),w.Ub(),w.Wb(),w.Wb(),w.Wb(),w.Sb(17,"span",91),w.Wb(),w.Sb(18,"hr"),w.Wb(),w.Xb(19,"div",8),w.Xb(20,"label",61),w.bc(21,105),w.Wb(),w.Xb(22,"div",11),w.Pc(23,zc,3,0,"span",85),w.Pc(24,Ic,10,7,"span",86),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.nc(2);w.Db(7),w.uc("ngIf",0===e.s3Keys.length),w.Db(1),w.uc("ngForOf",e.s3Keys),w.Db(4),w.uc("ngClass",w.zc(11,kc,e.icons.add)),w.Db(4),w.fc(w.pc(15,7,e.actionLabels.CREATE))(w.pc(16,9,e.s3keyLabel)),w.cc(14),w.Db(7),w.uc("ngIf",0===e.swiftKeys.length),w.Db(1),w.uc("ngForOf",e.swiftKeys)}}function xc(e,t){1&e&&(w.Xb(0,"span",92),w.Xb(1,"span",93),w.bc(2,114),w.Wb(),w.Wb())}function qc(e,t){if(1&e){const e=w.Yb();w.Xb(0,"span"),w.Xb(1,"div",71),w.Xb(2,"span",95),w.Xb(3,"div",96),w.Sb(4,"i"),w.Wb(),w.Wb(),w.Sb(5,"input",97),w.Xb(6,"span",73),w.Xb(7,"button",115),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).showCapabilityModal(c)}),w.Sb(8,"i",89),w.Wb(),w.Xb(9,"button",116),w.lc("click",function(){w.Ic(e);const c=t.index;return w.nc(3).deleteCapability(c)}),w.Sb(10,"i",89),w.Wb(),w.Wb(),w.Wb(),w.Sb(11,"span",93),w.Wb()}if(2&e){const e=t.$implicit,c=w.nc(3);w.Db(4),w.Fb(c.icons.share),w.Db(1),w.xc("value","",e.type,":",e.perm,""),w.Db(3),w.uc("ngClass",w.zc(7,kc,c.icons.edit)),w.Db(2),w.uc("ngClass",w.zc(9,kc,c.icons.destroy))}}function Ec(e,t){if(1&e){const e=w.Yb();w.Xb(0,"fieldset"),w.Xb(1,"legend"),w.bc(2,111),w.Wb(),w.Xb(3,"div",8),w.Xb(4,"div",14),w.Pc(5,xc,3,0,"span",85),w.Pc(6,qc,12,11,"span",86),w.Xb(7,"div",84),w.Xb(8,"div",87),w.Xb(9,"button",112),w.lc("click",function(){return w.Ic(e),w.nc(2).showCapabilityModal()}),w.oc(10,"pipeFunction"),w.oc(11,"pipeFunction"),w.Sb(12,"i",89),w.Vb(13),w.bc(14,113),w.oc(15,"titlecase"),w.oc(16,"upperFirst"),w.Ub(),w.Wb(),w.Wb(),w.Wb(),w.Sb(17,"span",91),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.nc(2);w.Db(5),w.uc("ngIf",0===e.capabilities.length),w.Db(1),w.uc("ngForOf",e.capabilities),w.Db(3),w.uc("disabled",w.qc(10,7,e.capabilities,e.hasAllCapabilities))("disableTooltip",!w.qc(11,10,e.capabilities,e.hasAllCapabilities)),w.Db(3),w.uc("ngClass",w.zc(17,kc,e.icons.add)),w.Db(4),w.fc(w.pc(15,13,e.actionLabels.ADD))(w.pc(16,15,e.capabilityLabel)),w.cc(14)}}function Fc(e,t){1&e&&(w.Xb(0,"div",8),w.Xb(1,"div",14),w.Xb(2,"div",15),w.Sb(3,"input",117),w.Xb(4,"label",118),w.bc(5,119),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function Pc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,123),w.Wb())}function Tc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,124),w.Wb())}function Cc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",120),w.bc(2,121),w.Wb(),w.Xb(3,"div",11),w.Sb(4,"input",122),w.Pc(5,Pc,2,0,"span",13),w.Pc(6,Tc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.userForm.showError("user_quota_max_size",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("user_quota_max_size",e,"quotaMaxSize"))}}function Rc(e,t){1&e&&(w.Xb(0,"div",8),w.Xb(1,"div",14),w.Xb(2,"div",15),w.Sb(3,"input",125),w.Xb(4,"label",126),w.bc(5,127),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function Ac(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,131),w.Wb())}function Nc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,132),w.Wb())}function Vc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",128),w.bc(2,129),w.Wb(),w.Xb(3,"div",11),w.Sb(4,"input",130),w.Pc(5,Ac,2,0,"span",13),w.Pc(6,Nc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.userForm.showError("user_quota_max_objects",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("user_quota_max_objects",e,"min"))}}function Oc(e,t){1&e&&(w.Xb(0,"div",8),w.Xb(1,"div",14),w.Xb(2,"div",15),w.Sb(3,"input",133),w.Xb(4,"label",134),w.bc(5,135),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function Bc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,139),w.Wb())}function Lc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,140),w.Wb())}function jc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",136),w.bc(2,137),w.Wb(),w.Xb(3,"div",11),w.Sb(4,"input",138),w.Pc(5,Bc,2,0,"span",13),w.Pc(6,Lc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.userForm.showError("bucket_quota_max_size",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("bucket_quota_max_size",e,"quotaMaxSize"))}}function Uc(e,t){1&e&&(w.Xb(0,"div",8),w.Xb(1,"div",14),w.Xb(2,"div",15),w.Sb(3,"input",141),w.Xb(4,"label",142),w.bc(5,143),w.Wb(),w.Wb(),w.Wb(),w.Wb())}function Mc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,147),w.Wb())}function Gc(e,t){1&e&&(w.Xb(0,"span",49),w.bc(1,148),w.Wb())}function Kc(e,t){if(1&e&&(w.Xb(0,"div",8),w.Xb(1,"label",144),w.bc(2,145),w.Wb(),w.Xb(3,"div",11),w.Sb(4,"input",146),w.Pc(5,Mc,2,0,"span",13),w.Pc(6,Gc,2,0,"span",13),w.Wb(),w.Wb()),2&e){w.nc();const e=w.Fc(2),t=w.nc();w.Db(5),w.uc("ngIf",t.userForm.showError("bucket_quota_max_objects",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("bucket_quota_max_objects",e,"min"))}}const Qc=function(e){return{required:e}};function Yc(e,t){if(1&e){const e=w.Yb();w.Xb(0,"div",1),w.Xb(1,"form",2,3),w.Xb(3,"div",4),w.Xb(4,"div",5),w.bc(5,6),w.oc(6,"titlecase"),w.oc(7,"upperFirst"),w.Wb(),w.Xb(8,"div",7),w.Xb(9,"div",8),w.Xb(10,"label",9),w.bc(11,10),w.Wb(),w.Xb(12,"div",11),w.Sb(13,"input",12),w.Pc(14,ic,2,0,"span",13),w.Pc(15,sc,2,0,"span",13),w.Pc(16,bc,2,0,"span",13),w.Wb(),w.Wb(),w.Xb(17,"div",8),w.Xb(18,"div",14),w.Xb(19,"div",15),w.Xb(20,"input",16),w.lc("click",function(){return w.Ic(e),w.nc().updateFieldsWhenTenanted()}),w.Wb(),w.Xb(21,"label",17),w.bc(22,18),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(23,rc,7,3,"div",19),w.Xb(24,"div",8),w.Xb(25,"label",20),w.bc(26,21),w.Wb(),w.Xb(27,"div",11),w.Sb(28,"input",22),w.Pc(29,lc,2,0,"span",13),w.Wb(),w.Wb(),w.Xb(30,"div",8),w.Xb(31,"label",23),w.bc(32,24),w.Wb(),w.Xb(33,"div",11),w.Sb(34,"input",25),w.Pc(35,uc,2,0,"span",13),w.Pc(36,dc,2,0,"span",13),w.Wb(),w.Wb(),w.Xb(37,"div",8),w.Xb(38,"label",26),w.bc(39,27),w.Wb(),w.Xb(40,"div",11),w.Xb(41,"select",28),w.lc("change",function(t){return w.Ic(e),w.nc().onMaxBucketsModeChange(t.target.value)}),w.Xb(42,"option",29),w.bc(43,30),w.Wb(),w.Xb(44,"option",31),w.bc(45,32),w.Wb(),w.Xb(46,"option",33),w.bc(47,34),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(48,pc,6,2,"div",19),w.Xb(49,"div",8),w.Xb(50,"div",14),w.Xb(51,"div",15),w.Sb(52,"input",35),w.Xb(53,"label",36),w.bc(54,37),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(55,yc,11,2,"fieldset",38),w.Pc(56,wc,16,11,"fieldset",38),w.Pc(57,$c,25,13,"fieldset",38),w.Pc(58,Ec,18,19,"fieldset",38),w.Xb(59,"fieldset"),w.Xb(60,"legend"),w.bc(61,39),w.Wb(),w.Xb(62,"div",8),w.Xb(63,"div",14),w.Xb(64,"div",15),w.Sb(65,"input",40),w.Xb(66,"label",41),w.bc(67,42),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(68,Fc,6,0,"div",19),w.Pc(69,Cc,7,2,"div",19),w.Pc(70,Rc,6,0,"div",19),w.Pc(71,Vc,7,2,"div",19),w.Wb(),w.Xb(72,"fieldset"),w.Xb(73,"legend"),w.bc(74,43),w.Wb(),w.Xb(75,"div",8),w.Xb(76,"div",14),w.Xb(77,"div",15),w.Sb(78,"input",44),w.Xb(79,"label",45),w.bc(80,46),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Pc(81,Oc,6,0,"div",19),w.Pc(82,jc,7,2,"div",19),w.Pc(83,Uc,6,0,"div",19),w.Pc(84,Kc,7,2,"div",19),w.Wb(),w.Wb(),w.Xb(85,"div",47),w.Xb(86,"cd-form-button-panel",48),w.lc("submitActionEvent",function(){return w.Ic(e),w.nc().onSubmit()}),w.oc(87,"titlecase"),w.oc(88,"upperFirst"),w.Wb(),w.Wb(),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.Fc(2),t=w.nc();w.Db(1),w.uc("formGroup",t.userForm),w.Db(6),w.fc(w.pc(6,29,t.action))(w.pc(7,31,t.resource)),w.cc(5),w.Db(3),w.uc("ngClass",w.zc(37,Qc,!t.editing)),w.Db(3),w.uc("readonly",t.editing),w.Db(1),w.uc("ngIf",t.userForm.showError("user_id",e,"required")),w.Db(1),w.uc("ngIf",t.userForm.showError("user_id",e,"pattern")),w.Db(1),w.uc("ngIf",!t.userForm.getValue("show_tenant")&&t.userForm.showError("user_id",e,"notUnique")),w.Db(4),w.uc("readonly",!0),w.Db(3),w.uc("ngIf",t.userForm.getValue("show_tenant")),w.Db(2),w.uc("ngClass",w.zc(39,Qc,!t.editing)),w.Db(4),w.uc("ngIf",t.userForm.showError("display_name",e,"required")),w.Db(6),w.uc("ngIf",t.userForm.showError("email",e,"email")),w.Db(1),w.uc("ngIf",t.userForm.showError("email",e,"notUnique")),w.Db(12),w.uc("ngIf",1==t.userForm.get("max_buckets_mode").value),w.Db(7),w.uc("ngIf",!t.editing),w.Db(1),w.uc("ngIf",t.editing),w.Db(1),w.uc("ngIf",t.editing),w.Db(1),w.uc("ngIf",t.editing),w.Db(10),w.uc("ngIf",t.userForm.controls.user_quota_enabled.value),w.Db(1),w.uc("ngIf",t.userForm.controls.user_quota_enabled.value&&!t.userForm.getValue("user_quota_max_size_unlimited")),w.Db(1),w.uc("ngIf",t.userForm.controls.user_quota_enabled.value),w.Db(1),w.uc("ngIf",t.userForm.controls.user_quota_enabled.value&&!t.userForm.getValue("user_quota_max_objects_unlimited")),w.Db(10),w.uc("ngIf",t.userForm.controls.bucket_quota_enabled.value),w.Db(1),w.uc("ngIf",t.userForm.controls.bucket_quota_enabled.value&&!t.userForm.getValue("bucket_quota_max_size_unlimited")),w.Db(1),w.uc("ngIf",t.userForm.controls.bucket_quota_enabled.value),w.Db(1),w.uc("ngIf",t.userForm.controls.bucket_quota_enabled.value&&!t.userForm.getValue("bucket_quota_max_objects_unlimited")),w.Db(2),w.uc("form",t.userForm)("submitText",w.pc(87,33,t.action)+" "+w.pc(88,35,t.resource))}}let Zc=(()=>{class e extends I.a{constructor(e,t,c,a,i,s,b){super(),this.formBuilder=e,this.route=t,this.router=c,this.rgwUserService=a,this.modalService=i,this.notificationService=s,this.actionLabels=b,this.editing=!1,this.submitObservables=[],this.icons=S.a,this.subusers=[],this.s3Keys=[],this.swiftKeys=[],this.capabilities=[],this.showTenant=!1,this.previousTenant=null,this.resource="user",this.subuserLabel="subuser",this.s3keyLabel="S3 Key",this.capabilityLabel="capability",this.editing=this.router.url.startsWith(`/rgw/user/${n.e.EDIT}`),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.createForm()}createForm(){this.userForm=this.formBuilder.group({user_id:[null,[i.A.required,i.A.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[x.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("tenant"))]],show_tenant:[this.editing],tenant:[null,[i.A.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[x.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("user_id"),!0)]],display_name:[null,[i.A.required]],email:[null,[x.a.email],[x.a.unique(this.rgwUserService.emailExists,this.rgwUserService)]],max_buckets_mode:[1],max_buckets:[1e3,[x.a.requiredIf({max_buckets_mode:"1"}),x.a.number(!1),i.A.min(1)]],suspended:[!1],generate_key:[!0],access_key:[null,[x.a.requiredIf({generate_key:!1})]],secret_key:[null,[x.a.requiredIf({generate_key:!1})]],user_quota_enabled:[!1],user_quota_max_size_unlimited:[!0],user_quota_max_size:[null,[x.a.composeIf({user_quota_enabled:!0,user_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],user_quota_max_objects_unlimited:[!0],user_quota_max_objects:[null,[i.A.min(0),x.a.requiredIf({user_quota_enabled:!0,user_quota_max_objects_unlimited:!1})]],bucket_quota_enabled:[!1],bucket_quota_max_size_unlimited:[!0],bucket_quota_max_size:[null,[x.a.composeIf({bucket_quota_enabled:!0,bucket_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],bucket_quota_max_objects_unlimited:[!0],bucket_quota_max_objects:[null,[i.A.min(0),x.a.requiredIf({bucket_quota_enabled:!0,bucket_quota_max_objects_unlimited:!1})]]})}ngOnInit(){this.route.params.subscribe(e=>{if(!e.hasOwnProperty("uid"))return void this.loadingReady();const t=decodeURIComponent(e.uid),c=[];c.push(this.rgwUserService.get(t)),c.push(this.rgwUserService.getQuota(t)),Object(f.a)(c).subscribe(e=>{const t=d.a.clone(this.userForm.value);let c=d.a.pick(e[0],d.a.keys(this.userForm.value));switch(c.max_buckets){case-1:c.max_buckets_mode=-1,c.max_buckets="";break;case 0:c.max_buckets_mode=0,c.max_buckets="";break;default:c.max_buckets_mode=1}["user","bucket"].forEach(t=>{const a=e[1][t+"_quota"];c[t+"_quota_enabled"]=a.enabled,a.max_size<0?(c[t+"_quota_max_size_unlimited"]=!0,c[t+"_quota_max_size"]=null):(c[t+"_quota_max_size_unlimited"]=!1,c[t+"_quota_max_size"]=`${a.max_size} B`),a.max_objects<0?(c[t+"_quota_max_objects_unlimited"]=!0,c[t+"_quota_max_objects"]=null):(c[t+"_quota_max_objects_unlimited"]=!1,c[t+"_quota_max_objects"]=a.max_objects)}),c=d.a.merge(t,c),this.userForm.setValue(c),this.subusers=e[0].subusers,this.s3Keys=e[0].keys,this.swiftKeys=e[0].swift_keys;const a={"read, write":"*"};e[0].caps.forEach(e=>{e.perm in a&&(e.perm=a[e.perm])}),this.capabilities=e[0].caps,this.loadingReady()},()=>{this.loadingError()})})}goToListView(){this.router.navigate(["/rgw/user"])}onSubmit(){let e;if(this.userForm.pristine)return void this.goToListView();const t=this.getUID();if(this.editing){if(this._isGeneralDirty()){const e=this._getUpdateArgs();this.submitObservables.push(this.rgwUserService.update(t,e))}e="Updated Object Gateway user '" + t + "'"}else{const c=this._getCreateArgs();this.submitObservables.push(this.rgwUserService.create(c)),e="Created Object Gateway user '" + t + "'"}if(this._isUserQuotaDirty()){const e=this._getUserQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}if(this._isBucketQuotaDirty()){const e=this._getBucketQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}Object(pt.a)(...this.submitObservables).subscribe({error:()=>{this.userForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.notificationService.show(z.a.success,e),this.goToListView()}})}updateFieldsWhenTenanted(){this.showTenant=this.userForm.getValue("show_tenant"),this.showTenant?(this.userForm.get("user_id").markAsTouched(),this.previousTenant=this.userForm.get("tenant").value,this.userForm.get("tenant").patchValue(null)):(this.userForm.get("user_id").markAsUntouched(),this.userForm.get("tenant").patchValue(this.previousTenant))}getUID(){var e;let t=this.userForm.getValue("user_id");const c=null===(e=this.userForm)||void 0===e?void 0:e.getValue("tenant");return c&&c.length>0&&(t=`${this.userForm.getValue("tenant")}$${t}`),t}quotaMaxSizeValidator(e){return Object(x.b)(e.value)?null:null===RegExp("^(\\d+(\\.\\d+)?)\\s*(B|K(B|iB)?|M(B|iB)?|G(B|iB)?|T(B|iB)?)?$","i").exec(e.value)||(new gt.a).toBytes(e.value)<1024?{quotaMaxSize:!0}:null}setSubuser(e,t){const c={"full-control":"full","read-write":"readwrite"},a=this.getUID();this.submitObservables.push(this.rgwUserService.createSubuser(a,{subuser:e.id,access:e.permissions in c?c[e.permissions]:e.permissions,key_type:"swift",secret_key:e.secret_key,generate_secret:e.generate_secret?"true":"false"})),d.a.isNumber(t)?this.subusers[t]=e:(this.subusers.push(e),this.swiftKeys.push({user:e.id,secret_key:e.generate_secret?"Apply your changes first...":e.secret_key})),this.userForm.markAsDirty()}deleteSubuser(e){const t=this.subusers[e];this.submitObservables.push(this.rgwUserService.deleteSubuser(this.getUID(),t.id)),this.s3Keys=this.s3Keys.filter(e=>e.user!==t.id),this.swiftKeys=this.swiftKeys.filter(e=>e.user!==t.id),this.subusers.splice(e,1),this.userForm.markAsDirty()}setCapability(e,t){const c=this.getUID();if(d.a.isNumber(t)){const a=this.capabilities[t];this.submitObservables.push(this.rgwUserService.deleteCapability(c,a.type,a.perm)),this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities[t]=e}else this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities=[...this.capabilities,e];this.userForm.markAsDirty()}deleteCapability(e){const t=this.capabilities[e];this.submitObservables.push(this.rgwUserService.deleteCapability(this.getUID(),t.type,t.perm)),this.capabilities.splice(e,1),this.capabilities=[...this.capabilities],this.userForm.markAsDirty()}hasAllCapabilities(e){return!d.a.difference(_t.getAll(),d.a.map(e,"type")).length}setS3Key(e,t){if(d.a.isNumber(t));else{const t=e.user.match(/([^:]+)(:(.+))?/),c=t[1],a={subuser:t[2]?t[3]:"",generate_key:e.generate_key?"true":"false"};"false"===a.generate_key&&(d.a.isNil(e.access_key)||(a.access_key=e.access_key),d.a.isNil(e.secret_key)||(a.secret_key=e.secret_key)),this.submitObservables.push(this.rgwUserService.addS3Key(c,a)),this.s3Keys.push({user:e.user,access_key:e.generate_key?"Apply your changes first...":e.access_key,secret_key:e.generate_key?"Apply your changes first...":e.secret_key})}this.userForm.markAsDirty()}deleteS3Key(e){const t=this.s3Keys[e];this.submitObservables.push(this.rgwUserService.deleteS3Key(this.getUID(),t.access_key)),this.s3Keys.splice(e,1),this.userForm.markAsDirty()}showSubuserModal(e){const t=this.getUID(),c=this.modalService.show(ec);if(d.a.isNumber(e)){const a=this.subusers[e];c.componentInstance.setEditing(),c.componentInstance.setValues(t,a.id,a.permissions)}else c.componentInstance.setEditing(!1),c.componentInstance.setValues(t),c.componentInstance.setSubusers(this.subusers);c.componentInstance.submitAction.subscribe(t=>{this.setSubuser(t,e)})}showS3KeyModal(e){const t=this.modalService.show(Lt);if(d.a.isNumber(e)){const c=this.s3Keys[e];t.componentInstance.setViewing(),t.componentInstance.setValues(c.user,c.access_key,c.secret_key)}else{const e=this._getS3KeyUserCandidates();t.componentInstance.setViewing(!1),t.componentInstance.setUserCandidates(e),t.componentInstance.submitAction.subscribe(e=>{this.setS3Key(e)})}}showSwiftKeyModal(e){const t=this.modalService.show(cc),c=this.swiftKeys[e];t.componentInstance.setValues(c.user,c.secret_key)}showCapabilityModal(e){const t=this.modalService.show($t);if(d.a.isNumber(e)){const c=this.capabilities[e];t.componentInstance.setEditing(),t.componentInstance.setValues(c.type,c.perm)}else t.componentInstance.setEditing(!1),t.componentInstance.setCapabilities(this.capabilities);t.componentInstance.submitAction.subscribe(t=>{this.setCapability(t,e)})}_isGeneralDirty(){return["display_name","email","max_buckets_mode","max_buckets","suspended"].some(e=>this.userForm.get(e).dirty)}_isUserQuotaDirty(){return["user_quota_enabled","user_quota_max_size_unlimited","user_quota_max_size","user_quota_max_objects_unlimited","user_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_isBucketQuotaDirty(){return["bucket_quota_enabled","bucket_quota_max_size_unlimited","bucket_quota_max_size","bucket_quota_max_objects_unlimited","bucket_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_getCreateArgs(){const e={uid:this.getUID(),display_name:this.userForm.getValue("display_name"),suspended:this.userForm.getValue("suspended"),email:"",max_buckets:this.userForm.getValue("max_buckets"),generate_key:this.userForm.getValue("generate_key"),access_key:"",secret_key:""},t=this.userForm.getValue("email");d.a.isString(t)&&t.length>0&&d.a.merge(e,{email:t}),this.userForm.getValue("generate_key")||d.a.merge(e,{generate_key:!1,access_key:this.userForm.getValue("access_key"),secret_key:this.userForm.getValue("secret_key")});const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&d.a.merge(e,{max_buckets:c}),e}_getUpdateArgs(){const e={},t=["display_name","email","max_buckets","suspended"];for(const a of t)e[a]=this.userForm.getValue(a);const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&(e.max_buckets=c),e}_getUserQuotaArgs(){const e={quota_type:"user",enabled:this.userForm.getValue("user_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("user_quota_max_size_unlimited")){const t=(new gt.a).toBytes(this.userForm.getValue("user_quota_max_size"));e.max_size_kb=(t/1024).toFixed(0)}return this.userForm.getValue("user_quota_max_objects_unlimited")||(e.max_objects=this.userForm.getValue("user_quota_max_objects")),e}_getBucketQuotaArgs(){const e={quota_type:"bucket",enabled:this.userForm.getValue("bucket_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("bucket_quota_max_size_unlimited")){const t=(new gt.a).toBytes(this.userForm.getValue("bucket_quota_max_size"));e.max_size_kb=(t/1024).toFixed(0)}return this.userForm.getValue("bucket_quota_max_objects_unlimited")||(e.max_objects=this.userForm.getValue("bucket_quota_max_objects")),e}_getS3KeyUserCandidates(){let e=[];const t=this.getUID();return d.a.isString(t)&&!d.a.isEmpty(t)&&e.push(t),this.subusers.forEach(t=>{e.push(t.id)}),this.s3Keys.forEach(t=>{e.push(t.user)}),e=d.a.uniq(e),e}onMaxBucketsModeChange(e){"1"===e&&(this.userForm.get("max_buckets").valid||this.userForm.patchValue({max_buckets:1e3}))}}return e.\u0275fac=function(t){return new(t||e)(w.Rb($.a),w.Rb(s.a),w.Rb(s.e),w.Rb(D),w.Rb($e.a),w.Rb(q.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-form"]],features:[w.Ab],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k,X,w,D,S,z,I,$,x,q,E,F,P,T,C,R,A,N,V,O,B,L,j,U,M,G,K,Q,Y,Z,J,H,ee,te,ce,ae,ie,se,be,oe,ne,re,le,ue,de;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="User ID",c="Show Tenant",a="Full name",i="Email address",s="Max. buckets",b="Disabled",o="Unlimited",n="Custom",r="Suspended",l="User quota",u="Enabled",d="Bucket quota",f="Enabled",m="This field is required.",p="The value is not valid.",g="The chosen user ID is already in use.",h="Tenant",_="The value is not valid.",v="The chosen user ID exists in this tenant.",y="This field is required.",W="This is not a valid email address.",k="The chosen email address is already in use.",X="This field is required.",w="The entered value must be >= 1.",D="S3 key",S="Auto-generate key",z="Access key",I="This field is required.",$="Secret key",x="This field is required.",q="Subusers",E="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",F="There are no subusers.",P="Edit",T="Delete",C="Keys",R="S3",A="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",N="Swift",V="There are no keys.",O="Show",B="Delete",L="There are no keys.",j="Show",U="Capabilities",M="All capabilities are already added.",G="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",K="There are no capabilities.",Q="Edit",Y="Delete",Z="Unlimited size",J="Max. size",H="This field is required.",ee="The value is not valid.",te="Unlimited objects",ce="Max. objects",ae="This field is required.",ie="The entered value must be >= 0.",se="Unlimited size",be="Max. size",oe="This field is required.",ne="The value is not valid.",re="Unlimited objects",le="Max. objects",ue="This field is required.",de="The entered value must be >= 0.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","user_id",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["id","user_id","type","text","formControlName","user_id",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","show_tenant","type","checkbox","formControlName","show_tenant",1,"custom-control-input",3,"readonly","click"],["for","show_tenant",1,"custom-control-label"],c,["class","form-group row",4,"ngIf"],["for","display_name",1,"cd-col-form-label",3,"ngClass"],a,["id","display_name","type","text","formControlName","display_name",1,"form-control"],["for","email",1,"cd-col-form-label"],i,["id","email","type","text","formControlName","email",1,"form-control"],["for","max_buckets_mode",1,"cd-col-form-label"],s,["formControlName","max_buckets_mode","name","max_buckets_mode","id","max_buckets_mode",1,"form-control","custom-select",3,"change"],["value","-1"],b,["value","0"],o,["value","1"],n,["id","suspended","type","checkbox","formControlName","suspended",1,"custom-control-input"],["for","suspended",1,"custom-control-label"],r,[4,"ngIf"],l,["id","user_quota_enabled","type","checkbox","formControlName","user_quota_enabled",1,"custom-control-input"],["for","user_quota_enabled",1,"custom-control-label"],u,d,["id","bucket_quota_enabled","type","checkbox","formControlName","bucket_quota_enabled",1,"custom-control-input"],["for","bucket_quota_enabled",1,"custom-control-label"],f,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],m,p,g,["for","tenant",1,"cd-col-form-label"],h,["id","tenant","type","text","formControlName","tenant","autofocus","",1,"form-control",3,"readonly"],_,v,y,W,k,[1,"cd-col-form-label"],["id","max_buckets","type","number","formControlName","max_buckets","min","1",1,"form-control"],X,w,D,["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],S,["for","access_key",1,"cd-col-form-label","required"],z,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],I,["for","secret_key",1,"cd-col-form-label","required"],$,["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],x,q,[1,"row"],["class","no-border",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"col-12"],["type","button",1,"btn","btn-light","float-right","tc_addSubuserButton",3,"click"],[3,"ngClass"],E,[1,"help-block"],[1,"no-border"],[1,"form-text","text-muted"],F,[1,"input-group-prepend"],[1,"input-group-text"],["type","text","readonly","",1,"cd-form-control",3,"value"],[1,"input-group-prepend","border-left-0","border-right-0"],["type","button","ngbTooltip",P,1,"btn","btn-light","tc_showSubuserButton",3,"click"],["type","button","ngbTooltip",T,1,"btn","btn-light","tc_deleteSubuserButton",3,"click"],C,R,["type","button",1,"btn","btn-light","float-right","tc_addS3KeyButton",3,"click"],A,N,V,["type","button","ngbTooltip",O,1,"btn","btn-light","tc_showS3KeyButton",3,"click"],["type","button","ngbTooltip",B,1,"btn","btn-light","tc_deleteS3KeyButton",3,"click"],L,["type","button","ngbTooltip",j,1,"btn","btn-light","tc_showSwiftKeyButton",3,"click"],U,["type","button","ngbTooltip",M,"triggers","pointerenter:pointerleave",1,"btn","btn-light","float-right","tc_addCapButton",3,"disabled","disableTooltip","click"],G,K,["type","button","ngbTooltip",Q,1,"btn","btn-light","tc_editCapButton",3,"click"],["type","button","ngbTooltip",Y,1,"btn","btn-light","tc_deleteCapButton",3,"click"],["id","user_quota_max_size_unlimited","type","checkbox","formControlName","user_quota_max_size_unlimited",1,"custom-control-input"],["for","user_quota_max_size_unlimited",1,"custom-control-label"],Z,["for","user_quota_max_size",1,"cd-col-form-label","required"],J,["id","user_quota_max_size","type","text","formControlName","user_quota_max_size","cdDimlessBinary","",1,"form-control"],H,ee,["id","user_quota_max_objects_unlimited","type","checkbox","formControlName","user_quota_max_objects_unlimited",1,"custom-control-input"],["for","user_quota_max_objects_unlimited",1,"custom-control-label"],te,["for","user_quota_max_objects",1,"cd-col-form-label","required"],ce,["id","user_quota_max_objects","type","number","formControlName","user_quota_max_objects",1,"form-control"],ae,ie,["id","bucket_quota_max_size_unlimited","type","checkbox","formControlName","bucket_quota_max_size_unlimited",1,"custom-control-input"],["for","bucket_quota_max_size_unlimited",1,"custom-control-label"],se,["for","bucket_quota_max_size",1,"cd-col-form-label","required"],be,["id","bucket_quota_max_size","type","text","formControlName","bucket_quota_max_size","cdDimlessBinary","",1,"form-control"],oe,ne,["id","bucket_quota_max_objects_unlimited","type","checkbox","formControlName","bucket_quota_max_objects_unlimited",1,"custom-control-input"],["for","bucket_quota_max_objects_unlimited",1,"custom-control-label"],re,["for","bucket_quota_max_objects",1,"cd-col-form-label","required"],le,["id","bucket_quota_max_objects","type","number","formControlName","bucket_quota_max_objects",1,"form-control"],ue,de]},template:function(e,t){1&e&&w.Pc(0,Yc,89,41,"div",0),2&e&&w.uc("cdFormLoading",t.loading)},directives:[P.a,i.B,i.r,T.a,i.k,C.a,a.p,R.a,i.d,A.a,i.q,i.i,a.r,i.b,i.z,i.u,i.C,O.a,N.a,i.v,xt.a,qt.a,a.q,b.D,ac.a],pipes:[a.A,B.a,o.b],styles:[""]}),e})();var Jc=c("x38r"),Hc=c("TJUb"),ea=c("FFMq");const ta=["accessKeyTpl"],ca=["secretKeyTpl"];function aa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,20),w.Wb(),w.Xb(3,"td"),w.Rc(4),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.Sc(e.user.email)}}function ia(e,t){if(1&e&&(w.Xb(0,"div"),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.Db(1),w.Uc(" ",e.id," (",e.permissions,") ")}}function sa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,21),w.Wb(),w.Xb(3,"td"),w.Pc(4,ia,2,2,"div",22),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.uc("ngForOf",e.user.subusers)}}function ba(e,t){if(1&e&&(w.Xb(0,"div"),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.Db(1),w.Uc(" ",e.type," (",e.perm,") ")}}function oa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,23),w.Wb(),w.Xb(3,"td"),w.Pc(4,ba,2,2,"div",22),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.uc("ngForOf",e.user.caps)}}function na(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,24),w.Wb(),w.Xb(3,"td"),w.Rc(4),w.oc(5,"join"),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.Sc(w.pc(5,1,e.user.mfa_ids))}}function ra(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function la(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,29),w.Wb())}function ua(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.oc(2,"dimlessBinary"),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",w.pc(2,1,e.user.user_quota.max_size)," ")}}function da(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function fa(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,30),w.Wb())}function ma(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",e.user.user_quota.max_objects," ")}}function pa(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"legend"),w.bc(2,25),w.Wb(),w.Xb(3,"table",9),w.Xb(4,"tbody"),w.Xb(5,"tr"),w.Xb(6,"td",10),w.bc(7,26),w.Wb(),w.Xb(8,"td",12),w.Rc(9),w.oc(10,"booleanText"),w.Wb(),w.Wb(),w.Xb(11,"tr"),w.Xb(12,"td",15),w.bc(13,27),w.Wb(),w.Pc(14,ra,2,0,"td",0),w.Pc(15,la,2,0,"td",0),w.Pc(16,ua,3,3,"td",0),w.Wb(),w.Xb(17,"tr"),w.Xb(18,"td",15),w.bc(19,28),w.Wb(),w.Pc(20,da,2,0,"td",0),w.Pc(21,fa,2,0,"td",0),w.Pc(22,ma,2,1,"td",0),w.Wb(),w.Wb(),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(9),w.Sc(w.pc(10,7,e.user.user_quota.enabled)),w.Db(5),w.uc("ngIf",!e.user.user_quota.enabled),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size<=-1),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size>-1),w.Db(4),w.uc("ngIf",!e.user.user_quota.enabled),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects<=-1),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects>-1)}}function ga(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function ha(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,35),w.Wb())}function _a(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.oc(2,"dimlessBinary"),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",w.pc(2,1,e.user.bucket_quota.max_size)," ")}}function va(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function ya(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,36),w.Wb())}function Wa(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",e.user.bucket_quota.max_objects," ")}}function ka(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"legend"),w.bc(2,31),w.Wb(),w.Xb(3,"table",9),w.Xb(4,"tbody"),w.Xb(5,"tr"),w.Xb(6,"td",10),w.bc(7,32),w.Wb(),w.Xb(8,"td",12),w.Rc(9),w.oc(10,"booleanText"),w.Wb(),w.Wb(),w.Xb(11,"tr"),w.Xb(12,"td",15),w.bc(13,33),w.Wb(),w.Pc(14,ga,2,0,"td",0),w.Pc(15,ha,2,0,"td",0),w.Pc(16,_a,3,3,"td",0),w.Wb(),w.Xb(17,"tr"),w.Xb(18,"td",15),w.bc(19,34),w.Wb(),w.Pc(20,va,2,0,"td",0),w.Pc(21,ya,2,0,"td",0),w.Pc(22,Wa,2,1,"td",0),w.Wb(),w.Wb(),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(9),w.Sc(w.pc(10,7,e.user.bucket_quota.enabled)),w.Db(5),w.uc("ngIf",!e.user.bucket_quota.enabled),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size<=-1),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size>-1),w.Db(4),w.uc("ngIf",!e.user.bucket_quota.enabled),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects<=-1),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects>-1)}}function Xa(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"table",9),w.Xb(2,"tbody"),w.Xb(3,"tr"),w.Xb(4,"td",10),w.bc(5,11),w.Wb(),w.Xb(6,"td",12),w.Rc(7),w.Wb(),w.Wb(),w.Xb(8,"tr"),w.Xb(9,"td",10),w.bc(10,13),w.Wb(),w.Xb(11,"td",12),w.Rc(12),w.Wb(),w.Wb(),w.Xb(13,"tr"),w.Xb(14,"td",10),w.bc(15,14),w.Wb(),w.Xb(16,"td",12),w.Rc(17),w.Wb(),w.Wb(),w.Xb(18,"tr"),w.Xb(19,"td",15),w.bc(20,16),w.Wb(),w.Xb(21,"td"),w.Rc(22),w.Wb(),w.Wb(),w.Pc(23,aa,5,1,"tr",0),w.Xb(24,"tr"),w.Xb(25,"td",15),w.bc(26,17),w.Wb(),w.Xb(27,"td"),w.Rc(28),w.oc(29,"booleanText"),w.Wb(),w.Wb(),w.Xb(30,"tr"),w.Xb(31,"td",15),w.bc(32,18),w.Wb(),w.Xb(33,"td"),w.Rc(34),w.oc(35,"booleanText"),w.Wb(),w.Wb(),w.Xb(36,"tr"),w.Xb(37,"td",15),w.bc(38,19),w.Wb(),w.Xb(39,"td"),w.Rc(40),w.oc(41,"map"),w.Wb(),w.Wb(),w.Pc(42,sa,5,1,"tr",0),w.Pc(43,oa,5,1,"tr",0),w.Pc(44,na,6,3,"tr",0),w.Wb(),w.Wb(),w.Pc(45,pa,23,9,"div",0),w.Pc(46,ka,23,9,"div",0),w.Wb()),2&e){const e=w.nc(3);w.Db(7),w.Sc(e.user.tenant),w.Db(5),w.Sc(e.user.user_id),w.Db(5),w.Sc(e.user.uid),w.Db(5),w.Sc(e.user.display_name),w.Db(1),w.uc("ngIf",null==e.user.email?null:e.user.email.length),w.Db(5),w.Sc(w.pc(29,13,e.user.suspended)),w.Db(6),w.Sc(w.pc(35,15,"true"===e.user.system)),w.Db(6),w.Sc(w.qc(41,17,e.user.max_buckets,e.maxBucketsMap)),w.Db(2),w.uc("ngIf",e.user.subusers&&e.user.subusers.length),w.Db(1),w.uc("ngIf",e.user.caps&&e.user.caps.length),w.Db(1),w.uc("ngIf",null==e.user.mfa_ids?null:e.user.mfa_ids.length),w.Db(1),w.uc("ngIf",e.user.user_quota),w.Db(1),w.uc("ngIf",e.user.bucket_quota)}}function wa(e,t){if(1&e&&w.Pc(0,Xa,47,20,"div",0),2&e){const e=w.nc(2);w.uc("ngIf",e.user)}}const Da=function(e){return[e]};function Sa(e,t){if(1&e){const e=w.Yb();w.Xb(0,"cd-table",39),w.lc("updateSelection",function(t){return w.Ic(e),w.nc(3).updateKeysSelection(t)}),w.Xb(1,"div",40),w.Xb(2,"div",41),w.Xb(3,"button",42),w.lc("click",function(){return w.Ic(e),w.nc(3).showKeyModal()}),w.Sb(4,"i",43),w.Vb(5),w.bc(6,44),w.Ub(),w.Wb(),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.nc(3);w.uc("data",e.keys)("columns",e.keysColumns),w.Db(3),w.uc("disabled",!e.keysSelection.hasSingleSelection),w.Db(1),w.uc("ngClass",w.zc(4,Da,e.icons.show))}}function za(e,t){1&e&&(w.Xb(0,"li",37),w.Xb(1,"a",4),w.bc(2,38),w.Wb(),w.Pc(3,Sa,7,6,"ng-template",6),w.Wb())}function Ia(e,t){if(1&e&&(w.Vb(0),w.Xb(1,"ul",1,2),w.Xb(3,"li",3),w.Xb(4,"a",4),w.bc(5,5),w.Wb(),w.Pc(6,wa,1,1,"ng-template",6),w.Wb(),w.Pc(7,za,4,0,"li",7),w.Wb(),w.Sb(8,"div",8),w.Ub()),2&e){const e=w.Fc(2),t=w.nc();w.Db(7),w.uc("ngIf",t.keys.length),w.Db(1),w.uc("ngbNavOutlet",e)}}let $a=(()=>{class e{constructor(e,t){this.rgwUserService=e,this.modalService=t,this.keys=[],this.keysColumns=[],this.keysSelection=new De.a,this.icons=S.a}ngOnInit(){this.keysColumns=[{name:"Username",prop:"username",flexGrow:1},{name:"Type",prop:"type",flexGrow:1}],this.maxBucketsMap={"-1":"Disabled",0:"Unlimited"}}ngOnChanges(){this.selection&&(this.user=this.selection,this.user.subusers=d.a.sortBy(this.user.subusers,"id"),this.user.caps=d.a.sortBy(this.user.caps,"type"),this.rgwUserService.getQuota(this.user.uid).subscribe(e=>{d.a.extend(this.user,e)}),this.keys=[],this.user.keys&&this.user.keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"S3",username:e.user,ref:e})}),this.user.swift_keys&&this.user.swift_keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"Swift",username:e.user,ref:e})}),this.keys=d.a.sortBy(this.keys,"user"))}updateKeysSelection(e){this.keysSelection=e}showKeyModal(){const e=this.keysSelection.first(),t=this.modalService.show("S3"===e.type?Lt:cc);switch(e.type){case"S3":t.componentInstance.setViewing(),t.componentInstance.setValues(e.ref.user,e.ref.access_key,e.ref.secret_key);break;case"Swift":t.componentInstance.setValues(e.ref.user,e.ref.secret_key)}}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(D),w.Rb($e.a))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-details"]],viewQuery:function(e,t){if(1&e&&(w.Wc(ta,1),w.Wc(ca,1)),2&e){let e;w.Ec(e=w.mc())&&(t.accessKeyTpl=e.first),w.Ec(e=w.mc())&&(t.secretKeyTpl=e.first)}},inputs:{selection:"selection"},features:[w.Bb],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k,X,w,D;return e="Details",t="Tenant",c="User ID",a="Username",i="Full name",s="Suspended",b="System",o="Maximum buckets",n="Email address",r="Subusers",l="Capabilities",u="MFAs(Id)",d="User quota",f="Enabled",m="Maximum size",p="Maximum objects",g="Unlimited",h="Unlimited",_="Bucket quota",v="Enabled",y="Maximum size",W="Maximum objects",k="Unlimited",X="Unlimited",w="Keys",D="Show",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-user-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","keys",4,"ngIf"],[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],t,[1,"w-75"],c,a,[1,"bold"],i,s,b,o,n,r,[4,"ngFor","ngForOf"],l,u,d,f,m,p,g,h,_,v,y,W,k,X,["ngbNavItem","keys"],w,["columnMode","flex","selectionType","multi","forceIdentifier","true",3,"data","columns","updateSelection"],[1,"table-actions"],["dropdown","",1,"btn-group"],["type","button",1,"btn","btn-accent",3,"disabled","click"],[3,"ngClass"],D]},template:function(e,t){1&e&&w.Pc(0,Ia,9,2,"ng-container",0),2&e&&w.uc("ngIf",t.selection)},directives:[a.r,b.p,He.a,b.r,b.s,b.q,b.u,a.q,we.a,R.a,a.p],pipes:[Fe.a,Hc.a,ea.a,Se.a],styles:[""]}),e})();const xa=["userSizeTpl"],qa=["userObjectTpl"];function Ea(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",8),2&e){const e=w.nc().row;w.uc("total",e.user_quota.max_size)("used",e.stats.size_actual)}}function Fa(e,t){1&e&&w.bc(0,9)}function Pa(e,t){if(1&e&&(w.Pc(0,Ea,1,2,"cd-usage-bar",6),w.Pc(1,Fa,1,0,"ng-template",null,7,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.user_quota.max_size>0&&e.user_quota.enabled)("ngIfElse",c)}}function Ta(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",12),2&e){const e=w.nc().row;w.uc("total",e.user_quota.max_objects)("used",e.stats.num_objects)("isBinary",!1)}}function Ca(e,t){1&e&&w.bc(0,13)}function Ra(e,t){if(1&e&&(w.Pc(0,Ta,1,3,"cd-usage-bar",10),w.Pc(1,Ca,1,0,"ng-template",null,11,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.user_quota.max_objects>0&&e.user_quota.enabled)("ngIfElse",c)}}let Aa=(()=>{class e extends ke.a{constructor(e,t,c,a,i,s){super(s),this.authStorageService=e,this.rgwUserService=t,this.modalService=c,this.urlBuilder=a,this.actionLabels=i,this.ngZone=s,this.columns=[],this.users=[],this.selection=new De.a}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Username",prop:"uid",flexGrow:1},{name:"Tenant",prop:"tenant",flexGrow:1},{name:"Full name",prop:"display_name",flexGrow:1},{name:"Email address",prop:"email",flexGrow:1},{name:"Suspended",prop:"suspended",flexGrow:1,cellClass:"text-center",cellTransformation:Jc.a.checkIcon},{name:"Max. buckets",prop:"max_buckets",flexGrow:1,cellTransformation:Jc.a.map,customTemplateConfig:{"-1":"Disabled",0:"Unlimited"}},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.userSizeTpl,flexGrow:.8},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.userObjectTpl,flexGrow:.8}];const e=()=>this.selection.first()&&`${encodeURIComponent(this.selection.first().uid)}`;this.tableActions=[{permission:"create",icon:S.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection},{permission:"update",icon:S.a.edit,routerLink:()=>this.urlBuilder.getEdit(e()),name:this.actionLabels.EDIT},{permission:"delete",icon:S.a.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:e=>e.hasMultiSelection}],this.setTableRefreshTimeout()}getUserList(e){this.setTableRefreshTimeout(),this.rgwUserService.list().subscribe(e=>{this.users=e},()=>{e.error()})}updateSelection(e){this.selection=e}deleteAction(){this.modalService.show(Xe.a,{itemDescription:this.selection.hasSingleSelection?"user":"users",itemNames:this.selection.selected.map(e=>e.uid),submitActionObservable:()=>new We.a(e=>{Object(f.a)(this.selection.selected.map(e=>this.rgwUserService.delete(e.uid))).subscribe({error:t=>{e.error(t),this.table.refreshBtn()},complete:()=>{e.complete(),this.table.refreshBtn()}})})})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(Ie.a),w.Rb(D),w.Rb($e.a),w.Rb(xe.a),w.Rb(n.b),w.Rb(w.D))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-list"]],viewQuery:function(e,t){if(1&e&&(w.Wc(we.a,3),w.Wc(xa,3),w.Wc(qa,3)),2&e){let e;w.Ec(e=w.mc())&&(t.table=e.first),w.Ec(e=w.mc())&&(t.userSizeTpl=e.first),w.Ec(e=w.mc())&&(t.userObjectTpl=e.first)}},features:[w.Cb([{provide:xe.a,useValue:new xe.a("rgw/user")}]),w.Ab],decls:8,vars:9,consts:function(){let e,t;return e="No Limit",t="No Limit",[["columnMode","flex","selectionType","multiClick","identifier","uid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["userSizeTpl",""],["userObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],e,[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],t]},template:function(e,t){1&e&&(w.Xb(0,"cd-table",0,1),w.lc("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)})("fetchData",function(e){return t.getUserList(e)}),w.Sb(2,"cd-table-actions",2),w.Sb(3,"cd-rgw-user-details",3),w.Wb(),w.Pc(4,Pa,3,2,"ng-template",null,4,w.Qc),w.Pc(6,Ra,3,2,"ng-template",null,5,w.Qc)),2&e&&(w.uc("autoReload",!1)("data",t.users)("columns",t.columns)("hasDetails",!0)("status",t.tableStatus),w.Db(2),w.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),w.Db(1),w.uc("selection",t.expandedRow))},directives:[we.a,qe.a,$a,a.r,Be.a],styles:[""]}),e})(),Na=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=w.Pb({type:e}),e.\u0275inj=w.Ob({imports:[[a.c,r.a,i.m,i.x,l.a,b.t,s.i,b.F,o.a]]}),e})();const Va=[{path:""},{path:"daemon",component:mt,data:{breadcrumbs:"Daemons"}},{path:"user",data:{breadcrumbs:"Users"},children:[{path:"",component:Aa},{path:n.e.CREATE,component:Zc,data:{breadcrumbs:n.a.CREATE}},{path:`${n.e.EDIT}/:uid`,component:Zc,data:{breadcrumbs:n.a.EDIT}}]},{path:"bucket",data:{breadcrumbs:"Buckets"},children:[{path:"",component:Ze},{path:n.e.CREATE,component:ye,data:{breadcrumbs:n.a.CREATE}},{path:`${n.e.EDIT}/:bid`,component:ye,data:{breadcrumbs:n.a.EDIT}}]}];let Oa=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=w.Pb({type:e}),e.\u0275inj=w.Ob({imports:[[Na,s.i.forChild(Va)]]}),e})()}}]);
\ No newline at end of file
index 380fbe3ea8208cc0877f7de98b6a22a007d2f9d0..74a20fed4831001ec0dc34b2e171ca977464fa3c 100644 (file)
@@ -6,7 +6,7 @@
 
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <link rel="icon" type="image/x-icon" id="cdFavicon" href="favicon.ico">
-<link rel="stylesheet" href="styles.7918cb8dc788b3eedc95.css"></head>
+<link rel="stylesheet" href="styles.0520b6222fe6dab25bab.css"></head>
 <body>
   <noscript>
     <div class="noscript container"
@@ -20,5 +20,5 @@
   </noscript>
 
   <cd-root></cd-root>
-<script src="runtime.fcd694c3eff5ef104b53.js" defer></script><script src="polyfills.b66d1515aae6fe3887b1.js" defer></script><script src="scripts.6bda3fa7e09a87cd4228.js" defer></script><script src="main.b78c1bf5c30e15315e18.js" defer></script></body>
+<script src="runtime.fc090c2eb8af922526a6.js" defer></script><script src="polyfills.69188bf73a1e0d939338.js" defer></script><script src="scripts.6bda3fa7e09a87cd4228.js" defer></script><script src="main.d269a7c492a93e2ebedb.js" defer></script></body>
 </html>
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.b78c1bf5c30e15315e18.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.b78c1bf5c30e15315e18.js
deleted file mode 100644 (file)
index 2aaf775..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var $localize=Object.assign(void 0===$localize?{}:$localize,{locale:"en-US"});
-"use strict";(function(global){global.ng=global.ng||{};global.ng.common=global.ng.common||{};global.ng.common.locales=global.ng.common.locales||{};const u=undefined;function plural(n){let i=Math.floor(Math.abs(n)),v=n.toString().replace(/^[^.]*\.?/,"").length;if(i===1&&v===0)return 1;return 5}global.ng.common.locales["en-us-posix"]=["en-US-POSIX",[["a","p"],["AM","PM"],u],[["AM","PM"],u,u],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],u,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],u,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",u,"{1} 'at' {0}",u],[".",",",";","%","+","-","E","\xD7","0/00","INF","NaN",":"],["0.######","0%","\xA4\xA00.00","0.000000E+000"],"USD","$","US Dollar",{},"ltr",plural,[[["mi","n","in the morning","in the afternoon","in the evening","at night"],["midnight","noon","in the morning","in the afternoon","in the evening","at night"],u],[["midnight","noon","morning","afternoon","evening","night"],u,u],["00:00","12:00",["06:00","12:00"],["12:00","18:00"],["18:00","21:00"],["21:00","06:00"]]]]})(typeof globalThis!=="undefined"&&globalThis||typeof global!=="undefined"&&global||typeof window!=="undefined"&&window);;
-(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"+0ag":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=/ceph version\s+[^ ]+\s+\(.+\)\s+(.+)\s+\((.+)\)/.exec(e);return t?"dev"===t[2]?"master":t[1]:e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"cephReleaseName",type:e,pure:!0}),e})()},"+EKe":function(e,t,n){"use strict";var i=n("23KU"),r=n("uE2L");t.a=function(e,t,n,s){var o=!n;n||(n={});for(var a=-1,c=t.length;++a<c;){var l=t[a],u=s?s(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),o?Object(r.a)(n,l,u):Object(i.a)(n,l,u)}return n}},"+fVR":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("e2NH");class r{constructor(e){this.ngZone=e}setExpandedRow(e){this.expandedRow=e}setTableRefreshTimeout(){clearTimeout(this.staleTimeout),this.ngZone.runOutsideAngular(()=>{this.staleTimeout=window.setTimeout(()=>{this.ngZone.run(()=>{this.tableStatus=new i.a("warning","The user list data might be stale. If needed, you can manually reload it.")})},1e4)})}}},"+s0g":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),i=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",w:"\xe9\xe9n week",ww:"%d weken",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"//9w":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"o\u0111\u0111ajagem\xe1nnu_guovvam\xe1nnu_njuk\u010dam\xe1nnu_cuo\u014bom\xe1nnu_miessem\xe1nnu_geassem\xe1nnu_suoidnem\xe1nnu_borgem\xe1nnu_\u010dak\u010dam\xe1nnu_golggotm\xe1nnu_sk\xe1bmam\xe1nnu_juovlam\xe1nnu".split("_"),monthsShort:"o\u0111\u0111j_guov_njuk_cuo_mies_geas_suoi_borg_\u010dak\u010d_golg_sk\xe1b_juov".split("_"),weekdays:"sotnabeaivi_vuoss\xe1rga_ma\u014b\u014beb\xe1rga_gaskavahkku_duorastat_bearjadat_l\xe1vvardat".split("_"),weekdaysShort:"sotn_vuos_ma\u014b_gask_duor_bear_l\xe1v".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s gea\u017ees",past:"ma\u014bit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta m\xe1nnu",MM:"%d m\xe1nut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"/1FC":function(e,t,n){"use strict";t.a=Array.isArray},"/GqU":function(e,t,n){var i=n("RK3t"),r=n("HYAF");e.exports=function(e){return i(r(e))}},"/NlG":function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var i=n("8Y7J"),r=n("oxzT"),s=n("G0yt"),o=n("SVse");const a=function(e){return[e]};function c(e,t){if(1&e&&(i.Sb(0,"td",8),i.Nb(1,"i",9),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Cb("alert-",e.bootstrapClass," ",e.typeIcon,""),i.pc("ngClass",i.uc(5,a,e.icons.large3x))}}function l(e,t){if(1&e&&(i.Sb(0,"td",10),i.Oc(1),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Pc(e.title)}}function u(e,t){1&e&&i.Ob(0)}function d(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"tr"),i.Mc(2,c,2,7,"td",4),i.Mc(3,l,2,1,"td",5),i.Rb(),i.Sb(4,"tr"),i.Sb(5,"td",6),i.Mc(6,u,1,0,"ng-container",7),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic(),t=i.Ac(6);i.yb(2),i.pc("ngIf",e.showIcon),i.yb(1),i.pc("ngIf",e.showTitle),i.yb(3),i.pc("ngTemplateOutlet",t)}}function h(e,t){if(1&e&&(i.Sb(0,"td",12),i.Nb(1,"i",13),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Cb("alert-",e.bootstrapClass," ",e.typeIcon,"")}}function f(e,t){if(1&e&&(i.Sb(0,"td",10),i.Oc(1),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Pc(e.title)}}function p(e,t){1&e&&i.Ob(0)}function m(e,t){if(1&e&&(i.Sb(0,"tr"),i.Mc(1,h,2,4,"td",11),i.Mc(2,f,2,1,"td",5),i.Sb(3,"td",6),i.Mc(4,p,1,0,"ng-container",7),i.Rb(),i.Rb()),2&e){const e=i.ic(),t=i.Ac(6);i.yb(1),i.pc("ngIf",e.showIcon),i.yb(1),i.pc("ngIf",e.showTitle),i.yb(2),i.pc("ngTemplateOutlet",t)}}function b(e,t){1&e&&i.nc(0)}const g=["*"];let _=(()=>{class e{constructor(){this.title="",this.bootstrapClass="",this.size="normal",this.showIcon=!0,this.showTitle=!0,this.dismissible=!1,this.dismissed=new i.o,this.icons=r.a}ngOnInit(){switch(this.type){case"warning":this.title=this.title||"Warning",this.typeIcon=this.typeIcon||r.a.warning,this.bootstrapClass=this.bootstrapClass||"warning";break;case"error":this.title=this.title||"Error",this.typeIcon=this.typeIcon||r.a.destroyCircle,this.bootstrapClass=this.bootstrapClass||"danger";break;case"info":this.title=this.title||"Information",this.typeIcon=this.typeIcon||r.a.infoCircle,this.bootstrapClass=this.bootstrapClass||"info";break;case"success":this.title=this.title||"Success",this.typeIcon=this.typeIcon||r.a.check,this.bootstrapClass=this.bootstrapClass||"success";break;case"danger":this.title=this.title||"Danger",this.typeIcon=this.typeIcon||r.a.warning,this.bootstrapClass=this.bootstrapClass||"danger"}}onClose(){this.dismissed.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-alert-panel"]],inputs:{title:"title",bootstrapClass:"bootstrapClass",type:"type",typeIcon:"typeIcon",size:"size",showIcon:"showIcon",showTitle:"showTitle",dismissible:"dismissible"},outputs:{dismissed:"dismissed"},ngContentSelectors:g,decls:7,vars:4,consts:[[3,"type","dismissible","close"],[4,"ngIf","ngIfElse"],["slim",""],["content",""],["rowspan","2","class","alert-panel-icon",4,"ngIf"],["class","alert-panel-title",4,"ngIf"],[1,"alert-panel-text"],[4,"ngTemplateOutlet"],["rowspan","2",1,"alert-panel-icon"],["aria-hidden","true",3,"ngClass"],[1,"alert-panel-title"],["class","alert-panel-icon",4,"ngIf"],[1,"alert-panel-icon"],["aria-hidden","true"]],template:function(e,t){if(1&e&&(i.oc(),i.Sb(0,"ngb-alert",0),i.gc("close",(function(){return t.onClose()})),i.Sb(1,"table"),i.Mc(2,d,7,3,"ng-container",1),i.Mc(3,m,5,3,"ng-template",null,2,i.Nc),i.Rb(),i.Rb(),i.Mc(5,b,1,0,"ng-template",null,3,i.Nc)),2&e){const e=i.Ac(4);i.qc("type",t.bootstrapClass),i.pc("dismissible",t.dismissible),i.yb(2),i.pc("ngIf","normal"===t.size)("ngIfElse",e)}},directives:[s.b,o.r,o.w,o.p],styles:[".alert-panel-icon[_ngcontent-%COMP%]{padding-right:.5em;vertical-align:top}.alert-panel-title[_ngcontent-%COMP%]{font-weight:700}"]}),e})()},"/X5v":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~\xe1\xf1\xfa\xe1~r\xfd_F~\xe9br\xfa~\xe1r\xfd_~M\xe1rc~h_\xc1p~r\xedl_~M\xe1\xfd_~J\xfa\xf1\xe9~_J\xfal~\xfd_\xc1\xfa~g\xfast~_S\xe9p~t\xe9mb~\xe9r_\xd3~ct\xf3b~\xe9r_\xd1~\xf3v\xe9m~b\xe9r_~D\xe9c\xe9~mb\xe9r".split("_"),monthsShort:"J~\xe1\xf1_~F\xe9b_~M\xe1r_~\xc1pr_~M\xe1\xfd_~J\xfa\xf1_~J\xfal_~\xc1\xfag_~S\xe9p_~\xd3ct_~\xd1\xf3v_~D\xe9c".split("_"),monthsParseExact:!0,weekdays:"S~\xfa\xf1d\xe1~\xfd_M\xf3~\xf1d\xe1\xfd~_T\xfa\xe9~sd\xe1\xfd~_W\xe9d~\xf1\xe9sd~\xe1\xfd_T~h\xfars~d\xe1\xfd_~Fr\xedd~\xe1\xfd_S~\xe1t\xfar~d\xe1\xfd".split("_"),weekdaysShort:"S~\xfa\xf1_~M\xf3\xf1_~T\xfa\xe9_~W\xe9d_~Th\xfa_~Fr\xed_~S\xe1t".split("_"),weekdaysMin:"S~\xfa_M\xf3~_T\xfa_~W\xe9_T~h_Fr~_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~\xf3d\xe1~\xfd \xe1t] LT",nextDay:"[T~\xf3m\xf3~rr\xf3~w \xe1t] LT",nextWeek:"dddd [\xe1t] LT",lastDay:"[\xdd~\xe9st~\xe9rd\xe1~\xfd \xe1t] LT",lastWeek:"[L~\xe1st] dddd [\xe1t] LT",sameElse:"L"},relativeTime:{future:"\xed~\xf1 %s",past:"%s \xe1~g\xf3",s:"\xe1 ~f\xe9w ~s\xe9c\xf3~\xf1ds",ss:"%d s~\xe9c\xf3\xf1~ds",m:"\xe1 ~m\xed\xf1~\xfat\xe9",mm:"%d m~\xed\xf1\xfa~t\xe9s",h:"\xe1~\xf1 h\xf3~\xfar",hh:"%d h~\xf3\xfars",d:"\xe1 ~d\xe1\xfd",dd:"%d d~\xe1\xfds",M:"\xe1 ~m\xf3\xf1~th",MM:"%d m~\xf3\xf1t~hs",y:"\xe1 ~\xfd\xe9\xe1r",yy:"%d \xfd~\xe9\xe1rs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"/b8u":function(e,t,n){var i=n("STAE");e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},"/byt":function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},"/uUt":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e,t){return n=>n.lift(new s(e,t))}class s{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new o(e,this.compare,this.keySelector))}}class o extends i.a{constructor(e,t,n){super(e),this.keySelector=n,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:n}=this;t=n?n(e):e}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:e}=this;n=e(this.key,t)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))}}},0:function(e,t,n){e.exports=n("zUnb")},"0+/T":function(e,t,n){"use strict";n.d(t,"a",(function(){return D}));var i=n("s7LF"),r=n("QFaf"),s=n("sb0X"),o=n("8Y7J"),a=n("G0yt"),c=n("ajRT"),l=n("SVse"),u=n("NwgZ"),d=n("ocLN"),h=n("ANnk"),f=n("f69J"),p=n("IZUe"),m=n("6+kj");function b(e,t){1&e&&o.Ob(0)}function g(e,t){1&e&&o.Ob(0)}function _(e,t){if(1&e&&(o.Sb(0,"p"),o.cc(1,21),o.jc(2,"lowercase"),o.Nb(3,"strong"),o.Zb(),o.Rb()),2&e){const e=o.ic(2);o.yb(3),o.ac(o.kc(2,2,e.actionDescription))(e.itemNames[0]),o.Xb(1)}}function y(e,t){if(1&e&&(o.Sb(0,"li"),o.Sb(1,"strong"),o.Oc(2),o.Rb(),o.Rb()),2&e){const e=t.$implicit;o.yb(2),o.Pc(e)}}function v(e,t){if(1&e&&(o.Sb(0,"p"),o.Wb(1,22),o.jc(2,"lowercase"),o.Rb(),o.Sb(3,"ul"),o.Mc(4,y,3,1,"li",23),o.Rb()),2&e){const e=o.ic(2);o.yb(2),o.ac(o.kc(2,2,e.actionDescription)),o.Xb(1),o.yb(2),o.pc("ngForOf",e.itemNames)}}function w(e,t){if(1&e&&(o.Sb(0,"span"),o.Mc(1,_,4,4,"p",10),o.Mc(2,v,5,4,"ng-template",null,20,o.Nc),o.Rb()),2&e){const e=o.Ac(3),t=o.ic();o.yb(1),o.pc("ngIf",1===t.itemNames.length)("ngIfElse",e)}}function S(e,t){if(1&e&&(o.Sb(0,"p"),o.Wb(1,24),o.jc(2,"lowercase"),o.Rb()),2&e){const e=o.ic();o.yb(2),o.ac(o.kc(2,2,e.actionDescription))(e.itemDescription),o.Xb(1)}}function M(e,t){1&e&&o.Ob(0)}function x(e,t){if(1&e&&(o.Oc(0),o.jc(1,"titlecase")),2&e){const e=o.ic();o.Rc(" ",o.kc(1,2,e.actionDescription)," ",e.itemDescription,"\n")}}const k=function(e){return{form:e}};let D=(()=>{class e{constructor(e){this.activeModal=e,this.actionDescription="delete"}ngOnInit(){const e={confirmation:new i.h(!1,[i.A.requiredTrue])};if(this.childFormGroup&&(e.child=this.childFormGroup),this.deletionForm=new r.a(e),!this.submitAction&&!this.submitActionObservable)throw new Error("No submit action defined")}callSubmitAction(){this.submitActionObservable?this.submitActionObservable().subscribe({error:this.stopLoadingSpinner.bind(this),complete:this.hideModal.bind(this)}):this.submitAction()}hideModal(){this.activeModal.close()}stopLoadingSpinner(){this.deletionForm.setErrors({cdSubmitButton:!0})}}return e.\u0275fac=function(t){return new(t||e)(o.Mb(a.a))},e.\u0275cmp=o.Gb({type:e,selectors:[["cd-deletion-modal"]],viewQuery:function(e,t){var n;1&e&&o.Jc(s.a,!0),2&e&&o.zc(n=o.hc())&&(t.submitButton=n.first)},decls:24,vars:15,consts:function(){return[[3,"modalRef"],["modal",""],[1,"modal-title"],[4,"ngTemplateOutlet"],[1,"modal-content"],["name","deletionForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"question"],[4,"ngIf","ngIfElse"],["noNames",""],[1,"form-group"],[1,"custom-control","custom-checkbox"],["type","checkbox","name","confirmation","id","confirmation","formControlName","confirmation","autofocus","",1,"custom-control-input"],["for","confirmation",1,"custom-control-label"],"Yes, I am sure.",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["deletionHeading",""],["manyNames",""],"Are you sure that you want to " + "\ufffd0\ufffd" + " " + "\ufffd#3\ufffd" + "" + "\ufffd1\ufffd" + "" + "\ufffd/#3\ufffd" + "?","Are you sure that you want to " + "\ufffd0\ufffd" + " the selected items?",[4,"ngFor","ngForOf"],"Are you sure that you want to " + "\ufffd0\ufffd" + " the selected " + "\ufffd1\ufffd" + "?"]},template:function(e,t){if(1&e&&(o.Sb(0,"cd-modal",0,1),o.Qb(2,2),o.Mc(3,b,1,0,"ng-container",3),o.Pb(),o.Qb(4,4),o.Sb(5,"form",5,6),o.Sb(7,"div",7),o.Mc(8,g,1,0,"ng-container",8),o.Sb(9,"div",9),o.Mc(10,w,4,2,"span",10),o.Mc(11,S,3,4,"ng-template",null,11,o.Nc),o.Mc(13,M,1,0,"ng-container",8),o.Sb(14,"div",12),o.Sb(15,"div",13),o.Nb(16,"input",14),o.Sb(17,"label",15),o.Wb(18,16),o.Rb(),o.Rb(),o.Rb(),o.Rb(),o.Rb(),o.Sb(19,"div",17),o.Sb(20,"cd-form-button-panel",18),o.gc("submitActionEvent",(function(){return t.callSubmitAction()})),o.jc(21,"titlecase"),o.Rb(),o.Rb(),o.Rb(),o.Pb(),o.Rb(),o.Mc(22,x,2,4,"ng-template",null,19,o.Nc)),2&e){const e=o.Ac(12),n=o.Ac(23);o.pc("modalRef",t.activeModal),o.yb(3),o.pc("ngTemplateOutlet",n),o.yb(2),o.pc("formGroup",t.deletionForm),o.yb(3),o.pc("ngTemplateOutlet",t.bodyTemplate)("ngTemplateOutletContext",t.bodyContext),o.yb(2),o.pc("ngIf",t.itemNames)("ngIfElse",e),o.yb(3),o.pc("ngTemplateOutlet",t.childFormGroupTemplate)("ngTemplateOutletContext",o.uc(13,k,t.deletionForm)),o.yb(7),o.pc("form",t.deletionForm)("submitText",o.kc(21,11,t.actionDescription)+" "+t.itemDescription)}},directives:[c.a,l.w,i.C,i.r,i.k,u.a,l.r,d.a,h.a,i.b,f.a,i.q,i.i,p.a,m.a,l.q],pipes:[l.A,l.o],styles:[".modal-body[_ngcontent-%COMP%]   .question[_ngcontent-%COMP%]{margin-top:1em}.modal-body[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:700}.modal-body[_ngcontent-%COMP%]   .question[_ngcontent-%COMP%]   .form-check[_ngcontent-%COMP%]{padding-top:7px}"]}),e})()},"07d7":function(e,t,n){var i=n("AO7/"),r=n("busE"),s=n("sEFX");i||r(Object.prototype,"toString",s,{unsafe:!0})},"0BK2":function(e,t){e.exports={}},"0Dky":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"0EUg":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("bHdf");function r(){return Object(i.a)(1)}},"0GbY":function(e,t,n){var i=n("Qo9l"),r=n("2oRo"),s=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?s(i[e])||s(r[e]):i[e]&&i[e][t]||r[e]&&r[e][t]}},"0eef":function(e,t,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!i.call({1:2},1);t.f=s?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},"0mo+":function(e,t,n){!function(e){"use strict";var t={1:"\u0f21",2:"\u0f22",3:"\u0f23",4:"\u0f24",5:"\u0f25",6:"\u0f26",7:"\u0f27",8:"\u0f28",9:"\u0f29",0:"\u0f20"},n={"\u0f21":"1","\u0f22":"2","\u0f23":"3","\u0f24":"4","\u0f25":"5","\u0f26":"6","\u0f27":"7","\u0f28":"8","\u0f29":"9","\u0f20":"0"};e.defineLocale("bo",{months:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f44\u0f0b\u0f54\u0f7c_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f66\u0f74\u0f58\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f5e\u0f72\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f63\u0f94\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0fb2\u0f74\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f62\u0f92\u0fb1\u0f51\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f42\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f45\u0f72\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54".split("_"),monthsShort:"\u0f5f\u0fb3\u0f0b1_\u0f5f\u0fb3\u0f0b2_\u0f5f\u0fb3\u0f0b3_\u0f5f\u0fb3\u0f0b4_\u0f5f\u0fb3\u0f0b5_\u0f5f\u0fb3\u0f0b6_\u0f5f\u0fb3\u0f0b7_\u0f5f\u0fb3\u0f0b8_\u0f5f\u0fb3\u0f0b9_\u0f5f\u0fb3\u0f0b10_\u0f5f\u0fb3\u0f0b11_\u0f5f\u0fb3\u0f0b12".split("_"),monthsShortRegex:/^(\u0f5f\u0fb3\u0f0b\d{1,2})/,monthsParseExact:!0,weekdays:"\u0f42\u0f5f\u0f60\u0f0b\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f42\u0f5f\u0f60\u0f0b\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysShort:"\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysMin:"\u0f49\u0f72_\u0f5f\u0fb3_\u0f58\u0f72\u0f42_\u0f63\u0fb7\u0f42_\u0f55\u0f74\u0f62_\u0f66\u0f44\u0f66_\u0f66\u0fa4\u0f7a\u0f53".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0f51\u0f72\u0f0b\u0f62\u0f72\u0f44] LT",nextDay:"[\u0f66\u0f44\u0f0b\u0f49\u0f72\u0f53] LT",nextWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f62\u0f97\u0f7a\u0f66\u0f0b\u0f58], LT",lastDay:"[\u0f41\u0f0b\u0f66\u0f44] LT",lastWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f58\u0f50\u0f60\u0f0b\u0f58] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0f63\u0f0b",past:"%s \u0f66\u0f94\u0f53\u0f0b\u0f63",s:"\u0f63\u0f58\u0f0b\u0f66\u0f44",ss:"%d \u0f66\u0f90\u0f62\u0f0b\u0f46\u0f0d",m:"\u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b\u0f42\u0f45\u0f72\u0f42",mm:"%d \u0f66\u0f90\u0f62\u0f0b\u0f58",h:"\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b\u0f42\u0f45\u0f72\u0f42",hh:"%d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51",d:"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f45\u0f72\u0f42",dd:"%d \u0f49\u0f72\u0f53\u0f0b",M:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f45\u0f72\u0f42",MM:"%d \u0f5f\u0fb3\u0f0b\u0f56",y:"\u0f63\u0f7c\u0f0b\u0f42\u0f45\u0f72\u0f42",yy:"%d \u0f63\u0f7c"},preparse:function(e){return e.replace(/[\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29\u0f20]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c|\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66|\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44|\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42|\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"===t&&e>=4||"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44"===t&&e<5||"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c":e<10?"\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66":e<17?"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44":e<20?"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42":"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"},week:{dow:0,doy:6}})}(n("wd/R"))},"0rvr":function(e,t,n){var i=n("glrk"),r=n("O741");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(s){}return function(n,s){return i(n),r(s),t?e.call(n,s):n.__proto__=s,n}}():void 0)},"0tRk":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_ter\xe7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xe1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xe1b".split("_"),weekdaysMin:"do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xe0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xe0s] HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",invalidDate:"Data inv\xe1lida"})}(n("wd/R"))},"14Sl":function(e,t,n){"use strict";n("rB9j");var i=n("busE"),r=n("kmMV"),s=n("0Dky"),o=n("tiKp"),a=n("kRJp"),c=o("species"),l=RegExp.prototype,u=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),d="$0"==="a".replace(/./,"$0"),h=o("replace"),f=!!/./[h]&&""===/./[h]("a","$0"),p=!s((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,h){var m=o(e),b=!s((function(){var t={};return t[m]=function(){return 7},7!=""[e](t)})),g=b&&!s((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[m]=/./[m]),n.exec=function(){return t=!0,null},n[m](""),!t}));if(!b||!g||"replace"===e&&(!u||!d||f)||"split"===e&&!p){var _=/./[m],y=n(m,""[e],(function(e,t,n,i,s){var o=t.exec;return o===r||o===l.exec?b&&!s?{done:!0,value:_.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}),{REPLACE_KEEPS_$0:d,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),v=y[1];i(String.prototype,e,y[0]),i(l,m,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}h&&a(l[m],"sham",!0)}},"1E5z":function(e,t,n){var i=n("m/L8").f,r=n("UTVS"),s=n("tiKp")("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,s)&&i(e,s,{configurable:!0,value:t})}},"1G5W":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("zx2A");function r(e){return t=>t.lift(new s(e))}class s{constructor(e){this.notifier=e}call(e,t){const n=new o(e),r=Object(i.c)(this.notifier,new i.a(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n}}class o extends i.b{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}},"1Ni5":function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return p}));var i=n("s7LF"),r=n("LvDl"),s=n.n(r),o=n("LRne"),a=n("PqYM"),c=n("aGrj"),l=n("lJxs"),u=n("IzEk"),d=n("Fgil"),h=n("aXbf");function f(e){return null==e||0===e.length}class p{static email(e){return f(e.value)?null:i.A.email(e)}static ip(e=0){const t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i,n=/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;return i.A.pattern(4===e?t:6===e?n:new RegExp(t.source+"|"+n.source))}static number(e=!0){return i.A.pattern(e?/^-?[0-9]+$/i:/^[0-9]+$/i)}static decimalNumber(e=!0){return i.A.pattern(e?/^-?[0-9]+(.[0-9]+)?$/i:/^[0-9]+(.[0-9]+)?$/i)}static sslCert(){return i.A.pattern(/^-----BEGIN CERTIFICATE-----(\n|\r|\f)((.+)?((\n|\r|\f).+)*)(\n|\r|\f)-----END CERTIFICATE-----[\n\r\f]*$/)}static sslPrivKey(){return i.A.pattern(/^-----BEGIN RSA PRIVATE KEY-----(\n|\r|\f)((.+)?((\n|\r|\f).+)*)(\n|\r|\f)-----END RSA PRIVATE KEY-----[\n\r\f]*$/)}static pemCert(){return i.A.pattern(/^-----BEGIN .+-----$.+^-----END .+-----$/ms)}static requiredIf(e,t){let n=!1;return i=>(!n&&i.parent&&(Object.keys(e).forEach(e=>{i.parent.get(e).valueChanges.subscribe(()=>{i.updateValueAndValidity({emitEvent:!1})})}),n=!0),Object.keys(e).every(t=>{if(!i.parent)return!1;const n=i.parent.get(t).value,r=e[t];if(s.a.isObjectLike(r)){let e=!1;switch(r.op){case"empty":e=s.a.isEmpty(n);break;case"!empty":e=!s.a.isEmpty(n);break;case"equal":e=n===r.arg1;break;case"!equal":e=n!==r.arg1;break;case"minLength":s.a.isString(n)&&(e=n.length>=r.arg1)}return e}return n===r})&&(s.a.isFunction(t)?t.call(t,i.value):f(i.value))?{required:!0}:null)}static composeIf(e,t){let n=!1;return r=>(!n&&r.parent&&(Object.keys(e).forEach(e=>{r.parent.get(e).valueChanges.subscribe(()=>{r.updateValueAndValidity({emitEvent:!1})})}),n=!0),Object.keys(e).every(t=>r.parent&&r.parent.get(t).value===e[t])?i.A.compose(t)(r):null)}static custom(e,t){return n=>{const i=t.call(this,n.value);return i?{[e]:i}:null}}static validateIf(e,t,n,r=[],s=[]){n=n.concat(r),e.setValidators(e=>t.call(this)?i.A.compose(n)(e):r.length>0?i.A.compose(r)(e):null),s.forEach(t=>{t.valueChanges.subscribe(()=>{e.updateValueAndValidity({emitEvent:!1})})})}static match(e,t){return n=>{const i=n.get(e),r=n.get(t);if(!i||!r)return null;if(i.value!==r.value)r.setErrors({match:!0});else if(r.hasError("match")){const e=r.errors;s.a.unset(e,"match"),r.setErrors(s.a.isEmpty(s.a.keys(e))?null:e)}return null}}static unique(e,t=null,n,i=!1){let r;return d=>d.pristine||f(d.value)?Object(o.a)(null):(r=d.value,s.a.isFunction(n)&&null!==n()&&""!==n()&&(r=i?`${d.value}$${n()}`:`${n()}$${d.value}`),Object(a.a)().pipe(Object(c.a)(e.call(t,r)),Object(l.a)(e=>e?{notUnique:!0}:null),Object(u.a)(1)))}static uuid(e=!1){const t=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return n=>n.pristine&&n.untouched?null:e||n.value?t.test(n.value)?null:{invalidUuid:"This is not a valid UUID"}:null}static binaryMin(e){return t=>{const n=new h.a,i=(new h.a).toBytes(t.value);if(e<=i)return null;const r=new d.a(n).transform(e);return{binaryMin:()=>"Size has to be at least " + r + " or more"}}}static binaryMax(e){return t=>{const n=new h.a,i=n.toBytes(t.value);if(e>=i)return null;const r=new d.a(n).transform(e);return{binaryMax:()=>"Size has to be at most " + r + " or less"}}}static passwordPolicy(e,t,n){return i=>{if(i.pristine||""===i.value)return s.a.isFunction(n)&&n(!0,0),Object(o.a)(null);let r;return s.a.isFunction(t)&&(r=t()),Object(a.a)(500).pipe(Object(c.a)(s.a.invoke(e,"validatePassword",i.value,r)),Object(l.a)(e=>(s.a.isFunction(n)&&n(e.valid,e.credits,e.valuation),e.valid?null:{passwordPolicy:!0})),Object(u.a)(1))}}}},"1Y/n":function(e,t,n){var i=n("HAuM"),r=n("ewvW"),s=n("RK3t"),o=n("UMSQ"),a=function(e){return function(t,n,a,c){i(n);var l=r(t),u=s(l),d=o(l.length),h=e?d-1:0,f=e?-1:1;if(a<2)for(;;){if(h in u){c=u[h],h+=f;break}if(h+=f,e?h<0:d<=h)throw TypeError("Reduce of empty array with no initial value")}for(;e?h>=0:d>h;h+=f)h in u&&(c=n(c,u[h],h,l));return c}};e.exports={left:a(!1),right:a(!0)}},"1nQr":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("LvDl"),r=n.n(i),s=n("lJxs"),o=n("20UP");class a{constructor(e){this.pwdPolicyEnabled=e.pwd_policy_enabled,this.pwdPolicyMinLength=e.pwd_policy_min_length,this.pwdPolicyCheckLengthEnabled=e.pwd_policy_check_length_enabled,this.pwdPolicyCheckOldpwdEnabled=e.pwd_policy_check_oldpwd_enabled,this.pwdPolicyCheckUsernameEnabled=e.pwd_policy_check_username_enabled,this.pwdPolicyCheckExclusionListEnabled=e.pwd_policy_check_exclusion_list_enabled,this.pwdPolicyCheckRepetitiveCharsEnabled=e.pwd_policy_check_repetitive_chars_enabled,this.pwdPolicyCheckSequentialCharsEnabled=e.pwd_policy_check_sequential_chars_enabled,this.pwdPolicyCheckComplexityEnabled=e.pwd_policy_check_complexity_enabled}}var c=n("8Y7J");let l=(()=>{class e{constructor(e){this.settingsService=e}getHelpText(){return this.settingsService.getStandardSettings().pipe(Object(s.a)(e=>{const t=new a(e);let n=[];if(t.pwdPolicyEnabled){n.push("Required rules for passwords:");const e={pwdPolicyCheckLengthEnabled:"Must contain at least " + t.pwdPolicyMinLength + " characters",pwdPolicyCheckOldpwdEnabled:"Must not be the same as the previous one",pwdPolicyCheckUsernameEnabled:"Cannot contain the username",pwdPolicyCheckExclusionListEnabled:"Cannot contain any configured keyword",pwdPolicyCheckRepetitiveCharsEnabled:"Cannot contain any repetitive characters e.g. \"aaa\"",pwdPolicyCheckSequentialCharsEnabled:"Cannot contain any sequential characters e.g. \"abc\"",pwdPolicyCheckComplexityEnabled:"Must consist of characters from the following groups:\n  * Alphabetic a-z, A-Z\n  * Numbers 0-9\n  * Special chars: !\"#$%& '()*+,-./:;<=>?@[\\]^_`{{|}}~\n  * Any other characters (signs)"};n=n.concat(r.a.keys(e).filter(e=>r.a.get(t,e)).map(t=>"- "+r.a.get(e,t)))}return n.join("\n")}))}mapCreditsToCssClass(e){let t="very-strong";return e<10?t="too-weak":e<15?t="weak":e<20?t="ok":e<25&&(t="strong"),t}}return e.\u0275fac=function(t){return new(t||e)(c.dc(o.a))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"1ppg":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"1rYy":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580\u056b_\u0583\u0565\u057f\u0580\u057e\u0561\u0580\u056b_\u0574\u0561\u0580\u057f\u056b_\u0561\u057a\u0580\u056b\u056c\u056b_\u0574\u0561\u0575\u056b\u057d\u056b_\u0570\u0578\u0582\u0576\u056b\u057d\u056b_\u0570\u0578\u0582\u056c\u056b\u057d\u056b_\u0585\u0563\u0578\u057d\u057f\u0578\u057d\u056b_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580\u056b_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b".split("_"),standalone:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580_\u0583\u0565\u057f\u0580\u057e\u0561\u0580_\u0574\u0561\u0580\u057f_\u0561\u057a\u0580\u056b\u056c_\u0574\u0561\u0575\u056b\u057d_\u0570\u0578\u0582\u0576\u056b\u057d_\u0570\u0578\u0582\u056c\u056b\u057d_\u0585\u0563\u0578\u057d\u057f\u0578\u057d_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580".split("_")},monthsShort:"\u0570\u0576\u057e_\u0583\u057f\u0580_\u0574\u0580\u057f_\u0561\u057a\u0580_\u0574\u0575\u057d_\u0570\u0576\u057d_\u0570\u056c\u057d_\u0585\u0563\u057d_\u057d\u057a\u057f_\u0570\u056f\u057f_\u0576\u0574\u0562_\u0564\u056f\u057f".split("_"),weekdays:"\u056f\u056b\u0580\u0561\u056f\u056b_\u0565\u0580\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b_\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0570\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b_\u0578\u0582\u0580\u0562\u0561\u0569_\u0577\u0561\u0562\u0561\u0569".split("_"),weekdaysShort:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),weekdaysMin:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0569.",LLL:"D MMMM YYYY \u0569., HH:mm",LLLL:"dddd, D MMMM YYYY \u0569., HH:mm"},calendar:{sameDay:"[\u0561\u0575\u057d\u0585\u0580] LT",nextDay:"[\u057e\u0561\u0572\u0568] LT",lastDay:"[\u0565\u0580\u0565\u056f] LT",nextWeek:function(){return"dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},lastWeek:function(){return"[\u0561\u0576\u0581\u0561\u056e] dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},sameElse:"L"},relativeTime:{future:"%s \u0570\u0565\u057f\u0578",past:"%s \u0561\u057c\u0561\u057b",s:"\u0574\u056b \u0584\u0561\u0576\u056b \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",ss:"%d \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",m:"\u0580\u0578\u057a\u0565",mm:"%d \u0580\u0578\u057a\u0565",h:"\u056a\u0561\u0574",hh:"%d \u056a\u0561\u0574",d:"\u0585\u0580",dd:"%d \u0585\u0580",M:"\u0561\u0574\u056b\u057d",MM:"%d \u0561\u0574\u056b\u057d",y:"\u057f\u0561\u0580\u056b",yy:"%d \u057f\u0561\u0580\u056b"},meridiemParse:/\u0563\u056b\u0577\u0565\u0580\u057e\u0561|\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561|\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576/,isPM:function(e){return/^(\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576)$/.test(e)},meridiem:function(e){return e<4?"\u0563\u056b\u0577\u0565\u0580\u057e\u0561":e<12?"\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561":e<17?"\u0581\u0565\u0580\u0565\u056f\u057e\u0561":"\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(\u056b\u0576|\u0580\u0564)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-\u056b\u0576":e+"-\u0580\u0564";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},"1xZ4":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_mar\xe7_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de mar\xe7_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[dem\xe0 a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},"20UP":function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("LvDl"),r=n.n(i),s=n("lJxs"),o=n("8Y7J"),a=n("IheW");let c=(()=>{class e{constructor(e){this.http=e,this.settings={}}getValues(e){return r.a.isArray(e)&&(e=e.join(",")),this.http.get("api/settings?names="+e).pipe(Object(s.a)(e=>{const t={};return r.a.forEach(e,e=>{r.a.set(t,e.name,e.value)}),t}))}ifSettingConfigured(e,t,n){const i=this.settings[e];void 0===i?this.http.get(e).subscribe(i=>{this.settings[e]=this.getSettingsValue(i),this.ifSettingConfigured(e,t,n)},t=>{401!==t.status&&(this.settings[e]="")}):""!==i?t(i):n&&n()}disableSetting(e){this.settings[e]=""}getSettingsValue(e){return e.value||e.instance||""}validateGrafanaDashboardUrl(e){return this.http.get("api/grafana/validation/"+e)}getStandardSettings(){return this.http.get("ui-api/standard_settings")}}return e.\u0275fac=function(t){return new(t||e)(o.dc(a.b))},e.\u0275prov=o.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"23KU":function(e,t,n){"use strict";var i=n("uE2L"),r=n("YHEm"),s=Object.prototype.hasOwnProperty;t.a=function(e,t,n){var o=e[t];s.call(e,t)&&Object(r.a)(o,n)&&(void 0!==n||t in e)||Object(i.a)(e,t,n)}},"25cm":function(e,t,n){"use strict";var i=n("tPH9"),r=n("/1FC");t.a=function(e,t,n){var s=t(e);return Object(r.a)(e)?s:Object(i.a)(s,n(e))}},"2EZI":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("s7LF"),r=n("QFaf"),s=n("8Y7J");let o=(()=>{class e extends i.g{group(e,t=null){const n=super.group(e,t);return new r.a(n.controls,n.validator,n.asyncValidator)}}return e.\u0275fac=function(t){return a(t||e)},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const a=s.Ub(o)},"2QA8":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())()},"2Vo4":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("XNiG"),r=n("9ppp");class s extends i.a{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new r.a;return this._value}next(e){super.next(this._value=e)}}},"2fFW":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));let i=!1;const r={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else i&&console.log("RxJS: Back to a better error behavior. Thank you. <3");i=e},get useDeprecatedSynchronousErrorHandling(){return i}}},"2fjn":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("wd/R"))},"2oRo":function(e,t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||function(){return this}()||Function("return this")()},"2ykv":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),i=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"3/ER":function(e,t,n){"use strict";(function(e){var i=n("Ju5/"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r?i.a.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,i=a?a(n):new e.constructor(n);return e.copy(i),i}}).call(this,n("3UD+")(e))},"33Wh":function(e,t,n){var i=n("yoRg"),r=n("eDl+");e.exports=Object.keys||function(e){return i(e,r)}},"3E0/":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("D0XW"),r=n("7o/Q"),s=n("WMd4");function o(e,t=i.a){var n;const r=(n=e)instanceof Date&&!isNaN(+n)?+e-t.now():Math.abs(e);return e=>e.lift(new a(r,t))}class a{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))}}class c extends r.a{constructor(e,t,n){super(e),this.delay=t,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,n=t.queue,i=e.scheduler,r=e.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const t=Math.max(0,n[0].time-i.now());this.schedule(e,t)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(c.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,n=new l(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(s.a.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(s.a.createComplete()),this.unsubscribe()}}class l{constructor(e,t){this.time=e,this.notification=t}}},"3E1r":function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"},i=[/^\u091c\u0928/i,/^\u092b\u093c\u0930|\u092b\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924\u0902|\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935|\u0928\u0935\u0902/i,/^\u0926\u093f\u0938\u0902|\u0926\u093f\u0938/i];e.defineLocale("hi",{months:{format:"\u091c\u0928\u0935\u0930\u0940_\u092b\u093c\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u092e\u094d\u092c\u0930_\u0926\u093f\u0938\u092e\u094d\u092c\u0930".split("_"),standalone:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u0902\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u0902\u092c\u0930_\u0926\u093f\u0938\u0902\u092c\u0930".split("_")},monthsShort:"\u091c\u0928._\u092b\u093c\u0930._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948._\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0905\u0917._\u0938\u093f\u0924._\u0905\u0915\u094d\u091f\u0942._\u0928\u0935._\u0926\u093f\u0938.".split("_"),weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0932\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0932_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u092c\u091c\u0947",LTS:"A h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A h:mm \u092c\u091c\u0947"},monthsParse:i,longMonthsParse:i,shortMonthsParse:[/^\u091c\u0928/i,/^\u092b\u093c\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935/i,/^\u0926\u093f\u0938/i],monthsRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsShortRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsStrictRegex:/^(\u091c\u0928\u0935\u0930\u0940?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908?|\u0905\u0917\u0938\u094d\u0924?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924?\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930?)/i,monthsShortStrictRegex:/^(\u091c\u0928\.?|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\.?|\u0905\u0917\.?|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\.?|\u0926\u093f\u0938\.?)/i,calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0915\u0932] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u0932] LT",lastWeek:"[\u092a\u093f\u091b\u0932\u0947] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u092e\u0947\u0902",past:"%s \u092a\u0939\u0932\u0947",s:"\u0915\u0941\u091b \u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0902\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u091f",mm:"%d \u092e\u093f\u0928\u091f",h:"\u090f\u0915 \u0918\u0902\u091f\u093e",hh:"%d \u0918\u0902\u091f\u0947",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u0940\u0928\u0947",MM:"%d \u092e\u0939\u0940\u0928\u0947",y:"\u090f\u0915 \u0935\u0930\u094d\u0937",yy:"%d \u0935\u0930\u094d\u0937"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0930\u093e\u0924|\u0938\u0941\u092c\u0939|\u0926\u094b\u092a\u0939\u0930|\u0936\u093e\u092e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924"===t?e<4?e:e+12:"\u0938\u0941\u092c\u0939"===t?e:"\u0926\u094b\u092a\u0939\u0930"===t?e>=10?e:e+12:"\u0936\u093e\u092e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924":e<10?"\u0938\u0941\u092c\u0939":e<17?"\u0926\u094b\u092a\u0939\u0930":e<20?"\u0936\u093e\u092e":"\u0930\u093e\u0924"},week:{dow:0,doy:6}})}(n("wd/R"))},"3N8a":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("quSY");class r extends i.a{constructor(e,t){super()}schedule(e,t=0){return this}}class s extends r{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,n=0){return setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n=!1,i=void 0;try{this.work(e)}catch(r){n=!0,i=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),i}_unsubscribe(){const e=this.id,t=this.scheduler,n=t.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}},"3UD+":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"3bBZ":function(e,t,n){var i=n("2oRo"),r=n("/byt"),s=n("4mDm"),o=n("kRJp"),a=n("tiKp"),c=a("iterator"),l=a("toStringTag"),u=s.values;for(var d in r){var h=i[d],f=h&&h.prototype;if(f){if(f[c]!==u)try{o(f,c,u)}catch(m){f[c]=u}if(f[l]||o(f,l,d),r[d])for(var p in s)if(f[p]!==s[p])try{o(f,p,s[p])}catch(m){f[p]=s[p]}}}},"3cmB":function(e,t,n){"use strict";var i=n("Y7yP"),r=n("Ju5/"),s=Object(i.a)(r.a,"Map");t.a=s},"4/q3":function(e,t,n){"use strict";var i=n("7gMY"),r=n("IzLi"),s=n("pyRK"),o=Object.prototype.hasOwnProperty,a=n("5WsY");t.a=function(e){return Object(a.a)(e)?Object(i.a)(e,!0):function(e){if(!Object(r.a)(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Object(s.a)(e),n=[];for(var i in e)("constructor"!=i||!t&&o.call(e,i))&&n.push(i);return n}(e)}},"4DD9":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){let t=!1;switch(e){case!0:case 1:case"y":case"yes":case"t":case"true":case"on":case"1":t=!0}return t}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"boolean",type:e,pure:!0}),e})()},"4I5i":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>{function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e})()},"4MV3":function(e,t,n){!function(e){"use strict";var t={1:"\u0ae7",2:"\u0ae8",3:"\u0ae9",4:"\u0aea",5:"\u0aeb",6:"\u0aec",7:"\u0aed",8:"\u0aee",9:"\u0aef",0:"\u0ae6"},n={"\u0ae7":"1","\u0ae8":"2","\u0ae9":"3","\u0aea":"4","\u0aeb":"5","\u0aec":"6","\u0aed":"7","\u0aee":"8","\u0aef":"9","\u0ae6":"0"};e.defineLocale("gu",{months:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0_\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0_\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2_\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe\u0a88_\u0a91\u0a97\u0ab8\u0acd\u0a9f_\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0a91\u0a95\u0acd\u0a9f\u0acd\u0aac\u0ab0_\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0".split("_"),monthsShort:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1._\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1._\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf._\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe._\u0a91\u0a97._\u0ab8\u0aaa\u0acd\u0a9f\u0ac7._\u0a91\u0a95\u0acd\u0a9f\u0acd._\u0aa8\u0ab5\u0ac7._\u0aa1\u0abf\u0ab8\u0ac7.".split("_"),monthsParseExact:!0,weekdays:"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0_\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0_\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0_\u0aac\u0ac1\u0aa7\u0acd\u0ab5\u0abe\u0ab0_\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0_\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0_\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0".split("_"),weekdaysShort:"\u0ab0\u0ab5\u0abf_\u0ab8\u0acb\u0aae_\u0aae\u0a82\u0a97\u0ab3_\u0aac\u0ac1\u0aa7\u0acd_\u0a97\u0ac1\u0ab0\u0ac1_\u0ab6\u0ac1\u0a95\u0acd\u0ab0_\u0ab6\u0aa8\u0abf".split("_"),weekdaysMin:"\u0ab0_\u0ab8\u0acb_\u0aae\u0a82_\u0aac\u0ac1_\u0a97\u0ac1_\u0ab6\u0ac1_\u0ab6".split("_"),longDateFormat:{LT:"A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LTS:"A h:mm:ss \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LLLL:"dddd, D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7"},calendar:{sameDay:"[\u0a86\u0a9c] LT",nextDay:"[\u0a95\u0abe\u0ab2\u0ac7] LT",nextWeek:"dddd, LT",lastDay:"[\u0a97\u0a87\u0a95\u0abe\u0ab2\u0ac7] LT",lastWeek:"[\u0aaa\u0abe\u0a9b\u0ab2\u0abe] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0aae\u0abe",past:"%s \u0aaa\u0ab9\u0ac7\u0ab2\u0abe",s:"\u0a85\u0aae\u0ac1\u0a95 \u0aaa\u0ab3\u0acb",ss:"%d \u0ab8\u0ac7\u0a95\u0a82\u0aa1",m:"\u0a8f\u0a95 \u0aae\u0abf\u0aa8\u0abf\u0a9f",mm:"%d \u0aae\u0abf\u0aa8\u0abf\u0a9f",h:"\u0a8f\u0a95 \u0a95\u0ab2\u0abe\u0a95",hh:"%d \u0a95\u0ab2\u0abe\u0a95",d:"\u0a8f\u0a95 \u0aa6\u0abf\u0ab5\u0ab8",dd:"%d \u0aa6\u0abf\u0ab5\u0ab8",M:"\u0a8f\u0a95 \u0aae\u0ab9\u0abf\u0aa8\u0acb",MM:"%d \u0aae\u0ab9\u0abf\u0aa8\u0acb",y:"\u0a8f\u0a95 \u0ab5\u0ab0\u0acd\u0ab7",yy:"%d \u0ab5\u0ab0\u0acd\u0ab7"},preparse:function(e){return e.replace(/[\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef\u0ae6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0ab0\u0abe\u0aa4|\u0aac\u0aaa\u0acb\u0ab0|\u0ab8\u0ab5\u0abe\u0ab0|\u0ab8\u0abe\u0a82\u0a9c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0ab0\u0abe\u0aa4"===t?e<4?e:e+12:"\u0ab8\u0ab5\u0abe\u0ab0"===t?e:"\u0aac\u0aaa\u0acb\u0ab0"===t?e>=10?e:e+12:"\u0ab8\u0abe\u0a82\u0a9c"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0ab0\u0abe\u0aa4":e<10?"\u0ab8\u0ab5\u0abe\u0ab0":e<17?"\u0aac\u0aaa\u0acb\u0ab0":e<20?"\u0ab8\u0abe\u0a82\u0a9c":"\u0ab0\u0abe\u0aa4"},week:{dow:0,doy:6}})}(n("wd/R"))},"4WOD":function(e,t,n){var i=n("UTVS"),r=n("ewvW"),s=n("93I0"),o=n("4Xet"),a=s("IE_PROTO"),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=r(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},"4Xet":function(e,t,n){var i=n("0Dky");e.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},"4dOw":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"4l63":function(e,t,n){var i=n("I+eb"),r=n("wg0c");i({global:!0,forced:parseInt!=r},{parseInt:r})},"4mDm":function(e,t,n){"use strict";var i=n("/GqU"),r=n("RNIs"),s=n("P4y1"),o=n("afO8"),a=n("fdAy"),c="Array Iterator",l=o.set,u=o.getterFor(c);e.exports=a(Array,"Array",(function(e,t){l(this,{type:c,target:i(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries")},"4syw":function(e,t,n){var i=n("busE");e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},"5+tZ":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("lJxs"),r=n("Cfvw"),s=n("zx2A");function o(e,t,n=Number.POSITIVE_INFINITY){return"function"==typeof t?s=>s.pipe(o((n,s)=>Object(r.a)(e(n,s)).pipe(Object(i.a)((e,i)=>t(n,e,s,i))),n)):("number"==typeof t&&(n=t),t=>t.lift(new a(e,n)))}class a{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new c(e,this.project,this.concurrent))}}class c extends s.b{constructor(e,t,n=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this.active++,this._innerSub(t)}_innerSub(e){const t=new s.a(this),n=this.destination;n.add(t);const i=Object(s.c)(e,t);i!==t&&n.add(i)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyComplete(){const e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}},"5WsY":function(e,t,n){"use strict";var i=n("vJtL"),r=n("Js68");t.a=function(e){return null!=e&&Object(r.a)(e.length)&&!Object(i.a)(e)}},"5yfJ":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("HDdC"),r=n("KqfI");const s=new i.a(r.a)},"6+QB":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},"6+kj":function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("8Y7J"),r=n("sne2"),s=n("JK/P"),o=n("sb0X"),a=n("SVse"),c=n("Z21x");function l(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-submit-button",2),i.gc("submitAction",(function(){return i.Dc(e),i.ic().submitAction()})),i.Oc(1),i.Rb()}if(2&e){const e=i.ic();i.pc("disabled",e.disabled)("form",e.form),i.yb(1),i.Pc(e.submitText)}}let u=(()=>{class e{constructor(e,t,n){this.location=e,this.actionLabels=t,this.modalService=n,this.submitActionEvent=new i.o,this.backActionEvent=new i.o,this.showSubmit=!0,this.wrappingClass="",this.btnClass="",this.submitText=this.actionLabels.CREATE,this.cancelText=this.actionLabels.CANCEL,this.disabled=!1}submitAction(){this.submitActionEvent.emit()}backAction(){0===this.backActionEvent.observers.length?this.modalService.hasOpenModals()?this.modalService.dismissAll():this.location.back():this.backActionEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(a.m),i.Mb(r.b),i.Mb(s.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-form-button-panel"]],viewQuery:function(e,t){var n;1&e&&i.Tc(o.a,!0),2&e&&i.zc(n=i.hc())&&(t.submitButton=n.first)},inputs:{form:"form",showSubmit:"showSubmit",wrappingClass:"wrappingClass",btnClass:"btnClass",submitText:"submitText",cancelText:"cancelText",disabled:"disabled"},outputs:{submitActionEvent:"submitActionEvent",backActionEvent:"backActionEvent"},decls:3,vars:4,consts:[[1,"m-2",3,"name","backAction"],["data-cy","submitBtn",3,"disabled","form","submitAction",4,"ngIf"],["data-cy","submitBtn",3,"disabled","form","submitAction"]],template:function(e,t){1&e&&(i.Sb(0,"div"),i.Sb(1,"cd-back-button",0),i.gc("backAction",(function(){return t.backAction()})),i.Rb(),i.Mc(2,l,2,3,"cd-submit-button",1),i.Rb()),2&e&&(i.Ab(t.wrappingClass),i.yb(1),i.pc("name",t.cancelText),i.yb(1),i.pc("ngIf",t.showSubmit))},directives:[c.a,a.r,o.a],styles:[""]}),e})()},"6B0Y":function(e,t,n){!function(e){"use strict";var t={1:"\u17e1",2:"\u17e2",3:"\u17e3",4:"\u17e4",5:"\u17e5",6:"\u17e6",7:"\u17e7",8:"\u17e8",9:"\u17e9",0:"\u17e0"},n={"\u17e1":"1","\u17e2":"2","\u17e3":"3","\u17e4":"4","\u17e5":"5","\u17e6":"6","\u17e7":"7","\u17e8":"8","\u17e9":"9","\u17e0":"0"};e.defineLocale("km",{months:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),monthsShort:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),weekdays:"\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799_\u1785\u17d0\u1793\u17d2\u1791_\u17a2\u1784\u17d2\u1782\u17b6\u179a_\u1796\u17bb\u1792_\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd_\u179f\u17bb\u1780\u17d2\u179a_\u179f\u17c5\u179a\u17cd".split("_"),weekdaysShort:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysMin:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u1796\u17d2\u179a\u17b9\u1780|\u179b\u17d2\u1784\u17b6\u1785/,isPM:function(e){return"\u179b\u17d2\u1784\u17b6\u1785"===e},meridiem:function(e,t,n){return e<12?"\u1796\u17d2\u179a\u17b9\u1780":"\u179b\u17d2\u1784\u17b6\u1785"},calendar:{sameDay:"[\u1790\u17d2\u1784\u17c3\u1793\u17c1\u17c7 \u1798\u17c9\u17c4\u1784] LT",nextDay:"[\u179f\u17d2\u17a2\u17c2\u1780 \u1798\u17c9\u17c4\u1784] LT",nextWeek:"dddd [\u1798\u17c9\u17c4\u1784] LT",lastDay:"[\u1798\u17d2\u179f\u17b7\u179b\u1798\u17b7\u1789 \u1798\u17c9\u17c4\u1784] LT",lastWeek:"dddd [\u179f\u1794\u17d2\u178f\u17b6\u17a0\u17cd\u1798\u17bb\u1793] [\u1798\u17c9\u17c4\u1784] LT",sameElse:"L"},relativeTime:{future:"%s\u1791\u17c0\u178f",past:"%s\u1798\u17bb\u1793",s:"\u1794\u17c9\u17bb\u1793\u17d2\u1798\u17b6\u1793\u179c\u17b7\u1793\u17b6\u1791\u17b8",ss:"%d \u179c\u17b7\u1793\u17b6\u1791\u17b8",m:"\u1798\u17bd\u1799\u1793\u17b6\u1791\u17b8",mm:"%d \u1793\u17b6\u1791\u17b8",h:"\u1798\u17bd\u1799\u1798\u17c9\u17c4\u1784",hh:"%d \u1798\u17c9\u17c4\u1784",d:"\u1798\u17bd\u1799\u1790\u17d2\u1784\u17c3",dd:"%d \u1790\u17d2\u1784\u17c3",M:"\u1798\u17bd\u1799\u1781\u17c2",MM:"%d \u1781\u17c2",y:"\u1798\u17bd\u1799\u1786\u17d2\u1793\u17b6\u17c6",yy:"%d \u1786\u17d2\u1793\u17b6\u17c6"},dayOfMonthOrdinalParse:/\u1791\u17b8\d{1,2}/,ordinal:"\u1791\u17b8%d",preparse:function(e){return e.replace(/[\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9\u17e0]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("wd/R"))},"6JNq":function(e,t,n){var i=n("UTVS"),r=n("Vu81"),s=n("Bs8V"),o=n("m/L8");e.exports=function(e,t){for(var n=r(t),a=o.f,c=s.f,l=0;l<n.length;l++){var u=n[l];i(e,u)||a(e,u,c(t,u))}}},"6LWA":function(e,t,n){var i=n("xrYK");e.exports=Array.isArray||function(e){return"Array"==i(e)}},"6VoE":function(e,t,n){var i=n("tiKp"),r=n("P4y1"),s=i("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[s]===e)}},"6qls":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("tz6c"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.docService=e,this.docText="documentation"}ngOnInit(){this.noSubscribe?this.docUrl=this.docService.urlGenerator(this.section):this.docService.subscribeOnce(this.section,e=>{this.docUrl=e})}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(i.a))},e.\u0275cmp=r.Gb({type:e,selectors:[["cd-doc"]],inputs:{section:"section",docText:"docText",noSubscribe:"noSubscribe"},decls:2,vars:2,consts:[["target","_blank",3,"href"]],template:function(e,t){1&e&&(r.Sb(0,"a",0),r.Oc(1),r.Rb()),2&e&&(r.qc("href",t.docUrl,r.Gc),r.yb(1),r.Pc(t.docText))},styles:[""]}),e})()},"7BjC":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["m\xf5ne sekundi","m\xf5ni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["\xfche minuti","\xfcks minut"],mm:[e+" minuti",e+" minutit"],h:["\xfche tunni","tund aega","\xfcks tund"],hh:[e+" tunni",e+" tundi"],d:["\xfche p\xe4eva","\xfcks p\xe4ev"],M:["kuu aja","kuu aega","\xfcks kuu"],MM:[e+" kuu",e+" kuud"],y:["\xfche aasta","aasta","\xfcks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:i?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_m\xe4rts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_m\xe4rts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"p\xfchap\xe4ev_esmasp\xe4ev_teisip\xe4ev_kolmap\xe4ev_neljap\xe4ev_reede_laup\xe4ev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[T\xe4na,] LT",nextDay:"[Homme,] LT",nextWeek:"[J\xe4rgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s p\xe4rast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d p\xe4eva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"7C5Q":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("wd/R"))},"7aV9":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"\u0da2\u0db1\u0dc0\u0dcf\u0dbb\u0dd2_\u0db4\u0dd9\u0db6\u0dbb\u0dc0\u0dcf\u0dbb\u0dd2_\u0db8\u0dcf\u0dbb\u0dca\u0dad\u0dd4_\u0d85\u0db4\u0dca\u200d\u0dbb\u0dda\u0dbd\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd\u0dc3\u0dca\u0dad\u0dd4_\u0dc3\u0dd0\u0db4\u0dca\u0dad\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0d94\u0d9a\u0dca\u0dad\u0ddd\u0db6\u0dbb\u0dca_\u0db1\u0ddc\u0dc0\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0daf\u0dd9\u0dc3\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca".split("_"),monthsShort:"\u0da2\u0db1_\u0db4\u0dd9\u0db6_\u0db8\u0dcf\u0dbb\u0dca_\u0d85\u0db4\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd_\u0dc3\u0dd0\u0db4\u0dca_\u0d94\u0d9a\u0dca_\u0db1\u0ddc\u0dc0\u0dd0_\u0daf\u0dd9\u0dc3\u0dd0".split("_"),weekdays:"\u0d89\u0dbb\u0dd2\u0daf\u0dcf_\u0dc3\u0db3\u0dd4\u0daf\u0dcf_\u0d85\u0d9f\u0dc4\u0dbb\u0dd4\u0dc0\u0dcf\u0daf\u0dcf_\u0db6\u0daf\u0dcf\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca\u0db4\u0dad\u0dd2\u0db1\u0dca\u0daf\u0dcf_\u0dc3\u0dd2\u0d9a\u0dd4\u0dbb\u0dcf\u0daf\u0dcf_\u0dc3\u0dd9\u0db1\u0dc3\u0dd4\u0dbb\u0dcf\u0daf\u0dcf".split("_"),weekdaysShort:"\u0d89\u0dbb\u0dd2_\u0dc3\u0db3\u0dd4_\u0d85\u0d9f_\u0db6\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4_\u0dc3\u0dd2\u0d9a\u0dd4_\u0dc3\u0dd9\u0db1".split("_"),weekdaysMin:"\u0d89_\u0dc3_\u0d85_\u0db6_\u0db6\u0dca\u200d\u0dbb_\u0dc3\u0dd2_\u0dc3\u0dd9".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [\u0dc0\u0dd0\u0db1\u0dd2] dddd, a h:mm:ss"},calendar:{sameDay:"[\u0d85\u0daf] LT[\u0da7]",nextDay:"[\u0dc4\u0dd9\u0da7] LT[\u0da7]",nextWeek:"dddd LT[\u0da7]",lastDay:"[\u0d8a\u0dba\u0dda] LT[\u0da7]",lastWeek:"[\u0db4\u0dc3\u0dd4\u0d9c\u0dd2\u0dba] dddd LT[\u0da7]",sameElse:"L"},relativeTime:{future:"%s\u0d9a\u0dd2\u0db1\u0dca",past:"%s\u0d9a\u0da7 \u0db4\u0dd9\u0dbb",s:"\u0dad\u0dad\u0dca\u0db4\u0dbb \u0d9a\u0dd2\u0dc4\u0dd2\u0db4\u0dba",ss:"\u0dad\u0dad\u0dca\u0db4\u0dbb %d",m:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4\u0dc0",mm:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4 %d",h:"\u0db4\u0dd0\u0dba",hh:"\u0db4\u0dd0\u0dba %d",d:"\u0daf\u0dd2\u0db1\u0dba",dd:"\u0daf\u0dd2\u0db1 %d",M:"\u0db8\u0dcf\u0dc3\u0dba",MM:"\u0db8\u0dcf\u0dc3 %d",y:"\u0dc0\u0dc3\u0dbb",yy:"\u0dc0\u0dc3\u0dbb %d"},dayOfMonthOrdinalParse:/\d{1,2} \u0dc0\u0dd0\u0db1\u0dd2/,ordinal:function(e){return e+" \u0dc0\u0dd0\u0db1\u0dd2"},meridiemParse:/\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4|\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4|\u0db4\u0dd9.\u0dc0|\u0db4.\u0dc0./,isPM:function(e){return"\u0db4.\u0dc0."===e||"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4"===e},meridiem:function(e,t,n){return e>11?n?"\u0db4.\u0dc0.":"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4":n?"\u0db4\u0dd9.\u0dc0.":"\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4"}})}(n("wd/R"))},"7gMY":function(e,t,n){"use strict";var i=n("9f76"),r=n("/1FC"),s=n("WOAq"),o=n("cSlR"),a=n("oYcn"),c=Object.prototype.hasOwnProperty;t.a=function(e,t){var n=Object(r.a)(e),l=!n&&Object(i.a)(e),u=!n&&!l&&Object(s.a)(e),d=!n&&!l&&!u&&Object(a.a)(e),h=n||l||u||d,f=h?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],p=f.length;for(var m in e)!t&&!c.call(e,m)||h&&("length"==m||u&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||Object(o.a)(m,p))||f.push(m);return f}},"7o/Q":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("n6bG"),r=n("gRHU"),s=n("quSY"),o=n("2QA8"),a=n("2fFW"),c=n("NJ4a");class l extends s.a{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=r.a;break;case 1:if(!e){this.destination=r.a;break}if("object"==typeof e){e instanceof l?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new u(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new u(this,e,t,n)}}[o.a](){return this}static create(e,t,n){const i=new l(e,t,n);return i.syncErrorThrowable=!1,i}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class u extends l{constructor(e,t,n,s){let o;super(),this._parentSubscriber=e;let a=this;Object(i.a)(t)?o=t:t&&(o=t.next,n=t.error,s=t.complete,t!==r.a&&(a=Object.create(t),Object(i.a)(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this))),this._context=a,this._next=o,this._error=n,this._complete=s}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;a.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=a.a;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(c.a)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(c.a)(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),a.a.useDeprecatedSynchronousErrorHandling)throw n;Object(c.a)(n)}}__tryOrSetError(e,t,n){if(!a.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(i){return a.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=i,e.syncErrorThrown=!0,!0):(Object(c.a)(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}},"8/+R":function(e,t,n){!function(e){"use strict";var t={1:"\u0a67",2:"\u0a68",3:"\u0a69",4:"\u0a6a",5:"\u0a6b",6:"\u0a6c",7:"\u0a6d",8:"\u0a6e",9:"\u0a6f",0:"\u0a66"},n={"\u0a67":"1","\u0a68":"2","\u0a69":"3","\u0a6a":"4","\u0a6b":"5","\u0a6c":"6","\u0a6d":"7","\u0a6e":"8","\u0a6f":"9","\u0a66":"0"};e.defineLocale("pa-in",{months:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),monthsShort:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),weekdays:"\u0a10\u0a24\u0a35\u0a3e\u0a30_\u0a38\u0a4b\u0a2e\u0a35\u0a3e\u0a30_\u0a2e\u0a70\u0a17\u0a32\u0a35\u0a3e\u0a30_\u0a2c\u0a41\u0a27\u0a35\u0a3e\u0a30_\u0a35\u0a40\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a28\u0a40\u0a1a\u0a30\u0a35\u0a3e\u0a30".split("_"),weekdaysShort:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),weekdaysMin:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),longDateFormat:{LT:"A h:mm \u0a35\u0a1c\u0a47",LTS:"A h:mm:ss \u0a35\u0a1c\u0a47",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47",LLLL:"dddd, D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47"},calendar:{sameDay:"[\u0a05\u0a1c] LT",nextDay:"[\u0a15\u0a32] LT",nextWeek:"[\u0a05\u0a17\u0a32\u0a3e] dddd, LT",lastDay:"[\u0a15\u0a32] LT",lastWeek:"[\u0a2a\u0a3f\u0a1b\u0a32\u0a47] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0a35\u0a3f\u0a71\u0a1a",past:"%s \u0a2a\u0a3f\u0a1b\u0a32\u0a47",s:"\u0a15\u0a41\u0a1d \u0a38\u0a15\u0a3f\u0a70\u0a1f",ss:"%d \u0a38\u0a15\u0a3f\u0a70\u0a1f",m:"\u0a07\u0a15 \u0a2e\u0a3f\u0a70\u0a1f",mm:"%d \u0a2e\u0a3f\u0a70\u0a1f",h:"\u0a07\u0a71\u0a15 \u0a18\u0a70\u0a1f\u0a3e",hh:"%d \u0a18\u0a70\u0a1f\u0a47",d:"\u0a07\u0a71\u0a15 \u0a26\u0a3f\u0a28",dd:"%d \u0a26\u0a3f\u0a28",M:"\u0a07\u0a71\u0a15 \u0a2e\u0a39\u0a40\u0a28\u0a3e",MM:"%d \u0a2e\u0a39\u0a40\u0a28\u0a47",y:"\u0a07\u0a71\u0a15 \u0a38\u0a3e\u0a32",yy:"%d \u0a38\u0a3e\u0a32"},preparse:function(e){return e.replace(/[\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f\u0a66]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0a30\u0a3e\u0a24|\u0a38\u0a35\u0a47\u0a30|\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30|\u0a38\u0a3c\u0a3e\u0a2e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0a30\u0a3e\u0a24"===t?e<4?e:e+12:"\u0a38\u0a35\u0a47\u0a30"===t?e:"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30"===t?e>=10?e:e+12:"\u0a38\u0a3c\u0a3e\u0a2e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0a30\u0a3e\u0a24":e<10?"\u0a38\u0a35\u0a47\u0a30":e<17?"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30":e<20?"\u0a38\u0a3c\u0a3e\u0a2e":"\u0a30\u0a3e\u0a24"},week:{dow:0,doy:6}})}(n("wd/R"))},"85J/":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=/ceph version\s+([^ ]+)\s+\(.+\)/.exec(e);return t?t[1]:e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"cephShortVersion",type:e,pure:!0}),e})()},"8M4i":function(e,t,n){"use strict";var i=n("ylTp"),r=Object.prototype,s=r.hasOwnProperty,o=r.toString,a=i.a?i.a.toStringTag:void 0,c=Object.prototype.toString,l=i.a?i.a.toStringTag:void 0;t.a=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var i=!0}catch(c){}var r=o.call(e);return i&&(t?e[a]=n:delete e[a]),r}(e):function(e){return c.call(e)}(e)}},"8Y7J":function(e,t,n){"use strict";n.d(t,"a",(function(){return Is})),n.d(t,"b",(function(){return eu})),n.d(t,"c",(function(){return Jl})),n.d(t,"d",(function(){return Gl})),n.d(t,"e",(function(){return ql})),n.d(t,"f",(function(){return Vu})),n.d(t,"g",(function(){return Iu})),n.d(t,"h",(function(){return bs})),n.d(t,"i",(function(){return du})),n.d(t,"j",(function(){return _a})),n.d(t,"k",(function(){return ma})),n.d(t,"l",(function(){return iu})),n.d(t,"m",(function(){return ya})),n.d(t,"n",(function(){return En})),n.d(t,"o",(function(){return Ml})),n.d(t,"p",(function(){return G})),n.d(t,"q",(function(){return d})),n.d(t,"r",(function(){return U})),n.d(t,"s",(function(){return As})),n.d(t,"t",(function(){return Fa})),n.d(t,"u",(function(){return Ya})),n.d(t,"v",(function(){return nu})),n.d(t,"w",(function(){return ce})),n.d(t,"x",(function(){return ju})),n.d(t,"y",(function(){return ae})),n.d(t,"z",(function(){return Ou})),n.d(t,"A",(function(){return pu})),n.d(t,"B",(function(){return h})),n.d(t,"C",(function(){return Xl})),n.d(t,"D",(function(){return Zl})),n.d(t,"E",(function(){return Ma})),n.d(t,"F",(function(){return wa})),n.d(t,"G",(function(){return Sa})),n.d(t,"H",(function(){return ka})),n.d(t,"I",(function(){return Si})),n.d(t,"J",(function(){return p})),n.d(t,"K",(function(){return Yu})),n.d(t,"L",(function(){return Wa})),n.d(t,"M",(function(){return Su})),n.d(t,"N",(function(){return _s})),n.d(t,"O",(function(){return Da})),n.d(t,"P",(function(){return Ba})),n.d(t,"Q",(function(){return _e})),n.d(t,"R",(function(){return Ru})),n.d(t,"S",(function(){return Qn})),n.d(t,"T",(function(){return L})),n.d(t,"U",(function(){return Jn})),n.d(t,"V",(function(){return Hu})),n.d(t,"W",(function(){return ku})),n.d(t,"X",(function(){return tu})),n.d(t,"Y",(function(){return ys})),n.d(t,"Z",(function(){return ac})),n.d(t,"ab",(function(){return vi})),n.d(t,"bb",(function(){return ni})),n.d(t,"cb",(function(){return zn})),n.d(t,"db",(function(){return Hn})),n.d(t,"eb",(function(){return Un})),n.d(t,"fb",(function(){return Vn})),n.d(t,"gb",(function(){return Wn})),n.d(t,"hb",(function(){return Bn})),n.d(t,"ib",(function(){return ic})),n.d(t,"jb",(function(){return $u})),n.d(t,"kb",(function(){return rc})),n.d(t,"lb",(function(){return sc})),n.d(t,"mb",(function(){return $n})),n.d(t,"nb",(function(){return F})),n.d(t,"ob",(function(){return Bs})),n.d(t,"pb",(function(){return go})),n.d(t,"qb",(function(){return bo})),n.d(t,"rb",(function(){return nc})),n.d(t,"sb",(function(){return Qe})),n.d(t,"tb",(function(){return C})),n.d(t,"ub",(function(){return Yn})),n.d(t,"vb",(function(){return Ns})),n.d(t,"wb",(function(){return Ve})),n.d(t,"xb",(function(){return pa})),n.d(t,"yb",(function(){return Bi})),n.d(t,"zb",(function(){return Xs})),n.d(t,"Ab",(function(){return Yo})),n.d(t,"Bb",(function(){return na})),n.d(t,"Cb",(function(){return ia})),n.d(t,"Db",(function(){return ra})),n.d(t,"Eb",(function(){return Fo})),n.d(t,"Fb",(function(){return Fl})),n.d(t,"Gb",(function(){return Se})),n.d(t,"Hb",(function(){return Oe})),n.d(t,"Ib",(function(){return _})),n.d(t,"Jb",(function(){return y})),n.d(t,"Kb",(function(){return De})),n.d(t,"Lb",(function(){return Re})),n.d(t,"Mb",(function(){return ro})),n.d(t,"Nb",(function(){return uo})),n.d(t,"Ob",(function(){return po})),n.d(t,"Pb",(function(){return fo})),n.d(t,"Qb",(function(){return ho})),n.d(t,"Rb",(function(){return lo})),n.d(t,"Sb",(function(){return co})),n.d(t,"Tb",(function(){return mo})),n.d(t,"Ub",(function(){return Cn})),n.d(t,"Vb",(function(){return sa})),n.d(t,"Wb",(function(){return Xc})),n.d(t,"Xb",(function(){return nl})),n.d(t,"Yb",(function(){return el})),n.d(t,"Zb",(function(){return Zc})),n.d(t,"ac",(function(){return tl})),n.d(t,"bc",(function(){return il})),n.d(t,"cc",(function(){return Kc})),n.d(t,"dc",(function(){return ie})),n.d(t,"ec",(function(){return so})),n.d(t,"fc",(function(){return Ul})),n.d(t,"gc",(function(){return _o})),n.d(t,"hc",(function(){return $l})),n.d(t,"ic",(function(){return wo})),n.d(t,"jc",(function(){return gl})),n.d(t,"kc",(function(){return _l})),n.d(t,"lc",(function(){return yl})),n.d(t,"mc",(function(){return vl})),n.d(t,"nc",(function(){return Do})),n.d(t,"oc",(function(){return Mo})),n.d(t,"pc",(function(){return oo})),n.d(t,"qc",(function(){return To})),n.d(t,"rc",(function(){return Co})),n.d(t,"sc",(function(){return Oo})),n.d(t,"tc",(function(){return al})),n.d(t,"uc",(function(){return cl})),n.d(t,"vc",(function(){return ll})),n.d(t,"wc",(function(){return ul})),n.d(t,"xc",(function(){return dl})),n.d(t,"yc",(function(){return hl})),n.d(t,"zc",(function(){return Il})),n.d(t,"Ac",(function(){return io})),n.d(t,"Bc",(function(){return ln})),n.d(t,"Cc",(function(){return cn})),n.d(t,"Dc",(function(){return bt})),n.d(t,"Ec",(function(){return Mi})),n.d(t,"Fc",(function(){return ki})),n.d(t,"Gc",(function(){return xi})),n.d(t,"Hc",(function(){return Te})),n.d(t,"Ic",(function(){return Yl})),n.d(t,"Jc",(function(){return Pl})),n.d(t,"Kc",(function(){return No})),n.d(t,"Lc",(function(){return oa})),n.d(t,"Mc",(function(){return no})),n.d(t,"Nc",(function(){return Bl})),n.d(t,"Oc",(function(){return Ko})),n.d(t,"Pc",(function(){return Zo})),n.d(t,"Qc",(function(){return Xo})),n.d(t,"Rc",(function(){return ea})),n.d(t,"Sc",(function(){return ta})),n.d(t,"Tc",(function(){return jl}));var i=n("XNiG"),r=n("quSY"),s=n("HDdC"),o=n("VRyK"),a=n("w1tV");function c(e){return{toString:e}.toString()}const l="__parameters__";function u(e,t,n){return c(()=>{const i=function(e){return function(...t){if(e){const n=e(...t);for(const e in n)this[e]=n[e]}}}(t);function r(...e){if(this instanceof r)return i.apply(this,e),this;const t=new r(...e);return n.annotation=t,n;function n(e,n,i){const r=e.hasOwnProperty(l)?e[l]:Object.defineProperty(e,l,{value:[]})[l];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(t),e}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r})}const d=u("Inject",e=>({token:e})),h=u("Optional"),f=u("Self"),p=u("SkipSelf");var m=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});function b(e){for(let t in e)if(e[t]===b)return t;throw Error("Could not find renamed property on target object.")}function g(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function _(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function y(e){return{factory:e.factory,providers:e.providers||[],imports:e.imports||[]}}function v(e){return w(e,e[M])||w(e,e[D])}function w(e,t){return t&&t.token===e?t:null}function S(e){return e&&(e.hasOwnProperty(x)||e.hasOwnProperty(T))?e[x]:null}const M=b({"\u0275prov":b}),x=b({"\u0275inj":b}),k=b({"\u0275provFallback":b}),D=b({ngInjectableDef:b}),T=b({ngInjectorDef:b});function C(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(C).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function O(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const R=b({__forward_ref__:b});function L(e){return e.__forward_ref__=L,e.toString=function(){return C(this())},e}function E(e){return A(e)?e():e}function A(e){return"function"==typeof e&&e.hasOwnProperty(R)&&e.__forward_ref__===L}const I="undefined"!=typeof globalThis&&globalThis,P="undefined"!=typeof window&&window,j="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,N="undefined"!=typeof global&&global,F=I||N||P||j,Y=b({"\u0275cmp":b}),z=b({"\u0275dir":b}),$=b({"\u0275pipe":b}),H=b({"\u0275mod":b}),W=b({"\u0275loc":b}),V=b({"\u0275fac":b}),B=b({__NG_ELEMENT_ID__:b});class U{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=_({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return"InjectionToken "+this._desc}}const G=new U("INJECTOR",-1),q={},J=/\n/gm,Q="__source",K=b({provide:String,useValue:b});let Z,X=void 0;function ee(e){const t=X;return X=e,t}function te(e){const t=Z;return Z=e,t}function ne(e,t=m.Default){if(void 0===X)throw new Error("inject() must be called from an injection context");return null===X?re(e,void 0,t):X.get(e,t&m.Optional?null:void 0,t)}function ie(e,t=m.Default){return(Z||ne)(E(e),t)}function re(e,t,n){const i=v(e);if(i&&"root"==i.providedIn)return void 0===i.value?i.value=i.factory():i.value;if(n&m.Optional)return null;if(void 0!==t)return t;throw new Error(`Injector: NOT_FOUND [${C(e)}]`)}function se(e){const t=[];for(let n=0;n<e.length;n++){const i=E(e[n]);if(Array.isArray(i)){if(0===i.length)throw new Error("Arguments array must have arguments.");let e=void 0,n=m.Default;for(let t=0;t<i.length;t++){const r=i[t];r instanceof h||"Optional"===r.ngMetadataName||r===h?n|=m.Optional:r instanceof p||"SkipSelf"===r.ngMetadataName||r===p?n|=m.SkipSelf:r instanceof f||"Self"===r.ngMetadataName||r===f?n|=m.Self:e=r instanceof d||r===d?r.token:r}t.push(ie(e,n))}else t.push(ie(i))}return t}class oe{get(e,t=q){if(t===q){const t=new Error(`NullInjectorError: No provider for ${C(e)}!`);throw t.name="NullInjectorError",t}return t}}class ae{}class ce{}function le(e,t){for(let n=0;n<e.length;n++)t.push(e[n])}function ue(e,t){e.forEach(e=>Array.isArray(e)?ue(e,t):t(e))}function de(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function he(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function fe(e,t){const n=[];for(let i=0;i<e;i++)n.push(t);return n}function pe(e,t,n){let i=be(e,t);return i>=0?e[1|i]=n:(i=~i,function(e,t,n,i){let r=e.length;if(r==t)e.push(n,i);else if(1===r)e.push(i,e[0]),e[0]=n;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=n,e[t+1]=i}}(e,i,t,n)),i}function me(e,t){const n=be(e,t);if(n>=0)return e[1|n]}function be(e,t){return function(e,t,n){let i=0,r=e.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=e[n<<1];if(t===s)return n<<1;s>t?r=n:i=n+1}return~(r<<1)}(e,t)}var ge=function(e){return e[e.OnPush=0]="OnPush",e[e.Default=1]="Default",e}({}),_e=function(e){return e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({});const ye={},ve=[];let we=0;function Se(e){return c(()=>{const t={},n={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===ge.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||ve,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||_e.Emulated,id:"c",styles:e.styles||ve,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,s=e.pipes;return n.id+=we++,n.inputs=Ce(e.inputs,t),n.outputs=Ce(e.outputs),r&&r.forEach(e=>e(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(Me):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(xe):null,n})}function Me(e){return Le(e)||function(e){return e[z]||null}(e)}function xe(e){return function(e){return e[$]||null}(e)}const ke={};function De(e){const t={type:e.type,bootstrap:e.bootstrap||ve,declarations:e.declarations||ve,imports:e.imports||ve,exports:e.exports||ve,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&c(()=>{ke[e.id]=e.type}),t}function Te(e,t){return c(()=>{const n=Ae(e,!0);n.declarations=t.declarations||ve,n.imports=t.imports||ve,n.exports=t.exports||ve})}function Ce(e,t){if(null==e)return ye;const n={};for(const i in e)if(e.hasOwnProperty(i)){let r=e[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,t&&(t[r]=s)}return n}const Oe=Se;function Re(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Le(e){return e[Y]||null}function Ee(e,t){return e.hasOwnProperty(V)?e[V]:null}function Ae(e,t){const n=e[H]||null;if(!n&&!0===t)throw new Error(`Type ${C(e)} does not have '\u0275mod' property.`);return n}const Ie=20,Pe=10;function je(e){return Array.isArray(e)&&"object"==typeof e[1]}function Ne(e){return Array.isArray(e)&&!0===e[1]}function Fe(e){return 0!=(8&e.flags)}function Ye(e){return 2==(2&e.flags)}function ze(e){return 1==(1&e.flags)}function $e(e){return null!==e.template}function He(e){return 0!=(512&e[2])}class We{constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}}function Ve(){return Be}function Be(e){return e.type.prototype.ngOnChanges&&(e.setInput=Ge),Ue}function Ue(){const e=qe(this),t=null==e?void 0:e.current;if(t){const n=e.previous;if(n===ye)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}}function Ge(e,t,n,i){const r=qe(e)||function(e,t){return e.__ngSimpleChanges__=t}(e,{previous:ye,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],c=o[a];s[a]=new We(c&&c.currentValue,t,o===ye),e[i]=t}function qe(e){return e.__ngSimpleChanges__||null}Ve.ngInherit=!0;let Je=void 0;function Qe(e){Je=e}function Ke(){return void 0!==Je?Je:"undefined"!=typeof document?document:void 0}function Ze(e){return!!e.listen}const Xe={createRenderer:(e,t)=>Ke()};function et(e){for(;Array.isArray(e);)e=e[0];return e}function tt(e,t){return et(t[e+Ie])}function nt(e,t){return et(t[e.index])}function it(e,t){return e.data[t+Ie]}function rt(e,t){return e[t+Ie]}function st(e,t){const n=t[e];return je(n)?n:n[0]}function ot(e){const t=function(e){return e.__ngContext__||null}(e);return t?Array.isArray(t)?t:t.lView:null}function at(e){return 4==(4&e[2])}function ct(e){return 128==(128&e[2])}function lt(e,t){return null===e||null==t?null:e[t]}function ut(e){e[18]=0}function dt(e,t){e[5]+=t;let n=e,i=e[3];for(;null!==i&&(1===t&&1===n[5]||-1===t&&0===n[5]);)i[5]+=t,n=i,i=i[3]}const ht={lFrame:Pt(null),bindingsEnabled:!0,checkNoChangesMode:!1};function ft(){return ht.bindingsEnabled}function pt(){return ht.lFrame.lView}function mt(){return ht.lFrame.tView}function bt(e){ht.lFrame.contextLView=e}function gt(){return ht.lFrame.currentTNode}function _t(e,t){ht.lFrame.currentTNode=e,ht.lFrame.isParent=t}function yt(){return ht.lFrame.isParent}function vt(){ht.lFrame.isParent=!1}function wt(){return ht.checkNoChangesMode}function St(e){ht.checkNoChangesMode=e}function Mt(){const e=ht.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function xt(){return ht.lFrame.bindingIndex}function kt(){return ht.lFrame.bindingIndex++}function Dt(e){const t=ht.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Tt(e,t){const n=ht.lFrame;n.bindingIndex=n.bindingRootIndex=e,Ct(t)}function Ct(e){ht.lFrame.currentDirectiveIndex=e}function Ot(e){const t=ht.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function Rt(){return ht.lFrame.currentQueryIndex}function Lt(e){ht.lFrame.currentQueryIndex=e}function Et(e,t){const n=It();ht.lFrame=n,n.currentTNode=t,n.lView=e}function At(e){const t=It(),n=e[1];ht.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex}function It(){const e=ht.lFrame,t=null===e?null:e.child;return null===t?Pt(e):t}function Pt(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:0,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null};return null!==e&&(e.child=t),t}function jt(){const e=ht.lFrame;return ht.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const Nt=jt;function Ft(){const e=jt();e.isParent=!0,e.tView=null,e.selectedIndex=0,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Yt(){return ht.lFrame.selectedIndex}function zt(e){ht.lFrame.selectedIndex=e}function $t(){const e=ht.lFrame;return it(e.tView,e.selectedIndex)}function Ht(e,t){for(let n=t.directiveStart,i=t.directiveEnd;n<i;n++){const t=e.data[n].type.prototype,{ngAfterContentInit:i,ngAfterContentChecked:r,ngAfterViewInit:s,ngAfterViewChecked:o,ngOnDestroy:a}=t;i&&(e.contentHooks||(e.contentHooks=[])).push(-n,i),r&&((e.contentHooks||(e.contentHooks=[])).push(n,r),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(n,r)),s&&(e.viewHooks||(e.viewHooks=[])).push(-n,s),o&&((e.viewHooks||(e.viewHooks=[])).push(n,o),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(n,o)),null!=a&&(e.destroyHooks||(e.destroyHooks=[])).push(n,a)}}function Wt(e,t,n){Ut(e,t,3,n)}function Vt(e,t,n,i){(3&e[2])===n&&Ut(e,t,n,i)}function Bt(e,t){let n=e[2];(3&n)===t&&(n&=2047,n+=1,e[2]=n)}function Ut(e,t,n,i){const r=null!=i?i:-1;let s=0;for(let o=void 0!==i?65535&e[18]:0;o<t.length;o++)if("number"==typeof t[o+1]){if(s=t[o],null!=i&&s>=i)break}else t[o]<0&&(e[18]+=65536),(s<r||-1==r)&&(Gt(e,n,t,o),e[18]=(4294901760&e[18])+o+2),o++}function Gt(e,t,n,i){const r=n[i]<0,s=n[i+1],o=e[r?-n[i]:n[i]];r?e[2]>>11<e[18]>>16&&(3&e[2])===t&&(e[2]+=2048,s.call(o)):s.call(o)}const qt=-1;class Jt{constructor(e,t,n){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=n}}function Qt(e,t,n){const i=Ze(e);let r=0;for(;r<n.length;){const s=n[r];if("number"==typeof s){if(0!==s)break;r++;const o=n[r++],a=n[r++],c=n[r++];i?e.setAttribute(t,a,c,o):t.setAttributeNS(o,a,c)}else{const o=s,a=n[++r];Zt(o)?i&&e.setProperty(t,o,a):i?e.setAttribute(t,o,a):t.setAttribute(o,a),r++}}return r}function Kt(e){return 3===e||4===e||6===e}function Zt(e){return 64===e.charCodeAt(0)}function Xt(e,t){if(null===t||0===t.length);else if(null===e||0===e.length)e=t.slice();else{let n=-1;for(let i=0;i<t.length;i++){const r=t[i];"number"==typeof r?n=r:0===n||en(e,n,r,null,-1===n||2===n?t[++i]:null)}}return e}function en(e,t,n,i,r){let s=0,o=e.length;if(-1===t)o=-1;else for(;s<e.length;){const n=e[s++];if("number"==typeof n){if(n===t){o=-1;break}if(n>t){o=s-1;break}}}for(;s<e.length;){const t=e[s];if("number"==typeof t)break;if(t===n){if(null===i)return void(null!==r&&(e[s+1]=r));if(i===e[s+1])return void(e[s+2]=r)}s++,null!==i&&s++,null!==r&&s++}-1!==o&&(e.splice(o,0,t),s=o+1),e.splice(s++,0,n),null!==i&&e.splice(s++,0,i),null!==r&&e.splice(s++,0,r)}function tn(e){return e!==qt}function nn(e){return 32767&e}function rn(e,t){let n=e>>16,i=t;for(;n>0;)i=i[15],n--;return i}function sn(e){return"string"==typeof e?e:null==e?"":""+e}function on(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():sn(e)}const an=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(F))();function cn(e){return{name:"window",target:e.ownerDocument.defaultView}}function ln(e){return{name:"body",target:e.ownerDocument.body}}function un(e){return e instanceof Function?e():e}let dn=!0;function hn(e){const t=dn;return dn=e,t}let fn=0;function pn(e,t){const n=bn(e,t);if(-1!==n)return n;const i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,mn(i.data,e),mn(t,null),mn(i.blueprint,null));const r=gn(e,t),s=e.injectorIndex;if(tn(r)){const e=nn(r),n=rn(r,t),i=n[1].data;for(let r=0;r<8;r++)t[s+r]=n[e+r]|i[e+r]}return t[s+8]=r,s}function mn(e,t){e.push(0,0,0,0,0,0,0,0,t)}function bn(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function gn(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,i=null,r=t;for(;null!==r;){const e=r[1],t=e.type;if(i=2===t?e.declTNode:1===t?r[6]:null,null===i)return qt;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return qt}function _n(e,t,n){!function(e,t,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(B)&&(i=n[B]),null==i&&(i=n[B]=fn++);const r=255&i,s=1<<r,o=64&r,a=32&r,c=t.data;128&r?o?a?c[e+7]|=s:c[e+6]|=s:a?c[e+5]|=s:c[e+4]|=s:o?a?c[e+3]|=s:c[e+2]|=s:a?c[e+1]|=s:c[e]|=s}(e,t,n)}function yn(e,t,n,i=m.Default,r){if(null!==e){const r=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(B)?e[B]:void 0;return"number"==typeof t&&t>0?255&t:t}(n);if("function"==typeof r){Et(t,e);try{const e=r();if(null!=e||i&m.Optional)return e;throw new Error(`No provider for ${on(n)}!`)}finally{Nt()}}else if("number"==typeof r){if(-1===r)return new Dn(e,t);let s=null,o=bn(e,t),a=qt,c=i&m.Host?t[16][6]:null;for((-1===o||i&m.SkipSelf)&&(a=-1===o?gn(e,t):t[o+8],a!==qt&&kn(i,!1)?(s=t[1],o=nn(a),t=rn(a,t)):o=-1);-1!==o;){const e=t[1];if(xn(r,o,e.data)){const e=wn(o,t,n,s,i,c);if(e!==vn)return e}a=t[o+8],a!==qt&&kn(i,t[1].data[o+8]===c)&&xn(r,o,t)?(s=e,o=nn(a),t=rn(a,t)):o=-1}}}if(i&m.Optional&&void 0===r&&(r=null),0==(i&(m.Self|m.Host))){const e=t[9],s=te(void 0);try{return e?e.get(n,r,i&m.Optional):re(n,r,i&m.Optional)}finally{te(s)}}if(i&m.Optional)return r;throw new Error(`NodeInjector: NOT_FOUND [${on(n)}]`)}const vn={};function wn(e,t,n,i,r,s){const o=t[1],a=o.data[e+8],c=Sn(a,o,n,null==i?Ye(a)&&dn:i!=o&&2===a.type,r&m.Host&&s===a);return null!==c?Mn(t,o,c,a):vn}function Sn(e,t,n,i,r){const s=e.providerIndexes,o=t.data,a=1048575&s,c=e.directiveStart,l=s>>20,u=r?a+l:e.directiveEnd;for(let d=i?a:a+l;d<u;d++){const e=o[d];if(d<c&&n===e||d>=c&&e.type===n)return d}if(r){const e=o[c];if(e&&$e(e)&&e.type===n)return c}return null}function Mn(e,t,n,i){let r=e[n];const s=t.data;if(r instanceof Jt){const o=r;if(o.resolving)throw new Error("Circular dep for "+on(s[n]));const a=hn(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?te(o.injectImpl):null;Et(e,i);try{r=e[n]=o.factory(void 0,s,e,i),t.firstCreatePass&&n>=i.directiveStart&&function(e,t,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=t.type.prototype;if(i){const i=Be(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,s))}(n,s[n],t)}finally{null!==c&&te(c),hn(a),o.resolving=!1,Nt()}}return r}function xn(e,t,n){const i=64&e,r=32&e;let s;return s=128&e?i?r?n[t+7]:n[t+6]:r?n[t+5]:n[t+4]:i?r?n[t+3]:n[t+2]:r?n[t+1]:n[t],!!(s&1<<e)}function kn(e,t){return!(e&m.Self||e&m.Host&&t)}class Dn{constructor(e,t){this._tNode=e,this._lView=t}get(e,t){return yn(this._tNode,this._lView,e,void 0,t)}}function Tn(e){const t=e;if(A(e))return()=>{const e=Tn(E(t));return e?e():null};let n=Ee(t);if(null===n){const e=S(t);n=e&&e.factory}return n||null}function Cn(e){return c(()=>{const t=e.prototype.constructor,n=t[V]||Tn(t),i=Object.prototype;let r=Object.getPrototypeOf(e.prototype).constructor;for(;r&&r!==i;){const e=r[V]||Tn(r);if(e&&e!==n)return e;r=Object.getPrototypeOf(r)}return e=>new e})}function On(e){return e.ngDebugContext}function Rn(e){return e.ngOriginalError}function Ln(e,...t){e.error(...t)}class En{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),n=this._findContext(e),i=function(e){return e.ngErrorLogger||Ln}(e);i(this._console,"ERROR",e),t&&i(this._console,"ORIGINAL ERROR",t),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(e){return e?On(e)?On(e):this._findContext(Rn(e)):null}_findOriginalError(e){let t=Rn(e);for(;t&&Rn(t);)t=Rn(t);return t}}class An{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"}}class In extends An{getTypeName(){return"HTML"}}class Pn extends An{getTypeName(){return"Style"}}class jn extends An{getTypeName(){return"Script"}}class Nn extends An{getTypeName(){return"URL"}}class Fn extends An{getTypeName(){return"ResourceURL"}}function Yn(e){return e instanceof An?e.changingThisBreaksApplicationSecurity:e}function zn(e,t){const n=$n(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see http://g.co/ng/security#xss)`)}return n===t}function $n(e){return e instanceof An&&e.getTypeName()||null}function Hn(e){return new In(e)}function Wn(e){return new Pn(e)}function Vn(e){return new jn(e)}function Bn(e){return new Nn(e)}function Un(e){return new Fn(e)}let Gn=!0,qn=!1;function Jn(){return qn=!0,Gn}function Qn(){if(qn)throw new Error("Cannot enable prod mode after platform setup.");Gn=!1}function Kn(e){return function(){try{return!!(new window.DOMParser).parseFromString("","text/html")}catch(e){return!1}}()?new Zn:new Xn(e)}class Zn{getInertBodyElement(e){e="<body><remove></remove>"+e;try{const t=(new window.DOMParser).parseFromString(e,"text/html").body;return t.removeChild(t.firstChild),t}catch(t){return null}}}class Xn{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const t=this.inertDocument.createElement("body");e.appendChild(t)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=e,t;const n=this.inertDocument.createElement("body");return n.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(e){const t=e.attributes;for(let i=t.length-1;0<i;i--){const n=t.item(i).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||e.removeAttribute(n)}let n=e.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const ei=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,ti=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function ni(e){return(e=String(e)).match(ei)||e.match(ti)?e:(Jn()&&console.warn(`WARNING: sanitizing unsafe URL value ${e} (see http://g.co/ng/security#xss)`),"unsafe:"+e)}function ii(e){return(e=String(e)).split(",").map(e=>ni(e.trim())).join(", ")}function ri(e){const t={};for(const n of e.split(","))t[n]=!0;return t}function si(...e){const t={};for(const n of e)for(const e in n)n.hasOwnProperty(e)&&(t[e]=!0);return t}const oi=ri("area,br,col,hr,img,wbr"),ai=ri("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ci=ri("rp,rt"),li=si(ci,ai),ui=si(oi,si(ai,ri("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),si(ci,ri("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),li),di=ri("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),hi=ri("srcset"),fi=si(di,hi,ri("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),ri("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),pi=ri("script,style,template");class mi{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,n=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?n=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,n&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!ui.hasOwnProperty(t))return this.sanitizedSomething=!0,!pi.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const n=e.attributes;for(let i=0;i<n.length;i++){const e=n.item(i),t=e.name,r=t.toLowerCase();if(!fi.hasOwnProperty(r)){this.sanitizedSomething=!0;continue}let s=e.value;di[r]&&(s=ni(s)),hi[r]&&(s=ii(s)),this.buf.push(" ",t,'="',_i(s),'"')}return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();ui.hasOwnProperty(t)&&!oi.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(_i(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t}}const bi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,gi=/([^\#-~ |!])/g;function _i(e){return e.replace(/&/g,"&amp;").replace(bi,(function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"})).replace(gi,(function(e){return"&#"+e.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let yi;function vi(e,t){let n=null;try{yi=yi||Kn(e);let i=t?String(t):"";n=yi.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=yi.getInertBodyElement(i)}while(i!==s);const o=new mi,a=o.sanitizeChildren(wi(n)||n);return Jn()&&o.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),a}finally{if(n){const e=wi(n)||n;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function wi(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Si=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({});function Mi(e){const t=Di();return t?t.sanitize(Si.HTML,e)||"":zn(e,"HTML")?Yn(e):vi(Ke(),sn(e))}function xi(e){const t=Di();return t?t.sanitize(Si.URL,e)||"":zn(e,"URL")?Yn(e):ni(sn(e))}function ki(e){const t=Di();if(t)return t.sanitize(Si.RESOURCE_URL,e)||"";if(zn(e,"ResourceURL"))return Yn(e);throw new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)")}function Di(){const e=pt();return e&&e[12]}function Ti(e,t){e.__ngContext__=t}function Ci(e,t,n){let i=e.length;for(;;){const r=e.indexOf(t,n);if(-1===r)return r;if(0===r||e.charCodeAt(r-1)<=32){const n=t.length;if(r+n===i||e.charCodeAt(r+n)<=32)return r}n=r+1}}const Oi="ng-template";function Ri(e,t,n){let i=0;for(;i<e.length;){let r=e[i++];if(n&&"class"===r){if(r=e[i],-1!==Ci(r.toLowerCase(),t,0))return!0}else if(1===r){for(;i<e.length&&"string"==typeof(r=e[i++]);)if(r.toLowerCase()===t)return!0;return!1}}return!1}function Li(e){return 0===e.type&&e.tagName!==Oi}function Ei(e,t,n){return t===(0!==e.type||n?e.tagName:Oi)}function Ai(e,t,n){let i=4;const r=e.attrs||[],s=function(e){for(let t=0;t<e.length;t++)if(Kt(e[t]))return t;return e.length}(r);let o=!1;for(let a=0;a<t.length;a++){const c=t[a];if("number"!=typeof c){if(!o)if(4&i){if(i=2|1&i,""!==c&&!Ei(e,c,n)||""===c&&1===t.length){if(Ii(i))return!1;o=!0}}else{const l=8&i?c:t[++a];if(8&i&&null!==e.attrs){if(!Ri(e.attrs,l,n)){if(Ii(i))return!1;o=!0}continue}const u=Pi(8&i?"class":c,r,Li(e),n);if(-1===u){if(Ii(i))return!1;o=!0;continue}if(""!==l){let e;e=u>s?"":r[u+1].toLowerCase();const t=8&i?e:null;if(t&&-1!==Ci(t,l,0)||2&i&&l!==e){if(Ii(i))return!1;o=!0}}}}else{if(!o&&!Ii(i)&&!Ii(c))return!1;if(o&&Ii(c))continue;o=!1,i=c|1&i}}return Ii(i)||o}function Ii(e){return 0==(1&e)}function Pi(e,t,n,i){if(null===t)return-1;let r=0;if(i||!n){let n=!1;for(;r<t.length;){const i=t[r];if(i===e)return r;if(3===i||6===i)n=!0;else{if(1===i||2===i){let e=t[++r];for(;"string"==typeof e;)e=t[++r];continue}if(4===i)break;if(0===i){r+=4;continue}}r+=n?1:2}return-1}return function(e,t){let n=e.indexOf(4);if(n>-1)for(n++;n<e.length;){const i=e[n];if("number"==typeof i)return-1;if(i===t)return n;n++}return-1}(t,e)}function ji(e,t,n=!1){for(let i=0;i<t.length;i++)if(Ai(e,t[i],n))return!0;return!1}function Ni(e,t){e:for(let n=0;n<t.length;n++){const i=t[n];if(e.length===i.length){for(let t=0;t<e.length;t++)if(e[t]!==i[t])continue e;return!0}}return!1}function Fi(e,t){return e?":not("+t.trim()+")":t}function Yi(e){let t=e[0],n=1,i=2,r="",s=!1;for(;n<e.length;){let o=e[n];if("string"==typeof o)if(2&i){const t=e[++n];r+="["+o+(t.length>0?'="'+t+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Ii(o)||(t+=Fi(s,r),r=""),i=o,s=s||!Ii(i);n++}return""!==r&&(t+=Fi(s,r)),t}const zi={};function $i(e){const t=e[3];return Ne(t)?t[3]:t}function Hi(e){return Vi(e[13])}function Wi(e){return Vi(e[4])}function Vi(e){for(;null!==e&&!Ne(e);)e=e[4];return e}function Bi(e){Ui(mt(),pt(),Yt()+e,wt())}function Ui(e,t,n,i){if(!i)if(3==(3&t[2])){const i=e.preOrderCheckHooks;null!==i&&Wt(t,i,n)}else{const i=e.preOrderHooks;null!==i&&Vt(t,i,0,n)}zt(n)}function Gi(e,t){return e<<17|t<<2}function qi(e){return e>>17&32767}function Ji(e){return 2|e}function Qi(e){return(131068&e)>>2}function Ki(e,t){return-131069&e|t<<2}function Zi(e){return 1|e}function Xi(e,t){const n=e.contentQueries;if(null!==n)for(let i=0;i<n.length;i+=2){const r=n[i],s=n[i+1];if(-1!==s){const n=e.data[s];Lt(r),n.contentQueries(2,t[s],s)}}}function er(e,t,n){return Ze(t)?t.createElement(e,n):null===n?t.createElement(e):t.createElementNS(n,e)}function tr(e,t,n,i,r,s,o,a,c,l){const u=t.blueprint.slice();return u[0]=r,u[2]=140|i,ut(u),u[3]=u[15]=e,u[8]=n,u[10]=o||e&&e[10],u[11]=a||e&&e[11],u[12]=c||e&&e[12]||null,u[9]=l||e&&e[9]||null,u[6]=s,u[16]=2==t.type?e[16]:u,u}function nr(e,t,n,i,r){const s=t+Ie,o=e.data[s]||function(e,t,n,i,r){const s=gt(),o=yt(),a=e.data[t]=function(e,t,n,i,r,s){return{type:n,index:i,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,tagName:r,attrs:s,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?s:s&&s.parent,n,t,i,r);return null===e.firstChild&&(e.firstChild=a),null!==s&&(o&&null==s.child&&null!==a.parent?s.child=a:o||(s.next=a)),a}(e,s,n,i,r);return _t(o,!0),o}function ir(e,t,n){At(t);try{const i=e.viewQuery;null!==i&&Pr(1,i,n);const r=e.template;null!==r&&or(e,t,r,1,n),e.firstCreatePass&&(e.firstCreatePass=!1),e.staticContentQueries&&Xi(e,t),e.staticViewQueries&&Pr(2,e.viewQuery,n);const s=e.components;null!==s&&function(e,t){for(let n=0;n<t.length;n++)Rr(e,t[n])}(t,s)}catch(i){throw e.firstCreatePass&&(e.incompleteFirstPass=!0),i}finally{t[2]&=-5,Ft()}}function rr(e,t,n,i){const r=t[2];if(256==(256&r))return;At(t);const s=wt();try{ut(t),ht.lFrame.bindingIndex=e.bindingStartIndex,null!==n&&or(e,t,n,2,i);const o=3==(3&r);if(!s)if(o){const n=e.preOrderCheckHooks;null!==n&&Wt(t,n,null)}else{const n=e.preOrderHooks;null!==n&&Vt(t,n,0,null),Bt(t,0)}if(function(e){for(let t=Hi(e);null!==t;t=Wi(t)){if(!t[2])continue;const e=t[9];for(let t=0;t<e.length;t++){const n=e[t],i=n[3];0==(1024&n[2])&&dt(i,1),n[2]|=1024}}}(t),function(e){for(let t=Hi(e);null!==t;t=Wi(t))for(let e=Pe;e<t.length;e++){const n=t[e],i=n[1];ct(n)&&rr(i,n,i.template,n[8])}}(t),null!==e.contentQueries&&Xi(e,t),!s)if(o){const n=e.contentCheckHooks;null!==n&&Wt(t,n)}else{const n=e.contentHooks;null!==n&&Vt(t,n,1),Bt(t,1)}!function(e,t){try{const n=e.expandoInstructions;if(null!==n){let i=e.expandoStartIndex,r=-1,s=-1;for(let e=0;e<n.length;e++){const o=n[e];"number"==typeof o?o<=0?(s=0-o,zt(s),i+=9+n[++e],r=i):i+=o:(null!==o&&(Tt(i,r),o(2,t[r])),r++)}}}finally{zt(-1)}}(e,t);const a=e.components;null!==a&&function(e,t){for(let n=0;n<t.length;n++)Or(e,t[n])}(t,a);const c=e.viewQuery;if(null!==c&&Pr(2,c,i),!s)if(o){const n=e.viewCheckHooks;null!==n&&Wt(t,n)}else{const n=e.viewHooks;null!==n&&Vt(t,n,2),Bt(t,2)}!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),s||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,dt(t[3],-1))}finally{Ft()}}function sr(e,t,n,i){const r=t[10],s=!wt(),o=at(t);try{s&&!o&&r.begin&&r.begin(),o&&ir(e,t,i),rr(e,t,n,i)}finally{s&&!o&&r.end&&r.end()}}function or(e,t,n,i,r){const s=Yt();try{zt(-1),2&i&&t.length>Ie&&Ui(e,t,0,wt()),n(i,r)}finally{zt(s)}}function ar(e,t,n){if(Fe(t)){const i=t.directiveEnd;for(let r=t.directiveStart;r<i;r++){const t=e.data[r];t.contentQueries&&t.contentQueries(1,n[r],r)}}}function cr(e,t,n){ft()&&(function(e,t,n,i){const r=n.directiveStart,s=n.directiveEnd;e.firstCreatePass||pn(n,t),Ti(i,t);const o=n.initialInputs;for(let a=r;a<s;a++){const i=e.data[a],s=$e(i);s&&xr(t,n,i);const c=Mn(t,e,a,n);Ti(c,t),null!==o&&Dr(0,a-r,c,i,0,o),s&&(st(n.index,t)[8]=c)}}(e,t,n,nt(n,t)),128==(128&n.flags)&&function(e,t,n){const i=n.directiveStart,r=n.directiveEnd,s=e.expandoInstructions,o=e.firstCreatePass,a=n.index-Ie,c=ht.lFrame.currentDirectiveIndex;try{zt(a);for(let n=i;n<r;n++){const i=e.data[n],r=t[n];Ct(n),null!==i.hostBindings||0!==i.hostVars||null!==i.hostAttrs?_r(i,r):o&&s.push(null)}}finally{zt(-1),Ct(c)}}(e,t,n))}function lr(e,t,n=nt){const i=t.localNames;if(null!==i){let r=t.index+1;for(let s=0;s<i.length;s+=2){const o=i[s+1],a=-1===o?n(t,e):e[o];e[r++]=a}}}function ur(e){const t=e.tView;return null===t||t.incompleteFirstPass?e.tView=dr(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts):t}function dr(e,t,n,i,r,s,o,a,c,l){const u=Ie+i,d=u+r,h=function(e,t){const n=[];for(let i=0;i<t;i++)n.push(i<e?null:zi);return n}(u,d),f="function"==typeof l?l():l;return h[1]={type:e,blueprint:h,template:n,queries:null,viewQuery:a,declTNode:t,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:d,expandoInstructions:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof s?s():s,pipeRegistry:"function"==typeof o?o():o,firstChild:null,schemas:c,consts:f,incompleteFirstPass:!1}}function hr(e,t,n,i){const r=Nr(t);r.push(n),e.firstCreatePass&&function(e){return e.cleanup||(e.cleanup=[])}(e).push(i,r.length-1)}function fr(e,t,n){for(let i in e)if(e.hasOwnProperty(i)){const r=e[i];(n=null===n?{}:n).hasOwnProperty(i)?n[i].push(t,r):n[i]=[t,r]}return n}function pr(e,t,n,i,r,s,o,a){const c=nt(t,n);let l,u=t.inputs;var d;!a&&null!=u&&(l=u[i])?(Yr(e,n,l,i,r),Ye(t)&&function(e,t){const n=st(t,e);16&n[2]||(n[2]|=64)}(n,t.index)):2===t.type&&(i="class"===(d=i)?"className":"for"===d?"htmlFor":"formaction"===d?"formAction":"innerHtml"===d?"innerHTML":"readonly"===d?"readOnly":"tabindex"===d?"tabIndex":d,r=null!=o?o(r,t.tagName||"",i):r,Ze(s)?s.setProperty(c,i,r):Zt(i)||(c.setProperty?c.setProperty(i,r):c[i]=r))}function mr(e,t,n,i){let r=!1;if(ft()){const s=function(e,t,n){const i=e.directiveRegistry;let r=null;if(i)for(let s=0;s<i.length;s++){const o=i[s];ji(n,o.selectors,!1)&&(r||(r=[]),_n(pn(n,t),e,o.type),$e(o)?(vr(e,n),r.unshift(o)):r.push(o))}return r}(e,t,n),o=null===i?null:{"":-1};if(null!==s){let i=0;r=!0,Sr(n,e.data.length,s.length);for(let e=0;e<s.length;e++){const t=s[e];t.providersResolver&&t.providersResolver(t)}yr(e,n,s.length);let a=!1,c=!1;for(let r=0;r<s.length;r++){const l=s[r];n.mergedAttrs=Xt(n.mergedAttrs,l.hostAttrs),Mr(e,t,l),wr(e.data.length-1,l,o),null!==l.contentQueries&&(n.flags|=8),null===l.hostBindings&&null===l.hostAttrs&&0===l.hostVars||(n.flags|=128);const u=l.type.prototype;!a&&(u.ngOnChanges||u.ngOnInit||u.ngDoCheck)&&((e.preOrderHooks||(e.preOrderHooks=[])).push(n.index-Ie),a=!0),c||!u.ngOnChanges&&!u.ngDoCheck||((e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(n.index-Ie),c=!0),br(e,l),i+=l.hostVars}!function(e,t){const n=t.directiveEnd,i=e.data,r=t.attrs,s=[];let o=null,a=null;for(let c=t.directiveStart;c<n;c++){const e=i[c],n=e.inputs,l=null===r||Li(t)?null:Tr(n,r);s.push(l),o=fr(n,c,o),a=fr(e.outputs,c,a)}null!==o&&(o.hasOwnProperty("class")&&(t.flags|=16),o.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=s,t.inputs=o,t.outputs=a}(e,n),gr(e,t,i)}o&&function(e,t,n){if(t){const i=e.localNames=[];for(let e=0;e<t.length;e+=2){const r=n[t[e+1]];if(null==r)throw new Error(`Export of name '${t[e+1]}' not found!`);i.push(t[e],r)}}}(n,i,o)}return n.mergedAttrs=Xt(n.mergedAttrs,n.attrs),r}function br(e,t){const n=e.expandoInstructions;n.push(t.hostBindings),0!==t.hostVars&&n.push(t.hostVars)}function gr(e,t,n){for(let i=0;i<n;i++)t.push(zi),e.blueprint.push(zi),e.data.push(null)}function _r(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function yr(e,t,n){const i=Ie-t.index,r=e.data.length-(1048575&t.providerIndexes);(e.expandoInstructions||(e.expandoInstructions=[])).push(i,r,n)}function vr(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function wr(e,t,n){if(n){if(t.exportAs)for(let i=0;i<t.exportAs.length;i++)n[t.exportAs[i]]=e;$e(t)&&(n[""]=e)}}function Sr(e,t,n){e.flags|=1,e.directiveStart=t,e.directiveEnd=t+n,e.providerIndexes=t}function Mr(e,t,n){e.data.push(n);const i=n.factory||(n.factory=Ee(n.type)),r=new Jt(i,$e(n),null);e.blueprint.push(r),t.push(r)}function xr(e,t,n){const i=nt(t,e),r=ur(n),s=e[10],o=Lr(e,tr(e,r,null,n.onPush?64:16,i,t,s,s.createRenderer(i,n),null,null));e[t.index]=o}function kr(e,t,n,i,r,s){const o=nt(e,t),a=t[11];if(null==i)Ze(a)?a.removeAttribute(o,n,s):o.removeAttribute(n);else{const t=null==r?sn(i):r(i,e.tagName||"",n);Ze(a)?a.setAttribute(o,n,t,s):s?o.setAttributeNS(s,n,t):o.setAttribute(n,t)}}function Dr(e,t,n,i,r,s){const o=s[t];if(null!==o){const e=i.setInput;for(let t=0;t<o.length;){const r=o[t++],s=o[t++],a=o[t++];null!==e?i.setInput(n,a,r,s):n[s]=a}}}function Tr(e,t){let n=null,i=0;for(;i<t.length;){const r=t[i];if(0!==r)if(5!==r){if("number"==typeof r)break;e.hasOwnProperty(r)&&(null===n&&(n=[]),n.push(r,e[r],t[i+1])),i+=2}else i+=2;else i+=4}return n}function Cr(e,t,n,i){return new Array(e,!0,!1,t,null,0,i,n,null,null)}function Or(e,t){const n=st(t,e);if(ct(n)){const e=n[1];80&n[2]?rr(e,n,e.template,n[8]):n[5]>0&&function e(t){for(let i=Hi(t);null!==i;i=Wi(i))for(let t=Pe;t<i.length;t++){const n=i[t];if(1024&n[2]){const e=n[1];rr(e,n,e.template,n[8])}else n[5]>0&&e(n)}const n=t[1].components;if(null!==n)for(let i=0;i<n.length;i++){const r=st(n[i],t);ct(r)&&r[5]>0&&e(r)}}(n)}}function Rr(e,t){const n=st(t,e),i=n[1];!function(e,t){for(let n=t.length;n<e.blueprint.length;n++)t.push(e.blueprint[n])}(i,n),ir(i,n,n[8])}function Lr(e,t){return e[13]?e[14][4]=t:e[13]=t,e[14]=t,t}function Er(e){for(;e;){e[2]|=64;const t=$i(e);if(He(e)&&!t)return e;e=t}return null}function Ar(e,t,n){const i=t[10];i.begin&&i.begin();try{rr(e,t,e.template,n)}catch(r){throw Fr(t,r),r}finally{i.end&&i.end()}}function Ir(e){!function(e){for(let t=0;t<e.components.length;t++){const n=e.components[t],i=ot(n),r=i[1];sr(r,i,r.template,n)}}(e[8])}function Pr(e,t,n){Lt(0),t(e,n)}const jr=(()=>Promise.resolve(null))();function Nr(e){return e[7]||(e[7]=[])}function Fr(e,t){const n=e[9],i=n?n.get(En,null):null;i&&i.handleError(t)}function Yr(e,t,n,i,r){for(let s=0;s<n.length;){const o=n[s++],a=n[s++],c=t[o],l=e.data[o];null!==l.setInput?l.setInput(c,r,i,a):c[a]=r}}function zr(e,t,n){const i=tt(t,e),r=e[11];Ze(r)?r.setValue(i,n):i.textContent=n}function $r(e,t,n,i,r){if(null!=i){let s,o=!1;Ne(i)?s=i:je(i)&&(o=!0,i=i[0]);const a=et(i);0===e&&null!==n?null==r?Jr(t,n,a):qr(t,n,a,r||null):1===e&&null!==n?qr(t,n,a,r||null):2===e?es(t,a,o):3===e&&t.destroyNode(a),null!=s&&function(e,t,n,i,r){const s=n[7];s!==et(n)&&$r(t,e,i,s,r);for(let o=Pe;o<n.length;o++){const r=n[o];ns(r[1],r,e,t,i,s)}}(t,e,s,n,r)}}function Hr(e,t){return Ze(t)?t.createText(e):t.createTextNode(e)}function Wr(e,t){const n=e[9],i=n.indexOf(t),r=t[3];1024&t[2]&&(t[2]&=-1025,dt(r,-1)),n.splice(i,1)}function Vr(e,t){if(e.length<=Pe)return;const n=Pe+t,i=e[n];if(i){const s=i[17];null!==s&&s!==e&&Wr(s,i),t>0&&(e[n-1][4]=i[4]);const o=he(e,Pe+t);ns(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function Br(e,t){if(!(256&t[2])){const n=t[11];Ze(n)&&n.destroyNode&&ns(e,t,n,3,null,null),function(e){let t=e[13];if(!t)return Ur(e[1],e);for(;t;){let n=null;if(je(t))n=t[13];else{const e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)je(t)&&Ur(t[1],t),t=t[3];null===t&&(t=e),je(t)&&Ur(t[1],t),n=t&&t[4]}t=n}}(t)}}function Ur(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let i=0;i<n.length;i+=2){const e=t[n[i]];if(!(e instanceof Jt)){const t=n[i+1];if(Array.isArray(t))for(let n=0;n<t.length;n+=2)t[n+1].call(e[t[n]]);else t.call(e)}}}(e,t),function(e,t){const n=e.cleanup;if(null!==n){const e=t[7];for(let i=0;i<n.length-1;i+=2)if("string"==typeof n[i]){const r=n[i+1],s="function"==typeof r?r(t):et(t[r]),o=e[n[i+2]],a=n[i+3];"boolean"==typeof a?s.removeEventListener(n[i],o,a):a>=0?e[a]():e[-a].unsubscribe(),i+=2}else n[i].call(e[n[i+1]]);t[7]=null}}(e,t),1===t[1].type&&Ze(t[11])&&t[11].destroy();const n=t[17];if(null!==n&&Ne(t[3])){n!==t[3]&&Wr(n,t);const i=t[19];null!==i&&i.detachView(e)}}}function Gr(e,t,n){let i=t.parent;for(;null!=i&&(3===i.type||4===i.type);)i=(t=i).parent;if(null===i)return n[0];if(t&&4===t.type&&4&t.flags)return nt(t,n).parentNode;if(2&i.flags){const t=e.data,n=t[t[i.index].directiveStart].encapsulation;if(n!==_e.ShadowDom&&n!==_e.Native)return null}return nt(i,n)}function qr(e,t,n,i){Ze(e)?e.insertBefore(t,n,i):t.insertBefore(n,i,!0)}function Jr(e,t,n){Ze(e)?e.appendChild(t,n):t.appendChild(n)}function Qr(e,t,n,i){null!==i?qr(e,t,n,i):Jr(e,t,n)}function Kr(e,t){return Ze(e)?e.parentNode(t):t.parentNode}function Zr(e,t){return 3===e.type||4===e.type?nt(e,t):null}function Xr(e,t,n,i){const r=Gr(e,i,t);if(null!=r){const e=t[11],s=Zr(i.parent||t[6],t);if(Array.isArray(n))for(let t=0;t<n.length;t++)Qr(e,r,n[t],s);else Qr(e,r,n,s)}}function es(e,t,n){const i=Kr(e,t);i&&function(e,t,n,i){Ze(e)?e.removeChild(t,n,i):t.removeChild(n)}(e,i,t,n)}function ts(e,t,n,i,r,s,o){for(;null!=n;){const a=i[n.index],c=n.type;o&&0===t&&(a&&Ti(et(a),i),n.flags|=4),64!=(64&n.flags)&&(3===c||4===c?(ts(e,t,n.child,i,r,s,!1),$r(t,e,r,a,s)):1===c?rs(e,t,i,n,r,s):$r(t,e,r,a,s)),n=o?n.projectionNext:n.next}}function ns(e,t,n,i,r,s){ts(n,i,e.firstChild,t,r,s,!1)}function is(e,t,n){rs(t[11],0,t,n,Gr(e,n,t),Zr(n.parent||t[6],t))}function rs(e,t,n,i,r,s){const o=n[16],a=o[6].projection[i.projection];if(Array.isArray(a))for(let c=0;c<a.length;c++)$r(t,e,r,a[c],s);else ts(e,t,a,o[3],r,s,!0)}function ss(e,t,n){Ze(e)?e.setAttribute(t,"style",n):t.style.cssText=n}function os(e,t,n){Ze(e)?""===n?e.removeAttribute(t,"class"):e.setAttribute(t,"class",n):t.className=n}class as{constructor(e,t){this._lView=e,this._cdRefInjectingView=t,this._appRef=null,this._viewContainerRef=null}get rootNodes(){const e=this._lView,t=e[1];return function e(t,n,i,r,s=!1){for(;null!==i;){const o=n[i.index];if(null!==o&&r.push(et(o)),Ne(o))for(let t=Pe;t<o.length;t++){const n=o[t],i=n[1].firstChild;null!==i&&e(n[1],n,i,r)}const a=i.type;if(3===a||4===a)e(t,n,i.child,r);else if(1===a){const t=n[16],s=t[6].projection[i.projection];if(Array.isArray(s))r.push(...s);else{const n=$i(t);e(n[1],n,s,r,!0)}}i=s?i.projectionNext:i.next}return r}(t,e,t.firstChild,[])}get context(){return this._lView[8]}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._viewContainerRef){const e=this._viewContainerRef.indexOf(this);e>-1&&this._viewContainerRef.detach(e),this._viewContainerRef=null}Br(this._lView[1],this._lView)}onDestroy(e){hr(this._lView[1],this._lView,null,e)}markForCheck(){Er(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ar(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(e,t,n){St(!0);try{Ar(e,t,n)}finally{St(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e}detachFromAppRef(){var e;this._appRef=null,ns(this._lView[1],e=this._lView,e[11],2,null,null)}attachToAppRef(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class cs extends as{constructor(e){super(e),this._view=e}detectChanges(){Ir(this._view)}checkNoChanges(){!function(e){St(!0);try{Ir(e)}finally{St(!1)}}(this._view)}get context(){return null}}let ls,us,ds;function hs(e,t,n){return ls||(ls=class extends e{}),new ls(nt(t,n))}function fs(e,t,n,i){return us||(us=class extends e{constructor(e,t,n){super(),this._declarationView=e,this._declarationTContainer=t,this.elementRef=n}createEmbeddedView(e){const t=this._declarationTContainer.tViews,n=tr(this._declarationView,t,e,16,null,t.declTNode,null,null,null,null);n[17]=this._declarationView[this._declarationTContainer.index];const i=this._declarationView[19];return null!==i&&(n[19]=i.createEmbeddedView(t)),ir(t,n,e),new as(n)}}),0===n.type?new us(i,n,hs(t,n,i)):null}function ps(e,t,n,i){let r;ds||(ds=class extends e{constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostView=n}get element(){return hs(t,this._hostTNode,this._hostView)}get injector(){return new Dn(this._hostTNode,this._hostView)}get parentInjector(){const e=gn(this._hostTNode,this._hostView);if(tn(e)){const t=rn(e,this._hostView),n=nn(e);return new Dn(t[1].data[n+8],t)}return new Dn(null,this._hostView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){return null!==this._lContainer[8]&&this._lContainer[8][e]||null}get length(){return this._lContainer.length-Pe}createEmbeddedView(e,t,n){const i=e.createEmbeddedView(t||{});return this.insert(i,n),i}createComponent(e,t,n,i,r){const s=n||this.parentInjector;if(!r&&null==e.ngModule&&s){const e=s.get(ae,null);e&&(r=e)}const o=e.create(s,i,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){const n=e._lView,i=n[1];if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");if(this.allocateContainerIfNeeded(),Ne(n[3])){const t=this.indexOf(e);if(-1!==t)this.detach(t);else{const t=n[3],i=new ds(t,t[6],t[3]);i.detach(i.indexOf(e))}}const r=this._adjustIndex(t),s=this._lContainer;!function(e,t,n,i){const r=Pe+i,s=n.length;i>0&&(n[r-1][4]=t),i<s-Pe?(t[4]=n[r],de(n,Pe+i,t)):(n.push(t),t[4]=null),t[3]=n;const o=t[17];null!==o&&n!==o&&function(e,t){const n=e[9];t[16]!==t[3][3][16]&&(e[2]=!0),null===n?e[9]=[t]:n.push(t)}(o,t);const a=t[19];null!==a&&a.insertView(e),t[2]|=128}(i,n,s,r);const o=function e(t,n){const i=Pe+t+1;if(i<n.length){const t=n[i],r=t[1].firstChild;if(null!==r)return function t(n,i){if(null!==i){const r=i.type;if(2===r)return nt(i,n);if(0===r)return e(-1,n[i.index]);if(3===r||4===r){const r=i.child;if(null!==r)return t(n,r);{const t=n[i.index];return Ne(t)?e(-1,t):et(t)}}{const e=n[16],r=e[6],s=$i(e),o=r.projection[i.projection];return null!=o?t(s,o):t(n,i.next)}}return null}(t,r)}return n[7]}(r,s),a=n[11],c=Kr(a,s[7]);return null!==c&&function(e,t,n,i,r,s){i[0]=r,i[6]=t,ns(e,i,n,1,r,s)}(i,s[6],a,n,c,o),e.attachToViewContainerRef(this),de(s[8],r,e),e}move(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");return this.insert(e,t)}indexOf(e){const t=this._lContainer[8];return null!==t?t.indexOf(e):-1}remove(e){this.allocateContainerIfNeeded();const t=this._adjustIndex(e,-1),n=Vr(this._lContainer,t);n&&(he(this._lContainer[8],t),Br(n[1],n))}detach(e){this.allocateContainerIfNeeded();const t=this._adjustIndex(e,-1),n=Vr(this._lContainer,t);return n&&null!=he(this._lContainer[8],t)?new as(n):null}_adjustIndex(e,t=0){return null==e?this.length+t:e}allocateContainerIfNeeded(){null===this._lContainer[8]&&(this._lContainer[8]=[])}});const s=i[n.index];if(Ne(s))r=s;else{let e;if(3===n.type)e=et(s);else if(e=i[11].createComment(""),He(i)){const t=i[11],r=nt(n,i);qr(t,Kr(t,r),e,function(e,t){return Ze(e)?e.nextSibling(t):t.nextSibling}(t,r))}else Xr(i[1],i,e,n);i[n.index]=r=Cr(s,i,e,n),Lr(i,r)}return new ds(r,n,i)}function ms(e=!1){return function(e,t,n){if(!n&&Ye(e)){const n=st(e.index,t);return new as(n,n)}return 2===e.type||0===e.type||3===e.type||4===e.type?new as(t[16],t):null}(gt(),pt(),e)}let bs=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>gs(),e})();const gs=ms,_s=Function,ys=new U("Set Injector scope."),vs={},ws={},Ss=[];let Ms=void 0;function xs(){return void 0===Ms&&(Ms=new oe),Ms}function ks(e,t=null,n=null,i){return new Ds(e,n,t||xs(),i)}class Ds{constructor(e,t,n,i=null){this.parent=n,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const r=[];t&&ue(t,n=>this.processProvider(n,e,t)),ue([e],e=>this.processInjectorType(e,[],r)),this.records.set(G,Os(void 0,this));const s=this.records.get(ys);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof e?null:C(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=q,n=m.Default){this.assertNotDestroyed();const i=ee(this);try{if(!(n&m.SkipSelf)){let t=this.records.get(e);if(void 0===t){const n=("function"==typeof(r=e)||"object"==typeof r&&r instanceof U)&&v(e);t=n&&this.injectableDefInScope(n)?Os(Ts(e),vs):null,this.records.set(e,t)}if(null!=t)return this.hydrate(e,t)}return(n&m.Self?xs():this.parent).get(e,t=n&m.Optional&&t===q?null:t)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(C(e)),i)throw s;return function(e,t,n,i){const r=e.ngTempTokenPath;throw t[Q]&&r.unshift(t[Q]),e.message=function(e,t,n,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;let r=C(t);if(Array.isArray(t))r=t.map(C).join(" -> ");else if("object"==typeof t){let e=[];for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e.push(n+":"+("string"==typeof i?JSON.stringify(i):C(i)))}r=`{${e.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${e.replace(J,"\n  ")}`}("\n"+e.message,r,n,i),e.ngTokenPath=r,e.ngTempTokenPath=null,e}(s,e,"R3InjectorError",this.source)}throw s}finally{ee(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((t,n)=>e.push(C(n))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,n){if(!(e=E(e)))return!1;let i=S(e);const r=null==i&&e.ngModule||void 0,s=void 0===r?e:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=S(r)),null==i)return!1;if(null!=i.imports&&!o){let e;n.push(s);try{ue(i.imports,i=>{this.processInjectorType(i,t,n)&&(void 0===e&&(e=[]),e.push(i))})}finally{}if(void 0!==e)for(let t=0;t<e.length;t++){const{ngModule:n,providers:i}=e[t];ue(i,e=>this.processProvider(e,n,i||Ss))}}this.injectorDefTypes.add(s),this.records.set(s,Os(i.factory,vs));const a=i.providers;if(null!=a&&!o){const t=e;ue(a,e=>this.processProvider(e,t,a))}return void 0!==r&&void 0!==e.providers}processProvider(e,t,n){let i=Ls(e=E(e))?e:E(e&&e.provide);const r=function(e,t,n){return Rs(e)?Os(void 0,e.useValue):Os(Cs(e),vs)}(e);if(Ls(e)||!0!==e.multi)this.records.get(i);else{let t=this.records.get(i);t||(t=Os(void 0,vs,!0),t.factory=()=>se(t.multi),this.records.set(i,t)),i=e,t.multi.push(e)}this.records.set(i,r)}hydrate(e,t){var n;return t.value===vs&&(t.value=ws,t.value=t.factory()),"object"==typeof t.value&&t.value&&null!==(n=t.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){return!!e.providedIn&&("string"==typeof e.providedIn?"any"===e.providedIn||e.providedIn===this.scope:this.injectorDefTypes.has(e.providedIn))}}function Ts(e){const t=v(e),n=null!==t?t.factory:Ee(e);if(null!==n)return n;const i=S(e);if(null!==i)return i.factory;if(e instanceof U)throw new Error(`Token ${C(e)} is missing a \u0275prov definition.`);if(e instanceof Function)return function(e){const t=e.length;if(t>0){const n=fe(t,"?");throw new Error(`Can't resolve all parameters for ${C(e)}: (${n.join(", ")}).`)}const n=function(e){const t=e&&(e[M]||e[D]||e[k]&&e[k]());if(t){const n=function(e){if(e.hasOwnProperty("name"))return e.name;const t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),t}return null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new Error("unreachable")}function Cs(e,t,n){let i=void 0;if(Ls(e)){const t=E(e);return Ee(t)||Ts(t)}if(Rs(e))i=()=>E(e.useValue);else if((r=e)&&r.useFactory)i=()=>e.useFactory(...se(e.deps||[]));else if(function(e){return!(!e||!e.useExisting)}(e))i=()=>ie(E(e.useExisting));else{const t=E(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return Ee(t)||Ts(t);i=()=>new t(...se(e.deps))}var r;return i}function Os(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Rs(e){return null!==e&&"object"==typeof e&&K in e}function Ls(e){return"function"==typeof e}const Es=function(e,t,n){return function(e,t=null,n=null,i){const r=ks(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)};let As=(()=>{class e{static create(e,t){return Array.isArray(e)?Es(e,t,""):Es(e.providers,e.parent,e.name||"")}}return e.THROW_IF_NOT_FOUND=q,e.NULL=new oe,e.\u0275prov=_({token:e,providedIn:"any",factory:()=>ie(G)}),e.__NG_ELEMENT_ID__=-1,e})();const Is=new U("AnalyzeForEntryComponents");function Ps(e,t,n){let i=n?e.styles:null,r=n?e.classes:null,s=0;if(null!==t)for(let o=0;o<t.length;o++){const e=t[o];"number"==typeof e?s=e:1==s?r=O(r,e):2==s&&(i=O(i,e+": "+t[++o]+";"))}n?e.styles=i:e.stylesWithoutHost=i,n?e.classes=r:e.classesWithoutHost=r}function js(e,t){const n=ot(e)[1],i=n.data.length-1;Ht(n,{directiveStart:i,directiveEnd:i+1})}function Ns(e){let t=Object.getPrototypeOf(e.type.prototype).constructor,n=!0;const i=[e];for(;t;){let r=void 0;if($e(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(n){i.push(r);const t=e;t.inputs=Fs(e.inputs),t.declaredInputs=Fs(e.declaredInputs),t.outputs=Fs(e.outputs);const n=r.hostBindings;n&&$s(e,n);const s=r.viewQuery,o=r.contentQueries;if(s&&Ys(e,s),o&&zs(e,o),g(e.inputs,r.inputs),g(e.declaredInputs,r.declaredInputs),g(e.outputs,r.outputs),$e(r)&&r.data.animation){const t=e.data;t.animation=(t.animation||[]).concat(r.data.animation)}}const t=r.features;if(t)for(let i=0;i<t.length;i++){const r=t[i];r&&r.ngInherit&&r(e),r===Ns&&(n=!1)}}t=Object.getPrototypeOf(t)}!function(e){let t=0,n=null;for(let i=e.length-1;i>=0;i--){const r=e[i];r.hostVars=t+=r.hostVars,r.hostAttrs=Xt(r.hostAttrs,n=Xt(n,r.hostAttrs))}}(i)}function Fs(e){return e===ye?{}:e===ve?[]:e}function Ys(e,t){const n=e.viewQuery;e.viewQuery=n?(e,i)=>{t(e,i),n(e,i)}:t}function zs(e,t){const n=e.contentQueries;e.contentQueries=n?(e,i,r)=>{t(e,i,r),n(e,i,r)}:t}function $s(e,t){const n=e.hostBindings;e.hostBindings=n?(e,i)=>{t(e,i),n(e,i)}:t}let Hs=null;function Ws(){if(!Hs){const e=F.Symbol;if(e&&e.iterator)Hs=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const n=e[t];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(Hs=n)}}}return Hs}class Vs{constructor(e){this.wrapped=e}static wrap(e){return new Vs(e)}static unwrap(e){return Vs.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof Vs}}function Bs(e){return!!Us(e)&&(Array.isArray(e)||!(e instanceof Map)&&Ws()in e)}function Us(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Gs(e,t,n){return e[t]=n}function qs(e,t){return e[t]}function Js(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function Qs(e,t,n,i){const r=Js(e,t,n);return Js(e,t+1,i)||r}function Ks(e,t,n,i,r){const s=Qs(e,t,n,i);return Js(e,t+2,r)||s}function Zs(e,t,n,i,r,s){const o=Qs(e,t,n,i);return Qs(e,t+2,r,s)||o}function Xs(e,t,n,i){const r=pt();return Js(r,kt(),t)&&(mt(),kr($t(),r,e,t,n,i)),Xs}function eo(e,t,n,i){return Js(e,kt(),n)?t+sn(n)+i:zi}function to(e,t,n,i,r,s){const o=Qs(e,xt(),n,r);return Dt(2),o?t+sn(n)+i+sn(r)+s:zi}function no(e,t,n,i,r,s,o,a){const c=pt(),l=mt(),u=e+Ie,d=l.firstCreatePass?function(e,t,n,i,r,s,o,a,c){const l=t.consts,u=nr(t,e,0,o||null,lt(l,a));mr(t,n,u,lt(l,c)),Ht(t,u);const d=u.tViews=dr(2,u,i,r,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,l);return null!==t.queries&&(t.queries.template(t,u),d.queries=t.queries.embeddedTView(u)),u}(e,l,c,t,n,i,r,s,o):l.data[u];_t(d,!1);const h=c[11].createComment("");Xr(l,c,h,d),Ti(h,c),Lr(c,c[u]=Cr(h,c,h,d)),ze(d)&&cr(l,c,d),null!=o&&lr(c,d,a)}function io(e){return rt(ht.lFrame.contextLView,e)}function ro(e,t=m.Default){const n=pt();return null===n?ie(e,t):yn(gt(),n,E(e),t)}function so(e){return function(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const e=n.length;let i=0;for(;i<e;){const r=n[i];if(Kt(r))break;if(0===r)i+=2;else if("number"==typeof r)for(i++;i<e&&"string"==typeof n[i];)i++;else{if(r===t)return n[i+1];i+=2}}}return null}(gt(),e)}function oo(e,t,n){const i=pt();return Js(i,kt(),t)&&pr(mt(),$t(),i,e,t,i[11],n,!1),oo}function ao(e,t,n,i,r){const s=r?"class":"style";Yr(e,n,t.inputs[s],s,i)}function co(e,t,n,i){const r=pt(),s=mt(),o=Ie+e,a=r[11],c=r[o]=er(t,a,ht.lFrame.currentNamespace),l=s.firstCreatePass?function(e,t,n,i,r,s,o){const a=t.consts,c=nr(t,e,2,r,lt(a,s));return mr(t,n,c,lt(a,o)),null!==c.attrs&&Ps(c,c.attrs,!1),null!==c.mergedAttrs&&Ps(c,c.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,c),c}(e,s,r,0,t,n,i):s.data[o];_t(l,!0);const u=l.mergedAttrs;null!==u&&Qt(a,c,u);const d=l.classes;null!==d&&os(a,c,d);const h=l.styles;null!==h&&ss(a,c,h),Xr(s,r,c,l),0===ht.lFrame.elementDepthCount&&Ti(c,r),ht.lFrame.elementDepthCount++,ze(l)&&(cr(s,r,l),ar(s,l,r)),null!==i&&lr(r,l)}function lo(){let e=gt();yt()?vt():(e=e.parent,_t(e,!1));const t=e;ht.lFrame.elementDepthCount--;const n=mt();n.firstCreatePass&&(Ht(n,e),Fe(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&ao(n,t,pt(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&ao(n,t,pt(),t.stylesWithoutHost,!1)}function uo(e,t,n,i){co(e,t,n,i),lo()}function ho(e,t,n){const i=pt(),r=mt(),s=e+Ie,o=r.firstCreatePass?function(e,t,n,i,r){const s=t.consts,o=lt(s,i),a=nr(t,e,3,"ng-container",o);return null!==o&&Ps(a,o,!0),mr(t,n,a,lt(s,r)),null!==t.queries&&t.queries.elementStart(t,a),a}(e,r,i,t,n):r.data[s];_t(o,!0);const a=i[s]=i[11].createComment("");Xr(r,i,a,o),Ti(a,i),ze(o)&&(cr(r,i,o),ar(r,o,i)),null!=n&&lr(i,o)}function fo(){let e=gt();const t=mt();yt()?vt():(e=e.parent,_t(e,!1)),t.firstCreatePass&&(Ht(t,e),Fe(e)&&t.queries.elementEnd(e))}function po(e,t,n){ho(e,t,n),fo()}function mo(){return pt()}function bo(e){return!!e&&"function"==typeof e.then}function go(e){return!!e&&"function"==typeof e.subscribe}function _o(e,t,n=!1,i){const r=pt(),s=mt(),o=gt();return function(e,t,n,i,r,s,o=!1,a){const c=ze(i),l=e.firstCreatePass&&(e.cleanup||(e.cleanup=[])),u=Nr(t);let d=!0;if(2===i.type){const h=nt(i,t),f=a?a(h):ye,p=f.target||h,m=u.length,b=a?e=>a(et(e[i.index])).target:i.index;if(Ze(n)){let o=null;if(!a&&c&&(o=function(e,t,n,i){const r=e.cleanup;if(null!=r)for(let s=0;s<r.length-1;s+=2){const e=r[s];if(e===n&&r[s+1]===i){const e=t[7],n=r[s+2];return e.length>n?e[n]:null}"string"==typeof e&&(s+=2)}return null}(e,t,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=vo(i,t,s,!1);const e=n.listen(f.name||p,r,s);u.push(s,e),l&&l.push(r,b,m,m+1)}}else s=vo(i,t,s,!0),p.addEventListener(r,s,o),u.push(s),l&&l.push(r,b,m,o)}const h=i.outputs;let f;if(d&&null!==h&&(f=h[r])){const e=f.length;if(e)for(let n=0;n<e;n+=2){const e=t[f[n]][f[n+1]].subscribe(s),o=u.length;u.push(s,e),l&&l.push(r,i.index,o,-(o+1))}}}(s,r,r[11],o,e,t,n,i),_o}function yo(e,t,n){try{return!1!==t(n)}catch(i){return Fr(e,i),!1}}function vo(e,t,n,i){return function r(s){if(s===Function)return n;const o=2&e.flags?st(e.index,t):t;0==(32&t[2])&&Er(o);let a=yo(t,n,s),c=r.__ngNextListenerFn__;for(;c;)a=yo(t,c,s)&&a,c=c.__ngNextListenerFn__;return i&&!1===a&&(s.preventDefault(),s.returnValue=!1),a}}function wo(e=1){return function(e){return(ht.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,ht.lFrame.contextLView))[8]}(e)}function So(e,t){let n=null;const i=function(e){const t=e.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(e);for(let r=0;r<t.length;r++){const s=t[r];if("*"!==s){if(null===i?ji(e,s,!0):Ni(i,s))return r}else n=r}return n}function Mo(e){const t=pt()[16][6];if(!t.projection){const n=t.projection=fe(e?e.length:1,null),i=n.slice();let r=t.child;for(;null!==r;){const t=e?So(r,e):0;null!==t&&(i[t]?i[t].projectionNext=r:n[t]=r,i[t]=r),r=r.next}}}let xo=!1;function ko(e){xo=e}function Do(e,t=0,n){const i=pt(),r=mt(),s=nr(r,e,1,null,n||null);null===s.projection&&(s.projection=t),vt(),xo||is(r,i,s)}function To(e,t,n){return Co(e,"",t,"",n),To}function Co(e,t,n,i,r){const s=pt(),o=eo(s,t,n,i);return o!==zi&&pr(mt(),$t(),s,e,o,s[11],r,!1),Co}function Oo(e,t,n,i,r,s,o){const a=pt(),c=to(a,t,n,i,r,s);return c!==zi&&pr(mt(),$t(),a,e,c,a[11],o,!1),Oo}const Ro=[];function Lo(e,t,n,i,r){const s=e[n+1],o=null===t;let a=i?qi(s):Qi(s),c=!1;for(;0!==a&&(!1===c||o);){const n=e[a+1];Eo(e[a],t)&&(c=!0,e[a+1]=i?Zi(n):Ji(n)),a=i?qi(n):Qi(n)}c&&(e[n+1]=i?Ji(s):Zi(s))}function Eo(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&be(e,t)>=0}const Ao={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Io(e){return e.substring(Ao.key,Ao.keyEnd)}function Po(e,t){const n=Ao.textEnd;return n===t?-1:(t=Ao.keyEnd=function(e,t,n){for(;t<n&&e.charCodeAt(t)>32;)t++;return t}(e,Ao.key=t,n),jo(e,t,n))}function jo(e,t,n){for(;t<n&&e.charCodeAt(t)<=32;)t++;return t}function No(e,t,n){return $o(e,t,n,!1),No}function Fo(e,t){return $o(e,t,null,!0),Fo}function Yo(e){Ho(pe,zo,e,!0)}function zo(e,t){for(let n=function(e){return function(e){Ao.key=0,Ao.keyEnd=0,Ao.value=0,Ao.valueEnd=0,Ao.textEnd=e.length}(e),Po(e,jo(e,0,Ao.textEnd))}(t);n>=0;n=Po(t,n))pe(e,Io(t),!0)}function $o(e,t,n,i){const r=pt(),s=mt(),o=Dt(2);s.firstUpdatePass&&Vo(s,e,o,i),t!==zi&&Js(r,o,t)&&Go(s,s.data[Yt()+Ie],r,r[11],e,r[o+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=C(Yn(e)))),e}(t,n),i,o)}function Ho(e,t,n,i){const r=mt(),s=Dt(2);r.firstUpdatePass&&Vo(r,null,s,i);const o=pt();if(n!==zi&&Js(o,s,n)){const a=r.data[Yt()+Ie];if(Qo(a,i)&&!Wo(r,s)){let e=i?a.classesWithoutHost:a.stylesWithoutHost;null!==e&&(n=O(e,n||"")),ao(r,a,o,n,i)}else!function(e,t,n,i,r,s,o,a){r===zi&&(r=Ro);let c=0,l=0,u=0<r.length?r[0]:null,d=0<s.length?s[0]:null;for(;null!==u||null!==d;){const h=c<r.length?r[c+1]:void 0,f=l<s.length?s[l+1]:void 0;let p=null,m=void 0;u===d?(c+=2,l+=2,h!==f&&(p=d,m=f)):null===d||null!==u&&u<d?(c+=2,p=u):(l+=2,p=d,m=f),null!==p&&Go(e,t,n,i,p,m,o,a),u=c<r.length?r[c]:null,d=l<s.length?s[l]:null}}(r,a,o,o[11],o[s+1],o[s+1]=function(e,t,n){if(null==n||""===n)return Ro;const i=[],r=Yn(n);if(Array.isArray(r))for(let s=0;s<r.length;s++)e(i,r[s],!0);else if("object"==typeof r)for(const s in r)r.hasOwnProperty(s)&&e(i,s,r[s]);else"string"==typeof r&&t(i,r);return i}(e,t,n),i,s)}}function Wo(e,t){return t>=e.expandoStartIndex}function Vo(e,t,n,i){const r=e.data;if(null===r[n+1]){const s=r[Yt()+Ie],o=Wo(e,n);Qo(s,i)&&null===t&&!o&&(t=!1),t=function(e,t,n,i){const r=Ot(e);let s=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=Uo(n=Bo(null,e,t,n,i),t.attrs,i),s=null);else{const o=t.directiveStylingLast;if(-1===o||e[o]!==r)if(n=Bo(r,e,t,n,i),null===s){let n=function(e,t,n){const i=n?t.classBindings:t.styleBindings;if(0!==Qi(i))return e[qi(i)]}(e,t,i);void 0!==n&&Array.isArray(n)&&(n=Bo(null,e,t,n[1],i),n=Uo(n,t.attrs,i),function(e,t,n,i){e[qi(n?t.classBindings:t.styleBindings)]=i}(e,t,i,n))}else s=function(e,t,n){let i=void 0;const r=t.directiveEnd;for(let s=1+t.directiveStylingLast;s<r;s++)i=Uo(i,e[s].hostAttrs,n);return Uo(i,t.attrs,n)}(e,t,i)}return void 0!==s&&(i?t.residualClasses=s:t.residualStyles=s),n}(r,s,t,i),function(e,t,n,i,r,s){let o=s?t.classBindings:t.styleBindings,a=qi(o),c=Qi(o);e[i]=n;let l,u=!1;if(Array.isArray(n)){const e=n;l=e[1],(null===l||be(e,l)>0)&&(u=!0)}else l=n;if(r)if(0!==c){const t=qi(e[a+1]);e[i+1]=Gi(t,a),0!==t&&(e[t+1]=Ki(e[t+1],i)),e[a+1]=131071&e[a+1]|i<<17}else e[i+1]=Gi(a,0),0!==a&&(e[a+1]=Ki(e[a+1],i)),a=i;else e[i+1]=Gi(c,0),0===a?a=i:e[c+1]=Ki(e[c+1],i),c=i;u&&(e[i+1]=Ji(e[i+1])),Lo(e,l,i,!0),Lo(e,l,i,!1),function(e,t,n,i,r){const s=r?e.residualClasses:e.residualStyles;null!=s&&"string"==typeof t&&be(s,t)>=0&&(n[i+1]=Zi(n[i+1]))}(t,l,e,i,s),o=Gi(a,c),s?t.classBindings=o:t.styleBindings=o}(r,s,t,n,o,i)}}function Bo(e,t,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a<o&&(s=t[a],i=Uo(i,s.hostAttrs,r),s!==e);)a++;return null!==e&&(n.directiveStylingLast=a),i}function Uo(e,t,n){const i=n?1:2;let r=-1;if(null!==t)for(let s=0;s<t.length;s++){const o=t[s];"number"==typeof o?r=o:r===i&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),pe(e,o,!!n||t[++s]))}return void 0===e?null:e}function Go(e,t,n,i,r,s,o,a){if(2!==t.type)return;const c=e.data,l=c[a+1];Jo(1==(1&l)?qo(c,t,n,r,Qi(l),o):void 0)||(Jo(s)||2==(2&l)&&(s=qo(c,null,n,r,a,o)),function(e,t,n,i,r){const s=Ze(e);if(t)r?s?e.addClass(n,i):n.classList.add(i):s?e.removeClass(n,i):n.classList.remove(i);else{const t=-1==i.indexOf("-")?void 0:2;null==r?s?e.removeStyle(n,i,t):n.style.removeProperty(i):s?e.setStyle(n,i,r,t):n.style.setProperty(i,r)}}(i,o,tt(Yt(),n),r,s))}function qo(e,t,n,i,r,s){const o=null===t;let a=void 0;for(;r>0;){const t=e[r],s=Array.isArray(t),c=s?t[1]:t,l=null===c;let u=n[r+1];u===zi&&(u=l?Ro:void 0);let d=l?me(u,i):c===i?u:void 0;if(s&&!Jo(d)&&(d=me(t,i)),Jo(d)&&(a=d,o))return a;const h=e[r+1];r=o?qi(h):Qi(h)}if(null!==t){let e=s?t.residualClasses:t.residualStyles;null!=e&&(a=me(e,i))}return a}function Jo(e){return void 0!==e}function Qo(e,t){return 0!=(e.flags&(t?16:32))}function Ko(e,t=""){const n=pt(),i=mt(),r=e+Ie,s=i.firstCreatePass?nr(i,e,2,null,null):i.data[r],o=n[r]=Hr(t,n[11]);Xr(i,n,o,s),_t(s,!1)}function Zo(e){return Xo("",e,""),Zo}function Xo(e,t,n){const i=pt(),r=eo(i,e,t,n);return r!==zi&&zr(i,Yt(),r),Xo}function ea(e,t,n,i,r){const s=pt(),o=to(s,e,t,n,i,r);return o!==zi&&zr(s,Yt(),o),ea}function ta(e,t,n,i,r,s,o){const a=pt(),c=function(e,t,n,i,r,s,o,a){const c=Ks(e,xt(),n,r,o);return Dt(3),c?t+sn(n)+i+sn(r)+s+sn(o)+a:zi}(a,e,t,n,i,r,s,o);return c!==zi&&zr(a,Yt(),c),ta}function na(e,t,n){Ho(pe,zo,eo(pt(),e,t,n),!0)}function ia(e,t,n,i,r){Ho(pe,zo,to(pt(),e,t,n,i,r),!0)}function ra(e,t,n,i,r,s,o,a,c){Ho(pe,zo,function(e,t,n,i,r,s,o,a,c,l){const u=Zs(e,xt(),n,r,o,c);return Dt(4),u?t+sn(n)+i+sn(r)+s+sn(o)+a+sn(c)+l:zi}(pt(),e,t,n,i,r,s,o,a,c),!0)}function sa(e,t,n){const i=pt();return Js(i,kt(),t)&&pr(mt(),$t(),i,e,t,i[11],n,!0),sa}function oa(e,t,n){const i=pt();if(Js(i,kt(),t)){const r=mt(),s=$t();pr(r,s,i,e,t,function(e,t,n){return(null===e||$e(e))&&(n=function(e){for(;Array.isArray(e);){if("object"==typeof e[1])return e;e=e[0]}return null}(n[t.index])),n[11]}(Ot(r.data),s,i),n,!0)}return oa}function aa(e,t,n,i,r){if(e=E(e),Array.isArray(e))for(let s=0;s<e.length;s++)aa(e[s],t,n,i,r);else{const s=mt(),o=pt();let a=Ls(e)?e:E(e.provide),c=Cs(e);const l=gt(),u=1048575&l.providerIndexes,d=l.directiveStart,h=l.providerIndexes>>20;if(Ls(e)||!e.multi){const i=new Jt(c,r,ro),f=ua(a,t,r?u:u+h,d);-1===f?(_n(pn(l,o),s,a),ca(s,e,t.length),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(i),o.push(i)):(n[f]=i,o[f]=i)}else{const f=ua(a,t,u+h,d),p=ua(a,t,u,u+h),m=f>=0&&n[f],b=p>=0&&n[p];if(r&&!b||!r&&!m){_n(pn(l,o),s,a);const u=function(e,t,n,i,r){const s=new Jt(e,n,ro);return s.multi=[],s.index=t,s.componentProviders=0,la(s,r,i&&!n),s}(r?ha:da,n.length,r,i,c);!r&&b&&(n[p].providerFactory=u),ca(s,e,t.length,0),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(u),o.push(u)}else ca(s,e,f>-1?f:p,la(n[r?p:f],c,!r&&i));!r&&i&&b&&n[p].componentProviders++}}}function ca(e,t,n,i){const r=Ls(t);if(r||t.useClass){const s=(t.useClass||t).prototype.ngOnDestroy;if(s){const o=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){const e=o.indexOf(n);-1===e?o.push(n,[i,s]):o[e+1].push(i,s)}else o.push(n,s)}}}function la(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function ua(e,t,n,i){for(let r=n;r<i;r++)if(t[r]===e)return r;return-1}function da(e,t,n,i){return fa(this.multi,[])}function ha(e,t,n,i){const r=this.multi;let s;if(this.providerFactory){const e=this.providerFactory.componentProviders,t=Mn(n,n[1],this.providerFactory.index,i);s=t.slice(0,e),fa(r,s);for(let n=e;n<t.length;n++)s.push(t[n])}else s=[],fa(r,s);return s}function fa(e,t){for(let n=0;n<e.length;n++)t.push((0,e[n])());return t}function pa(e,t=[]){return n=>{n.providersResolver=(n,i)=>function(e,t,n){const i=mt();if(i.firstCreatePass){const r=$e(e);aa(n,i.data,i.blueprint,r,!0),aa(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}class ma{}class ba{}class ga{resolveComponentFactory(e){throw function(e){const t=Error(`No component factory found for ${C(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(e)}}let _a=(()=>{class e{}return e.NULL=new ga,e})(),ya=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=()=>va(e),e})();const va=function(e){return hs(e,gt(),pt())};class wa{}var Sa=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({});let Ma=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>xa(),e})();const xa=function(){const e=pt(),t=st(gt().index,e);return function(e){const t=e[11];if(Ze(t))return t;throw new Error("Cannot inject Renderer2 when the application uses Renderer3!")}(je(t)?t:e)};let ka=(()=>{class e{}return e.\u0275prov=_({token:e,providedIn:"root",factory:()=>null}),e})();class Da{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const Ta=new Da("10.1.5");class Ca{constructor(){}supports(e){return Bs(e)}create(e){return new Ra(e)}}const Oa=(e,t)=>t;class Ra{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Oa}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,n=this._removalsHead,i=0,r=null;for(;t||n;){const s=!n||t&&t.currentIndex<Ia(n,i,r)?t:n,o=Ia(s,i,r),a=s.currentIndex;if(s===n)i--,n=n._nextRemoved;else if(t=t._next,null==s.previousIndex)i++;else{r||(r=[]);const e=o-i,t=a-i;if(e!=t){for(let n=0;n<e;n++){const i=n<r.length?r[n]:r[n]=0,s=i+n;t<=s&&s<e&&(r[n]=i+1)}r[s.previousIndex]=t-e}}o!==a&&e(s,o,a)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!Bs(e))throw new Error(`Error trying to diff '${C(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,n,i,r=this._itHead,s=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)n=e[t],i=this._trackByFn(t,n),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,n,i,t)),Object.is(r.item,n)||this._addIdentityChange(r,n)):(r=this._mismatch(r,n,i,t),s=!0),r=r._next}else t=0,function(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)t(e[n]);else{const n=e[Ws()]();let i;for(;!(i=n.next()).done;)t(i.value)}}(e,e=>{i=this._trackByFn(t,e),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,e,i,t)),Object.is(r.item,e)||this._addIdentityChange(r,e)):(r=this._mismatch(r,e,i,t),s=!0),r=r._next,t++}),this.length=t;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,n,i){let r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,r,i)):null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,r,i)):e=this._addAfter(new La(t,n),r,i),e}_verifyReinsertion(e,t,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?e=this._reinsertAfter(r,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const i=e._prevRemoved,r=e._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(e,t,n),this._addToMoves(e,n),e}_moveAfter(e,t,n){return this._unlink(e),this._insertAfter(e,t,n),this._addToMoves(e,n),e}_addAfter(e,t,n){return this._insertAfter(e,t,n),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,n){const i=null===t?this._itHead:t._next;return e._next=i,e._prev=t,null===i?this._itTail=e:i._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new Aa),this._linkedRecords.put(e),e.currentIndex=n,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,n=e._next;return null===t?this._itHead=n:t._next=n,null===n?this._itTail=t:n._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Aa),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class La{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Ea{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<=n.currentIndex)&&Object.is(n.trackById,e))return n;return null}remove(e){const t=e._prevDup,n=e._nextDup;return null===t?this._head=n:t._nextDup=n,null===n?this._tail=t:n._prevDup=t,null===this._head}}class Aa{constructor(){this.map=new Map}put(e){const t=e.trackById;let n=this.map.get(t);n||(n=new Ea,this.map.set(t,n)),n.add(e)}get(e,t){const n=this.map.get(e);return n?n.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Ia(e,t,n){const i=e.previousIndex;if(null===i)return i;let r=0;return n&&i<n.length&&(r=n[i]),i+t+r}class Pa{constructor(){}supports(e){return e instanceof Map||Us(e)}create(){return new ja}}class ja{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||Us(e)))throw new Error(`Error trying to diff '${C(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,n)=>{if(t&&t.key===n)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const i=this._getOrCreateRecordForKey(n,e);t=this._insertBeforeOrAppend(t,i)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const n=e._prev;return t._next=e,t._prev=n,e._prev=t,n&&(n._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const n=this._records.get(e);this._maybeAddToChanges(n,t);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new Na(e);return this._records.set(e,n),n.currentValue=t,this._addToAdditions(n),n}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(n=>t(e[n],n))}}class Na{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let Fa=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(null!=n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return e.create(t,n)},deps:[[e,new p,new h]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${n=e,n.name||typeof n}'`);var n}}return e.\u0275prov=_({token:e,providedIn:"root",factory:()=>new e([new Ca])}),e})(),Ya=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return e.create(t,n)},deps:[[e,new p,new h]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.\u0275prov=_({token:e,providedIn:"root",factory:()=>new e([new Pa])}),e})();const za=[new Pa],$a=new Fa([new Ca]),Ha=new Ya(za);let Wa=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>Va(e,ya),e})();const Va=function(e,t){return fs(e,t,gt(),pt())};let Ba=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>Ua(e,ya),e})();const Ua=function(e,t){return ps(e,t,gt(),pt())},Ga={};class qa extends _a{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=Le(e);return new Ka(t,this.ngModule)}}function Ja(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}const Qa=new U("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>an});class Ka extends ba{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=e.selectors.map(Yi).join(","),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return Ja(this.componentDef.inputs)}get outputs(){return Ja(this.componentDef.outputs)}create(e,t,n,i){const r=(i=i||this.ngModule)?function(e,t){return{get:(n,i,r)=>{const s=e.get(n,Ga,r);return s!==Ga||i===Ga?s:t.get(n,i,r)}}}(e,i.injector):e,s=r.get(wa,Xe),o=r.get(ka,null),a=s.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",l=n?function(e,t,n){if(Ze(e))return e.selectRootElement(t,n===_e.ShadowDom);let i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(a,n,this.componentDef.encapsulation):er(c,s.createRenderer(null,this.componentDef),function(e){const t=e.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(c)),u=this.componentDef.onPush?576:528,d={components:[],scheduler:an,clean:jr,playerHandler:null,flags:0},h=dr(0,null,null,1,0,null,null,null,null,null),f=tr(null,h,d,u,null,null,s,a,o,r);let p,m;At(f);try{const e=function(e,t,n,i,r,s){const o=n[1];n[20]=e;const a=nr(o,0,2,null,null),c=a.mergedAttrs=t.hostAttrs;null!==c&&(Ps(a,c,!0),null!==e&&(Qt(r,e,c),null!==a.classes&&os(r,e,a.classes),null!==a.styles&&ss(r,e,a.styles)));const l=i.createRenderer(e,t),u=tr(n,ur(t),null,t.onPush?64:16,n[20],a,i,l,null,null);return o.firstCreatePass&&(_n(pn(a,n),o,t.type),vr(o,a),Sr(a,n.length,1)),Lr(n,u),n[20]=u}(l,this.componentDef,f,s,a);if(l)if(n)Qt(a,l,["ng-version",Ta.full]);else{const{attrs:e,classes:t}=function(e){const t=[],n=[];let i=1,r=2;for(;i<e.length;){let s=e[i];if("string"==typeof s)2===r?""!==s&&t.push(s,e[++i]):8===r&&n.push(s);else{if(!Ii(r))break;r=s}i++}return{attrs:t,classes:n}}(this.componentDef.selectors[0]);e&&Qt(a,l,e),t&&t.length>0&&os(a,l,t.join(" "))}if(m=it(h,0),void 0!==t){const e=m.projection=[];for(let n=0;n<this.ngContentSelectors.length;n++){const i=t[n];e.push(null!=i?Array.from(i):null)}}p=function(e,t,n,i,r){const s=n[1],o=function(e,t,n){const i=gt();e.firstCreatePass&&(n.providersResolver&&n.providersResolver(n),yr(e,i,1),Mr(e,t,n));const r=Mn(t,e,t.length-1,i);Ti(r,t);const s=nt(i,t);return s&&Ti(s,t),r}(s,n,t);i.components.push(o),e[8]=o,r&&r.forEach(e=>e(o,t)),t.contentQueries&&t.contentQueries(1,o,n.length-1);const a=gt();if(s.firstCreatePass&&(null!==t.hostBindings||null!==t.hostAttrs)){zt(a.index-Ie);const e=n[1];br(e,t),gr(e,n,t.hostVars),_r(t,o)}return o}(e,this.componentDef,f,d,[js]),ir(h,f,null)}finally{Ft()}return new Za(this.componentType,p,hs(ya,m,f),f,m)}}class Za extends ma{constructor(e,t,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.destroyCbs=[],this.instance=t,this.hostView=this.changeDetectorRef=new cs(i),this.componentType=e}get injector(){return new Dn(this._tNode,this._rootLView)}destroy(){this.destroyCbs&&(this.destroyCbs.forEach(e=>e()),this.destroyCbs=null,!this.hostView.destroyed&&this.hostView.destroy())}onDestroy(e){this.destroyCbs&&this.destroyCbs.push(e)}}const Xa=void 0;var ec=["en",[["a","p"],["AM","PM"],Xa],[["AM","PM"],Xa,Xa],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Xa,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Xa,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Xa,"{1} 'at' {0}",Xa],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}];let tc={};function nc(e,t,n){"string"!=typeof t&&(n=t,t=e[ac.LocaleId]),t=t.toLowerCase().replace(/_/g,"-"),tc[t]=e,n&&(tc[t][ac.ExtraData]=n)}function ic(e){const t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=oc(t);if(n)return n;const i=t.split("-")[0];if(n=oc(i),n)return n;if("en"===i)return ec;throw new Error(`Missing locale data for the locale "${e}".`)}function rc(e){return ic(e)[ac.CurrencyCode]||null}function sc(e){return ic(e)[ac.PluralCase]}function oc(e){return e in tc||(tc[e]=F.ng&&F.ng.common&&F.ng.common.locales&&F.ng.common.locales[e]),tc[e]}var ac=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}({});const cc=["zero","one","two","few","many"],lc="en-US";let uc=lc;function dc(e){var t,n;n="Expected localeId to be defined",null==(t=e)&&function(e,t,n,i){throw new Error("ASSERTION ERROR: "+e+` [Expected=> null != ${t} <=Actual]`)}(n,t),"string"==typeof e&&(uc=e.toLowerCase().replace(/_/g,"-"))}const hc={marker:"element"},fc={marker:"comment"},pc=[];let mc=-1,bc=0,gc=0;function _c(e,t,n,i){const r=i[11];let s=null,o=null;const a=[];for(let c=0;c<n.length;c++){const l=n[c];if("string"==typeof l){const t=Hr(l,r),u=n[++c];o=s,s=xc(e,i,u,2,t,null),a.push(u),vt()}else if("number"==typeof l)switch(7&l){case 1:const r=l>>>17;let u;u=r===t?i[6]:it(e,r),o=Sc(e,s,u,o,i);break;case 0:const d=l>=0,h=(d?l:~l)>>>3;a.push(h),o=s,s=it(e,h),s&&_t(s,d);break;case 5:o=s=it(e,l>>>3),_t(s,!1);break;case 4:const f=n[++c],p=n[++c];kr(it(e,l>>>3),i,f,p,null,null);break;default:throw new Error(`Unable to determine the type of mutate operation for "${l}"`)}else switch(l){case fc:const t=n[++c],u=n[++c],d=r.createComment(t);o=s,s=xc(e,i,u,4,d,null),a.push(u),Ti(d,i),vt();break;case hc:const h=n[++c],f=n[++c];o=s,s=xc(e,i,f,2,r.createElement(h),h),a.push(f);break;default:throw new Error(`Unable to determine the type of mutate operation for "${l}"`)}}return vt(),a}function yc(e,t,n,i,r,s){let o=!1;for(let a=0;a<i.length;a++){const c=i[a],l=i[++a];if(c&s){let s="";for(let c=a+1;c<=a+l;c++){const a=i[c];if("string"==typeof a)s+=a;else if("number"==typeof a)if(a<0)s+=sn(n[r-a]);else{const l=a>>>2;switch(3&a){case 1:const a=i[++c],u=i[++c];pr(e,it(e,l),n,a,s,n[11],u,!1);break;case 0:zr(n,l,s);break;case 2:o=wc(e,t,i[++c],n,s);break;case 3:vc(e,t,i[++c],r,n,o)}}}}a+=l}}function vc(e,t,n,i,r,s){const o=t[n],a=r[o.currentCaseLViewIndex];null!==a&&yc(e,t,r,o.update[a],i,s?-1:bc)}function wc(e,t,n,i,r){!function e(t,n,i,r){const s=n[i],o=r[s.currentCaseLViewIndex];if(null!==o){const i=s.remove[o];for(let s=0;s<i.length;s++){const o=i[s],a=o>>>3;switch(7&o){case 3:Mc(t,r,a,!1);break;case 6:e(t,n,a,r)}}}}(e,t,n,i);let s=!1;const o=t[n],a=function(e,t){let n=e.cases.indexOf(t);if(-1===n)switch(e.type){case 1:{const i=function(e,t){const n=sc(t)(parseInt(e,10)),i=cc[n];return void 0!==i?i:"other"}(t,uc);n=e.cases.indexOf(i),-1===n&&"other"!==i&&(n=e.cases.indexOf("other"));break}case 0:n=e.cases.indexOf("other")}return n}(o,r);return i[o.currentCaseLViewIndex]=-1!==a?a:null,a>-1&&(_c(e,-1,o.create[a],i),s=!0),s}function Sc(e,t,n,i,r){const s=t.next;i||(i=n),i===n&&t!==n.child?(t.next=n.child,null===t.parent?e.firstChild=t:n.child=t):i!==n&&t!==i.next?(t.next=i.next,i.next=t):t.next=null,n!==r[6]&&(t.parent=n);let o=t.next;for(;o;)o.next===t&&(o.next=s),o=o.next;if(1===t.type)return is(e,r,t),t;Xr(e,r,nt(t,r),t);const a=r[t.index];return 0!==t.type&&Ne(a)&&Xr(e,r,a[7],t),t}function Mc(e,t,n,i){const r=it(e,n),s=tt(n,t);s&&es(t[11],s);const o=rt(t,n);if(Ne(o)){const e=o;0!==r.type&&es(t[11],e[7])}i&&r&&(r.flags|=64)}function xc(e,t,n,i,r,s){const o=gt();t[n+Ie]=r;const a=nr(e,n,i,s,null);return o&&o.next===a&&(o.next=null),a}const kc=/\ufffd(\d+):?\d*\ufffd/gi,Dc=/({\s*\ufffd\d+:?\d*\ufffd\s*,\s*\S{6}\s*,[\s\S]*})/gi,Tc=/\ufffd(\d+)\ufffd/,Cc=/^\s*(\ufffd\d+:?\d*\ufffd)\s*,\s*(select|plural)\s*,/;let Oc;const Rc=[],Lc=/\ufffd\/?\*(\d+:\d+)\ufffd/gi,Ec=/\ufffd(\/?[#*!]\d+):?\d*\ufffd/gi,Ac=/\uE500/g;function Ic(e,t,n,i=null){const r=[null,null],s=e.split(kc);let o=0;for(let a=0;a<s.length;a++){const e=s[a];if(1&a){const t=parseInt(e,10);r.push(-1-t),o|=Nc(t)}else""!==e&&r.push(e)}return r.push(t<<2|(n?1:0)),n&&r.push(n,i),r[0]=o,r[1]=r.length-2,r}function Pc(e,t=0){let n;t|=Nc(e.mainBinding);for(let i=0;i<e.values.length;i++){const r=e.values[i];for(let e=0;e<r.length;e++){const i=r[e];if("string"==typeof i)for(;n=kc.exec(i);)t|=Nc(parseInt(n[1],10));else t=Pc(i,t)}}return t}function jc(e){return e+Oc++}function Nc(e){return 1<<Math.min(e,31)}function Fc(e){return void 0===e}function Yc(e){let t,n,i="",r=0,s=!1;for(;null!==(t=Lc.exec(e));)s?t[0]===`\ufffd/*${n}\ufffd`&&(r=t.index,s=!1):(i+=e.substring(r,t.index+t[0].length),n=t[1],s=!0);return i+=e.substr(r),i}function zc(e,t,n,i){const r=[],s=[],o=[],a=[],c=[],l=t.values;for(let u=0;u<l.length;u++){const t=l[u],d=[];for(let e=0;e<t.length;e++){const n=t[e];if("string"!=typeof n){const i=d.push(n)-1;t[e]=`\x3c!--\ufffd${i}\ufffd--\x3e`}}const h=Hc(t.join(""),n,d,e,i);r.push(h.create),s.push(h.remove),o.push(h.update),a.push(h.vars),c.push(h.childIcus)}e.push({type:t.type,vars:a,currentCaseLViewIndex:Ie+i+1,childIcus:c,cases:t.cases,create:r,remove:s,update:o}),Oc+=Math.max(...a)}function $c(e){const t=[],n=[];let i=1,r=0;const s=Wc(e=e.replace(Cc,(function(e,t,n){return i="select"===n?0:1,r=parseInt(t.substr(1),10),""})));for(let o=0;o<s.length;){let e=s[o++].trim();1===i&&(e=e.replace(/\s*(?:=)?(\w+)\s*/,"$1")),e.length&&t.push(e);const r=Wc(s[o++]);t.length>n.length&&n.push(r)}return{type:i,mainBinding:r,cases:t,values:n}}function Hc(e,t,n,i,r){const s=Kn(Ke()).getInertBodyElement(e);if(!s)throw new Error("Unable to generate inert body element");const o={vars:1,childIcus:[],create:[],remove:[],update:[]};return function e(t,n,i,r,s,o){if(t){const a=[];for(;t;){const c=t.nextSibling,l=o+ ++n.vars;switch(t.nodeType){case Node.ELEMENT_NODE:const c=t,u=c.tagName.toLowerCase();if(ui.hasOwnProperty(u)){n.create.push(hc,u,l,i<<17|1);const a=c.attributes;for(let e=0;e<a.length;e++){const t=a.item(e),i=t.name.toLowerCase();t.value.match(kc)?fi.hasOwnProperty(i)&&le(di[i]?Ic(t.value,l,t.name,ni):hi[i]?Ic(t.value,l,t.name,ii):Ic(t.value,l,t.name),n.update):n.create.push(l<<3|4,t.name,t.value)}e(t.firstChild,n,l,r,s,o),n.remove.push(l<<3|3)}else n.vars--;break;case Node.TEXT_NODE:const d=t.textContent||"",h=d.match(kc);n.create.push(h?"":d,l,i<<17|1),n.remove.push(l<<3|3),h&&le(Ic(d,l),n.update);break;case Node.COMMENT_NODE:const f=Tc.exec(t.textContent||"");if(f){const e=parseInt(f[1],10);n.create.push(fc,"",l,i<<17|1),a.push([r[e],l])}else n.vars--;break;default:n.vars--}t=c}for(let e=0;e<a.length;e++){const t=a[e][0],i=a[e][1];zc(s,t,i,o+n.vars);const r=s.length-1;n.vars+=Math.max(...s[r].vars),n.childIcus.push(r);const c=Pc(t);n.update.push(Nc(t.mainBinding),3,-1-t.mainBinding,i<<2|2,r,c,2,i<<2|3,r),n.remove.push(r<<3|6,i<<3|3)}}}((wi(s)||s).firstChild,o,t,n,i,r),o}function Wc(e){if(!e)return[];let t=0;const n=[],i=[],r=/[{}]/g;let s;for(r.lastIndex=0;s=r.exec(e);){const r=s.index;if("}"==s[0]){if(n.pop(),0==n.length){const n=e.substring(t,r);Cc.test(n)?i.push($c(n)):i.push(n),t=r+1}}else{if(0==n.length){const n=e.substring(t,r);i.push(n),t=r+1}n.push("{")}}const o=e.substring(t);return i.push(o),i}const Vc=/\[(\ufffd.+?\ufffd?)\]/,Bc=/\[(\ufffd.+?\ufffd?)\]|(\ufffd\/?\*\d+:\d+\ufffd)/g,Uc=/({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g,Gc=/{([A-Z0-9_]+)}/g,qc=/\ufffdI18N_EXP_(ICU(_\d+)?)\ufffd/g,Jc=/\/\*/,Qc=/\d+\:(\d+)/;function Kc(e,t,n){const i=mt(),r=lt(i.consts,t);!function(e){pc[++mc]=e}(e),ko(!0),i.firstCreatePass&&null===i.data[e+Ie]&&function(e,t,n,i,r){const s=t.blueprint.length-Ie;Oc=0;const o=gt(),a=yt()?o:o&&o.parent;let c=a&&a!==e[6]?a.index-Ie:n,l=0;Rc[l]=c;const u=[];if(n>0&&o!==a){let e=o.index-Ie;yt()||(e=~e),u.push(e<<3|0)}const d=[],h=[];if(""===i&&Fc(r))u.push(i,jc(s),c<<17|1);else{const e=function(e,t){if(Fc(t))return Yc(e);{const n=e.indexOf(`:${t}\ufffd`)+2+t.toString().length,i=e.search(new RegExp(`\ufffd\\/\\*\\d+:${t}\ufffd`));return Yc(e.substring(n,i))}}(i,r),t=(f=e,f.replace(Ac," ")).split(Ec);for(let n=0;n<t.length;n++){let i=t[n];if(1&n)if("/"===i.charAt(0)){if("#"===i.charAt(1)){const e=parseInt(i.substr(2),10);c=Rc[--l],u.push(e<<3|5)}}else{const e=parseInt(i.substr(1),10),t="#"===i.charAt(0);u.push((t?e:~e)<<3|0,c<<17|1),t&&(Rc[++l]=c=e)}else{const t=Wc(i);for(let n=0;n<t.length;n++)if(1&n){const i=t[n];if("object"!=typeof i)throw new Error(`Unable to parse ICU expression in "${e}" message.`);const r=jc(s);u.push(fc,"",r,c<<17|1);const o=Pc(i);zc(h,i,r,r);const a=h.length-1;d.push(Nc(i.mainBinding),3,-1-i.mainBinding,r<<2|2,a,o,2,r<<2|3,a)}else if(""!==t[n]){const e=t[n],i=e.match(kc),r=jc(s);u.push(i?"":e,r,c<<17|1),i&&le(Ic(e,r),d)}}}}var f;Oc>0&&function(e,t,n){if(n>0&&e.firstCreatePass){for(let i=0;i<n;i++)e.blueprint.push(null),e.data.push(null),t.push(null);e.expandoInstructions?e.expandoInstructions.push(n):e.expandoStartIndex+=n}}(t,e,Oc),t.data[n+Ie]={vars:Oc,create:u,update:d,icus:h.length?h:null}}(pt(),i,e,r,n)}function Zc(){const e=pt();(function(e,t){const n=pc[mc--],i=e.data[n+Ie],r=gt(),s=_c(e,n,i.create,t);let o=n+1;for(;null!==r&&o<=r.index-Ie;){-1===s.indexOf(o)&&Mc(e,t,o,!0);const n=it(e,o);!n||0!==n.type&&2!==n.type&&3!==n.type||null===n.localNames||(o+=n.localNames.length>>1),o++}})(mt(),e),ko(!1)}function Xc(e,t,n){Kc(e,t,n),Zc()}function el(e,t){const n=pt(),i=mt();!function(e,t,n,i){const r=gt().index-Ie,s=[];for(let o=0;o<i.length;o+=2){const a=i[o],c=i[o+1].split(Dc);for(let i=0;i<c.length;i++){const o=c[i];if(1&i)throw new Error("ICU expressions are not yet supported in attributes");if(""!==o)if(o.match(kc))t.firstCreatePass&&null===t.data[n+Ie]&&le(Ic(o,r,a),s);else{const n=it(t,r);2===n.type&&kr(n,e,a,o,null,null);const i=null!==n.inputs&&n.inputs[a];i&&Yr(t,e,i,a,o)}}}t.firstCreatePass&&null===t.data[n+Ie]&&(t.data[n+Ie]=s)}(n,i,e,lt(i.consts,t))}function tl(e){return Js(pt(),kt(),e)&&(bc|=1<<gc),gc++,tl}function nl(e){!function(e,t,n){if(gc>0){const i=e.data[n+Ie];let r,s=null;Array.isArray(i)?r=i:(r=i.update,s=i.icus),yc(e,s,t,r,xt()-gc-1,bc),bc=0,gc=0}}(mt(),pt(),e)}function il(e,t={}){return function(e,t={}){let n=e;if(Vc.test(e)){const e={},t=[0];n=n.replace(Bc,(n,i,r)=>{const s=i||r,o=e[s]||[];if(o.length||(s.split("|").forEach(e=>{const t=e.match(Qc),n=t?parseInt(t[1],10):0,i=Jc.test(e);o.push([n,i,e])}),e[s]=o),!o.length)throw new Error("i18n postprocess: unmatched placeholder - "+s);const a=t[t.length-1];let c=0;for(let e=0;e<o.length;e++)if(o[e][0]===a){c=e;break}const[l,u,d]=o[c];return u?t.pop():a!==l&&t.push(l),o.splice(c,1),d})}return Object.keys(t).length?(n=n.replace(Uc,(e,n,i,r,s,o)=>t.hasOwnProperty(i)?`${n}${t[i]}${o}`:e),n=n.replace(Gc,(e,n)=>t.hasOwnProperty(n)?t[n]:e),n=n.replace(qc,(e,n)=>{if(t.hasOwnProperty(n)){const i=t[n];if(!i.length)throw new Error(`i18n postprocess: unmatched ICU - ${e} with key: ${n}`);return i.shift()}return e}),n):n}(e,t)}const rl=new Map;class sl extends ae{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new qa(this);const n=Ae(e),i=e[W]||null;i&&dc(i),this._bootstrapComponents=un(n.bootstrap),this._r3Injector=ks(e,t,[{provide:ae,useValue:this},{provide:_a,useValue:this.componentFactoryResolver}],C(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=As.THROW_IF_NOT_FOUND,n=m.Default){return e===As||e===ae||e===G?this:this._r3Injector.get(e,t,n)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class ol extends ce{constructor(e){super(),this.moduleType=e,null!==Ae(e)&&function e(t){if(null!==t.\u0275mod.id){const e=t.\u0275mod.id;(function(e,t,n){if(t&&t!==n)throw new Error(`Duplicate module registered for ${e} - ${C(t)} vs ${C(t.name)}`)})(e,rl.get(e),t),rl.set(e,t)}let n=t.\u0275mod.imports;n instanceof Function&&(n=n()),n&&n.forEach(t=>e(t))}(e)}create(e){return new sl(this.moduleType,e)}}function al(e,t,n){const i=Mt()+e,r=pt();return r[i]===zi?Gs(r,i,n?t.call(n):t()):qs(r,i)}function cl(e,t,n,i){return pl(pt(),Mt(),e,t,n,i)}function ll(e,t,n,i,r){return ml(pt(),Mt(),e,t,n,i,r)}function ul(e,t,n,i,r,s){return bl(pt(),Mt(),e,t,n,i,r,s)}function dl(e,t,n,i,r,s,o){return function(e,t,n,i,r,s,o,a,c){const l=t+n;return Zs(e,l,r,s,o,a)?Gs(e,l+4,c?i.call(c,r,s,o,a):i(r,s,o,a)):fl(e,l+4)}(pt(),Mt(),e,t,n,i,r,s,o)}function hl(e,t,n,i,r,s,o,a){const c=Mt()+e,l=pt(),u=Zs(l,c,n,i,r,s);return Js(l,c+4,o)||u?Gs(l,c+5,a?t.call(a,n,i,r,s,o):t(n,i,r,s,o)):qs(l,c+5)}function fl(e,t){const n=e[t];return n===zi?void 0:n}function pl(e,t,n,i,r,s){const o=t+n;return Js(e,o,r)?Gs(e,o+1,s?i.call(s,r):i(r)):fl(e,o+1)}function ml(e,t,n,i,r,s,o){const a=t+n;return Qs(e,a,r,s)?Gs(e,a+2,o?i.call(o,r,s):i(r,s)):fl(e,a+2)}function bl(e,t,n,i,r,s,o,a){const c=t+n;return Ks(e,c,r,s,o)?Gs(e,c+3,a?i.call(a,r,s,o):i(r,s,o)):fl(e,c+3)}function gl(e,t){const n=mt();let i;const r=e+Ie;n.firstCreatePass?(i=function(e,t){if(t)for(let n=t.length-1;n>=0;n--){const i=t[n];if(e===i.name)return i}throw new Error(`The pipe '${e}' could not be found!`)}(t,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=Ee(i.type)),o=te(ro);try{const t=hn(!1),i=s();return hn(t),function(e,t,n,i){const r=n+Ie;r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=i}(n,pt(),e,i),i}finally{te(o)}}function _l(e,t,n){const i=pt(),r=rt(i,e);return Sl(i,wl(i,e)?pl(i,Mt(),t,r.transform,n,r):r.transform(n))}function yl(e,t,n,i){const r=pt(),s=rt(r,e);return Sl(r,wl(r,e)?ml(r,Mt(),t,s.transform,n,i,s):s.transform(n,i))}function vl(e,t,n,i,r){const s=pt(),o=rt(s,e);return Sl(s,wl(s,e)?bl(s,Mt(),t,o.transform,n,i,r,o):o.transform(n,i,r))}function wl(e,t){return e[1].data[t+Ie].pure}function Sl(e,t){return Vs.isWrapped(t)&&(t=Vs.unwrap(t),e[xt()]=zi),t}const Ml=class extends i.a{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,n){let i,s=e=>null,o=()=>null;e&&"object"==typeof e?(i=this.__isAsync?t=>{setTimeout(()=>e.next(t))}:t=>{e.next(t)},e.error&&(s=this.__isAsync?t=>{setTimeout(()=>e.error(t))}:t=>{e.error(t)}),e.complete&&(o=this.__isAsync?()=>{setTimeout(()=>e.complete())}:()=>{e.complete()})):(i=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)},t&&(s=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)}),n&&(o=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const a=super.subscribe(i,s,o);return e instanceof r.a&&e.add(a),a}};function xl(){return this._results[Ws()]()}class kl{constructor(){this.dirty=!0,this._results=[],this.changes=new Ml,this.length=0;const e=Ws(),t=kl.prototype;t[e]||(t[e]=xl)}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e){this._results=function e(t,n){void 0===n&&(n=t);for(let i=0;i<t.length;i++){let r=t[i];Array.isArray(r)?(n===t&&(n=t.slice(0,i)),e(r,n)):n!==t&&n.push(r)}return n}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Dl{constructor(e){this.queryList=e,this.matches=null}clone(){return new Dl(this.queryList)}setDirty(){this.queryList.setDirty()}}class Tl{constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const n=null!==e.contentQueries?e.contentQueries[0]:t.length,i=[];for(let e=0;e<n;e++){const n=t.getByIndex(e);i.push(this.queries[n.indexInDeclarationView].clone())}return new Tl(i)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)null!==Vl(e,t).matches&&this.queries[t].setDirty()}}class Cl{constructor(e,t,n,i=null){this.predicate=e,this.descendants=t,this.isStatic=n,this.read=i}}class Ol{constructor(e=[]){this.queries=e}elementStart(e,t){for(let n=0;n<this.queries.length;n++)this.queries[n].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let n=0;n<this.length;n++){const i=null!==t?t.length:0,r=this.getByIndex(n).embeddedTView(e,i);r&&(r.indexInDeclarationView=n,null!==t?t.push(r):t=[r])}return null!==t?new Ol(t):null}template(e,t){for(let n=0;n<this.queries.length;n++)this.queries[n].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}}class Rl{constructor(e,t=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new Rl(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&!1===this.metadata.descendants){const t=this._declarationNodeIndex;let n=e.parent;for(;null!==n&&3===n.type&&n.index!==t;)n=n.parent;return t===(null!==n?n.index:-1)}return this._appliesToNextNode}matchTNode(e,t){const n=this.metadata.predicate;if(Array.isArray(n))for(let i=0;i<n.length;i++){const r=n[i];this.matchTNodeWithReadOption(e,t,Ll(t,r)),this.matchTNodeWithReadOption(e,t,Sn(t,e,r,!1,!1))}else n===Wa?0===t.type&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,Sn(t,e,n,!1,!1))}matchTNodeWithReadOption(e,t,n){if(null!==n){const i=this.metadata.read;if(null!==i)if(i===ya||i===Ba||i===Wa&&0===t.type)this.addMatch(t.index,-2);else{const n=Sn(t,e,i,!1,!1);null!==n&&this.addMatch(t.index,n)}else this.addMatch(t.index,n)}}addMatch(e,t){null===this.matches?this.matches=[e,t]:this.matches.push(e,t)}}function Ll(e,t){const n=e.localNames;if(null!==n)for(let i=0;i<n.length;i+=2)if(n[i]===t)return n[i+1];return null}function El(e,t,n,i){return-1===n?function(e,t){return 2===e.type||3===e.type?hs(ya,e,t):0===e.type?fs(Wa,ya,e,t):null}(t,e):-2===n?function(e,t,n){return n===ya?hs(ya,t,e):n===Wa?fs(Wa,ya,t,e):n===Ba?ps(Ba,ya,t,e):void 0}(e,t,i):Mn(e,e[1],n,t)}function Al(e,t,n,i){const r=t[19].queries[i];if(null===r.matches){const i=e.data,s=n.matches,o=[];for(let e=0;e<s.length;e+=2){const r=s[e];o.push(r<0?null:El(t,i[r],s[e+1],n.metadata.read))}r.matches=o}return r.matches}function Il(e){const t=pt(),n=mt(),i=Rt();Lt(i+1);const r=Vl(n,i);if(e.dirty&&at(t)===r.metadata.isStatic){if(null===r.matches)e.reset([]);else{const s=r.crossesNgTemplate?function e(t,n,i,r){const s=t.queries.getByIndex(i),o=s.matches;if(null!==o){const a=Al(t,n,s,i);for(let t=0;t<o.length;t+=2){const i=o[t];if(i>0)r.push(a[t/2]);else{const s=o[t+1],a=n[-i];for(let t=Pe;t<a.length;t++){const n=a[t];n[17]===n[3]&&e(n[1],n,s,r)}if(null!==a[9]){const t=a[9];for(let n=0;n<t.length;n++){const i=t[n];e(i[1],i,s,r)}}}}}return r}(n,t,i,[]):Al(n,t,r,i);e.reset(s),e.notifyOnChanges()}return!0}return!1}function Pl(e,t,n){Nl(mt(),pt(),e,t,n,!0)}function jl(e,t,n){Nl(mt(),pt(),e,t,n,!1)}function Nl(e,t,n,i,r,s){e.firstCreatePass&&(Wl(e,new Cl(n,i,s,r),-1),s&&(e.staticViewQueries=!0)),Hl(e,t)}function Fl(e,t,n,i){zl(mt(),pt(),t,n,i,!1,gt(),e)}function Yl(e,t,n,i){zl(mt(),pt(),t,n,i,!0,gt(),e)}function zl(e,t,n,i,r,s,o,a){e.firstCreatePass&&(Wl(e,new Cl(n,i,s,r),o.index),function(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(e.contentQueries.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(e,a),s&&(e.staticContentQueries=!0)),Hl(e,t)}function $l(){return e=pt(),t=Rt(),e[19].queries[t].queryList;var e,t}function Hl(e,t){const n=new kl;hr(e,t,n,n.destroy),null===t[19]&&(t[19]=new Tl),t[19].queries.push(new Dl(n))}function Wl(e,t,n){null===e.queries&&(e.queries=new Ol),e.queries.track(new Rl(t,n))}function Vl(e,t){return e.queries.getByIndex(t)}function Bl(e,t){return fs(Wa,ya,e,t)}function Ul(e=m.Default){const t=ms(!0);if(null!=t||e&m.Optional)return t;throw new Error("No provider for ChangeDetectorRef!")}const Gl=new U("Application Initializer");let ql=(()=>{class e{constructor(e){this.appInits=e,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const t=this.appInits[n]();bo(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}return e.\u0275fac=function(t){return new(t||e)(ie(Gl,8))},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();const Jl=new U("AppId"),Ql={provide:Jl,useFactory:function(){return`${Kl()}${Kl()}${Kl()}`},deps:[]};function Kl(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Zl=new U("Platform Initializer"),Xl=new U("Platform ID"),eu=new U("appBootstrapListener");let tu=(()=>{class e{log(e){console.log(e)}warn(e){console.warn(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();const nu=new U("LocaleId"),iu=new U("DefaultCurrencyCode");class ru{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const su=function(e){return new ol(e)},ou=su,au=function(e){return Promise.resolve(su(e))},cu=function(e){const t=su(e),n=un(Ae(e).declarations).reduce((e,t)=>{const n=Le(t);return n&&e.push(new Ka(n)),e},[]);return new ru(t,n)},lu=cu,uu=function(e){return Promise.resolve(cu(e))};let du=(()=>{class e{constructor(){this.compileModuleSync=ou,this.compileModuleAsync=au,this.compileModuleAndAllComponentsSync=lu,this.compileModuleAndAllComponentsAsync=uu}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();const hu=(()=>Promise.resolve(0))();function fu(e){"undefined"==typeof Zone?hu.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class pu{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Ml(!1),this.onMicrotaskEmpty=new Ml(!1),this.onStable=new Ml(!1),this.onError=new Ml(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const n=this;n._nesting=0,n._outer=n._inner=Zone.current,Zone.wtfZoneSpec&&(n._inner=n._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(n._inner=n._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(n._inner=n._inner.fork(Zone.longStackTraceZoneSpec)),n.shouldCoalesceEventChangeDetection=t,n.lastRequestAnimationFrameId=-1,n.nativeRequestAnimationFrame=function(){let e=F.requestAnimationFrame,t=F.cancelAnimationFrame;if("undefined"!=typeof Zone&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const i=t[Zone.__symbol__("OriginalDelegate")];i&&(t=i)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function(e){const t=!!e.shouldCoalesceEventChangeDetection&&e.nativeRequestAnimationFrame&&(()=>{!function(e){-1===e.lastRequestAnimationFrameId&&(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(F,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,_u(e),gu(e)},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),_u(e))}(e)});e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:t},onInvokeTask:(n,i,r,s,o,a)=>{try{return yu(e),n.invokeTask(r,s,o,a)}finally{t&&"eventTask"===s.type&&t(),vu(e)}},onInvoke:(t,n,i,r,s,o,a)=>{try{return yu(e),t.invoke(i,r,s,o,a)}finally{vu(e)}},onHasTask:(t,n,i,r)=>{t.hasTask(i,r),n===i&&("microTask"==r.change?(e._hasPendingMicrotasks=r.microTask,_u(e),gu(e)):"macroTask"==r.change&&(e.hasPendingMacrotasks=r.macroTask))},onHandleError:(t,n,i,r)=>(t.handleError(i,r),e.runOutsideAngular(()=>e.onError.emit(r)),!1)})}(n)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!pu.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(pu.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,e,bu,mu,mu);try{return r.runTask(s,t,n)}finally{r.cancelTask(s)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}}function mu(){}const bu={};function gu(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function _u(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||e.shouldCoalesceEventChangeDetection&&-1!==e.lastRequestAnimationFrameId)}function yu(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function vu(e){e._nesting--,gu(e)}class wu{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Ml,this.onMicrotaskEmpty=new Ml,this.onStable=new Ml,this.onError=new Ml}run(e,t,n){return e.apply(t,n)}runGuarded(e,t,n){return e.apply(t,n)}runOutsideAngular(e){return e()}runTask(e,t,n,i){return e.apply(t,n)}}let Su=(()=>{class e{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{pu.assertNotInAngularZone(),fu(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())fu(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,n){let i=-1;t&&t>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==i),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:i,updateCb:n})}whenStable(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,n){return[]}}return e.\u0275fac=function(t){return new(t||e)(ie(pu))},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})(),Mu=(()=>{class e{constructor(){this._applications=new Map,Tu.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return Tu.findTestabilityInTree(this,e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();class xu{addToWindow(e){}findTestabilityInTree(e,t,n){return null}}function ku(e){Tu=e}let Du,Tu=new xu;const Cu=new U("AllowMultipleToken");class Ou{constructor(e,t){this.name=e,this.token=t}}function Ru(e,t,n=[]){const i="Platform: "+t,r=new U(i);return(t=[])=>{let s=Lu();if(!s||s.injector.get(Cu,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{const e=n.concat(t).concat({provide:r,useValue:!0},{provide:ys,useValue:"platform"});!function(e){if(Du&&!Du.destroyed&&!Du.injector.get(Cu,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Du=e.get(Eu);const t=e.get(Zl,null);t&&t.forEach(e=>e())}(As.create({providers:e,name:i}))}return function(e){const t=Lu();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function Lu(){return Du&&!Du.destroyed?Du:null}let Eu=(()=>{class e{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const n=function(e,t){let n;return n="noop"===e?new wu:("zone.js"===e?void 0:e)||new pu({enableLongStackTrace:Jn(),shouldCoalesceEventChangeDetection:t}),n}(t?t.ngZone:void 0,t&&t.ngZoneEventCoalescing||!1),i=[{provide:pu,useValue:n}];return n.run(()=>{const t=As.create({providers:i,parent:this.injector,name:e.moduleType.name}),r=e.create(t),s=r.injector.get(En,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return r.onDestroy(()=>Pu(this._modules,r)),n.runOutsideAngular(()=>n.onError.subscribe({next:e=>{s.handleError(e)}})),function(e,t,n){try{const i=n();return bo(i)?i.catch(n=>{throw t.runOutsideAngular(()=>e.handleError(n)),n}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(s,n,()=>{const e=r.injector.get(ql);return e.runInitializers(),e.donePromise.then(()=>(dc(r.injector.get(nu,lc)||lc),this._moduleDoBootstrap(r),r))})})}bootstrapModule(e,t=[]){const n=Au({},t);return function(e,t,n){const i=new ol(n);return Promise.resolve(i)}(0,0,e).then(e=>this.bootstrapModuleFactory(e,n))}_moduleDoBootstrap(e){const t=e.injector.get(Iu);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${C(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(t){return new(t||e)(ie(As))},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();function Au(e,t){return Array.isArray(t)?t.reduce(Au,e):Object.assign(Object.assign({},e),t)}let Iu=(()=>{class e{constructor(e,t,n,i,r,c){this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=i,this._componentFactoryResolver=r,this._initStatus=c,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=Jn(),this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const l=new s.a(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),u=new s.a(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{pu.assertNotInAngularZone(),fu(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{pu.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),n.unsubscribe()}});this.isStable=Object(o.a)(l,u.pipe(Object(a.a)()))}bootstrap(e,t){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=e instanceof ba?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(ae),r=n.create(As.NULL,[],t||n.selector,i);r.onDestroy(()=>{this._unloadComponent(r)});const s=r.injector.get(Su,null);return s&&r.injector.get(Mu).registerApplication(r.location.nativeElement,s),this._loadComponent(r),Jn()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let e of this._views)e.detectChanges();if(this._enforceNoNewChanges)for(let e of this._views)e.checkNoChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;Pu(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(eu,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}_unloadComponent(e){this.detachView(e.hostView),Pu(this.components,e)}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy())}get viewCount(){return this._views.length}}return e.\u0275fac=function(t){return new(t||e)(ie(pu),ie(tu),ie(As),ie(En),ie(_a),ie(ql))},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();function Pu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ju{}class Nu{}const Fu={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let Yu=(()=>{class e{constructor(e,t){this._compiler=e,this._config=t||Fu}load(e){return this.loadAndCompile(e)}loadAndCompile(e){let[t,i]=e.split("#");return void 0===i&&(i="default"),n("zn8P")(t).then(e=>e[i]).then(e=>zu(e,t,i)).then(e=>this._compiler.compileModuleAsync(e))}loadFactory(e){let[t,i]=e.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+t+this._config.factoryPathSuffix).then(e=>e[i+r]).then(e=>zu(e,t,i))}}return e.\u0275fac=function(t){return new(t||e)(ie(du),ie(Nu,8))},e.\u0275prov=_({token:e,factory:e.\u0275fac}),e})();function zu(e,t,n){if(!e)throw new Error(`Cannot find '${n}' in '${t}'`);return e}const $u=function(e){return null},Hu=Ru(null,"core",[{provide:Xl,useValue:"unknown"},{provide:Eu,deps:[As]},{provide:Mu,deps:[]},{provide:tu,deps:[]}]),Wu=[{provide:Iu,useClass:Iu,deps:[pu,tu,As,En,_a,ql]},{provide:Qa,deps:[pu],useFactory:function(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:ql,useClass:ql,deps:[[new h,Gl]]},{provide:du,useClass:du,deps:[]},Ql,{provide:Fa,useFactory:function(){return $a},deps:[]},{provide:Ya,useFactory:function(){return Ha},deps:[]},{provide:nu,useFactory:function(e){return dc(e=e||"undefined"!=typeof $localize&&$localize.locale||lc),e},deps:[[new d(nu),new h,new p]]},{provide:iu,useValue:"USD"}];let Vu=(()=>{class e{constructor(e){}}return e.\u0275mod=De({type:e}),e.\u0275inj=y({factory:function(t){return new(t||e)(ie(Iu))},providers:Wu}),e})()},"8YOa":function(e,t,n){var i=n("0BK2"),r=n("hh1v"),s=n("UTVS"),o=n("m/L8").f,a=n("kOOl"),c=n("uy83"),l=a("meta"),u=0,d=Object.isExtensible||function(){return!0},h=function(e){o(e,l,{value:{objectID:"O"+ ++u,weakData:{}}})},f=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,l)){if(!d(e))return"F";if(!t)return"E";h(e)}return e[l].objectID},getWeakData:function(e,t){if(!s(e,l)){if(!d(e))return!0;if(!t)return!1;h(e)}return e[l].weakData},onFreeze:function(e){return c&&f.REQUIRED&&d(e)&&!s(e,l)&&h(e),e}};i[l]=!0},"8mBD":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Ter\xe7a-feira_Quarta-feira_Quinta-feira_Sexta-feira_S\xe1bado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_S\xe1b".split("_"),weekdaysMin:"Do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},"8xTl":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e){return r.a.upperFirst(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"upperFirst",type:e,pure:!0}),e})()},"9/5/":function(e,t){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof global&&global&&global.Object===Object&&global,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),u=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=r.test(e);return a||s.test(e)?o(e.slice(2),a?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var i,r,s,o,a,c,l=0,u=!1,b=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function y(e){return l=e,a=setTimeout(w,t),u?_(e):o}function v(e){var n=e-c;return void 0===c||n>=t||n<0||b&&e-l>=s}function w(){var e=f();if(v(e))return S(e);a=setTimeout(w,function(e){var n=t-(e-c);return b?h(n,s-(e-l)):n}(e))}function S(e){return a=void 0,g&&i?_(e):(i=r=void 0,o)}function M(){var e=f(),n=v(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return y(c);if(b)return a=setTimeout(w,t),_(c)}return void 0===a&&(a=setTimeout(w,t)),o}return t=m(t)||0,p(n)&&(u=!!n.leading,s=(b="maxWait"in n)?d(m(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),M.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},M.flush=function(){return void 0===a?o:S(f())},M}},"93I0":function(e,t,n){var i=n("VpIT"),r=n("kOOl"),s=i("keys");e.exports=function(e){return s[e]||(s[e]=r(e))}},"9Xeq":function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var i=n("SVse"),r=n("yT6U"),s=n("iExv"),o=n("4DD9"),a=n("a0VL"),c=n("+0ag"),l=n("85J/"),u=n("IzCI"),d=n("Fgil"),h=n("o4+5"),f=n("nSDx"),p=n("8Y7J");let m=(()=>{class e{transform(e){return encodeURIComponent(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=p.Lb({name:"encodeUri",type:e,pure:!0}),e})();var b=n("BQkM"),g=n("uYzU"),_=n("FFMq"),y=n("E2fk"),v=n("TJUb"),w=n("dEH0"),S=n("G1/K"),M=n("TYzs"),x=n("Dwqy"),k=n("Yrry"),D=n("efK2"),T=n("8xTl");let C=(()=>{class e{}return e.\u0275mod=p.Kb({type:e}),e.\u0275inj=p.Jb({factory:function(t){return new(t||e)},providers:[r.a,o.a,s.a,i.e,l.a,c.a,d.a,u.a,h.a,x.a,g.a,_.a,y.a,a.a,f.a,m,M.a,b.a,w.a,S.a,T.a,v.a,D.a,k.a],imports:[[i.c]]}),e})()},"9d/t":function(e,t,n){var i=n("AO7/"),r=n("xrYK"),s=n("tiKp")("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=i?r:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),s))?n:o?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i}},"9f76":function(e,t,n){"use strict";var i=n("8M4i"),r=n("EUcb"),s=function(e){return Object(r.a)(e)&&"[object Arguments]"==Object(i.a)(e)},o=Object.prototype,a=o.hasOwnProperty,c=o.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return Object(r.a)(e)&&a.call(e,"callee")&&!c.call(e,"callee")};t.a=l},"9nlD":function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("LvDl"),r=n.n(i),s=n("2Vo4"),o=n("XNiG"),a=n("mtw6"),c=n("G1I9"),l=n("a0VL"),u=n("ufoC"),d=n("8Y7J"),h=n("EApP");let f=(()=>{class e{constructor(e,t,n){this.toastr=e,this.taskMessageService=t,this.cdDatePipe=n,this.hideToasties=!1,this.dataSource=new s.a([]),this.data$=this.dataSource.asObservable(),this.sidebarSubject=new o.a,this.queued=[],this.KEY="cdNotifications";const i=localStorage.getItem(this.KEY);let a=[];r.a.isString(i)&&(a=JSON.parse(i,(e,t)=>r.a.isPlainObject(t)?r.a.assign(new c.a,t):t)),this.dataSource.next(a)}removeAll(){localStorage.removeItem(this.KEY),this.dataSource.next([])}remove(e){const t=this.dataSource.getValue();t.splice(e,1),this.dataSource.next(t),localStorage.setItem(this.KEY,JSON.stringify(t))}save(e){const t=this.dataSource.getValue();for(t.push(e),t.sort((e,t)=>e.timestamp>t.timestamp?-1:1);t.length>10;)t.pop();this.dataSource.next(t),localStorage.setItem(this.KEY,JSON.stringify(t))}show(e,t,n,i,s){return window.setTimeout(()=>{let o;o=r.a.isFunction(e)?e():r.a.isObject(e)?e:new c.b(e,t,n,i,s),this.queueToShow(o)},10)}queueToShow(e){this.cancel(this.queuedTimeoutId),this.queued.find(t=>r.a.isEqual(t,e))||this.queued.push(e),this.queuedTimeoutId=window.setTimeout(()=>{this.showQueued()},500)}showQueued(){this.getUnifiedTitleQueue().forEach(e=>{const t=new c.a(e);t.isFinishedTask||this.save(t),this.showToasty(t)})}getUnifiedTitleQueue(){return Object.values(this.queueShiftByTitle()).map(e=>{const t=e[0];return e.length>1&&(t.message="<ul>"+e.map(e=>`<li>${e.message}</li>`).join("")+"</ul>"),t})}queueShiftByTitle(){const e={};let t;for(;t=this.queued.shift();)e[t.title]||(e[t.title]=[]),e[t.title].push(t);return e}showToasty(e){this.hideToasties||this.toastr[["error","info","success"][e.type]]((e.message?e.message+"<br>":"")+this.renderTimeAndApplicationHtml(e),e.title,e.options)}renderTimeAndApplicationHtml(e){return`<small class="date">${this.cdDatePipe.transform(e.timestamp)}</small><i class="float-right custom-icon ${e.applicationClass}" title="${e.application}"></i>`}notifyTask(e,t=!0){const n=this.finishedTaskToNotification(e,t);return n.isFinishedTask=!0,this.show(n)}finishedTaskToNotification(e,t=!0){let n;return n=e.success&&t?new c.b(a.a.success,this.taskMessageService.getSuccessTitle(e)):new c.b(a.a.error,this.taskMessageService.getErrorTitle(e),this.taskMessageService.getErrorMessage(e)),n.isFinishedTask=!0,n}cancel(e){window.clearTimeout(e)}suspendToasties(e){this.hideToasties=e}toggleSidebar(e=!1){this.sidebarSubject.next(e)}}return e.\u0275fac=function(t){return new(t||e)(d.dc(h.b),d.dc(u.a),d.dc(l.a))},e.\u0275prov=d.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"9ppp":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})()},"9rRi":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am M\xe0rt","An Giblean","An C\xe8itean","An t-\xd2gmhios","An t-Iuchar","An L\xf9nastal","An t-Sultain","An D\xe0mhair","An t-Samhain","An D\xf9bhlachd"],monthsShort:["Faoi","Gear","M\xe0rt","Gibl","C\xe8it","\xd2gmh","Iuch","L\xf9n","Sult","D\xe0mh","Samh","D\xf9bh"],monthsParseExact:!0,weekdays:["Did\xf2mhnaich","Diluain","Dim\xe0irt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["D\xf2","Lu","M\xe0","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-m\xe0ireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-d\xe8 aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"m\xecos",MM:"%d m\xecosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},"9xzX":function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var i=n("mrSG"),r=n("IheW"),s=n("LvDl"),o=n.n(s),a=n("2Vo4"),c=n("z6cu"),l=n("LRne"),u=n("vkgz"),d=n("5+tZ"),h=n("XNiG"),f=n("zx2A");class p{constructor(e,t){this.notifier=e,this.source=t}call(e,t){return t.subscribe(new m(e,this.notifier,this.source))}}class m extends f.b{constructor(e,t,n){super(e),this.notifier=t,this.source=n}error(e){if(!this.isStopped){let n=this.errors,i=this.retries,r=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new h.a;try{const{notifier:e}=this;i=e(n)}catch(t){return super.error(t)}r=Object(f.c)(i,new f.a(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=r,n.next(e)}}_unsubscribe(){const{errors:e,retriesSubscription:t}=this;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0}notifyNext(){const{_unsubscribe:e}=this;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)}}var b=n("IzEk"),g=n("xTzq"),_=n("8Y7J");let y=(()=>{let e=class{constructor(e){this.http=e,this.url="api/rgw/daemon",this.daemons=new a.a([]),this.daemons$=this.daemons.asObservable(),this.selectedDaemon=new a.a(null),this.selectedDaemon$=this.selectedDaemon.asObservable()}list(){return this.http.get(this.url).pipe(Object(u.a)(e=>{this.daemons.next(e),o.a.isEmpty(this.selectedDaemon.getValue())&&this.selectDefaultDaemon(e)}))}get(e){return this.http.get(`${this.url}/${e}`)}selectDaemon(e){this.selectedDaemon.next(e)}selectDefaultDaemon(e){if(0===e.length)return null;for(const t of e)if(t.default)return this.selectDaemon(t),t;return this.selectDaemon(e[0]),e[0]}request(e){return this.selectedDaemon.pipe(Object(d.a)(e=>o.a.isEmpty(e)?this.list().pipe(Object(d.a)(e=>Object(c.a)(!o.a.isEmpty(e)))):Object(l.a)(e)),(t=e=>e.pipe(Object(d.a)(t=>t?e:Object(c.a)("No RGW daemons found!"))),e=>e.lift(new p(t,e))),Object(b.a)(1),Object(d.a)(t=>{let n=new r.e;return n=n.append("daemon_name",t.id),e(n)}));var t}};return e.\u0275fac=function(t){return new(t||e)(_.dc(r.b))},e.\u0275prov=_.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([g.a,Object(i.d)("design:paramtypes",[r.b])],e),e})()},"A+xa":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"\u043a\u04d1\u0440\u043b\u0430\u0447_\u043d\u0430\u0440\u04d1\u0441_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440\u0442\u043c\u0435_\u0443\u0442\u04d1_\u04ab\u0443\u0440\u043b\u0430_\u0430\u0432\u04d1\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448\u0442\u0430\u0432".split("_"),monthsShort:"\u043a\u04d1\u0440_\u043d\u0430\u0440_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440_\u0443\u0442\u04d1_\u04ab\u0443\u0440_\u0430\u0432\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448".split("_"),weekdays:"\u0432\u044b\u0440\u0441\u0430\u0440\u043d\u0438\u043a\u0443\u043d_\u0442\u0443\u043d\u0442\u0438\u043a\u0443\u043d_\u044b\u0442\u043b\u0430\u0440\u0438\u043a\u0443\u043d_\u044e\u043d\u043a\u0443\u043d_\u043a\u04d7\u04ab\u043d\u0435\u0440\u043d\u0438\u043a\u0443\u043d_\u044d\u0440\u043d\u0435\u043a\u0443\u043d_\u0448\u04d1\u043c\u0430\u0442\u043a\u0443\u043d".split("_"),weekdaysShort:"\u0432\u044b\u0440_\u0442\u0443\u043d_\u044b\u0442\u043b_\u044e\u043d_\u043a\u04d7\u04ab_\u044d\u0440\u043d_\u0448\u04d1\u043c".split("_"),weekdaysMin:"\u0432\u0440_\u0442\u043d_\u044b\u0442_\u044e\u043d_\u043a\u04ab_\u044d\u0440_\u0448\u043c".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7]",LLL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm",LLLL:"dddd, YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm"},calendar:{sameDay:"[\u041f\u0430\u044f\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextDay:"[\u042b\u0440\u0430\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastDay:"[\u04d6\u043d\u0435\u0440] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextWeek:"[\u04aa\u0438\u0442\u0435\u0441] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastWeek:"[\u0418\u0440\u0442\u043d\u04d7] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",sameElse:"L"},relativeTime:{future:function(e){return e+(/\u0441\u0435\u0445\u0435\u0442$/i.exec(e)?"\u0440\u0435\u043d":/\u04ab\u0443\u043b$/i.exec(e)?"\u0442\u0430\u043d":"\u0440\u0430\u043d")},past:"%s \u043a\u0430\u044f\u043b\u043b\u0430",s:"\u043f\u04d7\u0440-\u0438\u043a \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",ss:"%d \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",m:"\u043f\u04d7\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u043f\u04d7\u0440 \u0441\u0435\u0445\u0435\u0442",hh:"%d \u0441\u0435\u0445\u0435\u0442",d:"\u043f\u04d7\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u043f\u04d7\u0440 \u0443\u0439\u04d1\u0445",MM:"%d \u0443\u0439\u04d1\u0445",y:"\u043f\u04d7\u0440 \u04ab\u0443\u043b",yy:"%d \u04ab\u0443\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-\u043c\u04d7\u0448/,ordinal:"%d-\u043c\u04d7\u0448",week:{dow:1,doy:7}})}(n("wd/R"))},A2ZE:function(e,t,n){var i=n("HAuM");e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},ANnk:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("aexS"),r=n("f/UV"),s=n("8Y7J");let o=(()=>{class e{constructor(e,t,n){this.formScope=e,this.authStorageService=t,this.elementRef=n}ngAfterViewInit(){var e,t,n;this.permissions=this.authStorageService.getPermissions();const i=null===(e=this.formScope)||void 0===e?void 0:e.cdFormScope;i&&!(null===(n=null===(t=this.permissions)||void 0===t?void 0:t[i])||void 0===n?void 0:n.update)&&(this.elementRef.nativeElement.disabled=!0)}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(r.a,8),s.Mb(i.a),s.Mb(s.m))},e.\u0275dir=s.Hb({type:e,selectors:[["input",3,"cdNoFormInputDisable",""],["select",3,"cdNoFormInputDisable",""],["button",3,"cdNoFormInputDisable",""],["","cdFormInputDisable",""]]}),e})()},"AO7/":function(e,t,n){var i={};i[n("tiKp")("toStringTag")]="z",e.exports="[object z]"===String(i)},AQ68:function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("wd/R"))},Avrn:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("aexS"),r=n("8Y7J"),s=n("iInd");let o=(()=>{class e{constructor(e,t){this.router=e,this.authStorageService=t}canActivate(e,t){return!!this.authStorageService.isLoggedIn()||(this.router.navigate(["/login"],{queryParams:{returnUrl:t.url}}),!1)}canActivateChild(e,t){return this.canActivate(e,t)}}return e.\u0275fac=function(t){return new(t||e)(r.dc(s.e),r.dc(i.a))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},AvvY:function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"\u0d1c\u0d28\u0d41\u0d35\u0d30\u0d3f_\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41\u0d35\u0d30\u0d3f_\u0d2e\u0d3e\u0d7c\u0d1a\u0d4d\u0d1a\u0d4d_\u0d0f\u0d2a\u0d4d\u0d30\u0d3f\u0d7d_\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48_\u0d13\u0d17\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d4d_\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d02\u0d2c\u0d7c_\u0d12\u0d15\u0d4d\u0d1f\u0d4b\u0d2c\u0d7c_\u0d28\u0d35\u0d02\u0d2c\u0d7c_\u0d21\u0d3f\u0d38\u0d02\u0d2c\u0d7c".split("_"),monthsShort:"\u0d1c\u0d28\u0d41._\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41._\u0d2e\u0d3e\u0d7c._\u0d0f\u0d2a\u0d4d\u0d30\u0d3f._\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48._\u0d13\u0d17._\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31._\u0d12\u0d15\u0d4d\u0d1f\u0d4b._\u0d28\u0d35\u0d02._\u0d21\u0d3f\u0d38\u0d02.".split("_"),monthsParseExact:!0,weekdays:"\u0d1e\u0d3e\u0d2f\u0d31\u0d3e\u0d34\u0d4d\u0d1a_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d33\u0d3e\u0d34\u0d4d\u0d1a_\u0d1a\u0d4a\u0d35\u0d4d\u0d35\u0d3e\u0d34\u0d4d\u0d1a_\u0d2c\u0d41\u0d27\u0d28\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a_\u0d36\u0d28\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a".split("_"),weekdaysShort:"\u0d1e\u0d3e\u0d2f\u0d7c_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d7e_\u0d1a\u0d4a\u0d35\u0d4d\u0d35_\u0d2c\u0d41\u0d27\u0d7b_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d02_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f_\u0d36\u0d28\u0d3f".split("_"),weekdaysMin:"\u0d1e\u0d3e_\u0d24\u0d3f_\u0d1a\u0d4a_\u0d2c\u0d41_\u0d35\u0d4d\u0d2f\u0d3e_\u0d35\u0d46_\u0d36".split("_"),longDateFormat:{LT:"A h:mm -\u0d28\u0d41",LTS:"A h:mm:ss -\u0d28\u0d41",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -\u0d28\u0d41",LLLL:"dddd, D MMMM YYYY, A h:mm -\u0d28\u0d41"},calendar:{sameDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d4d] LT",nextDay:"[\u0d28\u0d3e\u0d33\u0d46] LT",nextWeek:"dddd, LT",lastDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d32\u0d46] LT",lastWeek:"[\u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d",past:"%s \u0d2e\u0d41\u0d7b\u0d2a\u0d4d",s:"\u0d05\u0d7d\u0d2a \u0d28\u0d3f\u0d2e\u0d3f\u0d37\u0d19\u0d4d\u0d19\u0d7e",ss:"%d \u0d38\u0d46\u0d15\u0d4d\u0d15\u0d7b\u0d21\u0d4d",m:"\u0d12\u0d30\u0d41 \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",mm:"%d \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",h:"\u0d12\u0d30\u0d41 \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",hh:"%d \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",d:"\u0d12\u0d30\u0d41 \u0d26\u0d3f\u0d35\u0d38\u0d02",dd:"%d \u0d26\u0d3f\u0d35\u0d38\u0d02",M:"\u0d12\u0d30\u0d41 \u0d2e\u0d3e\u0d38\u0d02",MM:"%d \u0d2e\u0d3e\u0d38\u0d02",y:"\u0d12\u0d30\u0d41 \u0d35\u0d7c\u0d37\u0d02",yy:"%d \u0d35\u0d7c\u0d37\u0d02"},meridiemParse:/\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f|\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46|\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d|\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02|\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f/i,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"===t&&e>=4||"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d"===t||"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f":e<12?"\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46":e<17?"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d":e<20?"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02":"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"}})}(n("wd/R"))},AwXo:function(e,t,n){"use strict";var i=n("Y7yP"),r=function(){try{var e=Object(i.a)(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();t.a=r},AxL3:function(e,t){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=n},AytR:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i={default_lang:"en-US",production:!0,year:"2021"}},B55N:function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"\u4ee4\u548c",narrow:"\u32ff",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"\u5e73\u6210",narrow:"\u337b",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"\u662d\u548c",narrow:"\u337c",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"\u5927\u6b63",narrow:"\u337d",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"\u660e\u6cbb",narrow:"\u337e",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"\u897f\u66a6",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"\u7d00\u5143\u524d",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(\u5143|\d+)\u5e74/,eraYearOrdinalParse:function(e,t){return"\u5143"===t[1]?1:parseInt(t[1]||e,10)},months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5(ddd) HH:mm"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function(e){return"\u5348\u5f8c"===e},meridiem:function(e,t,n){return e<12?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:function(e){return e.week()!==this.week()?"[\u6765\u9031]dddd LT":"dddd LT"},lastDay:"[\u6628\u65e5] LT",lastWeek:function(e){return this.week()!==e.week()?"[\u5148\u9031]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}\u65e5/,ordinal:function(e,t){switch(t){case"y":return 1===e?"\u5143\u5e74":e+"\u5e74";case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",ss:"%d\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}})}(n("wd/R"))},BFxc:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("7o/Q"),r=n("4I5i"),s=n("EY2u");function o(e){return function(t){return 0===e?Object(s.b)():t.lift(new a(e))}}class a{constructor(e){if(this.total=e,this.total<0)throw new r.a}call(e,t){return t.subscribe(new c(e,this.total))}}class c extends i.a{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,n=this.total,i=this.count++;t.length<n?t.push(e):t[i%n]=e}_complete(){const e=this.destination;let t=this.count;if(t>0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;r<n;r++){const r=t++%n;e.next(i[r])}}e.complete()}}},BQkM:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){return e+" IOPS"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"iops",type:e,pure:!0}),e})()},BVg3:function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,i,r){var s=e+" ";switch(i){case"s":return n||r?"nokkrar sek\xfandur":"nokkrum sek\xfandum";case"ss":return t(e)?s+(n||r?"sek\xfandur":"sek\xfandum"):s+"sek\xfanda";case"m":return n?"m\xedn\xfata":"m\xedn\xfatu";case"mm":return t(e)?s+(n||r?"m\xedn\xfatur":"m\xedn\xfatum"):n?s+"m\xedn\xfata":s+"m\xedn\xfatu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"d\xf6gum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"m\xe1nu\xf0ur":r?"m\xe1nu\xf0":"m\xe1nu\xf0i";case"MM":return t(e)?n?s+"m\xe1nu\xf0ir":s+(r?"m\xe1nu\xf0i":"m\xe1nu\xf0um"):n?s+"m\xe1nu\xf0ur":s+(r?"m\xe1nu\xf0":"m\xe1nu\xf0i");case"y":return n||r?"\xe1r":"\xe1ri";case"yy":return t(e)?s+(n||r?"\xe1r":"\xe1rum"):s+(n||r?"\xe1r":"\xe1ri")}}e.defineLocale("is",{months:"jan\xfaar_febr\xfaar_mars_apr\xedl_ma\xed_j\xfan\xed_j\xfal\xed_\xe1g\xfast_september_okt\xf3ber_n\xf3vember_desember".split("_"),monthsShort:"jan_feb_mar_apr_ma\xed_j\xfan_j\xfal_\xe1g\xfa_sep_okt_n\xf3v_des".split("_"),weekdays:"sunnudagur_m\xe1nudagur_\xferi\xf0judagur_mi\xf0vikudagur_fimmtudagur_f\xf6studagur_laugardagur".split("_"),weekdaysShort:"sun_m\xe1n_\xferi_mi\xf0_fim_f\xf6s_lau".split("_"),weekdaysMin:"Su_M\xe1_\xder_Mi_Fi_F\xf6_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[\xed dag kl.] LT",nextDay:"[\xe1 morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xed g\xe6r kl.] LT",lastWeek:"[s\xed\xf0asta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s s\xed\xf0an",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},Bs8V:function(e,t,n){var i=n("g6v/"),r=n("0eef"),s=n("XGwC"),o=n("/GqU"),a=n("wE6v"),c=n("UTVS"),l=n("DPsx"),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(e,t){if(e=o(e),t=a(t,!0),l)try{return u(e,t)}catch(n){}if(c(e,t))return s(!r.f.call(e,t),e[t])}},ByF4:function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apr\xedl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_m\xe1nadagur_t\xfdsdagur_mikudagur_h\xf3sdagur_fr\xedggjadagur_leygardagur".split("_"),weekdaysShort:"sun_m\xe1n_t\xfds_mik_h\xf3s_fr\xed_ley".split("_"),weekdaysMin:"su_m\xe1_t\xfd_mi_h\xf3_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[\xcd dag kl.] LT",nextDay:"[\xcd morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xcd gj\xe1r kl.] LT",lastWeek:"[s\xed\xf0stu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s s\xed\xf0ani",s:"f\xe1 sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein t\xedmi",hh:"%d t\xedmar",d:"ein dagur",dd:"%d dagar",M:"ein m\xe1na\xf0ur",MM:"%d m\xe1na\xf0ir",y:"eitt \xe1r",yy:"%d \xe1r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},Ce4a:function(e,t,n){"use strict";var i=n("Ju5/");t.a=i.a.Uint8Array},CfRg:function(e,t,n){"use strict";var i=n("oSzE"),r=n("23KU"),s=n("+EKe"),o=n("mkut"),a=n("4/q3"),c=n("3/ER"),l=n("eAQQ"),u=n("jN84"),d=n("n561"),h=n("TFwu"),f=n("TnHx"),p=n("YM6B"),m=Object.prototype.hasOwnProperty,b=n("lkxz"),g=/\w*$/,_=n("ylTp"),y=_.a?_.a.prototype:void 0,v=y?y.valueOf:void 0,w=n("G4mU"),S=n("hYPf"),M=n("/1FC"),x=n("WOAq"),k=n("EUcb"),D=n("ovuK"),T=n("xutz"),C=T.a&&T.a.isMap,O=C?Object(D.a)(C):function(e){return Object(k.a)(e)&&"[object Map]"==Object(p.a)(e)},R=n("IzLi"),L=T.a&&T.a.isSet,E=L?Object(D.a)(L):function(e){return Object(k.a)(e)&&"[object Set]"==Object(p.a)(e)},A="[object Arguments]",I="[object Function]",P="[object Object]",j={};j[A]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[P]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[I]=j["[object WeakMap]"]=!1,t.a=function e(t,n,_,y,k,D){var T,C=1&n,L=2&n,N=4&n;if(_&&(T=k?_(t,y,k,D):_(t)),void 0!==T)return T;if(!Object(R.a)(t))return t;var F=Object(M.a)(t);if(F){if(T=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&m.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!C)return Object(l.a)(t,T)}else{var Y=Object(p.a)(t),z=Y==I||"[object GeneratorFunction]"==Y;if(Object(x.a)(t))return Object(c.a)(t,C);if(Y==P||Y==A||z&&!k){if(T=L||z?{}:Object(S.a)(t),!C)return L?function(e,t){return Object(s.a)(e,Object(d.a)(e),t)}(t,function(e,t){return e&&Object(s.a)(t,Object(a.a)(t),e)}(T,t)):function(e,t){return Object(s.a)(e,Object(u.a)(e),t)}(t,function(e,t){return e&&Object(s.a)(t,Object(o.a)(t),e)}(T,t))}else{if(!j[Y])return k?t:{};T=function(e,t,n){var i,r,s=e.constructor;switch(t){case"[object ArrayBuffer]":return Object(b.a)(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return function(e,t){var n=t?Object(b.a)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Object(w.a)(e,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(r=new(i=e).constructor(i.source,g.exec(i))).lastIndex=i.lastIndex,r;case"[object Set]":return new s;case"[object Symbol]":return v?Object(v.call(e)):{}}}(t,Y,C)}}D||(D=new i.a);var $=D.get(t);if($)return $;D.set(t,T),E(t)?t.forEach((function(i){T.add(e(i,n,_,i,t,D))})):O(t)&&t.forEach((function(i,r){T.set(r,e(i,n,_,r,t,D))}));var H=F?void 0:(N?L?f.a:h.a:L?a.a:o.a)(t);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n););}(H||t,(function(i,s){H&&(i=t[s=i]),Object(r.a)(T,s,e(i,n,_,s,t,D))})),T}},Cfvw:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=n("HDdC"),r=n("SeVD"),s=n("quSY"),o=n("kJWO"),a=n("jZKg"),c=n("Lhse"),l=n("c2HN"),u=n("I55L");function d(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[o.a]}(e))return function(e,t){return new i.a(n=>{const i=new s.a;return i.add(t.schedule(()=>{const r=e[o.a]();i.add(r.subscribe({next(e){i.add(t.schedule(()=>n.next(e)))},error(e){i.add(t.schedule(()=>n.error(e)))},complete(){i.add(t.schedule(()=>n.complete()))}}))})),i})}(e,t);if(Object(l.a)(e))return function(e,t){return new i.a(n=>{const i=new s.a;return i.add(t.schedule(()=>e.then(e=>{i.add(t.schedule(()=>{n.next(e),i.add(t.schedule(()=>n.complete()))}))},e=>{i.add(t.schedule(()=>n.error(e)))}))),i})}(e,t);if(Object(u.a)(e))return Object(a.a)(e,t);if(function(e){return e&&"function"==typeof e[c.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new i.a(n=>{const i=new s.a;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(t.schedule(()=>{r=e[c.a](),i.add(t.schedule((function(){if(n.closed)return;let e,t;try{const n=r.next();e=n.value,t=n.done}catch(i){return void n.error(i)}t?n.complete():(n.next(e),this.schedule())})))})),i})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof i.a?e:new i.a(Object(r.a)(e))}},ChqD:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("w9WL"),c=n("zWsK"),l=n("V/fk"),u=n("9Xeq"),d=n("8Y7J");let h=(()=>{class e{}return e.\u0275mod=d.Kb({type:e}),e.\u0275inj=d.Jb({factory:function(t){return new(t||e)},imports:[[i.c,a.h,c.a,r.m,o.l,o.F,u.a,l.a,s.i],a.h]}),e})()},CjzT:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},CoRJ:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},CqXF:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e){return t=>t.lift(new s(e))}class s{constructor(e){this.value=e}call(e,t){return t.subscribe(new o(e,this.value))}}class o extends i.a{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}},"D/JM":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},D0XW:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return s}));var i=n("3N8a");const r=new(n("IjjT").a)(i.a),s=r},D4zM:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{constructor(e,t){this.elementRef=e,this.renderer=t}ngOnInit(){this.renderer.setAttribute(this.elementRef.nativeElement,"tabindex","-1"),this.iElement=this.renderer.createElement("i"),this.renderer.addClass(this.iElement,"fa"),this.renderer.appendChild(this.elementRef.nativeElement,this.iElement),this.update()}getInputElement(){return document.getElementById(this.cdPasswordButton)}update(){const e=this.getInputElement();e&&"text"===e.type?(this.renderer.removeClass(this.iElement,"fa-eye"),this.renderer.addClass(this.iElement,"fa-eye-slash")):(this.renderer.removeClass(this.iElement,"fa-eye-slash"),this.renderer.addClass(this.iElement,"fa-eye"))}onClick(){const e=this.getInputElement();e.type="password"===e.type?"text":"password",this.update()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdPasswordButton",""]],hostBindings:function(e,t){1&e&&i.gc("click",(function(){return t.onClick()}))},inputs:{cdPasswordButton:"cdPasswordButton"}}),e})()},DH7j:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>Array.isArray||(e=>e&&"number"==typeof e.length))()},"DKr+":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return i?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("wd/R"))},DLK6:function(e,t,n){var i=n("ewvW"),r=Math.floor,s="".replace,o=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,c,l,u){var d=n+e.length,h=c.length,f=a;return void 0!==l&&(l=i(l),f=o),s.call(u,f,(function(i,s){var o;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(d);case"<":o=l[s.slice(1,-1)];break;default:var a=+s;if(0===a)return i;if(a>h){var u=r(a/10);return 0===u?i:u<=h?void 0===c[u-1]?s.charAt(1):c[u-1]+s.charAt(1):i}o=c[a-1]}return void 0===o?"":o}))}},DNAf:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("LvDl"),r=n.n(i);class s{constructor(e){this.customValidations={},this.empty="No items selected.",this.selectionLimit={tooltip:"Deselect item to select again",text:"Selection limit reached"},this.filter="Filter tags",this.add="Add badge",this.noOptions="There are no items available.",r.a.merge(this,e)}}},DPsx:function(e,t,n){var i=n("g6v/"),r=n("0Dky"),s=n("zBJ4");e.exports=!i&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},DSvg:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("LvDl"),r=n("vkgz"),s=n("aexS"),o=n("8Y7J"),a=n("IheW"),c=n("iInd");let l=(()=>{class e{constructor(e,t,n,i){this.authStorageService=e,this.http=t,this.router=n,this.route=i}check(e){return this.http.post("api/auth/check",{token:e})}login(e){return this.http.post("api/auth",e).pipe(Object(r.a)(e=>{this.authStorageService.set(e.username,e.permissions,e.sso,e.pwdExpirationDate,e.pwdUpdateRequired)}))}logout(e=null){return this.http.post("api/auth/logout",null).subscribe(t=>{this.authStorageService.remove();const n=i.get(this.route.snapshot.queryParams,"returnUrl","/login");this.router.navigate([n],{skipLocationChange:!0}),e&&e(),window.location.replace(t.redirect_url)})}}return e.\u0275fac=function(t){return new(t||e)(o.dc(s.a),o.dc(a.b),o.dc(c.e),o.dc(c.a))},e.\u0275prov=o.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Dkky:function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},DlmY:function(e,t,n){"use strict";var i=n("Y7yP"),r=Object(i.a)(Object,"create"),s=Object.prototype.hasOwnProperty,o=Object.prototype.hasOwnProperty;function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}a.prototype.clear=function(){this.__data__=r?r(null):{},this.size=0},a.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},a.prototype.get=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return s.call(t,e)?t[e]:void 0},a.prototype.has=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)},a.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this};var c=a,l=n("nLtN"),u=n("3cmB"),d=function(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function h(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}h.prototype.clear=function(){this.size=0,this.__data__={hash:new c,map:new(u.a||l.a),string:new c}},h.prototype.delete=function(e){var t=d(this,e).delete(e);return this.size-=t?1:0,t},h.prototype.get=function(e){return d(this,e).get(e)},h.prototype.has=function(e){return d(this,e).has(e)},h.prototype.set=function(e,t){var n=d(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},t.a=h},Dmvi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("wd/R"))},DoHr:function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'\xfcnc\xfc",4:"'\xfcnc\xfc",100:"'\xfcnc\xfc",6:"'nc\u0131",9:"'uncu",10:"'uncu",30:"'uncu",60:"'\u0131nc\u0131",90:"'\u0131nc\u0131"};e.defineLocale("tr",{months:"Ocak_\u015eubat_Mart_Nisan_May\u0131s_Haziran_Temmuz_A\u011fustos_Eyl\xfcl_Ekim_Kas\u0131m_Aral\u0131k".split("_"),monthsShort:"Oca_\u015eub_Mar_Nis_May_Haz_Tem_A\u011fu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Sal\u0131_\xc7ar\u015famba_Per\u015fembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_\xc7ar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_\xc7a_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"\xf6\xf6":"\xd6\xd6":n?"\xf6s":"\xd6S"},meridiemParse:/\xf6\xf6|\xd6\xd6|\xf6s|\xd6S/,isPM:function(e){return"\xf6s"===e||"\xd6S"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[yar\u0131n saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[d\xfcn] LT",lastWeek:"[ge\xe7en] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \xf6nce",s:"birka\xe7 saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir y\u0131l",yy:"%d y\u0131l"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'\u0131nc\u0131";var i=e%10;return e+(t[i]||t[e%100-i]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},Dwqy:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("LvDl"),r=n.n(i),s=n("wd/R"),o=n.n(s),a=n("8Y7J");o.a.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}});let c=(()=>{class e{transform(e,t=!0){let n;if(n=r.a.isNumber(e)?o.a.unix(e):o()(e),!n.isValid())return"";let i=n.fromNow();return t&&(i=r.a.upperFirst(i)),i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=a.Lb({name:"relativeDate",type:e,pure:!1}),e})()},DxQv:function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n_man_tir_ons_tor_fre_l\xf8r".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"p\xe5 dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},Dzi0:function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"E+lV":function(e,t,n){!function(e){"use strict";var t={words:{ss:["\u0441\u0435\u043a\u0443\u043d\u0434\u0430","\u0441\u0435\u043a\u0443\u043d\u0434\u0435","\u0441\u0435\u043a\u0443\u043d\u0434\u0438"],m:["\u0458\u0435\u0434\u0430\u043d \u043c\u0438\u043d\u0443\u0442","\u0458\u0435\u0434\u043d\u0435 \u043c\u0438\u043d\u0443\u0442\u0435"],mm:["\u043c\u0438\u043d\u0443\u0442","\u043c\u0438\u043d\u0443\u0442\u0435","\u043c\u0438\u043d\u0443\u0442\u0430"],h:["\u0458\u0435\u0434\u0430\u043d \u0441\u0430\u0442","\u0458\u0435\u0434\u043d\u043e\u0433 \u0441\u0430\u0442\u0430"],hh:["\u0441\u0430\u0442","\u0441\u0430\u0442\u0430","\u0441\u0430\u0442\u0438"],dd:["\u0434\u0430\u043d","\u0434\u0430\u043d\u0430","\u0434\u0430\u043d\u0430"],MM:["\u043c\u0435\u0441\u0435\u0446","\u043c\u0435\u0441\u0435\u0446\u0430","\u043c\u0435\u0441\u0435\u0446\u0438"],yy:["\u0433\u043e\u0434\u0438\u043d\u0430","\u0433\u043e\u0434\u0438\u043d\u0435","\u0433\u043e\u0434\u0438\u043d\u0430"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"\u0458\u0430\u043d\u0443\u0430\u0440_\u0444\u0435\u0431\u0440\u0443\u0430\u0440_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440_\u043e\u043a\u0442\u043e\u0431\u0430\u0440_\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440_\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440".split("_"),monthsShort:"\u0458\u0430\u043d._\u0444\u0435\u0431._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433._\u0441\u0435\u043f._\u043e\u043a\u0442._\u043d\u043e\u0432._\u0434\u0435\u0446.".split("_"),monthsParseExact:!0,weekdays:"\u043d\u0435\u0434\u0435\u0459\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a_\u0443\u0442\u043e\u0440\u0430\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a_\u043f\u0435\u0442\u0430\u043a_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434._\u043f\u043e\u043d._\u0443\u0442\u043e._\u0441\u0440\u0435._\u0447\u0435\u0442._\u043f\u0435\u0442._\u0441\u0443\u0431.".split("_"),weekdaysMin:"\u043d\u0435_\u043f\u043e_\u0443\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441\u0443".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[\u0434\u0430\u043d\u0430\u0441 \u0443] LT",nextDay:"[\u0441\u0443\u0442\u0440\u0430 \u0443] LT",nextWeek:function(){switch(this.day()){case 0:return"[\u0443] [\u043d\u0435\u0434\u0435\u0459\u0443] [\u0443] LT";case 3:return"[\u0443] [\u0441\u0440\u0435\u0434\u0443] [\u0443] LT";case 6:return"[\u0443] [\u0441\u0443\u0431\u043e\u0442\u0443] [\u0443] LT";case 1:case 2:case 4:case 5:return"[\u0443] dddd [\u0443] LT"}},lastDay:"[\u0458\u0443\u0447\u0435 \u0443] LT",lastWeek:function(){return["[\u043f\u0440\u043e\u0448\u043b\u0435] [\u043d\u0435\u0434\u0435\u0459\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0443\u0442\u043e\u0440\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0440\u0435\u0434\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0447\u0435\u0442\u0432\u0440\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u0435\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0443\u0431\u043e\u0442\u0435] [\u0443] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435 %s",s:"\u043d\u0435\u043a\u043e\u043b\u0438\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"\u0434\u0430\u043d",dd:t.translate,M:"\u043c\u0435\u0441\u0435\u0446",MM:t.translate,y:"\u0433\u043e\u0434\u0438\u043d\u0443",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},E2fk:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){return"[DBG]"===e?"debug":"[INF]"===e?"info":"[WRN]"===e?"warn":"[ERR]"===e?"err":""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"logPriority",type:e,pure:!0}),e})()},E9XD:function(e,t,n){"use strict";var i=n("I+eb"),r=n("1Y/n").left,s=n("pkCn"),o=n("LQDL"),a=n("YF1G");i({target:"Array",proto:!0,forced:!s("reduce")||!a&&o>79&&o<83},{reduce:function(e){return r(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},EApP:function(e,t,n){"use strict";n.d(t,"a",(function(){return C})),n.d(t,"b",(function(){return k}));var i=n("8Y7J"),r=n("GS7A"),s=n("XNiG"),o=n("cUpR"),a=n("SVse");const c=["toast-component",""];function l(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",5),i.gc("click",(function(){return i.Dc(e),i.ic().remove()})),i.Sb(1,"span",6),i.Oc(2,"\xd7"),i.Rb(),i.Rb()}}function u(e,t){if(1&e&&(i.Qb(0),i.Oc(1),i.Pb()),2&e){const e=i.ic(2);i.yb(1),i.Qc("[",e.duplicatesCount+1,"]")}}function d(e,t){if(1&e&&(i.Sb(0,"div"),i.Oc(1),i.Mc(2,u,2,1,"ng-container",4),i.Rb()),2&e){const e=i.ic();i.Ab(e.options.titleClass),i.zb("aria-label",e.title),i.yb(1),i.Qc(" ",e.title," "),i.yb(1),i.pc("ngIf",e.duplicatesCount)}}function h(e,t){if(1&e&&i.Nb(0,"div",7),2&e){const e=i.ic();i.Ab(e.options.messageClass),i.pc("innerHTML",e.message,i.Ec)}}function f(e,t){if(1&e&&(i.Sb(0,"div",8),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.Ab(e.options.messageClass),i.zb("aria-label",e.message),i.yb(1),i.Qc(" ",e.message," ")}}function p(e,t){if(1&e&&(i.Sb(0,"div"),i.Nb(1,"div",9),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Kc("width",e.width+"%")}}class m{constructor(e,t,n,i,r,o){this.toastId=e,this.config=t,this.message=n,this.title=i,this.toastType=r,this.toastRef=o,this._onTap=new s.a,this._onAction=new s.a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(e){this._onAction.next(e)}onAction(){return this._onAction.asObservable()}}const b={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},g=new i.r("ToastConfig");class _{constructor(e,t){this.component=e,this.injector=t}attach(e,t){return this._attachedHost=e,e.attach(this,t)}detach(){const e=this._attachedHost;if(e)return this._attachedHost=void 0,e.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class y extends class{attach(e,t){return this._attachedPortal=e,this.attachComponentPortal(e,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(e){this._disposeFn=e}}{constructor(e,t,n){super(),this._hostDomElement=e,this._componentFactoryResolver=t,this._appRef=n}attachComponentPortal(e,t){const n=this._componentFactoryResolver.resolveComponentFactory(e.component);let i;return i=n.create(e.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let v=(()=>{class e{constructor(e){this._document=e}ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const e=this._document.createElement("div");e.classList.add("overlay-container"),this._document.body.appendChild(e),this._containerElement=e}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.d))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(a.d))},token:e,providedIn:"root"}),e})();class w{constructor(e){this._portalHost=e}attach(e,t=!0){return this._portalHost.attach(e,t)}detach(){return this._portalHost.detach()}}let S=(()=>{class e{constructor(e,t,n,i){this._overlayContainer=e,this._componentFactoryResolver=t,this._appRef=n,this._document=i,this._paneElements=new Map}create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){const n=this._document.createElement("div");return n.id="toast-container",n.classList.add(e),n.classList.add("toast-container"),t?t.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(e){return new y(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new w(this._createPortalHost(e))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(v),i.dc(i.j),i.dc(i.g),i.dc(a.d))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(v),Object(i.dc)(i.j),Object(i.dc)(i.g),Object(i.dc)(a.d))},token:e,providedIn:"root"}),e})();class M{constructor(e){this._overlayRef=e,this.duplicatesCount=0,this._afterClosed=new s.a,this._activate=new s.a,this._manualClose=new s.a,this._resetTimeout=new s.a,this._countDuplicate=new s.a}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(e,t){e&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}}class x{constructor(e,t){this._toastPackage=e,this._parentInjector=t}get(e,t,n){return e===m?this._toastPackage:this._parentInjector.get(e,t,n)}}let k=(()=>{class e{constructor(e,t,n,i,r){this.overlay=t,this._injector=n,this.sanitizer=i,this.ngZone=r,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=Object.assign(Object.assign({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=Object.assign(Object.assign({},e.default.iconClasses),e.config.iconClasses))}show(e,t,n={},i=""){return this._preBuildNotification(i,e,t,this.applyConfig(n))}success(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",e,t,this.applyConfig(n))}error(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",e,t,this.applyConfig(n))}info(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",e,t,this.applyConfig(n))}warning(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",e,t,this.applyConfig(n))}clear(e){for(const t of this.toasts)if(void 0!==e){if(t.toastId===e)return void t.toastRef.manualClose()}else t.toastRef.manualClose()}remove(e){const t=this._findToast(e);if(!t)return!1;if(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length)return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){const e=this.toasts[this.currentlyActive].toastRef;e.isInactive()||(this.currentlyActive=this.currentlyActive+1,e.activate())}return!0}findDuplicate(e="",t="",n,i){const{includeTitleDuplicates:r}=this.toastrConfig;for(const s of this.toasts){const o=r&&s.title===e;if((!r||o)&&s.message===t)return s.toastRef.onDuplicate(n,i),s}return null}applyConfig(e={}){return Object.assign(Object.assign({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,n,i){return i.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,n,i)):this._buildNotification(e,t,n,i)}_buildNotification(e,t,n,r){if(!r.toastComponent)throw new Error("toastComponent required");const s=this.findDuplicate(n,t,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||t)&&this.toastrConfig.preventDuplicates&&null!==s)return s;this.previousToastMessage=t;let o=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(o=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const a=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let c=t;t&&r.enableHtml&&(c=this.sanitizer.sanitize(i.I.HTML,t));const l=new M(a),u=new m(this.index,r,c,n,e,l),d=new x(u,this._injector),h=new _(r.toastComponent,d),f=a.attach(h,this.toastrConfig.newestOnTop);l.componentInstance=f.instance;const p={toastId:this.index,title:n||"",message:t||"",toastRef:l,onShown:l.afterActivate(),onHidden:l.afterClosed(),onTap:u.onTap(),onAction:u.onAction(),portal:f};return o||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{p.toastRef.activate()})),this.toasts.push(p),p}}return e.\u0275fac=function(t){return new(t||e)(i.dc(g),i.dc(S),i.dc(i.s),i.dc(o.b),i.dc(i.A))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(g),Object(i.dc)(S),Object(i.dc)(i.p),Object(i.dc)(o.b),Object(i.dc)(i.A))},token:e,providedIn:"root"}),e})(),D=(()=>{class e{constructor(e,t,n){this.toastrService=e,this.toastPackage=t,this.ngZone=n,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(e=>{this.duplicatesCount=e})}get displayStyle(){if("inactive"===this.state.value)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Object.assign(Object.assign({},this.state),{value:"active"}),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const e=(new Date).getTime();this.width=(this.hideTime-e)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Object.assign(Object.assign({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=Object.assign(Object.assign({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0!==this.options.disableTimeOut&&"extendedTimeOut"!==this.options.disableTimeOut&&0!==this.options.extendedTimeOut&&"removed"!==this.state.value&&(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(k),i.Mb(m),i.Mb(i.A))},e.\u0275cmp=i.Gb({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,t){1&e&&i.gc("click",(function(){return t.tapToast()}))("mouseenter",(function(){return t.stickAround()}))("mouseleave",(function(){return t.delayedHideToast()})),2&e&&(i.Lc("@flyInOut",t.state),i.Ab(t.toastClasses),i.Kc("display",t.displayStyle))},attrs:c,decls:5,vars:5,consts:[["class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class","innerHTML",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class",4,"ngIf"],[4,"ngIf"],["aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alertdialog","aria-live","polite",3,"innerHTML"],["role","alertdialog","aria-live","polite"],[1,"toast-progress"]],template:function(e,t){1&e&&(i.Mc(0,l,3,0,"button",0),i.Mc(1,d,3,5,"div",1),i.Mc(2,h,1,3,"div",2),i.Mc(3,f,2,4,"div",3),i.Mc(4,p,2,2,"div",4)),2&e&&(i.pc("ngIf",t.options.closeButton),i.yb(1),i.pc("ngIf",t.title),i.yb(1),i.pc("ngIf",t.message&&t.options.enableHtml),i.yb(1),i.pc("ngIf",t.message&&!t.options.enableHtml),i.yb(1),i.pc("ngIf",t.options.progressBar))},directives:[a.r],encapsulation:2,data:{animation:[Object(r.j)("flyInOut",[Object(r.g)("inactive",Object(r.h)({opacity:0})),Object(r.g)("active",Object(r.h)({opacity:1})),Object(r.g)("removed",Object(r.h)({opacity:0})),Object(r.i)("inactive => active",Object(r.e)("{{ easeTime }}ms {{ easing }}")),Object(r.i)("active => removed",Object(r.e)("{{ easeTime }}ms {{ easing }}"))])]}}),e})();const T=Object.assign(Object.assign({},b),{toastComponent:D});let C=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[{provide:g,useValue:{default:T,config:t}}]}}}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[a.c]]}),e})()},ENF9:function(e,t,n){"use strict";var i,r=n("2oRo"),s=n("4syw"),o=n("8YOa"),a=n("bWFh"),c=n("rKzb"),l=n("hh1v"),u=n("afO8").enforce,d=n("f5p1"),h=!r.ActiveXObject&&"ActiveXObject"in r,f=Object.isExtensible,p=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},m=e.exports=a("WeakMap",p,c);if(d&&h){i=c.getConstructor(p,"WeakMap",!0),o.REQUIRED=!0;var b=m.prototype,g=b.delete,_=b.has,y=b.get,v=b.set;s(b,{delete:function(e){if(l(e)&&!f(e)){var t=u(this);return t.frozen||(t.frozen=new i),g.call(this,e)||t.frozen.delete(e)}return g.call(this,e)},has:function(e){if(l(e)&&!f(e)){var t=u(this);return t.frozen||(t.frozen=new i),_.call(this,e)||t.frozen.has(e)}return _.call(this,e)},get:function(e){if(l(e)&&!f(e)){var t=u(this);return t.frozen||(t.frozen=new i),_.call(this,e)?y.call(this,e):t.frozen.get(e)}return y.call(this,e)},set:function(e,t){if(l(e)&&!f(e)){var n=u(this);n.frozen||(n.frozen=new i),_.call(this,e)?v.call(this,e,t):n.frozen.set(e,t)}else v.call(this,e,t);return this}})}},EOgW:function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21_\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c_\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21_\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19_\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21_\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19_\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21_\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21_\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19_\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21_\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19_\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21".split("_"),monthsShort:"\u0e21.\u0e04._\u0e01.\u0e1e._\u0e21\u0e35.\u0e04._\u0e40\u0e21.\u0e22._\u0e1e.\u0e04._\u0e21\u0e34.\u0e22._\u0e01.\u0e04._\u0e2a.\u0e04._\u0e01.\u0e22._\u0e15.\u0e04._\u0e1e.\u0e22._\u0e18.\u0e04.".split("_"),monthsParseExact:!0,weekdays:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysShort:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysMin:"\u0e2d\u0e32._\u0e08._\u0e2d._\u0e1e._\u0e1e\u0e24._\u0e28._\u0e2a.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm",LLLL:"\u0e27\u0e31\u0e19dddd\u0e17\u0e35\u0e48 D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm"},meridiemParse:/\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07|\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07/,isPM:function(e){return"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"===e},meridiem:function(e,t,n){return e<12?"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07":"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"},calendar:{sameDay:"[\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextDay:"[\u0e1e\u0e23\u0e38\u0e48\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextWeek:"dddd[\u0e2b\u0e19\u0e49\u0e32 \u0e40\u0e27\u0e25\u0e32] LT",lastDay:"[\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e27\u0e32\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",lastWeek:"[\u0e27\u0e31\u0e19]dddd[\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e27\u0e25\u0e32] LT",sameElse:"L"},relativeTime:{future:"\u0e2d\u0e35\u0e01 %s",past:"%s\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27",s:"\u0e44\u0e21\u0e48\u0e01\u0e35\u0e48\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",ss:"%d \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",m:"1 \u0e19\u0e32\u0e17\u0e35",mm:"%d \u0e19\u0e32\u0e17\u0e35",h:"1 \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",hh:"%d \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",d:"1 \u0e27\u0e31\u0e19",dd:"%d \u0e27\u0e31\u0e19",w:"1 \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",ww:"%d \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",M:"1 \u0e40\u0e14\u0e37\u0e2d\u0e19",MM:"%d \u0e40\u0e14\u0e37\u0e2d\u0e19",y:"1 \u0e1b\u0e35",yy:"%d \u0e1b\u0e35"}})}(n("wd/R"))},EUcb:function(e,t,n){"use strict";t.a=function(e){return null!=e&&"object"==typeof e}},EY2u:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));var i=n("HDdC");const r=new i.a(e=>e.complete());function s(e){return e?function(e){return new i.a(t=>e.schedule(()=>t.complete()))}(e):r}},EgGo:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("SVse"),r=n("sne2");class s{constructor(e){this.base=e}static concatURLSegments(e){return e.reduce(i.m.joinWithSlash)}static buildURL(e,...t){return s.concatURLSegments([...e?["/"]:[],...t])}getURL(e,t=!0,...n){return s.buildURL(t,this.base,e,...n)}getCreate(e=!0){return this.getURL(r.e.CREATE,e)}getCreateFrom(e,t=!0){return this.getURL(r.e.CREATE,t,e)}getDelete(e=!0){return this.getURL(r.e.DELETE,e)}getEdit(e,t=!0){return this.getURL(r.e.EDIT,t,e)}getUpdate(e,t=!0){return this.getURL(r.e.UPDATE,t,e)}getAdd(e=!0){return this.getURL(r.e.ADD,e)}getRemove(e=!0){return this.getURL(r.e.REMOVE,e)}getRecreate(e,t=!0){return this.getURL(r.e.RECREATE,t,e)}}},Ekvf:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("mrSG"),r=n("IheW"),s=n("lJxs"),o=n("xTzq"),a=n("o8EM"),c=n("8Y7J");let l=(()=>{let e=class{constructor(e,t){this.http=e,this.rbdConfigurationService=t,this.apiPath="api/pool"}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}update(e){let t;return e.hasOwnProperty("srcpool")?(t=e.srcpool,delete e.srcpool):(t=e.pool,delete e.pool),this.http.put(`${this.apiPath}/${encodeURIComponent(t)}`,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}get(e){return this.http.get(`${this.apiPath}/${e}`)}getList(){return this.http.get(this.apiPath+"?stats=true")}getConfiguration(e){return this.http.get(`${this.apiPath}/${e}/configuration`).pipe(Object(s.a)(e=>e.map(e=>Object.assign(e,this.rbdConfigurationService.getOptionByName(e.name)))))}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}list(e=[]){const t=e.join(",");return this.http.get(`${this.apiPath}?attrs=${t}`).toPromise().then(e=>e)}};return e.\u0275fac=function(t){return new(t||e)(c.dc(r.b),c.dc(a.a))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([o.a,Object(i.d)("design:paramtypes",[r.b,a.a])],e),e})()},EmSq:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("8Y7J"),r=n("LvDl"),s=n.n(r),o=n("Fgil"),a=n("aXbf"),c=n("s7LF");let l=(()=>{class e{constructor(e,t,n,r){this.elementRef=e,this.control=t,this.dimlessBinaryPipe=n,this.formatter=r,this.ngModelChange=new i.o,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value)}setValue(e){/^[\d.]+$/.test(e)&&(e+=this.defaultUnit||"m");const t=this.formatter.toBytes(e),n=this.round(t);this.el.value=this.dimlessBinaryPipe.transform(n),null!==t?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(e){if(null!==e&&0!==e){if(!s.a.isUndefined(this.minBytes)&&e<this.minBytes)return this.minBytes;if(!s.a.isUndefined(this.maxBytes)&&e>this.maxBytes)return this.maxBytes;if(!s.a.isUndefined(this.roundPower)){const t=Math.round(Math.log(e)/Math.log(this.roundPower));return Math.pow(this.roundPower,t)}}return e}onBlur(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(c.p),i.Mb(o.a),i.Mb(a.a))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdDimlessBinary",""]],hostBindings:function(e,t){1&e&&i.gc("blur",(function(e){return t.onBlur(e.target.value)}))},inputs:{minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),e})()},F8JR:function(e,t,n){"use strict";var i=n("tycR").forEach,r=n("pkCn")("forEach");e.exports=r?[].forEach:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}},FFMq:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){return e.join(", ")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"join",type:e,pure:!0}),e})()},FMNM:function(e,t,n){var i=n("xrYK"),r=n("kmMV");e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var s=n.call(e,t);if("object"!=typeof s)throw TypeError("RegExp exec method returned something other than an Object or null");return s}if("RegExp"!==i(e))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(e,t)}},FSuO:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("8Y7J"),r=n("LvDl"),s=n.n(r),o=n("x38r"),a=n("a0VL"),c=n("uIqm");let l=(()=>{class e{constructor(e){this.datePipe=e,this.autoReload=5e3,this.renderObjects=!1,this.appendParentKey=!0,this.hideEmpty=!1,this.hideKeys=[],this.columns=[],this.fetchData=new i.o}ngOnInit(){this.columns=[{prop:"key",flexGrow:1,cellTransformation:o.a.bold},{prop:"value",flexGrow:3}],this.customCss&&(this.columns[1].cellTransformation=o.a.classAdding),this.fetchData.observers.length>0&&this.table.fetchData.subscribe(()=>{this.fetchData.emit()}),this.useData()}ngOnChanges(){this.useData()}useData(){if(!this.data)return;let e=this.makePairs(this.data);this.hideKeys&&(e=e.filter(e=>!this.hideKeys.includes(e.key))),this.tableData=e}makePairs(e){let t=[];if(e){if(s.a.isArray(e))t=this.makePairsFromArray(e);else{if(!s.a.isObject(e))throw new Error("Wrong data format");t=this.makePairsFromObject(e)}return t=t.map(e=>(e.value=this.convertValue(e.value),e)).filter(e=>null!==e.value),s.a.sortBy(this.renderObjects?this.insertFlattenObjects(t):t,"key")}}makePairsFromArray(e){let t=[];const n=e[0];if(s.a.isArray(n)){if(2!==n.length)throw new Error(`Array contains too many elements (${n.length}). Needs to be of type [string, any][]`);t=e.map(e=>({key:e[0],value:e[1]}))}else s.a.isObject(n)&&(t=s.a.has(n,"key")&&s.a.has(n,"value")?[...e]:e.reduce((e,t)=>e.concat(this.makePairsFromObject(t)),t));return t}makePairsFromObject(e){return Object.keys(e).map(t=>({key:t,value:e[t]}))}insertFlattenObjects(e){return s.a.flattenDeep(e.map(e=>{const t=e.value,n=s.a.isObject(t);return!n||s.a.isEmpty(t)?(n&&(e.value=""),e):this.splitItemIntoItems(e)}))}splitItemIntoItems(e){return this.makePairs(e.value).map(t=>(this.appendParentKey&&(t.key=e.key+" "+t.key),t))}convertValue(e){if(s.a.isArray(e)){if(s.a.isEmpty(e)&&this.hideEmpty)return null;e=e.map(e=>s.a.isObject(e)?JSON.stringify(e):e).join(", ")}else if(s.a.isObject(e)){if(this.hideEmpty&&s.a.isEmpty(e)||!this.renderObjects)return null}else if(s.a.isString(e)){if(""===e&&this.hideEmpty)return null;this.isDate(e)&&(e=this.datePipe.transform(e)||e)}return e}isDate(e){const t="[ -:.TZ]",n="\\d{2}"+t;return e.match(new RegExp("^\\d{4}"+t+n+n+n+n+n+"\\d*Z?$"))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(a.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-table-key-value"]],viewQuery:function(e,t){var n;1&e&&i.Jc(c.a,!0),2&e&&i.zc(n=i.hc())&&(t.table=n.first)},inputs:{data:"data",autoReload:"autoReload",renderObjects:"renderObjects",appendParentKey:"appendParentKey",hideEmpty:"hideEmpty",hideKeys:"hideKeys",customCss:"customCss"},outputs:{fetchData:"fetchData"},features:[i.wb],decls:2,vars:9,consts:[["columnMode","flex",3,"data","columns","toolHeader","autoReload","customCss","autoSave","header","footer","limit"],["table",""]],template:function(e,t){1&e&&i.Nb(0,"cd-table",0,1),2&e&&i.pc("data",t.tableData)("columns",t.columns)("toolHeader",!1)("autoReload",t.autoReload)("customCss",t.customCss)("autoSave",!1)("header",!1)("footer",!1)("limit",0)},directives:[c.a],styles:[""]}),e})()},Fgil:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1024,["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"])}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(i.a))},e.\u0275pipe=r.Lb({name:"dimlessBinary",type:e,pure:!0}),e})()},Fnuy:function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"geni\xe8r_febri\xe8r_mar\xe7_abril_mai_junh_julhet_agost_setembre_oct\xf2bre_novembre_decembre".split("_"),format:"de geni\xe8r_de febri\xe8r_de mar\xe7_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'oct\xf2bre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dim\xe8cres_dij\xf2us_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[u\xe8i a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[i\xe8r a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},"G+Rx":function(e,t,n){var i=n("0GbY");e.exports=i("document","documentElement")},G0Uy:function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_\u0120unju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Di\u010bembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_\u0120un_Lul_Aww_Set_Ott_Nov_Di\u010b".split("_"),weekdays:"Il-\u0126add_It-Tnejn_It-Tlieta_L-Erbg\u0127a_Il-\u0126amis_Il-\u0120img\u0127a_Is-Sibt".split("_"),weekdaysShort:"\u0126ad_Tne_Tli_Erb_\u0126am_\u0120im_Sib".split("_"),weekdaysMin:"\u0126a_Tn_Tl_Er_\u0126a_\u0120i_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[G\u0127ada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-biera\u0127 fil-]LT",lastWeek:"dddd [li g\u0127adda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f\u2019 %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"sieg\u0127a",hh:"%d sieg\u0127at",d:"\u0121urnata",dd:"%d \u0121ranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},G0yt:function(e,t,n){"use strict";n.d(t,"a",(function(){return Xt})),n.d(t,"b",(function(){return He})),n.d(t,"c",(function(){return We})),n.d(t,"d",(function(){return Qe})),n.d(t,"e",(function(){return Ve})),n.d(t,"f",(function(){return Be})),n.d(t,"g",(function(){return ht})),n.d(t,"h",(function(){return Nt})),n.d(t,"i",(function(){return Bt})),n.d(t,"j",(function(){return $t})),n.d(t,"k",(function(){return Ht})),n.d(t,"l",(function(){return Ut})),n.d(t,"m",(function(){return Vt})),n.d(t,"n",(function(){return It})),n.d(t,"o",(function(){return sn})),n.d(t,"p",(function(){return dn})),n.d(t,"q",(function(){return ln})),n.d(t,"r",(function(){return un})),n.d(t,"s",(function(){return hn})),n.d(t,"t",(function(){return pn})),n.d(t,"u",(function(){return fn})),n.d(t,"v",(function(){return zt})),n.d(t,"w",(function(){return Sn})),n.d(t,"x",(function(){return yn})),n.d(t,"y",(function(){return Mn})),n.d(t,"z",(function(){return kn})),n.d(t,"A",(function(){return Dn})),n.d(t,"B",(function(){return jn})),n.d(t,"C",(function(){return Nn})),n.d(t,"D",(function(){return $n})),n.d(t,"E",(function(){return Fn})),n.d(t,"F",(function(){return Hn})),n.d(t,"G",(function(){return Kn})),n.d(t,"H",(function(){return Zn}));var i=n("8Y7J"),r=n("SVse"),s=n("s7LF"),o=n("XNiG"),a=n("2Vo4"),c=(n("itXk"),n("PqYM"),n("5yfJ"),n("xgIS")),l=n("VRyK"),u=n("DH7j"),d=n("yCtX"),h=n("l7GE"),f=n("ZUHj");class p{call(e,t){return t.subscribe(new m(e))}}class m extends h.a{constructor(e){super(e),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(e){this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(let n=0;n<t&&!this.hasFirst;n++){const t=e[n],i=Object(f.a)(this,t,void 0,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}}notifyNext(e,t,n){if(!this.hasFirst){this.hasFirst=!0;for(let e=0;e<this.subscriptions.length;e++)if(e!==n){let t=this.subscriptions[e];t.unsubscribe(),this.remove(t)}this.subscriptions=null}this.destination.next(t)}}var b=n("HDdC"),g=n("lJxs"),_=(n("JX91"),n("/uUt"),n("eIep")),y=n("1G5W"),v=n("pLZG"),w=n("IzEk"),S=n("vkgz");function M(...e){return t=>{let n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new x(e,n))}}class x{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new k(e,this.observables,this.project))}}class k extends h.a{constructor(e,t,n){super(e),this.observables=t,this.project=n,this.toRespond=[];const i=t.length;this.values=new Array(i);for(let r=0;r<i;r++)this.toRespond.push(r);for(let r=0;r<i;r++){let e=t[r];this.add(Object(f.a)(this,e,void 0,r))}}notifyNext(e,t,n){this.values[n]=t;const i=this.toRespond;if(i.length>0){const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}var D=n("3E0/"),T=n("w1tV");function C(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",1),i.Yb(1,2),i.gc("click",(function(){return i.Dc(e),i.ic().closeHandler()})),i.Sb(2,"span",3),i.Oc(3,"\xd7"),i.Rb(),i.Rb()}}const O=["*"],R=["defaultDayTemplate"],L=["content"];function E(e,t){if(1&e&&i.Nb(0,"div",7),2&e){const e=t.currentMonth,n=t.selected,r=t.disabled,s=t.focused;i.pc("date",t.date)("currentMonth",e)("selected",n)("disabled",r)("focused",s)}}function A(e,t){if(1&e&&(i.Sb(0,"div",12),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(1),i.Rc(" ",t.i18n.getMonthFullName(e.number,e.year)," ",t.i18n.getYearNumerals(e.year)," ")}}function I(e,t){if(1&e&&(i.Sb(0,"div",9),i.Mc(1,A,2,2,"div",10),i.Nb(2,"ngb-datepicker-month",11),i.Rb()),2&e){const e=t.$implicit,n=i.ic(2);i.yb(1),i.pc("ngIf","none"===n.navigation||n.displayMonths>1&&"select"===n.navigation),i.yb(1),i.pc("month",e.firstDate)}}function P(e,t){if(1&e&&i.Mc(0,I,3,2,"div",8),2&e){const e=i.ic();i.pc("ngForOf",e.model.months)}}function j(e,t){if(1&e){const e=i.Tb();i.Sb(0,"ngb-datepicker-navigation",13),i.gc("navigate",(function(t){return i.Dc(e),i.ic().onNavigateEvent(t)}))("select",(function(t){return i.Dc(e),i.ic().onNavigateDateSelect(t)})),i.Rb()}if(2&e){const e=i.ic();i.pc("date",e.model.firstDate)("months",e.model.months)("disabled",e.model.disabled)("showSelect","select"===e.model.navigation)("prevDisabled",e.model.prevDisabled)("nextDisabled",e.model.nextDisabled)("selectBoxes",e.model.selectBoxes)}}function N(e,t){}function F(e,t){}function Y(e,t){1&e&&i.Nb(0,"div",5)}function z(e,t){if(1&e&&(i.Sb(0,"div",6),i.Oc(1),i.Rb()),2&e){const e=t.$implicit,n=i.ic(2);i.yb(1),i.Qc(" ",n.i18n.getWeekdayShortName(e)," ")}}function $(e,t){if(1&e&&(i.Sb(0,"div",2),i.Mc(1,Y,1,0,"div",3),i.Mc(2,z,2,1,"div",4),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.datepicker.showWeekNumbers),i.yb(1),i.pc("ngForOf",e.viewModel.weekdays)}}function H(e,t){if(1&e&&(i.Sb(0,"div",11),i.Oc(1),i.Rb()),2&e){const e=i.ic(2).$implicit,t=i.ic();i.yb(1),i.Pc(t.i18n.getWeekNumerals(e.number))}}function W(e,t){}function V(e,t){if(1&e&&i.Mc(0,W,0,0,"ng-template",14),2&e){const e=i.ic().$implicit,t=i.ic(3);i.pc("ngTemplateOutlet",t.datepicker.dayTemplate)("ngTemplateOutletContext",e.context)}}function B(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",12),i.gc("click",(function(n){i.Dc(e);const r=t.$implicit;return i.ic(3).doSelect(r),n.preventDefault()})),i.Mc(1,V,1,2,"ng-template",13),i.Rb()}if(2&e){const e=t.$implicit;i.Eb("disabled",e.context.disabled)("hidden",e.hidden)("ngb-dp-today",e.context.today),i.pc("tabindex",e.tabindex),i.zb("aria-label",e.ariaLabel),i.yb(1),i.pc("ngIf",!e.hidden)}}function U(e,t){if(1&e&&(i.Sb(0,"div",8),i.Mc(1,H,2,1,"div",9),i.Mc(2,B,2,9,"div",10),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic();i.yb(1),i.pc("ngIf",t.datepicker.showWeekNumbers),i.yb(1),i.pc("ngForOf",e.days)}}function G(e,t){1&e&&i.Mc(0,U,3,2,"div",7),2&e&&i.pc("ngIf",!t.$implicit.collapsed)}function q(e,t){if(1&e){const e=i.Tb();i.Sb(0,"ngb-datepicker-navigation-select",8),i.gc("select",(function(t){return i.Dc(e),i.ic().select.emit(t)})),i.Rb()}if(2&e){const e=i.ic();i.pc("date",e.date)("disabled",e.disabled)("months",e.selectBoxes.months)("years",e.selectBoxes.years)}}function J(e,t){1&e&&i.Nb(0,"div",0)}function Q(e,t){1&e&&i.Nb(0,"div",0)}function K(e,t){if(1&e&&(i.Mc(0,J,1,0,"div",10),i.Sb(1,"div",11),i.Oc(2),i.Rb(),i.Mc(3,Q,1,0,"div",10)),2&e){const e=t.$implicit,n=t.index,r=i.ic(2);i.pc("ngIf",n>0),i.yb(2),i.Rc(" ",r.i18n.getMonthFullName(e.number,e.year)," ",r.i18n.getYearNumerals(e.year)," "),i.yb(1),i.pc("ngIf",n!==r.months.length-1)}}function Z(e,t){if(1&e&&i.Mc(0,K,4,4,"ng-template",9),2&e){const e=i.ic();i.pc("ngForOf",e.months)}}const X=["ngbDatepickerDayView",""],ee=["month"],te=["year"];function ne(e,t){if(1&e&&(i.Sb(0,"option",6),i.Oc(1),i.Rb()),2&e){const e=t.$implicit,n=i.ic();i.pc("value",e),i.zb("aria-label",n.i18n.getMonthFullName(e,null==n.date?null:n.date.year)),i.yb(1),i.Pc(n.i18n.getMonthShortName(e,null==n.date?null:n.date.year))}}function ie(e,t){if(1&e&&(i.Sb(0,"option",6),i.Oc(1),i.Rb()),2&e){const e=t.$implicit,n=i.ic();i.pc("value",e),i.yb(1),i.Pc(n.i18n.getYearNumerals(e))}}const re=["dialog"],se=["ngbNavOutlet",""];function oe(e,t){}const ae=function(e){return{$implicit:e}};function ce(e,t){if(1&e&&(i.Sb(0,"div",2),i.Mc(1,oe,0,0,"ng-template",3),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic();i.Eb("active",e.active),i.pc("id",e.panelDomId),i.zb("role",t.paneRole?t.paneRole:t.nav.roles?"tabpanel":void 0)("aria-labelledby",e.domId),i.yb(1),i.pc("ngTemplateOutlet",(null==e.contentTpl?null:e.contentTpl.templateRef)||null)("ngTemplateOutletContext",i.uc(7,ae,e.active))}}function le(e,t){1&e&&i.Mc(0,ce,2,9,"div",1),2&e&&i.pc("ngIf",t.$implicit.isPanelInDom())}function ue(e,t){if(1&e&&i.Oc(0),2&e){const e=i.ic(2);i.Pc(e.title)}}function de(e,t){}function he(e,t){if(1&e&&(i.Sb(0,"h3",3),i.Mc(1,ue,1,1,"ng-template",null,4,i.Nc),i.Mc(3,de,0,0,"ng-template",5),i.Rb()),2&e){const e=i.Ac(2),t=i.ic();i.yb(3),i.pc("ngTemplateOutlet",t.isTitleTemplate()?t.title:e)("ngTemplateOutletContext",t.context)}}function fe(e,t){if(1&e&&(i.Sb(0,"span"),i.Wb(1,3),i.jc(2,"percent"),i.Rb()),2&e){const e=i.ic();i.yb(2),i.ac(i.kc(2,1,e.getValue()/e.max)),i.Xb(1)}}function pe(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic();return t.changeHour(t.hourStep)})),i.Nb(1,"span",13),i.Sb(2,"span",14),i.Wb(3,15),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function me(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic();return t.changeHour(-t.hourStep)})),i.Nb(1,"span",16),i.Sb(2,"span",14),i.Wb(3,17),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function be(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic();return t.changeMinute(t.minuteStep)})),i.Nb(1,"span",13),i.Sb(2,"span",14),i.Wb(3,18),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function ge(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic();return t.changeMinute(-t.minuteStep)})),i.Nb(1,"span",16),i.Sb(2,"span",14),i.Wb(3,19),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function _e(e,t){1&e&&(i.Sb(0,"div",6),i.Oc(1,":"),i.Rb())}function ye(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic(2);return t.changeSecond(t.secondStep)})),i.Nb(1,"span",13),i.Sb(2,"span",14),i.Wb(3,22),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function ve(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",12),i.gc("click",(function(){i.Dc(e);const t=i.ic(2);return t.changeSecond(-t.secondStep)})),i.Nb(1,"span",16),i.Sb(2,"span",14),i.Wb(3,23),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.Eb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),i.pc("disabled",e.disabled)}}function we(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",20),i.Mc(1,ye,4,7,"button",3),i.Sb(2,"input",4),i.Yb(3,21),i.gc("change",(function(t){return i.Dc(e),i.ic().updateSecond(t.target.value)}))("input",(function(t){return i.Dc(e),i.ic().formatInput(t.target)}))("keydown.ArrowUp",(function(t){i.Dc(e);const n=i.ic();return n.changeSecond(n.secondStep),t.preventDefault()}))("keydown.ArrowDown",(function(t){i.Dc(e);const n=i.ic();return n.changeSecond(-n.secondStep),t.preventDefault()})),i.Rb(),i.Mc(4,ve,4,7,"button",3),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.spinners),i.yb(1),i.Eb("form-control-sm",e.isSmallSize)("form-control-lg",e.isLargeSize),i.pc("value",e.formatMinSec(null==e.model?null:e.model.second))("readOnly",e.readonlyInputs)("disabled",e.disabled),i.yb(2),i.pc("ngIf",e.spinners)}}function Se(e,t){1&e&&i.Nb(0,"div",6)}function Me(e,t){if(1&e&&(i.Qb(0),i.Wb(1,28),i.Pb()),2&e){const e=i.ic(2);i.yb(1),i.ac(e.i18n.getAfternoonPeriod()),i.Xb(1)}}function xe(e,t){if(1&e&&i.Wb(0,29),2&e){const e=i.ic(2);i.ac(e.i18n.getMorningPeriod()),i.Xb(0)}}function ke(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",24),i.Sb(1,"button",25),i.gc("click",(function(){return i.Dc(e),i.ic().toggleMeridian()})),i.Mc(2,Me,2,1,"ng-container",26),i.Mc(3,xe,1,1,"ng-template",null,27,i.Nc),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(4),t=i.ic();i.yb(1),i.Eb("btn-sm",t.isSmallSize)("btn-lg",t.isLargeSize)("disabled",t.disabled),i.pc("disabled",t.disabled),i.yb(1),i.pc("ngIf",t.model&&t.model.hour>=12)("ngIfElse",e)}}function De(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic();i.Ab(t.highlightClass),i.yb(1),i.Pc(e)}}function Te(e,t){if(1&e&&i.Oc(0),2&e){const e=i.ic().$implicit;i.Pc(e)}}function Ce(e,t){if(1&e&&(i.Mc(0,De,2,3,"span",1),i.Mc(1,Te,1,1,"ng-template",null,2,i.Nc)),2&e){const e=t.odd,n=i.Ac(2);i.pc("ngIf",e)("ngIfElse",n)}}function Oe(e,t){if(1&e&&i.Nb(0,"ngb-highlight",2),2&e){const e=t.term;i.pc("result",(0,t.formatter)(t.result))("term",e)}}function Re(e,t){}const Le=function(e,t,n){return{result:e,term:t,formatter:n}};function Ee(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",3),i.gc("mouseenter",(function(){i.Dc(e);const n=t.index;return i.ic().markActive(n)}))("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic().select(n)})),i.Mc(1,Re,0,0,"ng-template",4),i.Rb()}if(2&e){const e=t.$implicit,n=t.index,r=i.ic(),s=i.Ac(1);i.Eb("active",n===r.activeIdx),i.pc("id",r.id+"-"+n),i.yb(1),i.pc("ngTemplateOutlet",r.resultTemplate||s)("ngTemplateOutletContext",i.wc(5,Le,e,r.term,r.formatter))}}function Ae(e){return parseInt(""+e,10)}function Ie(e){return null!=e?""+e:""}function Pe(e){return"string"==typeof e}function je(e){return!isNaN(Ae(e))}function Ne(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function Fe(e){return null!=e}function Ye(e){return je(e)?("0"+e).slice(-2):""}function ze(e,t){return e&&e.className&&e.className.split&&e.className.split(/\s+/).indexOf(t)>=0}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(e){let t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});let $e=(()=>{let e=class{constructor(){this.dismissible=!0,this.type="warning"}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),He=(()=>{let e=class{constructor(e,t,n){this._renderer=t,this._element=n,this.close=new i.o,this.dismissible=e.dismissible,this.type=e.type}closeHandler(){this.close.emit()}ngOnChanges(e){const t=e.type;t&&!t.firstChange&&(this._renderer.removeClass(this._element.nativeElement,"alert-"+t.previousValue),this._renderer.addClass(this._element.nativeElement,"alert-"+t.currentValue))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,"alert-"+this.type)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb($e),i.Mb(i.E),i.Mb(i.m))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert"],hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("alert-dismissible",t.dismissible)},inputs:{dismissible:"dismissible",type:"type"},outputs:{close:"close"},features:[i.wb],ngContentSelectors:O,decls:2,vars:1,consts:function(){return[["type","button","class","close",3,"click",4,"ngIf",6,"aria-label"],["type","button",1,"close",3,"click",6,"aria-label"],["aria-label","Close"],["aria-hidden","true"]]},template:function(e,t){1&e&&(i.oc(),i.nc(0),i.Mc(1,C,4,0,"button",0)),2&e&&(i.yb(1),i.pc("ngIf",t.dismissible))},directives:[r.r],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),e})(),We=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})(),Ve=(()=>{let e=class{constructor(){this.collapsed=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbCollapse",""]],hostVars:4,hostBindings:function(e,t){2&e&&i.Eb("collapse",!0)("show",!t.collapsed)},inputs:{collapsed:["ngbCollapse","collapsed"]},exportAs:["ngbCollapse"]}),e})(),Be=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e})();class Ue{constructor(e,t,n){this.year=Ne(e)?e:null,this.month=Ne(t)?t:null,this.day=Ne(n)?n:null}static from(e){return e instanceof Ue?e:e?new Ue(e.year,e.month,e.day):null}equals(e){return null!=e&&this.year===e.year&&this.month===e.month&&this.day===e.day}before(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day<e.day:this.month<e.month:this.year<e.year)}after(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day>e.day:this.month>e.month:this.year>e.year)}}function Ge(e){return new Ue(e.getFullYear(),e.getMonth()+1,e.getDate())}function qe(e){const t=new Date(e.year,e.month-1,e.day,12);return isNaN(t.getTime())||t.setFullYear(e.year),t}function Je(){return new Ke}let Qe=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:Je,token:e,providedIn:"root"}),e})(),Ke=(()=>{let e=class extends Qe{getDaysPerWeek(){return 7}getMonths(){return[1,2,3,4,5,6,7,8,9,10,11,12]}getWeeksPerMonth(){return 6}getNext(e,t="d",n=1){let i=qe(e),r=!0,s=i.getMonth();switch(t){case"y":i.setFullYear(i.getFullYear()+n);break;case"m":s+=n,i.setMonth(s),s%=12,s<0&&(s+=12);break;case"d":i.setDate(i.getDate()+n),r=!1;break;default:return e}return r&&i.getMonth()!==s&&i.setDate(0),Ge(i)}getPrev(e,t="d",n=1){return this.getNext(e,t,-n)}getWeekday(e){let t=qe(e).getDay();return 0===t?7:t}getWeekNumber(e,t){7===t&&(t=0);const n=qe(e[(11-t)%7]);n.setDate(n.getDate()+4-(n.getDay()||7));const i=n.getTime();return n.setMonth(0),n.setDate(1),Math.floor(Math.round((i-n.getTime())/864e5)/7)+1}getToday(){return Ge(new Date)}isValid(e){if(!(e&&Ne(e.year)&&Ne(e.month)&&Ne(e.day)))return!1;if(0===e.year)return!1;const t=qe(e);return!isNaN(t.getTime())&&t.getFullYear()===e.year&&t.getMonth()+1===e.month&&t.getDate()===e.day}};return e.\u0275fac=function(t){return Xn(t||e)},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();function Ze(e,t){return!function(e,t){return!e&&!t||!!e&&!!t&&e.equals(t)}(e,t)}function Xe(e,t){return!(!e&&!t||e&&t&&e.year===t.year&&e.month===t.month)}function et(e,t,n){return e&&t&&e.before(t)?t:e&&n&&e.after(n)?n:e||null}function tt(e,t){const{minDate:n,maxDate:i,disabled:r,markDisabled:s}=t;return!(null==e||r||s&&s(e,{year:e.year,month:e.month})||n&&e.before(n)||i&&e.after(i))}let nt=(()=>{let e=class{getDayNumerals(e){return""+e.day}getWeekNumerals(e){return""+e}getYearNumerals(e){return""+e}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return e=Object(i.dc)(i.v),new it(e);var e},token:e,providedIn:"root"}),e})(),it=(()=>{let e=class extends nt{constructor(e){super(),this._locale=e;const t=Object(r.F)(e,r.g.Standalone,r.B.Short);this._weekdaysShort=t.map((e,n)=>t[(n+1)%7]),this._monthsShort=Object(r.H)(e,r.g.Standalone,r.B.Abbreviated),this._monthsFull=Object(r.H)(e,r.g.Standalone,r.B.Wide)}getWeekdayShortName(e){return this._weekdaysShort[e-1]||""}getMonthShortName(e){return this._monthsShort[e-1]||""}getMonthFullName(e){return this._monthsFull[e-1]||""}getDayAriaLabel(e){const t=new Date(e.year,e.month-1,e.day);return Object(r.E)(t,"fullDate",this._locale)}};return e.\u0275fac=function(t){return new(t||e)(i.dc(i.v))},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),rt=(()=>{let e=class{constructor(e,t){this._calendar=e,this._i18n=t,this._VALIDATORS={dayTemplateData:e=>{if(this._state.dayTemplateData!==e)return{dayTemplateData:e}},displayMonths:e=>{if(Ne(e=Ae(e))&&e>0&&this._state.displayMonths!==e)return{displayMonths:e}},disabled:e=>{if(this._state.disabled!==e)return{disabled:e}},firstDayOfWeek:e=>{if(Ne(e=Ae(e))&&e>=0&&this._state.firstDayOfWeek!==e)return{firstDayOfWeek:e}},focusVisible:e=>{if(this._state.focusVisible!==e&&!this._state.disabled)return{focusVisible:e}},markDisabled:e=>{if(this._state.markDisabled!==e)return{markDisabled:e}},maxDate:e=>{const t=this.toValidDate(e,null);if(Ze(this._state.maxDate,t))return{maxDate:t}},minDate:e=>{const t=this.toValidDate(e,null);if(Ze(this._state.minDate,t))return{minDate:t}},navigation:e=>{if(this._state.navigation!==e)return{navigation:e}},outsideDays:e=>{if(this._state.outsideDays!==e)return{outsideDays:e}}},this._model$=new o.a,this._dateSelect$=new o.a,this._state={dayTemplateData:null,markDisabled:null,maxDate:null,minDate:null,disabled:!1,displayMonths:1,firstDate:null,firstDayOfWeek:1,lastDate:null,focusDate:null,focusVisible:!1,months:[],navigation:"select",outsideDays:"visible",prevDisabled:!1,nextDisabled:!1,selectedDate:null,selectBoxes:{years:[],months:[]}}}get model$(){return this._model$.pipe(Object(v.a)(e=>e.months.length>0))}get dateSelect$(){return this._dateSelect$.pipe(Object(v.a)(e=>null!==e))}set(e){let t=Object.keys(e).map(t=>this._VALIDATORS[t](e[t])).reduce((e,t)=>Object.assign(Object.assign({},e),t),{});Object.keys(t).length>0&&this._nextState(t)}focus(e){const t=this.toValidDate(e,null);null!=t&&!this._state.disabled&&Ze(this._state.focusDate,t)&&this._nextState({focusDate:e})}focusSelect(){tt(this._state.focusDate,this._state)&&this.select(this._state.focusDate,{emitEvent:!0})}open(e){const t=this.toValidDate(e,this._calendar.getToday());null==t||this._state.disabled||this._state.firstDate&&!Xe(this._state.firstDate,t)||this._nextState({firstDate:t})}select(e,t={}){const n=this.toValidDate(e,null);null==n||this._state.disabled||(Ze(this._state.selectedDate,n)&&this._nextState({selectedDate:n}),t.emitEvent&&tt(n,this._state)&&this._dateSelect$.next(n))}toValidDate(e,t){const n=Ue.from(e);return void 0===t&&(t=this._calendar.getToday()),this._calendar.isValid(n)?n:t}getMonth(e){for(let t of this._state.months)if(e.month===t.number&&e.year===t.year)return t;throw new Error(`month ${e.month} of year ${e.year} not found`)}_nextState(e){const t=this._updateState(e);this._patchContexts(t),this._state=t,this._model$.next(this._state)}_patchContexts(e){const{months:t,displayMonths:n,selectedDate:i,focusDate:r,focusVisible:s,disabled:o,outsideDays:a}=e;e.months.forEach(e=>{e.weeks.forEach(c=>{c.days.forEach(c=>{r&&(c.context.focused=r.equals(c.date)&&s),c.tabindex=!o&&r&&c.date.equals(r)&&r.month===e.number?0:-1,!0===o&&(c.context.disabled=!0),void 0!==i&&(c.context.selected=null!==i&&i.equals(c.date)),e.number!==c.date.month&&(c.hidden="hidden"===a||"collapsed"===a||n>1&&c.date.after(t[0].firstDate)&&c.date.before(t[n-1].lastDate))})})})}_updateState(e){const t=Object.assign({},this._state,e);let n=t.firstDate;if(("minDate"in e||"maxDate"in e)&&(function(e,t){if(t&&e&&t.before(e))throw new Error(`'maxDate' ${t} should be greater than 'minDate' ${e}`)}(t.minDate,t.maxDate),t.focusDate=et(t.focusDate,t.minDate,t.maxDate),t.firstDate=et(t.firstDate,t.minDate,t.maxDate),n=t.focusDate),"disabled"in e&&(t.focusVisible=!1),"selectedDate"in e&&0===this._state.months.length&&(n=t.selectedDate),"focusVisible"in e)return t;if("focusDate"in e&&(t.focusDate=et(t.focusDate,t.minDate,t.maxDate),n=t.focusDate,0!==t.months.length&&t.focusDate&&!t.focusDate.before(t.firstDate)&&!t.focusDate.after(t.lastDate)))return t;if("firstDate"in e&&(t.firstDate=et(t.firstDate,t.minDate,t.maxDate),n=t.firstDate),n){const i=function(e,t,n,i,r){const{displayMonths:s,months:o}=n,a=o.splice(0,o.length);return Array.from({length:s},(n,i)=>{const s=Object.assign(e.getNext(t,"m",i),{day:1});if(o[i]=null,!r){const e=a.findIndex(e=>e.firstDate.equals(s));-1!==e&&(o[i]=a.splice(e,1)[0])}return s}).forEach((t,r)=>{null===o[r]&&(o[r]=function(e,t,n,i,r={}){const{dayTemplateData:s,minDate:o,maxDate:a,firstDayOfWeek:c,markDisabled:l,outsideDays:u}=n,d=e.getToday();r.firstDate=null,r.lastDate=null,r.number=t.month,r.year=t.year,r.weeks=r.weeks||[],r.weekdays=r.weekdays||[],t=function(e,t,n){const i=e.getDaysPerWeek(),r=new Ue(t.year,t.month,1),s=e.getWeekday(r)%i;return e.getPrev(r,"d",(i+s-n)%i)}(e,t,c);for(let h=0;h<e.getWeeksPerMonth();h++){let n=r.weeks[h];n||(n=r.weeks[h]={number:0,days:[],collapsed:!0});const f=n.days;for(let c=0;c<e.getDaysPerWeek();c++){0===h&&(r.weekdays[c]=e.getWeekday(t));const n=new Ue(t.year,t.month,t.day),u=e.getNext(n),p=i.getDayAriaLabel(n);let m=!!(o&&n.before(o)||a&&n.after(a));!m&&l&&(m=l(n,{month:r.number,year:r.year}));let b=n.equals(d),g=s?s(n,{month:r.number,year:r.year}):void 0;null===r.firstDate&&n.month===r.number&&(r.firstDate=n),n.month===r.number&&u.month!==r.number&&(r.lastDate=n);let _=f[c];_||(_=f[c]={}),_.date=n,_.context=Object.assign(_.context||{},{$implicit:n,date:n,data:g,currentMonth:r.number,currentYear:r.year,disabled:m,focused:!1,selected:!1,today:b}),_.tabindex=-1,_.ariaLabel=p,_.hidden=!1,t=u}n.number=e.getWeekNumber(f.map(e=>e.date),c),n.collapsed="collapsed"===u&&f[0].date.month!==r.number&&f[f.length-1].date.month!==r.number}return r}(e,t,n,i,a.shift()||{}))}),o}(this._calendar,n,t,this._i18n,"dayTemplateData"in e||"firstDayOfWeek"in e||"markDisabled"in e||"minDate"in e||"maxDate"in e||"disabled"in e||"outsideDays"in e);t.months=i,t.firstDate=i[0].firstDate,t.lastDate=i[i.length-1].lastDate,"selectedDate"in e&&!tt(t.selectedDate,t)&&(t.selectedDate=null),"firstDate"in e&&(!t.focusDate||t.focusDate.before(t.firstDate)||t.focusDate.after(t.lastDate))&&(t.focusDate=n);const r=!this._state.firstDate||this._state.firstDate.year!==t.firstDate.year,s=!this._state.firstDate||this._state.firstDate.month!==t.firstDate.month;"select"===t.navigation?(("minDate"in e||"maxDate"in e||0===t.selectBoxes.years.length||r)&&(t.selectBoxes.years=function(e,t,n){if(!e)return[];const i=t?Math.max(t.year,e.year-500):e.year-10,r=(n?Math.min(n.year,e.year+500):e.year+10)-i+1,s=Array(r);for(let o=0;o<r;o++)s[o]=i+o;return s}(t.firstDate,t.minDate,t.maxDate)),("minDate"in e||"maxDate"in e||0===t.selectBoxes.months.length||r)&&(t.selectBoxes.months=function(e,t,n,i){if(!t)return[];let r=e.getMonths(t.year);if(n&&t.year===n.year){const e=r.findIndex(e=>e===n.month);r=r.slice(e)}if(i&&t.year===i.year){const e=r.findIndex(e=>e===i.month);r=r.slice(0,e+1)}return r}(this._calendar,t.firstDate,t.minDate,t.maxDate))):t.selectBoxes={years:[],months:[]},"arrows"!==t.navigation&&"select"!==t.navigation||!(s||r||"minDate"in e||"maxDate"in e||"disabled"in e)||(t.prevDisabled=t.disabled||function(e,t,n){const i=Object.assign(e.getPrev(t,"m"),{day:1});return null!=n&&(i.year===n.year&&i.month<n.month||i.year<n.year&&1===n.month)}(this._calendar,t.firstDate,t.minDate),t.nextDisabled=t.disabled||function(e,t,n){const i=Object.assign(e.getNext(t,"m"),{day:1});return null!=n&&i.after(n)}(this._calendar,t.lastDate,t.maxDate))}return t}};return e.\u0275fac=function(t){return new(t||e)(i.dc(Qe),i.dc(nt))},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();var st=function(e){return e[e.PREV=0]="PREV",e[e.NEXT=1]="NEXT",e}({});let ot=(()=>{let e=class{constructor(){this.displayMonths=1,this.firstDayOfWeek=1,this.navigation="select",this.outsideDays="visible",this.showWeekdays=!0,this.showWeekNumbers=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function at(){return new lt}let ct=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:at,token:e,providedIn:"root"}),e})(),lt=(()=>{let e=class extends ct{fromModel(e){return e&&Ne(e.year)&&Ne(e.month)&&Ne(e.day)?{year:e.year,month:e.month,day:e.day}:null}toModel(e){return e&&Ne(e.year)&&Ne(e.month)&&Ne(e.day)?{year:e.year,month:e.month,day:e.day}:null}};return e.\u0275fac=function(t){return ei(t||e)},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();const ut={provide:s.o,useExisting:Object(i.T)(()=>ht),multi:!0};let dt=(()=>{let e=class{constructor(e){this.templateRef=e}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["ng-template","ngbDatepickerContent",""]]}),e})(),ht=(()=>{let e=class{constructor(e,t,n,r,s,a,c,l){this._service=e,this._calendar=t,this.i18n=n,this._elementRef=a,this._ngbDateAdapter=c,this._ngZone=l,this._controlValue=null,this._destroyed$=new o.a,this._publicState={},this.navigate=new i.o,this.dateSelect=new i.o,this.select=this.dateSelect,this.onChange=e=>{},this.onTouched=()=>{},["dayTemplate","dayTemplateData","displayMonths","firstDayOfWeek","footerTemplate","markDisabled","minDate","maxDate","navigation","outsideDays","showWeekdays","showWeekNumbers","startDate"].forEach(e=>this[e]=r[e]),e.dateSelect$.pipe(Object(y.a)(this._destroyed$)).subscribe(e=>{this.dateSelect.emit(e)}),e.model$.pipe(Object(y.a)(this._destroyed$)).subscribe(e=>{const t=e.firstDate,n=this.model?this.model.firstDate:null;this._publicState={maxDate:e.maxDate,minDate:e.minDate,firstDate:e.firstDate,lastDate:e.lastDate,focusedDate:e.focusDate,months:e.months.map(e=>e.firstDate)};let i=!1;if(!t.equals(n)&&(this.navigate.emit({current:n?{year:n.year,month:n.month}:null,next:{year:t.year,month:t.month},preventDefault:()=>i=!0}),i&&null!==n))return void this._service.open(n);const r=e.selectedDate,o=e.focusDate,a=this.model?this.model.focusDate:null;this.model=e,Ze(r,this._controlValue)&&(this._controlValue=r,this.onTouched(),this.onChange(this._ngbDateAdapter.toModel(r))),Ze(o,a)&&a&&e.focusVisible&&this.focus(),s.markForCheck()})}get state(){return this._publicState}get calendar(){return this._calendar}focusDate(e){this._service.focus(Ue.from(e))}focusSelect(){this._service.focusSelect()}focus(){this._ngZone.onStable.asObservable().pipe(Object(w.a)(1)).subscribe(()=>{const e=this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');e&&e.focus()})}navigateTo(e){this._service.open(Ue.from(e?e.day?e:Object.assign(Object.assign({},e),{day:1}):null))}ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{const e=Object(c.a)(this._contentEl.nativeElement,"focusin"),t=Object(c.a)(this._contentEl.nativeElement,"focusout"),{nativeElement:n}=this._elementRef;Object(l.a)(e,t).pipe(Object(v.a)(({target:e,relatedTarget:t})=>!(ze(e,"ngb-dp-day")&&ze(t,"ngb-dp-day")&&n.contains(e)&&n.contains(t))),Object(y.a)(this._destroyed$)).subscribe(({type:e})=>this._ngZone.run(()=>this._service.set({focusVisible:"focusin"===e})))})}ngOnDestroy(){this._destroyed$.next()}ngOnInit(){if(void 0===this.model){const e={};["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].forEach(t=>e[t]=this[t]),this._service.set(e),this.navigateTo(this.startDate)}this.dayTemplate||(this.dayTemplate=this._defaultDayTemplate)}ngOnChanges(e){const t={};if(["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].filter(t=>t in e).forEach(e=>t[e]=this[e]),this._service.set(t),"startDate"in e){const{currentValue:t,previousValue:n}=e.startDate;Xe(n,t)&&this.navigateTo(this.startDate)}}onDateSelect(e){this._service.focus(e),this._service.select(e,{emitEvent:!0})}onNavigateDateSelect(e){this._service.open(e)}onNavigateEvent(e){switch(e){case st.PREV:this._service.open(this._calendar.getPrev(this.model.firstDate,"m",1));break;case st.NEXT:this._service.open(this._calendar.getNext(this.model.firstDate,"m",1))}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._service.set({disabled:e})}writeValue(e){this._controlValue=Ue.from(this._ngbDateAdapter.fromModel(e)),this._service.select(this._controlValue)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(rt),i.Mb(Qe),i.Mb(nt),i.Mb(ot),i.Mb(i.h),i.Mb(i.m),i.Mb(ct),i.Mb(i.A))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-datepicker"]],contentQueries:function(e,t,n){var r;1&e&&i.Ic(n,dt,!0),2&e&&i.zc(r=i.hc())&&(t.contentTemplate=r.first)},viewQuery:function(e,t){var n;1&e&&(i.Jc(R,!0),i.Jc(L,!0)),2&e&&(i.zc(n=i.hc())&&(t._defaultDayTemplate=n.first),i.zc(n=i.hc())&&(t._contentEl=n.first))},inputs:{dayTemplate:"dayTemplate",dayTemplateData:"dayTemplateData",displayMonths:"displayMonths",firstDayOfWeek:"firstDayOfWeek",footerTemplate:"footerTemplate",markDisabled:"markDisabled",maxDate:"maxDate",minDate:"minDate",navigation:"navigation",outsideDays:"outsideDays",showWeekdays:"showWeekdays",showWeekNumbers:"showWeekNumbers",startDate:"startDate"},outputs:{navigate:"navigate",dateSelect:"dateSelect",select:"select"},exportAs:["ngbDatepicker"],features:[i.xb([ut,rt]),i.wb],decls:10,vars:5,consts:[["defaultDayTemplate",""],["defaultContentTemplate",""],[1,"ngb-dp-header"],[3,"date","months","disabled","showSelect","prevDisabled","nextDisabled","selectBoxes","navigate","select",4,"ngIf"],[1,"ngb-dp-content"],["content",""],[3,"ngTemplateOutlet"],["ngbDatepickerDayView","",3,"date","currentMonth","selected","disabled","focused"],["class","ngb-dp-month",4,"ngFor","ngForOf"],[1,"ngb-dp-month"],["class","ngb-dp-month-name",4,"ngIf"],[3,"month"],[1,"ngb-dp-month-name"],[3,"date","months","disabled","showSelect","prevDisabled","nextDisabled","selectBoxes","navigate","select"]],template:function(e,t){if(1&e&&(i.Mc(0,E,1,5,"ng-template",null,0,i.Nc),i.Mc(2,P,1,1,"ng-template",null,1,i.Nc),i.Sb(4,"div",2),i.Mc(5,j,1,7,"ngb-datepicker-navigation",3),i.Rb(),i.Sb(6,"div",4,5),i.Mc(8,N,0,0,"ng-template",6),i.Rb(),i.Mc(9,F,0,0,"ng-template",6)),2&e){const e=i.Ac(3);i.yb(5),i.pc("ngIf","none"!==t.navigation),i.yb(1),i.Eb("ngb-dp-months",!t.contentTemplate),i.yb(2),i.pc("ngTemplateOutlet",(null==t.contentTemplate?null:t.contentTemplate.templateRef)||e),i.yb(1),i.pc("ngTemplateOutlet",t.footerTemplate)}},directives:function(){return[r.r,r.w,Pt,r.q,mt,bt]},styles:["ngb-datepicker{border:1px solid #dfdfdf;border-radius:.25rem;display:inline-block}ngb-datepicker-month{pointer-events:auto}ngb-datepicker.dropdown-menu{padding:0}.ngb-dp-body{z-index:1050}.ngb-dp-header{border-bottom:0;border-radius:.25rem .25rem 0 0;padding-top:.25rem;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-months{display:-ms-flexbox;display:flex}.ngb-dp-month{pointer-events:none}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,.ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-left:1rem}.ngb-dp-month:last-child .ngb-dp-week{padding-right:.25rem}.ngb-dp-month:first-child .ngb-dp-week{padding-left:.25rem}.ngb-dp-month .ngb-dp-week:last-child{padding-bottom:.25rem}"],encapsulation:2,changeDetection:0}),e})();var ft=function(e){return e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Escape=27]="Escape",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.ArrowLeft=37]="ArrowLeft",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowRight=39]="ArrowRight",e[e.ArrowDown=40]="ArrowDown",e}({});let pt=(()=>{let e=class{processKey(e,t){const{state:n,calendar:i}=t;switch(e.which){case ft.PageUp:t.focusDate(i.getPrev(n.focusedDate,e.shiftKey?"y":"m",1));break;case ft.PageDown:t.focusDate(i.getNext(n.focusedDate,e.shiftKey?"y":"m",1));break;case ft.End:t.focusDate(e.shiftKey?n.maxDate:n.lastDate);break;case ft.Home:t.focusDate(e.shiftKey?n.minDate:n.firstDate);break;case ft.ArrowLeft:t.focusDate(i.getPrev(n.focusedDate,"d",1));break;case ft.ArrowUp:t.focusDate(i.getPrev(n.focusedDate,"d",i.getDaysPerWeek()));break;case ft.ArrowRight:t.focusDate(i.getNext(n.focusedDate,"d",1));break;case ft.ArrowDown:t.focusDate(i.getNext(n.focusedDate,"d",i.getDaysPerWeek()));break;case ft.Enter:case ft.Space:t.focusSelect();break;default:return}e.preventDefault(),e.stopPropagation()}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),mt=(()=>{let e=class{constructor(e,t,n,i){this.i18n=e,this.datepicker=t,this._keyboardService=n,this._service=i}set month(e){this.viewModel=this._service.getMonth(e)}onKeyDown(e){this._keyboardService.processKey(e,this.datepicker)}doSelect(e){e.context.disabled||e.hidden||this.datepicker.onDateSelect(e.date)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(nt),i.Mb(ht),i.Mb(pt),i.Mb(rt))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-datepicker-month"]],hostAttrs:["role","grid"],hostBindings:function(e,t){1&e&&i.gc("keydown",(function(e){return t.onKeyDown(e)}))},inputs:{month:"month"},decls:2,vars:2,consts:[["class","ngb-dp-week ngb-dp-weekdays","role","row",4,"ngIf"],["ngFor","",3,"ngForOf"],["role","row",1,"ngb-dp-week","ngb-dp-weekdays"],["class","ngb-dp-weekday ngb-dp-showweek",4,"ngIf"],["class","ngb-dp-weekday small","role","columnheader",4,"ngFor","ngForOf"],[1,"ngb-dp-weekday","ngb-dp-showweek"],["role","columnheader",1,"ngb-dp-weekday","small"],["class","ngb-dp-week","role","row",4,"ngIf"],["role","row",1,"ngb-dp-week"],["class","ngb-dp-week-number small text-muted",4,"ngIf"],["class","ngb-dp-day","role","gridcell",3,"disabled","tabindex","hidden","ngb-dp-today","click",4,"ngFor","ngForOf"],[1,"ngb-dp-week-number","small","text-muted"],["role","gridcell",1,"ngb-dp-day",3,"tabindex","click"],[3,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Mc(0,$,3,2,"div",0),i.Mc(1,G,1,1,"ng-template",1)),2&e&&(i.pc("ngIf",t.datepicker.showWeekdays),i.yb(1),i.pc("ngForOf",t.viewModel.weeks))},directives:[r.r,r.q,r.w],styles:['ngb-datepicker-month{display:block}.ngb-dp-week-number,.ngb-dp-weekday{line-height:2rem;text-align:center;font-style:italic}.ngb-dp-weekday{color:#5bc0de;color:var(--info)}.ngb-dp-week{border-radius:.25rem;display:-ms-flexbox;display:flex}.ngb-dp-weekdays{border-bottom:1px solid rgba(0,0,0,.125);border-radius:0;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-day,.ngb-dp-week-number,.ngb-dp-weekday{width:2rem;height:2rem}.ngb-dp-day{cursor:pointer}.ngb-dp-day.disabled,.ngb-dp-day.hidden{cursor:default;pointer-events:none}.ngb-dp-day[tabindex="0"]{z-index:1}'],encapsulation:2}),e})(),bt=(()=>{let e=class{constructor(e){this.i18n=e,this.navigation=st,this.months=[],this.navigate=new i.o,this.select=new i.o}onClickPrev(e){e.currentTarget.focus(),this.navigate.emit(this.navigation.PREV)}onClickNext(e){e.currentTarget.focus(),this.navigate.emit(this.navigation.NEXT)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(nt))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-datepicker-navigation"]],inputs:{months:"months",date:"date",disabled:"disabled",showSelect:"showSelect",prevDisabled:"prevDisabled",nextDisabled:"nextDisabled",selectBoxes:"selectBoxes"},outputs:{navigate:"navigate",select:"select"},decls:10,vars:4,consts:function(){return[[1,"ngb-dp-arrow"],["type","button",1,"btn","btn-link","ngb-dp-arrow-btn",3,"disabled","click",6,"aria-label","title"],["aria-label","Previous month","title","Previous month"],[1,"ngb-dp-navigation-chevron"],["class","ngb-dp-navigation-select",3,"date","disabled","months","years","select",4,"ngIf"],[4,"ngIf"],[1,"ngb-dp-arrow","right"],["aria-label","Next month","title","Next month"],[1,"ngb-dp-navigation-select",3,"date","disabled","months","years","select"],["ngFor","",3,"ngForOf"],["class","ngb-dp-arrow",4,"ngIf"],[1,"ngb-dp-month-name"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"button",1),i.Yb(2,2),i.gc("click",(function(e){return t.onClickPrev(e)})),i.Nb(3,"span",3),i.Rb(),i.Rb(),i.Mc(4,q,1,4,"ngb-datepicker-navigation-select",4),i.Mc(5,Z,1,1,void 0,5),i.Sb(6,"div",6),i.Sb(7,"button",1),i.Yb(8,7),i.gc("click",(function(e){return t.onClickNext(e)})),i.Nb(9,"span",3),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.pc("disabled",t.prevDisabled),i.yb(3),i.pc("ngIf",t.showSelect),i.yb(1),i.pc("ngIf",!t.showSelect),i.yb(2),i.pc("disabled",t.nextDisabled))},directives:function(){return[r.r,jt,r.q]},styles:["ngb-datepicker-navigation{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-dp-navigation-chevron{border-style:solid;border-width:.2em .2em 0 0;display:inline-block;width:.75em;height:.75em;margin-left:.25em;margin-right:.15em;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.right .ngb-dp-navigation-chevron{-webkit-transform:rotate(45deg);transform:rotate(45deg);margin-left:.15em;margin-right:.25em}.ngb-dp-arrow{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;padding-right:0;padding-left:0;margin:0;width:2rem;height:2rem}.ngb-dp-arrow.right{-ms-flex-pack:end;justify-content:flex-end}.ngb-dp-arrow-btn{padding:0 .25rem;margin:0 .5rem;border:none;background-color:transparent;z-index:1}.ngb-dp-arrow-btn:focus{outline-width:1px;outline-style:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.ngb-dp-arrow-btn:focus{outline-style:solid}}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-navigation-select{display:-ms-flexbox;display:flex;-ms-flex:1 1 9rem;flex:1 1 9rem}"],encapsulation:2,changeDetection:0}),e})();const gt=(e,t)=>!!t&&t.some(t=>t.contains(e)),_t=(e,t)=>!t||null!=function(e,t){return t?void 0===e.closest?null:e.closest(t):null}(e,t),yt=(()=>"undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent)))();function vt(e,t,n,i,r,s,o,a){var l;n&&e.runOutsideAngular((l=()=>{const l=Object(c.a)(t,"keydown").pipe(Object(y.a)(r),Object(v.a)(e=>e.which===ft.Escape),Object(S.a)(e=>e.preventDefault())),h=Object(c.a)(t,"mousedown").pipe(Object(g.a)(e=>{const t=e.target;return 2!==e.button&&!gt(t,o)&&("inside"===n?gt(t,s)&&_t(t,a):"outside"===n?!gt(t,s):_t(t,a)||!gt(t,s))}),Object(y.a)(r)),f=Object(c.a)(t,"mouseup").pipe(M(h),Object(v.a)(([e,t])=>t),Object(D.a)(0),Object(y.a)(r));(function(...e){if(1===e.length){if(!Object(u.a)(e[0]))return e[0];e=e[0]}return Object(d.a)(e,void 0).lift(new p)})([l.pipe(Object(g.a)(e=>0)),f.pipe(Object(g.a)(e=>1))]).subscribe(t=>e.run(()=>i(t)))},yt?()=>setTimeout(()=>l(),100):l))}const wt=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function St(e){const t=Array.from(e.querySelectorAll(wt)).filter(e=>-1!==e.tabIndex);return[t[0],t[t.length-1]]}const Mt=(e,t,n,i=!1)=>{e.runOutsideAngular(()=>{const e=Object(c.a)(t,"focusin").pipe(Object(y.a)(n),Object(g.a)(e=>e.target));Object(c.a)(t,"keydown").pipe(Object(y.a)(n),Object(v.a)(e=>e.which===ft.Tab),M(e)).subscribe(([e,n])=>{const[i,r]=St(t);n!==i&&n!==t||!e.shiftKey||(r.focus(),e.preventDefault()),n!==r||e.shiftKey||(i.focus(),e.preventDefault())}),i&&Object(c.a)(t,"click").pipe(Object(y.a)(n),M(e),Object(g.a)(e=>e[1])).subscribe(e=>e.focus())})};class xt{getAllStyles(e){return window.getComputedStyle(e)}getStyle(e,t){return this.getAllStyles(e)[t]}isStaticPositioned(e){return"static"===(this.getStyle(e,"position")||"static")}offsetParent(e){let t=e.offsetParent||document.documentElement;for(;t&&t!==document.documentElement&&this.isStaticPositioned(t);)t=t.offsetParent;return t||document.documentElement}position(e,t=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(e,"position"))n=e.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const t=this.offsetParent(e);n=this.offset(e,!1),t!==document.documentElement&&(i=this.offset(t,!1)),i.top+=t.clientTop,i.left+=t.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,t&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(e,t=!0){const n=e.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||e.offsetHeight,width:n.width||e.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return t&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(e,t,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(e,!1):this.position(e,!1),a=this.getAllStyles(t),c=parseFloat(a.marginTop),l=parseFloat(a.marginBottom),u=parseFloat(a.marginLeft),d=parseFloat(a.marginRight);let h=0,f=0;switch(r){case"top":h=o.top-(t.offsetHeight+c+l);break;case"bottom":h=o.top+o.height;break;case"left":f=o.left-(t.offsetWidth+u+d);break;case"right":f=o.left+o.width}switch(s){case"top":h=o.top;break;case"bottom":h=o.top+o.height-t.offsetHeight;break;case"left":f=o.left;break;case"right":f=o.left+o.width-t.offsetWidth;break;case"center":"top"===r||"bottom"===r?f=o.left+o.width/2-t.offsetWidth/2:h=o.top+o.height/2-t.offsetHeight/2}t.style.transform=`translate(${Math.round(f)}px, ${Math.round(h)}px)`;const p=t.getBoundingClientRect(),m=document.documentElement,b=window.innerHeight||m.clientHeight,g=window.innerWidth||m.clientWidth;return p.left>=0&&p.top>=0&&p.right<=g&&p.bottom<=b}}const kt=/\s+/,Dt=new xt;function Tt(e,t,n,i,r){let s=Array.isArray(n)?n:n.split(kt);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=t.classList,c=e=>{const[t,n]=e.split("-"),i=[];return r&&(i.push(`${r}-${t}`),n&&i.push(`${r}-${t}-${n}`),i.forEach(e=>{a.add(e)})),i};r&&o.forEach(e=>{a.remove(`${r}-${e}`)});let l=s.findIndex(e=>"auto"===e);l>=0&&o.forEach((function(e){null==s.find(t=>-1!==t.search("^"+e))&&s.splice(l++,1,e)}));const u=t.style;u.position="absolute",u.top="0",u.left="0",u["will-change"]="transform";let d=null,h=!1;for(d of s){let n=c(d);if(Dt.positionElements(e,t,d,i)){h=!0;break}r&&n.forEach(e=>{a.remove(e)})}return h||(d=s[0],c(d),Dt.positionElements(e,t,d,i)),d}function Ct(){return new Rt}let Ot=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:Ct,token:e,providedIn:"root"}),e})(),Rt=(()=>{let e=class extends Ot{parse(e){if(null!=e){const t=e.trim().split("-");if(1===t.length&&je(t[0]))return{year:Ae(t[0]),month:null,day:null};if(2===t.length&&je(t[0])&&je(t[1]))return{year:Ae(t[0]),month:Ae(t[1]),day:null};if(3===t.length&&je(t[0])&&je(t[1])&&je(t[2]))return{year:Ae(t[0]),month:Ae(t[1]),day:Ae(t[2])}}return null}format(e){return e?`${e.year}-${je(e.month)?Ye(e.month):""}-${je(e.day)?Ye(e.day):""}`:""}};return e.\u0275fac=function(t){return ti(t||e)},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),Lt=(()=>{let e=class extends ot{constructor(){super(...arguments),this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"],this.restoreFocus=!0}};return e.\u0275fac=function(t){return ni(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const Et={provide:s.o,useExisting:Object(i.T)(()=>It),multi:!0},At={provide:s.n,useExisting:Object(i.T)(()=>It),multi:!0};let It=(()=>{let e=class{constructor(e,t,n,r,s,o,a,c,l,u,d){this._parserFormatter=e,this._elRef=t,this._vcRef=n,this._renderer=r,this._cfr=s,this._ngZone=o,this._calendar=a,this._dateAdapter=c,this._document=l,this._changeDetector=u,this._cRef=null,this._disabled=!1,this._elWithFocus=null,this._model=null,this.dateSelect=new i.o,this.navigate=new i.o,this.closed=new i.o,this._onChange=e=>{},this._onTouched=()=>{},this._validatorChange=()=>{},["autoClose","container","positionTarget","placement"].forEach(e=>this[e]=d[e]),this._zoneSubscription=o.onStable.subscribe(()=>this._updatePopupPosition())}get disabled(){return this._disabled}set disabled(e){this._disabled=""===e||e&&"false"!==e,this.isOpen()&&this._cRef.instance.setDisabledState(this._disabled)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}registerOnValidatorChange(e){this._validatorChange=e}setDisabledState(e){this.disabled=e}validate(e){const{value:t}=e;if(null!=t){const e=this._fromDateStruct(this._dateAdapter.fromModel(t));if(!e)return{ngbDate:{invalid:t}};if(this.minDate&&e.before(Ue.from(this.minDate)))return{ngbDate:{minDate:{minDate:this.minDate,actual:t}}};if(this.maxDate&&e.after(Ue.from(this.maxDate)))return{ngbDate:{maxDate:{maxDate:this.maxDate,actual:t}}}}return null}writeValue(e){this._model=this._fromDateStruct(this._dateAdapter.fromModel(e)),this._writeModelValue(this._model)}manualDateChange(e,t=!1){const n=e!==this._inputValue;n&&(this._inputValue=e,this._model=this._fromDateStruct(this._parserFormatter.parse(e))),!n&&t||this._onChange(this._model?this._dateAdapter.toModel(this._model):""===e?null:e),t&&this._model&&this._writeModelValue(this._model)}isOpen(){return!!this._cRef}open(){if(!this.isOpen()){const e=this._cfr.resolveComponentFactory(ht);this._cRef=this._vcRef.createComponent(e),this._applyPopupStyling(this._cRef.location.nativeElement),this._applyDatepickerInputs(this._cRef.instance),this._subscribeForDatepickerOutputs(this._cRef.instance),this._cRef.instance.ngOnInit(),this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model)),this._cRef.instance.registerOnChange(e=>{this.writeValue(e),this._onChange(e),this._onTouched()}),this._cRef.changeDetectorRef.detectChanges(),this._cRef.instance.setDisabledState(this.disabled),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._cRef.location.nativeElement),this._elWithFocus=this._document.activeElement,Mt(this._ngZone,this._cRef.location.nativeElement,this.closed,!0),this._cRef.instance.focus(),vt(this._ngZone,this._document,this.autoClose,()=>this.close(),this.closed,[],[this._elRef.nativeElement,this._cRef.location.nativeElement])}}close(){if(this.isOpen()){this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView)),this._cRef=null,this.closed.emit(),this._changeDetector.markForCheck();let e=this._elWithFocus;Pe(this.restoreFocus)?e=this._document.querySelector(this.restoreFocus):void 0!==this.restoreFocus&&(e=this.restoreFocus),e&&e.focus?e.focus():this._document.body.focus()}}toggle(){this.isOpen()?this.close():this.open()}navigateTo(e){this.isOpen()&&this._cRef.instance.navigateTo(e)}onBlur(){this._onTouched()}onFocus(){this._elWithFocus=this._elRef.nativeElement}ngOnChanges(e){(e.minDate||e.maxDate)&&(this._validatorChange(),this.isOpen()&&(e.minDate&&(this._cRef.instance.minDate=this.minDate),e.maxDate&&(this._cRef.instance.maxDate=this.maxDate),this._cRef.instance.ngOnChanges(e)))}ngOnDestroy(){this.close(),this._zoneSubscription.unsubscribe()}_applyDatepickerInputs(e){["dayTemplate","dayTemplateData","displayMonths","firstDayOfWeek","footerTemplate","markDisabled","minDate","maxDate","navigation","outsideDays","showNavigation","showWeekdays","showWeekNumbers"].forEach(t=>{void 0!==this[t]&&(e[t]=this[t])}),e.startDate=this.startDate||this._model}_applyPopupStyling(e){this._renderer.addClass(e,"dropdown-menu"),this._renderer.addClass(e,"show"),"body"===this.container&&this._renderer.addClass(e,"ngb-dp-body")}_subscribeForDatepickerOutputs(e){e.navigate.subscribe(e=>this.navigate.emit(e)),e.dateSelect.subscribe(e=>{this.dateSelect.emit(e),!0!==this.autoClose&&"inside"!==this.autoClose||this.close()})}_writeModelValue(e){const t=this._parserFormatter.format(e);this._inputValue=t,this._renderer.setProperty(this._elRef.nativeElement,"value",t),this.isOpen()&&(this._cRef.instance.writeValue(this._dateAdapter.toModel(e)),this._onTouched())}_fromDateStruct(e){const t=e?new Ue(e.year,e.month,e.day):null;return this._calendar.isValid(t)?t:null}_updatePopupPosition(){if(!this._cRef)return;let e;if(e=Pe(this.positionTarget)?this._document.querySelector(this.positionTarget):this.positionTarget instanceof HTMLElement?this.positionTarget:this._elRef.nativeElement,this.positionTarget&&!e)throw new Error("ngbDatepicker could not find element declared in [positionTarget] to position against.");Tt(e,this._cRef.location.nativeElement,this.placement,"body"===this.container)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Ot),i.Mb(i.m),i.Mb(i.P),i.Mb(i.E),i.Mb(i.j),i.Mb(i.A),i.Mb(Qe),i.Mb(ct),i.Mb(r.d),i.Mb(i.h),i.Mb(Lt))},e.\u0275dir=i.Hb({type:e,selectors:[["input","ngbDatepicker",""]],hostVars:1,hostBindings:function(e,t){1&e&&i.gc("input",(function(e){return t.manualDateChange(e.target.value)}))("change",(function(e){return t.manualDateChange(e.target.value,!0)}))("focus",(function(){return t.onFocus()}))("blur",(function(){return t.onBlur()})),2&e&&i.Vb("disabled",t.disabled)},inputs:{disabled:"disabled",autoClose:"autoClose",dayTemplate:"dayTemplate",dayTemplateData:"dayTemplateData",displayMonths:"displayMonths",firstDayOfWeek:"firstDayOfWeek",footerTemplate:"footerTemplate",markDisabled:"markDisabled",minDate:"minDate",maxDate:"maxDate",navigation:"navigation",outsideDays:"outsideDays",placement:"placement",restoreFocus:"restoreFocus",showWeekdays:"showWeekdays",showWeekNumbers:"showWeekNumbers",startDate:"startDate",container:"container",positionTarget:"positionTarget"},outputs:{dateSelect:"dateSelect",navigate:"navigate",closed:"closed"},exportAs:["ngbDatepicker"],features:[i.xb([Et,At,{provide:ot,useExisting:Lt}]),i.wb]}),e})(),Pt=(()=>{let e=class{constructor(e){this.i18n=e}isMuted(){return!this.selected&&(this.date.month!==this.currentMonth||this.disabled)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(nt))},e.\u0275cmp=i.Gb({type:e,selectors:[["","ngbDatepickerDayView",""]],hostAttrs:[1,"btn-light"],hostVars:10,hostBindings:function(e,t){2&e&&i.Eb("bg-primary",t.selected)("text-white",t.selected)("text-muted",t.isMuted())("outside",t.isMuted())("active",t.focused)},inputs:{currentMonth:"currentMonth",date:"date",disabled:"disabled",focused:"focused",selected:"selected"},attrs:X,decls:1,vars:1,template:function(e,t){1&e&&i.Oc(0),2&e&&i.Pc(t.i18n.getDayNumerals(t.date))},styles:["[ngbDatepickerDayView]{text-align:center;width:2rem;height:2rem;line-height:2rem;border-radius:.25rem;background:0 0}[ngbDatepickerDayView].outside{opacity:.5}"],encapsulation:2,changeDetection:0}),e})(),jt=(()=>{let e=class{constructor(e,t){this.i18n=e,this._renderer=t,this.select=new i.o,this._month=-1,this._year=-1}changeMonth(e){this.select.emit(new Ue(this.date.year,Ae(e),1))}changeYear(e){this.select.emit(new Ue(Ae(e),this.date.month,1))}ngAfterViewChecked(){this.date&&(this.date.month!==this._month&&(this._month=this.date.month,this._renderer.setProperty(this.monthSelect.nativeElement,"value",this._month)),this.date.year!==this._year&&(this._year=this.date.year,this._renderer.setProperty(this.yearSelect.nativeElement,"value",this._year)))}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(nt),i.Mb(i.E))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-datepicker-navigation-select"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(ee,!0,i.m),i.Jc(te,!0,i.m)),2&e&&(i.zc(n=i.hc())&&(t.monthSelect=n.first),i.zc(n=i.hc())&&(t.yearSelect=n.first))},inputs:{date:"date",disabled:"disabled",months:"months",years:"years"},outputs:{select:"select"},decls:8,vars:4,consts:function(){return[[1,"custom-select",3,"disabled","change",6,"aria-label","title"],["month",""],["aria-label","Select month","title","Select month"],[3,"value",4,"ngFor","ngForOf"],["year",""],["aria-label","Select year","title","Select year"],[3,"value"]]},template:function(e,t){1&e&&(i.Sb(0,"select",0,1),i.Yb(2,2),i.gc("change",(function(e){return t.changeMonth(e.target.value)})),i.Mc(3,ne,2,3,"option",3),i.Rb(),i.Sb(4,"select",0,4),i.Yb(6,5),i.gc("change",(function(e){return t.changeYear(e.target.value)})),i.Mc(7,ie,2,2,"option",3),i.Rb()),2&e&&(i.pc("disabled",t.disabled),i.yb(3),i.pc("ngForOf",t.months),i.yb(1),i.pc("disabled",t.disabled),i.yb(3),i.pc("ngForOf",t.years))},directives:[r.q,s.u,s.B],styles:["ngb-datepicker-navigation-select>.custom-select{-ms-flex:1 1 auto;flex:1 1 auto;padding:0 .5rem;font-size:.875rem;height:1.85rem}ngb-datepicker-navigation-select>.custom-select:focus{z-index:1}ngb-datepicker-navigation-select>.custom-select::-ms-value{background-color:transparent!important}"],encapsulation:2,changeDetection:0}),e})(),Nt=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c,s.m]]}),e})(),Ft=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();var Yt;let zt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["",8,"navbar"]]}),e})(),$t=(()=>{let e=class{constructor(e){this.elementRef=e,this._disabled=!1}set disabled(e){this._disabled=""===e||!0===e}get disabled(){return this._disabled}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("disabled",t.disabled)},inputs:{disabled:"disabled"}}),e})(),Ht=(()=>{let e=class{constructor(e,t){this.dropdown=e,this.placement="bottom",this.isOpen=!1,this.nativeElement=t.nativeElement}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Object(i.T)(()=>Bt)),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(e,t,n){var r;1&e&&i.Fb(n,$t,!1),2&e&&i.zc(r=i.hc())&&(t.menuItems=r)},hostVars:5,hostBindings:function(e,t){1&e&&i.gc("keydown.ArrowUp",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.ArrowDown",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Home",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.End",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Enter",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Space",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Tab",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Shift.Tab",(function(e){return t.dropdown.onKeyDown(e)})),2&e&&(i.zb("x-placement",t.placement),i.Eb("dropdown-menu",!0)("show",t.dropdown.isOpen()))}}),e})(),Wt=(()=>{let e=class{constructor(e,t){this.dropdown=e,this.nativeElement=t.nativeElement}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Object(i.T)(()=>Bt)),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(e,t){2&e&&i.zb("aria-expanded",t.dropdown.isOpen())}}),e})(),Vt=(()=>{let e=Yt=class extends Wt{constructor(e,t){super(e,t)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Object(i.T)(()=>Bt)),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(e,t){1&e&&i.gc("click",(function(){return t.dropdown.toggle()}))("keydown.ArrowUp",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.ArrowDown",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Home",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.End",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Tab",(function(e){return t.dropdown.onKeyDown(e)}))("keydown.Shift.Tab",(function(e){return t.dropdown.onKeyDown(e)})),2&e&&i.zb("aria-expanded",t.dropdown.isOpen())},features:[i.xb([{provide:Wt,useExisting:Object(i.T)(()=>Yt)}]),i.vb]}),e})(),Bt=(()=>{let e=class{constructor(e,t,n,r,s,a,c){this._changeDetector=e,this._document=n,this._ngZone=r,this._elementRef=s,this._renderer=a,this._closed$=new o.a,this._bodyContainer=null,this._open=!1,this.openChange=new i.o,this.placement=t.placement,this.container=t.container,this.autoClose=t.autoClose,this.display=c?"static":"dynamic",this._zoneSubscription=r.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(Object(w.a)(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(e){e.container&&this._open&&this._applyContainer(this.container),e.placement&&!e.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){vt(this._ngZone,this._document,this.autoClose,e=>{this.close(),0===e&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(e){const t=e.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(e);if(!s&&n.length&&n.forEach((t,n)=>{t.contains(e.target)&&(r=t),t===this._document.activeElement&&(i=n)}),t!==ft.Space&&t!==ft.Enter){if(t!==ft.Tab){if(s||r){if(this.open(),n.length){switch(t){case ft.ArrowDown:i=Math.min(i+1,n.length-1);break;case ft.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case ft.Home:i=0;break;case ft.End:i=n.length-1}n[i].focus()}e.preventDefault()}}else if(e.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===e.target)return void("body"!==this.container||e.shiftKey?e.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const t=this._menu.nativeElement.querySelectorAll(wt);e.shiftKey&&e.target===t[0]?(this._anchor.nativeElement.focus(),e.preventDefault()):e.shiftKey||e.target!==t[t.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Object(c.a)(e.target,"focusout").pipe(Object(w.a)(1)).subscribe(({relatedTarget:e})=>{this._elementRef.nativeElement.contains(e)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Object(c.a)(r,"click").pipe(Object(w.a)(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(e){return this._anchor.nativeElement.contains(e.target)}_getMenuElements(){const e=this._menu;return null==e?[]:e.menuItems.filter(e=>!e.disabled).map(e=>e.elementRef.nativeElement)}_positionMenu(){const e=this._menu;this.isOpen()&&e&&this._applyPlacementClasses("dynamic"===this.display?Tt(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(e){return Array.isArray(e)?e[0]:e.split(" ")[0]}_resetContainer(){const e=this._renderer;if(this._menu){const t=this._menu.nativeElement;e.appendChild(this._elementRef.nativeElement,t),e.removeStyle(t,"position"),e.removeStyle(t,"transform")}this._bodyContainer&&(e.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(e=null){if(this._resetContainer(),"body"===e){const e=this._renderer,t=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||e.createElement("div");e.setStyle(n,"position","absolute"),e.setStyle(t,"position","static"),e.setStyle(n,"z-index","1050"),e.appendChild(n,t),e.appendChild(this._document.body,n)}}_applyPlacementClasses(e){const t=this._menu;if(t){e||(e=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),t.placement="static"===this.display?null:e;const r=-1!==e.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.h),i.Mb(Ft),i.Mb(r.d),i.Mb(i.A),i.Mb(i.m),i.Mb(i.E),i.Mb(zt,8))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbDropdown",""]],contentQueries:function(e,t,n){var r;1&e&&(i.Fb(n,Ht,!0),i.Fb(n,Wt,!0)),2&e&&(i.zc(r=i.hc())&&(t._menu=r.first),i.zc(r=i.hc())&&(t._anchor=r.first))},hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("show",t.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[i.wb]}),e})(),Ut=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e})(),Gt=(()=>{let e=class{constructor(){this.backdrop=!0,this.keyboard=!0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class qt{constructor(e,t,n){this.nodes=e,this.viewRef=t,this.componentRef=n}}class Jt{constructor(e,t,n,i,r,s){this._type=e,this._injector=t,this._viewContainerRef=n,this._renderer=i,this._componentFactoryResolver=r,this._applicationRef=s,this._windowRef=null,this._contentRef=null}open(e,t){return this._windowRef||(this._contentRef=this._getContentRef(e,t),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes)),this._windowRef}close(){var e;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null,(null===(e=this._contentRef)||void 0===e?void 0:e.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null))}_getContentRef(e,t){if(e){if(e instanceof i.L){const n=e.createEmbeddedView(t);return this._applicationRef.attachView(n),new qt([n.rootNodes],n)}return new qt([[this._renderer.createText(""+e)]])}return new qt([])}}const Qt=()=>{};let Kt=(()=>{let e=class{constructor(e){this._document=e}compensate(){const e=this._getWidth();return this._isPresent(e)?this._adjustBody(e):Qt}_adjustBody(e){const t=this._document.body,n=t.style.paddingRight,i=parseFloat(window.getComputedStyle(t)["padding-right"]);return t.style["padding-right"]=i+e+"px",()=>t.style["padding-right"]=n}_isPresent(e){const t=this._document.body.getBoundingClientRect();return window.innerWidth-(t.left+t.right)>=e-.1*e}_getWidth(){const e=this._document.createElement("div");e.className="modal-scrollbar-measure";const t=this._document.body;t.appendChild(e);const n=e.getBoundingClientRect().width-e.clientWidth;return t.removeChild(e),n}};return e.\u0275fac=function(t){return new(t||e)(i.dc(r.d))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(r.d))},token:e,providedIn:"root"}),e})(),Zt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:2,hostBindings:function(e,t){2&e&&i.Ab("modal-backdrop fade show"+(t.backdropClass?" "+t.backdropClass:""))},inputs:{backdropClass:"backdropClass"},decls:0,vars:0,template:function(e,t){},encapsulation:2}),e})();class Xt{close(e){}dismiss(e){}}class en{constructor(e,t,n,i){this._windowCmptRef=e,this._contentRef=t,this._backdropCmptRef=n,this._beforeDismiss=i,e.instance.dismissEvent.subscribe(e=>{this.dismiss(e)}),this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}close(e){this._windowCmptRef&&(this._resolve(e),this._removeModalElements())}_dismiss(e){this._reject(e),this._removeModalElements()}dismiss(e){if(this._windowCmptRef)if(this._beforeDismiss){const t=this._beforeDismiss();t&&t.then?t.then(t=>{!1!==t&&this._dismiss(e)},()=>{}):!1!==t&&this._dismiss(e)}else this._dismiss(e)}_removeModalElements(){const e=this._windowCmptRef.location.nativeElement;if(e.parentNode.removeChild(e),this._windowCmptRef.destroy(),this._backdropCmptRef){const e=this._backdropCmptRef.location.nativeElement;e.parentNode.removeChild(e),this._backdropCmptRef.destroy()}this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._backdropCmptRef=null,this._contentRef=null}}var tn=function(e){return e[e.BACKDROP_CLICK=0]="BACKDROP_CLICK",e[e.ESC=1]="ESC",e}({});let nn=(()=>{let e=class{constructor(e,t,n){this._document=e,this._elRef=t,this._zone=n,this._closed$=new o.a,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new i.o}dismiss(e){this.dismissEvent.emit(e)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){const{nativeElement:e}=this._elRef;if(this._zone.runOutsideAngular(()=>{Object(c.a)(e,"keydown").pipe(Object(y.a)(this._closed$),Object(v.a)(e=>e.which===ft.Escape&&this.keyboard)).subscribe(e=>requestAnimationFrame(()=>{e.defaultPrevented||this._zone.run(()=>this.dismiss(tn.ESC))}));let t=!1;Object(c.a)(this._dialogEl.nativeElement,"mousedown").pipe(Object(y.a)(this._closed$),Object(S.a)(()=>t=!1),Object(_.a)(()=>Object(c.a)(e,"mouseup").pipe(Object(y.a)(this._closed$),Object(w.a)(1))),Object(v.a)(({target:t})=>e===t)).subscribe(()=>{t=!0}),Object(c.a)(e,"click").pipe(Object(y.a)(this._closed$)).subscribe(({target:n})=>{!0!==this.backdrop||e!==n||t||this._zone.run(()=>this.dismiss(tn.BACKDROP_CLICK)),t=!1})}),!e.contains(document.activeElement)){const t=e.querySelector("[ngbAutofocus]"),n=St(e)[0];(t||n||e).focus()}}ngOnDestroy(){const e=this._document.body,t=this._elWithFocus;let n;n=t&&t.focus&&e.contains(t)?t:e,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null}),this._closed$.next()}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(r.d),i.Mb(i.m),i.Mb(i.A))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-modal-window"]],viewQuery:function(e,t){var n;1&e&&i.Jc(re,!0),2&e&&i.zc(n=i.hc())&&(t._dialogEl=n.first)},hostAttrs:["role","dialog","tabindex","-1"],hostVars:5,hostBindings:function(e,t){2&e&&(i.zb("aria-modal",!0)("aria-labelledby",t.ariaLabelledBy)("aria-describedby",t.ariaDescribedBy),i.Ab("modal fade show d-block"+(t.windowClass?" "+t.windowClass:"")))},inputs:{backdrop:"backdrop",keyboard:"keyboard",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:O,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(e,t){1&e&&(i.oc(),i.Sb(0,"div",0,1),i.Sb(2,"div",2),i.nc(3),i.Rb(),i.Rb()),2&e&&i.Ab("modal-dialog"+(t.size?" modal-"+t.size:"")+(t.centered?" modal-dialog-centered":"")+(t.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}"],encapsulation:2}),e})(),rn=(()=>{let e=class{constructor(e,t,n,r,s,a){this._applicationRef=e,this._injector=t,this._document=n,this._scrollBar=r,this._rendererFactory=s,this._ngZone=a,this._activeWindowCmptHasChanged=new o.a,this._ariaHiddenValues=new Map,this._backdropAttributes=["backdropClass"],this._modalRefs=[],this._windowAttributes=["ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new i.o,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const e=this._windowCmpts[this._windowCmpts.length-1];Mt(this._ngZone,e.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(e.location.nativeElement)}})}open(e,t,n,i){const r=i.container instanceof HTMLElement?i.container:Fe(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const c=new Xt,l=this._getContentRef(e,i.injector||t,n,c,i);let u=!1!==i.backdrop?this._attachBackdrop(e,r):void 0,d=this._attachWindowComponent(e,r,l),h=new en(d,l,u,i.beforeDismiss);return this._registerModalRef(h),this._registerWindowCmpt(d),h.result.then(o,o),h.result.then(a,a),c.close=e=>{h.close(e)},c.dismiss=e=>{h.dismiss(e)},this._applyWindowOptions(d.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),u&&u.instance&&this._applyBackdropOptions(u.instance,i),h}get activeInstances(){return this._activeInstances}dismissAll(e){this._modalRefs.forEach(t=>t.dismiss(e))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(e,t){let n=e.resolveComponentFactory(Zt).create(this._injector);return this._applicationRef.attachView(n.hostView),t.appendChild(n.location.nativeElement),n}_attachWindowComponent(e,t,n){let i=e.resolveComponentFactory(nn).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),t.appendChild(i.location.nativeElement),i}_applyWindowOptions(e,t){this._windowAttributes.forEach(n=>{Fe(t[n])&&(e[n]=t[n])})}_applyBackdropOptions(e,t){this._backdropAttributes.forEach(n=>{Fe(t[n])&&(e[n]=t[n])})}_getContentRef(e,t,n,r,s){return n?n instanceof i.L?this._createFromTemplateRef(n,r):Pe(n)?this._createFromString(n):this._createFromComponent(e,t,n,r,s):new qt([])}_createFromTemplateRef(e,t){const n=e.createEmbeddedView({$implicit:t,close(e){t.close(e)},dismiss(e){t.dismiss(e)}});return this._applicationRef.attachView(n),new qt([n.rootNodes],n)}_createFromString(e){const t=this._document.createTextNode(""+e);return new qt([[t]])}_createFromComponent(e,t,n,r,s){const o=e.resolveComponentFactory(n),a=i.s.create({providers:[{provide:Xt,useValue:r}],parent:t}),c=o.create(a),l=c.location.nativeElement;return s.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(c.hostView),new qt([[l]],c.hostView,c)}_setAriaHidden(e){const t=e.parentElement;t&&e!==this._document.body&&(Array.from(t.children).forEach(t=>{t!==e&&"SCRIPT"!==t.nodeName&&(this._ariaHiddenValues.set(t,t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}),this._setAriaHidden(t))}_revertAriaHidden(){this._ariaHiddenValues.forEach((e,t)=>{e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(e){const t=()=>{const t=this._modalRefs.indexOf(e);t>-1&&(this._modalRefs.splice(t,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(e),this._activeInstances.emit(this._modalRefs),e.result.then(t,t)}_registerWindowCmpt(e){this._windowCmpts.push(e),this._activeWindowCmptHasChanged.next(),e.onDestroy(()=>{const t=this._windowCmpts.indexOf(e);t>-1&&(this._windowCmpts.splice(t,1),this._activeWindowCmptHasChanged.next())})}};return e.\u0275fac=function(t){return new(t||e)(i.dc(i.g),i.dc(i.s),i.dc(r.d),i.dc(Kt),i.dc(i.F),i.dc(i.A))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(i.g),Object(i.dc)(i.p),Object(i.dc)(r.d),Object(i.dc)(Kt),Object(i.dc)(i.F),Object(i.dc)(i.A))},token:e,providedIn:"root"}),e})(),sn=(()=>{let e=class{constructor(e,t,n,i){this._moduleCFR=e,this._injector=t,this._modalStack=n,this._config=i}open(e,t={}){const n=Object.assign({},this._config,t);return this._modalStack.open(this._moduleCFR,this._injector,e,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(e){this._modalStack.dismissAll(e)}hasOpenModals(){return this._modalStack.hasOpenModals()}};return e.\u0275fac=function(t){return new(t||e)(i.dc(i.j),i.dc(i.s),i.dc(rn),i.dc(Gt))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(i.j),Object(i.dc)(i.p),Object(i.dc)(rn),Object(i.dc)(Gt))},token:e,providedIn:"root"}),e})(),on=(()=>{let e=class{constructor(){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const an=e=>Fe(e)&&""!==e;let cn=0,ln=(()=>{let e=class{constructor(e){this.templateRef=e}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["ng-template","ngbNavContent",""]]}),e})(),un=(()=>{let e=class{constructor(e,t){this.elementRef=t,this.disabled=!1,this._nav=e}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){Fe(this.domId)||(this.domId="ngb-nav-"+cn++)}get active(){return this._nav.activeId===this.id}get id(){return an(this._id)?this._id:this.domId}get panelDomId(){return this.domId+"-panel"}isPanelInDom(){return(Fe(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Object(i.T)(()=>dn)),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbNavItem",""]],contentQueries:function(e,t,n){var r;1&e&&i.Fb(n,ln,!1),2&e&&i.zc(r=i.hc())&&(t.contentTpls=r)},hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},exportAs:["ngbNavItem"]}),e})(),dn=(()=>{let e=class{constructor(e,t,n,r){this.role=e,this._cd=n,this._document=r,this.activeIdChange=new i.o,this.navChange=new i.o,this.destroyOnHide=t.destroyOnHide,this.orientation=t.orientation,this.roles=t.roles,this.keyboard=t.keyboard}click(e){e.disabled||this._updateActiveId(e.id)}onKeyDown(e){if("tablist"!==this.roles||!this.keyboard)return;const t=e.which,n=this.links.filter(e=>!e.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((e,t)=>{e.elRef.nativeElement===this._document.activeElement&&(r=t)}),i){switch(t){case ft.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case ft.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case ft.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case ft.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case ft.Home:r=0;break;case ft.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),e.preventDefault()}}select(e){this._updateActiveId(e,!1)}ngAfterContentInit(){if(!Fe(this.activeId)){const e=this.items.first?this.items.first.id:null;an(e)&&(this._updateActiveId(e,!1),this._cd.detectChanges())}}_updateActiveId(e,t=!0){if(this.activeId!==e){let n=!1;t&&this.navChange.emit({activeId:this.activeId,nextId:e,preventDefault:()=>{n=!0}}),n||(this.activeId=e,this.activeIdChange.emit(e))}}};return e.\u0275fac=function(t){return new(t||e)(i.ec("role"),i.Mb(on),i.Mb(i.h),i.Mb(r.d))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbNav",""]],contentQueries:function(e,t,n){var r;1&e&&(i.Fb(n,un,!1),i.Fb(n,hn,!0)),2&e&&(i.zc(r=i.hc())&&(t.items=r),i.zc(r=i.hc())&&(t.links=r))},hostVars:6,hostBindings:function(e,t){1&e&&i.gc("keydown.arrowLeft",(function(e){return t.onKeyDown(e)}))("keydown.arrowRight",(function(e){return t.onKeyDown(e)}))("keydown.arrowDown",(function(e){return t.onKeyDown(e)}))("keydown.arrowUp",(function(e){return t.onKeyDown(e)}))("keydown.Home",(function(e){return t.onKeyDown(e)}))("keydown.End",(function(e){return t.onKeyDown(e)})),2&e&&(i.zb("aria-orientation","vertical"===t.orientation&&"tablist"===t.roles?"vertical":void 0)("role",t.role?t.role:t.roles?"tablist":void 0),i.Eb("nav",!0)("flex-column","vertical"===t.orientation))},inputs:{destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",navChange:"navChange"},exportAs:["ngbNav"]}),e})(),hn=(()=>{let e=class{constructor(e,t,n,i){this.role=e,this.navItem=t,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}};return e.\u0275fac=function(t){return new(t||e)(i.ec("role"),i.Mb(un),i.Mb(dn),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(e,t){1&e&&i.gc("click",(function(e){return t.nav.click(t.navItem),e.preventDefault()})),2&e&&(i.Vb("id",t.navItem.domId),i.zb("role",t.role?t.role:t.nav.roles?"tab":void 0)("tabindex",t.navItem.disabled?-1:void 0)("aria-controls",t.navItem.isPanelInDom()?t.navItem.panelDomId:null)("aria-selected",t.navItem.active)("aria-disabled",t.navItem.disabled),i.Eb("nav-link",!0)("nav-item",t.hasNavItemClass())("active",t.navItem.active)("disabled",t.navItem.disabled))}}),e})(),fn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["","ngbNavOutlet",""]],hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("tab-content",!0)},inputs:{paneRole:"paneRole",nav:["ngbNavOutlet","nav"]},attrs:se,decls:1,vars:1,consts:[["ngFor","",3,"ngForOf"],["class","tab-pane",3,"id","active",4,"ngIf"],[1,"tab-pane",3,"id"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&i.Mc(0,le,1,1,"ng-template",0),2&e&&i.pc("ngForOf",t.nav.items)},directives:[r.q,r.r,r.w],encapsulation:2}),e})(),pn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})();class mn{constructor(e,t){this.open=e,this.close=t,t||(this.close=e)}isManual(){return"manual"===this.open||"manual"===this.close}}const bn={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},gn=e=>e>0?Object(D.a)(e):e=>e;function _n(e,t,n,i,r,s,o=0,a=0){const c=function(e,t=bn){const n=(e||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(e=>e.split(":")).map(e=>{let n=t[e[0]]||e;return new mn(n[0],n[1])}),r=i.filter(e=>e.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===c.length&&c[0].isManual())return()=>{};const u=function(e,t,n,i){return new b.a(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),c=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(e.listen(t,n.open,c)):s.push(e.listen(t,n.open,o),e.listen(t,n.close,a))}),()=>{s.forEach(e=>e())}})}(e,t,c,i).pipe(function(e,t,n){return i=>{let r=null;const s=i.pipe(Object(g.a)(e=>({open:e})),Object(v.a)(e=>{const t=n();return t===e.open||r&&r.open!==t?(r&&r.open!==e.open&&(r=null),!1):(r=e,!0)}),Object(T.a)()),o=s.pipe(Object(v.a)(e=>e.open),gn(e)),a=s.pipe(Object(v.a)(e=>!e.open),gn(t));return Object(l.a)(o,a).pipe(Object(v.a)(e=>e===r&&(r=null,e.open!==n())),Object(g.a)(e=>e.open))}}(o,a,i)).subscribe(e=>e?r():s());return()=>u.unsubscribe()}let yn=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement="auto",this.triggers="click",this.disablePopover=!1,this.openDelay=0,this.closeDelay=0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),vn=0,wn=(()=>{let e=class{isTitleTemplate(){return this.title instanceof i.L}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-popover-window"]],hostAttrs:["role","tooltip"],hostVars:3,hostBindings:function(e,t){2&e&&(i.Vb("id",t.id),i.Ab("popover"+(t.popoverClass?" "+t.popoverClass:"")))},inputs:{title:"title",id:"id",popoverClass:"popoverClass",context:"context"},ngContentSelectors:O,decls:4,vars:1,consts:[[1,"arrow"],["class","popover-header",4,"ngIf"],[1,"popover-body"],[1,"popover-header"],["simpleTitle",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.oc(),i.Nb(0,"div",0),i.Mc(1,he,4,2,"h3",1),i.Sb(2,"div",2),i.nc(3),i.Rb()),2&e&&(i.yb(1),i.pc("ngIf",null!=t.title))},directives:[r.r,r.w],styles:["ngb-popover-window.bs-popover-bottom>.arrow,ngb-popover-window.bs-popover-top>.arrow{left:50%;margin-left:-.5rem}ngb-popover-window.bs-popover-bottom-left>.arrow,ngb-popover-window.bs-popover-top-left>.arrow{left:2em}ngb-popover-window.bs-popover-bottom-right>.arrow,ngb-popover-window.bs-popover-top-right>.arrow{left:auto;right:2em}ngb-popover-window.bs-popover-left>.arrow,ngb-popover-window.bs-popover-right>.arrow{top:50%;margin-top:-.5rem}ngb-popover-window.bs-popover-left-top>.arrow,ngb-popover-window.bs-popover-right-top>.arrow{top:.7em}ngb-popover-window.bs-popover-left-bottom>.arrow,ngb-popover-window.bs-popover-right-bottom>.arrow{top:auto;bottom:.7em}"],encapsulation:2,changeDetection:0}),e})(),Sn=(()=>{let e=class{constructor(e,t,n,r,s,o,a,c,l,u){this._elementRef=e,this._renderer=t,this._ngZone=a,this._document=c,this._changeDetector=l,this.shown=new i.o,this.hidden=new i.o,this._ngbPopoverWindowId="ngb-popover-"+vn++,this._windowRef=null,this.autoClose=o.autoClose,this.placement=o.placement,this.triggers=o.triggers,this.container=o.container,this.disablePopover=o.disablePopover,this.popoverClass=o.popoverClass,this.openDelay=o.openDelay,this.closeDelay=o.closeDelay,this._popupService=new Jt(wn,n,s,t,r,u),this._zoneSubscription=a.onStable.subscribe(()=>{this._windowRef&&Tt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-popover")})}_isDisabled(){return!!this.disablePopover||!this.ngbPopover&&!this.popoverTitle}open(e){this._windowRef||this._isDisabled()||(this._windowRef=this._popupService.open(this.ngbPopover,e),this._windowRef.instance.title=this.popoverTitle,this._windowRef.instance.context=e,this._windowRef.instance.popoverClass=this.popoverClass,this._windowRef.instance.id=this._ngbPopoverWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbPopoverWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),vt(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),this.shown.emit())}close(){this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(),this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck())}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=_n(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({ngbPopover:e,popoverTitle:t,disablePopover:n,popoverClass:i}){i&&this.isOpen()&&(this._windowRef.instance.popoverClass=i.currentValue),(e||t||n)&&this._isDisabled()&&this.close()}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb(i.s),i.Mb(i.j),i.Mb(i.P),i.Mb(yn),i.Mb(i.A),i.Mb(r.d),i.Mb(i.h),i.Mb(i.g))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbPopover",""]],inputs:{autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disablePopover:"disablePopover",popoverClass:"popoverClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbPopover:"ngbPopover",popoverTitle:"popoverTitle"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbPopover"],features:[i.wb]}),e})(),Mn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})(),xn=(()=>{let e=class{constructor(){this.max=100,this.animated=!1,this.striped=!1,this.showValue=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),kn=(()=>{let e=class{constructor(e){this.value=0,this.max=e.max,this.animated=e.animated,this.striped=e.striped,this.textType=e.textType,this.type=e.type,this.showValue=e.showValue,this.height=e.height}set max(e){this._max=!je(e)||e<=0?100:e}get max(){return this._max}getValue(){return function(e,t,n=0){return Math.max(Math.min(e,t),n)}(this.value,this.max)}getPercentValue(){return 100*this.getValue()/this.max}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(xn))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-progressbar"]],inputs:{value:"value",max:"max",animated:"animated",striped:"striped",textType:"textType",type:"type",showValue:"showValue",height:"height"},ngContentSelectors:O,decls:4,vars:13,consts:function(){return[[1,"progress"],["role","progressbar","aria-valuemin","0"],[4,"ngIf"],"" + "\ufffd0\ufffd" + ""]},template:function(e,t){1&e&&(i.oc(),i.Sb(0,"div",0),i.Sb(1,"div",1),i.Mc(2,fe,3,3,"span",2),i.nc(3),i.Rb(),i.Rb()),2&e&&(i.Kc("height",t.height),i.yb(1),i.Db("progress-bar",t.type?" bg-"+t.type:"","",t.textType?" text-"+t.textType:"","\n      ",t.animated?" progress-bar-animated":"","",t.striped?" progress-bar-striped":"",""),i.Kc("width",t.getPercentValue(),"%"),i.zb("aria-valuenow",t.getValue())("aria-valuemax",t.max),i.yb(1),i.pc("ngIf",t.showValue))},directives:[r.r],pipes:[r.y],encapsulation:2,changeDetection:0}),e})(),Dn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})();class Tn{constructor(e,t,n){this.hour=Ae(e),this.minute=Ae(t),this.second=Ae(n)}changeHour(e=1){this.updateHour((isNaN(this.hour)?0:this.hour)+e)}updateHour(e){this.hour=je(e)?(e<0?24+e:e)%24:NaN}changeMinute(e=1){this.updateMinute((isNaN(this.minute)?0:this.minute)+e)}updateMinute(e){je(e)?(this.minute=e%60<0?60+e%60:e%60,this.changeHour(Math.floor(e/60))):this.minute=NaN}changeSecond(e=1){this.updateSecond((isNaN(this.second)?0:this.second)+e)}updateSecond(e){je(e)?(this.second=e<0?60+e%60:e%60,this.changeMinute(Math.floor(e/60))):this.second=NaN}isValid(e=!0){return je(this.hour)&&je(this.minute)&&(!e||je(this.second))}toString(){return`${this.hour||0}:${this.minute||0}:${this.second||0}`}}let Cn=(()=>{let e=class{constructor(){this.meridian=!1,this.spinners=!0,this.seconds=!1,this.hourStep=1,this.minuteStep=1,this.secondStep=1,this.disabled=!1,this.readonlyInputs=!1,this.size="medium"}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function On(){return new Ln}let Rn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:On,token:e,providedIn:"root"}),e})(),Ln=(()=>{let e=class extends Rn{fromModel(e){return e&&Ne(e.hour)&&Ne(e.minute)?{hour:e.hour,minute:e.minute,second:Ne(e.second)?e.second:null}:null}toModel(e){return e&&Ne(e.hour)&&Ne(e.minute)?{hour:e.hour,minute:e.minute,second:Ne(e.second)?e.second:null}:null}};return e.\u0275fac=function(t){return ii(t||e)},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),En=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return e=Object(i.dc)(i.v),new An(e);var e},token:e,providedIn:"root"}),e})(),An=(()=>{let e=class extends En{constructor(e){super(),this._periods=Object(r.G)(e,r.g.Standalone,r.B.Narrow)}getMorningPeriod(){return this._periods[0]}getAfternoonPeriod(){return this._periods[1]}};return e.\u0275fac=function(t){return new(t||e)(i.dc(i.v))},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();const In=/[^0-9]/g,Pn={provide:s.o,useExisting:Object(i.T)(()=>jn),multi:!0};let jn=(()=>{let e=class{constructor(e,t,n,i){this._config=e,this._ngbTimeAdapter=t,this._cd=n,this.i18n=i,this.onChange=e=>{},this.onTouched=()=>{},this.meridian=e.meridian,this.spinners=e.spinners,this.seconds=e.seconds,this.hourStep=e.hourStep,this.minuteStep=e.minuteStep,this.secondStep=e.secondStep,this.disabled=e.disabled,this.readonlyInputs=e.readonlyInputs,this.size=e.size}set hourStep(e){this._hourStep=Ne(e)?e:this._config.hourStep}get hourStep(){return this._hourStep}set minuteStep(e){this._minuteStep=Ne(e)?e:this._config.minuteStep}get minuteStep(){return this._minuteStep}set secondStep(e){this._secondStep=Ne(e)?e:this._config.secondStep}get secondStep(){return this._secondStep}writeValue(e){const t=this._ngbTimeAdapter.fromModel(e);this.model=t?new Tn(t.hour,t.minute,t.second):new Tn,this.seconds||t&&je(t.second)||(this.model.second=0),this._cd.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}changeHour(e){this.model.changeHour(e),this.propagateModelChange()}changeMinute(e){this.model.changeMinute(e),this.propagateModelChange()}changeSecond(e){this.model.changeSecond(e),this.propagateModelChange()}updateHour(e){const t=this.model.hour>=12,n=Ae(e);this.model.updateHour(this.meridian&&(t&&n<12||!t&&12===n)?n+12:n),this.propagateModelChange()}updateMinute(e){this.model.updateMinute(Ae(e)),this.propagateModelChange()}updateSecond(e){this.model.updateSecond(Ae(e)),this.propagateModelChange()}toggleMeridian(){this.meridian&&this.changeHour(12)}formatInput(e){e.value=e.value.replace(In,"")}formatHour(e){return je(e)?Ye(this.meridian?e%12==0?12:e%12:e%24):Ye(NaN)}formatMinSec(e){return Ye(je(e)?e:NaN)}get isSmallSize(){return"small"===this.size}get isLargeSize(){return"large"===this.size}ngOnChanges(e){e.seconds&&!this.seconds&&this.model&&!je(this.model.second)&&(this.model.second=0,this.propagateModelChange(!1))}propagateModelChange(e=!0){e&&this.onTouched(),this.model.isValid(this.seconds)?this.onChange(this._ngbTimeAdapter.toModel({hour:this.model.hour,minute:this.model.minute,second:this.model.second})):this.onChange(this._ngbTimeAdapter.toModel(null))}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(Cn),i.Mb(Rn),i.Mb(i.h),i.Mb(En))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-timepicker"]],inputs:{meridian:"meridian",spinners:"spinners",seconds:"seconds",hourStep:"hourStep",minuteStep:"minuteStep",secondStep:"secondStep",readonlyInputs:"readonlyInputs",size:"size"},features:[i.xb([Pn]),i.wb],decls:18,vars:25,consts:function(){return[[3,"disabled"],[1,"ngb-tp"],[1,"ngb-tp-input-container","ngb-tp-hour"],["tabindex","-1","type","button","class","btn btn-link",3,"btn-sm","btn-lg","disabled","click",4,"ngIf"],["type","text","maxlength","2","inputmode","numeric",1,"ngb-tp-input","form-control",3,"value","readOnly","disabled","change","input","keydown.ArrowUp","keydown.ArrowDown",6,"placeholder","aria-label"],["placeholder","HH","aria-label","Hours"],[1,"ngb-tp-spacer"],[1,"ngb-tp-input-container","ngb-tp-minute"],["placeholder","MM","aria-label","Minutes"],["class","ngb-tp-spacer",4,"ngIf"],["class","ngb-tp-input-container ngb-tp-second",4,"ngIf"],["class","ngb-tp-meridian",4,"ngIf"],["tabindex","-1","type","button",1,"btn","btn-link",3,"disabled","click"],[1,"chevron","ngb-tp-chevron"],[1,"sr-only"],"Increment hours",[1,"chevron","ngb-tp-chevron","bottom"],"Decrement hours","Increment minutes","Decrement minutes",[1,"ngb-tp-input-container","ngb-tp-second"],["placeholder","SS","aria-label","Seconds"],"Increment seconds","Decrement seconds",[1,"ngb-tp-meridian"],["type","button",1,"btn","btn-outline-primary",3,"disabled","click"],[4,"ngIf","ngIfElse"],["am",""],"" + "\ufffd0\ufffd" + "","" + "\ufffd0\ufffd" + ""]},template:function(e,t){1&e&&(i.Sb(0,"fieldset",0),i.Sb(1,"div",1),i.Sb(2,"div",2),i.Mc(3,pe,4,7,"button",3),i.Sb(4,"input",4),i.Yb(5,5),i.gc("change",(function(e){return t.updateHour(e.target.value)}))("input",(function(e){return t.formatInput(e.target)}))("keydown.ArrowUp",(function(e){return t.changeHour(t.hourStep),e.preventDefault()}))("keydown.ArrowDown",(function(e){return t.changeHour(-t.hourStep),e.preventDefault()})),i.Rb(),i.Mc(6,me,4,7,"button",3),i.Rb(),i.Sb(7,"div",6),i.Oc(8,":"),i.Rb(),i.Sb(9,"div",7),i.Mc(10,be,4,7,"button",3),i.Sb(11,"input",4),i.Yb(12,8),i.gc("change",(function(e){return t.updateMinute(e.target.value)}))("input",(function(e){return t.formatInput(e.target)}))("keydown.ArrowUp",(function(e){return t.changeMinute(t.minuteStep),e.preventDefault()}))("keydown.ArrowDown",(function(e){return t.changeMinute(-t.minuteStep),e.preventDefault()})),i.Rb(),i.Mc(13,ge,4,7,"button",3),i.Rb(),i.Mc(14,_e,2,0,"div",9),i.Mc(15,we,5,9,"div",10),i.Mc(16,Se,1,0,"div",9),i.Mc(17,ke,5,9,"div",11),i.Rb(),i.Rb()),2&e&&(i.Eb("disabled",t.disabled),i.pc("disabled",t.disabled),i.yb(3),i.pc("ngIf",t.spinners),i.yb(1),i.Eb("form-control-sm",t.isSmallSize)("form-control-lg",t.isLargeSize),i.pc("value",t.formatHour(null==t.model?null:t.model.hour))("readOnly",t.readonlyInputs)("disabled",t.disabled),i.yb(2),i.pc("ngIf",t.spinners),i.yb(4),i.pc("ngIf",t.spinners),i.yb(1),i.Eb("form-control-sm",t.isSmallSize)("form-control-lg",t.isLargeSize),i.pc("value",t.formatMinSec(null==t.model?null:t.model.minute))("readOnly",t.readonlyInputs)("disabled",t.disabled),i.yb(2),i.pc("ngIf",t.spinners),i.yb(1),i.pc("ngIf",t.seconds),i.yb(1),i.pc("ngIf",t.seconds),i.yb(1),i.pc("ngIf",t.meridian),i.yb(1),i.pc("ngIf",t.meridian))},directives:[r.r],styles:['ngb-timepicker{font-size:1rem}.ngb-tp{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-tp-input-container{width:4em}.ngb-tp-chevron::before{border-style:solid;border-width:.29em .29em 0 0;content:"";display:inline-block;height:.69em;left:.05em;position:relative;top:.15em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);vertical-align:middle;width:.69em}.ngb-tp-chevron.bottom:before{top:-.3em;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ngb-tp-input{text-align:center}.ngb-tp-hour,.ngb-tp-meridian,.ngb-tp-minute,.ngb-tp-second{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ngb-tp-spacer{width:1em;text-align:center}'],encapsulation:2}),e})(),Nn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})(),Fn=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Yn=0,zn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:3,hostBindings:function(e,t){2&e&&(i.Vb("id",t.id),i.Ab("tooltip show"+(t.tooltipClass?" "+t.tooltipClass:"")))},inputs:{id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:O,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(e,t){1&e&&(i.oc(),i.Nb(0,"div",0),i.Sb(1,"div",1),i.nc(2),i.Rb())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{top:auto;bottom:.4rem}"],encapsulation:2,changeDetection:0}),e})(),$n=(()=>{let e=class{constructor(e,t,n,r,s,o,a,c,l,u){this._elementRef=e,this._renderer=t,this._ngZone=a,this._document=c,this._changeDetector=l,this.shown=new i.o,this.hidden=new i.o,this._ngbTooltipWindowId="ngb-tooltip-"+Yn++,this._windowRef=null,this.autoClose=o.autoClose,this.placement=o.placement,this.triggers=o.triggers,this.container=o.container,this.disableTooltip=o.disableTooltip,this.tooltipClass=o.tooltipClass,this.openDelay=o.openDelay,this.closeDelay=o.closeDelay,this._popupService=new Jt(zn,n,s,t,r,u),this._zoneSubscription=a.onStable.subscribe(()=>{this._windowRef&&Tt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(e){this._ngbTooltip=e,!e&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(e){this._windowRef||!this._ngbTooltip||this.disableTooltip||(this._windowRef=this._popupService.open(this._ngbTooltip,e),this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),vt(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),this.shown.emit())}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(),this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck())}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=_n(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:e}){e&&this.isOpen()&&(this._windowRef.instance.tooltipClass=e.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb(i.s),i.Mb(i.j),i.Mb(i.P),i.Mb(Fn),i.Mb(i.A),i.Mb(r.d),i.Mb(i.h),i.Mb(i.g))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngbTooltip",""]],inputs:{autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[i.wb]}),e})(),Hn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e})(),Wn=(()=>{let e=class{constructor(){this.highlightClass="ngb-highlight"}ngOnChanges(e){const t=Ie(this.result),n=(Array.isArray(this.term)?this.term:[this.term]).map(e=>Ie(e).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")).filter(e=>e);this.parts=n.length?t.split(new RegExp(`(${n.join("|")})`,"gmi")):[t]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-highlight"]],inputs:{highlightClass:"highlightClass",result:"result",term:"term"},features:[i.wb],decls:1,vars:1,consts:[["ngFor","",3,"ngForOf"],[3,"class",4,"ngIf","ngIfElse"],["even",""]],template:function(e,t){1&e&&i.Mc(0,Ce,3,2,"ng-template",0),2&e&&i.pc("ngForOf",t.parts)},directives:[r.q,r.r],styles:[".ngb-highlight{font-weight:700}"],encapsulation:2,changeDetection:0}),e})(),Vn=(()=>{let e=class{constructor(){this.activeIdx=0,this.focusFirst=!0,this.formatter=Ie,this.selectEvent=new i.o,this.activeChangeEvent=new i.o}hasActive(){return this.activeIdx>-1&&this.activeIdx<this.results.length}getActive(){return this.results[this.activeIdx]}markActive(e){this.activeIdx=e,this._activeChanged()}next(){this.activeIdx===this.results.length-1?this.activeIdx=this.focusFirst?(this.activeIdx+1)%this.results.length:-1:this.activeIdx++,this._activeChanged()}prev(){this.activeIdx<0?this.activeIdx=this.results.length-1:0===this.activeIdx?this.activeIdx=this.focusFirst?this.results.length-1:-1:this.activeIdx--,this._activeChanged()}resetActive(){this.activeIdx=this.focusFirst?0:-1,this._activeChanged()}select(e){this.selectEvent.emit(e)}ngOnInit(){this.resetActive()}_activeChanged(){this.activeChangeEvent.emit(this.activeIdx>=0?this.id+"-"+this.activeIdx:void 0)}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["ngb-typeahead-window"]],hostAttrs:["role","listbox",1,"dropdown-menu","show"],hostVars:1,hostBindings:function(e,t){1&e&&i.gc("mousedown",(function(e){return e.preventDefault()})),2&e&&i.Vb("id",t.id)},inputs:{focusFirst:"focusFirst",formatter:"formatter",id:"id",results:"results",term:"term",resultTemplate:"resultTemplate"},outputs:{selectEvent:"select",activeChangeEvent:"activeChange"},exportAs:["ngbTypeaheadWindow"],decls:3,vars:1,consts:[["rt",""],["ngFor","",3,"ngForOf"],[3,"result","term"],["type","button","role","option",1,"dropdown-item",3,"id","mouseenter","click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Mc(0,Oe,1,2,"ng-template",null,0,i.Nc),i.Mc(2,Ee,2,9,"ng-template",1)),2&e&&(i.yb(2),i.pc("ngForOf",t.results))},directives:[r.q,Wn,r.w],encapsulation:2}),e})();const Bn=new i.r("live announcer delay",{providedIn:"root",factory:function(){return 100}});function Un(e,t=!1){let n=e.body.querySelector("#ngb-live");return null==n&&t&&(n=e.createElement("div"),n.setAttribute("id","ngb-live"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.classList.add("sr-only"),e.body.appendChild(n)),n}let Gn=(()=>{let e=class{constructor(e,t){this._document=e,this._delay=t}ngOnDestroy(){const e=Un(this._document);e&&e.parentElement.removeChild(e)}say(e){const t=Un(this._document,!0),n=this._delay;if(null!=t){t.textContent="";const i=()=>t.textContent=e;null===n?i():setTimeout(i,n)}}};return e.\u0275fac=function(t){return new(t||e)(i.dc(r.d),i.dc(Bn))},e.\u0275prov=Object(i.Ib)({factory:function(){return new e(Object(i.dc)(r.d),Object(i.dc)(Bn))},token:e,providedIn:"root"}),e})(),qn=(()=>{let e=class{constructor(){this.editable=!0,this.focusFirst=!0,this.showHint=!1,this.placement=["bottom-left","bottom-right","top-left","top-right"]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const Jn={provide:s.o,useExisting:Object(i.T)(()=>Kn),multi:!0};let Qn=0,Kn=(()=>{let e=class{constructor(e,t,n,r,s,l,u,d,h,f,p,m){this._elementRef=e,this._renderer=n,this._live=d,this._document=h,this._ngZone=f,this._changeDetector=p,this._subscription=null,this._closed$=new o.a,this._inputValueBackup=null,this._windowRef=null,this.autocomplete="off",this.placement="bottom-left",this.selectItem=new i.o,this.activeDescendant=null,this.popupId="ngb-typeahead-"+Qn++,this._onTouched=()=>{},this._onChange=e=>{},this.container=l.container,this.editable=l.editable,this.focusFirst=l.focusFirst,this.showHint=l.showHint,this.placement=l.placement,this._valueChanges=Object(c.a)(e.nativeElement,"input").pipe(Object(g.a)(e=>e.target.value)),this._resubscribeTypeahead=new a.a(null),this._popupService=new Jt(Vn,r,t,n,s,m),this._zoneSubscription=u.onStable.subscribe(()=>{this.isPopupOpen()&&Tt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container)})}ngOnInit(){const e=this._valueChanges.pipe(Object(S.a)(e=>{this._inputValueBackup=this.showHint?e:null,this._onChange(this.editable?e:void 0)})).pipe(this.ngbTypeahead),t=this._resubscribeTypeahead.pipe(Object(_.a)(()=>e));this._subscription=this._subscribeToUserInput(t)}ngOnDestroy(){this._closePopup(),this._unsubscribeFromUserInput(),this._zoneSubscription.unsubscribe()}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}writeValue(e){this._writeInputValue(this._formatItemForInput(e)),this.showHint&&(this._inputValueBackup=e)}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}dismissPopup(){this.isPopupOpen()&&(this._resubscribeTypeahead.next(null),this._closePopup(),this.showHint&&null!==this._inputValueBackup&&this._writeInputValue(this._inputValueBackup),this._changeDetector.markForCheck())}isPopupOpen(){return null!=this._windowRef}handleBlur(){this._resubscribeTypeahead.next(null),this._onTouched()}handleKeyDown(e){if(this.isPopupOpen())switch(e.which){case ft.ArrowDown:e.preventDefault(),this._windowRef.instance.next(),this._showHint();break;case ft.ArrowUp:e.preventDefault(),this._windowRef.instance.prev(),this._showHint();break;case ft.Enter:case ft.Tab:const t=this._windowRef.instance.getActive();Fe(t)&&(e.preventDefault(),e.stopPropagation(),this._selectResult(t)),this._closePopup()}}_openPopup(){this.isPopupOpen()||(this._inputValueBackup=this._elementRef.nativeElement.value,this._windowRef=this._popupService.open(),this._windowRef.instance.id=this.popupId,this._windowRef.instance.selectEvent.subscribe(e=>this._selectResultClosePopup(e)),this._windowRef.instance.activeChangeEvent.subscribe(e=>this.activeDescendant=e),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._changeDetector.markForCheck(),vt(this._ngZone,this._document,"outside",()=>this.dismissPopup(),this._closed$,[this._elementRef.nativeElement,this._windowRef.location.nativeElement]))}_closePopup(){this._closed$.next(),this._popupService.close(),this._windowRef=null,this.activeDescendant=null}_selectResult(e){let t=!1;this.selectItem.emit({item:e,preventDefault:()=>{t=!0}}),this._resubscribeTypeahead.next(null),t||(this.writeValue(e),this._onChange(e))}_selectResultClosePopup(e){this._selectResult(e),this._closePopup()}_showHint(){var e;if(this.showHint&&(null===(e=this._windowRef)||void 0===e?void 0:e.instance.hasActive())&&null!=this._inputValueBackup){const e=this._inputValueBackup.toLowerCase(),t=this._formatItemForInput(this._windowRef.instance.getActive());e===t.substr(0,this._inputValueBackup.length).toLowerCase()?(this._writeInputValue(this._inputValueBackup+t.substr(this._inputValueBackup.length)),this._elementRef.nativeElement.setSelectionRange.apply(this._elementRef.nativeElement,[this._inputValueBackup.length,t.length])):this._writeInputValue(t)}}_formatItemForInput(e){return null!=e&&this.inputFormatter?this.inputFormatter(e):Ie(e)}_writeInputValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",Ie(e))}_subscribeToUserInput(e){return e.subscribe(e=>{e&&0!==e.length?(this._openPopup(),this._windowRef.instance.focusFirst=this.focusFirst,this._windowRef.instance.results=e,this._windowRef.instance.term=this._elementRef.nativeElement.value,this.resultFormatter&&(this._windowRef.instance.formatter=this.resultFormatter),this.resultTemplate&&(this._windowRef.instance.resultTemplate=this.resultTemplate),this._windowRef.instance.resetActive(),this._windowRef.changeDetectorRef.detectChanges(),this._showHint()):this._closePopup();const t=e?e.length:0;this._live.say(0===t?"No results available":`${t} result${1===t?"":"s"} available`)})}_unsubscribeFromUserInput(){this._subscription&&this._subscription.unsubscribe(),this._subscription=null}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.P),i.Mb(i.E),i.Mb(i.s),i.Mb(i.j),i.Mb(qn),i.Mb(i.A),i.Mb(Gn),i.Mb(r.d),i.Mb(i.A),i.Mb(i.h),i.Mb(i.g))},e.\u0275dir=i.Hb({type:e,selectors:[["input","ngbTypeahead",""]],hostAttrs:["autocapitalize","off","autocorrect","off","role","combobox","aria-multiline","false"],hostVars:7,hostBindings:function(e,t){1&e&&i.gc("blur",(function(){return t.handleBlur()}))("keydown",(function(e){return t.handleKeyDown(e)})),2&e&&(i.Vb("autocomplete",t.autocomplete),i.zb("aria-autocomplete",t.showHint?"both":"list")("aria-activedescendant",t.activeDescendant)("aria-owns",t.isPopupOpen()?t.popupId:null)("aria-expanded",t.isPopupOpen()),i.Eb("open",t.isPopupOpen()))},inputs:{autocomplete:"autocomplete",placement:"placement",container:"container",editable:"editable",focusFirst:"focusFirst",showHint:"showHint",inputFormatter:"inputFormatter",ngbTypeahead:"ngbTypeahead",resultFormatter:"resultFormatter",resultTemplate:"resultTemplate"},outputs:{selectItem:"selectItem"},exportAs:["ngbTypeahead"],features:[i.xb([Jn])]}),e})(),Zn=(()=>{let e=class{};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[r.c]]}),e})();const Xn=i.Ub(Ke),ei=i.Ub(lt),ti=i.Ub(Rt),ni=i.Ub(Lt),ii=i.Ub(Ln)},"G1/K":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t){return""===e?r.a.defaultTo(t,"n/a"):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"notAvailable",type:e,pure:!0}),e})()},G1I9:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return o}));var i=n("oxzT"),r=n("mtw6");class s{constructor(e=r.a.info,t,n,i,s="Ceph"){this.type=e,this.title=t,this.message=n,this.options=i,this.application=s,this.isFinishedTask=!1,this.classes={Ceph:"ceph-icon",Prometheus:"prometheus-icon"},this.applicationClass=this.classes[this.application]}}class o extends s{constructor(e=new s){super(e.type,e.title,e.message,e.options,e.application),this.config=e,this.textClasses=["text-danger","text-info","text-success"],this.iconClasses=[i.a.warning,i.a.info,i.a.check],this.borderClasses=["border-danger","border-info","border-success"],delete this.config,this.timestamp=(new Date).toJSON(),this.iconClass=this.iconClasses[this.type],this.textClass=this.textClasses[this.type],this.borderClass=this.borderClasses[this.type],this.isFinishedTask=e.isFinishedTask}}},G4mU:function(e,t,n){"use strict";var i=n("lkxz");t.a=function(e,t){var n=t?Object(i.a)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},"G6Q+":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("SVse"),r=n("iInd"),s=n("PCNd"),o=n("8Y7J");let a=(()=>{class e{}return e.\u0275mod=o.Kb({type:e}),e.\u0275inj=o.Jb({factory:function(t){return new(t||e)},imports:[[i.c,s.a,r.i]]}),e})()},GS7A:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return o})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return m}));class i{}class r{}const s="*";function o(e,t){return{type:7,name:e,definitions:t,options:{}}}function a(e,t=null){return{type:4,styles:t,timings:e}}function c(e,t=null){return{type:2,steps:e,options:t}}function l(e){return{type:6,styles:e,offset:null}}function u(e,t,n){return{type:0,name:e,styles:t,options:n}}function d(e,t,n=null){return{type:1,expr:e,animation:t,options:n}}function h(e){Promise.resolve(null).then(e)}class f{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){h(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){}setPosition(e){}getPosition(){return 0}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}class p{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,n=0,i=0;const r=this.players.length;0==r?h(()=>this._onFinish()):this.players.forEach(e=>{e.onDone(()=>{++t==r&&this._onFinish()}),e.onDestroy(()=>{++n==r&&this._onDestroy()}),e.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((e,t)=>Math.max(e,t.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(e=>{const n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let e=0;return this.players.forEach(t=>{const n=t.getPosition();e=Math.min(n,e)}),e}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}const m="!"},GarU:function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},GgAd:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("8Y7J"),r=n("G0yt"),s=n("SVse"),o=n("Fgil"),a=n("o4+5");function c(e,t){if(1&e&&(i.Sb(0,"table"),i.Sb(1,"tr"),i.Sb(2,"td",4),i.Oc(3,"Used:\xa0"),i.Rb(),i.Sb(4,"td",5),i.Sb(5,"strong"),i.Oc(6),i.jc(7,"dimlessBinary"),i.jc(8,"dimless"),i.Rb(),i.Rb(),i.Rb(),i.Sb(9,"tr"),i.Sb(10,"td",4),i.Oc(11,"Free:\xa0"),i.Rb(),i.Sb(12,"td",6),i.Sb(13,"strong"),i.Oc(14),i.jc(15,"dimlessBinary"),i.jc(16,"dimless"),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(6),i.Qc(" ",e.isBinary?i.kc(7,2,e.used):i.kc(8,4,e.used),""),i.yb(8),i.Pc(e.isBinary?i.kc(15,6,e.total-e.used):i.kc(16,8,e.total-e.used))}}let l=(()=>{class e{constructor(){this.isBinary=!0,this.decimals=0}ngOnChanges(){this.usedPercentage=this.total>0?this.used/this.total*100:0,this.freePercentage=100-this.usedPercentage}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-usage-bar"]],inputs:{total:"total",used:"used",isBinary:"isBinary",decimals:"decimals"},features:[i.wb],decls:8,vars:9,consts:[["usageTooltipTpl",""],["data-placement","left",1,"progress",3,"ngbTooltip"],["role","progressbar",1,"progress-bar","bg-info"],["role","progressbar",1,"progress-bar","bg-freespace"],[1,"text-left"],[1,"text-right"],[1,"'text-right"]],template:function(e,t){if(1&e&&(i.Mc(0,c,17,10,"ng-template",null,0,i.Nc),i.Sb(2,"div",1),i.Sb(3,"div",2),i.Sb(4,"span"),i.Oc(5),i.jc(6,"number"),i.Rb(),i.Rb(),i.Nb(7,"div",3),i.Rb()),2&e){const e=i.Ac(1);i.yb(2),i.pc("ngbTooltip",e),i.yb(1),i.Kc("width",t.usedPercentage+"%"),i.yb(2),i.Qc("",i.lc(6,6,t.usedPercentage,"1.0-"+t.decimals),"%"),i.yb(2),i.Kc("width",t.freePercentage+"%")}},directives:[r.D],pipes:[s.f,o.a,a.a],styles:[".bg-info[_ngcontent-%COMP%]{background-color:#2b99a8!important}.bg-freespace[_ngcontent-%COMP%]{background-color:#ced4da!important}.progress[_ngcontent-%COMP%]{height:20px;margin-bottom:0;position:relative}.progress[_ngcontent-%COMP%]   div.progress-bar[_ngcontent-%COMP%]{position:static}.progress[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#000;display:block;font-weight:400;position:absolute;width:100%}"]}),e})()},GyhO:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("LRne"),r=n("0EUg");function s(...e){return Object(r.a)()(Object(i.a)(...e))}},H8ED:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443":"h"===n?t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d",hh:t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d",dd:"\u0434\u0437\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u0437\u0451\u043d",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u044b_\u043c\u0435\u0441\u044f\u0446\u0430\u045e",yy:"\u0433\u043e\u0434_\u0433\u0430\u0434\u044b_\u0433\u0430\u0434\u043e\u045e"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}e.defineLocale("be",{months:{format:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044f_\u043b\u044e\u0442\u0430\u0433\u0430_\u0441\u0430\u043a\u0430\u0432\u0456\u043a\u0430_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a\u0430_\u0442\u0440\u0430\u045e\u043d\u044f_\u0447\u044d\u0440\u0432\u0435\u043d\u044f_\u043b\u0456\u043f\u0435\u043d\u044f_\u0436\u043d\u0456\u045e\u043d\u044f_\u0432\u0435\u0440\u0430\u0441\u043d\u044f_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a\u0430_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430_\u0441\u043d\u0435\u0436\u043d\u044f".split("_"),standalone:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044c_\u043b\u044e\u0442\u044b_\u0441\u0430\u043a\u0430\u0432\u0456\u043a_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u044d\u0440\u0432\u0435\u043d\u044c_\u043b\u0456\u043f\u0435\u043d\u044c_\u0436\u043d\u0456\u0432\u0435\u043d\u044c_\u0432\u0435\u0440\u0430\u0441\u0435\u043d\u044c_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434_\u0441\u043d\u0435\u0436\u0430\u043d\u044c".split("_")},monthsShort:"\u0441\u0442\u0443\u0434_\u043b\u044e\u0442_\u0441\u0430\u043a_\u043a\u0440\u0430\u0441_\u0442\u0440\u0430\u0432_\u0447\u044d\u0440\u0432_\u043b\u0456\u043f_\u0436\u043d\u0456\u0432_\u0432\u0435\u0440_\u043a\u0430\u0441\u0442_\u043b\u0456\u0441\u0442_\u0441\u043d\u0435\u0436".split("_"),weekdays:{format:"\u043d\u044f\u0434\u0437\u0435\u043b\u044e_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0443_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0443_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),standalone:"\u043d\u044f\u0434\u0437\u0435\u043b\u044f_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0430_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0430_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),isFormat:/\[ ?[\u0423\u0443\u045e] ?(?:\u043c\u0456\u043d\u0443\u043b\u0443\u044e|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0443\u044e)? ?\] ?dddd/},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., HH:mm",LLLL:"dddd, D MMMM YYYY \u0433., HH:mm"},calendar:{sameDay:"[\u0421\u0451\u043d\u043d\u044f \u045e] LT",nextDay:"[\u0417\u0430\u045e\u0442\u0440\u0430 \u045e] LT",lastDay:"[\u0423\u0447\u043e\u0440\u0430 \u045e] LT",nextWeek:function(){return"[\u0423] dddd [\u045e] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u0443\u044e] dddd [\u045e] LT";case 1:case 2:case 4:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u044b] dddd [\u045e] LT"}},sameElse:"L"},relativeTime:{future:"\u043f\u0440\u0430\u0437 %s",past:"%s \u0442\u0430\u043c\u0443",s:"\u043d\u0435\u043a\u0430\u043b\u044c\u043a\u0456 \u0441\u0435\u043a\u0443\u043d\u0434",m:t,mm:t,h:t,hh:t,d:"\u0434\u0437\u0435\u043d\u044c",dd:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u044b|\u0440\u0430\u043d\u0456\u0446\u044b|\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u044b":e<12?"\u0440\u0430\u043d\u0456\u0446\u044b":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0430\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0456|\u044b|\u0433\u0430)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-\u044b":e+"-\u0456";case"D":return e+"-\u0433\u0430";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},HAuM:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},HDdC:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("7o/Q"),r=n("2QA8"),s=n("gRHU"),o=n("kJWO"),a=n("mCNh"),c=n("2fFW");let l=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){const{operator:o}=this,a=function(e,t,n){if(e){if(e instanceof i.a)return e;if(e[r.a])return e[r.a]()}return e||t||n?new i.a(e,t,n):new i.a(s.a)}(e,t,n);if(a.add(o?o.call(a,this.source):this.source||c.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),c.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a}_trySubscribe(e){try{return this._subscribe(e)}catch(t){c.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof i.a?n:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=u(t))((t,n)=>{let i;i=this.subscribe(t=>{try{e(t)}catch(r){n(r),i&&i.unsubscribe()}},n,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[o.a](){return this}pipe(...e){return 0===e.length?this:Object(a.b)(e)(this)}toPromise(e){return new(e=u(e))((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}}return e.create=t=>new e(t),e})();function u(e){if(e||(e=c.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},HH4o:function(e,t,n){var i=n("tiKp")("iterator"),r=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){r=!0}};o[i]=function(){return this},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var s={};s[i]=function(){return{next:function(){return{done:n=!0}}}},e(s)}catch(a){}return n}},HP3h:function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},r=function(e){return function(t,r,s,o){var a=n(t),c=i[e][n(t)];return 2===a&&(c=c[r?0:1]),c.replace(/%d/i,t)}},s=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},HYAF:function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},Hd5f:function(e,t,n){var i=n("0Dky"),r=n("tiKp"),s=n("LQDL"),o=r("species");e.exports=function(e){return s>=51||!i((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},Hicy:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));var i=n("8Y7J"),r=n("SVse"),s=function(){function e(e,t,n){this._el=e,this._ngZone=t,this.platformId=n,this.clickOutsideEnabled=!0,this.attachOutsideOnClick=!1,this.delayClickOutsideInit=!1,this.emitOnBlur=!1,this.exclude="",this.excludeBeforeClick=!1,this.clickOutsideEvents="",this.clickOutside=new i.o,this._nodesExcluded=[],this._events=["click"],this._initOnClickBody=this._initOnClickBody.bind(this),this._onClickBody=this._onClickBody.bind(this),this._onWindowBlur=this._onWindowBlur.bind(this)}return e.prototype.ngOnInit=function(){Object(r.I)(this.platformId)&&this._init()},e.prototype.ngOnDestroy=function(){Object(r.I)(this.platformId)&&(this._removeClickOutsideListener(),this._removeAttachOutsideOnClickListener(),this._removeWindowBlurListener())},e.prototype.ngOnChanges=function(e){Object(r.I)(this.platformId)&&(e.attachOutsideOnClick||e.exclude||e.emitOnBlur)&&this._init()},e.prototype._init=function(){""!==this.clickOutsideEvents&&(this._events=this.clickOutsideEvents.split(",").map((function(e){return e.trim()}))),this._excludeCheck(),this.attachOutsideOnClick?this._initAttachOutsideOnClickListener():this._initOnClickBody(),this.emitOnBlur&&this._initWindowBlurListener()},e.prototype._initOnClickBody=function(){this.delayClickOutsideInit?setTimeout(this._initClickOutsideListener.bind(this)):this._initClickOutsideListener()},e.prototype._excludeCheck=function(){if(this.exclude)try{var e=Array.from(document.querySelectorAll(this.exclude));e&&(this._nodesExcluded=e)}catch(t){console.error("[ng-click-outside] Check your exclude selector syntax.",t)}},e.prototype._onClickBody=function(e){this.clickOutsideEnabled&&(this.excludeBeforeClick&&this._excludeCheck(),this._el.nativeElement.contains(e.target)||this._shouldExclude(e.target)||(this._emit(e),this.attachOutsideOnClick&&this._removeClickOutsideListener()))},e.prototype._onWindowBlur=function(e){var t=this;setTimeout((function(){document.hidden||t._emit(e)}))},e.prototype._emit=function(e){var t=this;this.clickOutsideEnabled&&this._ngZone.run((function(){return t.clickOutside.emit(e)}))},e.prototype._shouldExclude=function(e){for(var t=0,n=this._nodesExcluded;t<n.length;t++)if(n[t].contains(e))return!0;return!1},e.prototype._initClickOutsideListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._events.forEach((function(t){return document.addEventListener(t,e._onClickBody)}))}))},e.prototype._removeClickOutsideListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._events.forEach((function(t){return document.removeEventListener(t,e._onClickBody)}))}))},e.prototype._initAttachOutsideOnClickListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._events.forEach((function(t){return e._el.nativeElement.addEventListener(t,e._initOnClickBody)}))}))},e.prototype._removeAttachOutsideOnClickListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._events.forEach((function(t){return e._el.nativeElement.removeEventListener(t,e._initOnClickBody)}))}))},e.prototype._initWindowBlurListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){window.addEventListener("blur",e._onWindowBlur)}))},e.prototype._removeWindowBlurListener=function(){var e=this;this._ngZone.runOutsideAngular((function(){window.removeEventListener("blur",e._onWindowBlur)}))},e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.A),i.Mb(i.C))},e.\u0275dir=i.Hb({type:e,selectors:[["","clickOutside",""]],inputs:{clickOutsideEnabled:"clickOutsideEnabled",attachOutsideOnClick:"attachOutsideOnClick",delayClickOutsideInit:"delayClickOutsideInit",emitOnBlur:"emitOnBlur",exclude:"exclude",excludeBeforeClick:"excludeBeforeClick",clickOutsideEvents:"clickOutsideEvents"},outputs:{clickOutside:"clickOutside"},features:[i.wb]}),e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e}(),o=function(){function e(){}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e}()},"I+eb":function(e,t,n){var i=n("2oRo"),r=n("Bs8V").f,s=n("kRJp"),o=n("busE"),a=n("zk60"),c=n("6JNq"),l=n("lMq5");e.exports=function(e,t){var n,u,d,h,f,p=e.target,m=e.global,b=e.stat;if(n=m?i:b?i[p]||a(p,{}):(i[p]||{}).prototype)for(u in t){if(h=t[u],d=e.noTargetGet?(f=r(n,u))&&f.value:n[u],!l(m?u:p+(b?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&s(h,"sham",!0),o(n,u,h,e)}}},I55L:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=e=>e&&"number"==typeof e.length&&"function"!=typeof e},I8vh:function(e,t,n){var i=n("ppGB"),r=Math.max,s=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):s(n,t)}},IBtZ:function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8_\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8_\u10db\u10d0\u10e0\u10e2\u10d8_\u10d0\u10de\u10e0\u10d8\u10da\u10d8_\u10db\u10d0\u10d8\u10e1\u10d8_\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8_\u10d8\u10d5\u10da\u10d8\u10e1\u10d8_\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd_\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8_\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8".split("_"),monthsShort:"\u10d8\u10d0\u10dc_\u10d7\u10d4\u10d1_\u10db\u10d0\u10e0_\u10d0\u10de\u10e0_\u10db\u10d0\u10d8_\u10d8\u10d5\u10dc_\u10d8\u10d5\u10da_\u10d0\u10d2\u10d5_\u10e1\u10d4\u10e5_\u10dd\u10e5\u10e2_\u10dc\u10dd\u10d4_\u10d3\u10d4\u10d9".split("_"),weekdays:{standalone:"\u10d9\u10d5\u10d8\u10e0\u10d0_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8_\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8".split("_"),format:"\u10d9\u10d5\u10d8\u10e0\u10d0\u10e1_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10e1_\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1".split("_"),isFormat:/(\u10ec\u10d8\u10dc\u10d0|\u10e8\u10d4\u10db\u10d3\u10d4\u10d2)/},weekdaysShort:"\u10d9\u10d5\u10d8_\u10dd\u10e0\u10e8_\u10e1\u10d0\u10db_\u10dd\u10d7\u10ee_\u10ee\u10e3\u10d7_\u10de\u10d0\u10e0_\u10e8\u10d0\u10d1".split("_"),weekdaysMin:"\u10d9\u10d5_\u10dd\u10e0_\u10e1\u10d0_\u10dd\u10d7_\u10ee\u10e3_\u10de\u10d0_\u10e8\u10d0".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u10d3\u10e6\u10d4\u10e1] LT[-\u10d6\u10d4]",nextDay:"[\u10ee\u10d5\u10d0\u10da] LT[-\u10d6\u10d4]",lastDay:"[\u10d2\u10e3\u10e8\u10d8\u10dc] LT[-\u10d6\u10d4]",nextWeek:"[\u10e8\u10d4\u10db\u10d3\u10d4\u10d2] dddd LT[-\u10d6\u10d4]",lastWeek:"[\u10ec\u10d8\u10dc\u10d0] dddd LT-\u10d6\u10d4",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(\u10ec\u10d0\u10db|\u10ec\u10e3\u10d7|\u10e1\u10d0\u10d0\u10d7|\u10ec\u10d4\u10da|\u10d3\u10e6|\u10d7\u10d5)(\u10d8|\u10d4)/,(function(e,t,n){return"\u10d8"===n?t+"\u10e8\u10d8":t+n+"\u10e8\u10d8"}))},past:function(e){return/(\u10ec\u10d0\u10db\u10d8|\u10ec\u10e3\u10d7\u10d8|\u10e1\u10d0\u10d0\u10d7\u10d8|\u10d3\u10e6\u10d4|\u10d7\u10d5\u10d4)/.test(e)?e.replace(/(\u10d8|\u10d4)$/,"\u10d8\u10e1 \u10ec\u10d8\u10dc"):/\u10ec\u10d4\u10da\u10d8/.test(e)?e.replace(/\u10ec\u10d4\u10da\u10d8$/,"\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc"):e},s:"\u10e0\u10d0\u10db\u10d3\u10d4\u10dc\u10d8\u10db\u10d4 \u10ec\u10d0\u10db\u10d8",ss:"%d \u10ec\u10d0\u10db\u10d8",m:"\u10ec\u10e3\u10d7\u10d8",mm:"%d \u10ec\u10e3\u10d7\u10d8",h:"\u10e1\u10d0\u10d0\u10d7\u10d8",hh:"%d \u10e1\u10d0\u10d0\u10d7\u10d8",d:"\u10d3\u10e6\u10d4",dd:"%d \u10d3\u10e6\u10d4",M:"\u10d7\u10d5\u10d4",MM:"%d \u10d7\u10d5\u10d4",y:"\u10ec\u10d4\u10da\u10d8",yy:"%d \u10ec\u10d4\u10da\u10d8"},dayOfMonthOrdinalParse:/0|1-\u10da\u10d8|\u10db\u10d4-\d{1,2}|\d{1,2}-\u10d4/,ordinal:function(e){return 0===e?e:1===e?e+"-\u10da\u10d8":e<20||e<=100&&e%20==0||e%100==0?"\u10db\u10d4-"+e:e+"-\u10d4"},week:{dow:1,doy:7}})}(n("wd/R"))},IZUe:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{constructor(e){this.elementRef=e,this.focus=!0}ngAfterViewInit(){const e=this.elementRef.nativeElement;this.focus&&r.a.isFunction(e.focus)&&e.focus()}set autofocus(e){r.a.isBoolean(e)?this.focus=e:r.a.isFunction(e)&&(this.focus=e())}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(s.m))},e.\u0275dir=s.Hb({type:e,selectors:[["","autofocus",""]],inputs:{autofocus:"autofocus"}}),e})()},Iab2:function(e,t,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function t(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){s(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(e,s,o){var a=r.URL||r.webkitURL,c=document.createElement("a");c.download=s=s||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?i(c):n(c.href)?t(e,s,o):i(c,c.target="_blank")):(c.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(c.href)}),4e4),setTimeout((function(){i(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,s){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,s),r);else if(n(e))t(e,r,s);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){i(o)}))}}:function(e,n,i,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,i);var o="application/octet-stream"===e.type,a=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&a)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},l.readAsDataURL(e)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(e);s?s.location=d:location.href=d,s=null,setTimeout((function(){u.revokeObjectURL(d)}),4e4)}});r.saveAs=s.saveAs=s,e.exports=s})?i.apply(t,[]):i)||(e.exports=r)},IheW:function(e,t,n){"use strict";n.d(t,"a",(function(){return C})),n.d(t,"b",(function(){return D})),n.d(t,"c",(function(){return $})),n.d(t,"d",(function(){return x})),n.d(t,"e",(function(){return m}));var i=n("8Y7J"),r=n("LRne"),s=n("HDdC"),o=n("bOdf"),a=n("pLZG"),c=n("lJxs"),l=n("SVse");class u{}class d{}class h{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const n=e.slice(0,t),i=n.toLowerCase(),r=e.slice(t+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let n=e[t];const i=t.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(t,i))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof h?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new h;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof h?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...n),this.headers.set(t,i);break;case"d":const r=e.value;if(r){let e=this.headers.get(t);if(!e)return;e=e.filter(e=>-1===r.indexOf(e)),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class f{encodeKey(e){return p(e)}encodeValue(e){return p(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function p(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class m{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new f,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const n=new Map;return e.length>0&&e.split("&").forEach(e=>{const i=e.indexOf("="),[r,s]=-1==i?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,i)),t.decodeValue(e.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const n=e.fromObject[t];this.map.set(t,Array.isArray(n)?n:[n])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new m({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat([e]),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const n=t.indexOf(e.value);-1!==n&&t.splice(n,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function b(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function g(e){return"undefined"!=typeof Blob&&e instanceof Blob}function _(e){return"undefined"!=typeof FormData&&e instanceof FormData}class y{constructor(e,t,n,i){let r;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new h),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const n=t.indexOf("?");this.urlWithParams=t+(-1===n?"?":n<t.length-1?"&":"")+e}}else this.params=new m,this.urlWithParams=t}serializeBody(){return null===this.body?null:b(this.body)||g(this.body)||_(this.body)||"string"==typeof this.body?this.body:this.body instanceof m?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||_(this.body)?null:g(this.body)?this.body.type||null:b(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof m?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||Array.isArray(this.body)?"application/json":null}clone(e={}){const t=e.method||this.method,n=e.url||this.url,i=e.responseType||this.responseType,r=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,o=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let a=e.headers||this.headers,c=e.params||this.params;return void 0!==e.setHeaders&&(a=Object.keys(e.setHeaders).reduce((t,n)=>t.set(n,e.setHeaders[n]),a)),e.setParams&&(c=Object.keys(e.setParams).reduce((t,n)=>t.set(n,e.setParams[n]),c)),new y(t,n,r,{params:c,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var v=function(e){return e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User",e}({});class w{constructor(e,t=200,n="OK"){this.headers=e.headers||new h,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||n,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class S extends w{constructor(e={}){super(e),this.type=v.ResponseHeader}clone(e={}){return new S({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class M extends w{constructor(e={}){super(e),this.type=v.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new M({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class x extends w{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(e.url||"(unknown url)"):`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function k(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let D=(()=>{class e{constructor(e){this.handler=e}request(e,t,n={}){let i;if(e instanceof y)i=e;else{let r=void 0;r=n.headers instanceof h?n.headers:new h(n.headers);let s=void 0;n.params&&(s=n.params instanceof m?n.params:new m({fromObject:n.params})),i=new y(e,t,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const s=Object(r.a)(i).pipe(Object(o.a)(e=>this.handler.handle(e)));if(e instanceof y||"events"===n.observe)return s;const l=s.pipe(Object(a.a)(e=>e instanceof M));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return l.pipe(Object(c.a)(e=>e.body))}case"response":return l;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new m).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,n={}){return this.request("PATCH",e,k(n,t))}post(e,t,n={}){return this.request("POST",e,k(n,t))}put(e,t,n={}){return this.request("PUT",e,k(n,t))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(u))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();class T{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const C=new i.r("HTTP_INTERCEPTORS");let O=(()=>{class e{intercept(e,t){return t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();const R=/^\)\]\}',?\n/;class L{}let E=(()=>{class e{constructor(){}build(){return new XMLHttpRequest}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),A=(()=>{class e{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new s.a(t=>{const n=this.xhrFactory.build();if(n.open(e.method,e.urlWithParams),e.withCredentials&&(n.withCredentials=!0),e.headers.forEach((e,t)=>n.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&n.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();n.responseType="json"!==t?t:"text"}const i=e.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const t=1223===n.status?204:n.status,i=n.statusText||"OK",s=new h(n.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(n)||e.url;return r=new S({headers:s,status:t,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),c=null;204!==r&&(c=void 0===n.response?n.responseText:n.response),0===r&&(r=c?200:0);let l=r>=200&&r<300;if("json"===e.responseType&&"string"==typeof c){const e=c;c=c.replace(R,"");try{c=""!==c?JSON.parse(c):null}catch(u){c=e,l&&(l=!1,c={error:u,text:c})}}l?(t.next(new M({body:c,headers:i,status:r,statusText:o,url:a||void 0})),t.complete()):t.error(new x({error:c,headers:i,status:r,statusText:o,url:a||void 0}))},a=e=>{const{url:i}=s(),r=new x({error:e,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});t.error(r)};let c=!1;const l=i=>{c||(t.next(s()),c=!0);let r={type:v.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===e.responseType&&n.responseText&&(r.partialText=n.responseText),t.next(r)},u=e=>{let n={type:v.UploadProgress,loaded:e.loaded};e.lengthComputable&&(n.total=e.total),t.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),e.reportProgress&&(n.addEventListener("progress",l),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),t.next({type:v.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("load",o),e.reportProgress&&(n.removeEventListener("progress",l),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return e.\u0275fac=function(t){return new(t||e)(i.dc(L))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();const I=new i.r("XSRF_COOKIE_NAME"),P=new i.r("XSRF_HEADER_NAME");class j{}let N=(()=>{class e{constructor(e,t,n){this.doc=e,this.platform=t,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Object(l.M)(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return e.\u0275fac=function(t){return new(t||e)(i.dc(l.d),i.dc(i.C),i.dc(I))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),F=(()=>{class e{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const n=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||n.startsWith("http://")||n.startsWith("https://"))return t.handle(e);const i=this.tokenService.getToken();return null===i||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,i)})),t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(j),i.dc(P))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),Y=(()=>{class e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(C,[]);this.chain=e.reduceRight((e,t)=>new T(e,t),this.backend)}return this.chain.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(d),i.dc(i.s))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),z=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:F,useClass:O}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:I,useValue:t.cookieName}:[],t.headerName?{provide:P,useValue:t.headerName}:[]]}}}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[F,{provide:C,useExisting:F,multi:!0},{provide:j,useClass:N},{provide:I,useValue:"XSRF-TOKEN"},{provide:P,useValue:"X-XSRF-TOKEN"}]}),e})(),$=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[D,{provide:u,useClass:Y},A,{provide:d,useExisting:A},E,{provide:L,useExisting:E}],imports:[[z.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e})()},IjjT:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));let i=(()=>{class e{constructor(t,n=e.now){this.SchedulerAction=t,this.now=n}schedule(e,t=0,n){return new this.SchedulerAction(this,e).schedule(n,t)}}return e.now=()=>Date.now(),e})();class r extends i{constructor(e,t=i.now){super(e,()=>r.delegate&&r.delegate!==this?r.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,n){return r.delegate&&r.delegate!==this?r.delegate.schedule(e,t,n):super.schedule(e,t,n)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}},ImZN:function(e,t,n){var i=n("glrk"),r=n("6VoE"),s=n("UMSQ"),o=n("A2ZE"),a=n("NaFW"),c=n("KmKo"),l=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var u,d,h,f,p,m,b,g=!(!n||!n.AS_ENTRIES),_=!(!n||!n.IS_ITERATOR),y=!(!n||!n.INTERRUPTED),v=o(t,n&&n.that,1+g+y),w=function(e){return u&&c(u),new l(!0,e)},S=function(e){return g?(i(e),y?v(e[0],e[1],w):v(e[0],e[1])):y?v(e,w):v(e)};if(_)u=e;else{if("function"!=typeof(d=a(e)))throw TypeError("Target is not iterable");if(r(d)){for(h=0,f=s(e.length);f>h;h++)if((p=S(e[h]))&&p instanceof l)return p;return new l(!1)}u=d.call(e)}for(m=u.next;!(b=m.call(u)).done;){try{p=S(b.value)}catch(M){throw c(u),M}if("object"==typeof p&&p&&p instanceof l)return p}return new l(!1)}},"Ivi+":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),monthsShort:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),weekdays:"\uc77c\uc694\uc77c_\uc6d4\uc694\uc77c_\ud654\uc694\uc77c_\uc218\uc694\uc77c_\ubaa9\uc694\uc77c_\uae08\uc694\uc77c_\ud1a0\uc694\uc77c".split("_"),weekdaysShort:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),weekdaysMin:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY\ub144 MMMM D\uc77c",LLL:"YYYY\ub144 MMMM D\uc77c A h:mm",LLLL:"YYYY\ub144 MMMM D\uc77c dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY\ub144 MMMM D\uc77c",lll:"YYYY\ub144 MMMM D\uc77c A h:mm",llll:"YYYY\ub144 MMMM D\uc77c dddd A h:mm"},calendar:{sameDay:"\uc624\ub298 LT",nextDay:"\ub0b4\uc77c LT",nextWeek:"dddd LT",lastDay:"\uc5b4\uc81c LT",lastWeek:"\uc9c0\ub09c\uc8fc dddd LT",sameElse:"L"},relativeTime:{future:"%s \ud6c4",past:"%s \uc804",s:"\uba87 \ucd08",ss:"%d\ucd08",m:"1\ubd84",mm:"%d\ubd84",h:"\ud55c \uc2dc\uac04",hh:"%d\uc2dc\uac04",d:"\ud558\ub8e8",dd:"%d\uc77c",M:"\ud55c \ub2ec",MM:"%d\ub2ec",y:"\uc77c \ub144",yy:"%d\ub144"},dayOfMonthOrdinalParse:/\d{1,2}(\uc77c|\uc6d4|\uc8fc)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\uc77c";case"M":return e+"\uc6d4";case"w":case"W":return e+"\uc8fc";default:return e}},meridiemParse:/\uc624\uc804|\uc624\ud6c4/,isPM:function(e){return"\uc624\ud6c4"===e},meridiem:function(e,t,n){return e<12?"\uc624\uc804":"\uc624\ud6c4"}})}(n("wd/R"))},IzCI:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1024,["B/s","kB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"])}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(i.a))},e.\u0275pipe=r.Lb({name:"dimlessBinaryPerSecond",type:e,pure:!0}),e})()},IzEk:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("7o/Q"),r=n("4I5i"),s=n("EY2u");function o(e){return t=>0===e?Object(s.b)():t.lift(new a(e))}class a{constructor(e){if(this.total=e,this.total<0)throw new r.a}call(e,t){return t.subscribe(new c(e,this.total))}}class c extends i.a{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}},IzLi:function(e,t,n){"use strict";t.a=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},JBy8:function(e,t,n){var i=n("yoRg"),r=n("eDl+").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},"JCF/":function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},i=["\u06a9\u0627\u0646\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0634\u0648\u0628\u0627\u062a","\u0626\u0627\u0632\u0627\u0631","\u0646\u06cc\u0633\u0627\u0646","\u0626\u0627\u06cc\u0627\u0631","\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646","\u062a\u06d5\u0645\u0645\u0648\u0632","\u0626\u0627\u0628","\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644","\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u0643\u06d5\u0645","\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0643\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"];e.defineLocale("ku",{months:i,monthsShort:i,weekdays:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u062f\u0648\u0648\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0633\u06ce\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysShort:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645_\u062f\u0648\u0648\u0634\u0647\u200c\u0645_\u0633\u06ce\u0634\u0647\u200c\u0645_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u0647_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c|\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc/,isPM:function(e){return/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c/.test(e)},meridiem:function(e,t,n){return e<12?"\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc":"\u0626\u06ce\u0648\u0627\u0631\u0647\u200c"},calendar:{sameDay:"[\u0626\u0647\u200c\u0645\u0631\u06c6 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextDay:"[\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastDay:"[\u062f\u0648\u06ce\u0646\u06ce \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",sameElse:"L"},relativeTime:{future:"\u0644\u0647\u200c %s",past:"%s",s:"\u0686\u0647\u200c\u0646\u062f \u0686\u0631\u0643\u0647\u200c\u06cc\u0647\u200c\u0643",ss:"\u0686\u0631\u0643\u0647\u200c %d",m:"\u06cc\u0647\u200c\u0643 \u062e\u0648\u0644\u0647\u200c\u0643",mm:"%d \u062e\u0648\u0644\u0647\u200c\u0643",h:"\u06cc\u0647\u200c\u0643 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",hh:"%d \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",d:"\u06cc\u0647\u200c\u0643 \u0695\u06c6\u0698",dd:"%d \u0695\u06c6\u0698",M:"\u06cc\u0647\u200c\u0643 \u0645\u0627\u0646\u06af",MM:"%d \u0645\u0627\u0646\u06af",y:"\u06cc\u0647\u200c\u0643 \u0633\u0627\u06b5",yy:"%d \u0633\u0627\u06b5"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},JIr8:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("zx2A");function r(e){return function(t){const n=new s(e),i=t.lift(n);return n.caught=i}}class s{constructor(e){this.selector=e}call(e,t){return t.subscribe(new o(e,this.selector,this.caught))}}class o extends i.b{constructor(e,t,n){super(e),this.selector=t,this.caught=n}error(e){if(!this.isStopped){let n;try{n=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const r=new i.a(this);this.add(r);const s=Object(i.c)(n,r);s!==r&&this.add(s)}}}},"JK/P":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("G0yt");let s=(()=>{class e{constructor(e){this.modal=e}show(e,t,n){const i=this.modal.open(e,n);return t&&Object.assign(i.componentInstance,t),i}dismissAll(){this.modal.dismissAll()}hasOpenModals(){return this.modal.hasOpenModals()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(r.o))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},JP8w:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("G0yt");let s=(()=>{class e{constructor(e){this.nav=e,this.localStorage=window.localStorage}ngOnInit(){const e=this.localStorage.getItem("tabset_"+this.cdStatefulTab);e&&this.nav.select(e)}onNavChange(e){this.cdStatefulTab&&e.nextId&&this.localStorage.setItem("tabset_"+this.cdStatefulTab,e.nextId)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(r.p,9))},e.\u0275dir=i.Hb({type:e,selectors:[["","cdStatefulTab",""]],hostBindings:function(e,t){1&e&&i.gc("navChange",(function(e){return t.onNavChange(e)}))},inputs:{cdStatefulTab:"cdStatefulTab"}}),e})()},JVSJ:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=e+" ";switch(n){case"ss":return i+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return i+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return i+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return i+(1===e?"dan":"dana");case"MM":return i+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return i+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[pro\u0161lu] dddd [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},JX91:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("GyhO"),r=n("z+Ro");function s(...e){const t=e[e.length-1];return Object(r.a)(t)?(e.pop(),n=>Object(i.a)(e,n,t)):t=>Object(i.a)(e,t)}},Js68:function(e,t,n){"use strict";t.a=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},"Ju5/":function(e,t,n){"use strict";var i=n("XqMk"),r="object"==typeof self&&self&&self.Object===Object&&self,s=i.a||r||Function("return this")();t.a=s},JvlW:function(e,t,n){!function(e){"use strict";var t={ss:"sekund\u0117_sekund\u017ei\u0173_sekundes",m:"minut\u0117_minut\u0117s_minut\u0119",mm:"minut\u0117s_minu\u010di\u0173_minutes",h:"valanda_valandos_valand\u0105",hh:"valandos_valand\u0173_valandas",d:"diena_dienos_dien\u0105",dd:"dienos_dien\u0173_dienas",M:"m\u0117nuo_m\u0117nesio_m\u0117nes\u012f",MM:"m\u0117nesiai_m\u0117nesi\u0173_m\u0117nesius",y:"metai_met\u0173_metus",yy:"metai_met\u0173_metus"};function n(e,t,n,i){return t?r(n)[0]:i?r(n)[1]:r(n)[2]}function i(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,o){var a=e+" ";return 1===e?a+n(0,t,s[0],o):t?a+(i(e)?r(s)[1]:r(s)[0]):o?a+r(s)[1]:a+(i(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_baland\u017eio_gegu\u017e\u0117s_bir\u017eelio_liepos_rugpj\u016b\u010dio_rugs\u0117jo_spalio_lapkri\u010dio_gruod\u017eio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegu\u017e\u0117_bir\u017eelis_liepa_rugpj\u016btis_rugs\u0117jis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadien\u012f_pirmadien\u012f_antradien\u012f_tre\u010diadien\u012f_ketvirtadien\u012f_penktadien\u012f_\u0161e\u0161tadien\u012f".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_tre\u010diadienis_ketvirtadienis_penktadienis_\u0161e\u0161tadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_\u0160e\u0161".split("_"),weekdaysMin:"S_P_A_T_K_Pn_\u0160".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[\u0160iandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Pra\u0117jus\u012f] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prie\u0161 %s",s:function(e,t,n,i){return t?"kelios sekund\u0117s":i?"keli\u0173 sekund\u017ei\u0173":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("wd/R"))},"K/tc":function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},KSF8:function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"th\xe1ng 1_th\xe1ng 2_th\xe1ng 3_th\xe1ng 4_th\xe1ng 5_th\xe1ng 6_th\xe1ng 7_th\xe1ng 8_th\xe1ng 9_th\xe1ng 10_th\xe1ng 11_th\xe1ng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"ch\u1ee7 nh\u1eadt_th\u1ee9 hai_th\u1ee9 ba_th\u1ee9 t\u01b0_th\u1ee9 n\u0103m_th\u1ee9 s\xe1u_th\u1ee9 b\u1ea3y".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [n\u0103m] YYYY",LLL:"D MMMM [n\u0103m] YYYY HH:mm",LLLL:"dddd, D MMMM [n\u0103m] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[H\xf4m nay l\xfac] LT",nextDay:"[Ng\xe0y mai l\xfac] LT",nextWeek:"dddd [tu\u1ea7n t\u1edbi l\xfac] LT",lastDay:"[H\xf4m qua l\xfac] LT",lastWeek:"dddd [tu\u1ea7n tr\u01b0\u1edbc l\xfac] LT",sameElse:"L"},relativeTime:{future:"%s t\u1edbi",past:"%s tr\u01b0\u1edbc",s:"v\xe0i gi\xe2y",ss:"%d gi\xe2y",m:"m\u1ed9t ph\xfat",mm:"%d ph\xfat",h:"m\u1ed9t gi\u1edd",hh:"%d gi\u1edd",d:"m\u1ed9t ng\xe0y",dd:"%d ng\xe0y",w:"m\u1ed9t tu\u1ea7n",ww:"%d tu\u1ea7n",M:"m\u1ed9t th\xe1ng",MM:"%d th\xe1ng",y:"m\u1ed9t n\u0103m",yy:"%d n\u0103m"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},KTz0:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedjelje] [u] LT","[pro\u0161log] [ponedjeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srijede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},KmKo:function(e,t,n){var i=n("glrk");e.exports=function(e){var t=e.return;if(void 0!==t)return i(t.call(e)).value}},Kqap:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e,t){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(e,t,n))}}class s{constructor(e,t,n=!1){this.accumulator=e,this.seed=t,this.hasSeed=n}call(e,t){return t.subscribe(new o(e,this.accumulator,this.seed,this.hasSeed))}}class o extends i.a{constructor(e,t,n,i){super(e),this.accumulator=t,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let n;try{n=this.accumulator(this.seed,e,t)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}},KqfI:function(e,t,n){"use strict";function i(){}n.d(t,"a",(function(){return i}))},L3Qv:function(e,t,n){"use strict";t.a=function(){return!1}},LQDL:function(e,t,n){var i,r,s=n("2oRo"),o=n("NC/Y"),a=s.process,c=a&&a.versions,l=c&&c.v8;l?r=(i=l.split("."))[0]<4?1:i[0]+i[1]:o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(r=i[1]),e.exports=r&&+r},LRne:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("z+Ro"),r=n("yCtX"),s=n("jZKg");function o(...e){let t=e[e.length-1];return Object(i.a)(t)?(e.pop(),Object(s.a)(e,t)):Object(r.a)(e)}},LceX:function(e,t,n){"use strict";n.r(t),n.d(t,"AuthModule",(function(){return Qe})),n.d(t,"RoutedAuthModule",(function(){return Ze}));var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("zWsK"),c=n("sne2"),l=n("PCNd"),u=n("LvDl"),d=n.n(u),h=n("cp0P"),f=n("LRne"),p=n("5+tZ"),m=n("8Y7J"),b=n("IheW");let g=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("api/role")}delete(e){return this.http.delete("api/role/"+e)}get(e){return this.http.get("api/role/"+e)}create(e){return this.http.post("api/role",e)}clone(e,t){return this.http.post(`api/role/${e}/clone`,{new_name:t})}update(e){return this.http.put("api/role/"+e.name,e)}exists(e){return this.list().pipe(Object(p.a)(t=>{const n=t.some(t=>t.name===e);return Object(f.a)(n)}))}}return e.\u0275fac=function(t){return new(t||e)(m.dc(b.b))},e.\u0275prov=m.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),_=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("ui-api/scope")}}return e.\u0275fac=function(t){return new(t||e)(m.dc(b.b))},e.\u0275prov=m.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var y=n("mtw6"),v=n("spCT"),w=n("QFaf"),S=n("1Ni5"),M=n("9nlD"),x=function(e){return e.editing="editing",e}({});class k{}var D=n("zc8c"),T=n("NwgZ"),C=n("ocLN"),O=n("ANnk"),R=n("f69J"),L=n("IZUe"),E=n("uIqm"),A=n("6+kj"),I=n("8xTl");const P=["headerPermissionCheckboxTpl"],j=["cellScopeCheckboxTpl"],N=["cellPermissionCheckboxTpl"];function F(e,t){1&e&&(m.Sb(0,"span",27),m.Wb(1,28),m.Rb())}function Y(e,t){1&e&&(m.Sb(0,"span",27),m.Wb(1,29),m.Rb())}const z=function(e){return{required:e}};function $(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",4),m.Sb(1,"form",5,6),m.Sb(3,"div",7),m.Sb(4,"div",8),m.Wb(5,9),m.jc(6,"titlecase"),m.jc(7,"upperFirst"),m.Rb(),m.Sb(8,"div",10),m.Sb(9,"div",11),m.Sb(10,"label",12),m.Wb(11,13),m.Rb(),m.Sb(12,"div",14),m.Sb(13,"input",15),m.Yb(14,16),m.Rb(),m.Mc(15,F,2,0,"span",17),m.Mc(16,Y,2,0,"span",17),m.Rb(),m.Rb(),m.Sb(17,"div",11),m.Sb(18,"label",18),m.Wb(19,19),m.Rb(),m.Sb(20,"div",14),m.Sb(21,"input",20),m.Yb(22,21),m.Rb(),m.Rb(),m.Rb(),m.Sb(23,"div",11),m.Sb(24,"label",22),m.Wb(25,23),m.Rb(),m.Sb(26,"div",14),m.Nb(27,"cd-table",24),m.Rb(),m.Rb(),m.Rb(),m.Sb(28,"div",25),m.Sb(29,"cd-form-button-panel",26),m.gc("submitActionEvent",(function(){return m.Dc(e),m.ic().submit()})),m.jc(30,"titlecase"),m.jc(31,"upperFirst"),m.Rb(),m.Rb(),m.Rb(),m.Rb(),m.Rb()}if(2&e){const e=m.Ac(2),t=m.ic();m.yb(1),m.pc("formGroup",t.roleForm),m.yb(6),m.ac(m.kc(6,15,t.action))(m.kc(7,17,t.resource)),m.Xb(5),m.yb(3),m.pc("ngClass",m.uc(23,z,t.mode!==t.roleFormMode.editing)),m.yb(5),m.pc("ngIf",t.roleForm.showError("name",e,"required")),m.yb(1),m.pc("ngIf",t.roleForm.showError("name",e,"notUnique")),m.yb(11),m.pc("data",t.scopes_permissions)("columns",t.columns)("toolHeader",!1)("autoReload",!1)("autoSave",!1)("footer",!1)("limit",0),m.yb(2),m.pc("form",t.roleForm)("submitText",m.kc(30,19,t.action)+" "+m.kc(31,21,t.resource))}}function H(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",30),m.Sb(1,"input",31),m.gc("change",(function(n){m.Dc(e);const i=t.row,r=t.column;return m.ic().onClickCellCheckbox(i.scope,r.prop,n)})),m.Rb(),m.Sb(2,"label",32),m.Oc(3),m.Rb(),m.Rb()}if(2&e){const e=t.row,n=t.value,i=m.ic();m.yb(1),m.rc("id","scope_",e.scope,""),m.pc("checked",i.isRowChecked(e.scope)),m.yb(1),m.rc("for","scope_",e.scope,""),m.yb(1),m.Pc(n)}}function W(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",30),m.Sb(1,"input",33),m.gc("change",(function(n){m.Dc(e);const i=t.row,r=t.column;return m.ic().onClickCellCheckbox(i.scope,r.prop,n)})),m.Rb(),m.Nb(2,"label",34),m.Rb()}if(2&e){const e=t.column,n=t.row,i=t.value;m.yb(1),m.pc("checked",i)("id",n.scope+"-"+e.prop),m.yb(1),m.pc("for",n.scope+"-"+e.prop)}}function V(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",30),m.Sb(1,"input",31),m.gc("change",(function(n){m.Dc(e);const i=t.column;return m.ic().onClickHeaderCheckbox(i.prop,n)})),m.Rb(),m.Sb(2,"label",35),m.Oc(3),m.Rb(),m.Rb()}if(2&e){const e=t.column,n=m.ic();m.yb(1),m.rc("id","header_",e.prop,""),m.pc("checked",n.isHeaderChecked(e.prop)),m.yb(1),m.rc("for","header_",e.prop,""),m.yb(1),m.Pc(e.name)}}let B=(()=>{class e extends v.a{constructor(e,t,n,i,r,s){super(),this.route=e,this.router=t,this.roleService=n,this.scopeService=i,this.notificationService=r,this.actionLabels=s,this.scopes=[],this.scopes_permissions=[],this.roleFormMode=x,this.resource="role",this.createForm(),this.listenToChanges()}createForm(){this.roleForm=new w.a({name:new r.h("",{validators:[r.A.required],asyncValidators:[S.a.unique(this.roleService.exists,this.roleService)]}),description:new r.h(""),scopes_permissions:new r.h({})})}ngOnInit(){this.columns=[{prop:"scope",name:"All",flexGrow:2,cellTemplate:this.cellScopeCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"read",name:"Read",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"create",name:"Create",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"update",name:"Update",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"delete",name:"Delete",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl}],this.router.url.startsWith("/user-management/roles/edit")?(this.mode=this.roleFormMode.editing,this.action=this.actionLabels.EDIT):this.action=this.actionLabels.CREATE,this.mode===this.roleFormMode.editing?this.initEdit():this.initCreate()}initCreate(){this.scopeService.list().subscribe(e=>{this.scopes=e,this.roleForm.get("scopes_permissions").setValue({}),this.loadingReady()})}initEdit(){this.roleForm.get("name").disable(),this.route.params.subscribe(e=>{const t=[];t.push(this.scopeService.list()),t.push(this.roleService.get(e.name)),Object(h.a)(t).subscribe(e=>{this.scopes=e[0],["name","description","scopes_permissions"].forEach(t=>this.roleForm.get(t).setValue(e[1][t])),this.loadingReady()})})}listenToChanges(){this.roleForm.get("scopes_permissions").valueChanges.subscribe(e=>{const t=[];d.a.each(this.scopes,n=>{const i={read:!1,create:!1,update:!1,delete:!1};i.scope=n,n in e&&d.a.each(e[n],e=>{i[e]=!0}),t.push(i)}),this.scopes_permissions=t})}isRowChecked(e){const t=d.a.find(this.scopes_permissions,t=>t.scope===e);return!d.a.isUndefined(t)&&t.read&&t.create&&t.update&&t.delete}isHeaderChecked(e){let t=[e];return"scope"===e&&(t=["read","create","update","delete"]),t.every(e=>this.scopes_permissions.every(t=>t[e]))}onClickCellCheckbox(e,t,n=null){const i=d.a.cloneDeep(this.roleForm.getValue("scopes_permissions"));let r=[t];"scope"===t&&(r=["read","create","update","delete"]),e in i||(i[e]=[]),n&&n.target.checked||!d.a.isEqual(r.sort(),d.a.intersection(i[e],r).sort())?i[e]=d.a.union(i[e],r):(i[e]=d.a.difference(i[e],r),d.a.isEmpty(i[e])&&d.a.unset(i,e)),this.roleForm.get("scopes_permissions").setValue(i)}onClickHeaderCheckbox(e,t){const n=d.a.cloneDeep(this.roleForm.getValue("scopes_permissions"));let i=[e];"scope"===e&&(i=["read","create","update","delete"]),d.a.each(i,e=>{d.a.each(this.scopes,i=>{t.target.checked?n[i]=d.a.union(n[i],[e]):(n[i]=d.a.difference(n[i],[e]),d.a.isEmpty(n[i])&&d.a.unset(n,i))})}),this.roleForm.get("scopes_permissions").setValue(n)}getRequest(){const e=new k;return["name","description","scopes_permissions"].forEach(t=>e[t]=this.roleForm.get(t).value),e}createAction(){const e=this.getRequest();this.roleService.create(e).subscribe(()=>{this.notificationService.show(y.a.success,"Created role '" + e.name + "'"),this.router.navigate(["/user-management/roles"])},()=>{this.roleForm.setErrors({cdSubmitButton:!0})})}editAction(){const e=this.getRequest();this.roleService.update(e).subscribe(()=>{this.notificationService.show(y.a.success,"Updated role '" + e.name + "'"),this.router.navigate(["/user-management/roles"])},()=>{this.roleForm.setErrors({cdSubmitButton:!0})})}submit(){this.mode===this.roleFormMode.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(s.a),m.Mb(s.e),m.Mb(g),m.Mb(_),m.Mb(M.a),m.Mb(c.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-role-form"]],viewQuery:function(e,t){var n;1&e&&(m.Jc(P,!0),m.Jc(j,!0),m.Jc(N,!0)),2&e&&(m.zc(n=m.hc())&&(t.headerPermissionCheckboxTpl=n.first),m.zc(n=m.hc())&&(t.cellScopeCheckboxTpl=n.first),m.zc(n=m.hc())&&(t.cellPermissionCheckboxTpl=n.first))},features:[m.vb],decls:7,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],["cellScopeCheckboxTpl",""],["cellPermissionCheckboxTpl",""],["headerPermissionCheckboxTpl",""],[1,"cd-col-form"],["name","roleForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label",3,"ngClass"],"Name",[1,"cd-col-form-input"],["type","text","id","name","name","name","formControlName","name","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","description",1,"cd-col-form-label"],"Description",["type","text","id","description","name","description","formControlName","description",1,"form-control",6,"placeholder"],["placeholder","Description..."],[1,"cd-col-form-label"],"Permissions",["columnMode","flex",3,"data","columns","toolHeader","autoReload","autoSave","footer","limit"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The chosen name is already in use.",[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","checked","change"],[1,"datatable-permissions-scope-cell-label","custom-control-label",3,"for"],["type","checkbox",1,"custom-control-input",3,"checked","id","change"],[1,"custom-control-label",3,"for"],[1,"datatable-permissions-header-cell-label","custom-control-label",3,"for"]]},template:function(e,t){1&e&&(m.Mc(0,$,32,25,"div",0),m.Mc(1,H,4,4,"ng-template",null,1,m.Nc),m.Mc(3,W,3,3,"ng-template",null,2,m.Nc),m.Mc(5,V,4,4,"ng-template",null,3,m.Nc)),2&e&&m.pc("cdFormLoading",t.loading)},directives:[D.a,r.C,r.r,r.k,T.a,C.a,i.p,O.a,r.d,R.a,r.q,r.i,L.a,i.r,E.a,A.a],pipes:[i.A,I.a],styles:[".datatable-permissions-header-cell-label[_ngcontent-%COMP%], .datatable-permissions-scope-cell-label[_ngcontent-%COMP%]{font-weight:700}"]}),e})();var U=n("+fVR"),G=n("0+/T"),q=n("Rf2I"),J=n("x38r"),Q=n("oxzT"),K=n("vCyI"),Z=n("nSDx"),X=n("aexS"),ee=n("JK/P"),te=n("EgGo");let ne=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(s.e))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-user-tabs"]],decls:8,vars:1,consts:function(){return[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/user-management/users"],["ngbNavLink",""],"Users",["ngbNavItem","/user-management/roles"],"Roles"]},template:function(e,t){1&e&&(m.Sb(0,"ul",0,1),m.gc("navChange",(function(e){return t.router.navigate([e.nextId])})),m.Sb(2,"li",2),m.Sb(3,"a",3),m.Wb(4,4),m.Rb(),m.Rb(),m.Sb(5,"li",5),m.Sb(6,"a",3),m.Wb(7,6),m.Rb(),m.Rb(),m.Rb()),2&e&&m.pc("activeId",t.router.url)},directives:[o.p,o.r,o.s],styles:[""]}),e})();var ie=n("S7zO");function re(e,t){if(1&e&&(m.Qb(0),m.Nb(1,"cd-table",1),m.Pb()),2&e){const e=m.ic();m.yb(1),m.pc("data",e.scopes_permissions)("columns",e.columns)("toolHeader",!1)("autoReload",!1)("autoSave",!1)("footer",!1)("limit",0)}}let se=(()=>{class e{constructor(){this.scopes_permissions=[]}ngOnInit(){this.columns=[{prop:"scope",name:"Scope",flexGrow:2},{prop:"read",name:"Read",flexGrow:1,cellClass:"text-center",cellTransformation:J.a.checkIcon},{prop:"create",name:"Create",flexGrow:1,cellClass:"text-center",cellTransformation:J.a.checkIcon},{prop:"update",name:"Update",flexGrow:1,cellClass:"text-center",cellTransformation:J.a.checkIcon},{prop:"delete",name:"Delete",flexGrow:1,cellClass:"text-center",cellTransformation:J.a.checkIcon}]}ngOnChanges(){if(this.selection){this.selectedItem=this.selection;const e=[];d.a.each(this.scopes,t=>{const n={read:!1,create:!1,update:!1,delete:!1};n.scope=t,t in this.selectedItem.scopes_permissions&&d.a.each(this.selectedItem.scopes_permissions[t],e=>{n[e]=!0}),e.push(n)}),this.scopes_permissions=e}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-role-details"]],inputs:{selection:"selection",scopes:"scopes"},features:[m.wb],decls:1,vars:1,consts:[[4,"ngIf"],["columnMode","flex",3,"data","columns","toolHeader","autoReload","autoSave","footer","limit"]],template:function(e,t){1&e&&m.Mc(0,re,2,7,"ng-container",0),2&e&&m.pc("ngIf",t.selection)},directives:[i.r,E.a],styles:[".fa[_ngcontent-%COMP%]{font-size:large}.fa.fa-square-o[_ngcontent-%COMP%]{color:#ced4da}"]}),e})(),oe=(()=>{class e extends U.a{constructor(e,t,n,i,r,s,o,a){super(),this.roleService=e,this.scopeService=t,this.emptyPipe=n,this.authStorageService=i,this.modalService=r,this.notificationService=s,this.urlBuilder=o,this.actionLabels=a,this.selection=new K.a,this.permission=this.authStorageService.getPermissions().user,this.tableActions=[{permission:"create",icon:Q.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"create",icon:Q.a.clone,name:this.actionLabels.CLONE,disable:()=>!this.selection.hasSingleSelection,click:()=>this.cloneRole()},{permission:"update",icon:Q.a.edit,disable:()=>!this.selection.hasSingleSelection||this.selection.first().system,routerLink:()=>this.selection.first()&&this.urlBuilder.getEdit(this.selection.first().name),name:this.actionLabels.EDIT},{permission:"delete",icon:Q.a.destroy,disable:()=>!this.selection.hasSingleSelection||this.selection.first().system,click:()=>this.deleteRoleModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:3},{name:"Description",prop:"description",flexGrow:5,pipe:this.emptyPipe},{name:"System Role",prop:"system",cellClass:"text-center",flexGrow:1,cellTransformation:J.a.checkIcon}]}getRoles(){Object(h.a)([this.roleService.list(),this.scopeService.list()]).subscribe(e=>{this.roles=e[0],this.scopes=e[1]})}updateSelection(e){this.selection=e}deleteRole(e){this.roleService.delete(e).subscribe(()=>{this.getRoles(),this.modalRef.close(),this.notificationService.show(y.a.success,"Deleted role '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}deleteRoleModal(){const e=this.selection.first().name;this.modalRef=this.modalService.show(G.a,{itemDescription:"Role",itemNames:[e],submitAction:()=>this.deleteRole(e)})}cloneRole(){const e=this.selection.first().name;this.modalRef=this.modalService.show(q.a,{fields:[{type:"text",name:"newName",value:e+"_clone",label:"New name",required:!0}],titleText:"Clone Role",submitButtonText:"Clone Role",onSubmit:t=>{this.roleService.clone(e,t.newName).subscribe(()=>{this.getRoles(),this.notificationService.show(y.a.success,"Cloned role '" + t.newName + "' from '" + e + "'")})}})}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(g),m.Mb(_),m.Mb(Z.a),m.Mb(X.a),m.Mb(ee.a),m.Mb(M.a),m.Mb(te.a),m.Mb(c.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-role-list"]],features:[m.xb([{provide:te.a,useValue:new te.a("user-management/roles")}]),m.vb],decls:4,vars:8,consts:[["columnMode","flex","identifier","name","selectionType","single",3,"data","columns","hasDetails","setExpandedRow","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection","scopes"]],template:function(e,t){1&e&&(m.Nb(0,"cd-user-tabs"),m.Sb(1,"cd-table",0),m.gc("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("fetchData",(function(){return t.getRoles()}))("updateSelection",(function(e){return t.updateSelection(e)})),m.Nb(2,"cd-table-actions",1),m.Nb(3,"cd-role-details",2),m.Rb()),2&e&&(m.yb(1),m.pc("data",t.roles)("columns",t.columns)("hasDetails",!0),m.yb(1),m.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),m.yb(1),m.pc("selection",t.expandedRow)("scopes",t.scopes))},directives:[ne,E.a,ie.a,se],styles:[""]}),e})();var ae=n("wd/R"),ce=n.n(ae),le=n("DSvg"),ue=n("20UP"),de=n("Mxhz"),he=n("OLbh"),fe=n("DNAf"),pe=n("2EZI"),me=n("oMSZ"),be=n("1nQr"),ge=function(e){return e.editing="editing",e}({});class _e{}var ye=n("D4zM"),ve=n("p4Cf"),we=n("ppaS"),Se=n("MAOJ");const Me=["removeSelfUserReadUpdatePermissionTpl"];function xe(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,29),m.Rb())}function ke(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,30),m.Rb())}function De(e,t){if(1&e&&m.Nb(0,"cd-helper",40),2&e){const e=m.ic(3);m.qc("html",e.passwordPolicyHelpText)}}function Te(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,41),m.Rb())}function Ce(e,t){if(1&e&&(m.Sb(0,"span",28),m.Oc(1),m.Rb()),2&e){const e=m.ic(3);m.yb(1),m.Qc(" ",e.passwordValuation," ")}}function Oe(e,t){if(1&e&&(m.Sb(0,"div",10),m.Sb(1,"label",31),m.Qb(2),m.Wb(3,32),m.Pb(),m.Mc(4,De,1,1,"cd-helper",33),m.Rb(),m.Sb(5,"div",13),m.Sb(6,"div",34),m.Nb(7,"input",35),m.Sb(8,"span",36),m.Nb(9,"button",37),m.Rb(),m.Rb(),m.Sb(10,"div",38),m.Nb(11,"div",39),m.Rb(),m.Mc(12,Te,2,0,"span",15),m.Mc(13,Ce,2,1,"span",15),m.Rb(),m.Rb()),2&e){m.ic();const e=m.Ac(2),t=m.ic();m.yb(4),m.pc("ngIf",t.passwordPolicyHelpText.length>0),m.yb(7),m.Ab(t.passwordStrengthLevelClass),m.qc("title",t.passwordValuation),m.yb(1),m.pc("ngIf",t.userForm.showError("password",e,"required")),m.yb(1),m.pc("ngIf",t.userForm.showError("password",e,"passwordPolicy"))}}function Re(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,46),m.Rb())}function Le(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,47),m.Rb())}function Ee(e,t){if(1&e&&(m.Sb(0,"div",10),m.Sb(1,"label",42),m.Wb(2,43),m.Rb(),m.Sb(3,"div",13),m.Sb(4,"div",34),m.Nb(5,"input",44),m.Sb(6,"span",36),m.Nb(7,"button",45),m.Rb(),m.Mc(8,Re,2,0,"span",15),m.Rb(),m.Mc(9,Le,2,0,"span",15),m.Rb(),m.Rb()),2&e){m.ic();const e=m.Ac(2),t=m.ic();m.yb(8),m.pc("ngIf",t.userForm.showError("confirmpassword",e,"match")),m.yb(1),m.pc("ngIf",t.userForm.showError("confirmpassword",e,"required"))}}function Ae(e,t){1&e&&(m.Sb(0,"cd-helper",55),m.Sb(1,"p"),m.Oc(2," The Dashboard setting defining the expiration interval of passwords is currently set to "),m.Sb(3,"strong"),m.Oc(4,"0"),m.Rb(),m.Oc(5,". This means if a date is set, the user password will only expire once. "),m.Rb(),m.Sb(6,"p"),m.Oc(7," Consider configuring the Dashboard setting "),m.Sb(8,"a",56),m.Oc(9,"USER_PWD_EXPIRATION_SPAN"),m.Rb(),m.Oc(10," in order to let passwords expire periodically. "),m.Rb(),m.Rb())}function Ie(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,57),m.Rb())}const Pe=function(e){return{required:e}};function je(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",10),m.Sb(1,"label",48),m.Qb(2),m.Wb(3,49),m.Pb(),m.Mc(4,Ae,11,0,"cd-helper",50),m.Rb(),m.Sb(5,"div",13),m.Sb(6,"div",34),m.Sb(7,"input",51,52),m.Yb(9,53),m.gc("click",(function(){return m.Dc(e),m.Ac(8).open()}))("keypress",(function(){return m.Dc(e),m.Ac(8).close()})),m.Rb(),m.Sb(10,"span",36),m.Sb(11,"button",54),m.gc("click",(function(){return m.Dc(e),m.ic(2).clearExpirationDate()})),m.Nb(12,"i"),m.Rb(),m.Rb(),m.Mc(13,Ie,2,0,"span",15),m.Rb(),m.Rb(),m.Rb()}if(2&e){m.ic();const e=m.Ac(2),t=m.ic(),n=m.Ac(4);m.yb(1),m.pc("ngClass",m.uc(7,Pe,t.pwdExpirationSettings.pwdExpirationSpan>0)),m.yb(3),m.pc("ngIf",0==t.pwdExpirationSettings.pwdExpirationSpan),m.yb(3),m.pc("ngbPopover",n),m.yb(5),m.Bb("icon-prepend ",t.icons.destroy,""),m.yb(1),m.pc("ngIf",t.userForm.showError("pwdExpirationDate",e,"required"))}}function Ne(e,t){1&e&&(m.Sb(0,"span",28),m.Wb(1,58),m.Rb())}function Fe(e,t){if(1&e&&(m.Sb(0,"span",59),m.Nb(1,"cd-select-badges",60),m.Rb()),2&e){const e=m.ic(2);m.yb(1),m.pc("data",e.userForm.controls.roles.value)("options",e.allRoles)("messages",e.messages)}}function Ye(e,t){1&e&&(m.Sb(0,"div",10),m.Sb(1,"div",61),m.Sb(2,"div",62),m.Nb(3,"input",63),m.Sb(4,"label",64),m.Wb(5,65),m.Rb(),m.Rb(),m.Rb(),m.Rb())}function ze(e,t){1&e&&(m.Sb(0,"div",10),m.Sb(1,"div",61),m.Sb(2,"div",62),m.Nb(3,"input",66),m.Sb(4,"label",67),m.Wb(5,68),m.Rb(),m.Rb(),m.Rb(),m.Rb())}function $e(e,t){if(1&e){const e=m.Tb();m.Sb(0,"div",3),m.Sb(1,"form",4,5),m.Sb(3,"div",6),m.Sb(4,"div",7),m.Wb(5,8),m.jc(6,"titlecase"),m.jc(7,"upperFirst"),m.Rb(),m.Sb(8,"div",9),m.Sb(9,"div",10),m.Sb(10,"label",11),m.Wb(11,12),m.Rb(),m.Sb(12,"div",13),m.Nb(13,"input",14),m.Mc(14,xe,2,0,"span",15),m.Mc(15,ke,2,0,"span",15),m.Rb(),m.Rb(),m.Mc(16,Oe,14,7,"div",16),m.Mc(17,Ee,10,2,"div",16),m.Mc(18,je,14,9,"div",16),m.Sb(19,"div",10),m.Sb(20,"label",17),m.Wb(21,18),m.Rb(),m.Sb(22,"div",13),m.Nb(23,"input",19),m.Rb(),m.Rb(),m.Sb(24,"div",10),m.Sb(25,"label",20),m.Wb(26,21),m.Rb(),m.Sb(27,"div",13),m.Nb(28,"input",22),m.Mc(29,Ne,2,0,"span",15),m.Rb(),m.Rb(),m.Sb(30,"div",10),m.Sb(31,"label",23),m.Wb(32,24),m.Rb(),m.Sb(33,"div",13),m.Mc(34,Fe,2,3,"span",25),m.Rb(),m.Rb(),m.Mc(35,Ye,6,0,"div",16),m.Mc(36,ze,6,0,"div",16),m.Rb(),m.Sb(37,"div",26),m.Sb(38,"cd-form-button-panel",27),m.gc("submitActionEvent",(function(){return m.Dc(e),m.ic().submit()})),m.jc(39,"titlecase"),m.jc(40,"upperFirst"),m.Rb(),m.Rb(),m.Rb(),m.Rb(),m.Rb()}if(2&e){const e=m.Ac(2),t=m.ic();m.yb(1),m.pc("formGroup",t.userForm),m.yb(6),m.ac(m.kc(6,15,t.action))(m.kc(7,17,t.resource)),m.Xb(5),m.yb(3),m.pc("ngClass",m.uc(23,Pe,t.mode!==t.userFormMode.editing)),m.yb(4),m.pc("ngIf",t.userForm.showError("username",e,"required")),m.yb(1),m.pc("ngIf",t.userForm.showError("username",e,"notUnique")),m.yb(1),m.pc("ngIf",!t.authStorageService.isSSO()),m.yb(1),m.pc("ngIf",!t.authStorageService.isSSO()),m.yb(1),m.pc("ngIf",!t.authStorageService.isSSO()),m.yb(11),m.pc("ngIf",t.userForm.showError("email",e,"email")),m.yb(5),m.pc("ngIf",t.allRoles),m.yb(1),m.pc("ngIf",!t.isCurrentUser()),m.yb(1),m.pc("ngIf",!t.isCurrentUser()&&!t.authStorageService.isSSO()),m.yb(2),m.pc("form",t.userForm)("submitText",m.kc(39,19,t.action)+" "+m.kc(40,21,t.resource))}}function He(e,t){1&e&&(m.Sb(0,"p"),m.Sb(1,"strong"),m.Wb(2,69),m.Rb(),m.Rb(),m.Nb(3,"br"),m.Sb(4,"p"),m.Wb(5,70),m.Rb(),m.Qb(6),m.Wb(7,71),m.Pb())}function We(e,t){if(1&e&&m.Nb(0,"cd-date-time-picker",72),2&e){const e=m.ic();m.pc("control",e.userForm.get("pwdExpirationDate"))("hasTime",!1)}}let Ve=(()=>{class e extends v.a{constructor(e,t,n,i,r,s,o,a,c,l,u,d){super(),this.authService=e,this.authStorageService=t,this.route=n,this.router=i,this.modalService=r,this.roleService=s,this.userService=o,this.notificationService=a,this.actionLabels=c,this.passwordPolicyService=l,this.formBuilder=u,this.settingsService=d,this.userFormMode=ge,this.messages=new fe.a({empty:"There are no roles."}),this.passwordPolicyHelpText="",this.icons=Q.a,this.pwdExpirationFormat="YYYY-MM-DD",this.resource="user",this.createForm(),this.messages=new fe.a({empty:"There are no roles."})}createForm(){this.passwordPolicyService.getHelpText().subscribe(e=>{this.passwordPolicyHelpText=e}),this.userForm=this.formBuilder.group({username:["",[r.A.required],[S.a.unique(this.userService.validateUserName,this.userService)]],name:[""],password:["",[],[S.a.passwordPolicy(this.userService,()=>this.userForm.getValue("username"),(e,t,n)=>{this.passwordStrengthLevelClass=this.passwordPolicyService.mapCreditsToCssClass(t),this.passwordValuation=d.a.defaultTo(n,"")})]],confirmpassword:[""],pwdExpirationDate:[void 0],email:["",[S.a.email]],roles:[[]],enabled:[!0,[r.A.required]],pwdUpdateRequired:[!0]},{validators:[S.a.match("password","confirmpassword")]})}ngOnInit(){this.router.url.startsWith("/user-management/users/edit")?(this.mode=this.userFormMode.editing,this.action=this.actionLabels.EDIT):this.action=this.actionLabels.CREATE;const e=[this.roleService.list(),this.settingsService.getStandardSettings()];Object(h.a)(e).subscribe(e=>{if(this.allRoles=d.a.map(e[0],e=>(e.enabled=!0,e)),this.pwdExpirationSettings=new me.a(e[1]),this.mode===this.userFormMode.editing)this.initEdit();else{if(this.pwdExpirationSettings.pwdExpirationSpan>0){const e=this.userForm.get("pwdExpirationDate"),t=ce()();t.add(this.pwdExpirationSettings.pwdExpirationSpan,"day"),e.setValue(t.format(this.pwdExpirationFormat)),e.setValidators([r.A.required])}this.loadingReady()}})}initEdit(){this.disableForEdit(),this.route.params.subscribe(e=>{this.userService.get(e.username).subscribe(e=>{this.response=d.a.cloneDeep(e),this.setResponse(e),this.loadingReady()})})}disableForEdit(){this.userForm.get("username").disable()}setResponse(e){["username","name","email","roles","enabled","pwdUpdateRequired"].forEach(t=>this.userForm.get(t).setValue(e[t]));const t=e.pwdExpirationDate;t&&this.userForm.get("pwdExpirationDate").setValue(ce()(1e3*t).format(this.pwdExpirationFormat))}getRequest(){const e=new _e;["username","password","name","email","roles","enabled","pwdUpdateRequired"].forEach(t=>e[t]=this.userForm.get(t).value);const t=this.userForm.get("pwdExpirationDate").value;if(t){const n=ce()(t,this.pwdExpirationFormat);this.mode===this.userFormMode.editing&&this.response.pwdExpirationDate===n.unix()||n.set({hour:23,minute:59,second:59}),e.pwdExpirationDate=n.unix()}return e}createAction(){const e=this.getRequest();this.userService.create(e).subscribe(()=>{this.notificationService.show(y.a.success,"Created user '" + e.username + "'"),this.router.navigate(["/user-management/users"])},()=>{this.userForm.setErrors({cdSubmitButton:!0})})}editAction(){if(this.isUserRemovingNeededRolePermissions()){const e={titleText:"Update user",buttonText:"Continue",bodyTpl:this.removeSelfUserReadUpdatePermissionTpl,onSubmit:()=>{this.modalRef.close(),this.doEditAction()},onCancel:()=>{this.userForm.setErrors({cdSubmitButton:!0}),this.userForm.get("roles").reset(this.userForm.get("roles").value)}};this.modalRef=this.modalService.show(he.a,e)}else this.doEditAction()}isCurrentUser(){return this.authStorageService.getUsername()===this.userForm.getValue("username")}isUserChangingRoles(){return this.isCurrentUser()&&this.response&&!d.a.isEqual(this.response.roles,this.userForm.getValue("roles"))}isUserRemovingNeededRolePermissions(){return this.isCurrentUser()&&!this.hasUserReadUpdatePermissions(this.userForm.getValue("roles"))}hasUserReadUpdatePermissions(e=[]){for(const t of this.allRoles)if(-1!==e.indexOf(t.name)&&t.scopes_permissions.user){const e=t.scopes_permissions.user;return["read","update"].every(t=>-1!==e.indexOf(t))}return!1}doEditAction(){const e=this.getRequest();this.userService.update(e).subscribe(()=>{this.isUserChangingRoles()?this.authService.logout(()=>{this.notificationService.show(y.a.info,"You were automatically logged out because your roles have been changed.")}):(this.notificationService.show(y.a.success,"Updated user '" + e.username + "'"),this.router.navigate(["/user-management/users"]))},()=>{this.userForm.setErrors({cdSubmitButton:!0})})}clearExpirationDate(){this.userForm.get("pwdExpirationDate").setValue(void 0)}submit(){this.mode===this.userFormMode.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(le.a),m.Mb(X.a),m.Mb(s.a),m.Mb(s.e),m.Mb(ee.a),m.Mb(g),m.Mb(de.a),m.Mb(M.a),m.Mb(c.b),m.Mb(be.a),m.Mb(pe.a),m.Mb(ue.a))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-user-form"]],viewQuery:function(e,t){var n;1&e&&m.Jc(Me,!0),2&e&&m.zc(n=m.hc())&&(t.removeSelfUserReadUpdatePermissionTpl=n.first)},features:[m.vb],decls:5,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],["removeSelfUserReadUpdatePermissionTpl",""],["popContent",""],[1,"cd-col-form"],["name","userForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","username",1,"cd-col-form-label",3,"ngClass"],"Username",[1,"cd-col-form-input"],["type","text","placeholder","Username...","id","username","name","username","formControlName","username","autocomplete","off","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],["for","name",1,"cd-col-form-label"],"Full name",["type","text","placeholder","Full name...","id","name","name","name","formControlName","name",1,"form-control"],["for","email",1,"cd-col-form-label"],"Email",["type","email","placeholder","Email...","id","email","name","email","formControlName","email",1,"form-control"],[1,"cd-col-form-label"],"Roles",["class","no-border full-height",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The username already exists.",["for","password",1,"cd-col-form-label"],"Password",["class","text-pre-wrap",3,"html",4,"ngIf"],[1,"input-group"],["type","password","placeholder","Password...","id","password","name","password","autocomplete","new-password","formControlName","password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-light"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],[1,"text-pre-wrap",3,"html"],"This field is required.",["for","confirmpassword",1,"cd-col-form-label"],"Confirm password",["type","password","placeholder","Confirm password...","id","confirmpassword","name","confirmpassword","autocomplete","new-password","formControlName","confirmpassword",1,"form-control"],["type","button","cdPasswordButton","confirmpassword",1,"btn","btn-light"],"Password confirmation doesn't match the password.","This field is required.",["for","pwdExpirationDate",1,"cd-col-form-label",3,"ngClass"],"Password expiration date",["class","text-pre-wrap",4,"ngIf"],["id","pwdExpirationDate","name","pwdExpirationDate","formControlName","pwdExpirationDate","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress",6,"placeholder"],["p","ngbPopover"],["placeholder","Password expiration date..."],["type","button",1,"btn","btn-light",3,"click"],[1,"text-pre-wrap"],["routerLink","/mgr-modules/edit/dashboard",1,"alert-link"],"This field is required.","Invalid email.",[1,"no-border","full-height"],[3,"data","options","messages"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","enabled","name","enabled","formControlName","enabled",1,"custom-control-input"],["for","enabled",1,"custom-control-label"],"Enabled",["type","checkbox","id","pwdUpdateRequired","name","pwdUpdateRequired","formControlName","pwdUpdateRequired",1,"custom-control-input"],["for","pwdUpdateRequired",1,"custom-control-label"],"User must change password at next logon","You are about to remove \"user read / update\" permissions from your own user.","If you continue, you will no longer be able to add or remove roles from any user.","Are you sure you want to continue?",[3,"control","hasTime"]]},template:function(e,t){1&e&&(m.Mc(0,$e,41,25,"div",0),m.Mc(1,He,8,0,"ng-template",null,1,m.Nc),m.Mc(3,We,1,2,"ng-template",null,2,m.Nc)),2&e&&m.pc("cdFormLoading",t.loading)},directives:[D.a,r.C,r.r,r.k,T.a,C.a,i.p,O.a,r.d,R.a,r.q,r.i,L.a,i.r,A.a,ye.a,ve.a,o.w,s.h,we.a,r.b,Se.a],pipes:[i.A,I.a],styles:[""]}),e})();var Be=n("a0VL");const Ue=["userRolesTpl"];function Ge(e,t){if(1&e&&(m.Sb(0,"span"),m.Oc(1),m.Rb()),2&e){const e=t.$implicit,n=t.last;m.yb(1),m.Rc(" ",e,"",n?"":", "," ")}}function qe(e,t){1&e&&m.Mc(0,Ge,2,2,"span",3),2&e&&m.pc("ngForOf",t.value)}let Je=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.userService=e,this.emptyPipe=t,this.modalService=n,this.notificationService=i,this.authStorageService=r,this.urlBuilder=s,this.cdDatePipe=o,this.actionLabels=a,this.selection=new K.a,this.permission=this.authStorageService.getPermissions().user,this.tableActions=[{permission:"create",icon:Q.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"update",icon:Q.a.edit,routerLink:()=>this.selection.first()&&this.urlBuilder.getEdit(this.selection.first().username),name:this.actionLabels.EDIT},{permission:"delete",icon:Q.a.destroy,click:()=>this.deleteUserModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Username",prop:"username",flexGrow:1},{name:"Name",prop:"name",flexGrow:1,pipe:this.emptyPipe},{name:"Email",prop:"email",flexGrow:1,pipe:this.emptyPipe},{name:"Roles",prop:"roles",flexGrow:1,cellTemplate:this.userRolesTpl},{name:"Enabled",prop:"enabled",flexGrow:1,cellTransformation:J.a.checkIcon},{name:"Password expiration date",prop:"pwdExpirationDate",flexGrow:1,pipe:this.cdDatePipe}]}getUsers(){this.userService.list().subscribe(e=>{e.forEach(e=>{e.pwdExpirationDate&&e.pwdExpirationDate>0&&(e.pwdExpirationDate=1e3*e.pwdExpirationDate)}),this.users=e})}updateSelection(e){this.selection=e}deleteUser(e){this.userService.delete(e).subscribe(()=>{this.getUsers(),this.modalRef.close(),this.notificationService.show(y.a.success,"Deleted user '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}deleteUserModal(){const e=this.authStorageService.getUsername(),t=this.selection.first().username;e!==t?this.modalRef=this.modalService.show(G.a,{itemDescription:"User",itemNames:[t],submitAction:()=>this.deleteUser(t)}):this.notificationService.show(y.a.error,"Failed to delete user '" + t + "'","You are currently logged in as '" + t + "'.")}}return e.\u0275fac=function(t){return new(t||e)(m.Mb(de.a),m.Mb(Z.a),m.Mb(ee.a),m.Mb(M.a),m.Mb(X.a),m.Mb(te.a),m.Mb(Be.a),m.Mb(c.b))},e.\u0275cmp=m.Gb({type:e,selectors:[["cd-user-list"]],viewQuery:function(e,t){var n;1&e&&m.Jc(Ue,!0),2&e&&m.zc(n=m.hc())&&(t.userRolesTpl=n.first)},features:[m.xb([{provide:te.a,useValue:new te.a("user-management/users")}])],decls:5,vars:5,consts:[["columnMode","flex","identifier","username","selectionType","single",3,"data","columns","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["userRolesTpl",""],[4,"ngFor","ngForOf"]],template:function(e,t){1&e&&(m.Nb(0,"cd-user-tabs"),m.Sb(1,"cd-table",0),m.gc("fetchData",(function(){return t.getUsers()}))("updateSelection",(function(e){return t.updateSelection(e)})),m.Nb(2,"cd-table-actions",1),m.Rb(),m.Mc(3,qe,1,1,"ng-template",null,2,m.Nc)),2&e&&(m.yb(1),m.pc("data",t.users)("columns",t.columns),m.yb(1),m.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ne,E.a,ie.a,i.q],styles:[""]}),e})(),Qe=(()=>{class e{}return e.\u0275mod=m.Kb({type:e}),e.\u0275inj=m.Jb({factory:function(t){return new(t||e)},imports:[[i.c,r.m,r.x,l.a,o.t,o.y,a.a,s.i]]}),e})();const Ke=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"users",data:{breadcrumbs:"Users"},children:[{path:"",component:Je},{path:c.e.CREATE,component:Ve,data:{breadcrumbs:c.a.CREATE}},{path:c.e.EDIT+"/:username",component:Ve,data:{breadcrumbs:c.a.EDIT}}]},{path:"roles",data:{breadcrumbs:"Roles"},children:[{path:"",component:oe},{path:c.e.CREATE,component:B,data:{breadcrumbs:c.a.CREATE}},{path:c.e.EDIT+"/:name",component:B,data:{breadcrumbs:c.a.EDIT}}]}];let Ze=(()=>{class e{}return e.\u0275mod=m.Kb({type:e}),e.\u0275inj=m.Jb({factory:function(t){return new(t||e)},imports:[[Qe,s.i.forChild(Ke)]]}),e})()},Lhse:function(e,t,n){"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(t,"a",(function(){return r}));const r=i()},Loxo:function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u042f\u043a\u0448\u0430\u043d\u0431\u0430_\u0414\u0443\u0448\u0430\u043d\u0431\u0430_\u0421\u0435\u0448\u0430\u043d\u0431\u0430_\u0427\u043e\u0440\u0448\u0430\u043d\u0431\u0430_\u041f\u0430\u0439\u0448\u0430\u043d\u0431\u0430_\u0416\u0443\u043c\u0430_\u0428\u0430\u043d\u0431\u0430".split("_"),weekdaysShort:"\u042f\u043a\u0448_\u0414\u0443\u0448_\u0421\u0435\u0448_\u0427\u043e\u0440_\u041f\u0430\u0439_\u0416\u0443\u043c_\u0428\u0430\u043d".split("_"),weekdaysMin:"\u042f\u043a_\u0414\u0443_\u0421\u0435_\u0427\u043e_\u041f\u0430_\u0416\u0443_\u0428\u0430".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[\u0411\u0443\u0433\u0443\u043d \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",nextDay:"[\u042d\u0440\u0442\u0430\u0433\u0430] LT [\u0434\u0430]",nextWeek:"dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastDay:"[\u041a\u0435\u0447\u0430 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastWeek:"[\u0423\u0442\u0433\u0430\u043d] dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",sameElse:"L"},relativeTime:{future:"\u042f\u043a\u0438\u043d %s \u0438\u0447\u0438\u0434\u0430",past:"\u0411\u0438\u0440 \u043d\u0435\u0447\u0430 %s \u043e\u043b\u0434\u0438\u043d",s:"\u0444\u0443\u0440\u0441\u0430\u0442",ss:"%d \u0444\u0443\u0440\u0441\u0430\u0442",m:"\u0431\u0438\u0440 \u0434\u0430\u043a\u0438\u043a\u0430",mm:"%d \u0434\u0430\u043a\u0438\u043a\u0430",h:"\u0431\u0438\u0440 \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u0431\u0438\u0440 \u043e\u0439",MM:"%d \u043e\u0439",y:"\u0431\u0438\u0440 \u0439\u0438\u043b",yy:"%d \u0439\u0438\u043b"},week:{dow:1,doy:7}})}(n("wd/R"))},LvDl:function(e,t,n){(function(e){var i;(function(){var r,s="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,l=128,u=1/0,d=9007199254740991,h=NaN,f=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],m="[object Arguments]",b="[object Array]",g="[object Boolean]",_="[object Date]",y="[object Error]",v="[object Function]",w="[object GeneratorFunction]",S="[object Map]",M="[object Number]",x="[object Object]",k="[object Promise]",D="[object RegExp]",T="[object Set]",C="[object String]",O="[object Symbol]",R="[object WeakMap]",L="[object ArrayBuffer]",E="[object DataView]",A="[object Float32Array]",I="[object Float64Array]",P="[object Int8Array]",j="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",Y="[object Uint8ClampedArray]",z="[object Uint16Array]",$="[object Uint32Array]",H=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,G=RegExp(B.source),q=RegExp(U.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),ie=/^\s+/,re=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Me="A-Z\\xc0-\\xd6\\xd8-\\xde",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="["+xe+"]",De="["+we+"]",Te="\\d+",Ce="["+Se+"]",Oe="[^\\ud800-\\udfff"+xe+Te+"\\u2700-\\u27bf"+Se+Me+"]",Re="\\ud83c[\\udffb-\\udfff]",Le="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Ie="["+Me+"]",Pe="(?:"+Ce+"|"+Oe+")",je="(?:"+Ie+"|"+Oe+")",Ne="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Fe="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+De+"|"+Re+")?",ze="[\\ufe0e\\ufe0f]?",$e=ze+Ye+"(?:\\u200d(?:"+[Le,Ee,Ae].join("|")+")"+ze+Ye+")*",He="(?:"+["[\\u2700-\\u27bf]",Ee,Ae].join("|")+")"+$e,We="(?:"+[Le+De+"?",De,Ee,Ae,"[\\ud800-\\udfff]"].join("|")+")",Ve=RegExp("['\u2019]","g"),Be=RegExp(De,"g"),Ue=RegExp(Re+"(?="+Re+")|"+We+$e,"g"),Ge=RegExp([Ie+"?"+Ce+"+"+Ne+"(?="+[ke,Ie,"$"].join("|")+")",je+"+"+Fe+"(?="+[ke,Ie+Pe,"$"].join("|")+")",Ie+"?"+Pe+"+"+Ne,Ie+"+"+Fe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,He].join("|"),"g"),qe=RegExp("[\\u200d\\ud800-\\udfff"+we+"\\ufe0e\\ufe0f]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ke=-1,Ze={};Ze[A]=Ze[I]=Ze[P]=Ze[j]=Ze[N]=Ze[F]=Ze[Y]=Ze[z]=Ze[$]=!0,Ze[m]=Ze[b]=Ze[L]=Ze[g]=Ze[E]=Ze[_]=Ze[y]=Ze[v]=Ze[S]=Ze[M]=Ze[x]=Ze[D]=Ze[T]=Ze[C]=Ze[R]=!1;var Xe={};Xe[m]=Xe[b]=Xe[L]=Xe[E]=Xe[g]=Xe[_]=Xe[A]=Xe[I]=Xe[P]=Xe[j]=Xe[N]=Xe[S]=Xe[M]=Xe[x]=Xe[D]=Xe[T]=Xe[C]=Xe[O]=Xe[F]=Xe[Y]=Xe[z]=Xe[$]=!0,Xe[y]=Xe[v]=Xe[R]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,nt=parseInt,it="object"==typeof global&&global&&global.Object===Object&&global,rt="object"==typeof self&&self&&self.Object===Object&&self,st=it||rt||Function("return this")(),ot=t&&!t.nodeType&&t,at=ot&&"object"==typeof e&&e&&!e.nodeType&&e,ct=at&&at.exports===ot,lt=ct&&it.process,ut=function(){try{return at&&at.require&&at.require("util").types||lt&&lt.binding&&lt.binding("util")}catch(e){}}(),dt=ut&&ut.isArrayBuffer,ht=ut&&ut.isDate,ft=ut&&ut.isMap,pt=ut&&ut.isRegExp,mt=ut&&ut.isSet,bt=ut&&ut.isTypedArray;function gt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,i){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(i,o,n(o),e)}return i}function yt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function vt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function wt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0}function St(e,t){for(var n=-1,i=null==e?0:e.length,r=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[r++]=o)}return s}function Mt(e,t){return!(null==e||!e.length)&&At(e,t,0)>-1}function xt(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function kt(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function Dt(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}function Tt(e,t,n,i){var r=-1,s=null==e?0:e.length;for(i&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n}function Ct(e,t,n,i){var r=null==e?0:e.length;for(i&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function Ot(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}var Rt=Nt("length");function Lt(e,t,n){var i;return n(e,(function(e,n,r){if(t(e,n,r))return i=n,!1})),i}function Et(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1}function At(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):Et(e,Pt,n)}function It(e,t,n,i){for(var r=n-1,s=e.length;++r<s;)if(i(e[r],t))return r;return-1}function Pt(e){return e!=e}function jt(e,t){var n=null==e?0:e.length;return n?zt(e,t)/n:h}function Nt(e){return function(t){return null==t?r:t[e]}}function Ft(e){return function(t){return null==e?r:e[t]}}function Yt(e,t,n,i,r){return r(e,(function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)})),n}function zt(e,t){for(var n,i=-1,s=e.length;++i<s;){var o=t(e[i]);o!==r&&(n=n===r?o:n+o)}return n}function $t(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Ht(e){return e?e.slice(0,an(e)+1).replace(ie,""):e}function Wt(e){return function(t){return e(t)}}function Vt(e,t){return kt(t,(function(t){return e[t]}))}function Bt(e,t){return e.has(t)}function Ut(e,t){for(var n=-1,i=e.length;++n<i&&At(t,e[n],0)>-1;);return n}function Gt(e,t){for(var n=e.length;n--&&At(t,e[n],0)>-1;);return n}function qt(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var Jt=Ft({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Qt=Ft({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Kt(e){return"\\"+et[e]}function Zt(e){return qe.test(e)}function Xt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function en(e,t){return function(n){return e(t(n))}}function tn(e,t){for(var n=-1,i=e.length,r=0,s=[];++n<i;){var o=e[n];o!==t&&o!==a||(e[n]=a,s[r++]=n)}return s}function nn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function rn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function sn(e){return Zt(e)?function(e){for(var t=Ue.lastIndex=0;Ue.test(e);)++t;return t}(e):Rt(e)}function on(e){return Zt(e)?function(e){return e.match(Ue)||[]}(e):function(e){return e.split("")}(e)}function an(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var cn=Ft({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),ln=function e(t){var n,i=(t=null==t?st:ln.defaults(st.Object(),t,ln.pick(st,Qe))).Array,re=t.Date,we=t.Error,Se=t.Function,Me=t.Math,xe=t.Object,ke=t.RegExp,De=t.String,Te=t.TypeError,Ce=i.prototype,Oe=xe.prototype,Re=t["__core-js_shared__"],Le=Se.prototype.toString,Ee=Oe.hasOwnProperty,Ae=0,Ie=(n=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Pe=Oe.toString,je=Le.call(xe),Ne=st._,Fe=ke("^"+Le.call(Ee).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ye=ct?t.Buffer:r,ze=t.Symbol,$e=t.Uint8Array,He=Ye?Ye.allocUnsafe:r,We=en(xe.getPrototypeOf,xe),Ue=xe.create,qe=Oe.propertyIsEnumerable,et=Ce.splice,it=ze?ze.isConcatSpreadable:r,rt=ze?ze.iterator:r,ot=ze?ze.toStringTag:r,at=function(){try{var e=cs(xe,"defineProperty");return e({},"",{}),e}catch(t){}}(),lt=t.clearTimeout!==st.clearTimeout&&t.clearTimeout,ut=re&&re.now!==st.Date.now&&re.now,Rt=t.setTimeout!==st.setTimeout&&t.setTimeout,Ft=Me.ceil,un=Me.floor,dn=xe.getOwnPropertySymbols,hn=Ye?Ye.isBuffer:r,fn=t.isFinite,pn=Ce.join,mn=en(xe.keys,xe),bn=Me.max,gn=Me.min,_n=re.now,yn=t.parseInt,vn=Me.random,wn=Ce.reverse,Sn=cs(t,"DataView"),Mn=cs(t,"Map"),xn=cs(t,"Promise"),kn=cs(t,"Set"),Dn=cs(t,"WeakMap"),Tn=cs(xe,"create"),Cn=Dn&&new Dn,On={},Rn=Ns(Sn),Ln=Ns(Mn),En=Ns(xn),An=Ns(kn),In=Ns(Dn),Pn=ze?ze.prototype:r,jn=Pn?Pn.valueOf:r,Nn=Pn?Pn.toString:r;function Fn(e){if(ta(e)&&!Vo(e)&&!(e instanceof Hn)){if(e instanceof $n)return e;if(Ee.call(e,"__wrapped__"))return Fs(e)}return new $n(e)}var Yn=function(){function e(){}return function(t){if(!ea(t))return{};if(Ue)return Ue(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function zn(){}function $n(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Un(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Bn;++t<n;)this.add(e[t])}function Gn(e){var t=this.__data__=new Vn(e);this.size=t.size}function qn(e,t){var n=Vo(e),i=!n&&Wo(e),r=!n&&!i&&qo(e),s=!n&&!i&&!r&&la(e),o=n||i||r||s,a=o?$t(e.length,De):[],c=a.length;for(var l in e)!t&&!Ee.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ms(l,c))||a.push(l);return a}function Jn(e){var t=e.length;return t?e[Bi(0,t-1)]:r}function Qn(e,t){return Es(Dr(e),si(t,0,e.length))}function Kn(e){return Es(Dr(e))}function Zn(e,t,n){(n!==r&&!zo(e[t],n)||n===r&&!(t in e))&&ii(e,t,n)}function Xn(e,t,n){var i=e[t];Ee.call(e,t)&&zo(i,n)&&(n!==r||t in e)||ii(e,t,n)}function ei(e,t){for(var n=e.length;n--;)if(zo(e[n][0],t))return n;return-1}function ti(e,t,n,i){return ui(e,(function(e,r,s){t(i,e,n(e),s)})),i}function ni(e,t){return e&&Tr(t,La(t),e)}function ii(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ri(e,t){for(var n=-1,s=t.length,o=i(s),a=null==e;++n<s;)o[n]=a?r:Da(e,t[n]);return o}function si(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function oi(e,t,n,i,s,o){var a,c=1&t,l=2&t,u=4&t;if(n&&(a=s?n(e,i,s,o):n(e)),a!==r)return a;if(!ea(e))return e;var d=Vo(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!c)return Dr(e,a)}else{var h=ds(e),f=h==v||h==w;if(qo(e))return vr(e,c);if(h==x||h==m||f&&!s){if(a=l||f?{}:fs(e),!c)return l?function(e,t){return Tr(e,us(e),t)}(e,function(e,t){return e&&Tr(t,Ea(t),e)}(a,e)):function(e,t){return Tr(e,ls(e),t)}(e,ni(a,e))}else{if(!Xe[h])return s?e:{};a=function(e,t,n){var i=e.constructor;switch(t){case L:return wr(e);case g:case _:return new i(+e);case E:return function(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case A:case I:case P:case j:case N:case F:case Y:case z:case $:return Sr(e,n);case S:return new i;case M:case C:return new i(e);case D:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new i;case O:return jn?xe(jn.call(e)):{}}}(e,h,c)}}o||(o=new Gn);var p=o.get(e);if(p)return p;o.set(e,a),oa(e)?e.forEach((function(i){a.add(oi(i,t,n,i,e,o))})):na(e)&&e.forEach((function(i,r){a.set(r,oi(i,t,n,r,e,o))}));var b=d?r:(u?l?ts:es:l?Ea:La)(e);return yt(b||e,(function(i,r){b&&(i=e[r=i]),Xn(a,r,oi(i,t,n,r,e,o))})),a}function ai(e,t,n){var i=n.length;if(null==e)return!i;for(e=xe(e);i--;){var s=n[i],o=e[s];if(o===r&&!(s in e)||!(0,t[s])(o))return!1}return!0}function ci(e,t,n){if("function"!=typeof e)throw new Te(s);return Cs((function(){e.apply(r,n)}),t)}function li(e,t,n,i){var r=-1,s=Mt,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=kt(t,Wt(n))),i?(s=xt,o=!1):t.length>=200&&(s=Bt,o=!1,t=new Un(t));e:for(;++r<a;){var u=e[r],d=null==n?u:n(u);if(u=i||0!==u?u:0,o&&d==d){for(var h=l;h--;)if(t[h]===d)continue e;c.push(u)}else s(t,d,i)||c.push(u)}return c}Fn.templateSettings={escape:J,evaluate:Q,interpolate:K,variable:"",imports:{_:Fn}},(Fn.prototype=zn.prototype).constructor=Fn,($n.prototype=Yn(zn.prototype)).constructor=$n,(Hn.prototype=Yn(zn.prototype)).constructor=Hn,Wn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Wn.prototype.get=function(e){var t=this.__data__;if(Tn){var n=t[e];return n===o?r:n}return Ee.call(t,e)?t[e]:r},Wn.prototype.has=function(e){var t=this.__data__;return Tn?t[e]!==r:Ee.call(t,e)},Wn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tn&&t===r?o:t,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=ei(t,e);return!(n<0||(n==t.length-1?t.pop():et.call(t,n,1),--this.size,0))},Vn.prototype.get=function(e){var t=this.__data__,n=ei(t,e);return n<0?r:t[n][1]},Vn.prototype.has=function(e){return ei(this.__data__,e)>-1},Vn.prototype.set=function(e,t){var n=this.__data__,i=ei(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Bn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Mn||Vn),string:new Wn}},Bn.prototype.delete=function(e){var t=os(this,e).delete(e);return this.size-=t?1:0,t},Bn.prototype.get=function(e){return os(this,e).get(e)},Bn.prototype.has=function(e){return os(this,e).has(e)},Bn.prototype.set=function(e,t){var n=os(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Un.prototype.add=Un.prototype.push=function(e){return this.__data__.set(e,o),this},Un.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new Vn,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vn){var i=n.__data__;if(!Mn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bn(i)}return n.set(e,t),this.size=n.size,this};var ui=Rr(_i),di=Rr(yi,!0);function hi(e,t){var n=!0;return ui(e,(function(e,i,r){return n=!!t(e,i,r)})),n}function fi(e,t,n){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(c===r?a==a&&!ca(a):n(a,c)))var c=a,l=o}return l}function pi(e,t){var n=[];return ui(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n}function mi(e,t,n,i,r){var s=-1,o=e.length;for(n||(n=ps),r||(r=[]);++s<o;){var a=e[s];t>0&&n(a)?t>1?mi(a,t-1,n,i,r):Dt(r,a):i||(r[r.length]=a)}return r}var bi=Lr(),gi=Lr(!0);function _i(e,t){return e&&bi(e,t,La)}function yi(e,t){return e&&gi(e,t,La)}function vi(e,t){return St(t,(function(t){return Ko(e[t])}))}function wi(e,t){for(var n=0,i=(t=br(t,e)).length;null!=e&&n<i;)e=e[js(t[n++])];return n&&n==i?e:r}function Si(e,t,n){var i=t(e);return Vo(e)?i:Dt(i,n(e))}function Mi(e){return null==e?e===r?"[object Undefined]":"[object Null]":ot&&ot in xe(e)?function(e){var t=Ee.call(e,ot),n=e[ot];try{e[ot]=r;var i=!0}catch(o){}var s=Pe.call(e);return i&&(t?e[ot]=n:delete e[ot]),s}(e):function(e){return Pe.call(e)}(e)}function xi(e,t){return e>t}function ki(e,t){return null!=e&&Ee.call(e,t)}function Di(e,t){return null!=e&&t in xe(e)}function Ti(e,t,n){for(var s=n?xt:Mt,o=e[0].length,a=e.length,c=a,l=i(a),u=1/0,d=[];c--;){var h=e[c];c&&t&&(h=kt(h,Wt(t))),u=gn(h.length,u),l[c]=!n&&(t||o>=120&&h.length>=120)?new Un(c&&h):r}h=e[0];var f=-1,p=l[0];e:for(;++f<o&&d.length<u;){var m=h[f],b=t?t(m):m;if(m=n||0!==m?m:0,!(p?Bt(p,b):s(d,b,n))){for(c=a;--c;){var g=l[c];if(!(g?Bt(g,b):s(e[c],b,n)))continue e}p&&p.push(b),d.push(m)}}return d}function Ci(e,t,n){var i=null==(e=xs(e,t=br(t,e)))?e:e[js(Js(t))];return null==i?r:gt(i,e,n)}function Oi(e){return ta(e)&&Mi(e)==m}function Ri(e,t,n,i,s){return e===t||(null==e||null==t||!ta(e)&&!ta(t)?e!=e&&t!=t:function(e,t,n,i,s,o){var a=Vo(e),c=Vo(t),l=a?b:ds(e),u=c?b:ds(t),d=(l=l==m?x:l)==x,h=(u=u==m?x:u)==x,f=l==u;if(f&&qo(e)){if(!qo(t))return!1;a=!0,d=!1}if(f&&!d)return o||(o=new Gn),a||la(e)?Zr(e,t,n,i,s,o):function(e,t,n,i,r,s,o){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!s(new $e(e),new $e(t)));case g:case _:case M:return zo(+e,+t);case y:return e.name==t.name&&e.message==t.message;case D:case C:return e==t+"";case S:var a=Xt;case T:if(a||(a=nn),e.size!=t.size&&!(1&i))return!1;var c=o.get(e);if(c)return c==t;i|=2,o.set(e,t);var l=Zr(a(e),a(t),i,r,s,o);return o.delete(e),l;case O:if(jn)return jn.call(e)==jn.call(t)}return!1}(e,t,l,n,i,s,o);if(!(1&n)){var p=d&&Ee.call(e,"__wrapped__"),v=h&&Ee.call(t,"__wrapped__");if(p||v){var w=p?e.value():e,k=v?t.value():t;return o||(o=new Gn),s(w,k,n,i,o)}}return!!f&&(o||(o=new Gn),function(e,t,n,i,s,o){var a=1&n,c=es(e),l=c.length;if(l!=es(t).length&&!a)return!1;for(var u=l;u--;){var d=c[u];if(!(a?d in t:Ee.call(t,d)))return!1}var h=o.get(e),f=o.get(t);if(h&&f)return h==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++u<l;){var b=e[d=c[u]],g=t[d];if(i)var _=a?i(g,b,d,t,e,o):i(b,g,d,e,t,o);if(!(_===r?b===g||s(b,g,n,i,o):_)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var y=e.constructor,v=t.constructor;y==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,i,s,o))}(e,t,n,i,Ri,s))}function Li(e,t,n,i){var s=n.length,o=s,a=!i;if(null==e)return!o;for(e=xe(e);s--;){var c=n[s];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s<o;){var l=(c=n[s])[0],u=e[l],d=c[1];if(a&&c[2]){if(u===r&&!(l in e))return!1}else{var h=new Gn;if(i)var f=i(u,d,l,e,t,h);if(!(f===r?Ri(d,u,3,i,h):f))return!1}}return!0}function Ei(e){return!(!ea(e)||(t=e,Ie&&Ie in t))&&(Ko(e)?Fe:me).test(Ns(e));var t}function Ai(e){return"function"==typeof e?e:null==e?ic:"object"==typeof e?Vo(e)?Fi(e[0],e[1]):Ni(e):hc(e)}function Ii(e){if(!vs(e))return mn(e);var t=[];for(var n in xe(e))Ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Pi(e,t){return e<t}function ji(e,t){var n=-1,r=Uo(e)?i(e.length):[];return ui(e,(function(e,i,s){r[++n]=t(e,i,s)})),r}function Ni(e){var t=as(e);return 1==t.length&&t[0][2]?Ss(t[0][0],t[0][1]):function(n){return n===e||Li(n,e,t)}}function Fi(e,t){return gs(e)&&ws(t)?Ss(js(e),t):function(n){var i=Da(n,e);return i===r&&i===t?Ta(n,e):Ri(t,i,3)}}function Yi(e,t,n,i,s){e!==t&&bi(t,(function(o,a){if(s||(s=new Gn),ea(o))!function(e,t,n,i,s,o,a){var c=Ds(e,n),l=Ds(t,n),u=a.get(l);if(u)Zn(e,n,u);else{var d=o?o(c,l,n+"",e,t,a):r,h=d===r;if(h){var f=Vo(l),p=!f&&qo(l),m=!f&&!p&&la(l);d=l,f||p||m?Vo(c)?d=c:Go(c)?d=Dr(c):p?(h=!1,d=vr(l,!0)):m?(h=!1,d=Sr(l,!0)):d=[]:ra(l)||Wo(l)?(d=c,Wo(c)?d=ga(c):ea(c)&&!Ko(c)||(d=fs(l))):h=!1}h&&(a.set(l,d),s(d,l,i,o,a),a.delete(l)),Zn(e,n,d)}}(e,t,a,n,Yi,i,s);else{var c=i?i(Ds(e,a),o,a+"",e,t,s):r;c===r&&(c=o),Zn(e,a,c)}}),Ea)}function zi(e,t){var n=e.length;if(n)return ms(t+=t<0?n:0,n)?e[t]:r}function $i(e,t,n){t=t.length?kt(t,(function(e){return Vo(e)?function(t){return wi(t,1===e.length?e[0]:e)}:e})):[ic];var i=-1;return t=kt(t,Wt(ss())),function(e,t){var i=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var i=-1,r=e.criteria,s=t.criteria,o=r.length,a=n.length;++i<o;){var c=Mr(r[i],s[i]);if(c)return i>=a?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)}));i--;)e[i]=e[i].value;return e}(ji(e,(function(e,n,r){return{criteria:kt(t,(function(t){return t(e)})),index:++i,value:e}})))}function Hi(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var o=t[i],a=wi(e,o);n(a,o)&&Qi(s,br(o,e),a)}return s}function Wi(e,t,n,i){var r=i?It:At,s=-1,o=t.length,a=e;for(e===t&&(t=Dr(t)),n&&(a=kt(e,Wt(n)));++s<o;)for(var c=0,l=t[s],u=n?n(l):l;(c=r(a,u,c,i))>-1;)a!==e&&et.call(a,c,1),et.call(e,c,1);return e}function Vi(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==s){var s=r;ms(r)?et.call(e,r,1):cr(e,r)}}return e}function Bi(e,t){return e+un(vn()*(t-e+1))}function Ui(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=un(t/2))&&(e+=e)}while(t);return n}function Gi(e,t){return Os(Ms(e,t,ic),e+"")}function qi(e){return Jn(za(e))}function Ji(e,t){var n=za(e);return Es(n,si(t,0,n.length))}function Qi(e,t,n,i){if(!ea(e))return e;for(var s=-1,o=(t=br(t,e)).length,a=o-1,c=e;null!=c&&++s<o;){var l=js(t[s]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(s!=a){var d=c[l];(u=i?i(d,l,c):r)===r&&(u=ea(d)?d:ms(t[s+1])?[]:{})}Xn(c,l,u),c=c[l]}return e}var Ki=Cn?function(e,t){return Cn.set(e,t),e}:ic,Zi=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:ec(t),writable:!0})}:ic;function Xi(e){return Es(za(e))}function er(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=i(s);++r<s;)o[r]=e[r+t];return o}function tr(e,t){var n;return ui(e,(function(e,i,r){return!(n=t(e,i,r))})),!!n}function nr(e,t,n){var i=0,r=null==e?i:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;i<r;){var s=i+r>>>1,o=e[s];null!==o&&!ca(o)&&(n?o<=t:o<t)?i=s+1:r=s}return r}return ir(e,t,ic,n)}function ir(e,t,n,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,c=null===t,l=ca(t),u=t===r;s<o;){var d=un((s+o)/2),h=n(e[d]),f=h!==r,p=null===h,m=h==h,b=ca(h);if(a)var g=i||m;else g=u?m&&(i||f):c?m&&f&&(i||!p):l?m&&f&&!p&&(i||!b):!p&&!b&&(i?h<=t:h<t);g?s=d+1:o=d}return gn(o,4294967294)}function rr(e,t){for(var n=-1,i=e.length,r=0,s=[];++n<i;){var o=e[n],a=t?t(o):o;if(!n||!zo(a,c)){var c=a;s[r++]=0===o?0:o}}return s}function sr(e){return"number"==typeof e?e:ca(e)?h:+e}function or(e){if("string"==typeof e)return e;if(Vo(e))return kt(e,or)+"";if(ca(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ar(e,t,n){var i=-1,r=Mt,s=e.length,o=!0,a=[],c=a;if(n)o=!1,r=xt;else if(s>=200){var l=t?null:Ur(e);if(l)return nn(l);o=!1,r=Bt,c=new Un}else c=t?[]:a;e:for(;++i<s;){var u=e[i],d=t?t(u):u;if(u=n||0!==u?u:0,o&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),a.push(u)}else r(c,d,n)||(c!==a&&c.push(d),a.push(u))}return a}function cr(e,t){return null==(e=xs(e,t=br(t,e)))||delete e[js(Js(t))]}function lr(e,t,n,i){return Qi(e,t,n(wi(e,t)),i)}function ur(e,t,n,i){for(var r=e.length,s=i?r:-1;(i?s--:++s<r)&&t(e[s],s,e););return n?er(e,i?0:s,i?s+1:r):er(e,i?s+1:0,i?r:s)}function dr(e,t){var n=e;return n instanceof Hn&&(n=n.value()),Tt(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),n)}function hr(e,t,n){var r=e.length;if(r<2)return r?ar(e[0]):[];for(var s=-1,o=i(r);++s<r;)for(var a=e[s],c=-1;++c<r;)c!=s&&(o[s]=li(o[s]||a,e[c],t,n));return ar(mi(o,1),t,n)}function fr(e,t,n){for(var i=-1,s=e.length,o=t.length,a={};++i<s;)n(a,e[i],i<o?t[i]:r);return a}function pr(e){return Go(e)?e:[]}function mr(e){return"function"==typeof e?e:ic}function br(e,t){return Vo(e)?e:gs(e,t)?[e]:Ps(_a(e))}var gr=Gi;function _r(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:er(e,t,n)}var yr=lt||function(e){return st.clearTimeout(e)};function vr(e,t){if(t)return e.slice();var n=e.length,i=He?He(n):new e.constructor(n);return e.copy(i),i}function wr(e){var t=new e.constructor(e.byteLength);return new $e(t).set(new $e(e)),t}function Sr(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Mr(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,o=ca(e),a=t!==r,c=null===t,l=t==t,u=ca(t);if(!c&&!u&&!o&&e>t||o&&a&&l&&!c&&!u||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!u&&e<t||u&&n&&s&&!i&&!o||c&&n&&s||!a&&s||!l)return-1}return 0}function xr(e,t,n,r){for(var s=-1,o=e.length,a=n.length,c=-1,l=t.length,u=bn(o-a,0),d=i(l+u),h=!r;++c<l;)d[c]=t[c];for(;++s<a;)(h||s<o)&&(d[n[s]]=e[s]);for(;u--;)d[c++]=e[s++];return d}function kr(e,t,n,r){for(var s=-1,o=e.length,a=-1,c=n.length,l=-1,u=t.length,d=bn(o-c,0),h=i(d+u),f=!r;++s<d;)h[s]=e[s];for(var p=s;++l<u;)h[p+l]=t[l];for(;++a<c;)(f||s<o)&&(h[p+n[a]]=e[s++]);return h}function Dr(e,t){var n=-1,r=e.length;for(t||(t=i(r));++n<r;)t[n]=e[n];return t}function Tr(e,t,n,i){var s=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],l=i?i(n[c],e[c],c,n,e):r;l===r&&(l=e[c]),s?ii(n,c,l):Xn(n,c,l)}return n}function Cr(e,t){return function(n,i){var r=Vo(n)?_t:ti,s=t?t():{};return r(n,e,ss(i,2),s)}}function Or(e){return Gi((function(t,n){var i=-1,s=n.length,o=s>1?n[s-1]:r,a=s>2?n[2]:r;for(o=e.length>3&&"function"==typeof o?(s--,o):r,a&&bs(n[0],n[1],a)&&(o=s<3?r:o,s=1),t=xe(t);++i<s;){var c=n[i];c&&e(t,c,i,o)}return t}))}function Rr(e,t){return function(n,i){if(null==n)return n;if(!Uo(n))return e(n,i);for(var r=n.length,s=t?r:-1,o=xe(n);(t?s--:++s<r)&&!1!==i(o[s],s,o););return n}}function Lr(e){return function(t,n,i){for(var r=-1,s=xe(t),o=i(t),a=o.length;a--;){var c=o[e?a:++r];if(!1===n(s[c],c,s))break}return t}}function Er(e){return function(t){var n=Zt(t=_a(t))?on(t):r,i=n?n[0]:t.charAt(0),s=n?_r(n,1).join(""):t.slice(1);return i[e]()+s}}function Ar(e){return function(t){return Tt(Ka(Wa(t).replace(Ve,"")),e,"")}}function Ir(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Yn(e.prototype),i=e.apply(n,t);return ea(i)?i:n}}function Pr(e){return function(t,n,i){var s=xe(t);if(!Uo(t)){var o=ss(n,3);t=La(t),n=function(e){return o(s[e],e,s)}}var a=e(t,n,i);return a>-1?s[o?t[a]:a]:r}}function jr(e){return Xr((function(t){var n=t.length,i=n,o=$n.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Te(s);if(o&&!c&&"wrapper"==is(a))var c=new $n([],!0)}for(i=c?i:n;++i<n;){var l=is(a=t[i]),u="wrapper"==l?ns(a):r;c=u&&_s(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[is(u[0])].apply(c,u[3]):1==a.length&&_s(a)?c[l]():c.thru(a)}return function(){var e=arguments,i=e[0];if(c&&1==e.length&&Vo(i))return c.plant(i).value();for(var r=0,s=n?t[r].apply(this,e):i;++r<n;)s=t[r].call(this,s);return s}}))}function Nr(e,t,n,s,o,a,c,u,d,h){var f=t&l,p=1&t,m=2&t,b=24&t,g=512&t,_=m?r:Ir(e);return function r(){for(var l=arguments.length,y=i(l),v=l;v--;)y[v]=arguments[v];if(b)var w=rs(r),S=qt(y,w);if(s&&(y=xr(y,s,o,b)),a&&(y=kr(y,a,c,b)),l-=S,b&&l<h){var M=tn(y,w);return Vr(e,t,Nr,r.placeholder,n,y,M,u,d,h-l)}var x=p?n:this,k=m?x[e]:e;return l=y.length,u?y=ks(y,u):g&&l>1&&y.reverse(),f&&d<l&&(y.length=d),this&&this!==st&&this instanceof r&&(k=_||Ir(k)),k.apply(x,y)}}function Fr(e,t){return function(n,i){return function(e,t,n,i){return _i(e,(function(e,r,s){t(i,n(e),r,s)})),i}(n,e,t(i),{})}}function Yr(e,t){return function(n,i){var s;if(n===r&&i===r)return t;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=or(n),i=or(i)):(n=sr(n),i=sr(i)),s=e(n,i)}return s}}function zr(e){return Xr((function(t){return t=kt(t,Wt(ss())),Gi((function(n){var i=this;return e(t,(function(e){return gt(e,i,n)}))}))}))}function $r(e,t){var n=(t=t===r?" ":or(t)).length;if(n<2)return n?Ui(t,e):t;var i=Ui(t,Ft(e/sn(t)));return Zt(t)?_r(on(i),0,e).join(""):i.slice(0,e)}function Hr(e){return function(t,n,s){return s&&"number"!=typeof s&&bs(t,n,s)&&(n=s=r),t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,n,r){for(var s=-1,o=bn(Ft((t-e)/(n||1)),0),a=i(o);o--;)a[r?o:++s]=e,e+=n;return a}(t,n,s=s===r?t<n?1:-1:fa(s),e)}}function Wr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ba(t),n=ba(n)),e(t,n)}}function Vr(e,t,n,i,s,o,a,l,u,d){var h=8&t;t|=h?c:64,4&(t&=~(h?64:c))||(t&=-4);var f=[e,t,s,h?o:r,h?a:r,h?r:o,h?r:a,l,u,d],p=n.apply(r,f);return _s(e)&&Ts(p,f),p.placeholder=i,Rs(p,e,t)}function Br(e){var t=Me[e];return function(e,n){if(e=ba(e),(n=null==n?0:gn(pa(n),292))&&fn(e)){var i=(_a(e)+"e").split("e");return+((i=(_a(t(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return t(e)}}var Ur=kn&&1/nn(new kn([,-0]))[1]==u?function(e){return new kn(e)}:cc;function Gr(e){return function(t){var n=ds(t);return n==S?Xt(t):n==T?rn(t):function(e,t){return kt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function qr(e,t,n,o,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Te(s);var m=o?o.length:0;if(m||(t&=-97,o=u=r),h=h===r?h:bn(pa(h),0),f=f===r?f:pa(f),m-=u?u.length:0,64&t){var b=o,g=u;o=u=r}var _=p?r:ns(e),y=[e,t,n,o,u,b,g,d,h,f];if(_&&function(e,t){var n=e[1],i=t[1],r=n|i;if(!(r<131||i==l&&8==n||i==l&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],r|=1&n?0:4);var s=t[3];if(s){var o=e[3];e[3]=o?xr(o,s,t[4]):s,e[4]=o?tn(e[3],a):t[4]}(s=t[5])&&(e[5]=(o=e[5])?kr(o,s,t[6]):s,e[6]=o?tn(e[5],a):t[6]),(s=t[7])&&(e[7]=s),i&l&&(e[8]=null==e[8]?t[8]:gn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(y,_),e=y[0],t=y[1],n=y[2],o=y[3],u=y[4],!(f=y[9]=y[9]===r?p?0:e.length:bn(y[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)v=8==t||16==t?function(e,t,n){var s=Ir(e);return function o(){for(var a=arguments.length,c=i(a),l=a,u=rs(o);l--;)c[l]=arguments[l];var d=a<3&&c[0]!==u&&c[a-1]!==u?[]:tn(c,u);return(a-=d.length)<n?Vr(e,t,Nr,o.placeholder,r,c,d,r,r,n-a):gt(this&&this!==st&&this instanceof o?s:e,this,c)}}(e,t,f):t!=c&&33!=t||u.length?Nr.apply(r,y):function(e,t,n,r){var s=1&t,o=Ir(e);return function t(){for(var a=-1,c=arguments.length,l=-1,u=r.length,d=i(u+c),h=this&&this!==st&&this instanceof t?o:e;++l<u;)d[l]=r[l];for(;c--;)d[l++]=arguments[++a];return gt(h,s?n:this,d)}}(e,t,n,o);else var v=function(e,t,n){var i=1&t,r=Ir(e);return function t(){return(this&&this!==st&&this instanceof t?r:e).apply(i?n:this,arguments)}}(e,t,n);return Rs((_?Ki:Ts)(v,y),e,t)}function Jr(e,t,n,i){return e===r||zo(e,Oe[n])&&!Ee.call(i,n)?t:e}function Qr(e,t,n,i,s,o){return ea(e)&&ea(t)&&(o.set(t,e),Yi(e,t,r,Qr,o),o.delete(t)),e}function Kr(e){return ra(e)?r:e}function Zr(e,t,n,i,s,o){var a=1&n,c=e.length,l=t.length;if(c!=l&&!(a&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&n?new Un:r;for(o.set(e,t),o.set(t,e);++h<c;){var m=e[h],b=t[h];if(i)var g=a?i(b,m,h,t,e,o):i(m,b,h,e,t,o);if(g!==r){if(g)continue;f=!1;break}if(p){if(!Ot(t,(function(e,t){if(!Bt(p,t)&&(m===e||s(m,e,n,i,o)))return p.push(t)}))){f=!1;break}}else if(m!==b&&!s(m,b,n,i,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Xr(e){return Os(Ms(e,r,Vs),e+"")}function es(e){return Si(e,La,ls)}function ts(e){return Si(e,Ea,us)}var ns=Cn?function(e){return Cn.get(e)}:cc;function is(e){for(var t=e.name+"",n=On[t],i=Ee.call(On,t)?n.length:0;i--;){var r=n[i],s=r.func;if(null==s||s==e)return r.name}return t}function rs(e){return(Ee.call(Fn,"placeholder")?Fn:e).placeholder}function ss(){var e=Fn.iteratee||rc;return e=e===rc?Ai:e,arguments.length?e(arguments[0],arguments[1]):e}function os(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function as(e){for(var t=La(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,ws(r)]}return t}function cs(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Ei(n)?n:r}var ls=dn?function(e){return null==e?[]:(e=xe(e),St(dn(e),(function(t){return qe.call(e,t)})))}:mc,us=dn?function(e){for(var t=[];e;)Dt(t,ls(e)),e=We(e);return t}:mc,ds=Mi;function hs(e,t,n){for(var i=-1,r=(t=br(t,e)).length,s=!1;++i<r;){var o=js(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=r?s:!!(r=null==e?0:e.length)&&Xo(r)&&ms(o,r)&&(Vo(e)||Wo(e))}function fs(e){return"function"!=typeof e.constructor||vs(e)?{}:Yn(We(e))}function ps(e){return Vo(e)||Wo(e)||!!(it&&e&&e[it])}function ms(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function bs(e,t,n){if(!ea(n))return!1;var i=typeof t;return!!("number"==i?Uo(n)&&ms(t,n.length):"string"==i&&t in n)&&zo(n[t],e)}function gs(e,t){if(Vo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ca(e))||X.test(e)||!Z.test(e)||null!=t&&e in xe(t)}function _s(e){var t=is(e),n=Fn[t];if("function"!=typeof n||!(t in Hn.prototype))return!1;if(e===n)return!0;var i=ns(n);return!!i&&e===i[0]}(Sn&&ds(new Sn(new ArrayBuffer(1)))!=E||Mn&&ds(new Mn)!=S||xn&&ds(xn.resolve())!=k||kn&&ds(new kn)!=T||Dn&&ds(new Dn)!=R)&&(ds=function(e){var t=Mi(e),n=t==x?e.constructor:r,i=n?Ns(n):"";if(i)switch(i){case Rn:return E;case Ln:return S;case En:return k;case An:return T;case In:return R}return t});var ys=Re?Ko:bc;function vs(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function ws(e){return e==e&&!ea(e)}function Ss(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in xe(n))}}function Ms(e,t,n){return t=bn(t===r?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=bn(r.length-t,0),a=i(o);++s<o;)a[s]=r[t+s];s=-1;for(var c=i(t+1);++s<t;)c[s]=r[s];return c[t]=n(a),gt(e,this,c)}}function xs(e,t){return t.length<2?e:wi(e,er(t,0,-1))}function ks(e,t){for(var n=e.length,i=gn(t.length,n),s=Dr(e);i--;){var o=t[i];e[i]=ms(o,n)?s[o]:r}return e}function Ds(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ts=Ls(Ki),Cs=Rt||function(e,t){return st.setTimeout(e,t)},Os=Ls(Zi);function Rs(e,t,n){var i=t+"";return Os(e,function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return yt(p,(function(n){var i="_."+n[0];t&n[1]&&!Mt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(i),n)))}function Ls(e){var t=0,n=0;return function(){var i=_n(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Es(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n<t;){var o=Bi(n,s),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var As,Is,Ps=(As=Io((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,i,r){t.push(i?r.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===Is.size&&Is.clear(),e})),Is=As.cache,As);function js(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ns(e){if(null!=e){try{return Le.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Fs(e){if(e instanceof Hn)return e.clone();var t=new $n(e.__wrapped__,e.__chain__);return t.__actions__=Dr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ys=Gi((function(e,t){return Go(e)?li(e,mi(t,1,Go,!0)):[]})),zs=Gi((function(e,t){var n=Js(t);return Go(n)&&(n=r),Go(e)?li(e,mi(t,1,Go,!0),ss(n,2)):[]})),$s=Gi((function(e,t){var n=Js(t);return Go(n)&&(n=r),Go(e)?li(e,mi(t,1,Go,!0),r,n):[]}));function Hs(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:pa(n);return r<0&&(r=bn(i+r,0)),Et(e,ss(t,3),r)}function Ws(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==r&&(s=pa(n),s=n<0?bn(i+s,0):gn(s,i-1)),Et(e,ss(t,3),s,!0)}function Vs(e){return null!=e&&e.length?mi(e,1):[]}function Bs(e){return e&&e.length?e[0]:r}var Us=Gi((function(e){var t=kt(e,pr);return t.length&&t[0]===e[0]?Ti(t):[]})),Gs=Gi((function(e){var t=Js(e),n=kt(e,pr);return t===Js(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Ti(n,ss(t,2)):[]})),qs=Gi((function(e){var t=Js(e),n=kt(e,pr);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Ti(n,r,t):[]}));function Js(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Qs=Gi(Ks);function Ks(e,t){return e&&e.length&&t&&t.length?Wi(e,t):e}var Zs=Xr((function(e,t){var n=null==e?0:e.length,i=ri(e,t);return Vi(e,kt(t,(function(e){return ms(e,n)?+e:e})).sort(Mr)),i}));function Xs(e){return null==e?e:wn.call(e)}var eo=Gi((function(e){return ar(mi(e,1,Go,!0))})),to=Gi((function(e){var t=Js(e);return Go(t)&&(t=r),ar(mi(e,1,Go,!0),ss(t,2))})),no=Gi((function(e){var t=Js(e);return t="function"==typeof t?t:r,ar(mi(e,1,Go,!0),r,t)}));function io(e){if(!e||!e.length)return[];var t=0;return e=St(e,(function(e){if(Go(e))return t=bn(e.length,t),!0})),$t(t,(function(t){return kt(e,Nt(t))}))}function ro(e,t){if(!e||!e.length)return[];var n=io(e);return null==t?n:kt(n,(function(e){return gt(t,r,e)}))}var so=Gi((function(e,t){return Go(e)?li(e,t):[]})),oo=Gi((function(e){return hr(St(e,Go))})),ao=Gi((function(e){var t=Js(e);return Go(t)&&(t=r),hr(St(e,Go),ss(t,2))})),co=Gi((function(e){var t=Js(e);return t="function"==typeof t?t:r,hr(St(e,Go),r,t)})),lo=Gi(io),uo=Gi((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ro(e,n)}));function ho(e){var t=Fn(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var po=Xr((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return ri(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&ms(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:fo,args:[s],thisArg:r}),new $n(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(s)})),mo=Cr((function(e,t,n){Ee.call(e,n)?++e[n]:ii(e,n,1)})),bo=Pr(Hs),go=Pr(Ws);function _o(e,t){return(Vo(e)?yt:ui)(e,ss(t,3))}function yo(e,t){return(Vo(e)?vt:di)(e,ss(t,3))}var vo=Cr((function(e,t,n){Ee.call(e,n)?e[n].push(t):ii(e,n,[t])})),wo=Gi((function(e,t,n){var r=-1,s="function"==typeof t,o=Uo(e)?i(e.length):[];return ui(e,(function(e){o[++r]=s?gt(t,e,n):Ci(e,t,n)})),o})),So=Cr((function(e,t,n){ii(e,n,t)}));function Mo(e,t){return(Vo(e)?kt:ji)(e,ss(t,3))}var xo=Cr((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),ko=Gi((function(e,t){if(null==e)return[];var n=t.length;return n>1&&bs(e,t[0],t[1])?t=[]:n>2&&bs(t[0],t[1],t[2])&&(t=[t[0]]),$i(e,mi(t,1),[])})),Do=ut||function(){return st.Date.now()};function To(e,t,n){return t=n?r:t,qr(e,l,r,r,r,r,t=e&&null==t?e.length:t)}function Co(e,t){var n;if("function"!=typeof t)throw new Te(s);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Oo=Gi((function(e,t,n){var i=1;if(n.length){var r=tn(n,rs(Oo));i|=c}return qr(e,i,t,n,r)})),Ro=Gi((function(e,t,n){var i=3;if(n.length){var r=tn(n,rs(Ro));i|=c}return qr(t,i,e,n,r)}));function Lo(e,t,n){var i,o,a,c,l,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Te(s);function m(t){var n=i,s=o;return i=o=r,d=t,c=e.apply(s,n)}function b(e){return d=e,l=Cs(_,t),h?m(e):c}function g(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=a}function _(){var e=Do();if(g(e))return y(e);l=Cs(_,function(e){var n=t-(e-u);return f?gn(n,a-(e-d)):n}(e))}function y(e){return l=r,p&&i?m(e):(i=o=r,c)}function v(){var e=Do(),n=g(e);if(i=arguments,o=this,u=e,n){if(l===r)return b(u);if(f)return yr(l),l=Cs(_,t),m(u)}return l===r&&(l=Cs(_,t)),c}return t=ba(t)||0,ea(n)&&(h=!!n.leading,a=(f="maxWait"in n)?bn(ba(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){l!==r&&yr(l),d=0,i=u=o=l=r},v.flush=function(){return l===r?c:y(Do())},v}var Eo=Gi((function(e,t){return ci(e,1,t)})),Ao=Gi((function(e,t,n){return ci(e,ba(t)||0,n)}));function Io(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(s);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Io.Cache||Bn),n}function Po(e){if("function"!=typeof e)throw new Te(s);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Io.Cache=Bn;var jo=gr((function(e,t){var n=(t=1==t.length&&Vo(t[0])?kt(t[0],Wt(ss())):kt(mi(t,1),Wt(ss()))).length;return Gi((function(i){for(var r=-1,s=gn(i.length,n);++r<s;)i[r]=t[r].call(this,i[r]);return gt(e,this,i)}))})),No=Gi((function(e,t){var n=tn(t,rs(No));return qr(e,c,r,t,n)})),Fo=Gi((function(e,t){var n=tn(t,rs(Fo));return qr(e,64,r,t,n)})),Yo=Xr((function(e,t){return qr(e,256,r,r,r,t)}));function zo(e,t){return e===t||e!=e&&t!=t}var $o=Wr(xi),Ho=Wr((function(e,t){return e>=t})),Wo=Oi(function(){return arguments}())?Oi:function(e){return ta(e)&&Ee.call(e,"callee")&&!qe.call(e,"callee")},Vo=i.isArray,Bo=dt?Wt(dt):function(e){return ta(e)&&Mi(e)==L};function Uo(e){return null!=e&&Xo(e.length)&&!Ko(e)}function Go(e){return ta(e)&&Uo(e)}var qo=hn||bc,Jo=ht?Wt(ht):function(e){return ta(e)&&Mi(e)==_};function Qo(e){if(!ta(e))return!1;var t=Mi(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ko(e){if(!ea(e))return!1;var t=Mi(e);return t==v||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zo(e){return"number"==typeof e&&e==pa(e)}function Xo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ea(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ta(e){return null!=e&&"object"==typeof e}var na=ft?Wt(ft):function(e){return ta(e)&&ds(e)==S};function ia(e){return"number"==typeof e||ta(e)&&Mi(e)==M}function ra(e){if(!ta(e)||Mi(e)!=x)return!1;var t=We(e);if(null===t)return!0;var n=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Le.call(n)==je}var sa=pt?Wt(pt):function(e){return ta(e)&&Mi(e)==D},oa=mt?Wt(mt):function(e){return ta(e)&&ds(e)==T};function aa(e){return"string"==typeof e||!Vo(e)&&ta(e)&&Mi(e)==C}function ca(e){return"symbol"==typeof e||ta(e)&&Mi(e)==O}var la=bt?Wt(bt):function(e){return ta(e)&&Xo(e.length)&&!!Ze[Mi(e)]},ua=Wr(Pi),da=Wr((function(e,t){return e<=t}));function ha(e){if(!e)return[];if(Uo(e))return aa(e)?on(e):Dr(e);if(rt&&e[rt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[rt]());var t=ds(e);return(t==S?Xt:t==T?nn:za)(e)}function fa(e){return e?(e=ba(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function ma(e){return e?si(pa(e),0,f):0}function ba(e){if("number"==typeof e)return e;if(ca(e))return h;if(ea(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ea(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var n=pe.test(e);return n||be.test(e)?nt(e.slice(2),n?2:8):fe.test(e)?h:+e}function ga(e){return Tr(e,Ea(e))}function _a(e){return null==e?"":or(e)}var ya=Or((function(e,t){if(vs(t)||Uo(t))Tr(t,La(t),e);else for(var n in t)Ee.call(t,n)&&Xn(e,n,t[n])})),va=Or((function(e,t){Tr(t,Ea(t),e)})),wa=Or((function(e,t,n,i){Tr(t,Ea(t),e,i)})),Sa=Or((function(e,t,n,i){Tr(t,La(t),e,i)})),Ma=Xr(ri),xa=Gi((function(e,t){e=xe(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&bs(t[0],t[1],s)&&(i=1);++n<i;)for(var o=t[n],a=Ea(o),c=-1,l=a.length;++c<l;){var u=a[c],d=e[u];(d===r||zo(d,Oe[u])&&!Ee.call(e,u))&&(e[u]=o[u])}return e})),ka=Gi((function(e){return e.push(r,Qr),gt(Ia,r,e)}));function Da(e,t,n){var i=null==e?r:wi(e,t);return i===r?n:i}function Ta(e,t){return null!=e&&hs(e,t,Di)}var Ca=Fr((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),e[t]=n}),ec(ic)),Oa=Fr((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),Ee.call(e,t)?e[t].push(n):e[t]=[n]}),ss),Ra=Gi(Ci);function La(e){return Uo(e)?qn(e):Ii(e)}function Ea(e){return Uo(e)?qn(e,!0):function(e){if(!ea(e))return function(e){var t=[];if(null!=e)for(var n in xe(e))t.push(n);return t}(e);var t=vs(e),n=[];for(var i in e)("constructor"!=i||!t&&Ee.call(e,i))&&n.push(i);return n}(e)}var Aa=Or((function(e,t,n){Yi(e,t,n)})),Ia=Or((function(e,t,n,i){Yi(e,t,n,i)})),Pa=Xr((function(e,t){var n={};if(null==e)return n;var i=!1;t=kt(t,(function(t){return t=br(t,e),i||(i=t.length>1),t})),Tr(e,ts(e),n),i&&(n=oi(n,7,Kr));for(var r=t.length;r--;)cr(n,t[r]);return n})),ja=Xr((function(e,t){return null==e?{}:function(e,t){return Hi(e,t,(function(t,n){return Ta(e,n)}))}(e,t)}));function Na(e,t){if(null==e)return{};var n=kt(ts(e),(function(e){return[e]}));return t=ss(t),Hi(e,n,(function(e,n){return t(e,n[0])}))}var Fa=Gr(La),Ya=Gr(Ea);function za(e){return null==e?[]:Vt(e,La(e))}var $a=Ar((function(e,t,n){return t=t.toLowerCase(),e+(n?Ha(t):t)}));function Ha(e){return Qa(_a(e).toLowerCase())}function Wa(e){return(e=_a(e))&&e.replace(_e,Jt).replace(Be,"")}var Va=Ar((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ba=Ar((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ua=Er("toLowerCase"),Ga=Ar((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),qa=Ar((function(e,t,n){return e+(n?" ":"")+Qa(t)})),Ja=Ar((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Qa=Er("toUpperCase");function Ka(e,t,n){return e=_a(e),(t=n?r:t)===r?function(e){return Je.test(e)}(e)?function(e){return e.match(Ge)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Za=Gi((function(e,t){try{return gt(e,r,t)}catch(n){return Qo(n)?n:new we(n)}})),Xa=Xr((function(e,t){return yt(t,(function(t){t=js(t),ii(e,t,Oo(e[t],e))})),e}));function ec(e){return function(){return e}}var tc=jr(),nc=jr(!0);function ic(e){return e}function rc(e){return Ai("function"==typeof e?e:oi(e,1))}var sc=Gi((function(e,t){return function(n){return Ci(n,e,t)}})),oc=Gi((function(e,t){return function(n){return Ci(e,n,t)}}));function ac(e,t,n){var i=La(t),r=vi(t,i);null!=n||ea(t)&&(r.length||!i.length)||(n=t,t=e,e=this,r=vi(t,La(t)));var s=!(ea(n)&&"chain"in n&&!n.chain),o=Ko(e);return yt(r,(function(n){var i=t[n];e[n]=i,o&&(e.prototype[n]=function(){var t=this.__chain__;if(s||t){var n=e(this.__wrapped__),r=n.__actions__=Dr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Dt([this.value()],arguments))})})),e}function cc(){}var lc=zr(kt),uc=zr(wt),dc=zr(Ot);function hc(e){return gs(e)?Nt(js(e)):function(e){return function(t){return wi(t,e)}}(e)}var fc=Hr(),pc=Hr(!0);function mc(){return[]}function bc(){return!1}var gc,_c=Yr((function(e,t){return e+t}),0),yc=Br("ceil"),vc=Yr((function(e,t){return e/t}),1),wc=Br("floor"),Sc=Yr((function(e,t){return e*t}),1),Mc=Br("round"),xc=Yr((function(e,t){return e-t}),0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Te(s);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=To,Fn.assign=ya,Fn.assignIn=va,Fn.assignInWith=wa,Fn.assignWith=Sa,Fn.at=Ma,Fn.before=Co,Fn.bind=Oo,Fn.bindAll=Xa,Fn.bindKey=Ro,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Vo(e)?e:[e]},Fn.chain=ho,Fn.chunk=function(e,t,n){t=(n?bs(e,t,n):t===r)?1:bn(pa(t),0);var s=null==e?0:e.length;if(!s||t<1)return[];for(var o=0,a=0,c=i(Ft(s/t));o<s;)c[a++]=er(e,o,o+=t);return c},Fn.compact=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var s=e[t];s&&(r[i++]=s)}return r},Fn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Dt(Vo(n)?Dr(n):[n],mi(t,1))},Fn.cond=function(e){var t=null==e?0:e.length,n=ss();return e=t?kt(e,(function(e){if("function"!=typeof e[1])throw new Te(s);return[n(e[0]),e[1]]})):[],Gi((function(n){for(var i=-1;++i<t;){var r=e[i];if(gt(r[0],this,n))return gt(r[1],this,n)}}))},Fn.conforms=function(e){return function(e){var t=La(e);return function(n){return ai(n,e,t)}}(oi(e,1))},Fn.constant=ec,Fn.countBy=mo,Fn.create=function(e,t){var n=Yn(e);return null==t?n:ni(n,t)},Fn.curry=function e(t,n,i){var s=qr(t,8,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Fn.curryRight=function e(t,n,i){var s=qr(t,16,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Fn.debounce=Lo,Fn.defaults=xa,Fn.defaultsDeep=ka,Fn.defer=Eo,Fn.delay=Ao,Fn.difference=Ys,Fn.differenceBy=zs,Fn.differenceWith=$s,Fn.drop=function(e,t,n){var i=null==e?0:e.length;return i?er(e,(t=n||t===r?1:pa(t))<0?0:t,i):[]},Fn.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?er(e,0,(t=i-(t=n||t===r?1:pa(t)))<0?0:t):[]},Fn.dropRightWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!0,!0):[]},Fn.dropWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!0):[]},Fn.fill=function(e,t,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&bs(e,t,n)&&(n=0,i=s),function(e,t,n,i){var s=e.length;for((n=pa(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:pa(i))<0&&(i+=s),i=n>i?0:ma(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Fn.filter=function(e,t){return(Vo(e)?St:pi)(e,ss(t,3))},Fn.flatMap=function(e,t){return mi(Mo(e,t),1)},Fn.flatMapDeep=function(e,t){return mi(Mo(e,t),u)},Fn.flatMapDepth=function(e,t,n){return n=n===r?1:pa(n),mi(Mo(e,t),n)},Fn.flatten=Vs,Fn.flattenDeep=function(e){return null!=e&&e.length?mi(e,u):[]},Fn.flattenDepth=function(e,t){return null!=e&&e.length?mi(e,t=t===r?1:pa(t)):[]},Fn.flip=function(e){return qr(e,512)},Fn.flow=tc,Fn.flowRight=nc,Fn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i},Fn.functions=function(e){return null==e?[]:vi(e,La(e))},Fn.functionsIn=function(e){return null==e?[]:vi(e,Ea(e))},Fn.groupBy=vo,Fn.initial=function(e){return null!=e&&e.length?er(e,0,-1):[]},Fn.intersection=Us,Fn.intersectionBy=Gs,Fn.intersectionWith=qs,Fn.invert=Ca,Fn.invertBy=Oa,Fn.invokeMap=wo,Fn.iteratee=rc,Fn.keyBy=So,Fn.keys=La,Fn.keysIn=Ea,Fn.map=Mo,Fn.mapKeys=function(e,t){var n={};return t=ss(t,3),_i(e,(function(e,i,r){ii(n,t(e,i,r),e)})),n},Fn.mapValues=function(e,t){var n={};return t=ss(t,3),_i(e,(function(e,i,r){ii(n,i,t(e,i,r))})),n},Fn.matches=function(e){return Ni(oi(e,1))},Fn.matchesProperty=function(e,t){return Fi(e,oi(t,1))},Fn.memoize=Io,Fn.merge=Aa,Fn.mergeWith=Ia,Fn.method=sc,Fn.methodOf=oc,Fn.mixin=ac,Fn.negate=Po,Fn.nthArg=function(e){return e=pa(e),Gi((function(t){return zi(t,e)}))},Fn.omit=Pa,Fn.omitBy=function(e,t){return Na(e,Po(ss(t)))},Fn.once=function(e){return Co(2,e)},Fn.orderBy=function(e,t,n,i){return null==e?[]:(Vo(t)||(t=null==t?[]:[t]),Vo(n=i?r:n)||(n=null==n?[]:[n]),$i(e,t,n))},Fn.over=lc,Fn.overArgs=jo,Fn.overEvery=uc,Fn.overSome=dc,Fn.partial=No,Fn.partialRight=Fo,Fn.partition=xo,Fn.pick=ja,Fn.pickBy=Na,Fn.property=hc,Fn.propertyOf=function(e){return function(t){return null==e?r:wi(e,t)}},Fn.pull=Qs,Fn.pullAll=Ks,Fn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Wi(e,t,ss(n,2)):e},Fn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wi(e,t,r,n):e},Fn.pullAt=Zs,Fn.range=fc,Fn.rangeRight=pc,Fn.rearg=Yo,Fn.reject=function(e,t){return(Vo(e)?St:pi)(e,Po(ss(t,3)))},Fn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],s=e.length;for(t=ss(t,3);++i<s;){var o=e[i];t(o,i,e)&&(n.push(o),r.push(i))}return Vi(e,r),n},Fn.rest=function(e,t){if("function"!=typeof e)throw new Te(s);return Gi(e,t=t===r?t:pa(t))},Fn.reverse=Xs,Fn.sampleSize=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:pa(t),(Vo(e)?Qn:Ji)(e,t)},Fn.set=function(e,t,n){return null==e?e:Qi(e,t,n)},Fn.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Qi(e,t,n,i)},Fn.shuffle=function(e){return(Vo(e)?Kn:Xi)(e)},Fn.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bs(e,t,n)?(t=0,n=i):(t=null==t?0:pa(t),n=n===r?i:pa(n)),er(e,t,n)):[]},Fn.sortBy=ko,Fn.sortedUniq=function(e){return e&&e.length?rr(e):[]},Fn.sortedUniqBy=function(e,t){return e&&e.length?rr(e,ss(t,2)):[]},Fn.split=function(e,t,n){return n&&"number"!=typeof n&&bs(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=_a(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=or(t))&&Zt(e)?_r(on(e),0,n):e.split(t,n):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Te(s);return t=null==t?0:bn(pa(t),0),Gi((function(n){var i=n[t],r=_r(n,0,t);return i&&Dt(r,i),gt(e,this,r)}))},Fn.tail=function(e){var t=null==e?0:e.length;return t?er(e,1,t):[]},Fn.take=function(e,t,n){return e&&e.length?er(e,0,(t=n||t===r?1:pa(t))<0?0:t):[]},Fn.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?er(e,(t=i-(t=n||t===r?1:pa(t)))<0?0:t,i):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?ur(e,ss(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new Te(s);return ea(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Lo(e,t,{leading:i,maxWait:t,trailing:r})},Fn.thru=fo,Fn.toArray=ha,Fn.toPairs=Fa,Fn.toPairsIn=Ya,Fn.toPath=function(e){return Vo(e)?kt(e,js):ca(e)?[e]:Dr(Ps(_a(e)))},Fn.toPlainObject=ga,Fn.transform=function(e,t,n){var i=Vo(e),r=i||qo(e)||la(e);if(t=ss(t,4),null==n){var s=e&&e.constructor;n=r?i?new s:[]:ea(e)&&Ko(s)?Yn(We(e)):{}}return(r?yt:_i)(e,(function(e,i,r){return t(n,e,i,r)})),n},Fn.unary=function(e){return To(e,1)},Fn.union=eo,Fn.unionBy=to,Fn.unionWith=no,Fn.uniq=function(e){return e&&e.length?ar(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?ar(e,ss(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ar(e,r,t):[]},Fn.unset=function(e,t){return null==e||cr(e,t)},Fn.unzip=io,Fn.unzipWith=ro,Fn.update=function(e,t,n){return null==e?e:lr(e,t,mr(n))},Fn.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:lr(e,t,mr(n),i)},Fn.values=za,Fn.valuesIn=function(e){return null==e?[]:Vt(e,Ea(e))},Fn.without=so,Fn.words=Ka,Fn.wrap=function(e,t){return No(mr(t),e)},Fn.xor=oo,Fn.xorBy=ao,Fn.xorWith=co,Fn.zip=lo,Fn.zipObject=function(e,t){return fr(e||[],t||[],Xn)},Fn.zipObjectDeep=function(e,t){return fr(e||[],t||[],Qi)},Fn.zipWith=uo,Fn.entries=Fa,Fn.entriesIn=Ya,Fn.extend=va,Fn.extendWith=wa,ac(Fn,Fn),Fn.add=_c,Fn.attempt=Za,Fn.camelCase=$a,Fn.capitalize=Ha,Fn.ceil=yc,Fn.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ba(n))==n?n:0),t!==r&&(t=(t=ba(t))==t?t:0),si(ba(e),t,n)},Fn.clone=function(e){return oi(e,4)},Fn.cloneDeep=function(e){return oi(e,5)},Fn.cloneDeepWith=function(e,t){return oi(e,5,t="function"==typeof t?t:r)},Fn.cloneWith=function(e,t){return oi(e,4,t="function"==typeof t?t:r)},Fn.conformsTo=function(e,t){return null==t||ai(e,t,La(t))},Fn.deburr=Wa,Fn.defaultTo=function(e,t){return null==e||e!=e?t:e},Fn.divide=vc,Fn.endsWith=function(e,t,n){e=_a(e),t=or(t);var i=e.length,s=n=n===r?i:si(pa(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},Fn.eq=zo,Fn.escape=function(e){return(e=_a(e))&&q.test(e)?e.replace(U,Qt):e},Fn.escapeRegExp=function(e){return(e=_a(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Fn.every=function(e,t,n){var i=Vo(e)?wt:hi;return n&&bs(e,t,n)&&(t=r),i(e,ss(t,3))},Fn.find=bo,Fn.findIndex=Hs,Fn.findKey=function(e,t){return Lt(e,ss(t,3),_i)},Fn.findLast=go,Fn.findLastIndex=Ws,Fn.findLastKey=function(e,t){return Lt(e,ss(t,3),yi)},Fn.floor=wc,Fn.forEach=_o,Fn.forEachRight=yo,Fn.forIn=function(e,t){return null==e?e:bi(e,ss(t,3),Ea)},Fn.forInRight=function(e,t){return null==e?e:gi(e,ss(t,3),Ea)},Fn.forOwn=function(e,t){return e&&_i(e,ss(t,3))},Fn.forOwnRight=function(e,t){return e&&yi(e,ss(t,3))},Fn.get=Da,Fn.gt=$o,Fn.gte=Ho,Fn.has=function(e,t){return null!=e&&hs(e,t,ki)},Fn.hasIn=Ta,Fn.head=Bs,Fn.identity=ic,Fn.includes=function(e,t,n,i){e=Uo(e)?e:za(e),n=n&&!i?pa(n):0;var r=e.length;return n<0&&(n=bn(r+n,0)),aa(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&At(e,t,n)>-1},Fn.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:pa(n);return r<0&&(r=bn(i+r,0)),At(e,t,r)},Fn.inRange=function(e,t,n){return t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,n){return e>=gn(t,n)&&e<bn(t,n)}(e=ba(e),t,n)},Fn.invoke=Ra,Fn.isArguments=Wo,Fn.isArray=Vo,Fn.isArrayBuffer=Bo,Fn.isArrayLike=Uo,Fn.isArrayLikeObject=Go,Fn.isBoolean=function(e){return!0===e||!1===e||ta(e)&&Mi(e)==g},Fn.isBuffer=qo,Fn.isDate=Jo,Fn.isElement=function(e){return ta(e)&&1===e.nodeType&&!ra(e)},Fn.isEmpty=function(e){if(null==e)return!0;if(Uo(e)&&(Vo(e)||"string"==typeof e||"function"==typeof e.splice||qo(e)||la(e)||Wo(e)))return!e.length;var t=ds(e);if(t==S||t==T)return!e.size;if(vs(e))return!Ii(e).length;for(var n in e)if(Ee.call(e,n))return!1;return!0},Fn.isEqual=function(e,t){return Ri(e,t)},Fn.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Ri(e,t,r,n):!!i},Fn.isError=Qo,Fn.isFinite=function(e){return"number"==typeof e&&fn(e)},Fn.isFunction=Ko,Fn.isInteger=Zo,Fn.isLength=Xo,Fn.isMap=na,Fn.isMatch=function(e,t){return e===t||Li(e,t,as(t))},Fn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Li(e,t,as(t),n)},Fn.isNaN=function(e){return ia(e)&&e!=+e},Fn.isNative=function(e){if(ys(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ei(e)},Fn.isNil=function(e){return null==e},Fn.isNull=function(e){return null===e},Fn.isNumber=ia,Fn.isObject=ea,Fn.isObjectLike=ta,Fn.isPlainObject=ra,Fn.isRegExp=sa,Fn.isSafeInteger=function(e){return Zo(e)&&e>=-9007199254740991&&e<=d},Fn.isSet=oa,Fn.isString=aa,Fn.isSymbol=ca,Fn.isTypedArray=la,Fn.isUndefined=function(e){return e===r},Fn.isWeakMap=function(e){return ta(e)&&ds(e)==R},Fn.isWeakSet=function(e){return ta(e)&&"[object WeakSet]"==Mi(e)},Fn.join=function(e,t){return null==e?"":pn.call(e,t)},Fn.kebabCase=Va,Fn.last=Js,Fn.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=pa(n))<0?bn(i+s,0):gn(s,i-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,s):Et(e,Pt,s,!0)},Fn.lowerCase=Ba,Fn.lowerFirst=Ua,Fn.lt=ua,Fn.lte=da,Fn.max=function(e){return e&&e.length?fi(e,ic,xi):r},Fn.maxBy=function(e,t){return e&&e.length?fi(e,ss(t,2),xi):r},Fn.mean=function(e){return jt(e,ic)},Fn.meanBy=function(e,t){return jt(e,ss(t,2))},Fn.min=function(e){return e&&e.length?fi(e,ic,Pi):r},Fn.minBy=function(e,t){return e&&e.length?fi(e,ss(t,2),Pi):r},Fn.stubArray=mc,Fn.stubFalse=bc,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=Sc,Fn.nth=function(e,t){return e&&e.length?zi(e,pa(t)):r},Fn.noConflict=function(){return st._===this&&(st._=Ne),this},Fn.noop=cc,Fn.now=Do,Fn.pad=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return $r(un(r),n)+e+$r(Ft(r),n)},Fn.padEnd=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;return t&&i<t?e+$r(t-i,n):e},Fn.padStart=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;return t&&i<t?$r(t-i,n)+e:e},Fn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),yn(_a(e).replace(ie,""),t||0)},Fn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bs(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var s=vn();return gn(e+s*(t-e+tt("1e-"+((s+"").length-1))),t)}return Bi(e,t)},Fn.reduce=function(e,t,n){var i=Vo(e)?Tt:Yt,r=arguments.length<3;return i(e,ss(t,4),n,r,ui)},Fn.reduceRight=function(e,t,n){var i=Vo(e)?Ct:Yt,r=arguments.length<3;return i(e,ss(t,4),n,r,di)},Fn.repeat=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:pa(t),Ui(_a(e),t)},Fn.replace=function(){var e=arguments,t=_a(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,n){var i=-1,s=(t=br(t,e)).length;for(s||(s=1,e=r);++i<s;){var o=null==e?r:e[js(t[i])];o===r&&(i=s,o=n),e=Ko(o)?o.call(e):o}return e},Fn.round=Mc,Fn.runInContext=e,Fn.sample=function(e){return(Vo(e)?Jn:qi)(e)},Fn.size=function(e){if(null==e)return 0;if(Uo(e))return aa(e)?sn(e):e.length;var t=ds(e);return t==S||t==T?e.size:Ii(e).length},Fn.snakeCase=Ga,Fn.some=function(e,t,n){var i=Vo(e)?Ot:tr;return n&&bs(e,t,n)&&(t=r),i(e,ss(t,3))},Fn.sortedIndex=function(e,t){return nr(e,t)},Fn.sortedIndexBy=function(e,t,n){return ir(e,t,ss(n,2))},Fn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var i=nr(e,t);if(i<n&&zo(e[i],t))return i}return-1},Fn.sortedLastIndex=function(e,t){return nr(e,t,!0)},Fn.sortedLastIndexBy=function(e,t,n){return ir(e,t,ss(n,2),!0)},Fn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=nr(e,t,!0)-1;if(zo(e[n],t))return n}return-1},Fn.startCase=qa,Fn.startsWith=function(e,t,n){return e=_a(e),n=null==n?0:si(pa(n),0,e.length),t=or(t),e.slice(n,n+t.length)==t},Fn.subtract=xc,Fn.sum=function(e){return e&&e.length?zt(e,ic):0},Fn.sumBy=function(e,t){return e&&e.length?zt(e,ss(t,2)):0},Fn.template=function(e,t,n){var i=Fn.templateSettings;n&&bs(e,t,n)&&(t=r),e=_a(e),t=wa({},t,i,Jr);var s,o,a=wa({},t.imports,i.imports,Jr),c=La(a),l=Vt(a,c),u=0,d=t.interpolate||ye,h="__p += '",f=ke((t.escape||ye).source+"|"+d.source+"|"+(d===K?de:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ke+"]")+"\n";e.replace(f,(function(t,n,i,r,a,c){return i||(i=r),h+=e.slice(u,c).replace(ve,Kt),n&&(s=!0,h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),i&&(h+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),h+="';\n";var m=Ee.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(H,""):h).replace(W,"$1").replace(V,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var b=Za((function(){return Se(c,p+"return "+h).apply(r,l)}));if(b.source=h,Qo(b))throw b;return b},Fn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=f,i=gn(e,f);t=ss(t),e-=f;for(var r=$t(i,t);++n<e;)t(n);return r},Fn.toFinite=fa,Fn.toInteger=pa,Fn.toLength=ma,Fn.toLower=function(e){return _a(e).toLowerCase()},Fn.toNumber=ba,Fn.toSafeInteger=function(e){return e?si(pa(e),-9007199254740991,d):0===e?e:0},Fn.toString=_a,Fn.toUpper=function(e){return _a(e).toUpperCase()},Fn.trim=function(e,t,n){if((e=_a(e))&&(n||t===r))return Ht(e);if(!e||!(t=or(t)))return e;var i=on(e),s=on(t);return _r(i,Ut(i,s),Gt(i,s)+1).join("")},Fn.trimEnd=function(e,t,n){if((e=_a(e))&&(n||t===r))return e.slice(0,an(e)+1);if(!e||!(t=or(t)))return e;var i=on(e);return _r(i,0,Gt(i,on(t))+1).join("")},Fn.trimStart=function(e,t,n){if((e=_a(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=or(t)))return e;var i=on(e);return _r(i,Ut(i,on(t))).join("")},Fn.truncate=function(e,t){var n=30,i="...";if(ea(t)){var s="separator"in t?t.separator:s;n="length"in t?pa(t.length):n,i="omission"in t?or(t.omission):i}var o=(e=_a(e)).length;if(Zt(e)){var a=on(e);o=a.length}if(n>=o)return e;var c=n-sn(i);if(c<1)return i;var l=a?_r(a,0,c).join(""):e.slice(0,c);if(s===r)return l+i;if(a&&(c+=l.length-c),sa(s)){if(e.slice(c).search(s)){var u,d=l;for(s.global||(s=ke(s.source,_a(he.exec(s))+"g")),s.lastIndex=0;u=s.exec(d);)var h=u.index;l=l.slice(0,h===r?c:h)}}else if(e.indexOf(or(s),c)!=c){var f=l.lastIndexOf(s);f>-1&&(l=l.slice(0,f))}return l+i},Fn.unescape=function(e){return(e=_a(e))&&G.test(e)?e.replace(B,cn):e},Fn.uniqueId=function(e){var t=++Ae;return _a(e)+t},Fn.upperCase=Ja,Fn.upperFirst=Qa,Fn.each=_o,Fn.eachRight=yo,Fn.first=Bs,ac(Fn,(gc={},_i(Fn,(function(e,t){Ee.call(Fn.prototype,t)||(gc[t]=e)})),gc),{chain:!1}),Fn.VERSION="4.17.21",yt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fn[e].placeholder=Fn})),yt(["drop","take"],(function(e,t){Hn.prototype[e]=function(n){n=n===r?1:bn(pa(n),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),yt(["filter","map","takeWhile"],(function(e,t){var n=t+1,i=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ss(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}})),yt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}})),yt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(ic)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Gi((function(e,t){return"function"==typeof e?new Hn(this):this.map((function(n){return Ci(n,e,t)}))})),Hn.prototype.reject=function(e){return this.filter(Po(ss(e)))},Hn.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(f)},_i(Hn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=Fn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(Fn.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof Hn,l=a[0],u=c||Vo(t),d=function(e){var t=s.apply(Fn,Dt([e],a));return i&&h?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,m=c&&!f;if(!o&&u){t=m?t:new Hn(this);var b=e.apply(t,a);return b.__actions__.push({func:fo,args:[d],thisArg:r}),new $n(b,h)}return p&&m?e.apply(this,a):(b=this.thru(d),p?i?b.value()[0]:b.value():b)})})),yt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(Vo(r)?r:[],e)}return this[n]((function(n){return t.apply(Vo(n)?n:[],e)}))}})),_i(Hn.prototype,(function(e,t){var n=Fn[t];if(n){var i=n.name+"";Ee.call(On,i)||(On[i]=[]),On[i].push({name:t,func:n})}})),On[Nr(r,2).name]=[{name:"wrapper",func:r}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Dr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Dr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Dr(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Vo(e),i=t<0,r=n?e.length:0,s=function(e,t,n){for(var i=-1,r=n.length;++i<r;){var s=n[i],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=gn(t,e+o);break;case"takeRight":e=bn(e,t-o)}}return{start:e,end:t}}(0,r,this.__views__),o=s.start,a=s.end,c=a-o,l=i?a:o-1,u=this.__iteratees__,d=u.length,h=0,f=gn(c,this.__takeCount__);if(!n||!i&&r==c&&f==c)return dr(e,this.__actions__);var p=[];e:for(;c--&&h<f;){for(var m=-1,b=e[l+=t];++m<d;){var g=u[m],_=g.type,y=(0,g.iteratee)(b);if(2==_)b=y;else if(!y){if(1==_)continue e;break e}}p[h++]=b}return p},Fn.prototype.at=po,Fn.prototype.chain=function(){return ho(this)},Fn.prototype.commit=function(){return new $n(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===r&&(this.__values__=ha(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var i=Fs(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:fo,args:[Xs],thisArg:r}),new $n(t,this.__chain__)}return this.thru(Xs)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return dr(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,rt&&(Fn.prototype[rt]=function(){return this}),Fn}();st._=ln,(i=(function(){return ln}).call(t,n,t,e))===r||(e.exports=i)}).call(this)}).call(this,n("YuTi")(e))},MAOJ:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("wd/R"),r=n.n(i),s=n("8Y7J"),o=n("G0yt"),a=n("s7LF"),c=n("SVse");function l(e,t){if(1&e){const e=s.Tb();s.Sb(0,"div",0),s.Sb(1,"ngb-timepicker",4),s.gc("ngModelChange",(function(t){return s.Dc(e),s.ic().time=t}))("ngModelChange",(function(){return s.Dc(e),s.ic().onModelChange()})),s.Rb(),s.Rb()}if(2&e){const e=s.ic();s.yb(1),s.pc("seconds",e.hasSeconds)("ngModel",e.time)}}let u=(()=>{class e{constructor(e){this.calendar=e,this.hasSeconds=!0,this.hasTime=!0}ngOnInit(){var e;this.minDate=this.calendar.getToday(),this.format=this.hasTime?this.hasSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm":"YYYY-MM-DD";let t=r()(null===(e=this.control)||void 0===e?void 0:e.value,this.format);t.isValid()&&!t.isBefore(r()())||(t=r()()),this.date={year:t.year(),month:t.month()+1,day:t.date()},this.time={hour:t.hour(),minute:t.minute(),second:t.second()},this.onModelChange()}onModelChange(){if(this.date){const e=Object.assign({},this.date,this.time);e.month--,setTimeout(()=>{this.control.setValue(r()(e).format(this.format))})}else setTimeout(()=>{this.control.setValue("")})}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(o.d))},e.\u0275cmp=s.Gb({type:e,selectors:[["cd-date-time-picker"]],inputs:{control:"control",hasSeconds:"hasSeconds",hasTime:"hasTime"},decls:4,vars:3,consts:[[1,"d-flex","justify-content-center"],[3,"ngModel","minDate","ngModelChange"],["dp",""],["class","d-flex justify-content-center",4,"ngIf"],[3,"seconds","ngModel","ngModelChange"]],template:function(e,t){1&e&&(s.Sb(0,"div",0),s.Sb(1,"ngb-datepicker",1,2),s.gc("ngModelChange",(function(e){return t.date=e}))("ngModelChange",(function(){return t.onModelChange()})),s.Rb(),s.Rb(),s.Mc(3,l,2,2,"div",3)),2&e&&(s.yb(1),s.pc("ngModel",t.date)("minDate",t.minDate),s.yb(2),s.pc("ngIf",t.hasTime))},directives:[o.g,a.q,a.t,c.r,o.B],styles:[""]}),e})()},"MO+k":function(e,t,n){e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(e,n){return function(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[t[i]]=i);var r=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in r)if(r.hasOwnProperty(s)){if(!("channels"in r[s]))throw new Error("missing channels property: "+s);if(!("labels"in r[s]))throw new Error("missing channel labels property: "+s);if(r[s].labels.length!==r[s].channels)throw new Error("channel and label counts mismatch: "+s);var o=r[s].channels,a=r[s].labels;delete r[s].channels,delete r[s].labels,Object.defineProperty(r[s],"channels",{value:o}),Object.defineProperty(r[s],"labels",{value:a})}r.rgb.hsl=function(e){var t,n,i=e[0]/255,r=e[1]/255,s=e[2]/255,o=Math.min(i,r,s),a=Math.max(i,r,s),c=a-o;return a===o?t=0:i===a?t=(r-s)/c:r===a?t=2+(s-i)/c:s===a&&(t=4+(i-r)/c),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+a)/2,[t,100*(a===o?0:n<=.5?c/(a+o):c/(2-a-o)),100*n]},r.rgb.hsv=function(e){var t,n,i,r,s,o=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),d=function(e){return(l-e)/6/u+.5};return 0===u?r=s=0:(s=u/l,t=d(o),n=d(a),i=d(c),o===l?r=i-n:a===l?r=1/3+t-i:c===l&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*l]},r.rgb.hwb=function(e){var t=e[0],n=e[1],i=e[2];return[r.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,i))*100,100*(i=1-1/255*Math.max(t,Math.max(n,i)))]},r.rgb.cmyk=function(e){var t,n=e[0]/255,i=e[1]/255,r=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-i,1-r)))/(1-t)||0),100*((1-i-t)/(1-t)||0),100*((1-r-t)/(1-t)||0),100*t]},r.rgb.keyword=function(e){var i=n[e];if(i)return i;var r,s,o,a=1/0;for(var c in t)if(t.hasOwnProperty(c)){var l=(s=e,o=t[c],Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)+Math.pow(s[2]-o[2],2));l<a&&(a=l,r=c)}return r},r.keyword.rgb=function(e){return t[e]},r.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*t+.7152*n+.0722*i),100*(.0193*t+.1192*n+.9505*i)]},r.rgb.lab=function(e){var t=r.rgb.xyz(e),n=t[0],i=t[1],s=t[2];return i/=100,s/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(s=s>.008856?Math.pow(s,1/3):7.787*s+16/116))]},r.hsl.rgb=function(e){var t,n,i,r,s,o=e[0]/360,a=e[1]/100,c=e[2]/100;if(0===a)return[s=255*c,s,s];t=2*c-(n=c<.5?c*(1+a):c+a-c*a),r=[0,0,0];for(var l=0;l<3;l++)(i=o+1/3*-(l-1))<0&&i++,i>1&&i--,r[l]=255*(s=6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t);return r},r.hsl.hsv=function(e){var t=e[0],n=e[1]/100,i=e[2]/100,r=n,s=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=s<=1?s:2-s,[t,100*(0===i?2*r/(s+r):2*n/(i+n)),(i+n)/2*100]},r.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,i=e[2]/100,r=Math.floor(t)%6,s=t-Math.floor(t),o=255*i*(1-n),a=255*i*(1-n*s),c=255*i*(1-n*(1-s));switch(i*=255,r){case 0:return[i,c,o];case 1:return[a,i,o];case 2:return[o,i,c];case 3:return[o,a,i];case 4:return[c,o,i];case 5:return[i,o,a]}},r.hsv.hsl=function(e){var t,n,i,r=e[0],s=e[1]/100,o=e[2]/100,a=Math.max(o,.01);return i=(2-s)*o,n=s*a,[r,100*(n=(n/=(t=(2-s)*a)<=1?t:2-t)||0),100*(i/=2)]},r.hwb.rgb=function(e){var t,n,i,r,s,o,a,c=e[0]/360,l=e[1]/100,u=e[2]/100,d=l+u;switch(d>1&&(l/=d,u/=d),i=6*c-(t=Math.floor(6*c)),0!=(1&t)&&(i=1-i),r=l+i*((n=1-u)-l),t){default:case 6:case 0:s=n,o=r,a=l;break;case 1:s=r,o=n,a=l;break;case 2:s=l,o=n,a=r;break;case 3:s=l,o=r,a=n;break;case 4:s=r,o=l,a=n;break;case 5:s=n,o=l,a=r}return[255*s,255*o,255*a]},r.cmyk.rgb=function(e){var t=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-i)+i)),255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},r.xyz.rgb=function(e){var t,n,i,r=e[0]/100,s=e[1]/100,o=e[2]/100;return n=-.9689*r+1.8758*s+.0415*o,i=.0557*r+-.204*s+1.057*o,t=(t=3.2406*r+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},r.xyz.lab=function(e){var t=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},r.lab.xyz=function(e){var t,n,i;t=e[1]/500+(n=(e[0]+16)/116),i=n-e[2]/200;var r=Math.pow(n,3),s=Math.pow(t,3),o=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,[t*=95.047,n*=100,i*=108.883]},r.lab.lch=function(e){var t,n=e[0],i=e[1],r=e[2];return(t=360*Math.atan2(r,i)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(i*i+r*r),t]},r.lch.lab=function(e){var t,n=e[1];return t=e[2]/360*2*Math.PI,[e[0],n*Math.cos(t),n*Math.sin(t)]},r.rgb.ansi16=function(e){var t=e[0],n=e[1],i=e[2],s=1 in arguments?arguments[1]:r.rgb.hsv(e)[2];if(0===(s=Math.round(s/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===s&&(o+=60),o},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){var t=e[0],n=e[1],i=e[2];return t===n&&n===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},r.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},r.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},r.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},r.rgb.hcg=function(e){var t,n=e[0]/255,i=e[1]/255,r=e[2]/255,s=Math.max(Math.max(n,i),r),o=Math.min(Math.min(n,i),r),a=s-o;return t=a<=0?0:s===n?(i-r)/a%6:s===i?2+(r-n)/a:4+(n-i)/a+4,t/=6,[360*(t%=1),100*a,100*(a<1?o/(1-a):0)]},r.hsl.hcg=function(e){var t,n=e[1]/100,i=e[2]/100,r=0;return(t=i<.5?2*n*i:2*n*(1-i))<1&&(r=(i-.5*t)/(1-t)),[e[0],100*t,100*r]},r.hsv.hcg=function(e){var t=e[2]/100,n=e[1]/100*t,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],100*n,100*i]},r.hcg.rgb=function(e){var t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var i,r=[0,0,0],s=e[0]/360%1*6,o=s%1,a=1-o;switch(Math.floor(s)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return[255*(t*r[0]+(i=(1-t)*n)),255*(t*r[1]+i),255*(t*r[2]+i)]},r.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),i=0;return n>0&&(i=t/n),[e[0],100*i,100*n]},r.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],100*i,100*n]},r.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},r.hwb.hcg=function(e){var t=1-e[2]/100,n=t-e[1]/100,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],100*n,100*i]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=r.gray.hsv=function(e){return[0,0,e[0]]},r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(n={exports:{}}),n.exports}();function i(e,t){return function(n){return t(e(n))}}function r(e,t){for(var r=[t[e].parent,e],s=n[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),s=i(n[t[o].parent][o],s),o=t[o].parent;return s.conversion=r,s}var s={};Object.keys(n).forEach((function(e){s[e]={},Object.defineProperty(s[e],"channels",{value:n[e].channels}),Object.defineProperty(s[e],"labels",{value:n[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),i=t.length,r=0;r<i;r++)e[t[r]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length;)for(var r=i.pop(),s=Object.keys(n[r]),o=s.length,a=0;a<o;a++){var c=s[a],l=t[c];-1===l.distance&&(l.distance=t[r].distance+1,l.parent=r,i.unshift(c))}return t}(e),i={},s=Object.keys(t),o=s.length,a=0;a<o;a++){var c=s[a];null!==t[c].parent&&(i[c]=r(c,t))}return i}(e);Object.keys(t).forEach((function(n){var i=t[n];s[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,r=0;r<i;r++)n[r]=Math.round(n[r]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(i),s[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(i)}))}));var o=s,a={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c={getRgba:l,getHsla:u,getRgb:function(e){var t=l(e);return t&&t.slice(0,3)},getHsl:function(e){var t=u(e);return t&&t.slice(0,3)},getHwb:d,getAlpha:function(e){var t=l(e);return t||(t=u(e))||(t=d(e))?t[3]:void 0},hexString:function(e,t){return t=void 0!==t&&3===e.length?t:e[3],"#"+b(e[0])+b(e[1])+b(e[2])+(t>=0&&t<1?b(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?h(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:h,percentString:function(e,t){return t<1||e[3]&&e[3]<1?f(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"},percentaString:f,hslString:function(e,t){return t<1||e[3]&&e[3]<1?p(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:p,hwbString:function(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return g[e.slice(0,3)]}};function l(e){if(e){var t=[0,0,0],n=1,i=e.match(/^#([a-fA-F0-9]{3,4})$/i),r="";if(i){r=(i=i[1])[3];for(var s=0;s<t.length;s++)t[s]=parseInt(i[s]+i[s],16);r&&(n=Math.round(parseInt(r+r,16)/255*100)/100)}else if(i=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(r=i[2],i=i[1],s=0;s<t.length;s++)t[s]=parseInt(i.slice(2*s,2*s+2),16);r&&(n=Math.round(parseInt(r,16)/255*100)/100)}else if(i=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(s=0;s<t.length;s++)t[s]=parseInt(i[s+1]);n=parseFloat(i[4])}else if(i=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(s=0;s<t.length;s++)t[s]=Math.round(2.55*parseFloat(i[s+1]));n=parseFloat(i[4])}else if(i=e.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(t=a[i[1]]))return}for(s=0;s<t.length;s++)t[s]=m(t[s],0,255);return n=n||0==n?m(n,0,1):1,t[3]=n,t}}function u(e){if(e){var t=e.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[m(parseInt(t[1]),0,360),m(parseFloat(t[2]),0,100),m(parseFloat(t[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function d(e){if(e){var t=e.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[m(parseInt(t[1]),0,360),m(parseFloat(t[2]),0,100),m(parseFloat(t[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function h(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function f(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function p(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function m(e,t,n){return Math.min(Math.max(t,e),n)}function b(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var g={};for(var _ in a)g[a[_]]=_;var y=function(e){return e instanceof y?e:this instanceof y?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=c.getRgba(e))?this.setValues("rgb",t):(t=c.getHsla(e))?this.setValues("hsl",t):(t=c.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new y(e);var t};y.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return c.hexString(this.values.rgb)},rgbString:function(){return c.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return c.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return c.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return c.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return c.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return c.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return c.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var i=e[n]/255;t[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,i=e,r=void 0===t?.5:t,s=2*r-1,o=n.alpha()-i.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return this.rgb(a*n.red()+c*i.red(),a*n.green()+c*i.green(),a*n.blue()+c*i.blue()).alpha(n.alpha()*r+i.alpha()*(1-r))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new y,i=this.values,r=n.values;for(var s in i)i.hasOwnProperty(s)&&("[object Array]"===(t={}.toString.call(e=i[s]))?r[s]=e.slice(0):"[object Number]"===t?r[s]=e:console.error("unexpected color value:",e));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(e){for(var t=this.values,n={},i=0;i<e.length;i++)n[e.charAt(i)]=t[e][i];return 1!==t.alpha&&(n.a=t.alpha),n},y.prototype.setValues=function(e,t){var n,i,r=this.values,s=this.spaces,a=this.maxes,c=1;if(this.valid=!0,"alpha"===e)c=t;else if(t.length)r[e]=t.slice(0,e.length),c=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)r[e][n]=t[e.charAt(n)];c=t.a}else if(void 0!==t[s[e][0]]){var l=s[e];for(n=0;n<e.length;n++)r[e][n]=t[l[n]];c=t.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===c?r.alpha:c)),"alpha"===e)return!1;for(n=0;n<e.length;n++)i=Math.max(0,Math.min(a[e][n],r[e][n])),r[e][n]=Math.round(i);for(var u in s)u!==e&&(r[u]=o[e][u](r[e]));return!0},y.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},y.prototype.setChannel=function(e,t,n){var i=this.values[e];return void 0===n?i[t]:(n===i[t]||(i[t]=n,this.setValues(e,i)),this)},"undefined"!=typeof window&&(window.Color=y);var v=y;function w(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}var S,M={noop:function(){},uid:(S=0,function(){return S++}),isNullOrUndef:function(e){return null==e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return void 0===e?t:e},valueAtIndexOrDefault:function(e,t,n){return M.valueOrDefault(M.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,i){var r,s,o;if(M.isArray(e))if(s=e.length,i)for(r=s-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;r<s;r++)t.call(n,e[r],r);else if(M.isObject(e))for(s=(o=Object.keys(e)).length,r=0;r<s;r++)t.call(n,e[o[r]],o[r])},arrayEquals:function(e,t){var n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=t[n],(r=e[n])instanceof Array&&s instanceof Array){if(!M.arrayEquals(r,s))return!1}else if(r!==s)return!1;return!0},clone:function(e){if(M.isArray(e))return e.map(M.clone);if(M.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),i=n.length,r=0;r<i;++r)t[n[r]]=M.clone(e[n[r]]);return t}return e},_merger:function(e,t,n,i){if(w(e)){var r=t[e],s=n[e];M.isObject(r)&&M.isObject(s)?M.merge(r,s,i):t[e]=M.clone(s)}},_mergerIf:function(e,t,n){if(w(e)){var i=t[e],r=n[e];M.isObject(i)&&M.isObject(r)?M.mergeIf(i,r):t.hasOwnProperty(e)||(t[e]=M.clone(r))}},merge:function(e,t,n){var i,r,s,o,a,c=M.isArray(t)?t:[t],l=c.length;if(!M.isObject(e))return e;for(i=(n=n||{}).merger||M._merger,r=0;r<l;++r)if(M.isObject(t=c[r]))for(a=0,o=(s=Object.keys(t)).length;a<o;++a)i(s[a],e,t,n);return e},mergeIf:function(e,t){return M.merge(e,t,{merger:M._mergerIf})},extend:Object.assign||function(e){return M.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=t.prototype,n.prototype=new i,n.extend=M.inherits,e&&M.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,i){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},x=M;M.callCallback=M.callback,M.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},M.getValueOrDefault=M.valueOrDefault,M.getValueAtIndexOrDefault=M.valueAtIndexOrDefault;var k={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),e<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-k.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*k.easeInBounce(2*e):.5*k.easeOutBounce(2*e-1)+.5}},D={effects:k};x.easingEffects=k;var T=Math.PI,C=T/180,O=2*T,R=T/2,L=T/4,E=2*T/3,A={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,i,r,s){if(s){var o=Math.min(s,r/2,i/2),a=t+o,c=n+o,l=t+i-o,u=n+r-o;e.moveTo(t,c),a<l&&c<u?(e.arc(a,c,o,-T,-R),e.arc(l,c,o,-R,0),e.arc(l,u,o,0,R),e.arc(a,u,o,R,T)):a<l?(e.moveTo(a,n),e.arc(l,c,o,-R,R),e.arc(a,c,o,R,T+R)):c<u?(e.arc(a,c,o,-T,0),e.arc(a,u,o,0,T)):e.arc(a,c,o,-T,T),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,r)},drawPoint:function(e,t,n,i,r,s){var o,a,c,l,u,d=(s||0)*C;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(i,r),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(i,r,n,0,O),e.closePath();break;case"triangle":e.moveTo(i+Math.sin(d)*n,r-Math.cos(d)*n),d+=E,e.lineTo(i+Math.sin(d)*n,r-Math.cos(d)*n),d+=E,e.lineTo(i+Math.sin(d)*n,r-Math.cos(d)*n),e.closePath();break;case"rectRounded":l=n-(u=.516*n),a=Math.cos(d+L)*l,c=Math.sin(d+L)*l,e.arc(i-a,r-c,u,d-T,d-R),e.arc(i+c,r-a,u,d-R,d),e.arc(i+a,r+c,u,d,d+R),e.arc(i-c,r+a,u,d+R,d+T),e.closePath();break;case"rect":if(!s){l=Math.SQRT1_2*n,e.rect(i-l,r-l,2*l,2*l);break}d+=L;case"rectRot":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+c,r-a),e.lineTo(i+a,r+c),e.lineTo(i-c,r+a),e.closePath();break;case"crossRot":d+=L;case"cross":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a);break;case"star":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a),d+=L,a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a);break;case"line":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c);break;case"dash":e.moveTo(i,r),e.lineTo(i+Math.cos(d)*n,r+Math.sin(d)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var n=1e-6;return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,i){var r=n.steppedLine;if(r){if("middle"===r){var s=(t.x+n.x)/2;e.lineTo(s,i?n.y:t.y),e.lineTo(s,i?t.y:n.y)}else"after"===r&&!i||"after"!==r&&i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}else n.tension?e.bezierCurveTo(i?t.controlPointPreviousX:t.controlPointNextX,i?t.controlPointPreviousY:t.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):e.lineTo(n.x,n.y)}},I=A;x.clear=A.clear,x.drawRoundedRectangle=function(e){e.beginPath(),A.roundedRect.apply(A,arguments)};var P={_set:function(e,t){return x.merge(this[e]||(this[e]={}),t)}};P._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var j=P,N=x.valueOrDefault,F={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,i,r;return x.isObject(e)?(t=+e.top||0,n=+e.right||0,i=+e.bottom||0,r=+e.left||0):t=n=i=r=+e||0,{top:t,right:n,bottom:i,left:r,height:t+i,width:r+n}},_parseFont:function(e){var t=j.global,n=N(e.fontSize,t.defaultFontSize),i={family:N(e.fontFamily,t.defaultFontFamily),lineHeight:x.options.toLineHeight(N(e.lineHeight,t.defaultLineHeight),n),size:n,style:N(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return i.string=function(e){return!e||x.isNullOrUndef(e.size)||x.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(i),i},resolve:function(e,t,n,i){var r,s,o,a=!0;for(r=0,s=e.length;r<s;++r)if(void 0!==(o=e[r])&&(void 0!==t&&"function"==typeof o&&(o=o(t),a=!1),void 0!==n&&x.isArray(o)&&(o=o[n],a=!1),void 0!==o))return i&&!a&&(i.cacheable=!1),o}},Y={_factorize:function(e){var t,n=[],i=Math.sqrt(e);for(t=1;t<i;t++)e%t==0&&(n.push(t),n.push(e/t));return i===(0|i)&&n.push(i),n.sort((function(e,t){return e-t})).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t);return e===Math.pow(10,n)?n:t}},z=Y;x.log10=Y.log10;var $=x,H=I,W=F,V=z;$.easing=D,$.canvas=H,$.options=W,$.math=V,$.rtl={getRtlAdapter:function(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},overrideTextDirection:function(e,t){var n,i;"ltr"!==t&&"rtl"!==t||(i=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)},restoreTextDirection:function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}};var B=function(e){$.extend(this,e),this.initialize.apply(this,arguments)};$.extend(B.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=$.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,i=t._start,r=t._view;return n&&1!==e?(r||(r=t._view={}),i||(i=t._start={}),function(e,t,n,i){var r,s,o,a,c,l,u,d,h,f=Object.keys(n);for(r=0,s=f.length;r<s;++r)if(l=n[o=f[r]],t.hasOwnProperty(o)||(t[o]=l),(a=t[o])!==l&&"_"!==o[0]){if(e.hasOwnProperty(o)||(e[o]=a),(u=typeof l)==typeof(c=e[o]))if("string"===u){if((d=v(c)).valid&&(h=v(l)).valid){t[o]=h.mix(d,i).rgbString();continue}}else if($.isFinite(c)&&$.isFinite(l)){t[o]=c+(l-c)*i;continue}t[o]=l}}(i,r,n,e),t):(t._view=$.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return $.isNumber(this._model.x)&&$.isNumber(this._model.y)}}),B.extend=$.inherits;var U=B,G=U.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),q=G;Object.defineProperty(G.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(G.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),j._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:$.noop,onComplete:$.noop}});var J={animations:[],request:null,addAnimation:function(e,t,n,i){var r,s,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,i||(e.animating=!0),r=0,s=o.length;r<s;++r)if(o[r].chart===e)return void(o[r]=t);o.push(t),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=$.findIndex(this.animations,(function(t){return t.chart===e}));-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=$.requestAnimFrame.call(window,(function(){e.request=null,e.startDigest()})))},startDigest:function(){var e=this;e.advance(),e.animations.length>0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,i,r=this.animations,s=0;s<r.length;)t=(e=r[s]).chart,n=e.numSteps,i=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(i,n),$.callback(e.render,[t,e],t),$.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?($.callback(e.onAnimationComplete,[e],t),t.animating=!1,r.splice(s,1)):++s}},Q=$.options.resolve,K=["push","pop","shift","splice","unshift"];function Z(e,t){var n=e._chartjs;if(n){var i=n.listeners,r=i.indexOf(t);-1!==r&&i.splice(r,1),i.length>0||(K.forEach((function(t){delete e[t]})),delete e._chartjs)}}var X=function(e,t){this.initialize(e,t)};$.extend(X.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,i=n.scales,r=e.getDataset(),s=n.options.scales;null!==t.xAxisID&&t.xAxisID in i&&!r.xAxisID||(t.xAxisID=r.xAxisID||s.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in i&&!r.yAxisID||(t.yAxisID=r.yAxisID||s.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&Z(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,i=n.getMeta(),r=n.getDataset().data||[],s=i.data;for(e=0,t=r.length;e<t;++e)s[e]=s[e]||n.createMetaData(e);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e,t,n=this,i=n.getDataset(),r=i.data||(i.data=[]);n._data!==r&&(n._data&&Z(n._data,n),r&&Object.isExtensible(r)&&(t=n,(e=r)._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K.forEach((function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),i=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),r=i.apply(this,t);return $.each(e._chartjs.listeners,(function(e){"function"==typeof e[n]&&e[n].apply(e,t)})),r}})})))),n._data=r),n.resyncElements()},_configure:function(){var e=this;e._config=$.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&$._merger(e,t,n)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:$.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],i=n.length,r=0;r<i;++r)n[r].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,i=0;for(e.dataset&&e.dataset.draw();i<n;++i)t[i].draw()},getStyle:function(e){var t,n=this,i=n.getMeta(),r=i.dataset;return n._configure(),!1!==(t=r&&void 0===e?n._resolveDatasetElementOptions(r||{}):n._resolveDataElementOptions(i.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,i,r,s,o=this,a=o.chart,c=o._config,l=e.custom||{},u=a.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:a,dataset:o.getDataset(),datasetIndex:o.index,hover:t};for(n=0,i=d.length;n<i;++n)r=d[n],s=t?"hover"+r.charAt(0).toUpperCase()+r.slice(1):r,h[r]=Q([l[s],c[s],u[s]],f);return h},_resolveDataElementOptions:function(e,t){var n=this,i=e&&e.custom,r=n._cachedDataOpts;if(r&&!i)return r;var s,o,a,c,l=n.chart,u=n._config,d=l.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,f={},p={chart:l,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},m={cacheable:!i};if(i=i||{},$.isArray(h))for(o=0,a=h.length;o<a;++o)f[c=h[o]]=Q([i[c],u[c],d[c]],p,t,m);else for(o=0,a=(s=Object.keys(h)).length;o<a;++o)f[c=s[o]]=Q([i[c],u[h[c]],u[c],d[c]],p,t,m);return m.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){$.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,i=e.custom||{},r=e._model,s=$.getHoverColor;e.$previousStyle={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth},r.backgroundColor=Q([i.hoverBackgroundColor,t.hoverBackgroundColor,s(r.backgroundColor)],void 0,n),r.borderColor=Q([i.hoverBorderColor,t.hoverBorderColor,s(r.borderColor)],void 0,n),r.borderWidth=Q([i.hoverBorderWidth,t.hoverBorderWidth,r.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,i,r,s,o=this.getMeta().dataset,a={};if(o){for(s=o._model,r=this._resolveDatasetElementOptions(o,!0),e=0,t=(i=Object.keys(r)).length;e<t;++e)a[n=i[e]]=s[n],s[n]=r[n];o.$previousStyle=a}},resyncElements:function(){var e=this,t=e.getMeta(),n=e.getDataset().data,i=t.data.length,r=n.length;r<i?t.data.splice(r,i-r):r>i&&e.insertElements(i,r-i)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),X.extend=$.inherits;var ee=X,te=2*Math.PI;function ne(e,t){var n=t.startAngle,i=t.endAngle,r=t.pixelMargin,s=r/t.outerRadius,o=t.x,a=t.y;e.beginPath(),e.arc(o,a,t.outerRadius,n-s,i+s),t.innerRadius>r?e.arc(o,a,t.innerRadius-r,i+(s=r/t.innerRadius),n-s,!0):e.arc(o,a,r,i+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}j._set("global",{elements:{arc:{backgroundColor:j.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var ie=U.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var i=$.getAngleFromPoint(n,{x:e,y:t}),r=i.angle,s=i.distance,o=n.startAngle,a=n.endAngle;a<o;)a+=te;for(;r>a;)r-=te;for(;r<o;)r+=te;return r>=o&&r<=a&&s>=n.innerRadius&&s<=n.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,r={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/te)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,r.fullCircles){for(r.endAngle=r.startAngle+te,t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),e=0;e<r.fullCircles;++e)t.fill();r.endAngle=r.startAngle+n.circumference%te}t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&function(e,t,n){var i="inner"===t.borderAlign;i?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(e,t,n,i){var r,s=n.endAngle;for(i&&(n.endAngle=n.startAngle+te,ne(e,n),n.endAngle=s,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=te,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+te,n.startAngle,!0),r=0;r<n.fullCircles;++r)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+te),r=0;r<n.fullCircles;++r)e.stroke()}(e,t,n,i),i&&ne(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}(t,n,r),t.restore()}}),re=$.valueOrDefault,se=j.global.defaultColor;j._set("global",{elements:{line:{tension:.4,backgroundColor:se,borderWidth:3,borderColor:se,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var oe=U.extend({_type:"line",draw:function(){var e,t,n,i=this,r=i._view,s=i._chart.ctx,o=r.spanGaps,a=i._children.slice(),c=j.global,l=c.elements.line,u=-1,d=i._loop;if(a.length){if(i._loop){for(e=0;e<a.length;++e)if(t=$.previousItem(a,e),!a[e]._view.skip&&t._view.skip){a=a.slice(e).concat(a.slice(0,e)),d=o;break}d&&a.push(a[0])}for(s.save(),s.lineCap=r.borderCapStyle||l.borderCapStyle,s.setLineDash&&s.setLineDash(r.borderDash||l.borderDash),s.lineDashOffset=re(r.borderDashOffset,l.borderDashOffset),s.lineJoin=r.borderJoinStyle||l.borderJoinStyle,s.lineWidth=re(r.borderWidth,l.borderWidth),s.strokeStyle=r.borderColor||c.defaultColor,s.beginPath(),(n=a[0]._view).skip||(s.moveTo(n.x,n.y),u=0),e=1;e<a.length;++e)n=a[e]._view,t=-1===u?$.previousItem(a,e):a[u],n.skip||(u!==e-1&&!o||-1===u?s.moveTo(n.x,n.y):$.canvas.lineTo(s,t._view,n),u=e);d&&s.closePath(),s.stroke(),s.restore()}}}),ae=$.valueOrDefault,ce=j.global.defaultColor;function le(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}j._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:ce,borderColor:ce,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ue=U.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:le,inXRange:le,inYRange:function(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,i=t.pointStyle,r=t.rotation,s=t.radius,o=t.x,a=t.y,c=j.global,l=c.defaultColor;t.skip||(void 0===e||$.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||l,n.lineWidth=ae(t.borderWidth,c.elements.point.borderWidth),n.fillStyle=t.backgroundColor||l,$.canvas.drawPoint(n,i,s,o,a,r))}}),de=j.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,n,i,r,s;return he(e)?(t=e.x-(s=e.width/2),n=e.x+s,i=Math.min(e.y,e.base),r=Math.max(e.y,e.base)):(s=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),i=e.y-s,r=e.y+s),{left:t,top:i,right:n,bottom:r}}function pe(e,t,n){return e===t?n:e===n?t:e}function me(e,t,n){var i=null===t,r=null===n,s=!(!e||i&&r)&&fe(e);return s&&(i||t>=s.left&&t<=s.right)&&(r||n>=s.top&&n<=s.bottom)}j._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var be=U.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(e){var t=fe(e),n=t.right-t.left,i=t.bottom-t.top,r=function(e,t,n){var i,r,s,o,a=e.borderWidth,c=function(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),n[t]=!0,n):n}(e);return $.isObject(a)?(i=+a.top||0,r=+a.right||0,s=+a.bottom||0,o=+a.left||0):i=r=s=o=+a||0,{t:c.top||i<0?0:i>n?n:i,r:c.right||r<0?0:r>t?t:r,b:c.bottom||s<0?0:s>n?n:s,l:c.left||o<0?0:o>t?t:o}}(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b}}}(t),i=n.outer,r=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(i.x,i.y,i.w,i.h),i.w===r.w&&i.h===r.h||(e.save(),e.beginPath(),e.rect(i.x,i.y,i.w,i.h),e.clip(),e.fillStyle=t.borderColor,e.rect(r.x,r.y,r.w,r.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return me(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return he(n)?me(n,e,null):me(n,null,t)},inXRange:function(e){return me(this._view,e,null)},inYRange:function(e){return me(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return he(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return he(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),ge={},_e=oe,ye=ue,ve=be;ge.Arc=ie,ge.Line=_e,ge.Point=ye,ge.Rectangle=ve;var we=$._deprecated,Se=$.valueOrDefault;j._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),j._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Me=ee.extend({dataElementType:ge.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,we("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),we("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),we("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),we("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),we("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,i=this,r=i.getMeta().data;for(i._ruler=i.getRuler(),t=0,n=r.length;t<n;++t)i.updateElement(r[t],t,e)},updateElement:function(e,t,n){var i=this,r=i.getMeta(),s=i.getDataset(),o=i._resolveDataElementOptions(e,t);e._xScale=i.getScaleForId(r.xAxisID),e._yScale=i.getScaleForId(r.yAxisID),e._datasetIndex=i.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:s.label,label:i.chart.data.labels[t]},$.isArray(s.data[t])&&(e._model.borderSkipped=null),i._updateElementGeometry(e,t,n,o),e.pivot()},_updateElementGeometry:function(e,t,n,i){var r=this,s=e._model,o=r._getValueScale(),a=o.getBasePixel(),c=o.isHorizontal(),l=r._ruler||r.getRuler(),u=r.calculateBarValuePixels(r.index,t,i),d=r.calculateBarIndexPixels(r.index,t,l,i);s.horizontal=c,s.base=n?a:u.base,s.x=c?n?a:u.head:d.center,s.y=c?d.center:n?a:u.head,s.height=c?d.size:void 0,s.width=c?void 0:d.size},_getStacks:function(e){var t,n,i=this._getIndexScale(),r=i._getMatchingVisibleMetas(this._type),s=i.options.stacked,o=r.length,a=[];for(t=0;t<o&&(n=r[t],(!1===s||-1===a.indexOf(n.stack)||void 0===s&&void 0===n.stack)&&a.push(n.stack),n.index!==e);++t);return a},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),i=void 0!==t?n.indexOf(t):-1;return-1===i?n.length-1:i},getRuler:function(){var e,t,n=this,i=n._getIndexScale(),r=[];for(e=0,t=n.getMeta().data.length;e<t;++e)r.push(i.getPixelForValue(null,e,n.index));return{pixels:r,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(e,t,n){var i,r,s,o,a,c,l,u=this,d=u.chart,h=u._getValueScale(),f=h.isHorizontal(),p=d.data.datasets,m=h._getMatchingVisibleMetas(u._type),b=h._parseValue(p[e].data[t]),g=n.minBarLength,_=h.options.stacked,y=u.getMeta().stack,v=void 0===b.start?0:b.max>=0&&b.min>=0?b.min:b.max,w=void 0===b.start?b.end:b.max>=0&&b.min>=0?b.max-b.min:b.min-b.max,S=m.length;if(_||void 0===_&&void 0!==y)for(i=0;i<S&&(r=m[i]).index!==e;++i)r.stack===y&&(s=void 0===(l=h._parseValue(p[r.index].data[t])).start?l.end:l.min>=0&&l.max>=0?l.max:l.min,(b.min<0&&s<0||b.max>=0&&s>0)&&(v+=s));return o=h.getPixelForValue(v),c=(a=h.getPixelForValue(v+w))-o,void 0!==g&&Math.abs(c)<g&&(c=g,a=w>=0&&!f||w<0&&f?o-g:o+g),{size:c,base:o,head:a,center:a+c/2}},calculateBarIndexPixels:function(e,t,n,i){var r="flex"===i.barThickness?function(e,t,n){var i,r=t.pixels,s=r[e],o=e>0?r[e-1]:null,a=e<r.length-1?r[e+1]:null,c=n.categoryPercentage;return null===o&&(o=s-(null===a?t.end-t.start:a-s)),null===a&&(a=s+s-o),i=s-(s-Math.min(o,a))/2*c,{chunk:Math.abs(a-o)/2*c/t.stackCount,ratio:n.barPercentage,start:i}}(t,n,i):function(e,t,n){var i,r,s=n.barThickness,o=t.stackCount,a=t.pixels[e],c=$.isNullOrUndef(s)?function(e,t){var n,i,r,s,o=e._length;for(r=1,s=t.length;r<s;++r)o=Math.min(o,Math.abs(t[r]-t[r-1]));for(r=0,s=e.getTicks().length;r<s;++r)i=e.getPixelForTick(r),o=r>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(t.scale,t.pixels):-1;return $.isNullOrUndef(s)?(i=c*n.categoryPercentage,r=n.barPercentage):(i=s*o,r=1),{chunk:i/o,ratio:r,start:a-i/2}}(t,n,i),s=this.getStackIndex(e,this.getMeta().stack),o=r.start+r.chunk*s+r.chunk/2,a=Math.min(Se(i.maxBarThickness,1/0),r.chunk*r.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),i=e.getMeta().data,r=e.getDataset(),s=i.length,o=0;for($.canvas.clipArea(t.ctx,t.chartArea);o<s;++o){var a=n._parseValue(r.data[o]);isNaN(a.min)||isNaN(a.max)||i[o].draw()}$.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=$.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,i=e._getValueScale().options;return t.barPercentage=Se(n.barPercentage,t.barPercentage),t.barThickness=Se(n.barThickness,t.barThickness),t.categoryPercentage=Se(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=Se(n.maxBarThickness,t.maxBarThickness),t.minBarLength=Se(i.minBarLength,t.minBarLength),t}}),xe=$.valueOrDefault,ke=$.options.resolve;j._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return(t.datasets[e.datasetIndex].label||"")+": ("+e.xLabel+", "+e.yLabel+", "+t.datasets[e.datasetIndex].data[e.index].r+")"}}}});var De=ee.extend({dataElementType:ge.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta();$.each(n.data,(function(n,i){t.updateElement(n,i,e)}))},updateElement:function(e,t,n){var i=this,r=i.getMeta(),s=e.custom||{},o=i.getScaleForId(r.xAxisID),a=i.getScaleForId(r.yAxisID),c=i._resolveDataElementOptions(e,t),l=i.getDataset().data[t],u=i.index,d=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof l?l:NaN,t,u),h=n?a.getBasePixel():a.getPixelForValue(l,t,u);e._xScale=o,e._yScale=a,e._options=c,e._datasetIndex=u,e._index=t,e._model={backgroundColor:c.backgroundColor,borderColor:c.borderColor,borderWidth:c.borderWidth,hitRadius:c.hitRadius,pointStyle:c.pointStyle,rotation:c.rotation,radius:n?0:c.radius,skip:s.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,i=$.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=xe(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=xe(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=xe(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,i=n.chart,r=n.getDataset(),s=e.custom||{},o=r.data[t]||{},a=ee.prototype._resolveDataElementOptions.apply(n,arguments),c={chart:i,dataIndex:t,dataset:r,datasetIndex:n.index};return n._cachedDataOpts===a&&(a=$.extend({},a)),a.radius=ke([s.radius,o.r,n._config.radius,i.options.elements.point.radius],c,t),a}}),Te=$.valueOrDefault,Ce=Math.PI,Oe=2*Ce,Re=Ce/2;j._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data,o=s.datasets,a=s.labels;if(r.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],a[t]&&i.appendChild(document.createTextNode(a[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map((function(n,i){var r=e.getDatasetMeta(0),s=r.controller.getStyle(i);return{text:n,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,hidden:isNaN(t.datasets[0].data[i])||r.data[i].hidden,index:i}})):[]}},onClick:function(e,t){var n,i,r,s=t.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(r=o.getDatasetMeta(n)).data[s]&&(r.data[s].hidden=!r.data[s].hidden);o.update()}},cutoutPercentage:50,rotation:-Re,circumference:Oe,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],i=": "+t.datasets[e.datasetIndex].data[e.index];return $.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var Le=ee.extend({dataElementType:ge.Arc,linkScales:$.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,i=this,r=i.chart,s=r.chartArea,o=r.options,a=1,c=1,l=0,u=0,d=i.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,m=i._getRingWeight(i.index);if(p<Oe){var b=o.rotation%Oe,g=(b+=b>=Ce?-Oe:b<-Ce?Oe:0)+p,_=Math.cos(b),y=Math.sin(b),v=Math.cos(g),w=Math.sin(g),S=b<=0&&g>=0||g>=Oe,M=b<=Re&&g>=Re||g>=Oe+Re,x=b<=-Re&&g>=-Re||g>=Ce+Re,k=b===-Ce||g>=Ce?-1:Math.min(_,_*f,v,v*f),D=x?-1:Math.min(y,y*f,w,w*f),T=S?1:Math.max(_,_*f,v,v*f),C=M?1:Math.max(y,y*f,w,w*f);a=(T-k)/2,c=(C-D)/2,l=-(T+k)/2,u=-(C+D)/2}for(t=0,n=h.length;t<n;++t)h[t]._options=i._resolveDataElementOptions(h[t],t);for(r.borderWidth=i.getMaxBorderWidth(),r.outerRadius=Math.max(Math.min((s.right-s.left-r.borderWidth)/a,(s.bottom-s.top-r.borderWidth)/c)/2,0),r.innerRadius=Math.max(r.outerRadius*f,0),r.radiusLength=(r.outerRadius-r.innerRadius)/(i._getVisibleDatasetWeightTotal()||1),r.offsetX=l*r.outerRadius,r.offsetY=u*r.outerRadius,d.total=i.calculateTotal(),i.outerRadius=r.outerRadius-r.radiusLength*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-r.radiusLength*m,0),t=0,n=h.length;t<n;++t)i.updateElement(h[t],t,e)},updateElement:function(e,t,n){var i=this,r=i.chart,s=r.chartArea,o=r.options,a=o.animation,c=(s.left+s.right)/2,l=(s.top+s.bottom)/2,u=o.rotation,d=o.rotation,h=i.getDataset(),f=n&&a.animateRotate||e.hidden?0:i.calculateCircumference(h.data[t])*(o.circumference/Oe),p=e._options||{};$.extend(e,{_datasetIndex:i.index,_index:t,_model:{backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,borderAlign:p.borderAlign,x:c+r.offsetX,y:l+r.offsetY,startAngle:u,endAngle:d,circumference:f,outerRadius:n&&a.animateScale?0:i.outerRadius,innerRadius:n&&a.animateScale?0:i.innerRadius,label:$.valueAtIndexOrDefault(h.label,t,r.data.labels[t])}});var m=e._model;n&&a.animateRotate||(m.startAngle=0===t?o.rotation:i.getMeta().data[t-1]._model.endAngle,m.endAngle=m.startAngle+m.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),i=0;return $.each(n.data,(function(n,r){e=t.data[r],isNaN(e)||n.hidden||(i+=Math.abs(e))})),i},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Oe*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,i,r,s,o,a,c,l=0,u=this.chart;if(!e)for(t=0,n=u.data.datasets.length;t<n;++t)if(u.isDatasetVisible(t)){e=(i=u.getDatasetMeta(t)).data,t!==this.index&&(s=i.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)r=e[t],s?(s._configure(),o=s._resolveDataElementOptions(r,t)):o=r._options,"inner"!==o.borderAlign&&(l=(c=o.hoverBorderWidth)>(l=(a=o.borderWidth)>l?a:l)?c:l);return l},setHoverStyle:function(e){var t=e._model,n=e._options,i=$.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Te(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Te(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Te(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(Te(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});j._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),j._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ee=Me.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Ae=$.valueOrDefault,Ie=$.options.resolve,Pe=$.canvas._isPointInArea;function je(e,t){var n=e&&e.options.ticks||{},i=n.reverse,r=void 0===n.min?t:0,s=void 0===n.max?t:0;return{start:i?s:r,end:i?r:s}}function Ne(e,t,n){var i=n/2,r=je(e,i),s=je(t,i);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function Fe(e){var t,n,i,r;return $.isObject(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r}}j._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var Ye=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,i=this,r=i.getMeta(),s=r.dataset,o=r.data||[],a=i._config,c=i._showLine=Ae(a.showLine,i.chart.options.showLines);for(i._xScale=i.getScaleForId(r.xAxisID),i._yScale=i.getScaleForId(r.yAxisID),c&&(void 0!==a.tension&&void 0===a.lineTension&&(a.lineTension=a.tension),s._scale=i._yScale,s._datasetIndex=i.index,s._children=o,s._model=i._resolveDatasetElementOptions(s),s.pivot()),t=0,n=o.length;t<n;++t)i.updateElement(o[t],t,e);for(c&&0!==s._model.tension&&i.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var i,r,s=this,o=s.getMeta(),a=e.custom||{},c=s.getDataset(),l=s.index,u=c.data[t],d=s._xScale,h=s._yScale,f=o.dataset._model,p=s._resolveDataElementOptions(e,t);i=d.getPixelForValue("object"==typeof u?u:NaN,t,l),r=n?h.getBasePixel():s.calculatePointY(u,t,l),e._xScale=d,e._yScale=h,e._options=p,e._datasetIndex=l,e._index=t,e._model={x:i,y:r,skip:a.skip||isNaN(i)||isNaN(r),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:Ae(a.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t=this,n=t._config,i=e.custom||{},r=t.chart.options,s=r.elements.line,o=ee.prototype._resolveDatasetElementOptions.apply(t,arguments);return o.spanGaps=Ae(n.spanGaps,r.spanGaps),o.tension=Ae(n.lineTension,s.tension),o.steppedLine=Ie([i.steppedLine,n.steppedLine,s.stepped]),o.clip=Fe(Ae(n.clip,Ne(t._xScale,t._yScale,o.borderWidth))),o},calculatePointY:function(e,t,n){var i,r,s,o,a,c,l=this.chart,u=this._yScale,d=0,h=0;if(u.options.stacked){for(o=+u.getRightValue(e),c=(a=l._getSortedVisibleDatasetMetas()).length,i=0;i<c&&(r=a[i]).index!==n;++i)"line"===r.type&&r.yAxisID===u.id&&((s=+u.getRightValue(l.data.datasets[r.index].data[t]))<0?h+=s||0:d+=s||0);return u.getPixelForValue(o<0?h+o:d+o)}return u.getPixelForValue(e)},updateBezierControlPoints:function(){var e,t,n,i,r=this.chart,s=this.getMeta(),o=s.dataset._model,a=r.chartArea,c=s.data||[];function l(e,t,n){return Math.max(Math.min(e,n),t)}if(o.spanGaps&&(c=c.filter((function(e){return!e._model.skip}))),"monotone"===o.cubicInterpolationMode)$.splineCurveMonotone(c);else for(e=0,t=c.length;e<t;++e)n=c[e]._model,i=$.splineCurve($.previousItem(c,e)._model,n,$.nextItem(c,e)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(r.options.elements.line.capBezierPoints)for(e=0,t=c.length;e<t;++e)Pe(n=c[e]._model,a)&&(e>0&&Pe(c[e-1]._model,a)&&(n.controlPointPreviousX=l(n.controlPointPreviousX,a.left,a.right),n.controlPointPreviousY=l(n.controlPointPreviousY,a.top,a.bottom)),e<c.length-1&&Pe(c[e+1]._model,a)&&(n.controlPointNextX=l(n.controlPointNextX,a.left,a.right),n.controlPointNextY=l(n.controlPointNextY,a.top,a.bottom)))},draw:function(){var e,t=this,n=t.chart,i=t.getMeta(),r=i.data||[],s=n.chartArea,o=n.canvas,a=0,c=r.length;for(t._showLine&&($.canvas.clipArea(n.ctx,{left:!1===(e=i.dataset._model.clip).left?0:s.left-e.left,right:!1===e.right?o.width:s.right+e.right,top:!1===e.top?0:s.top-e.top,bottom:!1===e.bottom?o.height:s.bottom+e.bottom}),i.dataset.draw(),$.canvas.unclipArea(n.ctx));a<c;++a)r[a].draw(s)},setHoverStyle:function(e){var t=e._model,n=e._options,i=$.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Ae(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Ae(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Ae(n.hoverBorderWidth,n.borderWidth),t.radius=Ae(n.hoverRadius,n.radius)}}),ze=$.options.resolve;j._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data,o=s.datasets,a=s.labels;if(r.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],a[t]&&i.appendChild(document.createTextNode(a[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map((function(n,i){var r=e.getDatasetMeta(0),s=r.controller.getStyle(i);return{text:n,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,hidden:isNaN(t.datasets[0].data[i])||r.data[i].hidden,index:i}})):[]}},onClick:function(e,t){var n,i,r,s=t.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(r=o.getDatasetMeta(n)).data[s].hidden=!r.data[s].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var $e=ee.extend({dataElementType:ge.Arc,linkScales:$.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i,r=this,s=r.getDataset(),o=r.getMeta(),a=r.chart.options.startAngle||0,c=r._starts=[],l=r._angles=[],u=o.data;for(r._updateRadius(),o.count=r.countVisibleElements(),t=0,n=s.data.length;t<n;t++)c[t]=a,i=r._computeAngle(t),l[t]=i,a+=i;for(t=0,n=u.length;t<n;++t)u[t]._options=r._resolveDataElementOptions(u[t],t),r.updateElement(u[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(r/2,0),t.innerRadius=Math.max(i.cutoutPercentage?t.outerRadius/100*i.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var i=this,r=i.chart,s=i.getDataset(),o=r.options,a=o.animation,c=r.scale,l=r.data.labels,u=c.xCenter,d=c.yCenter,h=o.startAngle,f=e.hidden?0:c.getDistanceFromCenterForValue(s.data[t]),p=i._starts[t],m=p+(e.hidden?0:i._angles[t]),b=a.animateScale?0:c.getDistanceFromCenterForValue(s.data[t]),g=e._options||{};$.extend(e,{_datasetIndex:i.index,_index:t,_scale:c,_model:{backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,borderAlign:g.borderAlign,x:u,y:d,innerRadius:0,outerRadius:n?b:f,startAngle:n&&a.animateRotate?h:p,endAngle:n&&a.animateRotate?h:m,label:$.valueAtIndexOrDefault(l,t,l[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return $.each(t.data,(function(t,i){isNaN(e.data[i])||t.hidden||n++})),n},setHoverStyle:function(e){var t=e._model,n=e._options,i=$.getHoverColor,r=$.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=r(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=r(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=r(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,i=t.getDataset(),r=t.getMeta();return isNaN(i.data[e])||r.data[e].hidden?0:ze([t.chart.options.elements.arc.angle,2*Math.PI/n],{chart:t.chart,dataIndex:e,dataset:i,datasetIndex:t.index},e)}});j._set("pie",$.clone(j.doughnut)),j._set("pie",{cutoutPercentage:0});var He=Le,We=$.valueOrDefault;j._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Ve=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,linkScales:$.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i=this,r=i.getMeta(),s=r.dataset,o=r.data||[],a=i.chart.scale,c=i._config;for(void 0!==c.tension&&void 0===c.lineTension&&(c.lineTension=c.tension),s._scale=a,s._datasetIndex=i.index,s._children=o,s._loop=!0,s._model=i._resolveDatasetElementOptions(s),s.pivot(),t=0,n=o.length;t<n;++t)i.updateElement(o[t],t,e);for(i.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var i=this,r=e.custom||{},s=i.getDataset(),o=i.chart.scale,a=o.getPointPositionForValue(t,s.data[t]),c=i._resolveDataElementOptions(e,t),l=i.getMeta().dataset._model,u=n?o.xCenter:a.x,d=n?o.yCenter:a.y;e._scale=o,e._options=c,e._datasetIndex=i.index,e._index=t,e._model={x:u,y:d,skip:r.skip||isNaN(u)||isNaN(d),radius:c.radius,pointStyle:c.pointStyle,rotation:c.rotation,backgroundColor:c.backgroundColor,borderColor:c.borderColor,borderWidth:c.borderWidth,tension:We(r.tension,l?l.tension:0),hitRadius:c.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,i=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return i.spanGaps=We(t.spanGaps,n.spanGaps),i.tension=We(t.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var e,t,n,i,r=this.getMeta(),s=this.chart.chartArea,o=r.data||[];function a(e,t,n){return Math.max(Math.min(e,n),t)}for(r.dataset._model.spanGaps&&(o=o.filter((function(e){return!e._model.skip}))),e=0,t=o.length;e<t;++e)n=o[e]._model,i=$.splineCurve($.previousItem(o,e,!0)._model,n,$.nextItem(o,e,!0)._model,n.tension),n.controlPointPreviousX=a(i.previous.x,s.left,s.right),n.controlPointPreviousY=a(i.previous.y,s.top,s.bottom),n.controlPointNextX=a(i.next.x,s.left,s.right),n.controlPointNextY=a(i.next.y,s.top,s.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,i=$.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=We(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=We(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=We(n.hoverBorderWidth,n.borderWidth),t.radius=We(n.hoverRadius,n.radius)}});j._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),j._set("global",{datasets:{scatter:{showLine:!1}}});var Be={bar:Me,bubble:De,doughnut:Le,horizontalBar:Ee,line:Ye,polarArea:$e,pie:He,radar:Ve,scatter:Ye};function Ue(e,t){return e.native?{x:e.x,y:e.y}:$.getRelativePosition(e,t)}function Ge(e,t){var n,i,r,s,o,a,c=e._getSortedVisibleDatasetMetas();for(i=0,s=c.length;i<s;++i)for(r=0,o=(n=c[i].data).length;r<o;++r)(a=n[r])._view.skip||t(a)}function qe(e,t){var n=[];return Ge(e,(function(e){e.inRange(t.x,t.y)&&n.push(e)})),n}function Je(e,t,n,i){var r=Number.POSITIVE_INFINITY,s=[];return Ge(e,(function(e){if(!n||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),a=i(t,o);a<r?(s=[e],r=a):a===r&&s.push(e)}})),s}function Qe(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,i){var r=t?Math.abs(e.x-i.x):0,s=n?Math.abs(e.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}function Ke(e,t,n){var i=Ue(t,e);n.axis=n.axis||"x";var r=Qe(n.axis),s=n.intersect?qe(e,i):Je(e,i,!1,r),o=[];return s.length?(e._getSortedVisibleDatasetMetas().forEach((function(e){var t=e.data[s[0]._index];t&&!t._view.skip&&o.push(t)})),o):[]}var Ze={modes:{single:function(e,t){var n=Ue(t,e),i=[];return Ge(e,(function(e){if(e.inRange(n.x,n.y))return i.push(e),i})),i.slice(0,1)},label:Ke,index:Ke,dataset:function(e,t,n){var i=Ue(t,e);n.axis=n.axis||"xy";var r=Qe(n.axis),s=n.intersect?qe(e,i):Je(e,i,!1,r);return s.length>0&&(s=e.getDatasetMeta(s[0]._datasetIndex).data),s},"x-axis":function(e,t){return Ke(e,t,{intersect:!1})},point:function(e,t){return qe(e,Ue(t,e))},nearest:function(e,t,n){var i=Ue(t,e);n.axis=n.axis||"xy";var r=Qe(n.axis);return Je(e,i,n.intersect,r)},x:function(e,t,n){var i=Ue(t,e),r=[],s=!1;return Ge(e,(function(e){e.inXRange(i.x)&&r.push(e),e.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r},y:function(e,t,n){var i=Ue(t,e),r=[],s=!1;return Ge(e,(function(e){e.inYRange(i.y)&&r.push(e),e.inRange(i.x,i.y)&&(s=!0)})),n.intersect&&!s&&(r=[]),r}}},Xe=$.extend;function et(e,t){return $.where(e,(function(e){return e.pos===t}))}function tt(e,t){return e.sort((function(e,n){var i=t?n:e,r=t?e:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function nt(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function it(e,t,n){var i,r,s=n.box,o=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?s.height:s.width,e[n.pos]+=n.size,s.getPadding){var a=s.getPadding();o.top=Math.max(o.top,a.top),o.left=Math.max(o.left,a.left),o.bottom=Math.max(o.bottom,a.bottom),o.right=Math.max(o.right,a.right)}if(i=t.outerWidth-nt(o,e,"left","right"),r=t.outerHeight-nt(o,e,"top","bottom"),i!==e.w||r!==e.h){e.w=i,e.h=r;var c=n.horizontal?[i,e.w]:[r,e.h];return!(c[0]===c[1]||isNaN(c[0])&&isNaN(c[1]))}}function rt(e,t){var n,i=t.maxPadding;return n={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach((function(e){n[e]=Math.max(t[e],i[e])})),n}function st(e,t,n){var i,r,s,o,a,c,l=[];for(i=0,r=e.length;i<r;++i)(o=(s=e[i]).box).update(s.width||t.w,s.height||t.h,rt(s.horizontal,t)),it(t,n,s)&&(c=!0,l.length&&(a=!0)),o.fullWidth||l.push(s);return a&&st(l,t,n)||c}function ot(e,t,n){var i,r,s,o,a=n.padding,c=t.x,l=t.y;for(i=0,r=e.length;i<r;++i)o=(s=e[i]).box,s.horizontal?(o.left=o.fullWidth?a.left:t.left,o.right=o.fullWidth?n.outerWidth-a.right:t.left+t.w,o.top=l,o.bottom=l+o.height,o.width=o.right-o.left,l=o.bottom):(o.left=c,o.right=c+o.width,o.top=t.top,o.bottom=t.top+t.h,o.height=o.bottom-o.top,c=o.right);t.x=c,t.y=l}j._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var at,ct={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var i,r=["fullWidth","position","weight"],s=r.length,o=0;o<s;++o)n.hasOwnProperty(i=r[o])&&(t[i]=n[i])},update:function(e,t,n){if(e){var i=$.options.toPadding((e.options.layout||{}).padding),r=t-i.width,s=n-i.height,o=function(e){var t=function(e){var t,n,i,r=[];for(t=0,n=(e||[]).length;t<n;++t)r.push({index:t,box:i=e[t],pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return r}(e),n=tt(et(t,"left"),!0),i=tt(et(t,"right")),r=tt(et(t,"top"),!0),s=tt(et(t,"bottom"));return{leftAndTop:n.concat(r),rightAndBottom:i.concat(s),chartArea:et(t,"chartArea"),vertical:n.concat(i),horizontal:r.concat(s)}}(e.boxes),a=o.vertical,c=o.horizontal,l=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:r,vBoxMaxWidth:r/2/a.length,hBoxMaxHeight:s/2}),u=Xe({maxPadding:Xe({},i),w:r,h:s,x:i.left,y:i.top},i);(function(e,t){var n,i,r;for(n=0,i=e.length;n<i;++n)(r=e[n]).width=r.horizontal?r.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,r.height=r.horizontal&&t.hBoxMaxHeight})(a.concat(c),l),st(a,u,l),st(c,u,l)&&st(a,u,l),function(e){var t=e.maxPadding;function n(n){var i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(u),ot(o.leftAndTop,u,l),u.x+=u.w,u.y+=u.h,ot(o.rightAndBottom,u,l),e.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h},$.each(o.chartArea,(function(t){var n=t.box;Xe(n,e.chartArea),n.update(u.w,u.h)}))}}},lt=(at=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&at.default||at,ut="chartjs-size-monitor",dt="chartjs-render-monitor",ht=["animationstart","webkitAnimationStart"],ft={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function pt(e,t){var n=$.getStyle(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var mt=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(n){}return e}()&&{passive:!0};function bt(e,t,n){e.addEventListener(t,n,mt)}function gt(e,t,n){e.removeEventListener(t,n,mt)}function _t(e,t,n,i,r){return{type:e,chart:t,native:r||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function yt(e){var t=document.createElement("div");return t.className=e||"",t}var vt={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document;!function(e,t){var n=e.$chartjs||(e.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(t)),e.appendChild(i)}}(t.host?t:document.head,lt)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),function(e,t){var n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var s=pt(e,"width");void 0!==s&&(e.width=s)}if(null===i||""===i)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=pt(e,"height");void 0!==s&&(e.height=o)}}(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t.$chartjs){var n=t.$chartjs.initial;["height","width"].forEach((function(e){var i=n[e];$.isNullOrUndef(i)?t.removeAttribute(e):t.setAttribute(e,i)})),$.each(n.style||{},(function(e,n){t.style[n]=e})),t.width=t.width,delete t.$chartjs}},addEventListener:function(e,t,n){var i=e.canvas;if("resize"!==t){var r=n.$chartjs||(n.$chartjs={});bt(i,t,(r.proxies||(r.proxies={}))[e.id+"_"+t]=function(t){n(function(e,t){var n=ft[e.type]||e.type,i=$.getRelativePosition(e,t);return _t(n,t,i.x,i.y,e)}(t,e))})}else!function(e,t,n){var i,r,s,o,a=e.$chartjs||(e.$chartjs={}),c=a.resizer=function(e){var t=1e6,n=yt(ut),i=yt(ut+"-expand"),r=yt(ut+"-shrink");i.appendChild(yt()),r.appendChild(yt()),n.appendChild(i),n.appendChild(r),n._reset=function(){i.scrollLeft=t,i.scrollTop=t,r.scrollLeft=t,r.scrollTop=t};var s=function(){n._reset(),e()};return bt(i,"scroll",s.bind(i,"expand")),bt(r,"scroll",s.bind(r,"shrink")),n}((i=function(){if(a.resizer){var i=n.options.maintainAspectRatio&&e.parentNode,r=i?i.clientWidth:0;t(_t("resize",n)),i&&i.clientWidth<r&&n.canvas&&t(_t("resize",n))}},s=!1,o=[],function(){o=Array.prototype.slice.call(arguments),r=r||this,s||(s=!0,$.requestAnimFrame.call(window,(function(){s=!1,i.apply(r,o)})))}));!function(e,t){var n=e.$chartjs||(e.$chartjs={}),i=n.renderProxy=function(e){"chartjs-render-animation"===e.animationName&&t()};$.each(ht,(function(t){bt(e,t,i)})),n.reflow=!!e.offsetParent,e.classList.add(dt)}(e,(function(){if(a.resizer){var t=e.parentNode;t&&t!==c.parentNode&&t.insertBefore(c,t.firstChild),c._reset()}}))}(i,n,e)},removeEventListener:function(e,t,n){var i,r,s,o=e.canvas;if("resize"!==t){var a=((n.$chartjs||{}).proxies||{})[e.id+"_"+t];a&&gt(o,t,a)}else s=(r=(i=o).$chartjs||{}).resizer,delete r.resizer,function(e){var t=e.$chartjs||{},n=t.renderProxy;n&&($.each(ht,(function(t){gt(e,t,n)})),delete t.renderProxy),e.classList.remove(dt)}(i),s&&s.parentNode&&s.parentNode.removeChild(s)}};$.addEvent=bt,$.removeEvent=gt;var wt=$.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},vt._enabled?vt:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});j._set("global",{plugins:{}});var St={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach((function(e){-1===t.indexOf(e)&&t.push(e)})),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach((function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var i,r,s,o,a,c=this.descriptors(e),l=c.length;for(i=0;i<l;++i)if("function"==typeof(a=(s=(r=c[i]).plugin)[t])&&((o=[e].concat(n||[])).push(r.options),!1===a.apply(s,o)))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],i=[],r=e&&e.config||{},s=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach((function(e){if(-1===n.indexOf(e)){var t=e.id,r=s[t];!1!==r&&(!0===r&&(r=$.clone(j.global.plugins[t])),n.push(e),i.push({plugin:e,options:r||{}}))}})),t.descriptors=i,t.id=this._cacheId,i},_invalidate:function(e){delete e.$plugins}},Mt={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=$.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?$.merge(Object.create(null),[j.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var n=this;n.defaults.hasOwnProperty(e)&&(n.defaults[e]=$.extend(n.defaults[e],t))},addScalesToLayout:function(e){$.each(e.scales,(function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,ct.addBox(e,t)}))}},xt=$.valueOrDefault,kt=$.rtl.getRtlAdapter;j._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:$.noop,title:function(e,t){var n="",i=t.labels,r=i?i.length:0;if(e.length>0){var s=e[0];s.label?n=s.label:s.xLabel?n=s.xLabel:r>0&&s.index<r&&(n=i[s.index])}return n},afterTitle:$.noop,beforeBody:$.noop,beforeLabel:$.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),$.isNullOrUndef(e.value)?n+=e.yLabel:n+=e.value,n},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:$.noop,afterBody:$.noop,beforeFooter:$.noop,footer:$.noop,afterFooter:$.noop}}});var Dt={average:function(e){if(!e.length)return!1;var t,n,i=0,r=0,s=0;for(t=0,n=e.length;t<n;++t){var o=e[t];if(o&&o.hasValue()){var a=o.tooltipPosition();i+=a.x,r+=a.y,++s}}return{x:i/s,y:r/s}},nearest:function(e,t){var n,i,r,s=t.x,o=t.y,a=Number.POSITIVE_INFINITY;for(n=0,i=e.length;n<i;++n){var c=e[n];if(c&&c.hasValue()){var l=c.getCenterPoint(),u=$.distanceBetweenPoints(t,l);u<a&&(a=u,r=c)}}if(r){var d=r.tooltipPosition();s=d.x,o=d.y}return{x:s,y:o}}};function Tt(e,t){return t&&($.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ct(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Ot(e){var t=j.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:xt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:xt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:xt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:xt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:xt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:xt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:xt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:xt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:xt(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Rt(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Lt(e){return Tt([],Ct(e))}var Et=U.extend({initialize:function(){this._model=Ot(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),i=t.title.apply(e,arguments),r=t.afterTitle.apply(e,arguments),s=[];return s=Tt(s,Ct(n)),s=Tt(s,Ct(i)),Tt(s,Ct(r))},getBeforeBody:function(){return Lt(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,i=n._options.callbacks,r=[];return $.each(e,(function(e){var s={before:[],lines:[],after:[]};Tt(s.before,Ct(i.beforeLabel.call(n,e,t))),Tt(s.lines,i.label.call(n,e,t)),Tt(s.after,Ct(i.afterLabel.call(n,e,t))),r.push(s)})),r},getAfterBody:function(){return Lt(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),i=t.footer.apply(e,arguments),r=t.afterFooter.apply(e,arguments),s=[];return s=Tt(s,Ct(n)),s=Tt(s,Ct(i)),Tt(s,Ct(r))},update:function(e){var t,n,i,r,s,o,a,c,l,u,d=this,h=d._options,f=d._model,p=d._model=Ot(h),m=d._active,b=d._data,g={xAlign:f.xAlign,yAlign:f.yAlign},_={x:f.x,y:f.y},y={width:f.width,height:f.height},v={x:f.caretX,y:f.caretY};if(m.length){p.opacity=1;var w=[],S=[];v=Dt[h.position].call(d,m,d._eventPosition);var M=[];for(t=0,n=m.length;t<n;++t)M.push((r=void 0,s=void 0,void 0,void 0,c=void 0,l=void 0,u=void 0,r=(i=m[t])._xScale,s=i._yScale||i._scale,o=i._index,l=(c=i._chart.getDatasetMeta(a=i._datasetIndex).controller)._getIndexScale(),u=c._getValueScale(),{xLabel:r?r.getLabelForIndex(o,a):"",yLabel:s?s.getLabelForIndex(o,a):"",label:l?""+l.getLabelForIndex(o,a):"",value:u?""+u.getLabelForIndex(o,a):"",index:o,datasetIndex:a,x:i._model.x,y:i._model.y}));h.filter&&(M=M.filter((function(e){return h.filter(e,b)}))),h.itemSort&&(M=M.sort((function(e,t){return h.itemSort(e,t,b)}))),$.each(M,(function(e){w.push(h.callbacks.labelColor.call(d,e,d._chart)),S.push(h.callbacks.labelTextColor.call(d,e,d._chart))})),p.title=d.getTitle(M,b),p.beforeBody=d.getBeforeBody(M,b),p.body=d.getBody(M,b),p.afterBody=d.getAfterBody(M,b),p.footer=d.getFooter(M,b),p.x=v.x,p.y=v.y,p.caretPadding=h.caretPadding,p.labelColors=w,p.labelTextColors=S,p.dataPoints=M,_=function(e,t,n,i){var r=e.x,s=e.y,o=e.caretPadding,a=n.xAlign,c=n.yAlign,l=e.caretSize+o,u=e.cornerRadius+o;return"right"===a?r-=t.width:"center"===a&&((r-=t.width/2)+t.width>i.width&&(r=i.width-t.width),r<0&&(r=0)),"top"===c?s+=l:s-="bottom"===c?t.height+l:t.height/2,"center"===c?"left"===a?r+=l:"right"===a&&(r-=l):"left"===a?r-=u:"right"===a&&(r+=u),{x:r,y:s}}(p,y=function(e,t){var n=e._chart.ctx,i=2*t.yPadding,r=0,s=t.body,o=s.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0),a=t.title.length,c=t.footer.length,l=t.titleFontSize,u=t.bodyFontSize,d=t.footerFontSize;i+=a*l,i+=a?(a-1)*t.titleSpacing:0,i+=a?t.titleMarginBottom:0,i+=(o+=t.beforeBody.length+t.afterBody.length)*u,i+=o?(o-1)*t.bodySpacing:0,i+=c?t.footerMarginTop:0,i+=c*d,i+=c?(c-1)*t.footerSpacing:0;var h=0,f=function(e){r=Math.max(r,n.measureText(e).width+h)};return n.font=$.fontString(l,t._titleFontStyle,t._titleFontFamily),$.each(t.title,f),n.font=$.fontString(u,t._bodyFontStyle,t._bodyFontFamily),$.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?u+2:0,$.each(s,(function(e){$.each(e.before,f),$.each(e.lines,f),$.each(e.after,f)})),h=0,n.font=$.fontString(d,t._footerFontStyle,t._footerFontFamily),$.each(t.footer,f),{width:r+=2*t.xPadding,height:i}}(this,p),g=function(e,t){var n,i,r,s,o,a=e._model,c=e._chart,l=e._chart.chartArea,u="center",d="center";a.y<t.height?d="top":a.y>c.height-t.height&&(d="bottom");var h=(l.left+l.right)/2,f=(l.top+l.bottom)/2;"center"===d?(n=function(e){return e<=h},i=function(e){return e>h}):(n=function(e){return e<=t.width/2},i=function(e){return e>=c.width-t.width/2}),r=function(e){return e+t.width+a.caretSize+a.caretPadding>c.width},s=function(e){return e-t.width-a.caretSize-a.caretPadding<0},o=function(e){return e<=f?"top":"bottom"},n(a.x)?(u="left",r(a.x)&&(u="center",d=o(a.y))):i(a.x)&&(u="right",s(a.x)&&(u="center",d=o(a.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:u,yAlign:p.yAlign?p.yAlign:d}}(this,y),d._chart)}else p.opacity=0;return p.xAlign=g.xAlign,p.yAlign=g.yAlign,p.x=_.x,p.y=_.y,p.width=y.width,p.height=y.height,p.caretX=v.x,p.caretY=v.y,d._model=p,e&&h.custom&&h.custom.call(d,p),d},drawCaret:function(e,t){var n=this._chart.ctx,i=this.getCaretPosition(e,t,this._view);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(e,t,n){var i,r,s,o,a,c,l=n.caretSize,u=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=e.x,p=e.y,m=t.width,b=t.height;if("center"===h)a=p+b/2,"left"===d?(r=(i=f)-l,s=i,o=a+l,c=a-l):(r=(i=f+m)+l,s=i,o=a-l,c=a+l);else if("left"===d?(i=(r=f+u+l)-l,s=r+l):"right"===d?(i=(r=f+m-u-l)-l,s=r+l):(i=(r=n.caretX)-l,s=r+l),"top"===h)a=(o=p)-l,c=o;else{a=(o=p+b)+l,c=o;var g=s;s=i,i=g}return{x1:i,x2:r,x3:s,y1:o,y2:a,y3:c}},drawTitle:function(e,t,n){var i,r,s,o=t.title,a=o.length;if(a){var c=kt(t.rtl,t.x,t.width);for(e.x=Rt(t,t._titleAlign),n.textAlign=c.textAlign(t._titleAlign),n.textBaseline="middle",i=t.titleFontSize,r=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=$.fontString(i,t._titleFontStyle,t._titleFontFamily),s=0;s<a;++s)n.fillText(o[s],c.x(e.x),e.y+i/2),e.y+=i+r,s+1===a&&(e.y+=t.titleMarginBottom-r)}},drawBody:function(e,t,n){var i,r,s,o,a,c,l,u,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,m=t.displayColors,b=0,g=m?Rt(t,"left"):0,_=kt(t.rtl,t.x,t.width),y=function(t){n.fillText(t,_.x(e.x+b),e.y+d/2),e.y+=d+h},v=_.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=$.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=Rt(t,v),n.fillStyle=t.bodyFontColor,$.each(t.beforeBody,y),b=m&&"right"!==v?"center"===f?d/2+1:d+2:0,a=0,l=p.length;a<l;++a){for(i=p[a],s=t.labelColors[a],n.fillStyle=r=t.labelTextColors[a],$.each(i.before,y),c=0,u=(o=i.lines).length;c<u;++c){if(m){var w=_.x(g);n.fillStyle=t.legendColorBackground,n.fillRect(_.leftForLtr(w,d),e.y,d,d),n.lineWidth=1,n.strokeStyle=s.borderColor,n.strokeRect(_.leftForLtr(w,d),e.y,d,d),n.fillStyle=s.backgroundColor,n.fillRect(_.leftForLtr(_.xPlus(w,1),d-2),e.y+1,d-2,d-2),n.fillStyle=r}y(o[c])}$.each(i.after,y)}b=0,$.each(t.afterBody,y),e.y-=h},drawFooter:function(e,t,n){var i,r,s=t.footer,o=s.length;if(o){var a=kt(t.rtl,t.x,t.width);for(e.x=Rt(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=a.textAlign(t._footerAlign),n.textBaseline="middle",i=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=$.fontString(i,t._footerFontStyle,t._footerFontFamily),r=0;r<o;++r)n.fillText(s[r],a.x(e.x),e.y+i/2),e.y+=i+t.footerSpacing}},drawBackground:function(e,t,n,i){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var r=t.xAlign,s=t.yAlign,o=e.x,a=e.y,c=i.width,l=i.height,u=t.cornerRadius;n.beginPath(),n.moveTo(o+u,a),"top"===s&&this.drawCaret(e,i),n.lineTo(o+c-u,a),n.quadraticCurveTo(o+c,a,o+c,a+u),"center"===s&&"right"===r&&this.drawCaret(e,i),n.lineTo(o+c,a+l-u),n.quadraticCurveTo(o+c,a+l,o+c-u,a+l),"bottom"===s&&this.drawCaret(e,i),n.lineTo(o+u,a+l),n.quadraticCurveTo(o,a+l,o,a+l-u),"center"===s&&"left"===r&&this.drawCaret(e,i),n.lineTo(o,a+u),n.quadraticCurveTo(o,a,o+u,a),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},i={x:t.x,y:t.y},r=Math.abs(t.opacity<.001)?0:t.opacity;this._options.enabled&&(t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length)&&(e.save(),e.globalAlpha=r,this.drawBackground(i,t,e,n),i.y+=t.yPadding,$.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),$.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===e.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,i.mode,i),i.reverse&&n._active.reverse()),(t=!$.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}});Et.positioners=Dt;var At=$.valueOrDefault;function It(){return $.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){if("xAxes"===e||"yAxes"===e){var r,s,o,a=n[e].length;for(t[e]||(t[e]=[]),r=0;r<a;++r)s=At((o=n[e][r]).type,"xAxes"===e?"category":"linear"),r>=t[e].length&&t[e].push({}),$.merge(t[e][r],!t[e][r].type||o.type&&o.type!==t[e][r].type?[Mt.getScaleDefaults(s),o]:o)}else $._merger(e,t,n,i)}})}function Pt(){return $.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){var r=t[e]||Object.create(null),s=n[e];"scales"===e?t[e]=It(r,s):"scale"===e?t[e]=$.merge(r,[Mt.getScaleDefaults(s.type),s]):$._merger(e,t,n,i)}})}function jt(e){var t=e.options;$.each(e.scales,(function(t){ct.removeBox(e,t)})),t=Pt(j.global,j[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Nt(e,t,n){var i,r=function(e){return e.id===i};do{i=t+n++}while($.findIndex(e,r)>=0);return i}function Ft(e){return"top"===e||"bottom"===e}function Yt(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}j._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var zt=function(e,t){return this.construct(e,t),this};$.extend(zt.prototype,{construct:function(e,t){var n=this;t=function(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Pt(j.global,j[e.type],e.options||{}),e}(t);var i=wt.acquireContext(e,t),r=i&&i.canvas,s=r&&r.height,o=r&&r.width;n.id=$.uid(),n.ctx=i,n.canvas=r,n.config=t,n.width=o,n.height=s,n.aspectRatio=s?o/s:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,zt.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),i&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return St.notify(e,"beforeInit"),$.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),St.notify(e,"afterInit"),e},clear:function(){return $.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,i=t.canvas,r=n.maintainAspectRatio&&t.aspectRatio||null,s=Math.max(0,Math.floor($.getMaximumWidth(i))),o=Math.max(0,Math.floor(r?s/r:$.getMaximumHeight(i)));if((t.width!==s||t.height!==o)&&(i.width=t.width=s,i.height=t.height=o,i.style.width=s+"px",i.style.height=o+"px",$.retinaScale(t,n.devicePixelRatio),!e)){var a={width:s,height:o};St.notify(t,"resize",[a]),n.onResize&&n.onResize(t,a),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;$.each(t.xAxes,(function(e,n){e.id||(e.id=Nt(t.xAxes,"x-axis-",n))})),$.each(t.yAxes,(function(e,n){e.id||(e.id=Nt(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},i=[],r=Object.keys(n).reduce((function(e,t){return e[t]=!1,e}),{});t.scales&&(i=i.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&i.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),$.each(i,(function(t){var i=t.options,s=i.id,o=At(i.type,t.dtype);Ft(i.position)!==Ft(t.dposition)&&(i.position=t.dposition),r[s]=!0;var a=null;if(s in n&&n[s].type===o)(a=n[s]).options=i,a.ctx=e.ctx,a.chart=e;else{var c=Mt.getScaleConstructor(o);if(!c)return;a=new c({id:s,type:o,options:i,ctx:e.ctx,chart:e}),n[a.id]=a}a.mergeTicksOptions(),t.isDefault&&(e.scale=a)})),$.each(r,(function(e,t){e||delete n[t]})),e.scales=n,Mt.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,i=[],r=n.data.datasets;for(e=0,t=r.length;e<t;e++){var s=r[e],o=n.getDatasetMeta(e),a=s.type||n.config.type;if(o.type&&o.type!==a&&(n.destroyDatasetMeta(e),o=n.getDatasetMeta(e)),o.type=a,o.order=s.order||0,o.index=e,o.controller)o.controller.updateIndex(e),o.controller.linkScales();else{var c=Be[o.type];if(void 0===c)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new c(n,e),i.push(o.controller)}}return i},resetElements:function(){var e=this;$.each(e.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.reset()}),e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),jt(i),St._invalidate(i),!1!==St.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var r=i.buildOrUpdateControllers();for(t=0,n=i.data.datasets.length;t<n;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&$.each(r,(function(e){e.reset()})),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],St.notify(i,"afterUpdate"),i._layers.sort(Yt("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;!1!==St.notify(e,"beforeLayout")&&(ct.update(this,this.width,this.height),e._layers=[],$.each(e.boxes,(function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())}),e),e._layers.forEach((function(e,t){e._idx=t})),St.notify(e,"afterScaleUpdate"),St.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==St.notify(e,"beforeDatasetsUpdate")){for(var t=0,n=e.data.datasets.length;t<n;++t)e.updateDataset(t);St.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,n=t.getDatasetMeta(e),i={meta:n,index:e};!1!==St.notify(t,"beforeDatasetUpdate",[i])&&(n.controller._update(),St.notify(t,"afterDatasetUpdate",[i]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,i=At(e.duration,n&&n.duration),r=e.lazy;if(!1!==St.notify(t,"beforeRender")){var s=function(e){St.notify(t,"afterRender"),$.callback(n&&n.onComplete,[e],t)};if(n&&i){var o=new q({numSteps:i/16.66,easing:e.easing||n.easing,render:function(e,t){var n=t.currentStep,i=n/t.numSteps;e.draw((0,$.easing.effects[t.easing])(i),i,n)},onAnimationProgress:n.onProgress,onAnimationComplete:s});J.addAnimation(t,o,i,r)}else t.draw(),s(new q({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,i=this;if(i.clear(),$.isNullOrUndef(e)&&(e=1),i.transition(e),!(i.width<=0||i.height<=0)&&!1!==St.notify(i,"beforeDraw",[e])){for(n=i._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(i.chartArea);for(i.drawDatasets(e);t<n.length;++t)n[t].draw(i.chartArea);i._drawTooltip(e),St.notify(i,"afterDraw",[e])}},transition:function(e){for(var t=this,n=0,i=(t.data.datasets||[]).length;n<i;++n)t.isDatasetVisible(n)&&t.getDatasetMeta(n).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,i=this,r=[];for(t=0,n=(i.data.datasets||[]).length;t<n;++t)e&&!i.isDatasetVisible(t)||r.push(i.getDatasetMeta(t));return r.sort(Yt("order","index")),r},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n,i=this;if(!1!==St.notify(i,"beforeDatasetsDraw",[e])){for(n=(t=i._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)i.drawDataset(t[n],e);St.notify(i,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};!1!==St.notify(this,"beforeDatasetDraw",[n])&&(e.controller.draw(t),St.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this,n=t.tooltip,i={tooltip:n,easingValue:e};!1!==St.notify(t,"beforeTooltipDraw",[i])&&(n.draw(),St.notify(t,"afterTooltipDraw",[i]))},getElementAtEvent:function(e){return Ze.modes.single(this,e)},getElementsAtEvent:function(e){return Ze.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Ze.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var i=Ze.modes[t];return"function"==typeof i?i(this,e,n):[]},getDatasetAtEvent:function(e){return Ze.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var i=n._meta[t.id];return i||(i=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),i},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],i=n._meta&&n._meta[t];i&&(i.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,i=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);i&&(n.unbindEvents(),$.canvas.clear(n),wt.releaseContext(n.ctx),n.canvas=null,n.ctx=null),St.notify(n,"destroy"),delete zt.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new Et({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};$.each(e.options.events,(function(i){wt.addEventListener(e,i,n),t[i]=n})),e.options.responsive&&(n=function(){e.resize()},wt.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,$.each(t,(function(t,n){wt.removeEventListener(e,n,t)})))},updateHoverStyle:function(e,t,n){var i,r,s,o=n?"set":"remove";for(r=0,s=e.length;r<s;++r)(i=e[r])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(!1!==St.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var i=t.handleEvent(e);n&&(i=n._start?n.handleEvent(e):i|n.handleEvent(e)),St.notify(t,"afterEvent",[e]);var r=t._bufferedRequest;return r?t.render(r):i&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t,n=this,i=n.options||{},r=i.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===e.type?[]:n.getElementsAtEventForMode(e,r.mode,r),$.callback(i.onHover||i.hover.onHover,[e.native,n.active],n),"mouseup"!==e.type&&"click"!==e.type||i.onClick&&i.onClick.call(n,e.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,r.mode,!1),n.active.length&&r.mode&&n.updateHoverStyle(n.active,r.mode,!0),t=!$.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,t}}),zt.instances={};var $t=zt;function Ht(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Wt(e){this.options=e||{}}zt.Controller=zt,zt.types={},$.configMerge=Pt,$.scaleMerge=It,$.extend(Wt.prototype,{formats:Ht,parse:Ht,format:Ht,add:Ht,diff:Ht,startOf:Ht,endOf:Ht,_create:function(e){return e}}),Wt.override=function(e){$.extend(Wt.prototype,e)};var Vt={_date:Wt},Bt={formatters:{values:function(e){return $.isArray(e)?e:""+e},linear:function(e,t,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&e!==Math.floor(e)&&(i=e-Math.floor(e));var r=$.log10(Math.abs(i)),s="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=$.log10(Math.abs(e)),a=Math.floor(o)-Math.floor(r);a=Math.max(Math.min(a,20),0),s=e.toExponential(a)}else{var c=-1*Math.floor(r);c=Math.max(Math.min(c,20),0),s=e.toFixed(c)}else s="0";return s},logarithmic:function(e,t,n){var i=e/Math.pow(10,Math.floor($.log10(e)));return 0===e?"0":1===i||2===i||5===i||0===t||t===n.length-1?e.toExponential():""}}},Ut=$.isArray,Gt=$.isNullOrUndef,qt=$.valueOrDefault,Jt=$.valueAtIndexOrDefault;function Qt(e,t,n){var i,r=e.getTicks().length,s=Math.min(t,r-1),o=e.getPixelForTick(s),a=e._startPixel,c=e._endPixel,l=1e-6;if(!(n&&(i=1===r?Math.max(o-a,c-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(s-1))/2,(o+=s<t?i:-i)<a-l||o>c+l)))return o}function Kt(e){return e.drawTicks?e.tickMarkLength:0}function Zt(e){var t,n;return e.display?(t=$.options._parseFont(e),n=$.options.toPadding(e.padding),t.lineHeight+n.height):0}function Xt(e,t){return $.extend($.options._parseFont({fontFamily:qt(t.fontFamily,e.fontFamily),fontSize:qt(t.fontSize,e.fontSize),fontStyle:qt(t.fontStyle,e.fontStyle),lineHeight:qt(t.lineHeight,e.lineHeight)}),{color:$.options.resolve([t.fontColor,e.fontColor,j.global.defaultFontColor])})}function en(e){var t=Xt(e,e.minor);return{minor:t,major:e.major.enabled?Xt(e,e.major):t}}function tn(e){var t,n,i,r=[];for(n=0,i=e.length;n<i;++n)void 0!==(t=e[n])._index&&r.push(t);return r}function nn(e,t,n,i){var r,s,o,a,c=qt(n,0),l=Math.min(qt(i,e.length),e.length),u=0;for(t=Math.ceil(t),i&&(t=(r=i-n)/Math.floor(r/t)),a=c;a<0;)u++,a=Math.round(c+u*t);for(s=Math.max(c,0);s<l;s++)o=e[s],s===a?(o._index=s,u++,a=Math.round(c+u*t)):delete o.label}j._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Bt.formatters.values,minor:{},major:{}}});var rn=U.extend({zeroLineIndex:0,getPadding:function(){var e=this;return{left:e.paddingLeft||0,top:e.paddingTop||0,right:e.paddingRight||0,bottom:e.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){$.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var i,r,s,o,a,c=this,l=c.options.ticks,u=l.sampleSize;if(c.beforeUpdate(),c.maxWidth=e,c.maxHeight=t,c.margins=$.extend({left:0,right:0,top:0,bottom:0},n),c._ticks=null,c.ticks=null,c._labelSizes=null,c._maxLabelLines=0,c.longestLabelWidth=0,c.longestTextCache=c.longestTextCache||{},c._gridLineItems=null,c._labelItems=null,c.beforeSetDimensions(),c.setDimensions(),c.afterSetDimensions(),c.beforeDataLimits(),c.determineDataLimits(),c.afterDataLimits(),c.beforeBuildTicks(),o=c.buildTicks()||[],(!(o=c.afterBuildTicks(o)||o)||!o.length)&&c.ticks)for(o=[],i=0,r=c.ticks.length;i<r;++i)o.push({value:c.ticks[i],major:!1});return c._ticks=o,s=c._convertTicksToLabels((a=u<o.length)?function(e,t){for(var n=[],i=e.length/t,r=0,s=e.length;r<s;r+=i)n.push(e[Math.floor(r)]);return n}(o,u):o),c._configure(),c.beforeCalculateTickRotation(),c.calculateTickRotation(),c.afterCalculateTickRotation(),c.beforeFit(),c.fit(),c.afterFit(),c._ticksToDraw=l.display&&(l.autoSkip||"auto"===l.source)?c._autoSkip(o):o,a&&(s=c._convertTicksToLabels(c._ticksToDraw)),c.ticks=s,c.afterUpdate(),c.minSize},_configure:function(){var e,t,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,i=!i),n._startPixel=e,n._endPixel=t,n._reversePixels=i,n._length=t-e},afterUpdate:function(){$.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){$.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){$.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){$.callback(this.options.beforeDataLimits,[this])},determineDataLimits:$.noop,afterDataLimits:function(){$.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){$.callback(this.options.beforeBuildTicks,[this])},buildTicks:$.noop,afterBuildTicks:function(e){var t=this;return Ut(e)&&e.length?$.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=$.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){$.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this,t=e.options.ticks;e.ticks=e.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){$.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){$.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,i,r,s,o,a=this,c=a.options,l=c.ticks,u=a.getTicks().length,d=l.minRotation||0,h=l.maxRotation,f=d;!a._isVisible()||!l.display||d>=h||u<=1||!a.isHorizontal()?a.labelRotation=d:(t=(e=a._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,i=Math.min(a.maxWidth,a.chart.width-t),t+6>(r=c.offset?a.maxWidth/u:i/(u-1))&&(r=i/(u-(c.offset?.5:1)),s=a.maxHeight-Kt(c.gridLines)-l.padding-Zt(c.scaleLabel),o=Math.sqrt(t*t+n*n),f=$.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/r,1)),Math.asin(Math.min(s/o,1))-Math.asin(n/o))),f=Math.max(d,Math.min(h,f))),a.labelRotation=f)},afterCalculateTickRotation:function(){$.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){$.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,i=e.options,r=i.ticks,s=i.scaleLabel,o=i.gridLines,a=e._isVisible(),c="bottom"===i.position,l=e.isHorizontal();if(l?t.width=e.maxWidth:a&&(t.width=Kt(o)+Zt(s)),l?a&&(t.height=Kt(o)+Zt(s)):t.height=e.maxHeight,r.display&&a){var u=en(r),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,m=d.highest,b=.4*u.minor.lineHeight,g=r.padding;if(l){var _=0!==e.labelRotation,y=$.toRadians(e.labelRotation),v=Math.cos(y),w=Math.sin(y);t.height=Math.min(e.maxHeight,t.height+(w*p.width+v*(m.height-(_?m.offset:0))+(_?0:b))+g);var S,M,x=e.getPixelForTick(0)-e.left,k=e.right-e.getPixelForTick(e.getTicks().length-1);_?(S=c?v*h.width+w*h.offset:w*(h.height-h.offset),M=c?w*(f.height-f.offset):v*f.width+w*f.offset):(S=h.width/2,M=f.width/2),e.paddingLeft=Math.max((S-x)*e.width/(e.width-x),0)+3,e.paddingRight=Math.max((M-k)*e.width/(e.width-k),0)+3}else t.width=Math.min(e.maxWidth,t.width+(r.mirror?0:p.width+g+b)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),l?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){$.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Gt(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,i,r=this;for(r.ticks=e.map((function(e){return e.value})),r.beforeTickToLabelConversion(),t=r.convertTicksToLabels(e)||r.ticks,r.afterTickToLabelConversion(),n=0,i=e.length;n<i;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,n,i){var r,s,o,a,c,l,u,d,h,f,p,m,b,g=n.length,_=[],y=[],v=[],w=0,S=0;for(r=0;r<g;++r){if(a=n[r].label,e.font=l=(c=n[r].major?t.major:t.minor).string,u=i[l]=i[l]||{data:{},gc:[]},d=c.lineHeight,h=f=0,Gt(a)||Ut(a)){if(Ut(a))for(s=0,o=a.length;s<o;++s)Gt(p=a[s])||Ut(p)||(h=$.measureText(e,u.data,u.gc,h,p),f+=d)}else h=$.measureText(e,u.data,u.gc,h,a),f=d;_.push(h),y.push(f),v.push(d/2),w=Math.max(h,w),S=Math.max(f,S)}function M(e){return{width:_[e]||0,height:y[e]||0,offset:v[e]||0}}return function(e,t){$.each(e,(function(e){var n,i=e.gc,r=i.length/2;if(r>t){for(n=0;n<r;++n)delete e.data[i[n]];i.splice(0,r)}}))}(i,g),m=_.indexOf(w),b=y.indexOf(S),{first:M(0),last:M(g-1),widest:M(m),highest:M(b)}}(e.ctx,en(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,i,r;return Ut(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),i=Math.min(t,n),r=Math.max(t,n)):(t=void 0,n=e=+this.getRightValue(e),i=e,r=e),{min:i,max:r,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:$.noop,getPixelForValue:$.noop,getValueForPixel:$.noop,getPixelForTick:function(e){var t=this,n=t.options.offset,i=t._ticks.length,r=1/Math.max(i-(n?0:1),1);return e<0||e>i-1?null:t.getPixelForDecimal(e*r+(n?r/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,i,r,s=this,o=s.options.ticks,a=o.maxTicksLimit||s._length/s._tickSize()+1,c=o.major.enabled?function(e){var t,n,i=[];for(t=0,n=e.length;t<n;t++)e[t].major&&i.push(t);return i}(e):[],l=c.length,u=c[0],d=c[l-1];if(l>a)return function(e,t,n){var i,r,s=0,o=t[0];for(n=Math.ceil(n),i=0;i<e.length;i++)r=e[i],i===o?(r._index=i,o=t[++s*n]):delete r.label}(e,c,l/a),tn(e);if(i=function(e,t,n,i){var r,s,o,a,c=function(e){var t,n,i=e.length;if(i<2)return!1;for(n=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),l=(t.length-1)/i;if(!c)return Math.max(l,1);for(o=0,a=(r=$.math._factorize(c)).length-1;o<a;o++)if((s=r[o])>l)return s;return Math.max(l,1)}(c,e,0,a),l>0){for(t=0,n=l-1;t<n;t++)nn(e,i,c[t],c[t+1]);return nn(e,i,$.isNullOrUndef(r=l>1?(d-u)/(l-1):null)?0:u-r,u),nn(e,i,d,$.isNullOrUndef(r)?e.length:d+r),tn(e)}return nn(e,i),tn(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=$.toRadians(e.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=e._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,c=s?s.highest.height+o:0;return e.isHorizontal()?c*i>a*r?a/i:c/r:c*r<a*i?c/i:a/r},_isVisible:function(){var e,t,n,i=this,r=i.chart,s=i.options.display;if("auto"!==s)return!!s;for(e=0,t=r.data.datasets.length;e<t;++e)if(r.isDatasetVisible(e)&&((n=r.getDatasetMeta(e)).xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_=this,y=_.chart,v=_.options,w=v.gridLines,S=v.position,M=w.offsetGridLines,x=_.isHorizontal(),k=_._ticksToDraw,D=k.length+(M?1:0),T=Kt(w),C=[],O=w.drawBorder?Jt(w.lineWidth,0,0):0,R=O/2,L=$._alignPixel,E=function(e){return L(y,e,O)};for("top"===S?(t=E(_.bottom),a=_.bottom-T,l=t-R,d=E(e.top)+R,f=e.bottom):"bottom"===S?(t=E(_.top),d=e.top,f=E(e.bottom)-R,a=t+R,l=_.top+T):"left"===S?(t=E(_.right),o=_.right-T,c=t-R,u=E(e.left)+R,h=e.right):(t=E(_.left),u=e.left,h=E(e.right)-R,o=t+R,c=_.left+T),n=0;n<D;++n)Gt((i=k[n]||{}).label)&&n<k.length||(n===_.zeroLineIndex&&v.offset===M?(p=w.zeroLineWidth,m=w.zeroLineColor,b=w.zeroLineBorderDash||[],g=w.zeroLineBorderDashOffset||0):(p=Jt(w.lineWidth,n,1),m=Jt(w.color,n,"rgba(0,0,0,0.1)"),b=w.borderDash||[],g=w.borderDashOffset||0),void 0!==(r=Qt(_,i._index||n,M))&&(s=L(y,r,p),x?o=c=u=h=s:a=l=d=f=s,C.push({tx1:o,ty1:a,tx2:c,ty2:l,x1:u,y1:d,x2:h,y2:f,width:p,color:m,borderDash:b,borderDashOffset:g})));return C.ticksLength=D,C.borderValue=t,C},_computeLabelItems:function(){var e,t,n,i,r,s,o,a,c,l,u,d,h=this,f=h.options,p=f.ticks,m=f.position,b=p.mirror,g=h.isHorizontal(),_=h._ticksToDraw,y=en(p),v=p.padding,w=Kt(f.gridLines),S=-$.toRadians(h.labelRotation),M=[];for("top"===m?(s=h.bottom-w-v,o=S?"left":"center"):"bottom"===m?(s=h.top+w+v,o=S?"right":"center"):"left"===m?(r=h.right-(b?0:w)-v,o=b?"left":"right"):(r=h.left+(b?0:w)+v,o=b?"right":"left"),e=0,t=_.length;e<t;++e)Gt(i=(n=_[e]).label)||(a=h.getPixelForTick(n._index||e)+p.labelOffset,l=(c=n.major?y.major:y.minor).lineHeight,u=Ut(i)?i.length:1,g?(r=a,d="top"===m?((S?1:.5)-u)*l:(S?0:.5)*l):(s=a,d=(1-u)*l/2),M.push({x:r,y:s,rotation:S,label:i,font:c,textOffset:d,textAlign:o}));return M},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var i,r,s,o,a,c=t.ctx,l=t.chart,u=$._alignPixel,d=n.drawBorder?Jt(n.lineWidth,0,0):0,h=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(s=0,o=h.length;s<o;++s)r=(a=h[s]).color,(i=a.width)&&r&&(c.save(),c.lineWidth=i,c.strokeStyle=r,c.setLineDash&&(c.setLineDash(a.borderDash),c.lineDashOffset=a.borderDashOffset),c.beginPath(),n.drawTicks&&(c.moveTo(a.tx1,a.ty1),c.lineTo(a.tx2,a.ty2)),n.drawOnChartArea&&(c.moveTo(a.x1,a.y1),c.lineTo(a.x2,a.y2)),c.stroke(),c.restore());if(d){var f,p,m,b,g=d,_=Jt(n.lineWidth,h.ticksLength-1,1),y=h.borderValue;t.isHorizontal()?(f=u(l,t.left,g)-g/2,p=u(l,t.right,_)+_/2,m=b=y):(m=u(l,t.top,g)-g/2,b=u(l,t.bottom,_)+_/2,f=p=y),c.lineWidth=d,c.strokeStyle=Jt(n.color,0),c.beginPath(),c.moveTo(f,m),c.lineTo(p,b),c.stroke()}}},_drawLabels:function(){var e=this;if(e.options.ticks.display){var t,n,i,r,s,o,a,c,l=e.ctx,u=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,i=u.length;t<i;++t){if(o=(s=u[t]).font,l.save(),l.translate(s.x,s.y),l.rotate(s.rotation),l.font=o.string,l.fillStyle=o.color,l.textBaseline="middle",l.textAlign=s.textAlign,c=s.textOffset,Ut(a=s.label))for(n=0,r=a.length;n<r;++n)l.fillText(""+a[n],0,c),c+=o.lineHeight;else l.fillText(a,0,c);l.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,i=n.scaleLabel;if(i.display){var r,s,o=qt(i.fontColor,j.global.defaultFontColor),a=$.options._parseFont(i),c=$.options.toPadding(i.padding),l=a.lineHeight/2,u=n.position,d=0;if(e.isHorizontal())r=e.left+e.width/2,s="bottom"===u?e.bottom-l-c.bottom:e.top+l+c.top;else{var h="left"===u;r=h?e.left+l+c.top:e.right-l-c.top,s=e.top+e.height/2,d=h?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(r,s),t.rotate(d),t.textAlign="center",t.textBaseline="middle",t.fillStyle=o,t.font=a.string,t.fillText(i.labelString,0,0),t.restore()}},draw:function(e){var t=this;t._isVisible()&&(t._drawGrid(e),t._drawTitle(),t._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,i=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==i&&e.draw===e._draw?[{z:i,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter((function(i){return(!e||i.type===e)&&(n?i.xAxisID===t.id:i.yAxisID===t.id)}))}});rn.prototype._draw=rn.prototype.draw;var sn=rn,on=$.isNullOrUndef,an=sn.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),i=t.options.ticks,r=i.min,s=i.max,o=0,a=n.length-1;void 0!==r&&(e=n.indexOf(r))>=0&&(o=e),void 0!==s&&(e=n.indexOf(s))>=0&&(a=e),t.minIndex=o,t.maxIndex=a,t.min=n[o],t.max=n[a]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,i=e.maxIndex;e.ticks=0===n&&i===t.length-1?t:t.slice(n,i+1)},getLabelForIndex:function(e,t){var n=this,i=n.chart;return i.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;sn.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var i,r,s,o=this;return on(t)||on(n)||(e=o.chart.data.datasets[n].data[t]),on(e)||(i=o.isHorizontal()?e.x:e.y),(void 0!==i||void 0!==e&&isNaN(t))&&(r=o._getLabels(),e=$.valueOrDefault(i,e),t=-1!==(s=r.indexOf(e))?s:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});an._defaults={position:"bottom"};var cn=$.isNullOrUndef,ln=sn.extend({getRightValue:function(e){return"string"==typeof e?+e:sn.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=$.sign(e.min),i=$.sign(e.max);n<0&&i<0?e.max=0:n>0&&i>0&&(e.min=0)}var r=void 0!==t.min||void 0!==t.suggestedMin,s=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(e.min=null===e.min?t.suggestedMin:Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(e.max=null===e.max?t.suggestedMax:Math.max(e.max,t.suggestedMax)),r!==s&&e.min>=e.max&&(r?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,i=n.stepSize,r=n.maxTicksLimit;return i?e=Math.ceil(t.max/i)-Math.floor(t.min/i)+1:(e=t._computeTickLimit(),r=r||11),r&&(e=Math.min(r,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:$.noop,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:$.valueOrDefault(t.fixedStepSize,t.stepSize)},r=e.ticks=function(e,t){var n,i,r,s,o=[],a=e.stepSize,c=a||1,l=e.maxTicks-1,u=e.min,d=e.max,h=e.precision,f=t.min,p=t.max,m=$.niceNum((p-f)/l/c)*c;if(m<1e-14&&cn(u)&&cn(d))return[f,p];(s=Math.ceil(p/m)-Math.floor(f/m))>l&&(m=$.niceNum(s*m/l/c)*c),a||cn(h)?n=Math.pow(10,$._decimalPlaces(m)):(n=Math.pow(10,h),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,r=Math.ceil(p/m)*m,a&&(!cn(u)&&$.almostWhole(u/m,m/1e3)&&(i=u),!cn(d)&&$.almostWhole(d/m,m/1e3)&&(r=d)),s=$.almostEquals(s=(r-i)/m,Math.round(s),m/1e3)?Math.round(s):Math.ceil(s),i=Math.round(i*n)/n,r=Math.round(r*n)/n,o.push(cn(u)?i:u);for(var b=1;b<s;++b)o.push(Math.round((i+b*m)*n)/n);return o.push(cn(d)?r:d),o}(i,e);e.handleDirectionalChanges(),e.max=$.max(r),e.min=$.min(r),t.reverse?(r.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),sn.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),i=t.min,r=t.max;sn.prototype._configure.call(t),t.options.offset&&n.length&&(i-=e=(r-i)/Math.max(n.length-1,1)/2,r+=e),t._startValue=i,t._endValue=r,t._valueRange=r-i}}),un={position:"left",ticks:{callback:Bt.formatters.linear}};function dn(e,t,n,i){var r,s,o=e.options,a=function(e,t,n){var i=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[i]&&(e[i]={pos:[],neg:[]}),e[i]}(t,o.stacked,n),c=a.pos,l=a.neg,u=i.length;for(r=0;r<u;++r)s=e._parseValue(i[r]),isNaN(s.min)||isNaN(s.max)||n.data[r].hidden||(c[r]=c[r]||0,l[r]=l[r]||0,o.relativePoints?c[r]=100:s.min<0||s.max<0?l[r]+=s.min:c[r]+=s.max)}function hn(e,t,n){var i,r,s=n.length;for(i=0;i<s;++i)r=e._parseValue(n[i]),isNaN(r.min)||isNaN(r.max)||t.data[i].hidden||(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}var fn=ln.extend({determineDataLimits:function(){var e,t,n,i,r=this,s=r.options,o=r.chart.data.datasets,a=r._getMatchingVisibleMetas(),c=s.stacked,l={},u=a.length;if(r.min=Number.POSITIVE_INFINITY,r.max=Number.NEGATIVE_INFINITY,void 0===c)for(e=0;!c&&e<u;++e)c=void 0!==(t=a[e]).stack;for(e=0;e<u;++e)n=o[(t=a[e]).index].data,c?dn(r,l,t,n):hn(r,t,n);$.each(l,(function(e){i=e.pos.concat(e.neg),r.min=Math.min(r.min,$.min(i)),r.max=Math.max(r.max,$.max(i))})),r.min=$.isFinite(r.min)&&!isNaN(r.min)?r.min:0,r.max=$.isFinite(r.max)&&!isNaN(r.max)?r.max:1,r.handleTickRangeOptions()},_computeTickLimit:function(){var e,t=this;return t.isHorizontal()?Math.ceil(t.width/40):(e=$.options._parseFont(t.options.ticks),Math.ceil(t.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){var t=this;return t.getPixelForDecimal((+t.getRightValue(e)-t._startValue)/t._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}});fn._defaults=un;var pn=$.valueOrDefault,mn=$.math.log10,bn={position:"left",ticks:{callback:Bt.formatters.logarithmic}};function gn(e,t){return $.isFinite(e)&&e>=0?e:t}var _n=sn.extend({determineDataLimits:function(){var e,t,n,i,r,s,o=this,a=o.options,c=o.chart,l=c.data.datasets,u=o.isHorizontal();function d(e){return u?e.xAxisID===o.id:e.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=a.stacked;if(void 0===h)for(e=0;e<l.length;e++)if(t=c.getDatasetMeta(e),c.isDatasetVisible(e)&&d(t)&&void 0!==t.stack){h=!0;break}if(a.stacked||h){var f={};for(e=0;e<l.length;e++){var p=[(t=c.getDatasetMeta(e)).type,void 0===a.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(c.isDatasetVisible(e)&&d(t))for(void 0===f[p]&&(f[p]=[]),r=0,s=(i=l[e].data).length;r<s;r++){var m=f[p];n=o._parseValue(i[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(m[r]=m[r]||0,m[r]+=n.max)}}$.each(f,(function(e){if(e.length>0){var t=$.min(e),n=$.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,n)}}))}else for(e=0;e<l.length;e++)if(t=c.getDatasetMeta(e),c.isDatasetVisible(e)&&d(t))for(r=0,s=(i=l[e].data).length;r<s;r++)n=o._parseValue(i[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=$.isFinite(o.min)?o.min:null,o.max=$.isFinite(o.max)?o.max:null,o.minNotZero=$.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=gn(t.min,e.min),e.max=gn(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(mn(e.min))-1),e.max=Math.pow(10,Math.floor(mn(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(mn(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(mn(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(mn(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),i={min:gn(t.min),max:gn(t.max)},r=e.ticks=function(e,t){var n,i,r=[],s=pn(e.min,Math.pow(10,Math.floor(mn(t.min)))),o=Math.floor(mn(t.max)),a=Math.ceil(t.max/Math.pow(10,o));0===s?(n=Math.floor(mn(t.minNotZero)),i=Math.floor(t.minNotZero/Math.pow(10,n)),r.push(s),s=i*Math.pow(10,n)):(n=Math.floor(mn(s)),i=Math.floor(s/Math.pow(10,n)));var c=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(s),10==++i&&(i=1,c=++n>=0?1:c),s=Math.round(i*Math.pow(10,n)*c)/c}while(n<o||n===o&&i<a);var l=pn(e.max,s);return r.push(l),r}(i,e);e.max=$.max(r),e.min=$.min(r),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&r.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),sn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(mn(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;sn.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=pn(e.options.ticks.fontSize,j.global.defaultFontSize)/e._length),e._startValue=mn(t),e._valueOffset=n,e._valueRange=(mn(e.max)-mn(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(mn(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}});_n._defaults=bn;var yn=$.valueOrDefault,vn=$.valueAtIndexOrDefault,wn=$.options.resolve,Sn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Bt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Mn(e){var t=e.ticks;return t.display&&e.display?yn(t.fontSize,j.global.defaultFontSize)+2*t.backdropPaddingY:0}function xn(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function kn(e){return 0===e||180===e?"center":e<180?"left":"right"}function Dn(e,t,n,i){var r,s,o=n.y+i/2;if($.isArray(t))for(r=0,s=t.length;r<s;++r)e.fillText(t[r],n.x,o),o+=i;else e.fillText(t,n.x,o)}function Tn(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function Cn(e){return $.isNumber(e)?e:0}var On=ln.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Mn(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;$.each(t.data.datasets,(function(r,s){if(t.isDatasetVisible(s)){var o=t.getDatasetMeta(s);$.each(r.data,(function(t,r){var s=+e.getRightValue(t);isNaN(s)||o.data[r].hidden||(n=Math.min(s,n),i=Math.max(s,i))}))}})),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=i===Number.NEGATIVE_INFINITY?0:i,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Mn(this.options))},convertTicksToLabels:function(){var e=this;ln.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map((function(){var t=$.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""}))},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this,t=e.options;t.display&&t.pointLabels.display?function(e){var t,n,i,r=$.options._parseFont(e.options.pointLabels),s={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={};e.ctx.font=r.string,e._pointLabelSizes=[];var a,c,l,u=e.chart.data.labels.length;for(t=0;t<u;t++){i=e.getPointPosition(t,e.drawingArea+5),a=e.ctx,c=r.lineHeight,n=$.isArray(l=e.pointLabels[t])?{w:$.longestText(a,a.font,l),h:l.length*c}:{w:a.measureText(l).width,h:c},e._pointLabelSizes[t]=n;var d=e.getIndexAngle(t),h=$.toDegrees(d)%360,f=xn(h,i.x,n.w,0,180),p=xn(h,i.y,n.h,90,270);f.start<s.l&&(s.l=f.start,o.l=d),f.end>s.r&&(s.r=f.end,o.r=d),p.start<s.t&&(s.t=p.start,o.t=d),p.end>s.b&&(s.b=p.end,o.b=d)}e.setReductions(e.drawingArea,s,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var i=this,r=t.l/Math.sin(n.l),s=Math.max(t.r-i.width,0)/Math.sin(n.r),o=-t.t/Math.cos(n.t),a=-Math.max(t.b-(i.height-i.paddingTop),0)/Math.cos(n.b);r=Cn(r),s=Cn(s),o=Cn(o),a=Cn(a),i.drawingArea=Math.min(Math.floor(e-(r+s)/2),Math.floor(e-(o+a)/2)),i.setCenterPoint(r,s,o,a)},setCenterPoint:function(e,t,n,i){var r=this,s=n+r.drawingArea,o=r.height-r.paddingTop-i-r.drawingArea;r.xCenter=Math.floor((e+r.drawingArea+(r.width-t-r.drawingArea))/2+r.left),r.yCenter=Math.floor((s+o)/2+r.top+r.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if($.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this,i=n.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(i)*t+n.xCenter,y:Math.sin(i)*t+n.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,n=t.min,i=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var e,t,n,i=this,r=i.ctx,s=i.options,o=s.gridLines,a=s.angleLines,c=yn(a.lineWidth,o.lineWidth),l=yn(a.color,o.color);if(s.pointLabels.display&&function(e){var t=e.ctx,n=e.options,i=n.pointLabels,r=Mn(n),s=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),o=$.options._parseFont(i);t.save(),t.font=o.string,t.textBaseline="middle";for(var a=e.chart.data.labels.length-1;a>=0;a--){var c=e.getPointPosition(a,s+(0===a?r/2:0)+5),l=vn(i.fontColor,a,j.global.defaultFontColor);t.fillStyle=l;var u=e.getIndexAngle(a),d=$.toDegrees(u);t.textAlign=kn(d),Tn(d,e._pointLabelSizes[a],c),Dn(t,e.pointLabels[a],c,o.lineHeight)}t.restore()}(i),o.display&&$.each(i.ticks,(function(e,n){0!==n&&(t=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(e,t,n,i){var r,s=e.ctx,o=t.circular,a=e.chart.data.labels.length,c=vn(t.color,i-1),l=vn(t.lineWidth,i-1);if((o||a)&&c&&l){if(s.save(),s.strokeStyle=c,s.lineWidth=l,s.setLineDash&&(s.setLineDash(t.borderDash||[]),s.lineDashOffset=t.borderDashOffset||0),s.beginPath(),o)s.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{r=e.getPointPosition(0,n),s.moveTo(r.x,r.y);for(var u=1;u<a;u++)r=e.getPointPosition(u,n),s.lineTo(r.x,r.y)}s.closePath(),s.stroke(),s.restore()}}(i,o,t,n))})),a.display&&c&&l){for(r.save(),r.lineWidth=c,r.strokeStyle=l,r.setLineDash&&(r.setLineDash(wn([a.borderDash,o.borderDash,[]])),r.lineDashOffset=wn([a.borderDashOffset,o.borderDashOffset,0])),e=i.chart.data.labels.length-1;e>=0;e--)t=i.getDistanceFromCenterForValue(s.ticks.reverse?i.min:i.max),n=i.getPointPosition(e,t),r.beginPath(),r.moveTo(i.xCenter,i.yCenter),r.lineTo(n.x,n.y),r.stroke();r.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var i,r,s=e.getIndexAngle(0),o=$.options._parseFont(n),a=yn(n.fontColor,j.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",$.each(e.ticks,(function(s,c){(0!==c||n.reverse)&&(i=e.getDistanceFromCenterForValue(e.ticksAsNumbers[c]),n.showLabelBackdrop&&(r=t.measureText(s).width,t.fillStyle=n.backdropColor,t.fillRect(-r/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,r+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),t.fillStyle=a,t.fillText(s,0,-i))})),t.restore()}},_drawTitle:$.noop});On._defaults=Sn;var Rn=$._deprecated,Ln=$.options.resolve,En=$.valueOrDefault,An=Number.MIN_SAFE_INTEGER||-9007199254740991,In=Number.MAX_SAFE_INTEGER||9007199254740991,Pn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},jn=Object.keys(Pn);function Nn(e,t){return e-t}function Fn(e){return $.valueOrDefault(e.time.min,e.ticks.min)}function Yn(e){return $.valueOrDefault(e.time.max,e.ticks.max)}function zn(e,t,n,i){var r=function(e,t,n){for(var i,r,s,o=0,a=e.length-1;o>=0&&o<=a;){if(s=e[i=o+a>>1],!(r=e[i-1]||null))return{lo:null,hi:s};if(s[t]<n)o=i+1;else{if(!(r[t]>n))return{lo:r,hi:s};a=i-1}}return{lo:s,hi:null}}(e,t,n),s=r.lo?r.hi?r.lo:e[e.length-2]:e[0],o=r.lo?r.hi?r.hi:e[e.length-1]:e[1],a=o[t]-s[t];return s[i]+(o[i]-s[i])*(a?(n-s[t])/a:0)}function $n(e,t){var n=e._adapter,i=e.options.time,r=i.parser,s=r||i.format,o=t;return"function"==typeof r&&(o=r(o)),$.isFinite(o)||(o="string"==typeof s?n.parse(o,s):n.parse(o)),null!==o?+o:(r||"function"!=typeof s||(o=s(t),$.isFinite(o)||(o=n.parse(o))),o)}function Hn(e,t){if($.isNullOrUndef(t))return null;var n=e.options.time,i=$n(e,e.getRightValue(t));return null===i||n.round&&(i=+e._adapter.startOf(i,n.round)),i}function Wn(e,t,n,i){var r,s,o=jn.length;for(r=jn.indexOf(e);r<o-1;++r)if((s=Pn[jn[r]]).common&&Math.ceil((n-t)/((s.steps?s.steps:In)*s.size))<=i)return jn[r];return jn[o-1]}function Vn(e,t,n){var i,r,s=[],o={},a=t.length;for(i=0;i<a;++i)o[r=t[i]]=i,s.push({value:r,major:!1});return 0!==a&&n?function(e,t,n,i){var r,s,o=e._adapter,a=+o.startOf(t[0].value,i),c=t[t.length-1].value;for(r=a;r<=c;r=+o.add(r,1,i))(s=n[r])>=0&&(t[s].major=!0);return t}(e,s,o,n):s}var Bn=sn.extend({initialize:function(){this.mergeTicksOptions(),sn.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),i=e._adapter=new Vt._date(t.adapters.date);return Rn("time scale",n.format,"time.format","time.parser"),Rn("time scale",n.min,"time.min","ticks.min"),Rn("time scale",n.max,"time.max","ticks.max"),$.mergeIf(n.displayFormats,i.formats()),sn.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),sn.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,i,r,s,o,a=this,c=a.chart,l=a._adapter,u=a.options,d=u.time.unit||"day",h=In,f=An,p=[],m=[],b=[],g=a._getLabels();for(e=0,n=g.length;e<n;++e)b.push(Hn(a,g[e]));for(e=0,n=(c.data.datasets||[]).length;e<n;++e)if(c.isDatasetVisible(e))if($.isObject((r=c.data.datasets[e].data)[0]))for(m[e]=[],t=0,i=r.length;t<i;++t)s=Hn(a,r[t]),p.push(s),m[e][t]=s;else m[e]=b.slice(0),o||(p=p.concat(b),o=!0);else m[e]=[];b.length&&(h=Math.min(h,b[0]),f=Math.max(f,b[b.length-1])),p.length&&(p=n>1?function(e){var t,n,i,r={},s=[];for(t=0,n=e.length;t<n;++t)r[i=e[t]]||(r[i]=!0,s.push(i));return s}(p).sort(Nn):p.sort(Nn),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=Hn(a,Fn(u))||h,f=Hn(a,Yn(u))||f,h=h===In?+l.startOf(Date.now(),d):h,f=f===An?+l.endOf(Date.now(),d)+1:f,a.min=Math.min(h,f),a.max=Math.max(h+1,f),a._table=[],a._timestamps={data:p,datasets:m,labels:b}},buildTicks:function(){var e,t,n,i=this,r=i.min,s=i.max,o=i.options,a=o.ticks,c=o.time,l=i._timestamps,u=[],d=i.getLabelCapacity(r),h=a.source,f=o.distribution;for(l="data"===h||"auto"===h&&"series"===f?l.data:"labels"===h?l.labels:function(e,t,n,i){var r,s=e._adapter,o=e.options,a=o.time,c=a.unit||Wn(a.minUnit,t,n,i),l=Ln([a.stepSize,a.unitStepSize,1]),u="week"===c&&a.isoWeekday,d=t,h=[];if(u&&(d=+s.startOf(d,"isoWeek",u)),d=+s.startOf(d,u?"day":c),s.diff(n,t,c)>1e5*l)throw t+" and "+n+" are too far apart with stepSize of "+l+" "+c;for(r=d;r<n;r=+s.add(r,l,c))h.push(r);return r!==n&&"ticks"!==o.bounds||h.push(r),h}(i,r,s,d),"ticks"===o.bounds&&l.length&&(r=l[0],s=l[l.length-1]),r=Hn(i,Fn(o))||r,s=Hn(i,Yn(o))||s,e=0,t=l.length;e<t;++e)(n=l[e])>=r&&n<=s&&u.push(n);return i.min=r,i.max=s,i._unit=c.unit||(a.autoSkip?Wn(c.minUnit,i.min,i.max,d):function(e,t,n,i,r){var s,o;for(s=jn.length-1;s>=jn.indexOf(n);s--)if(Pn[o=jn[s]].common&&e._adapter.diff(r,i,o)>=t-1)return o;return jn[n?jn.indexOf(n):0]}(i,u.length,c.minUnit,i.min,i.max)),i._majorUnit=a.major.enabled&&"year"!==i._unit?function(e){for(var t=jn.indexOf(e)+1,n=jn.length;t<n;++t)if(Pn[jn[t]].common)return jn[t]}(i._unit):void 0,i._table=function(e,t,n,i){if("linear"===i||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var r,s,o,a,c,l=[],u=[t];for(r=0,s=e.length;r<s;++r)(a=e[r])>t&&a<n&&u.push(a);for(u.push(n),r=0,s=u.length;r<s;++r)c=u[r+1],a=u[r],void 0!==(o=u[r-1])&&void 0!==c&&Math.round((c+o)/2)===a||l.push({time:a,pos:r/(s-1)});return l}(i._timestamps.data,r,s,f),i._offsets=function(e,t,n,i,r){var s,o,a=0,c=0;return r.offset&&t.length&&(s=zn(e,"time",t[0],"pos"),a=1===t.length?1-s:(zn(e,"time",t[1],"pos")-s)/2,o=zn(e,"time",t[t.length-1],"pos"),c=1===t.length?o:(o-zn(e,"time",t[t.length-2],"pos"))/2),{start:a,end:c,factor:1/(a+1+c)}}(i._table,u,0,0,o),a.reverse&&u.reverse(),Vn(i,u,i._majorUnit)},getLabelForIndex:function(e,t){var n=this,i=n._adapter,r=n.chart.data,s=n.options.time,o=r.labels&&e<r.labels.length?r.labels[e]:"",a=r.datasets[t].data[e];return $.isObject(a)&&(o=n.getRightValue(a)),s.tooltipFormat?i.format($n(n,o),s.tooltipFormat):"string"==typeof o?o:i.format($n(n,o),s.displayFormats.datetime)},tickFormatFunction:function(e,t,n,i){var r=this,s=r.options,o=s.time.displayFormats,a=r._majorUnit,c=o[a],l=n[t],u=s.ticks,d=a&&c&&l&&l.major,h=r._adapter.format(e,i||(d?c:o[r._unit])),f=d?u.major:u.minor,p=Ln([f.callback,f.userCallback,u.callback,u.userCallback]);return p?p(h,t,n):h},convertTicksToLabels:function(e){var t,n,i=[];for(t=0,n=e.length;t<n;++t)i.push(this.tickFormatFunction(e[t].value,t,e));return i},getPixelForOffset:function(e){var t=this,n=t._offsets,i=zn(t._table,"time",e,"pos");return t.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(e,t,n){var i=this,r=null;if(void 0!==t&&void 0!==n&&(r=i._timestamps.datasets[n][t]),null===r&&(r=Hn(i,e)),null!==r)return i.getPixelForOffset(r)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this,n=t._offsets,i=t.getDecimalForPixel(e)/n.factor-n.end,r=zn(t._table,"pos",i,"time");return t._adapter._create(r)},_getLabelSize:function(e){var t=this,n=t.options.ticks,i=t.ctx.measureText(e).width,r=$.toRadians(t.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),o=Math.sin(r),a=En(n.fontSize,j.global.defaultFontSize);return{w:i*s+a*o,h:i*o+a*s}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=t.tickFormatFunction(e,0,Vn(t,[e],t._majorUnit),r),o=t._getLabelSize(s),a=Math.floor(t.isHorizontal()?t.width/o.w:t.height/o.h);return t.options.offset&&a--,a>0?a:1}});Bn._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var Un={category:an,linear:fn,logarithmic:_n,radialLinear:On,time:Bn},Gn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Vt._date.override("function"==typeof e?{_id:"moment",formats:function(){return Gn},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,i){return e(t).add(n,i).valueOf()},diff:function(t,n,i){return e(t).diff(e(n),i)},startOf:function(t,n,i){return t=e(t),"isoWeek"===n?t.isoWeekday(i).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),j._set("global",{plugins:{filler:{propagate:!0}}});var qn={dataset:function(e){var t=e.fill,n=e.chart,i=n.getDatasetMeta(t),r=i&&n.isDatasetVisible(t)&&i.dataset._children||[],s=r.length||0;return s?function(e,t){return t<s&&r[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,i=t?t.y:null;return $.isArray(t)?function(e,n){return t[n]}:function(e){return{x:null===n?e.x:n,y:null===i?e.y:i}}}};function Jn(e,t,n){var i,r=e._model||{},s=r.fill;if(void 0===s&&(s=!!r.backgroundColor),!1===s||null===s)return!1;if(!0===s)return"origin";if(i=parseFloat(s,10),isFinite(i)&&Math.floor(i)===i)return"-"!==s[0]&&"+"!==s[0]||(i=t+i),!(i===t||i<0||i>=n)&&i;switch(s){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return s;default:return!1}}function Qn(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,n,i,r,s,o=e.el._scale,a=o.options,c=o.chart.data.labels.length,l=e.fill,u=[];if(!c)return null;for(n=a.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,t=a.ticks.reverse?o.max:o.min),r=0;r<c;++r)s="start"===l||"end"===l?o.getPointPositionForValue(r,"start"===l?t:n):o.getBasePosition(r),a.gridLines.circular&&(s.cx=i.x,s.cy=i.y,s.angle=o.getIndexAngle(r)-Math.PI/2),u.push(s);return u}(e):function(e){var t,n=e.el._model||{},i=e.el._scale||{},r=e.fill,s=null;if(isFinite(r))return null;if("start"===r?s=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===r?s=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?s=n.scaleZero:i.getBasePixel&&(s=i.getBasePixel()),null!=s){if(void 0!==s.x&&void 0!==s.y)return s;if($.isFinite(s))return{x:(t=i.isHorizontal())?s:null,y:t?null:s}}return null}(e)}function Kn(e,t,n){var i,r=e[t].fill,s=[t];if(!n)return r;for(;!1!==r&&-1===s.indexOf(r);){if(!isFinite(r))return r;if(!(i=e[r]))return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function Zn(e){var t=e.fill,n="dataset";return!1===t?null:(isFinite(t)||(n="boundary"),qn[n](e))}function Xn(e){return e&&!e.skip}function ei(e,t,n,i,r){var s,o,a,c;if(i&&r){for(e.moveTo(t[0].x,t[0].y),s=1;s<i;++s)$.canvas.lineTo(e,t[s-1],t[s]);if(void 0===n[0].angle)for(e.lineTo(n[r-1].x,n[r-1].y),s=r-1;s>0;--s)$.canvas.lineTo(e,n[s],n[s-1],!0);else for(o=n[0].cx,a=n[0].cy,c=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-a,2)),s=r-1;s>0;--s)e.arc(o,a,c,n[s].angle,n[s-1].angle,!0)}}function ti(e,t,n,i,r,s){var o,a,c,l,u,d,h,f,p=t.length,m=i.spanGaps,b=[],g=[],_=0,y=0;for(e.beginPath(),o=0,a=p;o<a;++o)u=n(l=t[c=o%p]._view,c,i),d=Xn(l),h=Xn(u),s&&void 0===f&&d&&(a=p+(f=o+1)),d&&h?(_=b.push(l),y=g.push(u)):_&&y&&(m?(d&&b.push(l),h&&g.push(u)):(ei(e,b,g,_,y),_=y=0,b=[],g=[]));ei(e,b,g,_,y),e.closePath(),e.fillStyle=r,e.fill()}var ni={id:"filler",afterDatasetsUpdate:function(e,t){var n,i,r,s,o=(e.data.datasets||[]).length,a=t.propagate,c=[];for(i=0;i<o;++i)s=null,(r=(n=e.getDatasetMeta(i)).dataset)&&r._model&&r instanceof ge.Line&&(s={visible:e.isDatasetVisible(i),fill:Jn(r,i,o),chart:e,el:r}),n.$filler=s,c.push(s);for(i=0;i<o;++i)(s=c[i])&&(s.fill=Kn(c,i,a),s.boundary=Qn(s),s.mapper=Zn(s))},beforeDatasetsDraw:function(e){var t,n,i,r,s,o,a,c=e._getSortedVisibleDatasetMetas(),l=e.ctx;for(n=c.length-1;n>=0;--n)(t=c[n].$filler)&&t.visible&&(s=(i=t.el)._children||[],a=(r=i._view).backgroundColor||j.global.defaultColor,(o=t.mapper)&&a&&s.length&&($.canvas.clipArea(l,e.chartArea),ti(l,s,o,r,a,i._loop),$.canvas.unclipArea(l)))}},ii=$.rtl.getRtlAdapter,ri=$.noop,si=$.valueOrDefault;function oi(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}j._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,i=this.chart,r=i.getDatasetMeta(n);r.hidden=null===r.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},i=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map((function(n){var r=n.controller.getStyle(i?0:void 0);return{text:t[n.index].label,fillStyle:r.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:r.borderWidth,strokeStyle:r.borderColor,pointStyle:r.pointStyle,rotation:r.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data.datasets;for(r.setAttribute("class",e.id+"-legend"),t=0,n=s.length;t<n;t++)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=s[t].backgroundColor,s[t].label&&i.appendChild(document.createTextNode(s[t].label));return r.outerHTML}});var ai=U.extend({initialize:function(e){var t=this;$.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:ri,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ri,beforeSetDimensions:ri,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ri,beforeBuildLabels:ri,buildLabels:function(){var e=this,t=e.options.labels||{},n=$.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:ri,beforeFit:ri,fit:function(){var e=this,t=e.options,n=t.labels,i=t.display,r=e.ctx,s=$.options._parseFont(n),o=s.size,a=e.legendHitBoxes=[],c=e.minSize,l=e.isHorizontal();if(l?(c.width=e.maxWidth,c.height=i?10:0):(c.width=i?10:0,c.height=e.maxHeight),i){if(r.font=s.string,l){var u=e.lineWidths=[0],d=0;r.textAlign="left",r.textBaseline="middle",$.each(e.legendItems,(function(e,t){var i=oi(n,o)+o/2+r.measureText(e.text).width;(0===t||u[u.length-1]+i+2*n.padding>c.width)&&(d+=o+n.padding,u[u.length-(t>0?0:1)]=0),a[t]={left:0,top:0,width:i,height:o},u[u.length-1]+=i+n.padding})),c.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],m=n.padding,b=0,g=0;$.each(e.legendItems,(function(e,t){var i=oi(n,o)+o/2+r.measureText(e.text).width;t>0&&g+o+2*h>c.height&&(m+=b+n.padding,f.push(b),p.push(g),b=0,g=0),b=Math.max(b,i),g+=o+h,a[t]={left:0,top:0,width:i,height:o}})),m+=b,f.push(b),p.push(g),c.width+=m}e.width=c.width,e.height=c.height}else e.width=c.width=e.height=c.height=0},afterFit:ri,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,i=j.global,r=i.defaultColor,s=i.elements.line,o=e.height,a=e.columnHeights,c=e.width,l=e.lineWidths;if(t.display){var u,d=ii(t.rtl,e.left,e.minSize.width),h=e.ctx,f=si(n.fontColor,i.defaultFontColor),p=$.options._parseFont(n),m=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var b=oi(n,m),g=e.legendHitBoxes,_=function(e,i){switch(t.align){case"start":return n.padding;case"end":return e-i;default:return(e-i+n.padding)/2}},y=e.isHorizontal();u=y?{x:e.left+_(c,l[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+_(o,a[0]),line:0},$.rtl.overrideTextDirection(e.ctx,t.textDirection);var v=m+n.padding;$.each(e.legendItems,(function(t,i){var f=h.measureText(t.text).width,p=b+m/2+f,w=u.x,S=u.y;d.setWidth(e.minSize.width),y?i>0&&w+p+n.padding>e.left+e.minSize.width&&(S=u.y+=v,u.line++,w=u.x=e.left+_(c,l[u.line])):i>0&&S+v>e.top+e.minSize.height&&(w=u.x=w+e.columnWidths[u.line]+n.padding,u.line++,S=u.y=e.top+_(o,a[u.line]));var M=d.x(w);(function(e,t,i){if(!(isNaN(b)||b<=0)){h.save();var o=si(i.lineWidth,s.borderWidth);if(h.fillStyle=si(i.fillStyle,r),h.lineCap=si(i.lineCap,s.borderCapStyle),h.lineDashOffset=si(i.lineDashOffset,s.borderDashOffset),h.lineJoin=si(i.lineJoin,s.borderJoinStyle),h.lineWidth=o,h.strokeStyle=si(i.strokeStyle,r),h.setLineDash&&h.setLineDash(si(i.lineDash,s.borderDash)),n&&n.usePointStyle){var a=b*Math.SQRT2/2,c=d.xPlus(e,b/2);$.canvas.drawPoint(h,i.pointStyle,a,c,t+m/2,i.rotation)}else h.fillRect(d.leftForLtr(e,b),t,b,m),0!==o&&h.strokeRect(d.leftForLtr(e,b),t,b,m);h.restore()}})(M,S,t),g[i].left=d.leftForLtr(M,g[i].width),g[i].top=S,function(e,t,n,i){var r=m/2,s=d.xPlus(e,b+r),o=t+r;h.fillText(n.text,s,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(s,o),h.lineTo(d.xPlus(s,i),o),h.stroke())}(M,S,t,f),y?u.x+=p+n.padding:u.y+=v})),$.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,i,r,s=this;if(e>=s.left&&e<=s.right&&t>=s.top&&t<=s.bottom)for(r=s.legendHitBoxes,n=0;n<r.length;++n)if(e>=(i=r[n]).left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return s.legendItems[n];return null},handleEvent:function(e){var t,n=this,i=n.options,r="mouseup"===e.type?"click":e.type;if("mousemove"===r){if(!i.onHover&&!i.onLeave)return}else{if("click"!==r)return;if(!i.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===r?t&&i.onClick&&i.onClick.call(n,e.native,t):(i.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),i.onHover&&t&&i.onHover.call(n,e.native,t))}});function ci(e,t){var n=new ai({ctx:e.ctx,options:t,chart:e});ct.configure(e,n,t),ct.addBox(e,n),e.legend=n}var li={id:"legend",_element:ai,beforeInit:function(e){var t=e.options.legend;t&&ci(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?($.mergeIf(t,j.global.legend),n?(ct.configure(e,n,t),n.options=t):ci(e,t)):n&&(ct.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},ui=$.noop;j._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var di=U.extend({initialize:function(e){$.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:ui,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ui,beforeSetDimensions:ui,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ui,beforeBuildLabels:ui,buildLabels:ui,afterBuildLabels:ui,beforeFit:ui,fit:function(){var e,t=this,n=t.options,i=t.minSize={},r=t.isHorizontal();n.display?(e=($.isArray(n.text)?n.text.length:1)*$.options._parseFont(n).lineHeight+2*n.padding,t.width=i.width=r?t.maxWidth:e,t.height=i.height=r?e:t.maxHeight):t.width=i.width=t.height=i.height=0},afterFit:ui,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var i,r,s,o=$.options._parseFont(n),a=o.lineHeight,c=a/2+n.padding,l=0,u=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=$.valueOrDefault(n.fontColor,j.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(r=d+(f-d)/2,s=u+c,i=f-d):(r="left"===n.position?d+c:f-c,s=u+(h-u)/2,i=h-u,l=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(r,s),t.rotate(l),t.textAlign="center",t.textBaseline="middle";var p=n.text;if($.isArray(p))for(var m=0,b=0;b<p.length;++b)t.fillText(p[b],0,m,i),m+=a;else t.fillText(p,0,0,i);t.restore()}}});function hi(e,t){var n=new di({ctx:e.ctx,options:t,chart:e});ct.configure(e,n,t),ct.addBox(e,n),e.titleBlock=n}var fi={},pi=ni,mi=li,bi={id:"title",_element:di,beforeInit:function(e){var t=e.options.title;t&&hi(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?($.mergeIf(t,j.global.title),n?(ct.configure(e,n,t),n.options=t):hi(e,t)):n&&(ct.removeBox(e,n),delete e.titleBlock)}};for(var gi in fi.filler=pi,fi.legend=mi,fi.title=bi,$t.helpers=$,function(){function e(e,t,n){var i;return"string"==typeof e?(i=parseInt(e,10),-1!==e.indexOf("%")&&(i=i/100*t.parentNode[n])):i=e,i}function t(e){return null!=e&&"none"!==e}function n(n,i,r){var s=document.defaultView,o=$._getParentNode(n),a=s.getComputedStyle(n)[i],c=s.getComputedStyle(o)[i],l=t(a),u=t(c),d=Number.POSITIVE_INFINITY;return l||u?Math.min(l?e(a,n,r):d,u?e(c,o,r):d):"none"}$.where=function(e,t){if($.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return $.each(e,(function(e){t(e)&&n.push(e)})),n},$.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var i=0,r=e.length;i<r;++i)if(t.call(n,e[i],i,e))return i;return-1},$.findNextWhere=function(e,t,n){$.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<e.length;i++){var r=e[i];if(t(r))return r}},$.findPreviousWhere=function(e,t,n){$.isNullOrUndef(n)&&(n=e.length);for(var i=n-1;i>=0;i--){var r=e[i];if(t(r))return r}},$.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},$.almostEquals=function(e,t,n){return Math.abs(e-t)<n},$.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},$.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},$.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},$.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},$.toRadians=function(e){return e*(Math.PI/180)},$.toDegrees=function(e){return e*(180/Math.PI)},$._decimalPlaces=function(e){if($.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},$.getAngleFromPoint=function(e,t){var n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i),s=Math.atan2(i,n);return s<-.5*Math.PI&&(s+=2*Math.PI),{angle:s,distance:r}},$.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},$.aliasPixel=function(e){return e%2==0?0:.5},$._alignPixel=function(e,t,n){var i=e.currentDevicePixelRatio,r=n/2;return Math.round((t-r)*i)/i+r},$.splineCurve=function(e,t,n,i){var r=e.skip?t:e,s=t,o=n.skip?t:n,a=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),c=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),l=a/(a+c),u=c/(a+c),d=i*(l=isNaN(l)?0:l),h=i*(u=isNaN(u)?0:u);return{previous:{x:s.x-d*(o.x-r.x),y:s.y-d*(o.y-r.y)},next:{x:s.x+h*(o.x-r.x),y:s.y+h*(o.y-r.y)}}},$.EPSILON=Number.EPSILON||1e-14,$.splineCurveMonotone=function(e){var t,n,i,r,s,o,a,c,l,u=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),d=u.length;for(t=0;t<d;++t)if(!(i=u[t]).model.skip){if(n=t>0?u[t-1]:null,(r=t<d-1?u[t+1]:null)&&!r.model.skip){var h=r.model.x-i.model.x;i.deltaK=0!==h?(r.model.y-i.model.y)/h:0}i.mK=!n||n.model.skip?i.deltaK:!r||r.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?0:(n.deltaK+i.deltaK)/2}for(t=0;t<d-1;++t)r=u[t+1],(i=u[t]).model.skip||r.model.skip||($.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=r.mK=0:(s=i.mK/i.deltaK,o=r.mK/i.deltaK,(c=Math.pow(s,2)+Math.pow(o,2))<=9||(a=3/Math.sqrt(c),i.mK=s*a*i.deltaK,r.mK=o*a*i.deltaK)));for(t=0;t<d;++t)(i=u[t]).model.skip||(r=t<d-1?u[t+1]:null,(n=t>0?u[t-1]:null)&&!n.model.skip&&(i.model.controlPointPreviousX=i.model.x-(l=(i.model.x-n.model.x)/3),i.model.controlPointPreviousY=i.model.y-l*i.mK),r&&!r.model.skip&&(i.model.controlPointNextX=i.model.x+(l=(r.model.x-i.model.x)/3),i.model.controlPointNextY=i.model.y+l*i.mK))},$.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},$.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},$.niceNum=function(e,t){var n=Math.floor($.log10(e)),i=e/Math.pow(10,n);return(t?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},$.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},$.getRelativePosition=function(e,t){var n,i,r=e.originalEvent||e,s=e.target||e.srcElement,o=s.getBoundingClientRect(),a=r.touches;a&&a.length>0?(n=a[0].clientX,i=a[0].clientY):(n=r.clientX,i=r.clientY);var c=parseFloat($.getStyle(s,"padding-left")),l=parseFloat($.getStyle(s,"padding-top")),u=parseFloat($.getStyle(s,"padding-right")),d=parseFloat($.getStyle(s,"padding-bottom")),h=o.bottom-o.top-l-d;return{x:n=Math.round((n-o.left-c)/(o.right-o.left-c-u)*s.width/t.currentDevicePixelRatio),y:i=Math.round((i-o.top-l)/h*s.height/t.currentDevicePixelRatio)}},$.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},$.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},$._calculatePadding=function(e,t,n){return(t=$.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},$._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},$.getMaximumWidth=function(e){var t=$._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,i=n-$._calculatePadding(t,"padding-left",n)-$._calculatePadding(t,"padding-right",n),r=$.getConstraintWidth(e);return isNaN(r)?i:Math.min(i,r)},$.getMaximumHeight=function(e){var t=$._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,i=n-$._calculatePadding(t,"padding-top",n)-$._calculatePadding(t,"padding-bottom",n),r=$.getConstraintHeight(e);return isNaN(r)?i:Math.min(i,r)},$.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},$.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=e.canvas,r=e.height,s=e.width;i.height=r*n,i.width=s*n,e.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=r+"px",i.style.width=s+"px")}},$.fontString=function(e,t,n){return t+" "+e+"px "+n},$.longestText=function(e,t,n,i){var r=(i=i||{}).data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.font=t;var o,a,c,l,u,d=0,h=n.length;for(o=0;o<h;o++)if(null!=(l=n[o])&&!0!==$.isArray(l))d=$.measureText(e,r,s,d,l);else if($.isArray(l))for(a=0,c=l.length;a<c;a++)null==(u=l[a])||$.isArray(u)||(d=$.measureText(e,r,s,d,u));var f=s.length/2;if(f>n.length){for(o=0;o<f;o++)delete r[s[o]];s.splice(0,f)}return d},$.measureText=function(e,t,n,i,r){var s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i},$.numberOfLabelLines=function(e){var t=1;return $.each(e,(function(e){$.isArray(e)&&e.length>t&&(t=e.length)})),t},$.color=v?function(e){return e instanceof CanvasGradient&&(e=j.global.defaultColor),v(e)}:function(e){return console.error("Color.js not found!"),e},$.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:$.color(e).saturate(.5).darken(.1).rgbString()}}(),$t._adapters=Vt,$t.Animation=q,$t.animationService=J,$t.controllers=Be,$t.DatasetController=ee,$t.defaults=j,$t.Element=U,$t.elements=ge,$t.Interaction=Ze,$t.layouts=ct,$t.platform=wt,$t.plugins=St,$t.Scale=sn,$t.scaleService=Mt,$t.Ticks=Bt,$t.Tooltip=Et,$t.helpers.each(Un,(function(e,t){$t.scaleService.registerScaleType(t,e,e._defaults)})),fi)fi.hasOwnProperty(gi)&&$t.plugins.register(fi[gi]);$t.platform.initialize();var _i=$t;return"undefined"!=typeof window&&(window.Chart=$t),$t.Chart=$t,$t.Legend=fi.legend._element,$t.Title=fi.title._element,$t.pluginService=$t.plugins,$t.PluginBase=$t.Element.extend({}),$t.canvasHelpers=$t.helpers.canvas,$t.layoutService=$t.layouts,$t.LinearScaleBase=ln,$t.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(e){$t[e]=function(t,n){return new $t(t,$t.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}})),_i}(function(){try{return n("wd/R")}catch(e){}}())},MuvH:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("IheW");let s=(()=>{class e{constructor(e){this.http=e}findValue(e,t){if(e.value)return e.value.find(e=>e.section===t)}getValue(e,t){let n=this.findValue(e,t);if(!n){const i=t.indexOf(".");-1!==i&&(n=this.findValue(e,t.substring(0,i)))}return n||(n=this.findValue(e,"global")),n?n.value:e.default}getConfigData(){return this.http.get("api/cluster_conf/")}get(e){return this.http.get("api/cluster_conf/"+e)}filter(e){return this.http.get("api/cluster_conf/filter?names="+e.join(","))}create(e){return this.http.post("api/cluster_conf/",e)}delete(e,t){return this.http.delete(`api/cluster_conf/${e}?section=${t}`)}bulkCreate(e){return this.http.put("api/cluster_conf/",e)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(r.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Mxhz:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("LRne"),r=n("CqXF"),s=n("JIr8"),o=n("8Y7J"),a=n("IheW");let c=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("api/user")}delete(e){return this.http.delete("api/user/"+e)}get(e){return this.http.get("api/user/"+e)}create(e){return this.http.post("api/user",e)}update(e){return this.http.put("api/user/"+e.username,e)}changePassword(e,t,n){return this.http.post(`api/user/${e}/change_password`,{old_password:t,new_password:n})}validateUserName(e){return this.get(e).pipe(Object(r.a)(!0),Object(s.a)(e=>(e.preventDefault(),Object(i.a)(!1))))}validatePassword(e,t=null,n=null){return this.http.post("api/user/validate_password",{password:e,username:t,old_password:n})}}return e.\u0275fac=function(t){return new(t||e)(o.dc(a.b))},e.\u0275prov=o.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"N+g0":function(e,t,n){var i=n("g6v/"),r=n("m/L8"),s=n("glrk"),o=n("33Wh");e.exports=i?Object.defineProperties:function(e,t){s(e);for(var n,i=o(t),a=i.length,c=0;a>c;)r.f(e,n=i[c++],t[n]);return e}},"NC/Y":function(e,t,n){var i=n("0GbY");e.exports=i("navigator","userAgent")||""},NEZu:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e,t,n,i){this.customColors={backgroundColor:void 0,borderColor:void 0},this.checkOffset=!1,this.chartEl=e.nativeElement,this.getStyleLeft=n,this.getStyleTop=i,this.tooltipEl=t.nativeElement}customTooltips(e){if(0===e.opacity)return void(this.tooltipEl.style.opacity=0);if(this.tooltipEl.classList.remove("above","below","no-transform"),this.tooltipEl.classList.add(e.yAlign?e.yAlign:"no-transform"),e.body){const t=e.title||[],n=e.body.map(e=>e.lines);let i="<thead>";t.forEach(e=>{i+="<tr><th>"+this.getTitle(e)+"</th></tr>"}),i+="</thead><tbody>",n.forEach((t,n)=>{const r=e.labelColors[n];let s="background:"+(this.customColors.backgroundColor||r.backgroundColor);s+="; border-color:"+(this.customColors.borderColor||r.borderColor),s+="; border-width: 2px",i+='<tr><td nowrap><span class="chartjs-tooltip-key" style="'+s+'"></span>'+this.getBody(t)+"</td></tr>"}),i+="</tbody>",this.tooltipEl.querySelector("table").innerHTML=i}const t=this.chartEl.offsetTop,n=this.chartEl.offsetLeft;if(this.checkOffset){const t=e.width/2;this.tooltipEl.classList.remove("transform-left"),this.tooltipEl.classList.remove("transform-right"),e.caretX-t<0?this.tooltipEl.classList.add("transform-left"):e.caretX+t>this.chartEl.width&&this.tooltipEl.classList.add("transform-right")}this.tooltipEl.style.left=this.getStyleLeft(e,n),this.tooltipEl.style.top=this.getStyleTop(e,t),this.tooltipEl.style.opacity=1,this.tooltipEl.style.fontFamily=e._fontFamily,this.tooltipEl.style.fontSize=e.fontSize,this.tooltipEl.style.fontStyle=e._fontStyle,this.tooltipEl.style.padding=e.yPadding+"px "+e.xPadding+"px"}getBody(e){return e}getTitle(e){return e}}},NJ4a:function(e,t,n){"use strict";function i(e){setTimeout(()=>{throw e},0)}n.d(t,"a",(function(){return i}))},NJ9Y:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("sVev"),r=n("pLZG"),s=n("BFxc"),o=n("XDbj"),a=n("xbPD"),c=n("SpAZ");function l(e,t){const n=arguments.length>=2;return l=>l.pipe(e?Object(r.a)((t,n)=>e(t,n,l)):c.a,Object(s.a)(1),n?Object(a.a)(t):Object(o.a)(()=>new i.a))}},NaFW:function(e,t,n){var i=n("9d/t"),r=n("P4y1"),s=n("tiKp")("iterator");e.exports=function(e){if(null!=e)return e[s]||e["@@iterator"]||r[i(e)]}},NwgZ:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("s7LF");let s=(()=>{class e{constructor(){this.validSubmit=new i.o}onSubmit(){this.markAsTouchedAndDirty(this.formGroup),this.formGroup.valid&&this.validSubmit.emit(this.formGroup.value)}markAsTouchedAndDirty(e){e instanceof r.j?Object.keys(e.controls).forEach(t=>this.markAsTouchedAndDirty(e.controls[t])):e instanceof r.e?e.controls.forEach(e=>this.markAsTouchedAndDirty(e)):e instanceof r.h&&e.enabled&&(e.markAsDirty(),e.markAsTouched(),e.updateValueAndValidity())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&i.gc("submit",(function(){return t.onSubmit()}))},inputs:{formGroup:"formGroup"},outputs:{validSubmit:"validSubmit"}}),e})()},O741:function(e,t,n){var i=n("hh1v");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},OIYi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},OLbh:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("s7LF"),r=n("8Y7J"),s=n("G0yt"),o=n("ajRT"),a=n("SVse"),c=n("NwgZ"),l=n("6+kj");function u(e,t){1&e&&(r.Sb(0,"span",11),r.Nb(1,"i",12),r.Rb())}function d(e,t){1&e&&r.Ob(0)}function h(e,t){if(1&e&&(r.Sb(0,"p"),r.Oc(1),r.Rb()),2&e){const e=r.ic();r.yb(1),r.Qc(" ",e.description," ")}}let f=(()=>{class e{constructor(e){this.activeModal=e,this.warning=!1,this.showSubmit=!0,this.boundCancel=this.cancel.bind(this),this.canceled=!1,this.confirmationForm=new i.j({})}ngOnInit(){if(this.bodyContext=this.bodyContext||{},this.bodyContext.$implicit=this.bodyData,!this.onSubmit)throw new Error("No submit action defined");if(!this.buttonText)throw new Error("No action name defined");if(!this.titleText)throw new Error("No title defined");if(!this.bodyTpl&&!this.description)throw new Error("No description defined")}ngOnDestroy(){this.onCancel&&this.canceled&&this.onCancel()}cancel(){this.canceled=!0,this.activeModal.close()}stopLoadingSpinner(){this.confirmationForm.setErrors({cdSubmitButton:!0})}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(s.a))},e.\u0275cmp=r.Gb({type:e,selectors:[["cd-confirmation-modal"]],decls:12,vars:9,consts:[[3,"hide"],[1,"modal-title"],["class","text-warning",4,"ngIf"],[1,"modal-content"],["name","confirmationForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent","backActionEvent"],[1,"text-warning"],[1,"fa","fa-exclamation-triangle","fa-1x"]],template:function(e,t){1&e&&(r.Sb(0,"cd-modal",0),r.gc("hide",(function(){return t.cancel()})),r.Qb(1,1),r.Mc(2,u,2,0,"span",2),r.Oc(3),r.Pb(),r.Qb(4,3),r.Sb(5,"form",4,5),r.Sb(7,"div",6),r.Mc(8,d,1,0,"ng-container",7),r.Mc(9,h,2,1,"p",8),r.Rb(),r.Sb(10,"div",9),r.Sb(11,"cd-form-button-panel",10),r.gc("submitActionEvent",(function(){return t.onSubmit(t.confirmationForm.value)}))("backActionEvent",(function(){return t.boundCancel()})),r.Rb(),r.Rb(),r.Rb(),r.Pb(),r.Rb()),2&e&&(r.yb(2),r.pc("ngIf",t.warning),r.yb(1),r.Pc(t.titleText),r.yb(2),r.pc("formGroup",t.confirmationForm),r.yb(3),r.pc("ngTemplateOutlet",t.bodyTpl)("ngTemplateOutletContext",t.bodyContext),r.yb(1),r.pc("ngIf",t.description),r.yb(2),r.pc("form",t.confirmationForm)("submitText",t.buttonText)("showSubmit",t.showSubmit))},directives:[o.a,a.r,i.C,i.r,i.k,c.a,a.w,l.a],styles:[""]}),e})()},Oaa7:function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},Ob0Z:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};function i(e,t,n,i){var r="";if(t)switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926";break;case"m":r="\u090f\u0915 \u092e\u093f\u0928\u093f\u091f";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u0947";break;case"h":r="\u090f\u0915 \u0924\u093e\u0938";break;case"hh":r="%d \u0924\u093e\u0938";break;case"d":r="\u090f\u0915 \u0926\u093f\u0935\u0938";break;case"dd":r="%d \u0926\u093f\u0935\u0938";break;case"M":r="\u090f\u0915 \u092e\u0939\u093f\u0928\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u0947";break;case"y":r="\u090f\u0915 \u0935\u0930\u094d\u0937";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u0947"}else switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"m":r="\u090f\u0915\u093e \u092e\u093f\u0928\u093f\u091f\u093e";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u093e\u0902";break;case"h":r="\u090f\u0915\u093e \u0924\u093e\u0938\u093e";break;case"hh":r="%d \u0924\u093e\u0938\u093e\u0902";break;case"d":r="\u090f\u0915\u093e \u0926\u093f\u0935\u0938\u093e";break;case"dd":r="%d \u0926\u093f\u0935\u0938\u093e\u0902";break;case"M":r="\u090f\u0915\u093e \u092e\u0939\u093f\u0928\u094d\u092f\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u094d\u092f\u093e\u0902";break;case"y":r="\u090f\u0915\u093e \u0935\u0930\u094d\u0937\u093e";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u093e\u0902"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u093f\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u0948_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a._\u090f\u092a\u094d\u0930\u093f._\u092e\u0947._\u091c\u0942\u0928._\u091c\u0941\u0932\u0948._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0933\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0933_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u0935\u093e\u091c\u0924\u093e",LTS:"A h:mm:ss \u0935\u093e\u091c\u0924\u093e",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e",LLLL:"dddd, D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0909\u0926\u094d\u092f\u093e] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092e\u093e\u0917\u0940\u0932] dddd, LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u0927\u094d\u092f\u0947",past:"%s\u092a\u0942\u0930\u094d\u0935\u0940",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u092a\u0939\u093e\u091f\u0947|\u0938\u0915\u093e\u0933\u0940|\u0926\u0941\u092a\u093e\u0930\u0940|\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940|\u0930\u093e\u0924\u094d\u0930\u0940/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u092a\u0939\u093e\u091f\u0947"===t||"\u0938\u0915\u093e\u0933\u0940"===t?e:"\u0926\u0941\u092a\u093e\u0930\u0940"===t||"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940"===t||"\u0930\u093e\u0924\u094d\u0930\u0940"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"\u092a\u0939\u093e\u091f\u0947":e<12?"\u0938\u0915\u093e\u0933\u0940":e<17?"\u0926\u0941\u092a\u093e\u0930\u0940":e<20?"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940":"\u0930\u093e\u0924\u094d\u0930\u0940"},week:{dow:0,doy:6}})}(n("wd/R"))},OjkT:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};e.defineLocale("ne",{months:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f\u0932_\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0937\u094d\u091f_\u0938\u0947\u092a\u094d\u091f\u0947\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u092d\u0947\u092e\u094d\u092c\u0930_\u0921\u093f\u0938\u0947\u092e\u094d\u092c\u0930".split("_"),monthsShort:"\u091c\u0928._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f._\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908._\u0905\u0917._\u0938\u0947\u092a\u094d\u091f._\u0905\u0915\u094d\u091f\u094b._\u0928\u094b\u092d\u0947._\u0921\u093f\u0938\u0947.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u0907\u0924\u092c\u093e\u0930_\u0938\u094b\u092e\u092c\u093e\u0930_\u092e\u0919\u094d\u0917\u0932\u092c\u093e\u0930_\u092c\u0941\u0927\u092c\u093e\u0930_\u092c\u093f\u0939\u093f\u092c\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u092c\u093e\u0930_\u0936\u0928\u093f\u092c\u093e\u0930".split("_"),weekdaysShort:"\u0906\u0907\u0924._\u0938\u094b\u092e._\u092e\u0919\u094d\u0917\u0932._\u092c\u0941\u0927._\u092c\u093f\u0939\u093f._\u0936\u0941\u0915\u094d\u0930._\u0936\u0928\u093f.".split("_"),weekdaysMin:"\u0906._\u0938\u094b._\u092e\u0902._\u092c\u0941._\u092c\u093f._\u0936\u0941._\u0936.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A\u0915\u094b h:mm \u092c\u091c\u0947",LTS:"A\u0915\u094b h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0930\u093e\u0924\u093f|\u092c\u093f\u0939\u093e\u0928|\u0926\u093f\u0909\u0901\u0938\u094b|\u0938\u093e\u0901\u091d/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u093f"===t?e<4?e:e+12:"\u092c\u093f\u0939\u093e\u0928"===t?e:"\u0926\u093f\u0909\u0901\u0938\u094b"===t?e>=10?e:e+12:"\u0938\u093e\u0901\u091d"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"\u0930\u093e\u0924\u093f":e<12?"\u092c\u093f\u0939\u093e\u0928":e<16?"\u0926\u093f\u0909\u0901\u0938\u094b":e<20?"\u0938\u093e\u0901\u091d":"\u0930\u093e\u0924\u093f"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u092d\u094b\u0932\u093f] LT",nextWeek:"[\u0906\u0909\u0901\u0926\u094b] dddd[,] LT",lastDay:"[\u0939\u093f\u091c\u094b] LT",lastWeek:"[\u0917\u090f\u0915\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u093e",past:"%s \u0905\u0917\u093e\u0921\u093f",s:"\u0915\u0947\u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0947\u0923\u094d\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u0947\u091f",mm:"%d \u092e\u093f\u0928\u0947\u091f",h:"\u090f\u0915 \u0918\u0923\u094d\u091f\u093e",hh:"%d \u0918\u0923\u094d\u091f\u093e",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u093f\u0928\u093e",MM:"%d \u092e\u0939\u093f\u0928\u093e",y:"\u090f\u0915 \u092c\u0930\u094d\u0937",yy:"%d \u092c\u0930\u094d\u0937"},week:{dow:0,doy:6}})}(n("wd/R"))},OmwH:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"D/M/YYYY",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},Oxv6:function(e,t,n){!function(e){"use strict";var t={0:"-\u0443\u043c",1:"-\u0443\u043c",2:"-\u044e\u043c",3:"-\u044e\u043c",4:"-\u0443\u043c",5:"-\u0443\u043c",6:"-\u0443\u043c",7:"-\u0443\u043c",8:"-\u0443\u043c",9:"-\u0443\u043c",10:"-\u0443\u043c",12:"-\u0443\u043c",13:"-\u0443\u043c",20:"-\u0443\u043c",30:"-\u044e\u043c",40:"-\u0443\u043c",50:"-\u0443\u043c",60:"-\u0443\u043c",70:"-\u0443\u043c",80:"-\u0443\u043c",90:"-\u0443\u043c",100:"-\u0443\u043c"};e.defineLocale("tg",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0430\u043b\u0438_\u043c\u0430\u0440\u0442\u0438_\u0430\u043f\u0440\u0435\u043b\u0438_\u043c\u0430\u0439\u0438_\u0438\u044e\u043d\u0438_\u0438\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442\u0438_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u0438_\u043e\u043a\u0442\u044f\u0431\u0440\u0438_\u043d\u043e\u044f\u0431\u0440\u0438_\u0434\u0435\u043a\u0430\u0431\u0440\u0438".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_")},monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u044f\u043a\u0448\u0430\u043d\u0431\u0435_\u0434\u0443\u0448\u0430\u043d\u0431\u0435_\u0441\u0435\u0448\u0430\u043d\u0431\u0435_\u0447\u043e\u0440\u0448\u0430\u043d\u0431\u0435_\u043f\u0430\u043d\u04b7\u0448\u0430\u043d\u0431\u0435_\u04b7\u0443\u043c\u044a\u0430_\u0448\u0430\u043d\u0431\u0435".split("_"),weekdaysShort:"\u044f\u0448\u0431_\u0434\u0448\u0431_\u0441\u0448\u0431_\u0447\u0448\u0431_\u043f\u0448\u0431_\u04b7\u0443\u043c_\u0448\u043d\u0431".split("_"),weekdaysMin:"\u044f\u0448_\u0434\u0448_\u0441\u0448_\u0447\u0448_\u043f\u0448_\u04b7\u043c_\u0448\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0418\u043c\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextDay:"[\u0424\u0430\u0440\u0434\u043e \u0441\u043e\u0430\u0442\u0438] LT",lastDay:"[\u0414\u0438\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u043e\u044f\u043d\u0434\u0430 \u0441\u043e\u0430\u0442\u0438] LT",lastWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u0433\u0443\u0437\u0430\u0448\u0442\u0430 \u0441\u043e\u0430\u0442\u0438] LT",sameElse:"L"},relativeTime:{future:"\u0431\u0430\u044a\u0434\u0438 %s",past:"%s \u043f\u0435\u0448",s:"\u044f\u043a\u0447\u0430\u043d\u0434 \u0441\u043e\u043d\u0438\u044f",m:"\u044f\u043a \u0434\u0430\u049b\u0438\u049b\u0430",mm:"%d \u0434\u0430\u049b\u0438\u049b\u0430",h:"\u044f\u043a \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u044f\u043a \u0440\u04ef\u0437",dd:"%d \u0440\u04ef\u0437",M:"\u044f\u043a \u043c\u043e\u04b3",MM:"%d \u043c\u043e\u04b3",y:"\u044f\u043a \u0441\u043e\u043b",yy:"%d \u0441\u043e\u043b"},meridiemParse:/\u0448\u0430\u0431|\u0441\u0443\u0431\u04b3|\u0440\u04ef\u0437|\u0431\u0435\u0433\u043e\u04b3/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0448\u0430\u0431"===t?e<4?e:e+12:"\u0441\u0443\u0431\u04b3"===t?e:"\u0440\u04ef\u0437"===t?e>=11?e:e+12:"\u0431\u0435\u0433\u043e\u04b3"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0448\u0430\u0431":e<11?"\u0441\u0443\u0431\u04b3":e<16?"\u0440\u04ef\u0437":e<19?"\u0431\u0435\u0433\u043e\u04b3":"\u0448\u0430\u0431"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0443\u043c|\u044e\u043c)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},P4y1:function(e,t){e.exports={}},P8lu:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var i=n("mrSG"),r=n("IheW"),s=n("LvDl"),o=n.n(s),a=n("cp0P"),c=n("LRne"),l=n("5+tZ"),u=n("CqXF"),d=n("JIr8"),h=n("9xzX"),f=n("xTzq"),p=n("8Y7J");let m=(()=>{let e=class{constructor(e,t){this.http=e,this.rgwDaemonService=t,this.url="api/rgw/user"}list(){return this.enumerate().pipe(Object(l.a)(e=>e.length>0?Object(a.a)(e.map(e=>this.get(e))):Object(c.a)([])))}enumerate(){return this.rgwDaemonService.request(e=>this.http.get(this.url,{params:e}))}enumerateEmail(){return this.rgwDaemonService.request(e=>this.http.get(this.url+"/get_emails",{params:e}))}get(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}`,{params:t}))}getQuota(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}/quota`,{params:t}))}create(e){return this.rgwDaemonService.request(t=>(o.a.keys(e).forEach(n=>{t=t.append(n,e[n])}),this.http.post(this.url,null,{params:t})))}update(e,t){return this.rgwDaemonService.request(n=>(o.a.keys(t).forEach(e=>{n=n.append(e,t[e])}),this.http.put(`${this.url}/${e}`,null,{params:n})))}updateQuota(e,t){return this.rgwDaemonService.request(n=>(o.a.keys(t).forEach(e=>{n=n.append(e,t[e])}),this.http.put(`${this.url}/${e}/quota`,null,{params:n})))}delete(e){return this.rgwDaemonService.request(t=>this.http.delete(`${this.url}/${e}`,{params:t}))}createSubuser(e,t){return this.rgwDaemonService.request(n=>(o.a.keys(t).forEach(e=>{n=n.append(e,t[e])}),this.http.post(`${this.url}/${e}/subuser`,null,{params:n})))}deleteSubuser(e,t){return this.rgwDaemonService.request(n=>this.http.delete(`${this.url}/${e}/subuser/${t}`,{params:n}))}addCapability(e,t,n){return this.rgwDaemonService.request(i=>(i=(i=i.append("type",t)).append("perm",n),this.http.post(`${this.url}/${e}/capability`,null,{params:i})))}deleteCapability(e,t,n){return this.rgwDaemonService.request(i=>(i=(i=i.append("type",t)).append("perm",n),this.http.delete(`${this.url}/${e}/capability`,{params:i})))}addS3Key(e,t){return this.rgwDaemonService.request(n=>(n=n.append("key_type","s3"),o.a.keys(t).forEach(e=>{n=n.append(e,t[e])}),this.http.post(`${this.url}/${e}/key`,null,{params:n})))}deleteS3Key(e,t){return this.rgwDaemonService.request(n=>(n=(n=n.append("key_type","s3")).append("access_key",t),this.http.delete(`${this.url}/${e}/key`,{params:n})))}exists(e){return this.get(e).pipe(Object(u.a)(!0),Object(d.a)(e=>(o.a.isFunction(e.preventDefault)&&e.preventDefault(),Object(c.a)(!1))))}emailExists(e){return e=decodeURIComponent(e),this.enumerateEmail().pipe(Object(l.a)(t=>{const n=o.a.indexOf(t,e);return Object(c.a)(-1!==n)}))}};return e.\u0275fac=function(t){return new(t||e)(p.dc(r.b),p.dc(h.a))},e.\u0275prov=p.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([f.a,Object(i.d)("design:paramtypes",[r.b,h.a])],e),e})()},PA2r:function(e,t,n){!function(e){"use strict";var t="leden_\xfanor_b\u0159ezen_duben_kv\u011bten_\u010derven_\u010dervenec_srpen_z\xe1\u0159\xed_\u0159\xedjen_listopad_prosinec".split("_"),n="led_\xfano_b\u0159e_dub_kv\u011b_\u010dvn_\u010dvc_srp_z\xe1\u0159_\u0159\xedj_lis_pro".split("_"),i=[/^led/i,/^\xfano/i,/^b\u0159e/i,/^dub/i,/^kv\u011b/i,/^(\u010dvn|\u010derven$|\u010dervna)/i,/^(\u010dvc|\u010dervenec|\u010dervence)/i,/^srp/i,/^z\xe1\u0159/i,/^\u0159\xedj/i,/^lis/i,/^pro/i],r=/^(leden|\xfanor|b\u0159ezen|duben|kv\u011bten|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|z\xe1\u0159\xed|\u0159\xedjen|listopad|prosinec|led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,i){var r=e+" ";switch(n){case"s":return t||i?"p\xe1r sekund":"p\xe1r sekundami";case"ss":return t||i?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":i?"minutu":"minutou";case"mm":return t||i?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":return t||i?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||i?"den":"dnem";case"dd":return t||i?r+(s(e)?"dny":"dn\xed"):r+"dny";case"M":return t||i?"m\u011bs\xedc":"m\u011bs\xedcem";case"MM":return t||i?r+(s(e)?"m\u011bs\xedce":"m\u011bs\xedc\u016f"):r+"m\u011bs\xedci";case"y":return t||i?"rok":"rokem";case"yy":return t||i?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|\xfanora|\xfanor|b\u0159ezen|b\u0159ezna|duben|dubna|kv\u011bten|kv\u011btna|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|srpna|z\xe1\u0159\xed|\u0159\xedjen|\u0159\xedjna|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"ned\u011ble_pond\u011bl\xed_\xfater\xfd_st\u0159eda_\u010dtvrtek_p\xe1tek_sobota".split("_"),weekdaysShort:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),weekdaysMin:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[z\xedtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v ned\u011bli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve st\u0159edu v] LT";case 4:return"[ve \u010dtvrtek v] LT";case 5:return"[v p\xe1tek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[v\u010dera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou ned\u011bli v] LT";case 1:case 2:return"[minul\xe9] dddd [v] LT";case 3:return"[minulou st\u0159edu v] LT";case 4:case 5:return"[minul\xfd] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"p\u0159ed %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},PCNd:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("SVse"),r=n("TKcr"),s=n("V/fk"),o=n("ChqD"),a=n("yGOH"),c=n("9Xeq"),l=n("Avrn"),u=n("aexS"),d=n("aXbf"),h=n("8Y7J");let f=(()=>{class e{}return e.\u0275mod=h.Kb({type:e}),e.\u0275inj=h.Jb({factory:function(t){return new(t||e)},providers:[u.a,l.a,d.a,r.a],imports:[[i.c,c.a,s.a,o.a,a.a],s.a,c.a,o.a,a.a]}),e})()},PKPk:function(e,t,n){"use strict";var i=n("ZUd8").charAt,r=n("afO8"),s=n("fdAy"),o="String Iterator",a=r.set,c=r.getterFor(o);s(String,"String",(function(e){a(this,{type:o,string:String(e),index:0})}),(function(){var e,t=c(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})}))},PeUW:function(e,t,n){!function(e){"use strict";var t={1:"\u0be7",2:"\u0be8",3:"\u0be9",4:"\u0bea",5:"\u0beb",6:"\u0bec",7:"\u0bed",8:"\u0bee",9:"\u0bef",0:"\u0be6"},n={"\u0be7":"1","\u0be8":"2","\u0be9":"3","\u0bea":"4","\u0beb":"5","\u0bec":"6","\u0bed":"7","\u0bee":"8","\u0bef":"9","\u0be6":"0"};e.defineLocale("ta",{months:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),monthsShort:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),weekdays:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bcd\u0bb1\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0b9f\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0ba9\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8".split("_"),weekdaysShort:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf_\u0b9a\u0ba9\u0bbf".split("_"),weekdaysMin:"\u0b9e\u0bbe_\u0ba4\u0bbf_\u0b9a\u0bc6_\u0baa\u0bc1_\u0bb5\u0bbf_\u0bb5\u0bc6_\u0b9a".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[\u0b87\u0ba9\u0bcd\u0bb1\u0bc1] LT",nextDay:"[\u0ba8\u0bbe\u0bb3\u0bc8] LT",nextWeek:"dddd, LT",lastDay:"[\u0ba8\u0bc7\u0bb1\u0bcd\u0bb1\u0bc1] LT",lastWeek:"[\u0b95\u0b9f\u0ba8\u0bcd\u0ba4 \u0bb5\u0bbe\u0bb0\u0bae\u0bcd] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0b87\u0bb2\u0bcd",past:"%s \u0bae\u0bc1\u0ba9\u0bcd",s:"\u0b92\u0bb0\u0bc1 \u0b9a\u0bbf\u0bb2 \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",ss:"%d \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",m:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0bae\u0bcd",mm:"%d \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0b99\u0bcd\u0b95\u0bb3\u0bcd",h:"\u0b92\u0bb0\u0bc1 \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",hh:"%d \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",d:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbe\u0bb3\u0bcd",dd:"%d \u0ba8\u0bbe\u0b9f\u0bcd\u0b95\u0bb3\u0bcd",M:"\u0b92\u0bb0\u0bc1 \u0bae\u0bbe\u0ba4\u0bae\u0bcd",MM:"%d \u0bae\u0bbe\u0ba4\u0b99\u0bcd\u0b95\u0bb3\u0bcd",y:"\u0b92\u0bb0\u0bc1 \u0bb5\u0bb0\u0bc1\u0b9f\u0bae\u0bcd",yy:"%d \u0b86\u0ba3\u0bcd\u0b9f\u0bc1\u0b95\u0bb3\u0bcd"},dayOfMonthOrdinalParse:/\d{1,2}\u0bb5\u0ba4\u0bc1/,ordinal:function(e){return e+"\u0bb5\u0ba4\u0bc1"},preparse:function(e){return e.replace(/[\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef\u0be6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0baf\u0bbe\u0bae\u0bae\u0bcd|\u0bb5\u0bc8\u0b95\u0bb1\u0bc8|\u0b95\u0bbe\u0bb2\u0bc8|\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd|\u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1|\u0bae\u0bbe\u0bb2\u0bc8/,meridiem:function(e,t,n){return e<2?" \u0baf\u0bbe\u0bae\u0bae\u0bcd":e<6?" \u0bb5\u0bc8\u0b95\u0bb1\u0bc8":e<10?" \u0b95\u0bbe\u0bb2\u0bc8":e<14?" \u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd":e<18?" \u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1":e<22?" \u0bae\u0bbe\u0bb2\u0bc8":" \u0baf\u0bbe\u0bae\u0bae\u0bcd"},meridiemHour:function(e,t){return 12===e&&(e=0),"\u0baf\u0bbe\u0bae\u0bae\u0bcd"===t?e<2?e:e+12:"\u0bb5\u0bc8\u0b95\u0bb1\u0bc8"===t||"\u0b95\u0bbe\u0bb2\u0bc8"===t||"\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("wd/R"))},PhyI:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var i=function(e){return e[e.global=0]="global",e[e.pool=1]="pool",e[e.image=2]="image",e}({}),r=function(e){return e[e.bps=0]="bps",e[e.iops=1]="iops",e[e.milliseconds=2]="milliseconds",e}({})},PpIw:function(e,t,n){!function(e){"use strict";var t={1:"\u0ce7",2:"\u0ce8",3:"\u0ce9",4:"\u0cea",5:"\u0ceb",6:"\u0cec",7:"\u0ced",8:"\u0cee",9:"\u0cef",0:"\u0ce6"},n={"\u0ce7":"1","\u0ce8":"2","\u0ce9":"3","\u0cea":"4","\u0ceb":"5","\u0cec":"6","\u0ced":"7","\u0cee":"8","\u0cef":"9","\u0ce6":"0"};e.defineLocale("kn",{months:"\u0c9c\u0ca8\u0cb5\u0cb0\u0cbf_\u0cab\u0cc6\u0cac\u0ccd\u0cb0\u0cb5\u0cb0\u0cbf_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5\u0cac\u0cb0\u0ccd_\u0ca8\u0cb5\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82\u0cac\u0cb0\u0ccd".split("_"),monthsShort:"\u0c9c\u0ca8_\u0cab\u0cc6\u0cac\u0ccd\u0cb0_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5_\u0ca8\u0cb5\u0cc6\u0c82_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82".split("_"),monthsParseExact:!0,weekdays:"\u0cad\u0cbe\u0ca8\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae\u0cb5\u0cbe\u0cb0_\u0cae\u0c82\u0c97\u0cb3\u0cb5\u0cbe\u0cb0_\u0cac\u0cc1\u0ca7\u0cb5\u0cbe\u0cb0_\u0c97\u0cc1\u0cb0\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0\u0cb5\u0cbe\u0cb0_\u0cb6\u0ca8\u0cbf\u0cb5\u0cbe\u0cb0".split("_"),weekdaysShort:"\u0cad\u0cbe\u0ca8\u0cc1_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae_\u0cae\u0c82\u0c97\u0cb3_\u0cac\u0cc1\u0ca7_\u0c97\u0cc1\u0cb0\u0cc1_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0_\u0cb6\u0ca8\u0cbf".split("_"),weekdaysMin:"\u0cad\u0cbe_\u0cb8\u0cc6\u0cc2\u0cd5_\u0cae\u0c82_\u0cac\u0cc1_\u0c97\u0cc1_\u0cb6\u0cc1_\u0cb6".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c87\u0c82\u0ca6\u0cc1] LT",nextDay:"[\u0ca8\u0cbe\u0cb3\u0cc6] LT",nextWeek:"dddd, LT",lastDay:"[\u0ca8\u0cbf\u0ca8\u0ccd\u0ca8\u0cc6] LT",lastWeek:"[\u0c95\u0cc6\u0cc2\u0ca8\u0cc6\u0caf] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0ca8\u0c82\u0ca4\u0cb0",past:"%s \u0cb9\u0cbf\u0c82\u0ca6\u0cc6",s:"\u0c95\u0cc6\u0cb2\u0cb5\u0cc1 \u0c95\u0ccd\u0cb7\u0ca3\u0c97\u0cb3\u0cc1",ss:"%d \u0cb8\u0cc6\u0c95\u0cc6\u0c82\u0ca1\u0cc1\u0c97\u0cb3\u0cc1",m:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",mm:"%d \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",h:"\u0c92\u0c82\u0ca6\u0cc1 \u0c97\u0c82\u0c9f\u0cc6",hh:"%d \u0c97\u0c82\u0c9f\u0cc6",d:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca6\u0cbf\u0ca8",dd:"%d \u0ca6\u0cbf\u0ca8",M:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",MM:"%d \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",y:"\u0c92\u0c82\u0ca6\u0cc1 \u0cb5\u0cb0\u0ccd\u0cb7",yy:"%d \u0cb5\u0cb0\u0ccd\u0cb7"},preparse:function(e){return e.replace(/[\u0ce7\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef\u0ce6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf|\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6|\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8|\u0cb8\u0c82\u0c9c\u0cc6/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"===t?e<4?e:e+12:"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6"===t?e:"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8"===t?e>=10?e:e+12:"\u0cb8\u0c82\u0c9c\u0cc6"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf":e<10?"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6":e<17?"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8":e<20?"\u0cb8\u0c82\u0c9c\u0cc6":"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"},dayOfMonthOrdinalParse:/\d{1,2}(\u0ca8\u0cc6\u0cd5)/,ordinal:function(e){return e+"\u0ca8\u0cc6\u0cd5"},week:{dow:0,doy:6}})}(n("wd/R"))},PqYM:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("HDdC"),r=n("D0XW"),s=n("Y7HM"),o=n("z+Ro");function a(e=0,t,n){let a=-1;return Object(s.a)(t)?a=Number(t)<1?1:Number(t):Object(o.a)(t)&&(n=t),Object(o.a)(n)||(n=r.a),new i.a(t=>{const i=Object(s.a)(e)?e:+e-n.now();return n.schedule(c,i,{index:0,period:a,subscriber:t})})}function c(e){const{index:t,period:n,subscriber:i}=e;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}}},QFaf:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("s7LF");class r extends i.j{constructor(e,t,n){super(e,t,n),this.controls=e}get(e){const t=this._get(e);if(!t)throw new Error(`Control '${e}' could not be found!`);return t}_get(e){return super.get(e)||Object.values(this.controls).filter(e=>e.get).map(t=>t instanceof r?t._get(e):t.get(e)).find(e=>Boolean(e))}getValue(e){return this.get(e).value}silentSet(e,t){this.get(e).setValue(t,{emitEvent:!1})}showError(e,t,n){const i=this.get(e);return(t.submitted||i.dirty)&&(n?i.hasError(n):i.invalid)}}},QTAa:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("t/zF");class r extends i.a{}},QWBl:function(e,t,n){"use strict";var i=n("I+eb"),r=n("F8JR");i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},Qj4J:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062a\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062a\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:0,doy:12}})}(n("wd/R"))},Qo9l:function(e,t,n){var i=n("2oRo");e.exports=i},RAwQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_M\xe4erz_Abr\xebll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_M\xe9indeg_D\xebnschdeg_M\xebttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._M\xe9._D\xeb._M\xeb._Do._Fr._Sa.".split("_"),weekdaysMin:"So_M\xe9_D\xeb_M\xeb_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[G\xebschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d M\xe9int",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},RK3t:function(e,t,n){var i=n("0Dky"),r=n("xrYK"),s="".split;e.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==r(e)?s.call(e,""):Object(e)}:Object},RNIs:function(e,t,n){var i=n("tiKp"),r=n("fHMY"),s=n("m/L8"),o=i("unscopables"),a=Array.prototype;null==a[o]&&s.f(a,o,{configurable:!0,value:r(null)}),e.exports=function(e){a[o][e]=!0}},Rf2I:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var i=n("s7LF"),r=n("LvDl"),s=n.n(r),o=n("2EZI"),a=n("Fgil"),c=n("aXbf"),l=n("8Y7J"),u=n("G0yt"),d=n("ajRT"),h=n("SVse"),f=n("NwgZ"),p=n("6+kj"),m=n("ANnk"),b=n("f69J"),g=n("EmSq"),_=n("ppaS");function y(e,t){if(1&e&&(l.Qb(0,10),l.Oc(1),l.Pb()),2&e){const e=l.ic();l.yb(1),l.Qc(" ",e.titleText," ")}}function v(e,t){if(1&e&&(l.Sb(0,"p"),l.Oc(1),l.Rb()),2&e){const e=l.ic();l.yb(1),l.Pc(e.message)}}const w=function(e){return{required:e}};function S(e,t){if(1&e&&(l.Sb(0,"label",18),l.Oc(1),l.Rb()),2&e){const e=l.ic().$implicit;l.pc("ngClass",l.uc(3,w,!0===(null==e?null:e.required)))("for",e.name),l.yb(1),l.Qc(" ",e.label," ")}}function M(e,t){if(1&e&&l.Nb(0,"input",19),2&e){const e=l.ic().$implicit;l.pc("type",e.type)("id",e.name)("name",e.name)("formControlName",e.name)}}function x(e,t){if(1&e&&l.Nb(0,"input",20),2&e){const e=l.ic().$implicit;l.pc("id",e.name)("name",e.name)("formControlName",e.name)}}function k(e,t){if(1&e&&(l.Sb(0,"option",24),l.Oc(1),l.Rb()),2&e){const e=l.ic(2).$implicit;l.pc("ngValue",null),l.yb(1),l.Qc(" ",null==e||null==e.typeConfig?null:e.typeConfig.placeholder," ")}}function D(e,t){if(1&e&&(l.Sb(0,"option",25),l.Oc(1),l.Rb()),2&e){const e=t.$implicit;l.pc("value",e.value),l.yb(1),l.Qc(" ",e.text," ")}}function T(e,t){if(1&e&&(l.Sb(0,"select",21),l.Mc(1,k,2,2,"option",22),l.Mc(2,D,2,2,"option",23),l.Rb()),2&e){const e=l.ic().$implicit;l.pc("id",e.name)("formControlName",e.name),l.yb(1),l.pc("ngIf",null==e||null==e.typeConfig?null:e.typeConfig.placeholder),l.yb(1),l.pc("ngForOf",null==e||null==e.typeConfig?null:e.typeConfig.options)}}function C(e,t){if(1&e&&l.Nb(0,"cd-select-badges",26),2&e){const e=l.ic().$implicit;l.pc("id",e.name)("data",e.value)("customBadges",null==e||null==e.typeConfig?null:e.typeConfig.customBadges)("options",null==e||null==e.typeConfig?null:e.typeConfig.options)("messages",null==e||null==e.typeConfig?null:e.typeConfig.messages)}}function O(e,t){if(1&e&&(l.Sb(0,"span",27),l.Oc(1),l.Rb()),2&e){const e=l.ic().$implicit,t=l.ic();l.yb(1),l.Qc(" ",t.getError(e)," ")}}const R=function(e,t){return{"cd-col-form-input":e,"col-sm-12":t}},L=function(){return["text","number"]};function E(e,t){if(1&e&&(l.Qb(0),l.Sb(1,"div"),l.Mc(2,S,2,5,"label",11),l.Sb(3,"div",12),l.Mc(4,M,1,4,"input",13),l.Mc(5,x,1,3,"input",14),l.Mc(6,T,3,4,"select",15),l.Mc(7,C,1,5,"cd-select-badges",16),l.Mc(8,O,2,1,"span",17),l.Rb(),l.Rb(),l.Pb()),2&e){const e=t.$implicit,n=l.ic(),i=l.Ac(4);l.yb(1),l.Bb("form-group row cd-",e.name,"-form-group"),l.yb(1),l.pc("ngIf",e.label),l.yb(1),l.pc("ngClass",l.vc(10,R,e.label,!e.label)),l.yb(1),l.pc("ngIf",l.tc(13,L).includes(e.type)),l.yb(1),l.pc("ngIf","binary"===e.type),l.yb(1),l.pc("ngIf","select"===e.type),l.yb(1),l.pc("ngIf","select-badges"===e.type),l.yb(1),l.pc("ngIf",n.formGroup.showError(e.name,i))}}let A=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.formBuilder=t,this.formatter=n,this.dimlessBinaryPipe=i}ngOnInit(){this.createForm()}createForm(){const e={};this.fields.forEach(t=>{e[t.name]=this.createFormControl(t)}),this.formGroup=this.formBuilder.group(e)}createFormControl(e){let t=[];return s.a.isBoolean(e.required)&&e.required&&t.push(i.A.required),e.validators&&(t=t.concat(e.validators)),new i.h(s.a.defaultTo("binary"===e.type?this.dimlessBinaryPipe.transform(e.value):e.value,null),{validators:t})}getError(e){const t=this.formGroup.get(e.name).errors;return Object.keys(t).map(n=>this.getErrorMessage(n,t[n],e.errors)).join("<br>")}getErrorMessage(e,t,n){if(n){const t=n[e];if(t)return t}return["binaryMin","binaryMax"].includes(e)?t():"required"===e?"This field is required.":"An error occurred."}onSubmitForm(e){this.fields.filter(e=>"binary"===e.type).map(e=>e.name).forEach(t=>{const n=e[t];n&&(e[t]=this.formatter.toBytes(n))}),this.activeModal.close(),s.a.isFunction(this.onSubmit)&&this.onSubmit(e)}}return e.\u0275fac=function(t){return new(t||e)(l.Mb(u.a),l.Mb(o.a),l.Mb(c.a),l.Mb(a.a))},e.\u0275cmp=l.Gb({type:e,selectors:[["cd-form-modal"]],decls:10,vars:7,consts:[[3,"modalRef"],["class","modal-title",4,"ngIf"],[1,"modal-content"],["novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"modal-title"],["class","cd-col-form-label",3,"ngClass","for",4,"ngIf"],[3,"ngClass"],["class","form-control",3,"type","id","name","formControlName",4,"ngIf"],["type","text","class","form-control","cdDimlessBinary","",3,"id","name","formControlName",4,"ngIf"],["class","form-control custom-select",3,"id","formControlName",4,"ngIf"],[3,"id","data","customBadges","options","messages",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-label",3,"ngClass","for"],[1,"form-control",3,"type","id","name","formControlName"],["type","text","cdDimlessBinary","",1,"form-control",3,"id","name","formControlName"],[1,"form-control","custom-select",3,"id","formControlName"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],[3,"value"],[3,"id","data","customBadges","options","messages"],[1,"invalid-feedback"]],template:function(e,t){1&e&&(l.Sb(0,"cd-modal",0),l.Mc(1,y,2,1,"ng-container",1),l.Qb(2,2),l.Sb(3,"form",3,4),l.Sb(5,"div",5),l.Mc(6,v,2,1,"p",6),l.Mc(7,E,9,14,"ng-container",7),l.Rb(),l.Sb(8,"div",8),l.Sb(9,"cd-form-button-panel",9),l.gc("submitActionEvent",(function(){return t.onSubmitForm(t.formGroup.value)})),l.Rb(),l.Rb(),l.Rb(),l.Pb(),l.Rb()),2&e&&(l.pc("modalRef",t.activeModal),l.yb(1),l.pc("ngIf",t.titleText),l.yb(2),l.pc("formGroup",t.formGroup),l.yb(3),l.pc("ngIf",t.message),l.yb(1),l.pc("ngForOf",t.fields),l.yb(2),l.pc("form",t.formGroup)("submitText",t.submitButtonText))},directives:[d.a,h.r,i.C,i.r,i.k,f.a,h.q,p.a,h.p,m.a,i.d,b.a,i.q,i.i,g.a,i.z,i.u,i.B,_.a],styles:[""]}),e})()},Rm1S:function(e,t,n){"use strict";var i=n("14Sl"),r=n("glrk"),s=n("UMSQ"),o=n("HYAF"),a=n("iqWW"),c=n("FMNM");i("match",1,(function(e,t,n){return[function(t){var n=o(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var o=r(e),l=String(this);if(!o.global)return c(o,l);var u=o.unicode;o.lastIndex=0;for(var d,h=[],f=0;null!==(d=c(o,l));){var p=String(d[0]);h[f]=p,""===p&&(o.lastIndex=a(l,s(o.lastIndex),u)),f++}return 0===f?null:h}]}))},RnhZ:function(e,t,n){var i={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn-bd":"loYQ","./bn-bd.js":"loYQ","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-in":"7C5Q","./en-in.js":"7C5Q","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./en-sg":"t+mt","./en-sg.js":"t+mt","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-mx":"tbfe","./es-mx.js":"tbfe","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fil":"1ppg","./fil.js":"1ppg","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-deva":"qvJo","./gom-deva.js":"qvJo","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./oc-lnc":"Fnuy","./oc-lnc.js":"Fnuy","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tk":"Wv91","./tk.js":"Wv91","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-mo":"OmwH","./zh-mo.js":"OmwH","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id="RnhZ"},S6ln:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=e+" ";switch(n){case"ss":return i+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return i+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return i+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return i+(1===e?"dan":"dana");case"MM":return i+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return i+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"sije\u010dnja_velja\u010de_o\u017eujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"sije\u010danj_velja\u010da_o\u017eujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._o\u017eu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:return"[pro\u0161lu] [nedjelju] [u] LT";case 3:return"[pro\u0161lu] [srijedu] [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},S7zO:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n("LvDl"),r=n.n(i),s=n("oxzT"),o=(n("vCyI"),n("jKX/"),n("8Y7J")),a=n("SVse"),c=n("iInd"),l=n("G0yt");const u=function(e){return{disabled:e}},d=function(e){return[e]};function h(e,t){if(1&e){const e=o.Tb();o.Qb(0),o.Sb(1,"button",3),o.gc("click",(function(){o.Dc(e);const t=o.ic();return t.useClickAction(t.currentAction)})),o.Nb(2,"i",4),o.Sb(3,"span"),o.Oc(4),o.Rb(),o.Rb(),o.Pb()}if(2&e){const e=o.ic();o.yb(1),o.Bb("btn btn-",e.btnColor,""),o.qc("title",e.useDisableDesc(e.currentAction)),o.pc("ngClass",o.uc(9,u,e.disableSelectionAction(e.currentAction)))("routerLink",e.useRouterLink(e.currentAction))("preserveFragment",e.currentAction.preserveFragment?"":null),o.yb(1),o.pc("ngClass",o.uc(11,d,e.currentAction.icon)),o.yb(2),o.Pc(e.currentAction.name)}}function f(e,t){if(1&e&&(o.Qb(0),o.Oc(1),o.Pb()),2&e){const e=o.ic(2);o.yb(1),o.Qc("",e.dropDownOnly," ")}}function p(e,t){1&e&&o.Nb(0,"span",10)}function m(e,t){if(1&e){const e=o.Tb();o.Qb(0),o.Sb(1,"button",11),o.gc("click",(function(){o.Dc(e);const n=t.$implicit;return o.ic(2).useClickAction(n)})),o.Nb(2,"i",4),o.Sb(3,"span"),o.Oc(4),o.Rb(),o.Rb(),o.Pb()}if(2&e){const e=t.$implicit,n=o.ic(2);o.yb(1),o.Ab(n.toClassName(e)),o.qc("title",n.useDisableDesc(e)),o.pc("routerLink",n.useRouterLink(e))("preserveFragment",e.preserveFragment?"":null)("disabled",n.disableSelectionAction(e)),o.yb(1),o.pc("ngClass",o.uc(9,d,e.icon)),o.yb(2),o.Pc(e.name)}}function b(e,t){if(1&e&&(o.Sb(0,"div",5),o.Sb(1,"button",6),o.Mc(2,f,2,1,"ng-container",1),o.Mc(3,p,1,0,"span",7),o.Rb(),o.Sb(4,"div",8),o.Mc(5,m,5,11,"ng-container",9),o.Rb(),o.Rb()),2&e){const e=o.ic();o.yb(1),o.Bb("btn btn-",e.btnColor," dropdown-toggle-split"),o.yb(1),o.pc("ngIf",e.dropDownOnly),o.yb(1),o.pc("ngIf",!e.dropDownOnly),o.yb(2),o.pc("ngForOf",e.dropDownActions)}}let g=(()=>{class e{constructor(){this.btnColor="accent",this.dropDownActions=[],this.icons=s.a}ngOnInit(){this.removeActionsWithNoPermissions(),this.onSelectionChange()}ngOnChanges(e){e.selection&&this.onSelectionChange()}onSelectionChange(){this.updateDropDownActions(),this.updateCurrentAction()}toClassName(e){return e.name.replace(/ /g,"-").replace(/[^a-z-]/gi,"").toLowerCase()}removeActionsWithNoPermissions(){if(!this.permission)return void(this.tableActions=[]);const e=Object.keys(this.permission).filter(e=>this.permission[e]);this.tableActions=this.tableActions.filter(t=>e.includes(t.permission))}updateDropDownActions(){this.dropDownActions=this.tableActions.filter(e=>e.visible?e.visible(this.selection):e)}updateCurrentAction(){if(this.dropDownOnly)return void(this.currentAction=void 0);let e=this.dropDownActions.find(e=>this.showableAction(e));!e&&this.dropDownActions.length>0&&(e=this.dropDownActions[0]),this.currentAction=e}showableAction(e){const t=e.canBePrimary,n=this.selection.hasSingleSelection,i="create"===e.permission?!n:n;return t&&t(this.selection)||!t&&i}useRouterLink(e){if(e.routerLink&&!this.disableSelectionAction(e))return r.a.isString(e.routerLink)?e.routerLink:e.routerLink()}disableSelectionAction(e){const t=e.disable;if(t)return Boolean(t(this.selection));const n=e.permission,i=this.selection.hasSingleSelection&&this.selection.first();return Boolean(["update","delete"].includes(n)&&(!i||i.cdExecuting))}useClickAction(e){return!this.disableSelectionAction(e)&&e.click&&e.click()}useDisableDesc(e){if(e.disable){const t=e.disable(this.selection);return r.a.isString(t)?t:void 0}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Gb({type:e,selectors:[["cd-table-actions"]],inputs:{permission:"permission",selection:"selection",tableActions:"tableActions",btnColor:"btnColor",dropDownOnly:"dropDownOnly"},features:[o.wb],decls:3,vars:2,consts:[[1,"btn-group"],[4,"ngIf"],["class","btn-group","ngbDropdown","","role","group","aria-label","Button group with nested dropdown",4,"ngIf"],["type","button",3,"title","ngClass","routerLink","preserveFragment","click"],[3,"ngClass"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["ngbDropdownToggle",""],["class","sr-only",4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],[4,"ngFor","ngForOf"],[1,"sr-only"],["ngbDropdownItem","",3,"title","routerLink","preserveFragment","disabled","click"]],template:function(e,t){1&e&&(o.Sb(0,"div",0),o.Mc(1,h,5,13,"ng-container",1),o.Mc(2,b,6,6,"div",2),o.Rb()),2&e&&(o.yb(1),o.pc("ngIf",t.currentAction),o.yb(1),o.pc("ngIf",t.dropDownActions.length>1))},directives:[a.r,a.p,c.f,l.i,l.m,l.k,a.q,l.j],styles:["button.disabled[_ngcontent-%COMP%]{cursor:default!important;pointer-events:auto}"]}),e})()},SFxW:function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-nc\u0131",9:"-uncu",10:"-uncu",30:"-uncu",60:"-\u0131nc\u0131",90:"-\u0131nc\u0131"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ert\u0259si_\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131_\xc7\u0259r\u015f\u0259nb\u0259_C\xfcm\u0259 ax\u015fam\u0131_C\xfcm\u0259_\u015e\u0259nb\u0259".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7\u0259r_CAx_C\xfcm_\u015e\u0259n".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7\u0259_CA_C\xfc_\u015e\u0259".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[g\u0259l\u0259n h\u0259ft\u0259] dddd [saat] LT",lastDay:"[d\xfcn\u0259n] LT",lastWeek:"[ke\xe7\u0259n h\u0259ft\u0259] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \u0259vv\u0259l",s:"bir ne\xe7\u0259 saniy\u0259",ss:"%d saniy\u0259",m:"bir d\u0259qiq\u0259",mm:"%d d\u0259qiq\u0259",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gec\u0259|s\u0259h\u0259r|g\xfcnd\xfcz|ax\u015fam/,isPM:function(e){return/^(g\xfcnd\xfcz|ax\u015fam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gec\u0259":e<12?"s\u0259h\u0259r":e<17?"g\xfcnd\xfcz":"ax\u015fam"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0131nc\u0131|inci|nci|\xfcnc\xfc|nc\u0131|uncu)/,ordinal:function(e){if(0===e)return e+"-\u0131nc\u0131";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},STAE:function(e,t,n){var i=n("LQDL"),r=n("0Dky");e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())||!Symbol.sham&&i&&i<41}))},SVse:function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return Ae})),n.d(t,"c",(function(){return qe})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return Fe})),n.d(t,"f",(function(){return Ve})),n.d(t,"g",(function(){return C})),n.d(t,"h",(function(){return S})),n.d(t,"i",(function(){return ze})),n.d(t,"j",(function(){return $e})),n.d(t,"k",(function(){return He})),n.d(t,"l",(function(){return d})),n.d(t,"m",(function(){return M})),n.d(t,"n",(function(){return _})),n.d(t,"o",(function(){return Ie})),n.d(t,"p",(function(){return me})),n.d(t,"q",(function(){return ge})),n.d(t,"r",(function(){return ye})),n.d(t,"s",(function(){return De})),n.d(t,"t",(function(){return Me})),n.d(t,"u",(function(){return xe})),n.d(t,"v",(function(){return ke})),n.d(t,"w",(function(){return Te})),n.d(t,"x",(function(){return w})),n.d(t,"y",(function(){return Be})),n.d(t,"z",(function(){return l})),n.d(t,"A",(function(){return je})),n.d(t,"B",(function(){return O})),n.d(t,"C",(function(){return Ne})),n.d(t,"D",(function(){return Ke})),n.d(t,"E",(function(){return Q})),n.d(t,"F",(function(){return A})),n.d(t,"G",(function(){return E})),n.d(t,"H",(function(){return I})),n.d(t,"I",(function(){return Qe})),n.d(t,"J",(function(){return a})),n.d(t,"K",(function(){return Je})),n.d(t,"L",(function(){return s})),n.d(t,"M",(function(){return pe})),n.d(t,"N",(function(){return o}));var i=n("8Y7J");let r=null;function s(){return r}function o(e){r||(r=e)}class a{}const c=new i.r("DocumentToken");let l=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:u,token:e,providedIn:"platform"}),e})();function u(){return Object(i.dc)(h)}const d=new i.r("Location Initialized");let h=(()=>{class e extends l{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=s().getLocation(),this._history=s().getHistory()}getBaseHrefFromDOM(){return s().getBaseHref(this._doc)}onPopState(e){s().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",e,!1)}onHashChange(e){s().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",e,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,t,n){f()?this._history.pushState(e,t,n):this.location.hash=n}replaceState(e,t,n){f()?this._history.replaceState(e,t,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return e.\u0275fac=function(t){return new(t||e)(i.dc(c))},e.\u0275prov=Object(i.Ib)({factory:p,token:e,providedIn:"platform"}),e})();function f(){return!!window.history.pushState}function p(){return new h(Object(i.dc)(c))}function m(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function b(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function g(e){return e&&"?"!==e[0]?"?"+e:e}let _=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:y,token:e,providedIn:"root"}),e})();function y(e){const t=Object(i.dc)(c).location;return new w(Object(i.dc)(l),t&&t.origin||"")}const v=new i.r("appBaseHref");let w=(()=>{class e extends _{constructor(e,t){if(super(),this._platformLocation=e,null==t&&(t=this._platformLocation.getBaseHrefFromDOM()),null==t)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=t}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return m(this._baseHref,e)}path(e=!1){const t=this._platformLocation.pathname+g(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?`${t}${n}`:t}pushState(e,t,n,i){const r=this.prepareExternalUrl(n+g(i));this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,i){const r=this.prepareExternalUrl(n+g(i));this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(l),i.dc(v,8))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),S=(()=>{class e extends _{constructor(e,t){super(),this._platformLocation=e,this._baseHref="",null!=t&&(this._baseHref=t)}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t}prepareExternalUrl(e){const t=m(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,n,i){let r=this.prepareExternalUrl(n+g(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,i){let r=this.prepareExternalUrl(n+g(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(l),i.dc(v,8))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),M=(()=>{class e{constructor(e,t){this._subject=new i.o,this._urlChangeListeners=[],this._platformStrategy=e;const n=this._platformStrategy.getBaseHref();this._platformLocation=t,this._baseHref=b(k(n)),this._platformStrategy.onPopState(e=>{this._subject.emit({url:this.path(!0),pop:!0,state:e.state,type:e.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+g(t))}normalize(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,k(t)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(e,t="",n=null){this._platformStrategy.pushState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g(t)),n)}replaceState(e,t="",n=null){this._platformStrategy.replaceState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g(t)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(e){this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(e=>{this._notifyUrlChangeListeners(e.url,e.state)}))}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach(n=>n(e,t))}subscribe(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}}return e.\u0275fac=function(t){return new(t||e)(i.dc(_),i.dc(l))},e.normalizeQueryParams=g,e.joinWithSlash=m,e.stripTrailingSlash=b,e.\u0275prov=Object(i.Ib)({factory:x,token:e,providedIn:"root"}),e})();function x(){return new M(Object(i.dc)(_),Object(i.dc)(l))}function k(e){return e.replace(/\/index.html$/,"")}var D=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}({}),T=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),C=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),O=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),R=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),L=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function E(e,t,n){const r=Object(i.ib)(e),s=H([r[i.Z.DayPeriodsFormat],r[i.Z.DayPeriodsStandalone]],t);return H(s,n)}function A(e,t,n){const r=Object(i.ib)(e),s=H([r[i.Z.DaysFormat],r[i.Z.DaysStandalone]],t);return H(s,n)}function I(e,t,n){const r=Object(i.ib)(e),s=H([r[i.Z.MonthsFormat],r[i.Z.MonthsStandalone]],t);return H(s,n)}function P(e,t){return H(Object(i.ib)(e)[i.Z.DateFormat],t)}function j(e,t){return H(Object(i.ib)(e)[i.Z.TimeFormat],t)}function N(e,t){return H(Object(i.ib)(e)[i.Z.DateTimeFormat],t)}function F(e,t){const n=Object(i.ib)(e),r=n[i.Z.NumberSymbols][t];if(void 0===r){if(t===L.CurrencyDecimal)return n[i.Z.NumberSymbols][L.Decimal];if(t===L.CurrencyGroup)return n[i.Z.NumberSymbols][L.Group]}return r}function Y(e,t){return Object(i.ib)(e)[i.Z.NumberFormats][t]}const z=i.lb;function $(e){if(!e[i.Z.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[i.Z.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function H(e,t){for(let n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function W(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const V=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,B={},U=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var G=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),q=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),J=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function Q(e,t,n,r){let s=function(e){if(se(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){e=e.trim();const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);if(/^(\d{4}-\d{1,2}-\d{1,2})$/.test(e)){const[t,n,i]=e.split("-").map(e=>+e);return new Date(t,n-1,i)}let n;if(n=e.match(V))return function(e){const t=new Date(0);let n=0,i=0;const r=e[8]?t.setUTCFullYear:t.setFullYear,s=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),i=Number(e[9]+e[11])),r.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const o=Number(e[4]||0)-n,a=Number(e[5]||0)-i,c=Number(e[6]||0),l=Math.round(1e3*parseFloat("0."+(e[7]||0)));return s.call(t,o,a,c,l),t}(n)}const t=new Date(e);if(!se(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=function e(t,n){const r=function(e){return Object(i.ib)(e)[i.Z.LocaleId]}(t);if(B[r]=B[r]||{},B[r][n])return B[r][n];let s="";switch(n){case"shortDate":s=P(t,R.Short);break;case"mediumDate":s=P(t,R.Medium);break;case"longDate":s=P(t,R.Long);break;case"fullDate":s=P(t,R.Full);break;case"shortTime":s=j(t,R.Short);break;case"mediumTime":s=j(t,R.Medium);break;case"longTime":s=j(t,R.Long);break;case"fullTime":s=j(t,R.Full);break;case"short":const n=e(t,"shortTime"),i=e(t,"shortDate");s=K(N(t,R.Short),[n,i]);break;case"medium":const r=e(t,"mediumTime"),o=e(t,"mediumDate");s=K(N(t,R.Medium),[r,o]);break;case"long":const a=e(t,"longTime"),c=e(t,"longDate");s=K(N(t,R.Long),[a,c]);break;case"full":const l=e(t,"fullTime"),u=e(t,"fullDate");s=K(N(t,R.Full),[l,u])}return s&&(B[r][n]=s),s}(n,t)||t;let o,a=[];for(;t;){if(o=U.exec(t),!o){a.push(t);break}{a=a.concat(o.slice(1));const e=a.pop();if(!e)break;t=e}}let c=s.getTimezoneOffset();r&&(c=re(r,c),s=function(e,t,n){const i=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(re(t,i)-i))}(s,r));let l="";return a.forEach(e=>{const t=function(e){if(ie[e])return ie[e];let t;switch(e){case"G":case"GG":case"GGG":t=ee(J.Eras,O.Abbreviated);break;case"GGGG":t=ee(J.Eras,O.Wide);break;case"GGGGG":t=ee(J.Eras,O.Narrow);break;case"y":t=X(q.FullYear,1,0,!1,!0);break;case"yy":t=X(q.FullYear,2,0,!0,!0);break;case"yyy":t=X(q.FullYear,3,0,!1,!0);break;case"yyyy":t=X(q.FullYear,4,0,!1,!0);break;case"M":case"L":t=X(q.Month,1,1);break;case"MM":case"LL":t=X(q.Month,2,1);break;case"MMM":t=ee(J.Months,O.Abbreviated);break;case"MMMM":t=ee(J.Months,O.Wide);break;case"MMMMM":t=ee(J.Months,O.Narrow);break;case"LLL":t=ee(J.Months,O.Abbreviated,C.Standalone);break;case"LLLL":t=ee(J.Months,O.Wide,C.Standalone);break;case"LLLLL":t=ee(J.Months,O.Narrow,C.Standalone);break;case"w":t=ne(1);break;case"ww":t=ne(2);break;case"W":t=ne(1,!0);break;case"d":t=X(q.Date,1);break;case"dd":t=X(q.Date,2);break;case"E":case"EE":case"EEE":t=ee(J.Days,O.Abbreviated);break;case"EEEE":t=ee(J.Days,O.Wide);break;case"EEEEE":t=ee(J.Days,O.Narrow);break;case"EEEEEE":t=ee(J.Days,O.Short);break;case"a":case"aa":case"aaa":t=ee(J.DayPeriods,O.Abbreviated);break;case"aaaa":t=ee(J.DayPeriods,O.Wide);break;case"aaaaa":t=ee(J.DayPeriods,O.Narrow);break;case"b":case"bb":case"bbb":t=ee(J.DayPeriods,O.Abbreviated,C.Standalone,!0);break;case"bbbb":t=ee(J.DayPeriods,O.Wide,C.Standalone,!0);break;case"bbbbb":t=ee(J.DayPeriods,O.Narrow,C.Standalone,!0);break;case"B":case"BB":case"BBB":t=ee(J.DayPeriods,O.Abbreviated,C.Format,!0);break;case"BBBB":t=ee(J.DayPeriods,O.Wide,C.Format,!0);break;case"BBBBB":t=ee(J.DayPeriods,O.Narrow,C.Format,!0);break;case"h":t=X(q.Hours,1,-12);break;case"hh":t=X(q.Hours,2,-12);break;case"H":t=X(q.Hours,1);break;case"HH":t=X(q.Hours,2);break;case"m":t=X(q.Minutes,1);break;case"mm":t=X(q.Minutes,2);break;case"s":t=X(q.Seconds,1);break;case"ss":t=X(q.Seconds,2);break;case"S":t=X(q.FractionalSeconds,1);break;case"SS":t=X(q.FractionalSeconds,2);break;case"SSS":t=X(q.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=te(G.Short);break;case"ZZZZZ":t=te(G.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=te(G.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=te(G.Long);break;default:return null}return ie[e]=t,t}(e);l+=t?t(s,n,c):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function K(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,(function(e,n){return null!=t&&n in t?t[n]:e}))),e}function Z(e,t,n="-",i,r){let s="";(e<0||r&&e<=0)&&(r?e=1-e:(e=-e,s=n));let o=String(e);for(;o.length<t;)o="0"+o;return i&&(o=o.substr(o.length-t)),s+o}function X(e,t,n=0,i=!1,r=!1){return function(s,o){let a=function(e,t){switch(e){case q.FullYear:return t.getFullYear();case q.Month:return t.getMonth();case q.Date:return t.getDate();case q.Hours:return t.getHours();case q.Minutes:return t.getMinutes();case q.Seconds:return t.getSeconds();case q.FractionalSeconds:return t.getMilliseconds();case q.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,s);if((n>0||a>-n)&&(a+=n),e===q.Hours)0===a&&-12===n&&(a=12);else if(e===q.FractionalSeconds)return c=t,Z(a,3).substr(0,c);var c;const l=F(o,L.MinusSign);return Z(a,t,l,i,r)}}function ee(e,t,n=C.Format,r=!1){return function(s,o){return function(e,t,n,r,s,o){switch(n){case J.Months:return I(t,s,r)[e.getMonth()];case J.Days:return A(t,s,r)[e.getDay()];case J.DayPeriods:const a=e.getHours(),c=e.getMinutes();if(o){const e=function(e){const t=Object(i.ib)(e);return $(t),(t[i.Z.ExtraData][2]||[]).map(e=>"string"==typeof e?W(e):[W(e[0]),W(e[1])])}(t),n=function(e,t,n){const r=Object(i.ib)(e);$(r);const s=H([r[i.Z.ExtraData][0],r[i.Z.ExtraData][1]],t)||[];return H(s,n)||[]}(t,s,r),o=e.findIndex(e=>{if(Array.isArray(e)){const[t,n]=e,i=a>=t.hours&&c>=t.minutes,r=a<n.hours||a===n.hours&&c<n.minutes;if(t.hours<n.hours){if(i&&r)return!0}else if(i||r)return!0}else if(e.hours===a&&e.minutes===c)return!0;return!1});if(-1!==o)return n[o]}return E(t,s,r)[a<12?0:1];case J.Eras:return function(e,t){return H(Object(i.ib)(e)[i.Z.Eras],t)}(t,r)[e.getFullYear()<=0?0:1];default:throw new Error("unexpected translation type "+n)}}(s,o,e,t,n,r)}}function te(e){return function(t,n,i){const r=-1*i,s=F(n,L.MinusSign),o=r>0?Math.floor(r/60):Math.ceil(r/60);switch(e){case G.Short:return(r>=0?"+":"")+Z(o,2,s)+Z(Math.abs(r%60),2,s);case G.ShortGMT:return"GMT"+(r>=0?"+":"")+Z(o,1,s);case G.Long:return"GMT"+(r>=0?"+":"")+Z(o,2,s)+":"+Z(Math.abs(r%60),2,s);case G.Extended:return 0===i?"Z":(r>=0?"+":"")+Z(o,2,s)+":"+Z(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${e}"`)}}}function ne(e,t=!1){return function(n,i){let r;if(t){const e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();r=1+Math.floor((t+e)/7)}else{const e=(s=n,new Date(s.getFullYear(),s.getMonth(),s.getDate()+(4-s.getDay()))),t=function(e){const t=new Date(e,0,1).getDay();return new Date(e,0,1+(t<=4?4:11)-t)}(e.getFullYear()),i=e.getTime()-t.getTime();r=1+Math.round(i/6048e5)}var s;return Z(r,e,F(i,L.MinusSign))}}const ie={};function re(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function se(e){return e instanceof Date&&!isNaN(e.valueOf())}const oe=/^(\d+)?\.((\d+)(-(\d+))?)?$/,ae=".",ce="0";function le(e,t,n,i,r,s,o=!1){let a="",c=!1;if(isFinite(e)){let l=function(e){let t,n,i,r,s,o=Math.abs(e)+"",a=0;for((n=o.indexOf(ae))>-1&&(o=o.replace(ae,"")),(i=o.search(/e/i))>0?(n<0&&(n=i),n+=+o.slice(i+1),o=o.substring(0,i)):n<0&&(n=o.length),i=0;o.charAt(i)===ce;i++);if(i===(s=o.length))t=[0],n=1;else{for(s--;o.charAt(s)===ce;)s--;for(n-=i,t=[],r=0;i<=s;i++,r++)t[r]=Number(o.charAt(i))}return n>22&&(t=t.splice(0,21),a=n-1,n=1),{digits:t,exponent:a,integerLen:n}}(e);o&&(l=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(l));let u=t.minInt,d=t.minFrac,h=t.maxFrac;if(s){const e=s.match(oe);if(null===e)throw new Error(s+" is not a valid digit info");const t=e[1],n=e[3],i=e[5];null!=t&&(u=de(t)),null!=n&&(d=de(n)),null!=i?h=de(i):null!=n&&d>h&&(h=d)}!function(e,t,n){if(t>n)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${n}).`);let i=e.digits,r=i.length-e.integerLen;const s=Math.min(Math.max(t,r),n);let o=s+e.integerLen,a=i[o];if(o>0){i.splice(Math.max(e.integerLen,o));for(let e=o;e<i.length;e++)i[e]=0}else{r=Math.max(0,r),e.integerLen=1,i.length=Math.max(1,o=s+1),i[0]=0;for(let e=1;e<o;e++)i[e]=0}if(a>=5)if(o-1<0){for(let t=0;t>o;t--)i.unshift(0),e.integerLen++;i.unshift(1),e.integerLen++}else i[o-1]++;for(;r<Math.max(0,s);r++)i.push(0);let c=0!==s;const l=t+e.integerLen,u=i.reduceRight((function(e,t,n,i){return i[n]=(t+=e)<10?t:t-10,c&&(0===i[n]&&n>=l?i.pop():c=!1),t>=10?1:0}),0);u&&(i.unshift(u),e.integerLen++)}(l,d,h);let f=l.digits,p=l.integerLen;const m=l.exponent;let b=[];for(c=f.every(e=>!e);p<u;p++)f.unshift(0);for(;p<0;p++)f.unshift(0);p>0?b=f.splice(p,f.length):(b=f,f=[0]);const g=[];for(f.length>=t.lgSize&&g.unshift(f.splice(-t.lgSize,f.length).join(""));f.length>t.gSize;)g.unshift(f.splice(-t.gSize,f.length).join(""));f.length&&g.unshift(f.join("")),a=g.join(F(n,i)),b.length&&(a+=F(n,r)+b.join("")),m&&(a+=F(n,L.Exponential)+"+"+m)}else a=F(n,L.Infinity);return a=e<0&&!c?t.negPre+a+t.negSuf:t.posPre+a+t.posSuf,a}function ue(e,t="-"){const n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=e.split(";"),r=i[0],s=i[1],o=-1!==r.indexOf(ae)?r.split(ae):[r.substring(0,r.lastIndexOf(ce)+1),r.substring(r.lastIndexOf(ce)+1)],a=o[0],c=o[1]||"";n.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u<c.length;u++){const e=c.charAt(u);e===ce?n.minFrac=n.maxFrac=u+1:"#"===e?n.maxFrac=u+1:n.posSuf+=e}const l=a.split(",");if(n.gSize=l[1]?l[1].length:0,n.lgSize=l[2]||l[1]?(l[2]||l[1]).length:0,s){const e=r.length-n.posPre.length-n.posSuf.length,t=s.indexOf("#");n.negPre=s.substr(0,t).replace(/'/g,""),n.negSuf=s.substr(t+e).replace(/'/g,"")}else n.negPre=t+n.posPre,n.negSuf=n.posSuf;return n}function de(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}class he{}let fe=(()=>{class e extends he{constructor(e){super(),this.locale=e}getPluralCategory(e,t){switch(z(t||this.locale)(e)){case T.Zero:return"zero";case T.One:return"one";case T.Two:return"two";case T.Few:return"few";case T.Many:return"many";default:return"other"}}}return e.\u0275fac=function(t){return new(t||e)(i.dc(i.v))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();function pe(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const e=n.indexOf("="),[i,r]=-1==e?[n,""]:[n.slice(0,e),n.slice(e+1)];if(i.trim()===t)return decodeURIComponent(r)}return null}let me=(()=>{class e{constructor(e,t,n,i){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Object(i.ob)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachChangedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachRemovedItem(e=>{e.previousValue&&this._toggleClass(e.key,!1)})}_applyIterableChanges(e){e.forEachAddedItem(e=>{if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Object(i.tb)(e.item));this._toggleClass(e.item,!0)}),e.forEachRemovedItem(e=>this._toggleClass(e.item,!1))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!0)):Object.keys(e).forEach(t=>this._toggleClass(t,!!e[t])))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!1)):Object.keys(e).forEach(e=>this._toggleClass(e,!1)))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach(e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.t),i.Mb(i.u),i.Mb(i.m),i.Mb(i.E))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e})();class be{constructor(e,t,n,i){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let ge=(()=>{class e{constructor(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){Object(i.U)()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn(`trackBy must be a function, but received ${JSON.stringify(e)}. See https://angular.io/api/common/NgForOf#change-propagation for more information.`),this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${n}' of type '${e=n,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,n,i)=>{if(null==e.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new be(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new _e(e,n);t.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new _e(e,r);t.push(s)}});for(let n=0;n<t.length;n++)this._perViewChange(t[n].view,t[n].record);for(let n=0,i=this._viewContainer.length;n<i;n++){const e=this._viewContainer.get(n);e.context.index=n,e.context.count=i,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.P),i.Mb(i.L),i.Mb(i.t))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),e})();class _e{constructor(e,t){this.record=e,this.view=t}}let ye=(()=>{class e{constructor(e,t){this._viewContainer=e,this._context=new ve,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){we("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){we("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.P),i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),e})();class ve{constructor(){this.$implicit=null,this.ngIf=null}}function we(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Object(i.tb)(t)}'.`)}class Se{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Me=(()=>{class e{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;t<this._defaultViews.length;t++)this._defaultViews[t].enforceState(e)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),e})(),xe=(()=>{class e{constructor(e,t,n){this.ngSwitch=n,n._addCase(),this._view=new Se(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.P),i.Mb(i.L),i.Mb(Me,1))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),e})(),ke=(()=>{class e{constructor(e,t,n){n._addDefault(new Se(e,t))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.P),i.Mb(i.L),i.Mb(Me,1))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngSwitchDefault",""]]}),e})(),De=(()=>{class e{constructor(e,t,n){this._ngEl=e,this._differs=t,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){const[n,i]=e.split(".");null!=(t=null!=t&&i?`${t}${i}`:t)?this._renderer.setStyle(this._ngEl.nativeElement,n,t):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(e){e.forEachRemovedItem(e=>this._setStyle(e.key,null)),e.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),e.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.u),i.Mb(i.E))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),e})(),Te=(()=>{class e{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){if(this._shouldRecreateView(e)){const e=this._viewContainerRef;this._viewRef&&e.remove(e.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?e.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),n=Object.keys(e.currentValue||{});if(t.length===n.length){for(let e of n)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.P))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[i.wb]}),e})();function Ce(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${Object(i.tb)(e)}'`)}class Oe{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Re{createSubscription(e,t){return e.then(t,e=>{throw e})}dispose(e){}onDestroy(e){}}const Le=new Re,Ee=new Oe;let Ae=(()=>{class e{constructor(e){this._ref=e,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue:(e&&this._subscribe(e),this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(t){if(Object(i.qb)(t))return Le;if(Object(i.pb)(t))return Ee;throw Ce(e,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(i.fc())},e.\u0275pipe=i.Lb({name:"async",type:e,pure:!1}),e})(),Ie=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw Ce(e,t);return t.toLowerCase()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"lowercase",type:e,pure:!0}),e})();const Pe=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;let je=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw Ce(e,t);return t.replace(Pe,e=>e[0].toUpperCase()+e.substr(1).toLowerCase())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"titlecase",type:e,pure:!0}),e})(),Ne=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw Ce(e,t);return t.toUpperCase()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"uppercase",type:e,pure:!0}),e})(),Fe=(()=>{class e{constructor(e){this.locale=e}transform(t,n="mediumDate",i,r){if(null==t||""===t||t!=t)return null;try{return Q(t,n,r||this.locale,i)}catch(s){throw Ce(e,s.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.v))},e.\u0275pipe=i.Lb({name:"date",type:e,pure:!0}),e})();const Ye=/#/g;let ze=(()=>{class e{constructor(e){this._localization=e}transform(t,n,i){if(null==t)return"";if("object"!=typeof n||null===n)throw Ce(e,n);return n[function(e,t,n,i){let r="="+e;if(t.indexOf(r)>-1)return r;if(r=n.getPluralCategory(e,i),t.indexOf(r)>-1)return r;if(t.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${e}"`)}(t,Object.keys(n),this._localization,i)].replace(Ye,t.toString())}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(he))},e.\u0275pipe=i.Lb({name:"i18nPlural",type:e,pure:!0}),e})(),$e=(()=>{class e{transform(e){return JSON.stringify(e,null,2)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"json",type:e,pure:!1}),e})(),He=(()=>{class e{constructor(e){this.differs=e,this.keyValues=[]}transform(e,t=We){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ||(this.differ=this.differs.find(e).create());const n=this.differ.diff(e);return n&&(this.keyValues=[],n.forEachItem(e=>{this.keyValues.push({key:e.key,value:e.currentValue})}),this.keyValues.sort(t)),this.keyValues}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.u))},e.\u0275pipe=i.Lb({name:"keyvalue",type:e,pure:!1}),e})();function We(e,t){const n=e.key,i=t.key;if(n===i)return 0;if(void 0===n)return 1;if(void 0===i)return-1;if(null===n)return 1;if(null===i)return-1;if("string"==typeof n&&"string"==typeof i)return n<i?-1:1;if("number"==typeof n&&"number"==typeof i)return n-i;if("boolean"==typeof n&&"boolean"==typeof i)return n<i?-1:1;const r=String(n),s=String(i);return r==s?0:r<s?-1:1}let Ve=(()=>{class e{constructor(e){this._locale=e}transform(t,n,i){if(Ue(t))return null;i=i||this._locale;try{return function(e,t,n){return le(e,ue(Y(t,D.Decimal),F(t,L.MinusSign)),t,L.Group,L.Decimal,n)}(Ge(t),i,n)}catch(r){throw Ce(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.v))},e.\u0275pipe=i.Lb({name:"number",type:e,pure:!0}),e})(),Be=(()=>{class e{constructor(e){this._locale=e}transform(t,n,i){if(Ue(t))return null;i=i||this._locale;try{return function(e,t,n){return le(e,ue(Y(t,D.Percent),F(t,L.MinusSign)),t,L.Group,L.Decimal,n,!0).replace(new RegExp("%","g"),F(t,L.PercentSign))}(Ge(t),i,n)}catch(r){throw Ce(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.v))},e.\u0275pipe=i.Lb({name:"percent",type:e,pure:!0}),e})();function Ue(e){return null==e||""===e||e!=e}function Ge(e){if("string"==typeof e&&!isNaN(Number(e)-parseFloat(e)))return Number(e);if("number"!=typeof e)throw new Error(e+" is not a number");return e}let qe=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[{provide:he,useClass:fe}]}),e})();const Je="browser";function Qe(e){return e===Je}let Ke=(()=>{class e{}return e.\u0275prov=Object(i.Ib)({token:e,providedIn:"root",factory:()=>new Ze(Object(i.dc)(c),window,Object(i.dc)(i.n))}),e})();class Ze{constructor(e,t,n){this.document=e,this.window=t,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportsScrolling()?[this.window.scrollX,this.window.scrollY]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(this.supportsScrolling()){const t=this.document.getElementById(e)||this.document.getElementsByName(e)[0];t&&this.scrollToElement(t)}}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),n=t.left+this.window.pageXOffset,i=t.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}supportScrollRestoration(){try{if(!this.window||!this.window.scrollTo)return!1;const e=Xe(this.window.history)||Xe(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch(e){return!1}}supportsScrolling(){try{return!!this.window.scrollTo}catch(e){return!1}}}function Xe(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}},SatO:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1200?"\u4e0a\u5348":1200===i?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},SeVD:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("ngJS"),r=n("NJ4a"),s=n("Lhse"),o=n("kJWO"),a=n("I55L"),c=n("c2HN"),l=n("XoHu");const u=e=>{if(e&&"function"==typeof e[o.a])return u=e,e=>{const t=u[o.a]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(Object(a.a)(e))return Object(i.a)(e);if(Object(c.a)(e))return n=e,e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,r.a),e);if(e&&"function"==typeof e[s.a])return t=e,e=>{const n=t[s.a]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e};{const t=Object(l.a)(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var t,n,u}},SpAZ:function(e,t,n){"use strict";function i(e){return e}n.d(t,"a",(function(){return i}))},SxV6:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("sVev"),r=n("pLZG"),s=n("IzEk"),o=n("xbPD"),a=n("XDbj"),c=n("SpAZ");function l(e,t){const n=arguments.length>=2;return l=>l.pipe(e?Object(r.a)((t,n)=>e(t,n,l)):c.a,Object(s.a)(1),n?Object(o.a)(t):Object(a.a)(()=>new i.a))}},TFwu:function(e,t,n){"use strict";var i=n("25cm"),r=n("jN84"),s=n("mkut");t.a=function(e){return Object(i.a)(e,s.a,r.a)}},TJUb:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t){return r.a.isPlainObject(t)?r.a.get(t,e,e):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"map",type:e,pure:!0}),e})()},TKcr:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{propertyValue(e){return getComputedStyle(document.body).getPropertyValue("--"+e)}}},TWQb:function(e,t,n){var i=n("/GqU"),r=n("UMSQ"),s=n("I8vh"),o=function(e){return function(t,n,o){var a,c=i(t),l=r(c.length),u=s(o,l);if(e&&n!=n){for(;l>u;)if((a=c[u++])!=a)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},TYzs:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=parseInt(e,10);return isNaN(t)?e:e+(1===Math.floor(t/10)?"th":t%10==1?"st":t%10==2?"nd":t%10==3?"rd":"th")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"ordinal",type:e,pure:!0}),e})()},TeQF:function(e,t,n){"use strict";var i=n("I+eb"),r=n("tycR").filter;i({target:"Array",proto:!0,forced:!n("Hd5f")("filter")},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},TnHx:function(e,t,n){"use strict";var i=n("25cm"),r=n("n561"),s=n("4/q3");t.a=function(e){return Object(i.a)(e,s.a,r.a)}},U6JX:function(e,t,n){"use strict";t.a=function(e,t){return function(n){return e(t(n))}}},UDhR:function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("wd/R"))},UMSQ:function(e,t,n){var i=n("ppGB"),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},USCx:function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Ean\xe1ir","Feabhra","M\xe1rta","Aibre\xe1n","Bealtaine","Meitheamh","I\xfail","L\xfanasa","Me\xe1n F\xf3mhair","Deireadh F\xf3mhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","M\xe1rt","Aib","Beal","Meith","I\xfail","L\xfan","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["D\xe9 Domhnaigh","D\xe9 Luain","D\xe9 M\xe1irt","D\xe9 C\xe9adaoin","D\xe9ardaoin","D\xe9 hAoine","D\xe9 Sathairn"],weekdaysShort:["Domh","Luan","M\xe1irt","C\xe9ad","D\xe9ar","Aoine","Sath"],weekdaysMin:["Do","Lu","M\xe1","C\xe9","D\xe9","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Am\xe1rach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inn\xe9 ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s \xf3 shin",s:"c\xfapla soicind",ss:"%d soicind",m:"n\xf3im\xe9ad",mm:"%d n\xf3im\xe9ad",h:"uair an chloig",hh:"%d uair an chloig",d:"l\xe1",dd:"%d l\xe1",M:"m\xed",MM:"%d m\xedonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},UTVS:function(e,t,n){var i=n("ewvW"),r={}.hasOwnProperty;e.exports=function(e,t){return r.call(i(e),t)}},UpQW:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u06cc","\u0641\u0631\u0648\u0631\u06cc","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u06cc\u0644","\u0645\u0626\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0626\u06cc","\u0627\u06af\u0633\u062a","\u0633\u062a\u0645\u0628\u0631","\u0627\u06a9\u062a\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062f\u0633\u0645\u0628\u0631"],n=["\u0627\u062a\u0648\u0627\u0631","\u067e\u06cc\u0631","\u0645\u0646\u06af\u0644","\u0628\u062f\u06be","\u062c\u0645\u0639\u0631\u0627\u062a","\u062c\u0645\u0639\u06c1","\u06c1\u0641\u062a\u06c1"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0622\u062c \u0628\u0648\u0642\u062a] LT",nextDay:"[\u06a9\u0644 \u0628\u0648\u0642\u062a] LT",nextWeek:"dddd [\u0628\u0648\u0642\u062a] LT",lastDay:"[\u06af\u0630\u0634\u062a\u06c1 \u0631\u0648\u0632 \u0628\u0648\u0642\u062a] LT",lastWeek:"[\u06af\u0630\u0634\u062a\u06c1] dddd [\u0628\u0648\u0642\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0628\u0639\u062f",past:"%s \u0642\u0628\u0644",s:"\u0686\u0646\u062f \u0633\u06cc\u06a9\u0646\u0688",ss:"%d \u0633\u06cc\u06a9\u0646\u0688",m:"\u0627\u06cc\u06a9 \u0645\u0646\u0679",mm:"%d \u0645\u0646\u0679",h:"\u0627\u06cc\u06a9 \u06af\u06be\u0646\u0679\u06c1",hh:"%d \u06af\u06be\u0646\u0679\u06d2",d:"\u0627\u06cc\u06a9 \u062f\u0646",dd:"%d \u062f\u0646",M:"\u0627\u06cc\u06a9 \u0645\u0627\u06c1",MM:"%d \u0645\u0627\u06c1",y:"\u0627\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},Ur1D:function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("wd/R"))},UudT:function(e,t,n){"use strict";var i=n("U6JX"),r=Object(i.a)(Object.getPrototypeOf,Object);t.a=r},UxlC:function(e,t,n){"use strict";var i=n("14Sl"),r=n("glrk"),s=n("UMSQ"),o=n("ppGB"),a=n("HYAF"),c=n("iqWW"),l=n("DLK6"),u=n("FMNM"),d=Math.max,h=Math.min;i("replace",2,(function(e,t,n,i){var f=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,p=i.REPLACE_KEEPS_$0,m=f?"$":"$0";return[function(n,i){var r=a(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,r,i):t.call(String(r),n,i)},function(e,i){if(!f&&p||"string"==typeof i&&-1===i.indexOf(m)){var a=n(t,e,this,i);if(a.done)return a.value}var b=r(e),g=String(this),_="function"==typeof i;_||(i=String(i));var y=b.global;if(y){var v=b.unicode;b.lastIndex=0}for(var w=[];;){var S=u(b,g);if(null===S)break;if(w.push(S),!y)break;""===String(S[0])&&(b.lastIndex=c(g,s(b.lastIndex),v))}for(var M,x="",k=0,D=0;D<w.length;D++){S=w[D];for(var T=String(S[0]),C=d(h(o(S.index),g.length),0),O=[],R=1;R<S.length;R++)O.push(void 0===(M=S[R])?M:String(M));var L=S.groups;if(_){var E=[T].concat(O,C,g);void 0!==L&&E.push(L);var A=String(i.apply(void 0,E))}else A=l(T,g,C,O,L,i);C>=k&&(x+=g.slice(k,C)+A,k=C+T.length)}return x+g.slice(k)}]}))},"V/fk":function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("Hicy"),c=n("hrfs"),l=n("WF9J"),u=n("yGOH"),d=n("9Xeq"),h=n("8Y7J");let f=(()=>{class e{}return e.\u0275mod=h.Kb({type:e}),e.\u0275inj=h.Jb({factory:function(t){return new(t||e)},providers:[],imports:[[i.c,r.m,r.x,o.c,o.y,o.A,o.F,c.b,r.x,d.a,u.a,o.l,a.b,l.b,s.i,o.h,o.C]]}),e})()},V2x9:function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Ju\xf1u_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},VRyK:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("HDdC"),r=n("z+Ro"),s=n("bHdf"),o=n("yCtX");function a(...e){let t=Number.POSITIVE_INFINITY,n=null,a=e[e.length-1];return Object(r.a)(a)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof a&&(t=e.pop()),null===n&&1===e.length&&e[0]instanceof i.a?e[0]:Object(s.a)(t)(Object(o.a)(e,n))}},VTlA:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("mSOc"),r=n("ufoC"),s=n("8Y7J");let o=(()=>{class e{constructor(e,t){this.taskMessageService=e,this.summaryService=t}init(e,t,n,i,r,s,o){this.getUpdate=e,this.preProcessing=t,this.setList=n,this.onFetchError=i,this.taskFilter=r,this.itemFilter=s,this.builders=o||{},this.summaryDataSubscription=this.summaryService.subscribe(e=>{this.summary=e,this.fetch()},this.onFetchError)}fetch(){this.getUpdate().subscribe(e=>{this.updateData(e,this.summary.executing_tasks.filter(this.taskFilter))},this.onFetchError)}updateData(e,t){const n=this.preProcessing?this.preProcessing(e):e;this.addMissing(n,t),n.forEach(e=>{const n=t.filter(t=>this.itemFilter(e,t));e.cdExecuting=this.getTaskAction(n)}),this.setList(n)}addMissing(e,t){const n=this.builders.default;t.forEach(t=>{const i=e.find(e=>this.itemFilter(e,t)),r=this.builders[t.name];i||!r&&!n||e.push(r?r(t.metadata):n(t.metadata))})}getTaskAction(e){if(0!==e.length)return e.map(e=>{const t=e.progress?` ${e.progress}%`:"";return this.taskMessageService.getRunningText(e)+"..."+t}).join(", ")}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(s.dc(r.a),s.dc(i.a))},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac}),e})()},VXsX:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");class o{constructor(e,t,n){this.name=e,this.metadata=t,this.onTaskFinished=n}}let a=(()=>{class e{constructor(){this.subscriptions=[]}init(e){return e.subscribe(e=>{const t=e.executing_tasks,n=e.finished_tasks,i=[];for(const r of this.subscriptions){const e=this._getTask(r,n),s=this._getTask(r,t);null!==e&&null===s&&r.onTaskFinished(e),null!==s&&i.push(r),this.subscriptions=i}})}subscribe(e,t,n){this.subscriptions.push(new o(e,t,n))}_getTask(e,t){for(const n of t)if(n.name===e.name&&r.a.isEqual(n.metadata,e.metadata))return n;return null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Vclq:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:6}})}(n("wd/R"))},Vhfg:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("lJxs"),r=n("WE5d"),s=n("ej+x"),o=n("8Y7J");let a=(()=>{class e{constructor(e){this.featureToggles=e}canActivate(e){return this.featureToggles.get().pipe(Object(i.a)(t=>{if(!1===t[e.routeConfig.path])throw new r.b;return!0}))}canActivateChild(e){return this.canActivate(e.parent)}}return e.\u0275fac=function(t){return new(t||e)(o.dc(s.a))},e.\u0275prov=o.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},VpIT:function(e,t,n){var i=n("xDBR"),r=n("xs3f");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.12.1",mode:i?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},Vu81:function(e,t,n){var i=n("0GbY"),r=n("JBy8"),s=n("dBg+"),o=n("glrk");e.exports=i("Reflect","ownKeys")||function(e){var t=r.f(o(e)),n=s.f;return n?t.concat(n(e)):t}},VxPD:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("yJti"),r=n("e2NH");class s extends r.a{constructor(e=i.a.ValueOk,t=""){switch(super(),e){case i.a.ValueOk:this.type="light",this.msg="";break;case i.a.ValueNone:this.type="info",this.msg=(t?"Retrieving data for " + t + ".":"Retrieving data.")+" "+"Please wait...";break;case i.a.ValueStale:this.type="warning",this.msg=t?"Displaying previously cached data for " + t + ".":"Displaying previously cached data.";break;case i.a.ValueException:this.type="danger",this.msg=(t?"Could not load data for " + t + ".":"Could not load data.")+" "+"Please check the cluster health."}}}},WE5d:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return o}));var i=n("oxzT");class r extends Error{}class s extends r{constructor(){super(...arguments),this.header="Page Not Found",this.message="Sorry, we couldn\u2019t find what you were looking for.\n  The page you requested may have been changed or moved.",this.icon=i.a.warning}}class o extends r{constructor(){super(...arguments),this.header="User Denied",this.message="Sorry, the user does not exist in Ceph.\n  You'll be logged out from the Identity Provider when you retry logging in.",this.icon=i.a.warning}}},WF9J:function(e,t,n){"use strict";n.d(t,"a",(function(){return z})),n.d(t,"b",(function(){return $})),n("TeQF"),n("QWBl"),n("4mDm"),n("zKZe"),n("07d7"),n("4l63"),n("PKPk"),n("ENF9"),n("3bBZ");var i=n("hKI/"),r=n.n(i),s=n("9/5/"),o=n.n(s),a=n("uyHG"),c=n.n(a),l=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),u="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,d="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),h="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(d):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},f=["top","right","bottom","left","width","height","size","weight"],p="undefined"!=typeof MutationObserver,m=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,r=0;function s(){n&&(n=!1,e()),i&&a()}function o(){h(s)}function a(){var e=Date.now();if(n){if(e-r<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);r=e}return a}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){u&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),p?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){u&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;f.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),b=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},g=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||d},_=S(0,0,0,0);function y(e){return parseFloat(e)||0}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+y(e["border-"+n+"-width"])}),0)}var w="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof g(e).SVGGraphicsElement}:function(e){return e instanceof g(e).SVGElement&&"function"==typeof e.getBBox};function S(e,t,n,i){return{x:e,y:t,width:n,height:i}}var M=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=S(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e,t=(e=this.target,u?w(e)?function(e){var t=e.getBBox();return S(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return _;var i=g(e).getComputedStyle(e),r=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n];t[r]=y(e["padding-"+r])}return t}(i),s=r.left+r.right,o=r.top+r.bottom,a=y(i.width),c=y(i.height);if("border-box"===i.boxSizing&&(Math.round(a+s)!==t&&(a-=v(i,"left","right")+s),Math.round(c+o)!==n&&(c-=v(i,"top","bottom")+o)),!function(e){return e===g(e).document.documentElement}(e)){var l=Math.round(a+s)-t,u=Math.round(c+o)-n;1!==Math.abs(l)&&(a-=l),1!==Math.abs(u)&&(c-=u)}return S(r.left,r.top,a,c)}(e):_);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),x=function(e,t){var n,i,r,s,o,a,c,l=(i=(n=t).x,r=n.y,s=n.width,o=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),b(c,{x:i,y:r,width:s,height:o,top:r,right:i+s,bottom:o+r,left:i}),c);b(this,{target:e,contentRect:l})},k=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new l,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof g(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new M(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof g(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new x(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),D="undefined"!=typeof WeakMap?new WeakMap:new l,T=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=m.getInstance(),i=new k(t,n,this);D.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){T.prototype[e]=function(){var t;return(t=D.get(this))[e].apply(t,arguments)}}));var C=void 0!==d.ResizeObserver?d.ResizeObserver:T,O=n("AxL3"),R=n.n(O);function L(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function E(e){return e&&e.ownerDocument?e.ownerDocument:document}n("E9XD"),n("sMBO"),n("rB9j"),n("Rm1S"),n("UxlC");var A=null,I=null;function P(e){if(null===A){var t=E(e);if(void 0===t)return A=0;var n=t.body,i=t.createElement("div");i.classList.add("simplebar-hide-scrollbar"),n.appendChild(i);var r=i.getBoundingClientRect().right;n.removeChild(i),A=r}return A}R.a&&window.addEventListener("resize",(function(){I!==window.devicePixelRatio&&(I=window.devicePixelRatio,A=null)}));var j=function(){function e(t,n){var i=this;this.onScroll=function(){var e=L(i.el);i.scrollXTicking||(e.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(e.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(e){i.mouseX=e.clientX,i.mouseY=e.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(e){var t,n;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(t=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(n=i.isWithinBounds(i.axis.y.track.rect)),(t||n)&&(e.preventDefault(),e.stopPropagation(),"mousedown"===e.type&&(t&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(e,"x"):i.onTrackClick(e,"x")),n&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(e,"y"):i.onTrackClick(e,"y"))))},this.drag=function(t){var n=i.axis[i.draggedAxis].track,r=n.rect[i.axis[i.draggedAxis].sizeAttr],s=i.axis[i.draggedAxis].scrollbar,o=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],a=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation();var c=(("y"===i.draggedAxis?t.pageY:t.pageX)-n.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset)/(r-s.size)*(o-a);"x"===i.draggedAxis&&(c=i.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?c-(r+s.size):c,c=i.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-c:c),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=c},this.onEndDrag=function(e){var t=E(i.el),n=L(i.el);e.preventDefault(),e.stopPropagation(),i.el.classList.remove(i.classNames.dragging),t.removeEventListener("mousemove",i.drag,!0),t.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=n.setTimeout((function(){t.removeEventListener("click",i.preventClick,!0),t.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null}))},this.preventClick=function(e){e.preventDefault(),e.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,{},n),this.classNames=Object.assign({},e.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,e.instances.has(this.el)||(this.recalculate=r()(this.recalculate.bind(this),64),this.onMouseMove=r()(this.onMouseMove.bind(this),64),this.hideScrollbars=o()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=o()(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=c()(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var t=document.createElement("div");t.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var n=t.firstElementChild;document.body.appendChild(n);var i=n.firstElementChild;n.scrollLeft=0;var r=e.getOffset(n),s=e.getOffset(i);n.scrollLeft=999;var o=e.getOffset(i);return{isRtlScrollingInverted:r.left!==s.left&&s.left-o.left!=0,isRtlScrollbarInverted:r.left!==s.left}},e.getOffset=function(e){var t=e.getBoundingClientRect(),n=E(e),i=L(e);return{top:t.top+(i.pageYOffset||n.documentElement.scrollTop),left:t.left+(i.pageXOffset||n.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),R.a&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var e=this;if(Array.prototype.filter.call(this.el.children,(function(t){return t.classList.contains(e.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),n=document.createElement("div");t.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),t.appendChild(n),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.initListeners=function(){var e=this,t=L(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var n=!1;this.resizeObserver=new(t.ResizeObserver||C)((function(){n&&e.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame((function(){n=!0})),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var e=L(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var t=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,i=this.contentEl.offsetWidth,r=this.contentWrapperEl.offsetWidth,s=this.elStyles.overflowX,o=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var a=this.contentEl.scrollHeight,c=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=n?i+"px":"auto",this.placeholderEl.style.height=a+"px";var l=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=c>i,this.axis.y.isOverflowing=a>l,this.axis.x.isOverflowing="hidden"!==s&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==o&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&c>r-(this.axis.y.isOverflowing?this.scrollbarWidth:0),this.axis.y.isOverflowing=this.axis.y.isOverflowing&&a>l-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(e){if(void 0===e&&(e="y"),!this.axis[e].isOverflowing)return 0;var t,n=this.axis[e].track.el[this.axis[e].offsetSizeAttr];return t=Math.max(~~(n/this.contentEl[this.axis[e].scrollSizeAttr]*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},t.positionScrollbar=function(t){if(void 0===t&&(t="y"),this.axis[t].isOverflowing){var n=this.contentWrapperEl[this.axis[t].scrollSizeAttr],i=this.axis[t].track.el[this.axis[t].offsetSizeAttr],r=parseInt(this.elStyles[this.axis[t].sizeAttr],10),s=this.axis[t].scrollbar,o=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=~~((o="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-o:o)/(n-r)*(i-s.size));a="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?a+(i-s.size):a,s.el.style.transform="x"===t?"translate3d("+a+"px, 0, 0)":"translate3d(0, "+a+"px, 0)"}},t.toggleTrackVisibility=function(e){void 0===e&&(e="y");var t=this.axis[e].track.el,n=this.axis[e].scrollbar.el;this.axis[e].isOverflowing||this.axis[e].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden"),n.style.display=this.axis[e].isOverflowing?"block":"none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.rect=this.axis[e].track.el.getBoundingClientRect(),this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[e].scrollbar.rect)?this.axis[e].scrollbar.el.classList.add(this.classNames.hover):this.axis[e].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[e].track.rect)?(this.showScrollbar(e),this.axis[e].track.el.classList.add(this.classNames.hover)):this.axis[e].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.el.classList.remove(this.classNames.hover),this.axis[e].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(e){void 0===e&&(e="y"),this.axis[e].isVisible||(this.axis[e].scrollbar.el.classList.add(this.classNames.visible),this.axis[e].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(e,t){void 0===t&&(t="y");var n=E(this.el),i=L(this.el);this.axis[t].dragOffset=("y"===t?e.pageY:e.pageX)-this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],this.draggedAxis=t,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(i.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(e,t){var n=this;if(void 0===t&&(t="y"),this.options.clickOnTrack){var i=L(this.el);this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var r=this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],s=parseInt(this.elStyles[this.axis[t].sizeAttr],10),o=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=("y"===t?this.mouseY-r:this.mouseX-r)<0?-1:1,c=-1===a?o-s:o+s;!function e(){var r,s;-1===a?o>c&&(n.contentWrapperEl.scrollTo(((r={})[n.axis[t].offsetAttr]=o-=n.options.clickOnTrackSpeed,r)),i.requestAnimationFrame(e)):o<c&&(n.contentWrapperEl.scrollTo(((s={})[n.axis[t].offsetAttr]=o+=n.options.clickOnTrackSpeed,s)),i.requestAnimationFrame(e))}()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:P(this.el)}catch(e){return P(this.el)}},t.removeListeners=function(){var e=this,t=L(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(t){e.el.removeEventListener(t,e.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(t){e.el.removeEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.findChild=function(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,(function(e){return n.call(e,t)}))[0]},e}();j.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},j.instances=new WeakMap;var N=j,F=n("8Y7J");const Y=["*"];let z=(()=>{class e{constructor(e){this.elRef=e}ngOnInit(){}ngAfterViewInit(){this.SimpleBar=new N(this.elRef.nativeElement,this.options||{})}ngOnDestroy(){this.SimpleBar.unMount(),this.SimpleBar=null}}return e.\u0275fac=function(t){return new(t||e)(F.Mb(F.m))},e.\u0275cmp=F.Gb({type:e,selectors:[["ngx-simplebar"]],hostAttrs:["data-simplebar","init"],inputs:{options:"options"},ngContentSelectors:Y,decls:13,vars:0,consts:[[1,"simplebar-wrapper"],[1,"simplebar-height-auto-observer-wrapper"],[1,"simplebar-height-auto-observer"],[1,"simplebar-mask"],[1,"simplebar-offset"],[1,"simplebar-content-wrapper"],[1,"simplebar-content"],[1,"simplebar-placeholder"],[1,"simplebar-track","simplebar-horizontal"],[1,"simplebar-scrollbar"],[1,"simplebar-track","simplebar-vertical"]],template:function(e,t){1&e&&(F.oc(),F.Sb(0,"div",0),F.Sb(1,"div",1),F.Nb(2,"div",2),F.Rb(),F.Sb(3,"div",3),F.Sb(4,"div",4),F.Sb(5,"div",5),F.Sb(6,"div",6),F.nc(7),F.Rb(),F.Rb(),F.Rb(),F.Rb(),F.Nb(8,"div",7),F.Rb(),F.Sb(9,"div",8),F.Nb(10,"div",9),F.Rb(),F.Sb(11,"div",10),F.Nb(12,"div",9),F.Rb())},styles:["[data-simplebar]{position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;flex-wrap:wrap;-webkit-box-pack:start;justify-content:flex-start;align-content:flex-start;-webkit-box-align:start;align-items:flex-start}.simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit}.simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto!important;height:auto!important;z-index:0}.simplebar-offset{direction:inherit!important;box-sizing:inherit!important;resize:none!important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch}.simplebar-content-wrapper{direction:inherit;box-sizing:border-box!important;position:relative;display:block;height:100%;width:auto;max-width:100%;max-height:100%;scrollbar-width:none;-ms-overflow-style:none}.simplebar-content-wrapper::-webkit-scrollbar,.simplebar-hide-scrollbar::-webkit-scrollbar{width:0;height:0}.simplebar-content:after,.simplebar-content:before{content:' ';display:table}.simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none}.simplebar-height-auto-observer-wrapper{box-sizing:inherit!important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;-webkit-box-flex:inherit;flex-grow:inherit;flex-shrink:0;flex-basis:0}.simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1}.simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden}[data-simplebar].simplebar-dragging .simplebar-content{pointer-events:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}[data-simplebar].simplebar-dragging .simplebar-track{pointer-events:all}.simplebar-scrollbar{position:absolute;left:0;right:0;min-height:10px}.simplebar-scrollbar:before{position:absolute;content:'';background:#000;border-radius:7px;left:2px;right:2px;opacity:0;-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.simplebar-scrollbar.simplebar-visible:before{opacity:.5;-webkit-transition:opacity linear;transition:opacity linear}.simplebar-track.simplebar-vertical{top:0;width:11px}.simplebar-track.simplebar-vertical .simplebar-scrollbar:before{top:2px;bottom:2px}.simplebar-track.simplebar-horizontal{left:0;height:11px}.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before{height:100%;left:2px;right:2px}.simplebar-track.simplebar-horizontal .simplebar-scrollbar{right:auto;left:0;top:2px;height:7px;min-height:0;min-width:10px;width:auto}[data-simplebar-direction=rtl] .simplebar-track.simplebar-vertical{right:auto;left:0}.hs-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll}.simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none}","ngx-simplebar{display:block}"],encapsulation:2}),e})(),$=(()=>{class e{}return e.\u0275mod=F.Kb({type:e}),e.\u0275inj=F.Jb({factory:function(t){return new(t||e)},imports:[[]]}),e})()},WJ6P:function(e,t,n){"use strict";t.a=function(){return[]}},WJkJ:function(e,t){e.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},WKiH:function(e,t,n){var i=n("HYAF"),r="["+n("WJkJ")+"]",s=RegExp("^"+r+r+"*"),o=RegExp(r+r+"*$"),a=function(e){return function(t){var n=String(i(t));return 1&e&&(n=n.replace(s,"")),2&e&&(n=n.replace(o,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},WMd4:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("EY2u"),r=n("LRne"),s=n("z6cu");let o=(()=>{class e{constructor(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}}accept(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)}toObservable(){switch(this.kind){case"N":return Object(r.a)(this.value);case"E":return Object(s.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}static createError(t){return new e("E",void 0,t)}static createComplete(){return e.completeNotification}}return e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e})()},WOAq:function(e,t,n){"use strict";(function(e){var i=n("Ju5/"),r=n("L3Qv"),s="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===s?i.a.Buffer:void 0;t.a=(a?a.isBuffer:void 0)||r.a}).call(this,n("3UD+")(e))},WYrj:function(e,t,n){!function(e){"use strict";var t=["\u0796\u07ac\u0782\u07aa\u0787\u07a6\u0783\u07a9","\u078a\u07ac\u0784\u07b0\u0783\u07aa\u0787\u07a6\u0783\u07a9","\u0789\u07a7\u0783\u07a8\u0797\u07aa","\u0787\u07ad\u0795\u07b0\u0783\u07a9\u078d\u07aa","\u0789\u07ad","\u0796\u07ab\u0782\u07b0","\u0796\u07aa\u078d\u07a6\u0787\u07a8","\u0787\u07af\u078e\u07a6\u0790\u07b0\u0793\u07aa","\u0790\u07ac\u0795\u07b0\u0793\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0787\u07ae\u0786\u07b0\u0793\u07af\u0784\u07a6\u0783\u07aa","\u0782\u07ae\u0788\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0791\u07a8\u0790\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa"],n=["\u0787\u07a7\u078b\u07a8\u0787\u07b0\u078c\u07a6","\u0780\u07af\u0789\u07a6","\u0787\u07a6\u0782\u07b0\u078e\u07a7\u0783\u07a6","\u0784\u07aa\u078b\u07a6","\u0784\u07aa\u0783\u07a7\u0790\u07b0\u078a\u07a6\u078c\u07a8","\u0780\u07aa\u0786\u07aa\u0783\u07aa","\u0780\u07ae\u0782\u07a8\u0780\u07a8\u0783\u07aa"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"\u0787\u07a7\u078b\u07a8_\u0780\u07af\u0789\u07a6_\u0787\u07a6\u0782\u07b0_\u0784\u07aa\u078b\u07a6_\u0784\u07aa\u0783\u07a7_\u0780\u07aa\u0786\u07aa_\u0780\u07ae\u0782\u07a8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0789\u0786|\u0789\u078a/,isPM:function(e){return"\u0789\u078a"===e},meridiem:function(e,t,n){return e<12?"\u0789\u0786":"\u0789\u078a"},calendar:{sameDay:"[\u0789\u07a8\u0787\u07a6\u078b\u07aa] LT",nextDay:"[\u0789\u07a7\u078b\u07a6\u0789\u07a7] LT",nextWeek:"dddd LT",lastDay:"[\u0787\u07a8\u0787\u07b0\u0794\u07ac] LT",lastWeek:"[\u078a\u07a7\u0787\u07a8\u078c\u07aa\u0788\u07a8] dddd LT",sameElse:"L"},relativeTime:{future:"\u078c\u07ac\u0783\u07ad\u078e\u07a6\u0787\u07a8 %s",past:"\u0786\u07aa\u0783\u07a8\u0782\u07b0 %s",s:"\u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa\u0786\u07ae\u0785\u07ac\u0787\u07b0",ss:"d% \u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa",m:"\u0789\u07a8\u0782\u07a8\u0793\u07ac\u0787\u07b0",mm:"\u0789\u07a8\u0782\u07a8\u0793\u07aa %d",h:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07ac\u0787\u07b0",hh:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07aa %d",d:"\u078b\u07aa\u0788\u07a6\u0780\u07ac\u0787\u07b0",dd:"\u078b\u07aa\u0788\u07a6\u0790\u07b0 %d",M:"\u0789\u07a6\u0780\u07ac\u0787\u07b0",MM:"\u0789\u07a6\u0790\u07b0 %d",y:"\u0787\u07a6\u0780\u07a6\u0783\u07ac\u0787\u07b0",yy:"\u0787\u07a6\u0780\u07a6\u0783\u07aa %d"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:7,doy:12}})}(n("wd/R"))},Wv91:function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'\xfcnji",4:"'\xfcnji",100:"'\xfcnji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"\xddanwar_Fewral_Mart_Aprel_Ma\xfd_I\xfdun_I\xfdul_Awgust_Sent\xfdabr_Okt\xfdabr_No\xfdabr_Dekabr".split("_"),monthsShort:"\xddan_Few_Mar_Apr_Ma\xfd_I\xfdn_I\xfdl_Awg_Sen_Okt_No\xfd_Dek".split("_"),weekdays:"\xddek\u015fenbe_Du\u015fenbe_Si\u015fenbe_\xc7ar\u015fenbe_Pen\u015fenbe_Anna_\u015eenbe".split("_"),weekdaysShort:"\xddek_Du\u015f_Si\u015f_\xc7ar_Pen_Ann_\u015een".split("_"),weekdaysMin:"\xddk_D\u015f_S\u015f_\xc7r_Pn_An_\u015en".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[d\xfc\xfdn] LT",lastWeek:"[ge\xe7en] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s so\u0148",past:"%s \xf6\u0148",s:"birn\xe4\xe7e sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir a\xfd",MM:"%d a\xfd",y:"bir \xfdyl",yy:"%d \xfdyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var i=e%10;return e+(t[i]||t[e%100-i]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},WxRl:function(e,t,n){!function(e){"use strict";var t="vas\xe1rnap h\xe9tf\u0151n kedden szerd\xe1n cs\xfct\xf6rt\xf6k\xf6n p\xe9nteken szombaton".split(" ");function n(e,t,n,i){var r=e;switch(n){case"s":return i||t?"n\xe9h\xe1ny m\xe1sodperc":"n\xe9h\xe1ny m\xe1sodperce";case"ss":return r+(i||t)?" m\xe1sodperc":" m\xe1sodperce";case"m":return"egy"+(i||t?" perc":" perce");case"mm":return r+(i||t?" perc":" perce");case"h":return"egy"+(i||t?" \xf3ra":" \xf3r\xe1ja");case"hh":return r+(i||t?" \xf3ra":" \xf3r\xe1ja");case"d":return"egy"+(i||t?" nap":" napja");case"dd":return r+(i||t?" nap":" napja");case"M":return"egy"+(i||t?" h\xf3nap":" h\xf3napja");case"MM":return r+(i||t?" h\xf3nap":" h\xf3napja");case"y":return"egy"+(i||t?" \xe9v":" \xe9ve");case"yy":return r+(i||t?" \xe9v":" \xe9ve")}return""}function i(e){return(e?"":"[m\xfalt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"janu\xe1r_febru\xe1r_m\xe1rcius_\xe1prilis_m\xe1jus_j\xfanius_j\xfalius_augusztus_szeptember_okt\xf3ber_november_december".split("_"),monthsShort:"jan._feb._m\xe1rc._\xe1pr._m\xe1j._j\xfan._j\xfal._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vas\xe1rnap_h\xe9tf\u0151_kedd_szerda_cs\xfct\xf6rt\xf6k_p\xe9ntek_szombat".split("_"),weekdaysShort:"vas_h\xe9t_kedd_sze_cs\xfct_p\xe9n_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return i.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return i.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s m\xfalva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},X709:function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf6ndag_m\xe5ndag_tisdag_onsdag_torsdag_fredag_l\xf6rdag".split("_"),weekdaysShort:"s\xf6n_m\xe5n_tis_ons_tor_fre_l\xf6r".split("_"),weekdaysMin:"s\xf6_m\xe5_ti_on_to_fr_l\xf6".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Ig\xe5r] LT",nextWeek:"[P\xe5] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"f\xf6r %s sedan",s:"n\xe5gra sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en m\xe5nad",MM:"%d m\xe5nader",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("wd/R"))},XDbj:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("sVev"),r=n("7o/Q");function s(e=c){return t=>t.lift(new o(e))}class o{constructor(e){this.errorFactory=e}call(e,t){return t.subscribe(new a(e,this.errorFactory))}}class a extends r.a{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let t;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)}}}function c(){return new i.a}},XDpg:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u5468\u65e5_\u5468\u4e00_\u5468\u4e8c_\u5468\u4e09_\u5468\u56db_\u5468\u4e94_\u5468\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5Ah\u70b9mm\u5206",LLLL:"YYYY\u5e74M\u6708D\u65e5ddddAh\u70b9mm\u5206",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:function(e){return e.week()!==this.week()?"[\u4e0b]dddLT":"[\u672c]dddLT"},lastDay:"[\u6628\u5929]LT",lastWeek:function(e){return this.week()!==e.week()?"[\u4e0a]dddLT":"[\u672c]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u5468)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u5468";default:return e}},relativeTime:{future:"%s\u540e",past:"%s\u524d",s:"\u51e0\u79d2",ss:"%d \u79d2",m:"1 \u5206\u949f",mm:"%d \u5206\u949f",h:"1 \u5c0f\u65f6",hh:"%d \u5c0f\u65f6",d:"1 \u5929",dd:"%d \u5929",w:"1 \u5468",ww:"%d \u5468",M:"1 \u4e2a\u6708",MM:"%d \u4e2a\u6708",y:"1 \u5e74",yy:"%d \u5e74"},week:{dow:1,doy:4}})}(n("wd/R"))},XFyV:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("oxzT"),r=n("8Y7J"),s=n("G0yt"),o=n("SVse");const a=function(e,t){return[e,t]},c=["*"];let l=(()=>{class e{constructor(){this.icons=i.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Gb({type:e,selectors:[["cd-loading-panel"]],ngContentSelectors:c,decls:4,vars:5,consts:[["type","info",3,"dismissible"],["aria-hidden","true",1,"mr-2",3,"ngClass"]],template:function(e,t){1&e&&(r.oc(),r.Sb(0,"ngb-alert",0),r.Sb(1,"strong"),r.Nb(2,"i",1),r.Rb(),r.nc(3),r.Rb()),2&e&&(r.pc("dismissible",!1),r.yb(2),r.pc("ngClass",r.vc(2,a,t.icons.spinner,t.icons.spin)))},directives:[s.b,o.p],styles:[""]}),e})()},XGwC:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},XLvN:function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"\u0c1c\u0c28\u0c35\u0c30\u0c3f_\u0c2b\u0c3f\u0c2c\u0c4d\u0c30\u0c35\u0c30\u0c3f_\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f\u0c32\u0c4d_\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17\u0c38\u0c4d\u0c1f\u0c41_\u0c38\u0c46\u0c2a\u0c4d\u0c1f\u0c46\u0c02\u0c2c\u0c30\u0c4d_\u0c05\u0c15\u0c4d\u0c1f\u0c4b\u0c2c\u0c30\u0c4d_\u0c28\u0c35\u0c02\u0c2c\u0c30\u0c4d_\u0c21\u0c3f\u0c38\u0c46\u0c02\u0c2c\u0c30\u0c4d".split("_"),monthsShort:"\u0c1c\u0c28._\u0c2b\u0c3f\u0c2c\u0c4d\u0c30._\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f._\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17._\u0c38\u0c46\u0c2a\u0c4d._\u0c05\u0c15\u0c4d\u0c1f\u0c4b._\u0c28\u0c35._\u0c21\u0c3f\u0c38\u0c46.".split("_"),monthsParseExact:!0,weekdays:"\u0c06\u0c26\u0c3f\u0c35\u0c3e\u0c30\u0c02_\u0c38\u0c4b\u0c2e\u0c35\u0c3e\u0c30\u0c02_\u0c2e\u0c02\u0c17\u0c33\u0c35\u0c3e\u0c30\u0c02_\u0c2c\u0c41\u0c27\u0c35\u0c3e\u0c30\u0c02_\u0c17\u0c41\u0c30\u0c41\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c41\u0c15\u0c4d\u0c30\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c28\u0c3f\u0c35\u0c3e\u0c30\u0c02".split("_"),weekdaysShort:"\u0c06\u0c26\u0c3f_\u0c38\u0c4b\u0c2e_\u0c2e\u0c02\u0c17\u0c33_\u0c2c\u0c41\u0c27_\u0c17\u0c41\u0c30\u0c41_\u0c36\u0c41\u0c15\u0c4d\u0c30_\u0c36\u0c28\u0c3f".split("_"),weekdaysMin:"\u0c06_\u0c38\u0c4b_\u0c2e\u0c02_\u0c2c\u0c41_\u0c17\u0c41_\u0c36\u0c41_\u0c36".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c28\u0c47\u0c21\u0c41] LT",nextDay:"[\u0c30\u0c47\u0c2a\u0c41] LT",nextWeek:"dddd, LT",lastDay:"[\u0c28\u0c3f\u0c28\u0c4d\u0c28] LT",lastWeek:"[\u0c17\u0c24] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0c32\u0c4b",past:"%s \u0c15\u0c4d\u0c30\u0c3f\u0c24\u0c02",s:"\u0c15\u0c4a\u0c28\u0c4d\u0c28\u0c3f \u0c15\u0c4d\u0c37\u0c23\u0c3e\u0c32\u0c41",ss:"%d \u0c38\u0c46\u0c15\u0c28\u0c4d\u0c32\u0c41",m:"\u0c12\u0c15 \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c02",mm:"%d \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c3e\u0c32\u0c41",h:"\u0c12\u0c15 \u0c17\u0c02\u0c1f",hh:"%d \u0c17\u0c02\u0c1f\u0c32\u0c41",d:"\u0c12\u0c15 \u0c30\u0c4b\u0c1c\u0c41",dd:"%d \u0c30\u0c4b\u0c1c\u0c41\u0c32\u0c41",M:"\u0c12\u0c15 \u0c28\u0c46\u0c32",MM:"%d \u0c28\u0c46\u0c32\u0c32\u0c41",y:"\u0c12\u0c15 \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c02",yy:"%d \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c3e\u0c32\u0c41"},dayOfMonthOrdinalParse:/\d{1,2}\u0c35/,ordinal:"%d\u0c35",meridiemParse:/\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f|\u0c09\u0c26\u0c2f\u0c02|\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02|\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"===t?e<4?e:e+12:"\u0c09\u0c26\u0c2f\u0c02"===t?e:"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02"===t?e>=10?e:e+12:"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f":e<10?"\u0c09\u0c26\u0c2f\u0c02":e<17?"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02":e<20?"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02":"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"},week:{dow:0,doy:6}})}(n("wd/R"))},XNiG:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u}));var i=n("HDdC"),r=n("7o/Q"),s=n("quSY"),o=n("9ppp"),a=n("Ylt2"),c=n("2QA8");class l extends r.a{constructor(e){super(e),this.destination=e}}let u=(()=>{class e extends i.a{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[c.a](){return new l(this)}lift(e){const t=new d(this,this);return t.operator=e,t}next(e){if(this.closed)throw new o.a;if(!this.isStopped){const{observers:t}=this,n=t.length,i=t.slice();for(let r=0;r<n;r++)i[r].next(e)}}error(e){if(this.closed)throw new o.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,n=t.length,i=t.slice();for(let r=0;r<n;r++)i[r].error(e);this.observers.length=0}complete(){if(this.closed)throw new o.a;this.isStopped=!0;const{observers:e}=this,t=e.length,n=e.slice();for(let i=0;i<t;i++)n[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new o.a;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new o.a;return this.hasError?(e.error(this.thrownError),s.a.EMPTY):this.isStopped?(e.complete(),s.a.EMPTY):(this.observers.push(e),new a.a(this,e))}asObservable(){const e=new i.a;return e.source=this,e}}return e.create=(e,t)=>new d(e,t),e})();class d extends u{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):s.a.EMPTY}}},XoHu:function(e,t,n){"use strict";function i(e){return null!==e&&"object"==typeof e}n.d(t,"a",(function(){return i}))},XqMk:function(e,t,n){"use strict";var i="object"==typeof global&&global&&global.Object===Object&&global;t.a=i},Y7HM:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("DH7j");function r(e){return!Object(i.a)(e)&&e-parseFloat(e)+1>=0}},Y7yP:function(e,t,n){"use strict";var i,r=n("vJtL"),s=n("Ju5/").a["__core-js_shared__"],o=(i=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",a=n("IzLi"),c=n("dLWn"),l=/^\[object .+?Constructor\]$/,u=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.a=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Object(a.a)(e)||(t=e,o&&o in t))&&(Object(r.a)(e)?u:l).test(Object(c.a)(e));var t}(n)?n:void 0}},YF1G:function(e,t,n){var i=n("xrYK"),r=n("2oRo");e.exports="process"==i(r.process)},YHEm:function(e,t,n){"use strict";t.a=function(e,t){return e===t||e!=e&&t!=t}},YM6B:function(e,t,n){"use strict";var i=n("Y7yP"),r=n("Ju5/"),s=Object(i.a)(r.a,"DataView"),o=n("3cmB"),a=Object(i.a)(r.a,"Promise"),c=Object(i.a)(r.a,"Set"),l=Object(i.a)(r.a,"WeakMap"),u=n("8M4i"),d=n("dLWn"),h="[object Map]",f="[object Promise]",p="[object Set]",m="[object WeakMap]",b="[object DataView]",g=Object(d.a)(s),_=Object(d.a)(o.a),y=Object(d.a)(a),v=Object(d.a)(c),w=Object(d.a)(l),S=u.a;(s&&S(new s(new ArrayBuffer(1)))!=b||o.a&&S(new o.a)!=h||a&&S(a.resolve())!=f||c&&S(new c)!=p||l&&S(new l)!=m)&&(S=function(e){var t=Object(u.a)(e),n="[object Object]"==t?e.constructor:void 0,i=n?Object(d.a)(n):"";if(i)switch(i){case g:return b;case _:return h;case y:return f;case v:return p;case w:return m}return t}),t.a=S},YNrV:function(e,t,n){"use strict";var i=n("g6v/"),r=n("0Dky"),s=n("33Wh"),o=n("dBg+"),a=n("0eef"),c=n("ewvW"),l=n("RK3t"),u=Object.assign,d=Object.defineProperty;e.exports=!u||r((function(){if(i&&1!==u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||s(u({},t)).join("")!=r}))?function(e,t){for(var n=c(e),r=arguments.length,u=1,d=o.f,h=a.f;r>u;)for(var f,p=l(arguments[u++]),m=d?s(p).concat(d(p)):s(p),b=m.length,g=0;b>g;)f=m[g++],i&&!h.call(p,f)||(n[f]=p[f]);return n}:u},YRex:function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),monthsShort:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),weekdays:"\u064a\u06d5\u0643\u0634\u06d5\u0646\u0628\u06d5_\u062f\u06c8\u0634\u06d5\u0646\u0628\u06d5_\u0633\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u0686\u0627\u0631\u0634\u06d5\u0646\u0628\u06d5_\u067e\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u062c\u06c8\u0645\u06d5_\u0634\u06d5\u0646\u0628\u06d5".split("_"),weekdaysShort:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),weekdaysMin:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649",LLL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm",LLLL:"dddd\u060c YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm"},meridiemParse:/\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5|\u0633\u06d5\u06be\u06d5\u0631|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646|\u0686\u06c8\u0634|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646|\u0643\u06d5\u0686/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5"===t||"\u0633\u06d5\u06be\u06d5\u0631"===t||"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646"===t?e:"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646"===t||"\u0643\u06d5\u0686"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5":i<900?"\u0633\u06d5\u06be\u06d5\u0631":i<1130?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646":i<1230?"\u0686\u06c8\u0634":i<1800?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646":"\u0643\u06d5\u0686"},calendar:{sameDay:"[\u0628\u06c8\u06af\u06c8\u0646 \u0633\u0627\u0626\u06d5\u062a] LT",nextDay:"[\u0626\u06d5\u062a\u06d5 \u0633\u0627\u0626\u06d5\u062a] LT",nextWeek:"[\u0643\u06d0\u0644\u06d5\u0631\u0643\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",lastDay:"[\u062a\u06c6\u0646\u06c8\u06af\u06c8\u0646] LT",lastWeek:"[\u0626\u0627\u0644\u062f\u0649\u0646\u0642\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0643\u06d0\u064a\u0649\u0646",past:"%s \u0628\u06c7\u0631\u06c7\u0646",s:"\u0646\u06d5\u0686\u0686\u06d5 \u0633\u06d0\u0643\u0648\u0646\u062a",ss:"%d \u0633\u06d0\u0643\u0648\u0646\u062a",m:"\u0628\u0649\u0631 \u0645\u0649\u0646\u06c7\u062a",mm:"%d \u0645\u0649\u0646\u06c7\u062a",h:"\u0628\u0649\u0631 \u0633\u0627\u0626\u06d5\u062a",hh:"%d \u0633\u0627\u0626\u06d5\u062a",d:"\u0628\u0649\u0631 \u0643\u06c8\u0646",dd:"%d \u0643\u06c8\u0646",M:"\u0628\u0649\u0631 \u0626\u0627\u064a",MM:"%d \u0626\u0627\u064a",y:"\u0628\u0649\u0631 \u064a\u0649\u0644",yy:"%d \u064a\u0649\u0644"},dayOfMonthOrdinalParse:/\d{1,2}(-\u0643\u06c8\u0646\u0649|-\u0626\u0627\u064a|-\u06be\u06d5\u067e\u062a\u06d5)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-\u0643\u06c8\u0646\u0649";case"w":case"W":return e+"-\u06be\u06d5\u067e\u062a\u06d5";default:return e}},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:7}})}(n("wd/R"))},Ylt2:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("quSY");class r extends i.a{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},Yrry:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("cUpR");let s=(()=>{class e{constructor(e){this.domSanitizer=e}transform(e){return this.domSanitizer.sanitize(i.I.HTML,e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(r.b))},e.\u0275pipe=i.Lb({name:"sanitizeHtml",type:e,pure:!0}),e})()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},Z21x:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("8Y7J"),r=n("sne2"),s=n("SVse"),o=n("ANnk");let a=(()=>{class e{constructor(e,t){this.location=e,this.actionLabels=t,this.backAction=new i.o,this.name=this.actionLabels.CANCEL}back(){0===this.backAction.observers.length?this.location.back():this.backAction.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(s.m),i.Mb(r.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-back-button"]],inputs:{name:"name"},outputs:{backAction:"backAction"},decls:2,vars:1,consts:[["type","button",1,"btn","btn-light","tc_backButton",3,"click"]],template:function(e,t){1&e&&(i.Sb(0,"button",0),i.gc("click",(function(){return t.back()})),i.Oc(1),i.Rb()),2&e&&(i.yb(1),i.Qc(" ",t.name,"\n"))},directives:[o.a],styles:[""]}),e})()},Z4QM:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u064a","\u0641\u064a\u0628\u0631\u0648\u0631\u064a","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u064a\u0644","\u0645\u0626\u064a","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0621\u0650","\u0622\u06af\u0633\u067d","\u0633\u064a\u067e\u067d\u0645\u0628\u0631","\u0622\u06aa\u067d\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u068a\u0633\u0645\u0628\u0631"],n=["\u0622\u0686\u0631","\u0633\u0648\u0645\u0631","\u0627\u06b1\u0627\u0631\u0648","\u0627\u0631\u0628\u0639","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639","\u0687\u0646\u0687\u0631"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0627\u0684] LT",nextDay:"[\u0633\u0680\u0627\u06bb\u064a] LT",nextWeek:"dddd [\u0627\u06b3\u064a\u0646 \u0647\u0641\u062a\u064a \u062a\u064a] LT",lastDay:"[\u06aa\u0627\u0644\u0647\u0647] LT",lastWeek:"[\u06af\u0632\u0631\u064a\u0644 \u0647\u0641\u062a\u064a] dddd [\u062a\u064a] LT",sameElse:"L"},relativeTime:{future:"%s \u067e\u0648\u0621",past:"%s \u0627\u06b3",s:"\u0686\u0646\u062f \u0633\u064a\u06aa\u0646\u068a",ss:"%d \u0633\u064a\u06aa\u0646\u068a",m:"\u0647\u06aa \u0645\u0646\u067d",mm:"%d \u0645\u0646\u067d",h:"\u0647\u06aa \u06aa\u0644\u0627\u06aa",hh:"%d \u06aa\u0644\u0627\u06aa",d:"\u0647\u06aa \u068f\u064a\u0646\u0647\u0646",dd:"%d \u068f\u064a\u0646\u0647\u0646",M:"\u0647\u06aa \u0645\u0647\u064a\u0646\u0648",MM:"%d \u0645\u0647\u064a\u0646\u0627",y:"\u0647\u06aa \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},ZAMP:function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},ZUHj:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("7o/Q");class r extends i.a{constructor(e,t,n){super(),this.parent=e,this.outerValue=t,this.outerIndex=n,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}var s=n("SeVD"),o=n("HDdC");function a(e,t,n,i,a=new r(e,n,i)){if(!a.closed)return t instanceof o.a?t.subscribe(a):Object(s.a)(t)(a)}},ZUd8:function(e,t,n){var i=n("ppGB"),r=n("HYAF"),s=function(e){return function(t,n){var s,o,a=String(r(t)),c=i(n),l=a.length;return c<0||c>=l?e?"":void 0:(s=a.charCodeAt(c))<55296||s>56319||c+1===l||(o=a.charCodeAt(c+1))<56320||o>57343?e?a.charAt(c):s:e?a.slice(c,c+2):o-56320+(s-55296<<10)+65536}};e.exports={codeAt:s(!1),charAt:s(!0)}},Zduo:function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_a\u016dgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_a\u016dg_sept_okt_nov_dec".split("_"),weekdays:"diman\u0109o_lundo_mardo_merkredo_\u0135a\u016ddo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_\u0135a\u016d_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_\u0135a_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodia\u016d je] LT",nextDay:"[Morga\u016d je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hiera\u016d je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"anta\u016d %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("wd/R"))},ZfDv:function(e,t,n){var i=n("hh1v"),r=n("6LWA"),s=n("tiKp")("species");e.exports=function(e,t){var n;return r(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!r(n.prototype)?i(n)&&null===(n=n[s])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},a0VL:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("SVse");let s=(()=>{class e{constructor(e){this.datePipe=e}transform(e){return null===e||""===e?"":this.datePipe.transform(e,"shortDate")+" "+this.datePipe.transform(e,"mediumTime")}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(r.e))},e.\u0275pipe=i.Lb({name:"cdDate",type:e,pure:!0}),e})()},a96k:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e,t,n,i=!0){this.selected=e,this.name=t,this.description=n,this.enabled=i}}},aGrj:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("eIep");function r(e,t){return t?Object(i.a)(()=>e,t):Object(i.a)(()=>e)}},aIdf:function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}var n=[/^gen/i,/^c[\u02bc\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],i=/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,r=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_C\u02bchwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C\u02bchwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc\u02bcher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:r,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[\u02bc\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:r,monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc\u02bchoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec\u02bch da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s \u02bczo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(function e(t){return t>9?e(t%10):t}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(a\xf1|vet)/,ordinal:function(e){return e+(1===e?"a\xf1":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("wd/R"))},aIsn:function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-t\u0101te_Hui-tanguru_Pout\u016b-te-rangi_Paenga-wh\u0101wh\u0101_Haratua_Pipiri_H\u014dngoingoi_Here-turi-k\u014dk\u0101_Mahuru_Whiringa-\u0101-nuku_Whiringa-\u0101-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_H\u014dngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"R\u0101tapu_Mane_T\u016brei_Wenerei_T\u0101ite_Paraire_H\u0101tarei".split("_"),weekdaysShort:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),weekdaysMin:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te h\u0113kona ruarua",ss:"%d h\u0113kona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},aQkU:function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"\u0458\u0430\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d\u0438_\u0458\u0443\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u0458\u0430\u043d_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u043e\u043a_\u043f\u0435\u0442\u043e\u043a_\u0441\u0430\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u0435_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u0430\u0431".split("_"),weekdaysMin:"\u043de_\u043fo_\u0432\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441a".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u0435\u043d\u0435\u0441 \u0432\u043e] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432\u043e] LT",nextWeek:"[\u0412\u043e] dddd [\u0432\u043e] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432\u043e] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0430\u0442\u0430] dddd [\u0432\u043e] LT";case 1:case 2:case 4:case 5:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0438\u043e\u0442] dddd [\u0432\u043e] LT"}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435\u0434 %s",s:"\u043d\u0435\u043a\u043e\u043b\u043a\u0443 \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u0435\u0434\u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0435\u0434\u0435\u043d \u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0435\u0434\u0435\u043d \u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",M:"\u0435\u0434\u0435\u043d \u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0438",y:"\u0435\u0434\u043d\u0430 \u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},aXbf:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{format_number(e,t,n,i=1){if(r.a.isString(e)&&(e=Number(e)),!r.a.isNumber(e))return"-";let s=e<1?0:Math.floor(Math.log(e)/Math.log(t));s=s>=n.length?n.length-1:s;let o=r.a.round(e/Math.pow(t,s),i).toString();return""===o?"-":(""!==n[s]&&(o=`${o} ${n[s]}`),o)}toBytes(e,t=null){const n=["b","k","m","g","t","p","e","z","y"],i=RegExp("^(\\d+(.\\d+)?) ?(["+n.join("")+"]?(b|ib|B/s)?)?$","i").exec(e);if(null===i)return t;let s=parseFloat(i[1]);return r.a.isString(i[3])&&(s*=Math.pow(1024,n.indexOf(i[3].toLowerCase()[0]))),Math.round(s)}toMilliseconds(e){const t=/^\s*(\d+)\s*(ms)?\s*$/i.exec(e);return null!==t?+t[1]:0}toIops(e){const t=/^\s*(\d+)\s*(IOPS)?\s*$/i.exec(e);return null!==t?+t[1]:0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},aexS:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("2Vo4"),r=n("jKX/"),s=n("8Y7J");let o=(()=>{class e{constructor(){this.isPwdDisplayedSource=new i.a(!1),this.isPwdDisplayed$=this.isPwdDisplayedSource.asObservable()}set(e,t={},n=!1,i=null,s=!1){localStorage.setItem("dashboard_username",e),localStorage.setItem("dashboard_permissions",JSON.stringify(new r.a(t))),localStorage.setItem("user_pwd_expiration_date",String(i)),localStorage.setItem("user_pwd_update_required",String(s)),localStorage.setItem("sso",String(n))}remove(){localStorage.removeItem("dashboard_username"),localStorage.removeItem("user_pwd_expiration_data"),localStorage.removeItem("user_pwd_update_required")}isLoggedIn(){return null!==localStorage.getItem("dashboard_username")}getUsername(){return localStorage.getItem("dashboard_username")}getPermissions(){return JSON.parse(localStorage.getItem("dashboard_permissions")||JSON.stringify(new r.a({})))}getPwdExpirationDate(){return Number(localStorage.getItem("user_pwd_expiration_date"))}getPwdUpdateRequired(){return"true"===localStorage.getItem("user_pwd_update_required")}isSSO(){return"true"===localStorage.getItem("sso")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},afO8:function(e,t,n){var i,r,s,o=n("f5p1"),a=n("2oRo"),c=n("hh1v"),l=n("kRJp"),u=n("UTVS"),d=n("xs3f"),h=n("93I0"),f=n("0BK2"),p="Object already initialized";if(o||d.state){var m=d.state||(d.state=new(0,a.WeakMap)),b=m.get,g=m.has,_=m.set;i=function(e,t){if(g.call(m,e))throw new TypeError(p);return t.facade=e,_.call(m,e,t),t},r=function(e){return b.call(m,e)||{}},s=function(e){return g.call(m,e)}}else{var y=h("state");f[y]=!0,i=function(e,t){if(u(e,y))throw new TypeError(p);return t.facade=e,l(e,y,t),t},r=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:i,get:r,has:s,enforce:function(e){return s(e)?r(e):i(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},ajRT:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("8Y7J"),r=n("ANnk");const s=[[["",8,"modal-title"]],[["",8,"modal-content"]]],o=[".modal-title",".modal-content"];let a=(()=>{class e{constructor(){this.hide=new i.o}close(){var e;null===(e=this.modalRef)||void 0===e||e.close(),this.hide.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-modal"]],inputs:{modalRef:"modalRef"},outputs:{hide:"hide"},ngContentSelectors:o,decls:7,vars:0,consts:[[1,"modal-header"],[1,"modal-title","float-left"],["type","button","aria-label","Close",1,"close","float-right",3,"click"],["aria-hidden","true"]],template:function(e,t){1&e&&(i.oc(s),i.Sb(0,"div",0),i.Sb(1,"h4",1),i.nc(2),i.Rb(),i.Sb(3,"button",2),i.gc("click",(function(){return t.close()})),i.Sb(4,"span",3),i.Oc(5,"\xd7"),i.Rb(),i.Rb(),i.Rb(),i.nc(6,1))},directives:[r.a],styles:[".modal-header[_ngcontent-%COMP%]{border-radius:5px 5px 0 0}.modal-header[_ngcontent-%COMP%],   cd-modal .modal-footer{background-color:#e9ecef;border-bottom:1px solid #ced4da}  cd-modal .modal-footer{border-radius:0 0 5px 5px}  cd-modal .modal-body{max-height:70vh;overflow-x:hidden;overflow-y:auto}button.close[_ngcontent-%COMP%]{outline:none}"]}),e})()},b1Dy:function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},b5OY:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var i=n("mrSG"),r=n("IheW"),s=n("LRne"),o=n("5+tZ"),a=n("xTzq"),c=n("8Y7J");let l=(()=>{let e=class{constructor(e){this.http=e,this.url="api/perf_counters"}list(){return this.http.get(this.url)}get(e,t){return this.http.get(`${this.url}/${e}/${t}`).pipe(Object(o.a)(e=>Object(s.a)(e.counters)))}};return e.\u0275fac=function(t){return new(t||e)(c.dc(r.b))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([a.a,Object(i.d)("design:paramtypes",[r.b])],e),e})();var u=n("SVse"),d=n("uIqm"),h=n("/NlG"),f=n("o4+5");const p=["valueTpl"];function m(e,t){if(1&e&&(c.Oc(0),c.jc(1,"dimless")),2&e){const e=t.row;c.Rc(" ",c.kc(1,2,e.value)," ",e.unit," ")}}function b(e,t){if(1&e){const e=c.Tb();c.Sb(0,"cd-table",2),c.gc("fetchData",(function(t){return c.Dc(e),c.ic().getCounters(t)})),c.Mc(1,m,2,4,"ng-template",null,3,c.Nc),c.Rb()}if(2&e){const e=c.ic();c.pc("data",e.counters)("columns",e.columns)("autoSave",!1)}}function g(e,t){1&e&&(c.Sb(0,"cd-alert-panel",4),c.Wb(1,5),c.Rb())}let _=(()=>{class e{constructor(e){this.performanceCounterService=e,this.columns=[],this.counters=[]}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:1},{name:"Description",prop:"description",flexGrow:1},{name:"Value",prop:"value",cellTemplate:this.valueTpl,flexGrow:1}]}getCounters(e){this.performanceCounterService.get(this.serviceType,this.serviceId).subscribe(e=>{this.counters=e},t=>{404===t.status?(t.preventDefault(),this.counters=null):e.error()})}}return e.\u0275fac=function(t){return new(t||e)(c.Mb(l))},e.\u0275cmp=c.Gb({type:e,selectors:[["cd-table-performance-counter"]],viewQuery:function(e,t){var n;1&e&&c.Tc(p,!0),2&e&&c.zc(n=c.hc())&&(t.valueTpl=n.first)},inputs:{serviceType:"serviceType",serviceId:"serviceId"},decls:3,vars:2,consts:function(){return[["columnMode","flex",3,"data","columns","autoSave","fetchData",4,"ngIf","ngIfElse"],["warning",""],["columnMode","flex",3,"data","columns","autoSave","fetchData"],["valueTpl",""],["type","warning"],"Performance counters not available"]},template:function(e,t){if(1&e&&(c.Mc(0,b,3,3,"cd-table",0),c.Mc(1,g,2,0,"ng-template",null,1,c.Nc)),2&e){const e=c.Ac(2);c.pc("ngIf",t.counters)("ngIfElse",e)}},directives:[u.r,d.a,h.a],pipes:[f.a],styles:[""]}),e})()},bHdf:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("5+tZ"),r=n("SpAZ");function s(e=Number.POSITIVE_INFINITY){return Object(i.a)(r.a,e)}},bOMt:function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},bOdf:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("5+tZ");function r(e,t){return Object(i.a)(e,t,1)}},bWFh:function(e,t,n){"use strict";var i=n("I+eb"),r=n("2oRo"),s=n("lMq5"),o=n("busE"),a=n("8YOa"),c=n("ImZN"),l=n("GarU"),u=n("hh1v"),d=n("0Dky"),h=n("HH4o"),f=n("1E5z"),p=n("cVYH");e.exports=function(e,t,n){var m=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),g=m?"set":"add",_=r[e],y=_&&_.prototype,v=_,w={},S=function(e){var t=y[e];o(y,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(b&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return b&&!u(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(b&&!u(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(s(e,"function"!=typeof _||!(b||y.forEach&&!d((function(){(new _).entries().next()})))))v=n.getConstructor(t,e,m,g),a.REQUIRED=!0;else if(s(e,!0)){var M=new v,x=M[g](b?{}:-0,1)!=M,k=d((function(){M.has(1)})),D=h((function(e){new _(e)})),T=!b&&d((function(){for(var e=new _,t=5;t--;)e[g](t,t);return!e.has(-0)}));D||((v=t((function(t,n){l(t,v,e);var i=p(new _,t,v);return null!=n&&c(n,i[g],{that:i,AS_ENTRIES:m}),i}))).prototype=y,y.constructor=v),(k||T)&&(S("delete"),S("has"),m&&S("get")),(T||x)&&S(g),b&&y.clear&&delete y.clear}return w[e]=v,i({global:!0,forced:v!=_},w),f(v,e),b||n.setStrong(v,e,m),v}},bXm7:function(e,t,n){!function(e){"use strict";var t={0:"-\u0448\u0456",1:"-\u0448\u0456",2:"-\u0448\u0456",3:"-\u0448\u0456",4:"-\u0448\u0456",5:"-\u0448\u0456",6:"-\u0448\u044b",7:"-\u0448\u0456",8:"-\u0448\u0456",9:"-\u0448\u044b",10:"-\u0448\u044b",20:"-\u0448\u044b",30:"-\u0448\u044b",40:"-\u0448\u044b",50:"-\u0448\u0456",60:"-\u0448\u044b",70:"-\u0448\u0456",80:"-\u0448\u0456",90:"-\u0448\u044b",100:"-\u0448\u0456"};e.defineLocale("kk",{months:"\u049b\u0430\u04a3\u0442\u0430\u0440_\u0430\u049b\u043f\u0430\u043d_\u043d\u0430\u0443\u0440\u044b\u0437_\u0441\u04d9\u0443\u0456\u0440_\u043c\u0430\u043c\u044b\u0440_\u043c\u0430\u0443\u0441\u044b\u043c_\u0448\u0456\u043b\u0434\u0435_\u0442\u0430\u043c\u044b\u0437_\u049b\u044b\u0440\u043a\u04af\u0439\u0435\u043a_\u049b\u0430\u0437\u0430\u043d_\u049b\u0430\u0440\u0430\u0448\u0430_\u0436\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d".split("_"),monthsShort:"\u049b\u0430\u04a3_\u0430\u049b\u043f_\u043d\u0430\u0443_\u0441\u04d9\u0443_\u043c\u0430\u043c_\u043c\u0430\u0443_\u0448\u0456\u043b_\u0442\u0430\u043c_\u049b\u044b\u0440_\u049b\u0430\u0437_\u049b\u0430\u0440_\u0436\u0435\u043b".split("_"),weekdays:"\u0436\u0435\u043a\u0441\u0435\u043d\u0431\u0456_\u0434\u04af\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u04d9\u0440\u0441\u0435\u043d\u0431\u0456_\u0431\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0436\u04b1\u043c\u0430_\u0441\u0435\u043d\u0431\u0456".split("_"),weekdaysShort:"\u0436\u0435\u043a_\u0434\u04af\u0439_\u0441\u0435\u0439_\u0441\u04d9\u0440_\u0431\u0435\u0439_\u0436\u04b1\u043c_\u0441\u0435\u043d".split("_"),weekdaysMin:"\u0436\u043a_\u0434\u0439_\u0441\u0439_\u0441\u0440_\u0431\u0439_\u0436\u043c_\u0441\u043d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u0456\u043d \u0441\u0430\u0493\u0430\u0442] LT",nextDay:"[\u0415\u0440\u0442\u0435\u04a3 \u0441\u0430\u0493\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0493\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0448\u0435 \u0441\u0430\u0493\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u0435\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u04a3] dddd [\u0441\u0430\u0493\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0456\u0448\u0456\u043d\u0434\u0435",past:"%s \u0431\u04b1\u0440\u044b\u043d",s:"\u0431\u0456\u0440\u043d\u0435\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0456\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u0431\u0456\u0440 \u0441\u0430\u0493\u0430\u0442",hh:"%d \u0441\u0430\u0493\u0430\u0442",d:"\u0431\u0456\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0456\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0456\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0448\u0456|\u0448\u044b)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},bYM6:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},bpih:function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},busE:function(e,t,n){var i=n("2oRo"),r=n("kRJp"),s=n("UTVS"),o=n("zk60"),a=n("iSVu"),c=n("afO8"),l=c.get,u=c.enforce,d=String(String).split("String");(e.exports=function(e,t,n,a){var c,l=!!a&&!!a.unsafe,h=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof t||s(n,"name")||r(n,"name",t),(c=u(n)).source||(c.source=d.join("string"==typeof t?t:""))),e!==i?(l?!f&&e[t]&&(h=!0):delete e[t],h?e[t]=n:r(e,t,n)):h?e[t]=n:o(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||a(this)}))},bxKX:function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},c2HN:function(e,t,n){"use strict";function i(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.d(t,"a",(function(){return i}))},cEzo:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("e0ae"),r=n("oxzT"),s=n("8Y7J"),o=n("EApP"),a=n("ANnk"),c=n("SVse");const l=function(e){return[e]};let u=(()=>{class e{constructor(e){this.toastr=e,this.byId=!0,this.icons=r.a}getText(){return document.getElementById(this.source).value}onClick(){try{const e=Object(i.a)(),t=this.byId?this.getText():this.source,n=()=>{this.toastr.success("Copied text to the clipboard successfully.")};["firefox","ie","ios","safari"].includes(e.name)?navigator.clipboard.writeText(t).then(()=>n()):navigator.permissions.query({name:"clipboard-write"}).then(e=>{"granted"!==e.state&&"prompt"!==e.state||navigator.clipboard.writeText(t).then(()=>n())})}catch(e){this.toastr.error("Failed to copy text to the clipboard.")}}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(o.b))},e.\u0275cmp=s.Gb({type:e,selectors:[["cd-copy-2-clipboard-button"]],hostBindings:function(e,t){1&e&&s.gc("click",(function(){return t.onClick()}))},inputs:{source:"source",byId:"byId"},decls:3,vars:3,consts:function(){return[["type","button",1,"btn","btn-light",3,"click",6,"title"],["title","Copy to Clipboard"],[3,"ngClass"]]},template:function(e,t){1&e&&(s.Sb(0,"button",0),s.Yb(1,1),s.gc("click",(function(){return t.onClick()})),s.Nb(2,"i",2),s.Rb()),2&e&&(s.yb(2),s.pc("ngClass",s.uc(1,l,t.icons.clipboard)))},directives:[a.a,c.p],styles:[""]}),e})()},cRix:function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[\xf4fr\xfbne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien min\xfat",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},cSlR:function(e,t,n){"use strict";var i=/^(?:0|[1-9]\d*)$/;t.a=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&i.test(e))&&e>-1&&e%1==0&&e<t}},cUpR:function(e,t,n){"use strict";n.d(t,"a",(function(){return N})),n.d(t,"b",(function(){return L})),n.d(t,"c",(function(){return $})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return w}));var i=n("SVse"),r=n("8Y7J");class s extends i.J{constructor(){super()}supportsDOMEvents(){return!0}}class o extends s{static makeCurrent(){Object(i.N)(new o)}getProperty(e,t){return e[t]}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(e,t,n){return e.addEventListener(t,n,!1),()=>{e.removeEventListener(t,n,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}getValue(e){return e.value}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=c||(c=document.querySelector("base"),c)?c.getAttribute("href"):null;return null==t?null:(n=t,a||(a=document.createElement("a")),a.setAttribute("href",n),"/"===a.pathname.charAt(0)?a.pathname:"/"+a.pathname);var n}resetBaseElement(){c=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Object(i.M)(document.cookie,e)}}let a,c=null;const l=new r.r("TRANSITION_ID"),u=[{provide:r.d,useFactory:function(e,t,n){return()=>{n.get(r.e).donePromise.then(()=>{const n=Object(i.L)();Array.prototype.slice.apply(t.querySelectorAll("style[ng-transition]")).filter(t=>t.getAttribute("ng-transition")===e).forEach(e=>n.remove(e))})}},deps:[l,i.d,r.s],multi:!0}];class d{static init(){Object(r.W)(new d)}addToWindow(e){r.nb.getAngularTestability=(t,n=!0)=>{const i=e.findTestabilityInTree(t,n);if(null==i)throw new Error("Could not find testability for element.");return i},r.nb.getAllAngularTestabilities=()=>e.getAllTestabilities(),r.nb.getAllAngularRootElements=()=>e.getAllRootElements(),r.nb.frameworkStabilizers||(r.nb.frameworkStabilizers=[]),r.nb.frameworkStabilizers.push(e=>{const t=r.nb.getAllAngularTestabilities();let n=t.length,i=!1;const s=function(t){i=i||t,n--,0==n&&e(i)};t.forEach((function(e){e.whenStable(s)}))})}findTestabilityInTree(e,t,n){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:n?Object(i.L)().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}const h=new r.r("EventManagerPlugins");let f=(()=>{class e{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}addGlobalEventListener(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const n=this._plugins;for(let i=0;i<n.length;i++){const t=n[i];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error("No event manager plugin found for event "+e)}}return e.\u0275fac=function(t){return new(t||e)(r.dc(h),r.dc(r.A))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();class p{constructor(e){this._doc=e}addGlobalEventListener(e,t,n){const r=Object(i.L)().getGlobalEventTarget(this._doc,e);if(!r)throw new Error(`Unsupported event target ${r} for event ${t}`);return this.addEventListener(r,t,n)}}let m=(()=>{class e{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})(),b=(()=>{class e extends m{constructor(e){super(),this._doc=e,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(e.head)}_addStylesToHost(e,t){e.forEach(e=>{const n=this._doc.createElement("style");n.textContent=e,this._styleNodes.add(t.appendChild(n))})}addHost(e){this._addStylesToHost(this._stylesSet,e),this._hostNodes.add(e)}removeHost(e){this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach(t=>this._addStylesToHost(e,t))}ngOnDestroy(){this._styleNodes.forEach(e=>Object(i.L)().remove(e))}}return e.\u0275fac=function(t){return new(t||e)(r.dc(i.d))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();const g={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},_=/%COMP%/g;function y(e,t,n){for(let i=0;i<t.length;i++){let r=t[i];Array.isArray(r)?y(e,r,n):(r=r.replace(_,e),n.push(r))}return n}function v(e){return t=>{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let w=(()=>{class e{constructor(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new S(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case r.Q.Emulated:{let n=this.rendererByCompId.get(t.id);return n||(n=new M(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,n)),n.applyToHost(e),n}case r.Q.Native:case r.Q.ShadowDom:return new x(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=y(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(t){return new(t||e)(r.dc(f),r.dc(b),r.dc(r.c))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();class S{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(g[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,n){e&&e.insertBefore(t,n)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error(`The selector "${e}" did not match any elements`);return t||(n.textContent=""),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,i){if(i){t=i+":"+t;const r=g[i];r?e.setAttributeNS(r,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){const i=g[n];i?e.removeAttributeNS(i,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,i){i&r.G.DashCase?e.style.setProperty(t,n,i&r.G.Important?"important":""):e.style[t]=n}removeStyle(e,t,n){n&r.G.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,n){e[t]=n}setValue(e,t){e.nodeValue=t}listen(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,v(n)):this.eventManager.addEventListener(e,t,v(n))}}class M extends S{constructor(e,t,n,i){super(e),this.component=n;const r=y(i+"-"+n.id,n.styles,[]);t.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(_,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(_,i+"-"+n.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,""),n}}class x extends S{constructor(e,t,n,i){super(e),this.sharedStylesHost=t,this.hostEl=n,this.component=i,this.shadowRoot=i.encapsulation===r.Q.ShadowDom?n.attachShadow({mode:"open"}):n.createShadowRoot(),this.sharedStylesHost.addHost(this.shadowRoot);const s=y(i.id,i.styles,[]);for(let r=0;r<s.length;r++){const e=document.createElement("style");e.textContent=s[r],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}let k=(()=>{class e extends p{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,n){return e.addEventListener(t,n,!1),()=>this.removeEventListener(e,t,n)}removeEventListener(e,t,n){return e.removeEventListener(t,n)}}return e.\u0275fac=function(t){return new(t||e)(r.dc(i.d))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();const D=["alt","control","meta","shift"],T={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},C={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},O={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let R=(()=>{class e extends p{constructor(e){super(e)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,n,r){const s=e.parseEventName(n),o=e.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Object(i.L)().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const n=t.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=e._normalizeKey(n.pop());let s="";if(D.forEach(e=>{const t=n.indexOf(e);t>-1&&(n.splice(t,1),s+=e+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(e){let t="",n=function(e){let t=e.key;if(null==t){if(t=e.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&C.hasOwnProperty(t)&&(t=C[t]))}return T[t]||t}(e);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),D.forEach(i=>{i!=n&&(0,O[i])(e)&&(t+=i+".")}),t+=n,t}static eventCallback(t,n,i){return r=>{e.getEventFullKey(r)===t&&i.runGuarded(()=>n(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return e.\u0275fac=function(t){return new(t||e)(r.dc(i.d))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})(),L=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Ib)({factory:function(){return Object(r.dc)(A)},token:e,providedIn:"root"}),e})();function E(e){return new A(e.get(i.d))}let A=(()=>{class e extends L{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case r.I.NONE:return t;case r.I.HTML:return Object(r.cb)(t,"HTML")?Object(r.ub)(t):Object(r.ab)(this._doc,String(t));case r.I.STYLE:return Object(r.cb)(t,"Style")?Object(r.ub)(t):t;case r.I.SCRIPT:if(Object(r.cb)(t,"Script"))return Object(r.ub)(t);throw new Error("unsafe value used in a script context");case r.I.URL:return Object(r.mb)(t),Object(r.cb)(t,"URL")?Object(r.ub)(t):Object(r.bb)(String(t));case r.I.RESOURCE_URL:if(Object(r.cb)(t,"ResourceURL"))return Object(r.ub)(t);throw new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see http://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return Object(r.db)(e)}bypassSecurityTrustStyle(e){return Object(r.gb)(e)}bypassSecurityTrustScript(e){return Object(r.fb)(e)}bypassSecurityTrustUrl(e){return Object(r.hb)(e)}bypassSecurityTrustResourceUrl(e){return Object(r.eb)(e)}}return e.\u0275fac=function(t){return new(t||e)(r.dc(i.d))},e.\u0275prov=Object(r.Ib)({factory:function(){return E(Object(r.dc)(r.p))},token:e,providedIn:"root"}),e})();const I=[{provide:r.C,useValue:i.K},{provide:r.D,useValue:function(){o.makeCurrent(),d.init()},multi:!0},{provide:i.d,useFactory:function(){return Object(r.sb)(document),document},deps:[]}],P=Object(r.R)(r.V,"browser",I),j=[[],{provide:r.Y,useValue:"root"},{provide:r.n,useFactory:function(){return new r.n},deps:[]},{provide:h,useClass:k,multi:!0,deps:[i.d,r.A,r.C]},{provide:h,useClass:R,multi:!0,deps:[i.d]},[],{provide:w,useClass:w,deps:[f,b,r.c]},{provide:r.F,useExisting:w},{provide:m,useExisting:b},{provide:b,useClass:b,deps:[i.d]},{provide:r.M,useClass:r.M,deps:[r.A]},{provide:f,useClass:f,deps:[h,r.A]},[]];let N=(()=>{class e{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:e,providers:[{provide:r.c,useValue:t.appId},{provide:l,useExisting:r.c},u]}}}return e.\u0275mod=r.Kb({type:e}),e.\u0275inj=r.Jb({factory:function(t){return new(t||e)(r.dc(e,12))},providers:j,imports:[i.c,r.f]}),e})();const F="undefined"!=typeof window&&window||{};class Y{constructor(e,t){this.msPerTick=e,this.numTicks=t}}class z{constructor(e){this.appRef=e.injector.get(r.g)}timeChangeDetection(e){const t=e&&e.record,n="Change Detection",r=null!=F.console.profile;t&&r&&F.console.profile(n);const s=Object(i.L)().performanceNow();let o=0;for(;o<5||Object(i.L)().performanceNow()-s<500;)this.appRef.tick(),o++;const a=Object(i.L)().performanceNow();t&&r&&F.console.profileEnd(n);const c=(a-s)/o;return F.console.log(`ran ${o} change detection cycles`),F.console.log(c.toFixed(2)+" ms per check"),new Y(c,o)}}function $(e){return"profiler",t=new z(e),"undefined"!=typeof COMPILED&&COMPILED||((r.nb.ng=r.nb.ng||{}).profiler=t),e;var t}},cVYH:function(e,t,n){var i=n("hh1v"),r=n("0rvr");e.exports=function(e,t,n){var s,o;return r&&"function"==typeof(s=t.constructor)&&s!==n&&i(o=s.prototype)&&o!==n.prototype&&r(e,o),e}},cp0P:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("HDdC"),r=n("DH7j"),s=n("lJxs"),o=n("XoHu"),a=n("Cfvw");function c(...e){if(1===e.length){const t=e[0];if(Object(r.a)(t))return l(t,null);if(Object(o.a)(t)&&Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);return l(e.map(e=>t[e]),e)}}if("function"==typeof e[e.length-1]){const t=e.pop();return l(e=1===e.length&&Object(r.a)(e[0])?e[0]:e,null).pipe(Object(s.a)(e=>t(...e)))}return l(e,null)}function l(e,t){return new i.a(n=>{const i=e.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let c=0;c<i;c++){const l=Object(a.a)(e[c]);let u=!1;n.add(l.subscribe({next:e=>{u||(u=!0,o++),r[c]=e},error:e=>n.error(e),complete:()=>{s++,s!==i&&u||(o===i&&n.next(t?t.reduce((e,t,n)=>(e[t]=r[n],e),{}):r),n.complete())}}))}})}},czMo:function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},"d+Og":function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("LvDl"),r=n.n(i),s=n("kJI8");let o=(()=>{class e{constructor(e){if(this.type=e,!this.isValidType())throw new Error("Wrong placement group category type");this.setTypeStates()}isValidType(){return e.VALID_CATEGORIES.includes(this.type)}setTypeStates(){switch(this.type){case e.CATEGORY_CLEAN:this.states=["active","clean"];break;case e.CATEGORY_WORKING:this.states=["activating","backfill_wait","backfilling","creating","deep","degraded","forced_backfill","forced_recovery","peering","peered","recovering","recovery_wait","repair","scrubbing","snaptrim","snaptrim_wait"];break;case e.CATEGORY_WARNING:this.states=["backfill_toofull","backfill_unfound","down","incomplete","inconsistent","recovery_toofull","recovery_unfound","remapped","snaptrim_error","stale","undersized"];break;default:this.states=[]}}}return e.CATEGORY_CLEAN="clean",e.CATEGORY_WORKING="working",e.CATEGORY_WARNING="warning",e.CATEGORY_UNKNOWN="unknown",e.VALID_CATEGORIES=[e.CATEGORY_CLEAN,e.CATEGORY_WORKING,e.CATEGORY_WARNING,e.CATEGORY_UNKNOWN],e})();var a=n("8Y7J");let c=(()=>{class e{constructor(){this.categories=this.createCategories()}getAllTypes(){return o.VALID_CATEGORIES}getTypeByStates(e){const t=this.getPgStatesFromText(e);if(0===t.length)return o.CATEGORY_UNKNOWN;const n=r.a.zipObject(o.VALID_CATEGORIES,o.VALID_CATEGORIES.map(e=>r.a.intersection(this.categories[e].states,t).length));if(n[o.CATEGORY_WARNING]>0)return o.CATEGORY_WARNING;const i=n[o.CATEGORY_WORKING];return t.length>n[o.CATEGORY_CLEAN]+i?o.CATEGORY_UNKNOWN:i?o.CATEGORY_WORKING:o.CATEGORY_CLEAN}createCategories(){return r.a.zipObject(o.VALID_CATEGORIES,o.VALID_CATEGORIES.map(e=>new o(e)))}getPgStatesFromText(e){const t=e.replace(/[^a-z]+/g," ").trim().split(" ");return r.a.uniq(t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=a.Ib({token:e,factory:e.\u0275fac,providedIn:s.a}),e})()},"dBg+":function(e,t){t.f=Object.getOwnPropertySymbols},dEH0:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){return e+" ms"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"milliseconds",type:e,pure:!0}),e})()},dLWn:function(e,t,n){"use strict";var i=Function.prototype.toString;t.a=function(e){if(null!=e){try{return i.call(e)}catch(t){}try{return e+""}catch(t){}}return""}},dNwA:function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("wd/R"))},dgut:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("NEZu"),r=n("Fgil"),s=n("8Y7J"),o=n("SVse"),a=n("hrfs");const c=["sparkCanvas"],l=["sparkTooltip"];let u=(()=>{class e{constructor(e){this.dimlessBinaryPipe=e,this.style={height:"30px",width:"100px"},this.colors=[{backgroundColor:"rgba(40,140,234,0.2)",borderColor:"rgba(40,140,234,1)",pointBackgroundColor:"rgba(40,140,234,1)",pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:"rgba(40,140,234,0.8)"}],this.options={animation:{duration:0},responsive:!0,maintainAspectRatio:!1,legend:{display:!1},elements:{line:{borderWidth:1}},tooltips:{enabled:!1,mode:"index",intersect:!1,custom:void 0,callbacks:{label:e=>this.isBinary?this.dimlessBinaryPipe.transform(e.yLabel):e.yLabel,title:()=>""}},scales:{yAxes:[{display:!1}],xAxes:[{display:!1}]}},this.datasets=[{data:[]}],this.labels=[]}ngOnInit(){const e=new i.a(this.chartCanvasRef,this.chartTooltipRef,(e,t)=>t+e.caretX+"px",e=>e.caretY-e.height-e.yPadding-5+"px");e.customColors={backgroundColor:this.colors[0].pointBackgroundColor,borderColor:this.colors[0].pointBorderColor},this.options.tooltips.custom=t=>{e.customTooltips(t)}}ngOnChanges(e){this.datasets[0].data=e.data.currentValue,this.labels=[...Array(e.data.currentValue.length)]}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(r.a))},e.\u0275cmp=s.Gb({type:e,selectors:[["cd-sparkline"]],viewQuery:function(e,t){var n;1&e&&(s.Jc(c,!0),s.Jc(l,!0)),2&e&&(s.zc(n=s.hc())&&(t.chartCanvasRef=n.first),s.zc(n=s.hc())&&(t.chartTooltipRef=n.first))},inputs:{data:"data",style:"style",isBinary:"isBinary"},features:[s.wb],decls:6,vars:6,consts:[[1,"chart-container",3,"ngStyle"],["baseChart","",3,"labels","datasets","options","colors","chartType"],["sparkCanvas",""],[1,"chartjs-tooltip"],["sparkTooltip",""]],template:function(e,t){1&e&&(s.Sb(0,"div",0),s.Nb(1,"canvas",1,2),s.Sb(3,"div",3,4),s.Nb(5,"table"),s.Rb(),s.Rb()),2&e&&(s.pc("ngStyle",t.style),s.yb(1),s.pc("labels",t.labels)("datasets",t.datasets)("options",t.options)("colors",t.colors)("chartType","line"))},directives:[o.s,a.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:rgba(0,0,0,.7);border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid transparent;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-container[_ngcontent-%COMP%]{position:static!important}']}),e})()},"e+ae":function(e,t,n){!function(e){"use strict";var t="janu\xe1r_febru\xe1r_marec_apr\xedl_m\xe1j_j\xfan_j\xfal_august_september_okt\xf3ber_november_december".split("_"),n="jan_feb_mar_apr_m\xe1j_j\xfan_j\xfal_aug_sep_okt_nov_dec".split("_");function i(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"p\xe1r sek\xfand":"p\xe1r sekundami";case"ss":return t||r?s+(i(e)?"sekundy":"sek\xfand"):s+"sekundami";case"m":return t?"min\xfata":r?"min\xfatu":"min\xfatou";case"mm":return t||r?s+(i(e)?"min\xfaty":"min\xfat"):s+"min\xfatami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(i(e)?"hodiny":"hod\xedn"):s+"hodinami";case"d":return t||r?"de\u0148":"d\u0148om";case"dd":return t||r?s+(i(e)?"dni":"dn\xed"):s+"d\u0148ami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(i(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(i(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nede\u013ea_pondelok_utorok_streda_\u0161tvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_\u0161t_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_\u0161t_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nede\u013eu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo \u0161tvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[v\u010dera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minul\xfa nede\u013eu o] LT";case 1:case 2:return"[minul\xfd] dddd [o] LT";case 3:return"[minul\xfa stredu o] LT";case 4:case 5:return"[minul\xfd] dddd [o] LT";case 6:return"[minul\xfa sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},e0ae:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=function(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"},r=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},s=function(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"},o=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},a=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],u=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function d(e){return e?h(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new a:"undefined"!=typeof navigator?h(navigator.userAgent):"undefined"!=typeof process&&process.version?new r(process.version.slice(1)):null}function h(e){var t=function(e){return""!==e&&l.reduce((function(t,n){var i=n[0];if(t)return t;var r=n[1].exec(e);return!!r&&[i,r]}),!1)}(e);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new o;var a=r[1]&&r[1].split(/[._]/).slice(0,3);a?a.length<3&&(a=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,r++)i[r]=s[o];return i}(a,function(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}(3-a.length))):a=[];var d=a.join("."),h=function(e){for(var t=0,n=u.length;t<n;t++){var i=u[t],r=i[0];if(i[1].exec(e))return r}return null}(e),f=c.exec(e);return f&&f[1]?new s(n,d,h,f[1]):new i(n,d,h)}},e2NH:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e="light",t=""){this.type=e,this.msg=t}}},eAQQ:function(e,t,n){"use strict";t.a=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},"eDl+":function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},eIep:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("lJxs"),r=n("Cfvw"),s=n("zx2A");function o(e,t){return"function"==typeof t?n=>n.pipe(o((n,s)=>Object(r.a)(e(n,s)).pipe(Object(i.a)((e,i)=>t(n,e,s,i))))):t=>t.lift(new a(e))}class a{constructor(e){this.project=e}call(e,t){return t.subscribe(new c(e,this.project))}}class c extends s.b{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const n=new s.a(this),i=this.destination;i.add(n),this.innerSubscription=Object(s.c)(e,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}},efK2:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t,n){return r.a.isString(e)?(n=r.a.defaultTo(n,""),r.a.truncate(e,{length:t,omission:n})):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"truncate",type:e,pure:!0}),e})()},"ej+x":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("lOp/"),r=n("8Y7J"),s=n("IheW");let o=(()=>{class e{constructor(e,t){this.http=e,this.timerService=t,this.API_URL="api/feature_toggles",this.REFRESH_INTERVAL=3e4,this.featureToggleMap$=this.timerService.get(()=>this.http.get(this.API_URL),this.REFRESH_INTERVAL)}get(){return this.featureToggleMap$}}return e.\u0275fac=function(t){return new(t||e)(r.dc(s.b),r.dc(i.a))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},ewvW:function(e,t,n){var i=n("HYAF");e.exports=function(e){return Object(i(e))}},"f/UV":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","cdFormScope",""]],inputs:{cdFormScope:"cdFormScope"}}),e})()},f5p1:function(e,t,n){var i=n("2oRo"),r=n("iSVu"),s=i.WeakMap;e.exports="function"==typeof s&&/native code/.test(r(s))},f69J:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("s7LF");let s=(()=>{class e{constructor(e){this.parent=e}get validClass(){return!!this.control&&this.control.valid&&(this.control.touched||this.control.dirty)}get invalidClass(){return!!this.control&&this.control.invalid&&this.control.touched&&this.control.dirty}get path(){return[...this.parent.path,this.formControlName]}get control(){return this.formDirective&&this.formDirective.getControl(this)}get formDirective(){return this.parent?this.parent.formDirective:null}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(r.c,13))},e.\u0275dir=i.Hb({type:e,selectors:[["",8,"form-control"],["",8,"form-check-input"],["",8,"custom-control-input"]],hostVars:4,hostBindings:function(e,t){2&e&&i.Eb("is-valid",t.validClass)("is-invalid",t.invalidClass)},inputs:{formControlName:"formControlName",formControl:"formControl"}}),e})()},fHMY:function(e,t,n){var i,r=n("glrk"),s=n("N+g0"),o=n("eDl+"),a=n("0BK2"),c=n("G+Rx"),l=n("zBJ4"),u=n("93I0")("IE_PROTO"),d=function(){},h=function(e){return"<script>"+e+"<\/script>"},f=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(r){}var e,t;f=i?function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t}(i):((t=l("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F);for(var n=o.length;n--;)delete f.prototype[o[n]];return f()};a[u]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(d.prototype=r(e),n=new d,d.prototype=null,n[u]=e):n=f(),void 0===t?n:s(n,t)}},fdAy:function(e,t,n){"use strict";var i=n("I+eb"),r=n("ntOU"),s=n("4WOD"),o=n("0rvr"),a=n("1E5z"),c=n("kRJp"),l=n("busE"),u=n("tiKp"),d=n("xDBR"),h=n("P4y1"),f=n("rpNk"),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,b=u("iterator"),g="keys",_="values",y="entries",v=function(){return this};e.exports=function(e,t,n,u,f,w,S){r(n,t,u);var M,x,k,D=function(e){if(e===f&&L)return L;if(!m&&e in O)return O[e];switch(e){case g:case _:case y:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",C=!1,O=e.prototype,R=O[b]||O["@@iterator"]||f&&O[f],L=!m&&R||D(f),E="Array"==t&&O.entries||R;if(E&&(M=s(E.call(new e)),p!==Object.prototype&&M.next&&(d||s(M)===p||(o?o(M,p):"function"!=typeof M[b]&&c(M,b,v)),a(M,T,!0,!0),d&&(h[T]=v))),f==_&&R&&R.name!==_&&(C=!0,L=function(){return R.call(this)}),d&&!S||O[b]===L||c(O,b,L),h[t]=L,f)if(x={values:D(_),keys:w?L:D(g),entries:D(y)},S)for(k in x)(m||C||!(k in O))&&l(O,k,x[k]);else i({target:t,proto:!0,forced:m||C},x);return x}},fzPg:function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"S\u1eb9\u0301r\u1eb9\u0301_E\u0300re\u0300le\u0300_\u1eb8r\u1eb9\u0300na\u0300_I\u0300gbe\u0301_E\u0300bibi_O\u0300ku\u0300du_Ag\u1eb9mo_O\u0300gu\u0301n_Owewe_\u1ecc\u0300wa\u0300ra\u0300_Be\u0301lu\u0301_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),monthsShort:"S\u1eb9\u0301r_E\u0300rl_\u1eb8rn_I\u0300gb_E\u0300bi_O\u0300ku\u0300_Ag\u1eb9_O\u0300gu\u0301_Owe_\u1ecc\u0300wa\u0300_Be\u0301l_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),weekdays:"A\u0300i\u0300ku\u0301_Aje\u0301_I\u0300s\u1eb9\u0301gun_\u1eccj\u1ecd\u0301ru\u0301_\u1eccj\u1ecd\u0301b\u1ecd_\u1eb8ti\u0300_A\u0300ba\u0301m\u1eb9\u0301ta".split("_"),weekdaysShort:"A\u0300i\u0300k_Aje\u0301_I\u0300s\u1eb9\u0301_\u1eccjr_\u1eccjb_\u1eb8ti\u0300_A\u0300ba\u0301".split("_"),weekdaysMin:"A\u0300i\u0300_Aj_I\u0300s_\u1eccr_\u1eccb_\u1eb8t_A\u0300b".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[O\u0300ni\u0300 ni] LT",nextDay:"[\u1ecc\u0300la ni] LT",nextWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301n'b\u1ecd] [ni] LT",lastDay:"[A\u0300na ni] LT",lastWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301l\u1ecd\u0301] [ni] LT",sameElse:"L"},relativeTime:{future:"ni\u0301 %s",past:"%s k\u1ecdja\u0301",s:"i\u0300s\u1eb9ju\u0301 aaya\u0301 die",ss:"aaya\u0301 %d",m:"i\u0300s\u1eb9ju\u0301 kan",mm:"i\u0300s\u1eb9ju\u0301 %d",h:"wa\u0301kati kan",hh:"wa\u0301kati %d",d:"\u1ecdj\u1ecd\u0301 kan",dd:"\u1ecdj\u1ecd\u0301 %d",M:"osu\u0300 kan",MM:"osu\u0300 %d",y:"\u1ecddu\u0301n kan",yy:"\u1ecddu\u0301n %d"},dayOfMonthOrdinalParse:/\u1ecdj\u1ecd\u0301\s\d{1,2}/,ordinal:"\u1ecdj\u1ecd\u0301 %d",week:{dow:1,doy:4}})}(n("wd/R"))},"g6v/":function(e,t,n){var i=n("0Dky");e.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},gRHU:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("2fFW"),r=n("NJ4a");const s={closed:!0,next(e){},error(e){if(i.a.useDeprecatedSynchronousErrorHandling)throw e;Object(r.a)(e)},complete(){}}},gVVK:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r=e+" ";switch(n){case"s":return t||i?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||i?"sekundi":"sekundah":e<5?t||i?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||i?"minuti":"minutama":e<5?t||i?"minute":"minutami":t||i?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||i?"uri":"urama":e<5?t||i?"ure":"urami":t||i?"ur":"urami");case"d":return t||i?"en dan":"enim dnem";case"dd":return r+(1===e?t||i?"dan":"dnem":2===e?t||i?"dni":"dnevoma":t||i?"dni":"dnevi");case"M":return t||i?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||i?"mesec":"mesecem":2===e?t||i?"meseca":"mesecema":e<5?t||i?"mesece":"meseci":t||i?"mesecev":"meseci");case"y":return t||i?"eno leto":"enim letom";case"yy":return r+(1===e?t||i?"leto":"letom":2===e?t||i?"leti":"letoma":e<5?t||i?"leta":"leti":t||i?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_\u010detrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._\u010det._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_\u010de_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[v\u010deraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prej\u0161njo] [nedeljo] [ob] LT";case 3:return"[prej\u0161njo] [sredo] [ob] LT";case 6:return"[prej\u0161njo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prej\u0161nji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"\u010dez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},gekB:function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme nelj\xe4 viisi kuusi seitsem\xe4n kahdeksan yhdeks\xe4n".split(" "),n=["nolla","yhden","kahden","kolmen","nelj\xe4n","viiden","kuuden",t[7],t[8],t[9]];function i(e,i,r,s){var o="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":o=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":o=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":o=s?"tunnin":"tuntia";break;case"d":return s?"p\xe4iv\xe4n":"p\xe4iv\xe4";case"dd":o=s?"p\xe4iv\xe4n":"p\xe4iv\xe4\xe4";break;case"M":return s?"kuukauden":"kuukausi";case"MM":o=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":o=s?"vuoden":"vuotta"}return function(e,i){return e<10?i?n[e]:t[e]:e}(e,s)+" "+o}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xe4kuu_hein\xe4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kes\xe4_hein\xe4_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[t\xe4n\xe4\xe4n] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s p\xe4\xe4st\xe4",past:"%s sitten",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},gjCT:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"};e.defineLocale("ar-sa",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:0,doy:6}})}(n("wd/R"))},glrk:function(e,t,n){var i=n("hh1v");e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},"hKI/":function(e,t){var n="Expected a function",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype.toString,h=Math.max,f=Math.min,p=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||o.test(e)?a(e.slice(2),n?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,i){var r=!0,s=!0;if("function"!=typeof e)throw new TypeError(n);return m(i)&&(r="leading"in i?!!i.leading:r,s="trailing"in i?!!i.trailing:s),function(e,t,i){var r,s,o,a,c,l,u=0,d=!1,g=!1,_=!0;if("function"!=typeof e)throw new TypeError(n);function y(t){var n=r,i=s;return r=s=void 0,u=t,a=e.apply(i,n)}function v(e){return u=e,c=setTimeout(S,t),d?y(e):a}function w(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-u>=o}function S(){var e=p();if(w(e))return M(e);c=setTimeout(S,function(e){var n=t-(e-l);return g?f(n,o-(e-u)):n}(e))}function M(e){return c=void 0,_&&r?y(e):(r=s=void 0,a)}function x(){var e=p(),n=w(e);if(r=arguments,s=this,l=e,n){if(void 0===c)return v(l);if(g)return c=setTimeout(S,t),y(l)}return void 0===c&&(c=setTimeout(S,t)),a}return t=b(t)||0,m(i)&&(d=!!i.leading,o=(g="maxWait"in i)?h(b(i.maxWait)||0,t):o,_="trailing"in i?!!i.trailing:_),x.cancel=function(){void 0!==c&&clearTimeout(c),u=0,r=l=s=c=void 0},x.flush=function(){return void 0===c?a:M(p())},x}(e,t,{leading:r,maxWait:t,trailing:s})}},hKrs:function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"\u044f\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u044f\u043d\u0443_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u044f\u0434\u0430_\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a_\u043f\u0435\u0442\u044a\u043a_\u0441\u044a\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u044f_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u044a\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u043d\u0435\u0441 \u0432] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432] LT",nextWeek:"dddd [\u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u041c\u0438\u043d\u0430\u043b\u0430\u0442\u0430] dddd [\u0432] LT";case 1:case 2:case 4:case 5:return"[\u041c\u0438\u043d\u0430\u043b\u0438\u044f] dddd [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0441\u043b\u0435\u0434 %s",past:"\u043f\u0440\u0435\u0434\u0438 %s",s:"\u043d\u044f\u043a\u043e\u043b\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",w:"\u0441\u0435\u0434\u043c\u0438\u0446\u0430",ww:"%d \u0441\u0435\u0434\u043c\u0438\u0446\u0438",M:"\u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0430",y:"\u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},hYPf:function(e,t,n){"use strict";var i=n("IzLi"),r=Object.create,s=function(){function e(){}return function(t){if(!Object(i.a)(t))return{};if(r)return r(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),o=n("UudT"),a=n("pyRK");t.a=function(e){return"function"!=typeof e.constructor||Object(a.a)(e)?{}:s(Object(o.a)(e))}},hh1v:function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},honF:function(e,t,n){!function(e){"use strict";var t={1:"\u1041",2:"\u1042",3:"\u1043",4:"\u1044",5:"\u1045",6:"\u1046",7:"\u1047",8:"\u1048",9:"\u1049",0:"\u1040"},n={"\u1041":"1","\u1042":"2","\u1043":"3","\u1044":"4","\u1045":"5","\u1046":"6","\u1047":"7","\u1048":"8","\u1049":"9","\u1040":"0"};e.defineLocale("my",{months:"\u1007\u1014\u103a\u1014\u101d\u102b\u101b\u102e_\u1016\u1031\u1016\u1031\u102c\u103a\u101d\u102b\u101b\u102e_\u1019\u1010\u103a_\u1027\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u1007\u1030\u101c\u102d\u102f\u1004\u103a_\u101e\u103c\u1002\u102f\u1010\u103a_\u1005\u1000\u103a\u1010\u1004\u103a\u1018\u102c_\u1021\u1031\u102c\u1000\u103a\u1010\u102d\u102f\u1018\u102c_\u1014\u102d\u102f\u101d\u1004\u103a\u1018\u102c_\u1012\u102e\u1007\u1004\u103a\u1018\u102c".split("_"),monthsShort:"\u1007\u1014\u103a_\u1016\u1031_\u1019\u1010\u103a_\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u101c\u102d\u102f\u1004\u103a_\u101e\u103c_\u1005\u1000\u103a_\u1021\u1031\u102c\u1000\u103a_\u1014\u102d\u102f_\u1012\u102e".split("_"),weekdays:"\u1010\u1014\u1004\u103a\u1039\u1002\u1014\u103d\u1031_\u1010\u1014\u1004\u103a\u1039\u101c\u102c_\u1021\u1004\u103a\u1039\u1002\u102b_\u1017\u102f\u1012\u1039\u1013\u101f\u1030\u1038_\u1000\u103c\u102c\u101e\u1015\u1010\u1031\u1038_\u101e\u1031\u102c\u1000\u103c\u102c_\u1005\u1014\u1031".split("_"),weekdaysShort:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),weekdaysMin:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u101a\u1014\u1031.] LT [\u1019\u103e\u102c]",nextDay:"[\u1019\u1014\u1000\u103a\u1016\u103c\u1014\u103a] LT [\u1019\u103e\u102c]",nextWeek:"dddd LT [\u1019\u103e\u102c]",lastDay:"[\u1019\u1014\u1031.\u1000] LT [\u1019\u103e\u102c]",lastWeek:"[\u1015\u103c\u102e\u1038\u1001\u1032\u1037\u101e\u1031\u102c] dddd LT [\u1019\u103e\u102c]",sameElse:"L"},relativeTime:{future:"\u101c\u102c\u1019\u100a\u103a\u1037 %s \u1019\u103e\u102c",past:"\u101c\u103d\u1014\u103a\u1001\u1032\u1037\u101e\u1031\u102c %s \u1000",s:"\u1005\u1000\u1039\u1000\u1014\u103a.\u1021\u1014\u100a\u103a\u1038\u1004\u101a\u103a",ss:"%d \u1005\u1000\u1039\u1000\u1014\u1037\u103a",m:"\u1010\u1005\u103a\u1019\u102d\u1014\u1005\u103a",mm:"%d \u1019\u102d\u1014\u1005\u103a",h:"\u1010\u1005\u103a\u1014\u102c\u101b\u102e",hh:"%d \u1014\u102c\u101b\u102e",d:"\u1010\u1005\u103a\u101b\u1000\u103a",dd:"%d \u101b\u1000\u103a",M:"\u1010\u1005\u103a\u101c",MM:"%d \u101c",y:"\u1010\u1005\u103a\u1014\u103e\u1005\u103a",yy:"%d \u1014\u103e\u1005\u103a"},preparse:function(e){return e.replace(/[\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049\u1040]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("wd/R"))},hrfs:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return g}));var i=n("8Y7J"),r=n("2Vo4"),s=n("CfRg"),o=n("MO+k");const a=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]];function c(e,t){return"rgba("+e.concat(t).join(",")+")"}function l(e,t){return Math.floor(Math.random()*(t-e+1))+e}function u(e){return{backgroundColor:e.map(e=>c(e,.6)),borderColor:e.map(()=>"#fff"),pointBackgroundColor:e.map(e=>c(e,1)),pointBorderColor:e.map(()=>"#fff"),pointHoverBackgroundColor:e.map(e=>c(e,1)),pointHoverBorderColor:e.map(e=>c(e,1))}}function d(){return[l(0,255),l(0,255),l(0,255)]}function h(e){return a[e]||d()}function f(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=a[n]||d();return t}let p=(()=>{class e{constructor(){this.pColorschemesOptions={},this.colorschemesOptions=new r.a({})}setColorschemesOptions(e){this.pColorschemesOptions=e,this.colorschemesOptions.next(e)}getColorschemesOptions(){return this.pColorschemesOptions}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const m=function(){var e={Default:0,Update:1,Refresh:2};return e[e.Default]="Default",e[e.Update]="Update",e[e.Refresh]="Refresh",e}();let b=(()=>{class e{constructor(e,t){this.element=e,this.themeService=t,this.options={},this.chartClick=new i.o,this.chartHover=new i.o,this.old={dataExists:!1,dataLength:0,datasetsExists:!1,datasetsLength:0,datasetsDataObjects:[],datasetsDataLengths:[],colorsExists:!1,colors:[],labelsExist:!1,labels:[],legendExists:!1,legend:{}},this.subs=[]}static registerPlugin(e){o.pluginService.register(e)}static unregisterPlugin(e){o.pluginService.unregister(e)}ngOnInit(){this.ctx=this.element.nativeElement.getContext("2d"),this.refresh(),this.subs.push(this.themeService.colorschemesOptions.subscribe(e=>this.themeChanged(e)))}themeChanged(e){this.refresh()}ngDoCheck(){if(!this.chart)return;let e=m.Default;const t=t=>{e=t>e?t:e};switch(!!this.data!==this.old.dataExists&&(this.propagateDataToDatasets(this.data),this.old.dataExists=!!this.data,t(m.Update)),this.data&&this.data.length!==this.old.dataLength&&(this.old.dataLength=this.data&&this.data.length||0,t(m.Update)),!!this.datasets!==this.old.datasetsExists&&(this.old.datasetsExists=!!this.datasets,t(m.Update)),this.datasets&&this.datasets.length!==this.old.datasetsLength&&(this.old.datasetsLength=this.datasets&&this.datasets.length||0,t(m.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data!==this.old.datasetsDataObjects[t]).length&&(this.old.datasetsDataObjects=this.datasets.map(e=>e.data),t(m.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data.length!==this.old.datasetsDataLengths[t]).length&&(this.old.datasetsDataLengths=this.datasets.map(e=>e.data.length),t(m.Update)),!!this.colors!==this.old.colorsExists&&(this.old.colorsExists=!!this.colors,this.updateColors(),t(m.Update)),this.colors&&this.colors.filter((e,t)=>!this.colorsEqual(e,this.old.colors[t])).length&&(this.old.colors=this.colors.map(e=>this.copyColor(e)),this.updateColors(),t(m.Update)),!!this.labels!==this.old.labelsExist&&(this.old.labelsExist=!!this.labels,t(m.Update)),this.labels&&this.labels.filter((e,t)=>!this.labelsEqual(e,this.old.labels[t])).length&&(this.old.labels=this.labels.map(e=>this.copyLabel(e)),t(m.Update)),!!this.options.legend!==this.old.legendExists&&(this.old.legendExists=!!this.options.legend,t(m.Refresh)),this.options.legend&&this.options.legend.position!==this.old.legend.position&&(this.old.legend.position=this.options.legend.position,t(m.Refresh)),e){case m.Default:break;case m.Update:this.update();break;case m.Refresh:this.refresh()}}copyLabel(e){return Array.isArray(e)?[...e]:e}labelsEqual(e,t){return Array.isArray(e)===Array.isArray(t)&&(Array.isArray(e)||e===t)&&(!Array.isArray(e)||e.length===t.length)&&(!Array.isArray(e)||0===e.filter((e,n)=>e!==t[n]).length)}copyColor(e){return{backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderColor:e.borderColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,pointBorderColor:e.pointBorderColor,pointBackgroundColor:e.pointBackgroundColor,pointBorderWidth:e.pointBorderWidth,pointRadius:e.pointRadius,pointHoverRadius:e.pointHoverRadius,pointHitRadius:e.pointHitRadius,pointHoverBackgroundColor:e.pointHoverBackgroundColor,pointHoverBorderColor:e.pointHoverBorderColor,pointHoverBorderWidth:e.pointHoverBorderWidth,pointStyle:e.pointStyle,hoverBackgroundColor:e.hoverBackgroundColor,hoverBorderColor:e.hoverBorderColor,hoverBorderWidth:e.hoverBorderWidth}}colorsEqual(e,t){return!e==!t&&(!e||e.backgroundColor===t.backgroundColor&&e.borderWidth===t.borderWidth&&e.borderColor===t.borderColor&&e.borderCapStyle===t.borderCapStyle&&e.borderDash===t.borderDash&&e.borderDashOffset===t.borderDashOffset&&e.borderJoinStyle===t.borderJoinStyle&&e.pointBorderColor===t.pointBorderColor&&e.pointBackgroundColor===t.pointBackgroundColor&&e.pointBorderWidth===t.pointBorderWidth&&e.pointRadius===t.pointRadius&&e.pointHoverRadius===t.pointHoverRadius&&e.pointHitRadius===t.pointHitRadius&&e.pointHoverBackgroundColor===t.pointHoverBackgroundColor&&e.pointHoverBorderColor===t.pointHoverBorderColor&&e.pointHoverBorderWidth===t.pointHoverBorderWidth&&e.pointStyle===t.pointStyle&&e.hoverBackgroundColor===t.hoverBackgroundColor&&e.hoverBorderColor===t.hoverBorderColor&&e.hoverBorderWidth===t.hoverBorderWidth)}updateColors(){this.datasets.forEach((e,t)=>{this.colors&&this.colors[t]?Object.assign(e,this.colors[t]):Object.assign(e,function(e,t,n){if("pie"===e||"doughnut"===e)return u(f(n));if("polarArea"===e)return{backgroundColor:(i=f(n)).map(e=>c(e,.6)),borderColor:i.map(e=>c(e,1)),hoverBackgroundColor:i.map(e=>c(e,.8)),hoverBorderColor:i.map(e=>c(e,1))};var i;if("line"===e||"radar"===e)return function(e){return{backgroundColor:c(e,.4),borderColor:c(e,1),pointBackgroundColor:c(e,1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:c(e,.8)}}(h(t));if("bar"===e||"horizontalBar"===e)return function(e){return{backgroundColor:c(e,.6),borderColor:c(e,1),hoverBackgroundColor:c(e,.8),hoverBorderColor:c(e,1)}}(h(t));if("bubble"===e)return u(f(n));if("scatter"===e)return u(f(n));throw new Error("getColors - Unsupported chart type "+e)}(this.chartType,t,e.data.length),Object.assign({},e))})}ngOnChanges(e){let t=m.Default;const n=e=>{t=e>t?e:t};switch(e.hasOwnProperty("data")&&e.data.currentValue&&(this.propagateDataToDatasets(e.data.currentValue),n(m.Update)),e.hasOwnProperty("datasets")&&e.datasets.currentValue&&(this.propagateDatasetsToData(e.datasets.currentValue),n(m.Update)),e.hasOwnProperty("labels")&&(this.chart&&(this.chart.data.labels=e.labels.currentValue),n(m.Update)),e.hasOwnProperty("legend")&&(this.chart&&(this.chart.config.options.legend.display=e.legend.currentValue,this.chart.generateLegend()),n(m.Update)),e.hasOwnProperty("options")&&n(m.Refresh),t){case m.Update:this.update();break;case m.Refresh:case m.Default:this.refresh()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(e=>e.unsubscribe())}update(e){if(this.chart)return this.chart.update(e)}hideDataset(e,t){this.chart.getDatasetMeta(e).hidden=t,this.chart.update()}isDatasetHidden(e){return this.chart.getDatasetMeta(e).hidden}toBase64Image(){return this.chart.toBase64Image()}getChartConfiguration(){const e=this.getDatasets(),t=Object.assign({},this.options);!1===this.legend&&(t.legend={display:!1}),t.hover=t.hover||{},t.hover.onHover||(t.hover.onHover=(e,t)=>{t&&!t.length||this.chartHover.emit({event:e,active:t})}),t.onClick||(t.onClick=(e,t)=>{this.chartClick.emit({event:e,active:t})});const n=this.smartMerge(t,this.themeService.getColorschemesOptions());return{type:this.chartType,data:{labels:this.labels||[],datasets:e},plugins:this.plugins,options:n}}getChartBuilder(e){const t=this.getChartConfiguration();return new o.Chart(e,t)}smartMerge(e,t,n=0){var i;if(0===n&&(i=e,e=Object(s.a)(i,5)),Object.keys(t).forEach(i=>{if(Array.isArray(t[i])){const r=e[i];r&&r.forEach(e=>{this.smartMerge(e,t[i][0],n+1)})}else"object"==typeof t[i]?(i in e||(e[i]={}),this.smartMerge(e[i],t[i],n+1)):e[i]=t[i]}),0===n)return e}isMultiLineLabel(e){return Array.isArray(e)}joinLabel(e){return e?this.isMultiLineLabel(e)?e.join(" "):e:null}propagateDatasetsToData(e){this.data=this.datasets.map(e=>e.data),this.chart&&(this.chart.data.datasets=e),this.updateColors()}propagateDataToDatasets(e){this.isMultiDataSet(e)?this.datasets&&e.length===this.datasets.length?this.datasets.forEach((t,n)=>{t.data=e[n]}):(this.datasets=e.map((e,t)=>({data:e,label:this.joinLabel(this.labels[t])||"Label "+t})),this.chart&&(this.chart.data.datasets=this.datasets)):this.datasets?(this.datasets[0]||(this.datasets[0]={}),this.datasets[0].data=e,this.datasets.splice(1)):(this.datasets=[{data:e}],this.chart&&(this.chart.data.datasets=this.datasets)),this.updateColors()}isMultiDataSet(e){return Array.isArray(e[0])}getDatasets(){if(!this.datasets&&!this.data)throw new Error("ng-charts configuration error, data or datasets field are required to render chart "+this.chartType);return this.datasets?(this.propagateDatasetsToData(this.datasets),this.datasets):this.data?(this.propagateDataToDatasets(this.data),this.datasets):void 0}refresh(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.ctx&&(this.chart=this.getChartBuilder(this.ctx))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(p))},e.\u0275dir=i.Hb({type:e,selectors:[["canvas","baseChart",""]],inputs:{options:"options",data:"data",datasets:"datasets",labels:"labels",chartType:"chartType",colors:"colors",legend:"legend",plugins:"plugins"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[i.wb]}),e})(),g=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[]]}),e})()},iEDd:function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xu\xf1o_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xu\xf1._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_m\xe9rcores_xoves_venres_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._m\xe9r._xov._ven._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_m\xe9_xo_ve_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextDay:function(){return"[ma\xf1\xe1 "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"\xe1s":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"\xe1":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"\xe1s":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},iExv:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e,t="Yes",n="No"){return Boolean(e)?t:n}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"booleanText",type:e,pure:!0}),e})()},iInd:function(e,t,n){"use strict";n.d(t,"a",(function(){return Pe})),n.d(t,"b",(function(){return P})),n.d(t,"c",(function(){return I})),n.d(t,"d",(function(){return sn})),n.d(t,"e",(function(){return Qt})),n.d(t,"f",(function(){return Kt})),n.d(t,"g",(function(){return en})),n.d(t,"h",(function(){return Zt})),n.d(t,"i",(function(){return fn})),n.d(t,"j",(function(){return tn}));var i=n("SVse"),r=n("8Y7J"),s=n("LRne"),o=n("Cfvw"),a=n("2Vo4"),c=n("itXk"),l=n("HDdC"),u=n("sVev"),d=n("EY2u");function h(e){return new l.a(t=>{let n;try{n=e()}catch(i){return void t.error(i)}return(n?Object(o.a)(n):Object(d.b)()).subscribe(t)})}var f=n("XNiG"),p=n("lJxs"),m=n("0EUg"),b=n("NJ9Y"),g=n("eIep"),_=n("IzEk"),y=n("JX91"),v=n("Kqap"),w=n("pLZG"),S=n("JIr8"),M=n("bOdf"),x=n("SxV6"),k=n("5+tZ"),D=n("vkgz"),T=n("BFxc"),C=n("7o/Q"),O=n("quSY");class R{constructor(e){this.callback=e}call(e,t){return t.subscribe(new L(e,this.callback))}}class L extends C.a{constructor(e,t){super(e),this.add(new O.a(t))}}var E=n("bHdf");class A{constructor(e,t){this.id=e,this.url=t}}class I extends A{constructor(e,t,n="imperative",i=null){super(e,t),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class P extends A{constructor(e,t,n){super(e,t),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class j extends A{constructor(e,t,n){super(e,t),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class N extends A{constructor(e,t,n){super(e,t),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class F extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Y extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class z extends A{constructor(e,t,n,i,r){super(e,t),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class $ extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class H extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class W{constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class V{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class B{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class U{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class G{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class q{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class J{constructor(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const Q="primary";class K{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function Z(e){return new K(e)}function X(e){const t=Error("NavigationCancelingError: "+e);return t.ngNavigationCancelingError=!0,t}function ee(e,t,n){const i=n.path.split("/");if(i.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||i.length<e.length))return null;const r={};for(let s=0;s<i.length;s++){const t=i[s],n=e[s];if(t.startsWith(":"))r[t.substring(1)]=n;else if(t!==n.path)return null}return{consumed:e.slice(0,i.length),posParams:r}}function te(e,t){const n=Object.keys(e),i=Object.keys(t);if(!n||!i||n.length!=i.length)return!1;let r;for(let s=0;s<n.length;s++)if(r=n[s],!ne(e[r],t[r]))return!1;return!0}function ne(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;const n=[...e].sort(),i=[...t].sort();return n.every((e,t)=>i[t]===e)}return e===t}function ie(e){return Array.prototype.concat.apply([],e)}function re(e){return e.length>0?e[e.length-1]:null}function se(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function oe(e){return Object(r.pb)(e)?e:Object(r.qb)(e)?Object(o.a)(Promise.resolve(e)):Object(s.a)(e)}function ae(e,t,n){return n?function(e,t){return te(e,t)}(e.queryParams,t.queryParams)&&function e(t,n){if(!de(t.segments,n.segments))return!1;if(t.numberOfChildren!==n.numberOfChildren)return!1;for(const i in n.children){if(!t.children[i])return!1;if(!e(t.children[i],n.children[i]))return!1}return!0}(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>ne(e[n],t[n]))}(e.queryParams,t.queryParams)&&function e(t,n){return function t(n,i,r){if(n.segments.length>r.length)return!!de(n.segments.slice(0,r.length),r)&&!i.hasChildren();if(n.segments.length===r.length){if(!de(n.segments,r))return!1;for(const t in i.children){if(!n.children[t])return!1;if(!e(n.children[t],i.children[t]))return!1}return!0}{const e=r.slice(0,n.segments.length),s=r.slice(n.segments.length);return!!de(n.segments,e)&&!!n.children.primary&&t(n.children.primary,i,s)}}(t,n,n.segments)}(e.root,t.root)}class ce{constructor(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Z(this.queryParams)),this._queryParamMap}toString(){return me.serialize(this)}}class le{constructor(e,t){this.segments=e,this.children=t,this.parent=null,se(t,(e,t)=>e.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return be(this)}}class ue{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=Z(this.parameters)),this._parameterMap}toString(){return Se(this)}}function de(e,t){return e.length===t.length&&e.every((e,n)=>e.path===t[n].path)}function he(e,t){let n=[];return se(e.children,(e,i)=>{i===Q&&(n=n.concat(t(e,i)))}),se(e.children,(e,i)=>{i!==Q&&(n=n.concat(t(e,i)))}),n}class fe{}class pe{parse(e){const t=new Te(e);return new ce(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){return`${"/"+function e(t,n){if(!t.hasChildren())return be(t);if(n){const n=t.children.primary?e(t.children.primary,!1):"",i=[];return se(t.children,(t,n)=>{n!==Q&&i.push(`${n}:${e(t,!1)}`)}),i.length>0?`${n}(${i.join("//")})`:n}{const n=he(t,(n,i)=>i===Q?[e(t.children.primary,!1)]:[`${i}:${e(n,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children.primary?`${be(t)}/${n[0]}`:`${be(t)}/(${n.join("//")})`}}(e.root,!0)}${function(e){const t=Object.keys(e).map(t=>{const n=e[t];return Array.isArray(n)?n.map(e=>`${_e(t)}=${_e(e)}`).join("&"):`${_e(t)}=${_e(n)}`});return t.length?"?"+t.join("&"):""}(e.queryParams)}${"string"==typeof e.fragment?"#"+encodeURI(e.fragment):""}`}}const me=new pe;function be(e){return e.segments.map(e=>Se(e)).join("/")}function ge(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function _e(e){return ge(e).replace(/%3B/gi,";")}function ye(e){return ge(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ve(e){return decodeURIComponent(e)}function we(e){return ve(e.replace(/\+/g,"%20"))}function Se(e){return`${ye(e.path)}${t=e.parameters,Object.keys(t).map(e=>`;${ye(e)}=${ye(t[e])}`).join("")}`;var t}const Me=/^[^\/()?;=#]+/;function xe(e){const t=e.match(Me);return t?t[0]:""}const ke=/^[^=?&#]+/,De=/^[^?&#]+/;class Te{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new le([],{}):new le([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n.primary=new le(e,t)),n}parseSegment(){const e=xe(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new ue(ve(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=xe(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=xe(this.remaining);e&&(n=e,this.capture(n))}e[ve(t)]=ve(n)}parseQueryParam(e){const t=function(e){const t=e.match(ke);return t?t[0]:""}(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=function(e){const t=e.match(De);return t?t[0]:""}(this.remaining);e&&(n=e,this.capture(n))}const i=we(t),r=we(n);if(e.hasOwnProperty(i)){let t=e[i];Array.isArray(t)||(t=[t],e[i]=t),t.push(r)}else e[i]=r}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=xe(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):e&&(r=Q);const s=this.parseChildren();t[r]=1===Object.keys(s).length?s.primary:new le([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class Ce{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Oe(e,this._root);return t?t.children.map(e=>e.value):[]}firstChild(e){const t=Oe(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Re(e,this._root);return t.length<2?[]:t[t.length-2].children.map(e=>e.value).filter(t=>t!==e)}pathFromRoot(e){return Re(e,this._root).map(e=>e.value)}}function Oe(e,t){if(e===t.value)return t;for(const n of t.children){const t=Oe(e,n);if(t)return t}return null}function Re(e,t){if(e===t.value)return[t];for(const n of t.children){const i=Re(e,n);if(i.length)return i.unshift(t),i}return[]}class Le{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Ee(e){const t={};return e&&e.children.forEach(e=>t[e.value.outlet]=e),t}class Ae extends Ce{constructor(e,t){super(e),this.snapshot=t,Ye(this,e)}toString(){return this.snapshot.toString()}}function Ie(e,t){const n=function(e,t){const n=new Ne([],{},{},"",{},Q,t,null,e.root,-1,{});return new Fe("",new Le(n,[]))}(e,t),i=new a.a([new ue("",{})]),r=new a.a({}),s=new a.a({}),o=new a.a({}),c=new a.a(""),l=new Pe(i,r,o,c,s,Q,t,n.root);return l.snapshot=n.root,new Ae(new Le(l,[]),n)}class Pe{constructor(e,t,n,i,r,s,o,a){this.url=e,this.params=t,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Object(p.a)(e=>Z(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(p.a)(e=>Z(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function je(e,t="emptyOnly"){const n=e.pathFromRoot;let i=0;if("always"!==t)for(i=n.length-1;i>=1;){const e=n[i],t=n[i-1];if(e.routeConfig&&""===e.routeConfig.path)i--;else{if(t.component)break;i--}}return function(e){return e.reduce((e,t)=>({params:Object.assign(Object.assign({},e.params),t.params),data:Object.assign(Object.assign({},e.data),t.data),resolve:Object.assign(Object.assign({},e.resolve),t._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class Ne{constructor(e,t,n,i,r,s,o,a,c,l,u){this.url=e,this.params=t,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=c,this._lastPathIndex=l,this._resolve=u}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Z(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Z(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(e=>e.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Fe extends Ce{constructor(e,t){super(t),this.url=e,Ye(this,t)}toString(){return ze(this._root)}}function Ye(e,t){t.value._routerState=e,t.children.forEach(t=>Ye(e,t))}function ze(e){const t=e.children.length>0?` { ${e.children.map(ze).join(", ")} } `:"";return`${e.value}${t}`}function $e(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,te(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),te(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!te(e[n],t[n]))return!1;return!0}(t.url,n.url)||e.url.next(n.url),te(t.data,n.data)||e.data.next(n.data)}else e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data)}function He(e,t){var n,i;return te(e.params,t.params)&&de(n=e.url,i=t.url)&&n.every((e,t)=>te(e.parameters,i[t].parameters))&&!(!e.parent!=!t.parent)&&(!e.parent||He(e.parent,t.parent))}function We(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Ve(e,t,n,i,r){let s={};return i&&se(i,(e,t)=>{s[t]=Array.isArray(e)?e.map(e=>""+e):""+e}),new ce(n.root===e?t:function e(t,n,i){const r={};return se(t.children,(t,s)=>{r[s]=t===n?i:e(t,n,i)}),new le(t.segments,r)}(n.root,e,t),s,r)}class Be{constructor(e,t,n){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=n,e&&n.length>0&&We(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(e=>"object"==typeof e&&null!=e&&e.outlets);if(i&&i!==re(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Ue{constructor(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}function Ge(e){return"object"==typeof e&&null!=e&&e.outlets?e.outlets.primary:""+e}function qe(e,t,n){if(e||(e=new le([],{})),0===e.segments.length&&e.hasChildren())return Je(e,t,n);const i=function(e,t,n){let i=0,r=t;const s={match:!1,pathIndex:0,commandIndex:0};for(;r<e.segments.length;){if(i>=n.length)return s;const t=e.segments[r],o=Ge(n[i]),a=i<n.length-1?n[i+1]:null;if(r>0&&void 0===o)break;if(o&&a&&"object"==typeof a&&void 0===a.outlets){if(!Xe(o,a,t))return s;i+=2}else{if(!Xe(o,{},t))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(e,t,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex<e.segments.length){const t=new le(e.segments.slice(0,i.pathIndex),{});return t.children.primary=new le(e.segments.slice(i.pathIndex),e.children),Je(t,0,r)}return i.match&&0===r.length?new le(e.segments,{}):i.match&&!e.hasChildren()?Qe(e,t,n):i.match?Je(e,0,r):Qe(e,t,n)}function Je(e,t,n){if(0===n.length)return new le(e.segments,{});{const i=function(e){return"object"==typeof e[0]&&null!==e[0]&&e[0].outlets?e[0].outlets:{[Q]:e}}(n),r={};return se(i,(n,i)=>{null!==n&&(r[i]=qe(e.children[i],t,n))}),se(e.children,(e,t)=>{void 0===i[t]&&(r[t]=e)}),new le(e.segments,r)}}function Qe(e,t,n){const i=e.segments.slice(0,t);let r=0;for(;r<n.length;){if("object"==typeof n[r]&&null!==n[r]&&void 0!==n[r].outlets){const e=Ke(n[r].outlets);return new le(i,e)}if(0===r&&We(n[0])){i.push(new ue(e.segments[t].path,n[0])),r++;continue}const s=Ge(n[r]),o=r<n.length-1?n[r+1]:null;s&&o&&We(o)?(i.push(new ue(s,Ze(o))),r+=2):(i.push(new ue(s,{})),r++)}return new le(i,{})}function Ke(e){const t={};return se(e,(e,n)=>{null!==e&&(t[n]=Qe(new le([],{}),0,e))}),t}function Ze(e){const t={};return se(e,(e,n)=>t[n]=""+e),t}function Xe(e,t,n){return e==n.path&&te(t,n.parameters)}class et{constructor(e,t,n,i){this.routeReuseStrategy=e,this.futureState=t,this.currState=n,this.forwardEvent=i}activate(e){const t=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,n,e),$e(this.futureState.root),this.activateChildRoutes(t,n,e)}deactivateChildRoutes(e,t,n){const i=Ee(t);e.children.forEach(e=>{const t=e.value.outlet;this.deactivateRoutes(e,i[t],n),delete i[t]}),se(i,(e,t)=>{this.deactivateRouteAndItsChildren(e,n)})}deactivateRoutes(e,t,n){const i=e.value,r=t?t.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(e,t,r.children)}else this.deactivateChildRoutes(e,t,n);else r&&this.deactivateRouteAndItsChildren(t,n)}deactivateRouteAndItsChildren(e,t){this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const n=t.getContext(e.value.outlet);if(n&&n.outlet){const t=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:t,route:e,contexts:i})}}deactivateRouteAndOutlet(e,t){const n=t.getContext(e.value.outlet);if(n){const i=Ee(e),r=e.value.component?n.children:t;se(i,(e,t)=>this.deactivateRouteAndItsChildren(e,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(e,t,n){const i=Ee(t);e.children.forEach(e=>{this.activateRoutes(e,i[e.value.outlet],n),this.forwardEvent(new q(e.value.snapshot))}),e.children.length&&this.forwardEvent(new U(e.value.snapshot))}activateRoutes(e,t,n){const i=e.value,r=t?t.value:null;if($e(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,r.children)}else this.activateChildRoutes(e,t,n);else if(i.component){const t=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const e=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),t.children.onOutletReAttached(e.contexts),t.attachRef=e.componentRef,t.route=e.route.value,t.outlet&&t.outlet.attach(e.componentRef,e.route.value),tt(e.route)}else{const n=function(e){for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;t.attachRef=null,t.route=i,t.resolver=r,t.outlet&&t.outlet.activateWith(i,r),this.activateChildRoutes(e,null,t.children)}}else this.activateChildRoutes(e,null,n)}}function tt(e){$e(e.value),e.children.forEach(tt)}class nt{constructor(e,t){this.routes=e,this.module=t}}function it(e){return"function"==typeof e}function rt(e){return e instanceof ce}const st=Symbol("INITIAL_VALUE");function ot(){return Object(g.a)(e=>Object(c.a)(...e.map(e=>e.pipe(Object(_.a)(1),Object(y.a)(st)))).pipe(Object(v.a)((e,t)=>{let n=!1;return t.reduce((e,i,r)=>{if(e!==st)return e;if(i===st&&(n=!0),!n){if(!1===i)return i;if(r===t.length-1||rt(i))return i}return e},e)},st),Object(w.a)(e=>e!==st),Object(p.a)(e=>rt(e)?e:!0===e),Object(_.a)(1)))}class at{constructor(e){this.segmentGroup=e||null}}class ct{constructor(e){this.urlTree=e}}function lt(e){return new l.a(t=>t.error(new at(e)))}function ut(e){return new l.a(t=>t.error(new ct(e)))}function dt(e){return new l.a(t=>t.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${e}'`)))}class ht{constructor(e,t,n,i,s){this.configLoader=t,this.urlSerializer=n,this.urlTree=i,this.config=s,this.allowRedirects=!0,this.ngModule=e.get(r.y)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Q).pipe(Object(p.a)(e=>this.createUrlTree(e,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Object(S.a)(e=>{if(e instanceof ct)return this.allowRedirects=!1,this.match(e.urlTree);if(e instanceof at)throw this.noMatchError(e);throw e}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,Q).pipe(Object(p.a)(t=>this.createUrlTree(t,e.queryParams,e.fragment))).pipe(Object(S.a)(e=>{if(e instanceof at)throw this.noMatchError(e);throw e}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,n){const i=e.segments.length>0?new le([],{[Q]:e}):e;return new ce(i,t,n)}expandSegmentGroup(e,t,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Object(p.a)(e=>new le([],e))):this.expandSegment(e,n,t,n.segments,i,!0)}expandChildren(e,t,n){return function(e,t){if(0===Object.keys(e).length)return Object(s.a)({});const n=[],i=[],r={};return se(e,(e,s)=>{const o=t(s,e).pipe(Object(p.a)(e=>r[s]=e));s===Q?n.push(o):i.push(o)}),s.a.apply(null,n.concat(i)).pipe(Object(m.a)(),Object(b.a)(),Object(p.a)(()=>r))}(n.children,(n,i)=>this.expandSegmentGroup(e,t,i,n))}expandSegment(e,t,n,i,r,o){return Object(s.a)(...n).pipe(Object(M.a)(a=>this.expandSegmentAgainstRoute(e,t,n,a,i,r,o).pipe(Object(S.a)(e=>{if(e instanceof at)return Object(s.a)(null);throw e}))),Object(x.a)(e=>!!e),Object(S.a)((e,n)=>{if(e instanceof u.a||"EmptyError"===e.name){if(this.noLeftoversInUrl(t,i,r))return Object(s.a)(new le([],{}));throw new at(t)}throw e}))}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}expandSegmentAgainstRoute(e,t,n,i,r,s,o){return bt(i)!==s?lt(t):void 0===i.redirectTo?this.matchSegmentAgainstRoute(e,t,i,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s):lt(t)}expandSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?ut(r):this.lineralizeSegments(n,r).pipe(Object(k.a)(n=>{const r=new le(n,{});return this.expandSegment(e,r,t,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:c,positionalParamSegments:l}=ft(t,i,r);if(!o)return lt(t);const u=this.applyRedirectCommands(a,i.redirectTo,l);return i.redirectTo.startsWith("/")?ut(u):this.lineralizeSegments(i,u).pipe(Object(k.a)(i=>this.expandSegment(e,t,n,i.concat(r.slice(c)),s,!1)))}matchSegmentAgainstRoute(e,t,n,i){if("**"===n.path)return n.loadChildren?this.configLoader.load(e.injector,n).pipe(Object(p.a)(e=>(n._loadedConfig=e,new le(i,{})))):Object(s.a)(new le(i,{}));const{matched:r,consumedSegments:o,lastChild:a}=ft(t,n,i);if(!r)return lt(t);const c=i.slice(a);return this.getChildConfig(e,n,i).pipe(Object(k.a)(e=>{const n=e.module,i=e.routes,{segmentGroup:r,slicedSegments:a}=function(e,t,n,i){return n.length>0&&function(e,t,n){return n.some(n=>mt(e,t,n)&&bt(n)!==Q)}(e,n,i)?{segmentGroup:pt(new le(t,function(e,t){const n={};n.primary=t;for(const i of e)""===i.path&&bt(i)!==Q&&(n[bt(i)]=new le([],{}));return n}(i,new le(n,e.children)))),slicedSegments:[]}:0===n.length&&function(e,t,n){return n.some(n=>mt(e,t,n))}(e,n,i)?{segmentGroup:pt(new le(e.segments,function(e,t,n,i){const r={};for(const s of n)mt(e,t,s)&&!i[bt(s)]&&(r[bt(s)]=new le([],{}));return Object.assign(Object.assign({},i),r)}(e,n,i,e.children))),slicedSegments:n}:{segmentGroup:e,slicedSegments:n}}(t,o,c,i);return 0===a.length&&r.hasChildren()?this.expandChildren(n,i,r).pipe(Object(p.a)(e=>new le(o,e))):0===i.length&&0===a.length?Object(s.a)(new le(o,{})):this.expandSegment(n,r,i,a,Q,!0).pipe(Object(p.a)(e=>new le(o.concat(e.segments),e.children)))}))}getChildConfig(e,t,n){return t.children?Object(s.a)(new nt(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?Object(s.a)(t._loadedConfig):this.runCanLoadGuards(e.injector,t,n).pipe(Object(k.a)(n=>n?this.configLoader.load(e.injector,t).pipe(Object(p.a)(e=>(t._loadedConfig=e,e))):function(e){return new l.a(t=>t.error(X(`Cannot load children because the guard of the route "path: '${e.path}'" returned false`)))}(t))):Object(s.a)(new nt([],e))}runCanLoadGuards(e,t,n){const i=t.canLoad;if(!i||0===i.length)return Object(s.a)(!0);const r=i.map(i=>{const r=e.get(i);let s;if(function(e){return e&&it(e.canLoad)}(r))s=r.canLoad(t,n);else{if(!it(r))throw new Error("Invalid CanLoad guard");s=r(t,n)}return oe(s)});return Object(s.a)(r).pipe(ot(),Object(D.a)(e=>{if(!rt(e))return;const t=X(`Redirecting to "${this.urlSerializer.serialize(e)}"`);throw t.url=e,t}),Object(p.a)(e=>!0===e))}lineralizeSegments(e,t){let n=[],i=t.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return Object(s.a)(n);if(i.numberOfChildren>1||!i.children.primary)return dt(e.redirectTo);i=i.children.primary}}applyRedirectCommands(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)}applyRedirectCreatreUrlTree(e,t,n,i){const r=this.createSegmentGroup(e,t.root,n,i);return new ce(r,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const n={};return se(e,(e,i)=>{if("string"==typeof e&&e.startsWith(":")){const r=e.substring(1);n[i]=t[r]}else n[i]=e}),n}createSegmentGroup(e,t,n,i){const r=this.createSegments(e,t.segments,n,i);let s={};return se(t.children,(t,r)=>{s[r]=this.createSegmentGroup(e,t,n,i)}),new le(r,s)}createSegments(e,t,n,i){return t.map(t=>t.path.startsWith(":")?this.findPosParam(e,t,i):this.findOrReturn(t,n))}findPosParam(e,t,n){const i=n[t.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return i}findOrReturn(e,t){let n=0;for(const i of t){if(i.path===e.path)return t.splice(n),i;n++}return e}}function ft(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};const i=(t.matcher||ee)(n,e,t);return i?{matched:!0,consumedSegments:i.consumed,lastChild:i.consumed.length,positionalParamSegments:i.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function pt(e){if(1===e.numberOfChildren&&e.children.primary){const t=e.children.primary;return new le(e.segments.concat(t.segments),t.children)}return e}function mt(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function bt(e){return e.outlet||Q}class gt{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class _t{constructor(e,t){this.component=e,this.route=t}}function yt(e,t,n){const i=e._root;return function e(t,n,i,r,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=Ee(n);return t.children.forEach(t=>{!function(t,n,i,r,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=t.value,a=n?n.value:null,c=i?i.getContext(t.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){const l=function(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!de(e.url,t.url);case"pathParamsOrQueryParamsChange":return!de(e.url,t.url)||!te(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!He(e,t)||!te(e.queryParams,t.queryParams);case"paramsChange":default:return!He(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new gt(r)):(o.data=a.data,o._resolvedData=a._resolvedData),e(t,n,o.component?c?c.children:null:i,r,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new _t(c.outlet.component,a))}else a&&wt(n,c,s),s.canActivateChecks.push(new gt(r)),e(t,null,o.component?c?c.children:null:i,r,s)}(t,o[t.value.outlet],i,r.concat([t.value]),s),delete o[t.value.outlet]}),se(o,(e,t)=>wt(e,i.getContext(t),s)),s}(i,t?t._root:null,n,[i.value])}function vt(e,t,n){const i=function(e){if(!e)return null;for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(t);return(i?i.module.injector:n).get(e)}function wt(e,t,n){const i=Ee(e),r=e.value;se(i,(e,i)=>{wt(e,r.component?t?t.children.getContext(i):null:t,n)}),n.canDeactivateChecks.push(new _t(r.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,r))}function St(e,t){return null!==e&&t&&t(new G(e)),Object(s.a)(!0)}function Mt(e,t){return null!==e&&t&&t(new B(e)),Object(s.a)(!0)}function xt(e,t,n){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return Object(s.a)(!0);const r=i.map(i=>h(()=>{const r=vt(i,t,n);let s;if(function(e){return e&&it(e.canActivate)}(r))s=oe(r.canActivate(t,e));else{if(!it(r))throw new Error("Invalid CanActivate guard");s=oe(r(t,e))}return s.pipe(Object(x.a)())}));return Object(s.a)(r).pipe(ot())}function kt(e,t,n){const i=t[t.length-1],r=t.slice(0,t.length-1).reverse().map(e=>function(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(e)).filter(e=>null!==e).map(t=>h(()=>{const r=t.guards.map(r=>{const s=vt(r,t.node,n);let o;if(function(e){return e&&it(e.canActivateChild)}(s))o=oe(s.canActivateChild(i,e));else{if(!it(s))throw new Error("Invalid CanActivateChild guard");o=oe(s(i,e))}return o.pipe(Object(x.a)())});return Object(s.a)(r).pipe(ot())}));return Object(s.a)(r).pipe(ot())}class Dt{}class Tt{constructor(e,t,n,i,r,s){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){try{const e=Rt(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,Q),n=new Ne([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},Q,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new Le(n,t),r=new Fe(this.url,i);return this.inheritParamsAndData(r._root),Object(s.a)(r)}catch(e){return new l.a(t=>t.error(e))}}inheritParamsAndData(e){const t=e.value,n=je(t,this.paramsInheritanceStrategy);t.params=Object.freeze(n.params),t.data=Object.freeze(n.data),e.children.forEach(e=>this.inheritParamsAndData(e))}processSegmentGroup(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)}processChildren(e,t){const n=he(t,(t,n)=>this.processSegmentGroup(e,t,n));return function(e){const t={};e.forEach(e=>{const n=t[e.value.outlet];if(n){const t=n.url.map(e=>e.toString()).join("/"),i=e.value.url.map(e=>e.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${t}' and '${i}'.`)}t[e.value.outlet]=e.value})}(n),n.sort((e,t)=>e.value.outlet===Q?-1:t.value.outlet===Q?1:e.value.outlet.localeCompare(t.value.outlet)),n}processSegment(e,t,n,i){for(const s of e)try{return this.processSegmentAgainstRoute(s,t,n,i)}catch(r){if(!(r instanceof Dt))throw r}if(this.noLeftoversInUrl(t,n,i))return[];throw new Dt}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}processSegmentAgainstRoute(e,t,n,i){if(e.redirectTo)throw new Dt;if((e.outlet||Q)!==i)throw new Dt;let r,s=[],o=[];if("**"===e.path){const s=n.length>0?re(n).parameters:{};r=new Ne(n,s,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,At(e),i,e.component,e,Ct(t),Ot(t)+n.length,It(e))}else{const a=function(e,t,n){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new Dt;return{consumedSegments:[],lastChild:0,parameters:{}}}const i=(t.matcher||ee)(n,e,t);if(!i)throw new Dt;const r={};se(i.posParams,(e,t)=>{r[t]=e.path});const s=i.consumed.length>0?Object.assign(Object.assign({},r),i.consumed[i.consumed.length-1].parameters):r;return{consumedSegments:i.consumed,lastChild:i.consumed.length,parameters:s}}(t,e,n);s=a.consumedSegments,o=n.slice(a.lastChild),r=new Ne(s,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,At(e),i,e.component,e,Ct(t),Ot(t)+s.length,It(e))}const a=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),{segmentGroup:c,slicedSegments:l}=Rt(t,s,o,a,this.relativeLinkResolution);if(0===l.length&&c.hasChildren()){const e=this.processChildren(a,c);return[new Le(r,e)]}if(0===a.length&&0===l.length)return[new Le(r,[])];const u=this.processSegment(a,c,l,Q);return[new Le(r,u)]}}function Ct(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function Ot(e){let t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift?t._segmentIndexShift:0;return n-1}function Rt(e,t,n,i,r){if(n.length>0&&function(e,t,n){return n.some(n=>Lt(e,t,n)&&Et(n)!==Q)}(e,n,i)){const r=new le(t,function(e,t,n,i){const r={};r.primary=i,i._sourceSegment=e,i._segmentIndexShift=t.length;for(const s of n)if(""===s.path&&Et(s)!==Q){const n=new le([],{});n._sourceSegment=e,n._segmentIndexShift=t.length,r[Et(s)]=n}return r}(e,t,i,new le(n,e.children)));return r._sourceSegment=e,r._segmentIndexShift=t.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return n.some(n=>Lt(e,t,n))}(e,n,i)){const s=new le(e.segments,function(e,t,n,i,r,s){const o={};for(const a of i)if(Lt(e,n,a)&&!r[Et(a)]){const n=new le([],{});n._sourceSegment=e,n._segmentIndexShift="legacy"===s?e.segments.length:t.length,o[Et(a)]=n}return Object.assign(Object.assign({},r),o)}(e,t,n,i,e.children,r));return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}const s=new le(e.segments,e.children);return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}function Lt(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function Et(e){return e.outlet||Q}function At(e){return e.data||{}}function It(e){return e.resolve||{}}function Pt(e){return function(t){return t.pipe(Object(g.a)(t=>{const n=e(t);return n?Object(o.a)(n).pipe(Object(p.a)(()=>t)):Object(o.a)([t])}))}}class jt extends class{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}{}let Nt=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Gb({type:e,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,t){1&e&&r.Nb(0,"router-outlet")},directives:function(){return[tn]},encapsulation:2}),e})();function Ft(e,t=""){for(let n=0;n<e.length;n++){const i=e[n];Yt(i,zt(t,i))}}function Yt(e,t){if(!e)throw new Error(`\n      Invalid configuration of route '${t}': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    `);if(Array.isArray(e))throw new Error(`Invalid configuration of route '${t}': Array cannot be specified`);if(!e.component&&!e.children&&!e.loadChildren&&e.outlet&&e.outlet!==Q)throw new Error(`Invalid configuration of route '${t}': a componentless route without children or loadChildren cannot have a named outlet set`);if(e.redirectTo&&e.children)throw new Error(`Invalid configuration of route '${t}': redirectTo and children cannot be used together`);if(e.redirectTo&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': redirectTo and loadChildren cannot be used together`);if(e.children&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': children and loadChildren cannot be used together`);if(e.redirectTo&&e.component)throw new Error(`Invalid configuration of route '${t}': redirectTo and component cannot be used together`);if(e.path&&e.matcher)throw new Error(`Invalid configuration of route '${t}': path and matcher cannot be used together`);if(void 0===e.redirectTo&&!e.component&&!e.children&&!e.loadChildren)throw new Error(`Invalid configuration of route '${t}'. One of the following must be provided: component, redirectTo, children or loadChildren`);if(void 0===e.path&&void 0===e.matcher)throw new Error(`Invalid configuration of route '${t}': routes must have either a path or a matcher specified`);if("string"==typeof e.path&&"/"===e.path.charAt(0))throw new Error(`Invalid configuration of route '${t}': path cannot start with a slash`);if(""===e.path&&void 0!==e.redirectTo&&void 0===e.pathMatch)throw new Error(`Invalid configuration of route '{path: "${t}", redirectTo: "${e.redirectTo}"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`);if(void 0!==e.pathMatch&&"full"!==e.pathMatch&&"prefix"!==e.pathMatch)throw new Error(`Invalid configuration of route '${t}': pathMatch can only be set to 'prefix' or 'full'`);e.children&&Ft(e.children,t)}function zt(e,t){return t?e||t.path?e&&!t.path?e+"/":!e&&t.path?t.path:`${e}/${t.path}`:"":e}function $t(e){const t=e.children&&e.children.map($t),n=t?Object.assign(Object.assign({},e),{children:t}):Object.assign({},e);return!n.component&&(t||n.loadChildren)&&n.outlet&&n.outlet!==Q&&(n.component=Nt),n}const Ht=new r.r("ROUTES");class Wt{constructor(e,t,n,i){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=i}load(e,t){return this.onLoadStartListener&&this.onLoadStartListener(t),this.loadModuleFactory(t.loadChildren).pipe(Object(p.a)(n=>{this.onLoadEndListener&&this.onLoadEndListener(t);const i=n.create(e);return new nt(ie(i.injector.get(Ht)).map($t),i)}))}loadModuleFactory(e){return"string"==typeof e?Object(o.a)(this.loader.load(e)):oe(e()).pipe(Object(k.a)(e=>e instanceof r.w?Object(s.a)(e):Object(o.a)(this.compiler.compileModuleAsync(e))))}}class Vt{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Bt,this.attachRef=null}}class Bt{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const n=this.getOrCreateContext(e);n.outlet=t,this.contexts.set(e,n)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new Vt,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}class Ut{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function Gt(e){throw e}function qt(e,t,n){return t.parse("/")}function Jt(e,t){return Object(s.a)(null)}let Qt=(()=>{class e{constructor(e,t,n,i,s,o,c,l){this.rootComponentType=e,this.urlSerializer=t,this.rootContexts=n,this.location=i,this.config=l,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new f.a,this.errorHandler=Gt,this.malformedUriErrorHandler=qt,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Jt,afterPreactivation:Jt},this.urlHandlingStrategy=new Ut,this.routeReuseStrategy=new jt,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=s.get(r.y),this.console=s.get(r.X);const u=s.get(r.A);this.isNgZoneEnabled=u instanceof r.A,this.resetConfig(l),this.currentUrlTree=new ce(new le([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Wt(o,c,e=>this.triggerEvent(new W(e)),e=>this.triggerEvent(new V(e))),this.routerState=Ie(this.currentUrlTree,this.rootComponentType),this.transitions=new a.a({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}setupNavigations(e){const t=this.events;return e.pipe(Object(w.a)(e=>0!==e.id),Object(p.a)(e=>Object.assign(Object.assign({},e),{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl)})),Object(g.a)(e=>{let n=!1,i=!1;return Object(s.a)(e).pipe(Object(D.a)(e=>{this.currentNavigation={id:e.id,initialUrl:e.currentRawUrl,extractedUrl:e.extractedUrl,trigger:e.source,extras:e.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Object(g.a)(e=>{const n=!this.navigated||e.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(e.rawUrl))return Object(s.a)(e).pipe(Object(g.a)(e=>{const n=this.transitions.getValue();return t.next(new I(e.id,this.serializeUrl(e.extractedUrl),e.source,e.restoredState)),n!==this.transitions.getValue()?d.a:[e]}),Object(g.a)(e=>Promise.resolve(e)),(i=this.ngModule.injector,r=this.configLoader,o=this.urlSerializer,a=this.config,function(e){return e.pipe(Object(g.a)(e=>function(e,t,n,i,r){return new ht(e,t,n,i,r).apply()}(i,r,o,e.extractedUrl,a).pipe(Object(p.a)(t=>Object.assign(Object.assign({},e),{urlAfterRedirects:t})))))}),Object(D.a)(e=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:e.urlAfterRedirects})}),function(e,t,n,i,r){return function(s){return s.pipe(Object(k.a)(s=>function(e,t,n,i,r="emptyOnly",s="legacy"){return new Tt(e,t,n,i,r,s).recognize()}(e,t,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(Object(p.a)(e=>Object.assign(Object.assign({},s),{targetSnapshot:e})))))}}(this.rootComponentType,this.config,e=>this.serializeUrl(e),this.paramsInheritanceStrategy,this.relativeLinkResolution),Object(D.a)(e=>{"eager"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(e.urlAfterRedirects,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),Object(D.a)(e=>{const n=new F(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);t.next(n)}));var i,r,o,a;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:o,extras:a}=e,c=new I(n,this.serializeUrl(i),r,o);t.next(c);const l=Ie(i,this.rootComponentType).snapshot;return Object(s.a)(Object.assign(Object.assign({},e),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},a),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=e.rawUrl,this.browserUrlTree=e.urlAfterRedirects,e.resolve(null),d.a}),Pt(e=>{const{targetSnapshot:t,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=e;return this.hooks.beforePreactivation(t,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),Object(D.a)(e=>{const t=new Y(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(p.a)(e=>Object.assign(Object.assign({},e),{guards:yt(e.targetSnapshot,e.currentSnapshot,this.rootContexts)})),function(e,t){return function(n){return n.pipe(Object(k.a)(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:a,canDeactivateChecks:c}}=n;return 0===c.length&&0===a.length?Object(s.a)(Object.assign(Object.assign({},n),{guardsResult:!0})):function(e,t,n,i){return Object(o.a)(e).pipe(Object(k.a)(e=>function(e,t,n,i,r){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!o||0===o.length)return Object(s.a)(!0);const a=o.map(s=>{const o=vt(s,t,r);let a;if(function(e){return e&&it(e.canDeactivate)}(o))a=oe(o.canDeactivate(e,t,n,i));else{if(!it(o))throw new Error("Invalid CanDeactivate guard");a=oe(o(e,t,n,i))}return a.pipe(Object(x.a)())});return Object(s.a)(a).pipe(ot())}(e.component,e.route,n,t,i)),Object(x.a)(e=>!0!==e,!0))}(c,i,r,e).pipe(Object(k.a)(n=>n&&"boolean"==typeof n?function(e,t,n,i){return Object(o.a)(t).pipe(Object(M.a)(t=>Object(o.a)([Mt(t.route.parent,i),St(t.route,i),kt(e,t.path,n),xt(e,t.route,n)]).pipe(Object(m.a)(),Object(x.a)(e=>!0!==e,!0))),Object(x.a)(e=>!0!==e,!0))}(i,a,e,t):Object(s.a)(n)),Object(p.a)(e=>Object.assign(Object.assign({},n),{guardsResult:e})))}))}}(this.ngModule.injector,e=>this.triggerEvent(e)),Object(D.a)(e=>{if(rt(e.guardsResult)){const t=X(`Redirecting to "${this.serializeUrl(e.guardsResult)}"`);throw t.url=e.guardsResult,t}}),Object(D.a)(e=>{const t=new z(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot,!!e.guardsResult);this.triggerEvent(t)}),Object(w.a)(e=>{if(!e.guardsResult){this.resetUrlToCurrentUrlTree();const n=new j(e.id,this.serializeUrl(e.extractedUrl),"");return t.next(n),e.resolve(!1),!1}return!0}),Pt(e=>{if(e.guards.canActivateChecks.length)return Object(s.a)(e).pipe(Object(D.a)(e=>{const t=new $(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(g.a)(e=>{let n=!1;return Object(s.a)(e).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,function(e){return e.pipe(Object(k.a)(e=>{const{targetSnapshot:t,guards:{canActivateChecks:n}}=e;if(!n.length)return Object(s.a)(e);let a=0;return Object(o.a)(n).pipe(Object(M.a)(e=>function(e,t,n,i){return function(e,t,n,i){const r=Object.keys(e);if(0===r.length)return Object(s.a)({});const a={};return Object(o.a)(r).pipe(Object(k.a)(r=>function(e,t,n,i){const r=vt(e,t,i);return oe(r.resolve?r.resolve(t,n):r(t,n))}(e[r],t,n,i).pipe(Object(D.a)(e=>{a[r]=e}))),Object(T.a)(1),Object(k.a)(()=>Object.keys(a).length===r.length?Object(s.a)(a):d.a))}(e._resolve,e,t,i).pipe(Object(p.a)(t=>(e._resolvedData=t,e.data=Object.assign(Object.assign({},e.data),je(e,n).resolve),null)))}(e.route,t,i,r)),Object(D.a)(()=>a++),Object(T.a)(1),Object(k.a)(t=>a===n.length?Object(s.a)(e):d.a))}))}),Object(D.a)({next:()=>n=!0,complete:()=>{if(!n){const n=new j(e.id,this.serializeUrl(e.extractedUrl),"At least one route resolver didn't emit any value.");t.next(n),e.resolve(!1)}}}));var i,r}),Object(D.a)(e=>{const t=new H(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}))}),Pt(e=>{const{targetSnapshot:t,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=e;return this.hooks.afterPreactivation(t,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),Object(p.a)(e=>{const t=function(e,t,n){const i=function e(t,n,i){if(i&&t.shouldReuseRoute(n.value,i.value.snapshot)){const r=i.value;r._futureSnapshot=n.value;const s=function(t,n,i){return n.children.map(n=>{for(const r of i.children)if(t.shouldReuseRoute(r.value.snapshot,n.value))return e(t,n,r);return e(t,n)})}(t,n,i);return new Le(r,s)}{const i=t.retrieve(n.value);if(i){const e=i.route;return function e(t,n){if(t.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=t.value;for(let i=0;i<t.children.length;++i)e(t.children[i],n.children[i])}(n,e),e}{const i=new Pe(new a.a((r=n.value).url),new a.a(r.params),new a.a(r.queryParams),new a.a(r.fragment),new a.a(r.data),r.outlet,r.component,r),s=n.children.map(n=>e(t,n));return new Le(i,s)}}var r}(e,t._root,n?n._root:void 0);return new Ae(i,t)}(this.routeReuseStrategy,e.targetSnapshot,e.currentRouterState);return Object.assign(Object.assign({},e),{targetRouterState:t})}),Object(D.a)(e=>{this.currentUrlTree=e.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl),this.routerState=e.targetRouterState,"deferred"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),(c=this.rootContexts,l=this.routeReuseStrategy,u=e=>this.triggerEvent(e),Object(p.a)(e=>(new et(l,e.targetRouterState,e.currentRouterState,u).activate(c),e))),Object(D.a)({next(){n=!0},complete(){n=!0}}),(r=()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new j(e.id,this.serializeUrl(e.extractedUrl),`Navigation ID ${e.id} is not equal to the current navigation id ${this.navigationId}`);t.next(n),e.resolve(!1)}this.currentNavigation=null},e=>e.lift(new R(r))),Object(S.a)(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=rt(n.url);i||(this.navigated=!0,this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl));const r=new j(e.id,this.serializeUrl(e.extractedUrl),n.message);t.next(r),i?setTimeout(()=>{const t=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(t,"imperative",null,{skipLocationChange:e.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:e.resolve,reject:e.reject,promise:e.promise})},0):e.resolve(!1)}else{this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl);const i=new N(e.id,this.serializeUrl(e.extractedUrl),n);t.next(i);try{e.resolve(this.errorHandler(n))}catch(s){e.reject(s)}}var r;return d.a}));var r,c,l,u}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}getTransition(){const e=this.transitions.value;return e.urlAfterRedirects=this.browserUrlTree,e}setTransition(e){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{const t=this.extractLocationChangeInfoFromEvent(e);this.shouldScheduleNavigation(this.lastLocationChangeInfo,t)&&setTimeout(()=>{const{source:e,state:n,urlTree:i}=t,r={replaceUrl:!0};if(n){const e=Object.assign({},n);delete e.navigationId,0!==Object.keys(e).length&&(r.state=e)}this.scheduleNavigation(i,e,n,r)},0),this.lastLocationChangeInfo=t}))}extractLocationChangeInfoFromEvent(e){var t;return{source:"popstate"===e.type?"popstate":"hashchange",urlTree:this.parseUrl(e.url),state:(null===(t=e.state)||void 0===t?void 0:t.navigationId)?e.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(e,t){if(!e)return!0;const n=t.urlTree.toString()===e.urlTree.toString();return!(t.transitionId===e.transitionId&&n&&("hashchange"===t.source&&"popstate"===e.source||"popstate"===t.source&&"hashchange"===e.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){Ft(e),this.config=e.map($t),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0)}createUrlTree(e,t={}){const{relativeTo:n,queryParams:i,fragment:s,preserveQueryParams:o,queryParamsHandling:a,preserveFragment:c}=t;Object(r.U)()&&o&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");const l=n||this.routerState.root,u=c?this.currentUrlTree.fragment:s;let d=null;if(a)switch(a){case"merge":d=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=i||null}else d=o?this.currentUrlTree.queryParams:i||null;return null!==d&&(d=this.removeEmptyProps(d)),function(e,t,n,i,r){if(0===n.length)return Ve(t.root,t.root,t,i,r);const s=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Be(!0,0,e);let t=0,n=!1;const i=e.reduce((e,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const t={};return se(i.outlets,(e,n)=>{t[n]="string"==typeof e?e.split("/"):e}),[...e,{outlets:t}]}if(i.segmentPath)return[...e,i.segmentPath]}return"string"!=typeof i?[...e,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?t++:""!=i&&e.push(i))}),e):[...e,i]},[]);return new Be(n,t,i)}(n);if(s.toRoot())return Ve(t.root,new le([],{}),t,i,r);const o=function(e,t,n){if(e.isAbsolute)return new Ue(t.root,!0,0);if(-1===n.snapshot._lastPathIndex){const e=n.snapshot._urlSegment;return new Ue(e,e===t.root,0)}const i=We(e.commands[0])?0:1;return function(e,t,n){let i=e,r=t,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Ue(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,e.numberOfDoubleDots)}(s,t,e),a=o.processChildren?Je(o.segmentGroup,o.index,s.commands):qe(o.segmentGroup,o.index,s.commands);return Ve(o.segmentGroup,a,t,i,r)}(l,this.currentUrlTree,e,d,u)}navigateByUrl(e,t={skipLocationChange:!1}){Object(r.U)()&&this.isNgZoneEnabled&&!r.A.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");const n=rt(e)?e:this.parseUrl(e),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,t)}navigate(e,t={skipLocationChange:!1}){return function(e){for(let t=0;t<e.length;t++){const n=e[t];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${t}`)}}(e),this.navigateByUrl(this.createUrlTree(e,t),t)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){let t;try{t=this.urlSerializer.parse(e)}catch(n){t=this.malformedUriErrorHandler(n,this.urlSerializer,e)}return t}isActive(e,t){if(rt(e))return ae(this.currentUrlTree,e,t);const n=this.parseUrl(e);return ae(this.currentUrlTree,n,t)}removeEmptyProps(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];return null!=i&&(t[n]=i),t},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.events.next(new P(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,e.resolve(!0)},e=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(e,t,n,i,r){const s=this.getTransition(),o="imperative"!==t&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===e.toString();if(o&&a)return Promise.resolve(!0);let c,l,u;r?(c=r.resolve,l=r.reject,u=r.promise):u=new Promise((e,t)=>{c=e,l=t});const d=++this.navigationId;return this.setTransition({id:d,source:t,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:i,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(e=>Promise.reject(e))}setBrowserUrl(e,t,n,i){const r=this.urlSerializer.serialize(e);i=i||{},this.location.isCurrentPathEqualTo(r)||t?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(e,t,n){this.routerState=e,this.currentUrlTree=t,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return e.\u0275fac=function(t){return new(t||e)(r.dc(r.N),r.dc(fe),r.dc(Bt),r.dc(i.m),r.dc(r.s),r.dc(r.x),r.dc(r.i),r.dc(void 0))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})(),Kt=(()=>{class e{constructor(e,t,n,i,r){this.router=e,this.route=t,this.commands=[],this.onChanges=new f.a,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(e){this.onChanges.next(this)}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}set preserveQueryParams(e){Object(r.U)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=e}onClick(){const e={skipLocationChange:Xt(this.skipLocationChange),replaceUrl:Xt(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,e),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:Xt(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:Xt(this.preserveFragment)})}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(Qt),r.Mb(Pe),r.ec("tabindex"),r.Mb(r.E),r.Mb(r.m))},e.\u0275dir=r.Hb({type:e,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(e,t){1&e&&r.gc("click",(function(){return t.onClick()}))},inputs:{routerLink:"routerLink",preserveQueryParams:"preserveQueryParams",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[r.wb]}),e})(),Zt=(()=>{class e{constructor(e,t,n){this.router=e,this.route=t,this.locationStrategy=n,this.commands=[],this.onChanges=new f.a,this.subscription=e.events.subscribe(e=>{e instanceof P&&this.updateTargetUrlAndHref()})}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}set preserveQueryParams(e){Object(r.U)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=e}ngOnChanges(e){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(e,t,n,i,r){if(0!==e||t||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:Xt(this.skipLocationChange),replaceUrl:Xt(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:Xt(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:Xt(this.preserveFragment)})}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(Qt),r.Mb(Pe),r.Mb(i.n))},e.\u0275dir=r.Hb({type:e,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(e,t){1&e&&r.gc("click",(function(e){return t.onClick(e.button,e.ctrlKey,e.shiftKey,e.altKey,e.metaKey)})),2&e&&(r.Vb("href",t.href,r.Gc),r.zb("target",t.target))},inputs:{routerLink:"routerLink",preserveQueryParams:"preserveQueryParams",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[r.wb]}),e})();function Xt(e){return""===e||!!e}let en=(()=>{class e{constructor(e,t,n,i,r,s){this.router=e,this.element=t,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=e.events.subscribe(e=>{e instanceof P&&this.update()})}ngAfterContentInit(){Object(o.a)([this.links.changes,this.linksWithHrefs.changes,Object(s.a)(null)]).pipe(Object(E.a)()).subscribe(e=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var e;null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe();const t=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(e=>!!e).map(e=>e.onChanges);this.linkInputChangesSubscription=Object(o.a)(t).pipe(Object(E.a)()).subscribe(e=>{this.isActive!==this.isLinkActive(this.router)(e)&&this.update()})}set routerLinkActive(e){const t=Array.isArray(e)?e:e.split(" ");this.classes=t.filter(e=>!!e)}ngOnChanges(e){this.update()}ngOnDestroy(){var e;this.routerEventsSubscription.unsubscribe(),null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const e=this.hasActiveLinks();this.isActive!==e&&(this.isActive=e,this.cdr.markForCheck(),this.classes.forEach(t=>{e?this.renderer.addClass(this.element.nativeElement,t):this.renderer.removeClass(this.element.nativeElement,t)}))})}isLinkActive(e){return t=>e.isActive(t.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.linkWithHref&&e(this.linkWithHref)||this.links.some(e)||this.linksWithHrefs.some(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(Qt),r.Mb(r.m),r.Mb(r.E),r.Mb(r.h),r.Mb(Kt,8),r.Mb(Zt,8))},e.\u0275dir=r.Hb({type:e,selectors:[["","routerLinkActive",""]],contentQueries:function(e,t,n){var i;1&e&&(r.Fb(n,Kt,!0),r.Fb(n,Zt,!0)),2&e&&(r.zc(i=r.hc())&&(t.links=i),r.zc(i=r.hc())&&(t.linksWithHrefs=i))},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[r.wb]}),e})(),tn=(()=>{class e{constructor(e,t,n,i,s){this.parentContexts=e,this.location=t,this.resolver=n,this.changeDetector=s,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.o,this.deactivateEvents=new r.o,this.name=i||Q,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,e}attach(e,t){this.activated=e,this._activatedRoute=t,this.location.insert(e.hostView)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,t){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const n=(t=t||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new nn(e,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(Bt),r.Mb(r.P),r.Mb(r.j),r.ec("name"),r.Mb(r.h))},e.\u0275dir=r.Hb({type:e,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),e})();class nn{constructor(e,t,n){this.route=e,this.childContexts=t,this.parent=n}get(e,t){return e===Pe?this.route:e===Bt?this.childContexts:this.parent.get(e,t)}}class rn{}class sn{preload(e,t){return t().pipe(Object(S.a)(()=>Object(s.a)(null)))}}class on{preload(e,t){return Object(s.a)(null)}}let an=(()=>{class e{constructor(e,t,n,i,r){this.router=e,this.injector=i,this.preloadingStrategy=r,this.loader=new Wt(t,n,t=>e.triggerEvent(new W(t)),t=>e.triggerEvent(new V(t)))}setUpPreloading(){this.subscription=this.router.events.pipe(Object(w.a)(e=>e instanceof P),Object(M.a)(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(r.y);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,t){const n=[];for(const i of t)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const e=i._loadedConfig;n.push(this.processRoutes(e.module,e.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(e,i)):i.children&&n.push(this.processRoutes(e,i.children));return Object(o.a)(n).pipe(Object(E.a)(),Object(p.a)(e=>{}))}preloadConfig(e,t){return this.preloadingStrategy.preload(t,()=>this.loader.load(e.injector,t).pipe(Object(k.a)(e=>(t._loadedConfig=e,this.processRoutes(e.module,e.routes)))))}}return e.\u0275fac=function(t){return new(t||e)(r.dc(Qt),r.dc(r.x),r.dc(r.i),r.dc(r.s),r.dc(rn))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})(),cn=(()=>{class e{constructor(e,t,n={}){this.router=e,this.viewportScroller=t,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof I?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof P&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof J&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,t){this.router.triggerEvent(new J(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,t))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.dc(Qt),r.dc(i.D),r.dc(void 0))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();const ln=new r.r("ROUTER_CONFIGURATION"),un=new r.r("ROUTER_FORROOT_GUARD"),dn=[i.m,{provide:fe,useClass:pe},{provide:Qt,useFactory:function(e,t,n,r,s,o,a,c={},l,u){const d=new Qt(null,e,t,n,r,s,o,ie(a));if(l&&(d.urlHandlingStrategy=l),u&&(d.routeReuseStrategy=u),c.errorHandler&&(d.errorHandler=c.errorHandler),c.malformedUriErrorHandler&&(d.malformedUriErrorHandler=c.malformedUriErrorHandler),c.enableTracing){const e=Object(i.L)();d.events.subscribe(t=>{e.logGroup("Router Event: "+t.constructor.name),e.log(t.toString()),e.log(t),e.logGroupEnd()})}return c.onSameUrlNavigation&&(d.onSameUrlNavigation=c.onSameUrlNavigation),c.paramsInheritanceStrategy&&(d.paramsInheritanceStrategy=c.paramsInheritanceStrategy),c.urlUpdateStrategy&&(d.urlUpdateStrategy=c.urlUpdateStrategy),c.relativeLinkResolution&&(d.relativeLinkResolution=c.relativeLinkResolution),d},deps:[fe,Bt,i.m,r.s,r.x,r.i,Ht,ln,[class{},new r.B],[class{},new r.B]]},Bt,{provide:Pe,useFactory:function(e){return e.routerState.root},deps:[Qt]},{provide:r.x,useClass:r.K},an,on,sn,{provide:ln,useValue:{enableTracing:!1}}];function hn(){return new r.z("Router",Qt)}let fn=(()=>{class e{constructor(e,t){}static forRoot(t,n){return{ngModule:e,providers:[dn,gn(t),{provide:un,useFactory:bn,deps:[[Qt,new r.B,new r.J]]},{provide:ln,useValue:n||{}},{provide:i.n,useFactory:mn,deps:[i.z,[new r.q(i.a),new r.B],ln]},{provide:cn,useFactory:pn,deps:[Qt,i.D,ln]},{provide:rn,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:on},{provide:r.z,multi:!0,useFactory:hn},[_n,{provide:r.d,multi:!0,useFactory:yn,deps:[_n]},{provide:wn,useFactory:vn,deps:[_n]},{provide:r.b,multi:!0,useExisting:wn}]]}}static forChild(t){return{ngModule:e,providers:[gn(t)]}}}return e.\u0275mod=r.Kb({type:e}),e.\u0275inj=r.Jb({factory:function(t){return new(t||e)(r.dc(un,8),r.dc(Qt,8))}}),e})();function pn(e,t,n){return n.scrollOffset&&t.setOffset(n.scrollOffset),new cn(e,t,n)}function mn(e,t,n={}){return n.useHash?new i.h(e,t):new i.x(e,t)}function bn(e){if(e)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function gn(e){return[{provide:r.a,multi:!0,useValue:e},{provide:Ht,multi:!0,useValue:e}]}let _n=(()=>{class e{constructor(e){this.injector=e,this.initNavigation=!1,this.resultOfPreactivationDone=new f.a}appInitializer(){return this.injector.get(i.l,Promise.resolve(null)).then(()=>{let e=null;const t=new Promise(t=>e=t),n=this.injector.get(Qt),i=this.injector.get(ln);if(this.isLegacyDisabled(i)||this.isLegacyEnabled(i))e(!0);else if("disabled"===i.initialNavigation)n.setUpLocationChangeListener(),e(!0);else{if("enabled"!==i.initialNavigation)throw new Error(`Invalid initialNavigation options: '${i.initialNavigation}'`);n.hooks.afterPreactivation=()=>this.initNavigation?Object(s.a)(null):(this.initNavigation=!0,e(!0),this.resultOfPreactivationDone),n.initialNavigation()}return t})}bootstrapListener(e){const t=this.injector.get(ln),n=this.injector.get(an),i=this.injector.get(cn),s=this.injector.get(Qt),o=this.injector.get(r.g);e===o.components[0]&&(this.isLegacyEnabled(t)?s.initialNavigation():this.isLegacyDisabled(t)&&s.setUpLocationChangeListener(),n.setUpPreloading(),i.init(),s.resetRootComponentType(o.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}isLegacyEnabled(e){return"legacy_enabled"===e.initialNavigation||!0===e.initialNavigation||void 0===e.initialNavigation}isLegacyDisabled(e){return"legacy_disabled"===e.initialNavigation||!1===e.initialNavigation}}return e.\u0275fac=function(t){return new(t||e)(r.dc(r.s))},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac}),e})();function yn(e){return e.appInitializer.bind(e)}function vn(e){return e.bootstrapListener.bind(e)}const wn=new r.r("Router Initializer")},iSVu:function(e,t,n){var i=n("xs3f"),r=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(e){return r.call(e)}),e.exports=i.inspectSource},iYuL:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},insk:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var i=n("20UP"),r=n("oxzT"),s=n("8Y7J"),o=n("cUpR"),a=n("SVse"),c=n("XFyV"),l=n("/NlG"),u=n("6qls"),d=n("ANnk"),h=n("s7LF");function f(e,t){1&e&&(s.Sb(0,"cd-loading-panel"),s.Wb(1,2),s.Rb())}function p(e,t){1&e&&(s.Sb(0,"cd-alert-panel",3),s.cc(1,4),s.Nb(2,"cd-doc",5),s.Zb(),s.Rb())}function m(e,t){1&e&&(s.Sb(0,"cd-alert-panel",3),s.cc(1,6),s.Nb(2,"cd-doc",5),s.Zb(),s.Rb())}function b(e,t){if(1&e&&(s.Sb(0,"option",20),s.Oc(1),s.Rb()),2&e){const e=t.$implicit;s.pc("ngValue",e.value),s.yb(1),s.Qc("",e.name," ")}}const g=function(e){return[e]};function _(e,t){if(1&e){const e=s.Tb();s.Qb(0),s.Sb(1,"div",7),s.Sb(2,"div",8),s.Sb(3,"div",9),s.Sb(4,"label",10),s.Wb(5,11),s.Rb(),s.Sb(6,"select",12),s.gc("ngModelChange",(function(t){return s.Dc(e),s.ic().time=t}))("ngModelChange",(function(t){return s.Dc(e),s.ic().onTimepickerChange(t)})),s.Mc(7,b,2,2,"option",13),s.Rb(),s.Sb(8,"button",14),s.Yb(9,15),s.gc("click",(function(){return s.Dc(e),s.ic().reset()})),s.Nb(10,"i",16),s.Rb(),s.Rb(),s.Rb(),s.Rb(),s.Sb(11,"div",7),s.Sb(12,"div",8),s.Sb(13,"div",17),s.Nb(14,"iframe",18,19),s.Rb(),s.Rb(),s.Rb(),s.Pb()}if(2&e){const e=s.ic();s.yb(6),s.pc("ngModel",e.time),s.yb(1),s.pc("ngForOf",e.grafanaTimes),s.yb(3),s.pc("ngClass",s.uc(5,g,e.icons.undo)),s.yb(4),s.pc("src",e.grafanaSrc,s.Fc)("ngClass",e.panelStyle)}}let y=(()=>{class e{constructor(e,t){this.sanitizer=e,this.settingsService=t,this.grafanaExist=!1,this.mode="&kiosk",this.datasource="Dashboard1",this.loading=!0,this.styles={},this.dashboardExist=!0,this.icons=r.a,this.DEFAULT_TIME="from=now-1h&to=now",this.grafanaTimes=[{name:"Last 5 minutes",value:"from=now-5m&to=now"},{name:"Last 15 minutes",value:"from=now-15m&to=now"},{name:"Last 30 minutes",value:"from=now-30m&to=now"},{name:"Last 1 hour (Default)",value:"from=now-1h&to=now"},{name:"Last 3 hours",value:"from=now-3h&to=now"},{name:"Last 6 hours",value:"from=now-6h&to=now"},{name:"Last 12 hours",value:"from=now-12h&to=now"},{name:"Last 24 hours",value:"from=now-24h&to=now"},{name:"Yesterday",value:"from=now-1d%2Fd&to=now-1d%2Fd"},{name:"Today so far",value:"from=now%2Fd&to=now"},{name:"Day before yesterday",value:"from=now-2d%2Fd&to=now-2d%2Fd"},{name:"Last 2 days",value:"from=now-2d&to=now"},{name:"This day last week",value:"from=now-7d%2Fd&to=now-7d%2Fd"},{name:"Previous week",value:"from=now-1w%2Fw&to=now-1w%2Fw"},{name:"This week so far",value:"from=now%2Fw&to=now"},{name:"Last 7 days",value:"from=now-7d&to=now"},{name:"Previous month",value:"from=now-1M%2FM&to=now-1M%2FM"},{name:"This month so far",value:"from=now%2FM&to=now"},{name:"Last 30 days",value:"from=now-30d&to=now"},{name:"Last 90 days",value:"from=now-90d&to=now"},{name:"Last 6 months",value:"from=now-6M&to=now"},{name:"Last 1 year",value:"from=now-1y&to=now"},{name:"Previous year",value:"from=now-1y%2Fy&to=now-1y%2Fy"},{name:"This year so far",value:"from=now%2Fy&to=now"},{name:"Last 2 years",value:"from=now-2y&to=now"},{name:"Last 5 years",value:"from=now-5y&to=now"}]}ngOnInit(){this.time=this.DEFAULT_TIME,this.styles={one:"grafana_one",two:"grafana_two",three:"grafana_three",four:"grafana_four"},this.settingsService.ifSettingConfigured("api/grafana/url",e=>{this.grafanaExist=!0,this.loading=!1,this.baseUrl=e+"/d/",this.getFrame()}),this.panelStyle=this.styles[this.grafanaStyle]}getFrame(){this.settingsService.validateGrafanaDashboardUrl(this.uid).subscribe(e=>this.dashboardExist=200===e),this.url=this.baseUrl+this.uid+"/"+this.grafanaPath+"&refresh=2s&var-datasource="+this.datasource+this.mode+"&"+this.time,this.grafanaSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.url)}onTimepickerChange(){this.grafanaExist&&this.getFrame()}reset(){this.time=this.DEFAULT_TIME,this.grafanaExist&&this.getFrame()}ngOnChanges(){this.grafanaExist&&this.getFrame()}}return e.\u0275fac=function(t){return new(t||e)(s.Mb(o.b),s.Mb(i.a))},e.\u0275cmp=s.Gb({type:e,selectors:[["cd-grafana"]],inputs:{grafanaPath:"grafanaPath",grafanaStyle:"grafanaStyle",uid:"uid"},features:[s.wb],decls:4,vars:4,consts:function(){return[[4,"ngIf"],["type","info",4,"ngIf"],"Loading panel data...",["type","info"],"Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to configure and enable the monitoring functionality.",["section","grafana"],"Grafana Dashboard doesn't exist. Please refer to " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to add dashboards to Grafana.",[1,"row"],[1,"col"],[1,"form-inline","timepicker"],["for","timepicker",1,"ml-1","my-1"],"Grafana Time Picker",["id","timepicker","name","timepicker",1,"custom-select","my-1","mx-3",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"btn","btn-light","my-1",3,"click",6,"title"],["title","Reset Settings"],[3,"ngClass"],[1,"grafana-container"],["id","iframe","frameborder","0","scrolling","no",1,"grafana",3,"src","ngClass"],["iframe",""],[3,"ngValue"]]},template:function(e,t){1&e&&(s.Mc(0,f,2,0,"cd-loading-panel",0),s.Mc(1,p,3,0,"cd-alert-panel",1),s.Mc(2,m,3,0,"cd-alert-panel",1),s.Mc(3,_,16,7,"ng-container",0)),2&e&&(s.pc("ngIf",t.loading&&t.grafanaExist),s.yb(1),s.pc("ngIf",!t.grafanaExist),s.yb(1),s.pc("ngIf",!t.dashboardExist),s.yb(1),s.pc("ngIf",t.grafanaExist&&t.dashboardExist))},directives:[a.r,c.a,l.a,u.a,d.a,h.z,h.q,h.t,a.q,a.p,h.u,h.B],styles:[".grafana[_ngcontent-%COMP%]{height:600px;width:100%;z-index:0}.grafana_one[_ngcontent-%COMP%]{height:400px}.grafana_two[_ngcontent-%COMP%]{height:750px}.grafana_three[_ngcontent-%COMP%]{height:900px}.grafana_four[_ngcontent-%COMP%]{height:1160px}.timepicker[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:700}.dropdown-menu[_ngcontent-%COMP%]{left:auto;right:20px;top:20px}"]}),e})()},iqWW:function(e,t,n){"use strict";var i=n("ZUd8").charAt;e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},itXk:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("z+Ro"),r=n("DH7j"),s=n("l7GE"),o=n("ZUHj"),a=n("yCtX");const c={};function l(...e){let t=void 0,n=void 0;return Object(i.a)(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Object(r.a)(e[0])&&(e=e[0]),Object(a.a)(e,n).lift(new u(t))}class u{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new d(e,this.resultSelector))}}class d extends s.a{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(c),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let n=0;n<t;n++){const t=e[n];this.add(Object(o.a)(this,t,void 0,n))}}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,n){const i=this.values,r=this.toRespond?i[n]===c?--this.toRespond:this.toRespond:0;i[n]=t,0===r&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},"jKX/":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class i{constructor(e=[]){["read","create","update","delete"].forEach(t=>this[t]=e.includes(t))}}class r{constructor(e){this.hosts=new i(e.hosts),this.configOpt=new i(e["config-opt"]),this.pool=new i(e.pool),this.osd=new i(e.osd),this.monitor=new i(e.monitor),this.rbdImage=new i(e["rbd-image"]),this.iscsi=new i(e.iscsi),this.rbdMirroring=new i(e["rbd-mirroring"]),this.rgw=new i(e.rgw),this.cephfs=new i(e.cephfs),this.manager=new i(e.manager),this.log=new i(e.log),this.user=new i(e.user),this.grafana=new i(e.grafana),this.prometheus=new i(e.prometheus),this.nfs=new i(e["nfs-ganesha"])}}},jN84:function(e,t,n){"use strict";var i=n("WJ6P"),r=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;t.a=s?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var i=-1,s=null==t?0:t.length,o=0,a=[];++i<s;){var c=t[i];r.call(e,c)&&(a[o++]=c)}return a}(s(e)))}:i.a},jUeY:function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2_\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2_\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2_\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2_\u039c\u03ac\u03b9\u03bf\u03c2_\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2_\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2_\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2_\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2_\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2_\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2_\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2".split("_"),monthsGenitiveEl:"\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5_\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5_\u039c\u03b1\u0390\u03bf\u03c5_\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5_\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5_\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5_\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5_\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"\u0399\u03b1\u03bd_\u03a6\u03b5\u03b2_\u039c\u03b1\u03c1_\u0391\u03c0\u03c1_\u039c\u03b1\u03ca_\u0399\u03bf\u03c5\u03bd_\u0399\u03bf\u03c5\u03bb_\u0391\u03c5\u03b3_\u03a3\u03b5\u03c0_\u039f\u03ba\u03c4_\u039d\u03bf\u03b5_\u0394\u03b5\u03ba".split("_"),weekdays:"\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae_\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1_\u03a4\u03c1\u03af\u03c4\u03b7_\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7_\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7_\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae_\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf".split("_"),weekdaysShort:"\u039a\u03c5\u03c1_\u0394\u03b5\u03c5_\u03a4\u03c1\u03b9_\u03a4\u03b5\u03c4_\u03a0\u03b5\u03bc_\u03a0\u03b1\u03c1_\u03a3\u03b1\u03b2".split("_"),weekdaysMin:"\u039a\u03c5_\u0394\u03b5_\u03a4\u03c1_\u03a4\u03b5_\u03a0\u03b5_\u03a0\u03b1_\u03a3\u03b1".split("_"),meridiem:function(e,t,n){return e>11?n?"\u03bc\u03bc":"\u039c\u039c":n?"\u03c0\u03bc":"\u03a0\u039c"},isPM:function(e){return"\u03bc"===(e+"").toLowerCase()[0]},meridiemParse:/[\u03a0\u039c]\.?\u039c?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[\u03a3\u03ae\u03bc\u03b5\u03c1\u03b1 {}] LT",nextDay:"[\u0391\u03cd\u03c1\u03b9\u03bf {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[\u03a7\u03b8\u03b5\u03c2 {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[\u03c4\u03bf \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf] dddd [{}] LT";default:return"[\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,i=this._calendarEl[e],r=t&&t.hours();return n=i,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(i=i.apply(t)),i.replace("{}",r%12==1?"\u03c3\u03c4\u03b7":"\u03c3\u03c4\u03b9\u03c2")},relativeTime:{future:"\u03c3\u03b5 %s",past:"%s \u03c0\u03c1\u03b9\u03bd",s:"\u03bb\u03af\u03b3\u03b1 \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",ss:"%d \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",m:"\u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",mm:"%d \u03bb\u03b5\u03c0\u03c4\u03ac",h:"\u03bc\u03af\u03b1 \u03ce\u03c1\u03b1",hh:"%d \u03ce\u03c1\u03b5\u03c2",d:"\u03bc\u03af\u03b1 \u03bc\u03ad\u03c1\u03b1",dd:"%d \u03bc\u03ad\u03c1\u03b5\u03c2",M:"\u03ad\u03bd\u03b1\u03c2 \u03bc\u03ae\u03bd\u03b1\u03c2",MM:"%d \u03bc\u03ae\u03bd\u03b5\u03c2",y:"\u03ad\u03bd\u03b1\u03c2 \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2",yy:"%d \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1"},dayOfMonthOrdinalParse:/\d{1,2}\u03b7/,ordinal:"%d\u03b7",week:{dow:1,doy:4}})}(n("wd/R"))},jVDg:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e,t,n){this.poolName=e,this.namespace=t,this.imageName=n}static fromString(e){const t=e.split("/");return new this(t[0],t.length>=3?t[1]:null,t.length>=3?t[2]:t[1])}getNameSpace(){return this.namespace?this.namespace+"/":""}toString(){return`${this.poolName}/${this.getNameSpace()}${this.imageName}`}toStringEncoded(){return encodeURIComponent(`${this.poolName}/${this.getNameSpace()}${this.imageName}`)}}},jVdC:function(e,t,n){!function(e){"use strict";var t="stycze\u0144_luty_marzec_kwiecie\u0144_maj_czerwiec_lipiec_sierpie\u0144_wrzesie\u0144_pa\u017adziernik_listopad_grudzie\u0144".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_wrze\u015bnia_pa\u017adziernika_listopada_grudnia".split("_"),i=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^pa\u017a/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var i=e+" ";switch(n){case"ss":return i+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minut\u0119";case"mm":return i+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzin\u0119";case"hh":return i+(r(e)?"godziny":"godzin");case"ww":return i+(r(e)?"tygodnie":"tygodni");case"MM":return i+(r(e)?"miesi\u0105ce":"miesi\u0119cy");case"yy":return i+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,i){return e?/D MMMM/.test(i)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_pa\u017a_lis_gru".split("_"),monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"niedziela_poniedzia\u0142ek_wtorek_\u015broda_czwartek_pi\u0105tek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_\u015br_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_\u015ar_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dzi\u015b o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedziel\u0119 o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W \u015brod\u0119 o] LT";case 6:return"[W sobot\u0119 o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zesz\u0142\u0105 niedziel\u0119 o] LT";case 3:return"[W zesz\u0142\u0105 \u015brod\u0119 o] LT";case 6:return"[W zesz\u0142\u0105 sobot\u0119 o] LT";default:return"[W zesz\u0142y] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzie\u0144",dd:"%d dni",w:"tydzie\u0144",ww:s,M:"miesi\u0105c",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},jZKg:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("HDdC"),r=n("quSY");function s(e,t){return new i.a(n=>{const i=new r.a;let s=0;return i.add(t.schedule((function(){s!==e.length?(n.next(e[s++]),n.closed||i.add(this.schedule())):n.complete()}))),i})}},jfSC:function(e,t,n){!function(e){"use strict";var t={1:"\u06f1",2:"\u06f2",3:"\u06f3",4:"\u06f4",5:"\u06f5",6:"\u06f6",7:"\u06f7",8:"\u06f8",9:"\u06f9",0:"\u06f0"},n={"\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9","\u06f0":"0"};e.defineLocale("fa",{months:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),monthsShort:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),weekdays:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysShort:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u062c_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631|\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/,isPM:function(e){return/\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/.test(e)},meridiem:function(e,t,n){return e<12?"\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631":"\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631"},calendar:{sameDay:"[\u0627\u0645\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",nextDay:"[\u0641\u0631\u062f\u0627 \u0633\u0627\u0639\u062a] LT",nextWeek:"dddd [\u0633\u0627\u0639\u062a] LT",lastDay:"[\u062f\u06cc\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",lastWeek:"dddd [\u067e\u06cc\u0634] [\u0633\u0627\u0639\u062a] LT",sameElse:"L"},relativeTime:{future:"\u062f\u0631 %s",past:"%s \u067e\u06cc\u0634",s:"\u0686\u0646\u062f \u062b\u0627\u0646\u06cc\u0647",ss:"%d \u062b\u0627\u0646\u06cc\u0647",m:"\u06cc\u06a9 \u062f\u0642\u06cc\u0642\u0647",mm:"%d \u062f\u0642\u06cc\u0642\u0647",h:"\u06cc\u06a9 \u0633\u0627\u0639\u062a",hh:"%d \u0633\u0627\u0639\u062a",d:"\u06cc\u06a9 \u0631\u0648\u0632",dd:"%d \u0631\u0648\u0632",M:"\u06cc\u06a9 \u0645\u0627\u0647",MM:"%d \u0645\u0627\u0647",y:"\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/[\u06f0-\u06f9]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},dayOfMonthOrdinalParse:/\d{1,2}\u0645/,ordinal:"%d\u0645",week:{dow:6,doy:12}})}(n("wd/R"))},jnO4:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},i=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},s=function(e){return function(t,n,s,o){var a=i(t),c=r[e][i(t)];return 2===a&&(c=c[n?0:1]),c.replace(/%d/i,t)}},o=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},jtHE:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("XNiG"),r=n("3N8a");class s extends r.a{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(e,t,n):e.flush(this)}}var o=n("IjjT");class a extends o.a{}const c=new a(s);var l=n("quSY"),u=n("pxpQ"),d=n("9ppp"),h=n("Ylt2");class f extends i.a{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new p(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,n=t?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new d.a;if(this.isStopped||this.hasError?s=l.a.EMPTY:(this.observers.push(e),s=new h.a(this,e)),i&&e.add(e=new u.a(e,i)),t)for(let o=0;o<r&&!e.closed;o++)e.next(n[o]);else for(let o=0;o<r&&!e.closed;o++)e.next(n[o].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),s}_getNow(){return(this.scheduler||c).now()}_trimBufferThenGetEvents(){const e=this._getNow(),t=this._bufferSize,n=this._windowTime,i=this._events,r=i.length;let s=0;for(;s<r&&!(e-i[s].time<n);)s++;return r>t&&(s=Math.max(s,r-t)),s>0&&i.splice(0,s),i}}class p{constructor(e,t){this.time=e,this.value=t}}},kEOa:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u09b0\u09be\u09a4|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t&&e>=4||"\u09a6\u09c1\u09aa\u09c1\u09b0"===t&&e<5||"\u09ac\u09bf\u0995\u09be\u09b2"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<10?"\u09b8\u0995\u09be\u09b2":e<17?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<20?"\u09ac\u09bf\u0995\u09be\u09b2":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},kJI8:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("SVse"),r=n("G0yt"),s=n("zWsK"),o=n("ChqD"),a=n("PCNd"),c=n("8Y7J");let l=(()=>{class e{}return e.\u0275mod=c.Kb({type:e}),e.\u0275inj=c.Jb({factory:function(t){return new(t||e)},imports:[[i.c,o.a,a.a,r.t,s.a]]}),e})()},kJWO:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")()},kOOl:function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+i).toString(36)}},kOpN:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},kRJp:function(e,t,n){var i=n("g6v/"),r=n("m/L8"),s=n("XGwC");e.exports=i?function(e,t,n){return r.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},kmMV:function(e,t,n){"use strict";var i,r,s=n("rW0t"),o=n("n3/R"),a=n("VpIT"),c=RegExp.prototype.exec,l=a("native-string-replace",String.prototype.replace),u=c,d=(r=/b*/g,c.call(i=/a/,"a"),c.call(r,"a"),0!==i.lastIndex||0!==r.lastIndex),h=o.UNSUPPORTED_Y||o.BROKEN_CARET,f=void 0!==/()??/.exec("")[1];(d||f||h)&&(u=function(e){var t,n,i,r,o=this,a=h&&o.sticky,u=s.call(o),p=o.source,m=0,b=e;return a&&(-1===(u=u.replace("y","")).indexOf("g")&&(u+="g"),b=String(e).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==e[o.lastIndex-1])&&(p="(?: "+p+")",b=" "+b,m++),n=new RegExp("^(?:"+p+")",u)),f&&(n=new RegExp("^"+p+"$(?!\\s)",u)),d&&(t=o.lastIndex),i=c.call(a?n:o,b),a?i?(i.input=i.input.slice(m),i[0]=i[0].slice(m),i.index=o.lastIndex,o.lastIndex+=i[0].length):o.lastIndex=0:d&&i&&(o.lastIndex=o.global?i.index+i[0].length:t),f&&i&&i.length>1&&l.call(i[0],n,(function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(i[r]=void 0)})),i}),e.exports=u},"kn/O":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n("HDdC"),r=n("mtw6"),s=n("G1I9"),o=n("QTAa"),a=n("9nlD"),c=n("mSOc"),l=n("VXsX"),u=n("ufoC"),d=n("8Y7J");let h=(()=>{class e{constructor(e,t,n,i){this.notificationService=e,this.summaryService=t,this.taskMessageService=n,this.taskManagerService=i}wrapTaskAroundCall({task:e,call:t}){return new i.a(n=>{t.subscribe(t=>{202===t.status?this._handleExecutingTasks(e):(this.summaryService.refresh(),e.success=!0,this.notificationService.notifyTask(e))},t=>{e.success=!1,e.exception=t.error,n.error(t)},()=>{n.complete()})})}_handleExecutingTasks(e){const t=new s.b(r.a.info,this.taskMessageService.getRunningTitle(e));t.isFinishedTask=!0,this.notificationService.show(t);const n=new o.a(e.name,e.metadata);this.summaryService.addRunningTask(n),this.taskManagerService.subscribe(n.name,n.metadata,e=>{this.notificationService.notifyTask(e)})}}return e.\u0275fac=function(t){return new(t||e)(d.dc(a.a),d.dc(c.a),d.dc(u.a),d.dc(l.a))},e.\u0275prov=d.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},kvvV:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("t/zF");class r extends i.a{}},l5ep:function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn \xf4l",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("wd/R"))},l7GE:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");class r extends i.a{notifyNext(e,t,n,i,r){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}},lJxs:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(e,t))}}class s{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new o(e,this.project,this.thisArg))}}class o extends i.a{constructor(e,t,n){super(e),this.project=t,this.count=0,this.thisArg=n||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},lMq5:function(e,t,n){var i=n("0Dky"),r=/#|\.prototype\./,s=function(e,t){var n=a[o(e)];return n==l||n!=c&&("function"==typeof t?i(t):!!t)},o=s.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";e.exports=s},"lOp/":function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("PqYM"),r=n("pxpQ"),s=n("eIep"),o=n("jtHE"),a=n("D0XW"),c=n("8Y7J");class l{constructor(e){this.zone=e,this.scheduler=a.b}now(){return this.scheduler.now()}}let u=(()=>{class e extends l{constructor(e){super(e)}schedule(...e){return this.zone.runOutsideAngular(()=>this.scheduler.schedule.apply(this.scheduler,e))}}return e.\u0275fac=function(t){return new(t||e)(c.dc(c.A))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d=(()=>{class e extends l{constructor(e){super(e)}schedule(...e){return this.zone.run(()=>this.scheduler.schedule.apply(this.scheduler,e))}}return e.\u0275fac=function(t){return new(t||e)(c.dc(c.A))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),h=(()=>{class e{constructor(e,t){this.leave=e,this.enter=t}}return e.\u0275fac=function(t){return new(t||e)(c.dc(u),c.dc(d))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),f=(()=>{class e{constructor(e){this.ngZone=e,this.DEFAULT_REFRESH_INTERVAL=5e3,this.DEFAULT_DUE_TIME=0}get(e,t=this.DEFAULT_REFRESH_INTERVAL,n=this.DEFAULT_DUE_TIME){return Object(i.a)(n,t,this.ngZone.leave).pipe(Object(r.b)(this.ngZone.enter),Object(s.a)(e),function(e,t,n){let i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:void 0,refCount:!1,scheduler:void 0},e=>e.lift(function({bufferSize:e=Number.POSITIVE_INFINITY,windowTime:t=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,a=0,c=!1,l=!1;return function(u){let d;a++,!r||c?(c=!1,r=new o.a(e,t,i),d=r.subscribe(this),s=u.subscribe({next(e){r.next(e)},error(e){c=!0,r.error(e)},complete(){l=!0,s=void 0,r.complete()}})):d=r.subscribe(this),this.add(()=>{a--,d.unsubscribe(),s&&!l&&n&&0===a&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}({refCount:!0,bufferSize:1}))}}return e.\u0275fac=function(t){return new(t||e)(c.dc(h))},e.\u0275prov=c.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},lXzo:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u043c\u0438\u043d\u0443\u0442\u0430":"\u043c\u0438\u043d\u0443\u0442\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u043c\u0438\u043d\u0443\u0442\u0430_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442":"\u043c\u0438\u043d\u0443\u0442\u0443_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442",hh:"\u0447\u0430\u0441_\u0447\u0430\u0441\u0430_\u0447\u0430\u0441\u043e\u0432",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u044f_\u0434\u043d\u0435\u0439",ww:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043d\u0435\u0434\u0435\u043b\u0438_\u043d\u0435\u0434\u0435\u043b\u044c",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u0430_\u043c\u0435\u0441\u044f\u0446\u0435\u0432",yy:"\u0433\u043e\u0434_\u0433\u043e\u0434\u0430_\u043b\u0435\u0442"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}var n=[/^\u044f\u043d\u0432/i,/^\u0444\u0435\u0432/i,/^\u043c\u0430\u0440/i,/^\u0430\u043f\u0440/i,/^\u043c\u0430[\u0439\u044f]/i,/^\u0438\u044e\u043d/i,/^\u0438\u044e\u043b/i,/^\u0430\u0432\u0433/i,/^\u0441\u0435\u043d/i,/^\u043e\u043a\u0442/i,/^\u043d\u043e\u044f/i,/^\u0434\u0435\u043a/i];e.defineLocale("ru",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u044f_\u0444\u0435\u0432\u0440\u0430\u043b\u044f_\u043c\u0430\u0440\u0442\u0430_\u0430\u043f\u0440\u0435\u043b\u044f_\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433\u0443\u0441\u0442\u0430_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f_\u043e\u043a\u0442\u044f\u0431\u0440\u044f_\u043d\u043e\u044f\u0431\u0440\u044f_\u0434\u0435\u043a\u0430\u0431\u0440\u044f".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_")},monthsShort:{format:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_"),standalone:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440\u0442_\u0430\u043f\u0440._\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_")},weekdays:{standalone:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0430_\u0441\u0443\u0431\u0431\u043e\u0442\u0430".split("_"),format:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0443_\u0441\u0443\u0431\u0431\u043e\u0442\u0443".split("_"),isFormat:/\[ ?[\u0412\u0432] ?(?:\u043f\u0440\u043e\u0448\u043b\u0443\u044e|\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e|\u044d\u0442\u0443)? ?] ?dddd/},weekdaysShort:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsShortRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsStrictRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044f\u044c]|\u0444\u0435\u0432\u0440\u0430\u043b[\u044f\u044c]|\u043c\u0430\u0440\u0442\u0430?|\u0430\u043f\u0440\u0435\u043b[\u044f\u044c]|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044f\u044c]|\u0438\u044e\u043b[\u044f\u044c]|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043e\u043a\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043d\u043e\u044f\u0431\u0440[\u044f\u044c]|\u0434\u0435\u043a\u0430\u0431\u0440[\u044f\u044c])/i,monthsShortStrictRegex:/^(\u044f\u043d\u0432\.|\u0444\u0435\u0432\u0440?\.|\u043c\u0430\u0440[\u0442.]|\u0430\u043f\u0440\.|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044c\u044f.]|\u0438\u044e\u043b[\u044c\u044f.]|\u0430\u0432\u0433\.|\u0441\u0435\u043d\u0442?\.|\u043e\u043a\u0442\.|\u043d\u043e\u044f\u0431?\.|\u0434\u0435\u043a\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., H:mm",LLLL:"dddd, D MMMM YYYY \u0433., H:mm"},calendar:{sameDay:"[\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432] LT",nextDay:"[\u0417\u0430\u0432\u0442\u0440\u0430, \u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430, \u0432] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e] dddd, [\u0432] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u0443\u044e] dddd, [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0447\u0435\u0440\u0435\u0437 %s",past:"%s \u043d\u0430\u0437\u0430\u0434",s:"\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0447\u0430\u0441",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,w:"\u043d\u0435\u0434\u0435\u043b\u044f",ww:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u0438|\u0443\u0442\u0440\u0430|\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430/i,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0438":e<12?"\u0443\u0442\u0440\u0430":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0435\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e|\u044f)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-\u0439";case"D":return e+"-\u0433\u043e";case"w":case"W":return e+"-\u044f";default:return e}},week:{dow:1,doy:4}})}(n("wd/R"))},lYtQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){switch(n){case"s":return t?"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434":"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d";case"ss":return e+(t?" \u0441\u0435\u043a\u0443\u043d\u0434":" \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d");case"m":case"mm":return e+(t?" \u043c\u0438\u043d\u0443\u0442":" \u043c\u0438\u043d\u0443\u0442\u044b\u043d");case"h":case"hh":return e+(t?" \u0446\u0430\u0433":" \u0446\u0430\u0433\u0438\u0439\u043d");case"d":case"dd":return e+(t?" \u04e9\u0434\u04e9\u0440":" \u04e9\u0434\u0440\u0438\u0439\u043d");case"M":case"MM":return e+(t?" \u0441\u0430\u0440":" \u0441\u0430\u0440\u044b\u043d");case"y":case"yy":return e+(t?" \u0436\u0438\u043b":" \u0436\u0438\u043b\u0438\u0439\u043d");default:return e}}e.defineLocale("mn",{months:"\u041d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0425\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0413\u0443\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u04e9\u0440\u04e9\u0432\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0422\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0417\u0443\u0440\u0433\u0430\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u043e\u043b\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u041d\u0430\u0439\u043c\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0415\u0441\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u043d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u0445\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440".split("_"),monthsShort:"1 \u0441\u0430\u0440_2 \u0441\u0430\u0440_3 \u0441\u0430\u0440_4 \u0441\u0430\u0440_5 \u0441\u0430\u0440_6 \u0441\u0430\u0440_7 \u0441\u0430\u0440_8 \u0441\u0430\u0440_9 \u0441\u0430\u0440_10 \u0441\u0430\u0440_11 \u0441\u0430\u0440_12 \u0441\u0430\u0440".split("_"),monthsParseExact:!0,weekdays:"\u041d\u044f\u043c_\u0414\u0430\u0432\u0430\u0430_\u041c\u044f\u0433\u043c\u0430\u0440_\u041b\u0445\u0430\u0433\u0432\u0430_\u041f\u04af\u0440\u044d\u0432_\u0411\u0430\u0430\u0441\u0430\u043d_\u0411\u044f\u043c\u0431\u0430".split("_"),weekdaysShort:"\u041d\u044f\u043c_\u0414\u0430\u0432_\u041c\u044f\u0433_\u041b\u0445\u0430_\u041f\u04af\u0440_\u0411\u0430\u0430_\u0411\u044f\u043c".split("_"),weekdaysMin:"\u041d\u044f_\u0414\u0430_\u041c\u044f_\u041b\u0445_\u041f\u04af_\u0411\u0430_\u0411\u044f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D",LLL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm",LLLL:"dddd, YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm"},meridiemParse:/\u04ae\u04e8|\u04ae\u0425/i,isPM:function(e){return"\u04ae\u0425"===e},meridiem:function(e,t,n){return e<12?"\u04ae\u04e8":"\u04ae\u0425"},calendar:{sameDay:"[\u04e8\u043d\u04e9\u04e9\u0434\u04e9\u0440] LT",nextDay:"[\u041c\u0430\u0440\u0433\u0430\u0430\u0448] LT",nextWeek:"[\u0418\u0440\u044d\u0445] dddd LT",lastDay:"[\u04e8\u0447\u0438\u0433\u0434\u04e9\u0440] LT",lastWeek:"[\u04e8\u043d\u0433\u04e9\u0440\u0441\u04e9\u043d] dddd LT",sameElse:"L"},relativeTime:{future:"%s \u0434\u0430\u0440\u0430\u0430",past:"%s \u04e9\u043c\u043d\u04e9",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} \u04e9\u0434\u04e9\u0440/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" \u04e9\u0434\u04e9\u0440";default:return e}}})}(n("wd/R"))},lgnt:function(e,t,n){!function(e){"use strict";var t={0:"-\u0447\u04af",1:"-\u0447\u0438",2:"-\u0447\u0438",3:"-\u0447\u04af",4:"-\u0447\u04af",5:"-\u0447\u0438",6:"-\u0447\u044b",7:"-\u0447\u0438",8:"-\u0447\u0438",9:"-\u0447\u0443",10:"-\u0447\u0443",20:"-\u0447\u044b",30:"-\u0447\u0443",40:"-\u0447\u044b",50:"-\u0447\u04af",60:"-\u0447\u044b",70:"-\u0447\u0438",80:"-\u0447\u0438",90:"-\u0447\u0443",100:"-\u0447\u04af"};e.defineLocale("ky",{months:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u0416\u0435\u043a\u0448\u0435\u043c\u0431\u0438_\u0414\u04af\u0439\u0448\u04e9\u043c\u0431\u04af_\u0428\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0428\u0430\u0440\u0448\u0435\u043c\u0431\u0438_\u0411\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0416\u0443\u043c\u0430_\u0418\u0448\u0435\u043c\u0431\u0438".split("_"),weekdaysShort:"\u0416\u0435\u043a_\u0414\u04af\u0439_\u0428\u0435\u0439_\u0428\u0430\u0440_\u0411\u0435\u0439_\u0416\u0443\u043c_\u0418\u0448\u0435".split("_"),weekdaysMin:"\u0416\u043a_\u0414\u0439_\u0428\u0439_\u0428\u0440_\u0411\u0439_\u0416\u043c_\u0418\u0448".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u04af\u043d \u0441\u0430\u0430\u0442] LT",nextDay:"[\u042d\u0440\u0442\u0435\u04a3 \u0441\u0430\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0447\u044d\u044d \u0441\u0430\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u04e9\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u043d] dddd [\u043a\u04af\u043d\u04af] [\u0441\u0430\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0438\u0447\u0438\u043d\u0434\u0435",past:"%s \u043c\u0443\u0440\u0443\u043d",s:"\u0431\u0438\u0440\u043d\u0435\u0447\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0438\u0440 \u043c\u04af\u043d\u04e9\u0442",mm:"%d \u043c\u04af\u043d\u04e9\u0442",h:"\u0431\u0438\u0440 \u0441\u0430\u0430\u0442",hh:"%d \u0441\u0430\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0438\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0438\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0447\u0438|\u0447\u044b|\u0447\u04af|\u0447\u0443)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},lkxz:function(e,t,n){"use strict";var i=n("Ce4a");t.a=function(e){var t=new e.constructor(e.byteLength);return new i.a(t).set(new i.a(e)),t}},loYQ:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn-bd",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u09b0\u09be\u09a4|\u09ad\u09cb\u09b0|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t?e<4?e:e+12:"\u09ad\u09cb\u09b0"===t||"\u09b8\u0995\u09be\u09b2"===t?e:"\u09a6\u09c1\u09aa\u09c1\u09b0"===t?e>=3?e:e+12:"\u09ac\u09bf\u0995\u09be\u09b2"===t||"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<6?"\u09ad\u09cb\u09b0":e<12?"\u09b8\u0995\u09be\u09b2":e<15?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<18?"\u09ac\u09bf\u0995\u09be\u09b2":e<20?"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},lyxo:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=" ";return(e%100>=20||e>=100&&e%100==0)&&(i=" de "),e+i+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"s\u0103pt\u0103m\xe2ni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminic\u0103_luni_mar\u021bi_miercuri_joi_vineri_s\xe2mb\u0103t\u0103".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_S\xe2m".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_S\xe2".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[m\xe2ine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s \xeen urm\u0103",s:"c\xe2teva secunde",ss:t,m:"un minut",mm:t,h:"o or\u0103",hh:t,d:"o zi",dd:t,w:"o s\u0103pt\u0103m\xe2n\u0103",ww:t,M:"o lun\u0103",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("wd/R"))},"m/L8":function(e,t,n){var i=n("g6v/"),r=n("DPsx"),s=n("glrk"),o=n("wE6v"),a=Object.defineProperty;t.f=i?a:function(e,t,n){if(s(e),t=o(t,!0),s(n),r)try{return a(e,t,n)}catch(i){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},mCNh:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s}));var i=n("SpAZ");function r(...e){return s(e)}function s(e){return 0===e.length?i.a:1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}}},mSOc:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=n("LvDl"),r=n.n(i),s=n("2Vo4"),o=n("pLZG"),a=n("SxV6"),c=n("lOp/"),l=n("8Y7J"),u=n("IheW");let d=(()=>{class e{constructor(e,t){this.http=e,this.timerService=t,this.REFRESH_INTERVAL=5e3,this.summaryDataSource=new s.a(null),this.summaryData$=this.summaryDataSource.asObservable()}startPolling(){return this.timerService.get(()=>this.retrieveSummaryObservable(),this.REFRESH_INTERVAL).subscribe(this.retrieveSummaryObserver())}refresh(){return this.retrieveSummaryObservable().subscribe(this.retrieveSummaryObserver())}retrieveSummaryObservable(){return this.http.get("api/summary")}retrieveSummaryObserver(){return e=>{this.summaryDataSource.next(e)}}subscribeOnce(e,t){return this.summaryData$.pipe(Object(o.a)(e=>!!e),Object(a.a)()).subscribe(e,t)}subscribe(e,t){return this.summaryData$.pipe(Object(o.a)(e=>!!e)).subscribe(e,t)}addRunningTask(e){const t=this.summaryDataSource.getValue();t&&(r.a.isArray(t.executing_tasks)?t.executing_tasks.find(t=>t.name===e.name&&r.a.isEqual(t.metadata,e.metadata))||t.executing_tasks.push(e):t.executing_tasks=[e],this.summaryDataSource.next(t))}}return e.\u0275fac=function(t){return new(t||e)(l.dc(u.b),l.dc(c.a))},e.\u0275prov=l.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},mkut:function(e,t,n){"use strict";var i=n("7gMY"),r=n("pyRK"),s=n("U6JX"),o=Object(s.a)(Object.keys,Object),a=Object.prototype.hasOwnProperty,c=n("5WsY");t.a=function(e){return Object(c.a)(e)?Object(i.a)(e):function(e){if(!Object(r.a)(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}},mrSG:function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function r(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function s(e,t){return function(n,i){t(n,i,e)}}function o(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function a(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(t){s(t)}}function a(e){try{c(i.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))}function c(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(a){s=[6,a],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}n.d(t,"f",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return c}))},mtw6:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e){return e[e.error=0]="error",e[e.info=1]="info",e[e.success=2]="success",e}({})},"n3/R":function(e,t,n){"use strict";var i=n("0Dky");function r(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=i((function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=i((function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},n561:function(e,t,n){"use strict";var i=n("tPH9"),r=n("UudT"),s=n("jN84"),o=n("WJ6P");t.a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Object(i.a)(t,Object(s.a)(e)),e=Object(r.a)(e);return t}:o.a},n6bG:function(e,t,n){"use strict";function i(e){return"function"==typeof e}n.d(t,"a",(function(){return i}))},nLtN:function(e,t,n){"use strict";var i=n("YHEm"),r=function(e,t){for(var n=e.length;n--;)if(Object(i.a)(e[n][0],t))return n;return-1},s=Array.prototype.splice;function o(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}o.prototype.clear=function(){this.__data__=[],this.size=0},o.prototype.delete=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():s.call(t,n,1),--this.size,0))},o.prototype.get=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]},o.prototype.has=function(e){return r(this.__data__,e)>-1},o.prototype.set=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},t.a=o},nSDx:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e){return r.a.isUndefined(e)||r.a.isNull(e)?"-":e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"empty",type:e,pure:!0}),e})()},ngJS:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=e=>t=>{for(let n=0,i=e.length;n<i&&!t.closed;n++)t.next(e[n]);t.complete()}},ntOU:function(e,t,n){"use strict";var i=n("rpNk").IteratorPrototype,r=n("fHMY"),s=n("XGwC"),o=n("1E5z"),a=n("P4y1"),c=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=r(i,{next:s(1,n)}),o(e,l,!1,!0),a[l]=c,e}},nyYc:function(e,t,n){!function(e){"use strict";var t=/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?|janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,n=[/^janv/i,/^f\xe9vr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^ao\xfbt/i,/^sept/i,/^oct/i,/^nov/i,/^d\xe9c/i];e.defineLocale("fr",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,monthsShortStrictRegex:/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},o1bE:function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},i=function(e){return function(i,r,s,o){var a=t(i),c=n[e][t(i)];return 2===a&&(c=c[r?0:1]),c.replace(/%d/i,i)}},r=["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0629","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:0,doy:4}})}(n("wd/R"))},"o4+5":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1e3,["","k","M","G","T","P","E","Z","Y"])}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(i.a))},e.\u0275pipe=r.Lb({name:"dimless",type:e,pure:!0}),e})()},o8EM:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("PhyI"),r=n("8Y7J");let s=(()=>{class e{constructor(){this.sections=[{heading:"Quality of Service",class:"quality-of-service",options:[{name:"rbd_qos_bps_limit",displayName:"BPS Limit",description:"The desired limit of IO bytes per second.",type:i.b.bps},{name:"rbd_qos_iops_limit",displayName:"IOPS Limit",description:"The desired limit of IO operations per second.",type:i.b.iops},{name:"rbd_qos_read_bps_limit",displayName:"Read BPS Limit",description:"The desired limit of read bytes per second.",type:i.b.bps},{name:"rbd_qos_read_iops_limit",displayName:"Read IOPS Limit",description:"The desired limit of read operations per second.",type:i.b.iops},{name:"rbd_qos_write_bps_limit",displayName:"Write BPS Limit",description:"The desired limit of write bytes per second.",type:i.b.bps},{name:"rbd_qos_write_iops_limit",displayName:"Write IOPS Limit",description:"The desired limit of write operations per second.",type:i.b.iops},{name:"rbd_qos_bps_burst",displayName:"BPS Burst",description:"The desired burst limit of IO bytes.",type:i.b.bps},{name:"rbd_qos_iops_burst",displayName:"IOPS Burst",description:"The desired burst limit of IO operations.",type:i.b.iops},{name:"rbd_qos_read_bps_burst",displayName:"Read BPS Burst",description:"The desired burst limit of read bytes.",type:i.b.bps},{name:"rbd_qos_read_iops_burst",displayName:"Read IOPS Burst",description:"The desired burst limit of read operations.",type:i.b.iops},{name:"rbd_qos_write_bps_burst",displayName:"Write BPS Burst",description:"The desired burst limit of write bytes.",type:i.b.bps},{name:"rbd_qos_write_iops_burst",displayName:"Write IOPS Burst",description:"The desired burst limit of write operations.",type:i.b.iops}]}]}static getOptionsFromSections(e){return e.map(e=>e.options).reduce((e,t)=>e.concat(t))}filterConfigOptionsByName(t){return e.getOptionsFromSections(this.sections).filter(e=>e.name===t)}getOptionValueByName(e,t,n=""){const i=this.filterConfigOptionsByName(e);return 1===i.length?i.pop()[t]:n}getWritableSections(){return this.sections.map(e=>(e.options=e.options.filter(e=>!e.readOnly),e))}getOptionFields(){return e.getOptionsFromSections(this.sections)}getWritableOptionFields(){return e.getOptionsFromSections(this.getWritableSections())}getOptionByName(e){return this.filterConfigOptionsByName(e).pop()}getDisplayName(e){return this.getOptionValueByName(e,"displayName")}getDescription(e){return this.getOptionValueByName(e,"description")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},oMSZ:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e){this.pwdExpirationSpan=0,this.pwdExpirationSpan=e.user_pwd_expiration_span,this.pwdExpirationWarning1=e.user_pwd_expiration_warning_1,this.pwdExpirationWarning2=e.user_pwd_expiration_warning_2}}},oSzE:function(e,t,n){"use strict";var i=n("nLtN"),r=n("3cmB"),s=n("DlmY");function o(e){var t=this.__data__=new i.a(e);this.size=t.size}o.prototype.clear=function(){this.__data__=new i.a,this.size=0},o.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},o.prototype.get=function(e){return this.__data__.get(e)},o.prototype.has=function(e){return this.__data__.has(e)},o.prototype.set=function(e,t){var n=this.__data__;if(n instanceof i.a){var o=n.__data__;if(!r.a||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new s.a(o)}return n.set(e,t),this.size=n.size,this},t.a=o},oYcn:function(e,t,n){"use strict";var i=n("8M4i"),r=n("Js68"),s=n("EUcb"),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1;var a=n("ovuK"),c=n("xutz"),l=c.a&&c.a.isTypedArray,u=l?Object(a.a)(l):function(e){return Object(s.a)(e)&&Object(r.a)(e.length)&&!!o[Object(i.a)(e)]};t.a=u},ocLN:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("s7LF"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.elRef=e,this.validationDisabled=!1}get hasErrors(){return this.formControlNames.some(e=>!e.valid&&e.dirty&&e.touched)&&!this.validationDisabled}get hasSuccess(){return!this.formControlNames.some(e=>!e.valid)&&this.formControlNames.some(e=>e.dirty&&e.touched)&&!this.validationDisabled}get label(){const e=this.elRef.nativeElement.querySelector("label");return e&&e.textContent?e.textContent.trim():"This field"}get isDirtyAndTouched(){return this.formControlNames.some(e=>e.dirty&&e.touched)}}return e.\u0275fac=function(t){return new(t||e)(r.Mb(r.m))},e.\u0275dir=r.Hb({type:e,selectors:[["",8,"form-group"]],contentQueries:function(e,t,n){var s;1&e&&r.Fb(n,i.i,!1),2&e&&r.zc(s=r.hc())&&(t.formControlNames=s)},hostVars:4,hostBindings:function(e,t){2&e&&r.Eb("has-error",t.hasErrors)("has-success",t.hasSuccess)},inputs:{validationDisabled:"validationDisabled"}}),e})()},"ohO+":function(e,t,n){"use strict";n.d(t,"a",(function(){return qr})),n.d(t,"b",(function(){return hs})),n.d(t,"c",(function(){return Is}));var i=n("8Y7J"),r=n("SVse"),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}function l(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}var u=[];Object.freeze(u);var d={};Object.freeze(d);var h={};function f(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:h}function p(){return++Le.mobxGuid}function m(e){throw b(!1,e),"X"}function b(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function g(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var _=function(){};function y(e){return null!==e&&"object"==typeof e}function v(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function w(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function S(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function M(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return y(e)&&!0===e[n]}}function x(e){return void 0!==f().Map&&e instanceof f().Map}function k(e){return e instanceof Set}function D(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function T(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function C(e){return null===e?null:"object"==typeof e?""+e:e}function O(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function R(e,t){S(e,O(),t)}function L(e){return e[O()]=A,e}function E(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function A(){return this}var I=function(){function e(e){void 0===e&&(e="Atom@"+p()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return Ne(this)},e.prototype.reportChanged=function(){Pe(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.UP_TO_DATE&&(i.isTracing!==ae.NONE&&Fe(i,e),i.onBecomeStale()),i.dependenciesState=oe.STALE}}}(this),je()},e.prototype.toString=function(){return this.name},e}(),P=M("Atom",I);function j(e,t){return e===t}var N={identity:j,structural:function(e,t){return Gt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||j(e,t)},shallow:function(e,t){return Gt(e,t,1)}},F={},Y={};function z(e,t){var n=t?F:Y;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return $(this),this[e]},set:function(t){$(this),this[e]=t}})}function $(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in w(e,"__mobxDidRunLazyInitializers",!0),t){var i=t[n];i.propertyCreator(e,i.prop,i.descriptor,i.decoratorTarget,i.decoratorArguments)}}}function H(e,t){return function(){var n,i=function(i,r,s,o){return!0===o?(t(i,r,s,i,n),null):(Object.prototype.hasOwnProperty.call(i,"__mobxDecorators")||w(i,"__mobxDecorators",a({},i.__mobxDecorators)),i.__mobxDecorators[r]={prop:r,propertyCreator:t,descriptor:s,decoratorTarget:i,decoratorArguments:n},z(r,e))};return W(arguments)?(n=u,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function W(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}function V(e,t,n){return at(e)?e:Array.isArray(e)?te.array(e,{name:n}):v(e)?te.object(e,void 0,{name:n}):x(e)?te.map(e,{name:n}):k(e)?te.set(e,{name:n}):e}function B(e){return e}function U(e){var t=H(!0,(function(t,n,i,r,s){!function(e,t,n,i){var r=Yt(e);if(ut(r)){var s=ht(r,{object:e,name:t,type:"add",newValue:n});if(!s)return;n=s.newValue}n=(r.values[t]=new De(n,i,r.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return zt[e]||(zt[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),r.keys&&r.keys.push(t),function(e,t,n,i){var r=ft(e),s=He(),o=r||s?{type:"add",object:t,name:n,newValue:i}:null;s&&Ve(a({},o,{name:e.name,key:n})),r&&mt(e,o),s&&Ue()}(r,e,t,n)}(t,n,i?i.initializer?i.initializer.call(t):i.value:void 0,e)})),n=("undefined"!=typeof process&&process,t);return n.enhancer=e,n}var G={deep:!0,name:void 0,defaultDecorator:void 0};function q(e){return null==e?G:"string"==typeof e?{name:e,deep:!0}:e}function J(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?B:V}Object.freeze(G),Object.freeze({deep:!1,name:void 0,defaultDecorator:void 0});var Q=U(V),K=U((function(e,t,n){return null==e||Vt(e)||Rt(e)||It(e)||Nt(e)?e:Array.isArray(e)?te.array(e,{name:n,deep:!1}):v(e)?te.object(e,void 0,{name:n,deep:!1}):x(e)?te.map(e,{name:n,deep:!1}):k(e)?te.set(e,{name:n,deep:!1}):m(!1)})),Z=U(B),X=U((function(e,t,n){return Gt(e,t)?t:e})),ee={box:function(e,t){arguments.length>2&&ne("box");var n=q(t);return new De(e,J(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ne("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ne("array");var n=q(t);return new xt(e,J(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ne("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ne("map");var n=q(t);return new Et(e,J(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ne("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ne("set");var n=q(t);return new jt(e,J(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ne("object");var i=q(n);return rt({},e,t,i)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ne("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:Z,shallow:K,deep:Q,struct:X},te=function(e,t,n){if("string"==typeof arguments[1])return Q.apply(null,arguments);if(at(e))return e;var i=v(e)?te.object(e,t,n):Array.isArray(e)?te.array(e,t):x(e)?te.map(e,t):k(e)?te.set(e,t):e;if(i!==e)return i;m(!1)};function ne(e){m("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach((function(e){return te[e]=ee[e]}));var ie=H(!1,(function(e,t,n,i,r){var s,o,c,l;s=e,o=t,c=a({get:n.get,set:n.set},r[0]||{}),l=Yt(s),c.name=l.name+"."+o,c.context=s,l.values[o]=new Te(c),Object.defineProperty(s,o,function(e){return $t[e]||($t[e]={configurable:Le.computedConfigurable,enumerable:!1,get:function(){return Ht(this).read(this,e)},set:function(t){Ht(this).write(this,e,t)}})}(o))})),re=ie({equals:N.structural}),se=function(e,t,n){if("string"==typeof t)return ie.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ie.apply(null,arguments);var i="object"==typeof t?t:{};return i.get=e,i.set="function"==typeof t?t:i.set,i.name=i.name||e.name||"",new Te(i)};se.struct=re;var oe=function(e){return e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE",e}({}),ae=function(e){return e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK",e}({}),ce=function(){return function(e){this.cause=e}}();function le(e){return e instanceof ce}function ue(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=me(),n=e.observing,i=n.length,r=0;r<i;r++){var s=n[r];if(Ce(s)){if(Le.disableErrorBoundaries)s.get();else try{s.get()}catch(o){return be(t),!0}if(e.dependenciesState===oe.STALE)return be(t),!0}}return ye(e),be(t),!1}}function de(e){var t=e.observers.length>0;Le.computationDepth>0&&t&&m(!1),Le.allowStateChanges||!t&&"strict"!==Le.enforceActions||m(!1)}function he(e,t,n){var i=ge(!0);ye(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Le.runId;var r,s=Le.trackingDerivation;if(Le.trackingDerivation=e,!0===Le.disableErrorBoundaries)r=t.call(n);else try{r=t.call(n)}catch(o){r=new ce(o)}return Le.trackingDerivation=s,function(e){for(var t=e.observing,n=e.observing=e.newObserving,i=oe.UP_TO_DATE,r=0,s=e.unboundDepsCount,o=0;o<s;o++)0===(a=n[o]).diffValue&&(a.diffValue=1,r!==o&&(n[r]=a),r++),a.dependenciesState>i&&(i=a.dependenciesState);for(n.length=r,e.newObserving=null,s=t.length;s--;)0===(a=t[s]).diffValue&&Ae(a,e),a.diffValue=0;for(;r--;){var a;1===(a=n[r]).diffValue&&(a.diffValue=0,Ee(a,e))}i!==oe.UP_TO_DATE&&(e.dependenciesState=i,e.onBecomeStale())}(e),_e(i),r}function fe(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Ae(t[n],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=me(),n=e();return be(t),n}function me(){var e=Le.trackingDerivation;return Le.trackingDerivation=null,e}function be(e){Le.trackingDerivation=e}function ge(e){var t=Le.allowStateReads;return Le.allowStateReads=e,t}function _e(e){Le.allowStateReads=e}function ye(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=oe.UP_TO_DATE}}var ve=0,we=1;function Se(e,t){var n=function(){return Me(e,t,this,arguments)};return n.isMobxAction=!0,n}function Me(e,t,n,i){var r=function(e,t,n){var i=He()&&!!e,r=0;if(i){r=Date.now();var s=n&&n.length||0,o=new Array(s);if(s>0)for(var a=0;a<s;a++)o[a]=n[a];Ve({type:"action",name:e,object:t,arguments:o})}var c=me();Pe();var l={prevDerivation:c,prevAllowStateChanges:xe(!0),prevAllowStateReads:ge(!0),notifySpy:i,startTime:r,actionId:we++,parentActionId:ve};return ve=l.actionId,l}(e,n,i);try{return t.apply(n,i)}catch(s){throw r.error=s,s}finally{!function(e){ve!==e.actionId&&m("invalid action stack. did you forget to finish an action?"),ve=e.parentActionId,void 0!==e.error&&(Le.suppressReactionErrors=!0),ke(e.prevAllowStateChanges),_e(e.prevAllowStateReads),je(),be(e.prevDerivation),e.notifySpy&&Ue({time:Date.now()-e.startTime}),Le.suppressReactionErrors=!1}(r)}}function xe(e){var t=Le.allowStateChanges;return Le.allowStateChanges=e,t}function ke(e){Le.allowStateChanges=e}var De=function(e){function t(t,n,i,r,s){void 0===i&&(i="ObservableValue@"+p()),void 0===r&&(r=!0),void 0===s&&(s=N.default);var o=e.call(this,i)||this;return o.enhancer=n,o.name=i,o.equals=s,o.hasUnreportedChange=!1,o.value=n(t,void 0,i),r&&He()&&We({type:"create",name:o.name,newValue:""+o.value}),o}return o(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Le.UNCHANGED){var n=He();n&&Ve({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Ue()}},t.prototype.prepareNewValue=function(e){if(de(this),ut(this)){var t=ht(this,{object:this,type:"update",newValue:e});if(!t)return Le.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Le.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),ft(this)&&mt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return dt(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),pt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return C(this.get())},t}(I);De.prototype[T()]=De.prototype.valueOf,M("ObservableValue",De);var Te=function(){function e(e){this.dependenciesState=oe.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=oe.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+p(),this.value=new ce(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=ae.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+p(),e.set&&(this.setter=Se(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?N.structural:N.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState===oe.UP_TO_DATE){e.lowestObserverState=oe.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.UP_TO_DATE&&(i.dependenciesState=oe.POSSIBLY_STALE,i.isTracing!==ae.NONE&&Fe(i,e),i.onBecomeStale())}}}(this)},e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.get=function(){this.isComputing&&m("Cycle detected in computation "+this.name+": "+this.derivation),0!==Le.inBatch||0!==this.observers.length||this.keepAlive?(Ne(this),ue(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.POSSIBLY_STALE?i.dependenciesState=oe.STALE:i.dependenciesState===oe.UP_TO_DATE&&(e.lowestObserverState=oe.UP_TO_DATE)}}}(this)):ue(this)&&(this.warnAboutUntrackedRead(),Pe(),this.value=this.computeValue(!1),je());var e=this.value;if(le(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(le(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){b(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else b(!1,!1)},e.prototype.trackAndCompute=function(){He()&&We({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===oe.NOT_TRACKING,n=this.computeValue(!0),i=t||le(e)||le(n)||!this.equals(e,n);return i&&(this.value=n),i},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Le.computationDepth++,e)t=he(this,this.derivation,this.scope);else if(!0===Le.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(n){t=new ce(n)}return Le.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(fe(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,i=!0,r=void 0;return Ze((function(){var s=n.get();if(!i||t){var o=me();e({type:"update",object:n,newValue:s,oldValue:r}),be(o)}i=!1,r=s}))},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return C(this.get())},e}();Te.prototype[T()]=Te.prototype.valueOf;var Ce=M("ComputedValue",Te),Oe=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),Re=!0,Le=function(){var e=f();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Re=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Oe).version&&(Re=!1),Re?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Oe):(setTimeout((function(){m("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Oe)}();function Ee(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ae(e,t){if(1===e.observers.length)e.observers.length=0,Ie(e);else{var n=e.observers,i=e.observersIndexes,r=n.pop();if(r!==t){var s=i[t.__mapid]||0;s?i[r.__mapid]=s:delete i[r.__mapid],n[s]=r}delete i[t.__mapid]}}function Ie(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Le.pendingUnobservations.push(e))}function Pe(){Le.inBatch++}function je(){if(0==--Le.inBatch){ze();for(var e=Le.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Te&&n.suspend())}Le.pendingUnobservations=[]}}function Ne(e){var t=Le.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&Le.inBatch>0&&Ie(e),!1)}function Fe(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var n=[];!function e(t,n,i){n.length>=1e3?n.push("(and many more)"):(n.push(""+new Array(i).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return e(t,n,i+1)})))}((i=e,st(Bt(i,void 0))),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Te?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n    ")()}var i}var Ye=function(){function e(e,t,n,i){void 0===e&&(e="Reaction@"+p()),void 0===i&&(i=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Le.pendingReactions.push(this),ze())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Pe(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&He()&&We({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}je()}},e.prototype.track=function(e){Pe();var t,n=He();n&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var i=he(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(i)&&this.reportExceptionInDerivation(i.cause),n&&Ue({time:Date.now()-t}),je()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Le.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Le.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),He()&&We({type:"error",name:this.name,message:n,error:""+e}),Le.globalReactionErrorHandlers.forEach((function(n){return n(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Pe(),fe(this),je()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var i=ct(e);if(!i)return m(!1);i.isTracing===ae.NONE&&console.log("[mobx.trace] '"+i.name+"' tracing enabled"),i.isTracing=n?ae.BREAK:ae.LOG}(this,e)},e}();function ze(){Le.inBatch>0||Le.isRunningReactions||function(){Le.isRunningReactions=!0;for(var e=Le.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction()}Le.isRunningReactions=!1}()}var $e=M("Reaction",Ye);function He(){return!!Le.spyListeners.length}function We(e){if(Le.spyListeners.length)for(var t=Le.spyListeners,n=0,i=t.length;n<i;n++)t[n](e)}function Ve(e){We(a({},e,{spyReportStart:!0}))}var Be={spyReportEnd:!0};function Ue(e){We(e?a({},e,{spyReportEnd:!0}):Be)}function Ge(){m(!1)}function qe(e){return function(t,n,i){if(i){if(i.value)return{value:Se(e,i.value),enumerable:!1,configurable:!0,writable:!0};var r=i.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Se(e,r.call(this))}}}return Je(e).apply(this,arguments)}}function Je(e){return function(t,n,i){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){w(this,n,Qe(e,t))}})}}var Qe=function(e,t,n,i){return 1===arguments.length&&"function"==typeof e?Se(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?Se(e,t):1===arguments.length&&"string"==typeof e?qe(e):!0!==i?qe(t).apply(null,arguments):void(e[t]=Se(e.name||t,n.value))};function Ke(e,t,n){w(e,t,Se(t,n.bind(e)))}function Ze(e,t){void 0===t&&(t=d);var n,i=t&&t.name||e.name||"Autorun@"+p();if(t.scheduler||t.delay){var r=et(t),s=!1;n=new Ye(i,(function(){s||(s=!0,r((function(){s=!1,n.isDisposed||n.track(o)})))}),t.onError,t.requiresObservable)}else n=new Ye(i,(function(){this.track(o)}),t.onError,t.requiresObservable);function o(){e(n)}return n.schedule(),n.getDisposer()}Qe.bound=function(e,t,n,i){return!0===i?(Ke(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Ke(this,t,n.value||n.initializer.call(this)),this[t]},set:Ge}:{enumerable:!1,configurable:!0,set:function(e){Ke(this,t,e)},get:function(){}}};var Xe=function(e){return e()};function et(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Xe}function tt(e,t,n){void 0===n&&(n=d),"boolean"==typeof n&&(n={fireImmediately:n});var i,r,s,o=n.name||"Reaction@"+p(),a=Qe(o,n.onError?(i=n.onError,r=t,function(){try{return r.apply(this,arguments)}catch(e){i.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=et(n),u=!0,h=!1,f=n.compareStructural?N.structural:n.equals||N.default,m=new Ye(o,(function(){u||c?b():h||(h=!0,l(b))}),n.onError,n.requiresObservable);function b(){if(h=!1,!m.isDisposed){var t=!1;m.track((function(){var n=e(m);t=u||!f(s,n),s=n})),u&&n.fireImmediately&&a(s,m),u||!0!==t||a(s,m),u&&(u=!1)}}return m.schedule(),m.getDisposer()}function nt(e,t,n){return it("onBecomeUnobserved",e,t,n)}function it(e,t,n,i){var r="function"==typeof i?Bt(t,n):Bt(t),s="function"==typeof i?i:n,o=r[e];return"function"!=typeof o?m(!1):(r[e]=function(){o.call(this),s.call(this)},function(){r[e]=o})}function rt(e,t,n,i){var r=(i=q(i)).defaultDecorator||(!1===i.deep?Z:Q);$(e),Yt(e,i.name,r.enhancer),Pe();try{for(var s in t){var o=Object.getOwnPropertyDescriptor(t,s),a=(n&&s in n?n[s]:o.get?ie:r)(e,s,o,!0);a&&Object.defineProperty(e,s,a)}}finally{je()}return e}function st(e){var t,n,i={name:e.name};return e.observing&&e.observing.length>0&&(i.dependencies=(t=e.observing,n=[],t.forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),n).map(st)),i}function ot(e,t){if(null==e)return!1;if(void 0!==t){if(Vt(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Vt(e)||!!e.$mobx||P(e)||$e(e)||Ce(e)}function at(e){return 1!==arguments.length&&m(!1),ot(e)}function ct(e){switch(e.length){case 0:return Le.trackingDerivation;case 1:return Bt(e[0]);case 2:return Bt(e[0],e[1])}}function lt(e,t){void 0===t&&(t=void 0),Pe();try{return e.apply(t)}finally{je()}}function ut(e){return void 0!==e.interceptors&&e.interceptors.length>0}function dt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function ht(e,t){var n=me();try{var i=e.interceptors;if(i)for(var r=0,s=i.length;r<s&&(b(!(t=i[r](t))||t.type,"Intercept handlers should return nothing or a change object"),t);r++);return t}finally{be(n)}}function ft(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function pt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),g((function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}))}function mt(e,t){var n=me(),i=e.changeListeners;if(i){for(var r=0,s=(i=i.slice()).length;r<s;r++)i[r](t);be(n)}}var bt,gt,_t,yt,vt=(bt=!1,gt={},Object.defineProperty(gt,"0",{set:function(){bt=!0}}),Object.create(gt)[0]=1,!1===bt),wt=0,St=function(){return function(){}}();_t=St,yt=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(_t.prototype,yt):void 0!==_t.prototype.__proto__?_t.prototype.__proto__=yt:_t.prototype=yt,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach((function(e){Object.defineProperty(St.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})}));var Mt=function(){function e(e,t,n,i){this.array=n,this.owned=i,this.values=[],this.lastKnownLength=0,this.atom=new I(e||"ObservableArray@"+p()),this.enhancer=function(n,i){return t(n,i,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),pt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),i=0;i<e-t;i++)n[i]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>wt&&Ct(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var i=this;de(this.atom);var r=this.values.length;if(void 0===e?e=0:e>r?e=r:e<0&&(e=Math.max(0,r+e)),t=1===arguments.length?r-e:null==t?0:Math.max(0,Math.min(t,r-e)),void 0===n&&(n=u),ut(this)){var s=ht(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!s)return u;t=s.removedCount,n=s.added}var o=(n=0===n.length?n:n.map((function(e){return i.enhancer(e,void 0)}))).length-t;this.updateArrayLength(r,o);var a=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,a),this.dehanceValues(a)},e.prototype.spliceItemsIntoValues=function(e,t,n){var i;if(n.length<1e4)return(i=this.values).splice.apply(i,l([e,t],n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r},e.prototype.notifyArrayChildUpdate=function(e,t,n){var i=!this.owned&&He(),r=ft(this),s=r||i?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;i&&Ve(a({},s,{name:this.atom.name})),this.atom.reportChanged(),r&&mt(this,s),i&&Ue()},e.prototype.notifyArraySplice=function(e,t,n){var i=!this.owned&&He(),r=ft(this),s=r||i?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;i&&Ve(a({},s,{name:this.atom.name})),this.atom.reportChanged(),r&&mt(this,s),i&&Ue()},e}(),xt=function(e){function t(t,n,i,r){void 0===i&&(i="ObservableArray@"+p()),void 0===r&&(r=!1);var s=e.call(this)||this,o=new Mt(i,n,s,r);if(S(s,"$mobx",o),t&&t.length){var a=xe(!0);s.spliceWithArray(0,0,t),ke(a)}return vt&&Object.defineProperty(o.array,"0",kt),s}return o(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map((function(e){return Rt(e)?e.peek():e})))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0);var i=this.findIndex.apply(this,arguments);return-1===i?void 0:this.get(i)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0);for(var i=this.peek(),r=i.length,s=n;s<r;s++)if(e.call(t,i[s],s,this))return s;return-1},t.prototype.splice=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var i,r=this.$mobx.values;i=e<t?l(r.slice(0,e),r.slice(e+1,t+1),[r[e]],r.slice(t+1)):l(r.slice(0,t),[r[e]],r.slice(t,e),r.slice(e+1)),this.replace(i)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,i=n.values;if(e<i.length){de(n.atom);var r=i[e];if(ut(n)){var s=ht(n,{type:"update",object:this,index:e,newValue:t});if(!s)return;t=s.newValue}(t=n.enhancer(t,r))!==r&&(i[e]=t,n.notifyArrayChildUpdate(e,t,r))}else{if(e!==i.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+i.length);n.spliceWithArray(e,0,[t])}},t}(St);R(xt.prototype,(function(){this.$mobx.atom.reportObserved();var e=this,t=0;return L({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})})),Object.defineProperty(xt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),w(xt.prototype,E(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach((function(e){var t=Array.prototype[e];b("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),w(xt.prototype,e,(function(){return t.apply(this.peek(),arguments)}))})),function(e,t){for(var n=0;n<t.length;n++)w(e,t[n],e[t[n]])}(xt.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var kt=Dt(0);function Dt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Tt(e){Object.defineProperty(xt.prototype,""+e,Dt(e))}function Ct(e){for(var t=wt;t<e;t++)Tt(t);wt=e}Ct(1e3);var Ot=M("ObservableArrayAdministration",Mt);function Rt(e){return y(e)&&Ot(e.$mobx)}var Lt={},Et=function(){function e(e,t,n){if(void 0===t&&(t=V),void 0===n&&(n="ObservableMap@"+p()),this.enhancer=t,this.name=n,this.$mobx=Lt,this._keys=new xt(void 0,B,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!Le.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var i=n=new De(this._has(e),B,this.name+"."+At(e)+"?",!1);this._hasMap.set(e,i),nt(i,(function(){return t._hasMap.delete(e)}))}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(ut(this)){var i=ht(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!i)return this;t=i.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(ut(this)&&!(r=ht(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=He(),i=ft(this),r=i||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&Ve(a({},r,{name:this.name,key:e})),lt((function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)})),i&&mt(this,r),n&&Ue(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==Le.UNCHANGED){var i=He(),r=ft(this),s=r||i?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;i&&Ve(a({},s,{name:this.name,key:e})),n.setNewValue(t),r&&mt(this,s),i&&Ue()}},e.prototype._addValue=function(e,t){var n=this;lt((function(){var i=new De(t,n.enhancer,n.name+"."+At(e),!1);n._data.set(e,i),t=i.value,n._updateHasMapEntry(e,!0),n._keys.push(e)}));var i=He(),r=ft(this),s=r||i?{type:"add",object:this,name:e,newValue:t}:null;i&&Ve(a({},s,{name:this.name,key:e})),r&&mt(this,s),i&&Ue()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[O()]()},e.prototype.values=function(){var e=this,t=0;return L({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return L({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach((function(i){return e.call(t,n.get(i),i,n)}))},e.prototype.merge=function(e){var t=this;return It(e)&&(e=e.toJS()),lt((function(){v(e)?Object.keys(e).forEach((function(n){return t.set(n,e[n])})):Array.isArray(e)?e.forEach((function(e){var n=c(e,2);return t.set(n[0],n[1])})):x(e)?e.constructor!==Map?m("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach((function(e,n){return t.set(n,e)})):null!=e&&m("Cannot initialize map from "+e)})),this},e.prototype.clear=function(){var e=this;lt((function(){pe((function(){e._keys.slice().forEach((function(t){return e.delete(t)}))}))}))},e.prototype.replace=function(e){var t=this;return lt((function(){for(var n,i=x(n=e)||It(n)?n:Array.isArray(n)?new Map(n):v(n)?new Map(Object.entries(n)):m("Cannot convert to map from '"+n+"'"),r=t._keys,s=Array.from(i.keys()),o=!1,a=0;a<r.length;a++){var c=r[a];r.length===s.length&&c!==s[a]&&(o=!0),i.has(c)||(o=!0,t.delete(c))}i.forEach((function(e,n){t._data.has(n)||(o=!0),t.set(n,e)})),o&&t._keys.replace(s)})),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach((function(n){return t["symbol"==typeof n?n:At(n)]=e.get(n)})),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach((function(n){return t.set(n,e.get(n))})),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map((function(t){return At(t)+": "+e.get(t)})).join(", ")+" }]"},e.prototype.observe=function(e,t){return pt(this,e)},e.prototype.intercept=function(e){return dt(this,e)},e}();function At(e){return e&&e.toString?e.toString():new String(e).toString()}R(Et.prototype,(function(){return this.entries()})),S(Et.prototype,E(),"Map");var It=M("ObservableMap",Et),Pt={},jt=function(){function e(e,t,n){if(void 0===t&&(t=V),void 0===n&&(n="ObservableSet@"+p()),this.name=n,this.$mobx=Pt,this._data=new Set,this._atom=function(e,t,n){void 0===t&&(t=_),void 0===n&&(n=_);var i=new I(e);return it("onBecomeObserved",i,t,void 0),nt(i,n),i}(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,i){return t(e,i,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;lt((function(){pe((function(){e._data.forEach((function(t){e.delete(t)}))}))}))},e.prototype.forEach=function(e,t){var n=this;this._data.forEach((function(i){e.call(t,i,i,n)}))},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if(de(this._atom),ut(this)&&!(r=ht(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){lt((function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()}));var n=He(),i=ft(this),r=i||n?{type:"add",object:this,newValue:e}:null;i&&mt(this,r)}return this},e.prototype.delete=function(e){var t=this;if(ut(this)&&!(r=ht(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=He(),i=ft(this),r=i||n?{type:"delete",object:this,oldValue:e}:null;return lt((function(){t._atom.reportChanged(),t._data.delete(e)})),i&&mt(this,r),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=D(this.keys()),n=D(this.values());return L({next:function(){var i=e;return e+=1,i<n.length?{value:[t[i],n[i]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=D(this._data.values()):(e=[],this._data.forEach((function(t){return e.push(t)}))),L({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return Nt(e)&&(e=e.toJS()),lt((function(){Array.isArray(e)||k(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&m("Cannot initialize set from "+e)})),this},e.prototype.observe=function(e,t){return pt(this,e)},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+D(this.keys()).join(", ")+" ]"},e}();R(jt.prototype,(function(){return this.values()})),S(jt.prototype,E(),"Set");var Nt=M("ObservableSet",jt),Ft=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var i=this.target;i!==e&&this.illegalAccess(e,t);var r=this.values[t];if(r instanceof Te)r.set(n);else{if(ut(this)){if(!(c=ht(this,{type:"update",object:i,name:t,newValue:n})))return;n=c.newValue}if((n=r.prepareNewValue(n))!==Le.UNCHANGED){var s=ft(this),o=He(),c=s||o?{type:"update",object:i,oldValue:r.value,name:t,newValue:n}:null;o&&Ve(a({},c,{name:this.name,key:t})),r.setNewValue(n),s&&mt(this,c),o&&Ue()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(ut(this)&&!(s=ht(this,{object:t,name:e,type:"remove"})))return;try{Pe();var n=ft(this),i=He(),r=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var s=n||i?{type:"remove",object:t,oldValue:r,name:e}:null;i&&Ve(a({},s,{name:this.name,key:e})),n&&mt(this,s),i&&Ue()}finally{je()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return pt(this,e)},e.prototype.intercept=function(e){return dt(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new xt(Object.keys(this.values).filter((function(t){return e.values[t]instanceof De})),B,"keys("+this.name+")",!0)),this.keys.slice()},e}();function Yt(e,t,n){void 0===t&&(t=""),void 0===n&&(n=V);var i=e.$mobx;return i||(v(e)||(t=(e.constructor.name||"ObservableObject")+"@"+p()),t||(t="ObservableObject@"+p()),S(e,"$mobx",i=new Ft(e,t,n)),i)}var zt=Object.create(null),$t=Object.create(null);function Ht(e){return e.$mobx||($(e),e.$mobx)}var Wt=M("ObservableObjectAdministration",Ft);function Vt(e){return!!y(e)&&($(e),Wt(e.$mobx))}function Bt(e,t){if("object"==typeof e&&null!==e){if(Rt(e))return void 0!==t&&m(!1),e.$mobx.atom;if(Nt(e))return e.$mobx;if(It(e)){var n=e;return void 0===t?Bt(n._keys):((i=n._data.get(t)||n._hasMap.get(t))||m(!1),i)}var i;if($(e),Vt(e))return t?((i=e.$mobx.values[t])||m(!1),i):m(!1);if(P(e)||Ce(e)||$e(e))return e}else if("function"==typeof e&&$e(e.$mobx))return e.$mobx;return m(!1)}var Ut=Object.prototype.toString;function Gt(e,t,n){return void 0===n&&(n=-1),function e(t,n,i,r,s){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return!1;if(t!=t)return n!=n;var o=typeof t;if("function"!==o&&"object"!==o&&"object"!=typeof n)return!1;t=qt(t),n=qt(n);var a=Ut.call(t);if(a!==Ut.call(n))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(n)}var c="[object Array]"===a;if(!c){if("object"!=typeof t||"object"!=typeof n)return!1;var l=t.constructor,u=n.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in t&&"constructor"in n)return!1}if(0===i)return!1;i<0&&(i=-1),s=s||[];for(var d=(r=r||[]).length;d--;)if(r[d]===t)return s[d]===n;if(r.push(t),s.push(n),c){if((d=t.length)!==n.length)return!1;for(;d--;)if(!e(t[d],n[d],i-1,r,s))return!1}else{var h=Object.keys(t),f=void 0;if(d=h.length,Object.keys(n).length!==d)return!1;for(;d--;)if(!Jt(n,f=h[d])||!e(t[f],n[f],i-1,r,s))return!1}return r.pop(),s.pop(),!0}(e,t,n)}function qt(e){return Rt(e)?e.peek():x(e)||It(e)||k(e)||Nt(e)?D(e.entries()):e}function Jt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return Le.spyListeners.push(e),g((function(){Le.spyListeners=Le.spyListeners.filter((function(t){return t!==e}))}))},extras:{getDebugName:function(e,t){return(void 0!==t?Bt(e,t):Vt(e)||It(e)||Nt(e)?function e(t,n){return t||m("Expecting some object"),void 0!==n?e(Bt(t,n)):P(t)||Ce(t)||$e(t)||It(t)||Nt(t)?t:($(t),t.$mobx?t.$mobx:void m(!1))}(e):Bt(e)).name}},$mobx:"$mobx"});var Qt,Kt,Zt,Xt,en=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},tn=function(e){return e},nn=Math.max,rn=function(e,t,n){return t=nn(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=nn(i.length-t,0),o=Array(s);++r<s;)o[r]=i[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=i[r];return a[t]=n(o),en(e,this,a)}},sn=n("AwXo"),on=Date.now,an=(Qt=sn.a?function(e,t){return Object(sn.a)(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:tn,Kt=0,Zt=0,function(){var e=on(),t=16-(e-Zt);if(Zt=e,t>0){if(++Kt>=800)return arguments[0]}else Kt=0;return Qt.apply(void 0,arguments)}),cn=function(e,t){return an(rn(e,t,tn),e+"")},ln=n("oSzE"),un=n("uE2L"),dn=n("YHEm"),hn=function(e,t,n){(void 0!==n&&!Object(dn.a)(e[t],n)||void 0===n&&!(t in e))&&Object(un.a)(e,t,n)},fn=function(e,t,n){for(var i=-1,r=Object(e),s=n(e),o=s.length;o--;){var a=s[++i];if(!1===t(r[a],a,r))break}return e},pn=n("3/ER"),mn=n("G4mU"),bn=n("eAQQ"),gn=n("hYPf"),_n=n("9f76"),yn=n("/1FC"),vn=n("5WsY"),wn=n("EUcb"),Sn=n("WOAq"),Mn=n("vJtL"),xn=n("IzLi"),kn=n("8M4i"),Dn=n("UudT"),Tn=Function.prototype.toString,Cn=Object.prototype.hasOwnProperty,On=Tn.call(Object),Rn=function(e){if(!Object(wn.a)(e)||"[object Object]"!=Object(kn.a)(e))return!1;var t=Object(Dn.a)(e);if(null===t)return!0;var n=Cn.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Tn.call(n)==On},Ln=n("oYcn"),En=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},An=n("+EKe"),In=n("4/q3"),Pn=function e(t,n,i,r,s){t!==n&&fn(n,(function(o,a){if(s||(s=new ln.a),Object(xn.a)(o))!function(e,t,n,i,r,s,o){var a,c=En(e,n),l=En(t,n),u=o.get(l);if(u)hn(e,n,u);else{var d=s?s(c,l,n+"",e,t,o):void 0,h=void 0===d;if(h){var f=Object(yn.a)(l),p=!f&&Object(Sn.a)(l),m=!f&&!p&&Object(Ln.a)(l);d=l,f||p||m?Object(yn.a)(c)?d=c:(a=c,Object(wn.a)(a)&&Object(vn.a)(a)?d=Object(bn.a)(c):p?(h=!1,d=Object(pn.a)(l,!0)):m?(h=!1,d=Object(mn.a)(l,!0)):d=[]):Rn(l)||Object(_n.a)(l)?(d=c,Object(_n.a)(c)?d=function(e){return Object(An.a)(e,Object(In.a)(e))}(c):Object(xn.a)(c)&&!Object(Mn.a)(c)||(d=Object(gn.a)(l))):h=!1}h&&(o.set(l,d),r(d,l,i,s,o),o.delete(l)),hn(e,n,d)}}(t,n,a,i,e,r,s);else{var c=r?r(En(t,a),o,a+"",t,n,s):void 0;void 0===c&&(c=o),hn(t,a,c)}}),In.a)},jn=function e(t,n,i,r,s,o){return Object(xn.a)(t)&&Object(xn.a)(n)&&(o.set(n,t),Pn(t,n,void 0,e,o),o.delete(n)),t},Nn=n("cSlR"),Fn=function(e,t,n){if(!Object(xn.a)(n))return!1;var i=typeof t;return!!("number"==i?Object(vn.a)(n)&&Object(Nn.a)(t,n.length):"string"==i&&t in n)&&Object(dn.a)(n[t],e)},Yn=(Xt=function(e,t,n,i){Pn(e,t,n,i)},cn((function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(r=Xt.length>3&&"function"==typeof r?(i--,r):void 0,s&&Fn(t[0],t[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++n<i;){var o=t[n];o&&Xt(e,o,n,r)}return e}))),zn=cn((function(e){return e.push(void 0,jn),en(Yn,void 0,e)})),$n=function(e){return"symbol"==typeof e||Object(wn.a)(e)&&"[object Symbol]"==Object(kn.a)(e)},Hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/,Vn=function(e,t){if(Object(yn.a)(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$n(e))||Wn.test(e)||!Hn.test(e)||null!=t&&e in Object(t)},Bn=n("DlmY");function Un(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Un.Cache||Bn.a),n}Un.Cache=Bn.a;var Gn,qn,Jn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qn=/\\(\\)?/g,Kn=(Gn=Un((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Jn,(function(e,n,i,r){t.push(i?r.replace(Qn,"$1"):n||e)})),t}),(function(e){return 500===qn.size&&qn.clear(),e})),qn=Gn.cache,Gn),Zn=n("ylTp"),Xn=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r},ei=Zn.a?Zn.a.prototype:void 0,ti=ei?ei.toString:void 0,ni=function(e,t){return Object(yn.a)(e)?e:Vn(e,t)?[e]:Kn(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Object(yn.a)(t))return Xn(t,e)+"";if($n(t))return ti?ti.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))},ii=function(e){if("string"==typeof e||$n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},ri=function(e,t){for(var n=0,i=(t=ni(t,e)).length;null!=e&&n<i;)e=e[ii(t[n++])];return n&&n==i?e:void 0},si=function(e,t,n){var i=null==e?void 0:ri(e,t);return void 0===i?n:i},oi=n("CfRg"),ai=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},ci=function(e,t){return null==(e=function(e,t){return t.length<2?e:ri(e,function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}(t,0,-1))}(e,t=ni(t,e)))||delete e[ii(ai(t))]},li=function(e){return Rn(e)?void 0:e},ui=n("tPH9"),di=Zn.a?Zn.a.isConcatSpreadable:void 0,hi=function(e){return Object(yn.a)(e)||Object(_n.a)(e)||!!(di&&e&&e[di])},fi=function(e){return null!=e&&e.length?function e(t,n,i,r,s){var o=-1,a=t.length;for(i||(i=hi),s||(s=[]);++o<a;){var c=t[o];n>0&&i(c)?n>1?e(c,n-1,i,r,s):Object(ui.a)(s,c):r||(s[s.length]=c)}return s}(e,1):[]},pi=function(e){return an(rn(e,void 0,fi),e+"")},mi=n("TnHx"),bi=pi((function(e,t){var n={};if(null==e)return n;var i=!1;t=Xn(t,(function(t){return t=ni(t,e),i||(i=t.length>1),t})),Object(An.a)(e,Object(mi.a)(e),n),i&&(n=Object(oi.a)(n,7,li));for(var r=t.length;r--;)ci(n,t[r]);return n})),gi=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};function _i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Bn.a;++t<n;)this.add(e[t])}_i.prototype.add=_i.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},_i.prototype.has=function(e){return this.__data__.has(e)};var yi=_i,vi=function(e,t){return e.has(t)},wi=function(e,t,n,i,r,s){var o=1&n,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,f=2&n?new yi:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var p=e[d],m=t[d];if(i)var b=o?i(m,p,d,t,e,s):i(p,m,d,e,t,s);if(void 0!==b){if(b)continue;h=!1;break}if(f){if(!gi(t,(function(e,t){if(!vi(f,t)&&(p===e||r(p,e,n,i,s)))return f.push(t)}))){h=!1;break}}else if(p!==m&&!r(p,m,n,i,s)){h=!1;break}}return s.delete(e),s.delete(t),h},Si=n("Ce4a"),Mi=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n},xi=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},ki=Zn.a?Zn.a.prototype:void 0,Di=ki?ki.valueOf:void 0,Ti=n("TFwu"),Ci=Object.prototype.hasOwnProperty,Oi=n("YM6B"),Ri="[object Arguments]",Li="[object Array]",Ei="[object Object]",Ai=Object.prototype.hasOwnProperty,Ii=function e(t,n,i,r,s){return t===n||(null==t||null==n||!Object(wn.a)(t)&&!Object(wn.a)(n)?t!=t&&n!=n:function(e,t,n,i,r,s){var o=Object(yn.a)(e),a=Object(yn.a)(t),c=o?Li:Object(Oi.a)(e),l=a?Li:Object(Oi.a)(t),u=(c=c==Ri?Ei:c)==Ei,d=(l=l==Ri?Ei:l)==Ei,h=c==l;if(h&&Object(Sn.a)(e)){if(!Object(Sn.a)(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new ln.a),o||Object(Ln.a)(e)?wi(e,t,n,i,r,s):function(e,t,n,i,r,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Si.a(e),new Si.a(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Object(dn.a)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Mi;case"[object Set]":if(a||(a=xi),e.size!=t.size&&!(1&i))return!1;var c=o.get(e);if(c)return c==t;i|=2,o.set(e,t);var l=wi(a(e),a(t),i,r,s,o);return o.delete(e),l;case"[object Symbol]":if(Di)return Di.call(e)==Di.call(t)}return!1}(e,t,c,n,i,r,s);if(!(1&n)){var f=u&&Ai.call(e,"__wrapped__"),p=d&&Ai.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,b=p?t.value():t;return s||(s=new ln.a),r(m,b,n,i,s)}}return!!h&&(s||(s=new ln.a),function(e,t,n,i,r,s){var o=1&n,a=Object(Ti.a)(e),c=a.length;if(c!=Object(Ti.a)(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:Ci.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var f=!0;s.set(e,t),s.set(t,e);for(var p=o;++l<c;){var m=e[u=a[l]],b=t[u];if(i)var g=o?i(b,m,u,t,e,s):i(m,b,u,e,t,s);if(!(void 0===g?m===b||r(m,b,n,i,s):g)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var _=e.constructor,y=t.constructor;_==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof y&&y instanceof y||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,i,r,s))}(t,n,i,r,e,s))},Pi=function(e){return e==e&&!Object(xn.a)(e)},ji=n("mkut"),Ni=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},Fi=function(e,t){return null!=e&&t in Object(e)},Yi=n("Js68"),zi=function(e,t){return null!=e&&function(e,t,n){for(var i=-1,r=(t=ni(t,e)).length,s=!1;++i<r;){var o=ii(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=r?s:!!(r=null==e?0:e.length)&&Object(Yi.a)(r)&&Object(Nn.a)(o,r)&&(Object(yn.a)(e)||Object(_n.a)(e))}(e,t,Fi)},$i=function(e){return"function"==typeof e?e:null==e?tn:"object"==typeof e?Object(yn.a)(e)?(r=e[1],Vn(i=e[0])&&Pi(r)?Ni(ii(i),r):function(e){var t=si(e,i);return void 0===t&&t===r?zi(e,i):Ii(r,t,3)}):1==(n=function(e){for(var t=Object(ji.a)(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Pi(r)]}return t}(t=e)).length&&n[0][2]?Ni(n[0][0],n[0][1]):function(e){return e===t||function(e,t,n,i){var r=n.length,s=r;if(null==e)return!s;for(e=Object(e);r--;){var o=n[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){var a=(o=n[r])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u,d=new ln.a;if(!(void 0===u?Ii(l,c,3,i,d):u))return!1}}return!0}(e,0,n)}:function(e){return Vn(e)?(t=ii(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return ri(t,e)}}(e);var t}(e);var t,n,i,r},Hi=function(e,t){if(null==e)return e;if(!Object(vn.a)(e))return function(e,t){return e&&fn(e,t,ji.a)}(e,t);for(var n=e.length,i=-1,r=Object(e);++i<n&&!1!==t(r[i],i,r););return e},Wi=function(e,t){var n;return Hi(e,(function(e,i,r){return!(n=t(e,i,r))})),!!n},Vi=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0},Bi=function(e,t){var n=!0;return Hi(e,(function(e,i,r){return n=!!t(e,i,r)})),n},Ui=function(e){return e&&e.length?e[0]:void 0},Gi=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var s=e[t];s&&(r[i++]=s)}return r},qi=function(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1},Ji=/\s/,Qi=/^\s+/,Ki=/^[-+]0x[0-9a-f]+$/i,Zi=/^0b[01]+$/i,Xi=/^0o[0-7]+$/i,er=parseInt,tr=function(e){if("number"==typeof e)return e;if($n(e))return NaN;if(Object(xn.a)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Object(xn.a)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;var n;e=(n=e)?n.slice(0,function(e){for(var t=e.length;t--&&Ji.test(e.charAt(t)););return t}(n)+1).replace(Qi,""):n;var i=Zi.test(e);return i||Xi.test(e)?er(e.slice(2),i?2:8):Ki.test(e)?NaN:+e},nr=function(e){var t=function(e){return e?1/0===(e=tr(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),n=t%1;return t==t?n?t-n:t:0},ir=Math.max,rr=function(e,t,n){var i=Object(e);if(!Object(vn.a)(e)){var r=$i(t);e=Object(ji.a)(e),t=function(e){return r(i[e],e,i)}}var s=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:nr(n);return r<0&&(r=ir(i+r,0)),qi(e,$i(t),r)}(e,t,n);return s>-1?i[r?e[s]:s]:void 0},sr=function(e){return"string"==typeof e||!Object(yn.a)(e)&&Object(wn.a)(e)&&"[object String]"==Object(kn.a)(e)},or=n("Ju5/"),ar=function(){return or.a.Date.now()},cr=Math.max,lr=Math.min,ur=function(e){return e!=e},dr=Math.max,hr=function(e,t,n,i){var r;e=Object(vn.a)(e)?e:null==(r=e)?[]:function(e,t){return Xn(t,(function(t){return e[t]}))}(r,Object(ji.a)(r)),n=n&&!i?nr(n):0;var s=e.length;return n<0&&(n=dr(s+n,0)),sr(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):qi(e,ur,n)}(e,t,n)>-1},fr=n("23KU"),pr=function(e,t,n,i){if(!Object(xn.a)(e))return e;for(var r=-1,s=(t=ni(t,e)).length,o=s-1,a=e;null!=a&&++r<s;){var c=ii(t[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=o){var u=a[c];void 0===(l=i?i(u,c,a):void 0)&&(l=Object(xn.a)(u)?u:Object(Nn.a)(t[r+1])?[]:{})}Object(fr.a)(a,c,l),a=a[c]}return e},mr=pi((function(e,t){return null==e?{}:function(e,t){return function(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var o=t[i],a=ri(e,o);n(0,o)&&pr(s,ni(o,e),a)}return s}(e,t,(function(t,n){return zi(e,n)}))}(e,t)}));function br(e,t){1&e&&(i.Sb(0,"span"),i.Oc(1,"loading..."),i.Rb())}const gr=function(e){return{$implicit:e}};function _r(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div"),i.nc(2),i.Rb(),i.Pb()),2&e){const e=i.ic();i.yb(1),i.Kc("height",e.getTotalHeight())}}const yr=function(){return{dontDetach:!0}},vr=["*"],wr=["loadingTemplate"],Sr=["treeNodeTemplate"],Mr=["treeNodeWrapperTemplate"],xr=["treeNodeFullTemplate"],kr=["viewport"],Dr=function(e,t,n,i){return{loadingTemplate:e,treeNodeTemplate:t,treeNodeWrapperTemplate:n,treeNodeFullTemplate:i}};function Tr(e,t){if(1&e&&i.Nb(0,"tree-node-collection",4),2&e){const e=i.ic();i.pc("nodes",e.treeModel.roots)("treeModel",e.treeModel)("templates",i.xc(3,Dr,e.loadingTemplate,e.treeNodeTemplate,e.treeNodeWrapperTemplate,e.treeNodeFullTemplate))}}function Cr(e,t){if(1&e&&i.Nb(0,"tree-node-drop-slot",5),2&e){const e=i.ic();i.pc("dropIndex",0)("node",e.treeModel.virtualRoot)}}function Or(e,t){if(1&e&&i.Nb(0,"tree-node-drop-slot",6),2&e){const e=i.ic(3);i.pc("dropIndex",e.node.index)("node",e.node.parent)}}function Rr(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,Or,1,2,"tree-node-drop-slot",3),i.Nb(2,"tree-node-wrapper",4),i.Nb(3,"tree-node-children",5),i.Nb(4,"tree-node-drop-slot",6),i.Rb()),2&e){const e=i.ic(2);i.Ab(e.node.getClass()),i.Eb("tree-node",!0)("tree-node-expanded",e.node.isExpanded&&e.node.hasChildren)("tree-node-collapsed",e.node.isCollapsed&&e.node.hasChildren)("tree-node-leaf",e.node.isLeaf)("tree-node-active",e.node.isActive)("tree-node-focused",e.node.isFocused),i.yb(1),i.pc("ngIf",0===e.index),i.yb(1),i.pc("node",e.node)("index",e.index)("templates",e.templates),i.yb(1),i.pc("node",e.node)("templates",e.templates),i.yb(1),i.pc("dropIndex",e.node.index+1)("node",e.node.parent)}}const Lr=function(e,t,n,i){return{$implicit:e,node:t,index:n,templates:i}};function Er(e,t){if(1&e&&(i.Qb(0),i.Mc(1,Rr,5,22,"div",1),i.Ob(2,2),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",!e.templates.treeNodeFullTemplate),i.yb(1),i.pc("ngTemplateOutlet",e.templates.treeNodeFullTemplate)("ngTemplateOutletContext",i.xc(3,Lr,e.node,e.node,e.index,e.templates))}}function Ar(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Pc(e.node.displayField)}}const Ir=function(e,t,n){return{$implicit:e,node:t,index:n}};function Pr(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span",3),i.gc("click",(function(t){return i.Dc(e),i.ic(2).node.mouseAction("expanderClick",t)})),i.Nb(1,"span",4),i.Rb()}if(2&e){const e=i.ic(2);i.Eb("toggle-children-wrapper-expanded",e.node.isExpanded)("toggle-children-wrapper-collapsed",e.node.isCollapsed)}}function jr(e,t){1&e&&i.Nb(0,"span",5)}function Nr(e,t){if(1&e&&(i.Qb(0),i.Mc(1,Pr,2,4,"span",1),i.Mc(2,jr,1,0,"span",2),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.node.hasChildren),i.yb(1),i.pc("ngIf",!e.node.hasChildren)}}function Fr(e,t){if(1&e&&i.Nb(0,"tree-node-collection",4),2&e){const e=i.ic(3);i.pc("nodes",e.node.children)("templates",e.templates)("treeModel",e.node.treeModel)}}function Yr(e,t){if(1&e&&i.Nb(0,"tree-loading-component",5),2&e){const e=i.ic(3);i.Kc("padding-left",e.node.getNodePadding()),i.pc("template",e.templates.loadingTemplate)("node",e.node)}}function zr(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,Fr,1,3,"tree-node-collection",2),i.Mc(2,Yr,1,4,"tree-loading-component",3),i.Rb()),2&e){const e=i.ic(2);i.Eb("tree-children",!0)("tree-children-no-padding",e.node.options.levelPadding),i.yb(1),i.pc("ngIf",e.node.children),i.yb(1),i.pc("ngIf",!e.node.children)}}function $r(e,t){if(1&e&&(i.Qb(0),i.Mc(1,zr,3,6,"div",1),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("treeAnimateOpen",e.node.isExpanded)("treeAnimateOpenSpeed",e.node.options.animateSpeed)("treeAnimateOpenAcceleration",e.node.options.animateAcceleration)("treeAnimateOpenEnabled",e.node.options.animateExpand)}}function Hr(e,t){if(1&e&&i.Nb(0,"tree-node",2),2&e){const e=t.$implicit,n=t.index,r=i.ic(2);i.pc("node",e)("index",n)("templates",r.templates)}}function Wr(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div"),i.Mc(2,Hr,1,3,"tree-node",1),i.Rb(),i.Pb()),2&e){const e=i.ic();i.yb(1),i.Kc("margin-top",e.marginTop),i.yb(1),i.pc("ngForOf",e.viewportNodes)("ngForTrackBy",e.trackNode)}}function Vr(e,t){if(1&e&&i.Nb(0,"tree-node-checkbox",4),2&e){const e=i.ic(2);i.pc("node",e.node)}}function Br(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",2),i.Mc(1,Vr,1,1,"tree-node-checkbox",3),i.Nb(2,"tree-node-expander",4),i.Sb(3,"div",5),i.gc("click",(function(t){return i.Dc(e),i.ic().node.mouseAction("click",t)}))("dblclick",(function(t){return i.Dc(e),i.ic().node.mouseAction("dblClick",t)}))("mouseover",(function(t){return i.Dc(e),i.ic().node.mouseAction("mouseOver",t)}))("mouseout",(function(t){return i.Dc(e),i.ic().node.mouseAction("mouseOut",t)}))("contextmenu",(function(t){return i.Dc(e),i.ic().node.mouseAction("contextMenu",t)}))("treeDrop",(function(t){return i.Dc(e),i.ic().node.onDrop(t)}))("treeDropDragOver",(function(t){return i.Dc(e),i.ic().node.mouseAction("dragOver",t)}))("treeDropDragLeave",(function(t){return i.Dc(e),i.ic().node.mouseAction("dragLeave",t)}))("treeDropDragEnter",(function(t){return i.Dc(e),i.ic().node.mouseAction("dragEnter",t)})),i.Nb(4,"tree-node-content",6),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.Kc("padding-left",e.node.getNodePadding()),i.yb(1),i.pc("ngIf",e.node.options.useCheckbox),i.yb(1),i.pc("node",e.node),i.yb(1),i.Eb("node-content-wrapper-active",e.node.isActive)("node-content-wrapper-focused",e.node.isFocused),i.pc("treeAllowDrop",e.node.allowDrop)("allowDragoverStyling",e.node.allowDragoverStyling())("treeDrag",e.node)("treeDragEnabled",e.node.allowDrag()),i.yb(1),i.pc("node",e.node)("index",e.index)("template",e.templates.treeNodeTemplate)}}function Ur(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"input",1),i.gc("click",(function(t){return i.Dc(e),i.ic().node.mouseAction("checkboxClick",t)})),i.Rb(),i.Pb()}if(2&e){const e=i.ic();i.yb(1),i.pc("checked",e.node.isSelected)("indeterminate",e.node.isPartiallySelected)}}let Gr=(()=>{class e{constructor(e,t){this.templateRef=e,this.viewContainer=t,this.templateBindings={}}ngOnInit(){this.view=this.viewContainer.createEmbeddedView(this.templateRef),this.dispose&&this.dispose(),this.shouldDetach()&&this.view.detach(),this.autoDetect(this.view)}shouldDetach(){return this.treeMobxAutorun&&this.treeMobxAutorun.detach}autoDetect(e){this.dispose=Ze(()=>e.detectChanges())}ngOnDestroy(){this.dispose&&this.dispose()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L),i.Mb(i.P))},e.\u0275dir=i.Hb({type:e,selectors:[["","treeMobxAutorun",""]],inputs:{treeMobxAutorun:"treeMobxAutorun"}}),e})();const qr={TOGGLE_ACTIVE:(e,t,n)=>t&&t.toggleActivated(),TOGGLE_ACTIVE_MULTI:(e,t,n)=>t&&t.toggleActivated(!0),TOGGLE_SELECTED:(e,t,n)=>t&&t.toggleSelected(),ACTIVATE:(e,t,n)=>t.setIsActive(!0),DEACTIVATE:(e,t,n)=>t.setIsActive(!1),SELECT:(e,t,n)=>t.setIsSelected(!0),DESELECT:(e,t,n)=>t.setIsSelected(!1),FOCUS:(e,t,n)=>t.focus(),TOGGLE_EXPANDED:(e,t,n)=>t.hasChildren&&t.toggleExpanded(),EXPAND:(e,t,n)=>t.expand(),COLLAPSE:(e,t,n)=>t.collapse(),DRILL_DOWN:(e,t,n)=>e.focusDrillDown(),DRILL_UP:(e,t,n)=>e.focusDrillUp(),NEXT_NODE:(e,t,n)=>e.focusNextNode(),PREVIOUS_NODE:(e,t,n)=>e.focusPreviousNode(),MOVE_NODE:(e,t,n,{from:i,to:r})=>{n.ctrlKey?e.copyNode(i,r):e.moveNode(i,r)}},Jr={mouse:{click:qr.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:qr.TOGGLE_EXPANDED,checkboxClick:qr.TOGGLE_SELECTED,drop:qr.MOVE_NODE},keys:{39:qr.DRILL_DOWN,37:qr.DRILL_UP,40:qr.NEXT_NODE,38:qr.PREVIOUS_NODE,32:qr.TOGGLE_ACTIVE,13:qr.TOGGLE_ACTIVE}};class Qr{constructor(e={}){this.options=e,this.actionMapping=zn({},this.options.actionMapping,Jr),e.rtl&&(this.actionMapping.keys[39]=si(e,["actionMapping","keys",39])||qr.DRILL_UP,this.actionMapping.keys[37]=si(e,["actionMapping","keys",37])||qr.DRILL_DOWN)}get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return void 0===this.options.scrollOnActivate||this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return void 0===this.options.useTriState||this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return void 0===this.options.allowDragoverStyling||this.options.allowDragoverStyling}getNodeClone(e){return this.options.getNodeClone?this.options.getNodeClone(e):bi(Object.assign({},e.data),["id"])}allowDrop(e,t,n){return this.options.allowDrop instanceof Function?this.options.allowDrop(e,t,n):void 0===this.options.allowDrop||this.options.allowDrop}allowDrag(e){return this.options.allowDrag instanceof Function?this.options.allowDrag(e):this.options.allowDrag}nodeClass(e){return this.options.nodeClass?this.options.nodeClass(e):""}nodeHeight(e){if(e.data.virtual)return 0;let t=this.options.nodeHeight||22;return"function"==typeof t&&(t=t(e)),t+(0===e.index?2:1)*this.dropSlotHeight}get dropSlotHeight(){return"number"==typeof(e=this.options.dropSlotHeight)||Object(wn.a)(e)&&"[object Number]"==Object(kn.a)(e)?this.options.dropSlotHeight:2;var e}}const Kr={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"};var Zr=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},Xr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let es=(()=>{class e{constructor(e,t,n,i){this.data=e,this.parent=t,this.treeModel=n,this.position=0,this.allowDrop=(e,t)=>this.options.allowDrop(e,{parent:this,index:0},t),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,null==this.id&&(this.id=Math.floor(1e13*Math.random())),this.index=i,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):(e=this.children,t=e=>e.isSelected,(Object(yn.a)(e)?gi:Wi)(e,$i(t)));var e,t}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):(e=this.children,t=e=>e.isAllSelected,(Object(yn.a)(e)?Vi:Bi)(e,$i(t)));var e,t}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw"Element Ref is no longer supported since introducing virtual scroll\n\n      You may use a template to obtain a reference to the element"}get originalNode(){return this._originalNode}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(e){this.treeModel.fireEvent(e)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(e){this.setField("id",e)}getField(e){return this.data[this.options[e+"Field"]]}setField(e,t){this.data[this.options[e+"Field"]]=t}_findAdjacentSibling(e,t=!1){const n=this._getParentsChildren(t),i=n.indexOf(this);return n.length>i+e?n[i+e]:null}findNextSibling(e=!1){return this._findAdjacentSibling(1,e)}findPreviousSibling(e=!1){return this._findAdjacentSibling(-1,e)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(e=>!e.isHidden)}getFirstChild(e=!1){return Ui((e?this.visibleChildren:this.children)||[])}getLastChild(e=!1){return ai((e?this.visibleChildren:this.children)||[])}findNextNode(e=!0,t=!1){return e&&this.isExpanded&&this.getFirstChild(t)||this.findNextSibling(t)||this.parent&&this.parent.findNextNode(!1,t)}findPreviousNode(e=!1){let t=this.findPreviousSibling(e);return t?t._getLastOpenDescendant(e):this.realParent}_getLastOpenDescendant(e=!1){const t=this.getLastChild(e);return this.isCollapsed||!t?this:t._getLastOpenDescendant(e)}_getParentsChildren(e=!1){return this.parent&&(e?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(e=!1){return this._getParentsChildren(e).indexOf(this)}isDescendantOf(e){return this===e||this.parent&&this.parent.isDescendantOf(e)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),"tree-node-level-"+this.level].join(" ")}onDrop(e){this.mouseAction("drop",e.event,{from:e.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(e=>{e&&(this.setField("children",e),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(e=>{e.getField("isExpanded")&&e.hasChildren&&e.expand()}))}).then(()=>{this.fireEvent({eventName:Kr.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(e){Promise.resolve(e(this)).then(()=>{this.children&&this.children.forEach(t=>t.doForAll(e))})}expandAll(){this.doForAll(e=>e.expand())}collapseAll(){this.doForAll(e=>e.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(e){return this.hasChildren&&this.treeModel.setExpandedNode(this,e),this}autoLoadChildren(){this.handler=tt(()=>this.isExpanded,e=>{!this.children&&this.hasChildren&&e&&this.loadNodeChildren()},{fireImmediately:!0})}dispose(){this.children&&this.children.forEach(e=>e.dispose()),this.handler&&this.handler(),this.parent=null,this.children=null}setIsActive(e,t=!1){return this.treeModel.setActiveNode(this,e,t),e&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(e){return this.isSelectable()?this.treeModel.setSelectedNode(this,e):this.visibleChildren.forEach(t=>t.setIsSelected(e)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(e=!1){return this.setIsActive(!this.isActive,e),this}setActiveAndVisible(e=!1){return this.setIsActive(!0,e).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(e=!1){this.treeModel.virtualScroll.scrollIntoView(this,e)}focus(e=!0){let t=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),e&&this.scrollIntoView(),t&&this.fireEvent({eventName:Kr.blur,node:t}),this.fireEvent({eventName:Kr.focus,node:this}),this}blur(){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),e&&this.fireEvent({eventName:Kr.blur,node:this}),this}setIsHidden(e){this.treeModel.setIsHidden(this,e)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(e,t,n=null){this.treeModel.setFocus(!0);const i=this.options.actionMapping.mouse[e];i&&i(this.treeModel,this,t,n)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((t,n)=>new e(t,this,this.treeModel,n))}}return Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isHidden",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isExpanded",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isActive",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isFocused",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isSelected",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isAllSelected",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"isPartiallySelected",null),Zr([te,Xr("design:type",Array)],e.prototype,"children",void 0),Zr([te,Xr("design:type",Number)],e.prototype,"index",void 0),Zr([te,Xr("design:type",Object)],e.prototype,"position",void 0),Zr([te,Xr("design:type",Number)],e.prototype,"height",void 0),Zr([se,Xr("design:type",Number),Xr("design:paramtypes",[])],e.prototype,"level",null),Zr([se,Xr("design:type",Array),Xr("design:paramtypes",[])],e.prototype,"path",null),Zr([se,Xr("design:type",Object),Xr("design:paramtypes",[])],e.prototype,"visibleChildren",null),Zr([Qe,Xr("design:type",Function),Xr("design:paramtypes",[Object]),Xr("design:returntype",void 0)],e.prototype,"setIsSelected",null),Zr([Qe,Xr("design:type",Function),Xr("design:paramtypes",[]),Xr("design:returntype",void 0)],e.prototype,"_initChildren",null),e})();var ts=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},ns=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let is=(()=>{class e{constructor(){this.options=new Qr,this.eventNames=Object.keys(Kr),this.expandedNodeIds={},this.selectedLeafNodeIds={},this.activeNodeIds={},this.hiddenNodeIds={},this.focusedNodeId=null,this.firstUpdate=!0,this.subscriptions=[]}fireEvent(e){e.treeModel=this,this.events[e.eventName].emit(e),this.events.event.emit(e)}subscribe(e,t){const n=this.events[e].subscribe(t);this.subscriptions.push(n)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this.virtualRoot.visibleChildren}getFirstRoot(e=!1){return Ui(e?this.getVisibleRoots():this.roots)}getLastRoot(e=!1){return ai(e?this.getVisibleRoots():this.roots)}get isFocused(){return e.focusedTree===this}isNodeFocused(e){return this.focusedNode===e}isEmptyTree(){return this.roots&&0===this.roots.length}get focusedNode(){return this.focusedNodeId?this.getNodeById(this.focusedNodeId):null}get expandedNodes(){const e=Object.keys(this.expandedNodeIds).filter(e=>this.expandedNodeIds[e]).map(e=>this.getNodeById(e));return Gi(e)}get activeNodes(){const e=Object.keys(this.activeNodeIds).filter(e=>this.activeNodeIds[e]).map(e=>this.getNodeById(e));return Gi(e)}get hiddenNodes(){const e=Object.keys(this.hiddenNodeIds).filter(e=>this.hiddenNodeIds[e]).map(e=>this.getNodeById(e));return Gi(e)}get selectedLeafNodes(){const e=Object.keys(this.selectedLeafNodeIds).filter(e=>this.selectedLeafNodeIds[e]).map(e=>this.getNodeById(e));return Gi(e)}getNodeByPath(e,t=null){if(!e)return null;if(t=t||this.virtualRoot,0===e.length)return t;if(!t.children)return null;const n=e.shift(),i=rr(t.children,{id:n});return i?this.getNodeByPath(e,i):null}getNodeById(e){const t=e.toString();return this.getNodeBy(e=>e.id.toString()===t)}getNodeBy(e,t=null){if(!(t=t||this.virtualRoot).children)return null;const n=rr(t.children,e);if(n)return n;for(let i of t.children){const t=this.getNodeBy(e,i);if(t)return t}}isExpanded(e){return this.expandedNodeIds[e.id]}isHidden(e){return this.hiddenNodeIds[e.id]}isActive(e){return this.activeNodeIds[e.id]}isSelected(e){return this.selectedLeafNodeIds[e.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){this.virtualRoot&&this.virtualRoot.dispose()}unsubscribeAll(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[]}setData({nodes:e,options:t=null,events:n=null}){t&&(this.options=new Qr(t)),n&&(this.events=n),e&&(this.nodes=e),this.update()}update(){let e={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose(),this.virtualRoot=new es(e,null,this,0),this.roots=this.virtualRoot.children,this.firstUpdate?this.roots&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:Kr.updateData})}setFocusedNode(e){this.focusedNodeId=e?e.id:null}setFocus(t){e.focusedTree=t?this:null}doForAll(e){this.roots.forEach(t=>t.doForAll(e))}focusNextNode(){let e=this.getFocusedNode(),t=e?e.findNextNode(!0,!0):this.getFirstRoot(!0);t&&t.focus()}focusPreviousNode(){let e=this.getFocusedNode(),t=e?e.findPreviousNode(!0):this.getLastRoot(!0);t&&t.focus()}focusDrillDown(){let e=this.getFocusedNode();if(e&&e.isCollapsed&&e.hasChildren)e.toggleExpanded();else{let t=e?e.getFirstChild(!0):this.getFirstRoot(!0);t&&t.focus()}}focusDrillUp(){let e=this.getFocusedNode();if(e)if(e.isExpanded)e.toggleExpanded();else{let t=e.realParent;t&&t.focus()}}setActiveNode(e,t,n=!1){n?this._setActiveNodeMulti(e,t):this._setActiveNodeSingle(e,t),t?(e.focus(this.options.scrollOnActivate),this.fireEvent({eventName:Kr.activate,node:e}),this.fireEvent({eventName:Kr.nodeActivate,node:e})):(this.fireEvent({eventName:Kr.deactivate,node:e}),this.fireEvent({eventName:Kr.nodeDeactivate,node:e}))}setSelectedNode(e,t){this.selectedLeafNodeIds=Object.assign({},this.selectedLeafNodeIds,{[e.id]:t}),t?(e.focus(),this.fireEvent({eventName:Kr.select,node:e})):this.fireEvent({eventName:Kr.deselect,node:e})}setExpandedNode(e,t){this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[e.id]:t}),this.fireEvent({eventName:Kr.toggleExpanded,node:e,isExpanded:t})}expandAll(){this.roots.forEach(e=>e.expandAll())}collapseAll(){this.roots.forEach(e=>e.collapseAll())}setIsHidden(e,t){this.hiddenNodeIds=Object.assign({},this.hiddenNodeIds,{[e.id]:t})}setHiddenNodeIds(e){this.hiddenNodeIds=e.reduce((e,t)=>Object.assign(e,{[t]:!0}),{})}performKeyAction(e,t){const n=this.options.actionMapping.keys[t.keyCode];return!!n&&(t.preventDefault(),n(this,e,t),!0)}filterNodes(e,t=!0){let n;if(!e)return this.clearFilter();if(sr(e))n=t=>-1!==t.displayField.toLowerCase().indexOf(e.toLowerCase());else{if(!Object(Mn.a)(e))return console.error("Don't know what to do with filter",e),void console.error("Should be either a string or function");n=e}const i={};this.roots.forEach(e=>this._filterNode(i,e,n,t)),this.hiddenNodeIds=i,this.fireEvent({eventName:Kr.changeFilter})}clearFilter(){this.hiddenNodeIds={},this.fireEvent({eventName:Kr.changeFilter})}moveNode(e,t){const n=e.getIndexInParent(),i=e.parent;if(!this.canMoveNode(e,t,n))return;const r=i.getField("children");t.parent.getField("children")||t.parent.setField("children",[]);const s=t.parent.getField("children"),o=r.splice(n,1)[0];let a=i===t.parent&&t.index>n?t.index-1:t.index;s.splice(a,0,o),i.treeModel.update(),t.parent.treeModel!==i.treeModel&&t.parent.treeModel.update(),this.fireEvent({eventName:Kr.moveNode,node:o,to:{parent:t.parent.data,index:a},from:{parent:i.data,index:n}})}copyNode(e,t){const n=e.getIndexInParent();if(!this.canMoveNode(e,t,n))return;t.parent.getField("children")||t.parent.setField("children",[]);const i=t.parent.getField("children"),r=this.options.getNodeClone(e);i.splice(t.index,0,r),e.treeModel.update(),t.parent.treeModel!==e.treeModel&&t.parent.treeModel.update(),this.fireEvent({eventName:Kr.copyNode,node:r,to:{parent:t.parent.data,index:t.index}})}getState(){return{expandedNodeIds:this.expandedNodeIds,selectedLeafNodeIds:this.selectedLeafNodeIds,activeNodeIds:this.activeNodeIds,hiddenNodeIds:this.hiddenNodeIds,focusedNodeId:this.focusedNodeId}}setState(e){e&&Object.assign(this,{expandedNodeIds:e.expandedNodeIds||{},selectedLeafNodeIds:e.selectedLeafNodeIds||{},activeNodeIds:e.activeNodeIds||{},hiddenNodeIds:e.hiddenNodeIds||{},focusedNodeId:e.focusedNodeId})}subscribeToState(e){Ze(()=>e(this.getState()))}canMoveNode(e,t,n){return n||e.getIndexInParent(),(e.parent!==t.parent||n!==t.index)&&!t.parent.isDescendantOf(e)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(e,t,n,i){let r=n(t);return t.children&&t.children.forEach(t=>{this._filterNode(e,t,n,i)&&(r=!0)}),r||(e[t.id]=!0),i&&r&&t.ensureVisible(),r}_calculateExpandedNodes(e=null){(e=e||this.virtualRoot).data[this.options.isExpandedField]&&(this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[e.id]:!0})),e.children&&e.children.forEach(e=>this._calculateExpandedNodes(e))}_setActiveNodeSingle(e,t){this.activeNodes.filter(t=>t!==e).forEach(e=>{this.fireEvent({eventName:Kr.deactivate,node:e}),this.fireEvent({eventName:Kr.nodeDeactivate,node:e})}),this.activeNodeIds=t?{[e.id]:!0}:{}}_setActiveNodeMulti(e,t){this.activeNodeIds=Object.assign({},this.activeNodeIds,{[e.id]:t})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e.focusedTree=null,ts([te,ns("design:type",Array)],e.prototype,"roots",void 0),ts([te,ns("design:type",Object)],e.prototype,"expandedNodeIds",void 0),ts([te,ns("design:type",Object)],e.prototype,"selectedLeafNodeIds",void 0),ts([te,ns("design:type",Object)],e.prototype,"activeNodeIds",void 0),ts([te,ns("design:type",Object)],e.prototype,"hiddenNodeIds",void 0),ts([te,ns("design:type",Object)],e.prototype,"focusedNodeId",void 0),ts([te,ns("design:type",es)],e.prototype,"virtualRoot",void 0),ts([se,ns("design:type",Object),ns("design:paramtypes",[])],e.prototype,"focusedNode",null),ts([se,ns("design:type",Object),ns("design:paramtypes",[])],e.prototype,"expandedNodes",null),ts([se,ns("design:type",Object),ns("design:paramtypes",[])],e.prototype,"activeNodes",null),ts([se,ns("design:type",Object),ns("design:paramtypes",[])],e.prototype,"hiddenNodes",null),ts([se,ns("design:type",Object),ns("design:paramtypes",[])],e.prototype,"selectedLeafNodes",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"setData",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"update",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"setFocusedNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"setFocus",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"doForAll",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"focusNextNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"focusPreviousNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"focusDrillDown",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"focusDrillUp",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object,Object]),ns("design:returntype",void 0)],e.prototype,"setActiveNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"setSelectedNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"setExpandedNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"expandAll",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"collapseAll",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"setIsHidden",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"setHiddenNodeIds",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"filterNodes",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[]),ns("design:returntype",void 0)],e.prototype,"clearFilter",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"moveNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object,Object]),ns("design:returntype",void 0)],e.prototype,"copyNode",null),ts([Qe,ns("design:type",Function),ns("design:paramtypes",[Object]),ns("design:returntype",void 0)],e.prototype,"setState",null),e})(),rs=(()=>{class e{constructor(){this._draggedElement=null}set(e){this._draggedElement=e}get(){return this._draggedElement}isDragging(){return!!this.get()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Ib)({factory:function(){return new e},token:e,providedIn:"root"}),e})();var ss=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},os=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const as=150;let cs=(()=>{class e{constructor(e){this.treeModel=e,this.yBlocks=0,this.x=0,this.viewportHeight=null,this.viewport=null,e.virtualScroll=this,this._dispose=[Ze(()=>this.fixScroll())]}get y(){return this.yBlocks*as}get totalHeight(){return this.treeModel.virtualRoot?this.treeModel.virtualRoot.height:0}fireEvent(e){this.treeModel.fireEvent(e)}init(){const e=this.recalcPositions.bind(this);e(),this._dispose=[...this._dispose,tt(()=>this.treeModel.roots,e),tt(()=>this.treeModel.expandedNodeIds,e),tt(()=>this.treeModel.hiddenNodeIds,e)],this.treeModel.subscribe(Kr.loadNodeChildren,e)}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(e){this.yBlocks=e}recalcPositions(){this.treeModel.virtualRoot.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0)}_getPositionAfter(e,t){let n=t;return e.forEach(e=>{e.position=n,n=this._getPositionAfterNode(e,n)}),n}_getPositionAfterNode(e,t){let n=e.getSelfHeight()+t;return e.children&&e.isExpanded&&(n=this._getPositionAfter(e.visibleChildren,n)),e.height=n-t,n}clear(){this._dispose.forEach(e=>e())}setViewport(e){Object.assign(this,{viewport:e,x:e.scrollLeft,yBlocks:Math.round(e.scrollTop/as),viewportHeight:e.getBoundingClientRect?e.getBoundingClientRect().height:0})}scrollIntoView(e,t,n=!0){if(e.options.scrollContainer){const i=e.options.scrollContainer,r=i.getBoundingClientRect().height,s=i.getBoundingClientRect().top,o=this.viewport.getBoundingClientRect().top+e.position-s;(t||o<i.scrollTop||o+e.getSelfHeight()>i.scrollTop+r)&&(i.scrollTop=n?o-r/2:o)}else(t||e.position<this.y||e.position+e.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=n?e.position-this.viewportHeight/2:e.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/as)))}getViewportNodes(e){if(!e)return[];const t=e.filter(e=>!e.isHidden);if(!this.isEnabled())return t;if(!this.viewportHeight||!t.length)return[];const n=ls(t,e=>e.position+500>this.y||e.position+e.height>this.y),i=ls(t,e=>e.position-500>this.y+this.viewportHeight,n),r=[];if(i-n>(1e3+this.viewportHeight)/t[0].treeModel.options.options.nodeHeight)return[];for(let s=n;s<=i;s++)r.push(t[s]);return r}fixScroll(){const e=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>e&&this._setYBlocks(e/as)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(is))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),ss([te,os("design:type",Object)],e.prototype,"yBlocks",void 0),ss([te,os("design:type",Object)],e.prototype,"x",void 0),ss([te,os("design:type",Object)],e.prototype,"viewportHeight",void 0),ss([se,os("design:type",Object),os("design:paramtypes",[])],e.prototype,"y",null),ss([se,os("design:type",Object),os("design:paramtypes",[])],e.prototype,"totalHeight",null),ss([Qe,os("design:type",Function),os("design:paramtypes",[Object]),os("design:returntype",void 0)],e.prototype,"_setYBlocks",null),ss([Qe,os("design:type",Function),os("design:paramtypes",[]),os("design:returntype",void 0)],e.prototype,"recalcPositions",null),ss([Qe,os("design:type",Function),os("design:paramtypes",[Object]),os("design:returntype",void 0)],e.prototype,"setViewport",null),ss([Qe,os("design:type",Function),os("design:paramtypes",[Object,Object,Object]),os("design:returntype",void 0)],e.prototype,"scrollIntoView",null),e})();function ls(e,t,n=0){let i=n,r=e.length-1;for(;i!==r;){let n=Math.floor((i+r)/2);t(e[n])?r=n:i=i===n?r:n}return i}let us=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-loading-component"]],inputs:{template:"template",node:"node"},decls:2,vars:5,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Mc(0,br,2,0,"span",0),i.Ob(1,1)),2&e&&(i.pc("ngIf",!t.template),i.yb(1),i.pc("ngTemplateOutlet",t.template)("ngTemplateOutletContext",i.uc(3,gr,t.node)))},directives:[r.r,r.w],encapsulation:2}),e})(),ds=(()=>{class e{constructor(e,t,n){this.elementRef=e,this.ngZone=t,this.virtualScroll=n,this.setViewport=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Object(xn.a)(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),function(e,t,n){var i,r,s,o,a,c,l=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function p(e){return l=e,a=setTimeout(b,t),u?f(e):o}function m(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=s}function b(){var e=ar();if(m(e))return g(e);a=setTimeout(b,function(e){var n=t-(e-c);return d?lr(n,s-(e-l)):n}(e))}function g(e){return a=void 0,h&&i?f(e):(i=r=void 0,o)}function _(){var e=ar(),n=m(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return p(c);if(d)return clearTimeout(a),a=setTimeout(b,t),f(c)}return void 0===a&&(a=setTimeout(b,t)),o}return t=tr(t)||0,Object(xn.a)(n)&&(u=!!n.leading,s=(d="maxWait"in n)?cr(tr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},_.flush=function(){return void 0===a?o:g(ar())},_}(e,t,{leading:i,maxWait:t,trailing:r})}(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init()}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:Kr.initialized})});let e=this.elementRef.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("scroll",this.scrollEventHandler)})}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.A),i.Mb(cs))},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-viewport"]],features:[i.xb([cs])],ngContentSelectors:vr,decls:1,vars:2,consts:[[4,"treeMobxAutorun"]],template:function(e,t){1&e&&(i.oc(),i.Mc(0,_r,3,2,"ng-container",0)),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:[Gr],encapsulation:2}),e})(),hs=(()=>{class e{constructor(e,t){this.treeModel=e,this.treeDraggedElement=t,e.eventNames.forEach(e=>this[e]=new i.o),e.subscribeToState(e=>this.stateChange.emit(e))}set nodes(e){}set options(e){}set focused(e){this.treeModel.setFocus(e)}set state(e){this.treeModel.setState(e)}onKeydown(e){if(!this.treeModel.isFocused)return;if(hr(["input","textarea"],document.activeElement.tagName.toLowerCase()))return;const t=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(t,e)}onMousedown(e){(function e(t,n){return!t||t.localName!==n&&e(t.parentElement,n)})(e.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(e){(e.options||e.nodes)&&this.treeModel.setData({options:e.options&&e.options.currentValue,nodes:e.nodes&&e.nodes.currentValue,events:mr(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(is),i.Mb(rs))},e.\u0275cmp=i.Gb({type:e,selectors:[["Tree"],["tree-root"]],contentQueries:function(e,t,n){var r;1&e&&(i.Fb(n,wr,!0),i.Fb(n,Sr,!0),i.Fb(n,Mr,!0),i.Fb(n,xr,!0)),2&e&&(i.zc(r=i.hc())&&(t.loadingTemplate=r.first),i.zc(r=i.hc())&&(t.treeNodeTemplate=r.first),i.zc(r=i.hc())&&(t.treeNodeWrapperTemplate=r.first),i.zc(r=i.hc())&&(t.treeNodeFullTemplate=r.first))},viewQuery:function(e,t){var n;1&e&&i.Tc(kr,!0),2&e&&i.zc(n=i.hc())&&(t.viewportComponent=n.first)},hostBindings:function(e,t){1&e&&i.gc("keydown",(function(e){return t.onKeydown(e)}),!1,i.Bc)("mousedown",(function(e){return t.onMousedown(e)}),!1,i.Bc)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[i.xb([is]),i.wb],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(e,t){1&e&&(i.Sb(0,"tree-viewport",null,0),i.Sb(2,"div",1),i.Mc(3,Tr,1,8,"tree-node-collection",2),i.Mc(4,Cr,1,2,"tree-node-drop-slot",3),i.Rb(),i.Rb()),2&e&&(i.yb(2),i.Eb("node-dragging",t.treeDraggedElement.isDragging())("angular-tree-component-rtl",t.treeModel.options.rtl),i.yb(1),i.pc("ngIf",t.treeModel.roots),i.yb(1),i.pc("ngIf",t.treeModel.isEmptyTree()))},directives:function(){return[ds,r.r,Ds,ms]},encapsulation:2}),e})(),fs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["TreeNode"],["tree-node"]],inputs:{node:"node",index:"index",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node",4,"ngIf"],[3,"node","index","templates"],[3,"node","templates"],[3,"dropIndex","node"]],template:function(e,t){1&e&&i.Mc(0,Er,3,8,"ng-container",0),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:function(){return[Gr,r.r,r.w,Ts,gs,ms]},encapsulation:2}),e})(),ps=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-content"]],inputs:{node:"node",index:"index",template:"template"},decls:2,vars:7,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Mc(0,Ar,2,1,"span",0),i.Ob(1,1)),2&e&&(i.pc("ngIf",!t.template),i.yb(1),i.pc("ngTemplateOutlet",t.template)("ngTemplateOutletContext",i.wc(3,Ir,t.node,t.node,t.index)))},directives:[r.r,r.w],encapsulation:2}),e})(),ms=(()=>{class e{onDrop(e){this.node.mouseAction("drop",e.event,{from:e.element,to:{parent:this.node,index:this.dropIndex}})}allowDrop(e,t){return this.node.options.allowDrop(e,{parent:this.node,index:this.dropIndex},t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:"node",dropIndex:"dropIndex"},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeAllowDrop","allowDragoverStyling","treeDrop"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.gc("treeDrop",(function(e){return t.onDrop(e)})),i.Rb()),2&e&&i.pc("treeAllowDrop",t.allowDrop.bind(t))("allowDragoverStyling",!0)},directives:function(){return[Ls]},encapsulation:2}),e})(),bs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-expander"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["class","toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed","click",4,"ngIf"],["class","toggle-children-placeholder",4,"ngIf"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"],[1,"toggle-children-placeholder"]],template:function(e,t){1&e&&i.Mc(0,Nr,3,2,"ng-container",0),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:[Gr,r.r],encapsulation:2}),e})(),gs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-children"]],inputs:{node:"node",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel",4,"ngIf"],["class","tree-node-loading",3,"padding-left","template","node",4,"ngIf"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"template","node"]],template:function(e,t){1&e&&i.Mc(0,$r,2,4,"ng-container",0),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:function(){return[Gr,As,r.r,Ds,us]},encapsulation:2}),e})();function _s(...e){return Qe(...e)}const ys=Object.assign(_s,Qe);function vs(...e){return se(...e)}const ws=Object.assign(vs,se);function Ss(...e){return te(...e)}const Ms=Object.assign(Ss,te);var xs=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},ks=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Ds=(()=>{class e{constructor(){this._dispose=[]}get nodes(){return this._nodes}set nodes(e){this.setNodes(e)}get marginTop(){const e=this.viewportNodes&&this.viewportNodes.length&&this.viewportNodes[0];return(e&&e.parent?e.position-e.parent.position-e.parent.getSelfHeight():0)+"px"}setNodes(e){this._nodes=e}ngOnInit(){this.virtualScroll=this.treeModel.virtualScroll,this._dispose=[tt(()=>this.virtualScroll.getViewportNodes(this.nodes).map(e=>e.index),e=>{this.viewportNodes=e.map(e=>this.nodes[e])},{compareStructural:!0,fireImmediately:!0}),tt(()=>this.nodes,e=>{this.viewportNodes=this.virtualScroll.getViewportNodes(e)})]}ngOnDestroy(){this._dispose.forEach(e=>e())}trackNode(e,t){return t.id}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-collection"]],inputs:{nodes:"nodes",treeModel:"treeModel",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"node","index","templates",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","index","templates"]],template:function(e,t){1&e&&i.Mc(0,Wr,3,4,"ng-container",0),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:[Gr,r.q,fs],encapsulation:2}),xs([Ms,ks("design:type",Object)],e.prototype,"_nodes",void 0),xs([Ms,ks("design:type",Array)],e.prototype,"viewportNodes",void 0),xs([ws,ks("design:type",String),ks("design:paramtypes",[])],e.prototype,"marginTop",null),xs([ys,ks("design:type",Function),ks("design:paramtypes",[Object]),ks("design:returntype",void 0)],e.prototype,"setNodes",null),e})(),Ts=(()=>{class e{constructor(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-wrapper"]],inputs:{node:"node",index:"index",templates:"templates"},decls:2,vars:8,consts:[["class","node-wrapper",3,"padding-left",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node",4,"ngIf"],[3,"node"],[1,"node-content-wrapper",3,"treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled","click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter"],[3,"node","index","template"]],template:function(e,t){1&e&&(i.Mc(0,Br,5,15,"div",0),i.Ob(1,1)),2&e&&(i.pc("ngIf",!t.templates.treeNodeWrapperTemplate),i.yb(1),i.pc("ngTemplateOutlet",t.templates.treeNodeWrapperTemplate)("ngTemplateOutletContext",i.xc(3,Lr,t.node,t.node,t.index,t.templates)))},directives:function(){return[r.r,r.w,bs,Es,Ls,ps,Cs]},encapsulation:2}),e})(),Cs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["tree-node-checkbox"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["type","checkbox",1,"tree-node-checkbox",3,"checked","indeterminate","click"]],template:function(e,t){1&e&&i.Mc(0,Ur,2,2,"ng-container",0),2&e&&i.pc("treeMobxAutorun",i.tc(1,yr))},directives:[Gr],encapsulation:2}),e})();const Os="is-dragging-over",Rs="is-dragging-over-disabled";let Ls=(()=>{class e{constructor(e,t,n,r){this.el=e,this.renderer=t,this.treeDraggedElement=n,this.ngZone=r,this.allowDragoverStyling=!0,this.onDropCallback=new i.o,this.onDragOverCallback=new i.o,this.onDragLeaveCallback=new i.o,this.onDragEnterCallback=new i.o,this._allowDrop=(e,t)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this)}set treeAllowDrop(e){this._allowDrop=e instanceof Function?e:(t,n)=>e}allowDrop(e){return this._allowDrop(this.treeDraggedElement.get(),e)}ngAfterViewInit(){let e=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("dragover",this.dragOverEventHandler),e.addEventListener("dragenter",this.dragEnterEventHandler),e.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let e=this.el.nativeElement;e.removeEventListener("dragover",this.dragOverEventHandler),e.removeEventListener("dragenter",this.dragEnterEventHandler),e.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(e){if(!this.allowDrop(e))return this.allowDragoverStyling?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:e,element:this.treeDraggedElement.get()}),e.preventDefault(),this.allowDragoverStyling&&this.addClass()}onDragEnter(e){this.allowDrop(e)&&(e.preventDefault(),this.onDragEnterCallback.emit({event:e,element:this.treeDraggedElement.get()}))}onDragLeave(e){if(!this.allowDrop(e))return this.allowDragoverStyling?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:e,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass()}onDrop(e){this.allowDrop(e)&&(e.preventDefault(),this.onDropCallback.emit({event:e,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,Os)}removeClass(){this.renderer.removeClass(this.el.nativeElement,Os)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,Rs)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,Rs)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb(rs),i.Mb(i.A))},e.\u0275dir=i.Hb({type:e,selectors:[["","treeDrop",""]],hostBindings:function(e,t){1&e&&i.gc("drop",(function(e){return t.onDrop(e)}))},inputs:{allowDragoverStyling:"allowDragoverStyling",treeAllowDrop:"treeAllowDrop"},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}}),e})(),Es=(()=>{class e{constructor(e,t,n,i){this.el=e,this.renderer=t,this.treeDraggedElement=n,this.ngZone=i,this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let e=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(e){e.dataTransfer.setData("text",e.target.id),this.treeDraggedElement.set(this.draggedElement),this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragStart",e)}onDrag(e){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("drag",e)}onDragEnd(){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb(rs),i.Mb(i.A))},e.\u0275dir=i.Hb({type:e,selectors:[["","treeDrag",""]],hostBindings:function(e,t){1&e&&i.gc("dragstart",(function(e){return t.onDragStart(e)}))("dragend",(function(){return t.onDragEnd()}))},inputs:{draggedElement:["treeDrag","draggedElement"],treeDragEnabled:"treeDragEnabled"}}),e})(),As=(()=>{class e{constructor(e,t,n){this.renderer=e,this.templateRef=t,this.viewContainerRef=n}set isOpen(e){e?(this._show(),this.isEnabled&&!1===this._isOpen&&this._animateOpen()):this.isEnabled?this._animateClose():this._hide(),this._isOpen=!!e}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let e=this.animateSpeed,t=this.animateAcceleration,n=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{const i=setInterval(()=>{if(!this._isOpen||!this.innerElement)return clearInterval(i);n+=e;const r=Math.round(n);this.renderer.setStyle(this.innerElement,"max-height",r+"px");const s=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;e*=t,t*=1.005,s<r&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(i))},17)})}_animateClose(){if(!this.innerElement)return;let e=this.animateSpeed,t=this.animateAcceleration,n=this.innerElement.getBoundingClientRect().height;const i=setInterval(()=>{if(this._isOpen||!this.innerElement)return clearInterval(i);n-=e,this.renderer.setStyle(this.innerElement,"max-height",n+"px"),e*=t,t*=1.005,n<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(i))},17)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.L),i.Mb(i.P))},e.\u0275dir=i.Hb({type:e,selectors:[["","treeAnimateOpen",""]],inputs:{isOpen:["treeAnimateOpen","isOpen"],animateSpeed:["treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:["treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:["treeAnimateOpenEnabled","isEnabled"]}}),e})(),Is=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[],imports:[[r.c]]}),e})()},ovuK:function(e,t,n){"use strict";t.a=function(e){return function(t){return e(t)}}},oxzT:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e){return e.add="fa fa-plus",e.addCircle="fa fa-plus-circle",e.minusCircle="fa fa-minus-circle",e.edit="fa fa-pencil",e.destroy="fa fa-times",e.destroyCircle="fa fa-times-circle",e.exchange="fa fa-exchange",e.copy="fa fa-copy",e.clipboard="fa fa-clipboard",e.flatten="fa fa-chain-broken",e.trash="fa fa-trash-o",e.lock="fa fa-lock",e.unlock="fa fa-unlock",e.clone="fa fa-clone",e.undo="fa fa-undo",e.search="fa fa-search",e.start="fa fa-play",e.stop="fa fa-stop",e.analyse="fa fa-stethoscope",e.deepCheck="fa fa-cog",e.reweight="fa fa-balance-scale",e.left="fa fa-arrow-left",e.right="fa fa-arrow-right",e.down="fa fa-arrow-down",e.erase="fa fa-eraser",e.user="fa fa-user",e.users="fa fa-users",e.share="fa fa-share-alt",e.key="fa fa-key-modern",e.warning="fa fa-exclamation-triangle",e.info="fa fa-info",e.infoCircle="fa fa-info-circle",e.questionCircle="fa fa-question-circle-o",e.check="fa fa-check",e.show="fa fa-eye",e.paragraph="fa fa-paragraph",e.terminal="fa fa-terminal",e.magic="fa fa-magic",e.hourglass="fa fa-hourglass-o",e.filledHourglass="fa fa-hourglass",e.table="fa fa-table",e.spinner="fa fa-spinner",e.refresh="fa fa-refresh",e.bullseye="fa fa-bullseye",e.disk="fa fa-hdd-o",e.server="fa fa-server",e.filter="fa fa-filter",e.lineChart="fa fa-line-chart",e.signOut="fa fa-sign-out",e.health="fa fa-heartbeat",e.circle="fa fa-circle",e.bell="fa fa-bell",e.tag="fa fa-tag",e.leftArrow="fa fa-angle-left",e.rightArrow="fa fa-angle-right",e.leftArrowDouble="fa fa-angle-double-left",e.rightArrowDouble="fa fa-angle-double-right",e.flag="fa fa-flag",e.clearFilters="fa fa-window-close",e.download="fa fa-download",e.upload="fa fa-upload",e.close="fa fa-times",e.json="fa fa-file-code-o",e.text="fa fa-file-text",e.wrench="fa fa-wrench",e.enter="fa fa-sign-in",e.exit="fa fa-sign-out",e.large="fa fa-lg",e.large2x="fa fa-2x",e.large3x="fa fa-3x",e.stack="fa fa-stack",e.stack1x="fa fa-stack-1x",e.stack2x="fa fa-stack-2x",e.pulse="fa fa-pulse",e.spin="fa fa-spin",e.inverse="fa fa-inverse",e}({})},"p/rL":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_M\u025bkalo_Zuw\u025bnkalo_Zuluyekalo_Utikalo_S\u025btanburukalo_\u0254kut\u0254burukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_M\u025b_Zuw_Zul_Uti_S\u025bt_\u0254ku_Now_Des".split("_"),weekdays:"Kari_Nt\u025bn\u025bn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Nt\u025b_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm"},calendar:{sameDay:"[Bi l\u025br\u025b] LT",nextDay:"[Sini l\u025br\u025b] LT",nextWeek:"dddd [don l\u025br\u025b] LT",lastDay:"[Kunu l\u025br\u025b] LT",lastWeek:"dddd [t\u025bm\u025bnen l\u025br\u025b] LT",sameElse:"L"},relativeTime:{future:"%s k\u0254n\u0254",past:"a b\u025b %s b\u0254",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"l\u025br\u025b kelen",hh:"l\u025br\u025b %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("wd/R"))},p4Cf:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("oxzT"),r=n("8Y7J"),s=n("SVse"),o=n("G0yt");function a(e,t){if(1&e&&(r.Nb(0,"div",2),r.nc(1)),2&e){const e=r.ic();r.Ab(e.class),r.pc("innerHtml",e.html,r.Ec)}}const c=function(e){return[e]},l=["*"];let u=(()=>{class e{constructor(){this.icons=i.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Gb({type:e,selectors:[["cd-helper"]],inputs:{class:"class",html:"html"},ngContentSelectors:l,decls:3,vars:4,consts:[["popoverTpl",""],["aria-hidden","true",3,"ngClass","ngbPopover","click"],[3,"innerHtml"]],template:function(e,t){if(1&e&&(r.oc(),r.Mc(0,a,2,3,"ng-template",null,0,r.Nc),r.Sb(2,"i",1),r.gc("click",(function(e){return e.preventDefault()})),r.Rb()),2&e){const e=r.Ac(1);r.yb(2),r.pc("ngClass",r.uc(2,c,t.icons.questionCircle))("ngbPopover",e)}},directives:[s.p,o.w],styles:["i[_ngcontent-%COMP%]{color:#2b99a8;cursor:pointer;padding-left:4px}"]}),e})()},pLZG:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e,t){return function(n){return n.lift(new s(e,t))}}class s{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new o(e,this.predicate,this.thisArg))}}class o extends i.a{constructor(e,t,n){super(e),this.predicate=t,this.thisArg=n,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}},pkCn:function(e,t,n){"use strict";var i=n("0Dky");e.exports=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))}},ppGB:function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},ppaS:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=n("8Y7J"),r=n("oxzT"),s=n("DNAf"),o=n("wnGv"),a=n("SVse");const c=["cdSelect"],l=function(e){return[e]};function u(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span"),i.Sb(1,"span",4),i.Sb(2,"span",5),i.Oc(3),i.Rb(),i.Sb(4,"a",6),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic(),i.Ac(1).removeItem(n)})),i.Nb(5,"i",7),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic();i.yb(3),i.Pc(e),i.yb(2),i.pc("ngClass",i.uc(2,l,n.icons.destroy))}}let d=(()=>{class e{constructor(){this.data=[],this.options=[],this.messages=new s.a({}),this.customBadges=!1,this.customBadgeValidators=[],this.selection=new i.o,this.icons=r.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-select-badges"]],viewQuery:function(e,t){var n;1&e&&i.Jc(c,!0),2&e&&i.zc(n=i.hc())&&(t.cdSelect=n.first)},inputs:{data:"data",options:"options",messages:"messages",selectionLimit:"selectionLimit",customBadges:"customBadges",customBadgeValidators:"customBadgeValidators"},outputs:{selection:"selection"},decls:4,vars:10,consts:[["elemClass","mr-2 select-menu-edit",3,"data","options","messages","selectionLimit","customBadges","customBadgeValidators","selection"],["cdSelect",""],[3,"ngClass"],[4,"ngFor","ngForOf"],[1,"badge","badge-dark","mr-2"],[1,"mr-2"],[1,"badge-remove",3,"click"],["aria-hidden","true",3,"ngClass"]],template:function(e,t){1&e&&(i.Sb(0,"cd-select",0,1),i.gc("selection",(function(e){return t.selection.emit(e)})),i.Nb(2,"i",2),i.Rb(),i.Mc(3,u,6,4,"span",3)),2&e&&(i.pc("data",t.data)("options",t.options)("messages",t.messages)("selectionLimit",t.selectionLimit)("customBadges",t.customBadges)("customBadgeValidators",t.customBadgeValidators),i.yb(2),i.pc("ngClass",i.uc(8,l,t.icons.edit)),i.yb(1),i.pc("ngForOf",t.data))},directives:[o.a,a.p,a.q],styles:[".badge-remove[_ngcontent-%COMP%]{color:#fff}i.fa-pencil[_ngcontent-%COMP%]{font-size:1.1rem}"]}),e})()},pxpQ:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a}));var i=n("7o/Q"),r=n("WMd4");function s(e,t=0){return function(n){return n.lift(new o(e,t))}}class o{constructor(e,t=0){this.scheduler=e,this.delay=t}call(e,t){return t.subscribe(new a(e,this.scheduler,this.delay))}}class a extends i.a{constructor(e,t,n=0){super(e),this.scheduler=t,this.delay=n}static dispatch(e){const{notification:t,destination:n}=e;t.observe(n),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new c(e,this.destination)))}_next(e){this.scheduleMessage(r.a.createNext(e))}_error(e){this.scheduleMessage(r.a.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(r.a.createComplete()),this.unsubscribe()}}class c{constructor(e,t){this.notification=e,this.destination=t}}},pyRK:function(e,t,n){"use strict";var i=Object.prototype;t.a=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}},quSY:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("DH7j"),r=n("XoHu"),s=n("n6bG");const o=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();let a=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:a,_unsubscribe:l,_subscriptions:u}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(let e=0;e<n.length;++e)n[e].remove(this);if(Object(s.a)(l)){a&&(this._unsubscribe=void 0);try{l.call(this)}catch(d){t=d instanceof o?c(d.errors):[d]}}if(Object(i.a)(u)){let e=-1,n=u.length;for(;++e<n;){const n=u[e];if(Object(r.a)(n))try{n.unsubscribe()}catch(d){t=t||[],d instanceof o?t=t.concat(c(d.errors)):t.push(d)}}}if(t)throw new o(t)}add(t){let n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){const t=n;n=new e,n._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:i}=n;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}const r=this._subscriptions;return null===r?this._subscriptions=[n]:r.push(n),n}remove(e){const t=this._subscriptions;if(t){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}}var t;return e.EMPTY=((t=new e).closed=!0,t),e})();function c(e){return e.reduce((e,t)=>e.concat(t instanceof o?t.errors:t),[])}},qvJo:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["\u0925\u094b\u0921\u092f\u093e \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940","\u0925\u094b\u0921\u0947 \u0938\u0945\u0915\u0902\u0921"],ss:[e+" \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940",e+" \u0938\u0945\u0915\u0902\u0921"],m:["\u090f\u0915\u093e \u092e\u093f\u0923\u091f\u093e\u0928","\u090f\u0915 \u092e\u093f\u0928\u0942\u091f"],mm:[e+" \u092e\u093f\u0923\u091f\u093e\u0902\u0928\u0940",e+" \u092e\u093f\u0923\u091f\u093e\u0902"],h:["\u090f\u0915\u093e \u0935\u0930\u093e\u0928","\u090f\u0915 \u0935\u0930"],hh:[e+" \u0935\u0930\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u093e\u0902"],d:["\u090f\u0915\u093e \u0926\u093f\u0938\u093e\u0928","\u090f\u0915 \u0926\u0940\u0938"],dd:[e+" \u0926\u093f\u0938\u093e\u0902\u0928\u0940",e+" \u0926\u0940\u0938"],M:["\u090f\u0915\u093e \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928","\u090f\u0915 \u092e\u094d\u0939\u092f\u0928\u094b"],MM:[e+" \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928\u0940",e+" \u092e\u094d\u0939\u092f\u0928\u0947"],y:["\u090f\u0915\u093e \u0935\u0930\u094d\u0938\u093e\u0928","\u090f\u0915 \u0935\u0930\u094d\u0938"],yy:[e+" \u0935\u0930\u094d\u0938\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u094d\u0938\u093e\u0902"]};return i?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u092f_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),format:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092e\u093e\u0930\u094d\u091a\u093e\u091a\u094d\u092f\u093e_\u090f\u092a\u094d\u0930\u0940\u0932\u093e\u091a\u094d\u092f\u093e_\u092e\u0947\u092f\u093e\u091a\u094d\u092f\u093e_\u091c\u0942\u0928\u093e\u091a\u094d\u092f\u093e_\u091c\u0941\u0932\u092f\u093e\u091a\u094d\u092f\u093e_\u0911\u0917\u0938\u094d\u091f\u093e\u091a\u094d\u092f\u093e_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0911\u0915\u094d\u091f\u094b\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0921\u093f\u0938\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940._\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u092f\u0924\u093e\u0930_\u0938\u094b\u092e\u093e\u0930_\u092e\u0902\u0917\u0933\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u092c\u093f\u0930\u0947\u0938\u094d\u0924\u093e\u0930_\u0938\u0941\u0915\u094d\u0930\u093e\u0930_\u0936\u0947\u0928\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0906\u092f\u0924._\u0938\u094b\u092e._\u092e\u0902\u0917\u0933._\u092c\u0941\u0927._\u092c\u094d\u0930\u0947\u0938\u094d\u0924._\u0938\u0941\u0915\u094d\u0930._\u0936\u0947\u0928.".split("_"),weekdaysMin:"\u0906_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u092c\u094d\u0930\u0947_\u0938\u0941_\u0936\u0947".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LTS:"A h:mm:ss [\u0935\u093e\u091c\u0924\u093e\u0902]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",llll:"ddd, D MMM YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]"},calendar:{sameDay:"[\u0906\u092f\u091c] LT",nextDay:"[\u092b\u093e\u0932\u094d\u092f\u093e\u0902] LT",nextWeek:"[\u092b\u0941\u0921\u0932\u094b] dddd[,] LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092b\u093e\u091f\u0932\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s \u0906\u0926\u0940\u0902",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(\u0935\u0947\u0930)/,ordinal:function(e,t){switch(t){case"D":return e+"\u0935\u0947\u0930";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/\u0930\u093e\u0924\u0940|\u0938\u0915\u093e\u0933\u0940\u0902|\u0926\u0928\u092a\u093e\u0930\u093e\u0902|\u0938\u093e\u0902\u091c\u0947/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u0940"===t?e<4?e:e+12:"\u0938\u0915\u093e\u0933\u0940\u0902"===t?e:"\u0926\u0928\u092a\u093e\u0930\u093e\u0902"===t?e>12?e:e+12:"\u0938\u093e\u0902\u091c\u0947"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924\u0940":e<12?"\u0938\u0915\u093e\u0933\u0940\u0902":e<16?"\u0926\u0928\u092a\u093e\u0930\u093e\u0902":e<20?"\u0938\u093e\u0902\u091c\u0947":"\u0930\u093e\u0924\u0940"}})}(n("wd/R"))},rB9j:function(e,t,n){"use strict";var i=n("I+eb"),r=n("kmMV");i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},rKzb:function(e,t,n){"use strict";var i=n("4syw"),r=n("8YOa").getWeakData,s=n("glrk"),o=n("hh1v"),a=n("GarU"),c=n("ImZN"),l=n("tycR"),u=n("UTVS"),d=n("afO8"),h=d.set,f=d.getterFor,p=l.find,m=l.findIndex,b=0,g=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},y=function(e,t){return p(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=m(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,l){var d=e((function(e,i){a(e,d,t),h(e,{type:t,id:b++,frozen:void 0}),null!=i&&c(i,e[l],{that:e,AS_ENTRIES:n})})),p=f(t),m=function(e,t,n){var i=p(e),o=r(s(t),!0);return!0===o?g(i).set(t,n):o[i.id]=n,e};return i(d.prototype,{delete:function(e){var t=p(this);if(!o(e))return!1;var n=r(e);return!0===n?g(t).delete(e):n&&u(n,t.id)&&delete n[t.id]},has:function(e){var t=p(this);if(!o(e))return!1;var n=r(e);return!0===n?g(t).has(e):n&&u(n,t.id)}}),i(d.prototype,n?{get:function(e){var t=p(this);if(o(e)){var n=r(e);return!0===n?g(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return m(this,e,t)}}:{add:function(e){return m(this,e,!0)}}),d}}},rW0t:function(e,t,n){"use strict";var i=n("glrk");e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},raLr:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443":"h"===n?t?"\u0433\u043e\u0434\u0438\u043d\u0430":"\u0433\u043e\u0434\u0438\u043d\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d",hh:t?"\u0433\u043e\u0434\u0438\u043d\u0430_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d":"\u0433\u043e\u0434\u0438\u043d\u0443_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u043d\u0456\u0432",MM:"\u043c\u0456\u0441\u044f\u0446\u044c_\u043c\u0456\u0441\u044f\u0446\u0456_\u043c\u0456\u0441\u044f\u0446\u0456\u0432",yy:"\u0440\u0456\u043a_\u0440\u043e\u043a\u0438_\u0440\u043e\u043a\u0456\u0432"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}function n(e){return function(){return e+"\u043e"+(11===this.hours()?"\u0431":"")+"] LT"}}e.defineLocale("uk",{months:{format:"\u0441\u0456\u0447\u043d\u044f_\u043b\u044e\u0442\u043e\u0433\u043e_\u0431\u0435\u0440\u0435\u0437\u043d\u044f_\u043a\u0432\u0456\u0442\u043d\u044f_\u0442\u0440\u0430\u0432\u043d\u044f_\u0447\u0435\u0440\u0432\u043d\u044f_\u043b\u0438\u043f\u043d\u044f_\u0441\u0435\u0440\u043f\u043d\u044f_\u0432\u0435\u0440\u0435\u0441\u043d\u044f_\u0436\u043e\u0432\u0442\u043d\u044f_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430_\u0433\u0440\u0443\u0434\u043d\u044f".split("_"),standalone:"\u0441\u0456\u0447\u0435\u043d\u044c_\u043b\u044e\u0442\u0438\u0439_\u0431\u0435\u0440\u0435\u0437\u0435\u043d\u044c_\u043a\u0432\u0456\u0442\u0435\u043d\u044c_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u0435\u0440\u0432\u0435\u043d\u044c_\u043b\u0438\u043f\u0435\u043d\u044c_\u0441\u0435\u0440\u043f\u0435\u043d\u044c_\u0432\u0435\u0440\u0435\u0441\u0435\u043d\u044c_\u0436\u043e\u0432\u0442\u0435\u043d\u044c_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434_\u0433\u0440\u0443\u0434\u0435\u043d\u044c".split("_")},monthsShort:"\u0441\u0456\u0447_\u043b\u044e\u0442_\u0431\u0435\u0440_\u043a\u0432\u0456\u0442_\u0442\u0440\u0430\u0432_\u0447\u0435\u0440\u0432_\u043b\u0438\u043f_\u0441\u0435\u0440\u043f_\u0432\u0435\u0440_\u0436\u043e\u0432\u0442_\u043b\u0438\u0441\u0442_\u0433\u0440\u0443\u0434".split("_"),weekdays:function(e,t){var n={nominative:"\u043d\u0435\u0434\u0456\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044f_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),accusative:"\u043d\u0435\u0434\u0456\u043b\u044e_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044e_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),genitive:"\u043d\u0435\u0434\u0456\u043b\u0456_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043a\u0430_\u0432\u0456\u0432\u0442\u043e\u0440\u043a\u0430_\u0441\u0435\u0440\u0435\u0434\u0438_\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u0456_\u0441\u0443\u0431\u043e\u0442\u0438".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[\u0412\u0432\u0423\u0443]\]) ?dddd/.test(t)?"accusative":/\[?(?:\u043c\u0438\u043d\u0443\u043b\u043e\u0457|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u043e\u0457)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0440.",LLL:"D MMMM YYYY \u0440., HH:mm",LLLL:"dddd, D MMMM YYYY \u0440., HH:mm"},calendar:{sameDay:n("[\u0421\u044c\u043e\u0433\u043e\u0434\u043d\u0456 "),nextDay:n("[\u0417\u0430\u0432\u0442\u0440\u0430 "),lastDay:n("[\u0412\u0447\u043e\u0440\u0430 "),nextWeek:n("[\u0423] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0457] dddd [").call(this);case 1:case 2:case 4:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0433\u043e] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"%s \u0442\u043e\u043c\u0443",s:"\u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0433\u043e\u0434\u0438\u043d\u0443",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,M:"\u043c\u0456\u0441\u044f\u0446\u044c",MM:t,y:"\u0440\u0456\u043a",yy:t},meridiemParse:/\u043d\u043e\u0447\u0456|\u0440\u0430\u043d\u043a\u0443|\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0456":e<12?"\u0440\u0430\u043d\u043a\u0443":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u043e\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-\u0439";case"D":return e+"-\u0433\u043e";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},rpNk:function(e,t,n){"use strict";var i,r,s,o=n("0Dky"),a=n("4WOD"),c=n("kRJp"),l=n("UTVS"),u=n("tiKp"),d=n("xDBR"),h=u("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(r=a(a(s)))!==Object.prototype&&(i=r):f=!0);var p=null==i||o((function(){var e={};return i[h].call(e)!==e}));p&&(i={}),d&&!p||l(i,h)||c(i,h,(function(){return this})),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}},"s+uk":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"J\xe4nner_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"J\xe4n._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},s7LF:function(e,t,n){"use strict";n.d(t,"a",(function(){return fe})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return be})),n.d(t,"f",(function(){return Ee})),n.d(t,"g",(function(){return Ye})),n.d(t,"h",(function(){return pe})),n.d(t,"i",(function(){return Pe})),n.d(t,"j",(function(){return me})),n.d(t,"k",(function(){return Ce})),n.d(t,"l",(function(){return Re})),n.d(t,"m",(function(){return ze})),n.d(t,"n",(function(){return M})),n.d(t,"o",(function(){return c})),n.d(t,"p",(function(){return g})),n.d(t,"q",(function(){return y})),n.d(t,"r",(function(){return v})),n.d(t,"s",(function(){return ye})),n.d(t,"t",(function(){return xe})),n.d(t,"u",(function(){return H})),n.d(t,"v",(function(){return A})),n.d(t,"w",(function(){return j})),n.d(t,"x",(function(){return $e})),n.d(t,"y",(function(){return Ne})),n.d(t,"z",(function(){return $})),n.d(t,"A",(function(){return D})),n.d(t,"B",(function(){return U})),n.d(t,"C",(function(){return ke}));var i=n("8Y7J"),r=n("SVse"),s=n("cp0P"),o=n("Cfvw"),a=n("lJxs");const c=new i.r("NgValueAccessor"),l={provide:c,useExisting:Object(i.T)(()=>u),multi:!0};let u=(()=>{class e{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(e,t){1&e&&i.gc("change",(function(e){return t.onChange(e.target.checked)}))("blur",(function(){return t.onTouched()}))},features:[i.xb([l])]}),e})();const d={provide:c,useExisting:Object(i.T)(()=>f),multi:!0},h=new i.r("CompositionEventMode");let f=(()=>{class e{constructor(e,t,n){this._renderer=e,this._elementRef=t,this._compositionMode=n,this.onChange=e=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=Object(r.L)()?Object(r.L)().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m),i.Mb(h,8))},e.\u0275dir=i.Hb({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&i.gc("input",(function(e){return t._handleInput(e.target.value)}))("blur",(function(){return t.onTouched()}))("compositionstart",(function(){return t._compositionStart()}))("compositionend",(function(e){return t._compositionEnd(e.target.value)}))},features:[i.xb([d])]}),e})(),p=(()=>{class e{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e}),e})(),m=(()=>{class e extends p{get formDirective(){return null}get path(){return null}}return e.\u0275fac=function(t){return b(t||e)},e.\u0275dir=i.Hb({type:e,features:[i.vb]}),e})();const b=i.Ub(m);class g extends p{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}get validator(){}get asyncValidator(){}}class _{constructor(e){this._cd=e}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}let y=(()=>{class e extends _{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(g,2))},e.\u0275dir=i.Hb({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&i.Eb("ng-untouched",t.ngClassUntouched)("ng-touched",t.ngClassTouched)("ng-pristine",t.ngClassPristine)("ng-dirty",t.ngClassDirty)("ng-valid",t.ngClassValid)("ng-invalid",t.ngClassInvalid)("ng-pending",t.ngClassPending)},features:[i.vb]}),e})(),v=(()=>{class e extends _{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(m,2))},e.\u0275dir=i.Hb({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(e,t){2&e&&i.Eb("ng-untouched",t.ngClassUntouched)("ng-touched",t.ngClassTouched)("ng-pristine",t.ngClassPristine)("ng-dirty",t.ngClassDirty)("ng-valid",t.ngClassValid)("ng-invalid",t.ngClassInvalid)("ng-pending",t.ngClassPending)},features:[i.vb]}),e})();function w(e){return null==e||0===e.length}function S(e){return null!=e&&"number"==typeof e.length}const M=new i.r("NgValidators"),x=new i.r("NgAsyncValidators"),k=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class D{static min(e){return t=>{if(w(t.value)||w(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n<e?{min:{min:e,actual:t.value}}:null}}static max(e){return t=>{if(w(t.value)||w(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n>e?{max:{max:e,actual:t.value}}:null}}static required(e){return w(e.value)?{required:!0}:null}static requiredTrue(e){return!0===e.value?null:{required:!0}}static email(e){return w(e.value)||k.test(e.value)?null:{email:!0}}static minLength(e){return t=>w(t.value)||!S(t.value)?null:t.value.length<e?{minlength:{requiredLength:e,actualLength:t.value.length}}:null}static maxLength(e){return t=>S(t.value)&&t.value.length>e?{maxlength:{requiredLength:e,actualLength:t.value.length}}:null}static pattern(e){if(!e)return D.nullValidator;let t,n;return"string"==typeof e?(n="","^"!==e.charAt(0)&&(n+="^"),n+=e,"$"!==e.charAt(e.length-1)&&(n+="$"),t=new RegExp(n)):(n=e.toString(),t=e),e=>{if(w(e.value))return null;const i=e.value;return t.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}static nullValidator(e){return null}static compose(e){if(!e)return null;const t=e.filter(T);return 0==t.length?null:function(e){return O(R(e,t))}}static composeAsync(e){if(!e)return null;const t=e.filter(T);return 0==t.length?null:function(e){const n=R(e,t).map(C);return Object(s.a)(n).pipe(Object(a.a)(O))}}}function T(e){return null!=e}function C(e){const t=Object(i.qb)(e)?Object(o.a)(e):e;return Object(i.pb)(t),t}function O(e){let t={};return e.forEach(e=>{t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function R(e,t){return t.map(t=>t(e))}function L(e){return e.map(e=>function(e){return!e.validate}(e)?e:t=>e.validate(t))}const E={provide:c,useExisting:Object(i.T)(()=>A),multi:!0};let A=(()=>{class e{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(e,t){1&e&&i.gc("input",(function(e){return t.onChange(e.target.value)}))("blur",(function(){return t.onTouched()}))},features:[i.xb([E])]}),e})();const I={provide:c,useExisting:Object(i.T)(()=>j),multi:!0};let P=(()=>{class e{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),j=(()=>{class e{constructor(e,t,n,i){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(g),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}fireUncheck(e){this.writeValue(e)}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m),i.Mb(P),i.Mb(i.s))},e.\u0275dir=i.Hb({type:e,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(e,t){1&e&&i.gc("change",(function(){return t.onChange()}))("blur",(function(){return t.onTouched()}))},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[i.xb([I])]}),e})();const N={provide:c,useExisting:Object(i.T)(()=>F),multi:!0};let F=(()=>{class e{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(e,t){1&e&&i.gc("change",(function(e){return t.onChange(e.target.value)}))("input",(function(e){return t.onChange(e.target.value)}))("blur",(function(){return t.onTouched()}))},features:[i.xb([N])]}),e})();const Y={provide:c,useExisting:Object(i.T)(()=>$),multi:!0};function z(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}let $=(()=>{class e{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(e){this._compareWith=e}writeValue(e){this.value=e;const t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=z(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(e){this.onChange=t=>{this.value=this._getOptionValue(t),e(this.value)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t),e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(e,t){1&e&&i.gc("change",(function(e){return t.onChange(e.target.value)}))("blur",(function(){return t.onTouched()}))},inputs:{compareWith:"compareWith"},features:[i.xb([Y])]}),e})(),H=(()=>{class e{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(e){null!=this._select&&(this._select._optionMap.set(this.id,e),this._setElementValue(z(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._setElementValue(e),this._select&&this._select.writeValue(this._select.value)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb($,9))},e.\u0275dir=i.Hb({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),e})();const W={provide:c,useExisting:Object(i.T)(()=>B),multi:!0};function V(e,t){return null==e?""+t:("string"==typeof t&&(t=`'${t}'`),t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}let B=(()=>{class e{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(e){this._compareWith=e}writeValue(e){let t;if(this.value=e,Array.isArray(e)){const n=e.map(e=>this._getOptionId(e));t=(e,t)=>{e._setSelected(n.indexOf(t.toString())>-1)}}else t=(e,t)=>{e._setSelected(!1)};this._optionMap.forEach(t)}registerOnChange(e){this.onChange=t=>{const n=[];if(void 0!==t.selectedOptions){const e=t.selectedOptions;for(let t=0;t<e.length;t++){const i=e.item(t),r=this._getOptionValue(i.value);n.push(r)}}else{const e=t.options;for(let t=0;t<e.length;t++){const i=e.item(t);if(i.selected){const e=this._getOptionValue(i.value);n.push(e)}}}this.value=n,e(n)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(e){const t=(this._idCounter++).toString();return this._optionMap.set(t,e),t}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t)._value,e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t)._value:e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.E),i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(e,t){1&e&&i.gc("change",(function(e){return t.onChange(e.target)}))("blur",(function(){return t.onTouched()}))},inputs:{compareWith:"compareWith"},features:[i.xb([W])]}),e})(),U=(()=>{class e{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){null!=this._select&&(this._value=e,this._setElementValue(V(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(V(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E),i.Mb(B,9))},e.\u0275dir=i.Hb({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),e})();function G(e,t){return[...t.path,e]}function q(e,t){e.validator=D.compose([e.validator,t.validator]),e.asyncValidator=D.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&J(e,t)})}(e,t),function(e,t){e.registerOnChange((e,n)=>{t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&J(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(e=>{t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())}),t._rawAsyncValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())})}function J(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function Q(e,t){e.validator=D.compose([e.validator,t.validator]),e.asyncValidator=D.composeAsync([e.asyncValidator,t.asyncValidator])}function K(e){return null!=e?D.compose(L(e)):null}function Z(e){return null!=e?D.composeAsync(L(e)):null}function X(e,t){if(!e.hasOwnProperty("model"))return!1;const n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)}const ee=[u,F,A,$,B,j];function te(e,t){e._syncPendingControls(),t.forEach(e=>{const t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function ne(e,t){if(!t)return null;Array.isArray(t);let n=void 0,i=void 0,r=void 0;return t.forEach(e=>{var t;e.constructor===f?n=e:(t=e,ee.some(e=>t.constructor===e)?i=e:r=e)}),r||i||n||null}function ie(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const re="VALID",se="INVALID",oe="PENDING",ae="DISABLED";function ce(e){return(he(e)?e.validators:e)||null}function le(e){return Array.isArray(e)?K(e):e||null}function ue(e,t){return(he(t)?t.asyncValidators:e)||null}function de(e){return Array.isArray(e)?Z(e):e||null}function he(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class fe{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=le(this._rawValidators),this._composedAsyncValidatorFn=de(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===re}get invalid(){return this.status===se}get pending(){return this.status==oe}get disabled(){return this.status===ae}get enabled(){return this.status!==ae}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=le(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=de(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=oe,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=ae,this.errors=null,this._forEachChild(t=>{t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=re,this._forEachChild(t=>{t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==re&&this.status!==oe||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ae:re}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=oe,this._hasOwnPendingAsyncValidator=!0;const t=C(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,n){if(null==t)return null;if(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length)return null;let i=e;return t.forEach(e=>{i=i instanceof me?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof be&&i.at(e)||null}),i}(this,e)}getError(e,t){const n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new i.o,this.statusChanges=new i.o}_calculateStatus(){return this._allControlsDisabled()?ae:this.errors?se:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(oe)?oe:this._anyControlsHaveStatus(se)?se:re}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){he(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&this._parent&&this._parent.dirty&&!this._parent._anyControlsDirty()}}class pe extends fe{constructor(e=null,t,n){super(ce(t),ue(n,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_clearChangeFns(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=()=>{}}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class me extends fe{constructor(e,t,n){super(ce(t),ue(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){Object.keys(e).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e={},t={}){this._forEachChild((n,i)=>{n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,n)=>(e[n]=t instanceof pe?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet. If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>e(this.controls[t],t))}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const n=this.controls[t];if(this.contains(t)&&e(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,n)=>((t.enabled||this.disabled)&&(e[n]=t.value),e))}_reduceChildren(e,t){let n=e;return this._forEachChild((e,i)=>{n=t(n,e,i)}),n}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class be extends fe{constructor(e,t,n){super(ce(t),ue(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e.forEach((e,n)=>{this.at(n)&&this.at(n).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e=[],t={}){this._forEachChild((n,i)=>{n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof pe?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet. If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)}_forEachChild(e){this.controls.forEach((t,n)=>{e(t,n)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const ge={provide:m,useExisting:Object(i.T)(()=>ye)},_e=(()=>Promise.resolve(null))();let ye=(()=>{class e extends m{constructor(e,t){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new i.o,this.form=new me({},K(e),Z(t))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){_e.then(()=>{const t=this._findContainer(e.path);e.control=t.registerControl(e.name,e.control),q(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){_e.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name),ie(this._directives,e)})}addFormGroup(e){_e.then(()=>{const t=this._findContainer(e.path),n=new me({});Q(n,e),t.registerControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){_e.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,t){_e.then(()=>{this.form.get(e.path).setValue(t)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,te(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(M,10),i.Mb(x,10))},e.\u0275dir=i.Hb({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&i.gc("submit",(function(e){return t.onSubmit(e)}))("reset",(function(){return t.onReset()}))},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[i.xb([ge]),i.vb]}),e})(),ve=(()=>{class e extends m{ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return G(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return K(this._validators)}get asyncValidator(){return Z(this._asyncValidators)}_checkParentType(){}}return e.\u0275fac=function(t){return we(t||e)},e.\u0275dir=i.Hb({type:e,features:[i.vb]}),e})();const we=i.Ub(ve),Se={provide:g,useExisting:Object(i.T)(()=>xe)},Me=(()=>Promise.resolve(null))();let xe=(()=>{class e extends g{constructor(e,t,n,r){super(),this.control=new pe,this._registered=!1,this.update=new i.o,this._parent=e,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=ne(0,r)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),X(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?G(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return K(this._rawValidators)}get asyncValidator(){return Z(this._rawAsyncValidators)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){q(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){Me.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const t=e.isDisabled.currentValue,n=""===t||t&&"false"!==t;Me.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(m,9),i.Mb(M,10),i.Mb(x,10),i.Mb(c,10))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[i.xb([Se]),i.vb,i.wb]}),e})(),ke=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e})();const De=new i.r("NgModelWithFormControlWarning"),Te={provide:m,useExisting:Object(i.T)(()=>Ce)};let Ce=(()=>{class e extends m{constructor(e,t){super(),this._validators=e,this._asyncValidators=t,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new i.o}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const t=this.form.get(e.path);return q(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}getControl(e){return this.form.get(e.path)}removeControl(e){ie(this.directives,e)}addFormGroup(e){const t=this.form.get(e.path);Q(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormGroup(e){}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){const t=this.form.get(e.path);Q(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormArray(e){}getFormArray(e){return this.form.get(e.path)}updateModel(e,t){this.form.get(e.path).setValue(t)}onSubmit(e){return this.submitted=!0,te(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach(e=>{const t=this.form.get(e.path);e.control!==t&&(function(e,t){const n=()=>{};t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n),t._rawValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),t._rawAsyncValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),e&&e._clearChangeFns()}(e.control,e),t&&q(t,e),e.control=t)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{}),this._oldForm=this.form}_updateValidators(){const e=K(this._validators);this.form.validator=D.compose([this.form.validator,e]);const t=Z(this._asyncValidators);this.form.asyncValidator=D.composeAsync([this.form.asyncValidator,t])}_checkFormPresent(){}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(M,10),i.Mb(x,10))},e.\u0275dir=i.Hb({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&i.gc("submit",(function(e){return t.onSubmit(e)}))("reset",(function(){return t.onReset()}))},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[i.xb([Te]),i.vb,i.wb]}),e})();const Oe={provide:m,useExisting:Object(i.T)(()=>Re)};let Re=(()=>{class e extends ve{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}_checkParentType(){Ae(this._parent)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(m,13),i.Mb(M,10),i.Mb(x,10))},e.\u0275dir=i.Hb({type:e,selectors:[["","formGroupName",""]],inputs:{name:["formGroupName","name"]},features:[i.xb([Oe]),i.vb]}),e})();const Le={provide:m,useExisting:Object(i.T)(()=>Ee)};let Ee=(()=>{class e extends m{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}ngOnInit(){this._checkParentType(),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return G(null==this.name?this.name:this.name.toString(),this._parent)}get validator(){return K(this._validators)}get asyncValidator(){return Z(this._asyncValidators)}_checkParentType(){Ae(this._parent)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(m,13),i.Mb(M,10),i.Mb(x,10))},e.\u0275dir=i.Hb({type:e,selectors:[["","formArrayName",""]],inputs:{name:["formArrayName","name"]},features:[i.xb([Le]),i.vb]}),e})();function Ae(e){return!(e instanceof Re||e instanceof Ce||e instanceof Ee)}const Ie={provide:g,useExisting:Object(i.T)(()=>Pe)};let Pe=(()=>{class e extends g{constructor(e,t,n,r,s){super(),this._ngModelWarningConfig=s,this._added=!1,this.update=new i.o,this._ngModelWarningSent=!1,this._parent=e,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=ne(0,r)}set isDisabled(e){}ngOnChanges(t){var n,r;this._added||this._setUpControl(),X(t,this.viewModel)&&(n=e,this,r=this._ngModelWarningConfig,Object(i.U)()&&"never"!==r&&((null!==r&&"once"!==r||n._ngModelWarningSentOnce)&&("always"!==r||this._ngModelWarningSent)||(n._ngModelWarningSentOnce=!0,this._ngModelWarningSent=!0)),this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return G(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return K(this._rawValidators)}get asyncValidator(){return Z(this._rawAsyncValidators)}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(m,13),i.Mb(M,10),i.Mb(x,10),i.Mb(c,10),i.Mb(De,8))},e.\u0275dir=i.Hb({type:e,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[i.xb([Ie]),i.vb,i.wb]}),e._ngModelWarningSentOnce=!1,e})();const je={provide:M,useExisting:Object(i.T)(()=>Ne),multi:!0};let Ne=(()=>{class e{constructor(){this._required=!1}get required(){return this._required}set required(e){this._required=null!=e&&!1!==e&&""+e!="false",this._onChange&&this._onChange()}validate(e){return this.required?D.required(e):null}registerOnValidatorChange(e){this._onChange=e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(e,t){2&e&&i.zb("required",t.required?"":null)},inputs:{required:"required"},features:[i.xb([je])]}),e})(),Fe=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e})(),Ye=(()=>{class e{group(e,t=null){const n=this._reduceControls(e);let i=null,r=null,s=void 0;return null!=t&&(function(e){return void 0!==e.asyncValidators||void 0!==e.validators||void 0!==e.updateOn}(t)?(i=null!=t.validators?t.validators:null,r=null!=t.asyncValidators?t.asyncValidators:null,s=null!=t.updateOn?t.updateOn:void 0):(i=null!=t.validator?t.validator:null,r=null!=t.asyncValidator?t.asyncValidator:null)),new me(n,{asyncValidators:r,updateOn:s,validators:i})}control(e,t,n){return new pe(e,t,n)}array(e,t,n){const i=e.map(e=>this._createControl(e));return new be(i,t,n)}_reduceControls(e){const t={};return Object.keys(e).forEach(n=>{t[n]=this._createControl(e[n])}),t}_createControl(e){return e instanceof pe||e instanceof me||e instanceof be?e:Array.isArray(e)?this.control(e[0],e.length>1?e[1]:null,e.length>2?e[2]:null):this.control(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),ze=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[P],imports:[Fe]}),e})(),$e=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:De,useValue:t.warnOnNgModelWithFormControl}]}}}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[Ye,P],imports:[Fe]}),e})()},sEFX:function(e,t,n){"use strict";var i=n("AO7/"),r=n("9d/t");e.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},sMBO:function(e,t,n){var i=n("g6v/"),r=n("m/L8").f,s=Function.prototype,o=s.toString,a=/^\s*function ([^ (]*)/,c="name";i&&!(c in s)&&r(s,c,{configurable:!0,get:function(){try{return o.call(this).match(a)[1]}catch(e){return""}}})},sVev:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=(()=>{function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e})()},sb0X:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n("8Y7J"),r=n("s7LF"),s=n("LvDl"),o=n.n(s),a=n("oxzT"),c=n("ANnk"),l=n("SVse");const u=function(e,t){return[e,t]};function d(e,t){if(1&e&&(i.Sb(0,"span"),i.Nb(1,"i",2),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngClass",i.vc(1,u,e.icons.spinner,e.icons.spin))}}const h=["*"];let f=(()=>{class e{constructor(e){this.elRef=e,this.type="submit",this.disabled=!1,this.submitAction=new i.o,this.loading=!1,this.icons=a.a}ngOnInit(){this.form.statusChanges.subscribe(()=>{o.a.has(this.form.errors,"cdSubmitButton")&&(this.loading=!1,o.a.unset(this.form.errors,"cdSubmitButton"),this.form instanceof r.a&&this.form.updateValueAndValidity())})}submit(e){this.focusButton(),this.form instanceof r.k&&this.form.onSubmit(e),this.form.invalid?this.focusInvalid():(this.loading=!0,this.submitAction.emit())}focusButton(){this.elRef.nativeElement.offsetParent.querySelector(`button[type="${this.type}"]`).focus()}focusInvalid(){const e=this.elRef.nativeElement.offsetParent.querySelector("input.ng-invalid, select.ng-invalid");e&&e.focus()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-submit-button"]],inputs:{form:"form",type:"type",disabled:"disabled",btnClass:"btnClass"},outputs:{submitAction:"submitAction"},ngContentSelectors:h,decls:3,vars:4,consts:[[1,"btn","btn-accent","tc_submitButton",3,"type","ngClass","disabled","click"],[4,"ngIf"],[3,"ngClass"]],template:function(e,t){1&e&&(i.oc(),i.Sb(0,"button",0),i.gc("click",(function(e){return t.submit(e)})),i.nc(1),i.Mc(2,d,2,4,"span",1),i.Rb()),2&e&&(i.pc("type",t.type)("ngClass",t.btnClass)("disabled",t.loading||t.disabled),i.yb(2),i.pc("ngIf",t.loading))},directives:[c.a,l.p,l.r],styles:[""]}),e})()},sne2:function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l}));var i=n("AytR"),r=n("8Y7J");let s=(()=>{class e{}return e.organization="ceph",e.projectName="Ceph Dashboard",e.license="Free software (LGPL 2.1).",e.copyright="Copyright(c) "+i.a.year+" Ceph contributors.",e})();var o=function(e){return e.CREATE="create",e.EDIT="edit",e.UPDATE="update",e.REMOVE="remove",e.DELETE="delete",e.ADD="add",e.COPY="copy",e.CLONE="clone",e.RECREATE="recreate",e.EXPIRE="expire",e}({}),a=function(e){return e.CREATE="Create",e.DELETE="Delete",e.ADD="Add",e.REMOVE="Remove",e.EDIT="Edit",e.CANCEL="Cancel",e.COPY="Copy",e.CLONE="Clone",e.UPDATE="Update",e.EVICT="Evict",e.SHOW="Show",e.RECREATE="Recreate",e.EXPIRE="Expire",e}({});let c=(()=>{class e{constructor(){this.CREATE="Create",this.DELETE="Delete",this.ADD="Add",this.SET="Set",this.SUBMIT="Submit",this.REMOVE="Remove",this.UNSET="Unset",this.EDIT="Edit",this.UPDATE="Update",this.CANCEL="Cancel",this.PREVIEW="Preview",this.MOVE="Move",this.NEXT="Next",this.BACK="Back",this.CLONE="Clone",this.COPY="Copy",this.DEEP_SCRUB="Deep Scrub",this.DESTROY="Destroy",this.EVICT="Evict",this.FLATTEN="Flatten",this.MARK_DOWN="Mark Down",this.MARK_IN="Mark In",this.MARK_LOST="Mark Lost",this.MARK_OUT="Mark Out",this.PROTECT="Protect",this.PURGE="Purge",this.RENAME="Rename",this.RESTORE="Restore",this.REWEIGHT="Reweight",this.ROLLBACK="Rollback",this.SCRUB="Scrub",this.SHOW="Show",this.TRASH="Move to Trash",this.UNPROTECT="Unprotect",this.CHANGE="Change",this.FLAGS="Flags",this.ENTER_MAINTENANCE="Enter Maintenance",this.EXIT_MAINTENANCE="Exit Maintenance",this.RECREATE="Recreate",this.EXPIRE="Expire"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),l=(()=>{class e{constructor(){this.CREATED="Created",this.DELETED="Deleted",this.ADDED="Added",this.REMOVED="Removed",this.EDITED="Edited",this.CANCELED="Canceled",this.PREVIEWED="Previewed",this.MOVED="Moved",this.CLONED="Cloned",this.COPIED="Copied",this.DEEP_SCRUBBED="Deep Scrubbed",this.DESTROYED="Destroyed",this.FLATTENED="Flattened",this.MARKED_DOWN="Marked Down",this.MARKED_IN="Marked In",this.MARKED_LOST="Marked Lost",this.MARKED_OUT="Marked Out",this.PROTECTED="Protected",this.PURGED="Purged",this.RENAMED="Renamed",this.RESTORED="Restored",this.REWEIGHTED="Reweighted",this.ROLLED_BACK="Rolled back",this.SCRUBBED="Scrubbed",this.SHOWED="Showed",this.TRASHED="Moved to Trash",this.UNPROTECTED="Unprotected",this.CHANGE="Change",this.RECREATED="Recreated",this.EXPIRED="Expired"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},sp3z:function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),monthsShort:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),weekdays:"\u0ead\u0eb2\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysShort:"\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysMin:"\u0e97_\u0e88_\u0ead\u0e84_\u0e9e_\u0e9e\u0eab_\u0eaa\u0e81_\u0eaa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"\u0ea7\u0eb1\u0e99dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2|\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87/,isPM:function(e){return"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"===e},meridiem:function(e,t,n){return e<12?"\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2":"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"},calendar:{sameDay:"[\u0ea1\u0eb7\u0ec9\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextDay:"[\u0ea1\u0eb7\u0ec9\u0ead\u0eb7\u0ec8\u0e99\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0edc\u0ec9\u0eb2\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastDay:"[\u0ea1\u0eb7\u0ec9\u0ea7\u0eb2\u0e99\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0ec1\u0ea5\u0ec9\u0ea7\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",sameElse:"L"},relativeTime:{future:"\u0ead\u0eb5\u0e81 %s",past:"%s\u0e9c\u0ec8\u0eb2\u0e99\u0ea1\u0eb2",s:"\u0e9a\u0ecd\u0ec8\u0ec0\u0e97\u0ebb\u0ec8\u0eb2\u0ec3\u0e94\u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",ss:"%d \u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",m:"1 \u0e99\u0eb2\u0e97\u0eb5",mm:"%d \u0e99\u0eb2\u0e97\u0eb5",h:"1 \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",hh:"%d \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",d:"1 \u0ea1\u0eb7\u0ec9",dd:"%d \u0ea1\u0eb7\u0ec9",M:"1 \u0ec0\u0e94\u0eb7\u0ead\u0e99",MM:"%d \u0ec0\u0e94\u0eb7\u0ead\u0e99",y:"1 \u0e9b\u0eb5",yy:"%d \u0e9b\u0eb5"},dayOfMonthOrdinalParse:/(\u0e97\u0eb5\u0ec8)\d{1,2}/,ordinal:function(e){return"\u0e97\u0eb5\u0ec8"+e}})}(n("wd/R"))},spCT:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}));var i=function(e){return e[e.Loading=0]="Loading",e[e.Ready=1]="Ready",e[e.Error=2]="Error",e[e.None=3]="None",e}({});class r{constructor(){this.loading=i.Loading}loadingStart(){this.loading=i.Loading}loadingReady(){this.loading=i.Ready}loadingError(){this.loading=i.Error}loadingNone(){this.loading=i.None}}},st4c:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("8Y7J"),r=n("IheW");let s=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/crush_rule",this.formTooltips={root:"The name of the node under which data should be placed.",failure_domain:"The type of CRUSH nodes across which we should separate replicas.",device_class:"The device class data should be placed on."}}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(r.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"t+mt":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"t/zF":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e,t){this.name=e,this.metadata=t}}},tGlX:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},tPH9:function(e,t,n){"use strict";t.a=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}},tT3J:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minu\u1e0d",mm:"%d minu\u1e0d",h:"sa\u025ba",hh:"%d tassa\u025bin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("wd/R"))},tUCv:function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("wd/R"))},tbfe:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},tiKp:function(e,t,n){var i=n("2oRo"),r=n("VpIT"),s=n("UTVS"),o=n("kOOl"),a=n("STAE"),c=n("/b8u"),l=r("wks"),u=i.Symbol,d=c?u:u&&u.withoutSetter||o;e.exports=function(e){return s(l,e)&&(a||"string"==typeof l[e])||(l[e]=a&&s(u,e)?u[e]:d("Symbol."+e)),l[e]}},tycR:function(e,t,n){var i=n("A2ZE"),r=n("RK3t"),s=n("ewvW"),o=n("UMSQ"),a=n("ZfDv"),c=[].push,l=function(e){var t=1==e,n=2==e,l=3==e,u=4==e,d=6==e,h=7==e,f=5==e||d;return function(p,m,b,g){for(var _,y,v=s(p),w=r(v),S=i(m,b,3),M=o(w.length),x=0,k=g||a,D=t?k(p,M):n||h?k(p,0):void 0;M>x;x++)if((f||x in w)&&(y=S(_=w[x],x,v),e))if(t)D[x]=y;else if(y)switch(e){case 3:return!0;case 5:return _;case 6:return x;case 2:c.call(D,_)}else switch(e){case 4:return!1;case 7:c.call(D,_)}return d?-1:l||u?u:D}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterOut:l(7)}},tz6c:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n("2Vo4"),r=n("pLZG"),s=n("lJxs"),o=n("SxV6"),a=n("+0ag"),c=n("mSOc"),l=n("8Y7J");let u=(()=>{class e{constructor(e,t){this.summaryservice=e,this.cephReleaseNamePipe=t,this.releaseDataSource=new i.a(null),this.releaseData$=this.releaseDataSource.asObservable(),this.summaryservice.subscribeOnce(e=>{const t=this.cephReleaseNamePipe.transform(e.version);this.releaseDataSource.next(t)})}urlGenerator(e,t="master"){const n=`https://docs.ceph.com/en/${"master"===t?"latest":t}/`,i="https://ceph.io/";return{iscsi:n+"mgr/dashboard/#enabling-iscsi-management",prometheus:n+"mgr/dashboard/#enabling-prometheus-alerting","nfs-ganesha":n+"mgr/dashboard/#configuring-nfs-ganesha-in-the-dashboard","rgw-nfs":n+"radosgw/nfs",rgw:n+"mgr/dashboard/#enabling-the-object-gateway-management-frontend",dashboard:n+"mgr/dashboard",grafana:n+"mgr/dashboard/#enabling-the-embedding-of-grafana-dashboards",orch:n+"mgr/orchestrator",pgs:i+"pgcalc",help:i+"help/",security:i+"security/",trademarks:i+"legal-page/trademarks/","dashboard-landing-page-status":n+"mgr/dashboard/#dashboard-landing-page-status","dashboard-landing-page-performance":n+"mgr/dashboard/#dashboard-landing-page-performance","dashboard-landing-page-capacity":n+"mgr/dashboard/#dashboard-landing-page-capacity"}[e]}subscribeOnce(e,t,n){return this.releaseData$.pipe(Object(r.a)(e=>!!e),Object(s.a)(t=>this.urlGenerator(e,t)),Object(o.a)()).subscribe(t,n)}}return e.\u0275fac=function(t){return new(t||e)(l.dc(c.a),l.dc(a.a))},e.\u0275prov=l.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},u3GI:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uE2L:function(e,t,n){"use strict";var i=n("AwXo");t.a=function(e,t,n){"__proto__"==t&&i.a?Object(i.a)(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},uEye:function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_m\xe5ndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._m\xe5._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_m\xe5_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I g\xe5r klokka] LT",lastWeek:"[F\xf8reg\xe5ande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein m\xe5nad",MM:"%d m\xe5nader",y:"eit \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uIqm:function(e,t,n){"use strict";n.d(t,"a",(function(){return ve}));var i=n("8Y7J"),r=n("w9WL"),s=n("LvDl"),o=n.n(s),a=n("PqYM"),c=n("HDdC"),l=n("e2NH"),u=n("x38r"),d=n("oxzT");class h{constructor(e){this.errorConfig={resetData:!0,displayError:!0},this.error=e}}var f=n("vCyI"),p=n("SVse"),m=n("G0yt"),b=n("s7LF"),g=n("dgut"),_=n("iInd"),y=n("4DD9"),v=n("o4+5"),w=n("zWsK"),S=n("yT6U"),M=n("TJUb"),x=n("efK2");const k=["tableCellBoldTpl"],D=["sparklineTpl"],T=["routerLinkTpl"],C=["checkIconTpl"],O=["perSecondTpl"],R=["executingTpl"],L=["classAddingTpl"],E=["badgeTpl"],A=["mapTpl"],I=["truncateTpl"],P=["rowDetailsTpl"];function j(e,t){1&e&&(i.Sb(0,"div",20),i.Sb(1,"div",21),i.nc(2),i.Rb(),i.Rb())}function N(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",36),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic(3).onSelectFilter(n),!1})),i.Oc(2),i.Rb(),i.Pb()}if(2&e){const e=t.$implicit;i.yb(2),i.Pc(e.column.name)}}const F=function(e){return[e]};function Y(e,t){if(1&e&&i.Nb(0,"i",28),2&e){const e=i.ic(4);i.pc("ngClass",i.uc(1,F,e.icons.check))}}function z(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",36),i.gc("click",(function(){i.Dc(e);const n=t.$implicit,r=i.ic(3);return r.onChangeFilter(r.selectedFilter,n),!1})),i.Oc(2),i.Mc(3,Y,1,3,"i",37),i.Rb(),i.Pb()}if(2&e){const e=t.$implicit,n=i.ic(3);i.yb(2),i.Qc(" ",e.formatted," "),i.yb(1),i.pc("ngIf",void 0!==n.selectedFilter.value&&n.selectedFilter.value.raw===e.raw)}}const $=function(e,t){return[e,t]};function H(e,t){if(1&e&&(i.Sb(0,"div",32),i.Sb(1,"div",33),i.Sb(2,"button",34),i.Nb(3,"i",28),i.Oc(4),i.Rb(),i.Sb(5,"div",29),i.Mc(6,N,3,1,"ng-container",30),i.Rb(),i.Rb(),i.Sb(7,"div",35),i.Sb(8,"button",34),i.Oc(9),i.Rb(),i.Sb(10,"div",29),i.Mc(11,z,4,2,"ng-container",30),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic(2);i.yb(3),i.pc("ngClass",i.vc(7,$,e.icons.large,e.icons.filter)),i.yb(1),i.Qc(" ",e.selectedFilter.column.name," "),i.yb(2),i.pc("ngForOf",e.columnFilters),i.yb(2),i.Eb("disabled",0===e.selectedFilter.options.length),i.yb(1),i.Qc(" ",e.selectedFilter.value?e.selectedFilter.value.formatted:"Any"," "),i.yb(2),i.pc("ngForOf",e.selectedFilter.options)}}function W(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",38),i.Sb(1,"span",39),i.Sb(2,"span",40),i.Nb(3,"i",28),i.Rb(),i.Rb(),i.Sb(4,"input",41),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic(2).search=t}))("keyup",(function(){return i.Dc(e),i.ic(2).updateFilter()})),i.Rb(),i.Sb(5,"div",42),i.Sb(6,"button",43),i.gc("click",(function(){return i.Dc(e),i.ic(2).onClearSearch()})),i.Nb(7,"i"),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.yb(3),i.pc("ngClass",i.uc(5,F,e.icons.search)),i.yb(1),i.pc("ngModel",e.search),i.yb(3),i.Bb("icon-prepend ",e.icons.destroy,"")}}function V(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",44),i.Sb(1,"input",45),i.gc("click",(function(t){return i.Dc(e),i.ic(2).setLimit(t)}))("keyup",(function(t){return i.Dc(e),i.ic(2).setLimit(t)}))("blur",(function(t){return i.Dc(e),i.ic(2).setLimit(t)})),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.yb(1),i.pc("value",e.userConfig.limit)}}function B(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",36),i.gc("click",(function(){i.Dc(e);const t=i.ic().$implicit;return i.ic(2).toggleColumn(t),!1})),i.Sb(1,"div",47),i.Nb(2,"input",48),i.Sb(3,"label",49),i.Oc(4),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic().$implicit;i.yb(2),i.pc("name",e.prop)("id",e.prop)("checked",!e.isHidden),i.yb(1),i.pc("for",e.prop),i.yb(1),i.Pc(e.name)}}function U(e,t){if(1&e&&(i.Qb(0),i.Mc(1,B,5,5,"button",46),i.Pb()),2&e){const e=t.$implicit;i.yb(1),i.pc("ngIf",""!==e.name)}}function G(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",50),i.Sb(1,"button",51),i.gc("click",(function(){return i.Dc(e),i.ic(2).refreshBtn()})),i.Nb(2,"i",28),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.yb(1),i.Ab("btn btn-"+e.status.type),i.pc("ngbTooltip",e.status.msg),i.yb(1),i.Eb("fa-spin",e.updating||e.loadingIndicator),i.pc("ngClass",i.vc(6,$,e.icons.large,e.icons.refresh))}}function q(e,t){if(1&e&&(i.Sb(0,"div",20),i.Sb(1,"div",21),i.nc(2,1),i.Rb(),i.Mc(3,H,12,10,"div",22),i.Mc(4,W,8,7,"div",23),i.Mc(5,V,2,1,"div",24),i.Sb(6,"div",25),i.Sb(7,"div",26),i.Sb(8,"button",27),i.Nb(9,"i",28),i.Rb(),i.Sb(10,"div",29),i.Mc(11,U,2,1,"ng-container",30),i.Rb(),i.Rb(),i.Rb(),i.Mc(12,G,3,9,"div",31),i.Rb()),2&e){const e=i.ic();i.yb(3),i.pc("ngIf",0!==e.columnFilters.length),i.yb(1),i.pc("ngIf",e.searchField),i.yb(1),i.pc("ngIf",e.limit),i.yb(4),i.pc("ngClass",i.vc(6,$,e.icons.large,e.icons.table)),i.yb(2),i.pc("ngForOf",e.columns),i.yb(1),i.pc("ngIf",e.fetchData.observers.length>0)}}function J(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span",56),i.Sb(1,"span",57),i.Oc(2),i.Rb(),i.Sb(3,"a",58),i.gc("click",(function(){i.Dc(e);const t=i.ic().$implicit;return i.ic(2).onChangeFilter(t),!1})),i.Nb(4,"i",59),i.Rb(),i.Rb()}if(2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(2),i.Rc("",e.column.name,": ",e.value.formatted,""),i.yb(2),i.pc("ngClass",i.uc(3,F,t.icons.destroy))}}function Q(e,t){if(1&e&&(i.Sb(0,"span"),i.Mc(1,J,5,5,"span",55),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.pc("ngIf",e.value)}}function K(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",20),i.Sb(1,"div",52),i.Mc(2,Q,2,1,"span",30),i.Sb(3,"a",53),i.gc("click",(function(){return i.Dc(e),i.ic().onClearFilters(),!1})),i.Qb(4),i.Wb(5,54),i.Pb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(2),i.pc("ngForOf",e.columnFilters)}}function Z(e,t){1&e&&i.nc(0,2)}function X(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Qb(2),i.Wb(3,64),i.Pb(),i.Oc(4," / "),i.Rb()),2&e){const e=i.ic().selectedCount;i.yb(1),i.Qc(" ",e," ")}}function ee(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Qb(2),i.Wb(3,65),i.Pb(),i.Oc(4," / "),i.Rb()),2&e){const e=i.ic().rowCount;i.yb(1),i.Qc(" ",e," ")}}function te(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",60),i.Mc(1,X,5,1,"span",61),i.Mc(2,ee,5,1,"span",61),i.Sb(3,"span"),i.Oc(4),i.Qb(5),i.Wb(6,62),i.Pb(),i.Rb(),i.Rb(),i.Sb(7,"datatable-pager",63),i.gc("change",(function(t){return i.Dc(e),i.ic(),i.Ac(5).onFooterPage(t)})),i.Rb()}if(2&e){const e=t.rowCount,n=t.pageSize,r=t.curPage,s=i.ic();i.yb(1),i.pc("ngIf",s.selectionType),i.yb(1),i.pc("ngIf",e!=(null==s.data?null:s.data.length)),i.yb(2),i.Qc(" ",(null==s.data?null:s.data.length)||0," "),i.yb(3),i.pc("pagerLeftArrowIcon",s.paginationClasses.pagerLeftArrow)("pagerRightArrowIcon",s.paginationClasses.pagerRightArrow)("pagerPreviousIcon",s.paginationClasses.pagerPrevious)("pagerNextIcon",s.paginationClasses.pagerNext)("page",r)("size",n)("count",e)("hidden",!(e/n>1))}}function ne(e,t){if(1&e&&(i.Sb(0,"strong"),i.Oc(1),i.Rb()),2&e){const e=t.value;i.yb(1),i.Pc(e)}}function ie(e,t){if(1&e&&i.Nb(0,"cd-sparkline",66),2&e){const e=t.row;i.pc("data",t.value)("isBinary",e.cdIsBinary)}}function re(e,t){if(1&e&&(i.Sb(0,"a",67),i.Oc(1),i.Rb()),2&e){const e=t.row,n=t.value;i.pc("routerLink",i.uc(3,F,e.cdLink))("queryParams",e.cdParams),i.yb(1),i.Pc(n)}}function se(e,t){if(1&e&&(i.Nb(0,"i",68),i.jc(1,"boolean")),2&e){const e=t.value,n=i.ic();i.pc("ngClass",i.uc(4,F,n.icons.check))("hidden",!i.kc(1,2,e))}}function oe(e,t){1&e&&(i.Oc(0),i.jc(1,"dimless")),2&e&&i.Qc(" ",i.kc(1,1,t.value)," /s\n")}function ae(e,t){if(1&e&&i.Nb(0,"i",28),2&e){const e=i.ic(2);i.pc("ngClass",i.vc(1,$,e.icons.spinner,e.icons.spin))}}function ce(e,t){if(1&e&&(i.Sb(0,"span",28),i.Oc(1),i.Rb()),2&e){const e=i.ic(),t=e.column,n=e.row;i.pc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.executingClass?t.customTemplateConfig.executingClass:"text-muted italic"),i.yb(1),i.Qc("(",n.cdExecuting,")")}}function le(e,t){if(1&e&&(i.Mc(0,ae,1,4,"i",37),i.Sb(1,"span",28),i.Oc(2),i.Rb(),i.Mc(3,ce,2,2,"span",37)),2&e){const e=t.column,n=t.row,r=t.value;i.pc("ngIf",n.cdExecuting),i.yb(1),i.pc("ngClass",null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.valueClass),i.yb(1),i.Qc(" ",r," "),i.yb(1),i.pc("ngIf",n.cdExecuting)}}function ue(e,t){if(1&e&&(i.Sb(0,"span"),i.jc(1,"pipeFunction"),i.Oc(2),i.Rb()),2&e){const e=t.value,n=i.ic();i.Ab(i.mc(1,4,e,n.useCustomClass,n)),i.yb(2),i.Pc(e)}}function de(e,t){if(1&e&&(i.Sb(0,"span",70),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic().column;i.pc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.map&&null!=t&&null!=t.customTemplateConfig&&null!=t.customTemplateConfig.map[e]&&t.customTemplateConfig.map[e].class?t.customTemplateConfig.map[e].class:null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.class?t.customTemplateConfig.class:"badge-primary"),i.yb(1),i.Qc(" ",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.map&&null!=t&&null!=t.customTemplateConfig&&null!=t.customTemplateConfig.map[e]&&t.customTemplateConfig.map[e].value?t.customTemplateConfig.map[e].value:null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.prefix?t.customTemplateConfig.prefix+e:e," ")}}function he(e,t){1&e&&(i.Sb(0,"span"),i.Oc(1,"\xa0"),i.Rb())}function fe(e,t){if(1&e&&(i.Sb(0,"span"),i.Mc(1,de,2,2,"span",69),i.Mc(2,he,2,0,"span",61),i.Rb()),2&e){const e=t.$implicit,n=t.last,r=i.ic().column;i.yb(1),i.pc("ngIf",null!=r&&null!=r.customTemplateConfig&&r.customTemplateConfig.map&&null!=r&&null!=r.customTemplateConfig&&null!=r.customTemplateConfig.map[e]&&r.customTemplateConfig.map[e].value?r.customTemplateConfig.map[e].value:null!=r&&null!=r.customTemplateConfig&&r.customTemplateConfig.prefix?r.customTemplateConfig.prefix+e:e),i.yb(1),i.pc("ngIf",!n)}}function pe(e,t){1&e&&(i.Mc(0,fe,3,2,"span",30),i.jc(1,"array")),2&e&&i.pc("ngForOf",i.kc(1,1,t.value))}function me(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.jc(2,"map"),i.Rb()),2&e){const e=t.column,n=t.value;i.yb(1),i.Pc(i.lc(2,1,n,null==e?null:e.customTemplateConfig))}}function be(e,t){if(1&e&&(i.Sb(0,"span",71),i.Oc(1),i.jc(2,"truncate"),i.Rb()),2&e){const e=t.column,n=t.value;i.pc("title",n),i.yb(1),i.Pc(i.mc(2,2,n,null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.length,null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.omission))}}function ge(e,t){if(1&e){const e=i.Tb();i.Sb(0,"a",72),i.Yb(1,73),i.gc("click",(function(n){i.Dc(e);const r=t.row,s=t.expanded;return i.ic().toggleExpandRow(r,s,n)})),i.Rb()}if(2&e){const e=t.expanded;i.Eb("expand-collapse-icon-right",!e)("expand-collapse-icon-down",e)}}const _e=[[["",8,"only-table-actions"]],[["",8,"table-actions"]],[["","cdTableDetail",""]]],ye=[".only-table-actions",".table-actions","[cdTableDetail]"];let ve=(()=>{class e{constructor(e,t){this.ngZone=e,this.cdRef=t,this.columnMode="flex",this.onlyActionHeader=!1,this.toolHeader=!0,this.searchField=!0,this.header=!0,this.footer=!0,this.limit=10,this.hasDetails=!1,this.autoReload=5e3,this.identifier="id",this.forceIdentifier=!1,this.selectionType=void 0,this.updateSelectionOnRefresh="onChange",this.updateExpandedOnRefresh="onChange",this.autoSave=!0,this.searchableObjects=!1,this.extraFilterableColumns=[],this.status=new l.a,this.fetchData=new i.o,this.updateSelection=new i.o,this.setExpandedRow=new i.o,this.columnFiltersChanged=new i.o,this.selection=new f.a,this.expanded=void 0,this.icons=d.a,this.cellTemplates={},this.search="",this.rows=[],this.loadingIndicator=!0,this.paginationClasses={pagerLeftArrow:d.a.leftArrowDouble,pagerRightArrow:d.a.rightArrowDouble,pagerPrevious:d.a.leftArrow,pagerNext:d.a.rightArrow},this.userConfig={},this.localStorage=window.localStorage,this.updating=!1,this.columnFilters=[]}get columnFiltered(){return o.a.some(this.columnFilters,e=>void 0!==e.value)}static prepareSearch(e){return(e=e.toLowerCase().replace(/,/g,"")).match(/['"][^'"]+['"]/)&&(e=e.replace(/['"][^'"]+['"]/g,e=>e.replace(/(['"])([^'"]+)(['"])/g,"$2").replace(/ /g,"+"))),e.split(" ").filter(e=>e)}ngOnInit(){if(this.localColumns=o.a.clone(this.columns),this.table.element.addEventListener("mouseenter",e=>e.stopPropagation()),this._addTemplates(),!this.sorts){const e=-1!==o.a.findIndex(this.localColumns,["prop",this.identifier]);this.sorts=this.createSortingDefinition(e?this.identifier:this.localColumns[0].prop+""),e||this.forceIdentifier||(this.identifier=this.localColumns[0].prop+"")}this.initUserConfig(),this.localColumns.forEach(e=>{e.cellTransformation&&(e.cellTemplate=this.cellTemplates[e.cellTransformation]),e.flexGrow||(e.flexGrow=e.prop+""===this.identifier?1:2),e.resizeable||(e.resizeable=!1)}),this.initExpandCollapseColumn(),this.initCheckboxColumn(),this.filterHiddenColumns(),this.initColumnFilters(),this.updateColumnFilterOptions(),this.updateSelection.emit(new f.a),this.fetchData.observers.length>0&&(this.loadingIndicator=!0),o.a.isInteger(this.autoReload)&&this.autoReload>0?this.ngZone.runOutsideAngular(()=>{this.reloadSubscriber=Object(a.a)(0,this.autoReload).subscribe(()=>{this.ngZone.run(()=>this.reloadData())})}):this.autoReload?this.useData():this.reloadData()}initUserConfig(){this.autoSave&&(this.tableName=this._calculateUniqueTableName(this.localColumns),this._loadUserConfig(),this._initUserConfigAutoSave()),this.userConfig.limit||(this.userConfig.limit=this.limit),this.userConfig.sorts||(this.userConfig.sorts=this.sorts),this.userConfig.columns?this.localColumns.forEach((e,t)=>{e.isHidden=this.userConfig.columns[t].isHidden}):this.updateUserColumns()}_calculateUniqueTableName(e){const t=e=>{if(!o.a.isString(e))return 0;let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)*n;return t};return e.reduce((e,n,i)=>(t(n.prop)+t(n.name))*(i+1)+e,0).toString()}_loadUserConfig(){const e=this.localStorage.getItem(this.tableName);e&&(this.userConfig=JSON.parse(e))}_initUserConfigAutoSave(){const e=new c.a(this._initUserConfigProxy.bind(this));this.saveSubscriber=e.subscribe(this._saveUserConfig.bind(this))}_initUserConfigProxy(e){this.userConfig=new Proxy(this.userConfig,{set:(t,n,i)=>(t[n]=i,e.next(t),!0)})}_saveUserConfig(e){this.localStorage.setItem(this.tableName,JSON.stringify(e))}updateUserColumns(){this.userConfig.columns=this.localColumns.map(e=>({prop:e.prop,name:e.name,isHidden:!!e.isHidden}))}initCheckboxColumn(){"multiClick"===this.selectionType&&this.localColumns.unshift({prop:void 0,resizeable:!1,sortable:!1,draggable:!1,checkboxable:!0,canAutoResize:!1,cellClass:"cd-datatable-checkbox",width:30})}initExpandCollapseColumn(){this.hasDetails&&this.localColumns.unshift({prop:void 0,resizeable:!1,sortable:!1,draggable:!1,isHidden:!1,canAutoResize:!1,cellClass:"cd-datatable-expand-collapse",width:40,cellTemplate:this.rowDetailsTpl})}filterHiddenColumns(){this.tableColumns=this.localColumns.filter(e=>!e.isHidden)}initColumnFilters(){let e=o.a.filter(this.localColumns,{filterable:!0});e=[...e,...this.extraFilterableColumns],this.columnFilters=e.map(e=>({column:e,options:[],value:e.filterInitValue?this.createColumnFilterOption(e.filterInitValue,e.pipe):void 0})),this.selectedFilter=o.a.first(this.columnFilters)}createColumnFilterOption(e,t){return{raw:o.a.toString(e),formatted:t?t.transform(e):o.a.toString(e)}}updateColumnFilterOptions(){this.columnFilters.forEach(e=>{let t=[];if(o.a.isUndefined(e.column.filterOptions)){const n=o.a.filter(o.a.map(this.data,e.column.prop),e=>o.a.isString(e)&&""!==e||o.a.isBoolean(e)||o.a.isFinite(e)||o.a.isDate(e));t=o.a.sortedUniq(n.sort())}else t=e.column.filterOptions;const n=t.map(t=>this.createColumnFilterOption(t,e.column.pipe));e.value&&o.a.isUndefined(o.a.find(n,{raw:e.value.raw}))&&(e.value=void 0),e.options=n})}onSelectFilter(e){this.selectedFilter=e}onChangeFilter(e,t){e.value=o.a.isEqual(e.value,t)?void 0:t,this.updateFilter()}doColumnFiltering(){const e=[];let t=[...this.data],n=[];return this.columnFilters.forEach(i=>{if(void 0===i.value)return;e.push({name:i.column.name,prop:i.column.prop,value:i.value});const s=o.a.partition(t,e=>{const t=Object(r.j)(i.column.prop)(e,i.column.prop);return o.a.isUndefined(i.column.filterPredicate)?""+t===i.value.raw:i.column.filterPredicate(e,i.value.raw)});t=s[0],n=[...n,...s[1]]}),this.columnFiltersChanged.emit({filters:e,data:t,dataOut:n}),o.a.forEach(this.selection.selected,e=>{void 0===o.a.find(t,{[this.identifier]:e[this.identifier]})&&(this.selection=new f.a,this.onSelect(this.selection))}),t}ngOnDestroy(){this.reloadSubscriber&&this.reloadSubscriber.unsubscribe(),this.saveSubscriber&&this.saveSubscriber.unsubscribe()}ngAfterContentChecked(){this.table&&this.table.element.clientWidth!==this.currentWidth&&(this.currentWidth=this.table.element.clientWidth,this.table.recalculate(),o.a.get(this.table,"cd").markForCheck())}_addTemplates(){this.cellTemplates.bold=this.tableCellBoldTpl,this.cellTemplates.checkIcon=this.checkIconTpl,this.cellTemplates.sparkline=this.sparklineTpl,this.cellTemplates.routerLink=this.routerLinkTpl,this.cellTemplates.perSecond=this.perSecondTpl,this.cellTemplates.executing=this.executingTpl,this.cellTemplates.classAdding=this.classAddingTpl,this.cellTemplates.badge=this.badgeTpl,this.cellTemplates.map=this.mapTpl,this.cellTemplates.truncate=this.truncateTpl}useCustomClass(e){if(!this.customCss)throw new Error("Custom classes are not set!");const t=Object.keys(this.customCss),n=Object.values(this.customCss).map((n,i)=>(o.a.isFunction(n)&&n(e)||n===e)&&t[i]).filter(e=>e).join(" ");return o.a.isEmpty(n)?void 0:n}ngOnChanges(e){e.data&&e.data.currentValue&&this.useData()}setLimit(e){const t=parseInt(e.target.value,10);t>0&&(this.userConfig.limit=t)}reloadData(){if(!this.updating){this.status=new l.a;const e=new h(()=>{e.errorConfig.displayError&&(this.status=new l.a("danger","Failed to load data.")),e.errorConfig.resetData&&(this.data=[]),this.useData()});this.fetchData.emit(e),this.updating=!0}}refreshBtn(){this.loadingIndicator=!0,this.reloadData()}rowIdentity(){return e=>{const t=e[this.identifier];if(o.a.isUndefined(t))throw new Error(`Wrong identifier "${this.identifier}" -> "${t}"`);return t}}useData(){this.data&&(this.updateColumnFilterOptions(),this.updateFilter(),this.reset(),this.updateSelected(),this.updateExpanded())}reset(){this.loadingIndicator=!1,this.updating=!1}updateSelected(){if("never"===this.updateSelectionOnRefresh)return;const e=[];this.selection.selected.forEach(t=>{for(const n of this.data)t[this.identifier]===n[this.identifier]&&e.push(n)}),"onChange"===this.updateSelectionOnRefresh&&o.a.isEqual(this.selection.selected,e)||(this.selection.selected=e,this.onSelect(this.selection))}updateExpanded(){if(o.a.isUndefined(this.expanded)||"never"===this.updateExpandedOnRefresh)return;const e=this.expanded[this.identifier],t=o.a.find(this.data,t=>e===t[this.identifier]);"onChange"===this.updateExpandedOnRefresh&&o.a.isEqual(this.expanded,t)||(this.expanded=t,this.setExpandedRow.emit(t))}onSelect(e){o.a.has(e,"selected")&&(this.selection.selected=e.selected),this.updateSelection.emit(o.a.clone(this.selection))}toggleColumn(e){const t=e.prop,n=!e.isHidden;n&&1===this.tableColumns.length?e.isHidden=!0:(o.a.find(this.localColumns,e=>e.prop===t).isHidden=n,this.updateColumns())}updateColumns(){this.updateUserColumns(),this.filterHiddenColumns();const e=this.userConfig.sorts[0].prop;o.a.find(this.tableColumns,t=>t.prop===e)||(this.userConfig.sorts=this.createSortingDefinition(this.tableColumns[0].prop)),this.table.recalculate(),this.cdRef.detectChanges()}createSortingDefinition(e){return[{prop:e,dir:r.i.asc}]}changeSorting({sorts:e}){this.userConfig.sorts=e}onClearSearch(){this.search="",this.updateFilter()}onClearFilters(){this.columnFilters.forEach(e=>{e.value=void 0}),this.selectedFilter=o.a.first(this.columnFilters),this.updateFilter()}updateFilter(){let t=0!==this.columnFilters.length?this.doColumnFiltering():this.data;if(this.search.length>0&&t){const n=this.localColumns.filter(e=>e.cellTransformation!==u.a.sparkline);t=this.subSearch(t,e.prepareSearch(this.search),n),this.table.offset=0}this.rows=t}subSearch(e,t,n){if(0===t.length||0===e.length)return e;const i=t.pop().replace(/\+/g," ").split(":"),r=[...n];return 2===i.length&&(n=r.filter(e=>-1!==e.name.toLowerCase().indexOf(i[0]))),e=this.basicDataSearch(o.a.last(i),e,n),this.subSearch(e,t,r)}basicDataSearch(e,t,n){return 0===e.length?t:t.filter(t=>n.filter(n=>{let i=o.a.get(t,n.prop);if(o.a.isUndefined(n.pipe)||(i=n.pipe.transform(i)),o.a.isUndefined(i)||o.a.isNull(i))return!1;if(o.a.isArray(i)?i=i.join(" "):(o.a.isNumber(i)||o.a.isBoolean(i))&&(i=i.toString()),o.a.isObjectLike(i)){if(!this.searchableObjects)return!1;i=JSON.stringify(i)}return-1!==i.toLowerCase().indexOf(e)}).length>0)}getRowClass(){return()=>({clickable:!o.a.isUndefined(this.selectionType)})}toggleExpandRow(e,t,n){n.stopPropagation(),t?(this.expanded=void 0,this.setExpandedRow.emit(void 0)):(this.expanded=e,this.table.rowDetail.collapseAllRows(),this.setExpandedRow.emit(e)),this.table.rowDetail.toggleExpandRow(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.A),i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-table"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(r.d,!0),i.Jc(k,!0),i.Jc(D,!0),i.Jc(T,!0),i.Jc(C,!0),i.Jc(O,!0),i.Jc(R,!0),i.Jc(L,!0),i.Jc(E,!0),i.Jc(A,!0),i.Jc(I,!0),i.Jc(P,!0)),2&e&&(i.zc(n=i.hc())&&(t.table=n.first),i.zc(n=i.hc())&&(t.tableCellBoldTpl=n.first),i.zc(n=i.hc())&&(t.sparklineTpl=n.first),i.zc(n=i.hc())&&(t.routerLinkTpl=n.first),i.zc(n=i.hc())&&(t.checkIconTpl=n.first),i.zc(n=i.hc())&&(t.perSecondTpl=n.first),i.zc(n=i.hc())&&(t.executingTpl=n.first),i.zc(n=i.hc())&&(t.classAddingTpl=n.first),i.zc(n=i.hc())&&(t.badgeTpl=n.first),i.zc(n=i.hc())&&(t.mapTpl=n.first),i.zc(n=i.hc())&&(t.truncateTpl=n.first),i.zc(n=i.hc())&&(t.rowDetailsTpl=n.first))},inputs:{data:"data",columns:"columns",sorts:"sorts",columnMode:"columnMode",onlyActionHeader:"onlyActionHeader",toolHeader:"toolHeader",searchField:"searchField",header:"header",footer:"footer",limit:"limit",hasDetails:"hasDetails",autoReload:"autoReload",identifier:"identifier",forceIdentifier:"forceIdentifier",selectionType:"selectionType",updateSelectionOnRefresh:"updateSelectionOnRefresh",updateExpandedOnRefresh:"updateExpandedOnRefresh",autoSave:"autoSave",searchableObjects:"searchableObjects",customCss:"customCss",extraFilterableColumns:"extraFilterableColumns",status:"status"},outputs:{fetchData:"fetchData",updateSelection:"updateSelection",setExpandedRow:"setExpandedRow",columnFiltersChanged:"columnFiltersChanged"},features:[i.wb],ngContentSelectors:ye,decls:33,vars:17,consts:function(){return[[1,"dataTables_wrapper"],["class","dataTables_header clearfix",4,"ngIf"],[1,"bootstrap","cd-datatable",3,"cssClasses","selectionType","selected","sorts","columns","columnMode","rows","rowClass","headerHeight","footerHeight","limit","loadingIndicator","rowIdentity","rowHeight","select","sort"],["table",""],["rowHeight","auto"],["detailRow",""],["ngx-datatable-row-detail-template",""],["ngx-datatable-footer-template",""],["tableCellBoldTpl",""],["sparklineTpl",""],["routerLinkTpl",""],["checkIconTpl",""],["perSecondTpl",""],["executingTpl",""],["classAddingTpl",""],["badgeTpl",""],["mapTpl",""],["truncateTpl",""],["ngx-datatable-cell-template",""],["rowDetailsTpl",""],[1,"dataTables_header","clearfix"],[1,"cd-datatable-actions"],["class","btn-group widget-toolbar",4,"ngIf"],["class","input-group search",4,"ngIf"],["class","input-group dataTables_paginate",4,"ngIf"],[1,"widget-toolbar"],["ngbDropdown","","autoClose","outside",1,"tc_menuitem"],["ngbDropdownToggle","",1,"btn","btn-light","tc_columnBtn"],[3,"ngClass"],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["class","widget-toolbar tc_refreshBtn",4,"ngIf"],[1,"btn-group","widget-toolbar"],["ngbDropdown","","placement","bottom-right",1,"tc_filter_name"],["ngbDropdownToggle","",1,"btn","btn-light"],["ngbDropdown","","placement","bottom-right",1,"tc_filter_option"],["ngbDropdownItem","",3,"click"],[3,"ngClass",4,"ngIf"],[1,"input-group","search"],[1,"input-group-prepend"],[1,"input-group-text"],["type","text",1,"form-control",3,"ngModel","ngModelChange","keyup"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"click"],[1,"input-group","dataTables_paginate"],["type","number","min","1","max","9999",1,"form-control",3,"value","click","keyup","blur"],["ngbDropdownItem","",3,"click",4,"ngIf"],[1,"custom-control","custom-checkbox","py-0"],["type","checkbox",1,"custom-control-input",3,"name","id","checked"],[1,"custom-control-label",3,"for"],[1,"widget-toolbar","tc_refreshBtn"],["type","button",3,"ngbTooltip","click"],[1,"filter-chips"],["href","",1,"tc_clearSelections",3,"click"],"Clear filters",["class","badge badge-info mr-2",4,"ngIf"],[1,"badge","badge-info","mr-2"],[1,"mr-2"],[1,"badge-remove",3,"click"],["aria-hidden","true",3,"ngClass"],[1,"page-count"],[4,"ngIf"],"total",[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change"],"selected","found",[3,"data","isBinary"],[3,"routerLink","queryParams"],[3,"ngClass","hidden"],["class","badge",3,"ngClass",4,"ngIf"],[1,"badge",3,"ngClass"],["data-toggle","tooltip",3,"title"],["href","javascript:void(0)",1,"expand-collapse-icon","tc_expand-collapse",3,"click",6,"title"],["title","Expand/Collapse Row"]]},template:function(e,t){1&e&&(i.oc(_e),i.Sb(0,"div",0),i.Mc(1,j,3,0,"div",1),i.Mc(2,q,13,9,"div",1),i.Mc(3,K,6,1,"div",1),i.Sb(4,"ngx-datatable",2,3),i.gc("select",(function(e){return t.onSelect(e)}))("sort",(function(e){return t.changeSorting(e)})),i.Sb(6,"ngx-datatable-row-detail",4,5),i.Mc(8,Z,1,0,"ng-template",6),i.Rb(),i.Sb(9,"ngx-datatable-footer"),i.Mc(10,te,8,11,"ng-template",7),i.Rb(),i.Rb(),i.Rb(),i.Mc(11,ne,2,1,"ng-template",null,8,i.Nc),i.Mc(13,ie,1,2,"ng-template",null,9,i.Nc),i.Mc(15,re,2,5,"ng-template",null,10,i.Nc),i.Mc(17,se,2,6,"ng-template",null,11,i.Nc),i.Mc(19,oe,2,3,"ng-template",null,12,i.Nc),i.Mc(21,le,4,4,"ng-template",null,13,i.Nc),i.Mc(23,ue,3,8,"ng-template",null,14,i.Nc),i.Mc(25,pe,2,3,"ng-template",null,15,i.Nc),i.Mc(27,me,3,4,"ng-template",null,16,i.Nc),i.Mc(29,be,3,6,"ng-template",null,17,i.Nc),i.Mc(31,ge,2,4,"ng-template",18,19,i.Nc)),2&e&&(i.yb(1),i.pc("ngIf",t.onlyActionHeader),i.yb(1),i.pc("ngIf",t.toolHeader),i.yb(1),i.pc("ngIf",t.toolHeader&&t.columnFiltered),i.yb(1),i.pc("cssClasses",t.paginationClasses)("selectionType",t.selectionType)("selected",t.selection.selected)("sorts",t.userConfig.sorts)("columns",t.tableColumns)("columnMode",t.columnMode)("rows",t.rows)("rowClass",t.getRowClass())("headerHeight",t.header?"auto":0)("footerHeight",t.footer?"auto":0)("limit",t.userConfig.limit>0?t.userConfig.limit:void 0)("loadingIndicator",t.loadingIndicator)("rowIdentity",t.rowIdentity())("rowHeight","auto"))},directives:[p.r,r.d,r.f,r.g,r.e,r.b,r.a,m.i,m.m,p.p,m.k,p.q,m.j,b.d,b.q,b.t,m.D,r.c,g.a,_.h],pipes:[y.a,v.a,w.b,S.a,M.a,x.a],styles:['@charset "UTF-8";.dataTables_wrapper[_ngcontent-%COMP%]{margin-bottom:25px}.dataTables_wrapper[_ngcontent-%COMP%]   .separator[_ngcontent-%COMP%]{border-left:1px solid rgba(0,0,0,.09);display:inline-block;height:30px;margin-left:5px;padding-left:5px;vertical-align:middle}.dataTables_wrapper[_ngcontent-%COMP%]   .widget-toolbar[_ngcontent-%COMP%]{border-left:1px solid rgba(0,0,0,.09);float:right;padding:0 8px}.dataTables_wrapper[_ngcontent-%COMP%]   .widget-toolbar[_ngcontent-%COMP%]   .form-check[_ngcontent-%COMP%]{padding-left:0}.dataTables_wrapper[_ngcontent-%COMP%]   .dataTables_length[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{line-height:25px;text-align:right}.dataTables_header[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ced4da;border-bottom:0;padding:5px;position:relative}.dataTables_header[_ngcontent-%COMP%]   .cd-datatable-actions[_ngcontent-%COMP%]{float:left}.dataTables_header[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]{padding-left:8px}.dataTables_header[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]{border-left:1px solid rgba(0,0,0,.09);float:right;max-width:250px;padding-left:8px;padding-right:8px;width:40%}.dataTables_header[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]   .form-control[_ngcontent-%COMP%]{height:30px}.dataTables_header[_ngcontent-%COMP%]   .input-group.dataTables_paginate[_ngcontent-%COMP%]{min-width:85px;padding-right:8px;width:8%}.dataTables_header[_ngcontent-%COMP%]   .filter-chips[_ngcontent-%COMP%]{float:right;padding:0 8px}.dataTables_header[_ngcontent-%COMP%]   .filter-chips[_ngcontent-%COMP%]   .badge-remove[_ngcontent-%COMP%]{color:#fff}  cd-table .cd-datatable{border:1px solid #ced4da;margin-bottom:0;max-width:none!important}  cd-table .cd-datatable .progress-linear{display:block;height:5px;margin:0;padding:0;position:relative;width:100%}  cd-table .cd-datatable .progress-linear .container{background-color:#2b99a8}  cd-table .cd-datatable .progress-linear .container .bar{background-color:#2b99a8;height:100%;left:0;overflow:hidden;position:absolute;width:100%}  cd-table .cd-datatable .progress-linear .container .bar:before{animation:progress-loading 3s linear infinite;background-color:#2b99a8;content:"";display:block;height:100%;left:-200px;position:absolute;width:200px}  cd-table .cd-datatable .datatable-header{background-clip:padding-box;background-color:#f8f9fa;background-image:linear-gradient(180deg,#f8f9fa 0,#e9ecef);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fffafafa",endColorstr="#ffededed",GradientType=0)}  cd-table .cd-datatable .datatable-header .sort-asc,   cd-table .cd-datatable .datatable-header .sort-desc{color:#2b99a8}  cd-table .cd-datatable .datatable-header .datatable-header-cell{border:0;border-bottom:1px solid #ced4da;border-left:1px solid #ced4da;padding:5px;font-weight:700;text-align:left}  cd-table .cd-datatable .datatable-header .datatable-header-cell .datatable-header-cell-label:after{font-family:ForkAwesome;font-weight:400;height:9px;left:10px;line-height:12px;position:relative;vertical-align:initial;width:12px}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable .datatable-header-cell-label:after{content:" \uf0dc"}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable.sort-active.sort-asc .datatable-header-cell-label:after{content:" \uf160"}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable.sort-active.sort-desc .datatable-header-cell-label:after{content:" \uf161"}  cd-table .cd-datatable .datatable-header .datatable-header-cell:first-child{border-left:0}  cd-table .cd-datatable .datatable-body{margin-bottom:-6px}  cd-table .cd-datatable .datatable-body .empty-row{background-color:#c8ecf1;font-style:italic;font-weight:700;padding-bottom:5px;padding-top:5px;text-align:center}  cd-table .cd-datatable .datatable-body .datatable-body-row.clickable:hover .datatable-row-group{background-color:#c8ecf1;transition-duration:.3s;transition-property:background;transition-timing-function:linear}  cd-table .cd-datatable .datatable-body .datatable-body-row.datatable-row-even{background-color:#fff}  cd-table .cd-datatable .datatable-body .datatable-body-row.datatable-row-odd{background-color:#f8f9fa}  cd-table .cd-datatable .datatable-body .datatable-body-row.active,   cd-table .cd-datatable .datatable-body .datatable-body-row.active:hover{background-color:#9fdee6}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell{border:0;border-bottom:1px solid #ced4da;border-left:1px solid #ced4da;padding:5px}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell:first-child{border-left:0}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{display:block;height:100%}  cd-table .cd-datatable .datatable-body .datatable-row-detail{border-bottom:2px solid #ced4da;overflow-y:visible!important;padding:20px}  cd-table .cd-datatable .datatable-body .expand-collapse-icon{display:block;height:100%;text-align:center}  cd-table .cd-datatable .datatable-body .expand-collapse-icon:hover{text-decoration:none}  cd-table .cd-datatable .datatable-body .expand-collapse-icon-right:before{color:#212529;font-family:ForkAwesome,sans-serif;font-size:1rem;line-height:1;content:"\uf105"}  cd-table .cd-datatable .datatable-body .expand-collapse-icon-down:before{color:#212529;font-family:ForkAwesome,sans-serif;font-size:1rem;line-height:1;content:"\uf107"}  cd-table .cd-datatable .datatable-footer .page-count,   cd-table .cd-datatable .datatable-footer .selected-count{font-style:italic;min-height:2rem;padding-left:.3rem;padding-top:.3rem}  cd-table .cd-datatable .cd-datatable-checkbox{text-align:center}@keyframes progress-loading{0%{left:-200px;width:15%}50%{width:30%}70%{width:70%}80%{left:50%}95%{left:120%}to{left:100%}}'],changeDetection:0}),e})()},uXwI:function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekund\u0113m_sekunde_sekundes".split("_"),m:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),mm:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),h:"stundas_stund\u0101m_stunda_stundas".split("_"),hh:"stundas_stund\u0101m_stunda_stundas".split("_"),d:"dienas_dien\u0101m_diena_dienas".split("_"),dd:"dienas_dien\u0101m_diena_dienas".split("_"),M:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),MM:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function i(e,i,r){return e+" "+n(t[r],e,i)}function r(e,i,r){return n(t[r],e,i)}e.defineLocale("lv",{months:"janv\u0101ris_febru\u0101ris_marts_apr\u012blis_maijs_j\u016bnijs_j\u016blijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_j\u016bn_j\u016bl_aug_sep_okt_nov_dec".split("_"),weekdays:"sv\u0113tdiena_pirmdiena_otrdiena_tre\u0161diena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[\u0160odien pulksten] LT",nextDay:"[R\u012bt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pag\u0101ju\u0161\u0101] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"p\u0113c %s",past:"pirms %s",s:function(e,t){return t?"da\u017eas sekundes":"da\u017e\u0101m sekund\u0113m"},ss:i,m:r,mm:i,h:r,hh:i,d:r,dd:i,M:r,MM:i,y:r,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uYzU:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e){switch(e){case"user:rbd":return"user:rbd (tcmu-runner)";default:return e}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"iscsiBackstore",type:e,pure:!0}),e})()},ufoC:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=function(e){return e.auth="Login",e.cephfs="CephFS",e.rbd="RBD",e.pool="Pool",e.osd="OSD",e.role="Role",e.user="User",e}({}),r=n("jVDg"),s=n("8Y7J");class o{constructor(e,t,n){this.running=e,this.failure=t,this.success=n}}class a{constructor(e,t,n){this.operation=e,this.involves=t,this.errors=n||(()=>({}))}failure(e){return "Failed to " + this.operation.failure + " " + this.involves(e) + ""}running(e){return`${this.operation.running} ${this.involves(e)}`}success(e){return`${this.operation.success} ${this.involves(e)}`}}let c=(()=>{class e{constructor(){this.defaultMessage=this.newTaskMessage(new o("Executing","execute","Executed"),e=>e&&(i[e.component]||e.component)||"unknown task",()=>({})),this.commonOperations={create:new o("Creating","create","Created"),update:new o("Updating","update","Updated"),delete:new o("Deleting","delete","Deleted"),add:new o("Adding","add","Added"),remove:new o("Removing","remove","Removed"),import:new o("Importing","import","Imported")},this.rbd={default:e=>"RBD '" + e.image_spec + "'",create:e=>{const t=new r.a(e.pool_name,e.namespace,e.image_name).toString();return "RBD '" + t + "'"},child:e=>{const t=new r.a(e.child_pool_name,e.child_namespace,e.child_image_name).toString();return "RBD '" + t + "'"},destination:e=>{const t=new r.a(e.dest_pool_name,e.dest_namespace,e.dest_image_name).toString();return "RBD '" + t + "'"},snapshot:e=>"RBD snapshot '" + e.image_spec + "@" + e.snapshot_name + "'"},this.rbd_mirroring={site_name:()=>"mirroring site name",bootstrap:()=>"bootstrap token",pool:e=>"mirror mode for pool '" + e.pool_name + "'",pool_peer:e=>"mirror peer for pool '" + e.pool_name + "'"},this.grafana={update_dashboards:()=>"all dashboards"},this.messages={"host/create":this.newTaskMessage(this.commonOperations.create,e=>this.host(e)),"host/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.host(e)),"host/identify_device":this.newTaskMessage(new o("Identifying","identify","Identified"),e=>"device '" + e.device + "' on host '" + e.hostname + "'"),"osd/create":this.newTaskMessage(this.commonOperations.create,e=>"OSDs (DriveGroups: " + e.tracking_id + ")"),"osd/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.osd(e)),"pool/create":this.newTaskMessage(this.commonOperations.create,e=>this.pool(e),e=>({17:"Name is already used by " + this.pool(e) + "."})),"pool/edit":this.newTaskMessage(this.commonOperations.update,e=>this.pool(e),e=>({17:"Name is already used by " + this.pool(e) + "."})),"pool/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.pool(e)),"ecp/create":this.newTaskMessage(this.commonOperations.create,e=>this.ecp(e),e=>({17:"Name is already used by " + this.ecp(e) + "."})),"ecp/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.ecp(e)),"crushRule/create":this.newTaskMessage(this.commonOperations.create,e=>this.crushRule(e),e=>({17:"Name is already used by " + this.crushRule(e) + "."})),"crushRule/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.crushRule(e)),"rbd/create":this.newTaskMessage(this.commonOperations.create,this.rbd.create,e=>({17:"Name is already used by " + this.rbd.create(e) + "."})),"rbd/edit":this.newTaskMessage(this.commonOperations.update,this.rbd.default,e=>({17:"Name is already used by " + this.rbd.default(e) + "."})),"rbd/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd.default,e=>({16:"" + this.rbd.default(e) + " is busy.",39:"" + this.rbd.default(e) + " contains snapshots."})),"rbd/clone":this.newTaskMessage(new o("Cloning","clone","Cloned"),this.rbd.child,e=>({17:"Name is already used by " + this.rbd.child(e) + ".",22:"Snapshot of " + this.rbd.child(e) + " must be protected."})),"rbd/copy":this.newTaskMessage(new o("Copying","copy","Copied"),this.rbd.destination,e=>({17:"Name is already used by " + this.rbd.destination(e) + "."})),"rbd/flatten":this.newTaskMessage(new o("Flattening","flatten","Flattened"),this.rbd.default),"rbd/snap/create":this.newTaskMessage(this.commonOperations.create,this.rbd.snapshot,e=>({17:"Name is already used by " + this.rbd.snapshot(e) + "."})),"rbd/snap/edit":this.newTaskMessage(this.commonOperations.update,this.rbd.snapshot,e=>({16:"Cannot unprotect " + this.rbd.snapshot(e) + " because it contains child images."})),"rbd/snap/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd.snapshot,e=>({16:"Cannot delete " + this.rbd.snapshot(e) + " because it's protected."})),"rbd/snap/rollback":this.newTaskMessage(new o("Rolling back","rollback","Rolled back"),this.rbd.snapshot),"rbd/trash/move":this.newTaskMessage(new o("Moving","move","Moved"),e=>"image '" + e.image_spec + "' to trash",()=>({2:"Could not find image."})),"rbd/trash/restore":this.newTaskMessage(new o("Restoring","restore","Restored"),e=>"image '" + e.image_id_spec + "' into '" + e.new_image_name + "'",e=>({17:"Image name '" + e.new_image_name + "' is already in use."})),"rbd/trash/remove":this.newTaskMessage(new o("Deleting","delete","Deleted"),e=>"image '" + e.image_id_spec + "'"),"rbd/trash/purge":this.newTaskMessage(new o("Purging","purge","Purged"),e=>{let t="all pools";return e.pool_name&&(t=`'${e.pool_name}'`),"images from " + t + ""}),"rbd/mirroring/site_name/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.site_name,()=>({})),"rbd/mirroring/bootstrap/create":this.newTaskMessage(this.commonOperations.create,this.rbd_mirroring.bootstrap,()=>({})),"rbd/mirroring/bootstrap/import":this.newTaskMessage(this.commonOperations.import,this.rbd_mirroring.bootstrap,()=>({})),"rbd/mirroring/pool/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.pool,()=>({16:"Cannot disable mirroring because it contains a peer."})),"rbd/mirroring/peer/add":this.newTaskMessage(this.commonOperations.create,this.rbd_mirroring.pool_peer,()=>({})),"rbd/mirroring/peer/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.pool_peer,()=>({})),"rbd/mirroring/peer/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd_mirroring.pool_peer,()=>({})),"iscsi/target/create":this.newTaskMessage(this.commonOperations.create,e=>this.iscsiTarget(e)),"iscsi/target/edit":this.newTaskMessage(this.commonOperations.update,e=>this.iscsiTarget(e)),"iscsi/target/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.iscsiTarget(e)),"nfs/create":this.newTaskMessage(this.commonOperations.create,e=>this.nfs(e)),"nfs/edit":this.newTaskMessage(this.commonOperations.update,e=>this.nfs(e)),"nfs/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.nfs(e)),"grafana/dashboards/update":this.newTaskMessage(this.commonOperations.update,this.grafana.update_dashboards,()=>({})),"service/create":this.newTaskMessage(this.commonOperations.create,e=>this.service(e)),"service/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.service(e))}}newTaskMessage(e,t,n){return new a(e,t,n)}host(e){return "host '" + e.hostname + "'"}osd(e){return "OSD '" + e.svc_id + "'"}pool(e){return "pool '" + e.pool_name + "'"}ecp(e){return "erasure code profile '" + e.name + "'"}crushRule(e){return "crush rule '" + e.name + "'"}iscsiTarget(e){return "target '" + e.target_iqn + "'"}nfs(e){return "NFS '" + e.cluster_id + ":" + (e.export_id ? e.export_id : e.path) + "'"}service(e){return "Service '" + e.service_name + "'"}_getTaskTitle(e){return e.name&&e.name.startsWith("progress/")?this.newTaskMessage(new o(e.name.replace("progress/",""),"",e.name.replace("progress/","")),e=>""):this.messages[e.name]||this.defaultMessage}getSuccessTitle(e){return this._getTaskTitle(e).success(e.metadata)}getErrorMessage(e){return this._getTaskTitle(e).errors(e.metadata)[e.exception.code]||e.exception.detail}getErrorTitle(e){return this._getTaskTitle(e).failure(e.metadata)}getRunningTitle(e){return this._getTaskTitle(e).running(e.metadata)}getRunningText(e){return this._getTaskTitle(e).operation.running}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},uy83:function(e,t,n){var i=n("0Dky");e.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},uyHG:function(e,t){var n,i="__lodash_hash_undefined__",r=/^\[object .+?Constructor\]$/,s="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,a=s||o||Function("return this")(),c=Array.prototype,l=Function.prototype,u=Object.prototype,d=a["__core-js_shared__"],h=(n=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",f=l.toString,p=u.hasOwnProperty,m=u.toString,b=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=c.splice,_=k(a,"Map"),y=k(Object,"create");function v(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function S(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function M(e,t){for(var n,i,r=e.length;r--;)if((n=e[r][0])===(i=t)||n!=n&&i!=i)return r;return-1}function x(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!T(e)||(t=e,h&&h in t))&&(function(e){var t=T(e)?m.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?b:r).test(function(e){if(null!=e){try{return f.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e));var t}(n)?n:void 0}function D(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o),o};return n.cache=new(D.Cache||S),n}function T(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}v.prototype.clear=function(){this.__data__=y?y(null):{}},v.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},v.prototype.get=function(e){var t=this.__data__;if(y){var n=t[e];return n===i?void 0:n}return p.call(t,e)?t[e]:void 0},v.prototype.has=function(e){var t=this.__data__;return y?void 0!==t[e]:p.call(t,e)},v.prototype.set=function(e,t){return this.__data__[e]=y&&void 0===t?i:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0||(n==t.length-1?t.pop():g.call(t,n,1),0))},w.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return M(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,i=M(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},S.prototype.clear=function(){this.__data__={hash:new v,map:new(_||w),string:new v}},S.prototype.delete=function(e){return x(this,e).delete(e)},S.prototype.get=function(e){return x(this,e).get(e)},S.prototype.has=function(e){return x(this,e).has(e)},S.prototype.set=function(e,t){return x(this,e).set(e,t),this},D.Cache=S,e.exports=D},vCyI:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(e){this._selected=[],e&&(this._selected=e),this.update()}update(){this.hasSelection=this._selected.length>0,this.hasSingleSelection=1===this._selected.length,this.hasMultiSelection=this._selected.length>1}set selected(e){this._selected=e,this.update()}get selected(){return this._selected}add(e){this._selected.push(e),this.update()}first(){return this.hasSelection?this._selected[0]:null}}},vJtL:function(e,t,n){"use strict";var i=n("8M4i"),r=n("IzLi");t.a=function(e){if(!Object(r.a)(e))return!1;var t=Object(i.a)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},vkgz:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("7o/Q"),r=n("KqfI"),s=n("n6bG");function o(e,t,n){return function(i){return i.lift(new a(e,t,n))}}class a{constructor(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}call(e,t){return t.subscribe(new c(e,this.nextOrObserver,this.error,this.complete))}}class c extends i.a{constructor(e,t,n,i){super(e),this._tapNext=r.a,this._tapError=r.a,this._tapComplete=r.a,this._tapError=n||r.a,this._tapComplete=i||r.a,Object(s.a)(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||r.a,this._tapError=t.error||r.a,this._tapComplete=t.complete||r.a)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}},w1tV:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n("XNiG"),r=n("HDdC"),s=n("7o/Q"),o=n("quSY");function a(){return function(e){return e.lift(new c(e))}}class c{constructor(e){this.connectable=e}call(e,t){const{connectable:n}=this;n._refCount++;const i=new l(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class l extends s.a{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:n}=this,i=e._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}class u extends r.a{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new o.a,e.add(this.source.subscribe(new h(this.getSubject(),this))),e.closed&&(this._connection=null,e=o.a.EMPTY)),e}refCount(){return a()(this)}}const d=(()=>{const e=u.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}})();class h extends i.b{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function f(){return new i.a}function p(){return e=>{return a()((t=f,function(e){let n;n="function"==typeof t?t:function(){return t};const i=Object.create(e,d);return i.source=e,i.subjectFactory=n,i})(e));var t}}},w9WL:function(e,t,n){"use strict";n.d(t,"a",(function(){return Pe})),n.d(t,"b",(function(){return ue})),n.d(t,"c",(function(){return ft})),n.d(t,"d",(function(){return ut})),n.d(t,"e",(function(){return ze})),n.d(t,"f",(function(){return Ye})),n.d(t,"g",(function(){return Fe})),n.d(t,"h",(function(){return xt})),n.d(t,"i",(function(){return ct})),n.d(t,"j",(function(){return ve}));var i=n("8Y7J"),r=n("SVse"),s=n("XNiG"),o=n("xgIS"),a=n("2Vo4"),c=n("1G5W"),l=n("mrSG");const u=["*"];function d(e,t){1&e&&i.Nb(0,"datatable-progress")}function h(e,t){if(1&e&&i.Nb(0,"datatable-summary-row",9),2&e){const e=i.ic(2);i.pc("rowHeight",e.summaryHeight)("offsetX",e.offsetX)("innerWidth",e.innerWidth)("rows",e.rows)("columns",e.columns)}}function f(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-body-row",13),i.gc("treeAction",(function(){i.Dc(e);const t=i.ic().$implicit;return i.ic(2).onTreeAction(t)}))("activate",(function(t){i.Dc(e);const n=i.ic().index,r=i.ic(2);return i.Ac(2).onActivate(t,r.indexes.first+n)})),i.Rb()}if(2&e){const e=i.ic().$implicit,t=i.ic(2),n=i.Ac(2);i.pc("isSelected",n.getRowSelected(e))("innerWidth",t.innerWidth)("offsetX",t.offsetX)("columns",t.columns)("rowHeight",t.getRowHeight(e))("row",e)("rowIndex",t.getRowIndex(e))("expanded",t.getRowExpanded(e))("rowClass",t.rowClass)("displayCheck",t.displayCheck)("treeStatus",e&&e.treeStatus)}}function p(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-body-row",15),i.gc("activate",(function(n){i.Dc(e);const r=t.index;return i.ic(4),i.Ac(2).onActivate(n,r)})),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic(2).$implicit,r=i.ic(2),s=i.Ac(2);i.pc("isSelected",s.getRowSelected(e))("innerWidth",r.innerWidth)("offsetX",r.offsetX)("columns",r.columns)("rowHeight",r.getRowHeight(e))("row",e)("group",n.value)("rowIndex",r.getRowIndex(e))("expanded",r.getRowExpanded(e))("rowClass",r.rowClass)}}function m(e,t){if(1&e&&i.Mc(0,p,1,10,"datatable-body-row",14),2&e){const e=i.ic().$implicit,t=i.ic(2);i.pc("ngForOf",e.value)("ngForTrackBy",t.rowTrackingFn)}}function b(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-row-wrapper",10),i.gc("rowContextmenu",(function(t){return i.Dc(e),i.ic(2).rowContextmenu.emit(t)})),i.Mc(1,f,1,11,"datatable-body-row",11),i.Mc(2,m,1,2,"ng-template",null,12,i.Nc),i.Rb()}if(2&e){const e=t.$implicit,n=t.index,r=i.Ac(3),s=i.ic(2);i.pc("groupedRows",s.groupedRows)("innerWidth",s.innerWidth)("ngStyle",s.getRowsStyles(e))("rowDetail",s.rowDetail)("groupHeader",s.groupHeader)("offsetX",s.offsetX)("detailRowHeight",s.getDetailRowHeight(e&&e[n],n))("row",e)("expanded",s.getRowExpanded(e))("rowIndex",s.getRowIndex(e&&e[n])),i.yb(1),i.pc("ngIf",!s.groupedRows)("ngIfElse",r)}}function g(e,t){if(1&e&&i.Nb(0,"datatable-summary-row",16),2&e){const e=i.ic(2);i.pc("ngStyle",e.getBottomSummaryRowStyles())("rowHeight",e.summaryHeight)("offsetX",e.offsetX)("innerWidth",e.innerWidth)("rows",e.rows)("columns",e.columns)}}function _(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-scroller",5),i.gc("scroll",(function(t){return i.Dc(e),i.ic().onBodyScroll(t)})),i.Mc(1,h,1,5,"datatable-summary-row",6),i.Mc(2,b,4,12,"datatable-row-wrapper",7),i.Mc(3,g,1,6,"datatable-summary-row",8),i.Rb()}if(2&e){const e=i.ic();i.pc("scrollbarV",e.scrollbarV)("scrollbarH",e.scrollbarH)("scrollHeight",e.scrollHeight)("scrollWidth",null==e.columnGroupWidths?null:e.columnGroupWidths.total),i.yb(1),i.pc("ngIf",e.summaryRow&&"top"===e.summaryPosition),i.yb(1),i.pc("ngForOf",e.temp)("ngForTrackBy",e.rowTrackingFn),i.yb(1),i.pc("ngIf",e.summaryRow&&"bottom"===e.summaryPosition)}}function y(e,t){if(1&e&&i.Nb(0,"div",17),2&e){const e=i.ic();i.pc("innerHTML",e.emptyMessage,i.Ec)}}function v(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-header-cell",4),i.gc("resize",(function(n){i.Dc(e);const r=t.$implicit;return i.ic(2).onColumnResized(n,r)}))("longPressStart",(function(t){return i.Dc(e),i.ic(2).onLongPressStart(t)}))("longPressEnd",(function(t){return i.Dc(e),i.ic(2).onLongPressEnd(t)}))("sort",(function(t){return i.Dc(e),i.ic(2).onSort(t)}))("select",(function(t){return i.Dc(e),i.ic(2).select.emit(t)}))("columnContextmenu",(function(t){return i.Dc(e),i.ic(2).columnContextmenu.emit(t)})),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic(2);i.pc("resizeEnabled",e.resizeable)("pressModel",e)("pressEnabled",n.reorderable&&e.draggable)("dragX",n.reorderable&&e.draggable&&e.dragging)("dragY",!1)("dragModel",e)("dragEventTarget",n.dragEventTarget)("headerHeight",n.headerHeight)("isTarget",e.isTarget)("targetMarkerTemplate",n.targetMarkerTemplate)("targetMarkerContext",e.targetMarkerContext)("column",e)("sortType",n.sortType)("sorts",n.sorts)("selectionType",n.selectionType)("sortAscendingIcon",n.sortAscendingIcon)("sortDescendingIcon",n.sortDescendingIcon)("sortUnsetIcon",n.sortUnsetIcon)("allRowsSelected",n.allRowsSelected)}}function w(e,t){if(1&e&&(i.Sb(0,"div",2),i.Mc(1,v,1,19,"datatable-header-cell",3),i.Rb()),2&e){const e=t.$implicit,n=i.ic();i.Ab("datatable-row-"+e.type),i.pc("ngStyle",n._styleByGroup[e.type]),i.yb(1),i.pc("ngForOf",e.columns)("ngForTrackBy",n.columnTrackingFn)}}function S(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-header",4),i.gc("sort",(function(t){return i.Dc(e),i.ic().onColumnSort(t)}))("resize",(function(t){return i.Dc(e),i.ic().onColumnResize(t)}))("reorder",(function(t){return i.Dc(e),i.ic().onColumnReorder(t)}))("select",(function(t){return i.Dc(e),i.ic().onHeaderSelect(t)}))("columnContextmenu",(function(t){return i.Dc(e),i.ic().onColumnContextmenu(t)})),i.jc(1,"async"),i.Rb()}if(2&e){const e=i.ic();i.pc("sorts",e.sorts)("sortType",e.sortType)("scrollbarH",e.scrollbarH)("innerWidth",e._innerWidth)("offsetX",i.kc(1,15,e._offsetX))("dealsWithGroup",void 0!==e.groupedRows)("columns",e._internalColumns)("headerHeight",e.headerHeight)("reorderable",e.reorderable)("targetMarkerTemplate",e.targetMarkerTemplate)("sortAscendingIcon",e.cssClasses.sortAscending)("sortDescendingIcon",e.cssClasses.sortDescending)("sortUnsetIcon",e.cssClasses.sortUnset)("allRowsSelected",e.allRowsSelected)("selectionType",e.selectionType)}}function M(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-footer",5),i.gc("page",(function(t){return i.Dc(e),i.ic().onFooterPage(t)})),i.Rb()}if(2&e){const e=i.ic();i.pc("rowCount",e.rowCount)("pageSize",e.pageSize)("offset",e.offset)("footerHeight",e.footerHeight)("footerTemplate",e.footer)("totalMessage",e.messages.totalMessage)("pagerLeftArrowIcon",e.cssClasses.pagerLeftArrow)("pagerRightArrowIcon",e.cssClasses.pagerRightArrow)("pagerPreviousIcon",e.cssClasses.pagerPrevious)("selectedCount",e.selected.length)("selectedMessage",!!e.selectionType&&e.messages.selectedMessage)("pagerNextIcon",e.cssClasses.pagerNext)}}function x(e,t){}function k(e,t){if(1&e&&i.Mc(0,x,0,0,"ng-template",5),2&e){const e=i.ic();i.pc("ngTemplateOutlet",e.targetMarkerTemplate)("ngTemplateOutletContext",e.targetMarkerContext)}}function D(e,t){if(1&e){const e=i.Tb();i.Sb(0,"label",6),i.Sb(1,"input",7),i.gc("change",(function(){i.Dc(e);const t=i.ic();return t.select.emit(!t.allRowsSelected)})),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("checked",e.allRowsSelected)}}function T(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span",8),i.Sb(1,"span",9),i.gc("click",(function(){return i.Dc(e),i.ic().onSort()})),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("innerHTML",e.name,i.Ec)}}function C(e,t){}function O(e,t){if(1&e&&i.Mc(0,C,0,0,"ng-template",5),2&e){const e=i.ic();i.pc("ngTemplateOutlet",e.column.headerTemplate)("ngTemplateOutletContext",e.cellContext)}}function R(e,t){}const L=function(e,t,n,i,r){return{rowCount:e,pageSize:t,selectedCount:n,curPage:i,offset:r}};function E(e,t){if(1&e&&i.Mc(0,R,0,0,"ng-template",4),2&e){const e=i.ic();i.pc("ngTemplateOutlet",e.footerTemplate.template)("ngTemplateOutletContext",i.yc(2,L,e.rowCount,e.pageSize,e.selectedCount,e.curPage,e.offset))}}function A(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Rc(" ",null==e.selectedCount?null:e.selectedCount.toLocaleString()," ",e.selectedMessage," / ")}}function I(e,t){if(1&e&&(i.Sb(0,"div",5),i.Mc(1,A,2,2,"span",1),i.Oc(2),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.selectedMessage),i.yb(1),i.Rc(" ",null==e.rowCount?null:e.rowCount.toLocaleString()," ",e.totalMessage," ")}}function P(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-pager",6),i.gc("change",(function(t){return i.Dc(e),i.ic().page.emit(t)})),i.Rb()}if(2&e){const e=i.ic();i.pc("pagerLeftArrowIcon",e.pagerLeftArrowIcon)("pagerRightArrowIcon",e.pagerRightArrowIcon)("pagerPreviousIcon",e.pagerPreviousIcon)("pagerNextIcon",e.pagerNextIcon)("page",e.curPage)("size",e.pageSize)("count",e.rowCount)("hidden",!e.isVisible)}}const j=function(e){return{"selected-count":e}};function N(e,t){if(1&e){const e=i.Tb();i.Sb(0,"li",6),i.Sb(1,"a",7),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic().selectPage(n.number)})),i.Oc(2),i.Rb(),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic();i.Eb("active",e.number===n.page),i.zb("aria-label","page "+e.number),i.yb(2),i.Qc(" ",e.text," ")}}function F(e,t){if(1&e){const e=i.Tb();i.Sb(0,"datatable-body-cell",3),i.gc("activate",(function(n){i.Dc(e);const r=t.index;return i.ic(2).onActivate(n,r)}))("treeAction",(function(){return i.Dc(e),i.ic(2).onTreeAction()})),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic(2);i.pc("row",n.row)("group",n.group)("expanded",n.expanded)("isSelected",n.isSelected)("rowIndex",n.rowIndex)("column",e)("rowHeight",n.rowHeight)("displayCheck",n.displayCheck)("treeStatus",n.treeStatus)}}function Y(e,t){if(1&e&&(i.Sb(0,"div",1),i.Mc(1,F,1,9,"datatable-body-cell",2),i.Rb()),2&e){const e=t.$implicit,n=i.ic();i.Bb("datatable-row-",e.type," datatable-row-group"),i.pc("ngStyle",n._groupStyles[e.type]),i.yb(1),i.pc("ngForOf",e.columns)("ngForTrackBy",n.columnTrackingFn)}}function z(e,t){}function $(e,t){if(1&e&&i.Mc(0,z,0,0,"ng-template",4),2&e){const e=i.ic(2);i.pc("ngTemplateOutlet",e.groupHeader.template)("ngTemplateOutletContext",e.groupContext)}}function H(e,t){if(1&e&&(i.Sb(0,"div",3),i.Mc(1,$,1,2,void 0,1),i.Rb()),2&e){const e=i.ic();i.pc("ngStyle",e.getGroupHeaderStyle()),i.yb(1),i.pc("ngIf",e.groupHeader&&e.groupHeader.template)}}function W(e,t){1&e&&i.nc(0,0,["*ngIf","(groupHeader && groupHeader.template && expanded) || !groupHeader || !groupHeader.template"])}function V(e,t){}function B(e,t){if(1&e&&i.Mc(0,V,0,0,"ng-template",4),2&e){const e=i.ic(2);i.pc("ngTemplateOutlet",e.rowDetail.template)("ngTemplateOutletContext",e.rowContext)}}function U(e,t){if(1&e&&(i.Sb(0,"div",5),i.Mc(1,B,1,2,void 0,1),i.Rb()),2&e){const e=i.ic();i.Kc("height",e.detailRowHeight,"px"),i.yb(1),i.pc("ngIf",e.rowDetail&&e.rowDetail.template)}}const G=["cellTemplate"];function q(e,t){if(1&e){const e=i.Tb();i.Sb(0,"label",4),i.Sb(1,"input",5),i.gc("click",(function(t){return i.Dc(e),i.ic().onCheckboxChange(t)})),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("checked",e.isSelected)}}function J(e,t){1&e&&i.Nb(0,"i",11)}function Q(e,t){1&e&&i.Nb(0,"i",12)}function K(e,t){1&e&&i.Nb(0,"i",13)}function Z(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",7),i.gc("click",(function(){return i.Dc(e),i.ic(2).onTreeAction()})),i.Sb(1,"span"),i.Mc(2,J,1,0,"i",8),i.Mc(3,Q,1,0,"i",9),i.Mc(4,K,1,0,"i",10),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.pc("disabled","disabled"===e.treeStatus),i.yb(2),i.pc("ngIf","loading"===e.treeStatus),i.yb(1),i.pc("ngIf","collapsed"===e.treeStatus),i.yb(1),i.pc("ngIf","expanded"===e.treeStatus||"disabled"===e.treeStatus)}}function X(e,t){}const ee=function(e){return{cellContext:e}};function te(e,t){if(1&e&&i.Mc(0,X,0,0,"ng-template",14),2&e){const e=i.ic(2);i.pc("ngTemplateOutlet",e.column.treeToggleTemplate)("ngTemplateOutletContext",i.uc(2,ee,e.cellContext))}}function ne(e,t){if(1&e&&(i.Qb(0),i.Mc(1,Z,5,4,"button",6),i.Mc(2,te,1,4,void 0,2),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",!e.column.treeToggleTemplate),i.yb(1),i.pc("ngIf",e.column.treeToggleTemplate)}}function ie(e,t){if(1&e&&i.Nb(0,"span",15),2&e){const e=i.ic();i.pc("title",e.sanitizedValue)("innerHTML",e.value,i.Ec)}}function re(e,t){}function se(e,t){if(1&e&&i.Mc(0,re,0,0,"ng-template",14,16,i.Nc),2&e){const e=i.ic();i.pc("ngTemplateOutlet",e.column.cellTemplate)("ngTemplateOutletContext",e.cellContext)}}function oe(e,t){if(1&e&&i.Nb(0,"datatable-body-row",1),2&e){const e=i.ic();i.pc("innerWidth",e.innerWidth)("offsetX",e.offsetX)("columns",e._internalColumns)("rowHeight",e.rowHeight)("row",e.summaryRow)("rowIndex",-1)}}let ae=(()=>{class e{constructor(e){this.document=e,this.width=this.getWidth()}getWidth(){const e=this.document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",this.document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const n=this.document.createElement("div");n.style.width="100%",e.appendChild(n);const i=n.offsetWidth;return e.parentNode.removeChild(e),t-i}}return e.\u0275fac=function(t){return new(t||e)(i.dc(r.d))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),ce=(()=>{class e{getDimensions(e){return e.getBoundingClientRect()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),le=(()=>{class e{constructor(){this.columnInputChanges=new s.a}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),ue=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-footer-template",""]]}),e})(),de=(()=>{class e{constructor(e,t){this.element=e,this.zone=t,this.isVisible=!1,this.visible=new i.o}ngOnInit(){this.runCheck()}ngOnDestroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const e=()=>{const{offsetHeight:t,offsetWidth:n}=this.element.nativeElement;t&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e(),50)}))};this.timeout=setTimeout(()=>e())}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.A))},e.\u0275dir=i.Hb({type:e,selectors:[["","visibilityObserver",""]],hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("visible",t.isVisible)},outputs:{visible:"visible"}}),e})(),he=(()=>{class e{constructor(e){this.dragX=!0,this.dragY=!0,this.dragStart=new i.o,this.dragging=new i.o,this.dragEnd=new i.o,this.isDragging=!1,this.element=e.nativeElement}ngOnChanges(e){e.dragEventTarget&&e.dragEventTarget.currentValue&&this.dragModel.dragging&&this.onMousedown(e.dragEventTarget.currentValue)}ngOnDestroy(){this._destroySubscription()}onMouseup(e){this.isDragging&&(this.isDragging=!1,this.element.classList.remove("dragging"),this.subscription&&(this._destroySubscription(),this.dragEnd.emit({event:e,element:this.element,model:this.dragModel})))}onMousedown(e){if(e.target.classList.contains("draggable")&&(this.dragX||this.dragY)){e.preventDefault(),this.isDragging=!0;const t={x:e.clientX,y:e.clientY},n=Object(o.a)(document,"mouseup");this.subscription=n.subscribe(e=>this.onMouseup(e));const i=Object(o.a)(document,"mousemove").pipe(Object(c.a)(n)).subscribe(e=>this.move(e,t));this.subscription.add(i),this.dragStart.emit({event:e,element:this.element,model:this.dragModel})}}move(e,t){if(!this.isDragging)return;const n=e.clientY-t.y;this.dragX&&(this.element.style.left=e.clientX-t.x+"px"),this.dragY&&(this.element.style.top=n+"px"),this.element.classList.add("dragging"),this.dragging.emit({event:e,element:this.element,model:this.dragModel})}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m))},e.\u0275dir=i.Hb({type:e,selectors:[["","draggable",""]],inputs:{dragX:"dragX",dragY:"dragY",dragEventTarget:"dragEventTarget",dragModel:"dragModel"},outputs:{dragStart:"dragStart",dragging:"dragging",dragEnd:"dragEnd"},features:[i.wb]}),e})(),fe=(()=>{class e{constructor(e,t){this.renderer=t,this.resizeEnabled=!0,this.resize=new i.o,this.resizing=!1,this.element=e.nativeElement}ngAfterViewInit(){const e=this.renderer;this.resizeHandle=e.createElement("span"),e.addClass(this.resizeHandle,this.resizeEnabled?"resize-handle":"resize-handle--not-resizable"),e.appendChild(this.element,this.resizeHandle)}ngOnDestroy(){this._destroySubscription(),this.renderer.destroyNode?this.renderer.destroyNode(this.resizeHandle):this.resizeHandle&&this.renderer.removeChild(this.renderer.parentNode(this.resizeHandle),this.resizeHandle)}onMouseup(){this.resizing=!1,this.subscription&&!this.subscription.closed&&(this._destroySubscription(),this.resize.emit(this.element.clientWidth))}onMousedown(e){const t=e.target.classList.contains("resize-handle"),n=this.element.clientWidth,i=e.screenX;if(t){e.stopPropagation(),this.resizing=!0;const t=Object(o.a)(document,"mouseup");this.subscription=t.subscribe(e=>this.onMouseup());const r=Object(o.a)(document,"mousemove").pipe(Object(c.a)(t)).subscribe(e=>this.move(e,n,i));this.subscription.add(r)}}move(e,t,n){const i=t+(e.screenX-n);(!this.minWidth||i>=this.minWidth)&&(!this.maxWidth||i<=this.maxWidth)&&(this.element.style.width=i+"px")}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.E))},e.\u0275dir=i.Hb({type:e,selectors:[["","resizeable",""]],hostVars:2,hostBindings:function(e,t){1&e&&i.gc("mousedown",(function(e){return t.onMousedown(e)})),2&e&&i.Eb("resizeable",t.resizeEnabled)},inputs:{resizeEnabled:"resizeEnabled",minWidth:"minWidth",maxWidth:"maxWidth"},outputs:{resize:"resize"}}),e})(),pe=(()=>{class e{constructor(e,t){this.document=t,this.reorder=new i.o,this.targetChanged=new i.o,this.differ=e.find({}).create()}ngAfterContentInit(){this.updateSubscriptions(),this.draggables.changes.subscribe(this.updateSubscriptions.bind(this))}ngOnDestroy(){this.draggables.forEach(e=>{e.dragStart.unsubscribe(),e.dragging.unsubscribe(),e.dragEnd.unsubscribe()})}updateSubscriptions(){const e=this.differ.diff(this.createMapDiffs());if(e){const t=({currentValue:e,previousValue:t})=>{n({previousValue:t}),e&&(e.dragStart.subscribe(this.onDragStart.bind(this)),e.dragging.subscribe(this.onDragging.bind(this)),e.dragEnd.subscribe(this.onDragEnd.bind(this)))},n=({previousValue:e})=>{e&&(e.dragStart.unsubscribe(),e.dragging.unsubscribe(),e.dragEnd.unsubscribe())};e.forEachAddedItem(t),e.forEachRemovedItem(n)}}onDragStart(){this.positions={};let e=0;for(const t of this.draggables.toArray()){const n=t.element,i=parseInt(n.offsetLeft.toString(),0);this.positions[t.dragModel.prop]={left:i,right:i+parseInt(n.offsetWidth.toString(),0),index:e++,element:n}}}onDragging({model:e,event:t}){const n=this.positions[e.prop],i=this.isTarget(e,t);i?this.lastDraggingIndex!==i.i&&(this.targetChanged.emit({prevIndex:this.lastDraggingIndex,newIndex:i.i,initialIndex:n.index}),this.lastDraggingIndex=i.i):this.lastDraggingIndex!==n.index&&(this.targetChanged.emit({prevIndex:this.lastDraggingIndex,initialIndex:n.index}),this.lastDraggingIndex=n.index)}onDragEnd({element:e,model:t,event:n}){const i=this.positions[t.prop],r=this.isTarget(t,n);r&&this.reorder.emit({prevIndex:i.index,newIndex:r.i,model:t}),this.lastDraggingIndex=void 0,e.style.left="auto"}isTarget(e,t){let n=0;const i=this.document.elementsFromPoint(t.x||t.clientX,t.y||t.clientY);for(const r in this.positions){const t=this.positions[r];if(e.prop!==r&&i.find(e=>e===t.element))return{pos:t,i:n};n++}}createMapDiffs(){return this.draggables.toArray().reduce((e,t)=>(e[t.dragModel.$$id]=t,e),{})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.u),i.Mb(r.d))},e.\u0275dir=i.Hb({type:e,selectors:[["","orderable",""]],contentQueries:function(e,t,n){var r;1&e&&i.Fb(n,he,!0),2&e&&i.zc(r=i.hc())&&(t.draggables=r)},outputs:{reorder:"reorder",targetChanged:"targetChanged"}}),e})(),me=(()=>{class e{constructor(){this.pressEnabled=!0,this.duration=500,this.longPressStart=new i.o,this.longPressing=new i.o,this.longPressEnd=new i.o,this.mouseX=0,this.mouseY=0}get press(){return this.pressing}get isLongPress(){return this.isLongPressing}onMouseDown(e){if(1!==e.which||!this.pressEnabled)return;if(e.target.classList.contains("resize-handle"))return;this.mouseX=e.clientX,this.mouseY=e.clientY,this.pressing=!0,this.isLongPressing=!1;const t=Object(o.a)(document,"mouseup");this.subscription=t.subscribe(e=>this.onMouseup()),this.timeout=setTimeout(()=>{this.isLongPressing=!0,this.longPressStart.emit({event:e,model:this.pressModel}),this.subscription.add(Object(o.a)(document,"mousemove").pipe(Object(c.a)(t)).subscribe(e=>this.onMouseMove(e))),this.loop(e)},this.duration),this.loop(e)}onMouseMove(e){if(this.pressing&&!this.isLongPressing){const t=Math.abs(e.clientX-this.mouseX)>10,n=Math.abs(e.clientY-this.mouseY)>10;(t||n)&&this.endPress()}}loop(e){this.isLongPressing&&(this.timeout=setTimeout(()=>{this.longPressing.emit({event:e,model:this.pressModel}),this.loop(e)},50))}endPress(){clearTimeout(this.timeout),this.isLongPressing=!1,this.pressing=!1,this._destroySubscription(),this.longPressEnd.emit({model:this.pressModel})}onMouseup(){this.endPress()}ngOnDestroy(){this._destroySubscription()}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["","long-press",""]],hostVars:4,hostBindings:function(e,t){1&e&&i.gc("mousedown",(function(e){return t.onMouseDown(e)})),2&e&&i.Eb("press",t.press)("longpress",t.isLongPress)},inputs:{pressEnabled:"pressEnabled",duration:"duration",pressModel:"pressModel"},outputs:{longPressStart:"longPressStart",longPressing:"longPressing",longPressEnd:"longPressEnd"}}),e})(),be=(()=>{class e{constructor(e,t,n){this.ngZone=e,this.renderer=n,this.scrollbarV=!1,this.scrollbarH=!1,this.scroll=new i.o,this.scrollYPos=0,this.scrollXPos=0,this.prevScrollYPos=0,this.prevScrollXPos=0,this._scrollEventListener=null,this.element=t.nativeElement}ngOnInit(){if(this.scrollbarV||this.scrollbarH){const e=this.renderer;this.parentElement=e.parentNode(e.parentNode(this.element)),this._scrollEventListener=this.onScrolled.bind(this),this.parentElement.addEventListener("scroll",this._scrollEventListener)}}ngOnDestroy(){this._scrollEventListener&&(this.parentElement.removeEventListener("scroll",this._scrollEventListener),this._scrollEventListener=null)}setOffset(e){this.parentElement&&(this.parentElement.scrollTop=e)}onScrolled(e){const t=e.currentTarget;requestAnimationFrame(()=>{this.scrollYPos=t.scrollTop,this.scrollXPos=t.scrollLeft,this.updateOffset()})}updateOffset(){let e;this.scrollYPos<this.prevScrollYPos?e="down":this.scrollYPos>this.prevScrollYPos&&(e="up"),this.scroll.emit({direction:e,scrollYPos:this.scrollYPos,scrollXPos:this.scrollXPos}),this.prevScrollYPos=this.scrollYPos,this.prevScrollXPos=this.scrollXPos}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.A),i.Mb(i.m),i.Mb(i.E))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-scroller"]],hostAttrs:[1,"datatable-scroll"],hostVars:4,hostBindings:function(e,t){2&e&&i.Kc("height",t.scrollHeight,"px")("width",t.scrollWidth,"px")},inputs:{scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth"},outputs:{scroll:"scroll"},ngContentSelectors:u,decls:1,vars:0,template:function(e,t){1&e&&(i.oc(),i.nc(0))},encapsulation:2,changeDetection:0}),e})(),ge=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-group-header-template",""]]}),e})(),_e=(()=>{class e{constructor(){this.rowHeight=0,this.toggle=new i.o}get template(){return this._templateInput||this._templateQuery}toggleExpandGroup(e){this.toggle.emit({type:"group",value:e})}expandAllGroups(){this.toggle.emit({type:"all",value:!0})}collapseAllGroups(){this.toggle.emit({type:"all",value:!1})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["ngx-datatable-group-header"]],contentQueries:function(e,t,n){var r;1&e&&i.Ic(n,ge,!0,i.L),2&e&&i.zc(r=i.hc())&&(t._templateQuery=r.first)},inputs:{rowHeight:"rowHeight",_templateInput:["template","_templateInput"]},outputs:{toggle:"toggle"}}),e})();function ye(){return""}function ve(e){return null==e?ye:"number"==typeof e?we:-1!==e.indexOf(".")?Me:Se}function we(e,t){if(null==e)return"";if(!e||null==t)return e;const n=e[t];return null==n?"":n}function Se(e,t){if(null==e)return"";if(!e||!t)return e;const n=e[t];return null==n?"":n}function Me(e,t){if(null==e)return"";if(!e||!t)return e;let n=e[t];if(void 0!==n)return n;n=e;const i=t.split(".");if(i.length)for(let r=0;r<i.length;r++)if(n=n[i[r]],null==n)return"";return n}function xe(e){return e&&(t=>ve(e)(t,e))}function ke(e,t,n){if(t&&n){const i={},r=e.length;let s=null;i[0]=new De;const o=e.reduce((e,t)=>{const i=n(t);return-1===e.indexOf(i)&&e.push(i),e},[]);for(let t=0;t<r;t++)i[n(e[t])]=new De(e[t]);for(let c=0;c<r;c++){s=i[n(e[c])];let r=0;const a=t(s.row);a&&o.indexOf(a)>-1&&(r=a),s.parent=i[r],s.row.level=s.parent.row.level+1,s.parent.children.push(s)}let a=[];return i[0].flatten((function(){a=[...a,this.row]}),!0),a}return e}class De{constructor(e=null){e||(e={level:-1,treeStatus:"expanded"}),this.row=e,this.parent=null,this.children=[]}flatten(e,t){if("expanded"===this.row.treeStatus)for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n];e.apply(i,Array.prototype.slice.call(arguments,2)),t&&i.flatten.apply(i,arguments)}}}function Te(e){return(e=(e=(e=e.replace(/[^a-zA-Z0-9 ]/g," ")).replace(/([a-z](?=[A-Z]))/g,"$1 ")).replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase()).replace(/([ 0-9]+)([a-zA-Z])/g,(function(e,t,n){return t.trim()+n.toUpperCase()}))}function Ce(e){if(!e)return;let t=!1;for(const n of e)n.$$id||(n.$$id=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)),Oe(n.prop)&&n.name&&(n.prop=Te(n.name)),n.$$valueGetter||(n.$$valueGetter=ve(n.prop)),!Oe(n.prop)&&Oe(n.name)&&(n.name=String(n.prop).replace(/([A-Z])/g,e=>" "+e).replace(/^./,e=>e.toUpperCase())),Oe(n.prop)&&Oe(n.name)&&(n.name=""),n.hasOwnProperty("resizeable")||(n.resizeable=!0),n.hasOwnProperty("sortable")||(n.sortable=!0),n.hasOwnProperty("draggable")||(n.draggable=!0),n.hasOwnProperty("canAutoResize")||(n.canAutoResize=!0),n.hasOwnProperty("width")||(n.width=150),n.hasOwnProperty("isTreeColumn")&&n.isTreeColumn&&!t?t=!0:n.isTreeColumn=!1}function Oe(e){return null==e}var Re=function(e){return e.standard="standard",e.flex="flex",e.force="force",e}({}),Le=function(e){return e.single="single",e.multi="multi",e.multiClick="multiClick",e.cell="cell",e.checkbox="checkbox",e}({}),Ee=function(e){return e.single="single",e.multi="multi",e}({}),Ae=function(e){return e.header="header",e.body="body",e}({});let Ie=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-header-template",""]]}),e})(),Pe=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-cell-template",""]]}),e})(),je=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-tree-toggle",""]]}),e})(),Ne=(()=>{class e{constructor(e){this.columnChangesService=e,this.isFirstChange=!0}get cellTemplate(){return this._cellTemplateInput||this._cellTemplateQuery}get headerTemplate(){return this._headerTemplateInput||this._headerTemplateQuery}get treeToggleTemplate(){return this._treeToggleTemplateInput||this._treeToggleTemplateQuery}ngOnChanges(){this.isFirstChange?this.isFirstChange=!1:this.columnChangesService.onInputChange()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(le))},e.\u0275dir=i.Hb({type:e,selectors:[["ngx-datatable-column"]],contentQueries:function(e,t,n){var r;1&e&&(i.Ic(n,Pe,!0,i.L),i.Ic(n,Ie,!0,i.L),i.Ic(n,je,!0,i.L)),2&e&&(i.zc(r=i.hc())&&(t._cellTemplateQuery=r.first),i.zc(r=i.hc())&&(t._headerTemplateQuery=r.first),i.zc(r=i.hc())&&(t._treeToggleTemplateQuery=r.first))},inputs:{name:"name",prop:"prop",frozenLeft:"frozenLeft",frozenRight:"frozenRight",flexGrow:"flexGrow",resizeable:"resizeable",comparator:"comparator",pipe:"pipe",sortable:"sortable",draggable:"draggable",canAutoResize:"canAutoResize",minWidth:"minWidth",width:"width",maxWidth:"maxWidth",checkboxable:"checkboxable",headerCheckboxable:"headerCheckboxable",headerClass:"headerClass",cellClass:"cellClass",isTreeColumn:"isTreeColumn",treeLevelIndent:"treeLevelIndent",summaryFunc:"summaryFunc",summaryTemplate:"summaryTemplate",_cellTemplateInput:["cellTemplate","_cellTemplateInput"],_headerTemplateInput:["headerTemplate","_headerTemplateInput"],_treeToggleTemplateInput:["treeToggleTemplate","_treeToggleTemplateInput"]},features:[i.wb]}),e})(),Fe=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.L))},e.\u0275dir=i.Hb({type:e,selectors:[["","ngx-datatable-row-detail-template",""]]}),e})(),Ye=(()=>{class e{constructor(){this.rowHeight=0,this.toggle=new i.o}get template(){return this._templateInput||this._templateQuery}toggleExpandRow(e){this.toggle.emit({type:"row",value:e})}expandAllRows(){this.toggle.emit({type:"all",value:!0})}collapseAllRows(){this.toggle.emit({type:"all",value:!1})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["ngx-datatable-row-detail"]],contentQueries:function(e,t,n){var r;1&e&&i.Ic(n,Fe,!0,i.L),2&e&&i.zc(r=i.hc())&&(t._templateQuery=r.first)},inputs:{rowHeight:"rowHeight",_templateInput:["template","_templateInput"]},outputs:{toggle:"toggle"}}),e})(),ze=(()=>{class e{get template(){return this._templateInput||this._templateQuery}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Hb({type:e,selectors:[["ngx-datatable-footer"]],contentQueries:function(e,t,n){var r;1&e&&i.Fb(n,ue,!0,i.L),2&e&&i.zc(r=i.hc())&&(t._templateQuery=r.first)},inputs:{footerHeight:"footerHeight",totalMessage:"totalMessage",selectedMessage:"selectedMessage",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon",_templateInput:["template","_templateInput"]}}),e})();function $e(e){const t={left:[],center:[],right:[]};if(e)for(const n of e)n.frozenLeft?t.left.push(n):n.frozenRight?t.right.push(n):t.center.push(n);return t}function He(e,t){return{left:We(e.left),center:We(e.center),right:We(e.right),total:Math.floor(We(t))}}function We(e,t){let n=0;if(e)for(const i of e)n+=parseFloat(t&&i[t]?i[t]:i.width);return n}function Ve(e){const t=[],n=$e(e);return t.push({type:"left",columns:n.left}),t.push({type:"center",columns:n.center}),t.push({type:"right",columns:n.right}),t}class Be{constructor(){this.treeArray=[]}clearCache(){this.treeArray=[]}initCache(e){const{rows:t,rowHeight:n,detailRowHeight:i,externalVirtual:r,rowCount:s,rowIndexes:o,rowExpansions:a}=e,c="function"==typeof n,l="function"==typeof i;if(!c&&isNaN(n))throw new Error(`Row Height cache initialization failed. Please ensure that 'rowHeight' is a\n        valid number or function value: (${n}) when 'scrollbarV' is enabled.`);if(!l&&isNaN(i))throw new Error(`Row Height cache initialization failed. Please ensure that 'detailRowHeight' is a\n        valid number or function value: (${i}) when 'scrollbarV' is enabled.`);const u=r?s:t.length;this.treeArray=new Array(u);for(let d=0;d<u;++d)this.treeArray[d]=0;for(let d=0;d<u;++d){const e=t[d];let r=n;c&&(r=n(e));const s=a.has(e);e&&s&&(r+=l?i(e,o.get(e)):i),this.update(d,r)}}getRowIndex(e){return 0===e?0:this.calcRowIndex(e)}update(e,t){if(!this.treeArray.length)throw new Error(`Update at index ${e} with value ${t} failed:\n        Row Height cache not initialized.`);const n=this.treeArray.length;for(e|=0;e<n;)this.treeArray[e]+=t,e|=e+1}query(e){if(!this.treeArray.length)throw new Error(`query at index ${e} failed: Fenwick tree array not initialized.`);let t=0;for(e|=0;e>=0;)t+=this.treeArray[e],e=(e&e+1)-1;return t}queryBetween(e,t){return this.query(t)-this.query(e-1)}calcRowIndex(e){if(!this.treeArray.length)return 0;let t=-1;const n=this.treeArray.length;for(let i=Math.pow(2,n.toString(2).length-1);0!==i;i>>=1){const r=t+i;r<n&&e>=this.treeArray[r]&&(e-=this.treeArray[r],t=r)}return t+1}}const Ue={},Ge="undefined"!=typeof document?document.createElement("div").style:void 0,qe=function(){const e="undefined"!=typeof window?window.getComputedStyle(document.documentElement,""):void 0,t=void 0!==e?Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/):null,n=null!==t?t[1]:void 0,i=void 0!==n?"WebKit|Moz|MS|O".match(new RegExp("("+n+")","i"))[1]:void 0;return i?{dom:i,lowercase:n,css:`-${n}-`,js:n[0].toUpperCase()+n.substr(1)}:void 0}();function Je(e){const t=Te(e);return Ue[t]||(void 0!==qe&&void 0!==Ge[qe.css+e]?Ue[t]=qe.css+e:void 0!==Ge[e]&&(Ue[t]=e)),Ue[t]}const Qe="undefined"!=typeof window?Je("transform"):void 0,Ke="undefined"!=typeof window?Je("backfaceVisibility"):void 0,Ze="undefined"!=typeof window?!!Je("transform"):void 0,Xe="undefined"!=typeof window?!!Je("perspective"):void 0,et="undefined"!=typeof window?window.navigator.userAgent:"Chrome",tt=/Safari\//.test(et)&&!/Chrome\//.test(et);function nt(e,t,n){void 0!==Qe&&Ze?!tt&&Xe?(e[Qe]=`translate3d(${t}px, ${n}px, 0)`,e[Ke]="hidden"):e[Te(Qe)]=`translate(${t}px, ${n}px)`:(e.top=n+"px",e.left=t+"px")}let it=(()=>{class e{constructor(e){this.cd=e,this.selected=[],this.scroll=new i.o,this.page=new i.o,this.activate=new i.o,this.select=new i.o,this.detailToggle=new i.o,this.rowContextmenu=new i.o(!1),this.treeAction=new i.o,this.rowHeightsCache=new Be,this.temp=[],this.offsetY=0,this.indexes={},this.rowIndexes=new WeakMap,this.rowExpansions=[],this.getDetailRowHeight=(e,t)=>{if(!this.rowDetail)return 0;const n=this.rowDetail.rowHeight;return"function"==typeof n?n(e,t):n},this.rowTrackingFn=(e,t)=>{const n=this.getRowIndex(t);return this.trackByProp?t[this.trackByProp]:n}}set pageSize(e){this._pageSize=e,this.recalcLayout()}get pageSize(){return this._pageSize}set rows(e){this._rows=e,this.recalcLayout()}get rows(){return this._rows}set columns(e){this._columns=e;const t=$e(e);this.columnGroupWidths=He(t,e)}get columns(){return this._columns}set offset(e){this._offset=e,(!this.scrollbarV||this.scrollbarV&&!this.virtualization)&&this.recalcLayout()}get offset(){return this._offset}set rowCount(e){this._rowCount=e,this.recalcLayout()}get rowCount(){return this._rowCount}get bodyWidth(){return this.scrollbarH?this.innerWidth+"px":"100%"}set bodyHeight(e){this._bodyHeight=this.scrollbarV?e+"px":"auto",this.recalcLayout()}get bodyHeight(){return this._bodyHeight}get selectEnabled(){return!!this.selectionType}get scrollHeight(){if(this.scrollbarV&&this.virtualization&&this.rowCount)return this.rowHeightsCache.query(this.rowCount-1)}ngOnInit(){this.rowDetail&&(this.listener=this.rowDetail.toggle.subscribe(({type:e,value:t})=>{"row"===e&&this.toggleRowExpansion(t),"all"===e&&this.toggleAllRows(t),this.updateIndexes(),this.updateRows(),this.cd.markForCheck()})),this.groupHeader&&(this.listener=this.groupHeader.toggle.subscribe(({type:e,value:t})=>{"group"===e&&this.toggleRowExpansion(t),"all"===e&&this.toggleAllRows(t),this.updateIndexes(),this.updateRows(),this.cd.markForCheck()}))}ngOnDestroy(){(this.rowDetail||this.groupHeader)&&this.listener.unsubscribe()}updateOffsetY(e){this.scroller&&(this.scrollbarV&&this.virtualization&&e?e=this.rowHeightsCache.query(this.pageSize*e-1):this.scrollbarV&&!this.virtualization&&(e=0),this.scroller.setOffset(e||0))}onBodyScroll(e){const t=e.scrollYPos,n=e.scrollXPos;this.offsetY===t&&this.offsetX===n||this.scroll.emit({offsetY:t,offsetX:n}),this.offsetY=t,this.offsetX=n,this.updateIndexes(),this.updatePage(e.direction),this.updateRows()}updatePage(e){let t=this.indexes.first/this.pageSize;"up"===e?t=Math.ceil(t):"down"===e&&(t=Math.floor(t)),void 0===e||isNaN(t)||this.page.emit({offset:t})}updateRows(){const{first:e,last:t}=this.indexes;let n=e,i=0;const r=[];if(this.groupedRows){let e=3;for(1===this.groupedRows.length&&(e=this.groupedRows[0].value.length);n<t&&n<this.groupedRows.length;){const e=this.groupedRows[n];this.rowIndexes.set(e,n),e.value&&e.value.forEach((e,t)=>{this.rowIndexes.set(e,`${n}-${t}`)}),r[i]=e,i++,n++}}else for(;n<t&&n<this.rowCount;){const e=this.rows[n];e&&(this.rowIndexes.set(e,n),r[i]=e),i++,n++}this.temp=r}getRowHeight(e){return"function"==typeof this.rowHeight?this.rowHeight(e):this.rowHeight}getGroupHeight(e){let t=0;if(e.value)for(let n=0;n<e.value.length;n++)t+=this.getRowAndDetailHeight(e.value[n]);return t}getRowAndDetailHeight(e){let t=this.getRowHeight(e);return this.getRowExpanded(e)&&(t+=this.getDetailRowHeight(e)),t}getRowsStyles(e){const t={};if(this.groupedRows&&(t.width=this.columnGroupWidths.total),this.scrollbarV&&this.virtualization){let n=0;if(this.groupedRows){const t=e[e.length-1];n=t?this.getRowIndex(t):0}else n=this.getRowIndex(e);nt(t,0,this.rowHeightsCache.query(n-1))}return t}getBottomSummaryRowStyles(){if(!this.scrollbarV||!this.rows||!this.rows.length)return null;const e={position:"absolute"};return nt(e,0,this.rowHeightsCache.query(this.rows.length-1)),e}hideIndicator(){setTimeout(()=>this.loadingIndicator=!1,500)}updateIndexes(){let e=0,t=0;if(this.scrollbarV)if(this.virtualization){const n=parseInt(this.bodyHeight,0);e=this.rowHeightsCache.getRowIndex(this.offsetY),t=this.rowHeightsCache.getRowIndex(n+this.offsetY)+1}else e=0,t=this.rowCount;else this.externalPaging||(e=Math.max(this.offset*this.pageSize,0)),t=Math.min(e+this.pageSize,this.rowCount);this.indexes={first:e,last:t}}refreshRowHeightCache(){if(this.scrollbarV&&(!this.scrollbarV||this.virtualization)&&(this.rowHeightsCache.clearCache(),this.rows&&this.rows.length)){const e=new Set;for(const t of this.rows)this.getRowExpanded(t)&&e.add(t);this.rowHeightsCache.initCache({rows:this.rows,rowHeight:this.rowHeight,detailRowHeight:this.getDetailRowHeight,externalVirtual:this.scrollbarV&&this.externalPaging,rowCount:this.rowCount,rowIndexes:this.rowIndexes,rowExpansions:e})}}getAdjustedViewPortIndex(){const e=this.indexes.first;return this.scrollbarV&&this.virtualization&&this.rowHeightsCache.query(e-1)<=this.offsetY?e-1:e}toggleRowExpansion(e){const t=this.getAdjustedViewPortIndex(),n=this.getRowExpandedIdx(e,this.rowExpansions),i=n>-1;if(this.scrollbarV&&this.virtualization){const t=this.getDetailRowHeight(e)*(i?-1:1),n=this.getRowIndex(e);this.rowHeightsCache.update(n,t)}i?this.rowExpansions.splice(n,1):this.rowExpansions.push(e),this.detailToggle.emit({rows:[e],currentIndex:t})}toggleAllRows(e){this.rowExpansions=[];const t=this.getAdjustedViewPortIndex();if(e)for(const n of this.rows)this.rowExpansions.push(n);this.scrollbarV&&this.recalcLayout(),this.detailToggle.emit({rows:this.rows,currentIndex:t})}recalcLayout(){this.refreshRowHeightCache(),this.updateIndexes(),this.updateRows()}columnTrackingFn(e,t){return t.$$id}stylesByGroup(e){const t=this.columnGroupWidths,n=this.offsetX,i={width:t[e]+"px"};if("left"===e)nt(i,n,0);else if("right"===e){const e=parseInt(this.innerWidth+"",0);nt(i,-1*(t.total-e-n),0)}return i}getRowExpanded(e){if(0===this.rowExpansions.length&&this.groupExpansionDefault)for(const t of this.groupedRows)this.rowExpansions.push(t);return this.getRowExpandedIdx(e,this.rowExpansions)>-1}getRowExpandedIdx(e,t){if(!t||!t.length)return-1;const n=this.rowIdentity(e);return t.findIndex(e=>this.rowIdentity(e)===n)}getRowIndex(e){return this.rowIndexes.get(e)||0}onTreeAction(e){this.treeAction.emit({row:e})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-body"]],viewQuery:function(e,t){var n;1&e&&i.Tc(be,!0),2&e&&i.zc(n=i.hc())&&(t.scroller=n.first)},hostAttrs:[1,"datatable-body"],hostVars:4,hostBindings:function(e,t){2&e&&i.Kc("width",t.bodyWidth)("height",t.bodyHeight)},inputs:{selected:"selected",pageSize:"pageSize",rows:"rows",columns:"columns",offset:"offset",rowCount:"rowCount",bodyHeight:"bodyHeight",offsetX:"offsetX",loadingIndicator:"loadingIndicator",scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",externalPaging:"externalPaging",rowHeight:"rowHeight",emptyMessage:"emptyMessage",selectionType:"selectionType",rowIdentity:"rowIdentity",rowDetail:"rowDetail",groupHeader:"groupHeader",selectCheck:"selectCheck",displayCheck:"displayCheck",trackByProp:"trackByProp",rowClass:"rowClass",groupedRows:"groupedRows",groupExpansionDefault:"groupExpansionDefault",innerWidth:"innerWidth",groupRowsBy:"groupRowsBy",virtualization:"virtualization",summaryRow:"summaryRow",summaryPosition:"summaryPosition",summaryHeight:"summaryHeight"},outputs:{scroll:"scroll",page:"page",activate:"activate",select:"select",detailToggle:"detailToggle",rowContextmenu:"rowContextmenu",treeAction:"treeAction"},decls:5,vars:9,consts:[[4,"ngIf"],[3,"selected","rows","selectCheck","selectEnabled","selectionType","rowIdentity","select","activate"],["selector",""],[3,"scrollbarV","scrollbarH","scrollHeight","scrollWidth","scroll",4,"ngIf"],["class","empty-row",3,"innerHTML",4,"ngIf"],[3,"scrollbarV","scrollbarH","scrollHeight","scrollWidth","scroll"],[3,"rowHeight","offsetX","innerWidth","rows","columns",4,"ngIf"],[3,"groupedRows","innerWidth","ngStyle","rowDetail","groupHeader","offsetX","detailRowHeight","row","expanded","rowIndex","rowContextmenu",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle","rowHeight","offsetX","innerWidth","rows","columns",4,"ngIf"],[3,"rowHeight","offsetX","innerWidth","rows","columns"],[3,"groupedRows","innerWidth","ngStyle","rowDetail","groupHeader","offsetX","detailRowHeight","row","expanded","rowIndex","rowContextmenu"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","rowIndex","expanded","rowClass","displayCheck","treeStatus","treeAction","activate",4,"ngIf","ngIfElse"],["groupedRowsTemplate",""],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","rowIndex","expanded","rowClass","displayCheck","treeStatus","treeAction","activate"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","group","rowIndex","expanded","rowClass","activate",4,"ngFor","ngForOf","ngForTrackBy"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","group","rowIndex","expanded","rowClass","activate"],[3,"ngStyle","rowHeight","offsetX","innerWidth","rows","columns"],[1,"empty-row",3,"innerHTML"]],template:function(e,t){1&e&&(i.Mc(0,d,1,0,"datatable-progress",0),i.Sb(1,"datatable-selection",1,2),i.gc("select",(function(e){return t.select.emit(e)}))("activate",(function(e){return t.activate.emit(e)})),i.Mc(3,_,4,8,"datatable-scroller",3),i.Mc(4,y,1,1,"div",4),i.Rb()),2&e&&(i.pc("ngIf",t.loadingIndicator),i.yb(1),i.pc("selected",t.selected)("rows",t.rows)("selectCheck",t.selectCheck)("selectEnabled",t.selectEnabled)("selectionType",t.selectionType)("rowIdentity",t.rowIdentity),i.yb(2),i.pc("ngIf",null==t.rows?null:t.rows.length),i.yb(1),i.pc("ngIf",!(null!=t.rows&&t.rows.length||t.loadingIndicator)))},directives:function(){return[r.r,vt,pt,be,r.q,Mt,gt,r.s,bt]},encapsulation:2,changeDetection:0}),e})(),rt=(()=>{class e{constructor(e){this.cd=e,this.sort=new i.o,this.reorder=new i.o,this.resize=new i.o,this.select=new i.o,this.columnContextmenu=new i.o(!1),this._columnGroupWidths={total:100},this._styleByGroup={left:{},center:{},right:{}},this.destroyed=!1}set innerWidth(e){this._innerWidth=e,setTimeout(()=>{if(this._columns){const e=$e(this._columns);this._columnGroupWidths=He(e,this._columns),this.setStylesByGroup()}})}get innerWidth(){return this._innerWidth}set headerHeight(e){this._headerHeight="auto"!==e?e+"px":e}get headerHeight(){return this._headerHeight}set columns(e){this._columns=e;const t=$e(e);this._columnsByPin=Ve(e),setTimeout(()=>{this._columnGroupWidths=He(t,e),this.setStylesByGroup()})}get columns(){return this._columns}set offsetX(e){this._offsetX=e,this.setStylesByGroup()}get offsetX(){return this._offsetX}ngOnDestroy(){this.destroyed=!0}onLongPressStart({event:e,model:t}){t.dragging=!0,this.dragEventTarget=e}onLongPressEnd({event:e,model:t}){this.dragEventTarget=e,setTimeout(()=>{const e=this._columns.find(e=>e.$$id===t.$$id);e&&(e.dragging=!1)},5)}get headerWidth(){return this.scrollbarH?this.innerWidth+"px":"100%"}trackByGroups(e,t){return t.type}columnTrackingFn(e,t){return t.$$id}onColumnResized(e,t){e<=t.minWidth?e=t.minWidth:e>=t.maxWidth&&(e=t.maxWidth),this.resize.emit({column:t,prevValue:t.width,newValue:e})}onColumnReordered({prevIndex:e,newIndex:t,model:n}){const i=this.getColumn(t);i.isTarget=!1,i.targetMarkerContext=void 0,this.reorder.emit({column:n,prevValue:e,newValue:t})}onTargetChanged({prevIndex:e,newIndex:t,initialIndex:n}){if(e||0===e){const t=this.getColumn(e);t.isTarget=!1,t.targetMarkerContext=void 0}if(t||0===t){const e=this.getColumn(t);e.isTarget=!0,n!==t&&(e.targetMarkerContext={class:"targetMarker ".concat(n>t?"dragFromRight":"dragFromLeft")})}}getColumn(e){const t=this._columnsByPin[0].columns.length;if(e<t)return this._columnsByPin[0].columns[e];const n=this._columnsByPin[1].columns.length;return e<t+n?this._columnsByPin[1].columns[e-t]:this._columnsByPin[2].columns[e-t-n]}onSort({column:e,prevValue:t,newValue:n}){if(e.dragging)return;const i=this.calcNewSorts(e,t,n);this.sort.emit({sorts:i,column:e,prevValue:t,newValue:n})}calcNewSorts(e,t,n){let i=0;this.sorts||(this.sorts=[]);const r=this.sorts.map((t,n)=>((t=Object.assign({},t)).prop===e.prop&&(i=n),t));return void 0===n?r.splice(i,1):t?r[i].dir=n:(this.sortType===Ee.single&&r.splice(0,this.sorts.length),r.push({dir:n,prop:e.prop})),r}setStylesByGroup(){this._styleByGroup.left=this.calcStylesByGroup("left"),this._styleByGroup.center=this.calcStylesByGroup("center"),this._styleByGroup.right=this.calcStylesByGroup("right"),this.destroyed||this.cd.detectChanges()}calcStylesByGroup(e){const t=this._columnGroupWidths,n={width:t[e]+"px"};return"center"===e?nt(n,-1*this.offsetX,0):"right"===e&&nt(n,-1*(t.total-this.innerWidth),0),n}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-header"]],hostAttrs:[1,"datatable-header"],hostVars:4,hostBindings:function(e,t){2&e&&i.Kc("height",t.headerHeight)("width",t.headerWidth)},inputs:{innerWidth:"innerWidth",headerHeight:"headerHeight",columns:"columns",offsetX:"offsetX",sorts:"sorts",sortAscendingIcon:"sortAscendingIcon",sortDescendingIcon:"sortDescendingIcon",sortUnsetIcon:"sortUnsetIcon",scrollbarH:"scrollbarH",dealsWithGroup:"dealsWithGroup",targetMarkerTemplate:"targetMarkerTemplate",sortType:"sortType",allRowsSelected:"allRowsSelected",selectionType:"selectionType",reorderable:"reorderable"},outputs:{sort:"sort",reorder:"reorder",resize:"resize",select:"select",columnContextmenu:"columnContextmenu"},decls:2,vars:4,consts:[["orderable","",1,"datatable-header-inner",3,"reorder","targetChanged"],[3,"class","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["resizeable","","long-press","","draggable","",3,"resizeEnabled","pressModel","pressEnabled","dragX","dragY","dragModel","dragEventTarget","headerHeight","isTarget","targetMarkerTemplate","targetMarkerContext","column","sortType","sorts","selectionType","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","resize","longPressStart","longPressEnd","sort","select","columnContextmenu",4,"ngFor","ngForOf","ngForTrackBy"],["resizeable","","long-press","","draggable","",3,"resizeEnabled","pressModel","pressEnabled","dragX","dragY","dragModel","dragEventTarget","headerHeight","isTarget","targetMarkerTemplate","targetMarkerContext","column","sortType","sorts","selectionType","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","resize","longPressStart","longPressEnd","sort","select","columnContextmenu"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.gc("reorder",(function(e){return t.onColumnReordered(e)}))("targetChanged",(function(e){return t.onTargetChanged(e)})),i.Mc(1,w,2,5,"div",1),i.Rb()),2&e&&(i.Kc("width",t._columnGroupWidths.total,"px"),i.yb(1),i.pc("ngForOf",t._columnsByPin)("ngForTrackBy",t.trackByGroups))},directives:function(){return[pe,r.q,r.s,dt,fe,me,he]},encapsulation:2,changeDetection:0}),e})();function st(e,t,n){let i,r,s;n=n||{};let o=null,a=0;function c(){a=!1===n.leading?0:+new Date,o=null,s=e.apply(i,r)}return function(){const l=+new Date;a||!1!==n.leading||(a=l);const u=t-(l-a);return i=this,r=arguments,u<=0?(clearTimeout(o),o=null,a=l,s=e.apply(i,r)):o||!1===n.trailing||(o=setTimeout(c,u)),s}}function ot(e,t){for(const n of t){const t=e.indexOf(n);e.splice(t,1)}}function at(e,t=300){let n=0;for(const i of e)n+=i.width||t;return n}var ct=function(e){return e.asc="asc",e.desc="desc",e}({});function lt(e,t){if(null==e&&(e=0),null==t&&(t=0),e instanceof Date&&t instanceof Date){if(e<t)return-1;if(e>t)return 1}else if(isNaN(parseFloat(e))||!isFinite(e)||isNaN(parseFloat(t))||!isFinite(t)){if(e=String(e),t=String(t),e.toLowerCase()<t.toLowerCase())return-1;if(e.toLowerCase()>t.toLowerCase())return 1}else{if(parseFloat(e)<parseFloat(t))return-1;if(parseFloat(e)>parseFloat(t))return 1}return 0}let ut=(()=>{class e{constructor(e,t,n,r,s,o,c){this.scrollbarHelper=e,this.dimensionsHelper=t,this.cd=n,this.columnChangesService=o,this.configuration=c,this.selected=[],this.scrollbarV=!1,this.scrollbarH=!1,this.rowHeight=30,this.columnMode=Re.standard,this.headerHeight=30,this.footerHeight=0,this.externalPaging=!1,this.externalSorting=!1,this.loadingIndicator=!1,this.reorderable=!0,this.swapColumns=!0,this.sortType=Ee.single,this.sorts=[],this.cssClasses={sortAscending:"datatable-icon-up",sortDescending:"datatable-icon-down",sortUnset:"datatable-icon-sort-unset",pagerLeftArrow:"datatable-icon-left",pagerRightArrow:"datatable-icon-right",pagerPrevious:"datatable-icon-prev",pagerNext:"datatable-icon-skip"},this.messages={emptyMessage:"No data to display",totalMessage:"total",selectedMessage:"selected"},this.groupExpansionDefault=!1,this.selectAllRowsOnPage=!1,this.virtualization=!0,this.summaryRow=!1,this.summaryHeight=30,this.summaryPosition="top",this.scroll=new i.o,this.activate=new i.o,this.select=new i.o,this.sort=new i.o,this.page=new i.o,this.reorder=new i.o,this.resize=new i.o,this.tableContextmenu=new i.o(!1),this.treeAction=new i.o,this.rowCount=0,this._offsetX=new a.a(0),this._count=0,this._offset=0,this._subscriptions=[],this.rowIdentity=e=>this._groupRowsBy?e.key:e,this.element=r.nativeElement,this.rowDiffer=s.find({}).create(),this.configuration&&this.configuration.messages&&(this.messages=Object.assign({},this.configuration.messages))}set rows(e){this._rows=e,e&&(this._internalRows=[...e]),this.externalSorting||this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.recalculate(),this._rows&&this._groupRowsBy&&(this.groupedRows=this.groupArrayBy(this._rows,this._groupRowsBy)),this.cd.markForCheck()}get rows(){return this._rows}set groupRowsBy(e){e&&(this._groupRowsBy=e,this._rows&&this._groupRowsBy&&(this.groupedRows=this.groupArrayBy(this._rows,this._groupRowsBy)))}get groupRowsBy(){return this._groupRowsBy}set columns(e){e&&(this._internalColumns=[...e],Ce(this._internalColumns),this.recalculateColumns()),this._columns=e}get columns(){return this._columns}set limit(e){this._limit=e,this.recalculate()}get limit(){return this._limit}set count(e){this._count=e,this.recalculate()}get count(){return this._count}set offset(e){this._offset=e}get offset(){return Math.max(Math.min(this._offset,Math.ceil(this.rowCount/this.pageSize)-1),0)}get isFixedHeader(){const e=this.headerHeight;return"string"!=typeof e||"auto"!==e}get isFixedRow(){return"auto"!==this.rowHeight}get isVertScroll(){return this.scrollbarV}get isVirtualized(){return this.virtualization}get isHorScroll(){return this.scrollbarH}get isSelectable(){return void 0!==this.selectionType}get isCheckboxSelection(){return this.selectionType===Le.checkbox}get isCellSelection(){return this.selectionType===Le.cell}get isSingleSelection(){return this.selectionType===Le.single}get isMultiSelection(){return this.selectionType===Le.multi}get isMultiClickSelection(){return this.selectionType===Le.multiClick}set columnTemplates(e){this._columnTemplates=e,this.translateColumns(e)}get columnTemplates(){return this._columnTemplates}get allRowsSelected(){let e=this.rows&&this.selected&&this.selected.length===this.rows.length;if(this.bodyComponent&&this.selectAllRowsOnPage){const t=this.bodyComponent.indexes;e=this.selected.length===t.last-t.first}return this.selected&&this.rows&&0!==this.rows.length&&e}ngOnInit(){this.recalculate()}ngAfterViewInit(){this.externalSorting||this.sortInternalRows(),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(()=>{this.recalculate(),this.externalPaging&&this.scrollbarV&&this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:0})})}ngAfterContentInit(){this.columnTemplates.changes.subscribe(e=>this.translateColumns(e)),this.listenForColumnInputChanges()}translateColumns(e){if(e){const t=e.toArray();t.length&&(this._internalColumns=function(e){const t=[];for(const n of e){const e={},i=Object.getOwnPropertyNames(n);for(const t of i)e[t]=n[t];n.headerTemplate&&(e.headerTemplate=n.headerTemplate),n.cellTemplate&&(e.cellTemplate=n.cellTemplate),n.summaryFunc&&(e.summaryFunc=n.summaryFunc),n.summaryTemplate&&(e.summaryTemplate=n.summaryTemplate),t.push(e)}return t}(t),Ce(this._internalColumns),this.recalculateColumns(),this.sortInternalRows(),this.cd.markForCheck())}}groupArrayBy(e,t){const n=new Map;return e.forEach(e=>{const i=e[t];n.has(i)?n.get(i).push(e):n.set(i,[e])}),Array.from(n,e=>({key:e[0],value:e[1]}))}ngDoCheck(){this.rowDiffer.diff(this.rows)&&(this.externalSorting?this._internalRows=[...this.rows]:this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.recalculatePages(),this.cd.markForCheck())}recalculate(){this.recalculateDims(),this.recalculateColumns(),this.cd.markForCheck()}onWindowResize(){this.recalculate()}recalculateColumns(e=this._internalColumns,t=-1,n=this.scrollbarH){if(!e)return;let i=this._innerWidth;return this.scrollbarV&&(i-=this.scrollbarHelper.width),this.columnMode===Re.force?function(e,t,n,i,r=300){const s=e.slice(n+1,e.length).filter(e=>!1!==e.canAutoResize);for(const d of s)d.$$oldWidth||(d.$$oldWidth=d.width);let o=0,a=!1,c=at(e,r),l=t-c;const u=[];do{o=l/s.length,a=c>=t;for(const e of s){if(a&&i)e.width=e.$$oldWidth||e.width||r;else{const t=(e.width||r)+o;e.minWidth&&t<e.minWidth?(e.width=e.minWidth,u.push(e)):e.maxWidth&&t>e.maxWidth?(e.width=e.maxWidth,u.push(e)):e.width=t}e.width=Math.max(0,e.width)}c=at(e),l=t-c,ot(s,u)}while(l>1&&0!==s.length)}(e,i,t,n):this.columnMode===Re.flex&&function(e,t){const n=function(e,t){let n=0;for(const i of e)n+=i.width;return n}(e),i=function(e){let t=0;for(const n of e)t+=n.flexGrow||0;return t}(e),r=$e(e);n!==t&&function(e,t,n){for(const s in e)for(const i of e[s])i.canAutoResize?i.width=0:(t-=i.width,n-=i.flexGrow?i.flexGrow:0);const i={};let r=t;do{const t=r/n;r=0;for(const n in e)for(const s of e[n])if(s.canAutoResize&&!i[s.prop]){const e=s.width+s.flexGrow*t;void 0!==s.minWidth&&e<s.minWidth?(r+=e-s.minWidth,s.width=s.minWidth,i[s.prop]=!0):s.width=e}}while(0!==r)}(r,t,i)}(e,i),e}recalculateDims(){const e=this.dimensionsHelper.getDimensions(this.element);if(this._innerWidth=Math.floor(e.width),this.scrollbarV){let t=e.height;this.headerHeight&&(t-=this.headerHeight),this.footerHeight&&(t-=this.footerHeight),this.bodyHeight=t}this.recalculatePages()}recalculatePages(){this.pageSize=this.calcPageSize(),this.rowCount=this.calcRowCount()}onBodyPage({offset:e}){this.externalPaging&&!this.virtualization||(this.offset=e,this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset}))}onBodyScroll(e){this._offsetX.next(e.offsetX),this.scroll.emit(e),this.cd.detectChanges()}onFooterPage(e){this.offset=e.page-1,this.bodyComponent.updateOffsetY(this.offset),this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset}),this.selectAllRowsOnPage&&(this.selected=[],this.select.emit({selected:this.selected}))}calcPageSize(e=this.rows){if(this.scrollbarV&&this.virtualization){const e=Math.ceil(this.bodyHeight/this.rowHeight);return Math.max(e,0)}return void 0!==this.limit?this.limit:e?e.length:0}calcRowCount(e=this.rows){return this.externalPaging?this.count:e?this.groupedRows?this.groupedRows.length:null!=this.treeFromRelation&&null!=this.treeToRelation?this._internalRows.length:e.length:0}onColumnContextmenu({event:e,column:t}){this.tableContextmenu.emit({event:e,type:Ae.header,content:t})}onRowContextmenu({event:e,row:t}){this.tableContextmenu.emit({event:e,type:Ae.body,content:t})}onColumnResize({column:e,newValue:t}){if(void 0===e)return;let n;const i=this._internalColumns.map((i,r)=>((i=Object.assign({},i)).$$id===e.$$id&&(n=r,i.width=t,i.$$oldWidth=t),i));this.recalculateColumns(i,n),this._internalColumns=i,this.resize.emit({column:e,newValue:t})}onColumnReorder({column:e,newValue:t,prevValue:n}){const i=this._internalColumns.map(e=>Object.assign({},e));if(this.swapColumns){const r=i[t];i[t]=e,i[n]=r}else if(t>n){const e=i[n];for(let r=n;r<t;r++)i[r]=i[r+1];i[t]=e}else{const e=i[n];for(let r=n;r>t;r--)i[r]=i[r-1];i[t]=e}this._internalColumns=i,this.reorder.emit({column:e,newValue:t,prevValue:n})}onColumnSort(e){this.selectAllRowsOnPage&&(this.selected=[],this.select.emit({selected:this.selected})),this.sorts=e.sorts,!1===this.externalSorting&&this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.offset=0,this.bodyComponent.updateOffsetY(this.offset),this.sort.emit(e)}onHeaderSelect(e){if(this.bodyComponent&&this.selectAllRowsOnPage){const e=this.bodyComponent.indexes.first,t=this.bodyComponent.indexes.last,n=this.selected.length===t-e;this.selected=[],n||this.selected.push(...this._internalRows.slice(e,t))}else{const e=this.selected.length===this.rows.length;this.selected=[],e||this.selected.push(...this.rows)}this.select.emit({selected:this.selected})}onBodySelect(e){this.select.emit(e)}onTreeAction(e){const t=e.row,n=this._rows.findIndex(t=>t[this.treeToRelation]===e.row[this.treeToRelation]);this.treeAction.emit({row:t,rowIndex:n})}ngOnDestroy(){this._subscriptions.forEach(e=>e.unsubscribe())}listenForColumnInputChanges(){this._subscriptions.push(this.columnChangesService.columnInputChanges$.subscribe(()=>{this.columnTemplates&&this.columnTemplates.notifyOnChanges()}))}sortInternalRows(){this._internalRows=function(e,t,n){if(!e)return[];if(!n||!n.length||!t)return[...e];const i=new Map;e.forEach((e,t)=>i.set(e,t));const r=[...e],s=t.reduce((e,t)=>(t.comparator&&"function"==typeof t.comparator&&(e[t.prop]=t.comparator),e),{}),o=n.map(e=>{const t=e.prop;return{prop:t,dir:e.dir,valueGetter:ve(t),compareFn:s[t]||lt}});return r.sort((function(e,t){for(const n of o){const{prop:i,valueGetter:r}=n,s=r(e,i),o=r(t,i),a=n.dir!==ct.desc?n.compareFn(s,o,e,t,n.dir):-n.compareFn(s,o,e,t,n.dir);if(0!==a)return a}return i.has(e)&&i.has(t)?i.get(e)<i.get(t)?-1:1:0}))}(this._internalRows,this._internalColumns,this.sorts)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(ae,4),i.Mb(ce,4),i.Mb(i.h),i.Mb(i.m),i.Mb(i.u),i.Mb(le),i.Mb("configuration",8))},e.\u0275cmp=i.Gb({type:e,selectors:[["ngx-datatable"]],contentQueries:function(e,t,n){var r;1&e&&(i.Fb(n,Ye,!0),i.Fb(n,_e,!0),i.Fb(n,ze,!0),i.Fb(n,Ne,!1)),2&e&&(i.zc(r=i.hc())&&(t.rowDetail=r.first),i.zc(r=i.hc())&&(t.groupHeader=r.first),i.zc(r=i.hc())&&(t.footer=r.first),i.zc(r=i.hc())&&(t.columnTemplates=r))},viewQuery:function(e,t){var n;1&e&&(i.Tc(it,!0),i.Tc(rt,!0)),2&e&&(i.zc(n=i.hc())&&(t.bodyComponent=n.first),i.zc(n=i.hc())&&(t.headerComponent=n.first))},hostAttrs:[1,"ngx-datatable"],hostVars:22,hostBindings:function(e,t){1&e&&i.gc("resize",(function(){return t.onWindowResize()}),!1,i.Cc),2&e&&i.Eb("fixed-header",t.isFixedHeader)("fixed-row",t.isFixedRow)("scroll-vertical",t.isVertScroll)("virtualized",t.isVirtualized)("scroll-horz",t.isHorScroll)("selectable",t.isSelectable)("checkbox-selection",t.isCheckboxSelection)("cell-selection",t.isCellSelection)("single-selection",t.isSingleSelection)("multi-selection",t.isMultiSelection)("multi-click-selection",t.isMultiClickSelection)},inputs:{selected:"selected",scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",rowHeight:"rowHeight",columnMode:"columnMode",headerHeight:"headerHeight",footerHeight:"footerHeight",externalPaging:"externalPaging",externalSorting:"externalSorting",loadingIndicator:"loadingIndicator",reorderable:"reorderable",swapColumns:"swapColumns",sortType:"sortType",sorts:"sorts",cssClasses:"cssClasses",messages:"messages",groupExpansionDefault:"groupExpansionDefault",selectAllRowsOnPage:"selectAllRowsOnPage",virtualization:"virtualization",summaryRow:"summaryRow",summaryHeight:"summaryHeight",summaryPosition:"summaryPosition",rowIdentity:"rowIdentity",rows:"rows",groupedRows:"groupedRows",groupRowsBy:"groupRowsBy",columns:"columns",limit:"limit",count:"count",offset:"offset",targetMarkerTemplate:"targetMarkerTemplate",selectionType:"selectionType",rowClass:"rowClass",selectCheck:"selectCheck",displayCheck:"displayCheck",trackByProp:"trackByProp",treeFromRelation:"treeFromRelation",treeToRelation:"treeToRelation"},outputs:{scroll:"scroll",activate:"activate",select:"select",sort:"sort",page:"page",reorder:"reorder",resize:"resize",tableContextmenu:"tableContextmenu",treeAction:"treeAction"},decls:5,vars:34,consts:[["visibilityObserver","",3,"visible"],[3,"sorts","sortType","scrollbarH","innerWidth","offsetX","dealsWithGroup","columns","headerHeight","reorderable","targetMarkerTemplate","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","selectionType","sort","resize","reorder","select","columnContextmenu",4,"ngIf"],[3,"groupRowsBy","groupedRows","rows","groupExpansionDefault","scrollbarV","scrollbarH","virtualization","loadingIndicator","externalPaging","rowHeight","rowCount","offset","trackByProp","columns","pageSize","offsetX","rowDetail","groupHeader","selected","innerWidth","bodyHeight","selectionType","emptyMessage","rowIdentity","rowClass","selectCheck","displayCheck","summaryRow","summaryHeight","summaryPosition","page","activate","rowContextmenu","select","scroll","treeAction"],[3,"rowCount","pageSize","offset","footerHeight","footerTemplate","totalMessage","pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","selectedCount","selectedMessage","pagerNextIcon","page",4,"ngIf"],[3,"sorts","sortType","scrollbarH","innerWidth","offsetX","dealsWithGroup","columns","headerHeight","reorderable","targetMarkerTemplate","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","selectionType","sort","resize","reorder","select","columnContextmenu"],[3,"rowCount","pageSize","offset","footerHeight","footerTemplate","totalMessage","pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","selectedCount","selectedMessage","pagerNextIcon","page"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.gc("visible",(function(){return t.recalculate()})),i.Mc(1,S,2,17,"datatable-header",1),i.Sb(2,"datatable-body",2),i.gc("page",(function(e){return t.onBodyPage(e)}))("activate",(function(e){return t.activate.emit(e)}))("rowContextmenu",(function(e){return t.onRowContextmenu(e)}))("select",(function(e){return t.onBodySelect(e)}))("scroll",(function(e){return t.onBodyScroll(e)}))("treeAction",(function(e){return t.onTreeAction(e)})),i.jc(3,"async"),i.Rb(),i.Mc(4,M,1,12,"datatable-footer",3),i.Rb()),2&e&&(i.yb(1),i.pc("ngIf",t.headerHeight),i.yb(1),i.pc("groupRowsBy",t.groupRowsBy)("groupedRows",t.groupedRows)("rows",t._internalRows)("groupExpansionDefault",t.groupExpansionDefault)("scrollbarV",t.scrollbarV)("scrollbarH",t.scrollbarH)("virtualization",t.virtualization)("loadingIndicator",t.loadingIndicator)("externalPaging",t.externalPaging)("rowHeight",t.rowHeight)("rowCount",t.rowCount)("offset",t.offset)("trackByProp",t.trackByProp)("columns",t._internalColumns)("pageSize",t.pageSize)("offsetX",i.kc(3,32,t._offsetX))("rowDetail",t.rowDetail)("groupHeader",t.groupHeader)("selected",t.selected)("innerWidth",t._innerWidth)("bodyHeight",t.bodyHeight)("selectionType",t.selectionType)("emptyMessage",t.messages.emptyMessage)("rowIdentity",t.rowIdentity)("rowClass",t.rowClass)("selectCheck",t.selectCheck)("displayCheck",t.displayCheck)("summaryRow",t.summaryRow)("summaryHeight",t.summaryHeight)("summaryPosition",t.summaryPosition),i.yb(2),i.pc("ngIf",t.footerHeight))},directives:function(){return[de,r.r,it,rt,ht]},pipes:function(){return[r.b]},styles:[".ngx-datatable{display:block;justify-content:center;overflow:hidden;position:relative;transform:translateZ(0)}.ngx-datatable [hidden]{display:none!important}.ngx-datatable *,.ngx-datatable :after,.ngx-datatable :before{box-sizing:border-box}.ngx-datatable.scroll-vertical .datatable-body{overflow-y:auto}.ngx-datatable.scroll-vertical.virtualized .datatable-body .datatable-row-wrapper{position:absolute}.ngx-datatable.scroll-horz .datatable-body{-webkit-overflow-scrolling:touch;overflow-x:auto}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner{white-space:nowrap}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-datatable.fixed-row .datatable-scroll,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row{white-space:nowrap}.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-cell,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-group-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-datatable .datatable-body-row,.ngx-datatable .datatable-header-inner,.ngx-datatable .datatable-row-center{-o-flex-flow:row;display:flex;flex-direction:row;flex-flow:row}.ngx-datatable .datatable-body-cell,.ngx-datatable .datatable-header-cell{display:inline-block;line-height:1.625;overflow-x:hidden;vertical-align:top}.ngx-datatable .datatable-body-cell:focus,.ngx-datatable .datatable-header-cell:focus{outline:none}.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-row-right{z-index:9}.ngx-datatable .datatable-row-center,.ngx-datatable .datatable-row-group,.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-row-right{position:relative}.ngx-datatable .datatable-header{display:block;overflow:hidden}.ngx-datatable .datatable-header .datatable-header-inner{-webkit-align-items:stretch;align-items:stretch}.ngx-datatable .datatable-header .datatable-header-cell{display:inline-block;position:relative}.ngx-datatable .datatable-header .datatable-header-cell.sortable .datatable-header-cell-wrapper{cursor:pointer}.ngx-datatable .datatable-header .datatable-header-cell.longpress .datatable-header-cell-wrapper{cursor:move}.ngx-datatable .datatable-header .datatable-header-cell .sort-btn{cursor:pointer;display:inline-block;line-height:100%;vertical-align:middle}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell .resize-handle--not-resizable{bottom:0;display:inline-block;padding:0 4px;position:absolute;right:0;top:0;visibility:hidden;width:5px}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle{cursor:ew-resize}.ngx-datatable .datatable-header .datatable-header-cell.resizeable:hover .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell:hover .resize-handle--not-resizable{visibility:visible}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker{bottom:0;position:absolute;top:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromLeft{right:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromRight{left:0}.ngx-datatable .datatable-header .datatable-header-cell .datatable-header-cell-template-wrap{height:inherit}.ngx-datatable .datatable-body{display:block;position:relative;z-index:10}.ngx-datatable .datatable-body .datatable-scroll{display:inline-block}.ngx-datatable .datatable-body .datatable-row-detail{overflow-y:hidden}.ngx-datatable .datatable-body .datatable-row-wrapper{display:flex;flex-direction:column}.ngx-datatable .datatable-body .datatable-body-row{outline:none}.ngx-datatable .datatable-body .datatable-body-row>div{display:flex}.ngx-datatable .datatable-footer{display:block;overflow:auto;width:100%}.ngx-datatable .datatable-footer .datatable-footer-inner{align-items:center;display:flex;width:100%}.ngx-datatable .datatable-footer .selected-count .page-count{flex:1 1 40%}.ngx-datatable .datatable-footer .selected-count .datatable-pager{flex:1 1 60%}.ngx-datatable .datatable-footer .page-count{flex:1 1 20%}.ngx-datatable .datatable-footer .datatable-pager{flex:1 1 80%;text-align:right}.ngx-datatable .datatable-footer .datatable-pager .pager,.ngx-datatable .datatable-footer .datatable-pager .pager li{display:inline-block;list-style:none;margin:0;padding:0}.ngx-datatable .datatable-footer .datatable-pager .pager li,.ngx-datatable .datatable-footer .datatable-pager .pager li a{outline:none}.ngx-datatable .datatable-footer .datatable-pager .pager li a{cursor:pointer;display:inline-block}.ngx-datatable .datatable-footer .datatable-pager .pager li.disabled a{cursor:not-allowed}"],encapsulation:2,changeDetection:0}),Object(l.b)([function(e,t,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:st(n.value,5,void 0)}),this[t]}}}],e.prototype,"onWindowResize",null),e})(),dt=(()=>{class e{constructor(e){this.cd=e,this.sort=new i.o,this.select=new i.o,this.columnContextmenu=new i.o(!1),this.sortFn=this.onSort.bind(this),this.selectFn=this.select.emit.bind(this.select),this.cellContext={column:this.column,sortDir:this.sortDir,sortFn:this.sortFn,allRowsSelected:this.allRowsSelected,selectFn:this.selectFn}}set allRowsSelected(e){this._allRowsSelected=e,this.cellContext.allRowsSelected=e}get allRowsSelected(){return this._allRowsSelected}set column(e){this._column=e,this.cellContext.column=e,this.cd.markForCheck()}get column(){return this._column}set sorts(e){this._sorts=e,this.sortDir=this.calcSortDir(e),this.cellContext.sortDir=this.sortDir,this.sortClass=this.calcSortClass(this.sortDir),this.cd.markForCheck()}get sorts(){return this._sorts}get columnCssClasses(){let e="datatable-header-cell";if(this.column.sortable&&(e+=" sortable"),this.column.resizeable&&(e+=" resizeable"),this.column.headerClass)if("string"==typeof this.column.headerClass)e+=" "+this.column.headerClass;else if("function"==typeof this.column.headerClass){const t=this.column.headerClass({column:this.column});if("string"==typeof t)e+=t;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=" "+i)}}const t=this.sortDir;return t&&(e+=" sort-active sort-"+t),e}get name(){return void 0===this.column.headerTemplate?this.column.name:void 0}get minWidth(){return this.column.minWidth}get maxWidth(){return this.column.maxWidth}get width(){return this.column.width}get isCheckboxable(){return this.column.checkboxable&&this.column.headerCheckboxable&&this.selectionType===Le.checkbox}onContextmenu(e){this.columnContextmenu.emit({event:e,column:this.column})}ngOnInit(){this.sortClass=this.calcSortClass(this.sortDir)}calcSortDir(e){if(e&&this.column){const t=e.find(e=>e.prop===this.column.prop);if(t)return t.dir}}onSort(){if(!this.column.sortable)return;const e=(t=this.sortDir,this.sortType===Ee.single?t===ct.asc?ct.desc:ct.asc:t?t===ct.asc?ct.desc:void 0:ct.asc);var t;this.sort.emit({column:this.column,prevValue:this.sortDir,newValue:e})}calcSortClass(e){if(this.cellContext.column.sortable)return e===ct.asc?"sort-btn sort-asc "+this.sortAscendingIcon:e===ct.desc?"sort-btn sort-desc "+this.sortDescendingIcon:"sort-btn "+this.sortUnsetIcon}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-header-cell"]],hostAttrs:[1,"datatable-header-cell"],hostVars:11,hostBindings:function(e,t){1&e&&i.gc("contextmenu",(function(e){return t.onContextmenu(e)})),2&e&&(i.zb("title",t.name),i.Ab(t.columnCssClasses),i.Kc("min-width",t.minWidth,"px")("max-width",t.maxWidth,"px")("width",t.width,"px")("height",t.headerHeight,"px"))},inputs:{allRowsSelected:"allRowsSelected",column:"column",sorts:"sorts",sortType:"sortType",sortAscendingIcon:"sortAscendingIcon",sortDescendingIcon:"sortDescendingIcon",sortUnsetIcon:"sortUnsetIcon",isTarget:"isTarget",targetMarkerTemplate:"targetMarkerTemplate",targetMarkerContext:"targetMarkerContext",selectionType:"selectionType",headerHeight:"headerHeight"},outputs:{sort:"sort",select:"select",columnContextmenu:"columnContextmenu"},decls:6,vars:6,consts:[[1,"datatable-header-cell-template-wrap"],[4,"ngIf"],["class","datatable-checkbox",4,"ngIf"],["class","datatable-header-cell-wrapper",4,"ngIf"],[3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"datatable-checkbox"],["type","checkbox",3,"checked","change"],[1,"datatable-header-cell-wrapper"],[1,"datatable-header-cell-label","draggable",3,"innerHTML","click"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Mc(1,k,1,2,void 0,1),i.Mc(2,D,2,1,"label",2),i.Mc(3,T,2,1,"span",3),i.Mc(4,O,1,2,void 0,1),i.Sb(5,"span",4),i.gc("click",(function(){return t.onSort()})),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.pc("ngIf",t.isTarget),i.yb(1),i.pc("ngIf",t.isCheckboxable),i.yb(1),i.pc("ngIf",!t.column.headerTemplate),i.yb(1),i.pc("ngIf",t.column.headerTemplate),i.yb(1),i.Ab(t.sortClass))},directives:[r.r,r.w],encapsulation:2,changeDetection:0}),e})(),ht=(()=>{class e{constructor(){this.selectedCount=0,this.page=new i.o}get isVisible(){return this.rowCount/this.pageSize>1}get curPage(){return this.offset+1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-footer"]],hostAttrs:[1,"datatable-footer"],inputs:{selectedCount:"selectedCount",footerHeight:"footerHeight",rowCount:"rowCount",pageSize:"pageSize",offset:"offset",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon",totalMessage:"totalMessage",footerTemplate:"footerTemplate",selectedMessage:"selectedMessage"},outputs:{page:"page"},decls:4,vars:8,consts:[[1,"datatable-footer-inner",3,"ngClass"],[4,"ngIf"],["class","page-count",4,"ngIf"],[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"page-count"],[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Mc(1,E,1,8,void 0,1),i.Mc(2,I,3,3,"div",2),i.Mc(3,P,1,8,"datatable-pager",3),i.Rb()),2&e&&(i.Kc("height",t.footerHeight,"px"),i.pc("ngClass",i.uc(6,j,t.selectedMessage)),i.yb(1),i.pc("ngIf",t.footerTemplate),i.yb(1),i.pc("ngIf",!t.footerTemplate),i.yb(1),i.pc("ngIf",!t.footerTemplate))},directives:function(){return[r.p,r.r,r.w,ft]},encapsulation:2,changeDetection:0}),e})(),ft=(()=>{class e{constructor(){this.change=new i.o,this._count=0,this._page=1,this._size=0}set size(e){this._size=e,this.pages=this.calcPages()}get size(){return this._size}set count(e){this._count=e,this.pages=this.calcPages()}get count(){return this._count}set page(e){this._page=e,this.pages=this.calcPages()}get page(){return this._page}get totalPages(){const e=this.size<1?1:Math.ceil(this.count/this.size);return Math.max(e||0,1)}canPrevious(){return this.page>1}canNext(){return this.page<this.totalPages}prevPage(){this.selectPage(this.page-1)}nextPage(){this.selectPage(this.page+1)}selectPage(e){e>0&&e<=this.totalPages&&e!==this.page&&(this.page=e,this.change.emit({page:e}))}calcPages(e){const t=[];let n=1,i=this.totalPages;e=e||this.page,5<this.totalPages&&(n=e-Math.floor(2.5),i=e+Math.floor(2.5),n<1?(n=1,i=Math.min(n+5-1,this.totalPages)):i>this.totalPages&&(n=Math.max(this.totalPages-5+1,1),i=this.totalPages));for(let r=n;r<=i;r++)t.push({number:r,text:r});return t}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-pager"]],hostAttrs:[1,"datatable-pager"],inputs:{size:"size",count:"count",page:"page",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon"},outputs:{change:"change"},decls:14,vars:21,consts:[[1,"pager"],["role","button","aria-label","go to first page","href","javascript:void(0)",3,"click"],["role","button","aria-label","go to previous page","href","javascript:void(0)",3,"click"],["role","button","class","pages",3,"active",4,"ngFor","ngForOf"],["role","button","aria-label","go to next page","href","javascript:void(0)",3,"click"],["role","button","aria-label","go to last page","href","javascript:void(0)",3,"click"],["role","button",1,"pages"],["href","javascript:void(0)",3,"click"]],template:function(e,t){1&e&&(i.Sb(0,"ul",0),i.Sb(1,"li"),i.Sb(2,"a",1),i.gc("click",(function(){return t.selectPage(1)})),i.Nb(3,"i"),i.Rb(),i.Rb(),i.Sb(4,"li"),i.Sb(5,"a",2),i.gc("click",(function(){return t.prevPage()})),i.Nb(6,"i"),i.Rb(),i.Rb(),i.Mc(7,N,3,4,"li",3),i.Sb(8,"li"),i.Sb(9,"a",4),i.gc("click",(function(){return t.nextPage()})),i.Nb(10,"i"),i.Rb(),i.Rb(),i.Sb(11,"li"),i.Sb(12,"a",5),i.gc("click",(function(){return t.selectPage(t.totalPages)})),i.Nb(13,"i"),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.Eb("disabled",!t.canPrevious()),i.yb(2),i.Ab(t.pagerPreviousIcon),i.yb(1),i.Eb("disabled",!t.canPrevious()),i.yb(2),i.Ab(t.pagerLeftArrowIcon),i.yb(1),i.pc("ngForOf",t.pages),i.yb(1),i.Eb("disabled",!t.canNext()),i.yb(2),i.Ab(t.pagerRightArrowIcon),i.yb(1),i.Eb("disabled",!t.canNext()),i.yb(2),i.Ab(t.pagerNextIcon))},directives:[r.q],encapsulation:2,changeDetection:0}),e})(),pt=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-progress"]],decls:3,vars:0,consts:[["role","progressbar",1,"progress-linear"],[1,"container"],[1,"bar"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Nb(2,"div",2),i.Rb(),i.Rb())},encapsulation:2,changeDetection:0}),e})();var mt=function(e){return e[e.up=38]="up",e[e.down=40]="down",e[e.return=13]="return",e[e.escape=27]="escape",e[e.left=37]="left",e[e.right=39]="right",e}({});let bt=(()=>{class e{constructor(e,t,n,r){this.differs=e,this.scrollbarHelper=t,this.cd=n,this.treeStatus="collapsed",this.activate=new i.o,this.treeAction=new i.o,this._groupStyles={left:{},center:{},right:{}},this._element=r.nativeElement,this._rowDiffer=e.find({}).create()}set columns(e){this._columns=e,this.recalculateColumns(e),this.buildStylesByGroup()}get columns(){return this._columns}set innerWidth(e){if(this._columns){const e=$e(this._columns);this._columnGroupWidths=He(e,this._columns)}this._innerWidth=e,this.recalculateColumns(),this.buildStylesByGroup()}get innerWidth(){return this._innerWidth}set offsetX(e){this._offsetX=e,this.buildStylesByGroup()}get offsetX(){return this._offsetX}get cssClass(){let e="datatable-body-row";if(this.isSelected&&(e+=" active"),this.rowIndex%2!=0&&(e+=" datatable-row-odd"),this.rowIndex%2==0&&(e+=" datatable-row-even"),this.rowClass){const t=this.rowClass(this.row);if("string"==typeof t)e+=" "+t;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=" "+i)}}return e}get columnsTotalWidths(){return this._columnGroupWidths.total}ngDoCheck(){this._rowDiffer.diff(this.row)&&this.cd.markForCheck()}trackByGroups(e,t){return t.type}columnTrackingFn(e,t){return t.$$id}buildStylesByGroup(){this._groupStyles.left=this.calcStylesByGroup("left"),this._groupStyles.center=this.calcStylesByGroup("center"),this._groupStyles.right=this.calcStylesByGroup("right"),this.cd.markForCheck()}calcStylesByGroup(e){const t=this._columnGroupWidths,n=this.offsetX,i={width:t[e]+"px"};if("left"===e)nt(i,n,0);else if("right"===e){const e=parseInt(this.innerWidth+"",0);nt(i,-1*(t.total-e-n+this.scrollbarHelper.width),0)}return i}onActivate(e,t){e.cellIndex=t,e.rowElement=this._element,this.activate.emit(e)}onKeyDown(e){const t=e.keyCode;(t===mt.return||t===mt.down||t===mt.up||t===mt.left||t===mt.right)&&e.target===this._element&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,rowElement:this._element}))}onMouseenter(e){this.activate.emit({type:"mouseenter",event:e,row:this.row,rowElement:this._element})}recalculateColumns(e=this.columns){this._columns=e;const t=$e(this._columns);this._columnsByPin=Ve(this._columns),this._columnGroupWidths=He(t,this._columns)}onTreeAction(){this.treeAction.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.u),i.Mb(ae,4),i.Mb(i.h),i.Mb(i.m))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-body-row"]],hostVars:6,hostBindings:function(e,t){1&e&&i.gc("keydown",(function(e){return t.onKeyDown(e)}))("mouseenter",(function(e){return t.onMouseenter(e)})),2&e&&(i.Ab(t.cssClass),i.Kc("width",t.columnsTotalWidths,"px")("height",t.rowHeight,"px"))},inputs:{treeStatus:"treeStatus",columns:"columns",innerWidth:"innerWidth",offsetX:"offsetX",expanded:"expanded",rowClass:"rowClass",row:"row",group:"group",isSelected:"isSelected",rowIndex:"rowIndex",displayCheck:"displayCheck",rowHeight:"rowHeight"},outputs:{activate:"activate",treeAction:"treeAction"},decls:1,vars:2,consts:[[3,"class","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["tabindex","-1",3,"row","group","expanded","isSelected","rowIndex","column","rowHeight","displayCheck","treeStatus","activate","treeAction",4,"ngFor","ngForOf","ngForTrackBy"],["tabindex","-1",3,"row","group","expanded","isSelected","rowIndex","column","rowHeight","displayCheck","treeStatus","activate","treeAction"]],template:function(e,t){1&e&&i.Mc(0,Y,2,6,"div",0),2&e&&i.pc("ngForOf",t._columnsByPin)("ngForTrackBy",t.trackByGroups)},directives:function(){return[r.q,r.s,_t]},encapsulation:2,changeDetection:0}),e})(),gt=(()=>{class e{constructor(e,t){this.cd=e,this.differs=t,this.rowContextmenu=new i.o(!1),this.groupContext={group:this.row,expanded:this.expanded,rowIndex:this.rowIndex},this.rowContext={row:this.row,expanded:this.expanded,rowIndex:this.rowIndex},this._expanded=!1,this.rowDiffer=t.find({}).create()}set rowIndex(e){this._rowIndex=e,this.rowContext.rowIndex=e,this.groupContext.rowIndex=e,this.cd.markForCheck()}get rowIndex(){return this._rowIndex}set expanded(e){this._expanded=e,this.groupContext.expanded=e,this.rowContext.expanded=e,this.cd.markForCheck()}get expanded(){return this._expanded}ngDoCheck(){this.rowDiffer.diff(this.row)&&(this.rowContext.row=this.row,this.groupContext.group=this.row,this.cd.markForCheck())}onContextmenu(e){this.rowContextmenu.emit({event:e,row:this.row})}getGroupHeaderStyle(){const e={};return e.transform="translate3d("+this.offsetX+"px, 0px, 0px)",e["backface-visibility"]="hidden",e.width=this.innerWidth,e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.h),i.Mb(i.u))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-row-wrapper"]],hostAttrs:[1,"datatable-row-wrapper"],hostBindings:function(e,t){1&e&&i.gc("contextmenu",(function(e){return t.onContextmenu(e)}))},inputs:{rowIndex:"rowIndex",expanded:"expanded",innerWidth:"innerWidth",rowDetail:"rowDetail",groupHeader:"groupHeader",offsetX:"offsetX",detailRowHeight:"detailRowHeight",row:"row",groupedRows:"groupedRows"},outputs:{rowContextmenu:"rowContextmenu"},ngContentSelectors:u,decls:3,vars:3,consts:[["class","datatable-group-header",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","datatable-row-detail",3,"height",4,"ngIf"],[1,"datatable-group-header",3,"ngStyle"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"datatable-row-detail"]],template:function(e,t){1&e&&(i.oc(),i.Mc(0,H,2,2,"div",0),i.Mc(1,W,1,0,"ng-content",1),i.Mc(2,U,2,3,"div",2)),2&e&&(i.pc("ngIf",t.groupHeader&&t.groupHeader.template),i.yb(1),i.pc("ngIf",t.groupHeader&&t.groupHeader.template&&t.expanded||!t.groupHeader||!t.groupHeader.template),i.yb(1),i.pc("ngIf",t.rowDetail&&t.rowDetail.template&&t.expanded))},directives:[r.r,r.s,r.w],encapsulation:2,changeDetection:0}),e})(),_t=(()=>{class e{constructor(e,t){this.cd=t,this.activate=new i.o,this.treeAction=new i.o,this.isFocused=!1,this.onCheckboxChangeFn=this.onCheckboxChange.bind(this),this.activateFn=this.activate.emit.bind(this.activate),this.cellContext={onCheckboxChangeFn:this.onCheckboxChangeFn,activateFn:this.activateFn,row:this.row,group:this.group,value:this.value,column:this.column,rowHeight:this.rowHeight,isSelected:this.isSelected,rowIndex:this.rowIndex,treeStatus:this.treeStatus,onTreeAction:this.onTreeAction.bind(this)},this._element=e.nativeElement}set group(e){this._group=e,this.cellContext.group=e,this.checkValueUpdates(),this.cd.markForCheck()}get group(){return this._group}set rowHeight(e){this._rowHeight=e,this.cellContext.rowHeight=e,this.checkValueUpdates(),this.cd.markForCheck()}get rowHeight(){return this._rowHeight}set isSelected(e){this._isSelected=e,this.cellContext.isSelected=e,this.cd.markForCheck()}get isSelected(){return this._isSelected}set expanded(e){this._expanded=e,this.cellContext.expanded=e,this.cd.markForCheck()}get expanded(){return this._expanded}set rowIndex(e){this._rowIndex=e,this.cellContext.rowIndex=e,this.checkValueUpdates(),this.cd.markForCheck()}get rowIndex(){return this._rowIndex}set column(e){this._column=e,this.cellContext.column=e,this.checkValueUpdates(),this.cd.markForCheck()}get column(){return this._column}set row(e){this._row=e,this.cellContext.row=e,this.checkValueUpdates(),this.cd.markForCheck()}get row(){return this._row}set sorts(e){this._sorts=e,this.calcSortDir=this.calcSortDir(e)}get sorts(){return this._sorts}set treeStatus(e){this._treeStatus="collapsed"!==e&&"expanded"!==e&&"loading"!==e&&"disabled"!==e?"collapsed":e,this.cellContext.treeStatus=this._treeStatus,this.checkValueUpdates(),this.cd.markForCheck()}get treeStatus(){return this._treeStatus}get columnCssClasses(){let e="datatable-body-cell";if(this.column.cellClass)if("string"==typeof this.column.cellClass)e+=" "+this.column.cellClass;else if("function"==typeof this.column.cellClass){const t=this.column.cellClass({row:this.row,group:this.group,column:this.column,value:this.value,rowHeight:this.rowHeight});if("string"==typeof t)e+=" "+t;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=" "+i)}}return this.sortDir||(e+=" sort-active"),this.isFocused&&(e+=" active"),this.sortDir===ct.asc&&(e+=" sort-asc"),this.sortDir===ct.desc&&(e+=" sort-desc"),e}get width(){return this.column.width}get minWidth(){return this.column.minWidth}get maxWidth(){return this.column.maxWidth}get height(){const e=this.rowHeight;return isNaN(e)?e:e+"px"}ngDoCheck(){this.checkValueUpdates()}ngOnDestroy(){this.cellTemplate&&this.cellTemplate.clear()}checkValueUpdates(){let e="";if(this.row&&this.column){const t=this.column.$$valueGetter(this.row,this.column.prop),n=this.column.pipe;n?e=n.transform(t):void 0!==e&&(e=t)}else e="";this.value!==e&&(this.value=e,this.cellContext.value=e,this.sanitizedValue=null!=e?this.stripHtml(e):e,this.cd.markForCheck())}onFocus(){this.isFocused=!0}onBlur(){this.isFocused=!1}onClick(e){this.activate.emit({type:"click",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element})}onDblClick(e){this.activate.emit({type:"dblclick",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element})}onKeyDown(e){const t=e.keyCode;(t===mt.return||t===mt.down||t===mt.up||t===mt.left||t===mt.right)&&e.target===this._element&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element}))}onCheckboxChange(e){this.activate.emit({type:"checkbox",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element,treeStatus:"collapsed"})}calcSortDir(e){if(!e)return;const t=e.find(e=>e.prop===this.column.prop);return t?t.dir:void 0}stripHtml(e){return e.replace?e.replace(/<\/?[^>]+(>|$)/g,""):e}onTreeAction(){this.treeAction.emit(this.row)}calcLeftMargin(e,t){return e.isTreeColumn?t.level*(null!=e.treeLevelIndent?e.treeLevelIndent:50):0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.m),i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-body-cell"]],viewQuery:function(e,t){var n;1&e&&i.Jc(G,!0,i.P),2&e&&i.zc(n=i.hc())&&(t.cellTemplate=n.first)},hostVars:10,hostBindings:function(e,t){1&e&&i.gc("focus",(function(){return t.onFocus()}))("blur",(function(){return t.onBlur()}))("click",(function(e){return t.onClick(e)}))("dblclick",(function(e){return t.onDblClick(e)}))("keydown",(function(e){return t.onKeyDown(e)})),2&e&&(i.Ab(t.columnCssClasses),i.Kc("width",t.width,"px")("min-width",t.minWidth,"px")("max-width",t.maxWidth,"px")("height",t.height))},inputs:{group:"group",rowHeight:"rowHeight",isSelected:"isSelected",expanded:"expanded",rowIndex:"rowIndex",column:"column",row:"row",sorts:"sorts",treeStatus:"treeStatus",displayCheck:"displayCheck"},outputs:{activate:"activate",treeAction:"treeAction"},decls:5,vars:6,consts:[[1,"datatable-body-cell-label"],["class","datatable-checkbox",4,"ngIf"],[4,"ngIf"],[3,"title","innerHTML",4,"ngIf"],[1,"datatable-checkbox"],["type","checkbox",3,"checked","click"],["class","datatable-tree-button",3,"disabled","click",4,"ngIf"],[1,"datatable-tree-button",3,"disabled","click"],["class","icon datatable-icon-collapse",4,"ngIf"],["class","icon datatable-icon-up",4,"ngIf"],["class","icon datatable-icon-down",4,"ngIf"],[1,"icon","datatable-icon-collapse"],[1,"icon","datatable-icon-up"],[1,"icon","datatable-icon-down"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"title","innerHTML"],["cellTemplate",""]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Mc(1,q,2,1,"label",1),i.Mc(2,ne,3,2,"ng-container",2),i.Mc(3,ie,1,2,"span",3),i.Mc(4,se,2,2,void 0,2),i.Rb()),2&e&&(i.Kc("margin-left",t.calcLeftMargin(t.column,t.row),"px"),i.yb(1),i.pc("ngIf",t.column.checkboxable&&(!t.displayCheck||t.displayCheck(t.row,t.column,t.value))),i.yb(1),i.pc("ngIf",t.column.isTreeColumn),i.yb(1),i.pc("ngIf",!t.column.cellTemplate),i.yb(1),i.pc("ngIf",t.column.cellTemplate))},directives:[r.r,r.w],encapsulation:2,changeDetection:0}),e})();function yt(e,t,n){const i=n(t,e);return i>-1?e.splice(i,1):e.push(t),e}let vt=(()=>{class e{constructor(){this.activate=new i.o,this.select=new i.o}selectRow(e,t,n){if(!this.selectEnabled)return;const i=this.selectionType===Le.checkbox,r=this.selectionType===Le.multiClick;let s=[];s=this.selectionType===Le.multi||i||r?e.shiftKey?function(e,t,n,i,r){const s=n<i;for(let o=0;o<t.length;o++){const r=t[o],a=o>=i&&o<=n,c=o<=i&&o>=n;let l={start:0,end:0};l=s?{start:n,end:i}:{start:i,end:n+1},(s&&c||!s&&a)&&o>=l.start&&o<=l.end&&e.push(r)}return e}([],this.rows,t,this.prevIndex,this.getRowSelectedIdx.bind(this)):yt(e.ctrlKey||e.metaKey||r||i?[...this.selected]:[],n,this.getRowSelectedIdx.bind(this)):yt([],n,this.getRowSelectedIdx.bind(this)),"function"==typeof this.selectCheck&&(s=s.filter(this.selectCheck.bind(this))),this.selected.splice(0,this.selected.length),this.selected.push(...s),this.prevIndex=t,this.select.emit({selected:s})}onActivate(e,t){const{type:n,event:i,row:r}=e,s=this.selectionType===Le.checkbox;!s&&("click"===n||"dblclick"===n)||s&&"checkbox"===n?this.selectRow(i,t,r):"keydown"===n&&(i.keyCode===mt.return?this.selectRow(i,t,r):this.onKeyboardFocus(e)),this.activate.emit(e)}onKeyboardFocus(e){const{keyCode:t}=e.event;if(t===mt.up||t===mt.down||t===mt.right||t===mt.left){const n=this.selectionType===Le.cell;e.cellElement&&n?n&&this.focusCell(e.cellElement,e.rowElement,t,e.cellIndex):this.focusRow(e.rowElement,t)}}focusRow(e,t){const n=this.getPrevNextRow(e,t);n&&n.focus()}getPrevNextRow(e,t){const n=e.parentElement;if(n){let e;if(t===mt.up?e=n.previousElementSibling:t===mt.down&&(e=n.nextElementSibling),e&&e.children.length)return e.children[0]}}focusCell(e,t,n,i){let r;if(n===mt.left)r=e.previousElementSibling;else if(n===mt.right)r=e.nextElementSibling;else if(n===mt.up||n===mt.down){const e=this.getPrevNextRow(t,n);if(e){const t=e.getElementsByClassName("datatable-body-cell");t.length&&(r=t[i])}}r&&r.focus()}getRowSelected(e){return this.getRowSelectedIdx(e,this.selected)>-1}getRowSelectedIdx(e,t){if(!t||!t.length)return-1;const n=this.rowIdentity(e);return t.findIndex(e=>this.rowIdentity(e)===n)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-selection"]],inputs:{rows:"rows",selected:"selected",selectEnabled:"selectEnabled",selectionType:"selectionType",rowIdentity:"rowIdentity",selectCheck:"selectCheck"},outputs:{activate:"activate",select:"select"},ngContentSelectors:u,decls:1,vars:0,template:function(e,t){1&e&&(i.oc(),i.nc(0))},encapsulation:2,changeDetection:0}),e})();function wt(e){const t=e.filter(e=>!!e);return t.length?t.some(e=>"number"!=typeof e)?null:t.reduce((e,t)=>e+t):null}function St(e){return null}let Mt=(()=>{class e{constructor(){this.summaryRow={}}ngOnChanges(){this.columns&&this.rows&&(this.updateInternalColumns(),this.updateValues())}updateInternalColumns(){this._internalColumns=this.columns.map(e=>Object.assign(Object.assign({},e),{cellTemplate:e.summaryTemplate}))}updateValues(){this.summaryRow={},this.columns.filter(e=>!e.summaryTemplate).forEach(e=>{const t=this.rows.map(t=>t[e.prop]),n=this.getSummaryFunction(e);this.summaryRow[e.prop]=e.pipe?e.pipe.transform(n(t)):n(t)})}getSummaryFunction(e){return void 0===e.summaryFunc?wt:null===e.summaryFunc?St:e.summaryFunc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["datatable-summary-row"]],hostAttrs:[1,"datatable-summary-row"],inputs:{rows:"rows",columns:"columns",rowHeight:"rowHeight",offsetX:"offsetX",innerWidth:"innerWidth"},features:[i.wb],decls:1,vars:1,consts:[["tabindex","-1",3,"innerWidth","offsetX","columns","rowHeight","row","rowIndex",4,"ngIf"],["tabindex","-1",3,"innerWidth","offsetX","columns","rowHeight","row","rowIndex"]],template:function(e,t){1&e&&i.Mc(0,oe,1,6,"datatable-body-row",0),2&e&&i.pc("ngIf",t.summaryRow&&t._internalColumns)},directives:[r.r,bt],encapsulation:2}),e})(),xt=(()=>{class e{static forRoot(t){return{ngModule:e,providers:[{provide:"configuration",useValue:t}]}}}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[ae,ce,le],imports:[[r.c]]}),e})();"undefined"==typeof document||document.elementsFromPoint||(document.elementsFromPoint=function(e,t){const n=[],i=[];let r,s,o;for(;(r=document.elementFromPoint(e,t))&&-1===n.indexOf(r)&&null!=r;)n.push(r),i.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(s=i.length;o=i[--s];)n[s].style.setProperty("pointer-events",o.value?o.value:"",o.priority);return n})},wE6v:function(e,t,n){var i=n("hh1v");e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},wQk9:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),monthsShort:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),weekdays:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysShort:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysMin:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u2d30\u2d59\u2d37\u2d45 \u2d34] LT",nextDay:"[\u2d30\u2d59\u2d3d\u2d30 \u2d34] LT",nextWeek:"dddd [\u2d34] LT",lastDay:"[\u2d30\u2d5a\u2d30\u2d4f\u2d5c \u2d34] LT",lastWeek:"dddd [\u2d34] LT",sameElse:"L"},relativeTime:{future:"\u2d37\u2d30\u2d37\u2d45 \u2d59 \u2d62\u2d30\u2d4f %s",past:"\u2d62\u2d30\u2d4f %s",s:"\u2d49\u2d4e\u2d49\u2d3d",ss:"%d \u2d49\u2d4e\u2d49\u2d3d",m:"\u2d4e\u2d49\u2d4f\u2d53\u2d3a",mm:"%d \u2d4e\u2d49\u2d4f\u2d53\u2d3a",h:"\u2d59\u2d30\u2d44\u2d30",hh:"%d \u2d5c\u2d30\u2d59\u2d59\u2d30\u2d44\u2d49\u2d4f",d:"\u2d30\u2d59\u2d59",dd:"%d o\u2d59\u2d59\u2d30\u2d4f",M:"\u2d30\u2d62o\u2d53\u2d54",MM:"%d \u2d49\u2d62\u2d62\u2d49\u2d54\u2d4f",y:"\u2d30\u2d59\u2d33\u2d30\u2d59",yy:"%d \u2d49\u2d59\u2d33\u2d30\u2d59\u2d4f"},week:{dow:6,doy:12}})}(n("wd/R"))},"wd/R":function(e,t,n){(function(e){e.exports=function(){"use strict";var t,i;function r(){return t.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function f(e,t){for(var n in t)a(t,n)&&(e[n]=t[n]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,i){return xt(e,t,n,i,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function b(e){if(null==e._isValid){var t=m(e),n=i.call(t.parsedDateParts,(function(e){return null!=e})),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function g(e){var t=p(NaN);return null!=e?f(m(t),e):m(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),i=n.length>>>0;for(t=0;t<i;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var _=r.momentProperties=[],y=!1;function v(e,t){var n,i,r;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=m(t)),l(t._locale)||(e._locale=t._locale),_.length>0)for(n=0;n<_.length;n++)l(r=t[i=_[n]])||(e[i]=r);return e}function w(e){v(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,r.updateOffset(this),y=!1)}function S(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function M(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,t){var n=!0;return f((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var i,s,o,c=[];for(s=0;s<arguments.length;s++){if(i="","object"==typeof arguments[s]){for(o in i+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];c.push(i)}M(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var k,D={};function T(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),D[e]||(M(t),D[e]=!0)}function C(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e,t){var n,i=f({},e);for(n in t)a(t,n)&&(o(e[n])&&o(t[n])?(i[n]={},f(i[n],e[n]),f(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);for(n in e)a(e,n)&&!a(t,n)&&o(e[n])&&(i[n]=f({},i[n]));return i}function R(e){null!=e&&this.set(e)}function L(e,t,n){var i=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-i.length)).toString().substr(1)+i}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,k=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var E=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,A=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},P={};function j(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(P[e]=r),t&&(P[t[0]]=function(){return L(r.apply(this,arguments),t[1],t[2])}),n&&(P[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function N(e,t){return e.isValid()?(t=F(t,e.localeData()),I[t]=I[t]||function(e){var t,n,i,r=e.match(E);for(t=0,n=r.length;t<n;t++)r[t]=P[r[t]]?P[r[t]]:(i=r[t]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(t){var i,s="";for(i=0;i<n;i++)s+=C(r[i])?r[i].call(t,e):r[i];return s}}(t),I[t](e)):e.localeData().invalidDate()}function F(e,t){var n=5;function i(e){return t.longDateFormat(e)||e}for(A.lastIndex=0;n>=0&&A.test(e);)e=e.replace(A,i),A.lastIndex=0,n-=1;return e}var Y={};function z(e,t){var n=e.toLowerCase();Y[n]=Y[n+"s"]=Y[t]=e}function $(e){return"string"==typeof e?Y[e]||Y[e.toLowerCase()]:void 0}function H(e){var t,n,i={};for(n in e)a(e,n)&&(t=$(n))&&(i[t]=e[n]);return i}var W={};function V(e,t){W[e]=t}function B(e){return e%4==0&&e%100!=0||e%400==0}function U(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function G(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=U(t)),n}function q(e,t){return function(n){return null!=n?(Q(this,e,n),r.updateOffset(this,t),this):J(this,e)}}function J(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&B(e.year())&&1===e.month()&&29===e.date()?(n=G(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Se(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var K,Z=/\d/,X=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,ie=/\d\d?/,re=/\d\d\d\d?/,se=/\d\d\d\d\d\d?/,oe=/\d{1,3}/,ae=/\d{1,4}/,ce=/[+-]?\d{1,6}/,le=/\d+/,ue=/[+-]?\d+/,de=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,fe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,n){K[e]=C(t)?t:function(e,i){return e&&n?n:t}}function me(e,t){return a(K,e)?K[e](t._strict,t._locale):new RegExp(be(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,i,r){return t||n||i||r}))))}function be(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}K={};var ge,_e={};function ye(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),u(t)&&(i=function(e,n){n[t]=G(e)}),n=0;n<e.length;n++)_e[e[n]]=i}function ve(e,t){ye(e,(function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)}))}function we(e,t,n){null!=t&&a(_e,e)&&_e[e](t,n._a,n,e)}function Se(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%12+12)%12;return e+=(t-n)/12,1===n?B(e)?29:28:31-n%7%2}ge=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},j("M",["MM",2],"Mo",(function(){return this.month()+1})),j("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),j("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),z("month","M"),V("month",8),pe("M",ie),pe("MM",ie,X),pe("MMM",(function(e,t){return t.monthsShortRegex(e)})),pe("MMMM",(function(e,t){return t.monthsRegex(e)})),ye(["M","MM"],(function(e,t){t[1]=G(e)-1})),ye(["MMM","MMMM"],(function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[1]=r:m(n).invalidMonth=e}));var Me="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ke=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,De=fe,Te=fe;function Ce(e,t,n){var i,r,s,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=p([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,o))?r:null:-1!==(r=ge.call(this._longMonthsParse,o))?r:null:"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,o))||-1!==(r=ge.call(this._longMonthsParse,o))?r:null:-1!==(r=ge.call(this._longMonthsParse,o))||-1!==(r=ge.call(this._shortMonthsParse,o))?r:null}function Oe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=G(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Se(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Re(e){return null!=e?(Oe(this,e),r.updateOffset(this,!0),this):J(this,"Month")}function Le(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],s=[];for(t=0;t<12;t++)n=p([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),s.sort(e),t=0;t<12;t++)i[t]=be(i[t]),r[t]=be(r[t]);for(t=0;t<24;t++)s[t]=be(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Ee(e){return B(e)?366:365}j("Y",0,0,(function(){var e=this.year();return e<=9999?L(e,4):"+"+e})),j(0,["YY",2],0,(function(){return this.year()%100})),j(0,["YYYY",4],0,"year"),j(0,["YYYYY",5],0,"year"),j(0,["YYYYYY",6,!0],0,"year"),z("year","y"),V("year",1),pe("Y",ue),pe("YY",ie,X),pe("YYYY",ae,te),pe("YYYYY",ce,ne),pe("YYYYYY",ce,ne),ye(["YYYYY","YYYYYY"],0),ye("YYYY",(function(e,t){t[0]=2===e.length?r.parseTwoDigitYear(e):G(e)})),ye("YY",(function(e,t){t[0]=r.parseTwoDigitYear(e)})),ye("Y",(function(e,t){t[0]=parseInt(e,10)})),r.parseTwoDigitYear=function(e){return G(e)+(G(e)>68?1900:2e3)};var Ae=q("FullYear",!0);function Ie(e,t,n,i,r,s,o){var a;return e<100&&e>=0?(a=new Date(e+400,t,n,i,r,s,o),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,i,r,s,o),a}function Pe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function je(e,t,n){var i=7+t-n;return-(7+Pe(e,0,i).getUTCDay()-t)%7+i-1}function Ne(e,t,n,i,r){var s,o,a=1+7*(t-1)+(7+n-i)%7+je(e,i,r);return a<=0?o=Ee(s=e-1)+a:a>Ee(e)?(s=e+1,o=a-Ee(e)):(s=e,o=a),{year:s,dayOfYear:o}}function Fe(e,t,n){var i,r,s=je(e.year(),t,n),o=Math.floor((e.dayOfYear()-s-1)/7)+1;return o<1?i=o+Ye(r=e.year()-1,t,n):o>Ye(e.year(),t,n)?(i=o-Ye(e.year(),t,n),r=e.year()+1):(r=e.year(),i=o),{week:i,year:r}}function Ye(e,t,n){var i=je(e,t,n),r=je(e+1,t,n);return(Ee(e)-i+r)/7}function ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),V("week",5),V("isoWeek",5),pe("w",ie),pe("ww",ie,X),pe("W",ie),pe("WW",ie,X),ve(["w","ww","W","WW"],(function(e,t,n,i){t[i.substr(0,1)]=G(e)})),j("d",0,"do","day"),j("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),j("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),j("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),V("day",11),V("weekday",11),V("isoWeekday",11),pe("d",ie),pe("e",ie),pe("E",ie),pe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),pe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),pe("dddd",(function(e,t){return t.weekdaysRegex(e)})),ve(["dd","ddd","dddd"],(function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:m(n).invalidWeekday=e})),ve(["d","e","E"],(function(e,t,n,i){t[i]=G(e)}));var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),He="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),We="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ve=fe,Be=fe,Ue=fe;function Ge(e,t,n){var i,r,s,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=p([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,o))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._shortWeekdaysParse,o))||-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,o))||-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,o))||-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._shortWeekdaysParse,o))?r:null}function qe(){function e(e,t){return t.length-e.length}var t,n,i,r,s,o=[],a=[],c=[],l=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),i=be(this.weekdaysMin(n,"")),r=be(this.weekdaysShort(n,"")),s=be(this.weekdays(n,"")),o.push(i),a.push(r),c.push(s),l.push(i),l.push(r),l.push(s);o.sort(e),a.sort(e),c.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Je(){return this.hours()%12||12}function Qe(e,t){j(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Ke(e,t){return t._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,Je),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+Je.apply(this)+L(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+Je.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),Qe("a",!0),Qe("A",!1),z("hour","h"),V("hour",13),pe("a",Ke),pe("A",Ke),pe("H",ie),pe("h",ie),pe("k",ie),pe("HH",ie,X),pe("hh",ie,X),pe("kk",ie,X),pe("hmm",re),pe("hmmss",se),pe("Hmm",re),pe("Hmmss",se),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var i=G(e);t[3]=24===i?0:i})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=G(e),m(n).bigHour=!0})),ye("hmm",(function(e,t,n){var i=e.length-2;t[3]=G(e.substr(0,i)),t[4]=G(e.substr(i)),m(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=G(e.substr(0,i)),t[4]=G(e.substr(i,2)),t[5]=G(e.substr(r)),m(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var i=e.length-2;t[3]=G(e.substr(0,i)),t[4]=G(e.substr(i))})),ye("Hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=G(e.substr(0,i)),t[4]=G(e.substr(i,2)),t[5]=G(e.substr(r))}));var Ze,Xe=q("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Me,monthsShort:xe,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:We,weekdaysShort:He,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function it(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n<i;n+=1)if(e[n]!==t[n])return n;return i}function rt(e){return e?e.toLowerCase().replace("_","-"):e}function st(t){var i=null;if(void 0===tt[t]&&void 0!==e&&e&&e.exports)try{i=Ze._abbr,n("RnhZ")("./"+t),ot(i)}catch(r){tt[t]=null}return tt[t]}function ot(e,t){var n;return e&&((n=l(t)?ct(e):at(e,t))?Ze=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ze._abbr}function at(e,t){if(null!==t){var n,i=et;if(t.abbr=e,null!=tt[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=tt[e]._config;else if(null!=t.parentLocale)if(null!=tt[t.parentLocale])i=tt[t.parentLocale]._config;else{if(null==(n=st(t.parentLocale)))return nt[t.parentLocale]||(nt[t.parentLocale]=[]),nt[t.parentLocale].push({name:e,config:t}),null;i=n._config}return tt[e]=new R(O(i,t)),nt[e]&&nt[e].forEach((function(e){at(e.name,e.config)})),ot(e),tt[e]}return delete tt[e],null}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ze;if(!s(e)){if(t=st(e))return t;e=[e]}return function(e){for(var t,n,i,r,s=0;s<e.length;){for(t=(r=rt(e[s]).split("-")).length,n=(n=rt(e[s+1]))?n.split("-"):null;t>0;){if(i=st(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&it(r,n)>=t-1)break;t--}s++}return Ze}(e)}function lt(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Se(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var ut=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,bt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function _t(e){var t,n,i,r,s,o,a=e._i,c=ut.exec(a)||dt.exec(a);if(c){for(m(e).iso=!0,t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(c[1])){r=ft[t][0],i=!1!==ft[t][2];break}if(null==r)return void(e._isValid=!1);if(c[3]){for(t=0,n=pt.length;t<n;t++)if(pt[t][1].exec(c[3])){s=(c[2]||" ")+pt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!i&&null!=s)return void(e._isValid=!1);if(c[4]){if(!ht.exec(c[4]))return void(e._isValid=!1);o="Z"}e._f=r+(s||"")+(o||""),St(e)}else e._isValid=!1}function yt(e){var t,n,i,r,s,o,a,c,l,u=bt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){if(n=u[3],i=u[2],r=u[5],s=u[6],o=u[7],a=[(c=u[4],l=parseInt(c,10),l<=49?2e3+l:l<=999?1900+l:l),xe.indexOf(n),parseInt(i,10),parseInt(r,10),parseInt(s,10)],o&&a.push(parseInt(o,10)),!function(e,t,n){return!e||He.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],t=a,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return gt[e];if(t)return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}(u[8],u[9],u[10]),e._d=Pe.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function vt(e,t,n){return null!=e?e:null!=t?t:n}function wt(e){var t,n,i,s,o,a=[];if(!e._d){for(i=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,i,r,s,o,a,c,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,o=4,n=vt(t.GG,e._a[0],Fe(kt(),1,4).year),i=vt(t.W,1),((r=vt(t.E,1))<1||r>7)&&(c=!0)):(s=e._locale._week.dow,o=e._locale._week.doy,l=Fe(kt(),s,o),n=vt(t.gg,e._a[0],l.year),i=vt(t.w,l.week),null!=t.d?((r=t.d)<0||r>6)&&(c=!0):null!=t.e?(r=t.e+s,(t.e<0||t.e>6)&&(c=!0)):r=s),i<1||i>Ye(n,s,o)?m(e)._overflowWeeks=!0:null!=c?m(e)._overflowWeekday=!0:(a=Ne(n,i,r,s,o),e._a[0]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(o=vt(e._a[0],i[0]),(e._dayOfYear>Ee(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Pe(o,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=i[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Pe:Ie).apply(null,a),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(m(e).weekdayMismatch=!0)}}function St(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,s,o,a,c=""+e._i,l=c.length,u=0;for(i=F(e._f,e._locale).match(E)||[],t=0;t<i.length;t++)(n=(c.match(me(s=i[t],e))||[])[0])&&((o=c.substr(0,c.indexOf(n))).length>0&&m(e).unusedInput.push(o),c=c.slice(c.indexOf(n)+n.length),u+=n.length),P[s]?(n?m(e).empty=!1:m(e).unusedTokens.push(s),we(s,n,e)):e._strict&&!n&&m(e).unusedTokens.push(s);m(e).charsLeftOver=l-u,c.length>0&&m(e).unusedInput.push(c),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(a=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(a,e._a[0])),wt(e),lt(e)}else yt(e);else _t(e)}function Mt(e){var t=e._i,n=e._f;return e._locale=e._locale||ct(e._l),null===t||void 0===n&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),S(t)?new w(lt(t)):(d(t)?e._d=t:s(n)?function(e){var t,n,i,r,s,o,a=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)s=0,o=!1,t=v({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],St(t),b(t)&&(o=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,a?s<i&&(i=s,n=t):(null==i||s<i||o)&&(i=s,n=t,o&&(a=!0));f(e,n||t)}(e):n?St(e):function(e){var t=e._i;l(t)?e._d=new Date(r.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=mt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,yt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=h(t.slice(0),(function(e){return parseInt(e,10)})),wt(e)):o(t)?function(e){if(!e._d){var t=H(e._i);e._a=h([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),wt(e)}}(e):u(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),b(e)||(e._d=null),e))}function xt(e,t,n,i,r){var a,l={};return!0!==t&&!1!==t||(i=t,t=void 0),!0!==n&&!1!==n||(i=n,n=void 0),(o(e)&&c(e)||s(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=n,l._i=e,l._f=t,l._strict=i,(a=new w(lt(Mt(l))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function kt(e,t,n,i){return xt(e,t,n,i,!1)}r.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var Dt=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()})),Tt=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()}));function Ct(e,t){var n,i;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return kt();for(n=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](n)||(n=t[i]);return n}var Ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rt(e){var t=H(e),n=t.year||0,i=t.quarter||0,r=t.month||0,s=t.week||t.isoWeek||0,o=t.day||0,c=t.hour||0,l=t.minute||0,u=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,i=!1;for(t in e)if(a(e,t)&&(-1===ge.call(Ot,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Ot.length;++n)if(e[Ot[n]]){if(i)return!1;parseFloat(e[Ot[n]])!==G(e[Ot[n]])&&(i=!0)}return!0}(t),this._milliseconds=+d+1e3*u+6e4*l+1e3*c*60*60,this._days=+o+7*s,this._months=+r+3*i+12*n,this._data={},this._locale=ct(),this._bubble()}function Lt(e){return e instanceof Rt}function Et(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function At(e,t){j(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+L(~~(e/60),2)+t+L(~~e%60,2)}))}At("Z",":"),At("ZZ",""),pe("Z",he),pe("ZZ",he),ye(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Pt(he,e)}));var It=/([\+\-]|\d\d)/gi;function Pt(e,t){var n,i,r=(t||"").match(e);return null===r?null:0===(i=60*(n=((r[r.length-1]||[])+"").match(It)||["-",0,0])[1]+G(n[2]))?0:"+"===n[0]?i:-i}function jt(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(S(e)||d(e)?e.valueOf():kt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):kt(e).local()}function Nt(e){return-Math.round(e._d.getTimezoneOffset())}function Ft(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Yt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $t(e,t){var n,i,r,s,o,c,l=e,d=null;return Lt(e)?l={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(l={},t?l[t]=+e:l.milliseconds=+e):(d=Yt.exec(e))?(n="-"===d[1]?-1:1,l={y:0,d:G(d[2])*n,h:G(d[3])*n,m:G(d[4])*n,s:G(d[5])*n,ms:G(Et(1e3*d[6]))*n}):(d=zt.exec(e))?l={y:Ht(d[2],n="-"===d[1]?-1:1),M:Ht(d[3],n),w:Ht(d[4],n),d:Ht(d[5],n),h:Ht(d[6],n),m:Ht(d[7],n),s:Ht(d[8],n)}:null==l?l={}:"object"==typeof l&&("from"in l||"to"in l)&&(s=kt(l.from),o=kt(l.to),r=s.isValid()&&o.isValid()?(o=jt(o,s),s.isBefore(o)?c=Wt(s,o):((c=Wt(o,s)).milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0},(l={}).ms=r.milliseconds,l.M=r.months),i=new Rt(l),Lt(e)&&a(e,"_locale")&&(i._locale=e._locale),Lt(e)&&a(e,"_isValid")&&(i._isValid=e._isValid),i}function Ht(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Wt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Vt(e,t){return function(n,i){var r;return null===i||isNaN(+i)||(T(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Bt(this,$t(n,i),e),this}}function Bt(e,t,n,i){var s=t._milliseconds,o=Et(t._days),a=Et(t._months);e.isValid()&&(i=null==i||i,a&&Oe(e,J(e,"Month")+a*n),o&&Q(e,"Date",J(e,"Date")+o*n),s&&e._d.setTime(e._d.valueOf()+s*n),i&&r.updateOffset(e,o||a))}$t.fn=Rt.prototype,$t.invalid=function(){return $t(NaN)};var Ut=Vt(1,"add"),Gt=Vt(-1,"subtract");function qt(e){return"string"==typeof e||e instanceof String}function Jt(e){return S(e)||d(e)||qt(e)||u(e)||function(e){var t=s(e),n=!1;return t&&(n=0===e.filter((function(t){return!u(t)&&qt(e)})).length),t&&n}(e)||function(e){var t,n=o(e)&&!c(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)i=i||a(e,r[t]);return n&&i}(e)||null==e}function Qt(e){var t,n=o(e)&&!c(e),i=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)i=i||a(e,r[t]);return n&&i}function Kt(e,t){if(e.date()<t.date())return-Kt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,"months");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,"months")):(t-i)/(e.clone().add(n+1,"months")-i)))||0}function Zt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ct(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function en(){return this._locale}var tn=1e3,nn=6e4,rn=36e5,sn=126227808e5;function on(e,t){return(e%t+t)%t}function an(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-sn:new Date(e,t,n).valueOf()}function cn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-sn:Date.UTC(e,t,n)}function ln(e,t){return t.erasAbbrRegex(e)}function un(){var e,t,n=[],i=[],r=[],s=[],o=this.eras();for(e=0,t=o.length;e<t;++e)i.push(be(o[e].name)),n.push(be(o[e].abbr)),r.push(be(o[e].narrow)),s.push(be(o[e].name)),s.push(be(o[e].abbr)),s.push(be(o[e].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function dn(e,t){j(0,[e,e.length],0,t)}function hn(e,t,n,i,r){var s;return null==e?Fe(this,i,r).year:(t>(s=Ye(e,i,r))&&(t=s),fn.call(this,e,t,n,i,r))}function fn(e,t,n,i,r){var s=Ne(e,t,n,i,r),o=Pe(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}j("N",0,0,"eraAbbr"),j("NN",0,0,"eraAbbr"),j("NNN",0,0,"eraAbbr"),j("NNNN",0,0,"eraName"),j("NNNNN",0,0,"eraNarrow"),j("y",["y",1],"yo","eraYear"),j("y",["yy",2],0,"eraYear"),j("y",["yyy",3],0,"eraYear"),j("y",["yyyy",4],0,"eraYear"),pe("N",ln),pe("NN",ln),pe("NNN",ln),pe("NNNN",(function(e,t){return t.erasNameRegex(e)})),pe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?m(n).era=r:m(n).invalidEra=e})),pe("y",le),pe("yy",le),pe("yyy",le),pe("yyyy",le),pe("yo",(function(e,t){return t._eraYearOrdinalRegex||le})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),t[0]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,r):parseInt(e,10)})),j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),dn("gggg","weekYear"),dn("ggggg","weekYear"),dn("GGGG","isoWeekYear"),dn("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),V("weekYear",1),V("isoWeekYear",1),pe("G",ue),pe("g",ue),pe("GG",ie,X),pe("gg",ie,X),pe("GGGG",ae,te),pe("gggg",ae,te),pe("GGGGG",ce,ne),pe("ggggg",ce,ne),ve(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,i){t[i.substr(0,2)]=G(e)})),ve(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),j("Q",0,"Qo","quarter"),z("quarter","Q"),V("quarter",7),pe("Q",Z),ye("Q",(function(e,t){t[1]=3*(G(e)-1)})),j("D",["DD",2],"Do","date"),z("date","D"),V("date",9),pe("D",ie),pe("DD",ie,X),pe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=G(e.match(ie)[0])}));var pn=q("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),V("dayOfYear",4),pe("DDD",oe),pe("DDDD",ee),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=G(e)})),j("m",["mm",2],0,"minute"),z("minute","m"),V("minute",14),pe("m",ie),pe("mm",ie,X),ye(["m","mm"],4);var mn=q("Minutes",!1);j("s",["ss",2],0,"second"),z("second","s"),V("second",15),pe("s",ie),pe("ss",ie,X),ye(["s","ss"],5);var bn,gn,_n=q("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),z("millisecond","ms"),V("millisecond",16),pe("S",oe,Z),pe("SS",oe,X),pe("SSS",oe,ee),bn="SSSS";bn.length<=9;bn+="S")pe(bn,le);function yn(e,t){t[6]=G(1e3*("0."+e))}for(bn="S";bn.length<=9;bn+="S")ye(bn,yn);gn=q("Milliseconds",!1),j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var vn=w.prototype;function wn(e){return e}vn.add=Ut,vn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):Qt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||kt(),i=jt(n,this).startOf("day"),s=r.calendarFormat(this,i)||"sameElse",o=t&&(C(t[s])?t[s].call(this,n):t[s]);return this.format(o||this.localeData().calendar(s,this,kt(n)))},vn.clone=function(){return new w(this)},vn.diff=function(e,t,n){var i,r,s;if(!this.isValid())return NaN;if(!(i=jt(e,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=$(t)){case"year":s=Kt(this,i)/12;break;case"month":s=Kt(this,i);break;case"quarter":s=Kt(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-r)/864e5;break;case"week":s=(this-i-r)/6048e5;break;default:s=this-i}return n?s:U(s)},vn.endOf=function(e){var t,n;if(void 0===(e=$(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?cn:an,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=rn-on(t+(this._isUTC?0:this.utcOffset()*nn),rn)-1;break;case"minute":t=this._d.valueOf(),t+=nn-on(t,nn)-1;break;case"second":t=this._d.valueOf(),t+=tn-on(t,tn)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},vn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=N(this,e);return this.localeData().postformat(t)},vn.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||kt(e).isValid())?$t({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},vn.fromNow=function(e){return this.from(kt(),e)},vn.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||kt(e).isValid())?$t({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},vn.toNow=function(e){return this.to(kt(),e)},vn.get=function(e){return C(this[e=$(e)])?this[e]():this},vn.invalidAt=function(){return m(this).overflow},vn.isAfter=function(e,t){var n=S(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},vn.isBefore=function(e,t){var n=S(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},vn.isBetween=function(e,t,n,i){var r=S(e)?e:kt(e),s=S(t)?t:kt(t);return!!(this.isValid()&&r.isValid()&&s.isValid())&&("("===(i=i||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===i[1]?this.isBefore(s,n):!this.isAfter(s,n))},vn.isSame=function(e,t){var n,i=S(e)?e:kt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=$(t)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},vn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},vn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},vn.isValid=function(){return b(this)},vn.lang=Xt,vn.locale=Zt,vn.localeData=en,vn.max=Tt,vn.min=Dt,vn.parsingFlags=function(){return f({},m(this))},vn.set=function(e,t){if("object"==typeof e){var n,i=function(e){var t,n=[];for(t in e)a(e,t)&&n.push({unit:t,priority:W[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}(e=H(e));for(n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit])}else if(C(this[e=$(e)]))return this[e](t);return this},vn.startOf=function(e){var t,n;if(void 0===(e=$(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?cn:an,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=on(t+(this._isUTC?0:this.utcOffset()*nn),rn);break;case"minute":t=this._d.valueOf(),t-=on(t,nn);break;case"second":t=this._d.valueOf(),t-=on(t,tn)}return this._d.setTime(t),r.updateOffset(this,!0),this},vn.subtract=Gt,vn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},vn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},vn.toDate=function(){return new Date(this.valueOf())},vn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?N(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(n,"Z")):N(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},vn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",i="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+i+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(vn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),vn.toJSON=function(){return this.isValid()?this.toISOString():null},vn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},vn.unix=function(){return Math.floor(this.valueOf()/1e3)},vn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},vn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},vn.eraName=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].name;if(i[e].until<=n&&n<=i[e].since)return i[e].name}return""},vn.eraNarrow=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].narrow;if(i[e].until<=n&&n<=i[e].since)return i[e].narrow}return""},vn.eraAbbr=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].abbr;if(i[e].until<=n&&n<=i[e].since)return i[e].abbr}return""},vn.eraYear=function(){var e,t,n,i,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,i=this.clone().startOf("day").valueOf(),s[e].since<=i&&i<=s[e].until||s[e].until<=i&&i<=s[e].since)return(this.year()-r(s[e].since).year())*n+s[e].offset;return this.year()},vn.year=Ae,vn.isLeapYear=function(){return B(this.year())},vn.weekYear=function(e){return hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},vn.isoWeekYear=function(e){return hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},vn.quarter=vn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},vn.month=Re,vn.daysInMonth=function(){return Se(this.year(),this.month())},vn.week=vn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},vn.isoWeek=vn.isoWeeks=function(e){var t=Fe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},vn.weeksInYear=function(){var e=this.localeData()._week;return Ye(this.year(),e.dow,e.doy)},vn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ye(this.weekYear(),e.dow,e.doy)},vn.isoWeeksInYear=function(){return Ye(this.year(),1,4)},vn.isoWeeksInISOWeekYear=function(){return Ye(this.isoWeekYear(),1,4)},vn.date=pn,vn.day=vn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},vn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},vn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},vn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},vn.hour=vn.hours=Xe,vn.minute=vn.minutes=mn,vn.second=vn.seconds=_n,vn.millisecond=vn.milliseconds=gn,vn.utcOffset=function(e,t,n){var i,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Pt(he,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=Nt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!t||this._changeInProgress?Bt(this,$t(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Nt(this)},vn.utc=function(e){return this.utcOffset(0,e)},vn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Nt(this),"m")),this},vn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Pt(de,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},vn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?kt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},vn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},vn.isLocal=function(){return!!this.isValid()&&!this._isUTC},vn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},vn.isUtc=Ft,vn.isUTC=Ft,vn.zoneAbbr=function(){return this._isUTC?"UTC":""},vn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},vn.dates=x("dates accessor is deprecated. Use date instead.",pn),vn.months=x("months accessor is deprecated. Use month instead",Re),vn.years=x("years accessor is deprecated. Use year instead",Ae),vn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),vn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=Mt(t))._a?(e=t._isUTC?p(t._a):kt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var i,r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),o=0;for(i=0;i<r;i++)G(e[i])!==G(t[i])&&o++;return o+s}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}));var Sn=R.prototype;function Mn(e,t,n,i){var r=ct(),s=p().set(i,t);return r[n](s,e)}function xn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Mn(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Mn(e,i,n,"month");return r}function kn(e,t,n,i){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,s=ct(),o=e?s._week.dow:0,a=[];if(null!=n)return Mn(t,(n+o)%7,i,"day");for(r=0;r<7;r++)a[r]=Mn(t,(r+o)%7,i,"day");return a}Sn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return C(i)?i.call(t,n):i},Sn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(E).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},Sn.invalidDate=function(){return this._invalidDate},Sn.ordinal=function(e){return this._ordinal.replace("%d",e)},Sn.preparse=wn,Sn.postformat=wn,Sn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return C(r)?r(e,t,n,i):r.replace(/%d/i,e)},Sn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)},Sn.set=function(e){var t,n;for(n in e)a(e,n)&&(C(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Sn.eras=function(e,t){var n,i,s,o=this._eras||ct("en")._eras;for(n=0,i=o.length;n<i;++n){switch(typeof o[n].since){case"string":s=r(o[n].since).startOf("day"),o[n].since=s.valueOf()}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":s=r(o[n].until).startOf("day").valueOf(),o[n].until=s.valueOf()}}return o},Sn.erasParse=function(e,t,n){var i,r,s,o,a,c=this.eras();for(e=e.toUpperCase(),i=0,r=c.length;i<r;++i)if(s=c[i].name.toUpperCase(),o=c[i].abbr.toUpperCase(),a=c[i].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return c[i];break;case"NNNN":if(s===e)return c[i];break;case"NNNNN":if(a===e)return c[i]}else if([s,o,a].indexOf(e)>=0)return c[i]},Sn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},Sn.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||un.call(this),e?this._erasAbbrRegex:this._erasRegex},Sn.erasNameRegex=function(e){return a(this,"_erasNameRegex")||un.call(this),e?this._erasNameRegex:this._erasRegex},Sn.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||un.call(this),e?this._erasNarrowRegex:this._erasRegex},Sn.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ke).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},Sn.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ke.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Sn.monthsParse=function(e,t,n){var i,r,s;if(this._monthsParseExact)return Ce.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=p([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},Sn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Le.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Te),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Sn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Le.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=De),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Sn.week=function(e){return Fe(e,this._week.dow,this._week.doy).week},Sn.firstDayOfYear=function(){return this._week.doy},Sn.firstDayOfWeek=function(){return this._week.dow},Sn.weekdays=function(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ze(n,this._week.dow):e?n[e.day()]:n},Sn.weekdaysMin=function(e){return!0===e?ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Sn.weekdaysShort=function(e){return!0===e?ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Sn.weekdaysParse=function(e,t,n){var i,r,s;if(this._weekdaysParseExact)return Ge.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=p([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},Sn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Ve),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Sn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Be),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Sn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ue),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Sn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Sn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ot("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===G(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=x("moment.lang is deprecated. Use moment.locale instead.",ot),r.langData=x("moment.langData is deprecated. Use moment.localeData instead.",ct);var Dn=Math.abs;function Tn(e,t,n,i){var r=$t(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function Cn(e){return e<0?Math.floor(e):Math.ceil(e)}function On(e){return 4800*e/146097}function Rn(e){return 146097*e/4800}function Ln(e){return function(){return this.as(e)}}var En=Ln("ms"),An=Ln("s"),In=Ln("m"),Pn=Ln("h"),jn=Ln("d"),Nn=Ln("w"),Fn=Ln("M"),Yn=Ln("Q"),zn=Ln("y");function $n(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hn=$n("milliseconds"),Wn=$n("seconds"),Vn=$n("minutes"),Bn=$n("hours"),Un=$n("days"),Gn=$n("months"),qn=$n("years"),Jn=Math.round,Qn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Kn(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}var Zn=Math.abs;function Xn(e){return(e>0)-(e<0)||+e}function ei(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,s,o,a,c=Zn(this._milliseconds)/1e3,l=Zn(this._days),u=Zn(this._months),d=this.asSeconds();return d?(e=U(c/60),t=U(e/60),c%=60,e%=60,n=U(u/12),u%=12,i=c?c.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",s=Xn(this._months)!==Xn(d)?"-":"",o=Xn(this._days)!==Xn(d)?"-":"",a=Xn(this._milliseconds)!==Xn(d)?"-":"",r+"P"+(n?s+n+"Y":"")+(u?s+u+"M":"")+(l?o+l+"D":"")+(t||e||c?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(c?a+i+"S":"")):"P0D"}var ti=Rt.prototype;return ti.isValid=function(){return this._isValid},ti.abs=function(){var e=this._data;return this._milliseconds=Dn(this._milliseconds),this._days=Dn(this._days),this._months=Dn(this._months),e.milliseconds=Dn(e.milliseconds),e.seconds=Dn(e.seconds),e.minutes=Dn(e.minutes),e.hours=Dn(e.hours),e.months=Dn(e.months),e.years=Dn(e.years),this},ti.add=function(e,t){return Tn(this,e,t,1)},ti.subtract=function(e,t){return Tn(this,e,t,-1)},ti.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=$(e))||"quarter"===e||"year"===e)switch(n=this._months+On(t=this._days+i/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Rn(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},ti.asMilliseconds=En,ti.asSeconds=An,ti.asMinutes=In,ti.asHours=Pn,ti.asDays=jn,ti.asWeeks=Nn,ti.asMonths=Fn,ti.asQuarters=Yn,ti.asYears=zn,ti.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*G(this._months/12):NaN},ti._bubble=function(){var e,t,n,i,r,s=this._milliseconds,o=this._days,a=this._months,c=this._data;return s>=0&&o>=0&&a>=0||s<=0&&o<=0&&a<=0||(s+=864e5*Cn(Rn(a)+o),o=0,a=0),c.milliseconds=s%1e3,e=U(s/1e3),c.seconds=e%60,t=U(e/60),c.minutes=t%60,n=U(t/60),c.hours=n%24,o+=U(n/24),a+=r=U(On(o)),o-=Cn(Rn(r)),i=U(a/12),a%=12,c.days=o,c.months=a,c.years=i,this},ti.clone=function(){return $t(this)},ti.get=function(e){return e=$(e),this.isValid()?this[e+"s"]():NaN},ti.milliseconds=Hn,ti.seconds=Wn,ti.minutes=Vn,ti.hours=Bn,ti.days=Un,ti.weeks=function(){return U(this.days()/7)},ti.months=Gn,ti.years=qn,ti.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,s=Qn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(s=Object.assign({},Qn,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),i=function(e,t,n,i){var r=$t(e).abs(),s=Jn(r.as("s")),o=Jn(r.as("m")),a=Jn(r.as("h")),c=Jn(r.as("d")),l=Jn(r.as("M")),u=Jn(r.as("w")),d=Jn(r.as("y")),h=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||a<=1&&["h"]||a<n.h&&["hh",a]||c<=1&&["d"]||c<n.d&&["dd",c];return null!=n.w&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),(h=h||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=i,Kn.apply(null,h)}(this,!r,s,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)},ti.toISOString=ei,ti.toString=ei,ti.toJSON=ei,ti.locale=Zt,ti.localeData=en,ti.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ei),ti.lang=Xt,j("X",0,0,"unix"),j("x",0,0,"valueOf"),pe("x",ue),pe("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date(G(e))})),r.version="2.29.1",t=kt,r.fn=vn,r.min=function(){return Ct("isBefore",[].slice.call(arguments,0))},r.max=function(){return Ct("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return kt(1e3*e)},r.months=function(e,t){return xn(e,t,"months")},r.isDate=d,r.locale=ot,r.invalid=g,r.duration=$t,r.isMoment=S,r.weekdays=function(e,t,n){return kn(e,t,n,"weekdays")},r.parseZone=function(){return kt.apply(null,arguments).parseZone()},r.localeData=ct,r.isDuration=Lt,r.monthsShort=function(e,t){return xn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return kn(e,t,n,"weekdaysMin")},r.defineLocale=at,r.updateLocale=function(e,t){if(null!=t){var n,i,r=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(O(tt[e]._config,t)):(null!=(i=st(e))&&(r=i._config),t=O(r,t),null==i&&(t.abbr=e),(n=new R(t)).parentLocale=tt[e],tt[e]=n),ot(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===ot()&&ot(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return k(tt)},r.weekdaysShort=function(e,t,n){return kn(e,t,n,"weekdaysShort")},r.normalizeUnits=$,r.relativeTimeRounding=function(e){return void 0===e?Jn:"function"==typeof e&&(Jn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==Qn[e]&&(void 0===t?Qn[e]:(Qn[e]=t,"s"===e&&(Qn.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=vn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n("YuTi")(e))},wg0c:function(e,t,n){var i=n("2oRo"),r=n("WKiH").trim,s=n("WJkJ"),o=i.parseInt,a=/^[+-]?0[Xx]/,c=8!==o(s+"08")||22!==o(s+"0x16");e.exports=c?function(e,t){var n=r(String(e));return o(n,t>>>0||(a.test(n)?16:10))}:o},wnGv:function(e,t,n){"use strict";n.d(t,"a",(function(){return L}));var i=n("8Y7J"),r=n("s7LF"),s=n("LvDl"),o=n.n(s),a=n("oxzT"),c=n("QFaf"),l=n("DNAf"),u=n("a96k"),d=n("SVse"),h=n("NwgZ"),f=n("ANnk"),p=n("f69J"),m=n("G0yt");function b(e,t){if(1&e&&(i.Sb(0,"span",12),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.yb(1),i.Qc(" ",t.messages.customValidations[e]," ")}}function g(e,t){if(1&e&&(i.Qb(0),i.Mc(1,b,2,1,"span",11),i.Pb()),2&e){const e=t.$implicit;i.ic();const n=i.Ac(1),r=i.ic();i.yb(1),i.pc("ngIf",r.form.showError("filter",n)&&r.filter.hasError(e))}}const _=function(e){return[e]};function y(e,t){if(1&e&&i.Nb(0,"i",18),2&e){const e=i.ic(3);i.pc("ngClass",i.uc(1,_,e.icons.check))}}function v(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"br"),i.Sb(2,"small",19),i.Oc(3),i.Rb(),i.Pb()),2&e){const e=i.ic().$implicit;i.yb(3),i.Qc(" ",e.description,"\xa0 ")}}const w=function(e){return{"help-block disabled":e}};function S(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",13),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic(2).triggerSelection(n)})),i.Sb(1,"div",14),i.Mc(2,y,1,3,"i",15),i.Oc(3," \xa0 "),i.Rb(),i.Sb(4,"div",16),i.Oc(5),i.Mc(6,v,4,1,"ng-container",17),i.Rb(),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic(2);i.pc("ngClass",i.uc(4,w,!(n.data.length!==n.selectionLimit&&e.enabled||e.selected))),i.yb(2),i.pc("ngIf",e.selected),i.yb(3),i.Qc(" ",e.name," "),i.yb(1),i.pc("ngIf",e.description)}}function M(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",20),i.gc("click",(function(){return i.Dc(e),i.ic(2).addCustomOption()})),i.Sb(1,"div",14),i.Nb(2,"i",18),i.Oc(3," \xa0 "),i.Rb(),i.Sb(4,"div",16),i.Oc(5),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.yb(2),i.pc("ngClass",i.uc(3,_,e.icons.tag)),i.yb(3),i.Rc(" ",e.messages.add," '",e.filter.value,"' ")}}function x(e,t){if(1&e&&(i.Sb(0,"span",23),i.Oc(1),i.Rb()),2&e){const e=i.ic(3);i.pc("ngbTooltip",e.messages.selectionLimit.tooltip),i.yb(1),i.Qc(" ",e.messages.selectionLimit.text," ")}}function k(e,t){if(1&e&&(i.Sb(0,"div",21),i.Mc(1,x,2,2,"span",22),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.pc("ngIf",e.data.length===e.selectionLimit)}}function D(e,t){if(1&e){const e=i.Tb();i.Sb(0,"form",4,5),i.Sb(2,"div"),i.Sb(3,"input",6),i.gc("keyup",(function(t){i.Dc(e);const n=i.ic();return 13==t.keyCode?n.selectOption():n.updateFilter()})),i.Rb(),i.Mc(4,g,2,1,"ng-container",7),i.Rb(),i.Rb(),i.Mc(5,S,7,6,"div",8),i.Mc(6,M,6,5,"div",9),i.Mc(7,k,2,1,"div",10)}if(2&e){const e=i.ic();i.pc("formGroup",e.form),i.yb(3),i.pc("placeholder",e.messages.filter),i.yb(1),i.pc("ngForOf",e.Object.keys(e.messages.customValidations)),i.yb(1),i.pc("ngForOf",e.filteredOptions),i.yb(1),i.pc("ngIf",e.isCreatable()),i.yb(1),i.pc("ngIf",e.data.length===e.selectionLimit)}}function T(e,t){if(1&e&&(i.Sb(0,"a",24),i.nc(1),i.Rb()),2&e){const e=i.ic(),t=i.Ac(1);i.pc("ngClass",e.elemClass)("ngbPopover",t)}}function C(e,t){if(1&e&&(i.Sb(0,"span",25),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Qc(" ",e.messages.empty,"\n")}}function O(e,t){if(1&e&&(i.Sb(0,"span",25),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Qc(" ",e.messages.noOptions,"\n")}}const R=["*"];let L=(()=>{class e{constructor(){this.data=[],this.options=[],this.messages=new l.a({}),this.customBadges=!1,this.customBadgeValidators=[],this.selection=new i.o,this.Object=Object,this.filteredOptions=[],this.icons=a.a}ngOnInit(){this.initFilter(),this.data.length>0&&this.initMissingOptions(),this.options=o.a.sortBy(this.options,["name"]),this.updateOptions()}initFilter(){this.filter=new r.h("",{validators:this.customBadgeValidators}),this.form=new c.a({filter:this.filter}),this.filteredOptions=[...this.options||[]]}initMissingOptions(){const e=this.options.map(e=>e.name);this.data.filter(t=>-1===e.indexOf(t)).forEach(e=>this.addOption(e)),this.forceOptionsToReflectData()}addOption(e){this.options.push(new u.a(!1,e,"")),this.options=o.a.sortBy(this.options,["name"]),this.triggerSelection(this.options.find(t=>t.name===e))}triggerSelection(e){!e||this.selectionLimit&&!e.selected&&this.data.length>=this.selectionLimit||(e.selected=!e.selected,this.updateOptions(),this.selection.emit({option:e}))}updateOptions(){this.data.splice(0,this.data.length),this.options.forEach(e=>{e.selected&&this.data.push(e.name)}),this.updateFilter()}updateFilter(){this.filteredOptions=this.options.filter(e=>e.name.includes(this.filter.value))}forceOptionsToReflectData(){this.options.forEach(e=>{-1!==this.data.indexOf(e.name)&&(e.selected=!0)})}ngOnChanges(){this.filter&&this.updateFilter(),this.options&&this.data&&0!==this.data.length&&this.forceOptionsToReflectData()}selectOption(){0===this.filteredOptions.length?this.addCustomOption():(this.triggerSelection(this.filteredOptions[0]),this.resetFilter())}addCustomOption(){this.isCreatable()&&(this.addOption(this.filter.value),this.resetFilter())}isCreatable(){return this.customBadges&&this.filter.valid&&this.filter.value.length>0&&this.filteredOptions.every(e=>e.name!==this.filter.value)}resetFilter(){this.filter.setValue(""),this.updateFilter()}removeItem(e){this.triggerSelection(this.options.find(t=>t.name===e&&t.selected))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-select"]],inputs:{elemClass:"elemClass",data:"data",options:"options",messages:"messages",selectionLimit:"selectionLimit",customBadges:"customBadges",customBadgeValidators:"customBadgeValidators"},outputs:{selection:"selection"},features:[i.wb],ngContentSelectors:R,decls:5,vars:3,consts:[["popTemplate",""],["class","select-menu-edit float-left",3,"ngClass","ngbPopover",4,"ngIf"],["class","form-text text-muted float-left",4,"ngIf"],["class","form-text text-muted  float-left",4,"ngIf"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],["type","text","formControlName","filter",1,"form-control","text-center",3,"placeholder","keyup"],[4,"ngFor","ngForOf"],["class","select-menu-item",3,"ngClass","click",4,"ngFor","ngForOf"],["class","select-menu-item",3,"click",4,"ngIf"],["class","is-invalid",4,"ngIf"],["class","invalid-feedback text-center d-block",4,"ngIf"],[1,"invalid-feedback","text-center","d-block"],[1,"select-menu-item",3,"ngClass","click"],[1,"select-menu-item-icon"],["aria-hidden","true",3,"ngClass",4,"ngIf"],[1,"select-menu-item-content"],[4,"ngIf"],["aria-hidden","true",3,"ngClass"],[1,"form-text","text-muted"],[1,"select-menu-item",3,"click"],[1,"is-invalid"],["class","form-text text-muted text-center text-warning",3,"ngbTooltip",4,"ngIf"],[1,"form-text","text-muted","text-center","text-warning",3,"ngbTooltip"],[1,"select-menu-edit","float-left",3,"ngClass","ngbPopover"],[1,"form-text","text-muted","float-left"]],template:function(e,t){1&e&&(i.oc(),i.Mc(0,D,8,6,"ng-template",null,0,i.Nc),i.Mc(2,T,2,2,"a",1),i.Mc(3,C,2,1,"span",2),i.Mc(4,O,2,1,"span",3)),2&e&&(i.yb(2),i.pc("ngIf",t.customBadges||t.options.length>0),i.yb(1),i.pc("ngIf",0===t.data.length&&!(!t.customBadges&&0===t.options.length)),i.yb(1),i.pc("ngIf",!t.customBadges&&0===t.options.length))},directives:[d.r,r.C,r.r,r.k,h.a,f.a,r.d,p.a,r.q,r.i,d.q,d.p,m.D,m.w],styles:[".select-menu-item[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.09);cursor:pointer;display:block;font-size:1rem}.select-menu-item[_ngcontent-%COMP%]:hover{background-color:#e9ecef}.select-menu-item-icon[_ngcontent-%COMP%]{float:left;padding:.5em;width:3em}.select-menu-item-content[_ngcontent-%COMP%]{padding:.5em}.select-menu-item-content[_ngcontent-%COMP%]   .form-text[_ngcontent-%COMP%]{display:flex}"]}),e})()},x38r:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e){return e.bold="bold",e.sparkline="sparkline",e.perSecond="perSecond",e.checkIcon="checkIcon",e.routerLink="routerLink",e.executing="executing",e.classAdding="classAdding",e.badge="badge",e.map="map",e.truncate="truncate",e}({})},x6pH:function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"\u05d9\u05e0\u05d5\u05d0\u05e8_\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05d9\u05dc_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8_\u05e1\u05e4\u05d8\u05de\u05d1\u05e8_\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8_\u05e0\u05d5\u05d1\u05de\u05d1\u05e8_\u05d3\u05e6\u05de\u05d1\u05e8".split("_"),monthsShort:"\u05d9\u05e0\u05d5\u05f3_\u05e4\u05d1\u05e8\u05f3_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05f3_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05f3_\u05e1\u05e4\u05d8\u05f3_\u05d0\u05d5\u05e7\u05f3_\u05e0\u05d5\u05d1\u05f3_\u05d3\u05e6\u05de\u05f3".split("_"),weekdays:"\u05e8\u05d0\u05e9\u05d5\u05df_\u05e9\u05e0\u05d9_\u05e9\u05dc\u05d9\u05e9\u05d9_\u05e8\u05d1\u05d9\u05e2\u05d9_\u05d7\u05de\u05d9\u05e9\u05d9_\u05e9\u05d9\u05e9\u05d9_\u05e9\u05d1\u05ea".split("_"),weekdaysShort:"\u05d0\u05f3_\u05d1\u05f3_\u05d2\u05f3_\u05d3\u05f3_\u05d4\u05f3_\u05d5\u05f3_\u05e9\u05f3".split("_"),weekdaysMin:"\u05d0_\u05d1_\u05d2_\u05d3_\u05d4_\u05d5_\u05e9".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [\u05d1]MMMM YYYY",LLL:"D [\u05d1]MMMM YYYY HH:mm",LLLL:"dddd, D [\u05d1]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[\u05d4\u05d9\u05d5\u05dd \u05d1\u05be]LT",nextDay:"[\u05de\u05d7\u05e8 \u05d1\u05be]LT",nextWeek:"dddd [\u05d1\u05e9\u05e2\u05d4] LT",lastDay:"[\u05d0\u05ea\u05de\u05d5\u05dc \u05d1\u05be]LT",lastWeek:"[\u05d1\u05d9\u05d5\u05dd] dddd [\u05d4\u05d0\u05d7\u05e8\u05d5\u05df \u05d1\u05e9\u05e2\u05d4] LT",sameElse:"L"},relativeTime:{future:"\u05d1\u05e2\u05d5\u05d3 %s",past:"\u05dc\u05e4\u05e0\u05d9 %s",s:"\u05de\u05e1\u05e4\u05e8 \u05e9\u05e0\u05d9\u05d5\u05ea",ss:"%d \u05e9\u05e0\u05d9\u05d5\u05ea",m:"\u05d3\u05e7\u05d4",mm:"%d \u05d3\u05e7\u05d5\u05ea",h:"\u05e9\u05e2\u05d4",hh:function(e){return 2===e?"\u05e9\u05e2\u05ea\u05d9\u05d9\u05dd":e+" \u05e9\u05e2\u05d5\u05ea"},d:"\u05d9\u05d5\u05dd",dd:function(e){return 2===e?"\u05d9\u05d5\u05de\u05d9\u05d9\u05dd":e+" \u05d9\u05de\u05d9\u05dd"},M:"\u05d7\u05d5\u05d3\u05e9",MM:function(e){return 2===e?"\u05d7\u05d5\u05d3\u05e9\u05d9\u05d9\u05dd":e+" \u05d7\u05d5\u05d3\u05e9\u05d9\u05dd"},y:"\u05e9\u05e0\u05d4",yy:function(e){return 2===e?"\u05e9\u05e0\u05ea\u05d9\u05d9\u05dd":e%10==0&&10!==e?e+" \u05e9\u05e0\u05d4":e+" \u05e9\u05e0\u05d9\u05dd"}},meridiemParse:/\u05d0\u05d7\u05d4"\u05e6|\u05dc\u05e4\u05e0\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8|\u05d1\u05d1\u05d5\u05e7\u05e8|\u05d1\u05e2\u05e8\u05d1/i,isPM:function(e){return/^(\u05d0\u05d7\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05d1\u05e2\u05e8\u05d1)$/.test(e)},meridiem:function(e,t,n){return e<5?"\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8":e<10?"\u05d1\u05d1\u05d5\u05e7\u05e8":e<12?n?'\u05dc\u05e4\u05e0\u05d4"\u05e6':"\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":e<18?n?'\u05d0\u05d7\u05d4"\u05e6':"\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":"\u05d1\u05e2\u05e8\u05d1"}})}(n("wd/R"))},xDBR:function(e,t){e.exports=!1},xTzq:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o}));var i=n("LvDl"),r=n.n(i);function s(...e){switch(e.length){case 1:return a.apply(void 0,e);case 3:return c.apply(void 0,e);default:throw new Error}}function o(e,t,n){const i="__ignore_"+t;Array.isArray(e[i])?e[i].push(n):e[i]=[n]}function a(e){for(const t of Object.getOwnPropertyNames(e.prototype)){const n=Object.getOwnPropertyDescriptor(e.prototype,t),i="constructor"===t;n.value instanceof Function&&!i&&(c(e.prototype,t,n),Object.defineProperty(e.prototype,t,n))}}function c(e,t,n){void 0===n&&(n=Object.getOwnPropertyDescriptor(e,t));const i=n.value;n.value=function(){const n="__ignore_"+t,s=e[n]||[],o=[];for(let e=0;e<arguments.length;e++)o[e]=r.a.isString(arguments[e])&&-1===s.indexOf(e)?encodeURIComponent(arguments[e]):arguments[e];const a=i.apply(this,o);return a}}},xbPD:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("7o/Q");function r(e=null){return t=>t.lift(new s(e))}class s{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new o(e,this.defaultValue))}}class o extends i.a{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}},xgIS:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("HDdC"),r=n("DH7j"),s=n("n6bG"),o=n("lJxs");function a(e,t,n,c){return Object(s.a)(n)&&(c=n,n=void 0),c?a(e,t,n).pipe(Object(o.a)(e=>Object(r.a)(e)?c(...e):c(e))):new i.a(i=>{!function e(t,n,i,r,s){let o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){const e=t;t.addEventListener(n,i,s),o=()=>e.removeEventListener(n,i,s)}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){const e=t;t.on(n,i),o=()=>e.off(n,i)}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){const e=t;t.addListener(n,i),o=()=>e.removeListener(n,i)}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let o=0,a=t.length;o<a;o++)e(t[o],n,i,r,s)}r.add(o)}(e,t,(function(e){i.next(arguments.length>1?Array.prototype.slice.call(arguments):e)}),i,n)})}},xrYK:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},xs3f:function(e,t,n){var i=n("2oRo"),r=n("zk60"),s="__core-js_shared__",o=i[s]||r(s,{});e.exports=o},xutz:function(e,t,n){"use strict";(function(e){var i=n("XqMk"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r&&i.a.process,a=function(){try{return s&&s.require&&s.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();t.a=a}).call(this,n("3UD+")(e))},yCtX:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("HDdC"),r=n("ngJS"),s=n("jZKg");function o(e,t){return t?Object(s.a)(e,t):new i.a(Object(r.a)(e))}},yGOH:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[]]}),e})()},yJti:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e){return e[e.ValueOk=0]="ValueOk",e[e.ValueStale=1]="ValueStale",e[e.ValueNone=2]="ValueNone",e[e.ValueException=3]="ValueException",e}({})},yPMs:function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_N\xebntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_N\xebn_Dhj".split("_"),weekdays:"E Diel_E H\xebn\xeb_E Mart\xeb_E M\xebrkur\xeb_E Enjte_E Premte_E Shtun\xeb".split("_"),weekdaysShort:"Die_H\xebn_Mar_M\xebr_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_M\xeb_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot n\xeb] LT",nextDay:"[Nes\xebr n\xeb] LT",nextWeek:"dddd [n\xeb] LT",lastDay:"[Dje n\xeb] LT",lastWeek:"dddd [e kaluar n\xeb] LT",sameElse:"L"},relativeTime:{future:"n\xeb %s",past:"%s m\xeb par\xeb",s:"disa sekonda",ss:"%d sekonda",m:"nj\xeb minut\xeb",mm:"%d minuta",h:"nj\xeb or\xeb",hh:"%d or\xeb",d:"nj\xeb dit\xeb",dd:"%d dit\xeb",M:"nj\xeb muaj",MM:"%d muaj",y:"nj\xeb vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},yT6U:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t=!1){let n=e;return(!r.a.isArray(e)||r.a.isArray(e)&&t)&&(n=[e]),n}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Lb({name:"array",type:e,pure:!0}),e})()},ylTp:function(e,t,n){"use strict";var i=n("Ju5/");t.a=i.a.Symbol},yoRg:function(e,t,n){var i=n("UTVS"),r=n("/GqU"),s=n("TWQb").indexOf,o=n("0BK2");e.exports=function(e,t){var n,a=r(e),c=0,l=[];for(n in a)!i(o,n)&&i(a,n)&&l.push(n);for(;t.length>c;)i(a,n=t[c++])&&(~s(l,n)||l.push(n));return l}},"z+Ro":function(e,t,n){"use strict";function i(e){return e&&"function"==typeof e.schedule}n.d(t,"a",(function(){return i}))},z1FC:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n m\xedut","'iens m\xedut"],mm:[e+" m\xeduts",e+" m\xeduts"],h:["'n \xfeora","'iensa \xfeora"],hh:[e+" \xfeoras",e+" \xfeoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return i||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Mar\xe7_Avr\xefu_Mai_G\xfcn_Julia_Guscht_Setemvar_Listop\xe4ts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_G\xfcn_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"S\xfaladi_L\xfane\xe7i_Maitzi_M\xe1rcuri_Xh\xfaadi_Vi\xe9ner\xe7i_S\xe1turi".split("_"),weekdaysShort:"S\xfal_L\xfan_Mai_M\xe1r_Xh\xfa_Vi\xe9_S\xe1t".split("_"),weekdaysMin:"S\xfa_L\xfa_Ma_M\xe1_Xh_Vi_S\xe1".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi \xe0] LT",nextDay:"[dem\xe0 \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[ieiri \xe0] LT",lastWeek:"[s\xfcr el] dddd [lasteu \xe0] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z3Vd:function(e,t,n){!function(e){"use strict";var t="pagh_wa\u2019_cha\u2019_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,i,r){var s=function(e){var n=Math.floor(e%1e3/100),i=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),i>0&&(s+=(""!==s?" ":"")+t[i]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(i){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera\u2019 jar wa\u2019_tera\u2019 jar cha\u2019_tera\u2019 jar wej_tera\u2019 jar loS_tera\u2019 jar vagh_tera\u2019 jar jav_tera\u2019 jar Soch_tera\u2019 jar chorgh_tera\u2019 jar Hut_tera\u2019 jar wa\u2019maH_tera\u2019 jar wa\u2019maH wa\u2019_tera\u2019 jar wa\u2019maH cha\u2019".split("_"),monthsShort:"jar wa\u2019_jar cha\u2019_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa\u2019maH_jar wa\u2019maH wa\u2019_jar wa\u2019maH cha\u2019".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa\u2019leS] LT",nextWeek:"LLL",lastDay:"[wa\u2019Hu\u2019] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu\u2019":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa\u2019 tup",mm:n,h:"wa\u2019 rep",hh:n,d:"wa\u2019 jaj",dd:n,M:"wa\u2019 jar",MM:n,y:"wa\u2019 DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z6cu:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n("HDdC");function r(e,t){return new i.a(t?n=>t.schedule(s,0,{error:e,subscriber:n}):t=>t.error(e))}function s({error:e,subscriber:t}){t.error(e)}},zBJ4:function(e,t,n){var i=n("2oRo"),r=n("hh1v"),s=i.document,o=r(s)&&r(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},zKZe:function(e,t,n){var i=n("I+eb"),r=n("YNrV");i({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},zUnb:function(e,t,n){"use strict";n.r(t);var i=n("8Y7J"),r=n("cUpR"),s=n("AytR"),o=n("SVse"),a=n("IheW"),c=n("GS7A");function l(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function u(e){switch(e.length){case 0:return new c.d;case 1:return e[0];default:return new c.k(e)}}function d(e,t,n,i,r={},s={}){const o=[],a=[];let l=-1,u=null;if(i.forEach(e=>{const n=e.offset,i=n==l,d=i&&u||{};Object.keys(e).forEach(n=>{let i=n,a=e[n];if("offset"!==n)switch(i=t.normalizePropertyName(i,o),a){case c.l:a=r[n];break;case c.a:a=s[n];break;default:a=t.normalizeStyleValue(n,i,a,o)}d[i]=a}),i||a.push(d),u=d,l=n}),o.length){const e="\n - ";throw new Error(`Unable to animate due to the following errors:${e}${o.join(e)}`)}return a}function h(e,t,n,i){switch(t){case"start":e.onStart(()=>i(n&&f(n,"start",e)));break;case"done":e.onDone(()=>i(n&&f(n,"done",e)));break;case"destroy":e.onDestroy(()=>i(n&&f(n,"destroy",e)))}}function f(e,t,n){const i=n.totalTime,r=p(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==i?e.totalTime:i,!!n.disabled),s=e._data;return null!=s&&(r._data=s),r}function p(e,t,n,i,r="",s=0,o){return{element:e,triggerName:t,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function m(e,t,n){let i;return e instanceof Map?(i=e.get(t),i||e.set(t,i=n)):(i=e[t],i||(i=e[t]=n)),i}function b(e){const t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}let g=(e,t)=>!1,_=(e,t)=>!1,y=(e,t,n)=>[];const v=l();(v||"undefined"!=typeof Element)&&(g=(e,t)=>e.contains(t),_=(()=>{if(v||Element.prototype.matches)return(e,t)=>e.matches(t);{const e=Element.prototype,t=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;return t?(e,n)=>t.apply(e,[n]):_}})(),y=(e,t,n)=>{let i=[];if(n)i.push(...e.querySelectorAll(t));else{const n=e.querySelector(t);n&&i.push(n)}return i});let w=null,S=!1;function M(e){w||(w=("undefined"!=typeof document?document.body:null)||{},S=!!w.style&&"WebkitAppearance"in w.style);let t=!0;return w.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in w.style,!t&&S)&&(t="Webkit"+e.charAt(0).toUpperCase()+e.substr(1)in w.style),t}const x=_,k=g,D=y;function T(e){const t={};return Object.keys(e).forEach(n=>{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");t[i]=e[n]}),t}let C=(()=>{class e{validateStyleProperty(e){return M(e)}matchesElement(e,t){return x(e,t)}containsElement(e,t){return k(e,t)}query(e,t,n){return D(e,t,n)}computeStyle(e,t,n){return n||""}animate(e,t,n,i,r,s=[],o){return new c.d(n,i)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),O=(()=>{class e{}return e.NOOP=new C,e})();const R="ng-enter",L="ng-leave",E="ng-trigger",A=".ng-trigger",I="ng-animating",P=".ng-animating";function j(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:N(parseFloat(t[1]),t[2])}function N(e,t){switch(t){case"s":return 1e3*e;default:return e}}function F(e,t,n){return e.hasOwnProperty("duration")?e:function(e,t,n){let i,r=0,s="";if("string"==typeof e){const n=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return t.push(`The provided timing value "${e}" is invalid.`),{duration:0,delay:0,easing:""};i=N(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=N(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=e;if(!n){let n=!1,s=t.length;i<0&&(t.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(t.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&t.splice(s,0,`The provided timing value "${e}" is invalid.`)}return{duration:i,delay:r,easing:s}}(e,t,n)}function Y(e,t={}){return Object.keys(e).forEach(n=>{t[n]=e[n]}),t}function z(e,t,n={}){if(t)for(let i in e)n[i]=e[i];else Y(e,n);return n}function $(e,t,n){return n?t+":"+n+";":""}function H(e){let t="";for(let n=0;n<e.style.length;n++){const i=e.style.item(n);t+=$(0,i,e.style.getPropertyValue(i))}for(const n in e.style)e.style.hasOwnProperty(n)&&!n.startsWith("_")&&(t+=$(0,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.style[n]));e.setAttribute("style",t)}function W(e,t,n){e.style&&(Object.keys(t).forEach(i=>{const r=K(i);n&&!n.hasOwnProperty(i)&&(n[i]=e.style[r]),e.style[r]=t[i]}),l()&&H(e))}function V(e,t){e.style&&(Object.keys(t).forEach(t=>{const n=K(t);e.style[n]=""}),l()&&H(e))}function B(e){return Array.isArray(e)?1==e.length?e[0]:Object(c.f)(e):e}const U=new RegExp("{{\\s*(.+?)\\s*}}","g");function G(e){let t=[];if("string"==typeof e){let n;for(;n=U.exec(e);)t.push(n[1]);U.lastIndex=0}return t}function q(e,t,n){const i=e.toString(),r=i.replace(U,(e,i)=>{let r=t[i];return t.hasOwnProperty(i)||(n.push("Please provide a value for the animation param "+i),r=""),r.toString()});return r==i?e:r}function J(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}const Q=/-+([a-z0-9])/g;function K(e){return e.replace(Q,(...e)=>e[1].toUpperCase())}function Z(e,t){return 0===e||0===t}function X(e,t,n){const i=Object.keys(n);if(i.length&&t.length){let s=t[0],o=[];if(i.forEach(e=>{s.hasOwnProperty(e)||o.push(e),s[e]=n[e]}),o.length)for(var r=1;r<t.length;r++){let n=t[r];o.forEach((function(t){n[t]=te(e,t)}))}}return t}function ee(e,t,n){switch(t.type){case 7:return e.visitTrigger(t,n);case 0:return e.visitState(t,n);case 1:return e.visitTransition(t,n);case 2:return e.visitSequence(t,n);case 3:return e.visitGroup(t,n);case 4:return e.visitAnimate(t,n);case 5:return e.visitKeyframes(t,n);case 6:return e.visitStyle(t,n);case 8:return e.visitReference(t,n);case 9:return e.visitAnimateChild(t,n);case 10:return e.visitAnimateRef(t,n);case 11:return e.visitQuery(t,n);case 12:return e.visitStagger(t,n);default:throw new Error("Unable to resolve animation metadata node #"+t.type)}}function te(e,t){return window.getComputedStyle(e)[t]}const ne="*";function ie(e,t){const n=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(e=>function(e,t,n){if(":"==e[0]){const i=function(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return t.push(`The transition alias value "${e}" is not supported`),"* => *"}}(e,n);if("function"==typeof i)return void t.push(i);e=i}const i=e.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${e}" is not supported`),t;const r=i[1],s=i[2],o=i[3];t.push(oe(r,o)),"<"!=s[0]||r==ne&&o==ne||t.push(oe(o,r))}(e,n,t)):n.push(e),n}const re=new Set(["true","1"]),se=new Set(["false","0"]);function oe(e,t){const n=re.has(e)||se.has(e),i=re.has(t)||se.has(t);return(r,s)=>{let o=e==ne||e==r,a=t==ne||t==s;return!o&&n&&"boolean"==typeof r&&(o=r?re.has(e):se.has(e)),!a&&i&&"boolean"==typeof s&&(a=s?re.has(t):se.has(t)),o&&a}}const ae=new RegExp("s*:selfs*,?","g");function ce(e,t,n){return new le(e).build(t,n)}class le{constructor(e){this._driver=e}build(e,t){const n=new ue(t);return this._resetContextStyleTimingState(n),ee(this,B(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0;const r=[],s=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(e=>{if(this._resetContextStyleTimingState(t),0==e.type){const n=e,i=n.name;i.toString().split(/\s*,\s*/).forEach(e=>{n.name=e,r.push(this.visitState(n,t))}),n.name=i}else if(1==e.type){const r=this.visitTransition(e,t);n+=r.queryCount,i+=r.depCount,s.push(r)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(e,t){const n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(e=>{if(de(e)){const t=e;Object.keys(t).forEach(e=>{G(t[e]).forEach(e=>{s.hasOwnProperty(e)||r.add(e)})})}}),r.size){const n=J(r.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const n=ee(this,B(e.animation),t);return{type:1,matchers:ie(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:he(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(e=>ee(this,e,t)),options:he(e.options)}}visitGroup(e,t){const n=t.currentTime;let i=0;const r=e.steps.map(e=>{t.currentTime=n;const r=ee(this,e,t);return i=Math.max(i,t.currentTime),r});return t.currentTime=i,{type:3,steps:r,options:he(e.options)}}visitAnimate(e,t){const n=function(e,t){let n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return fe(F(e,t).duration,0,"");const i=e;if(i.split(/\s+/).some(e=>"{"==e.charAt(0)&&"{"==e.charAt(1))){const e=fe(0,0,"");return e.dynamic=!0,e.strValue=i,e}return n=n||F(i,t),fe(n.duration,n.delay,n.easing)}(e.timings,t.errors);let i;t.currentAnimateTimings=n;let r=e.styles?e.styles:Object(c.h)({});if(5==r.type)i=this.visitKeyframes(r,t);else{let r=e.styles,s=!1;if(!r){s=!0;const e={};n.easing&&(e.easing=n.easing),r=Object(c.h)(e)}t.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,t);o.isEmptyStep=s,i=o}return t.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(e,t){const n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){const n=[];Array.isArray(e.styles)?e.styles.forEach(e=>{"string"==typeof e?e==c.a?n.push(e):t.errors.push(`The provided style string value ${e} is not allowed.`):n.push(e)}):n.push(e.styles);let i=!1,r=null;return n.forEach(e=>{if(de(e)){const t=e,n=t.easing;if(n&&(r=n,delete t.easing),!i)for(let e in t)if(t[e].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:e.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(e,t){const n=t.currentAnimateTimings;let i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.delay),e.styles.forEach(e=>{"string"!=typeof e&&Object.keys(e).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void t.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=t.collectedStyles[t.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(t.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),t.options&&function(e,t,n){const i=t.params||{},r=G(e);r.length&&r.forEach(e=>{i.hasOwnProperty(e)||n.push(`Unable to resolve the local animation param ${e} in the given list of values`)})}(e[n],t.options,t.errors)})})}visitKeyframes(e,t){const n={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const c=e.steps.map(e=>{const n=this._makeStyleAst(e,t);let c=null!=n.offset?n.offset:function(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(e=>{if(de(e)&&e.hasOwnProperty("offset")){const n=e;t=parseFloat(n.offset),delete n.offset}});else if(de(e)&&e.hasOwnProperty("offset")){const n=e;t=parseFloat(n.offset),delete n.offset}return t}(n.styles),l=0;return null!=c&&(i++,l=n.offset=c),o=o||l<0||l>1,s=s||l<a,a=l,r.push(l),n});o&&t.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),s&&t.errors.push("Please ensure that all keyframe offsets are in order");const l=e.steps.length;let u=0;i>0&&i<l?t.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==i&&(u=1/(l-1));const d=l-1,h=t.currentTime,f=t.currentAnimateTimings,p=f.duration;return c.forEach((e,i)=>{const s=u>0?i==d?1:u*i:r[i],o=s*p;t.currentTime=h+f.delay+o,f.duration=o,this._validateStyleAst(e,t),e.offset=s,n.styles.push(e)}),n}visitReference(e,t){return{type:8,animation:ee(this,B(e.animation),t),options:he(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:he(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:he(e.options)}}visitQuery(e,t){const n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[r,s]=function(e){const t=!!e.split(/\s*,\s*/).find(e=>":self"==e);return t&&(e=e.replace(ae,"")),[e=e.replace(/@\*/g,A).replace(/@\w+/g,e=>".ng-trigger-"+e.substr(1)).replace(/:animating/g,P),t]}(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,m(t.collectedStyles,t.currentQuerySelector,{});const o=ee(this,B(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:e.selector,options:he(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const n="full"===e.timings?{duration:0,delay:0,easing:"full"}:F(e.timings,t.errors,!0);return{type:12,animation:ee(this,B(e.animation),t),timings:n,options:null}}}class ue{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function de(e){return!Array.isArray(e)&&"object"==typeof e}function he(e){var t;return e?(e=Y(e)).params&&(e.params=(t=e.params)?Y(t):null):e={},e}function fe(e,t,n){return{duration:e,delay:t,easing:n}}function pe(e,t,n,i,r,s,o=null,a=!1){return{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class me{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const be=new RegExp(":enter","g"),ge=new RegExp(":leave","g");function _e(e,t,n,i,r,s={},o={},a,c,l=[]){return(new ye).buildKeyframes(e,t,n,i,r,s,o,a,c,l)}class ye{buildKeyframes(e,t,n,i,r,s,o,a,c,l=[]){c=c||new me;const u=new we(e,t,c,i,r,l,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),ee(this,n,u);const d=u.timelines.filter(e=>e.containsAnimation());if(d.length&&Object.keys(o).length){const e=d[d.length-1];e.allowOnlyTimelineStyles()||e.setStyles([o],null,u.errors,a)}return d.length?d.map(e=>e.buildKeyframes()):[pe(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const n=t.subInstructions.consume(t.element);if(n){const i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&t.transformIntoNewTimeline(s)}t.previousNode=e}visitAnimateRef(e,t){const n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,n){let i=t.currentTimeline.currentTime;const r=null!=n.duration?j(n.duration):null,s=null!=n.delay?j(n.delay):null;return 0!==r&&e.forEach(e=>{const n=t.appendInstructionToTimeline(e,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(e,t){t.updateOptions(e.options,!0),ee(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const n=t.subContextCount;let i=t;const r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ve);const e=j(r.delay);i.delayNextStep(e)}e.steps.length&&(e.steps.forEach(e=>ee(this,e,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const n=[];let i=t.currentTimeline.currentTime;const r=e.options&&e.options.delay?j(e.options.delay):0;e.steps.forEach(s=>{const o=t.createSubContext(e.options);r&&o.delayNextStep(r),ee(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(e=>t.currentTimeline.mergeTimelineCollectedStyles(e)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const n=e.strValue;return F(t.params?q(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());const r=e.style;5==r.type?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,s=t.createSubContext().currentTimeline;s.easing=n.easing,e.styles.forEach(e=>{s.forwardTime((e.offset||0)*r),s.setStyles(e.styles,e.easing,t.errors,t.options),s.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(s),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){const n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?j(i.delay):0;r&&(6===t.previousNode.type||0==n&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=ve);let s=n;const o=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{t.currentQueryIndex=i;const o=t.createSubContext(e.options,n);r&&o.delayNextStep(r),n===t.element&&(a=o.currentTimeline),ee(this,e.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),a&&(t.currentTimeline.mergeTimelineCollectedStyles(a),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const n=t.parentContext,i=t.currentTimeline,r=e.timings,s=Math.abs(r.duration),o=s*(t.currentQueryTotal-1);let a=s*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const c=t.currentTimeline;a&&c.delayNextStep(a);const l=c.currentTime;ee(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-l+(i.startTime-n.currentTimeline.startTime)}}const ve={};class we{constructor(e,t,n,i,r,s,o,a){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ve,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new Se(this._driver,t,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const n=e;let i=this.options;null!=n.duration&&(i.duration=j(n.duration)),null!=n.delay&&(i.delay=j(n.delay));const r=n.params;if(r){let e=i.params;e||(e=this.options.params={}),Object.keys(r).forEach(n=>{t&&e.hasOwnProperty(n)||(e[n]=q(r[n],e,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const n=e.params={};Object.keys(t).forEach(e=>{n[e]=t[e]})}}return e}createSubContext(e=null,t,n){const i=t||this.element,r=new we(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){const i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},r=new Me(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,i,r,s){let o=[];if(i&&o.push(this.element),e.length>0){e=(e=e.replace(be,"."+this._enterClassName)).replace(ge,"."+this._leaveClassName);let t=this._driver.query(this.element,e,1!=n);0!==n&&(t=n<0?t.slice(t.length+n,t.length):t.slice(0,n)),o.push(...t)}return r||0!=o.length||s.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),o}}class Se{constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new Se(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(e=>{this._backFill[e]=this._globalTimelineStyles[e]||c.a,this._currentKeyframe[e]=c.a}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&(this._previousKeyframe.easing=t);const r=i&&i.params||{},s=function(e,t){const n={};let i;return e.forEach(e=>{"*"===e?(i=i||Object.keys(t),i.forEach(e=>{n[e]=c.a})):z(e,!1,n)}),n}(e,this._globalTimelineStyles);Object.keys(s).forEach(e=>{const t=q(s[e],r,n);this._pendingStyles[e]=t,this._localTimelineStyles.hasOwnProperty(e)||(this._backFill[e]=this._globalTimelineStyles.hasOwnProperty(e)?this._globalTimelineStyles[e]:c.a),this._updateStyle(e,t)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(t=>{this._currentKeyframe[t]=e[t]}),Object.keys(this._localTimelineStyles).forEach(e=>{this._currentKeyframe.hasOwnProperty(e)||(this._currentKeyframe[e]=this._localTimelineStyles[e])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const n=this._styleSummary[t],i=e._styleSummary[t];(!n||i.time>n.time)&&this._updateStyle(t,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=z(r,!0);Object.keys(o).forEach(n=>{const i=o[n];i==c.l?e.add(n):i==c.a&&t.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=e.size?J(e.values()):[],s=t.size?J(t.values()):[];if(n){const e=i[0],t=Y(e);e.offset=0,t.offset=1,i=[e,t]}return pe(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class Me extends Se{constructor(e,t,n,i,r,s,o=!1){super(e,t,s.delay),this.element=t,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const r=[],s=n+t,o=t/s,a=z(e[0],!1);a.offset=0,r.push(a);const c=z(e[0],!1);c.offset=xe(o),r.push(c);const l=e.length-1;for(let i=1;i<=l;i++){let o=z(e[i],!1);o.offset=xe((t+o.offset*n)/s),r.push(o)}n=s,t=0,i="",e=r}return pe(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}}function xe(e,t=3){const n=Math.pow(10,t-1);return Math.round(e*n)/n}class ke{}class De extends ke{normalizePropertyName(e,t){return K(e)}normalizeStyleValue(e,t,n,i){let r="";const s=n.toString().trim();if(Te[t]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const t=n.match(/^[+-]?[\d\.]+([a-z]*)$/);t&&0==t[1].length&&i.push(`Please provide a CSS unit value for ${e}:${n}`)}return s+r}}const Te=(()=>function(e){const t={};return e.forEach(e=>t[e]=!0),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function Ce(e,t,n,i,r,s,o,a,c,l,u,d,h){return{type:0,element:e,triggerName:t,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:c,preStyleProps:l,postStyleProps:u,totalTime:d,errors:h}}const Oe={};class Re{constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return function(e,t,n,i,r){return e.some(e=>e(t,n,i,r))}(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){const i=this._stateStyles["*"],r=this._stateStyles[e],s=i?i.buildStyles(t,n):{};return r?r.buildStyles(t,n):s}build(e,t,n,i,r,s,o,a,c,l){const u=[],d=this.ast.options&&this.ast.options.params||Oe,h=this.buildStyles(n,o&&o.params||Oe,u),f=a&&a.params||Oe,p=this.buildStyles(i,f,u),b=new Set,g=new Map,_=new Map,y="void"===i,v={params:Object.assign(Object.assign({},d),f)},w=l?[]:_e(e,t,this.ast.animation,r,s,h,p,v,c,u);let S=0;if(w.forEach(e=>{S=Math.max(e.duration+e.delay,S)}),u.length)return Ce(t,this._triggerName,n,i,y,h,p,[],[],g,_,S,u);w.forEach(e=>{const n=e.element,i=m(g,n,{});e.preStyleProps.forEach(e=>i[e]=!0);const r=m(_,n,{});e.postStyleProps.forEach(e=>r[e]=!0),n!==t&&b.add(n)});const M=J(b.values());return Ce(t,this._triggerName,n,i,y,h,p,w,M,g,_,S)}}class Le{constructor(e,t){this.styles=e,this.defaultParams=t}buildStyles(e,t){const n={},i=Y(this.defaultParams);return Object.keys(e).forEach(t=>{const n=e[t];null!=n&&(i[t]=n)}),this.styles.styles.forEach(e=>{if("string"!=typeof e){const r=e;Object.keys(r).forEach(e=>{let s=r[e];s.length>1&&(s=q(s,i,t)),n[e]=s})}}),n}}class Ee{constructor(e,t){this.name=e,this.ast=t,this.transitionFactories=[],this.states={},t.states.forEach(e=>{this.states[e.name]=new Le(e.style,e.options&&e.options.params||{})}),Ae(this.states,"true","1"),Ae(this.states,"false","0"),t.transitions.forEach(t=>{this.transitionFactories.push(new Re(e,t,this.states))}),this.fallbackTransition=new Re(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[(e,t)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(r=>r.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}}function Ae(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}const Ie=new me;class Pe{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(e,t){const n=[],i=ce(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[e]=i}_buildPlayer(e,t,n){const i=e.element,r=d(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){const i=[],r=this._animations[e];let s;const o=new Map;if(r?(s=_e(this._driver,t,r,R,L,{},{},n,Ie,i),s.forEach(e=>{const t=m(o,e.element,{});e.postStyleProps.forEach(e=>t[e]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error("Unable to create the animation due to the following errors: "+i.join("\n"));o.forEach((e,t)=>{Object.keys(e).forEach(n=>{e[n]=this._driver.computeStyle(t,n,c.a)})});const a=u(s.map(e=>{const t=o.get(e.element);return this._buildPlayer(e,{},t)}));return this._playersById[e]=a,a.onDestroy(()=>this.destroy(e)),this.players.push(a),a}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by "+e);return t}listen(e,t,n,i){const r=p(t,"","","");return h(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if("register"==n)return void this.register(e,i[0]);if("create"==n)return void this.create(e,t,i[0]||{});const r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}}const je="ng-animate-queued",Ne="ng-animate-disabled",Fe=".ng-animate-disabled",Ye=[],ze={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},$e={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class He{constructor(e,t=""){this.namespaceId=t;const n=e&&e.hasOwnProperty("value");if(this.value=null!=(i=n?e.value:e)?i:null,n){const t=Y(e);delete t.value,this.options=t}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const e=this.options.params;Object.keys(t).forEach(n=>{null==e[n]&&(e[n]=t[n])})}}}const We="void",Ve=new He(We);class Be{constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,Ze(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${t}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${t}" is not supported!`);var r;const s=m(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};s.push(o);const a=m(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(Ze(e,E),Ze(e,"ng-trigger-"+t),a[t]=Ve),()=>{this._engine.afterFlush(()=>{const e=s.indexOf(o);e>=0&&s.splice(e,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,n,i=!0){const r=this._getTrigger(t),s=new Ge(this.id,t,e);let o=this._engine.statesByElement.get(e);o||(Ze(e,E),Ze(e,"ng-trigger-"+t),this._engine.statesByElement.set(e,o={}));let a=o[t];const c=new He(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&c.absorbOptions(a.options),o[t]=c,a||(a=Ve),c.value!==We&&a.value===c.value){if(!function(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!=i.length)return!1;for(let r=0;r<n.length;r++){const i=n[r];if(!t.hasOwnProperty(i)||e[i]!==t[i])return!1}return!0}(a.params,c.params)){const t=[],n=r.matchStyles(a.value,a.params,t),i=r.matchStyles(c.value,c.params,t);t.length?this._engine.reportError(t):this._engine.afterFlush(()=>{V(e,n),W(e,i)})}return}const l=m(this._engine.playersByElement,e,[]);l.forEach(e=>{e.namespaceId==this.id&&e.triggerName==t&&e.queued&&e.destroy()});let u=r.matchTransition(a.value,c.value,e,c.params),d=!1;if(!u){if(!i)return;u=r.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:u,fromState:a,toState:c,player:s,isFallbackTransition:d}),d||(Ze(e,je),s.onStart(()=>{Xe(e,je)})),s.onDone(()=>{let t=this.players.indexOf(s);t>=0&&this.players.splice(t,1);const n=this._engine.playersByElement.get(e);if(n){let e=n.indexOf(s);e>=0&&n.splice(e,1)}}),this.players.push(s),l.push(s),s}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,n)=>{delete t[e]}),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(t=>t.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(e=>e.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const n=this._engine.driver.query(e,A,!0);n.forEach(e=>{if(e.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(e);n.size?n.forEach(n=>n.triggerLeaveAnimation(e,t,!1,!0)):this.clearElementCache(e)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(e=>this.clearElementCache(e)))}triggerLeaveAnimation(e,t,n,i){const r=this._engine.statesByElement.get(e);if(r){const s=[];if(Object.keys(r).forEach(t=>{if(this._triggers[t]){const n=this.trigger(e,t,We,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),n&&u(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e);if(t){const n=new Set;t.forEach(t=>{const i=t.name;if(n.has(i))return;n.add(i);const r=this._triggers[i].fallbackTransition,s=this._engine.statesByElement.get(e)[i]||Ve,o=new He(We),a=new Ge(this.id,i,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:i,transition:r,fromState:s,toState:o,player:a,isFallbackTransition:!0})})}}removeNode(e,t){const n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){const t=n.players.length?n.playersByQueriedElement.get(e):[];if(t&&t.length)i=!0;else{let t=e;for(;t=t.parentNode;)if(n.statesByElement.get(t)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{const i=e.__ng_removed;i&&i!==ze||(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){Ze(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(t=>{if(t.name==n.triggerName){const i=p(r,n.triggerName,n.fromState.value,n.toState.value);i._data=e,h(n.player,t.phase,i,t.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((e,t)=>{const n=e.transition.ast.depCount,i=t.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(e.element,t.element)?1:-1})}destroy(e){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(t=>t.element===e)||t,t}}class Ue{constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(e,t)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(t=>{t.queued&&e.push(t)})}),e}createNamespace(e,t){const n=new Be(e,t,this);return t.parentNode?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,t)){this._namespaceList.splice(r+1,0,e),i=!0;break}i||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){if(!e)return;const n=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[e];const t=this._namespaceList.indexOf(n);t>=0&&this._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(()=>n.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,n=this.statesByElement.get(e);if(n){const e=Object.keys(n);for(let i=0;i<e.length;i++){const r=n[e[i]].namespaceId;if(r){const e=this._fetchNamespace(r);e&&t.add(e)}}}return t}trigger(e,t,n,i){if(qe(t)){const r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!qe(t))return;const r=t.__ng_removed;if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;const e=this.collectedLeaveElements.indexOf(t);e>=0&&this.collectedLeaveElements.splice(e,1)}if(e){const i=this._fetchNamespace(e);i&&i.insertNode(t,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),Ze(e,Ne)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Xe(e,Ne))}removeNode(e,t,n,i){if(qe(t)){const r=e?this._fetchNamespace(e):null;if(r?r.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),n){const n=this.namespacesByHostElement.get(t);n&&n.id!==e&&n.removeNode(t,i)}}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,n,i){this.collectedLeaveElements.push(t),t.__ng_removed={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(e,t,n,i,r){return qe(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,A,!0);t.forEach(e=>this.destroyActiveAnimationsForElement(e)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,P,!0),t.forEach(e=>this.finishActiveQueriedAnimationOnElement(e)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(e=>{e.queued?e.markedForDestroy=!0:e.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(e=>e.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return u(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e.__ng_removed;if(t&&t.setForRemoval){if(e.__ng_removed=ze,t.namespaceId){this.destroyInnerAnimations(e);const n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,Fe)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Fe,!0).forEach(e=>{this.markElementAsDisabled(e,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((e,t)=>this._balanceNamespaceList(e,t)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++)Ze(this.collectedEnterElements[n],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const n=[];try{t=this._flushAnimations(n,e)}finally{for(let e=0;e<n.length;e++)n[e]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++)this.processLeaveNode(this.collectedLeaveElements[n]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(e=>e()),this._flushFns=[],this._whenQuietFns.length){const e=this._whenQuietFns;this._whenQuietFns=[],t.length?u(t).onDone(()=>{e.forEach(e=>e())}):e.forEach(e=>e())}}reportError(e){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+e.join("\n"))}_flushAnimations(e,t){const n=new me,i=[],r=new Map,s=[],o=new Map,a=new Map,l=new Map,d=new Set;this.disabledNodes.forEach(e=>{d.add(e);const t=this.driver.query(e,".ng-animate-queued",!0);for(let n=0;n<t.length;n++)d.add(t[n])});const h=this.bodyNode,f=Array.from(this.statesByElement.keys()),p=Ke(f,this.collectedEnterElements),b=new Map;let g=0;p.forEach((e,t)=>{const n=R+g++;b.set(t,n),e.forEach(e=>Ze(e,n))});const _=[],y=new Set,v=new Set;for(let c=0;c<this.collectedLeaveElements.length;c++){const e=this.collectedLeaveElements[c],t=e.__ng_removed;t&&t.setForRemoval&&(_.push(e),y.add(e),t.hasAnimation?this.driver.query(e,".ng-star-inserted",!0).forEach(e=>y.add(e)):v.add(e))}const w=new Map,S=Ke(f,Array.from(y));S.forEach((e,t)=>{const n=L+g++;w.set(t,n),e.forEach(e=>Ze(e,n))}),e.push(()=>{p.forEach((e,t)=>{const n=b.get(t);e.forEach(e=>Xe(e,n))}),S.forEach((e,t)=>{const n=w.get(t);e.forEach(e=>Xe(e,n))}),_.forEach(e=>{this.processLeaveNode(e)})});const M=[],x=[];for(let c=this._namespaceList.length-1;c>=0;c--)this._namespaceList[c].drainQueuedTransitions(t).forEach(e=>{const t=e.player,r=e.element;if(M.push(t),this.collectedEnterElements.length){const e=r.__ng_removed;if(e&&e.setForMove)return void t.destroy()}const c=!h||!this.driver.containsElement(h,r),u=w.get(r),d=b.get(r),f=this._buildInstruction(e,n,d,u,c);if(f.errors&&f.errors.length)x.push(f);else{if(c)return t.onStart(()=>V(r,f.fromStyles)),t.onDestroy(()=>W(r,f.toStyles)),void i.push(t);if(e.isFallbackTransition)return t.onStart(()=>V(r,f.fromStyles)),t.onDestroy(()=>W(r,f.toStyles)),void i.push(t);f.timelines.forEach(e=>e.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:t,element:r}),f.queriedElements.forEach(e=>m(o,e,[]).push(t)),f.preStyleProps.forEach((e,t)=>{const n=Object.keys(e);if(n.length){let e=a.get(t);e||a.set(t,e=new Set),n.forEach(t=>e.add(t))}}),f.postStyleProps.forEach((e,t)=>{const n=Object.keys(e);let i=l.get(t);i||l.set(t,i=new Set),n.forEach(e=>i.add(e))})}});if(x.length){const e=[];x.forEach(t=>{e.push(`@${t.triggerName} has failed due to:\n`),t.errors.forEach(t=>e.push(`- ${t}\n`))}),M.forEach(e=>e.destroy()),this.reportError(e)}const k=new Map,D=new Map;s.forEach(e=>{const t=e.element;n.has(t)&&(D.set(t,t),this._beforeAnimationBuild(e.player.namespaceId,e.instruction,k))}),i.forEach(e=>{const t=e.element;this._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(e=>{m(k,t,[]).push(e),e.destroy()})});const T=_.filter(e=>tt(e,a,l)),C=new Map;Qe(C,this.driver,v,l,c.a).forEach(e=>{tt(e,a,l)&&T.push(e)});const O=new Map;p.forEach((e,t)=>{Qe(O,this.driver,new Set(e),a,c.l)}),T.forEach(e=>{const t=C.get(e),n=O.get(e);C.set(e,Object.assign(Object.assign({},t),n))});const E=[],A=[],I={};s.forEach(e=>{const{element:t,player:s,instruction:o}=e;if(n.has(t)){if(d.has(t))return s.onDestroy(()=>W(t,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let e=I;if(D.size>1){let n=t;const i=[];for(;n=n.parentNode;){const t=D.get(n);if(t){e=t;break}i.push(n)}i.forEach(t=>D.set(t,e))}const n=this._buildAnimation(s.namespaceId,o,k,r,O,C);if(s.setRealPlayer(n),e===I)E.push(s);else{const t=this.playersByElement.get(e);t&&t.length&&(s.parentPlayer=u(t)),i.push(s)}}else V(t,o.fromStyles),s.onDestroy(()=>W(t,o.toStyles)),A.push(s),d.has(t)&&i.push(s)}),A.forEach(e=>{const t=r.get(e.element);if(t&&t.length){const n=u(t);e.setRealPlayer(n)}}),i.forEach(e=>{e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(let c=0;c<_.length;c++){const e=_[c],t=e.__ng_removed;if(Xe(e,L),t&&t.hasAnimation)continue;let n=[];if(o.size){let t=o.get(e);t&&t.length&&n.push(...t);let i=this.driver.query(e,P,!0);for(let e=0;e<i.length;e++){let t=o.get(i[e]);t&&t.length&&n.push(...t)}}const i=n.filter(e=>!e.destroyed);i.length?et(this,e,i):this.processLeaveNode(e)}return _.length=0,E.forEach(e=>{this.players.push(e),e.onDone(()=>{e.destroy();const t=this.players.indexOf(e);this.players.splice(t,1)}),e.play()}),E}elementContainsData(e,t){let n=!1;const i=t.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(t)&&(n=!0),this.playersByQueriedElement.has(t)&&(n=!0),this.statesByElement.has(t)&&(n=!0),this._fetchNamespace(e).elementContainsData(t)||n}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,i,r){let s=[];if(t){const t=this.playersByQueriedElement.get(e);t&&(s=t)}else{const t=this.playersByElement.get(e);if(t){const e=!r||r==We;t.forEach(t=>{t.queued||(e||t.triggerName==i)&&s.push(t)})}}return(n||i)&&(s=s.filter(e=>!(n&&n!=e.namespaceId||i&&i!=e.triggerName))),s}_beforeAnimationBuild(e,t,n){const i=t.element,r=t.isRemovalTransition?void 0:e,s=t.isRemovalTransition?void 0:t.triggerName;for(const o of t.timelines){const e=o.element,a=e!==i,c=m(n,e,[]);this._getPreviousPlayers(e,a,r,s,t.toState).forEach(e=>{const t=e.getRealPlayer();t.beforeDestroy&&t.beforeDestroy(),e.destroy(),c.push(e)})}V(i,t.fromStyles)}_buildAnimation(e,t,n,i,r,s){const o=t.triggerName,a=t.element,l=[],h=new Set,f=new Set,p=t.timelines.map(t=>{const u=t.element;h.add(u);const p=u.__ng_removed;if(p&&p.removedBeforeQueried)return new c.d(t.duration,t.delay);const m=u!==a,b=function(e){const t=[];return function e(t,n){for(let i=0;i<t.length;i++){const r=t[i];r instanceof c.k?e(r.players,n):n.push(r)}}(e,t),t}((n.get(u)||Ye).map(e=>e.getRealPlayer())).filter(e=>!!e.element&&e.element===u),g=r.get(u),_=s.get(u),y=d(0,this._normalizer,0,t.keyframes,g,_),v=this._buildPlayer(t,y,b);if(t.subTimeline&&i&&f.add(u),m){const t=new Ge(e,o,u);t.setRealPlayer(v),l.push(t)}return v});l.forEach(e=>{m(this.playersByQueriedElement,e.element,[]).push(e),e.onDone(()=>function(e,t,n){let i;if(e instanceof Map){if(i=e.get(t),i){if(i.length){const e=i.indexOf(n);i.splice(e,1)}0==i.length&&e.delete(t)}}else if(i=e[t],i){if(i.length){const e=i.indexOf(n);i.splice(e,1)}0==i.length&&delete e[t]}return i}(this.playersByQueriedElement,e.element,e))}),h.forEach(e=>Ze(e,I));const b=u(p);return b.onDestroy(()=>{h.forEach(e=>Xe(e,I)),W(a,t.toStyles)}),f.forEach(e=>{m(i,e,[]).push(b)}),b}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new c.d(e.duration,e.delay)}}class Ge{constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n,this._player=new c.d,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(n=>h(e,t,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){m(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function qe(e){return e&&1===e.nodeType}function Je(e,t){const n=e.style.display;return e.style.display=null!=t?t:"none",n}function Qe(e,t,n,i,r){const s=[];n.forEach(e=>s.push(Je(e)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(e=>{const n=s[e]=t.computeStyle(i,e,r);n&&0!=n.length||(i.__ng_removed=$e,o.push(i))}),e.set(i,s)});let a=0;return n.forEach(e=>Je(e,s[a++])),o}function Ke(e,t){const n=new Map;if(e.forEach(e=>n.set(e,[])),0==t.length)return n;const i=new Set(t),r=new Map;return t.forEach(e=>{const t=function e(t){if(!t)return 1;let s=r.get(t);if(s)return s;const o=t.parentNode;return s=n.has(o)?o:i.has(o)?1:e(o),r.set(t,s),s}(e);1!==t&&n.get(t).push(e)}),n}function Ze(e,t){if(e.classList)e.classList.add(t);else{let n=e.$$classes;n||(n=e.$$classes={}),n[t]=!0}}function Xe(e,t){if(e.classList)e.classList.remove(t);else{let n=e.$$classes;n&&delete n[t]}}function et(e,t,n){u(n).onDone(()=>e.processLeaveNode(t))}function tt(e,t,n){const i=n.get(e);if(!i)return!1;let r=t.get(e);return r?i.forEach(e=>r.add(e)):t.set(e,i),n.delete(e),!0}class nt{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._triggerCache={},this.onRemovalComplete=(e,t)=>{},this._transitionEngine=new Ue(e,t,n),this._timelineEngine=new Pe(e,t,n),this._transitionEngine.onRemovalComplete=(e,t)=>this.onRemovalComplete(e,t)}registerTrigger(e,t,n,i,r){const s=e+"-"+i;let o=this._triggerCache[s];if(!o){const e=[],t=ce(this._driver,r,e);if(e.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${e.join("\n - ")}`);o=function(e,t){return new Ee(e,t)}(i,t),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(t,i,o)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n,i){this._transitionEngine.removeNode(e,t,i||!1,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if("@"==n.charAt(0)){const[e,r]=b(n);this._timelineEngine.command(e,t,r,i)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if("@"==n.charAt(0)){const[e,i]=b(n);return this._timelineEngine.listen(e,t,i,r)}return this._transitionEngine.listen(e,t,n,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function it(e,t){let n=null,i=null;return Array.isArray(t)&&t.length?(n=st(t[0]),t.length>1&&(i=st(t[t.length-1]))):t&&(n=st(t)),n||i?new rt(e,n,i):null}let rt=(()=>{class e{constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i,this._state=0;let r=e.initialStylesByElement.get(t);r||e.initialStylesByElement.set(t,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&W(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(W(this._element,this._initialStyles),this._endStyles&&(W(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(e.initialStylesByElement.delete(this._element),this._startStyles&&(V(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(V(this._element,this._endStyles),this._endStyles=null),W(this._element,this._initialStyles),this._state=3)}}return e.initialStylesByElement=new WeakMap,e})();function st(e){let t=null;const n=Object.keys(e);for(let i=0;i<n.length;i++){const r=n[i];ot(r)&&(t=t||{},t[r]=e[r])}return t}function ot(e){return"display"===e||"position"===e}const at="animation",ct="animationend";class lt{constructor(e,t,n,i,r,s,o){this._element=e,this._name=t,this._duration=n,this._delay=i,this._easing=r,this._fillMode=s,this._onDoneFn=o,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=e=>this._handleCallback(e)}apply(){!function(e,t){const n=mt(e,"").trim();n.length&&(function(e,t){let n=0;for(let i=0;i<e.length;i++)","===e.charAt(i)&&n++}(n),t=`${n}, ${t}`),pt(e,"",t)}(this._element,`${this._duration}ms ${this._easing} ${this._delay}ms 1 normal ${this._fillMode} ${this._name}`),ft(this._element,this._eventFn,!1),this._startTime=Date.now()}pause(){ut(this._element,this._name,"paused")}resume(){ut(this._element,this._name,"running")}setPosition(e){const t=dt(this._element,this._name);this._position=e*this._duration,pt(this._element,"Delay",`-${this._position}ms`,t)}getPosition(){return this._position}_handleCallback(e){const t=e._ngTestManualTimestamp||Date.now(),n=1e3*parseFloat(e.elapsedTime.toFixed(3));e.animationName==this._name&&Math.max(t-this._startTime,0)>=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),ft(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){const n=mt(e,"").split(","),i=ht(n,t);i>=0&&(n.splice(i,1),pt(e,"",n.join(",")))}(this._element,this._name))}}function ut(e,t,n){pt(e,"PlayState",n,dt(e,t))}function dt(e,t){const n=mt(e,"");return n.indexOf(",")>0?ht(n.split(","),t):ht([n],t)}function ht(e,t){for(let n=0;n<e.length;n++)if(e[n].indexOf(t)>=0)return n;return-1}function ft(e,t,n){n?e.removeEventListener(ct,t):e.addEventListener(ct,t)}function pt(e,t,n,i){const r=at+t;if(null!=i){const t=e.style[r];if(t.length){const e=t.split(",");e[i]=n,n=e.join(",")}}e.style[r]=n}function mt(e,t){return e.style[at+t]}class bt{constructor(e,t,n,i,r,s,o,a){this.element=e,this.keyframes=t,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new lt(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(e[n]=t?this._finalStyles[n]:te(this.element,n))})}this.currentSnapshot=e}}class gt extends c.d{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=T(t)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class _t{constructor(){this._count=0,this._head=document.querySelector("head"),this._warningIssued=!1}validateStyleProperty(e){return M(e)}matchesElement(e,t){return x(e,t)}containsElement(e,t){return k(e,t)}query(e,t,n){return D(e,t,n)}computeStyle(e,t,n){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,n){n=n.map(e=>T(e));let i=`@keyframes ${t} {\n`,r="";n.forEach(e=>{r=" ";const t=parseFloat(e.offset);i+=`${r}${100*t}% {\n`,r+=" ",Object.keys(e).forEach(t=>{const n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${t}: ${n};\n`)}}),i+=r+"}\n"}),i+="}\n";const s=document.createElement("style");return s.innerHTML=i,s}animate(e,t,n,i,r,s=[],o){o&&this._notifyFaultyScrubber();const a=s.filter(e=>e instanceof bt),c={};Z(n,i)&&a.forEach(e=>{let t=e.currentSnapshot;Object.keys(t).forEach(e=>c[e]=t[e])});const l=function(e){let t={};return e&&(Array.isArray(e)?e:[e]).forEach(e=>{Object.keys(e).forEach(n=>{"offset"!=n&&"easing"!=n&&(t[n]=e[n])})}),t}(t=X(e,t,c));if(0==n)return new gt(e,l);const u="gen_css_kf_"+this._count++,d=this.buildKeyframeElement(e,u,t);document.querySelector("head").appendChild(d);const h=it(e,t),f=new bt(e,t,u,n,i,r,l,h);return f.onDestroy(()=>{var e;(e=d).parentNode.removeChild(e)}),f}_notifyFaultyScrubber(){this._warningIssued||(console.warn("@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n","  visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill."),this._warningIssued=!0)}}class yt{constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,n){return e.animate(t,n)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:te(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}class vt{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(wt().toString()),this._cssKeyframesDriver=new _t}validateStyleProperty(e){return M(e)}matchesElement(e,t){return x(e,t)}containsElement(e,t){return k(e,t)}query(e,t,n){return D(e,t,n)}computeStyle(e,t,n){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const c={},l=s.filter(e=>e instanceof yt);Z(n,i)&&l.forEach(e=>{let t=e.currentSnapshot;Object.keys(t).forEach(e=>c[e]=t[e])});const u=it(e,t=X(e,t=t.map(e=>z(e,!1)),c));return new yt(e,t,a,u)}}function wt(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let St=(()=>{class e extends c.b{constructor(e,t){super(),this._nextAnimationId=0,this._renderer=e.createRenderer(t.body,{id:"0",encapsulation:i.Q.None,styles:[],data:{animation:[]}})}build(e){const t=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(e)?Object(c.f)(e):e;return kt(this._renderer,null,t,"register",[n]),new Mt(t,this._renderer)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(i.F),i.dc(o.d))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();class Mt extends c.c{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new xt(this._id,e,t||{},this._renderer)}}class xt{constructor(e,t,n,i){this.id=e,this.element=t,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return kt(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(e){this._command("setPosition",e)}getPosition(){return 0}}function kt(e,t,n,i,r){return e.setProperty(t,`@@${n}:${i}`,r)}const Dt="@",Tt="@.disabled";let Ct=(()=>{class e{constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),t.onRemovalComplete=(e,t)=>{t&&t.parentNode(e)&&t.removeChild(e.parentNode,e)}}createRenderer(e,t){const n=this.delegate.createRenderer(e,t);if(!(e&&t&&t.data&&t.data.animation)){let e=this._rendererCache.get(n);return e||(e=new Ot("",n,this.engine),this._rendererCache.set(n,e)),e}const i=t.id,r=t.id+"-"+this._currentId;this._currentId++,this.engine.register(r,e);const s=t=>{Array.isArray(t)?t.forEach(s):this.engine.registerTrigger(i,r,e,t.name,t)};return t.data.animation.forEach(s),new Rt(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){e>=0&&e<this._microtaskId?this._zone.run(()=>t(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(e=>{const[t,n]=e;t(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([t,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(i.F),i.dc(nt),i.dc(i.A))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();class Ot{constructor(e,t,n){this.namespaceId=e,this.delegate=t,this.engine=n,this.destroyNode=this.delegate.destroyNode?e=>t.destroyNode(e):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,!0)}removeChild(e,t,n){this.engine.onRemove(this.namespaceId,t,this.delegate,n)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Dt&&t==Tt?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Rt extends Ot{constructor(e,t,n,i){super(t,n,i),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Dt?"."==t.charAt(1)&&t==Tt?this.disableAnimations(e,n=void 0===n||!!n):this.engine.process(this.namespaceId,e,t.substr(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Dt){const i=function(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(e);let r=t.substr(1),s="";return r.charAt(0)!=Dt&&([r,s]=function(e){const t=e.indexOf(".");return[e.substring(0,t),e.substr(t+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,e=>{this.factory.scheduleListenerCallback(e._data||-1,n,e)})}return this.delegate.listen(e,t,n)}}let Lt=(()=>{class e extends nt{constructor(e,t,n){super(e.body,t,n)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(o.d),i.dc(O),i.dc(ke))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();const Et=[{provide:O,useFactory:function(){return"function"==typeof wt()?new vt:new _t}},{provide:new i.r("AnimationModuleType"),useValue:"BrowserAnimations"},{provide:c.b,useClass:St},{provide:ke,useFactory:function(){return new De}},{provide:nt,useClass:Lt},{provide:i.F,useFactory:function(e,t,n){return new Ct(e,t,n)},deps:[r.e,nt,i.A]}];let At=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:Et,imports:[r.a]}),e})();var It=n("EApP"),Pt=n("iInd"),jt=n("LvDl"),Nt=n.n(jt),Ft=n("mrSG"),Yt=n("xTzq");let zt=(()=>{let e=class{constructor(e){this.http=e,this.baseURL="api/cephfs",this.baseUiURL="ui-api/cephfs"}list(){return this.http.get(""+this.baseURL)}lsDir(e,t){let n=`${this.baseUiURL}/${e}/ls_dir?depth=2`;return t&&(n+="&path="+encodeURIComponent(t)),this.http.get(n)}getCephfs(e){return this.http.get(`${this.baseURL}/${e}`)}getTabs(e){return this.http.get(`ui-api/cephfs/${e}/tabs`)}getClients(e){return this.http.get(`${this.baseURL}/${e}/clients`)}evictClient(e,t){return this.http.delete(`${this.baseURL}/${e}/client/${t}`)}getMdsCounters(e){return this.http.get(`${this.baseURL}/${e}/mds_counters`)}mkSnapshot(e,t,n){let i=new a.e;return i=i.append("path",t),Nt.a.isUndefined(n)||(i=i.append("name",n)),this.http.post(`${this.baseURL}/${e}/snapshot`,null,{params:i})}rmSnapshot(e,t,n){let i=new a.e;return i=i.append("path",t),i=i.append("name",n),this.http.delete(`${this.baseURL}/${e}/snapshot`,{params:i})}quota(e,t,n){let i=new a.e;return i=i.append("path",t),this.http.put(`${this.baseURL}/${e}/quota`,n,{observe:"response",params:i})}};return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(Ft.b)([Yt.a,Object(Ft.d)("design:paramtypes",[a.b])],e),e})();var $t=n("+fVR"),Ht=n("x38r"),Wt=n("vCyI"),Vt=n("a0VL"),Bt=n("uIqm"),Ut=n("PqYM"),Gt=n("VxPD"),qt=n("yJti"),Jt=n("aexS"),Qt=n("G0yt"),Kt=n("JP8w"),Zt=n("Fgil"),Xt=n("o4+5"),en=n("FSuO"),tn=n("wd/R"),nn=n.n(tn),rn=n("NEZu"),sn=n("hrfs");const on=["chartCanvas"],an=["chartTooltip"];let cn=(()=>{class e{constructor(){this.lhsCounter="mds_mem.ino",this.rhsCounter="mds_server.handle_client_request",this.chart={datasets:[{label:this.lhsCounter,yAxisID:"LHS",data:[],lineTension:.1},{label:this.rhsCounter,yAxisID:"RHS",data:[],lineTension:.1}],options:{title:{text:"",display:!0},responsive:!0,maintainAspectRatio:!1,legend:{position:"top"},scales:{xAxes:[{position:"top",type:"time",time:{displayFormats:{quarter:"MMM YYYY"}},ticks:{maxRotation:0}}],yAxes:[{id:"LHS",type:"linear",position:"left"},{id:"RHS",type:"linear",position:"right"}]},tooltips:{enabled:!1,mode:"index",intersect:!1,position:"nearest",callbacks:{title:(e,t)=>{let n=0;if(e.length>0){const i=e[0];n=t.datasets[i.datasetIndex].data[i.index].x}return n.toString()}}}},chartType:"line"}}ngOnInit(){Nt.a.isUndefined(this.mdsCounter)||(this.setChartTooltip(),this.updateChart())}ngOnChanges(){Nt.a.isUndefined(this.mdsCounter)||this.updateChart()}setChartTooltip(){const e=new rn.a(this.chartCanvas,this.chartTooltip,e=>e.caretX+"px",e=>e.caretY-e.height-23+"px");e.getTitle=e=>nn()(e,"x").format("LTS"),e.checkOffset=!0,Nt.a.merge(this.chart,{options:{title:{text:this.mdsCounter.name},tooltips:{custom:t=>e.customTooltips(t)}}})}updateChart(){const e=[{data:this.convertTimeSeries(this.mdsCounter[this.lhsCounter])},{data:this.deltaTimeSeries(this.mdsCounter[this.rhsCounter])}];Nt.a.merge(this.chart,{datasets:e}),this.chart.datasets=[...this.chart.datasets]}convertTimeSeries(e){const t=[];return Nt.a.each(e,e=>{t.push({x:1e3*e[0],y:e[1]})}),t.shift(),t}deltaTimeSeries(e){let t,n=e[0];const i=[];for(t=1;t<e.length;t++){const r=e[t];i.push({x:1e3*r[0],y:r[1]-n[1]}),n=r}return i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-chart"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(on,!0),i.Jc(an,!0)),2&e&&(i.zc(n=i.hc())&&(t.chartCanvas=n.first),i.zc(n=i.hc())&&(t.chartTooltip=n.first))},inputs:{mdsCounter:"mdsCounter"},features:[i.wb],decls:6,vars:3,consts:[[1,"chart-container"],["baseChart","",3,"datasets","options","chartType"],["chartCanvas",""],[1,"chartjs-tooltip"],["chartTooltip",""]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Nb(1,"canvas",1,2),i.Sb(3,"div",3,4),i.Nb(5,"table"),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.pc("datasets",t.chart.datasets)("options",t.chart.options)("chartType",t.chart.chartType))},directives:[sn.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:rgba(0,0,0,.7);border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid transparent;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-container[_ngcontent-%COMP%]{height:500px;margin-bottom:20px;position:relative;width:100%}']}),e})();var ln=n("GgAd");const un=["poolUsageTpl"],dn=["activityTmpl"];function hn(e,t){if(1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",11),i.Nb(2,"cd-cephfs-chart",12),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.pc("mdsCounter",e)}}function fn(e,t){if(1&e&&i.Nb(0,"cd-usage-bar",13),2&e){const e=t.row;i.pc("total",e.size)("used",e.used)}}function pn(e,t){1&e&&(i.Oc(0),i.jc(1,"dimless")),2&e&&i.Rc(" ","standby-replay"===t.row.state?"Evts":"Reqs",": ",i.kc(1,2,t.value)," /s\n")}let mn=(()=>{class e{constructor(e,t){this.dimlessBinary=e,this.dimless=t,this.standbys=[],this.objectValues=Object.values}ngOnChanges(){this.setStandbys()}setStandbys(){this.standbys=[{key:"Standby daemons",value:this.data.standbys}]}ngOnInit(){this.columns={ranks:[{prop:"rank",name:"Rank"},{prop:"state",name:"State"},{prop:"mds",name:"Daemon"},{prop:"activity",name:"Activity",cellTemplate:this.activityTmpl},{prop:"dns",name:"Dentries",pipe:this.dimless},{prop:"inos",name:"Inodes",pipe:this.dimless},{prop:"dirs",name:"Dirs",pipe:this.dimless},{prop:"caps",name:"Caps",pipe:this.dimless}],pools:[{prop:"pool",name:"Pool"},{prop:"type",name:"Type"},{prop:"size",name:"Size",pipe:this.dimlessBinary},{name:"Usage",cellTemplate:this.poolUsageTpl,comparator:(e,t,n,i)=>{const r=n.used/n.avail,s=i.used/i.avail;return r===s?0:r>s?1:-1}}]}}trackByFn(e,t){return t.name}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Zt.a),i.Mb(Xt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-detail"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(un,!0),i.Jc(dn,!0)),2&e&&(i.zc(n=i.hc())&&(t.poolUsageTpl=n.first),i.zc(n=i.hc())&&(t.activityTmpl=n.first))},inputs:{data:"data"},features:[i.wb],decls:19,vars:9,consts:function(){return[[1,"row"],[1,"col-sm-6"],"Ranks",[3,"data","columns","toolHeader"],"Standbys",[3,"data"],"Pools","MDS performance counters",["class","row",4,"ngFor","ngForOf","ngForTrackBy"],["poolUsageTpl",""],["activityTmpl",""],[1,"col-md-12"],[3,"mdsCounter"],[3,"total","used"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"legend"),i.Wb(3,2),i.Rb(),i.Nb(4,"cd-table",3),i.Sb(5,"legend"),i.Wb(6,4),i.Rb(),i.Nb(7,"cd-table-key-value",5),i.Rb(),i.Sb(8,"div",1),i.Sb(9,"legend"),i.Wb(10,6),i.Rb(),i.Nb(11,"cd-table",3),i.Rb(),i.Rb(),i.Sb(12,"legend"),i.Wb(13,7),i.Rb(),i.Mc(14,hn,3,1,"div",8),i.Mc(15,fn,1,2,"ng-template",null,9,i.Nc),i.Mc(17,pn,2,4,"ng-template",null,10,i.Nc)),2&e&&(i.yb(4),i.pc("data",t.data.ranks)("columns",t.columns.ranks)("toolHeader",!1),i.yb(3),i.pc("data",t.standbys),i.yb(4),i.pc("data",t.data.pools)("columns",t.columns.pools)("toolHeader",!1),i.yb(3),i.pc("ngForOf",t.objectValues(t.data.mdsCounters))("ngForTrackBy",t.trackByFn))},directives:[Bt.a,en.a,o.q,cn,ln.a],pipes:[Xt.a],styles:[".progress[_ngcontent-%COMP%]{margin-bottom:0}"]}),e})();var bn=n("0+/T"),gn=n("sne2"),_n=n("oxzT"),yn=n("mtw6"),vn=n("JK/P"),wn=n("9nlD"),Sn=n("S7zO");let Mn=(()=>{class e{constructor(e,t,n,r,s){this.cephfsService=e,this.modalService=t,this.notificationService=n,this.authStorageService=r,this.actionLabels=s,this.triggerApiUpdate=new i.o,this.selection=new Wt.a,this.permission=this.authStorageService.getPermissions().cephfs,this.tableActions=[{permission:"update",icon:_n.a.signOut,click:()=>this.evictClientModal(),name:this.actionLabels.EVICT}]}ngOnInit(){this.columns=[{prop:"id",name:"id"},{prop:"type",name:"type"},{prop:"state",name:"state"},{prop:"version",name:"version"},{prop:"hostname",name:"Host"},{prop:"root",name:"root"}]}updateSelection(e){this.selection=e}evictClient(e){this.cephfsService.evictClient(this.id,e).subscribe(()=>{this.triggerApiUpdate.emit(),this.modalRef.close(),this.notificationService.show(yn.a.success,"Evicted client '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}evictClientModal(){const e=this.selection.first().id;this.modalRef=this.modalService.show(bn.a,{itemDescription:"client",itemNames:[e],actionDescription:"evict",submitAction:()=>this.evictClient(e)})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(zt),i.Mb(vn.a),i.Mb(wn.a),i.Mb(Jt.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-clients"]],inputs:{id:"id",clients:"clients"},outputs:{triggerApiUpdate:"triggerApiUpdate"},decls:2,vars:7,consts:[["selectionType","single",3,"data","columns","status","autoReload","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(i.Sb(0,"cd-table",0),i.gc("fetchData",(function(){return t.triggerApiUpdate.emit()}))("updateSelection",(function(e){return t.updateSelection(e)})),i.Nb(1,"cd-table-actions",1),i.Rb()),2&e&&(i.pc("data",t.clients.data)("columns",t.columns)("status",t.clients.status)("autoReload",-1),i.yb(1),i.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Bt.a,Sn.a],styles:[""]}),e})();var xn=n("s7LF"),kn=n("ohO+"),Dn=n("OLbh"),Tn=n("Rf2I"),Cn=n("1Ni5"),On=n("ANnk");const Rn=["origin"],Ln=function(e,t){return[e,t]};function En(e,t){if(1&e&&i.Nb(0,"i",5),2&e){const e=i.ic(2);i.pc("ngClass",i.vc(1,Ln,e.icons.spinner,e.icons.spin))}}function An(e,t){if(1&e&&(i.Sb(0,"tree-root",10),i.Mc(1,En,1,4,"ng-template",null,11,i.Nc),i.Rb()),2&e){const e=i.ic();i.pc("nodes",e.nodes)("options",e.treeOptions)}}function In(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"legend"),i.Wb(2,17),i.Rb(),i.Sb(3,"cd-table",18),i.gc("updateSelection",(function(t){return i.Dc(e),i.ic(2).quota.updateSelection(t)})),i.Nb(4,"cd-table-actions",19),i.Rb(),i.Pb()}if(2&e){const e=i.ic(2);i.yb(3),i.pc("data",e.settings)("columns",e.quota.columns)("limit",0)("footer",!1)("onlyActionHeader",!0)("forceIdentifier",!0)("toolHeader",!1),i.yb(1),i.pc("permission",e.permission)("selection",e.quota.selection)("tableActions",e.quota.tableActions)}}function Pn(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",12),i.Sb(1,"div",2),i.Sb(2,"div",3),i.Oc(3),i.Rb(),i.Sb(4,"div",6),i.Mc(5,In,5,10,"ng-container",13),i.Sb(6,"legend"),i.Wb(7,14),i.Rb(),i.Sb(8,"cd-table",15),i.gc("updateSelection",(function(t){return i.Dc(e),i.ic().snapshot.updateSelection(t)})),i.Nb(9,"cd-table-actions",16),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(3),i.Qc(" ",e.selectedDir.path," "),i.yb(2),i.pc("ngIf","/"!==e.selectedDir.path),i.yb(3),i.pc("data",e.selectedDir.snapshots)("columns",e.snapshot.columns),i.yb(1),i.pc("permission",e.permission)("selection",e.snapshot.selection)("tableActions",e.snapshot.tableActions)}}function jn(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span",20),i.gc("click",(function(){i.Dc(e);const n=t.value;return i.ic().selectOrigin(n)})),i.Oc(1),i.Rb()}if(2&e){const e=t.value;i.yb(1),i.Pc(e)}}let Nn=(()=>{class e{constructor(e,t,n,i,r,s,o){this.authStorageService=e,this.modalService=t,this.cephfsService=n,this.cdDatePipe=i,this.actionLabels=r,this.notificationService=s,this.dimlessBinaryPipe=o,this.icons=_n.a,this.loadingIndicator=!1,this.loading={},this.treeOptions={useVirtualScroll:!0,getChildren:e=>this.updateDirectory(e.id),actionMapping:{mouse:{click:this.selectAndShowNode.bind(this),expanderClick:this.selectAndShowNode.bind(this)}}}}selectAndShowNode(e,t,n){kn.a.TOGGLE_EXPANDED(e,t,n),this.selectNode(t)}selectNode(e){kn.a.TOGGLE_ACTIVE(void 0,e,void 0),this.selectedDir=this.getDirectory(e),"/"!==e.id&&this.setSettings(e)}ngOnInit(){this.permission=this.authStorageService.getPermissions().cephfs,this.setUpQuotaTable(),this.setUpSnapshotTable()}setUpQuotaTable(){this.quota={columns:[{prop:"row.name",name:"Name",flexGrow:1},{prop:"row.value",name:"Value",sortable:!1,flexGrow:1},{prop:"row.originPath",name:"Origin",sortable:!1,cellTemplate:this.originTmpl,flexGrow:1}],selection:new Wt.a,updateSelection:e=>{this.quota.selection=e},tableActions:[{name:this.actionLabels.SET,icon:_n.a.edit,permission:"update",visible:e=>!e.hasSelection||e.first()&&0===e.first().dirValue,click:()=>this.updateQuotaModal()},{name:this.actionLabels.UPDATE,icon:_n.a.edit,permission:"update",visible:e=>e.first()&&e.first().dirValue>0,click:()=>this.updateQuotaModal()},{name:this.actionLabels.UNSET,icon:_n.a.destroy,permission:"update",disable:e=>!e.hasSelection||e.first()&&0===e.first().dirValue,click:()=>this.unsetQuotaModal()}]}}setUpSnapshotTable(){this.snapshot={columns:[{prop:"name",name:"Name",flexGrow:1},{prop:"path",name:"Path",isHidden:!0,flexGrow:2},{prop:"created",name:"Created",flexGrow:1,pipe:this.cdDatePipe}],selection:new Wt.a,updateSelection:e=>{this.snapshot.selection=e},tableActions:[{name:this.actionLabels.CREATE,icon:_n.a.add,permission:"create",canBePrimary:e=>!e.hasSelection,click:()=>this.createSnapshot(),disable:()=>this.disableCreateSnapshot()},{name:this.actionLabels.DELETE,icon:_n.a.destroy,permission:"delete",click:()=>this.deleteSnapshotModal(),canBePrimary:e=>e.hasSelection,disable:e=>!e.hasSelection}]}}disableCreateSnapshot(){const e=this.selectedDir.path.split("/").slice(1);return e.length>=4&&"volumes"===e[0]&&"Cannot create snapshots for files/folders in the subvolume " + e[2] + ""}ngOnChanges(){this.selectedDir=void 0,this.dirs=[],this.requestedPaths=[],this.nodeIds={},this.id&&(this.setRootNode(),this.firstCall())}setRootNode(){this.nodes=[{name:"/",id:"/",isExpanded:!0}]}firstCall(){setTimeout(()=>{this.getNode("/").loadNodeChildren()},10)}updateDirectory(e){if(this.unsetLoadingIndicator(),this.requestedPaths.includes(e)){if(!0===this.loading[e])return}else this.requestedPaths.push(e);return new Promise(t=>{this.setLoadingIndicator(e,!0),this.cephfsService.lsDir(this.id,e).subscribe(n=>{this.updateTreeStructure(n),this.updateQuotaTable(),this.updateTree(),t(this.getChildren(e)),this.setLoadingIndicator(e,!1)})})}setLoadingIndicator(e,t){this.loading[e]=t,this.unsetLoadingIndicator()}getSubDirectories(e,t=this.dirs){return t.filter(t=>t.parent===e)}getChildren(e){const t=this.getSubTree(e);return Nt.a.sortBy(this.getSubDirectories(e),"path").map(e=>this.createNode(e,t))}createNode(e,t){return this.nodeIds[e.path]=e,t||this.getSubTree(e.parent),{name:e.name,id:e.path,hasChildren:this.getSubDirectories(e.path,t).length>0}}getSubTree(e){return this.dirs.filter(t=>t.parent&&t.parent.startsWith(e))}setSettings(e){const t=(e,t)=>e?t?t(e):e:"";this.settings=[this.getQuota(e,"max_files",t),this.getQuota(e,"max_bytes",e=>t(e,e=>this.dimlessBinaryPipe.transform(e)))]}getQuota(e,t,n){const i=e.id;e=this.getOrigin(e,t);const r=this.getDirectory(e),s=r.quotas[t];let o=s,a=r.path;if(e.id===i)if("/"===e.parent.id)o=0;else{const n=this.getDirectory(this.getOrigin(e.parent,t));o=n.quotas[t],a=n.path}return{row:{name:"max_bytes"===t?"Max size":"Max files",value:n(s),originPath:s?r.path:""},quotaKey:t,dirValue:this.nodeIds[i].quotas[t],nextTreeMaximum:{value:o,path:o?a:""}}}getOrigin(e,t){if(e.parent&&"/"!==e.parent.id){const n=this.getQuotaFromTree(e,t),i=this.getOrigin(e.parent,t),r=this.getQuotaFromTree(i,t);return 0===n||0!==r&&r<n?i:e}return e}getQuotaFromTree(e,t){return this.getDirectory(e).quotas[t]}getDirectory(e){return this.nodeIds[e.id]}selectOrigin(e){this.selectNode(this.getNode(e))}getNode(e){return this.treeComponent.treeModel.getNodeById(e)}updateQuotaModal(){const e=this.selectedDir.path,t=this.quota.selection.first(),n=t.nextTreeMaximum,i=t.quotaKey,r=t.dirValue;this.modalService.show(Tn.a,{titleText:this.getModalQuotaTitle(0===r?this.actionLabels.SET:this.actionLabels.UPDATE,e),message:n.value?"The inherited " + this.getQuotaValueFromPathMsg(n.value, n.path) + " is the maximum value to be used.":void 0,fields:[this.getQuotaFormField(t.row.name,i,r,n.value)],submitButtonText:"Save",onSubmit:e=>this.updateQuota(e)})}getModalQuotaTitle(e,t){return "" + e + " CephFS " + this.getQuotaName() + " quota for '" + t + "'"}getQuotaName(){return this.isBytesQuotaSelected()?"size":"files"}isBytesQuotaSelected(){return"max_bytes"===this.quota.selection.first().quotaKey}getQuotaValueFromPathMsg(e,t){return e=this.isBytesQuotaSelected()?this.dimlessBinaryPipe.transform(e):e,"" + this.getQuotaName() + " quota " + e + " from '" + t + "'"}getQuotaFormField(e,t,n,i){const r="max_bytes"===t,s=[r?Cn.a.binaryMin(0):xn.A.min(0)];i&&s.push(r?Cn.a.binaryMax(i):xn.A.max(i));const o={type:r?"binary":"number",label:e,name:t,value:n,validators:s,required:!0};return r||(o.errors={min:"Value has to be at least 0 or more",max:"Value has to be at most " + i + " or less"}),o}updateQuota(e,t){const n=this.selectedDir.path,i=this.quota.selection.first().quotaKey,r=0===this.selectedDir.quotas[i]?this.actionLabels.SET:0===e[i]?this.actionLabels.UNSET:"Updated";this.cephfsService.quota(this.id,n,e).subscribe(()=>{t&&t(),this.notificationService.show(yn.a.success,this.getModalQuotaTitle(r,n)),this.forceDirRefresh()})}unsetQuotaModal(){const e=this.selectedDir.path,t=this.quota.selection.first(),n=t.quotaKey,i=t.nextTreeMaximum,r=t.dirValue,s=this.getQuotaValueFromPathMsg(i.value,i.path),o=i.value>0?i.value>r?"in order to inherit " + s + "":"which isn't used because of the inheritance of " + s + "":"in order to have no quota on the directory";this.modalRef=this.modalService.show(Dn.a,{titleText:this.getModalQuotaTitle(this.actionLabels.UNSET,e),buttonText:this.actionLabels.UNSET,description:"" + this.actionLabels.UNSET + " " + this.getQuotaValueFromPathMsg(r, e) + " " + o + ".",onSubmit:()=>this.updateQuota({[n]:0},()=>this.modalRef.close())})}createSnapshot(){const e=this.selectedDir.path;this.modalService.show(Tn.a,{titleText:"Create Snapshot",message:"Please enter the name of the snapshot.",fields:[{type:"text",name:"name",value:""+nn()().toISOString(!0),required:!0}],submitButtonText:"Create Snapshot",onSubmit:t=>{this.cephfsService.mkSnapshot(this.id,e,t.name).subscribe(t=>{this.notificationService.show(yn.a.success,"Created snapshot '" + t + "' for '" + e + "'"),this.forceDirRefresh()})}})}forceDirRefresh(e){if(!e){const t=this.selectedDir;if(!t)throw new Error("This function can only be called without path if an selection was made");e=t.parent?t.parent:t.path}this.getNode(e).loadNodeChildren()}updateTreeStructure(e){const t=(e,t)=>{const n=e.filter(e=>e.parent===t),i=n.map(e=>e.path);return{children:n,paths:i}};Nt.a.uniq(e.map(e=>e.parent).sort()).forEach(n=>{const i=t(e,n),r=t(this.dirs,n);r.children.forEach(e=>{i.paths.includes(e.path)||this.removeOldDirectory(e)}),i.children.forEach(e=>{r.paths.includes(e.path)?this.updateExistingDirectory(r.children,e):this.addNewDirectory(e)})})}removeOldDirectory(e){const t=e.path;Nt.a.remove(this.dirs,e=>e.path===t),delete this.nodeIds[t],this.updateDirectoriesParentNode(e)}updateDirectoriesParentNode(e){const t=e.parent;if(!t)return;const n=this.getNode(t);if(!n)return;const i=this.getChildren(t);n.data.children=i,n.data.hasChildren=i.length>0,this.treeComponent.treeModel.update()}addNewDirectory(e){this.dirs.push(e),this.nodeIds[e.path]=e,this.updateDirectoriesParentNode(e)}updateExistingDirectory(e,t){const n=e.find(e=>e.path===t.path);Object.assign(n,t)}updateQuotaTable(){const e=this.selectedDir?this.getNode(this.selectedDir.path):void 0;e&&"/"!==e.id&&this.setSettings(e)}updateTree(e=!1){this.loadingIndicator&&!e||(this.treeComponent.treeModel.update(),this.nodes=[...this.nodes],this.treeComponent.sizeChanged())}deleteSnapshotModal(){this.modalRef=this.modalService.show(bn.a,{itemDescription:"CephFs Snapshot",itemNames:this.snapshot.selection.selected.map(e=>e.name),submitAction:()=>this.deleteSnapshot()})}deleteSnapshot(){const e=this.selectedDir.path;this.snapshot.selection.selected.forEach(t=>{const n=t.name;this.cephfsService.rmSnapshot(this.id,e,n).subscribe(()=>{this.notificationService.show(yn.a.success,"Deleted snapshot '" + n + "' for '" + e + "'")})}),this.modalRef.close(),this.forceDirRefresh()}refreshAllDirectories(){this.loadingIndicator=!0,this.requestedPaths.map(e=>this.forceDirRefresh(e));const e=setInterval(()=>{this.updateTree(!0),this.loadingIndicator||clearInterval(e)},3e3)}unsetLoadingIndicator(){this.loadingIndicator&&(clearTimeout(this.loadingTimeout),this.loadingTimeout=setTimeout(()=>{if(Object.values(this.loading).some(e=>e))return this.unsetLoadingIndicator();this.loadingIndicator=!1,this.updateTree()},3e3))}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(vn.a),i.Mb(zt),i.Mb(Vt.a),i.Mb(gn.b),i.Mb(wn.a),i.Mb(Zt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-directories"]],viewQuery:function(e,t){var n;1&e&&(i.Tc(kn.b,!0),i.Jc(Rn,!0)),2&e&&(i.zc(n=i.hc())&&(t.treeComponent=n.first),i.zc(n=i.hc())&&(t.originTmpl=n.first))},inputs:{id:"id"},features:[i.wb],decls:11,vars:10,consts:function(){return[[1,"row"],[1,"col-sm-4","pr-0"],[1,"card"],[1,"card-header"],["type","button",1,"btn","btn-light","pull-right",3,"click"],[3,"ngClass"],[1,"card-body"],[3,"nodes","options",4,"ngIf"],["class","col-sm-8 metadata",4,"ngIf"],["origin",""],[3,"nodes","options"],["loadingTemplate",""],[1,"col-sm-8","metadata"],[4,"ngIf"],"Snapshots",["identifier","name","forceIdentifier","true","selectionType","multiClick",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],"Quotas",["selectionType","single","identifier","quotaKey",3,"data","columns","limit","footer","onlyActionHeader","forceIdentifier","toolHeader","updateSelection"],[1,"only-table-actions",3,"permission","selection","tableActions"],[1,"quota-origin",3,"click"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"div",2),i.Sb(3,"div",3),i.Sb(4,"button",4),i.gc("click",(function(){return t.refreshAllDirectories()})),i.Nb(5,"i",5),i.Rb(),i.Rb(),i.Sb(6,"div",6),i.Mc(7,An,3,2,"tree-root",7),i.Rb(),i.Rb(),i.Rb(),i.Mc(8,Pn,10,7,"div",8),i.Rb(),i.Mc(9,jn,2,1,"ng-template",null,9,i.Nc)),2&e&&(i.yb(4),i.Eb("disabled",t.loadingIndicator),i.yb(1),i.Eb("fa-spin",t.loadingIndicator),i.pc("ngClass",i.vc(7,Ln,t.icons.large,t.icons.refresh)),i.yb(2),i.pc("ngIf",t.nodes),i.yb(1),i.pc("ngIf",t.selectedDir))},directives:[On.a,o.p,o.r,kn.b,Bt.a,Sn.a],styles:["cd-cephfs-directories tree-root .tree-children{overflow:inherit}.quota-origin[_ngcontent-%COMP%]{color:#2b99a8;cursor:pointer}.quota-origin[_ngcontent-%COMP%]:hover{color:#212529}"]}),e})();var Fn=n("insk");function Yn(e,t){if(1&e&&i.Nb(0,"cd-cephfs-detail",15),2&e){const e=i.ic(2);i.pc("data",e.details)}}function zn(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-cephfs-clients",16),i.gc("triggerApiUpdate",(function(){return i.Dc(e),i.ic(2).refresh()})),i.Rb()}if(2&e){const e=i.ic(2);i.pc("id",e.id)("clients",e.clients)}}function $n(e,t){if(1&e&&i.Nb(0,"cd-cephfs-directories",17),2&e){const e=i.ic(2);i.pc("id",e.id)}}function Hn(e,t){if(1&e&&i.Nb(0,"cd-grafana",18),2&e){const e=i.ic(2);i.pc("grafanaPath","mds-performance?var-mds_servers=mds."+e.grafanaId)}}function Wn(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"ul",1,2),i.gc("navChange",(function(){return i.Dc(e),i.ic().softRefresh()})),i.Sb(3,"li",3),i.Sb(4,"a",4),i.Wb(5,5),i.Rb(),i.Mc(6,Yn,1,1,"ng-template",6),i.Rb(),i.Sb(7,"li",7),i.Sb(8,"a",4),i.Qb(9),i.Wb(10,8),i.Pb(),i.Sb(11,"span",9),i.Oc(12),i.Rb(),i.Rb(),i.Mc(13,zn,1,2,"ng-template",6),i.Rb(),i.Sb(14,"li",10),i.Sb(15,"a",4),i.Wb(16,11),i.Rb(),i.Mc(17,$n,1,1,"ng-template",6),i.Rb(),i.Sb(18,"li",12),i.Sb(19,"a",4),i.Wb(20,13),i.Rb(),i.Mc(21,Hn,1,1,"ng-template",6),i.Rb(),i.Rb(),i.Nb(22,"div",14),i.Pb()}if(2&e){const e=i.Ac(2),t=i.ic();i.yb(12),i.Pc(t.clients.data.length),i.yb(10),i.pc("ngbNavOutlet",e)}}let Vn=(()=>{class e{constructor(e,t,n){this.ngZone=e,this.authStorageService=t,this.cephfsService=n,this.clients={data:[],status:new Gt.a(qt.a.ValueNone)},this.details={standbys:"",pools:[],ranks:[],mdsCounters:{},name:""},this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){this.selection?this.selection.id!==this.id&&this.setupSelected(this.selection.id,this.selection.mdsmap.info):this.unsubscribeInterval()}setupSelected(e,t){this.id=e;const n=Nt.a.first(Object.values(t));this.grafanaId=n&&n.name,this.details={standbys:"",pools:[],ranks:[],mdsCounters:{},name:""},this.clients={data:[],status:new Gt.a(qt.a.ValueNone)},this.updateInterval()}updateInterval(){this.unsubscribeInterval(),this.subscribeInterval()}unsubscribeInterval(){this.reloadSubscriber&&this.reloadSubscriber.unsubscribe()}subscribeInterval(){this.ngZone.runOutsideAngular(()=>this.reloadSubscriber=Object(Ut.a)(0,5e3).subscribe(()=>this.ngZone.run(()=>this.refresh())))}refresh(){this.cephfsService.getTabs(this.id).subscribe(e=>{this.data=e,this.softRefresh()},()=>{this.clients.status=new Gt.a(qt.a.ValueException)})}softRefresh(){const e=Nt.a.cloneDeep(this.data);this.clients=e.clients,this.clients.status=new Gt.a(this.clients.status),this.details={standbys:e.standbys,pools:e.pools,ranks:e.ranks,mdsCounters:e.mds_counters,name:e.name}}ngOnDestroy(){this.unsubscribeInterval()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(i.A),i.Mb(Jt.a),i.Mb(zt))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-tabs"]],inputs:{selection:"selection"},features:[i.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],["ngbNav","","cdStatefulTab","cephfs-tabs",1,"nav-tabs",3,"navChange"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","clients"],"Clients",[1,"badge","badge-pill","badge-tab","ml-1"],["ngbNavItem","directories"],"Directories",["ngbNavItem","performance-details"],"Performance Details",[3,"ngbNavOutlet"],[3,"data"],[3,"id","clients","triggerApiUpdate"],[3,"id"],["uid","tbO9LAiZz","grafanaStyle","one",3,"grafanaPath"]]},template:function(e,t){1&e&&i.Mc(0,Wn,23,2,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,mn,Mn,Nn,Fn.a],styles:[""]}),e})(),Bn=(()=>{class e extends $t.a{constructor(e,t){super(),this.cephfsService=e,this.cdDatePipe=t,this.filesystems=[],this.selection=new Wt.a}ngOnInit(){this.columns=[{name:"Name",prop:"mdsmap.fs_name",flexGrow:2},{name:"Created",prop:"mdsmap.created",flexGrow:2,pipe:this.cdDatePipe},{name:"Enabled",prop:"mdsmap.enabled",flexGrow:1,cellTransformation:Ht.a.checkIcon}]}loadFilesystems(e){this.cephfsService.list().subscribe(e=>{this.filesystems=e},()=>{e.error()})}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(zt),i.Mb(Vt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-cephfs-list"]],features:[i.vb],decls:2,vars:4,consts:[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","fetchData","setExpandedRow","updateSelection"],["cdTableDetail","",3,"selection"]],template:function(e,t){1&e&&(i.Sb(0,"cd-table",0),i.gc("fetchData",(function(e){return t.loadFilesystems(e)}))("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)})),i.Nb(1,"cd-cephfs-tabs",1),i.Rb()),2&e&&(i.pc("data",t.filesystems)("columns",t.columns)("hasDetails",!0),i.yb(1),i.pc("selection",t.expandedRow))},directives:[Bt.a,Vn],styles:[""]}),e})();var Un=n("MuvH");let Gn=(()=>{class e{static getType(e){const t=Nt.a.find(this.knownTypes,t=>t.name===e);if(void 0!==t)return t;throw new Error('Found unknown type "'+e+'" for config option.')}static getTypeValidators(t){const n=e.getType(t.type);if("bool"===n.name||"str"===n.name)return;const i={validators:[],patternHelpText:n.patternHelpText};return n.isNumberType?(t.max&&""!==t.max&&(i.max=t.max,i.validators.push(xn.A.max(t.max))),t.min&&""!==t.min?(i.min=t.min,i.validators.push(xn.A.min(t.min))):"defaultMin"in n&&(i.min=n.defaultMin,i.validators.push(xn.A.min(n.defaultMin))),i.validators.push("float"===t.type?Cn.a.decimalNumber():Cn.a.number(n.allowsNegative))):"addr"===t.type?i.validators=[Cn.a.ip()]:"uuid"===t.type&&(i.validators=[Cn.a.uuid()]),i}static getTypeStep(e,t){if(["uint","int","size","secs"].includes(e))return 1;if("float"===e){if(null!==t&&-1!==t.toString().indexOf(".")){const e=t.toString().split(".");return Math.pow(10,-e[1].length)}return.1}}}return e.knownTypes=[{name:"uint",inputType:"number",humanReadable:"Unsigned integer value",defaultMin:0,patternHelpText:"The entered value needs to be an unsigned number.",isNumberType:!0,allowsNegative:!1},{name:"int",inputType:"number",humanReadable:"Integer value",patternHelpText:"The entered value needs to be a number.",isNumberType:!0,allowsNegative:!0},{name:"size",inputType:"number",humanReadable:"Unsigned integer value (>=16bit)",defaultMin:0,patternHelpText:"The entered value needs to be a unsigned number.",isNumberType:!0,allowsNegative:!1},{name:"secs",inputType:"number",humanReadable:"Number of seconds",defaultMin:1,patternHelpText:"The entered value needs to be a number >= 1.",isNumberType:!0,allowsNegative:!1},{name:"float",inputType:"number",humanReadable:"Double value",patternHelpText:"The entered value needs to be a number or decimal.",isNumberType:!0,allowsNegative:!0},{name:"str",inputType:"text",humanReadable:"Text",isNumberType:!1},{name:"addr",inputType:"text",humanReadable:"IPv4 or IPv6 address",patternHelpText:"The entered value needs to be a valid IP address.",isNumberType:!1},{name:"uuid",inputType:"text",humanReadable:"UUID",patternHelpText:"The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8",isNumberType:!1},{name:"bool",inputType:"checkbox",humanReadable:"Boolean value",isNumberType:!1}],e})();var qn=n("spCT"),Jn=n("QFaf");class Qn{constructor(){this.value=[]}}var Kn=n("zc8c"),Zn=n("NwgZ"),Xn=n("ocLN"),ei=n("f69J"),ti=n("6+kj");function ni(e,t){1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",9),i.Wb(2,20),i.Rb(),i.Sb(3,"div",11),i.Sb(4,"textarea",21),i.Oc(5,"            "),i.Rb(),i.Rb(),i.Rb())}function ii(e,t){1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",9),i.Wb(2,22),i.Rb(),i.Sb(3,"div",11),i.Sb(4,"textarea",23),i.Oc(5,"            "),i.Rb(),i.Rb(),i.Rb())}function ri(e,t){1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",9),i.Wb(2,24),i.Rb(),i.Sb(3,"div",11),i.Nb(4,"input",25),i.Rb(),i.Rb())}function si(e,t){1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",9),i.Wb(2,26),i.Rb(),i.Sb(3,"div",11),i.Nb(4,"input",27),i.Rb(),i.Rb())}function oi(e,t){if(1&e&&(i.Sb(0,"span",30),i.Sb(1,"span",31),i.Oc(2),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Pc(e)}}function ai(e,t){if(1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",9),i.Wb(2,28),i.Rb(),i.Sb(3,"div",11),i.Mc(4,oi,3,1,"span",29),i.Rb(),i.Rb()),2&e){const e=i.ic(2);i.yb(4),i.pc("ngForOf",e.configForm.getValue("services"))}}function ci(e,t){if(1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",32),i.Oc(2),i.Rb(),i.Sb(3,"div",11),i.Sb(4,"select",33),i.Sb(5,"option",34),i.Wb(6,35),i.Rb(),i.Sb(7,"option",34),i.Wb(8,36),i.Rb(),i.Sb(9,"option",34),i.Wb(10,37),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.pc("for",e),i.yb(1),i.Qc("",e," "),i.yb(2),i.pc("formControlName",e),i.yb(1),i.pc("ngValue",null),i.yb(2),i.pc("ngValue",!0),i.yb(2),i.pc("ngValue",!1)}}function li(e,t){if(1&e&&(i.Sb(0,"span",40),i.Oc(1),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.Qc(" ",e.patternHelpText," ")}}function ui(e,t){if(1&e&&(i.Sb(0,"span",40),i.Oc(1),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.Qc(" ",e.patternHelpText," ")}}function di(e,t){if(1&e&&(i.Sb(0,"span",40),i.Wb(1,41),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.ac(e.maxValue),i.Xb(1)}}function hi(e,t){if(1&e&&(i.Sb(0,"span",40),i.Wb(1,42),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.ac(e.minValue),i.Xb(1)}}function fi(e,t){if(1&e&&(i.Sb(0,"div",8),i.Sb(1,"label",32),i.Oc(2),i.Rb(),i.Sb(3,"div",11),i.Nb(4,"input",38),i.Mc(5,li,2,1,"span",39),i.Mc(6,ui,2,1,"span",39),i.Mc(7,di,2,1,"span",39),i.Mc(8,hi,2,1,"span",39),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit;i.ic();const t=i.Ac(2),n=i.ic();i.yb(1),i.pc("for",e),i.yb(1),i.Qc("",e," "),i.yb(2),i.pc("type",n.inputType)("id",e)("placeholder",n.humanReadableType)("formControlName",e)("step",n.getStep(n.type,n.configForm.getValue(e))),i.yb(1),i.pc("ngIf",n.configForm.showError(e,t,"pattern")),i.yb(1),i.pc("ngIf",n.configForm.showError(e,t,"invalidUuid")),i.yb(1),i.pc("ngIf",n.configForm.showError(e,t,"max")),i.yb(1),i.pc("ngIf",n.configForm.showError(e,t,"min"))}}function pi(e,t){if(1&e&&(i.Qb(0),i.Mc(1,ci,11,6,"div",13),i.Mc(2,fi,9,11,"div",13),i.Pb()),2&e){const e=i.ic(2);i.yb(1),i.pc("ngIf","bool"===e.type),i.yb(1),i.pc("ngIf","bool"!==e.type)}}function mi(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",1),i.Sb(1,"form",2,3),i.Sb(3,"div",4),i.Sb(4,"div",5),i.Qb(5,6),i.Oc(6,"Edit"),i.Pb(),i.Oc(7),i.Rb(),i.Sb(8,"div",7),i.Sb(9,"div",8),i.Sb(10,"label",9),i.Wb(11,10),i.Rb(),i.Sb(12,"div",11),i.Nb(13,"input",12),i.Rb(),i.Rb(),i.Mc(14,ni,6,0,"div",13),i.Mc(15,ii,6,0,"div",13),i.Mc(16,ri,5,0,"div",13),i.Mc(17,si,5,0,"div",13),i.Mc(18,ai,5,1,"div",13),i.Sb(19,"div",14),i.Sb(20,"h3",15),i.Wb(21,16),i.Rb(),i.Mc(22,pi,3,2,"ng-container",17),i.Rb(),i.Rb(),i.Sb(23,"div",18),i.Sb(24,"cd-form-button-panel",19),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic().submit()})),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("formGroup",e.configForm),i.yb(6),i.Qc(" ",e.configForm.getValue("name")," "),i.yb(7),i.pc("ngIf",e.configForm.getValue("desc")),i.yb(1),i.pc("ngIf",e.configForm.getValue("long_desc")),i.yb(1),i.pc("ngIf",""!==e.configForm.getValue("default")),i.yb(1),i.pc("ngIf",""!==e.configForm.getValue("daemon_default")),i.yb(1),i.pc("ngIf",e.configForm.getValue("services").length>0),i.yb(4),i.pc("ngForOf",e.availSections),i.yb(2),i.pc("form",e.configForm)("submitText",e.actionLabels.UPDATE)}}let bi=(()=>{class e extends qn.a{constructor(e,t,n,i,r){super(),this.actionLabels=e,this.route=t,this.router=n,this.configService=i,this.notificationService=r,this.availSections=["global","mon","mgr","osd","mds","client"],this.createForm()}createForm(){const e={name:new xn.h({value:null}),desc:new xn.h({value:null}),long_desc:new xn.h({value:null}),values:new xn.j({}),default:new xn.h({value:null}),daemon_default:new xn.h({value:null}),services:new xn.h([])};this.availSections.forEach(t=>{e.values.addControl(t,new xn.h(null))}),this.configForm=new Jn.a(e)}ngOnInit(){this.route.params.subscribe(e=>{this.configService.get(e.name).subscribe(e=>{this.setResponse(e),this.loadingReady()})})}getValidators(e){const t=Gn.getTypeValidators(e);if(t)return this.patternHelpText=t.patternHelpText,"max"in t&&""!==t.max&&(this.maxValue=t.max),"min"in t&&""!==t.min&&(this.minValue=t.min),t.validators}getStep(e,t){return Gn.getTypeStep(e,t)}setResponse(e){this.response=e;const t=this.getValidators(e);this.configForm.get("name").setValue(e.name),this.configForm.get("desc").setValue(e.desc),this.configForm.get("long_desc").setValue(e.long_desc),this.configForm.get("default").setValue(e.default),this.configForm.get("daemon_default").setValue(e.daemon_default),this.configForm.get("services").setValue(e.services),this.response.value&&this.response.value.forEach(e=>{let t=null;t="true"===e.value||"false"!==e.value&&e.value,this.configForm.get("values").get(e.section).setValue(t)}),this.availSections.forEach(e=>{this.configForm.get("values").get(e).setValidators(t)});const n=Gn.getType(e.type);this.type=n.name,this.inputType=n.inputType,this.humanReadableType=n.humanReadable}createRequest(){const e=[];if(this.availSections.forEach(t=>{const n=this.configForm.getValue(t);null!==n&&""!==n&&e.push({section:t,value:n})}),!Nt.a.isEqual(this.response.value,e)){const t=new Qn;return t.name=this.configForm.getValue("name"),t.value=e,t}return null}submit(){const e=this.createRequest();e&&this.configService.create(e).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated config option " + e.name + ""),this.router.navigate(["/configuration"])},()=>{this.configForm.setErrors({cdSubmitButton:!0})}),this.router.navigate(["/configuration"])}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Pt.a),i.Mb(Pt.e),i.Mb(Un.a),i.Mb(wn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-configuration-form"]],features:[i.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","configForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],["i18",""],[1,"card-body"],[1,"form-group","row"],[1,"cd-col-form-label"],"Name",[1,"cd-col-form-input"],["type","text","id","name","formControlName","name","readonly","",1,"form-control"],["class","form-group row",4,"ngIf"],["formGroupName","values"],[1,"cd-header"],"Values",[4,"ngFor","ngForOf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],"Description",["id","desc","formControlName","desc","readonly","",1,"form-control","resize-vertical"],"Long description",["id","long_desc","formControlName","long_desc","readonly","",1,"form-control","resize-vertical"],"Default",["type","text","id","default","formControlName","default","readonly","",1,"form-control"],"Daemon default",["type","text","id","daemon_default","formControlName","daemon_default","readonly","",1,"form-control"],"Services",["class","form-component-badge",4,"ngFor","ngForOf"],[1,"form-component-badge"],[1,"badge","badge-dark"],[1,"cd-col-form-label",3,"for"],["id","pool","name","pool",1,"form-control","custom-select",3,"formControlName"],[3,"ngValue"],"-- Default --","true","false",[1,"form-control",3,"type","id","placeholder","formControlName","step"],["class","invalid-feedback",4,"ngIf"],[1,"invalid-feedback"],"The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".","The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + "."]},template:function(e,t){1&e&&i.Mc(0,mi,25,10,"div",0),2&e&&i.pc("cdFormLoading",t.loading)},directives:[Kn.a,xn.C,xn.r,Zn.a,xn.k,Xn.a,On.a,xn.d,ei.a,xn.q,xn.i,o.r,xn.l,o.q,ti.a,xn.z,xn.u,xn.B],styles:[".form-component-badge[_ngcontent-%COMP%]{display:block;height:34px}.form-component-badge[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{margin-top:7px}.resize-vertical[_ngcontent-%COMP%]{resize:vertical}"]}),e})();var gi=n("iExv");function _i(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Nb(2,"br"),i.Rb()),2&e){const e=t.$implicit,n=t.last;i.yb(1),i.Sc(" ",e.section,": ",e.value,"",n?"":",","")}}function yi(e,t){if(1&e&&(i.Sb(0,"span"),i.Sb(1,"span",23),i.Sb(2,"span",24),i.Oc(3),i.jc(4,"uppercase"),i.Rb(),i.Rb(),i.Rb()),2&e){const e=t.$implicit,n=i.ic(2);i.yb(1),i.qc("title",n.flags[e]),i.yb(2),i.Pc(i.kc(4,2,e))}}function vi(e,t){if(1&e&&(i.Sb(0,"span"),i.Sb(1,"span",24),i.Oc(2),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Pc(e)}}function wi(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"table",1),i.Sb(2,"tbody"),i.Sb(3,"tr"),i.Sb(4,"td",2),i.Wb(5,3),i.Rb(),i.Sb(6,"td",4),i.Oc(7),i.Rb(),i.Rb(),i.Sb(8,"tr"),i.Sb(9,"td",5),i.Wb(10,6),i.Rb(),i.Sb(11,"td"),i.Oc(12),i.Rb(),i.Rb(),i.Sb(13,"tr"),i.Sb(14,"td",5),i.Wb(15,7),i.Rb(),i.Sb(16,"td"),i.Oc(17),i.Rb(),i.Rb(),i.Sb(18,"tr"),i.Sb(19,"td",5),i.Wb(20,8),i.Rb(),i.Sb(21,"td"),i.Mc(22,_i,3,3,"span",9),i.Rb(),i.Rb(),i.Sb(23,"tr"),i.Sb(24,"td",5),i.Wb(25,10),i.Rb(),i.Sb(26,"td"),i.Oc(27),i.Rb(),i.Rb(),i.Sb(28,"tr"),i.Sb(29,"td",5),i.Wb(30,11),i.Rb(),i.Sb(31,"td"),i.Oc(32),i.Rb(),i.Rb(),i.Sb(33,"tr"),i.Sb(34,"td",5),i.Wb(35,12),i.Rb(),i.Sb(36,"td"),i.Oc(37),i.Rb(),i.Rb(),i.Sb(38,"tr"),i.Sb(39,"td",5),i.Wb(40,13),i.Rb(),i.Sb(41,"td"),i.Oc(42),i.Rb(),i.Rb(),i.Sb(43,"tr"),i.Sb(44,"td",5),i.Wb(45,14),i.Rb(),i.Sb(46,"td"),i.Oc(47),i.Rb(),i.Rb(),i.Sb(48,"tr"),i.Sb(49,"td",5),i.Wb(50,15),i.Rb(),i.Sb(51,"td"),i.Mc(52,yi,5,4,"span",9),i.Rb(),i.Rb(),i.Sb(53,"tr"),i.Sb(54,"td",5),i.Wb(55,16),i.Rb(),i.Sb(56,"td"),i.Mc(57,vi,3,1,"span",9),i.Rb(),i.Rb(),i.Sb(58,"tr"),i.Sb(59,"td",5),i.Wb(60,17),i.Rb(),i.Sb(61,"td"),i.Oc(62),i.Rb(),i.Rb(),i.Sb(63,"tr"),i.Sb(64,"td",5),i.Wb(65,18),i.Rb(),i.Sb(66,"td"),i.Oc(67),i.Rb(),i.Rb(),i.Sb(68,"tr"),i.Sb(69,"td",5),i.Wb(70,19),i.Rb(),i.Sb(71,"td"),i.Oc(72),i.jc(73,"booleanText"),i.Rb(),i.Rb(),i.Sb(74,"tr"),i.Sb(75,"td",5),i.Wb(76,20),i.Rb(),i.Sb(77,"td"),i.Oc(78),i.Rb(),i.Rb(),i.Sb(79,"tr"),i.Sb(80,"td",5),i.Wb(81,21),i.Rb(),i.Sb(82,"td"),i.Oc(83),i.Rb(),i.Rb(),i.Sb(84,"tr"),i.Sb(85,"td",5),i.Wb(86,22),i.Rb(),i.Sb(87,"td"),i.Oc(88),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic();i.yb(7),i.Pc(e.selection.name),i.yb(5),i.Pc(e.selection.desc),i.yb(5),i.Pc(e.selection.long_desc),i.yb(5),i.pc("ngForOf",e.selection.value),i.yb(5),i.Pc(e.selection.default),i.yb(5),i.Pc(e.selection.daemon_default),i.yb(5),i.Pc(e.selection.type),i.yb(5),i.Pc(e.selection.min),i.yb(5),i.Pc(e.selection.max),i.yb(5),i.pc("ngForOf",e.selection.flags),i.yb(5),i.pc("ngForOf",e.selection.services),i.yb(5),i.Pc(e.selection.source),i.yb(5),i.Pc(e.selection.level),i.yb(5),i.Pc(i.kc(73,17,e.selection.can_update_at_runtime)),i.yb(6),i.Pc(e.selection.tags),i.yb(5),i.Pc(e.selection.enum_values),i.yb(5),i.Pc(e.selection.see_also)}}let Si=(()=>{class e{constructor(){this.flags={runtime:"The value can be updated at runtime.",no_mon_update:"Daemons/clients do not pull this value from the\n      monitor config database. We disallow setting this option via 'ceph config\n      set ...'. This option should be configured via ceph.conf or via the\n      command line.",startup:"Option takes effect only during daemon startup.",cluster_create:"Option only affects cluster creation.",create:"Option only affects daemon creation."}}ngOnChanges(){this.selection&&(this.selection.services=Nt.a.split(this.selection.services,","))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-configuration-details"]],inputs:{selection:"selection"},features:[i.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],"Name",[1,"w-75"],[1,"bold"],"Description","Long description","Current values",[4,"ngFor","ngForOf"],"Default","Daemon default","Type","Min","Max","Flags","Services","Source","Level","Can be updated at runtime (editable)","Tags","Enum values","See also",[3,"title"],[1,"badge","badge-dark","mr-2"]]},template:function(e,t){1&e&&i.Mc(0,wi,89,19,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,o.q],pipes:[gi.a,o.C],styles:[""]}),e})();const Mi=["confValTpl"],xi=["confFlagTpl"];function ki(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Nb(2,"br"),i.Rb()),2&e){const e=t.$implicit,n=t.last;i.yb(1),i.Sc(" ",e.section,": ",e.value,"",n?"":",","")}}function Di(e,t){if(1&e&&(i.Sb(0,"span"),i.Mc(1,ki,3,3,"span",5),i.Rb()),2&e){const e=i.ic().value;i.yb(1),i.pc("ngForOf",e)}}function Ti(e,t){1&e&&i.Mc(0,Di,2,1,"span",4),2&e&&i.pc("ngIf",t.value)}let Ci=(()=>{class e extends $t.a{constructor(e,t,n){super(),this.authStorageService=e,this.configurationService=t,this.actionLabels=n,this.data=[],this.icons=_n.a,this.selection=new Wt.a,this.filters=[{name:"Level",prop:"level",filterOptions:["basic","advanced","dev"],filterInitValue:"basic",filterPredicate:(e,t)=>{let n;return function(e){e[e.basic=0]="basic",e[e.advanced=1]="advanced",e[e.dev=2]="dev"}(n||(n={})),n[e.level]<=n[t]}},{name:"Service",prop:"services",filterOptions:["mon","mgr","osd","mds","common","mds_client","rgw"],filterPredicate:(e,t)=>e.services.includes(t)},{name:"Source",prop:"source",filterOptions:["mon"],filterPredicate:(e,t)=>!!e.hasOwnProperty("source")&&e.source.includes(t)},{name:"Modified",prop:"modified",filterOptions:["yes","no"],filterPredicate:(e,t)=>!("yes"!==t||!e.hasOwnProperty("value"))||"no"===t&&!e.hasOwnProperty("value")}],this.permission=this.authStorageService.getPermissions().configOpt;const i=()=>this.selection.first()&&""+encodeURIComponent(this.selection.first().name);this.tableActions=[{permission:"update",icon:_n.a.edit,routerLink:()=>"/configuration/edit/"+i(),name:this.actionLabels.EDIT,disable:()=>!this.isEditable(this.selection)}]}ngOnInit(){this.columns=[{canAutoResize:!0,prop:"name",name:"Name"},{prop:"desc",name:"Description",cellClass:"wrap"},{prop:"value",name:"Current value",cellClass:"wrap",cellTemplate:this.confValTpl},{prop:"default",name:"Default",cellClass:"wrap"},{prop:"can_update_at_runtime",name:"Editable",cellTransformation:Ht.a.checkIcon,flexGrow:.4,cellClass:"text-center"}]}updateSelection(e){this.selection=e}getConfigurationList(e){this.configurationService.getConfigData().subscribe(e=>{this.data=e},()=>{e.error()})}isEditable(e){return 1===e.selected.length&&e.selected[0].can_update_at_runtime}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Un.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-configuration"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(Mi,!0),i.Tc(xi,!0)),2&e&&(i.zc(n=i.hc())&&(t.confValTpl=n.first),i.zc(n=i.hc())&&(t.confFlagTpl=n.first))},features:[i.vb],decls:5,vars:8,consts:[["selectionType","single",3,"data","columns","extraFilterableColumns","hasDetails","fetchData","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["confValTpl",""],[4,"ngIf"],[4,"ngFor","ngForOf"]],template:function(e,t){1&e&&(i.Sb(0,"cd-table",0),i.gc("fetchData",(function(e){return t.getConfigurationList(e)}))("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)})),i.Nb(1,"cd-table-actions",1),i.Nb(2,"cd-configuration-details",2),i.Rb(),i.Mc(3,Ti,1,1,"ng-template",null,3,i.Nc)),2&e&&(i.pc("data",t.data)("columns",t.columns)("extraFilterableColumns",t.filters)("hasDetails",!0),i.yb(1),i.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),i.yb(1),i.pc("selection",t.expandedRow))},directives:[Bt.a,Sn.a,Si,o.r,o.q],styles:[".filter[_ngcontent-%COMP%]{padding-right:8px}.fa-stack[_ngcontent-%COMP%]{font-size:.79rem}.fa-stack[_ngcontent-%COMP%]   .fa-stack-1x[_ngcontent-%COMP%]{margin-left:8px;margin-top:5px}  cd-configuration datatable-body-cell.wrap{word-break:break-all}"]}),e})();var Oi=n("quSY"),Ri=n("st4c"),Li=n("lOp/");const Ei=["tree"],Ai=function(e,t,n){return[e,t,n]};function Ii(e,t){if(1&e&&i.Nb(0,"i",12),2&e){const e=i.ic();i.pc("ngClass",i.wc(1,Ai,e.icons.large,e.icons.spinner,e.icons.spin))}}const Pi=function(){return["in","up"]},ji=function(){return["down","out","destroyed"]},Ni=function(e,t){return{"badge-success":e,"badge-danger":t}};function Fi(e,t){if(1&e&&(i.Sb(0,"span",15),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit;i.pc("ngClass",i.vc(4,Ni,i.tc(2,Pi).includes(e.data.status),i.tc(3,ji).includes(e.data.status))),i.yb(1),i.Qc(" ",e.data.status," ")}}const Yi=function(e){return{"type-osd":e}};function zi(e,t){if(1&e&&(i.Mc(0,Fi,2,7,"span",13),i.Sb(1,"span"),i.Oc(2,"\xa0"),i.Rb(),i.Nb(3,"span",14)),2&e){const e=t.$implicit;i.pc("ngIf",e.data.status),i.yb(3),i.pc("ngClass",i.uc(3,Yi,"osd"===e.data.type))("innerHTML",e.data.name,i.Ec)}}function $i(e,t){if(1&e&&(i.Sb(0,"div",16),i.Sb(1,"legend"),i.Oc(2),i.Rb(),i.Nb(3,"cd-table-key-value",17),i.Rb()),2&e){const e=i.ic();i.yb(2),i.Pc(e.metadataTitle),i.yb(1),i.pc("data",e.metadata)}}let Hi=(()=>{class e{constructor(e,t){this.crushRuleService=e,this.timerService=t,this.sub=new Oi.a,this.icons=_n.a,this.loadingIndicator=!0,this.nodes=[],this.treeOptions={useVirtualScroll:!0,nodeHeight:22,actionMapping:{mouse:{click:this.onNodeSelected.bind(this)}}},this.metadataKeyMap={}}ngOnInit(){this.sub=this.timerService.get(()=>this.crushRuleService.getInfo(),5e3).subscribe(e=>{this.loadingIndicator=!1,this.nodes=this.abstractTreeData(e)})}ngOnDestroy(){this.sub.unsubscribe()}abstractTreeData(e){const t=e.nodes||[],n=e.roots||[],i={};if(0===t.length)return[{name:"No nodes!"}];const r=[];return t.reverse().forEach(e=>{n.includes(e.id)&&r.push(e.id),i[e.id]=this.generateTreeLeaf(e,i)}),r.map(e=>i[e])}generateTreeLeaf(e,t){const n=e.id;this.metadataKeyMap[n]=e;const i=[],r={name:e.name+" ("+e.type+")",status:e.status,cdId:n,type:e.type};return e.children&&(e.children.sort().forEach(e=>{i.push(t[e])}),r.children=i),r}onNodeSelected(e,t){if(kn.a.ACTIVATE(e,t,!0),void 0!==t.data.cdId){const e=this.metadataKeyMap[t.data.cdId],{name:n,type:i}=e,r=Object(Ft.f)(e,["name","type","status"]);this.metadata=r,this.metadataTitle=n+" ("+i+")"}else delete this.metadata,delete this.metadataTitle}onUpdateData(){this.tree.treeModel.expandAll()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Ri.a),i.Mb(Li.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-crushmap"]],viewQuery:function(e,t){var n;1&e&&i.Tc(Ei,!0),2&e&&i.zc(n=i.hc())&&(t.tree=n.first)},decls:14,vars:4,consts:function(){return[[1,"row"],[1,"col-sm-12","col-lg-12"],[1,"card"],[1,"card-header"],"CRUSH map viewer",[1,"card-body"],[1,"col-sm-6","col-lg-6","tree-container"],[3,"ngClass",4,"ngIf"],[3,"nodes","options","updateData"],["tree",""],["treeNodeTemplate",""],["class","col-sm-6 col-lg-6 metadata",4,"ngIf"],[3,"ngClass"],["class","badge",3,"ngClass",4,"ngIf"],[1,"node-name",3,"ngClass","innerHTML"],[1,"badge",3,"ngClass"],[1,"col-sm-6","col-lg-6","metadata"],[3,"data"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"div",2),i.Sb(3,"div",3),i.Wb(4,4),i.Rb(),i.Sb(5,"div",5),i.Sb(6,"div",0),i.Sb(7,"div",6),i.Mc(8,Ii,1,5,"i",7),i.Sb(9,"tree-root",8,9),i.gc("updateData",(function(){return t.onUpdateData()})),i.Mc(11,zi,4,5,"ng-template",null,10,i.Nc),i.Rb(),i.Rb(),i.Mc(13,$i,4,2,"div",11),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(8),i.pc("ngIf",t.loadingIndicator),i.yb(1),i.pc("nodes",t.nodes)("options",t.treeOptions),i.yb(4),i.pc("ngIf",t.metadata))},directives:[o.r,kn.b,o.p,en.a],styles:[".tree-container[_ngcontent-%COMP%]{height:calc(100vh - 200px)}"]}),e})();var Wi=n("LRne"),Vi=n("lJxs"),Bi=n("Kqap"),Ui=n("BFxc"),Gi=n("xbPD"),qi=n("mCNh");function Ji(e,t,n){return 0===n?[t]:(e.push(t),e)}function Qi(){return function(e,t){return arguments.length>=2?function(n){return Object(qi.a)(Object(Bi.a)(e,t),Object(Ui.a)(1),Object(Gi.a)(t))(n)}:function(t){return Object(qi.a)(Object(Bi.a)((t,n,i)=>e(t,n,i+1)),Object(Ui.a)(1))(t)}}(Ji,[])}var Ki=n("5+tZ");let Zi=(()=>{class e{calculateAdditionalData(e){if(!e.life_expectancy_min||!e.life_expectancy_max)return e.state="unknown",e;const t=e=>!!Number.parseFloat(e),n=(e,n)=>e&&n&&t(e)&&t(n)?nn.a.duration(nn()(e).diff(nn()(n))).asWeeks():null,i=nn.a.duration(nn()(nn.a.now()).diff(nn()(e.life_expectancy_stamp))).asWeeks(),r=n(e.life_expectancy_max,e.life_expectancy_stamp),s=n(e.life_expectancy_min,e.life_expectancy_stamp);return e.state=i>1?"stale":null!==r&&r<=2?"bad":null!==s&&s<=4?"warning":"good",e.life_expectancy_weeks={max:null!==r?Math.round(r):null,min:null!==s?Math.round(s):null},e}readable(e){return e.readableDaemons=e.daemons.join(" "),e}prepareDevice(e){return this.readable(this.calculateAdditionalData(e))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Xi=(()=>{class e{constructor(e,t){this.http=e,this.deviceService=t,this.baseURL="api/host",this.baseUIURL="ui-api/host"}list(){return this.http.get(this.baseURL)}create(e,t,n,i){return this.http.post(this.baseURL,{hostname:e,addr:t,labels:n,status:i},{observe:"response",headers:{Accept:"application/vnd.ceph.api.v0.1+json"}})}delete(e){return this.http.delete(`${this.baseURL}/${e}`,{observe:"response"})}getDevices(e){return this.http.get(`${this.baseURL}/${e}/devices`).pipe(Object(Vi.a)(e=>e.map(e=>this.deviceService.prepareDevice(e))))}getSmartData(e){return this.http.get(`${this.baseURL}/${e}/smart`)}getDaemons(e){return this.http.get(`${this.baseURL}/${e}/daemons`)}getLabels(){return this.http.get(this.baseUIURL+"/labels")}update(e,t=!1,n=[],i=!1,r=!1){return this.http.put(`${this.baseURL}/${e}`,{update_labels:t,labels:n,maintenance:i,force:r},{headers:{Accept:"application/vnd.ceph.api.v0.1+json"}})}identifyDevice(e,t,n){return this.http.post(`${this.baseURL}/${e}/identify_device`,{device:t,duration:n})}getInventoryParams(e){let t=new a.e;return e&&(t=t.append("refresh",Nt.a.toString(e))),t}getInventory(e,t){const n=this.getInventoryParams(t);return this.http.get(`${this.baseURL}/${e}/inventory`,{params:n})}inventoryList(e){const t=this.getInventoryParams(e);return this.http.get(this.baseUIURL+"/inventory",{params:t})}inventoryDeviceList(e,t){let n;return n=e?this.getInventory(e,t).pipe(Qi()):this.inventoryList(t),n.pipe(Object(Ki.a)(e=>{const t=Nt.a.flatMap(e,e=>e.devices.map(t=>(t.hostname=e.name,t.uid=t.device_id?t.device_id:`${t.hostname}-${t.path}`,t)));return Object(Wi.a)(t)}))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b),i.dc(Zi))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var er=n("DNAf"),tr=n("kvvV"),nr=n("kn/O"),ir=n("IZUe"),rr=n("ppaS"),sr=n("8xTl");function or(e,t){1&e&&(i.Sb(0,"span",27),i.Wb(1,28),i.Rb())}function ar(e,t){1&e&&(i.Sb(0,"span",27),i.Wb(1,29),i.Rb())}function cr(e,t){1&e&&(i.Sb(0,"span",27),i.Wb(1,30),i.Rb())}function lr(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",1),i.Sb(1,"form",2,3),i.Sb(3,"div",4),i.Sb(4,"div",5),i.Wb(5,6),i.jc(6,"titlecase"),i.jc(7,"upperFirst"),i.Rb(),i.Sb(8,"div",7),i.Sb(9,"div",8),i.Sb(10,"label",9),i.Wb(11,10),i.Rb(),i.Sb(12,"div",11),i.Nb(13,"input",12),i.Mc(14,or,2,0,"span",13),i.Mc(15,ar,2,0,"span",13),i.Rb(),i.Rb(),i.Sb(16,"div",8),i.Sb(17,"label",14),i.Wb(18,15),i.Rb(),i.Sb(19,"div",11),i.Nb(20,"input",16),i.Mc(21,cr,2,0,"span",13),i.Rb(),i.Rb(),i.Sb(22,"div",8),i.Sb(23,"label",17),i.Wb(24,18),i.Rb(),i.Sb(25,"div",11),i.Nb(26,"cd-select-badges",19),i.Rb(),i.Rb(),i.Sb(27,"div",8),i.Sb(28,"div",20),i.Sb(29,"div",21),i.Nb(30,"input",22),i.Sb(31,"label",23),i.Wb(32,24),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(33,"div",25),i.Sb(34,"cd-form-button-panel",26),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic().submit()})),i.jc(35,"titlecase"),i.jc(36,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(2),t=i.ic();i.yb(1),i.pc("formGroup",t.hostForm),i.yb(6),i.ac(i.kc(6,11,t.action))(i.kc(7,13,t.resource)),i.Xb(5),i.yb(7),i.pc("ngIf",t.hostForm.showError("hostname",e,"required")),i.yb(1),i.pc("ngIf",t.hostForm.showError("hostname",e,"uniqueName")),i.yb(6),i.pc("ngIf",t.hostForm.showError("addr",e,"pattern")),i.yb(5),i.pc("data",t.hostForm.controls.labels.value)("customBadges",!0)("messages",t.messages),i.yb(8),i.pc("form",t.hostForm)("submitText",i.kc(35,15,t.action)+" "+i.kc(36,17,t.resource))}}let ur=(()=>{class e extends qn.a{constructor(e,t,n,i){super(),this.router=e,this.actionLabels=t,this.hostService=n,this.taskWrapper=i,this.messages=new er.a({empty:"There are no labels.",filter:"Filter or add labels",add:"Add label"}),this.resource="host",this.action=this.actionLabels.CREATE,this.createForm()}ngOnInit(){this.hostService.list().subscribe(e=>{this.hostnames=e.map(e=>e.hostname),this.loadingReady()})}createForm(){this.hostForm=new Jn.a({hostname:new xn.h("",{validators:[xn.A.required,Cn.a.custom("uniqueName",e=>this.hostnames&&-1!==this.hostnames.indexOf(e))]}),addr:new xn.h("",{validators:[Cn.a.ip()]}),labels:new xn.h([]),maintenance:new xn.h(!1)})}submit(){const e=this.hostForm.get("hostname").value;this.addr=this.hostForm.get("addr").value,this.status=this.hostForm.get("maintenance").value?"maintenance":"",this.allLabels=this.hostForm.get("labels").value,this.taskWrapper.wrapTaskAroundCall({task:new tr.a("host/"+gn.e.CREATE,{hostname:e}),call:this.hostService.create(e,this.addr,this.allLabels,this.status)}).subscribe({error:()=>{this.hostForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.router.navigate(["/hosts"])}})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e),i.Mb(gn.b),i.Mb(Xi),i.Mb(nr.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-host-form"]],features:[i.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","hostForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","hostname",1,"cd-col-form-label","required"],"Hostname",[1,"cd-col-form-input"],["type","text","placeholder","mon-123","id","hostname","name","hostname","formControlName","hostname","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","addr",1,"cd-col-form-label"],"Nework address",["type","text","placeholder","192.168.0.1","id","addr","name","addr","formControlName","addr",1,"form-control"],["for","labels",1,"cd-col-form-label"],"Labels",["id","labels",3,"data","customBadges","messages"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","maintenance","type","checkbox","formControlName","maintenance",1,"custom-control-input"],["for","maintenance",1,"custom-control-label"],"Maintenance Mode",[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The chosen hostname is already in use.","The value is not a valid IP address."]},template:function(e,t){1&e&&i.Mc(0,lr,37,19,"div",0),2&e&&i.pc("cdFormLoading",t.loading)},directives:[Kn.a,xn.C,xn.r,Zn.a,xn.k,Xn.a,On.a,xn.d,ei.a,xn.q,xn.i,ir.a,o.r,rr.a,xn.b,ti.a],pipes:[o.A,sr.a],styles:[""]}),e})(),dr=(()=>{class e{constructor(e){this.http=e,this.url="api/orchestrator",this.disableMessages={noOrchestrator:"The feature is disabled because Orchestrator is not available.",missingFeature:"The Orchestrator backend doesn't support this feature."}}status(){return this.http.get(this.url+"/status")}hasFeature(e,t){return Nt.a.every(t,t=>Nt.a.get(e.features,t+".available"))}getTableActionDisableDesc(e,t){return!!e&&(e.available?!this.hasFeature(e,t)&&this.disableMessages.missingFeature:this.disableMessages.noOrchestrator)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var hr=function(e){return e.HOST_LIST="get_hosts",e.HOST_CREATE="add_host",e.HOST_DELETE="remove_host",e.HOST_LABEL_ADD="add_host_label",e.HOST_LABEL_REMOVE="remove_host_label",e.HOST_MAINTENANCE_ENTER="enter_host_maintenance",e.HOST_MAINTENANCE_EXIT="exit_host_maintenance",e.SERVICE_LIST="describe_service",e.SERVICE_CREATE="apply",e.SERVICE_DELETE="remove_service",e.SERVICE_RELOAD="service_action",e.DAEMON_LIST="list_daemons",e.OSD_GET_REMOVE_STATUS="remove_osds_status",e.OSD_CREATE="apply_drivegroups",e.OSD_DELETE="remove_osds",e.DEVICE_LIST="get_inventory",e.DEVICE_BLINK_LIGHT="blink_device_light",e}({}),fr=n("85J/"),pr=n("EgGo");n("jKX/");let mr=(()=>{class e{constructor(e,t){this.http=e,this.deviceService=t,this.path="api/osd",this.osdRecvSpeedModalPriorities={KNOWN_PRIORITIES:[{name:null,text:"-- Select the priority --",values:{osd_max_backfills:null,osd_recovery_max_active:null,osd_recovery_max_single_start:null,osd_recovery_sleep:null}},{name:"low",text:"Low",values:{osd_max_backfills:1,osd_recovery_max_active:1,osd_recovery_max_single_start:1,osd_recovery_sleep:.5}},{name:"default",text:"Default",values:{osd_max_backfills:1,osd_recovery_max_active:3,osd_recovery_max_single_start:1,osd_recovery_sleep:0}},{name:"high",text:"High",values:{osd_max_backfills:4,osd_recovery_max_active:4,osd_recovery_max_single_start:4,osd_recovery_sleep:0}}]}}create(e){const t={method:"drive_groups",data:e,tracking_id:Nt.a.join(Nt.a.map(e,"service_id"),", ")};return this.http.post(this.path,t,{observe:"response"})}getList(){return this.http.get(""+this.path)}getDetails(e){return this.http.get(`${this.path}/${e}`)}getSmartData(e){return this.http.get(`${this.path}/${e}/smart`)}scrub(e,t){return this.http.post(`${this.path}/${e}/scrub?deep=${t}`,null)}getFlags(){return this.http.get(this.path+"/flags")}updateFlags(e){return this.http.put(this.path+"/flags",{flags:e})}updateIndividualFlags(e,t){return this.http.put(this.path+"/flags/individual",{flags:e,ids:t})}markOut(e){return this.http.put(`${this.path}/${e}/mark`,{action:"out"})}markIn(e){return this.http.put(`${this.path}/${e}/mark`,{action:"in"})}markDown(e){return this.http.put(`${this.path}/${e}/mark`,{action:"down"})}reweight(e,t){return this.http.post(`${this.path}/${e}/reweight`,{weight:t})}update(e,t){return this.http.put(`${this.path}/${e}`,{device_class:t})}markLost(e){return this.http.put(`${this.path}/${e}/mark`,{action:"lost"})}purge(e){return this.http.post(`${this.path}/${e}/purge`,null)}destroy(e){return this.http.post(`${this.path}/${e}/destroy`,null)}delete(e,t,n){return this.http.delete(`${this.path}/${e}`,{observe:"response",params:{preserve_id:t?"true":"false",force:n?"true":"false"}})}safeToDestroy(e){return this.http.get(`${this.path}/safe_to_destroy?ids=${e}`)}safeToDelete(e){return this.http.get(`${this.path}/safe_to_delete?svc_ids=${e}`)}getDevices(e){return this.http.get(`${this.path}/${e}/devices`).pipe(Object(Vi.a)(e=>e.map(e=>this.deviceService.prepareDevice(e))))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b),i.dc(Zi))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var br=n("/NlG");const gr=["deviceLocation"],_r=["lifeExpectancy"],yr=["lifeExpectancyTimestamp"];function vr(e,t){if(1&e&&i.Nb(0,"cd-table",5),2&e){const e=i.ic();i.pc("data",e.devices)("columns",e.columns)}}function wr(e,t){1&e&&(i.Sb(0,"cd-alert-panel",6),i.Wb(1,7),i.Rb())}function Sr(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.Pc(e.dev)}}function Mr(e,t){1&e&&i.Mc(0,Sr,2,1,"span",8),2&e&&i.pc("ngForOf",t.value)}function xr(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.jc(2,"i18nPlural"),i.Rb()),2&e){const e=i.ic().value,t=i.ic();i.yb(1),i.Qc("> ",i.lc(2,1,e.min,t.translationMapping),"")}}function kr(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.jc(2,"i18nPlural"),i.Rb()),2&e){const e=i.ic().value,t=i.ic();i.yb(1),i.Qc("< ",i.lc(2,1,e.max,t.translationMapping),"")}}function Dr(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.jc(2,"i18nPlural"),i.Rb()),2&e){const e=i.ic().value,t=i.ic();i.yb(1),i.Rc("",e.min," to ",i.lc(2,2,e.max,t.translationMapping),"")}}function Tr(e,t){if(1&e&&(i.Mc(0,xr,3,4,"span",9),i.Mc(1,kr,3,4,"span",9),i.Mc(2,Dr,3,5,"span",9)),2&e){const e=t.value;i.pc("ngIf",e.min&&!e.max),i.yb(1),i.pc("ngIf",e.max&&!e.min),i.yb(1),i.pc("ngIf",e.max&&e.min)}}function Cr(e,t){1&e&&i.Oc(0),2&e&&i.Qc(" ",t.value,"\n")}let Or=(()=>{class e{constructor(e,t,n){this.hostService=e,this.datePipe=t,this.osdService=n,this.hostname="",this.osdId=null,this.devices=null,this.columns=[],this.translationMapping={"=1":"# week",other:"# weeks"}}ngOnInit(){this.columns=[{prop:"devid",name:"Device ID",minWidth:200},{prop:"state",name:"State of Health",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{map:{good:{value:"Good",class:"badge-success"},warning:{value:"Warning",class:"badge-warning"},bad:{value:"Bad",class:"badge-danger"},stale:{value:"Stale",class:"badge-info"},unknown:{value:"Unknown",class:"badge-dark"}}}},{prop:"life_expectancy_weeks",name:"Life Expectancy",cellTemplate:this.lifeExpectancyTemplate},{prop:"life_expectancy_stamp",name:"Prediction Creation Date",cellTemplate:this.lifeExpectancyTimestampTemplate,pipe:this.datePipe,isHidden:!0},{prop:"location",name:"Device Name",cellTemplate:this.locationTemplate},{prop:"readableDaemons",name:"Daemons"}]}ngOnChanges(){const e=e=>this.devices=e;this.hostname?this.hostService.getDevices(this.hostname).subscribe(e):null!==this.osdId&&this.osdService.getDevices(this.osdId).subscribe(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Xi),i.Mb(o.e),i.Mb(mr))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-device-list"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(gr,!0),i.Jc(_r,!0),i.Jc(yr,!0)),2&e&&(i.zc(n=i.hc())&&(t.locationTemplate=n.first),i.zc(n=i.hc())&&(t.lifeExpectancyTemplate=n.first),i.zc(n=i.hc())&&(t.lifeExpectancyTimestampTemplate=n.first))},inputs:{hostname:"hostname",osdId:"osdId"},features:[i.wb],decls:8,vars:2,consts:function(){return[[3,"data","columns",4,"ngIf"],["type","warning",4,"ngIf"],["deviceLocation",""],["lifeExpectancy",""],["lifeExpectancyTimestamp",""],[3,"data","columns"],["type","warning"],"Neither hostname nor OSD ID given",[4,"ngFor","ngForOf"],[4,"ngIf"]]},template:function(e,t){1&e&&(i.Mc(0,vr,1,2,"cd-table",0),i.Mc(1,wr,2,0,"cd-alert-panel",1),i.Mc(2,Mr,1,1,"ng-template",null,2,i.Nc),i.Mc(4,Tr,3,3,"ng-template",null,3,i.Nc),i.Mc(6,Cr,1,1,"ng-template",null,4,i.Nc)),2&e&&(i.pc("ngIf",t.hostname||null!==t.osdId),i.yb(1),i.pc("ngIf",""===t.hostname&&null===t.osdId))},directives:[o.r,Bt.a,br.a,o.q],pipes:[o.i],styles:[""]}),e})();var Rr=n("6qls");function Lr(e,t){1&e&&(i.Sb(0,"cd-alert-panel",2),i.Wb(1,3),i.Rb())}function Er(e,t){1&e&&(i.Sb(0,"cd-alert-panel",2),i.cc(1,4),i.Nb(2,"cd-doc",5),i.Zb(),i.Rb())}let Ar=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-orchestrator-doc-panel"]],inputs:{missingFeatures:"missingFeatures"},decls:3,vars:2,consts:function(){return[["type","info",4,"ngIf","ngIfElse"],["elseBlock",""],["type","info"],"The feature is not supported in the current Orchestrator.","Orchestrator is not available. Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to configure and enable the functionality.",["section","orch"]]},template:function(e,t){if(1&e&&(i.Mc(0,Lr,2,0,"cd-alert-panel",0),i.Mc(1,Er,3,0,"ng-template",null,1,i.Nc)),2&e){const e=i.Ac(2);i.pc("ngIf",t.missingFeatures)("ngIfElse",e)}},directives:[o.r,br.a,Rr.a],styles:[""]}),e})(),Ir=(()=>{class e{constructor(e,t,n,r,s,o){this.authStorageService=e,this.dimlessBinary=t,this.modalService=n,this.notificationService=r,this.orchService=s,this.hostService=o,this.devices=[],this.hiddenColumns=[],this.filterColumns=["hostname","human_readable_type","available","sys_api.vendor","sys_api.model","sys_api.size"],this.selectionType=void 0,this.filterChange=new i.o,this.fetchInventory=new i.o,this.icons=_n.a,this.columns=[],this.selection=new Wt.a,this.orchStatus=void 0,this.actionOrchFeatures={identify:[hr.DEVICE_BLINK_LIGHT]}}ngOnInit(){this.permission=this.authStorageService.getPermissions().osd,this.tableActions=[{permission:"update",icon:_n.a.show,click:()=>this.identifyDevice(),name:"Identify",disable:e=>this.getDisable("identify",e),canBePrimary:e=>!e.hasSingleSelection,visible:()=>Nt.a.isString(this.selectionType)}];const e=[{name:"Hostname",prop:"hostname",flexGrow:1},{name:"Device path",prop:"path",flexGrow:1},{name:"Type",prop:"human_readable_type",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{map:{hdd:{value:"HDD",class:"badge-hdd"},ssd:{value:"SSD",class:"badge-ssd"}}}},{name:"Available",prop:"available",flexGrow:1,cellClass:"text-center",cellTransformation:Ht.a.checkIcon},{name:"Vendor",prop:"sys_api.vendor",flexGrow:1},{name:"Model",prop:"sys_api.model",flexGrow:1},{name:"Size",prop:"sys_api.size",flexGrow:1,pipe:this.dimlessBinary},{name:"OSDs",prop:"osd_ids",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{class:"badge-dark",prefix:"osd."}}];this.columns=e.filter(e=>!this.hiddenColumns.includes(e.prop)),Nt.a.forEach(this.filterColumns,e=>{const t=Nt.a.find(this.columns,{prop:e});t&&(t.filterable=!0)}),this.fetchInventory.observers.length>0&&(this.fetchInventorySub=this.table.fetchData.subscribe(()=>{this.fetchInventory.emit()}))}ngOnDestroy(){this.fetchInventorySub&&this.fetchInventorySub.unsubscribe()}onColumnFiltersChanged(e){this.filterChange.emit(e)}getDisable(e,t){return!t.hasSingleSelection||this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}updateSelection(e){this.selection=e}identifyDevice(){const e=this.selection.first(),t=e.hostname,n=e.path||e.device_id;this.modalService.show(Tn.a,{titleText:"Identify device " + n + "",message:"Please enter the duration how long to blink the LED.",fields:[{type:"select",name:"duration",value:300,required:!0,typeConfig:{options:[{text:"1 minute",value:60},{text:"2 minutes",value:120},{text:"5 minutes",value:300},{text:"10 minutes",value:600},{text:"15 minutes",value:900}]}}],submitButtonText:"Execute",onSubmit:e=>{this.hostService.identifyDevice(t,n,e.duration).subscribe(()=>{this.notificationService.show(yn.a.success,"Identifying '" + n + "' started on host '" + t + "'")})}})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Zt.a),i.Mb(vn.a),i.Mb(wn.a),i.Mb(dr),i.Mb(Xi))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-inventory-devices"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Bt.a,!0),2&e&&i.zc(n=i.hc())&&(t.table=n.first)},inputs:{devices:"devices",hiddenColumns:"hiddenColumns",filterColumns:"filterColumns",selectionType:"selectionType",orchStatus:"orchStatus"},outputs:{filterChange:"filterChange",fetchInventory:"fetchInventory"},decls:2,vars:9,consts:[["identifier","uid","columnMode","flex",3,"data","columns","forceIdentifier","selectionType","autoReload","searchField","updateSelection","columnFiltersChanged"],[1,"table-actions",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(i.Sb(0,"cd-table",0),i.gc("updateSelection",(function(e){return t.updateSelection(e)}))("columnFiltersChanged",(function(e){return t.onColumnFiltersChanged(e)})),i.Nb(1,"cd-table-actions",1),i.Rb()),2&e&&(i.pc("data",t.devices)("columns",t.columns)("forceIdentifier",!0)("selectionType",t.selectionType)("autoReload",!1)("searchField",!1),i.yb(1),i.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Bt.a,Sn.a],styles:[".filter[_ngcontent-%COMP%]{padding-right:8px}.fa-stack[_ngcontent-%COMP%]{font-size:.79rem}.fa-stack[_ngcontent-%COMP%]   .fa-stack-1x[_ngcontent-%COMP%]{margin-left:8px;margin-top:5px}"]}),e})();function Pr(e,t){1&e&&i.Nb(0,"cd-orchestrator-doc-panel")}const jr=function(){return[]},Nr=function(){return["hostname"]};function Fr(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"legend"),i.Wb(2,1),i.Rb(),i.Sb(3,"div",2),i.Sb(4,"div",3),i.Sb(5,"cd-inventory-devices",4),i.gc("fetchInventory",(function(){return i.Dc(e),i.ic().refresh()})),i.Rb(),i.Rb(),i.Rb(),i.Pb()}if(2&e){const e=i.ic();i.yb(5),i.pc("devices",e.devices)("hiddenColumns",void 0===e.hostname?i.tc(3,jr):i.tc(4,Nr))("orchStatus",e.orchStatus)}}let Yr=(()=>{class e{constructor(e,t,n){this.orchService=e,this.hostService=t,this.ngZone=n,this.reloadInterval=5e3,this.firstRefresh=!0,this.icons=_n.a,this.showDocPanel=!1,this.devices=[]}ngOnInit(){this.orchService.status().subscribe(e=>{this.orchStatus=e,this.showDocPanel=!e.available,e.available&&this.ngZone.runOutsideAngular(()=>{this.reloadSubscriber=Object(Ut.a)(this.reloadInterval,this.reloadInterval).subscribe(()=>{this.ngZone.run(()=>{this.getInventory(!1)})})})})}ngOnDestroy(){var e;null===(e=this.reloadSubscriber)||void 0===e||e.unsubscribe()}ngOnChanges(){var e;(null===(e=this.orchStatus)||void 0===e?void 0:e.available)&&(this.devices=[],this.getInventory(!1))}getInventory(e){""!==this.hostname&&this.hostService.inventoryDeviceList(this.hostname,e).subscribe(e=>{this.devices=e},()=>{this.devices=[]})}refresh(){this.getInventory(!this.firstRefresh),this.firstRefresh=!1}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(dr),i.Mb(Xi),i.Mb(i.A))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-inventory"]],inputs:{hostname:"hostname"},features:[i.wb],decls:2,vars:2,consts:function(){return[[4,"ngIf"],"Physical Disks",[1,"row"],[1,"col-md-12"],["selectionType","single",3,"devices","hiddenColumns","orchStatus","fetchInventory"]]},template:function(e,t){1&e&&(i.Mc(0,Pr,1,0,"cd-orchestrator-doc-panel",0),i.Mc(1,Fr,6,5,"ng-container",0)),2&e&&(i.pc("ngIf",t.showDocPanel),i.yb(1),i.pc("ngIf",null==t.orchStatus?null:t.orchStatus.available))},directives:[o.r,Ar,Ir],styles:[""]}),e})(),zr=(()=>{class e{constructor(e){this.http=e,this.url="api/service"}list(e){const t=e?{params:(new a.e).set("service_name",e)}:{};return this.http.get(this.url,t)}getDaemons(e){return this.http.get(`${this.url}/${e}/daemons`)}create(e){return this.http.post(this.url,{service_name:e.service_id?`${e.service_type}.${e.service_id}`:e.service_type,service_spec:e},{observe:"response"})}delete(e){return this.http.delete(`${this.url}/${e}`,{observe:"response"})}getKnownTypes(){return this.http.get(this.url+"/known_types")}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var $r=n("Dwqy"),Hr=n("zWsK");const Wr=["statusTpl"],Vr=["listTpl"],Br=["daemonsTable"];function Ur(e,t){1&e&&i.Nb(0,"cd-orchestrator-doc-panel")}function Gr(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",6,7),i.gc("fetchData",(function(t){return i.Dc(e),i.ic(2).getDaemons(t)})),i.Rb()}if(2&e){const e=i.ic(2);i.pc("data",e.daemons)("columns",e.columns)}}function qr(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,Gr,2,2,"cd-table",5),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.hasOrchestrator)}}function Jr(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",6,7),i.gc("fetchData",(function(t){return i.Dc(e),i.ic(3).getDaemons(t)})),i.Rb()}if(2&e){const e=i.ic(3);i.pc("data",e.daemons)("columns",e.columns)}}function Qr(e,t){if(1&e&&i.Mc(0,Jr,2,2,"cd-table",5),2&e){const e=i.ic(2);i.pc("ngIf",e.hasOrchestrator)}}function Kr(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",6,17),i.gc("fetchData",(function(t){return i.Dc(e),i.ic(3).getServices(t)})),i.Rb()}if(2&e){const e=i.ic(3);i.pc("data",e.services)("columns",e.serviceColumns)}}function Zr(e,t){if(1&e&&i.Mc(0,Kr,2,2,"cd-table",5),2&e){const e=i.ic(2);i.pc("ngIf",e.hasOrchestrator)}}function Xr(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",8,9),i.Sb(3,"li",10),i.Sb(4,"a",11),i.Wb(5,12),i.Rb(),i.Mc(6,Qr,1,1,"ng-template",13),i.Rb(),i.Sb(7,"li",14),i.Sb(8,"a",11),i.Wb(9,15),i.Rb(),i.Mc(10,Zr,1,1,"ng-template",13),i.Rb(),i.Rb(),i.Nb(11,"div",16),i.Pb()),2&e){const e=i.Ac(2);i.yb(11),i.pc("ngbNavOutlet",e)}}function es(e,t){if(1&e&&(i.Sb(0,"span",18),i.jc(1,"pipeFunction"),i.Oc(2),i.Rb()),2&e){const e=t.row,n=i.ic();i.pc("ngClass",i.lc(1,2,e,n.getStatusClass)),i.yb(2),i.Qc(" ",e.status_desc," ")}}function ts(e,t){1&e&&(i.Sb(0,"div"),i.Sb(1,"span"),i.Oc(2,"No data available"),i.Rb(),i.Rb())}const ns=function(e){return[e]};function is(e,t){if(1&e&&(i.Sb(0,"span"),i.Nb(1,"i",23),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.pc("ngClass",i.uc(1,ns,e.icons.infoCircle))}}function rs(e,t){if(1&e&&(i.Sb(0,"span"),i.Nb(1,"i",23),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.pc("ngClass",i.uc(1,ns,e.icons.warning))}}function ss(e,t){if(1&e&&(i.Sb(0,"ul"),i.Sb(1,"li"),i.Sb(2,"b"),i.Oc(3),i.jc(4,"relativeDate"),i.Rb(),i.Sb(5,"span",22),i.Oc(6),i.Rb(),i.Nb(7,"br"),i.Mc(8,is,2,3,"span",0),i.Mc(9,rs,2,3,"span",0),i.Oc(10),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(3),i.Qc("",i.kc(4,5,e.created)," - "),i.yb(3),i.Pc(e.subject),i.yb(2),i.pc("ngIf","INFO"==e.level),i.yb(1),i.pc("ngIf","ERROR"==e.level),i.yb(1),i.Qc(" ",e.message,"")}}function os(e,t){if(1&e&&(i.Sb(0,"div",20),i.Mc(1,ss,11,7,"ul",21),i.Rb()),2&e){const e=i.ic().value,t=i.ic();i.yb(1),i.pc("ngForOf",e)("ngForTrackBy",t.trackByFn)}}function as(e,t){if(1&e&&(i.Mc(0,ts,3,0,"div",0),i.Mc(1,os,2,2,"div",19)),2&e){const e=t.value;i.pc("ngIf",0==e.length||null==e),i.yb(1),i.pc("ngIf",0!=e.length&&null!=e)}}let cs=(()=>{class e{constructor(e,t,n,i){this.hostService=e,this.cephServiceService=t,this.orchService=n,this.relativeDatePipe=i,this.icons=_n.a,this.daemons=[],this.services=[],this.columns=[],this.serviceColumns=[],this.hasOrchestrator=!1,this.showDocPanel=!1}ngOnInit(){this.columns=[{name:"Hostname",prop:"hostname",flexGrow:2,filterable:!0},{name:"Daemon type",prop:"daemon_type",flexGrow:1,filterable:!0},{name:"Daemon ID",prop:"daemon_id",flexGrow:1,filterable:!0},{name:"Container ID",prop:"container_id",flexGrow:2,filterable:!0,cellTransformation:Ht.a.truncate,customTemplateConfig:{length:12}},{name:"Container Image name",prop:"container_image_name",flexGrow:3,filterable:!0},{name:"Container Image ID",prop:"container_image_id",flexGrow:2,filterable:!0,cellTransformation:Ht.a.truncate,customTemplateConfig:{length:12}},{name:"Version",prop:"version",flexGrow:1,filterable:!0},{name:"Status",prop:"status_desc",flexGrow:1,filterable:!0,cellTemplate:this.statusTpl},{name:"Last Refreshed",prop:"last_refresh",pipe:this.relativeDatePipe,flexGrow:1},{name:"Daemon Events",prop:"events",flexGrow:5,cellTemplate:this.listTpl}],this.serviceColumns=[{name:"Service Name",prop:"service_name",flexGrow:2,filterable:!0},{name:"Service Type",prop:"service_type",flexGrow:1,filterable:!0},{name:"Service Events",prop:"events",flexGrow:5,cellTemplate:this.listTpl}],this.orchService.status().subscribe(e=>{this.hasOrchestrator=e.available,this.showDocPanel=!e.available})}ngOnChanges(){Nt.a.isUndefined(this.daemonsTable)||this.daemonsTable.reloadData()}ngAfterViewInit(){this.daemonsTableTplsSub=this.daemonsTableTpls.changes.subscribe(e=>{this.daemonsTable=e.first})}ngOnDestroy(){this.daemonsTableTplsSub&&this.daemonsTableTplsSub.unsubscribe(),this.serviceSub&&this.serviceSub.unsubscribe()}getStatusClass(e){return Nt.a.get({"-1":"badge-danger",0:"badge-warning",1:"badge-success"},e.status,"badge-dark")}getDaemons(e){let t;if(this.hostname)t=this.hostService.getDaemons(this.hostname);else{if(!this.serviceName)return void(this.daemons=[]);t=this.cephServiceService.getDaemons(this.serviceName)}t.subscribe(e=>{this.daemons=e},()=>{this.daemons=[],e.error()})}getServices(e){this.serviceSub=this.cephServiceService.list(this.serviceName).subscribe(e=>{this.services=e},()=>{this.services=[],e.error()})}trackByFn(e,t){return t.created}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Xi),i.Mb(zr),i.Mb(dr),i.Mb($r.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-service-daemon-list"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(Wr,!0),i.Jc(Vr,!0),i.Tc(Br,!0)),2&e&&(i.zc(n=i.hc())&&(t.statusTpl=n.first),i.zc(n=i.hc())&&(t.listTpl=n.first),i.zc(n=i.hc())&&(t.daemonsTableTpls=n))},inputs:{serviceName:"serviceName",hostname:"hostname",flag:"flag"},features:[i.wb],decls:8,vars:3,consts:function(){return[[4,"ngIf"],[4,"ngIf","ngIfElse"],["serviceDetailsTpl",""],["statusTpl",""],["listTpl",""],["columnMode","flex",3,"data","columns","fetchData",4,"ngIf"],["columnMode","flex",3,"data","columns","fetchData"],["daemonsTable",""],["ngbNav","","cdStatefulTab","service-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","service_events"],"Service Events",[3,"ngbNavOutlet"],["serviceTable",""],[1,"badge",3,"ngClass"],["class","ul-margin",4,"ngIf"],[1,"ul-margin"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"badge","badge-info"],["aria-hidden","true",3,"ngClass"]]},template:function(e,t){if(1&e&&(i.Mc(0,Ur,1,0,"cd-orchestrator-doc-panel",0),i.Mc(1,qr,2,1,"div",1),i.Mc(2,Xr,12,1,"ng-template",null,2,i.Nc),i.Mc(4,es,3,5,"ng-template",null,3,i.Nc),i.Mc(6,as,2,2,"ng-template",null,4,i.Nc)),2&e){const e=i.Ac(3);i.pc("ngIf",t.showDocPanel),i.yb(1),i.pc("ngIf","hostDetails"===t.flag)("ngIfElse",e)}},directives:[o.r,Ar,Bt.a,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,o.p,o.q],pipes:[Hr.b,$r.a],styles:[".fa-info-circle[_ngcontent-%COMP%]{color:#2b99a8}.fa-exclamation-triangle[_ngcontent-%COMP%]{color:#ef5c55}.ul-margin[_ngcontent-%COMP%]{margin-left:-30px}"]}),e})();var ls=n("XFyV");const us=["innerNav"];function ds(e,t){1&e&&(i.Sb(0,"cd-alert-panel",5),i.Wb(1,6),i.Rb())}function hs(e,t){1&e&&(i.Sb(0,"cd-alert-panel",7),i.Wb(1,8),i.Rb())}function fs(e,t){1&e&&(i.Sb(0,"cd-alert-panel",10),i.Wb(1,11),i.Rb())}function ps(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"cd-alert-panel",20),i.Oc(2),i.Rb(),i.Pb()),2&e){const e=i.ic(2).$implicit;i.yb(2),i.Pc(e.value.userMessage)}}function ms(e,t){1&e&&(i.Sb(0,"cd-alert-panel",23),i.Yb(1,24),i.Wb(2,25),i.Rb())}function bs(e,t){1&e&&(i.Qb(0),i.Sb(1,"cd-alert-panel",27),i.Yb(2,28),i.Wb(3,29),i.Rb(),i.Pb())}function gs(e,t){1&e&&(i.Sb(0,"cd-alert-panel",30),i.Yb(1,31),i.Wb(2,32),i.Rb())}function _s(e,t){if(1&e&&(i.Mc(0,bs,4,0,"ng-container",0),i.Mc(1,gs,3,0,"ng-template",null,26,i.Nc)),2&e){const e=i.Ac(2),t=i.ic(3).$implicit;i.pc("ngIf",t.value.info.smart_status.passed)("ngIfElse",e)}}function ys(e,t){if(1&e&&(i.Mc(0,ms,3,0,"cd-alert-panel",21),i.jc(1,"pipeFunction"),i.Mc(2,_s,3,2,"ng-template",null,22,i.Nc)),2&e){const e=i.Ac(3),t=i.ic(2).$implicit,n=i.ic(4);i.pc("ngIf",i.lc(1,2,null==t.value.info?null:t.value.info.smart_status,n.isEmpty))("ngIfElse",e)}}function vs(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",39),2&e){const e=i.ic(4).$implicit;i.pc("renderObjects",!0)("data",e.value.info)}}function ws(e,t){1&e&&(i.Sb(0,"cd-alert-panel",40),i.Wb(1,41),i.Rb())}function Ss(e,t){if(1&e&&(i.Mc(0,vs,1,2,"cd-table-key-value",37),i.jc(1,"pipeFunction"),i.Mc(2,ws,2,0,"cd-alert-panel",38),i.jc(3,"pipeFunction")),2&e){const e=i.ic(3).$implicit,t=i.ic(4);i.pc("ngIf",!i.lc(1,2,e.value.info,t.isEmpty)),i.yb(2),i.pc("ngIf",i.lc(3,5,e.value.info,t.isEmpty))}}function Ms(e,t){if(1&e&&i.Nb(0,"cd-table",45),2&e){const e=i.ic(4).$implicit,t=i.ic(4);i.pc("data",e.value.smart.attributes.table)("columns",t.smartDataColumns)}}function xs(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",46),2&e){const e=i.ic(4).$implicit;i.pc("renderObjects",!0)("data",e.value.smart.nvmeData)}}function ks(e,t){1&e&&(i.Sb(0,"cd-alert-panel",47),i.Wb(1,48),i.Rb())}function Ds(e,t){if(1&e&&(i.Mc(0,Ms,1,2,"cd-table",42),i.Mc(1,xs,1,2,"cd-table-key-value",43),i.Mc(2,ks,2,0,"cd-alert-panel",44)),2&e){const e=i.ic(3).$implicit;i.pc("ngIf",null==e.value.smart?null:e.value.smart.attributes),i.yb(1),i.pc("ngIf",null==e.value.smart?null:e.value.smart.nvmeData),i.yb(1),i.pc("ngIf",!(null!=e.value.smart&&e.value.smart.attributes||null!=e.value.smart&&e.value.smart.nvmeData))}}function Ts(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",12,33),i.Sb(3,"li",34),i.Sb(4,"a",17),i.Wb(5,35),i.Rb(),i.Mc(6,Ss,4,8,"ng-template",18),i.Rb(),i.Sb(7,"li",34),i.Sb(8,"a",17),i.Wb(9,36),i.Rb(),i.Mc(10,Ds,3,3,"ng-template",18),i.Rb(),i.Rb(),i.Nb(11,"div",15),i.Pb()),2&e){const e=i.Ac(2);i.yb(3),i.pc("ngbNavItem",1),i.yb(4),i.pc("ngbNavItem",2),i.yb(4),i.pc("ngbNavOutlet",e)}}function Cs(e,t){if(1&e&&(i.Mc(0,ps,3,1,"ng-container",0),i.Mc(1,ys,4,5,"ng-template",null,19,i.Nc),i.Mc(3,Ts,12,3,"ng-container",4),i.jc(4,"pipeFunction"),i.jc(5,"pipeFunction")),2&e){const e=i.Ac(2),t=i.ic().$implicit,n=i.ic(4);i.pc("ngIf",t.value.error)("ngIfElse",e),i.yb(3),i.pc("ngIf",!i.lc(4,3,t.value.info,n.isEmpty)||!i.lc(5,6,t.value.smart,n.isEmpty))}}function Os(e,t){if(1&e&&(i.Sb(0,"li",16),i.Sb(1,"a",17),i.Oc(2),i.Rb(),i.Mc(3,Cs,6,9,"ng-template",18),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Rc("",e.value.device," (",e.value.identifier,")")}}function Rs(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",12,13),i.Mc(3,Os,4,2,"li",14),i.jc(4,"keyvalue"),i.Rb(),i.Nb(5,"div",15),i.Pb()),2&e){const e=i.Ac(2),t=i.ic(3);i.yb(3),i.pc("ngForOf",i.kc(4,2,t.data)),i.yb(2),i.pc("ngbNavOutlet",e)}}function Ls(e,t){if(1&e&&(i.Qb(0),i.Mc(1,fs,2,0,"cd-alert-panel",9),i.jc(2,"pipeFunction"),i.Mc(3,Rs,6,4,"ng-container",4),i.jc(4,"pipeFunction"),i.Pb()),2&e){const e=i.ic(2);i.yb(1),i.pc("ngIf",i.lc(2,2,e.data,e.isEmpty)),i.yb(2),i.pc("ngIf",!i.lc(4,5,e.data,e.isEmpty))}}function Es(e,t){if(1&e&&(i.Qb(0),i.Mc(1,ds,2,0,"cd-alert-panel",2),i.Mc(2,hs,2,0,"cd-alert-panel",3),i.Mc(3,Ls,5,8,"ng-container",4),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",e.error),i.yb(1),i.pc("ngIf",e.incompatible),i.yb(1),i.pc("ngIf",!e.error&&!e.incompatible)}}function As(e,t){1&e&&(i.Sb(0,"cd-loading-panel"),i.Wb(1,49),i.Rb())}let Is=(()=>{class e{constructor(e,t){this.osdService=e,this.hostService=t,this.osdId=null,this.hostname=null,this.loading=!1,this.incompatible=!1,this.error=!1,this.data={},this.isEmpty=Nt.a.isEmpty}isSmartError(e){return void 0!==Nt.a.get(e,"error")}isNvmeSmartData(e){return"nvme"===Nt.a.get(e,"device.protocol","").toLowerCase()}isHddSmartData(e){return"ata"===Nt.a.get(e,"device.protocol","").toLowerCase()}fetchData(e){const t={};Nt.a.each(e,(e,n)=>{if(this.isSmartError(e)){let i="";i=-22===e.smartctl_error_code?"Smartctl has received an unknown argument (error code " + e.smartctl_error_code + "). You may be using an incompatible version of smartmontools. Version >= 7.0 of smartmontools is required to successfully retrieve data.":"An error with error code " + e.smartctl_error_code + " occurred.",t[n]={error:e.error,smartctl_error_code:e.smartctl_error_code,smartctl_output:e.smartctl_output,userMessage:i,device:e.dev,identifier:e.nvme_vendor}}else 1!==e.json_format_version[0]?this.incompatible=!0:this.isHddSmartData(e)?t[n]=this.extractHddData(e):this.isNvmeSmartData(e)&&(t[n]=this.extractNvmeData(e))}),this.data=t,this.loading=!1}extractNvmeData(e){return{info:Nt.a.omitBy(e,(e,t)=>["nvme_smart_health_information_log"].includes(t)),smart:{nvmeData:e.nvme_smart_health_information_log},device:e.device.name,identifier:e.serial_number}}extractHddData(e){const t=Nt.a.omitBy(e,(e,t)=>["ata_smart_attributes","ata_smart_selective_self_test_log","ata_smart_data"].includes(t));return{info:t,smart:{attributes:e.ata_smart_attributes,data:e.ata_smart_data},device:t.device.name,identifier:t.serial_number}}updateData(){this.loading=!0,null!==this.osdId?this.osdService.getSmartData(this.osdId).subscribe({next:this.fetchData.bind(this),error:e=>{e.preventDefault(),this.error=e,this.loading=!1}}):null!==this.hostname&&this.hostService.getSmartData(this.hostname).subscribe({next:this.fetchData.bind(this),error:e=>{e.preventDefault(),this.error=e,this.loading=!1}})}ngOnInit(){this.smartDataColumns=[{prop:"id",name:"ID"},{prop:"name",name:"Name"},{prop:"raw.value",name:"Raw"},{prop:"thresh",name:"Threshold"},{prop:"value",name:"Value"},{prop:"when_failed",name:"When Failed"},{prop:"worst",name:"Worst"}]}ngOnChanges(e){this.data={},e.osdId?this.osdId=e.osdId.currentValue:e.hostname&&(this.hostname=e.hostname.currentValue),this.updateData()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(mr),i.Mb(Xi))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-smart-list"]],viewQuery:function(e,t){var n;1&e&&i.Tc(us,!0),2&e&&i.zc(n=i.hc())&&(t.nav=n.first)},inputs:{osdId:"osdId",hostname:"hostname"},features:[i.wb],decls:3,vars:2,consts:function(){return[[4,"ngIf","ngIfElse"],["isLoading",""],["type","error",4,"ngIf"],["type","warning",4,"ngIf"],[4,"ngIf"],["type","error"],"Failed to retrieve SMART data.",["type","warning"],"The data received has the JSON format version 2.x and is currently incompatible with the dashboard.",["type","info",4,"ngIf"],["type","info"],"No SMART data available.",["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","",4,"ngFor","ngForOf"],[3,"ngbNavOutlet"],["ngbNavItem",""],["ngbNavLink",""],["ngbNavContent",""],["noError",""],["id","alert-error","type","warning"],["id","alert-self-test-unknown","size","slim","type","warning",4,"ngIf","ngIfElse",6,"title"],["hasSmartStatus",""],["id","alert-self-test-unknown","size","slim","type","warning",6,"title"],["title","SMART overall-health self-assessment test result"],"unknown",["selfTestFailed",""],["id","alert-self-test-passed","size","slim","type","info",6,"title"],["title","SMART overall-health self-assessment test result"],"passed",["id","alert-self-test-failed","size","slim","type","warning",6,"title"],["title","SMART overall-health self-assessment test result"],"failed",["innerNav","ngbNav"],[3,"ngbNavItem"],"Device Information","SMART",[3,"renderObjects","data",4,"ngIf"],["id","alert-device-info-unavailable","type","info",4,"ngIf"],[3,"renderObjects","data"],["id","alert-device-info-unavailable","type","info"],"No device information available for this device.",["updateSelectionOnRefresh","never",3,"data","columns",4,"ngIf"],["updateSelectionOnRefresh","never",3,"renderObjects","data",4,"ngIf"],["id","alert-device-smart-data-unavailable","type","info",4,"ngIf"],["updateSelectionOnRefresh","never",3,"data","columns"],["updateSelectionOnRefresh","never",3,"renderObjects","data"],["id","alert-device-smart-data-unavailable","type","info"],"No SMART data available for this device.","SMART data is loading."]},template:function(e,t){if(1&e&&(i.Mc(0,Es,4,3,"ng-container",0),i.Mc(1,As,2,0,"ng-template",null,1,i.Nc)),2&e){const e=i.Ac(2);i.pc("ngIf",!t.loading)("ngIfElse",e)}},directives:[o.r,br.a,Qt.p,o.q,Qt.u,Qt.r,Qt.s,Qt.q,en.a,Bt.a,ls.a],pipes:[Hr.b,o.k],styles:[""]}),e})();function Ps(e,t){if(1&e&&i.Nb(0,"cd-device-list",14),2&e){const e=i.ic(2);i.pc("hostname",e.selection.hostname)}}function js(e,t){if(1&e&&i.Nb(0,"cd-inventory",14),2&e){const e=i.ic(3);i.pc("hostname",e.selectedHostname)}}function Ns(e,t){1&e&&(i.Sb(0,"li",15),i.Sb(1,"a",5),i.Wb(2,16),i.Rb(),i.Mc(3,js,1,1,"ng-template",7),i.Rb())}function Fs(e,t){if(1&e&&i.Nb(0,"cd-service-daemon-list",19),2&e){const e=i.ic(3);i.pc("hostname",e.selectedHostname)}}function Ys(e,t){1&e&&(i.Sb(0,"li",17),i.Sb(1,"a",5),i.Wb(2,18),i.Rb(),i.Mc(3,Fs,1,1,"ng-template",7),i.Rb())}function zs(e,t){if(1&e&&i.Nb(0,"cd-grafana",22),2&e){const e=i.ic(3);i.pc("grafanaPath","host-details?var-ceph_hosts="+e.selectedHostname)}}function $s(e,t){1&e&&(i.Sb(0,"li",20),i.Sb(1,"a",5),i.Wb(2,21),i.Rb(),i.Mc(3,zs,1,1,"ng-template",7),i.Rb())}function Hs(e,t){if(1&e&&i.Nb(0,"cd-smart-list",14),2&e){const e=i.ic(3);i.pc("hostname",e.selectedHostname)}}function Ws(e,t){if(1&e&&i.Mc(0,Hs,1,1,"cd-smart-list",23),2&e){const e=i.ic(2),t=i.Ac(2);i.pc("ngIf",e.selectedHostname)("ngIfElse",t)}}function Vs(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",2,3),i.Sb(3,"li",4),i.Sb(4,"a",5),i.Wb(5,6),i.Rb(),i.Mc(6,Ps,1,1,"ng-template",7),i.Rb(),i.Mc(7,Ns,4,0,"li",8),i.Mc(8,Ys,4,0,"li",9),i.Mc(9,$s,4,0,"li",10),i.Sb(10,"li",11),i.Sb(11,"a",5),i.Wb(12,12),i.Rb(),i.Mc(13,Ws,1,2,"ng-template",7),i.Rb(),i.Rb(),i.Nb(14,"div",13),i.Pb()),2&e){const e=i.Ac(2),t=i.ic();i.yb(7),i.pc("ngIf",t.permissions.hosts.read),i.yb(1),i.pc("ngIf",t.permissions.hosts.read),i.yb(1),i.pc("ngIf",t.permissions.grafana.read),i.yb(5),i.pc("ngbNavOutlet",e)}}function Bs(e,t){1&e&&(i.Sb(0,"cd-alert-panel",24),i.Wb(1,25),i.Rb())}let Us=(()=>{class e{get selectedHostname(){return void 0!==this.selection?this.selection.hostname:null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-host-details"]],inputs:{permissions:"permissions",selection:"selection"},decls:3,vars:1,consts:function(){return[[4,"ngIf"],["noHostname",""],["ngbNav","","cdStatefulTab","host-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","devices"],["ngbNavLink",""],"Devices",["ngbNavContent",""],["ngbNavItem","inventory",4,"ngIf"],["ngbNavItem","daemons",4,"ngIf"],["ngbNavItem","performance-details",4,"ngIf"],["ngbNavItem","device-health"],"Device health",[3,"ngbNavOutlet"],[3,"hostname"],["ngbNavItem","inventory"],"Physical Disks",["ngbNavItem","daemons"],"Daemons",["flag","hostDetails",3,"hostname"],["ngbNavItem","performance-details"],"Performance Details",["uid","rtOg0AiWz","grafanaStyle","four",3,"grafanaPath"],[3,"hostname",4,"ngIf","ngIfElse"],["type","error"],"No hostname found."]},template:function(e,t){1&e&&(i.Mc(0,Vs,15,4,"ng-container",0),i.Mc(1,Bs,2,0,"ng-template",null,1,i.Nc)),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,Or,Yr,cs,Fn.a,Is,br.a],styles:[""]}),e})();const Gs=["servicesTpl"],qs=["maintenanceConfirmTpl"];function Js(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",10),i.gc("fetchData",(function(t){return i.Dc(e),i.ic().getHosts(t)}))("setExpandedRow",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)}))("updateSelection",(function(t){return i.Dc(e),i.ic().updateSelection(t)})),i.Sb(1,"div",11),i.Nb(2,"cd-table-actions",12),i.Rb(),i.Nb(3,"cd-host-details",13),i.Rb()}if(2&e){const e=i.ic();i.pc("data",e.hosts)("columns",e.columns)("hasDetails",!0),i.yb(2),i.pc("permission",e.permissions.hosts)("selection",e.selection)("tableActions",e.tableActions),i.yb(1),i.pc("permissions",e.permissions)("selection",e.expandedRow)}}function Qs(e,t){1&e&&i.Nb(0,"cd-grafana",15),2&e&&i.pc("grafanaPath","host-overview?")}function Ks(e,t){1&e&&(i.Sb(0,"li",2),i.Sb(1,"a",3),i.Wb(2,14),i.Rb(),i.Mc(3,Qs,1,1,"ng-template",5),i.Rb())}const Zs=function(e){return[e]};function Xs(e,t){if(1&e&&(i.Sb(0,"a",19),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic(2);i.pc("routerLink",i.uc(4,Zs,e.cdLink))("queryParams",t.cdParams),i.yb(1),i.Rc("",e.type,".",e.id,"")}}function eo(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.Rc(" ",e.type,".",e.id," ")}}function to(e,t){1&e&&(i.Qb(0),i.Oc(1,", "),i.Pb())}function no(e,t){if(1&e&&(i.Sb(0,"span"),i.Mc(1,Xs,2,6,"a",17),i.Mc(2,eo,2,2,"span",18),i.Mc(3,to,2,0,"ng-container",18),i.Rb()),2&e){const e=t.$implicit,n=t.last;i.yb(1),i.pc("ngIf",e.canRead),i.yb(1),i.pc("ngIf",!e.canRead),i.yb(1),i.pc("ngIf",!n)}}function io(e,t){1&e&&i.Mc(0,no,4,3,"span",16),2&e&&i.pc("ngForOf",t.value)}function ro(e,t){if(1&e&&(i.Sb(0,"ul"),i.Sb(1,"li"),i.Wb(2,20),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(2),i.ac(e),i.Xb(2)}}function so(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,ro,3,1,"ul",18),i.Rb()),2&e){const e=t.last,n=i.ic(2);i.yb(1),i.pc("ngIf",!e||"1"==n.errorMessage.length)}}function oo(e,t){1&e&&(i.Qb(0),i.Wb(1,21),i.Pb())}function ao(e,t){if(1&e&&(i.Mc(0,so,2,1,"div",16),i.Mc(1,oo,2,0,"ng-container",18)),2&e){const e=i.ic();i.pc("ngForOf",e.errorMessage),i.yb(1),i.pc("ngIf",e.showSubmit)}}let co=(()=>{class e extends $t.a{constructor(e,t,n,i,r,s,o,a,c,l){super(),this.authStorageService=e,this.hostService=t,this.cephShortVersionPipe=n,this.urlBuilder=i,this.actionLabels=r,this.modalService=s,this.taskWrapper=o,this.router=a,this.notificationService=c,this.orchService=l,this.columns=[],this.hosts=[],this.isLoadingHosts=!1,this.cdParams={fromLink:"/hosts"},this.selection=new Wt.a,this.isExecuting=!1,this.icons=_n.a,this.messages={nonOrchHost:"The feature is disabled because the selected host is not managed by Orchestrator."},this.actionOrchFeatures={create:[hr.HOST_CREATE],edit:[hr.HOST_LABEL_ADD,hr.HOST_LABEL_REMOVE],delete:[hr.HOST_DELETE],maintenance:[hr.HOST_MAINTENANCE_ENTER,hr.HOST_MAINTENANCE_EXIT]},this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{name:this.actionLabels.CREATE,permission:"create",icon:_n.a.add,click:()=>this.router.navigate([this.urlBuilder.getCreate()]),disable:e=>this.getDisable("create",e)},{name:this.actionLabels.EDIT,permission:"update",icon:_n.a.edit,click:()=>this.editAction(),disable:e=>this.getDisable("edit",e)},{name:this.actionLabels.DELETE,permission:"delete",icon:_n.a.destroy,click:()=>this.deleteAction(),disable:e=>this.getDisable("delete",e)},{name:this.actionLabels.ENTER_MAINTENANCE,permission:"update",icon:_n.a.enter,click:()=>this.hostMaintenance(),disable:e=>this.getDisable("maintenance",e)||this.isExecuting||this.enableButton},{name:this.actionLabels.EXIT_MAINTENANCE,permission:"update",icon:_n.a.exit,click:()=>this.hostMaintenance(),disable:e=>this.getDisable("maintenance",e)||this.isExecuting||!this.enableButton}]}ngOnInit(){this.columns=[{name:"Hostname",prop:"hostname",flexGrow:1},{name:"Services",prop:"services",flexGrow:3,cellTemplate:this.servicesTpl},{name:"Labels",prop:"labels",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{class:"badge-dark"}},{name:"Status",prop:"status",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{map:{maintenance:{class:"badge-warning"}}}},{name:"Version",prop:"ceph_version",flexGrow:1,pipe:this.cephShortVersionPipe}],this.orchService.status().subscribe(e=>{this.orchStatus=e})}updateSelection(e){this.selection=e,this.enableButton=!1,this.selection.hasSelection&&"maintenance"===this.selection.first().status&&(this.enableButton=!0)}editAction(){this.hostService.getLabels().subscribe(e=>{const t=this.selection.first(),n=e.map(e=>({enabled:!0,name:e}));this.modalService.show(Tn.a,{titleText:"Edit Host: " + t.hostname + "",fields:[{type:"select-badges",name:"labels",value:t.labels,label:"Labels",typeConfig:{customBadges:!0,options:n,messages:new er.a({empty:"There are no labels.",filter:"Filter or add labels",add:"Add label"})}}],submitButtonText:"Edit Host",onSubmit:e=>{this.hostService.update(t.hostname,!0,e.labels).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated Host \"" + t.hostname + "\""),this.table.refreshBtn()})}})})}hostMaintenance(){this.isExecuting=!0;const e=this.selection.first();"maintenance"!==e.status?this.hostService.update(e.hostname,!1,[],!0).subscribe(()=>{this.isExecuting=!1,this.notificationService.show(yn.a.success,"\"" + e.hostname + "\" moved to maintenance"),this.table.refreshBtn()},t=>{if(this.isExecuting=!1,this.errorMessage=t.error.detail.split(/\n/),t.preventDefault(),!t.error.detail.includes("WARNING")||t.error.detail.includes("It is NOT safe to stop")||t.error.detail.includes("ALERT")||t.error.detail.includes("unsafe to stop"))this.notificationService.show(yn.a.error,"\"" + e.hostname + "\" cannot be put into maintenance","" + t.error.detail + "");else{const t={titleText:"Warning",buttonText:"Continue",warning:!0,bodyTpl:this.maintenanceConfirmTpl,showSubmit:!0,onSubmit:()=>{this.hostService.update(e.hostname,!1,[],!0,!0).subscribe(()=>{this.modalRef.close()},()=>this.modalRef.close())}};this.modalRef=this.modalService.show(Dn.a,t)}}):this.hostService.update(e.hostname,!1,[],!0).subscribe(()=>{this.isExecuting=!1,this.notificationService.show(yn.a.success,"\"" + e.hostname + "\" has exited maintenance"),this.table.refreshBtn()})}getDisable(e,t){if("delete"===e||"edit"===e||"maintenance"===e){if(!(null==t?void 0:t.hasSingleSelection))return!0;if(!Nt.a.every(t.selected,"sources.orchestrator"))return this.messages.nonOrchHost}return this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}deleteAction(){const e=this.selection.first().hostname;this.modalRef=this.modalService.show(bn.a,{itemDescription:"Host",itemNames:[e],actionDescription:"delete",submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new tr.a("host/delete",{hostname:e}),call:this.hostService.delete(e)})})}getHosts(e){if(this.isLoadingHosts)return;const t={mds:"cephfs",mon:"monitor",osd:"osd",rgw:"rgw","rbd-mirror":"rbdMirroring",mgr:"manager","tcmu-runner":"iscsi"};this.isLoadingHosts=!0,this.hostService.list().subscribe(e=>{e.map(e=>(e.services.map(e=>{e.cdLink=`/perf_counters/${e.type}/${encodeURIComponent(e.id)}`;const n=this.permissions[t[e.type]];return e.canRead=!!n&&n.read,e}),e)),this.hosts=e,this.isLoadingHosts=!1},()=>{this.isLoadingHosts=!1,e.error()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Xi),i.Mb(fr.a),i.Mb(pr.a),i.Mb(gn.b),i.Mb(vn.a),i.Mb(nr.a),i.Mb(Pt.e),i.Mb(wn.a),i.Mb(dr))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-hosts"]],viewQuery:function(e,t){var n;1&e&&(i.Tc(Bt.a,!0),i.Jc(Gs,!0),i.Jc(qs,!0)),2&e&&(i.zc(n=i.hc())&&(t.table=n.first),i.zc(n=i.hc())&&(t.servicesTpl=n.first),i.zc(n=i.hc())&&(t.maintenanceConfirmTpl=n.first))},features:[i.xb([{provide:pr.a,useValue:new pr.a("hosts")}]),i.vb],decls:12,vars:2,consts:function(){return[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],"Hosts List",["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["servicesTpl",""],["maintenanceConfirmTpl",""],["columnMode","flex","selectionType","single",3,"data","columns","hasDetails","fetchData","setExpandedRow","updateSelection"],[1,"table-actions","btn-toolbar"],["id","host-actions",1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"permissions","selection"],"Overall Performance",["uid","y0KGL0iZz","grafanaStyle","two",3,"grafanaPath"],[4,"ngFor","ngForOf"],["class","service-link",3,"routerLink","queryParams",4,"ngIf"],[4,"ngIf"],[1,"service-link",3,"routerLink","queryParams"],"" + "\ufffd0\ufffd" + "","Are you sure you want to continue?"]},template:function(e,t){if(1&e&&(i.Sb(0,"ul",0,1),i.Sb(2,"li",2),i.Sb(3,"a",3),i.Wb(4,4),i.Rb(),i.Mc(5,Js,4,8,"ng-template",5),i.Rb(),i.Mc(6,Ks,4,0,"li",6),i.Rb(),i.Nb(7,"div",7),i.Mc(8,io,1,1,"ng-template",null,8,i.Nc),i.Mc(10,ao,2,2,"ng-template",null,9,i.Nc)),2&e){const e=i.Ac(1);i.yb(6),i.pc("ngIf",t.permissions.grafana.read),i.yb(1),i.pc("ngbNavOutlet",e)}},directives:[Qt.p,Qt.r,Qt.s,Qt.q,o.r,Qt.u,Bt.a,Sn.a,Us,Fn.a,o.q,Pt.h],styles:[""]}),e})(),lo=(()=>{class e{constructor(e){this.http=e}getLogs(){return this.http.get("api/logs/all")}validateDashboardUrl(e){return this.http.get("api/grafana/validation/"+e)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var uo=n("Iab2");let ho=(()=>{class e{download(e,t){Object(uo.saveAs)(new Blob([e]),t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const fo=function(e){return[e]};function po(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",5),i.gc("click",(function(){return i.Dc(e),i.ic().download("json")})),i.Nb(1,"i",2),i.Sb(2,"span"),i.Oc(3,"JSON"),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("ngClass",i.uc(1,fo,e.icons.json))}}function mo(e,t){if(1&e){const e=i.Tb();i.Sb(0,"button",5),i.gc("click",(function(){return i.Dc(e),i.ic().download()})),i.Nb(1,"i",2),i.Sb(2,"span"),i.Oc(3,"Text"),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("ngClass",i.uc(1,fo,e.icons.text))}}let bo=(()=>{class e{constructor(e){this.textToDownloadService=e,this.title="Download",this.icons=_n.a}download(e){this.fileName=`${this.fileName}_${(new Date).toLocaleDateString()}`,"json"===e?this.textToDownloadService.download(JSON.stringify(this.objectItem,null,2),this.fileName+".json"):this.textToDownloadService.download(this.textItem,this.fileName+".txt")}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(ho))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-download-button"]],inputs:{objectItem:"objectItem",textItem:"textItem",fileName:"fileName",title:"title"},decls:6,vars:6,consts:[["ngbDropdown","","placement","bottom-right"],["type","button","ngbDropdownToggle","",1,"btn","btn-light","dropdown-toggle-split",3,"title"],[3,"ngClass"],["ngbDropdownMenu",""],["ngbDropdownItem","",3,"click",4,"ngIf"],["ngbDropdownItem","",3,"click"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"button",1),i.Nb(2,"i",2),i.Rb(),i.Sb(3,"div",3),i.Mc(4,po,4,3,"button",4),i.Mc(5,mo,4,3,"button",4),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.pc("title",t.title),i.yb(1),i.pc("ngClass",i.uc(4,fo,t.icons.download)),i.yb(2),i.pc("ngIf",t.objectItem),i.yb(1),i.pc("ngIf",t.textItem))},directives:[Qt.i,On.a,Qt.m,o.p,Qt.k,o.r,Qt.j],styles:[""]}),e})();var go=n("cEzo"),_o=n("E2fk");function yo(e,t){1&e&&i.Ob(0)}function vo(e,t){if(1&e&&(i.Sb(0,"div",19),i.Nb(1,"cd-download-button",20),i.Nb(2,"cd-copy-2-clipboard-button",21),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.pc("objectItem",e.clog)("textItem",e.clogText),i.yb(1),i.pc("source",e.clogText)("byId",!1)}}function wo(e,t){if(1&e&&(i.Sb(0,"p"),i.Sb(1,"span",22),i.Oc(2),i.jc(3,"cdDate"),i.Rb(),i.Sb(4,"span"),i.jc(5,"logPriority"),i.Oc(6),i.Rb(),i.Sb(7,"span",23),i.Oc(8),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Pc(i.kc(3,6,e.stamp)),i.yb(2),i.Bb("priority ",i.kc(5,8,e.priority),""),i.yb(2),i.Pc(e.priority),i.yb(2),i.Pc(e.message)}}function So(e,t){1&e&&i.Ob(0)}function Mo(e,t){if(1&e&&(i.Sb(0,"div",14),i.Mc(1,vo,3,4,"div",15),i.Sb(2,"div",16),i.Mc(3,wo,9,10,"p",17),i.Mc(4,So,1,0,"ng-container",18),i.Rb(),i.Rb()),2&e){const e=i.ic(3),t=i.Ac(4);i.yb(1),i.pc("ngIf",e.clog.length),i.yb(2),i.pc("ngForOf",e.clog),i.yb(1),i.pc("ngIf",0!=e.clog.length)("ngIfElse",t)}}function xo(e,t){if(1&e&&i.Mc(0,Mo,5,4,"div",13),2&e){const e=i.ic(2);i.pc("ngIf",e.clog)}}function ko(e,t){if(1&e&&(i.Sb(0,"div",19),i.Nb(1,"cd-download-button",24),i.Nb(2,"cd-copy-2-clipboard-button",21),i.Rb()),2&e){const e=i.ic(4);i.yb(1),i.pc("objectItem",e.audit_log)("textItem",e.auditLogText),i.yb(1),i.pc("source",e.auditLogText)("byId",!1)}}function Do(e,t){if(1&e&&(i.Sb(0,"p"),i.Sb(1,"span",22),i.Oc(2),i.jc(3,"cdDate"),i.Rb(),i.Sb(4,"span"),i.jc(5,"logPriority"),i.Oc(6),i.Rb(),i.Sb(7,"span",23),i.Oc(8),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Pc(i.kc(3,6,e.stamp)),i.yb(2),i.Bb("priority ",i.kc(5,8,e.priority),""),i.yb(2),i.Pc(e.priority),i.yb(2),i.Pc(e.message)}}function To(e,t){1&e&&i.Ob(0)}function Co(e,t){if(1&e&&(i.Sb(0,"div",14),i.Mc(1,ko,3,4,"div",15),i.Sb(2,"div",16),i.Mc(3,Do,9,10,"p",17),i.Mc(4,To,1,0,"ng-container",18),i.Rb(),i.Rb()),2&e){const e=i.ic(3),t=i.Ac(4);i.yb(1),i.pc("ngIf",e.audit_log.length),i.yb(2),i.pc("ngForOf",e.audit_log),i.yb(1),i.pc("ngIf",0!=e.audit_log.length)("ngIfElse",t)}}function Oo(e,t){if(1&e&&i.Mc(0,Co,5,4,"div",13),2&e){const e=i.ic(2);i.pc("ngIf",e.audit_log)}}function Ro(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,yo,1,0,"ng-container",3),i.Sb(2,"ul",4,5),i.Sb(4,"li",6),i.Sb(5,"a",7),i.Wb(6,8),i.Rb(),i.Mc(7,xo,1,1,"ng-template",9),i.Rb(),i.Sb(8,"li",10),i.Sb(9,"a",7),i.Wb(10,11),i.Rb(),i.Mc(11,Oo,1,1,"ng-template",9),i.Rb(),i.Rb(),i.Nb(12,"div",12),i.Rb()),2&e){const e=i.Ac(3);i.ic();const t=i.Ac(2);i.yb(1),i.pc("ngTemplateOutlet",t),i.yb(11),i.pc("ngbNavOutlet",e)}}function Lo(e,t){if(1&e&&(i.Sb(0,"option",46),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.value),i.yb(1),i.Pc(e.name)}}const Eo=function(e){return[e]};function Ao(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",25),i.Sb(1,"div",26),i.Sb(2,"label",27),i.Wb(3,28),i.Rb(),i.Sb(4,"select",29),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().priority=t}))("ngModelChange",(function(){return i.Dc(e),i.ic().filterLogs()})),i.Mc(5,Lo,2,2,"option",30),i.Rb(),i.Rb(),i.Sb(6,"div",26),i.Sb(7,"label",31),i.Wb(8,32),i.Rb(),i.Sb(9,"div",33),i.Sb(10,"div",34),i.Sb(11,"span",35),i.Nb(12,"i",36),i.Rb(),i.Rb(),i.Sb(13,"input",37),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().search=t}))("keyup",(function(){return i.Dc(e),i.ic().filterLogs()})),i.Rb(),i.Sb(14,"div",38),i.Sb(15,"button",39),i.gc("click",(function(){return i.Dc(e),i.ic().clearSearchKey()})),i.Nb(16,"i"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(17,"div",26),i.Sb(18,"label",40),i.Wb(19,41),i.Rb(),i.Sb(20,"div",33),i.Sb(21,"input",42,43),i.gc("click",(function(){return i.Dc(e),i.Ac(22).open()}))("ngModelChange",(function(t){return i.Dc(e),i.ic().selectedDate=t}))("ngModelChange",(function(){return i.Dc(e),i.ic().filterLogs()})),i.Rb(),i.Sb(23,"span",38),i.Sb(24,"button",39),i.gc("click",(function(){return i.Dc(e),i.ic().clearDate()})),i.Nb(25,"i"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(26,"div",26),i.Sb(27,"label"),i.Wb(28,44),i.Rb(),i.Sb(29,"ngb-timepicker",45),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().startTime=t}))("ngModelChange",(function(){return i.Dc(e),i.ic().filterLogs()})),i.Rb(),i.Sb(30,"span"),i.Oc(31,"\xa0\u2014\xa0"),i.Rb(),i.Sb(32,"ngb-timepicker",45),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().endTime=t}))("ngModelChange",(function(){return i.Dc(e),i.ic().filterLogs()})),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(4),i.pc("ngModel",e.priority),i.yb(1),i.pc("ngForOf",e.priorities),i.yb(7),i.pc("ngClass",i.uc(16,Eo,e.icons.search)),i.yb(1),i.pc("ngModel",e.search),i.yb(3),i.Bb("icon-prepend ",e.icons.destroy,""),i.yb(5),i.pc("maxDate",e.maxDate)("ngModel",e.selectedDate),i.yb(4),i.Bb("icon-prepend ",e.icons.destroy,""),i.yb(4),i.pc("spinners",!1)("ngModel",e.startTime),i.yb(3),i.pc("spinners",!1)("ngModel",e.endTime)}}function Io(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span"),i.Wb(1,47),i.Rb(),i.Sb(2,"span"),i.Oc(3,"\xa0"),i.Rb(),i.Sb(4,"a",48),i.gc("click",(function(){return i.Dc(e),i.ic().resetFilter()})),i.Wb(5,49),i.Rb()}}let Po=(()=>{class e{constructor(e,t,n){this.logsService=e,this.datePipe=t,this.ngZone=n,this.icons=_n.a,this.priorities=[{name:"Debug",value:"[DBG]"},{name:"Info",value:"[INF]"},{name:"Warning",value:"[WRN]"},{name:"Error",value:"[ERR]"},{name:"All",value:"All"}],this.priority="All",this.search="",this.startTime={hour:0,minute:0},this.endTime={hour:23,minute:59},this.maxDate={year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}ngOnInit(){this.getInfo(),this.ngZone.runOutsideAngular(()=>{this.interval=window.setInterval(()=>{this.ngZone.run(()=>{this.getInfo()})},5e3)})}ngOnDestroy(){clearInterval(this.interval)}getInfo(){this.logsService.getLogs().subscribe(e=>{this.contentData=e,this.clogText=this.logToText(this.contentData.clog),this.auditLogText=this.logToText(this.contentData.audit_log),this.filterLogs()})}abstractFilters(){var e,t,n,i,r,s,o,a;const c=this.priority,l=this.search.toLowerCase().replace(/,/g,"");let u;if(this.selectedDate){const e=this.selectedDate.month,t=this.selectedDate.day;u=`${this.selectedDate.year}-${e<=9?"0"+e:""+e}-${t<=9?"0"+t:""+t}`}else u="";return{priority:c,key:l,yearMonthDay:u,sTime:60*(null!==(t=null===(e=this.startTime)||void 0===e?void 0:e.hour)&&void 0!==t?t:0)+(null!==(i=null===(n=this.startTime)||void 0===n?void 0:n.minute)&&void 0!==i?i:0),eTime:60*(null!==(s=null===(r=this.endTime)||void 0===r?void 0:r.hour)&&void 0!==s?s:23)+(null!==(a=null===(o=this.endTime)||void 0===o?void 0:o.minute)&&void 0!==a?a:59)}}filterExecutor(e,t){return e.filter(e=>{const n=this.datePipe.transform(e.stamp,"mediumTime"),i=parseInt(n.split(":")[0],10),r=parseInt(n.split(":")[1],10);let s,o,a;return s="All"===t.priority?e.priority:t.priority,o=t.yearMonthDay?t.yearMonthDay:e.stamp,a=60*i+r,e.priority===s&&-1!==e.message.toLowerCase().indexOf(t.key)&&-1!==e.stamp.indexOf(o)&&a>=t.sTime&&a<=t.eTime})}filterLogs(){const e=this.abstractFilters();this.clog=this.filterExecutor(this.contentData.clog,e),this.audit_log=this.filterExecutor(this.contentData.audit_log,e)}clearSearchKey(){this.search="",this.filterLogs()}clearDate(){this.selectedDate=null,this.filterLogs()}resetFilter(){return this.priority="All",this.search="",this.selectedDate=null,this.startTime={hour:0,minute:0},this.endTime={hour:23,minute:59},this.filterLogs(),!1}logToText(e){let t="";for(const n of Object.keys(e))t=t+this.datePipe.transform(e[n].stamp,"medium")+"\t"+e[n].priority+"\t"+e[n].message+"\n";return t}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(lo),i.Mb(o.e),i.Mb(i.A))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-logs"]],decls:5,vars:1,consts:function(){return[[4,"ngIf"],["logFiltersTpl",""],["noEntriesTpl",""],[4,"ngTemplateOutlet"],["ngbNav","","cdStatefulTab","logs",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","cluster-logs"],["ngbNavLink",""],"Cluster Logs",["ngbNavContent",""],["ngbNavItem","audit-logs"],"Audit Logs",[3,"ngbNavOutlet"],["class","card bg-light mb-3",4,"ngIf"],[1,"card","bg-light","mb-3"],["class","btn-group","role","group",4,"ngIf"],[1,"card-body"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["role","group",1,"btn-group"],["fileName","cluster_log",3,"objectItem","textItem"],[3,"source","byId"],[1,"timestamp"],[1,"message"],["fileName","audit_log",3,"objectItem","textItem"],[1,"form-inline"],[1,"form-group"],["for","logs-priority"],"Priority:",["id","logs-priority",1,"form-control","custom-select",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["for","logs-keyword"],"Keyword:",[1,"input-group"],[1,"input-group-prepend"],[1,"input-group-text"],[3,"ngClass"],["id","logs-keyword","type","text",1,"form-control",3,"ngModel","ngModelChange","keyup"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"click"],["for","logs-date"],"Date:",["id","logs-date","placeholder","YYYY-MM-DD","ngbDatepicker","",1,"form-control",3,"maxDate","ngModel","click","ngModelChange"],["d","ngbDatepicker"],"Time range:",[3,"spinners","ngModel","ngModelChange"],[3,"value"],"No log entries found. Please try to select different filter options.",["href","#",3,"click"],"Reset filter."]},template:function(e,t){1&e&&(i.Mc(0,Ro,13,2,"div",0),i.Mc(1,Ao,33,18,"ng-template",null,1,i.Nc),i.Mc(3,Io,6,0,"ng-template",null,2,i.Nc)),2&e&&i.pc("ngIf",t.contentData)},directives:[o.r,o.w,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,o.q,bo,go.a,Xn.a,On.a,xn.z,ei.a,xn.q,xn.t,o.p,xn.d,Qt.n,Qt.B,xn.u,xn.B],pipes:[Vt.a,_o.a],styles:["p[_ngcontent-%COMP%]{font-family:monospace}.card[_ngcontent-%COMP%]   .btn-group[_ngcontent-%COMP%]{margin-top:-45px;position:absolute;right:0}.card[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{display:flex}.card[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.card[_ngcontent-%COMP%]   .timestamp[_ngcontent-%COMP%]{flex-shrink:0;font-weight:700}.card[_ngcontent-%COMP%]   .priority[_ngcontent-%COMP%]{margin-left:.5rem}.card[_ngcontent-%COMP%]   .message[_ngcontent-%COMP%]{margin-left:1rem}.card[_ngcontent-%COMP%]   .err[_ngcontent-%COMP%]{color:#ef5c55}.card[_ngcontent-%COMP%]   .warn[_ngcontent-%COMP%]{color:#ffc200}.card[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{color:#2b99a8}.card[_ngcontent-%COMP%]   .debug[_ngcontent-%COMP%]{color:#495057}  cd-logs ngb-timepicker input.ngb-tp-input{width:3.5rem!important}"]}),e})();var jo=n("cp0P");let No=(()=>{class e{constructor(e){this.http=e,this.url="api/mgr/module"}list(){return this.http.get(""+this.url)}getConfig(e){return this.http.get(`${this.url}/${e}`)}updateConfig(e,t){return this.http.put(`${this.url}/${e}`,{config:t})}enable(e){return this.http.post(`${this.url}/${e}/enable`,null)}disable(e){return this.http.post(`${this.url}/${e}/disable`,null)}getOptions(e){return this.http.get(`${this.url}/${e}/options`)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Fo=n("2EZI"),Yo=n("p4Cf");function zo(e,t){if(1&e&&(i.Sb(0,"cd-helper"),i.Oc(1),i.jc(2,"upperFirst"),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.Qc(" ",i.kc(2,1,e.value.long_desc||e.value.desc)," ")}}function $o(e,t){if(1&e&&(i.Sb(0,"div",15),i.Sb(1,"div",16),i.Nb(2,"input",17),i.Nb(3,"label",18),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(2),i.qc("id",e.value.name),i.qc("formControlName",e.value.name),i.yb(1),i.qc("for",e.value.name)}}function Ho(e,t){if(1&e&&i.Nb(0,"input",22),2&e){const e=i.ic(2).$implicit;i.qc("id",e.value.name),i.qc("formControlName",e.value.name)}}function Wo(e,t){if(1&e&&(i.Sb(0,"option",25),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("ngValue",e),i.yb(1),i.Qc(" ",e," ")}}function Vo(e,t){if(1&e&&(i.Sb(0,"select",23),i.Mc(1,Wo,2,2,"option",24),i.Rb()),2&e){const e=i.ic(2).$implicit;i.qc("id",e.value.name),i.qc("formControlName",e.value.name),i.yb(1),i.pc("ngForOf",e.value.enum_allowed)}}function Bo(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,27),i.Rb())}function Uo(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,28),i.Rb())}function Go(e,t){if(1&e&&(i.Sb(0,"div",15),i.Mc(1,Ho,1,2,"input",19),i.Mc(2,Vo,2,3,"select",20),i.Mc(3,Bo,2,0,"span",21),i.Mc(4,Uo,2,0,"span",21),i.Rb()),2&e){const e=i.ic().$implicit;i.ic();const t=i.Ac(2),n=i.ic();i.yb(1),i.pc("ngIf",0===e.value.enum_allowed.length),i.yb(1),i.pc("ngIf",e.value.enum_allowed.length>0),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"invalidUuid")),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}function qo(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,30),i.Rb())}function Jo(e,t){if(1&e&&(i.Sb(0,"span",26),i.Wb(1,31),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.ac(e.value.max),i.Xb(1)}}function Qo(e,t){if(1&e&&(i.Sb(0,"span",26),i.Wb(1,32),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.ac(e.value.min),i.Xb(1)}}function Ko(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,33),i.Rb())}function Zo(e,t){if(1&e&&(i.Sb(0,"div",15),i.Nb(1,"input",29),i.Mc(2,qo,2,0,"span",21),i.Mc(3,Jo,2,1,"span",21),i.Mc(4,Qo,2,1,"span",21),i.Mc(5,Ko,2,0,"span",21),i.Rb()),2&e){const e=i.ic().$implicit;i.ic();const t=i.Ac(2),n=i.ic();i.yb(1),i.qc("id",e.value.name),i.qc("formControlName",e.value.name),i.qc("min",e.value.min),i.qc("max",e.value.max),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"required")),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"max")),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"min")),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}function Xo(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,35),i.Rb())}function ea(e,t){1&e&&(i.Sb(0,"span",26),i.Wb(1,36),i.Rb())}function ta(e,t){if(1&e&&(i.Sb(0,"div",15),i.Nb(1,"input",34),i.Mc(2,Xo,2,0,"span",21),i.Mc(3,ea,2,0,"span",21),i.Rb()),2&e){const e=i.ic().$implicit;i.ic();const t=i.Ac(2),n=i.ic();i.yb(1),i.qc("id",e.value.name),i.qc("formControlName",e.value.name),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"required")),i.yb(1),i.pc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}const na=function(){return["addr","str","uuid"]},ia=function(){return["uint","int","size","secs"]};function ra(e,t){if(1&e&&(i.Sb(0,"div",11),i.Sb(1,"label",12),i.Oc(2),i.Mc(3,zo,3,3,"cd-helper",13),i.Rb(),i.Mc(4,$o,4,3,"div",14),i.Mc(5,Go,5,4,"div",14),i.Mc(6,Zo,6,8,"div",14),i.Mc(7,ta,4,4,"div",14),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.qc("for",e.value.name),i.yb(1),i.Qc(" ",e.value.name," "),i.yb(1),i.pc("ngIf",e.value.long_desc||e.value.desc),i.yb(1),i.pc("ngIf","bool"===e.value.type),i.yb(1),i.pc("ngIf",i.tc(7,na).includes(e.value.type)),i.yb(1),i.pc("ngIf",i.tc(8,ia).includes(e.value.type)),i.yb(1),i.pc("ngIf","float"===e.value.type)}}function sa(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",1),i.Sb(1,"form",2,3),i.Sb(3,"div",4),i.Sb(4,"div",5),i.Wb(5,6),i.Rb(),i.Sb(6,"div",7),i.Mc(7,ra,8,9,"div",8),i.jc(8,"keyvalue"),i.Rb(),i.Sb(9,"div",9),i.Sb(10,"cd-form-button-panel",10),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic().onSubmit()})),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic();i.yb(1),i.pc("formGroup",e.mgrModuleForm),i.yb(6),i.pc("ngForOf",i.kc(8,4,e.moduleOptions)),i.yb(3),i.pc("form",e.mgrModuleForm)("submitText",e.actionLabels.UPDATE)}}let oa=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s){super(),this.actionLabels=e,this.route=t,this.router=n,this.formBuilder=i,this.mgrModuleService=r,this.notificationService=s,this.moduleName="",this.moduleOptions=[]}ngOnInit(){this.route.params.subscribe(e=>{this.moduleName=decodeURIComponent(e.name);const t=[this.mgrModuleService.getOptions(this.moduleName),this.mgrModuleService.getConfig(this.moduleName)];Object(jo.a)(t).subscribe(e=>{this.moduleOptions=e[0],this.createForm(),this.mgrModuleForm.setValue(e[1]),this.loadingReady()},e=>{this.loadingError()})})}getValidators(e){const t=[];switch(e.type){case"addr":t.push(Cn.a.ip());break;case"uint":case"int":case"size":case"secs":t.push(Cn.a.number()),t.push(xn.A.required),Nt.a.isNumber(e.min)&&t.push(xn.A.min(e.min)),Nt.a.isNumber(e.max)&&t.push(xn.A.max(e.max));break;case"str":Nt.a.isNumber(e.min)&&t.push(xn.A.minLength(e.min)),Nt.a.isNumber(e.max)&&t.push(xn.A.maxLength(e.max));break;case"float":t.push(xn.A.required),t.push(Cn.a.decimalNumber());break;case"uuid":t.push(Cn.a.uuid())}return t}createForm(){const e={};Nt.a.forEach(this.moduleOptions,t=>{e[t.name]=[t.default_value,this.getValidators(t)]}),this.mgrModuleForm=this.formBuilder.group(e)}goToListView(){this.router.navigate(["/mgr-modules"])}onSubmit(){if(this.mgrModuleForm.pristine)return void this.goToListView();const e={};Nt.a.forEach(this.moduleOptions,t=>{const n=this.mgrModuleForm.get(t.name);n.dirty&&n.valid&&(e[t.name]=n.value)}),this.mgrModuleService.updateConfig(this.moduleName,e).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated options for module '" + this.moduleName + "'."),this.goToListView()},()=>{this.mgrModuleForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Pt.a),i.Mb(Pt.e),i.Mb(Fo.a),i.Mb(No),i.Mb(wn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-mgr-module-form"]],features:[i.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","mgrModuleForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],"Edit Manager module",[1,"card-body"],["class","form-group row",4,"ngFor","ngForOf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"form-group","row"],[1,"cd-col-form-label",3,"for"],[4,"ngIf"],["class","cd-col-form-input",4,"ngIf"],[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","formControlName"],[1,"custom-control-label",3,"for"],["class","form-control","type","text",3,"id","formControlName",4,"ngIf"],["class","form-control custom-select",3,"id","formControlName",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["type","text",1,"form-control",3,"id","formControlName"],[1,"form-control","custom-select",3,"id","formControlName"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[1,"invalid-feedback"],"The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8","The entered value needs to be a valid IP address.",["type","number",1,"form-control",3,"id","formControlName","min","max"],"This field is required.","The entered value is too high! It must be lower or equal to " + "\ufffd0\ufffd" + ".","The entered value is too low! It must be greater or equal to " + "\ufffd0\ufffd" + ".","The entered value needs to be a number.",["type","number",1,"form-control",3,"id","formControlName"],"This field is required.","The entered value needs to be a number or decimal."]},template:function(e,t){1&e&&i.Mc(0,sa,11,6,"div",0),2&e&&i.pc("cdFormLoading",t.loading)},directives:[Kn.a,xn.C,xn.r,xn.k,Zn.a,o.q,ti.a,Xn.a,o.r,Yo.a,On.a,xn.b,ei.a,xn.q,xn.i,xn.d,xn.z,xn.u,xn.B,xn.v],pipes:[o.k,sr.a],styles:[""]}),e})();var aa=n("jtHE");const ca=["*"],la=["templateOutlet"];function ua(e,t){if(1&e&&(i.Sb(0,"div",6),i.Oc(1),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Qc(" ",e.message||e.defaultMessage," ")}}function da(e,t){if(1&e&&(i.Sb(0,"div",3),i.Nb(1,"div",4),i.Mc(2,ua,2,1,"div",5),i.Rb()),2&e){const e=i.ic();i.yb(2),i.pc("ngIf",e.message||e.defaultMessage)}}function ha(e,t){}function fa(e,t){1&e&&i.Mc(0,ha,0,0,"ng-template",null,7,i.Nc)}const pa=function(e){return{active:e}};let ma=(()=>{class e{}return e.START="start",e.STOP="stop",e.UPDATE="update",e.RESET="reset",e.RESET_GLOBAL="reset_global",e.UNSUBSCRIBE="unsubscribe",e})();const ba="block-ui-main";let ga=(()=>{let e=class{constructor(){this.blockUISettings={},this.blockUIInstances={},this.blockUISubject=new aa.a(1),this.blockUIObservable=this.blockUISubject.asObservable(),this.blockUIObservable.subscribe(this.blockUIMiddleware.bind(this))}getSettings(){return this.blockUISettings}updateSettings(e={}){this.blockUISettings=Object.assign(Object.assign({},this.blockUISettings),e)}decorate(e="block-ui-main"){const t={name:e,isActive:!1,blockCount:0,start:this.dispatch(this.blockUISubject,ma.START,e),update:this.dispatch(this.blockUISubject,ma.UPDATE,e),stop:this.dispatch(this.blockUISubject,ma.STOP,e),reset:this.dispatch(this.blockUISubject,ma.RESET,e),resetGlobal:this.dispatch(this.blockUISubject,ma.RESET_GLOBAL,e),unsubscribe:this.dispatch(this.blockUISubject,ma.UNSUBSCRIBE,e)};return this.blockUIInstances[e]=this.blockUIInstances[e]||t,t}observe(){return this.blockUIObservable}clearInstance(e){this.dispatch(this.blockUISubject,ma.RESET,e)}blockUIMiddleware({action:e,name:t}){let n=null;switch(e){case ma.START:n=!0;break;case ma.STOP:case ma.RESET:n=!1}null!==n&&(this.blockUIInstances[t].isActive=n)}dispatch(e,t,n="block-ui-main"){return i=>{e.next({name:n,action:t,message:i})}}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),_a=(()=>{let e=class{constructor(e){this.blockUI=e}ngOnInit(){this.name=this.name||ba,this.template=this.template||this.blockUI.blockUISettings.template}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(ga))},e.\u0275cmp=i.Gb({type:e,selectors:[["block-ui"]],inputs:{name:"name",template:"template",message:"message",delayStart:"delayStart",delayStop:"delayStop"},ngContentSelectors:ca,decls:2,vars:5,consts:[[3,"name","message","template","delayStart","delayStop"]],template:function(e,t){1&e&&(i.oc(),i.nc(0),i.Nb(1,"block-ui-content",0)),2&e&&(i.yb(1),i.pc("name",t.name)("message",t.message)("template",t.template)("delayStart",t.delayStart)("delayStop",t.delayStop))},directives:function(){return[ya]},encapsulation:2}),e})(),ya=(()=>{let e=class{constructor(e,t,n){this.blockUI=e,this.resolver=t,this.changeDetectionRef=n,this.name=ba,this.defaultBlockState={startTimeouts:[],stopTimeouts:[],updateTimeouts:[],blockCount:0,startCallCount:0,stopCallCount:0},this.state=Object.assign({},this.defaultBlockState)}ngOnInit(){this.settings=this.blockUI.getSettings(),this.blockUISubscription=this.subscribeToBlockUI(this.blockUI.observe())}ngAfterViewInit(){try{if(!this.templateCmp)return!1;if(this.templateCmp instanceof i.L)this.templateOutlet.createEmbeddedView(this.templateCmp);else{const e=this.resolver.resolveComponentFactory(this.templateCmp);this.templateCompRef=this.templateOutlet.createComponent(e),this.updateBlockTemplate(this.message)}}catch(e){console.error("ng-block-ui:",e)}}ngAfterViewChecked(){this.detectChanges()}subscribeToBlockUI(e){return e.subscribe(e=>this.onDispatchedEvent(e))}onDispatchedEvent(e){switch(e.action){case ma.START:this.onStart(e);break;case ma.STOP:this.onStop(e);break;case ma.UPDATE:this.onUpdate(e);break;case ma.RESET:this.onReset(e);break;case ma.RESET_GLOBAL:this.resetState();break;case ma.UNSUBSCRIBE:this.onStop(e),this.onUnsubscribe(e.name)}}onStart({name:e,message:t}){if(e===this.name){const e=this.delayStart||this.settings.delayStart||0;this.state.startCallCount+=1;const n=setTimeout(()=>{this.state.blockCount+=1,this.showBlock(t),this.updateInstanceBlockCount()},e);this.state.startTimeouts.push(n)}}onStop({name:e}){if(e===this.name){const e=this.state.stopCallCount+1;if(this.state.startCallCount-e>=0){const t=this.delayStop||this.settings.delayStop||0;this.state.stopCallCount=e;const n=setTimeout(()=>{this.state.blockCount-=1,this.updateInstanceBlockCount(),this.detectChanges()},t);this.state.stopTimeouts.push(n)}}}onUpdate({name:e,message:t}){if(e===this.name){const e=this.delayStart||this.settings.delayStart||0;clearTimeout(this.state.updateTimeouts[0]);const n=setTimeout(()=>{this.updateMessage(t)},e);this.state.updateTimeouts.push(n)}}onReset({name:e}){e===this.name&&this.resetState()}updateMessage(e){this.showBlock(e)}showBlock(e){this.message=e||this.defaultMessage||this.settings.message,this.updateBlockTemplate(this.message),this.detectChanges()}updateBlockTemplate(e){this.templateCompRef&&this.templateCompRef instanceof i.k&&(this.templateCompRef.instance.message=e)}resetState(){[...this.state.startTimeouts,...this.state.stopTimeouts,...this.state.updateTimeouts].forEach(clearTimeout),this.state=Object.assign({},this.defaultBlockState),this.updateInstanceBlockCount(),this.detectChanges()}onUnsubscribe(e){this.blockUISubscription&&e===this.name&&this.blockUISubscription.unsubscribe()}updateInstanceBlockCount(){if(this.blockUI.blockUIInstances[this.name]){const{blockCount:e}=this.state;this.blockUI.blockUIInstances[this.name].blockCount=e}}detectChanges(){this.changeDetectionRef.destroyed||this.changeDetectionRef.detectChanges()}ngOnDestroy(){this.resetState(),this.onUnsubscribe(this.name),this.blockUI.clearInstance(this.name)}};return e.\u0275fac=function(t){return new(t||e)(i.Mb(ga),i.Mb(i.j),i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["block-ui-content"]],viewQuery:function(e,t){var n;1&e&&i.Tc(la,!0,i.P),2&e&&i.zc(n=i.hc())&&(t.templateOutlet=n.first)},inputs:{name:"name",delayStart:"delayStart",delayStop:"delayStop",defaultMessage:["message","defaultMessage"],templateCmp:["template","templateCmp"]},decls:3,vars:9,consts:[[3,"ngClass"],["class","block-ui-spinner",4,"ngIf"],[4,"ngIf"],[1,"block-ui-spinner"],[1,"loader"],["class","message",4,"ngIf"],[1,"message"],["templateOutlet",""]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Mc(1,da,3,1,"div",1),i.Mc(2,fa,2,0,void 0,2),i.Rb()),2&e&&(i.Cb("block-ui-wrapper ",t.name," ",t.className,""),i.pc("ngClass",i.uc(7,pa,t.state.blockCount>0)),i.yb(1),i.pc("ngIf",!t.templateCmp),i.yb(1),i.pc("ngIf",t.templateCmp))},directives:[o.p,o.r],styles:["\n.block-ui-wrapper {\n  display: none;\n  position: fixed;\n  height: 100%;\n  width: 100%;\n  top: 0;\n  left: 0;\n  background: rgba(0, 0, 0, 0.70);\n  z-index: 30000;\n  cursor: wait;\n}\n\n.block-ui-wrapper.block-ui-wrapper--element {\n  position: absolute;\n}\n\n.block-ui-wrapper.active {\n  display: block;\n}\n\n.block-ui-wrapper.block-ui-main {\n  position: fixed;\n}\n\n.block-ui-spinner,\n.block-ui-template {\n  position: absolute;\n  top: 40%;\n  margin: 0 auto;\n  left: 0;\n  right: 0;\n  transform: translateY(-50%);\n}\n\n.block-ui-spinner > .message {\n  font-size: 1.3em;\n  text-align: center;\n  color: #fff;\n}\n\n.block-ui__element {\n  position: relative;\n}\n\n.loader,\n.loader:after {\n  border-radius: 50%;\n  width: 10em;\n  height: 10em;\n}\n.loader {\n  margin: 7px auto;\n  font-size: 5px;\n  position: relative;\n  text-indent: -9999em;\n  border-top: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-right: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-left: 1.1em solid #ffffff;\n  -webkit-transform: translateZ(0);\n  -ms-transform: translateZ(0);\n  transform: translateZ(0);\n  -webkit-animation: load8 1.1s infinite linear;\n  animation: load8 1.1s infinite linear;\n}\n\n@-webkit-keyframes load8 {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n\n@keyframes load8 {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n"],encapsulation:2}),e})(),va=(()=>{let e=class{constructor(e){this.blockUIInstance=e,this.globalDispatch=this.blockUIInstance.decorate()}start(e,t){this.dispatch(e,ma.START,t)}stop(e){this.dispatch(e,ma.STOP)}reset(e){this.dispatch(e,ma.RESET)}resetGlobal(){this.globalDispatch.resetGlobal()}update(e,t){this.dispatch(e,ma.UPDATE,t)}unsubscribe(e){this.dispatch(e,ma.UNSUBSCRIBE)}isActive(e=null){const t=e?this.toArray(e):null,n=this.blockUIInstance.blockUIInstances;return Object.keys(n).some(e=>t?t.indexOf(n[e].name)>=0&&n[e].isActive:n[e].isActive)}dispatch(e=[],t,n){this.toArray(e).forEach(e=>this.blockUIInstance.decorate(e)[t](n))}toArray(e=[]){return"string"==typeof e?[e]:e}};return e.\u0275fac=function(t){return new(t||e)(i.dc(ga))},e.\u0275prov=i.Ib({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();var wa;const Sa=new ga,Ma=new i.r("BlockUIModuleSettings");function xa(e){return Sa.updateSettings(e),Sa}let ka=(()=>{let e=wa=class{static forRoot(e={}){return{ngModule:wa,providers:[{provide:Ma,useValue:e},{provide:ga,useFactory:xa,deps:[Ma]},va]}}};return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[o.c]]}),e})(),Da=1;function Ta(e,t={}){return t.scopeToInstance?function(t,n){const i=`_${n}-block-ui`;Object.defineProperty(t,n,{get:function(){if(this[i])return this[i];const t=`${e}-${Da++}`;return this[i]=Sa.decorate(t),this[i]},set:function(e){this[i]=e}})}:function(t,n){t[n]=Sa.decorate(e)}}function Ca(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"cd-table-key-value",1),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("data",e.module_config)}}let Oa=(()=>{class e{constructor(e){this.mgrModuleService=e}ngOnChanges(){this.selection&&this.mgrModuleService.getConfig(this.selection.name).subscribe(e=>{this.module_config=e})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(No))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-mgr-module-details"]],inputs:{selection:"selection"},features:[i.wb],decls:1,vars:1,consts:[[4,"ngIf"],[3,"data"]],template:function(e,t){1&e&&i.Mc(0,Ca,2,1,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,en.a],styles:[""]}),e})(),Ra=(()=>{class e extends $t.a{constructor(e,t,n){super(),this.authStorageService=e,this.mgrModuleService=t,this.notificationService=n,this.columns=[],this.modules=[],this.selection=new Wt.a,this.permission=this.authStorageService.getPermissions().configOpt,this.columns=[{name:"Name",prop:"name",flexGrow:1},{name:"Enabled",prop:"enabled",flexGrow:1,cellClass:"text-center",cellTransformation:Ht.a.checkIcon},{name:"Always-On",prop:"always_on",flexGrow:1,cellClass:"text-center",cellTransformation:Ht.a.checkIcon}];const i=()=>this.selection.first()&&encodeURIComponent(this.selection.first().name);this.tableActions=[{name:"Edit",permission:"update",disable:()=>!this.selection.hasSelection||0===Object.values(this.selection.first().options).length,routerLink:()=>"/mgr-modules/edit/"+i(),icon:_n.a.edit},{name:"Enable",permission:"update",click:()=>this.updateModuleState(),disable:()=>this.isTableActionDisabled("enabled"),icon:_n.a.start},{name:"Disable",permission:"update",click:()=>this.updateModuleState(),disable:()=>this.getTableActionDisabledDesc(),icon:_n.a.stop}]}getModuleList(e){this.mgrModuleService.list().subscribe(e=>{this.modules=e},()=>{e.error()})}updateSelection(e){this.selection=e}isTableActionDisabled(e){if(!this.selection.hasSelection)return!0;const t=this.selection.first();if("dashboard"===t.name)return!0;if(t.always_on)return!0;switch(e){case"enabled":return t.enabled;case"disabled":return!t.enabled}}getTableActionDisabledDesc(){var e;return(null===(e=this.selection.first())||void 0===e?void 0:e.always_on)?"This Manager module is always on.":this.isTableActionDisabled("disabled")}updateModuleState(){if(!this.selection.hasSelection)return;let e;const t=()=>{Object(Ut.a)(2e3).subscribe(()=>{this.mgrModuleService.list().subscribe(()=>{this.notificationService.suspendToasties(!1),this.blockUI.stop(),this.table.refreshBtn()},()=>{t()})})},n=this.selection.first();e=n.enabled?this.mgrModuleService.disable(n.name):this.mgrModuleService.enable(n.name),e.subscribe(()=>{},()=>{this.notificationService.suspendToasties(!0),this.blockUI.start("Reconnecting, please wait ..."),t()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(No),i.Mb(wn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-mgr-module-list"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Bt.a,!0),2&e&&i.zc(n=i.hc())&&(t.table=n.first)},features:[i.vb],decls:4,vars:8,consts:[["columnMode","flex","selectionType","single","identifier","module",3,"autoReload","data","columns","hasDetails","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"]],template:function(e,t){1&e&&(i.Sb(0,"cd-table",0,1),i.gc("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)}))("fetchData",(function(e){return t.getModuleList(e)})),i.Nb(2,"cd-table-actions",2),i.Nb(3,"cd-mgr-module-details",3),i.Rb()),2&e&&(i.pc("autoReload",!1)("data",t.modules)("columns",t.columns)("hasDetails",!0),i.yb(2),i.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),i.yb(1),i.pc("selection",t.expandedRow))},directives:[Bt.a,Sn.a,Oa],styles:[""]}),Object(Ft.b)([Ta(),Object(Ft.d)("design:type",Object)],e.prototype,"blockUI",void 0),e})(),La=(()=>{class e{constructor(e){this.http=e}getMonitor(){return this.http.get("api/monitor")}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Ea(e,t){if(1&e&&(i.Sb(0,"table",11),i.Sb(1,"tr"),i.Sb(2,"td",12),i.Wb(3,13),i.Rb(),i.Sb(4,"td"),i.Oc(5),i.Rb(),i.Rb(),i.Sb(6,"tr"),i.Sb(7,"td",12),i.Wb(8,14),i.Rb(),i.Sb(9,"td"),i.Oc(10),i.jc(11,"relativeDate"),i.Rb(),i.Rb(),i.Sb(12,"tr"),i.Sb(13,"td",12),i.Wb(14,15),i.Rb(),i.Sb(15,"td"),i.Oc(16),i.Rb(),i.Rb(),i.Sb(17,"tr"),i.Sb(18,"td",12),i.Wb(19,16),i.Rb(),i.Sb(20,"td"),i.Oc(21),i.Rb(),i.Rb(),i.Sb(22,"tr"),i.Sb(23,"td",12),i.Wb(24,17),i.Rb(),i.Sb(25,"td"),i.Oc(26),i.Rb(),i.Rb(),i.Sb(27,"tr"),i.Sb(28,"td",12),i.Wb(29,18),i.Rb(),i.Sb(30,"td"),i.Oc(31),i.Rb(),i.Rb(),i.Sb(32,"tr"),i.Sb(33,"td",12),i.Wb(34,19),i.Rb(),i.Sb(35,"td"),i.Oc(36),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(5),i.Pc(e.mon_status.monmap.fsid),i.yb(5),i.Pc(i.kc(11,7,e.mon_status.monmap.modified)),i.yb(6),i.Pc(e.mon_status.monmap.epoch),i.yb(5),i.Pc(e.mon_status.features.quorum_con),i.yb(5),i.Pc(e.mon_status.features.quorum_mon),i.yb(5),i.Pc(e.mon_status.features.required_con),i.yb(5),i.Pc(e.mon_status.features.required_mon)}}let Aa=(()=>{class e{constructor(e){this.monitorService=e,this.inQuorum={columns:[{prop:"name",name:"Name",cellTransformation:Ht.a.routerLink},{prop:"rank",name:"Rank"},{prop:"public_addr",name:"Public Address"},{prop:"cdOpenSessions",name:"Open Sessions",cellTransformation:Ht.a.sparkline,comparator:(e,t)=>{const n=Nt.a.last(e),i=Nt.a.last(t);return n&&i&&n!==i?n>i?1:-1:0}}]},this.notInQuorum={columns:[{prop:"name",name:"Name",cellTransformation:Ht.a.routerLink},{prop:"rank",name:"Rank"},{prop:"public_addr",name:"Public Address"}]}}refresh(){this.monitorService.getMonitor().subscribe(e=>{e.in_quorum.map(e=>(e.cdOpenSessions=e.stats.num_sessions.map(e=>e[1]),e.cdLink="/perf_counters/mon/"+e.name,e.cdParams={fromLink:"/monitor"},e)),e.out_quorum.map(e=>(e.cdLink="/perf_counters/mon/"+e.name,e.cdParams={fromLink:"/monitor"},e)),this.inQuorum.data=[...e.in_quorum],this.notInQuorum.data=[...e.out_quorum],this.mon_status=e.mon_status})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(La))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-monitor"]],decls:13,vars:5,consts:function(){return[[1,"row"],[1,"col-lg-4"],[1,"cd-header"],"Status",["class","table table-striped",4,"ngIf"],[1,"col-lg-8"],[1,"in-quorum","cd-header"],"In Quorum",[3,"data","columns"],"Not In Quorum",[3,"data","columns","fetchData"],[1,"table","table-striped"],[1,"bold"],"Cluster ID","monmap modified","monmap epoch","quorum con","quorum mon","required con","required mon"]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"fieldset"),i.Sb(3,"legend",2),i.Wb(4,3),i.Rb(),i.Mc(5,Ea,37,9,"table",4),i.Rb(),i.Rb(),i.Sb(6,"div",5),i.Sb(7,"legend",6),i.Wb(8,7),i.Rb(),i.Nb(9,"cd-table",8),i.Sb(10,"legend",6),i.Wb(11,9),i.Rb(),i.Sb(12,"cd-table",10),i.gc("fetchData",(function(){return t.refresh()})),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(5),i.pc("ngIf",t.mon_status),i.yb(4),i.pc("data",t.inQuorum.data)("columns",t.inQuorum.columns),i.yb(3),i.pc("data",t.notInQuorum.data)("columns",t.notInQuorum.columns))},directives:[o.r,Bt.a],pipes:[$r.a],styles:[""]}),e})();var Ia=n("ajRT");let Pa=(()=>{class e{constructor(e,t,n,r,s){this.activeModal=e,this.actionLabels=t,this.formBuilder=n,this.osdService=r,this.taskWrapper=s,this.driveGroups=[],this.submitAction=new i.o,this.action=t.CREATE,this.createForm()}createForm(){this.formGroup=this.formBuilder.group({})}onSubmit(){this.taskWrapper.wrapTaskAroundCall({task:new tr.a("osd/"+gn.e.CREATE,{tracking_id:Nt.a.join(Nt.a.map(this.driveGroups,"service_id"),", ")}),call:this.osdService.create(this.driveGroups)}).subscribe({error:()=>{this.formGroup.setErrors({cdSubmitButton:!0})},complete:()=>{this.submitAction.emit(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(gn.b),i.Mb(Fo.a),i.Mb(mr),i.Mb(nr.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-creation-preview-modal"]],inputs:{driveGroups:"driveGroups"},outputs:{submitAction:"submitAction"},decls:15,vars:9,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"OSD creation preview",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],"DriveGroups",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Sb(7,"h4"),i.Wb(8,7),i.Rb(),i.Sb(9,"pre"),i.Oc(10),i.jc(11,"json"),i.Rb(),i.Rb(),i.Sb(12,"div",8),i.Sb(13,"cd-form-button-panel",9),i.gc("submitActionEvent",(function(){return t.onSubmit()})),i.jc(14,"titlecase"),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(4),i.pc("formGroup",t.formGroup),i.yb(6),i.Pc(i.kc(11,5,t.driveGroups)),i.yb(3),i.pc("form",t.formGroup)("submitText",i.kc(14,7,t.action)))},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,ti.a],pipes:[o.j,o.A],styles:[""]}),e})();const ja=["inventoryDevices"];function Na(e,t){if(1&e&&(i.Sb(0,"span",16),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.Qc(" ",e," ")}}function Fa(e,t){if(1&e&&(i.Sb(0,"cd-alert-panel",13),i.Qb(1),i.Wb(2,14),i.Pb(),i.Mc(3,Na,2,1,"span",15),i.Rb()),2&e){const e=i.ic();i.pc("showTitle",!1),i.yb(3),i.pc("ngForOf",e.requiredFilters)}}function Ya(e,t){if(1&e&&(i.Sb(0,"div"),i.Sb(1,"p",17),i.Sb(2,"span"),i.Wb(3,18),i.jc(4,"dimlessBinary"),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(4),i.ac(e.filteredDevices.length)(i.kc(4,2,e.capacity)),i.Xb(3)}}const za=function(){return["available","osd_ids"]};let $a=(()=>{class e{constructor(e,t,n){this.formBuilder=e,this.activeModal=t,this.actionLabels=n,this.submitAction=new i.o,this.icons=_n.a,this.filterColumns=[],this.devices=[],this.filteredDevices=[],this.capacity=0,this.canSubmit=!1,this.requiredFilters=[],this.action=n.ADD,this.createForm()}ngAfterViewInit(){const e=Nt.a.filter(this.inventoryDevices.columns,e=>this.filterColumns.includes(e.prop)&&"hostname"!==e.prop);setTimeout(()=>{this.requiredFilters=Nt.a.map(e,"name")},0)}createForm(){this.formGroup=this.formBuilder.group({})}onFilterChange(e){if(this.capacity=0,this.canSubmit=!1,Nt.a.isEmpty(e.filters))this.filteredDevices=[],this.event=void 0;else{const t=e.filters.filter(e=>"hostname"!==e.prop);this.canSubmit=!Nt.a.isEmpty(t),this.filteredDevices=e.data,this.capacity=Nt.a.sumBy(this.filteredDevices,"sys_api.size"),this.event=e}}onSubmit(){this.submitAction.emit(this.event),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Fo.a),i.Mb(Qt.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-devices-selection-modal"]],viewQuery:function(e,t){var n;1&e&&i.Tc(ja,!0),2&e&&i.zc(n=i.hc())&&(t.inventoryDevices=n.first)},outputs:{submitAction:"submitAction"},decls:14,vars:14,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " devices",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],["type","warning","size","slim",3,"showTitle",4,"ngIf"],[3,"devices","filterColumns","hiddenColumns","filterChange"],["inventoryDevices",""],[4,"ngIf"],[1,"modal-footer"],[3,"form","disabled","submitText","submitActionEvent"],["type","warning","size","slim",3,"showTitle"],"At least one of these filters must be applied in order to proceed:",["class","badge badge-dark ml-2",4,"ngFor","ngForOf"],[1,"badge","badge-dark","ml-2"],[1,"text-center"],"Number of devices: " + "\ufffd0\ufffd" + ". Raw capacity: " + "\ufffd1\ufffd" + "."]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Mc(7,Fa,4,2,"cd-alert-panel",7),i.Sb(8,"cd-inventory-devices",8,9),i.gc("filterChange",(function(e){return t.onFilterChange(e)})),i.Rb(),i.Mc(10,Ya,5,4,"div",10),i.Rb(),i.Sb(11,"div",11),i.Sb(12,"cd-form-button-panel",12),i.gc("submitActionEvent",(function(){return t.onSubmit()})),i.jc(13,"titlecase"),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(2),i.ac(t.deviceType),i.Xb(2),i.yb(2),i.pc("formGroup",t.formGroup),i.yb(3),i.pc("ngIf",!t.canSubmit),i.yb(1),i.pc("devices",t.devices)("filterColumns",t.filterColumns)("hiddenColumns",i.tc(13,za)),i.yb(2),i.pc("ngIf",t.canSubmit),i.yb(2),i.pc("form",t.formGroup)("disabled",!t.canSubmit||0===t.filteredDevices.length)("submitText",i.kc(13,11,t.action)))},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,o.r,Ir,ti.a,br.a,o.q],pipes:[o.A,Zt.a],styles:[""]}),e})();function Ha(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,7),i.Rb())}function Wa(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,8),i.Rb())}function Va(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,9),i.Rb())}const Ba=function(e){return[e]};function Ua(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",10),i.gc("click",(function(){return i.Dc(e),i.ic().showSelectionModal()})),i.Nb(2,"i",11),i.Qb(3),i.Wb(4,12),i.Pb(),i.Rb(),i.Pb()}if(2&e){const e=i.ic();i.yb(1),i.pc("title",e.addButtonTooltip)("disabled",0===e.availDevices.length||!e.canSelect),i.yb(1),i.pc("ngClass",i.uc(3,Ba,e.icons.add))}}function Ga(e,t){if(1&e&&(i.Sb(0,"span"),i.Sb(1,"span",19),i.Oc(2),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(2),i.Rc("",e.name,": ",e.value.formatted,"")}}function qa(e,t){if(1&e&&(i.Sb(0,"div",20),i.Sb(1,"span"),i.Wb(2,21),i.jc(3,"dimlessBinary"),i.Rb(),i.Rb()),2&e){const e=i.ic(2);i.yb(3),i.ac(i.kc(3,1,e.capacity)),i.Xb(2)}}const Ja=function(){return["available","osd_ids"]},Qa=function(){return[]};function Ka(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",13),i.Mc(1,Ga,3,2,"span",14),i.Sb(2,"a",15),i.gc("click",(function(){return i.Dc(e),i.ic().clearDevices(),!1})),i.Nb(3,"i",11),i.Qb(4),i.Wb(5,16),i.Pb(),i.Rb(),i.Rb(),i.Sb(6,"div"),i.Nb(7,"cd-inventory-devices",17),i.Rb(),i.Mc(8,qa,4,3,"div",18)}if(2&e){const e=i.ic();i.yb(1),i.pc("ngForOf",e.appliedFilters),i.yb(2),i.pc("ngClass",i.uc(6,Ba,e.icons.clearFilters)),i.yb(4),i.pc("devices",e.devices)("hiddenColumns",i.tc(8,Ja))("filterColumns",i.tc(9,Qa)),i.yb(1),i.pc("ngIf","data"===e.type)}}let Za=(()=>{class e{constructor(e){this.modalService=e,this.selected=new i.o,this.cleared=new i.o,this.icons=_n.a,this.devices=[],this.capacity=0,this.appliedFilters=[],this.tooltips={noAvailDevices:"No available devices",addPrimaryFirst:"Please add primary devices first",addByFilters:"Add devices by using filters"}}ngOnInit(){this.updateAddButtonTooltip()}ngOnChanges(){this.updateAddButtonTooltip()}showSelectionModal(){let e=["human_readable_type","sys_api.vendor","sys_api.model","sys_api.size"];"data"===this.type&&(e=["hostname",...e]),this.modalService.show($a,{hostname:this.hostname,deviceType:this.name,devices:this.availDevices,filterColumns:e},{size:"xl"}).componentInstance.submitAction.subscribe(e=>{this.devices=e.data,this.capacity=Nt.a.sumBy(this.devices,"sys_api.size"),this.appliedFilters=e.filters;const t=Nt.a.assign({type:this.type},e);this.selected.emit(t)})}updateAddButtonTooltip(){this.addButtonTooltip="data"===this.type&&0===this.availDevices.length?this.tooltips.noAvailDevices:this.canSelect?0===this.availDevices.length?this.tooltips.noAvailDevices:this.tooltips.addByFilters:this.tooltips.addPrimaryFirst}clearDevices(){const e={type:this.type,clearedDevices:[...this.devices]};this.devices=[],this.cleared.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(vn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-devices-selection-groups"]],inputs:{type:"type",name:"name",hostname:"hostname",availDevices:"availDevices",canSelect:"canSelect"},outputs:{selected:"selected",cleared:"cleared"},features:[i.wb],decls:12,vars:6,consts:function(){return[[1,"form-group","row"],["for","createDeleteButton",1,"cd-col-form-label"],"" + "\ufffd0\ufffd" + " devices",[4,"ngIf"],[1,"cd-col-form-input"],[4,"ngIf","ngIfElse"],["blockClearDevices",""],"The primary storage devices. These devices contain all OSD data.","Write-Ahead-Log devices. These devices are used for BlueStore\u2019s internal journal. It is only useful to use a WAL device if the device is faster than the primary device (e.g. NVME devices or SSDs). If there is only a small amount of fast storage available (e.g., less than a gigabyte), we recommend using it as a WAL device.","DB devices can be used for storing BlueStore\u2019s internal metadata. It is only helpful to provision a DB device if it is faster than the primary device (e.g. NVME devices or SSD).",["type","button","data-toggle","tooltip",1,"btn","btn-light",3,"title","disabled","click"],[3,"ngClass"],"Add",[1,"pb-2","my-2","border-bottom"],[4,"ngFor","ngForOf"],["href","",1,"tc_clearSelections",3,"click"],"Clear",[3,"devices","hiddenColumns","filterColumns"],["class","float-right",4,"ngIf"],[1,"badge","badge-dark","mr-2"],[1,"float-right"],"Raw capacity: " + "\ufffd0\ufffd" + ""]},template:function(e,t){if(1&e&&(i.Sb(0,"div",0),i.Sb(1,"label",1),i.Qb(2),i.Wb(3,2),i.Pb(),i.Sb(4,"cd-helper"),i.Mc(5,Ha,2,0,"span",3),i.Mc(6,Wa,2,0,"span",3),i.Mc(7,Va,2,0,"span",3),i.Rb(),i.Rb(),i.Sb(8,"div",4),i.Mc(9,Ua,5,5,"ng-container",5),i.Mc(10,Ka,9,10,"ng-template",null,6,i.Nc),i.Rb(),i.Rb()),2&e){const e=i.Ac(11);i.yb(3),i.ac(t.name),i.Xb(3),i.yb(2),i.pc("ngIf","data"===t.type),i.yb(1),i.pc("ngIf","wal"===t.type),i.yb(1),i.pc("ngIf","db"===t.type),i.yb(2),i.pc("ngIf",0===t.devices.length)("ngIfElse",e)}},directives:[Xn.a,Yo.a,o.r,On.a,o.p,o.q,Ir],pipes:[Zt.a],styles:[".tc_clearSelections[_ngcontent-%COMP%]{text-decoration:none}"]}),e})();var Xa=n("aXbf");class ec{constructor(){this.reset(),this.formatterService=new Xa.a,this.deviceSelectionAttrs={"sys_api.vendor":{name:"vendor"},"sys_api.model":{name:"model"},device_id:{name:"device_id"},human_readable_type:{name:"rotational",formatter:e=>"hdd"===e.toLowerCase()},"sys_api.size":{name:"size",formatter:e=>this.formatterService.format_number(e,1024,["B","KB","MB","GB","TB","PB"]).replace(" ","")}}}reset(){this.spec={service_type:"osd",service_id:"dashboard-"+Nt.a.now()}}setName(e){this.spec.service_id=e}setHostPattern(e){this.spec.host_pattern=e}setDeviceSelection(e,t){const n=e+"_devices";this.spec[n]={},t.forEach(e=>{const t=this.deviceSelectionAttrs[e.prop];t&&(this.spec[n][t.name]=t.formatter?t.formatter(e.value.raw):e.value.raw)})}clearDeviceSelection(e){delete this.spec[e+"_devices"]}setSlots(e,t){const n=e+"_slots";0===t?delete this.spec[n]:this.spec[n]=t}setFeature(e,t){t?this.spec[e]=!0:delete this.spec[e]}}const tc=["dataDeviceSelectionGroups"],nc=["walDeviceSelectionGroups"],ic=["dbDeviceSelectionGroups"],rc=["previewButtonPanel"];function sc(e,t){1&e&&i.Nb(0,"cd-orchestrator-doc-panel")}function oc(e,t){1&e&&(i.Sb(0,"span",33),i.Wb(1,34),i.Rb())}function ac(e,t){if(1&e&&(i.Sb(0,"div",26),i.Sb(1,"label",27),i.Qb(2),i.Wb(3,28),i.Pb(),i.Sb(4,"cd-helper"),i.Sb(5,"span"),i.Wb(6,29),i.Rb(),i.Nb(7,"br"),i.Sb(8,"span"),i.Wb(9,30),i.Rb(),i.Rb(),i.Rb(),i.Sb(10,"div",21),i.Nb(11,"input",31),i.Mc(12,oc,2,0,"span",32),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(12),i.pc("ngIf",t.form.showError("walSlots",e,"min"))}}function cc(e,t){1&e&&(i.Sb(0,"span",33),i.Wb(1,40),i.Rb())}function lc(e,t){if(1&e&&(i.Sb(0,"div",26),i.Sb(1,"label",35),i.Qb(2),i.Wb(3,36),i.Pb(),i.Sb(4,"cd-helper"),i.Sb(5,"span"),i.Wb(6,37),i.Rb(),i.Nb(7,"br"),i.Sb(8,"span"),i.Wb(9,38),i.Rb(),i.Rb(),i.Rb(),i.Sb(10,"div",21),i.Nb(11,"input",39),i.Mc(12,cc,2,0,"span",32),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(12),i.pc("ngIf",t.form.showError("dbSlots",e,"min"))}}function uc(e,t){if(1&e&&(i.Sb(0,"div",41),i.Nb(1,"input",42),i.Sb(2,"label",43),i.Oc(3),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.qc("id",e.key),i.qc("name",e.key),i.qc("formControlName",e.key),i.yb(1),i.qc("for",e.key),i.yb(1),i.Pc(e.desc)}}function dc(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",2),i.Sb(1,"form",3,4),i.Sb(3,"div",5),i.Sb(4,"div",6),i.Wb(5,7),i.jc(6,"titlecase"),i.jc(7,"upperFirst"),i.Rb(),i.Sb(8,"div",8),i.Sb(9,"fieldset"),i.Sb(10,"cd-osd-devices-selection-groups",9,10),i.gc("selected",(function(t){return i.Dc(e),i.ic().onDevicesSelected(t)}))("cleared",(function(t){return i.Dc(e),i.ic().onDevicesCleared(t)})),i.Rb(),i.Rb(),i.Sb(12,"fieldset"),i.Sb(13,"legend"),i.Wb(14,11),i.Rb(),i.Sb(15,"cd-osd-devices-selection-groups",12,13),i.gc("selected",(function(t){return i.Dc(e),i.ic().onDevicesSelected(t)}))("cleared",(function(t){return i.Dc(e),i.ic().onDevicesCleared(t)})),i.Rb(),i.Mc(17,ac,13,1,"div",14),i.Sb(18,"cd-osd-devices-selection-groups",15,16),i.gc("selected",(function(t){return i.Dc(e),i.ic().onDevicesSelected(t)}))("cleared",(function(t){return i.Dc(e),i.ic().onDevicesCleared(t)})),i.Rb(),i.Mc(20,lc,13,1,"div",14),i.Rb(),i.Sb(21,"fieldset"),i.Sb(22,"legend"),i.Wb(23,17),i.Rb(),i.Sb(24,"div",18),i.Sb(25,"label",19),i.Wb(26,20),i.Rb(),i.Sb(27,"div",21),i.Mc(28,uc,4,5,"div",22),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(29,"div",23),i.Sb(30,"cd-form-button-panel",24,25),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic().submit()})),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(11),t=i.Ac(16),n=i.Ac(19),r=i.ic();i.yb(1),i.pc("formGroup",r.form),i.yb(6),i.ac(i.kc(6,15,r.action))(i.kc(7,17,r.resource)),i.Xb(5),i.yb(3),i.pc("availDevices",r.availDevices)("canSelect",0!==r.availDevices.length),i.yb(5),i.pc("availDevices",r.availDevices)("canSelect",0!==e.devices.length),i.yb(2),i.pc("ngIf",0!==t.devices.length),i.yb(1),i.pc("availDevices",r.availDevices)("canSelect",0!==e.devices.length),i.yb(2),i.pc("ngIf",0!==n.devices.length),i.yb(8),i.pc("ngForOf",r.featureList),i.yb(2),i.pc("form",r.form)("disabled",0===e.devices.length)("submitText",r.actionLabels.PREVIEW)}}let hc=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s){super(),this.actionLabels=e,this.authStorageService=t,this.orchService=n,this.hostService=i,this.router=r,this.modalService=s,this.icons=_n.a,this.columns=[],this.allDevices=[],this.availDevices=[],this.dataDeviceFilters=[],this.dbDeviceFilters=[],this.walDeviceFilters=[],this.hostname="",this.driveGroup=new ec,this.featureList=[],this.hasOrchestrator=!0,this.resource="OSDs",this.action=this.actionLabels.CREATE,this.features={encrypted:{key:"encrypted",desc:"Encryption"}},this.featureList=Nt.a.map(this.features,(e,t)=>Object.assign(e,{key:t})),this.createForm()}ngOnInit(){this.orchService.status().subscribe(e=>{this.hasOrchestrator=e.available,e.available?this.getDataDevices():this.loadingNone()}),this.form.get("walSlots").valueChanges.subscribe(e=>this.setSlots("wal",e)),this.form.get("dbSlots").valueChanges.subscribe(e=>this.setSlots("db",e)),Nt.a.each(this.features,e=>{this.form.get("features").get(e.key).valueChanges.subscribe(t=>this.featureFormUpdate(e.key,t))})}createForm(){this.form=new Jn.a({walSlots:new xn.h(0,{validators:[xn.A.min(0)]}),dbSlots:new xn.h(0,{validators:[xn.A.min(0)]}),features:new Jn.a(this.featureList.reduce((e,t)=>(e[t.key]=new xn.h({value:!1,disabled:!0}),e),{}))})}getDataDevices(){this.hostService.inventoryDeviceList().subscribe(e=>{this.allDevices=Nt.a.filter(e,"available"),this.availDevices=[...this.allDevices],this.loadingReady()},()=>{this.allDevices=[],this.availDevices=[],this.loadingError()})}setSlots(e,t){"number"==typeof t&&t>=0&&this.driveGroup.setSlots(e,t)}featureFormUpdate(e,t){this.driveGroup.setFeature(e,t)}enableFeatures(){this.featureList.forEach(e=>{this.form.get(e.key).enable({emitEvent:!1})})}disableFeatures(){this.featureList.forEach(e=>{const t=this.form.get(e.key);t.disable({emitEvent:!1}),t.setValue(!1,{emitEvent:!1})})}onDevicesSelected(e){if(this.availDevices=e.dataOut,"data"===e.type){const t=Nt.a.find(e.filters,{prop:"hostname"});t?(this.hostname=t.value.raw,this.availDevices=e.dataOut.filter(e=>e.hostname===this.hostname),this.driveGroup.setHostPattern(this.hostname)):this.driveGroup.setHostPattern("*"),this.enableFeatures()}this.driveGroup.setDeviceSelection(e.type,e.filters)}onDevicesCleared(e){"data"===e.type?(this.availDevices=[...this.allDevices],this.walDeviceSelectionGroups.devices=[],this.dbDeviceSelectionGroups.devices=[],this.disableFeatures(),this.driveGroup.reset(),this.form.get("walSlots").setValue(0,{emitEvent:!1}),this.form.get("dbSlots").setValue(0,{emitEvent:!1})):(this.availDevices=[...this.availDevices,...e.clearedDevices],this.driveGroup.clearDeviceSelection(e.type),this.form.get(e.type+"Slots").setValue(0,{emitEvent:!1}))}submit(){const e=this.authStorageService.getUsername();this.driveGroup.setName(`dashboard-${e}-${Nt.a.now()}`),this.modalService.show(Pa,{driveGroups:[this.driveGroup.spec]}).componentInstance.submitAction.subscribe(()=>{this.router.navigate(["/osd"])}),this.previewButtonPanel.submitButton.loading=!1}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Jt.a),i.Mb(dr),i.Mb(Xi),i.Mb(Pt.e),i.Mb(vn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-form"]],viewQuery:function(e,t){var n;1&e&&(i.Tc(tc,!0),i.Tc(nc,!0),i.Tc(ic,!0),i.Tc(rc,!0)),2&e&&(i.zc(n=i.hc())&&(t.dataDeviceSelectionGroups=n.first),i.zc(n=i.hc())&&(t.walDeviceSelectionGroups=n.first),i.zc(n=i.hc())&&(t.dbDeviceSelectionGroups=n.first),i.zc(n=i.hc())&&(t.previewButtonPanel=n.first))},features:[i.vb],decls:2,vars:2,consts:function(){return[[4,"ngIf"],["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],["name","Primary","type","data",3,"availDevices","canSelect","selected","cleared"],["dataDeviceSelectionGroups",""],"Shared devices",["name","WAL","type","wal",3,"availDevices","canSelect","selected","cleared"],["walDeviceSelectionGroups",""],["class","form-group row",4,"ngIf"],["name","DB","type","db",3,"availDevices","canSelect","selected","cleared"],["dbDeviceSelectionGroups",""],"Configuration",["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],"Features",[1,"cd-col-form-input"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","disabled","submitText","submitActionEvent"],["previewButtonPanel",""],[1,"form-group","row"],["for","walSlots",1,"cd-col-form-label"],"WAL slots","How many OSDs per WAL device.","Specify 0 to let Orchestrator backend decide it.",["id","walSlots","name","walSlots","type","number","min","0","formControlName","walSlots",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"invalid-feedback"],"Value should be greater than or equal to 0",["for","dbSlots",1,"cd-col-form-label"],"DB slots","How many OSDs per DB device.","Specify 0 to let Orchestrator backend decide it.",["id","dbSlots","name","dbSlots","type","number","min","0","formControlName","dbSlots",1,"form-control"],"Value should be greater than or equal to 0",[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"]]},template:function(e,t){1&e&&(i.Mc(0,sc,1,0,"cd-orchestrator-doc-panel",0),i.Mc(1,dc,32,19,"div",1)),2&e&&(i.pc("ngIf",!t.hasOrchestrator),i.yb(1),i.pc("cdFormLoading",t.loading))},directives:[o.r,Kn.a,Ar,xn.C,xn.r,Zn.a,xn.k,Za,Xn.a,xn.l,o.q,ti.a,Yo.a,On.a,xn.v,xn.d,ei.a,xn.q,xn.i,xn.b],pipes:[o.A,sr.a],styles:[""]}),e})();function fc(e,t){if(1&e&&(i.Sb(0,"span",18),i.Wb(1,19),i.Rb()),2&e){const e=i.ic(2);i.pc("ngbTooltip",e.clusterWideTooltip)}}function pc(e,t){1&e&&i.Nb(0,"hr",20)}function mc(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",12),i.Sb(1,"input",13),i.gc("change",(function(){i.Dc(e);const n=t.$implicit;return i.ic().changeValue(n)})),i.Rb(),i.Sb(2,"label",14),i.Sb(3,"strong"),i.Oc(4),i.Rb(),i.Mc(5,fc,2,1,"span",15),i.Nb(6,"br"),i.Sb(7,"span",16),i.Oc(8),i.Rb(),i.Rb(),i.Mc(9,pc,1,0,"hr",17),i.Rb()}if(2&e){const e=t.$implicit,n=t.last;i.yb(1),i.pc("checked",e.value)("indeterminate",e.indeterminate)("name",e.code)("id",e.code),i.yb(1),i.pc("for",e.code),i.yb(2),i.Pc(e.name),i.yb(1),i.pc("ngIf",e.clusterWide),i.yb(3),i.Pc(e.description),i.yb(1),i.pc("ngIf",!n)}}let bc=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.osdService=i,this.notificationService=r,this.initialSelection=[],this.osdFlagsForm=new xn.j({}),this.flags=[{code:"noup",name:"No Up",description:"OSDs are not allowed to start",value:!1,clusterWide:!1,indeterminate:!1},{code:"nodown",name:"No Down",description:"OSD failure reports are being ignored, such that the monitors will not mark OSDs down",value:!1,clusterWide:!1,indeterminate:!1},{code:"noin",name:"No In",description:"OSDs that were previously marked out will not be marked back in when they start",value:!1,clusterWide:!1,indeterminate:!1},{code:"noout",name:"No Out",description:"OSDs will not automatically be marked out after the configured interval",value:!1,clusterWide:!1,indeterminate:!1}],this.clusterWideTooltip="The flag has been enabled for the entire cluster.",this.permissions=this.authStorageService.getPermissions()}ngOnInit(){const e=this.selected.length;this.osdService.getFlags().subscribe(t=>{const n=this.getActivatedIndivFlags();this.flags.forEach(i=>{const r=n[i.code];t.includes(i.code)&&(i.clusterWide=!0),r===e?i.value=!0:r>0&&(i.indeterminate=!0)}),this.initialSelection=Nt.a.cloneDeep(this.flags)})}getActivatedIndivFlags(){const e={};return this.flags.forEach(t=>{e[t.code]=0}),[].concat(...this.selected.map(e=>e.state)).map(t=>{Object.keys(e).includes(t)&&(e[t]=e[t]+1)}),e}changeValue(e){e.value=!e.value,e.indeterminate=!1}resetSelection(){this.flags=Nt.a.cloneDeep(this.initialSelection)}submitAction(){const e={};this.flags.forEach(t=>{e[t.code]=t.indeterminate?null:t.value});const t=this.selected.map(e=>e.osd);this.osdService.updateIndividualFlags(e,t).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated OSD Flags"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(gn.b),i.Mb(Jt.a),i.Mb(mr),i.Mb(wn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-flags-indiv-modal"]],decls:12,vars:6,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Individual OSD Flags",[1,"modal-content"],["name","osdFlagsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],"Restore previous selection",[3,"form","showSubmit","submitText","submitActionEvent"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"checked","indeterminate","name","id","change"],["ng-class","['tc_' + key]",1,"custom-control-label",3,"for"],["class","badge badge-hdd ml-2",3,"ngbTooltip",4,"ngIf"],[1,"form-text","text-muted"],["class","m-1",4,"ngIf"],[1,"badge","badge-hdd","ml-2",3,"ngbTooltip"],"Cluster-wide",[1,"m-1"]]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Mc(7,mc,10,9,"div",7),i.Rb(),i.Sb(8,"div",8),i.Sb(9,"button",9),i.gc("click",(function(){return t.resetSelection()})),i.Wb(10,10),i.Rb(),i.Sb(11,"cd-form-button-panel",11),i.gc("submitActionEvent",(function(){return t.submitAction()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(4),i.pc("formGroup",t.osdFlagsForm),i.yb(3),i.pc("ngForOf",t.flags),i.yb(4),i.pc("form",t.osdFlagsForm)("showSubmit",t.permissions.osd.update)("submitText",t.actionLabels.UPDATE))},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,o.q,On.a,ti.a,ei.a,o.r,Qt.D],styles:[""]}),e})();var gc=n("f/UV");function _c(e,t){1&e&&i.Nb(0,"hr",15)}function yc(e,t){if(1&e&&(i.Sb(0,"div",10),i.Sb(1,"input",11),i.gc("change",(function(){const e=t.$implicit;return e.value=!e.value})),i.Rb(),i.Sb(2,"label",12),i.Sb(3,"strong"),i.Oc(4),i.Rb(),i.Nb(5,"br"),i.Sb(6,"span",13),i.Oc(7),i.Rb(),i.Rb(),i.Mc(8,_c,1,0,"hr",14),i.Rb()),2&e){const e=t.$implicit,n=t.last;i.yb(1),i.pc("checked",e.value)("name",e.code)("id",e.code)("disabled",e.disabled),i.yb(1),i.pc("for",e.code),i.yb(2),i.Pc(e.name),i.yb(3),i.Pc(e.description),i.yb(1),i.pc("ngIf",!n)}}let vc=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.osdService=i,this.notificationService=r,this.osdFlagsForm=new xn.j({}),this.allFlags={noin:{code:"noin",name:"No In",value:!1,description:"OSDs that were previously marked out will not be marked back in when they start"},noout:{code:"noout",name:"No Out",value:!1,description:"OSDs will not automatically be marked out after the configured interval"},noup:{code:"noup",name:"No Up",value:!1,description:"OSDs are not allowed to start"},nodown:{code:"nodown",name:"No Down",value:!1,description:"OSD failure reports are being ignored, such that the monitors will not mark OSDs down"},pause:{code:"pause",name:"Pause",value:!1,description:"Pauses reads and writes"},noscrub:{code:"noscrub",name:"No Scrub",value:!1,description:"Scrubbing is disabled"},"nodeep-scrub":{code:"nodeep-scrub",name:"No Deep Scrub",value:!1,description:"Deep Scrubbing is disabled"},nobackfill:{code:"nobackfill",name:"No Backfill",value:!1,description:"Backfilling of PGs is suspended"},norebalance:{code:"norebalance",name:"No Rebalance",value:!1,description:"OSD will choose not to backfill unless PG is also degraded"},norecover:{code:"norecover",name:"No Recover",value:!1,description:"Recovery of PGs is suspended"},sortbitwise:{code:"sortbitwise",name:"Bitwise Sort",value:!1,description:"Use bitwise sort",disabled:!0},purged_snapdirs:{code:"purged_snapdirs",name:"Purged Snapdirs",value:!1,description:"OSDs have converted snapsets",disabled:!0},recovery_deletes:{code:"recovery_deletes",name:"Recovery Deletes",value:!1,description:"Deletes performed during recovery instead of peering",disabled:!0},pglog_hardlimit:{code:"pglog_hardlimit",name:"PG Log Hard Limit",value:!1,description:"Puts a hard limit on pg log length",disabled:!0}},this.unknownFlags=[],this.permissions=this.authStorageService.getPermissions()}ngOnInit(){this.osdService.getFlags().subscribe(e=>{e.forEach(e=>{this.allFlags[e]?this.allFlags[e].value=!0:this.unknownFlags.push(e)}),this.flags=Nt.a.toArray(this.allFlags)})}submitAction(){const e=this.flags.filter(e=>e.value).map(e=>e.code).concat(this.unknownFlags);this.osdService.updateFlags(e).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated OSD Flags"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(gn.b),i.Mb(Jt.a),i.Mb(mr),i.Mb(wn.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-flags-modal"]],decls:10,vars:6,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Cluster-wide OSD Flags",[1,"modal-content"],["name","osdFlagsForm","novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"checked","name","id","disabled","change"],["ng-class","['tc_' + key]",1,"custom-control-label",3,"for"],[1,"form-text","text-muted"],["class","m-1",4,"ngIf"],[1,"m-1"]]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Mc(7,yc,9,8,"div",7),i.Rb(),i.Sb(8,"div",8),i.Sb(9,"cd-form-button-panel",9),i.gc("submitActionEvent",(function(){return t.submitAction()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(4),i.pc("formGroup",t.osdFlagsForm),i.yb(3),i.pc("ngForOf",t.flags),i.yb(2),i.pc("form",t.osdFlagsForm)("showSubmit",t.permissions.osd.update)("submitText",t.actionLabels.UPDATE))},directives:[Ia.a,xn.C,xn.r,gc.a,Zn.a,xn.k,o.q,ti.a,On.a,ei.a,o.r],styles:[""]}),e})();function wc(e,t){if(1&e&&(i.Sb(0,"cd-helper"),i.Oc(1),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.Qc(" ",e.long_desc,"")}}function Sc(e,t){if(1&e&&(i.Sb(0,"div",4),i.Sb(1,"label",5),i.Sb(2,"b"),i.Oc(3),i.Rb(),i.Nb(4,"br"),i.Sb(5,"span",6),i.Oc(6),i.Mc(7,wc,2,1,"cd-helper",7),i.Rb(),i.Rb(),i.Sb(8,"div",8),i.Sb(9,"div",9),i.Nb(10,"input",10),i.Nb(11,"label",11),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.pc("for",e.name),i.yb(2),i.Pc(e.text),i.yb(3),i.Qc(" ",e.desc," "),i.yb(1),i.pc("ngIf",e.long_desc),i.yb(3),i.pc("id",e.name)("formControlName",e.name),i.yb(1),i.pc("for",e.name)}}function Mc(e,t){if(1&e&&(i.Sb(0,"cd-helper"),i.Oc(1),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.Qc(" ",e.long_desc,"")}}const xc=function(e){return[e]};function kc(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",16),i.Sb(1,"button",17),i.Yb(2,18),i.gc("click",(function(){i.Dc(e);const t=i.ic(2).$implicit;return i.ic().resetValue(t.name)})),i.Nb(3,"i",19),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(3),i.pc("ngClass",i.uc(1,xc,e.icons.erase))}}function Dc(e,t){if(1&e&&(i.Sb(0,"span",20),i.Oc(1),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.Qc(" ",e.additionalTypeInfo.patternHelpText,"")}}function Tc(e,t){if(1&e&&(i.Sb(0,"span",20),i.Oc(1),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.Qc(" ",e.additionalTypeInfo.patternHelpText,"")}}function Cc(e,t){if(1&e&&(i.Sb(0,"span",20),i.Wb(1,21),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.ac(e.maxValue),i.Xb(1)}}function Oc(e,t){if(1&e&&(i.Sb(0,"span",20),i.Wb(1,22),i.Rb()),2&e){const e=i.ic(2).$implicit;i.yb(1),i.ac(e.minValue),i.Xb(1)}}function Rc(e,t){if(1&e&&(i.Sb(0,"div",4),i.Sb(1,"label",5),i.Oc(2),i.Nb(3,"br"),i.Sb(4,"span",6),i.Oc(5),i.Mc(6,Mc,2,1,"cd-helper",7),i.Rb(),i.Rb(),i.Sb(7,"div",8),i.Sb(8,"div",12),i.Nb(9,"input",13),i.Mc(10,kc,4,3,"div",14),i.Rb(),i.Mc(11,Dc,2,1,"span",15),i.Mc(12,Tc,2,1,"span",15),i.Mc(13,Cc,2,1,"span",15),i.Mc(14,Oc,2,1,"span",15),i.Rb(),i.Rb()),2&e){const e=i.ic().$implicit,t=i.ic();i.yb(1),i.pc("for",e.name),i.yb(1),i.Qc("",e.text," "),i.yb(3),i.Qc(" ",e.desc," "),i.yb(1),i.pc("ngIf",e.long_desc),i.yb(3),i.pc("type",e.additionalTypeInfo.inputType)("id",e.name)("placeholder",e.additionalTypeInfo.humanReadable)("formControlName",e.name)("step",t.getStep(e.type,t.optionsForm.getValue(e.name))),i.yb(1),i.pc("ngIf",t.optionsFormShowReset),i.yb(1),i.pc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"pattern")),i.yb(1),i.pc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"invalidUuid")),i.yb(1),i.pc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"max")),i.yb(1),i.pc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"min"))}}function Lc(e,t){1&e&&i.Nb(0,"hr",23)}function Ec(e,t){if(1&e&&(i.Sb(0,"div"),i.Mc(1,Sc,12,7,"div",2),i.Mc(2,Rc,15,14,"div",2),i.Mc(3,Lc,1,0,"hr",3),i.Rb()),2&e){const e=t.$implicit,n=t.last;i.yb(1),i.pc("ngIf","bool"===e.type),i.yb(1),i.pc("ngIf","bool"!==e.type),i.yb(1),i.pc("ngIf",!n)}}let Ac=(()=>{class e{constructor(e){this.configService=e,this.optionNames=[],this.optionsForm=new Jn.a({}),this.optionsFormDir=new xn.s([],[]),this.optionsFormGroupName="",this.optionsFormShowReset=!0,this.icons=_n.a,this.options=[],this.optionsFormGroup=new Jn.a({})}static optionNameToText(e){const t=["mon","mgr","osd","mds","client"];return e.split("_").filter((e,n)=>0!==n||!t.includes(e)).map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" ")}ngOnInit(){this.createForm(),this.loadStoredData()}createForm(){this.optionsForm.addControl(this.optionsFormGroupName,this.optionsFormGroup),this.optionNames.forEach(e=>{this.optionsFormGroup.addControl(e,new xn.h(null))})}getStep(e,t){return Gn.getTypeStep(e,t)}loadStoredData(){this.configService.filter(this.optionNames).subscribe(t=>{this.options=t.map(t=>{const n=this.optionsForm.get(t.name),i=Gn.getTypeValidators(t);return t.additionalTypeInfo=Gn.getType(t.type),t.text=e.optionNameToText(t.name),t.value=Nt.a.find(t.value,e=>"osd"===e.section),t.value&&n.setValue("bool"===t.additionalTypeInfo.name?"true"===t.value.value:t.value.value),i&&(t.patternHelpText=i.patternHelpText,"max"in i&&""!==i.max&&(t.maxValue=i.max),"min"in i&&""!==i.min&&(t.minValue=i.min),n.setValidators(i.validators)),t})})}saveValues(){const e={};return this.optionNames.forEach(t=>{const n=this.optionsForm.getValue(t);null!==n&&""!==n&&(e[t]={section:"osd",value:n})}),this.configService.bulkCreate({options:e})}resetValue(e){this.configService.delete(e,"osd").subscribe(()=>{this.optionsForm.get(e).reset()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Un.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-config-option"]],inputs:{optionNames:"optionNames",optionsForm:"optionsForm",optionsFormDir:"optionsFormDir",optionsFormGroupName:"optionsFormGroupName",optionsFormShowReset:"optionsFormShowReset"},decls:2,vars:2,consts:function(){return[[3,"formGroup"],[4,"ngFor","ngForOf"],["class","form-group row pt-2",4,"ngIf"],["class","my-2",4,"ngIf"],[1,"form-group","row","pt-2"],[1,"cd-col-form-label",3,"for"],[1,"text-muted"],[4,"ngIf"],[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","formControlName"],[1,"custom-control-label",3,"for"],[1,"input-group"],[1,"form-control",3,"type","id","placeholder","formControlName","step"],["class","input-group-append",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"input-group-append"],["type","button","data-toggle","button",1,"btn","btn-light",3,"click",6,"title"],["title","Remove the custom configuration value. The default configuration will be inherited and used instead."],["aria-hidden","true",3,"ngClass"],[1,"invalid-feedback"],"The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".","The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + ".",[1,"my-2"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Mc(1,Ec,4,3,"div",1),i.Rb()),2&e&&(i.pc("formGroup",t.optionsFormGroup),i.yb(1),i.pc("ngForOf",t.options))},directives:[xn.r,xn.k,Zn.a,o.q,o.r,Xn.a,On.a,xn.b,ei.a,xn.q,xn.i,Yo.a,xn.d,o.p],styles:[".custom-checkbox[_ngcontent-%COMP%]   input[_ngcontent-%COMP%], .custom-checkbox[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:pointer}.col-form-label[_ngcontent-%COMP%]{text-align:left}"]}),e})(),Ic=(()=>{class e{}return e.basicOptions=["osd_scrub_during_recovery","osd_scrub_begin_hour","osd_scrub_end_hour","osd_scrub_begin_week_day","osd_scrub_end_week_day","osd_scrub_min_interval","osd_scrub_max_interval","osd_deep_scrub_interval","osd_scrub_auto_repair","osd_max_scrubs","osd_scrub_priority","osd_scrub_sleep"],e.advancedOptions=["osd_scrub_auto_repair_num_errors","osd_debug_deep_scrub_sleep","osd_deep_scrub_keys","osd_deep_scrub_large_omap_object_key_threshold","osd_deep_scrub_large_omap_object_value_sum_threshold","osd_deep_scrub_randomize_ratio","osd_deep_scrub_stride","osd_deep_scrub_update_digest_min_age","osd_requested_scrub_priority","osd_scrub_backoff_ratio","osd_scrub_chunk_max","osd_scrub_chunk_min","osd_scrub_cost","osd_scrub_interval_randomize_ratio","osd_scrub_invalid_stats","osd_scrub_load_threshold","osd_scrub_max_preemptions"],e})();const Pc=["basicOptionsValues"],jc=["advancedOptionsValues"];function Nc(e,t){if(1&e){const e=i.Tb();i.Sb(0,"a",15),i.gc("click",(function(){return i.Dc(e),i.ic().advancedEnabled=!0})),i.Wb(1,16),i.Rb()}}function Fc(e,t){if(1&e&&(i.Sb(0,"div"),i.Sb(1,"h3",17),i.Wb(2,18),i.Rb(),i.Nb(3,"cd-config-option",7,19),i.Rb()),2&e){const e=i.ic(),t=i.Ac(7);i.yb(3),i.pc("optionNames",e.advancedOptions)("optionsForm",e.osdPgScrubForm)("optionsFormDir",t)("optionsFormGroupName","advancedFormGroup")}}let Yc=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.authStorageService=t,this.notificationService=n,this.actionLabels=i,this.basicOptions=Ic.basicOptions,this.advancedOptions=Ic.advancedOptions,this.advancedEnabled=!1,this.osdPgScrubForm=new Jn.a({}),this.resource="PG scrub options",this.action=this.actionLabels.EDIT,this.permissions=this.authStorageService.getPermissions()}submitAction(){const e=[this.basicOptionsValues.saveValues()];this.advancedOptionsValues&&e.push(this.advancedOptionsValues.saveValues()),Object(jo.a)(e).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated PG scrub options"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(Jt.a),i.Mb(wn.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-pg-scrub-modal"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(Pc,!0),i.Tc(jc,!0)),2&e&&(i.zc(n=i.hc())&&(t.basicOptionsValues=n.first),i.zc(n=i.hc())&&(t.advancedOptionsValues=n.first))},decls:19,vars:21,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],[3,"optionNames","optionsForm","optionsFormDir","optionsFormGroupName"],["basicOptionsValues",""],[1,"row"],[1,"col-sm-12"],["class","pull-right margin-right-md",3,"click",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"pull-right","margin-right-md",3,"click"],"Advanced...",[1,"page-header"],"Advanced configuration options",["advancedOptionsValues",""]]},template:function(e,t){if(1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.jc(3,"titlecase"),i.jc(4,"upperFirst"),i.Pb(),i.Qb(5,3),i.Sb(6,"form",4,5),i.Sb(8,"div",6),i.Nb(9,"cd-config-option",7,8),i.Sb(11,"div",9),i.Sb(12,"div",10),i.Mc(13,Nc,2,0,"a",11),i.Rb(),i.Rb(),i.Mc(14,Fc,5,4,"div",12),i.Rb(),i.Sb(15,"div",13),i.Sb(16,"cd-form-button-panel",14),i.gc("submitActionEvent",(function(){return t.submitAction()})),i.jc(17,"titlecase"),i.jc(18,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e){const e=i.Ac(7);i.pc("modalRef",t.activeModal),i.yb(4),i.ac(i.kc(3,13,t.action))(i.kc(4,15,t.resource)),i.Xb(2),i.yb(2),i.pc("formGroup",t.osdPgScrubForm),i.yb(3),i.pc("optionNames",t.basicOptions)("optionsForm",t.osdPgScrubForm)("optionsFormDir",e)("optionsFormGroupName","basicFormGroup"),i.yb(4),i.pc("ngIf",!t.advancedEnabled),i.yb(1),i.pc("ngIf",t.advancedEnabled),i.yb(2),i.pc("form",t.osdPgScrubForm)("showSubmit",t.permissions.configOpt.update)("submitText",i.kc(17,17,t.action)+" "+i.kc(18,19,t.resource))}},directives:[Ia.a,xn.C,xn.r,gc.a,Zn.a,xn.k,Ac,o.r,ti.a],pipes:[o.A,sr.a],styles:[""]}),e})();function zc(e,t){if(1&e&&(i.Sb(0,"option",22),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.name),i.yb(1),i.Qc(" ",e.text," ")}}function $c(e,t){1&e&&(i.Sb(0,"span",23),i.Wb(1,24),i.Rb())}function Hc(e,t){if(1&e&&(i.Sb(0,"cd-helper"),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.Pc(e.value.desc)}}function Wc(e,t){1&e&&(i.Sb(0,"span",23),i.Wb(1,29),i.Rb())}function Vc(e,t){if(1&e&&(i.Sb(0,"span",23),i.Wb(1,30),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.ac(e.value.patternHelpText),i.Xb(1)}}function Bc(e,t){if(1&e&&(i.Sb(0,"span",23),i.Wb(1,31),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.ac(e.value.maxValue),i.Xb(1)}}function Uc(e,t){if(1&e&&(i.Sb(0,"span",23),i.Wb(1,32),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.ac(e.value.minValue),i.Xb(1)}}const Gc=function(e){return{required:e}};function qc(e,t){if(1&e&&(i.Sb(0,"div",7),i.Sb(1,"label",25),i.Sb(2,"span",26),i.Oc(3),i.Rb(),i.Mc(4,Hc,2,1,"cd-helper",27),i.Rb(),i.Sb(5,"div",10),i.Nb(6,"input",28),i.Mc(7,Wc,2,0,"span",13),i.Mc(8,Vc,2,1,"span",13),i.Mc(9,Bc,2,1,"span",13),i.Mc(10,Uc,2,1,"span",13),i.Rb(),i.Rb()),2&e){const e=t.$implicit,n=i.ic(),r=i.Ac(5);i.yb(1),i.pc("for",e.key),i.yb(1),i.pc("ngClass",i.uc(11,Gc,n.osdRecvSpeedForm.getValue("customizePriority"))),i.yb(1),i.Qc(" ",e.value.text," "),i.yb(1),i.pc("ngIf",e.value.desc),i.yb(2),i.pc("id",e.key)("formControlName",e.key)("readonly",!n.osdRecvSpeedForm.getValue("customizePriority")),i.yb(1),i.pc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,r,"required")),i.yb(1),i.pc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,r,"pattern")),i.yb(1),i.pc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,r,"max")),i.yb(1),i.pc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,r,"min"))}}let Jc=(()=>{class e{constructor(e,t,n,i,r,s){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.configService=i,this.notificationService=r,this.osdService=s,this.priorities=[],this.priorityAttrs={},this.permissions=this.authStorageService.getPermissions(),this.priorities=this.osdService.osdRecvSpeedModalPriorities.KNOWN_PRIORITIES,this.osdRecvSpeedForm=new Jn.a({priority:new xn.h(null,{validators:[xn.A.required]}),customizePriority:new xn.h(!1)}),this.priorityAttrs={osd_max_backfills:{text:"Max Backfills",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_max_active:{text:"Recovery Max Active",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_max_single_start:{text:"Recovery Max Single Start",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_sleep:{text:"Recovery Sleep",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0}},Object.keys(this.priorityAttrs).forEach(e=>{this.osdRecvSpeedForm.addControl(e,new xn.h(null,{validators:[xn.A.required]}))})}ngOnInit(){this.configService.filter(Object.keys(this.priorityAttrs)).subscribe(e=>{const t=this.getCurrentValues(e);this.detectPriority(t.values,e=>{this.setPriority(e)}),this.setDescription(t.configOptions),this.setValidators(t.configOptions)})}detectPriority(e,t){const n=Nt.a.find(this.priorities,t=>Nt.a.isEqual(t.values,e));return this.osdRecvSpeedForm.controls.customizePriority.setValue(!1),n?t(n):4===Object.entries(e).length?(this.osdRecvSpeedForm.controls.customizePriority.setValue(!0),t(Object({name:"custom",text:"Custom",values:e}))):t(this.priorities[0])}getCurrentValues(e){const t={values:{},configOptions:[]};return e.forEach(e=>{t.configOptions.push(e),"value"in e?e.value.forEach(n=>{"osd"===n.section&&(t.values[e.name]=Number(n.value))}):"default"in e&&null!==e.default&&(t.values[e.name]=Number(e.default))}),t}setDescription(e){e.forEach(e=>{""!==e.desc&&(this.priorityAttrs[e.name].desc=e.desc)})}setPriority(e){const t=Nt.a.find(this.priorities,e=>"custom"===e.name);"custom"===e.name?t||this.priorities.push(e):t&&this.priorities.splice(this.priorities.indexOf(t),1),this.osdRecvSpeedForm.controls.priority.setValue(e.name),Object.entries(e.values).forEach(([e,t])=>{this.osdRecvSpeedForm.controls[e].setValue(t)})}setValidators(e){e.forEach(e=>{const t=Gn.getTypeValidators(e);t?(t.validators.push(xn.A.required),"max"in t&&""!==t.max&&(this.priorityAttrs[e.name].maxValue=t.max),"min"in t&&""!==t.min&&(this.priorityAttrs[e.name].minValue=t.min),this.priorityAttrs[e.name].patternHelpText=t.patternHelpText,this.osdRecvSpeedForm.controls[e.name].setValidators(t.validators)):this.osdRecvSpeedForm.controls[e.name].setValidators(xn.A.required)})}onCustomizePriorityChange(){const e={};if(Object.keys(this.priorityAttrs).forEach(t=>{e[t]=this.osdRecvSpeedForm.getValue(t)}),this.osdRecvSpeedForm.getValue("customizePriority")){const t={name:"custom",text:"Custom",values:e};this.setPriority(t)}else this.detectPriority(e,e=>{this.setPriority(e)})}onPriorityChange(e){const t=Nt.a.find(this.priorities,t=>t.name===e)||this.priorities[0];this.osdRecvSpeedForm.get("customizePriority").setValue(!1),this.setPriority(t)}submitAction(){const e={};Object.keys(this.priorityAttrs).forEach(t=>{e[t]={section:"osd",value:this.osdRecvSpeedForm.getValue(t)}}),this.configService.bulkCreate({options:e}).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated OSD recovery speed priority '" + this.osdRecvSpeedForm.getValue("priority") + "'"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(gn.b),i.Mb(Jt.a),i.Mb(Un.a),i.Mb(wn.a),i.Mb(mr))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-recv-speed-modal"]],decls:24,vars:10,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"OSD Recovery Priority",[1,"modal-content"],["novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","priority",1,"cd-col-form-label","required"],"Priority",[1,"cd-col-form-input"],["formControlName","priority","id","priority",1,"form-control","custom-select",3,"change"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["formControlName","customizePriority","id","customizePriority","name","customizePriority","type","checkbox",1,"custom-control-input",3,"change"],["for","customizePriority",1,"custom-control-label"],"Customize priority values",["class","form-group row",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],"This field is required.",[1,"cd-col-form-label",3,"for"],[3,"ngClass"],[4,"ngIf"],["type","number",1,"form-control",3,"id","formControlName","readonly"],"This field is required!","" + "\ufffd0\ufffd" + "","The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".","The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + "."]},template:function(e,t){if(1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Sb(7,"div",7),i.Sb(8,"label",8),i.Wb(9,9),i.Rb(),i.Sb(10,"div",10),i.Sb(11,"select",11),i.gc("change",(function(e){return t.onPriorityChange(e.target.value)})),i.Mc(12,zc,2,2,"option",12),i.Rb(),i.Mc(13,$c,2,0,"span",13),i.Rb(),i.Rb(),i.Sb(14,"div",7),i.Sb(15,"div",14),i.Sb(16,"div",15),i.Sb(17,"input",16),i.gc("change",(function(){return t.onCustomizePriorityChange()})),i.Rb(),i.Sb(18,"label",17),i.Wb(19,18),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Mc(20,qc,11,13,"div",19),i.jc(21,"keyvalue"),i.Rb(),i.Sb(22,"div",20),i.Sb(23,"cd-form-button-panel",21),i.gc("submitActionEvent",(function(){return t.submitAction()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e){const e=i.Ac(5);i.pc("modalRef",t.activeModal),i.yb(4),i.pc("formGroup",t.osdRecvSpeedForm),i.yb(8),i.pc("ngForOf",t.priorities),i.yb(1),i.pc("ngIf",t.osdRecvSpeedForm.showError("priority",e,"required")),i.yb(7),i.pc("ngForOf",i.kc(21,8,t.priorityAttrs)),i.yb(3),i.pc("form",t.osdRecvSpeedForm)("submitText",t.actionLabels.UPDATE)("showSubmit",t.permissions.configOpt.update)}},directives:[Ia.a,xn.C,xn.r,gc.a,Zn.a,xn.k,Xn.a,On.a,xn.z,ei.a,xn.q,xn.i,o.q,o.r,xn.b,ti.a,xn.u,xn.B,o.p,xn.v,xn.d,Yo.a],pipes:[o.k],styles:[""]}),e})();function Qc(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,15),i.Rb())}function Kc(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,16),i.Rb())}function Zc(e,t){if(1&e&&(i.Sb(0,"span",13),i.Mc(1,Qc,2,0,"span",14),i.Mc(2,Kc,2,0,"span",14),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",null==e.weight.errors?null:e.weight.errors.required),i.yb(1),i.pc("ngIf",(null==e.weight.errors?null:e.weight.errors.max)||(null==e.weight.errors?null:e.weight.errors.min))}}let Xc=(()=>{class e{constructor(e,t,n,i){this.actionLabels=e,this.activeModal=t,this.osdService=n,this.fb=i,this.currentWeight=1}get weight(){return this.reweightForm.get("weight")}ngOnInit(){this.reweightForm=this.fb.group({weight:this.fb.control(this.currentWeight,[xn.A.required,xn.A.max(1),xn.A.min(0)])})}reweight(){this.osdService.reweight(this.osdId,this.reweightForm.value.weight).subscribe(()=>this.activeModal.close())}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Qt.a),i.Mb(mr),i.Mb(Fo.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-reweight-modal"]],decls:14,vars:7,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"Reweight OSD: " + "\ufffd0\ufffd" + "",[1,"modal-content"],[3,"formGroup"],[1,"modal-body"],[1,"row"],["for","weight",1,"cd-col-form-label"],[1,"cd-col-form-input"],["id","weight","type","number","step","0.1","formControlName","weight","min","0","max","1",1,"form-control",3,"value"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],[4,"ngIf"],"This field is required.","The value needs to be between 0 and 1."]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Qb(1,1),i.Wb(2,2),i.Pb(),i.Qb(3,3),i.Sb(4,"form",4),i.Sb(5,"div",5),i.Sb(6,"div",6),i.Sb(7,"label",7),i.Oc(8,"Weight"),i.Rb(),i.Sb(9,"div",8),i.Nb(10,"input",9),i.Mc(11,Zc,3,2,"span",10),i.Rb(),i.Rb(),i.Rb(),i.Sb(12,"div",11),i.Sb(13,"cd-form-button-panel",12),i.gc("submitActionEvent",(function(){return t.reweight()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(2),i.ac(t.osdId),i.Xb(2),i.yb(2),i.pc("formGroup",t.reweightForm),i.yb(6),i.pc("value",t.currentWeight),i.yb(1),i.pc("ngIf",t.weight.errors),i.yb(2),i.pc("form",t.reweightForm)("submitText",t.actionLabels.REWEIGHT))},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,On.a,xn.v,xn.d,ei.a,xn.q,xn.i,o.r,ti.a],styles:[""]}),e})();var el=n("FFMq");let tl=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.osdService=n,this.notificationService=i,this.joinPipe=r,this.selected=[]}ngOnInit(){this.scrubForm=new xn.j({})}scrub(){Object(jo.a)(this.selected.map(e=>this.osdService.scrub(e,this.deep))).subscribe(()=>{this.notificationService.show(yn.a.success,"" + (this.deep ? "Deep scrub" : "Scrub") + " was initialized in the following OSD(s): " + this.joinPipe.transform(this.selected) + ""),this.activeModal.close()},()=>this.activeModal.close())}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(gn.b),i.Mb(mr),i.Mb(wn.a),i.Mb(el.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-scrub-modal"]],decls:13,vars:9,consts:function(){var e,t,n;return e="{VAR_SELECT, select, true {Deep } other {}}",e=i.bc(e,{VAR_SELECT:"\ufffd0\ufffd"}),t="OSDs " + e + "Scrub",n="{VAR_SELECT, select, true {deep } other {}}",n=i.bc(n,{VAR_SELECT:"\ufffd0\ufffd"}),[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["name","scrubForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],"You are about to apply a " + n + "scrub to the OSD(s): " + "\ufffd#9\ufffd" + "" + "\ufffd1\ufffd" + "" + "\ufffd/#9\ufffd" + ".",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(i.Sb(0,"cd-modal",0),i.Sb(1,"span",1),i.Wb(2,2),i.Rb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Sb(7,"p"),i.cc(8,7),i.Nb(9,"strong"),i.jc(10,"join"),i.Zb(),i.Rb(),i.Rb(),i.Sb(11,"div",8),i.Sb(12,"cd-form-button-panel",9),i.gc("submitActionEvent",(function(){return t.scrub()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e&&(i.pc("modalRef",t.activeModal),i.yb(2),i.ac(t.deep),i.Xb(2),i.yb(2),i.pc("formGroup",t.scrubForm),i.yb(6),i.ac(t.deep)(i.kc(10,7,t.selected)),i.Xb(8),i.yb(2),i.pc("form",t.scrubForm)("submitText",t.actionLabels.UPDATE))},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,ti.a],pipes:[el.a],styles:[""]}),e})();var nl=n("b5OY");function il(e,t){if(1&e&&i.Nb(0,"cd-device-list",17),2&e){const e=i.ic(2);i.pc("osdId",null==e.osd?null:e.osd.id)}}function rl(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",18),2&e){const e=i.ic(2);i.pc("data",null==e.osd||null==e.osd.details?null:e.osd.details.osd_map)}}function sl(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table-key-value",21),i.gc("fetchData",(function(){return i.Dc(e),i.ic(3).refresh()})),i.Rb()}if(2&e){const e=i.ic(3);i.pc("data",null==e.osd||null==e.osd.details?null:e.osd.details.osd_metadata)}}function ol(e,t){1&e&&(i.Sb(0,"cd-alert-panel",22),i.Wb(1,23),i.Rb())}function al(e,t){if(1&e&&(i.Mc(0,sl,1,1,"cd-table-key-value",19),i.Mc(1,ol,2,0,"ng-template",null,20,i.Nc)),2&e){const e=i.Ac(2),t=i.ic(2);i.pc("ngIf",null==t.osd||null==t.osd.details?null:t.osd.details.osd_metadata)("ngIfElse",e)}}function cl(e,t){if(1&e&&i.Nb(0,"cd-smart-list",17),2&e){const e=i.ic(2);i.pc("osdId",null==e.osd?null:e.osd.id)}}function ll(e,t){if(1&e&&i.Nb(0,"cd-table-performance-counter",25),2&e){const e=i.ic(3);i.pc("serviceId",null==e.osd?null:e.osd.id)}}function ul(e,t){if(1&e&&i.Mc(0,ll,1,1,"cd-table-performance-counter",24),2&e){const e=i.ic(2);i.pc("ngIf",null==e.osd?null:e.osd.details)}}function dl(e,t){if(1&e&&i.Nb(0,"cd-grafana",28),2&e){const e=i.ic(3);i.pc("grafanaPath","osd-device-details?var-osd=osd."+e.osd.id)}}function hl(e,t){1&e&&(i.Sb(0,"li",26),i.Sb(1,"a",4),i.Wb(2,27),i.Rb(),i.Mc(3,dl,1,1,"ng-template",6),i.Rb())}function fl(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",1,2),i.Sb(3,"li",3),i.Sb(4,"a",4),i.Wb(5,5),i.Rb(),i.Mc(6,il,1,1,"ng-template",6),i.Rb(),i.Sb(7,"li",7),i.Sb(8,"a",4),i.Wb(9,8),i.Rb(),i.Mc(10,rl,1,1,"ng-template",6),i.Rb(),i.Sb(11,"li",9),i.Sb(12,"a",4),i.Wb(13,10),i.Rb(),i.Mc(14,al,3,2,"ng-template",6),i.Rb(),i.Sb(15,"li",11),i.Sb(16,"a",4),i.Wb(17,12),i.Rb(),i.Mc(18,cl,1,1,"ng-template",6),i.Rb(),i.Sb(19,"li",13),i.Sb(20,"a",4),i.Wb(21,14),i.Rb(),i.Mc(22,ul,1,1,"ng-template",6),i.Rb(),i.Mc(23,hl,4,0,"li",15),i.Rb(),i.Nb(24,"div",16),i.Pb()),2&e){const e=i.Ac(2),t=i.ic();i.yb(23),i.pc("ngIf",t.grafanaPermission.read),i.yb(1),i.pc("ngbNavOutlet",e)}}let pl=(()=>{class e{constructor(e,t){this.osdService=e,this.authStorageService=t,this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){var e,t,n;(null===(e=this.osd)||void 0===e?void 0:e.id)!==(null===(t=this.selection)||void 0===t?void 0:t.id)&&(this.osd=this.selection),Nt.a.isNumber(null===(n=this.osd)||void 0===n?void 0:n.id)&&this.refresh()}refresh(){this.osdService.getDetails(this.osd.id).subscribe(e=>{this.osd.details=e})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(mr),i.Mb(Jt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-details"]],inputs:{selection:"selection"},features:[i.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],["ngbNav","","id","tabset-osd-details","cdStatefulTab","osd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","devices"],["ngbNavLink",""],"Devices",["ngbNavContent",""],["ngbNavItem","attributes"],"Attributes (OSD map)",["ngbNavItem","metadata"],"Metadata",["ngbNavItem","device-health"],"Device health",["ngbNavItem","performance-counter"],"Performance counter",["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"osdId"],[3,"data"],[3,"data","fetchData",4,"ngIf","ngIfElse"],["noMetaData",""],[3,"data","fetchData"],["type","warning"],"Metadata not available",["serviceType","osd",3,"serviceId",4,"ngIf"],["serviceType","osd",3,"serviceId"],["ngbNavItem","performance-details"],"Performance Details",["uid","CrAHE0iZz","grafanaStyle","three",3,"grafanaPath"]]},template:function(e,t){1&e&&i.Mc(0,fl,25,2,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,Or,en.a,br.a,Is,nl.a,Fn.a],styles:[""]}),e})();const ml=["osdUsageTpl"],bl=["markOsdConfirmationTpl"],gl=["criticalConfirmationTpl"],_l=["reweightBodyTpl"],yl=["safeToDestroyBodyTpl"],vl=["deleteOsdExtraTpl"],wl=["flagsTpl"],Sl=function(){return{read:!0}};function Ml(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",13),i.gc("fetchData",(function(){return i.Dc(e),i.ic().getOsdList()}))("setExpandedRow",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)}))("updateSelection",(function(t){return i.Dc(e),i.ic().updateSelection(t)})),i.Sb(1,"div",14),i.Nb(2,"cd-table-actions",15),i.Nb(3,"cd-table-actions",16),i.Rb(),i.Nb(4,"cd-osd-details",17),i.Rb()}if(2&e){const e=i.ic();i.pc("data",e.osds)("columns",e.columns)("hasDetails",!0)("updateSelectionOnRefresh","never"),i.yb(2),i.pc("permission",e.permissions.osd)("selection",e.selection)("tableActions",e.tableActions),i.yb(1),i.pc("permission",i.tc(11,Sl))("selection",e.selection)("tableActions",e.clusterWideActions),i.yb(1),i.pc("selection",e.expandedRow)}}function xl(e,t){1&e&&i.Nb(0,"cd-grafana",19),2&e&&i.pc("grafanaPath","osd-overview?")}function kl(e,t){1&e&&(i.Sb(0,"li",2),i.Sb(1,"a",3),i.Wb(2,18),i.Rb(),i.Mc(3,xl,1,1,"ng-template",5),i.Rb())}function Dl(e,t){if(1&e&&(i.Qb(0),i.cc(1,20),i.Nb(2,"strong"),i.jc(3,"join"),i.Nb(4,"strong"),i.Zb(),i.Pb()),2&e){const e=t.markActionDescription,n=t.osdIds;i.yb(4),i.ac(i.kc(3,2,n))(e),i.Xb(1)}}function Tl(e,t){if(1&e&&(i.Sb(0,"div",23),i.Sb(1,"cd-alert-panel",24),i.Wb(2,25),i.Rb(),i.Rb()),2&e){const e=i.ic(),t=e.actionDescription,n=e.message,r=i.ic();i.yb(2),i.ac(r.selection.hasSingleSelection)(t)(n),i.Xb(2)}}function Cl(e,t){if(1&e&&(i.Mc(0,Tl,3,3,"div",21),i.Qb(1),i.cc(2,22),i.Nb(3,"strong"),i.jc(4,"join"),i.Nb(5,"strong"),i.Zb(),i.Pb()),2&e){const e=t.actionDescription,n=t.osdIds;i.pc("ngIf",!t.safeToPerform),i.yb(5),i.ac(i.kc(4,3,n))(e),i.Xb(2)}}function Ol(e,t){if(1&e&&(i.Sb(0,"span",28),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.Pc(e)}}function Rl(e,t){if(1&e&&(i.Sb(0,"span",29),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.Pc(e)}}function Ll(e,t){if(1&e&&(i.Mc(0,Ol,2,1,"span",26),i.Mc(1,Rl,2,1,"span",27)),2&e){const e=t.row;i.pc("ngForOf",e.cdClusterFlags),i.yb(1),i.pc("ngForOf",e.cdIndivFlags)}}function El(e,t){if(1&e&&i.Nb(0,"cd-usage-bar",30),2&e){const e=t.row;i.pc("total",e.stats.stat_bytes)("used",e.stats.stat_bytes_used)}}function Al(e,t){1&e&&(i.Qb(0,31),i.Qb(1,32),i.Sb(2,"div",33),i.Sb(3,"div",34),i.Nb(4,"input",35),i.Sb(5,"label",36),i.Wb(6,37),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Pb()),2&e&&i.pc("formGroup",t.form)}let Il=(()=>{class e extends $t.a{constructor(e,t,n,i,r,s,o,a,c,l){super(),this.authStorageService=e,this.osdService=t,this.dimlessBinaryPipe=n,this.modalService=i,this.urlBuilder=r,this.router=s,this.taskWrapper=o,this.actionLabels=a,this.notificationService=c,this.orchService=l,this.icons=_n.a,this.selection=new Wt.a,this.osds=[],this.disabledFlags=["sortbitwise","purged_snapdirs","recovery_deletes","pglog_hardlimit"],this.indivFlagNames=["noup","nodown","noin","noout"],this.actionOrchFeatures={create:[hr.OSD_CREATE],delete:[hr.OSD_DELETE]},this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{name:this.actionLabels.CREATE,permission:"create",icon:_n.a.add,click:()=>this.router.navigate([this.urlBuilder.getCreate()]),disable:e=>this.getDisable("create",e),canBePrimary:e=>!e.hasSelection},{name:this.actionLabels.EDIT,permission:"update",icon:_n.a.edit,click:()=>this.editAction()},{name:this.actionLabels.FLAGS,permission:"update",icon:_n.a.flag,click:()=>this.configureFlagsIndivAction(),disable:()=>!this.hasOsdSelected},{name:this.actionLabels.SCRUB,permission:"update",icon:_n.a.analyse,click:()=>this.scrubAction(!1),disable:()=>!this.hasOsdSelected,canBePrimary:e=>e.hasSelection},{name:this.actionLabels.DEEP_SCRUB,permission:"update",icon:_n.a.deepCheck,click:()=>this.scrubAction(!0),disable:()=>!this.hasOsdSelected},{name:this.actionLabels.REWEIGHT,permission:"update",click:()=>this.reweight(),disable:()=>!this.hasOsdSelected||!this.selection.hasSingleSelection,icon:_n.a.reweight},{name:this.actionLabels.MARK_OUT,permission:"update",click:()=>this.showConfirmationModal("out",this.osdService.markOut),disable:()=>this.isNotSelectedOrInState("out"),icon:_n.a.left},{name:this.actionLabels.MARK_IN,permission:"update",click:()=>this.showConfirmationModal("in",this.osdService.markIn),disable:()=>this.isNotSelectedOrInState("in"),icon:_n.a.right},{name:this.actionLabels.MARK_DOWN,permission:"update",click:()=>this.showConfirmationModal("down",this.osdService.markDown),disable:()=>this.isNotSelectedOrInState("down"),icon:_n.a.down},{name:this.actionLabels.MARK_LOST,permission:"delete",click:()=>this.showCriticalConfirmationModal("Mark","OSD lost","marked lost",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",this.osdService.markLost),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.flatten},{name:this.actionLabels.PURGE,permission:"delete",click:()=>this.showCriticalConfirmationModal("Purge","OSD","purged",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",e=>(this.selection=new Wt.a,this.osdService.purge(e))),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.erase},{name:this.actionLabels.DESTROY,permission:"delete",click:()=>this.showCriticalConfirmationModal("destroy","OSD","destroyed",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",e=>(this.selection=new Wt.a,this.osdService.destroy(e))),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.destroyCircle},{name:this.actionLabels.DELETE,permission:"delete",click:()=>this.delete(),disable:e=>this.getDisable("delete",e),icon:_n.a.destroy}]}static collectStates(e){const t=[e.in?"in":"out"];return e.up?t.push("up"):e.state.includes("destroyed")?t.push("destroyed"):t.push("down"),t}ngOnInit(){this.clusterWideActions=[{name:"Flags",icon:_n.a.flag,click:()=>this.configureFlagsAction(),permission:"read",visible:()=>this.permissions.osd.read},{name:"Recovery Priority",icon:_n.a.deepCheck,click:()=>this.configureQosParamsAction(),permission:"read",visible:()=>this.permissions.configOpt.read},{name:"PG scrub",icon:_n.a.analyse,click:()=>this.configurePgScrubAction(),permission:"read",visible:()=>this.permissions.configOpt.read}],this.columns=[{prop:"id",name:"ID",flexGrow:1,cellTransformation:Ht.a.executing,customTemplateConfig:{valueClass:"bold"}},{prop:"host.name",name:"Host"},{prop:"collectedStates",name:"Status",flexGrow:1,cellTransformation:Ht.a.badge,customTemplateConfig:{map:{in:{class:"badge-success"},up:{class:"badge-success"},down:{class:"badge-danger"},out:{class:"badge-danger"},destroyed:{class:"badge-danger"}}}},{prop:"tree.device_class",name:"Device class",flexGrow:1.2,cellTransformation:Ht.a.badge,customTemplateConfig:{map:{hdd:{class:"badge-hdd"},ssd:{class:"badge-ssd"}}}},{prop:"stats.numpg",name:"PGs",flexGrow:1},{prop:"stats.stat_bytes",name:"Size",flexGrow:1,pipe:this.dimlessBinaryPipe},{prop:"state",name:"Flags",cellTemplate:this.flagsTpl},{prop:"stats.usage",name:"Usage",cellTemplate:this.osdUsageTpl},{prop:"stats_history.out_bytes",name:"Read bytes",cellTransformation:Ht.a.sparkline},{prop:"stats_history.in_bytes",name:"Write bytes",cellTransformation:Ht.a.sparkline},{prop:"stats.op_r",name:"Read ops",cellTransformation:Ht.a.perSecond},{prop:"stats.op_w",name:"Write ops",cellTransformation:Ht.a.perSecond}],this.orchService.status().subscribe(e=>this.orchStatus=e)}getDisable(e,t){if("delete"===e){if(!t.hasSelection)return!0;if(Nt.a.some(this.getSelectedOsds(),e=>{const t=Nt.a.get(e,"operational_status");return"deleting"===t||"unmanaged"===t}))return!0}return this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}getSelectedOsdIds(){const e=this.osds.map(e=>e.id);return this.selection.selected.map(e=>e.id).filter(t=>e.includes(t)).sort()}getSelectedOsds(){return this.osds.filter(e=>!Nt.a.isUndefined(e)&&this.getSelectedOsdIds().includes(e.id))}get hasOsdSelected(){return this.getSelectedOsdIds().length>0}updateSelection(e){this.selection=e}isNotSelectedOrInState(e){const t=this.getSelectedOsds();if(0===t.length)return!0;switch(e){case"in":return t.some(e=>1===e.in);case"out":return t.some(e=>1!==e.in);case"down":return t.some(e=>1!==e.up);case"up":return t.some(e=>1===e.up)}}getOsdList(){const t=[this.osdService.getList(),this.osdService.getFlags()];Object(jo.a)(t).subscribe(t=>{this.osds=t[0].map(n=>{n.collectedStates=e.collectStates(n),n.stats_history.out_bytes=n.stats_history.op_out_bytes.map(e=>e[1]),n.stats_history.in_bytes=n.stats_history.op_in_bytes.map(e=>e[1]),n.stats.usage=n.stats.stat_bytes_used/n.stats.stat_bytes,n.cdIsBinary=!0,n.cdIndivFlags=n.state.filter(e=>this.indivFlagNames.includes(e)),n.cdClusterFlags=t[1].filter(e=>!this.disabledFlags.includes(e));const i=Nt.a.get(n,"operational_status","unmanaged");return"unmanaged"!==i&&"working"!==i&&(n.cdExecuting=i),n})})}editAction(){const e=Nt.a.filter(this.osds,["id",this.selection.first().id]).pop();this.modalService.show(Tn.a,{titleText:"Edit OSD: " + e.id + "",fields:[{type:"text",name:"deviceClass",value:e.tree.device_class,label:"Device class",required:!0}],submitButtonText:"Edit OSD",onSubmit:t=>{this.osdService.update(e.id,t.deviceClass).subscribe(()=>{this.notificationService.show(yn.a.success,"Updated OSD '" + e.id + "'"),this.getOsdList()})}})}scrubAction(e){if(!this.hasOsdSelected)return;const t={selected:this.getSelectedOsdIds(),deep:e};this.bsModalRef=this.modalService.show(tl,t)}configureFlagsAction(){this.bsModalRef=this.modalService.show(vc)}configureFlagsIndivAction(){const e={selected:this.getSelectedOsds()};this.bsModalRef=this.modalService.show(bc,e)}showConfirmationModal(e,t){const n=this.getSelectedOsdIds();this.bsModalRef=this.modalService.show(Dn.a,{titleText:"Mark OSD " + e + "",buttonText:"Mark " + e + "",bodyTpl:this.markOsdConfirmationTpl,bodyContext:{markActionDescription:e,osdIds:n},onSubmit:()=>{Object(jo.a)(this.getSelectedOsdIds().map(e=>t.call(this.osdService,e))).subscribe(()=>this.bsModalRef.close())}})}reweight(){const e=this.osds.filter(e=>e.id===this.selection.first().id).pop();this.bsModalRef=this.modalService.show(Xc,{currentWeight:e.weight,osdId:e.id})}delete(){const e=new Jn.a({preserve:new xn.h(!1)});this.showCriticalConfirmationModal("delete","OSD","deleted",e=>this.osdService.safeToDelete(JSON.stringify(e)),"is_safe_to_delete",t=>(this.selection=new Wt.a,this.taskWrapper.wrapTaskAroundCall({task:new tr.a("osd/"+gn.e.DELETE,{svc_id:t}),call:this.osdService.delete(t,e.value.preserve,!0)})),!0,e,this.deleteOsdExtraTpl)}showCriticalConfirmationModal(e,t,n,i,r,s,o=!1,a,c){i(this.getSelectedOsdIds()).subscribe(i=>{const l=this.modalService.show(bn.a,{actionDescription:e,itemDescription:t,bodyTemplate:this.criticalConfirmationTpl,bodyContext:{safeToPerform:i[r],message:i.message,actionDescription:n,osdIds:this.getSelectedOsdIds()},childFormGroup:a,childFormGroupTemplate:c,submitAction:()=>{const e=Object(jo.a)(this.getSelectedOsdIds().map(e=>s.call(this.osdService,e)));o?e.subscribe({error:()=>{this.getOsdList(),l.close()},complete:()=>l.close()}):e.subscribe(()=>{this.getOsdList(),l.close()},()=>l.close())}})})}configureQosParamsAction(){this.bsModalRef=this.modalService.show(Jc)}configurePgScrubAction(){this.bsModalRef=this.modalService.show(Yc,void 0,{size:"lg"})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(mr),i.Mb(Zt.a),i.Mb(vn.a),i.Mb(pr.a),i.Mb(Pt.e),i.Mb(nr.a),i.Mb(gn.b),i.Mb(wn.a),i.Mb(dr))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-osd-list"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(ml,!0),i.Jc(bl,!0),i.Jc(gl,!0),i.Tc(_l,!0),i.Tc(yl,!0),i.Tc(vl,!0),i.Jc(wl,!0)),2&e&&(i.zc(n=i.hc())&&(t.osdUsageTpl=n.first),i.zc(n=i.hc())&&(t.markOsdConfirmationTpl=n.first),i.zc(n=i.hc())&&(t.criticalConfirmationTpl=n.first),i.zc(n=i.hc())&&(t.reweightBodyTpl=n.first),i.zc(n=i.hc())&&(t.safeToDestroyBodyTpl=n.first),i.zc(n=i.hc())&&(t.deleteOsdExtraTpl=n.first),i.zc(n=i.hc())&&(t.flagsTpl=n.first))},features:[i.xb([{provide:pr.a,useValue:new pr.a("osd")}]),i.vb],decls:18,vars:2,consts:function(){var e,t,n,r,s;return e="OSDs List",t="Overall Performance",n="" + "[\ufffd#2\ufffd|\ufffd#4\ufffd]" + "OSD(s) " + "\ufffd0\ufffd" + "" + "[\ufffd/#2\ufffd|\ufffd/#4\ufffd]" + " will be marked " + "[\ufffd#2\ufffd|\ufffd#4\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#2\ufffd|\ufffd/#4\ufffd]" + " if you proceed.",n=i.bc(n),r="" + "[\ufffd#3\ufffd|\ufffd#5\ufffd]" + "OSD " + "\ufffd0\ufffd" + "" + "[\ufffd/#3\ufffd|\ufffd/#5\ufffd]" + " will be " + "[\ufffd#3\ufffd|\ufffd#5\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#3\ufffd|\ufffd/#5\ufffd]" + " if you proceed.",r=i.bc(r),s="{VAR_SELECT, select, true {OSD is} other {OSDs are}}",s=i.bc(s,{VAR_SELECT:"\ufffd0\ufffd"}),[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["markOsdConfirmationTpl",""],["criticalConfirmationTpl",""],["flagsTpl",""],["osdUsageTpl",""],["deleteOsdExtraTpl",""],["selectionType","multiClick",3,"data","columns","hasDetails","updateSelectionOnRefresh","fetchData","setExpandedRow","updateSelection"],[1,"table-actions","btn-toolbar"],["id","osd-actions",1,"btn-group",3,"permission","selection","tableActions"],["dropDownOnly","Cluster-wide configuration","btnColor","light","id","cluster-wide-actions",1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],t,["uid","lo02I1Aiz","grafanaStyle","four",3,"grafanaPath"],n,["class","danger",4,"ngIf"],r,[1,"danger"],["type","warning"],"The " + s + " not safe to be " + "\ufffd1\ufffd" + "! " + "\ufffd2\ufffd" + "",["class","badge badge-hdd mr-1",4,"ngFor","ngForOf"],["class","badge badge-info mr-1",4,"ngFor","ngForOf"],[1,"badge","badge-hdd","mr-1"],[1,"badge","badge-info","mr-1"],[3,"total","used"],[3,"formGroup"],["formGroupName","child"],[1,"form-group"],[1,"custom-control","custom-checkbox"],["type","checkbox","name","preserve","id","preserve","formControlName","preserve",1,"custom-control-input"],["for","preserve",1,"custom-control-label"],"Preserve OSD ID(s) for replacement."]},template:function(e,t){if(1&e&&(i.Sb(0,"ul",0,1),i.Sb(2,"li",2),i.Sb(3,"a",3),i.Wb(4,4),i.Rb(),i.Mc(5,Ml,5,12,"ng-template",5),i.Rb(),i.Mc(6,kl,4,0,"li",6),i.Rb(),i.Nb(7,"div",7),i.Mc(8,Dl,5,4,"ng-template",null,8,i.Nc),i.Mc(10,Cl,6,5,"ng-template",null,9,i.Nc),i.Mc(12,Ll,2,2,"ng-template",null,10,i.Nc),i.Mc(14,El,1,2,"ng-template",null,11,i.Nc),i.Mc(16,Al,7,1,"ng-template",null,12,i.Nc)),2&e){const e=i.Ac(1);i.yb(6),i.pc("ngIf",t.permissions.grafana.read),i.yb(1),i.pc("ngbNavOutlet",e)}},directives:[Qt.p,Qt.r,Qt.s,Qt.q,o.r,Qt.u,Bt.a,Sn.a,pl,Fn.a,br.a,o.q,ln.a,Zn.a,xn.r,xn.k,xn.l,Xn.a,On.a,xn.b,ei.a,xn.q,xn.i],pipes:[el.a],styles:[""]}),e})();var Pl=n("20UP");let jl=(()=>{class e{constructor(e,t){this.http=e,this.settingsService=t,this.baseURL="api/prometheus",this.settingsKey={alertmanager:"api/settings/alertmanager-api-host",prometheus:"api/settings/prometheus-api-host"}}ifAlertmanagerConfigured(e,t){this.settingsService.ifSettingConfigured(this.settingsKey.alertmanager,e,t)}disableAlertmanagerConfig(){this.settingsService.disableSetting(this.settingsKey.alertmanager)}ifPrometheusConfigured(e,t){this.settingsService.ifSettingConfigured(this.settingsKey.prometheus,e,t)}disablePrometheusConfig(){this.settingsService.disableSetting(this.settingsKey.prometheus)}getAlerts(e={}){return this.http.get(this.baseURL,{params:e})}getSilences(e={}){return this.http.get(this.baseURL+"/silences",{params:e})}getRules(e="all"){return this.http.get(this.baseURL+"/rules").pipe(Object(Vi.a)(t=>(["alerting","rewrites"].includes(e)&&t.groups.map(t=>{t.rules=t.rules.filter(t=>t.type===e)}),t)))}setSilence(e){return this.http.post(this.baseURL+"/silence",e,{observe:"response"})}expireSilence(e){return this.http.delete(`${this.baseURL}/silence/${e}`,{observe:"response"})}getNotifications(e){return this.http.get(`${this.baseURL}/notifications?from=${e&&e.id?e.id:"last"}`)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b),i.dc(Pl.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Nl=n("G1I9");let Fl=(()=>{class e{constructor(e){this.notificationService=e}sendNotifications(e){e.forEach(e=>this.notificationService.show(e))}convertToCustomAlerts(e){return Nt.a.uniqWith(e.map(e=>({status:Nt.a.isObject(e.status)?e.status.state:this.getPrometheusNotificationStatus(e),name:e.labels.alertname,url:e.generatorURL,description:e.annotations.description,fingerprint:Nt.a.isObject(e.status)&&e.fingerprint})),Nt.a.isEqual)}getPrometheusNotificationStatus(e){const t=e.status;return"firing"===t?"active":t}convertAlertToNotification(e){return new Nl.b(this.formatType(e.status),`${e.name} (${e.status})`,this.appendSourceLink(e,e.description),void 0,"Prometheus")}formatType(e){return yn.a[Nt.a.findKey({error:["firing","active"],info:["suppressed","unprocessed"],success:["resolved"]},t=>t.includes(e))]}appendSourceLink(e,t){return`${t} <a href="${e.url}" target="_blank"><i class="${_n.a.lineChart}"></i></a>`}}return e.\u0275fac=function(t){return new(t||e)(i.dc(wn.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Yl=(()=>{class e{constructor(e,t){this.alertFormatter=e,this.prometheusService=t,this.canAlertsBeNotified=!1,this.alerts=[],this.rules=[]}getAlerts(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.prometheusService.getAlerts().subscribe(e=>this.handleAlerts(e),e=>{[404,504].includes(e.status)&&this.prometheusService.disableAlertmanagerConfig()})})}getRules(){this.prometheusService.ifPrometheusConfigured(()=>{this.prometheusService.getRules("alerting").subscribe(e=>{this.rules=e.groups.reduce((e,t)=>e.concat(t.rules.map(e=>(e.group=t.name,e))),[])})})}refresh(){this.getAlerts(),this.getRules()}handleAlerts(e){this.canAlertsBeNotified&&this.notifyOnAlertChanges(e,this.alerts),this.activeAlerts=Nt.a.reduce(this.alerts,(e,t)=>"active"===t.status.state?++e:e,0),this.alerts=e,this.canAlertsBeNotified=!0}notifyOnAlertChanges(e,t){const n=this.getChangedAlerts(this.alertFormatter.convertToCustomAlerts(e),this.alertFormatter.convertToCustomAlerts(t)),i=Nt.a.filter(n,e=>"suppressed"!==e.status).map(e=>this.alertFormatter.convertAlertToNotification(e));this.alertFormatter.sendNotifications(i)}getChangedAlerts(e,t){return Nt.a.differenceWith(e,t,Nt.a.isEqual).concat(this.getVanishedAlerts(e,t))}getVanishedAlerts(e,t){return Nt.a.differenceWith(t,e,(e,t)=>e.fingerprint===t.fingerprint).map(e=>(e.status="resolved",e))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(Fl),i.dc(jl))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),zl=(()=>{class e extends $t.a{constructor(e){super(),this.prometheusService=e,this.isPrometheusConfigured=!1,this.isAlertmanagerConfigured=!1}ngOnInit(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.isAlertmanagerConfigured=!0}),this.prometheusService.ifPrometheusConfigured(()=>{this.isPrometheusConfigured=!0})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(jl))},e.\u0275dir=i.Hb({type:e,features:[i.vb]}),e})(),$l=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-prometheus-tabs"]],decls:11,vars:1,consts:function(){return[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/monitoring/active-alerts"],["ngbNavLink",""],"Active Alerts",["ngbNavItem","/monitoring/alerts"],"Alerts",["ngbNavItem","/monitoring/silences"],"Silences"]},template:function(e,t){1&e&&(i.Sb(0,"ul",0,1),i.gc("navChange",(function(e){return t.router.navigate([e.nextId])})),i.Sb(2,"li",2),i.Sb(3,"a",3),i.Wb(4,4),i.Rb(),i.Rb(),i.Sb(5,"li",5),i.Sb(6,"a",3),i.Wb(7,6),i.Rb(),i.Rb(),i.Sb(8,"li",7),i.Sb(9,"a",3),i.Wb(10,8),i.Rb(),i.Rb(),i.Rb()),2&e&&i.pc("activeId",t.router.url)},directives:[Qt.p,Qt.r,Qt.s],styles:[""]}),e})();const Hl=["externalLinkTpl"];function Wl(e,t){1&e&&(i.Sb(0,"cd-alert-panel",3),i.cc(1,4),i.Nb(2,"cd-doc",5),i.Zb(),i.Rb())}function Vl(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",9),2&e){const e=i.ic(2);i.pc("renderObjects",!0)("hideEmpty",!0)("appendParentKey",!1)("data",e.expandedRow)("customCss",e.customCss)("autoReload",!1)}}function Bl(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",6),i.gc("setExpandedRow",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)}))("updateSelection",(function(t){return i.Dc(e),i.ic().updateSelection(t)})),i.Nb(1,"cd-table-actions",7),i.Mc(2,Vl,1,6,"cd-table-key-value",8),i.Rb()}if(2&e){const e=i.ic();i.pc("data",e.prometheusAlertService.alerts)("columns",e.columns)("forceIdentifier",!0)("customCss",e.customCss)("hasDetails",!0),i.yb(1),i.pc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),i.yb(1),i.pc("ngIf",e.expandedRow)}}const Ul=function(e){return[e]};function Gl(e,t){if(1&e&&(i.Sb(0,"a",10),i.Nb(1,"i",11),i.Oc(2," Source"),i.Rb()),2&e){const e=t.value,n=i.ic();i.pc("href",e,i.Gc),i.yb(1),i.pc("ngClass",i.uc(2,Ul,n.icons.lineChart))}}let ql=(()=>{class e extends zl{constructor(e,t,n,i,r){super(r),this.authStorageService=e,this.prometheusAlertService=t,this.urlBuilder=n,this.cdDatePipe=i,this.selection=new Wt.a,this.icons=_n.a,this.customCss={"badge badge-danger":"active","badge badge-warning":"unprocessed","badge badge-info":"suppressed"},this.permission=this.authStorageService.getPermissions().prometheus,this.tableActions=[{permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>!e.hasSingleSelection||e.first().cdExecuting,icon:_n.a.add,routerLink:()=>"/monitoring"+this.urlBuilder.getCreateFrom(this.selection.first().fingerprint),name:"Create Silence"}]}ngOnInit(){super.ngOnInit(),this.columns=[{name:"Name",prop:"labels.alertname",flexGrow:2},{name:"Job",prop:"labels.job",flexGrow:2},{name:"Severity",prop:"labels.severity"},{name:"State",prop:"status.state",cellTransformation:Ht.a.classAdding},{name:"Started",prop:"startsAt",pipe:this.cdDatePipe},{name:"URL",prop:"generatorURL",sortable:!1,cellTemplate:this.externalLinkTpl}]}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Yl),i.Mb(pr.a),i.Mb(Vt.a),i.Mb(jl))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-active-alert-list"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Hl,!0),2&e&&i.zc(n=i.hc())&&(t.externalLinkTpl=n.first)},features:[i.xb([{provide:pr.a,useValue:new pr.a("silences")}]),i.vb],decls:5,vars:2,consts:function(){return[["type","info",4,"ngIf"],["identifier","fingerprint","selectionType","single",3,"data","columns","forceIdentifier","customCss","hasDetails","setExpandedRow","updateSelection",4,"ngIf"],["externalLinkTpl",""],["type","info"],"To see all active Prometheus alerts, please provide the URL to the API of Prometheus' Alertmanager as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",["section","prometheus"],["identifier","fingerprint","selectionType","single",3,"data","columns","forceIdentifier","customCss","hasDetails","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload",4,"ngIf"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload"],["target","_blank",3,"href"],[3,"ngClass"]]},template:function(e,t){1&e&&(i.Nb(0,"cd-prometheus-tabs"),i.Mc(1,Wl,3,0,"cd-alert-panel",0),i.Mc(2,Bl,3,9,"cd-table",1),i.Mc(3,Gl,3,4,"ng-template",null,2,i.Nc)),2&e&&(i.yb(1),i.pc("ngIf",!t.isAlertmanagerConfigured),i.yb(1),i.pc("ngIf",t.isAlertmanagerConfigured))},directives:[$l,o.r,br.a,Rr.a,Bt.a,Sn.a,en.a,o.p],styles:[""]}),e})(),Jl=(()=>{class e{transform(e){const t=[[""+Math.floor(e/31536e3),"years"],[""+Math.floor(e%31536e3/86400),"days"],[""+Math.floor(e%86400/3600),"hours"],[""+Math.floor(e%3600/60),"minutes"],[""+Math.floor(e%60),"seconds"]];let n="";for(let i=0,r=t.length;i<r;i++)"0"!==t[i][0]&&(n+=" "+t[i][0]+" "+("1"===t[i][0]?t[i][1].substr(0,t[i][1].length-1):t[i][1]));return n.trim()||"1 second"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"duration",type:e,pure:!1}),e})();function Ql(e,t){1&e&&(i.Sb(0,"cd-alert-panel",2),i.cc(1,3),i.Nb(2,"cd-doc",4),i.Zb(),i.Rb())}function Kl(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",7),2&e){const e=i.ic(2);i.pc("data",e.expandedRow)("renderObjects",!0)("hideKeys",e.hideKeys)}}function Zl(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",5),i.gc("updateSelection",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)})),i.Mc(1,Kl,1,3,"cd-table-key-value",6),i.Rb()}if(2&e){const e=i.ic();i.pc("data",e.prometheusAlertService.rules)("columns",e.columns)("hasDetails",!0)("selectionType","single"),i.yb(1),i.pc("ngIf",e.expandedRow)}}let Xl=(()=>{class e extends zl{constructor(e,t){super(t),this.prometheusAlertService=e,this.hideKeys=["alerts","type"]}ngOnInit(){super.ngOnInit(),this.columns=[{prop:"name",name:"Name"},{prop:"labels.severity",name:"Severity"},{prop:"group",name:"Group"},{prop:"duration",name:"Duration",pipe:new Jl},{prop:"query",name:"Query",isHidden:!0},{prop:"annotations.description",name:"Description"}]}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Yl),i.Mb(jl))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-rules-list"]],features:[i.vb],decls:3,vars:2,consts:function(){return[["type","info",4,"ngIf"],[3,"data","columns","hasDetails","selectionType","updateSelection",4,"ngIf"],["type","info"],"To see all configured Prometheus alerts, please provide the URL to the API of Prometheus as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",["section","prometheus"],[3,"data","columns","hasDetails","selectionType","updateSelection"],["cdTableDetail","",3,"data","renderObjects","hideKeys",4,"ngIf"],["cdTableDetail","",3,"data","renderObjects","hideKeys"]]},template:function(e,t){1&e&&(i.Nb(0,"cd-prometheus-tabs"),i.Mc(1,Ql,3,0,"cd-alert-panel",0),i.Mc(2,Zl,2,5,"cd-table",1)),2&e&&(i.yb(1),i.pc("ngIf",!t.isPrometheusConfigured),i.yb(1),i.pc("ngIf",t.isPrometheusConfigured))},directives:[$l,o.r,br.a,Rr.a,Bt.a,en.a],styles:[""]}),e})();var eu=n("WE5d");let tu=(()=>{class e{constructor(){this.valueAttributePath={alertname:"name",instance:"alerts.0.labels.instance",job:"alerts.0.labels.job",severity:"labels.severity"}}singleMatch(e,t){return this.multiMatch([e],t)}multiMatch(e,t){if(!e.some(e=>e.isRegex))return e.forEach(e=>{t=this.getMatchedRules(e,t)}),this.describeMatch(t)}getMatchedRules(e,t){const n=this.getAttributePath(e.name);return t.filter(t=>Nt.a.get(t,n)===e.value)}describeMatch(e){let t=0;return e.forEach(e=>t+=e.alerts.length),{status:this.getMatchText(e.length,t),cssClass:t?"has-success":"has-warning"}}getAttributePath(e){return this.valueAttributePath[e]}getMatchText(e,t){const n={noRule:"Your matcher seems to match no currently defined rule or active alert.",noAlerts:"no active alerts",alert:"1 active alert",alerts:"" + t + " active alerts",rule:"Matches 1 rule",rules:"Matches " + e + " rules"};return e?"" + (e > 1 ? n.rules : n.rule) + " with " + (t ? t > 1 ? n.alerts : n.alert : n.noAlerts) + ".":n.noRule}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),nu=(()=>{class e{calculateDuration(e,t){const n=+e,i=+t,r=this.getDuration(Math.abs(n-i));return n>i?"-"+r:r}getDuration(e){const t=new Date(e),n=t.getUTCHours(),i=t.getUTCMinutes(),r=(e,t)=>e?e+t:e;return[r(Math.floor(e/864e5),"d"),r(n,"h"),r(i,"m")].filter(e=>e).join(" ")}calculateDate(e,t,n){const i=+e;if(Nt.a.isNaN(i))return;const r=this.getDurationMs(t)*(n?-1:1);return new Date(i+r)}getDurationMs(e){return 6e4*(60*(24*this.getNumbersFromString(e,"d")+this.getNumbersFromString(e,"h"))+this.getNumbersFromString(e,"m"))}getNumbersFromString(e,t){const n=e.match(new RegExp("[0-9 ]+"+t,"i"));return n?parseInt(n[0],10):0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var iu=n("XNiG"),ru=n("VRyK"),su=n("7o/Q"),ou=n("D0XW");function au(e,t=ou.a){return n=>n.lift(new cu(e,t))}class cu{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new lu(e,this.dueTime,this.scheduler))}}class lu extends su.a{constructor(e,t,n){super(e),this.dueTime=t,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(uu,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function uu(e){e.debouncedNext()}var du=n("/uUt"),hu=n("pLZG");function fu(e,t){if(1&e&&(i.Sb(0,"option",27),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Qc(" ",e," ")}}function pu(e,t){1&e&&(i.Sb(0,"span",28),i.Wb(1,29),i.Rb())}function mu(e,t){1&e&&(i.Sb(0,"span",28),i.Wb(1,30),i.Rb())}function bu(e,t){if(1&e&&(i.Sb(0,"div",31),i.Sb(1,"span"),i.Oc(2),i.Rb(),i.Rb()),2&e){const e=i.ic();i.Bb("cd-col-form-offset ",e.matcherMatch.cssClass,""),i.yb(1),i.Bb("text-muted ",e.matcherMatch.cssClass,""),i.yb(1),i.Qc(" ",e.matcherMatch.status," ")}}let gu=(()=>{class e{constructor(e,t,n,r){this.formBuilder=e,this.silenceMatcher=t,this.activeModal=n,this.actionLabels=r,this.submitAction=new i.o,this.editMode=!1,this.nameAttributes=["alertname","instance","job","severity"],this.possibleValues=[],this.matcherMatch=void 0,this.valueClick=new iu.a,this.valueFocus=new iu.a,this.search=e=>Object(ru.a)(e.pipe(au(200),Object(du.a)()),this.valueFocus,this.valueClick.pipe(Object(hu.a)(()=>!this.typeahead.isPopupOpen()))).pipe(Object(Vi.a)(e=>(""===e?this.possibleValues:this.possibleValues.filter(t=>t.toLowerCase().indexOf(e.toLowerCase())>-1)).slice(0,10))),this.createForm(),this.subscribeToChanges()}createForm(){this.form=this.formBuilder.group({name:[null,[xn.A.required]],value:[{value:"",disabled:!0},[xn.A.required]],isRegex:new xn.h(!1)})}subscribeToChanges(){this.form.get("name").valueChanges.subscribe(e=>{null!==e?(this.setPossibleValues(e),this.form.get("value").enable()):this.form.get("value").disable()}),this.form.get("value").valueChanges.subscribe(e=>{const t=this.form.value;t.value=e,this.matcherMatch=this.silenceMatcher.singleMatch(t,this.rules)})}setPossibleValues(e){this.possibleValues=Nt.a.sortedUniq(this.rules.map(t=>Nt.a.get(t,this.silenceMatcher.getAttributePath(e))).filter(e=>e))}getMode(){return this.editMode?this.actionLabels.EDIT:this.actionLabels.ADD}preFillControls(e){this.form.setValue(e)}onSubmit(){this.submitAction.emit(this.form.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Fo.a),i.Mb(tu),i.Mb(Qt.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-silence-matcher-modal"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Qt.G,!0),2&e&&i.zc(n=i.hc())&&(t.typeahead=n.first)},outputs:{submitAction:"submitAction"},decls:31,vars:11,consts:function(){var e;return e="{VAR_SELECT, select, true {Edit} other {Add}}",e=i.bc(e,{VAR_SELECT:"\ufffd0\ufffd"}),[[3,"modalRef"],[1,"modal-title"],"" + e + " Matcher",[1,"modal-content"],["novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],"Name",[1,"cd-col-form-input"],["id","name","formControlName","name","name","name",1,"form-control"],[3,"ngValue"],"-- Select an attribute to match against --",[3,"value",4,"ngFor","ngForOf"],["class","help-block",4,"ngIf"],["for","value",1,"cd-col-form-label","required"],"Value",["id","value","container","body","type","text","formControlName","value",1,"form-control",3,"ngbTypeahead","focus","click"],["id","match-state",3,"class",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","isRegex","name","is-regex","id","is-regex",1,"custom-control-input"],["for","is-regex",1,"custom-control-label"],"Use regular expression",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"help-block"],"This field is required!","This field is required!",["id","match-state"]]},template:function(e,t){if(1&e&&(i.Sb(0,"cd-modal",0),i.Sb(1,"span",1),i.Wb(2,2),i.Rb(),i.Qb(3,3),i.Sb(4,"form",4,5),i.Sb(6,"div",6),i.Sb(7,"div",7),i.Sb(8,"label",8),i.Wb(9,9),i.Rb(),i.Sb(10,"div",10),i.Sb(11,"select",11),i.Sb(12,"option",12),i.Wb(13,13),i.Rb(),i.Mc(14,fu,2,2,"option",14),i.Rb(),i.Mc(15,pu,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(16,"div",7),i.Sb(17,"label",16),i.Wb(18,17),i.Rb(),i.Sb(19,"div",10),i.Sb(20,"input",18),i.gc("focus",(function(e){return t.valueFocus.next(e.target.value)}))("click",(function(e){return t.valueClick.next(e.target.value)})),i.Rb(),i.Mc(21,mu,2,0,"span",15),i.Rb(),i.Mc(22,bu,3,7,"div",19),i.Rb(),i.Sb(23,"div",7),i.Sb(24,"div",20),i.Sb(25,"div",21),i.Nb(26,"input",22),i.Sb(27,"label",23),i.Wb(28,24),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(29,"div",25),i.Sb(30,"cd-form-button-panel",26),i.gc("submitActionEvent",(function(){return t.onSubmit()})),i.Rb(),i.Rb(),i.Rb(),i.Pb(),i.Rb()),2&e){const e=i.Ac(5);i.pc("modalRef",t.activeModal),i.yb(2),i.ac(t.editMode),i.Xb(2),i.yb(2),i.pc("formGroup",t.form),i.yb(8),i.pc("ngValue",null),i.yb(2),i.pc("ngForOf",t.nameAttributes),i.yb(1),i.pc("ngIf",t.form.showError("name",e,"required")),i.yb(5),i.pc("ngbTypeahead",t.search),i.yb(1),i.pc("ngIf",t.form.showError("value",e,"required")),i.yb(1),i.pc("ngIf",t.form.getValue("value")&&!t.form.getValue("isRegex")&&t.matcherMatch),i.yb(8),i.pc("form",t.form)("submitText",t.getMode())}},directives:[Ia.a,xn.C,xn.r,Zn.a,xn.k,Xn.a,On.a,xn.z,ei.a,xn.q,xn.i,xn.u,xn.B,o.q,o.r,xn.d,Qt.G,xn.b,ti.a],styles:[""]}),e})();var _u=n("MAOJ");function yu(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"input",54),i.Pb()),2&e){const e=i.ic().$implicit,t=i.ic(),n=t.index,r=t.matcher;i.yb(1),i.sc("id","matcher-",e.attribute,"-",n,""),i.pc("value",r[e.attribute])}}function vu(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",47),i.Sb(2,"div",55),i.Nb(3,"input",56),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic().$implicit,t=i.ic(),n=t.index,r=t.matcher;i.yb(3),i.sc("id","matcher-",e.attribute,"-",n,""),i.pc("checked",r[e.attribute])}}const wu=function(e){return[e]};function Su(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",52),i.Sb(2,"span",53),i.Nb(3,"i",38),i.Rb(),i.Rb(),i.Mc(4,yu,2,3,"ng-container",7),i.Mc(5,vu,4,3,"ng-container",7),i.Pb()),2&e){const e=t.$implicit;i.yb(2),i.pc("ngbTooltip",e.tooltip),i.yb(1),i.pc("ngClass",i.uc(4,wu,e.icon)),i.yb(1),i.pc("ngIf","isRegex"!==e.attribute),i.yb(1),i.pc("ngIf","isRegex"===e.attribute)}}function Mu(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",46),i.Mc(1,Su,6,6,"ng-container",34),i.Sb(2,"span",47),i.Sb(3,"button",48),i.Yb(4,49),i.gc("click",(function(){i.Dc(e);const n=t.index;return i.ic().showMatcherModal(n)})),i.Nb(5,"i",38),i.Rb(),i.Sb(6,"button",48),i.Yb(7,50),i.gc("click",(function(){i.Dc(e);const n=t.index;return i.ic().deleteMatcher(n)})),i.Nb(8,"i",38),i.Rb(),i.Rb(),i.Rb(),i.Nb(9,"span",51)}if(2&e){const e=t.index,n=i.ic();i.yb(1),i.pc("ngForOf",n.matcherConfig),i.yb(2),i.rc("id","matcher-edit-",e,""),i.yb(2),i.pc("ngClass",i.uc(5,wu,n.icons.edit)),i.yb(1),i.rc("id","matcher-delete-",e,""),i.yb(2),i.pc("ngClass",i.uc(7,wu,n.icons.trash))}}function xu(e,t){1&e&&(i.Sb(0,"cd-helper"),i.Wb(1,57),i.Rb())}function ku(e,t){1&e&&(i.Sb(0,"span",58),i.Wb(1,59),i.Rb())}function Du(e,t){1&e&&(i.Sb(0,"span",58),i.Wb(1,60),i.Rb())}function Tu(e,t){1&e&&(i.Sb(0,"span",58),i.Wb(1,61),i.Rb())}function Cu(e,t){1&e&&(i.Sb(0,"span",58),i.Wb(1,62),i.Rb())}function Ou(e,t){1&e&&(i.Sb(0,"span",58),i.Wb(1,63),i.Rb())}const Ru=function(e,t){return{"text-warning":e,"text-danger":t}};function Lu(e,t){if(1&e&&(i.Sb(0,"h5",38),i.Sb(1,"strong"),i.Wb(2,64),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(4);i.pc("ngClass",i.vc(1,Ru,!e.submitted,e.submitted))}}function Eu(e,t){1&e&&i.Ob(0)}const Au=function(e,t){return{index:e,matcher:t}};function Iu(e,t){if(1&e&&(i.Sb(0,"span"),i.Mc(1,Eu,1,0,"ng-container",65),i.Rb()),2&e){const e=t.$implicit,n=t.index;i.ic();const r=i.Ac(1);i.yb(1),i.pc("ngTemplateOutlet",r)("ngTemplateOutletContext",i.vc(2,Au,n,e))}}function Pu(e,t){if(1&e&&(i.Sb(0,"div",66),i.Sb(1,"span"),i.Oc(2),i.Rb(),i.Rb()),2&e){const e=i.ic();i.Bb("cd-col-form-offset ",e.matcherMatch.cssClass,""),i.yb(1),i.Bb("text-muted ",e.matcherMatch.cssClass,""),i.yb(1),i.Qc(" ",e.matcherMatch.status," ")}}function ju(e,t){if(1&e&&i.Nb(0,"cd-date-time-picker",67),2&e){const e=i.ic();i.pc("control",e.form.get("startsAt"))("hasSeconds",!1)}}function Nu(e,t){if(1&e&&i.Nb(0,"cd-date-time-picker",67),2&e){const e=i.ic();i.pc("control",e.form.get("endsAt"))("hasSeconds",!1)}}const Fu=function(e){return{"btn-warning":e}};let Yu=(()=>{class e{constructor(e,t,n,i,r,s,o,a,c,l,u){this.router=e,this.authStorageService=t,this.formBuilder=n,this.prometheusService=i,this.notificationService=r,this.route=s,this.timeDiff=o,this.modalService=a,this.silenceMatcher=c,this.actionLabels=l,this.succeededLabels=u,this.icons=_n.a,this.recreate=!1,this.edit=!1,this.resource="silence",this.matchers=[],this.matcherMatch=void 0,this.matcherConfig=[{tooltip:"Attribute name",icon:this.icons.paragraph,attribute:"name"},{tooltip:"Value",icon:this.icons.terminal,attribute:"value"},{tooltip:"Regular expression",icon:this.icons.magic,attribute:"isRegex"}],this.datetimeFormat="YYYY-MM-DD HH:mm",this.init()}init(){this.chooseMode(),this.authenticate(),this.createForm(),this.setupDates(),this.getData()}chooseMode(){this.edit=this.router.url.startsWith("/monitoring/silences/edit"),this.recreate=this.router.url.startsWith("/monitoring/silences/recreate"),this.action=this.edit?this.actionLabels.EDIT:this.recreate?this.actionLabels.RECREATE:this.actionLabels.CREATE}authenticate(){if(this.permission=this.authStorageService.getPermissions().prometheus,!this.permission.read||!(this.edit?this.permission.update:this.permission.create))throw new eu.b}createForm(){const e=Cn.a.custom("format",e=>!(""===e||nn()(e,this.datetimeFormat).isValid()));this.form=this.formBuilder.group({startsAt:["",[xn.A.required,e]],duration:["2h",[xn.A.min(1)]],endsAt:["",[xn.A.required,e]],createdBy:[this.authStorageService.getUsername(),[xn.A.required]],comment:[null,[xn.A.required]]},{validators:Cn.a.custom("matcherRequired",()=>0===this.matchers.length)})}setupDates(){const e=nn()().format(this.datetimeFormat);this.form.silentSet("startsAt",e),this.updateDate(),this.subscribeDateChanges()}updateDate(e){const t=nn()(this.form.getValue(e?"endsAt":"startsAt"),this.datetimeFormat).toDate(),n=this.timeDiff.calculateDate(t,this.form.getValue("duration"),e);if(n){const t=nn()(n).format(this.datetimeFormat);this.form.silentSet(e?"startsAt":"endsAt",t)}}subscribeDateChanges(){this.form.get("startsAt").valueChanges.subscribe(()=>{this.onDateChange()}),this.form.get("duration").valueChanges.subscribe(()=>{this.updateDate()}),this.form.get("endsAt").valueChanges.subscribe(()=>{this.onDateChange(!0)})}onDateChange(e){const t=nn()(this.form.getValue("startsAt"),this.datetimeFormat),n=nn()(this.form.getValue("endsAt"),this.datetimeFormat);t.isBefore(n)?this.updateDuration():this.updateDate(e)}updateDuration(){const e=nn()(this.form.getValue("startsAt"),this.datetimeFormat).toDate(),t=nn()(this.form.getValue("endsAt"),this.datetimeFormat).toDate();this.form.silentSet("duration",this.timeDiff.calculateDuration(e,t))}getData(){this.getRules(),this.getModeSpecificData()}getRules(){this.prometheusService.ifPrometheusConfigured(()=>this.prometheusService.getRules().subscribe(e=>{this.rules=e.groups.reduce((e,t)=>Nt.a.concat(e,t.rules),[])},()=>{this.prometheusService.disablePrometheusConfig(),this.rules=[]}),()=>{this.rules=[],this.notificationService.show(yn.a.info,"Please add your Prometheus host to the dashboard configuration and refresh the page",void 0,void 0,"Prometheus")})}getModeSpecificData(){this.route.params.subscribe(e=>{e.id&&(this.edit||this.recreate?this.prometheusService.getSilences(e).subscribe(e=>{this.fillFormWithSilence(e[0])}):this.prometheusService.getAlerts(e).subscribe(e=>{this.fillFormByAlert(e[0])}))})}fillFormWithSilence(e){this.id=e.id,this.edit&&(["startsAt","endsAt"].forEach(t=>this.form.silentSet(t,nn()(e[t]).format(this.datetimeFormat))),this.updateDuration()),["createdBy","comment"].forEach(t=>this.form.silentSet(t,e[t])),this.matchers=e.matchers,this.validateMatchers()}validateMatchers(){this.rules?(this.matcherMatch=this.silenceMatcher.multiMatch(this.matchers,this.rules),this.form.markAsDirty(),this.form.updateValueAndValidity()):window.setTimeout(()=>this.validateMatchers(),100)}fillFormByAlert(e){const t=e.labels;Object.keys(t).forEach(e=>this.setMatcher({name:e,value:t[e],isRegex:!1}))}setMatcher(e,t){Nt.a.isNumber(t)?this.matchers[t]=e:this.matchers.push(e),this.validateMatchers()}showMatcherModal(e){const t=this.modalService.show(gu).componentInstance;t.rules=this.rules,Nt.a.isNumber(e)&&(t.editMode=!0,t.preFillControls(this.matchers[e])),t.submitAction.subscribe(t=>{this.setMatcher(t,e)})}deleteMatcher(e){this.matchers.splice(e,1),this.validateMatchers()}submit(){this.form.invalid||this.prometheusService.setSilence(this.getSubmitData()).subscribe(e=>{this.router.navigate(["/monitoring/silences"]),this.notificationService.show(yn.a.success,this.getNotificationTile(e.body.silenceId),void 0,void 0,"Prometheus")},()=>this.form.setErrors({cdSubmitButton:!0}))}getSubmitData(){const e=this.form.value;return delete e.duration,e.startsAt=nn()(e.startsAt,this.datetimeFormat).toISOString(),e.endsAt=nn()(e.endsAt,this.datetimeFormat).toISOString(),e.matchers=this.matchers,this.edit&&(e.id=this.id),e}getNotificationTile(e){let t;return t=this.edit?this.succeededLabels.EDITED:this.recreate?this.succeededLabels.RECREATED:this.succeededLabels.CREATED,`${t} ${this.resource} ${e}`}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e),i.Mb(Jt.a),i.Mb(Fo.a),i.Mb(jl),i.Mb(wn.a),i.Mb(Pt.a),i.Mb(nu),i.Mb(vn.a),i.Mb(tu),i.Mb(gn.b),i.Mb(gn.d))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-prometheus-form"]],decls:71,vars:30,consts:function(){return[["matcherTpl",""],[1,"cd-col-form"],["name","form","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"]," " + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + " ",[4,"ngIf"],[1,"card-body"],[1,"form-group","row"],["for","created-by",1,"cd-col-form-label","required"],"Creator",[1,"cd-col-form-input"],["formControlName","createdBy","id","created-by","name","created-by","type","text",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","comment",1,"cd-col-form-label","required"],"Comment",["formControlName","comment","id","comment","name","comment","type","text",1,"form-control"],["for","starts-at",1,"cd-col-form-label"],[1,"required"],"Start time","If the start time lies in the past the creation time will be used",["formControlName","startsAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["ps","ngbPopover"],["for","duration",1,"cd-col-form-label","required"],"Duration",["formControlName","duration","id","duration","name","duration","type","text",1,"form-control"],["for","ends-at",1,"cd-col-form-label","required"],"End time",["formControlName","endsAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["pe","ngbPopover"],"Matchers",[1,"cd-col-form-offset"],[3,"ngClass",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"row"],[1,"col-12"],["type","button","id","add-matcher",1,"btn","btn-light","float-right","my-3",3,"ngClass","click"],[3,"ngClass"],"Add matcher",["id","match-state",3,"class",4,"ngIf"],[1,"card-footer"],[1,"text-right"],[3,"form","submitText","submitActionEvent"],["popStart",""],["popEnd",""],[1,"input-group","my-2"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"id","click",6,"ngbTooltip"],["ngbTooltip","Edit"],["ngbTooltip","Delete"],[1,"help-block"],[1,"input-group-prepend"],[1,"input-group-text",3,"ngbTooltip"],["type","text","disabled","","readonly","",1,"form-control",3,"id","value"],[1,"input-group-text"],["type","checkbox","disabled","","readonly","",3,"id","checked"],"Editing a silence will expire the old silence and recreate it as a new silence",[1,"invalid-feedback"],"This field is required!","This field is required!","This field is required!","This field is required!","This field is required!","A silence requires at least one matcher",[4,"ngTemplateOutlet","ngTemplateOutletContext"],["id","match-state"],[3,"control","hasSeconds"]]},template:function(e,t){if(1&e){const e=i.Tb();i.Mc(0,Mu,10,9,"ng-template",null,0,i.Nc),i.Sb(2,"div",1),i.Sb(3,"form",2,3),i.Sb(5,"div",4),i.Sb(6,"div",5),i.Sb(7,"span"),i.Wb(8,6),i.jc(9,"titlecase"),i.jc(10,"upperFirst"),i.Rb(),i.Mc(11,xu,2,0,"cd-helper",7),i.Rb(),i.Sb(12,"div",8),i.Sb(13,"div",9),i.Sb(14,"label",10),i.Wb(15,11),i.Rb(),i.Sb(16,"div",12),i.Nb(17,"input",13),i.Mc(18,ku,2,0,"span",14),i.Rb(),i.Rb(),i.Sb(19,"div",9),i.Sb(20,"label",15),i.Wb(21,16),i.Rb(),i.Sb(22,"div",12),i.Sb(23,"textarea",17),i.Oc(24,"            "),i.Rb(),i.Mc(25,Du,2,0,"span",14),i.Rb(),i.Rb(),i.Sb(26,"div",9),i.Sb(27,"label",18),i.Sb(28,"span",19),i.Wb(29,20),i.Rb(),i.Sb(30,"cd-helper"),i.Wb(31,21),i.Rb(),i.Rb(),i.Sb(32,"div",12),i.Sb(33,"input",22,23),i.gc("click",(function(){return i.Dc(e),i.Ac(34).open()}))("keypress",(function(){return i.Dc(e),i.Ac(34).close()})),i.Rb(),i.Mc(35,Tu,2,0,"span",14),i.Rb(),i.Rb(),i.Sb(36,"div",9),i.Sb(37,"label",24),i.Wb(38,25),i.Rb(),i.Sb(39,"div",12),i.Nb(40,"input",26),i.Mc(41,Cu,2,0,"span",14),i.Rb(),i.Rb(),i.Sb(42,"div",9),i.Sb(43,"label",27),i.Wb(44,28),i.Rb(),i.Sb(45,"div",12),i.Sb(46,"input",29,30),i.gc("click",(function(){return i.Dc(e),i.Ac(47).open()}))("keypress",(function(){return i.Dc(e),i.Ac(47).close()})),i.Rb(),i.Mc(48,Ou,2,0,"span",14),i.Rb(),i.Rb(),i.Sb(49,"fieldset"),i.Sb(50,"legend",19),i.Wb(51,31),i.Rb(),i.Sb(52,"div",32),i.Mc(53,Lu,3,4,"h5",33),i.Mc(54,Iu,2,5,"span",34),i.Sb(55,"div",35),i.Sb(56,"div",36),i.Sb(57,"button",37),i.gc("click",(function(){return t.showMatcherModal()})),i.Nb(58,"i",38),i.Qb(59),i.Wb(60,39),i.Pb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Mc(61,Pu,3,7,"div",40),i.Rb(),i.Rb(),i.Sb(62,"div",41),i.Sb(63,"div",42),i.Sb(64,"cd-form-button-panel",43),i.gc("submitActionEvent",(function(){return t.submit()})),i.jc(65,"titlecase"),i.jc(66,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Mc(67,ju,1,2,"ng-template",null,44,i.Nc),i.Mc(69,Nu,1,2,"ng-template",null,45,i.Nc)}if(2&e){const e=i.Ac(4),n=i.Ac(68),r=i.Ac(70);i.yb(3),i.pc("formGroup",t.form),i.yb(7),i.ac(i.kc(9,18,t.action))(i.kc(10,20,t.resource)),i.Xb(8),i.yb(1),i.pc("ngIf",t.edit),i.yb(7),i.pc("ngIf",t.form.showError("createdBy",e,"required")),i.yb(7),i.pc("ngIf",t.form.showError("comment",e,"required")),i.yb(8),i.pc("ngbPopover",n),i.yb(2),i.pc("ngIf",t.form.showError("startsAt",e,"required")),i.yb(6),i.pc("ngIf",t.form.showError("duration",e,"required")),i.yb(5),i.pc("ngbPopover",r),i.yb(2),i.pc("ngIf",t.form.showError("endsAt",e,"required")),i.yb(5),i.pc("ngIf",0===t.matchers.length),i.yb(1),i.pc("ngForOf",t.matchers),i.yb(3),i.pc("ngClass",i.uc(26,Fu,e.submitted&&0===t.matchers.length)),i.yb(1),i.pc("ngClass",i.uc(28,wu,t.icons.add)),i.yb(3),i.pc("ngIf",t.matchers.length&&t.matcherMatch),i.yb(3),i.pc("form",t.form)("submitText",i.kc(65,22,t.action)+" "+i.kc(66,24,t.resource))}},directives:[xn.C,xn.r,Zn.a,xn.k,o.r,Xn.a,On.a,xn.d,ei.a,xn.q,xn.i,Yo.a,Qt.w,o.q,o.p,ti.a,Qt.D,o.w,_u.a],pipes:[o.A,sr.a],styles:["textarea[_ngcontent-%COMP%]{resize:vertical}"]}),e})();var zu=n("w9WL"),$u=n("HDdC");function Hu(e,t){1&e&&(i.Sb(0,"cd-alert-panel",2),i.cc(1,3),i.Nb(2,"cd-doc",4),i.Zb(),i.Rb())}function Wu(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",8),2&e){const e=i.ic(2);i.pc("renderObjects",!0)("hideEmpty",!0)("appendParentKey",!1)("data",e.expandedRow)("customCss",e.customCss)("autoReload",!1)}}function Vu(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-table",5),i.gc("setExpandedRow",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)}))("fetchData",(function(){return i.Dc(e),i.ic().refresh()}))("updateSelection",(function(t){return i.Dc(e),i.ic().updateSelection(t)})),i.Nb(1,"cd-table-actions",6),i.Mc(2,Wu,1,6,"cd-table-key-value",7),i.Rb()}if(2&e){const e=i.ic();i.pc("data",e.silences)("columns",e.columns)("forceIdentifier",!0)("customCss",e.customCss)("sorts",e.sorts)("hasDetails",!0),i.yb(1),i.pc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),i.yb(1),i.pc("ngIf",e.expandedRow)}}let Bu=(()=>{class e extends zl{constructor(e,t,n,i,r,s,o,a){super(a),this.authStorageService=e,this.cdDatePipe=t,this.modalService=n,this.notificationService=i,this.urlBuilder=r,this.actionLabels=s,this.succeededLabels=o,this.silences=[],this.selection=new Wt.a,this.customCss={"badge badge-danger":"active","badge badge-warning":"pending","badge badge-default":"expired"},this.sorts=[{prop:"endsAt",dir:zu.i.desc}],this.permission=this.authStorageService.getPermissions().prometheus;const c=e=>e.first()&&e.first().status&&"expired"===e.first().status.state;this.tableActions=[{permission:"create",icon:_n.a.add,routerLink:()=>this.urlBuilder.getCreate(),canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"create",canBePrimary:e=>e.hasSingleSelection&&c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||e.first().cdExecuting&&c(e)||!c(e),icon:_n.a.copy,routerLink:()=>this.urlBuilder.getRecreate(this.selection.first().id),name:this.actionLabels.RECREATE},{permission:"update",icon:_n.a.edit,canBePrimary:e=>e.hasSingleSelection&&!c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||e.first().cdExecuting&&!c(e)||c(e),routerLink:()=>this.urlBuilder.getEdit(this.selection.first().id),name:this.actionLabels.EDIT},{permission:"delete",icon:_n.a.trash,canBePrimary:e=>e.hasSingleSelection&&!c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||c(e),click:()=>this.expireSilence(),name:this.actionLabels.EXPIRE}],this.columns=[{name:"ID",prop:"id",flexGrow:3},{name:"Created by",prop:"createdBy",flexGrow:2},{name:"Started",prop:"startsAt",pipe:this.cdDatePipe},{name:"Updated",prop:"updatedAt",pipe:this.cdDatePipe},{name:"Ends",prop:"endsAt",pipe:this.cdDatePipe},{name:"Status",prop:"status.state",cellTransformation:Ht.a.classAdding}]}refresh(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.prometheusService.getSilences().subscribe(e=>{this.silences=e},()=>{this.prometheusService.disableAlertmanagerConfig()})})}updateSelection(e){this.selection=e}expireSilence(){const e=this.selection.first().id,t="Silence",n="Prometheus";this.modalRef=this.modalService.show(bn.a,{itemDescription:t,itemNames:[e],actionDescription:this.actionLabels.EXPIRE,submitActionObservable:()=>new $u.a(i=>{this.prometheusService.expireSilence(e).subscribe(()=>{this.notificationService.show(yn.a.success,`${this.succeededLabels.EXPIRED} ${t} ${e}`,void 0,void 0,n)},e=>{e.application=n,i.error(e)},()=>{i.complete(),this.refresh()})})})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Vt.a),i.Mb(vn.a),i.Mb(wn.a),i.Mb(pr.a),i.Mb(gn.b),i.Mb(gn.d),i.Mb(jl))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-silences-list"]],features:[i.xb([{provide:pr.a,useValue:new pr.a("monitoring/silences")}]),i.vb],decls:3,vars:2,consts:function(){return[["type","info",4,"ngIf"],["selectionType","single",3,"data","columns","forceIdentifier","customCss","sorts","hasDetails","setExpandedRow","fetchData","updateSelection",4,"ngIf"],["type","info"],"To enable Silences, please provide the URL to the API of the Prometheus' Alertmanager as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",["section","prometheus"],["selectionType","single",3,"data","columns","forceIdentifier","customCss","sorts","hasDetails","setExpandedRow","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload",4,"ngIf"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload"]]},template:function(e,t){1&e&&(i.Nb(0,"cd-prometheus-tabs"),i.Mc(1,Hu,3,0,"cd-alert-panel",0),i.Mc(2,Vu,3,10,"cd-table",1)),2&e&&(i.yb(1),i.pc("ngIf",!t.isAlertmanagerConfigured),i.yb(1),i.pc("ngIf",t.isAlertmanagerConfigured))},directives:[$l,o.r,br.a,Rr.a,Bt.a,Sn.a,en.a],styles:[""]}),e})();var Uu=n("Ekvf"),Gu=n("a96k"),qu=n("D4zM");function Ju(e,t){if(1&e&&(i.Sb(0,"option",29),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Qc(" ",e," ")}}function Qu(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,31),i.Rb())}function Ku(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,36),i.Rb()),2&e&&i.pc("ngValue",null)}function Zu(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,37),i.Rb()),2&e&&i.pc("ngValue",null)}function Xu(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,38),i.Rb()),2&e&&i.pc("ngValue",null)}function ed(e,t){if(1&e&&(i.Sb(0,"option",29),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.service_name),i.yb(1),i.Pc(e.service_name)}}function td(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,39),i.Rb())}const nd=function(){return["ingress"]},id=function(e){return{required:e}};function rd(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",7),i.Sb(1,"label",32),i.Wb(2,33),i.Rb(),i.Sb(3,"div",10),i.Sb(4,"select",34),i.gc("change",(function(){return i.Dc(e),i.ic().prePopulateId()})),i.Mc(5,Ku,2,1,"option",35),i.Mc(6,Zu,2,1,"option",35),i.Mc(7,Xu,2,1,"option",35),i.Mc(8,ed,2,2,"option",14),i.Rb(),i.Mc(9,td,2,0,"span",15),i.Rb(),i.Rb()}if(2&e){const e=i.ic(),t=i.Ac(2);i.yb(1),i.pc("ngClass",i.uc(7,id,i.tc(6,nd).includes(e.serviceForm.controls.service_type.value))),i.yb(4),i.pc("ngIf",null===e.services),i.yb(1),i.pc("ngIf",null!==e.services&&0===e.services.length),i.yb(1),i.pc("ngIf",null!==e.services&&e.services.length>0),i.yb(1),i.pc("ngForOf",e.services),i.yb(1),i.pc("ngIf",e.serviceForm.showError("backend_service",t,"required"))}}function sd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,40),i.Rb())}function od(e,t){1&e&&(i.Sb(0,"span",30),i.cc(1,41),i.Nb(2,"strong"),i.Zb(),i.Rb())}function ad(e,t){1&e&&(i.Sb(0,"div",7),i.Sb(1,"label",42),i.Wb(2,43),i.Rb(),i.Sb(3,"div",10),i.Sb(4,"select",44),i.Sb(5,"option",45),i.Wb(6,46),i.Rb(),i.Sb(7,"option",47),i.Wb(8,48),i.Rb(),i.Rb(),i.Rb(),i.Rb())}function cd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,52),i.Rb())}function ld(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",7),i.Sb(1,"label",49),i.Wb(2,50),i.Rb(),i.Sb(3,"div",10),i.Sb(4,"input",51),i.gc("focus",(function(t){return i.Dc(e),i.ic().labelFocus.next(t.target.value)}))("click",(function(t){return i.Dc(e),i.ic().labelClick.next(t.target.value)})),i.Rb(),i.Mc(5,cd,2,0,"span",15),i.Rb(),i.Rb()}if(2&e){const e=i.ic(),t=i.Ac(2);i.yb(4),i.pc("ngbTypeahead",e.searchLabels),i.yb(1),i.pc("ngIf",e.serviceForm.showError("label",t,"required"))}}function ud(e,t){if(1&e&&(i.Sb(0,"div",7),i.Sb(1,"label",53),i.Wb(2,54),i.Rb(),i.Sb(3,"div",10),i.Nb(4,"cd-select-badges",55),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(4),i.pc("data",e.serviceForm.controls.hosts.value)("options",e.hosts.options)("messages",e.hosts.messages)}}function dd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,60),i.Rb())}function hd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,61),i.Rb())}function fd(e,t){if(1&e&&(i.Sb(0,"div",7),i.Sb(1,"label",56),i.Sb(2,"span"),i.Wb(3,57),i.Rb(),i.Sb(4,"cd-helper"),i.Wb(5,58),i.Rb(),i.Rb(),i.Sb(6,"div",10),i.Nb(7,"input",59),i.Mc(8,dd,2,0,"span",15),i.Mc(9,hd,2,0,"span",15),i.Rb(),i.Rb()),2&e){const e=i.ic(),t=i.Ac(2);i.yb(8),i.pc("ngIf",e.serviceForm.showError("count",t,"min")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("count",t,"pattern"))}}function pd(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,68),i.Rb()),2&e&&i.pc("ngValue",null)}function md(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,69),i.Rb()),2&e&&i.pc("ngValue",null)}function bd(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,70),i.Rb()),2&e&&i.pc("ngValue",null)}function gd(e,t){if(1&e&&(i.Sb(0,"option",29),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.pool_name),i.yb(1),i.Pc(e.pool_name)}}function _d(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,71),i.Rb())}function yd(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",7),i.Sb(2,"label",62),i.Wb(3,63),i.Rb(),i.Sb(4,"div",10),i.Sb(5,"select",64),i.Mc(6,pd,2,1,"option",35),i.Mc(7,md,2,1,"option",35),i.Mc(8,bd,2,1,"option",35),i.Mc(9,gd,2,2,"option",14),i.Rb(),i.Mc(10,_d,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(11,"div",7),i.Sb(12,"label",65),i.Wb(13,66),i.Rb(),i.Sb(14,"div",10),i.Nb(15,"input",67),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic(),t=i.Ac(2);i.yb(6),i.pc("ngIf",null===e.pools),i.yb(1),i.pc("ngIf",null!==e.pools&&0===e.pools.length),i.yb(1),i.pc("ngIf",null!==e.pools&&e.pools.length>0),i.yb(1),i.pc("ngForOf",e.pools),i.yb(1),i.pc("ngIf",e.serviceForm.showError("pool",t,"required"))}}function vd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,75),i.Rb())}function wd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,76),i.Rb())}function Sd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,77),i.Rb())}function Md(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",7),i.Sb(2,"label",72),i.Wb(3,73),i.Rb(),i.Sb(4,"div",10),i.Nb(5,"input",74),i.Mc(6,vd,2,0,"span",15),i.Mc(7,wd,2,0,"span",15),i.Mc(8,Sd,2,0,"span",15),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic(),t=i.Ac(2);i.yb(6),i.pc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"pattern")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"min")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"max"))}}function xd(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,97),i.Rb()),2&e&&i.pc("ngValue",null)}function kd(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,98),i.Rb()),2&e&&i.pc("ngValue",null)}function Dd(e,t){1&e&&(i.Sb(0,"option",12),i.Wb(1,99),i.Rb()),2&e&&i.pc("ngValue",null)}function Td(e,t){if(1&e&&(i.Sb(0,"option",29),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.pool_name),i.yb(1),i.Pc(e.pool_name)}}function Cd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,100),i.Rb())}function Od(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,101),i.Rb())}function Rd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,102),i.Rb())}function Ld(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,103),i.Rb())}function Ed(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,104),i.Rb())}function Ad(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,105),i.Rb())}const Id=function(){return["iscsi"]};function Pd(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",7),i.Sb(2,"label",62),i.Wb(3,78),i.Rb(),i.Sb(4,"div",10),i.Sb(5,"select",64),i.Mc(6,xd,2,1,"option",35),i.Mc(7,kd,2,1,"option",35),i.Mc(8,Dd,2,1,"option",35),i.Mc(9,Td,2,2,"option",14),i.Rb(),i.Mc(10,Cd,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(11,"div",7),i.Sb(12,"label",79),i.Sb(13,"span"),i.Wb(14,80),i.Rb(),i.Sb(15,"cd-helper"),i.Sb(16,"span"),i.Wb(17,81),i.Rb(),i.Nb(18,"br"),i.Sb(19,"span"),i.cc(20,82),i.Nb(21,"b"),i.Zb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(22,"div",10),i.Nb(23,"input",83),i.Rb(),i.Rb(),i.Sb(24,"div",7),i.Sb(25,"label",84),i.Wb(26,85),i.Rb(),i.Sb(27,"div",10),i.Nb(28,"input",86),i.Mc(29,Od,2,0,"span",15),i.Mc(30,Rd,2,0,"span",15),i.Mc(31,Ld,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(32,"div",7),i.Sb(33,"label",87),i.Wb(34,88),i.Rb(),i.Sb(35,"div",10),i.Nb(36,"input",89),i.Mc(37,Ed,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(38,"div",7),i.Sb(39,"label",90),i.Wb(40,91),i.Rb(),i.Sb(41,"div",10),i.Sb(42,"div",92),i.Nb(43,"input",93),i.Sb(44,"span",94),i.Nb(45,"button",95),i.Nb(46,"cd-copy-2-clipboard-button",96),i.Rb(),i.Mc(47,Ad,2,0,"span",15),i.Rb(),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic(),t=i.Ac(2);i.yb(6),i.pc("ngIf",null===e.pools),i.yb(1),i.pc("ngIf",null!==e.pools&&0===e.pools.length),i.yb(1),i.pc("ngIf",null!==e.pools&&e.pools.length>0),i.yb(1),i.pc("ngForOf",e.pools),i.yb(1),i.pc("ngIf",e.serviceForm.showError("pool",t,"required")),i.yb(19),i.pc("ngIf",e.serviceForm.showError("api_port",t,"pattern")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("api_port",t,"min")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("api_port",t,"max")),i.yb(2),i.pc("ngClass",i.uc(13,id,i.tc(12,Id).includes(e.serviceForm.controls.service_type.value))),i.yb(4),i.pc("ngIf",e.serviceForm.showError("api_user",t,"required")),i.yb(2),i.pc("ngClass",i.uc(16,id,i.tc(15,Id).includes(e.serviceForm.controls.service_type.value))),i.yb(8),i.pc("ngIf",e.serviceForm.showError("api_password",t,"required"))}}function jd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,122),i.Rb())}function Nd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,123),i.Rb())}function Fd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,124),i.Rb())}function Yd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,125),i.Rb())}function zd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,126),i.Rb())}function $d(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,127),i.Rb())}function Hd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,128),i.Rb())}function Wd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,129),i.Rb())}function Vd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,130),i.Rb())}function Bd(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",7),i.Sb(2,"label",106),i.Sb(3,"span"),i.Wb(4,107),i.Rb(),i.Sb(5,"cd-helper"),i.Sb(6,"span"),i.Wb(7,108),i.Rb(),i.Rb(),i.Rb(),i.Sb(8,"div",10),i.Nb(9,"input",109),i.Mc(10,jd,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(11,"div",7),i.Sb(12,"label",110),i.Sb(13,"span"),i.Wb(14,111),i.Rb(),i.Sb(15,"cd-helper"),i.Sb(16,"span"),i.Wb(17,112),i.Rb(),i.Rb(),i.Rb(),i.Sb(18,"div",10),i.Nb(19,"input",113),i.Mc(20,Nd,2,0,"span",15),i.Mc(21,Fd,2,0,"span",15),i.Mc(22,Yd,2,0,"span",15),i.Mc(23,zd,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(24,"div",7),i.Sb(25,"label",114),i.Sb(26,"span"),i.Wb(27,115),i.Rb(),i.Sb(28,"cd-helper"),i.Sb(29,"span"),i.Wb(30,116),i.Rb(),i.Rb(),i.Rb(),i.Sb(31,"div",10),i.Nb(32,"input",117),i.Mc(33,$d,2,0,"span",15),i.Mc(34,Hd,2,0,"span",15),i.Mc(35,Wd,2,0,"span",15),i.Mc(36,Vd,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(37,"div",7),i.Sb(38,"label",118),i.Sb(39,"span"),i.Wb(40,119),i.Rb(),i.Sb(41,"cd-helper"),i.Sb(42,"span"),i.Wb(43,120),i.Rb(),i.Rb(),i.Rb(),i.Sb(44,"div",10),i.Nb(45,"input",121),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic(),t=i.Ac(2);i.yb(2),i.pc("ngClass",i.uc(13,id,i.tc(12,nd).includes(e.serviceForm.controls.service_type.value))),i.yb(8),i.pc("ngIf",e.serviceForm.showError("virtual_ip",t,"required")),i.yb(2),i.pc("ngClass",i.uc(16,id,i.tc(15,nd).includes(e.serviceForm.controls.service_type.value))),i.yb(8),i.pc("ngIf",e.serviceForm.showError("frontend_port",t,"pattern")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("frontend_port",t,"min")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("frontend_port",t,"max")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("frontend_port",t,"required")),i.yb(2),i.pc("ngClass",i.uc(19,id,i.tc(18,nd).includes(e.serviceForm.controls.service_type.value))),i.yb(8),i.pc("ngIf",e.serviceForm.showError("monitor_port",t,"pattern")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("monitor_port",t,"min")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("monitor_port",t,"max")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("monitor_port",t,"required"))}}function Ud(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,139),i.Rb())}function Gd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,140),i.Rb())}function qd(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",7),i.Sb(1,"label",134),i.Sb(2,"span"),i.Wb(3,135),i.Rb(),i.Sb(4,"cd-helper"),i.Wb(5,136),i.Rb(),i.Rb(),i.Sb(6,"div",10),i.Sb(7,"textarea",137),i.Oc(8,"              "),i.Rb(),i.Sb(9,"input",138),i.gc("change",(function(t){return i.Dc(e),i.ic(2).fileUpload(t.target.files,"ssl_cert")})),i.Rb(),i.Mc(10,Ud,2,0,"span",15),i.Mc(11,Gd,2,0,"span",15),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2),t=i.Ac(2);i.yb(10),i.pc("ngIf",e.serviceForm.showError("ssl_cert",t,"required")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("ssl_cert",t,"pattern"))}}function Jd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,145),i.Rb())}function Qd(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,146),i.Rb())}function Kd(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",7),i.Sb(1,"label",141),i.Sb(2,"span"),i.Wb(3,142),i.Rb(),i.Sb(4,"cd-helper"),i.Wb(5,143),i.Rb(),i.Rb(),i.Sb(6,"div",10),i.Sb(7,"textarea",144),i.Oc(8,"              "),i.Rb(),i.Sb(9,"input",138),i.gc("change",(function(t){return i.Dc(e),i.ic(2).fileUpload(t.target.files,"ssl_key")})),i.Rb(),i.Mc(10,Jd,2,0,"span",15),i.Mc(11,Qd,2,0,"span",15),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2),t=i.Ac(2);i.yb(10),i.pc("ngIf",e.serviceForm.showError("ssl_key",t,"required")),i.yb(1),i.pc("ngIf",e.serviceForm.showError("ssl_key",t,"pattern"))}}function Zd(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",7),i.Sb(2,"div",20),i.Sb(3,"div",21),i.Nb(4,"input",131),i.Sb(5,"label",132),i.Wb(6,133),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Mc(7,qd,12,2,"div",16),i.Mc(8,Kd,12,2,"div",16),i.Pb()),2&e){const e=i.ic();i.yb(7),i.pc("ngIf",e.serviceForm.controls.ssl.value),i.yb(1),i.pc("ngIf",e.serviceForm.controls.ssl.value&&"rgw"!==e.serviceForm.controls.service_type.value)}}const Xd=function(){return["mds","rgw","nfs","iscsi","ingress"]},eh=function(){return["rgw","iscsi","ingress"]};let th=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o){super(),this.actionLabels=e,this.cephServiceService=t,this.formBuilder=n,this.hostService=i,this.poolService=r,this.router=s,this.taskWrapperService=o,this.RGW_SVC_ID_PATTERN=/^([^.]+)(\.([^.]+)\.([^.]+))?$/,this.serviceTypes=[],this.labelClick=new iu.a,this.labelFocus=new iu.a,this.services=[],this.searchLabels=e=>Object(ru.a)(e.pipe(au(200),Object(du.a)()),this.labelFocus,this.labelClick.pipe(Object(hu.a)(()=>!this.typeahead.isPopupOpen()))).pipe(Object(Vi.a)(e=>this.labels.filter(t=>t.toLowerCase().indexOf(e.toLowerCase())>-1).slice(0,10))),this.resource="service",this.hosts={options:[],messages:new er.a({empty:"There are no hosts.",filter:"Filter hosts"})},this.createForm()}createForm(){this.serviceForm=this.formBuilder.group({service_type:[null,[xn.A.required]],service_id:[null,[Cn.a.requiredIf({service_type:"mds"}),Cn.a.requiredIf({service_type:"nfs"}),Cn.a.requiredIf({service_type:"iscsi"}),Cn.a.requiredIf({service_type:"ingress"}),Cn.a.composeIf({service_type:"rgw"},[xn.A.required,Cn.a.custom("rgwPattern",e=>!Nt.a.isEmpty(e)&&!this.RGW_SVC_ID_PATTERN.test(e))])]],placement:["hosts"],label:[null,[Cn.a.requiredIf({placement:"label",unmanaged:!1})]],hosts:[[]],count:[null,[Cn.a.number(!1),xn.A.min(1)]],unmanaged:[!1],pool:[null,[Cn.a.requiredIf({service_type:"nfs",unmanaged:!1}),Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],namespace:[null],rgw_frontend_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],trusted_ip_list:[null],api_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],api_user:[null,[Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],api_password:[null,[Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],backend_service:[null,[Cn.a.requiredIf({service_type:"ingress",unmanaged:!1})]],virtual_ip:[null,[Cn.a.requiredIf({service_type:"ingress",unmanaged:!1})]],frontend_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],monitor_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],virtual_interface_networks:[null],ssl:[!1],ssl_cert:["",[Cn.a.composeIf({service_type:"rgw",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.pemCert()]),Cn.a.composeIf({service_type:"iscsi",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.sslCert()])]],ssl_key:["",[Cn.a.composeIf({service_type:"iscsi",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.sslPrivKey()])]]})}ngOnInit(){this.action=this.actionLabels.CREATE,this.cephServiceService.getKnownTypes().subscribe(e=>{this.serviceTypes=Nt.a.difference(e,["container","osd"]).sort()}),this.hostService.list().subscribe(e=>{const t=[];Nt.a.forEach(e,e=>{if(Nt.a.get(e,"sources.orchestrator",!1)){const n=new Gu.a(!1,Nt.a.get(e,"hostname"),"");t.push(n)}}),this.hosts.options=[...t]}),this.hostService.getLabels().subscribe(e=>{this.labels=e}),this.poolService.getList().subscribe(e=>{this.pools=e}),this.cephServiceService.list().subscribe(e=>{this.services=e.filter(e=>"rgw"===e.service_type)})}goToListView(){this.router.navigate(["/services"])}fileUpload(e,t){const n=e[0],i=new FileReader;i.addEventListener("load",e=>{const n=this.serviceForm.get(t);n.setValue(e.target.result),n.markAsDirty(),n.markAsTouched(),n.updateValueAndValidity()}),i.readAsText(n,"utf8")}prePopulateId(){const e=this.serviceForm.get("service_id"),t=this.serviceForm.getValue("backend_service");e.reset({value:t,disabled:!0})}onSubmit(){const e=this,t=this.serviceForm.value,n=t.service_type,i={service_type:n,placement:{},unmanaged:t.unmanaged};let r;if("rgw"===n){const e=t.service_id.match(this.RGW_SVC_ID_PATTERN);r=e[1],e[3]&&(i.rgw_realm=e[3],i.rgw_zone=e[4])}else r=t.service_id;const s=r;let o=n;if(Nt.a.isString(s)&&!Nt.a.isEmpty(s)&&(o=`${n}.${s}`,i.service_id=s),!t.unmanaged){switch(t.placement){case"hosts":t.hosts.length>0&&(i.placement.hosts=t.hosts);break;case"label":i.placement.label=t.label}switch(Nt.a.isNumber(t.count)&&t.count>0&&(i.placement.count=t.count),n){case"nfs":i.pool=t.pool,Nt.a.isString(t.namespace)&&!Nt.a.isEmpty(t.namespace)&&(i.namespace=t.namespace);break;case"rgw":Nt.a.isNumber(t.rgw_frontend_port)&&t.rgw_frontend_port>0&&(i.rgw_frontend_port=t.rgw_frontend_port),i.ssl=t.ssl,t.ssl&&(i.rgw_frontend_ssl_certificate=t.ssl_cert.trim());break;case"iscsi":i.pool=t.pool,Nt.a.isString(t.trusted_ip_list)&&!Nt.a.isEmpty(t.trusted_ip_list)&&(i.trusted_ip_list=t.trusted_ip_list.trim()),Nt.a.isNumber(t.api_port)&&t.api_port>0&&(i.api_port=t.api_port),i.api_user=t.api_user,i.api_password=t.api_password,i.api_secure=t.ssl,t.ssl&&(i.ssl_cert=t.ssl_cert.trim(),i.ssl_key=t.ssl_key.trim());break;case"ingress":i.backend_service=t.backend_service,i.service_id=t.backend_service,Nt.a.isString(t.virtual_ip)&&!Nt.a.isEmpty(t.virtual_ip)&&(i.virtual_ip=t.virtual_ip.trim()),Nt.a.isNumber(t.frontend_port)&&t.frontend_port>0&&(i.frontend_port=t.frontend_port),Nt.a.isNumber(t.monitor_port)&&t.monitor_port>0&&(i.monitor_port=t.monitor_port),i.ssl=t.ssl,t.ssl&&(i.ssl_cert=t.ssl_cert.trim(),i.ssl_key=t.ssl_key.trim()),i.virtual_interface_networks=t.virtual_interface_networks}}this.taskWrapperService.wrapTaskAroundCall({task:new tr.a("service/"+gn.e.CREATE,{service_name:o}),call:this.cephServiceService.create(i)}).subscribe({error(){e.serviceForm.setErrors({cdSubmitButton:!0})},complete(){e.goToListView()}})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(zr),i.Mb(Fo.a),i.Mb(Xi),i.Mb(Uu.a),i.Mb(Pt.e),i.Mb(nr.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-service-form"]],viewQuery:function(e,t){var n;1&e&&i.Tc(Qt.G,!0),2&e&&i.zc(n=i.hc())&&(t.typeahead=n.first)},features:[i.vb],decls:46,vars:33,consts:function(){return[[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","service_type",1,"cd-col-form-label","required"],"Type",[1,"cd-col-form-input"],["id","service_type","name","service_type","formControlName","service_type",1,"form-control","custom-select"],[3,"ngValue"],"-- Select a service type --",[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],["for","service_id",1,"cd-col-form-label",3,"ngClass"],"Id",["id","service_id","type","text","formControlName","service_id",1,"form-control"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","unmanaged","type","checkbox","formControlName","unmanaged",1,"custom-control-input"],["for","unmanaged",1,"custom-control-label"],"Unmanaged",[4,"ngIf"],[1,"card-footer"],[1,"text-right"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],"This field is required.",["for","backend_service",1,"cd-col-form-label",3,"ngClass"],"Backend Service",["id","backend_service","name","backend_service","formControlName","backend_service",1,"form-control","custom-select",3,"change"],[3,"ngValue",4,"ngIf"],"Loading...","-- No service available --","-- Select an existing RGW service --","This field is required.","This field is required.","The value does not match the pattern " + "\ufffd#2\ufffd" + "<service_id>[.<realm_name>.<zone_name>]" + "\ufffd/#2\ufffd" + ".",["for","placement",1,"cd-col-form-label"],"Placement",["id","placement","formControlName","placement",1,"form-control","custom-select"],["value","hosts"],"Hosts",["value","label"],"Label",["for","label",1,"cd-col-form-label"],"Label",["id","label","type","text","formControlName","label",1,"form-control",3,"ngbTypeahead","focus","click"],"This field is required.",["for","hosts",1,"cd-col-form-label"],"Hosts",["id","hosts",3,"data","options","messages"],["for","count",1,"cd-col-form-label"],"Count","Only that number of daemons will be created.",["id","count","type","number","formControlName","count","min","1",1,"form-control"],"The value must be at least 1.","The entered value needs to be a number.",["for","pool",1,"cd-col-form-label","required"],"Pool",["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],["for","namespace",1,"cd-col-form-label"],"Namespace",["id","namespace","type","text","formControlName","namespace",1,"form-control"],"Loading...","-- No pools available --","-- Select a pool --","This field is required.",["for","rgw_frontend_port",1,"cd-col-form-label"],"Port",["id","rgw_frontend_port","type","number","formControlName","rgw_frontend_port","min","1","max","65535",1,"form-control"],"The entered value needs to be a number.","The value must be at least 1.","The value cannot exceed 65535.","Pool",["for","trusted_ip_list",1,"cd-col-form-label"],"Trusted IPs","Comma separated list of IP addresses.","Please add the " + "\ufffd#21\ufffd" + "Ceph Manager" + "\ufffd/#21\ufffd" + " IP addresses here, otherwise the iSCSI gateways can't be reached.",["id","trusted_ip_list","type","text","formControlName","trusted_ip_list",1,"form-control"],["for","api_port",1,"cd-col-form-label"],"Port",["id","api_port","type","number","formControlName","api_port","min","1","max","65535",1,"form-control"],["for","api_user",1,"cd-col-form-label",3,"ngClass"],"User",["id","api_user","type","text","formControlName","api_user",1,"form-control"],["for","api_password",1,"cd-col-form-label",3,"ngClass"],"Password",[1,"input-group"],["id","api_password","type","password","autocomplete","new-password","formControlName","api_password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","api_password",1,"btn","btn-light"],["source","api_password"],"Loading...","-- No pools available --","-- Select a pool --","This field is required.","The entered value needs to be a number.","The value must be at least 1.","The value cannot exceed 65535.","This field is required.","This field is required.",["for","virtual_ip",1,"cd-col-form-label",3,"ngClass"],"Virtual IP","The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.",["id","virtual_ip","type","text","formControlName","virtual_ip",1,"form-control"],["for","frontend_port",1,"cd-col-form-label",3,"ngClass"],"Frontend Port","The port used to access the ingress service.",["id","frontend_port","type","number","formControlName","frontend_port","min","1","max","65535",1,"form-control"],["for","monitor_port",1,"cd-col-form-label",3,"ngClass"],"Monitor Port","The port used by haproxy for load balancer status.",["id","monitor_port","type","number","formControlName","monitor_port","min","1","max","65535",1,"form-control"],["for","virtual_interface_networks",1,"cd-col-form-label"],"CIDR Networks","A list of networks to identify which network interface to use for the virtual IP address.",["id","virtual_interface_networks","type","text","formControlName","virtual_interface_networks",1,"form-control"],"This field is required.","The entered value needs to be a number.","The value must be at least 1.","The value cannot exceed 65535.","This field is required.","The entered value needs to be a number.","The value must be at least 1.","The value cannot exceed 65535.","This field is required.",["id","ssl","type","checkbox","formControlName","ssl",1,"custom-control-input"],["for","ssl",1,"custom-control-label"],"SSL",["for","ssl_cert",1,"cd-col-form-label"],"Certificate","The SSL certificate in PEM format.",["id","ssl_cert","formControlName","ssl_cert","rows","5",1,"form-control","resize-vertical","text-monospace","text-pre"],["type","file",3,"change"],"This field is required.","Invalid SSL certificate.",["for","ssl_key",1,"cd-col-form-label"],"Private key","The SSL private key in PEM format.",["id","ssl_key","formControlName","ssl_key","rows","5",1,"form-control","resize-vertical","text-monospace","text-pre"],"This field is required.","Invalid SSL private key."]},template:function(e,t){if(1&e&&(i.Sb(0,"div",0),i.Sb(1,"form",1,2),i.Sb(3,"div",3),i.Sb(4,"div",4),i.Wb(5,5),i.jc(6,"titlecase"),i.jc(7,"upperFirst"),i.Rb(),i.Sb(8,"div",6),i.Sb(9,"div",7),i.Sb(10,"label",8),i.Wb(11,9),i.Rb(),i.Sb(12,"div",10),i.Sb(13,"select",11),i.Sb(14,"option",12),i.Wb(15,13),i.Rb(),i.Mc(16,Ju,2,2,"option",14),i.Rb(),i.Mc(17,Qu,2,0,"span",15),i.Rb(),i.Rb(),i.Mc(18,rd,10,9,"div",16),i.Sb(19,"div",7),i.Sb(20,"label",17),i.Wb(21,18),i.Rb(),i.Sb(22,"div",10),i.Nb(23,"input",19),i.Mc(24,sd,2,0,"span",15),i.Mc(25,od,3,0,"span",15),i.Rb(),i.Rb(),i.Sb(26,"div",7),i.Sb(27,"div",20),i.Sb(28,"div",21),i.Nb(29,"input",22),i.Sb(30,"label",23),i.Wb(31,24),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Mc(32,ad,9,0,"div",16),i.Mc(33,ld,6,2,"div",16),i.Mc(34,ud,5,3,"div",16),i.Mc(35,fd,10,2,"div",16),i.Mc(36,yd,16,5,"ng-container",25),i.Mc(37,Md,9,3,"ng-container",25),i.Mc(38,Pd,48,18,"ng-container",25),i.Mc(39,Bd,46,21,"ng-container",25),i.Mc(40,Zd,9,2,"ng-container",25),i.Rb(),i.Sb(41,"div",26),i.Sb(42,"div",27),i.Sb(43,"cd-form-button-panel",28),i.gc("submitActionEvent",(function(){return t.onSubmit()})),i.jc(44,"titlecase"),i.jc(45,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(2);i.yb(1),i.pc("formGroup",t.serviceForm),i.yb(6),i.ac(i.kc(6,21,t.action))(i.kc(7,23,t.resource)),i.Xb(5),i.yb(7),i.pc("ngValue",null),i.yb(2),i.pc("ngForOf",t.serviceTypes),i.yb(1),i.pc("ngIf",t.serviceForm.showError("service_type",e,"required")),i.yb(1),i.pc("ngIf","ingress"===t.serviceForm.controls.service_type.value),i.yb(2),i.pc("ngClass",i.uc(30,id,i.tc(29,Xd).includes(t.serviceForm.controls.service_type.value))),i.yb(4),i.pc("ngIf",t.serviceForm.showError("service_id",e,"required")),i.yb(1),i.pc("ngIf",t.serviceForm.showError("service_id",e,"rgwPattern")),i.yb(7),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"label"===t.serviceForm.controls.placement.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"hosts"===t.serviceForm.controls.placement.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"nfs"===t.serviceForm.controls.service_type.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"rgw"===t.serviceForm.controls.service_type.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"iscsi"===t.serviceForm.controls.service_type.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&"ingress"===t.serviceForm.controls.service_type.value),i.yb(1),i.pc("ngIf",!t.serviceForm.controls.unmanaged.value&&i.tc(32,eh).includes(t.serviceForm.controls.service_type.value)),i.yb(3),i.pc("form",t.serviceForm)("submitText",i.kc(44,25,t.action)+" "+i.kc(45,27,t.resource))}},directives:[xn.C,xn.r,Zn.a,xn.k,Xn.a,On.a,xn.z,ei.a,xn.q,xn.i,xn.u,xn.B,o.q,o.r,o.p,xn.d,xn.b,ti.a,Qt.G,rr.a,Yo.a,xn.v,qu.a,go.a],pipes:[o.A,sr.a],styles:[""]}),e})();var nh=n("3E0/");let ih=(()=>{class e{transform(e){if(Nt.a.isUndefined(e))return "no spec";if(Nt.a.get(e,"unmanaged",!1))return "unmanaged";const t=[],n=Nt.a.get(e,"placement.hosts"),i=Nt.a.get(e,"placement.count"),r=Nt.a.get(e,"placement.label"),s=Nt.a.get(e,"placement.host_pattern");return Nt.a.isArray(n)&&t.push(...n),Nt.a.isNumber(i)&&t.push("count:" + i + ""),Nt.a.isString(r)&&t.push("label:" + r + ""),Nt.a.isString(s)&&t.push(s),t.join(";")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"placement",type:e,pure:!0}),e})();function rh(e,t){if(1&e&&(i.Qb(0),i.Nb(1,"cd-service-daemon-list",1),i.Pb()),2&e){const e=i.ic();i.yb(1),i.pc("serviceName",e.selection.service_name)}}let sh=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-service-details"]],inputs:{permissions:"permissions",selection:"selection"},decls:1,vars:1,consts:[[4,"ngIf"],[3,"serviceName"]],template:function(e,t){1&e&&i.Mc(0,rh,2,1,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,cs],styles:[""]}),e})();function oh(e,t){1&e&&i.Nb(0,"cd-orchestrator-doc-panel")}function ah(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"cd-table",1),i.gc("fetchData",(function(t){return i.Dc(e),i.ic().getServices(t)}))("setExpandedRow",(function(t){return i.Dc(e),i.ic().setExpandedRow(t)}))("updateSelection",(function(t){return i.Dc(e),i.ic().updateSelection(t)})),i.Nb(2,"cd-table-actions",2),i.Nb(3,"cd-service-details",3),i.Rb(),i.Pb()}if(2&e){const e=i.ic();i.yb(1),i.pc("data",e.services)("columns",e.columns)("autoReload",5e3)("hasDetails",!0),i.yb(1),i.pc("permission",e.permissions.hosts)("selection",e.selection)("tableActions",e.tableActions),i.yb(1),i.pc("permissions",e.permissions)("selection",e.expandedRow)}}let ch=(()=>{class e extends $t.a{constructor(e,t,n,i,r,s,o,a){super(),this.actionLabels=e,this.authStorageService=t,this.modalService=n,this.orchService=i,this.cephServiceService=r,this.relativeDatePipe=s,this.taskWrapperService=o,this.urlBuilder=a,this.hiddenColumns=[],this.showDocPanel=!1,this.actionOrchFeatures={create:[hr.SERVICE_CREATE],delete:[hr.SERVICE_DELETE]},this.columns=[],this.services=[],this.isLoadingServices=!1,this.selection=new Wt.a,this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{permission:"create",icon:_n.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection,disable:e=>this.getDisable("create",e)},{permission:"delete",icon:_n.a.destroy,click:()=>this.deleteAction(),name:this.actionLabels.DELETE,disable:e=>this.getDisable("delete",e)}]}ngOnInit(){const e=[{name:"Service",prop:"service_name",flexGrow:1},{name:"Placement",prop:"",pipe:new ih,flexGrow:2},{name:"Running",prop:"status.running",flexGrow:1},{name:"Size",prop:"status.size",flexGrow:1},{name:"Last Refreshed",prop:"status.last_refresh",pipe:this.relativeDatePipe,flexGrow:1}];this.columns=e.filter(e=>!this.hiddenColumns.includes(e.prop)),this.orchService.status().subscribe(e=>{this.orchStatus=e,this.showDocPanel=!e.available})}ngOnChanges(){var e;(null===(e=this.orchStatus)||void 0===e?void 0:e.available)&&(this.services=[],this.table.reloadData())}getDisable(e,t){return"delete"===e&&!(null==t?void 0:t.hasSingleSelection)||this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}getServices(e){this.isLoadingServices||(this.isLoadingServices=!0,this.cephServiceService.list().subscribe(e=>{this.services=e,this.isLoadingServices=!1},()=>{this.isLoadingServices=!1,this.services=[],e.error()}))}updateSelection(e){this.selection=e}deleteAction(){const e=this.selection.first();this.modalService.show(bn.a,{itemDescription:"Service",itemNames:[e.service_name],actionDescription:"delete",submitActionObservable:()=>this.taskWrapperService.wrapTaskAroundCall({task:new tr.a("service/"+gn.e.DELETE,{service_name:e.service_name}),call:this.cephServiceService.delete(e.service_name)}).pipe(Object(nh.a)(5e3))})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Jt.a),i.Mb(vn.a),i.Mb(dr),i.Mb(zr),i.Mb($r.a),i.Mb(nr.a),i.Mb(pr.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-services"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Bt.a,!0),2&e&&i.zc(n=i.hc())&&(t.table=n.first)},inputs:{hostname:"hostname",hiddenColumns:"hiddenColumns"},features:[i.xb([{provide:pr.a,useValue:new pr.a("services")}]),i.vb,i.wb],decls:2,vars:2,consts:[[4,"ngIf"],["identifier","service_name","forceIdentifier","true","columnMode","flex","selectionType","single",3,"data","columns","autoReload","hasDetails","fetchData","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"permissions","selection"]],template:function(e,t){1&e&&(i.Mc(0,oh,1,0,"cd-orchestrator-doc-panel",0),i.Mc(1,ah,4,9,"ng-container",0)),2&e&&(i.pc("ngIf",t.showDocPanel),i.yb(1),i.pc("ngIf",null==t.orchStatus?null:t.orchStatus.available))},directives:[o.r,Ar,Bt.a,Sn.a,sh],styles:[""]}),e})(),lh=(()=>{class e{constructor(e){this.http=e,this.url="api/telemetry"}getReport(){return this.http.get(this.url+"/report")}enable(e=!0){const t={enable:e};return e&&(t.license_name="sharing-1-0"),this.http.put(""+this.url,t)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),uh=(()=>{class e{constructor(){this.visible=!1,this.update=new i.o}setVisibility(e){this.visible=e,this.update.emit(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function dh(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div"),i.Oc(1," The plugin is already "),i.Sb(2,"b"),i.Oc(3,"enabled"),i.Rb(),i.Oc(4,". Click "),i.Sb(5,"b"),i.Oc(6,"Deactivate"),i.Rb(),i.Oc(7," to disable it.\xa0 "),i.Sb(8,"button",71),i.gc("click",(function(){return i.Dc(e),i.ic(3).disableModule("The Telemetry module has been disabled successfully.")})),i.Wb(9,72),i.Rb(),i.Rb()}}function hh(e,t){1&e&&(i.Sb(0,"span",73),i.Wb(1,74),i.Rb())}function fh(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div"),i.Sb(1,"form",4,5),i.Sb(3,"div",6),i.Sb(4,"div",7),i.Wb(5,8),i.Rb(),i.Sb(6,"div",9),i.Sb(7,"p"),i.cc(8,10),i.Nb(9,"br"),i.Nb(10,"a",11),i.Nb(11,"br"),i.Nb(12,"br"),i.Nb(13,"b"),i.Zb(),i.Rb(),i.Mc(14,dh,10,0,"div",12),i.Sb(15,"legend"),i.Wb(16,13),i.Rb(),i.Sb(17,"p"),i.Wb(18,14),i.Rb(),i.Sb(19,"div",15),i.Sb(20,"label",16),i.Qb(21),i.Wb(22,17),i.Pb(),i.Sb(23,"cd-helper"),i.Qb(24),i.Wb(25,18),i.Pb(),i.Sb(26,"ul"),i.Sb(27,"li"),i.Wb(28,19),i.Rb(),i.Sb(29,"li"),i.Wb(30,20),i.Rb(),i.Sb(31,"li"),i.Wb(32,21),i.Rb(),i.Sb(33,"li"),i.Wb(34,22),i.Rb(),i.Sb(35,"li"),i.Wb(36,23),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(37,"div",24),i.Sb(38,"div",25),i.Nb(39,"input",26),i.Nb(40,"label",27),i.Rb(),i.Rb(),i.Rb(),i.Sb(41,"div",15),i.Sb(42,"label",28),i.Qb(43),i.Wb(44,29),i.Pb(),i.Sb(45,"cd-helper"),i.Qb(46),i.Wb(47,30),i.Pb(),i.Sb(48,"ul"),i.Sb(49,"li"),i.Wb(50,31),i.Rb(),i.Sb(51,"li"),i.Wb(52,32),i.Rb(),i.Sb(53,"li"),i.Wb(54,33),i.Rb(),i.Sb(55,"li"),i.Wb(56,34),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(57,"div",24),i.Sb(58,"div",25),i.Nb(59,"input",35),i.Nb(60,"label",36),i.Rb(),i.Rb(),i.Rb(),i.Sb(61,"div",15),i.Sb(62,"label",37),i.Qb(63),i.Wb(64,38),i.Pb(),i.Sb(65,"cd-helper",39),i.Yb(66,40),i.Rb(),i.Rb(),i.Sb(67,"div",24),i.Sb(68,"div",25),i.Nb(69,"input",41),i.Nb(70,"label",42),i.Rb(),i.Rb(),i.Rb(),i.Sb(71,"div",15),i.Sb(72,"label",43),i.Qb(73),i.Wb(74,44),i.Pb(),i.Sb(75,"cd-helper"),i.Qb(76),i.Wb(77,45),i.Pb(),i.Sb(78,"ul"),i.Sb(79,"li"),i.Oc(80,"Cluster description"),i.Rb(),i.Sb(81,"li"),i.Oc(82,"Contact email address"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(83,"div",24),i.Sb(84,"div",25),i.Nb(85,"input",46),i.Nb(86,"label",47),i.Rb(),i.Rb(),i.Rb(),i.Sb(87,"legend"),i.Qb(88),i.Wb(89,48),i.Pb(),i.Sb(90,"cd-helper"),i.Wb(91,49),i.Rb(),i.Rb(),i.Sb(92,"div",15),i.Sb(93,"label",50),i.Wb(94,51),i.Rb(),i.Sb(95,"div",24),i.Nb(96,"input",52),i.Rb(),i.Rb(),i.Sb(97,"div",15),i.Sb(98,"label",53),i.Wb(99,54),i.Rb(),i.Sb(100,"div",24),i.Sb(101,"input",55),i.Yb(102,56),i.Rb(),i.Rb(),i.Rb(),i.Sb(103,"legend"),i.Wb(104,57),i.Rb(),i.Sb(105,"div",15),i.Sb(106,"label",58),i.Qb(107),i.Wb(108,59),i.Pb(),i.Sb(109,"cd-helper"),i.Wb(110,60),i.Rb(),i.Rb(),i.Sb(111,"div",24),i.Nb(112,"input",61),i.Mc(113,hh,2,0,"span",62),i.Rb(),i.Rb(),i.Sb(114,"div",15),i.Sb(115,"label",63),i.Qb(116),i.Wb(117,64),i.Pb(),i.Sb(118,"cd-helper"),i.Sb(119,"p"),i.Wb(120,65),i.Rb(),i.Sb(121,"p"),i.Wb(122,66),i.Rb(),i.Rb(),i.Rb(),i.Sb(123,"div",24),i.Nb(124,"input",67),i.Rb(),i.Rb(),i.Nb(125,"br"),i.Sb(126,"p"),i.cc(127,68),i.Nb(128,"b"),i.Zb(),i.Rb(),i.Rb(),i.Sb(129,"div",69),i.Sb(130,"div",70),i.Sb(131,"button",71),i.gc("click",(function(){return i.Dc(e),i.ic(2).next()})),i.Qb(132),i.Oc(133),i.Pb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(2),t=i.ic(2);i.yb(1),i.pc("formGroup",t.configForm),i.yb(4),i.ac(t.step),i.Xb(5),i.yb(8),i.ac(t.sendToUrl)(t.sendToDeviceUrl),i.Xb(8),i.yb(1),i.pc("ngIf",t.moduleEnabled),i.yb(99),i.pc("ngIf",t.configForm.showError("interval",e,"min")),i.yb(20),i.Pc(t.actionLabels.NEXT)}}function ph(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div"),i.Sb(1,"form",75,76),i.Sb(3,"div",6),i.Sb(4,"div",7),i.Wb(5,77),i.Rb(),i.Sb(6,"div",9),i.Sb(7,"div",15),i.Sb(8,"label",78),i.cc(9,79),i.Sb(10,"cd-helper",39),i.Yb(11,80),i.Rb(),i.Zb(),i.Rb(),i.Sb(12,"div",24),i.Nb(13,"input",81),i.Rb(),i.Rb(),i.Sb(14,"div",15),i.Sb(15,"label",82),i.cc(16,83),i.Sb(17,"cd-helper",39),i.Yb(18,84),i.Rb(),i.Zb(),i.Rb(),i.Sb(19,"div",24),i.Nb(20,"textarea",85),i.Rb(),i.Rb(),i.Sb(21,"div",15),i.Sb(22,"div",86),i.Sb(23,"div",87),i.Nb(24,"cd-download-button",88),i.Nb(25,"cd-copy-2-clipboard-button",89),i.Rb(),i.Rb(),i.Rb(),i.Sb(26,"div",15),i.Sb(27,"div",86),i.Sb(28,"div",25),i.Nb(29,"input",90),i.Sb(30,"label",91),i.cc(31,92),i.Nb(32,"a",93),i.Zb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(33,"div",69),i.Sb(34,"div",70),i.Sb(35,"cd-form-button-panel",94),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic(2).onSubmit()}))("backActionEvent",(function(){return i.Dc(e),i.ic(2).back()})),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic(2);i.yb(1),i.pc("formGroup",e.previewForm),i.yb(4),i.ac(e.step),i.Xb(5),i.yb(19),i.pc("objectItem",e.report),i.yb(11),i.pc("form",e.previewForm)("submitText",e.actionLabels.UPDATE)("cancelText",e.actionLabels.BACK)}}function mh(e,t){if(1&e&&(i.Sb(0,"div",1),i.Qb(1,2),i.Mc(2,fh,134,7,"div",3),i.Mc(3,ph,36,6,"div",3),i.Pb(),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngSwitch",e.step),i.yb(1),i.pc("ngSwitchCase",1),i.yb(1),i.pc("ngSwitchCase",2)}}let bh=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o){super(),this.actionLabels=e,this.formBuilder=t,this.mgrModuleService=n,this.notificationService=i,this.router=r,this.telemetryService=s,this.telemetryNotificationService=o,this.licenseAgrmt=!1,this.options={},this.requiredFields=["channel_basic","channel_crash","channel_device","channel_ident","interval","proxy","contact","description"],this.report=void 0,this.reportId=void 0,this.sendToUrl="",this.sendToDeviceUrl="",this.step=1}ngOnInit(){const e=[this.mgrModuleService.getOptions("telemetry"),this.mgrModuleService.getConfig("telemetry")];Object(jo.a)(e).subscribe(e=>{const t=e[1];this.moduleEnabled=t.enabled,this.sendToUrl=t.url,this.sendToDeviceUrl=t.device_url,this.options=Nt.a.pick(e[0],this.requiredFields);const n=Nt.a.pick(t,this.requiredFields);this.createConfigForm(),this.configForm.setValue(n),this.loadingReady()},e=>{this.loadingError()})}createConfigForm(){const e={};Nt.a.forEach(Object.values(this.options),t=>{e[t.name]=[t.default_value,this.getValidators(t)]}),this.configForm=this.formBuilder.group(e)}createPreviewForm(){const e={report:JSON.stringify(this.report,null,2),reportId:this.reportId,licenseAgrmt:[this.licenseAgrmt,xn.A.requiredTrue]};this.previewForm=this.formBuilder.group(e)}getValidators(e){const t=[];switch(e.type){case"int":t.push(Cn.a.number()),t.push(xn.A.required),Nt.a.isNumber(e.min)&&t.push(xn.A.min(e.min)),Nt.a.isNumber(e.max)&&t.push(xn.A.max(e.max));break;case"str":Nt.a.isNumber(e.min)&&t.push(xn.A.minLength(e.min)),Nt.a.isNumber(e.max)&&t.push(xn.A.maxLength(e.max))}return t}getReport(){this.loadingStart(),this.telemetryService.getReport().subscribe(e=>{this.report=e,this.reportId=e.report.report_id,this.createPreviewForm(),this.loadingReady(),this.step++},e=>{this.loadingError()})}updateConfig(){const e={};Nt.a.forEach(Object.values(this.options),t=>{const n=this.configForm.get(t.name);n.dirty&&n.valid&&(e[t.name]=n.value)}),this.mgrModuleService.updateConfig("telemetry",e).subscribe(()=>{this.disableModule("Your settings have been applied successfully.  Due to privacy/legal reasons the Telemetry module is now disabled until you  complete the next step and accept the license.",()=>{this.getReport()})},()=>{this.configForm.setErrors({cdSubmitButton:!0})})}disableModule(e=null,t=null){this.telemetryService.enable(!1).subscribe(()=>{this.telemetryNotificationService.setVisibility(!0),e&&this.notificationService.show(yn.a.success,e),t?t():this.router.navigate([""])})}next(){this.configForm.pristine?this.getReport():this.updateConfig()}back(){this.step--}onSubmit(){this.telemetryService.enable().subscribe(()=>{this.telemetryNotificationService.setVisibility(!1),this.notificationService.show(yn.a.success,"The Telemetry module has been configured and activated successfully."),this.router.navigate([""])})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(Fo.a),i.Mb(No),i.Mb(wn.a),i.Mb(Pt.e),i.Mb(lh),i.Mb(uh))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-telemetry"]],features:[i.vb],decls:1,vars:1,consts:function(){var e,t,n,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,y,v,w,S,M,x,k,D,T,C,O,R,L,E,A,I,P,j,N,F,Y;return e="Step " + "\ufffd0\ufffd" + " of 2: Telemetry report configuration",t="The telemetry module sends anonymous data about this Ceph cluster back to the Ceph developers to help understand how Ceph is used and what problems users may be experiencing." + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + " This data is visualized on " + "\ufffd#10\ufffd" + "public dashboards" + "\ufffd/#10\ufffd" + " that allow the community to quickly see summary statistics on how many clusters are reporting, their total capacity and OSD count, and version distribution trends." + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + "" + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + " The data being reported does " + "\ufffd#13\ufffd" + "not" + "\ufffd/#13\ufffd" + " contain any sensitive data like pool names, object names, object contents, hostnames, or device serial numbers. It contains counters and statistics on how the cluster has been deployed, the version of Ceph, the distribution of the hosts and other parameters which help the project to gain a better understanding of the way Ceph is used. The data is sent secured to " + "\ufffd0\ufffd" + " and " + "\ufffd1\ufffd" + " (device report).",t=i.bc(t),n="Channels",r="The telemetry report is broken down into several \"channels\", each with a different type of information that can be configured below.",s="Basic",o="Includes basic information about the cluster:",a="Capacity of the cluster",c="Number of monitors, managers, OSDs, MDSs, object gateways, or other daemons",l="Software version currently being used",u="Number and types of RADOS pools and CephFS file systems",d="Names of configuration options that have been changed from their default (but not their values)",h="Crash",f="Includes information about daemon crashes:",p="Type of daemon",m="Version of the daemon",b="Operating system (OS distribution, kernel version)",g="Stack trace identifying where in the Ceph code the crash occurred",_="Device",y="Includes information about device metrics like anonymized SMART metrics.",v="Ident",w="Includes user-provided identifying information about the cluster:",S="Contact Information",M="Submitting any contact information is completely optional and disabled by default.",x="Contact",k="Description",D="My first Ceph cluster",T="Advanced Settings",C="Interval",O="The module compiles and sends a new report every 24 hours by default. You can adjust this interval by setting a different number of hours.",R="Proxy",L="If the cluster cannot directly connect to the configured telemetry endpoint (default telemetry.ceph.com), you can configure a HTTP/HTTPS proxy server by e.g. adding https://10.0.0.1:8080",E="You can also include a user:pass if needed e.g. https://ceph:telemetry@10.0.0.1:8080",A="" + "\ufffd#128\ufffd" + "Note:" + "\ufffd/#128\ufffd" + " By clicking 'Next' you will first see a preview of the report content before you can activate the automatic submission of your data.",I="Deactivate",P="The entered value is too low! It must be greater or equal to 8.",j="Step " + "\ufffd0\ufffd" + " of 2: Telemetry report preview",N="A randomized UUID to identify a particular cluster over the course of several telemetry reports.",F="Report ID " + "\ufffd#10\ufffd" + "" + "\ufffd/#10\ufffd" + "",Y="The actual telemetry data that will be submitted.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],[3,"ngSwitch"],[4,"ngSwitchCase"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],t,["href","https://telemetry-public.ceph.com/"],[4,"ngIf"],n,r,[1,"form-group","row"],["for","channel_basic",1,"cd-col-form-label"],s,o,a,c,l,u,d,[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","channel_basic","formControlName","channel_basic",1,"custom-control-input"],["for","channel_basic",1,"custom-control-label"],["for","channel_crash",1,"cd-col-form-label"],h,f,p,m,b,g,["type","checkbox","id","channel_crash","formControlName","channel_crash",1,"custom-control-input"],["for","channel_crash",1,"custom-control-label"],["for","channel_device",1,"cd-col-form-label"],_,[6,"html"],["html",y],["type","checkbox","id","channel_device","formControlName","channel_device",1,"custom-control-input"],["for","channel_device",1,"custom-control-label"],["for","channel_ident",1,"cd-col-form-label"],v,w,["type","checkbox","id","channel_ident","formControlName","channel_ident",1,"custom-control-input"],["for","channel_ident",1,"custom-control-label"],S,M,["for","contact",1,"cd-col-form-label"],x,["id","contact","type","text","formControlName","contact","placeholder","Example User <user@example.com>",1,"form-control"],["for","description",1,"cd-col-form-label"],k,["id","description","type","text","formControlName","description",1,"form-control",6,"placeholder"],["placeholder",D],T,["for","interval",1,"cd-col-form-label"],C,O,["id","interval","type","number","formControlName","interval",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","proxy",1,"cd-col-form-label"],R,L,E,["id","proxy","type","text","formControlName","proxy","placeholder","https://10.0.0.1:8080",1,"form-control"],A,[1,"card-footer"],[1,"button-group","text-right"],["type","button",1,"btn","btn-light",3,"click"],I,[1,"invalid-feedback"],P,["name","previewForm","novalidate","",3,"formGroup"],["frm","ngForm"],j,["for","reportId",1,"cd-col-form-label"],F,["html",N],["type","text","id","reportId","formControlName","reportId","readonly","",1,"form-control"],["for","report",1,"cd-col-form-label"],"Report preview " + "\ufffd#17\ufffd" + "" + "\ufffd/#17\ufffd" + "",["html",Y],["id","report","formControlName","report","rows","15","readonly","",1,"form-control"],[1,"cd-col-form-offset"],["role","group",1,"btn-group"],["fileName","telemetry_report",3,"objectItem"],["source","report"],["type","checkbox","id","licenseAgrmt","name","licenseAgrmt","formControlName","licenseAgrmt",1,"custom-control-input"],["for","licenseAgrmt",1,"custom-control-label"],"I agree to my telemetry data being submitted under the " + "\ufffd#32\ufffd" + "Community Data License Agreement - Sharing - Version 1.0" + "\ufffd/#32\ufffd" + "",["href","https://cdla.io/sharing-1-0/"],[3,"form","submitText","cancelText","submitActionEvent","backActionEvent"]]},template:function(e,t){1&e&&i.Mc(0,mh,4,3,"div",0),2&e&&i.pc("cdFormLoading",t.loading)},directives:[Kn.a,o.t,o.u,xn.C,xn.r,Zn.a,xn.k,o.r,Xn.a,Yo.a,On.a,xn.b,ei.a,xn.q,xn.i,xn.d,xn.v,bo,go.a,ti.a],styles:[""]}),e})();var gh=n("2Vo4"),_h=n("Y7HM");function yh(e){const{subscriber:t,counter:n,period:i}=e;t.next(n),this.schedule({subscriber:t,counter:n+1,period:i},i)}let vh=(()=>{class e{constructor(e){this.ngZone=e,this.intervalDataSource=new gh.a(null),this.intervalData$=this.intervalDataSource.asObservable();const t=parseInt(sessionStorage.getItem("dashboard_interval"),10)||5e3;this.setRefreshInterval(t)}setRefreshInterval(e){this.intervalTime=e,sessionStorage.setItem("dashboard_interval",e.toString()),this.intervalSubscription&&this.intervalSubscription.unsubscribe(),this.ngZone.runOutsideAngular(()=>{this.intervalSubscription=function(e=0,t=ou.a){return(!Object(_h.a)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=ou.a),new $u.a(n=>(n.add(t.schedule(yh,e,{subscriber:n,counter:0,period:e})),n))}(this.intervalTime).subscribe(()=>this.ngZone.run(()=>{this.intervalDataSource.next(this.intervalTime)}))})}getRefreshInterval(){return this.intervalTime}ngOnDestroy(){this.intervalSubscription&&this.intervalSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(i.A))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function wh(e,t){if(1&e&&(i.Sb(0,"option",8),i.Oc(1),i.Rb()),2&e){const e=t.$implicit,n=i.ic();i.pc("value",n.intervalList[e]),i.yb(1),i.Pc(e)}}let Sh=(()=>{class e{constructor(e){this.refreshIntervalService=e,this.intervalList={"5 s":5e3,"10 s":1e4,"15 s":15e3,"30 s":3e4,"1 min":6e4,"3 min":18e4,"5 min":3e5},this.intervalKeys=Object.keys(this.intervalList)}ngOnInit(){this.selectedInterval=this.refreshIntervalService.getRefreshInterval()||5e3}changeRefreshInterval(e){this.refreshIntervalService.setRefreshInterval(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(vh))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-refresh-selector"]],decls:8,vars:2,consts:function(){return[[1,"container-fluid"],[1,"row"],[1,"col","d-flex","justify-content-end"],[1,"form-inline"],["for","refreshInterval",1,"col-form-label","my-0","mx-2"],"Refresh",["id","refreshInterval","name","refreshInterval",1,"form-control","custom-select",3,"ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"div",2),i.Sb(3,"form",3),i.Sb(4,"label",4),i.Wb(5,5),i.Rb(),i.Sb(6,"select",6),i.gc("change",(function(e){return t.changeRefreshInterval(e.target.value)}))("ngModelChange",(function(e){return t.selectedInterval=e})),i.Mc(7,wh,2,2,"option",7),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(6),i.pc("ngModel",t.selectedInterval),i.yb(1),i.pc("ngForOf",t.intervalKeys))},directives:[xn.C,xn.r,xn.s,On.a,xn.z,ei.a,xn.q,xn.t,o.q,xn.u,xn.B],styles:[""]}),e})();var Mh=n("d+Og");let xh=(()=>{class e{constructor(e){this.http=e}getFullHealth(){return this.http.get("api/health/full")}getMinimalHealth(){return this.http.get("api/health/minimal")}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var kh=n("TKcr"),Dh=n("ej+x");function Th(e,t){if(1&e&&(i.Sb(0,"div",6),i.cc(1,7),i.jc(2,"lowercase"),i.Sb(3,"cd-doc",8),i.Yb(4,9),i.jc(5,"lowercase"),i.Rb(),i.Zb(),i.Rb()),2&e){const e=i.ic();i.yb(3),i.rc("section","dashboard-landing-page-",i.kc(5,4,e.groupTitle),""),i.yb(2),i.ac(i.kc(2,2,e.groupTitle)),i.Xb(1)}}const Ch=function(e,t){return[e,t]},Oh=["*"];let Rh=(()=>{class e{constructor(){this.icons=_n.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-info-group"]],inputs:{groupTitle:"groupTitle"},ngContentSelectors:Oh,decls:11,vars:6,consts:function(){var e;return e="here",[[1,"row"],["triggers","",1,"info-group-title",3,"ngbPopover"],["popInfo","ngbPopover"],["type","button",1,"popover-icon","btn","btn-link","p-0",3,"click"],[3,"ngClass"],["popInfoTemplate",""],[1,"text-center"],"For an overview of " + "\ufffd0\ufffd" + " widgets click " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + "",[3,"section",6,"docText"],["docText",e]]},template:function(e,t){if(1&e){const e=i.Tb();i.oc(),i.Sb(0,"div",0),i.Sb(1,"div",1,2),i.Sb(3,"span"),i.Oc(4),i.Rb(),i.Sb(5,"button",3),i.gc("click",(function(){return i.Dc(e),i.Ac(2).toggle()})),i.Nb(6,"i",4),i.Rb(),i.Rb(),i.Rb(),i.Sb(7,"div",0),i.nc(8),i.Rb(),i.Mc(9,Th,6,6,"ng-template",null,5,i.Nc)}if(2&e){const e=i.Ac(10);i.yb(1),i.pc("ngbPopover",e),i.yb(3),i.Pc(t.groupTitle),i.yb(2),i.pc("ngClass",i.vc(3,Ch,t.icons.infoCircle,t.icons.large))}},directives:[Qt.w,On.a,o.p,Rr.a],pipes:[o.o],styles:[".info-group-title[_ngcontent-%COMP%]{font-size:1.75rem;margin:0 0 .5vw .5vw}.popover-icon[_ngcontent-%COMP%]:focus{box-shadow:none}"]}),e})();function Lh(e,t){if(1&e&&(i.Sb(0,"a",6),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.pc("routerLink",e.link),i.yb(1),i.Pc(e.cardTitle)}}function Eh(e,t){if(1&e&&i.Oc(0),2&e){const e=i.ic();i.Qc(" ",e.cardTitle," ")}}const Ah=["*"];let Ih=(()=>{class e{constructor(){this.cardClass=""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-info-card"]],inputs:{cardTitle:"cardTitle",link:"link",cardClass:"cardClass",contentClass:"contentClass"},ngContentSelectors:Ah,decls:8,vars:4,consts:[[1,"card","shadow-sm",3,"ngClass"],[1,"card-body","d-flex","align-items-center","justify-content-center"],[1,"card-title","m-4"],[3,"routerLink",4,"ngIf","ngIfElse"],["noLinkTitle",""],[1,"card-text","text-center",3,"ngClass"],[3,"routerLink"]],template:function(e,t){if(1&e&&(i.oc(),i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"h4",2),i.Mc(3,Lh,2,2,"a",3),i.Mc(4,Eh,1,1,"ng-template",null,4,i.Nc),i.Rb(),i.Sb(6,"div",5),i.nc(7),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(5);i.pc("ngClass",t.cardClass),i.yb(3),i.pc("ngIf",t.link)("ngIfElse",e),i.yb(3),i.pc("ngClass",t.contentClass)}},directives:[o.p,o.r,Pt.h],styles:[".card[_ngcontent-%COMP%]{font-size:12px;border:.5px solid #dee2e6;border-radius:3px;height:100%}@media screen and (min-width:320px){.card[_ngcontent-%COMP%]{font-size:calc(12px + 9 * ((100vw - 320px) / 1728))}}@media screen and (min-width:2048px){.card[_ngcontent-%COMP%]{font-size:21px}}.card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding-top:40px!important}.card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]   .card-title[_ngcontent-%COMP%]{left:-.6rem;position:absolute;top:-.3rem}.no-center[_ngcontent-%COMP%]{left:unset;position:unset;top:unset;transform:unset}.content-highlight[_ngcontent-%COMP%]{font-weight:700}"]}),e})();var Ph=n("MO+k");const jh=["chartCanvas"],Nh=["chartTooltip"];let Fh=(()=>{class e{constructor(e,t,n){this.dimlessBinary=e,this.dimless=t,this.cssHelper=n,this.config={},this.isBytesData=!1,this.showLabelAsTooltip=!1,this.prepareFn=new i.o,this.chartConfig={chartType:"doughnut",dataset:[{label:null,borderWidth:0}],colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-green"),this.cssHelper.propertyValue("chart-color-yellow"),this.cssHelper.propertyValue("chart-color-orange"),this.cssHelper.propertyValue("chart-color-red"),this.cssHelper.propertyValue("chart-color-blue")]}],options:{cutoutPercentage:90,events:["click","mouseout","touchstart"],legend:{display:!0,position:"right",labels:{boxWidth:10,usePointStyle:!1}},plugins:{center_text:!0},tooltips:{enabled:!0,displayColors:!1,backgroundColor:this.cssHelper.propertyValue("chart-color-tooltip-background"),cornerRadius:0,bodyFontSize:14,bodyFontStyle:"600",position:"nearest",xPadding:12,yPadding:12,callbacks:{label:(e,t)=>{let n=t.labels[e.index];return n.includes("%")||(n=`${n} (${t.datasets[e.datasetIndex].data[e.index]}%)`),n}}},title:{display:!1}}},this.doughnutChartPlugins=[{id:"center_text",beforeDraw(e){const t=new kh.a,n="Helvetica Neue, Helvetica, Arial, sans-serif";Ph.defaults.global.defaultFontFamily=n;const i=e.ctx;if(!e.options.plugins.center_text||!e.data.datasets[0].label)return;i.save();const r=e.data.datasets[0].label.split("\n"),s=(e.chartArea.left+e.chartArea.right)/2,o=(e.chartArea.top+e.chartArea.bottom)/2;i.textAlign="center",i.textBaseline="middle",i.font="24px "+n,i.fillStyle=t.propertyValue("chart-color-center-text"),i.fillText(r[0],s,o-10),r.length>1&&(i.font="14px "+n,i.fillStyle=t.propertyValue("chart-color-center-text-description"),i.fillText(r[1],s,o+10)),i.restore()}}]}ngOnInit(){new rn.a(this.chartCanvasRef,this.chartTooltipRef,(e,t)=>t+e.caretX+"px",(e,t)=>t+e.caretY-e.height-10+"px").getBody=e=>this.getChartTooltipBody(e),Nt.a.merge(this.chartConfig,this.config),this.prepareFn.emit([this.chartConfig,this.data])}ngOnChanges(){this.prepareFn.emit([this.chartConfig,this.data]),this.setChartSliceBorderWidth()}getChartTooltipBody(e){const t=e[0].split(": ");return this.showLabelAsTooltip?t[0]:(t[1]=this.isBytesData?this.dimlessBinary.transform(t[1]):this.dimless.transform(t[1]),t.join(": "))}setChartSliceBorderWidth(){let e=0;Nt.a.forEach(this.chartConfig.dataset[0].data,(function(t){t>0&&(e+=1)})),this.chartConfig.dataset[0].borderWidth=e>1?1:0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Zt.a),i.Mb(Xt.a),i.Mb(kh.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-health-pie"]],viewQuery:function(e,t){var n;1&e&&(i.Jc(jh,!0),i.Jc(Nh,!0)),2&e&&(i.zc(n=i.hc())&&(t.chartCanvasRef=n.first),i.zc(n=i.hc())&&(t.chartTooltipRef=n.first))},inputs:{data:"data",config:"config",isBytesData:"isBytesData",tooltipFn:"tooltipFn",showLabelAsTooltip:"showLabelAsTooltip"},outputs:{prepareFn:"prepareFn"},features:[i.wb],decls:6,vars:6,consts:[[1,"chart-container"],["baseChart","",1,"chart-canvas",3,"datasets","chartType","options","labels","colors","plugins"],["chartCanvas",""],[1,"chartjs-tooltip"],["chartTooltip",""]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Nb(1,"canvas",1,2),i.Sb(3,"div",3,4),i.Nb(5,"table"),i.Rb(),i.Rb()),2&e&&(i.yb(1),i.pc("datasets",t.chartConfig.dataset)("chartType",t.chartConfig.chartType)("options",t.chartConfig.options)("labels",t.chartConfig.labels)("colors",t.chartConfig.colors)("plugins",t.doughnutChartPlugins))},directives:[sn.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:rgba(0,0,0,.7);border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid transparent;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-canvas[_ngcontent-%COMP%], .chart-container[_ngcontent-%COMP%]{height:100%;margin-left:auto;margin-right:auto;position:unset;width:100%}.chart-canvas[_ngcontent-%COMP%]{max-height:100%;max-width:100%}']}),e})(),Yh=(()=>{class e{transform(e){if(!e)return"";let t=0,n=0;Nt.a.each(e.osds,e=>{e.in&&t++,e.up&&n++});const i=[{content:`${e.osds.length} ${"total"}`,class:""}];i.push({content:"",class:"card-text-line-break"}),i.push({content:`${n} ${"up"}, ${t} ${"in"}`,class:""});const r=e.osds.length-n,s=e.osds.length-t;if(r>0||s>0){i.push({content:"",class:"card-text-line-break"});const e=r>0?`${r} ${"down"}`:"",t=s>0?`${s} ${"out"}`:"";i.push({content:`${e}${r>0&&s>0?", ":""}${t}`,class:"card-text-error"})}return i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"osdSummary",type:e,pure:!0}),e})(),zh=(()=>{class e{transform(e){if(!e)return"";let t="",n="",i=0,r=0,s=0;Nt.a.each(e.standbys,()=>{i+=1}),e.standbys&&!e.filesystems?(t=`${i} ${"up"}`,n="no filesystems"):0===e.filesystems.length?t="no filesystems":(Nt.a.each(e.filesystems,e=>{Nt.a.each(e.mdsmap.info,e=>{"up:standby-replay"===e.state?s+=1:r+=1})}),t=`${r} ${"active"}`,n=`${i+s} ${"standby"}`);const o=e.standbys.map(e=>e.name).join(", "),a=o?`${"standby daemons"}: ${o}`:"",c=e.filesystems?e.filesystems.length:0,l=Object.values(c>0?e.filesystems[0].mdsmap.info:{}).map(e=>e.name).join(", ");let u=l?`${"active daemon"}: ${l}`:"";!r&&c>0&&(u=`${s} ${"standbyReplay"}`);const d=[{content:t,class:"popover-info",titleText:u}];return n&&(d.push({content:"",class:"card-text-line-break",titleText:""}),d.push({content:n,class:"popover-info",titleText:a})),d}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"mdsSummary",type:e,pure:!0}),e})();var $h=function(e){return e.HEALTH_ERR="health-color-error",e.HEALTH_WARN="health-color-warning",e.HEALTH_OK="health-color-healthy",e}({});let Hh=(()=>{class e{constructor(e){this.cssHelper=e}transform(e){return Object.keys($h).includes(e)?{color:this.cssHelper.propertyValue($h[e])}:null}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(kh.a))},e.\u0275pipe=i.Lb({name:"healthColor",type:e,pure:!0}),e})(),Wh=(()=>{class e{transform(e){return e?"" + e.monmap.mons.length.toString() + " (quorum " + e.quorum.join(", ") + ")":""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"monSummary",type:e,pure:!0}),e})(),Vh=(()=>{class e{transform(e){if(!e)return"";let t="n/a";const n=Nt.a.isUndefined(e.active_name)?"":`${"active daemon"}: ${e.active_name}`;n.length>0&&(t="1");const i=e.standbys.map(e=>e.name).join(", "),r=i?`${"standby daemons"}: ${i}`:"",s=e.standbys.length,o=[{content:`${t} ${"active"}`,class:"popover-info",titleText:n}];return o.push({content:"",class:"card-text-line-break",titleText:""}),o.push({content:`${s} ${"standby"}`,class:"popover-info",titleText:r}),o}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"mgrSummary",type:e,pure:!0}),e})();function Bh(e,t){1&e&&i.Ob(0)}function Uh(e,t){if(1&e&&(i.Sb(0,"li"),i.Sb(1,"span",21),i.jc(2,"healthColor"),i.Oc(3),i.Rb(),i.Oc(4),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.pc("ngStyle",i.kc(2,3,e.severity)),i.yb(2),i.Pc(e.type),i.yb(1),i.Qc(": ",e.summary.message," ")}}function Gh(e,t){if(1&e&&(i.Mc(0,Bh,1,0,"ng-container",19),i.Sb(1,"ul"),i.Mc(2,Uh,5,5,"li",20),i.Rb()),2&e){i.ic(4);const e=i.Ac(5),t=i.ic();i.pc("ngTemplateOutlet",e),i.yb(2),i.pc("ngForOf",t.healthData.health.checks)}}function qh(e,t){1&e&&i.Nb(0,"i",22)}function Jh(e,t){if(1&e&&(i.Qb(0),i.Mc(1,Gh,3,2,"ng-template",null,16,i.Nc),i.Sb(3,"div",17),i.jc(4,"healthColor"),i.Oc(5),i.Mc(6,qh,1,0,"i",18),i.Rb(),i.Pb()),2&e){const e=i.Ac(2),t=i.ic(4);i.yb(3),i.pc("ngStyle",i.kc(4,4,t.healthData.health.status))("ngbPopover",e),i.yb(2),i.Qc(" ",t.healthData.health.status," "),i.yb(1),i.pc("ngIf","HEALTH_OK"!=(null==t.healthData.health?null:t.healthData.health.status))}}function Qh(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",21),i.jc(2,"healthColor"),i.Oc(3),i.Rb(),i.Pb()),2&e){const e=i.ic(4);i.yb(1),i.pc("ngStyle",i.kc(2,2,e.healthData.health.status)),i.yb(2),i.Qc(" ",e.healthData.health.status," ")}}function Kh(e,t){if(1&e&&(i.Sb(0,"cd-info-card",13),i.Yb(1,14),i.Mc(2,Jh,7,6,"ng-container",15),i.Mc(3,Qh,4,4,"ng-container",15),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.pc("ngIf",(null==e.healthData.health||null==e.healthData.health.checks?null:e.healthData.health.checks.length)>0),i.yb(1),i.pc("ngIf",!(null!=e.healthData.health&&null!=e.healthData.health.checks&&e.healthData.health.checks.length))}}function Zh(e,t){if(1&e&&(i.Sb(0,"cd-info-card",23),i.Yb(1,24),i.Oc(2),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",e.healthData.hosts," total ")}}function Xh(e,t){if(1&e&&(i.Sb(0,"cd-info-card",25),i.Yb(1,26),i.Oc(2),i.jc(3,"monSummary"),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",i.kc(3,1,e.healthData.mon_status)," ")}}function ef(e,t){if(1&e&&(i.Sb(0,"span",30),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("ngClass",e.class),i.yb(1),i.Qc(" ",e.content," ")}}function tf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",27),i.Yb(1,28),i.Mc(2,ef,2,2,"span",29),i.Rb()),2&e){const e=t.ngIf;i.yb(2),i.pc("ngForOf",e)}}function nf(e,t){if(1&e&&(i.Sb(0,"span",33),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("ngClass",e.class)("title",null!=e.titleText?e.titleText:""),i.yb(1),i.Qc(" ",e.content," ")}}function rf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",13),i.Yb(1,31),i.Mc(2,nf,2,3,"span",32),i.jc(3,"mgrSummary"),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.pc("ngForOf",i.kc(3,1,e.healthData.mgr_map))}}function sf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",34),i.Yb(1,35),i.Oc(2),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",e.healthData.rgw," total ")}}function of(e,t){if(1&e&&(i.Sb(0,"span",33),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("ngClass",e.class)("title",null!=e.titleText?e.titleText:""),i.yb(1),i.Qc(" ",e.content," ")}}function af(e,t){if(1&e&&(i.Sb(0,"cd-info-card",36),i.Yb(1,37),i.Mc(2,of,2,3,"span",32),i.Rb()),2&e){const e=t.ngIf;i.pc("contentClass",(e.length>1?"text-area-size-2":"")+" content-highlight"),i.yb(2),i.pc("ngForOf",e)}}const cf=function(e){return{"card-text-error":e}};function lf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",38),i.Yb(1,39),i.Oc(2),i.Nb(3,"span",40),i.Oc(4),i.Sb(5,"span",30),i.Oc(6),i.Rb(),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",e.healthData.iscsi_daemons.up+e.healthData.iscsi_daemons.down," total "),i.yb(2),i.Qc(" ",e.healthData.iscsi_daemons.up," up, "),i.yb(1),i.pc("ngClass",i.uc(4,cf,e.healthData.iscsi_daemons.down>0)),i.yb(1),i.Qc("",e.healthData.iscsi_daemons.down," down")}}function uf(e,t){if(1&e&&(i.Sb(0,"cd-info-group",4),i.Yb(1,5),i.Mc(2,Kh,4,2,"cd-info-card",6),i.Mc(3,Zh,3,1,"cd-info-card",7),i.Mc(4,Xh,4,3,"cd-info-card",8),i.Mc(5,tf,3,1,"cd-info-card",9),i.jc(6,"osdSummary"),i.Mc(7,rf,4,3,"cd-info-card",6),i.Mc(8,sf,3,1,"cd-info-card",10),i.Mc(9,af,3,2,"cd-info-card",11),i.jc(10,"mdsSummary"),i.Mc(11,lf,7,6,"cd-info-card",12),i.Rb()),2&e){const e=i.ic().ngIf,t=i.ic();i.yb(2),i.pc("ngIf",null==t.healthData.health?null:t.healthData.health.status),i.yb(1),i.pc("ngIf",null!=t.healthData.hosts),i.yb(1),i.pc("ngIf",t.healthData.mon_status),i.yb(1),i.pc("ngIf",i.kc(6,8,t.healthData.osd_map)),i.yb(2),i.pc("ngIf",t.healthData.mgr_map),i.yb(1),i.pc("ngIf",e.rgw&&null!=t.healthData.rgw),i.yb(1),i.pc("ngIf",i.kc(10,10,e.cephfs&&t.healthData.fs_map)),i.yb(2),i.pc("ngIf",e.iscsi&&null!=t.healthData.iscsi_daemons)}}function df(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-info-card",45),i.Yb(1,46),i.Sb(2,"cd-health-pie",47),i.gc("prepareFn",(function(t){return i.Dc(e),i.ic(3).prepareRawUsage(t[0],t[1])})),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(2),i.pc("data",e.healthData)("config",e.rawCapacityChartConfig)("isBytesData",!0)}}function hf(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-info-card",45),i.Yb(1,48),i.Sb(2,"cd-health-pie",49),i.gc("prepareFn",(function(t){return i.Dc(e),i.ic(3).prepareObjects(t[0],t[1])})),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(2),i.pc("data",e.healthData)}}function ff(e,t){1&e&&i.Ob(0)}function pf(e,t){if(1&e&&(i.Sb(0,"li"),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.Rc(" ",e.key,": ",e.value," ")}}function mf(e,t){if(1&e&&(i.Mc(0,ff,1,0,"ng-container",19),i.Sb(1,"ul"),i.Mc(2,pf,2,2,"li",20),i.jc(3,"keyvalue"),i.Rb()),2&e){i.ic(3);const e=i.Ac(5),t=i.ic();i.pc("ngTemplateOutlet",e),i.yb(2),i.pc("ngForOf",i.kc(3,2,t.healthData.pg_info.statuses))}}function bf(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-info-card",45),i.Yb(1,50),i.Mc(2,mf,4,4,"ng-template",null,51,i.Nc),i.Sb(4,"div",52),i.Sb(5,"div",53),i.Sb(6,"cd-health-pie",54),i.gc("prepareFn",(function(t){return i.Dc(e),i.ic(3).preparePgStatus(t[0],t[1])})),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(3),t=i.ic(3);i.yb(5),i.pc("ngbPopover",e),i.yb(1),i.pc("data",t.healthData)("config",t.pgStatusChartConfig)}}function gf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",55),i.Yb(1,56),i.Oc(2),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",e.healthData.pools.length," ")}}function _f(e,t){if(1&e&&(i.Sb(0,"cd-info-card",57),i.Yb(1,58),i.Oc(2),i.jc(3,"dimless"),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",i.kc(3,1,e.healthData.pg_info.pgs_per_osd)," ")}}function yf(e,t){if(1&e&&(i.Sb(0,"cd-info-group",4),i.Yb(1,41),i.Mc(2,df,3,3,"cd-info-card",42),i.Mc(3,hf,3,1,"cd-info-card",42),i.Mc(4,bf,7,3,"cd-info-card",42),i.Mc(5,gf,3,1,"cd-info-card",43),i.Mc(6,_f,4,3,"cd-info-card",44),i.Rb()),2&e){const e=i.ic(2);i.yb(2),i.pc("ngIf",e.healthData.df),i.yb(1),i.pc("ngIf",null!=(null==e.healthData.pg_info||null==e.healthData.pg_info.object_stats?null:e.healthData.pg_info.object_stats.num_objects)),i.yb(1),i.pc("ngIf",e.healthData.pg_info),i.yb(1),i.pc("ngIf",e.healthData.pools),i.yb(1),i.pc("ngIf",e.healthData.pg_info)}}function vf(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-info-card",62),i.Yb(1,63),i.Sb(2,"cd-health-pie",54),i.gc("prepareFn",(function(t){return i.Dc(e),i.ic(3).prepareReadWriteRatio(t[0],t[1])})),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(2),i.pc("data",e.healthData)("config",e.clientStatsConfig)}}function wf(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-info-card",62),i.Yb(1,64),i.Sb(2,"cd-health-pie",54),i.gc("prepareFn",(function(t){return i.Dc(e),i.ic(3).prepareClientThroughput(t[0],t[1])})),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(2),i.pc("data",e.healthData)("config",e.clientStatsConfig)}}function Sf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",65),i.Yb(1,66),i.Oc(2),i.jc(3,"dimlessBinary"),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",i.kc(3,1,e.healthData.client_perf.recovering_bytes_per_sec)+"/s"," ")}}function Mf(e,t){if(1&e&&(i.Sb(0,"cd-info-card",65),i.Yb(1,67),i.Oc(2),i.Rb()),2&e){const e=i.ic(3);i.yb(2),i.Qc(" ",e.healthData.scrub_status," ")}}function xf(e,t){if(1&e&&(i.Sb(0,"cd-info-group",4),i.Yb(1,59),i.Mc(2,vf,3,2,"cd-info-card",60),i.Mc(3,wf,3,2,"cd-info-card",60),i.Mc(4,Sf,4,3,"cd-info-card",61),i.Mc(5,Mf,3,1,"cd-info-card",61),i.Rb()),2&e){const e=i.ic(2);i.yb(2),i.pc("ngIf",e.healthData.client_perf),i.yb(1),i.pc("ngIf",e.healthData.client_perf),i.yb(1),i.pc("ngIf",e.healthData.client_perf),i.yb(1),i.pc("ngIf",e.healthData.scrub_status)}}const kf=function(e){return[e]};function Df(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"p",68),i.cc(2,69),i.Nb(3,"i",30),i.Nb(4,"a",70),i.Zb(),i.Rb(),i.Pb()),2&e){const e=i.ic(3);i.yb(3),i.pc("ngClass",i.uc(1,kf,e.icons.infoCircle))}}function Tf(e,t){if(1&e&&i.Mc(0,Df,5,3,"ng-container",15),2&e){const e=i.ic(2);i.pc("ngIf",e.permissions.log.read)}}function Cf(e,t){if(1&e&&(i.Sb(0,"div",1),i.Mc(1,uf,12,12,"cd-info-group",2),i.Mc(2,yf,7,5,"cd-info-group",2),i.Mc(3,xf,6,4,"cd-info-group",2),i.Mc(4,Tf,1,1,"ng-template",null,3,i.Nc),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngIf",(null==e.healthData.health?null:e.healthData.health.status)||e.healthData.mon_status||e.healthData.osd_map||e.healthData.mgr_map||null!=e.healthData.hosts||null!=e.healthData.rgw||e.healthData.fs_map||null!=e.healthData.iscsi_daemons),i.yb(1),i.pc("ngIf",e.healthData.pools||e.healthData.df||e.healthData.pg_info),i.yb(1),i.pc("ngIf",e.healthData.client_perf||e.healthData.scrub_status)}}let Of=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.healthService=e,this.authStorageService=t,this.pgCategoryService=n,this.featureToggles=i,this.refreshIntervalService=r,this.dimlessBinary=s,this.dimless=o,this.cssHelper=a,this.interval=new Oi.a,this.icons=_n.a,this.clientStatsConfig={colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-cyan"),this.cssHelper.propertyValue("chart-color-purple")]}]},this.rawCapacityChartConfig={colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-blue"),this.cssHelper.propertyValue("chart-color-gray")]}]},this.pgStatusChartConfig={options:{events:[""]}},this.permissions=this.authStorageService.getPermissions(),this.enabledFeature$=this.featureToggles.get()}ngOnInit(){this.interval=this.refreshIntervalService.intervalData$.subscribe(()=>{this.getHealth()})}ngOnDestroy(){this.interval.unsubscribe()}getHealth(){this.healthService.getMinimalHealth().subscribe(e=>{this.healthData=e})}prepareReadWriteRatio(e){const t=[],n=[],i=this.healthData.client_perf.write_op_per_sec+this.healthData.client_perf.read_op_per_sec;t.push(`${"Reads"}: ${this.dimless.transform(this.healthData.client_perf.read_op_per_sec)} ${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.read_op_per_sec,i)),t.push(`${"Writes"}: ${this.dimless.transform(this.healthData.client_perf.write_op_per_sec)} ${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.write_op_per_sec,i)),e.labels=t,e.dataset[0].data=n,e.dataset[0].label=`${this.dimless.transform(i)}\n${"IOPS"}`}prepareClientThroughput(e){const t=[],n=[],i=this.healthData.client_perf.read_bytes_sec+this.healthData.client_perf.write_bytes_sec;t.push(`${"Reads"}: ${this.dimlessBinary.transform(this.healthData.client_perf.read_bytes_sec)}${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.read_bytes_sec,i)),t.push(`${"Writes"}: ${this.dimlessBinary.transform(this.healthData.client_perf.write_bytes_sec)}${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.write_bytes_sec,i)),e.labels=t,e.dataset[0].data=n,e.dataset[0].label=`${this.dimlessBinary.transform(i).replace(" ","\n")}${"/s"}`}prepareRawUsage(e,t){const n=this.calcPercentage(t.df.stats.total_bytes-t.df.stats.total_used_raw_bytes,t.df.stats.total_bytes),i=this.calcPercentage(t.df.stats.total_used_raw_bytes,t.df.stats.total_bytes);e.dataset[0].data=[i,n],e.labels=[`${"Used"}: ${this.dimlessBinary.transform(t.df.stats.total_used_raw_bytes)}`,`${"Avail."}: ${this.dimlessBinary.transform(t.df.stats.total_bytes-t.df.stats.total_used_raw_bytes)}`],e.dataset[0].label=`${i}%\nof ${this.dimlessBinary.transform(t.df.stats.total_bytes)}`}preparePgStatus(e,t){const n={};let i=0;Nt.a.forEach(t.pg_info.statuses,(e,t)=>{const r=this.pgCategoryService.getTypeByStates(t);Nt.a.isUndefined(n[r])&&(n[r]=0),n[r]+=e,i+=e});for(const r of this.pgCategoryService.getAllTypes())Nt.a.isUndefined(n[r])&&(n[r]=0);e.dataset[0].data=this.pgCategoryService.getAllTypes().map(e=>this.calcPercentage(n[e],i)),e.labels=[`${"Clean"}: ${this.dimless.transform(n.clean)}`,`${"Working"}: ${this.dimless.transform(n.working)}`,`${"Warning"}: ${this.dimless.transform(n.warning)}`,`${"Unknown"}: ${this.dimless.transform(n.unknown)}`],e.dataset[0].label=`${i}\n${"PGs"}`}prepareObjects(e,t){const n=t.pg_info.object_stats.num_object_copies,i=this.calcPercentage(n-t.pg_info.object_stats.num_objects_misplaced-t.pg_info.object_stats.num_objects_degraded-t.pg_info.object_stats.num_objects_unfound,n),r=this.calcPercentage(t.pg_info.object_stats.num_objects_misplaced,n),s=this.calcPercentage(t.pg_info.object_stats.num_objects_degraded,n),o=this.calcPercentage(t.pg_info.object_stats.num_objects_unfound,n);e.labels=[`${"Healthy"}: ${i}%`,`${"Misplaced"}: ${r}%`,`${"Degraded"}: ${s}%`,`${"Unfound"}: ${o}%`],e.dataset[0].data=[i,r,s,o],e.dataset[0].label=`${this.dimless.transform(t.pg_info.object_stats.num_objects)}\n${"objects"}`}isClientReadWriteChartShowable(){return(this.healthData.client_perf.read_op_per_sec||0)+(this.healthData.client_perf.write_op_per_sec||0)>0}calcPercentage(e,t){return Nt.a.isNumber(e)&&Nt.a.isNumber(t)&&0!==t?Math.round(e/t*100):0}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(xh),i.Mb(Jt.a),i.Mb(Mh.a),i.Mb(Dh.a),i.Mb(vh),i.Mb(Zt.a),i.Mb(Xt.a),i.Mb(kh.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-health"]],decls:2,vars:3,consts:function(){return[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[4,"ngIf",6,"groupTitle"],["logsLink",""],[6,"groupTitle"],["groupTitle","Status"],["class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["link","/hosts","class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["link","/monitor","class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["link","/osd","class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["link","/rgw/daemon","class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["class","cd-status-card",3,"contentClass",4,"ngIf",6,"cardTitle"],["link","/block/iscsi","class","cd-status-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","Cluster Status"],[4,"ngIf"],["healthChecks",""],["popoverClass","info-card-popover-cluster-status",1,"info-card-content-clickable",3,"ngStyle","ngbPopover"],["class","fa fa-exclamation-triangle",4,"ngIf"],[4,"ngTemplateOutlet"],[4,"ngFor","ngForOf"],[3,"ngStyle"],[1,"fa","fa-exclamation-triangle"],["link","/hosts","contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","Hosts"],["link","/monitor","contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","Monitors"],["link","/osd","contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","OSDs"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],["cardTitle","Managers"],[3,"ngClass","title",4,"ngFor","ngForOf"],[3,"ngClass","title"],["link","/rgw/daemon","contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","Object Gateways"],[1,"cd-status-card",3,"contentClass",6,"cardTitle"],["cardTitle","Metadata Servers"],["link","/block/iscsi","contentClass","content-highlight",1,"cd-status-card",6,"cardTitle"],["cardTitle","iSCSI Gateways"],[1,"card-text-line-break"],["groupTitle","Capacity"],["class","cd-capacity-card cd-chart-card","contentClass","content-chart",4,"ngIf",6,"cardTitle"],["link","/pool","class","cd-capacity-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["class","cd-capacity-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["contentClass","content-chart",1,"cd-capacity-card","cd-chart-card",6,"cardTitle"],["cardTitle","Raw Capacity"],[3,"data","config","isBytesData","prepareFn"],["cardTitle","Objects"],[3,"data","prepareFn"],["cardTitle","PG Status"],["pgStatus",""],[1,"pg-status-popover-wrapper"],[3,"ngbPopover"],[3,"data","config","prepareFn"],["link","/pool","contentClass","content-highlight",1,"cd-capacity-card",6,"cardTitle"],["cardTitle","Pools"],["contentClass","content-highlight",1,"cd-capacity-card",6,"cardTitle"],["cardTitle","PGs per OSD"],["groupTitle","Performance"],["class","cd-performance-card cd-chart-card","contentClass","content-chart",4,"ngIf",6,"cardTitle"],["class","cd-performance-card","contentClass","content-highlight",4,"ngIf",6,"cardTitle"],["contentClass","content-chart",1,"cd-performance-card","cd-chart-card",6,"cardTitle"],["cardTitle","Client Read/Write"],["cardTitle","Client Throughput"],["contentClass","content-highlight",1,"cd-performance-card",6,"cardTitle"],["cardTitle","Recovery Throughput"],["cardTitle","Scrubbing"],[1,"logs-link"],"" + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + " See " + "\ufffd#4\ufffd" + "Logs" + "\ufffd/#4\ufffd" + " for more details.",["routerLink","/logs"]]},template:function(e,t){1&e&&(i.Mc(0,Cf,6,3,"div",0),i.jc(1,"async")),2&e&&i.pc("ngIf",i.kc(1,1,t.healthData&&t.enabledFeature$))},directives:[o.r,Rh,Ih,o.s,Qt.w,o.w,o.q,o.p,Fh,Pt.h],pipes:[o.b,Yh,zh,Hh,Wh,Vh,o.k,Xt.a,Zt.a],styles:['cd-info-card[_ngcontent-%COMP%]{padding:0 .5vw}  cd-health .pg-status-popover-wrapper{position:relative}  cd-health .pg-status-popover-wrapper .popover{max-height:20vh;max-width:unset!important;min-width:unset!important;position:absolute;width:116%}  cd-health .pg-status-popover-wrapper .popover .popover-body{font-size:1rem;max-height:19vh;max-width:100%}.logs-link[_ngcontent-%COMP%]{text-align:center}.card-text-error[_ngcontent-%COMP%]{color:#ef5c55;display:inline}.card-text-line-break[_ngcontent-%COMP%]:after{content:"\\a";white-space:pre}.popover-info[_ngcontent-%COMP%]:hover{cursor:pointer}']}),e})();function Rf(e,t){1&e&&i.Nb(0,"cd-health")}function Lf(e,t){}function Ef(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",1,2),i.Sb(3,"li",3),i.Sb(4,"a",4),i.Wb(5,5),i.Rb(),i.Mc(6,Rf,1,0,"ng-template",6),i.Rb(),i.Sb(7,"li",3),i.Sb(8,"a",4),i.Wb(9,7),i.Rb(),i.Mc(10,Lf,0,0,"ng-template",6),i.Rb(),i.Rb(),i.Nb(11,"div",8),i.Pb()),2&e){const e=i.Ac(2);i.yb(11),i.pc("ngbNavOutlet",e)}}function Af(e,t){1&e&&i.Nb(0,"cd-health")}let If=(()=>{class e{constructor(){this.hasGrafana=!1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-dashboard"]],decls:4,vars:2,consts:function(){return[[4,"ngIf"],["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],"Health",["ngbNavContent",""],"Statistics",[3,"ngbNavOutlet"]]},template:function(e,t){1&e&&(i.Sb(0,"div"),i.Nb(1,"cd-refresh-selector"),i.Mc(2,Ef,12,1,"ng-container",0),i.Mc(3,Af,1,0,"cd-health",0),i.Rb()),2&e&&(i.yb(2),i.pc("ngIf",t.hasGrafana),i.yb(1),i.pc("ngIf",!t.hasGrafana))},directives:[Sh,o.r,Qt.p,Qt.r,Qt.s,Qt.q,Qt.u,Of],styles:["div[_ngcontent-%COMP%]{padding-top:20px}"]}),e})(),Pf=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/nfs-ganesha",this.uiApiPath="ui-api/nfs-ganesha",this.nfsAccessType=[{value:"RW",help:"Allows all operations"},{value:"RO",help:"Allows only operations that do not modify the server"},{value:"MDONLY",help:"Does not allow read or write operations, but allows any other operation"},{value:"MDONLY_RO",help:"Does not allow read, write, or any operation that modifies file attributes or directory content"},{value:"NONE",help:"Allows no access at all"}],this.nfsFsal=[{value:"CEPH",descr:"CephFS"},{value:"RGW",descr:"Object Gateway"}],this.nfsSquash=["no_root_squash","root_id_squash","root_squash","all_squash"]}list(){return this.http.get(this.apiPath+"/export")}get(e,t){return this.http.get(`${this.apiPath}/export/${e}/${t}`)}create(e){return this.http.post(this.apiPath+"/export",e,{observe:"response"})}update(e,t,n){return this.http.put(`${this.apiPath}/export/${e}/${t}`,n,{observe:"response"})}delete(e,t){return this.http.delete(`${this.apiPath}/export/${e}/${t}`,{observe:"response"})}lsDir(e,t){return this.http.get(`${this.uiApiPath}/lsdir/${e}?root_dir=${t}`)}buckets(e){return this.http.get(`${this.uiApiPath}/rgw/buckets?user_id=${e}`)}clients(){return this.http.get(this.uiApiPath+"/cephx/clients")}fsals(){return this.http.get(this.uiApiPath+"/fsals")}filesystems(){return this.http.get(this.uiApiPath+"/cephfs/filesystems")}daemon(){return this.http.get(this.apiPath+"/daemon")}start(e){return this.http.put(`${this.apiPath}/service/${e}/start`,null,{observe:"response"})}stop(e){return this.http.put(`${this.apiPath}/service/${e}/stop`,null,{observe:"response"})}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var jf=n("P8lu"),Nf=function(e){return e.user="user",e.orchestrator="orchestrator",e}({}),Ff=n("TYzs");function Yf(e,t){1&e&&(i.Sb(0,"span",14),i.Sb(1,"span",15),i.Wb(2,16),i.Rb(),i.Rb())}function zf(e,t){1&e&&(i.Sb(0,"span"),i.Wb(1,36),i.Rb())}function $f(e,t){1&e&&(i.Sb(0,"span"),i.Qb(1),i.Wb(2,37),i.Pb(),i.Nb(3,"br"),i.Qb(4),i.Wb(5,38),i.Pb(),i.Oc(6," 192.168.0.10, 192.168.1.0/8 "),i.Rb())}function Hf(e,t){if(1&e&&(i.Sb(0,"option",39),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.value),i.yb(1),i.Pc(e.value)}}function Wf(e,t){if(1&e&&(i.Sb(0,"span",15),i.Oc(1),i.Rb()),2&e){const e=i.ic().index,t=i.ic();i.yb(1),i.Qc(" ",t.getAccessTypeHelp(e)," ")}}function Vf(e,t){if(1&e&&(i.Sb(0,"option",39),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Pc(e)}}function Bf(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div"),i.Sb(1,"div",17),i.Sb(2,"div",18),i.Oc(3),i.jc(4,"ordinal"),i.Sb(5,"span",19),i.gc("click",(function(){i.Dc(e);const n=t.index;return i.ic().removeClient(n)})),i.Oc(6,"\xd7"),i.Rb(),i.Rb(),i.Sb(7,"div",20),i.Sb(8,"div",0),i.Sb(9,"label",21),i.Wb(10,22),i.Rb(),i.Sb(11,"div",23),i.Nb(12,"input",24),i.Sb(13,"span",25),i.Mc(14,zf,2,0,"span",26),i.Mc(15,$f,7,0,"span",26),i.Rb(),i.Rb(),i.Rb(),i.Sb(16,"div",0),i.Sb(17,"label",27),i.Wb(18,28),i.Rb(),i.Sb(19,"div",23),i.Sb(20,"select",29),i.Sb(21,"option",30),i.Oc(22),i.Rb(),i.Mc(23,Hf,2,2,"option",31),i.Rb(),i.Mc(24,Wf,2,1,"span",32),i.Rb(),i.Rb(),i.Sb(25,"div",0),i.Sb(26,"label",33),i.Wb(27,34),i.Rb(),i.Sb(28,"div",23),i.Sb(29,"select",35),i.Sb(30,"option",30),i.Oc(31),i.Rb(),i.Mc(32,Vf,2,2,"option",31),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=t.index,n=i.ic(),r=i.Ac(4);i.yb(1),i.pc("formGroupName",e),i.yb(2),i.Qc(" ",i.kc(4,9,e+1)," "),i.yb(11),i.pc("ngIf",n.showError(e,"addresses",r,"required")),i.yb(1),i.pc("ngIf",n.showError(e,"addresses",r,"pattern")),i.yb(7),i.Pc(n.getNoAccessTypeDescr()),i.yb(1),i.pc("ngForOf",n.nfsAccessType),i.yb(1),i.pc("ngIf",n.getValue(e,"access_type")),i.yb(7),i.Pc(n.getNoSquashDescr()),i.yb(1),i.pc("ngForOf",n.nfsSquash)}}const Uf=function(e){return[e]};let Gf=(()=>{class e{constructor(e){this.nfsService=e,this.nfsSquash=this.nfsService.nfsSquash,this.nfsAccessType=this.nfsService.nfsAccessType,this.icons=_n.a}ngOnInit(){Nt.a.forEach(this.clients,e=>{this.addClient().patchValue(e)})}getNoAccessTypeDescr(){return this.form.getValue("access_type")?`${this.form.getValue("access_type")} ${"(inherited from global config)"}`:"-- Select the access type --"}getAccessTypeHelp(e){const t=this.nfsAccessType.find(t=>this.getValue(e,"access_type")===t.value);return Nt.a.isObjectLike(t)?t.help:""}getNoSquashDescr(){return this.form.getValue("squash")?`${this.form.getValue("squash")} (${"inherited from global config"})`:"-- Select what kind of user id squashing is performed --"}addClient(){const e=this.form.get("clients"),t="(([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3}).([0-9]{1,3})([/](\\d|[1-2]\\d|3[0-2]))?)",n=new Jn.a({addresses:new xn.h("",{validators:[xn.A.required,xn.A.pattern(`${t}([ ,]{1,2}${t})*`)]}),access_type:new xn.h(""),squash:new xn.h("")});return e.push(n),n}removeClient(e){this.form.get("clients").removeAt(e)}showError(e,t,n,i){return this.form.controls.clients.controls[e].showError(t,n,i)}getValue(e,t){return this.form.get("clients").at(e).getValue(t)}trackByFn(e){return e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pf))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-nfs-form-client"]],inputs:{form:"form",clients:"clients"},decls:15,vars:7,consts:function(){return[[1,"form-group","row"],[1,"cd-col-form-label"],"Clients",[1,"cd-col-form-input",3,"formGroup"],["formDir","ngForm"],["class","no-border text-muted",4,"ngIf"],["formArrayName","clients"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"row"],[1,"col-12"],[1,"float-right"],[1,"btn","btn-light",3,"click"],[3,"ngClass"],"Add clients",[1,"no-border","text-muted"],[1,"form-text","text-muted"],"Any client can access",[1,"card",3,"formGroupName"],[1,"card-header"],["ngbTooltip","Remove",1,"float-right","clickable",3,"click"],[1,"card-body"],["for","addresses",1,"cd-col-form-label"],"Addresses",[1,"cd-col-form-input"],["type","text","name","addresses","id","addresses","formControlName","addresses","placeholder","192.168.0.10, 192.168.1.0/8",1,"form-control"],[1,"invalid-feedback"],[4,"ngIf"],["for","access_type",1,"cd-col-form-label"],"Access Type",["name","access_type","id","access_type","formControlName","access_type",1,"form-control","custom-select"],["value",""],[3,"value",4,"ngFor","ngForOf"],["class","form-text text-muted",4,"ngIf"],["for","squash",1,"cd-col-form-label"],"Squash",["name","squash","id","squash","formControlName","squash",1,"form-control","custom-select"],"This field is required.","Must contain one or more comma-separated values","For example:",[3,"value"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"label",1),i.Wb(2,2),i.Rb(),i.Sb(3,"div",3,4),i.Mc(5,Yf,3,0,"span",5),i.Qb(6,6),i.Mc(7,Bf,33,11,"div",7),i.Pb(),i.Sb(8,"div",8),i.Sb(9,"div",9),i.Sb(10,"div",10),i.Sb(11,"button",11),i.gc("click",(function(){return t.addClient()})),i.Nb(12,"i",12),i.Qb(13),i.Wb(14,13),i.Pb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(3),i.pc("formGroup",t.form),i.yb(2),i.pc("ngIf",0===t.form.get("clients").value.length),i.yb(2),i.pc("ngForOf",t.form.get("clients").value)("ngForTrackBy",t.trackByFn),i.yb(5),i.pc("ngClass",i.uc(5,Uf,t.icons.add)))},directives:[Xn.a,xn.r,xn.k,Zn.a,o.r,xn.f,o.q,On.a,o.p,xn.l,Qt.D,xn.d,ei.a,xn.q,xn.i,xn.z,xn.u,xn.B],pipes:[Ff.a],styles:[""]}),e})();var qf=n("wnGv");const Jf=["nfsClients"];function Qf(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,51),i.Rb())}function Kf(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,52),i.Rb())}function Zf(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,53),i.Rb())}function Xf(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.cluster_id),i.yb(1),i.Pc(e.cluster_id)}}function ep(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,56),i.Rb())}function tp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",47),i.Wb(2,48),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"select",49),i.gc("change",(function(){return i.Dc(e),i.ic(2).onClusterChange()})),i.Mc(5,Qf,2,0,"option",15),i.Mc(6,Kf,2,0,"option",15),i.Mc(7,Zf,2,0,"option",15),i.Mc(8,Xf,2,2,"option",16),i.Rb(),i.Mc(9,ep,2,0,"span",17),i.Rb(),i.Rb()}if(2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(5),i.pc("ngIf",null===t.allClusters),i.yb(1),i.pc("ngIf",null!==t.allClusters&&0===t.allClusters.length),i.yb(1),i.pc("ngIf",null!==t.allClusters&&t.allClusters.length>0),i.yb(1),i.pc("ngForOf",t.allClusters),i.yb(1),i.pc("ngIf",t.nfsForm.showError("cluster_id",e,"required"))}}const np=function(e){return[e]};function ip(e,t){if(1&e){const e=i.Tb();i.Sb(0,"span",64),i.Sb(1,"button",65),i.gc("click",(function(){i.Dc(e);const t=i.ic(),n=t.index,r=t.$implicit;return i.ic(3).removeDaemon(n,r)})),i.Nb(2,"i",66),i.Rb(),i.Rb()}if(2&e){const e=i.ic(4);i.yb(2),i.pc("ngClass",i.uc(1,np,e.icons.destroy))}}function rp(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",61),i.Nb(2,"input",62),i.Mc(3,ip,3,3,"span",63),i.Rb(),i.Pb()),2&e){const e=t.$implicit,n=i.ic(3);i.yb(2),i.pc("value",e),i.yb(1),i.pc("ngIf","user"===n.clusterType)}}function sp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",67),i.Sb(1,"div",68),i.Sb(2,"cd-select",69),i.gc("selection",(function(){return i.Dc(e),i.ic(3).onDaemonSelection()})),i.Nb(3,"i",70),i.Qb(4),i.Wb(5,71),i.Pb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(2),i.pc("data",e.nfsForm.get("daemons").value)("options",e.daemonsSelections)("messages",e.daemonsMessages),i.yb(1),i.pc("ngClass",i.uc(4,np,e.icons.add))}}function op(e,t){1&e&&(i.Qb(0),i.Wb(1,75),i.Pb())}function ap(e,t){1&e&&(i.Qb(0),i.Wb(1,76),i.Pb())}function cp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",67),i.Sb(1,"div",68),i.Sb(2,"button",72),i.gc("click",(function(){return i.Dc(e),i.ic(3).onToggleAllDaemonsSelection()})),i.Nb(3,"i",70),i.Mc(4,op,2,0,"ng-container",73),i.Mc(5,ap,2,0,"ng-template",null,74,i.Nc),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(6),t=i.ic(3);i.yb(3),i.pc("ngClass",i.uc(3,np,t.icons.add)),i.yb(1),i.pc("ngIf",0===t.nfsForm.getValue("daemons").length)("ngIfElse",e)}}function lp(e,t){if(1&e&&(i.Sb(0,"div",10),i.Sb(1,"label",57),i.Qb(2),i.Wb(3,58),i.Pb(),i.Rb(),i.Sb(4,"div",13),i.Mc(5,rp,4,2,"ng-container",59),i.Mc(6,sp,6,6,"div",60),i.Mc(7,cp,7,5,"div",60),i.Rb(),i.Rb()),2&e){const e=i.ic(2);i.yb(5),i.pc("ngForOf",e.nfsForm.getValue("daemons")),i.yb(1),i.pc("ngIf","user"===e.clusterType),i.yb(1),i.pc("ngIf","orchestrator"===e.clusterType)}}function up(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,77),i.Rb())}function dp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,78),i.Rb())}function hp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,79),i.Rb())}function fp(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.value),i.yb(1),i.Pc(e.descr)}}function pp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,80),i.Rb())}function mp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,84),i.Rb())}function bp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,85),i.Rb())}function gp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,86),i.Rb())}function _p(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Pc(e)}}function yp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,87),i.Rb())}function vp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",81),i.Wb(2,82),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"select",83),i.gc("change",(function(){return i.Dc(e),i.ic(2).rgwUserIdChangeHandler()})),i.Mc(5,mp,2,0,"option",15),i.Mc(6,bp,2,0,"option",15),i.Mc(7,gp,2,0,"option",15),i.Mc(8,_p,2,2,"option",16),i.Rb(),i.Mc(9,yp,2,0,"span",17),i.Rb(),i.Rb()}if(2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(5),i.pc("ngIf",null===t.allRgwUsers),i.yb(1),i.pc("ngIf",null!==t.allRgwUsers&&0===t.allRgwUsers.length),i.yb(1),i.pc("ngIf",null!==t.allRgwUsers&&t.allRgwUsers.length>0),i.yb(1),i.pc("ngForOf",t.allRgwUsers),i.yb(1),i.pc("ngIf",t.nfsForm.showError("rgw_user_id",e,"required"))}}function wp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,91),i.Rb())}function Sp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,92),i.Rb())}function Mp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,93),i.Rb())}function xp(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Pc(e)}}function kp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,94),i.Rb())}function Dp(e,t){if(1&e&&(i.Sb(0,"div",10),i.Sb(1,"label",88),i.Wb(2,89),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"select",90),i.Mc(5,wp,2,0,"option",15),i.Mc(6,Sp,2,0,"option",15),i.Mc(7,Mp,2,0,"option",15),i.Mc(8,xp,2,2,"option",16),i.Rb(),i.Mc(9,kp,2,0,"span",17),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(5),i.pc("ngIf",null===t.allCephxClients),i.yb(1),i.pc("ngIf",null!==t.allCephxClients&&0===t.allCephxClients.length),i.yb(1),i.pc("ngIf",null!==t.allCephxClients&&t.allCephxClients.length>0),i.yb(1),i.pc("ngForOf",t.allCephxClients),i.yb(1),i.pc("ngIf",t.nfsForm.showError("user_id",e,"required"))}}function Tp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,98),i.Rb())}function Cp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,99),i.Rb())}function Op(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,100),i.Rb())}function Rp(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.name),i.yb(1),i.Pc(e.name)}}function Lp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,101),i.Rb())}function Ep(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",95),i.Wb(2,96),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"select",97),i.gc("change",(function(){return i.Dc(e),i.ic(2).rgwUserIdChangeHandler()})),i.Mc(5,Tp,2,0,"option",15),i.Mc(6,Cp,2,0,"option",15),i.Mc(7,Op,2,0,"option",15),i.Mc(8,Rp,2,2,"option",16),i.Rb(),i.Mc(9,Lp,2,0,"span",17),i.Rb(),i.Rb()}if(2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(5),i.pc("ngIf",null===t.allFsNames),i.yb(1),i.pc("ngIf",null!==t.allFsNames&&0===t.allFsNames.length),i.yb(1),i.pc("ngIf",null!==t.allFsNames&&t.allFsNames.length>0),i.yb(1),i.pc("ngForOf",t.allFsNames),i.yb(1),i.pc("ngIf",t.nfsForm.showError("fs_name",e,"required"))}}function Ap(e,t){1&e&&i.Nb(0,"input",108)}function Ip(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,109),i.Rb())}const Pp=function(e){return{required:e}};function jp(e,t){if(1&e&&(i.Sb(0,"div",10),i.Sb(1,"label",102),i.Wb(2,103),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"div",20),i.Nb(5,"input",104),i.Sb(6,"label",105),i.Wb(7,106),i.Rb(),i.Rb(),i.Nb(8,"br"),i.Mc(9,Ap,1,0,"input",107),i.Mc(10,Ip,2,0,"span",17),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(1),i.pc("ngClass",i.uc(3,Pp,t.nfsForm.getValue("security_label"))),i.yb(8),i.pc("ngIf",t.nfsForm.getValue("security_label")),i.yb(1),i.pc("ngIf",t.nfsForm.showError("sec_label_xattr",e,"required"))}}function Np(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,113),i.Rb())}function Fp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,114),i.Rb())}function Yp(e,t){1&e&&(i.Sb(0,"span",115),i.Wb(1,116),i.Rb())}function zp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",110),i.Wb(2,111),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"input",112),i.gc("selectItem",(function(){return i.Dc(e),i.ic(2).pathChangeHandler()}))("blur",(function(){return i.Dc(e),i.ic(2).pathChangeHandler()})),i.Rb(),i.Mc(5,Np,2,0,"span",17),i.Mc(6,Fp,2,0,"span",17),i.Mc(7,Yp,2,0,"span",30),i.Rb(),i.Rb()}if(2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(4),i.pc("ngbTypeahead",t.pathDataSource),i.yb(1),i.pc("ngIf",t.nfsForm.showError("path",e,"required")),i.yb(1),i.pc("ngIf",t.nfsForm.showError("path",e,"pattern")),i.yb(1),i.pc("ngIf",t.isNewDirectory&&!t.nfsForm.showError("path",e))}}function $p(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,118),i.Rb())}function Hp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,119),i.Rb())}function Wp(e,t){1&e&&(i.Sb(0,"span",115),i.Wb(1,120),i.Rb())}function Vp(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",10),i.Sb(1,"label",110),i.Wb(2,117),i.Rb(),i.Sb(3,"div",13),i.Sb(4,"input",112),i.gc("selectItem",(function(){return i.Dc(e),i.ic(2).bucketChangeHandler()}))("blur",(function(){return i.Dc(e),i.ic(2).bucketChangeHandler()})),i.Rb(),i.Mc(5,$p,2,0,"span",17),i.Mc(6,Hp,2,0,"span",17),i.Mc(7,Wp,2,0,"span",30),i.Rb(),i.Rb()}if(2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(4),i.pc("ngbTypeahead",t.bucketDataSource),i.yb(1),i.pc("ngIf",t.nfsForm.showError("path",e,"required")),i.yb(1),i.pc("ngIf",t.nfsForm.showError("path",e,"pattern")),i.yb(1),i.pc("ngIf",t.isNewBucket&&!t.nfsForm.showError("path",e))}}function Bp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,121),i.Rb())}function Up(e,t){1&e&&(i.Sb(0,"div",10),i.Sb(1,"label",122),i.Qb(2),i.Wb(3,123),i.Pb(),i.Sb(4,"cd-helper"),i.Sb(5,"p"),i.cc(6,124),i.Nb(7,"strong"),i.Zb(),i.Rb(),i.Sb(8,"p"),i.Wb(9,125),i.Rb(),i.Sb(10,"p"),i.Wb(11,126),i.Rb(),i.Rb(),i.Rb(),i.Sb(12,"div",13),i.Nb(13,"input",127),i.Rb(),i.Rb())}function Gp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,134),i.Rb())}function qp(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,135),i.Rb())}function Jp(e,t){if(1&e&&(i.Sb(0,"div",10),i.Sb(1,"label",128),i.Sb(2,"span",129),i.Wb(3,130),i.Rb(),i.Sb(4,"cd-helper"),i.Sb(5,"p"),i.cc(6,131),i.Nb(7,"strong"),i.Nb(8,"strong"),i.Zb(),i.Rb(),i.Sb(9,"p"),i.Wb(10,132),i.Rb(),i.Rb(),i.Rb(),i.Sb(11,"div",13),i.Nb(12,"input",133),i.Mc(13,Gp,2,0,"span",17),i.Mc(14,qp,2,0,"span",17),i.Rb(),i.Rb()),2&e){i.ic();const e=i.Ac(2),t=i.ic();i.yb(13),i.pc("ngIf",t.nfsForm.showError("pseudo",e,"required")),i.yb(1),i.pc("ngIf",t.nfsForm.showError("pseudo",e,"pattern"))}}function Qp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,136),i.Rb())}function Kp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,137),i.Rb())}function Zp(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,138),i.Rb())}function Xp(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e.value),i.yb(1),i.Pc(e.value)}}function em(e,t){if(1&e&&(i.Sb(0,"span",115),i.Oc(1),i.Rb()),2&e){const e=i.ic(2);i.yb(1),i.Qc(" ",e.getAccessTypeHelp(e.nfsForm.getValue("access_type"))," ")}}function tm(e,t){1&e&&(i.Sb(0,"span",139),i.cc(1,140),i.Nb(2,"cd-doc",141),i.Zb(),i.Rb())}function nm(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,142),i.Rb())}function im(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,143),i.Rb())}function rm(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,144),i.Rb())}function sm(e,t){1&e&&(i.Sb(0,"option",50),i.Wb(1,145),i.Rb())}function om(e,t){if(1&e&&(i.Sb(0,"option",54),i.Oc(1),i.Rb()),2&e){const e=t.$implicit;i.pc("value",e),i.yb(1),i.Pc(e)}}function am(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,146),i.Rb())}function cm(e,t){1&e&&(i.Sb(0,"span",55),i.Wb(1,147),i.Rb())}function lm(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",1),i.Sb(1,"form",2,3),i.Sb(3,"div",4),i.Sb(4,"div",5),i.Wb(5,6),i.jc(6,"titlecase"),i.jc(7,"upperFirst"),i.Rb(),i.Sb(8,"div",7),i.Mc(9,tp,10,5,"div",8),i.Mc(10,lp,8,3,"div",8),i.Sb(11,"div",9),i.Sb(12,"div",10),i.Sb(13,"label",11),i.Wb(14,12),i.Rb(),i.Sb(15,"div",13),i.Sb(16,"select",14),i.gc("change",(function(){return i.Dc(e),i.ic().fsalChangeHandler()})),i.Mc(17,up,2,0,"option",15),i.Mc(18,dp,2,0,"option",15),i.Mc(19,hp,2,0,"option",15),i.Mc(20,fp,2,2,"option",16),i.Rb(),i.Mc(21,pp,2,0,"span",17),i.Rb(),i.Rb(),i.Mc(22,vp,10,5,"div",8),i.Mc(23,Dp,10,5,"div",8),i.Mc(24,Ep,10,5,"div",8),i.Rb(),i.Mc(25,jp,11,5,"div",8),i.Mc(26,zp,8,4,"div",8),i.Mc(27,Vp,8,4,"div",8),i.Sb(28,"div",10),i.Sb(29,"label",18),i.Wb(30,19),i.Rb(),i.Sb(31,"div",13),i.Sb(32,"div",20),i.Nb(33,"input",21),i.Sb(34,"label",22),i.Wb(35,23),i.Rb(),i.Rb(),i.Sb(36,"div",20),i.Nb(37,"input",24),i.Sb(38,"label",25),i.Wb(39,26),i.Rb(),i.Rb(),i.Mc(40,Bp,2,0,"span",17),i.Rb(),i.Rb(),i.Mc(41,Up,14,0,"div",8),i.Mc(42,Jp,15,2,"div",8),i.Sb(43,"div",10),i.Sb(44,"label",27),i.Wb(45,28),i.Rb(),i.Sb(46,"div",13),i.Sb(47,"select",29),i.gc("change",(function(){return i.Dc(e),i.ic().accessTypeChangeHandler()})),i.Mc(48,Qp,2,0,"option",15),i.Mc(49,Kp,2,0,"option",15),i.Mc(50,Zp,2,0,"option",15),i.Mc(51,Xp,2,2,"option",16),i.Rb(),i.Mc(52,em,2,1,"span",30),i.Mc(53,tm,3,0,"span",31),i.Mc(54,nm,2,0,"span",17),i.Rb(),i.Rb(),i.Sb(55,"div",10),i.Sb(56,"label",32),i.Wb(57,33),i.Rb(),i.Sb(58,"div",13),i.Sb(59,"select",34),i.Mc(60,im,2,0,"option",15),i.Mc(61,rm,2,0,"option",15),i.Mc(62,sm,2,0,"option",15),i.Mc(63,om,2,2,"option",16),i.Rb(),i.Mc(64,am,2,0,"span",17),i.Rb(),i.Rb(),i.Sb(65,"div",10),i.Sb(66,"label",35),i.Wb(67,36),i.Rb(),i.Sb(68,"div",13),i.Sb(69,"div",20),i.Nb(70,"input",37),i.Sb(71,"label",38),i.Wb(72,39),i.Rb(),i.Rb(),i.Sb(73,"div",20),i.Nb(74,"input",40),i.Sb(75,"label",41),i.Wb(76,42),i.Rb(),i.Rb(),i.Mc(77,cm,2,0,"span",17),i.Nb(78,"hr"),i.Rb(),i.Rb(),i.Nb(79,"cd-nfs-form-client",43,44),i.Rb(),i.Sb(81,"div",45),i.Sb(82,"cd-form-button-panel",46),i.gc("submitActionEvent",(function(){return i.Dc(e),i.ic().submitAction()})),i.jc(83,"titlecase"),i.jc(84,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(2),t=i.ic();i.yb(1),i.pc("formGroup",t.nfsForm),i.yb(6),i.ac(i.kc(6,36,t.action))(i.kc(7,38,t.resource)),i.Xb(5),i.yb(2),i.pc("ngIf",!t.isDefaultCluster),i.yb(1),i.pc("ngIf",t.clusterType),i.yb(7),i.pc("ngIf",null===t.allFsals),i.yb(1),i.pc("ngIf",null!==t.allFsals&&0===t.allFsals.length),i.yb(1),i.pc("ngIf",null!==t.allFsals&&t.allFsals.length>0),i.yb(1),i.pc("ngForOf",t.allFsals),i.yb(1),i.pc("ngIf",t.nfsForm.showError("name",e,"required")),i.yb(1),i.pc("ngIf","RGW"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf","CEPH"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf","CEPH"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf","CEPH"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf","CEPH"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf","RGW"===t.nfsForm.getValue("name")),i.yb(13),i.pc("ngIf",t.nfsForm.showError("protocolNfsv3",e,"required")||t.nfsForm.showError("protocolNfsv4",e,"required")),i.yb(1),i.pc("ngIf",t.nfsForm.getValue("protocolNfsv3")),i.yb(1),i.pc("ngIf",t.nfsForm.getValue("protocolNfsv4")),i.yb(6),i.pc("ngIf",null===t.nfsAccessType),i.yb(1),i.pc("ngIf",null!==t.nfsAccessType&&0===t.nfsAccessType.length),i.yb(1),i.pc("ngIf",null!==t.nfsAccessType&&t.nfsAccessType.length>0),i.yb(1),i.pc("ngForOf",t.nfsAccessType),i.yb(1),i.pc("ngIf",t.nfsForm.getValue("access_type")),i.yb(1),i.pc("ngIf","RW"===t.nfsForm.getValue("access_type")&&"RGW"===t.nfsForm.getValue("name")),i.yb(1),i.pc("ngIf",t.nfsForm.showError("access_type",e,"required")),i.yb(6),i.pc("ngIf",null===t.nfsSquash),i.yb(1),i.pc("ngIf",null!==t.nfsSquash&&0===t.nfsSquash.length),i.yb(1),i.pc("ngIf",null!==t.nfsSquash&&t.nfsSquash.length>0),i.yb(1),i.pc("ngForOf",t.nfsSquash),i.yb(1),i.pc("ngIf",t.nfsForm.showError("squash",e,"required")),i.yb(13),i.pc("ngIf",t.nfsForm.showError("transportUDP",e,"required")||t.nfsForm.showError("transportTCP",e,"required")),i.yb(2),i.pc("form",t.nfsForm)("clients",t.clients),i.yb(3),i.pc("form",t.nfsForm)("submitText",i.kc(83,40,t.action)+" "+i.kc(84,42,t.resource))}}let um=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o,a,c){super(),this.authStorageService=e,this.nfsService=t,this.route=n,this.router=i,this.rgwUserService=r,this.formBuilder=s,this.taskWrapper=o,this.cdRef=a,this.actionLabels=c,this.clients=[],this.isEdit=!1,this.cluster_id=null,this.clusterType=null,this.export_id=null,this.isNewDirectory=!1,this.isNewBucket=!1,this.isDefaultCluster=!1,this.allClusters=null,this.allDaemons={},this.icons=_n.a,this.allFsals=[],this.allRgwUsers=[],this.allCephxClients=null,this.allFsNames=null,this.defaultAccessType={RGW:"RO"},this.nfsAccessType=this.nfsService.nfsAccessType,this.nfsSquash=this.nfsService.nfsSquash,this.daemonsSelections=[],this.daemonsMessages=new er.a({noOptions:"There are no daemons available."}),this.pathDataSource=e=>e.pipe(au(200),Object(du.a)(),Object(Ki.a)(e=>this.getPathTypeahead(e)),Object(Vi.a)(e=>e.paths)),this.bucketDataSource=e=>e.pipe(au(200),Object(du.a)(),Object(Ki.a)(e=>this.getBucketTypeahead(e))),this.permission=this.authStorageService.getPermissions().pool,this.resource="NFS export",this.createForm()}ngOnInit(){const e=[this.nfsService.daemon(),this.nfsService.fsals(),this.nfsService.clients(),this.nfsService.filesystems()];this.router.url.startsWith("/nfs/edit")&&(this.isEdit=!0),this.isEdit?(this.action=this.actionLabels.EDIT,this.route.params.subscribe(t=>{this.cluster_id=decodeURIComponent(t.cluster_id),this.export_id=decodeURIComponent(t.export_id),e.push(this.nfsService.get(this.cluster_id,this.export_id)),this.getData(e)}),this.nfsForm.get("cluster_id").disable()):(this.action=this.actionLabels.CREATE,this.getData(e))}getData(e){Object(jo.a)(e).subscribe(e=>{this.resolveDaemons(e[0]),this.resolveFsals(e[1]),this.resolveClients(e[2]),this.resolveFilesystems(e[3]),e[4]&&this.resolveModel(e[4]),this.loadingReady()})}createForm(){this.nfsForm=new Jn.a({cluster_id:new xn.h("",{validators:[xn.A.required]}),daemons:new xn.h([]),fsal:new Jn.a({name:new xn.h("",{validators:[xn.A.required]}),user_id:new xn.h("",{validators:[Cn.a.requiredIf({name:"CEPH"})]}),fs_name:new xn.h("",{validators:[Cn.a.requiredIf({name:"CEPH"})]}),rgw_user_id:new xn.h("",{validators:[Cn.a.requiredIf({name:"RGW"})]})}),path:new xn.h(""),protocolNfsv3:new xn.h(!1,{validators:[Cn.a.requiredIf({protocolNfsv4:!1},e=>!e)]}),protocolNfsv4:new xn.h(!0,{validators:[Cn.a.requiredIf({protocolNfsv3:!1},e=>!e)]}),tag:new xn.h(""),pseudo:new xn.h("",{validators:[Cn.a.requiredIf({protocolNfsv4:!0}),xn.A.pattern("^/[^><|&()]*$")]}),access_type:new xn.h("RW",{validators:[xn.A.required]}),squash:new xn.h("",{validators:[xn.A.required]}),transportUDP:new xn.h(!0,{validators:[Cn.a.requiredIf({transportTCP:!1},e=>!e)]}),transportTCP:new xn.h(!0,{validators:[Cn.a.requiredIf({transportUDP:!1},e=>!e)]}),clients:this.formBuilder.array([]),security_label:new xn.h(!1),sec_label_xattr:new xn.h("security.selinux",Cn.a.requiredIf({security_label:!0,"fsal.name":"CEPH"}))})}resolveModel(e){"CEPH"===e.fsal.name&&(e.sec_label_xattr=e.fsal.sec_label_xattr),this.clusterType===Nf.user&&(this.daemonsSelections=Nt.a.map(this.allDaemons[e.cluster_id],t=>new Gu.a(-1!==e.daemons.indexOf(t),t,"")),this.daemonsSelections=[...this.daemonsSelections]),e.protocolNfsv3=-1!==e.protocols.indexOf(3),e.protocolNfsv4=-1!==e.protocols.indexOf(4),delete e.protocols,e.transportTCP=-1!==e.transports.indexOf("TCP"),e.transportUDP=-1!==e.transports.indexOf("UDP"),delete e.transports,e.clients.forEach(e=>{let t="";e.addresses.forEach(e=>{t+=e+", "}),t.length>=2&&(t=t.substring(0,t.length-2)),e.addresses=t}),this.nfsForm.patchValue(e),this.setPathValidation(),this.clients=e.clients}resolveDaemons(e){var t;e=Nt.a.sortBy(e,["daemon_id"]);const n=Nt.a.groupBy(e,"cluster_id");this.allClusters=[],Nt.a.forIn(n,(e,t)=>{this.allClusters.push({cluster_id:t,cluster_type:e[0].cluster_type}),this.allDaemons[t]=[]}),Nt.a.forEach(e,e=>{this.allDaemons[e.cluster_id].push(e.daemon_id)}),this.isEdit&&(this.clusterType=null===(t=Nt.a.find(this.allClusters,{cluster_id:this.cluster_id}))||void 0===t?void 0:t.cluster_type);const i=Nt.a.isArray(this.allClusters)&&1===this.allClusters.length;this.isDefaultCluster=i&&"_default_"===this.allClusters[0].cluster_id,i&&(this.nfsForm.patchValue({cluster_id:this.allClusters[0].cluster_id}),this.onClusterChange())}resolveFsals(e){e.forEach(e=>{const t=this.nfsService.nfsFsal.find(t=>e===t.value);Nt.a.isObjectLike(t)&&(this.allFsals.push(t),"RGW"===t.value&&this.rgwUserService.list().subscribe(e=>{e.forEach(e=>{0===e.suspended&&e.keys.length>0&&this.allRgwUsers.push(e.tenant?`${e.tenant}$${e.user_id}`:e.user_id)})}))}),1===this.allFsals.length&&Nt.a.isUndefined(this.nfsForm.getValue("fsal"))&&this.nfsForm.patchValue({fsal:this.allFsals[0]})}resolveClients(e){this.allCephxClients=e}resolveFilesystems(e){this.allFsNames=e,1===e.length&&this.nfsForm.patchValue({fsal:{fs_name:e[0].name}})}fsalChangeHandler(){this.nfsForm.patchValue({tag:this._generateTag(),pseudo:this._generatePseudo(),access_type:this._updateAccessType()}),this.setPathValidation(),this.cdRef.detectChanges()}accessTypeChangeHandler(){const e=this.nfsForm.getValue("name"),t=this.nfsForm.getValue("access_type");this.defaultAccessType[e]=t}setPathValidation(){"RGW"===this.nfsForm.getValue("name")?this.nfsForm.get("path").setValidators([xn.A.required,xn.A.pattern("^(/|[^/><|&()#?]+)$")]):this.nfsForm.get("path").setValidators([xn.A.required,xn.A.pattern("^/[^><|&()?]*$")])}rgwUserIdChangeHandler(){this.nfsForm.patchValue({pseudo:this._generatePseudo()})}getAccessTypeHelp(e){const t=this.nfsAccessType.find(t=>{if(e===t.value)return t});return Nt.a.isObjectLike(t)?t.help:""}getId(){return Nt.a.isString(this.nfsForm.getValue("cluster_id"))&&Nt.a.isString(this.nfsForm.getValue("path"))?this.nfsForm.getValue("cluster_id")+":"+this.nfsForm.getValue("path"):""}getPathTypeahead(e){if(!Nt.a.isString(e)||"/"===e)return Object(Wi.a)([]);const t=this.nfsForm.getValue("fsal").fs_name;return this.nfsService.lsDir(t,e)}pathChangeHandler(){this.nfsForm.patchValue({pseudo:this._generatePseudo()});const e=this.nfsForm.getValue("path");this.getPathTypeahead(e).subscribe(t=>{this.isNewDirectory="/"!==e&&-1===t.paths.indexOf(e)})}bucketChangeHandler(){this.nfsForm.patchValue({tag:this._generateTag(),pseudo:this._generatePseudo()});const e=this.nfsForm.getValue("path");this.getBucketTypeahead(e).subscribe(t=>{this.isNewBucket=""!==e&&-1===t.indexOf(e)})}getBucketTypeahead(e){const t=this.nfsForm.getValue("rgw_user_id");return Nt.a.isString(t)&&Nt.a.isString(e)&&"/"!==e&&""!==e?this.nfsService.buckets(t):Object(Wi.a)([])}_generateTag(){let e=this.nfsForm.getValue("tag");return this.nfsForm.get("tag").dirty||(e=void 0,"RGW"===this.nfsForm.getValue("fsal")&&(e=this.nfsForm.getValue("path"))),e}_generatePseudo(){let e=this.nfsForm.getValue("pseudo");return this.nfsForm.get("pseudo")&&!this.nfsForm.get("pseudo").dirty&&(e=void 0,"CEPH"===this.nfsForm.getValue("fsal")?(e="/cephfs",Nt.a.isString(this.nfsForm.getValue("path"))&&(e+=this.nfsForm.getValue("path"))):"RGW"===this.nfsForm.getValue("fsal")&&Nt.a.isString(this.nfsForm.getValue("rgw_user_id"))&&(e="/"+this.nfsForm.getValue("rgw_user_id"),Nt.a.isString(this.nfsForm.getValue("path"))&&(e+="/"+this.nfsForm.getValue("path")))),e}_updateAccessType(){const e=this.nfsForm.getValue("name");let t=this.defaultAccessType[e];return t||(t="RW"),t}onClusterChange(){var e;const t=this.nfsForm.getValue("cluster_id");this.clusterType=null===(e=Nt.a.find(this.allClusters,{cluster_id:t}))||void 0===e?void 0:e.cluster_type,this.clusterType===Nf.user?(this.daemonsSelections=Nt.a.map(this.allDaemons[t],e=>new Gu.a(!1,e,"")),this.daemonsSelections=[...this.daemonsSelections]):this.daemonsSelections=[],this.nfsForm.patchValue({daemons:[]})}removeDaemon(e,t){this.daemonsSelections.forEach(e=>{e.name===t&&(e.selected=!1)});const n=this.nfsForm.get("daemons");return n.value.splice(e,1),n.setValue(n.value),!1}onDaemonSelection(){this.nfsForm.get("daemons").setValue(this.nfsForm.getValue("daemons"))}onToggleAllDaemonsSelection(){const e=this.nfsForm.getValue("cluster_id"),t=0===this.nfsForm.getValue("daemons").length?this.allDaemons[e]:[];this.nfsForm.patchValue({daemons:t})}submitAction(){let e;const t=this._buildRequest();e=this.taskWrapper.wrapTaskAroundCall(this.isEdit?{task:new tr.a("nfs/edit",{cluster_id:this.cluster_id,export_id:this.export_id}),call:this.nfsService.update(this.cluster_id,this.export_id,t)}:{task:new tr.a("nfs/create",{path:t.path,fsal:t.fsal,cluster_id:t.cluster_id}),call:this.nfsService.create(t)}),e.subscribe({error:()=>this.nfsForm.setErrors({cdSubmitButton:!0}),complete:()=>this.router.navigate(["/nfs"])})}_buildRequest(){const e=Nt.a.cloneDeep(this.nfsForm.value);return(Nt.a.isUndefined(e.tag)||""===e.tag)&&(e.tag=null),this.isEdit&&(e.export_id=this.export_id),"CEPH"===e.fsal.name?delete e.fsal.rgw_user_id:(delete e.fsal.fs_name,delete e.fsal.user_id),e.protocols=[],e.protocolNfsv3?e.protocols.push(3):e.tag=null,delete e.protocolNfsv3,e.protocolNfsv4?e.protocols.push(4):e.pseudo=null,delete e.protocolNfsv4,e.transports=[],e.transportTCP&&e.transports.push("TCP"),delete e.transportTCP,e.transportUDP&&e.transports.push("UDP"),delete e.transportUDP,e.clients.forEach(t=>{t.addresses=Nt.a.isString(t.addresses)?Nt()(t.addresses).split(/[ ,]+/).uniq().filter(e=>""!==e).value():[],t.squash||(t.squash=e.squash),t.access_type||(t.access_type=e.access_type)}),e.fsal.sec_label_xattr=!1===e.security_label||"RGW"===e.fsal.name?null:e.sec_label_xattr,delete e.sec_label_xattr,e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Pf),i.Mb(Pt.a),i.Mb(Pt.e),i.Mb(jf.a),i.Mb(Fo.a),i.Mb(nr.a),i.Mb(i.h),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-nfs-form"]],viewQuery:function(e,t){var n;1&e&&i.Jc(Jf,!0),2&e&&i.zc(n=i.hc())&&(t.nfsClients=n.first)},features:[i.vb],decls:1,vars:1,consts:function(){var e,t,n,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,y,v,w,S,M,x,k,D,T,C,O,R,L,E,A,I,P,j,N,F,Y,z,$,H,W,V,B,U,G,q,J,Q,K,Z,X,ee,te,ne;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Storage Backend",n="NFS Protocol",r="NFSv3",s="NFSv4",o="Access Type",a="Squash",c="Transport Protocol",l="UDP",u="TCP",d="Cluster",h="Loading...",f="-- No cluster available --",p="-- Select the cluster --",m="This field is required.",b="Daemons",g="Add daemon",_="Add all daemons",y="Remove all daemons",v="Loading...",w="-- No data pools available --",S="-- Select the storage backend --",M="This field is required.",x="Object Gateway User",k="Loading...",D="-- No users available --",T="-- Select the object gateway user --",C="This field is required.",O="CephFS User ID",R="Loading...",L="-- No clients available --",E="-- Select the cephx client --",A="This field is required.",I="CephFS Name",P="Loading...",j="-- No CephFS filesystem available --",N="-- Select the CephFS filesystem --",F="This field is required.",Y="Security Label",z="Enable security label",$="This field is required.",H="CephFS Path",W="This field is required.",V="Path need to start with a '/' and can be followed by a word",B="New directory will be created",U="Path",G="This field is required.",q="Path can only be a single '/' or a word",J="New bucket will be created",Q="This field is required.",K="NFS Tag",Z="Alternative access for " + "\ufffd#7\ufffd" + "NFS v3" + "\ufffd/#7\ufffd" + " mounts (it must not have a leading /).",X="Clients may not mount subdirectories (i.e. if Tag = foo, the client may not mount foo/baz).",ee="By using different Tag options, the same Path may be exported multiple times.",te="Pseudo",ne="The position that this " + "[\ufffd#7\ufffd|\ufffd#8\ufffd]" + "NFS v4" + "[\ufffd/#7\ufffd|\ufffd/#8\ufffd]" + " export occupies in the " + "[\ufffd#7\ufffd|\ufffd#8\ufffd]" + "Pseudo FS" + "[\ufffd/#7\ufffd|\ufffd/#8\ufffd]" + " (it must be unique).",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","nfsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],["class","form-group row",4,"ngIf"],["formGroupName","fsal"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["formControlName","name","name","name","id","name",1,"form-control","custom-select",3,"change"],["value","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],["for","protocols",1,"cd-col-form-label","required"],n,[1,"custom-control","custom-checkbox"],["type","checkbox","id","protocolNfsv3","name","protocolNfsv3","formControlName","protocolNfsv3","disabled","",1,"custom-control-input"],["for","protocolNfsv3",1,"custom-control-label"],r,["type","checkbox","formControlName","protocolNfsv4","name","protocolNfsv4","id","protocolNfsv4",1,"custom-control-input"],["for","protocolNfsv4",1,"custom-control-label"],s,["for","access_type",1,"cd-col-form-label","required"],o,["formControlName","access_type","name","access_type","id","access_type",1,"form-control","custom-select",3,"change"],["class","form-text text-muted",4,"ngIf"],["class","form-text text-warning",4,"ngIf"],["for","squash",1,"cd-col-form-label","required"],a,["name","squash","formControlName","squash","id","squash",1,"form-control","custom-select"],["for","transports",1,"cd-col-form-label","required"],c,["type","checkbox","formControlName","transportUDP","name","transportUDP","id","transportUDP",1,"custom-control-input"],["for","transportUDP",1,"custom-control-label"],l,["type","checkbox","formControlName","transportTCP","name","transportTCP","id","transportTCP",1,"custom-control-input"],["for","transportTCP",1,"custom-control-label"],u,[3,"form","clients"],["nfsClients",""],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","cluster_id",1,"cd-col-form-label","required"],d,["formControlName","cluster_id","name","cluster_id","id","cluster_id",1,"form-control","custom-select",3,"change"],["value",""],h,f,p,[3,"value"],[1,"invalid-feedback"],m,["for","daemons",1,"cd-col-form-label"],b,[4,"ngFor","ngForOf"],["class","row",4,"ngIf"],[1,"input-group","cd-mb"],["type","text","disabled","",1,"cd-form-control",3,"value"],["class","input-group-append",4,"ngIf"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],[1,"row"],[1,"col-md-12"],["elemClass","btn btn-light float-right",3,"data","options","messages","selection"],[3,"ngClass"],g,["type","button",1,"btn","btn-light","float-right",3,"click"],[4,"ngIf","ngIfElse"],["hasDaemons",""],_,y,v,w,S,M,["for","rgw_user_id",1,"cd-col-form-label","required"],x,["formControlName","rgw_user_id","name","rgw_user_id","id","rgw_user_id",1,"form-control","custom-select",3,"change"],k,D,T,C,["for","user_id",1,"cd-col-form-label","required"],O,["formControlName","user_id","name","user_id","id","user_id",1,"form-control","custom-select"],R,L,E,A,["for","fs_name",1,"cd-col-form-label","required"],I,["formControlName","fs_name","name","fs_name","id","fs_name",1,"form-control","custom-select",3,"change"],P,j,N,F,["for","security_label",1,"cd-col-form-label",3,"ngClass"],Y,["type","checkbox","formControlName","security_label","name","security_label","id","security_label",1,"custom-control-input"],["for","security_label",1,"custom-control-label"],z,["type","text","class","form-control","name","sec_label_xattr","id","sec_label_xattr","formControlName","sec_label_xattr",4,"ngIf"],["type","text","name","sec_label_xattr","id","sec_label_xattr","formControlName","sec_label_xattr",1,"form-control"],$,["for","path",1,"cd-col-form-label","required"],H,["type","text","name","path","id","path","formControlName","path",1,"form-control",3,"ngbTypeahead","selectItem","blur"],W,V,[1,"form-text","text-muted"],B,U,G,q,J,Q,["for","tag",1,"cd-col-form-label"],K,Z,X,ee,["type","text","name","tag","id","tag","formControlName","tag",1,"form-control"],["for","pseudo",1,"cd-col-form-label"],[1,"required"],te,ne=i.bc(ne),"By using different Pseudo options, the same Path may be exported multiple times.",["type","text","name","pseudo","id","pseudo","formControlName","pseudo",1,"form-control"],"This field is required.","Pseudo needs to start with a '/' and can't contain any of the following: >, <, |, &, ( or ).","Loading...","-- No access type available --","-- Select the access type --",[1,"form-text","text-warning"],"The Object Gateway NFS backend has a number of limitations which will seriously affect applications writing to the share. Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " for details before enabling write access.",["section","rgw-nfs"],"This field is required.","Loading...","-- No squash available --","--Select what kind of user id squashing is performed --","This field is required.","This field is required."]},template:function(e,t){1&e&&i.Mc(0,lm,85,44,"div",0),2&e&&i.pc("cdFormLoading",t.loading)},directives:[Kn.a,xn.C,xn.r,xn.k,Zn.a,o.r,xn.l,Xn.a,On.a,xn.z,ei.a,xn.q,xn.i,o.q,xn.b,Gf,ti.a,xn.u,xn.B,o.p,qf.a,xn.d,Qt.G,Yo.a,Rr.a],pipes:[o.A,sr.a],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),e})();var dm=n("VTlA");function hm(e,t){if(1&e&&i.Nb(0,"cd-table-key-value",10),2&e){const e=i.ic(2);i.pc("data",e.data)}}function fm(e,t){if(1&e&&i.Nb(0,"cd-table",11,12),2&e){const e=i.ic(2);i.pc("data",e.clients)("columns",e.clientsColumns)}}function pm(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"ul",1,2),i.Sb(3,"li",3),i.Sb(4,"a",4),i.Wb(5,5),i.Rb(),i.Mc(6,hm,1,1,"ng-template",6),i.Rb(),i.Sb(7,"li",7),i.Sb(8,"a",4),i.Wb(9,8),i.Rb(),i.Mc(10,fm,2,2,"ng-template",6),i.Rb(),i.Rb(),i.Nb(11,"div",9),i.Pb()),2&e){const e=i.Ac(2),t=i.ic();i.yb(9),i.ac(t.clients.length),i.Xb(9),i.yb(2),i.pc("ngbNavOutlet",e)}}let mm=(()=>{class e{constructor(){this.clients=[],this.clientsColumns=[{name:"Addresses",prop:"addresses",flexGrow:2},{name:"Access Type",prop:"access_type",flexGrow:1},{name:"Squash",prop:"squash",flexGrow:1}]}ngOnChanges(){this.selection&&(this.selectedItem=this.selection,this.clients=this.selectedItem.clients,this.data={},this.data["Cluster"]=this.selectedItem.cluster_id,this.data["Daemons"]=this.selectedItem.daemons,this.data["NFS Protocol"]=this.selectedItem.protocols.map(e=>"NFSv"+e),this.data["Pseudo"]=this.selectedItem.pseudo,this.data["Access Type"]=this.selectedItem.access_type,this.data["Squash"]=this.selectedItem.squash,this.data["Transport"]=this.selectedItem.transports,this.data["Path"]=this.selectedItem.path,"CEPH"===this.selectedItem.fsal.name?(this.data["Storage Backend"]="CephFS",this.data["CephFS User"]=this.selectedItem.fsal.user_id,this.data["CephFS Filesystem"]=this.selectedItem.fsal.fs_name,this.data["Security Label"]=this.selectedItem.fsal.sec_label_xattr):(this.data["Storage Backend"]="Object Gateway",this.data["Object Gateway User"]=this.selectedItem.fsal.rgw_user_id))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-nfs-details"]],inputs:{selection:"selection"},features:[i.wb],decls:1,vars:1,consts:function(){return[[4,"ngIf"],["ngbNav","","cdStatefulTab","nfs-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","clients"],"Clients (" + "\ufffd0\ufffd" + ")",[3,"ngbNavOutlet"],[3,"data"],["columnMode","flex","identifier","addresses","forceIdentifier","true","selectionType","",3,"data","columns"],["table",""]]},template:function(e,t){1&e&&i.Mc(0,pm,12,2,"ng-container",0),2&e&&i.pc("ngIf",t.selection)},directives:[o.r,Qt.p,Kt.a,Qt.r,Qt.s,Qt.q,Qt.u,en.a,Bt.a],styles:[""]}),e})();const bm=["nfsState"],gm=["nfsFsal"],_m=["table"];function ym(e,t){1&e&&(i.Qb(0),i.Wb(1,7),i.Pb())}function vm(e,t){1&e&&(i.Qb(0),i.Wb(1,8),i.Pb())}function wm(e,t){if(1&e&&(i.Mc(0,ym,2,0,"ng-container",6),i.Mc(1,vm,2,0,"ng-container",6)),2&e){const e=t.value;i.pc("ngIf","CEPH"===e.name),i.yb(1),i.pc("ngIf","RGW"===e.name)}}let Sm=(()=>{class e extends $t.a{constructor(e,t,n,i,r,s){super(),this.authStorageService=e,this.modalService=t,this.nfsService=n,this.taskListService=i,this.taskWrapper=r,this.actionLabels=s,this.selection=new Wt.a,this.isDefaultCluster=!1,this.builders={"nfs/create":e=>({path:e.path,cluster_id:e.cluster_id,fsal:e.fsal})},this.permission=this.authStorageService.getPermissions().nfs;const o=()=>this.selection.first()&&`${encodeURI(this.selection.first().cluster_id)}/${encodeURI(this.selection.first().export_id)}`;this.tableActions=[{permission:"create",icon:_n.a.add,routerLink:()=>"/nfs/create",canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:_n.a.edit,routerLink:()=>"/nfs/edit/"+o(),name:this.actionLabels.EDIT},{permission:"delete",icon:_n.a.destroy,click:()=>this.deleteNfsModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Path",prop:"path",flexGrow:2,cellTransformation:Ht.a.executing},{name:"Pseudo",prop:"pseudo",flexGrow:2},{name:"Cluster",prop:"cluster_id",flexGrow:2},{name:"Daemons",prop:"daemons",flexGrow:2},{name:"Storage Backend",prop:"fsal",flexGrow:2,cellTemplate:this.nfsFsal},{name:"Access Type",prop:"access_type",flexGrow:2}],this.nfsService.daemon().subscribe(e=>{const t=Nt()(e).map(e=>e.cluster_id).uniq().value();this.isDefaultCluster=1===t.length&&"_default_"===t[0],this.columns[2].isHidden=this.isDefaultCluster,this.table&&this.table.updateColumns(),this.taskListService.init(()=>this.nfsService.list(),e=>this.prepareResponse(e),e=>this.exports=e,()=>this.onFetchError(),this.taskFilter,this.itemFilter,this.builders)},()=>{this.onFetchError()})}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}prepareResponse(e){let t=[];return e.forEach(e=>{e.id=`${e.cluster_id}:${e.export_id}`,e.state="LOADING",t=t.concat(e)}),t}onFetchError(){this.table.reset(),this.viewCacheStatus={status:qt.a.ValueException}}itemFilter(e,t){return e.cluster_id===t.metadata.cluster_id&&e.export_id===t.metadata.export_id}taskFilter(e){return["nfs/create","nfs/delete","nfs/edit"].includes(e.name)}updateSelection(e){this.selection=e}deleteNfsModal(){const e=this.selection.first().cluster_id,t=this.selection.first().export_id;this.modalRef=this.modalService.show(bn.a,{itemDescription:"NFS export",itemNames:[`${e}:${t}`],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new tr.a("nfs/delete",{cluster_id:e,export_id:t}),call:this.nfsService.delete(e,t)})})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(vn.a),i.Mb(Pf),i.Mb(dm.a),i.Mb(nr.a),i.Mb(gn.b))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-nfs-list"]],viewQuery:function(e,t){var n;1&e&&(i.Tc(bm,!0),i.Jc(gm,!0),i.Jc(_m,!0)),2&e&&(i.zc(n=i.hc())&&(t.nfsState=n.first),i.zc(n=i.hc())&&(t.nfsFsal=n.first),i.zc(n=i.hc())&&(t.table=n.first))},features:[i.xb([dm.a]),i.vb],decls:7,vars:7,consts:function(){return[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["nfsFsal",""],[4,"ngIf"],"CephFS","Object Gateway"]},template:function(e,t){1&e&&(i.Sb(0,"cd-table",0,1),i.gc("setExpandedRow",(function(e){return t.setExpandedRow(e)}))("updateSelection",(function(e){return t.updateSelection(e)})),i.Sb(2,"div",2),i.Nb(3,"cd-table-actions",3),i.Rb(),i.Nb(4,"cd-nfs-details",4),i.Rb(),i.Mc(5,wm,2,2,"ng-template",null,5,i.Nc)),2&e&&(i.pc("data",t.exports)("columns",t.columns)("hasDetails",!0),i.yb(3),i.pc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),i.yb(1),i.pc("selection",t.expandedRow))},directives:[Bt.a,Sn.a,mm,o.r],styles:[""]}),e})(),Mm=(()=>{class e{constructor(t){this.route=t,this.route.queryParams.subscribe(t=>{this.fromLink=t.fromLink||e.defaultFromLink}),this.route.params.subscribe(e=>{this.serviceId=decodeURIComponent(e.id),this.serviceType=e.type})}}return e.defaultFromLink="/hosts",e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-performance-counter"]],decls:3,vars:4,consts:[[3,"serviceType","serviceId"]],template:function(e,t){1&e&&(i.Sb(0,"legend"),i.Oc(1),i.Rb(),i.Nb(2,"cd-table-performance-counter",0)),2&e&&(i.yb(1),i.Rc("",t.serviceType,".",t.serviceId,""),i.yb(1),i.pc("serviceType",t.serviceType)("serviceId",t.serviceId))},directives:[nl.a],styles:[""]}),e})();var xm=n("DSvg"),km=n("Mxhz"),Dm=n("1nQr");function Tm(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,31),i.Rb())}function Cm(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,32),i.Rb())}function Om(e,t){if(1&e&&i.Nb(0,"cd-helper",33),2&e){const e=i.ic();i.qc("html",e.passwordPolicyHelpText)}}function Rm(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,34),i.Rb())}function Lm(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,35),i.Rb())}function Em(e,t){if(1&e&&(i.Sb(0,"span",30),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Qc(" ",e.passwordValuation," ")}}function Am(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,36),i.Rb())}function Im(e,t){1&e&&(i.Sb(0,"span",30),i.Wb(1,37),i.Rb())}let Pm=(()=>{class e{constructor(e,t,n,i,r,s,o){this.actionLabels=e,this.notificationService=t,this.userService=n,this.authStorageService=i,this.formBuilder=r,this.router=s,this.passwordPolicyService=o,this.passwordPolicyHelpText="",this.icons=_n.a,this.action=this.actionLabels.CHANGE,this.resource="password",this.createForm()}createForm(){this.passwordPolicyService.getHelpText().subscribe(e=>{this.passwordPolicyHelpText=e}),this.userForm=this.formBuilder.group({oldpassword:[null,[xn.A.required,Cn.a.custom("notmatch",()=>this.userForm&&this.userForm.getValue("newpassword")===this.userForm.getValue("oldpassword"))]],newpassword:[null,[xn.A.required,Cn.a.custom("notmatch",()=>this.userForm&&this.userForm.getValue("oldpassword")===this.userForm.getValue("newpassword"))],[Cn.a.passwordPolicy(this.userService,()=>this.authStorageService.getUsername(),(e,t,n)=>{this.passwordStrengthLevelClass=this.passwordPolicyService.mapCreditsToCssClass(t),this.passwordValuation=Nt.a.defaultTo(n,"")})]],confirmnewpassword:[null,[xn.A.required]]},{validators:[Cn.a.match("newpassword","confirmnewpassword")]})}onSubmit(){if(this.userForm.pristine)return;const e=this.authStorageService.getUsername(),t=this.userForm.getValue("oldpassword"),n=this.userForm.getValue("newpassword");this.userService.changePassword(e,t,n).subscribe(()=>this.onPasswordChange(),()=>{this.userForm.setErrors({cdSubmitButton:!0})})}onPasswordChange(){this.notificationService.show(yn.a.success,"Updated user password\""),this.router.navigate(["/login"])}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(wn.a),i.Mb(km.a),i.Mb(Jt.a),i.Mb(Fo.a),i.Mb(Pt.e),i.Mb(Dm.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-user-password-form"]],decls:48,vars:25,consts:function(){return[[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","oldpassword",1,"cd-col-form-label","required"],"Old password",[1,"cd-col-form-input"],[1,"input-group"],["type","password","placeholder","Old password...","id","oldpassword","formControlName","oldpassword","autocomplete","new-password","autofocus","",1,"form-control"],[1,"input-group-append"],["cdPasswordButton","oldpassword",1,"btn","btn-light"],["class","invalid-feedback",4,"ngIf"],["for","newpassword",1,"cd-col-form-label"],[1,"required"],"New password",["class","text-pre-wrap",3,"html",4,"ngIf"],["type","password","placeholder","Password...","id","newpassword","autocomplete","new-password","formControlName","newpassword",1,"form-control"],["type","button","cdPasswordButton","newpassword",1,"btn","btn-light"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],["for","confirmnewpassword",1,"cd-col-form-label","required"],"Confirm new password",["type","password","autocomplete","new-password","placeholder","Confirm new password...","id","confirmnewpassword","formControlName","confirmnewpassword",1,"form-control"],["cdPasswordButton","confirmnewpassword",1,"btn","btn-light"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required.","The old and new passwords must be different.",[1,"text-pre-wrap",3,"html"],"This field is required.","The old and new passwords must be different.","This field is required.","Password confirmation doesn't match the new password."]},template:function(e,t){if(1&e&&(i.Sb(0,"div",0),i.Sb(1,"form",1,2),i.Sb(3,"div",3),i.Sb(4,"div",4),i.Wb(5,5),i.jc(6,"titlecase"),i.jc(7,"upperFirst"),i.Rb(),i.Sb(8,"div",6),i.Sb(9,"div",7),i.Sb(10,"label",8),i.Wb(11,9),i.Rb(),i.Sb(12,"div",10),i.Sb(13,"div",11),i.Nb(14,"input",12),i.Sb(15,"span",13),i.Nb(16,"button",14),i.Rb(),i.Rb(),i.Mc(17,Tm,2,0,"span",15),i.Mc(18,Cm,2,0,"span",15),i.Rb(),i.Rb(),i.Sb(19,"div",7),i.Sb(20,"label",16),i.Sb(21,"span",17),i.Wb(22,18),i.Rb(),i.Mc(23,Om,1,1,"cd-helper",19),i.Rb(),i.Sb(24,"div",10),i.Sb(25,"div",11),i.Nb(26,"input",20),i.Sb(27,"span",13),i.Nb(28,"button",21),i.Rb(),i.Rb(),i.Sb(29,"div",22),i.Nb(30,"div",23),i.Rb(),i.Mc(31,Rm,2,0,"span",15),i.Mc(32,Lm,2,0,"span",15),i.Mc(33,Em,2,1,"span",15),i.Rb(),i.Rb(),i.Sb(34,"div",7),i.Sb(35,"label",24),i.Wb(36,25),i.Rb(),i.Sb(37,"div",10),i.Sb(38,"div",11),i.Nb(39,"input",26),i.Sb(40,"span",13),i.Nb(41,"button",27),i.Rb(),i.Rb(),i.Mc(42,Am,2,0,"span",15),i.Mc(43,Im,2,0,"span",15),i.Rb(),i.Rb(),i.Rb(),i.Sb(44,"div",28),i.Sb(45,"cd-form-button-panel",29),i.gc("submitActionEvent",(function(){return t.onSubmit()})),i.jc(46,"titlecase"),i.jc(47,"upperFirst"),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(2);i.yb(1),i.pc("formGroup",t.userForm),i.yb(6),i.ac(i.kc(6,17,t.action))(i.kc(7,19,t.resource)),i.Xb(5),i.yb(10),i.pc("ngIf",t.userForm.showError("oldpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("oldpassword",e,"notmatch")),i.yb(5),i.pc("ngIf",t.passwordPolicyHelpText.length>0),i.yb(7),i.Ab(t.passwordStrengthLevelClass),i.qc("title",t.passwordValuation),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"notmatch")),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"passwordPolicy")),i.yb(9),i.pc("ngIf",t.userForm.showError("confirmnewpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("confirmnewpassword",e,"match")),i.yb(2),i.pc("form",t.userForm)("submitText",i.kc(46,21,t.action)+" "+i.kc(47,23,t.resource))}},directives:[xn.C,xn.r,xn.k,Zn.a,Xn.a,On.a,xn.d,ei.a,xn.q,xn.i,ir.a,qu.a,o.r,ti.a,Yo.a],pipes:[o.A,sr.a],styles:[""]}),e})();function jm(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,18),i.Rb())}function Nm(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,19),i.Rb())}function Fm(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,20),i.Rb())}function Ym(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,21),i.Rb())}function zm(e,t){if(1&e&&(i.Sb(0,"span",17),i.Oc(1),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Qc(" ",e.passwordValuation," ")}}function $m(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,22),i.Rb())}function Hm(e,t){1&e&&(i.Sb(0,"span",17),i.Wb(1,23),i.Rb())}let Wm=(()=>{class e extends Pm{constructor(e,t,n,i,r,s,o,a){super(e,t,n,i,r,s,o),this.actionLabels=e,this.notificationService=t,this.userService=n,this.authStorageService=i,this.formBuilder=r,this.router=s,this.passwordPolicyService=o,this.authService=a}onPasswordChange(){this.authService.logout()}onCancel(){this.authService.logout()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(gn.b),i.Mb(wn.a),i.Mb(km.a),i.Mb(Jt.a),i.Mb(Fo.a),i.Mb(Pt.e),i.Mb(Dm.a),i.Mb(xm.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-login-password-form"]],features:[i.vb],decls:34,vars:19,consts:function(){return["Please set a new password.","You will be redirected to the login page afterwards.",["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"form-group","has-feedback"],[1,"input-group"],["type","password","placeholder","Old password...","id","oldpassword","formControlName","oldpassword","autocomplete","new-password","autofocus","",1,"form-control"],[1,"input-group-append"],["cdPasswordButton","oldpassword",1,"btn","btn-outline-light","btn-password"],["class","invalid-feedback",4,"ngIf"],["type","password","placeholder","New password...","id","newpassword","autocomplete","new-password","formControlName","newpassword",1,"form-control"],["type","button","cdPasswordButton","newpassword",1,"btn","btn-outline-light","btn-password"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],["type","password","autocomplete","new-password","placeholder","Confirm new password...","id","confirmnewpassword","formControlName","confirmnewpassword",1,"form-control"],["cdPasswordButton","confirmnewpassword",1,"btn","btn-outline-light","btn-password"],["wrappingClass","text-right",3,"form","disabled","submitText","submitActionEvent","backActionEvent"],[1,"invalid-feedback"],"This field is required.","The old and new passwords must be different.","This field is required.","The old and new passwords must be different.","This field is required.","Password confirmation doesn't match the new password."]},template:function(e,t){if(1&e&&(i.Sb(0,"div"),i.Sb(1,"h2"),i.Wb(2,0),i.Rb(),i.Sb(3,"h4"),i.Wb(4,1),i.Rb(),i.Sb(5,"form",2,3),i.Sb(7,"div",4),i.Sb(8,"div",5),i.Nb(9,"input",6),i.Sb(10,"span",7),i.Nb(11,"button",8),i.Rb(),i.Rb(),i.Mc(12,jm,2,0,"span",9),i.Mc(13,Nm,2,0,"span",9),i.Rb(),i.Sb(14,"div",4),i.Sb(15,"div",5),i.Nb(16,"input",10),i.Sb(17,"span",7),i.Nb(18,"button",11),i.Rb(),i.Rb(),i.Sb(19,"div",12),i.Nb(20,"div",13),i.Rb(),i.Mc(21,Fm,2,0,"span",9),i.Mc(22,Ym,2,0,"span",9),i.Mc(23,zm,2,1,"span",9),i.Rb(),i.Sb(24,"div",4),i.Sb(25,"div",5),i.Nb(26,"input",14),i.Sb(27,"span",7),i.Nb(28,"button",15),i.Rb(),i.Rb(),i.Mc(29,$m,2,0,"span",9),i.Mc(30,Hm,2,0,"span",9),i.Rb(),i.Sb(31,"cd-form-button-panel",16),i.gc("submitActionEvent",(function(){return t.onSubmit()}))("backActionEvent",(function(){return t.onCancel()})),i.jc(32,"titlecase"),i.jc(33,"upperFirst"),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(6);i.yb(5),i.pc("formGroup",t.userForm),i.yb(7),i.pc("ngIf",t.userForm.showError("oldpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("oldpassword",e,"notmatch")),i.yb(7),i.Ab(t.passwordStrengthLevelClass),i.qc("title",t.passwordValuation),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"notmatch")),i.yb(1),i.pc("ngIf",t.userForm.showError("newpassword",e,"passwordPolicy")),i.yb(6),i.pc("ngIf",t.userForm.showError("confirmnewpassword",e,"required")),i.yb(1),i.pc("ngIf",t.userForm.showError("confirmnewpassword",e,"match")),i.yb(1),i.pc("form",t.userForm)("disabled",t.userForm.invalid)("submitText",i.kc(32,15,t.action)+" "+i.kc(33,17,t.resource))}},directives:[xn.C,xn.r,xn.k,Zn.a,Xn.a,On.a,xn.d,ei.a,xn.q,xn.i,ir.a,qu.a,o.r,ti.a],pipes:[o.A,sr.a],styles:["cd-login-password-form h4{margin:0 0 30px}  cd-login-password-form .form-group{background-color:#2e373d;border-left:4px solid #fff}  cd-login-password-form .form-group:focus-within{border-left:4px solid #ef5c55}  cd-login-password-form .btn-password,   cd-login-password-form .btn-password:focus,   cd-login-password-form .form-control,   cd-login-password-form .form-control:focus{background-color:#2e373d;border:0;box-shadow:none;color:#f8f9fa;filter:none;outline:none}  cd-login-password-form .form-control::placeholder{color:#6c757d}  cd-login-password-form .btn-password:focus{outline-color:#2b99a8}  cd-login-password-form button.btn:not(:first-child){margin-left:5px}@keyframes autofill{to{background-color:#2e373d;color:#f8f9fa}}input[_ngcontent-%COMP%]:-webkit-autofill{animation-fill-mode:both;animation-name:autofill;border-radius:0;box-shadow:inset 0 0 0 1000px #2e373d;-webkit-text-fill-color:#f8f9fa;-webkit-transition-property:none;transition-property:none}.invalid-feedback[_ngcontent-%COMP%]{padding-left:9px}.is-invalid.cd-form-control[_ngcontent-%COMP%]{border-color:transparent}"]}),e})();class Vm{}function Bm(e,t){1&e&&(i.Sb(0,"div",21),i.Wb(1,22),i.Rb())}function Um(e,t){1&e&&(i.Sb(0,"div",21),i.Wb(1,23),i.Rb())}function Gm(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",1),i.Sb(1,"form",2,3),i.gc("ngSubmit",(function(){return i.Dc(e),i.ic().login()})),i.Sb(3,"div",4),i.Sb(4,"label",5),i.Wb(5,6),i.Rb(),i.Sb(6,"input",7,8),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().model.username=t})),i.Rb(),i.Mc(8,Bm,2,0,"div",9),i.Rb(),i.Sb(9,"div",10),i.Sb(10,"div",11),i.Sb(11,"div",12),i.Sb(12,"label",13),i.Wb(13,14),i.Rb(),i.Sb(14,"input",15,16),i.gc("ngModelChange",(function(t){return i.Dc(e),i.ic().model.password=t})),i.Rb(),i.Mc(16,Um,2,0,"div",9),i.Rb(),i.Sb(17,"span",17),i.Nb(18,"button",18),i.Rb(),i.Rb(),i.Rb(),i.Sb(19,"input",19),i.Yb(20,20),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.Ac(2),t=i.Ac(7),n=i.Ac(15),r=i.ic();i.yb(6),i.pc("ngModel",r.model.username),i.zb("aria-invalid",t.invalid),i.yb(2),i.pc("ngIf",(e.submitted||t.dirty)&&t.invalid),i.yb(6),i.pc("ngModel",r.model.password),i.zb("aria-invalid",n.invalid),i.yb(2),i.pc("ngIf",(e.submitted||n.dirty)&&n.invalid),i.yb(3),i.pc("disabled",e.invalid)}}let qm=(()=>{class e{constructor(e,t,n,i,r){this.authService=e,this.authStorageService=t,this.modalService=n,this.route=i,this.router=r,this.model=new Vm,this.isLoginActive=!1}ngOnInit(){if(this.authStorageService.isLoggedIn())this.router.navigate([""]);else{this.modalService.dismissAll();let e=null;if(-1!==window.location.hash.indexOf("access_token=")){e=window.location.hash.split("access_token=")[1];const t=window.location.toString();window.history.replaceState({},document.title,t.split("?")[0])}this.authService.check(e).subscribe(e=>{e.login_url?"#/login"===e.login_url?this.isLoginActive=!0:window.location.replace(e.login_url):(this.authStorageService.set(e.username,e.permissions,e.sso,e.pwdExpirationDate),this.router.navigate([""]))})}}login(){this.authService.login(this.model).subscribe(()=>{const e=Nt.a.get(this.route.snapshot.queryParams,"returnUrl","/");this.router.navigate([e])})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(xm.a),i.Mb(Jt.a),i.Mb(vn.a),i.Mb(Pt.a),i.Mb(Pt.e))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-login"]],decls:1,vars:1,consts:function(){return[["class","container",4,"ngIf"],[1,"container"],["name","loginForm","novalidate","",3,"ngSubmit"],["loginForm","ngForm"],[1,"form-group","has-feedback","d-flex","flex-column","py-3"],["for","username",1,"placeholder","pl-4"],"Username",["id","username","name","username","type","text","aria-labelledby","username","required","","autofocus","",1,"form-control","pl-4",3,"ngModel","ngModelChange"],["username","ngModel"],["class","invalid-feedback pl-4",4,"ngIf"],["id","password-div",1,"form-group","has-feedback"],[1,"input-group","d-flex","flex-nowrap"],[1,"d-flex","flex-column","flex-grow-1","py-3"],["for","password",1,"placeholder","pl-4"],"Password",["id","password","name","password","type","password","aria-labelledby","password","required","",1,"form-control","pl-4",3,"ngModel","ngModelChange"],["password","ngModel"],[1,"form-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-outline-light","btn-password","h-100","px-4"],["type","submit",1,"btn","btn-accent","px-5","py-2",3,"disabled",6,"value"],["value","Log in"],[1,"invalid-feedback","pl-4"],"Username is required","Password is required"]},template:function(e,t){1&e&&i.Mc(0,Gm,21,7,"div",0),2&e&&i.pc("ngIf",t.isLoginActive)},directives:[o.r,xn.C,xn.r,xn.s,Xn.a,On.a,xn.d,ei.a,xn.y,ir.a,xn.q,xn.t,qu.a],styles:["cd-login .form-group{background-color:#2e373d;border-left:4px solid #fff;height:auto;margin-bottom:2rem}  cd-login .form-group:focus-within{border-left:4px solid #ef5c55}  cd-login .btn-password,   cd-login .btn-password:focus,   cd-login .form-control,   cd-login .form-control:focus{background-color:#2e373d;border:0;box-shadow:none;color:#f8f9fa;filter:none;outline:none}  cd-login .placeholder{color:#6c757d}  cd-login .btn-password:focus{outline-color:#2b99a8}@keyframes autofill{to{background-color:#2e373d;color:#f8f9fa}}input[_ngcontent-%COMP%]:-webkit-autofill{animation-fill-mode:both;animation-name:autofill;border-radius:0;box-shadow:inset 0 0 0 1000px #2e373d;-webkit-text-fill-color:#f8f9fa;-webkit-transition-property:none;transition-property:none}"]}),e})();var Jm=n("tz6c");function Qm(e,t){if(1&e&&(i.Sb(0,"div"),i.Nb(1,"i",8),i.Nb(2,"br"),i.Nb(3,"br"),i.Nb(4,"br"),i.Sb(5,"h3"),i.Sb(6,"b"),i.Oc(7),i.Rb(),i.Rb(),i.Nb(8,"br"),i.Sb(9,"h4"),i.Oc(10),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(1),i.Ab(e.icon),i.yb(6),i.Pc(e.header),i.yb(3),i.Pc(e.message)}}function Km(e,t){1&e&&(i.Nb(0,"i",9),i.Nb(1,"br"),i.Nb(2,"br"),i.Nb(3,"br"),i.Sb(4,"h3"),i.cc(5,10),i.Nb(6,"b"),i.Zb(),i.Rb(),i.Nb(7,"br"),i.Sb(8,"h4"),i.Wb(9,11),i.Rb())}function Zm(e,t){if(1&e&&(i.Sb(0,"div"),i.Sb(1,"h4"),i.cc(2,12),i.Nb(3,"a",13),i.Zb(),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(3),i.qc("href",e.docUrl,i.Gc),i.ac(e.section_info),i.Xb(2)}}let Xm=(()=>{class e{constructor(e,t){this.router=e,this.docService=t}ngOnInit(){this.fetchData(),this.routerSubscription=this.router.events.pipe(Object(hu.a)(e=>e instanceof Pt.b)).subscribe(()=>{this.fetchData()})}unloadHandler(e){e.returnValue=!1}fetchData(){try{this.router.onSameUrlNavigation="reload",this.message=history.state.message,this.header=history.state.header,this.section=history.state.section,this.section_info=history.state.section_info,this.icon=history.state.icon,this.source=history.state.source,this.docUrl=this.docService.urlGenerator(this.section)}catch(e){this.router.navigate(["/error"])}}ngOnDestroy(){this.routerSubscription&&this.routerSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e),i.Mb(Jm.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-error"]],hostBindings:function(e,t){1&e&&i.gc("beforeunload",(function(e){return t.unloadHandler(e)}),!1,i.Cc)},decls:16,vars:4,consts:function(){return[["target","_blank"],[1,"dashboard","row"],[1,"text-center","content"],[4,"ngIf","ngIfElse"],["elseBlock",""],[4,"ngIf"],[1,"btn","btn-primary",3,"routerLink"],"Go To Dashboard",["aria-hidden","true"],["aria-hidden","true",1,"fa","fa-exclamation-triangle"],"" + "\ufffd#6\ufffd" + "Page not Found" + "\ufffd/#6\ufffd" + "","Sorry, we couldn\u2019t find what you were looking for. The page you requested may have been changed or moved.","Please consult the " + "\ufffd#3\ufffd" + "documentation" + "\ufffd/#3\ufffd" + " on how to configure and enable the " + "\ufffd0\ufffd" + " management functionality.",[3,"href"]]},template:function(e,t){if(1&e&&(i.Sb(0,"head"),i.Sb(1,"title"),i.Oc(2,"Error Page"),i.Rb(),i.Nb(3,"base",0),i.Rb(),i.Sb(4,"div",1),i.Sb(5,"div",2),i.Nb(6,"br"),i.Mc(7,Qm,11,5,"div",3),i.Mc(8,Km,10,0,"ng-template",null,4,i.Nc),i.Mc(10,Zm,4,2,"div",5),i.Nb(11,"br"),i.Nb(12,"br"),i.Sb(13,"div"),i.Sb(14,"button",6),i.Wb(15,7),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(9);i.yb(7),i.pc("ngIf",t.header&&t.message)("ngIfElse",e),i.yb(3),i.pc("ngIf",t.section),i.yb(4),i.pc("routerLink","/dashboard")}},directives:[o.r,On.a,Pt.f],styles:["h4[_ngcontent-%COMP%]{color:#495057}i[_ngcontent-%COMP%]{font-size:6em;margin-top:120px}.dashboard[_ngcontent-%COMP%], .text-center[_ngcontent-%COMP%]{background-color:#e9ecef}.dashboard[_ngcontent-%COMP%]{height:100%;position:relative}.content[_ngcontent-%COMP%]{left:50%;position:absolute;top:40%;transform:translate(-50%,-50%);width:100%}.row[_ngcontent-%COMP%]{display:block;margin-left:-29px;margin-right:-29px;padding-top:10em}.fa-exclamation-triangle[_ngcontent-%COMP%], .fa-lock[_ngcontent-%COMP%]{color:#ef5c55}.fa-wrench[_ngcontent-%COMP%]{color:#2b99a8}"]}),e})(),eb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-blank-layout"]],decls:1,vars:0,template:function(e,t){1&e&&i.Nb(0,"router-outlet")},directives:[Pt.j],styles:[""]}),e})(),tb=(()=>{class e{constructor(e,t){this.http=e,this.localeId=t}getLocale(){return this.localeId||s.a.default_lang}setLocale(e){document.cookie="cd-lang="+e}getLanguages(){return this.http.get("ui-api/langs")}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b),i.dc(i.v))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var nb=function(e){return e.cs="\u010ce\u0161tina",e.de="Deutsch",e["en-US"]="English",e.es="Espa\xf1ol",e.fr="Fran\xe7ais",e.id="Bahasa Indonesia",e.it="Italiano",e.ja="\u65e5\u672c\u8a9e",e.ko="\ud55c\uad6d\uc5b4",e.pl="Polski",e.pt="Portugu\xeas (brasileiro)",e["zh-Hans"]="\u4e2d\u6587 (\u7b80\u4f53)",e["zh-Hant"]="\u4e2d\u6587 (\u7e41\u9ad4\uff09",e}({});function ib(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",5),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic().changeLanguage(n.key)})),i.Oc(2),i.Rb(),i.Pb()}if(2&e){const e=t.$implicit;i.yb(2),i.Qc(" ",e.value," ")}}let rb=(()=>{class e{constructor(e){this.languageService=e,this.allLanguages=nb,this.supportedLanguages={}}ngOnInit(){this.selectedLanguage=this.languageService.getLocale(),this.languageService.getLanguages().subscribe(e=>{this.supportedLanguages=Nt.a.pick(nb,e)})}reloadWindow(){window.location.reload()}changeLanguage(e){this.languageService.setLocale(e),this.reloadWindow()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(tb))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-language-selector"]],decls:7,vars:4,consts:function(){return[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","",6,"title"],["title","Select a Language"],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["ngbDropdownItem","",3,"click"]]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"a",1),i.Yb(2,2),i.Oc(3),i.Rb(),i.Sb(4,"div",3),i.Mc(5,ib,3,1,"ng-container",4),i.jc(6,"keyvalue"),i.Rb(),i.Rb()),2&e&&(i.yb(3),i.Qc(" ",t.allLanguages[t.selectedLanguage]," "),i.yb(2),i.pc("ngForOf",i.kc(6,2,t.supportedLanguages)))},directives:[Qt.i,Qt.m,Qt.k,o.q,On.a,Qt.j],pipes:[o.k],styles:[""]}),e})();function sb(e,t){if(1&e&&(i.Sb(0,"li",10),i.Sb(1,"cd-doc",11),i.Yb(2,12),i.Rb(),i.Rb()),2&e){const e=t.$implicit;i.yb(1),i.ac(e.text),i.Xb(2),i.qc("section",e.section)}}let ob=(()=>{class e{constructor(){this.docItems=[{section:"help",text:"Help"},{section:"security",text:"Security"},{section:"trademarks",text:"Trademarks"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-login-layout"]],decls:15,vars:1,consts:function(){return[[1,"login","full-height"],[1,"navbar","p-4"],[1,"navbar-brand"],[1,"form-inline"],[1,"container"],[1,"row","full-height","vertical-align"],[1,"col-sm-12","col-md-6","d-sm-block"],["src","assets/Ceph_Ceph_Logo_with_text_white.svg","alt","Ceph",1,"img-fluid"],[1,"list-inline"],["class","list-inline-item p-3",4,"ngFor","ngForOf"],[1,"list-inline-item","p-3"],["noSubscribe","true",3,"section",6,"docText"],["docText","" + "\ufffd0\ufffd" + ""]]},template:function(e,t){1&e&&(i.Sb(0,"main",0),i.Sb(1,"header"),i.Sb(2,"nav",1),i.Nb(3,"a",2),i.Sb(4,"div",3),i.Nb(5,"cd-language-selector"),i.Rb(),i.Rb(),i.Rb(),i.Sb(6,"section"),i.Sb(7,"div",4),i.Sb(8,"div",5),i.Sb(9,"div",6),i.Nb(10,"router-outlet"),i.Rb(),i.Sb(11,"div",6),i.Nb(12,"img",7),i.Sb(13,"ul",8),i.Mc(14,sb,3,2,"li",9),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(14),i.pc("ngForOf",t.docItems))},directives:[Qt.v,rb,Pt.j,o.q,Rr.a],styles:["cd-login-layout .login{background-color:#374249;background-image:url(ceph_background.e82dd79127290ddbe8cb.gif);background-position:100% 100%;background-repeat:no-repeat;color:#f8f9fa}  cd-login-layout .login header{position:absolute;width:100vw}  cd-login-layout .login header .navbar .dropdown-menu{margin-top:.2rem}  cd-login-layout .login header .navbar .dropdown-menu li a:hover{background-color:#2b99a8}  cd-login-layout .login section{display:inline-flex;min-height:100vh;width:100vw}  cd-login-layout .login .list-inline{margin-bottom:20%;margin-left:20%}  cd-login-layout .login a{color:#fff}  cd-login-layout .login a:hover{color:#adb5bd}"]}),e})();var ab=n("mSOc");let cb=(()=>{class e{constructor(e,t,n){this.document=e,this.summaryService=t,this.cssHelper=n}init(){var e;this.url=null===(e=this.document.getElementById("cdFavicon"))||void 0===e?void 0:e.getAttribute("href"),this.sub=this.summaryService.subscribe(e=>{this.changeIcon(e.health_status)})}changeIcon(e){if(e===this.oldStatus)return;this.oldStatus=e;const t=this.document.getElementById("cdFavicon"),n=this.document.createElement("canvas");n.width=16,n.height=16;const i=n.getContext("2d"),r=this.document.createElement("img");r.src=this.url,r.onload=()=>{i.drawImage(r,0,0,16,16),Object.keys($h).includes(e)&&(i.save(),i.globalCompositeOperation="destination-out",i.beginPath(),i.arc(n.width-4,4,6,0,2*Math.PI),i.fill(),i.restore(),i.beginPath(),i.arc(n.width-4,4,4,0,2*Math.PI),i.fillStyle=this.cssHelper.propertyValue($h[e]),i.fill()),t.setAttribute("href",n.toDataURL("image/png"))}}ngOnDestroy(){var e;this.changeIcon(),null===(e=this.sub)||void 0===e||e.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(o.d),i.dc(ab.a),i.dc(kh.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();var lb=n("VXsX"),ub=n("EY2u"),db=n("JIr8"),hb=n("vkgz");class fb{constructor(e,t){this.count=e,this.source=t}call(e,t){return t.subscribe(new pb(e,this.count,this.source))}}class pb extends su.a{constructor(e,t,n){super(e),this.count=t,this.source=n}complete(){if(!this.isStopped){const{source:e,count:t}=this;if(0===t)return super.complete();t>-1&&(this.count=t-1),e.subscribe(this._unsubscribeAndRecycle())}}}let mb=(()=>{class e{constructor(e){this.http=e,this.url="ui-api/motd"}get(){return this.http.get(this.url)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),bb=(()=>{class e{constructor(e){this.motdService=e,this.motdSource=new gh.a(null),this.localStorageKey="dashboard_motd_hidden",this.motd$=this.motdSource.asObservable(),this.subscription=Object(Wi.a)(!0).pipe(Object(Ki.a)(()=>this.motdService.get()),Object(db.a)(e=>(jt.isFunction(e.preventDefault)&&e.preventDefault(),ub.a)),Object(hb.a)(e=>this.processResponse(e)),Object(nh.a)(6e4),function(e=-1){return t=>0===e?Object(ub.b)():t.lift(new fb(e<0?-1:e-1,t))}()).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}hide(){const e=this.motdSource.getValue();if(e){const t=`${e.severity}:${e.md5}`;switch(e.severity){case"info":localStorage.setItem(this.localStorageKey,t),sessionStorage.removeItem(this.localStorageKey);break;case"warning":sessionStorage.setItem(this.localStorageKey,t),localStorage.removeItem(this.localStorageKey)}}this.motdSource.next(null)}processResponse(e){const t=sessionStorage.getItem(this.localStorageKey)||localStorage.getItem(this.localStorageKey);let n=jt.isNull(t);if(!n&&e){const[i,r]=t.split(":");i===e.severity&&r===e.md5||(n=!0,sessionStorage.removeItem(this.localStorageKey),localStorage.removeItem(this.localStorageKey))}n&&this.motdSource.next(e)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(mb))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var gb=n("oMSZ");function _b(e,t){1&e&&(i.Sb(0,"div"),i.cc(1,3),i.Nb(2,"strong"),i.Nb(3,"a",4),i.Zb(),i.Rb())}function yb(e,t){if(1&e&&(i.Sb(0,"div"),i.cc(1,5),i.Nb(2,"strong"),i.Nb(3,"a",4),i.Zb(),i.Rb()),2&e){const e=i.ic(2);i.yb(3),i.ac(e.expirationDays),i.Xb(1)}}function vb(e,t){if(1&e){const e=i.Tb();i.Sb(0,"ngb-alert",1),i.gc("close",(function(t){return i.Dc(e),i.ic().close(t)})),i.Mc(1,_b,4,0,"div",2),i.Mc(2,yb,4,1,"div",2),i.Rb()}if(2&e){const e=i.ic();i.qc("type",e.alertType),i.yb(1),i.pc("ngIf",0===e.expirationDays),i.yb(1),i.pc("ngIf",e.expirationDays>0)}}let wb=(()=>{class e{constructor(e,t){this.settingsService=e,this.authStorageService=t,this.displayNotification=!1}ngOnInit(){this.settingsService.getStandardSettings().subscribe(e=>{this.pwdExpirationSettings=new gb.a(e);const t=this.authStorageService.getPwdExpirationDate();t&&(this.expirationDays=this.getExpirationDays(t),this.alertType=this.expirationDays<=this.pwdExpirationSettings.pwdExpirationWarning2?"danger":"warning",this.displayNotification=this.expirationDays<=this.pwdExpirationSettings.pwdExpirationWarning1,this.authStorageService.isPwdDisplayedSource.next(this.displayNotification))})}ngOnDestroy(){this.authStorageService.isPwdDisplayedSource.next(!1)}getExpirationDays(e){const t=new Date,n=new Date(1e3*e);return Math.floor((n.valueOf()-t.valueOf())/864e5)}close(){this.authStorageService.isPwdDisplayedSource.next(!1),this.displayNotification=!1}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pl.a),i.Mb(Jt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-pwd-expiration-notification"]],decls:1,vars:1,consts:function(){return[["class","no-margin-bottom",3,"type","close",4,"ngIf"],[1,"no-margin-bottom",3,"type","close"],[4,"ngIf"],"Your password will expire in " + "\ufffd#2\ufffd" + "less than 1" + "\ufffd/#2\ufffd" + " day. Click " + "\ufffd#3\ufffd" + "here" + "\ufffd/#3\ufffd" + " to change it now.",["routerLink","/user-profile/edit",1,"alert-link"],"Your password will expire in " + "\ufffd#2\ufffd" + "" + "\ufffd0\ufffd" + "" + "\ufffd/#2\ufffd" + " day(s). Click " + "\ufffd#3\ufffd" + "here" + "\ufffd/#3\ufffd" + " to change it now."]},template:function(e,t){1&e&&i.Mc(0,vb,3,3,"ngb-alert",0),2&e&&i.pc("ngIf",t.displayNotification)},directives:[o.r,Qt.b,Pt.h],styles:["cd-pwd-expiration-notification .no-margin-bottom{margin-bottom:0}"]}),e})();function Sb(e,t){if(1&e){const e=i.Tb();i.Sb(0,"ngb-alert",1),i.gc("close",(function(t){return i.Dc(e),i.ic().close(t)})),i.Sb(1,"div"),i.cc(2,2),i.Nb(3,"a",3),i.Nb(4,"a",4),i.Zb(),i.Rb(),i.Rb()}}let Mb=(()=>{class e{constructor(e,t,n,i){this.mgrModuleService=e,this.authStorageService=t,this.notificationService=n,this.telemetryNotificationService=i,this.displayNotification=!1}ngOnInit(){if(this.telemetryNotificationService.update.subscribe(e=>{this.displayNotification=e}),!this.isNotificationHidden()){const e=this.authStorageService.getPermissions().configOpt;Nt.a.every(Object.values(e))&&this.mgrModuleService.getConfig("telemetry").subscribe(e=>{e.enabled||this.telemetryNotificationService.setVisibility(!0)})}}ngOnDestroy(){this.telemetryNotificationService.setVisibility(!1)}isNotificationHidden(){return"true"===localStorage.getItem("telemetry_notification_hidden")}close(){this.telemetryNotificationService.setVisibility(!1),localStorage.setItem("telemetry_notification_hidden","true"),this.notificationService.show(yn.a.success,"Telemetry activation reminder muted","You can activate the module on the Telemetry configuration page (<b>Dashboard Settings</b> -> <b>Telemetry configuration</b>) at any time.")}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(No),i.Mb(Jt.a),i.Mb(wn.a),i.Mb(uh))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-telemetry-notification"]],decls:1,vars:1,consts:function(){var e;return e="The Ceph community needs your help to continue improving: please " + "\ufffd#3\ufffd" + "Activate" + "[\ufffd/#3\ufffd|\ufffd/#4\ufffd]" + " the " + "\ufffd#4\ufffd" + "Telemetry" + "[\ufffd/#3\ufffd|\ufffd/#4\ufffd]" + " module.",[["class","no-margin-bottom","type","warning",3,"close",4,"ngIf"],["type","warning",1,"no-margin-bottom",3,"close"],e=i.bc(e),["routerLink","/telemetry",1,"btn","activate-button","alert-link","activate-text"],["href","https://docs.ceph.com/en/latest/mgr/telemetry/"]]},template:function(e,t){1&e&&i.Mc(0,Sb,5,0,"ngb-alert",0),2&e&&i.pc("ngIf",t.displayNotification)},directives:[o.r,Qt.b,Pt.h],styles:["cd-telemetry-notification .no-margin-bottom{margin-bottom:0}.activate-button[_ngcontent-%COMP%]{background-color:#fcecba;border:.5px solid #495057;border-radius:10%;padding:.1rem .4rem}.activate-text[_ngcontent-%COMP%]{color:#495057;font-weight:700}"]}),e})();var xb=n("Yrry");function kb(e,t){if(1&e){const e=i.Tb();i.Sb(0,"cd-alert-panel",1),i.gc("dismissed",(function(){return i.Dc(e),i.ic().onDismissed()})),i.Nb(1,"span",2),i.jc(2,"sanitizeHtml"),i.Rb()}if(2&e){const e=i.ic();i.pc("showTitle",!1)("type",e.motd.severity)("dismissible","danger"!==e.motd.severity),i.yb(1),i.pc("innerHTML",i.kc(2,4,e.motd.message),i.Ec)}}let Db=(()=>{class e{constructor(e){this.motdNotificationService=e,this.motd=void 0}ngOnInit(){this.subscription=this.motdNotificationService.motd$.subscribe(e=>{this.motd=e})}ngOnDestroy(){this.subscription.unsubscribe()}onDismissed(){this.motdNotificationService.hide()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(bb))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-motd"]],decls:1,vars:1,consts:[["size","slim",3,"showTitle","type","dismissible","dismissed",4,"ngIf"],["size","slim",3,"showTitle","type","dismissible","dismissed"],[3,"innerHTML"]],template:function(e,t){1&e&&i.Mc(0,kb,3,6,"cd-alert-panel",0),2&e&&i.pc("ngIf",t.motd)},directives:[o.r,br.a],pipes:[xb.a],styles:[""]}),e})();var Tb=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),n=new Promise((function(t){return e._queue.push(t)}));return t||this._dispatch(),n},e.prototype.runExclusive=function(e){return Object(Ft.a)(this,void 0,void 0,(function(){var t,n,i;return Object(Ft.c)(this,(function(r){switch(r.label){case 0:return[4,this.acquire()];case 1:t=r.sent(),n=t[0],i=t[1],r.label=2;case 2:return r.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,r.sent()];case 4:return i(),[7];case 5:return[2]}}))}))},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");this._currentReleaser&&(this._currentReleaser(),this._currentReleaser=void 0)},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}(),Cb=function(){function e(){this._semaphore=new Tb(1)}return e.prototype.acquire=function(){return Object(Ft.a)(this,void 0,void 0,(function(){return Object(Ft.c)(this,(function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,e.sent()[1]]}}))}))},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive((function(){return e()}))},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();let Ob=(()=>{class e{constructor(e,t){this.alertFormatter=e,this.prometheusService=t,this.backendFailure=!1,this.notifications=[]}refresh(){this.backendFailure||this.prometheusService.getNotifications(Nt.a.last(this.notifications)).subscribe(e=>this.handleNotifications(e),()=>this.backendFailure=!0)}handleNotifications(e){0!==e.length&&(this.notifications.length>0&&this.alertFormatter.sendNotifications(Nt.a.flatten(e.map(e=>this.formatNotification(e)))),this.notifications=this.notifications.concat(e))}formatNotification(e){return this.alertFormatter.convertToCustomAlerts(e.alerts).map(e=>this.alertFormatter.convertAlertToNotification(e))}}return e.\u0275fac=function(t){return new(t||e)(i.dc(Fl),i.dc(jl))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Rb=n("ufoC"),Lb=n("Hicy"),Eb=n("WF9J");const Ab=function(e,t){return[e,t]},Ib=function(e,t,n,i){return[e,t,n,i]};function Pb(e,t){if(1&e&&(i.Sb(0,"div"),i.Sb(1,"div",12),i.Sb(2,"div",13),i.Sb(3,"div",14),i.Sb(4,"span",15),i.Nb(5,"i",7),i.Nb(6,"i",7),i.Rb(),i.Rb(),i.Sb(7,"div",16),i.Sb(8,"div",17),i.Sb(9,"h6",18),i.Oc(10),i.Rb(),i.Sb(11,"div",19),i.Nb(12,"ngb-progressbar",20),i.Rb(),i.Sb(13,"p",21),i.Sb(14,"small",22),i.Oc(15),i.jc(16,"cdDate"),i.Rb(),i.Sb(17,"span",23),i.Oc(18),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Nb(19,"hr"),i.Rb()),2&e){const e=t.$implicit,n=i.ic(2);i.yb(4),i.pc("ngClass",i.vc(11,Ab,n.icons.stack,n.icons.large2x)),i.yb(1),i.pc("ngClass",i.vc(14,Ab,n.icons.stack2x,n.icons.circle)),i.yb(1),i.pc("ngClass",i.xc(17,Ib,n.icons.stack1x,n.icons.spinner,n.icons.spin,n.icons.inverse)),i.yb(4),i.Pc(e.description),i.yb(2),i.pc("value",null==e?null:e.progress)("striped",!0)("animated",!0),i.yb(3),i.Qc(" ",i.kc(16,9,e.begin_time)," "),i.yb(3),i.Qc(" ",e.progress||0," % ")}}function jb(e,t){if(1&e&&i.Mc(0,Pb,20,22,"div",11),2&e){const e=i.ic();i.pc("ngForOf",e.executingTasks)("ngForTrackBy",e.trackByFn)}}function Nb(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"small"),i.Qb(2),i.Wb(3,36),i.Pb(),i.Oc(4),i.jc(5,"duration"),i.Rb(),i.Nb(6,"br"),i.Pb()),2&e){const e=i.ic().$implicit;i.yb(4),i.Qc(" ",i.kc(5,1,e.duration)," ")}}const Fb=function(e,t,n){return[e,t,n]},Yb=function(e){return[e]};function zb(e,t){if(1&e){const e=i.Tb();i.Sb(0,"div",7),i.Sb(1,"div",29),i.Sb(2,"div",13),i.Sb(3,"div",14),i.Sb(4,"span",7),i.Nb(5,"i",7),i.Nb(6,"i",7),i.Rb(),i.Rb(),i.Sb(7,"div",30),i.Sb(8,"div",17),i.Sb(9,"button",31),i.Yb(10,32),i.gc("click",(function(n){i.Dc(e);const r=t.index;return i.ic(3).remove(r),n.stopPropagation()})),i.Nb(11,"i",7),i.Rb(),i.Sb(12,"h6",18),i.Oc(13),i.Rb(),i.Nb(14,"p",33),i.Sb(15,"p",21),i.Mc(16,Nb,7,3,"ng-container",24),i.Sb(17,"small",34),i.jc(18,"cdDate"),i.Oc(19),i.jc(20,"relativeDate"),i.Rb(),i.Nb(21,"i",35),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Nb(22,"hr"),i.Rb()}if(2&e){const e=t.$implicit,n=i.ic(3);i.pc("ngClass",e.borderClass),i.yb(4),i.pc("ngClass",i.wc(16,Fb,n.icons.stack,n.icons.large2x,e.textClass)),i.yb(1),i.pc("ngClass",i.vc(20,Ab,n.icons.circle,n.icons.stack2x)),i.yb(1),i.pc("ngClass",i.wc(23,Fb,n.icons.stack1x,n.icons.inverse,e.iconClass)),i.yb(5),i.pc("ngClass",i.uc(27,Yb,n.icons.trash)),i.yb(2),i.Pc(e.title),i.yb(1),i.pc("innerHtml",e.message,i.Ec),i.yb(2),i.pc("ngIf",e.duration),i.yb(1),i.pc("title",i.kc(18,12,e.timestamp)),i.yb(2),i.Pc(i.kc(20,14,e.timestamp)),i.yb(2),i.pc("ngClass",i.uc(29,Yb,e.applicationClass))("title",e.application)}}function $b(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",25),i.gc("click",(function(t){return i.Dc(e),i.ic(2).removeAll(),t.stopPropagation()})),i.Nb(2,"i",26),i.Oc(3," \xa0 "),i.Qb(4),i.Wb(5,27),i.Pb(),i.Rb(),i.Nb(6,"hr"),i.Mc(7,zb,23,31,"div",28),i.Pb()}if(2&e){const e=i.ic(2);i.yb(2),i.pc("ngClass",i.uc(2,Yb,e.icons.trash)),i.yb(5),i.pc("ngForOf",e.notifications)}}function Hb(e,t){if(1&e&&i.Mc(0,$b,8,4,"ng-container",24),2&e){const e=i.ic();i.pc("ngIf",e.notifications.length>0)}}function Wb(e,t){1&e&&(i.Sb(0,"div"),i.Sb(1,"div",37),i.Wb(2,38),i.Rb(),i.Rb())}function Vb(e,t){if(1&e&&i.Mc(0,Wb,3,0,"div",24),2&e){const e=i.ic();i.pc("ngIf",0===e.notifications.length&&0===e.executingTasks.length)}}function Bb(e,t){1&e&&i.Ob(0)}function Ub(e,t){1&e&&i.Ob(0)}function Gb(e,t){1&e&&i.Ob(0)}let qb=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.notificationService=e,this.summaryService=t,this.taskMessageService=n,this.prometheusNotificationService=i,this.authStorageService=r,this.prometheusAlertService=s,this.ngZone=o,this.cdRef=a,this.isSidebarOpened=!1,this.executingTasks=[],this.subs=new Oi.a,this.icons=_n.a,this.last_task="",this.mutex=new Cb,this.simplebar={autoHide:!1},this.notifications=[]}ngOnDestroy(){window.clearInterval(this.interval),window.clearTimeout(this.timeout),this.subs.unsubscribe()}ngOnInit(){this.last_task=window.localStorage.getItem("last_task");const e=this.authStorageService.getPermissions();e.prometheus.read&&e.configOpt.read&&(this.triggerPrometheusAlerts(),this.ngZone.runOutsideAngular(()=>{this.interval=window.setInterval(()=>{this.ngZone.run(()=>{this.triggerPrometheusAlerts()})},5e3)})),this.subs.add(this.notificationService.data$.subscribe(e=>{this.notifications=Nt.a.orderBy(e,["timestamp"],["desc"]),this.cdRef.detectChanges()})),this.subs.add(this.notificationService.sidebarSubject.subscribe(e=>{this.isSidebarOpened=!e&&!this.isSidebarOpened,window.clearTimeout(this.timeout),this.timeout=window.setTimeout(()=>{this.cdRef.detectChanges()},0)})),this.subs.add(this.summaryService.subscribe(e=>{this._handleTasks(e.executing_tasks),this.mutex.acquire().then(t=>{Nt.a.filter(e.finished_tasks,e=>!this.last_task||nn()(e.end_time).isAfter(this.last_task)).forEach(e=>{const t=this.notificationService.finishedTaskToNotification(e,e.success),n=new Nl.a(t);n.timestamp=e.end_time,n.duration=e.duration,this.last_task&&!nn()(e.end_time).isAfter(this.last_task)||(this.last_task=e.end_time,window.localStorage.setItem("last_task",this.last_task)),this.notificationService.save(n)}),this.cdRef.detectChanges(),t()})}))}_handleTasks(e){for(const t of e)t.description=this.taskMessageService.getRunningTitle(t);this.executingTasks=e}triggerPrometheusAlerts(){this.prometheusAlertService.refresh(),this.prometheusNotificationService.refresh()}removeAll(){this.notificationService.removeAll()}remove(e){this.notificationService.remove(e)}closeSidebar(){this.isSidebarOpened=!1}trackByFn(e){return e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(wn.a),i.Mb(ab.a),i.Mb(Rb.a),i.Mb(Ob),i.Mb(Jt.a),i.Mb(Yl),i.Mb(i.A),i.Mb(i.h))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-notifications-sidebar"]],hostVars:2,hostBindings:function(e,t){2&e&&i.Eb("active",t.isSidebarOpened)},decls:18,vars:6,consts:function(){return[["tasksTpl",""],["notificationsTpl",""],["emptyTpl",""],[1,"card",3,"clickOutsideEnabled","clickOutside"],[1,"card-header"],"Tasks and Notifications",["tabindex","-1","type","button",1,"close","float-right",3,"click"],[3,"ngClass"],[3,"options"],[1,"card-body"],[4,"ngTemplateOutlet"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"card","tc_task","border-0"],[1,"row","no-gutters"],[1,"col-md-2","text-center"],[1,"text-info",3,"ngClass"],[1,"col-md-9"],[1,"card-body","p-1"],[1,"card-title","bold"],[1,"mb-1"],["type","info",3,"value","striped","animated"],[1,"card-text","text-muted"],[1,"date","float-left"],[1,"float-right"],[4,"ngIf"],["type","button",1,"btn","btn-light","btn-block",3,"click"],["aria-hidden","true",3,"ngClass"],"Clear notifications",[3,"ngClass",4,"ngFor","ngForOf"],[1,"card","tc_notification","border-0"],[1,"col-md-10"],[1,"btn","btn-link","float-right","mt-0","pt-0",3,"click",6,"title"],["title","Remove notification"],[1,"card-text",3,"innerHtml"],[1,"date",3,"title"],[1,"float-right","custom-icon",3,"ngClass","title"],"Duration:",[1,"message","text-center"],"There are no notifications."]},template:function(e,t){if(1&e&&(i.Mc(0,jb,1,2,"ng-template",null,0,i.Nc),i.Mc(2,Hb,1,1,"ng-template",null,1,i.Nc),i.Mc(4,Vb,1,1,"ng-template",null,2,i.Nc),i.Sb(6,"div",3),i.gc("clickOutside",(function(){return t.closeSidebar()})),i.Sb(7,"div",4),i.Qb(8),i.Wb(9,5),i.Pb(),i.Sb(10,"button",6),i.gc("click",(function(){return t.closeSidebar()})),i.Sb(11,"span"),i.Nb(12,"i",7),i.Rb(),i.Rb(),i.Rb(),i.Sb(13,"ngx-simplebar",8),i.Sb(14,"div",9),i.Mc(15,Bb,1,0,"ng-container",10),i.Mc(16,Ub,1,0,"ng-container",10),i.Mc(17,Gb,1,0,"ng-container",10),i.Rb(),i.Rb(),i.Rb()),2&e){const e=i.Ac(1),n=i.Ac(3),r=i.Ac(5);i.yb(6),i.pc("clickOutsideEnabled",t.isSidebarOpened),i.yb(6),i.pc("ngClass",t.icons.close),i.yb(1),i.pc("options",t.simplebar),i.yb(2),i.pc("ngTemplateOutlet",e),i.yb(1),i.pc("ngTemplateOutlet",n),i.yb(1),i.pc("ngTemplateOutlet",r)}},directives:[Lb.a,On.a,o.p,Eb.a,o.w,o.q,Qt.z,o.r],pipes:[Vt.a,$r.a,Jl],styles:["[_nghost-%COMP%]{bottom:10px;max-width:90vw;position:fixed;right:-350px;top:53px;transition:all .6s;width:350px;z-index:9}.active[_nghost-%COMP%]{right:20px}.card[_ngcontent-%COMP%]{height:100%}.card-body[_ngcontent-%COMP%]{padding-left:0;padding-right:5px;padding-top:3px}ngx-simplebar[_ngcontent-%COMP%]{height:calc(100% - 42.2px)}.separator[_ngcontent-%COMP%]{background-color:#e9ecef;color:#6c757d;font-size:1rem;padding:5px 12px}.btn-block[_ngcontent-%COMP%]{width:98%}.btn-link[_ngcontent-%COMP%]   .fa-trash-o[_ngcontent-%COMP%]{color:#000}table[_ngcontent-%COMP%]{width:100%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0;padding-bottom:1rem;padding-top:1rem}hr[_ngcontent-%COMP%]{margin-bottom:2px;margin-top:2px}.card-text[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),e})();function Jb(e,t){1&e&&i.Nb(0,"span",6)}const Qb=function(e){return{running:e}},Kb=function(e){return[e]};let Zb=(()=>{class e{constructor(e,t){this.notificationService=e,this.summaryService=t,this.icons=_n.a,this.hasRunningTasks=!1,this.hasNotifications=!1,this.subs=new Oi.a}ngOnInit(){this.subs.add(this.summaryService.subscribe(e=>{this.hasRunningTasks=e.executing_tasks.length>0})),this.subs.add(this.notificationService.data$.subscribe(e=>{this.hasNotifications=e.length>0}))}ngOnDestroy(){this.subs.unsubscribe()}toggleSidebar(){this.notificationService.toggleSidebar()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(wn.a),i.Mb(ab.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-notifications"]],decls:6,vars:7,consts:function(){return[[3,"ngClass","click",6,"title"],["title","Tasks and Notifications"],[3,"ngClass"],["class","dot",4,"ngIf"],[1,"d-md-none"],"Tasks and Notifications",[1,"dot"]]},template:function(e,t){1&e&&(i.Sb(0,"a",0),i.Yb(1,1),i.gc("click",(function(){return t.toggleSidebar()})),i.Nb(2,"i",2),i.Mc(3,Jb,1,0,"span",3),i.Sb(4,"span",4),i.Wb(5,5),i.Rb(),i.Rb()),2&e&&(i.pc("ngClass",i.uc(3,Qb,t.hasRunningTasks)),i.yb(2),i.pc("ngClass",i.uc(5,Kb,t.icons.bell)),i.yb(1),i.pc("ngIf",t.hasNotifications))},directives:[o.p,o.r],styles:[".running[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#2b99a8}.running[_ngcontent-%COMP%]:hover   i[_ngcontent-%COMP%]{color:#fff}a[_ngcontent-%COMP%]   .dot[_ngcontent-%COMP%]{background-color:#2b99a8;border:2px solid #374249;border-radius:50%;height:11px;position:absolute;right:17px;top:10px;width:10px}a[_ngcontent-%COMP%]:hover   .dot[_ngcontent-%COMP%]{background-color:#fff;border-color:#2b99a8}"]}),e})();var Xb=n("e0ae");let eg=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.summaryService=t,this.userService=n,this.authStorageService=i,this.userPermission=this.authStorageService.getPermissions().user}ngOnInit(){this.projectConstants=gn.c,this.hostAddr=window.location.hostname,this.modalVariables=this.setVariables(),this.subs=this.summaryService.subscribe(e=>{const t=e.version.replace("ceph version ","").split(" ");this.hostAddr=e.mgr_host.replace(/(^\w+:|^)\/\//,"").replace(/\/$/,""),this.versionNumber=t[0],this.versionHash=t[1],this.versionName=t.slice(2,t.length).join(" ")})}ngOnDestroy(){this.subs.unsubscribe()}setVariables(){const e={};e.user=localStorage.getItem("dashboard_username"),e.role="user",this.userPermission.read&&this.userService.get(e.user).subscribe(t=>{e.role=t.roles});const t=Object(Xb.a)();return e.browserName=t&&t.name?t.name:"Not detected",e.browserVersion=t&&t.version?t.version:"Not detected",e.browserOS=t&&t.os?t.os:"Not detected",e}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.a),i.Mb(ab.a),i.Mb(km.a),i.Mb(Jt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-about"]],decls:46,vars:13,consts:[[1,"about-container"],[1,"modal-header"],["type","button","aria-label","Close",1,"close","float-right",3,"click"],["aria-hidden","true"],[1,"modal-body"],["src","assets/Ceph_Ceph_Logo_with_text_red_white.svg",1,"ceph-logo",3,"alt"],[1,"product-versions"],[1,"modal-footer"],[1,"text-left"]],template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"div",1),i.Sb(2,"button",2),i.gc("click",(function(){return t.activeModal.close()})),i.Sb(3,"span",3),i.Oc(4,"\xd7"),i.Rb(),i.Rb(),i.Rb(),i.Sb(5,"div",4),i.Nb(6,"img",5),i.Sb(7,"h3"),i.Sb(8,"strong"),i.Oc(9),i.Rb(),i.Rb(),i.Sb(10,"div",6),i.Sb(11,"strong"),i.Oc(12,"Version"),i.Rb(),i.Nb(13,"br"),i.Oc(14),i.Nb(15,"br"),i.Oc(16),i.Rb(),i.Nb(17,"br"),i.Sb(18,"dl"),i.Sb(19,"dt"),i.Oc(20,"Ceph Manager"),i.Rb(),i.Sb(21,"dd"),i.Oc(22),i.Rb(),i.Sb(23,"dt"),i.Oc(24,"User"),i.Rb(),i.Sb(25,"dd"),i.Oc(26),i.Rb(),i.Sb(27,"dt"),i.Oc(28,"User Role"),i.Rb(),i.Sb(29,"dd"),i.Oc(30),i.Rb(),i.Sb(31,"dt"),i.Oc(32,"Browser"),i.Rb(),i.Sb(33,"dd"),i.Oc(34),i.Rb(),i.Sb(35,"dt"),i.Oc(36,"Browser Version"),i.Rb(),i.Sb(37,"dd"),i.Oc(38),i.Rb(),i.Sb(39,"dt"),i.Oc(40,"Browser OS"),i.Rb(),i.Sb(41,"dd"),i.Oc(42),i.Rb(),i.Rb(),i.Rb(),i.Sb(43,"div",7),i.Sb(44,"div",8),i.Oc(45),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(6),i.qc("alt",t.projectConstants.organization),i.yb(3),i.Pc(t.projectConstants.projectName),i.yb(5),i.Rc(" ",t.versionNumber," ",t.versionHash," "),i.yb(2),i.Qc(" ",t.versionName," "),i.yb(6),i.Pc(t.hostAddr),i.yb(4),i.Pc(t.modalVariables.user),i.yb(4),i.Pc(t.modalVariables.role),i.yb(4),i.Pc(t.modalVariables.browserName),i.yb(4),i.Pc(t.modalVariables.browserVersion),i.yb(4),i.Pc(t.modalVariables.browserOS),i.yb(3),i.Rc(" ",t.projectConstants.copyright," ",t.projectConstants.license," "))},directives:[On.a],styles:[".about-container[_ngcontent-%COMP%]{background-color:#374249;background-image:url(ceph_background.e82dd79127290ddbe8cb.gif);background-position:100% 100%;background-repeat:no-repeat;color:#fff;text-shadow:1px 1px #374249}.product-versions[_ngcontent-%COMP%]{margin-top:30px}.product-versions[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{margin-right:10px}.modal-header[_ngcontent-%COMP%]{border-bottom:0}.modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{color:#fff;font-size:2em}.modal-body[_ngcontent-%COMP%]{padding-left:80px;padding-right:80px}.ceph-logo[_ngcontent-%COMP%]{margin-bottom:30px;width:25%}.modal-footer[_ngcontent-%COMP%]{border-top:0;display:block;padding:15px 80px 35px}"]}),e})();const tg=function(e){return[e]},ng=function(e){return{disabled:e}};let ig=(()=>{class e{constructor(e,t){this.modalService=e,this.docService=t,this.icons=_n.a}ngOnInit(){this.docService.subscribeOnce("dashboard",e=>{this.docsUrl=e})}openAboutModal(){this.modalRef=this.modalService.show(eg,null,{size:"lg"})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(vn.a),i.Mb(Jm.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-dashboard-help"]],decls:13,vars:7,consts:function(){return[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","",6,"title"],["title","Help"],[3,"ngClass"],[1,"d-md-none"],"Help",["ngbDropdownMenu",""],["ngbDropdownItem","","target","_blank",1,"text-capitalize",3,"ngClass","href"],"documentation",["ngbDropdownItem","","href","/docs","target","_blank"],"API",["ngbDropdownItem","",3,"click"],"About"]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"a",1),i.Yb(2,2),i.Nb(3,"i",3),i.Sb(4,"span",4),i.Wb(5,5),i.Rb(),i.Rb(),i.Sb(6,"div",6),i.Sb(7,"a",7),i.Wb(8,8),i.Rb(),i.Sb(9,"a",9),i.Wb(10,10),i.Rb(),i.Sb(11,"button",11),i.gc("click",(function(){return t.openAboutModal()})),i.Wb(12,12),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(3),i.pc("ngClass",i.uc(3,tg,t.icons.questionCircle)),i.yb(4),i.qc("href",t.docsUrl,i.Gc),i.pc("ngClass",i.uc(5,ng,!t.docsUrl)))},directives:[Qt.i,Qt.m,o.p,Qt.k,Qt.j,On.a],styles:[""]}),e})();function rg(e,t){1&e&&(i.Sb(0,"button",10),i.Wb(1,11),i.Rb())}function sg(e,t){1&e&&(i.Sb(0,"button",12),i.Wb(1,13),i.Rb())}const og=function(e){return[e]};function ag(e,t){if(1&e&&(i.Sb(0,"div",1),i.Sb(1,"a",2),i.Yb(2,3),i.Nb(3,"i",4),i.Sb(4,"span",5),i.Wb(5,6),i.Rb(),i.Rb(),i.Sb(6,"div",7),i.Mc(7,rg,2,0,"button",8),i.Mc(8,sg,2,0,"button",9),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(3),i.pc("ngClass",i.uc(3,og,e.icons.deepCheck)),i.yb(4),i.pc("ngIf",e.userPermission.read),i.yb(1),i.pc("ngIf",e.configOptPermission.read)}}let cg=(()=>{class e{constructor(e){this.authStorageService=e,this.icons=_n.a;const t=this.authStorageService.getPermissions();this.userPermission=t.user,this.configOptPermission=t.configOpt}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-administration"]],decls:1,vars:1,consts:function(){return[["ngbDropdown","","placement","bottom-right",4,"ngIf"],["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","",1,"dropdown-toggle",6,"title"],["title","Dashboard Settings"],[3,"ngClass"],[1,"d-md-none"],"Dashboard Settings",["ngbDropdownMenu",""],["ngbDropdownItem","","routerLink","/user-management",4,"ngIf"],["ngbDropdownItem","","routerLink","/telemetry",4,"ngIf"],["ngbDropdownItem","","routerLink","/user-management"],"User management",["ngbDropdownItem","","routerLink","/telemetry"],"Telemetry configuration"]},template:function(e,t){1&e&&i.Mc(0,ag,9,5,"div",0),2&e&&i.pc("ngIf",t.userPermission.read)},directives:[o.r,Qt.i,Qt.m,o.p,Qt.k,On.a,Qt.j,Pt.f],styles:[""]}),e})();const lg=function(e){return[e]};function ug(e,t){if(1&e&&(i.Sb(0,"button",13),i.Nb(1,"i",3),i.Sb(2,"span"),i.Wb(3,14),i.Rb(),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngClass",i.uc(1,lg,e.icons.lock))}}let dg=(()=>{class e{constructor(e,t){this.authStorageService=e,this.authService=t,this.icons=_n.a}ngOnInit(){this.username=this.authStorageService.getUsername(),this.sso=this.authStorageService.isSSO()}logout(){this.authService.logout()}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(xm.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-identity"]],decls:16,vars:8,consts:function(){return[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","",6,"title"],["title","Logged in user"],[3,"ngClass"],[1,"d-md-none"],"Logged in user",["ngbDropdownMenu",""],["ngbDropdownItem","","disabled",""],"Signed in as " + "\ufffd#9\ufffd" + "" + "\ufffd0\ufffd" + "" + "\ufffd/#9\ufffd" + "",[1,"dropdown-divider"],["ngbDropdownItem","","routerLink","/user-profile/edit",4,"ngIf"],["ngbDropdownItem","",3,"click"],"Sign out",["ngbDropdownItem","","routerLink","/user-profile/edit"],"Change password"]},template:function(e,t){1&e&&(i.Sb(0,"div",0),i.Sb(1,"a",1),i.Yb(2,2),i.Nb(3,"i",3),i.Sb(4,"span",4),i.Wb(5,5),i.Rb(),i.Rb(),i.Sb(6,"div",6),i.Sb(7,"button",7),i.cc(8,8),i.Nb(9,"strong"),i.Zb(),i.Rb(),i.Nb(10,"li",9),i.Mc(11,ug,4,3,"button",10),i.Sb(12,"button",11),i.gc("click",(function(){return t.logout()})),i.Nb(13,"i",3),i.Sb(14,"span"),i.Wb(15,12),i.Rb(),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(3),i.pc("ngClass",i.uc(4,lg,t.icons.user)),i.yb(6),i.ac(t.username),i.Xb(8),i.yb(2),i.pc("ngIf",!t.sso),i.yb(2),i.pc("ngClass",i.uc(6,lg,t.icons.signOut)))},directives:[Qt.i,Qt.m,o.p,Qt.k,On.a,Qt.j,o.r,Pt.f],styles:[""]}),e})();function hg(e,t){1&e&&i.Ob(0)}function fg(e,t){1&e&&i.Ob(0)}function pg(e,t){if(1&e){const e=i.Tb();i.Sb(0,"li",21),i.Nb(1,"cd-language-selector",22),i.Rb(),i.Sb(2,"li",21),i.Sb(3,"cd-notifications",23),i.gc("click",(function(){return i.Dc(e),i.ic().toggleRightSidebar()})),i.Rb(),i.Rb(),i.Sb(4,"li",21),i.Nb(5,"cd-dashboard-help",22),i.Rb(),i.Sb(6,"li",21),i.Nb(7,"cd-administration",22),i.Rb(),i.Sb(8,"li",21),i.Nb(9,"cd-identity",22),i.Rb()}}function mg(e,t){1&e&&(i.Sb(0,"li",49),i.Sb(1,"a",50),i.Wb(2,51),i.Rb(),i.Rb())}function bg(e,t){1&e&&(i.Sb(0,"li",52),i.Sb(1,"a",53),i.Wb(2,54),i.Rb(),i.Rb())}function gg(e,t){1&e&&(i.Sb(0,"li",55),i.Sb(1,"a",56),i.Wb(2,57),i.Rb(),i.Rb())}function _g(e,t){1&e&&(i.Sb(0,"li",58),i.Sb(1,"a",59),i.Wb(2,60),i.Rb(),i.Rb())}function yg(e,t){1&e&&(i.Sb(0,"li",61),i.Sb(1,"a",62),i.Wb(2,63),i.Rb(),i.Rb())}function vg(e,t){1&e&&(i.Sb(0,"li",64),i.Sb(1,"a",65),i.Wb(2,66),i.Rb(),i.Rb())}function wg(e,t){1&e&&(i.Sb(0,"li",67),i.Sb(1,"a",68),i.Wb(2,69),i.Rb(),i.Rb())}function Sg(e,t){1&e&&(i.Sb(0,"li",70),i.Sb(1,"a",71),i.Wb(2,72),i.Rb(),i.Rb())}function Mg(e,t){1&e&&(i.Sb(0,"li",73),i.Sb(1,"a",74),i.Wb(2,75),i.Rb(),i.Rb())}function xg(e,t){if(1&e&&(i.Sb(0,"small",80),i.Oc(1),i.Rb()),2&e){const e=i.ic(5);i.yb(1),i.Pc(e.prometheusAlertService.activeAlerts)}}function kg(e,t){if(1&e&&(i.Sb(0,"li",76),i.Sb(1,"a",77),i.Qb(2),i.Wb(3,78),i.Pb(),i.Mc(4,xg,2,1,"small",79),i.Rb(),i.Rb()),2&e){const e=i.ic(4);i.yb(4),i.pc("ngIf",e.prometheusAlertService.activeAlerts>0)}}function Dg(e,t){if(1&e){const e=i.Tb();i.Sb(0,"li",35),i.Sb(1,"a",36),i.gc("click",(function(){return i.Dc(e),i.ic(3).toggleSubMenu("cluster")})),i.Qb(2),i.Wb(3,37),i.Pb(),i.Rb(),i.Sb(4,"ul",38),i.Mc(5,mg,3,0,"li",39),i.Mc(6,bg,3,0,"li",40),i.Mc(7,gg,3,0,"li",41),i.Mc(8,_g,3,0,"li",42),i.Mc(9,yg,3,0,"li",43),i.Mc(10,vg,3,0,"li",44),i.Mc(11,wg,3,0,"li",45),i.Mc(12,Sg,3,0,"li",46),i.Mc(13,Mg,3,0,"li",47),i.Mc(14,kg,5,1,"li",48),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(1),i.zb("aria-expanded","cluster"==e.displayedSubMenu),i.yb(3),i.pc("ngbCollapse","cluster"!==e.displayedSubMenu),i.yb(1),i.pc("ngIf",e.permissions.hosts.read),i.yb(1),i.pc("ngIf",e.permissions.hosts.read),i.yb(1),i.pc("ngIf",e.permissions.monitor.read),i.yb(1),i.pc("ngIf",e.permissions.hosts.read),i.yb(1),i.pc("ngIf",e.permissions.osd.read),i.yb(1),i.pc("ngIf",e.permissions.configOpt.read),i.yb(1),i.pc("ngIf",e.permissions.osd.read),i.yb(1),i.pc("ngIf",e.permissions.configOpt.read),i.yb(1),i.pc("ngIf",e.permissions.log.read),i.yb(1),i.pc("ngIf",e.permissions.prometheus.read)}}function Tg(e,t){1&e&&(i.Sb(0,"li",81),i.Sb(1,"a",82),i.Wb(2,83),i.Rb(),i.Rb())}function Cg(e,t){1&e&&(i.Sb(0,"li",90),i.Sb(1,"a",91),i.Wb(2,92),i.Rb(),i.Rb())}function Og(e,t){if(1&e&&(i.Sb(0,"small",97),i.Oc(1),i.Rb()),2&e){const e=i.ic(5);i.yb(1),i.Pc(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.warnings)}}function Rg(e,t){if(1&e&&(i.Sb(0,"small",80),i.Oc(1),i.Rb()),2&e){const e=i.ic(5);i.yb(1),i.Pc(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.errors)}}function Lg(e,t){if(1&e&&(i.Sb(0,"li",93),i.Sb(1,"a",94),i.Qb(2),i.Wb(3,95),i.Pb(),i.Mc(4,Og,2,1,"small",96),i.Mc(5,Rg,2,1,"small",79),i.Rb(),i.Rb()),2&e){const e=i.ic(4);i.yb(4),i.pc("ngIf",0!==(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.warnings)),i.yb(1),i.pc("ngIf",0!==(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.errors))}}function Eg(e,t){1&e&&(i.Sb(0,"li",98),i.Sb(1,"a",99),i.Wb(2,100),i.Rb(),i.Rb())}function Ag(e,t){if(1&e){const e=i.Tb();i.Sb(0,"li",84),i.Sb(1,"a",85),i.gc("click",(function(){return i.Dc(e),i.ic(3).toggleSubMenu("block")})),i.Qb(2),i.Wb(3,86),i.Pb(),i.Rb(),i.Sb(4,"ul",38),i.Mc(5,Cg,3,0,"li",87),i.Mc(6,Lg,6,2,"li",88),i.Mc(7,Eg,3,0,"li",89),i.Rb(),i.Rb()}if(2&e){const e=i.ic().ngIf,t=i.ic(2);i.yb(1),i.pc("ngStyle",t.blockHealthColor()),i.zb("aria-expanded","block"==t.displayedSubMenu),i.yb(3),i.pc("ngbCollapse","block"!==t.displayedSubMenu),i.yb(1),i.pc("ngIf",t.permissions.rbdImage.read&&e.rbd),i.yb(1),i.pc("ngIf",t.permissions.rbdMirroring.read&&e.mirroring),i.yb(1),i.pc("ngIf",t.permissions.iscsi.read&&e.iscsi)}}function Ig(e,t){1&e&&(i.Sb(0,"li",101),i.Sb(1,"a",102),i.Wb(2,103),i.Rb(),i.Rb())}function Pg(e,t){1&e&&(i.Sb(0,"li",104),i.Sb(1,"a",105),i.Wb(2,106),i.Rb(),i.Rb())}function jg(e,t){if(1&e){const e=i.Tb();i.Sb(0,"li",107),i.Sb(1,"a",36),i.gc("click",(function(){return i.Dc(e),i.ic(3).toggleSubMenu("rgw")})),i.Qb(2),i.Wb(3,108),i.Pb(),i.Rb(),i.Sb(4,"ul",38),i.Sb(5,"li",109),i.Sb(6,"a",110),i.Wb(7,111),i.Rb(),i.Rb(),i.Sb(8,"li",112),i.Sb(9,"a",113),i.Wb(10,114),i.Rb(),i.Rb(),i.Sb(11,"li",115),i.Sb(12,"a",116),i.Wb(13,117),i.Rb(),i.Rb(),i.Rb(),i.Rb()}if(2&e){const e=i.ic(3);i.yb(1),i.zb("aria-expanded","rgw"==e.displayedSubMenu),i.yb(3),i.pc("ngbCollapse","rgw"!==e.displayedSubMenu)}}const Ng=function(e){return[e]};function Fg(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"li",25),i.Sb(2,"a",26),i.Sb(3,"span"),i.Wb(4,27),i.Rb(),i.Oc(5,"\xa0 "),i.Nb(6,"i",28),i.jc(7,"healthColor"),i.Rb(),i.Rb(),i.Mc(8,Dg,15,12,"li",29),i.Mc(9,Tg,3,0,"li",30),i.Mc(10,Ag,8,6,"li",31),i.Mc(11,Ig,3,0,"li",32),i.Mc(12,Pg,3,0,"li",33),i.Mc(13,jg,14,2,"li",34),i.Pb()),2&e){const e=t.ngIf,n=i.ic(2);i.yb(6),i.pc("ngClass",i.uc(10,Ng,n.icons.health))("ngStyle",i.kc(7,8,null==n.summaryData?null:n.summaryData.health_status)),i.yb(2),i.pc("ngIf",n.permissions.hosts.read||n.permissions.monitor.read||n.permissions.osd.read||n.permissions.configOpt.read||n.permissions.log.read||n.permissions.prometheus.read),i.yb(1),i.pc("ngIf",n.permissions.pool.read),i.yb(1),i.pc("ngIf",(n.permissions.rbdImage.read||n.permissions.rbdMirroring.read||n.permissions.iscsi.read)&&(e.rbd||e.mirroring||e.iscsi)),i.yb(1),i.pc("ngIf",n.permissions.nfs.read&&e.nfs),i.yb(1),i.pc("ngIf",n.permissions.cephfs.read&&e.cephfs),i.yb(1),i.pc("ngIf",n.permissions.rgw.read&&e.rgw)}}function Yg(e,t){if(1&e&&(i.Mc(0,Fg,14,12,"ng-container",24),i.jc(1,"async")),2&e){const e=i.ic();i.pc("ngIf",i.kc(1,1,e.enabledFeature$))}}const zg=function(e){return{show:e}},$g=function(e){return{active:e}},Hg=["*"];let Wg=(()=>{class e{constructor(e,t,n,i,r,s){this.authStorageService=e,this.summaryService=t,this.featureToggles=n,this.telemetryNotificationService=i,this.prometheusAlertService=r,this.motdNotificationService=s,this.notifications=[],this.icons=_n.a,this.rightSidebarOpen=!1,this.showMenuSidebar=!0,this.displayedSubMenu="",this.simplebar={autoHide:!1},this.subs=new Oi.a,this.permissions=this.authStorageService.getPermissions(),this.enabledFeature$=this.featureToggles.get()}get class(){return"top-notification-"+this.notifications.length}ngOnInit(){this.subs.add(this.summaryService.subscribe(e=>{this.summaryData=e})),this.subs.add(this.authStorageService.isPwdDisplayed$.subscribe(e=>{this.showTopNotification("isPwdDisplayed",e)})),this.subs.add(this.telemetryNotificationService.update.subscribe(e=>{this.showTopNotification("telemetryNotificationEnabled",e)})),this.subs.add(this.motdNotificationService.motd$.subscribe(e=>{this.showTopNotification("motdNotificationEnabled",jt.isPlainObject(e))}))}ngOnDestroy(){this.subs.unsubscribe()}blockHealthColor(){if(this.summaryData&&this.summaryData.rbd_mirroring){if(this.summaryData.rbd_mirroring.errors>0)return{color:"#d9534f"};if(this.summaryData.rbd_mirroring.warnings>0)return{color:"#f0ad4e"}}}toggleSubMenu(e){this.displayedSubMenu=this.displayedSubMenu===e?"":e}toggleRightSidebar(){this.rightSidebarOpen=!this.rightSidebarOpen}showTopNotification(e,t){if(t)this.notifications.includes(e)||this.notifications.push(e);else{const t=this.notifications.indexOf(e);t>=0&&this.notifications.splice(t,1)}}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(ab.a),i.Mb(Dh.a),i.Mb(uh),i.Mb(Yl),i.Mb(bb))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-navigation"]],hostVars:2,hostBindings:function(e,t){2&e&&i.Ab(t.class)},ngContentSelectors:Hg,decls:29,vars:12,consts:function(){return[[1,"cd-navbar-top"],[1,"navbar","fixed-top","navbar-expand-md","navbar-dark","cd-navbar-brand"],[1,"btn","btn-link","py-0",3,"click"],["aria-hidden","true",1,"fa","fa-bars","fa-2x"],["href","#",1,"navbar-brand","ml-2"],["src","assets/Ceph_Ceph_Logo_with_text_white.svg","alt","Ceph"],["type","button",1,"navbar-toggler",3,"click"],[1,"sr-only"],"Toggle navigation",[1,""],[1,"fa","fa-navicon","fa-lg"],[1,"collapse","navbar-collapse",3,"ngClass"],[1,"nav","navbar-nav","cd-navbar-utility","my-2","my-md-0"],[4,"ngTemplateOutlet"],[1,"wrapper"],["id","sidebar",3,"ngClass"],[3,"options"],[1,"list-unstyled","components","cd-navbar-primary"],["id","content",3,"ngClass"],["cd_utilities",""],["cd_menu",""],[1,"nav-item"],[1,"cd-navbar"],[1,"cd-navbar",3,"click"],[4,"ngIf"],["routerLinkActive","active",1,"nav-item","tc_menuitem_dashboard"],["routerLink","/dashboard",1,"nav-link"],"Dashboard",[3,"ngClass","ngStyle"],["routerLinkActive","active","class","nav-item tc_menuitem_cluster",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_pool",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_block",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_nfs",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_cephfs",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_rgw",4,"ngIf"],["routerLinkActive","active",1,"nav-item","tc_menuitem_cluster"],["aria-controls","collapseBasic",1,"nav-link","dropdown-toggle",3,"click"],"Cluster",[1,"list-unstyled",3,"ngbCollapse"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_hosts",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_inventory",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_monitor",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_services",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_osds",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_configuration",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_crush",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_modules",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_log",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_monitoring",4,"ngIf"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_hosts"],["routerLink","/hosts"],"Hosts",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_inventory"],["routerLink","/inventory"],"Physical Disks",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_monitor"],["routerLink","/monitor/"],"Monitors",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_services"],["routerLink","/services/"],"Services",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_osds"],["routerLink","/osd"],"OSDs",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_configuration"],["routerLink","/configuration"],"Configuration",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_crush"],["routerLink","/crush-map"],"CRUSH map",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_modules"],["routerLink","/mgr-modules"],"Manager Modules",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_log"],["routerLink","/logs"],"Logs",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_monitoring"],["routerLink","/monitoring"],"Monitoring",["class","badge badge-danger",4,"ngIf"],[1,"badge","badge-danger"],["routerLinkActive","active",1,"nav-item","tc_menuitem_pool"],["routerLink","/pool",1,"nav-link"],"Pools",["routerLinkActive","active",1,"nav-item","tc_menuitem_block"],["aria-controls","collapseBasic",1,"nav-link","dropdown-toggle",3,"ngStyle","click"],"Block",["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_images",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_mirroring",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_iscsi",4,"ngIf"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_images"],["routerLink","/block/rbd"],"Images",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_mirroring"],["routerLink","/block/mirroring"],"Mirroring",["class","badge badge-warning",4,"ngIf"],[1,"badge","badge-warning"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_iscsi"],["routerLink","/block/iscsi"],"iSCSI",["routerLinkActive","active",1,"nav-item","tc_menuitem_nfs"],["routerLink","/nfs",1,"nav-link"],"NFS",["routerLinkActive","active",1,"nav-item","tc_menuitem_cephfs"],["routerLink","/cephfs",1,"nav-link"],"File Systems",["routerLinkActive","active",1,"nav-item","tc_menuitem_rgw"],"Object Gateway",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_daemons"],["routerLink","/rgw/daemon"],"Daemons",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_users"],["routerLink","/rgw/user"],"Users",["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_buckets"],["routerLink","/rgw/bucket"],"Buckets"]},template:function(e,t){if(1&e&&(i.oc(),i.Nb(0,"cd-pwd-expiration-notification"),i.Nb(1,"cd-telemetry-notification"),i.Nb(2,"cd-motd"),i.Nb(3,"cd-notifications-sidebar"),i.Sb(4,"div",0),i.Sb(5,"nav",1),i.Sb(6,"button",2),i.gc("click",(function(){return t.showMenuSidebar=!t.showMenuSidebar})),i.Nb(7,"i",3),i.Rb(),i.Sb(8,"a",4),i.Nb(9,"img",5),i.Rb(),i.Sb(10,"button",6),i.gc("click",(function(){return t.toggleRightSidebar()})),i.Sb(11,"span",7),i.Wb(12,8),i.Rb(),i.Sb(13,"span",9),i.Nb(14,"i",10),i.Rb(),i.Rb(),i.Sb(15,"div",11),i.Sb(16,"ul",12),i.Mc(17,hg,1,0,"ng-container",13),i.Rb(),i.Rb(),i.Rb(),i.Rb(),i.Sb(18,"div",14),i.Sb(19,"nav",15),i.Sb(20,"ngx-simplebar",16),i.Sb(21,"ul",17),i.Mc(22,fg,1,0,"ng-container",13),i.Rb(),i.Rb(),i.Rb(),i.Sb(23,"div",18),i.nc(24),i.Rb(),i.Rb(),i.Mc(25,pg,10,0,"ng-template",null,19,i.Nc),i.Mc(27,Yg,2,3,"ng-template",null,20,i.Nc)),2&e){const e=i.Ac(26),n=i.Ac(28);i.yb(15),i.pc("ngClass",i.uc(6,zg,t.rightSidebarOpen)),i.yb(2),i.pc("ngTemplateOutlet",e),i.yb(2),i.pc("ngClass",i.uc(8,$g,!t.showMenuSidebar)),i.yb(1),i.pc("options",t.simplebar),i.yb(2),i.pc("ngTemplateOutlet",n),i.yb(1),i.pc("ngClass",i.uc(10,$g,!t.showMenuSidebar))}},directives:[wb,Mb,Db,qb,Qt.v,On.a,o.p,o.w,Eb.a,rb,Zb,ig,cg,dg,o.r,Pt.g,Pt.h,o.s,Qt.e],pipes:[o.b,Hh],styles:['@charset "UTF-8";  cd-navigation .cd-navbar-top .cd-navbar-brand{background:#374249;border-top:4px solid #2b99a8}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand,   cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand:hover{color:#e9ecef;height:auto;padding:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand>img{height:25px}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler{border:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler:focus,   cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler:hover{outline:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler .fa-navicon{color:#e9ecef}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-collapse{padding:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>.active>a{background-color:#2b99a8;color:#e9ecef}  cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a,   cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a:focus,   cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a:hover{background-color:initial;border-color:transparent;color:#e9ecef}  cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown]>a,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>a,   cd-navigation .cd-navbar-top .navbar-nav>li>a{color:#e9ecef;display:block;line-height:1;padding:13.5px 18px!important;position:relative;text-decoration:none}  cd-navigation .cd-navbar-top .navbar-nav .nav-link,   cd-navigation .cd-navbar-top .navbar-nav .nav-link:hover{color:#e9ecef}  cd-navigation .cd-navbar-top .navbar-nav>li:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown].open>a,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown]>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>a:hover{background-color:#2b99a8}  cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>[ngbDropdown]>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>[ngbDropdown]>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>li>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>a:hover{background-color:initial;border-color:transparent;color:#e9ecef}@media (min-width:768px){  cd-navigation .cd-navbar-top .cd-navbar-utility{border-bottom:0;font-size:1.1rem;position:absolute;right:0;top:0}}@media (max-width:calc(768px - 1px)){  cd-navigation .cd-navbar-top .navbar-nav{margin:0}  cd-navigation .cd-navbar-top .navbar-nav .fa{margin-right:.5em}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu{background-color:#2b99a8;border:0;padding-bottom:0;padding-top:0}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu>li>a{color:#e9ecef;padding:5px 15px 5px 35px}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu>.active>a,   cd-navigation .cd-navbar-top .navbar-nav>li>a:hover{background-color:#2b99a8}}.cd-navbar-primary[_ngcontent-%COMP%]   .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .cd-navbar-primary[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .cd-navbar-primary[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#2b99a8!important;border:0!important;color:#e9ecef!important}.wrapper[_ngcontent-%COMP%]{display:flex;width:100%}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]{background:#374249;bottom:0;color:#fff;left:0;overflow-y:auto;position:fixed;top:43px;transition:all .3s;width:200px;z-index:999}.wrapper[_ngcontent-%COMP%]   #sidebar.active[_ngcontent-%COMP%]{margin-left:-200px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul.component[_ngcontent-%COMP%]{margin:0;padding:20px 0}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#fff;padding:10px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#fff;display:block;font-size:1.1em;padding:10px 10px 10px 27px;text-decoration:none}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{background:#2b99a8;color:#fff}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%] > .badge[_ngcontent-%COMP%]{margin-left:5px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]   a[aria-expanded=true][_ngcontent-%COMP%]{color:#fff}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[_ngcontent-%COMP%]{position:relative}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[_ngcontent-%COMP%]:after{border:0;content:"\uf054";font-family:ForkAwesome;font-size:1rem;position:absolute;right:20px;transition:transform .3s ease-in-out}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[aria-expanded=true][_ngcontent-%COMP%]:after{transform:rotate(90deg)}.wrapper[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{background:#4d5c66;font-size:.9em!important;padding-left:40px!important}.wrapper[_ngcontent-%COMP%]   .cd-navbar-primary[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus{outline:none}.wrapper[_ngcontent-%COMP%]   ngx-simplebar[_ngcontent-%COMP%]{height:100%}#content[_ngcontent-%COMP%]{bottom:0;position:absolute;right:0;top:43px;transition:all .3s;width:calc(100% - 200px)}#content.active[_ngcontent-%COMP%]{width:100vw}.top-notification-1[_nghost-%COMP%]   .cd-navbar-top[_ngcontent-%COMP%]   .cd-navbar-brand[_ngcontent-%COMP%]{top:37.6px}.top-notification-1[_nghost-%COMP%]   #content[_ngcontent-%COMP%], .top-notification-1[_nghost-%COMP%]   #sidebar[_ngcontent-%COMP%]{top:80.6px}.top-notification-1[_nghost-%COMP%]   cd-notifications-sidebar[_ngcontent-%COMP%]{top:90.6px}.top-notification-2[_nghost-%COMP%]   .cd-navbar-top[_ngcontent-%COMP%]   .cd-navbar-brand[_ngcontent-%COMP%]{top:75.2px}.top-notification-2[_nghost-%COMP%]   #content[_ngcontent-%COMP%], .top-notification-2[_nghost-%COMP%]   #sidebar[_ngcontent-%COMP%]{top:118.2px}.top-notification-2[_nghost-%COMP%]   cd-notifications-sidebar[_ngcontent-%COMP%]{top:128.2px}']}),e})();var Vg=n("5yfJ"),Bg=n("9xzX");function Ug(e,t){if(1&e){const e=i.Tb();i.Qb(0),i.Sb(1,"button",9),i.gc("click",(function(){i.Dc(e);const n=t.$implicit;return i.ic(3).onDaemonSelection(n)})),i.Oc(2),i.Rb(),i.Pb()}if(2&e){const e=t.$implicit;i.yb(2),i.Rc(" ",e.id," ( ",e.zonegroup_name," ) ")}}function Gg(e,t){if(1&e&&(i.Qb(0),i.Sb(1,"div",1),i.Sb(2,"span",2),i.Wb(3,3),i.Rb(),i.Sb(4,"div",4),i.Sb(5,"button",5),i.Yb(6,6),i.Oc(7),i.Rb(),i.Sb(8,"div",7),i.Mc(9,Ug,3,2,"ng-container",8),i.Rb(),i.Rb(),i.Rb(),i.Pb()),2&e){const e=i.ic().ngIf;i.yb(7),i.Rc(" ",e.selectedDaemon.id," ( ",e.selectedDaemon.zonegroup_name," ) "),i.yb(2),i.pc("ngForOf",e.daemons)}}function qg(e,t){if(1&e&&(i.Qb(0),i.Mc(1,Gg,10,3,"ng-container",0),i.Pb()),2&e){const e=t.ngIf,n=i.ic();i.yb(1),i.pc("ngIf",e.ftMap&&e.ftMap.rgw&&n.permissions.rgw.read&&n.isRgwRoute&&e.daemons.length>1)}}const Jg=function(e,t,n){return{ftMap:e,daemons:t,selectedDaemon:n}};let Qg=(()=>{class e{constructor(e,t,n,i,r){this.authStorageService=e,this.featureToggles=t,this.router=n,this.timerService=i,this.rgwDaemonService=r,this.REFRESH_INTERVAL=5e3,this.subs=new Oi.a,this.rgwUrlPrefix="/rgw",this.isRgwRoute=document.location.href.includes(this.rgwUrlPrefix)}ngOnInit(){this.permissions=this.authStorageService.getPermissions(),this.featureToggleMap$=this.featureToggles.get(),this.subs.add(this.router.events.pipe(Object(hu.a)(e=>e instanceof Pt.b)).subscribe(()=>this.isRgwRoute=this.router.url.startsWith(this.rgwUrlPrefix))),this.subs.add(this.timerService.get(()=>this.isRgwRoute?this.rgwDaemonService.list():Vg.a,this.REFRESH_INTERVAL).subscribe())}ngOnDestroy(){this.subs.unsubscribe()}onDaemonSelection(e){this.rgwDaemonService.selectDaemon(e),this.reloadData()}reloadData(){const e=this.router.url;this.router.navigateByUrl(this.rgwUrlPrefix,{skipLocationChange:!0}).finally(()=>{this.router.navigate([e])})}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Jt.a),i.Mb(Dh.a),i.Mb(Pt.e),i.Mb(Li.a),i.Mb(Bg.a))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-context"]],decls:4,vars:11,consts:function(){return[[4,"ngIf"],[1,"cd-context-bar","pt-3","pb-3"],[1,"mr-1"],"Selected Object Gateway:",["ngbDropdown","","placement","bottom-left",1,"d-inline-block","ml-2"],["ngbDropdownToggle","",1,"btn","btn-outline-info","ctx-bar-selected-rgw-daemon",6,"title"],["title","Select Object Gateway"],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["ngbDropdownItem","",1,"ctx-bar-available-rgw-daemon",3,"click"]]},template:function(e,t){1&e&&(i.Mc(0,qg,2,1,"ng-container",0),i.jc(1,"async"),i.jc(2,"async"),i.jc(3,"async")),2&e&&i.pc("ngIf",i.wc(7,Jg,i.kc(1,1,t.featureToggleMap$),i.kc(2,3,t.rgwDaemonService.daemons$),i.kc(3,5,t.rgwDaemonService.selectedDaemon$)))},directives:[o.r,Qt.i,On.a,Qt.m,Qt.k,o.q,Qt.j],pipes:[o.b],styles:[".cd-context-bar[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}"]}),e})();var Kg=n("GyhO"),Zg=n("Cfvw"),Xg=n("zx2A");class e_{constructor(e,t){this.keySelector=e,this.flushes=t}call(e,t){return t.subscribe(new t_(e,this.keySelector,this.flushes))}}class t_ extends Xg.b{constructor(e,t,n){super(e),this.keySelector=t,this.values=new Set,n&&this.add(Object(Xg.c)(n,new Xg.a(this)))}notifyNext(){this.values.clear()}notifyError(e){this._error(e)}_next(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)}_useKeySelector(e){let t;const{destination:n}=this;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)}_finalizeNext(e,t){const{values:n}=this;n.has(e)||(n.add(e),this.destination.next(t))}}var n_=n("SxV6");class i_{resolve(e){const t=e.routeConfig.data,n=null===t.path?null:this.getFullPath(e),i=[{text:"string"==typeof t.breadcrumbs?t.breadcrumbs:t.breadcrumbs.text||t.text||n,path:n}];return Object(Wi.a)(i)}getFullPath(e){return(e=>e.reduce((e,t)=>e+t.url.reduce((e,t)=>e+"/"+t.path,""),""))(e.pathFromRoot)}}function r_(e,t){if(1&e&&(i.Sb(0,"a",6),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit;i.pc("routerLink",e.path),i.yb(1),i.Pc(e.text)}}function s_(e,t){if(1&e&&(i.Sb(0,"span"),i.Oc(1),i.Rb()),2&e){const e=i.ic().$implicit;i.yb(1),i.Pc(e.text)}}const o_=function(e){return{active:e}};function a_(e,t){if(1&e&&(i.Sb(0,"li",3),i.Mc(1,r_,2,2,"a",4),i.Mc(2,s_,2,1,"span",5),i.Rb()),2&e){const e=t.$implicit,n=t.last,r=i.ic(2);i.pc("ngClass",i.uc(3,o_,n&&r.finished)),i.yb(1),i.pc("ngIf",!n&&null!==e.path),i.yb(1),i.pc("ngIf",n||null===e.path)}}function c_(e,t){if(1&e&&(i.Sb(0,"ol",1),i.Mc(1,a_,3,5,"li",2),i.Rb()),2&e){const e=i.ic();i.yb(1),i.pc("ngForOf",e.crumbs)}}let l_=(()=>{class e{constructor(e,t){this.router=e,this.injector=t,this.crumbs=[],this.finished=!1,this.defaultResolver=new i_,this.subscription=this.router.events.pipe(Object(hu.a)(e=>e instanceof Pt.c)).subscribe(()=>{this.finished=!1}),this.subscription=this.router.events.pipe(Object(hu.a)(e=>e instanceof Pt.b)).subscribe(()=>{var t;this._resolveCrumbs(e.routerState.snapshot.root).pipe(Object(Ki.a)(e=>e),(t=e=>e.text,e=>e.lift(new e_(t,void 0))),Qi(),Object(Ki.a)(e=>{const t=this.postProcess(e);return this.wrapIntoObservable(t).pipe(Object(n_.a)())})).subscribe(e=>{this.finished=!0,this.crumbs=e})})}ngOnDestroy(){this.subscription.unsubscribe()}_resolveCrumbs(e){let t;const n=e.routeConfig&&e.routeConfig.data;if(n&&n.breadcrumbs){let i;i=n.breadcrumbs.prototype instanceof i_?this.injector.get(n.breadcrumbs):this.defaultResolver;const r=i.resolve(e);t=this.wrapIntoObservable(r).pipe(Object(n_.a)())}else t=Object(Wi.a)([]);return e.firstChild&&(t=Object(Kg.a)(t,this._resolveCrumbs(e.firstChild))),t}postProcess(e){const t=[];return e.forEach(e=>{const n=e.text.split("/");if(n.length>1){e.text=n[n.length-1];for(let e=0;e<n.length-1;e++)t.push({text:n[e],path:null})}t.push(e)}),t}isPromise(e){return e&&"function"==typeof e.then}wrapIntoObservable(e){return e instanceof $u.a?e:this.isPromise(e)?Object(Zg.a)(Promise.resolve(e)):Object(Wi.a)(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e),i.Mb(i.s))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-breadcrumbs"]],decls:1,vars:1,consts:[["class","breadcrumb",4,"ngIf"],[1,"breadcrumb"],["class","breadcrumb-item",3,"ngClass",4,"ngFor","ngForOf"],[1,"breadcrumb-item",3,"ngClass"],["preserveFragment","",3,"routerLink",4,"ngIf"],[4,"ngIf"],["preserveFragment","",3,"routerLink"]],template:function(e,t){1&e&&i.Mc(0,c_,2,1,"ol",0),2&e&&i.pc("ngIf",t.crumbs.length)},directives:[o.r,o.q,o.p,Pt.h],styles:['@charset "UTF-8";.breadcrumb[_ngcontent-%COMP%]{background-color:initial;border-radius:0;margin-top:8px;padding:8px 0}.breadcrumb[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]:before{content:"\uf101";font-family:ForkAwesome;padding:0 5px 0 7px}']}),e})();const u_=function(e){return{dashboard:e}};let d_=(()=>{class e{constructor(e,t,n,i){this.router=e,this.summaryService=t,this.taskManagerService=n,this.faviconService=i,this.subs=new Oi.a}ngOnInit(){this.subs.add(this.summaryService.startPolling()),this.subs.add(this.taskManagerService.init(this.summaryService)),this.faviconService.init()}ngOnDestroy(){this.subs.unsubscribe()}isDashboardPage(){return"/dashboard"===this.router.url}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Pt.e),i.Mb(ab.a),i.Mb(lb.a),i.Mb(cb))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-workbench-layout"]],features:[i.xb([cb])],decls:6,vars:3,consts:[[1,"container-fluid","h-100",3,"ngClass"]],template:function(e,t){1&e&&(i.Sb(0,"block-ui"),i.Sb(1,"cd-navigation"),i.Sb(2,"div",0),i.Nb(3,"cd-context"),i.Nb(4,"cd-breadcrumbs"),i.Nb(5,"router-outlet"),i.Rb(),i.Rb(),i.Rb()),2&e&&(i.yb(2),i.pc("ngClass",i.uc(1,u_,t.isDashboardPage())))},directives:[_a,Wg,o.p,Qg,l_,Pt.j],styles:[".dashboard[_ngcontent-%COMP%]{background-color:#e9ecef;margin:0;padding:0}.container-fluid[_ngcontent-%COMP%]{overflow:auto}"]}),e})();var h_=n("Avrn");let f_=(()=>{class e{constructor(e,t){this.router=e,this.authStorageService=t}canActivate(e,t){return!(this.authStorageService.isLoggedIn()&&!this.authStorageService.isSSO()&&this.authStorageService.getPwdUpdateRequired()&&(this.router.navigate(["/login-change-password"],{queryParams:{returnUrl:t.url}}),1))}canActivateChild(e,t){return this.canActivate(e,t)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(Pt.e),i.dc(Jt.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var p_=n("Vhfg");let m_=(()=>{class e{constructor(e,t){this.http=e,this.router=t}canActivate(e){return this.doCheck(e)}canActivateChild(e){return this.doCheck(e)}doCheck(t){if(t.url.length>0&&e.ALLOWLIST.includes(t.url[0].path))return Object(Wi.a)(!0);const n=t.data.moduleStatusGuardConfig;return this.http.get(`api/${n.apiPath}/status`).pipe(Object(Vi.a)(e=>(e.available||this.router.navigate([n.redirectTo||""],{state:{header:n.header,message:e.message,section:n.section,section_info:n.section_info,icon:_n.a.wrench}}),e.available)),Object(db.a)(()=>(this.router.navigate([n.redirectTo]),Object(Wi.a)(!1))))}}return e.ALLOWLIST=["501"],e.\u0275fac=function(t){return new(t||e)(i.dc(a.b),i.dc(Pt.e))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),b_=(()=>{class e{constructor(e){this.authStorageService=e}canActivate(){if(!this.authStorageService.isSSO())return!0;throw new eu.c}canActivateChild(){return this.canActivate()}}return e.\u0275fac=function(t){return new(t||e)(i.dc(Jt.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),g_=(()=>{class e extends i_{resolve(e){const t=[],n=e.queryParams.fromLink||null;let i="";switch(n){case"/monitor":i="Monitors";break;case"/hosts":i="Hosts"}return t.push({text:"Cluster",path:null}),t.push({text:i,path:n}),t.push({text:"Performance Counters",path:""}),t}}return e.\u0275fac=function(t){return __(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();const __=i.Ub(g_);let y_=(()=>{class e extends i_{resolve(e){const t=e.params.name;return[{text:Nt.a.startCase(t)+"/Edit",path:t}]}}return e.\u0275fac=function(t){return v_(t||e)},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})();const v_=i.Ub(y_),w_=[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"",component:d_,canActivate:[h_.a,f_],canActivateChild:[h_.a,f_],children:[{path:"dashboard",component:If},{path:"error",component:Xm},{path:"hosts",data:{breadcrumbs:"Cluster/Hosts"},children:[{path:"",component:co},{path:gn.e.CREATE,component:ur,data:{breadcrumbs:gn.a.CREATE}}]},{path:"monitor",component:Aa,data:{breadcrumbs:"Cluster/Monitors"}},{path:"services",canActivateChild:[m_],data:{moduleStatusGuardConfig:{apiPath:"orchestrator",redirectTo:"error",section:"orch",section_info:"Orchestrator",header:"Orchestrator is not available"},breadcrumbs:"Cluster/Services"},children:[{path:"",component:ch},{path:gn.e.CREATE,component:th,data:{breadcrumbs:gn.a.CREATE}}]},{path:"inventory",canActivate:[m_],component:Yr,data:{moduleStatusGuardConfig:{apiPath:"orchestrator",redirectTo:"error",section:"orch",section_info:"Orchestrator",header:"Orchestrator is not available"},breadcrumbs:"Cluster/Physical Disks"}},{path:"osd",data:{breadcrumbs:"Cluster/OSDs"},children:[{path:"",component:Il},{path:gn.e.CREATE,component:hc,data:{breadcrumbs:gn.a.CREATE}}]},{path:"configuration",data:{breadcrumbs:"Cluster/Configuration"},children:[{path:"",component:Ci},{path:"edit/:name",component:bi,data:{breadcrumbs:gn.a.EDIT}}]},{path:"crush-map",component:Hi,data:{breadcrumbs:"Cluster/CRUSH map"}},{path:"logs",component:Po,data:{breadcrumbs:"Cluster/Logs"}},{path:"telemetry",component:bh,data:{breadcrumbs:"Telemetry configuration"}},{path:"monitoring",data:{breadcrumbs:"Cluster/Monitoring"},children:[{path:"",redirectTo:"active-alerts",pathMatch:"full"},{path:"active-alerts",data:{breadcrumbs:"Active Alerts"},component:ql},{path:"alerts",data:{breadcrumbs:"Alerts"},component:Xl},{path:"silences",data:{breadcrumbs:"Silences"},children:[{path:"",component:Bu},{path:gn.e.CREATE,component:Yu,data:{breadcrumbs:gn.a.CREATE+" Silence"}},{path:gn.e.CREATE+"/:id",component:Yu,data:{breadcrumbs:gn.a.CREATE}},{path:gn.e.EDIT+"/:id",component:Yu,data:{breadcrumbs:gn.a.EDIT}},{path:gn.e.RECREATE+"/:id",component:Yu,data:{breadcrumbs:gn.a.RECREATE}}]}]},{path:"perf_counters/:type/:id",component:Mm,data:{breadcrumbs:g_}},{path:"mgr-modules",data:{breadcrumbs:"Cluster/Manager Modules"},children:[{path:"",component:Ra},{path:"edit/:name",component:oa,data:{breadcrumbs:y_}}]},{path:"pool",data:{breadcrumbs:"Pools"},loadChildren:()=>Promise.all([n.e(1),n.e(5)]).then(n.bind(null,"5azF")).then(e=>e.RoutedPoolModule)},{path:"block",data:{breadcrumbs:!0,text:"Block",path:null},loadChildren:()=>n.e(1).then(n.bind(null,"k/xb")).then(e=>e.RoutedBlockModule)},{path:"cephfs",component:Bn,canActivate:[p_.a],data:{breadcrumbs:"File Systems"}},{path:"rgw",canActivateChild:[p_.a,m_],data:{moduleStatusGuardConfig:{apiPath:"rgw",redirectTo:"error",section:"rgw",section_info:"Object Gateway",header:"The Object Gateway Service is not configured"},breadcrumbs:!0,text:"Object Gateway",path:null},loadChildren:()=>n.e(6).then(n.bind(null,"OkK6")).then(e=>e.RoutedRgwModule)},{path:"user-management",data:{breadcrumbs:"User management",path:null},loadChildren:()=>Promise.resolve().then(n.bind(null,"LceX")).then(e=>e.RoutedAuthModule)},{path:"user-profile",data:{breadcrumbs:"User profile",path:null},children:[{path:gn.e.EDIT,component:Pm,canActivate:[b_],data:{breadcrumbs:gn.a.EDIT}}]},{path:"nfs",canActivateChild:[p_.a,m_],data:{moduleStatusGuardConfig:{apiPath:"nfs-ganesha",redirectTo:"error",section:"nfs-ganesha",section_info:"NFS GANESHA",header:"NFS-Ganesha is not configured"},breadcrumbs:"NFS"},children:[{path:"",component:Sm},{path:gn.e.CREATE,component:um,data:{breadcrumbs:gn.a.CREATE}},{path:gn.e.EDIT+"/:cluster_id/:export_id",component:um,data:{breadcrumbs:gn.a.EDIT}}]}]},{path:"",component:ob,children:[{path:"login",component:qm},{path:"login-change-password",component:Wm,canActivate:[b_]}]},{path:"",component:eb,children:[{path:"**",redirectTo:"/error"}]}];let S_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[y_,g_],imports:[[Pt.i.forRoot(w_,{useHash:!0,preloadingStrategy:Pt.d})],Pt.i]}),e})(),M_=(()=>{class e{constructor(e,t){e.autoClose="outside",e.container="body",e.placement="bottom",t.container="body"}}return e.\u0275fac=function(t){return new(t||e)(i.Mb(Qt.x),i.Mb(Qt.E))},e.\u0275cmp=i.Gb({type:e,selectors:[["cd-root"]],decls:1,vars:0,template:function(e,t){1&e&&i.Nb(0,"router-outlet")},directives:[Pt.j],styles:[""]}),e})();var x_=n("PCNd");let k_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[o.c,x_.a,S_,sn.b,kn.c,Qt.t]]}),e})();var D_=n("G6Q+"),T_=n("kJI8");let C_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[S_,o.c,xn.x,x_.a,Qt.t]]}),e})(),O_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[o.c,D_.a,Qt.t,x_.a,Pt.i,xn.m,xn.x,Qt.F,C_,Qt.H,Qt.C,kn.c,T_.a,Qt.h,Qt.y,Qt.l,Hr.a]]}),e})(),R_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[T_.a,o.c,Qt.t,x_.a,sn.b,Pt.i,Qt.y]]}),e})(),L_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[xn.x,Pt.i,x_.a,Qt.t,o.c,Qt.H,Qt.F]]}),e})(),E_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[o.c,O_,R_,D_.a,k_,L_,x_.a]]}),e})();var A_=n("LceX");let I_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[o.c,A_.AuthModule,Qt.f,Qt.l,S_,x_.a,Eb.b,Pt.i]]}),e})(),P_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},imports:[[ka.forRoot(),o.c,I_,Qt.l,Pt.i,x_.a],I_]}),e})();var j_=n("z6cu");let N_=(()=>{class e{constructor(e,t,n){this.router=e,this.authStorageService=t,this.notificationService=n}intercept(e,t){const n=e.headers.get("Accept");let i;return i=n&&n.startsWith("application/vnd.ceph.api.v")?e.clone():e.clone({setHeaders:{Accept:"application/vnd.ceph.api.v1.0+json"}}),t.handle(i).pipe(Object(db.a)(e=>{if(e instanceof a.d){let t;switch(e.status){case 400:const n=new tr.a,i=e.error.task;Nt.a.isPlainObject(i)?(i.metadata.component=i.metadata.component||e.error.component,n.name=i.name,n.metadata=i.metadata):n.metadata=e.error,n.success=!1,n.exception=e.error,t=this.notificationService.notifyTask(n);break;case 401:this.authStorageService.remove(),this.router.navigate(["/login"]);break;case 403:this.router.navigate(["error"],{state:{message:"Sorry, you don\u2019t have permission to view this page or resource.",header:"Access Denied",icon:"fa fa-lock",source:"forbidden"}});break;default:t=this.prepareNotification(e)}e.preventDefault=()=>{this.notificationService.cancel(t)},e.ignoreStatusCode=function(e){this.status===e&&this.preventDefault()}}return Object(j_.a)(e)}))}prepareNotification(e){return this.notificationService.show(()=>{let t="";return Nt.a.isPlainObject(e.error)&&Nt.a.isString(e.error.detail)?t=e.error.detail:Nt.a.isString(e.error)?t=e.error:Nt.a.isString(e.message)&&(t=e.message),new Nl.b(yn.a.error,`${e.status} - ${e.statusText}`,t,void 0,e.application)})}}return e.\u0275fac=function(t){return new(t||e)(i.dc(Pt.e),i.dc(Jt.a),i.dc(wn.a))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),F_=(()=>{class e{constructor(e){this.http=e}jsError(e,t,n){return this.http.post("ui-api/logging/js-error",{url:e,message:t,stack:n})}}return e.\u0275fac=function(t){return new(t||e)(i.dc(a.b))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Y_=(()=>{class e{constructor(e,t){this.injector=e,this.router=t}handleError(e){const t=this.injector.get(F_),n=window.location.href;if(t.jsError(n,e&&e.message,e&&e.stack).subscribe(),!(e.rejection instanceof eu.a))throw e;setTimeout(()=>this.router.navigate(["error"],{state:{message:e.rejection.message,header:e.rejection.header,icon:e.rejection.icon}}),50)}}return e.\u0275fac=function(t){return new(t||e)(i.dc(i.s),i.dc(Pt.e))},e.\u0275prov=i.Ib({token:e,factory:e.\u0275fac}),e})(),z_=(()=>{class e{}return e.\u0275mod=i.Kb({type:e,bootstrap:[M_]}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)},providers:[{provide:i.n,useClass:Y_},{provide:a.a,useClass:N_,multi:!0},{provide:o.a,useValue:"/"+(window.location.pathname.split("/",1)[1]||"")}],imports:[[a.c,r.a,At,It.a.forRoot({positionClass:"toast-top-right",preventDuplicates:!0,enableHtml:!0}),S_,P_,x_.a,E_],x_.a]}),e})();s.a.production&&Object(i.S)(),r.d().bootstrapModule(z_).then(e=>{if(Object(i.U)()){const t=e.injector.get(i.g).components[0];Object(r.c)(t)}}).catch(e=>console.log(e))},zWsK:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return r}));var i=n("8Y7J");let r=(()=>{class e{transform(e,t,n){return n?t.call(n,e):t(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Lb({name:"pipeFunction",type:e,pure:!0}),e})(),s=(()=>{class e{}return e.\u0275mod=i.Kb({type:e}),e.\u0275inj=i.Jb({factory:function(t){return new(t||e)}}),e})()},zc8c:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("/NlG"),r=n("XFyV"),s=n("spCT"),o=n("8Y7J");let a=(()=>{class e{constructor(e,t,n){this.templateRef=e,this.viewContainer=t,this.componentFactoryResolver=n}set cdFormLoading(e){let t,n;switch(this.viewContainer.clear(),e){case s.b.Loading:t=this.componentFactoryResolver.resolveComponentFactory(r.a),n=this.resolveNgContent("Loading form data..."),this.viewContainer.createComponent(t,null,null,n);break;case s.b.Ready:this.viewContainer.createEmbeddedView(this.templateRef);break;case s.b.Error:t=this.componentFactoryResolver.resolveComponentFactory(i.a),n=this.resolveNgContent("Form data could not be loaded."),this.viewContainer.createComponent(t,null,null,n).instance.type="error"}}resolveNgContent(e){return[[document.createTextNode(e)]]}}return e.\u0275fac=function(t){return new(t||e)(o.Mb(o.L),o.Mb(o.P),o.Mb(o.j))},e.\u0275dir=o.Hb({type:e,selectors:[["","cdFormLoading",""]],inputs:{cdFormLoading:"cdFormLoading"}}),e})()},zk60:function(e,t,n){var i=n("2oRo"),r=n("kRJp");e.exports=function(e,t){try{r(i,e,t)}catch(n){i[e]=t}return t}},zn8P:function(e,t){function n(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="zn8P"},zx2A:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c}));var i=n("7o/Q"),r=n("HDdC"),s=n("SeVD");class o extends i.a{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class a extends i.a{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function c(e,t){if(!t.closed)return e instanceof r.a?e.subscribe(t):Object(s.a)(e)(t)}},zx6S:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedelje] [u] LT","[pro\u0161log] [ponedeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))}},[[0,0]]]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.d269a7c492a93e2ebedb.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/main.d269a7c492a93e2ebedb.js
new file mode 100644 (file)
index 0000000..88b58f6
--- /dev/null
@@ -0,0 +1,3 @@
+var $localize=Object.assign(void 0===$localize?{}:$localize,{locale:"en-US"});
+"use strict";(function(global){global.ng=global.ng||{};global.ng.common=global.ng.common||{};global.ng.common.locales=global.ng.common.locales||{};const u=undefined;function plural(n){let i=Math.floor(Math.abs(n)),v=n.toString().replace(/^[^.]*\.?/,"").length;if(i===1&&v===0)return 1;return 5}global.ng.common.locales["en-us-posix"]=["en-US-POSIX",[["a","p"],["AM","PM"],u],[["AM","PM"],u,u],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],u,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],u,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",u,"{1} 'at' {0}",u],[".",",",";","%","+","-","E","\xD7","0/00","INF","NaN",":"],["0.######","0%","\xA4\xA00.00","0.000000E+000"],"USD","$","US Dollar",{},"ltr",plural,[[["mi","n","in the morning","in the afternoon","in the evening","at night"],["midnight","noon","in the morning","in the afternoon","in the evening","at night"],u],[["midnight","noon","morning","afternoon","evening","night"],u,u],["00:00","12:00",["06:00","12:00"],["12:00","18:00"],["18:00","21:00"],["21:00","06:00"]]]]})(typeof globalThis!=="undefined"&&globalThis||typeof global!=="undefined"&&global||typeof window!=="undefined"&&window);;
+(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"+0ag":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=/ceph version\s+[^ ]+\s+\(.+\)\s+(.+)\s+\((.+)\)/.exec(e);return t?"dev"===t[2]?"master":t[1]:e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"cephReleaseName",type:e,pure:!0}),e})()},"+EKe":function(e,t,n){"use strict";var i=n("23KU"),r=n("uE2L");t.a=function(e,t,n,s){var o=!n;n||(n={});for(var a=-1,c=t.length;++a<c;){var l=t[a],u=s?s(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),o?Object(r.a)(n,l,u):Object(i.a)(n,l,u)}return n}},"+fVR":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("e2NH");class r{constructor(e){this.ngZone=e}setExpandedRow(e){this.expandedRow=e}setTableRefreshTimeout(){clearTimeout(this.staleTimeout),this.ngZone.runOutsideAngular(()=>{this.staleTimeout=window.setTimeout(()=>{this.ngZone.run(()=>{this.tableStatus=new i.a("warning","The user list data might be stale. If needed, you can manually reload it.")})},1e4)})}}},"+s0g":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),i=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",w:"\xe9\xe9n week",ww:"%d weken",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"//9w":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"o\u0111\u0111ajagem\xe1nnu_guovvam\xe1nnu_njuk\u010dam\xe1nnu_cuo\u014bom\xe1nnu_miessem\xe1nnu_geassem\xe1nnu_suoidnem\xe1nnu_borgem\xe1nnu_\u010dak\u010dam\xe1nnu_golggotm\xe1nnu_sk\xe1bmam\xe1nnu_juovlam\xe1nnu".split("_"),monthsShort:"o\u0111\u0111j_guov_njuk_cuo_mies_geas_suoi_borg_\u010dak\u010d_golg_sk\xe1b_juov".split("_"),weekdays:"sotnabeaivi_vuoss\xe1rga_ma\u014b\u014beb\xe1rga_gaskavahkku_duorastat_bearjadat_l\xe1vvardat".split("_"),weekdaysShort:"sotn_vuos_ma\u014b_gask_duor_bear_l\xe1v".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s gea\u017ees",past:"ma\u014bit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta m\xe1nnu",MM:"%d m\xe1nut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"/1FC":function(e,t,n){"use strict";t.a=Array.isArray},"/GqU":function(e,t,n){var i=n("RK3t"),r=n("HYAF");e.exports=function(e){return i(r(e))}},"/NlG":function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n("8Y7J"),r=n("oxzT"),s=n("G0yt"),o=n("SVse");const a=function(e){return[e]};function c(e,t){if(1&e&&(i.Xb(0,"td",8),i.Sb(1,"i",9),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.Hb("alert-",e.bootstrapClass," ",e.typeIcon,""),i.uc("ngClass",i.zc(5,a,e.icons.large3x))}}function l(e,t){if(1&e&&(i.Xb(0,"td",10),i.Rc(1),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.Sc(e.title)}}function u(e,t){1&e&&i.Tb(0)}function d(e,t){if(1&e&&(i.Vb(0),i.Xb(1,"tr"),i.Pc(2,c,2,7,"td",4),i.Pc(3,l,2,1,"td",5),i.Wb(),i.Xb(4,"tr"),i.Xb(5,"td",6),i.Pc(6,u,1,0,"ng-container",7),i.Wb(),i.Wb(),i.Ub()),2&e){const e=i.nc(),t=i.Fc(6);i.Db(2),i.uc("ngIf",e.showIcon),i.Db(1),i.uc("ngIf",e.showTitle),i.Db(3),i.uc("ngTemplateOutlet",t)}}function h(e,t){if(1&e&&(i.Xb(0,"td",12),i.Sb(1,"i",13),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.Hb("alert-",e.bootstrapClass," ",e.typeIcon,"")}}function f(e,t){if(1&e&&(i.Xb(0,"td",10),i.Rc(1),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.Sc(e.title)}}function p(e,t){1&e&&i.Tb(0)}function m(e,t){if(1&e&&(i.Xb(0,"tr"),i.Pc(1,h,2,4,"td",11),i.Pc(2,f,2,1,"td",5),i.Xb(3,"td",6),i.Pc(4,p,1,0,"ng-container",7),i.Wb(),i.Wb()),2&e){const e=i.nc(),t=i.Fc(6);i.Db(1),i.uc("ngIf",e.showIcon),i.Db(1),i.uc("ngIf",e.showTitle),i.Db(2),i.uc("ngTemplateOutlet",t)}}function b(e,t){1&e&&i.sc(0)}const g=["*"];let _=(()=>{class e{constructor(){this.title="",this.bootstrapClass="",this.size="normal",this.showIcon=!0,this.showTitle=!0,this.dismissible=!1,this.dismissed=new i.p,this.icons=r.a}ngOnInit(){switch(this.type){case"warning":this.title=this.title||"Warning",this.typeIcon=this.typeIcon||r.a.warning,this.bootstrapClass=this.bootstrapClass||"warning";break;case"error":this.title=this.title||"Error",this.typeIcon=this.typeIcon||r.a.destroyCircle,this.bootstrapClass=this.bootstrapClass||"danger";break;case"info":this.title=this.title||"Information",this.typeIcon=this.typeIcon||r.a.infoCircle,this.bootstrapClass=this.bootstrapClass||"info";break;case"success":this.title=this.title||"Success",this.typeIcon=this.typeIcon||r.a.check,this.bootstrapClass=this.bootstrapClass||"success";break;case"danger":this.title=this.title||"Danger",this.typeIcon=this.typeIcon||r.a.warning,this.bootstrapClass=this.bootstrapClass||"danger"}}onClose(){this.dismissed.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-alert-panel"]],inputs:{title:"title",bootstrapClass:"bootstrapClass",type:"type",typeIcon:"typeIcon",size:"size",showIcon:"showIcon",showTitle:"showTitle",dismissible:"dismissible"},outputs:{dismissed:"dismissed"},ngContentSelectors:g,decls:7,vars:4,consts:[[3,"type","dismissible","close"],[4,"ngIf","ngIfElse"],["slim",""],["content",""],["rowspan","2","class","alert-panel-icon",4,"ngIf"],["class","alert-panel-title",4,"ngIf"],[1,"alert-panel-text"],[4,"ngTemplateOutlet"],["rowspan","2",1,"alert-panel-icon"],["aria-hidden","true",3,"ngClass"],[1,"alert-panel-title"],["class","alert-panel-icon",4,"ngIf"],[1,"alert-panel-icon"],["aria-hidden","true"]],template:function(e,t){if(1&e&&(i.tc(),i.Xb(0,"ngb-alert",0),i.lc("close",function(){return t.onClose()}),i.Xb(1,"table"),i.Pc(2,d,7,3,"ng-container",1),i.Pc(3,m,5,3,"ng-template",null,2,i.Qc),i.Wb(),i.Wb(),i.Pc(5,b,1,0,"ng-template",null,3,i.Qc)),2&e){const e=i.Fc(4);i.vc("type",t.bootstrapClass),i.uc("dismissible",t.dismissible),i.Db(2),i.uc("ngIf","normal"===t.size)("ngIfElse",e)}},directives:[s.b,o.r,o.w,o.p],styles:[".alert-panel-icon[_ngcontent-%COMP%]{padding-right:.5em;vertical-align:top}.alert-panel-title[_ngcontent-%COMP%]{font-weight:700}"]}),e})()},"/OPJ":function(e,t,n){var i=n("0Dky"),r=n("2oRo").RegExp;e.exports=i(function(){var e=r(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})},"/X5v":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~\xe1\xf1\xfa\xe1~r\xfd_F~\xe9br\xfa~\xe1r\xfd_~M\xe1rc~h_\xc1p~r\xedl_~M\xe1\xfd_~J\xfa\xf1\xe9~_J\xfal~\xfd_\xc1\xfa~g\xfast~_S\xe9p~t\xe9mb~\xe9r_\xd3~ct\xf3b~\xe9r_\xd1~\xf3v\xe9m~b\xe9r_~D\xe9c\xe9~mb\xe9r".split("_"),monthsShort:"J~\xe1\xf1_~F\xe9b_~M\xe1r_~\xc1pr_~M\xe1\xfd_~J\xfa\xf1_~J\xfal_~\xc1\xfag_~S\xe9p_~\xd3ct_~\xd1\xf3v_~D\xe9c".split("_"),monthsParseExact:!0,weekdays:"S~\xfa\xf1d\xe1~\xfd_M\xf3~\xf1d\xe1\xfd~_T\xfa\xe9~sd\xe1\xfd~_W\xe9d~\xf1\xe9sd~\xe1\xfd_T~h\xfars~d\xe1\xfd_~Fr\xedd~\xe1\xfd_S~\xe1t\xfar~d\xe1\xfd".split("_"),weekdaysShort:"S~\xfa\xf1_~M\xf3\xf1_~T\xfa\xe9_~W\xe9d_~Th\xfa_~Fr\xed_~S\xe1t".split("_"),weekdaysMin:"S~\xfa_M\xf3~_T\xfa_~W\xe9_T~h_Fr~_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~\xf3d\xe1~\xfd \xe1t] LT",nextDay:"[T~\xf3m\xf3~rr\xf3~w \xe1t] LT",nextWeek:"dddd [\xe1t] LT",lastDay:"[\xdd~\xe9st~\xe9rd\xe1~\xfd \xe1t] LT",lastWeek:"[L~\xe1st] dddd [\xe1t] LT",sameElse:"L"},relativeTime:{future:"\xed~\xf1 %s",past:"%s \xe1~g\xf3",s:"\xe1 ~f\xe9w ~s\xe9c\xf3~\xf1ds",ss:"%d s~\xe9c\xf3\xf1~ds",m:"\xe1 ~m\xed\xf1~\xfat\xe9",mm:"%d m~\xed\xf1\xfa~t\xe9s",h:"\xe1~\xf1 h\xf3~\xfar",hh:"%d h~\xf3\xfars",d:"\xe1 ~d\xe1\xfd",dd:"%d d~\xe1\xfds",M:"\xe1 ~m\xf3\xf1~th",MM:"%d m~\xf3\xf1t~hs",y:"\xe1 ~\xfd\xe9\xe1r",yy:"%d \xfd~\xe9\xe1rs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"/b8u":function(e,t,n){var i=n("STAE");e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},"/byt":function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},"/uUt":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e,t){return n=>n.lift(new s(e,t))}class s{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new o(e,this.compare,this.keySelector))}}class o extends i.a{constructor(e,t,n){super(e),this.keySelector=n,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:n}=this;t=n?n(e):e}catch(i){return this.destination.error(i)}let n=!1;if(this.hasKey)try{const{compare:e}=this;n=e(this.key,t)}catch(i){return this.destination.error(i)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))}}},0:function(e,t,n){e.exports=n("zUnb")},"0+/T":function(e,t,n){"use strict";n.d(t,"a",function(){return T});var i=n("s7LF"),r=n("QFaf"),s=n("sb0X"),o=n("8Y7J"),a=n("G0yt"),c=n("ajRT"),l=n("SVse"),u=n("NwgZ"),d=n("ocLN"),h=n("ANnk"),f=n("f69J"),p=n("IZUe"),m=n("6+kj");function b(e,t){1&e&&o.Tb(0)}function g(e,t){1&e&&o.Tb(0)}function _(e,t){if(1&e&&(o.Xb(0,"p"),o.hc(1,21),o.oc(2,"lowercase"),o.Sb(3,"strong"),o.ec(),o.Wb()),2&e){const e=o.nc(2);o.Db(3),o.fc(o.pc(2,2,e.actionDescription))(e.itemNames[0]),o.cc(1)}}function v(e,t){if(1&e&&(o.Xb(0,"li"),o.Xb(1,"strong"),o.Rc(2),o.Wb(),o.Wb()),2&e){const e=t.$implicit;o.Db(2),o.Sc(e)}}function y(e,t){if(1&e&&(o.Xb(0,"p"),o.bc(1,22),o.oc(2,"lowercase"),o.Wb(),o.Xb(3,"ul"),o.Pc(4,v,3,1,"li",23),o.Wb()),2&e){const e=o.nc(2);o.Db(2),o.fc(o.pc(2,2,e.actionDescription)),o.cc(1),o.Db(2),o.uc("ngForOf",e.itemNames)}}function w(e,t){if(1&e&&(o.Xb(0,"span"),o.Pc(1,_,4,4,"p",10),o.Pc(2,y,5,4,"ng-template",null,20,o.Qc),o.Wb()),2&e){const e=o.Fc(3),t=o.nc();o.Db(1),o.uc("ngIf",1===t.itemNames.length)("ngIfElse",e)}}function D(e,t){if(1&e&&(o.Xb(0,"p"),o.bc(1,24),o.oc(2,"lowercase"),o.Wb()),2&e){const e=o.nc();o.Db(2),o.fc(o.pc(2,2,e.actionDescription))(e.itemDescription),o.cc(1)}}function S(e,t){1&e&&o.Tb(0)}function x(e,t){if(1&e&&(o.Rc(0),o.oc(1,"titlecase")),2&e){const e=o.nc();o.Uc(" ",o.pc(1,2,e.actionDescription)," ",e.itemDescription,"\n")}}const k=function(e){return{form:e}};let T=(()=>{class e{constructor(e){this.activeModal=e,this.actionDescription="delete"}ngOnInit(){const e={confirmation:new i.h(!1,[i.A.requiredTrue])};if(this.childFormGroup&&(e.child=this.childFormGroup),this.deletionForm=new r.a(e),!this.submitAction&&!this.submitActionObservable)throw new Error("No submit action defined")}callSubmitAction(){this.submitActionObservable?this.submitActionObservable().subscribe({error:this.stopLoadingSpinner.bind(this),complete:this.hideModal.bind(this)}):this.submitAction()}hideModal(){this.activeModal.close()}stopLoadingSpinner(){this.deletionForm.setErrors({cdSubmitButton:!0})}}return e.\u0275fac=function(t){return new(t||e)(o.Rb(a.a))},e.\u0275cmp=o.Lb({type:e,selectors:[["cd-deletion-modal"]],viewQuery:function(e,t){if(1&e&&o.Wc(s.a,3),2&e){let e;o.Ec(e=o.mc())&&(t.submitButton=e.first)}},decls:24,vars:15,consts:function(){let e,t,n,i;return e="Yes, I am sure.",t="Are you sure that you want to " + "\ufffd0\ufffd" + " " + "\ufffd#3\ufffd" + "" + "\ufffd1\ufffd" + "" + "\ufffd/#3\ufffd" + "?",n="Are you sure that you want to " + "\ufffd0\ufffd" + " the selected items?",i="Are you sure that you want to " + "\ufffd0\ufffd" + " the selected " + "\ufffd1\ufffd" + "?",[[3,"modalRef"],["modal",""],[1,"modal-title"],[4,"ngTemplateOutlet"],[1,"modal-content"],["name","deletionForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"question"],[4,"ngIf","ngIfElse"],["noNames",""],[1,"form-group"],[1,"custom-control","custom-checkbox"],["type","checkbox","name","confirmation","id","confirmation","formControlName","confirmation","autofocus","",1,"custom-control-input"],["for","confirmation",1,"custom-control-label"],e,[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["deletionHeading",""],["manyNames",""],t,n,[4,"ngFor","ngForOf"],i]},template:function(e,t){if(1&e&&(o.Xb(0,"cd-modal",0,1),o.Vb(2,2),o.Pc(3,b,1,0,"ng-container",3),o.Ub(),o.Vb(4,4),o.Xb(5,"form",5,6),o.Xb(7,"div",7),o.Pc(8,g,1,0,"ng-container",8),o.Xb(9,"div",9),o.Pc(10,w,4,2,"span",10),o.Pc(11,D,3,4,"ng-template",null,11,o.Qc),o.Pc(13,S,1,0,"ng-container",8),o.Xb(14,"div",12),o.Xb(15,"div",13),o.Sb(16,"input",14),o.Xb(17,"label",15),o.bc(18,16),o.Wb(),o.Wb(),o.Wb(),o.Wb(),o.Wb(),o.Xb(19,"div",17),o.Xb(20,"cd-form-button-panel",18),o.lc("submitActionEvent",function(){return t.callSubmitAction()}),o.oc(21,"titlecase"),o.Wb(),o.Wb(),o.Wb(),o.Ub(),o.Wb(),o.Pc(22,x,2,4,"ng-template",null,19,o.Qc)),2&e){const e=o.Fc(12),n=o.Fc(23);o.uc("modalRef",t.activeModal),o.Db(3),o.uc("ngTemplateOutlet",n),o.Db(2),o.uc("formGroup",t.deletionForm),o.Db(3),o.uc("ngTemplateOutlet",t.bodyTemplate)("ngTemplateOutletContext",t.bodyContext),o.Db(2),o.uc("ngIf",t.itemNames)("ngIfElse",e),o.Db(3),o.uc("ngTemplateOutlet",t.childFormGroupTemplate)("ngTemplateOutletContext",o.zc(13,k,t.deletionForm)),o.Db(7),o.uc("form",t.deletionForm)("submitText",o.pc(21,11,t.actionDescription)+" "+t.itemDescription)}},directives:[c.a,l.w,i.B,i.r,i.k,u.a,l.r,d.a,h.a,i.b,f.a,i.q,i.i,p.a,m.a,l.q],pipes:[l.A,l.o],styles:[".modal-body[_ngcontent-%COMP%]   .question[_ngcontent-%COMP%]{margin-top:1em}.modal-body[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:700}.modal-body[_ngcontent-%COMP%]   .question[_ngcontent-%COMP%]   .form-check[_ngcontent-%COMP%]{padding-top:7px}"]}),e})()},"07d7":function(e,t,n){var i=n("AO7/"),r=n("busE"),s=n("sEFX");i||r(Object.prototype,"toString",s,{unsafe:!0})},"0BK2":function(e,t){e.exports={}},"0Dky":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"0GbY":function(e,t,n){var i=n("2oRo"),r=n("Fib7"),s=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(i[e]):i[e]&&i[e][t]}},"0eef":function(e,t,n){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!i.call({1:2},1);t.f=s?function(e){var t=r(this,e);return!!t&&t.enumerable}:i},"0mo+":function(e,t,n){!function(e){"use strict";var t={1:"\u0f21",2:"\u0f22",3:"\u0f23",4:"\u0f24",5:"\u0f25",6:"\u0f26",7:"\u0f27",8:"\u0f28",9:"\u0f29",0:"\u0f20"},n={"\u0f21":"1","\u0f22":"2","\u0f23":"3","\u0f24":"4","\u0f25":"5","\u0f26":"6","\u0f27":"7","\u0f28":"8","\u0f29":"9","\u0f20":"0"};e.defineLocale("bo",{months:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f44\u0f0b\u0f54\u0f7c_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f66\u0f74\u0f58\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f5e\u0f72\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f63\u0f94\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0fb2\u0f74\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f62\u0f92\u0fb1\u0f51\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f42\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f45\u0f72\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54".split("_"),monthsShort:"\u0f5f\u0fb3\u0f0b1_\u0f5f\u0fb3\u0f0b2_\u0f5f\u0fb3\u0f0b3_\u0f5f\u0fb3\u0f0b4_\u0f5f\u0fb3\u0f0b5_\u0f5f\u0fb3\u0f0b6_\u0f5f\u0fb3\u0f0b7_\u0f5f\u0fb3\u0f0b8_\u0f5f\u0fb3\u0f0b9_\u0f5f\u0fb3\u0f0b10_\u0f5f\u0fb3\u0f0b11_\u0f5f\u0fb3\u0f0b12".split("_"),monthsShortRegex:/^(\u0f5f\u0fb3\u0f0b\d{1,2})/,monthsParseExact:!0,weekdays:"\u0f42\u0f5f\u0f60\u0f0b\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f42\u0f5f\u0f60\u0f0b\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysShort:"\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysMin:"\u0f49\u0f72_\u0f5f\u0fb3_\u0f58\u0f72\u0f42_\u0f63\u0fb7\u0f42_\u0f55\u0f74\u0f62_\u0f66\u0f44\u0f66_\u0f66\u0fa4\u0f7a\u0f53".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0f51\u0f72\u0f0b\u0f62\u0f72\u0f44] LT",nextDay:"[\u0f66\u0f44\u0f0b\u0f49\u0f72\u0f53] LT",nextWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f62\u0f97\u0f7a\u0f66\u0f0b\u0f58], LT",lastDay:"[\u0f41\u0f0b\u0f66\u0f44] LT",lastWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f58\u0f50\u0f60\u0f0b\u0f58] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0f63\u0f0b",past:"%s \u0f66\u0f94\u0f53\u0f0b\u0f63",s:"\u0f63\u0f58\u0f0b\u0f66\u0f44",ss:"%d \u0f66\u0f90\u0f62\u0f0b\u0f46\u0f0d",m:"\u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b\u0f42\u0f45\u0f72\u0f42",mm:"%d \u0f66\u0f90\u0f62\u0f0b\u0f58",h:"\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b\u0f42\u0f45\u0f72\u0f42",hh:"%d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51",d:"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f45\u0f72\u0f42",dd:"%d \u0f49\u0f72\u0f53\u0f0b",M:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f45\u0f72\u0f42",MM:"%d \u0f5f\u0fb3\u0f0b\u0f56",y:"\u0f63\u0f7c\u0f0b\u0f42\u0f45\u0f72\u0f42",yy:"%d \u0f63\u0f7c"},preparse:function(e){return e.replace(/[\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29\u0f20]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c|\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66|\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44|\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42|\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"===t&&e>=4||"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44"===t&&e<5||"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c":e<10?"\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66":e<17?"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44":e<20?"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42":"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"},week:{dow:0,doy:6}})}(n("wd/R"))},"0rvr":function(e,t,n){var i=n("4zBA"),r=n("glrk"),s=n("O741");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(o){}return function(n,i){return r(n),s(i),t?e(n,i):n.__proto__=i,n}}():void 0)},"0tRk":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_ter\xe7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xe1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xe1b".split("_"),weekdaysMin:"do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xe0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xe0s] HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",invalidDate:"Data inv\xe1lida"})}(n("wd/R"))},"14Sl":function(e,t,n){"use strict";n("rB9j");var i=n("4zBA"),r=n("busE"),s=n("kmMV"),o=n("0Dky"),a=n("tiKp"),c=n("kRJp"),l=a("species"),u=RegExp.prototype;e.exports=function(e,t,n,d){var h=a(e),f=!o(function(){var t={};return t[h]=function(){return 7},7!=""[e](t)}),p=f&&!o(function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[l]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t});if(!f||!p||n){var m=i(/./[h]),b=t(h,""[e],function(e,t,n,r,o){var a=i(e),c=t.exec;return c===s||c===u.exec?f&&!o?{done:!0,value:m(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}});r(String.prototype,e,b[0]),r(u,h,b[1])}d&&c(u[h],"sham",!0)}},"1E5z":function(e,t,n){var i=n("m/L8").f,r=n("Gi26"),s=n("tiKp")("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,s)&&i(e,s,{configurable:!0,value:t})}},"1G5W":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("zx2A");function r(e){return t=>t.lift(new s(e))}class s{constructor(e){this.notifier=e}call(e,t){const n=new o(e),r=Object(i.c)(this.notifier,new i.a(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n}}class o extends i.b{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}},"1Ni5":function(e,t,n){"use strict";n.d(t,"b",function(){return p}),n.d(t,"a",function(){return m});var i=n("s7LF"),r=n("LvDl"),s=n.n(r),o=n("LRne"),a=n("PqYM"),c=n("eIep");function l(e,t){return t?Object(c.a)(()=>e,t):Object(c.a)(()=>e)}var u=n("lJxs"),d=n("IzEk"),h=n("Fgil"),f=n("aXbf");function p(e){return null==e||0===e.length}class m{static email(e){return p(e.value)?null:i.A.email(e)}static ip(e=0){const t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i,n=/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;return i.A.pattern(4===e?t:6===e?n:new RegExp(t.source+"|"+n.source))}static number(e=!0){return i.A.pattern(e?/^-?[0-9]+$/i:/^[0-9]+$/i)}static decimalNumber(e=!0){return i.A.pattern(e?/^-?[0-9]+(.[0-9]+)?$/i:/^[0-9]+(.[0-9]+)?$/i)}static sslCert(){return i.A.pattern(/^-----BEGIN CERTIFICATE-----(\n|\r|\f)((.+)?((\n|\r|\f).+)*)(\n|\r|\f)-----END CERTIFICATE-----[\n\r\f]*$/)}static sslPrivKey(){return i.A.pattern(/^-----BEGIN RSA PRIVATE KEY-----(\n|\r|\f)((.+)?((\n|\r|\f).+)*)(\n|\r|\f)-----END RSA PRIVATE KEY-----[\n\r\f]*$/)}static pemCert(){return i.A.pattern(/^-----BEGIN .+-----$.+^-----END .+-----$/ms)}static requiredIf(e,t){let n=!1;return i=>(!n&&i.parent&&(Object.keys(e).forEach(e=>{i.parent.get(e).valueChanges.subscribe(()=>{i.updateValueAndValidity({emitEvent:!1})})}),n=!0),Object.keys(e).every(t=>{if(!i.parent)return!1;const n=i.parent.get(t).value,r=e[t];if(s.a.isObjectLike(r)){let e=!1;switch(r.op){case"empty":e=s.a.isEmpty(n);break;case"!empty":e=!s.a.isEmpty(n);break;case"equal":e=n===r.arg1;break;case"!equal":e=n!==r.arg1;break;case"minLength":s.a.isString(n)&&(e=n.length>=r.arg1)}return e}return n===r})&&(s.a.isFunction(t)?t.call(t,i.value):p(i.value))?{required:!0}:null)}static composeIf(e,t){let n=!1;return r=>(!n&&r.parent&&(Object.keys(e).forEach(e=>{r.parent.get(e).valueChanges.subscribe(()=>{r.updateValueAndValidity({emitEvent:!1})})}),n=!0),Object.keys(e).every(t=>r.parent&&r.parent.get(t).value===e[t])?i.A.compose(t)(r):null)}static custom(e,t){return n=>{const i=t.call(this,n.value);return i?{[e]:i}:null}}static validateIf(e,t,n,r=[],s=[]){n=n.concat(r),e.setValidators(e=>t.call(this)?i.A.compose(n)(e):r.length>0?i.A.compose(r)(e):null),s.forEach(t=>{t.valueChanges.subscribe(()=>{e.updateValueAndValidity({emitEvent:!1})})})}static match(e,t){return n=>{const i=n.get(e),r=n.get(t);if(!i||!r)return null;if(i.value!==r.value)r.setErrors({match:!0});else if(r.hasError("match")){const e=r.errors;s.a.unset(e,"match"),r.setErrors(s.a.isEmpty(s.a.keys(e))?null:e)}return null}}static unique(e,t=null,n,i=!1){let r;return c=>c.pristine||p(c.value)?Object(o.a)(null):(r=c.value,s.a.isFunction(n)&&null!==n()&&""!==n()&&(r=i?`${c.value}$${n()}`:`${n()}$${c.value}`),Object(a.a)().pipe(l(e.call(t,r)),Object(u.a)(e=>e?{notUnique:!0}:null),Object(d.a)(1)))}static uuid(e=!1){const t=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return n=>n.pristine&&n.untouched?null:e||n.value?t.test(n.value)?null:{invalidUuid:"This is not a valid UUID"}:null}static binaryMin(e){return t=>{const n=new f.a,i=(new f.a).toBytes(t.value);if(e<=i)return null;const r=new h.a(n).transform(e);return{binaryMin:()=>"Size has to be at least " + r + " or more"}}}static binaryMax(e){return t=>{const n=new f.a,i=n.toBytes(t.value);if(e>=i)return null;const r=new h.a(n).transform(e);return{binaryMax:()=>"Size has to be at most " + r + " or less"}}}static passwordPolicy(e,t,n){return i=>{if(i.pristine||""===i.value)return s.a.isFunction(n)&&n(!0,0),Object(o.a)(null);let r;return s.a.isFunction(t)&&(r=t()),Object(a.a)(500).pipe(l(s.a.invoke(e,"validatePassword",i.value,r)),Object(u.a)(e=>(s.a.isFunction(n)&&n(e.valid,e.credits,e.valuation),e.valid?null:{passwordPolicy:!0})),Object(d.a)(1))}}static bucketName(){return e=>{if(e.pristine||!e.value)return Object(o.a)({required:!0});const t=[];let n;return t.push(()=>{const t=e.value;let i=!0;return(/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(t)||/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i.test(t))&&(n="ipAddress",i=!1),i}),t.push(t=>s.a.inRange(t.length,3,64)?!!/^[0-9a-z.-]+$/.test(e.value)||(n="bucketNameInvalid",!1):(n="shouldBeInRange",!1)),t.push(e=>{const t=s.a.split(e,".");return s.a.every(t,e=>e!==s.a.toLower(e)||e.includes("_")?(n="containsUpperCase",!1):/^[0-9a-z-]+$/.test(e)?s.a.every([0,e.length-1],t=>(n="lowerCaseOrNumber",/[a-z]/.test(e[t])||s.a.isInteger(s.a.parseInt(e[t])))):(n="onlyLowerCaseAndNumbers",!1))}),s.a.every(t,t=>t(e.value))?Object(o.a)(null):Object(o.a)((()=>{switch(n){case"onlyLowerCaseAndNumbers":return{onlyLowerCaseAndNumbers:!0};case"shouldBeInRange":return{shouldBeInRange:!0};case"ipAddress":return{ipAddress:!0};case"containsUpperCase":return{containsUpperCase:!0};case"lowerCaseOrNumber":return{lowerCaseOrNumber:!0};default:return{bucketNameInvalid:!0}}})())}}static bucketExistence(e,t){return n=>n.pristine||!n.value?Object(o.a)({required:!0}):t.exists(n.value).pipe(Object(u.a)(t=>t===e?null:{bucketNameNotAllowed:!0}))}}},"1Y/n":function(e,t,n){var i=n("2oRo"),r=n("We1y"),s=n("ewvW"),o=n("RK3t"),a=n("B/qT"),c=i.TypeError,l=function(e){return function(t,n,i,l){r(n);var u=s(t),d=o(u),h=a(u),f=e?h-1:0,p=e?-1:1;if(i<2)for(;;){if(f in d){l=d[f],f+=p;break}if(f+=p,e?f<0:h<=f)throw c("Reduce of empty array with no initial value")}for(;e?f>=0:h>f;f+=p)f in d&&(l=n(l,d[f],f,u));return l}};e.exports={left:l(!1),right:l(!0)}},"1nQr":function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("LvDl"),r=n.n(i),s=n("lJxs"),o=n("20UP");class a{constructor(e){this.pwdPolicyEnabled=e.pwd_policy_enabled,this.pwdPolicyMinLength=e.pwd_policy_min_length,this.pwdPolicyCheckLengthEnabled=e.pwd_policy_check_length_enabled,this.pwdPolicyCheckOldpwdEnabled=e.pwd_policy_check_oldpwd_enabled,this.pwdPolicyCheckUsernameEnabled=e.pwd_policy_check_username_enabled,this.pwdPolicyCheckExclusionListEnabled=e.pwd_policy_check_exclusion_list_enabled,this.pwdPolicyCheckRepetitiveCharsEnabled=e.pwd_policy_check_repetitive_chars_enabled,this.pwdPolicyCheckSequentialCharsEnabled=e.pwd_policy_check_sequential_chars_enabled,this.pwdPolicyCheckComplexityEnabled=e.pwd_policy_check_complexity_enabled}}var c=n("8Y7J");let l=(()=>{class e{constructor(e){this.settingsService=e}getHelpText(){return this.settingsService.getStandardSettings().pipe(Object(s.a)(e=>{const t=new a(e);let n=[];if(t.pwdPolicyEnabled){n.push("Required rules for passwords:");const e={pwdPolicyCheckLengthEnabled:"Must contain at least " + t.pwdPolicyMinLength + " characters",pwdPolicyCheckOldpwdEnabled:"Must not be the same as the previous one",pwdPolicyCheckUsernameEnabled:"Cannot contain the username",pwdPolicyCheckExclusionListEnabled:"Cannot contain any configured keyword",pwdPolicyCheckRepetitiveCharsEnabled:"Cannot contain any repetitive characters e.g. \"aaa\"",pwdPolicyCheckSequentialCharsEnabled:"Cannot contain any sequential characters e.g. \"abc\"",pwdPolicyCheckComplexityEnabled:"Must consist of characters from the following groups:\n  * Alphabetic a-z, A-Z\n  * Numbers 0-9\n  * Special chars: !\"#$%& '()*+,-./:;<=>?@[\\]^_`{{|}}~\n  * Any other characters (signs)"};n=n.concat(r.a.keys(e).filter(e=>r.a.get(t,e)).map(t=>"- "+r.a.get(e,t)))}return n.join("\n")}))}mapCreditsToCssClass(e){let t="very-strong";return e<10?t="too-weak":e<15?t="weak":e<20?t="ok":e<25&&(t="strong"),t}}return e.\u0275fac=function(t){return new(t||e)(c.ic(o.a))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"1ppg":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"1rYy":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580\u056b_\u0583\u0565\u057f\u0580\u057e\u0561\u0580\u056b_\u0574\u0561\u0580\u057f\u056b_\u0561\u057a\u0580\u056b\u056c\u056b_\u0574\u0561\u0575\u056b\u057d\u056b_\u0570\u0578\u0582\u0576\u056b\u057d\u056b_\u0570\u0578\u0582\u056c\u056b\u057d\u056b_\u0585\u0563\u0578\u057d\u057f\u0578\u057d\u056b_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580\u056b_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b".split("_"),standalone:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580_\u0583\u0565\u057f\u0580\u057e\u0561\u0580_\u0574\u0561\u0580\u057f_\u0561\u057a\u0580\u056b\u056c_\u0574\u0561\u0575\u056b\u057d_\u0570\u0578\u0582\u0576\u056b\u057d_\u0570\u0578\u0582\u056c\u056b\u057d_\u0585\u0563\u0578\u057d\u057f\u0578\u057d_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580".split("_")},monthsShort:"\u0570\u0576\u057e_\u0583\u057f\u0580_\u0574\u0580\u057f_\u0561\u057a\u0580_\u0574\u0575\u057d_\u0570\u0576\u057d_\u0570\u056c\u057d_\u0585\u0563\u057d_\u057d\u057a\u057f_\u0570\u056f\u057f_\u0576\u0574\u0562_\u0564\u056f\u057f".split("_"),weekdays:"\u056f\u056b\u0580\u0561\u056f\u056b_\u0565\u0580\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b_\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0570\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b_\u0578\u0582\u0580\u0562\u0561\u0569_\u0577\u0561\u0562\u0561\u0569".split("_"),weekdaysShort:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),weekdaysMin:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0569.",LLL:"D MMMM YYYY \u0569., HH:mm",LLLL:"dddd, D MMMM YYYY \u0569., HH:mm"},calendar:{sameDay:"[\u0561\u0575\u057d\u0585\u0580] LT",nextDay:"[\u057e\u0561\u0572\u0568] LT",lastDay:"[\u0565\u0580\u0565\u056f] LT",nextWeek:function(){return"dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},lastWeek:function(){return"[\u0561\u0576\u0581\u0561\u056e] dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},sameElse:"L"},relativeTime:{future:"%s \u0570\u0565\u057f\u0578",past:"%s \u0561\u057c\u0561\u057b",s:"\u0574\u056b \u0584\u0561\u0576\u056b \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",ss:"%d \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",m:"\u0580\u0578\u057a\u0565",mm:"%d \u0580\u0578\u057a\u0565",h:"\u056a\u0561\u0574",hh:"%d \u056a\u0561\u0574",d:"\u0585\u0580",dd:"%d \u0585\u0580",M:"\u0561\u0574\u056b\u057d",MM:"%d \u0561\u0574\u056b\u057d",y:"\u057f\u0561\u0580\u056b",yy:"%d \u057f\u0561\u0580\u056b"},meridiemParse:/\u0563\u056b\u0577\u0565\u0580\u057e\u0561|\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561|\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576/,isPM:function(e){return/^(\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576)$/.test(e)},meridiem:function(e){return e<4?"\u0563\u056b\u0577\u0565\u0580\u057e\u0561":e<12?"\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561":e<17?"\u0581\u0565\u0580\u0565\u056f\u057e\u0561":"\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(\u056b\u0576|\u0580\u0564)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-\u056b\u0576":e+"-\u0580\u0564";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},"1xZ4":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_mar\xe7_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de mar\xe7_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[dem\xe0 a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},"20UP":function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n("LvDl"),r=n.n(i),s=n("lJxs"),o=n("8Y7J"),a=n("IheW");let c=(()=>{class e{constructor(e){this.http=e,this.settings={}}getValues(e){return r.a.isArray(e)&&(e=e.join(",")),this.http.get(`api/settings?names=${e}`).pipe(Object(s.a)(e=>{const t={};return r.a.forEach(e,e=>{r.a.set(t,e.name,e.value)}),t}))}ifSettingConfigured(e,t,n){const i=this.settings[e];void 0===i?this.http.get(e).subscribe(i=>{this.settings[e]=this.getSettingsValue(i),this.ifSettingConfigured(e,t,n)},t=>{401!==t.status&&(this.settings[e]="")}):""!==i?t(i):n&&n()}disableSetting(e){this.settings[e]=""}getSettingsValue(e){return e.value||e.instance||""}validateGrafanaDashboardUrl(e){return this.http.get(`api/grafana/validation/${e}`)}getStandardSettings(){return this.http.get("ui-api/standard_settings")}}return e.\u0275fac=function(t){return new(t||e)(o.ic(a.b))},e.\u0275prov=o.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"23KU":function(e,t,n){"use strict";var i=n("uE2L"),r=n("YHEm"),s=Object.prototype.hasOwnProperty;t.a=function(e,t,n){var o=e[t];s.call(e,t)&&Object(r.a)(o,n)&&(void 0!==n||t in e)||Object(i.a)(e,t,n)}},"25cm":function(e,t,n){"use strict";var i=n("tPH9"),r=n("/1FC");t.a=function(e,t,n){var s=t(e);return Object(r.a)(e)?s:Object(i.a)(s,n(e))}},"2EZI":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("s7LF"),r=n("QFaf"),s=n("8Y7J");let o=(()=>{class e extends i.g{group(e,t=null){const n=super.group(e,t);return new r.a(n.controls,n.validator,n.asyncValidator)}}return e.\u0275fac=function(t){return a(t||e)},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const a=s.Zb(o)},"2QA8":function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())()},"2Vo4":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("XNiG"),r=n("9ppp");class s extends i.a{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new r.a;return this._value}next(e){super.next(this._value=e)}}},"2bX/":function(e,t,n){var i=n("2oRo"),r=n("0GbY"),s=n("Fib7"),o=n("OpvP"),a=n("/b8u"),c=i.Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return s(t)&&o(t.prototype,c(e))}},"2fFW":function(e,t,n){"use strict";n.d(t,"a",function(){return r});let i=!1;const r={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else i&&console.log("RxJS: Back to a better error behavior. Thank you. <3");i=e},get useDeprecatedSynchronousErrorHandling(){return i}}},"2fjn":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("wd/R"))},"2oRo":function(e,t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||function(){return this}()||Function("return this")()},"2ykv":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),i=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"3/ER":function(e,t,n){"use strict";(function(e){var i=n("Ju5/"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r?i.a.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,i=a?a(n):new e.constructor(n);return e.copy(i),i}}).call(this,n("3UD+")(e))},"33Wh":function(e,t,n){var i=n("yoRg"),r=n("eDl+");e.exports=Object.keys||function(e){return i(e,r)}},"3E0/":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("D0XW"),r=n("7o/Q"),s=n("WMd4");function o(e,t=i.a){var n;const r=(n=e)instanceof Date&&!isNaN(+n)?+e-t.now():Math.abs(e);return e=>e.lift(new a(r,t))}class a{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))}}class c extends r.a{constructor(e,t,n){super(e),this.delay=t,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,n=t.queue,i=e.scheduler,r=e.destination;for(;n.length>0&&n[0].time-i.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const t=Math.max(0,n[0].time-i.now());this.schedule(e,t)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(c.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,n=new l(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(s.a.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(s.a.createComplete()),this.unsubscribe()}}class l{constructor(e,t){this.time=e,this.notification=t}}},"3E1r":function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"},i=[/^\u091c\u0928/i,/^\u092b\u093c\u0930|\u092b\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924\u0902|\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935|\u0928\u0935\u0902/i,/^\u0926\u093f\u0938\u0902|\u0926\u093f\u0938/i];e.defineLocale("hi",{months:{format:"\u091c\u0928\u0935\u0930\u0940_\u092b\u093c\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u092e\u094d\u092c\u0930_\u0926\u093f\u0938\u092e\u094d\u092c\u0930".split("_"),standalone:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u0902\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u0902\u092c\u0930_\u0926\u093f\u0938\u0902\u092c\u0930".split("_")},monthsShort:"\u091c\u0928._\u092b\u093c\u0930._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948._\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0905\u0917._\u0938\u093f\u0924._\u0905\u0915\u094d\u091f\u0942._\u0928\u0935._\u0926\u093f\u0938.".split("_"),weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0932\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0932_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u092c\u091c\u0947",LTS:"A h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A h:mm \u092c\u091c\u0947"},monthsParse:i,longMonthsParse:i,shortMonthsParse:[/^\u091c\u0928/i,/^\u092b\u093c\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935/i,/^\u0926\u093f\u0938/i],monthsRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsShortRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsStrictRegex:/^(\u091c\u0928\u0935\u0930\u0940?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908?|\u0905\u0917\u0938\u094d\u0924?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924?\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930?)/i,monthsShortStrictRegex:/^(\u091c\u0928\.?|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\.?|\u0905\u0917\.?|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\.?|\u0926\u093f\u0938\.?)/i,calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0915\u0932] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u0932] LT",lastWeek:"[\u092a\u093f\u091b\u0932\u0947] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u092e\u0947\u0902",past:"%s \u092a\u0939\u0932\u0947",s:"\u0915\u0941\u091b \u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0902\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u091f",mm:"%d \u092e\u093f\u0928\u091f",h:"\u090f\u0915 \u0918\u0902\u091f\u093e",hh:"%d \u0918\u0902\u091f\u0947",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u0940\u0928\u0947",MM:"%d \u092e\u0939\u0940\u0928\u0947",y:"\u090f\u0915 \u0935\u0930\u094d\u0937",yy:"%d \u0935\u0930\u094d\u0937"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0930\u093e\u0924|\u0938\u0941\u092c\u0939|\u0926\u094b\u092a\u0939\u0930|\u0936\u093e\u092e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924"===t?e<4?e:e+12:"\u0938\u0941\u092c\u0939"===t?e:"\u0926\u094b\u092a\u0939\u0930"===t?e>=10?e:e+12:"\u0936\u093e\u092e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924":e<10?"\u0938\u0941\u092c\u0939":e<17?"\u0926\u094b\u092a\u0939\u0930":e<20?"\u0936\u093e\u092e":"\u0930\u093e\u0924"},week:{dow:0,doy:6}})}(n("wd/R"))},"3Eq5":function(e,t,n){var i=n("We1y");e.exports=function(e,t){var n=e[t];return null==n?void 0:i(n)}},"3N8a":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("quSY");class r extends i.a{constructor(e,t){super()}schedule(e,t=0){return this}}class s extends r{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,n=0){return setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n,i=!1;try{this.work(e)}catch(r){i=!0,n=!!r&&r||new Error(r)}if(i)return this.unsubscribe(),n}_unsubscribe(){const e=this.id,t=this.scheduler,n=t.actions,i=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&n.splice(i,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}},"3UD+":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"3bBZ":function(e,t,n){var i=n("2oRo"),r=n("/byt"),s=n("eFrH"),o=n("4mDm"),a=n("kRJp"),c=n("tiKp"),l=c("iterator"),u=c("toStringTag"),d=o.values,h=function(e,t){if(e){if(e[l]!==d)try{a(e,l,d)}catch(i){e[l]=d}if(e[u]||a(e,u,t),r[t])for(var n in o)if(e[n]!==o[n])try{a(e,n,o[n])}catch(i){e[n]=o[n]}}};for(var f in r)h(i[f]&&i[f].prototype,f);h(s,"DOMTokenList")},"3cmB":function(e,t,n){"use strict";var i=n("Y7yP"),r=n("Ju5/"),s=Object(i.a)(r.a,"Map");t.a=s},"4/q3":function(e,t,n){"use strict";var i=n("7gMY"),r=n("IzLi"),s=n("pyRK"),o=Object.prototype.hasOwnProperty,a=n("5WsY");t.a=function(e){return Object(a.a)(e)?Object(i.a)(e,!0):function(e){if(!Object(r.a)(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Object(s.a)(e),n=[];for(var i in e)("constructor"!=i||!t&&o.call(e,i))&&n.push(i);return n}(e)}},"4DD9":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){let t=!1;switch(e){case!0:case 1:case"y":case"yes":case"t":case"true":case"on":case"1":t=!0}return t}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"boolean",type:e,pure:!0}),e})()},"4I5i":function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>{function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e})()},"4MV3":function(e,t,n){!function(e){"use strict";var t={1:"\u0ae7",2:"\u0ae8",3:"\u0ae9",4:"\u0aea",5:"\u0aeb",6:"\u0aec",7:"\u0aed",8:"\u0aee",9:"\u0aef",0:"\u0ae6"},n={"\u0ae7":"1","\u0ae8":"2","\u0ae9":"3","\u0aea":"4","\u0aeb":"5","\u0aec":"6","\u0aed":"7","\u0aee":"8","\u0aef":"9","\u0ae6":"0"};e.defineLocale("gu",{months:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0_\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0_\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2_\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe\u0a88_\u0a91\u0a97\u0ab8\u0acd\u0a9f_\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0a91\u0a95\u0acd\u0a9f\u0acd\u0aac\u0ab0_\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0".split("_"),monthsShort:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1._\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1._\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf._\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe._\u0a91\u0a97._\u0ab8\u0aaa\u0acd\u0a9f\u0ac7._\u0a91\u0a95\u0acd\u0a9f\u0acd._\u0aa8\u0ab5\u0ac7._\u0aa1\u0abf\u0ab8\u0ac7.".split("_"),monthsParseExact:!0,weekdays:"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0_\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0_\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0_\u0aac\u0ac1\u0aa7\u0acd\u0ab5\u0abe\u0ab0_\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0_\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0_\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0".split("_"),weekdaysShort:"\u0ab0\u0ab5\u0abf_\u0ab8\u0acb\u0aae_\u0aae\u0a82\u0a97\u0ab3_\u0aac\u0ac1\u0aa7\u0acd_\u0a97\u0ac1\u0ab0\u0ac1_\u0ab6\u0ac1\u0a95\u0acd\u0ab0_\u0ab6\u0aa8\u0abf".split("_"),weekdaysMin:"\u0ab0_\u0ab8\u0acb_\u0aae\u0a82_\u0aac\u0ac1_\u0a97\u0ac1_\u0ab6\u0ac1_\u0ab6".split("_"),longDateFormat:{LT:"A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LTS:"A h:mm:ss \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LLLL:"dddd, D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7"},calendar:{sameDay:"[\u0a86\u0a9c] LT",nextDay:"[\u0a95\u0abe\u0ab2\u0ac7] LT",nextWeek:"dddd, LT",lastDay:"[\u0a97\u0a87\u0a95\u0abe\u0ab2\u0ac7] LT",lastWeek:"[\u0aaa\u0abe\u0a9b\u0ab2\u0abe] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0aae\u0abe",past:"%s \u0aaa\u0ab9\u0ac7\u0ab2\u0abe",s:"\u0a85\u0aae\u0ac1\u0a95 \u0aaa\u0ab3\u0acb",ss:"%d \u0ab8\u0ac7\u0a95\u0a82\u0aa1",m:"\u0a8f\u0a95 \u0aae\u0abf\u0aa8\u0abf\u0a9f",mm:"%d \u0aae\u0abf\u0aa8\u0abf\u0a9f",h:"\u0a8f\u0a95 \u0a95\u0ab2\u0abe\u0a95",hh:"%d \u0a95\u0ab2\u0abe\u0a95",d:"\u0a8f\u0a95 \u0aa6\u0abf\u0ab5\u0ab8",dd:"%d \u0aa6\u0abf\u0ab5\u0ab8",M:"\u0a8f\u0a95 \u0aae\u0ab9\u0abf\u0aa8\u0acb",MM:"%d \u0aae\u0ab9\u0abf\u0aa8\u0acb",y:"\u0a8f\u0a95 \u0ab5\u0ab0\u0acd\u0ab7",yy:"%d \u0ab5\u0ab0\u0acd\u0ab7"},preparse:function(e){return e.replace(/[\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef\u0ae6]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0ab0\u0abe\u0aa4|\u0aac\u0aaa\u0acb\u0ab0|\u0ab8\u0ab5\u0abe\u0ab0|\u0ab8\u0abe\u0a82\u0a9c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0ab0\u0abe\u0aa4"===t?e<4?e:e+12:"\u0ab8\u0ab5\u0abe\u0ab0"===t?e:"\u0aac\u0aaa\u0acb\u0ab0"===t?e>=10?e:e+12:"\u0ab8\u0abe\u0a82\u0a9c"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0ab0\u0abe\u0aa4":e<10?"\u0ab8\u0ab5\u0abe\u0ab0":e<17?"\u0aac\u0aaa\u0acb\u0ab0":e<20?"\u0ab8\u0abe\u0a82\u0a9c":"\u0ab0\u0abe\u0aa4"},week:{dow:0,doy:6}})}(n("wd/R"))},"4WOD":function(e,t,n){var i=n("2oRo"),r=n("Gi26"),s=n("Fib7"),o=n("ewvW"),a=n("93I0"),c=n("4Xet"),l=a("IE_PROTO"),u=i.Object,d=u.prototype;e.exports=c?u.getPrototypeOf:function(e){var t=o(e);if(r(t,l))return t[l];var n=t.constructor;return s(n)&&t instanceof n?n.prototype:t instanceof u?d:null}},"4Xet":function(e,t,n){var i=n("0Dky");e.exports=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},"4dOw":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"4l63":function(e,t,n){var i=n("I+eb"),r=n("wg0c");i({global:!0,forced:parseInt!=r},{parseInt:r})},"4mDm":function(e,t,n){"use strict";var i=n("/GqU"),r=n("RNIs"),s=n("P4y1"),o=n("afO8"),a=n("fdAy"),c="Array Iterator",l=o.set,u=o.getterFor(c);e.exports=a(Array,"Array",function(e,t){l(this,{type:c,target:i(e),index:0,kind:t})},function(){var e=u(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries")},"4syw":function(e,t,n){var i=n("busE");e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},"4zBA":function(e,t){var n=Function.prototype,i=n.bind,r=n.call,s=i&&i.bind(r);e.exports=i?function(e){return e&&s(r,e)}:function(e){return e&&function(){return r.apply(e,arguments)}}},"5+tZ":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("lJxs"),r=n("Cfvw"),s=n("zx2A");function o(e,t,n=Number.POSITIVE_INFINITY){return"function"==typeof t?s=>s.pipe(o((n,s)=>Object(r.a)(e(n,s)).pipe(Object(i.a)((e,i)=>t(n,e,s,i))),n)):("number"==typeof t&&(n=t),t=>t.lift(new a(e,n)))}class a{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new c(e,this.project,this.concurrent))}}class c extends s.b{constructor(e,t,n=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this.active++,this._innerSub(t)}_innerSub(e){const t=new s.a(this),n=this.destination;n.add(t);const i=Object(s.c)(e,t);i!==t&&n.add(i)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyComplete(){const e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}},"5WsY":function(e,t,n){"use strict";var i=n("vJtL"),r=n("Js68");t.a=function(e){return null!=e&&Object(r.a)(e.length)&&!Object(i.a)(e)}},"5yfJ":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("HDdC"),r=n("KqfI");const s=new i.a(r.a)},"6+QB":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},"6+kj":function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("8Y7J"),r=n("sne2"),s=n("JK/P"),o=n("sb0X"),a=n("SVse"),c=n("Z21x");function l(e,t){if(1&e){const e=i.Yb();i.Xb(0,"cd-submit-button",2),i.lc("submitAction",function(){return i.Ic(e),i.nc().submitAction()}),i.Rc(1),i.Wb()}if(2&e){const e=i.nc();i.uc("disabled",e.disabled)("form",e.form),i.Db(1),i.Sc(e.submitText)}}let u=(()=>{class e{constructor(e,t,n){this.location=e,this.actionLabels=t,this.modalService=n,this.submitActionEvent=new i.p,this.backActionEvent=new i.p,this.showSubmit=!0,this.wrappingClass="",this.btnClass="",this.submitText=this.actionLabels.CREATE,this.cancelText=this.actionLabels.CANCEL,this.disabled=!1}submitAction(){this.submitActionEvent.emit()}backAction(){0===this.backActionEvent.observers.length?this.modalService.hasOpenModals()?this.modalService.dismissAll():this.location.back():this.backActionEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(a.m),i.Rb(r.b),i.Rb(s.a))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-form-button-panel"]],viewQuery:function(e,t){if(1&e&&i.Wc(o.a,1),2&e){let e;i.Ec(e=i.mc())&&(t.submitButton=e.first)}},inputs:{form:"form",showSubmit:"showSubmit",wrappingClass:"wrappingClass",btnClass:"btnClass",submitText:"submitText",cancelText:"cancelText",disabled:"disabled"},outputs:{submitActionEvent:"submitActionEvent",backActionEvent:"backActionEvent"},decls:3,vars:4,consts:[[1,"m-2",3,"name","backAction"],["data-cy","submitBtn",3,"disabled","form","submitAction",4,"ngIf"],["data-cy","submitBtn",3,"disabled","form","submitAction"]],template:function(e,t){1&e&&(i.Xb(0,"div"),i.Xb(1,"cd-back-button",0),i.lc("backAction",function(){return t.backAction()}),i.Wb(),i.Pc(2,l,2,3,"cd-submit-button",1),i.Wb()),2&e&&(i.Fb(t.wrappingClass),i.Db(1),i.uc("name",t.cancelText),i.Db(1),i.uc("ngIf",t.showSubmit))},directives:[c.a,a.r,o.a],styles:[""]}),e})()},"6B0Y":function(e,t,n){!function(e){"use strict";var t={1:"\u17e1",2:"\u17e2",3:"\u17e3",4:"\u17e4",5:"\u17e5",6:"\u17e6",7:"\u17e7",8:"\u17e8",9:"\u17e9",0:"\u17e0"},n={"\u17e1":"1","\u17e2":"2","\u17e3":"3","\u17e4":"4","\u17e5":"5","\u17e6":"6","\u17e7":"7","\u17e8":"8","\u17e9":"9","\u17e0":"0"};e.defineLocale("km",{months:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),monthsShort:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),weekdays:"\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799_\u1785\u17d0\u1793\u17d2\u1791_\u17a2\u1784\u17d2\u1782\u17b6\u179a_\u1796\u17bb\u1792_\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd_\u179f\u17bb\u1780\u17d2\u179a_\u179f\u17c5\u179a\u17cd".split("_"),weekdaysShort:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysMin:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u1796\u17d2\u179a\u17b9\u1780|\u179b\u17d2\u1784\u17b6\u1785/,isPM:function(e){return"\u179b\u17d2\u1784\u17b6\u1785"===e},meridiem:function(e,t,n){return e<12?"\u1796\u17d2\u179a\u17b9\u1780":"\u179b\u17d2\u1784\u17b6\u1785"},calendar:{sameDay:"[\u1790\u17d2\u1784\u17c3\u1793\u17c1\u17c7 \u1798\u17c9\u17c4\u1784] LT",nextDay:"[\u179f\u17d2\u17a2\u17c2\u1780 \u1798\u17c9\u17c4\u1784] LT",nextWeek:"dddd [\u1798\u17c9\u17c4\u1784] LT",lastDay:"[\u1798\u17d2\u179f\u17b7\u179b\u1798\u17b7\u1789 \u1798\u17c9\u17c4\u1784] LT",lastWeek:"dddd [\u179f\u1794\u17d2\u178f\u17b6\u17a0\u17cd\u1798\u17bb\u1793] [\u1798\u17c9\u17c4\u1784] LT",sameElse:"L"},relativeTime:{future:"%s\u1791\u17c0\u178f",past:"%s\u1798\u17bb\u1793",s:"\u1794\u17c9\u17bb\u1793\u17d2\u1798\u17b6\u1793\u179c\u17b7\u1793\u17b6\u1791\u17b8",ss:"%d \u179c\u17b7\u1793\u17b6\u1791\u17b8",m:"\u1798\u17bd\u1799\u1793\u17b6\u1791\u17b8",mm:"%d \u1793\u17b6\u1791\u17b8",h:"\u1798\u17bd\u1799\u1798\u17c9\u17c4\u1784",hh:"%d \u1798\u17c9\u17c4\u1784",d:"\u1798\u17bd\u1799\u1790\u17d2\u1784\u17c3",dd:"%d \u1790\u17d2\u1784\u17c3",M:"\u1798\u17bd\u1799\u1781\u17c2",MM:"%d \u1781\u17c2",y:"\u1798\u17bd\u1799\u1786\u17d2\u1793\u17b6\u17c6",yy:"%d \u1786\u17d2\u1793\u17b6\u17c6"},dayOfMonthOrdinalParse:/\u1791\u17b8\d{1,2}/,ordinal:"\u1791\u17b8%d",preparse:function(e){return e.replace(/[\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9\u17e0]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})}(n("wd/R"))},"6HA4":function(e,t,n){"use strict";n.d(t,"a",function(){return p});var i=n("mrSG"),r=n("IheW"),s=n("LvDl"),o=n.n(s),a=n("LRne"),c=n("CqXF"),l=n("JIr8"),u=n("zNnC"),d=n("9xzX"),h=n("xTzq"),f=n("8Y7J");let p=(()=>{let e=class extends u.a{constructor(e,t){super(),this.http=e,this.rgwDaemonService=t,this.url="api/rgw/bucket"}list(e=!1,t=""){return this.rgwDaemonService.request(n=>(n=n.append("stats",e.toString()),t&&(n=n.append("uid",t)),this.http.get(this.url,{headers:{Accept:this.getVersionHeaderValue(1,1)},params:n})))}get(e){return this.rgwDaemonService.request(t=>this.http.get(`${this.url}/${e}`,{params:t}))}create(e,t,n,i,s,o,a){return this.rgwDaemonService.request(c=>this.http.post(this.url,null,{params:new r.e({fromObject:{bucket:e,uid:t,zonegroup:n,placement_target:i,lock_enabled:String(s),lock_mode:o,lock_retention_period_days:a,daemon_name:c.get("daemon_name")}})}))}update(e,t,n,i,r,s,o,a,c){return this.rgwDaemonService.request(l=>(l=(l=(l=(l=(l=(l=(l=(l=l.append("bucket_id",t)).append("uid",n)).append("versioning_state",i)).append("mfa_delete",r)).append("mfa_token_serial",s)).append("mfa_token_pin",o)).append("lock_mode",a)).append("lock_retention_period_days",c),this.http.put(`${this.url}/${e}`,null,{params:l})))}delete(e,t=!0){return this.rgwDaemonService.request(n=>(n=n.append("purge_objects",t?"true":"false"),this.http.delete(`${this.url}/${e}`,{params:n})))}exists(e){return this.get(e).pipe(Object(c.a)(!0),Object(l.a)(e=>(o.a.isFunction(e.preventDefault)&&e.preventDefault(),Object(a.a)(!1))))}getLockDays(e){return e.lock_retention_period_years>0?Math.floor(365.242*e.lock_retention_period_years):e.lock_retention_period_days||0}};return e.\u0275fac=function(t){return new(t||e)(f.ic(r.b),f.ic(d.a))},e.\u0275prov=f.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([h.a,Object(i.d)("design:paramtypes",[r.b,d.a])],e),e})()},"6JNq":function(e,t,n){var i=n("Gi26"),r=n("Vu81"),s=n("Bs8V"),o=n("m/L8");e.exports=function(e,t){for(var n=r(t),a=o.f,c=s.f,l=0;l<n.length;l++){var u=n[l];i(e,u)||a(e,u,c(t,u))}}},"6LWA":function(e,t,n){var i=n("xrYK");e.exports=Array.isArray||function(e){return"Array"==i(e)}},"6VoE":function(e,t,n){var i=n("tiKp"),r=n("P4y1"),s=i("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[s]===e)}},"6qls":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("tz6c"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.docService=e,this.docText="documentation"}ngOnInit(){this.noSubscribe?this.docUrl=this.docService.urlGenerator(this.section):this.docService.subscribeOnce(this.section,e=>{this.docUrl=e})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(i.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-doc"]],inputs:{section:"section",docText:"docText",noSubscribe:"noSubscribe"},decls:2,vars:2,consts:[["target","_blank",3,"href"]],template:function(e,t){1&e&&(r.Xb(0,"a",0),r.Rc(1),r.Wb()),2&e&&(r.vc("href",t.docUrl,r.Lc),r.Db(1),r.Sc(t.docText))},styles:[""]}),e})()},"7BjC":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["m\xf5ne sekundi","m\xf5ni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["\xfche minuti","\xfcks minut"],mm:[e+" minuti",e+" minutit"],h:["\xfche tunni","tund aega","\xfcks tund"],hh:[e+" tunni",e+" tundi"],d:["\xfche p\xe4eva","\xfcks p\xe4ev"],M:["kuu aja","kuu aega","\xfcks kuu"],MM:[e+" kuu",e+" kuud"],y:["\xfche aasta","aasta","\xfcks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:i?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_m\xe4rts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_m\xe4rts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"p\xfchap\xe4ev_esmasp\xe4ev_teisip\xe4ev_kolmap\xe4ev_neljap\xe4ev_reede_laup\xe4ev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[T\xe4na,] LT",nextDay:"[Homme,] LT",nextWeek:"[J\xe4rgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s p\xe4rast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d p\xe4eva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"7C5Q":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("wd/R"))},"7aV9":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"\u0da2\u0db1\u0dc0\u0dcf\u0dbb\u0dd2_\u0db4\u0dd9\u0db6\u0dbb\u0dc0\u0dcf\u0dbb\u0dd2_\u0db8\u0dcf\u0dbb\u0dca\u0dad\u0dd4_\u0d85\u0db4\u0dca\u200d\u0dbb\u0dda\u0dbd\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd\u0dc3\u0dca\u0dad\u0dd4_\u0dc3\u0dd0\u0db4\u0dca\u0dad\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0d94\u0d9a\u0dca\u0dad\u0ddd\u0db6\u0dbb\u0dca_\u0db1\u0ddc\u0dc0\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0daf\u0dd9\u0dc3\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca".split("_"),monthsShort:"\u0da2\u0db1_\u0db4\u0dd9\u0db6_\u0db8\u0dcf\u0dbb\u0dca_\u0d85\u0db4\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd_\u0dc3\u0dd0\u0db4\u0dca_\u0d94\u0d9a\u0dca_\u0db1\u0ddc\u0dc0\u0dd0_\u0daf\u0dd9\u0dc3\u0dd0".split("_"),weekdays:"\u0d89\u0dbb\u0dd2\u0daf\u0dcf_\u0dc3\u0db3\u0dd4\u0daf\u0dcf_\u0d85\u0d9f\u0dc4\u0dbb\u0dd4\u0dc0\u0dcf\u0daf\u0dcf_\u0db6\u0daf\u0dcf\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca\u0db4\u0dad\u0dd2\u0db1\u0dca\u0daf\u0dcf_\u0dc3\u0dd2\u0d9a\u0dd4\u0dbb\u0dcf\u0daf\u0dcf_\u0dc3\u0dd9\u0db1\u0dc3\u0dd4\u0dbb\u0dcf\u0daf\u0dcf".split("_"),weekdaysShort:"\u0d89\u0dbb\u0dd2_\u0dc3\u0db3\u0dd4_\u0d85\u0d9f_\u0db6\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4_\u0dc3\u0dd2\u0d9a\u0dd4_\u0dc3\u0dd9\u0db1".split("_"),weekdaysMin:"\u0d89_\u0dc3_\u0d85_\u0db6_\u0db6\u0dca\u200d\u0dbb_\u0dc3\u0dd2_\u0dc3\u0dd9".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [\u0dc0\u0dd0\u0db1\u0dd2] dddd, a h:mm:ss"},calendar:{sameDay:"[\u0d85\u0daf] LT[\u0da7]",nextDay:"[\u0dc4\u0dd9\u0da7] LT[\u0da7]",nextWeek:"dddd LT[\u0da7]",lastDay:"[\u0d8a\u0dba\u0dda] LT[\u0da7]",lastWeek:"[\u0db4\u0dc3\u0dd4\u0d9c\u0dd2\u0dba] dddd LT[\u0da7]",sameElse:"L"},relativeTime:{future:"%s\u0d9a\u0dd2\u0db1\u0dca",past:"%s\u0d9a\u0da7 \u0db4\u0dd9\u0dbb",s:"\u0dad\u0dad\u0dca\u0db4\u0dbb \u0d9a\u0dd2\u0dc4\u0dd2\u0db4\u0dba",ss:"\u0dad\u0dad\u0dca\u0db4\u0dbb %d",m:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4\u0dc0",mm:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4 %d",h:"\u0db4\u0dd0\u0dba",hh:"\u0db4\u0dd0\u0dba %d",d:"\u0daf\u0dd2\u0db1\u0dba",dd:"\u0daf\u0dd2\u0db1 %d",M:"\u0db8\u0dcf\u0dc3\u0dba",MM:"\u0db8\u0dcf\u0dc3 %d",y:"\u0dc0\u0dc3\u0dbb",yy:"\u0dc0\u0dc3\u0dbb %d"},dayOfMonthOrdinalParse:/\d{1,2} \u0dc0\u0dd0\u0db1\u0dd2/,ordinal:function(e){return e+" \u0dc0\u0dd0\u0db1\u0dd2"},meridiemParse:/\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4|\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4|\u0db4\u0dd9.\u0dc0|\u0db4.\u0dc0./,isPM:function(e){return"\u0db4.\u0dc0."===e||"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4"===e},meridiem:function(e,t,n){return e>11?n?"\u0db4.\u0dc0.":"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4":n?"\u0db4\u0dd9.\u0dc0.":"\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4"}})}(n("wd/R"))},"7gMY":function(e,t,n){"use strict";var i=n("9f76"),r=n("/1FC"),s=n("WOAq"),o=n("cSlR"),a=n("oYcn"),c=Object.prototype.hasOwnProperty;t.a=function(e,t){var n=Object(r.a)(e),l=!n&&Object(i.a)(e),u=!n&&!l&&Object(s.a)(e),d=!n&&!l&&!u&&Object(a.a)(e),h=n||l||u||d,f=h?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],p=f.length;for(var m in e)!t&&!c.call(e,m)||h&&("length"==m||u&&("offset"==m||"parent"==m)||d&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||Object(o.a)(m,p))||f.push(m);return f}},"7o/Q":function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("n6bG"),r=n("gRHU"),s=n("quSY"),o=n("2QA8"),a=n("2fFW"),c=n("NJ4a");class l extends s.a{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=r.a;break;case 1:if(!e){this.destination=r.a;break}if("object"==typeof e){e instanceof l?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new u(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new u(this,e,t,n)}}[o.a](){return this}static create(e,t,n){const i=new l(e,t,n);return i.syncErrorThrowable=!1,i}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class u extends l{constructor(e,t,n,s){let o;super(),this._parentSubscriber=e;let a=this;Object(i.a)(t)?o=t:t&&(o=t.next,n=t.error,s=t.complete,t!==r.a&&(a=Object.create(t),Object(i.a)(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this))),this._context=a,this._next=o,this._error=n,this._complete=s}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;a.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=a.a;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(c.a)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(c.a)(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),a.a.useDeprecatedSynchronousErrorHandling)throw n;Object(c.a)(n)}}__tryOrSetError(e,t,n){if(!a.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(i){return a.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=i,e.syncErrorThrown=!0,!0):(Object(c.a)(i),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}},"8/+R":function(e,t,n){!function(e){"use strict";var t={1:"\u0a67",2:"\u0a68",3:"\u0a69",4:"\u0a6a",5:"\u0a6b",6:"\u0a6c",7:"\u0a6d",8:"\u0a6e",9:"\u0a6f",0:"\u0a66"},n={"\u0a67":"1","\u0a68":"2","\u0a69":"3","\u0a6a":"4","\u0a6b":"5","\u0a6c":"6","\u0a6d":"7","\u0a6e":"8","\u0a6f":"9","\u0a66":"0"};e.defineLocale("pa-in",{months:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),monthsShort:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),weekdays:"\u0a10\u0a24\u0a35\u0a3e\u0a30_\u0a38\u0a4b\u0a2e\u0a35\u0a3e\u0a30_\u0a2e\u0a70\u0a17\u0a32\u0a35\u0a3e\u0a30_\u0a2c\u0a41\u0a27\u0a35\u0a3e\u0a30_\u0a35\u0a40\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a28\u0a40\u0a1a\u0a30\u0a35\u0a3e\u0a30".split("_"),weekdaysShort:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),weekdaysMin:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),longDateFormat:{LT:"A h:mm \u0a35\u0a1c\u0a47",LTS:"A h:mm:ss \u0a35\u0a1c\u0a47",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47",LLLL:"dddd, D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47"},calendar:{sameDay:"[\u0a05\u0a1c] LT",nextDay:"[\u0a15\u0a32] LT",nextWeek:"[\u0a05\u0a17\u0a32\u0a3e] dddd, LT",lastDay:"[\u0a15\u0a32] LT",lastWeek:"[\u0a2a\u0a3f\u0a1b\u0a32\u0a47] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0a35\u0a3f\u0a71\u0a1a",past:"%s \u0a2a\u0a3f\u0a1b\u0a32\u0a47",s:"\u0a15\u0a41\u0a1d \u0a38\u0a15\u0a3f\u0a70\u0a1f",ss:"%d \u0a38\u0a15\u0a3f\u0a70\u0a1f",m:"\u0a07\u0a15 \u0a2e\u0a3f\u0a70\u0a1f",mm:"%d \u0a2e\u0a3f\u0a70\u0a1f",h:"\u0a07\u0a71\u0a15 \u0a18\u0a70\u0a1f\u0a3e",hh:"%d \u0a18\u0a70\u0a1f\u0a47",d:"\u0a07\u0a71\u0a15 \u0a26\u0a3f\u0a28",dd:"%d \u0a26\u0a3f\u0a28",M:"\u0a07\u0a71\u0a15 \u0a2e\u0a39\u0a40\u0a28\u0a3e",MM:"%d \u0a2e\u0a39\u0a40\u0a28\u0a47",y:"\u0a07\u0a71\u0a15 \u0a38\u0a3e\u0a32",yy:"%d \u0a38\u0a3e\u0a32"},preparse:function(e){return e.replace(/[\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f\u0a66]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0a30\u0a3e\u0a24|\u0a38\u0a35\u0a47\u0a30|\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30|\u0a38\u0a3c\u0a3e\u0a2e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0a30\u0a3e\u0a24"===t?e<4?e:e+12:"\u0a38\u0a35\u0a47\u0a30"===t?e:"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30"===t?e>=10?e:e+12:"\u0a38\u0a3c\u0a3e\u0a2e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0a30\u0a3e\u0a24":e<10?"\u0a38\u0a35\u0a47\u0a30":e<17?"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30":e<20?"\u0a38\u0a3c\u0a3e\u0a2e":"\u0a30\u0a3e\u0a24"},week:{dow:0,doy:6}})}(n("wd/R"))},"82ph":function(e,t,n){var i=n("4zBA");e.exports=i([].slice)},"85J/":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=/ceph version\s+([^ ]+)\s+\(.+\)/.exec(e);return t?t[1]:e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"cephShortVersion",type:e,pure:!0}),e})()},"8M4i":function(e,t,n){"use strict";var i=n("ylTp"),r=Object.prototype,s=r.hasOwnProperty,o=r.toString,a=i.a?i.a.toStringTag:void 0,c=Object.prototype.toString,l=i.a?i.a.toStringTag:void 0;t.a=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var i=!0}catch(c){}var r=o.call(e);return i&&(t?e[a]=n:delete e[a]),r}(e):function(e){return c.call(e)}(e)}},"8Y7J":function(e,t,n){"use strict";n.d(t,"a",function(){return dn}),n.d(t,"b",function(){return $u}),n.d(t,"c",function(){return Wu}),n.d(t,"d",function(){return Pu}),n.d(t,"e",function(){return Fu}),n.d(t,"f",function(){return Pd}),n.d(t,"g",function(){return kd}),n.d(t,"h",function(){return ln}),n.d(t,"i",function(){return Sl}),n.d(t,"j",function(){return Zu}),n.d(t,"k",function(){return Uc}),n.d(t,"l",function(){return Xc}),n.d(t,"m",function(){return Vu}),n.d(t,"n",function(){return Kc}),n.d(t,"o",function(){return Ri}),n.d(t,"p",function(){return pu}),n.d(t,"q",function(){return Rn}),n.d(t,"r",function(){return Fs}),n.d(t,"s",function(){return En}),n.d(t,"t",function(){return L}),n.d(t,"u",function(){return un}),n.d(t,"v",function(){return Qs}),n.d(t,"w",function(){return bl}),n.d(t,"x",function(){return _l}),n.d(t,"y",function(){return Xu}),n.d(t,"z",function(){return Rl}),n.d(t,"A",function(){return Md}),n.d(t,"B",function(){return Il}),n.d(t,"C",function(){return yd}),n.d(t,"D",function(){return nd}),n.d(t,"E",function(){return An}),n.d(t,"F",function(){return zu}),n.d(t,"G",function(){return Nu}),n.d(t,"H",function(){return el}),n.d(t,"I",function(){return Zc}),n.d(t,"J",function(){return $i}),n.d(t,"K",function(){return nl}),n.d(t,"L",function(){return Ti}),n.d(t,"M",function(){return In}),n.d(t,"N",function(){return Ld}),n.d(t,"O",function(){return Ol}),n.d(t,"P",function(){return ld}),n.d(t,"Q",function(){return hn}),n.d(t,"R",function(){return il}),n.d(t,"S",function(){return Fl}),n.d(t,"T",function(){return F}),n.d(t,"U",function(){return wd}),n.d(t,"V",function(){return _d}),n.d(t,"W",function(){return f}),n.d(t,"X",function(){return gd}),n.d(t,"Y",function(){return Id}),n.d(t,"Z",function(){return hd}),n.d(t,"ab",function(){return Hu}),n.d(t,"bb",function(){return js}),n.d(t,"cb",function(){return Oa}),n.d(t,"db",function(){return b}),n.d(t,"eb",function(){return xi}),n.d(t,"fb",function(){return oi}),n.d(t,"gb",function(){return qn}),n.d(t,"hb",function(){return Jn}),n.d(t,"ib",function(){return ei}),n.d(t,"jb",function(){return Qn}),n.d(t,"kb",function(){return Kn}),n.d(t,"lb",function(){return Zn}),n.d(t,"mb",function(){return ka}),n.d(t,"nb",function(){return Ad}),n.d(t,"ob",function(){return Ta}),n.d(t,"pb",function(){return Ma}),n.d(t,"qb",function(){return Gn}),n.d(t,"rb",function(){return z}),n.d(t,"sb",function(){return co}),n.d(t,"tb",function(){return Ro}),n.d(t,"ub",function(){return Ao}),n.d(t,"vb",function(){return Io}),n.d(t,"wb",function(){return xa}),n.d(t,"xb",function(){return Te}),n.d(t,"yb",function(){return u}),n.d(t,"zb",function(){return Un}),n.d(t,"Ab",function(){return eo}),n.d(t,"Bb",function(){return ye}),n.d(t,"Cb",function(){return Hc}),n.d(t,"Db",function(){return jr}),n.d(t,"Eb",function(){return go}),n.d(t,"Fb",function(){return Zo}),n.d(t,"Gb",function(){return ba}),n.d(t,"Hb",function(){return ga}),n.d(t,"Ib",function(){return _a}),n.d(t,"Jb",function(){return Qo}),n.d(t,"Kb",function(){return Cu}),n.d(t,"Lb",function(){return Z}),n.d(t,"Mb",function(){return oe}),n.d(t,"Nb",function(){return w}),n.d(t,"Ob",function(){return D}),n.d(t,"Pb",function(){return ie}),n.d(t,"Qb",function(){return ae}),n.d(t,"Rb",function(){return Do}),n.d(t,"Sb",function(){return Mo}),n.d(t,"Tb",function(){return Lo}),n.d(t,"Ub",function(){return Oo}),n.d(t,"Vb",function(){return Co}),n.d(t,"Wb",function(){return To}),n.d(t,"Xb",function(){return ko}),n.d(t,"Yb",function(){return Eo}),n.d(t,"Zb",function(){return rn}),n.d(t,"ac",function(){return va}),n.d(t,"bc",function(){return Ec}),n.d(t,"cc",function(){return Rc}),n.d(t,"dc",function(){return Ac}),n.d(t,"ec",function(){return Lc}),n.d(t,"fc",function(){return Ic}),n.d(t,"gc",function(){return Pc}),n.d(t,"hc",function(){return Oc}),n.d(t,"ic",function(){return Cn}),n.d(t,"jc",function(){return on}),n.d(t,"kc",function(){return Ru}),n.d(t,"lc",function(){return Po}),n.d(t,"mc",function(){return Ou}),n.d(t,"nc",function(){return jo}),n.d(t,"oc",function(){return au}),n.d(t,"pc",function(){return cu}),n.d(t,"qc",function(){return lu}),n.d(t,"rc",function(){return uu}),n.d(t,"sc",function(){return zo}),n.d(t,"tc",function(){return No}),n.d(t,"uc",function(){return So}),n.d(t,"vc",function(){return $o}),n.d(t,"wc",function(){return Ho}),n.d(t,"xc",function(){return Xo}),n.d(t,"yc",function(){return Kl}),n.d(t,"zc",function(){return Ql}),n.d(t,"Ac",function(){return Zl}),n.d(t,"Bc",function(){return eu}),n.d(t,"Cc",function(){return tu}),n.d(t,"Dc",function(){return nu}),n.d(t,"Ec",function(){return Tu}),n.d(t,"Fc",function(){return wo}),n.d(t,"Gc",function(){return Ni}),n.d(t,"Hc",function(){return Yi}),n.d(t,"Ic",function(){return Be}),n.d(t,"Jc",function(){return Mi}),n.d(t,"Kc",function(){return Oi}),n.d(t,"Lc",function(){return Ci}),n.d(t,"Mc",function(){return re}),n.d(t,"Nc",function(){return Ko}),n.d(t,"Oc",function(){return ya}),n.d(t,"Pc",function(){return yo}),n.d(t,"Qc",function(){return Iu}),n.d(t,"Rc",function(){return da}),n.d(t,"Sc",function(){return ha}),n.d(t,"Tc",function(){return fa}),n.d(t,"Uc",function(){return pa}),n.d(t,"Vc",function(){return ma}),n.d(t,"Wc",function(){return Mu});var i=n("XNiG"),r=n("quSY"),s=n("HDdC"),o=n("VRyK"),a=n("w1tV");function c(e){for(let t in e)if(e[t]===c)return t;throw Error("Could not find renamed property on target object.")}function l(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function u(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(u).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function d(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const h=c({__forward_ref__:c});function f(e){return e.__forward_ref__=f,e.toString=function(){return u(this())},e}function p(e){return m(e)?e():e}function m(e){return"function"==typeof e&&e.hasOwnProperty(h)&&e.__forward_ref__===f}class b extends Error{constructor(e,t){super(function(e,t){return`${e?`NG0${e}: `:""}${t}`}(e,t)),this.code=e}}function g(e){return"string"==typeof e?e:null==e?"":String(e)}function _(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():g(e)}function v(e,t){const n=t?` in ${t}`:"";throw new b("201",`No provider for ${_(e)} found${n}`)}function y(e,t,n,i){throw new Error(`ASSERTION ERROR: ${e}`+(null==i?"":` [Expected=> ${n} ${i} ${t} <=Actual]`))}function w(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function D(e){return{providers:e.providers||[],imports:e.imports||[]}}function S(e){return x(e,T)||x(e,C)}function x(e,t){return e.hasOwnProperty(t)?e[t]:null}function k(e){return e&&(e.hasOwnProperty(M)||e.hasOwnProperty(O))?e[M]:null}const T=c({"\u0275prov":c}),M=c({"\u0275inj":c}),C=c({ngInjectableDef:c}),O=c({ngInjectorDef:c});var L=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});let E;function A(e){const t=E;return E=e,t}function I(e,t,n){const i=S(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:n&L.Optional?null:void 0!==t?t:void v(u(e),"Injector")}function R(e){return{toString:e}.toString()}var P=function(e){return e[e.OnPush=0]="OnPush",e[e.Default=1]="Default",e}({}),F=function(e){return e[e.Emulated=0]="Emulated",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({});const W="undefined"!=typeof globalThis&&globalThis,j="undefined"!=typeof window&&window,Y="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,N="undefined"!=typeof global&&global,z=W||N||j||Y,$={},H=[],X=[],V=c({"\u0275cmp":c}),B=c({"\u0275dir":c}),U=c({"\u0275pipe":c}),q=c({"\u0275mod":c}),G=c({"\u0275loc":c}),J=c({"\u0275fac":c}),K=c({__NG_ELEMENT_ID__:c});let Q=0;function Z(e){return R(()=>{const t={},n={type:e.type,providersResolver:null,decls:e.decls,vars:e.vars,factory:null,template:e.template||null,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:e.exportAs||null,onPush:e.changeDetection===P.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors||X,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||F.Emulated,id:"c",styles:e.styles||X,_:null,setInput:null,schemas:e.schemas||null,tView:null},i=e.directives,r=e.features,s=e.pipes;return n.id+=Q++,n.inputs=se(e.inputs,t),n.outputs=se(e.outputs),r&&r.forEach(e=>e(n)),n.directiveDefs=i?()=>("function"==typeof i?i():i).map(ee):null,n.pipeDefs=s?()=>("function"==typeof s?s():s).map(te):null,n})}function ee(e){return ce(e)||function(e){return e[B]||null}(e)}function te(e){return function(e){return e[U]||null}(e)}const ne={};function ie(e){const t={type:e.type,bootstrap:e.bootstrap||X,declarations:e.declarations||X,imports:e.imports||X,exports:e.exports||X,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null};return null!=e.id&&R(()=>{ne[e.id]=e.type}),t}function re(e,t){return R(()=>{const n=le(e,!0);n.declarations=t.declarations||X,n.imports=t.imports||X,n.exports=t.exports||X})}function se(e,t){if(null==e)return $;const n={};for(const i in e)if(e.hasOwnProperty(i)){let r=e[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),n[r]=i,t&&(t[r]=s)}return n}const oe=Z;function ae(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function ce(e){return e[V]||null}function le(e,t){const n=e[q]||null;if(!n&&!0===t)throw new Error(`Type ${u(e)} does not have '\u0275mod' property.`);return n}const ue=20,de=10;function he(e){return Array.isArray(e)&&"object"==typeof e[1]}function fe(e){return Array.isArray(e)&&!0===e[1]}function pe(e){return 0!=(8&e.flags)}function me(e){return 2==(2&e.flags)}function be(e){return 1==(1&e.flags)}function ge(e){return null!==e.template}function _e(e,t){return e.hasOwnProperty(J)?e[J]:null}class ve{constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}}function ye(){return we}function we(e){return e.type.prototype.ngOnChanges&&(e.setInput=Se),De}function De(){const e=xe(this),t=null==e?void 0:e.current;if(t){const n=e.previous;if(n===$)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}}function Se(e,t,n,i){const r=xe(e)||function(e,t){return e.__ngSimpleChanges__=t}(e,{previous:$,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[n],c=o[a];s[a]=new ve(c&&c.currentValue,t,o===$),e[i]=t}function xe(e){return e.__ngSimpleChanges__||null}let ke;function Te(e){ke=e}function Me(){return void 0!==ke?ke:"undefined"!=typeof document?document:void 0}function Ce(e){return!!e.listen}ye.ngInherit=!0;const Oe={createRenderer:(e,t)=>Me()};function Le(e){for(;Array.isArray(e);)e=e[0];return e}function Ee(e,t){return Le(t[e])}function Ae(e,t){return Le(t[e.index])}function Ie(e,t){return e.data[t]}function Re(e,t){return e[t]}function Pe(e,t){const n=t[e];return he(n)?n:n[0]}function Fe(e){const t=function(e){return e.__ngContext__||null}(e);return t?Array.isArray(t)?t:t.lView:null}function We(e){return 4==(4&e[2])}function je(e){return 128==(128&e[2])}function Ye(e,t){return null==t?null:e[t]}function Ne(e){e[18]=0}function ze(e,t){e[5]+=t;let n=e,i=e[3];for(;null!==i&&(1===t&&1===n[5]||-1===t&&0===n[5]);)i[5]+=t,n=i,i=i[3]}const $e={lFrame:mt(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function He(){return $e.bindingsEnabled}function Xe(){return $e.lFrame.lView}function Ve(){return $e.lFrame.tView}function Be(e){$e.lFrame.contextLView=e}function Ue(){let e=qe();for(;null!==e&&64===e.type;)e=e.parent;return e}function qe(){return $e.lFrame.currentTNode}function Ge(){const e=$e.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Je(e,t){const n=$e.lFrame;n.currentTNode=e,n.isParent=t}function Ke(){return $e.lFrame.isParent}function Qe(){$e.lFrame.isParent=!1}function Ze(){return $e.isInCheckNoChangesMode}function et(e){$e.isInCheckNoChangesMode=e}function tt(){const e=$e.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function nt(){return $e.lFrame.bindingIndex}function it(){return $e.lFrame.bindingIndex++}function rt(e){const t=$e.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function st(e){$e.lFrame.inI18n=e}function ot(e,t){const n=$e.lFrame;n.bindingIndex=n.bindingRootIndex=e,at(t)}function at(e){$e.lFrame.currentDirectiveIndex=e}function ct(e){const t=$e.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function lt(){return $e.lFrame.currentQueryIndex}function ut(e){$e.lFrame.currentQueryIndex=e}function dt(e){const t=e[1];return 2===t.type?t.declTNode:1===t.type?e[6]:null}function ht(e,t,n){if(n&L.SkipSelf){let i=t,r=e;for(;i=i.parent,!(null!==i||n&L.Host||(i=dt(r),null===i)||(r=r[15],10&i.type)););if(null===i)return!1;t=i,e=r}const i=$e.lFrame=pt();return i.currentTNode=t,i.lView=e,!0}function ft(e){const t=pt(),n=e[1];$e.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function pt(){const e=$e.lFrame,t=null===e?null:e.child;return null===t?mt(e):t}function mt(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function bt(){const e=$e.lFrame;return $e.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const gt=bt;function _t(){const e=bt();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function vt(){return $e.lFrame.selectedIndex}function yt(e){$e.lFrame.selectedIndex=e}function wt(){const e=$e.lFrame;return Ie(e.tView,e.selectedIndex)}function Dt(e,t){for(let n=t.directiveStart,i=t.directiveEnd;n<i;n++){const t=e.data[n].type.prototype,{ngAfterContentInit:i,ngAfterContentChecked:r,ngAfterViewInit:s,ngAfterViewChecked:o,ngOnDestroy:a}=t;i&&(e.contentHooks||(e.contentHooks=[])).push(-n,i),r&&((e.contentHooks||(e.contentHooks=[])).push(n,r),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(n,r)),s&&(e.viewHooks||(e.viewHooks=[])).push(-n,s),o&&((e.viewHooks||(e.viewHooks=[])).push(n,o),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(n,o)),null!=a&&(e.destroyHooks||(e.destroyHooks=[])).push(n,a)}}function St(e,t,n){Tt(e,t,3,n)}function xt(e,t,n,i){(3&e[2])===n&&Tt(e,t,n,i)}function kt(e,t){let n=e[2];(3&n)===t&&(n&=2047,n+=1,e[2]=n)}function Tt(e,t,n,i){const r=null!=i?i:-1,s=t.length-1;let o=0;for(let a=void 0!==i?65535&e[18]:0;a<s;a++)if("number"==typeof t[a+1]){if(o=t[a],null!=i&&o>=i)break}else t[a]<0&&(e[18]+=65536),(o<r||-1==r)&&(Mt(e,n,t,a),e[18]=(4294901760&e[18])+a+2),a++}function Mt(e,t,n,i){const r=n[i]<0,s=n[i+1],o=e[r?-n[i]:n[i]];if(r){if(e[2]>>11<e[18]>>16&&(3&e[2])===t){e[2]+=2048;try{s.call(o)}finally{}}}else try{s.call(o)}finally{}}const Ct=-1;class Ot{constructor(e,t,n){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=n}}function Lt(e,t,n){const i=Ce(e);let r=0;for(;r<n.length;){const s=n[r];if("number"==typeof s){if(0!==s)break;r++;const o=n[r++],a=n[r++],c=n[r++];i?e.setAttribute(t,a,c,o):t.setAttributeNS(o,a,c)}else{const o=s,a=n[++r];At(o)?i&&e.setProperty(t,o,a):i?e.setAttribute(t,o,a):t.setAttribute(o,a),r++}}return r}function Et(e){return 3===e||4===e||6===e}function At(e){return 64===e.charCodeAt(0)}function It(e,t){if(null===t||0===t.length);else if(null===e||0===e.length)e=t.slice();else{let n=-1;for(let i=0;i<t.length;i++){const r=t[i];"number"==typeof r?n=r:0===n||Rt(e,n,r,null,-1===n||2===n?t[++i]:null)}}return e}function Rt(e,t,n,i,r){let s=0,o=e.length;if(-1===t)o=-1;else for(;s<e.length;){const n=e[s++];if("number"==typeof n){if(n===t){o=-1;break}if(n>t){o=s-1;break}}}for(;s<e.length;){const t=e[s];if("number"==typeof t)break;if(t===n){if(null===i)return void(null!==r&&(e[s+1]=r));if(i===e[s+1])return void(e[s+2]=r)}s++,null!==i&&s++,null!==r&&s++}-1!==o&&(e.splice(o,0,t),s=o+1),e.splice(s++,0,n),null!==i&&e.splice(s++,0,i),null!==r&&e.splice(s++,0,r)}function Pt(e){return e!==Ct}function Ft(e){return 32767&e}function Wt(e,t){let n=e>>16,i=t;for(;n>0;)i=i[15],n--;return i}let jt=!0;function Yt(e){const t=jt;return jt=e,t}let Nt=0;function zt(e,t){const n=Ht(e,t);if(-1!==n)return n;const i=t[1];i.firstCreatePass&&(e.injectorIndex=t.length,$t(i.data,e),$t(t,null),$t(i.blueprint,null));const r=Xt(e,t),s=e.injectorIndex;if(Pt(r)){const e=Ft(r),n=Wt(r,t),i=n[1].data;for(let r=0;r<8;r++)t[s+r]=n[e+r]|i[e+r]}return t[s+8]=r,s}function $t(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Ht(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Xt(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,i=null,r=t;for(;null!==r;){const e=r[1],t=e.type;if(i=2===t?e.declTNode:1===t?r[6]:null,null===i)return Ct;if(n++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|n<<16}return Ct}function Vt(e,t,n){!function(e,t,n){let i;"string"==typeof n?i=n.charCodeAt(0)||0:n.hasOwnProperty(K)&&(i=n[K]),null==i&&(i=n[K]=Nt++);const r=255&i;t.data[e+(r>>5)]|=1<<r}(e,t,n)}function Bt(e,t,n){if(n&L.Optional)return e;v(t,"NodeInjector")}function Ut(e,t,n,i){if(n&L.Optional&&void 0===i&&(i=null),0==(n&(L.Self|L.Host))){const r=e[9],s=A(void 0);try{return r?r.get(t,i,n&L.Optional):I(t,i,n&L.Optional)}finally{A(s)}}return Bt(i,t,n)}function qt(e,t,n,i=L.Default,r){if(null!==e){const s=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e.hasOwnProperty(K)?e[K]:void 0;return"number"==typeof t?t>=0?255&t:Jt:t}(n);if("function"==typeof s){if(!ht(t,e,i))return i&L.Host?Bt(r,n,i):Ut(t,n,i,r);try{const e=s();if(null!=e||i&L.Optional)return e;v(n)}finally{gt()}}else if("number"==typeof s){let r=null,o=Ht(e,t),a=Ct,c=i&L.Host?t[16][6]:null;for((-1===o||i&L.SkipSelf)&&(a=-1===o?Xt(e,t):t[o+8],a!==Ct&&tn(i,!1)?(r=t[1],o=Ft(a),t=Wt(a,t)):o=-1);-1!==o;){const e=t[1];if(en(s,o,e.data)){const e=Kt(o,t,n,r,i,c);if(e!==Gt)return e}a=t[o+8],a!==Ct&&tn(i,t[1].data[o+8]===c)&&en(s,o,t)?(r=e,o=Ft(a),t=Wt(a,t)):o=-1}}}return Ut(t,n,i,r)}const Gt={};function Jt(){return new nn(Ue(),Xe())}function Kt(e,t,n,i,r,s){const o=t[1],a=o.data[e+8],c=Qt(a,o,n,null==i?me(a)&&jt:i!=o&&0!=(3&a.type),r&L.Host&&s===a);return null!==c?Zt(t,o,c,a):Gt}function Qt(e,t,n,i,r){const s=e.providerIndexes,o=t.data,a=1048575&s,c=e.directiveStart,l=s>>20,u=r?a+l:e.directiveEnd;for(let d=i?a:a+l;d<u;d++){const e=o[d];if(d<c&&n===e||d>=c&&e.type===n)return d}if(r){const e=o[c];if(e&&ge(e)&&e.type===n)return c}return null}function Zt(e,t,n,i){let r=e[n];const s=t.data;if(r instanceof Ot){const o=r;o.resolving&&function(e,t){throw new b("200",`Circular dependency in DI detected for ${e}`)}(_(s[n]));const a=Yt(o.canSeeViewProviders);o.resolving=!0;const c=o.injectImpl?A(o.injectImpl):null;ht(e,i,L.Default);try{r=e[n]=o.factory(void 0,s,e,i),t.firstCreatePass&&n>=i.directiveStart&&function(e,t,n){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=t.type.prototype;if(i){const i=we(t);(n.preOrderHooks||(n.preOrderHooks=[])).push(e,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,i)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-e,r),s&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,s))}(n,s[n],t)}finally{null!==c&&A(c),Yt(a),o.resolving=!1,gt()}}return r}function en(e,t,n){return!!(n[t+(e>>5)]&1<<e)}function tn(e,t){return!(e&L.Self||e&L.Host&&t)}class nn{constructor(e,t){this._tNode=e,this._lView=t}get(e,t){return qt(this._tNode,this._lView,e,void 0,t)}}function rn(e){return R(()=>{const t=e.prototype.constructor,n=t[J]||sn(t),i=Object.prototype;let r=Object.getPrototypeOf(e.prototype).constructor;for(;r&&r!==i;){const e=r[J]||sn(r);if(e&&e!==n)return e;r=Object.getPrototypeOf(r)}return e=>new e})}function sn(e){return m(e)?()=>{const t=sn(p(e));return t&&t()}:_e(e)}function on(e){return function(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const e=n.length;let i=0;for(;i<e;){const r=n[i];if(Et(r))break;if(0===r)i+=2;else if("number"==typeof r)for(i++;i<e&&"string"==typeof n[i];)i++;else{if(r===t)return n[i+1];i+=2}}}return null}(Ue(),e)}const an="__parameters__";function cn(e,t,n){return R(()=>{const i=function(e){return function(...t){if(e){const n=e(...t);for(const e in n)this[e]=n[e]}}}(t);function r(...e){if(this instanceof r)return i.apply(this,e),this;const t=new r(...e);return n.annotation=t,n;function n(e,n,i){const r=e.hasOwnProperty(an)?e[an]:Object.defineProperty(e,an,{value:[]})[an];for(;r.length<=i;)r.push(null);return(r[i]=r[i]||[]).push(t),e}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r})}const ln=function(){return cn("Attribute",e=>({attributeName:e,__NG_ELEMENT_ID__:()=>on(e)}))}();class un{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=w({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const dn=new un("AnalyzeForEntryComponents"),hn=Function;function fn(e,t){void 0===t&&(t=e);for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?(t===e&&(t=e.slice(0,n)),fn(i,t)):t!==e&&t.push(i)}return t}function pn(e,t){e.forEach(e=>Array.isArray(e)?pn(e,t):t(e))}function mn(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function bn(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function gn(e,t){const n=[];for(let i=0;i<e;i++)n.push(t);return n}function _n(e,t,n){let i=yn(e,t);return i>=0?e[1|i]=n:(i=~i,function(e,t,n,i){let r=e.length;if(r==t)e.push(n,i);else if(1===r)e.push(i,e[0]),e[0]=n;else{for(r--,e.push(e[r-1],e[r]);r>t;)e[r]=e[r-2],r--;e[t]=n,e[t+1]=i}}(e,i,t,n)),i}function vn(e,t){const n=yn(e,t);if(n>=0)return e[1|n]}function yn(e,t){return function(e,t,n){let i=0,r=e.length>>1;for(;r!==i;){const n=i+(r-i>>1),s=e[n<<1];if(t===s)return n<<1;s>t?r=n:i=n+1}return~(r<<1)}(e,t)}const wn={},Dn=/\n/gm,Sn="__source",xn=c({provide:String,useValue:c});let kn;function Tn(e){const t=kn;return kn=e,t}function Mn(e,t=L.Default){if(void 0===kn)throw new Error("inject() must be called from an injection context");return null===kn?I(e,void 0,t):kn.get(e,t&L.Optional?null:void 0,t)}function Cn(e,t=L.Default){return(E||Mn)(p(e),t)}function On(e){const t=[];for(let n=0;n<e.length;n++){const i=p(e[n]);if(Array.isArray(i)){if(0===i.length)throw new Error("Arguments array must have arguments.");let e,n=L.Default;for(let t=0;t<i.length;t++){const r=i[t],s=r.__NG_DI_FLAG__;"number"==typeof s?-1===s?e=r.token:n|=s:e=r}t.push(Cn(e,n))}else t.push(Cn(i))}return t}function Ln(e,t){return e.__NG_DI_FLAG__=t,e.prototype.__NG_DI_FLAG__=t,e}const En=Ln(cn("Inject",e=>({token:e})),-1),An=Ln(cn("Optional"),8),In=Ln(cn("SkipSelf"),4),Rn=Ln(cn("Host"),1);let Pn,Fn;function Wn(e){var t;return(null===(t=function(){if(void 0===Pn&&(Pn=null,z.trustedTypes))try{Pn=z.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(t){}return Pn}())||void 0===t?void 0:t.createHTML(e))||e}function jn(){if(void 0===Fn&&(Fn=null,z.trustedTypes))try{Fn=z.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch(e){}return Fn}function Yn(e){var t;return(null===(t=jn())||void 0===t?void 0:t.createHTML(e))||e}function Nn(e){var t;return(null===(t=jn())||void 0===t?void 0:t.createScriptURL(e))||e}class zn{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class $n extends zn{getTypeName(){return"HTML"}}class Hn extends zn{getTypeName(){return"Style"}}class Xn extends zn{getTypeName(){return"Script"}}class Vn extends zn{getTypeName(){return"URL"}}class Bn extends zn{getTypeName(){return"ResourceURL"}}function Un(e){return e instanceof zn?e.changingThisBreaksApplicationSecurity:e}function qn(e,t){const n=Gn(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===t}function Gn(e){return e instanceof zn&&e.getTypeName()||null}function Jn(e){return new $n(e)}function Kn(e){return new Hn(e)}function Qn(e){return new Xn(e)}function Zn(e){return new Vn(e)}function ei(e){return new Bn(e)}function ti(e){const t=new ii(e);return function(){try{return!!(new window.DOMParser).parseFromString(Wn(""),"text/html")}catch(e){return!1}}()?new ni(t):t}class ni{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{const t=(new window.DOMParser).parseFromString(Wn(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class ii{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e);const t=this.inertDocument.createElement("body");e.appendChild(t)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Wn(e),t;const n=this.inertDocument.createElement("body");return n.innerHTML=Wn(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(e){const t=e.attributes;for(let i=t.length-1;0<i;i--){const n=t.item(i).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||e.removeAttribute(n)}let n=e.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const ri=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,si=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function oi(e){return(e=String(e)).match(ri)||e.match(si)?e:"unsafe:"+e}function ai(e){return(e=String(e)).split(",").map(e=>oi(e.trim())).join(", ")}function ci(e){const t={};for(const n of e.split(","))t[n]=!0;return t}function li(...e){const t={};for(const n of e)for(const e in n)n.hasOwnProperty(e)&&(t[e]=!0);return t}const ui=ci("area,br,col,hr,img,wbr"),di=ci("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),hi=ci("rp,rt"),fi=li(hi,di),pi=li(ui,li(di,ci("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),li(hi,ci("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),fi),mi=ci("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),bi=ci("srcset"),gi=li(mi,bi,ci("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),ci("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),_i=ci("script,style,template");class vi{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,n=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?n=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,n&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!pi.hasOwnProperty(t))return this.sanitizedSomething=!0,!_i.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const n=e.attributes;for(let i=0;i<n.length;i++){const e=n.item(i),t=e.name,r=t.toLowerCase();if(!gi.hasOwnProperty(r)){this.sanitizedSomething=!0;continue}let s=e.value;mi[r]&&(s=oi(s)),bi[r]&&(s=ai(s)),this.buf.push(" ",t,'="',Di(s),'"')}return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();pi.hasOwnProperty(t)&&!ui.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Di(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const yi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wi=/([^\#-~ |!])/g;function Di(e){return e.replace(/&/g,"&amp;").replace(yi,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(wi,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let Si;function xi(e,t){let n=null;try{Si=Si||ti(e);let i=t?String(t):"";n=Si.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=n.innerHTML,n=Si.getInertBodyElement(i)}while(i!==s);return Wn((new vi).sanitizeChildren(ki(n)||n))}finally{if(n){const e=ki(n)||n;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function ki(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Ti=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({});function Mi(e){const t=Li();return t?Yn(t.sanitize(Ti.HTML,e)||""):qn(e,"HTML")?Yn(Un(e)):xi(Me(),g(e))}function Ci(e){const t=Li();return t?t.sanitize(Ti.URL,e)||"":qn(e,"URL")?Un(e):oi(g(e))}function Oi(e){const t=Li();if(t)return Nn(t.sanitize(Ti.RESOURCE_URL,e)||"");if(qn(e,"ResourceURL"))return Nn(Un(e));throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)")}function Li(){const e=Xe();return e&&e[12]}function Ei(e){return e.ngDebugContext}function Ai(e){return e.ngOriginalError}function Ii(e,...t){e.error(...t)}class Ri{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),n=this._findContext(e),i=function(e){return e.ngErrorLogger||Ii}(e);i(this._console,"ERROR",e),t&&i(this._console,"ORIGINAL ERROR",t),n&&i(this._console,"ERROR CONTEXT",n)}_findContext(e){return e?Ei(e)?Ei(e):this._findContext(Ai(e)):null}_findOriginalError(e){let t=Ai(e);for(;t&&Ai(t);)t=Ai(t);return t}}const Pi=/^>|^->|<!--|-->|--!>|<!-$/g,Fi=/(<|>)/;function Wi(e,t){e.__ngContext__=t}const ji=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(z))();function Yi(e){return{name:"window",target:e.ownerDocument.defaultView}}function Ni(e){return{name:"body",target:e.ownerDocument.body}}function zi(e){return e instanceof Function?e():e}var $i=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({});let Hi;function Xi(e,t){return Hi(e,t)}function Vi(e){const t=e[3];return fe(t)?t[3]:t}function Bi(e){return qi(e[13])}function Ui(e){return qi(e[4])}function qi(e){for(;null!==e&&!fe(e);)e=e[4];return e}function Gi(e,t,n,i,r){if(null!=i){let s,o=!1;fe(i)?s=i:he(i)&&(o=!0,i=i[0]);const a=Le(i);0===e&&null!==n?null==r?ar(t,n,a):or(t,n,a,r||null,!0):1===e&&null!==n?or(t,n,a,r||null,!0):2===e?vr(t,a,o):3===e&&t.destroyNode(a),null!=s&&function(e,t,n,i,r){const s=n[7];s!==Le(n)&&Gi(t,e,i,s,r);for(let o=de;o<n.length;o++){const r=n[o];wr(r[1],r,e,t,i,s)}}(t,e,s,n,r)}}function Ji(e,t){return Ce(e)?e.createText(t):e.createTextNode(t)}function Ki(e,t,n){Ce(e)?e.setValue(t,n):t.textContent=n}function Qi(e,t){return e.createComment(function(e){return e.replace(Pi,e=>e.replace(Fi,"\u200b$1\u200b"))}(t))}function Zi(e,t,n){return Ce(e)?e.createElement(t,n):null===n?e.createElement(t):e.createElementNS(n,t)}function er(e,t){const n=e[9],i=n.indexOf(t),r=t[3];1024&t[2]&&(t[2]&=-1025,ze(r,-1)),n.splice(i,1)}function tr(e,t){if(e.length<=de)return;const n=de+t,i=e[n];if(i){const s=i[17];null!==s&&s!==e&&er(s,i),t>0&&(e[n-1][4]=i[4]);const o=bn(e,de+t);wr(i[1],r=i,r[11],2,null,null),r[0]=null,r[6]=null;const a=o[19];null!==a&&a.detachView(o[1]),i[3]=null,i[4]=null,i[2]&=-129}var r;return i}function nr(e,t){if(!(256&t[2])){const n=t[11];Ce(n)&&n.destroyNode&&wr(e,t,n,3,null,null),function(e){let t=e[13];if(!t)return ir(e[1],e);for(;t;){let n=null;if(he(t))n=t[13];else{const e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)he(t)&&ir(t[1],t),t=t[3];null===t&&(t=e),he(t)&&ir(t[1],t),n=t&&t[4]}t=n}}(t)}}function ir(e,t){if(!(256&t[2])){t[2]&=-129,t[2]|=256,function(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let i=0;i<n.length;i+=2){const e=t[n[i]];if(!(e instanceof Ot)){const t=n[i+1];if(Array.isArray(t))for(let n=0;n<t.length;n+=2){const i=e[t[n]],r=t[n+1];try{r.call(i)}finally{}}else try{t.call(e)}finally{}}}}(e,t),function(e,t){const n=e.cleanup,i=t[7];let r=-1;if(null!==n)for(let s=0;s<n.length-1;s+=2)if("string"==typeof n[s]){const e=n[s+1],o="function"==typeof e?e(t):Le(t[e]),a=i[r=n[s+2]],c=n[s+3];"boolean"==typeof c?o.removeEventListener(n[s],a,c):c>=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const e=i[r=n[s+1]];n[s].call(e)}if(null!==i){for(let e=r+1;e<i.length;e++)(0,i[e])();t[7]=null}}(e,t),1===t[1].type&&Ce(t[11])&&t[11].destroy();const n=t[17];if(null!==n&&fe(t[3])){n!==t[3]&&er(n,t);const i=t[19];null!==i&&i.detachView(e)}}}function rr(e,t,n){return sr(e,t.parent,n)}function sr(e,t,n){let i=t;for(;null!==i&&40&i.type;)i=(t=i).parent;if(null===i)return n[0];if(2&i.flags){const t=e.data[i.directiveStart].encapsulation;if(t===F.None||t===F.Emulated)return null}return Ae(i,n)}function or(e,t,n,i,r){Ce(e)?e.insertBefore(t,n,i,r):t.insertBefore(n,i,r)}function ar(e,t,n){Ce(e)?e.appendChild(t,n):t.appendChild(n)}function cr(e,t,n,i,r){null!==i?or(e,t,n,i,r):ar(e,t,n)}function lr(e,t){return Ce(e)?e.parentNode(t):t.parentNode}function ur(e,t,n){return fr(e,t,n)}function dr(e,t,n){return 40&e.type?Ae(e,n):null}let hr,fr=dr;function pr(e,t){fr=e,hr=t}function mr(e,t,n,i){const r=rr(e,i,t),s=t[11],o=ur(i.parent||t[6],i,t);if(null!=r)if(Array.isArray(n))for(let a=0;a<n.length;a++)cr(s,r,n[a],o,!1);else cr(s,r,n,o,!1);void 0!==hr&&hr(s,i,t,n,r)}function br(e,t){if(null!==t){const n=t.type;if(3&n)return Ae(t,e);if(4&n)return _r(-1,e[t.index]);if(8&n){const n=t.child;if(null!==n)return br(e,n);{const n=e[t.index];return fe(n)?_r(-1,n):Le(n)}}if(32&n)return Xi(t,e)()||Le(e[t.index]);{const n=gr(e,t);return null!==n?Array.isArray(n)?n[0]:br(Vi(e[16]),n):br(e,t.next)}}return null}function gr(e,t){return null!==t?e[16][6].projection[t.projection]:null}function _r(e,t){const n=de+e+1;if(n<t.length){const e=t[n],i=e[1].firstChild;if(null!==i)return br(e,i)}return t[7]}function vr(e,t,n){const i=lr(e,t);i&&function(e,t,n,i){Ce(e)?e.removeChild(t,n,i):t.removeChild(n)}(e,i,t,n)}function yr(e,t,n,i,r,s,o){for(;null!=n;){const a=i[n.index],c=n.type;if(o&&0===t&&(a&&Wi(Le(a),i),n.flags|=4),64!=(64&n.flags))if(8&c)yr(e,t,n.child,i,r,s,!1),Gi(t,e,r,a,s);else if(32&c){const o=Xi(n,i);let c;for(;c=o();)Gi(t,e,r,c,s);Gi(t,e,r,a,s)}else 16&c?Dr(e,t,i,n,r,s):Gi(t,e,r,a,s);n=o?n.projectionNext:n.next}}function wr(e,t,n,i,r,s){yr(n,i,e.firstChild,t,r,s,!1)}function Dr(e,t,n,i,r,s){const o=n[16],a=o[6].projection[i.projection];if(Array.isArray(a))for(let c=0;c<a.length;c++)Gi(t,e,r,a[c],s);else yr(e,t,a,o[3],r,s,!0)}function Sr(e,t,n){Ce(e)?e.setAttribute(t,"style",n):t.style.cssText=n}function xr(e,t,n){Ce(e)?""===n?e.removeAttribute(t,"class"):e.setAttribute(t,"class",n):t.className=n}function kr(e,t,n){let i=e.length;for(;;){const r=e.indexOf(t,n);if(-1===r)return r;if(0===r||e.charCodeAt(r-1)<=32){const n=t.length;if(r+n===i||e.charCodeAt(r+n)<=32)return r}n=r+1}}const Tr="ng-template";function Mr(e,t,n){let i=0;for(;i<e.length;){let r=e[i++];if(n&&"class"===r){if(r=e[i],-1!==kr(r.toLowerCase(),t,0))return!0}else if(1===r){for(;i<e.length&&"string"==typeof(r=e[i++]);)if(r.toLowerCase()===t)return!0;return!1}}return!1}function Cr(e){return 4===e.type&&e.value!==Tr}function Or(e,t,n){return t===(4!==e.type||n?e.value:Tr)}function Lr(e,t,n){let i=4;const r=e.attrs||[],s=function(e){for(let t=0;t<e.length;t++)if(Et(e[t]))return t;return e.length}(r);let o=!1;for(let a=0;a<t.length;a++){const c=t[a];if("number"!=typeof c){if(!o)if(4&i){if(i=2|1&i,""!==c&&!Or(e,c,n)||""===c&&1===t.length){if(Er(i))return!1;o=!0}}else{const l=8&i?c:t[++a];if(8&i&&null!==e.attrs){if(!Mr(e.attrs,l,n)){if(Er(i))return!1;o=!0}continue}const u=Ar(8&i?"class":c,r,Cr(e),n);if(-1===u){if(Er(i))return!1;o=!0;continue}if(""!==l){let e;e=u>s?"":r[u+1].toLowerCase();const t=8&i?e:null;if(t&&-1!==kr(t,l,0)||2&i&&l!==e){if(Er(i))return!1;o=!0}}}}else{if(!o&&!Er(i)&&!Er(c))return!1;if(o&&Er(c))continue;o=!1,i=c|1&i}}return Er(i)||o}function Er(e){return 0==(1&e)}function Ar(e,t,n,i){if(null===t)return-1;let r=0;if(i||!n){let n=!1;for(;r<t.length;){const i=t[r];if(i===e)return r;if(3===i||6===i)n=!0;else{if(1===i||2===i){let e=t[++r];for(;"string"==typeof e;)e=t[++r];continue}if(4===i)break;if(0===i){r+=4;continue}}r+=n?1:2}return-1}return function(e,t){let n=e.indexOf(4);if(n>-1)for(n++;n<e.length;){const i=e[n];if("number"==typeof i)return-1;if(i===t)return n;n++}return-1}(t,e)}function Ir(e,t,n=!1){for(let i=0;i<t.length;i++)if(Lr(e,t[i],n))return!0;return!1}function Rr(e,t){e:for(let n=0;n<t.length;n++){const i=t[n];if(e.length===i.length){for(let t=0;t<e.length;t++)if(e[t]!==i[t])continue e;return!0}}return!1}function Pr(e,t){return e?":not("+t.trim()+")":t}function Fr(e){let t=e[0],n=1,i=2,r="",s=!1;for(;n<e.length;){let o=e[n];if("string"==typeof o)if(2&i){const t=e[++n];r+="["+o+(t.length>0?'="'+t+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""===r||Er(o)||(t+=Pr(s,r),r=""),i=o,s=s||!Er(i);n++}return""!==r&&(t+=Pr(s,r)),t}const Wr={};function jr(e){Yr(Ve(),Xe(),vt()+e,Ze())}function Yr(e,t,n,i){if(!i)if(3==(3&t[2])){const i=e.preOrderCheckHooks;null!==i&&St(t,i,n)}else{const i=e.preOrderHooks;null!==i&&xt(t,i,0,n)}yt(n)}function Nr(e,t){return e<<17|t<<2}function zr(e){return e>>17&32767}function $r(e){return 2|e}function Hr(e){return(131068&e)>>2}function Xr(e,t){return-131069&e|t<<2}function Vr(e){return 1|e}function Br(e,t){const n=e.contentQueries;if(null!==n)for(let i=0;i<n.length;i+=2){const r=n[i],s=n[i+1];if(-1!==s){const n=e.data[s];ut(r),n.contentQueries(2,t[s],s)}}}function Ur(e,t,n,i,r,s,o,a,c,l){const u=t.blueprint.slice();return u[0]=r,u[2]=140|i,Ne(u),u[3]=u[15]=e,u[8]=n,u[10]=o||e&&e[10],u[11]=a||e&&e[11],u[12]=c||e&&e[12]||null,u[9]=l||e&&e[9]||null,u[6]=s,u[16]=2==t.type?e[16]:u,u}function qr(e,t,n,i,r){let s=e.data[t];if(null===s)s=Gr(e,t,n,i,r),$e.lFrame.inI18n&&(s.flags|=64);else if(64&s.type){s.type=n,s.value=i,s.attrs=r;const e=Ge();s.injectorIndex=null===e?-1:e.injectorIndex}return Je(s,!0),s}function Gr(e,t,n,i,r){const s=qe(),o=Ke(),a=e.data[t]=function(e,t,n,i,r,s){return{type:n,index:i,insertBeforeIndex:null,injectorIndex:t?t.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,value:r,attrs:s,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,o?s:s&&s.parent,n,t,i,r);return null===e.firstChild&&(e.firstChild=a),null!==s&&(o?null==s.child&&null!==a.parent&&(s.child=a):null===s.next&&(s.next=a)),a}function Jr(e,t,n,i){if(0===n)return-1;const r=t.length;for(let s=0;s<n;s++)t.push(i),e.blueprint.push(i),e.data.push(null);return r}function Kr(e,t,n){ft(t);try{const i=e.viewQuery;null!==i&&Cs(1,i,n);const r=e.template;null!==r&&es(e,t,r,1,n),e.firstCreatePass&&(e.firstCreatePass=!1),e.staticContentQueries&&Br(e,t),e.staticViewQueries&&Cs(2,e.viewQuery,n);const s=e.components;null!==s&&function(e,t){for(let n=0;n<t.length;n++)Ss(e,t[n])}(t,s)}catch(i){throw e.firstCreatePass&&(e.incompleteFirstPass=!0),i}finally{t[2]&=-5,_t()}}function Qr(e,t,n,i){const r=t[2];if(256==(256&r))return;ft(t);const s=Ze();try{Ne(t),$e.lFrame.bindingIndex=e.bindingStartIndex,null!==n&&es(e,t,n,2,i);const o=3==(3&r);if(!s)if(o){const n=e.preOrderCheckHooks;null!==n&&St(t,n,null)}else{const n=e.preOrderHooks;null!==n&&xt(t,n,0,null),kt(t,0)}if(function(e){for(let t=Bi(e);null!==t;t=Ui(t)){if(!t[2])continue;const e=t[9];for(let t=0;t<e.length;t++){const n=e[t],i=n[3];0==(1024&n[2])&&ze(i,1),n[2]|=1024}}}(t),function(e){for(let t=Bi(e);null!==t;t=Ui(t))for(let e=de;e<t.length;e++){const n=t[e],i=n[1];je(n)&&Qr(i,n,i.template,n[8])}}(t),null!==e.contentQueries&&Br(e,t),!s)if(o){const n=e.contentCheckHooks;null!==n&&St(t,n)}else{const n=e.contentHooks;null!==n&&xt(t,n,1),kt(t,1)}!function(e,t){const n=e.hostBindingOpCodes;if(null!==n)try{for(let e=0;e<n.length;e++){const i=n[e];if(i<0)yt(~i);else{const r=i,s=n[++e],o=n[++e];ot(s,r),o(2,t[r])}}}finally{yt(-1)}}(e,t);const a=e.components;null!==a&&function(e,t){for(let n=0;n<t.length;n++)ws(e,t[n])}(t,a);const c=e.viewQuery;if(null!==c&&Cs(2,c,i),!s)if(o){const n=e.viewCheckHooks;null!==n&&St(t,n)}else{const n=e.viewHooks;null!==n&&xt(t,n,2),kt(t,2)}!0===e.firstUpdatePass&&(e.firstUpdatePass=!1),s||(t[2]&=-73),1024&t[2]&&(t[2]&=-1025,ze(t[3],-1))}finally{_t()}}function Zr(e,t,n,i){const r=t[10],s=!Ze(),o=We(t);try{s&&!o&&r.begin&&r.begin(),o&&Kr(e,t,i),Qr(e,t,n,i)}finally{s&&!o&&r.end&&r.end()}}function es(e,t,n,i,r){const s=vt(),o=2&i;try{yt(-1),o&&t.length>ue&&Yr(e,t,ue,Ze()),n(i,r)}finally{yt(s)}}function ts(e,t,n){if(pe(t)){const i=t.directiveEnd;for(let r=t.directiveStart;r<i;r++){const t=e.data[r];t.contentQueries&&t.contentQueries(1,n[r],r)}}}function ns(e,t,n){He()&&(function(e,t,n,i){const r=n.directiveStart,s=n.directiveEnd;e.firstCreatePass||zt(n,t),Wi(i,t);const o=n.initialInputs;for(let a=r;a<s;a++){const i=e.data[a],s=ge(i);s&&bs(t,n,i);const c=Zt(t,e,a,n);Wi(c,t),null!==o&&_s(0,a-r,c,i,0,o),s&&(Pe(n.index,t)[8]=c)}}(e,t,n,Ae(n,t)),128==(128&n.flags)&&function(e,t,n){const i=n.directiveStart,r=n.directiveEnd,s=n.index,o=$e.lFrame.currentDirectiveIndex;try{yt(s);for(let n=i;n<r;n++){const i=e.data[n],r=t[n];at(n),null===i.hostBindings&&0===i.hostVars&&null===i.hostAttrs||ds(i,r)}}finally{yt(-1),at(o)}}(e,t,n))}function is(e,t,n=Ae){const i=t.localNames;if(null!==i){let r=t.index+1;for(let s=0;s<i.length;s+=2){const o=i[s+1],a=-1===o?n(t,e):e[o];e[r++]=a}}}function rs(e){const t=e.tView;return null===t||t.incompleteFirstPass?e.tView=ss(1,null,e.template,e.decls,e.vars,e.directiveDefs,e.pipeDefs,e.viewQuery,e.schemas,e.consts):t}function ss(e,t,n,i,r,s,o,a,c,l){const u=ue+i,d=u+r,h=function(e,t){const n=[];for(let i=0;i<t;i++)n.push(i<e?null:Wr);return n}(u,d),f="function"==typeof l?l():l;return h[1]={type:e,blueprint:h,template:n,queries:null,viewQuery:a,declTNode:t,data:h.slice().fill(null,u),bindingStartIndex:u,expandoStartIndex:d,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof s?s():s,pipeRegistry:"function"==typeof o?o():o,firstChild:null,schemas:c,consts:f,incompleteFirstPass:!1}}function os(e,t,n,i){const r=Ls(t);null===n?r.push(i):(r.push(n),e.firstCreatePass&&Es(e).push(i,r.length-1))}function as(e,t,n){for(let i in e)if(e.hasOwnProperty(i)){const r=e[i];(n=null===n?{}:n).hasOwnProperty(i)?n[i].push(t,r):n[i]=[t,r]}return n}function cs(e,t,n,i,r,s,o,a){const c=Ae(t,n);let l,u=t.inputs;var d;!a&&null!=u&&(l=u[i])?(Is(e,n,l,i,r),me(t)&&function(e,t){const n=Pe(t,e);16&n[2]||(n[2]|=64)}(n,t.index)):3&t.type&&(i="class"===(d=i)?"className":"for"===d?"htmlFor":"formaction"===d?"formAction":"innerHtml"===d?"innerHTML":"readonly"===d?"readOnly":"tabindex"===d?"tabIndex":d,r=null!=o?o(r,t.value||"",i):r,Ce(s)?s.setProperty(c,i,r):At(i)||(c.setProperty?c.setProperty(i,r):c[i]=r))}function ls(e,t,n,i){let r=!1;if(He()){const s=function(e,t,n){const i=e.directiveRegistry;let r=null;if(i)for(let s=0;s<i.length;s++){const o=i[s];Ir(n,o.selectors,!1)&&(r||(r=[]),Vt(zt(n,t),e,o.type),ge(o)?(hs(e,n),r.unshift(o)):r.push(o))}return r}(e,t,n),o=null===i?null:{"":-1};if(null!==s){r=!0,ps(n,e.data.length,s.length);for(let e=0;e<s.length;e++){const t=s[e];t.providersResolver&&t.providersResolver(t)}let i=!1,a=!1,c=Jr(e,t,s.length,null);for(let r=0;r<s.length;r++){const l=s[r];n.mergedAttrs=It(n.mergedAttrs,l.hostAttrs),ms(e,n,t,c,l),fs(c,l,o),null!==l.contentQueries&&(n.flags|=8),null===l.hostBindings&&null===l.hostAttrs&&0===l.hostVars||(n.flags|=128);const u=l.type.prototype;!i&&(u.ngOnChanges||u.ngOnInit||u.ngDoCheck)&&((e.preOrderHooks||(e.preOrderHooks=[])).push(n.index),i=!0),a||!u.ngOnChanges&&!u.ngDoCheck||((e.preOrderCheckHooks||(e.preOrderCheckHooks=[])).push(n.index),a=!0),c++}!function(e,t){const n=t.directiveEnd,i=e.data,r=t.attrs,s=[];let o=null,a=null;for(let c=t.directiveStart;c<n;c++){const e=i[c],n=e.inputs,l=null===r||Cr(t)?null:vs(n,r);s.push(l),o=as(n,c,o),a=as(e.outputs,c,a)}null!==o&&(o.hasOwnProperty("class")&&(t.flags|=16),o.hasOwnProperty("style")&&(t.flags|=32)),t.initialInputs=s,t.inputs=o,t.outputs=a}(e,n)}o&&function(e,t,n){if(t){const i=e.localNames=[];for(let e=0;e<t.length;e+=2){const r=n[t[e+1]];if(null==r)throw new b("301",`Export of name '${t[e+1]}' not found!`);i.push(t[e],r)}}}(n,i,o)}return n.mergedAttrs=It(n.mergedAttrs,n.attrs),r}function us(e,t,n,i,r,s){const o=s.hostBindings;if(o){let n=e.hostBindingOpCodes;null===n&&(n=e.hostBindingOpCodes=[]);const s=~t.index;(function(e){let t=e.length;for(;t>0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(n)!=s&&n.push(s),n.push(i,r,o)}}function ds(e,t){null!==e.hostBindings&&e.hostBindings(1,t)}function hs(e,t){t.flags|=2,(e.components||(e.components=[])).push(t.index)}function fs(e,t,n){if(n){if(t.exportAs)for(let i=0;i<t.exportAs.length;i++)n[t.exportAs[i]]=e;ge(t)&&(n[""]=e)}}function ps(e,t,n){e.flags|=1,e.directiveStart=t,e.directiveEnd=t+n,e.providerIndexes=t}function ms(e,t,n,i,r){e.data[i]=r;const s=r.factory||(r.factory=_e(r.type)),o=new Ot(s,ge(r),null);e.blueprint[i]=o,n[i]=o,us(e,t,0,i,Jr(e,n,r.hostVars,Wr),r)}function bs(e,t,n){const i=Ae(t,e),r=rs(n),s=e[10],o=xs(e,Ur(e,r,null,n.onPush?64:16,i,t,s,s.createRenderer(i,n),null,null));e[t.index]=o}function gs(e,t,n,i,r,s,o){if(null==s)Ce(e)?e.removeAttribute(t,r,n):t.removeAttribute(r);else{const a=null==o?g(s):o(s,i||"",r);Ce(e)?e.setAttribute(t,r,a,n):n?t.setAttributeNS(n,r,a):t.setAttribute(r,a)}}function _s(e,t,n,i,r,s){const o=s[t];if(null!==o){const e=i.setInput;for(let t=0;t<o.length;){const r=o[t++],s=o[t++],a=o[t++];null!==e?i.setInput(n,a,r,s):n[s]=a}}}function vs(e,t){let n=null,i=0;for(;i<t.length;){const r=t[i];if(0!==r)if(5!==r){if("number"==typeof r)break;e.hasOwnProperty(r)&&(null===n&&(n=[]),n.push(r,e[r],t[i+1])),i+=2}else i+=2;else i+=4}return n}function ys(e,t,n,i){return new Array(e,!0,!1,t,null,0,i,n,null,null)}function ws(e,t){const n=Pe(t,e);if(je(n)){const e=n[1];80&n[2]?Qr(e,n,e.template,n[8]):n[5]>0&&Ds(n)}}function Ds(e){for(let n=Bi(e);null!==n;n=Ui(n))for(let e=de;e<n.length;e++){const t=n[e];if(1024&t[2]){const e=t[1];Qr(e,t,e.template,t[8])}else t[5]>0&&Ds(t)}const t=e[1].components;if(null!==t)for(let n=0;n<t.length;n++){const i=Pe(t[n],e);je(i)&&i[5]>0&&Ds(i)}}function Ss(e,t){const n=Pe(t,e),i=n[1];!function(e,t){for(let n=t.length;n<e.blueprint.length;n++)t.push(e.blueprint[n])}(i,n),Kr(i,n,n[8])}function xs(e,t){return e[13]?e[14][4]=t:e[13]=t,e[14]=t,t}function ks(e){for(;e;){e[2]|=64;const t=Vi(e);if(0!=(512&e[2])&&!t)return e;e=t}return null}function Ts(e,t,n){const i=t[10];i.begin&&i.begin();try{Qr(e,t,e.template,n)}catch(r){throw As(t,r),r}finally{i.end&&i.end()}}function Ms(e){!function(e){for(let t=0;t<e.components.length;t++){const n=e.components[t],i=Fe(n),r=i[1];Zr(r,i,r.template,n)}}(e[8])}function Cs(e,t,n){ut(0),t(e,n)}const Os=(()=>Promise.resolve(null))();function Ls(e){return e[7]||(e[7]=[])}function Es(e){return e.cleanup||(e.cleanup=[])}function As(e,t){const n=e[9],i=n?n.get(Ri,null):null;i&&i.handleError(t)}function Is(e,t,n,i,r){for(let s=0;s<n.length;){const o=n[s++],a=n[s++],c=t[o],l=e.data[o];null!==l.setInput?l.setInput(c,r,i,a):c[a]=r}}function Rs(e,t,n){const i=Ee(t,e);Ki(e[11],i,n)}function Ps(e,t,n){let i=n?e.styles:null,r=n?e.classes:null,s=0;if(null!==t)for(let o=0;o<t.length;o++){const e=t[o];"number"==typeof e?s=e:1==s?r=d(r,e):2==s&&(i=d(i,e+": "+t[++o]+";"))}n?e.styles=i:e.stylesWithoutHost=i,n?e.classes=r:e.classesWithoutHost=r}const Fs=new un("INJECTOR",-1);class Ws{get(e,t=wn){if(t===wn){const t=new Error(`NullInjectorError: No provider for ${u(e)}!`);throw t.name="NullInjectorError",t}return t}}const js=new un("Set Injector scope."),Ys={},Ns={},zs=[];let $s;function Hs(){return void 0===$s&&($s=new Ws),$s}function Xs(e,t=null,n=null,i){return new Vs(e,n,t||Hs(),i)}class Vs{constructor(e,t,n,i=null){this.parent=n,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const r=[];t&&pn(t,n=>this.processProvider(n,e,t)),pn([e],e=>this.processInjectorType(e,[],r)),this.records.set(Fs,qs(void 0,this));const s=this.records.get(js);this.scope=null!=s?s.value:null,this.source=i||("object"==typeof e?null:u(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=wn,n=L.Default){this.assertNotDestroyed();const i=Tn(this);try{if(!(n&L.SkipSelf)){let t=this.records.get(e);if(void 0===t){const n=("function"==typeof(r=e)||"object"==typeof r&&r instanceof un)&&S(e);t=n&&this.injectableDefInScope(n)?qs(Bs(e),Ys):null,this.records.set(e,t)}if(null!=t)return this.hydrate(e,t)}return(n&L.Self?Hs():this.parent).get(e,t=n&L.Optional&&t===wn?null:t)}catch(s){if("NullInjectorError"===s.name){if((s.ngTempTokenPath=s.ngTempTokenPath||[]).unshift(u(e)),i)throw s;return function(e,t,n,i){const r=e.ngTempTokenPath;throw t[Sn]&&r.unshift(t[Sn]),e.message=function(e,t,n,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.substr(2):e;let r=u(t);if(Array.isArray(t))r=t.map(u).join(" -> ");else if("object"==typeof t){let e=[];for(let n in t)if(t.hasOwnProperty(n)){let i=t[n];e.push(n+":"+("string"==typeof i?JSON.stringify(i):u(i)))}r=`{${e.join(", ")}}`}return`${n}${i?"("+i+")":""}[${r}]: ${e.replace(Dn,"\n  ")}`}("\n"+e.message,r,n,i),e.ngTokenPath=r,e.ngTempTokenPath=null,e}(s,e,"R3InjectorError",this.source)}throw s}finally{Tn(i)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((t,n)=>e.push(u(n))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,n){if(!(e=p(e)))return!1;let i=k(e);const r=null==i&&e.ngModule||void 0,s=void 0===r?e:r,o=-1!==n.indexOf(s);if(void 0!==r&&(i=k(r)),null==i)return!1;if(null!=i.imports&&!o){let e;n.push(s);try{pn(i.imports,i=>{this.processInjectorType(i,t,n)&&(void 0===e&&(e=[]),e.push(i))})}finally{}if(void 0!==e)for(let t=0;t<e.length;t++){const{ngModule:n,providers:i}=e[t];pn(i,e=>this.processProvider(e,n,i||zs))}}this.injectorDefTypes.add(s);const a=_e(s)||(()=>new s);this.records.set(s,qs(a,Ys));const c=i.providers;if(null!=c&&!o){const t=e;pn(c,e=>this.processProvider(e,t,c))}return void 0!==r&&void 0!==e.providers}processProvider(e,t,n){let i=Js(e=p(e))?e:p(e&&e.provide);const r=function(e,t,n){return Gs(e)?qs(void 0,e.useValue):qs(Us(e),Ys)}(e);if(Js(e)||!0!==e.multi)this.records.get(i);else{let t=this.records.get(i);t||(t=qs(void 0,Ys,!0),t.factory=()=>On(t.multi),this.records.set(i,t)),i=e,t.multi.push(e)}this.records.set(i,r)}hydrate(e,t){var n;return t.value===Ys&&(t.value=Ns,t.value=t.factory()),"object"==typeof t.value&&t.value&&null!==(n=t.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){return!!e.providedIn&&("string"==typeof e.providedIn?"any"===e.providedIn||e.providedIn===this.scope:this.injectorDefTypes.has(e.providedIn))}}function Bs(e){const t=S(e),n=null!==t?t.factory:_e(e);if(null!==n)return n;if(e instanceof un)throw new Error(`Token ${u(e)} is missing a \u0275prov definition.`);if(e instanceof Function)return function(e){const t=e.length;if(t>0){const n=gn(t,"?");throw new Error(`Can't resolve all parameters for ${u(e)}: (${n.join(", ")}).`)}const n=function(e){const t=e&&(e[T]||e[C]);if(t){const n=function(e){if(e.hasOwnProperty("name"))return e.name;const t=(""+e).match(/^function\s*([^\s(]+)/);return null===t?"":t[1]}(e);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),t}return null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new Error("unreachable")}function Us(e,t,n){let i;if(Js(e)){const t=p(e);return _e(t)||Bs(t)}if(Gs(e))i=()=>p(e.useValue);else if((r=e)&&r.useFactory)i=()=>e.useFactory(...On(e.deps||[]));else if(function(e){return!(!e||!e.useExisting)}(e))i=()=>Cn(p(e.useExisting));else{const t=p(e&&(e.useClass||e.provide));if(!function(e){return!!e.deps}(e))return _e(t)||Bs(t);i=()=>new t(...On(e.deps))}var r;return i}function qs(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Gs(e){return null!==e&&"object"==typeof e&&xn in e}function Js(e){return"function"==typeof e}const Ks=function(e,t,n){return function(e,t=null,n=null,i){const r=Xs(e,t,n,i);return r._resolveInjectorDefTypes(),r}({name:n},t,e,n)};let Qs=(()=>{class e{static create(e,t){return Array.isArray(e)?Ks(e,t,""):Ks(e.providers,e.parent,e.name||"")}}return e.THROW_IF_NOT_FOUND=wn,e.NULL=new Ws,e.\u0275prov=w({token:e,providedIn:"any",factory:()=>Cn(Fs)}),e.__NG_ELEMENT_ID__=-1,e})();function Zs(e,t){Dt(Fe(e)[1],Ue())}function eo(e){let t=Object.getPrototypeOf(e.type.prototype).constructor,n=!0;const i=[e];for(;t;){let r;if(ge(e))r=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Error("Directives cannot inherit Components");r=t.\u0275dir}if(r){if(n){i.push(r);const t=e;t.inputs=to(e.inputs),t.declaredInputs=to(e.declaredInputs),t.outputs=to(e.outputs);const n=r.hostBindings;n&&ro(e,n);const s=r.viewQuery,o=r.contentQueries;if(s&&no(e,s),o&&io(e,o),l(e.inputs,r.inputs),l(e.declaredInputs,r.declaredInputs),l(e.outputs,r.outputs),ge(r)&&r.data.animation){const t=e.data;t.animation=(t.animation||[]).concat(r.data.animation)}}const t=r.features;if(t)for(let i=0;i<t.length;i++){const r=t[i];r&&r.ngInherit&&r(e),r===eo&&(n=!1)}}t=Object.getPrototypeOf(t)}!function(e){let t=0,n=null;for(let i=e.length-1;i>=0;i--){const r=e[i];r.hostVars=t+=r.hostVars,r.hostAttrs=It(r.hostAttrs,n=It(n,r.hostAttrs))}}(i)}function to(e){return e===$?{}:e===X?[]:e}function no(e,t){const n=e.viewQuery;e.viewQuery=n?(e,i)=>{t(e,i),n(e,i)}:t}function io(e,t){const n=e.contentQueries;e.contentQueries=n?(e,i,r)=>{t(e,i,r),n(e,i,r)}:t}function ro(e,t){const n=e.hostBindings;e.hostBindings=n?(e,i)=>{t(e,i),n(e,i)}:t}let so=null;function oo(){if(!so){const e=z.Symbol;if(e&&e.iterator)so=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const n=e[t];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(so=n)}}}return so}class ao{constructor(e){this.wrapped=e}static wrap(e){return new ao(e)}static unwrap(e){return ao.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof ao}}function co(e){return!!lo(e)&&(Array.isArray(e)||!(e instanceof Map)&&oo()in e)}function lo(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function uo(e,t,n){return e[t]=n}function ho(e,t){return e[t]}function fo(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function po(e,t,n,i){const r=fo(e,t,n);return fo(e,t+1,i)||r}function mo(e,t,n,i,r){const s=po(e,t,n,i);return fo(e,t+2,r)||s}function bo(e,t,n,i,r,s){const o=po(e,t,n,i);return po(e,t+2,r,s)||o}function go(e,t,n,i){const r=Xe();return fo(r,it(),t)&&(Ve(),function(e,t,n,i,r,s){const o=Ae(e,t);gs(t[11],o,s,e.value,n,i,r)}(wt(),r,e,t,n,i)),go}function _o(e,t,n,i){return fo(e,it(),n)?t+g(n)+i:Wr}function vo(e,t,n,i,r,s){const o=po(e,nt(),n,r);return rt(2),o?t+g(n)+i+g(r)+s:Wr}function yo(e,t,n,i,r,s,o,a){const c=Xe(),l=Ve(),u=e+ue,d=l.firstCreatePass?function(e,t,n,i,r,s,o,a,c){const l=t.consts,u=qr(t,e,4,o||null,Ye(l,a));ls(t,n,u,Ye(l,c)),Dt(t,u);const d=u.tViews=ss(2,u,i,r,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,l);return null!==t.queries&&(t.queries.template(t,u),d.queries=t.queries.embeddedTView(u)),u}(u,l,c,t,n,i,r,s,o):l.data[u];Je(d,!1);const h=c[11].createComment("");mr(l,c,h,d),Wi(h,c),xs(c,c[u]=ys(h,c,h,d)),be(d)&&ns(l,c,d),null!=o&&is(c,d,a)}function wo(e){return Re($e.lFrame.contextLView,ue+e)}function Do(e,t=L.Default){const n=Xe();return null===n?Cn(e,t):qt(Ue(),n,p(e),t)}function So(e,t,n){const i=Xe();return fo(i,it(),t)&&cs(Ve(),wt(),i,e,t,i[11],n,!1),So}function xo(e,t,n,i,r){const s=r?"class":"style";Is(e,n,t.inputs[s],s,i)}function ko(e,t,n,i){const r=Xe(),s=Ve(),o=ue+e,a=r[11],c=r[o]=Zi(a,t,$e.lFrame.currentNamespace),l=s.firstCreatePass?function(e,t,n,i,r,s,o){const a=t.consts,c=qr(t,e,2,r,Ye(a,s));return ls(t,n,c,Ye(a,o)),null!==c.attrs&&Ps(c,c.attrs,!1),null!==c.mergedAttrs&&Ps(c,c.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,r,0,t,n,i):s.data[o];Je(l,!0);const u=l.mergedAttrs;null!==u&&Lt(a,c,u);const d=l.classes;null!==d&&xr(a,c,d);const h=l.styles;null!==h&&Sr(a,c,h),64!=(64&l.flags)&&mr(s,r,c,l),0===$e.lFrame.elementDepthCount&&Wi(c,r),$e.lFrame.elementDepthCount++,be(l)&&(ns(s,r,l),ts(s,l,r)),null!==i&&is(r,l)}function To(){let e=Ue();Ke()?Qe():(e=e.parent,Je(e,!1));const t=e;$e.lFrame.elementDepthCount--;const n=Ve();n.firstCreatePass&&(Dt(n,e),pe(e)&&n.queries.elementEnd(e)),null!=t.classesWithoutHost&&function(e){return 0!=(16&e.flags)}(t)&&xo(n,t,Xe(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function(e){return 0!=(32&e.flags)}(t)&&xo(n,t,Xe(),t.stylesWithoutHost,!1)}function Mo(e,t,n,i){ko(e,t,n,i),To()}function Co(e,t,n){const i=Xe(),r=Ve(),s=e+ue,o=r.firstCreatePass?function(e,t,n,i,r){const s=t.consts,o=Ye(s,i),a=qr(t,e,8,"ng-container",o);return null!==o&&Ps(a,o,!0),ls(t,n,a,Ye(s,r)),null!==t.queries&&t.queries.elementStart(t,a),a}(s,r,i,t,n):r.data[s];Je(o,!0);const a=i[s]=i[11].createComment("");mr(r,i,a,o),Wi(a,i),be(o)&&(ns(r,i,o),ts(r,o,i)),null!=n&&is(i,o)}function Oo(){let e=Ue();const t=Ve();Ke()?Qe():(e=e.parent,Je(e,!1)),t.firstCreatePass&&(Dt(t,e),pe(e)&&t.queries.elementEnd(e))}function Lo(e,t,n){Co(e,t,n),Oo()}function Eo(){return Xe()}function Ao(e){return!!e&&"function"==typeof e.then}function Io(e){return!!e&&"function"==typeof e.subscribe}const Ro=Io;function Po(e,t,n=!1,i){const r=Xe(),s=Ve(),o=Ue();return function(e,t,n,i,r,s,o=!1,a){const c=be(i),l=e.firstCreatePass&&Es(e),u=Ls(t);let d=!0;if(3&i.type){const h=Ae(i,t),f=a?a(h):$,p=f.target||h,m=u.length,b=a?e=>a(Le(e[i.index])).target:i.index;if(Ce(n)){let o=null;if(!a&&c&&(o=function(e,t,n,i){const r=e.cleanup;if(null!=r)for(let s=0;s<r.length-1;s+=2){const e=r[s];if(e===n&&r[s+1]===i){const e=t[7],n=r[s+2];return e.length>n?e[n]:null}"string"==typeof e&&(s+=2)}return null}(e,t,r,i.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=s,o.__ngLastListenerFn__=s,d=!1;else{s=Wo(i,t,0,s,!1);const e=n.listen(f.name||p,r,s);u.push(s,e),l&&l.push(r,b,m,m+1)}}else s=Wo(i,t,0,s,!0),p.addEventListener(r,s,o),u.push(s),l&&l.push(r,b,m,o)}else s=Wo(i,t,0,s,!1);const h=i.outputs;let f;if(d&&null!==h&&(f=h[r])){const e=f.length;if(e)for(let n=0;n<e;n+=2){const e=t[f[n]][f[n+1]].subscribe(s),o=u.length;u.push(s,e),l&&l.push(r,i.index,o,-(o+1))}}}(s,r,r[11],o,e,t,n,i),Po}function Fo(e,t,n,i){try{return!1!==n(i)}catch(r){return As(e,r),!1}}function Wo(e,t,n,i,r){return function n(s){if(s===Function)return i;const o=2&e.flags?Pe(e.index,t):t;0==(32&t[2])&&ks(o);let a=Fo(t,0,i,s),c=n.__ngNextListenerFn__;for(;c;)a=Fo(t,0,c,s)&&a,c=c.__ngNextListenerFn__;return r&&!1===a&&(s.preventDefault(),s.returnValue=!1),a}}function jo(e=1){return function(e){return($e.lFrame.contextLView=function(e,t){for(;e>0;)t=t[15],e--;return t}(e,$e.lFrame.contextLView))[8]}(e)}function Yo(e,t){let n=null;const i=function(e){const t=e.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(e);for(let r=0;r<t.length;r++){const s=t[r];if("*"!==s){if(null===i?Ir(e,s,!0):Rr(i,s))return r}else n=r}return n}function No(e){const t=Xe()[16][6];if(!t.projection){const n=t.projection=gn(e?e.length:1,null),i=n.slice();let r=t.child;for(;null!==r;){const t=e?Yo(r,e):0;null!==t&&(i[t]?i[t].projectionNext=r:n[t]=r,i[t]=r),r=r.next}}}function zo(e,t=0,n){const i=Xe(),r=Ve(),s=qr(r,ue+e,16,null,n||null);null===s.projection&&(s.projection=t),Qe(),64!=(64&s.flags)&&function(e,t,n){Dr(t[11],0,t,n,rr(e,n,t),ur(n.parent||t[6],n,t))}(r,i,s)}function $o(e,t,n){return Ho(e,"",t,"",n),$o}function Ho(e,t,n,i,r){const s=Xe(),o=_o(s,t,n,i);return o!==Wr&&cs(Ve(),wt(),s,e,o,s[11],r,!1),Ho}function Xo(e,t,n,i,r,s,o){const a=Xe(),c=vo(a,t,n,i,r,s);return c!==Wr&&cs(Ve(),wt(),a,e,c,a[11],o,!1),Xo}function Vo(e,t,n,i,r){const s=e[n+1],o=null===t;let a=i?zr(s):Hr(s),c=!1;for(;0!==a&&(!1===c||o);){const n=e[a+1];Bo(e[a],t)&&(c=!0,e[a+1]=i?Vr(n):$r(n)),a=i?zr(n):Hr(n)}c&&(e[n+1]=i?$r(s):Vr(s))}function Bo(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&yn(e,t)>=0}const Uo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function qo(e){return e.substring(Uo.key,Uo.keyEnd)}function Go(e,t){const n=Uo.textEnd;return n===t?-1:(t=Uo.keyEnd=function(e,t,n){for(;t<n&&e.charCodeAt(t)>32;)t++;return t}(e,Uo.key=t,n),Jo(e,t,n))}function Jo(e,t,n){for(;t<n&&e.charCodeAt(t)<=32;)t++;return t}function Ko(e,t,n){return ta(e,t,n,!1),Ko}function Qo(e,t){return ta(e,t,null,!0),Qo}function Zo(e){na(_n,ea,e,!0)}function ea(e,t){for(let n=function(e){return function(e){Uo.key=0,Uo.keyEnd=0,Uo.value=0,Uo.valueEnd=0,Uo.textEnd=e.length}(e),Go(e,Jo(e,0,Uo.textEnd))}(t);n>=0;n=Go(t,n))_n(e,qo(t),!0)}function ta(e,t,n,i){const r=Xe(),s=Ve(),o=rt(2);s.firstUpdatePass&&ra(s,e,o,i),t!==Wr&&fo(r,o,t)&&aa(s,s.data[vt()],r,r[11],e,r[o+1]=function(e,t){return null==e||("string"==typeof t?e+=t:"object"==typeof e&&(e=u(Un(e)))),e}(t,n),i,o)}function na(e,t,n,i){const r=Ve(),s=rt(2);r.firstUpdatePass&&ra(r,null,s,i);const o=Xe();if(n!==Wr&&fo(o,s,n)){const a=r.data[vt()];if(ua(a,i)&&!ia(r,s)){let e=i?a.classesWithoutHost:a.stylesWithoutHost;null!==e&&(n=d(e,n||"")),xo(r,a,o,n,i)}else!function(e,t,n,i,r,s,o,a){r===Wr&&(r=H);let c=0,l=0,u=0<r.length?r[0]:null,d=0<s.length?s[0]:null;for(;null!==u||null!==d;){const h=c<r.length?r[c+1]:void 0,f=l<s.length?s[l+1]:void 0;let p,m=null;u===d?(c+=2,l+=2,h!==f&&(m=d,p=f)):null===d||null!==u&&u<d?(c+=2,m=u):(l+=2,m=d,p=f),null!==m&&aa(e,t,n,i,m,p,o,a),u=c<r.length?r[c]:null,d=l<s.length?s[l]:null}}(r,a,o,o[11],o[s+1],o[s+1]=function(e,t,n){if(null==n||""===n)return H;const i=[],r=Un(n);if(Array.isArray(r))for(let s=0;s<r.length;s++)e(i,r[s],!0);else if("object"==typeof r)for(const s in r)r.hasOwnProperty(s)&&e(i,s,r[s]);else"string"==typeof r&&t(i,r);return i}(e,t,n),i,s)}}function ia(e,t){return t>=e.expandoStartIndex}function ra(e,t,n,i){const r=e.data;if(null===r[n+1]){const s=r[vt()],o=ia(e,n);ua(s,i)&&null===t&&!o&&(t=!1),t=function(e,t,n,i){const r=ct(e);let s=i?t.residualClasses:t.residualStyles;if(null===r)0===(i?t.classBindings:t.styleBindings)&&(n=oa(n=sa(null,e,t,n,i),t.attrs,i),s=null);else{const o=t.directiveStylingLast;if(-1===o||e[o]!==r)if(n=sa(r,e,t,n,i),null===s){let n=function(e,t,n){const i=n?t.classBindings:t.styleBindings;if(0!==Hr(i))return e[zr(i)]}(e,t,i);void 0!==n&&Array.isArray(n)&&(n=sa(null,e,t,n[1],i),n=oa(n,t.attrs,i),function(e,t,n,i){e[zr(n?t.classBindings:t.styleBindings)]=i}(e,t,i,n))}else s=function(e,t,n){let i;const r=t.directiveEnd;for(let s=1+t.directiveStylingLast;s<r;s++)i=oa(i,e[s].hostAttrs,n);return oa(i,t.attrs,n)}(e,t,i)}return void 0!==s&&(i?t.residualClasses=s:t.residualStyles=s),n}(r,s,t,i),function(e,t,n,i,r,s){let o=s?t.classBindings:t.styleBindings,a=zr(o),c=Hr(o);e[i]=n;let l,u=!1;if(Array.isArray(n)){const e=n;l=e[1],(null===l||yn(e,l)>0)&&(u=!0)}else l=n;if(r)if(0!==c){const t=zr(e[a+1]);e[i+1]=Nr(t,a),0!==t&&(e[t+1]=Xr(e[t+1],i)),e[a+1]=131071&e[a+1]|i<<17}else e[i+1]=Nr(a,0),0!==a&&(e[a+1]=Xr(e[a+1],i)),a=i;else e[i+1]=Nr(c,0),0===a?a=i:e[c+1]=Xr(e[c+1],i),c=i;u&&(e[i+1]=$r(e[i+1])),Vo(e,l,i,!0),Vo(e,l,i,!1),function(e,t,n,i,r){const s=r?e.residualClasses:e.residualStyles;null!=s&&"string"==typeof t&&yn(s,t)>=0&&(n[i+1]=Vr(n[i+1]))}(t,l,e,i,s),o=Nr(a,c),s?t.classBindings=o:t.styleBindings=o}(r,s,t,n,o,i)}}function sa(e,t,n,i,r){let s=null;const o=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a<o&&(s=t[a],i=oa(i,s.hostAttrs,r),s!==e);)a++;return null!==e&&(n.directiveStylingLast=a),i}function oa(e,t,n){const i=n?1:2;let r=-1;if(null!==t)for(let s=0;s<t.length;s++){const o=t[s];"number"==typeof o?r=o:r===i&&(Array.isArray(e)||(e=void 0===e?[]:["",e]),_n(e,o,!!n||t[++s]))}return void 0===e?null:e}function aa(e,t,n,i,r,s,o,a){if(!(3&t.type))return;const c=e.data,l=c[a+1];la(1==(1&l)?ca(c,t,n,r,Hr(l),o):void 0)||(la(s)||2==(2&l)&&(s=ca(c,null,n,r,a,o)),function(e,t,n,i,r){const s=Ce(e);if(t)r?s?e.addClass(n,i):n.classList.add(i):s?e.removeClass(n,i):n.classList.remove(i);else{let t=-1===i.indexOf("-")?void 0:$i.DashCase;if(null==r)s?e.removeStyle(n,i,t):n.style.removeProperty(i);else{const o="string"==typeof r&&r.endsWith("!important");o&&(r=r.slice(0,-10),t|=$i.Important),s?e.setStyle(n,i,r,t):n.style.setProperty(i,r,o?"important":"")}}}(i,o,Ee(vt(),n),r,s))}function ca(e,t,n,i,r,s){const o=null===t;let a;for(;r>0;){const t=e[r],s=Array.isArray(t),c=s?t[1]:t,l=null===c;let u=n[r+1];u===Wr&&(u=l?H:void 0);let d=l?vn(u,i):c===i?u:void 0;if(s&&!la(d)&&(d=vn(t,i)),la(d)&&(a=d,o))return a;const h=e[r+1];r=o?zr(h):Hr(h)}if(null!==t){let e=s?t.residualClasses:t.residualStyles;null!=e&&(a=vn(e,i))}return a}function la(e){return void 0!==e}function ua(e,t){return 0!=(e.flags&(t?16:32))}function da(e,t=""){const n=Xe(),i=Ve(),r=e+ue,s=i.firstCreatePass?qr(i,r,1,t,null):i.data[r],o=n[r]=Ji(n[11],t);mr(i,n,o,s),Je(s,!1)}function ha(e){return fa("",e,""),ha}function fa(e,t,n){const i=Xe(),r=_o(i,e,t,n);return r!==Wr&&Rs(i,vt(),r),fa}function pa(e,t,n,i,r){const s=Xe(),o=vo(s,e,t,n,i,r);return o!==Wr&&Rs(s,vt(),o),pa}function ma(e,t,n,i,r,s,o){const a=Xe(),c=function(e,t,n,i,r,s,o,a){const c=mo(e,nt(),n,r,o);return rt(3),c?t+g(n)+i+g(r)+s+g(o)+a:Wr}(a,e,t,n,i,r,s,o);return c!==Wr&&Rs(a,vt(),c),ma}function ba(e,t,n){na(_n,ea,_o(Xe(),e,t,n),!0)}function ga(e,t,n,i,r){na(_n,ea,vo(Xe(),e,t,n,i,r),!0)}function _a(e,t,n,i,r,s,o,a,c){na(_n,ea,function(e,t,n,i,r,s,o,a,c,l){const u=bo(e,nt(),n,r,o,c);return rt(4),u?t+g(n)+i+g(r)+s+g(o)+a+g(c)+l:Wr}(Xe(),e,t,n,i,r,s,o,a,c),!0)}function va(e,t,n){const i=Xe();return fo(i,it(),t)&&cs(Ve(),wt(),i,e,t,i[11],n,!0),va}function ya(e,t,n){const i=Xe();if(fo(i,it(),t)){const r=Ve(),s=wt();cs(r,s,i,e,t,function(e,t,n){return(null===e||ge(e))&&(n=function(e){for(;Array.isArray(e);){if("object"==typeof e[1])return e;e=e[0]}return null}(n[t.index])),n[11]}(ct(r.data),s,i),n,!0)}return ya}const wa=void 0;var Da=["en",[["a","p"],["AM","PM"],wa],[["AM","PM"],wa,wa],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],wa,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],wa,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",wa,"{1} 'at' {0}",wa],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}];let Sa={};function xa(e,t,n){"string"!=typeof t&&(n=t,t=e[Oa.LocaleId]),t=t.toLowerCase().replace(/_/g,"-"),Sa[t]=e,n&&(Sa[t][Oa.ExtraData]=n)}function ka(e){const t=function(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=Ca(t);if(n)return n;const i=t.split("-")[0];if(n=Ca(i),n)return n;if("en"===i)return Da;throw new Error(`Missing locale data for the locale "${e}".`)}function Ta(e){return ka(e)[Oa.CurrencyCode]||null}function Ma(e){return ka(e)[Oa.PluralCase]}function Ca(e){return e in Sa||(Sa[e]=z.ng&&z.ng.common&&z.ng.common.locales&&z.ng.common.locales[e]),Sa[e]}var Oa=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}({});const La=["zero","one","two","few","many"],Ea="en-US",Aa={marker:"element"},Ia={marker:"ICU"};var Ra=function(e){return e[e.SHIFT=2]="SHIFT",e[e.APPEND_EAGERLY=1]="APPEND_EAGERLY",e[e.COMMENT=2]="COMMENT",e}({});let Pa=Ea;function Fa(e){var t;null==(t=e)&&y("Expected localeId to be defined",t,null,"!="),"string"==typeof e&&(Pa=e.toLowerCase().replace(/_/g,"-"))}function Wa(e,t,n){const i=t.insertBeforeIndex,r=Array.isArray(i)?i[0]:i;return null===r?dr(e,0,n):Le(n[r])}function ja(e,t,n,i,r){const s=t.insertBeforeIndex;if(Array.isArray(s)){let o=i,a=null;if(3&t.type||(a=o,o=r),null!==o&&0==(2&t.flags))for(let t=1;t<s.length;t++)or(e,o,n[s[t]],a,!1)}}function Ya(e,t){if(e.push(t),e.length>1)for(let n=e.length-2;n>=0;n--){const i=e[n];Na(i)||za(i,t)&&null===$a(i)&&Ha(i,t.index)}}function Na(e){return!(64&e.type)}function za(e,t){return Na(t)||e.index>t.index}function $a(e){const t=e.insertBeforeIndex;return Array.isArray(t)?t[0]:t}function Ha(e,t){const n=e.insertBeforeIndex;Array.isArray(n)?n[0]=t:(pr(Wa,ja),e.insertBeforeIndex=t)}function Xa(e,t){const n=e.data[t];return null===n||"string"==typeof n?null:n.hasOwnProperty("currentCaseLViewIndex")?n:n.value}function Va(e,t,n){const i=Gr(e,n,64,null,null);return Ya(t,i),i}function Ba(e,t){const n=t[e.currentCaseLViewIndex];return null===n?n:n<0?~n:n}let Ua=0,qa=0;function Ga(e,t,n,i){const r=n[11];let s,o=null;for(let a=0;a<t.length;a++){const c=t[a];if("string"==typeof c){const e=t[++a];null===n[e]&&(n[e]=Ji(r,c))}else if("number"==typeof c)switch(1&c){case 0:const l=c>>>17;let u,d;if(null===o&&(o=l,s=lr(r,i)),l===o?(u=i,d=s):(u=null,d=Le(n[l])),null!==d){const t=(131070&c)>>>1;or(r,d,n[t],u,!1);const i=Xa(e,t);if(null!==i&&"object"==typeof i){const t=Ba(i,n);null!==t&&Ga(e,i.create[t],n,n[i.anchorIdx])}}break;case 1:const h=t[++a],f=t[++a];gs(r,Ee(c>>>1,n),null,null,h,f,null);break;default:throw new Error(`Unable to determine the type of mutate operation for "${c}"`)}else switch(c){case Ia:const e=t[++a],i=t[++a];null===n[i]&&Wi(n[i]=Qi(r,e),n);break;case Aa:const s=t[++a],o=t[++a];null===n[o]&&Wi(n[o]=Zi(r,s,null),n)}}}function Ja(e,t,n,i,r){for(let s=0;s<n.length;s++){const o=n[s],a=n[++s];if(o&r){let r="";for(let o=s+1;o<=s+a;o++){const s=n[o];if("string"==typeof s)r+=s;else if("number"==typeof s)if(s<0)r+=g(t[i-s]);else{const a=s>>>2;switch(3&s){case 1:const s=n[++o],c=n[++o],l=e.data[a];"string"==typeof l?gs(t[11],t[a],null,l,s,r,c):cs(e,l,t,s,r,t[11],c,!1);break;case 0:const u=t[a];null!==u&&Ki(t[11],u,r);break;case 2:Qa(e,Xa(e,a),t,r);break;case 3:Ka(e,Xa(e,a),i,t)}}}}else{const r=n[s+1];if(r>0&&3==(3&r)){const n=Xa(e,r>>>2);t[n.currentCaseLViewIndex]<0&&Ka(e,n,i,t)}}s+=a}}function Ka(e,t,n,i){let r=i[t.currentCaseLViewIndex];if(null!==r){let s=Ua;r<0&&(r=i[t.currentCaseLViewIndex]=~r,s=-1),Ja(e,i,t.update[r],n,s)}}function Qa(e,t,n,i){const r=function(e,t){let n=e.cases.indexOf(t);if(-1===n)switch(e.type){case 1:{const i=function(e,t){const n=Ma(t)(parseInt(e,10)),i=La[n];return void 0!==i?i:"other"}(t,Pa);n=e.cases.indexOf(i),-1===n&&"other"!==i&&(n=e.cases.indexOf("other"));break}case 0:n=e.cases.indexOf("other")}return-1===n?null:n}(t,i);if(Ba(t,n)!==r&&(Za(e,t,n),n[t.currentCaseLViewIndex]=null===r?null:~r,null!==r)){const i=n[t.anchorIdx];i&&Ga(e,t.create[r],n,i)}}function Za(e,t,n){let i=Ba(t,n);if(null!==i){const r=t.remove[i];for(let t=0;t<r.length;t++){const i=r[t];if(i>0){const e=Ee(i,n);null!==e&&vr(n[11],e)}else Za(e,Xa(e,~i),n)}}}const ec=/\ufffd(\d+):?\d*\ufffd/gi,tc=/({\s*\ufffd\d+:?\d*\ufffd\s*,\s*\S{6}\s*,[\s\S]*})/gi,nc=/\ufffd(\d+)\ufffd/,ic=/^\s*(\ufffd\d+:?\d*\ufffd)\s*,\s*(select|plural)\s*,/,rc=/\ufffd\/?\*(\d+:\d+)\ufffd/gi,sc=/\ufffd(\/?[#*]\d+):?\d*\ufffd/gi,oc=/\uE500/g;function ac(e,t,n,i,r,s,o){const a=Jr(e,i,1,null);let c=a<<Ra.SHIFT,l=Ge();t===l&&(l=null),null===l&&(c|=Ra.APPEND_EAGERLY),o&&(c|=Ra.COMMENT,void 0===Hi&&(Hi=function(){const e=[];let t,n,i=-1;function r(e,t){i=0;const r=Ba(e,t);n=null!==r?e.remove[r]:X}function s(){if(i<n.length){const o=n[i++];return o>0?t[o]:(e.push(i,n),r(t[1].data[~o],t),s())}return 0===e.length?null:(n=e.pop(),i=e.pop(),s())}return function(n,i){for(t=i;e.length;)e.pop();return r(n.value,i),s}}())),r.push(c,null===s?"":s);const u=Gr(e,a,o?32:1,null===s?"":s,null);Ya(n,u);const d=u.index;return Je(u,!1),null!==l&&t!==l&&function(e,t){let n=e.insertBeforeIndex;var i;null===n?(pr(Wa,ja),n=e.insertBeforeIndex=[null,t]):("Expecting array here",(i=Array.isArray(n))!=!0&&y("Expecting array here",i,true,"=="),n.push(t))}(l,d),u}function cc(e,t,n,i,r,s,o){const a=o.match(ec),c=ac(e,t,n,s,i,a?null:o,!1);a&&lc(r,o,c.index,null,0,null)}function lc(e,t,n,i,r,s){const o=e.length,a=o+1;e.push(null,null);const c=o+2,l=t.split(ec);let u=0;for(let d=0;d<l.length;d++){const t=l[d];if(1&d){const n=r+parseInt(t,10);e.push(-1-n),u|=dc(n)}else""!==t&&e.push(t)}return e.push(n<<2|(i?1:0)),i&&e.push(i,s),e[o]=u,e[a]=e.length-c,u}function uc(e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];"number"==typeof i&&i<0&&t++}return t}function dc(e){return 1<<Math.min(e,31)}function hc(e){let t,n,i="",r=0,s=!1;for(;null!==(t=rc.exec(e));)s?t[0]===`\ufffd/*${n}\ufffd`&&(r=t.index,s=!1):(i+=e.substring(r,t.index+t[0].length),n=t[1],s=!0);return i+=e.substr(r),i}function fc(e,t,n,i,r,s){let o=0;const a={type:r.type,currentCaseLViewIndex:Jr(e,t,1,null),anchorIdx:s,cases:[],create:[],remove:[],update:[]};!function(e,t,n){e.push(dc(t.mainBinding),2,-1-t.mainBinding,n<<2|2)}(n,r,s),function(e,t,n){const i=e.data[t];null===i?e.data[t]=n:i.value=n}(e,s,a);const c=r.values;for(let l=0;l<c.length;l++){const s=c[l],u=[];for(let e=0;e<s.length;e++){const t=s[e];if("string"!=typeof t){const n=u.push(t)-1;s[e]=`\x3c!--\ufffd${n}\ufffd--\x3e`}}o=bc(e,a,t,n,i,r.cases[l],s.join(""),u)|o}o&&function(e,t,n){e.push(t,1,n<<2|3)}(n,o,s)}function pc(e){const t=[],n=[];let i=1,r=0;const s=mc(e=e.replace(ic,function(e,t,n){return i="select"===n?0:1,r=parseInt(t.substr(1),10),""}));for(let o=0;o<s.length;){let e=s[o++].trim();1===i&&(e=e.replace(/\s*(?:=)?(\w+)\s*/,"$1")),e.length&&t.push(e);const r=mc(s[o++]);t.length>n.length&&n.push(r)}return{type:i,mainBinding:r,cases:t,values:n}}function mc(e){if(!e)return[];let t=0;const n=[],i=[],r=/[{}]/g;let s;for(r.lastIndex=0;s=r.exec(e);){const r=s.index;if("}"==s[0]){if(n.pop(),0==n.length){const n=e.substring(t,r);ic.test(n)?i.push(pc(n)):i.push(n),t=r+1}}else{if(0==n.length){const n=e.substring(t,r);i.push(n),t=r+1}n.push("{")}}const o=e.substring(t);return i.push(o),i}function bc(e,t,n,i,r,s,o,a){const c=[],l=[],u=[];t.cases.push(s),t.create.push(c),t.remove.push(l),t.update.push(u);const d=ti(Me()).getInertBodyElement(o),h=ki(d)||d;return h?gc(e,t,n,i,c,l,u,h,r,a,0):0}function gc(e,t,n,i,r,s,o,a,c,l,u){let d=0,h=a.firstChild;for(;h;){const a=Jr(e,n,1,null);switch(h.nodeType){case Node.ELEMENT_NODE:const f=h,p=f.tagName.toLowerCase();if(pi.hasOwnProperty(p)){yc(r,Aa,p,c,a),e.data[a]=p;const m=f.attributes;for(let e=0;e<m.length;e++){const t=m.item(e),n=t.name.toLowerCase();t.value.match(ec)?gi.hasOwnProperty(n)&&lc(o,t.value,a,t.name,0,mi[n]?oi:bi[n]?ai:null):wc(r,a,t)}d=gc(e,t,n,i,r,s,o,h,a,l,u+1)|d,_c(s,a,u)}break;case Node.TEXT_NODE:const m=h.textContent||"",b=m.match(ec);yc(r,null,b?"":m,c,a),_c(s,a,u),b&&(d=lc(o,m,a,null,0,null)|d);break;case Node.COMMENT_NODE:const g=nc.exec(h.textContent||"");if(g){const t=l[parseInt(g[1],10)];yc(r,Ia,"",c,a),fc(e,n,i,c,t,a),vc(s,a,u)}}h=h.nextSibling}return d}function _c(e,t,n){0===n&&e.push(t)}function vc(e,t,n){0===n&&(e.push(~t),e.push(t))}function yc(e,t,n,i,r){null!==t&&e.push(t),e.push(n,r,0|i<<17|r<<1)}function wc(e,t,n){e.push(t<<1|1,n.name,n.value)}const Dc=/\[(\ufffd.+?\ufffd?)\]/,Sc=/\[(\ufffd.+?\ufffd?)\]|(\ufffd\/?\*\d+:\d+\ufffd)/g,xc=/({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g,kc=/{([A-Z0-9_]+)}/g,Tc=/\ufffdI18N_EXP_(ICU(_\d+)?)\ufffd/g,Mc=/\/\*/,Cc=/\d+\:(\d+)/;function Oc(e,t,n=-1){const i=Ve(),r=Xe(),s=ue+e,o=Ye(i.consts,t),a=Ge();i.firstCreatePass&&function(e,t,n,i,r,s){const o=Ge(),a=[],c=[],l=[[]],u=(d=r=function(e,t){if(function(e){return-1===e}(t))return hc(e);{const n=e.indexOf(`:${t}\ufffd`)+2+t.toString().length,i=e.search(new RegExp(`\ufffd\\/\\*\\d+:${t}\ufffd`));return hc(e.substring(n,i))}}(r,s),d.replace(oc," ")).split(sc);var d;for(let h=0;h<u.length;h++){let i=u[h];if(0==(1&h)){const s=mc(i);for(let i=0;i<s.length;i++){let u=s[i];if(0==(1&i)){const t=u;""!==t&&cc(e,o,l[0],a,c,n,t)}else{const i=u;if("object"!=typeof i)throw new Error(`Unable to parse ICU expression in "${r}" message.`);fc(e,n,c,t,i,ac(e,o,l[0],n,a,"",!0).index)}}}else{const t=47===i.charCodeAt(0),n=(i.charCodeAt(t?1:0),ue+Number.parseInt(i.substring(t?2:1)));if(t)l.shift(),Je(Ge(),!1);else{const t=Va(e,l[0],n);l.unshift([]),Je(t,!0)}}}e.data[i]={create:a,update:c}}(i,null===a?0:a.index,r,s,o,n);const c=i.data[s],l=sr(i,a===r[6]?null:a,r);!function(e,t,n,i){const r=e[11];for(let s=0;s<t.length;s++){const o=t[s++],a=t[s],c=(o&Ra.COMMENT)===Ra.COMMENT,l=(o&Ra.APPEND_EAGERLY)===Ra.APPEND_EAGERLY,u=o>>>Ra.SHIFT;let d=e[u];null===d&&(d=e[u]=c?r.createComment(a):Ji(r,a)),l&&null!==n&&or(r,n,d,i,!1)}}(r,c.create,l,a&&8&a.type?r[a.index]:null),st(!0)}function Lc(){st(!1)}function Ec(e,t,n){Oc(e,t,n),Lc()}function Ac(e,t){const n=Ve(),i=Ye(n.consts,t);!function(e,t,n){const i=Ue().index,r=[];if(e.firstCreatePass&&null===e.data[t]){for(let e=0;e<n.length;e+=2){const t=n[e],s=n[e+1];if(""!==s){if(tc.test(s))throw new Error(`ICU expressions are not supported in attributes. Message: "${s}".`);lc(r,s,i,t,uc(r),null)}}e.data[t]=r}}(n,e+ue,i)}function Ic(e){return fo(Xe(),it(),e)&&(Ua|=1<<Math.min(qa,31)),qa++,Ic}function Rc(e){!function(e,t,n){if(qa>0){const i=e.data[n];Ja(e,t,Array.isArray(i)?i:i.update,nt()-qa-1,Ua)}Ua=0,qa=0}(Ve(),Xe(),e+ue)}function Pc(e,t={}){return function(e,t={}){let n=e;if(Dc.test(e)){const e={},t=[0];n=n.replace(Sc,(n,i,r)=>{const s=i||r,o=e[s]||[];if(o.length||(s.split("|").forEach(e=>{const t=e.match(Cc),n=t?parseInt(t[1],10):0,i=Mc.test(e);o.push([n,i,e])}),e[s]=o),!o.length)throw new Error(`i18n postprocess: unmatched placeholder - ${s}`);const a=t[t.length-1];let c=0;for(let e=0;e<o.length;e++)if(o[e][0]===a){c=e;break}const[l,u,d]=o[c];return u?t.pop():a!==l&&t.push(l),o.splice(c,1),d})}return Object.keys(t).length?(n=n.replace(xc,(e,n,i,r,s,o)=>t.hasOwnProperty(i)?`${n}${t[i]}${o}`:e),n=n.replace(kc,(e,n)=>t.hasOwnProperty(n)?t[n]:e),n=n.replace(Tc,(e,n)=>{if(t.hasOwnProperty(n)){const i=t[n];if(!i.length)throw new Error(`i18n postprocess: unmatched ICU - ${e} with key: ${n}`);return i.shift()}return e}),n):n}(e,t)}function Fc(e,t,n,i,r){if(e=p(e),Array.isArray(e))for(let s=0;s<e.length;s++)Fc(e[s],t,n,i,r);else{const s=Ve(),o=Xe();let a=Js(e)?e:p(e.provide),c=Us(e);const l=Ue(),u=1048575&l.providerIndexes,d=l.directiveStart,h=l.providerIndexes>>20;if(Js(e)||!e.multi){const i=new Ot(c,r,Do),f=Yc(a,t,r?u:u+h,d);-1===f?(Vt(zt(l,o),s,a),Wc(s,e,t.length),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(i),o.push(i)):(n[f]=i,o[f]=i)}else{const f=Yc(a,t,u+h,d),p=Yc(a,t,u,u+h),m=f>=0&&n[f],b=p>=0&&n[p];if(r&&!b||!r&&!m){Vt(zt(l,o),s,a);const u=function(e,t,n,i,r){const s=new Ot(e,n,Do);return s.multi=[],s.index=t,s.componentProviders=0,jc(s,r,i&&!n),s}(r?zc:Nc,n.length,r,i,c);!r&&b&&(n[p].providerFactory=u),Wc(s,e,t.length,0),t.push(a),l.directiveStart++,l.directiveEnd++,r&&(l.providerIndexes+=1048576),n.push(u),o.push(u)}else Wc(s,e,f>-1?f:p,jc(n[r?p:f],c,!r&&i));!r&&i&&b&&n[p].componentProviders++}}}function Wc(e,t,n,i){const r=Js(t);if(r||t.useClass){const s=(t.useClass||t).prototype.ngOnDestroy;if(s){const o=e.destroyHooks||(e.destroyHooks=[]);if(!r&&t.multi){const e=o.indexOf(n);-1===e?o.push(n,[i,s]):o[e+1].push(i,s)}else o.push(n,s)}}}function jc(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Yc(e,t,n,i){for(let r=n;r<i;r++)if(t[r]===e)return r;return-1}function Nc(e,t,n,i){return $c(this.multi,[])}function zc(e,t,n,i){const r=this.multi;let s;if(this.providerFactory){const e=this.providerFactory.componentProviders,t=Zt(n,n[1],this.providerFactory.index,i);s=t.slice(0,e),$c(r,s);for(let n=e;n<t.length;n++)s.push(t[n])}else s=[],$c(r,s);return s}function $c(e,t){for(let n=0;n<e.length;n++)t.push((0,e[n])());return t}function Hc(e,t=[]){return n=>{n.providersResolver=(n,i)=>function(e,t,n){const i=Ve();if(i.firstCreatePass){const r=ge(e);Fc(n,i.data,i.blueprint,r,!0),Fc(t,i.data,i.blueprint,r,!1)}}(n,i?i(e):e,t)}}class Xc{}class Vc{}class Bc{resolveComponentFactory(e){throw function(e){const t=Error(`No component factory found for ${u(e)}. Did you add it to @NgModule.entryComponents?`);return t.ngComponent=e,t}(e)}}let Uc=(()=>{class e{}return e.NULL=new Bc,e})();function qc(...e){}function Gc(e,t){return new Kc(Ae(e,t))}const Jc=function(){return Gc(Ue(),Xe())};let Kc=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=Jc,e})();function Qc(e){return e instanceof Kc?e.nativeElement:e}class Zc{}let el=(()=>{class e{}return e.__NG_ELEMENT_ID__=()=>tl(),e})();const tl=function(){const e=Xe(),t=Pe(Ue().index,e);return function(e){return e[11]}(he(t)?t:e)};let nl=(()=>{class e{}return e.\u0275prov=w({token:e,providedIn:"root",factory:()=>null}),e})();class il{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const rl=new il("11.2.14");class sl{constructor(){}supports(e){return co(e)}create(e){return new al(e)}}const ol=(e,t)=>t;class al{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||ol}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,n=this._removalsHead,i=0,r=null;for(;t||n;){const s=!n||t&&t.currentIndex<dl(n,i,r)?t:n,o=dl(s,i,r),a=s.currentIndex;if(s===n)i--,n=n._nextRemoved;else if(t=t._next,null==s.previousIndex)i++;else{r||(r=[]);const e=o-i,t=a-i;if(e!=t){for(let n=0;n<e;n++){const i=n<r.length?r[n]:r[n]=0,s=i+n;t<=s&&s<e&&(r[n]=i+1)}r[s.previousIndex]=t-e}}o!==a&&e(s,o,a)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!co(e))throw new Error(`Error trying to diff '${u(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,n,i,r=this._itHead,s=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)n=e[t],i=this._trackByFn(t,n),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,n,i,t)),Object.is(r.item,n)||this._addIdentityChange(r,n)):(r=this._mismatch(r,n,i,t),s=!0),r=r._next}else t=0,function(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)t(e[n]);else{const n=e[oo()]();let i;for(;!(i=n.next()).done;)t(i.value)}}(e,e=>{i=this._trackByFn(t,e),null!==r&&Object.is(r.trackById,i)?(s&&(r=this._verifyReinsertion(r,e,i,t)),Object.is(r.item,e)||this._addIdentityChange(r,e)):(r=this._mismatch(r,e,i,t),s=!0),r=r._next,t++}),this.length=t;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,n,i){let r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,r,i)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(n,i))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,r,i)):e=this._addAfter(new cl(t,n),r,i),e}_verifyReinsertion(e,t,n,i){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?e=this._reinsertAfter(r,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const i=e._prevRemoved,r=e._nextRemoved;return null===i?this._removalsHead=r:i._nextRemoved=r,null===r?this._removalsTail=i:r._prevRemoved=i,this._insertAfter(e,t,n),this._addToMoves(e,n),e}_moveAfter(e,t,n){return this._unlink(e),this._insertAfter(e,t,n),this._addToMoves(e,n),e}_addAfter(e,t,n){return this._insertAfter(e,t,n),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,n){const i=null===t?this._itHead:t._next;return e._next=i,e._prev=t,null===i?this._itTail=e:i._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new ul),this._linkedRecords.put(e),e.currentIndex=n,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,n=e._next;return null===t?this._itHead=n:t._next=n,null===n?this._itTail=t:n._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new ul),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class cl{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class ll{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<=n.currentIndex)&&Object.is(n.trackById,e))return n;return null}remove(e){const t=e._prevDup,n=e._nextDup;return null===t?this._head=n:t._nextDup=n,null===n?this._tail=t:n._prevDup=t,null===this._head}}class ul{constructor(){this.map=new Map}put(e){const t=e.trackById;let n=this.map.get(t);n||(n=new ll,this.map.set(t,n)),n.add(e)}get(e,t){const n=this.map.get(e);return n?n.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function dl(e,t,n){const i=e.previousIndex;if(null===i)return i;let r=0;return n&&i<n.length&&(r=n[i]),i+t+r}class hl{constructor(){}supports(e){return e instanceof Map||lo(e)}create(){return new fl}}class fl{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||lo(e)))throw new Error(`Error trying to diff '${u(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,n)=>{if(t&&t.key===n)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const i=this._getOrCreateRecordForKey(n,e);t=this._insertBeforeOrAppend(t,i)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const n=e._prev;return t._next=e,t._prev=n,e._prev=t,n&&(n._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const n=this._records.get(e);this._maybeAddToChanges(n,t);const i=n._prev,r=n._next;return i&&(i._next=r),r&&(r._prev=i),n._next=null,n._prev=null,n}const n=new pl(e);return this._records.set(e,n),n.currentValue=t,this._addToAdditions(n),n}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(n=>t(e[n],n))}}class pl{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function ml(){return new bl([new sl])}let bl=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(null!=n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>e.create(t,n||ml()),deps:[[e,new In,new An]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${n=e,n.name||typeof n}'`);var n}}return e.\u0275prov=w({token:e,providedIn:"root",factory:ml}),e})();function gl(){return new _l([new hl])}let _l=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>e.create(t,n||gl()),deps:[[e,new In,new An]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.\u0275prov=w({token:e,providedIn:"root",factory:gl}),e})();function vl(e,t,n,i,r=!1){for(;null!==n;){const s=t[n.index];if(null!==s&&i.push(Le(s)),fe(s))for(let e=de;e<s.length;e++){const t=s[e],n=t[1].firstChild;null!==n&&vl(t[1],t,n,i)}const o=n.type;if(8&o)vl(e,t,n.child,i);else if(32&o){const e=Xi(n,t);let r;for(;r=e();)i.push(r)}else if(16&o){const e=gr(t,n);if(Array.isArray(e))i.push(...e);else{const n=Vi(t[16]);vl(n[1],n,e,i,!0)}}n=r?n.projectionNext:n.next}return i}class yl{constructor(e,t){this._lView=e,this._cdRefInjectingView=t,this._appRef=null,this._attachedToViewContainer=!1}get rootNodes(){const e=this._lView,t=e[1];return vl(t,e,t.firstChild,[])}get context(){return this._lView[8]}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[3];if(fe(e)){const t=e[8],n=t?t.indexOf(this):-1;n>-1&&(tr(e,n),bn(t,n))}this._attachedToViewContainer=!1}nr(this._lView[1],this._lView)}onDestroy(e){os(this._lView[1],this._lView,null,e)}markForCheck(){ks(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Ts(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(e,t,n){et(!0);try{Ts(e,t,n)}finally{et(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){var e;this._appRef=null,wr(this._lView[1],e=this._lView,e[11],2,null,null)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class wl extends yl{constructor(e){super(e),this._view=e}detectChanges(){Ms(this._view)}checkNoChanges(){!function(e){et(!0);try{Ms(e)}finally{et(!1)}}(this._view)}get context(){return null}}const Dl=xl;let Sl=(()=>{class e{}return e.__NG_ELEMENT_ID__=Dl,e.__ChangeDetectorRef__=!0,e})();function xl(e=!1){return function(e,t,n){if(!n&&me(e)){const n=Pe(e.index,t);return new yl(n,n)}return 47&e.type?new yl(t[16],t):null}(Ue(),Xe(),e)}const kl=[new hl],Tl=new bl([new sl]),Ml=new _l(kl),Cl=function(){return Al(Ue(),Xe())};let Ol=(()=>{class e{}return e.__NG_ELEMENT_ID__=Cl,e})();const Ll=Ol,El=class extends Ll{constructor(e,t,n){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=n}createEmbeddedView(e){const t=this._declarationTContainer.tViews,n=Ur(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const i=this._declarationLView[19];return null!==i&&(n[19]=i.createEmbeddedView(t)),Kr(t,n,e),new yl(n)}};function Al(e,t){return 4&e.type?new El(t,e,Gc(e,t)):null}class Il{}class Rl{}const Pl=function(){return zl(Ue(),Xe())};let Fl=(()=>{class e{}return e.__NG_ELEMENT_ID__=Pl,e})();const Wl=Fl,jl=class extends Wl{constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=n}get element(){return Gc(this._hostTNode,this._hostLView)}get injector(){return new nn(this._hostTNode,this._hostLView)}get parentInjector(){const e=Xt(this._hostTNode,this._hostLView);if(Pt(e)){const t=Wt(e,this._hostLView),n=Ft(e);return new nn(t[1].data[n+8],t)}return new nn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=Yl(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-de}createEmbeddedView(e,t,n){const i=e.createEmbeddedView(t||{});return this.insert(i,n),i}createComponent(e,t,n,i,r){const s=n||this.parentInjector;if(!r&&null==e.ngModule&&s){const e=s.get(Il,null);e&&(r=e)}const o=e.create(s,i,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){const n=e._lView,i=n[1];if(fe(n[3])){const t=this.indexOf(e);if(-1!==t)this.detach(t);else{const t=n[3],i=new jl(t,t[6],t[3]);i.detach(i.indexOf(e))}}const r=this._adjustIndex(t),s=this._lContainer;!function(e,t,n,i){const r=de+i,s=n.length;i>0&&(n[r-1][4]=t),i<s-de?(t[4]=n[r],mn(n,de+i,t)):(n.push(t),t[4]=null),t[3]=n;const o=t[17];null!==o&&n!==o&&function(e,t){const n=e[9];t[16]!==t[3][3][16]&&(e[2]=!0),null===n?e[9]=[t]:n.push(t)}(o,t);const a=t[19];null!==a&&a.insertView(e),t[2]|=128}(i,n,s,r);const o=_r(r,s),a=n[11],c=lr(a,s[7]);return null!==c&&function(e,t,n,i,r,s){i[0]=r,i[6]=t,wr(e,i,n,1,r,s)}(i,s[6],a,n,c,o),e.attachToViewContainerRef(),mn(Nl(s),r,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=Yl(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),n=tr(this._lContainer,t);n&&(bn(Nl(this._lContainer),t),nr(n[1],n))}detach(e){const t=this._adjustIndex(e,-1),n=tr(this._lContainer,t);return n&&null!=bn(Nl(this._lContainer),t)?new yl(n):null}_adjustIndex(e,t=0){return null==e?this.length+t:e}};function Yl(e){return e[8]}function Nl(e){return e[8]||(e[8]=[])}function zl(e,t){let n;const i=t[e.index];if(fe(i))n=i;else{let r;if(8&e.type)r=Le(i);else{const n=t[11];r=n.createComment("");const i=Ae(e,t);or(n,lr(n,i),r,function(e,t){return Ce(e)?e.nextSibling(t):t.nextSibling}(n,i),!1)}t[e.index]=n=ys(i,t,r,e),xs(t,n)}return new jl(n,e,t)}const $l={};class Hl extends Uc{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=ce(e);return new Bl(t,this.ngModule)}}function Xl(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}const Vl=new un("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>ji});class Bl extends Vc{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=e.selectors.map(Fr).join(","),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return Xl(this.componentDef.inputs)}get outputs(){return Xl(this.componentDef.outputs)}create(e,t,n,i){const r=(i=i||this.ngModule)?function(e,t){return{get:(n,i,r)=>{const s=e.get(n,$l,r);return s!==$l||i===$l?s:t.get(n,i,r)}}}(e,i.injector):e,s=r.get(Zc,Oe),o=r.get(nl,null),a=s.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",l=n?function(e,t,n){if(Ce(e))return e.selectRootElement(t,n===F.ShadowDom);let i="string"==typeof t?e.querySelector(t):t;return i.textContent="",i}(a,n,this.componentDef.encapsulation):Zi(s.createRenderer(null,this.componentDef),c,function(e){const t=e.toLowerCase();return"svg"===t?"http://www.w3.org/2000/svg":"math"===t?"http://www.w3.org/1998/MathML/":null}(c)),u=this.componentDef.onPush?576:528,d={components:[],scheduler:ji,clean:Os,playerHandler:null,flags:0},h=ss(0,null,null,1,0,null,null,null,null,null),f=Ur(null,h,d,u,null,null,s,a,o,r);let p,m;ft(f);try{const e=function(e,t,n,i,r,s){const o=n[1];n[20]=e;const a=qr(o,20,2,"#host",null),c=a.mergedAttrs=t.hostAttrs;null!==c&&(Ps(a,c,!0),null!==e&&(Lt(r,e,c),null!==a.classes&&xr(r,e,a.classes),null!==a.styles&&Sr(r,e,a.styles)));const l=i.createRenderer(e,t),u=Ur(n,rs(t),null,t.onPush?64:16,n[20],a,i,l,null,null);return o.firstCreatePass&&(Vt(zt(a,n),o,t.type),hs(o,a),ps(a,n.length,1)),xs(n,u),n[20]=u}(l,this.componentDef,f,s,a);if(l)if(n)Lt(a,l,["ng-version",rl.full]);else{const{attrs:e,classes:t}=function(e){const t=[],n=[];let i=1,r=2;for(;i<e.length;){let s=e[i];if("string"==typeof s)2===r?""!==s&&t.push(s,e[++i]):8===r&&n.push(s);else{if(!Er(r))break;r=s}i++}return{attrs:t,classes:n}}(this.componentDef.selectors[0]);e&&Lt(a,l,e),t&&t.length>0&&xr(a,l,t.join(" "))}if(m=Ie(h,ue),void 0!==t){const e=m.projection=[];for(let n=0;n<this.ngContentSelectors.length;n++){const i=t[n];e.push(null!=i?Array.from(i):null)}}p=function(e,t,n,i,r){const s=n[1],o=function(e,t,n){const i=Ue();e.firstCreatePass&&(n.providersResolver&&n.providersResolver(n),ms(e,i,t,Jr(e,t,1,null),n));const r=Zt(t,e,i.directiveStart,i);Wi(r,t);const s=Ae(i,t);return s&&Wi(s,t),r}(s,n,t);if(i.components.push(o),e[8]=o,r&&r.forEach(e=>e(o,t)),t.contentQueries){const e=Ue();t.contentQueries(1,o,e.directiveStart)}const a=Ue();return!s.firstCreatePass||null===t.hostBindings&&null===t.hostAttrs||(yt(a.index),us(n[1],a,0,a.directiveStart,a.directiveEnd,t),ds(t,o)),o}(e,this.componentDef,f,d,[Zs]),Kr(h,f,null)}finally{_t()}return new Ul(this.componentType,p,Gc(m,f),f,m)}}class Ul extends Xc{constructor(e,t,n,i,r){super(),this.location=n,this._rootLView=i,this._tNode=r,this.instance=t,this.hostView=this.changeDetectorRef=new wl(i),this.componentType=e}get injector(){return new nn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const ql=new Map;class Gl extends Il{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Hl(this);const n=le(e),i=e[G]||null;i&&Fa(i),this._bootstrapComponents=zi(n.bootstrap),this._r3Injector=Xs(e,t,[{provide:Il,useValue:this},{provide:Uc,useValue:this.componentFactoryResolver}],u(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Qs.THROW_IF_NOT_FOUND,n=L.Default){return e===Qs||e===Il||e===Fs?this:this._r3Injector.get(e,t,n)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class Jl extends Rl{constructor(e){super(),this.moduleType=e,null!==le(e)&&function(e){const t=new Set;!function e(n){const i=le(n,!0),r=i.id;null!==r&&(function(e,t,n){if(t&&t!==n)throw new Error(`Duplicate module registered for ${e} - ${u(t)} vs ${u(t.name)}`)}(r,ql.get(r),n),ql.set(r,n));const s=zi(i.imports);for(const o of s)t.has(o)||(t.add(o),e(o))}(e)}(e)}create(e){return new Gl(this.moduleType,e)}}function Kl(e,t,n){const i=tt()+e,r=Xe();return r[i]===Wr?uo(r,i,n?t.call(n):t()):ho(r,i)}function Ql(e,t,n,i){return ru(Xe(),tt(),e,t,n,i)}function Zl(e,t,n,i,r){return su(Xe(),tt(),e,t,n,i,r)}function eu(e,t,n,i,r,s){return ou(Xe(),tt(),e,t,n,i,r,s)}function tu(e,t,n,i,r,s,o){return function(e,t,n,i,r,s,o,a,c){const l=t+n;return bo(e,l,r,s,o,a)?uo(e,l+4,c?i.call(c,r,s,o,a):i(r,s,o,a)):iu(e,l+4)}(Xe(),tt(),e,t,n,i,r,s,o)}function nu(e,t,n,i,r,s,o,a){const c=tt()+e,l=Xe(),u=bo(l,c,n,i,r,s);return fo(l,c+4,o)||u?uo(l,c+5,a?t.call(a,n,i,r,s,o):t(n,i,r,s,o)):ho(l,c+5)}function iu(e,t){const n=e[t];return n===Wr?void 0:n}function ru(e,t,n,i,r,s){const o=t+n;return fo(e,o,r)?uo(e,o+1,s?i.call(s,r):i(r)):iu(e,o+1)}function su(e,t,n,i,r,s,o){const a=t+n;return po(e,a,r,s)?uo(e,a+2,o?i.call(o,r,s):i(r,s)):iu(e,a+2)}function ou(e,t,n,i,r,s,o,a){const c=t+n;return mo(e,c,r,s,o)?uo(e,c+3,a?i.call(a,r,s,o):i(r,s,o)):iu(e,c+3)}function au(e,t){const n=Ve();let i;const r=e+ue;n.firstCreatePass?(i=function(e,t){if(t)for(let n=t.length-1;n>=0;n--){const i=t[n];if(e===i.name)return i}throw new b("302",`The pipe '${e}' could not be found!`)}(t,n.pipeRegistry),n.data[r]=i,i.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,i.onDestroy)):i=n.data[r];const s=i.factory||(i.factory=_e(i.type)),o=A(Do);try{const e=Yt(!1),t=s();return Yt(e),function(e,t,n,i){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=i}(n,Xe(),r,t),t}finally{A(o)}}function cu(e,t,n){const i=e+ue,r=Xe(),s=Re(r,i);return hu(r,du(r,i)?ru(r,tt(),t,s.transform,n,s):s.transform(n))}function lu(e,t,n,i){const r=e+ue,s=Xe(),o=Re(s,r);return hu(s,du(s,r)?su(s,tt(),t,o.transform,n,i,o):o.transform(n,i))}function uu(e,t,n,i,r){const s=e+ue,o=Xe(),a=Re(o,s);return hu(o,du(o,s)?ou(o,tt(),t,a.transform,n,i,r,a):a.transform(n,i,r))}function du(e,t){return e[1].data[t].pure}function hu(e,t){return ao.isWrapped(t)&&(t=ao.unwrap(t),e[nt()]=Wr),t}function fu(e){return t=>{setTimeout(e,void 0,t)}}const pu=class extends i.a{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,n){var i,s,o;let a=e,c=t||(()=>null),l=n;if(e&&"object"==typeof e){const t=e;a=null===(i=t.next)||void 0===i?void 0:i.bind(t),c=null===(s=t.error)||void 0===s?void 0:s.bind(t),l=null===(o=t.complete)||void 0===o?void 0:o.bind(t)}this.__isAsync&&(c=fu(c),a&&(a=fu(a)),l&&(l=fu(l)));const u=super.subscribe({next:a,error:c,complete:l});return e instanceof r.a&&e.add(u),u}};function mu(){return this._results[oo()]()}class bu{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=oo(),n=bu.prototype;n[t]||(n[t]=mu)}get changes(){return this._changes||(this._changes=new pu)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const n=this;n.dirty=!1;const i=fn(e);(this._changesDetected=!function(e,t,n){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=t[i];if(n&&(r=n(r),s=n(s)),s!==r)return!1}return!0}(n._results,i,t))&&(n._results=i,n.length=i.length,n.last=i[this.length-1],n.first=i[0])}notifyOnChanges(){!this._changes||!this._changesDetected&&this._emitDistinctChangesOnly||this._changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class gu{constructor(e){this.queryList=e,this.matches=null}clone(){return new gu(this.queryList)}setDirty(){this.queryList.setDirty()}}class _u{constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const n=null!==e.contentQueries?e.contentQueries[0]:t.length,i=[];for(let e=0;e<n;e++){const n=t.getByIndex(e);i.push(this.queries[n.indexInDeclarationView].clone())}return new _u(i)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)null!==Au(e,t).matches&&this.queries[t].setDirty()}}class vu{constructor(e,t,n=null){this.predicate=e,this.flags=t,this.read=n}}class yu{constructor(e=[]){this.queries=e}elementStart(e,t){for(let n=0;n<this.queries.length;n++)this.queries[n].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let n=0;n<this.length;n++){const i=null!==t?t.length:0,r=this.getByIndex(n).embeddedTView(e,i);r&&(r.indexInDeclarationView=n,null!==t?t.push(r):t=[r])}return null!==t?new yu(t):null}template(e,t){for(let n=0;n<this.queries.length;n++)this.queries[n].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}}class wu{constructor(e,t=-1){this.metadata=e,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new wu(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&1!=(1&this.metadata.flags)){const t=this._declarationNodeIndex;let n=e.parent;for(;null!==n&&8&n.type&&n.index!==t;)n=n.parent;return t===(null!==n?n.index:-1)}return this._appliesToNextNode}matchTNode(e,t){const n=this.metadata.predicate;if(Array.isArray(n))for(let i=0;i<n.length;i++){const r=n[i];this.matchTNodeWithReadOption(e,t,Du(t,r)),this.matchTNodeWithReadOption(e,t,Qt(t,e,r,!1,!1))}else n===Ol?4&t.type&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,Qt(t,e,n,!1,!1))}matchTNodeWithReadOption(e,t,n){if(null!==n){const i=this.metadata.read;if(null!==i)if(i===Kc||i===Fl||i===Ol&&4&t.type)this.addMatch(t.index,-2);else{const n=Qt(t,e,i,!1,!1);null!==n&&this.addMatch(t.index,n)}else this.addMatch(t.index,n)}}addMatch(e,t){null===this.matches?this.matches=[e,t]:this.matches.push(e,t)}}function Du(e,t){const n=e.localNames;if(null!==n)for(let i=0;i<n.length;i+=2)if(n[i]===t)return n[i+1];return null}function Su(e,t,n,i){return-1===n?function(e,t){return 11&e.type?Gc(e,t):4&e.type?Al(e,t):null}(t,e):-2===n?function(e,t,n){return n===Kc?Gc(t,e):n===Ol?Al(t,e):n===Fl?zl(t,e):void 0}(e,t,i):Zt(e,e[1],n,t)}function xu(e,t,n,i){const r=t[19].queries[i];if(null===r.matches){const i=e.data,s=n.matches,o=[];for(let e=0;e<s.length;e+=2){const r=s[e];o.push(r<0?null:Su(t,i[r],s[e+1],n.metadata.read))}r.matches=o}return r.matches}function ku(e,t,n,i){const r=e.queries.getByIndex(n),s=r.matches;if(null!==s){const o=xu(e,t,r,n);for(let e=0;e<s.length;e+=2){const n=s[e];if(n>0)i.push(o[e/2]);else{const r=s[e+1],o=t[-n];for(let e=de;e<o.length;e++){const t=o[e];t[17]===t[3]&&ku(t[1],t,r,i)}if(null!==o[9]){const e=o[9];for(let t=0;t<e.length;t++){const n=e[t];ku(n[1],n,r,i)}}}}}return i}function Tu(e){const t=Xe(),n=Ve(),i=lt();ut(i+1);const r=Au(n,i);if(e.dirty&&We(t)===(2==(2&r.metadata.flags))){if(null===r.matches)e.reset([]);else{const s=r.crossesNgTemplate?ku(n,t,i,[]):xu(n,t,r,i);e.reset(s,Qc),e.notifyOnChanges()}return!0}return!1}function Mu(e,t,n){const i=Ve();i.firstCreatePass&&(Eu(i,new vu(e,t,n),-1),2==(2&t)&&(i.staticViewQueries=!0)),Lu(i,Xe(),t)}function Cu(e,t,n,i){const r=Ve();if(r.firstCreatePass){const s=Ue();Eu(r,new vu(t,n,i),s.index),function(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(n.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(r,e),2==(2&n)&&(r.staticContentQueries=!0)}Lu(r,Xe(),n)}function Ou(){return e=Xe(),t=lt(),e[19].queries[t].queryList;var e,t}function Lu(e,t,n){const i=new bu(4==(4&n));os(e,t,i,i.destroy),null===t[19]&&(t[19]=new _u),t[19].queries.push(new gu(i))}function Eu(e,t,n){null===e.queries&&(e.queries=new yu),e.queries.track(new wu(t,n))}function Au(e,t){return e.queries.getByIndex(t)}function Iu(e,t){return Al(e,t)}function Ru(e=L.Default){const t=xl(!0);if(null!=t||e&L.Optional)return t;v("ChangeDetectorRef")}const Pu=new un("Application Initializer");let Fu=(()=>{class e{constructor(e){this.appInits=e,this.resolve=qc,this.reject=qc,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const t=this.appInits[n]();Ao(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}return e.\u0275fac=function(t){return new(t||e)(Cn(Pu,8))},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();const Wu=new un("AppId"),ju={provide:Wu,useFactory:function(){return`${Yu()}${Yu()}${Yu()}`},deps:[]};function Yu(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Nu=new un("Platform Initializer"),zu=new un("Platform ID"),$u=new un("appBootstrapListener");let Hu=(()=>{class e{log(e){console.log(e)}warn(e){console.warn(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();const Xu=new un("LocaleId"),Vu=new un("DefaultCurrencyCode");class Bu{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const Uu=function(e){return new Jl(e)},qu=Uu,Gu=function(e){return Promise.resolve(Uu(e))},Ju=function(e){const t=Uu(e),n=zi(le(e).declarations).reduce((e,t)=>{const n=ce(t);return n&&e.push(new Bl(n)),e},[]);return new Bu(t,n)},Ku=Ju,Qu=function(e){return Promise.resolve(Ju(e))};let Zu=(()=>{class e{constructor(){this.compileModuleSync=qu,this.compileModuleAsync=Gu,this.compileModuleAndAllComponentsSync=Ku,this.compileModuleAndAllComponentsAsync=Qu}clearCache(){}clearCacheFor(e){}getModuleId(e){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();const ed=(()=>Promise.resolve(0))();function td(e){"undefined"==typeof Zone?ed.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class nd{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new pu(!1),this.onMicrotaskEmpty=new pu(!1),this.onStable=new pu(!1),this.onError=new pu(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const i=this;i._nesting=0,i._outer=i._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(i._inner=i._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(i._inner=i._inner.fork(Zone.longStackTraceZoneSpec)),i.shouldCoalesceEventChangeDetection=!n&&t,i.shouldCoalesceRunChangeDetection=n,i.lastRequestAnimationFrameId=-1,i.nativeRequestAnimationFrame=function(){let e=z.requestAnimationFrame,t=z.cancelAnimationFrame;if("undefined"!=typeof Zone&&e&&t){const n=e[Zone.__symbol__("OriginalDelegate")];n&&(e=n);const i=t[Zone.__symbol__("OriginalDelegate")];i&&(t=i)}return{nativeRequestAnimationFrame:e,nativeCancelAnimationFrame:t}}().nativeRequestAnimationFrame,function(e){const t=()=>{!function(e){-1===e.lastRequestAnimationFrameId&&(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(z,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,sd(e),rd(e)},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),sd(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,i,r,s,o,a)=>{try{return od(e),n.invokeTask(r,s,o,a)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||e.shouldCoalesceRunChangeDetection)&&t(),ad(e)}},onInvoke:(n,i,r,s,o,a,c)=>{try{return od(e),n.invoke(r,s,o,a,c)}finally{e.shouldCoalesceRunChangeDetection&&t(),ad(e)}},onHasTask:(t,n,i,r)=>{t.hasTask(i,r),n===i&&("microTask"==r.change?(e._hasPendingMicrotasks=r.microTask,sd(e),rd(e)):"macroTask"==r.change&&(e.hasPendingMacrotasks=r.macroTask))},onHandleError:(t,n,i,r)=>(t.handleError(i,r),e.runOutsideAngular(()=>e.onError.emit(r)),!1)})}(i)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!nd.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(nd.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,i){const r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,e,id,qc,qc);try{return r.runTask(s,t,n)}finally{r.cancelTask(s)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}}const id={};function rd(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function sd(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function od(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function ad(e){e._nesting--,rd(e)}class cd{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new pu,this.onMicrotaskEmpty=new pu,this.onStable=new pu,this.onError=new pu}run(e,t,n){return e.apply(t,n)}runGuarded(e,t,n){return e.apply(t,n)}runOutsideAngular(e){return e()}runTask(e,t,n,i){return e.apply(t,n)}}let ld=(()=>{class e{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{nd.assertNotInAngularZone(),td(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())td(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,n){let i=-1;t&&t>0&&(i=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==i),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:i,updateCb:n})}whenStable(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,n){return[]}}return e.\u0275fac=function(t){return new(t||e)(Cn(nd))},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})(),ud=(()=>{class e{constructor(){this._applications=new Map,pd.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return pd.findTestabilityInTree(this,e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();class dd{addToWindow(e){}findTestabilityInTree(e,t,n){return null}}function hd(e){pd=e}let fd,pd=new dd,md=!0,bd=!1;function gd(){return bd=!0,md}function _d(){if(bd)throw new Error("Cannot enable prod mode after platform setup.");md=!1}const vd=new un("AllowMultipleToken");class yd{constructor(e,t){this.name=e,this.token=t}}function wd(e,t,n=[]){const i=`Platform: ${t}`,r=new un(i);return(t=[])=>{let s=Dd();if(!s||s.injector.get(vd,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{const e=n.concat(t).concat({provide:r,useValue:!0},{provide:js,useValue:"platform"});!function(e){if(fd&&!fd.destroyed&&!fd.injector.get(vd,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");fd=e.get(Sd);const t=e.get(Nu,null);t&&t.forEach(e=>e())}(Qs.create({providers:e,name:i}))}return function(e){const t=Dd();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(r)}}function Dd(){return fd&&!fd.destroyed?fd:null}let Sd=(()=>{class e{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const n=function(e,t){let n;return n="noop"===e?new cd:("zone.js"===e?void 0:e)||new nd({enableLongStackTrace:gd(),shouldCoalesceEventChangeDetection:!!(null==t?void 0:t.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==t?void 0:t.ngZoneRunCoalescing)}),n}(t?t.ngZone:void 0,{ngZoneEventCoalescing:t&&t.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:t&&t.ngZoneRunCoalescing||!1}),i=[{provide:nd,useValue:n}];return n.run(()=>{const t=Qs.create({providers:i,parent:this.injector,name:e.moduleType.name}),r=e.create(t),s=r.injector.get(Ri,null);if(!s)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const e=n.onError.subscribe({next:e=>{s.handleError(e)}});r.onDestroy(()=>{Td(this._modules,r),e.unsubscribe()})}),function(e,t,n){try{const i=n();return Ao(i)?i.catch(n=>{throw t.runOutsideAngular(()=>e.handleError(n)),n}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(s,n,()=>{const e=r.injector.get(Fu);return e.runInitializers(),e.donePromise.then(()=>(Fa(r.injector.get(Xu,Ea)||Ea),this._moduleDoBootstrap(r),r))})})}bootstrapModule(e,t=[]){const n=xd({},t);return function(e,t,n){const i=new Jl(n);return Promise.resolve(i)}(0,0,e).then(e=>this.bootstrapModuleFactory(e,n))}_moduleDoBootstrap(e){const t=e.injector.get(kd);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${u(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}return e.\u0275fac=function(t){return new(t||e)(Cn(Qs))},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();function xd(e,t){return Array.isArray(t)?t.reduce(xd,e):Object.assign(Object.assign({},e),t)}let kd=(()=>{class e{constructor(e,t,n,i,r){this._zone=e,this._injector=t,this._exceptionHandler=n,this._componentFactoryResolver=i,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const c=new s.a(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),l=new s.a(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{nd.assertNotInAngularZone(),td(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{nd.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),n.unsubscribe()}});this.isStable=Object(o.a)(c,l.pipe(Object(a.a)()))}bootstrap(e,t){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=e instanceof Vc?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);const i=n.isBoundToModule?void 0:this._injector.get(Il),r=n.create(Qs.NULL,[],t||n.selector,i),s=r.location.nativeElement,o=r.injector.get(ld,null),a=o&&r.injector.get(ud);return o&&a&&a.registerApplication(s,o),r.onDestroy(()=>{this.detachView(r.hostView),Td(this.components,r),a&&a.unregisterApplication(s)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let e of this._views)e.detectChanges()}catch(e){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(e))}finally{this._runningTick=!1}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;Td(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get($u,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return e.\u0275fac=function(t){return new(t||e)(Cn(nd),Cn(Qs),Cn(Ri),Cn(Uc),Cn(Fu))},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();function Td(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Md{}class Cd{}const Od={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let Ld=(()=>{class e{constructor(e,t){this._compiler=e,this._config=t||Od}load(e){return this.loadAndCompile(e)}loadAndCompile(e){let[t,i]=e.split("#");return void 0===i&&(i="default"),n("zn8P")(t).then(e=>e[i]).then(e=>Ed(e,t,i)).then(e=>this._compiler.compileModuleAsync(e))}loadFactory(e){let[t,i]=e.split("#"),r="NgFactory";return void 0===i&&(i="default",r=""),n("zn8P")(this._config.factoryPathPrefix+t+this._config.factoryPathSuffix).then(e=>e[i+r]).then(e=>Ed(e,t,i))}}return e.\u0275fac=function(t){return new(t||e)(Cn(Zu),Cn(Cd,8))},e.\u0275prov=w({token:e,factory:e.\u0275fac}),e})();function Ed(e,t,n){if(!e)throw new Error(`Cannot find '${n}' in '${t}'`);return e}const Ad=function(e){return null},Id=wd(null,"core",[{provide:zu,useValue:"unknown"},{provide:Sd,deps:[Qs]},{provide:ud,deps:[]},{provide:Hu,deps:[]}]),Rd=[{provide:kd,useClass:kd,deps:[nd,Qs,Ri,Uc,Fu]},{provide:Vl,deps:[nd],useFactory:function(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}},{provide:Fu,useClass:Fu,deps:[[new An,Pu]]},{provide:Zu,useClass:Zu,deps:[]},ju,{provide:bl,useFactory:function(){return Tl},deps:[]},{provide:_l,useFactory:function(){return Ml},deps:[]},{provide:Xu,useFactory:function(e){return Fa(e=e||"undefined"!=typeof $localize&&$localize.locale||Ea),e},deps:[[new En(Xu),new An,new In]]},{provide:Vu,useValue:"USD"}];let Pd=(()=>{class e{constructor(e){}}return e.\u0275fac=function(t){return new(t||e)(Cn(kd))},e.\u0275mod=ie({type:e}),e.\u0275inj=D({providers:Rd}),e})()},"8YOa":function(e,t,n){var i=n("I+eb"),r=n("4zBA"),s=n("0BK2"),o=n("hh1v"),a=n("Gi26"),c=n("m/L8").f,l=n("JBy8"),u=n("BX/b"),d=n("kOOl"),h=n("uy83"),f=!1,p=d("meta"),m=0,b=Object.isExtensible||function(){return!0},g=function(e){c(e,p,{value:{objectID:"O"+m++,weakData:{}}})},_=e.exports={enable:function(){_.enable=function(){},f=!0;var e=l.f,t=r([].splice),n={};n[p]=1,e(n).length&&(l.f=function(n){for(var i=e(n),r=0,s=i.length;r<s;r++)if(i[r]===p){t(i,r,1);break}return i},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,p)){if(!b(e))return"F";if(!t)return"E";g(e)}return e[p].objectID},getWeakData:function(e,t){if(!a(e,p)){if(!b(e))return!0;if(!t)return!1;g(e)}return e[p].weakData},onFreeze:function(e){return h&&f&&b(e)&&!a(e,p)&&g(e),e}};s[p]=!0},"8mBD":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Ter\xe7a-feira_Quarta-feira_Quinta-feira_Sexta-feira_S\xe1bado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_S\xe1b".split("_"),weekdaysMin:"Do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},"8xTl":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e){return r.a.upperFirst(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"upperFirst",type:e,pure:!0}),e})()},"9/5/":function(e,t){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof global&&global&&global.Object===Object&&global,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),u=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=r.test(e);return a||s.test(e)?o(e.slice(2),a?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var i,r,s,o,a,c,l=0,u=!1,b=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function v(e){return l=e,a=setTimeout(w,t),u?_(e):o}function y(e){var n=e-c;return void 0===c||n>=t||n<0||b&&e-l>=s}function w(){var e=f();if(y(e))return D(e);a=setTimeout(w,function(e){var n=t-(e-c);return b?h(n,s-(e-l)):n}(e))}function D(e){return a=void 0,g&&i?_(e):(i=r=void 0,o)}function S(){var e=f(),n=y(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return v(c);if(b)return a=setTimeout(w,t),_(c)}return void 0===a&&(a=setTimeout(w,t)),o}return t=m(t)||0,p(n)&&(u=!!n.leading,s=(b="maxWait"in n)?d(m(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},S.flush=function(){return void 0===a?o:D(f())},S}},"93I0":function(e,t,n){var i=n("VpIT"),r=n("kOOl"),s=i("keys");e.exports=function(e){return s[e]||(s[e]=r(e))}},"9Xeq":function(e,t,n){"use strict";n.d(t,"a",function(){return C});var i=n("SVse"),r=n("yT6U"),s=n("iExv"),o=n("4DD9"),a=n("a0VL"),c=n("+0ag"),l=n("85J/"),u=n("IzCI"),d=n("Fgil"),h=n("o4+5"),f=n("nSDx"),p=n("8Y7J");let m=(()=>{class e{transform(e){return encodeURIComponent(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=p.Qb({name:"encodeUri",type:e,pure:!0}),e})();var b=n("BQkM"),g=n("uYzU"),_=n("FFMq"),v=n("E2fk"),y=n("TJUb"),w=n("dEH0"),D=n("G1/K"),S=n("TYzs"),x=n("Dwqy"),k=n("Yrry"),T=n("efK2"),M=n("8xTl");let C=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=p.Pb({type:e}),e.\u0275inj=p.Ob({providers:[r.a,o.a,s.a,i.e,l.a,c.a,d.a,u.a,h.a,x.a,g.a,_.a,v.a,a.a,f.a,m,S.a,b.a,w.a,D.a,M.a,y.a,T.a,k.a],imports:[[i.c]]}),e})()},"9d/t":function(e,t,n){var i=n("2oRo"),r=n("AO7/"),s=n("Fib7"),o=n("xrYK"),a=n("tiKp")("toStringTag"),c=i.Object,l="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=c(e),a))?n:l?o(t):"Object"==(i=o(t))&&s(t.callee)?"Arguments":i}},"9f76":function(e,t,n){"use strict";var i=n("8M4i"),r=n("EUcb"),s=function(e){return Object(r.a)(e)&&"[object Arguments]"==Object(i.a)(e)},o=Object.prototype,a=o.hasOwnProperty,c=o.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return Object(r.a)(e)&&a.call(e,"callee")&&!c.call(e,"callee")};t.a=l},"9nlD":function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("LvDl"),r=n.n(i),s=n("2Vo4"),o=n("XNiG"),a=n("mtw6"),c=n("G1I9"),l=n("a0VL"),u=n("ufoC"),d=n("8Y7J"),h=n("EApP");let f=(()=>{class e{constructor(e,t,n){this.toastr=e,this.taskMessageService=t,this.cdDatePipe=n,this.hideToasties=!1,this.dataSource=new s.a([]),this.data$=this.dataSource.asObservable(),this.sidebarSubject=new o.a,this.queued=[],this.KEY="cdNotifications";const i=localStorage.getItem(this.KEY);let a=[];r.a.isString(i)&&(a=JSON.parse(i,(e,t)=>r.a.isPlainObject(t)?r.a.assign(new c.a,t):t)),this.dataSource.next(a)}removeAll(){localStorage.removeItem(this.KEY),this.dataSource.next([])}remove(e){const t=this.dataSource.getValue();t.splice(e,1),this.dataSource.next(t),localStorage.setItem(this.KEY,JSON.stringify(t))}save(e){const t=this.dataSource.getValue();for(t.push(e),t.sort((e,t)=>e.timestamp>t.timestamp?-1:1);t.length>10;)t.pop();this.dataSource.next(t),localStorage.setItem(this.KEY,JSON.stringify(t))}show(e,t,n,i,s){return window.setTimeout(()=>{let o;o=r.a.isFunction(e)?e():r.a.isObject(e)?e:new c.b(e,t,n,i,s),this.queueToShow(o)},10)}queueToShow(e){this.cancel(this.queuedTimeoutId),this.queued.find(t=>r.a.isEqual(t,e))||this.queued.push(e),this.queuedTimeoutId=window.setTimeout(()=>{this.showQueued()},500)}showQueued(){this.getUnifiedTitleQueue().forEach(e=>{const t=new c.a(e);t.isFinishedTask||this.save(t),this.showToasty(t)})}getUnifiedTitleQueue(){return Object.values(this.queueShiftByTitle()).map(e=>{const t=e[0];return e.length>1&&(t.message="<ul>"+e.map(e=>`<li>${e.message}</li>`).join("")+"</ul>"),t})}queueShiftByTitle(){const e={};let t;for(;t=this.queued.shift();)e[t.title]||(e[t.title]=[]),e[t.title].push(t);return e}showToasty(e){this.hideToasties||this.toastr[["error","info","success"][e.type]]((e.message?e.message+"<br>":"")+this.renderTimeAndApplicationHtml(e),e.title,e.options)}renderTimeAndApplicationHtml(e){return`<small class="date">${this.cdDatePipe.transform(e.timestamp)}</small><i class="float-right custom-icon ${e.applicationClass}" title="${e.application}"></i>`}notifyTask(e,t=!0){const n=this.finishedTaskToNotification(e,t);return n.isFinishedTask=!0,this.show(n)}finishedTaskToNotification(e,t=!0){let n;return n=e.success&&t?new c.b(a.a.success,this.taskMessageService.getSuccessTitle(e)):new c.b(a.a.error,this.taskMessageService.getErrorTitle(e),this.taskMessageService.getErrorMessage(e)),n.isFinishedTask=!0,n}cancel(e){window.clearTimeout(e)}suspendToasties(e){this.hideToasties=e}toggleSidebar(e=!1){this.sidebarSubject.next(e)}}return e.\u0275fac=function(t){return new(t||e)(d.ic(h.b),d.ic(u.a),d.ic(l.a))},e.\u0275prov=d.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"9ppp":function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})()},"9rRi":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am M\xe0rt","An Giblean","An C\xe8itean","An t-\xd2gmhios","An t-Iuchar","An L\xf9nastal","An t-Sultain","An D\xe0mhair","An t-Samhain","An D\xf9bhlachd"],monthsShort:["Faoi","Gear","M\xe0rt","Gibl","C\xe8it","\xd2gmh","Iuch","L\xf9n","Sult","D\xe0mh","Samh","D\xf9bh"],monthsParseExact:!0,weekdays:["Did\xf2mhnaich","Diluain","Dim\xe0irt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["D\xf2","Lu","M\xe0","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-m\xe0ireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-d\xe8 aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"m\xecos",MM:"%d m\xecosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},"9xzX":function(e,t,n){"use strict";n.d(t,"a",function(){return m});var i=n("mrSG"),r=n("IheW"),s=n("LvDl"),o=n.n(s),a=n("2Vo4"),c=n("z6cu"),l=n("LRne"),u=n("vkgz"),d=n("5+tZ"),h=n("IzEk"),f=n("xTzq"),p=n("8Y7J");let m=(()=>{let e=class{constructor(e){this.http=e,this.url="api/rgw/daemon",this.daemons=new a.a([]),this.daemons$=this.daemons.asObservable(),this.selectedDaemon=new a.a(null),this.selectedDaemon$=this.selectedDaemon.asObservable()}list(){return this.http.get(this.url).pipe(Object(u.a)(e=>{this.daemons.next(e),o.a.isEmpty(this.selectedDaemon.getValue())&&this.selectDefaultDaemon(e)}))}get(e){return this.http.get(`${this.url}/${e}`)}selectDaemon(e){this.selectedDaemon.next(e)}selectDefaultDaemon(e){if(0===e.length)return null;for(const t of e)if(t.default)return this.selectDaemon(t),t;return this.selectDaemon(e[0]),e[0]}request(e){return this.selectedDaemon.pipe(Object(d.a)(e=>o.a.isEmpty(e)?this.list().pipe(Object(d.a)(e=>o.a.isEmpty(e)?Object(c.a)("No RGW daemons found!"):this.selectedDaemon$)):Object(l.a)(e)),Object(h.a)(1),Object(d.a)(t=>{let n=new r.e;return n=n.append("daemon_name",t.id),e(n)}))}};return e.\u0275fac=function(t){return new(t||e)(p.ic(r.b))},e.\u0275prov=p.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([f.a,Object(i.d)("design:paramtypes",[r.b])],e),e})()},"A+xa":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"\u043a\u04d1\u0440\u043b\u0430\u0447_\u043d\u0430\u0440\u04d1\u0441_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440\u0442\u043c\u0435_\u0443\u0442\u04d1_\u04ab\u0443\u0440\u043b\u0430_\u0430\u0432\u04d1\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448\u0442\u0430\u0432".split("_"),monthsShort:"\u043a\u04d1\u0440_\u043d\u0430\u0440_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440_\u0443\u0442\u04d1_\u04ab\u0443\u0440_\u0430\u0432\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448".split("_"),weekdays:"\u0432\u044b\u0440\u0441\u0430\u0440\u043d\u0438\u043a\u0443\u043d_\u0442\u0443\u043d\u0442\u0438\u043a\u0443\u043d_\u044b\u0442\u043b\u0430\u0440\u0438\u043a\u0443\u043d_\u044e\u043d\u043a\u0443\u043d_\u043a\u04d7\u04ab\u043d\u0435\u0440\u043d\u0438\u043a\u0443\u043d_\u044d\u0440\u043d\u0435\u043a\u0443\u043d_\u0448\u04d1\u043c\u0430\u0442\u043a\u0443\u043d".split("_"),weekdaysShort:"\u0432\u044b\u0440_\u0442\u0443\u043d_\u044b\u0442\u043b_\u044e\u043d_\u043a\u04d7\u04ab_\u044d\u0440\u043d_\u0448\u04d1\u043c".split("_"),weekdaysMin:"\u0432\u0440_\u0442\u043d_\u044b\u0442_\u044e\u043d_\u043a\u04ab_\u044d\u0440_\u0448\u043c".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7]",LLL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm",LLLL:"dddd, YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm"},calendar:{sameDay:"[\u041f\u0430\u044f\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextDay:"[\u042b\u0440\u0430\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastDay:"[\u04d6\u043d\u0435\u0440] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextWeek:"[\u04aa\u0438\u0442\u0435\u0441] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastWeek:"[\u0418\u0440\u0442\u043d\u04d7] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",sameElse:"L"},relativeTime:{future:function(e){return e+(/\u0441\u0435\u0445\u0435\u0442$/i.exec(e)?"\u0440\u0435\u043d":/\u04ab\u0443\u043b$/i.exec(e)?"\u0442\u0430\u043d":"\u0440\u0430\u043d")},past:"%s \u043a\u0430\u044f\u043b\u043b\u0430",s:"\u043f\u04d7\u0440-\u0438\u043a \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",ss:"%d \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",m:"\u043f\u04d7\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u043f\u04d7\u0440 \u0441\u0435\u0445\u0435\u0442",hh:"%d \u0441\u0435\u0445\u0435\u0442",d:"\u043f\u04d7\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u043f\u04d7\u0440 \u0443\u0439\u04d1\u0445",MM:"%d \u0443\u0439\u04d1\u0445",y:"\u043f\u04d7\u0440 \u04ab\u0443\u043b",yy:"%d \u04ab\u0443\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-\u043c\u04d7\u0448/,ordinal:"%d-\u043c\u04d7\u0448",week:{dow:1,doy:7}})}(n("wd/R"))},A2ZE:function(e,t,n){var i=n("4zBA"),r=n("We1y"),s=i(i.bind);e.exports=function(e,t){return r(e),void 0===t?e:s?s(e,t):function(){return e.apply(t,arguments)}}},ANnk:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("aexS"),r=n("f/UV"),s=n("8Y7J");let o=(()=>{class e{constructor(e,t,n){this.formScope=e,this.authStorageService=t,this.elementRef=n}ngAfterViewInit(){var e,t,n;this.permissions=this.authStorageService.getPermissions();const i=null===(e=this.formScope)||void 0===e?void 0:e.cdFormScope;i&&!(null===(n=null===(t=this.permissions)||void 0===t?void 0:t[i])||void 0===n?void 0:n.update)&&(this.elementRef.nativeElement.disabled=!0)}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(r.a,8),s.Rb(i.a),s.Rb(s.n))},e.\u0275dir=s.Mb({type:e,selectors:[["input",3,"cdNoFormInputDisable",""],["select",3,"cdNoFormInputDisable",""],["button",3,"cdNoFormInputDisable",""],["","cdFormInputDisable",""]]}),e})()},"AO7/":function(e,t,n){var i={};i[n("tiKp")("toStringTag")]="z",e.exports="[object z]"===String(i)},AQ68:function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("wd/R"))},Avrn:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("aexS"),r=n("8Y7J"),s=n("iInd");let o=(()=>{class e{constructor(e,t){this.router=e,this.authStorageService=t}canActivate(e,t){return!!this.authStorageService.isLoggedIn()||(this.router.navigate(["/login"],{queryParams:{returnUrl:t.url}}),!1)}canActivateChild(e,t){return this.canActivate(e,t)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(s.e),r.ic(i.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},AvvY:function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"\u0d1c\u0d28\u0d41\u0d35\u0d30\u0d3f_\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41\u0d35\u0d30\u0d3f_\u0d2e\u0d3e\u0d7c\u0d1a\u0d4d\u0d1a\u0d4d_\u0d0f\u0d2a\u0d4d\u0d30\u0d3f\u0d7d_\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48_\u0d13\u0d17\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d4d_\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d02\u0d2c\u0d7c_\u0d12\u0d15\u0d4d\u0d1f\u0d4b\u0d2c\u0d7c_\u0d28\u0d35\u0d02\u0d2c\u0d7c_\u0d21\u0d3f\u0d38\u0d02\u0d2c\u0d7c".split("_"),monthsShort:"\u0d1c\u0d28\u0d41._\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41._\u0d2e\u0d3e\u0d7c._\u0d0f\u0d2a\u0d4d\u0d30\u0d3f._\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48._\u0d13\u0d17._\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31._\u0d12\u0d15\u0d4d\u0d1f\u0d4b._\u0d28\u0d35\u0d02._\u0d21\u0d3f\u0d38\u0d02.".split("_"),monthsParseExact:!0,weekdays:"\u0d1e\u0d3e\u0d2f\u0d31\u0d3e\u0d34\u0d4d\u0d1a_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d33\u0d3e\u0d34\u0d4d\u0d1a_\u0d1a\u0d4a\u0d35\u0d4d\u0d35\u0d3e\u0d34\u0d4d\u0d1a_\u0d2c\u0d41\u0d27\u0d28\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a_\u0d36\u0d28\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a".split("_"),weekdaysShort:"\u0d1e\u0d3e\u0d2f\u0d7c_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d7e_\u0d1a\u0d4a\u0d35\u0d4d\u0d35_\u0d2c\u0d41\u0d27\u0d7b_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d02_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f_\u0d36\u0d28\u0d3f".split("_"),weekdaysMin:"\u0d1e\u0d3e_\u0d24\u0d3f_\u0d1a\u0d4a_\u0d2c\u0d41_\u0d35\u0d4d\u0d2f\u0d3e_\u0d35\u0d46_\u0d36".split("_"),longDateFormat:{LT:"A h:mm -\u0d28\u0d41",LTS:"A h:mm:ss -\u0d28\u0d41",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -\u0d28\u0d41",LLLL:"dddd, D MMMM YYYY, A h:mm -\u0d28\u0d41"},calendar:{sameDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d4d] LT",nextDay:"[\u0d28\u0d3e\u0d33\u0d46] LT",nextWeek:"dddd, LT",lastDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d32\u0d46] LT",lastWeek:"[\u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d",past:"%s \u0d2e\u0d41\u0d7b\u0d2a\u0d4d",s:"\u0d05\u0d7d\u0d2a \u0d28\u0d3f\u0d2e\u0d3f\u0d37\u0d19\u0d4d\u0d19\u0d7e",ss:"%d \u0d38\u0d46\u0d15\u0d4d\u0d15\u0d7b\u0d21\u0d4d",m:"\u0d12\u0d30\u0d41 \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",mm:"%d \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",h:"\u0d12\u0d30\u0d41 \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",hh:"%d \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",d:"\u0d12\u0d30\u0d41 \u0d26\u0d3f\u0d35\u0d38\u0d02",dd:"%d \u0d26\u0d3f\u0d35\u0d38\u0d02",M:"\u0d12\u0d30\u0d41 \u0d2e\u0d3e\u0d38\u0d02",MM:"%d \u0d2e\u0d3e\u0d38\u0d02",y:"\u0d12\u0d30\u0d41 \u0d35\u0d7c\u0d37\u0d02",yy:"%d \u0d35\u0d7c\u0d37\u0d02"},meridiemParse:/\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f|\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46|\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d|\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02|\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f/i,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"===t&&e>=4||"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d"===t||"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f":e<12?"\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46":e<17?"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d":e<20?"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02":"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"}})}(n("wd/R"))},AwXo:function(e,t,n){"use strict";var i=n("Y7yP"),r=function(){try{var e=Object(i.a)(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();t.a=r},AxL3:function(e,t){var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=n},AytR:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i={default_lang:"en-US",production:!0,year:"2021"}},"B/qT":function(e,t,n){var i=n("UMSQ");e.exports=function(e){return i(e.length)}},B55N:function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"\u4ee4\u548c",narrow:"\u32ff",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"\u5e73\u6210",narrow:"\u337b",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"\u662d\u548c",narrow:"\u337c",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"\u5927\u6b63",narrow:"\u337d",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"\u660e\u6cbb",narrow:"\u337e",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"\u897f\u66a6",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"\u7d00\u5143\u524d",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(\u5143|\d+)\u5e74/,eraYearOrdinalParse:function(e,t){return"\u5143"===t[1]?1:parseInt(t[1]||e,10)},months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5(ddd) HH:mm"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function(e){return"\u5348\u5f8c"===e},meridiem:function(e,t,n){return e<12?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:function(e){return e.week()!==this.week()?"[\u6765\u9031]dddd LT":"dddd LT"},lastDay:"[\u6628\u65e5] LT",lastWeek:function(e){return this.week()!==e.week()?"[\u5148\u9031]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}\u65e5/,ordinal:function(e,t){switch(t){case"y":return 1===e?"\u5143\u5e74":e+"\u5e74";case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",ss:"%d\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}})}(n("wd/R"))},BFxc:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("7o/Q"),r=n("4I5i"),s=n("EY2u");function o(e){return function(t){return 0===e?Object(s.b)():t.lift(new a(e))}}class a{constructor(e){if(this.total=e,this.total<0)throw new r.a}call(e,t){return t.subscribe(new c(e,this.total))}}class c extends i.a{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,n=this.total,i=this.count++;t.length<n?t.push(e):t[i%n]=e}_complete(){const e=this.destination;let t=this.count;if(t>0){const n=this.count>=this.total?this.total:this.count,i=this.ring;for(let r=0;r<n;r++){const r=t++%n;e.next(i[r])}}e.complete()}}},BQkM:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){return`${e} IOPS`}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"iops",type:e,pure:!0}),e})()},BVg3:function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,i,r){var s=e+" ";switch(i){case"s":return n||r?"nokkrar sek\xfandur":"nokkrum sek\xfandum";case"ss":return t(e)?s+(n||r?"sek\xfandur":"sek\xfandum"):s+"sek\xfanda";case"m":return n?"m\xedn\xfata":"m\xedn\xfatu";case"mm":return t(e)?s+(n||r?"m\xedn\xfatur":"m\xedn\xfatum"):n?s+"m\xedn\xfata":s+"m\xedn\xfatu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"d\xf6gum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"m\xe1nu\xf0ur":r?"m\xe1nu\xf0":"m\xe1nu\xf0i";case"MM":return t(e)?n?s+"m\xe1nu\xf0ir":s+(r?"m\xe1nu\xf0i":"m\xe1nu\xf0um"):n?s+"m\xe1nu\xf0ur":s+(r?"m\xe1nu\xf0":"m\xe1nu\xf0i");case"y":return n||r?"\xe1r":"\xe1ri";case"yy":return t(e)?s+(n||r?"\xe1r":"\xe1rum"):s+(n||r?"\xe1r":"\xe1ri")}}e.defineLocale("is",{months:"jan\xfaar_febr\xfaar_mars_apr\xedl_ma\xed_j\xfan\xed_j\xfal\xed_\xe1g\xfast_september_okt\xf3ber_n\xf3vember_desember".split("_"),monthsShort:"jan_feb_mar_apr_ma\xed_j\xfan_j\xfal_\xe1g\xfa_sep_okt_n\xf3v_des".split("_"),weekdays:"sunnudagur_m\xe1nudagur_\xferi\xf0judagur_mi\xf0vikudagur_fimmtudagur_f\xf6studagur_laugardagur".split("_"),weekdaysShort:"sun_m\xe1n_\xferi_mi\xf0_fim_f\xf6s_lau".split("_"),weekdaysMin:"Su_M\xe1_\xder_Mi_Fi_F\xf6_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[\xed dag kl.] LT",nextDay:"[\xe1 morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xed g\xe6r kl.] LT",lastWeek:"[s\xed\xf0asta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s s\xed\xf0an",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"BX/b":function(e,t,n){var i=n("xrYK"),r=n("/GqU"),s=n("JBy8").f,o=n("82ph"),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"Window"==i(e)?function(e){try{return s(e)}catch(t){return o(a)}}(e):s(r(e))}},Bs8V:function(e,t,n){var i=n("g6v/"),r=n("xluM"),s=n("0eef"),o=n("XGwC"),a=n("/GqU"),c=n("oEtG"),l=n("Gi26"),u=n("DPsx"),d=Object.getOwnPropertyDescriptor;t.f=i?d:function(e,t){if(e=a(e),t=c(t),u)try{return d(e,t)}catch(n){}if(l(e,t))return o(!r(s.f,e,t),e[t])}},ByF4:function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apr\xedl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_m\xe1nadagur_t\xfdsdagur_mikudagur_h\xf3sdagur_fr\xedggjadagur_leygardagur".split("_"),weekdaysShort:"sun_m\xe1n_t\xfds_mik_h\xf3s_fr\xed_ley".split("_"),weekdaysMin:"su_m\xe1_t\xfd_mi_h\xf3_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[\xcd dag kl.] LT",nextDay:"[\xcd morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xcd gj\xe1r kl.] LT",lastWeek:"[s\xed\xf0stu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s s\xed\xf0ani",s:"f\xe1 sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein t\xedmi",hh:"%d t\xedmar",d:"ein dagur",dd:"%d dagar",M:"ein m\xe1na\xf0ur",MM:"%d m\xe1na\xf0ir",y:"eitt \xe1r",yy:"%d \xe1r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},C0Ia:function(e,t,n){var i=n("2oRo"),r=n("6LWA"),s=n("aO6C"),o=n("hh1v"),a=n("tiKp")("species"),c=i.Array;e.exports=function(e){var t;return r(e)&&(s(t=e.constructor)&&(t===c||r(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0),void 0===t?c:t}},Ce4a:function(e,t,n){"use strict";var i=n("Ju5/");t.a=i.a.Uint8Array},CfRg:function(e,t,n){"use strict";var i=n("oSzE"),r=n("23KU"),s=n("+EKe"),o=n("mkut"),a=n("4/q3"),c=n("3/ER"),l=n("eAQQ"),u=n("jN84"),d=n("n561"),h=n("TFwu"),f=n("TnHx"),p=n("YM6B"),m=Object.prototype.hasOwnProperty,b=n("lkxz"),g=/\w*$/,_=n("ylTp"),v=_.a?_.a.prototype:void 0,y=v?v.valueOf:void 0,w=n("G4mU"),D=n("hYPf"),S=n("/1FC"),x=n("WOAq"),k=n("EUcb"),T=n("ovuK"),M=n("xutz"),C=M.a&&M.a.isMap,O=C?Object(T.a)(C):function(e){return Object(k.a)(e)&&"[object Map]"==Object(p.a)(e)},L=n("IzLi"),E=M.a&&M.a.isSet,A=E?Object(T.a)(E):function(e){return Object(k.a)(e)&&"[object Set]"==Object(p.a)(e)},I="[object Arguments]",R="[object Function]",P="[object Object]",F={};F[I]=F["[object Array]"]=F["[object ArrayBuffer]"]=F["[object DataView]"]=F["[object Boolean]"]=F["[object Date]"]=F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Map]"]=F["[object Number]"]=F[P]=F["[object RegExp]"]=F["[object Set]"]=F["[object String]"]=F["[object Symbol]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F["[object Error]"]=F[R]=F["[object WeakMap]"]=!1,t.a=function e(t,n,_,v,k,T){var M,C=1&n,E=2&n,W=4&n;if(_&&(M=k?_(t,v,k,T):_(t)),void 0!==M)return M;if(!Object(L.a)(t))return t;var j=Object(S.a)(t);if(j){if(M=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&m.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!C)return Object(l.a)(t,M)}else{var Y=Object(p.a)(t),N=Y==R||"[object GeneratorFunction]"==Y;if(Object(x.a)(t))return Object(c.a)(t,C);if(Y==P||Y==I||N&&!k){if(M=E||N?{}:Object(D.a)(t),!C)return E?function(e,t){return Object(s.a)(e,Object(d.a)(e),t)}(t,function(e,t){return e&&Object(s.a)(t,Object(a.a)(t),e)}(M,t)):function(e,t){return Object(s.a)(e,Object(u.a)(e),t)}(t,function(e,t){return e&&Object(s.a)(t,Object(o.a)(t),e)}(M,t))}else{if(!F[Y])return k?t:{};M=function(e,t,n){var i,r,s=e.constructor;switch(t){case"[object ArrayBuffer]":return Object(b.a)(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return function(e,t){var n=t?Object(b.a)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Object(w.a)(e,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(r=new(i=e).constructor(i.source,g.exec(i))).lastIndex=i.lastIndex,r;case"[object Set]":return new s;case"[object Symbol]":return y?Object(y.call(e)):{}}}(t,Y,C)}}T||(T=new i.a);var z=T.get(t);if(z)return z;T.set(t,M),A(t)?t.forEach(function(i){M.add(e(i,n,_,i,t,T))}):O(t)&&t.forEach(function(i,r){M.set(r,e(i,n,_,r,t,T))});var $=j?void 0:(W?E?f.a:h.a:E?a.a:o.a)(t);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n););}($||t,function(i,s){$&&(i=t[s=i]),Object(r.a)(M,s,e(i,n,_,s,t,T))}),M}},Cfvw:function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n("HDdC"),r=n("SeVD"),s=n("quSY"),o=n("kJWO"),a=n("jZKg"),c=n("Lhse"),l=n("c2HN"),u=n("I55L");function d(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[o.a]}(e))return function(e,t){return new i.a(n=>{const i=new s.a;return i.add(t.schedule(()=>{const r=e[o.a]();i.add(r.subscribe({next(e){i.add(t.schedule(()=>n.next(e)))},error(e){i.add(t.schedule(()=>n.error(e)))},complete(){i.add(t.schedule(()=>n.complete()))}}))})),i})}(e,t);if(Object(l.a)(e))return function(e,t){return new i.a(n=>{const i=new s.a;return i.add(t.schedule(()=>e.then(e=>{i.add(t.schedule(()=>{n.next(e),i.add(t.schedule(()=>n.complete()))}))},e=>{i.add(t.schedule(()=>n.error(e)))}))),i})}(e,t);if(Object(u.a)(e))return Object(a.a)(e,t);if(function(e){return e&&"function"==typeof e[c.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new i.a(n=>{const i=new s.a;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(t.schedule(()=>{r=e[c.a](),i.add(t.schedule(function(){if(n.closed)return;let e,t;try{const n=r.next();e=n.value,t=n.done}catch(i){return void n.error(i)}t?n.complete():(n.next(e),this.schedule())}))})),i})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof i.a?e:new i.a(Object(r.a)(e))}},ChqD:function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("w9WL"),c=n("zWsK"),l=n("V/fk"),u=n("9Xeq"),d=n("8Y7J");let h=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=d.Pb({type:e}),e.\u0275inj=d.Ob({imports:[[i.c,a.h,c.a,r.m,o.l,o.F,u.a,l.a,s.i],a.h]}),e})()},CjzT:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},CoRJ:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},CqXF:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e){return t=>t.lift(new s(e))}class s{constructor(e){this.value=e}call(e,t){return t.subscribe(new o(e,this.value))}}class o extends i.a{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}},"D/JM":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},D0XW:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return s});var i=n("3N8a");const r=new(n("IjjT").a)(i.a),s=r},D4zM:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{constructor(e,t){this.elementRef=e,this.renderer=t}ngOnInit(){this.renderer.setAttribute(this.elementRef.nativeElement,"tabindex","-1"),this.iElement=this.renderer.createElement("i"),this.renderer.addClass(this.iElement,"fa"),this.renderer.appendChild(this.elementRef.nativeElement,this.iElement),this.update()}getInputElement(){return document.getElementById(this.cdPasswordButton)}update(){const e=this.getInputElement();e&&"text"===e.type?(this.renderer.removeClass(this.iElement,"fa-eye"),this.renderer.addClass(this.iElement,"fa-eye-slash")):(this.renderer.removeClass(this.iElement,"fa-eye-slash"),this.renderer.addClass(this.iElement,"fa-eye"))}onClick(){const e=this.getInputElement();e.type="password"===e.type?"text":"password",this.update()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdPasswordButton",""]],hostBindings:function(e,t){1&e&&i.lc("click",function(){return t.onClick()})},inputs:{cdPasswordButton:"cdPasswordButton"}}),e})()},DH7j:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>Array.isArray||(e=>e&&"number"==typeof e.length))()},"DKr+":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return i?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("wd/R"))},DLK6:function(e,t,n){var i=n("4zBA"),r=n("ewvW"),s=Math.floor,o=i("".charAt),a=i("".replace),c=i("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,i,d,h){var f=n+e.length,p=i.length,m=u;return void 0!==d&&(d=r(d),m=l),a(h,m,function(r,a){var l;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return c(t,0,n);case"'":return c(t,f);case"<":l=d[c(a,1,-1)];break;default:var u=+a;if(0===u)return r;if(u>p){var h=s(u/10);return 0===h?r:h<=p?void 0===i[h-1]?o(a,1):i[h-1]+o(a,1):r}l=i[u-1]}return void 0===l?"":l})}},DNAf:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("LvDl"),r=n.n(i);class s{constructor(e){this.customValidations={},this.empty="No items selected.",this.selectionLimit={tooltip:"Deselect item to select again",text:"Selection limit reached"},this.filter="Filter tags",this.add="Add badge",this.noOptions="There are no items available.",r.a.merge(this,e)}}},DPsx:function(e,t,n){var i=n("g6v/"),r=n("0Dky"),s=n("zBJ4");e.exports=!i&&!r(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},DSvg:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("LvDl"),r=n("vkgz"),s=n("aexS"),o=n("8Y7J"),a=n("IheW"),c=n("iInd");let l=(()=>{class e{constructor(e,t,n,i){this.authStorageService=e,this.http=t,this.router=n,this.route=i}check(e){return this.http.post("api/auth/check",{token:e})}login(e){return this.http.post("api/auth",e).pipe(Object(r.a)(e=>{this.authStorageService.set(e.username,e.permissions,e.sso,e.pwdExpirationDate,e.pwdUpdateRequired)}))}logout(e=null){return this.http.post("api/auth/logout",null).subscribe(t=>{this.authStorageService.remove();const n=i.get(this.route.snapshot.queryParams,"returnUrl","/login");this.router.navigate([n],{skipLocationChange:!0}),e&&e(),window.location.replace(t.redirect_url)})}}return e.\u0275fac=function(t){return new(t||e)(o.ic(s.a),o.ic(a.b),o.ic(c.e),o.ic(c.a))},e.\u0275prov=o.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},DVFp:function(e,t,n){var i=n("2oRo").String;e.exports=function(e){try{return i(e)}catch(t){return"Object"}}},Dkky:function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},DlmY:function(e,t,n){"use strict";var i=n("Y7yP"),r=Object(i.a)(Object,"create"),s=Object.prototype.hasOwnProperty,o=Object.prototype.hasOwnProperty;function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}a.prototype.clear=function(){this.__data__=r?r(null):{},this.size=0},a.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},a.prototype.get=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return s.call(t,e)?t[e]:void 0},a.prototype.has=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)},a.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this};var c=a,l=n("nLtN"),u=n("3cmB"),d=function(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function h(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}h.prototype.clear=function(){this.size=0,this.__data__={hash:new c,map:new(u.a||l.a),string:new c}},h.prototype.delete=function(e){var t=d(this,e).delete(e);return this.size-=t?1:0,t},h.prototype.get=function(e){return d(this,e).get(e)},h.prototype.has=function(e){return d(this,e).has(e)},h.prototype.set=function(e,t){var n=d(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},t.a=h},Dmvi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("wd/R"))},DoHr:function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'\xfcnc\xfc",4:"'\xfcnc\xfc",100:"'\xfcnc\xfc",6:"'nc\u0131",9:"'uncu",10:"'uncu",30:"'uncu",60:"'\u0131nc\u0131",90:"'\u0131nc\u0131"};e.defineLocale("tr",{months:"Ocak_\u015eubat_Mart_Nisan_May\u0131s_Haziran_Temmuz_A\u011fustos_Eyl\xfcl_Ekim_Kas\u0131m_Aral\u0131k".split("_"),monthsShort:"Oca_\u015eub_Mar_Nis_May_Haz_Tem_A\u011fu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Sal\u0131_\xc7ar\u015famba_Per\u015fembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_\xc7ar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_\xc7a_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"\xf6\xf6":"\xd6\xd6":n?"\xf6s":"\xd6S"},meridiemParse:/\xf6\xf6|\xd6\xd6|\xf6s|\xd6S/,isPM:function(e){return"\xf6s"===e||"\xd6S"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[yar\u0131n saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[d\xfcn] LT",lastWeek:"[ge\xe7en] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \xf6nce",s:"birka\xe7 saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir y\u0131l",yy:"%d y\u0131l"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'\u0131nc\u0131";var i=e%10;return e+(t[i]||t[e%100-i]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},Dwqy:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n("LvDl"),r=n.n(i),s=n("wd/R"),o=n.n(s),a=n("8Y7J");o.a.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}});let c=(()=>{class e{transform(e,t=!0){let n;if(n=r.a.isNumber(e)?o.a.unix(e):o()(e),!n.isValid())return"";let i=n.fromNow();return t&&(i=r.a.upperFirst(i)),i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=a.Qb({name:"relativeDate",type:e,pure:!1}),e})()},DxQv:function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n_man_tir_ons_tor_fre_l\xf8r".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"p\xe5 dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},Dzi0:function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"E+lV":function(e,t,n){!function(e){"use strict";var t={words:{ss:["\u0441\u0435\u043a\u0443\u043d\u0434\u0430","\u0441\u0435\u043a\u0443\u043d\u0434\u0435","\u0441\u0435\u043a\u0443\u043d\u0434\u0438"],m:["\u0458\u0435\u0434\u0430\u043d \u043c\u0438\u043d\u0443\u0442","\u0458\u0435\u0434\u043d\u0435 \u043c\u0438\u043d\u0443\u0442\u0435"],mm:["\u043c\u0438\u043d\u0443\u0442","\u043c\u0438\u043d\u0443\u0442\u0435","\u043c\u0438\u043d\u0443\u0442\u0430"],h:["\u0458\u0435\u0434\u0430\u043d \u0441\u0430\u0442","\u0458\u0435\u0434\u043d\u043e\u0433 \u0441\u0430\u0442\u0430"],hh:["\u0441\u0430\u0442","\u0441\u0430\u0442\u0430","\u0441\u0430\u0442\u0438"],dd:["\u0434\u0430\u043d","\u0434\u0430\u043d\u0430","\u0434\u0430\u043d\u0430"],MM:["\u043c\u0435\u0441\u0435\u0446","\u043c\u0435\u0441\u0435\u0446\u0430","\u043c\u0435\u0441\u0435\u0446\u0438"],yy:["\u0433\u043e\u0434\u0438\u043d\u0430","\u0433\u043e\u0434\u0438\u043d\u0435","\u0433\u043e\u0434\u0438\u043d\u0430"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"\u0458\u0430\u043d\u0443\u0430\u0440_\u0444\u0435\u0431\u0440\u0443\u0430\u0440_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440_\u043e\u043a\u0442\u043e\u0431\u0430\u0440_\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440_\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440".split("_"),monthsShort:"\u0458\u0430\u043d._\u0444\u0435\u0431._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433._\u0441\u0435\u043f._\u043e\u043a\u0442._\u043d\u043e\u0432._\u0434\u0435\u0446.".split("_"),monthsParseExact:!0,weekdays:"\u043d\u0435\u0434\u0435\u0459\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a_\u0443\u0442\u043e\u0440\u0430\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a_\u043f\u0435\u0442\u0430\u043a_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434._\u043f\u043e\u043d._\u0443\u0442\u043e._\u0441\u0440\u0435._\u0447\u0435\u0442._\u043f\u0435\u0442._\u0441\u0443\u0431.".split("_"),weekdaysMin:"\u043d\u0435_\u043f\u043e_\u0443\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441\u0443".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[\u0434\u0430\u043d\u0430\u0441 \u0443] LT",nextDay:"[\u0441\u0443\u0442\u0440\u0430 \u0443] LT",nextWeek:function(){switch(this.day()){case 0:return"[\u0443] [\u043d\u0435\u0434\u0435\u0459\u0443] [\u0443] LT";case 3:return"[\u0443] [\u0441\u0440\u0435\u0434\u0443] [\u0443] LT";case 6:return"[\u0443] [\u0441\u0443\u0431\u043e\u0442\u0443] [\u0443] LT";case 1:case 2:case 4:case 5:return"[\u0443] dddd [\u0443] LT"}},lastDay:"[\u0458\u0443\u0447\u0435 \u0443] LT",lastWeek:function(){return["[\u043f\u0440\u043e\u0448\u043b\u0435] [\u043d\u0435\u0434\u0435\u0459\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0443\u0442\u043e\u0440\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0440\u0435\u0434\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0447\u0435\u0442\u0432\u0440\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u0435\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0443\u0431\u043e\u0442\u0435] [\u0443] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435 %s",s:"\u043d\u0435\u043a\u043e\u043b\u0438\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"\u0434\u0430\u043d",dd:t.translate,M:"\u043c\u0435\u0441\u0435\u0446",MM:t.translate,y:"\u0433\u043e\u0434\u0438\u043d\u0443",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},E2fk:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){return"[DBG]"===e?"debug":"[INF]"===e?"info":"[WRN]"===e?"warn":"[ERR]"===e?"err":""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"logPriority",type:e,pure:!0}),e})()},E9XD:function(e,t,n){"use strict";var i=n("I+eb"),r=n("1Y/n").left,s=n("pkCn"),o=n("LQDL"),a=n("YF1G");i({target:"Array",proto:!0,forced:!s("reduce")||!a&&o>79&&o<83},{reduce:function(e){var t=arguments.length;return r(this,e,t,t>1?arguments[1]:void 0)}})},EApP:function(e,t,n){"use strict";n.d(t,"a",function(){return R}),n.d(t,"b",function(){return E});var i=n("8Y7J"),r=n("GS7A"),s=n("XNiG"),o=n("cUpR"),a=n("SVse");const c=["toast-component",""];function l(e,t){if(1&e){const e=i.Yb();i.Xb(0,"button",5),i.lc("click",function(){return i.Ic(e),i.nc().remove()}),i.Xb(1,"span",6),i.Rc(2,"\xd7"),i.Wb(),i.Wb()}}function u(e,t){if(1&e&&(i.Vb(0),i.Rc(1),i.Ub()),2&e){const e=i.nc(2);i.Db(1),i.Tc("[",e.duplicatesCount+1,"]")}}function d(e,t){if(1&e&&(i.Xb(0,"div"),i.Rc(1),i.Pc(2,u,2,1,"ng-container",4),i.Wb()),2&e){const e=i.nc();i.Fb(e.options.titleClass),i.Eb("aria-label",e.title),i.Db(1),i.Tc(" ",e.title," "),i.Db(1),i.uc("ngIf",e.duplicatesCount)}}function h(e,t){if(1&e&&i.Sb(0,"div",7),2&e){const e=i.nc();i.Fb(e.options.messageClass),i.uc("innerHTML",e.message,i.Jc)}}function f(e,t){if(1&e&&(i.Xb(0,"div",8),i.Rc(1),i.Wb()),2&e){const e=i.nc();i.Fb(e.options.messageClass),i.Eb("aria-label",e.message),i.Db(1),i.Tc(" ",e.message," ")}}function p(e,t){if(1&e&&(i.Xb(0,"div"),i.Sb(1,"div",9),i.Wb()),2&e){const e=i.nc();i.Db(1),i.Nc("width",e.width+"%")}}function m(e,t){if(1&e){const e=i.Yb();i.Xb(0,"button",5),i.lc("click",function(){return i.Ic(e),i.nc().remove()}),i.Xb(1,"span",6),i.Rc(2,"\xd7"),i.Wb(),i.Wb()}}function b(e,t){if(1&e&&(i.Vb(0),i.Rc(1),i.Ub()),2&e){const e=i.nc(2);i.Db(1),i.Tc("[",e.duplicatesCount+1,"]")}}function g(e,t){if(1&e&&(i.Xb(0,"div"),i.Rc(1),i.Pc(2,b,2,1,"ng-container",4),i.Wb()),2&e){const e=i.nc();i.Fb(e.options.titleClass),i.Eb("aria-label",e.title),i.Db(1),i.Tc(" ",e.title," "),i.Db(1),i.uc("ngIf",e.duplicatesCount)}}function _(e,t){if(1&e&&i.Sb(0,"div",7),2&e){const e=i.nc();i.Fb(e.options.messageClass),i.uc("innerHTML",e.message,i.Jc)}}function v(e,t){if(1&e&&(i.Xb(0,"div",8),i.Rc(1),i.Wb()),2&e){const e=i.nc();i.Fb(e.options.messageClass),i.Eb("aria-label",e.message),i.Db(1),i.Tc(" ",e.message," ")}}function y(e,t){if(1&e&&(i.Xb(0,"div"),i.Sb(1,"div",9),i.Wb()),2&e){const e=i.nc();i.Db(1),i.Nc("width",e.width+"%")}}class w{constructor(e,t,n,i,r,o){this.toastId=e,this.config=t,this.message=n,this.title=i,this.toastType=r,this.toastRef=o,this._onTap=new s.a,this._onAction=new s.a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(e){this._onAction.next(e)}onAction(){return this._onAction.asObservable()}}const D={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},S=new i.u("ToastConfig");class x{constructor(e,t){this.component=e,this.injector=t}attach(e,t){return this._attachedHost=e,e.attach(this,t)}detach(){const e=this._attachedHost;if(e)return this._attachedHost=void 0,e.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class k extends class{attach(e,t){return this._attachedPortal=e,this.attachComponentPortal(e,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(e){this._disposeFn=e}}{constructor(e,t,n){super(),this._hostDomElement=e,this._componentFactoryResolver=t,this._appRef=n}attachComponentPortal(e,t){const n=this._componentFactoryResolver.resolveComponentFactory(e.component);let i;return i=n.create(e.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let T=(()=>{class e{constructor(e){this._document=e}ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const e=this._document.createElement("div");e.classList.add("overlay-container"),this._document.body.appendChild(e),this._containerElement=e}}return e.\u0275fac=function(t){return new(t||e)(i.ic(a.d))},e.\u0275prov=Object(i.Nb)({factory:function(){return new e(Object(i.ic)(a.d))},token:e,providedIn:"root"}),e})();class M{constructor(e){this._portalHost=e}attach(e,t=!0){return this._portalHost.attach(e,t)}detach(){return this._portalHost.detach()}}let C=(()=>{class e{constructor(e,t,n,i){this._overlayContainer=e,this._componentFactoryResolver=t,this._appRef=n,this._document=i,this._paneElements=new Map}create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){const n=this._document.createElement("div");return n.id="toast-container",n.classList.add(e),n.classList.add("toast-container"),t?t.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(e){return new k(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new M(this._createPortalHost(e))}}return e.\u0275fac=function(t){return new(t||e)(i.ic(T),i.ic(i.k),i.ic(i.g),i.ic(a.d))},e.\u0275prov=Object(i.Nb)({factory:function(){return new e(Object(i.ic)(T),Object(i.ic)(i.k),Object(i.ic)(i.g),Object(i.ic)(a.d))},token:e,providedIn:"root"}),e})();class O{constructor(e){this._overlayRef=e,this.duplicatesCount=0,this._afterClosed=new s.a,this._activate=new s.a,this._manualClose=new s.a,this._resetTimeout=new s.a,this._countDuplicate=new s.a}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(e,t){e&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}}class L{constructor(e,t){this._toastPackage=e,this._parentInjector=t}get(e,t,n){return e===w?this._toastPackage:this._parentInjector.get(e,t,n)}}let E=(()=>{class e{constructor(e,t,n,i,r){this.overlay=t,this._injector=n,this.sanitizer=i,this.ngZone=r,this.currentlyActive=0,this.toasts=[],this.index=0,this.toastrConfig=Object.assign(Object.assign({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=Object.assign(Object.assign({},e.default.iconClasses),e.config.iconClasses))}show(e,t,n={},i=""){return this._preBuildNotification(i,e,t,this.applyConfig(n))}success(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",e,t,this.applyConfig(n))}error(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",e,t,this.applyConfig(n))}info(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",e,t,this.applyConfig(n))}warning(e,t,n={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",e,t,this.applyConfig(n))}clear(e){for(const t of this.toasts)if(void 0!==e){if(t.toastId===e)return void t.toastRef.manualClose()}else t.toastRef.manualClose()}remove(e){const t=this._findToast(e);if(!t)return!1;if(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length)return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){const e=this.toasts[this.currentlyActive].toastRef;e.isInactive()||(this.currentlyActive=this.currentlyActive+1,e.activate())}return!0}findDuplicate(e="",t="",n,i){const{includeTitleDuplicates:r}=this.toastrConfig;for(const s of this.toasts){const o=r&&s.title===e;if((!r||o)&&s.message===t)return s.toastRef.onDuplicate(n,i),s}return null}applyConfig(e={}){return Object.assign(Object.assign({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,n,i){return i.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,n,i)):this._buildNotification(e,t,n,i)}_buildNotification(e,t,n,r){if(!r.toastComponent)throw new Error("toastComponent required");const s=this.findDuplicate(n,t,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||t)&&this.toastrConfig.preventDuplicates&&null!==s)return s;this.previousToastMessage=t;let o=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(o=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const a=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let c=t;t&&r.enableHtml&&(c=this.sanitizer.sanitize(i.L.HTML,t));const l=new O(a),u=new w(this.index,r,c,n,e,l),d=new L(u,this._injector),h=new x(r.toastComponent,d),f=a.attach(h,this.toastrConfig.newestOnTop);l.componentInstance=f.instance;const p={toastId:this.index,title:n||"",message:t||"",toastRef:l,onShown:l.afterActivate(),onHidden:l.afterClosed(),onTap:u.onTap(),onAction:u.onAction(),portal:f};return o||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{p.toastRef.activate()})),this.toasts.push(p),p}}return e.\u0275fac=function(t){return new(t||e)(i.ic(S),i.ic(C),i.ic(i.v),i.ic(o.b),i.ic(i.D))},e.\u0275prov=Object(i.Nb)({factory:function(){return new e(Object(i.ic)(S),Object(i.ic)(C),Object(i.ic)(i.r),Object(i.ic)(o.b),Object(i.ic)(i.D))},token:e,providedIn:"root"}),e})(),A=(()=>{class e{constructor(e,t,n){this.toastrService=e,this.toastPackage=t,this.ngZone=n,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(e=>{this.duplicatesCount=e})}get displayStyle(){if("inactive"===this.state.value)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=Object.assign(Object.assign({},this.state),{value:"active"}),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const e=(new Date).getTime();this.width=(this.hideTime-e)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=Object.assign(Object.assign({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=Object.assign(Object.assign({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0!==this.options.disableTimeOut&&"extendedTimeOut"!==this.options.disableTimeOut&&0!==this.options.extendedTimeOut&&"removed"!==this.state.value&&(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(E),i.Rb(w),i.Rb(i.D))},e.\u0275cmp=i.Lb({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,t){1&e&&i.lc("click",function(){return t.tapToast()})("mouseenter",function(){return t.stickAround()})("mouseleave",function(){return t.delayedHideToast()}),2&e&&(i.Oc("@flyInOut",t.state),i.Fb(t.toastClasses),i.Nc("display",t.displayStyle))},attrs:c,decls:5,vars:5,consts:[["class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class","innerHTML",4,"ngIf"],["role","alertdialog","aria-live","polite",3,"class",4,"ngIf"],[4,"ngIf"],["aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alertdialog","aria-live","polite",3,"innerHTML"],["role","alertdialog","aria-live","polite"],[1,"toast-progress"]],template:function(e,t){1&e&&(i.Pc(0,l,3,0,"button",0),i.Pc(1,d,3,5,"div",1),i.Pc(2,h,1,3,"div",2),i.Pc(3,f,2,4,"div",3),i.Pc(4,p,2,2,"div",4)),2&e&&(i.uc("ngIf",t.options.closeButton),i.Db(1),i.uc("ngIf",t.title),i.Db(1),i.uc("ngIf",t.message&&t.options.enableHtml),i.Db(1),i.uc("ngIf",t.message&&!t.options.enableHtml),i.Db(1),i.uc("ngIf",t.options.progressBar))},directives:[a.r],encapsulation:2,data:{animation:[Object(r.j)("flyInOut",[Object(r.g)("inactive",Object(r.h)({opacity:0})),Object(r.g)("active",Object(r.h)({opacity:1})),Object(r.g)("removed",Object(r.h)({opacity:0})),Object(r.i)("inactive => active",Object(r.e)("{{ easeTime }}ms {{ easing }}")),Object(r.i)("active => removed",Object(r.e)("{{ easeTime }}ms {{ easing }}"))])]}}),e})();const I=Object.assign(Object.assign({},D),{toastComponent:A});let R=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[{provide:S,useValue:{default:I,config:t}}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[[a.c]]}),e})(),P=(()=>{class e{constructor(e,t,n){this.toastrService=e,this.toastPackage=t,this.appRef=n,this.width=-1,this.toastClasses="",this.state="inactive",this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(e=>{this.duplicatesCount=e})}get displayStyle(){if("inactive"===this.state)return"none"}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(0===this.width||100===this.width||!this.options.timeOut)return;const e=(new Date).getTime();this.width=(this.hideTime-e)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=(new Date).getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){"removed"!==this.state&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){"removed"!==this.state&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){!0!==this.options.disableTimeOut&&"extendedTimeOut"!==this.options.disableTimeOut&&0!==this.options.extendedTimeOut&&"removed"!==this.state&&(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(E),i.Rb(w),i.Rb(i.g))},e.\u0275cmp=i.Lb({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,t){1&e&&i.lc("click",function(){return t.tapToast()})("mouseenter",function(){return t.stickAround()})("mouseleave",function(){return t.delayedHideToast()}),2&e&&(i.Fb(t.toastClasses),i.Nc("display",t.displayStyle))},attrs:c,decls:5,vars:5,consts:[["class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert","aria-live","polite",3,"class","innerHTML",4,"ngIf"],["role","alert","aria-live","polite",3,"class",4,"ngIf"],[4,"ngIf"],["aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert","aria-live","polite",3,"innerHTML"],["role","alert","aria-live","polite"],[1,"toast-progress"]],template:function(e,t){1&e&&(i.Pc(0,m,3,0,"button",0),i.Pc(1,g,3,5,"div",1),i.Pc(2,_,1,3,"div",2),i.Pc(3,v,2,4,"div",3),i.Pc(4,y,2,2,"div",4)),2&e&&(i.uc("ngIf",t.options.closeButton),i.Db(1),i.uc("ngIf",t.title),i.Db(1),i.uc("ngIf",t.message&&t.options.enableHtml),i.Db(1),i.uc("ngIf",t.message&&!t.options.enableHtml),i.Db(1),i.uc("ngIf",t.options.progressBar))},directives:[a.r],encapsulation:2}),e})();Object.assign(Object.assign({},D),{toastComponent:P})},EHx7:function(e,t,n){var i=n("0Dky"),r=n("2oRo").RegExp;e.exports=i(function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})},ENF9:function(e,t,n){"use strict";var i,r=n("2oRo"),s=n("4zBA"),o=n("4syw"),a=n("8YOa"),c=n("bWFh"),l=n("rKzb"),u=n("hh1v"),d=n("afO8").enforce,h=n("f5p1"),f=!r.ActiveXObject&&"ActiveXObject"in r,p=Object.isExtensible,m=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},b=c("WeakMap",m,l);if(h&&f){i=l.getConstructor(m,"WeakMap",!0),a.enable();var g=b.prototype,_=s(g.delete),v=s(g.has),y=s(g.get),w=s(g.set);o(g,{delete:function(e){if(u(e)&&!p(e)){var t=d(this);return t.frozen||(t.frozen=new i),_(this,e)||t.frozen.delete(e)}return _(this,e)},has:function(e){if(u(e)&&!p(e)){var t=d(this);return t.frozen||(t.frozen=new i),v(this,e)||t.frozen.has(e)}return v(this,e)},get:function(e){if(u(e)&&!p(e)){var t=d(this);return t.frozen||(t.frozen=new i),v(this,e)?y(this,e):t.frozen.get(e)}return y(this,e)},set:function(e,t){if(u(e)&&!p(e)){var n=d(this);n.frozen||(n.frozen=new i),v(this,e)?w(this,e,t):n.frozen.set(e,t)}else w(this,e,t);return this}})}},EOgW:function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21_\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c_\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21_\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19_\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21_\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19_\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21_\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21_\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19_\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21_\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19_\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21".split("_"),monthsShort:"\u0e21.\u0e04._\u0e01.\u0e1e._\u0e21\u0e35.\u0e04._\u0e40\u0e21.\u0e22._\u0e1e.\u0e04._\u0e21\u0e34.\u0e22._\u0e01.\u0e04._\u0e2a.\u0e04._\u0e01.\u0e22._\u0e15.\u0e04._\u0e1e.\u0e22._\u0e18.\u0e04.".split("_"),monthsParseExact:!0,weekdays:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysShort:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysMin:"\u0e2d\u0e32._\u0e08._\u0e2d._\u0e1e._\u0e1e\u0e24._\u0e28._\u0e2a.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm",LLLL:"\u0e27\u0e31\u0e19dddd\u0e17\u0e35\u0e48 D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm"},meridiemParse:/\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07|\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07/,isPM:function(e){return"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"===e},meridiem:function(e,t,n){return e<12?"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07":"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"},calendar:{sameDay:"[\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextDay:"[\u0e1e\u0e23\u0e38\u0e48\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextWeek:"dddd[\u0e2b\u0e19\u0e49\u0e32 \u0e40\u0e27\u0e25\u0e32] LT",lastDay:"[\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e27\u0e32\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",lastWeek:"[\u0e27\u0e31\u0e19]dddd[\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e27\u0e25\u0e32] LT",sameElse:"L"},relativeTime:{future:"\u0e2d\u0e35\u0e01 %s",past:"%s\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27",s:"\u0e44\u0e21\u0e48\u0e01\u0e35\u0e48\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",ss:"%d \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",m:"1 \u0e19\u0e32\u0e17\u0e35",mm:"%d \u0e19\u0e32\u0e17\u0e35",h:"1 \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",hh:"%d \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",d:"1 \u0e27\u0e31\u0e19",dd:"%d \u0e27\u0e31\u0e19",w:"1 \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",ww:"%d \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",M:"1 \u0e40\u0e14\u0e37\u0e2d\u0e19",MM:"%d \u0e40\u0e14\u0e37\u0e2d\u0e19",y:"1 \u0e1b\u0e35",yy:"%d \u0e1b\u0e35"}})}(n("wd/R"))},EQ5u:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return c});var i=n("XNiG"),r=n("HDdC"),s=(n("7o/Q"),n("quSY")),o=n("x+ZX");class a extends r.a{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new s.a,e.add(this.source.subscribe(new l(this.getSubject(),this))),e.closed&&(this._connection=null,e=s.a.EMPTY)),e}refCount(){return Object(o.a)()(this)}}const c=(()=>{const e=a.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}})();class l extends i.b{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}},EUcb:function(e,t,n){"use strict";t.a=function(e){return null!=e&&"object"==typeof e}},EY2u:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return s});var i=n("HDdC");const r=new i.a(e=>e.complete());function s(e){return e?function(e){return new i.a(t=>e.schedule(()=>t.complete()))}(e):r}},EgGo:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("SVse"),r=n("sne2");class s{constructor(e){this.base=e}static concatURLSegments(e){return e.reduce(i.m.joinWithSlash)}static buildURL(e,...t){return s.concatURLSegments([...e?["/"]:[],...t])}getURL(e,t=!0,...n){return s.buildURL(t,this.base,e,...n)}getCreate(e=!0){return this.getURL(r.e.CREATE,e)}getCreateFrom(e,t=!0){return this.getURL(r.e.CREATE,t,e)}getDelete(e=!0){return this.getURL(r.e.DELETE,e)}getEdit(e,t=!0){return this.getURL(r.e.EDIT,t,e)}getUpdate(e,t=!0){return this.getURL(r.e.UPDATE,t,e)}getAdd(e=!0){return this.getURL(r.e.ADD,e)}getRemove(e=!0){return this.getURL(r.e.REMOVE,e)}getRecreate(e,t=!0){return this.getURL(r.e.RECREATE,t,e)}}},Ekvf:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("mrSG"),r=n("IheW"),s=n("lJxs"),o=n("xTzq"),a=n("o8EM"),c=n("8Y7J");let l=(()=>{let e=class{constructor(e,t){this.http=e,this.rbdConfigurationService=t,this.apiPath="api/pool"}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}update(e){let t;return e.hasOwnProperty("srcpool")?(t=e.srcpool,delete e.srcpool):(t=e.pool,delete e.pool),this.http.put(`${this.apiPath}/${encodeURIComponent(t)}`,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}get(e){return this.http.get(`${this.apiPath}/${e}`)}getList(){return this.http.get(`${this.apiPath}?stats=true`)}getConfiguration(e){return this.http.get(`${this.apiPath}/${e}/configuration`).pipe(Object(s.a)(e=>e.map(e=>Object.assign(e,this.rbdConfigurationService.getOptionByName(e.name)))))}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}list(e=[]){const t=e.join(",");return this.http.get(`${this.apiPath}?attrs=${t}`).toPromise().then(e=>e)}};return e.\u0275fac=function(t){return new(t||e)(c.ic(r.b),c.ic(a.a))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([o.a,Object(i.d)("design:paramtypes",[r.b,a.a])],e),e})()},EmSq:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("8Y7J"),r=n("LvDl"),s=n.n(r),o=n("Fgil"),a=n("aXbf"),c=n("s7LF");let l=(()=>{class e{constructor(e,t,n,r){this.elementRef=e,this.control=t,this.dimlessBinaryPipe=n,this.formatter=r,this.ngModelChange=new i.p,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value)}setValue(e){/^[\d.]+$/.test(e)&&(e+=this.defaultUnit||"m");const t=this.formatter.toBytes(e),n=this.round(t);this.el.value=this.dimlessBinaryPipe.transform(n),null!==t?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(e){if(null!==e&&0!==e){if(!s.a.isUndefined(this.minBytes)&&e<this.minBytes)return this.minBytes;if(!s.a.isUndefined(this.maxBytes)&&e>this.maxBytes)return this.maxBytes;if(!s.a.isUndefined(this.roundPower)){const t=Math.round(Math.log(e)/Math.log(this.roundPower));return Math.pow(this.roundPower,t)}}return e}onBlur(e){this.setValue(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(c.p),i.Rb(o.a),i.Rb(a.a))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdDimlessBinary",""]],hostBindings:function(e,t){1&e&&i.lc("blur",function(e){return t.onBlur(e.target.value)})},inputs:{minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),e})()},F8JR:function(e,t,n){"use strict";var i=n("tycR").forEach,r=n("pkCn")("forEach");e.exports=r?[].forEach:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}},FFMq:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){return e.join(", ")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"join",type:e,pure:!0}),e})()},FMNM:function(e,t,n){var i=n("2oRo"),r=n("xluM"),s=n("glrk"),o=n("Fib7"),a=n("xrYK"),c=n("kmMV"),l=i.TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var i=r(n,e,t);return null!==i&&s(i),i}if("RegExp"===a(e))return r(c,e,t);throw l("RegExp#exec called on incompatible receiver")}},FSuO:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("8Y7J"),r=n("LvDl"),s=n.n(r),o=n("x38r"),a=n("a0VL"),c=n("uIqm");let l=(()=>{class e{constructor(e){this.datePipe=e,this.autoReload=5e3,this.renderObjects=!1,this.appendParentKey=!0,this.hideEmpty=!1,this.hideKeys=[],this.columns=[],this.fetchData=new i.p}ngOnInit(){this.columns=[{prop:"key",flexGrow:1,cellTransformation:o.a.bold},{prop:"value",flexGrow:3}],this.customCss&&(this.columns[1].cellTransformation=o.a.classAdding),this.fetchData.observers.length>0&&this.table.fetchData.subscribe(()=>{this.fetchData.emit()}),this.useData()}ngOnChanges(){this.useData()}useData(){if(!this.data)return;let e=this.makePairs(this.data);this.hideKeys&&(e=e.filter(e=>!this.hideKeys.includes(e.key))),this.tableData=e}makePairs(e){let t=[];if(e){if(s.a.isArray(e))t=this.makePairsFromArray(e);else{if(!s.a.isObject(e))throw new Error("Wrong data format");t=this.makePairsFromObject(e)}return t=t.map(e=>(e.value=this.convertValue(e.value),e)).filter(e=>null!==e.value),s.a.sortBy(this.renderObjects?this.insertFlattenObjects(t):t,"key")}}makePairsFromArray(e){let t=[];const n=e[0];if(s.a.isArray(n)){if(2!==n.length)throw new Error(`Array contains too many elements (${n.length}). Needs to be of type [string, any][]`);t=e.map(e=>({key:e[0],value:e[1]}))}else s.a.isObject(n)&&(t=s.a.has(n,"key")&&s.a.has(n,"value")?[...e]:e.reduce((e,t)=>e.concat(this.makePairsFromObject(t)),t));return t}makePairsFromObject(e){return Object.keys(e).map(t=>({key:t,value:e[t]}))}insertFlattenObjects(e){return s.a.flattenDeep(e.map(e=>{const t=e.value,n=s.a.isObject(t);return!n||s.a.isEmpty(t)?(n&&(e.value=""),e):this.splitItemIntoItems(e)}))}splitItemIntoItems(e){return this.makePairs(e.value).map(t=>(this.appendParentKey&&(t.key=e.key+" "+t.key),t))}convertValue(e){if(s.a.isArray(e)){if(s.a.isEmpty(e)&&this.hideEmpty)return null;e=e.map(e=>s.a.isObject(e)?JSON.stringify(e):e).join(", ")}else if(s.a.isObject(e)){if(this.hideEmpty&&s.a.isEmpty(e)||!this.renderObjects)return null}else if(s.a.isString(e)){if(""===e&&this.hideEmpty)return null;this.isDate(e)&&(e=this.datePipe.transform(e)||e)}return e}isDate(e){const t="[ -:.TZ]",n="\\d{2}"+t;return e.match(new RegExp("^\\d{4}"+t+n+n+n+n+n+"\\d*Z?$"))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(a.a))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-table-key-value"]],viewQuery:function(e,t){if(1&e&&i.Wc(c.a,3),2&e){let e;i.Ec(e=i.mc())&&(t.table=e.first)}},inputs:{data:"data",autoReload:"autoReload",renderObjects:"renderObjects",appendParentKey:"appendParentKey",hideEmpty:"hideEmpty",hideKeys:"hideKeys",customCss:"customCss"},outputs:{fetchData:"fetchData"},features:[i.Bb],decls:2,vars:9,consts:[["columnMode","flex",3,"data","columns","toolHeader","autoReload","customCss","autoSave","header","footer","limit"],["table",""]],template:function(e,t){1&e&&i.Sb(0,"cd-table",0,1),2&e&&i.uc("data",t.tableData)("columns",t.columns)("toolHeader",!1)("autoReload",t.autoReload)("customCss",t.customCss)("autoSave",!1)("header",!1)("footer",!1)("limit",0)},directives:[c.a],styles:[""]}),e})()},Fgil:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1024,["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"])}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(i.a))},e.\u0275pipe=r.Qb({name:"dimlessBinary",type:e,pure:!0}),e})()},Fib7:function(e,t){e.exports=function(e){return"function"==typeof e}},Fnuy:function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"geni\xe8r_febri\xe8r_mar\xe7_abril_mai_junh_julhet_agost_setembre_oct\xf2bre_novembre_decembre".split("_"),format:"de geni\xe8r_de febri\xe8r_de mar\xe7_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'oct\xf2bre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dim\xe8cres_dij\xf2us_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[u\xe8i a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[i\xe8r a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},"G+Rx":function(e,t,n){var i=n("0GbY");e.exports=i("document","documentElement")},G0Uy:function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_\u0120unju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Di\u010bembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_\u0120un_Lul_Aww_Set_Ott_Nov_Di\u010b".split("_"),weekdays:"Il-\u0126add_It-Tnejn_It-Tlieta_L-Erbg\u0127a_Il-\u0126amis_Il-\u0120img\u0127a_Is-Sibt".split("_"),weekdaysShort:"\u0126ad_Tne_Tli_Erb_\u0126am_\u0120im_Sib".split("_"),weekdaysMin:"\u0126a_Tn_Tl_Er_\u0126a_\u0120i_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[G\u0127ada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-biera\u0127 fil-]LT",lastWeek:"dddd [li g\u0127adda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f\u2019 %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"sieg\u0127a",hh:"%d sieg\u0127at",d:"\u0121urnata",dd:"%d \u0121ranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},G0yt:function(e,t,n){"use strict";n.d(t,"a",function(){return un}),n.d(t,"b",function(){return Ue}),n.d(t,"c",function(){return qe}),n.d(t,"d",function(){return at}),n.d(t,"e",function(){return tt}),n.d(t,"f",function(){return nt}),n.d(t,"g",function(){return St}),n.d(t,"h",function(){return Ut}),n.d(t,"i",function(){return tn}),n.d(t,"j",function(){return Kt}),n.d(t,"k",function(){return Qt}),n.d(t,"l",function(){return nn}),n.d(t,"m",function(){return en}),n.d(t,"n",function(){return Xt}),n.d(t,"o",function(){return mn}),n.d(t,"p",function(){return wn}),n.d(t,"q",function(){return vn}),n.d(t,"r",function(){return yn}),n.d(t,"s",function(){return Dn}),n.d(t,"t",function(){return xn}),n.d(t,"u",function(){return Sn}),n.d(t,"v",function(){return Jt}),n.d(t,"w",function(){return An}),n.d(t,"x",function(){return On}),n.d(t,"y",function(){return In}),n.d(t,"z",function(){return Pn}),n.d(t,"A",function(){return Fn}),n.d(t,"B",function(){return Gn}),n.d(t,"C",function(){return Jn}),n.d(t,"D",function(){return ei}),n.d(t,"E",function(){return Kn}),n.d(t,"F",function(){return ti}),n.d(t,"G",function(){return ui}),n.d(t,"H",function(){return di});var i=n("mrSG"),r=n("8Y7J"),s=n("SVse"),o=n("s7LF"),a=n("XNiG"),c=n("2Vo4"),l=(n("itXk"),n("PqYM"),n("5yfJ"),n("xgIS")),u=n("VRyK"),d=n("DH7j"),h=n("yCtX"),f=n("l7GE"),p=n("ZUHj");class m{call(e,t){return t.subscribe(new b(e))}}class b extends f.a{constructor(e){super(e),this.hasFirst=!1,this.observables=[],this.subscriptions=[]}_next(e){this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(let n=0;n<t&&!this.hasFirst;n++){const t=e[n],i=Object(p.a)(this,t,void 0,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}}notifyNext(e,t,n){if(!this.hasFirst){this.hasFirst=!0;for(let e=0;e<this.subscriptions.length;e++)if(e!==n){let t=this.subscriptions[e];t.unsubscribe(),this.remove(t)}this.subscriptions=null}this.destination.next(t)}}var g=n("HDdC"),_=n("lJxs"),v=(n("JX91"),n("/uUt"),n("eIep")),y=n("1G5W"),w=n("pLZG"),D=n("IzEk"),S=n("vkgz");function x(...e){return t=>{let n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new k(e,n))}}class k{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new T(e,this.observables,this.project))}}class T extends f.a{constructor(e,t,n){super(e),this.observables=t,this.project=n,this.toRespond=[];const i=t.length;this.values=new Array(i);for(let r=0;r<i;r++)this.toRespond.push(r);for(let r=0;r<i;r++){let e=t[r];this.add(Object(p.a)(this,e,void 0,r))}}notifyNext(e,t,n){this.values[n]=t;const i=this.toRespond;if(i.length>0){const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}var M=n("3E0/"),C=n("w1tV");function O(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",1),r.lc("click",function(){return r.Ic(e),r.nc().closeHandler()}),r.Xb(1,"span",2),r.Rc(2,"\xd7"),r.Wb(),r.Wb()}}const L=["*"],E=["defaultDayTemplate"],A=["content"];function I(e,t){if(1&e&&r.Sb(0,"div",7),2&e){const e=t.currentMonth,n=t.selected,i=t.disabled,s=t.focused;r.uc("date",t.date)("currentMonth",e)("selected",n)("disabled",i)("focused",s)}}function R(e,t){if(1&e&&(r.Xb(0,"div",12),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc(2);r.Db(1),r.Uc(" ",t.i18n.getMonthFullName(e.number,e.year)," ",t.i18n.getYearNumerals(e.year)," ")}}function P(e,t){if(1&e&&(r.Xb(0,"div",9),r.Pc(1,R,2,2,"div",10),r.Sb(2,"ngb-datepicker-month",11),r.Wb()),2&e){const e=t.$implicit,n=r.nc(2);r.Db(1),r.uc("ngIf","none"===n.navigation||n.displayMonths>1&&"select"===n.navigation),r.Db(1),r.uc("month",e.firstDate)}}function F(e,t){if(1&e&&r.Pc(0,P,3,2,"div",8),2&e){const e=r.nc();r.uc("ngForOf",e.model.months)}}function W(e,t){if(1&e){const e=r.Yb();r.Xb(0,"ngb-datepicker-navigation",13),r.lc("navigate",function(t){return r.Ic(e),r.nc().onNavigateEvent(t)})("select",function(t){return r.Ic(e),r.nc().onNavigateDateSelect(t)}),r.Wb()}if(2&e){const e=r.nc();r.uc("date",e.model.firstDate)("months",e.model.months)("disabled",e.model.disabled)("showSelect","select"===e.model.navigation)("prevDisabled",e.model.prevDisabled)("nextDisabled",e.model.nextDisabled)("selectBoxes",e.model.selectBoxes)}}function j(e,t){}function Y(e,t){}function N(e,t){1&e&&r.Sb(0,"div",5)}function z(e,t){if(1&e&&(r.Xb(0,"div",6),r.Rc(1),r.Wb()),2&e){const e=t.$implicit,n=r.nc(2);r.Db(1),r.Tc(" ",n.i18n.getWeekdayShortName(e)," ")}}function $(e,t){if(1&e&&(r.Xb(0,"div",2),r.Pc(1,N,1,0,"div",3),r.Pc(2,z,2,1,"div",4),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngIf",e.datepicker.showWeekNumbers),r.Db(1),r.uc("ngForOf",e.viewModel.weekdays)}}function H(e,t){if(1&e&&(r.Xb(0,"div",11),r.Rc(1),r.Wb()),2&e){const e=r.nc(2).$implicit,t=r.nc();r.Db(1),r.Sc(t.i18n.getWeekNumerals(e.number))}}function X(e,t){}function V(e,t){if(1&e&&r.Pc(0,X,0,0,"ng-template",14),2&e){const e=r.nc().$implicit,t=r.nc(3);r.uc("ngTemplateOutlet",t.datepicker.dayTemplate)("ngTemplateOutletContext",e.context)}}function B(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",12),r.lc("click",function(n){r.Ic(e);const i=t.$implicit;return r.nc(3).doSelect(i),n.preventDefault()}),r.Pc(1,V,1,2,"ng-template",13),r.Wb()}if(2&e){const e=t.$implicit;r.Jb("disabled",e.context.disabled)("hidden",e.hidden)("ngb-dp-today",e.context.today),r.uc("tabindex",e.tabindex),r.Eb("aria-label",e.ariaLabel),r.Db(1),r.uc("ngIf",!e.hidden)}}function U(e,t){if(1&e&&(r.Xb(0,"div",8),r.Pc(1,H,2,1,"div",9),r.Pc(2,B,2,9,"div",10),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc();r.Db(1),r.uc("ngIf",t.datepicker.showWeekNumbers),r.Db(1),r.uc("ngForOf",e.days)}}function q(e,t){1&e&&r.Pc(0,U,3,2,"div",7),2&e&&r.uc("ngIf",!t.$implicit.collapsed)}function G(e,t){if(1&e){const e=r.Yb();r.Xb(0,"ngb-datepicker-navigation-select",7),r.lc("select",function(t){return r.Ic(e),r.nc().select.emit(t)}),r.Wb()}if(2&e){const e=r.nc();r.uc("date",e.date)("disabled",e.disabled)("months",e.selectBoxes.months)("years",e.selectBoxes.years)}}function J(e,t){1&e&&r.Sb(0,"div",0)}function K(e,t){1&e&&r.Sb(0,"div",0)}function Q(e,t){if(1&e&&(r.Pc(0,J,1,0,"div",9),r.Xb(1,"div",10),r.Rc(2),r.Wb(),r.Pc(3,K,1,0,"div",9)),2&e){const e=t.$implicit,n=t.index,i=r.nc(2);r.uc("ngIf",n>0),r.Db(2),r.Uc(" ",i.i18n.getMonthFullName(e.number,e.year)," ",i.i18n.getYearNumerals(e.year)," "),r.Db(1),r.uc("ngIf",n!==i.months.length-1)}}function Z(e,t){if(1&e&&r.Pc(0,Q,4,4,"ng-template",8),2&e){const e=r.nc();r.uc("ngForOf",e.months)}}const ee=["ngbDatepickerDayView",""],te=["month"],ne=["year"];function ie(e,t){if(1&e&&(r.Xb(0,"option",5),r.Rc(1),r.Wb()),2&e){const e=t.$implicit,n=r.nc();r.uc("value",e),r.Eb("aria-label",n.i18n.getMonthFullName(e,null==n.date?null:n.date.year)),r.Db(1),r.Sc(n.i18n.getMonthShortName(e,null==n.date?null:n.date.year))}}function re(e,t){if(1&e&&(r.Xb(0,"option",5),r.Rc(1),r.Wb()),2&e){const e=t.$implicit,n=r.nc();r.uc("value",e),r.Db(1),r.Sc(n.i18n.getYearNumerals(e))}}const se=["dialog"],oe=["ngbNavOutlet",""];function ae(e,t){}const ce=function(e){return{$implicit:e}};function le(e,t){if(1&e&&(r.Xb(0,"div",2),r.Pc(1,ae,0,0,"ng-template",3),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc();r.Jb("active",e.active),r.uc("id",e.panelDomId),r.Eb("role",t.paneRole?t.paneRole:t.nav.roles?"tabpanel":void 0)("aria-labelledby",e.domId),r.Db(1),r.uc("ngTemplateOutlet",(null==e.contentTpl?null:e.contentTpl.templateRef)||null)("ngTemplateOutletContext",r.zc(7,ce,e.active))}}function ue(e,t){1&e&&r.Pc(0,le,2,9,"div",1),2&e&&r.uc("ngIf",t.$implicit.isPanelInDom())}function de(e,t){if(1&e&&r.Rc(0),2&e){const e=r.nc(2);r.Sc(e.title)}}function he(e,t){}function fe(e,t){if(1&e&&(r.Xb(0,"h3",3),r.Pc(1,de,1,1,"ng-template",null,4,r.Qc),r.Pc(3,he,0,0,"ng-template",5),r.Wb()),2&e){const e=r.Fc(2),t=r.nc();r.Db(3),r.uc("ngTemplateOutlet",t.isTitleTemplate()?t.title:e)("ngTemplateOutletContext",t.context)}}function pe(e,t){if(1&e&&(r.Xb(0,"span"),r.bc(1,3),r.oc(2,"percent"),r.Wb()),2&e){const e=r.nc();r.Db(2),r.fc(r.pc(2,1,e.getValue()/e.max)),r.cc(1)}}function me(e,t){1&e&&r.Rc(0),2&e&&r.Sc(100===t.fill?"\u2605":"\u2606")}function be(e,t){}function ge(e,t){if(1&e){const e=r.Yb();r.Xb(0,"span",2),r.Rc(1),r.Wb(),r.Xb(2,"span",3),r.lc("mouseenter",function(){r.Ic(e);const n=t.index;return r.nc().enter(n+1)})("click",function(){r.Ic(e);const n=t.index;return r.nc().handleClick(n+1)}),r.Pc(3,be,0,0,"ng-template",4),r.Wb()}if(2&e){const e=t.index,n=r.nc(),i=r.Fc(1);r.Db(1),r.Tc("(",e<n.nextRate?"*":" ",")"),r.Db(1),r.Nc("cursor",n.readonly||n.disabled?"default":"pointer"),r.Db(1),r.uc("ngTemplateOutlet",n.starTemplate||n.starTemplateFromContent||i)("ngTemplateOutletContext",n.contexts[e])}}function _e(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc();return t.changeHour(t.hourStep)}),r.Sb(1,"span",12),r.Xb(2,"span",13),r.bc(3,14),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function ve(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc();return t.changeHour(-t.hourStep)}),r.Sb(1,"span",15),r.Xb(2,"span",13),r.bc(3,16),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function ye(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc();return t.changeMinute(t.minuteStep)}),r.Sb(1,"span",12),r.Xb(2,"span",13),r.bc(3,17),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function we(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc();return t.changeMinute(-t.minuteStep)}),r.Sb(1,"span",15),r.Xb(2,"span",13),r.bc(3,18),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function De(e,t){1&e&&(r.Xb(0,"div",5),r.Rc(1,":"),r.Wb())}function Se(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc(2);return t.changeSecond(t.secondStep)}),r.Sb(1,"span",12),r.Xb(2,"span",13),r.bc(3,21),r.Wb(),r.Wb()}if(2&e){const e=r.nc(2);r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function xe(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",11),r.lc("click",function(){r.Ic(e);const t=r.nc(2);return t.changeSecond(-t.secondStep)}),r.Sb(1,"span",15),r.Xb(2,"span",13),r.bc(3,22),r.Wb(),r.Wb()}if(2&e){const e=r.nc(2);r.Jb("btn-sm",e.isSmallSize)("btn-lg",e.isLargeSize)("disabled",e.disabled),r.uc("disabled",e.disabled)}}function ke(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",19),r.Pc(1,Se,4,7,"button",3),r.Xb(2,"input",20),r.lc("change",function(t){return r.Ic(e),r.nc().updateSecond(t.target.value)})("input",function(t){return r.Ic(e),r.nc().formatInput(t.target)})("keydown.ArrowUp",function(t){r.Ic(e);const n=r.nc();return n.changeSecond(n.secondStep),t.preventDefault()})("keydown.ArrowDown",function(t){r.Ic(e);const n=r.nc();return n.changeSecond(-n.secondStep),t.preventDefault()}),r.Wb(),r.Pc(3,xe,4,7,"button",3),r.Wb()}if(2&e){const e=r.nc();r.Db(1),r.uc("ngIf",e.spinners),r.Db(1),r.Jb("form-control-sm",e.isSmallSize)("form-control-lg",e.isLargeSize),r.uc("value",e.formatMinSec(null==e.model?null:e.model.second))("readOnly",e.readonlyInputs)("disabled",e.disabled),r.Db(1),r.uc("ngIf",e.spinners)}}function Te(e,t){1&e&&r.Sb(0,"div",5)}function Me(e,t){if(1&e&&(r.Vb(0),r.bc(1,27),r.Ub()),2&e){const e=r.nc(2);r.Db(1),r.fc(e.i18n.getAfternoonPeriod()),r.cc(1)}}function Ce(e,t){if(1&e&&r.bc(0,28),2&e){const e=r.nc(2);r.fc(e.i18n.getMorningPeriod()),r.cc(0)}}function Oe(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",23),r.Xb(1,"button",24),r.lc("click",function(){return r.Ic(e),r.nc().toggleMeridian()}),r.Pc(2,Me,2,1,"ng-container",25),r.Pc(3,Ce,1,1,"ng-template",null,26,r.Qc),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(4),t=r.nc();r.Db(1),r.Jb("btn-sm",t.isSmallSize)("btn-lg",t.isLargeSize)("disabled",t.disabled),r.uc("disabled",t.disabled),r.Db(1),r.uc("ngIf",t.model&&t.model.hour>=12)("ngIfElse",e)}}function Le(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc();r.Fb(t.highlightClass),r.Db(1),r.Sc(e)}}function Ee(e,t){if(1&e&&r.Rc(0),2&e){const e=r.nc().$implicit;r.Sc(e)}}function Ae(e,t){if(1&e&&(r.Pc(0,Le,2,3,"span",1),r.Pc(1,Ee,1,1,"ng-template",null,2,r.Qc)),2&e){const e=t.odd,n=r.Fc(2);r.uc("ngIf",e)("ngIfElse",n)}}function Ie(e,t){if(1&e&&r.Sb(0,"ngb-highlight",2),2&e){const e=t.term;r.uc("result",(0,t.formatter)(t.result))("term",e)}}function Re(e,t){}const Pe=function(e,t,n){return{result:e,term:t,formatter:n}};function Fe(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",3),r.lc("mouseenter",function(){r.Ic(e);const n=t.index;return r.nc().markActive(n)})("click",function(){r.Ic(e);const n=t.$implicit;return r.nc().select(n)}),r.Pc(1,Re,0,0,"ng-template",4),r.Wb()}if(2&e){const e=t.$implicit,n=t.index,i=r.nc(),s=r.Fc(1);r.Jb("active",n===i.activeIdx),r.uc("id",i.id+"-"+n),r.Db(1),r.uc("ngTemplateOutlet",i.resultTemplate||s)("ngTemplateOutletContext",r.Bc(5,Pe,e,i.term,i.formatter))}}function We(e){return parseInt(`${e}`,10)}function je(e){return null!=e?`${e}`:""}function Ye(e,t,n=0){return Math.max(Math.min(e,t),n)}function Ne(e){return"string"==typeof e}function ze(e){return!isNaN(We(e))}function $e(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function He(e){return null!=e}function Xe(e){return ze(e)?`0${e}`.slice(-2):""}function Ve(e,t){return e&&e.className&&e.className.split&&e.className.split(/\s+/).indexOf(t)>=0}"undefined"==typeof Element||Element.prototype.closest||(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest=function(e){let t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});let Be=(()=>{let e=class{constructor(){this.dismissible=!0,this.type="warning"}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Ue=(()=>{let e=class{constructor(e,t,n){this._renderer=t,this._element=n,this.close=new r.p,this.dismissible=e.dismissible,this.type=e.type}closeHandler(){this.close.emit()}ngOnChanges(e){const t=e.type;t&&!t.firstChange&&(this._renderer.removeClass(this._element.nativeElement,`alert-${t.previousValue}`),this._renderer.addClass(this._element.nativeElement,`alert-${t.currentValue}`))}ngOnInit(){this._renderer.addClass(this._element.nativeElement,`alert-${this.type}`)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Be),r.Rb(r.H),r.Rb(r.n))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-alert"]],hostAttrs:["role","alert",1,"alert"],hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("alert-dismissible",t.dismissible)},inputs:{dismissible:"dismissible",type:"type"},outputs:{close:"close"},features:[r.Bb],ngContentSelectors:L,decls:2,vars:1,consts:function(){let e;return e="Close",[["type","button","class","close","aria-label",e,3,"click",4,"ngIf"],["type","button","aria-label",e,1,"close",3,"click"],["aria-hidden","true"]]},template:function(e,t){1&e&&(r.tc(),r.sc(0),r.Pc(1,O,3,0,"button",0)),2&e&&(r.Db(1),r.uc("ngIf",t.dismissible))},directives:[s.r],styles:["ngb-alert{display:block}"],encapsulation:2,changeDetection:0}),e})(),qe=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})(),Ge=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbButtonLabel",""]],hostVars:8,hostBindings:function(e,t){2&e&&r.Jb("btn",!0)("active",t.active)("disabled",t.disabled)("focus",t.focused)}}),e})();const Je={provide:o.o,useExisting:Object(r.W)(()=>Ke),multi:!0};let Ke=(()=>{let e=class{constructor(e,t){this._label=e,this._cd=t,this.disabled=!1,this.valueChecked=!0,this.valueUnChecked=!1,this.onChange=e=>{},this.onTouched=()=>{}}set focused(e){this._label.focused=e,e||this.onTouched()}onInputChange(e){const t=e.target.checked?this.valueChecked:this.valueUnChecked;this.onChange(t),this.onTouched(),this.writeValue(t)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._label.disabled=e}writeValue(e){this.checked=e===this.valueChecked,this._label.active=this.checked,this._cd.markForCheck()}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Ge),r.Rb(r.i))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbButton","","type","checkbox"]],hostVars:2,hostBindings:function(e,t){1&e&&r.lc("change",function(e){return t.onInputChange(e)})("focus",function(){return t.focused=!0})("blur",function(){return t.focused=!1}),2&e&&r.ac("checked",t.checked)("disabled",t.disabled)},inputs:{disabled:"disabled",valueChecked:"valueChecked",valueUnChecked:"valueUnChecked"},features:[r.Cb([Je])]}),e})();const Qe={provide:o.o,useExisting:Object(r.W)(()=>et),multi:!0};let Ze=0,et=(()=>{let e=class{constructor(){this._radios=new Set,this._value=null,this.name="ngb-radio-"+Ze++,this.onChange=e=>{},this.onTouched=()=>{}}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}onRadioChange(e){this.writeValue(e.value),this.onChange(e.value)}onRadioValueUpdate(){this._updateRadiosValue()}register(e){this._radios.add(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._disabled=e,this._updateRadiosDisabled()}unregister(e){this._radios.delete(e)}writeValue(e){this._value=e,this._updateRadiosValue()}_updateRadiosValue(){this._radios.forEach(e=>e.updateValue(this._value))}_updateRadiosDisabled(){this._radios.forEach(e=>e.updateDisabled())}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbRadioGroup",""]],hostAttrs:["role","radiogroup"],inputs:{name:"name"},features:[r.Cb([Qe])]}),e})(),tt=(()=>{let e=class{constructor(){this.collapsed=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbCollapse",""]],hostVars:4,hostBindings:function(e,t){2&e&&r.Jb("collapse",!0)("show",!t.collapsed)},inputs:{collapsed:["ngbCollapse","collapsed"]},exportAs:["ngbCollapse"]}),e})(),nt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({}),e})();class it{constructor(e,t,n){this.year=$e(e)?e:null,this.month=$e(t)?t:null,this.day=$e(n)?n:null}static from(e){return e instanceof it?e:e?new it(e.year,e.month,e.day):null}equals(e){return null!=e&&this.year===e.year&&this.month===e.month&&this.day===e.day}before(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day<e.day:this.month<e.month:this.year<e.year)}after(e){return!!e&&(this.year===e.year?this.month===e.month?this.day!==e.day&&this.day>e.day:this.month>e.month:this.year>e.year)}}function rt(e){return new it(e.getFullYear(),e.getMonth()+1,e.getDate())}function st(e){const t=new Date(e.year,e.month-1,e.day,12);return isNaN(t.getTime())||t.setFullYear(e.year),t}function ot(){return new ct}let at=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:ot,token:e,providedIn:"root"}),e})(),ct=(()=>{let e=class extends at{getDaysPerWeek(){return 7}getMonths(){return[1,2,3,4,5,6,7,8,9,10,11,12]}getWeeksPerMonth(){return 6}getNext(e,t="d",n=1){let i=st(e),r=!0,s=i.getMonth();switch(t){case"y":i.setFullYear(i.getFullYear()+n);break;case"m":s+=n,i.setMonth(s),s%=12,s<0&&(s+=12);break;case"d":i.setDate(i.getDate()+n),r=!1;break;default:return e}return r&&i.getMonth()!==s&&i.setDate(0),rt(i)}getPrev(e,t="d",n=1){return this.getNext(e,t,-n)}getWeekday(e){let t=st(e).getDay();return 0===t?7:t}getWeekNumber(e,t){7===t&&(t=0);const n=st(e[(11-t)%7]);n.setDate(n.getDate()+4-(n.getDay()||7));const i=n.getTime();return n.setMonth(0),n.setDate(1),Math.floor(Math.round((i-n.getTime())/864e5)/7)+1}getToday(){return rt(new Date)}isValid(e){if(!(e&&$e(e.year)&&$e(e.month)&&$e(e.day)))return!1;if(0===e.year)return!1;const t=st(e);return!isNaN(t.getTime())&&t.getFullYear()===e.year&&t.getMonth()+1===e.month&&t.getDate()===e.day}};return e.\u0275fac=function(t){return hi(t||e)},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();function lt(e,t){return!function(e,t){return!e&&!t||!!e&&!!t&&e.equals(t)}(e,t)}function ut(e,t){return!(!e&&!t||e&&t&&e.year===t.year&&e.month===t.month)}function dt(e,t,n){return e&&t&&e.before(t)?t:e&&n&&e.after(n)?n:e||null}function ht(e,t){const{minDate:n,maxDate:i,disabled:r,markDisabled:s}=t;return!(null==e||r||s&&s(e,{year:e.year,month:e.month})||n&&e.before(n)||i&&e.after(i))}let ft=(()=>{let e=class{getDayNumerals(e){return`${e.day}`}getWeekNumerals(e){return`${e}`}getYearNumerals(e){return`${e}`}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return e=Object(r.ic)(r.y),new pt(e);var e},token:e,providedIn:"root"}),e})(),pt=(()=>{let e=class extends ft{constructor(e){super(),this._locale=e;const t=Object(s.F)(e,s.g.Standalone,s.B.Short);this._weekdaysShort=t.map((e,n)=>t[(n+1)%7]),this._monthsShort=Object(s.H)(e,s.g.Standalone,s.B.Abbreviated),this._monthsFull=Object(s.H)(e,s.g.Standalone,s.B.Wide)}getWeekdayShortName(e){return this._weekdaysShort[e-1]||""}getMonthShortName(e){return this._monthsShort[e-1]||""}getMonthFullName(e){return this._monthsFull[e-1]||""}getDayAriaLabel(e){const t=new Date(e.year,e.month-1,e.day);return Object(s.E)(t,"fullDate",this._locale)}};return e.\u0275fac=function(t){return new(t||e)(r.ic(r.y))},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(r.y))],e),e})(),mt=(()=>{let e=class{constructor(e,t){this._calendar=e,this._i18n=t,this._VALIDATORS={dayTemplateData:e=>{if(this._state.dayTemplateData!==e)return{dayTemplateData:e}},displayMonths:e=>{if($e(e=We(e))&&e>0&&this._state.displayMonths!==e)return{displayMonths:e}},disabled:e=>{if(this._state.disabled!==e)return{disabled:e}},firstDayOfWeek:e=>{if($e(e=We(e))&&e>=0&&this._state.firstDayOfWeek!==e)return{firstDayOfWeek:e}},focusVisible:e=>{if(this._state.focusVisible!==e&&!this._state.disabled)return{focusVisible:e}},markDisabled:e=>{if(this._state.markDisabled!==e)return{markDisabled:e}},maxDate:e=>{const t=this.toValidDate(e,null);if(lt(this._state.maxDate,t))return{maxDate:t}},minDate:e=>{const t=this.toValidDate(e,null);if(lt(this._state.minDate,t))return{minDate:t}},navigation:e=>{if(this._state.navigation!==e)return{navigation:e}},outsideDays:e=>{if(this._state.outsideDays!==e)return{outsideDays:e}}},this._model$=new a.a,this._dateSelect$=new a.a,this._state={dayTemplateData:null,markDisabled:null,maxDate:null,minDate:null,disabled:!1,displayMonths:1,firstDate:null,firstDayOfWeek:1,lastDate:null,focusDate:null,focusVisible:!1,months:[],navigation:"select",outsideDays:"visible",prevDisabled:!1,nextDisabled:!1,selectedDate:null,selectBoxes:{years:[],months:[]}}}get model$(){return this._model$.pipe(Object(w.a)(e=>e.months.length>0))}get dateSelect$(){return this._dateSelect$.pipe(Object(w.a)(e=>null!==e))}set(e){let t=Object.keys(e).map(t=>this._VALIDATORS[t](e[t])).reduce((e,t)=>Object.assign(Object.assign({},e),t),{});Object.keys(t).length>0&&this._nextState(t)}focus(e){const t=this.toValidDate(e,null);null!=t&&!this._state.disabled&&lt(this._state.focusDate,t)&&this._nextState({focusDate:e})}focusSelect(){ht(this._state.focusDate,this._state)&&this.select(this._state.focusDate,{emitEvent:!0})}open(e){const t=this.toValidDate(e,this._calendar.getToday());null==t||this._state.disabled||this._state.firstDate&&!ut(this._state.firstDate,t)||this._nextState({firstDate:t})}select(e,t={}){const n=this.toValidDate(e,null);null==n||this._state.disabled||(lt(this._state.selectedDate,n)&&this._nextState({selectedDate:n}),t.emitEvent&&ht(n,this._state)&&this._dateSelect$.next(n))}toValidDate(e,t){const n=it.from(e);return void 0===t&&(t=this._calendar.getToday()),this._calendar.isValid(n)?n:t}getMonth(e){for(let t of this._state.months)if(e.month===t.number&&e.year===t.year)return t;throw new Error(`month ${e.month} of year ${e.year} not found`)}_nextState(e){const t=this._updateState(e);this._patchContexts(t),this._state=t,this._model$.next(this._state)}_patchContexts(e){const{months:t,displayMonths:n,selectedDate:i,focusDate:r,focusVisible:s,disabled:o,outsideDays:a}=e;e.months.forEach(e=>{e.weeks.forEach(c=>{c.days.forEach(c=>{r&&(c.context.focused=r.equals(c.date)&&s),c.tabindex=!o&&r&&c.date.equals(r)&&r.month===e.number?0:-1,!0===o&&(c.context.disabled=!0),void 0!==i&&(c.context.selected=null!==i&&i.equals(c.date)),e.number!==c.date.month&&(c.hidden="hidden"===a||"collapsed"===a||n>1&&c.date.after(t[0].firstDate)&&c.date.before(t[n-1].lastDate))})})})}_updateState(e){const t=Object.assign({},this._state,e);let n=t.firstDate;if(("minDate"in e||"maxDate"in e)&&(function(e,t){if(t&&e&&t.before(e))throw new Error(`'maxDate' ${t} should be greater than 'minDate' ${e}`)}(t.minDate,t.maxDate),t.focusDate=dt(t.focusDate,t.minDate,t.maxDate),t.firstDate=dt(t.firstDate,t.minDate,t.maxDate),n=t.focusDate),"disabled"in e&&(t.focusVisible=!1),"selectedDate"in e&&0===this._state.months.length&&(n=t.selectedDate),"focusVisible"in e)return t;if("focusDate"in e&&(t.focusDate=dt(t.focusDate,t.minDate,t.maxDate),n=t.focusDate,0!==t.months.length&&t.focusDate&&!t.focusDate.before(t.firstDate)&&!t.focusDate.after(t.lastDate)))return t;if("firstDate"in e&&(t.firstDate=dt(t.firstDate,t.minDate,t.maxDate),n=t.firstDate),n){const i=function(e,t,n,i,r){const{displayMonths:s,months:o}=n,a=o.splice(0,o.length);return Array.from({length:s},(n,i)=>{const s=Object.assign(e.getNext(t,"m",i),{day:1});if(o[i]=null,!r){const e=a.findIndex(e=>e.firstDate.equals(s));-1!==e&&(o[i]=a.splice(e,1)[0])}return s}).forEach((t,r)=>{null===o[r]&&(o[r]=function(e,t,n,i,r={}){const{dayTemplateData:s,minDate:o,maxDate:a,firstDayOfWeek:c,markDisabled:l,outsideDays:u}=n,d=e.getToday();r.firstDate=null,r.lastDate=null,r.number=t.month,r.year=t.year,r.weeks=r.weeks||[],r.weekdays=r.weekdays||[],t=function(e,t,n){const i=e.getDaysPerWeek(),r=new it(t.year,t.month,1),s=e.getWeekday(r)%i;return e.getPrev(r,"d",(i+s-n)%i)}(e,t,c);for(let h=0;h<e.getWeeksPerMonth();h++){let n=r.weeks[h];n||(n=r.weeks[h]={number:0,days:[],collapsed:!0});const f=n.days;for(let c=0;c<e.getDaysPerWeek();c++){0===h&&(r.weekdays[c]=e.getWeekday(t));const n=new it(t.year,t.month,t.day),u=e.getNext(n),p=i.getDayAriaLabel(n);let m=!!(o&&n.before(o)||a&&n.after(a));!m&&l&&(m=l(n,{month:r.number,year:r.year}));let b=n.equals(d),g=s?s(n,{month:r.number,year:r.year}):void 0;null===r.firstDate&&n.month===r.number&&(r.firstDate=n),n.month===r.number&&u.month!==r.number&&(r.lastDate=n);let _=f[c];_||(_=f[c]={}),_.date=n,_.context=Object.assign(_.context||{},{$implicit:n,date:n,data:g,currentMonth:r.number,currentYear:r.year,disabled:m,focused:!1,selected:!1,today:b}),_.tabindex=-1,_.ariaLabel=p,_.hidden=!1,t=u}n.number=e.getWeekNumber(f.map(e=>e.date),c),n.collapsed="collapsed"===u&&f[0].date.month!==r.number&&f[f.length-1].date.month!==r.number}return r}(e,t,n,i,a.shift()||{}))}),o}(this._calendar,n,t,this._i18n,"dayTemplateData"in e||"firstDayOfWeek"in e||"markDisabled"in e||"minDate"in e||"maxDate"in e||"disabled"in e||"outsideDays"in e);t.months=i,t.firstDate=i[0].firstDate,t.lastDate=i[i.length-1].lastDate,"selectedDate"in e&&!ht(t.selectedDate,t)&&(t.selectedDate=null),"firstDate"in e&&(!t.focusDate||t.focusDate.before(t.firstDate)||t.focusDate.after(t.lastDate))&&(t.focusDate=n);const r=!this._state.firstDate||this._state.firstDate.year!==t.firstDate.year,s=!this._state.firstDate||this._state.firstDate.month!==t.firstDate.month;"select"===t.navigation?(("minDate"in e||"maxDate"in e||0===t.selectBoxes.years.length||r)&&(t.selectBoxes.years=function(e,t,n){if(!e)return[];const i=t?Math.max(t.year,e.year-500):e.year-10,r=(n?Math.min(n.year,e.year+500):e.year+10)-i+1,s=Array(r);for(let o=0;o<r;o++)s[o]=i+o;return s}(t.firstDate,t.minDate,t.maxDate)),("minDate"in e||"maxDate"in e||0===t.selectBoxes.months.length||r)&&(t.selectBoxes.months=function(e,t,n,i){if(!t)return[];let r=e.getMonths(t.year);if(n&&t.year===n.year){const e=r.findIndex(e=>e===n.month);r=r.slice(e)}if(i&&t.year===i.year){const e=r.findIndex(e=>e===i.month);r=r.slice(0,e+1)}return r}(this._calendar,t.firstDate,t.minDate,t.maxDate))):t.selectBoxes={years:[],months:[]},"arrows"!==t.navigation&&"select"!==t.navigation||!(s||r||"minDate"in e||"maxDate"in e||"disabled"in e)||(t.prevDisabled=t.disabled||function(e,t,n){const i=Object.assign(e.getPrev(t,"m"),{day:1});return null!=n&&(i.year===n.year&&i.month<n.month||i.year<n.year&&1===n.month)}(this._calendar,t.firstDate,t.minDate),t.nextDisabled=t.disabled||function(e,t,n){const i=Object.assign(e.getNext(t,"m"),{day:1});return null!=n&&i.after(n)}(this._calendar,t.lastDate,t.maxDate))}return t}};return e.\u0275fac=function(t){return new(t||e)(r.ic(at),r.ic(ft))},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();var bt=function(e){return e[e.PREV=0]="PREV",e[e.NEXT=1]="NEXT",e}({});let gt=(()=>{let e=class{constructor(){this.displayMonths=1,this.firstDayOfWeek=1,this.navigation="select",this.outsideDays="visible",this.showWeekdays=!0,this.showWeekNumbers=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function _t(){return new yt}let vt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:_t,token:e,providedIn:"root"}),e})(),yt=(()=>{let e=class extends vt{fromModel(e){return e&&$e(e.year)&&$e(e.month)&&$e(e.day)?{year:e.year,month:e.month,day:e.day}:null}toModel(e){return e&&$e(e.year)&&$e(e.month)&&$e(e.day)?{year:e.year,month:e.month,day:e.day}:null}};return e.\u0275fac=function(t){return fi(t||e)},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();const wt={provide:o.o,useExisting:Object(r.W)(()=>St),multi:!0};let Dt=(()=>{let e=class{constructor(e){this.templateRef=e}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.O))},e.\u0275dir=r.Mb({type:e,selectors:[["ng-template","ngbDatepickerContent",""]]}),e})(),St=(()=>{let e=class{constructor(e,t,n,i,s,o,c,l){this._service=e,this._calendar=t,this.i18n=n,this._elementRef=o,this._ngbDateAdapter=c,this._ngZone=l,this._controlValue=null,this._destroyed$=new a.a,this._publicState={},this.navigate=new r.p,this.dateSelect=new r.p,this.select=this.dateSelect,this.onChange=e=>{},this.onTouched=()=>{},["dayTemplate","dayTemplateData","displayMonths","firstDayOfWeek","footerTemplate","markDisabled","minDate","maxDate","navigation","outsideDays","showWeekdays","showWeekNumbers","startDate"].forEach(e=>this[e]=i[e]),e.dateSelect$.pipe(Object(y.a)(this._destroyed$)).subscribe(e=>{this.dateSelect.emit(e)}),e.model$.pipe(Object(y.a)(this._destroyed$)).subscribe(e=>{const t=e.firstDate,n=this.model?this.model.firstDate:null;this._publicState={maxDate:e.maxDate,minDate:e.minDate,firstDate:e.firstDate,lastDate:e.lastDate,focusedDate:e.focusDate,months:e.months.map(e=>e.firstDate)};let i=!1;if(!t.equals(n)&&(this.navigate.emit({current:n?{year:n.year,month:n.month}:null,next:{year:t.year,month:t.month},preventDefault:()=>i=!0}),i&&null!==n))return void this._service.open(n);const r=e.selectedDate,o=e.focusDate,a=this.model?this.model.focusDate:null;this.model=e,lt(r,this._controlValue)&&(this._controlValue=r,this.onTouched(),this.onChange(this._ngbDateAdapter.toModel(r))),lt(o,a)&&a&&e.focusVisible&&this.focus(),s.markForCheck()})}get state(){return this._publicState}get calendar(){return this._calendar}focusDate(e){this._service.focus(it.from(e))}focusSelect(){this._service.focusSelect()}focus(){this._ngZone.onStable.asObservable().pipe(Object(D.a)(1)).subscribe(()=>{const e=this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');e&&e.focus()})}navigateTo(e){this._service.open(it.from(e?e.day?e:Object.assign(Object.assign({},e),{day:1}):null))}ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{const e=Object(l.a)(this._contentEl.nativeElement,"focusin"),t=Object(l.a)(this._contentEl.nativeElement,"focusout"),{nativeElement:n}=this._elementRef;Object(u.a)(e,t).pipe(Object(w.a)(({target:e,relatedTarget:t})=>!(Ve(e,"ngb-dp-day")&&Ve(t,"ngb-dp-day")&&n.contains(e)&&n.contains(t))),Object(y.a)(this._destroyed$)).subscribe(({type:e})=>this._ngZone.run(()=>this._service.set({focusVisible:"focusin"===e})))})}ngOnDestroy(){this._destroyed$.next()}ngOnInit(){if(void 0===this.model){const e={};["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].forEach(t=>e[t]=this[t]),this._service.set(e),this.navigateTo(this.startDate)}this.dayTemplate||(this.dayTemplate=this._defaultDayTemplate)}ngOnChanges(e){const t={};if(["dayTemplateData","displayMonths","markDisabled","firstDayOfWeek","navigation","minDate","maxDate","outsideDays"].filter(t=>t in e).forEach(e=>t[e]=this[e]),this._service.set(t),"startDate"in e){const{currentValue:t,previousValue:n}=e.startDate;ut(n,t)&&this.navigateTo(this.startDate)}}onDateSelect(e){this._service.focus(e),this._service.select(e,{emitEvent:!0})}onNavigateDateSelect(e){this._service.open(e)}onNavigateEvent(e){switch(e){case bt.PREV:this._service.open(this._calendar.getPrev(this.model.firstDate,"m",1));break;case bt.NEXT:this._service.open(this._calendar.getNext(this.model.firstDate,"m",1))}}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._service.set({disabled:e})}writeValue(e){this._controlValue=it.from(this._ngbDateAdapter.fromModel(e)),this._service.select(this._controlValue)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(mt),r.Rb(at),r.Rb(ft),r.Rb(gt),r.Rb(r.i),r.Rb(r.n),r.Rb(vt),r.Rb(r.D))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-datepicker"]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,Dt,3),2&e){let e;r.Ec(e=r.mc())&&(t.contentTemplate=e.first)}},viewQuery:function(e,t){if(1&e&&(r.Wc(E,3),r.Wc(A,3)),2&e){let e;r.Ec(e=r.mc())&&(t._defaultDayTemplate=e.first),r.Ec(e=r.mc())&&(t._contentEl=e.first)}},inputs:{dayTemplate:"dayTemplate",dayTemplateData:"dayTemplateData",displayMonths:"displayMonths",firstDayOfWeek:"firstDayOfWeek",footerTemplate:"footerTemplate",markDisabled:"markDisabled",maxDate:"maxDate",minDate:"minDate",navigation:"navigation",outsideDays:"outsideDays",showWeekdays:"showWeekdays",showWeekNumbers:"showWeekNumbers",startDate:"startDate"},outputs:{navigate:"navigate",dateSelect:"dateSelect",select:"select"},exportAs:["ngbDatepicker"],features:[r.Cb([wt,mt]),r.Bb],decls:10,vars:5,consts:[["defaultDayTemplate",""],["defaultContentTemplate",""],[1,"ngb-dp-header"],[3,"date","months","disabled","showSelect","prevDisabled","nextDisabled","selectBoxes","navigate","select",4,"ngIf"],[1,"ngb-dp-content"],["content",""],[3,"ngTemplateOutlet"],["ngbDatepickerDayView","",3,"date","currentMonth","selected","disabled","focused"],["class","ngb-dp-month",4,"ngFor","ngForOf"],[1,"ngb-dp-month"],["class","ngb-dp-month-name",4,"ngIf"],[3,"month"],[1,"ngb-dp-month-name"],[3,"date","months","disabled","showSelect","prevDisabled","nextDisabled","selectBoxes","navigate","select"]],template:function(e,t){if(1&e&&(r.Pc(0,I,1,5,"ng-template",null,0,r.Qc),r.Pc(2,F,1,1,"ng-template",null,1,r.Qc),r.Xb(4,"div",2),r.Pc(5,W,1,7,"ngb-datepicker-navigation",3),r.Wb(),r.Xb(6,"div",4,5),r.Pc(8,j,0,0,"ng-template",6),r.Wb(),r.Pc(9,Y,0,0,"ng-template",6)),2&e){const e=r.Fc(3);r.Db(5),r.uc("ngIf","none"!==t.navigation),r.Db(1),r.Jb("ngb-dp-months",!t.contentTemplate),r.Db(2),r.uc("ngTemplateOutlet",(null==t.contentTemplate?null:t.contentTemplate.templateRef)||e),r.Db(1),r.uc("ngTemplateOutlet",t.footerTemplate)}},directives:function(){return[s.r,s.w,Vt,s.q,Tt,Mt]},styles:["ngb-datepicker{border:1px solid #dfdfdf;border-radius:.25rem;display:inline-block}ngb-datepicker-month{pointer-events:auto}ngb-datepicker.dropdown-menu{padding:0}.ngb-dp-body{z-index:1050}.ngb-dp-header{border-bottom:0;border-radius:.25rem .25rem 0 0;padding-top:.25rem;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-months{display:-ms-flexbox;display:flex}.ngb-dp-month{pointer-events:none}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,.ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-left:1rem}.ngb-dp-month:last-child .ngb-dp-week{padding-right:.25rem}.ngb-dp-month:first-child .ngb-dp-week{padding-left:.25rem}.ngb-dp-month .ngb-dp-week:last-child{padding-bottom:.25rem}"],encapsulation:2,changeDetection:0}),e})();var xt=function(e){return e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Escape=27]="Escape",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.ArrowLeft=37]="ArrowLeft",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowRight=39]="ArrowRight",e[e.ArrowDown=40]="ArrowDown",e}({});let kt=(()=>{let e=class{processKey(e,t){const{state:n,calendar:i}=t;switch(e.which){case xt.PageUp:t.focusDate(i.getPrev(n.focusedDate,e.shiftKey?"y":"m",1));break;case xt.PageDown:t.focusDate(i.getNext(n.focusedDate,e.shiftKey?"y":"m",1));break;case xt.End:t.focusDate(e.shiftKey?n.maxDate:n.lastDate);break;case xt.Home:t.focusDate(e.shiftKey?n.minDate:n.firstDate);break;case xt.ArrowLeft:t.focusDate(i.getPrev(n.focusedDate,"d",1));break;case xt.ArrowUp:t.focusDate(i.getPrev(n.focusedDate,"d",i.getDaysPerWeek()));break;case xt.ArrowRight:t.focusDate(i.getNext(n.focusedDate,"d",1));break;case xt.ArrowDown:t.focusDate(i.getNext(n.focusedDate,"d",i.getDaysPerWeek()));break;case xt.Enter:case xt.Space:t.focusSelect();break;default:return}e.preventDefault(),e.stopPropagation()}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Tt=(()=>{let e=class{constructor(e,t,n,i){this.i18n=e,this.datepicker=t,this._keyboardService=n,this._service=i}set month(e){this.viewModel=this._service.getMonth(e)}onKeyDown(e){this._keyboardService.processKey(e,this.datepicker)}doSelect(e){e.context.disabled||e.hidden||this.datepicker.onDateSelect(e.date)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(ft),r.Rb(St),r.Rb(kt),r.Rb(mt))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-datepicker-month"]],hostAttrs:["role","grid"],hostBindings:function(e,t){1&e&&r.lc("keydown",function(e){return t.onKeyDown(e)})},inputs:{month:"month"},decls:2,vars:2,consts:[["class","ngb-dp-week ngb-dp-weekdays","role","row",4,"ngIf"],["ngFor","",3,"ngForOf"],["role","row",1,"ngb-dp-week","ngb-dp-weekdays"],["class","ngb-dp-weekday ngb-dp-showweek",4,"ngIf"],["class","ngb-dp-weekday small","role","columnheader",4,"ngFor","ngForOf"],[1,"ngb-dp-weekday","ngb-dp-showweek"],["role","columnheader",1,"ngb-dp-weekday","small"],["class","ngb-dp-week","role","row",4,"ngIf"],["role","row",1,"ngb-dp-week"],["class","ngb-dp-week-number small text-muted",4,"ngIf"],["class","ngb-dp-day","role","gridcell",3,"disabled","tabindex","hidden","ngb-dp-today","click",4,"ngFor","ngForOf"],[1,"ngb-dp-week-number","small","text-muted"],["role","gridcell",1,"ngb-dp-day",3,"tabindex","click"],[3,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(r.Pc(0,$,3,2,"div",0),r.Pc(1,q,1,1,"ng-template",1)),2&e&&(r.uc("ngIf",t.datepicker.showWeekdays),r.Db(1),r.uc("ngForOf",t.viewModel.weeks))},directives:[s.r,s.q,s.w],styles:['ngb-datepicker-month{display:block}.ngb-dp-week-number,.ngb-dp-weekday{line-height:2rem;text-align:center;font-style:italic}.ngb-dp-weekday{color:#5bc0de;color:var(--info)}.ngb-dp-week{border-radius:.25rem;display:-ms-flexbox;display:flex}.ngb-dp-weekdays{border-bottom:1px solid rgba(0,0,0,.125);border-radius:0;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-day,.ngb-dp-week-number,.ngb-dp-weekday{width:2rem;height:2rem}.ngb-dp-day{cursor:pointer}.ngb-dp-day.disabled,.ngb-dp-day.hidden{cursor:default;pointer-events:none}.ngb-dp-day[tabindex="0"]{z-index:1}'],encapsulation:2}),e})(),Mt=(()=>{let e=class{constructor(e){this.i18n=e,this.navigation=bt,this.months=[],this.navigate=new r.p,this.select=new r.p}onClickPrev(e){e.currentTarget.focus(),this.navigate.emit(this.navigation.PREV)}onClickNext(e){e.currentTarget.focus(),this.navigate.emit(this.navigation.NEXT)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(ft))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-datepicker-navigation"]],inputs:{months:"months",date:"date",disabled:"disabled",showSelect:"showSelect",prevDisabled:"prevDisabled",nextDisabled:"nextDisabled",selectBoxes:"selectBoxes"},outputs:{navigate:"navigate",select:"select"},decls:8,vars:4,consts:function(){let e,t,n,i;return e="Previous month",t="Previous month",n="Next month",i="Next month",[[1,"ngb-dp-arrow"],["type","button","aria-label",e,"title",t,1,"btn","btn-link","ngb-dp-arrow-btn",3,"disabled","click"],[1,"ngb-dp-navigation-chevron"],["class","ngb-dp-navigation-select",3,"date","disabled","months","years","select",4,"ngIf"],[4,"ngIf"],[1,"ngb-dp-arrow","right"],["type","button","aria-label",n,"title",i,1,"btn","btn-link","ngb-dp-arrow-btn",3,"disabled","click"],[1,"ngb-dp-navigation-select",3,"date","disabled","months","years","select"],["ngFor","",3,"ngForOf"],["class","ngb-dp-arrow",4,"ngIf"],[1,"ngb-dp-month-name"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"button",1),r.lc("click",function(e){return t.onClickPrev(e)}),r.Sb(2,"span",2),r.Wb(),r.Wb(),r.Pc(3,G,1,4,"ngb-datepicker-navigation-select",3),r.Pc(4,Z,1,1,void 0,4),r.Xb(5,"div",5),r.Xb(6,"button",6),r.lc("click",function(e){return t.onClickNext(e)}),r.Sb(7,"span",2),r.Wb(),r.Wb()),2&e&&(r.Db(1),r.uc("disabled",t.prevDisabled),r.Db(2),r.uc("ngIf",t.showSelect),r.Db(1),r.uc("ngIf",!t.showSelect),r.Db(2),r.uc("disabled",t.nextDisabled))},directives:function(){return[s.r,Bt,s.q]},styles:["ngb-datepicker-navigation{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-dp-navigation-chevron{border-style:solid;border-width:.2em .2em 0 0;display:inline-block;width:.75em;height:.75em;margin-left:.25em;margin-right:.15em;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.right .ngb-dp-navigation-chevron{-webkit-transform:rotate(45deg);transform:rotate(45deg);margin-left:.15em;margin-right:.25em}.ngb-dp-arrow{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;padding-right:0;padding-left:0;margin:0;width:2rem;height:2rem}.ngb-dp-arrow.right{-ms-flex-pack:end;justify-content:flex-end}.ngb-dp-arrow-btn{padding:0 .25rem;margin:0 .5rem;border:none;background-color:transparent;z-index:1}.ngb-dp-arrow-btn:focus{outline-width:1px;outline-style:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.ngb-dp-arrow-btn:focus{outline-style:solid}}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-navigation-select{display:-ms-flexbox;display:flex;-ms-flex:1 1 9rem;flex:1 1 9rem}"],encapsulation:2,changeDetection:0}),e})();const Ct=(e,t)=>!!t&&t.some(t=>t.contains(e)),Ot=(e,t)=>!t||null!=function(e,t){return t?void 0===e.closest?null:e.closest(t):null}(e,t),Lt="undefined"!=typeof navigator&&!!navigator.userAgent&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2||/Android/.test(navigator.userAgent));function Et(e,t,n,i,r,s,o,a){var c;n&&e.runOutsideAngular((c=()=>{const c=Object(l.a)(t,"keydown").pipe(Object(y.a)(r),Object(w.a)(e=>e.which===xt.Escape),Object(S.a)(e=>e.preventDefault())),u=Object(l.a)(t,"mousedown").pipe(Object(_.a)(e=>{const t=e.target;return 2!==e.button&&!Ct(t,o)&&("inside"===n?Ct(t,s)&&Ot(t,a):"outside"===n?!Ct(t,s):Ot(t,a)||!Ct(t,s))}),Object(y.a)(r)),f=Object(l.a)(t,"mouseup").pipe(x(u),Object(w.a)(([e,t])=>t),Object(M.a)(0),Object(y.a)(r));(function(...e){if(1===e.length){if(!Object(d.a)(e[0]))return e[0];e=e[0]}return Object(h.a)(e,void 0).lift(new m)})([c.pipe(Object(_.a)(e=>0)),f.pipe(Object(_.a)(e=>1))]).subscribe(t=>e.run(()=>i(t)))},Lt?()=>setTimeout(()=>c(),100):c))}const At=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(", ");function It(e){const t=Array.from(e.querySelectorAll(At)).filter(e=>-1!==e.tabIndex);return[t[0],t[t.length-1]]}const Rt=(e,t,n,i=!1)=>{e.runOutsideAngular(()=>{const e=Object(l.a)(t,"focusin").pipe(Object(y.a)(n),Object(_.a)(e=>e.target));Object(l.a)(t,"keydown").pipe(Object(y.a)(n),Object(w.a)(e=>e.which===xt.Tab),x(e)).subscribe(([e,n])=>{const[i,r]=It(t);n!==i&&n!==t||!e.shiftKey||(r.focus(),e.preventDefault()),n!==r||e.shiftKey||(i.focus(),e.preventDefault())}),i&&Object(l.a)(t,"click").pipe(Object(y.a)(n),x(e),Object(_.a)(e=>e[1])).subscribe(e=>e.focus())})},Pt=/\s+/,Ft=new class{getAllStyles(e){return window.getComputedStyle(e)}getStyle(e,t){return this.getAllStyles(e)[t]}isStaticPositioned(e){return"static"===(this.getStyle(e,"position")||"static")}offsetParent(e){let t=e.offsetParent||document.documentElement;for(;t&&t!==document.documentElement&&this.isStaticPositioned(t);)t=t.offsetParent;return t||document.documentElement}position(e,t=!0){let n,i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(e,"position"))n=e.getBoundingClientRect(),n={top:n.top,bottom:n.bottom,left:n.left,right:n.right,height:n.height,width:n.width};else{const t=this.offsetParent(e);n=this.offset(e,!1),t!==document.documentElement&&(i=this.offset(t,!1)),i.top+=t.clientTop,i.left+=t.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,t&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n}offset(e,t=!0){const n=e.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,r=window.pageXOffset-document.documentElement.clientLeft;let s={height:n.height||e.offsetHeight,width:n.width||e.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+r,right:n.right+r};return t&&(s.height=Math.round(s.height),s.width=Math.round(s.width),s.top=Math.round(s.top),s.bottom=Math.round(s.bottom),s.left=Math.round(s.left),s.right=Math.round(s.right)),s}positionElements(e,t,n,i){const[r="top",s="center"]=n.split("-"),o=i?this.offset(e,!1):this.position(e,!1),a=this.getAllStyles(t),c=parseFloat(a.marginTop),l=parseFloat(a.marginBottom),u=parseFloat(a.marginLeft),d=parseFloat(a.marginRight);let h=0,f=0;switch(r){case"top":h=o.top-(t.offsetHeight+c+l);break;case"bottom":h=o.top+o.height;break;case"left":f=o.left-(t.offsetWidth+u+d);break;case"right":f=o.left+o.width}switch(s){case"top":h=o.top;break;case"bottom":h=o.top+o.height-t.offsetHeight;break;case"left":f=o.left;break;case"right":f=o.left+o.width-t.offsetWidth;break;case"center":"top"===r||"bottom"===r?f=o.left+o.width/2-t.offsetWidth/2:h=o.top+o.height/2-t.offsetHeight/2}t.style.transform=`translate(${Math.round(f)}px, ${Math.round(h)}px)`;const p=t.getBoundingClientRect(),m=document.documentElement,b=window.innerHeight||m.clientHeight,g=window.innerWidth||m.clientWidth;return p.left>=0&&p.top>=0&&p.right<=g&&p.bottom<=b}};function Wt(e,t,n,i,r){let s=Array.isArray(n)?n:n.split(Pt);const o=["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right","left-top","left-bottom","right-top","right-bottom"],a=t.classList,c=e=>{const[t,n]=e.split("-"),i=[];return r&&(i.push(`${r}-${t}`),n&&i.push(`${r}-${t}-${n}`),i.forEach(e=>{a.add(e)})),i};r&&o.forEach(e=>{a.remove(`${r}-${e}`)});let l=s.findIndex(e=>"auto"===e);l>=0&&o.forEach(function(e){null==s.find(t=>-1!==t.search("^"+e))&&s.splice(l++,1,e)});const u=t.style;u.position="absolute",u.top="0",u.left="0",u["will-change"]="transform";let d=null,h=!1;for(d of s){let n=c(d);if(Ft.positionElements(e,t,d,i)){h=!0;break}r&&n.forEach(e=>{a.remove(e)})}return h||(d=s[0],c(d),Ft.positionElements(e,t,d,i)),d}function jt(){return new Nt}let Yt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:jt,token:e,providedIn:"root"}),e})(),Nt=(()=>{let e=class extends Yt{parse(e){if(null!=e){const t=e.trim().split("-");if(1===t.length&&ze(t[0]))return{year:We(t[0]),month:null,day:null};if(2===t.length&&ze(t[0])&&ze(t[1]))return{year:We(t[0]),month:We(t[1]),day:null};if(3===t.length&&ze(t[0])&&ze(t[1])&&ze(t[2]))return{year:We(t[0]),month:We(t[1]),day:We(t[2])}}return null}format(e){return e?`${e.year}-${ze(e.month)?Xe(e.month):""}-${ze(e.day)?Xe(e.day):""}`:""}};return e.\u0275fac=function(t){return pi(t||e)},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),zt=(()=>{let e=class extends gt{constructor(){super(...arguments),this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"],this.restoreFocus=!0}};return e.\u0275fac=function(t){return mi(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const $t={provide:o.o,useExisting:Object(r.W)(()=>Xt),multi:!0},Ht={provide:o.n,useExisting:Object(r.W)(()=>Xt),multi:!0};let Xt=(()=>{let e=class{constructor(e,t,n,i,s,o,a,c,l,u,d){this._parserFormatter=e,this._elRef=t,this._vcRef=n,this._renderer=i,this._cfr=s,this._ngZone=o,this._calendar=a,this._dateAdapter=c,this._document=l,this._changeDetector=u,this._cRef=null,this._disabled=!1,this._elWithFocus=null,this._model=null,this.dateSelect=new r.p,this.navigate=new r.p,this.closed=new r.p,this._onChange=e=>{},this._onTouched=()=>{},this._validatorChange=()=>{},["autoClose","container","positionTarget","placement"].forEach(e=>this[e]=d[e]),this._zoneSubscription=o.onStable.subscribe(()=>this._updatePopupPosition())}get disabled(){return this._disabled}set disabled(e){this._disabled=""===e||e&&"false"!==e,this.isOpen()&&this._cRef.instance.setDisabledState(this._disabled)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}registerOnValidatorChange(e){this._validatorChange=e}setDisabledState(e){this.disabled=e}validate(e){const{value:t}=e;if(null!=t){const e=this._fromDateStruct(this._dateAdapter.fromModel(t));if(!e)return{ngbDate:{invalid:t}};if(this.minDate&&e.before(it.from(this.minDate)))return{ngbDate:{minDate:{minDate:this.minDate,actual:t}}};if(this.maxDate&&e.after(it.from(this.maxDate)))return{ngbDate:{maxDate:{maxDate:this.maxDate,actual:t}}}}return null}writeValue(e){this._model=this._fromDateStruct(this._dateAdapter.fromModel(e)),this._writeModelValue(this._model)}manualDateChange(e,t=!1){const n=e!==this._inputValue;n&&(this._inputValue=e,this._model=this._fromDateStruct(this._parserFormatter.parse(e))),!n&&t||this._onChange(this._model?this._dateAdapter.toModel(this._model):""===e?null:e),t&&this._model&&this._writeModelValue(this._model)}isOpen(){return!!this._cRef}open(){if(!this.isOpen()){const e=this._cfr.resolveComponentFactory(St);this._cRef=this._vcRef.createComponent(e),this._applyPopupStyling(this._cRef.location.nativeElement),this._applyDatepickerInputs(this._cRef.instance),this._subscribeForDatepickerOutputs(this._cRef.instance),this._cRef.instance.ngOnInit(),this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model)),this._cRef.instance.registerOnChange(e=>{this.writeValue(e),this._onChange(e),this._onTouched()}),this._cRef.changeDetectorRef.detectChanges(),this._cRef.instance.setDisabledState(this.disabled),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._cRef.location.nativeElement),this._elWithFocus=this._document.activeElement,Rt(this._ngZone,this._cRef.location.nativeElement,this.closed,!0),this._cRef.instance.focus(),Et(this._ngZone,this._document,this.autoClose,()=>this.close(),this.closed,[],[this._elRef.nativeElement,this._cRef.location.nativeElement])}}close(){if(this.isOpen()){this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView)),this._cRef=null,this.closed.emit(),this._changeDetector.markForCheck();let e=this._elWithFocus;Ne(this.restoreFocus)?e=this._document.querySelector(this.restoreFocus):void 0!==this.restoreFocus&&(e=this.restoreFocus),e&&e.focus?e.focus():this._document.body.focus()}}toggle(){this.isOpen()?this.close():this.open()}navigateTo(e){this.isOpen()&&this._cRef.instance.navigateTo(e)}onBlur(){this._onTouched()}onFocus(){this._elWithFocus=this._elRef.nativeElement}ngOnChanges(e){(e.minDate||e.maxDate)&&(this._validatorChange(),this.isOpen()&&(e.minDate&&(this._cRef.instance.minDate=this.minDate),e.maxDate&&(this._cRef.instance.maxDate=this.maxDate),this._cRef.instance.ngOnChanges(e)))}ngOnDestroy(){this.close(),this._zoneSubscription.unsubscribe()}_applyDatepickerInputs(e){["dayTemplate","dayTemplateData","displayMonths","firstDayOfWeek","footerTemplate","markDisabled","minDate","maxDate","navigation","outsideDays","showNavigation","showWeekdays","showWeekNumbers"].forEach(t=>{void 0!==this[t]&&(e[t]=this[t])}),e.startDate=this.startDate||this._model}_applyPopupStyling(e){this._renderer.addClass(e,"dropdown-menu"),this._renderer.addClass(e,"show"),"body"===this.container&&this._renderer.addClass(e,"ngb-dp-body")}_subscribeForDatepickerOutputs(e){e.navigate.subscribe(e=>this.navigate.emit(e)),e.dateSelect.subscribe(e=>{this.dateSelect.emit(e),!0!==this.autoClose&&"inside"!==this.autoClose||this.close()})}_writeModelValue(e){const t=this._parserFormatter.format(e);this._inputValue=t,this._renderer.setProperty(this._elRef.nativeElement,"value",t),this.isOpen()&&(this._cRef.instance.writeValue(this._dateAdapter.toModel(e)),this._onTouched())}_fromDateStruct(e){const t=e?new it(e.year,e.month,e.day):null;return this._calendar.isValid(t)?t:null}_updatePopupPosition(){if(!this._cRef)return;let e;if(e=Ne(this.positionTarget)?this._document.querySelector(this.positionTarget):this.positionTarget instanceof HTMLElement?this.positionTarget:this._elRef.nativeElement,this.positionTarget&&!e)throw new Error("ngbDatepicker could not find element declared in [positionTarget] to position against.");Wt(e,this._cRef.location.nativeElement,this.placement,"body"===this.container)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Yt),r.Rb(r.n),r.Rb(r.S),r.Rb(r.H),r.Rb(r.k),r.Rb(r.D),r.Rb(at),r.Rb(vt),r.Rb(s.d),r.Rb(r.i),r.Rb(zt))},e.\u0275dir=r.Mb({type:e,selectors:[["input","ngbDatepicker",""]],hostVars:1,hostBindings:function(e,t){1&e&&r.lc("input",function(e){return t.manualDateChange(e.target.value)})("change",function(e){return t.manualDateChange(e.target.value,!0)})("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()}),2&e&&r.ac("disabled",t.disabled)},inputs:{disabled:"disabled",autoClose:"autoClose",dayTemplate:"dayTemplate",dayTemplateData:"dayTemplateData",displayMonths:"displayMonths",firstDayOfWeek:"firstDayOfWeek",footerTemplate:"footerTemplate",markDisabled:"markDisabled",minDate:"minDate",maxDate:"maxDate",navigation:"navigation",outsideDays:"outsideDays",placement:"placement",restoreFocus:"restoreFocus",showWeekdays:"showWeekdays",showWeekNumbers:"showWeekNumbers",startDate:"startDate",container:"container",positionTarget:"positionTarget"},outputs:{dateSelect:"dateSelect",navigate:"navigate",closed:"closed"},exportAs:["ngbDatepicker"],features:[r.Cb([$t,Ht,{provide:gt,useExisting:zt}]),r.Bb]}),e=Object(i.b)([Object(i.e)(8,Object(r.s)(s.d))],e),e})(),Vt=(()=>{let e=class{constructor(e){this.i18n=e}isMuted(){return!this.selected&&(this.date.month!==this.currentMonth||this.disabled)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(ft))},e.\u0275cmp=r.Lb({type:e,selectors:[["","ngbDatepickerDayView",""]],hostAttrs:[1,"btn-light"],hostVars:10,hostBindings:function(e,t){2&e&&r.Jb("bg-primary",t.selected)("text-white",t.selected)("text-muted",t.isMuted())("outside",t.isMuted())("active",t.focused)},inputs:{currentMonth:"currentMonth",date:"date",disabled:"disabled",focused:"focused",selected:"selected"},attrs:ee,decls:1,vars:1,template:function(e,t){1&e&&r.Rc(0),2&e&&r.Sc(t.i18n.getDayNumerals(t.date))},styles:["[ngbDatepickerDayView]{text-align:center;width:2rem;height:2rem;line-height:2rem;border-radius:.25rem;background:0 0}[ngbDatepickerDayView].outside{opacity:.5}"],encapsulation:2,changeDetection:0}),e})(),Bt=(()=>{let e=class{constructor(e,t){this.i18n=e,this._renderer=t,this.select=new r.p,this._month=-1,this._year=-1}changeMonth(e){this.select.emit(new it(this.date.year,We(e),1))}changeYear(e){this.select.emit(new it(We(e),this.date.month,1))}ngAfterViewChecked(){this.date&&(this.date.month!==this._month&&(this._month=this.date.month,this._renderer.setProperty(this.monthSelect.nativeElement,"value",this._month)),this.date.year!==this._year&&(this._year=this.date.year,this._renderer.setProperty(this.yearSelect.nativeElement,"value",this._year)))}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(ft),r.Rb(r.H))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-datepicker-navigation-select"]],viewQuery:function(e,t){if(1&e&&(r.Wc(te,3,r.n),r.Wc(ne,3,r.n)),2&e){let e;r.Ec(e=r.mc())&&(t.monthSelect=e.first),r.Ec(e=r.mc())&&(t.yearSelect=e.first)}},inputs:{date:"date",disabled:"disabled",months:"months",years:"years"},outputs:{select:"select"},decls:6,vars:4,consts:function(){let e,t,n,i;return e="Select month",t="Select month",n="Select year",i="Select year",[["aria-label",e,"title",t,1,"custom-select",3,"disabled","change"],["month",""],[3,"value",4,"ngFor","ngForOf"],["aria-label",n,"title",i,1,"custom-select",3,"disabled","change"],["year",""],[3,"value"]]},template:function(e,t){1&e&&(r.Xb(0,"select",0,1),r.lc("change",function(e){return t.changeMonth(e.target.value)}),r.Pc(2,ie,2,3,"option",2),r.Wb(),r.Xb(3,"select",3,4),r.lc("change",function(e){return t.changeYear(e.target.value)}),r.Pc(5,re,2,2,"option",2),r.Wb()),2&e&&(r.uc("disabled",t.disabled),r.Db(2),r.uc("ngForOf",t.months),r.Db(1),r.uc("disabled",t.disabled),r.Db(2),r.uc("ngForOf",t.years))},directives:[s.q,o.u,o.C],styles:["ngb-datepicker-navigation-select>.custom-select{-ms-flex:1 1 auto;flex:1 1 auto;padding:0 .5rem;font-size:.875rem;height:1.85rem}ngb-datepicker-navigation-select>.custom-select:focus{z-index:1}ngb-datepicker-navigation-select>.custom-select::-ms-value{background-color:transparent!important}"],encapsulation:2,changeDetection:0}),e})();new Date(1882,10,12),new Date(2174,10,25);let Ut=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c,o.m]]}),e})(),qt=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement=["bottom-left","bottom-right","top-left","top-right"]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();var Gt;let Jt=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=r.Mb({type:e,selectors:[["",8,"navbar"]]}),e})(),Kt=(()=>{let e=class{constructor(e){this.elementRef=e,this._disabled=!1}set disabled(e){this._disabled=""===e||!0===e}get disabled(){return this._disabled}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbDropdownItem",""]],hostAttrs:[1,"dropdown-item"],hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("disabled",t.disabled)},inputs:{disabled:"disabled"}}),e})(),Qt=(()=>{let e=class{constructor(e,t){this.dropdown=e,this.placement="bottom",this.isOpen=!1,this.nativeElement=t.nativeElement}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Object(r.W)(()=>tn)),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbDropdownMenu",""]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,Kt,0),2&e){let e;r.Ec(e=r.mc())&&(t.menuItems=e)}},hostVars:5,hostBindings:function(e,t){1&e&&r.lc("keydown.ArrowUp",function(e){return t.dropdown.onKeyDown(e)})("keydown.ArrowDown",function(e){return t.dropdown.onKeyDown(e)})("keydown.Home",function(e){return t.dropdown.onKeyDown(e)})("keydown.End",function(e){return t.dropdown.onKeyDown(e)})("keydown.Enter",function(e){return t.dropdown.onKeyDown(e)})("keydown.Space",function(e){return t.dropdown.onKeyDown(e)})("keydown.Tab",function(e){return t.dropdown.onKeyDown(e)})("keydown.Shift.Tab",function(e){return t.dropdown.onKeyDown(e)}),2&e&&(r.Eb("x-placement",t.placement),r.Jb("dropdown-menu",!0)("show",t.dropdown.isOpen()))}}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(Object(r.W)(()=>tn)))],e),e})(),Zt=(()=>{let e=class{constructor(e,t){this.dropdown=e,this.nativeElement=t.nativeElement}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Object(r.W)(()=>tn)),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbDropdownAnchor",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(e,t){2&e&&r.Eb("aria-expanded",t.dropdown.isOpen())}}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(Object(r.W)(()=>tn)))],e),e})(),en=(()=>{let e=Gt=class extends Zt{constructor(e,t){super(e,t)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Object(r.W)(()=>tn)),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbDropdownToggle",""]],hostAttrs:[1,"dropdown-toggle"],hostVars:1,hostBindings:function(e,t){1&e&&r.lc("click",function(){return t.dropdown.toggle()})("keydown.ArrowUp",function(e){return t.dropdown.onKeyDown(e)})("keydown.ArrowDown",function(e){return t.dropdown.onKeyDown(e)})("keydown.Home",function(e){return t.dropdown.onKeyDown(e)})("keydown.End",function(e){return t.dropdown.onKeyDown(e)})("keydown.Tab",function(e){return t.dropdown.onKeyDown(e)})("keydown.Shift.Tab",function(e){return t.dropdown.onKeyDown(e)}),2&e&&r.Eb("aria-expanded",t.dropdown.isOpen())},features:[r.Cb([{provide:Zt,useExisting:Object(r.W)(()=>Gt)}]),r.Ab]}),e=Gt=Object(i.b)([Object(i.e)(0,Object(r.s)(Object(r.W)(()=>tn)))],e),e})(),tn=(()=>{let e=class{constructor(e,t,n,i,s,o,c){this._changeDetector=e,this._document=n,this._ngZone=i,this._elementRef=s,this._renderer=o,this._closed$=new a.a,this._bodyContainer=null,this._open=!1,this.openChange=new r.p,this.placement=t.placement,this.container=t.container,this.autoClose=t.autoClose,this.display=c?"static":"dynamic",this._zoneSubscription=i.onStable.subscribe(()=>{this._positionMenu()})}ngAfterContentInit(){this._ngZone.onStable.pipe(Object(D.a)(1)).subscribe(()=>{this._applyPlacementClasses(),this._open&&this._setCloseHandlers()})}ngOnChanges(e){e.container&&this._open&&this._applyContainer(this.container),e.placement&&!e.placement.isFirstChange&&this._applyPlacementClasses()}isOpen(){return this._open}open(){this._open||(this._open=!0,this._applyContainer(this.container),this.openChange.emit(!0),this._setCloseHandlers(),this._anchor&&this._anchor.nativeElement.focus())}_setCloseHandlers(){Et(this._ngZone,this._document,this.autoClose,e=>{this.close(),0===e&&this._anchor.nativeElement.focus()},this._closed$,this._menu?[this._menu.nativeElement]:[],this._anchor?[this._anchor.nativeElement]:[],".dropdown-item,.dropdown-divider")}close(){this._open&&(this._open=!1,this._resetContainer(),this._closed$.next(),this.openChange.emit(!1),this._changeDetector.markForCheck())}toggle(){this.isOpen()?this.close():this.open()}ngOnDestroy(){this._resetContainer(),this._closed$.next(),this._zoneSubscription.unsubscribe()}onKeyDown(e){const t=e.which,n=this._getMenuElements();let i=-1,r=null;const s=this._isEventFromToggle(e);if(!s&&n.length&&n.forEach((t,n)=>{t.contains(e.target)&&(r=t),t===this._document.activeElement&&(i=n)}),t!==xt.Space&&t!==xt.Enter){if(t!==xt.Tab){if(s||r){if(this.open(),n.length){switch(t){case xt.ArrowDown:i=Math.min(i+1,n.length-1);break;case xt.ArrowUp:if(this._isDropup()&&-1===i){i=n.length-1;break}i=Math.max(i-1,0);break;case xt.Home:i=0;break;case xt.End:i=n.length-1}n[i].focus()}e.preventDefault()}}else if(e.target&&this.isOpen()&&this.autoClose){if(this._anchor.nativeElement===e.target)return void("body"!==this.container||e.shiftKey?e.shiftKey&&this.close():(this._renderer.setAttribute(this._menu.nativeElement,"tabindex","0"),this._menu.nativeElement.focus(),this._renderer.removeAttribute(this._menu.nativeElement,"tabindex")));if("body"===this.container){const t=this._menu.nativeElement.querySelectorAll(At);e.shiftKey&&e.target===t[0]?(this._anchor.nativeElement.focus(),e.preventDefault()):e.shiftKey||e.target!==t[t.length-1]||(this._anchor.nativeElement.focus(),this.close())}else Object(l.a)(e.target,"focusout").pipe(Object(D.a)(1)).subscribe(({relatedTarget:e})=>{this._elementRef.nativeElement.contains(e)||this.close()})}}else!r||!0!==this.autoClose&&"inside"!==this.autoClose||Object(l.a)(r,"click").pipe(Object(D.a)(1)).subscribe(()=>this.close())}_isDropup(){return this._elementRef.nativeElement.classList.contains("dropup")}_isEventFromToggle(e){return this._anchor.nativeElement.contains(e.target)}_getMenuElements(){const e=this._menu;return null==e?[]:e.menuItems.filter(e=>!e.disabled).map(e=>e.elementRef.nativeElement)}_positionMenu(){const e=this._menu;this.isOpen()&&e&&this._applyPlacementClasses("dynamic"===this.display?Wt(this._anchor.nativeElement,this._bodyContainer||this._menu.nativeElement,this.placement,"body"===this.container):this._getFirstPlacement(this.placement))}_getFirstPlacement(e){return Array.isArray(e)?e[0]:e.split(" ")[0]}_resetContainer(){const e=this._renderer;if(this._menu){const t=this._menu.nativeElement;e.appendChild(this._elementRef.nativeElement,t),e.removeStyle(t,"position"),e.removeStyle(t,"transform")}this._bodyContainer&&(e.removeChild(this._document.body,this._bodyContainer),this._bodyContainer=null)}_applyContainer(e=null){if(this._resetContainer(),"body"===e){const e=this._renderer,t=this._menu.nativeElement,n=this._bodyContainer=this._bodyContainer||e.createElement("div");e.setStyle(n,"position","absolute"),e.setStyle(t,"position","static"),e.setStyle(n,"z-index","1050"),e.appendChild(n,t),e.appendChild(this._document.body,n)}}_applyPlacementClasses(e){const t=this._menu;if(t){e||(e=this._getFirstPlacement(this.placement));const n=this._renderer,i=this._elementRef.nativeElement;n.removeClass(i,"dropup"),n.removeClass(i,"dropdown"),t.placement="static"===this.display?null:e;const r=-1!==e.search("^top")?"dropup":"dropdown";n.addClass(i,r);const s=this._bodyContainer;s&&(n.removeClass(s,"dropup"),n.removeClass(s,"dropdown"),n.addClass(s,r))}}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.i),r.Rb(qt),r.Rb(s.d),r.Rb(r.D),r.Rb(r.n),r.Rb(r.H),r.Rb(Jt,8))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbDropdown",""]],contentQueries:function(e,t,n){if(1&e&&(r.Kb(n,Qt,1),r.Kb(n,Zt,1)),2&e){let e;r.Ec(e=r.mc())&&(t._menu=e.first),r.Ec(e=r.mc())&&(t._anchor=e.first)}},hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("show",t.isOpen())},inputs:{_open:["open","_open"],placement:"placement",container:"container",autoClose:"autoClose",display:"display"},outputs:{openChange:"openChange"},exportAs:["ngbDropdown"],features:[r.Bb]}),e=Object(i.b)([Object(i.e)(2,Object(r.s)(s.d)),Object(i.e)(6,Object(r.E)())],e),e})(),nn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({}),e})(),rn=(()=>{let e=class{constructor(){this.backdrop=!0,this.keyboard=!0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class sn{constructor(e,t,n){this.nodes=e,this.viewRef=t,this.componentRef=n}}class on{constructor(e,t,n,i,r,s){this._type=e,this._injector=t,this._viewContainerRef=n,this._renderer=i,this._componentFactoryResolver=r,this._applicationRef=s,this._windowRef=null,this._contentRef=null}open(e,t){return this._windowRef||(this._contentRef=this._getContentRef(e,t),this._windowRef=this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type),this._viewContainerRef.length,this._injector,this._contentRef.nodes)),this._windowRef}close(){var e;this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null,(null===(e=this._contentRef)||void 0===e?void 0:e.viewRef)&&(this._applicationRef.detachView(this._contentRef.viewRef),this._contentRef.viewRef.destroy(),this._contentRef=null))}_getContentRef(e,t){if(e){if(e instanceof r.O){const n=e.createEmbeddedView(t);return this._applicationRef.attachView(n),new sn([n.rootNodes],n)}return new sn([[this._renderer.createText(`${e}`)]])}return new sn([])}}const an=()=>{};let cn=(()=>{let e=class{constructor(e){this._document=e}compensate(){const e=this._getWidth();return this._isPresent(e)?this._adjustBody(e):an}_adjustBody(e){const t=this._document.body,n=t.style.paddingRight,i=parseFloat(window.getComputedStyle(t)["padding-right"]);return t.style["padding-right"]=`${i+e}px`,()=>t.style["padding-right"]=n}_isPresent(e){const t=this._document.body.getBoundingClientRect();return window.innerWidth-(t.left+t.right)>=e-.1*e}_getWidth(){const e=this._document.createElement("div");e.className="modal-scrollbar-measure";const t=this._document.body;t.appendChild(e);const n=e.getBoundingClientRect().width-e.clientWidth;return t.removeChild(e),n}};return e.\u0275fac=function(t){return new(t||e)(r.ic(s.d))},e.\u0275prov=Object(r.Nb)({factory:function(){return new e(Object(r.ic)(s.d))},token:e,providedIn:"root"}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(s.d))],e),e})(),ln=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-modal-backdrop"]],hostAttrs:[2,"z-index","1050"],hostVars:2,hostBindings:function(e,t){2&e&&r.Fb("modal-backdrop fade show"+(t.backdropClass?" "+t.backdropClass:""))},inputs:{backdropClass:"backdropClass"},decls:0,vars:0,template:function(e,t){},encapsulation:2}),e})();class un{close(e){}dismiss(e){}}class dn{constructor(e,t,n,i){this._windowCmptRef=e,this._contentRef=t,this._backdropCmptRef=n,this._beforeDismiss=i,e.instance.dismissEvent.subscribe(e=>{this.dismiss(e)}),this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this.result.then(null,()=>{})}get componentInstance(){if(this._contentRef&&this._contentRef.componentRef)return this._contentRef.componentRef.instance}close(e){this._windowCmptRef&&(this._resolve(e),this._removeModalElements())}_dismiss(e){this._reject(e),this._removeModalElements()}dismiss(e){if(this._windowCmptRef)if(this._beforeDismiss){const t=this._beforeDismiss();t&&t.then?t.then(t=>{!1!==t&&this._dismiss(e)},()=>{}):!1!==t&&this._dismiss(e)}else this._dismiss(e)}_removeModalElements(){const e=this._windowCmptRef.location.nativeElement;if(e.parentNode.removeChild(e),this._windowCmptRef.destroy(),this._backdropCmptRef){const e=this._backdropCmptRef.location.nativeElement;e.parentNode.removeChild(e),this._backdropCmptRef.destroy()}this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._backdropCmptRef=null,this._contentRef=null}}var hn=function(e){return e[e.BACKDROP_CLICK=0]="BACKDROP_CLICK",e[e.ESC=1]="ESC",e}({});let fn=(()=>{let e=class{constructor(e,t,n){this._document=e,this._elRef=t,this._zone=n,this._closed$=new a.a,this._elWithFocus=null,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new r.p}dismiss(e){this.dismissEvent.emit(e)}ngOnInit(){this._elWithFocus=this._document.activeElement}ngAfterViewInit(){const{nativeElement:e}=this._elRef;if(this._zone.runOutsideAngular(()=>{Object(l.a)(e,"keydown").pipe(Object(y.a)(this._closed$),Object(w.a)(e=>e.which===xt.Escape&&this.keyboard)).subscribe(e=>requestAnimationFrame(()=>{e.defaultPrevented||this._zone.run(()=>this.dismiss(hn.ESC))}));let t=!1;Object(l.a)(this._dialogEl.nativeElement,"mousedown").pipe(Object(y.a)(this._closed$),Object(S.a)(()=>t=!1),Object(v.a)(()=>Object(l.a)(e,"mouseup").pipe(Object(y.a)(this._closed$),Object(D.a)(1))),Object(w.a)(({target:t})=>e===t)).subscribe(()=>{t=!0}),Object(l.a)(e,"click").pipe(Object(y.a)(this._closed$)).subscribe(({target:n})=>{!0!==this.backdrop||e!==n||t||this._zone.run(()=>this.dismiss(hn.BACKDROP_CLICK)),t=!1})}),!e.contains(document.activeElement)){const t=e.querySelector("[ngbAutofocus]"),n=It(e)[0];(t||n||e).focus()}}ngOnDestroy(){const e=this._document.body,t=this._elWithFocus;let n;n=t&&t.focus&&e.contains(t)?t:e,this._zone.runOutsideAngular(()=>{setTimeout(()=>n.focus()),this._elWithFocus=null}),this._closed$.next()}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(s.d),r.Rb(r.n),r.Rb(r.D))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-modal-window"]],viewQuery:function(e,t){if(1&e&&r.Wc(se,3),2&e){let e;r.Ec(e=r.mc())&&(t._dialogEl=e.first)}},hostAttrs:["role","dialog","tabindex","-1"],hostVars:5,hostBindings:function(e,t){2&e&&(r.Eb("aria-modal",!0)("aria-labelledby",t.ariaLabelledBy)("aria-describedby",t.ariaDescribedBy),r.Fb("modal fade show d-block"+(t.windowClass?" "+t.windowClass:"")))},inputs:{backdrop:"backdrop",keyboard:"keyboard",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",centered:"centered",scrollable:"scrollable",size:"size",windowClass:"windowClass"},outputs:{dismissEvent:"dismiss"},ngContentSelectors:L,decls:4,vars:2,consts:[["role","document"],["dialog",""],[1,"modal-content"]],template:function(e,t){1&e&&(r.tc(),r.Xb(0,"div",0,1),r.Xb(2,"div",2),r.sc(3),r.Wb(),r.Wb()),2&e&&r.Fb("modal-dialog"+(t.size?" modal-"+t.size:"")+(t.centered?" modal-dialog-centered":"")+(t.scrollable?" modal-dialog-scrollable":""))},styles:["ngb-modal-window .component-host-scrollable{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}"],encapsulation:2}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(s.d))],e),e})(),pn=(()=>{let e=class{constructor(e,t,n,i,s,o){this._applicationRef=e,this._injector=t,this._document=n,this._scrollBar=i,this._rendererFactory=s,this._ngZone=o,this._activeWindowCmptHasChanged=new a.a,this._ariaHiddenValues=new Map,this._backdropAttributes=["backdropClass"],this._modalRefs=[],this._windowAttributes=["ariaLabelledBy","ariaDescribedBy","backdrop","centered","keyboard","scrollable","size","windowClass"],this._windowCmpts=[],this._activeInstances=new r.p,this._activeWindowCmptHasChanged.subscribe(()=>{if(this._windowCmpts.length){const e=this._windowCmpts[this._windowCmpts.length-1];Rt(this._ngZone,e.location.nativeElement,this._activeWindowCmptHasChanged),this._revertAriaHidden(),this._setAriaHidden(e.location.nativeElement)}})}open(e,t,n,i){const r=i.container instanceof HTMLElement?i.container:He(i.container)?this._document.querySelector(i.container):this._document.body,s=this._rendererFactory.createRenderer(null,null),o=this._scrollBar.compensate(),a=()=>{this._modalRefs.length||(s.removeClass(this._document.body,"modal-open"),this._revertAriaHidden())};if(!r)throw new Error(`The specified modal container "${i.container||"body"}" was not found in the DOM.`);const c=new un,l=this._getContentRef(e,i.injector||t,n,c,i);let u=!1!==i.backdrop?this._attachBackdrop(e,r):void 0,d=this._attachWindowComponent(e,r,l),h=new dn(d,l,u,i.beforeDismiss);return this._registerModalRef(h),this._registerWindowCmpt(d),h.result.then(o,o),h.result.then(a,a),c.close=e=>{h.close(e)},c.dismiss=e=>{h.dismiss(e)},this._applyWindowOptions(d.instance,i),1===this._modalRefs.length&&s.addClass(this._document.body,"modal-open"),u&&u.instance&&this._applyBackdropOptions(u.instance,i),h}get activeInstances(){return this._activeInstances}dismissAll(e){this._modalRefs.forEach(t=>t.dismiss(e))}hasOpenModals(){return this._modalRefs.length>0}_attachBackdrop(e,t){let n=e.resolveComponentFactory(ln).create(this._injector);return this._applicationRef.attachView(n.hostView),t.appendChild(n.location.nativeElement),n}_attachWindowComponent(e,t,n){let i=e.resolveComponentFactory(fn).create(this._injector,n.nodes);return this._applicationRef.attachView(i.hostView),t.appendChild(i.location.nativeElement),i}_applyWindowOptions(e,t){this._windowAttributes.forEach(n=>{He(t[n])&&(e[n]=t[n])})}_applyBackdropOptions(e,t){this._backdropAttributes.forEach(n=>{He(t[n])&&(e[n]=t[n])})}_getContentRef(e,t,n,i,s){return n?n instanceof r.O?this._createFromTemplateRef(n,i):Ne(n)?this._createFromString(n):this._createFromComponent(e,t,n,i,s):new sn([])}_createFromTemplateRef(e,t){const n=e.createEmbeddedView({$implicit:t,close(e){t.close(e)},dismiss(e){t.dismiss(e)}});return this._applicationRef.attachView(n),new sn([n.rootNodes],n)}_createFromString(e){const t=this._document.createTextNode(`${e}`);return new sn([[t]])}_createFromComponent(e,t,n,i,s){const o=e.resolveComponentFactory(n),a=r.v.create({providers:[{provide:un,useValue:i}],parent:t}),c=o.create(a),l=c.location.nativeElement;return s.scrollable&&l.classList.add("component-host-scrollable"),this._applicationRef.attachView(c.hostView),new sn([[l]],c.hostView,c)}_setAriaHidden(e){const t=e.parentElement;t&&e!==this._document.body&&(Array.from(t.children).forEach(t=>{t!==e&&"SCRIPT"!==t.nodeName&&(this._ariaHiddenValues.set(t,t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}),this._setAriaHidden(t))}_revertAriaHidden(){this._ariaHiddenValues.forEach((e,t)=>{e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}),this._ariaHiddenValues.clear()}_registerModalRef(e){const t=()=>{const t=this._modalRefs.indexOf(e);t>-1&&(this._modalRefs.splice(t,1),this._activeInstances.emit(this._modalRefs))};this._modalRefs.push(e),this._activeInstances.emit(this._modalRefs),e.result.then(t,t)}_registerWindowCmpt(e){this._windowCmpts.push(e),this._activeWindowCmptHasChanged.next(),e.onDestroy(()=>{const t=this._windowCmpts.indexOf(e);t>-1&&(this._windowCmpts.splice(t,1),this._activeWindowCmptHasChanged.next())})}};return e.\u0275fac=function(t){return new(t||e)(r.ic(r.g),r.ic(r.v),r.ic(s.d),r.ic(cn),r.ic(r.I),r.ic(r.D))},e.\u0275prov=Object(r.Nb)({factory:function(){return new e(Object(r.ic)(r.g),Object(r.ic)(r.r),Object(r.ic)(s.d),Object(r.ic)(cn),Object(r.ic)(r.I),Object(r.ic)(r.D))},token:e,providedIn:"root"}),e=Object(i.b)([Object(i.e)(2,Object(r.s)(s.d))],e),e})(),mn=(()=>{let e=class{constructor(e,t,n,i){this._moduleCFR=e,this._injector=t,this._modalStack=n,this._config=i}open(e,t={}){const n=Object.assign({},this._config,t);return this._modalStack.open(this._moduleCFR,this._injector,e,n)}get activeInstances(){return this._modalStack.activeInstances}dismissAll(e){this._modalStack.dismissAll(e)}hasOpenModals(){return this._modalStack.hasOpenModals()}};return e.\u0275fac=function(t){return new(t||e)(r.ic(r.k),r.ic(r.v),r.ic(pn),r.ic(rn))},e.\u0275prov=Object(r.Nb)({factory:function(){return new e(Object(r.ic)(r.k),Object(r.ic)(r.r),Object(r.ic)(pn),Object(r.ic)(rn))},token:e,providedIn:"root"}),e})(),bn=(()=>{let e=class{constructor(){this.destroyOnHide=!0,this.orientation="horizontal",this.roles="tablist",this.keyboard=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const gn=e=>He(e)&&""!==e;let _n=0,vn=(()=>{let e=class{constructor(e){this.templateRef=e}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.O))},e.\u0275dir=r.Mb({type:e,selectors:[["ng-template","ngbNavContent",""]]}),e})(),yn=(()=>{let e=class{constructor(e,t){this.elementRef=t,this.disabled=!1,this._nav=e}ngAfterContentChecked(){this.contentTpl=this.contentTpls.first}ngOnInit(){He(this.domId)||(this.domId="ngb-nav-"+_n++)}get active(){return this._nav.activeId===this.id}get id(){return gn(this._id)?this._id:this.domId}get panelDomId(){return`${this.domId}-panel`}isPanelInDom(){return(He(this.destroyOnHide)?!this.destroyOnHide:!this._nav.destroyOnHide)||this.active}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Object(r.W)(()=>wn)),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbNavItem",""]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,vn,0),2&e){let e;r.Ec(e=r.mc())&&(t.contentTpls=e)}},hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("nav-item",!0)},inputs:{disabled:"disabled",domId:"domId",destroyOnHide:"destroyOnHide",_id:["ngbNavItem","_id"]},exportAs:["ngbNavItem"]}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(Object(r.W)(()=>wn)))],e),e})(),wn=(()=>{let e=class{constructor(e,t,n,i){this.role=e,this._cd=n,this._document=i,this.activeIdChange=new r.p,this.navChange=new r.p,this.destroyOnHide=t.destroyOnHide,this.orientation=t.orientation,this.roles=t.roles,this.keyboard=t.keyboard}click(e){e.disabled||this._updateActiveId(e.id)}onKeyDown(e){if("tablist"!==this.roles||!this.keyboard)return;const t=e.which,n=this.links.filter(e=>!e.navItem.disabled),{length:i}=n;let r=-1;if(n.forEach((e,t)=>{e.elRef.nativeElement===this._document.activeElement&&(r=t)}),i){switch(t){case xt.ArrowLeft:if("vertical"===this.orientation)return;r=(r-1+i)%i;break;case xt.ArrowRight:if("vertical"===this.orientation)return;r=(r+1)%i;break;case xt.ArrowDown:if("horizontal"===this.orientation)return;r=(r+1)%i;break;case xt.ArrowUp:if("horizontal"===this.orientation)return;r=(r-1+i)%i;break;case xt.Home:r=0;break;case xt.End:r=i-1}"changeWithArrows"===this.keyboard&&this.select(n[r].navItem.id),n[r].elRef.nativeElement.focus(),e.preventDefault()}}select(e){this._updateActiveId(e,!1)}ngAfterContentInit(){if(!He(this.activeId)){const e=this.items.first?this.items.first.id:null;gn(e)&&(this._updateActiveId(e,!1),this._cd.detectChanges())}}_updateActiveId(e,t=!0){if(this.activeId!==e){let n=!1;t&&this.navChange.emit({activeId:this.activeId,nextId:e,preventDefault:()=>{n=!0}}),n||(this.activeId=e,this.activeIdChange.emit(e))}}};return e.\u0275fac=function(t){return new(t||e)(r.jc("role"),r.Rb(bn),r.Rb(r.i),r.Rb(s.d))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbNav",""]],contentQueries:function(e,t,n){if(1&e&&(r.Kb(n,yn,0),r.Kb(n,Dn,1)),2&e){let e;r.Ec(e=r.mc())&&(t.items=e),r.Ec(e=r.mc())&&(t.links=e)}},hostVars:6,hostBindings:function(e,t){1&e&&r.lc("keydown.arrowLeft",function(e){return t.onKeyDown(e)})("keydown.arrowRight",function(e){return t.onKeyDown(e)})("keydown.arrowDown",function(e){return t.onKeyDown(e)})("keydown.arrowUp",function(e){return t.onKeyDown(e)})("keydown.Home",function(e){return t.onKeyDown(e)})("keydown.End",function(e){return t.onKeyDown(e)}),2&e&&(r.Eb("aria-orientation","vertical"===t.orientation&&"tablist"===t.roles?"vertical":void 0)("role",t.role?t.role:t.roles?"tablist":void 0),r.Jb("nav",!0)("flex-column","vertical"===t.orientation))},inputs:{destroyOnHide:"destroyOnHide",orientation:"orientation",roles:"roles",keyboard:"keyboard",activeId:"activeId"},outputs:{activeIdChange:"activeIdChange",navChange:"navChange"},exportAs:["ngbNav"]}),e=Object(i.b)([Object(i.e)(0,Object(r.h)("role")),Object(i.e)(3,Object(r.s)(s.d))],e),e})(),Dn=(()=>{let e=class{constructor(e,t,n,i){this.role=e,this.navItem=t,this.nav=n,this.elRef=i}hasNavItemClass(){return this.navItem.elementRef.nativeElement.nodeType===Node.COMMENT_NODE}};return e.\u0275fac=function(t){return new(t||e)(r.jc("role"),r.Rb(yn),r.Rb(wn),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["a","ngbNavLink",""]],hostAttrs:["href",""],hostVars:14,hostBindings:function(e,t){1&e&&r.lc("click",function(e){return t.nav.click(t.navItem),e.preventDefault()}),2&e&&(r.ac("id",t.navItem.domId),r.Eb("role",t.role?t.role:t.nav.roles?"tab":void 0)("tabindex",t.navItem.disabled?-1:void 0)("aria-controls",t.navItem.isPanelInDom()?t.navItem.panelDomId:null)("aria-selected",t.navItem.active)("aria-disabled",t.navItem.disabled),r.Jb("nav-link",!0)("nav-item",t.hasNavItemClass())("active",t.navItem.active)("disabled",t.navItem.disabled))}}),e=Object(i.b)([Object(i.e)(0,Object(r.h)("role"))],e),e})(),Sn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["","ngbNavOutlet",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("tab-content",!0)},inputs:{paneRole:"paneRole",nav:["ngbNavOutlet","nav"]},attrs:oe,decls:1,vars:1,consts:[["ngFor","",3,"ngForOf"],["class","tab-pane",3,"id","active",4,"ngIf"],[1,"tab-pane",3,"id"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&r.Pc(0,ue,1,1,"ng-template",0),2&e&&r.uc("ngForOf",t.nav.items)},directives:[s.q,s.r,s.w],encapsulation:2}),e})(),xn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})();class kn{constructor(e,t){this.open=e,this.close=t,t||(this.close=e)}isManual(){return"manual"===this.open||"manual"===this.close}}const Tn={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]},Mn=e=>e>0?Object(M.a)(e):e=>e;function Cn(e,t,n,i,r,s,o=0,a=0){const c=function(e,t=Tn){const n=(e||"").trim();if(0===n.length)return[];const i=n.split(/\s+/).map(e=>e.split(":")).map(e=>{let n=t[e[0]]||e;return new kn(n[0],n[1])}),r=i.filter(e=>e.isManual());if(r.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===r.length&&i.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return i}(n);if(1===c.length&&c[0].isManual())return()=>{};const l=function(e,t,n,i){return new g.a(r=>{const s=[],o=()=>r.next(!0),a=()=>r.next(!1),c=()=>r.next(!i());return n.forEach(n=>{n.open===n.close?s.push(e.listen(t,n.open,c)):s.push(e.listen(t,n.open,o),e.listen(t,n.close,a))}),()=>{s.forEach(e=>e())}})}(e,t,c,i).pipe(function(e,t,n){return i=>{let r=null;const s=i.pipe(Object(_.a)(e=>({open:e})),Object(w.a)(e=>{const t=n();return t===e.open||r&&r.open!==t?(r&&r.open!==e.open&&(r=null),!1):(r=e,!0)}),Object(C.a)()),o=s.pipe(Object(w.a)(e=>e.open),Mn(e)),a=s.pipe(Object(w.a)(e=>!e.open),Mn(t));return Object(u.a)(o,a).pipe(Object(w.a)(e=>e===r&&(r=null,e.open!==n())),Object(_.a)(e=>e.open))}}(o,a,i)).subscribe(e=>e?r():s());return()=>l.unsubscribe()}let On=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement="auto",this.triggers="click",this.disablePopover=!1,this.openDelay=0,this.closeDelay=0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Ln=0,En=(()=>{let e=class{isTitleTemplate(){return this.title instanceof r.O}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-popover-window"]],hostAttrs:["role","tooltip"],hostVars:3,hostBindings:function(e,t){2&e&&(r.ac("id",t.id),r.Fb("popover"+(t.popoverClass?" "+t.popoverClass:"")))},inputs:{title:"title",id:"id",popoverClass:"popoverClass",context:"context"},ngContentSelectors:L,decls:4,vars:1,consts:[[1,"arrow"],["class","popover-header",4,"ngIf"],[1,"popover-body"],[1,"popover-header"],["simpleTitle",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(r.tc(),r.Sb(0,"div",0),r.Pc(1,fe,4,2,"h3",1),r.Xb(2,"div",2),r.sc(3),r.Wb()),2&e&&(r.Db(1),r.uc("ngIf",null!=t.title))},directives:[s.r,s.w],styles:["ngb-popover-window.bs-popover-bottom>.arrow,ngb-popover-window.bs-popover-top>.arrow{left:50%;margin-left:-.5rem}ngb-popover-window.bs-popover-bottom-left>.arrow,ngb-popover-window.bs-popover-top-left>.arrow{left:2em}ngb-popover-window.bs-popover-bottom-right>.arrow,ngb-popover-window.bs-popover-top-right>.arrow{left:auto;right:2em}ngb-popover-window.bs-popover-left>.arrow,ngb-popover-window.bs-popover-right>.arrow{top:50%;margin-top:-.5rem}ngb-popover-window.bs-popover-left-top>.arrow,ngb-popover-window.bs-popover-right-top>.arrow{top:.7em}ngb-popover-window.bs-popover-left-bottom>.arrow,ngb-popover-window.bs-popover-right-bottom>.arrow{top:auto;bottom:.7em}"],encapsulation:2,changeDetection:0}),e})(),An=(()=>{let e=class{constructor(e,t,n,i,s,o,a,c,l,u){this._elementRef=e,this._renderer=t,this._ngZone=a,this._document=c,this._changeDetector=l,this.shown=new r.p,this.hidden=new r.p,this._ngbPopoverWindowId="ngb-popover-"+Ln++,this._windowRef=null,this.autoClose=o.autoClose,this.placement=o.placement,this.triggers=o.triggers,this.container=o.container,this.disablePopover=o.disablePopover,this.popoverClass=o.popoverClass,this.openDelay=o.openDelay,this.closeDelay=o.closeDelay,this._popupService=new on(En,n,s,t,i,u),this._zoneSubscription=a.onStable.subscribe(()=>{this._windowRef&&Wt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-popover")})}_isDisabled(){return!!this.disablePopover||!this.ngbPopover&&!this.popoverTitle}open(e){this._windowRef||this._isDisabled()||(this._windowRef=this._popupService.open(this.ngbPopover,e),this._windowRef.instance.title=this.popoverTitle,this._windowRef.instance.context=e,this._windowRef.instance.popoverClass=this.popoverClass,this._windowRef.instance.id=this._ngbPopoverWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbPopoverWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),Et(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),this.shown.emit())}close(){this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(),this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck())}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=Cn(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({ngbPopover:e,popoverTitle:t,disablePopover:n,popoverClass:i}){i&&this.isOpen()&&(this._windowRef.instance.popoverClass=i.currentValue),(e||t||n)&&this._isDisabled()&&this.close()}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.n),r.Rb(r.H),r.Rb(r.v),r.Rb(r.k),r.Rb(r.S),r.Rb(On),r.Rb(r.D),r.Rb(s.d),r.Rb(r.i),r.Rb(r.g))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbPopover",""]],inputs:{autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disablePopover:"disablePopover",popoverClass:"popoverClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbPopover:"ngbPopover",popoverTitle:"popoverTitle"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbPopover"],features:[r.Bb]}),e=Object(i.b)([Object(i.e)(7,Object(r.s)(s.d))],e),e})(),In=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})(),Rn=(()=>{let e=class{constructor(){this.max=100,this.animated=!1,this.striped=!1,this.showValue=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Pn=(()=>{let e=class{constructor(e){this.value=0,this.max=e.max,this.animated=e.animated,this.striped=e.striped,this.textType=e.textType,this.type=e.type,this.showValue=e.showValue,this.height=e.height}set max(e){this._max=!ze(e)||e<=0?100:e}get max(){return this._max}getValue(){return Ye(this.value,this.max)}getPercentValue(){return 100*this.getValue()/this.max}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Rn))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-progressbar"]],inputs:{value:"value",max:"max",animated:"animated",striped:"striped",textType:"textType",type:"type",showValue:"showValue",height:"height"},ngContentSelectors:L,decls:4,vars:13,consts:function(){let e;return e="" + "\ufffd0\ufffd" + "",[[1,"progress"],["role","progressbar","aria-valuemin","0"],[4,"ngIf"],e]},template:function(e,t){1&e&&(r.tc(),r.Xb(0,"div",0),r.Xb(1,"div",1),r.Pc(2,pe,3,3,"span",2),r.sc(3),r.Wb(),r.Wb()),2&e&&(r.Nc("height",t.height),r.Db(1),r.Ib("progress-bar",t.type?" bg-"+t.type:"","",t.textType?" text-"+t.textType:"","\n      ",t.animated?" progress-bar-animated":"","",t.striped?" progress-bar-striped":"",""),r.Nc("width",t.getPercentValue(),"%"),r.Eb("aria-valuenow",t.getValue())("aria-valuemax",t.max),r.Db(1),r.uc("ngIf",t.showValue))},directives:[s.r],pipes:[s.y],encapsulation:2,changeDetection:0}),e})(),Fn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})(),Wn=(()=>{let e=class{constructor(){this.max=10,this.readonly=!1,this.resettable=!1}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const jn={provide:o.o,useExisting:Object(r.W)(()=>Yn),multi:!0};let Yn=(()=>{let e=class{constructor(e,t){this._changeDetectorRef=t,this.contexts=[],this.disabled=!1,this.hover=new r.p,this.leave=new r.p,this.rateChange=new r.p(!0),this.onChange=e=>{},this.onTouched=()=>{},this.max=e.max,this.readonly=e.readonly}ariaValueText(){return`${this.nextRate} out of ${this.max}`}enter(e){this.readonly||this.disabled||this._updateState(e),this.hover.emit(e)}handleBlur(){this.onTouched()}handleClick(e){this.readonly||this.disabled||this.update(this.resettable&&this.rate===e?0:e)}handleKeyDown(e){switch(e.which){case xt.ArrowDown:case xt.ArrowLeft:this.update(this.rate-1);break;case xt.ArrowUp:case xt.ArrowRight:this.update(this.rate+1);break;case xt.Home:this.update(0);break;case xt.End:this.update(this.max);break;default:return}e.preventDefault()}ngOnChanges(e){e.rate&&this.update(this.rate)}ngOnInit(){this.contexts=Array.from({length:this.max},(e,t)=>({fill:0,index:t})),this._updateState(this.rate)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}reset(){this.leave.emit(this.nextRate),this._updateState(this.rate)}setDisabledState(e){this.disabled=e}update(e,t=!0){const n=Ye(e,this.max,0);this.readonly||this.disabled||this.rate===n||(this.rate=n,this.rateChange.emit(this.rate)),t&&(this.onChange(this.rate),this.onTouched()),this._updateState(this.rate)}writeValue(e){this.update(e,!1),this._changeDetectorRef.markForCheck()}_getFillValue(e){const t=this.nextRate-e;return t>=1?100:t<1&&t>0?parseInt((100*t).toFixed(2),10):0}_updateState(e){this.nextRate=e,this.contexts.forEach((e,t)=>e.fill=this._getFillValue(t))}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Wn),r.Rb(r.i))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-rating"]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,r.O,1),2&e){let e;r.Ec(e=r.mc())&&(t.starTemplateFromContent=e.first)}},hostAttrs:["role","slider","aria-valuemin","0",1,"d-inline-flex"],hostVars:5,hostBindings:function(e,t){1&e&&r.lc("blur",function(){return t.handleBlur()})("keydown",function(e){return t.handleKeyDown(e)})("mouseleave",function(){return t.reset()}),2&e&&(r.ac("tabindex",t.disabled?-1:0),r.Eb("aria-valuemax",t.max)("aria-valuenow",t.nextRate)("aria-valuetext",t.ariaValueText())("aria-disabled",!!t.readonly||null))},inputs:{max:"max",readonly:"readonly",rate:"rate",resettable:"resettable",starTemplate:"starTemplate"},outputs:{hover:"hover",leave:"leave",rateChange:"rateChange"},features:[r.Cb([jn]),r.Bb],decls:3,vars:1,consts:[["t",""],["ngFor","",3,"ngForOf"],[1,"sr-only"],[3,"mouseenter","click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(r.Pc(0,me,1,1,"ng-template",null,0,r.Qc),r.Pc(2,ge,4,5,"ng-template",1)),2&e&&(r.Db(2),r.uc("ngForOf",t.contexts))},directives:[s.q,s.w],encapsulation:2,changeDetection:0}),e})();class Nn{constructor(e,t,n){this.hour=We(e),this.minute=We(t),this.second=We(n)}changeHour(e=1){this.updateHour((isNaN(this.hour)?0:this.hour)+e)}updateHour(e){this.hour=ze(e)?(e<0?24+e:e)%24:NaN}changeMinute(e=1){this.updateMinute((isNaN(this.minute)?0:this.minute)+e)}updateMinute(e){ze(e)?(this.minute=e%60<0?60+e%60:e%60,this.changeHour(Math.floor(e/60))):this.minute=NaN}changeSecond(e=1){this.updateSecond((isNaN(this.second)?0:this.second)+e)}updateSecond(e){ze(e)?(this.second=e<0?60+e%60:e%60,this.changeMinute(Math.floor(e/60))):this.second=NaN}isValid(e=!0){return ze(this.hour)&&ze(this.minute)&&(!e||ze(this.second))}toString(){return`${this.hour||0}:${this.minute||0}:${this.second||0}`}}let zn=(()=>{let e=class{constructor(){this.meridian=!1,this.spinners=!0,this.seconds=!1,this.hourStep=1,this.minuteStep=1,this.secondStep=1,this.disabled=!1,this.readonlyInputs=!1,this.size="medium"}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function $n(){return new Xn}let Hn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:$n,token:e,providedIn:"root"}),e})(),Xn=(()=>{let e=class extends Hn{fromModel(e){return e&&$e(e.hour)&&$e(e.minute)?{hour:e.hour,minute:e.minute,second:$e(e.second)?e.second:null}:null}toModel(e){return e&&$e(e.hour)&&$e(e.minute)?{hour:e.hour,minute:e.minute,second:$e(e.second)?e.second:null}:null}};return e.\u0275fac=function(t){return bi(t||e)},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),Vn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return e=Object(r.ic)(r.y),new Bn(e);var e},token:e,providedIn:"root"}),e})(),Bn=(()=>{let e=class extends Vn{constructor(e){super(),this._periods=Object(s.G)(e,s.g.Standalone,s.B.Narrow)}getMorningPeriod(){return this._periods[0]}getAfternoonPeriod(){return this._periods[1]}};return e.\u0275fac=function(t){return new(t||e)(r.ic(r.y))},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(r.y))],e),e})();const Un=/[^0-9]/g,qn={provide:o.o,useExisting:Object(r.W)(()=>Gn),multi:!0};let Gn=(()=>{let e=class{constructor(e,t,n,i){this._config=e,this._ngbTimeAdapter=t,this._cd=n,this.i18n=i,this.onChange=e=>{},this.onTouched=()=>{},this.meridian=e.meridian,this.spinners=e.spinners,this.seconds=e.seconds,this.hourStep=e.hourStep,this.minuteStep=e.minuteStep,this.secondStep=e.secondStep,this.disabled=e.disabled,this.readonlyInputs=e.readonlyInputs,this.size=e.size}set hourStep(e){this._hourStep=$e(e)?e:this._config.hourStep}get hourStep(){return this._hourStep}set minuteStep(e){this._minuteStep=$e(e)?e:this._config.minuteStep}get minuteStep(){return this._minuteStep}set secondStep(e){this._secondStep=$e(e)?e:this._config.secondStep}get secondStep(){return this._secondStep}writeValue(e){const t=this._ngbTimeAdapter.fromModel(e);this.model=t?new Nn(t.hour,t.minute,t.second):new Nn,this.seconds||t&&ze(t.second)||(this.model.second=0),this._cd.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}changeHour(e){this.model.changeHour(e),this.propagateModelChange()}changeMinute(e){this.model.changeMinute(e),this.propagateModelChange()}changeSecond(e){this.model.changeSecond(e),this.propagateModelChange()}updateHour(e){const t=this.model.hour>=12,n=We(e);this.model.updateHour(this.meridian&&(t&&n<12||!t&&12===n)?n+12:n),this.propagateModelChange()}updateMinute(e){this.model.updateMinute(We(e)),this.propagateModelChange()}updateSecond(e){this.model.updateSecond(We(e)),this.propagateModelChange()}toggleMeridian(){this.meridian&&this.changeHour(12)}formatInput(e){e.value=e.value.replace(Un,"")}formatHour(e){return ze(e)?Xe(this.meridian?e%12==0?12:e%12:e%24):Xe(NaN)}formatMinSec(e){return Xe(ze(e)?e:NaN)}get isSmallSize(){return"small"===this.size}get isLargeSize(){return"large"===this.size}ngOnChanges(e){e.seconds&&!this.seconds&&this.model&&!ze(this.model.second)&&(this.model.second=0,this.propagateModelChange(!1))}propagateModelChange(e=!0){e&&this.onTouched(),this.model.isValid(this.seconds)?this.onChange(this._ngbTimeAdapter.toModel({hour:this.model.hour,minute:this.model.minute,second:this.model.second})):this.onChange(this._ngbTimeAdapter.toModel(null))}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(zn),r.Rb(Hn),r.Rb(r.i),r.Rb(Vn))},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-timepicker"]],inputs:{meridian:"meridian",spinners:"spinners",seconds:"seconds",hourStep:"hourStep",minuteStep:"minuteStep",secondStep:"secondStep",readonlyInputs:"readonlyInputs",size:"size"},features:[r.Cb([qn]),r.Bb],decls:16,vars:25,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f;return e="HH",t="Hours",n="MM",i="Minutes",r="Increment hours",s="Decrement hours",o="Increment minutes",a="Decrement minutes",c="SS",l="Seconds",u="Increment seconds",d="Decrement seconds",h="" + "\ufffd0\ufffd" + "",f="" + "\ufffd0\ufffd" + "",[[3,"disabled"],[1,"ngb-tp"],[1,"ngb-tp-input-container","ngb-tp-hour"],["tabindex","-1","type","button","class","btn btn-link",3,"btn-sm","btn-lg","disabled","click",4,"ngIf"],["type","text","maxlength","2","inputmode","numeric","placeholder",e,"aria-label",t,1,"ngb-tp-input","form-control",3,"value","readOnly","disabled","change","input","keydown.ArrowUp","keydown.ArrowDown"],[1,"ngb-tp-spacer"],[1,"ngb-tp-input-container","ngb-tp-minute"],["type","text","maxlength","2","inputmode","numeric","placeholder",n,"aria-label",i,1,"ngb-tp-input","form-control",3,"value","readOnly","disabled","change","input","keydown.ArrowUp","keydown.ArrowDown"],["class","ngb-tp-spacer",4,"ngIf"],["class","ngb-tp-input-container ngb-tp-second",4,"ngIf"],["class","ngb-tp-meridian",4,"ngIf"],["tabindex","-1","type","button",1,"btn","btn-link",3,"disabled","click"],[1,"chevron","ngb-tp-chevron"],[1,"sr-only"],r,[1,"chevron","ngb-tp-chevron","bottom"],s,o,a,[1,"ngb-tp-input-container","ngb-tp-second"],["type","text","maxlength","2","inputmode","numeric","placeholder",c,"aria-label",l,1,"ngb-tp-input","form-control",3,"value","readOnly","disabled","change","input","keydown.ArrowUp","keydown.ArrowDown"],u,d,[1,"ngb-tp-meridian"],["type","button",1,"btn","btn-outline-primary",3,"disabled","click"],[4,"ngIf","ngIfElse"],["am",""],h,f]},template:function(e,t){1&e&&(r.Xb(0,"fieldset",0),r.Xb(1,"div",1),r.Xb(2,"div",2),r.Pc(3,_e,4,7,"button",3),r.Xb(4,"input",4),r.lc("change",function(e){return t.updateHour(e.target.value)})("input",function(e){return t.formatInput(e.target)})("keydown.ArrowUp",function(e){return t.changeHour(t.hourStep),e.preventDefault()})("keydown.ArrowDown",function(e){return t.changeHour(-t.hourStep),e.preventDefault()}),r.Wb(),r.Pc(5,ve,4,7,"button",3),r.Wb(),r.Xb(6,"div",5),r.Rc(7,":"),r.Wb(),r.Xb(8,"div",6),r.Pc(9,ye,4,7,"button",3),r.Xb(10,"input",7),r.lc("change",function(e){return t.updateMinute(e.target.value)})("input",function(e){return t.formatInput(e.target)})("keydown.ArrowUp",function(e){return t.changeMinute(t.minuteStep),e.preventDefault()})("keydown.ArrowDown",function(e){return t.changeMinute(-t.minuteStep),e.preventDefault()}),r.Wb(),r.Pc(11,we,4,7,"button",3),r.Wb(),r.Pc(12,De,2,0,"div",8),r.Pc(13,ke,4,9,"div",9),r.Pc(14,Te,1,0,"div",8),r.Pc(15,Oe,5,9,"div",10),r.Wb(),r.Wb()),2&e&&(r.Jb("disabled",t.disabled),r.uc("disabled",t.disabled),r.Db(3),r.uc("ngIf",t.spinners),r.Db(1),r.Jb("form-control-sm",t.isSmallSize)("form-control-lg",t.isLargeSize),r.uc("value",t.formatHour(null==t.model?null:t.model.hour))("readOnly",t.readonlyInputs)("disabled",t.disabled),r.Db(1),r.uc("ngIf",t.spinners),r.Db(4),r.uc("ngIf",t.spinners),r.Db(1),r.Jb("form-control-sm",t.isSmallSize)("form-control-lg",t.isLargeSize),r.uc("value",t.formatMinSec(null==t.model?null:t.model.minute))("readOnly",t.readonlyInputs)("disabled",t.disabled),r.Db(1),r.uc("ngIf",t.spinners),r.Db(1),r.uc("ngIf",t.seconds),r.Db(1),r.uc("ngIf",t.seconds),r.Db(1),r.uc("ngIf",t.meridian),r.Db(1),r.uc("ngIf",t.meridian))},directives:[s.r],styles:['ngb-timepicker{font-size:1rem}.ngb-tp{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-tp-input-container{width:4em}.ngb-tp-chevron::before{border-style:solid;border-width:.29em .29em 0 0;content:"";display:inline-block;height:.69em;left:.05em;position:relative;top:.15em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);vertical-align:middle;width:.69em}.ngb-tp-chevron.bottom:before{top:-.3em;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ngb-tp-input{text-align:center}.ngb-tp-hour,.ngb-tp-meridian,.ngb-tp-minute,.ngb-tp-second{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ngb-tp-spacer{width:1em;text-align:center}'],encapsulation:2}),e})(),Jn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})(),Kn=(()=>{let e=class{constructor(){this.autoClose=!0,this.placement="auto",this.triggers="hover focus",this.disableTooltip=!1,this.openDelay=0,this.closeDelay=0}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),Qn=0,Zn=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-tooltip-window"]],hostAttrs:["role","tooltip"],hostVars:3,hostBindings:function(e,t){2&e&&(r.ac("id",t.id),r.Fb("tooltip show"+(t.tooltipClass?" "+t.tooltipClass:"")))},inputs:{id:"id",tooltipClass:"tooltipClass"},ngContentSelectors:L,decls:3,vars:0,consts:[[1,"arrow"],[1,"tooltip-inner"]],template:function(e,t){1&e&&(r.tc(),r.Sb(0,"div",0),r.Xb(1,"div",1),r.sc(2),r.Wb())},styles:["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{top:auto;bottom:.4rem}"],encapsulation:2,changeDetection:0}),e})(),ei=(()=>{let e=class{constructor(e,t,n,i,s,o,a,c,l,u){this._elementRef=e,this._renderer=t,this._ngZone=a,this._document=c,this._changeDetector=l,this.shown=new r.p,this.hidden=new r.p,this._ngbTooltipWindowId="ngb-tooltip-"+Qn++,this._windowRef=null,this.autoClose=o.autoClose,this.placement=o.placement,this.triggers=o.triggers,this.container=o.container,this.disableTooltip=o.disableTooltip,this.tooltipClass=o.tooltipClass,this.openDelay=o.openDelay,this.closeDelay=o.closeDelay,this._popupService=new on(Zn,n,s,t,i,u),this._zoneSubscription=a.onStable.subscribe(()=>{this._windowRef&&Wt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container,"bs-tooltip")})}set ngbTooltip(e){this._ngbTooltip=e,!e&&this._windowRef&&this.close()}get ngbTooltip(){return this._ngbTooltip}open(e){this._windowRef||!this._ngbTooltip||this.disableTooltip||(this._windowRef=this._popupService.open(this._ngbTooltip,e),this._windowRef.instance.tooltipClass=this.tooltipClass,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.detectChanges(),this._windowRef.changeDetectorRef.markForCheck(),Et(this._ngZone,this._document,this.autoClose,()=>this.close(),this.hidden,[this._windowRef.location.nativeElement]),this.shown.emit())}close(){null!=this._windowRef&&(this._renderer.removeAttribute(this._elementRef.nativeElement,"aria-describedby"),this._popupService.close(),this._windowRef=null,this.hidden.emit(),this._changeDetector.markForCheck())}toggle(){this._windowRef?this.close():this.open()}isOpen(){return null!=this._windowRef}ngOnInit(){this._unregisterListenersFn=Cn(this._renderer,this._elementRef.nativeElement,this.triggers,this.isOpen.bind(this),this.open.bind(this),this.close.bind(this),+this.openDelay,+this.closeDelay)}ngOnChanges({tooltipClass:e}){e&&this.isOpen()&&(this._windowRef.instance.tooltipClass=e.currentValue)}ngOnDestroy(){this.close(),this._unregisterListenersFn&&this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.n),r.Rb(r.H),r.Rb(r.v),r.Rb(r.k),r.Rb(r.S),r.Rb(Kn),r.Rb(r.D),r.Rb(s.d),r.Rb(r.i),r.Rb(r.g))},e.\u0275dir=r.Mb({type:e,selectors:[["","ngbTooltip",""]],inputs:{autoClose:"autoClose",placement:"placement",triggers:"triggers",container:"container",disableTooltip:"disableTooltip",tooltipClass:"tooltipClass",openDelay:"openDelay",closeDelay:"closeDelay",ngbTooltip:"ngbTooltip"},outputs:{shown:"shown",hidden:"hidden"},exportAs:["ngbTooltip"],features:[r.Bb]}),e=Object(i.b)([Object(i.e)(7,Object(r.s)(s.d))],e),e})(),ti=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({}),e})(),ni=(()=>{let e=class{constructor(){this.highlightClass="ngb-highlight"}ngOnChanges(e){const t=je(this.result),n=(Array.isArray(this.term)?this.term:[this.term]).map(e=>je(e).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")).filter(e=>e);this.parts=n.length?t.split(new RegExp(`(${n.join("|")})`,"gmi")):[t]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-highlight"]],inputs:{highlightClass:"highlightClass",result:"result",term:"term"},features:[r.Bb],decls:1,vars:1,consts:[["ngFor","",3,"ngForOf"],[3,"class",4,"ngIf","ngIfElse"],["even",""]],template:function(e,t){1&e&&r.Pc(0,Ae,3,2,"ng-template",0),2&e&&r.uc("ngForOf",t.parts)},directives:[s.q,s.r],styles:[".ngb-highlight{font-weight:700}"],encapsulation:2,changeDetection:0}),e})(),ii=(()=>{let e=class{constructor(){this.activeIdx=0,this.focusFirst=!0,this.formatter=je,this.selectEvent=new r.p,this.activeChangeEvent=new r.p}hasActive(){return this.activeIdx>-1&&this.activeIdx<this.results.length}getActive(){return this.results[this.activeIdx]}markActive(e){this.activeIdx=e,this._activeChanged()}next(){this.activeIdx===this.results.length-1?this.activeIdx=this.focusFirst?(this.activeIdx+1)%this.results.length:-1:this.activeIdx++,this._activeChanged()}prev(){this.activeIdx<0?this.activeIdx=this.results.length-1:0===this.activeIdx?this.activeIdx=this.focusFirst?this.results.length-1:-1:this.activeIdx--,this._activeChanged()}resetActive(){this.activeIdx=this.focusFirst?0:-1,this._activeChanged()}select(e){this.selectEvent.emit(e)}ngOnInit(){this.resetActive()}_activeChanged(){this.activeChangeEvent.emit(this.activeIdx>=0?this.id+"-"+this.activeIdx:void 0)}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ngb-typeahead-window"]],hostAttrs:["role","listbox",1,"dropdown-menu","show"],hostVars:1,hostBindings:function(e,t){1&e&&r.lc("mousedown",function(e){return e.preventDefault()}),2&e&&r.ac("id",t.id)},inputs:{focusFirst:"focusFirst",formatter:"formatter",id:"id",results:"results",term:"term",resultTemplate:"resultTemplate"},outputs:{selectEvent:"select",activeChangeEvent:"activeChange"},exportAs:["ngbTypeaheadWindow"],decls:3,vars:1,consts:[["rt",""],["ngFor","",3,"ngForOf"],[3,"result","term"],["type","button","role","option",1,"dropdown-item",3,"id","mouseenter","click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(r.Pc(0,Ie,1,2,"ng-template",null,0,r.Qc),r.Pc(2,Fe,2,9,"ng-template",1)),2&e&&(r.Db(2),r.uc("ngForOf",t.results))},directives:[s.q,ni,s.w],encapsulation:2}),e})();const ri=new r.u("live announcer delay",{providedIn:"root",factory:function(){return 100}});function si(e,t=!1){let n=e.body.querySelector("#ngb-live");return null==n&&t&&(n=e.createElement("div"),n.setAttribute("id","ngb-live"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.classList.add("sr-only"),e.body.appendChild(n)),n}let oi=(()=>{let e=class{constructor(e,t){this._document=e,this._delay=t}ngOnDestroy(){const e=si(this._document);e&&e.parentElement.removeChild(e)}say(e){const t=si(this._document,!0),n=this._delay;if(null!=t){t.textContent="";const i=()=>t.textContent=e;null===n?i():setTimeout(i,n)}}};return e.\u0275fac=function(t){return new(t||e)(r.ic(s.d),r.ic(ri))},e.\u0275prov=Object(r.Nb)({factory:function(){return new e(Object(r.ic)(s.d),Object(r.ic)(ri))},token:e,providedIn:"root"}),e=Object(i.b)([Object(i.e)(0,Object(r.s)(s.d)),Object(i.e)(1,Object(r.s)(ri))],e),e})(),ai=(()=>{let e=class{constructor(){this.editable=!0,this.focusFirst=!0,this.showHint=!1,this.placement=["bottom-left","bottom-right","top-left","top-right"]}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const ci={provide:o.o,useExisting:Object(r.W)(()=>ui),multi:!0};let li=0,ui=(()=>{let e=class{constructor(e,t,n,i,s,o,u,d,h,f,p,m){this._elementRef=e,this._renderer=n,this._live=d,this._document=h,this._ngZone=f,this._changeDetector=p,this._subscription=null,this._closed$=new a.a,this._inputValueBackup=null,this._windowRef=null,this.autocomplete="off",this.placement="bottom-left",this.selectItem=new r.p,this.activeDescendant=null,this.popupId="ngb-typeahead-"+li++,this._onTouched=()=>{},this._onChange=e=>{},this.container=o.container,this.editable=o.editable,this.focusFirst=o.focusFirst,this.showHint=o.showHint,this.placement=o.placement,this._valueChanges=Object(l.a)(e.nativeElement,"input").pipe(Object(_.a)(e=>e.target.value)),this._resubscribeTypeahead=new c.a(null),this._popupService=new on(ii,i,t,n,s,m),this._zoneSubscription=u.onStable.subscribe(()=>{this.isPopupOpen()&&Wt(this._elementRef.nativeElement,this._windowRef.location.nativeElement,this.placement,"body"===this.container)})}ngOnInit(){const e=this._valueChanges.pipe(Object(S.a)(e=>{this._inputValueBackup=this.showHint?e:null,this._onChange(this.editable?e:void 0)})).pipe(this.ngbTypeahead),t=this._resubscribeTypeahead.pipe(Object(v.a)(()=>e));this._subscription=this._subscribeToUserInput(t)}ngOnDestroy(){this._closePopup(),this._unsubscribeFromUserInput(),this._zoneSubscription.unsubscribe()}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}writeValue(e){this._writeInputValue(this._formatItemForInput(e)),this.showHint&&(this._inputValueBackup=e)}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}dismissPopup(){this.isPopupOpen()&&(this._resubscribeTypeahead.next(null),this._closePopup(),this.showHint&&null!==this._inputValueBackup&&this._writeInputValue(this._inputValueBackup),this._changeDetector.markForCheck())}isPopupOpen(){return null!=this._windowRef}handleBlur(){this._resubscribeTypeahead.next(null),this._onTouched()}handleKeyDown(e){if(this.isPopupOpen())switch(e.which){case xt.ArrowDown:e.preventDefault(),this._windowRef.instance.next(),this._showHint();break;case xt.ArrowUp:e.preventDefault(),this._windowRef.instance.prev(),this._showHint();break;case xt.Enter:case xt.Tab:const t=this._windowRef.instance.getActive();He(t)&&(e.preventDefault(),e.stopPropagation(),this._selectResult(t)),this._closePopup()}}_openPopup(){this.isPopupOpen()||(this._inputValueBackup=this._elementRef.nativeElement.value,this._windowRef=this._popupService.open(),this._windowRef.instance.id=this.popupId,this._windowRef.instance.selectEvent.subscribe(e=>this._selectResultClosePopup(e)),this._windowRef.instance.activeChangeEvent.subscribe(e=>this.activeDescendant=e),"body"===this.container&&this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._changeDetector.markForCheck(),Et(this._ngZone,this._document,"outside",()=>this.dismissPopup(),this._closed$,[this._elementRef.nativeElement,this._windowRef.location.nativeElement]))}_closePopup(){this._closed$.next(),this._popupService.close(),this._windowRef=null,this.activeDescendant=null}_selectResult(e){let t=!1;this.selectItem.emit({item:e,preventDefault:()=>{t=!0}}),this._resubscribeTypeahead.next(null),t||(this.writeValue(e),this._onChange(e))}_selectResultClosePopup(e){this._selectResult(e),this._closePopup()}_showHint(){var e;if(this.showHint&&(null===(e=this._windowRef)||void 0===e?void 0:e.instance.hasActive())&&null!=this._inputValueBackup){const e=this._inputValueBackup.toLowerCase(),t=this._formatItemForInput(this._windowRef.instance.getActive());e===t.substr(0,this._inputValueBackup.length).toLowerCase()?(this._writeInputValue(this._inputValueBackup+t.substr(this._inputValueBackup.length)),this._elementRef.nativeElement.setSelectionRange.apply(this._elementRef.nativeElement,[this._inputValueBackup.length,t.length])):this._writeInputValue(t)}}_formatItemForInput(e){return null!=e&&this.inputFormatter?this.inputFormatter(e):je(e)}_writeInputValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",je(e))}_subscribeToUserInput(e){return e.subscribe(e=>{e&&0!==e.length?(this._openPopup(),this._windowRef.instance.focusFirst=this.focusFirst,this._windowRef.instance.results=e,this._windowRef.instance.term=this._elementRef.nativeElement.value,this.resultFormatter&&(this._windowRef.instance.formatter=this.resultFormatter),this.resultTemplate&&(this._windowRef.instance.resultTemplate=this.resultTemplate),this._windowRef.instance.resetActive(),this._windowRef.changeDetectorRef.detectChanges(),this._showHint()):this._closePopup();const t=e?e.length:0;this._live.say(0===t?"No results available":`${t} result${1===t?"":"s"} available`)})}_unsubscribeFromUserInput(){this._subscription&&this._subscription.unsubscribe(),this._subscription=null}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.n),r.Rb(r.S),r.Rb(r.H),r.Rb(r.v),r.Rb(r.k),r.Rb(ai),r.Rb(r.D),r.Rb(oi),r.Rb(s.d),r.Rb(r.D),r.Rb(r.i),r.Rb(r.g))},e.\u0275dir=r.Mb({type:e,selectors:[["input","ngbTypeahead",""]],hostAttrs:["autocapitalize","off","autocorrect","off","role","combobox","aria-multiline","false"],hostVars:7,hostBindings:function(e,t){1&e&&r.lc("blur",function(){return t.handleBlur()})("keydown",function(e){return t.handleKeyDown(e)}),2&e&&(r.ac("autocomplete",t.autocomplete),r.Eb("aria-autocomplete",t.showHint?"both":"list")("aria-activedescendant",t.activeDescendant)("aria-owns",t.isPopupOpen()?t.popupId:null)("aria-expanded",t.isPopupOpen()),r.Jb("open",t.isPopupOpen()))},inputs:{autocomplete:"autocomplete",placement:"placement",container:"container",editable:"editable",focusFirst:"focusFirst",showHint:"showHint",inputFormatter:"inputFormatter",ngbTypeahead:"ngbTypeahead",resultFormatter:"resultFormatter",resultTemplate:"resultTemplate"},outputs:{selectItem:"selectItem"},exportAs:["ngbTypeahead"],features:[r.Cb([ci])]}),e=Object(i.b)([Object(i.e)(8,Object(r.s)(s.d))],e),e})(),di=(()=>{let e=class{};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})();const hi=r.Zb(ct),fi=r.Zb(yt),pi=r.Zb(Nt),mi=r.Zb(zt),bi=r.Zb(Xn)},"G1/K":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t){return""===e?r.a.defaultTo(t,"n/a"):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"notAvailable",type:e,pure:!0}),e})()},G1I9:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o});var i=n("oxzT"),r=n("mtw6");class s{constructor(e=r.a.info,t,n,i,s="Ceph"){this.type=e,this.title=t,this.message=n,this.options=i,this.application=s,this.isFinishedTask=!1,this.classes={Ceph:"ceph-icon",Prometheus:"prometheus-icon"},this.applicationClass=this.classes[this.application]}}class o extends s{constructor(e=new s){super(e.type,e.title,e.message,e.options,e.application),this.config=e,this.textClasses=["text-danger","text-info","text-success"],this.iconClasses=[i.a.warning,i.a.info,i.a.check],this.borderClasses=["border-danger","border-info","border-success"],delete this.config,this.timestamp=(new Date).toJSON(),this.iconClass=this.iconClasses[this.type],this.textClass=this.textClasses[this.type],this.borderClass=this.borderClasses[this.type],this.isFinishedTask=e.isFinishedTask}}},G4mU:function(e,t,n){"use strict";var i=n("lkxz");t.a=function(e,t){var n=t?Object(i.a)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},"G6Q+":function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("SVse"),r=n("iInd"),s=n("PCNd"),o=n("8Y7J");let a=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.Pb({type:e}),e.\u0275inj=o.Ob({imports:[[i.c,s.a,r.i]]}),e})()},GS7A:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return r}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return a}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"j",function(){return o}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return m});class i{}class r{}const s="*";function o(e,t){return{type:7,name:e,definitions:t,options:{}}}function a(e,t=null){return{type:4,styles:t,timings:e}}function c(e,t=null){return{type:2,steps:e,options:t}}function l(e){return{type:6,styles:e,offset:null}}function u(e,t,n){return{type:0,name:e,styles:t,options:n}}function d(e,t,n=null){return{type:1,expr:e,animation:t,options:n}}function h(e){Promise.resolve(null).then(e)}class f{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){h(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}class p{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,n=0,i=0;const r=this.players.length;0==r?h(()=>this._onFinish()):this.players.forEach(e=>{e.onDone(()=>{++t==r&&this._onFinish()}),e.onDestroy(()=>{++n==r&&this._onDestroy()}),e.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((e,t)=>Math.max(e,t.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(e=>{const n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){const e=this.players.reduce((e,t)=>null===e||t.totalTime>e.totalTime?t:e,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}const m="!"},GarU:function(e,t,n){var i=n("2oRo"),r=n("OpvP"),s=i.TypeError;e.exports=function(e,t){if(r(t,e))return e;throw s("Incorrect invocation")}},GgAd:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("8Y7J"),r=n("G0yt"),s=n("SVse"),o=n("Fgil"),a=n("o4+5");function c(e,t){if(1&e&&(i.Xb(0,"table"),i.Xb(1,"tr"),i.Xb(2,"td",4),i.Rc(3,"Used:\xa0"),i.Wb(),i.Xb(4,"td",5),i.Xb(5,"strong"),i.Rc(6),i.oc(7,"dimlessBinary"),i.oc(8,"dimless"),i.Wb(),i.Wb(),i.Wb(),i.Xb(9,"tr"),i.Xb(10,"td",4),i.Rc(11,"Free:\xa0"),i.Wb(),i.Xb(12,"td",6),i.Xb(13,"strong"),i.Rc(14),i.oc(15,"dimlessBinary"),i.oc(16,"dimless"),i.Wb(),i.Wb(),i.Wb(),i.Wb()),2&e){const e=i.nc();i.Db(6),i.Tc(" ",e.isBinary?i.pc(7,2,e.used):i.pc(8,4,e.used),""),i.Db(8),i.Sc(e.isBinary?i.pc(15,6,e.total-e.used):i.pc(16,8,e.total-e.used))}}let l=(()=>{class e{constructor(){this.isBinary=!0,this.decimals=0}ngOnChanges(){this.usedPercentage=this.total>0?this.used/this.total*100:0,this.freePercentage=100-this.usedPercentage}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-usage-bar"]],inputs:{total:"total",used:"used",isBinary:"isBinary",decimals:"decimals"},features:[i.Bb],decls:8,vars:9,consts:[["usageTooltipTpl",""],["data-placement","left",1,"progress",3,"ngbTooltip"],["role","progressbar",1,"progress-bar","bg-info"],["role","progressbar",1,"progress-bar","bg-freespace"],[1,"text-left"],[1,"text-right"],[1,"'text-right"]],template:function(e,t){if(1&e&&(i.Pc(0,c,17,10,"ng-template",null,0,i.Qc),i.Xb(2,"div",1),i.Xb(3,"div",2),i.Xb(4,"span"),i.Rc(5),i.oc(6,"number"),i.Wb(),i.Wb(),i.Sb(7,"div",3),i.Wb()),2&e){const e=i.Fc(1);i.Db(2),i.uc("ngbTooltip",e),i.Db(1),i.Nc("width",t.usedPercentage+"%"),i.Db(2),i.Tc("",i.qc(6,6,t.usedPercentage,"1.0-"+t.decimals),"%"),i.Db(2),i.Nc("width",t.freePercentage+"%")}},directives:[r.D],pipes:[s.f,o.a,a.a],styles:[".bg-info[_ngcontent-%COMP%]{background-color:#2b99a8!important}.bg-freespace[_ngcontent-%COMP%]{background-color:#ced4da!important}.progress[_ngcontent-%COMP%]{height:20px;margin-bottom:0;position:relative}.progress[_ngcontent-%COMP%]   div.progress-bar[_ngcontent-%COMP%]{position:static}.progress[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{color:#000;display:block;font-weight:400;position:absolute;width:100%}"]}),e})()},Gi26:function(e,t,n){var i=n("4zBA"),r=n("ewvW"),s=i({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(r(e),t)}},GyhO:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("LRne"),r=n("bHdf");function s(...e){return Object(r.a)(1)(Object(i.a)(...e))}},H8ED:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443":"h"===n?t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d",hh:t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d",dd:"\u0434\u0437\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u0437\u0451\u043d",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u044b_\u043c\u0435\u0441\u044f\u0446\u0430\u045e",yy:"\u0433\u043e\u0434_\u0433\u0430\u0434\u044b_\u0433\u0430\u0434\u043e\u045e"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}e.defineLocale("be",{months:{format:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044f_\u043b\u044e\u0442\u0430\u0433\u0430_\u0441\u0430\u043a\u0430\u0432\u0456\u043a\u0430_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a\u0430_\u0442\u0440\u0430\u045e\u043d\u044f_\u0447\u044d\u0440\u0432\u0435\u043d\u044f_\u043b\u0456\u043f\u0435\u043d\u044f_\u0436\u043d\u0456\u045e\u043d\u044f_\u0432\u0435\u0440\u0430\u0441\u043d\u044f_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a\u0430_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430_\u0441\u043d\u0435\u0436\u043d\u044f".split("_"),standalone:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044c_\u043b\u044e\u0442\u044b_\u0441\u0430\u043a\u0430\u0432\u0456\u043a_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u044d\u0440\u0432\u0435\u043d\u044c_\u043b\u0456\u043f\u0435\u043d\u044c_\u0436\u043d\u0456\u0432\u0435\u043d\u044c_\u0432\u0435\u0440\u0430\u0441\u0435\u043d\u044c_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434_\u0441\u043d\u0435\u0436\u0430\u043d\u044c".split("_")},monthsShort:"\u0441\u0442\u0443\u0434_\u043b\u044e\u0442_\u0441\u0430\u043a_\u043a\u0440\u0430\u0441_\u0442\u0440\u0430\u0432_\u0447\u044d\u0440\u0432_\u043b\u0456\u043f_\u0436\u043d\u0456\u0432_\u0432\u0435\u0440_\u043a\u0430\u0441\u0442_\u043b\u0456\u0441\u0442_\u0441\u043d\u0435\u0436".split("_"),weekdays:{format:"\u043d\u044f\u0434\u0437\u0435\u043b\u044e_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0443_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0443_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),standalone:"\u043d\u044f\u0434\u0437\u0435\u043b\u044f_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0430_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0430_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),isFormat:/\[ ?[\u0423\u0443\u045e] ?(?:\u043c\u0456\u043d\u0443\u043b\u0443\u044e|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0443\u044e)? ?\] ?dddd/},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., HH:mm",LLLL:"dddd, D MMMM YYYY \u0433., HH:mm"},calendar:{sameDay:"[\u0421\u0451\u043d\u043d\u044f \u045e] LT",nextDay:"[\u0417\u0430\u045e\u0442\u0440\u0430 \u045e] LT",lastDay:"[\u0423\u0447\u043e\u0440\u0430 \u045e] LT",nextWeek:function(){return"[\u0423] dddd [\u045e] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u0443\u044e] dddd [\u045e] LT";case 1:case 2:case 4:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u044b] dddd [\u045e] LT"}},sameElse:"L"},relativeTime:{future:"\u043f\u0440\u0430\u0437 %s",past:"%s \u0442\u0430\u043c\u0443",s:"\u043d\u0435\u043a\u0430\u043b\u044c\u043a\u0456 \u0441\u0435\u043a\u0443\u043d\u0434",m:t,mm:t,h:t,hh:t,d:"\u0434\u0437\u0435\u043d\u044c",dd:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u044b|\u0440\u0430\u043d\u0456\u0446\u044b|\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u044b":e<12?"\u0440\u0430\u043d\u0456\u0446\u044b":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0430\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0456|\u044b|\u0433\u0430)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-\u044b":e+"-\u0456";case"D":return e+"-\u0433\u0430";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},HDdC:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("7o/Q"),r=n("2QA8"),s=n("gRHU"),o=n("kJWO"),a=n("mCNh"),c=n("2fFW");let l=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){const{operator:o}=this,a=function(e,t,n){if(e){if(e instanceof i.a)return e;if(e[r.a])return e[r.a]()}return e||t||n?new i.a(e,t,n):new i.a(s.a)}(e,t,n);if(a.add(o?o.call(a,this.source):this.source||c.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),c.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a}_trySubscribe(e){try{return this._subscribe(e)}catch(t){c.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof i.a?n:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=u(t))((t,n)=>{let i;i=this.subscribe(t=>{try{e(t)}catch(r){n(r),i&&i.unsubscribe()}},n,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[o.a](){return this}pipe(...e){return 0===e.length?this:Object(a.b)(e)(this)}toPromise(e){return new(e=u(e))((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}}return e.create=t=>new e(t),e})();function u(e){if(e||(e=c.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},HH4o:function(e,t,n){var i=n("tiKp")("iterator"),r=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){r=!0}};o[i]=function(){return this},Array.from(o,function(){throw 2})}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var s={};s[i]=function(){return{next:function(){return{done:n=!0}}}},e(s)}catch(a){}return n}},HP3h:function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},r=function(e){return function(t,r,s,o){var a=n(t),c=i[e][n(t)];return 2===a&&(c=c[r?0:1]),c.replace(/%d/i,t)}},s=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},HYAF:function(e,t,n){var i=n("2oRo").TypeError;e.exports=function(e){if(null==e)throw i("Can't call method on "+e);return e}},Hd5f:function(e,t,n){var i=n("0Dky"),r=n("tiKp"),s=n("LQDL"),o=r("species");e.exports=function(e){return s>=51||!i(function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},Hicy:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a});var i=n("8Y7J"),r=n("SVse"),s=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=function(){function e(e,t,n){this._el=e,this._ngZone=t,this.platformId=n,this.clickOutsideEnabled=!0,this.attachOutsideOnClick=!1,this.delayClickOutsideInit=!1,this.emitOnBlur=!1,this.exclude="",this.excludeBeforeClick=!1,this.clickOutsideEvents="",this.clickOutside=new i.p,this._nodesExcluded=[],this._events=["click"],this._initOnClickBody=this._initOnClickBody.bind(this),this._onClickBody=this._onClickBody.bind(this),this._onWindowBlur=this._onWindowBlur.bind(this)}return e.prototype.ngOnInit=function(){Object(r.I)(this.platformId)&&this._init()},e.prototype.ngOnDestroy=function(){Object(r.I)(this.platformId)&&(this._removeClickOutsideListener(),this._removeAttachOutsideOnClickListener(),this._removeWindowBlurListener())},e.prototype.ngOnChanges=function(e){Object(r.I)(this.platformId)&&(e.attachOutsideOnClick||e.exclude||e.emitOnBlur)&&this._init()},e.prototype._init=function(){""!==this.clickOutsideEvents&&(this._events=this.clickOutsideEvents.split(",").map(function(e){return e.trim()})),this._excludeCheck(),this.attachOutsideOnClick?this._initAttachOutsideOnClickListener():this._initOnClickBody(),this.emitOnBlur&&this._initWindowBlurListener()},e.prototype._initOnClickBody=function(){this.delayClickOutsideInit?setTimeout(this._initClickOutsideListener.bind(this)):this._initClickOutsideListener()},e.prototype._excludeCheck=function(){if(this.exclude)try{var e=Array.from(document.querySelectorAll(this.exclude));e&&(this._nodesExcluded=e)}catch(t){console.error("[ng-click-outside] Check your exclude selector syntax.",t)}},e.prototype._onClickBody=function(e){this.clickOutsideEnabled&&(this.excludeBeforeClick&&this._excludeCheck(),this._el.nativeElement.contains(e.target)||this._shouldExclude(e.target)||(this._emit(e),this.attachOutsideOnClick&&this._removeClickOutsideListener()))},e.prototype._onWindowBlur=function(e){var t=this;setTimeout(function(){document.hidden||t._emit(e)})},e.prototype._emit=function(e){var t=this;this.clickOutsideEnabled&&this._ngZone.run(function(){return t.clickOutside.emit(e)})},e.prototype._shouldExclude=function(e){for(var t=0,n=this._nodesExcluded;t<n.length;t++)if(n[t].contains(e))return!0;return!1},e.prototype._initClickOutsideListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){e._events.forEach(function(t){return document.addEventListener(t,e._onClickBody)})})},e.prototype._removeClickOutsideListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){e._events.forEach(function(t){return document.removeEventListener(t,e._onClickBody)})})},e.prototype._initAttachOutsideOnClickListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){e._events.forEach(function(t){return e._el.nativeElement.addEventListener(t,e._initOnClickBody)})})},e.prototype._removeAttachOutsideOnClickListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){e._events.forEach(function(t){return e._el.nativeElement.removeEventListener(t,e._initOnClickBody)})})},e.prototype._initWindowBlurListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){window.addEventListener("blur",e._onWindowBlur)})},e.prototype._removeWindowBlurListener=function(){var e=this;this._ngZone.runOutsideAngular(function(){window.removeEventListener("blur",e._onWindowBlur)})},(e=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}([(2,t=Object(i.s)(i.F),function(e,n){t(e,n,2)}),s("design:paramtypes",[i.n,i.D,Object])],e)).\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.D),i.Rb(i.F))},e.\u0275dir=i.Mb({type:e,selectors:[["","clickOutside",""]],inputs:{clickOutsideEnabled:"clickOutsideEnabled",attachOutsideOnClick:"attachOutsideOnClick",delayClickOutsideInit:"delayClickOutsideInit",emitOnBlur:"emitOnBlur",exclude:"exclude",excludeBeforeClick:"excludeBeforeClick",clickOutsideEvents:"clickOutsideEvents"},outputs:{clickOutside:"clickOutside"},features:[i.Bb]}),e.\u0275prov=i.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e;var t}(),a=function(){function e(){}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({}),e}()},"I+eb":function(e,t,n){var i=n("2oRo"),r=n("Bs8V").f,s=n("kRJp"),o=n("busE"),a=n("zk60"),c=n("6JNq"),l=n("lMq5");e.exports=function(e,t){var n,u,d,h,f,p=e.target,m=e.global,b=e.stat;if(n=m?i:b?i[p]||a(p,{}):(i[p]||{}).prototype)for(u in t){if(h=t[u],d=e.noTargetGet?(f=r(n,u))&&f.value:n[u],!l(m?u:p+(b?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&s(h,"sham",!0),o(n,u,h,e)}}},I55L:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=e=>e&&"number"==typeof e.length&&"function"!=typeof e},I8vh:function(e,t,n){var i=n("WSbT"),r=Math.max,s=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):s(n,t)}},IBtZ:function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8_\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8_\u10db\u10d0\u10e0\u10e2\u10d8_\u10d0\u10de\u10e0\u10d8\u10da\u10d8_\u10db\u10d0\u10d8\u10e1\u10d8_\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8_\u10d8\u10d5\u10da\u10d8\u10e1\u10d8_\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd_\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8_\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8".split("_"),monthsShort:"\u10d8\u10d0\u10dc_\u10d7\u10d4\u10d1_\u10db\u10d0\u10e0_\u10d0\u10de\u10e0_\u10db\u10d0\u10d8_\u10d8\u10d5\u10dc_\u10d8\u10d5\u10da_\u10d0\u10d2\u10d5_\u10e1\u10d4\u10e5_\u10dd\u10e5\u10e2_\u10dc\u10dd\u10d4_\u10d3\u10d4\u10d9".split("_"),weekdays:{standalone:"\u10d9\u10d5\u10d8\u10e0\u10d0_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8_\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8".split("_"),format:"\u10d9\u10d5\u10d8\u10e0\u10d0\u10e1_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10e1_\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1".split("_"),isFormat:/(\u10ec\u10d8\u10dc\u10d0|\u10e8\u10d4\u10db\u10d3\u10d4\u10d2)/},weekdaysShort:"\u10d9\u10d5\u10d8_\u10dd\u10e0\u10e8_\u10e1\u10d0\u10db_\u10dd\u10d7\u10ee_\u10ee\u10e3\u10d7_\u10de\u10d0\u10e0_\u10e8\u10d0\u10d1".split("_"),weekdaysMin:"\u10d9\u10d5_\u10dd\u10e0_\u10e1\u10d0_\u10dd\u10d7_\u10ee\u10e3_\u10de\u10d0_\u10e8\u10d0".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u10d3\u10e6\u10d4\u10e1] LT[-\u10d6\u10d4]",nextDay:"[\u10ee\u10d5\u10d0\u10da] LT[-\u10d6\u10d4]",lastDay:"[\u10d2\u10e3\u10e8\u10d8\u10dc] LT[-\u10d6\u10d4]",nextWeek:"[\u10e8\u10d4\u10db\u10d3\u10d4\u10d2] dddd LT[-\u10d6\u10d4]",lastWeek:"[\u10ec\u10d8\u10dc\u10d0] dddd LT-\u10d6\u10d4",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(\u10ec\u10d0\u10db|\u10ec\u10e3\u10d7|\u10e1\u10d0\u10d0\u10d7|\u10ec\u10d4\u10da|\u10d3\u10e6|\u10d7\u10d5)(\u10d8|\u10d4)/,function(e,t,n){return"\u10d8"===n?t+"\u10e8\u10d8":t+n+"\u10e8\u10d8"})},past:function(e){return/(\u10ec\u10d0\u10db\u10d8|\u10ec\u10e3\u10d7\u10d8|\u10e1\u10d0\u10d0\u10d7\u10d8|\u10d3\u10e6\u10d4|\u10d7\u10d5\u10d4)/.test(e)?e.replace(/(\u10d8|\u10d4)$/,"\u10d8\u10e1 \u10ec\u10d8\u10dc"):/\u10ec\u10d4\u10da\u10d8/.test(e)?e.replace(/\u10ec\u10d4\u10da\u10d8$/,"\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc"):e},s:"\u10e0\u10d0\u10db\u10d3\u10d4\u10dc\u10d8\u10db\u10d4 \u10ec\u10d0\u10db\u10d8",ss:"%d \u10ec\u10d0\u10db\u10d8",m:"\u10ec\u10e3\u10d7\u10d8",mm:"%d \u10ec\u10e3\u10d7\u10d8",h:"\u10e1\u10d0\u10d0\u10d7\u10d8",hh:"%d \u10e1\u10d0\u10d0\u10d7\u10d8",d:"\u10d3\u10e6\u10d4",dd:"%d \u10d3\u10e6\u10d4",M:"\u10d7\u10d5\u10d4",MM:"%d \u10d7\u10d5\u10d4",y:"\u10ec\u10d4\u10da\u10d8",yy:"%d \u10ec\u10d4\u10da\u10d8"},dayOfMonthOrdinalParse:/0|1-\u10da\u10d8|\u10db\u10d4-\d{1,2}|\d{1,2}-\u10d4/,ordinal:function(e){return 0===e?e:1===e?e+"-\u10da\u10d8":e<20||e<=100&&e%20==0||e%100==0?"\u10db\u10d4-"+e:e+"-\u10d4"},week:{dow:1,doy:7}})}(n("wd/R"))},IZUe:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{constructor(e){this.elementRef=e,this.focus=!0}ngAfterViewInit(){const e=this.elementRef.nativeElement;this.focus&&r.a.isFunction(e.focus)&&e.focus()}set autofocus(e){r.a.isBoolean(e)?this.focus=e:r.a.isFunction(e)&&(this.focus=e())}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(s.n))},e.\u0275dir=s.Mb({type:e,selectors:[["","autofocus",""]],inputs:{autofocus:"autofocus"}}),e})()},Iab2:function(e,t,n){var i,r;void 0===(r="function"==typeof(i=function(){"use strict";function t(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){s(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,s=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(e,s,o){var a=r.URL||r.webkitURL,c=document.createElement("a");c.download=s=s||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?i(c):n(c.href)?t(e,s,o):i(c,c.target="_blank")):(c.href=a.createObjectURL(e),setTimeout(function(){a.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,s){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,s),r);else if(n(e))t(e,r,s);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){i(o)})}}:function(e,n,i,s){if((s=s||open("","_blank"))&&(s.document.title=s.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,i);var o="application/octet-stream"===e.type,a=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&a)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=e:location=e,s=null},l.readAsDataURL(e)}else{var u=r.URL||r.webkitURL,d=u.createObjectURL(e);s?s.location=d:location.href=d,s=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});r.saveAs=s.saveAs=s,e.exports=s})?i.apply(t,[]):i)||(e.exports=r)},IheW:function(e,t,n){"use strict";n.d(t,"a",function(){return C}),n.d(t,"b",function(){return T}),n.d(t,"c",function(){return z}),n.d(t,"d",function(){return x}),n.d(t,"e",function(){return m});var i=n("8Y7J"),r=n("LRne"),s=n("HDdC"),o=n("bOdf"),a=n("pLZG"),c=n("lJxs"),l=n("SVse");class u{}class d{}class h{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const n=e.slice(0,t),i=n.toLowerCase(),r=e.slice(t+1).trim();this.maybeSetNormalizedName(n,i),this.headers.has(i)?this.headers.get(i).push(r):this.headers.set(i,[r])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let n=e[t];const i=t.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(i,n),this.maybeSetNormalizedName(t,i))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof h?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new h;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof h?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...n),this.headers.set(t,i);break;case"d":const r=e.value;if(r){let e=this.headers.get(t);if(!e)return;e=e.filter(e=>-1===r.indexOf(e)),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class f{encodeKey(e){return p(e)}encodeValue(e){return p(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function p(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class m{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new f,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const n=new Map;return e.length>0&&e.replace(/^\?/,"").split("&").forEach(e=>{const i=e.indexOf("="),[r,s]=-1==i?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,i)),t.decodeValue(e.slice(i+1))],o=n.get(r)||[];o.push(s),n.set(r,o)}),n}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const n=e.fromObject[t];this.map.set(t,Array.isArray(n)?n:[n])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(n=>{const i=e[n];Array.isArray(i)?i.forEach(e=>{t.push({param:n,value:e,op:"a"})}):t.push({param:n,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new m({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const n=t.indexOf(e.value);-1!==n&&t.splice(n,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function b(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function g(e){return"undefined"!=typeof Blob&&e instanceof Blob}function _(e){return"undefined"!=typeof FormData&&e instanceof FormData}class v{constructor(e,t,n,i){let r;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==n?n:null,r=i):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new h),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const n=t.indexOf("?");this.urlWithParams=t+(-1===n?"?":n<t.length-1?"&":"")+e}}else this.params=new m,this.urlWithParams=t}serializeBody(){return null===this.body?null:b(this.body)||g(this.body)||_(this.body)||"string"==typeof this.body?this.body:this.body instanceof m?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||_(this.body)?null:g(this.body)?this.body.type||null:b(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof m?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(e={}){const t=e.method||this.method,n=e.url||this.url,i=e.responseType||this.responseType,r=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,o=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let a=e.headers||this.headers,c=e.params||this.params;return void 0!==e.setHeaders&&(a=Object.keys(e.setHeaders).reduce((t,n)=>t.set(n,e.setHeaders[n]),a)),e.setParams&&(c=Object.keys(e.setParams).reduce((t,n)=>t.set(n,e.setParams[n]),c)),new v(t,n,r,{params:c,headers:a,reportProgress:o,responseType:i,withCredentials:s})}}var y=function(e){return e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User",e}({});class w{constructor(e,t=200,n="OK"){this.headers=e.headers||new h,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||n,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class D extends w{constructor(e={}){super(e),this.type=y.ResponseHeader}clone(e={}){return new D({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class S extends w{constructor(e={}){super(e),this.type=y.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new S({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class x extends w{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function k(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let T=(()=>{class e{constructor(e){this.handler=e}request(e,t,n={}){let i;if(e instanceof v)i=e;else{let r,s;r=n.headers instanceof h?n.headers:new h(n.headers),n.params&&(s=n.params instanceof m?n.params:new m({fromObject:n.params})),i=new v(e,t,void 0!==n.body?n.body:null,{headers:r,params:s,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const s=Object(r.a)(i).pipe(Object(o.a)(e=>this.handler.handle(e)));if(e instanceof v||"events"===n.observe)return s;const l=s.pipe(Object(a.a)(e=>e instanceof S));switch(n.observe||"body"){case"body":switch(i.responseType){case"arraybuffer":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return l.pipe(Object(c.a)(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return l.pipe(Object(c.a)(e=>e.body))}case"response":return l;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new m).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,n={}){return this.request("PATCH",e,k(n,t))}post(e,t,n={}){return this.request("POST",e,k(n,t))}put(e,t,n={}){return this.request("PUT",e,k(n,t))}}return e.\u0275fac=function(t){return new(t||e)(i.ic(u))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})();class M{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const C=new i.u("HTTP_INTERCEPTORS");let O=(()=>{class e{intercept(e,t){return t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})();const L=/^\)\]\}',?\n/;class E{}let A=(()=>{class e{constructor(){}build(){return new XMLHttpRequest}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),I=(()=>{class e{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new s.a(t=>{const n=this.xhrFactory.build();if(n.open(e.method,e.urlWithParams),e.withCredentials&&(n.withCredentials=!0),e.headers.forEach((e,t)=>n.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&n.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();n.responseType="json"!==t?t:"text"}const i=e.serializeBody();let r=null;const s=()=>{if(null!==r)return r;const t=1223===n.status?204:n.status,i=n.statusText||"OK",s=new h(n.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(n)||e.url;return r=new D({headers:s,status:t,statusText:i,url:o}),r},o=()=>{let{headers:i,status:r,statusText:o,url:a}=s(),c=null;204!==r&&(c=void 0===n.response?n.responseText:n.response),0===r&&(r=c?200:0);let l=r>=200&&r<300;if("json"===e.responseType&&"string"==typeof c){const e=c;c=c.replace(L,"");try{c=""!==c?JSON.parse(c):null}catch(u){c=e,l&&(l=!1,c={error:u,text:c})}}l?(t.next(new S({body:c,headers:i,status:r,statusText:o,url:a||void 0})),t.complete()):t.error(new x({error:c,headers:i,status:r,statusText:o,url:a||void 0}))},a=e=>{const{url:i}=s(),r=new x({error:e,status:n.status||0,statusText:n.statusText||"Unknown Error",url:i||void 0});t.error(r)};let c=!1;const l=i=>{c||(t.next(s()),c=!0);let r={type:y.DownloadProgress,loaded:i.loaded};i.lengthComputable&&(r.total=i.total),"text"===e.responseType&&n.responseText&&(r.partialText=n.responseText),t.next(r)},u=e=>{let n={type:y.UploadProgress,loaded:e.loaded};e.lengthComputable&&(n.total=e.total),t.next(n)};return n.addEventListener("load",o),n.addEventListener("error",a),n.addEventListener("timeout",a),n.addEventListener("abort",a),e.reportProgress&&(n.addEventListener("progress",l),null!==i&&n.upload&&n.upload.addEventListener("progress",u)),n.send(i),t.next({type:y.Sent}),()=>{n.removeEventListener("error",a),n.removeEventListener("abort",a),n.removeEventListener("load",o),n.removeEventListener("timeout",a),e.reportProgress&&(n.removeEventListener("progress",l),null!==i&&n.upload&&n.upload.removeEventListener("progress",u)),n.readyState!==n.DONE&&n.abort()}})}}return e.\u0275fac=function(t){return new(t||e)(i.ic(E))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})();const R=new i.u("XSRF_COOKIE_NAME"),P=new i.u("XSRF_HEADER_NAME");class F{}let W=(()=>{class e{constructor(e,t,n){this.doc=e,this.platform=t,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Object(l.M)(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return e.\u0275fac=function(t){return new(t||e)(i.ic(l.d),i.ic(i.F),i.ic(R))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),j=(()=>{class e{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const n=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||n.startsWith("http://")||n.startsWith("https://"))return t.handle(e);const i=this.tokenService.getToken();return null===i||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,i)})),t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(i.ic(F),i.ic(P))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),Y=(()=>{class e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(C,[]);this.chain=e.reduceRight((e,t)=>new M(e,t),this.backend)}return this.chain.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(i.ic(d),i.ic(i.v))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),N=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:j,useClass:O}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:R,useValue:t.cookieName}:[],t.headerName?{provide:P,useValue:t.headerName}:[]]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({providers:[j,{provide:C,useExisting:j,multi:!0},{provide:F,useClass:W},{provide:R,useValue:"XSRF-TOKEN"},{provide:P,useValue:"X-XSRF-TOKEN"}]}),e})(),z=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({providers:[T,{provide:u,useClass:Y},I,{provide:d,useExisting:I},A,{provide:E,useExisting:A}],imports:[[N.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e})()},IjjT:function(e,t,n){"use strict";n.d(t,"a",function(){return r});let i=(()=>{class e{constructor(t,n=e.now){this.SchedulerAction=t,this.now=n}schedule(e,t=0,n){return new this.SchedulerAction(this,e).schedule(n,t)}}return e.now=()=>Date.now(),e})();class r extends i{constructor(e,t=i.now){super(e,()=>r.delegate&&r.delegate!==this?r.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,n){return r.delegate&&r.delegate!==this?r.delegate.schedule(e,t,n):super.schedule(e,t,n)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}},ImZN:function(e,t,n){var i=n("2oRo"),r=n("A2ZE"),s=n("xluM"),o=n("glrk"),a=n("DVFp"),c=n("6VoE"),l=n("B/qT"),u=n("OpvP"),d=n("mh/w"),h=n("NaFW"),f=n("KmKo"),p=i.TypeError,m=function(e,t){this.stopped=e,this.result=t},b=m.prototype;e.exports=function(e,t,n){var i,g,_,v,y,w,D,S=!(!n||!n.AS_ENTRIES),x=!(!n||!n.IS_ITERATOR),k=!(!n||!n.INTERRUPTED),T=r(t,n&&n.that),M=function(e){return i&&f(i,"normal",e),new m(!0,e)},C=function(e){return S?(o(e),k?T(e[0],e[1],M):T(e[0],e[1])):k?T(e,M):T(e)};if(x)i=e;else{if(!(g=h(e)))throw p(a(e)+" is not iterable");if(c(g)){for(_=0,v=l(e);v>_;_++)if((y=C(e[_]))&&u(b,y))return y;return new m(!1)}i=d(e,g)}for(w=i.next;!(D=s(w,i)).done;){try{y=C(D.value)}catch(O){f(i,"throw",O)}if("object"==typeof y&&y&&u(b,y))return y}return new m(!1)}},"Ivi+":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),monthsShort:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),weekdays:"\uc77c\uc694\uc77c_\uc6d4\uc694\uc77c_\ud654\uc694\uc77c_\uc218\uc694\uc77c_\ubaa9\uc694\uc77c_\uae08\uc694\uc77c_\ud1a0\uc694\uc77c".split("_"),weekdaysShort:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),weekdaysMin:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY\ub144 MMMM D\uc77c",LLL:"YYYY\ub144 MMMM D\uc77c A h:mm",LLLL:"YYYY\ub144 MMMM D\uc77c dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY\ub144 MMMM D\uc77c",lll:"YYYY\ub144 MMMM D\uc77c A h:mm",llll:"YYYY\ub144 MMMM D\uc77c dddd A h:mm"},calendar:{sameDay:"\uc624\ub298 LT",nextDay:"\ub0b4\uc77c LT",nextWeek:"dddd LT",lastDay:"\uc5b4\uc81c LT",lastWeek:"\uc9c0\ub09c\uc8fc dddd LT",sameElse:"L"},relativeTime:{future:"%s \ud6c4",past:"%s \uc804",s:"\uba87 \ucd08",ss:"%d\ucd08",m:"1\ubd84",mm:"%d\ubd84",h:"\ud55c \uc2dc\uac04",hh:"%d\uc2dc\uac04",d:"\ud558\ub8e8",dd:"%d\uc77c",M:"\ud55c \ub2ec",MM:"%d\ub2ec",y:"\uc77c \ub144",yy:"%d\ub144"},dayOfMonthOrdinalParse:/\d{1,2}(\uc77c|\uc6d4|\uc8fc)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\uc77c";case"M":return e+"\uc6d4";case"w":case"W":return e+"\uc8fc";default:return e}},meridiemParse:/\uc624\uc804|\uc624\ud6c4/,isPM:function(e){return"\uc624\ud6c4"===e},meridiem:function(e,t,n){return e<12?"\uc624\uc804":"\uc624\ud6c4"}})}(n("wd/R"))},IzCI:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1024,["B/s","kB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"])}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(i.a))},e.\u0275pipe=r.Qb({name:"dimlessBinaryPerSecond",type:e,pure:!0}),e})()},IzEk:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("7o/Q"),r=n("4I5i"),s=n("EY2u");function o(e){return t=>0===e?Object(s.b)():t.lift(new a(e))}class a{constructor(e){if(this.total=e,this.total<0)throw new r.a}call(e,t){return t.subscribe(new c(e,this.total))}}class c extends i.a{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}},IzLi:function(e,t,n){"use strict";t.a=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},JBy8:function(e,t,n){var i=n("yoRg"),r=n("eDl+").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},"JCF/":function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},i=["\u06a9\u0627\u0646\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0634\u0648\u0628\u0627\u062a","\u0626\u0627\u0632\u0627\u0631","\u0646\u06cc\u0633\u0627\u0646","\u0626\u0627\u06cc\u0627\u0631","\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646","\u062a\u06d5\u0645\u0645\u0648\u0632","\u0626\u0627\u0628","\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644","\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u0643\u06d5\u0645","\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0643\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"];e.defineLocale("ku",{months:i,monthsShort:i,weekdays:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u062f\u0648\u0648\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0633\u06ce\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysShort:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645_\u062f\u0648\u0648\u0634\u0647\u200c\u0645_\u0633\u06ce\u0634\u0647\u200c\u0645_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u0647_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c|\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc/,isPM:function(e){return/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c/.test(e)},meridiem:function(e,t,n){return e<12?"\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc":"\u0626\u06ce\u0648\u0627\u0631\u0647\u200c"},calendar:{sameDay:"[\u0626\u0647\u200c\u0645\u0631\u06c6 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextDay:"[\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastDay:"[\u062f\u0648\u06ce\u0646\u06ce \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",sameElse:"L"},relativeTime:{future:"\u0644\u0647\u200c %s",past:"%s",s:"\u0686\u0647\u200c\u0646\u062f \u0686\u0631\u0643\u0647\u200c\u06cc\u0647\u200c\u0643",ss:"\u0686\u0631\u0643\u0647\u200c %d",m:"\u06cc\u0647\u200c\u0643 \u062e\u0648\u0644\u0647\u200c\u0643",mm:"%d \u062e\u0648\u0644\u0647\u200c\u0643",h:"\u06cc\u0647\u200c\u0643 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",hh:"%d \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",d:"\u06cc\u0647\u200c\u0643 \u0695\u06c6\u0698",dd:"%d \u0695\u06c6\u0698",M:"\u06cc\u0647\u200c\u0643 \u0645\u0627\u0646\u06af",MM:"%d \u0645\u0627\u0646\u06af",y:"\u06cc\u0647\u200c\u0643 \u0633\u0627\u06b5",yy:"%d \u0633\u0627\u06b5"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,function(e){return n[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},JIr8:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("zx2A");function r(e){return function(t){const n=new s(e),i=t.lift(n);return n.caught=i}}class s{constructor(e){this.selector=e}call(e,t){return t.subscribe(new o(e,this.selector,this.caught))}}class o extends i.b{constructor(e,t,n){super(e),this.selector=t,this.caught=n}error(e){if(!this.isStopped){let n;try{n=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const r=new i.a(this);this.add(r);const s=Object(i.c)(n,r);s!==r&&this.add(s)}}}},"JK/P":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("G0yt");let s=(()=>{class e{constructor(e){this.modal=e}show(e,t,n){const i=this.modal.open(e,n);return t&&Object.assign(i.componentInstance,t),i}dismissAll(){this.modal.dismissAll()}hasOpenModals(){return this.modal.hasOpenModals()}}return e.\u0275fac=function(t){return new(t||e)(i.ic(r.o))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},JP8w:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("G0yt");let s=(()=>{class e{constructor(e){this.nav=e,this.localStorage=window.localStorage}ngOnInit(){const e=this.localStorage.getItem(`tabset_${this.cdStatefulTab}`);e&&this.nav.select(e)}onNavChange(e){this.cdStatefulTab&&e.nextId&&this.localStorage.setItem(`tabset_${this.cdStatefulTab}`,e.nextId)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(r.p,9))},e.\u0275dir=i.Mb({type:e,selectors:[["","cdStatefulTab",""]],hostBindings:function(e,t){1&e&&i.lc("navChange",function(e){return t.onNavChange(e)})},inputs:{cdStatefulTab:"cdStatefulTab"}}),e})()},JVSJ:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=e+" ";switch(n){case"ss":return i+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return i+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return i+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return i+(1===e?"dan":"dana");case"MM":return i+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return i+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[pro\u0161lu] dddd [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},JX91:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("GyhO"),r=n("z+Ro");function s(...e){const t=e[e.length-1];return Object(r.a)(t)?(e.pop(),n=>Object(i.a)(e,n,t)):t=>Object(i.a)(e,t)}},Js68:function(e,t,n){"use strict";t.a=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},"Ju5/":function(e,t,n){"use strict";var i=n("XqMk"),r="object"==typeof self&&self&&self.Object===Object&&self,s=i.a||r||Function("return this")();t.a=s},JvlW:function(e,t,n){!function(e){"use strict";var t={ss:"sekund\u0117_sekund\u017ei\u0173_sekundes",m:"minut\u0117_minut\u0117s_minut\u0119",mm:"minut\u0117s_minu\u010di\u0173_minutes",h:"valanda_valandos_valand\u0105",hh:"valandos_valand\u0173_valandas",d:"diena_dienos_dien\u0105",dd:"dienos_dien\u0173_dienas",M:"m\u0117nuo_m\u0117nesio_m\u0117nes\u012f",MM:"m\u0117nesiai_m\u0117nesi\u0173_m\u0117nesius",y:"metai_met\u0173_metus",yy:"metai_met\u0173_metus"};function n(e,t,n,i){return t?r(n)[0]:i?r(n)[1]:r(n)[2]}function i(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,o){var a=e+" ";return 1===e?a+n(0,t,s[0],o):t?a+(i(e)?r(s)[1]:r(s)[0]):o?a+r(s)[1]:a+(i(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_baland\u017eio_gegu\u017e\u0117s_bir\u017eelio_liepos_rugpj\u016b\u010dio_rugs\u0117jo_spalio_lapkri\u010dio_gruod\u017eio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegu\u017e\u0117_bir\u017eelis_liepa_rugpj\u016btis_rugs\u0117jis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadien\u012f_pirmadien\u012f_antradien\u012f_tre\u010diadien\u012f_ketvirtadien\u012f_penktadien\u012f_\u0161e\u0161tadien\u012f".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_tre\u010diadienis_ketvirtadienis_penktadienis_\u0161e\u0161tadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_\u0160e\u0161".split("_"),weekdaysMin:"S_P_A_T_K_Pn_\u0160".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[\u0160iandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Pra\u0117jus\u012f] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prie\u0161 %s",s:function(e,t,n,i){return t?"kelios sekund\u0117s":i?"keli\u0173 sekund\u017ei\u0173":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("wd/R"))},"K/tc":function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},K6Rb:function(e,t){var n=Function.prototype,i=n.apply,r=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n.bind?r.bind(i):function(){return r.apply(i,arguments)})},KSF8:function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"th\xe1ng 1_th\xe1ng 2_th\xe1ng 3_th\xe1ng 4_th\xe1ng 5_th\xe1ng 6_th\xe1ng 7_th\xe1ng 8_th\xe1ng 9_th\xe1ng 10_th\xe1ng 11_th\xe1ng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"ch\u1ee7 nh\u1eadt_th\u1ee9 hai_th\u1ee9 ba_th\u1ee9 t\u01b0_th\u1ee9 n\u0103m_th\u1ee9 s\xe1u_th\u1ee9 b\u1ea3y".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [n\u0103m] YYYY",LLL:"D MMMM [n\u0103m] YYYY HH:mm",LLLL:"dddd, D MMMM [n\u0103m] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[H\xf4m nay l\xfac] LT",nextDay:"[Ng\xe0y mai l\xfac] LT",nextWeek:"dddd [tu\u1ea7n t\u1edbi l\xfac] LT",lastDay:"[H\xf4m qua l\xfac] LT",lastWeek:"dddd [tu\u1ea7n tr\u01b0\u1edbc l\xfac] LT",sameElse:"L"},relativeTime:{future:"%s t\u1edbi",past:"%s tr\u01b0\u1edbc",s:"v\xe0i gi\xe2y",ss:"%d gi\xe2y",m:"m\u1ed9t ph\xfat",mm:"%d ph\xfat",h:"m\u1ed9t gi\u1edd",hh:"%d gi\u1edd",d:"m\u1ed9t ng\xe0y",dd:"%d ng\xe0y",w:"m\u1ed9t tu\u1ea7n",ww:"%d tu\u1ea7n",M:"m\u1ed9t th\xe1ng",MM:"%d th\xe1ng",y:"m\u1ed9t n\u0103m",yy:"%d n\u0103m"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},KTz0:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedjelje] [u] LT","[pro\u0161log] [ponedjeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srijede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},KmKo:function(e,t,n){var i=n("xluM"),r=n("glrk"),s=n("3Eq5");e.exports=function(e,t,n){var o,a;r(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw n;return n}o=i(o,e)}catch(c){a=!0,o=c}if("throw"===t)throw n;if(a)throw o;return r(o),n}},Kqap:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e,t){let n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new s(e,t,n))}}class s{constructor(e,t,n=!1){this.accumulator=e,this.seed=t,this.hasSeed=n}call(e,t){return t.subscribe(new o(e,this.accumulator,this.seed,this.hasSeed))}}class o extends i.a{constructor(e,t,n,i){super(e),this.accumulator=t,this._seed=n,this.hasSeed=i,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let n;try{n=this.accumulator(this.seed,e,t)}catch(i){this.destination.error(i)}this.seed=n,this.destination.next(n)}}},KqfI:function(e,t,n){"use strict";function i(){}n.d(t,"a",function(){return i})},L3Qv:function(e,t,n){"use strict";t.a=function(){return!1}},LQDL:function(e,t,n){var i,r,s=n("2oRo"),o=n("NC/Y"),a=s.process,c=s.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(r=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(r=+i[1]),e.exports=r},LRne:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("z+Ro"),r=n("yCtX"),s=n("jZKg");function o(...e){let t=e[e.length-1];return Object(i.a)(t)?(e.pop(),Object(s.a)(e,t)):Object(r.a)(e)}},LceX:function(e,t,n){"use strict";n.r(t),n.d(t,"AuthModule",function(){return Je}),n.d(t,"RoutedAuthModule",function(){return Qe});var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("zWsK"),c=n("sne2"),l=n("PCNd"),u=n("LvDl"),d=n.n(u),h=n("cp0P"),f=n("LRne"),p=n("5+tZ"),m=n("8Y7J"),b=n("IheW");let g=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("api/role")}delete(e){return this.http.delete(`api/role/${e}`)}get(e){return this.http.get(`api/role/${e}`)}create(e){return this.http.post("api/role",e)}clone(e,t){return this.http.post(`api/role/${e}/clone`,{new_name:t})}update(e){return this.http.put(`api/role/${e.name}`,e)}exists(e){return this.list().pipe(Object(p.a)(t=>{const n=t.some(t=>t.name===e);return Object(f.a)(n)}))}}return e.\u0275fac=function(t){return new(t||e)(m.ic(b.b))},e.\u0275prov=m.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),_=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("ui-api/scope")}}return e.\u0275fac=function(t){return new(t||e)(m.ic(b.b))},e.\u0275prov=m.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var v=n("mtw6"),y=n("spCT"),w=n("QFaf"),D=n("1Ni5"),S=n("9nlD"),x=function(e){return e.editing="editing",e}({});class k{}var T=n("zc8c"),M=n("NwgZ"),C=n("ocLN"),O=n("ANnk"),L=n("f69J"),E=n("IZUe"),A=n("uIqm"),I=n("6+kj"),R=n("8xTl");const P=["headerPermissionCheckboxTpl"],F=["cellScopeCheckboxTpl"],W=["cellPermissionCheckboxTpl"];function j(e,t){1&e&&(m.Xb(0,"span",25),m.bc(1,26),m.Wb())}function Y(e,t){1&e&&(m.Xb(0,"span",25),m.bc(1,27),m.Wb())}const N=function(e){return{required:e}};function z(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",4),m.Xb(1,"form",5,6),m.Xb(3,"div",7),m.Xb(4,"div",8),m.bc(5,9),m.oc(6,"titlecase"),m.oc(7,"upperFirst"),m.Wb(),m.Xb(8,"div",10),m.Xb(9,"div",11),m.Xb(10,"label",12),m.bc(11,13),m.Wb(),m.Xb(12,"div",14),m.Sb(13,"input",15),m.Pc(14,j,2,0,"span",16),m.Pc(15,Y,2,0,"span",16),m.Wb(),m.Wb(),m.Xb(16,"div",11),m.Xb(17,"label",17),m.bc(18,18),m.Wb(),m.Xb(19,"div",14),m.Sb(20,"input",19),m.Wb(),m.Wb(),m.Xb(21,"div",11),m.Xb(22,"label",20),m.bc(23,21),m.Wb(),m.Xb(24,"div",14),m.Sb(25,"cd-table",22),m.Wb(),m.Wb(),m.Wb(),m.Xb(26,"div",23),m.Xb(27,"cd-form-button-panel",24),m.lc("submitActionEvent",function(){return m.Ic(e),m.nc().submit()}),m.oc(28,"titlecase"),m.oc(29,"upperFirst"),m.Wb(),m.Wb(),m.Wb(),m.Wb(),m.Wb()}if(2&e){const e=m.Fc(2),t=m.nc();m.Db(1),m.uc("formGroup",t.roleForm),m.Db(6),m.fc(m.pc(6,15,t.action))(m.pc(7,17,t.resource)),m.cc(5),m.Db(3),m.uc("ngClass",m.zc(23,N,t.mode!==t.roleFormMode.editing)),m.Db(4),m.uc("ngIf",t.roleForm.showError("name",e,"required")),m.Db(1),m.uc("ngIf",t.roleForm.showError("name",e,"notUnique")),m.Db(10),m.uc("data",t.scopes_permissions)("columns",t.columns)("toolHeader",!1)("autoReload",!1)("autoSave",!1)("footer",!1)("limit",0),m.Db(2),m.uc("form",t.roleForm)("submitText",m.pc(28,19,t.action)+" "+m.pc(29,21,t.resource))}}function $(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",28),m.Xb(1,"input",29),m.lc("change",function(n){m.Ic(e);const i=t.row,r=t.column;return m.nc().onClickCellCheckbox(i.scope,r.prop,n)}),m.Wb(),m.Xb(2,"label",30),m.Rc(3),m.Wb(),m.Wb()}if(2&e){const e=t.row,n=t.value,i=m.nc();m.Db(1),m.wc("id","scope_",e.scope,""),m.uc("checked",i.isRowChecked(e.scope)),m.Db(1),m.wc("for","scope_",e.scope,""),m.Db(1),m.Sc(n)}}function H(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",28),m.Xb(1,"input",31),m.lc("change",function(n){m.Ic(e);const i=t.row,r=t.column;return m.nc().onClickCellCheckbox(i.scope,r.prop,n)}),m.Wb(),m.Sb(2,"label",32),m.Wb()}if(2&e){const e=t.column,n=t.row,i=t.value;m.Db(1),m.uc("checked",i)("id",n.scope+"-"+e.prop),m.Db(1),m.uc("for",n.scope+"-"+e.prop)}}function X(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",28),m.Xb(1,"input",29),m.lc("change",function(n){m.Ic(e);const i=t.column;return m.nc().onClickHeaderCheckbox(i.prop,n)}),m.Wb(),m.Xb(2,"label",33),m.Rc(3),m.Wb(),m.Wb()}if(2&e){const e=t.column,n=m.nc();m.Db(1),m.wc("id","header_",e.prop,""),m.uc("checked",n.isHeaderChecked(e.prop)),m.Db(1),m.wc("for","header_",e.prop,""),m.Db(1),m.Sc(e.name)}}let V=(()=>{class e extends y.a{constructor(e,t,n,i,r,s){super(),this.route=e,this.router=t,this.roleService=n,this.scopeService=i,this.notificationService=r,this.actionLabels=s,this.scopes=[],this.scopes_permissions=[],this.roleFormMode=x,this.resource="role",this.createForm(),this.listenToChanges()}createForm(){this.roleForm=new w.a({name:new r.h("",{validators:[r.A.required],asyncValidators:[D.a.unique(this.roleService.exists,this.roleService)]}),description:new r.h(""),scopes_permissions:new r.h({})})}ngOnInit(){this.columns=[{prop:"scope",name:"All",flexGrow:2,cellTemplate:this.cellScopeCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"read",name:"Read",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"create",name:"Create",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"update",name:"Update",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl},{prop:"delete",name:"Delete",flexGrow:1,cellClass:"text-center",cellTemplate:this.cellPermissionCheckboxTpl,headerTemplate:this.headerPermissionCheckboxTpl}],this.router.url.startsWith("/user-management/roles/edit")?(this.mode=this.roleFormMode.editing,this.action=this.actionLabels.EDIT):this.action=this.actionLabels.CREATE,this.mode===this.roleFormMode.editing?this.initEdit():this.initCreate()}initCreate(){this.scopeService.list().subscribe(e=>{this.scopes=e,this.roleForm.get("scopes_permissions").setValue({}),this.loadingReady()})}initEdit(){this.roleForm.get("name").disable(),this.route.params.subscribe(e=>{const t=[];t.push(this.scopeService.list()),t.push(this.roleService.get(e.name)),Object(h.a)(t).subscribe(e=>{this.scopes=e[0],["name","description","scopes_permissions"].forEach(t=>this.roleForm.get(t).setValue(e[1][t])),this.loadingReady()})})}listenToChanges(){this.roleForm.get("scopes_permissions").valueChanges.subscribe(e=>{const t=[];d.a.each(this.scopes,n=>{const i={read:!1,create:!1,update:!1,delete:!1};i.scope=n,n in e&&d.a.each(e[n],e=>{i[e]=!0}),t.push(i)}),this.scopes_permissions=t})}isRowChecked(e){const t=d.a.find(this.scopes_permissions,t=>t.scope===e);return!d.a.isUndefined(t)&&t.read&&t.create&&t.update&&t.delete}isHeaderChecked(e){let t=[e];return"scope"===e&&(t=["read","create","update","delete"]),t.every(e=>this.scopes_permissions.every(t=>t[e]))}onClickCellCheckbox(e,t,n=null){const i=d.a.cloneDeep(this.roleForm.getValue("scopes_permissions"));let r=[t];"scope"===t&&(r=["read","create","update","delete"]),e in i||(i[e]=[]),n&&n.target.checked||!d.a.isEqual(r.sort(),d.a.intersection(i[e],r).sort())?i[e]=d.a.union(i[e],r):(i[e]=d.a.difference(i[e],r),d.a.isEmpty(i[e])&&d.a.unset(i,e)),this.roleForm.get("scopes_permissions").setValue(i)}onClickHeaderCheckbox(e,t){const n=d.a.cloneDeep(this.roleForm.getValue("scopes_permissions"));let i=[e];"scope"===e&&(i=["read","create","update","delete"]),d.a.each(i,e=>{d.a.each(this.scopes,i=>{t.target.checked?n[i]=d.a.union(n[i],[e]):(n[i]=d.a.difference(n[i],[e]),d.a.isEmpty(n[i])&&d.a.unset(n,i))})}),this.roleForm.get("scopes_permissions").setValue(n)}getRequest(){const e=new k;return["name","description","scopes_permissions"].forEach(t=>e[t]=this.roleForm.get(t).value),e}createAction(){const e=this.getRequest();this.roleService.create(e).subscribe(()=>{this.notificationService.show(v.a.success,"Created role '" + e.name + "'"),this.router.navigate(["/user-management/roles"])},()=>{this.roleForm.setErrors({cdSubmitButton:!0})})}editAction(){const e=this.getRequest();this.roleService.update(e).subscribe(()=>{this.notificationService.show(v.a.success,"Updated role '" + e.name + "'"),this.router.navigate(["/user-management/roles"])},()=>{this.roleForm.setErrors({cdSubmitButton:!0})})}submit(){this.mode===this.roleFormMode.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(m.Rb(s.a),m.Rb(s.e),m.Rb(g),m.Rb(_),m.Rb(S.a),m.Rb(c.b))},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-role-form"]],viewQuery:function(e,t){if(1&e&&(m.Wc(P,3),m.Wc(F,3),m.Wc(W,3)),2&e){let e;m.Ec(e=m.mc())&&(t.headerPermissionCheckboxTpl=e.first),m.Ec(e=m.mc())&&(t.cellScopeCheckboxTpl=e.first),m.Ec(e=m.mc())&&(t.cellPermissionCheckboxTpl=e.first)}},features:[m.Ab],decls:7,vars:1,consts:function(){let e,t,n,i,r,s,o,a;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",n="Name...",i="Description",r="Description...",s="Permissions",o="This field is required.",a="The chosen name is already in use.",[["class","cd-col-form",4,"cdFormLoading"],["cellScopeCheckboxTpl",""],["cellPermissionCheckboxTpl",""],["headerPermissionCheckboxTpl",""],[1,"cd-col-form"],["name","roleForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["type","text","placeholder",n,"id","name","name","name","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","description",1,"cd-col-form-label"],i,["type","text","placeholder",r,"id","description","name","description","formControlName","description",1,"form-control"],[1,"cd-col-form-label"],s,["columnMode","flex",3,"data","columns","toolHeader","autoReload","autoSave","footer","limit"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],o,a,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","checked","change"],[1,"datatable-permissions-scope-cell-label","custom-control-label",3,"for"],["type","checkbox",1,"custom-control-input",3,"checked","id","change"],[1,"custom-control-label",3,"for"],[1,"datatable-permissions-header-cell-label","custom-control-label",3,"for"]]},template:function(e,t){1&e&&(m.Pc(0,z,30,25,"div",0),m.Pc(1,$,4,4,"ng-template",null,1,m.Qc),m.Pc(3,H,3,3,"ng-template",null,2,m.Qc),m.Pc(5,X,4,4,"ng-template",null,3,m.Qc)),2&e&&m.uc("cdFormLoading",t.loading)},directives:[T.a,r.B,r.r,r.k,M.a,C.a,i.p,O.a,r.d,L.a,r.q,r.i,E.a,i.r,A.a,I.a],pipes:[i.A,R.a],styles:[".datatable-permissions-header-cell-label[_ngcontent-%COMP%], .datatable-permissions-scope-cell-label[_ngcontent-%COMP%]{font-weight:700}"]}),e})();var B=n("+fVR"),U=n("0+/T"),q=n("Rf2I"),G=n("x38r"),J=n("oxzT"),K=n("vCyI"),Q=n("nSDx"),Z=n("aexS"),ee=n("JK/P"),te=n("EgGo");let ne=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(m.Rb(s.e))},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-user-tabs"]],decls:8,vars:1,consts:function(){let e,t;return e="Users",t="Roles",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/user-management/users"],["ngbNavLink",""],e,["ngbNavItem","/user-management/roles"],t]},template:function(e,t){1&e&&(m.Xb(0,"ul",0,1),m.lc("navChange",function(e){return t.router.navigate([e.nextId])}),m.Xb(2,"li",2),m.Xb(3,"a",3),m.bc(4,4),m.Wb(),m.Wb(),m.Xb(5,"li",5),m.Xb(6,"a",3),m.bc(7,6),m.Wb(),m.Wb(),m.Wb()),2&e&&m.uc("activeId",t.router.url)},directives:[o.p,o.r,o.s],styles:[""]}),e})();var ie=n("S7zO");function re(e,t){if(1&e&&(m.Vb(0),m.Sb(1,"cd-table",1),m.Ub()),2&e){const e=m.nc();m.Db(1),m.uc("data",e.scopes_permissions)("columns",e.columns)("toolHeader",!1)("autoReload",!1)("autoSave",!1)("footer",!1)("limit",0)}}let se=(()=>{class e{constructor(){this.scopes_permissions=[]}ngOnInit(){this.columns=[{prop:"scope",name:"Scope",flexGrow:2},{prop:"read",name:"Read",flexGrow:1,cellClass:"text-center",cellTransformation:G.a.checkIcon},{prop:"create",name:"Create",flexGrow:1,cellClass:"text-center",cellTransformation:G.a.checkIcon},{prop:"update",name:"Update",flexGrow:1,cellClass:"text-center",cellTransformation:G.a.checkIcon},{prop:"delete",name:"Delete",flexGrow:1,cellClass:"text-center",cellTransformation:G.a.checkIcon}]}ngOnChanges(){if(this.selection){this.selectedItem=this.selection;const e=[];d.a.each(this.scopes,t=>{const n={read:!1,create:!1,update:!1,delete:!1};n.scope=t,t in this.selectedItem.scopes_permissions&&d.a.each(this.selectedItem.scopes_permissions[t],e=>{n[e]=!0}),e.push(n)}),this.scopes_permissions=e}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-role-details"]],inputs:{selection:"selection",scopes:"scopes"},features:[m.Bb],decls:1,vars:1,consts:[[4,"ngIf"],["columnMode","flex",3,"data","columns","toolHeader","autoReload","autoSave","footer","limit"]],template:function(e,t){1&e&&m.Pc(0,re,2,7,"ng-container",0),2&e&&m.uc("ngIf",t.selection)},directives:[i.r,A.a],styles:[".fa[_ngcontent-%COMP%]{font-size:large}.fa.fa-square-o[_ngcontent-%COMP%]{color:#ced4da}"]}),e})(),oe=(()=>{class e extends B.a{constructor(e,t,n,i,r,s,o,a){super(),this.roleService=e,this.scopeService=t,this.emptyPipe=n,this.authStorageService=i,this.modalService=r,this.notificationService=s,this.urlBuilder=o,this.actionLabels=a,this.selection=new K.a,this.permission=this.authStorageService.getPermissions().user,this.tableActions=[{permission:"create",icon:J.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"create",icon:J.a.clone,name:this.actionLabels.CLONE,disable:()=>!this.selection.hasSingleSelection,click:()=>this.cloneRole()},{permission:"update",icon:J.a.edit,disable:()=>!this.selection.hasSingleSelection||this.selection.first().system,routerLink:()=>this.selection.first()&&this.urlBuilder.getEdit(this.selection.first().name),name:this.actionLabels.EDIT},{permission:"delete",icon:J.a.destroy,disable:()=>!this.selection.hasSingleSelection||this.selection.first().system,click:()=>this.deleteRoleModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:3},{name:"Description",prop:"description",flexGrow:5,pipe:this.emptyPipe},{name:"System Role",prop:"system",cellClass:"text-center",flexGrow:1,cellTransformation:G.a.checkIcon}]}getRoles(){Object(h.a)([this.roleService.list(),this.scopeService.list()]).subscribe(e=>{this.roles=e[0],this.scopes=e[1]})}updateSelection(e){this.selection=e}deleteRole(e){this.roleService.delete(e).subscribe(()=>{this.getRoles(),this.modalRef.close(),this.notificationService.show(v.a.success,"Deleted role '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}deleteRoleModal(){const e=this.selection.first().name;this.modalRef=this.modalService.show(U.a,{itemDescription:"Role",itemNames:[e],submitAction:()=>this.deleteRole(e)})}cloneRole(){const e=this.selection.first().name;this.modalRef=this.modalService.show(q.a,{fields:[{type:"text",name:"newName",value:`${e}_clone`,label:"New name",required:!0}],titleText:"Clone Role",submitButtonText:"Clone Role",onSubmit:t=>{this.roleService.clone(e,t.newName).subscribe(()=>{this.getRoles(),this.notificationService.show(v.a.success,"Cloned role '" + t.newName + "' from '" + e + "'")})}})}}return e.\u0275fac=function(t){return new(t||e)(m.Rb(g),m.Rb(_),m.Rb(Q.a),m.Rb(Z.a),m.Rb(ee.a),m.Rb(S.a),m.Rb(te.a),m.Rb(c.b))},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-role-list"]],features:[m.Cb([{provide:te.a,useValue:new te.a("user-management/roles")}]),m.Ab],decls:4,vars:8,consts:[["columnMode","flex","identifier","name","selectionType","single",3,"data","columns","hasDetails","setExpandedRow","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection","scopes"]],template:function(e,t){1&e&&(m.Sb(0,"cd-user-tabs"),m.Xb(1,"cd-table",0),m.lc("setExpandedRow",function(e){return t.setExpandedRow(e)})("fetchData",function(){return t.getRoles()})("updateSelection",function(e){return t.updateSelection(e)}),m.Sb(2,"cd-table-actions",1),m.Sb(3,"cd-role-details",2),m.Wb()),2&e&&(m.Db(1),m.uc("data",t.roles)("columns",t.columns)("hasDetails",!0),m.Db(1),m.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),m.Db(1),m.uc("selection",t.expandedRow)("scopes",t.scopes))},directives:[ne,A.a,ie.a,se],styles:[""]}),e})();var ae=n("wd/R"),ce=n.n(ae),le=n("DSvg"),ue=n("20UP"),de=n("Mxhz"),he=n("OLbh"),fe=n("DNAf"),pe=n("2EZI"),me=n("oMSZ"),be=n("1nQr"),ge=function(e){return e.editing="editing",e}({});class _e{}var ve=n("D4zM"),ye=n("p4Cf"),we=n("ppaS"),De=n("MAOJ");const Se=["removeSelfUserReadUpdatePermissionTpl"];function xe(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,29),m.Wb())}function ke(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,30),m.Wb())}function Te(e,t){if(1&e&&m.Sb(0,"cd-helper",40),2&e){const e=m.nc(3);m.vc("html",e.passwordPolicyHelpText)}}function Me(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,41),m.Wb())}function Ce(e,t){if(1&e&&(m.Xb(0,"span",28),m.Rc(1),m.Wb()),2&e){const e=m.nc(3);m.Db(1),m.Tc(" ",e.passwordValuation," ")}}function Oe(e,t){if(1&e&&(m.Xb(0,"div",10),m.Xb(1,"label",31),m.Vb(2),m.bc(3,32),m.Ub(),m.Pc(4,Te,1,1,"cd-helper",33),m.Wb(),m.Xb(5,"div",13),m.Xb(6,"div",34),m.Sb(7,"input",35),m.Xb(8,"span",36),m.Sb(9,"button",37),m.Wb(),m.Wb(),m.Xb(10,"div",38),m.Sb(11,"div",39),m.Wb(),m.Pc(12,Me,2,0,"span",15),m.Pc(13,Ce,2,1,"span",15),m.Wb(),m.Wb()),2&e){m.nc();const e=m.Fc(2),t=m.nc();m.Db(4),m.uc("ngIf",t.passwordPolicyHelpText.length>0),m.Db(7),m.Fb(t.passwordStrengthLevelClass),m.vc("title",t.passwordValuation),m.Db(1),m.uc("ngIf",t.userForm.showError("password",e,"required")),m.Db(1),m.uc("ngIf",t.userForm.showError("password",e,"passwordPolicy"))}}function Le(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,46),m.Wb())}function Ee(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,47),m.Wb())}function Ae(e,t){if(1&e&&(m.Xb(0,"div",10),m.Xb(1,"label",42),m.bc(2,43),m.Wb(),m.Xb(3,"div",13),m.Xb(4,"div",34),m.Sb(5,"input",44),m.Xb(6,"span",36),m.Sb(7,"button",45),m.Wb(),m.Pc(8,Le,2,0,"span",15),m.Wb(),m.Pc(9,Ee,2,0,"span",15),m.Wb(),m.Wb()),2&e){m.nc();const e=m.Fc(2),t=m.nc();m.Db(8),m.uc("ngIf",t.userForm.showError("confirmpassword",e,"match")),m.Db(1),m.uc("ngIf",t.userForm.showError("confirmpassword",e,"required"))}}function Ie(e,t){1&e&&(m.Xb(0,"cd-helper",54),m.Xb(1,"p"),m.Rc(2," The Dashboard setting defining the expiration interval of passwords is currently set to "),m.Xb(3,"strong"),m.Rc(4,"0"),m.Wb(),m.Rc(5,". This means if a date is set, the user password will only expire once. "),m.Wb(),m.Xb(6,"p"),m.Rc(7," Consider configuring the Dashboard setting "),m.Xb(8,"a",55),m.Rc(9,"USER_PWD_EXPIRATION_SPAN"),m.Wb(),m.Rc(10," in order to let passwords expire periodically. "),m.Wb(),m.Wb())}function Re(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,56),m.Wb())}const Pe=function(e){return{required:e}};function Fe(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",10),m.Xb(1,"label",48),m.Vb(2),m.bc(3,49),m.Ub(),m.Pc(4,Ie,11,0,"cd-helper",50),m.Wb(),m.Xb(5,"div",13),m.Xb(6,"div",34),m.Xb(7,"input",51,52),m.lc("click",function(){return m.Ic(e),m.Fc(8).open()})("keypress",function(){return m.Ic(e),m.Fc(8).close()}),m.Wb(),m.Xb(9,"span",36),m.Xb(10,"button",53),m.lc("click",function(){return m.Ic(e),m.nc(2).clearExpirationDate()}),m.Sb(11,"i"),m.Wb(),m.Wb(),m.Pc(12,Re,2,0,"span",15),m.Wb(),m.Wb(),m.Wb()}if(2&e){m.nc();const e=m.Fc(2),t=m.nc(),n=m.Fc(4);m.Db(1),m.uc("ngClass",m.zc(7,Pe,t.pwdExpirationSettings.pwdExpirationSpan>0)),m.Db(3),m.uc("ngIf",0==t.pwdExpirationSettings.pwdExpirationSpan),m.Db(3),m.uc("ngbPopover",n),m.Db(4),m.Gb("icon-prepend ",t.icons.destroy,""),m.Db(1),m.uc("ngIf",t.userForm.showError("pwdExpirationDate",e,"required"))}}function We(e,t){1&e&&(m.Xb(0,"span",28),m.bc(1,57),m.Wb())}function je(e,t){if(1&e&&(m.Xb(0,"span",58),m.Sb(1,"cd-select-badges",59),m.Wb()),2&e){const e=m.nc(2);m.Db(1),m.uc("data",e.userForm.controls.roles.value)("options",e.allRoles)("messages",e.messages)}}function Ye(e,t){1&e&&(m.Xb(0,"div",10),m.Xb(1,"div",60),m.Xb(2,"div",61),m.Sb(3,"input",62),m.Xb(4,"label",63),m.bc(5,64),m.Wb(),m.Wb(),m.Wb(),m.Wb())}function Ne(e,t){1&e&&(m.Xb(0,"div",10),m.Xb(1,"div",60),m.Xb(2,"div",61),m.Sb(3,"input",65),m.Xb(4,"label",66),m.bc(5,67),m.Wb(),m.Wb(),m.Wb(),m.Wb())}function ze(e,t){if(1&e){const e=m.Yb();m.Xb(0,"div",3),m.Xb(1,"form",4,5),m.Xb(3,"div",6),m.Xb(4,"div",7),m.bc(5,8),m.oc(6,"titlecase"),m.oc(7,"upperFirst"),m.Wb(),m.Xb(8,"div",9),m.Xb(9,"div",10),m.Xb(10,"label",11),m.bc(11,12),m.Wb(),m.Xb(12,"div",13),m.Sb(13,"input",14),m.Pc(14,xe,2,0,"span",15),m.Pc(15,ke,2,0,"span",15),m.Wb(),m.Wb(),m.Pc(16,Oe,14,7,"div",16),m.Pc(17,Ae,10,2,"div",16),m.Pc(18,Fe,13,9,"div",16),m.Xb(19,"div",10),m.Xb(20,"label",17),m.bc(21,18),m.Wb(),m.Xb(22,"div",13),m.Sb(23,"input",19),m.Wb(),m.Wb(),m.Xb(24,"div",10),m.Xb(25,"label",20),m.bc(26,21),m.Wb(),m.Xb(27,"div",13),m.Sb(28,"input",22),m.Pc(29,We,2,0,"span",15),m.Wb(),m.Wb(),m.Xb(30,"div",10),m.Xb(31,"label",23),m.bc(32,24),m.Wb(),m.Xb(33,"div",13),m.Pc(34,je,2,3,"span",25),m.Wb(),m.Wb(),m.Pc(35,Ye,6,0,"div",16),m.Pc(36,Ne,6,0,"div",16),m.Wb(),m.Xb(37,"div",26),m.Xb(38,"cd-form-button-panel",27),m.lc("submitActionEvent",function(){return m.Ic(e),m.nc().submit()}),m.oc(39,"titlecase"),m.oc(40,"upperFirst"),m.Wb(),m.Wb(),m.Wb(),m.Wb(),m.Wb()}if(2&e){const e=m.Fc(2),t=m.nc();m.Db(1),m.uc("formGroup",t.userForm),m.Db(6),m.fc(m.pc(6,15,t.action))(m.pc(7,17,t.resource)),m.cc(5),m.Db(3),m.uc("ngClass",m.zc(23,Pe,t.mode!==t.userFormMode.editing)),m.Db(4),m.uc("ngIf",t.userForm.showError("username",e,"required")),m.Db(1),m.uc("ngIf",t.userForm.showError("username",e,"notUnique")),m.Db(1),m.uc("ngIf",!t.authStorageService.isSSO()),m.Db(1),m.uc("ngIf",!t.authStorageService.isSSO()),m.Db(1),m.uc("ngIf",!t.authStorageService.isSSO()),m.Db(11),m.uc("ngIf",t.userForm.showError("email",e,"email")),m.Db(5),m.uc("ngIf",t.allRoles),m.Db(1),m.uc("ngIf",!t.isCurrentUser()),m.Db(1),m.uc("ngIf",!t.isCurrentUser()&&!t.authStorageService.isSSO()),m.Db(2),m.uc("form",t.userForm)("submitText",m.pc(39,19,t.action)+" "+m.pc(40,21,t.resource))}}function $e(e,t){1&e&&(m.Xb(0,"p"),m.Xb(1,"strong"),m.bc(2,68),m.Wb(),m.Wb(),m.Sb(3,"br"),m.Xb(4,"p"),m.bc(5,69),m.Wb(),m.Vb(6),m.bc(7,70),m.Ub())}function He(e,t){if(1&e&&m.Sb(0,"cd-date-time-picker",71),2&e){const e=m.nc();m.uc("control",e.userForm.get("pwdExpirationDate"))("hasTime",!1)}}let Xe=(()=>{class e extends y.a{constructor(e,t,n,i,r,s,o,a,c,l,u,d){super(),this.authService=e,this.authStorageService=t,this.route=n,this.router=i,this.modalService=r,this.roleService=s,this.userService=o,this.notificationService=a,this.actionLabels=c,this.passwordPolicyService=l,this.formBuilder=u,this.settingsService=d,this.userFormMode=ge,this.messages=new fe.a({empty:"There are no roles."}),this.passwordPolicyHelpText="",this.icons=J.a,this.pwdExpirationFormat="YYYY-MM-DD",this.resource="user",this.createForm(),this.messages=new fe.a({empty:"There are no roles."})}createForm(){this.passwordPolicyService.getHelpText().subscribe(e=>{this.passwordPolicyHelpText=e}),this.userForm=this.formBuilder.group({username:["",[r.A.required],[D.a.unique(this.userService.validateUserName,this.userService)]],name:[""],password:["",[],[D.a.passwordPolicy(this.userService,()=>this.userForm.getValue("username"),(e,t,n)=>{this.passwordStrengthLevelClass=this.passwordPolicyService.mapCreditsToCssClass(t),this.passwordValuation=d.a.defaultTo(n,"")})]],confirmpassword:[""],pwdExpirationDate:[void 0],email:["",[D.a.email]],roles:[[]],enabled:[!0,[r.A.required]],pwdUpdateRequired:[!0]},{validators:[D.a.match("password","confirmpassword")]})}ngOnInit(){this.router.url.startsWith("/user-management/users/edit")?(this.mode=this.userFormMode.editing,this.action=this.actionLabels.EDIT):this.action=this.actionLabels.CREATE;const e=[this.roleService.list(),this.settingsService.getStandardSettings()];Object(h.a)(e).subscribe(e=>{if(this.allRoles=d.a.map(e[0],e=>(e.enabled=!0,e)),this.pwdExpirationSettings=new me.a(e[1]),this.mode===this.userFormMode.editing)this.initEdit();else{if(this.pwdExpirationSettings.pwdExpirationSpan>0){const e=this.userForm.get("pwdExpirationDate"),t=ce()();t.add(this.pwdExpirationSettings.pwdExpirationSpan,"day"),e.setValue(t.format(this.pwdExpirationFormat)),e.setValidators([r.A.required])}this.loadingReady()}})}initEdit(){this.disableForEdit(),this.route.params.subscribe(e=>{this.userService.get(e.username).subscribe(e=>{this.response=d.a.cloneDeep(e),this.setResponse(e),this.loadingReady()})})}disableForEdit(){this.userForm.get("username").disable()}setResponse(e){["username","name","email","roles","enabled","pwdUpdateRequired"].forEach(t=>this.userForm.get(t).setValue(e[t]));const t=e.pwdExpirationDate;t&&this.userForm.get("pwdExpirationDate").setValue(ce()(1e3*t).format(this.pwdExpirationFormat))}getRequest(){const e=new _e;["username","password","name","email","roles","enabled","pwdUpdateRequired"].forEach(t=>e[t]=this.userForm.get(t).value);const t=this.userForm.get("pwdExpirationDate").value;if(t){const n=ce()(t,this.pwdExpirationFormat);this.mode===this.userFormMode.editing&&this.response.pwdExpirationDate===n.unix()||n.set({hour:23,minute:59,second:59}),e.pwdExpirationDate=n.unix()}return e}createAction(){const e=this.getRequest();this.userService.create(e).subscribe(()=>{this.notificationService.show(v.a.success,"Created user '" + e.username + "'"),this.router.navigate(["/user-management/users"])},()=>{this.userForm.setErrors({cdSubmitButton:!0})})}editAction(){if(this.isUserRemovingNeededRolePermissions()){const e={titleText:"Update user",buttonText:"Continue",bodyTpl:this.removeSelfUserReadUpdatePermissionTpl,onSubmit:()=>{this.modalRef.close(),this.doEditAction()},onCancel:()=>{this.userForm.setErrors({cdSubmitButton:!0}),this.userForm.get("roles").reset(this.userForm.get("roles").value)}};this.modalRef=this.modalService.show(he.a,e)}else this.doEditAction()}isCurrentUser(){return this.authStorageService.getUsername()===this.userForm.getValue("username")}isUserChangingRoles(){return this.isCurrentUser()&&this.response&&!d.a.isEqual(this.response.roles,this.userForm.getValue("roles"))}isUserRemovingNeededRolePermissions(){return this.isCurrentUser()&&!this.hasUserReadUpdatePermissions(this.userForm.getValue("roles"))}hasUserReadUpdatePermissions(e=[]){for(const t of this.allRoles)if(-1!==e.indexOf(t.name)&&t.scopes_permissions.user){const e=t.scopes_permissions.user;return["read","update"].every(t=>-1!==e.indexOf(t))}return!1}doEditAction(){const e=this.getRequest();this.userService.update(e).subscribe(()=>{this.isUserChangingRoles()?this.authService.logout(()=>{this.notificationService.show(v.a.info,"You were automatically logged out because your roles have been changed.")}):(this.notificationService.show(v.a.success,"Updated user '" + e.username + "'"),this.router.navigate(["/user-management/users"]))},()=>{this.userForm.setErrors({cdSubmitButton:!0})})}clearExpirationDate(){this.userForm.get("pwdExpirationDate").setValue(void 0)}submit(){this.mode===this.userFormMode.editing?this.editAction():this.createAction()}}return e.\u0275fac=function(t){return new(t||e)(m.Rb(le.a),m.Rb(Z.a),m.Rb(s.a),m.Rb(s.e),m.Rb(ee.a),m.Rb(g),m.Rb(de.a),m.Rb(S.a),m.Rb(c.b),m.Rb(be.a),m.Rb(pe.a),m.Rb(ue.a))},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-user-form"]],viewQuery:function(e,t){if(1&e&&m.Wc(Se,3),2&e){let e;m.Ec(e=m.mc())&&(t.removeSelfUserReadUpdatePermissionTpl=e.first)}},features:[m.Ab],decls:5,vars:1,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Username",n="Full name",i="Email",r="Roles",s="This field is required.",o="The username already exists.",a="Password",c="This field is required.",l="Confirm password",u="Password confirmation doesn't match the password.",d="This field is required.",h="Password expiration date",f="Password expiration date...",p="This field is required.",m="Invalid email.",b="Enabled",g="User must change password at next logon",_="You are about to remove \"user read / update\" permissions from your own user.",v="If you continue, you will no longer be able to add or remove roles from any user.",y="Are you sure you want to continue?",[["class","cd-col-form",4,"cdFormLoading"],["removeSelfUserReadUpdatePermissionTpl",""],["popContent",""],[1,"cd-col-form"],["name","userForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","username",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["type","text","placeholder","Username...","id","username","name","username","formControlName","username","autocomplete","off","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],["for","name",1,"cd-col-form-label"],n,["type","text","placeholder","Full name...","id","name","name","name","formControlName","name",1,"form-control"],["for","email",1,"cd-col-form-label"],i,["type","email","placeholder","Email...","id","email","name","email","formControlName","email",1,"form-control"],[1,"cd-col-form-label"],r,["class","no-border full-height",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],s,o,["for","password",1,"cd-col-form-label"],a,["class","text-pre-wrap",3,"html",4,"ngIf"],[1,"input-group"],["type","password","placeholder","Password...","id","password","name","password","autocomplete","new-password","formControlName","password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-light"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],[1,"text-pre-wrap",3,"html"],c,["for","confirmpassword",1,"cd-col-form-label"],l,["type","password","placeholder","Confirm password...","id","confirmpassword","name","confirmpassword","autocomplete","new-password","formControlName","confirmpassword",1,"form-control"],["type","button","cdPasswordButton","confirmpassword",1,"btn","btn-light"],u,d,["for","pwdExpirationDate",1,"cd-col-form-label",3,"ngClass"],h,["class","text-pre-wrap",4,"ngIf"],["placeholder",f,"id","pwdExpirationDate","name","pwdExpirationDate","formControlName","pwdExpirationDate","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["p","ngbPopover"],["type","button",1,"btn","btn-light",3,"click"],[1,"text-pre-wrap"],["routerLink","/mgr-modules/edit/dashboard",1,"alert-link"],p,m,[1,"no-border","full-height"],[3,"data","options","messages"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","enabled","name","enabled","formControlName","enabled",1,"custom-control-input"],["for","enabled",1,"custom-control-label"],b,["type","checkbox","id","pwdUpdateRequired","name","pwdUpdateRequired","formControlName","pwdUpdateRequired",1,"custom-control-input"],["for","pwdUpdateRequired",1,"custom-control-label"],g,_,v,y,[3,"control","hasTime"]]},template:function(e,t){1&e&&(m.Pc(0,ze,41,25,"div",0),m.Pc(1,$e,8,0,"ng-template",null,1,m.Qc),m.Pc(3,He,1,2,"ng-template",null,2,m.Qc)),2&e&&m.uc("cdFormLoading",t.loading)},directives:[T.a,r.B,r.r,r.k,M.a,C.a,i.p,O.a,r.d,L.a,r.q,r.i,E.a,i.r,I.a,ve.a,ye.a,o.w,s.h,we.a,r.b,De.a],pipes:[i.A,R.a],styles:[""]}),e})();var Ve=n("a0VL");const Be=["userRolesTpl"];function Ue(e,t){if(1&e&&(m.Xb(0,"span"),m.Rc(1),m.Wb()),2&e){const e=t.$implicit,n=t.last;m.Db(1),m.Uc(" ",e,"",n?"":", "," ")}}function qe(e,t){1&e&&m.Pc(0,Ue,2,2,"span",3),2&e&&m.uc("ngForOf",t.value)}let Ge=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.userService=e,this.emptyPipe=t,this.modalService=n,this.notificationService=i,this.authStorageService=r,this.urlBuilder=s,this.cdDatePipe=o,this.actionLabels=a,this.selection=new K.a,this.permission=this.authStorageService.getPermissions().user,this.tableActions=[{permission:"create",icon:J.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"update",icon:J.a.edit,routerLink:()=>this.selection.first()&&this.urlBuilder.getEdit(this.selection.first().username),name:this.actionLabels.EDIT},{permission:"delete",icon:J.a.destroy,click:()=>this.deleteUserModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Username",prop:"username",flexGrow:1},{name:"Name",prop:"name",flexGrow:1,pipe:this.emptyPipe},{name:"Email",prop:"email",flexGrow:1,pipe:this.emptyPipe},{name:"Roles",prop:"roles",flexGrow:1,cellTemplate:this.userRolesTpl},{name:"Enabled",prop:"enabled",flexGrow:1,cellTransformation:G.a.checkIcon},{name:"Password expiration date",prop:"pwdExpirationDate",flexGrow:1,pipe:this.cdDatePipe}]}getUsers(){this.userService.list().subscribe(e=>{e.forEach(e=>{e.pwdExpirationDate&&e.pwdExpirationDate>0&&(e.pwdExpirationDate=1e3*e.pwdExpirationDate)}),this.users=e})}updateSelection(e){this.selection=e}deleteUser(e){this.userService.delete(e).subscribe(()=>{this.getUsers(),this.modalRef.close(),this.notificationService.show(v.a.success,"Deleted user '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}deleteUserModal(){const e=this.authStorageService.getUsername(),t=this.selection.first().username;e!==t?this.modalRef=this.modalService.show(U.a,{itemDescription:"User",itemNames:[t],submitAction:()=>this.deleteUser(t)}):this.notificationService.show(v.a.error,"Failed to delete user '" + t + "'","You are currently logged in as '" + t + "'.")}}return e.\u0275fac=function(t){return new(t||e)(m.Rb(de.a),m.Rb(Q.a),m.Rb(ee.a),m.Rb(S.a),m.Rb(Z.a),m.Rb(te.a),m.Rb(Ve.a),m.Rb(c.b))},e.\u0275cmp=m.Lb({type:e,selectors:[["cd-user-list"]],viewQuery:function(e,t){if(1&e&&m.Wc(Be,3),2&e){let e;m.Ec(e=m.mc())&&(t.userRolesTpl=e.first)}},features:[m.Cb([{provide:te.a,useValue:new te.a("user-management/users")}])],decls:5,vars:5,consts:[["columnMode","flex","identifier","username","selectionType","single",3,"data","columns","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["userRolesTpl",""],[4,"ngFor","ngForOf"]],template:function(e,t){1&e&&(m.Sb(0,"cd-user-tabs"),m.Xb(1,"cd-table",0),m.lc("fetchData",function(){return t.getUsers()})("updateSelection",function(e){return t.updateSelection(e)}),m.Sb(2,"cd-table-actions",1),m.Wb(),m.Pc(3,qe,1,1,"ng-template",null,2,m.Qc)),2&e&&(m.Db(1),m.uc("data",t.users)("columns",t.columns),m.Db(1),m.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[ne,A.a,ie.a,i.q],styles:[""]}),e})(),Je=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Pb({type:e}),e.\u0275inj=m.Ob({imports:[[i.c,r.m,r.x,l.a,o.t,o.y,a.a,s.i]]}),e})();const Ke=[{path:"",redirectTo:"users",pathMatch:"full"},{path:"users",data:{breadcrumbs:"Users"},children:[{path:"",component:Ge},{path:c.e.CREATE,component:Xe,data:{breadcrumbs:c.a.CREATE}},{path:`${c.e.EDIT}/:username`,component:Xe,data:{breadcrumbs:c.a.EDIT}}]},{path:"roles",data:{breadcrumbs:"Roles"},children:[{path:"",component:oe},{path:c.e.CREATE,component:V,data:{breadcrumbs:c.a.CREATE}},{path:`${c.e.EDIT}/:name`,component:V,data:{breadcrumbs:c.a.EDIT}}]}];let Qe=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=m.Pb({type:e}),e.\u0275inj=m.Ob({imports:[[Je,s.i.forChild(Ke)]]}),e})()},Lhse:function(e,t,n){"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(t,"a",function(){return r});const r=i()},Loxo:function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u042f\u043a\u0448\u0430\u043d\u0431\u0430_\u0414\u0443\u0448\u0430\u043d\u0431\u0430_\u0421\u0435\u0448\u0430\u043d\u0431\u0430_\u0427\u043e\u0440\u0448\u0430\u043d\u0431\u0430_\u041f\u0430\u0439\u0448\u0430\u043d\u0431\u0430_\u0416\u0443\u043c\u0430_\u0428\u0430\u043d\u0431\u0430".split("_"),weekdaysShort:"\u042f\u043a\u0448_\u0414\u0443\u0448_\u0421\u0435\u0448_\u0427\u043e\u0440_\u041f\u0430\u0439_\u0416\u0443\u043c_\u0428\u0430\u043d".split("_"),weekdaysMin:"\u042f\u043a_\u0414\u0443_\u0421\u0435_\u0427\u043e_\u041f\u0430_\u0416\u0443_\u0428\u0430".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[\u0411\u0443\u0433\u0443\u043d \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",nextDay:"[\u042d\u0440\u0442\u0430\u0433\u0430] LT [\u0434\u0430]",nextWeek:"dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastDay:"[\u041a\u0435\u0447\u0430 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastWeek:"[\u0423\u0442\u0433\u0430\u043d] dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",sameElse:"L"},relativeTime:{future:"\u042f\u043a\u0438\u043d %s \u0438\u0447\u0438\u0434\u0430",past:"\u0411\u0438\u0440 \u043d\u0435\u0447\u0430 %s \u043e\u043b\u0434\u0438\u043d",s:"\u0444\u0443\u0440\u0441\u0430\u0442",ss:"%d \u0444\u0443\u0440\u0441\u0430\u0442",m:"\u0431\u0438\u0440 \u0434\u0430\u043a\u0438\u043a\u0430",mm:"%d \u0434\u0430\u043a\u0438\u043a\u0430",h:"\u0431\u0438\u0440 \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u0431\u0438\u0440 \u043e\u0439",MM:"%d \u043e\u0439",y:"\u0431\u0438\u0440 \u0439\u0438\u043b",yy:"%d \u0439\u0438\u043b"},week:{dow:1,doy:7}})}(n("wd/R"))},LvDl:function(e,t,n){(function(e){var i;(function(){var r,s="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,l=128,u=1/0,d=9007199254740991,h=NaN,f=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],m="[object Arguments]",b="[object Array]",g="[object Boolean]",_="[object Date]",v="[object Error]",y="[object Function]",w="[object GeneratorFunction]",D="[object Map]",S="[object Number]",x="[object Object]",k="[object Promise]",T="[object RegExp]",M="[object Set]",C="[object String]",O="[object Symbol]",L="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",I="[object Float32Array]",R="[object Float64Array]",P="[object Int8Array]",F="[object Int16Array]",W="[object Int32Array]",j="[object Uint8Array]",Y="[object Uint8ClampedArray]",N="[object Uint16Array]",z="[object Uint32Array]",$=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,X=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,U=RegExp(V.source),q=RegExp(B.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),ie=/^\s+/,re=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",De="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="["+xe+"]",Te="["+we+"]",Me="\\d+",Ce="["+De+"]",Oe="[^\\ud800-\\udfff"+xe+Me+"\\u2700-\\u27bf"+De+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",Ae="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",Re="["+Se+"]",Pe="(?:"+Ce+"|"+Oe+")",Fe="(?:"+Re+"|"+Oe+")",We="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",je="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Te+"|"+Le+")?",Ne="[\\ufe0e\\ufe0f]?",ze=Ne+Ye+"(?:\\u200d(?:"+[Ee,Ae,Ie].join("|")+")"+Ne+Ye+")*",$e="(?:"+["[\\u2700-\\u27bf]",Ae,Ie].join("|")+")"+ze,He="(?:"+[Ee+Te+"?",Te,Ae,Ie,"[\\ud800-\\udfff]"].join("|")+")",Xe=RegExp("['\u2019]","g"),Ve=RegExp(Te,"g"),Be=RegExp(Le+"(?="+Le+")|"+He+ze,"g"),Ue=RegExp([Re+"?"+Ce+"+"+We+"(?="+[ke,Re,"$"].join("|")+")",Fe+"+"+je+"(?="+[ke,Re+Pe,"$"].join("|")+")",Re+"?"+Pe+"+"+We,Re+"+"+je,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,$e].join("|"),"g"),qe=RegExp("[\\u200d\\ud800-\\udfff"+we+"\\ufe0e\\ufe0f]"),Ge=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ke=-1,Qe={};Qe[I]=Qe[R]=Qe[P]=Qe[F]=Qe[W]=Qe[j]=Qe[Y]=Qe[N]=Qe[z]=!0,Qe[m]=Qe[b]=Qe[E]=Qe[g]=Qe[A]=Qe[_]=Qe[v]=Qe[y]=Qe[D]=Qe[S]=Qe[x]=Qe[T]=Qe[M]=Qe[C]=Qe[L]=!1;var Ze={};Ze[m]=Ze[b]=Ze[E]=Ze[A]=Ze[g]=Ze[_]=Ze[I]=Ze[R]=Ze[P]=Ze[F]=Ze[W]=Ze[D]=Ze[S]=Ze[x]=Ze[T]=Ze[M]=Ze[C]=Ze[O]=Ze[j]=Ze[Y]=Ze[N]=Ze[z]=!0,Ze[v]=Ze[y]=Ze[L]=!1;var et={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tt=parseFloat,nt=parseInt,it="object"==typeof global&&global&&global.Object===Object&&global,rt="object"==typeof self&&self&&self.Object===Object&&self,st=it||rt||Function("return this")(),ot=t&&!t.nodeType&&t,at=ot&&"object"==typeof e&&e&&!e.nodeType&&e,ct=at&&at.exports===ot,lt=ct&&it.process,ut=function(){try{return at&&at.require&&at.require("util").types||lt&&lt.binding&&lt.binding("util")}catch(e){}}(),dt=ut&&ut.isArrayBuffer,ht=ut&&ut.isDate,ft=ut&&ut.isMap,pt=ut&&ut.isRegExp,mt=ut&&ut.isSet,bt=ut&&ut.isTypedArray;function gt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,i){for(var r=-1,s=null==e?0:e.length;++r<s;){var o=e[r];t(i,o,n(o),e)}return i}function vt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function yt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function wt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0}function Dt(e,t){for(var n=-1,i=null==e?0:e.length,r=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[r++]=o)}return s}function St(e,t){return!(null==e||!e.length)&&It(e,t,0)>-1}function xt(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function kt(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function Tt(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}function Mt(e,t,n,i){var r=-1,s=null==e?0:e.length;for(i&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n}function Ct(e,t,n,i){var r=null==e?0:e.length;for(i&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function Ot(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}var Lt=Wt("length");function Et(e,t,n){var i;return n(e,function(e,n,r){if(t(e,n,r))return i=n,!1}),i}function At(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1}function It(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):At(e,Pt,n)}function Rt(e,t,n,i){for(var r=n-1,s=e.length;++r<s;)if(i(e[r],t))return r;return-1}function Pt(e){return e!=e}function Ft(e,t){var n=null==e?0:e.length;return n?Nt(e,t)/n:h}function Wt(e){return function(t){return null==t?r:t[e]}}function jt(e){return function(t){return null==e?r:e[t]}}function Yt(e,t,n,i,r){return r(e,function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)}),n}function Nt(e,t){for(var n,i=-1,s=e.length;++i<s;){var o=t(e[i]);o!==r&&(n=n===r?o:n+o)}return n}function zt(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function $t(e){return e?e.slice(0,an(e)+1).replace(ie,""):e}function Ht(e){return function(t){return e(t)}}function Xt(e,t){return kt(t,function(t){return e[t]})}function Vt(e,t){return e.has(t)}function Bt(e,t){for(var n=-1,i=e.length;++n<i&&It(t,e[n],0)>-1;);return n}function Ut(e,t){for(var n=e.length;n--&&It(t,e[n],0)>-1;);return n}function qt(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var Gt=jt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Jt=jt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Kt(e){return"\\"+et[e]}function Qt(e){return qe.test(e)}function Zt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function en(e,t){return function(n){return e(t(n))}}function tn(e,t){for(var n=-1,i=e.length,r=0,s=[];++n<i;){var o=e[n];o!==t&&o!==a||(e[n]=a,s[r++]=n)}return s}function nn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function sn(e){return Qt(e)?function(e){for(var t=Be.lastIndex=0;Be.test(e);)++t;return t}(e):Lt(e)}function on(e){return Qt(e)?function(e){return e.match(Be)||[]}(e):function(e){return e.split("")}(e)}function an(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var cn=jt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),ln=function e(t){var n,i=(t=null==t?st:ln.defaults(st.Object(),t,ln.pick(st,Je))).Array,re=t.Date,we=t.Error,De=t.Function,Se=t.Math,xe=t.Object,ke=t.RegExp,Te=t.String,Me=t.TypeError,Ce=i.prototype,Oe=xe.prototype,Le=t["__core-js_shared__"],Ee=De.prototype.toString,Ae=Oe.hasOwnProperty,Ie=0,Re=(n=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Pe=Oe.toString,Fe=Ee.call(xe),We=st._,je=ke("^"+Ee.call(Ae).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ye=ct?t.Buffer:r,Ne=t.Symbol,ze=t.Uint8Array,$e=Ye?Ye.allocUnsafe:r,He=en(xe.getPrototypeOf,xe),Be=xe.create,qe=Oe.propertyIsEnumerable,et=Ce.splice,it=Ne?Ne.isConcatSpreadable:r,rt=Ne?Ne.iterator:r,ot=Ne?Ne.toStringTag:r,at=function(){try{var e=cs(xe,"defineProperty");return e({},"",{}),e}catch(t){}}(),lt=t.clearTimeout!==st.clearTimeout&&t.clearTimeout,ut=re&&re.now!==st.Date.now&&re.now,Lt=t.setTimeout!==st.setTimeout&&t.setTimeout,jt=Se.ceil,un=Se.floor,dn=xe.getOwnPropertySymbols,hn=Ye?Ye.isBuffer:r,fn=t.isFinite,pn=Ce.join,mn=en(xe.keys,xe),bn=Se.max,gn=Se.min,_n=re.now,vn=t.parseInt,yn=Se.random,wn=Ce.reverse,Dn=cs(t,"DataView"),Sn=cs(t,"Map"),xn=cs(t,"Promise"),kn=cs(t,"Set"),Tn=cs(t,"WeakMap"),Mn=cs(xe,"create"),Cn=Tn&&new Tn,On={},Ln=Ws(Dn),En=Ws(Sn),An=Ws(xn),In=Ws(kn),Rn=Ws(Tn),Pn=Ne?Ne.prototype:r,Fn=Pn?Pn.valueOf:r,Wn=Pn?Pn.toString:r;function jn(e){if(ta(e)&&!Xo(e)&&!(e instanceof $n)){if(e instanceof zn)return e;if(Ae.call(e,"__wrapped__"))return js(e)}return new zn(e)}var Yn=function(){function e(){}return function(t){if(!ea(t))return{};if(Be)return Be(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Nn(){}function zn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function $n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vn;++t<n;)this.add(e[t])}function Un(e){var t=this.__data__=new Xn(e);this.size=t.size}function qn(e,t){var n=Xo(e),i=!n&&Ho(e),r=!n&&!i&&qo(e),s=!n&&!i&&!r&&la(e),o=n||i||r||s,a=o?zt(e.length,Te):[],c=a.length;for(var l in e)!t&&!Ae.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ms(l,c))||a.push(l);return a}function Gn(e){var t=e.length;return t?e[Vi(0,t-1)]:r}function Jn(e,t){return As(Tr(e),si(t,0,e.length))}function Kn(e){return As(Tr(e))}function Qn(e,t,n){(n!==r&&!No(e[t],n)||n===r&&!(t in e))&&ii(e,t,n)}function Zn(e,t,n){var i=e[t];Ae.call(e,t)&&No(i,n)&&(n!==r||t in e)||ii(e,t,n)}function ei(e,t){for(var n=e.length;n--;)if(No(e[n][0],t))return n;return-1}function ti(e,t,n,i){return ui(e,function(e,r,s){t(i,e,n(e),s)}),i}function ni(e,t){return e&&Mr(t,Ea(t),e)}function ii(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ri(e,t){for(var n=-1,s=t.length,o=i(s),a=null==e;++n<s;)o[n]=a?r:Ta(e,t[n]);return o}function si(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function oi(e,t,n,i,s,o){var a,c=1&t,l=2&t,u=4&t;if(n&&(a=s?n(e,i,s,o):n(e)),a!==r)return a;if(!ea(e))return e;var d=Xo(e);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!c)return Tr(e,a)}else{var h=ds(e),f=h==y||h==w;if(qo(e))return yr(e,c);if(h==x||h==m||f&&!s){if(a=l||f?{}:fs(e),!c)return l?function(e,t){return Mr(e,us(e),t)}(e,function(e,t){return e&&Mr(t,Aa(t),e)}(a,e)):function(e,t){return Mr(e,ls(e),t)}(e,ni(a,e))}else{if(!Ze[h])return s?e:{};a=function(e,t,n){var i=e.constructor;switch(t){case E:return wr(e);case g:case _:return new i(+e);case A:return function(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case R:case P:case F:case W:case j:case Y:case N:case z:return Dr(e,n);case D:return new i;case S:case C:return new i(e);case T:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new i;case O:return Fn?xe(Fn.call(e)):{}}}(e,h,c)}}o||(o=new Un);var p=o.get(e);if(p)return p;o.set(e,a),oa(e)?e.forEach(function(i){a.add(oi(i,t,n,i,e,o))}):na(e)&&e.forEach(function(i,r){a.set(r,oi(i,t,n,r,e,o))});var b=d?r:(u?l?ts:es:l?Aa:Ea)(e);return vt(b||e,function(i,r){b&&(i=e[r=i]),Zn(a,r,oi(i,t,n,r,e,o))}),a}function ai(e,t,n){var i=n.length;if(null==e)return!i;for(e=xe(e);i--;){var s=n[i],o=e[s];if(o===r&&!(s in e)||!(0,t[s])(o))return!1}return!0}function ci(e,t,n){if("function"!=typeof e)throw new Me(s);return Cs(function(){e.apply(r,n)},t)}function li(e,t,n,i){var r=-1,s=St,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=kt(t,Ht(n))),i?(s=xt,o=!1):t.length>=200&&(s=Vt,o=!1,t=new Bn(t));e:for(;++r<a;){var u=e[r],d=null==n?u:n(u);if(u=i||0!==u?u:0,o&&d==d){for(var h=l;h--;)if(t[h]===d)continue e;c.push(u)}else s(t,d,i)||c.push(u)}return c}jn.templateSettings={escape:G,evaluate:J,interpolate:K,variable:"",imports:{_:jn}},(jn.prototype=Nn.prototype).constructor=jn,(zn.prototype=Yn(Nn.prototype)).constructor=zn,($n.prototype=Yn(Nn.prototype)).constructor=$n,Hn.prototype.clear=function(){this.__data__=Mn?Mn(null):{},this.size=0},Hn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hn.prototype.get=function(e){var t=this.__data__;if(Mn){var n=t[e];return n===o?r:n}return Ae.call(t,e)?t[e]:r},Hn.prototype.has=function(e){var t=this.__data__;return Mn?t[e]!==r:Ae.call(t,e)},Hn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mn&&t===r?o:t,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=ei(t,e);return!(n<0||(n==t.length-1?t.pop():et.call(t,n,1),--this.size,0))},Xn.prototype.get=function(e){var t=this.__data__,n=ei(t,e);return n<0?r:t[n][1]},Xn.prototype.has=function(e){return ei(this.__data__,e)>-1},Xn.prototype.set=function(e,t){var n=this.__data__,i=ei(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(Sn||Xn),string:new Hn}},Vn.prototype.delete=function(e){var t=os(this,e).delete(e);return this.size-=t?1:0,t},Vn.prototype.get=function(e){return os(this,e).get(e)},Vn.prototype.has=function(e){return os(this,e).has(e)},Vn.prototype.set=function(e,t){var n=os(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Bn.prototype.add=Bn.prototype.push=function(e){return this.__data__.set(e,o),this},Bn.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.clear=function(){this.__data__=new Xn,this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Un.prototype.get=function(e){return this.__data__.get(e)},Un.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xn){var i=n.__data__;if(!Sn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vn(i)}return n.set(e,t),this.size=n.size,this};var ui=Lr(_i),di=Lr(vi,!0);function hi(e,t){var n=!0;return ui(e,function(e,i,r){return n=!!t(e,i,r)}),n}function fi(e,t,n){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(c===r?a==a&&!ca(a):n(a,c)))var c=a,l=o}return l}function pi(e,t){var n=[];return ui(e,function(e,i,r){t(e,i,r)&&n.push(e)}),n}function mi(e,t,n,i,r){var s=-1,o=e.length;for(n||(n=ps),r||(r=[]);++s<o;){var a=e[s];t>0&&n(a)?t>1?mi(a,t-1,n,i,r):Tt(r,a):i||(r[r.length]=a)}return r}var bi=Er(),gi=Er(!0);function _i(e,t){return e&&bi(e,t,Ea)}function vi(e,t){return e&&gi(e,t,Ea)}function yi(e,t){return Dt(t,function(t){return Ko(e[t])})}function wi(e,t){for(var n=0,i=(t=br(t,e)).length;null!=e&&n<i;)e=e[Fs(t[n++])];return n&&n==i?e:r}function Di(e,t,n){var i=t(e);return Xo(e)?i:Tt(i,n(e))}function Si(e){return null==e?e===r?"[object Undefined]":"[object Null]":ot&&ot in xe(e)?function(e){var t=Ae.call(e,ot),n=e[ot];try{e[ot]=r;var i=!0}catch(o){}var s=Pe.call(e);return i&&(t?e[ot]=n:delete e[ot]),s}(e):function(e){return Pe.call(e)}(e)}function xi(e,t){return e>t}function ki(e,t){return null!=e&&Ae.call(e,t)}function Ti(e,t){return null!=e&&t in xe(e)}function Mi(e,t,n){for(var s=n?xt:St,o=e[0].length,a=e.length,c=a,l=i(a),u=1/0,d=[];c--;){var h=e[c];c&&t&&(h=kt(h,Ht(t))),u=gn(h.length,u),l[c]=!n&&(t||o>=120&&h.length>=120)?new Bn(c&&h):r}h=e[0];var f=-1,p=l[0];e:for(;++f<o&&d.length<u;){var m=h[f],b=t?t(m):m;if(m=n||0!==m?m:0,!(p?Vt(p,b):s(d,b,n))){for(c=a;--c;){var g=l[c];if(!(g?Vt(g,b):s(e[c],b,n)))continue e}p&&p.push(b),d.push(m)}}return d}function Ci(e,t,n){var i=null==(e=xs(e,t=br(t,e)))?e:e[Fs(Gs(t))];return null==i?r:gt(i,e,n)}function Oi(e){return ta(e)&&Si(e)==m}function Li(e,t,n,i,s){return e===t||(null==e||null==t||!ta(e)&&!ta(t)?e!=e&&t!=t:function(e,t,n,i,s,o){var a=Xo(e),c=Xo(t),l=a?b:ds(e),u=c?b:ds(t),d=(l=l==m?x:l)==x,h=(u=u==m?x:u)==x,f=l==u;if(f&&qo(e)){if(!qo(t))return!1;a=!0,d=!1}if(f&&!d)return o||(o=new Un),a||la(e)?Qr(e,t,n,i,s,o):function(e,t,n,i,r,s,o){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!s(new ze(e),new ze(t)));case g:case _:case S:return No(+e,+t);case v:return e.name==t.name&&e.message==t.message;case T:case C:return e==t+"";case D:var a=Zt;case M:if(a||(a=nn),e.size!=t.size&&!(1&i))return!1;var c=o.get(e);if(c)return c==t;i|=2,o.set(e,t);var l=Qr(a(e),a(t),i,r,s,o);return o.delete(e),l;case O:if(Fn)return Fn.call(e)==Fn.call(t)}return!1}(e,t,l,n,i,s,o);if(!(1&n)){var p=d&&Ae.call(e,"__wrapped__"),y=h&&Ae.call(t,"__wrapped__");if(p||y){var w=p?e.value():e,k=y?t.value():t;return o||(o=new Un),s(w,k,n,i,o)}}return!!f&&(o||(o=new Un),function(e,t,n,i,s,o){var a=1&n,c=es(e),l=c.length;if(l!=es(t).length&&!a)return!1;for(var u=l;u--;){var d=c[u];if(!(a?d in t:Ae.call(t,d)))return!1}var h=o.get(e),f=o.get(t);if(h&&f)return h==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++u<l;){var b=e[d=c[u]],g=t[d];if(i)var _=a?i(g,b,d,t,e,o):i(b,g,d,e,t,o);if(!(_===r?b===g||s(b,g,n,i,o):_)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,i,s,o))}(e,t,n,i,Li,s))}function Ei(e,t,n,i){var s=n.length,o=s,a=!i;if(null==e)return!o;for(e=xe(e);s--;){var c=n[s];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s<o;){var l=(c=n[s])[0],u=e[l],d=c[1];if(a&&c[2]){if(u===r&&!(l in e))return!1}else{var h=new Un;if(i)var f=i(u,d,l,e,t,h);if(!(f===r?Li(d,u,3,i,h):f))return!1}}return!0}function Ai(e){return!(!ea(e)||(t=e,Re&&Re in t))&&(Ko(e)?je:me).test(Ws(e));var t}function Ii(e){return"function"==typeof e?e:null==e?ic:"object"==typeof e?Xo(e)?ji(e[0],e[1]):Wi(e):hc(e)}function Ri(e){if(!ys(e))return mn(e);var t=[];for(var n in xe(e))Ae.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Pi(e,t){return e<t}function Fi(e,t){var n=-1,r=Bo(e)?i(e.length):[];return ui(e,function(e,i,s){r[++n]=t(e,i,s)}),r}function Wi(e){var t=as(e);return 1==t.length&&t[0][2]?Ds(t[0][0],t[0][1]):function(n){return n===e||Ei(n,e,t)}}function ji(e,t){return gs(e)&&ws(t)?Ds(Fs(e),t):function(n){var i=Ta(n,e);return i===r&&i===t?Ma(n,e):Li(t,i,3)}}function Yi(e,t,n,i,s){e!==t&&bi(t,function(o,a){if(s||(s=new Un),ea(o))!function(e,t,n,i,s,o,a){var c=Ts(e,n),l=Ts(t,n),u=a.get(l);if(u)Qn(e,n,u);else{var d=o?o(c,l,n+"",e,t,a):r,h=d===r;if(h){var f=Xo(l),p=!f&&qo(l),m=!f&&!p&&la(l);d=l,f||p||m?Xo(c)?d=c:Uo(c)?d=Tr(c):p?(h=!1,d=yr(l,!0)):m?(h=!1,d=Dr(l,!0)):d=[]:ra(l)||Ho(l)?(d=c,Ho(c)?d=ga(c):ea(c)&&!Ko(c)||(d=fs(l))):h=!1}h&&(a.set(l,d),s(d,l,i,o,a),a.delete(l)),Qn(e,n,d)}}(e,t,a,n,Yi,i,s);else{var c=i?i(Ts(e,a),o,a+"",e,t,s):r;c===r&&(c=o),Qn(e,a,c)}},Aa)}function Ni(e,t){var n=e.length;if(n)return ms(t+=t<0?n:0,n)?e[t]:r}function zi(e,t,n){t=t.length?kt(t,function(e){return Xo(e)?function(t){return wi(t,1===e.length?e[0]:e)}:e}):[ic];var i=-1;return t=kt(t,Ht(ss())),function(e,t){var i=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var i=-1,r=e.criteria,s=t.criteria,o=r.length,a=n.length;++i<o;){var c=Sr(r[i],s[i]);if(c)return i>=a?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)});i--;)e[i]=e[i].value;return e}(Fi(e,function(e,n,r){return{criteria:kt(t,function(t){return t(e)}),index:++i,value:e}}))}function $i(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var o=t[i],a=wi(e,o);n(a,o)&&Ji(s,br(o,e),a)}return s}function Hi(e,t,n,i){var r=i?Rt:It,s=-1,o=t.length,a=e;for(e===t&&(t=Tr(t)),n&&(a=kt(e,Ht(n)));++s<o;)for(var c=0,l=t[s],u=n?n(l):l;(c=r(a,u,c,i))>-1;)a!==e&&et.call(a,c,1),et.call(e,c,1);return e}function Xi(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==s){var s=r;ms(r)?et.call(e,r,1):cr(e,r)}}return e}function Vi(e,t){return e+un(yn()*(t-e+1))}function Bi(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=un(t/2))&&(e+=e)}while(t);return n}function Ui(e,t){return Os(Ss(e,t,ic),e+"")}function qi(e){return Gn(Na(e))}function Gi(e,t){var n=Na(e);return As(n,si(t,0,n.length))}function Ji(e,t,n,i){if(!ea(e))return e;for(var s=-1,o=(t=br(t,e)).length,a=o-1,c=e;null!=c&&++s<o;){var l=Fs(t[s]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(s!=a){var d=c[l];(u=i?i(d,l,c):r)===r&&(u=ea(d)?d:ms(t[s+1])?[]:{})}Zn(c,l,u),c=c[l]}return e}var Ki=Cn?function(e,t){return Cn.set(e,t),e}:ic,Qi=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:ec(t),writable:!0})}:ic;function Zi(e){return As(Na(e))}function er(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=i(s);++r<s;)o[r]=e[r+t];return o}function tr(e,t){var n;return ui(e,function(e,i,r){return!(n=t(e,i,r))}),!!n}function nr(e,t,n){var i=0,r=null==e?i:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;i<r;){var s=i+r>>>1,o=e[s];null!==o&&!ca(o)&&(n?o<=t:o<t)?i=s+1:r=s}return r}return ir(e,t,ic,n)}function ir(e,t,n,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,c=null===t,l=ca(t),u=t===r;s<o;){var d=un((s+o)/2),h=n(e[d]),f=h!==r,p=null===h,m=h==h,b=ca(h);if(a)var g=i||m;else g=u?m&&(i||f):c?m&&f&&(i||!p):l?m&&f&&!p&&(i||!b):!p&&!b&&(i?h<=t:h<t);g?s=d+1:o=d}return gn(o,4294967294)}function rr(e,t){for(var n=-1,i=e.length,r=0,s=[];++n<i;){var o=e[n],a=t?t(o):o;if(!n||!No(a,c)){var c=a;s[r++]=0===o?0:o}}return s}function sr(e){return"number"==typeof e?e:ca(e)?h:+e}function or(e){if("string"==typeof e)return e;if(Xo(e))return kt(e,or)+"";if(ca(e))return Wn?Wn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ar(e,t,n){var i=-1,r=St,s=e.length,o=!0,a=[],c=a;if(n)o=!1,r=xt;else if(s>=200){var l=t?null:Br(e);if(l)return nn(l);o=!1,r=Vt,c=new Bn}else c=t?[]:a;e:for(;++i<s;){var u=e[i],d=t?t(u):u;if(u=n||0!==u?u:0,o&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),a.push(u)}else r(c,d,n)||(c!==a&&c.push(d),a.push(u))}return a}function cr(e,t){return null==(e=xs(e,t=br(t,e)))||delete e[Fs(Gs(t))]}function lr(e,t,n,i){return Ji(e,t,n(wi(e,t)),i)}function ur(e,t,n,i){for(var r=e.length,s=i?r:-1;(i?s--:++s<r)&&t(e[s],s,e););return n?er(e,i?0:s,i?s+1:r):er(e,i?s+1:0,i?r:s)}function dr(e,t){var n=e;return n instanceof $n&&(n=n.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Tt([e],t.args))},n)}function hr(e,t,n){var r=e.length;if(r<2)return r?ar(e[0]):[];for(var s=-1,o=i(r);++s<r;)for(var a=e[s],c=-1;++c<r;)c!=s&&(o[s]=li(o[s]||a,e[c],t,n));return ar(mi(o,1),t,n)}function fr(e,t,n){for(var i=-1,s=e.length,o=t.length,a={};++i<s;)n(a,e[i],i<o?t[i]:r);return a}function pr(e){return Uo(e)?e:[]}function mr(e){return"function"==typeof e?e:ic}function br(e,t){return Xo(e)?e:gs(e,t)?[e]:Ps(_a(e))}var gr=Ui;function _r(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:er(e,t,n)}var vr=lt||function(e){return st.clearTimeout(e)};function yr(e,t){if(t)return e.slice();var n=e.length,i=$e?$e(n):new e.constructor(n);return e.copy(i),i}function wr(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function Dr(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Sr(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,o=ca(e),a=t!==r,c=null===t,l=t==t,u=ca(t);if(!c&&!u&&!o&&e>t||o&&a&&l&&!c&&!u||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!u&&e<t||u&&n&&s&&!i&&!o||c&&n&&s||!a&&s||!l)return-1}return 0}function xr(e,t,n,r){for(var s=-1,o=e.length,a=n.length,c=-1,l=t.length,u=bn(o-a,0),d=i(l+u),h=!r;++c<l;)d[c]=t[c];for(;++s<a;)(h||s<o)&&(d[n[s]]=e[s]);for(;u--;)d[c++]=e[s++];return d}function kr(e,t,n,r){for(var s=-1,o=e.length,a=-1,c=n.length,l=-1,u=t.length,d=bn(o-c,0),h=i(d+u),f=!r;++s<d;)h[s]=e[s];for(var p=s;++l<u;)h[p+l]=t[l];for(;++a<c;)(f||s<o)&&(h[p+n[a]]=e[s++]);return h}function Tr(e,t){var n=-1,r=e.length;for(t||(t=i(r));++n<r;)t[n]=e[n];return t}function Mr(e,t,n,i){var s=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],l=i?i(n[c],e[c],c,n,e):r;l===r&&(l=e[c]),s?ii(n,c,l):Zn(n,c,l)}return n}function Cr(e,t){return function(n,i){var r=Xo(n)?_t:ti,s=t?t():{};return r(n,e,ss(i,2),s)}}function Or(e){return Ui(function(t,n){var i=-1,s=n.length,o=s>1?n[s-1]:r,a=s>2?n[2]:r;for(o=e.length>3&&"function"==typeof o?(s--,o):r,a&&bs(n[0],n[1],a)&&(o=s<3?r:o,s=1),t=xe(t);++i<s;){var c=n[i];c&&e(t,c,i,o)}return t})}function Lr(e,t){return function(n,i){if(null==n)return n;if(!Bo(n))return e(n,i);for(var r=n.length,s=t?r:-1,o=xe(n);(t?s--:++s<r)&&!1!==i(o[s],s,o););return n}}function Er(e){return function(t,n,i){for(var r=-1,s=xe(t),o=i(t),a=o.length;a--;){var c=o[e?a:++r];if(!1===n(s[c],c,s))break}return t}}function Ar(e){return function(t){var n=Qt(t=_a(t))?on(t):r,i=n?n[0]:t.charAt(0),s=n?_r(n,1).join(""):t.slice(1);return i[e]()+s}}function Ir(e){return function(t){return Mt(Ka(Ha(t).replace(Xe,"")),e,"")}}function Rr(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Yn(e.prototype),i=e.apply(n,t);return ea(i)?i:n}}function Pr(e){return function(t,n,i){var s=xe(t);if(!Bo(t)){var o=ss(n,3);t=Ea(t),n=function(e){return o(s[e],e,s)}}var a=e(t,n,i);return a>-1?s[o?t[a]:a]:r}}function Fr(e){return Zr(function(t){var n=t.length,i=n,o=zn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Me(s);if(o&&!c&&"wrapper"==is(a))var c=new zn([],!0)}for(i=c?i:n;++i<n;){var l=is(a=t[i]),u="wrapper"==l?ns(a):r;c=u&&_s(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[is(u[0])].apply(c,u[3]):1==a.length&&_s(a)?c[l]():c.thru(a)}return function(){var e=arguments,i=e[0];if(c&&1==e.length&&Xo(i))return c.plant(i).value();for(var r=0,s=n?t[r].apply(this,e):i;++r<n;)s=t[r].call(this,s);return s}})}function Wr(e,t,n,s,o,a,c,u,d,h){var f=t&l,p=1&t,m=2&t,b=24&t,g=512&t,_=m?r:Rr(e);return function r(){for(var l=arguments.length,v=i(l),y=l;y--;)v[y]=arguments[y];if(b)var w=rs(r),D=qt(v,w);if(s&&(v=xr(v,s,o,b)),a&&(v=kr(v,a,c,b)),l-=D,b&&l<h){var S=tn(v,w);return Xr(e,t,Wr,r.placeholder,n,v,S,u,d,h-l)}var x=p?n:this,k=m?x[e]:e;return l=v.length,u?v=ks(v,u):g&&l>1&&v.reverse(),f&&d<l&&(v.length=d),this&&this!==st&&this instanceof r&&(k=_||Rr(k)),k.apply(x,v)}}function jr(e,t){return function(n,i){return function(e,t,n,i){return _i(e,function(e,r,s){t(i,n(e),r,s)}),i}(n,e,t(i),{})}}function Yr(e,t){return function(n,i){var s;if(n===r&&i===r)return t;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=or(n),i=or(i)):(n=sr(n),i=sr(i)),s=e(n,i)}return s}}function Nr(e){return Zr(function(t){return t=kt(t,Ht(ss())),Ui(function(n){var i=this;return e(t,function(e){return gt(e,i,n)})})})}function zr(e,t){var n=(t=t===r?" ":or(t)).length;if(n<2)return n?Bi(t,e):t;var i=Bi(t,jt(e/sn(t)));return Qt(t)?_r(on(i),0,e).join(""):i.slice(0,e)}function $r(e){return function(t,n,s){return s&&"number"!=typeof s&&bs(t,n,s)&&(n=s=r),t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,n,r){for(var s=-1,o=bn(jt((t-e)/(n||1)),0),a=i(o);o--;)a[r?o:++s]=e,e+=n;return a}(t,n,s=s===r?t<n?1:-1:fa(s),e)}}function Hr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ba(t),n=ba(n)),e(t,n)}}function Xr(e,t,n,i,s,o,a,l,u,d){var h=8&t;t|=h?c:64,4&(t&=~(h?64:c))||(t&=-4);var f=[e,t,s,h?o:r,h?a:r,h?r:o,h?r:a,l,u,d],p=n.apply(r,f);return _s(e)&&Ms(p,f),p.placeholder=i,Ls(p,e,t)}function Vr(e){var t=Se[e];return function(e,n){if(e=ba(e),(n=null==n?0:gn(pa(n),292))&&fn(e)){var i=(_a(e)+"e").split("e");return+((i=(_a(t(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return t(e)}}var Br=kn&&1/nn(new kn([,-0]))[1]==u?function(e){return new kn(e)}:cc;function Ur(e){return function(t){var n=ds(t);return n==D?Zt(t):n==M?rn(t):function(e,t){return kt(t,function(t){return[t,e[t]]})}(t,e(t))}}function qr(e,t,n,o,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Me(s);var m=o?o.length:0;if(m||(t&=-97,o=u=r),h=h===r?h:bn(pa(h),0),f=f===r?f:pa(f),m-=u?u.length:0,64&t){var b=o,g=u;o=u=r}var _=p?r:ns(e),v=[e,t,n,o,u,b,g,d,h,f];if(_&&function(e,t){var n=e[1],i=t[1],r=n|i;if(!(r<131||i==l&&8==n||i==l&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],r|=1&n?0:4);var s=t[3];if(s){var o=e[3];e[3]=o?xr(o,s,t[4]):s,e[4]=o?tn(e[3],a):t[4]}(s=t[5])&&(e[5]=(o=e[5])?kr(o,s,t[6]):s,e[6]=o?tn(e[5],a):t[6]),(s=t[7])&&(e[7]=s),i&l&&(e[8]=null==e[8]?t[8]:gn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(v,_),e=v[0],t=v[1],n=v[2],o=v[3],u=v[4],!(f=v[9]=v[9]===r?p?0:e.length:bn(v[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)y=8==t||16==t?function(e,t,n){var s=Rr(e);return function o(){for(var a=arguments.length,c=i(a),l=a,u=rs(o);l--;)c[l]=arguments[l];var d=a<3&&c[0]!==u&&c[a-1]!==u?[]:tn(c,u);return(a-=d.length)<n?Xr(e,t,Wr,o.placeholder,r,c,d,r,r,n-a):gt(this&&this!==st&&this instanceof o?s:e,this,c)}}(e,t,f):t!=c&&33!=t||u.length?Wr.apply(r,v):function(e,t,n,r){var s=1&t,o=Rr(e);return function t(){for(var a=-1,c=arguments.length,l=-1,u=r.length,d=i(u+c),h=this&&this!==st&&this instanceof t?o:e;++l<u;)d[l]=r[l];for(;c--;)d[l++]=arguments[++a];return gt(h,s?n:this,d)}}(e,t,n,o);else var y=function(e,t,n){var i=1&t,r=Rr(e);return function t(){return(this&&this!==st&&this instanceof t?r:e).apply(i?n:this,arguments)}}(e,t,n);return Ls((_?Ki:Ms)(y,v),e,t)}function Gr(e,t,n,i){return e===r||No(e,Oe[n])&&!Ae.call(i,n)?t:e}function Jr(e,t,n,i,s,o){return ea(e)&&ea(t)&&(o.set(t,e),Yi(e,t,r,Jr,o),o.delete(t)),e}function Kr(e){return ra(e)?r:e}function Qr(e,t,n,i,s,o){var a=1&n,c=e.length,l=t.length;if(c!=l&&!(a&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&n?new Bn:r;for(o.set(e,t),o.set(t,e);++h<c;){var m=e[h],b=t[h];if(i)var g=a?i(b,m,h,t,e,o):i(m,b,h,e,t,o);if(g!==r){if(g)continue;f=!1;break}if(p){if(!Ot(t,function(e,t){if(!Vt(p,t)&&(m===e||s(m,e,n,i,o)))return p.push(t)})){f=!1;break}}else if(m!==b&&!s(m,b,n,i,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Zr(e){return Os(Ss(e,r,Xs),e+"")}function es(e){return Di(e,Ea,ls)}function ts(e){return Di(e,Aa,us)}var ns=Cn?function(e){return Cn.get(e)}:cc;function is(e){for(var t=e.name+"",n=On[t],i=Ae.call(On,t)?n.length:0;i--;){var r=n[i],s=r.func;if(null==s||s==e)return r.name}return t}function rs(e){return(Ae.call(jn,"placeholder")?jn:e).placeholder}function ss(){var e=jn.iteratee||rc;return e=e===rc?Ii:e,arguments.length?e(arguments[0],arguments[1]):e}function os(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function as(e){for(var t=Ea(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,ws(r)]}return t}function cs(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Ai(n)?n:r}var ls=dn?function(e){return null==e?[]:(e=xe(e),Dt(dn(e),function(t){return qe.call(e,t)}))}:mc,us=dn?function(e){for(var t=[];e;)Tt(t,ls(e)),e=He(e);return t}:mc,ds=Si;function hs(e,t,n){for(var i=-1,r=(t=br(t,e)).length,s=!1;++i<r;){var o=Fs(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=r?s:!!(r=null==e?0:e.length)&&Zo(r)&&ms(o,r)&&(Xo(e)||Ho(e))}function fs(e){return"function"!=typeof e.constructor||ys(e)?{}:Yn(He(e))}function ps(e){return Xo(e)||Ho(e)||!!(it&&e&&e[it])}function ms(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function bs(e,t,n){if(!ea(n))return!1;var i=typeof t;return!!("number"==i?Bo(n)&&ms(t,n.length):"string"==i&&t in n)&&No(n[t],e)}function gs(e,t){if(Xo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ca(e))||Z.test(e)||!Q.test(e)||null!=t&&e in xe(t)}function _s(e){var t=is(e),n=jn[t];if("function"!=typeof n||!(t in $n.prototype))return!1;if(e===n)return!0;var i=ns(n);return!!i&&e===i[0]}(Dn&&ds(new Dn(new ArrayBuffer(1)))!=A||Sn&&ds(new Sn)!=D||xn&&ds(xn.resolve())!=k||kn&&ds(new kn)!=M||Tn&&ds(new Tn)!=L)&&(ds=function(e){var t=Si(e),n=t==x?e.constructor:r,i=n?Ws(n):"";if(i)switch(i){case Ln:return A;case En:return D;case An:return k;case In:return M;case Rn:return L}return t});var vs=Le?Ko:bc;function ys(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function ws(e){return e==e&&!ea(e)}function Ds(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in xe(n))}}function Ss(e,t,n){return t=bn(t===r?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=bn(r.length-t,0),a=i(o);++s<o;)a[s]=r[t+s];s=-1;for(var c=i(t+1);++s<t;)c[s]=r[s];return c[t]=n(a),gt(e,this,c)}}function xs(e,t){return t.length<2?e:wi(e,er(t,0,-1))}function ks(e,t){for(var n=e.length,i=gn(t.length,n),s=Tr(e);i--;){var o=t[i];e[i]=ms(o,n)?s[o]:r}return e}function Ts(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ms=Es(Ki),Cs=Lt||function(e,t){return st.setTimeout(e,t)},Os=Es(Qi);function Ls(e,t,n){var i=t+"";return Os(e,function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return vt(p,function(n){var i="_."+n[0];t&n[1]&&!St(e,i)&&e.push(i)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(i),n)))}function Es(e){var t=0,n=0;return function(){var i=_n(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function As(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n<t;){var o=Vi(n,s),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Is,Rs,Ps=(Is=Ro(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,function(e,n,i,r){t.push(i?r.replace(ue,"$1"):n||e)}),t},function(e){return 500===Rs.size&&Rs.clear(),e}),Rs=Is.cache,Is);function Fs(e){if("string"==typeof e||ca(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ws(e){if(null!=e){try{return Ee.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function js(e){if(e instanceof $n)return e.clone();var t=new zn(e.__wrapped__,e.__chain__);return t.__actions__=Tr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ys=Ui(function(e,t){return Uo(e)?li(e,mi(t,1,Uo,!0)):[]}),Ns=Ui(function(e,t){var n=Gs(t);return Uo(n)&&(n=r),Uo(e)?li(e,mi(t,1,Uo,!0),ss(n,2)):[]}),zs=Ui(function(e,t){var n=Gs(t);return Uo(n)&&(n=r),Uo(e)?li(e,mi(t,1,Uo,!0),r,n):[]});function $s(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:pa(n);return r<0&&(r=bn(i+r,0)),At(e,ss(t,3),r)}function Hs(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==r&&(s=pa(n),s=n<0?bn(i+s,0):gn(s,i-1)),At(e,ss(t,3),s,!0)}function Xs(e){return null!=e&&e.length?mi(e,1):[]}function Vs(e){return e&&e.length?e[0]:r}var Bs=Ui(function(e){var t=kt(e,pr);return t.length&&t[0]===e[0]?Mi(t):[]}),Us=Ui(function(e){var t=Gs(e),n=kt(e,pr);return t===Gs(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Mi(n,ss(t,2)):[]}),qs=Ui(function(e){var t=Gs(e),n=kt(e,pr);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Mi(n,r,t):[]});function Gs(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Js=Ui(Ks);function Ks(e,t){return e&&e.length&&t&&t.length?Hi(e,t):e}var Qs=Zr(function(e,t){var n=null==e?0:e.length,i=ri(e,t);return Xi(e,kt(t,function(e){return ms(e,n)?+e:e}).sort(Sr)),i});function Zs(e){return null==e?e:wn.call(e)}var eo=Ui(function(e){return ar(mi(e,1,Uo,!0))}),to=Ui(function(e){var t=Gs(e);return Uo(t)&&(t=r),ar(mi(e,1,Uo,!0),ss(t,2))}),no=Ui(function(e){var t=Gs(e);return t="function"==typeof t?t:r,ar(mi(e,1,Uo,!0),r,t)});function io(e){if(!e||!e.length)return[];var t=0;return e=Dt(e,function(e){if(Uo(e))return t=bn(e.length,t),!0}),zt(t,function(t){return kt(e,Wt(t))})}function ro(e,t){if(!e||!e.length)return[];var n=io(e);return null==t?n:kt(n,function(e){return gt(t,r,e)})}var so=Ui(function(e,t){return Uo(e)?li(e,t):[]}),oo=Ui(function(e){return hr(Dt(e,Uo))}),ao=Ui(function(e){var t=Gs(e);return Uo(t)&&(t=r),hr(Dt(e,Uo),ss(t,2))}),co=Ui(function(e){var t=Gs(e);return t="function"==typeof t?t:r,hr(Dt(e,Uo),r,t)}),lo=Ui(io),uo=Ui(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ro(e,n)});function ho(e){var t=jn(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var po=Zr(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return ri(t,e)};return!(t>1||this.__actions__.length)&&i instanceof $n&&ms(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:fo,args:[s],thisArg:r}),new zn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(s)}),mo=Cr(function(e,t,n){Ae.call(e,n)?++e[n]:ii(e,n,1)}),bo=Pr($s),go=Pr(Hs);function _o(e,t){return(Xo(e)?vt:ui)(e,ss(t,3))}function vo(e,t){return(Xo(e)?yt:di)(e,ss(t,3))}var yo=Cr(function(e,t,n){Ae.call(e,n)?e[n].push(t):ii(e,n,[t])}),wo=Ui(function(e,t,n){var r=-1,s="function"==typeof t,o=Bo(e)?i(e.length):[];return ui(e,function(e){o[++r]=s?gt(t,e,n):Ci(e,t,n)}),o}),Do=Cr(function(e,t,n){ii(e,n,t)});function So(e,t){return(Xo(e)?kt:Fi)(e,ss(t,3))}var xo=Cr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ko=Ui(function(e,t){if(null==e)return[];var n=t.length;return n>1&&bs(e,t[0],t[1])?t=[]:n>2&&bs(t[0],t[1],t[2])&&(t=[t[0]]),zi(e,mi(t,1),[])}),To=ut||function(){return st.Date.now()};function Mo(e,t,n){return t=n?r:t,qr(e,l,r,r,r,r,t=e&&null==t?e.length:t)}function Co(e,t){var n;if("function"!=typeof t)throw new Me(s);return e=pa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Oo=Ui(function(e,t,n){var i=1;if(n.length){var r=tn(n,rs(Oo));i|=c}return qr(e,i,t,n,r)}),Lo=Ui(function(e,t,n){var i=3;if(n.length){var r=tn(n,rs(Lo));i|=c}return qr(t,i,e,n,r)});function Eo(e,t,n){var i,o,a,c,l,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Me(s);function m(t){var n=i,s=o;return i=o=r,d=t,c=e.apply(s,n)}function b(e){return d=e,l=Cs(_,t),h?m(e):c}function g(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=a}function _(){var e=To();if(g(e))return v(e);l=Cs(_,function(e){var n=t-(e-u);return f?gn(n,a-(e-d)):n}(e))}function v(e){return l=r,p&&i?m(e):(i=o=r,c)}function y(){var e=To(),n=g(e);if(i=arguments,o=this,u=e,n){if(l===r)return b(u);if(f)return vr(l),l=Cs(_,t),m(u)}return l===r&&(l=Cs(_,t)),c}return t=ba(t)||0,ea(n)&&(h=!!n.leading,a=(f="maxWait"in n)?bn(ba(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),y.cancel=function(){l!==r&&vr(l),d=0,i=u=o=l=r},y.flush=function(){return l===r?c:v(To())},y}var Ao=Ui(function(e,t){return ci(e,1,t)}),Io=Ui(function(e,t,n){return ci(e,ba(t)||0,n)});function Ro(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(s);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Ro.Cache||Vn),n}function Po(e){if("function"!=typeof e)throw new Me(s);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ro.Cache=Vn;var Fo=gr(function(e,t){var n=(t=1==t.length&&Xo(t[0])?kt(t[0],Ht(ss())):kt(mi(t,1),Ht(ss()))).length;return Ui(function(i){for(var r=-1,s=gn(i.length,n);++r<s;)i[r]=t[r].call(this,i[r]);return gt(e,this,i)})}),Wo=Ui(function(e,t){var n=tn(t,rs(Wo));return qr(e,c,r,t,n)}),jo=Ui(function(e,t){var n=tn(t,rs(jo));return qr(e,64,r,t,n)}),Yo=Zr(function(e,t){return qr(e,256,r,r,r,t)});function No(e,t){return e===t||e!=e&&t!=t}var zo=Hr(xi),$o=Hr(function(e,t){return e>=t}),Ho=Oi(function(){return arguments}())?Oi:function(e){return ta(e)&&Ae.call(e,"callee")&&!qe.call(e,"callee")},Xo=i.isArray,Vo=dt?Ht(dt):function(e){return ta(e)&&Si(e)==E};function Bo(e){return null!=e&&Zo(e.length)&&!Ko(e)}function Uo(e){return ta(e)&&Bo(e)}var qo=hn||bc,Go=ht?Ht(ht):function(e){return ta(e)&&Si(e)==_};function Jo(e){if(!ta(e))return!1;var t=Si(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ko(e){if(!ea(e))return!1;var t=Si(e);return t==y||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==pa(e)}function Zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function ea(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ta(e){return null!=e&&"object"==typeof e}var na=ft?Ht(ft):function(e){return ta(e)&&ds(e)==D};function ia(e){return"number"==typeof e||ta(e)&&Si(e)==S}function ra(e){if(!ta(e)||Si(e)!=x)return!1;var t=He(e);if(null===t)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ee.call(n)==Fe}var sa=pt?Ht(pt):function(e){return ta(e)&&Si(e)==T},oa=mt?Ht(mt):function(e){return ta(e)&&ds(e)==M};function aa(e){return"string"==typeof e||!Xo(e)&&ta(e)&&Si(e)==C}function ca(e){return"symbol"==typeof e||ta(e)&&Si(e)==O}var la=bt?Ht(bt):function(e){return ta(e)&&Zo(e.length)&&!!Qe[Si(e)]},ua=Hr(Pi),da=Hr(function(e,t){return e<=t});function ha(e){if(!e)return[];if(Bo(e))return aa(e)?on(e):Tr(e);if(rt&&e[rt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[rt]());var t=ds(e);return(t==D?Zt:t==M?nn:Na)(e)}function fa(e){return e?(e=ba(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function pa(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function ma(e){return e?si(pa(e),0,f):0}function ba(e){if("number"==typeof e)return e;if(ca(e))return h;if(ea(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ea(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=$t(e);var n=pe.test(e);return n||be.test(e)?nt(e.slice(2),n?2:8):fe.test(e)?h:+e}function ga(e){return Mr(e,Aa(e))}function _a(e){return null==e?"":or(e)}var va=Or(function(e,t){if(ys(t)||Bo(t))Mr(t,Ea(t),e);else for(var n in t)Ae.call(t,n)&&Zn(e,n,t[n])}),ya=Or(function(e,t){Mr(t,Aa(t),e)}),wa=Or(function(e,t,n,i){Mr(t,Aa(t),e,i)}),Da=Or(function(e,t,n,i){Mr(t,Ea(t),e,i)}),Sa=Zr(ri),xa=Ui(function(e,t){e=xe(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&bs(t[0],t[1],s)&&(i=1);++n<i;)for(var o=t[n],a=Aa(o),c=-1,l=a.length;++c<l;){var u=a[c],d=e[u];(d===r||No(d,Oe[u])&&!Ae.call(e,u))&&(e[u]=o[u])}return e}),ka=Ui(function(e){return e.push(r,Jr),gt(Ra,r,e)});function Ta(e,t,n){var i=null==e?r:wi(e,t);return i===r?n:i}function Ma(e,t){return null!=e&&hs(e,t,Ti)}var Ca=jr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),e[t]=n},ec(ic)),Oa=jr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),Ae.call(e,t)?e[t].push(n):e[t]=[n]},ss),La=Ui(Ci);function Ea(e){return Bo(e)?qn(e):Ri(e)}function Aa(e){return Bo(e)?qn(e,!0):function(e){if(!ea(e))return function(e){var t=[];if(null!=e)for(var n in xe(e))t.push(n);return t}(e);var t=ys(e),n=[];for(var i in e)("constructor"!=i||!t&&Ae.call(e,i))&&n.push(i);return n}(e)}var Ia=Or(function(e,t,n){Yi(e,t,n)}),Ra=Or(function(e,t,n,i){Yi(e,t,n,i)}),Pa=Zr(function(e,t){var n={};if(null==e)return n;var i=!1;t=kt(t,function(t){return t=br(t,e),i||(i=t.length>1),t}),Mr(e,ts(e),n),i&&(n=oi(n,7,Kr));for(var r=t.length;r--;)cr(n,t[r]);return n}),Fa=Zr(function(e,t){return null==e?{}:function(e,t){return $i(e,t,function(t,n){return Ma(e,n)})}(e,t)});function Wa(e,t){if(null==e)return{};var n=kt(ts(e),function(e){return[e]});return t=ss(t),$i(e,n,function(e,n){return t(e,n[0])})}var ja=Ur(Ea),Ya=Ur(Aa);function Na(e){return null==e?[]:Xt(e,Ea(e))}var za=Ir(function(e,t,n){return t=t.toLowerCase(),e+(n?$a(t):t)});function $a(e){return Ja(_a(e).toLowerCase())}function Ha(e){return(e=_a(e))&&e.replace(_e,Gt).replace(Ve,"")}var Xa=Ir(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Va=Ir(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ba=Ar("toLowerCase"),Ua=Ir(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),qa=Ir(function(e,t,n){return e+(n?" ":"")+Ja(t)}),Ga=Ir(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ja=Ar("toUpperCase");function Ka(e,t,n){return e=_a(e),(t=n?r:t)===r?function(e){return Ge.test(e)}(e)?function(e){return e.match(Ue)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qa=Ui(function(e,t){try{return gt(e,r,t)}catch(n){return Jo(n)?n:new we(n)}}),Za=Zr(function(e,t){return vt(t,function(t){t=Fs(t),ii(e,t,Oo(e[t],e))}),e});function ec(e){return function(){return e}}var tc=Fr(),nc=Fr(!0);function ic(e){return e}function rc(e){return Ii("function"==typeof e?e:oi(e,1))}var sc=Ui(function(e,t){return function(n){return Ci(n,e,t)}}),oc=Ui(function(e,t){return function(n){return Ci(e,n,t)}});function ac(e,t,n){var i=Ea(t),r=yi(t,i);null!=n||ea(t)&&(r.length||!i.length)||(n=t,t=e,e=this,r=yi(t,Ea(t)));var s=!(ea(n)&&"chain"in n&&!n.chain),o=Ko(e);return vt(r,function(n){var i=t[n];e[n]=i,o&&(e.prototype[n]=function(){var t=this.__chain__;if(s||t){var n=e(this.__wrapped__),r=n.__actions__=Tr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Tt([this.value()],arguments))})}),e}function cc(){}var lc=Nr(kt),uc=Nr(wt),dc=Nr(Ot);function hc(e){return gs(e)?Wt(Fs(e)):function(e){return function(t){return wi(t,e)}}(e)}var fc=$r(),pc=$r(!0);function mc(){return[]}function bc(){return!1}var gc,_c=Yr(function(e,t){return e+t},0),vc=Vr("ceil"),yc=Yr(function(e,t){return e/t},1),wc=Vr("floor"),Dc=Yr(function(e,t){return e*t},1),Sc=Vr("round"),xc=Yr(function(e,t){return e-t},0);return jn.after=function(e,t){if("function"!=typeof t)throw new Me(s);return e=pa(e),function(){if(--e<1)return t.apply(this,arguments)}},jn.ary=Mo,jn.assign=va,jn.assignIn=ya,jn.assignInWith=wa,jn.assignWith=Da,jn.at=Sa,jn.before=Co,jn.bind=Oo,jn.bindAll=Za,jn.bindKey=Lo,jn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Xo(e)?e:[e]},jn.chain=ho,jn.chunk=function(e,t,n){t=(n?bs(e,t,n):t===r)?1:bn(pa(t),0);var s=null==e?0:e.length;if(!s||t<1)return[];for(var o=0,a=0,c=i(jt(s/t));o<s;)c[a++]=er(e,o,o+=t);return c},jn.compact=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var s=e[t];s&&(r[i++]=s)}return r},jn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Tt(Xo(n)?Tr(n):[n],mi(t,1))},jn.cond=function(e){var t=null==e?0:e.length,n=ss();return e=t?kt(e,function(e){if("function"!=typeof e[1])throw new Me(s);return[n(e[0]),e[1]]}):[],Ui(function(n){for(var i=-1;++i<t;){var r=e[i];if(gt(r[0],this,n))return gt(r[1],this,n)}})},jn.conforms=function(e){return function(e){var t=Ea(e);return function(n){return ai(n,e,t)}}(oi(e,1))},jn.constant=ec,jn.countBy=mo,jn.create=function(e,t){var n=Yn(e);return null==t?n:ni(n,t)},jn.curry=function e(t,n,i){var s=qr(t,8,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},jn.curryRight=function e(t,n,i){var s=qr(t,16,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},jn.debounce=Eo,jn.defaults=xa,jn.defaultsDeep=ka,jn.defer=Ao,jn.delay=Io,jn.difference=Ys,jn.differenceBy=Ns,jn.differenceWith=zs,jn.drop=function(e,t,n){var i=null==e?0:e.length;return i?er(e,(t=n||t===r?1:pa(t))<0?0:t,i):[]},jn.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?er(e,0,(t=i-(t=n||t===r?1:pa(t)))<0?0:t):[]},jn.dropRightWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!0,!0):[]},jn.dropWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!0):[]},jn.fill=function(e,t,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&bs(e,t,n)&&(n=0,i=s),function(e,t,n,i){var s=e.length;for((n=pa(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:pa(i))<0&&(i+=s),i=n>i?0:ma(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},jn.filter=function(e,t){return(Xo(e)?Dt:pi)(e,ss(t,3))},jn.flatMap=function(e,t){return mi(So(e,t),1)},jn.flatMapDeep=function(e,t){return mi(So(e,t),u)},jn.flatMapDepth=function(e,t,n){return n=n===r?1:pa(n),mi(So(e,t),n)},jn.flatten=Xs,jn.flattenDeep=function(e){return null!=e&&e.length?mi(e,u):[]},jn.flattenDepth=function(e,t){return null!=e&&e.length?mi(e,t=t===r?1:pa(t)):[]},jn.flip=function(e){return qr(e,512)},jn.flow=tc,jn.flowRight=nc,jn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i},jn.functions=function(e){return null==e?[]:yi(e,Ea(e))},jn.functionsIn=function(e){return null==e?[]:yi(e,Aa(e))},jn.groupBy=yo,jn.initial=function(e){return null!=e&&e.length?er(e,0,-1):[]},jn.intersection=Bs,jn.intersectionBy=Us,jn.intersectionWith=qs,jn.invert=Ca,jn.invertBy=Oa,jn.invokeMap=wo,jn.iteratee=rc,jn.keyBy=Do,jn.keys=Ea,jn.keysIn=Aa,jn.map=So,jn.mapKeys=function(e,t){var n={};return t=ss(t,3),_i(e,function(e,i,r){ii(n,t(e,i,r),e)}),n},jn.mapValues=function(e,t){var n={};return t=ss(t,3),_i(e,function(e,i,r){ii(n,i,t(e,i,r))}),n},jn.matches=function(e){return Wi(oi(e,1))},jn.matchesProperty=function(e,t){return ji(e,oi(t,1))},jn.memoize=Ro,jn.merge=Ia,jn.mergeWith=Ra,jn.method=sc,jn.methodOf=oc,jn.mixin=ac,jn.negate=Po,jn.nthArg=function(e){return e=pa(e),Ui(function(t){return Ni(t,e)})},jn.omit=Pa,jn.omitBy=function(e,t){return Wa(e,Po(ss(t)))},jn.once=function(e){return Co(2,e)},jn.orderBy=function(e,t,n,i){return null==e?[]:(Xo(t)||(t=null==t?[]:[t]),Xo(n=i?r:n)||(n=null==n?[]:[n]),zi(e,t,n))},jn.over=lc,jn.overArgs=Fo,jn.overEvery=uc,jn.overSome=dc,jn.partial=Wo,jn.partialRight=jo,jn.partition=xo,jn.pick=Fa,jn.pickBy=Wa,jn.property=hc,jn.propertyOf=function(e){return function(t){return null==e?r:wi(e,t)}},jn.pull=Js,jn.pullAll=Ks,jn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Hi(e,t,ss(n,2)):e},jn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Hi(e,t,r,n):e},jn.pullAt=Qs,jn.range=fc,jn.rangeRight=pc,jn.rearg=Yo,jn.reject=function(e,t){return(Xo(e)?Dt:pi)(e,Po(ss(t,3)))},jn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],s=e.length;for(t=ss(t,3);++i<s;){var o=e[i];t(o,i,e)&&(n.push(o),r.push(i))}return Xi(e,r),n},jn.rest=function(e,t){if("function"!=typeof e)throw new Me(s);return Ui(e,t=t===r?t:pa(t))},jn.reverse=Zs,jn.sampleSize=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:pa(t),(Xo(e)?Jn:Gi)(e,t)},jn.set=function(e,t,n){return null==e?e:Ji(e,t,n)},jn.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Ji(e,t,n,i)},jn.shuffle=function(e){return(Xo(e)?Kn:Zi)(e)},jn.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bs(e,t,n)?(t=0,n=i):(t=null==t?0:pa(t),n=n===r?i:pa(n)),er(e,t,n)):[]},jn.sortBy=ko,jn.sortedUniq=function(e){return e&&e.length?rr(e):[]},jn.sortedUniqBy=function(e,t){return e&&e.length?rr(e,ss(t,2)):[]},jn.split=function(e,t,n){return n&&"number"!=typeof n&&bs(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=_a(e))&&("string"==typeof t||null!=t&&!sa(t))&&!(t=or(t))&&Qt(e)?_r(on(e),0,n):e.split(t,n):[]},jn.spread=function(e,t){if("function"!=typeof e)throw new Me(s);return t=null==t?0:bn(pa(t),0),Ui(function(n){var i=n[t],r=_r(n,0,t);return i&&Tt(r,i),gt(e,this,r)})},jn.tail=function(e){var t=null==e?0:e.length;return t?er(e,1,t):[]},jn.take=function(e,t,n){return e&&e.length?er(e,0,(t=n||t===r?1:pa(t))<0?0:t):[]},jn.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?er(e,(t=i-(t=n||t===r?1:pa(t)))<0?0:t,i):[]},jn.takeRightWhile=function(e,t){return e&&e.length?ur(e,ss(t,3),!1,!0):[]},jn.takeWhile=function(e,t){return e&&e.length?ur(e,ss(t,3)):[]},jn.tap=function(e,t){return t(e),e},jn.throttle=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new Me(s);return ea(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Eo(e,t,{leading:i,maxWait:t,trailing:r})},jn.thru=fo,jn.toArray=ha,jn.toPairs=ja,jn.toPairsIn=Ya,jn.toPath=function(e){return Xo(e)?kt(e,Fs):ca(e)?[e]:Tr(Ps(_a(e)))},jn.toPlainObject=ga,jn.transform=function(e,t,n){var i=Xo(e),r=i||qo(e)||la(e);if(t=ss(t,4),null==n){var s=e&&e.constructor;n=r?i?new s:[]:ea(e)&&Ko(s)?Yn(He(e)):{}}return(r?vt:_i)(e,function(e,i,r){return t(n,e,i,r)}),n},jn.unary=function(e){return Mo(e,1)},jn.union=eo,jn.unionBy=to,jn.unionWith=no,jn.uniq=function(e){return e&&e.length?ar(e):[]},jn.uniqBy=function(e,t){return e&&e.length?ar(e,ss(t,2)):[]},jn.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ar(e,r,t):[]},jn.unset=function(e,t){return null==e||cr(e,t)},jn.unzip=io,jn.unzipWith=ro,jn.update=function(e,t,n){return null==e?e:lr(e,t,mr(n))},jn.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:lr(e,t,mr(n),i)},jn.values=Na,jn.valuesIn=function(e){return null==e?[]:Xt(e,Aa(e))},jn.without=so,jn.words=Ka,jn.wrap=function(e,t){return Wo(mr(t),e)},jn.xor=oo,jn.xorBy=ao,jn.xorWith=co,jn.zip=lo,jn.zipObject=function(e,t){return fr(e||[],t||[],Zn)},jn.zipObjectDeep=function(e,t){return fr(e||[],t||[],Ji)},jn.zipWith=uo,jn.entries=ja,jn.entriesIn=Ya,jn.extend=ya,jn.extendWith=wa,ac(jn,jn),jn.add=_c,jn.attempt=Qa,jn.camelCase=za,jn.capitalize=$a,jn.ceil=vc,jn.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ba(n))==n?n:0),t!==r&&(t=(t=ba(t))==t?t:0),si(ba(e),t,n)},jn.clone=function(e){return oi(e,4)},jn.cloneDeep=function(e){return oi(e,5)},jn.cloneDeepWith=function(e,t){return oi(e,5,t="function"==typeof t?t:r)},jn.cloneWith=function(e,t){return oi(e,4,t="function"==typeof t?t:r)},jn.conformsTo=function(e,t){return null==t||ai(e,t,Ea(t))},jn.deburr=Ha,jn.defaultTo=function(e,t){return null==e||e!=e?t:e},jn.divide=yc,jn.endsWith=function(e,t,n){e=_a(e),t=or(t);var i=e.length,s=n=n===r?i:si(pa(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},jn.eq=No,jn.escape=function(e){return(e=_a(e))&&q.test(e)?e.replace(B,Jt):e},jn.escapeRegExp=function(e){return(e=_a(e))&&ne.test(e)?e.replace(te,"\\$&"):e},jn.every=function(e,t,n){var i=Xo(e)?wt:hi;return n&&bs(e,t,n)&&(t=r),i(e,ss(t,3))},jn.find=bo,jn.findIndex=$s,jn.findKey=function(e,t){return Et(e,ss(t,3),_i)},jn.findLast=go,jn.findLastIndex=Hs,jn.findLastKey=function(e,t){return Et(e,ss(t,3),vi)},jn.floor=wc,jn.forEach=_o,jn.forEachRight=vo,jn.forIn=function(e,t){return null==e?e:bi(e,ss(t,3),Aa)},jn.forInRight=function(e,t){return null==e?e:gi(e,ss(t,3),Aa)},jn.forOwn=function(e,t){return e&&_i(e,ss(t,3))},jn.forOwnRight=function(e,t){return e&&vi(e,ss(t,3))},jn.get=Ta,jn.gt=zo,jn.gte=$o,jn.has=function(e,t){return null!=e&&hs(e,t,ki)},jn.hasIn=Ma,jn.head=Vs,jn.identity=ic,jn.includes=function(e,t,n,i){e=Bo(e)?e:Na(e),n=n&&!i?pa(n):0;var r=e.length;return n<0&&(n=bn(r+n,0)),aa(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&It(e,t,n)>-1},jn.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:pa(n);return r<0&&(r=bn(i+r,0)),It(e,t,r)},jn.inRange=function(e,t,n){return t=fa(t),n===r?(n=t,t=0):n=fa(n),function(e,t,n){return e>=gn(t,n)&&e<bn(t,n)}(e=ba(e),t,n)},jn.invoke=La,jn.isArguments=Ho,jn.isArray=Xo,jn.isArrayBuffer=Vo,jn.isArrayLike=Bo,jn.isArrayLikeObject=Uo,jn.isBoolean=function(e){return!0===e||!1===e||ta(e)&&Si(e)==g},jn.isBuffer=qo,jn.isDate=Go,jn.isElement=function(e){return ta(e)&&1===e.nodeType&&!ra(e)},jn.isEmpty=function(e){if(null==e)return!0;if(Bo(e)&&(Xo(e)||"string"==typeof e||"function"==typeof e.splice||qo(e)||la(e)||Ho(e)))return!e.length;var t=ds(e);if(t==D||t==M)return!e.size;if(ys(e))return!Ri(e).length;for(var n in e)if(Ae.call(e,n))return!1;return!0},jn.isEqual=function(e,t){return Li(e,t)},jn.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Li(e,t,r,n):!!i},jn.isError=Jo,jn.isFinite=function(e){return"number"==typeof e&&fn(e)},jn.isFunction=Ko,jn.isInteger=Qo,jn.isLength=Zo,jn.isMap=na,jn.isMatch=function(e,t){return e===t||Ei(e,t,as(t))},jn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Ei(e,t,as(t),n)},jn.isNaN=function(e){return ia(e)&&e!=+e},jn.isNative=function(e){if(vs(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ai(e)},jn.isNil=function(e){return null==e},jn.isNull=function(e){return null===e},jn.isNumber=ia,jn.isObject=ea,jn.isObjectLike=ta,jn.isPlainObject=ra,jn.isRegExp=sa,jn.isSafeInteger=function(e){return Qo(e)&&e>=-9007199254740991&&e<=d},jn.isSet=oa,jn.isString=aa,jn.isSymbol=ca,jn.isTypedArray=la,jn.isUndefined=function(e){return e===r},jn.isWeakMap=function(e){return ta(e)&&ds(e)==L},jn.isWeakSet=function(e){return ta(e)&&"[object WeakSet]"==Si(e)},jn.join=function(e,t){return null==e?"":pn.call(e,t)},jn.kebabCase=Xa,jn.last=Gs,jn.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=pa(n))<0?bn(i+s,0):gn(s,i-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,s):At(e,Pt,s,!0)},jn.lowerCase=Va,jn.lowerFirst=Ba,jn.lt=ua,jn.lte=da,jn.max=function(e){return e&&e.length?fi(e,ic,xi):r},jn.maxBy=function(e,t){return e&&e.length?fi(e,ss(t,2),xi):r},jn.mean=function(e){return Ft(e,ic)},jn.meanBy=function(e,t){return Ft(e,ss(t,2))},jn.min=function(e){return e&&e.length?fi(e,ic,Pi):r},jn.minBy=function(e,t){return e&&e.length?fi(e,ss(t,2),Pi):r},jn.stubArray=mc,jn.stubFalse=bc,jn.stubObject=function(){return{}},jn.stubString=function(){return""},jn.stubTrue=function(){return!0},jn.multiply=Dc,jn.nth=function(e,t){return e&&e.length?Ni(e,pa(t)):r},jn.noConflict=function(){return st._===this&&(st._=We),this},jn.noop=cc,jn.now=To,jn.pad=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return zr(un(r),n)+e+zr(jt(r),n)},jn.padEnd=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;return t&&i<t?e+zr(t-i,n):e},jn.padStart=function(e,t,n){e=_a(e);var i=(t=pa(t))?sn(e):0;return t&&i<t?zr(t-i,n)+e:e},jn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(_a(e).replace(ie,""),t||0)},jn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bs(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fa(e),t===r?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var s=yn();return gn(e+s*(t-e+tt("1e-"+((s+"").length-1))),t)}return Vi(e,t)},jn.reduce=function(e,t,n){var i=Xo(e)?Mt:Yt,r=arguments.length<3;return i(e,ss(t,4),n,r,ui)},jn.reduceRight=function(e,t,n){var i=Xo(e)?Ct:Yt,r=arguments.length<3;return i(e,ss(t,4),n,r,di)},jn.repeat=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:pa(t),Bi(_a(e),t)},jn.replace=function(){var e=arguments,t=_a(e[0]);return e.length<3?t:t.replace(e[1],e[2])},jn.result=function(e,t,n){var i=-1,s=(t=br(t,e)).length;for(s||(s=1,e=r);++i<s;){var o=null==e?r:e[Fs(t[i])];o===r&&(i=s,o=n),e=Ko(o)?o.call(e):o}return e},jn.round=Sc,jn.runInContext=e,jn.sample=function(e){return(Xo(e)?Gn:qi)(e)},jn.size=function(e){if(null==e)return 0;if(Bo(e))return aa(e)?sn(e):e.length;var t=ds(e);return t==D||t==M?e.size:Ri(e).length},jn.snakeCase=Ua,jn.some=function(e,t,n){var i=Xo(e)?Ot:tr;return n&&bs(e,t,n)&&(t=r),i(e,ss(t,3))},jn.sortedIndex=function(e,t){return nr(e,t)},jn.sortedIndexBy=function(e,t,n){return ir(e,t,ss(n,2))},jn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var i=nr(e,t);if(i<n&&No(e[i],t))return i}return-1},jn.sortedLastIndex=function(e,t){return nr(e,t,!0)},jn.sortedLastIndexBy=function(e,t,n){return ir(e,t,ss(n,2),!0)},jn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=nr(e,t,!0)-1;if(No(e[n],t))return n}return-1},jn.startCase=qa,jn.startsWith=function(e,t,n){return e=_a(e),n=null==n?0:si(pa(n),0,e.length),t=or(t),e.slice(n,n+t.length)==t},jn.subtract=xc,jn.sum=function(e){return e&&e.length?Nt(e,ic):0},jn.sumBy=function(e,t){return e&&e.length?Nt(e,ss(t,2)):0},jn.template=function(e,t,n){var i=jn.templateSettings;n&&bs(e,t,n)&&(t=r),e=_a(e),t=wa({},t,i,Gr);var s,o,a=wa({},t.imports,i.imports,Gr),c=Ea(a),l=Xt(a,c),u=0,d=t.interpolate||ve,h="__p += '",f=ke((t.escape||ve).source+"|"+d.source+"|"+(d===K?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Ae.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ke+"]")+"\n";e.replace(f,function(t,n,i,r,a,c){return i||(i=r),h+=e.slice(u,c).replace(ye,Kt),n&&(s=!0,h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),i&&(h+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=c+t.length,t}),h+="';\n";var m=Ae.call(t,"variable")&&t.variable;if(m){if(le.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace($,""):h).replace(H,"$1").replace(X,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var b=Qa(function(){return De(c,p+"return "+h).apply(r,l)});if(b.source=h,Jo(b))throw b;return b},jn.times=function(e,t){if((e=pa(e))<1||e>d)return[];var n=f,i=gn(e,f);t=ss(t),e-=f;for(var r=zt(i,t);++n<e;)t(n);return r},jn.toFinite=fa,jn.toInteger=pa,jn.toLength=ma,jn.toLower=function(e){return _a(e).toLowerCase()},jn.toNumber=ba,jn.toSafeInteger=function(e){return e?si(pa(e),-9007199254740991,d):0===e?e:0},jn.toString=_a,jn.toUpper=function(e){return _a(e).toUpperCase()},jn.trim=function(e,t,n){if((e=_a(e))&&(n||t===r))return $t(e);if(!e||!(t=or(t)))return e;var i=on(e),s=on(t);return _r(i,Bt(i,s),Ut(i,s)+1).join("")},jn.trimEnd=function(e,t,n){if((e=_a(e))&&(n||t===r))return e.slice(0,an(e)+1);if(!e||!(t=or(t)))return e;var i=on(e);return _r(i,0,Ut(i,on(t))+1).join("")},jn.trimStart=function(e,t,n){if((e=_a(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=or(t)))return e;var i=on(e);return _r(i,Bt(i,on(t))).join("")},jn.truncate=function(e,t){var n=30,i="...";if(ea(t)){var s="separator"in t?t.separator:s;n="length"in t?pa(t.length):n,i="omission"in t?or(t.omission):i}var o=(e=_a(e)).length;if(Qt(e)){var a=on(e);o=a.length}if(n>=o)return e;var c=n-sn(i);if(c<1)return i;var l=a?_r(a,0,c).join(""):e.slice(0,c);if(s===r)return l+i;if(a&&(c+=l.length-c),sa(s)){if(e.slice(c).search(s)){var u,d=l;for(s.global||(s=ke(s.source,_a(he.exec(s))+"g")),s.lastIndex=0;u=s.exec(d);)var h=u.index;l=l.slice(0,h===r?c:h)}}else if(e.indexOf(or(s),c)!=c){var f=l.lastIndexOf(s);f>-1&&(l=l.slice(0,f))}return l+i},jn.unescape=function(e){return(e=_a(e))&&U.test(e)?e.replace(V,cn):e},jn.uniqueId=function(e){var t=++Ie;return _a(e)+t},jn.upperCase=Ga,jn.upperFirst=Ja,jn.each=_o,jn.eachRight=vo,jn.first=Vs,ac(jn,(gc={},_i(jn,function(e,t){Ae.call(jn.prototype,t)||(gc[t]=e)}),gc),{chain:!1}),jn.VERSION="4.17.21",vt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){jn[e].placeholder=jn}),vt(["drop","take"],function(e,t){$n.prototype[e]=function(n){n=n===r?1:bn(pa(n),0);var i=this.__filtered__&&!t?new $n(this):this.clone();return i.__filtered__?i.__takeCount__=gn(n,i.__takeCount__):i.__views__.push({size:gn(n,f),type:e+(i.__dir__<0?"Right":"")}),i},$n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),vt(["filter","map","takeWhile"],function(e,t){var n=t+1,i=1==n||3==n;$n.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ss(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),vt(["head","last"],function(e,t){var n="take"+(t?"Right":"");$n.prototype[e]=function(){return this[n](1).value()[0]}}),vt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");$n.prototype[e]=function(){return this.__filtered__?new $n(this):this[n](1)}}),$n.prototype.compact=function(){return this.filter(ic)},$n.prototype.find=function(e){return this.filter(e).head()},$n.prototype.findLast=function(e){return this.reverse().find(e)},$n.prototype.invokeMap=Ui(function(e,t){return"function"==typeof e?new $n(this):this.map(function(n){return Ci(n,e,t)})}),$n.prototype.reject=function(e){return this.filter(Po(ss(e)))},$n.prototype.slice=function(e,t){e=pa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new $n(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=pa(t))<0?n.dropRight(-t):n.take(t-e)),n)},$n.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$n.prototype.toArray=function(){return this.take(f)},_i($n.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=jn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(jn.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof $n,l=a[0],u=c||Xo(t),d=function(e){var t=s.apply(jn,Tt([e],a));return i&&h?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,m=c&&!f;if(!o&&u){t=m?t:new $n(this);var b=e.apply(t,a);return b.__actions__.push({func:fo,args:[d],thisArg:r}),new zn(b,h)}return p&&m?e.apply(this,a):(b=this.thru(d),p?i?b.value()[0]:b.value():b)})}),vt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);jn.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(Xo(r)?r:[],e)}return this[n](function(n){return t.apply(Xo(n)?n:[],e)})}}),_i($n.prototype,function(e,t){var n=jn[t];if(n){var i=n.name+"";Ae.call(On,i)||(On[i]=[]),On[i].push({name:t,func:n})}}),On[Wr(r,2).name]=[{name:"wrapper",func:r}],$n.prototype.clone=function(){var e=new $n(this.__wrapped__);return e.__actions__=Tr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Tr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Tr(this.__views__),e},$n.prototype.reverse=function(){if(this.__filtered__){var e=new $n(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},$n.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Xo(e),i=t<0,r=n?e.length:0,s=function(e,t,n){for(var i=-1,r=n.length;++i<r;){var s=n[i],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=gn(t,e+o);break;case"takeRight":e=bn(e,t-o)}}return{start:e,end:t}}(0,r,this.__views__),o=s.start,a=s.end,c=a-o,l=i?a:o-1,u=this.__iteratees__,d=u.length,h=0,f=gn(c,this.__takeCount__);if(!n||!i&&r==c&&f==c)return dr(e,this.__actions__);var p=[];e:for(;c--&&h<f;){for(var m=-1,b=e[l+=t];++m<d;){var g=u[m],_=g.type,v=(0,g.iteratee)(b);if(2==_)b=v;else if(!v){if(1==_)continue e;break e}}p[h++]=b}return p},jn.prototype.at=po,jn.prototype.chain=function(){return ho(this)},jn.prototype.commit=function(){return new zn(this.value(),this.__chain__)},jn.prototype.next=function(){this.__values__===r&&(this.__values__=ha(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},jn.prototype.plant=function(e){for(var t,n=this;n instanceof Nn;){var i=js(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},jn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof $n){var t=e;return this.__actions__.length&&(t=new $n(this)),(t=t.reverse()).__actions__.push({func:fo,args:[Zs],thisArg:r}),new zn(t,this.__chain__)}return this.thru(Zs)},jn.prototype.toJSON=jn.prototype.valueOf=jn.prototype.value=function(){return dr(this.__wrapped__,this.__actions__)},jn.prototype.first=jn.prototype.head,rt&&(jn.prototype[rt]=function(){return this}),jn}();st._=ln,(i=(function(){return ln}).call(t,n,t,e))===r||(e.exports=i)}).call(this)}).call(this,n("YuTi")(e))},MAOJ:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("wd/R"),r=n.n(i),s=n("8Y7J"),o=n("G0yt"),a=n("s7LF"),c=n("SVse");function l(e,t){if(1&e){const e=s.Yb();s.Xb(0,"div",0),s.Xb(1,"ngb-timepicker",4),s.lc("ngModelChange",function(t){return s.Ic(e),s.nc().time=t})("ngModelChange",function(){return s.Ic(e),s.nc().onModelChange()}),s.Wb(),s.Wb()}if(2&e){const e=s.nc();s.Db(1),s.uc("seconds",e.hasSeconds)("ngModel",e.time)}}let u=(()=>{class e{constructor(e){this.calendar=e,this.hasSeconds=!0,this.hasTime=!0}ngOnInit(){var e;this.minDate=this.calendar.getToday(),this.format=this.hasTime?this.hasSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm":"YYYY-MM-DD";let t=r()(null===(e=this.control)||void 0===e?void 0:e.value,this.format);t.isValid()&&!t.isBefore(r()())||(t=r()()),this.date={year:t.year(),month:t.month()+1,day:t.date()},this.time={hour:t.hour(),minute:t.minute(),second:t.second()},this.onModelChange()}onModelChange(){if(this.date){const e=Object.assign({},this.date,this.time);e.month--,setTimeout(()=>{this.control.setValue(r()(e).format(this.format))})}else setTimeout(()=>{this.control.setValue("")})}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(o.d))},e.\u0275cmp=s.Lb({type:e,selectors:[["cd-date-time-picker"]],inputs:{control:"control",hasSeconds:"hasSeconds",hasTime:"hasTime"},decls:4,vars:3,consts:[[1,"d-flex","justify-content-center"],[3,"ngModel","minDate","ngModelChange"],["dp",""],["class","d-flex justify-content-center",4,"ngIf"],[3,"seconds","ngModel","ngModelChange"]],template:function(e,t){1&e&&(s.Xb(0,"div",0),s.Xb(1,"ngb-datepicker",1,2),s.lc("ngModelChange",function(e){return t.date=e})("ngModelChange",function(){return t.onModelChange()}),s.Wb(),s.Wb(),s.Pc(3,l,2,2,"div",3)),2&e&&(s.Db(1),s.uc("ngModel",t.date)("minDate",t.minDate),s.Db(2),s.uc("ngIf",t.hasTime))},directives:[o.g,a.q,a.t,c.r,o.B],styles:[""]}),e})()},"MO+k":function(e,t,n){e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(e,n){return function(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[t[i]]=i);var r=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in r)if(r.hasOwnProperty(s)){if(!("channels"in r[s]))throw new Error("missing channels property: "+s);if(!("labels"in r[s]))throw new Error("missing channel labels property: "+s);if(r[s].labels.length!==r[s].channels)throw new Error("channel and label counts mismatch: "+s);var o=r[s].channels,a=r[s].labels;delete r[s].channels,delete r[s].labels,Object.defineProperty(r[s],"channels",{value:o}),Object.defineProperty(r[s],"labels",{value:a})}r.rgb.hsl=function(e){var t,n,i=e[0]/255,r=e[1]/255,s=e[2]/255,o=Math.min(i,r,s),a=Math.max(i,r,s),c=a-o;return a===o?t=0:i===a?t=(r-s)/c:r===a?t=2+(s-i)/c:s===a&&(t=4+(i-r)/c),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+a)/2,[t,100*(a===o?0:n<=.5?c/(a+o):c/(2-a-o)),100*n]},r.rgb.hsv=function(e){var t,n,i,r,s,o=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),d=function(e){return(l-e)/6/u+.5};return 0===u?r=s=0:(s=u/l,t=d(o),n=d(a),i=d(c),o===l?r=i-n:a===l?r=1/3+t-i:c===l&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*l]},r.rgb.hwb=function(e){var t=e[0],n=e[1],i=e[2];return[r.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,i))*100,100*(i=1-1/255*Math.max(t,Math.max(n,i)))]},r.rgb.cmyk=function(e){var t,n=e[0]/255,i=e[1]/255,r=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-i,1-r)))/(1-t)||0),100*((1-i-t)/(1-t)||0),100*((1-r-t)/(1-t)||0),100*t]},r.rgb.keyword=function(e){var i=n[e];if(i)return i;var r,s,o,a=1/0;for(var c in t)if(t.hasOwnProperty(c)){var l=(s=e,o=t[c],Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)+Math.pow(s[2]-o[2],2));l<a&&(a=l,r=c)}return r},r.keyword.rgb=function(e){return t[e]},r.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,i=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*t+.7152*n+.0722*i),100*(.0193*t+.1192*n+.9505*i)]},r.rgb.lab=function(e){var t=r.rgb.xyz(e),n=t[0],i=t[1],s=t[2];return i/=100,s/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(s=s>.008856?Math.pow(s,1/3):7.787*s+16/116))]},r.hsl.rgb=function(e){var t,n,i,r,s,o=e[0]/360,a=e[1]/100,c=e[2]/100;if(0===a)return[s=255*c,s,s];t=2*c-(n=c<.5?c*(1+a):c+a-c*a),r=[0,0,0];for(var l=0;l<3;l++)(i=o+1/3*-(l-1))<0&&i++,i>1&&i--,r[l]=255*(s=6*i<1?t+6*(n-t)*i:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t);return r},r.hsl.hsv=function(e){var t=e[0],n=e[1]/100,i=e[2]/100,r=n,s=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=s<=1?s:2-s,[t,100*(0===i?2*r/(s+r):2*n/(i+n)),(i+n)/2*100]},r.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,i=e[2]/100,r=Math.floor(t)%6,s=t-Math.floor(t),o=255*i*(1-n),a=255*i*(1-n*s),c=255*i*(1-n*(1-s));switch(i*=255,r){case 0:return[i,c,o];case 1:return[a,i,o];case 2:return[o,i,c];case 3:return[o,a,i];case 4:return[c,o,i];case 5:return[i,o,a]}},r.hsv.hsl=function(e){var t,n,i,r=e[0],s=e[1]/100,o=e[2]/100,a=Math.max(o,.01);return i=(2-s)*o,n=s*a,[r,100*(n=(n/=(t=(2-s)*a)<=1?t:2-t)||0),100*(i/=2)]},r.hwb.rgb=function(e){var t,n,i,r,s,o,a,c=e[0]/360,l=e[1]/100,u=e[2]/100,d=l+u;switch(d>1&&(l/=d,u/=d),i=6*c-(t=Math.floor(6*c)),0!=(1&t)&&(i=1-i),r=l+i*((n=1-u)-l),t){default:case 6:case 0:s=n,o=r,a=l;break;case 1:s=r,o=n,a=l;break;case 2:s=l,o=n,a=r;break;case 3:s=l,o=r,a=n;break;case 4:s=r,o=l,a=n;break;case 5:s=n,o=l,a=r}return[255*s,255*o,255*a]},r.cmyk.rgb=function(e){var t=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-i)+i)),255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},r.xyz.rgb=function(e){var t,n,i,r=e[0]/100,s=e[1]/100,o=e[2]/100;return n=-.9689*r+1.8758*s+.0415*o,i=.0557*r+-.204*s+1.057*o,t=(t=3.2406*r+-1.5372*s+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},r.xyz.lab=function(e){var t=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},r.lab.xyz=function(e){var t,n,i;t=e[1]/500+(n=(e[0]+16)/116),i=n-e[2]/200;var r=Math.pow(n,3),s=Math.pow(t,3),o=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,[t*=95.047,n*=100,i*=108.883]},r.lab.lch=function(e){var t,n=e[0],i=e[1],r=e[2];return(t=360*Math.atan2(r,i)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(i*i+r*r),t]},r.lch.lab=function(e){var t,n=e[1];return t=e[2]/360*2*Math.PI,[e[0],n*Math.cos(t),n*Math.sin(t)]},r.rgb.ansi16=function(e){var t=e[0],n=e[1],i=e[2],s=1 in arguments?arguments[1]:r.rgb.hsv(e)[2];if(0===(s=Math.round(s/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===s&&(o+=60),o},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){var t=e[0],n=e[1],i=e[2];return t===n&&n===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},r.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},r.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},r.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map(function(e){return e+e}).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},r.rgb.hcg=function(e){var t,n=e[0]/255,i=e[1]/255,r=e[2]/255,s=Math.max(Math.max(n,i),r),o=Math.min(Math.min(n,i),r),a=s-o;return t=a<=0?0:s===n?(i-r)/a%6:s===i?2+(r-n)/a:4+(n-i)/a+4,t/=6,[360*(t%=1),100*a,100*(a<1?o/(1-a):0)]},r.hsl.hcg=function(e){var t,n=e[1]/100,i=e[2]/100,r=0;return(t=i<.5?2*n*i:2*n*(1-i))<1&&(r=(i-.5*t)/(1-t)),[e[0],100*t,100*r]},r.hsv.hcg=function(e){var t=e[2]/100,n=e[1]/100*t,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],100*n,100*i]},r.hcg.rgb=function(e){var t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var i,r=[0,0,0],s=e[0]/360%1*6,o=s%1,a=1-o;switch(Math.floor(s)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return[255*(t*r[0]+(i=(1-t)*n)),255*(t*r[1]+i),255*(t*r[2]+i)]},r.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),i=0;return n>0&&(i=t/n),[e[0],100*i,100*n]},r.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],100*i,100*n]},r.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},r.hwb.hcg=function(e){var t=1-e[2]/100,n=t-e[1]/100,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],100*n,100*i]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=r.gray.hsv=function(e){return[0,0,e[0]]},r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(n={exports:{}}),n.exports}();function i(e,t){return function(n){return t(e(n))}}function r(e,t){for(var r=[t[e].parent,e],s=n[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),s=i(n[t[o].parent][o],s),o=t[o].parent;return s.conversion=r,s}var s={};Object.keys(n).forEach(function(e){s[e]={},Object.defineProperty(s[e],"channels",{value:n[e].channels}),Object.defineProperty(s[e],"labels",{value:n[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),i=t.length,r=0;r<i;r++)e[t[r]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length;)for(var r=i.pop(),s=Object.keys(n[r]),o=s.length,a=0;a<o;a++){var c=s[a],l=t[c];-1===l.distance&&(l.distance=t[r].distance+1,l.parent=r,i.unshift(c))}return t}(e),i={},s=Object.keys(t),o=s.length,a=0;a<o;a++){var c=s[a];null!==t[c].parent&&(i[c]=r(c,t))}return i}(e);Object.keys(t).forEach(function(n){var i=t[n];s[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var i=n.length,r=0;r<i;r++)n[r]=Math.round(n[r]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(i),s[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(i)})});var o=s,a={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},c={getRgba:l,getHsla:u,getRgb:function(e){var t=l(e);return t&&t.slice(0,3)},getHsl:function(e){var t=u(e);return t&&t.slice(0,3)},getHwb:d,getAlpha:function(e){var t=l(e);return t||(t=u(e))||(t=d(e))?t[3]:void 0},hexString:function(e,t){return t=void 0!==t&&3===e.length?t:e[3],"#"+b(e[0])+b(e[1])+b(e[2])+(t>=0&&t<1?b(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?h(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:h,percentString:function(e,t){return t<1||e[3]&&e[3]<1?f(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"},percentaString:f,hslString:function(e,t){return t<1||e[3]&&e[3]<1?p(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:p,hwbString:function(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return g[e.slice(0,3)]}};function l(e){if(e){var t=[0,0,0],n=1,i=e.match(/^#([a-fA-F0-9]{3,4})$/i),r="";if(i){r=(i=i[1])[3];for(var s=0;s<t.length;s++)t[s]=parseInt(i[s]+i[s],16);r&&(n=Math.round(parseInt(r+r,16)/255*100)/100)}else if(i=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(r=i[2],i=i[1],s=0;s<t.length;s++)t[s]=parseInt(i.slice(2*s,2*s+2),16);r&&(n=Math.round(parseInt(r,16)/255*100)/100)}else if(i=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(s=0;s<t.length;s++)t[s]=parseInt(i[s+1]);n=parseFloat(i[4])}else if(i=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(s=0;s<t.length;s++)t[s]=Math.round(2.55*parseFloat(i[s+1]));n=parseFloat(i[4])}else if(i=e.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(t=a[i[1]]))return}for(s=0;s<t.length;s++)t[s]=m(t[s],0,255);return n=n||0==n?m(n,0,1):1,t[3]=n,t}}function u(e){if(e){var t=e.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[m(parseInt(t[1]),0,360),m(parseFloat(t[2]),0,100),m(parseFloat(t[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function d(e){if(e){var t=e.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[m(parseInt(t[1]),0,360),m(parseFloat(t[2]),0,100),m(parseFloat(t[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function h(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function f(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function p(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function m(e,t,n){return Math.min(Math.max(t,e),n)}function b(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var g={};for(var _ in a)g[a[_]]=_;var v=function(e){return e instanceof v?e:this instanceof v?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=c.getRgba(e))?this.setValues("rgb",t):(t=c.getHsla(e))?this.setValues("hsl",t):(t=c.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new v(e);var t};v.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return c.hexString(this.values.rgb)},rgbString:function(){return c.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return c.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return c.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return c.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return c.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return c.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return c.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var i=e[n]/255;t[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,i=e,r=void 0===t?.5:t,s=2*r-1,o=n.alpha()-i.alpha(),a=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return this.rgb(a*n.red()+c*i.red(),a*n.green()+c*i.green(),a*n.blue()+c*i.blue()).alpha(n.alpha()*r+i.alpha()*(1-r))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new v,i=this.values,r=n.values;for(var s in i)i.hasOwnProperty(s)&&("[object Array]"===(t={}.toString.call(e=i[s]))?r[s]=e.slice(0):"[object Number]"===t?r[s]=e:console.error("unexpected color value:",e));return n}},v.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},v.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},v.prototype.getValues=function(e){for(var t=this.values,n={},i=0;i<e.length;i++)n[e.charAt(i)]=t[e][i];return 1!==t.alpha&&(n.a=t.alpha),n},v.prototype.setValues=function(e,t){var n,i,r=this.values,s=this.spaces,a=this.maxes,c=1;if(this.valid=!0,"alpha"===e)c=t;else if(t.length)r[e]=t.slice(0,e.length),c=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)r[e][n]=t[e.charAt(n)];c=t.a}else if(void 0!==t[s[e][0]]){var l=s[e];for(n=0;n<e.length;n++)r[e][n]=t[l[n]];c=t.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===c?r.alpha:c)),"alpha"===e)return!1;for(n=0;n<e.length;n++)i=Math.max(0,Math.min(a[e][n],r[e][n])),r[e][n]=Math.round(i);for(var u in s)u!==e&&(r[u]=o[e][u](r[e]));return!0},v.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},v.prototype.setChannel=function(e,t,n){var i=this.values[e];return void 0===n?i[t]:(n===i[t]||(i[t]=n,this.setValues(e,i)),this)},"undefined"!=typeof window&&(window.Color=v);var y=v;function w(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}var D,S={noop:function(){},uid:(D=0,function(){return D++}),isNullOrUndef:function(e){return null==e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return void 0===e?t:e},valueAtIndexOrDefault:function(e,t,n){return S.valueOrDefault(S.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,i){var r,s,o;if(S.isArray(e))if(s=e.length,i)for(r=s-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;r<s;r++)t.call(n,e[r],r);else if(S.isObject(e))for(s=(o=Object.keys(e)).length,r=0;r<s;r++)t.call(n,e[o[r]],o[r])},arrayEquals:function(e,t){var n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=t[n],(r=e[n])instanceof Array&&s instanceof Array){if(!S.arrayEquals(r,s))return!1}else if(r!==s)return!1;return!0},clone:function(e){if(S.isArray(e))return e.map(S.clone);if(S.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),i=n.length,r=0;r<i;++r)t[n[r]]=S.clone(e[n[r]]);return t}return e},_merger:function(e,t,n,i){if(w(e)){var r=t[e],s=n[e];S.isObject(r)&&S.isObject(s)?S.merge(r,s,i):t[e]=S.clone(s)}},_mergerIf:function(e,t,n){if(w(e)){var i=t[e],r=n[e];S.isObject(i)&&S.isObject(r)?S.mergeIf(i,r):t.hasOwnProperty(e)||(t[e]=S.clone(r))}},merge:function(e,t,n){var i,r,s,o,a,c=S.isArray(t)?t:[t],l=c.length;if(!S.isObject(e))return e;for(i=(n=n||{}).merger||S._merger,r=0;r<l;++r)if(S.isObject(t=c[r]))for(a=0,o=(s=Object.keys(t)).length;a<o;++a)i(s[a],e,t,n);return e},mergeIf:function(e,t){return S.merge(e,t,{merger:S._mergerIf})},extend:Object.assign||function(e){return S.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=t.prototype,n.prototype=new i,n.extend=S.inherits,e&&S.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,i){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},x=S;S.callCallback=S.callback,S.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},S.getValueOrDefault=S.valueOrDefault,S.getValueAtIndexOrDefault=S.valueAtIndexOrDefault;var k={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:1===e?1:(n||(n=.3),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,i=1;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),i<1?(i=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/i),e<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-k.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*k.easeInBounce(2*e):.5*k.easeOutBounce(2*e-1)+.5}},T={effects:k};x.easingEffects=k;var M=Math.PI,C=M/180,O=2*M,L=M/2,E=M/4,A=2*M/3,I={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,i,r,s){if(s){var o=Math.min(s,r/2,i/2),a=t+o,c=n+o,l=t+i-o,u=n+r-o;e.moveTo(t,c),a<l&&c<u?(e.arc(a,c,o,-M,-L),e.arc(l,c,o,-L,0),e.arc(l,u,o,0,L),e.arc(a,u,o,L,M)):a<l?(e.moveTo(a,n),e.arc(l,c,o,-L,L),e.arc(a,c,o,L,M+L)):c<u?(e.arc(a,c,o,-M,0),e.arc(a,u,o,0,M)):e.arc(a,c,o,-M,M),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,r)},drawPoint:function(e,t,n,i,r,s){var o,a,c,l,u,d=(s||0)*C;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(i,r),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(i,r,n,0,O),e.closePath();break;case"triangle":e.moveTo(i+Math.sin(d)*n,r-Math.cos(d)*n),d+=A,e.lineTo(i+Math.sin(d)*n,r-Math.cos(d)*n),d+=A,e.lineTo(i+Math.sin(d)*n,r-Math.cos(d)*n),e.closePath();break;case"rectRounded":l=n-(u=.516*n),a=Math.cos(d+E)*l,c=Math.sin(d+E)*l,e.arc(i-a,r-c,u,d-M,d-L),e.arc(i+c,r-a,u,d-L,d),e.arc(i+a,r+c,u,d,d+L),e.arc(i-c,r+a,u,d+L,d+M),e.closePath();break;case"rect":if(!s){l=Math.SQRT1_2*n,e.rect(i-l,r-l,2*l,2*l);break}d+=E;case"rectRot":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+c,r-a),e.lineTo(i+a,r+c),e.lineTo(i-c,r+a),e.closePath();break;case"crossRot":d+=E;case"cross":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a);break;case"star":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a),d+=E,a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c),e.moveTo(i+c,r-a),e.lineTo(i-c,r+a);break;case"line":a=Math.cos(d)*n,c=Math.sin(d)*n,e.moveTo(i-a,r-c),e.lineTo(i+a,r+c);break;case"dash":e.moveTo(i,r),e.lineTo(i+Math.cos(d)*n,r+Math.sin(d)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var n=1e-6;return e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,i){var r=n.steppedLine;if(r){if("middle"===r){var s=(t.x+n.x)/2;e.lineTo(s,i?n.y:t.y),e.lineTo(s,i?t.y:n.y)}else"after"===r&&!i||"after"!==r&&i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}else n.tension?e.bezierCurveTo(i?t.controlPointPreviousX:t.controlPointNextX,i?t.controlPointPreviousY:t.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):e.lineTo(n.x,n.y)}},R=I;x.clear=I.clear,x.drawRoundedRectangle=function(e){e.beginPath(),I.roundedRect.apply(I,arguments)};var P={_set:function(e,t){return x.merge(this[e]||(this[e]={}),t)}};P._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var F=P,W=x.valueOrDefault,j={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,i,r;return x.isObject(e)?(t=+e.top||0,n=+e.right||0,i=+e.bottom||0,r=+e.left||0):t=n=i=r=+e||0,{top:t,right:n,bottom:i,left:r,height:t+i,width:r+n}},_parseFont:function(e){var t=F.global,n=W(e.fontSize,t.defaultFontSize),i={family:W(e.fontFamily,t.defaultFontFamily),lineHeight:x.options.toLineHeight(W(e.lineHeight,t.defaultLineHeight),n),size:n,style:W(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return i.string=function(e){return!e||x.isNullOrUndef(e.size)||x.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(i),i},resolve:function(e,t,n,i){var r,s,o,a=!0;for(r=0,s=e.length;r<s;++r)if(void 0!==(o=e[r])&&(void 0!==t&&"function"==typeof o&&(o=o(t),a=!1),void 0!==n&&x.isArray(o)&&(o=o[n],a=!1),void 0!==o))return i&&!a&&(i.cacheable=!1),o}},Y={_factorize:function(e){var t,n=[],i=Math.sqrt(e);for(t=1;t<i;t++)e%t==0&&(n.push(t),n.push(e/t));return i===(0|i)&&n.push(i),n.sort(function(e,t){return e-t}).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t);return e===Math.pow(10,n)?n:t}},N=Y;x.log10=Y.log10;var z=x,$=R,H=j,X=N;z.easing=T,z.canvas=$,z.options=H,z.math=X,z.rtl={getRtlAdapter:function(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},overrideTextDirection:function(e,t){var n,i;"ltr"!==t&&"rtl"!==t||(i=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)},restoreTextDirection:function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}};var V=function(e){z.extend(this,e),this.initialize.apply(this,arguments)};z.extend(V.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=z.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,i=t._start,r=t._view;return n&&1!==e?(r||(r=t._view={}),i||(i=t._start={}),function(e,t,n,i){var r,s,o,a,c,l,u,d,h,f=Object.keys(n);for(r=0,s=f.length;r<s;++r)if(l=n[o=f[r]],t.hasOwnProperty(o)||(t[o]=l),(a=t[o])!==l&&"_"!==o[0]){if(e.hasOwnProperty(o)||(e[o]=a),(u=typeof l)==typeof(c=e[o]))if("string"===u){if((d=y(c)).valid&&(h=y(l)).valid){t[o]=h.mix(d,i).rgbString();continue}}else if(z.isFinite(c)&&z.isFinite(l)){t[o]=c+(l-c)*i;continue}t[o]=l}}(i,r,n,e),t):(t._view=z.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return z.isNumber(this._model.x)&&z.isNumber(this._model.y)}}),V.extend=z.inherits;var B=V,U=B.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),q=U;Object.defineProperty(U.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(U.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),F._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:z.noop,onComplete:z.noop}});var G={animations:[],request:null,addAnimation:function(e,t,n,i){var r,s,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,i||(e.animating=!0),r=0,s=o.length;r<s;++r)if(o[r].chart===e)return void(o[r]=t);o.push(t),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=z.findIndex(this.animations,function(t){return t.chart===e});-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=z.requestAnimFrame.call(window,function(){e.request=null,e.startDigest()}))},startDigest:function(){var e=this;e.advance(),e.animations.length>0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,i,r=this.animations,s=0;s<r.length;)t=(e=r[s]).chart,n=e.numSteps,i=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(i,n),z.callback(e.render,[t,e],t),z.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?(z.callback(e.onAnimationComplete,[e],t),t.animating=!1,r.splice(s,1)):++s}},J=z.options.resolve,K=["push","pop","shift","splice","unshift"];function Q(e,t){var n=e._chartjs;if(n){var i=n.listeners,r=i.indexOf(t);-1!==r&&i.splice(r,1),i.length>0||(K.forEach(function(t){delete e[t]}),delete e._chartjs)}}var Z=function(e,t){this.initialize(e,t)};z.extend(Z.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,i=n.scales,r=e.getDataset(),s=n.options.scales;null!==t.xAxisID&&t.xAxisID in i&&!r.xAxisID||(t.xAxisID=r.xAxisID||s.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in i&&!r.yAxisID||(t.yAxisID=r.yAxisID||s.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&Q(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,i=n.getMeta(),r=n.getDataset().data||[],s=i.data;for(e=0,t=r.length;e<t;++e)s[e]=s[e]||n.createMetaData(e);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e,t,n=this,i=n.getDataset(),r=i.data||(i.data=[]);n._data!==r&&(n._data&&Q(n._data,n),r&&Object.isExtensible(r)&&(t=n,(e=r)._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),K.forEach(function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),i=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),r=i.apply(this,t);return z.each(e._chartjs.listeners,function(e){"function"==typeof e[n]&&e[n].apply(e,t)}),r}})}))),n._data=r),n.resyncElements()},_configure:function(){var e=this;e._config=z.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&z._merger(e,t,n)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:z.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],i=n.length,r=0;r<i;++r)n[r].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,i=0;for(e.dataset&&e.dataset.draw();i<n;++i)t[i].draw()},getStyle:function(e){var t,n=this,i=n.getMeta(),r=i.dataset;return n._configure(),!1!==(t=r&&void 0===e?n._resolveDatasetElementOptions(r||{}):n._resolveDataElementOptions(i.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,i,r,s,o=this,a=o.chart,c=o._config,l=e.custom||{},u=a.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:a,dataset:o.getDataset(),datasetIndex:o.index,hover:t};for(n=0,i=d.length;n<i;++n)r=d[n],s=t?"hover"+r.charAt(0).toUpperCase()+r.slice(1):r,h[r]=J([l[s],c[s],u[s]],f);return h},_resolveDataElementOptions:function(e,t){var n=this,i=e&&e.custom,r=n._cachedDataOpts;if(r&&!i)return r;var s,o,a,c,l=n.chart,u=n._config,d=l.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,f={},p={chart:l,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},m={cacheable:!i};if(i=i||{},z.isArray(h))for(o=0,a=h.length;o<a;++o)f[c=h[o]]=J([i[c],u[c],d[c]],p,t,m);else for(o=0,a=(s=Object.keys(h)).length;o<a;++o)f[c=s[o]]=J([i[c],u[h[c]],u[c],d[c]],p,t,m);return m.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){z.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,i=e.custom||{},r=e._model,s=z.getHoverColor;e.$previousStyle={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth},r.backgroundColor=J([i.hoverBackgroundColor,t.hoverBackgroundColor,s(r.backgroundColor)],void 0,n),r.borderColor=J([i.hoverBorderColor,t.hoverBorderColor,s(r.borderColor)],void 0,n),r.borderWidth=J([i.hoverBorderWidth,t.hoverBorderWidth,r.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,i,r,s,o=this.getMeta().dataset,a={};if(o){for(s=o._model,r=this._resolveDatasetElementOptions(o,!0),e=0,t=(i=Object.keys(r)).length;e<t;++e)a[n=i[e]]=s[n],s[n]=r[n];o.$previousStyle=a}},resyncElements:function(){var e=this,t=e.getMeta(),n=e.getDataset().data,i=t.data.length,r=n.length;r<i?t.data.splice(r,i-r):r>i&&e.insertElements(i,r-i)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),Z.extend=z.inherits;var ee=Z,te=2*Math.PI;function ne(e,t){var n=t.startAngle,i=t.endAngle,r=t.pixelMargin,s=r/t.outerRadius,o=t.x,a=t.y;e.beginPath(),e.arc(o,a,t.outerRadius,n-s,i+s),t.innerRadius>r?e.arc(o,a,t.innerRadius-r,i+(s=r/t.innerRadius),n-s,!0):e.arc(o,a,r,i+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}F._set("global",{elements:{arc:{backgroundColor:F.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var ie=B.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var i=z.getAngleFromPoint(n,{x:e,y:t}),r=i.angle,s=i.distance,o=n.startAngle,a=n.endAngle;a<o;)a+=te;for(;r>a;)r-=te;for(;r<o;)r+=te;return r>=o&&r<=a&&s>=n.innerRadius&&s<=n.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,r={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/te)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,r.fullCircles){for(r.endAngle=r.startAngle+te,t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),e=0;e<r.fullCircles;++e)t.fill();r.endAngle=r.startAngle+n.circumference%te}t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&function(e,t,n){var i="inner"===t.borderAlign;i?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(e,t,n,i){var r,s=n.endAngle;for(i&&(n.endAngle=n.startAngle+te,ne(e,n),n.endAngle=s,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=te,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+te,n.startAngle,!0),r=0;r<n.fullCircles;++r)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+te),r=0;r<n.fullCircles;++r)e.stroke()}(e,t,n,i),i&&ne(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}(t,n,r),t.restore()}}),re=z.valueOrDefault,se=F.global.defaultColor;F._set("global",{elements:{line:{tension:.4,backgroundColor:se,borderWidth:3,borderColor:se,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var oe=B.extend({_type:"line",draw:function(){var e,t,n,i=this,r=i._view,s=i._chart.ctx,o=r.spanGaps,a=i._children.slice(),c=F.global,l=c.elements.line,u=-1,d=i._loop;if(a.length){if(i._loop){for(e=0;e<a.length;++e)if(t=z.previousItem(a,e),!a[e]._view.skip&&t._view.skip){a=a.slice(e).concat(a.slice(0,e)),d=o;break}d&&a.push(a[0])}for(s.save(),s.lineCap=r.borderCapStyle||l.borderCapStyle,s.setLineDash&&s.setLineDash(r.borderDash||l.borderDash),s.lineDashOffset=re(r.borderDashOffset,l.borderDashOffset),s.lineJoin=r.borderJoinStyle||l.borderJoinStyle,s.lineWidth=re(r.borderWidth,l.borderWidth),s.strokeStyle=r.borderColor||c.defaultColor,s.beginPath(),(n=a[0]._view).skip||(s.moveTo(n.x,n.y),u=0),e=1;e<a.length;++e)n=a[e]._view,t=-1===u?z.previousItem(a,e):a[u],n.skip||(u!==e-1&&!o||-1===u?s.moveTo(n.x,n.y):z.canvas.lineTo(s,t._view,n),u=e);d&&s.closePath(),s.stroke(),s.restore()}}}),ae=z.valueOrDefault,ce=F.global.defaultColor;function le(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}F._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:ce,borderColor:ce,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ue=B.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:le,inXRange:le,inYRange:function(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,i=t.pointStyle,r=t.rotation,s=t.radius,o=t.x,a=t.y,c=F.global,l=c.defaultColor;t.skip||(void 0===e||z.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||l,n.lineWidth=ae(t.borderWidth,c.elements.point.borderWidth),n.fillStyle=t.backgroundColor||l,z.canvas.drawPoint(n,i,s,o,a,r))}}),de=F.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,n,i,r,s;return he(e)?(t=e.x-(s=e.width/2),n=e.x+s,i=Math.min(e.y,e.base),r=Math.max(e.y,e.base)):(s=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),i=e.y-s,r=e.y+s),{left:t,top:i,right:n,bottom:r}}function pe(e,t,n){return e===t?n:e===n?t:e}function me(e,t,n){var i=null===t,r=null===n,s=!(!e||i&&r)&&fe(e);return s&&(i||t>=s.left&&t<=s.right)&&(r||n>=s.top&&n<=s.bottom)}F._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var be=B.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(e){var t=fe(e),n=t.right-t.left,i=t.bottom-t.top,r=function(e,t,n){var i,r,s,o,a=e.borderWidth,c=function(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),n[t]=!0,n):n}(e);return z.isObject(a)?(i=+a.top||0,r=+a.right||0,s=+a.bottom||0,o=+a.left||0):i=r=s=o=+a||0,{t:c.top||i<0?0:i>n?n:i,r:c.right||r<0?0:r>t?t:r,b:c.bottom||s<0?0:s>n?n:s,l:c.left||o<0?0:o>t?t:o}}(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b}}}(t),i=n.outer,r=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(i.x,i.y,i.w,i.h),i.w===r.w&&i.h===r.h||(e.save(),e.beginPath(),e.rect(i.x,i.y,i.w,i.h),e.clip(),e.fillStyle=t.borderColor,e.rect(r.x,r.y,r.w,r.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return me(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return he(n)?me(n,e,null):me(n,null,t)},inXRange:function(e){return me(this._view,e,null)},inYRange:function(e){return me(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return he(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return he(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),ge={},_e=oe,ve=ue,ye=be;ge.Arc=ie,ge.Line=_e,ge.Point=ve,ge.Rectangle=ye;var we=z._deprecated,De=z.valueOrDefault;F._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),F._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Se=ee.extend({dataElementType:ge.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,we("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),we("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),we("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),we("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),we("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,i=this,r=i.getMeta().data;for(i._ruler=i.getRuler(),t=0,n=r.length;t<n;++t)i.updateElement(r[t],t,e)},updateElement:function(e,t,n){var i=this,r=i.getMeta(),s=i.getDataset(),o=i._resolveDataElementOptions(e,t);e._xScale=i.getScaleForId(r.xAxisID),e._yScale=i.getScaleForId(r.yAxisID),e._datasetIndex=i.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:s.label,label:i.chart.data.labels[t]},z.isArray(s.data[t])&&(e._model.borderSkipped=null),i._updateElementGeometry(e,t,n,o),e.pivot()},_updateElementGeometry:function(e,t,n,i){var r=this,s=e._model,o=r._getValueScale(),a=o.getBasePixel(),c=o.isHorizontal(),l=r._ruler||r.getRuler(),u=r.calculateBarValuePixels(r.index,t,i),d=r.calculateBarIndexPixels(r.index,t,l,i);s.horizontal=c,s.base=n?a:u.base,s.x=c?n?a:u.head:d.center,s.y=c?d.center:n?a:u.head,s.height=c?d.size:void 0,s.width=c?void 0:d.size},_getStacks:function(e){var t,n,i=this._getIndexScale(),r=i._getMatchingVisibleMetas(this._type),s=i.options.stacked,o=r.length,a=[];for(t=0;t<o&&(n=r[t],(!1===s||-1===a.indexOf(n.stack)||void 0===s&&void 0===n.stack)&&a.push(n.stack),n.index!==e);++t);return a},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),i=void 0!==t?n.indexOf(t):-1;return-1===i?n.length-1:i},getRuler:function(){var e,t,n=this,i=n._getIndexScale(),r=[];for(e=0,t=n.getMeta().data.length;e<t;++e)r.push(i.getPixelForValue(null,e,n.index));return{pixels:r,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(e,t,n){var i,r,s,o,a,c,l,u=this,d=u.chart,h=u._getValueScale(),f=h.isHorizontal(),p=d.data.datasets,m=h._getMatchingVisibleMetas(u._type),b=h._parseValue(p[e].data[t]),g=n.minBarLength,_=h.options.stacked,v=u.getMeta().stack,y=void 0===b.start?0:b.max>=0&&b.min>=0?b.min:b.max,w=void 0===b.start?b.end:b.max>=0&&b.min>=0?b.max-b.min:b.min-b.max,D=m.length;if(_||void 0===_&&void 0!==v)for(i=0;i<D&&(r=m[i]).index!==e;++i)r.stack===v&&(s=void 0===(l=h._parseValue(p[r.index].data[t])).start?l.end:l.min>=0&&l.max>=0?l.max:l.min,(b.min<0&&s<0||b.max>=0&&s>0)&&(y+=s));return o=h.getPixelForValue(y),c=(a=h.getPixelForValue(y+w))-o,void 0!==g&&Math.abs(c)<g&&(c=g,a=w>=0&&!f||w<0&&f?o-g:o+g),{size:c,base:o,head:a,center:a+c/2}},calculateBarIndexPixels:function(e,t,n,i){var r="flex"===i.barThickness?function(e,t,n){var i,r=t.pixels,s=r[e],o=e>0?r[e-1]:null,a=e<r.length-1?r[e+1]:null,c=n.categoryPercentage;return null===o&&(o=s-(null===a?t.end-t.start:a-s)),null===a&&(a=s+s-o),i=s-(s-Math.min(o,a))/2*c,{chunk:Math.abs(a-o)/2*c/t.stackCount,ratio:n.barPercentage,start:i}}(t,n,i):function(e,t,n){var i,r,s=n.barThickness,o=t.stackCount,a=t.pixels[e],c=z.isNullOrUndef(s)?function(e,t){var n,i,r,s,o=e._length;for(r=1,s=t.length;r<s;++r)o=Math.min(o,Math.abs(t[r]-t[r-1]));for(r=0,s=e.getTicks().length;r<s;++r)i=e.getPixelForTick(r),o=r>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(t.scale,t.pixels):-1;return z.isNullOrUndef(s)?(i=c*n.categoryPercentage,r=n.barPercentage):(i=s*o,r=1),{chunk:i/o,ratio:r,start:a-i/2}}(t,n,i),s=this.getStackIndex(e,this.getMeta().stack),o=r.start+r.chunk*s+r.chunk/2,a=Math.min(De(i.maxBarThickness,1/0),r.chunk*r.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),i=e.getMeta().data,r=e.getDataset(),s=i.length,o=0;for(z.canvas.clipArea(t.ctx,t.chartArea);o<s;++o){var a=n._parseValue(r.data[o]);isNaN(a.min)||isNaN(a.max)||i[o].draw()}z.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=z.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,i=e._getValueScale().options;return t.barPercentage=De(n.barPercentage,t.barPercentage),t.barThickness=De(n.barThickness,t.barThickness),t.categoryPercentage=De(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=De(n.maxBarThickness,t.maxBarThickness),t.minBarLength=De(i.minBarLength,t.minBarLength),t}}),xe=z.valueOrDefault,ke=z.options.resolve;F._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return(t.datasets[e.datasetIndex].label||"")+": ("+e.xLabel+", "+e.yLabel+", "+t.datasets[e.datasetIndex].data[e.index].r+")"}}}});var Te=ee.extend({dataElementType:ge.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta();z.each(n.data,function(n,i){t.updateElement(n,i,e)})},updateElement:function(e,t,n){var i=this,r=i.getMeta(),s=e.custom||{},o=i.getScaleForId(r.xAxisID),a=i.getScaleForId(r.yAxisID),c=i._resolveDataElementOptions(e,t),l=i.getDataset().data[t],u=i.index,d=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof l?l:NaN,t,u),h=n?a.getBasePixel():a.getPixelForValue(l,t,u);e._xScale=o,e._yScale=a,e._options=c,e._datasetIndex=u,e._index=t,e._model={backgroundColor:c.backgroundColor,borderColor:c.borderColor,borderWidth:c.borderWidth,hitRadius:c.hitRadius,pointStyle:c.pointStyle,rotation:c.rotation,radius:n?0:c.radius,skip:s.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,i=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=xe(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=xe(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=xe(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,i=n.chart,r=n.getDataset(),s=e.custom||{},o=r.data[t]||{},a=ee.prototype._resolveDataElementOptions.apply(n,arguments),c={chart:i,dataIndex:t,dataset:r,datasetIndex:n.index};return n._cachedDataOpts===a&&(a=z.extend({},a)),a.radius=ke([s.radius,o.r,n._config.radius,i.options.elements.point.radius],c,t),a}}),Me=z.valueOrDefault,Ce=Math.PI,Oe=2*Ce,Le=Ce/2;F._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data,o=s.datasets,a=s.labels;if(r.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],a[t]&&i.appendChild(document.createTextNode(a[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,i){var r=e.getDatasetMeta(0),s=r.controller.getStyle(i);return{text:n,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,hidden:isNaN(t.datasets[0].data[i])||r.data[i].hidden,index:i}}):[]}},onClick:function(e,t){var n,i,r,s=t.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(r=o.getDatasetMeta(n)).data[s]&&(r.data[s].hidden=!r.data[s].hidden);o.update()}},cutoutPercentage:50,rotation:-Le,circumference:Oe,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],i=": "+t.datasets[e.datasetIndex].data[e.index];return z.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var Ee=ee.extend({dataElementType:ge.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,i=this,r=i.chart,s=r.chartArea,o=r.options,a=1,c=1,l=0,u=0,d=i.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,m=i._getRingWeight(i.index);if(p<Oe){var b=o.rotation%Oe,g=(b+=b>=Ce?-Oe:b<-Ce?Oe:0)+p,_=Math.cos(b),v=Math.sin(b),y=Math.cos(g),w=Math.sin(g),D=b<=0&&g>=0||g>=Oe,S=b<=Le&&g>=Le||g>=Oe+Le,x=b<=-Le&&g>=-Le||g>=Ce+Le,k=b===-Ce||g>=Ce?-1:Math.min(_,_*f,y,y*f),T=x?-1:Math.min(v,v*f,w,w*f),M=D?1:Math.max(_,_*f,y,y*f),C=S?1:Math.max(v,v*f,w,w*f);a=(M-k)/2,c=(C-T)/2,l=-(M+k)/2,u=-(C+T)/2}for(t=0,n=h.length;t<n;++t)h[t]._options=i._resolveDataElementOptions(h[t],t);for(r.borderWidth=i.getMaxBorderWidth(),r.outerRadius=Math.max(Math.min((s.right-s.left-r.borderWidth)/a,(s.bottom-s.top-r.borderWidth)/c)/2,0),r.innerRadius=Math.max(r.outerRadius*f,0),r.radiusLength=(r.outerRadius-r.innerRadius)/(i._getVisibleDatasetWeightTotal()||1),r.offsetX=l*r.outerRadius,r.offsetY=u*r.outerRadius,d.total=i.calculateTotal(),i.outerRadius=r.outerRadius-r.radiusLength*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-r.radiusLength*m,0),t=0,n=h.length;t<n;++t)i.updateElement(h[t],t,e)},updateElement:function(e,t,n){var i=this,r=i.chart,s=r.chartArea,o=r.options,a=o.animation,c=(s.left+s.right)/2,l=(s.top+s.bottom)/2,u=o.rotation,d=o.rotation,h=i.getDataset(),f=n&&a.animateRotate||e.hidden?0:i.calculateCircumference(h.data[t])*(o.circumference/Oe),p=e._options||{};z.extend(e,{_datasetIndex:i.index,_index:t,_model:{backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,borderAlign:p.borderAlign,x:c+r.offsetX,y:l+r.offsetY,startAngle:u,endAngle:d,circumference:f,outerRadius:n&&a.animateScale?0:i.outerRadius,innerRadius:n&&a.animateScale?0:i.innerRadius,label:z.valueAtIndexOrDefault(h.label,t,r.data.labels[t])}});var m=e._model;n&&a.animateRotate||(m.startAngle=0===t?o.rotation:i.getMeta().data[t-1]._model.endAngle,m.endAngle=m.startAngle+m.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),i=0;return z.each(n.data,function(n,r){e=t.data[r],isNaN(e)||n.hidden||(i+=Math.abs(e))}),i},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Oe*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,i,r,s,o,a,c,l=0,u=this.chart;if(!e)for(t=0,n=u.data.datasets.length;t<n;++t)if(u.isDatasetVisible(t)){e=(i=u.getDatasetMeta(t)).data,t!==this.index&&(s=i.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)r=e[t],s?(s._configure(),o=s._resolveDataElementOptions(r,t)):o=r._options,"inner"!==o.borderAlign&&(l=(c=o.hoverBorderWidth)>(l=(a=o.borderWidth)>l?a:l)?c:l);return l},setHoverStyle:function(e){var t=e._model,n=e._options,i=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Me(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Me(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Me(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(Me(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});F._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),F._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ae=Se.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Ie=z.valueOrDefault,Re=z.options.resolve,Pe=z.canvas._isPointInArea;function Fe(e,t){var n=e&&e.options.ticks||{},i=n.reverse,r=void 0===n.min?t:0,s=void 0===n.max?t:0;return{start:i?s:r,end:i?r:s}}function We(e,t,n){var i=n/2,r=Fe(e,i),s=Fe(t,i);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function je(e){var t,n,i,r;return z.isObject(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r}}F._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var Ye=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,i=this,r=i.getMeta(),s=r.dataset,o=r.data||[],a=i._config,c=i._showLine=Ie(a.showLine,i.chart.options.showLines);for(i._xScale=i.getScaleForId(r.xAxisID),i._yScale=i.getScaleForId(r.yAxisID),c&&(void 0!==a.tension&&void 0===a.lineTension&&(a.lineTension=a.tension),s._scale=i._yScale,s._datasetIndex=i.index,s._children=o,s._model=i._resolveDatasetElementOptions(s),s.pivot()),t=0,n=o.length;t<n;++t)i.updateElement(o[t],t,e);for(c&&0!==s._model.tension&&i.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var i,r,s=this,o=s.getMeta(),a=e.custom||{},c=s.getDataset(),l=s.index,u=c.data[t],d=s._xScale,h=s._yScale,f=o.dataset._model,p=s._resolveDataElementOptions(e,t);i=d.getPixelForValue("object"==typeof u?u:NaN,t,l),r=n?h.getBasePixel():s.calculatePointY(u,t,l),e._xScale=d,e._yScale=h,e._options=p,e._datasetIndex=l,e._index=t,e._model={x:i,y:r,skip:a.skip||isNaN(i)||isNaN(r),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:Ie(a.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t=this,n=t._config,i=e.custom||{},r=t.chart.options,s=r.elements.line,o=ee.prototype._resolveDatasetElementOptions.apply(t,arguments);return o.spanGaps=Ie(n.spanGaps,r.spanGaps),o.tension=Ie(n.lineTension,s.tension),o.steppedLine=Re([i.steppedLine,n.steppedLine,s.stepped]),o.clip=je(Ie(n.clip,We(t._xScale,t._yScale,o.borderWidth))),o},calculatePointY:function(e,t,n){var i,r,s,o,a,c,l=this.chart,u=this._yScale,d=0,h=0;if(u.options.stacked){for(o=+u.getRightValue(e),c=(a=l._getSortedVisibleDatasetMetas()).length,i=0;i<c&&(r=a[i]).index!==n;++i)"line"===r.type&&r.yAxisID===u.id&&((s=+u.getRightValue(l.data.datasets[r.index].data[t]))<0?h+=s||0:d+=s||0);return u.getPixelForValue(o<0?h+o:d+o)}return u.getPixelForValue(e)},updateBezierControlPoints:function(){var e,t,n,i,r=this.chart,s=this.getMeta(),o=s.dataset._model,a=r.chartArea,c=s.data||[];function l(e,t,n){return Math.max(Math.min(e,n),t)}if(o.spanGaps&&(c=c.filter(function(e){return!e._model.skip})),"monotone"===o.cubicInterpolationMode)z.splineCurveMonotone(c);else for(e=0,t=c.length;e<t;++e)n=c[e]._model,i=z.splineCurve(z.previousItem(c,e)._model,n,z.nextItem(c,e)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(r.options.elements.line.capBezierPoints)for(e=0,t=c.length;e<t;++e)Pe(n=c[e]._model,a)&&(e>0&&Pe(c[e-1]._model,a)&&(n.controlPointPreviousX=l(n.controlPointPreviousX,a.left,a.right),n.controlPointPreviousY=l(n.controlPointPreviousY,a.top,a.bottom)),e<c.length-1&&Pe(c[e+1]._model,a)&&(n.controlPointNextX=l(n.controlPointNextX,a.left,a.right),n.controlPointNextY=l(n.controlPointNextY,a.top,a.bottom)))},draw:function(){var e,t=this,n=t.chart,i=t.getMeta(),r=i.data||[],s=n.chartArea,o=n.canvas,a=0,c=r.length;for(t._showLine&&(z.canvas.clipArea(n.ctx,{left:!1===(e=i.dataset._model.clip).left?0:s.left-e.left,right:!1===e.right?o.width:s.right+e.right,top:!1===e.top?0:s.top-e.top,bottom:!1===e.bottom?o.height:s.bottom+e.bottom}),i.dataset.draw(),z.canvas.unclipArea(n.ctx));a<c;++a)r[a].draw(s)},setHoverStyle:function(e){var t=e._model,n=e._options,i=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Ie(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=Ie(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=Ie(n.hoverBorderWidth,n.borderWidth),t.radius=Ie(n.hoverRadius,n.radius)}}),Ne=z.options.resolve;F._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data,o=s.datasets,a=s.labels;if(r.setAttribute("class",e.id+"-legend"),o.length)for(t=0,n=o[0].data.length;t<n;++t)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],a[t]&&i.appendChild(document.createTextNode(a[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map(function(n,i){var r=e.getDatasetMeta(0),s=r.controller.getStyle(i);return{text:n,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,hidden:isNaN(t.datasets[0].data[i])||r.data[i].hidden,index:i}}):[]}},onClick:function(e,t){var n,i,r,s=t.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(r=o.getDatasetMeta(n)).data[s].hidden=!r.data[s].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var ze=ee.extend({dataElementType:ge.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i,r=this,s=r.getDataset(),o=r.getMeta(),a=r.chart.options.startAngle||0,c=r._starts=[],l=r._angles=[],u=o.data;for(r._updateRadius(),o.count=r.countVisibleElements(),t=0,n=s.data.length;t<n;t++)c[t]=a,i=r._computeAngle(t),l[t]=i,a+=i;for(t=0,n=u.length;t<n;++t)u[t]._options=r._resolveDataElementOptions(u[t],t),r.updateElement(u[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(r/2,0),t.innerRadius=Math.max(i.cutoutPercentage?t.outerRadius/100*i.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var i=this,r=i.chart,s=i.getDataset(),o=r.options,a=o.animation,c=r.scale,l=r.data.labels,u=c.xCenter,d=c.yCenter,h=o.startAngle,f=e.hidden?0:c.getDistanceFromCenterForValue(s.data[t]),p=i._starts[t],m=p+(e.hidden?0:i._angles[t]),b=a.animateScale?0:c.getDistanceFromCenterForValue(s.data[t]),g=e._options||{};z.extend(e,{_datasetIndex:i.index,_index:t,_scale:c,_model:{backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,borderAlign:g.borderAlign,x:u,y:d,innerRadius:0,outerRadius:n?b:f,startAngle:n&&a.animateRotate?h:p,endAngle:n&&a.animateRotate?h:m,label:z.valueAtIndexOrDefault(l,t,l[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return z.each(t.data,function(t,i){isNaN(e.data[i])||t.hidden||n++}),n},setHoverStyle:function(e){var t=e._model,n=e._options,i=z.getHoverColor,r=z.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=r(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=r(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=r(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,i=t.getDataset(),r=t.getMeta();return isNaN(i.data[e])||r.data[e].hidden?0:Ne([t.chart.options.elements.arc.angle,2*Math.PI/n],{chart:t.chart,dataIndex:e,dataset:i,datasetIndex:t.index},e)}});F._set("pie",z.clone(F.doughnut)),F._set("pie",{cutoutPercentage:0});var $e=Ee,He=z.valueOrDefault;F._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Xe=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,linkScales:z.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,i=this,r=i.getMeta(),s=r.dataset,o=r.data||[],a=i.chart.scale,c=i._config;for(void 0!==c.tension&&void 0===c.lineTension&&(c.lineTension=c.tension),s._scale=a,s._datasetIndex=i.index,s._children=o,s._loop=!0,s._model=i._resolveDatasetElementOptions(s),s.pivot(),t=0,n=o.length;t<n;++t)i.updateElement(o[t],t,e);for(i.updateBezierControlPoints(),t=0,n=o.length;t<n;++t)o[t].pivot()},updateElement:function(e,t,n){var i=this,r=e.custom||{},s=i.getDataset(),o=i.chart.scale,a=o.getPointPositionForValue(t,s.data[t]),c=i._resolveDataElementOptions(e,t),l=i.getMeta().dataset._model,u=n?o.xCenter:a.x,d=n?o.yCenter:a.y;e._scale=o,e._options=c,e._datasetIndex=i.index,e._index=t,e._model={x:u,y:d,skip:r.skip||isNaN(u)||isNaN(d),radius:c.radius,pointStyle:c.pointStyle,rotation:c.rotation,backgroundColor:c.backgroundColor,borderColor:c.borderColor,borderWidth:c.borderWidth,tension:He(r.tension,l?l.tension:0),hitRadius:c.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,i=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return i.spanGaps=He(t.spanGaps,n.spanGaps),i.tension=He(t.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var e,t,n,i,r=this.getMeta(),s=this.chart.chartArea,o=r.data||[];function a(e,t,n){return Math.max(Math.min(e,n),t)}for(r.dataset._model.spanGaps&&(o=o.filter(function(e){return!e._model.skip})),e=0,t=o.length;e<t;++e)n=o[e]._model,i=z.splineCurve(z.previousItem(o,e,!0)._model,n,z.nextItem(o,e,!0)._model,n.tension),n.controlPointPreviousX=a(i.previous.x,s.left,s.right),n.controlPointPreviousY=a(i.previous.y,s.top,s.bottom),n.controlPointNextX=a(i.next.x,s.left,s.right),n.controlPointNextY=a(i.next.y,s.top,s.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,i=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=He(n.hoverBackgroundColor,i(n.backgroundColor)),t.borderColor=He(n.hoverBorderColor,i(n.borderColor)),t.borderWidth=He(n.hoverBorderWidth,n.borderWidth),t.radius=He(n.hoverRadius,n.radius)}});F._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),F._set("global",{datasets:{scatter:{showLine:!1}}});var Ve={bar:Se,bubble:Te,doughnut:Ee,horizontalBar:Ae,line:Ye,polarArea:ze,pie:$e,radar:Xe,scatter:Ye};function Be(e,t){return e.native?{x:e.x,y:e.y}:z.getRelativePosition(e,t)}function Ue(e,t){var n,i,r,s,o,a,c=e._getSortedVisibleDatasetMetas();for(i=0,s=c.length;i<s;++i)for(r=0,o=(n=c[i].data).length;r<o;++r)(a=n[r])._view.skip||t(a)}function qe(e,t){var n=[];return Ue(e,function(e){e.inRange(t.x,t.y)&&n.push(e)}),n}function Ge(e,t,n,i){var r=Number.POSITIVE_INFINITY,s=[];return Ue(e,function(e){if(!n||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),a=i(t,o);a<r?(s=[e],r=a):a===r&&s.push(e)}}),s}function Je(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,i){var r=t?Math.abs(e.x-i.x):0,s=n?Math.abs(e.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}function Ke(e,t,n){var i=Be(t,e);n.axis=n.axis||"x";var r=Je(n.axis),s=n.intersect?qe(e,i):Ge(e,i,!1,r),o=[];return s.length?(e._getSortedVisibleDatasetMetas().forEach(function(e){var t=e.data[s[0]._index];t&&!t._view.skip&&o.push(t)}),o):[]}var Qe={modes:{single:function(e,t){var n=Be(t,e),i=[];return Ue(e,function(e){if(e.inRange(n.x,n.y))return i.push(e),i}),i.slice(0,1)},label:Ke,index:Ke,dataset:function(e,t,n){var i=Be(t,e);n.axis=n.axis||"xy";var r=Je(n.axis),s=n.intersect?qe(e,i):Ge(e,i,!1,r);return s.length>0&&(s=e.getDatasetMeta(s[0]._datasetIndex).data),s},"x-axis":function(e,t){return Ke(e,t,{intersect:!1})},point:function(e,t){return qe(e,Be(t,e))},nearest:function(e,t,n){var i=Be(t,e);n.axis=n.axis||"xy";var r=Je(n.axis);return Ge(e,i,n.intersect,r)},x:function(e,t,n){var i=Be(t,e),r=[],s=!1;return Ue(e,function(e){e.inXRange(i.x)&&r.push(e),e.inRange(i.x,i.y)&&(s=!0)}),n.intersect&&!s&&(r=[]),r},y:function(e,t,n){var i=Be(t,e),r=[],s=!1;return Ue(e,function(e){e.inYRange(i.y)&&r.push(e),e.inRange(i.x,i.y)&&(s=!0)}),n.intersect&&!s&&(r=[]),r}}},Ze=z.extend;function et(e,t){return z.where(e,function(e){return e.pos===t})}function tt(e,t){return e.sort(function(e,n){var i=t?n:e,r=t?e:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function nt(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function it(e,t,n){var i,r,s=n.box,o=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?s.height:s.width,e[n.pos]+=n.size,s.getPadding){var a=s.getPadding();o.top=Math.max(o.top,a.top),o.left=Math.max(o.left,a.left),o.bottom=Math.max(o.bottom,a.bottom),o.right=Math.max(o.right,a.right)}if(i=t.outerWidth-nt(o,e,"left","right"),r=t.outerHeight-nt(o,e,"top","bottom"),i!==e.w||r!==e.h){e.w=i,e.h=r;var c=n.horizontal?[i,e.w]:[r,e.h];return!(c[0]===c[1]||isNaN(c[0])&&isNaN(c[1]))}}function rt(e,t){var n,i=t.maxPadding;return n={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach(function(e){n[e]=Math.max(t[e],i[e])}),n}function st(e,t,n){var i,r,s,o,a,c,l=[];for(i=0,r=e.length;i<r;++i)(o=(s=e[i]).box).update(s.width||t.w,s.height||t.h,rt(s.horizontal,t)),it(t,n,s)&&(c=!0,l.length&&(a=!0)),o.fullWidth||l.push(s);return a&&st(l,t,n)||c}function ot(e,t,n){var i,r,s,o,a=n.padding,c=t.x,l=t.y;for(i=0,r=e.length;i<r;++i)o=(s=e[i]).box,s.horizontal?(o.left=o.fullWidth?a.left:t.left,o.right=o.fullWidth?n.outerWidth-a.right:t.left+t.w,o.top=l,o.bottom=l+o.height,o.width=o.right-o.left,l=o.bottom):(o.left=c,o.right=c+o.width,o.top=t.top,o.bottom=t.top+t.h,o.height=o.bottom-o.top,c=o.right);t.x=c,t.y=l}F._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var at,ct={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var i,r=["fullWidth","position","weight"],s=r.length,o=0;o<s;++o)n.hasOwnProperty(i=r[o])&&(t[i]=n[i])},update:function(e,t,n){if(e){var i=z.options.toPadding((e.options.layout||{}).padding),r=t-i.width,s=n-i.height,o=function(e){var t=function(e){var t,n,i,r=[];for(t=0,n=(e||[]).length;t<n;++t)r.push({index:t,box:i=e[t],pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return r}(e),n=tt(et(t,"left"),!0),i=tt(et(t,"right")),r=tt(et(t,"top"),!0),s=tt(et(t,"bottom"));return{leftAndTop:n.concat(r),rightAndBottom:i.concat(s),chartArea:et(t,"chartArea"),vertical:n.concat(i),horizontal:r.concat(s)}}(e.boxes),a=o.vertical,c=o.horizontal,l=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:r,vBoxMaxWidth:r/2/a.length,hBoxMaxHeight:s/2}),u=Ze({maxPadding:Ze({},i),w:r,h:s,x:i.left,y:i.top},i);(function(e,t){var n,i,r;for(n=0,i=e.length;n<i;++n)(r=e[n]).width=r.horizontal?r.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,r.height=r.horizontal&&t.hBoxMaxHeight})(a.concat(c),l),st(a,u,l),st(c,u,l)&&st(a,u,l),function(e){var t=e.maxPadding;function n(n){var i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(u),ot(o.leftAndTop,u,l),u.x+=u.w,u.y+=u.h,ot(o.rightAndBottom,u,l),e.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h},z.each(o.chartArea,function(t){var n=t.box;Ze(n,e.chartArea),n.update(u.w,u.h)})}}},lt=(at=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&at.default||at,ut="chartjs-size-monitor",dt="chartjs-render-monitor",ht=["animationstart","webkitAnimationStart"],ft={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function pt(e,t){var n=z.getStyle(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var mt=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(n){}return e}()&&{passive:!0};function bt(e,t,n){e.addEventListener(t,n,mt)}function gt(e,t,n){e.removeEventListener(t,n,mt)}function _t(e,t,n,i,r){return{type:e,chart:t,native:r||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function vt(e){var t=document.createElement("div");return t.className=e||"",t}var yt={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document;!function(e,t){var n=e.$chartjs||(e.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(t)),e.appendChild(i)}}(t.host?t:document.head,lt)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),function(e,t){var n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var s=pt(e,"width");void 0!==s&&(e.width=s)}if(null===i||""===i)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=pt(e,"height");void 0!==s&&(e.height=o)}}(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t.$chartjs){var n=t.$chartjs.initial;["height","width"].forEach(function(e){var i=n[e];z.isNullOrUndef(i)?t.removeAttribute(e):t.setAttribute(e,i)}),z.each(n.style||{},function(e,n){t.style[n]=e}),t.width=t.width,delete t.$chartjs}},addEventListener:function(e,t,n){var i=e.canvas;if("resize"!==t){var r=n.$chartjs||(n.$chartjs={});bt(i,t,(r.proxies||(r.proxies={}))[e.id+"_"+t]=function(t){n(function(e,t){var n=ft[e.type]||e.type,i=z.getRelativePosition(e,t);return _t(n,t,i.x,i.y,e)}(t,e))})}else!function(e,t,n){var i,r,s,o,a=e.$chartjs||(e.$chartjs={}),c=a.resizer=function(e){var t=1e6,n=vt(ut),i=vt(ut+"-expand"),r=vt(ut+"-shrink");i.appendChild(vt()),r.appendChild(vt()),n.appendChild(i),n.appendChild(r),n._reset=function(){i.scrollLeft=t,i.scrollTop=t,r.scrollLeft=t,r.scrollTop=t};var s=function(){n._reset(),e()};return bt(i,"scroll",s.bind(i,"expand")),bt(r,"scroll",s.bind(r,"shrink")),n}((i=function(){if(a.resizer){var i=n.options.maintainAspectRatio&&e.parentNode,r=i?i.clientWidth:0;t(_t("resize",n)),i&&i.clientWidth<r&&n.canvas&&t(_t("resize",n))}},s=!1,o=[],function(){o=Array.prototype.slice.call(arguments),r=r||this,s||(s=!0,z.requestAnimFrame.call(window,function(){s=!1,i.apply(r,o)}))}));!function(e,t){var n=e.$chartjs||(e.$chartjs={}),i=n.renderProxy=function(e){"chartjs-render-animation"===e.animationName&&t()};z.each(ht,function(t){bt(e,t,i)}),n.reflow=!!e.offsetParent,e.classList.add(dt)}(e,function(){if(a.resizer){var t=e.parentNode;t&&t!==c.parentNode&&t.insertBefore(c,t.firstChild),c._reset()}})}(i,n,e)},removeEventListener:function(e,t,n){var i,r,s,o=e.canvas;if("resize"!==t){var a=((n.$chartjs||{}).proxies||{})[e.id+"_"+t];a&&gt(o,t,a)}else s=(r=(i=o).$chartjs||{}).resizer,delete r.resizer,function(e){var t=e.$chartjs||{},n=t.renderProxy;n&&(z.each(ht,function(t){gt(e,t,n)}),delete t.renderProxy),e.classList.remove(dt)}(i),s&&s.parentNode&&s.parentNode.removeChild(s)}};z.addEvent=bt,z.removeEvent=gt;var wt=z.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},yt._enabled?yt:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});F._set("global",{plugins:{}});var Dt={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach(function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var i,r,s,o,a,c=this.descriptors(e),l=c.length;for(i=0;i<l;++i)if("function"==typeof(a=(s=(r=c[i]).plugin)[t])&&((o=[e].concat(n||[])).push(r.options),!1===a.apply(s,o)))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],i=[],r=e&&e.config||{},s=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach(function(e){if(-1===n.indexOf(e)){var t=e.id,r=s[t];!1!==r&&(!0===r&&(r=z.clone(F.global.plugins[t])),n.push(e),i.push({plugin:e,options:r||{}}))}}),t.descriptors=i,t.id=this._cacheId,i},_invalidate:function(e){delete e.$plugins}},St={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=z.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?z.merge(Object.create(null),[F.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var n=this;n.defaults.hasOwnProperty(e)&&(n.defaults[e]=z.extend(n.defaults[e],t))},addScalesToLayout:function(e){z.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,ct.addBox(e,t)})}},xt=z.valueOrDefault,kt=z.rtl.getRtlAdapter;F._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:z.noop,title:function(e,t){var n="",i=t.labels,r=i?i.length:0;if(e.length>0){var s=e[0];s.label?n=s.label:s.xLabel?n=s.xLabel:r>0&&s.index<r&&(n=i[s.index])}return n},afterTitle:z.noop,beforeBody:z.noop,beforeLabel:z.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),z.isNullOrUndef(e.value)?n+=e.yLabel:n+=e.value,n},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:z.noop,afterBody:z.noop,beforeFooter:z.noop,footer:z.noop,afterFooter:z.noop}}});var Tt={average:function(e){if(!e.length)return!1;var t,n,i=0,r=0,s=0;for(t=0,n=e.length;t<n;++t){var o=e[t];if(o&&o.hasValue()){var a=o.tooltipPosition();i+=a.x,r+=a.y,++s}}return{x:i/s,y:r/s}},nearest:function(e,t){var n,i,r,s=t.x,o=t.y,a=Number.POSITIVE_INFINITY;for(n=0,i=e.length;n<i;++n){var c=e[n];if(c&&c.hasValue()){var l=c.getCenterPoint(),u=z.distanceBetweenPoints(t,l);u<a&&(a=u,r=c)}}if(r){var d=r.tooltipPosition();s=d.x,o=d.y}return{x:s,y:o}}};function Mt(e,t){return t&&(z.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ct(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Ot(e){var t=F.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:xt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:xt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:xt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:xt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:xt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:xt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:xt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:xt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:xt(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Lt(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Et(e){return Mt([],Ct(e))}var At=B.extend({initialize:function(){this._model=Ot(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),i=t.title.apply(e,arguments),r=t.afterTitle.apply(e,arguments),s=[];return s=Mt(s,Ct(n)),s=Mt(s,Ct(i)),Mt(s,Ct(r))},getBeforeBody:function(){return Et(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,i=n._options.callbacks,r=[];return z.each(e,function(e){var s={before:[],lines:[],after:[]};Mt(s.before,Ct(i.beforeLabel.call(n,e,t))),Mt(s.lines,i.label.call(n,e,t)),Mt(s.after,Ct(i.afterLabel.call(n,e,t))),r.push(s)}),r},getAfterBody:function(){return Et(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),i=t.footer.apply(e,arguments),r=t.afterFooter.apply(e,arguments),s=[];return s=Mt(s,Ct(n)),s=Mt(s,Ct(i)),Mt(s,Ct(r))},update:function(e){var t,n,i,r,s,o,a,c,l,u,d=this,h=d._options,f=d._model,p=d._model=Ot(h),m=d._active,b=d._data,g={xAlign:f.xAlign,yAlign:f.yAlign},_={x:f.x,y:f.y},v={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(m.length){p.opacity=1;var w=[],D=[];y=Tt[h.position].call(d,m,d._eventPosition);var S=[];for(t=0,n=m.length;t<n;++t)S.push((r=void 0,s=void 0,void 0,void 0,c=void 0,l=void 0,u=void 0,r=(i=m[t])._xScale,s=i._yScale||i._scale,o=i._index,l=(c=i._chart.getDatasetMeta(a=i._datasetIndex).controller)._getIndexScale(),u=c._getValueScale(),{xLabel:r?r.getLabelForIndex(o,a):"",yLabel:s?s.getLabelForIndex(o,a):"",label:l?""+l.getLabelForIndex(o,a):"",value:u?""+u.getLabelForIndex(o,a):"",index:o,datasetIndex:a,x:i._model.x,y:i._model.y}));h.filter&&(S=S.filter(function(e){return h.filter(e,b)})),h.itemSort&&(S=S.sort(function(e,t){return h.itemSort(e,t,b)})),z.each(S,function(e){w.push(h.callbacks.labelColor.call(d,e,d._chart)),D.push(h.callbacks.labelTextColor.call(d,e,d._chart))}),p.title=d.getTitle(S,b),p.beforeBody=d.getBeforeBody(S,b),p.body=d.getBody(S,b),p.afterBody=d.getAfterBody(S,b),p.footer=d.getFooter(S,b),p.x=y.x,p.y=y.y,p.caretPadding=h.caretPadding,p.labelColors=w,p.labelTextColors=D,p.dataPoints=S,_=function(e,t,n,i){var r=e.x,s=e.y,o=e.caretPadding,a=n.xAlign,c=n.yAlign,l=e.caretSize+o,u=e.cornerRadius+o;return"right"===a?r-=t.width:"center"===a&&((r-=t.width/2)+t.width>i.width&&(r=i.width-t.width),r<0&&(r=0)),"top"===c?s+=l:s-="bottom"===c?t.height+l:t.height/2,"center"===c?"left"===a?r+=l:"right"===a&&(r-=l):"left"===a?r-=u:"right"===a&&(r+=u),{x:r,y:s}}(p,v=function(e,t){var n=e._chart.ctx,i=2*t.yPadding,r=0,s=t.body,o=s.reduce(function(e,t){return e+t.before.length+t.lines.length+t.after.length},0),a=t.title.length,c=t.footer.length,l=t.titleFontSize,u=t.bodyFontSize,d=t.footerFontSize;i+=a*l,i+=a?(a-1)*t.titleSpacing:0,i+=a?t.titleMarginBottom:0,i+=(o+=t.beforeBody.length+t.afterBody.length)*u,i+=o?(o-1)*t.bodySpacing:0,i+=c?t.footerMarginTop:0,i+=c*d,i+=c?(c-1)*t.footerSpacing:0;var h=0,f=function(e){r=Math.max(r,n.measureText(e).width+h)};return n.font=z.fontString(l,t._titleFontStyle,t._titleFontFamily),z.each(t.title,f),n.font=z.fontString(u,t._bodyFontStyle,t._bodyFontFamily),z.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?u+2:0,z.each(s,function(e){z.each(e.before,f),z.each(e.lines,f),z.each(e.after,f)}),h=0,n.font=z.fontString(d,t._footerFontStyle,t._footerFontFamily),z.each(t.footer,f),{width:r+=2*t.xPadding,height:i}}(this,p),g=function(e,t){var n,i,r,s,o,a=e._model,c=e._chart,l=e._chart.chartArea,u="center",d="center";a.y<t.height?d="top":a.y>c.height-t.height&&(d="bottom");var h=(l.left+l.right)/2,f=(l.top+l.bottom)/2;"center"===d?(n=function(e){return e<=h},i=function(e){return e>h}):(n=function(e){return e<=t.width/2},i=function(e){return e>=c.width-t.width/2}),r=function(e){return e+t.width+a.caretSize+a.caretPadding>c.width},s=function(e){return e-t.width-a.caretSize-a.caretPadding<0},o=function(e){return e<=f?"top":"bottom"},n(a.x)?(u="left",r(a.x)&&(u="center",d=o(a.y))):i(a.x)&&(u="right",s(a.x)&&(u="center",d=o(a.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:u,yAlign:p.yAlign?p.yAlign:d}}(this,v),d._chart)}else p.opacity=0;return p.xAlign=g.xAlign,p.yAlign=g.yAlign,p.x=_.x,p.y=_.y,p.width=v.width,p.height=v.height,p.caretX=y.x,p.caretY=y.y,d._model=p,e&&h.custom&&h.custom.call(d,p),d},drawCaret:function(e,t){var n=this._chart.ctx,i=this.getCaretPosition(e,t,this._view);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(e,t,n){var i,r,s,o,a,c,l=n.caretSize,u=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=e.x,p=e.y,m=t.width,b=t.height;if("center"===h)a=p+b/2,"left"===d?(r=(i=f)-l,s=i,o=a+l,c=a-l):(r=(i=f+m)+l,s=i,o=a-l,c=a+l);else if("left"===d?(i=(r=f+u+l)-l,s=r+l):"right"===d?(i=(r=f+m-u-l)-l,s=r+l):(i=(r=n.caretX)-l,s=r+l),"top"===h)a=(o=p)-l,c=o;else{a=(o=p+b)+l,c=o;var g=s;s=i,i=g}return{x1:i,x2:r,x3:s,y1:o,y2:a,y3:c}},drawTitle:function(e,t,n){var i,r,s,o=t.title,a=o.length;if(a){var c=kt(t.rtl,t.x,t.width);for(e.x=Lt(t,t._titleAlign),n.textAlign=c.textAlign(t._titleAlign),n.textBaseline="middle",i=t.titleFontSize,r=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=z.fontString(i,t._titleFontStyle,t._titleFontFamily),s=0;s<a;++s)n.fillText(o[s],c.x(e.x),e.y+i/2),e.y+=i+r,s+1===a&&(e.y+=t.titleMarginBottom-r)}},drawBody:function(e,t,n){var i,r,s,o,a,c,l,u,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,m=t.displayColors,b=0,g=m?Lt(t,"left"):0,_=kt(t.rtl,t.x,t.width),v=function(t){n.fillText(t,_.x(e.x+b),e.y+d/2),e.y+=d+h},y=_.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=z.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=Lt(t,y),n.fillStyle=t.bodyFontColor,z.each(t.beforeBody,v),b=m&&"right"!==y?"center"===f?d/2+1:d+2:0,a=0,l=p.length;a<l;++a){for(i=p[a],s=t.labelColors[a],n.fillStyle=r=t.labelTextColors[a],z.each(i.before,v),c=0,u=(o=i.lines).length;c<u;++c){if(m){var w=_.x(g);n.fillStyle=t.legendColorBackground,n.fillRect(_.leftForLtr(w,d),e.y,d,d),n.lineWidth=1,n.strokeStyle=s.borderColor,n.strokeRect(_.leftForLtr(w,d),e.y,d,d),n.fillStyle=s.backgroundColor,n.fillRect(_.leftForLtr(_.xPlus(w,1),d-2),e.y+1,d-2,d-2),n.fillStyle=r}v(o[c])}z.each(i.after,v)}b=0,z.each(t.afterBody,v),e.y-=h},drawFooter:function(e,t,n){var i,r,s=t.footer,o=s.length;if(o){var a=kt(t.rtl,t.x,t.width);for(e.x=Lt(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=a.textAlign(t._footerAlign),n.textBaseline="middle",i=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=z.fontString(i,t._footerFontStyle,t._footerFontFamily),r=0;r<o;++r)n.fillText(s[r],a.x(e.x),e.y+i/2),e.y+=i+t.footerSpacing}},drawBackground:function(e,t,n,i){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var r=t.xAlign,s=t.yAlign,o=e.x,a=e.y,c=i.width,l=i.height,u=t.cornerRadius;n.beginPath(),n.moveTo(o+u,a),"top"===s&&this.drawCaret(e,i),n.lineTo(o+c-u,a),n.quadraticCurveTo(o+c,a,o+c,a+u),"center"===s&&"right"===r&&this.drawCaret(e,i),n.lineTo(o+c,a+l-u),n.quadraticCurveTo(o+c,a+l,o+c-u,a+l),"bottom"===s&&this.drawCaret(e,i),n.lineTo(o+u,a+l),n.quadraticCurveTo(o,a+l,o,a+l-u),"center"===s&&"left"===r&&this.drawCaret(e,i),n.lineTo(o,a+u),n.quadraticCurveTo(o,a,o+u,a),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},i={x:t.x,y:t.y},r=Math.abs(t.opacity<.001)?0:t.opacity;this._options.enabled&&(t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length)&&(e.save(),e.globalAlpha=r,this.drawBackground(i,t,e,n),i.y+=t.yPadding,z.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),z.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===e.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,i.mode,i),i.reverse&&n._active.reverse()),(t=!z.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}});At.positioners=Tt;var It=z.valueOrDefault;function Rt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){if("xAxes"===e||"yAxes"===e){var r,s,o,a=n[e].length;for(t[e]||(t[e]=[]),r=0;r<a;++r)s=It((o=n[e][r]).type,"xAxes"===e?"category":"linear"),r>=t[e].length&&t[e].push({}),z.merge(t[e][r],!t[e][r].type||o.type&&o.type!==t[e][r].type?[St.getScaleDefaults(s),o]:o)}else z._merger(e,t,n,i)}})}function Pt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,i){var r=t[e]||Object.create(null),s=n[e];"scales"===e?t[e]=Rt(r,s):"scale"===e?t[e]=z.merge(r,[St.getScaleDefaults(s.type),s]):z._merger(e,t,n,i)}})}function Ft(e){var t=e.options;z.each(e.scales,function(t){ct.removeBox(e,t)}),t=Pt(F.global,F[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Wt(e,t,n){var i,r=function(e){return e.id===i};do{i=t+n++}while(z.findIndex(e,r)>=0);return i}function jt(e){return"top"===e||"bottom"===e}function Yt(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}F._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Nt=function(e,t){return this.construct(e,t),this};z.extend(Nt.prototype,{construct:function(e,t){var n=this;t=function(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Pt(F.global,F[e.type],e.options||{}),e}(t);var i=wt.acquireContext(e,t),r=i&&i.canvas,s=r&&r.height,o=r&&r.width;n.id=z.uid(),n.ctx=i,n.canvas=r,n.config=t,n.width=o,n.height=s,n.aspectRatio=s?o/s:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Nt.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),i&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return Dt.notify(e,"beforeInit"),z.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),Dt.notify(e,"afterInit"),e},clear:function(){return z.canvas.clear(this),this},stop:function(){return G.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,i=t.canvas,r=n.maintainAspectRatio&&t.aspectRatio||null,s=Math.max(0,Math.floor(z.getMaximumWidth(i))),o=Math.max(0,Math.floor(r?s/r:z.getMaximumHeight(i)));if((t.width!==s||t.height!==o)&&(i.width=t.width=s,i.height=t.height=o,i.style.width=s+"px",i.style.height=o+"px",z.retinaScale(t,n.devicePixelRatio),!e)){var a={width:s,height:o};Dt.notify(t,"resize",[a]),n.onResize&&n.onResize(t,a),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;z.each(t.xAxes,function(e,n){e.id||(e.id=Wt(t.xAxes,"x-axis-",n))}),z.each(t.yAxes,function(e,n){e.id||(e.id=Wt(t.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},i=[],r=Object.keys(n).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(i=i.concat((t.scales.xAxes||[]).map(function(e){return{options:e,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(e){return{options:e,dtype:"linear",dposition:"left"}}))),t.scale&&i.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),z.each(i,function(t){var i=t.options,s=i.id,o=It(i.type,t.dtype);jt(i.position)!==jt(t.dposition)&&(i.position=t.dposition),r[s]=!0;var a=null;if(s in n&&n[s].type===o)(a=n[s]).options=i,a.ctx=e.ctx,a.chart=e;else{var c=St.getScaleConstructor(o);if(!c)return;a=new c({id:s,type:o,options:i,ctx:e.ctx,chart:e}),n[a.id]=a}a.mergeTicksOptions(),t.isDefault&&(e.scale=a)}),z.each(r,function(e,t){e||delete n[t]}),e.scales=n,St.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,i=[],r=n.data.datasets;for(e=0,t=r.length;e<t;e++){var s=r[e],o=n.getDatasetMeta(e),a=s.type||n.config.type;if(o.type&&o.type!==a&&(n.destroyDatasetMeta(e),o=n.getDatasetMeta(e)),o.type=a,o.order=s.order||0,o.index=e,o.controller)o.controller.updateIndex(e),o.controller.linkScales();else{var c=Ve[o.type];if(void 0===c)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new c(n,e),i.push(o.controller)}}return i},resetElements:function(){var e=this;z.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),Ft(i),Dt._invalidate(i),!1!==Dt.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var r=i.buildOrUpdateControllers();for(t=0,n=i.data.datasets.length;t<n;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&z.each(r,function(e){e.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],Dt.notify(i,"afterUpdate"),i._layers.sort(Yt("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;!1!==Dt.notify(e,"beforeLayout")&&(ct.update(this,this.width,this.height),e._layers=[],z.each(e.boxes,function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())},e),e._layers.forEach(function(e,t){e._idx=t}),Dt.notify(e,"afterScaleUpdate"),Dt.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==Dt.notify(e,"beforeDatasetsUpdate")){for(var t=0,n=e.data.datasets.length;t<n;++t)e.updateDataset(t);Dt.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,n=t.getDatasetMeta(e),i={meta:n,index:e};!1!==Dt.notify(t,"beforeDatasetUpdate",[i])&&(n.controller._update(),Dt.notify(t,"afterDatasetUpdate",[i]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,i=It(e.duration,n&&n.duration),r=e.lazy;if(!1!==Dt.notify(t,"beforeRender")){var s=function(e){Dt.notify(t,"afterRender"),z.callback(n&&n.onComplete,[e],t)};if(n&&i){var o=new q({numSteps:i/16.66,easing:e.easing||n.easing,render:function(e,t){var n=t.currentStep,i=n/t.numSteps;e.draw((0,z.easing.effects[t.easing])(i),i,n)},onAnimationProgress:n.onProgress,onAnimationComplete:s});G.addAnimation(t,o,i,r)}else t.draw(),s(new q({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,i=this;if(i.clear(),z.isNullOrUndef(e)&&(e=1),i.transition(e),!(i.width<=0||i.height<=0)&&!1!==Dt.notify(i,"beforeDraw",[e])){for(n=i._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(i.chartArea);for(i.drawDatasets(e);t<n.length;++t)n[t].draw(i.chartArea);i._drawTooltip(e),Dt.notify(i,"afterDraw",[e])}},transition:function(e){for(var t=this,n=0,i=(t.data.datasets||[]).length;n<i;++n)t.isDatasetVisible(n)&&t.getDatasetMeta(n).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,i=this,r=[];for(t=0,n=(i.data.datasets||[]).length;t<n;++t)e&&!i.isDatasetVisible(t)||r.push(i.getDatasetMeta(t));return r.sort(Yt("order","index")),r},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n,i=this;if(!1!==Dt.notify(i,"beforeDatasetsDraw",[e])){for(n=(t=i._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)i.drawDataset(t[n],e);Dt.notify(i,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};!1!==Dt.notify(this,"beforeDatasetDraw",[n])&&(e.controller.draw(t),Dt.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this,n=t.tooltip,i={tooltip:n,easingValue:e};!1!==Dt.notify(t,"beforeTooltipDraw",[i])&&(n.draw(),Dt.notify(t,"afterTooltipDraw",[i]))},getElementAtEvent:function(e){return Qe.modes.single(this,e)},getElementsAtEvent:function(e){return Qe.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Qe.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var i=Qe.modes[t];return"function"==typeof i?i(this,e,n):[]},getDatasetAtEvent:function(e){return Qe.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var i=n._meta[t.id];return i||(i=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),i},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],i=n._meta&&n._meta[t];i&&(i.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,i=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);i&&(n.unbindEvents(),z.canvas.clear(n),wt.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Dt.notify(n,"destroy"),delete Nt.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new At({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};z.each(e.options.events,function(i){wt.addEventListener(e,i,n),t[i]=n}),e.options.responsive&&(n=function(){e.resize()},wt.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,z.each(t,function(t,n){wt.removeEventListener(e,n,t)}))},updateHoverStyle:function(e,t,n){var i,r,s,o=n?"set":"remove";for(r=0,s=e.length;r<s;++r)(i=e[r])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(!1!==Dt.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var i=t.handleEvent(e);n&&(i=n._start?n.handleEvent(e):i|n.handleEvent(e)),Dt.notify(t,"afterEvent",[e]);var r=t._bufferedRequest;return r?t.render(r):i&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t,n=this,i=n.options||{},r=i.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===e.type?[]:n.getElementsAtEventForMode(e,r.mode,r),z.callback(i.onHover||i.hover.onHover,[e.native,n.active],n),"mouseup"!==e.type&&"click"!==e.type||i.onClick&&i.onClick.call(n,e.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,r.mode,!1),n.active.length&&r.mode&&n.updateHoverStyle(n.active,r.mode,!0),t=!z.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,t}}),Nt.instances={};var zt=Nt;function $t(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Ht(e){this.options=e||{}}Nt.Controller=Nt,Nt.types={},z.configMerge=Pt,z.scaleMerge=Rt,z.extend(Ht.prototype,{formats:$t,parse:$t,format:$t,add:$t,diff:$t,startOf:$t,endOf:$t,_create:function(e){return e}}),Ht.override=function(e){z.extend(Ht.prototype,e)};var Xt={_date:Ht},Vt={formatters:{values:function(e){return z.isArray(e)?e:""+e},linear:function(e,t,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&e!==Math.floor(e)&&(i=e-Math.floor(e));var r=z.log10(Math.abs(i)),s="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=z.log10(Math.abs(e)),a=Math.floor(o)-Math.floor(r);a=Math.max(Math.min(a,20),0),s=e.toExponential(a)}else{var c=-1*Math.floor(r);c=Math.max(Math.min(c,20),0),s=e.toFixed(c)}else s="0";return s},logarithmic:function(e,t,n){var i=e/Math.pow(10,Math.floor(z.log10(e)));return 0===e?"0":1===i||2===i||5===i||0===t||t===n.length-1?e.toExponential():""}}},Bt=z.isArray,Ut=z.isNullOrUndef,qt=z.valueOrDefault,Gt=z.valueAtIndexOrDefault;function Jt(e,t,n){var i,r=e.getTicks().length,s=Math.min(t,r-1),o=e.getPixelForTick(s),a=e._startPixel,c=e._endPixel,l=1e-6;if(!(n&&(i=1===r?Math.max(o-a,c-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(s-1))/2,(o+=s<t?i:-i)<a-l||o>c+l)))return o}function Kt(e){return e.drawTicks?e.tickMarkLength:0}function Qt(e){var t,n;return e.display?(t=z.options._parseFont(e),n=z.options.toPadding(e.padding),t.lineHeight+n.height):0}function Zt(e,t){return z.extend(z.options._parseFont({fontFamily:qt(t.fontFamily,e.fontFamily),fontSize:qt(t.fontSize,e.fontSize),fontStyle:qt(t.fontStyle,e.fontStyle),lineHeight:qt(t.lineHeight,e.lineHeight)}),{color:z.options.resolve([t.fontColor,e.fontColor,F.global.defaultFontColor])})}function en(e){var t=Zt(e,e.minor);return{minor:t,major:e.major.enabled?Zt(e,e.major):t}}function tn(e){var t,n,i,r=[];for(n=0,i=e.length;n<i;++n)void 0!==(t=e[n])._index&&r.push(t);return r}function nn(e,t,n,i){var r,s,o,a,c=qt(n,0),l=Math.min(qt(i,e.length),e.length),u=0;for(t=Math.ceil(t),i&&(t=(r=i-n)/Math.floor(r/t)),a=c;a<0;)u++,a=Math.round(c+u*t);for(s=Math.max(c,0);s<l;s++)o=e[s],s===a?(o._index=s,u++,a=Math.round(c+u*t)):delete o.label}F._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{}}});var rn=B.extend({zeroLineIndex:0,getPadding:function(){var e=this;return{left:e.paddingLeft||0,top:e.paddingTop||0,right:e.paddingRight||0,bottom:e.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){z.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var i,r,s,o,a,c=this,l=c.options.ticks,u=l.sampleSize;if(c.beforeUpdate(),c.maxWidth=e,c.maxHeight=t,c.margins=z.extend({left:0,right:0,top:0,bottom:0},n),c._ticks=null,c.ticks=null,c._labelSizes=null,c._maxLabelLines=0,c.longestLabelWidth=0,c.longestTextCache=c.longestTextCache||{},c._gridLineItems=null,c._labelItems=null,c.beforeSetDimensions(),c.setDimensions(),c.afterSetDimensions(),c.beforeDataLimits(),c.determineDataLimits(),c.afterDataLimits(),c.beforeBuildTicks(),o=c.buildTicks()||[],(!(o=c.afterBuildTicks(o)||o)||!o.length)&&c.ticks)for(o=[],i=0,r=c.ticks.length;i<r;++i)o.push({value:c.ticks[i],major:!1});return c._ticks=o,s=c._convertTicksToLabels((a=u<o.length)?function(e,t){for(var n=[],i=e.length/t,r=0,s=e.length;r<s;r+=i)n.push(e[Math.floor(r)]);return n}(o,u):o),c._configure(),c.beforeCalculateTickRotation(),c.calculateTickRotation(),c.afterCalculateTickRotation(),c.beforeFit(),c.fit(),c.afterFit(),c._ticksToDraw=l.display&&(l.autoSkip||"auto"===l.source)?c._autoSkip(o):o,a&&(s=c._convertTicksToLabels(c._ticksToDraw)),c.ticks=s,c.afterUpdate(),c.minSize},_configure:function(){var e,t,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,i=!i),n._startPixel=e,n._endPixel=t,n._reversePixels=i,n._length=t-e},afterUpdate:function(){z.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){z.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){z.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){z.callback(this.options.beforeDataLimits,[this])},determineDataLimits:z.noop,afterDataLimits:function(){z.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){z.callback(this.options.beforeBuildTicks,[this])},buildTicks:z.noop,afterBuildTicks:function(e){var t=this;return Bt(e)&&e.length?z.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=z.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){z.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this,t=e.options.ticks;e.ticks=e.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){z.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){z.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,i,r,s,o,a=this,c=a.options,l=c.ticks,u=a.getTicks().length,d=l.minRotation||0,h=l.maxRotation,f=d;!a._isVisible()||!l.display||d>=h||u<=1||!a.isHorizontal()?a.labelRotation=d:(t=(e=a._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,i=Math.min(a.maxWidth,a.chart.width-t),t+6>(r=c.offset?a.maxWidth/u:i/(u-1))&&(r=i/(u-(c.offset?.5:1)),s=a.maxHeight-Kt(c.gridLines)-l.padding-Qt(c.scaleLabel),o=Math.sqrt(t*t+n*n),f=z.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/r,1)),Math.asin(Math.min(s/o,1))-Math.asin(n/o))),f=Math.max(d,Math.min(h,f))),a.labelRotation=f)},afterCalculateTickRotation:function(){z.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){z.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,i=e.options,r=i.ticks,s=i.scaleLabel,o=i.gridLines,a=e._isVisible(),c="bottom"===i.position,l=e.isHorizontal();if(l?t.width=e.maxWidth:a&&(t.width=Kt(o)+Qt(s)),l?a&&(t.height=Kt(o)+Qt(s)):t.height=e.maxHeight,r.display&&a){var u=en(r),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,m=d.highest,b=.4*u.minor.lineHeight,g=r.padding;if(l){var _=0!==e.labelRotation,v=z.toRadians(e.labelRotation),y=Math.cos(v),w=Math.sin(v);t.height=Math.min(e.maxHeight,t.height+(w*p.width+y*(m.height-(_?m.offset:0))+(_?0:b))+g);var D,S,x=e.getPixelForTick(0)-e.left,k=e.right-e.getPixelForTick(e.getTicks().length-1);_?(D=c?y*h.width+w*h.offset:w*(h.height-h.offset),S=c?w*(f.height-f.offset):y*f.width+w*f.offset):(D=h.width/2,S=f.width/2),e.paddingLeft=Math.max((D-x)*e.width/(e.width-x),0)+3,e.paddingRight=Math.max((S-k)*e.width/(e.width-k),0)+3}else t.width=Math.min(e.maxWidth,t.width+(r.mirror?0:p.width+g+b)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),l?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){z.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Ut(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,i,r=this;for(r.ticks=e.map(function(e){return e.value}),r.beforeTickToLabelConversion(),t=r.convertTicksToLabels(e)||r.ticks,r.afterTickToLabelConversion(),n=0,i=e.length;n<i;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,n,i){var r,s,o,a,c,l,u,d,h,f,p,m,b,g=n.length,_=[],v=[],y=[],w=0,D=0;for(r=0;r<g;++r){if(a=n[r].label,e.font=l=(c=n[r].major?t.major:t.minor).string,u=i[l]=i[l]||{data:{},gc:[]},d=c.lineHeight,h=f=0,Ut(a)||Bt(a)){if(Bt(a))for(s=0,o=a.length;s<o;++s)Ut(p=a[s])||Bt(p)||(h=z.measureText(e,u.data,u.gc,h,p),f+=d)}else h=z.measureText(e,u.data,u.gc,h,a),f=d;_.push(h),v.push(f),y.push(d/2),w=Math.max(h,w),D=Math.max(f,D)}function S(e){return{width:_[e]||0,height:v[e]||0,offset:y[e]||0}}return function(e,t){z.each(e,function(e){var n,i=e.gc,r=i.length/2;if(r>t){for(n=0;n<r;++n)delete e.data[i[n]];i.splice(0,r)}})}(i,g),m=_.indexOf(w),b=v.indexOf(D),{first:S(0),last:S(g-1),widest:S(m),highest:S(b)}}(e.ctx,en(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,i,r;return Bt(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),i=Math.min(t,n),r=Math.max(t,n)):(t=void 0,n=e=+this.getRightValue(e),i=e,r=e),{min:i,max:r,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:z.noop,getPixelForValue:z.noop,getValueForPixel:z.noop,getPixelForTick:function(e){var t=this,n=t.options.offset,i=t._ticks.length,r=1/Math.max(i-(n?0:1),1);return e<0||e>i-1?null:t.getPixelForDecimal(e*r+(n?r/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,i,r,s=this,o=s.options.ticks,a=o.maxTicksLimit||s._length/s._tickSize()+1,c=o.major.enabled?function(e){var t,n,i=[];for(t=0,n=e.length;t<n;t++)e[t].major&&i.push(t);return i}(e):[],l=c.length,u=c[0],d=c[l-1];if(l>a)return function(e,t,n){var i,r,s=0,o=t[0];for(n=Math.ceil(n),i=0;i<e.length;i++)r=e[i],i===o?(r._index=i,o=t[++s*n]):delete r.label}(e,c,l/a),tn(e);if(i=function(e,t,n,i){var r,s,o,a,c=function(e){var t,n,i=e.length;if(i<2)return!1;for(n=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),l=(t.length-1)/i;if(!c)return Math.max(l,1);for(o=0,a=(r=z.math._factorize(c)).length-1;o<a;o++)if((s=r[o])>l)return s;return Math.max(l,1)}(c,e,0,a),l>0){for(t=0,n=l-1;t<n;t++)nn(e,i,c[t],c[t+1]);return nn(e,i,z.isNullOrUndef(r=l>1?(d-u)/(l-1):null)?0:u-r,u),nn(e,i,d,z.isNullOrUndef(r)?e.length:d+r),tn(e)}return nn(e,i),tn(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=z.toRadians(e.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=e._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,c=s?s.highest.height+o:0;return e.isHorizontal()?c*i>a*r?a/i:c/r:c*r<a*i?c/i:a/r},_isVisible:function(){var e,t,n,i=this,r=i.chart,s=i.options.display;if("auto"!==s)return!!s;for(e=0,t=r.data.datasets.length;e<t;++e)if(r.isDatasetVisible(e)&&((n=r.getDatasetMeta(e)).xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_=this,v=_.chart,y=_.options,w=y.gridLines,D=y.position,S=w.offsetGridLines,x=_.isHorizontal(),k=_._ticksToDraw,T=k.length+(S?1:0),M=Kt(w),C=[],O=w.drawBorder?Gt(w.lineWidth,0,0):0,L=O/2,E=z._alignPixel,A=function(e){return E(v,e,O)};for("top"===D?(t=A(_.bottom),a=_.bottom-M,l=t-L,d=A(e.top)+L,f=e.bottom):"bottom"===D?(t=A(_.top),d=e.top,f=A(e.bottom)-L,a=t+L,l=_.top+M):"left"===D?(t=A(_.right),o=_.right-M,c=t-L,u=A(e.left)+L,h=e.right):(t=A(_.left),u=e.left,h=A(e.right)-L,o=t+L,c=_.left+M),n=0;n<T;++n)Ut((i=k[n]||{}).label)&&n<k.length||(n===_.zeroLineIndex&&y.offset===S?(p=w.zeroLineWidth,m=w.zeroLineColor,b=w.zeroLineBorderDash||[],g=w.zeroLineBorderDashOffset||0):(p=Gt(w.lineWidth,n,1),m=Gt(w.color,n,"rgba(0,0,0,0.1)"),b=w.borderDash||[],g=w.borderDashOffset||0),void 0!==(r=Jt(_,i._index||n,S))&&(s=E(v,r,p),x?o=c=u=h=s:a=l=d=f=s,C.push({tx1:o,ty1:a,tx2:c,ty2:l,x1:u,y1:d,x2:h,y2:f,width:p,color:m,borderDash:b,borderDashOffset:g})));return C.ticksLength=T,C.borderValue=t,C},_computeLabelItems:function(){var e,t,n,i,r,s,o,a,c,l,u,d,h=this,f=h.options,p=f.ticks,m=f.position,b=p.mirror,g=h.isHorizontal(),_=h._ticksToDraw,v=en(p),y=p.padding,w=Kt(f.gridLines),D=-z.toRadians(h.labelRotation),S=[];for("top"===m?(s=h.bottom-w-y,o=D?"left":"center"):"bottom"===m?(s=h.top+w+y,o=D?"right":"center"):"left"===m?(r=h.right-(b?0:w)-y,o=b?"left":"right"):(r=h.left+(b?0:w)+y,o=b?"right":"left"),e=0,t=_.length;e<t;++e)Ut(i=(n=_[e]).label)||(a=h.getPixelForTick(n._index||e)+p.labelOffset,l=(c=n.major?v.major:v.minor).lineHeight,u=Bt(i)?i.length:1,g?(r=a,d="top"===m?((D?1:.5)-u)*l:(D?0:.5)*l):(s=a,d=(1-u)*l/2),S.push({x:r,y:s,rotation:D,label:i,font:c,textOffset:d,textAlign:o}));return S},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var i,r,s,o,a,c=t.ctx,l=t.chart,u=z._alignPixel,d=n.drawBorder?Gt(n.lineWidth,0,0):0,h=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(s=0,o=h.length;s<o;++s)r=(a=h[s]).color,(i=a.width)&&r&&(c.save(),c.lineWidth=i,c.strokeStyle=r,c.setLineDash&&(c.setLineDash(a.borderDash),c.lineDashOffset=a.borderDashOffset),c.beginPath(),n.drawTicks&&(c.moveTo(a.tx1,a.ty1),c.lineTo(a.tx2,a.ty2)),n.drawOnChartArea&&(c.moveTo(a.x1,a.y1),c.lineTo(a.x2,a.y2)),c.stroke(),c.restore());if(d){var f,p,m,b,g=d,_=Gt(n.lineWidth,h.ticksLength-1,1),v=h.borderValue;t.isHorizontal()?(f=u(l,t.left,g)-g/2,p=u(l,t.right,_)+_/2,m=b=v):(m=u(l,t.top,g)-g/2,b=u(l,t.bottom,_)+_/2,f=p=v),c.lineWidth=d,c.strokeStyle=Gt(n.color,0),c.beginPath(),c.moveTo(f,m),c.lineTo(p,b),c.stroke()}}},_drawLabels:function(){var e=this;if(e.options.ticks.display){var t,n,i,r,s,o,a,c,l=e.ctx,u=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,i=u.length;t<i;++t){if(o=(s=u[t]).font,l.save(),l.translate(s.x,s.y),l.rotate(s.rotation),l.font=o.string,l.fillStyle=o.color,l.textBaseline="middle",l.textAlign=s.textAlign,c=s.textOffset,Bt(a=s.label))for(n=0,r=a.length;n<r;++n)l.fillText(""+a[n],0,c),c+=o.lineHeight;else l.fillText(a,0,c);l.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,i=n.scaleLabel;if(i.display){var r,s,o=qt(i.fontColor,F.global.defaultFontColor),a=z.options._parseFont(i),c=z.options.toPadding(i.padding),l=a.lineHeight/2,u=n.position,d=0;if(e.isHorizontal())r=e.left+e.width/2,s="bottom"===u?e.bottom-l-c.bottom:e.top+l+c.top;else{var h="left"===u;r=h?e.left+l+c.top:e.right-l-c.top,s=e.top+e.height/2,d=h?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(r,s),t.rotate(d),t.textAlign="center",t.textBaseline="middle",t.fillStyle=o,t.font=a.string,t.fillText(i.labelString,0,0),t.restore()}},draw:function(e){var t=this;t._isVisible()&&(t._drawGrid(e),t._drawTitle(),t._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,i=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==i&&e.draw===e._draw?[{z:i,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(i){return(!e||i.type===e)&&(n?i.xAxisID===t.id:i.yAxisID===t.id)})}});rn.prototype._draw=rn.prototype.draw;var sn=rn,on=z.isNullOrUndef,an=sn.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),i=t.options.ticks,r=i.min,s=i.max,o=0,a=n.length-1;void 0!==r&&(e=n.indexOf(r))>=0&&(o=e),void 0!==s&&(e=n.indexOf(s))>=0&&(a=e),t.minIndex=o,t.maxIndex=a,t.min=n[o],t.max=n[a]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,i=e.maxIndex;e.ticks=0===n&&i===t.length-1?t:t.slice(n,i+1)},getLabelForIndex:function(e,t){var n=this,i=n.chart;return i.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;sn.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var i,r,s,o=this;return on(t)||on(n)||(e=o.chart.data.datasets[n].data[t]),on(e)||(i=o.isHorizontal()?e.x:e.y),(void 0!==i||void 0!==e&&isNaN(t))&&(r=o._getLabels(),e=z.valueOrDefault(i,e),t=-1!==(s=r.indexOf(e))?s:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});an._defaults={position:"bottom"};var cn=z.isNullOrUndef,ln=sn.extend({getRightValue:function(e){return"string"==typeof e?+e:sn.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=z.sign(e.min),i=z.sign(e.max);n<0&&i<0?e.max=0:n>0&&i>0&&(e.min=0)}var r=void 0!==t.min||void 0!==t.suggestedMin,s=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(e.min=null===e.min?t.suggestedMin:Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(e.max=null===e.max?t.suggestedMax:Math.max(e.max,t.suggestedMax)),r!==s&&e.min>=e.max&&(r?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,i=n.stepSize,r=n.maxTicksLimit;return i?e=Math.ceil(t.max/i)-Math.floor(t.min/i)+1:(e=t._computeTickLimit(),r=r||11),r&&(e=Math.min(r,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:z.noop,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:z.valueOrDefault(t.fixedStepSize,t.stepSize)},r=e.ticks=function(e,t){var n,i,r,s,o=[],a=e.stepSize,c=a||1,l=e.maxTicks-1,u=e.min,d=e.max,h=e.precision,f=t.min,p=t.max,m=z.niceNum((p-f)/l/c)*c;if(m<1e-14&&cn(u)&&cn(d))return[f,p];(s=Math.ceil(p/m)-Math.floor(f/m))>l&&(m=z.niceNum(s*m/l/c)*c),a||cn(h)?n=Math.pow(10,z._decimalPlaces(m)):(n=Math.pow(10,h),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,r=Math.ceil(p/m)*m,a&&(!cn(u)&&z.almostWhole(u/m,m/1e3)&&(i=u),!cn(d)&&z.almostWhole(d/m,m/1e3)&&(r=d)),s=z.almostEquals(s=(r-i)/m,Math.round(s),m/1e3)?Math.round(s):Math.ceil(s),i=Math.round(i*n)/n,r=Math.round(r*n)/n,o.push(cn(u)?i:u);for(var b=1;b<s;++b)o.push(Math.round((i+b*m)*n)/n);return o.push(cn(d)?r:d),o}(i,e);e.handleDirectionalChanges(),e.max=z.max(r),e.min=z.min(r),t.reverse?(r.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),sn.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),i=t.min,r=t.max;sn.prototype._configure.call(t),t.options.offset&&n.length&&(i-=e=(r-i)/Math.max(n.length-1,1)/2,r+=e),t._startValue=i,t._endValue=r,t._valueRange=r-i}}),un={position:"left",ticks:{callback:Vt.formatters.linear}};function dn(e,t,n,i){var r,s,o=e.options,a=function(e,t,n){var i=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[i]&&(e[i]={pos:[],neg:[]}),e[i]}(t,o.stacked,n),c=a.pos,l=a.neg,u=i.length;for(r=0;r<u;++r)s=e._parseValue(i[r]),isNaN(s.min)||isNaN(s.max)||n.data[r].hidden||(c[r]=c[r]||0,l[r]=l[r]||0,o.relativePoints?c[r]=100:s.min<0||s.max<0?l[r]+=s.min:c[r]+=s.max)}function hn(e,t,n){var i,r,s=n.length;for(i=0;i<s;++i)r=e._parseValue(n[i]),isNaN(r.min)||isNaN(r.max)||t.data[i].hidden||(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}var fn=ln.extend({determineDataLimits:function(){var e,t,n,i,r=this,s=r.options,o=r.chart.data.datasets,a=r._getMatchingVisibleMetas(),c=s.stacked,l={},u=a.length;if(r.min=Number.POSITIVE_INFINITY,r.max=Number.NEGATIVE_INFINITY,void 0===c)for(e=0;!c&&e<u;++e)c=void 0!==(t=a[e]).stack;for(e=0;e<u;++e)n=o[(t=a[e]).index].data,c?dn(r,l,t,n):hn(r,t,n);z.each(l,function(e){i=e.pos.concat(e.neg),r.min=Math.min(r.min,z.min(i)),r.max=Math.max(r.max,z.max(i))}),r.min=z.isFinite(r.min)&&!isNaN(r.min)?r.min:0,r.max=z.isFinite(r.max)&&!isNaN(r.max)?r.max:1,r.handleTickRangeOptions()},_computeTickLimit:function(){var e,t=this;return t.isHorizontal()?Math.ceil(t.width/40):(e=z.options._parseFont(t.options.ticks),Math.ceil(t.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){var t=this;return t.getPixelForDecimal((+t.getRightValue(e)-t._startValue)/t._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}});fn._defaults=un;var pn=z.valueOrDefault,mn=z.math.log10,bn={position:"left",ticks:{callback:Vt.formatters.logarithmic}};function gn(e,t){return z.isFinite(e)&&e>=0?e:t}var _n=sn.extend({determineDataLimits:function(){var e,t,n,i,r,s,o=this,a=o.options,c=o.chart,l=c.data.datasets,u=o.isHorizontal();function d(e){return u?e.xAxisID===o.id:e.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=a.stacked;if(void 0===h)for(e=0;e<l.length;e++)if(t=c.getDatasetMeta(e),c.isDatasetVisible(e)&&d(t)&&void 0!==t.stack){h=!0;break}if(a.stacked||h){var f={};for(e=0;e<l.length;e++){var p=[(t=c.getDatasetMeta(e)).type,void 0===a.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(c.isDatasetVisible(e)&&d(t))for(void 0===f[p]&&(f[p]=[]),r=0,s=(i=l[e].data).length;r<s;r++){var m=f[p];n=o._parseValue(i[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(m[r]=m[r]||0,m[r]+=n.max)}}z.each(f,function(e){if(e.length>0){var t=z.min(e),n=z.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,n)}})}else for(e=0;e<l.length;e++)if(t=c.getDatasetMeta(e),c.isDatasetVisible(e)&&d(t))for(r=0,s=(i=l[e].data).length;r<s;r++)n=o._parseValue(i[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=z.isFinite(o.min)?o.min:null,o.max=z.isFinite(o.max)?o.max:null,o.minNotZero=z.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=gn(t.min,e.min),e.max=gn(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(mn(e.min))-1),e.max=Math.pow(10,Math.floor(mn(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(mn(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(mn(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(mn(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),i={min:gn(t.min),max:gn(t.max)},r=e.ticks=function(e,t){var n,i,r=[],s=pn(e.min,Math.pow(10,Math.floor(mn(t.min)))),o=Math.floor(mn(t.max)),a=Math.ceil(t.max/Math.pow(10,o));0===s?(n=Math.floor(mn(t.minNotZero)),i=Math.floor(t.minNotZero/Math.pow(10,n)),r.push(s),s=i*Math.pow(10,n)):(n=Math.floor(mn(s)),i=Math.floor(s/Math.pow(10,n)));var c=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(s),10==++i&&(i=1,c=++n>=0?1:c),s=Math.round(i*Math.pow(10,n)*c)/c}while(n<o||n===o&&i<a);var l=pn(e.max,s);return r.push(l),r}(i,e);e.max=z.max(r),e.min=z.min(r),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&r.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),sn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(mn(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;sn.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=pn(e.options.ticks.fontSize,F.global.defaultFontSize)/e._length),e._startValue=mn(t),e._valueOffset=n,e._valueRange=(mn(e.max)-mn(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(mn(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}});_n._defaults=bn;var vn=z.valueOrDefault,yn=z.valueAtIndexOrDefault,wn=z.options.resolve,Dn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Vt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Sn(e){var t=e.ticks;return t.display&&e.display?vn(t.fontSize,F.global.defaultFontSize)+2*t.backdropPaddingY:0}function xn(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function kn(e){return 0===e||180===e?"center":e<180?"left":"right"}function Tn(e,t,n,i){var r,s,o=n.y+i/2;if(z.isArray(t))for(r=0,s=t.length;r<s;++r)e.fillText(t[r],n.x,o),o+=i;else e.fillText(t,n.x,o)}function Mn(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function Cn(e){return z.isNumber(e)?e:0}var On=ln.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Sn(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;z.each(t.data.datasets,function(r,s){if(t.isDatasetVisible(s)){var o=t.getDatasetMeta(s);z.each(r.data,function(t,r){var s=+e.getRightValue(t);isNaN(s)||o.data[r].hidden||(n=Math.min(s,n),i=Math.max(s,i))})}}),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=i===Number.NEGATIVE_INFINITY?0:i,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Sn(this.options))},convertTicksToLabels:function(){var e=this;ln.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=z.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""})},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this,t=e.options;t.display&&t.pointLabels.display?function(e){var t,n,i,r=z.options._parseFont(e.options.pointLabels),s={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={};e.ctx.font=r.string,e._pointLabelSizes=[];var a,c,l,u=e.chart.data.labels.length;for(t=0;t<u;t++){i=e.getPointPosition(t,e.drawingArea+5),a=e.ctx,c=r.lineHeight,n=z.isArray(l=e.pointLabels[t])?{w:z.longestText(a,a.font,l),h:l.length*c}:{w:a.measureText(l).width,h:c},e._pointLabelSizes[t]=n;var d=e.getIndexAngle(t),h=z.toDegrees(d)%360,f=xn(h,i.x,n.w,0,180),p=xn(h,i.y,n.h,90,270);f.start<s.l&&(s.l=f.start,o.l=d),f.end>s.r&&(s.r=f.end,o.r=d),p.start<s.t&&(s.t=p.start,o.t=d),p.end>s.b&&(s.b=p.end,o.b=d)}e.setReductions(e.drawingArea,s,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var i=this,r=t.l/Math.sin(n.l),s=Math.max(t.r-i.width,0)/Math.sin(n.r),o=-t.t/Math.cos(n.t),a=-Math.max(t.b-(i.height-i.paddingTop),0)/Math.cos(n.b);r=Cn(r),s=Cn(s),o=Cn(o),a=Cn(a),i.drawingArea=Math.min(Math.floor(e-(r+s)/2),Math.floor(e-(o+a)/2)),i.setCenterPoint(r,s,o,a)},setCenterPoint:function(e,t,n,i){var r=this,s=n+r.drawingArea,o=r.height-r.paddingTop-i-r.drawingArea;r.xCenter=Math.floor((e+r.drawingArea+(r.width-t-r.drawingArea))/2+r.left),r.yCenter=Math.floor((s+o)/2+r.top+r.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(z.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this,i=n.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(i)*t+n.xCenter,y:Math.sin(i)*t+n.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,n=t.min,i=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var e,t,n,i=this,r=i.ctx,s=i.options,o=s.gridLines,a=s.angleLines,c=vn(a.lineWidth,o.lineWidth),l=vn(a.color,o.color);if(s.pointLabels.display&&function(e){var t=e.ctx,n=e.options,i=n.pointLabels,r=Sn(n),s=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),o=z.options._parseFont(i);t.save(),t.font=o.string,t.textBaseline="middle";for(var a=e.chart.data.labels.length-1;a>=0;a--){var c=e.getPointPosition(a,s+(0===a?r/2:0)+5),l=yn(i.fontColor,a,F.global.defaultFontColor);t.fillStyle=l;var u=e.getIndexAngle(a),d=z.toDegrees(u);t.textAlign=kn(d),Mn(d,e._pointLabelSizes[a],c),Tn(t,e.pointLabels[a],c,o.lineHeight)}t.restore()}(i),o.display&&z.each(i.ticks,function(e,n){0!==n&&(t=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(e,t,n,i){var r,s=e.ctx,o=t.circular,a=e.chart.data.labels.length,c=yn(t.color,i-1),l=yn(t.lineWidth,i-1);if((o||a)&&c&&l){if(s.save(),s.strokeStyle=c,s.lineWidth=l,s.setLineDash&&(s.setLineDash(t.borderDash||[]),s.lineDashOffset=t.borderDashOffset||0),s.beginPath(),o)s.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{r=e.getPointPosition(0,n),s.moveTo(r.x,r.y);for(var u=1;u<a;u++)r=e.getPointPosition(u,n),s.lineTo(r.x,r.y)}s.closePath(),s.stroke(),s.restore()}}(i,o,t,n))}),a.display&&c&&l){for(r.save(),r.lineWidth=c,r.strokeStyle=l,r.setLineDash&&(r.setLineDash(wn([a.borderDash,o.borderDash,[]])),r.lineDashOffset=wn([a.borderDashOffset,o.borderDashOffset,0])),e=i.chart.data.labels.length-1;e>=0;e--)t=i.getDistanceFromCenterForValue(s.ticks.reverse?i.min:i.max),n=i.getPointPosition(e,t),r.beginPath(),r.moveTo(i.xCenter,i.yCenter),r.lineTo(n.x,n.y),r.stroke();r.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var i,r,s=e.getIndexAngle(0),o=z.options._parseFont(n),a=vn(n.fontColor,F.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",z.each(e.ticks,function(s,c){(0!==c||n.reverse)&&(i=e.getDistanceFromCenterForValue(e.ticksAsNumbers[c]),n.showLabelBackdrop&&(r=t.measureText(s).width,t.fillStyle=n.backdropColor,t.fillRect(-r/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,r+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),t.fillStyle=a,t.fillText(s,0,-i))}),t.restore()}},_drawTitle:z.noop});On._defaults=Dn;var Ln=z._deprecated,En=z.options.resolve,An=z.valueOrDefault,In=Number.MIN_SAFE_INTEGER||-9007199254740991,Rn=Number.MAX_SAFE_INTEGER||9007199254740991,Pn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Fn=Object.keys(Pn);function Wn(e,t){return e-t}function jn(e){return z.valueOrDefault(e.time.min,e.ticks.min)}function Yn(e){return z.valueOrDefault(e.time.max,e.ticks.max)}function Nn(e,t,n,i){var r=function(e,t,n){for(var i,r,s,o=0,a=e.length-1;o>=0&&o<=a;){if(s=e[i=o+a>>1],!(r=e[i-1]||null))return{lo:null,hi:s};if(s[t]<n)o=i+1;else{if(!(r[t]>n))return{lo:r,hi:s};a=i-1}}return{lo:s,hi:null}}(e,t,n),s=r.lo?r.hi?r.lo:e[e.length-2]:e[0],o=r.lo?r.hi?r.hi:e[e.length-1]:e[1],a=o[t]-s[t];return s[i]+(o[i]-s[i])*(a?(n-s[t])/a:0)}function zn(e,t){var n=e._adapter,i=e.options.time,r=i.parser,s=r||i.format,o=t;return"function"==typeof r&&(o=r(o)),z.isFinite(o)||(o="string"==typeof s?n.parse(o,s):n.parse(o)),null!==o?+o:(r||"function"!=typeof s||(o=s(t),z.isFinite(o)||(o=n.parse(o))),o)}function $n(e,t){if(z.isNullOrUndef(t))return null;var n=e.options.time,i=zn(e,e.getRightValue(t));return null===i||n.round&&(i=+e._adapter.startOf(i,n.round)),i}function Hn(e,t,n,i){var r,s,o=Fn.length;for(r=Fn.indexOf(e);r<o-1;++r)if((s=Pn[Fn[r]]).common&&Math.ceil((n-t)/((s.steps?s.steps:Rn)*s.size))<=i)return Fn[r];return Fn[o-1]}function Xn(e,t,n){var i,r,s=[],o={},a=t.length;for(i=0;i<a;++i)o[r=t[i]]=i,s.push({value:r,major:!1});return 0!==a&&n?function(e,t,n,i){var r,s,o=e._adapter,a=+o.startOf(t[0].value,i),c=t[t.length-1].value;for(r=a;r<=c;r=+o.add(r,1,i))(s=n[r])>=0&&(t[s].major=!0);return t}(e,s,o,n):s}var Vn=sn.extend({initialize:function(){this.mergeTicksOptions(),sn.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),i=e._adapter=new Xt._date(t.adapters.date);return Ln("time scale",n.format,"time.format","time.parser"),Ln("time scale",n.min,"time.min","ticks.min"),Ln("time scale",n.max,"time.max","ticks.max"),z.mergeIf(n.displayFormats,i.formats()),sn.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),sn.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,i,r,s,o,a=this,c=a.chart,l=a._adapter,u=a.options,d=u.time.unit||"day",h=Rn,f=In,p=[],m=[],b=[],g=a._getLabels();for(e=0,n=g.length;e<n;++e)b.push($n(a,g[e]));for(e=0,n=(c.data.datasets||[]).length;e<n;++e)if(c.isDatasetVisible(e))if(z.isObject((r=c.data.datasets[e].data)[0]))for(m[e]=[],t=0,i=r.length;t<i;++t)s=$n(a,r[t]),p.push(s),m[e][t]=s;else m[e]=b.slice(0),o||(p=p.concat(b),o=!0);else m[e]=[];b.length&&(h=Math.min(h,b[0]),f=Math.max(f,b[b.length-1])),p.length&&(p=n>1?function(e){var t,n,i,r={},s=[];for(t=0,n=e.length;t<n;++t)r[i=e[t]]||(r[i]=!0,s.push(i));return s}(p).sort(Wn):p.sort(Wn),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=$n(a,jn(u))||h,f=$n(a,Yn(u))||f,h=h===Rn?+l.startOf(Date.now(),d):h,f=f===In?+l.endOf(Date.now(),d)+1:f,a.min=Math.min(h,f),a.max=Math.max(h+1,f),a._table=[],a._timestamps={data:p,datasets:m,labels:b}},buildTicks:function(){var e,t,n,i=this,r=i.min,s=i.max,o=i.options,a=o.ticks,c=o.time,l=i._timestamps,u=[],d=i.getLabelCapacity(r),h=a.source,f=o.distribution;for(l="data"===h||"auto"===h&&"series"===f?l.data:"labels"===h?l.labels:function(e,t,n,i){var r,s=e._adapter,o=e.options,a=o.time,c=a.unit||Hn(a.minUnit,t,n,i),l=En([a.stepSize,a.unitStepSize,1]),u="week"===c&&a.isoWeekday,d=t,h=[];if(u&&(d=+s.startOf(d,"isoWeek",u)),d=+s.startOf(d,u?"day":c),s.diff(n,t,c)>1e5*l)throw t+" and "+n+" are too far apart with stepSize of "+l+" "+c;for(r=d;r<n;r=+s.add(r,l,c))h.push(r);return r!==n&&"ticks"!==o.bounds||h.push(r),h}(i,r,s,d),"ticks"===o.bounds&&l.length&&(r=l[0],s=l[l.length-1]),r=$n(i,jn(o))||r,s=$n(i,Yn(o))||s,e=0,t=l.length;e<t;++e)(n=l[e])>=r&&n<=s&&u.push(n);return i.min=r,i.max=s,i._unit=c.unit||(a.autoSkip?Hn(c.minUnit,i.min,i.max,d):function(e,t,n,i,r){var s,o;for(s=Fn.length-1;s>=Fn.indexOf(n);s--)if(Pn[o=Fn[s]].common&&e._adapter.diff(r,i,o)>=t-1)return o;return Fn[n?Fn.indexOf(n):0]}(i,u.length,c.minUnit,i.min,i.max)),i._majorUnit=a.major.enabled&&"year"!==i._unit?function(e){for(var t=Fn.indexOf(e)+1,n=Fn.length;t<n;++t)if(Pn[Fn[t]].common)return Fn[t]}(i._unit):void 0,i._table=function(e,t,n,i){if("linear"===i||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var r,s,o,a,c,l=[],u=[t];for(r=0,s=e.length;r<s;++r)(a=e[r])>t&&a<n&&u.push(a);for(u.push(n),r=0,s=u.length;r<s;++r)c=u[r+1],a=u[r],void 0!==(o=u[r-1])&&void 0!==c&&Math.round((c+o)/2)===a||l.push({time:a,pos:r/(s-1)});return l}(i._timestamps.data,r,s,f),i._offsets=function(e,t,n,i,r){var s,o,a=0,c=0;return r.offset&&t.length&&(s=Nn(e,"time",t[0],"pos"),a=1===t.length?1-s:(Nn(e,"time",t[1],"pos")-s)/2,o=Nn(e,"time",t[t.length-1],"pos"),c=1===t.length?o:(o-Nn(e,"time",t[t.length-2],"pos"))/2),{start:a,end:c,factor:1/(a+1+c)}}(i._table,u,0,0,o),a.reverse&&u.reverse(),Xn(i,u,i._majorUnit)},getLabelForIndex:function(e,t){var n=this,i=n._adapter,r=n.chart.data,s=n.options.time,o=r.labels&&e<r.labels.length?r.labels[e]:"",a=r.datasets[t].data[e];return z.isObject(a)&&(o=n.getRightValue(a)),s.tooltipFormat?i.format(zn(n,o),s.tooltipFormat):"string"==typeof o?o:i.format(zn(n,o),s.displayFormats.datetime)},tickFormatFunction:function(e,t,n,i){var r=this,s=r.options,o=s.time.displayFormats,a=r._majorUnit,c=o[a],l=n[t],u=s.ticks,d=a&&c&&l&&l.major,h=r._adapter.format(e,i||(d?c:o[r._unit])),f=d?u.major:u.minor,p=En([f.callback,f.userCallback,u.callback,u.userCallback]);return p?p(h,t,n):h},convertTicksToLabels:function(e){var t,n,i=[];for(t=0,n=e.length;t<n;++t)i.push(this.tickFormatFunction(e[t].value,t,e));return i},getPixelForOffset:function(e){var t=this,n=t._offsets,i=Nn(t._table,"time",e,"pos");return t.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(e,t,n){var i=this,r=null;if(void 0!==t&&void 0!==n&&(r=i._timestamps.datasets[n][t]),null===r&&(r=$n(i,e)),null!==r)return i.getPixelForOffset(r)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this,n=t._offsets,i=t.getDecimalForPixel(e)/n.factor-n.end,r=Nn(t._table,"pos",i,"time");return t._adapter._create(r)},_getLabelSize:function(e){var t=this,n=t.options.ticks,i=t.ctx.measureText(e).width,r=z.toRadians(t.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),o=Math.sin(r),a=An(n.fontSize,F.global.defaultFontSize);return{w:i*s+a*o,h:i*o+a*s}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=t.tickFormatFunction(e,0,Xn(t,[e],t._majorUnit),r),o=t._getLabelSize(s),a=Math.floor(t.isHorizontal()?t.width/o.w:t.height/o.h);return t.options.offset&&a--,a>0?a:1}});Vn._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var Bn={category:an,linear:fn,logarithmic:_n,radialLinear:On,time:Vn},Un={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Xt._date.override("function"==typeof e?{_id:"moment",formats:function(){return Un},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,i){return e(t).add(n,i).valueOf()},diff:function(t,n,i){return e(t).diff(e(n),i)},startOf:function(t,n,i){return t=e(t),"isoWeek"===n?t.isoWeekday(i).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),F._set("global",{plugins:{filler:{propagate:!0}}});var qn={dataset:function(e){var t=e.fill,n=e.chart,i=n.getDatasetMeta(t),r=i&&n.isDatasetVisible(t)&&i.dataset._children||[],s=r.length||0;return s?function(e,t){return t<s&&r[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,i=t?t.y:null;return z.isArray(t)?function(e,n){return t[n]}:function(e){return{x:null===n?e.x:n,y:null===i?e.y:i}}}};function Gn(e,t,n){var i,r=e._model||{},s=r.fill;if(void 0===s&&(s=!!r.backgroundColor),!1===s||null===s)return!1;if(!0===s)return"origin";if(i=parseFloat(s,10),isFinite(i)&&Math.floor(i)===i)return"-"!==s[0]&&"+"!==s[0]||(i=t+i),!(i===t||i<0||i>=n)&&i;switch(s){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return s;default:return!1}}function Jn(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,n,i,r,s,o=e.el._scale,a=o.options,c=o.chart.data.labels.length,l=e.fill,u=[];if(!c)return null;for(n=a.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,t=a.ticks.reverse?o.max:o.min),r=0;r<c;++r)s="start"===l||"end"===l?o.getPointPositionForValue(r,"start"===l?t:n):o.getBasePosition(r),a.gridLines.circular&&(s.cx=i.x,s.cy=i.y,s.angle=o.getIndexAngle(r)-Math.PI/2),u.push(s);return u}(e):function(e){var t,n=e.el._model||{},i=e.el._scale||{},r=e.fill,s=null;if(isFinite(r))return null;if("start"===r?s=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===r?s=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?s=n.scaleZero:i.getBasePixel&&(s=i.getBasePixel()),null!=s){if(void 0!==s.x&&void 0!==s.y)return s;if(z.isFinite(s))return{x:(t=i.isHorizontal())?s:null,y:t?null:s}}return null}(e)}function Kn(e,t,n){var i,r=e[t].fill,s=[t];if(!n)return r;for(;!1!==r&&-1===s.indexOf(r);){if(!isFinite(r))return r;if(!(i=e[r]))return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function Qn(e){var t=e.fill,n="dataset";return!1===t?null:(isFinite(t)||(n="boundary"),qn[n](e))}function Zn(e){return e&&!e.skip}function ei(e,t,n,i,r){var s,o,a,c;if(i&&r){for(e.moveTo(t[0].x,t[0].y),s=1;s<i;++s)z.canvas.lineTo(e,t[s-1],t[s]);if(void 0===n[0].angle)for(e.lineTo(n[r-1].x,n[r-1].y),s=r-1;s>0;--s)z.canvas.lineTo(e,n[s],n[s-1],!0);else for(o=n[0].cx,a=n[0].cy,c=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-a,2)),s=r-1;s>0;--s)e.arc(o,a,c,n[s].angle,n[s-1].angle,!0)}}function ti(e,t,n,i,r,s){var o,a,c,l,u,d,h,f,p=t.length,m=i.spanGaps,b=[],g=[],_=0,v=0;for(e.beginPath(),o=0,a=p;o<a;++o)u=n(l=t[c=o%p]._view,c,i),d=Zn(l),h=Zn(u),s&&void 0===f&&d&&(a=p+(f=o+1)),d&&h?(_=b.push(l),v=g.push(u)):_&&v&&(m?(d&&b.push(l),h&&g.push(u)):(ei(e,b,g,_,v),_=v=0,b=[],g=[]));ei(e,b,g,_,v),e.closePath(),e.fillStyle=r,e.fill()}var ni={id:"filler",afterDatasetsUpdate:function(e,t){var n,i,r,s,o=(e.data.datasets||[]).length,a=t.propagate,c=[];for(i=0;i<o;++i)s=null,(r=(n=e.getDatasetMeta(i)).dataset)&&r._model&&r instanceof ge.Line&&(s={visible:e.isDatasetVisible(i),fill:Gn(r,i,o),chart:e,el:r}),n.$filler=s,c.push(s);for(i=0;i<o;++i)(s=c[i])&&(s.fill=Kn(c,i,a),s.boundary=Jn(s),s.mapper=Qn(s))},beforeDatasetsDraw:function(e){var t,n,i,r,s,o,a,c=e._getSortedVisibleDatasetMetas(),l=e.ctx;for(n=c.length-1;n>=0;--n)(t=c[n].$filler)&&t.visible&&(s=(i=t.el)._children||[],a=(r=i._view).backgroundColor||F.global.defaultColor,(o=t.mapper)&&a&&s.length&&(z.canvas.clipArea(l,e.chartArea),ti(l,s,o,r,a,i._loop),z.canvas.unclipArea(l)))}},ii=z.rtl.getRtlAdapter,ri=z.noop,si=z.valueOrDefault;function oi(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}F._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,i=this.chart,r=i.getDatasetMeta(n);r.hidden=null===r.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},i=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(n){var r=n.controller.getStyle(i?0:void 0);return{text:t[n.index].label,fillStyle:r.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:r.borderWidth,strokeStyle:r.borderColor,pointStyle:r.pointStyle,rotation:r.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(e){var t,n,i,r=document.createElement("ul"),s=e.data.datasets;for(r.setAttribute("class",e.id+"-legend"),t=0,n=s.length;t<n;t++)(i=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=s[t].backgroundColor,s[t].label&&i.appendChild(document.createTextNode(s[t].label));return r.outerHTML}});var ai=B.extend({initialize:function(e){var t=this;z.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:ri,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ri,beforeSetDimensions:ri,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ri,beforeBuildLabels:ri,buildLabels:function(){var e=this,t=e.options.labels||{},n=z.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter(function(n){return t.filter(n,e.chart.data)})),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:ri,beforeFit:ri,fit:function(){var e=this,t=e.options,n=t.labels,i=t.display,r=e.ctx,s=z.options._parseFont(n),o=s.size,a=e.legendHitBoxes=[],c=e.minSize,l=e.isHorizontal();if(l?(c.width=e.maxWidth,c.height=i?10:0):(c.width=i?10:0,c.height=e.maxHeight),i){if(r.font=s.string,l){var u=e.lineWidths=[0],d=0;r.textAlign="left",r.textBaseline="middle",z.each(e.legendItems,function(e,t){var i=oi(n,o)+o/2+r.measureText(e.text).width;(0===t||u[u.length-1]+i+2*n.padding>c.width)&&(d+=o+n.padding,u[u.length-(t>0?0:1)]=0),a[t]={left:0,top:0,width:i,height:o},u[u.length-1]+=i+n.padding}),c.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],m=n.padding,b=0,g=0;z.each(e.legendItems,function(e,t){var i=oi(n,o)+o/2+r.measureText(e.text).width;t>0&&g+o+2*h>c.height&&(m+=b+n.padding,f.push(b),p.push(g),b=0,g=0),b=Math.max(b,i),g+=o+h,a[t]={left:0,top:0,width:i,height:o}}),m+=b,f.push(b),p.push(g),c.width+=m}e.width=c.width,e.height=c.height}else e.width=c.width=e.height=c.height=0},afterFit:ri,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,i=F.global,r=i.defaultColor,s=i.elements.line,o=e.height,a=e.columnHeights,c=e.width,l=e.lineWidths;if(t.display){var u,d=ii(t.rtl,e.left,e.minSize.width),h=e.ctx,f=si(n.fontColor,i.defaultFontColor),p=z.options._parseFont(n),m=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var b=oi(n,m),g=e.legendHitBoxes,_=function(e,i){switch(t.align){case"start":return n.padding;case"end":return e-i;default:return(e-i+n.padding)/2}},v=e.isHorizontal();u=v?{x:e.left+_(c,l[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+_(o,a[0]),line:0},z.rtl.overrideTextDirection(e.ctx,t.textDirection);var y=m+n.padding;z.each(e.legendItems,function(t,i){var f=h.measureText(t.text).width,p=b+m/2+f,w=u.x,D=u.y;d.setWidth(e.minSize.width),v?i>0&&w+p+n.padding>e.left+e.minSize.width&&(D=u.y+=y,u.line++,w=u.x=e.left+_(c,l[u.line])):i>0&&D+y>e.top+e.minSize.height&&(w=u.x=w+e.columnWidths[u.line]+n.padding,u.line++,D=u.y=e.top+_(o,a[u.line]));var S=d.x(w);(function(e,t,i){if(!(isNaN(b)||b<=0)){h.save();var o=si(i.lineWidth,s.borderWidth);if(h.fillStyle=si(i.fillStyle,r),h.lineCap=si(i.lineCap,s.borderCapStyle),h.lineDashOffset=si(i.lineDashOffset,s.borderDashOffset),h.lineJoin=si(i.lineJoin,s.borderJoinStyle),h.lineWidth=o,h.strokeStyle=si(i.strokeStyle,r),h.setLineDash&&h.setLineDash(si(i.lineDash,s.borderDash)),n&&n.usePointStyle){var a=b*Math.SQRT2/2,c=d.xPlus(e,b/2);z.canvas.drawPoint(h,i.pointStyle,a,c,t+m/2,i.rotation)}else h.fillRect(d.leftForLtr(e,b),t,b,m),0!==o&&h.strokeRect(d.leftForLtr(e,b),t,b,m);h.restore()}})(S,D,t),g[i].left=d.leftForLtr(S,g[i].width),g[i].top=D,function(e,t,n,i){var r=m/2,s=d.xPlus(e,b+r),o=t+r;h.fillText(n.text,s,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(s,o),h.lineTo(d.xPlus(s,i),o),h.stroke())}(S,D,t,f),v?u.x+=p+n.padding:u.y+=y}),z.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,i,r,s=this;if(e>=s.left&&e<=s.right&&t>=s.top&&t<=s.bottom)for(r=s.legendHitBoxes,n=0;n<r.length;++n)if(e>=(i=r[n]).left&&e<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return s.legendItems[n];return null},handleEvent:function(e){var t,n=this,i=n.options,r="mouseup"===e.type?"click":e.type;if("mousemove"===r){if(!i.onHover&&!i.onLeave)return}else{if("click"!==r)return;if(!i.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===r?t&&i.onClick&&i.onClick.call(n,e.native,t):(i.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),i.onHover&&t&&i.onHover.call(n,e.native,t))}});function ci(e,t){var n=new ai({ctx:e.ctx,options:t,chart:e});ct.configure(e,n,t),ct.addBox(e,n),e.legend=n}var li={id:"legend",_element:ai,beforeInit:function(e){var t=e.options.legend;t&&ci(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(z.mergeIf(t,F.global.legend),n?(ct.configure(e,n,t),n.options=t):ci(e,t)):n&&(ct.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},ui=z.noop;F._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var di=B.extend({initialize:function(e){z.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:ui,update:function(e,t,n){var i=this;return i.beforeUpdate(),i.maxWidth=e,i.maxHeight=t,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ui,beforeSetDimensions:ui,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ui,beforeBuildLabels:ui,buildLabels:ui,afterBuildLabels:ui,beforeFit:ui,fit:function(){var e,t=this,n=t.options,i=t.minSize={},r=t.isHorizontal();n.display?(e=(z.isArray(n.text)?n.text.length:1)*z.options._parseFont(n).lineHeight+2*n.padding,t.width=i.width=r?t.maxWidth:e,t.height=i.height=r?e:t.maxHeight):t.width=i.width=t.height=i.height=0},afterFit:ui,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var i,r,s,o=z.options._parseFont(n),a=o.lineHeight,c=a/2+n.padding,l=0,u=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=z.valueOrDefault(n.fontColor,F.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(r=d+(f-d)/2,s=u+c,i=f-d):(r="left"===n.position?d+c:f-c,s=u+(h-u)/2,i=h-u,l=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(r,s),t.rotate(l),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(z.isArray(p))for(var m=0,b=0;b<p.length;++b)t.fillText(p[b],0,m,i),m+=a;else t.fillText(p,0,0,i);t.restore()}}});function hi(e,t){var n=new di({ctx:e.ctx,options:t,chart:e});ct.configure(e,n,t),ct.addBox(e,n),e.titleBlock=n}var fi={},pi=ni,mi=li,bi={id:"title",_element:di,beforeInit:function(e){var t=e.options.title;t&&hi(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(z.mergeIf(t,F.global.title),n?(ct.configure(e,n,t),n.options=t):hi(e,t)):n&&(ct.removeBox(e,n),delete e.titleBlock)}};for(var gi in fi.filler=pi,fi.legend=mi,fi.title=bi,zt.helpers=z,function(){function e(e,t,n){var i;return"string"==typeof e?(i=parseInt(e,10),-1!==e.indexOf("%")&&(i=i/100*t.parentNode[n])):i=e,i}function t(e){return null!=e&&"none"!==e}function n(n,i,r){var s=document.defaultView,o=z._getParentNode(n),a=s.getComputedStyle(n)[i],c=s.getComputedStyle(o)[i],l=t(a),u=t(c),d=Number.POSITIVE_INFINITY;return l||u?Math.min(l?e(a,n,r):d,u?e(c,o,r):d):"none"}z.where=function(e,t){if(z.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return z.each(e,function(e){t(e)&&n.push(e)}),n},z.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var i=0,r=e.length;i<r;++i)if(t.call(n,e[i],i,e))return i;return-1},z.findNextWhere=function(e,t,n){z.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<e.length;i++){var r=e[i];if(t(r))return r}},z.findPreviousWhere=function(e,t,n){z.isNullOrUndef(n)&&(n=e.length);for(var i=n-1;i>=0;i--){var r=e[i];if(t(r))return r}},z.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},z.almostEquals=function(e,t,n){return Math.abs(e-t)<n},z.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},z.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},z.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},z.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},z.toRadians=function(e){return e*(Math.PI/180)},z.toDegrees=function(e){return e*(180/Math.PI)},z._decimalPlaces=function(e){if(z.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},z.getAngleFromPoint=function(e,t){var n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i),s=Math.atan2(i,n);return s<-.5*Math.PI&&(s+=2*Math.PI),{angle:s,distance:r}},z.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},z.aliasPixel=function(e){return e%2==0?0:.5},z._alignPixel=function(e,t,n){var i=e.currentDevicePixelRatio,r=n/2;return Math.round((t-r)*i)/i+r},z.splineCurve=function(e,t,n,i){var r=e.skip?t:e,s=t,o=n.skip?t:n,a=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),c=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),l=a/(a+c),u=c/(a+c),d=i*(l=isNaN(l)?0:l),h=i*(u=isNaN(u)?0:u);return{previous:{x:s.x-d*(o.x-r.x),y:s.y-d*(o.y-r.y)},next:{x:s.x+h*(o.x-r.x),y:s.y+h*(o.y-r.y)}}},z.EPSILON=Number.EPSILON||1e-14,z.splineCurveMonotone=function(e){var t,n,i,r,s,o,a,c,l,u=(e||[]).map(function(e){return{model:e._model,deltaK:0,mK:0}}),d=u.length;for(t=0;t<d;++t)if(!(i=u[t]).model.skip){if(n=t>0?u[t-1]:null,(r=t<d-1?u[t+1]:null)&&!r.model.skip){var h=r.model.x-i.model.x;i.deltaK=0!==h?(r.model.y-i.model.y)/h:0}i.mK=!n||n.model.skip?i.deltaK:!r||r.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?0:(n.deltaK+i.deltaK)/2}for(t=0;t<d-1;++t)r=u[t+1],(i=u[t]).model.skip||r.model.skip||(z.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=r.mK=0:(s=i.mK/i.deltaK,o=r.mK/i.deltaK,(c=Math.pow(s,2)+Math.pow(o,2))<=9||(a=3/Math.sqrt(c),i.mK=s*a*i.deltaK,r.mK=o*a*i.deltaK)));for(t=0;t<d;++t)(i=u[t]).model.skip||(r=t<d-1?u[t+1]:null,(n=t>0?u[t-1]:null)&&!n.model.skip&&(i.model.controlPointPreviousX=i.model.x-(l=(i.model.x-n.model.x)/3),i.model.controlPointPreviousY=i.model.y-l*i.mK),r&&!r.model.skip&&(i.model.controlPointNextX=i.model.x+(l=(r.model.x-i.model.x)/3),i.model.controlPointNextY=i.model.y+l*i.mK))},z.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},z.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},z.niceNum=function(e,t){var n=Math.floor(z.log10(e)),i=e/Math.pow(10,n);return(t?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},z.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},z.getRelativePosition=function(e,t){var n,i,r=e.originalEvent||e,s=e.target||e.srcElement,o=s.getBoundingClientRect(),a=r.touches;a&&a.length>0?(n=a[0].clientX,i=a[0].clientY):(n=r.clientX,i=r.clientY);var c=parseFloat(z.getStyle(s,"padding-left")),l=parseFloat(z.getStyle(s,"padding-top")),u=parseFloat(z.getStyle(s,"padding-right")),d=parseFloat(z.getStyle(s,"padding-bottom")),h=o.bottom-o.top-l-d;return{x:n=Math.round((n-o.left-c)/(o.right-o.left-c-u)*s.width/t.currentDevicePixelRatio),y:i=Math.round((i-o.top-l)/h*s.height/t.currentDevicePixelRatio)}},z.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},z.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},z._calculatePadding=function(e,t,n){return(t=z.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},z._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},z.getMaximumWidth=function(e){var t=z._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,i=n-z._calculatePadding(t,"padding-left",n)-z._calculatePadding(t,"padding-right",n),r=z.getConstraintWidth(e);return isNaN(r)?i:Math.min(i,r)},z.getMaximumHeight=function(e){var t=z._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,i=n-z._calculatePadding(t,"padding-top",n)-z._calculatePadding(t,"padding-bottom",n),r=z.getConstraintHeight(e);return isNaN(r)?i:Math.min(i,r)},z.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},z.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=e.canvas,r=e.height,s=e.width;i.height=r*n,i.width=s*n,e.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=r+"px",i.style.width=s+"px")}},z.fontString=function(e,t,n){return t+" "+e+"px "+n},z.longestText=function(e,t,n,i){var r=(i=i||{}).data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.font=t;var o,a,c,l,u,d=0,h=n.length;for(o=0;o<h;o++)if(null!=(l=n[o])&&!0!==z.isArray(l))d=z.measureText(e,r,s,d,l);else if(z.isArray(l))for(a=0,c=l.length;a<c;a++)null==(u=l[a])||z.isArray(u)||(d=z.measureText(e,r,s,d,u));var f=s.length/2;if(f>n.length){for(o=0;o<f;o++)delete r[s[o]];s.splice(0,f)}return d},z.measureText=function(e,t,n,i,r){var s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i},z.numberOfLabelLines=function(e){var t=1;return z.each(e,function(e){z.isArray(e)&&e.length>t&&(t=e.length)}),t},z.color=y?function(e){return e instanceof CanvasGradient&&(e=F.global.defaultColor),y(e)}:function(e){return console.error("Color.js not found!"),e},z.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:z.color(e).saturate(.5).darken(.1).rgbString()}}(),zt._adapters=Xt,zt.Animation=q,zt.animationService=G,zt.controllers=Ve,zt.DatasetController=ee,zt.defaults=F,zt.Element=B,zt.elements=ge,zt.Interaction=Qe,zt.layouts=ct,zt.platform=wt,zt.plugins=Dt,zt.Scale=sn,zt.scaleService=St,zt.Ticks=Vt,zt.Tooltip=At,zt.helpers.each(Bn,function(e,t){zt.scaleService.registerScaleType(t,e,e._defaults)}),fi)fi.hasOwnProperty(gi)&&zt.plugins.register(fi[gi]);zt.platform.initialize();var _i=zt;return"undefined"!=typeof window&&(window.Chart=zt),zt.Chart=zt,zt.Legend=fi.legend._element,zt.Title=fi.title._element,zt.pluginService=zt.plugins,zt.PluginBase=zt.Element.extend({}),zt.canvasHelpers=zt.helpers.canvas,zt.layoutService=zt.layouts,zt.LinearScaleBase=ln,zt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){zt[e]=function(t,n){return new zt(t,zt.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),_i}(function(){try{return n("wd/R")}catch(e){}}())},MuvH:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("IheW");let s=(()=>{class e{constructor(e){this.http=e}findValue(e,t){if(e.value)return e.value.find(e=>e.section===t)}getValue(e,t){let n=this.findValue(e,t);if(!n){const i=t.indexOf(".");-1!==i&&(n=this.findValue(e,t.substring(0,i)))}return n||(n=this.findValue(e,"global")),n?n.value:e.default}getConfigData(){return this.http.get("api/cluster_conf/")}get(e){return this.http.get(`api/cluster_conf/${e}`)}filter(e){return this.http.get(`api/cluster_conf/filter?names=${e.join(",")}`)}create(e){return this.http.post("api/cluster_conf/",e)}delete(e,t){return this.http.delete(`api/cluster_conf/${e}?section=${t}`)}bulkCreate(e){return this.http.put("api/cluster_conf/",e)}}return e.\u0275fac=function(t){return new(t||e)(i.ic(r.b))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Mxhz:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n("LRne"),r=n("CqXF"),s=n("JIr8"),o=n("8Y7J"),a=n("IheW");let c=(()=>{class e{constructor(e){this.http=e}list(){return this.http.get("api/user")}delete(e){return this.http.delete(`api/user/${e}`)}get(e){return this.http.get(`api/user/${e}`)}create(e){return this.http.post("api/user",e)}update(e){return this.http.put(`api/user/${e.username}`,e)}changePassword(e,t,n){return this.http.post(`api/user/${e}/change_password`,{old_password:t,new_password:n})}validateUserName(e){return this.get(e).pipe(Object(r.a)(!0),Object(s.a)(e=>(e.preventDefault(),Object(i.a)(!1))))}validatePassword(e,t=null,n=null){return this.http.post("api/user/validate_password",{password:e,username:t,old_password:n})}}return e.\u0275fac=function(t){return new(t||e)(o.ic(a.b))},e.\u0275prov=o.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"N+g0":function(e,t,n){var i=n("g6v/"),r=n("m/L8"),s=n("glrk"),o=n("/GqU"),a=n("33Wh");e.exports=i?Object.defineProperties:function(e,t){s(e);for(var n,i=o(t),c=a(t),l=c.length,u=0;l>u;)r.f(e,n=c[u++],i[n]);return e}},"NC/Y":function(e,t,n){var i=n("0GbY");e.exports=i("navigator","userAgent")||""},NEZu:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e,t,n,i){this.customColors={backgroundColor:void 0,borderColor:void 0},this.checkOffset=!1,this.chartEl=e.nativeElement,this.getStyleLeft=n,this.getStyleTop=i,this.tooltipEl=t.nativeElement}customTooltips(e){if(0===e.opacity)return void(this.tooltipEl.style.opacity=0);if(this.tooltipEl.classList.remove("above","below","no-transform"),this.tooltipEl.classList.add(e.yAlign?e.yAlign:"no-transform"),e.body){const t=e.title||[],n=e.body.map(e=>e.lines);let i="<thead>";t.forEach(e=>{i+="<tr><th>"+this.getTitle(e)+"</th></tr>"}),i+="</thead><tbody>",n.forEach((t,n)=>{const r=e.labelColors[n];let s="background:"+(this.customColors.backgroundColor||r.backgroundColor);s+="; border-color:"+(this.customColors.borderColor||r.borderColor),s+="; border-width: 2px",i+='<tr><td nowrap><span class="chartjs-tooltip-key" style="'+s+'"></span>'+this.getBody(t)+"</td></tr>"}),i+="</tbody>",this.tooltipEl.querySelector("table").innerHTML=i}const t=this.chartEl.offsetTop,n=this.chartEl.offsetLeft;if(this.checkOffset){const t=e.width/2;this.tooltipEl.classList.remove("transform-left"),this.tooltipEl.classList.remove("transform-right"),e.caretX-t<0?this.tooltipEl.classList.add("transform-left"):e.caretX+t>this.chartEl.width&&this.tooltipEl.classList.add("transform-right")}this.tooltipEl.style.left=this.getStyleLeft(e,n),this.tooltipEl.style.top=this.getStyleTop(e,t),this.tooltipEl.style.opacity=1,this.tooltipEl.style.fontFamily=e._fontFamily,this.tooltipEl.style.fontSize=e.fontSize,this.tooltipEl.style.fontStyle=e._fontStyle,this.tooltipEl.style.padding=e.yPadding+"px "+e.xPadding+"px"}getBody(e){return e}getTitle(e){return e}}},NJ4a:function(e,t,n){"use strict";function i(e){setTimeout(()=>{throw e},0)}n.d(t,"a",function(){return i})},NJ9Y:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("sVev"),r=n("pLZG"),s=n("BFxc"),o=n("XDbj"),a=n("xbPD"),c=n("SpAZ");function l(e,t){const n=arguments.length>=2;return l=>l.pipe(e?Object(r.a)((t,n)=>e(t,n,l)):c.a,Object(s.a)(1),n?Object(a.a)(t):Object(o.a)(()=>new i.a))}},NaFW:function(e,t,n){var i=n("9d/t"),r=n("3Eq5"),s=n("P4y1"),o=n("tiKp")("iterator");e.exports=function(e){if(null!=e)return r(e,o)||r(e,"@@iterator")||s[i(e)]}},NwgZ:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("s7LF");let s=(()=>{class e{constructor(){this.validSubmit=new i.p}onSubmit(){this.markAsTouchedAndDirty(this.formGroup),this.formGroup.valid&&this.validSubmit.emit(this.formGroup.value)}markAsTouchedAndDirty(e){e instanceof r.j?Object.keys(e.controls).forEach(t=>this.markAsTouchedAndDirty(e.controls[t])):e instanceof r.e?e.controls.forEach(e=>this.markAsTouchedAndDirty(e)):e instanceof r.h&&e.enabled&&(e.markAsDirty(),e.markAsTouched(),e.updateValueAndValidity())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&i.lc("submit",function(){return t.onSubmit()})},inputs:{formGroup:"formGroup"},outputs:{validSubmit:"validSubmit"}}),e})()},O741:function(e,t,n){var i=n("2oRo"),r=n("Fib7"),s=i.String,o=i.TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw o("Can't set "+s(e)+" as a prototype")}},OIYi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},OLbh:function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("s7LF"),r=n("8Y7J"),s=n("G0yt"),o=n("ajRT"),a=n("SVse"),c=n("NwgZ"),l=n("6+kj");function u(e,t){1&e&&(r.Xb(0,"span",11),r.Sb(1,"i",12),r.Wb())}function d(e,t){1&e&&r.Tb(0)}function h(e,t){if(1&e&&(r.Xb(0,"p"),r.Rc(1),r.Wb()),2&e){const e=r.nc();r.Db(1),r.Tc(" ",e.description," ")}}let f=(()=>{class e{constructor(e){this.activeModal=e,this.warning=!1,this.showSubmit=!0,this.boundCancel=this.cancel.bind(this),this.canceled=!1,this.confirmationForm=new i.j({})}ngOnInit(){if(this.bodyContext=this.bodyContext||{},this.bodyContext.$implicit=this.bodyData,!this.onSubmit)throw new Error("No submit action defined");if(!this.buttonText)throw new Error("No action name defined");if(!this.titleText)throw new Error("No title defined");if(!this.bodyTpl&&!this.description)throw new Error("No description defined")}ngOnDestroy(){this.onCancel&&this.canceled&&this.onCancel()}cancel(){this.canceled=!0,this.activeModal.close()}stopLoadingSpinner(){this.confirmationForm.setErrors({cdSubmitButton:!0})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(s.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-confirmation-modal"]],decls:12,vars:9,consts:[[3,"hide"],[1,"modal-title"],["class","text-warning",4,"ngIf"],[1,"modal-content"],["name","confirmationForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent","backActionEvent"],[1,"text-warning"],[1,"fa","fa-exclamation-triangle","fa-1x"]],template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.lc("hide",function(){return t.cancel()}),r.Vb(1,1),r.Pc(2,u,2,0,"span",2),r.Rc(3),r.Ub(),r.Vb(4,3),r.Xb(5,"form",4,5),r.Xb(7,"div",6),r.Pc(8,d,1,0,"ng-container",7),r.Pc(9,h,2,1,"p",8),r.Wb(),r.Xb(10,"div",9),r.Xb(11,"cd-form-button-panel",10),r.lc("submitActionEvent",function(){return t.onSubmit(t.confirmationForm.value)})("backActionEvent",function(){return t.boundCancel()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.Db(2),r.uc("ngIf",t.warning),r.Db(1),r.Sc(t.titleText),r.Db(2),r.uc("formGroup",t.confirmationForm),r.Db(3),r.uc("ngTemplateOutlet",t.bodyTpl)("ngTemplateOutletContext",t.bodyContext),r.Db(1),r.uc("ngIf",t.description),r.Db(2),r.uc("form",t.confirmationForm)("submitText",t.buttonText)("showSubmit",t.showSubmit))},directives:[o.a,a.r,i.B,i.r,i.k,c.a,a.w,l.a],styles:[""]}),e})()},Oaa7:function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},Ob0Z:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};function i(e,t,n,i){var r="";if(t)switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926";break;case"m":r="\u090f\u0915 \u092e\u093f\u0928\u093f\u091f";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u0947";break;case"h":r="\u090f\u0915 \u0924\u093e\u0938";break;case"hh":r="%d \u0924\u093e\u0938";break;case"d":r="\u090f\u0915 \u0926\u093f\u0935\u0938";break;case"dd":r="%d \u0926\u093f\u0935\u0938";break;case"M":r="\u090f\u0915 \u092e\u0939\u093f\u0928\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u0947";break;case"y":r="\u090f\u0915 \u0935\u0930\u094d\u0937";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u0947"}else switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"m":r="\u090f\u0915\u093e \u092e\u093f\u0928\u093f\u091f\u093e";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u093e\u0902";break;case"h":r="\u090f\u0915\u093e \u0924\u093e\u0938\u093e";break;case"hh":r="%d \u0924\u093e\u0938\u093e\u0902";break;case"d":r="\u090f\u0915\u093e \u0926\u093f\u0935\u0938\u093e";break;case"dd":r="%d \u0926\u093f\u0935\u0938\u093e\u0902";break;case"M":r="\u090f\u0915\u093e \u092e\u0939\u093f\u0928\u094d\u092f\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u094d\u092f\u093e\u0902";break;case"y":r="\u090f\u0915\u093e \u0935\u0930\u094d\u0937\u093e";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u093e\u0902"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u093f\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u0948_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a._\u090f\u092a\u094d\u0930\u093f._\u092e\u0947._\u091c\u0942\u0928._\u091c\u0941\u0932\u0948._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0933\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0933_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u0935\u093e\u091c\u0924\u093e",LTS:"A h:mm:ss \u0935\u093e\u091c\u0924\u093e",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e",LLLL:"dddd, D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0909\u0926\u094d\u092f\u093e] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092e\u093e\u0917\u0940\u0932] dddd, LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u0927\u094d\u092f\u0947",past:"%s\u092a\u0942\u0930\u094d\u0935\u0940",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u092a\u0939\u093e\u091f\u0947|\u0938\u0915\u093e\u0933\u0940|\u0926\u0941\u092a\u093e\u0930\u0940|\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940|\u0930\u093e\u0924\u094d\u0930\u0940/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u092a\u0939\u093e\u091f\u0947"===t||"\u0938\u0915\u093e\u0933\u0940"===t?e:"\u0926\u0941\u092a\u093e\u0930\u0940"===t||"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940"===t||"\u0930\u093e\u0924\u094d\u0930\u0940"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"\u092a\u0939\u093e\u091f\u0947":e<12?"\u0938\u0915\u093e\u0933\u0940":e<17?"\u0926\u0941\u092a\u093e\u0930\u0940":e<20?"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940":"\u0930\u093e\u0924\u094d\u0930\u0940"},week:{dow:0,doy:6}})}(n("wd/R"))},OjkT:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};e.defineLocale("ne",{months:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f\u0932_\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0937\u094d\u091f_\u0938\u0947\u092a\u094d\u091f\u0947\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u092d\u0947\u092e\u094d\u092c\u0930_\u0921\u093f\u0938\u0947\u092e\u094d\u092c\u0930".split("_"),monthsShort:"\u091c\u0928._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f._\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908._\u0905\u0917._\u0938\u0947\u092a\u094d\u091f._\u0905\u0915\u094d\u091f\u094b._\u0928\u094b\u092d\u0947._\u0921\u093f\u0938\u0947.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u0907\u0924\u092c\u093e\u0930_\u0938\u094b\u092e\u092c\u093e\u0930_\u092e\u0919\u094d\u0917\u0932\u092c\u093e\u0930_\u092c\u0941\u0927\u092c\u093e\u0930_\u092c\u093f\u0939\u093f\u092c\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u092c\u093e\u0930_\u0936\u0928\u093f\u092c\u093e\u0930".split("_"),weekdaysShort:"\u0906\u0907\u0924._\u0938\u094b\u092e._\u092e\u0919\u094d\u0917\u0932._\u092c\u0941\u0927._\u092c\u093f\u0939\u093f._\u0936\u0941\u0915\u094d\u0930._\u0936\u0928\u093f.".split("_"),weekdaysMin:"\u0906._\u0938\u094b._\u092e\u0902._\u092c\u0941._\u092c\u093f._\u0936\u0941._\u0936.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A\u0915\u094b h:mm \u092c\u091c\u0947",LTS:"A\u0915\u094b h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0930\u093e\u0924\u093f|\u092c\u093f\u0939\u093e\u0928|\u0926\u093f\u0909\u0901\u0938\u094b|\u0938\u093e\u0901\u091d/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u093f"===t?e<4?e:e+12:"\u092c\u093f\u0939\u093e\u0928"===t?e:"\u0926\u093f\u0909\u0901\u0938\u094b"===t?e>=10?e:e+12:"\u0938\u093e\u0901\u091d"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"\u0930\u093e\u0924\u093f":e<12?"\u092c\u093f\u0939\u093e\u0928":e<16?"\u0926\u093f\u0909\u0901\u0938\u094b":e<20?"\u0938\u093e\u0901\u091d":"\u0930\u093e\u0924\u093f"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u092d\u094b\u0932\u093f] LT",nextWeek:"[\u0906\u0909\u0901\u0926\u094b] dddd[,] LT",lastDay:"[\u0939\u093f\u091c\u094b] LT",lastWeek:"[\u0917\u090f\u0915\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u093e",past:"%s \u0905\u0917\u093e\u0921\u093f",s:"\u0915\u0947\u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0947\u0923\u094d\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u0947\u091f",mm:"%d \u092e\u093f\u0928\u0947\u091f",h:"\u090f\u0915 \u0918\u0923\u094d\u091f\u093e",hh:"%d \u0918\u0923\u094d\u091f\u093e",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u093f\u0928\u093e",MM:"%d \u092e\u0939\u093f\u0928\u093e",y:"\u090f\u0915 \u092c\u0930\u094d\u0937",yy:"%d \u092c\u0930\u094d\u0937"},week:{dow:0,doy:6}})}(n("wd/R"))},OmwH:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"D/M/YYYY",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},OpvP:function(e,t,n){var i=n("4zBA");e.exports=i({}.isPrototypeOf)},Oxv6:function(e,t,n){!function(e){"use strict";var t={0:"-\u0443\u043c",1:"-\u0443\u043c",2:"-\u044e\u043c",3:"-\u044e\u043c",4:"-\u0443\u043c",5:"-\u0443\u043c",6:"-\u0443\u043c",7:"-\u0443\u043c",8:"-\u0443\u043c",9:"-\u0443\u043c",10:"-\u0443\u043c",12:"-\u0443\u043c",13:"-\u0443\u043c",20:"-\u0443\u043c",30:"-\u044e\u043c",40:"-\u0443\u043c",50:"-\u0443\u043c",60:"-\u0443\u043c",70:"-\u0443\u043c",80:"-\u0443\u043c",90:"-\u0443\u043c",100:"-\u0443\u043c"};e.defineLocale("tg",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0430\u043b\u0438_\u043c\u0430\u0440\u0442\u0438_\u0430\u043f\u0440\u0435\u043b\u0438_\u043c\u0430\u0439\u0438_\u0438\u044e\u043d\u0438_\u0438\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442\u0438_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u0438_\u043e\u043a\u0442\u044f\u0431\u0440\u0438_\u043d\u043e\u044f\u0431\u0440\u0438_\u0434\u0435\u043a\u0430\u0431\u0440\u0438".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_")},monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u044f\u043a\u0448\u0430\u043d\u0431\u0435_\u0434\u0443\u0448\u0430\u043d\u0431\u0435_\u0441\u0435\u0448\u0430\u043d\u0431\u0435_\u0447\u043e\u0440\u0448\u0430\u043d\u0431\u0435_\u043f\u0430\u043d\u04b7\u0448\u0430\u043d\u0431\u0435_\u04b7\u0443\u043c\u044a\u0430_\u0448\u0430\u043d\u0431\u0435".split("_"),weekdaysShort:"\u044f\u0448\u0431_\u0434\u0448\u0431_\u0441\u0448\u0431_\u0447\u0448\u0431_\u043f\u0448\u0431_\u04b7\u0443\u043c_\u0448\u043d\u0431".split("_"),weekdaysMin:"\u044f\u0448_\u0434\u0448_\u0441\u0448_\u0447\u0448_\u043f\u0448_\u04b7\u043c_\u0448\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0418\u043c\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextDay:"[\u0424\u0430\u0440\u0434\u043e \u0441\u043e\u0430\u0442\u0438] LT",lastDay:"[\u0414\u0438\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u043e\u044f\u043d\u0434\u0430 \u0441\u043e\u0430\u0442\u0438] LT",lastWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u0433\u0443\u0437\u0430\u0448\u0442\u0430 \u0441\u043e\u0430\u0442\u0438] LT",sameElse:"L"},relativeTime:{future:"\u0431\u0430\u044a\u0434\u0438 %s",past:"%s \u043f\u0435\u0448",s:"\u044f\u043a\u0447\u0430\u043d\u0434 \u0441\u043e\u043d\u0438\u044f",m:"\u044f\u043a \u0434\u0430\u049b\u0438\u049b\u0430",mm:"%d \u0434\u0430\u049b\u0438\u049b\u0430",h:"\u044f\u043a \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u044f\u043a \u0440\u04ef\u0437",dd:"%d \u0440\u04ef\u0437",M:"\u044f\u043a \u043c\u043e\u04b3",MM:"%d \u043c\u043e\u04b3",y:"\u044f\u043a \u0441\u043e\u043b",yy:"%d \u0441\u043e\u043b"},meridiemParse:/\u0448\u0430\u0431|\u0441\u0443\u0431\u04b3|\u0440\u04ef\u0437|\u0431\u0435\u0433\u043e\u04b3/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0448\u0430\u0431"===t?e<4?e:e+12:"\u0441\u0443\u0431\u04b3"===t?e:"\u0440\u04ef\u0437"===t?e>=11?e:e+12:"\u0431\u0435\u0433\u043e\u04b3"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0448\u0430\u0431":e<11?"\u0441\u0443\u0431\u04b3":e<16?"\u0440\u04ef\u0437":e<19?"\u0431\u0435\u0433\u043e\u04b3":"\u0448\u0430\u0431"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0443\u043c|\u044e\u043c)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},P4y1:function(e,t){e.exports={}},PA2r:function(e,t,n){!function(e){"use strict";var t="leden_\xfanor_b\u0159ezen_duben_kv\u011bten_\u010derven_\u010dervenec_srpen_z\xe1\u0159\xed_\u0159\xedjen_listopad_prosinec".split("_"),n="led_\xfano_b\u0159e_dub_kv\u011b_\u010dvn_\u010dvc_srp_z\xe1\u0159_\u0159\xedj_lis_pro".split("_"),i=[/^led/i,/^\xfano/i,/^b\u0159e/i,/^dub/i,/^kv\u011b/i,/^(\u010dvn|\u010derven$|\u010dervna)/i,/^(\u010dvc|\u010dervenec|\u010dervence)/i,/^srp/i,/^z\xe1\u0159/i,/^\u0159\xedj/i,/^lis/i,/^pro/i],r=/^(leden|\xfanor|b\u0159ezen|duben|kv\u011bten|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|z\xe1\u0159\xed|\u0159\xedjen|listopad|prosinec|led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function o(e,t,n,i){var r=e+" ";switch(n){case"s":return t||i?"p\xe1r sekund":"p\xe1r sekundami";case"ss":return t||i?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":i?"minutu":"minutou";case"mm":return t||i?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":return t||i?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||i?"den":"dnem";case"dd":return t||i?r+(s(e)?"dny":"dn\xed"):r+"dny";case"M":return t||i?"m\u011bs\xedc":"m\u011bs\xedcem";case"MM":return t||i?r+(s(e)?"m\u011bs\xedce":"m\u011bs\xedc\u016f"):r+"m\u011bs\xedci";case"y":return t||i?"rok":"rokem";case"yy":return t||i?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|\xfanora|\xfanor|b\u0159ezen|b\u0159ezna|duben|dubna|kv\u011bten|kv\u011btna|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|srpna|z\xe1\u0159\xed|\u0159\xedjen|\u0159\xedjna|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"ned\u011ble_pond\u011bl\xed_\xfater\xfd_st\u0159eda_\u010dtvrtek_p\xe1tek_sobota".split("_"),weekdaysShort:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),weekdaysMin:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[z\xedtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v ned\u011bli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve st\u0159edu v] LT";case 4:return"[ve \u010dtvrtek v] LT";case 5:return"[v p\xe1tek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[v\u010dera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou ned\u011bli v] LT";case 1:case 2:return"[minul\xe9] dddd [v] LT";case 3:return"[minulou st\u0159edu v] LT";case 4:case 5:return"[minul\xfd] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"p\u0159ed %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},PCNd:function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("SVse"),r=n("TKcr"),s=n("V/fk"),o=n("ChqD"),a=n("yGOH"),c=n("9Xeq"),l=n("Avrn"),u=n("aexS"),d=n("aXbf"),h=n("8Y7J");let f=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=h.Pb({type:e}),e.\u0275inj=h.Ob({providers:[u.a,l.a,d.a,r.a],imports:[[i.c,c.a,s.a,o.a,a.a],s.a,c.a,o.a,a.a]}),e})()},PKPk:function(e,t,n){"use strict";var i=n("ZUd8").charAt,r=n("V37c"),s=n("afO8"),o=n("fdAy"),a="String Iterator",c=s.set,l=s.getterFor(a);o(String,"String",function(e){c(this,{type:a,string:r(e),index:0})},function(){var e,t=l(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})})},PeUW:function(e,t,n){!function(e){"use strict";var t={1:"\u0be7",2:"\u0be8",3:"\u0be9",4:"\u0bea",5:"\u0beb",6:"\u0bec",7:"\u0bed",8:"\u0bee",9:"\u0bef",0:"\u0be6"},n={"\u0be7":"1","\u0be8":"2","\u0be9":"3","\u0bea":"4","\u0beb":"5","\u0bec":"6","\u0bed":"7","\u0bee":"8","\u0bef":"9","\u0be6":"0"};e.defineLocale("ta",{months:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),monthsShort:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),weekdays:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bcd\u0bb1\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0b9f\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0ba9\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8".split("_"),weekdaysShort:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf_\u0b9a\u0ba9\u0bbf".split("_"),weekdaysMin:"\u0b9e\u0bbe_\u0ba4\u0bbf_\u0b9a\u0bc6_\u0baa\u0bc1_\u0bb5\u0bbf_\u0bb5\u0bc6_\u0b9a".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[\u0b87\u0ba9\u0bcd\u0bb1\u0bc1] LT",nextDay:"[\u0ba8\u0bbe\u0bb3\u0bc8] LT",nextWeek:"dddd, LT",lastDay:"[\u0ba8\u0bc7\u0bb1\u0bcd\u0bb1\u0bc1] LT",lastWeek:"[\u0b95\u0b9f\u0ba8\u0bcd\u0ba4 \u0bb5\u0bbe\u0bb0\u0bae\u0bcd] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0b87\u0bb2\u0bcd",past:"%s \u0bae\u0bc1\u0ba9\u0bcd",s:"\u0b92\u0bb0\u0bc1 \u0b9a\u0bbf\u0bb2 \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",ss:"%d \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",m:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0bae\u0bcd",mm:"%d \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0b99\u0bcd\u0b95\u0bb3\u0bcd",h:"\u0b92\u0bb0\u0bc1 \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",hh:"%d \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",d:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbe\u0bb3\u0bcd",dd:"%d \u0ba8\u0bbe\u0b9f\u0bcd\u0b95\u0bb3\u0bcd",M:"\u0b92\u0bb0\u0bc1 \u0bae\u0bbe\u0ba4\u0bae\u0bcd",MM:"%d \u0bae\u0bbe\u0ba4\u0b99\u0bcd\u0b95\u0bb3\u0bcd",y:"\u0b92\u0bb0\u0bc1 \u0bb5\u0bb0\u0bc1\u0b9f\u0bae\u0bcd",yy:"%d \u0b86\u0ba3\u0bcd\u0b9f\u0bc1\u0b95\u0bb3\u0bcd"},dayOfMonthOrdinalParse:/\d{1,2}\u0bb5\u0ba4\u0bc1/,ordinal:function(e){return e+"\u0bb5\u0ba4\u0bc1"},preparse:function(e){return e.replace(/[\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef\u0be6]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0baf\u0bbe\u0bae\u0bae\u0bcd|\u0bb5\u0bc8\u0b95\u0bb1\u0bc8|\u0b95\u0bbe\u0bb2\u0bc8|\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd|\u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1|\u0bae\u0bbe\u0bb2\u0bc8/,meridiem:function(e,t,n){return e<2?" \u0baf\u0bbe\u0bae\u0bae\u0bcd":e<6?" \u0bb5\u0bc8\u0b95\u0bb1\u0bc8":e<10?" \u0b95\u0bbe\u0bb2\u0bc8":e<14?" \u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd":e<18?" \u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1":e<22?" \u0bae\u0bbe\u0bb2\u0bc8":" \u0baf\u0bbe\u0bae\u0bae\u0bcd"},meridiemHour:function(e,t){return 12===e&&(e=0),"\u0baf\u0bbe\u0bae\u0bae\u0bcd"===t?e<2?e:e+12:"\u0bb5\u0bc8\u0b95\u0bb1\u0bc8"===t||"\u0b95\u0bbe\u0bb2\u0bc8"===t||"\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("wd/R"))},PhyI:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return r});var i=function(e){return e[e.global=0]="global",e[e.pool=1]="pool",e[e.image=2]="image",e}({}),r=function(e){return e[e.bps=0]="bps",e[e.iops=1]="iops",e[e.milliseconds=2]="milliseconds",e}({})},PpIw:function(e,t,n){!function(e){"use strict";var t={1:"\u0ce7",2:"\u0ce8",3:"\u0ce9",4:"\u0cea",5:"\u0ceb",6:"\u0cec",7:"\u0ced",8:"\u0cee",9:"\u0cef",0:"\u0ce6"},n={"\u0ce7":"1","\u0ce8":"2","\u0ce9":"3","\u0cea":"4","\u0ceb":"5","\u0cec":"6","\u0ced":"7","\u0cee":"8","\u0cef":"9","\u0ce6":"0"};e.defineLocale("kn",{months:"\u0c9c\u0ca8\u0cb5\u0cb0\u0cbf_\u0cab\u0cc6\u0cac\u0ccd\u0cb0\u0cb5\u0cb0\u0cbf_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5\u0cac\u0cb0\u0ccd_\u0ca8\u0cb5\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82\u0cac\u0cb0\u0ccd".split("_"),monthsShort:"\u0c9c\u0ca8_\u0cab\u0cc6\u0cac\u0ccd\u0cb0_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5_\u0ca8\u0cb5\u0cc6\u0c82_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82".split("_"),monthsParseExact:!0,weekdays:"\u0cad\u0cbe\u0ca8\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae\u0cb5\u0cbe\u0cb0_\u0cae\u0c82\u0c97\u0cb3\u0cb5\u0cbe\u0cb0_\u0cac\u0cc1\u0ca7\u0cb5\u0cbe\u0cb0_\u0c97\u0cc1\u0cb0\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0\u0cb5\u0cbe\u0cb0_\u0cb6\u0ca8\u0cbf\u0cb5\u0cbe\u0cb0".split("_"),weekdaysShort:"\u0cad\u0cbe\u0ca8\u0cc1_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae_\u0cae\u0c82\u0c97\u0cb3_\u0cac\u0cc1\u0ca7_\u0c97\u0cc1\u0cb0\u0cc1_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0_\u0cb6\u0ca8\u0cbf".split("_"),weekdaysMin:"\u0cad\u0cbe_\u0cb8\u0cc6\u0cc2\u0cd5_\u0cae\u0c82_\u0cac\u0cc1_\u0c97\u0cc1_\u0cb6\u0cc1_\u0cb6".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c87\u0c82\u0ca6\u0cc1] LT",nextDay:"[\u0ca8\u0cbe\u0cb3\u0cc6] LT",nextWeek:"dddd, LT",lastDay:"[\u0ca8\u0cbf\u0ca8\u0ccd\u0ca8\u0cc6] LT",lastWeek:"[\u0c95\u0cc6\u0cc2\u0ca8\u0cc6\u0caf] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0ca8\u0c82\u0ca4\u0cb0",past:"%s \u0cb9\u0cbf\u0c82\u0ca6\u0cc6",s:"\u0c95\u0cc6\u0cb2\u0cb5\u0cc1 \u0c95\u0ccd\u0cb7\u0ca3\u0c97\u0cb3\u0cc1",ss:"%d \u0cb8\u0cc6\u0c95\u0cc6\u0c82\u0ca1\u0cc1\u0c97\u0cb3\u0cc1",m:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",mm:"%d \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",h:"\u0c92\u0c82\u0ca6\u0cc1 \u0c97\u0c82\u0c9f\u0cc6",hh:"%d \u0c97\u0c82\u0c9f\u0cc6",d:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca6\u0cbf\u0ca8",dd:"%d \u0ca6\u0cbf\u0ca8",M:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",MM:"%d \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",y:"\u0c92\u0c82\u0ca6\u0cc1 \u0cb5\u0cb0\u0ccd\u0cb7",yy:"%d \u0cb5\u0cb0\u0ccd\u0cb7"},preparse:function(e){return e.replace(/[\u0ce7\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef\u0ce6]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf|\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6|\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8|\u0cb8\u0c82\u0c9c\u0cc6/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"===t?e<4?e:e+12:"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6"===t?e:"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8"===t?e>=10?e:e+12:"\u0cb8\u0c82\u0c9c\u0cc6"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf":e<10?"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6":e<17?"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8":e<20?"\u0cb8\u0c82\u0c9c\u0cc6":"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"},dayOfMonthOrdinalParse:/\d{1,2}(\u0ca8\u0cc6\u0cd5)/,ordinal:function(e){return e+"\u0ca8\u0cc6\u0cd5"},week:{dow:0,doy:6}})}(n("wd/R"))},PqYM:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("HDdC"),r=n("D0XW"),s=n("Y7HM"),o=n("z+Ro");function a(e=0,t,n){let a=-1;return Object(s.a)(t)?a=Number(t)<1?1:Number(t):Object(o.a)(t)&&(n=t),Object(o.a)(n)||(n=r.a),new i.a(t=>{const i=Object(s.a)(e)?e:+e-n.now();return n.schedule(c,i,{index:0,period:a,subscriber:t})})}function c(e){const{index:t,period:n,subscriber:i}=e;if(i.next(t),!i.closed){if(-1===n)return i.complete();e.index=t+1,this.schedule(e,n)}}},QFaf:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("s7LF");class r extends i.j{constructor(e,t,n){super(e,t,n),this.controls=e}get(e){const t=this._get(e);if(!t)throw new Error(`Control '${e}' could not be found!`);return t}_get(e){return super.get(e)||Object.values(this.controls).filter(e=>e.get).map(t=>t instanceof r?t._get(e):t.get(e)).find(e=>Boolean(e))}getValue(e){return this.get(e).value}silentSet(e,t){this.get(e).setValue(t,{emitEvent:!1})}showError(e,t,n){const i=this.get(e);return(t.submitted||i.dirty)&&(n?i.hasError(n):i.invalid)}}},QTAa:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("t/zF");class r extends i.a{}},QWBl:function(e,t,n){"use strict";var i=n("I+eb"),r=n("F8JR");i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},Qj4J:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062a\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062a\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:0,doy:12}})}(n("wd/R"))},RAwQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_M\xe4erz_Abr\xebll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_M\xe9indeg_D\xebnschdeg_M\xebttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._M\xe9._D\xeb._M\xeb._Do._Fr._Sa.".split("_"),weekdaysMin:"So_M\xe9_D\xeb_M\xeb_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[G\xebschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d M\xe9int",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},RK3t:function(e,t,n){var i=n("2oRo"),r=n("4zBA"),s=n("0Dky"),o=n("xrYK"),a=i.Object,c=r("".split);e.exports=s(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"==o(e)?c(e,""):a(e)}:a},RNIs:function(e,t,n){var i=n("tiKp"),r=n("fHMY"),s=n("m/L8"),o=i("unscopables"),a=Array.prototype;null==a[o]&&s.f(a,o,{configurable:!0,value:r(null)}),e.exports=function(e){a[o][e]=!0}},Rf2I:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var i=n("s7LF"),r=n("LvDl"),s=n.n(r),o=n("2EZI"),a=n("Fgil"),c=n("aXbf"),l=n("8Y7J"),u=n("G0yt"),d=n("ajRT"),h=n("SVse"),f=n("NwgZ"),p=n("6+kj"),m=n("ANnk"),b=n("f69J"),g=n("EmSq"),_=n("ppaS");function v(e,t){if(1&e&&(l.Vb(0,10),l.Rc(1),l.Ub()),2&e){const e=l.nc();l.Db(1),l.Tc(" ",e.titleText," ")}}function y(e,t){if(1&e&&(l.Xb(0,"p"),l.Rc(1),l.Wb()),2&e){const e=l.nc();l.Db(1),l.Sc(e.message)}}const w=function(e){return{required:e}};function D(e,t){if(1&e&&(l.Xb(0,"label",18),l.Rc(1),l.Wb()),2&e){const e=l.nc().$implicit;l.uc("ngClass",l.zc(3,w,!0===(null==e?null:e.required)))("for",e.name),l.Db(1),l.Tc(" ",e.label," ")}}function S(e,t){if(1&e&&l.Sb(0,"input",19),2&e){const e=l.nc().$implicit;l.uc("type",e.type)("id",e.name)("name",e.name)("formControlName",e.name)}}function x(e,t){if(1&e&&l.Sb(0,"input",20),2&e){const e=l.nc().$implicit;l.uc("id",e.name)("name",e.name)("formControlName",e.name)}}function k(e,t){if(1&e&&(l.Xb(0,"option",24),l.Rc(1),l.Wb()),2&e){const e=l.nc(2).$implicit;l.uc("ngValue",null),l.Db(1),l.Tc(" ",null==e||null==e.typeConfig?null:e.typeConfig.placeholder," ")}}function T(e,t){if(1&e&&(l.Xb(0,"option",25),l.Rc(1),l.Wb()),2&e){const e=t.$implicit;l.uc("value",e.value),l.Db(1),l.Tc(" ",e.text," ")}}function M(e,t){if(1&e&&(l.Xb(0,"select",21),l.Pc(1,k,2,2,"option",22),l.Pc(2,T,2,2,"option",23),l.Wb()),2&e){const e=l.nc().$implicit;l.uc("id",e.name)("formControlName",e.name),l.Db(1),l.uc("ngIf",null==e||null==e.typeConfig?null:e.typeConfig.placeholder),l.Db(1),l.uc("ngForOf",null==e||null==e.typeConfig?null:e.typeConfig.options)}}function C(e,t){if(1&e&&l.Sb(0,"cd-select-badges",26),2&e){const e=l.nc().$implicit;l.uc("id",e.name)("data",e.value)("customBadges",null==e||null==e.typeConfig?null:e.typeConfig.customBadges)("options",null==e||null==e.typeConfig?null:e.typeConfig.options)("messages",null==e||null==e.typeConfig?null:e.typeConfig.messages)}}function O(e,t){if(1&e&&(l.Xb(0,"span",27),l.Rc(1),l.Wb()),2&e){const e=l.nc().$implicit,t=l.nc();l.Db(1),l.Tc(" ",t.getError(e)," ")}}const L=function(e,t){return{"cd-col-form-input":e,"col-sm-12":t}},E=function(){return["text","number"]};function A(e,t){if(1&e&&(l.Vb(0),l.Xb(1,"div"),l.Pc(2,D,2,5,"label",11),l.Xb(3,"div",12),l.Pc(4,S,1,4,"input",13),l.Pc(5,x,1,3,"input",14),l.Pc(6,M,3,4,"select",15),l.Pc(7,C,1,5,"cd-select-badges",16),l.Pc(8,O,2,1,"span",17),l.Wb(),l.Wb(),l.Ub()),2&e){const e=t.$implicit,n=l.nc(),i=l.Fc(4);l.Db(1),l.Gb("form-group row cd-",e.name,"-form-group"),l.Db(1),l.uc("ngIf",e.label),l.Db(1),l.uc("ngClass",l.Ac(10,L,e.label,!e.label)),l.Db(1),l.uc("ngIf",l.yc(13,E).includes(e.type)),l.Db(1),l.uc("ngIf","binary"===e.type),l.Db(1),l.uc("ngIf","select"===e.type),l.Db(1),l.uc("ngIf","select-badges"===e.type),l.Db(1),l.uc("ngIf",n.formGroup.showError(e.name,i))}}let I=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.formBuilder=t,this.formatter=n,this.dimlessBinaryPipe=i}ngOnInit(){this.createForm()}createForm(){const e={};this.fields.forEach(t=>{e[t.name]=this.createFormControl(t)}),this.formGroup=this.formBuilder.group(e)}createFormControl(e){let t=[];return s.a.isBoolean(e.required)&&e.required&&t.push(i.A.required),e.validators&&(t=t.concat(e.validators)),new i.h(s.a.defaultTo("binary"===e.type?this.dimlessBinaryPipe.transform(e.value):e.value,null),{validators:t})}getError(e){const t=this.formGroup.get(e.name).errors;return Object.keys(t).map(n=>this.getErrorMessage(n,t[n],e.errors)).join("<br>")}getErrorMessage(e,t,n){if(n){const t=n[e];if(t)return t}return["binaryMin","binaryMax"].includes(e)?t():"required"===e?"This field is required.":"An error occurred."}onSubmitForm(e){this.fields.filter(e=>"binary"===e.type).map(e=>e.name).forEach(t=>{const n=e[t];n&&(e[t]=this.formatter.toBytes(n))}),this.activeModal.close(),s.a.isFunction(this.onSubmit)&&this.onSubmit(e)}}return e.\u0275fac=function(t){return new(t||e)(l.Rb(u.a),l.Rb(o.a),l.Rb(c.a),l.Rb(a.a))},e.\u0275cmp=l.Lb({type:e,selectors:[["cd-form-modal"]],decls:10,vars:7,consts:[[3,"modalRef"],["class","modal-title",4,"ngIf"],[1,"modal-content"],["novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"modal-title"],["class","cd-col-form-label",3,"ngClass","for",4,"ngIf"],[3,"ngClass"],["class","form-control",3,"type","id","name","formControlName",4,"ngIf"],["type","text","class","form-control","cdDimlessBinary","",3,"id","name","formControlName",4,"ngIf"],["class","form-control custom-select",3,"id","formControlName",4,"ngIf"],[3,"id","data","customBadges","options","messages",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-label",3,"ngClass","for"],[1,"form-control",3,"type","id","name","formControlName"],["type","text","cdDimlessBinary","",1,"form-control",3,"id","name","formControlName"],[1,"form-control","custom-select",3,"id","formControlName"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],[3,"value"],[3,"id","data","customBadges","options","messages"],[1,"invalid-feedback"]],template:function(e,t){1&e&&(l.Xb(0,"cd-modal",0),l.Pc(1,v,2,1,"ng-container",1),l.Vb(2,2),l.Xb(3,"form",3,4),l.Xb(5,"div",5),l.Pc(6,y,2,1,"p",6),l.Pc(7,A,9,14,"ng-container",7),l.Wb(),l.Xb(8,"div",8),l.Xb(9,"cd-form-button-panel",9),l.lc("submitActionEvent",function(){return t.onSubmitForm(t.formGroup.value)}),l.Wb(),l.Wb(),l.Wb(),l.Ub(),l.Wb()),2&e&&(l.uc("modalRef",t.activeModal),l.Db(1),l.uc("ngIf",t.titleText),l.Db(2),l.uc("formGroup",t.formGroup),l.Db(3),l.uc("ngIf",t.message),l.Db(1),l.uc("ngForOf",t.fields),l.Db(2),l.uc("form",t.formGroup)("submitText",t.submitButtonText))},directives:[d.a,h.r,i.B,i.r,i.k,f.a,h.q,p.a,h.p,m.a,i.d,b.a,i.q,i.i,g.a,i.z,i.u,i.C,_.a],styles:[""]}),e})()},Rm1S:function(e,t,n){"use strict";var i=n("xluM"),r=n("14Sl"),s=n("glrk"),o=n("UMSQ"),a=n("V37c"),c=n("HYAF"),l=n("3Eq5"),u=n("iqWW"),d=n("FMNM");r("match",function(e,t,n){return[function(t){var n=c(this),r=null==t?void 0:l(t,e);return r?i(r,t,n):new RegExp(t)[e](a(n))},function(e){var i=s(this),r=a(e),c=n(t,i,r);if(c.done)return c.value;if(!i.global)return d(i,r);var l=i.unicode;i.lastIndex=0;for(var h,f=[],p=0;null!==(h=d(i,r));){var m=a(h[0]);f[p]=m,""===m&&(i.lastIndex=u(r,o(i.lastIndex),l)),p++}return 0===p?null:f}]})},RnhZ:function(e,t,n){var i={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn-bd":"loYQ","./bn-bd.js":"loYQ","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-in":"7C5Q","./en-in.js":"7C5Q","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./en-sg":"t+mt","./en-sg.js":"t+mt","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-mx":"tbfe","./es-mx.js":"tbfe","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fil":"1ppg","./fil.js":"1ppg","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-deva":"qvJo","./gom-deva.js":"qvJo","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./oc-lnc":"Fnuy","./oc-lnc.js":"Fnuy","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tk":"Wv91","./tk.js":"Wv91","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-mo":"OmwH","./zh-mo.js":"OmwH","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id="RnhZ"},S6ln:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=e+" ";switch(n){case"ss":return i+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return i+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return i+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return i+(1===e?"dan":"dana");case"MM":return i+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return i+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"sije\u010dnja_velja\u010de_o\u017eujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"sije\u010danj_velja\u010da_o\u017eujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._o\u017eu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:return"[pro\u0161lu] [nedjelju] [u] LT";case 3:return"[pro\u0161lu] [srijedu] [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},S7zO:function(e,t,n){"use strict";n.d(t,"a",function(){return g});var i=n("LvDl"),r=n.n(i),s=n("oxzT"),o=(n("vCyI"),n("jKX/"),n("8Y7J")),a=n("SVse"),c=n("iInd"),l=n("G0yt");const u=function(e){return{disabled:e}},d=function(e){return[e]};function h(e,t){if(1&e){const e=o.Yb();o.Vb(0),o.Xb(1,"button",3),o.lc("click",function(){o.Ic(e);const t=o.nc();return t.useClickAction(t.currentAction)}),o.Sb(2,"i",4),o.Xb(3,"span"),o.Rc(4),o.Wb(),o.Wb(),o.Ub()}if(2&e){const e=o.nc();o.Db(1),o.Gb("btn btn-",e.btnColor,""),o.vc("title",e.useDisableDesc(e.currentAction)),o.uc("ngClass",o.zc(9,u,e.disableSelectionAction(e.currentAction)))("routerLink",e.useRouterLink(e.currentAction))("preserveFragment",e.currentAction.preserveFragment?"":null),o.Db(1),o.uc("ngClass",o.zc(11,d,e.currentAction.icon)),o.Db(2),o.Sc(e.currentAction.name)}}function f(e,t){if(1&e&&(o.Vb(0),o.Rc(1),o.Ub()),2&e){const e=o.nc(2);o.Db(1),o.Tc("",e.dropDownOnly," ")}}function p(e,t){1&e&&o.Sb(0,"span",10)}function m(e,t){if(1&e){const e=o.Yb();o.Vb(0),o.Xb(1,"button",11),o.lc("click",function(){o.Ic(e);const n=t.$implicit;return o.nc(2).useClickAction(n)}),o.Sb(2,"i",4),o.Xb(3,"span"),o.Rc(4),o.Wb(),o.Wb(),o.Ub()}if(2&e){const e=t.$implicit,n=o.nc(2);o.Db(1),o.Fb(n.toClassName(e)),o.vc("title",n.useDisableDesc(e)),o.uc("routerLink",n.useRouterLink(e))("preserveFragment",e.preserveFragment?"":null)("disabled",n.disableSelectionAction(e)),o.Db(1),o.uc("ngClass",o.zc(9,d,e.icon)),o.Db(2),o.Sc(e.name)}}function b(e,t){if(1&e&&(o.Xb(0,"div",5),o.Xb(1,"button",6),o.Pc(2,f,2,1,"ng-container",1),o.Pc(3,p,1,0,"span",7),o.Wb(),o.Xb(4,"div",8),o.Pc(5,m,5,11,"ng-container",9),o.Wb(),o.Wb()),2&e){const e=o.nc();o.Db(1),o.Gb("btn btn-",e.btnColor," dropdown-toggle-split"),o.Db(1),o.uc("ngIf",e.dropDownOnly),o.Db(1),o.uc("ngIf",!e.dropDownOnly),o.Db(2),o.uc("ngForOf",e.dropDownActions)}}let g=(()=>{class e{constructor(){this.btnColor="accent",this.dropDownActions=[],this.icons=s.a}ngOnInit(){this.removeActionsWithNoPermissions(),this.onSelectionChange()}ngOnChanges(e){e.selection&&this.onSelectionChange()}onSelectionChange(){this.updateDropDownActions(),this.updateCurrentAction()}toClassName(e){return e.name.replace(/ /g,"-").replace(/[^a-z-]/gi,"").toLowerCase()}removeActionsWithNoPermissions(){if(!this.permission)return void(this.tableActions=[]);const e=Object.keys(this.permission).filter(e=>this.permission[e]);this.tableActions=this.tableActions.filter(t=>e.includes(t.permission))}updateDropDownActions(){this.dropDownActions=this.tableActions.filter(e=>e.visible?e.visible(this.selection):e)}updateCurrentAction(){if(this.dropDownOnly)return void(this.currentAction=void 0);let e=this.dropDownActions.find(e=>this.showableAction(e));!e&&this.dropDownActions.length>0&&(e=this.dropDownActions[0]),this.currentAction=e}showableAction(e){const t=e.canBePrimary,n=this.selection.hasSingleSelection,i="create"===e.permission?!n:n;return t&&t(this.selection)||!t&&i}useRouterLink(e){if(e.routerLink&&!this.disableSelectionAction(e))return r.a.isString(e.routerLink)?e.routerLink:e.routerLink()}disableSelectionAction(e){const t=e.disable;if(t)return Boolean(t(this.selection));const n=e.permission,i=this.selection.hasSingleSelection&&this.selection.first();return Boolean(["update","delete"].includes(n)&&(!i||i.cdExecuting))}useClickAction(e){return!this.disableSelectionAction(e)&&e.click&&e.click()}useDisableDesc(e){if(e.disable){const t=e.disable(this.selection);return r.a.isString(t)?t:void 0}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Lb({type:e,selectors:[["cd-table-actions"]],inputs:{permission:"permission",selection:"selection",tableActions:"tableActions",btnColor:"btnColor",dropDownOnly:"dropDownOnly"},features:[o.Bb],decls:3,vars:2,consts:[[1,"btn-group"],[4,"ngIf"],["class","btn-group","ngbDropdown","","role","group","aria-label","Button group with nested dropdown",4,"ngIf"],["type","button",3,"title","ngClass","routerLink","preserveFragment","click"],[3,"ngClass"],["ngbDropdown","","role","group","aria-label","Button group with nested dropdown",1,"btn-group"],["ngbDropdownToggle",""],["class","sr-only",4,"ngIf"],["ngbDropdownMenu","",1,"dropdown-menu"],[4,"ngFor","ngForOf"],[1,"sr-only"],["ngbDropdownItem","",3,"title","routerLink","preserveFragment","disabled","click"]],template:function(e,t){1&e&&(o.Xb(0,"div",0),o.Pc(1,h,5,13,"ng-container",1),o.Pc(2,b,6,6,"div",2),o.Wb()),2&e&&(o.Db(1),o.uc("ngIf",t.currentAction),o.Db(1),o.uc("ngIf",t.dropDownActions.length>1))},directives:[a.r,a.p,c.f,l.i,l.m,l.k,a.q,l.j],styles:["button.disabled[_ngcontent-%COMP%]{cursor:default!important;pointer-events:auto}"]}),e})()},SFrS:function(e,t,n){var i=n("2oRo"),r=n("xluM"),s=n("Fib7"),o=n("hh1v"),a=i.TypeError;e.exports=function(e,t){var n,i;if("string"===t&&s(n=e.toString)&&!o(i=r(n,e)))return i;if(s(n=e.valueOf)&&!o(i=r(n,e)))return i;if("string"!==t&&s(n=e.toString)&&!o(i=r(n,e)))return i;throw a("Can't convert object to primitive value")}},SFxW:function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-nc\u0131",9:"-uncu",10:"-uncu",30:"-uncu",60:"-\u0131nc\u0131",90:"-\u0131nc\u0131"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ert\u0259si_\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131_\xc7\u0259r\u015f\u0259nb\u0259_C\xfcm\u0259 ax\u015fam\u0131_C\xfcm\u0259_\u015e\u0259nb\u0259".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7\u0259r_CAx_C\xfcm_\u015e\u0259n".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7\u0259_CA_C\xfc_\u015e\u0259".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[g\u0259l\u0259n h\u0259ft\u0259] dddd [saat] LT",lastDay:"[d\xfcn\u0259n] LT",lastWeek:"[ke\xe7\u0259n h\u0259ft\u0259] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \u0259vv\u0259l",s:"bir ne\xe7\u0259 saniy\u0259",ss:"%d saniy\u0259",m:"bir d\u0259qiq\u0259",mm:"%d d\u0259qiq\u0259",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gec\u0259|s\u0259h\u0259r|g\xfcnd\xfcz|ax\u015fam/,isPM:function(e){return/^(g\xfcnd\xfcz|ax\u015fam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gec\u0259":e<12?"s\u0259h\u0259r":e<17?"g\xfcnd\xfcz":"ax\u015fam"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0131nc\u0131|inci|nci|\xfcnc\xfc|nc\u0131|uncu)/,ordinal:function(e){if(0===e)return e+"-\u0131nc\u0131";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},STAE:function(e,t,n){var i=n("LQDL"),r=n("0Dky");e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&i&&i<41})},SVse:function(e,t,n){"use strict";n.d(t,"a",function(){return y}),n.d(t,"b",function(){return We}),n.d(t,"c",function(){return Qe}),n.d(t,"d",function(){return c}),n.d(t,"e",function(){return $e}),n.d(t,"f",function(){return qe}),n.d(t,"g",function(){return C}),n.d(t,"h",function(){return D}),n.d(t,"i",function(){return Xe}),n.d(t,"j",function(){return Ve}),n.d(t,"k",function(){return Be}),n.d(t,"l",function(){return d}),n.d(t,"m",function(){return S}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return je}),n.d(t,"p",function(){return ve}),n.d(t,"q",function(){return we}),n.d(t,"r",function(){return Se}),n.d(t,"s",function(){return Le}),n.d(t,"t",function(){return Me}),n.d(t,"u",function(){return Ce}),n.d(t,"v",function(){return Oe}),n.d(t,"w",function(){return Ee}),n.d(t,"x",function(){return w}),n.d(t,"y",function(){return Ge}),n.d(t,"z",function(){return l}),n.d(t,"A",function(){return Ne}),n.d(t,"B",function(){return O}),n.d(t,"C",function(){return ze}),n.d(t,"D",function(){return tt}),n.d(t,"E",function(){return J}),n.d(t,"F",function(){return I}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return R}),n.d(t,"I",function(){return et}),n.d(t,"J",function(){return a}),n.d(t,"K",function(){return Ze}),n.d(t,"L",function(){return s}),n.d(t,"M",function(){return _e}),n.d(t,"N",function(){return o});var i=n("8Y7J");let r=null;function s(){return r}function o(e){r||(r=e)}class a{}const c=new i.u("DocumentToken");let l=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:u,token:e,providedIn:"platform"}),e})();function u(){return Object(i.ic)(h)}const d=new i.u("Location Initialized");let h=(()=>{class e extends l{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=s().getLocation(),this._history=s().getHistory()}getBaseHrefFromDOM(){return s().getBaseHref(this._doc)}onPopState(e){s().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",e,!1)}onHashChange(e){s().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",e,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,t,n){f()?this._history.pushState(e,t,n):this.location.hash=n}replaceState(e,t,n){f()?this._history.replaceState(e,t,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return e.\u0275fac=function(t){return new(t||e)(i.ic(c))},e.\u0275prov=Object(i.Nb)({factory:p,token:e,providedIn:"platform"}),e})();function f(){return!!window.history.pushState}function p(){return new h(Object(i.ic)(c))}function m(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}function b(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}function g(e){return e&&"?"!==e[0]?"?"+e:e}let _=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:v,token:e,providedIn:"root"}),e})();function v(e){const t=Object(i.ic)(c).location;return new w(Object(i.ic)(l),t&&t.origin||"")}const y=new i.u("appBaseHref");let w=(()=>{class e extends _{constructor(e,t){if(super(),this._platformLocation=e,null==t&&(t=this._platformLocation.getBaseHrefFromDOM()),null==t)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=t}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return m(this._baseHref,e)}path(e=!1){const t=this._platformLocation.pathname+g(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?`${t}${n}`:t}pushState(e,t,n,i){const r=this.prepareExternalUrl(n+g(i));this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,i){const r=this.prepareExternalUrl(n+g(i));this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return e.\u0275fac=function(t){return new(t||e)(i.ic(l),i.ic(y,8))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),D=(()=>{class e extends _{constructor(e,t){super(),this._platformLocation=e,this._baseHref="",null!=t&&(this._baseHref=t)}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t}prepareExternalUrl(e){const t=m(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,n,i){let r=this.prepareExternalUrl(n+g(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,i){let r=this.prepareExternalUrl(n+g(i));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return e.\u0275fac=function(t){return new(t||e)(i.ic(l),i.ic(y,8))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),S=(()=>{class e{constructor(e,t){this._subject=new i.p,this._urlChangeListeners=[],this._platformStrategy=e;const n=this._platformStrategy.getBaseHref();this._platformLocation=t,this._baseHref=b(k(n)),this._platformStrategy.onPopState(e=>{this._subject.emit({url:this.path(!0),pop:!0,state:e.state,type:e.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+g(t))}normalize(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,k(t)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(e,t="",n=null){this._platformStrategy.pushState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g(t)),n)}replaceState(e,t="",n=null){this._platformStrategy.replaceState(n,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g(t)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(e){this._urlChangeListeners.push(e),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(e=>{this._notifyUrlChangeListeners(e.url,e.state)}))}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach(n=>n(e,t))}subscribe(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}}return e.\u0275fac=function(t){return new(t||e)(i.ic(_),i.ic(l))},e.normalizeQueryParams=g,e.joinWithSlash=m,e.stripTrailingSlash=b,e.\u0275prov=Object(i.Nb)({factory:x,token:e,providedIn:"root"}),e})();function x(){return new S(Object(i.ic)(_),Object(i.ic)(l))}function k(e){return e.replace(/\/index.html$/,"")}var T=function(e){return e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency",e[e.Scientific=3]="Scientific",e}({}),M=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),C=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),O=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),L=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),E=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function A(e,t,n){const r=Object(i.mb)(e),s=$([r[i.cb.DayPeriodsFormat],r[i.cb.DayPeriodsStandalone]],t);return $(s,n)}function I(e,t,n){const r=Object(i.mb)(e),s=$([r[i.cb.DaysFormat],r[i.cb.DaysStandalone]],t);return $(s,n)}function R(e,t,n){const r=Object(i.mb)(e),s=$([r[i.cb.MonthsFormat],r[i.cb.MonthsStandalone]],t);return $(s,n)}function P(e,t){return $(Object(i.mb)(e)[i.cb.DateFormat],t)}function F(e,t){return $(Object(i.mb)(e)[i.cb.TimeFormat],t)}function W(e,t){return $(Object(i.mb)(e)[i.cb.DateTimeFormat],t)}function j(e,t){const n=Object(i.mb)(e),r=n[i.cb.NumberSymbols][t];if(void 0===r){if(t===E.CurrencyDecimal)return n[i.cb.NumberSymbols][E.Decimal];if(t===E.CurrencyGroup)return n[i.cb.NumberSymbols][E.Group]}return r}function Y(e,t){return Object(i.mb)(e)[i.cb.NumberFormats][t]}const N=i.pb;function z(e){if(!e[i.cb.ExtraData])throw new Error(`Missing extra locale data for the locale "${e[i.cb.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function $(e,t){for(let n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function H(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}const X=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,V={},B=/((?:[^GyYMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;var U=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),q=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),G=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function J(e,t,n,i){let r=function(e){if(le(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){const[t,n=1,i=1]=e.split("-").map(e=>+e);return K(t,n-1,i)}const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let n;if(n=e.match(X))return function(e){const t=new Date(0);let n=0,i=0;const r=e[8]?t.setUTCFullYear:t.setFullYear,s=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),i=Number(e[9]+e[11])),r.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const o=Number(e[4]||0)-n,a=Number(e[5]||0)-i,c=Number(e[6]||0),l=Math.floor(1e3*parseFloat("0."+(e[7]||0)));return s.call(t,o,a,c,l),t}(n)}const t=new Date(e);if(!le(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=Q(n,t)||t;let s,o=[];for(;t;){if(s=B.exec(t),!s){o.push(t);break}{o=o.concat(s.slice(1));const e=o.pop();if(!e)break;t=e}}let a=r.getTimezoneOffset();i&&(a=ce(i,a),r=function(e,t,n){const i=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(ce(t,i)-i))}(r,i));let c="";return o.forEach(e=>{const t=function(e){if(ae[e])return ae[e];let t;switch(e){case"G":case"GG":case"GGG":t=ne(G.Eras,O.Abbreviated);break;case"GGGG":t=ne(G.Eras,O.Wide);break;case"GGGGG":t=ne(G.Eras,O.Narrow);break;case"y":t=te(q.FullYear,1,0,!1,!0);break;case"yy":t=te(q.FullYear,2,0,!0,!0);break;case"yyy":t=te(q.FullYear,3,0,!1,!0);break;case"yyyy":t=te(q.FullYear,4,0,!1,!0);break;case"Y":t=oe(1);break;case"YY":t=oe(2,!0);break;case"YYY":t=oe(3);break;case"YYYY":t=oe(4);break;case"M":case"L":t=te(q.Month,1,1);break;case"MM":case"LL":t=te(q.Month,2,1);break;case"MMM":t=ne(G.Months,O.Abbreviated);break;case"MMMM":t=ne(G.Months,O.Wide);break;case"MMMMM":t=ne(G.Months,O.Narrow);break;case"LLL":t=ne(G.Months,O.Abbreviated,C.Standalone);break;case"LLLL":t=ne(G.Months,O.Wide,C.Standalone);break;case"LLLLL":t=ne(G.Months,O.Narrow,C.Standalone);break;case"w":t=se(1);break;case"ww":t=se(2);break;case"W":t=se(1,!0);break;case"d":t=te(q.Date,1);break;case"dd":t=te(q.Date,2);break;case"E":case"EE":case"EEE":t=ne(G.Days,O.Abbreviated);break;case"EEEE":t=ne(G.Days,O.Wide);break;case"EEEEE":t=ne(G.Days,O.Narrow);break;case"EEEEEE":t=ne(G.Days,O.Short);break;case"a":case"aa":case"aaa":t=ne(G.DayPeriods,O.Abbreviated);break;case"aaaa":t=ne(G.DayPeriods,O.Wide);break;case"aaaaa":t=ne(G.DayPeriods,O.Narrow);break;case"b":case"bb":case"bbb":t=ne(G.DayPeriods,O.Abbreviated,C.Standalone,!0);break;case"bbbb":t=ne(G.DayPeriods,O.Wide,C.Standalone,!0);break;case"bbbbb":t=ne(G.DayPeriods,O.Narrow,C.Standalone,!0);break;case"B":case"BB":case"BBB":t=ne(G.DayPeriods,O.Abbreviated,C.Format,!0);break;case"BBBB":t=ne(G.DayPeriods,O.Wide,C.Format,!0);break;case"BBBBB":t=ne(G.DayPeriods,O.Narrow,C.Format,!0);break;case"h":t=te(q.Hours,1,-12);break;case"hh":t=te(q.Hours,2,-12);break;case"H":t=te(q.Hours,1);break;case"HH":t=te(q.Hours,2);break;case"m":t=te(q.Minutes,1);break;case"mm":t=te(q.Minutes,2);break;case"s":t=te(q.Seconds,1);break;case"ss":t=te(q.Seconds,2);break;case"S":t=te(q.FractionalSeconds,1);break;case"SS":t=te(q.FractionalSeconds,2);break;case"SSS":t=te(q.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=ie(U.Short);break;case"ZZZZZ":t=ie(U.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=ie(U.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=ie(U.Long);break;default:return null}return ae[e]=t,t}(e);c+=t?t(r,n,a):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}function K(e,t,n){const i=new Date(0);return i.setFullYear(e,t,n),i.setHours(0,0,0),i}function Q(e,t){const n=function(e){return Object(i.mb)(e)[i.cb.LocaleId]}(e);if(V[n]=V[n]||{},V[n][t])return V[n][t];let r="";switch(t){case"shortDate":r=P(e,L.Short);break;case"mediumDate":r=P(e,L.Medium);break;case"longDate":r=P(e,L.Long);break;case"fullDate":r=P(e,L.Full);break;case"shortTime":r=F(e,L.Short);break;case"mediumTime":r=F(e,L.Medium);break;case"longTime":r=F(e,L.Long);break;case"fullTime":r=F(e,L.Full);break;case"short":const t=Q(e,"shortTime"),n=Q(e,"shortDate");r=Z(W(e,L.Short),[t,n]);break;case"medium":const i=Q(e,"mediumTime"),s=Q(e,"mediumDate");r=Z(W(e,L.Medium),[i,s]);break;case"long":const o=Q(e,"longTime"),a=Q(e,"longDate");r=Z(W(e,L.Long),[o,a]);break;case"full":const c=Q(e,"fullTime"),l=Q(e,"fullDate");r=Z(W(e,L.Full),[c,l])}return r&&(V[n][t]=r),r}function Z(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e}function ee(e,t,n="-",i,r){let s="";(e<0||r&&e<=0)&&(r?e=1-e:(e=-e,s=n));let o=String(e);for(;o.length<t;)o="0"+o;return i&&(o=o.substr(o.length-t)),s+o}function te(e,t,n=0,i=!1,r=!1){return function(s,o){let a=function(e,t){switch(e){case q.FullYear:return t.getFullYear();case q.Month:return t.getMonth();case q.Date:return t.getDate();case q.Hours:return t.getHours();case q.Minutes:return t.getMinutes();case q.Seconds:return t.getSeconds();case q.FractionalSeconds:return t.getMilliseconds();case q.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,s);if((n>0||a>-n)&&(a+=n),e===q.Hours)0===a&&-12===n&&(a=12);else if(e===q.FractionalSeconds)return c=t,ee(a,3).substr(0,c);var c;const l=j(o,E.MinusSign);return ee(a,t,l,i,r)}}function ne(e,t,n=C.Format,r=!1){return function(s,o){return function(e,t,n,r,s,o){switch(n){case G.Months:return R(t,s,r)[e.getMonth()];case G.Days:return I(t,s,r)[e.getDay()];case G.DayPeriods:const a=e.getHours(),c=e.getMinutes();if(o){const e=function(e){const t=Object(i.mb)(e);return z(t),(t[i.cb.ExtraData][2]||[]).map(e=>"string"==typeof e?H(e):[H(e[0]),H(e[1])])}(t),n=function(e,t,n){const r=Object(i.mb)(e);z(r);const s=$([r[i.cb.ExtraData][0],r[i.cb.ExtraData][1]],t)||[];return $(s,n)||[]}(t,s,r),o=e.findIndex(e=>{if(Array.isArray(e)){const[t,n]=e,i=a>=t.hours&&c>=t.minutes,r=a<n.hours||a===n.hours&&c<n.minutes;if(t.hours<n.hours){if(i&&r)return!0}else if(i||r)return!0}else if(e.hours===a&&e.minutes===c)return!0;return!1});if(-1!==o)return n[o]}return A(t,s,r)[a<12?0:1];case G.Eras:return function(e,t){return $(Object(i.mb)(e)[i.cb.Eras],t)}(t,r)[e.getFullYear()<=0?0:1];default:throw new Error(`unexpected translation type ${n}`)}}(s,o,e,t,n,r)}}function ie(e){return function(t,n,i){const r=-1*i,s=j(n,E.MinusSign),o=r>0?Math.floor(r/60):Math.ceil(r/60);switch(e){case U.Short:return(r>=0?"+":"")+ee(o,2,s)+ee(Math.abs(r%60),2,s);case U.ShortGMT:return"GMT"+(r>=0?"+":"")+ee(o,1,s);case U.Long:return"GMT"+(r>=0?"+":"")+ee(o,2,s)+":"+ee(Math.abs(r%60),2,s);case U.Extended:return 0===i?"Z":(r>=0?"+":"")+ee(o,2,s)+":"+ee(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${e}"`)}}}function re(e){return K(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function se(e,t=!1){return function(n,i){let r;if(t){const e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();r=1+Math.floor((t+e)/7)}else{const e=re(n),t=function(e){const t=K(e,0,1).getDay();return K(e,0,1+(t<=4?4:11)-t)}(e.getFullYear()),i=e.getTime()-t.getTime();r=1+Math.round(i/6048e5)}return ee(r,e,j(i,E.MinusSign))}}function oe(e,t=!1){return function(n,i){return ee(re(n).getFullYear(),e,j(i,E.MinusSign),t)}}const ae={};function ce(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function le(e){return e instanceof Date&&!isNaN(e.valueOf())}const ue=/^(\d+)?\.((\d+)(-(\d+))?)?$/,de=".",he="0";function fe(e,t,n,i,r,s,o=!1){let a="",c=!1;if(isFinite(e)){let l=function(e){let t,n,i,r,s,o=Math.abs(e)+"",a=0;for((n=o.indexOf(de))>-1&&(o=o.replace(de,"")),(i=o.search(/e/i))>0?(n<0&&(n=i),n+=+o.slice(i+1),o=o.substring(0,i)):n<0&&(n=o.length),i=0;o.charAt(i)===he;i++);if(i===(s=o.length))t=[0],n=1;else{for(s--;o.charAt(s)===he;)s--;for(n-=i,t=[],r=0;i<=s;i++,r++)t[r]=Number(o.charAt(i))}return n>22&&(t=t.splice(0,21),a=n-1,n=1),{digits:t,exponent:a,integerLen:n}}(e);o&&(l=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(l));let u=t.minInt,d=t.minFrac,h=t.maxFrac;if(s){const e=s.match(ue);if(null===e)throw new Error(`${s} is not a valid digit info`);const t=e[1],n=e[3],i=e[5];null!=t&&(u=me(t)),null!=n&&(d=me(n)),null!=i?h=me(i):null!=n&&d>h&&(h=d)}!function(e,t,n){if(t>n)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${n}).`);let i=e.digits,r=i.length-e.integerLen;const s=Math.min(Math.max(t,r),n);let o=s+e.integerLen,a=i[o];if(o>0){i.splice(Math.max(e.integerLen,o));for(let e=o;e<i.length;e++)i[e]=0}else{r=Math.max(0,r),e.integerLen=1,i.length=Math.max(1,o=s+1),i[0]=0;for(let e=1;e<o;e++)i[e]=0}if(a>=5)if(o-1<0){for(let t=0;t>o;t--)i.unshift(0),e.integerLen++;i.unshift(1),e.integerLen++}else i[o-1]++;for(;r<Math.max(0,s);r++)i.push(0);let c=0!==s;const l=t+e.integerLen,u=i.reduceRight(function(e,t,n,i){return i[n]=(t+=e)<10?t:t-10,c&&(0===i[n]&&n>=l?i.pop():c=!1),t>=10?1:0},0);u&&(i.unshift(u),e.integerLen++)}(l,d,h);let f=l.digits,p=l.integerLen;const m=l.exponent;let b=[];for(c=f.every(e=>!e);p<u;p++)f.unshift(0);for(;p<0;p++)f.unshift(0);p>0?b=f.splice(p,f.length):(b=f,f=[0]);const g=[];for(f.length>=t.lgSize&&g.unshift(f.splice(-t.lgSize,f.length).join(""));f.length>t.gSize;)g.unshift(f.splice(-t.gSize,f.length).join(""));f.length&&g.unshift(f.join("")),a=g.join(j(n,i)),b.length&&(a+=j(n,r)+b.join("")),m&&(a+=j(n,E.Exponential)+"+"+m)}else a=j(n,E.Infinity);return a=e<0&&!c?t.negPre+a+t.negSuf:t.posPre+a+t.posSuf,a}function pe(e,t="-"){const n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},i=e.split(";"),r=i[0],s=i[1],o=-1!==r.indexOf(de)?r.split(de):[r.substring(0,r.lastIndexOf(he)+1),r.substring(r.lastIndexOf(he)+1)],a=o[0],c=o[1]||"";n.posPre=a.substr(0,a.indexOf("#"));for(let u=0;u<c.length;u++){const e=c.charAt(u);e===he?n.minFrac=n.maxFrac=u+1:"#"===e?n.maxFrac=u+1:n.posSuf+=e}const l=a.split(",");if(n.gSize=l[1]?l[1].length:0,n.lgSize=l[2]||l[1]?(l[2]||l[1]).length:0,s){const e=r.length-n.posPre.length-n.posSuf.length,t=s.indexOf("#");n.negPre=s.substr(0,t).replace(/'/g,""),n.negSuf=s.substr(t+e).replace(/'/g,"")}else n.negPre=t+n.posPre,n.negSuf=n.posSuf;return n}function me(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}class be{}let ge=(()=>{class e extends be{constructor(e){super(),this.locale=e}getPluralCategory(e,t){switch(N(t||this.locale)(e)){case M.Zero:return"zero";case M.One:return"one";case M.Two:return"two";case M.Few:return"few";case M.Many:return"many";default:return"other"}}}return e.\u0275fac=function(t){return new(t||e)(i.ic(i.y))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})();function _e(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const e=n.indexOf("="),[i,r]=-1==e?[n,""]:[n.slice(0,e),n.slice(e+1)];if(i.trim()===t)return decodeURIComponent(r)}return null}let ve=(()=>{class e{constructor(e,t,n,i){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=i,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Object(i.sb)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachChangedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachRemovedItem(e=>{e.previousValue&&this._toggleClass(e.key,!1)})}_applyIterableChanges(e){e.forEachAddedItem(e=>{if("string"!=typeof e.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Object(i.yb)(e.item)}`);this._toggleClass(e.item,!0)}),e.forEachRemovedItem(e=>this._toggleClass(e.item,!1))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!0)):Object.keys(e).forEach(t=>this._toggleClass(t,!!e[t])))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!1)):Object.keys(e).forEach(e=>this._toggleClass(e,!1)))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach(e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)})}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.w),i.Rb(i.x),i.Rb(i.n),i.Rb(i.H))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),e})();class ye{constructor(e,t,n,i){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=i}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let we=(()=>{class e{constructor(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${n}' of type '${e=n,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,n,i)=>{if(null==e.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new ye(null,this._ngForOf,-1,-1),null===i?void 0:i),r=new De(e,n);t.push(r)}else if(null==i)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,i);const s=new De(e,r);t.push(s)}});for(let n=0;n<t.length;n++)this._perViewChange(t[n].view,t[n].record);for(let n=0,i=this._viewContainer.length;n<i;n++){const e=this._viewContainer.get(n);e.context.index=n,e.context.count=i,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.S),i.Rb(i.O),i.Rb(i.w))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),e})();class De{constructor(e,t){this.record=e,this.view=t}}let Se=(()=>{class e{constructor(e,t){this._viewContainer=e,this._context=new xe,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){ke("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){ke("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.S),i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),e})();class xe{constructor(){this.$implicit=null,this.ngIf=null}}function ke(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Object(i.yb)(t)}'.`)}class Te{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Me=(()=>{class e{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;t<this._defaultViews.length;t++)this._defaultViews[t].enforceState(e)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}}),e})(),Ce=(()=>{class e{constructor(e,t,n){this.ngSwitch=n,n._addCase(),this._view=new Te(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.S),i.Rb(i.O),i.Rb(Me,9))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),e})(),Oe=(()=>{class e{constructor(e,t,n){n._addDefault(new Te(e,t))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.S),i.Rb(i.O),i.Rb(Me,9))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngSwitchDefault",""]]}),e})(),Le=(()=>{class e{constructor(e,t,n){this._ngEl=e,this._differs=t,this._renderer=n,this._ngStyle=null,this._differ=null}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){const[n,i]=e.split(".");null!=(t=null!=t&&i?`${t}${i}`:t)?this._renderer.setStyle(this._ngEl.nativeElement,n,t):this._renderer.removeStyle(this._ngEl.nativeElement,n)}_applyChanges(e){e.forEachRemovedItem(e=>this._setStyle(e.key,null)),e.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),e.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.x),i.Rb(i.H))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),e})(),Ee=(()=>{class e{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){if(this._shouldRecreateView(e)){const e=this._viewContainerRef;this._viewRef&&e.remove(e.indexOf(this._viewRef)),this._viewRef=this.ngTemplateOutlet?e.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext):null}else this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),n=Object.keys(e.currentValue||{});if(t.length===n.length){for(let e of n)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.S))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet"},features:[i.Bb]}),e})();function Ae(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${Object(i.yb)(e)}'`)}class Ie{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class Re{createSubscription(e,t){return e.then(t,e=>{throw e})}dispose(e){}onDestroy(e){}}const Pe=new Re,Fe=new Ie;let We=(()=>{class e{constructor(e){this._ref=e,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue:(e&&this._subscribe(e),this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(t){if(Object(i.ub)(t))return Pe;if(Object(i.vb)(t))return Fe;throw Ae(e,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(i.kc())},e.\u0275pipe=i.Qb({name:"async",type:e,pure:!1}),e})(),je=(()=>{class e{transform(t){if(null==t)return null;if("string"!=typeof t)throw Ae(e,t);return t.toLowerCase()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"lowercase",type:e,pure:!0}),e})();const Ye=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g;let Ne=(()=>{class e{transform(t){if(null==t)return null;if("string"!=typeof t)throw Ae(e,t);return t.replace(Ye,e=>e[0].toUpperCase()+e.substr(1).toLowerCase())}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"titlecase",type:e,pure:!0}),e})(),ze=(()=>{class e{transform(t){if(null==t)return null;if("string"!=typeof t)throw Ae(e,t);return t.toUpperCase()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"uppercase",type:e,pure:!0}),e})(),$e=(()=>{class e{constructor(e){this.locale=e}transform(t,n="mediumDate",i,r){if(null==t||""===t||t!=t)return null;try{return J(t,n,r||this.locale,i)}catch(s){throw Ae(e,s.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.y))},e.\u0275pipe=i.Qb({name:"date",type:e,pure:!0}),e})();const He=/#/g;let Xe=(()=>{class e{constructor(e){this._localization=e}transform(t,n,i){if(null==t)return"";if("object"!=typeof n||null===n)throw Ae(e,n);return n[function(e,t,n,i){let r=`=${e}`;if(t.indexOf(r)>-1)return r;if(r=n.getPluralCategory(e,i),t.indexOf(r)>-1)return r;if(t.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${e}"`)}(t,Object.keys(n),this._localization,i)].replace(He,t.toString())}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(be))},e.\u0275pipe=i.Qb({name:"i18nPlural",type:e,pure:!0}),e})(),Ve=(()=>{class e{transform(e){return JSON.stringify(e,null,2)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"json",type:e,pure:!1}),e})(),Be=(()=>{class e{constructor(e){this.differs=e,this.keyValues=[]}transform(e,t=Ue){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ||(this.differ=this.differs.find(e).create());const n=this.differ.diff(e);return n&&(this.keyValues=[],n.forEachItem(e=>{this.keyValues.push({key:e.key,value:e.currentValue})}),this.keyValues.sort(t)),this.keyValues}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.x))},e.\u0275pipe=i.Qb({name:"keyvalue",type:e,pure:!1}),e})();function Ue(e,t){const n=e.key,i=t.key;if(n===i)return 0;if(void 0===n)return 1;if(void 0===i)return-1;if(null===n)return 1;if(null===i)return-1;if("string"==typeof n&&"string"==typeof i)return n<i?-1:1;if("number"==typeof n&&"number"==typeof i)return n-i;if("boolean"==typeof n&&"boolean"==typeof i)return n<i?-1:1;const r=String(n),s=String(i);return r==s?0:r<s?-1:1}let qe=(()=>{class e{constructor(e){this._locale=e}transform(t,n,i){if(!Je(t))return null;i=i||this._locale;try{return function(e,t,n){return fe(e,pe(Y(t,T.Decimal),j(t,E.MinusSign)),t,E.Group,E.Decimal,n)}(Ke(t),i,n)}catch(r){throw Ae(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.y))},e.\u0275pipe=i.Qb({name:"number",type:e,pure:!0}),e})(),Ge=(()=>{class e{constructor(e){this._locale=e}transform(t,n,i){if(!Je(t))return null;i=i||this._locale;try{return function(e,t,n){return fe(e,pe(Y(t,T.Percent),j(t,E.MinusSign)),t,E.Group,E.Decimal,n,!0).replace(new RegExp("%","g"),j(t,E.PercentSign))}(Ke(t),i,n)}catch(r){throw Ae(e,r.message)}}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.y))},e.\u0275pipe=i.Qb({name:"percent",type:e,pure:!0}),e})();function Je(e){return!(null==e||""===e||e!=e)}function Ke(e){if("string"==typeof e&&!isNaN(Number(e)-parseFloat(e)))return Number(e);if("number"!=typeof e)throw new Error(`${e} is not a number`);return e}let Qe=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({providers:[{provide:be,useClass:ge}]}),e})();const Ze="browser";function et(e){return e===Ze}let tt=(()=>{class e{}return e.\u0275prov=Object(i.Nb)({token:e,providedIn:"root",factory:()=>new nt(Object(i.ic)(c),window)}),e})();class nt{constructor(e,t){this.document=e,this.window=t,this.offset=()=>[0,0]}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportsScrolling()?[this.window.pageXOffset,this.window.pageYOffset]:[0,0]}scrollToPosition(e){this.supportsScrolling()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(!this.supportsScrolling())return;const t=function(e,t){const n=e.getElementById(t)||e.getElementsByName(t)[0];if(n)return n;if("function"==typeof e.createTreeWalker&&e.body&&(e.body.createShadowRoot||e.body.attachShadow)){const n=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let i=n.currentNode;for(;i;){const e=i.shadowRoot;if(e){const n=e.getElementById(t)||e.querySelector(`[name="${t}"]`);if(n)return n}i=n.nextNode()}}return null}(this.document,e);t&&(this.scrollToElement(t),this.attemptFocus(t))}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),n=t.left+this.window.pageXOffset,i=t.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],i-r[1])}attemptFocus(e){return e.focus(),this.document.activeElement===e}supportScrollRestoration(){try{if(!this.supportsScrolling())return!1;const e=it(this.window.history)||it(Object.getPrototypeOf(this.window.history));return!(!e||!e.writable&&!e.set)}catch(e){return!1}}supportsScrolling(){try{return!!this.window&&!!this.window.scrollTo&&"pageXOffset"in this.window}catch(e){return!1}}}function it(e){return Object.getOwnPropertyDescriptor(e,"scrollRestoration")}},SatO:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1200?"\u4e0a\u5348":1200===i?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},SeVD:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("ngJS"),r=n("NJ4a"),s=n("Lhse"),o=n("kJWO"),a=n("I55L"),c=n("c2HN"),l=n("XoHu");const u=e=>{if(e&&"function"==typeof e[o.a])return u=e,e=>{const t=u[o.a]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(Object(a.a)(e))return Object(i.a)(e);if(Object(c.a)(e))return n=e,e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,r.a),e);if(e&&"function"==typeof e[s.a])return t=e,e=>{const n=t[s.a]();for(;;){let t;try{t=n.next()}catch(i){return e.error(i),e}if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e};{const t=Object(l.a)(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var t,n,u}},SpAZ:function(e,t,n){"use strict";function i(e){return e}n.d(t,"a",function(){return i})},SxV6:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("sVev"),r=n("pLZG"),s=n("IzEk"),o=n("xbPD"),a=n("XDbj"),c=n("SpAZ");function l(e,t){const n=arguments.length>=2;return l=>l.pipe(e?Object(r.a)((t,n)=>e(t,n,l)):c.a,Object(s.a)(1),n?Object(o.a)(t):Object(a.a)(()=>new i.a))}},TFwu:function(e,t,n){"use strict";var i=n("25cm"),r=n("jN84"),s=n("mkut");t.a=function(e){return Object(i.a)(e,s.a,r.a)}},TJUb:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t){return r.a.isPlainObject(t)?r.a.get(t,e,e):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"map",type:e,pure:!0}),e})()},TKcr:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{propertyValue(e){return getComputedStyle(document.body).getPropertyValue(`--${e}`)}}},TWQb:function(e,t,n){var i=n("/GqU"),r=n("I8vh"),s=n("B/qT"),o=function(e){return function(t,n,o){var a,c=i(t),l=s(c),u=r(o,l);if(e&&n!=n){for(;l>u;)if((a=c[u++])!=a)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},TYzs:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){const t=parseInt(e,10);return isNaN(t)?e:e+(1===Math.floor(t/10)?"th":t%10==1?"st":t%10==2?"nd":t%10==3?"rd":"th")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"ordinal",type:e,pure:!0}),e})()},TeQF:function(e,t,n){"use strict";var i=n("I+eb"),r=n("tycR").filter;i({target:"Array",proto:!0,forced:!n("Hd5f")("filter")},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},TnHx:function(e,t,n){"use strict";var i=n("25cm"),r=n("n561"),s=n("4/q3");t.a=function(e){return Object(i.a)(e,s.a,r.a)}},TuBq:function(e,t,n){var i=n("icBU"),r=n("kbA8");e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),g(function(e){return e.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(a).split("\\,").join(c).split("\\.").join(l)}(e),!0).map(d)):[]};var s="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function u(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(s).join("\\").split(o).join("{").split(a).join("}").split(c).join(",").split(l).join(".")}function h(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.body,s=n.post,o=n.pre.split(",");o[o.length-1]+="{"+i+"}";var a=h(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function f(e){return"{"+e+"}"}function p(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function b(e,t){return e>=t}function g(e,t){var n=[],s=r("{","}",e);if(!s||/\$$/.test(s.pre))return[e];var o,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=c||l,_=s.body.indexOf(",")>=0;if(!d&&!_)return s.post.match(/,.*\}/)?g(e=s.pre+"{"+s.body+a+s.post):[e];if(d)o=s.body.split(/\.\./);else if(1===(o=h(s.body)).length&&1===(o=g(o[0],!1).map(f)).length)return(w=s.post.length?g(s.post,!1):[""]).map(function(e){return s.pre+o[0]+e});var v,y=s.pre,w=s.post.length?g(s.post,!1):[""];if(d){var D=u(o[0]),S=u(o[1]),x=Math.max(o[0].length,o[1].length),k=3==o.length?Math.abs(u(o[2])):1,T=m;S<D&&(k*=-1,T=b);var M=o.some(p);v=[];for(var C=D;T(C,S);C+=k){var O;if(l)"\\"===(O=String.fromCharCode(C))&&(O="");else if(O=String(C),M){var L=x-O.length;if(L>0){var E=new Array(L+1).join("0");O=C<0?"-"+E+O.slice(1):E+O}}v.push(O)}}else v=i(o,function(e){return g(e,!1)});for(var A=0;A<v.length;A++)for(var I=0;I<w.length;I++){var R=y+v[A]+w[I];(!t||d||R)&&n.push(R)}return n}},U6JX:function(e,t,n){"use strict";t.a=function(e,t){return function(n){return e(t(n))}}},UDhR:function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("wd/R"))},UMSQ:function(e,t,n){var i=n("WSbT"),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},USCx:function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Ean\xe1ir","Feabhra","M\xe1rta","Aibre\xe1n","Bealtaine","Meitheamh","I\xfail","L\xfanasa","Me\xe1n F\xf3mhair","Deireadh F\xf3mhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","M\xe1rt","Aib","Beal","Meith","I\xfail","L\xfan","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["D\xe9 Domhnaigh","D\xe9 Luain","D\xe9 M\xe1irt","D\xe9 C\xe9adaoin","D\xe9ardaoin","D\xe9 hAoine","D\xe9 Sathairn"],weekdaysShort:["Domh","Luan","M\xe1irt","C\xe9ad","D\xe9ar","Aoine","Sath"],weekdaysMin:["Do","Lu","M\xe1","C\xe9","D\xe9","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Am\xe1rach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inn\xe9 ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s \xf3 shin",s:"c\xfapla soicind",ss:"%d soicind",m:"n\xf3im\xe9ad",mm:"%d n\xf3im\xe9ad",h:"uair an chloig",hh:"%d uair an chloig",d:"l\xe1",dd:"%d l\xe1",M:"m\xed",MM:"%d m\xedonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},UpQW:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u06cc","\u0641\u0631\u0648\u0631\u06cc","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u06cc\u0644","\u0645\u0626\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0626\u06cc","\u0627\u06af\u0633\u062a","\u0633\u062a\u0645\u0628\u0631","\u0627\u06a9\u062a\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062f\u0633\u0645\u0628\u0631"],n=["\u0627\u062a\u0648\u0627\u0631","\u067e\u06cc\u0631","\u0645\u0646\u06af\u0644","\u0628\u062f\u06be","\u062c\u0645\u0639\u0631\u0627\u062a","\u062c\u0645\u0639\u06c1","\u06c1\u0641\u062a\u06c1"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0622\u062c \u0628\u0648\u0642\u062a] LT",nextDay:"[\u06a9\u0644 \u0628\u0648\u0642\u062a] LT",nextWeek:"dddd [\u0628\u0648\u0642\u062a] LT",lastDay:"[\u06af\u0630\u0634\u062a\u06c1 \u0631\u0648\u0632 \u0628\u0648\u0642\u062a] LT",lastWeek:"[\u06af\u0630\u0634\u062a\u06c1] dddd [\u0628\u0648\u0642\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0628\u0639\u062f",past:"%s \u0642\u0628\u0644",s:"\u0686\u0646\u062f \u0633\u06cc\u06a9\u0646\u0688",ss:"%d \u0633\u06cc\u06a9\u0646\u0688",m:"\u0627\u06cc\u06a9 \u0645\u0646\u0679",mm:"%d \u0645\u0646\u0679",h:"\u0627\u06cc\u06a9 \u06af\u06be\u0646\u0679\u06c1",hh:"%d \u06af\u06be\u0646\u0679\u06d2",d:"\u0627\u06cc\u06a9 \u062f\u0646",dd:"%d \u062f\u0646",M:"\u0627\u06cc\u06a9 \u0645\u0627\u06c1",MM:"%d \u0645\u0627\u06c1",y:"\u0627\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},Ur1D:function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("wd/R"))},UudT:function(e,t,n){"use strict";var i=n("U6JX"),r=Object(i.a)(Object.getPrototypeOf,Object);t.a=r},UxlC:function(e,t,n){"use strict";var i=n("K6Rb"),r=n("xluM"),s=n("4zBA"),o=n("14Sl"),a=n("0Dky"),c=n("glrk"),l=n("Fib7"),u=n("WSbT"),d=n("UMSQ"),h=n("V37c"),f=n("HYAF"),p=n("iqWW"),m=n("3Eq5"),b=n("DLK6"),g=n("FMNM"),_=n("tiKp")("replace"),v=Math.max,y=Math.min,w=s([].concat),D=s([].push),S=s("".indexOf),x=s("".slice),k="$0"==="a".replace(/./,"$0"),T=!!/./[_]&&""===/./[_]("a","$0");o("replace",function(e,t,n){var s=T?"$":"$0";return[function(e,n){var i=f(this),s=null==e?void 0:m(e,_);return s?r(s,e,i,n):r(t,h(i),e,n)},function(e,r){var o=c(this),a=h(e);if("string"==typeof r&&-1===S(r,s)&&-1===S(r,"$<")){var f=n(t,o,a,r);if(f.done)return f.value}var m=l(r);m||(r=h(r));var _=o.global;if(_){var k=o.unicode;o.lastIndex=0}for(var T=[];;){var M=g(o,a);if(null===M)break;if(D(T,M),!_)break;""===h(M[0])&&(o.lastIndex=p(a,d(o.lastIndex),k))}for(var C,O="",L=0,E=0;E<T.length;E++){for(var A=h((M=T[E])[0]),I=v(y(u(M.index),a.length),0),R=[],P=1;P<M.length;P++)D(R,void 0===(C=M[P])?C:String(C));var F=M.groups;if(m){var W=w([A],R,I,a);void 0!==F&&D(W,F);var j=h(i(r,void 0,W))}else j=b(A,a,I,R,F,r);I>=L&&(O+=x(a,L,I)+j,L=I+A.length)}return O+x(a,L)}]},!!a(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!k||T)},"V/fk":function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("SVse"),r=n("s7LF"),s=n("iInd"),o=n("G0yt"),a=n("Hicy"),c=n("hrfs"),l=n("WF9J"),u=n("yGOH"),d=n("9Xeq"),h=n("8Y7J");let f=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=h.Pb({type:e}),e.\u0275inj=h.Ob({providers:[],imports:[[i.c,r.m,r.x,o.c,o.y,o.A,o.F,c.b,r.x,d.a,u.a,o.l,a.b,l.b,s.i,o.h,o.C]]}),e})()},V2x9:function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Ju\xf1u_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},V37c:function(e,t,n){var i=n("2oRo"),r=n("9d/t"),s=i.String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return s(e)}},VRyK:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("HDdC"),r=n("z+Ro"),s=n("bHdf"),o=n("yCtX");function a(...e){let t=Number.POSITIVE_INFINITY,n=null,a=e[e.length-1];return Object(r.a)(a)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof a&&(t=e.pop()),null===n&&1===e.length&&e[0]instanceof i.a?e[0]:Object(s.a)(t)(Object(o.a)(e,n))}},VTlA:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("mSOc"),r=n("ufoC"),s=n("8Y7J");let o=(()=>{class e{constructor(e,t){this.taskMessageService=e,this.summaryService=t}init(e,t,n,i,r,s,o){this.getUpdate=e,this.preProcessing=t,this.setList=n,this.onFetchError=i,this.taskFilter=r,this.itemFilter=s,this.builders=o||{},this.summaryDataSubscription=this.summaryService.subscribe(e=>{this.summary=e,this.fetch()},this.onFetchError)}fetch(){this.getUpdate().subscribe(e=>{this.updateData(e,this.summary.executing_tasks.filter(this.taskFilter))},this.onFetchError)}updateData(e,t){const n=this.preProcessing?this.preProcessing(e):e;this.addMissing(n,t),n.forEach(e=>{const n=t.filter(t=>this.itemFilter(e,t));e.cdExecuting=this.getTaskAction(n)}),this.setList(n)}addMissing(e,t){const n=this.builders.default;t.forEach(t=>{const i=e.find(e=>this.itemFilter(e,t)),r=this.builders[t.name];i||!r&&!n||e.push(r?r(t.metadata):n(t.metadata))})}getTaskAction(e){if(0!==e.length)return e.map(e=>{const t=e.progress?` ${e.progress}%`:"";return this.taskMessageService.getRunningText(e)+"..."+t}).join(", ")}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(s.ic(r.a),s.ic(i.a))},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac}),e})()},VXsX:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");class o{constructor(e,t,n){this.name=e,this.metadata=t,this.onTaskFinished=n}}let a=(()=>{class e{constructor(){this.subscriptions=[]}init(e){return e.subscribe(e=>{const t=e.executing_tasks,n=e.finished_tasks,i=[];for(const r of this.subscriptions){const e=this._getTask(r,n),s=this._getTask(r,t);null!==e&&null===s&&r.onTaskFinished(e),null!==s&&i.push(r),this.subscriptions=i}})}subscribe(e,t,n){this.subscriptions.push(new o(e,t,n))}_getTask(e,t){for(const n of t)if(n.name===e.name&&r.a.isEqual(n.metadata,e.metadata))return n;return null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Vclq:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:6}})}(n("wd/R"))},Vhfg:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("lJxs"),r=n("WE5d"),s=n("ej+x"),o=n("8Y7J");let a=(()=>{class e{constructor(e){this.featureToggles=e}canActivate(e){return this.featureToggles.get().pipe(Object(i.a)(t=>{if(!1===t[e.routeConfig.path])throw new r.b;return!0}))}canActivateChild(e){return this.canActivate(e.parent)}}return e.\u0275fac=function(t){return new(t||e)(o.ic(s.a))},e.\u0275prov=o.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},VpIT:function(e,t,n){var i=n("xDBR"),r=n("xs3f");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.0",mode:i?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},Vu81:function(e,t,n){var i=n("0GbY"),r=n("4zBA"),s=n("JBy8"),o=n("dBg+"),a=n("glrk"),c=r([].concat);e.exports=i("Reflect","ownKeys")||function(e){var t=s.f(a(e)),n=o.f;return n?c(t,n(e)):t}},VxPD:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("yJti"),r=n("e2NH");class s extends r.a{constructor(e=i.a.ValueOk,t=""){switch(super(),e){case i.a.ValueOk:this.type="light",this.msg="";break;case i.a.ValueNone:this.type="info",this.msg=(t?"Retrieving data for " + t + ".":"Retrieving data.")+" "+"Please wait...";break;case i.a.ValueStale:this.type="warning",this.msg=t?"Displaying previously cached data for " + t + ".":"Displaying previously cached data.";break;case i.a.ValueException:this.type="danger",this.msg=(t?"Could not load data for " + t + ".":"Could not load data.")+" "+"Please check the cluster health."}}}},WE5d:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return o});var i=n("oxzT");class r extends Error{}class s extends r{constructor(){super(...arguments),this.header="Page Not Found",this.message="Sorry, we couldn\u2019t find what you were looking for.\n  The page you requested may have been changed or moved.",this.icon=i.a.warning}}class o extends r{constructor(){super(...arguments),this.header="User Denied",this.message="Sorry, the user does not exist in Ceph.\n  You'll be logged out from the Identity Provider when you retry logging in.",this.icon=i.a.warning}}},WF9J:function(e,t,n){"use strict";n.d(t,"a",function(){return re}),n.d(t,"b",function(){return se}),n("TeQF"),n("QWBl"),n("4mDm"),n("zKZe"),n("07d7"),n("4l63"),n("PKPk"),n("ENF9"),n("3bBZ");var i,r=n("hKI/"),s=n.n(r),o=n("9/5/"),a=n.n(o),c=n("uyHG"),l=n.n(c),u=[],d="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(i||(i={}));var h,f=function(e){return Object.freeze(e)},p=function(e,t){this.inlineSize=e,this.blockSize=t,f(this)},m=function(){function e(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,f(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),b=function(e){return e instanceof SVGElement&&"getBBox"in e},g=function(e){if(b(e)){var t=e.getBBox();return!t.width&&!t.height}return!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_=function(e){var t,n;if(e instanceof Element)return!0;var i=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(i&&e instanceof i.Element)},v="undefined"!=typeof window?window:{},y=new WeakMap,w=/auto|scroll/,D=/^tb|vertical/,S=/msie|trident/i.test(v.navigator&&v.navigator.userAgent),x=function(e){return parseFloat(e||"0")},k=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new p((n?t:e)||0,(n?e:t)||0)},T=f({devicePixelContentBoxSize:k(),borderBoxSize:k(),contentBoxSize:k(),contentRect:new m(0,0,0,0)}),M=function(e,t){if(void 0===t&&(t=!1),y.has(e)&&!t)return y.get(e);if(g(e))return y.set(e,T),T;var n=getComputedStyle(e),i=b(e)&&e.ownerSVGElement&&e.getBBox(),r=!S&&"border-box"===n.boxSizing,s=D.test(n.writingMode||""),o=!i&&w.test(n.overflowY||""),a=!i&&w.test(n.overflowX||""),c=i?0:x(n.paddingTop),l=i?0:x(n.paddingRight),u=i?0:x(n.paddingBottom),d=i?0:x(n.paddingLeft),h=i?0:x(n.borderTopWidth),p=i?0:x(n.borderRightWidth),_=i?0:x(n.borderBottomWidth),v=d+l,M=c+u,C=(i?0:x(n.borderLeftWidth))+p,O=h+_,L=a?e.offsetHeight-O-e.clientHeight:0,E=o?e.offsetWidth-C-e.clientWidth:0,A=r?v+C:0,I=r?M+O:0,R=i?i.width:x(n.width)-A-E,P=i?i.height:x(n.height)-I-L,F=R+v+E+C,W=P+M+L+O,j=f({devicePixelContentBoxSize:k(Math.round(R*devicePixelRatio),Math.round(P*devicePixelRatio),s),borderBoxSize:k(F,W,s),contentBoxSize:k(R,P,s),contentRect:new m(d,c,R,P)});return y.set(e,j),j},C=function(e,t,n){var r=M(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case i.DEVICE_PIXEL_CONTENT_BOX:return a;case i.BORDER_BOX:return s;default:return o}},O=function(e){var t=M(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=f([t.borderBoxSize]),this.contentBoxSize=f([t.contentBoxSize]),this.devicePixelContentBoxSize=f([t.devicePixelContentBoxSize])},L=function(e){if(g(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},E=function(){var e=1/0,t=[];u.forEach(function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach(function(t){var n=new O(t.target),r=L(t.target);i.push(n),t.lastReportedSize=C(t.target,t.observedBox),r<e&&(e=r)}),t.push(function(){n.callback.call(n.observer,i,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,i=t;n<i.length;n++)(0,i[n])();return e},A=function(e){u.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(L(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},I=[],R=0,P={attributes:!0,characterData:!0,childList:!0,subtree:!0},F=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],W=function(e){return void 0===e&&(e=0),Date.now()+e},j=!1,Y=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!j){j=!0;var n,i=W(e);n=function(){var n=!1;try{n=function(){var e,t=0;for(A(t);u.some(function(e){return e.activeTargets.length>0});)t=E(),A(t);return u.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:d}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=d),window.dispatchEvent(e)),t>0}()}finally{if(j=!1,e=i-W(),!R)return;n?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!h){var t=0,i=document.createTextNode("");new MutationObserver(function(){return I.splice(0).forEach(function(e){return e()})}).observe(i,{characterData:!0}),h=function(){i.textContent=""+(t?t--:t++)}}I.push(function(){requestAnimationFrame(n)}),h()}()}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,P)};document.body?t():v.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),F.forEach(function(t){return v.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),F.forEach(function(t){return v.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),N=function(e){!R&&e>0&&Y.start(),!(R+=e)&&Y.stop()},z=function(){function e(e,t){this.target=e,this.observedBox=t||i.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=C(this.target,this.observedBox,!0);return b(e=this.target)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),$=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},H=new WeakMap,X=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},V=function(){function e(){}return e.connect=function(e,t){var n=new $(e,t);H.set(e,n)},e.observe=function(e,t,n){var i=H.get(e),r=0===i.observationTargets.length;X(i.observationTargets,t)<0&&(r&&u.push(i),i.observationTargets.push(new z(t,n&&n.box)),N(1),Y.schedule())},e.unobserve=function(e,t){var n=H.get(e),i=X(n.observationTargets,t);i>=0&&(1===n.observationTargets.length&&u.splice(u.indexOf(n),1),n.observationTargets.splice(i,1),N(-1))},e.disconnect=function(e){var t=this,n=H.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),B=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");V.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!_(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");V.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!_(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");V.unobserve(this,e)},e.prototype.disconnect=function(){V.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),U=n("AxL3"),q=n.n(U);function G(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function J(e){return e&&e.ownerDocument?e.ownerDocument:document}n("E9XD"),n("sMBO"),n("rB9j"),n("Rm1S"),n("UxlC");var K=null,Q=null;function Z(e){if(null===K){var t=J(e);if(void 0===t)return K=0;var n=t.body,i=t.createElement("div");i.classList.add("simplebar-hide-scrollbar"),n.appendChild(i);var r=i.getBoundingClientRect().right;n.removeChild(i),K=r}return K}q.a&&window.addEventListener("resize",function(){Q!==window.devicePixelRatio&&(Q=window.devicePixelRatio,K=null)});var ee=function(){function e(t,n){var i=this;this.onScroll=function(){var e=G(i.el);i.scrollXTicking||(e.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(e.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(e){i.mouseX=e.clientX,i.mouseY=e.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(e){var t,n;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(t=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(n=i.isWithinBounds(i.axis.y.track.rect)),(t||n)&&(e.preventDefault(),e.stopPropagation(),"mousedown"===e.type&&(t&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(e,"x"):i.onTrackClick(e,"x")),n&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(e,"y"):i.onTrackClick(e,"y"))))},this.drag=function(t){var n=i.axis[i.draggedAxis].track,r=n.rect[i.axis[i.draggedAxis].sizeAttr],s=i.axis[i.draggedAxis].scrollbar,o=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],a=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation();var c=(("y"===i.draggedAxis?t.pageY:t.pageX)-n.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset)/(r-s.size)*(o-a);"x"===i.draggedAxis&&(c=i.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?c-(r+s.size):c,c=i.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-c:c),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=c},this.onEndDrag=function(e){var t=J(i.el),n=G(i.el);e.preventDefault(),e.stopPropagation(),i.el.classList.remove(i.classNames.dragging),t.removeEventListener("mousemove",i.drag,!0),t.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=n.setTimeout(function(){t.removeEventListener("click",i.preventClick,!0),t.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null})},this.preventClick=function(e){e.preventDefault(),e.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,{},n),this.classNames=Object.assign({},e.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,e.instances.has(this.el)||(this.recalculate=s()(this.recalculate.bind(this),64),this.onMouseMove=s()(this.onMouseMove.bind(this),64),this.hideScrollbars=a()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=a()(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=l()(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var t=document.createElement("div");t.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var n=t.firstElementChild;document.body.appendChild(n);var i=n.firstElementChild;n.scrollLeft=0;var r=e.getOffset(n),s=e.getOffset(i);n.scrollLeft=999;var o=e.getOffset(i);return{isRtlScrollingInverted:r.left!==s.left&&s.left-o.left!=0,isRtlScrollbarInverted:r.left!==s.left}},e.getOffset=function(e){var t=e.getBoundingClientRect(),n=J(e),i=G(e);return{top:t.top+(i.pageYOffset||n.documentElement.scrollTop),left:t.left+(i.pageXOffset||n.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),q.a&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var e=this;if(Array.prototype.filter.call(this.el.children,function(t){return t.classList.contains(e.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),n=document.createElement("div");t.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),t.appendChild(n),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.setAccessibilityAttributes=function(){var e=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",e)},t.initListeners=function(){var e=this,t=G(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var n=!1;this.resizeObserver=new(t.ResizeObserver||B)(function(){n&&e.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame(function(){n=!0}),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var e=G(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var t=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,i=this.contentEl.offsetWidth,r=this.contentWrapperEl.offsetWidth,s=this.elStyles.overflowX,o=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var a=this.contentEl.scrollHeight,c=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=n?i+"px":"auto",this.placeholderEl.style.height=a+"px";var l=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=c>i,this.axis.y.isOverflowing=a>l,this.axis.x.isOverflowing="hidden"!==s&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==o&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&c>r-(this.axis.y.isOverflowing?this.scrollbarWidth:0),this.axis.y.isOverflowing=this.axis.y.isOverflowing&&a>l-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(e){if(void 0===e&&(e="y"),!this.axis[e].isOverflowing)return 0;var t,n=this.axis[e].track.el[this.axis[e].offsetSizeAttr];return t=Math.max(~~(n/this.contentEl[this.axis[e].scrollSizeAttr]*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},t.positionScrollbar=function(t){if(void 0===t&&(t="y"),this.axis[t].isOverflowing){var n=this.contentWrapperEl[this.axis[t].scrollSizeAttr],i=this.axis[t].track.el[this.axis[t].offsetSizeAttr],r=parseInt(this.elStyles[this.axis[t].sizeAttr],10),s=this.axis[t].scrollbar,o=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=~~((o="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-o:o)/(n-r)*(i-s.size));a="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?a+(i-s.size):a,s.el.style.transform="x"===t?"translate3d("+a+"px, 0, 0)":"translate3d(0, "+a+"px, 0)"}},t.toggleTrackVisibility=function(e){void 0===e&&(e="y");var t=this.axis[e].track.el,n=this.axis[e].scrollbar.el;this.axis[e].isOverflowing||this.axis[e].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden"),n.style.display=this.axis[e].isOverflowing?"block":"none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.rect=this.axis[e].track.el.getBoundingClientRect(),this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[e].scrollbar.rect)?this.axis[e].scrollbar.el.classList.add(this.classNames.hover):this.axis[e].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[e].track.rect)?(this.showScrollbar(e),this.axis[e].track.el.classList.add(this.classNames.hover)):this.axis[e].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.el.classList.remove(this.classNames.hover),this.axis[e].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(e){void 0===e&&(e="y"),this.axis[e].isVisible||(this.axis[e].scrollbar.el.classList.add(this.classNames.visible),this.axis[e].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(e,t){void 0===t&&(t="y");var n=J(this.el),i=G(this.el);this.axis[t].dragOffset=("y"===t?e.pageY:e.pageX)-this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],this.draggedAxis=t,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(i.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(e,t){var n=this;if(void 0===t&&(t="y"),this.options.clickOnTrack){var i=G(this.el);this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var r=this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],s=parseInt(this.elStyles[this.axis[t].sizeAttr],10),o=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=("y"===t?this.mouseY-r:this.mouseX-r)<0?-1:1,c=-1===a?o-s:o+s;!function e(){var r,s;-1===a?o>c&&(n.contentWrapperEl.scrollTo(((r={})[n.axis[t].offsetAttr]=o-=n.options.clickOnTrackSpeed,r)),i.requestAnimationFrame(e)):o<c&&(n.contentWrapperEl.scrollTo(((s={})[n.axis[t].offsetAttr]=o+=n.options.clickOnTrackSpeed,s)),i.requestAnimationFrame(e))}()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:Z(this.el)}catch(e){return Z(this.el)}},t.removeListeners=function(){var e=this,t=G(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(t){e.el.removeEventListener(t,e.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(t){e.el.removeEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.findChild=function(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,function(e){return n.call(e,t)})[0]},e}();ee.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},ee.instances=new WeakMap;var te=ee,ne=n("8Y7J");const ie=["*"];let re=(()=>{class e{constructor(e){this.elRef=e}ngOnInit(){}ngAfterViewInit(){this.SimpleBar=new te(this.elRef.nativeElement,this.options||{})}ngOnDestroy(){this.SimpleBar.unMount(),this.SimpleBar=null}}return e.\u0275fac=function(t){return new(t||e)(ne.Rb(ne.n))},e.\u0275cmp=ne.Lb({type:e,selectors:[["ngx-simplebar"]],hostAttrs:["data-simplebar","init"],inputs:{options:"options"},ngContentSelectors:ie,decls:13,vars:0,consts:[[1,"simplebar-wrapper"],[1,"simplebar-height-auto-observer-wrapper"],[1,"simplebar-height-auto-observer"],[1,"simplebar-mask"],[1,"simplebar-offset"],[1,"simplebar-content-wrapper"],[1,"simplebar-content"],[1,"simplebar-placeholder"],[1,"simplebar-track","simplebar-horizontal"],[1,"simplebar-scrollbar"],[1,"simplebar-track","simplebar-vertical"]],template:function(e,t){1&e&&(ne.tc(),ne.Xb(0,"div",0),ne.Xb(1,"div",1),ne.Sb(2,"div",2),ne.Wb(),ne.Xb(3,"div",3),ne.Xb(4,"div",4),ne.Xb(5,"div",5),ne.Xb(6,"div",6),ne.sc(7),ne.Wb(),ne.Wb(),ne.Wb(),ne.Wb(),ne.Sb(8,"div",7),ne.Wb(),ne.Xb(9,"div",8),ne.Sb(10,"div",9),ne.Wb(),ne.Xb(11,"div",10),ne.Sb(12,"div",9),ne.Wb())},styles:["[data-simplebar]{position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;flex-wrap:wrap;-webkit-box-pack:start;justify-content:flex-start;align-content:flex-start;-webkit-box-align:start;align-items:flex-start}.simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit}.simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto!important;height:auto!important;z-index:0}.simplebar-offset{direction:inherit!important;box-sizing:inherit!important;resize:none!important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch}.simplebar-content-wrapper{direction:inherit;box-sizing:border-box!important;position:relative;display:block;height:100%;width:auto;max-width:100%;max-height:100%;scrollbar-width:none;-ms-overflow-style:none}.simplebar-content-wrapper::-webkit-scrollbar,.simplebar-hide-scrollbar::-webkit-scrollbar{width:0;height:0}.simplebar-content:after,.simplebar-content:before{content:' ';display:table}.simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none}.simplebar-height-auto-observer-wrapper{box-sizing:inherit!important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;-webkit-box-flex:inherit;flex-grow:inherit;flex-shrink:0;flex-basis:0}.simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1}.simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden}[data-simplebar].simplebar-dragging .simplebar-content{pointer-events:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}[data-simplebar].simplebar-dragging .simplebar-track{pointer-events:all}.simplebar-scrollbar{position:absolute;left:0;right:0;min-height:10px}.simplebar-scrollbar:before{position:absolute;content:'';background:#000;border-radius:7px;left:2px;right:2px;opacity:0;-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.simplebar-scrollbar.simplebar-visible:before{opacity:.5;-webkit-transition:opacity linear;transition:opacity linear}.simplebar-track.simplebar-vertical{top:0;width:11px}.simplebar-track.simplebar-vertical .simplebar-scrollbar:before{top:2px;bottom:2px}.simplebar-track.simplebar-horizontal{left:0;height:11px}.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before{height:100%;left:2px;right:2px}.simplebar-track.simplebar-horizontal .simplebar-scrollbar{right:auto;left:0;top:2px;height:7px;min-height:0;min-width:10px;width:auto}[data-simplebar-direction=rtl] .simplebar-track.simplebar-vertical{right:auto;left:0}.hs-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll}.simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none}","ngx-simplebar{display:block}"],encapsulation:2}),e})(),se=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=ne.Pb({type:e}),e.\u0275inj=ne.Ob({imports:[[]]}),e})()},WJ6P:function(e,t,n){"use strict";t.a=function(){return[]}},WJkJ:function(e,t){e.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},WKiH:function(e,t,n){var i=n("4zBA"),r=n("HYAF"),s=n("V37c"),o=n("WJkJ"),a=i("".replace),c="["+o+"]",l=RegExp("^"+c+c+"*"),u=RegExp(c+c+"*$"),d=function(e){return function(t){var n=s(r(t));return 1&e&&(n=a(n,l,"")),2&e&&(n=a(n,u,"")),n}};e.exports={start:d(1),end:d(2),trim:d(3)}},WMd4:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("EY2u"),r=n("LRne"),s=n("z6cu");let o=(()=>{class e{constructor(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}}accept(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)}toObservable(){switch(this.kind){case"N":return Object(r.a)(this.value);case"E":return Object(s.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}static createError(t){return new e("E",void 0,t)}static createComplete(){return e.completeNotification}}return e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e})()},WOAq:function(e,t,n){"use strict";(function(e){var i=n("Ju5/"),r=n("L3Qv"),s="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=s&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===s?i.a.Buffer:void 0;t.a=(a?a.isBuffer:void 0)||r.a}).call(this,n("3UD+")(e))},WSbT:function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){var t=+e;return t!=t||0===t?0:(t>0?i:n)(t)}},WYrj:function(e,t,n){!function(e){"use strict";var t=["\u0796\u07ac\u0782\u07aa\u0787\u07a6\u0783\u07a9","\u078a\u07ac\u0784\u07b0\u0783\u07aa\u0787\u07a6\u0783\u07a9","\u0789\u07a7\u0783\u07a8\u0797\u07aa","\u0787\u07ad\u0795\u07b0\u0783\u07a9\u078d\u07aa","\u0789\u07ad","\u0796\u07ab\u0782\u07b0","\u0796\u07aa\u078d\u07a6\u0787\u07a8","\u0787\u07af\u078e\u07a6\u0790\u07b0\u0793\u07aa","\u0790\u07ac\u0795\u07b0\u0793\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0787\u07ae\u0786\u07b0\u0793\u07af\u0784\u07a6\u0783\u07aa","\u0782\u07ae\u0788\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0791\u07a8\u0790\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa"],n=["\u0787\u07a7\u078b\u07a8\u0787\u07b0\u078c\u07a6","\u0780\u07af\u0789\u07a6","\u0787\u07a6\u0782\u07b0\u078e\u07a7\u0783\u07a6","\u0784\u07aa\u078b\u07a6","\u0784\u07aa\u0783\u07a7\u0790\u07b0\u078a\u07a6\u078c\u07a8","\u0780\u07aa\u0786\u07aa\u0783\u07aa","\u0780\u07ae\u0782\u07a8\u0780\u07a8\u0783\u07aa"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"\u0787\u07a7\u078b\u07a8_\u0780\u07af\u0789\u07a6_\u0787\u07a6\u0782\u07b0_\u0784\u07aa\u078b\u07a6_\u0784\u07aa\u0783\u07a7_\u0780\u07aa\u0786\u07aa_\u0780\u07ae\u0782\u07a8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0789\u0786|\u0789\u078a/,isPM:function(e){return"\u0789\u078a"===e},meridiem:function(e,t,n){return e<12?"\u0789\u0786":"\u0789\u078a"},calendar:{sameDay:"[\u0789\u07a8\u0787\u07a6\u078b\u07aa] LT",nextDay:"[\u0789\u07a7\u078b\u07a6\u0789\u07a7] LT",nextWeek:"dddd LT",lastDay:"[\u0787\u07a8\u0787\u07b0\u0794\u07ac] LT",lastWeek:"[\u078a\u07a7\u0787\u07a8\u078c\u07aa\u0788\u07a8] dddd LT",sameElse:"L"},relativeTime:{future:"\u078c\u07ac\u0783\u07ad\u078e\u07a6\u0787\u07a8 %s",past:"\u0786\u07aa\u0783\u07a8\u0782\u07b0 %s",s:"\u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa\u0786\u07ae\u0785\u07ac\u0787\u07b0",ss:"d% \u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa",m:"\u0789\u07a8\u0782\u07a8\u0793\u07ac\u0787\u07b0",mm:"\u0789\u07a8\u0782\u07a8\u0793\u07aa %d",h:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07ac\u0787\u07b0",hh:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07aa %d",d:"\u078b\u07aa\u0788\u07a6\u0780\u07ac\u0787\u07b0",dd:"\u078b\u07aa\u0788\u07a6\u0790\u07b0 %d",M:"\u0789\u07a6\u0780\u07ac\u0787\u07b0",MM:"\u0789\u07a6\u0790\u07b0 %d",y:"\u0787\u07a6\u0780\u07a6\u0783\u07ac\u0787\u07b0",yy:"\u0787\u07a6\u0780\u07a6\u0783\u07aa %d"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:7,doy:12}})}(n("wd/R"))},We1y:function(e,t,n){var i=n("2oRo"),r=n("Fib7"),s=n("DVFp"),o=i.TypeError;e.exports=function(e){if(r(e))return e;throw o(s(e)+" is not a function")}},Wv91:function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'\xfcnji",4:"'\xfcnji",100:"'\xfcnji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"\xddanwar_Fewral_Mart_Aprel_Ma\xfd_I\xfdun_I\xfdul_Awgust_Sent\xfdabr_Okt\xfdabr_No\xfdabr_Dekabr".split("_"),monthsShort:"\xddan_Few_Mar_Apr_Ma\xfd_I\xfdn_I\xfdl_Awg_Sen_Okt_No\xfd_Dek".split("_"),weekdays:"\xddek\u015fenbe_Du\u015fenbe_Si\u015fenbe_\xc7ar\u015fenbe_Pen\u015fenbe_Anna_\u015eenbe".split("_"),weekdaysShort:"\xddek_Du\u015f_Si\u015f_\xc7ar_Pen_Ann_\u015een".split("_"),weekdaysMin:"\xddk_D\u015f_S\u015f_\xc7r_Pn_An_\u015en".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[d\xfc\xfdn] LT",lastWeek:"[ge\xe7en] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s so\u0148",past:"%s \xf6\u0148",s:"birn\xe4\xe7e sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir a\xfd",MM:"%d a\xfd",y:"bir \xfdyl",yy:"%d \xfdyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var i=e%10;return e+(t[i]||t[e%100-i]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},WxRl:function(e,t,n){!function(e){"use strict";var t="vas\xe1rnap h\xe9tf\u0151n kedden szerd\xe1n cs\xfct\xf6rt\xf6k\xf6n p\xe9nteken szombaton".split(" ");function n(e,t,n,i){var r=e;switch(n){case"s":return i||t?"n\xe9h\xe1ny m\xe1sodperc":"n\xe9h\xe1ny m\xe1sodperce";case"ss":return r+(i||t)?" m\xe1sodperc":" m\xe1sodperce";case"m":return"egy"+(i||t?" perc":" perce");case"mm":return r+(i||t?" perc":" perce");case"h":return"egy"+(i||t?" \xf3ra":" \xf3r\xe1ja");case"hh":return r+(i||t?" \xf3ra":" \xf3r\xe1ja");case"d":return"egy"+(i||t?" nap":" napja");case"dd":return r+(i||t?" nap":" napja");case"M":return"egy"+(i||t?" h\xf3nap":" h\xf3napja");case"MM":return r+(i||t?" h\xf3nap":" h\xf3napja");case"y":return"egy"+(i||t?" \xe9v":" \xe9ve");case"yy":return r+(i||t?" \xe9v":" \xe9ve")}return""}function i(e){return(e?"":"[m\xfalt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"janu\xe1r_febru\xe1r_m\xe1rcius_\xe1prilis_m\xe1jus_j\xfanius_j\xfalius_augusztus_szeptember_okt\xf3ber_november_december".split("_"),monthsShort:"jan._feb._m\xe1rc._\xe1pr._m\xe1j._j\xfan._j\xfal._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vas\xe1rnap_h\xe9tf\u0151_kedd_szerda_cs\xfct\xf6rt\xf6k_p\xe9ntek_szombat".split("_"),weekdaysShort:"vas_h\xe9t_kedd_sze_cs\xfct_p\xe9n_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return i.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return i.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s m\xfalva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},X709:function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf6ndag_m\xe5ndag_tisdag_onsdag_torsdag_fredag_l\xf6rdag".split("_"),weekdaysShort:"s\xf6n_m\xe5n_tis_ons_tor_fre_l\xf6r".split("_"),weekdaysMin:"s\xf6_m\xe5_ti_on_to_fr_l\xf6".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Ig\xe5r] LT",nextWeek:"[P\xe5] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"f\xf6r %s sedan",s:"n\xe5gra sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en m\xe5nad",MM:"%d m\xe5nader",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("wd/R"))},XDbj:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("sVev"),r=n("7o/Q");function s(e=c){return t=>t.lift(new o(e))}class o{constructor(e){this.errorFactory=e}call(e,t){return t.subscribe(new a(e,this.errorFactory))}}class a extends r.a{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let t;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)}}}function c(){return new i.a}},XDpg:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u5468\u65e5_\u5468\u4e00_\u5468\u4e8c_\u5468\u4e09_\u5468\u56db_\u5468\u4e94_\u5468\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5Ah\u70b9mm\u5206",LLLL:"YYYY\u5e74M\u6708D\u65e5ddddAh\u70b9mm\u5206",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:function(e){return e.week()!==this.week()?"[\u4e0b]dddLT":"[\u672c]dddLT"},lastDay:"[\u6628\u5929]LT",lastWeek:function(e){return this.week()!==e.week()?"[\u4e0a]dddLT":"[\u672c]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u5468)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u5468";default:return e}},relativeTime:{future:"%s\u540e",past:"%s\u524d",s:"\u51e0\u79d2",ss:"%d \u79d2",m:"1 \u5206\u949f",mm:"%d \u5206\u949f",h:"1 \u5c0f\u65f6",hh:"%d \u5c0f\u65f6",d:"1 \u5929",dd:"%d \u5929",w:"1 \u5468",ww:"%d \u5468",M:"1 \u4e2a\u6708",MM:"%d \u4e2a\u6708",y:"1 \u5e74",yy:"%d \u5e74"},week:{dow:1,doy:4}})}(n("wd/R"))},XFyV:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("oxzT"),r=n("8Y7J"),s=n("G0yt"),o=n("SVse");const a=function(e,t){return[e,t]},c=["*"];let l=(()=>{class e{constructor(){this.icons=i.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-loading-panel"]],ngContentSelectors:c,decls:4,vars:5,consts:[["type","info",3,"dismissible"],["aria-hidden","true",1,"mr-2",3,"ngClass"]],template:function(e,t){1&e&&(r.tc(),r.Xb(0,"ngb-alert",0),r.Xb(1,"strong"),r.Sb(2,"i",1),r.Wb(),r.sc(3),r.Wb()),2&e&&(r.uc("dismissible",!1),r.Db(2),r.uc("ngClass",r.Ac(2,a,t.icons.spinner,t.icons.spin)))},directives:[s.b,o.p],styles:[""]}),e})()},XGwC:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},XLvN:function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"\u0c1c\u0c28\u0c35\u0c30\u0c3f_\u0c2b\u0c3f\u0c2c\u0c4d\u0c30\u0c35\u0c30\u0c3f_\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f\u0c32\u0c4d_\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17\u0c38\u0c4d\u0c1f\u0c41_\u0c38\u0c46\u0c2a\u0c4d\u0c1f\u0c46\u0c02\u0c2c\u0c30\u0c4d_\u0c05\u0c15\u0c4d\u0c1f\u0c4b\u0c2c\u0c30\u0c4d_\u0c28\u0c35\u0c02\u0c2c\u0c30\u0c4d_\u0c21\u0c3f\u0c38\u0c46\u0c02\u0c2c\u0c30\u0c4d".split("_"),monthsShort:"\u0c1c\u0c28._\u0c2b\u0c3f\u0c2c\u0c4d\u0c30._\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f._\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17._\u0c38\u0c46\u0c2a\u0c4d._\u0c05\u0c15\u0c4d\u0c1f\u0c4b._\u0c28\u0c35._\u0c21\u0c3f\u0c38\u0c46.".split("_"),monthsParseExact:!0,weekdays:"\u0c06\u0c26\u0c3f\u0c35\u0c3e\u0c30\u0c02_\u0c38\u0c4b\u0c2e\u0c35\u0c3e\u0c30\u0c02_\u0c2e\u0c02\u0c17\u0c33\u0c35\u0c3e\u0c30\u0c02_\u0c2c\u0c41\u0c27\u0c35\u0c3e\u0c30\u0c02_\u0c17\u0c41\u0c30\u0c41\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c41\u0c15\u0c4d\u0c30\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c28\u0c3f\u0c35\u0c3e\u0c30\u0c02".split("_"),weekdaysShort:"\u0c06\u0c26\u0c3f_\u0c38\u0c4b\u0c2e_\u0c2e\u0c02\u0c17\u0c33_\u0c2c\u0c41\u0c27_\u0c17\u0c41\u0c30\u0c41_\u0c36\u0c41\u0c15\u0c4d\u0c30_\u0c36\u0c28\u0c3f".split("_"),weekdaysMin:"\u0c06_\u0c38\u0c4b_\u0c2e\u0c02_\u0c2c\u0c41_\u0c17\u0c41_\u0c36\u0c41_\u0c36".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c28\u0c47\u0c21\u0c41] LT",nextDay:"[\u0c30\u0c47\u0c2a\u0c41] LT",nextWeek:"dddd, LT",lastDay:"[\u0c28\u0c3f\u0c28\u0c4d\u0c28] LT",lastWeek:"[\u0c17\u0c24] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0c32\u0c4b",past:"%s \u0c15\u0c4d\u0c30\u0c3f\u0c24\u0c02",s:"\u0c15\u0c4a\u0c28\u0c4d\u0c28\u0c3f \u0c15\u0c4d\u0c37\u0c23\u0c3e\u0c32\u0c41",ss:"%d \u0c38\u0c46\u0c15\u0c28\u0c4d\u0c32\u0c41",m:"\u0c12\u0c15 \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c02",mm:"%d \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c3e\u0c32\u0c41",h:"\u0c12\u0c15 \u0c17\u0c02\u0c1f",hh:"%d \u0c17\u0c02\u0c1f\u0c32\u0c41",d:"\u0c12\u0c15 \u0c30\u0c4b\u0c1c\u0c41",dd:"%d \u0c30\u0c4b\u0c1c\u0c41\u0c32\u0c41",M:"\u0c12\u0c15 \u0c28\u0c46\u0c32",MM:"%d \u0c28\u0c46\u0c32\u0c32\u0c41",y:"\u0c12\u0c15 \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c02",yy:"%d \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c3e\u0c32\u0c41"},dayOfMonthOrdinalParse:/\d{1,2}\u0c35/,ordinal:"%d\u0c35",meridiemParse:/\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f|\u0c09\u0c26\u0c2f\u0c02|\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02|\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"===t?e<4?e:e+12:"\u0c09\u0c26\u0c2f\u0c02"===t?e:"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02"===t?e>=10?e:e+12:"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f":e<10?"\u0c09\u0c26\u0c2f\u0c02":e<17?"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02":e<20?"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02":"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"},week:{dow:0,doy:6}})}(n("wd/R"))},XNiG:function(e,t,n){"use strict";n.d(t,"b",function(){return l}),n.d(t,"a",function(){return u});var i=n("HDdC"),r=n("7o/Q"),s=n("quSY"),o=n("9ppp"),a=n("Ylt2"),c=n("2QA8");class l extends r.a{constructor(e){super(e),this.destination=e}}let u=(()=>{class e extends i.a{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[c.a](){return new l(this)}lift(e){const t=new d(this,this);return t.operator=e,t}next(e){if(this.closed)throw new o.a;if(!this.isStopped){const{observers:t}=this,n=t.length,i=t.slice();for(let r=0;r<n;r++)i[r].next(e)}}error(e){if(this.closed)throw new o.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,n=t.length,i=t.slice();for(let r=0;r<n;r++)i[r].error(e);this.observers.length=0}complete(){if(this.closed)throw new o.a;this.isStopped=!0;const{observers:e}=this,t=e.length,n=e.slice();for(let i=0;i<t;i++)n[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new o.a;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new o.a;return this.hasError?(e.error(this.thrownError),s.a.EMPTY):this.isStopped?(e.complete(),s.a.EMPTY):(this.observers.push(e),new a.a(this,e))}asObservable(){const e=new i.a;return e.source=this,e}}return e.create=(e,t)=>new d(e,t),e})();class d extends u{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):s.a.EMPTY}}},Xnc8:function(e,t,n){var i=n("g6v/"),r=n("Gi26"),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,a=r(s,"name"),c=a&&"something"===(function(){}).name,l=a&&(!i||i&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},XoHu:function(e,t,n){"use strict";function i(e){return null!==e&&"object"==typeof e}n.d(t,"a",function(){return i})},XqMk:function(e,t,n){"use strict";var i="object"==typeof global&&global&&global.Object===Object&&global;t.a=i},Y7HM:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("DH7j");function r(e){return!Object(i.a)(e)&&e-parseFloat(e)+1>=0}},Y7yP:function(e,t,n){"use strict";var i,r=n("vJtL"),s=n("Ju5/").a["__core-js_shared__"],o=(i=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",a=n("IzLi"),c=n("dLWn"),l=/^\[object .+?Constructor\]$/,u=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.a=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Object(a.a)(e)||(t=e,o&&o in t))&&(Object(r.a)(e)?u:l).test(Object(c.a)(e));var t}(n)?n:void 0}},YF1G:function(e,t,n){var i=n("xrYK"),r=n("2oRo");e.exports="process"==i(r.process)},YHEm:function(e,t,n){"use strict";t.a=function(e,t){return e===t||e!=e&&t!=t}},YM6B:function(e,t,n){"use strict";var i=n("Y7yP"),r=n("Ju5/"),s=Object(i.a)(r.a,"DataView"),o=n("3cmB"),a=Object(i.a)(r.a,"Promise"),c=Object(i.a)(r.a,"Set"),l=Object(i.a)(r.a,"WeakMap"),u=n("8M4i"),d=n("dLWn"),h="[object Map]",f="[object Promise]",p="[object Set]",m="[object WeakMap]",b="[object DataView]",g=Object(d.a)(s),_=Object(d.a)(o.a),v=Object(d.a)(a),y=Object(d.a)(c),w=Object(d.a)(l),D=u.a;(s&&D(new s(new ArrayBuffer(1)))!=b||o.a&&D(new o.a)!=h||a&&D(a.resolve())!=f||c&&D(new c)!=p||l&&D(new l)!=m)&&(D=function(e){var t=Object(u.a)(e),n="[object Object]"==t?e.constructor:void 0,i=n?Object(d.a)(n):"";if(i)switch(i){case g:return b;case _:return h;case v:return f;case y:return p;case w:return m}return t}),t.a=D},YNrV:function(e,t,n){"use strict";var i=n("g6v/"),r=n("4zBA"),s=n("xluM"),o=n("0Dky"),a=n("33Wh"),c=n("dBg+"),l=n("0eef"),u=n("ewvW"),d=n("RK3t"),h=Object.assign,f=Object.defineProperty,p=r([].concat);e.exports=!h||o(function(){if(i&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=h({},e)[n]||a(h({},t)).join("")!=r})?function(e,t){for(var n=u(e),r=arguments.length,o=1,h=c.f,f=l.f;r>o;)for(var m,b=d(arguments[o++]),g=h?p(a(b),h(b)):a(b),_=g.length,v=0;_>v;)m=g[v++],i&&!s(f,b,m)||(n[m]=b[m]);return n}:h},YRex:function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),monthsShort:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),weekdays:"\u064a\u06d5\u0643\u0634\u06d5\u0646\u0628\u06d5_\u062f\u06c8\u0634\u06d5\u0646\u0628\u06d5_\u0633\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u0686\u0627\u0631\u0634\u06d5\u0646\u0628\u06d5_\u067e\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u062c\u06c8\u0645\u06d5_\u0634\u06d5\u0646\u0628\u06d5".split("_"),weekdaysShort:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),weekdaysMin:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649",LLL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm",LLLL:"dddd\u060c YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm"},meridiemParse:/\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5|\u0633\u06d5\u06be\u06d5\u0631|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646|\u0686\u06c8\u0634|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646|\u0643\u06d5\u0686/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5"===t||"\u0633\u06d5\u06be\u06d5\u0631"===t||"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646"===t?e:"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646"===t||"\u0643\u06d5\u0686"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5":i<900?"\u0633\u06d5\u06be\u06d5\u0631":i<1130?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646":i<1230?"\u0686\u06c8\u0634":i<1800?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646":"\u0643\u06d5\u0686"},calendar:{sameDay:"[\u0628\u06c8\u06af\u06c8\u0646 \u0633\u0627\u0626\u06d5\u062a] LT",nextDay:"[\u0626\u06d5\u062a\u06d5 \u0633\u0627\u0626\u06d5\u062a] LT",nextWeek:"[\u0643\u06d0\u0644\u06d5\u0631\u0643\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",lastDay:"[\u062a\u06c6\u0646\u06c8\u06af\u06c8\u0646] LT",lastWeek:"[\u0626\u0627\u0644\u062f\u0649\u0646\u0642\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0643\u06d0\u064a\u0649\u0646",past:"%s \u0628\u06c7\u0631\u06c7\u0646",s:"\u0646\u06d5\u0686\u0686\u06d5 \u0633\u06d0\u0643\u0648\u0646\u062a",ss:"%d \u0633\u06d0\u0643\u0648\u0646\u062a",m:"\u0628\u0649\u0631 \u0645\u0649\u0646\u06c7\u062a",mm:"%d \u0645\u0649\u0646\u06c7\u062a",h:"\u0628\u0649\u0631 \u0633\u0627\u0626\u06d5\u062a",hh:"%d \u0633\u0627\u0626\u06d5\u062a",d:"\u0628\u0649\u0631 \u0643\u06c8\u0646",dd:"%d \u0643\u06c8\u0646",M:"\u0628\u0649\u0631 \u0626\u0627\u064a",MM:"%d \u0626\u0627\u064a",y:"\u0628\u0649\u0631 \u064a\u0649\u0644",yy:"%d \u064a\u0649\u0644"},dayOfMonthOrdinalParse:/\d{1,2}(-\u0643\u06c8\u0646\u0649|-\u0626\u0627\u064a|-\u06be\u06d5\u067e\u062a\u06d5)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-\u0643\u06c8\u0646\u0649";case"w":case"W":return e+"-\u06be\u06d5\u067e\u062a\u06d5";default:return e}},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:7}})}(n("wd/R"))},Ylt2:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("quSY");class r extends i.a{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},Yrry:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("cUpR");let s=(()=>{class e{constructor(e){this.domSanitizer=e}transform(e){return this.domSanitizer.sanitize(i.L.HTML,e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(r.b))},e.\u0275pipe=i.Qb({name:"sanitizeHtml",type:e,pure:!0}),e})()},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},Z21x:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("8Y7J"),r=n("sne2"),s=n("SVse"),o=n("ANnk");let a=(()=>{class e{constructor(e,t){this.location=e,this.actionLabels=t,this.backAction=new i.p,this.name=this.actionLabels.CANCEL}back(){0===this.backAction.observers.length?this.location.back():this.backAction.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(s.m),i.Rb(r.b))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-back-button"]],inputs:{name:"name"},outputs:{backAction:"backAction"},decls:2,vars:1,consts:[["type","button",1,"btn","btn-light","tc_backButton",3,"click"]],template:function(e,t){1&e&&(i.Xb(0,"button",0),i.lc("click",function(){return t.back()}),i.Rc(1),i.Wb()),2&e&&(i.Db(1),i.Tc(" ",t.name,"\n"))},directives:[o.a],styles:[""]}),e})()},Z4QM:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u064a","\u0641\u064a\u0628\u0631\u0648\u0631\u064a","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u064a\u0644","\u0645\u0626\u064a","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0621\u0650","\u0622\u06af\u0633\u067d","\u0633\u064a\u067e\u067d\u0645\u0628\u0631","\u0622\u06aa\u067d\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u068a\u0633\u0645\u0628\u0631"],n=["\u0622\u0686\u0631","\u0633\u0648\u0645\u0631","\u0627\u06b1\u0627\u0631\u0648","\u0627\u0631\u0628\u0639","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639","\u0687\u0646\u0687\u0631"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0627\u0684] LT",nextDay:"[\u0633\u0680\u0627\u06bb\u064a] LT",nextWeek:"dddd [\u0627\u06b3\u064a\u0646 \u0647\u0641\u062a\u064a \u062a\u064a] LT",lastDay:"[\u06aa\u0627\u0644\u0647\u0647] LT",lastWeek:"[\u06af\u0632\u0631\u064a\u0644 \u0647\u0641\u062a\u064a] dddd [\u062a\u064a] LT",sameElse:"L"},relativeTime:{future:"%s \u067e\u0648\u0621",past:"%s \u0627\u06b3",s:"\u0686\u0646\u062f \u0633\u064a\u06aa\u0646\u068a",ss:"%d \u0633\u064a\u06aa\u0646\u068a",m:"\u0647\u06aa \u0645\u0646\u067d",mm:"%d \u0645\u0646\u067d",h:"\u0647\u06aa \u06aa\u0644\u0627\u06aa",hh:"%d \u06aa\u0644\u0627\u06aa",d:"\u0647\u06aa \u068f\u064a\u0646\u0647\u0646",dd:"%d \u068f\u064a\u0646\u0647\u0646",M:"\u0647\u06aa \u0645\u0647\u064a\u0646\u0648",MM:"%d \u0645\u0647\u064a\u0646\u0627",y:"\u0647\u06aa \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},ZAMP:function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},ZUHj:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("7o/Q");class r extends i.a{constructor(e,t,n){super(),this.parent=e,this.outerValue=t,this.outerIndex=n,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}var s=n("SeVD"),o=n("HDdC");function a(e,t,n,i,a=new r(e,n,i)){if(!a.closed)return t instanceof o.a?t.subscribe(a):Object(s.a)(t)(a)}},ZUd8:function(e,t,n){var i=n("4zBA"),r=n("WSbT"),s=n("V37c"),o=n("HYAF"),a=i("".charAt),c=i("".charCodeAt),l=i("".slice),u=function(e){return function(t,n){var i,u,d=s(o(t)),h=r(n),f=d.length;return h<0||h>=f?e?"":void 0:(i=c(d,h))<55296||i>56319||h+1===f||(u=c(d,h+1))<56320||u>57343?e?a(d,h):i:e?l(d,h,h+2):u-56320+(i-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},Zduo:function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_a\u016dgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_a\u016dg_sept_okt_nov_dec".split("_"),weekdays:"diman\u0109o_lundo_mardo_merkredo_\u0135a\u016ddo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_\u0135a\u016d_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_\u0135a_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodia\u016d je] LT",nextDay:"[Morga\u016d je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hiera\u016d je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"anta\u016d %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("wd/R"))},ZfDv:function(e,t,n){var i=n("C0Ia");e.exports=function(e,t){return new(i(e))(0===t?0:t)}},a0VL:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("SVse");let s=(()=>{class e{constructor(e){this.datePipe=e}transform(e){return null===e||""===e?"":this.datePipe.transform(e,"shortDate")+" "+this.datePipe.transform(e,"mediumTime")}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(r.e))},e.\u0275pipe=i.Qb({name:"cdDate",type:e,pure:!0}),e})()},a96k:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e,t,n,i=!0){this.selected=e,this.name=t,this.description=n,this.enabled=i}}},aIdf:function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var i=[/^gen/i,/^c[\u02bc\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_C\u02bchwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C\u02bchwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc\u02bcher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[\u02bc\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc\u02bchoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec\u02bch da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s \u02bczo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(a\xf1|vet)/,ordinal:function(e){return e+(1===e?"a\xf1":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("wd/R"))},aIsn:function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-t\u0101te_Hui-tanguru_Pout\u016b-te-rangi_Paenga-wh\u0101wh\u0101_Haratua_Pipiri_H\u014dngoingoi_Here-turi-k\u014dk\u0101_Mahuru_Whiringa-\u0101-nuku_Whiringa-\u0101-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_H\u014dngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"R\u0101tapu_Mane_T\u016brei_Wenerei_T\u0101ite_Paraire_H\u0101tarei".split("_"),weekdaysShort:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),weekdaysMin:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te h\u0113kona ruarua",ss:"%d h\u0113kona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},aO6C:function(e,t,n){var i=n("4zBA"),r=n("0Dky"),s=n("Fib7"),o=n("9d/t"),a=n("0GbY"),c=n("iSVu"),l=function(){},u=[],d=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=i(h.exec),p=!h.exec(l),m=function(e){if(!s(e))return!1;try{return d(l,u,e),!0}catch(t){return!1}};e.exports=!d||r(function(){var e;return m(m.call)||!m(Object)||!m(function(){e=!0})||e})?function(e){if(!s(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return p||!!f(h,c(e))}:m},aQkU:function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"\u0458\u0430\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d\u0438_\u0458\u0443\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u0458\u0430\u043d_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u043e\u043a_\u043f\u0435\u0442\u043e\u043a_\u0441\u0430\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u0435_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u0430\u0431".split("_"),weekdaysMin:"\u043de_\u043fo_\u0432\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441a".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u0435\u043d\u0435\u0441 \u0432\u043e] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432\u043e] LT",nextWeek:"[\u0412\u043e] dddd [\u0432\u043e] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432\u043e] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0430\u0442\u0430] dddd [\u0432\u043e] LT";case 1:case 2:case 4:case 5:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0438\u043e\u0442] dddd [\u0432\u043e] LT"}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435\u0434 %s",s:"\u043d\u0435\u043a\u043e\u043b\u043a\u0443 \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u0435\u0434\u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0435\u0434\u0435\u043d \u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0435\u0434\u0435\u043d \u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",M:"\u0435\u0434\u0435\u043d \u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0438",y:"\u0435\u0434\u043d\u0430 \u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},aXbf:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{format_number(e,t,n,i=1){if(r.a.isString(e)&&(e=Number(e)),!r.a.isNumber(e))return"-";let s=e<1?0:Math.floor(Math.log(e)/Math.log(t));s=s>=n.length?n.length-1:s;let o=r.a.round(e/Math.pow(t,s),i).toString();return""===o?"-":(""!==n[s]&&(o=`${o} ${n[s]}`),o)}toBytes(e,t=null){const n=["b","k","m","g","t","p","e","z","y"],i=RegExp("^(\\d+(.\\d+)?) ?(["+n.join("")+"]?(b|ib|B/s)?)?$","i").exec(e);if(null===i)return t;let s=parseFloat(i[1]);return r.a.isString(i[3])&&(s*=Math.pow(1024,n.indexOf(i[3].toLowerCase()[0]))),Math.round(s)}toMilliseconds(e){const t=/^\s*(\d+)\s*(ms)?\s*$/i.exec(e);return null!==t?+t[1]:0}toIops(e){const t=/^\s*(\d+)\s*(IOPS)?\s*$/i.exec(e);return null!==t?+t[1]:0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},aexS:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("2Vo4"),r=n("jKX/"),s=n("8Y7J");let o=(()=>{class e{constructor(){this.isPwdDisplayedSource=new i.a(!1),this.isPwdDisplayed$=this.isPwdDisplayedSource.asObservable()}set(e,t={},n=!1,i=null,s=!1){localStorage.setItem("dashboard_username",e),localStorage.setItem("dashboard_permissions",JSON.stringify(new r.a(t))),localStorage.setItem("user_pwd_expiration_date",String(i)),localStorage.setItem("user_pwd_update_required",String(s)),localStorage.setItem("sso",String(n))}remove(){localStorage.removeItem("dashboard_username"),localStorage.removeItem("user_pwd_expiration_data"),localStorage.removeItem("user_pwd_update_required")}isLoggedIn(){return null!==localStorage.getItem("dashboard_username")}getUsername(){return localStorage.getItem("dashboard_username")}getPermissions(){return JSON.parse(localStorage.getItem("dashboard_permissions")||JSON.stringify(new r.a({})))}getPwdExpirationDate(){return Number(localStorage.getItem("user_pwd_expiration_date"))}getPwdUpdateRequired(){return"true"===localStorage.getItem("user_pwd_update_required")}isSSO(){return"true"===localStorage.getItem("sso")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},afO8:function(e,t,n){var i,r,s,o=n("f5p1"),a=n("2oRo"),c=n("4zBA"),l=n("hh1v"),u=n("kRJp"),d=n("Gi26"),h=n("xs3f"),f=n("93I0"),p=n("0BK2"),m="Object already initialized",b=a.TypeError;if(o||h.state){var g=h.state||(h.state=new(0,a.WeakMap)),_=c(g.get),v=c(g.has),y=c(g.set);i=function(e,t){if(v(g,e))throw new b(m);return t.facade=e,y(g,e,t),t},r=function(e){return _(g,e)||{}},s=function(e){return v(g,e)}}else{var w=f("state");p[w]=!0,i=function(e,t){if(d(e,w))throw new b(m);return t.facade=e,u(e,w,t),t},r=function(e){return d(e,w)?e[w]:{}},s=function(e){return d(e,w)}}e.exports={set:i,get:r,has:s,enforce:function(e){return s(e)?r(e):i(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw b("Incompatible receiver, "+e+" required");return n}}}},ajRT:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("8Y7J"),r=n("iInd"),s=n("SVse"),o=n("ANnk");const a=[[["",8,"modal-title"]],[["",8,"modal-content"]]],c=[".modal-title",".modal-content"];let l=(()=>{class e{constructor(e){this.router=e,this.hide=new i.p}close(){var e;this.pageURL?this.router.navigate([this.pageURL,{outlets:{modal:null}}]):null===(e=this.modalRef)||void 0===e||e.close(),this.hide.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(r.e))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-modal"]],inputs:{modalRef:"modalRef",pageURL:"pageURL"},outputs:{hide:"hide"},ngContentSelectors:c,decls:10,vars:2,consts:[[3,"ngClass"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title","float-left"],["type","button","aria-label","Close",1,"close","float-right",3,"click"],["aria-hidden","true"]],template:function(e,t){1&e&&(i.tc(a),i.Xb(0,"div",0),i.Xb(1,"div",0),i.Xb(2,"div",1),i.Xb(3,"div",2),i.Xb(4,"h4",3),i.sc(5),i.Wb(),i.Xb(6,"button",4),i.lc("click",function(){return t.close()}),i.Xb(7,"span",5),i.Rc(8,"\xd7"),i.Wb(),i.Wb(),i.Wb(),i.sc(9,1),i.Wb(),i.Wb(),i.Wb()),2&e&&(i.uc("ngClass",t.pageURL?"modal":""),i.Db(1),i.uc("ngClass",t.pageURL?"modal-dialog":""))},directives:[s.p,o.a],styles:[".modal-header[_ngcontent-%COMP%]{background-color:#e9ecef;border-bottom:1px solid #ced4da;border-radius:5px 5px 0 0}  cd-modal .modal-footer{background-color:#e9ecef;border-bottom:1px solid #ced4da;border-radius:0 0 5px 5px}  cd-modal .modal-body{max-height:70vh;overflow-x:hidden;overflow-y:auto}button.close[_ngcontent-%COMP%]{outline:none}"]}),e})()},b1Dy:function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},b5OY:function(e,t,n){"use strict";n.d(t,"a",function(){return _});var i=n("mrSG"),r=n("IheW"),s=n("LRne"),o=n("5+tZ"),a=n("xTzq"),c=n("8Y7J");let l=(()=>{let e=class{constructor(e){this.http=e,this.url="api/perf_counters"}list(){return this.http.get(this.url)}get(e,t){return this.http.get(`${this.url}/${e}/${t}`).pipe(Object(o.a)(e=>Object(s.a)(e.counters)))}};return e.\u0275fac=function(t){return new(t||e)(c.ic(r.b))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([a.a,Object(i.d)("design:paramtypes",[r.b])],e),e})();var u=n("SVse"),d=n("uIqm"),h=n("/NlG"),f=n("o4+5");const p=["valueTpl"];function m(e,t){if(1&e&&(c.Rc(0),c.oc(1,"dimless")),2&e){const e=t.row;c.Uc(" ",c.pc(1,2,e.value)," ",e.unit," ")}}function b(e,t){if(1&e){const e=c.Yb();c.Xb(0,"cd-table",2),c.lc("fetchData",function(t){return c.Ic(e),c.nc().getCounters(t)}),c.Pc(1,m,2,4,"ng-template",null,3,c.Qc),c.Wb()}if(2&e){const e=c.nc();c.uc("data",e.counters)("columns",e.columns)("autoSave",!1)}}function g(e,t){1&e&&(c.Xb(0,"cd-alert-panel",4),c.bc(1,5),c.Wb())}let _=(()=>{class e{constructor(e){this.performanceCounterService=e,this.columns=[],this.counters=[]}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:1},{name:"Description",prop:"description",flexGrow:1},{name:"Value",prop:"value",cellTemplate:this.valueTpl,flexGrow:1}]}getCounters(e){this.performanceCounterService.get(this.serviceType,this.serviceId).subscribe(e=>{this.counters=e},t=>{404===t.status?(t.preventDefault(),this.counters=null):e.error()})}}return e.\u0275fac=function(t){return new(t||e)(c.Rb(l))},e.\u0275cmp=c.Lb({type:e,selectors:[["cd-table-performance-counter"]],viewQuery:function(e,t){if(1&e&&c.Wc(p,1),2&e){let e;c.Ec(e=c.mc())&&(t.valueTpl=e.first)}},inputs:{serviceType:"serviceType",serviceId:"serviceId"},decls:3,vars:2,consts:function(){let e;return e="Performance counters not available",[["columnMode","flex",3,"data","columns","autoSave","fetchData",4,"ngIf","ngIfElse"],["warning",""],["columnMode","flex",3,"data","columns","autoSave","fetchData"],["valueTpl",""],["type","warning"],e]},template:function(e,t){if(1&e&&(c.Pc(0,b,3,3,"cd-table",0),c.Pc(1,g,2,0,"ng-template",null,1,c.Qc)),2&e){const e=c.Fc(2);c.uc("ngIf",t.counters)("ngIfElse",e)}},directives:[u.r,d.a,h.a],pipes:[f.a],styles:[""]}),e})()},bHdf:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("5+tZ"),r=n("SpAZ");function s(e=Number.POSITIVE_INFINITY){return Object(i.a)(r.a,e)}},bOMt:function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},bOdf:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("5+tZ");function r(e,t){return Object(i.a)(e,t,1)}},bWFh:function(e,t,n){"use strict";var i=n("I+eb"),r=n("2oRo"),s=n("4zBA"),o=n("lMq5"),a=n("busE"),c=n("8YOa"),l=n("ImZN"),u=n("GarU"),d=n("Fib7"),h=n("hh1v"),f=n("0Dky"),p=n("HH4o"),m=n("1E5z"),b=n("cVYH");e.exports=function(e,t,n){var g=-1!==e.indexOf("Map"),_=-1!==e.indexOf("Weak"),v=g?"set":"add",y=r[e],w=y&&y.prototype,D=y,S={},x=function(e){var t=s(w[e]);a(w,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(_&&!h(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return _&&!h(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(_&&!h(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(o(e,!d(y)||!(_||w.forEach&&!f(function(){(new y).entries().next()}))))D=n.getConstructor(t,e,g,v),c.enable();else if(o(e,!0)){var k=new D,T=k[v](_?{}:-0,1)!=k,M=f(function(){k.has(1)}),C=p(function(e){new y(e)}),O=!_&&f(function(){for(var e=new y,t=5;t--;)e[v](t,t);return!e.has(-0)});C||((D=t(function(e,t){u(e,w);var n=b(new y,e,D);return null!=t&&l(t,n[v],{that:n,AS_ENTRIES:g}),n})).prototype=w,w.constructor=D),(M||O)&&(x("delete"),x("has"),g&&x("get")),(O||T)&&x(v),_&&w.clear&&delete w.clear}return S[e]=D,i({global:!0,forced:D!=y},S),m(D,e),_||n.setStrong(D,e,g),D}},bXm7:function(e,t,n){!function(e){"use strict";var t={0:"-\u0448\u0456",1:"-\u0448\u0456",2:"-\u0448\u0456",3:"-\u0448\u0456",4:"-\u0448\u0456",5:"-\u0448\u0456",6:"-\u0448\u044b",7:"-\u0448\u0456",8:"-\u0448\u0456",9:"-\u0448\u044b",10:"-\u0448\u044b",20:"-\u0448\u044b",30:"-\u0448\u044b",40:"-\u0448\u044b",50:"-\u0448\u0456",60:"-\u0448\u044b",70:"-\u0448\u0456",80:"-\u0448\u0456",90:"-\u0448\u044b",100:"-\u0448\u0456"};e.defineLocale("kk",{months:"\u049b\u0430\u04a3\u0442\u0430\u0440_\u0430\u049b\u043f\u0430\u043d_\u043d\u0430\u0443\u0440\u044b\u0437_\u0441\u04d9\u0443\u0456\u0440_\u043c\u0430\u043c\u044b\u0440_\u043c\u0430\u0443\u0441\u044b\u043c_\u0448\u0456\u043b\u0434\u0435_\u0442\u0430\u043c\u044b\u0437_\u049b\u044b\u0440\u043a\u04af\u0439\u0435\u043a_\u049b\u0430\u0437\u0430\u043d_\u049b\u0430\u0440\u0430\u0448\u0430_\u0436\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d".split("_"),monthsShort:"\u049b\u0430\u04a3_\u0430\u049b\u043f_\u043d\u0430\u0443_\u0441\u04d9\u0443_\u043c\u0430\u043c_\u043c\u0430\u0443_\u0448\u0456\u043b_\u0442\u0430\u043c_\u049b\u044b\u0440_\u049b\u0430\u0437_\u049b\u0430\u0440_\u0436\u0435\u043b".split("_"),weekdays:"\u0436\u0435\u043a\u0441\u0435\u043d\u0431\u0456_\u0434\u04af\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u04d9\u0440\u0441\u0435\u043d\u0431\u0456_\u0431\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0436\u04b1\u043c\u0430_\u0441\u0435\u043d\u0431\u0456".split("_"),weekdaysShort:"\u0436\u0435\u043a_\u0434\u04af\u0439_\u0441\u0435\u0439_\u0441\u04d9\u0440_\u0431\u0435\u0439_\u0436\u04b1\u043c_\u0441\u0435\u043d".split("_"),weekdaysMin:"\u0436\u043a_\u0434\u0439_\u0441\u0439_\u0441\u0440_\u0431\u0439_\u0436\u043c_\u0441\u043d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u0456\u043d \u0441\u0430\u0493\u0430\u0442] LT",nextDay:"[\u0415\u0440\u0442\u0435\u04a3 \u0441\u0430\u0493\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0493\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0448\u0435 \u0441\u0430\u0493\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u0435\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u04a3] dddd [\u0441\u0430\u0493\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0456\u0448\u0456\u043d\u0434\u0435",past:"%s \u0431\u04b1\u0440\u044b\u043d",s:"\u0431\u0456\u0440\u043d\u0435\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0456\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u0431\u0456\u0440 \u0441\u0430\u0493\u0430\u0442",hh:"%d \u0441\u0430\u0493\u0430\u0442",d:"\u0431\u0456\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0456\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0456\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0448\u0456|\u0448\u044b)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},bYM6:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},bpih:function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},busE:function(e,t,n){var i=n("2oRo"),r=n("Fib7"),s=n("Gi26"),o=n("kRJp"),a=n("zk60"),c=n("iSVu"),l=n("afO8"),u=n("Xnc8").CONFIGURABLE,d=l.get,h=l.enforce,f=String(String).split("String");(e.exports=function(e,t,n,c){var l,d=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,m=!!c&&!!c.noTargetGet,b=c&&void 0!==c.name?c.name:t;r(n)&&("Symbol("===String(b).slice(0,7)&&(b="["+String(b).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!s(n,"name")||u&&n.name!==b)&&o(n,"name",b),(l=h(n)).source||(l.source=f.join("string"==typeof b?b:""))),e!==i?(d?!m&&e[t]&&(p=!0):delete e[t],p?e[t]=n:o(e,t,n)):p?e[t]=n:a(t,n)})(Function.prototype,"toString",function(){return r(this)&&d(this).source||c(this)})},bxKX:function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},c2HN:function(e,t,n){"use strict";function i(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.d(t,"a",function(){return i})},cEzo:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("e0ae"),r=n("oxzT"),s=n("8Y7J"),o=n("EApP"),a=n("ANnk"),c=n("SVse");const l=function(e){return[e]};let u=(()=>{class e{constructor(e){this.toastr=e,this.byId=!0,this.icons=r.a}getText(){return document.getElementById(this.source).value}onClick(){try{const e=Object(i.a)(),t=this.byId?this.getText():this.source,n=()=>{this.toastr.success("Copied text to the clipboard successfully.")};["firefox","ie","ios","safari"].includes(e.name)?navigator.clipboard.writeText(t).then(()=>n()):navigator.permissions.query({name:"clipboard-write"}).then(e=>{"granted"!==e.state&&"prompt"!==e.state||navigator.clipboard.writeText(t).then(()=>n())})}catch(e){this.toastr.error("Failed to copy text to the clipboard.")}}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(o.b))},e.\u0275cmp=s.Lb({type:e,selectors:[["cd-copy-2-clipboard-button"]],hostBindings:function(e,t){1&e&&s.lc("click",function(){return t.onClick()})},inputs:{source:"source",byId:"byId"},decls:2,vars:3,consts:function(){let e;return e="Copy to Clipboard",[["type","button","title",e,1,"btn","btn-light",3,"click"],[3,"ngClass"]]},template:function(e,t){1&e&&(s.Xb(0,"button",0),s.lc("click",function(){return t.onClick()}),s.Sb(1,"i",1),s.Wb()),2&e&&(s.Db(1),s.uc("ngClass",s.zc(1,l,t.icons.clipboard)))},directives:[a.a,c.p],styles:[""]}),e})()},cRix:function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[\xf4fr\xfbne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien min\xfat",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},cSlR:function(e,t,n){"use strict";var i=/^(?:0|[1-9]\d*)$/;t.a=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&i.test(e))&&e>-1&&e%1==0&&e<t}},cUpR:function(e,t,n){"use strict";n.d(t,"a",function(){return j}),n.d(t,"b",function(){return A}),n.d(t,"c",function(){return $}),n.d(t,"d",function(){return F}),n.d(t,"e",function(){return D});var i=n("SVse"),r=n("8Y7J");class s extends i.J{constructor(){super()}supportsDOMEvents(){return!0}}class o extends s{static makeCurrent(){Object(i.N)(new o)}getProperty(e,t){return e[t]}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(e,t,n){return e.addEventListener(t,n,!1),()=>{e.removeEventListener(t,n,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}getValue(e){return e.value}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=c||(c=document.querySelector("base"),c)?c.getAttribute("href"):null;return null==t?null:(n=t,a||(a=document.createElement("a")),a.setAttribute("href",n),"/"===a.pathname.charAt(0)?a.pathname:"/"+a.pathname);var n}resetBaseElement(){c=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Object(i.M)(document.cookie,e)}}let a,c=null;const l=new r.u("TRANSITION_ID"),u=[{provide:r.d,useFactory:function(e,t,n){return()=>{n.get(r.e).donePromise.then(()=>{const n=Object(i.L)();Array.prototype.slice.apply(t.querySelectorAll("style[ng-transition]")).filter(t=>t.getAttribute("ng-transition")===e).forEach(e=>n.remove(e))})}},deps:[l,i.d,r.v],multi:!0}];class d{static init(){Object(r.Z)(new d)}addToWindow(e){r.rb.getAngularTestability=(t,n=!0)=>{const i=e.findTestabilityInTree(t,n);if(null==i)throw new Error("Could not find testability for element.");return i},r.rb.getAllAngularTestabilities=()=>e.getAllTestabilities(),r.rb.getAllAngularRootElements=()=>e.getAllRootElements(),r.rb.frameworkStabilizers||(r.rb.frameworkStabilizers=[]),r.rb.frameworkStabilizers.push(e=>{const t=r.rb.getAllAngularTestabilities();let n=t.length,i=!1;const s=function(t){i=i||t,n--,0==n&&e(i)};t.forEach(function(e){e.whenStable(s)})})}findTestabilityInTree(e,t,n){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:n?Object(i.L)().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}const h=new r.u("EventManagerPlugins");let f=(()=>{class e{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}addGlobalEventListener(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const n=this._plugins;for(let i=0;i<n.length;i++){const t=n[i];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error(`No event manager plugin found for event ${e}`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(h),r.ic(r.D))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();class p{constructor(e){this._doc=e}addGlobalEventListener(e,t,n){const r=Object(i.L)().getGlobalEventTarget(this._doc,e);if(!r)throw new Error(`Unsupported event target ${r} for event ${t}`);return this.addEventListener(r,t,n)}}let m=(()=>{class e{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),b=(()=>{class e extends m{constructor(e){super(),this._doc=e,this._hostNodes=new Map,this._hostNodes.set(e.head,[])}_addStylesToHost(e,t,n){e.forEach(e=>{const i=this._doc.createElement("style");i.textContent=e,n.push(t.appendChild(i))})}addHost(e){const t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)}removeHost(e){const t=this._hostNodes.get(e);t&&t.forEach(g),this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach((t,n)=>{this._addStylesToHost(e,n,t)})}ngOnDestroy(){this._hostNodes.forEach(e=>e.forEach(g))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(i.d))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();function g(e){Object(i.L)().remove(e)}const _={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},v=/%COMP%/g;function y(e,t,n){for(let i=0;i<t.length;i++){let r=t[i];Array.isArray(r)?y(e,r,n):(r=r.replace(v,e),n.push(r))}return n}function w(e){return t=>{if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}let D=(()=>{class e{constructor(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new S(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case r.T.Emulated:{let n=this.rendererByCompId.get(t.id);return n||(n=new x(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,n)),n.applyToHost(e),n}case 1:case r.T.ShadowDom:return new k(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=y(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return e.\u0275fac=function(t){return new(t||e)(r.ic(f),r.ic(b),r.ic(r.c))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();class S{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(_[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,n){e&&e.insertBefore(t,n)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error(`The selector "${e}" did not match any elements`);return t||(n.textContent=""),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,i){if(i){t=i+":"+t;const r=_[i];r?e.setAttributeNS(r,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){const i=_[n];i?e.removeAttributeNS(i,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,i){i&(r.J.DashCase|r.J.Important)?e.style.setProperty(t,n,i&r.J.Important?"important":""):e.style[t]=n}removeStyle(e,t,n){n&r.J.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,n){e[t]=n}setValue(e,t){e.nodeValue=t}listen(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,w(n)):this.eventManager.addEventListener(e,t,w(n))}}class x extends S{constructor(e,t,n,i){super(e),this.component=n;const r=y(i+"-"+n.id,n.styles,[]);t.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(v,i+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(v,i+"-"+n.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,""),n}}class k extends S{constructor(e,t,n,i){super(e),this.sharedStylesHost=t,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=y(i.id,i.styles,[]);for(let s=0;s<r.length;s++){const e=document.createElement("style");e.textContent=r[s],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}let T=(()=>{class e extends p{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,n){return e.addEventListener(t,n,!1),()=>this.removeEventListener(e,t,n)}removeEventListener(e,t,n){return e.removeEventListener(t,n)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(i.d))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();const M=["alt","control","meta","shift"],C={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},O={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},L={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let E=(()=>{class e extends p{constructor(e){super(e)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,n,r){const s=e.parseEventName(n),o=e.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Object(i.L)().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const n=t.toLowerCase().split("."),i=n.shift();if(0===n.length||"keydown"!==i&&"keyup"!==i)return null;const r=e._normalizeKey(n.pop());let s="";if(M.forEach(e=>{const t=n.indexOf(e);t>-1&&(n.splice(t,1),s+=e+".")}),s+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=i,o.fullKey=s,o}static getEventFullKey(e){let t="",n=function(e){let t=e.key;if(null==t){if(t=e.keyIdentifier,null==t)return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),3===e.location&&O.hasOwnProperty(t)&&(t=O[t]))}return C[t]||t}(e);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),M.forEach(i=>{i!=n&&(0,L[i])(e)&&(t+=i+".")}),t+=n,t}static eventCallback(t,n,i){return r=>{e.getEventFullKey(r)===t&&i.runGuarded(()=>n(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return e.\u0275fac=function(t){return new(t||e)(r.ic(i.d))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),A=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(r.Nb)({factory:function(){return Object(r.ic)(R)},token:e,providedIn:"root"}),e})();function I(e){return new R(e.get(i.d))}let R=(()=>{class e extends A{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case r.L.NONE:return t;case r.L.HTML:return Object(r.gb)(t,"HTML")?Object(r.zb)(t):Object(r.eb)(this._doc,String(t)).toString();case r.L.STYLE:return Object(r.gb)(t,"Style")?Object(r.zb)(t):t;case r.L.SCRIPT:if(Object(r.gb)(t,"Script"))return Object(r.zb)(t);throw new Error("unsafe value used in a script context");case r.L.URL:return Object(r.qb)(t),Object(r.gb)(t,"URL")?Object(r.zb)(t):Object(r.fb)(String(t));case r.L.RESOURCE_URL:if(Object(r.gb)(t,"ResourceURL"))return Object(r.zb)(t);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(e){return Object(r.hb)(e)}bypassSecurityTrustStyle(e){return Object(r.kb)(e)}bypassSecurityTrustScript(e){return Object(r.jb)(e)}bypassSecurityTrustUrl(e){return Object(r.lb)(e)}bypassSecurityTrustResourceUrl(e){return Object(r.ib)(e)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(i.d))},e.\u0275prov=Object(r.Nb)({factory:function(){return I(Object(r.ic)(r.r))},token:e,providedIn:"root"}),e})();const P=[{provide:r.F,useValue:i.K},{provide:r.G,useValue:function(){o.makeCurrent(),d.init()},multi:!0},{provide:i.d,useFactory:function(){return Object(r.xb)(document),document},deps:[]}],F=Object(r.U)(r.Y,"browser",P),W=[[],{provide:r.bb,useValue:"root"},{provide:r.o,useFactory:function(){return new r.o},deps:[]},{provide:h,useClass:T,multi:!0,deps:[i.d,r.D,r.F]},{provide:h,useClass:E,multi:!0,deps:[i.d]},[],{provide:D,useClass:D,deps:[f,b,r.c]},{provide:r.I,useExisting:D},{provide:m,useExisting:b},{provide:b,useClass:b,deps:[i.d]},{provide:r.P,useClass:r.P,deps:[r.D]},{provide:f,useClass:f,deps:[h,r.D]},[]];let j=(()=>{class e{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:e,providers:[{provide:r.c,useValue:t.appId},{provide:l,useExisting:r.c},u]}}}return e.\u0275fac=function(t){return new(t||e)(r.ic(e,12))},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({providers:W,imports:[i.c,r.f]}),e})();const Y="undefined"!=typeof window&&window||{};class N{constructor(e,t){this.msPerTick=e,this.numTicks=t}}class z{constructor(e){this.appRef=e.injector.get(r.g)}timeChangeDetection(e){const t=e&&e.record,n="Change Detection",r=null!=Y.console.profile;t&&r&&Y.console.profile(n);const s=Object(i.L)().performanceNow();let o=0;for(;o<5||Object(i.L)().performanceNow()-s<500;)this.appRef.tick(),o++;const a=Object(i.L)().performanceNow();t&&r&&Y.console.profileEnd(n);const c=(a-s)/o;return Y.console.log(`ran ${o} change detection cycles`),Y.console.log(`${c.toFixed(2)} ms per check`),new N(c,o)}}function $(e){return"profiler",t=new z(e),"undefined"!=typeof COMPILED&&COMPILED||((r.rb.ng=r.rb.ng||{}).profiler=t),e;var t}},cVYH:function(e,t,n){var i=n("Fib7"),r=n("hh1v"),s=n("0rvr");e.exports=function(e,t,n){var o,a;return s&&i(o=t.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&s(e,a),e}},cp0P:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n("HDdC"),r=n("DH7j"),s=n("lJxs"),o=n("XoHu"),a=n("Cfvw");function c(...e){if(1===e.length){const t=e[0];if(Object(r.a)(t))return l(t,null);if(Object(o.a)(t)&&Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);return l(e.map(e=>t[e]),e)}}if("function"==typeof e[e.length-1]){const t=e.pop();return l(e=1===e.length&&Object(r.a)(e[0])?e[0]:e,null).pipe(Object(s.a)(e=>t(...e)))}return l(e,null)}function l(e,t){return new i.a(n=>{const i=e.length;if(0===i)return void n.complete();const r=new Array(i);let s=0,o=0;for(let c=0;c<i;c++){const l=Object(a.a)(e[c]);let u=!1;n.add(l.subscribe({next:e=>{u||(u=!0,o++),r[c]=e},error:e=>n.error(e),complete:()=>{s++,s!==i&&u||(o===i&&n.next(t?t.reduce((e,t,n)=>(e[t]=r[n],e),{}):r),n.complete())}}))}})}},czMo:function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},"d+Og":function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=n("LvDl"),r=n.n(i),s=n("kJI8");let o=(()=>{class e{constructor(e){if(this.type=e,!this.isValidType())throw new Error("Wrong placement group category type");this.setTypeStates()}isValidType(){return e.VALID_CATEGORIES.includes(this.type)}setTypeStates(){switch(this.type){case e.CATEGORY_CLEAN:this.states=["active","clean"];break;case e.CATEGORY_WORKING:this.states=["activating","backfill_wait","backfilling","creating","deep","degraded","forced_backfill","forced_recovery","peering","peered","recovering","recovery_wait","repair","scrubbing","snaptrim","snaptrim_wait"];break;case e.CATEGORY_WARNING:this.states=["backfill_toofull","backfill_unfound","down","incomplete","inconsistent","recovery_toofull","recovery_unfound","remapped","snaptrim_error","stale","undersized"];break;default:this.states=[]}}}return e.CATEGORY_CLEAN="clean",e.CATEGORY_WORKING="working",e.CATEGORY_WARNING="warning",e.CATEGORY_UNKNOWN="unknown",e.VALID_CATEGORIES=[e.CATEGORY_CLEAN,e.CATEGORY_WORKING,e.CATEGORY_WARNING,e.CATEGORY_UNKNOWN],e})();var a=n("8Y7J");let c=(()=>{class e{constructor(){this.categories=this.createCategories()}getAllTypes(){return o.VALID_CATEGORIES}getTypeByStates(e){const t=this.getPgStatesFromText(e);if(0===t.length)return o.CATEGORY_UNKNOWN;const n=r.a.zipObject(o.VALID_CATEGORIES,o.VALID_CATEGORIES.map(e=>r.a.intersection(this.categories[e].states,t).length));if(n[o.CATEGORY_WARNING]>0)return o.CATEGORY_WARNING;const i=n[o.CATEGORY_WORKING];return t.length>n[o.CATEGORY_CLEAN]+i?o.CATEGORY_UNKNOWN:i?o.CATEGORY_WORKING:o.CATEGORY_CLEAN}createCategories(){return r.a.zipObject(o.VALID_CATEGORIES,o.VALID_CATEGORIES.map(e=>new o(e)))}getPgStatesFromText(e){const t=e.replace(/[^a-z]+/g," ").trim().split(" ");return r.a.uniq(t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=a.Nb({token:e,factory:e.\u0275fac,providedIn:s.a}),e})()},"dBg+":function(e,t){t.f=Object.getOwnPropertySymbols},dEH0:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){return`${e} ms`}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"milliseconds",type:e,pure:!0}),e})()},dLWn:function(e,t,n){"use strict";var i=Function.prototype.toString;t.a=function(e){if(null!=e){try{return i.call(e)}catch(t){}try{return e+""}catch(t){}}return""}},dNwA:function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("wd/R"))},dgut:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("NEZu"),r=n("Fgil"),s=n("8Y7J"),o=n("SVse"),a=n("hrfs");const c=["sparkCanvas"],l=["sparkTooltip"];let u=(()=>{class e{constructor(e){this.dimlessBinaryPipe=e,this.style={height:"30px",width:"100px"},this.colors=[{backgroundColor:"rgba(40,140,234,0.2)",borderColor:"rgba(40,140,234,1)",pointBackgroundColor:"rgba(40,140,234,1)",pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:"rgba(40,140,234,0.8)"}],this.options={animation:{duration:0},responsive:!0,maintainAspectRatio:!1,legend:{display:!1},elements:{line:{borderWidth:1}},tooltips:{enabled:!1,mode:"index",intersect:!1,custom:void 0,callbacks:{label:e=>this.isBinary?this.dimlessBinaryPipe.transform(e.yLabel):e.yLabel,title:()=>""}},scales:{yAxes:[{display:!1}],xAxes:[{display:!1}]}},this.datasets=[{data:[]}],this.labels=[]}ngOnInit(){const e=new i.a(this.chartCanvasRef,this.chartTooltipRef,(e,t)=>t+e.caretX+"px",e=>e.caretY-e.height-e.yPadding-5+"px");e.customColors={backgroundColor:this.colors[0].pointBackgroundColor,borderColor:this.colors[0].pointBorderColor},this.options.tooltips.custom=t=>{e.customTooltips(t)}}ngOnChanges(e){this.datasets[0].data=e.data.currentValue,this.labels=[...Array(e.data.currentValue.length)]}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(r.a))},e.\u0275cmp=s.Lb({type:e,selectors:[["cd-sparkline"]],viewQuery:function(e,t){if(1&e&&(s.Wc(c,3),s.Wc(l,3)),2&e){let e;s.Ec(e=s.mc())&&(t.chartCanvasRef=e.first),s.Ec(e=s.mc())&&(t.chartTooltipRef=e.first)}},inputs:{data:"data",style:"style",isBinary:"isBinary"},features:[s.Bb],decls:6,vars:6,consts:[[1,"chart-container",3,"ngStyle"],["baseChart","",3,"labels","datasets","options","colors","chartType"],["sparkCanvas",""],[1,"chartjs-tooltip"],["sparkTooltip",""]],template:function(e,t){1&e&&(s.Xb(0,"div",0),s.Sb(1,"canvas",1,2),s.Xb(3,"div",3,4),s.Sb(5,"table"),s.Wb(),s.Wb()),2&e&&(s.uc("ngStyle",t.style),s.Db(1),s.uc("labels",t.labels)("datasets",t.datasets)("options",t.options)("colors",t.colors)("chartType","line"))},directives:[o.s,a.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:#000000b3;border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid #0000;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-container[_ngcontent-%COMP%]{position:static!important}']}),e})()},"e+ae":function(e,t,n){!function(e){"use strict";var t="janu\xe1r_febru\xe1r_marec_apr\xedl_m\xe1j_j\xfan_j\xfal_august_september_okt\xf3ber_november_december".split("_"),n="jan_feb_mar_apr_m\xe1j_j\xfan_j\xfal_aug_sep_okt_nov_dec".split("_");function i(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"p\xe1r sek\xfand":"p\xe1r sekundami";case"ss":return t||r?s+(i(e)?"sekundy":"sek\xfand"):s+"sekundami";case"m":return t?"min\xfata":r?"min\xfatu":"min\xfatou";case"mm":return t||r?s+(i(e)?"min\xfaty":"min\xfat"):s+"min\xfatami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(i(e)?"hodiny":"hod\xedn"):s+"hodinami";case"d":return t||r?"de\u0148":"d\u0148om";case"dd":return t||r?s+(i(e)?"dni":"dn\xed"):s+"d\u0148ami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(i(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(i(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nede\u013ea_pondelok_utorok_streda_\u0161tvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_\u0161t_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_\u0161t_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nede\u013eu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo \u0161tvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[v\u010dera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minul\xfa nede\u013eu o] LT";case 1:case 2:return"[minul\xfd] dddd [o] LT";case 3:return"[minul\xfa stredu o] LT";case 4:case 5:return"[minul\xfd] dddd [o] LT";case 6:return"[minul\xfa sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},e0ae:function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=function(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"},r=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},s=function(e,t,n,i){this.name=e,this.version=t,this.os=n,this.bot=i,this.type="bot-device"},o=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},a=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],u=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function d(e){return e?h(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new a:"undefined"!=typeof navigator?h(navigator.userAgent):"undefined"!=typeof process&&process.version?new r(process.version.slice(1)):null}function h(e){var t=function(e){return""!==e&&l.reduce(function(t,n){var i=n[0];if(t)return t;var r=n[1].exec(e);return!!r&&[i,r]},!1)}(e);if(!t)return null;var n=t[0],r=t[1];if("searchbot"===n)return new o;var a=r[1]&&r[1].split(/[._]/).slice(0,3);a?a.length<3&&(a=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,r++)i[r]=s[o];return i}(a,function(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}(3-a.length))):a=[];var d=a.join("."),h=function(e){for(var t=0,n=u.length;t<n;t++){var i=u[t],r=i[0];if(i[1].exec(e))return r}return null}(e),f=c.exec(e);return f&&f[1]?new s(n,d,h,f[1]):new i(n,d,h)}},e2NH:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e="light",t=""){this.type=e,this.msg=t}}},eAQQ:function(e,t,n){"use strict";t.a=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},"eCU+":function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("mrSG"),r=n("IheW"),s=n("5+tZ"),o=n("lJxs"),a=n("9xzX"),c=n("xTzq"),l=n("8Y7J");let u=(()=>{let e=class{constructor(e,t){this.http=e,this.rgwDaemonService=t,this.url="api/rgw/site"}get(e){return this.rgwDaemonService.request(t=>(e&&(t=t.append("query",e)),this.http.get(this.url,{params:t})))}isDefaultRealm(){return this.get("default-realm").pipe(Object(s.a)(e=>this.rgwDaemonService.selectedDaemon$.pipe(Object(o.a)(t=>t.realm_name===e))))}};return e.\u0275fac=function(t){return new(t||e)(l.ic(r.b),l.ic(a.a))},e.\u0275prov=l.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(i.b)([c.a,Object(i.d)("design:paramtypes",[r.b,a.a])],e),e})()},"eDl+":function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},eFrH:function(e,t,n){var i=n("zBJ4")("span").classList,r=i&&i.constructor&&i.constructor.prototype;e.exports=r===Object.prototype?void 0:r},eIep:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("lJxs"),r=n("Cfvw"),s=n("zx2A");function o(e,t){return"function"==typeof t?n=>n.pipe(o((n,s)=>Object(r.a)(e(n,s)).pipe(Object(i.a)((e,i)=>t(n,e,s,i))))):t=>t.lift(new a(e))}class a{constructor(e){this.project=e}call(e,t){return t.subscribe(new c(e,this.project))}}class c extends s.b{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(i){return void this.destination.error(i)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const n=new s.a(this),i=this.destination;i.add(n),this.innerSubscription=Object(s.c)(e,n),this.innerSubscription!==n&&i.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}},efK2:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t,n){return r.a.isString(e)?(n=r.a.defaultTo(n,""),r.a.truncate(e,{length:t,omission:n})):e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"truncate",type:e,pure:!0}),e})()},"ej+x":function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("lOp/"),r=n("8Y7J"),s=n("IheW");let o=(()=>{class e{constructor(e,t){this.http=e,this.timerService=t,this.API_URL="api/feature_toggles",this.REFRESH_INTERVAL=3e4,this.featureToggleMap$=this.timerService.get(()=>this.http.get(this.API_URL),this.REFRESH_INTERVAL)}get(){return this.featureToggleMap$}}return e.\u0275fac=function(t){return new(t||e)(r.ic(s.b),r.ic(i.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},ewvW:function(e,t,n){var i=n("2oRo"),r=n("HYAF"),s=i.Object;e.exports=function(e){return s(r(e))}},"f/UV":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["","cdFormScope",""]],inputs:{cdFormScope:"cdFormScope"}}),e})()},f5p1:function(e,t,n){var i=n("2oRo"),r=n("Fib7"),s=n("iSVu"),o=i.WeakMap;e.exports=r(o)&&/native code/.test(s(o))},f69J:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("s7LF");let s=(()=>{class e{constructor(e){this.parent=e}get validClass(){return!!this.control&&this.control.valid&&(this.control.touched||this.control.dirty)}get invalidClass(){return!!this.control&&this.control.invalid&&this.control.touched&&this.control.dirty}get path(){return[...this.parent.path,this.formControlName]}get control(){return this.formDirective&&this.formDirective.getControl(this)}get formDirective(){return this.parent?this.parent.formDirective:null}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(r.c,13))},e.\u0275dir=i.Mb({type:e,selectors:[["",8,"form-control"],["",8,"form-check-input"],["",8,"custom-control-input"]],hostVars:4,hostBindings:function(e,t){2&e&&i.Jb("is-valid",t.validClass)("is-invalid",t.invalidClass)},inputs:{formControlName:"formControlName",formControl:"formControl"}}),e})()},fHMY:function(e,t,n){var i,r=n("glrk"),s=n("N+g0"),o=n("eDl+"),a=n("0BK2"),c=n("G+Rx"),l=n("zBJ4"),u=n("93I0")("IE_PROTO"),d=function(){},h=function(e){return"<script>"+e+"<\/script>"},f=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},p=function(){try{i=new ActiveXObject("htmlfile")}catch(r){}var e,t;p="undefined"!=typeof document?document.domain&&i?f(i):((t=l("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):f(i);for(var n=o.length;n--;)delete p.prototype[o[n]];return p()};a[u]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(d.prototype=r(e),n=new d,d.prototype=null,n[u]=e):n=p(),void 0===t?n:s(n,t)}},fdAy:function(e,t,n){"use strict";var i=n("I+eb"),r=n("xluM"),s=n("xDBR"),o=n("Xnc8"),a=n("Fib7"),c=n("ntOU"),l=n("4WOD"),u=n("0rvr"),d=n("1E5z"),h=n("kRJp"),f=n("busE"),p=n("tiKp"),m=n("P4y1"),b=n("rpNk"),g=o.PROPER,_=o.CONFIGURABLE,v=b.IteratorPrototype,y=b.BUGGY_SAFARI_ITERATORS,w=p("iterator"),D="keys",S="values",x="entries",k=function(){return this};e.exports=function(e,t,n,o,p,b,T){c(n,t,o);var M,C,O,L=function(e){if(e===p&&P)return P;if(!y&&e in I)return I[e];switch(e){case D:case S:case x:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",A=!1,I=e.prototype,R=I[w]||I["@@iterator"]||p&&I[p],P=!y&&R||L(p),F="Array"==t&&I.entries||R;if(F&&(M=l(F.call(new e)))!==Object.prototype&&M.next&&(s||l(M)===v||(u?u(M,v):a(M[w])||f(M,w,k)),d(M,E,!0,!0),s&&(m[E]=k)),g&&p==S&&R&&R.name!==S&&(!s&&_?h(I,"name",S):(A=!0,P=function(){return r(R,this)})),p)if(C={values:L(S),keys:b?P:L(D),entries:L(x)},T)for(O in C)(y||A||!(O in I))&&f(I,O,C[O]);else i({target:t,proto:!0,forced:y||A},C);return s&&!T||I[w]===P||f(I,w,P,{name:p}),m[t]=P,C}},fzPg:function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"S\u1eb9\u0301r\u1eb9\u0301_E\u0300re\u0300le\u0300_\u1eb8r\u1eb9\u0300na\u0300_I\u0300gbe\u0301_E\u0300bibi_O\u0300ku\u0300du_Ag\u1eb9mo_O\u0300gu\u0301n_Owewe_\u1ecc\u0300wa\u0300ra\u0300_Be\u0301lu\u0301_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),monthsShort:"S\u1eb9\u0301r_E\u0300rl_\u1eb8rn_I\u0300gb_E\u0300bi_O\u0300ku\u0300_Ag\u1eb9_O\u0300gu\u0301_Owe_\u1ecc\u0300wa\u0300_Be\u0301l_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),weekdays:"A\u0300i\u0300ku\u0301_Aje\u0301_I\u0300s\u1eb9\u0301gun_\u1eccj\u1ecd\u0301ru\u0301_\u1eccj\u1ecd\u0301b\u1ecd_\u1eb8ti\u0300_A\u0300ba\u0301m\u1eb9\u0301ta".split("_"),weekdaysShort:"A\u0300i\u0300k_Aje\u0301_I\u0300s\u1eb9\u0301_\u1eccjr_\u1eccjb_\u1eb8ti\u0300_A\u0300ba\u0301".split("_"),weekdaysMin:"A\u0300i\u0300_Aj_I\u0300s_\u1eccr_\u1eccb_\u1eb8t_A\u0300b".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[O\u0300ni\u0300 ni] LT",nextDay:"[\u1ecc\u0300la ni] LT",nextWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301n'b\u1ecd] [ni] LT",lastDay:"[A\u0300na ni] LT",lastWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301l\u1ecd\u0301] [ni] LT",sameElse:"L"},relativeTime:{future:"ni\u0301 %s",past:"%s k\u1ecdja\u0301",s:"i\u0300s\u1eb9ju\u0301 aaya\u0301 die",ss:"aaya\u0301 %d",m:"i\u0300s\u1eb9ju\u0301 kan",mm:"i\u0300s\u1eb9ju\u0301 %d",h:"wa\u0301kati kan",hh:"wa\u0301kati %d",d:"\u1ecdj\u1ecd\u0301 kan",dd:"\u1ecdj\u1ecd\u0301 %d",M:"osu\u0300 kan",MM:"osu\u0300 %d",y:"\u1ecddu\u0301n kan",yy:"\u1ecddu\u0301n %d"},dayOfMonthOrdinalParse:/\u1ecdj\u1ecd\u0301\s\d{1,2}/,ordinal:"\u1ecdj\u1ecd\u0301 %d",week:{dow:1,doy:4}})}(n("wd/R"))},"g6v/":function(e,t,n){var i=n("0Dky");e.exports=!i(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},gRHU:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("2fFW"),r=n("NJ4a");const s={closed:!0,next(e){},error(e){if(i.a.useDeprecatedSynchronousErrorHandling)throw e;Object(r.a)(e)},complete(){}}},gVVK:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r=e+" ";switch(n){case"s":return t||i?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||i?"sekundi":"sekundah":e<5?t||i?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||i?"minuti":"minutama":e<5?t||i?"minute":"minutami":t||i?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||i?"uri":"urama":e<5?t||i?"ure":"urami":t||i?"ur":"urami");case"d":return t||i?"en dan":"enim dnem";case"dd":return r+(1===e?t||i?"dan":"dnem":2===e?t||i?"dni":"dnevoma":t||i?"dni":"dnevi");case"M":return t||i?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||i?"mesec":"mesecem":2===e?t||i?"meseca":"mesecema":e<5?t||i?"mesece":"meseci":t||i?"mesecev":"meseci");case"y":return t||i?"eno leto":"enim letom";case"yy":return r+(1===e?t||i?"leto":"letom":2===e?t||i?"leti":"letoma":e<5?t||i?"leta":"leti":t||i?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_\u010detrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._\u010det._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_\u010de_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[v\u010deraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prej\u0161njo] [nedeljo] [ob] LT";case 3:return"[prej\u0161njo] [sredo] [ob] LT";case 6:return"[prej\u0161njo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prej\u0161nji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"\u010dez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},gekB:function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme nelj\xe4 viisi kuusi seitsem\xe4n kahdeksan yhdeks\xe4n".split(" "),n=["nolla","yhden","kahden","kolmen","nelj\xe4n","viiden","kuuden",t[7],t[8],t[9]];function i(e,i,r,s){var o="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":o=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":o=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":o=s?"tunnin":"tuntia";break;case"d":return s?"p\xe4iv\xe4n":"p\xe4iv\xe4";case"dd":o=s?"p\xe4iv\xe4n":"p\xe4iv\xe4\xe4";break;case"M":return s?"kuukauden":"kuukausi";case"MM":o=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":o=s?"vuoden":"vuotta"}return function(e,i){return e<10?i?n[e]:t[e]:e}(e,s)+" "+o}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xe4kuu_hein\xe4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kes\xe4_hein\xe4_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[t\xe4n\xe4\xe4n] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s p\xe4\xe4st\xe4",past:"%s sitten",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},gjCT:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"};e.defineLocale("ar-sa",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,function(e){return n[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"\u060c")},week:{dow:0,doy:6}})}(n("wd/R"))},glrk:function(e,t,n){var i=n("2oRo"),r=n("hh1v"),s=i.String,o=i.TypeError;e.exports=function(e){if(r(e))return e;throw o(s(e)+" is not an object")}},"hKI/":function(e,t){var n="Expected a function",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype.toString,h=Math.max,f=Math.min,p=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||o.test(e)?a(e.slice(2),n?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,i){var r=!0,s=!0;if("function"!=typeof e)throw new TypeError(n);return m(i)&&(r="leading"in i?!!i.leading:r,s="trailing"in i?!!i.trailing:s),function(e,t,i){var r,s,o,a,c,l,u=0,d=!1,g=!1,_=!0;if("function"!=typeof e)throw new TypeError(n);function v(t){var n=r,i=s;return r=s=void 0,u=t,a=e.apply(i,n)}function y(e){return u=e,c=setTimeout(D,t),d?v(e):a}function w(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-u>=o}function D(){var e=p();if(w(e))return S(e);c=setTimeout(D,function(e){var n=t-(e-l);return g?f(n,o-(e-u)):n}(e))}function S(e){return c=void 0,_&&r?v(e):(r=s=void 0,a)}function x(){var e=p(),n=w(e);if(r=arguments,s=this,l=e,n){if(void 0===c)return y(l);if(g)return c=setTimeout(D,t),v(l)}return void 0===c&&(c=setTimeout(D,t)),a}return t=b(t)||0,m(i)&&(d=!!i.leading,o=(g="maxWait"in i)?h(b(i.maxWait)||0,t):o,_="trailing"in i?!!i.trailing:_),x.cancel=function(){void 0!==c&&clearTimeout(c),u=0,r=l=s=c=void 0},x.flush=function(){return void 0===c?a:S(p())},x}(e,t,{leading:r,maxWait:t,trailing:s})}},hKrs:function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"\u044f\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u044f\u043d\u0443_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u044f\u0434\u0430_\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a_\u043f\u0435\u0442\u044a\u043a_\u0441\u044a\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u044f_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u044a\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u043d\u0435\u0441 \u0432] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432] LT",nextWeek:"dddd [\u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u041c\u0438\u043d\u0430\u043b\u0430\u0442\u0430] dddd [\u0432] LT";case 1:case 2:case 4:case 5:return"[\u041c\u0438\u043d\u0430\u043b\u0438\u044f] dddd [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0441\u043b\u0435\u0434 %s",past:"\u043f\u0440\u0435\u0434\u0438 %s",s:"\u043d\u044f\u043a\u043e\u043b\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",w:"\u0441\u0435\u0434\u043c\u0438\u0446\u0430",ww:"%d \u0441\u0435\u0434\u043c\u0438\u0446\u0438",M:"\u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0430",y:"\u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},hYPf:function(e,t,n){"use strict";var i=n("IzLi"),r=Object.create,s=function(){function e(){}return function(t){if(!Object(i.a)(t))return{};if(r)return r(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),o=n("UudT"),a=n("pyRK");t.a=function(e){return"function"!=typeof e.constructor||Object(a.a)(e)?{}:s(Object(o.a)(e))}},hh1v:function(e,t,n){var i=n("Fib7");e.exports=function(e){return"object"==typeof e?null!==e:i(e)}},honF:function(e,t,n){!function(e){"use strict";var t={1:"\u1041",2:"\u1042",3:"\u1043",4:"\u1044",5:"\u1045",6:"\u1046",7:"\u1047",8:"\u1048",9:"\u1049",0:"\u1040"},n={"\u1041":"1","\u1042":"2","\u1043":"3","\u1044":"4","\u1045":"5","\u1046":"6","\u1047":"7","\u1048":"8","\u1049":"9","\u1040":"0"};e.defineLocale("my",{months:"\u1007\u1014\u103a\u1014\u101d\u102b\u101b\u102e_\u1016\u1031\u1016\u1031\u102c\u103a\u101d\u102b\u101b\u102e_\u1019\u1010\u103a_\u1027\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u1007\u1030\u101c\u102d\u102f\u1004\u103a_\u101e\u103c\u1002\u102f\u1010\u103a_\u1005\u1000\u103a\u1010\u1004\u103a\u1018\u102c_\u1021\u1031\u102c\u1000\u103a\u1010\u102d\u102f\u1018\u102c_\u1014\u102d\u102f\u101d\u1004\u103a\u1018\u102c_\u1012\u102e\u1007\u1004\u103a\u1018\u102c".split("_"),monthsShort:"\u1007\u1014\u103a_\u1016\u1031_\u1019\u1010\u103a_\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u101c\u102d\u102f\u1004\u103a_\u101e\u103c_\u1005\u1000\u103a_\u1021\u1031\u102c\u1000\u103a_\u1014\u102d\u102f_\u1012\u102e".split("_"),weekdays:"\u1010\u1014\u1004\u103a\u1039\u1002\u1014\u103d\u1031_\u1010\u1014\u1004\u103a\u1039\u101c\u102c_\u1021\u1004\u103a\u1039\u1002\u102b_\u1017\u102f\u1012\u1039\u1013\u101f\u1030\u1038_\u1000\u103c\u102c\u101e\u1015\u1010\u1031\u1038_\u101e\u1031\u102c\u1000\u103c\u102c_\u1005\u1014\u1031".split("_"),weekdaysShort:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),weekdaysMin:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u101a\u1014\u1031.] LT [\u1019\u103e\u102c]",nextDay:"[\u1019\u1014\u1000\u103a\u1016\u103c\u1014\u103a] LT [\u1019\u103e\u102c]",nextWeek:"dddd LT [\u1019\u103e\u102c]",lastDay:"[\u1019\u1014\u1031.\u1000] LT [\u1019\u103e\u102c]",lastWeek:"[\u1015\u103c\u102e\u1038\u1001\u1032\u1037\u101e\u1031\u102c] dddd LT [\u1019\u103e\u102c]",sameElse:"L"},relativeTime:{future:"\u101c\u102c\u1019\u100a\u103a\u1037 %s \u1019\u103e\u102c",past:"\u101c\u103d\u1014\u103a\u1001\u1032\u1037\u101e\u1031\u102c %s \u1000",s:"\u1005\u1000\u1039\u1000\u1014\u103a.\u1021\u1014\u100a\u103a\u1038\u1004\u101a\u103a",ss:"%d \u1005\u1000\u1039\u1000\u1014\u1037\u103a",m:"\u1010\u1005\u103a\u1019\u102d\u1014\u1005\u103a",mm:"%d \u1019\u102d\u1014\u1005\u103a",h:"\u1010\u1005\u103a\u1014\u102c\u101b\u102e",hh:"%d \u1014\u102c\u101b\u102e",d:"\u1010\u1005\u103a\u101b\u1000\u103a",dd:"%d \u101b\u1000\u103a",M:"\u1010\u1005\u103a\u101c",MM:"%d \u101c",y:"\u1010\u1005\u103a\u1014\u103e\u1005\u103a",yy:"%d \u1014\u103e\u1005\u103a"},preparse:function(e){return e.replace(/[\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049\u1040]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})}(n("wd/R"))},hrfs:function(e,t,n){"use strict";n.d(t,"a",function(){return b}),n.d(t,"b",function(){return g});var i=n("8Y7J"),r=n("2Vo4"),s=n("CfRg"),o=n("MO+k");const a=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]];function c(e,t){return"rgba("+e.concat(t).join(",")+")"}function l(e,t){return Math.floor(Math.random()*(t-e+1))+e}function u(e){return{backgroundColor:e.map(e=>c(e,.6)),borderColor:e.map(()=>"#fff"),pointBackgroundColor:e.map(e=>c(e,1)),pointBorderColor:e.map(()=>"#fff"),pointHoverBackgroundColor:e.map(e=>c(e,1)),pointHoverBorderColor:e.map(e=>c(e,1))}}function d(){return[l(0,255),l(0,255),l(0,255)]}function h(e){return a[e]||d()}function f(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=a[n]||d();return t}let p=(()=>{class e{constructor(){this.pColorschemesOptions={},this.colorschemesOptions=new r.a({})}setColorschemesOptions(e){this.pColorschemesOptions=e,this.colorschemesOptions.next(e)}getColorschemesOptions(){return this.pColorschemesOptions}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const m={Default:0,Update:1,Refresh:2};m[m.Default]="Default",m[m.Update]="Update",m[m.Refresh]="Refresh";let b=(()=>{class e{constructor(e,t){this.element=e,this.themeService=t,this.options={},this.chartClick=new i.p,this.chartHover=new i.p,this.old={dataExists:!1,dataLength:0,datasetsExists:!1,datasetsLength:0,datasetsDataObjects:[],datasetsDataLengths:[],colorsExists:!1,colors:[],labelsExist:!1,labels:[],legendExists:!1,legend:{}},this.subs=[]}static registerPlugin(e){o.pluginService.register(e)}static unregisterPlugin(e){o.pluginService.unregister(e)}ngOnInit(){this.ctx=this.element.nativeElement.getContext("2d"),this.refresh(),this.subs.push(this.themeService.colorschemesOptions.subscribe(e=>this.themeChanged(e)))}themeChanged(e){this.refresh()}ngDoCheck(){if(!this.chart)return;let e=m.Default;const t=t=>{e=t>e?t:e};switch(!!this.data!==this.old.dataExists&&(this.propagateDataToDatasets(this.data),this.old.dataExists=!!this.data,t(m.Update)),this.data&&this.data.length!==this.old.dataLength&&(this.old.dataLength=this.data&&this.data.length||0,t(m.Update)),!!this.datasets!==this.old.datasetsExists&&(this.old.datasetsExists=!!this.datasets,t(m.Update)),this.datasets&&this.datasets.length!==this.old.datasetsLength&&(this.old.datasetsLength=this.datasets&&this.datasets.length||0,t(m.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data!==this.old.datasetsDataObjects[t]).length&&(this.old.datasetsDataObjects=this.datasets.map(e=>e.data),t(m.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data.length!==this.old.datasetsDataLengths[t]).length&&(this.old.datasetsDataLengths=this.datasets.map(e=>e.data.length),t(m.Update)),!!this.colors!==this.old.colorsExists&&(this.old.colorsExists=!!this.colors,this.updateColors(),t(m.Update)),this.colors&&this.colors.filter((e,t)=>!this.colorsEqual(e,this.old.colors[t])).length&&(this.old.colors=this.colors.map(e=>this.copyColor(e)),this.updateColors(),t(m.Update)),!!this.labels!==this.old.labelsExist&&(this.old.labelsExist=!!this.labels,t(m.Update)),this.labels&&this.labels.filter((e,t)=>!this.labelsEqual(e,this.old.labels[t])).length&&(this.old.labels=this.labels.map(e=>this.copyLabel(e)),t(m.Update)),!!this.options.legend!==this.old.legendExists&&(this.old.legendExists=!!this.options.legend,t(m.Refresh)),this.options.legend&&this.options.legend.position!==this.old.legend.position&&(this.old.legend.position=this.options.legend.position,t(m.Refresh)),e){case m.Default:break;case m.Update:this.update();break;case m.Refresh:this.refresh()}}copyLabel(e){return Array.isArray(e)?[...e]:e}labelsEqual(e,t){return Array.isArray(e)===Array.isArray(t)&&(Array.isArray(e)||e===t)&&(!Array.isArray(e)||e.length===t.length)&&(!Array.isArray(e)||0===e.filter((e,n)=>e!==t[n]).length)}copyColor(e){return{backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderColor:e.borderColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,pointBorderColor:e.pointBorderColor,pointBackgroundColor:e.pointBackgroundColor,pointBorderWidth:e.pointBorderWidth,pointRadius:e.pointRadius,pointHoverRadius:e.pointHoverRadius,pointHitRadius:e.pointHitRadius,pointHoverBackgroundColor:e.pointHoverBackgroundColor,pointHoverBorderColor:e.pointHoverBorderColor,pointHoverBorderWidth:e.pointHoverBorderWidth,pointStyle:e.pointStyle,hoverBackgroundColor:e.hoverBackgroundColor,hoverBorderColor:e.hoverBorderColor,hoverBorderWidth:e.hoverBorderWidth}}colorsEqual(e,t){return!e==!t&&(!e||e.backgroundColor===t.backgroundColor&&e.borderWidth===t.borderWidth&&e.borderColor===t.borderColor&&e.borderCapStyle===t.borderCapStyle&&e.borderDash===t.borderDash&&e.borderDashOffset===t.borderDashOffset&&e.borderJoinStyle===t.borderJoinStyle&&e.pointBorderColor===t.pointBorderColor&&e.pointBackgroundColor===t.pointBackgroundColor&&e.pointBorderWidth===t.pointBorderWidth&&e.pointRadius===t.pointRadius&&e.pointHoverRadius===t.pointHoverRadius&&e.pointHitRadius===t.pointHitRadius&&e.pointHoverBackgroundColor===t.pointHoverBackgroundColor&&e.pointHoverBorderColor===t.pointHoverBorderColor&&e.pointHoverBorderWidth===t.pointHoverBorderWidth&&e.pointStyle===t.pointStyle&&e.hoverBackgroundColor===t.hoverBackgroundColor&&e.hoverBorderColor===t.hoverBorderColor&&e.hoverBorderWidth===t.hoverBorderWidth)}updateColors(){this.datasets.forEach((e,t)=>{this.colors&&this.colors[t]?Object.assign(e,this.colors[t]):Object.assign(e,function(e,t,n){if("pie"===e||"doughnut"===e)return u(f(n));if("polarArea"===e)return{backgroundColor:(i=f(n)).map(e=>c(e,.6)),borderColor:i.map(e=>c(e,1)),hoverBackgroundColor:i.map(e=>c(e,.8)),hoverBorderColor:i.map(e=>c(e,1))};var i;if("line"===e||"radar"===e)return function(e){return{backgroundColor:c(e,.4),borderColor:c(e,1),pointBackgroundColor:c(e,1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:c(e,.8)}}(h(t));if("bar"===e||"horizontalBar"===e)return function(e){return{backgroundColor:c(e,.6),borderColor:c(e,1),hoverBackgroundColor:c(e,.8),hoverBorderColor:c(e,1)}}(h(t));if("bubble"===e)return u(f(n));if("scatter"===e)return u(f(n));throw new Error(`getColors - Unsupported chart type ${e}`)}(this.chartType,t,e.data.length),Object.assign({},e))})}ngOnChanges(e){let t=m.Default;const n=e=>{t=e>t?e:t};switch(e.hasOwnProperty("data")&&e.data.currentValue&&(this.propagateDataToDatasets(e.data.currentValue),n(m.Update)),e.hasOwnProperty("datasets")&&e.datasets.currentValue&&(this.propagateDatasetsToData(e.datasets.currentValue),n(m.Update)),e.hasOwnProperty("labels")&&(this.chart&&(this.chart.data.labels=e.labels.currentValue),n(m.Update)),e.hasOwnProperty("legend")&&(this.chart&&(this.chart.config.options.legend.display=e.legend.currentValue,this.chart.generateLegend()),n(m.Update)),e.hasOwnProperty("options")&&n(m.Refresh),t){case m.Update:this.update();break;case m.Refresh:case m.Default:this.refresh()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(e=>e.unsubscribe())}update(e){if(this.chart)return this.chart.update(e)}hideDataset(e,t){this.chart.getDatasetMeta(e).hidden=t,this.chart.update()}isDatasetHidden(e){return this.chart.getDatasetMeta(e).hidden}toBase64Image(){return this.chart.toBase64Image()}getChartConfiguration(){const e=this.getDatasets(),t=Object.assign({},this.options);!1===this.legend&&(t.legend={display:!1}),t.hover=t.hover||{},t.hover.onHover||(t.hover.onHover=(e,t)=>{t&&!t.length||this.chartHover.emit({event:e,active:t})}),t.onClick||(t.onClick=(e,t)=>{this.chartClick.emit({event:e,active:t})});const n=this.smartMerge(t,this.themeService.getColorschemesOptions());return{type:this.chartType,data:{labels:this.labels||[],datasets:e},plugins:this.plugins,options:n}}getChartBuilder(e){const t=this.getChartConfiguration();return new o.Chart(e,t)}smartMerge(e,t,n=0){var i;if(0===n&&(i=e,e=Object(s.a)(i,5)),Object.keys(t).forEach(i=>{if(Array.isArray(t[i])){const r=e[i];r&&r.forEach(e=>{this.smartMerge(e,t[i][0],n+1)})}else"object"==typeof t[i]?(i in e||(e[i]={}),this.smartMerge(e[i],t[i],n+1)):e[i]=t[i]}),0===n)return e}isMultiLineLabel(e){return Array.isArray(e)}joinLabel(e){return e?this.isMultiLineLabel(e)?e.join(" "):e:null}propagateDatasetsToData(e){this.data=this.datasets.map(e=>e.data),this.chart&&(this.chart.data.datasets=e),this.updateColors()}propagateDataToDatasets(e){this.isMultiDataSet(e)?this.datasets&&e.length===this.datasets.length?this.datasets.forEach((t,n)=>{t.data=e[n]}):(this.datasets=e.map((e,t)=>({data:e,label:this.joinLabel(this.labels[t])||`Label ${t}`})),this.chart&&(this.chart.data.datasets=this.datasets)):this.datasets?(this.datasets[0]||(this.datasets[0]={}),this.datasets[0].data=e,this.datasets.splice(1)):(this.datasets=[{data:e}],this.chart&&(this.chart.data.datasets=this.datasets)),this.updateColors()}isMultiDataSet(e){return Array.isArray(e[0])}getDatasets(){if(!this.datasets&&!this.data)throw new Error(`ng-charts configuration error, data or datasets field are required to render chart ${this.chartType}`);return this.datasets?(this.propagateDatasetsToData(this.datasets),this.datasets):this.data?(this.propagateDataToDatasets(this.data),this.datasets):void 0}refresh(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.ctx&&(this.chart=this.getChartBuilder(this.ctx))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(p))},e.\u0275dir=i.Mb({type:e,selectors:[["canvas","baseChart",""]],inputs:{options:"options",data:"data",datasets:"datasets",labels:"labels",chartType:"chartType",colors:"colors",legend:"legend",plugins:"plugins"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[i.Bb]}),e})(),g=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[[]]}),e})()},iEDd:function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xu\xf1o_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xu\xf1._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_m\xe9rcores_xoves_venres_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._m\xe9r._xov._ven._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_m\xe9_xo_ve_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextDay:function(){return"[ma\xf1\xe1 "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"\xe1s":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"\xe1":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"\xe1s":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},iExv:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e,t="Yes",n="No"){return Boolean(e)?t:n}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"booleanText",type:e,pure:!0}),e})()},iInd:function(e,t,n){"use strict";n.d(t,"a",function(){return We}),n.d(t,"b",function(){return R}),n.d(t,"c",function(){return I}),n.d(t,"d",function(){return hn}),n.d(t,"e",function(){return rn}),n.d(t,"f",function(){return sn}),n.d(t,"g",function(){return cn}),n.d(t,"h",function(){return on}),n.d(t,"i",function(){return yn}),n.d(t,"j",function(){return ln});var i=n("SVse"),r=n("8Y7J"),s=n("Cfvw"),o=n("LRne"),a=n("2Vo4"),c=n("itXk"),l=n("HDdC"),u=n("sVev"),d=n("GyhO"),h=n("EY2u");function f(e){return new l.a(t=>{let n;try{n=e()}catch(i){return void t.error(i)}return(n?Object(s.a)(n):Object(h.b)()).subscribe(t)})}var p=n("EQ5u"),m=n("XNiG"),b=n("lJxs"),g=n("eIep"),_=n("IzEk"),v=n("JX91"),y=n("Kqap"),w=n("pLZG"),D=n("JIr8"),S=n("bOdf"),x=n("NJ9Y"),k=n("SxV6"),T=n("5+tZ"),M=n("vkgz"),C=n("BFxc"),O=n("x+ZX"),L=n("nYR2"),E=n("bHdf");class A{constructor(e,t){this.id=e,this.url=t}}class I extends A{constructor(e,t,n="imperative",i=null){super(e,t),this.navigationTrigger=n,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class R extends A{constructor(e,t,n){super(e,t),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class P extends A{constructor(e,t,n){super(e,t),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class F extends A{constructor(e,t,n){super(e,t),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class W extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class j extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Y extends A{constructor(e,t,n,i,r){super(e,t),this.urlAfterRedirects=n,this.state=i,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class N extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class z extends A{constructor(e,t,n,i){super(e,t),this.urlAfterRedirects=n,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ${constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class H{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class X{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class V{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class B{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class U{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class q{constructor(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const G="primary";class J{constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function K(e){return new J(e)}function Q(e){const t=Error("NavigationCancelingError: "+e);return t.ngNavigationCancelingError=!0,t}function Z(e,t,n){const i=n.path.split("/");if(i.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||i.length<e.length))return null;const r={};for(let s=0;s<i.length;s++){const t=i[s],n=e[s];if(t.startsWith(":"))r[t.substring(1)]=n;else if(t!==n.path)return null}return{consumed:e.slice(0,i.length),posParams:r}}function ee(e,t){const n=e?Object.keys(e):void 0,i=t?Object.keys(t):void 0;if(!n||!i||n.length!=i.length)return!1;let r;for(let s=0;s<n.length;s++)if(r=n[s],!te(e[r],t[r]))return!1;return!0}function te(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;const n=[...e].sort(),i=[...t].sort();return n.every((e,t)=>i[t]===e)}return e===t}function ne(e){return Array.prototype.concat.apply([],e)}function ie(e){return e.length>0?e[e.length-1]:null}function re(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function se(e){return Object(r.tb)(e)?e:Object(r.ub)(e)?Object(s.a)(Promise.resolve(e)):Object(o.a)(e)}function oe(e,t,n){return n?function(e,t){return ee(e,t)}(e.queryParams,t.queryParams)&&ae(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>te(e[n],t[n]))}(e.queryParams,t.queryParams)&&ce(e.root,t.root)}function ae(e,t){if(!fe(e.segments,t.segments))return!1;if(e.numberOfChildren!==t.numberOfChildren)return!1;for(const n in t.children){if(!e.children[n])return!1;if(!ae(e.children[n],t.children[n]))return!1}return!0}function ce(e,t){return le(e,t,t.segments)}function le(e,t,n){if(e.segments.length>n.length)return!!fe(e.segments.slice(0,n.length),n)&&!t.hasChildren();if(e.segments.length===n.length){if(!fe(e.segments,n))return!1;for(const n in t.children){if(!e.children[n])return!1;if(!ce(e.children[n],t.children[n]))return!1}return!0}{const i=n.slice(0,e.segments.length),r=n.slice(e.segments.length);return!!fe(e.segments,i)&&!!e.children.primary&&le(e.children.primary,t,r)}}class ue{constructor(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=K(this.queryParams)),this._queryParamMap}toString(){return be.serialize(this)}}class de{constructor(e,t){this.segments=e,this.children=t,this.parent=null,re(t,(e,t)=>e.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return ge(this)}}class he{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=K(this.parameters)),this._parameterMap}toString(){return xe(this)}}function fe(e,t){return e.length===t.length&&e.every((e,n)=>e.path===t[n].path)}class pe{}class me{parse(e){const t=new Oe(e);return new ue(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){var t;return`/${_e(e.root,!0)}${function(e){const t=Object.keys(e).map(t=>{const n=e[t];return Array.isArray(n)?n.map(e=>`${ye(t)}=${ye(e)}`).join("&"):`${ye(t)}=${ye(n)}`});return t.length?`?${t.join("&")}`:""}(e.queryParams)}${"string"==typeof e.fragment?`#${t=e.fragment,encodeURI(t)}`:""}`}}const be=new me;function ge(e){return e.segments.map(e=>xe(e)).join("/")}function _e(e,t){if(!e.hasChildren())return ge(e);if(t){const t=e.children.primary?_e(e.children.primary,!1):"",n=[];return re(e.children,(e,t)=>{t!==G&&n.push(`${t}:${_e(e,!1)}`)}),n.length>0?`${t}(${n.join("//")})`:t}{const t=function(e,t){let n=[];return re(e.children,(e,i)=>{i===G&&(n=n.concat(t(e,i)))}),re(e.children,(e,i)=>{i!==G&&(n=n.concat(t(e,i)))}),n}(e,(t,n)=>n===G?[_e(e.children.primary,!1)]:[`${n}:${_e(t,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children.primary?`${ge(e)}/${t[0]}`:`${ge(e)}/(${t.join("//")})`}}function ve(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function ye(e){return ve(e).replace(/%3B/gi,";")}function we(e){return ve(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function De(e){return decodeURIComponent(e)}function Se(e){return De(e.replace(/\+/g,"%20"))}function xe(e){return`${we(e.path)}${t=e.parameters,Object.keys(t).map(e=>`;${we(e)}=${we(t[e])}`).join("")}`;var t}const ke=/^[^\/()?;=#]+/;function Te(e){const t=e.match(ke);return t?t[0]:""}const Me=/^[^=?&#]+/,Ce=/^[^?&#]+/;class Oe{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new de([],{}):new de([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n.primary=new de(e,t)),n}parseSegment(){const e=Te(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new he(De(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=Te(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=Te(this.remaining);e&&(n=e,this.capture(n))}e[De(t)]=De(n)}parseQueryParam(e){const t=function(e){const t=e.match(Me);return t?t[0]:""}(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=function(e){const t=e.match(Ce);return t?t[0]:""}(this.remaining);e&&(n=e,this.capture(n))}const i=Se(t),r=Se(n);if(e.hasOwnProperty(i)){let t=e[i];Array.isArray(t)||(t=[t],e[i]=t),t.push(r)}else e[i]=r}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=Te(this.remaining),i=this.remaining[n.length];if("/"!==i&&")"!==i&&";"!==i)throw new Error(`Cannot parse url '${this.url}'`);let r;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):e&&(r=G);const s=this.parseChildren();t[r]=1===Object.keys(s).length?s.primary:new de([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class Le{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=Ee(e,this._root);return t?t.children.map(e=>e.value):[]}firstChild(e){const t=Ee(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=Ae(e,this._root);return t.length<2?[]:t[t.length-2].children.map(e=>e.value).filter(t=>t!==e)}pathFromRoot(e){return Ae(e,this._root).map(e=>e.value)}}function Ee(e,t){if(e===t.value)return t;for(const n of t.children){const t=Ee(e,n);if(t)return t}return null}function Ae(e,t){if(e===t.value)return[t];for(const n of t.children){const i=Ae(e,n);if(i.length)return i.unshift(t),i}return[]}class Ie{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Re(e){const t={};return e&&e.children.forEach(e=>t[e.value.outlet]=e),t}class Pe extends Le{constructor(e,t){super(e),this.snapshot=t,ze(this,e)}toString(){return this.snapshot.toString()}}function Fe(e,t){const n=function(e,t){const n=new Ye([],{},{},"",{},G,t,null,e.root,-1,{});return new Ne("",new Ie(n,[]))}(e,t),i=new a.a([new he("",{})]),r=new a.a({}),s=new a.a({}),o=new a.a({}),c=new a.a(""),l=new We(i,r,o,c,s,G,t,n.root);return l.snapshot=n.root,new Pe(new Ie(l,[]),n)}class We{constructor(e,t,n,i,r,s,o,a){this.url=e,this.params=t,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Object(b.a)(e=>K(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(b.a)(e=>K(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function je(e,t="emptyOnly"){const n=e.pathFromRoot;let i=0;if("always"!==t)for(i=n.length-1;i>=1;){const e=n[i],t=n[i-1];if(e.routeConfig&&""===e.routeConfig.path)i--;else{if(t.component)break;i--}}return function(e){return e.reduce((e,t)=>({params:Object.assign(Object.assign({},e.params),t.params),data:Object.assign(Object.assign({},e.data),t.data),resolve:Object.assign(Object.assign({},e.resolve),t._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(i))}class Ye{constructor(e,t,n,i,r,s,o,a,c,l,u){this.url=e,this.params=t,this.queryParams=n,this.fragment=i,this.data=r,this.outlet=s,this.component=o,this.routeConfig=a,this._urlSegment=c,this._lastPathIndex=l,this._resolve=u}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=K(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=K(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(e=>e.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Ne extends Le{constructor(e,t){super(t),this.url=e,ze(this,t)}toString(){return $e(this._root)}}function ze(e,t){t.value._routerState=e,t.children.forEach(t=>ze(e,t))}function $e(e){const t=e.children.length>0?` { ${e.children.map($e).join(", ")} } `:"";return`${e.value}${t}`}function He(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,ee(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),ee(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!ee(e[n],t[n]))return!1;return!0}(t.url,n.url)||e.url.next(n.url),ee(t.data,n.data)||e.data.next(n.data)}else e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data)}function Xe(e,t){var n,i;return ee(e.params,t.params)&&fe(n=e.url,i=t.url)&&n.every((e,t)=>ee(e.parameters,i[t].parameters))&&!(!e.parent!=!t.parent)&&(!e.parent||Xe(e.parent,t.parent))}function Ve(e,t,n){if(n&&e.shouldReuseRoute(t.value,n.value.snapshot)){const i=n.value;i._futureSnapshot=t.value;const r=function(e,t,n){return t.children.map(t=>{for(const i of n.children)if(e.shouldReuseRoute(t.value,i.value.snapshot))return Ve(e,t,i);return Ve(e,t)})}(e,t,n);return new Ie(i,r)}{if(e.shouldAttach(t.value)){const n=e.retrieve(t.value);if(null!==n){const e=n.route;return Be(t,e),e}}const n=new We(new a.a((i=t.value).url),new a.a(i.params),new a.a(i.queryParams),new a.a(i.fragment),new a.a(i.data),i.outlet,i.component,i),r=t.children.map(t=>Ve(e,t));return new Ie(n,r)}var i}function Be(e,t){if(e.value.routeConfig!==t.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==t.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");t.value._futureSnapshot=e.value;for(let n=0;n<e.children.length;++n)Be(e.children[n],t.children[n])}function Ue(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function qe(e){return"object"==typeof e&&null!=e&&e.outlets}function Ge(e,t,n,i,r){let s={};return i&&re(i,(e,t)=>{s[t]=Array.isArray(e)?e.map(e=>`${e}`):`${e}`}),new ue(n.root===e?t:Je(n.root,e,t),s,r)}function Je(e,t,n){const i={};return re(e.children,(e,r)=>{i[r]=e===t?n:Je(e,t,n)}),new de(e.segments,i)}class Ke{constructor(e,t,n){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=n,e&&n.length>0&&Ue(n[0]))throw new Error("Root segment cannot have matrix parameters");const i=n.find(qe);if(i&&i!==ie(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Qe{constructor(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}function Ze(e,t,n){if(e||(e=new de([],{})),0===e.segments.length&&e.hasChildren())return et(e,t,n);const i=function(e,t,n){let i=0,r=t;const s={match:!1,pathIndex:0,commandIndex:0};for(;r<e.segments.length;){if(i>=n.length)return s;const t=e.segments[r],o=n[i];if(qe(o))break;const a=`${o}`,c=i<n.length-1?n[i+1]:null;if(r>0&&void 0===a)break;if(a&&c&&"object"==typeof c&&void 0===c.outlets){if(!rt(a,c,t))return s;i+=2}else{if(!rt(a,{},t))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}(e,t,n),r=n.slice(i.commandIndex);if(i.match&&i.pathIndex<e.segments.length){const t=new de(e.segments.slice(0,i.pathIndex),{});return t.children.primary=new de(e.segments.slice(i.pathIndex),e.children),et(t,0,r)}return i.match&&0===r.length?new de(e.segments,{}):i.match&&!e.hasChildren()?tt(e,t,n):i.match?et(e,0,r):tt(e,t,n)}function et(e,t,n){if(0===n.length)return new de(e.segments,{});{const i=function(e){return qe(e[0])?e[0].outlets:{[G]:e}}(n),r={};return re(i,(n,i)=>{"string"==typeof n&&(n=[n]),null!==n&&(r[i]=Ze(e.children[i],t,n))}),re(e.children,(e,t)=>{void 0===i[t]&&(r[t]=e)}),new de(e.segments,r)}}function tt(e,t,n){const i=e.segments.slice(0,t);let r=0;for(;r<n.length;){const s=n[r];if(qe(s)){const e=nt(s.outlets);return new de(i,e)}if(0===r&&Ue(n[0])){i.push(new he(e.segments[t].path,it(n[0]))),r++;continue}const o=qe(s)?s.outlets.primary:`${s}`,a=r<n.length-1?n[r+1]:null;o&&a&&Ue(a)?(i.push(new he(o,it(a))),r+=2):(i.push(new he(o,{})),r++)}return new de(i,{})}function nt(e){const t={};return re(e,(e,n)=>{"string"==typeof e&&(e=[e]),null!==e&&(t[n]=tt(new de([],{}),0,e))}),t}function it(e){const t={};return re(e,(e,n)=>t[n]=`${e}`),t}function rt(e,t,n){return e==n.path&&ee(t,n.parameters)}class st{constructor(e,t,n,i){this.routeReuseStrategy=e,this.futureState=t,this.currState=n,this.forwardEvent=i}activate(e){const t=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,n,e),He(this.futureState.root),this.activateChildRoutes(t,n,e)}deactivateChildRoutes(e,t,n){const i=Re(t);e.children.forEach(e=>{const t=e.value.outlet;this.deactivateRoutes(e,i[t],n),delete i[t]}),re(i,(e,t)=>{this.deactivateRouteAndItsChildren(e,n)})}deactivateRoutes(e,t,n){const i=e.value,r=t?t.value:null;if(i===r)if(i.component){const r=n.getContext(i.outlet);r&&this.deactivateChildRoutes(e,t,r.children)}else this.deactivateChildRoutes(e,t,n);else r&&this.deactivateRouteAndItsChildren(t,n)}deactivateRouteAndItsChildren(e,t){this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const n=t.getContext(e.value.outlet);if(n&&n.outlet){const t=n.outlet.detach(),i=n.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:t,route:e,contexts:i})}}deactivateRouteAndOutlet(e,t){const n=t.getContext(e.value.outlet),i=n&&e.value.component?n.children:t,r=Re(e);for(const s of Object.keys(r))this.deactivateRouteAndItsChildren(r[s],i);n&&n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated(),n.attachRef=null,n.resolver=null,n.route=null)}activateChildRoutes(e,t,n){const i=Re(t);e.children.forEach(e=>{this.activateRoutes(e,i[e.value.outlet],n),this.forwardEvent(new U(e.value.snapshot))}),e.children.length&&this.forwardEvent(new V(e.value.snapshot))}activateRoutes(e,t,n){const i=e.value,r=t?t.value:null;if(He(i),i===r)if(i.component){const r=n.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,r.children)}else this.activateChildRoutes(e,t,n);else if(i.component){const t=n.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const e=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),t.children.onOutletReAttached(e.contexts),t.attachRef=e.componentRef,t.route=e.route.value,t.outlet&&t.outlet.attach(e.componentRef,e.route.value),ot(e.route)}else{const n=function(e){for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(i.snapshot),r=n?n.module.componentFactoryResolver:null;t.attachRef=null,t.route=i,t.resolver=r,t.outlet&&t.outlet.activateWith(i,r),this.activateChildRoutes(e,null,t.children)}}else this.activateChildRoutes(e,null,n)}}function ot(e){He(e.value),e.children.forEach(ot)}class at{constructor(e,t){this.routes=e,this.module=t}}function ct(e){return"function"==typeof e}function lt(e){return e instanceof ue}const ut=Symbol("INITIAL_VALUE");function dt(){return Object(g.a)(e=>Object(c.a)(e.map(e=>e.pipe(Object(_.a)(1),Object(v.a)(ut)))).pipe(Object(y.a)((e,t)=>{let n=!1;return t.reduce((e,i,r)=>{if(e!==ut)return e;if(i===ut&&(n=!0),!n){if(!1===i)return i;if(r===t.length-1||lt(i))return i}return e},e)},ut),Object(w.a)(e=>e!==ut),Object(b.a)(e=>lt(e)?e:!0===e),Object(_.a)(1)))}let ht=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,t){1&e&&r.Sb(0,"router-outlet")},directives:function(){return[ln]},encapsulation:2}),e})();function ft(e,t=""){for(let n=0;n<e.length;n++){const i=e[n];pt(i,mt(t,i))}}function pt(e,t){e.children&&ft(e.children,t)}function mt(e,t){return t?e||t.path?e&&!t.path?`${e}/`:!e&&t.path?t.path:`${e}/${t.path}`:"":e}function bt(e){const t=e.children&&e.children.map(bt),n=t?Object.assign(Object.assign({},e),{children:t}):Object.assign({},e);return!n.component&&(t||n.loadChildren)&&n.outlet&&n.outlet!==G&&(n.component=ht),n}function gt(e){return e.outlet||G}function _t(e,t){const n=e.filter(e=>gt(e)===t);return n.push(...e.filter(e=>gt(e)!==t)),n}const vt={matched:!1,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};function yt(e,t,n){var i;if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?Object.assign({},vt):{matched:!0,consumedSegments:[],lastChild:0,parameters:{},positionalParamSegments:{}};const r=(t.matcher||Z)(n,e,t);if(!r)return Object.assign({},vt);const s={};re(r.posParams,(e,t)=>{s[t]=e.path});const o=r.consumed.length>0?Object.assign(Object.assign({},s),r.consumed[r.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:o,positionalParamSegments:null!==(i=r.posParams)&&void 0!==i?i:{}}}function wt(e,t,n,i,r="corrected"){if(n.length>0&&function(e,t,n){return n.some(n=>Dt(e,t,n)&&gt(n)!==G)}(e,n,i)){const r=new de(t,function(e,t,n,i){const r={};r.primary=i,i._sourceSegment=e,i._segmentIndexShift=t.length;for(const s of n)if(""===s.path&&gt(s)!==G){const n=new de([],{});n._sourceSegment=e,n._segmentIndexShift=t.length,r[gt(s)]=n}return r}(e,t,i,new de(n,e.children)));return r._sourceSegment=e,r._segmentIndexShift=t.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return n.some(n=>Dt(e,t,n))}(e,n,i)){const s=new de(e.segments,function(e,t,n,i,r,s){const o={};for(const a of i)if(Dt(e,n,a)&&!r[gt(a)]){const n=new de([],{});n._sourceSegment=e,n._segmentIndexShift="legacy"===s?e.segments.length:t.length,o[gt(a)]=n}return Object.assign(Object.assign({},r),o)}(e,t,n,i,e.children,r));return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}const s=new de(e.segments,e.children);return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}function Dt(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path}function St(e,t,n,i){return!!(gt(e)===i||i!==G&&Dt(t,n,e))&&("**"===e.path||yt(t,e,n).matched)}function xt(e,t,n){return 0===t.length&&!e.children[n]}class kt{constructor(e){this.segmentGroup=e||null}}class Tt{constructor(e){this.urlTree=e}}function Mt(e){return new l.a(t=>t.error(new kt(e)))}function Ct(e){return new l.a(t=>t.error(new Tt(e)))}function Ot(e){return new l.a(t=>t.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${e}'`)))}class Lt{constructor(e,t,n,i,s){this.configLoader=t,this.urlSerializer=n,this.urlTree=i,this.config=s,this.allowRedirects=!0,this.ngModule=e.get(r.B)}apply(){const e=wt(this.urlTree.root,[],[],this.config).segmentGroup,t=new de(e.segments,e.children);return this.expandSegmentGroup(this.ngModule,this.config,t,G).pipe(Object(b.a)(e=>this.createUrlTree(Et(e),this.urlTree.queryParams,this.urlTree.fragment))).pipe(Object(D.a)(e=>{if(e instanceof Tt)return this.allowRedirects=!1,this.match(e.urlTree);if(e instanceof kt)throw this.noMatchError(e);throw e}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,G).pipe(Object(b.a)(t=>this.createUrlTree(Et(t),e.queryParams,e.fragment))).pipe(Object(D.a)(e=>{if(e instanceof kt)throw this.noMatchError(e);throw e}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,n){const i=e.segments.length>0?new de([],{[G]:e}):e;return new ue(i,t,n)}expandSegmentGroup(e,t,n,i){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Object(b.a)(e=>new de([],e))):this.expandSegment(e,n,t,n.segments,i,!0)}expandChildren(e,t,n){const i=[];for(const r of Object.keys(n.children))"primary"===r?i.unshift(r):i.push(r);return Object(s.a)(i).pipe(Object(S.a)(i=>{const r=n.children[i],s=_t(t,i);return this.expandSegmentGroup(e,s,r,i).pipe(Object(b.a)(e=>({segment:e,outlet:i})))}),Object(y.a)((e,t)=>(e[t.outlet]=t.segment,e),{}),Object(x.a)())}expandSegment(e,t,n,i,r,a){return Object(s.a)(n).pipe(Object(S.a)(s=>this.expandSegmentAgainstRoute(e,t,n,s,i,r,a).pipe(Object(D.a)(e=>{if(e instanceof kt)return Object(o.a)(null);throw e}))),Object(k.a)(e=>!!e),Object(D.a)((e,n)=>{if(e instanceof u.a||"EmptyError"===e.name){if(xt(t,i,r))return Object(o.a)(new de([],{}));throw new kt(t)}throw e}))}expandSegmentAgainstRoute(e,t,n,i,r,s,o){return St(i,t,r,s)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(e,t,i,r,s):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s):Mt(t):Mt(t)}expandSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s){return"**"===i.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,i,s):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,n,i){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Ct(r):this.lineralizeSegments(n,r).pipe(Object(T.a)(n=>{const r=new de(n,{});return this.expandSegment(e,r,t,n,i,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,i,r,s){const{matched:o,consumedSegments:a,lastChild:c,positionalParamSegments:l}=yt(t,i,r);if(!o)return Mt(t);const u=this.applyRedirectCommands(a,i.redirectTo,l);return i.redirectTo.startsWith("/")?Ct(u):this.lineralizeSegments(i,u).pipe(Object(T.a)(i=>this.expandSegment(e,t,n,i.concat(r.slice(c)),s,!1)))}matchSegmentAgainstRoute(e,t,n,i,r){if("**"===n.path)return n.loadChildren?(n._loadedConfig?Object(o.a)(n._loadedConfig):this.configLoader.load(e.injector,n)).pipe(Object(b.a)(e=>(n._loadedConfig=e,new de(i,{})))):Object(o.a)(new de(i,{}));const{matched:s,consumedSegments:a,lastChild:c}=yt(t,n,i);if(!s)return Mt(t);const l=i.slice(c);return this.getChildConfig(e,n,i).pipe(Object(T.a)(e=>{const i=e.module,s=e.routes,{segmentGroup:c,slicedSegments:u}=wt(t,a,l,s),d=new de(c.segments,c.children);if(0===u.length&&d.hasChildren())return this.expandChildren(i,s,d).pipe(Object(b.a)(e=>new de(a,e)));if(0===s.length&&0===u.length)return Object(o.a)(new de(a,{}));const h=gt(n)===r;return this.expandSegment(i,d,s,u,h?G:r,!0).pipe(Object(b.a)(e=>new de(a.concat(e.segments),e.children)))}))}getChildConfig(e,t,n){return t.children?Object(o.a)(new at(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?Object(o.a)(t._loadedConfig):this.runCanLoadGuards(e.injector,t,n).pipe(Object(T.a)(n=>n?this.configLoader.load(e.injector,t).pipe(Object(b.a)(e=>(t._loadedConfig=e,e))):function(e){return new l.a(t=>t.error(Q(`Cannot load children because the guard of the route "path: '${e.path}'" returned false`)))}(t))):Object(o.a)(new at([],e))}runCanLoadGuards(e,t,n){const i=t.canLoad;if(!i||0===i.length)return Object(o.a)(!0);const r=i.map(i=>{const r=e.get(i);let s;if(function(e){return e&&ct(e.canLoad)}(r))s=r.canLoad(t,n);else{if(!ct(r))throw new Error("Invalid CanLoad guard");s=r(t,n)}return se(s)});return Object(o.a)(r).pipe(dt(),Object(M.a)(e=>{if(!lt(e))return;const t=Q(`Redirecting to "${this.urlSerializer.serialize(e)}"`);throw t.url=e,t}),Object(b.a)(e=>!0===e))}lineralizeSegments(e,t){let n=[],i=t.root;for(;;){if(n=n.concat(i.segments),0===i.numberOfChildren)return Object(o.a)(n);if(i.numberOfChildren>1||!i.children.primary)return Ot(e.redirectTo);i=i.children.primary}}applyRedirectCommands(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)}applyRedirectCreatreUrlTree(e,t,n,i){const r=this.createSegmentGroup(e,t.root,n,i);return new ue(r,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const n={};return re(e,(e,i)=>{if("string"==typeof e&&e.startsWith(":")){const r=e.substring(1);n[i]=t[r]}else n[i]=e}),n}createSegmentGroup(e,t,n,i){const r=this.createSegments(e,t.segments,n,i);let s={};return re(t.children,(t,r)=>{s[r]=this.createSegmentGroup(e,t,n,i)}),new de(r,s)}createSegments(e,t,n,i){return t.map(t=>t.path.startsWith(":")?this.findPosParam(e,t,i):this.findOrReturn(t,n))}findPosParam(e,t,n){const i=n[t.path.substring(1)];if(!i)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return i}findOrReturn(e,t){let n=0;for(const i of t){if(i.path===e.path)return t.splice(n),i;n++}return e}}function Et(e){const t={};for(const n of Object.keys(e.children)){const i=Et(e.children[n]);(i.segments.length>0||i.hasChildren())&&(t[n]=i)}return function(e){if(1===e.numberOfChildren&&e.children.primary){const t=e.children.primary;return new de(e.segments.concat(t.segments),t.children)}return e}(new de(e.segments,t))}class At{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class It{constructor(e,t){this.component=e,this.route=t}}function Rt(e,t,n){const i=e._root;return Ft(i,t?t._root:null,n,[i.value])}function Pt(e,t,n){const i=function(e){if(!e)return null;for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(t);return(i?i.module.injector:n).get(e)}function Ft(e,t,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=Re(t);return e.children.forEach(e=>{!function(e,t,n,i,r={canDeactivateChecks:[],canActivateChecks:[]}){const s=e.value,o=t?t.value:null,a=n?n.getContext(e.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){const c=function(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!fe(e.url,t.url);case"pathParamsOrQueryParamsChange":return!fe(e.url,t.url)||!ee(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Xe(e,t)||!ee(e.queryParams,t.queryParams);case"paramsChange":default:return!Xe(e,t)}}(o,s,s.routeConfig.runGuardsAndResolvers);c?r.canActivateChecks.push(new At(i)):(s.data=o.data,s._resolvedData=o._resolvedData),Ft(e,t,s.component?a?a.children:null:n,i,r),c&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new It(a.outlet.component,o))}else o&&Wt(t,a,r),r.canActivateChecks.push(new At(i)),Ft(e,null,s.component?a?a.children:null:n,i,r)}(e,s[e.value.outlet],n,i.concat([e.value]),r),delete s[e.value.outlet]}),re(s,(e,t)=>Wt(e,n.getContext(t),r)),r}function Wt(e,t,n){const i=Re(e),r=e.value;re(i,(e,i)=>{Wt(e,r.component?t?t.children.getContext(i):null:t,n)}),n.canDeactivateChecks.push(new It(r.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,r))}class jt{}function Yt(e){return new l.a(t=>t.error(e))}class Nt{constructor(e,t,n,i,r,s){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=i,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=s}recognize(){const e=wt(this.urlTree.root,[],[],this.config.filter(e=>void 0===e.redirectTo),this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,G);if(null===t)return null;const n=new Ye([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},G,this.rootComponentType,null,this.urlTree.root,-1,{}),i=new Ie(n,t),r=new Ne(this.url,i);return this.inheritParamsAndData(r._root),r}inheritParamsAndData(e){const t=e.value,n=je(t,this.paramsInheritanceStrategy);t.params=Object.freeze(n.params),t.data=Object.freeze(n.data),e.children.forEach(e=>this.inheritParamsAndData(e))}processSegmentGroup(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)}processChildren(e,t){const n=[];for(const r of Object.keys(t.children)){const i=t.children[r],s=_t(e,r),o=this.processSegmentGroup(s,i,r);if(null===o)return null;n.push(...o)}const i=$t(n);return i.sort((e,t)=>e.value.outlet===G?-1:t.value.outlet===G?1:e.value.outlet.localeCompare(t.value.outlet)),i}processSegment(e,t,n,i){for(const r of e){const e=this.processSegmentAgainstRoute(r,t,n,i);if(null!==e)return e}return xt(t,n,i)?[]:null}processSegmentAgainstRoute(e,t,n,i){if(e.redirectTo||!St(e,t,n,i))return null;let r,s=[],o=[];if("**"===e.path){const i=n.length>0?ie(n).parameters:{};r=new Ye(n,i,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Vt(e),gt(e),e.component,e,Ht(t),Xt(t)+n.length,Bt(e))}else{const i=yt(t,e,n);if(!i.matched)return null;s=i.consumedSegments,o=n.slice(i.lastChild),r=new Ye(s,i.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Vt(e),gt(e),e.component,e,Ht(t),Xt(t)+s.length,Bt(e))}const a=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),{segmentGroup:c,slicedSegments:l}=wt(t,s,o,a.filter(e=>void 0===e.redirectTo),this.relativeLinkResolution);if(0===l.length&&c.hasChildren()){const e=this.processChildren(a,c);return null===e?null:[new Ie(r,e)]}if(0===a.length&&0===l.length)return[new Ie(r,[])];const u=gt(e)===i,d=this.processSegment(a,c,l,u?G:i);return null===d?null:[new Ie(r,d)]}}function zt(e){const t=e.value.routeConfig;return t&&""===t.path&&void 0===t.redirectTo}function $t(e){const t=[],n=new Set;for(const i of e){if(!zt(i)){t.push(i);continue}const e=t.find(e=>i.value.routeConfig===e.value.routeConfig);void 0!==e?(e.children.push(...i.children),n.add(e)):t.push(i)}for(const i of n){const e=$t(i.children);t.push(new Ie(i.value,e))}return t.filter(e=>!n.has(e))}function Ht(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function Xt(e){let t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;for(;t._sourceSegment;)t=t._sourceSegment,n+=t._segmentIndexShift?t._segmentIndexShift:0;return n-1}function Vt(e){return e.data||{}}function Bt(e){return e.resolve||{}}function Ut(e){return Object(g.a)(t=>{const n=e(t);return n?Object(s.a)(n).pipe(Object(b.a)(()=>t)):Object(o.a)(t)})}class qt extends class{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}{}const Gt=new r.u("ROUTES");class Jt{constructor(e,t,n,i){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=i}load(e,t){if(t._loader$)return t._loader$;this.onLoadStartListener&&this.onLoadStartListener(t);const n=this.loadModuleFactory(t.loadChildren).pipe(Object(b.a)(n=>{this.onLoadEndListener&&this.onLoadEndListener(t);const i=n.create(e);return new at(ne(i.injector.get(Gt,void 0,r.t.Self|r.t.Optional)).map(bt),i)}),Object(D.a)(e=>{throw t._loader$=void 0,e}));return t._loader$=new p.a(n,()=>new m.a).pipe(Object(O.a)()),t._loader$}loadModuleFactory(e){return"string"==typeof e?Object(s.a)(this.loader.load(e)):se(e()).pipe(Object(T.a)(e=>e instanceof r.z?Object(o.a)(e):Object(s.a)(this.compiler.compileModuleAsync(e))))}}class Kt{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Qt,this.attachRef=null}}class Qt{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const n=this.getOrCreateContext(e);n.outlet=t,this.contexts.set(e,n)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new Kt,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}class Zt{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function en(e){throw e}function tn(e,t,n){return t.parse("/")}function nn(e,t){return Object(o.a)(null)}let rn=(()=>{class e{constructor(e,t,n,i,s,o,c,l){this.rootComponentType=e,this.urlSerializer=t,this.rootContexts=n,this.location=i,this.config=l,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.disposed=!1,this.lastLocationChangeInfo=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new m.a,this.errorHandler=en,this.malformedUriErrorHandler=tn,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:nn,afterPreactivation:nn},this.urlHandlingStrategy=new Zt,this.routeReuseStrategy=new qt,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="corrected",this.ngModule=s.get(r.B),this.console=s.get(r.ab);const u=s.get(r.D);this.isNgZoneEnabled=u instanceof r.D&&r.D.isInAngularZone(),this.resetConfig(l),this.currentUrlTree=new ue(new de([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Jt(o,c,e=>this.triggerEvent(new $(e)),e=>this.triggerEvent(new H(e))),this.routerState=Fe(this.currentUrlTree,this.rootComponentType),this.transitions=new a.a({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}setupNavigations(e){const t=this.events;return e.pipe(Object(w.a)(e=>0!==e.id),Object(b.a)(e=>Object.assign(Object.assign({},e),{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl)})),Object(g.a)(e=>{let n=!1,i=!1;return Object(o.a)(e).pipe(Object(M.a)(e=>{this.currentNavigation={id:e.id,initialUrl:e.currentRawUrl,extractedUrl:e.extractedUrl,trigger:e.source,extras:e.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Object(g.a)(e=>{const n=!this.navigated||e.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(e.rawUrl))return Object(o.a)(e).pipe(Object(g.a)(e=>{const n=this.transitions.getValue();return t.next(new I(e.id,this.serializeUrl(e.extractedUrl),e.source,e.restoredState)),n!==this.transitions.getValue()?h.a:Promise.resolve(e)}),(i=this.ngModule.injector,r=this.configLoader,s=this.urlSerializer,a=this.config,Object(g.a)(e=>function(e,t,n,i,r){return new Lt(e,t,n,i,r).apply()}(i,r,s,e.extractedUrl,a).pipe(Object(b.a)(t=>Object.assign(Object.assign({},e),{urlAfterRedirects:t}))))),Object(M.a)(e=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:e.urlAfterRedirects})}),function(e,t,n,i,r){return Object(T.a)(s=>function(e,t,n,i,r="emptyOnly",s="legacy"){try{const a=new Nt(e,t,n,i,r,s).recognize();return null===a?Yt(new jt):Object(o.a)(a)}catch(a){return Yt(a)}}(e,t,s.urlAfterRedirects,n(s.urlAfterRedirects),i,r).pipe(Object(b.a)(e=>Object.assign(Object.assign({},s),{targetSnapshot:e}))))}(this.rootComponentType,this.config,e=>this.serializeUrl(e),this.paramsInheritanceStrategy,this.relativeLinkResolution),Object(M.a)(e=>{"eager"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(e.urlAfterRedirects,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects);const n=new W(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);t.next(n)}));var i,r,s,a;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:i,source:r,restoredState:s,extras:a}=e,c=new I(n,this.serializeUrl(i),r,s);t.next(c);const l=Fe(i,this.rootComponentType).snapshot;return Object(o.a)(Object.assign(Object.assign({},e),{targetSnapshot:l,urlAfterRedirects:i,extras:Object.assign(Object.assign({},a),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=e.rawUrl,this.browserUrlTree=e.urlAfterRedirects,e.resolve(null),h.a}),Ut(e=>{const{targetSnapshot:t,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=e;return this.hooks.beforePreactivation(t,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),Object(M.a)(e=>{const t=new j(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(b.a)(e=>Object.assign(Object.assign({},e),{guards:Rt(e.targetSnapshot,e.currentSnapshot,this.rootContexts)})),function(e,t){return Object(T.a)(n=>{const{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:a,canDeactivateChecks:c}}=n;return 0===c.length&&0===a.length?Object(o.a)(Object.assign(Object.assign({},n),{guardsResult:!0})):function(e,t,n,i){return Object(s.a)(e).pipe(Object(T.a)(e=>function(e,t,n,i,r){const s=t&&t.routeConfig?t.routeConfig.canDeactivate:null;if(!s||0===s.length)return Object(o.a)(!0);const a=s.map(s=>{const o=Pt(s,t,r);let a;if(function(e){return e&&ct(e.canDeactivate)}(o))a=se(o.canDeactivate(e,t,n,i));else{if(!ct(o))throw new Error("Invalid CanDeactivate guard");a=se(o(e,t,n,i))}return a.pipe(Object(k.a)())});return Object(o.a)(a).pipe(dt())}(e.component,e.route,n,t,i)),Object(k.a)(e=>!0!==e,!0))}(c,i,r,e).pipe(Object(T.a)(n=>n&&"boolean"==typeof n?function(e,t,n,i){return Object(s.a)(t).pipe(Object(S.a)(t=>Object(d.a)(function(e,t){return null!==e&&t&&t(new X(e)),Object(o.a)(!0)}(t.route.parent,i),function(e,t){return null!==e&&t&&t(new B(e)),Object(o.a)(!0)}(t.route,i),function(e,t,n){const i=t[t.length-1],r=t.slice(0,t.length-1).reverse().map(e=>function(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(e)).filter(e=>null!==e).map(t=>f(()=>{const r=t.guards.map(r=>{const s=Pt(r,t.node,n);let o;if(function(e){return e&&ct(e.canActivateChild)}(s))o=se(s.canActivateChild(i,e));else{if(!ct(s))throw new Error("Invalid CanActivateChild guard");o=se(s(i,e))}return o.pipe(Object(k.a)())});return Object(o.a)(r).pipe(dt())}));return Object(o.a)(r).pipe(dt())}(e,t.path,n),function(e,t,n){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return Object(o.a)(!0);const r=i.map(i=>f(()=>{const r=Pt(i,t,n);let s;if(function(e){return e&&ct(e.canActivate)}(r))s=se(r.canActivate(t,e));else{if(!ct(r))throw new Error("Invalid CanActivate guard");s=se(r(t,e))}return s.pipe(Object(k.a)())}));return Object(o.a)(r).pipe(dt())}(e,t.route,n))),Object(k.a)(e=>!0!==e,!0))}(i,a,e,t):Object(o.a)(n)),Object(b.a)(e=>Object.assign(Object.assign({},n),{guardsResult:e})))})}(this.ngModule.injector,e=>this.triggerEvent(e)),Object(M.a)(e=>{if(lt(e.guardsResult)){const t=Q(`Redirecting to "${this.serializeUrl(e.guardsResult)}"`);throw t.url=e.guardsResult,t}const t=new Y(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot,!!e.guardsResult);this.triggerEvent(t)}),Object(w.a)(e=>{if(!e.guardsResult){this.resetUrlToCurrentUrlTree();const n=new P(e.id,this.serializeUrl(e.extractedUrl),"");return t.next(n),e.resolve(!1),!1}return!0}),Ut(e=>{if(e.guards.canActivateChecks.length)return Object(o.a)(e).pipe(Object(M.a)(e=>{const t=new N(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(g.a)(e=>{let n=!1;return Object(o.a)(e).pipe((i=this.paramsInheritanceStrategy,r=this.ngModule.injector,Object(T.a)(e=>{const{targetSnapshot:t,guards:{canActivateChecks:n}}=e;if(!n.length)return Object(o.a)(e);let a=0;return Object(s.a)(n).pipe(Object(S.a)(e=>function(e,t,n,i){return function(e,t,n,i){const r=Object.keys(e);if(0===r.length)return Object(o.a)({});const a={};return Object(s.a)(r).pipe(Object(T.a)(r=>function(e,t,n,i){const r=Pt(e,t,i);return se(r.resolve?r.resolve(t,n):r(t,n))}(e[r],t,n,i).pipe(Object(M.a)(e=>{a[r]=e}))),Object(C.a)(1),Object(T.a)(()=>Object.keys(a).length===r.length?Object(o.a)(a):h.a))}(e._resolve,e,t,i).pipe(Object(b.a)(t=>(e._resolvedData=t,e.data=Object.assign(Object.assign({},e.data),je(e,n).resolve),null)))}(e.route,t,i,r)),Object(M.a)(()=>a++),Object(C.a)(1),Object(T.a)(t=>a===n.length?Object(o.a)(e):h.a))})),Object(M.a)({next:()=>n=!0,complete:()=>{if(!n){const n=new P(e.id,this.serializeUrl(e.extractedUrl),"At least one route resolver didn't emit any value.");t.next(n),e.resolve(!1)}}}));var i,r}),Object(M.a)(e=>{const t=new z(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}))}),Ut(e=>{const{targetSnapshot:t,id:n,extractedUrl:i,rawUrl:r,extras:{skipLocationChange:s,replaceUrl:o}}=e;return this.hooks.afterPreactivation(t,{navigationId:n,appliedUrlTree:i,rawUrlTree:r,skipLocationChange:!!s,replaceUrl:!!o})}),Object(b.a)(e=>{const t=function(e,t,n){const i=Ve(e,t._root,n?n._root:void 0);return new Pe(i,t)}(this.routeReuseStrategy,e.targetSnapshot,e.currentRouterState);return Object.assign(Object.assign({},e),{targetRouterState:t})}),Object(M.a)(e=>{this.currentUrlTree=e.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl),this.routerState=e.targetRouterState,"deferred"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),(r=this.rootContexts,a=this.routeReuseStrategy,c=e=>this.triggerEvent(e),Object(b.a)(e=>(new st(a,e.targetRouterState,e.currentRouterState,c).activate(r),e))),Object(M.a)({next(){n=!0},complete(){n=!0}}),Object(L.a)(()=>{if(!n&&!i){this.resetUrlToCurrentUrlTree();const n=new P(e.id,this.serializeUrl(e.extractedUrl),`Navigation ID ${e.id} is not equal to the current navigation id ${this.navigationId}`);t.next(n),e.resolve(!1)}this.currentNavigation=null}),Object(D.a)(n=>{if(i=!0,(r=n)&&r.ngNavigationCancelingError){const i=lt(n.url);i||(this.navigated=!0,this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl));const r=new P(e.id,this.serializeUrl(e.extractedUrl),n.message);t.next(r),i?setTimeout(()=>{const t=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);this.scheduleNavigation(t,"imperative",null,{skipLocationChange:e.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:e.resolve,reject:e.reject,promise:e.promise})},0):e.resolve(!1)}else{this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl);const i=new F(e.id,this.serializeUrl(e.extractedUrl),n);t.next(i);try{e.resolve(this.errorHandler(n))}catch(s){e.reject(s)}}var r;return h.a}));var r,a,c}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}getTransition(){const e=this.transitions.value;return e.urlAfterRedirects=this.browserUrlTree,e}setTransition(e){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{const t=this.extractLocationChangeInfoFromEvent(e);this.shouldScheduleNavigation(this.lastLocationChangeInfo,t)&&setTimeout(()=>{const{source:e,state:n,urlTree:i}=t,r={replaceUrl:!0};if(n){const e=Object.assign({},n);delete e.navigationId,0!==Object.keys(e).length&&(r.state=e)}this.scheduleNavigation(i,e,n,r)},0),this.lastLocationChangeInfo=t}))}extractLocationChangeInfoFromEvent(e){var t;return{source:"popstate"===e.type?"popstate":"hashchange",urlTree:this.parseUrl(e.url),state:(null===(t=e.state)||void 0===t?void 0:t.navigationId)?e.state:null,transitionId:this.getTransition().id}}shouldScheduleNavigation(e,t){if(!e)return!0;const n=t.urlTree.toString()===e.urlTree.toString();return!(t.transitionId===e.transitionId&&n&&("hashchange"===t.source&&"popstate"===e.source||"popstate"===t.source&&"hashchange"===e.source))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){ft(e),this.config=e.map(bt),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.transitions.complete(),this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=void 0),this.disposed=!0}createUrlTree(e,t={}){const{relativeTo:n,queryParams:i,fragment:r,queryParamsHandling:s,preserveFragment:o}=t,a=n||this.routerState.root,c=o?this.currentUrlTree.fragment:r;let l=null;switch(s){case"merge":l=Object.assign(Object.assign({},this.currentUrlTree.queryParams),i);break;case"preserve":l=this.currentUrlTree.queryParams;break;default:l=i||null}return null!==l&&(l=this.removeEmptyProps(l)),function(e,t,n,i,r){if(0===n.length)return Ge(t.root,t.root,t,i,r);const s=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Ke(!0,0,e);let t=0,n=!1;const i=e.reduce((e,i,r)=>{if("object"==typeof i&&null!=i){if(i.outlets){const t={};return re(i.outlets,(e,n)=>{t[n]="string"==typeof e?e.split("/"):e}),[...e,{outlets:t}]}if(i.segmentPath)return[...e,i.segmentPath]}return"string"!=typeof i?[...e,i]:0===r?(i.split("/").forEach((i,r)=>{0==r&&"."===i||(0==r&&""===i?n=!0:".."===i?t++:""!=i&&e.push(i))}),e):[...e,i]},[]);return new Ke(n,t,i)}(n);if(s.toRoot())return Ge(t.root,new de([],{}),t,i,r);const o=function(e,t,n){if(e.isAbsolute)return new Qe(t.root,!0,0);if(-1===n.snapshot._lastPathIndex){const e=n.snapshot._urlSegment;return new Qe(e,e===t.root,0)}const i=Ue(e.commands[0])?0:1;return function(e,t,n){let i=e,r=t,s=n;for(;s>r;){if(s-=r,i=i.parent,!i)throw new Error("Invalid number of '../'");r=i.segments.length}return new Qe(i,!1,r-s)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+i,e.numberOfDoubleDots)}(s,t,e),a=o.processChildren?et(o.segmentGroup,o.index,s.commands):Ze(o.segmentGroup,o.index,s.commands);return Ge(o.segmentGroup,a,t,i,r)}(a,this.currentUrlTree,e,l,c)}navigateByUrl(e,t={skipLocationChange:!1}){const n=lt(e)?e:this.parseUrl(e),i=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(i,"imperative",null,t)}navigate(e,t={skipLocationChange:!1}){return function(e){for(let t=0;t<e.length;t++){const n=e[t];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${t}`)}}(e),this.navigateByUrl(this.createUrlTree(e,t),t)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){let t;try{t=this.urlSerializer.parse(e)}catch(n){t=this.malformedUriErrorHandler(n,this.urlSerializer,e)}return t}isActive(e,t){if(lt(e))return oe(this.currentUrlTree,e,t);const n=this.parseUrl(e);return oe(this.currentUrlTree,n,t)}removeEmptyProps(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];return null!=i&&(t[n]=i),t},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.events.next(new R(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,e.resolve(!0)},e=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(e,t,n,i,r){if(this.disposed)return Promise.resolve(!1);const s=this.getTransition(),o="imperative"!==t&&"imperative"===(null==s?void 0:s.source),a=(this.lastSuccessfulId===s.id||this.currentNavigation?s.rawUrl:s.urlAfterRedirects).toString()===e.toString();if(o&&a)return Promise.resolve(!0);let c,l,u;r?(c=r.resolve,l=r.reject,u=r.promise):u=new Promise((e,t)=>{c=e,l=t});const d=++this.navigationId;return this.setTransition({id:d,source:t,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:i,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(e=>Promise.reject(e))}setBrowserUrl(e,t,n,i){const r=this.urlSerializer.serialize(e);i=i||{},this.location.isCurrentPathEqualTo(r)||t?this.location.replaceState(r,"",Object.assign(Object.assign({},i),{navigationId:n})):this.location.go(r,"",Object.assign(Object.assign({},i),{navigationId:n}))}resetStateAndUrl(e,t,n){this.routerState=e,this.currentUrlTree=t,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.Q),r.ic(pe),r.ic(Qt),r.ic(i.m),r.ic(r.v),r.ic(r.A),r.ic(r.j),r.ic(void 0))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),sn=(()=>{class e{constructor(e,t,n,i,r){this.router=e,this.route=t,this.commands=[],this.onChanges=new m.a,null==n&&i.setAttribute(r.nativeElement,"tabindex","0")}ngOnChanges(e){this.onChanges.next(this)}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}onClick(){const e={skipLocationChange:an(this.skipLocationChange),replaceUrl:an(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,e),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:an(this.preserveFragment)})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(rn),r.Rb(We),r.jc("tabindex"),r.Rb(r.H),r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(e,t){1&e&&r.lc("click",function(){return t.onClick()})},inputs:{routerLink:"routerLink",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[r.Bb]}),e})(),on=(()=>{class e{constructor(e,t,n){this.router=e,this.route=t,this.locationStrategy=n,this.commands=[],this.onChanges=new m.a,this.subscription=e.events.subscribe(e=>{e instanceof R&&this.updateTargetUrlAndHref()})}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}ngOnChanges(e){this.updateTargetUrlAndHref(),this.onChanges.next(this)}ngOnDestroy(){this.subscription.unsubscribe()}onClick(e,t,n,i,r){if(0!==e||t||n||i||r)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const s={skipLocationChange:an(this.skipLocationChange),replaceUrl:an(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,s),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:an(this.preserveFragment)})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(rn),r.Rb(We),r.Rb(i.n))},e.\u0275dir=r.Mb({type:e,selectors:[["a","routerLink",""],["area","routerLink",""]],hostVars:2,hostBindings:function(e,t){1&e&&r.lc("click",function(e){return t.onClick(e.button,e.ctrlKey,e.shiftKey,e.altKey,e.metaKey)}),2&e&&(r.ac("href",t.href,r.Lc),r.Eb("target",t.target))},inputs:{routerLink:"routerLink",target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state",relativeTo:"relativeTo"},features:[r.Bb]}),e})();function an(e){return""===e||!!e}let cn=(()=>{class e{constructor(e,t,n,i,r,s){this.router=e,this.element=t,this.renderer=n,this.cdr=i,this.link=r,this.linkWithHref=s,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.routerEventsSubscription=e.events.subscribe(e=>{e instanceof R&&this.update()})}ngAfterContentInit(){Object(o.a)(this.links.changes,this.linksWithHrefs.changes,Object(o.a)(null)).pipe(Object(E.a)()).subscribe(e=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){var e;null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe();const t=[...this.links.toArray(),...this.linksWithHrefs.toArray(),this.link,this.linkWithHref].filter(e=>!!e).map(e=>e.onChanges);this.linkInputChangesSubscription=Object(s.a)(t).pipe(Object(E.a)()).subscribe(e=>{this.isActive!==this.isLinkActive(this.router)(e)&&this.update()})}set routerLinkActive(e){const t=Array.isArray(e)?e:e.split(" ");this.classes=t.filter(e=>!!e)}ngOnChanges(e){this.update()}ngOnDestroy(){var e;this.routerEventsSubscription.unsubscribe(),null===(e=this.linkInputChangesSubscription)||void 0===e||e.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const e=this.hasActiveLinks();this.isActive!==e&&(this.isActive=e,this.cdr.markForCheck(),this.classes.forEach(t=>{e?this.renderer.addClass(this.element.nativeElement,t):this.renderer.removeClass(this.element.nativeElement,t)}))})}isLinkActive(e){return t=>e.isActive(t.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.linkWithHref&&e(this.linkWithHref)||this.links.some(e)||this.linksWithHrefs.some(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(rn),r.Rb(r.n),r.Rb(r.H),r.Rb(r.i),r.Rb(sn,8),r.Rb(on,8))},e.\u0275dir=r.Mb({type:e,selectors:[["","routerLinkActive",""]],contentQueries:function(e,t,n){if(1&e&&(r.Kb(n,sn,1),r.Kb(n,on,1)),2&e){let e;r.Ec(e=r.mc())&&(t.links=e),r.Ec(e=r.mc())&&(t.linksWithHrefs=e)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",routerLinkActive:"routerLinkActive"},exportAs:["routerLinkActive"],features:[r.Bb]}),e})(),ln=(()=>{class e{constructor(e,t,n,i,s){this.parentContexts=e,this.location=t,this.resolver=n,this.changeDetector=s,this.activated=null,this._activatedRoute=null,this.activateEvents=new r.p,this.deactivateEvents=new r.p,this.name=i||G,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,e}attach(e,t){this.activated=e,this._activatedRoute=t,this.location.insert(e.hostView)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,t){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const n=(t=t||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),i=this.parentContexts.getOrCreateContext(this.name).children,r=new un(e,i,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Qt),r.Rb(r.S),r.Rb(r.k),r.jc("name"),r.Rb(r.i))},e.\u0275dir=r.Mb({type:e,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),e})();class un{constructor(e,t,n){this.route=e,this.childContexts=t,this.parent=n}get(e,t){return e===We?this.route:e===Qt?this.childContexts:this.parent.get(e,t)}}class dn{}class hn{preload(e,t){return t().pipe(Object(D.a)(()=>Object(o.a)(null)))}}class fn{preload(e,t){return Object(o.a)(null)}}let pn=(()=>{class e{constructor(e,t,n,i,r){this.router=e,this.injector=i,this.preloadingStrategy=r,this.loader=new Jt(t,n,t=>e.triggerEvent(new $(t)),t=>e.triggerEvent(new H(t)))}setUpPreloading(){this.subscription=this.router.events.pipe(Object(w.a)(e=>e instanceof R),Object(S.a)(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(r.B);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,t){const n=[];for(const i of t)if(i.loadChildren&&!i.canLoad&&i._loadedConfig){const e=i._loadedConfig;n.push(this.processRoutes(e.module,e.routes))}else i.loadChildren&&!i.canLoad?n.push(this.preloadConfig(e,i)):i.children&&n.push(this.processRoutes(e,i.children));return Object(s.a)(n).pipe(Object(E.a)(),Object(b.a)(e=>{}))}preloadConfig(e,t){return this.preloadingStrategy.preload(t,()=>(t._loadedConfig?Object(o.a)(t._loadedConfig):this.loader.load(e.injector,t)).pipe(Object(T.a)(e=>(t._loadedConfig=e,this.processRoutes(e.module,e.routes)))))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(rn),r.ic(r.A),r.ic(r.j),r.ic(r.v),r.ic(dn))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),mn=(()=>{class e{constructor(e,t,n={}){this.router=e,this.viewportScroller=t,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof I?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof R&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof q&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,t){this.router.triggerEvent(new q(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,t))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.ic(rn),r.ic(i.D),r.ic(void 0))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();const bn=new r.u("ROUTER_CONFIGURATION"),gn=new r.u("ROUTER_FORROOT_GUARD"),_n=[i.m,{provide:pe,useClass:me},{provide:rn,useFactory:function(e,t,n,r,s,o,a,c={},l,u){const d=new rn(null,e,t,n,r,s,o,ne(a));if(l&&(d.urlHandlingStrategy=l),u&&(d.routeReuseStrategy=u),function(e,t){e.errorHandler&&(t.errorHandler=e.errorHandler),e.malformedUriErrorHandler&&(t.malformedUriErrorHandler=e.malformedUriErrorHandler),e.onSameUrlNavigation&&(t.onSameUrlNavigation=e.onSameUrlNavigation),e.paramsInheritanceStrategy&&(t.paramsInheritanceStrategy=e.paramsInheritanceStrategy),e.relativeLinkResolution&&(t.relativeLinkResolution=e.relativeLinkResolution),e.urlUpdateStrategy&&(t.urlUpdateStrategy=e.urlUpdateStrategy)}(c,d),c.enableTracing){const e=Object(i.L)();d.events.subscribe(t=>{e.logGroup(`Router Event: ${t.constructor.name}`),e.log(t.toString()),e.log(t),e.logGroupEnd()})}return d},deps:[pe,Qt,i.m,r.v,r.A,r.j,Gt,bn,[class{},new r.E],[class{},new r.E]]},Qt,{provide:We,useFactory:function(e){return e.routerState.root},deps:[rn]},{provide:r.A,useClass:r.N},pn,fn,hn,{provide:bn,useValue:{enableTracing:!1}}];function vn(){return new r.C("Router",rn)}let yn=(()=>{class e{constructor(e,t){}static forRoot(t,n){return{ngModule:e,providers:[_n,xn(t),{provide:gn,useFactory:Sn,deps:[[rn,new r.E,new r.M]]},{provide:bn,useValue:n||{}},{provide:i.n,useFactory:Dn,deps:[i.z,[new r.s(i.a),new r.E],bn]},{provide:mn,useFactory:wn,deps:[rn,i.D,bn]},{provide:dn,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:fn},{provide:r.C,multi:!0,useFactory:vn},[kn,{provide:r.d,multi:!0,useFactory:Tn,deps:[kn]},{provide:Cn,useFactory:Mn,deps:[kn]},{provide:r.b,multi:!0,useExisting:Cn}]]}}static forChild(t){return{ngModule:e,providers:[xn(t)]}}}return e.\u0275fac=function(t){return new(t||e)(r.ic(gn,8),r.ic(rn,8))},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({}),e})();function wn(e,t,n){return n.scrollOffset&&t.setOffset(n.scrollOffset),new mn(e,t,n)}function Dn(e,t,n={}){return n.useHash?new i.h(e,t):new i.x(e,t)}function Sn(e){return"guarded"}function xn(e){return[{provide:r.a,multi:!0,useValue:e},{provide:Gt,multi:!0,useValue:e}]}let kn=(()=>{class e{constructor(e){this.injector=e,this.initNavigation=!1,this.resultOfPreactivationDone=new m.a}appInitializer(){return this.injector.get(i.l,Promise.resolve(null)).then(()=>{let e=null;const t=new Promise(t=>e=t),n=this.injector.get(rn),i=this.injector.get(bn);return"disabled"===i.initialNavigation?(n.setUpLocationChangeListener(),e(!0)):"enabled"===i.initialNavigation||"enabledBlocking"===i.initialNavigation?(n.hooks.afterPreactivation=()=>this.initNavigation?Object(o.a)(null):(this.initNavigation=!0,e(!0),this.resultOfPreactivationDone),n.initialNavigation()):e(!0),t})}bootstrapListener(e){const t=this.injector.get(bn),n=this.injector.get(pn),i=this.injector.get(mn),s=this.injector.get(rn),o=this.injector.get(r.g);e===o.components[0]&&("enabledNonBlocking"!==t.initialNavigation&&void 0!==t.initialNavigation||s.initialNavigation(),n.setUpPreloading(),i.init(),s.resetRootComponentType(o.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.v))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();function Tn(e){return e.appInitializer.bind(e)}function Mn(e){return e.bootstrapListener.bind(e)}const Cn=new r.u("Router Initializer")},iSVu:function(e,t,n){var i=n("4zBA"),r=n("Fib7"),s=n("xs3f"),o=i(Function.toString);r(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},iYuL:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},icBU:function(e,t){e.exports=function(e,t){for(var i=[],r=0;r<e.length;r++){var s=t(e[r],r);n(s)?i.push.apply(i,s):i.push(s)}return i};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},insk:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var i=n("20UP"),r=n("oxzT"),s=n("8Y7J"),o=n("cUpR"),a=n("SVse"),c=n("XFyV"),l=n("/NlG"),u=n("6qls"),d=n("ANnk"),h=n("s7LF");function f(e,t){1&e&&(s.Xb(0,"cd-loading-panel"),s.bc(1,2),s.Wb())}function p(e,t){1&e&&(s.Xb(0,"cd-alert-panel",3),s.hc(1,4),s.Sb(2,"cd-doc",5),s.ec(),s.Wb())}function m(e,t){1&e&&(s.Xb(0,"cd-alert-panel",3),s.hc(1,6),s.Sb(2,"cd-doc",5),s.ec(),s.Wb())}function b(e,t){if(1&e&&(s.Xb(0,"option",19),s.Rc(1),s.Wb()),2&e){const e=t.$implicit;s.uc("ngValue",e.value),s.Db(1),s.Tc("",e.name," ")}}const g=function(e){return[e]};function _(e,t){if(1&e){const e=s.Yb();s.Vb(0),s.Xb(1,"div",7),s.Xb(2,"div",8),s.Xb(3,"div",9),s.Xb(4,"label",10),s.bc(5,11),s.Wb(),s.Xb(6,"select",12),s.lc("ngModelChange",function(t){return s.Ic(e),s.nc().time=t})("ngModelChange",function(t){return s.Ic(e),s.nc().onTimepickerChange(t)}),s.Pc(7,b,2,2,"option",13),s.Wb(),s.Xb(8,"button",14),s.lc("click",function(){return s.Ic(e),s.nc().reset()}),s.Sb(9,"i",15),s.Wb(),s.Wb(),s.Wb(),s.Wb(),s.Xb(10,"div",7),s.Xb(11,"div",8),s.Xb(12,"div",16),s.Sb(13,"iframe",17,18),s.Wb(),s.Wb(),s.Wb(),s.Ub()}if(2&e){const e=s.nc();s.Db(6),s.uc("ngModel",e.time),s.Db(1),s.uc("ngForOf",e.grafanaTimes),s.Db(2),s.uc("ngClass",s.zc(5,g,e.icons.undo)),s.Db(4),s.uc("src",e.grafanaSrc,s.Kc)("ngClass",e.panelStyle)}}let v=(()=>{class e{constructor(e,t){this.sanitizer=e,this.settingsService=t,this.grafanaExist=!1,this.mode="&kiosk",this.datasource="Dashboard1",this.loading=!0,this.styles={},this.dashboardExist=!0,this.icons=r.a,this.DEFAULT_TIME="from=now-1h&to=now",this.grafanaTimes=[{name:"Last 5 minutes",value:"from=now-5m&to=now"},{name:"Last 15 minutes",value:"from=now-15m&to=now"},{name:"Last 30 minutes",value:"from=now-30m&to=now"},{name:"Last 1 hour (Default)",value:"from=now-1h&to=now"},{name:"Last 3 hours",value:"from=now-3h&to=now"},{name:"Last 6 hours",value:"from=now-6h&to=now"},{name:"Last 12 hours",value:"from=now-12h&to=now"},{name:"Last 24 hours",value:"from=now-24h&to=now"},{name:"Yesterday",value:"from=now-1d%2Fd&to=now-1d%2Fd"},{name:"Today so far",value:"from=now%2Fd&to=now"},{name:"Day before yesterday",value:"from=now-2d%2Fd&to=now-2d%2Fd"},{name:"Last 2 days",value:"from=now-2d&to=now"},{name:"This day last week",value:"from=now-7d%2Fd&to=now-7d%2Fd"},{name:"Previous week",value:"from=now-1w%2Fw&to=now-1w%2Fw"},{name:"This week so far",value:"from=now%2Fw&to=now"},{name:"Last 7 days",value:"from=now-7d&to=now"},{name:"Previous month",value:"from=now-1M%2FM&to=now-1M%2FM"},{name:"This month so far",value:"from=now%2FM&to=now"},{name:"Last 30 days",value:"from=now-30d&to=now"},{name:"Last 90 days",value:"from=now-90d&to=now"},{name:"Last 6 months",value:"from=now-6M&to=now"},{name:"Last 1 year",value:"from=now-1y&to=now"},{name:"Previous year",value:"from=now-1y%2Fy&to=now-1y%2Fy"},{name:"This year so far",value:"from=now%2Fy&to=now"},{name:"Last 2 years",value:"from=now-2y&to=now"},{name:"Last 5 years",value:"from=now-5y&to=now"}]}ngOnInit(){this.time=this.DEFAULT_TIME,this.styles={one:"grafana_one",two:"grafana_two",three:"grafana_three",four:"grafana_four"},this.settingsService.ifSettingConfigured("api/grafana/url",e=>{this.grafanaExist=!0,this.loading=!1,this.baseUrl=e+"/d/",this.getFrame()}),this.panelStyle=this.styles[this.grafanaStyle]}getFrame(){this.settingsService.validateGrafanaDashboardUrl(this.uid).subscribe(e=>this.dashboardExist=200===e),this.url=this.baseUrl+this.uid+"/"+this.grafanaPath+"&refresh=2s"+`&var-datasource=${this.datasource}`+this.mode+"&"+this.time,this.grafanaSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.url)}onTimepickerChange(){this.grafanaExist&&this.getFrame()}reset(){this.time=this.DEFAULT_TIME,this.grafanaExist&&this.getFrame()}ngOnChanges(){this.grafanaExist&&this.getFrame()}}return e.\u0275fac=function(t){return new(t||e)(s.Rb(o.b),s.Rb(i.a))},e.\u0275cmp=s.Lb({type:e,selectors:[["cd-grafana"]],inputs:{grafanaPath:"grafanaPath",grafanaStyle:"grafanaStyle",uid:"uid"},features:[s.Bb],decls:4,vars:4,consts:function(){let e,t,n,i,r;return e="Loading panel data...",t="Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to configure and enable the monitoring functionality.",n="Grafana Dashboard doesn't exist. Please refer to " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to add dashboards to Grafana.",i="Grafana Time Picker",r="Reset Settings",[[4,"ngIf"],["type","info",4,"ngIf"],e,["type","info"],t,["section","grafana"],n,[1,"row"],[1,"col"],[1,"form-inline","timepicker"],["for","timepicker",1,"ml-1","my-1"],i,["id","timepicker","name","timepicker",1,"custom-select","my-1","mx-3",3,"ngModel","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],["title",r,1,"btn","btn-light","my-1",3,"click"],[3,"ngClass"],[1,"grafana-container"],["id","iframe","frameborder","0","scrolling","no",1,"grafana",3,"src","ngClass"],["iframe",""],[3,"ngValue"]]},template:function(e,t){1&e&&(s.Pc(0,f,2,0,"cd-loading-panel",0),s.Pc(1,p,3,0,"cd-alert-panel",1),s.Pc(2,m,3,0,"cd-alert-panel",1),s.Pc(3,_,15,7,"ng-container",0)),2&e&&(s.uc("ngIf",t.loading&&t.grafanaExist),s.Db(1),s.uc("ngIf",!t.grafanaExist),s.Db(1),s.uc("ngIf",!t.dashboardExist),s.Db(1),s.uc("ngIf",t.grafanaExist&&t.dashboardExist))},directives:[a.r,c.a,l.a,u.a,d.a,h.z,h.q,h.t,a.q,a.p,h.u,h.C],styles:[".grafana[_ngcontent-%COMP%]{height:600px;width:100%;z-index:0}.grafana_one[_ngcontent-%COMP%]{height:400px}.grafana_two[_ngcontent-%COMP%]{height:750px}.grafana_three[_ngcontent-%COMP%]{height:900px}.grafana_four[_ngcontent-%COMP%]{height:1160px}.timepicker[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:700}.dropdown-menu[_ngcontent-%COMP%]{left:auto;right:20px;top:20px}"]}),e})()},iqWW:function(e,t,n){"use strict";var i=n("ZUd8").charAt;e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},itXk:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("z+Ro"),r=n("DH7j"),s=n("l7GE"),o=n("ZUHj"),a=n("yCtX");const c={};function l(...e){let t,n;return Object(i.a)(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Object(r.a)(e[0])&&(e=e[0]),Object(a.a)(e,n).lift(new u(t))}class u{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new d(e,this.resultSelector))}}class d extends s.a{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(c),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let n=0;n<t;n++){const t=e[n];this.add(Object(o.a)(this,t,void 0,n))}}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,n){const i=this.values,r=this.toRespond?i[n]===c?--this.toRespond:this.toRespond:0;i[n]=t,0===r&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},"jKX/":function(e,t,n){"use strict";n.d(t,"a",function(){return r});class i{constructor(e=[]){["read","create","update","delete"].forEach(t=>this[t]=e.includes(t))}}class r{constructor(e){this.hosts=new i(e.hosts),this.configOpt=new i(e["config-opt"]),this.pool=new i(e.pool),this.osd=new i(e.osd),this.monitor=new i(e.monitor),this.rbdImage=new i(e["rbd-image"]),this.iscsi=new i(e.iscsi),this.rbdMirroring=new i(e["rbd-mirroring"]),this.rgw=new i(e.rgw),this.cephfs=new i(e.cephfs),this.manager=new i(e.manager),this.log=new i(e.log),this.user=new i(e.user),this.grafana=new i(e.grafana),this.prometheus=new i(e.prometheus),this.nfs=new i(e["nfs-ganesha"])}}},jN84:function(e,t,n){"use strict";var i=n("WJ6P"),r=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;t.a=s?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var i=-1,s=null==t?0:t.length,o=0,a=[];++i<s;){var c=t[i];r.call(e,c)&&(a[o++]=c)}return a}(s(e)))}:i.a},jUeY:function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2_\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2_\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2_\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2_\u039c\u03ac\u03b9\u03bf\u03c2_\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2_\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2_\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2_\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2_\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2_\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2_\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2".split("_"),monthsGenitiveEl:"\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5_\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5_\u039c\u03b1\u0390\u03bf\u03c5_\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5_\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5_\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5_\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5_\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"\u0399\u03b1\u03bd_\u03a6\u03b5\u03b2_\u039c\u03b1\u03c1_\u0391\u03c0\u03c1_\u039c\u03b1\u03ca_\u0399\u03bf\u03c5\u03bd_\u0399\u03bf\u03c5\u03bb_\u0391\u03c5\u03b3_\u03a3\u03b5\u03c0_\u039f\u03ba\u03c4_\u039d\u03bf\u03b5_\u0394\u03b5\u03ba".split("_"),weekdays:"\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae_\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1_\u03a4\u03c1\u03af\u03c4\u03b7_\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7_\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7_\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae_\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf".split("_"),weekdaysShort:"\u039a\u03c5\u03c1_\u0394\u03b5\u03c5_\u03a4\u03c1\u03b9_\u03a4\u03b5\u03c4_\u03a0\u03b5\u03bc_\u03a0\u03b1\u03c1_\u03a3\u03b1\u03b2".split("_"),weekdaysMin:"\u039a\u03c5_\u0394\u03b5_\u03a4\u03c1_\u03a4\u03b5_\u03a0\u03b5_\u03a0\u03b1_\u03a3\u03b1".split("_"),meridiem:function(e,t,n){return e>11?n?"\u03bc\u03bc":"\u039c\u039c":n?"\u03c0\u03bc":"\u03a0\u039c"},isPM:function(e){return"\u03bc"===(e+"").toLowerCase()[0]},meridiemParse:/[\u03a0\u039c]\.?\u039c?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[\u03a3\u03ae\u03bc\u03b5\u03c1\u03b1 {}] LT",nextDay:"[\u0391\u03cd\u03c1\u03b9\u03bf {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[\u03a7\u03b8\u03b5\u03c2 {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[\u03c4\u03bf \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf] dddd [{}] LT";default:return"[\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,i=this._calendarEl[e],r=t&&t.hours();return n=i,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(i=i.apply(t)),i.replace("{}",r%12==1?"\u03c3\u03c4\u03b7":"\u03c3\u03c4\u03b9\u03c2")},relativeTime:{future:"\u03c3\u03b5 %s",past:"%s \u03c0\u03c1\u03b9\u03bd",s:"\u03bb\u03af\u03b3\u03b1 \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",ss:"%d \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",m:"\u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",mm:"%d \u03bb\u03b5\u03c0\u03c4\u03ac",h:"\u03bc\u03af\u03b1 \u03ce\u03c1\u03b1",hh:"%d \u03ce\u03c1\u03b5\u03c2",d:"\u03bc\u03af\u03b1 \u03bc\u03ad\u03c1\u03b1",dd:"%d \u03bc\u03ad\u03c1\u03b5\u03c2",M:"\u03ad\u03bd\u03b1\u03c2 \u03bc\u03ae\u03bd\u03b1\u03c2",MM:"%d \u03bc\u03ae\u03bd\u03b5\u03c2",y:"\u03ad\u03bd\u03b1\u03c2 \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2",yy:"%d \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1"},dayOfMonthOrdinalParse:/\d{1,2}\u03b7/,ordinal:"%d\u03b7",week:{dow:1,doy:4}})}(n("wd/R"))},jVDg:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e,t,n){this.poolName=e,this.namespace=t,this.imageName=n}static fromString(e){const t=e.split("/");return new this(t[0],t.length>=3?t[1]:null,t.length>=3?t[2]:t[1])}getNameSpace(){return this.namespace?`${this.namespace}/`:""}toString(){return`${this.poolName}/${this.getNameSpace()}${this.imageName}`}toStringEncoded(){return encodeURIComponent(`${this.poolName}/${this.getNameSpace()}${this.imageName}`)}}},jVdC:function(e,t,n){!function(e){"use strict";var t="stycze\u0144_luty_marzec_kwiecie\u0144_maj_czerwiec_lipiec_sierpie\u0144_wrzesie\u0144_pa\u017adziernik_listopad_grudzie\u0144".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_wrze\u015bnia_pa\u017adziernika_listopada_grudnia".split("_"),i=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^pa\u017a/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var i=e+" ";switch(n){case"ss":return i+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minut\u0119";case"mm":return i+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzin\u0119";case"hh":return i+(r(e)?"godziny":"godzin");case"ww":return i+(r(e)?"tygodnie":"tygodni");case"MM":return i+(r(e)?"miesi\u0105ce":"miesi\u0119cy");case"yy":return i+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,i){return e?/D MMMM/.test(i)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_pa\u017a_lis_gru".split("_"),monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"niedziela_poniedzia\u0142ek_wtorek_\u015broda_czwartek_pi\u0105tek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_\u015br_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_\u015ar_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dzi\u015b o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedziel\u0119 o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W \u015brod\u0119 o] LT";case 6:return"[W sobot\u0119 o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zesz\u0142\u0105 niedziel\u0119 o] LT";case 3:return"[W zesz\u0142\u0105 \u015brod\u0119 o] LT";case 6:return"[W zesz\u0142\u0105 sobot\u0119 o] LT";default:return"[W zesz\u0142y] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzie\u0144",dd:"%d dni",w:"tydzie\u0144",ww:s,M:"miesi\u0105c",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},jZKg:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("HDdC"),r=n("quSY");function s(e,t){return new i.a(n=>{const i=new r.a;let s=0;return i.add(t.schedule(function(){s!==e.length?(n.next(e[s++]),n.closed||i.add(this.schedule())):n.complete()})),i})}},jfSC:function(e,t,n){!function(e){"use strict";var t={1:"\u06f1",2:"\u06f2",3:"\u06f3",4:"\u06f4",5:"\u06f5",6:"\u06f6",7:"\u06f7",8:"\u06f8",9:"\u06f9",0:"\u06f0"},n={"\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9","\u06f0":"0"};e.defineLocale("fa",{months:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),monthsShort:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),weekdays:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysShort:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u062c_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631|\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/,isPM:function(e){return/\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/.test(e)},meridiem:function(e,t,n){return e<12?"\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631":"\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631"},calendar:{sameDay:"[\u0627\u0645\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",nextDay:"[\u0641\u0631\u062f\u0627 \u0633\u0627\u0639\u062a] LT",nextWeek:"dddd [\u0633\u0627\u0639\u062a] LT",lastDay:"[\u062f\u06cc\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",lastWeek:"dddd [\u067e\u06cc\u0634] [\u0633\u0627\u0639\u062a] LT",sameElse:"L"},relativeTime:{future:"\u062f\u0631 %s",past:"%s \u067e\u06cc\u0634",s:"\u0686\u0646\u062f \u062b\u0627\u0646\u06cc\u0647",ss:"%d \u062b\u0627\u0646\u06cc\u0647",m:"\u06cc\u06a9 \u062f\u0642\u06cc\u0642\u0647",mm:"%d \u062f\u0642\u06cc\u0642\u0647",h:"\u06cc\u06a9 \u0633\u0627\u0639\u062a",hh:"%d \u0633\u0627\u0639\u062a",d:"\u06cc\u06a9 \u0631\u0648\u0632",dd:"%d \u0631\u0648\u0632",M:"\u06cc\u06a9 \u0645\u0627\u0647",MM:"%d \u0645\u0627\u0647",y:"\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/[\u06f0-\u06f9]/g,function(e){return n[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"\u060c")},dayOfMonthOrdinalParse:/\d{1,2}\u0645/,ordinal:"%d\u0645",week:{dow:6,doy:12}})}(n("wd/R"))},jnO4:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},i=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},s=function(e){return function(t,n,s,o){var a=i(t),c=r[e][i(t)];return 2===a&&(c=c[n?0:1]),c.replace(/%d/i,t)}},o=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,function(e){return n[e]}).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},jtHE:function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("XNiG"),r=n("3N8a");class s extends r.a{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(e,t,n):e.flush(this)}}var o=n("IjjT");class a extends o.a{}const c=new a(s);var l=n("quSY"),u=n("pxpQ"),d=n("9ppp"),h=n("Ylt2");class f extends i.a{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new p(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,n=t?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,r=n.length;let s;if(this.closed)throw new d.a;if(this.isStopped||this.hasError?s=l.a.EMPTY:(this.observers.push(e),s=new h.a(this,e)),i&&e.add(e=new u.a(e,i)),t)for(let o=0;o<r&&!e.closed;o++)e.next(n[o]);else for(let o=0;o<r&&!e.closed;o++)e.next(n[o].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),s}_getNow(){return(this.scheduler||c).now()}_trimBufferThenGetEvents(){const e=this._getNow(),t=this._bufferSize,n=this._windowTime,i=this._events,r=i.length;let s=0;for(;s<r&&!(e-i[s].time<n);)s++;return r>t&&(s=Math.max(s,r-t)),s>0&&i.splice(0,s),i}}class p{constructor(e,t){this.time=e,this.value=t}}},kEOa:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u09b0\u09be\u09a4|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t&&e>=4||"\u09a6\u09c1\u09aa\u09c1\u09b0"===t&&e<5||"\u09ac\u09bf\u0995\u09be\u09b2"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<10?"\u09b8\u0995\u09be\u09b2":e<17?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<20?"\u09ac\u09bf\u0995\u09be\u09b2":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},kJI8:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var i=n("SVse"),r=n("G0yt"),s=n("zWsK"),o=n("ChqD"),a=n("PCNd"),c=n("8Y7J");let l=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=c.Pb({type:e}),e.\u0275inj=c.Ob({imports:[[i.c,o.a,a.a,r.t,s.a]]}),e})()},kJWO:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")()},kOOl:function(e,t,n){var i=n("4zBA"),r=0,s=Math.random(),o=i(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+s,36)}},kOpN:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var i=100*e+t;return i<600?"\u51cc\u6668":i<900?"\u65e9\u4e0a":i<1130?"\u4e0a\u5348":i<1230?"\u4e2d\u5348":i<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},kRJp:function(e,t,n){var i=n("g6v/"),r=n("m/L8"),s=n("XGwC");e.exports=i?function(e,t,n){return r.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},kbA8:function(e,t,n){"use strict";function i(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var i=s(e,t,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+e.length,i[1]),post:n.slice(i[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}function s(e,t,n){var i,r,s,o,a,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(i=[],s=n.length;u>=0&&!a;)u==c?(i.push(u),c=n.indexOf(e,u+1)):1==i.length?a=[i.pop(),l]:((r=i.pop())<s&&(s=r,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;i.length&&(a=[s,o])}return a}e.exports=i,i.range=s},kmMV:function(e,t,n){"use strict";var i,r,s=n("xluM"),o=n("4zBA"),a=n("V37c"),c=n("rW0t"),l=n("n3/R"),u=n("VpIT"),d=n("fHMY"),h=n("afO8").get,f=n("/OPJ"),p=n("EHx7"),m=u("native-string-replace",String.prototype.replace),b=RegExp.prototype.exec,g=b,_=o("".charAt),v=o("".indexOf),y=o("".replace),w=o("".slice),D=(r=/b*/g,s(b,i=/a/,"a"),s(b,r,"a"),0!==i.lastIndex||0!==r.lastIndex),S=l.UNSUPPORTED_Y||l.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(D||x||S||f||p)&&(g=function(e){var t,n,i,r,o,l,u,f=this,p=h(f),k=a(e),T=p.raw;if(T)return T.lastIndex=f.lastIndex,t=s(g,T,k),f.lastIndex=T.lastIndex,t;var M=p.groups,C=S&&f.sticky,O=s(c,f),L=f.source,E=0,A=k;if(C&&(O=y(O,"y",""),-1===v(O,"g")&&(O+="g"),A=w(k,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==_(k,f.lastIndex-1))&&(L="(?: "+L+")",A=" "+A,E++),n=new RegExp("^(?:"+L+")",O)),x&&(n=new RegExp("^"+L+"$(?!\\s)",O)),D&&(i=f.lastIndex),r=s(b,C?n:f,A),C?r?(r.input=w(r.input,E),r[0]=w(r[0],E),r.index=f.lastIndex,f.lastIndex+=r[0].length):f.lastIndex=0:D&&r&&(f.lastIndex=f.global?r.index+r[0].length:i),x&&r&&r.length>1&&s(m,r[0],n,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)}),r&&M)for(r.groups=l=d(null),o=0;o<M.length;o++)l[(u=M[o])[0]]=r[u[1]];return r}),e.exports=g},"kn/O":function(e,t,n){"use strict";n.d(t,"a",function(){return h});var i=n("HDdC"),r=n("mtw6"),s=n("G1I9"),o=n("QTAa"),a=n("9nlD"),c=n("mSOc"),l=n("VXsX"),u=n("ufoC"),d=n("8Y7J");let h=(()=>{class e{constructor(e,t,n,i){this.notificationService=e,this.summaryService=t,this.taskMessageService=n,this.taskManagerService=i}wrapTaskAroundCall({task:e,call:t}){return new i.a(n=>{t.subscribe(t=>{202===t.status?this._handleExecutingTasks(e):(this.summaryService.refresh(),e.success=!0,this.notificationService.notifyTask(e))},t=>{e.success=!1,e.exception=t.error,n.error(t)},()=>{n.complete()})})}_handleExecutingTasks(e){const t=new s.b(r.a.info,this.taskMessageService.getRunningTitle(e));t.isFinishedTask=!0,this.notificationService.show(t);const n=new o.a(e.name,e.metadata);this.summaryService.addRunningTask(n),this.taskManagerService.subscribe(n.name,n.metadata,e=>{this.notificationService.notifyTask(e)})}}return e.\u0275fac=function(t){return new(t||e)(d.ic(a.a),d.ic(c.a),d.ic(u.a),d.ic(l.a))},e.\u0275prov=d.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},kvvV:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("t/zF");class r extends i.a{}},l5ep:function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn \xf4l",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("wd/R"))},l7GE:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");class r extends i.a{notifyNext(e,t,n,i,r){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}},lJxs:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(e,t))}}class s{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new o(e,this.project,this.thisArg))}}class o extends i.a{constructor(e,t,n){super(e),this.project=t,this.count=0,this.thisArg=n||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},lMq5:function(e,t,n){var i=n("0Dky"),r=n("Fib7"),s=/#|\.prototype\./,o=function(e,t){var n=c[a(e)];return n==u||n!=l&&(r(t)?i(t):!!t)},a=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},c=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},"lOp/":function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("PqYM"),r=n("pxpQ"),s=n("eIep"),o=n("jtHE"),a=n("D0XW"),c=n("8Y7J");class l{constructor(e){this.zone=e,this.scheduler=a.b}now(){return this.scheduler.now()}}let u=(()=>{class e extends l{constructor(e){super(e)}schedule(...e){return this.zone.runOutsideAngular(()=>this.scheduler.schedule.apply(this.scheduler,e))}}return e.\u0275fac=function(t){return new(t||e)(c.ic(c.D))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d=(()=>{class e extends l{constructor(e){super(e)}schedule(...e){return this.zone.run(()=>this.scheduler.schedule.apply(this.scheduler,e))}}return e.\u0275fac=function(t){return new(t||e)(c.ic(c.D))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),h=(()=>{class e{constructor(e,t){this.leave=e,this.enter=t}}return e.\u0275fac=function(t){return new(t||e)(c.ic(u),c.ic(d))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),f=(()=>{class e{constructor(e){this.ngZone=e,this.DEFAULT_REFRESH_INTERVAL=5e3,this.DEFAULT_DUE_TIME=0}get(e,t=this.DEFAULT_REFRESH_INTERVAL,n=this.DEFAULT_DUE_TIME){return Object(i.a)(n,t,this.ngZone.leave).pipe(Object(r.b)(this.ngZone.enter),Object(s.a)(e),function(e,t,n){let i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:void 0,refCount:!1,scheduler:void 0},e=>e.lift(function({bufferSize:e=Number.POSITIVE_INFINITY,windowTime:t=Number.POSITIVE_INFINITY,refCount:n,scheduler:i}){let r,s,a=0,c=!1,l=!1;return function(u){let d;a++,!r||c?(c=!1,r=new o.a(e,t,i),d=r.subscribe(this),s=u.subscribe({next(e){r.next(e)},error(e){c=!0,r.error(e)},complete(){l=!0,s=void 0,r.complete()}})):d=r.subscribe(this),this.add(()=>{a--,d.unsubscribe(),s&&!l&&n&&0===a&&(s.unsubscribe(),s=void 0,r=void 0)})}}(i))}({refCount:!0,bufferSize:1}))}}return e.\u0275fac=function(t){return new(t||e)(c.ic(h))},e.\u0275prov=c.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},lXzo:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u043c\u0438\u043d\u0443\u0442\u0430":"\u043c\u0438\u043d\u0443\u0442\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u043c\u0438\u043d\u0443\u0442\u0430_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442":"\u043c\u0438\u043d\u0443\u0442\u0443_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442",hh:"\u0447\u0430\u0441_\u0447\u0430\u0441\u0430_\u0447\u0430\u0441\u043e\u0432",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u044f_\u0434\u043d\u0435\u0439",ww:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043d\u0435\u0434\u0435\u043b\u0438_\u043d\u0435\u0434\u0435\u043b\u044c",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u0430_\u043c\u0435\u0441\u044f\u0446\u0435\u0432",yy:"\u0433\u043e\u0434_\u0433\u043e\u0434\u0430_\u043b\u0435\u0442"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}var n=[/^\u044f\u043d\u0432/i,/^\u0444\u0435\u0432/i,/^\u043c\u0430\u0440/i,/^\u0430\u043f\u0440/i,/^\u043c\u0430[\u0439\u044f]/i,/^\u0438\u044e\u043d/i,/^\u0438\u044e\u043b/i,/^\u0430\u0432\u0433/i,/^\u0441\u0435\u043d/i,/^\u043e\u043a\u0442/i,/^\u043d\u043e\u044f/i,/^\u0434\u0435\u043a/i];e.defineLocale("ru",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u044f_\u0444\u0435\u0432\u0440\u0430\u043b\u044f_\u043c\u0430\u0440\u0442\u0430_\u0430\u043f\u0440\u0435\u043b\u044f_\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433\u0443\u0441\u0442\u0430_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f_\u043e\u043a\u0442\u044f\u0431\u0440\u044f_\u043d\u043e\u044f\u0431\u0440\u044f_\u0434\u0435\u043a\u0430\u0431\u0440\u044f".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_")},monthsShort:{format:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_"),standalone:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440\u0442_\u0430\u043f\u0440._\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_")},weekdays:{standalone:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0430_\u0441\u0443\u0431\u0431\u043e\u0442\u0430".split("_"),format:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0443_\u0441\u0443\u0431\u0431\u043e\u0442\u0443".split("_"),isFormat:/\[ ?[\u0412\u0432] ?(?:\u043f\u0440\u043e\u0448\u043b\u0443\u044e|\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e|\u044d\u0442\u0443)? ?] ?dddd/},weekdaysShort:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsShortRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsStrictRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044f\u044c]|\u0444\u0435\u0432\u0440\u0430\u043b[\u044f\u044c]|\u043c\u0430\u0440\u0442\u0430?|\u0430\u043f\u0440\u0435\u043b[\u044f\u044c]|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044f\u044c]|\u0438\u044e\u043b[\u044f\u044c]|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043e\u043a\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043d\u043e\u044f\u0431\u0440[\u044f\u044c]|\u0434\u0435\u043a\u0430\u0431\u0440[\u044f\u044c])/i,monthsShortStrictRegex:/^(\u044f\u043d\u0432\.|\u0444\u0435\u0432\u0440?\.|\u043c\u0430\u0440[\u0442.]|\u0430\u043f\u0440\.|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044c\u044f.]|\u0438\u044e\u043b[\u044c\u044f.]|\u0430\u0432\u0433\.|\u0441\u0435\u043d\u0442?\.|\u043e\u043a\u0442\.|\u043d\u043e\u044f\u0431?\.|\u0434\u0435\u043a\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., H:mm",LLLL:"dddd, D MMMM YYYY \u0433., H:mm"},calendar:{sameDay:"[\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432] LT",nextDay:"[\u0417\u0430\u0432\u0442\u0440\u0430, \u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430, \u0432] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e] dddd, [\u0432] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u0443\u044e] dddd, [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0447\u0435\u0440\u0435\u0437 %s",past:"%s \u043d\u0430\u0437\u0430\u0434",s:"\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0447\u0430\u0441",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,w:"\u043d\u0435\u0434\u0435\u043b\u044f",ww:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u0438|\u0443\u0442\u0440\u0430|\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430/i,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0438":e<12?"\u0443\u0442\u0440\u0430":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0435\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e|\u044f)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-\u0439";case"D":return e+"-\u0433\u043e";case"w":case"W":return e+"-\u044f";default:return e}},week:{dow:1,doy:4}})}(n("wd/R"))},lYtQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){switch(n){case"s":return t?"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434":"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d";case"ss":return e+(t?" \u0441\u0435\u043a\u0443\u043d\u0434":" \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d");case"m":case"mm":return e+(t?" \u043c\u0438\u043d\u0443\u0442":" \u043c\u0438\u043d\u0443\u0442\u044b\u043d");case"h":case"hh":return e+(t?" \u0446\u0430\u0433":" \u0446\u0430\u0433\u0438\u0439\u043d");case"d":case"dd":return e+(t?" \u04e9\u0434\u04e9\u0440":" \u04e9\u0434\u0440\u0438\u0439\u043d");case"M":case"MM":return e+(t?" \u0441\u0430\u0440":" \u0441\u0430\u0440\u044b\u043d");case"y":case"yy":return e+(t?" \u0436\u0438\u043b":" \u0436\u0438\u043b\u0438\u0439\u043d");default:return e}}e.defineLocale("mn",{months:"\u041d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0425\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0413\u0443\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u04e9\u0440\u04e9\u0432\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0422\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0417\u0443\u0440\u0433\u0430\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u043e\u043b\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u041d\u0430\u0439\u043c\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0415\u0441\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u043d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u0445\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440".split("_"),monthsShort:"1 \u0441\u0430\u0440_2 \u0441\u0430\u0440_3 \u0441\u0430\u0440_4 \u0441\u0430\u0440_5 \u0441\u0430\u0440_6 \u0441\u0430\u0440_7 \u0441\u0430\u0440_8 \u0441\u0430\u0440_9 \u0441\u0430\u0440_10 \u0441\u0430\u0440_11 \u0441\u0430\u0440_12 \u0441\u0430\u0440".split("_"),monthsParseExact:!0,weekdays:"\u041d\u044f\u043c_\u0414\u0430\u0432\u0430\u0430_\u041c\u044f\u0433\u043c\u0430\u0440_\u041b\u0445\u0430\u0433\u0432\u0430_\u041f\u04af\u0440\u044d\u0432_\u0411\u0430\u0430\u0441\u0430\u043d_\u0411\u044f\u043c\u0431\u0430".split("_"),weekdaysShort:"\u041d\u044f\u043c_\u0414\u0430\u0432_\u041c\u044f\u0433_\u041b\u0445\u0430_\u041f\u04af\u0440_\u0411\u0430\u0430_\u0411\u044f\u043c".split("_"),weekdaysMin:"\u041d\u044f_\u0414\u0430_\u041c\u044f_\u041b\u0445_\u041f\u04af_\u0411\u0430_\u0411\u044f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D",LLL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm",LLLL:"dddd, YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm"},meridiemParse:/\u04ae\u04e8|\u04ae\u0425/i,isPM:function(e){return"\u04ae\u0425"===e},meridiem:function(e,t,n){return e<12?"\u04ae\u04e8":"\u04ae\u0425"},calendar:{sameDay:"[\u04e8\u043d\u04e9\u04e9\u0434\u04e9\u0440] LT",nextDay:"[\u041c\u0430\u0440\u0433\u0430\u0430\u0448] LT",nextWeek:"[\u0418\u0440\u044d\u0445] dddd LT",lastDay:"[\u04e8\u0447\u0438\u0433\u0434\u04e9\u0440] LT",lastWeek:"[\u04e8\u043d\u0433\u04e9\u0440\u0441\u04e9\u043d] dddd LT",sameElse:"L"},relativeTime:{future:"%s \u0434\u0430\u0440\u0430\u0430",past:"%s \u04e9\u043c\u043d\u04e9",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} \u04e9\u0434\u04e9\u0440/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" \u04e9\u0434\u04e9\u0440";default:return e}}})}(n("wd/R"))},lgnt:function(e,t,n){!function(e){"use strict";var t={0:"-\u0447\u04af",1:"-\u0447\u0438",2:"-\u0447\u0438",3:"-\u0447\u04af",4:"-\u0447\u04af",5:"-\u0447\u0438",6:"-\u0447\u044b",7:"-\u0447\u0438",8:"-\u0447\u0438",9:"-\u0447\u0443",10:"-\u0447\u0443",20:"-\u0447\u044b",30:"-\u0447\u0443",40:"-\u0447\u044b",50:"-\u0447\u04af",60:"-\u0447\u044b",70:"-\u0447\u0438",80:"-\u0447\u0438",90:"-\u0447\u0443",100:"-\u0447\u04af"};e.defineLocale("ky",{months:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u0416\u0435\u043a\u0448\u0435\u043c\u0431\u0438_\u0414\u04af\u0439\u0448\u04e9\u043c\u0431\u04af_\u0428\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0428\u0430\u0440\u0448\u0435\u043c\u0431\u0438_\u0411\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0416\u0443\u043c\u0430_\u0418\u0448\u0435\u043c\u0431\u0438".split("_"),weekdaysShort:"\u0416\u0435\u043a_\u0414\u04af\u0439_\u0428\u0435\u0439_\u0428\u0430\u0440_\u0411\u0435\u0439_\u0416\u0443\u043c_\u0418\u0448\u0435".split("_"),weekdaysMin:"\u0416\u043a_\u0414\u0439_\u0428\u0439_\u0428\u0440_\u0411\u0439_\u0416\u043c_\u0418\u0448".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u04af\u043d \u0441\u0430\u0430\u0442] LT",nextDay:"[\u042d\u0440\u0442\u0435\u04a3 \u0441\u0430\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0447\u044d\u044d \u0441\u0430\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u04e9\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u043d] dddd [\u043a\u04af\u043d\u04af] [\u0441\u0430\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0438\u0447\u0438\u043d\u0434\u0435",past:"%s \u043c\u0443\u0440\u0443\u043d",s:"\u0431\u0438\u0440\u043d\u0435\u0447\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0438\u0440 \u043c\u04af\u043d\u04e9\u0442",mm:"%d \u043c\u04af\u043d\u04e9\u0442",h:"\u0431\u0438\u0440 \u0441\u0430\u0430\u0442",hh:"%d \u0441\u0430\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0438\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0438\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0447\u0438|\u0447\u044b|\u0447\u04af|\u0447\u0443)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},lkxz:function(e,t,n){"use strict";var i=n("Ce4a");t.a=function(e){var t=new e.constructor(e.byteLength);return new i.a(t).set(new i.a(e)),t}},loYQ:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn-bd",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/\u09b0\u09be\u09a4|\u09ad\u09cb\u09b0|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t?e<4?e:e+12:"\u09ad\u09cb\u09b0"===t||"\u09b8\u0995\u09be\u09b2"===t?e:"\u09a6\u09c1\u09aa\u09c1\u09b0"===t?e>=3?e:e+12:"\u09ac\u09bf\u0995\u09be\u09b2"===t||"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<6?"\u09ad\u09cb\u09b0":e<12?"\u09b8\u0995\u09be\u09b2":e<15?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<18?"\u09ac\u09bf\u0995\u09be\u09b2":e<20?"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},lyxo:function(e,t,n){!function(e){"use strict";function t(e,t,n){var i=" ";return(e%100>=20||e>=100&&e%100==0)&&(i=" de "),e+i+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"s\u0103pt\u0103m\xe2ni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminic\u0103_luni_mar\u021bi_miercuri_joi_vineri_s\xe2mb\u0103t\u0103".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_S\xe2m".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_S\xe2".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[m\xe2ine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s \xeen urm\u0103",s:"c\xe2teva secunde",ss:t,m:"un minut",mm:t,h:"o or\u0103",hh:t,d:"o zi",dd:t,w:"o s\u0103pt\u0103m\xe2n\u0103",ww:t,M:"o lun\u0103",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("wd/R"))},"m/L8":function(e,t,n){var i=n("2oRo"),r=n("g6v/"),s=n("DPsx"),o=n("glrk"),a=n("oEtG"),c=i.TypeError,l=Object.defineProperty;t.f=r?l:function(e,t,n){if(o(e),t=a(t),o(n),s)try{return l(e,t,n)}catch(i){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},mCNh:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return s});var i=n("SpAZ");function r(...e){return s(e)}function s(e){return 0===e.length?i.a:1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}}},mSOc:function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n("LvDl"),r=n.n(i),s=n("2Vo4"),o=n("pLZG"),a=n("SxV6"),c=n("lOp/"),l=n("8Y7J"),u=n("IheW");let d=(()=>{class e{constructor(e,t){this.http=e,this.timerService=t,this.REFRESH_INTERVAL=5e3,this.summaryDataSource=new s.a(null),this.summaryData$=this.summaryDataSource.asObservable()}startPolling(){return this.timerService.get(()=>this.retrieveSummaryObservable(),this.REFRESH_INTERVAL).subscribe(this.retrieveSummaryObserver())}refresh(){return this.retrieveSummaryObservable().subscribe(this.retrieveSummaryObserver())}retrieveSummaryObservable(){return this.http.get("api/summary")}retrieveSummaryObserver(){return e=>{this.summaryDataSource.next(e)}}subscribeOnce(e,t){return this.summaryData$.pipe(Object(o.a)(e=>!!e),Object(a.a)()).subscribe(e,t)}subscribe(e,t){return this.summaryData$.pipe(Object(o.a)(e=>!!e)).subscribe(e,t)}addRunningTask(e){const t=this.summaryDataSource.getValue();t&&(r.a.isArray(t.executing_tasks)?t.executing_tasks.find(t=>t.name===e.name&&r.a.isEqual(t.metadata,e.metadata))||t.executing_tasks.push(e):t.executing_tasks=[e],this.summaryDataSource.next(t))}}return e.\u0275fac=function(t){return new(t||e)(l.ic(u.b),l.ic(c.a))},e.\u0275prov=l.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"mh/w":function(e,t,n){var i=n("2oRo"),r=n("xluM"),s=n("We1y"),o=n("glrk"),a=n("DVFp"),c=n("NaFW"),l=i.TypeError;e.exports=function(e,t){var n=arguments.length<2?c(e):t;if(s(n))return o(r(n,e));throw l(a(e)+" is not iterable")}},mkut:function(e,t,n){"use strict";var i=n("7gMY"),r=n("pyRK"),s=n("U6JX"),o=Object(s.a)(Object.keys,Object),a=Object.prototype.hasOwnProperty,c=n("5WsY");t.a=function(e){return Object(c.a)(e)?Object(i.a)(e):function(e){if(!Object(r.a)(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}},mrSG:function(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function r(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function s(e,t){return function(n,i){t(n,i,e)}}function o(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function a(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{c(i.next(e))}catch(t){s(t)}}function a(e){try{c(i.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((i=i.apply(e,t||[])).next())})}function c(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(a){s=[6,a],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}n.d(t,"f",function(){return i}),n.d(t,"b",function(){return r}),n.d(t,"e",function(){return s}),n.d(t,"d",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return c})},mtw6:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=function(e){return e[e.error=0]="error",e[e.info=1]="info",e[e.success=2]="success",e}({})},"n3/R":function(e,t,n){var i=n("0Dky"),r=n("2oRo").RegExp;t.UNSUPPORTED_Y=i(function(){var e=r("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),t.BROKEN_CARET=i(function(){var e=r("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},n561:function(e,t,n){"use strict";var i=n("tPH9"),r=n("UudT"),s=n("jN84"),o=n("WJ6P");t.a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Object(i.a)(t,Object(s.a)(e)),e=Object(r.a)(e);return t}:o.a},n6bG:function(e,t,n){"use strict";function i(e){return"function"==typeof e}n.d(t,"a",function(){return i})},nLtN:function(e,t,n){"use strict";var i=n("YHEm"),r=function(e,t){for(var n=e.length;n--;)if(Object(i.a)(e[n][0],t))return n;return-1},s=Array.prototype.splice;function o(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}o.prototype.clear=function(){this.__data__=[],this.size=0},o.prototype.delete=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():s.call(t,n,1),--this.size,0))},o.prototype.get=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]},o.prototype.has=function(e){return r(this.__data__,e)>-1},o.prototype.set=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},t.a=o},nQ07:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("LvDl"),r=n.n(i);class s{static updateChanged(e,t){let n=!1;return Object.keys(t).forEach(i=>{const s=t[i];r.a.isEqual(s,e[i])||(e[i]=s,n=!0)}),n}static cdVersionHeader(e,t){return`application/vnd.ceph.api.v${e}.${t}+json`}}},nSDx:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e){return r.a.isUndefined(e)||r.a.isNull(e)?"-":e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"empty",type:e,pure:!0}),e})()},nYR2:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("7o/Q"),r=n("quSY");function s(e){return t=>t.lift(new o(e))}class o{constructor(e){this.callback=e}call(e,t){return t.subscribe(new a(e,this.callback))}}class a extends i.a{constructor(e,t){super(e),this.add(new r.a(t))}}},ngJS:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=e=>t=>{for(let n=0,i=e.length;n<i&&!t.closed;n++)t.next(e[n]);t.complete()}},ntOU:function(e,t,n){"use strict";var i=n("rpNk").IteratorPrototype,r=n("fHMY"),s=n("XGwC"),o=n("1E5z"),a=n("P4y1"),c=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=r(i,{next:s(1,n)}),o(e,l,!1,!0),a[l]=c,e}},nyYc:function(e,t,n){!function(e){"use strict";var t=/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?|janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,n=[/^janv/i,/^f\xe9vr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^ao\xfbt/i,/^sept/i,/^oct/i,/^nov/i,/^d\xe9c/i];e.defineLocale("fr",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,monthsShortStrictRegex:/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},o1bE:function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},i=function(e){return function(i,r,s,o){var a=t(i),c=n[e][t(i)];return 2===a&&(c=c[r?0:1]),c.replace(/%d/i,i)}},r=["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0629","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:0,doy:4}})}(n("wd/R"))},"o4+5":function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("aXbf"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.formatter=e}transform(e){return this.formatter.format_number(e,1e3,["","k","M","G","T","P","E","Z","Y"])}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(i.a))},e.\u0275pipe=r.Qb({name:"dimless",type:e,pure:!0}),e})()},o8EM:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("PhyI"),r=n("8Y7J");let s=(()=>{class e{constructor(){this.sections=[{heading:"Quality of Service",class:"quality-of-service",options:[{name:"rbd_qos_bps_limit",displayName:"BPS Limit",description:"The desired limit of IO bytes per second.",type:i.b.bps},{name:"rbd_qos_iops_limit",displayName:"IOPS Limit",description:"The desired limit of IO operations per second.",type:i.b.iops},{name:"rbd_qos_read_bps_limit",displayName:"Read BPS Limit",description:"The desired limit of read bytes per second.",type:i.b.bps},{name:"rbd_qos_read_iops_limit",displayName:"Read IOPS Limit",description:"The desired limit of read operations per second.",type:i.b.iops},{name:"rbd_qos_write_bps_limit",displayName:"Write BPS Limit",description:"The desired limit of write bytes per second.",type:i.b.bps},{name:"rbd_qos_write_iops_limit",displayName:"Write IOPS Limit",description:"The desired limit of write operations per second.",type:i.b.iops},{name:"rbd_qos_bps_burst",displayName:"BPS Burst",description:"The desired burst limit of IO bytes.",type:i.b.bps},{name:"rbd_qos_iops_burst",displayName:"IOPS Burst",description:"The desired burst limit of IO operations.",type:i.b.iops},{name:"rbd_qos_read_bps_burst",displayName:"Read BPS Burst",description:"The desired burst limit of read bytes.",type:i.b.bps},{name:"rbd_qos_read_iops_burst",displayName:"Read IOPS Burst",description:"The desired burst limit of read operations.",type:i.b.iops},{name:"rbd_qos_write_bps_burst",displayName:"Write BPS Burst",description:"The desired burst limit of write bytes.",type:i.b.bps},{name:"rbd_qos_write_iops_burst",displayName:"Write IOPS Burst",description:"The desired burst limit of write operations.",type:i.b.iops}]}]}static getOptionsFromSections(e){return e.map(e=>e.options).reduce((e,t)=>e.concat(t))}filterConfigOptionsByName(t){return e.getOptionsFromSections(this.sections).filter(e=>e.name===t)}getOptionValueByName(e,t,n=""){const i=this.filterConfigOptionsByName(e);return 1===i.length?i.pop()[t]:n}getWritableSections(){return this.sections.map(e=>(e.options=e.options.filter(e=>!e.readOnly),e))}getOptionFields(){return e.getOptionsFromSections(this.sections)}getWritableOptionFields(){return e.getOptionsFromSections(this.getWritableSections())}getOptionByName(e){return this.filterConfigOptionsByName(e).pop()}getDisplayName(e){return this.getOptionValueByName(e,"displayName")}getDescription(e){return this.getOptionValueByName(e,"description")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},oEtG:function(e,t,n){var i=n("wE6v"),r=n("2bX/");e.exports=function(e){var t=i(e,"string");return r(t)?t:t+""}},oMSZ:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e){this.pwdExpirationSpan=0,this.pwdExpirationSpan=e.user_pwd_expiration_span,this.pwdExpirationWarning1=e.user_pwd_expiration_warning_1,this.pwdExpirationWarning2=e.user_pwd_expiration_warning_2}}},oSzE:function(e,t,n){"use strict";var i=n("nLtN"),r=n("3cmB"),s=n("DlmY");function o(e){var t=this.__data__=new i.a(e);this.size=t.size}o.prototype.clear=function(){this.__data__=new i.a,this.size=0},o.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},o.prototype.get=function(e){return this.__data__.get(e)},o.prototype.has=function(e){return this.__data__.has(e)},o.prototype.set=function(e,t){var n=this.__data__;if(n instanceof i.a){var o=n.__data__;if(!r.a||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new s.a(o)}return n.set(e,t),this.size=n.size,this},t.a=o},oYcn:function(e,t,n){"use strict";var i=n("8M4i"),r=n("Js68"),s=n("EUcb"),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1;var a=n("ovuK"),c=n("xutz"),l=c.a&&c.a.isTypedArray,u=l?Object(a.a)(l):function(e){return Object(s.a)(e)&&Object(r.a)(e.length)&&!!o[Object(i.a)(e)]};t.a=u},ocLN:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("s7LF"),r=n("8Y7J");let s=(()=>{class e{constructor(e){this.elRef=e,this.validationDisabled=!1}get hasErrors(){return this.formControlNames.some(e=>!e.valid&&e.dirty&&e.touched)&&!this.validationDisabled}get hasSuccess(){return!this.formControlNames.some(e=>!e.valid)&&this.formControlNames.some(e=>e.dirty&&e.touched)&&!this.validationDisabled}get label(){const e=this.elRef.nativeElement.querySelector("label");return e&&e.textContent?e.textContent.trim():"This field"}get isDirtyAndTouched(){return this.formControlNames.some(e=>e.dirty&&e.touched)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.n))},e.\u0275dir=r.Mb({type:e,selectors:[["",8,"form-group"]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,i.i,0),2&e){let e;r.Ec(e=r.mc())&&(t.formControlNames=e)}},hostVars:4,hostBindings:function(e,t){2&e&&r.Jb("has-error",t.hasErrors)("has-success",t.hasSuccess)},inputs:{validationDisabled:"validationDisabled"}}),e})()},"ohO+":function(e,t,n){"use strict";n.d(t,"a",function(){return es}),n.d(t,"b",function(){return _s}),n.d(t,"c",function(){return Ws});var i=n("8Y7J"),r=n("SVse"),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}function l(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}var u=[];Object.freeze(u);var d={};Object.freeze(d);var h={};function f(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:h}function p(){return++Ee.mobxGuid}function m(e){throw b(!1,e),"X"}function b(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is an production build."))}function g(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var _=function(){};function v(e){return null!==e&&"object"==typeof e}function y(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function w(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function D(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function S(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return v(e)&&!0===e[n]}}function x(e){return void 0!==f().Map&&e instanceof f().Map}function k(e){return e instanceof Set}function T(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function M(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function C(e){return null===e?null:"object"==typeof e?""+e:e}function O(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function L(e,t){D(e,O(),t)}function E(e){return e[O()]=I,e}function A(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function I(){return this}var R=function(){function e(e){void 0===e&&(e="Atom@"+p()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=oe.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return We(this)},e.prototype.reportChanged=function(){Pe(),function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.UP_TO_DATE&&(i.isTracing!==ae.NONE&&je(i,e),i.onBecomeStale()),i.dependenciesState=oe.STALE}}}(this),Fe()},e.prototype.toString=function(){return this.name},e}(),P=S("Atom",R);function F(e,t){return e===t}var W={identity:F,structural:function(e,t){return Gt(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||F(e,t)},shallow:function(e,t){return Gt(e,t,1)}},j={},Y={};function N(e,t){var n=t?j:Y;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return z(this),this[e]},set:function(t){z(this),this[e]=t}})}function z(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in w(e,"__mobxDidRunLazyInitializers",!0),t){var i=t[n];i.propertyCreator(e,i.prop,i.descriptor,i.decoratorTarget,i.decoratorArguments)}}}function $(e,t){return function(){var n,i=function(i,r,s,o){return!0===o?(t(i,r,s,i,n),null):(Object.prototype.hasOwnProperty.call(i,"__mobxDecorators")||w(i,"__mobxDecorators",a({},i.__mobxDecorators)),i.__mobxDecorators[r]={prop:r,propertyCreator:t,descriptor:s,decoratorTarget:i,decoratorArguments:n},N(r,e))};return H(arguments)?(n=u,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function H(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}function X(e,t,n){return ct(e)?e:Array.isArray(e)?te.array(e,{name:n}):y(e)?te.object(e,void 0,{name:n}):x(e)?te.map(e,{name:n}):k(e)?te.set(e,{name:n}):e}function V(e){return e}function B(e){var t=$(!0,function(t,n,i,r,s){!function(e,t,n,i){var r=Nt(e);if(dt(r)){var s=ft(r,{object:e,name:t,type:"add",newValue:n});if(!s)return;n=s.newValue}n=(r.values[t]=new Te(n,i,r.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return zt[e]||(zt[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),r.keys&&r.keys.push(t),function(e,t,n,i){var r=pt(e),s=He(),o=r||s?{type:"add",object:t,name:n,newValue:i}:null;s&&Ve(a({},o,{name:e.name,key:n})),r&&bt(e,o),s&&Ue()}(r,e,t,n)}(t,n,i?i.initializer?i.initializer.call(t):i.value:void 0,e)}),n=("undefined"!=typeof process&&process,t);return n.enhancer=e,n}var U={deep:!0,name:void 0,defaultDecorator:void 0};function q(e){return null==e?U:"string"==typeof e?{name:e,deep:!0}:e}function G(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?V:X}Object.freeze(U),Object.freeze({deep:!1,name:void 0,defaultDecorator:void 0});var J=B(X),K=B(function(e,t,n){return null==e||Vt(e)||Et(e)||Pt(e)||jt(e)?e:Array.isArray(e)?te.array(e,{name:n,deep:!1}):y(e)?te.object(e,void 0,{name:n,deep:!1}):x(e)?te.map(e,{name:n,deep:!1}):k(e)?te.set(e,{name:n,deep:!1}):m(!1)}),Q=B(V),Z=B(function(e,t,n){return Gt(e,t)?t:e}),ee={box:function(e,t){arguments.length>2&&ne("box");var n=q(t);return new Te(e,G(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&ne("shallowBox"),te.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&ne("array");var n=q(t);return new kt(e,G(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&ne("shallowArray"),te.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&ne("map");var n=q(t);return new It(e,G(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&ne("shallowMap"),te.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&ne("set");var n=q(t);return new Wt(e,G(n),n.name)},object:function(e,t,n){"string"==typeof arguments[1]&&ne("object");var i=q(n);return st({},e,t,i)},shallowObject:function(e,t){return"string"==typeof arguments[1]&&ne("shallowObject"),te.object(e,{},{name:t,deep:!1})},ref:Q,shallow:K,deep:J,struct:Z},te=function(e,t,n){if("string"==typeof arguments[1])return J.apply(null,arguments);if(ct(e))return e;var i=y(e)?te.object(e,t,n):Array.isArray(e)?te.array(e,t):x(e)?te.map(e,t):k(e)?te.set(e,t):e;if(i!==e)return i;m(!1)};function ne(e){m("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(ee).forEach(function(e){return te[e]=ee[e]});var ie=$(!1,function(e,t,n,i,r){var s,o,c,l;s=e,o=t,c=a({get:n.get,set:n.set},r[0]||{}),l=Nt(s),c.name=l.name+"."+o,c.context=s,l.values[o]=new Me(c),Object.defineProperty(s,o,function(e){return $t[e]||($t[e]={configurable:Ee.computedConfigurable,enumerable:!1,get:function(){return Ht(this).read(this,e)},set:function(t){Ht(this).write(this,e,t)}})}(o))}),re=ie({equals:W.structural}),se=function(e,t,n){if("string"==typeof t)return ie.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ie.apply(null,arguments);var i="object"==typeof t?t:{};return i.get=e,i.set="function"==typeof t?t:i.set,i.name=i.name||e.name||"",new Me(i)};se.struct=re;var oe=function(e){return e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE",e}({}),ae=function(e){return e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK",e}({}),ce=function(){return function(e){this.cause=e}}();function le(e){return e instanceof ce}function ue(e){switch(e.dependenciesState){case oe.UP_TO_DATE:return!1;case oe.NOT_TRACKING:case oe.STALE:return!0;case oe.POSSIBLY_STALE:for(var t=me(),n=e.observing,i=n.length,r=0;r<i;r++){var s=n[r];if(Ce(s)){if(Ee.disableErrorBoundaries)s.get();else try{s.get()}catch(o){return be(t),!0}if(e.dependenciesState===oe.STALE)return be(t),!0}}return ve(e),be(t),!1}}function de(e){var t=e.observers.length>0;Ee.computationDepth>0&&t&&m(!1),Ee.allowStateChanges||!t&&"strict"!==Ee.enforceActions||m(!1)}function he(e,t,n){var i=ge(!0);ve(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Ee.runId;var r,s=Ee.trackingDerivation;if(Ee.trackingDerivation=e,!0===Ee.disableErrorBoundaries)r=t.call(n);else try{r=t.call(n)}catch(o){r=new ce(o)}return Ee.trackingDerivation=s,function(e){for(var t=e.observing,n=e.observing=e.newObserving,i=oe.UP_TO_DATE,r=0,s=e.unboundDepsCount,o=0;o<s;o++)0===(a=n[o]).diffValue&&(a.diffValue=1,r!==o&&(n[r]=a),r++),a.dependenciesState>i&&(i=a.dependenciesState);for(n.length=r,e.newObserving=null,s=t.length;s--;)0===(a=t[s]).diffValue&&Ie(a,e),a.diffValue=0;for(;r--;){var a;1===(a=n[r]).diffValue&&(a.diffValue=0,Ae(a,e))}i!==oe.UP_TO_DATE&&(e.dependenciesState=i,e.onBecomeStale())}(e),_e(i),r}function fe(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Ie(t[n],e);e.dependenciesState=oe.NOT_TRACKING}function pe(e){var t=me(),n=e();return be(t),n}function me(){var e=Ee.trackingDerivation;return Ee.trackingDerivation=null,e}function be(e){Ee.trackingDerivation=e}function ge(e){var t=Ee.allowStateReads;return Ee.allowStateReads=e,t}function _e(e){Ee.allowStateReads=e}function ve(e){if(e.dependenciesState!==oe.UP_TO_DATE){e.dependenciesState=oe.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=oe.UP_TO_DATE}}var ye=0,we=1;function De(e,t){var n=function(){return Se(e,t,this,arguments)};return n.isMobxAction=!0,n}function Se(e,t,n,i){var r=function(e,t,n){var i=He()&&!!e,r=0;if(i){r=Date.now();var s=n&&n.length||0,o=new Array(s);if(s>0)for(var a=0;a<s;a++)o[a]=n[a];Ve({type:"action",name:e,object:t,arguments:o})}var c=me();Pe();var l={prevDerivation:c,prevAllowStateChanges:xe(!0),prevAllowStateReads:ge(!0),notifySpy:i,startTime:r,actionId:we++,parentActionId:ye};return ye=l.actionId,l}(e,n,i);try{return t.apply(n,i)}catch(s){throw r.error=s,s}finally{!function(e){ye!==e.actionId&&m("invalid action stack. did you forget to finish an action?"),ye=e.parentActionId,void 0!==e.error&&(Ee.suppressReactionErrors=!0),ke(e.prevAllowStateChanges),_e(e.prevAllowStateReads),Fe(),be(e.prevDerivation),e.notifySpy&&Ue({time:Date.now()-e.startTime}),Ee.suppressReactionErrors=!1}(r)}}function xe(e){var t=Ee.allowStateChanges;return Ee.allowStateChanges=e,t}function ke(e){Ee.allowStateChanges=e}var Te=function(e){function t(t,n,i,r,s){void 0===i&&(i="ObservableValue@"+p()),void 0===r&&(r=!0),void 0===s&&(s=W.default);var o=e.call(this,i)||this;return o.enhancer=n,o.name=i,o.equals=s,o.hasUnreportedChange=!1,o.value=n(t,void 0,i),r&&He()&&Xe({type:"create",name:o.name,newValue:""+o.value}),o}return o(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Ee.UNCHANGED){var n=He();n&&Ve({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Ue()}},t.prototype.prepareNewValue=function(e){if(de(this),dt(this)){var t=ft(this,{object:this,type:"update",newValue:e});if(!t)return Ee.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ee.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),pt(this)&&bt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return ht(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),mt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return C(this.get())},t}(R);Te.prototype[M()]=Te.prototype.valueOf,S("ObservableValue",Te);var Me=function(){function e(e){this.dependenciesState=oe.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=oe.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+p(),this.value=new ce(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=ae.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+p(),e.set&&(this.setter=De(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?W.structural:W.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState===oe.UP_TO_DATE){e.lowestObserverState=oe.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.UP_TO_DATE&&(i.dependenciesState=oe.POSSIBLY_STALE,i.isTracing!==ae.NONE&&je(i,e),i.onBecomeStale())}}}(this)},e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.get=function(){this.isComputing&&m("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ee.inBatch||0!==this.observers.length||this.keepAlive?(We(this),ue(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState!==oe.STALE){e.lowestObserverState=oe.STALE;for(var t=e.observers,n=t.length;n--;){var i=t[n];i.dependenciesState===oe.POSSIBLY_STALE?i.dependenciesState=oe.STALE:i.dependenciesState===oe.UP_TO_DATE&&(e.lowestObserverState=oe.UP_TO_DATE)}}}(this)):ue(this)&&(this.warnAboutUntrackedRead(),Pe(),this.value=this.computeValue(!1),Fe());var e=this.value;if(le(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(le(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){b(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else b(!1,!1)},e.prototype.trackAndCompute=function(){He()&&Xe({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===oe.NOT_TRACKING,n=this.computeValue(!0),i=t||le(e)||le(n)||!this.equals(e,n);return i&&(this.value=n),i},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ee.computationDepth++,e)t=he(this,this.derivation,this.scope);else if(!0===Ee.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(n){t=new ce(n)}return Ee.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(fe(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,i=!0,r=void 0;return Ze(function(){var s=n.get();if(!i||t){var o=me();e({type:"update",object:n,newValue:s,oldValue:r}),be(o)}i=!1,r=s})},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return C(this.get())},e}();Me.prototype[M()]=Me.prototype.valueOf;var Ce=S("ComputedValue",Me),Oe=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),Le=!0,Ee=function(){var e=f();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Le=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Oe).version&&(Le=!1),Le?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Oe):(setTimeout(function(){m("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Oe)}();function Ae(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ie(e,t){if(1===e.observers.length)e.observers.length=0,Re(e);else{var n=e.observers,i=e.observersIndexes,r=n.pop();if(r!==t){var s=i[t.__mapid]||0;s?i[r.__mapid]=s:delete i[r.__mapid],n[s]=r}delete i[t.__mapid]}}function Re(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ee.pendingUnobservations.push(e))}function Pe(){Ee.inBatch++}function Fe(){if(0==--Ee.inBatch){ze();for(var e=Ee.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Me&&n.suspend())}Ee.pendingUnobservations=[]}}function We(e){var t=Ee.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&Ee.inBatch>0&&Re(e),!1)}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===ae.BREAK){var n=[];Ye(ot(Bt(e,void 0)),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Me?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n    ")()}}function Ye(e,t,n){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(n).join("\t")+e.name),e.dependencies&&e.dependencies.forEach(function(e){return Ye(e,t,n+1)}))}var Ne=function(){function e(e,t,n,i){void 0===e&&(e="Reaction@"+p()),void 0===i&&(i=!1),this.name=e,this.onInvalidate=t,this.errorHandler=n,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=oe.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+p(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ae.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ee.pendingReactions.push(this),ze())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Pe(),this._isScheduled=!1,ue(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&He()&&Xe({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Fe()}},e.prototype.track=function(e){Pe();var t,n=He();n&&(t=Date.now(),Ve({name:this.name,type:"reaction"})),this._isRunning=!0;var i=he(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&fe(this),le(i)&&this.reportExceptionInDerivation(i.cause),n&&Ue({time:Date.now()-t}),Fe()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ee.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ee.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),He()&&Xe({type:"error",name:this.name,message:n,error:""+e}),Ee.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Pe(),fe(this),Fe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var i=lt(e);if(!i)return m(!1);i.isTracing===ae.NONE&&console.log("[mobx.trace] '"+i.name+"' tracing enabled"),i.isTracing=n?ae.BREAK:ae.LOG}(this,e)},e}();function ze(){Ee.inBatch>0||Ee.isRunningReactions||function(){Ee.isRunningReactions=!0;for(var e=Ee.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("Reaction doesn't converge to a stable state after 100 iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction()}Ee.isRunningReactions=!1}()}var $e=S("Reaction",Ne);function He(){return!!Ee.spyListeners.length}function Xe(e){if(Ee.spyListeners.length)for(var t=Ee.spyListeners,n=0,i=t.length;n<i;n++)t[n](e)}function Ve(e){Xe(a({},e,{spyReportStart:!0}))}var Be={spyReportEnd:!0};function Ue(e){Xe(e?a({},e,{spyReportEnd:!0}):Be)}function qe(){m(!1)}function Ge(e){return function(t,n,i){if(i){if(i.value)return{value:De(e,i.value),enumerable:!1,configurable:!0,writable:!0};var r=i.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return De(e,r.call(this))}}}return Je(e).apply(this,arguments)}}function Je(e){return function(t,n,i){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){w(this,n,Ke(e,t))}})}}var Ke=function(e,t,n,i){return 1===arguments.length&&"function"==typeof e?De(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?De(e,t):1===arguments.length&&"string"==typeof e?Ge(e):!0!==i?Ge(t).apply(null,arguments):void(e[t]=De(e.name||t,n.value))};function Qe(e,t,n){w(e,t,De(t,n.bind(e)))}function Ze(e,t){void 0===t&&(t=d);var n,i=t&&t.name||e.name||"Autorun@"+p();if(t.scheduler||t.delay){var r=tt(t),s=!1;n=new Ne(i,function(){s||(s=!0,r(function(){s=!1,n.isDisposed||n.track(o)}))},t.onError,t.requiresObservable)}else n=new Ne(i,function(){this.track(o)},t.onError,t.requiresObservable);function o(){e(n)}return n.schedule(),n.getDisposer()}Ke.bound=function(e,t,n,i){return!0===i?(Qe(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Qe(this,t,n.value||n.initializer.call(this)),this[t]},set:qe}:{enumerable:!1,configurable:!0,set:function(e){Qe(this,t,e)},get:function(){}}};var et=function(e){return e()};function tt(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:et}function nt(e,t,n){void 0===n&&(n=d),"boolean"==typeof n&&(n={fireImmediately:n});var i,r,s,o=n.name||"Reaction@"+p(),a=Ke(o,n.onError?(i=n.onError,r=t,function(){try{return r.apply(this,arguments)}catch(e){i.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=tt(n),u=!0,h=!1,f=n.compareStructural?W.structural:n.equals||W.default,m=new Ne(o,function(){u||c?b():h||(h=!0,l(b))},n.onError,n.requiresObservable);function b(){if(h=!1,!m.isDisposed){var t=!1;m.track(function(){var n=e(m);t=u||!f(s,n),s=n}),u&&n.fireImmediately&&a(s,m),u||!0!==t||a(s,m),u&&(u=!1)}}return m.schedule(),m.getDisposer()}function it(e,t,n){return rt("onBecomeUnobserved",e,t,n)}function rt(e,t,n,i){var r="function"==typeof i?Bt(t,n):Bt(t),s="function"==typeof i?i:n,o=r[e];return"function"!=typeof o?m(!1):(r[e]=function(){o.call(this),s.call(this)},function(){r[e]=o})}function st(e,t,n,i){var r=(i=q(i)).defaultDecorator||(!1===i.deep?Q:J);z(e),Nt(e,i.name,r.enhancer),Pe();try{for(var s in t){var o=Object.getOwnPropertyDescriptor(t,s),a=(n&&s in n?n[s]:o.get?ie:r)(e,s,o,!0);a&&Object.defineProperty(e,s,a)}}finally{Fe()}return e}function ot(e){var t,n,i={name:e.name};return e.observing&&e.observing.length>0&&(i.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(ot)),i}function at(e,t){if(null==e)return!1;if(void 0!==t){if(Vt(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return Vt(e)||!!e.$mobx||P(e)||$e(e)||Ce(e)}function ct(e){return 1!==arguments.length&&m(!1),at(e)}function lt(e){switch(e.length){case 0:return Ee.trackingDerivation;case 1:return Bt(e[0]);case 2:return Bt(e[0],e[1])}}function ut(e,t){void 0===t&&(t=void 0),Pe();try{return e.apply(t)}finally{Fe()}}function dt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function ht(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),g(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function ft(e,t){var n=me();try{var i=e.interceptors;if(i)for(var r=0,s=i.length;r<s&&(b(!(t=i[r](t))||t.type,"Intercept handlers should return nothing or a change object"),t);r++);return t}finally{be(n)}}function pt(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function mt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),g(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function bt(e,t){var n=me(),i=e.changeListeners;if(i){for(var r=0,s=(i=i.slice()).length;r<s;r++)i[r](t);be(n)}}var gt,_t,vt,yt,wt=(gt=!1,_t={},Object.defineProperty(_t,"0",{set:function(){gt=!0}}),Object.create(_t)[0]=1,!1===gt),Dt=0,St=function(){return function(){}}();vt=St,yt=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(vt.prototype,yt):void 0!==vt.prototype.__proto__?vt.prototype.__proto__=yt:vt.prototype=yt,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(St.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var xt=function(){function e(e,t,n,i){this.array=n,this.owned=i,this.values=[],this.lastKnownLength=0,this.atom=new R(e||"ObservableArray@"+p()),this.enhancer=function(n,i){return t(n,i,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return ht(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),mt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),i=0;i<e-t;i++)n[i]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>Dt&&Ot(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var i=this;de(this.atom);var r=this.values.length;if(void 0===e?e=0:e>r?e=r:e<0&&(e=Math.max(0,r+e)),t=1===arguments.length?r-e:null==t?0:Math.max(0,Math.min(t,r-e)),void 0===n&&(n=u),dt(this)){var s=ft(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!s)return u;t=s.removedCount,n=s.added}var o=(n=0===n.length?n:n.map(function(e){return i.enhancer(e,void 0)})).length-t;this.updateArrayLength(r,o);var a=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,a),this.dehanceValues(a)},e.prototype.spliceItemsIntoValues=function(e,t,n){var i;if(n.length<1e4)return(i=this.values).splice.apply(i,l([e,t],n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r},e.prototype.notifyArrayChildUpdate=function(e,t,n){var i=!this.owned&&He(),r=pt(this),s=r||i?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;i&&Ve(a({},s,{name:this.atom.name})),this.atom.reportChanged(),r&&bt(this,s),i&&Ue()},e.prototype.notifyArraySplice=function(e,t,n){var i=!this.owned&&He(),r=pt(this),s=r||i?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;i&&Ve(a({},s,{name:this.atom.name})),this.atom.reportChanged(),r&&bt(this,s),i&&Ue()},e}(),kt=function(e){function t(t,n,i,r){void 0===i&&(i="ObservableArray@"+p()),void 0===r&&(r=!1);var s=e.call(this)||this,o=new xt(i,n,s,r);if(D(s,"$mobx",o),t&&t.length){var a=xe(!0);s.spliceWithArray(0,0,t),ke(a)}return wt&&Object.defineProperty(o.array,"0",Tt),s}return o(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Et(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0);var i=this.findIndex.apply(this,arguments);return-1===i?void 0:this.get(i)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0);for(var i=this.peek(),r=i.length,s=n;s<r;s++)if(e.call(t,i[s],s,this))return s;return-1},t.prototype.splice=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var i,r=this.$mobx.values;i=e<t?l(r.slice(0,e),r.slice(e+1,t+1),[r[e]],r.slice(t+1)):l(r.slice(0,t),[r[e]],r.slice(t,e),r.slice(e+1)),this.replace(i)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,i=n.values;if(e<i.length){de(n.atom);var r=i[e];if(dt(n)){var s=ft(n,{type:"update",object:this,index:e,newValue:t});if(!s)return;t=s.newValue}(t=n.enhancer(t,r))!==r&&(i[e]=t,n.notifyArrayChildUpdate(e,t,r))}else{if(e!==i.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+i.length);n.spliceWithArray(e,0,[t])}},t}(St);L(kt.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return E({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(kt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),w(kt.prototype,A(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];b("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),w(kt.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)w(e,t[n],e[t[n]])}(kt.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var Tt=Mt(0);function Mt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Ct(e){Object.defineProperty(kt.prototype,""+e,Mt(e))}function Ot(e){for(var t=Dt;t<e;t++)Ct(t);Dt=e}Ot(1e3);var Lt=S("ObservableArrayAdministration",xt);function Et(e){return v(e)&&Lt(e.$mobx)}var At={},It=function(){function e(e,t,n){if(void 0===t&&(t=X),void 0===n&&(n="ObservableMap@"+p()),this.enhancer=t,this.name=n,this.$mobx=At,this._keys=new kt(void 0,V,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!Ee.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var i=n=new Te(this._has(e),V,this.name+"."+Rt(e)+"?",!1);this._hasMap.set(e,i),it(i,function(){return t._hasMap.delete(e)})}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(dt(this)){var i=ft(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!i)return this;t=i.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(dt(this)&&!(r=ft(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=He(),i=pt(this),r=i||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&Ve(a({},r,{name:this.name,key:e})),ut(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),i&&bt(this,r),n&&Ue(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==Ee.UNCHANGED){var i=He(),r=pt(this),s=r||i?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;i&&Ve(a({},s,{name:this.name,key:e})),n.setNewValue(t),r&&bt(this,s),i&&Ue()}},e.prototype._addValue=function(e,t){var n=this;ut(function(){var i=new Te(t,n.enhancer,n.name+"."+Rt(e),!1);n._data.set(e,i),t=i.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var i=He(),r=pt(this),s=r||i?{type:"add",object:this,name:e,newValue:t}:null;i&&Ve(a({},s,{name:this.name,key:e})),r&&bt(this,s),i&&Ue()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[O()]()},e.prototype.values=function(){var e=this,t=0;return E({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return E({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(i){return e.call(t,n.get(i),i,n)})},e.prototype.merge=function(e){var t=this;return Pt(e)&&(e=e.toJS()),ut(function(){y(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=c(e,2);return t.set(n[0],n[1])}):x(e)?e.constructor!==Map?m("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!=e&&m("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;ut(function(){pe(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return ut(function(){for(var n,i=x(n=e)||Pt(n)?n:Array.isArray(n)?new Map(n):y(n)?new Map(Object.entries(n)):m("Cannot convert to map from '"+n+"'"),r=t._keys,s=Array.from(i.keys()),o=!1,a=0;a<r.length;a++){var c=r[a];r.length===s.length&&c!==s[a]&&(o=!0),i.has(c)||(o=!0,t.delete(c))}i.forEach(function(e,n){t._data.has(n)||(o=!0),t.set(n,e)}),o&&t._keys.replace(s)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Rt(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Rt(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return mt(this,e)},e.prototype.intercept=function(e){return ht(this,e)},e}();function Rt(e){return e&&e.toString?e.toString():new String(e).toString()}L(It.prototype,function(){return this.entries()}),D(It.prototype,A(),"Map");var Pt=S("ObservableMap",It),Ft={},Wt=function(){function e(e,t,n){if(void 0===t&&(t=X),void 0===n&&(n="ObservableSet@"+p()),this.name=n,this.$mobx=Ft,this._data=new Set,this._atom=function(e,t,n){void 0===t&&(t=_),void 0===n&&(n=_);var i=new R(e);return rt("onBecomeObserved",i,t,void 0),it(i,n),i}(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,i){return t(e,i,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;ut(function(){pe(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(i){e.call(t,i,i,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if(de(this._atom),dt(this)&&!(r=ft(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){ut(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var n=He(),i=pt(this),r=i||n?{type:"add",object:this,newValue:e}:null;i&&bt(this,r)}return this},e.prototype.delete=function(e){var t=this;if(dt(this)&&!(r=ft(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=He(),i=pt(this),r=i||n?{type:"delete",object:this,oldValue:e}:null;return ut(function(){t._atom.reportChanged(),t._data.delete(e)}),i&&bt(this,r),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=T(this.keys()),n=T(this.values());return E({next:function(){var i=e;return e+=1,i<n.length?{value:[t[i],n[i]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=T(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),E({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return jt(e)&&(e=e.toJS()),ut(function(){Array.isArray(e)||k(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&m("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return mt(this,e)},e.prototype.intercept=function(e){return ht(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+T(this.keys()).join(", ")+" ]"},e}();L(Wt.prototype,function(){return this.values()}),D(Wt.prototype,A(),"Set");var jt=S("ObservableSet",Wt),Yt=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var i=this.target;i!==e&&this.illegalAccess(e,t);var r=this.values[t];if(r instanceof Me)r.set(n);else{if(dt(this)){if(!(c=ft(this,{type:"update",object:i,name:t,newValue:n})))return;n=c.newValue}if((n=r.prepareNewValue(n))!==Ee.UNCHANGED){var s=pt(this),o=He(),c=s||o?{type:"update",object:i,oldValue:r.value,name:t,newValue:n}:null;o&&Ve(a({},c,{name:this.name,key:t})),r.setNewValue(n),s&&bt(this,c),o&&Ue()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(dt(this)&&!(s=ft(this,{object:t,name:e,type:"remove"})))return;try{Pe();var n=pt(this),i=He(),r=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var s=n||i?{type:"remove",object:t,oldValue:r,name:e}:null;i&&Ve(a({},s,{name:this.name,key:e})),n&&bt(this,s),i&&Ue()}finally{Fe()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return mt(this,e)},e.prototype.intercept=function(e){return ht(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new kt(Object.keys(this.values).filter(function(t){return e.values[t]instanceof Te}),V,"keys("+this.name+")",!0)),this.keys.slice()},e}();function Nt(e,t,n){void 0===t&&(t=""),void 0===n&&(n=X);var i=e.$mobx;return i||(y(e)||(t=(e.constructor.name||"ObservableObject")+"@"+p()),t||(t="ObservableObject@"+p()),D(e,"$mobx",i=new Yt(e,t,n)),i)}var zt=Object.create(null),$t=Object.create(null);function Ht(e){return e.$mobx||(z(e),e.$mobx)}var Xt=S("ObservableObjectAdministration",Yt);function Vt(e){return!!v(e)&&(z(e),Xt(e.$mobx))}function Bt(e,t){if("object"==typeof e&&null!==e){if(Et(e))return void 0!==t&&m(!1),e.$mobx.atom;if(jt(e))return e.$mobx;if(Pt(e)){var n=e;return void 0===t?Bt(n._keys):((i=n._data.get(t)||n._hasMap.get(t))||m(!1),i)}var i;if(z(e),Vt(e))return t?((i=e.$mobx.values[t])||m(!1),i):m(!1);if(P(e)||Ce(e)||$e(e))return e}else if("function"==typeof e&&$e(e.$mobx))return e.$mobx;return m(!1)}function Ut(e,t){return e||m("Expecting some object"),void 0!==t?Ut(Bt(e,t)):P(e)||Ce(e)||$e(e)||Pt(e)||jt(e)?e:(z(e),e.$mobx?e.$mobx:void m(!1))}var qt=Object.prototype.toString;function Gt(e,t,n){return void 0===n&&(n=-1),Jt(e,t,n)}function Jt(e,t,n,i,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var s=typeof e;if("function"!==s&&"object"!==s&&"object"!=typeof t)return!1;e=Kt(e),t=Kt(t);var o=qt.call(e);if(o!==qt.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var a="[object Array]"===o;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in e&&"constructor"in t)return!1}if(0===n)return!1;n<0&&(n=-1),r=r||[];for(var u=(i=i||[]).length;u--;)if(i[u]===e)return r[u]===t;if(i.push(e),r.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!Jt(e[u],t[u],n-1,i,r))return!1}else{var d=Object.keys(e),h=void 0;if(u=d.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!Qt(t,h=d[u])||!Jt(e[h],t[h],n-1,i,r))return!1}return i.pop(),r.pop(),!0}function Kt(e){return Et(e)?e.peek():x(e)||Pt(e)||k(e)||jt(e)?T(e.entries()):e}function Qt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return Ee.spyListeners.push(e),g(function(){Ee.spyListeners=Ee.spyListeners.filter(function(t){return t!==e})})},extras:{getDebugName:function(e,t){return(void 0!==t?Bt(e,t):Vt(e)||Pt(e)||jt(e)?Ut(e):Bt(e)).name}},$mobx:"$mobx"});var Zt,en,tn,nn,rn=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},sn=function(e){return e},on=Math.max,an=function(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=on(i.length-t,0),o=Array(s);++r<s;)o[r]=i[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=i[r];return a[t]=n(o),rn(e,this,a)}},cn=n("AwXo"),ln=Date.now,un=(Zt=cn.a?function(e,t){return Object(cn.a)(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:sn,en=0,tn=0,function(){var e=ln(),t=16-(e-tn);if(tn=e,t>0){if(++en>=800)return arguments[0]}else en=0;return Zt.apply(void 0,arguments)}),dn=function(e,t){return un(an(e,t,sn),e+"")},hn=n("oSzE"),fn=n("uE2L"),pn=n("YHEm"),mn=function(e,t,n){(void 0!==n&&!Object(pn.a)(e[t],n)||void 0===n&&!(t in e))&&Object(fn.a)(e,t,n)},bn=function(e,t,n){for(var i=-1,r=Object(e),s=n(e),o=s.length;o--;){var a=s[++i];if(!1===t(r[a],a,r))break}return e},gn=n("3/ER"),_n=n("G4mU"),vn=n("eAQQ"),yn=n("hYPf"),wn=n("9f76"),Dn=n("/1FC"),Sn=n("5WsY"),xn=n("EUcb"),kn=n("WOAq"),Tn=n("vJtL"),Mn=n("IzLi"),Cn=n("8M4i"),On=n("UudT"),Ln=Function.prototype.toString,En=Object.prototype.hasOwnProperty,An=Ln.call(Object),In=function(e){if(!Object(xn.a)(e)||"[object Object]"!=Object(Cn.a)(e))return!1;var t=Object(On.a)(e);if(null===t)return!0;var n=En.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ln.call(n)==An},Rn=n("oYcn"),Pn=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Fn=n("+EKe"),Wn=n("4/q3"),jn=function e(t,n,i,r,s){t!==n&&bn(n,function(o,a){if(s||(s=new hn.a),Object(Mn.a)(o))!function(e,t,n,i,r,s,o){var a,c=Pn(e,n),l=Pn(t,n),u=o.get(l);if(u)mn(e,n,u);else{var d=s?s(c,l,n+"",e,t,o):void 0,h=void 0===d;if(h){var f=Object(Dn.a)(l),p=!f&&Object(kn.a)(l),m=!f&&!p&&Object(Rn.a)(l);d=l,f||p||m?Object(Dn.a)(c)?d=c:(a=c,Object(xn.a)(a)&&Object(Sn.a)(a)?d=Object(vn.a)(c):p?(h=!1,d=Object(gn.a)(l,!0)):m?(h=!1,d=Object(_n.a)(l,!0)):d=[]):In(l)||Object(wn.a)(l)?(d=c,Object(wn.a)(c)?d=function(e){return Object(Fn.a)(e,Object(Wn.a)(e))}(c):Object(Mn.a)(c)&&!Object(Tn.a)(c)||(d=Object(yn.a)(l))):h=!1}h&&(o.set(l,d),r(d,l,i,s,o),o.delete(l)),mn(e,n,d)}}(t,n,a,i,e,r,s);else{var c=r?r(Pn(t,a),o,a+"",t,n,s):void 0;void 0===c&&(c=o),mn(t,a,c)}},Wn.a)},Yn=function e(t,n,i,r,s,o){return Object(Mn.a)(t)&&Object(Mn.a)(n)&&(o.set(n,t),jn(t,n,void 0,e,o),o.delete(n)),t},Nn=n("cSlR"),zn=function(e,t,n){if(!Object(Mn.a)(n))return!1;var i=typeof t;return!!("number"==i?Object(Sn.a)(n)&&Object(Nn.a)(t,n.length):"string"==i&&t in n)&&Object(pn.a)(n[t],e)},$n=(nn=function(e,t,n,i){jn(e,t,n,i)},dn(function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(r=nn.length>3&&"function"==typeof r?(i--,r):void 0,s&&zn(t[0],t[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++n<i;){var o=t[n];o&&nn(e,o,n,r)}return e})),Hn=dn(function(e){return e.push(void 0,Yn),rn($n,void 0,e)}),Xn=function(e){return"symbol"==typeof e||Object(xn.a)(e)&&"[object Symbol]"==Object(Cn.a)(e)},Vn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bn=/^\w*$/,Un=function(e,t){if(Object(Dn.a)(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Xn(e))||Bn.test(e)||!Vn.test(e)||null!=t&&e in Object(t)},qn=n("DlmY");function Gn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(Gn.Cache||qn.a),n}Gn.Cache=qn.a;var Jn,Kn,Qn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zn=/\\(\\)?/g,ei=(Jn=Gn(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Qn,function(e,n,i,r){t.push(i?r.replace(Zn,"$1"):n||e)}),t},function(e){return 500===Kn.size&&Kn.clear(),e}),Kn=Jn.cache,Jn),ti=n("ylTp"),ni=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r},ii=ti.a?ti.a.prototype:void 0,ri=ii?ii.toString:void 0,si=function e(t){if("string"==typeof t)return t;if(Object(Dn.a)(t))return ni(t,e)+"";if(Xn(t))return ri?ri.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},oi=function(e){return null==e?"":si(e)},ai=function(e,t){return Object(Dn.a)(e)?e:Un(e,t)?[e]:ei(oi(e))},ci=function(e){if("string"==typeof e||Xn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},li=function(e,t){for(var n=0,i=(t=ai(t,e)).length;null!=e&&n<i;)e=e[ci(t[n++])];return n&&n==i?e:void 0},ui=function(e,t,n){var i=null==e?void 0:li(e,t);return void 0===i?n:i},di=n("CfRg"),hi=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},fi=function(e,t){return null==(e=function(e,t){return t.length<2?e:li(e,function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}(t,0,-1))}(e,t=ai(t,e)))||delete e[ci(hi(t))]},pi=function(e){return In(e)?void 0:e},mi=n("tPH9"),bi=ti.a?ti.a.isConcatSpreadable:void 0,gi=function(e){return Object(Dn.a)(e)||Object(wn.a)(e)||!!(bi&&e&&e[bi])},_i=function e(t,n,i,r,s){var o=-1,a=t.length;for(i||(i=gi),s||(s=[]);++o<a;){var c=t[o];n>0&&i(c)?n>1?e(c,n-1,i,r,s):Object(mi.a)(s,c):r||(s[s.length]=c)}return s},vi=function(e){return null!=e&&e.length?_i(e,1):[]},yi=function(e){return un(an(e,void 0,vi),e+"")},wi=n("TnHx"),Di=yi(function(e,t){var n={};if(null==e)return n;var i=!1;t=ni(t,function(t){return t=ai(t,e),i||(i=t.length>1),t}),Object(Fn.a)(e,Object(wi.a)(e),n),i&&(n=Object(di.a)(n,7,pi));for(var r=t.length;r--;)fi(n,t[r]);return n}),Si=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};function xi(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn.a;++t<n;)this.add(e[t])}xi.prototype.add=xi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},xi.prototype.has=function(e){return this.__data__.has(e)};var ki=xi,Ti=function(e,t){return e.has(t)},Mi=function(e,t,n,i,r,s){var o=1&n,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,f=2&n?new ki:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var p=e[d],m=t[d];if(i)var b=o?i(m,p,d,t,e,s):i(p,m,d,e,t,s);if(void 0!==b){if(b)continue;h=!1;break}if(f){if(!Si(t,function(e,t){if(!Ti(f,t)&&(p===e||r(p,e,n,i,s)))return f.push(t)})){h=!1;break}}else if(p!==m&&!r(p,m,n,i,s)){h=!1;break}}return s.delete(e),s.delete(t),h},Ci=n("Ce4a"),Oi=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n},Li=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},Ei=ti.a?ti.a.prototype:void 0,Ai=Ei?Ei.valueOf:void 0,Ii=n("TFwu"),Ri=Object.prototype.hasOwnProperty,Pi=n("YM6B"),Fi="[object Arguments]",Wi="[object Array]",ji="[object Object]",Yi=Object.prototype.hasOwnProperty,Ni=function e(t,n,i,r,s){return t===n||(null==t||null==n||!Object(xn.a)(t)&&!Object(xn.a)(n)?t!=t&&n!=n:function(e,t,n,i,r,s){var o=Object(Dn.a)(e),a=Object(Dn.a)(t),c=o?Wi:Object(Pi.a)(e),l=a?Wi:Object(Pi.a)(t),u=(c=c==Fi?ji:c)==ji,d=(l=l==Fi?ji:l)==ji,h=c==l;if(h&&Object(kn.a)(e)){if(!Object(kn.a)(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new hn.a),o||Object(Rn.a)(e)?Mi(e,t,n,i,r,s):function(e,t,n,i,r,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Ci.a(e),new Ci.a(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Object(pn.a)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Oi;case"[object Set]":if(a||(a=Li),e.size!=t.size&&!(1&i))return!1;var c=o.get(e);if(c)return c==t;i|=2,o.set(e,t);var l=Mi(a(e),a(t),i,r,s,o);return o.delete(e),l;case"[object Symbol]":if(Ai)return Ai.call(e)==Ai.call(t)}return!1}(e,t,c,n,i,r,s);if(!(1&n)){var f=u&&Yi.call(e,"__wrapped__"),p=d&&Yi.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,b=p?t.value():t;return s||(s=new hn.a),r(m,b,n,i,s)}}return!!h&&(s||(s=new hn.a),function(e,t,n,i,r,s){var o=1&n,a=Object(Ii.a)(e),c=a.length;if(c!=Object(Ii.a)(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:Ri.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var f=!0;s.set(e,t),s.set(t,e);for(var p=o;++l<c;){var m=e[u=a[l]],b=t[u];if(i)var g=o?i(b,m,u,t,e,s):i(m,b,u,e,t,s);if(!(void 0===g?m===b||r(m,b,n,i,s):g)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var _=e.constructor,v=t.constructor;_==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof v&&v instanceof v||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,i,r,s))}(t,n,i,r,e,s))},zi=function(e){return e==e&&!Object(Mn.a)(e)},$i=n("mkut"),Hi=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},Xi=function(e,t){return null!=e&&t in Object(e)},Vi=n("Js68"),Bi=function(e,t){return null!=e&&function(e,t,n){for(var i=-1,r=(t=ai(t,e)).length,s=!1;++i<r;){var o=ci(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=r?s:!!(r=null==e?0:e.length)&&Object(Vi.a)(r)&&Object(Nn.a)(o,r)&&(Object(Dn.a)(e)||Object(wn.a)(e))}(e,t,Xi)},Ui=function(e){return"function"==typeof e?e:null==e?sn:"object"==typeof e?Object(Dn.a)(e)?(r=e[1],Un(i=e[0])&&zi(r)?Hi(ci(i),r):function(e){var t=ui(e,i);return void 0===t&&t===r?Bi(e,i):Ni(r,t,3)}):1==(n=function(e){for(var t=Object($i.a)(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,zi(r)]}return t}(t=e)).length&&n[0][2]?Hi(n[0][0],n[0][1]):function(e){return e===t||function(e,t,n,i){var r=n.length,s=r;if(null==e)return!s;for(e=Object(e);r--;){var o=n[r];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){var a=(o=n[r])[0],c=e[a],l=o[1];if(o[2]){if(void 0===c&&!(a in e))return!1}else{var u,d=new hn.a;if(!(void 0===u?Ni(l,c,3,i,d):u))return!1}}return!0}(e,0,n)}:function(e){return Un(e)?(t=ci(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return li(t,e)}}(e);var t}(e);var t,n,i,r},qi=function(e,t){if(null==e)return e;if(!Object(Sn.a)(e))return function(e,t){return e&&bn(e,t,$i.a)}(e,t);for(var n=e.length,i=-1,r=Object(e);++i<n&&!1!==t(r[i],i,r););return e},Gi=function(e,t){var n;return qi(e,function(e,i,r){return!(n=t(e,i,r))}),!!n},Ji=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0},Ki=function(e,t){var n=!0;return qi(e,function(e,i,r){return n=!!t(e,i,r)}),n},Qi=function(e){return e&&e.length?e[0]:void 0},Zi=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var s=e[t];s&&(r[i++]=s)}return r},er=function(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1},tr=/\s/,nr=/^\s+/,ir=/^[-+]0x[0-9a-f]+$/i,rr=/^0b[01]+$/i,sr=/^0o[0-7]+$/i,or=parseInt,ar=function(e){if("number"==typeof e)return e;if(Xn(e))return NaN;if(Object(Mn.a)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Object(Mn.a)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;var n;e=(n=e)?n.slice(0,function(e){for(var t=e.length;t--&&tr.test(e.charAt(t)););return t}(n)+1).replace(nr,""):n;var i=rr.test(e);return i||sr.test(e)?or(e.slice(2),i?2:8):ir.test(e)?NaN:+e},cr=function(e){var t=function(e){return e?1/0===(e=ar(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),n=t%1;return t==t?n?t-n:t:0},lr=Math.max,ur=function(e,t,n){var i=Object(e);if(!Object(Sn.a)(e)){var r=Ui(t);e=Object($i.a)(e),t=function(e){return r(i[e],e,i)}}var s=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:cr(n);return r<0&&(r=lr(i+r,0)),er(e,Ui(t),r)}(e,t,n);return s>-1?i[r?e[s]:s]:void 0},dr=function(e){return"string"==typeof e||!Object(Dn.a)(e)&&Object(xn.a)(e)&&"[object String]"==Object(Cn.a)(e)},hr=n("Ju5/"),fr=function(){return hr.a.Date.now()},pr=Math.max,mr=Math.min,br=function(e){return e!=e},gr=Math.max,_r=function(e,t,n,i){var r;e=Object(Sn.a)(e)?e:null==(r=e)?[]:function(e,t){return ni(t,function(t){return e[t]})}(r,Object($i.a)(r)),n=n&&!i?cr(n):0;var s=e.length;return n<0&&(n=gr(s+n,0)),dr(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):er(e,br,n)}(e,t,n)>-1},vr=n("23KU"),yr=function(e,t,n,i){if(!Object(Mn.a)(e))return e;for(var r=-1,s=(t=ai(t,e)).length,o=s-1,a=e;null!=a&&++r<s;){var c=ci(t[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(r!=o){var u=a[c];void 0===(l=i?i(u,c,a):void 0)&&(l=Object(Mn.a)(u)?u:Object(Nn.a)(t[r+1])?[]:{})}Object(vr.a)(a,c,l),a=a[c]}return e},wr=yi(function(e,t){return null==e?{}:function(e,t){return function(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var o=t[i],a=li(e,o);n(0,o)&&yr(s,ai(o,e),a)}return s}(e,t,function(t,n){return Bi(e,n)})}(e,t)});function Dr(e,t){1&e&&(i.Xb(0,"span"),i.Rc(1,"loading..."),i.Wb())}const Sr=function(e){return{$implicit:e}};function xr(e,t){if(1&e&&(i.Vb(0),i.Xb(1,"div"),i.sc(2),i.Wb(),i.Ub()),2&e){const e=i.nc();i.Db(1),i.Nc("height",e.getTotalHeight())}}const kr=function(){return{dontDetach:!0}},Tr=["*"],Mr=["loadingTemplate"],Cr=["treeNodeTemplate"],Or=["treeNodeWrapperTemplate"],Lr=["treeNodeFullTemplate"],Er=["viewport"],Ar=function(e,t,n,i){return{loadingTemplate:e,treeNodeTemplate:t,treeNodeWrapperTemplate:n,treeNodeFullTemplate:i}};function Ir(e,t){if(1&e&&i.Sb(0,"tree-node-collection",4),2&e){const e=i.nc();i.uc("nodes",e.treeModel.roots)("treeModel",e.treeModel)("templates",i.Cc(3,Ar,e.loadingTemplate,e.treeNodeTemplate,e.treeNodeWrapperTemplate,e.treeNodeFullTemplate))}}function Rr(e,t){if(1&e&&i.Sb(0,"tree-node-drop-slot",5),2&e){const e=i.nc();i.uc("dropIndex",0)("node",e.treeModel.virtualRoot)}}function Pr(e,t){if(1&e&&i.Sb(0,"tree-node-drop-slot",6),2&e){const e=i.nc(3);i.uc("dropIndex",e.node.index)("node",e.node.parent)}}function Fr(e,t){if(1&e&&(i.Xb(0,"div"),i.Pc(1,Pr,1,2,"tree-node-drop-slot",3),i.Sb(2,"tree-node-wrapper",4),i.Sb(3,"tree-node-children",5),i.Sb(4,"tree-node-drop-slot",6),i.Wb()),2&e){const e=i.nc(2);i.Fb(e.node.getClass()),i.Jb("tree-node",!0)("tree-node-expanded",e.node.isExpanded&&e.node.hasChildren)("tree-node-collapsed",e.node.isCollapsed&&e.node.hasChildren)("tree-node-leaf",e.node.isLeaf)("tree-node-active",e.node.isActive)("tree-node-focused",e.node.isFocused),i.Db(1),i.uc("ngIf",0===e.index),i.Db(1),i.uc("node",e.node)("index",e.index)("templates",e.templates),i.Db(1),i.uc("node",e.node)("templates",e.templates),i.Db(1),i.uc("dropIndex",e.node.index+1)("node",e.node.parent)}}const Wr=function(e,t,n,i){return{$implicit:e,node:t,index:n,templates:i}};function jr(e,t){if(1&e&&(i.Vb(0),i.Pc(1,Fr,5,22,"div",1),i.Tb(2,2),i.Ub()),2&e){const e=i.nc();i.Db(1),i.uc("ngIf",!e.templates.treeNodeFullTemplate),i.Db(1),i.uc("ngTemplateOutlet",e.templates.treeNodeFullTemplate)("ngTemplateOutletContext",i.Cc(3,Wr,e.node,e.node,e.index,e.templates))}}function Yr(e,t){if(1&e&&(i.Xb(0,"span"),i.Rc(1),i.Wb()),2&e){const e=i.nc();i.Db(1),i.Sc(e.node.displayField)}}const Nr=function(e,t,n){return{$implicit:e,node:t,index:n}};function zr(e,t){if(1&e){const e=i.Yb();i.Xb(0,"span",3),i.lc("click",function(t){return i.Ic(e),i.nc(2).node.mouseAction("expanderClick",t)}),i.Sb(1,"span",4),i.Wb()}if(2&e){const e=i.nc(2);i.Jb("toggle-children-wrapper-expanded",e.node.isExpanded)("toggle-children-wrapper-collapsed",e.node.isCollapsed)}}function $r(e,t){1&e&&i.Sb(0,"span",5)}function Hr(e,t){if(1&e&&(i.Vb(0),i.Pc(1,zr,2,4,"span",1),i.Pc(2,$r,1,0,"span",2),i.Ub()),2&e){const e=i.nc();i.Db(1),i.uc("ngIf",e.node.hasChildren),i.Db(1),i.uc("ngIf",!e.node.hasChildren)}}function Xr(e,t){if(1&e&&i.Sb(0,"tree-node-collection",4),2&e){const e=i.nc(3);i.uc("nodes",e.node.children)("templates",e.templates)("treeModel",e.node.treeModel)}}function Vr(e,t){if(1&e&&i.Sb(0,"tree-loading-component",5),2&e){const e=i.nc(3);i.Nc("padding-left",e.node.getNodePadding()),i.uc("template",e.templates.loadingTemplate)("node",e.node)}}function Br(e,t){if(1&e&&(i.Xb(0,"div"),i.Pc(1,Xr,1,3,"tree-node-collection",2),i.Pc(2,Vr,1,4,"tree-loading-component",3),i.Wb()),2&e){const e=i.nc(2);i.Jb("tree-children",!0)("tree-children-no-padding",e.node.options.levelPadding),i.Db(1),i.uc("ngIf",e.node.children),i.Db(1),i.uc("ngIf",!e.node.children)}}function Ur(e,t){if(1&e&&(i.Vb(0),i.Pc(1,Br,3,6,"div",1),i.Ub()),2&e){const e=i.nc();i.Db(1),i.uc("treeAnimateOpen",e.node.isExpanded)("treeAnimateOpenSpeed",e.node.options.animateSpeed)("treeAnimateOpenAcceleration",e.node.options.animateAcceleration)("treeAnimateOpenEnabled",e.node.options.animateExpand)}}function qr(e,t){if(1&e&&i.Sb(0,"tree-node",2),2&e){const e=t.$implicit,n=t.index,r=i.nc(2);i.uc("node",e)("index",n)("templates",r.templates)}}function Gr(e,t){if(1&e&&(i.Vb(0),i.Xb(1,"div"),i.Pc(2,qr,1,3,"tree-node",1),i.Wb(),i.Ub()),2&e){const e=i.nc();i.Db(1),i.Nc("margin-top",e.marginTop),i.Db(1),i.uc("ngForOf",e.viewportNodes)("ngForTrackBy",e.trackNode)}}function Jr(e,t){if(1&e&&i.Sb(0,"tree-node-checkbox",4),2&e){const e=i.nc(2);i.uc("node",e.node)}}function Kr(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",2),i.Pc(1,Jr,1,1,"tree-node-checkbox",3),i.Sb(2,"tree-node-expander",4),i.Xb(3,"div",5),i.lc("click",function(t){return i.Ic(e),i.nc().node.mouseAction("click",t)})("dblclick",function(t){return i.Ic(e),i.nc().node.mouseAction("dblClick",t)})("mouseover",function(t){return i.Ic(e),i.nc().node.mouseAction("mouseOver",t)})("mouseout",function(t){return i.Ic(e),i.nc().node.mouseAction("mouseOut",t)})("contextmenu",function(t){return i.Ic(e),i.nc().node.mouseAction("contextMenu",t)})("treeDrop",function(t){return i.Ic(e),i.nc().node.onDrop(t)})("treeDropDragOver",function(t){return i.Ic(e),i.nc().node.mouseAction("dragOver",t)})("treeDropDragLeave",function(t){return i.Ic(e),i.nc().node.mouseAction("dragLeave",t)})("treeDropDragEnter",function(t){return i.Ic(e),i.nc().node.mouseAction("dragEnter",t)}),i.Sb(4,"tree-node-content",6),i.Wb(),i.Wb()}if(2&e){const e=i.nc();i.Nc("padding-left",e.node.getNodePadding()),i.Db(1),i.uc("ngIf",e.node.options.useCheckbox),i.Db(1),i.uc("node",e.node),i.Db(1),i.Jb("node-content-wrapper-active",e.node.isActive)("node-content-wrapper-focused",e.node.isFocused),i.uc("treeAllowDrop",e.node.allowDrop)("allowDragoverStyling",e.node.allowDragoverStyling())("treeDrag",e.node)("treeDragEnabled",e.node.allowDrag()),i.Db(1),i.uc("node",e.node)("index",e.index)("template",e.templates.treeNodeTemplate)}}function Qr(e,t){if(1&e){const e=i.Yb();i.Vb(0),i.Xb(1,"input",1),i.lc("click",function(t){return i.Ic(e),i.nc().node.mouseAction("checkboxClick",t)}),i.Wb(),i.Ub()}if(2&e){const e=i.nc();i.Db(1),i.uc("checked",e.node.isSelected)("indeterminate",e.node.isPartiallySelected)}}let Zr=(()=>{class e{constructor(e,t){this.templateRef=e,this.viewContainer=t,this.templateBindings={}}ngOnInit(){this.view=this.viewContainer.createEmbeddedView(this.templateRef),this.dispose&&this.dispose(),this.shouldDetach()&&this.view.detach(),this.autoDetect(this.view)}shouldDetach(){return this.treeMobxAutorun&&this.treeMobxAutorun.detach}autoDetect(e){this.dispose=Ze(()=>e.detectChanges())}ngOnDestroy(){this.dispose&&this.dispose()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O),i.Rb(i.S))},e.\u0275dir=i.Mb({type:e,selectors:[["","treeMobxAutorun",""]],inputs:{treeMobxAutorun:"treeMobxAutorun"}}),e})();const es={TOGGLE_ACTIVE:(e,t,n)=>t&&t.toggleActivated(),TOGGLE_ACTIVE_MULTI:(e,t,n)=>t&&t.toggleActivated(!0),TOGGLE_SELECTED:(e,t,n)=>t&&t.toggleSelected(),ACTIVATE:(e,t,n)=>t.setIsActive(!0),DEACTIVATE:(e,t,n)=>t.setIsActive(!1),SELECT:(e,t,n)=>t.setIsSelected(!0),DESELECT:(e,t,n)=>t.setIsSelected(!1),FOCUS:(e,t,n)=>t.focus(),TOGGLE_EXPANDED:(e,t,n)=>t.hasChildren&&t.toggleExpanded(),EXPAND:(e,t,n)=>t.expand(),COLLAPSE:(e,t,n)=>t.collapse(),DRILL_DOWN:(e,t,n)=>e.focusDrillDown(),DRILL_UP:(e,t,n)=>e.focusDrillUp(),NEXT_NODE:(e,t,n)=>e.focusNextNode(),PREVIOUS_NODE:(e,t,n)=>e.focusPreviousNode(),MOVE_NODE:(e,t,n,{from:i,to:r})=>{n.ctrlKey?e.copyNode(i,r):e.moveNode(i,r)}},ts={mouse:{click:es.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:es.TOGGLE_EXPANDED,checkboxClick:es.TOGGLE_SELECTED,drop:es.MOVE_NODE},keys:{39:es.DRILL_DOWN,37:es.DRILL_UP,40:es.NEXT_NODE,38:es.PREVIOUS_NODE,32:es.TOGGLE_ACTIVE,13:es.TOGGLE_ACTIVE}};class ns{constructor(e={}){this.options=e,this.actionMapping=Hn({},this.options.actionMapping,ts),e.rtl&&(this.actionMapping.keys[39]=ui(e,["actionMapping","keys",39])||es.DRILL_UP,this.actionMapping.keys[37]=ui(e,["actionMapping","keys",37])||es.DRILL_DOWN)}get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return void 0===this.options.scrollOnActivate||this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return void 0===this.options.useTriState||this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return void 0===this.options.allowDragoverStyling||this.options.allowDragoverStyling}getNodeClone(e){return this.options.getNodeClone?this.options.getNodeClone(e):Di(Object.assign({},e.data),["id"])}allowDrop(e,t,n){return this.options.allowDrop instanceof Function?this.options.allowDrop(e,t,n):void 0===this.options.allowDrop||this.options.allowDrop}allowDrag(e){return this.options.allowDrag instanceof Function?this.options.allowDrag(e):this.options.allowDrag}nodeClass(e){return this.options.nodeClass?this.options.nodeClass(e):""}nodeHeight(e){if(e.data.virtual)return 0;let t=this.options.nodeHeight||22;return"function"==typeof t&&(t=t(e)),t+(0===e.index?2:1)*this.dropSlotHeight}get dropSlotHeight(){return"number"==typeof(e=this.options.dropSlotHeight)||Object(xn.a)(e)&&"[object Number]"==Object(Cn.a)(e)?this.options.dropSlotHeight:2;var e}}const is={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"};var rs=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},ss=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let os=(()=>{class e{constructor(e,t,n,i){this.data=e,this.parent=t,this.treeModel=n,this.position=0,this.allowDrop=(e,t)=>this.options.allowDrop(e,{parent:this,index:0},t),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,null==this.id&&(this.id=Math.floor(1e13*Math.random())),this.index=i,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):(e=this.children,t=e=>e.isSelected,(Object(Dn.a)(e)?Si:Gi)(e,Ui(t)));var e,t}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):(e=this.children,t=e=>e.isAllSelected,(Object(Dn.a)(e)?Ji:Ki)(e,Ui(t)));var e,t}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw"Element Ref is no longer supported since introducing virtual scroll\n\n      You may use a template to obtain a reference to the element"}get originalNode(){return this._originalNode}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(e){this.treeModel.fireEvent(e)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(e){this.setField("id",e)}getField(e){return this.data[this.options[`${e}Field`]]}setField(e,t){this.data[this.options[`${e}Field`]]=t}_findAdjacentSibling(e,t=!1){const n=this._getParentsChildren(t),i=n.indexOf(this);return n.length>i+e?n[i+e]:null}findNextSibling(e=!1){return this._findAdjacentSibling(1,e)}findPreviousSibling(e=!1){return this._findAdjacentSibling(-1,e)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(e=>!e.isHidden)}getFirstChild(e=!1){return Qi((e?this.visibleChildren:this.children)||[])}getLastChild(e=!1){return hi((e?this.visibleChildren:this.children)||[])}findNextNode(e=!0,t=!1){return e&&this.isExpanded&&this.getFirstChild(t)||this.findNextSibling(t)||this.parent&&this.parent.findNextNode(!1,t)}findPreviousNode(e=!1){let t=this.findPreviousSibling(e);return t?t._getLastOpenDescendant(e):this.realParent}_getLastOpenDescendant(e=!1){const t=this.getLastChild(e);return this.isCollapsed||!t?this:t._getLastOpenDescendant(e)}_getParentsChildren(e=!1){return this.parent&&(e?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(e=!1){return this._getParentsChildren(e).indexOf(this)}isDescendantOf(e){return this===e||this.parent&&this.parent.isDescendantOf(e)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),`tree-node-level-${this.level}`].join(" ")}onDrop(e){this.mouseAction("drop",e.event,{from:e.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(e=>{e&&(this.setField("children",e),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(e=>{e.getField("isExpanded")&&e.hasChildren&&e.expand()}))}).then(()=>{this.fireEvent({eventName:is.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(e){Promise.resolve(e(this)).then(()=>{this.children&&this.children.forEach(t=>t.doForAll(e))})}expandAll(){this.doForAll(e=>e.expand())}collapseAll(){this.doForAll(e=>e.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(e){return this.hasChildren&&this.treeModel.setExpandedNode(this,e),this}autoLoadChildren(){this.handler=nt(()=>this.isExpanded,e=>{!this.children&&this.hasChildren&&e&&this.loadNodeChildren()},{fireImmediately:!0})}dispose(){this.children&&this.children.forEach(e=>e.dispose()),this.handler&&this.handler(),this.parent=null,this.children=null}setIsActive(e,t=!1){return this.treeModel.setActiveNode(this,e,t),e&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(e){return this.isSelectable()?this.treeModel.setSelectedNode(this,e):this.visibleChildren.forEach(t=>t.setIsSelected(e)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(e=!1){return this.setIsActive(!this.isActive,e),this}setActiveAndVisible(e=!1){return this.setIsActive(!0,e).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(e=!1){this.treeModel.virtualScroll.scrollIntoView(this,e)}focus(e=!0){let t=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),e&&this.scrollIntoView(),t&&this.fireEvent({eventName:is.blur,node:t}),this.fireEvent({eventName:is.focus,node:this}),this}blur(){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),e&&this.fireEvent({eventName:is.blur,node:this}),this}setIsHidden(e){this.treeModel.setIsHidden(this,e)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(e,t,n=null){this.treeModel.setFocus(!0);const i=this.options.actionMapping.mouse[e];i&&i(this.treeModel,this,t,n)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((t,n)=>new e(t,this,this.treeModel,n))}}return rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isHidden",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isExpanded",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isActive",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isFocused",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isSelected",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isAllSelected",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"isPartiallySelected",null),rs([te,ss("design:type",Array)],e.prototype,"children",void 0),rs([te,ss("design:type",Number)],e.prototype,"index",void 0),rs([te,ss("design:type",Object)],e.prototype,"position",void 0),rs([te,ss("design:type",Number)],e.prototype,"height",void 0),rs([se,ss("design:type",Number),ss("design:paramtypes",[])],e.prototype,"level",null),rs([se,ss("design:type",Array),ss("design:paramtypes",[])],e.prototype,"path",null),rs([se,ss("design:type",Object),ss("design:paramtypes",[])],e.prototype,"visibleChildren",null),rs([Ke,ss("design:type",Function),ss("design:paramtypes",[Object]),ss("design:returntype",void 0)],e.prototype,"setIsSelected",null),rs([Ke,ss("design:type",Function),ss("design:paramtypes",[]),ss("design:returntype",void 0)],e.prototype,"_initChildren",null),e})();var as=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},cs=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let ls=(()=>{class e{constructor(){this.options=new ns,this.eventNames=Object.keys(is),this.expandedNodeIds={},this.selectedLeafNodeIds={},this.activeNodeIds={},this.hiddenNodeIds={},this.focusedNodeId=null,this.firstUpdate=!0,this.subscriptions=[]}fireEvent(e){e.treeModel=this,this.events[e.eventName].emit(e),this.events.event.emit(e)}subscribe(e,t){const n=this.events[e].subscribe(t);this.subscriptions.push(n)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this.virtualRoot.visibleChildren}getFirstRoot(e=!1){return Qi(e?this.getVisibleRoots():this.roots)}getLastRoot(e=!1){return hi(e?this.getVisibleRoots():this.roots)}get isFocused(){return e.focusedTree===this}isNodeFocused(e){return this.focusedNode===e}isEmptyTree(){return this.roots&&0===this.roots.length}get focusedNode(){return this.focusedNodeId?this.getNodeById(this.focusedNodeId):null}get expandedNodes(){const e=Object.keys(this.expandedNodeIds).filter(e=>this.expandedNodeIds[e]).map(e=>this.getNodeById(e));return Zi(e)}get activeNodes(){const e=Object.keys(this.activeNodeIds).filter(e=>this.activeNodeIds[e]).map(e=>this.getNodeById(e));return Zi(e)}get hiddenNodes(){const e=Object.keys(this.hiddenNodeIds).filter(e=>this.hiddenNodeIds[e]).map(e=>this.getNodeById(e));return Zi(e)}get selectedLeafNodes(){const e=Object.keys(this.selectedLeafNodeIds).filter(e=>this.selectedLeafNodeIds[e]).map(e=>this.getNodeById(e));return Zi(e)}getNodeByPath(e,t=null){if(!e)return null;if(t=t||this.virtualRoot,0===e.length)return t;if(!t.children)return null;const n=e.shift(),i=ur(t.children,{id:n});return i?this.getNodeByPath(e,i):null}getNodeById(e){const t=e.toString();return this.getNodeBy(e=>e.id.toString()===t)}getNodeBy(e,t=null){if(!(t=t||this.virtualRoot).children)return null;const n=ur(t.children,e);if(n)return n;for(let i of t.children){const t=this.getNodeBy(e,i);if(t)return t}}isExpanded(e){return this.expandedNodeIds[e.id]}isHidden(e){return this.hiddenNodeIds[e.id]}isActive(e){return this.activeNodeIds[e.id]}isSelected(e){return this.selectedLeafNodeIds[e.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){this.virtualRoot&&this.virtualRoot.dispose()}unsubscribeAll(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[]}setData({nodes:e,options:t=null,events:n=null}){t&&(this.options=new ns(t)),n&&(this.events=n),e&&(this.nodes=e),this.update()}update(){let e={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose(),this.virtualRoot=new os(e,null,this,0),this.roots=this.virtualRoot.children,this.firstUpdate?this.roots&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:is.updateData})}setFocusedNode(e){this.focusedNodeId=e?e.id:null}setFocus(t){e.focusedTree=t?this:null}doForAll(e){this.roots.forEach(t=>t.doForAll(e))}focusNextNode(){let e=this.getFocusedNode(),t=e?e.findNextNode(!0,!0):this.getFirstRoot(!0);t&&t.focus()}focusPreviousNode(){let e=this.getFocusedNode(),t=e?e.findPreviousNode(!0):this.getLastRoot(!0);t&&t.focus()}focusDrillDown(){let e=this.getFocusedNode();if(e&&e.isCollapsed&&e.hasChildren)e.toggleExpanded();else{let t=e?e.getFirstChild(!0):this.getFirstRoot(!0);t&&t.focus()}}focusDrillUp(){let e=this.getFocusedNode();if(e)if(e.isExpanded)e.toggleExpanded();else{let t=e.realParent;t&&t.focus()}}setActiveNode(e,t,n=!1){n?this._setActiveNodeMulti(e,t):this._setActiveNodeSingle(e,t),t?(e.focus(this.options.scrollOnActivate),this.fireEvent({eventName:is.activate,node:e}),this.fireEvent({eventName:is.nodeActivate,node:e})):(this.fireEvent({eventName:is.deactivate,node:e}),this.fireEvent({eventName:is.nodeDeactivate,node:e}))}setSelectedNode(e,t){this.selectedLeafNodeIds=Object.assign({},this.selectedLeafNodeIds,{[e.id]:t}),t?(e.focus(),this.fireEvent({eventName:is.select,node:e})):this.fireEvent({eventName:is.deselect,node:e})}setExpandedNode(e,t){this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[e.id]:t}),this.fireEvent({eventName:is.toggleExpanded,node:e,isExpanded:t})}expandAll(){this.roots.forEach(e=>e.expandAll())}collapseAll(){this.roots.forEach(e=>e.collapseAll())}setIsHidden(e,t){this.hiddenNodeIds=Object.assign({},this.hiddenNodeIds,{[e.id]:t})}setHiddenNodeIds(e){this.hiddenNodeIds=e.reduce((e,t)=>Object.assign(e,{[t]:!0}),{})}performKeyAction(e,t){const n=this.options.actionMapping.keys[t.keyCode];return!!n&&(t.preventDefault(),n(this,e,t),!0)}filterNodes(e,t=!0){let n;if(!e)return this.clearFilter();if(dr(e))n=t=>-1!==t.displayField.toLowerCase().indexOf(e.toLowerCase());else{if(!Object(Tn.a)(e))return console.error("Don't know what to do with filter",e),void console.error("Should be either a string or function");n=e}const i={};this.roots.forEach(e=>this._filterNode(i,e,n,t)),this.hiddenNodeIds=i,this.fireEvent({eventName:is.changeFilter})}clearFilter(){this.hiddenNodeIds={},this.fireEvent({eventName:is.changeFilter})}moveNode(e,t){const n=e.getIndexInParent(),i=e.parent;if(!this.canMoveNode(e,t,n))return;const r=i.getField("children");t.parent.getField("children")||t.parent.setField("children",[]);const s=t.parent.getField("children"),o=r.splice(n,1)[0];let a=i===t.parent&&t.index>n?t.index-1:t.index;s.splice(a,0,o),i.treeModel.update(),t.parent.treeModel!==i.treeModel&&t.parent.treeModel.update(),this.fireEvent({eventName:is.moveNode,node:o,to:{parent:t.parent.data,index:a},from:{parent:i.data,index:n}})}copyNode(e,t){const n=e.getIndexInParent();if(!this.canMoveNode(e,t,n))return;t.parent.getField("children")||t.parent.setField("children",[]);const i=t.parent.getField("children"),r=this.options.getNodeClone(e);i.splice(t.index,0,r),e.treeModel.update(),t.parent.treeModel!==e.treeModel&&t.parent.treeModel.update(),this.fireEvent({eventName:is.copyNode,node:r,to:{parent:t.parent.data,index:t.index}})}getState(){return{expandedNodeIds:this.expandedNodeIds,selectedLeafNodeIds:this.selectedLeafNodeIds,activeNodeIds:this.activeNodeIds,hiddenNodeIds:this.hiddenNodeIds,focusedNodeId:this.focusedNodeId}}setState(e){e&&Object.assign(this,{expandedNodeIds:e.expandedNodeIds||{},selectedLeafNodeIds:e.selectedLeafNodeIds||{},activeNodeIds:e.activeNodeIds||{},hiddenNodeIds:e.hiddenNodeIds||{},focusedNodeId:e.focusedNodeId})}subscribeToState(e){Ze(()=>e(this.getState()))}canMoveNode(e,t,n){return n||e.getIndexInParent(),(e.parent!==t.parent||n!==t.index)&&!t.parent.isDescendantOf(e)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(e,t,n,i){let r=n(t);return t.children&&t.children.forEach(t=>{this._filterNode(e,t,n,i)&&(r=!0)}),r||(e[t.id]=!0),i&&r&&t.ensureVisible(),r}_calculateExpandedNodes(e=null){(e=e||this.virtualRoot).data[this.options.isExpandedField]&&(this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[e.id]:!0})),e.children&&e.children.forEach(e=>this._calculateExpandedNodes(e))}_setActiveNodeSingle(e,t){this.activeNodes.filter(t=>t!==e).forEach(e=>{this.fireEvent({eventName:is.deactivate,node:e}),this.fireEvent({eventName:is.nodeDeactivate,node:e})}),this.activeNodeIds=t?{[e.id]:!0}:{}}_setActiveNodeMulti(e,t){this.activeNodeIds=Object.assign({},this.activeNodeIds,{[e.id]:t})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e.focusedTree=null,as([te,cs("design:type",Array)],e.prototype,"roots",void 0),as([te,cs("design:type",Object)],e.prototype,"expandedNodeIds",void 0),as([te,cs("design:type",Object)],e.prototype,"selectedLeafNodeIds",void 0),as([te,cs("design:type",Object)],e.prototype,"activeNodeIds",void 0),as([te,cs("design:type",Object)],e.prototype,"hiddenNodeIds",void 0),as([te,cs("design:type",Object)],e.prototype,"focusedNodeId",void 0),as([te,cs("design:type",os)],e.prototype,"virtualRoot",void 0),as([se,cs("design:type",Object),cs("design:paramtypes",[])],e.prototype,"focusedNode",null),as([se,cs("design:type",Object),cs("design:paramtypes",[])],e.prototype,"expandedNodes",null),as([se,cs("design:type",Object),cs("design:paramtypes",[])],e.prototype,"activeNodes",null),as([se,cs("design:type",Object),cs("design:paramtypes",[])],e.prototype,"hiddenNodes",null),as([se,cs("design:type",Object),cs("design:paramtypes",[])],e.prototype,"selectedLeafNodes",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"setData",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"update",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"setFocusedNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"setFocus",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"doForAll",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"focusNextNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"focusPreviousNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"focusDrillDown",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"focusDrillUp",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object,Object]),cs("design:returntype",void 0)],e.prototype,"setActiveNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"setSelectedNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"setExpandedNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"expandAll",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"collapseAll",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"setIsHidden",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"setHiddenNodeIds",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"filterNodes",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[]),cs("design:returntype",void 0)],e.prototype,"clearFilter",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"moveNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object,Object]),cs("design:returntype",void 0)],e.prototype,"copyNode",null),as([Ke,cs("design:type",Function),cs("design:paramtypes",[Object]),cs("design:returntype",void 0)],e.prototype,"setState",null),e})(),us=(()=>{class e{constructor(){this._draggedElement=null}set(e){this._draggedElement=e}get(){return this._draggedElement}isDragging(){return!!this.get()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();var ds=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},hs=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};const fs=150;let ps=(()=>{class e{constructor(e){this.treeModel=e,this.yBlocks=0,this.x=0,this.viewportHeight=null,this.viewport=null,e.virtualScroll=this,this._dispose=[Ze(()=>this.fixScroll())]}get y(){return this.yBlocks*fs}get totalHeight(){return this.treeModel.virtualRoot?this.treeModel.virtualRoot.height:0}fireEvent(e){this.treeModel.fireEvent(e)}init(){const e=this.recalcPositions.bind(this);e(),this._dispose=[...this._dispose,nt(()=>this.treeModel.roots,e),nt(()=>this.treeModel.expandedNodeIds,e),nt(()=>this.treeModel.hiddenNodeIds,e)],this.treeModel.subscribe(is.loadNodeChildren,e)}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(e){this.yBlocks=e}recalcPositions(){this.treeModel.virtualRoot.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0)}_getPositionAfter(e,t){let n=t;return e.forEach(e=>{e.position=n,n=this._getPositionAfterNode(e,n)}),n}_getPositionAfterNode(e,t){let n=e.getSelfHeight()+t;return e.children&&e.isExpanded&&(n=this._getPositionAfter(e.visibleChildren,n)),e.height=n-t,n}clear(){this._dispose.forEach(e=>e())}setViewport(e){Object.assign(this,{viewport:e,x:e.scrollLeft,yBlocks:Math.round(e.scrollTop/fs),viewportHeight:e.getBoundingClientRect?e.getBoundingClientRect().height:0})}scrollIntoView(e,t,n=!0){if(e.options.scrollContainer){const i=e.options.scrollContainer,r=i.getBoundingClientRect().height,s=i.getBoundingClientRect().top,o=this.viewport.getBoundingClientRect().top+e.position-s;(t||o<i.scrollTop||o+e.getSelfHeight()>i.scrollTop+r)&&(i.scrollTop=n?o-r/2:o)}else(t||e.position<this.y||e.position+e.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=n?e.position-this.viewportHeight/2:e.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/fs)))}getViewportNodes(e){if(!e)return[];const t=e.filter(e=>!e.isHidden);if(!this.isEnabled())return t;if(!this.viewportHeight||!t.length)return[];const n=ms(t,e=>e.position+500>this.y||e.position+e.height>this.y),i=ms(t,e=>e.position-500>this.y+this.viewportHeight,n),r=[];if(i-n>(1e3+this.viewportHeight)/t[0].treeModel.options.options.nodeHeight)return[];for(let s=n;s<=i;s++)r.push(t[s]);return r}fixScroll(){const e=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>e&&this._setYBlocks(e/fs)}}return e.\u0275fac=function(t){return new(t||e)(i.ic(ls))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),ds([te,hs("design:type",Object)],e.prototype,"yBlocks",void 0),ds([te,hs("design:type",Object)],e.prototype,"x",void 0),ds([te,hs("design:type",Object)],e.prototype,"viewportHeight",void 0),ds([se,hs("design:type",Object),hs("design:paramtypes",[])],e.prototype,"y",null),ds([se,hs("design:type",Object),hs("design:paramtypes",[])],e.prototype,"totalHeight",null),ds([Ke,hs("design:type",Function),hs("design:paramtypes",[Object]),hs("design:returntype",void 0)],e.prototype,"_setYBlocks",null),ds([Ke,hs("design:type",Function),hs("design:paramtypes",[]),hs("design:returntype",void 0)],e.prototype,"recalcPositions",null),ds([Ke,hs("design:type",Function),hs("design:paramtypes",[Object]),hs("design:returntype",void 0)],e.prototype,"setViewport",null),ds([Ke,hs("design:type",Function),hs("design:paramtypes",[Object,Object,Object]),hs("design:returntype",void 0)],e.prototype,"scrollIntoView",null),e})();function ms(e,t,n=0){let i=n,r=e.length-1;for(;i!==r;){let n=Math.floor((i+r)/2);t(e[n])?r=n:i=i===n?r:n}return i}let bs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-loading-component"]],inputs:{template:"template",node:"node"},decls:2,vars:5,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Pc(0,Dr,2,0,"span",0),i.Tb(1,1)),2&e&&(i.uc("ngIf",!t.template),i.Db(1),i.uc("ngTemplateOutlet",t.template)("ngTemplateOutletContext",i.zc(3,Sr,t.node)))},directives:[r.r,r.w],encapsulation:2}),e})(),gs=(()=>{class e{constructor(e,t,n){this.elementRef=e,this.ngZone=t,this.virtualScroll=n,this.setViewport=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Object(Mn.a)(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),function(e,t,n){var i,r,s,o,a,c,l=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function p(e){return l=e,a=setTimeout(b,t),u?f(e):o}function m(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=s}function b(){var e=fr();if(m(e))return g(e);a=setTimeout(b,function(e){var n=t-(e-c);return d?mr(n,s-(e-l)):n}(e))}function g(e){return a=void 0,h&&i?f(e):(i=r=void 0,o)}function _(){var e=fr(),n=m(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return p(c);if(d)return clearTimeout(a),a=setTimeout(b,t),f(c)}return void 0===a&&(a=setTimeout(b,t)),o}return t=ar(t)||0,Object(Mn.a)(n)&&(u=!!n.leading,s=(d="maxWait"in n)?pr(ar(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},_.flush=function(){return void 0===a?o:g(fr())},_}(e,t,{leading:i,maxWait:t,trailing:r})}(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init()}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:is.initialized})});let e=this.elementRef.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("scroll",this.scrollEventHandler)})}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.D),i.Rb(ps))},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-viewport"]],features:[i.Cb([ps])],ngContentSelectors:Tr,decls:1,vars:2,consts:[[4,"treeMobxAutorun"]],template:function(e,t){1&e&&(i.tc(),i.Pc(0,xr,3,2,"ng-container",0)),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:[Zr],encapsulation:2}),e})(),_s=(()=>{class e{constructor(e,t){this.treeModel=e,this.treeDraggedElement=t,e.eventNames.forEach(e=>this[e]=new i.p),e.subscribeToState(e=>this.stateChange.emit(e))}set nodes(e){}set options(e){}set focused(e){this.treeModel.setFocus(e)}set state(e){this.treeModel.setState(e)}onKeydown(e){if(!this.treeModel.isFocused)return;if(_r(["input","textarea"],document.activeElement.tagName.toLowerCase()))return;const t=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(t,e)}onMousedown(e){(function e(t,n){return!t||t.localName!==n&&e(t.parentElement,n)})(e.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(e){(e.options||e.nodes)&&this.treeModel.setData({options:e.options&&e.options.currentValue,nodes:e.nodes&&e.nodes.currentValue,events:wr(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(ls),i.Rb(us))},e.\u0275cmp=i.Lb({type:e,selectors:[["Tree"],["tree-root"]],contentQueries:function(e,t,n){if(1&e&&(i.Kb(n,Mr,1),i.Kb(n,Cr,1),i.Kb(n,Or,1),i.Kb(n,Lr,1)),2&e){let e;i.Ec(e=i.mc())&&(t.loadingTemplate=e.first),i.Ec(e=i.mc())&&(t.treeNodeTemplate=e.first),i.Ec(e=i.mc())&&(t.treeNodeWrapperTemplate=e.first),i.Ec(e=i.mc())&&(t.treeNodeFullTemplate=e.first)}},viewQuery:function(e,t){if(1&e&&i.Wc(Er,1),2&e){let e;i.Ec(e=i.mc())&&(t.viewportComponent=e.first)}},hostBindings:function(e,t){1&e&&i.lc("keydown",function(e){return t.onKeydown(e)},!1,i.Gc)("mousedown",function(e){return t.onMousedown(e)},!1,i.Gc)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[i.Cb([ls]),i.Bb],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(e,t){1&e&&(i.Xb(0,"tree-viewport",null,0),i.Xb(2,"div",1),i.Pc(3,Ir,1,8,"tree-node-collection",2),i.Pc(4,Rr,1,2,"tree-node-drop-slot",3),i.Wb(),i.Wb()),2&e&&(i.Db(2),i.Jb("node-dragging",t.treeDraggedElement.isDragging())("angular-tree-component-rtl",t.treeModel.options.rtl),i.Db(1),i.uc("ngIf",t.treeModel.roots),i.Db(1),i.uc("ngIf",t.treeModel.isEmptyTree()))},directives:function(){return[gs,r.r,Os,ws]},encapsulation:2}),e})(),vs=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["TreeNode"],["tree-node"]],inputs:{node:"node",index:"index",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node",4,"ngIf"],[3,"node","index","templates"],[3,"node","templates"],[3,"dropIndex","node"]],template:function(e,t){1&e&&i.Pc(0,jr,3,8,"ng-container",0),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:function(){return[Zr,r.r,r.w,Ls,Ss,ws]},encapsulation:2}),e})(),ys=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-content"]],inputs:{node:"node",index:"index",template:"template"},decls:2,vars:7,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(i.Pc(0,Yr,2,1,"span",0),i.Tb(1,1)),2&e&&(i.uc("ngIf",!t.template),i.Db(1),i.uc("ngTemplateOutlet",t.template)("ngTemplateOutletContext",i.Bc(3,Nr,t.node,t.node,t.index)))},directives:[r.r,r.w],encapsulation:2}),e})(),ws=(()=>{class e{onDrop(e){this.node.mouseAction("drop",e.event,{from:e.element,to:{parent:this.node,index:this.dropIndex}})}allowDrop(e,t){return this.node.options.allowDrop(e,{parent:this.node,index:this.dropIndex},t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:"node",dropIndex:"dropIndex"},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeAllowDrop","allowDragoverStyling","treeDrop"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.lc("treeDrop",function(e){return t.onDrop(e)}),i.Wb()),2&e&&i.uc("treeAllowDrop",t.allowDrop.bind(t))("allowDragoverStyling",!0)},directives:function(){return[Rs]},encapsulation:2}),e})(),Ds=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-expander"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["class","toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed","click",4,"ngIf"],["class","toggle-children-placeholder",4,"ngIf"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"],[1,"toggle-children-placeholder"]],template:function(e,t){1&e&&i.Pc(0,Hr,3,2,"ng-container",0),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:[Zr,r.r],encapsulation:2}),e})(),Ss=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-children"]],inputs:{node:"node",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel",4,"ngIf"],["class","tree-node-loading",3,"padding-left","template","node",4,"ngIf"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"template","node"]],template:function(e,t){1&e&&i.Pc(0,Ur,2,4,"ng-container",0),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:function(){return[Zr,Fs,r.r,Os,bs]},encapsulation:2}),e})();const xs=Object.assign(function(...e){return Ke(...e)},Ke),ks=Object.assign(function(...e){return se(...e)},se),Ts=Object.assign(function(...e){return te(...e)},te);var Ms=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},Cs=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Os=(()=>{class e{constructor(){this._dispose=[]}get nodes(){return this._nodes}set nodes(e){this.setNodes(e)}get marginTop(){const e=this.viewportNodes&&this.viewportNodes.length&&this.viewportNodes[0];return(e&&e.parent?e.position-e.parent.position-e.parent.getSelfHeight():0)+"px"}setNodes(e){this._nodes=e}ngOnInit(){this.virtualScroll=this.treeModel.virtualScroll,this._dispose=[nt(()=>this.virtualScroll.getViewportNodes(this.nodes).map(e=>e.index),e=>{this.viewportNodes=e.map(e=>this.nodes[e])},{compareStructural:!0,fireImmediately:!0}),nt(()=>this.nodes,e=>{this.viewportNodes=this.virtualScroll.getViewportNodes(e)})]}ngOnDestroy(){this._dispose.forEach(e=>e())}trackNode(e,t){return t.id}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-collection"]],inputs:{nodes:"nodes",treeModel:"treeModel",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"node","index","templates",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","index","templates"]],template:function(e,t){1&e&&i.Pc(0,Gr,3,4,"ng-container",0),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:[Zr,r.q,vs],encapsulation:2}),Ms([Ts,Cs("design:type",Object)],e.prototype,"_nodes",void 0),Ms([Ts,Cs("design:type",Array)],e.prototype,"viewportNodes",void 0),Ms([ks,Cs("design:type",String),Cs("design:paramtypes",[])],e.prototype,"marginTop",null),Ms([xs,Cs("design:type",Function),Cs("design:paramtypes",[Object]),Cs("design:returntype",void 0)],e.prototype,"setNodes",null),e})(),Ls=(()=>{class e{constructor(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-wrapper"]],inputs:{node:"node",index:"index",templates:"templates"},decls:2,vars:8,consts:[["class","node-wrapper",3,"padding-left",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node",4,"ngIf"],[3,"node"],[1,"node-content-wrapper",3,"treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled","click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter"],[3,"node","index","template"]],template:function(e,t){1&e&&(i.Pc(0,Kr,5,15,"div",0),i.Tb(1,1)),2&e&&(i.uc("ngIf",!t.templates.treeNodeWrapperTemplate),i.Db(1),i.uc("ngTemplateOutlet",t.templates.treeNodeWrapperTemplate)("ngTemplateOutletContext",i.Cc(3,Wr,t.node,t.node,t.index,t.templates)))},directives:function(){return[r.r,r.w,Ds,Ps,Rs,ys,Es]},encapsulation:2}),e})(),Es=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["tree-node-checkbox"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["type","checkbox",1,"tree-node-checkbox",3,"checked","indeterminate","click"]],template:function(e,t){1&e&&i.Pc(0,Qr,2,2,"ng-container",0),2&e&&i.uc("treeMobxAutorun",i.yc(1,kr))},directives:[Zr],encapsulation:2}),e})();const As="is-dragging-over",Is="is-dragging-over-disabled";let Rs=(()=>{class e{constructor(e,t,n,r){this.el=e,this.renderer=t,this.treeDraggedElement=n,this.ngZone=r,this.allowDragoverStyling=!0,this.onDropCallback=new i.p,this.onDragOverCallback=new i.p,this.onDragLeaveCallback=new i.p,this.onDragEnterCallback=new i.p,this._allowDrop=(e,t)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this)}set treeAllowDrop(e){this._allowDrop=e instanceof Function?e:(t,n)=>e}allowDrop(e){return this._allowDrop(this.treeDraggedElement.get(),e)}ngAfterViewInit(){let e=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("dragover",this.dragOverEventHandler),e.addEventListener("dragenter",this.dragEnterEventHandler),e.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let e=this.el.nativeElement;e.removeEventListener("dragover",this.dragOverEventHandler),e.removeEventListener("dragenter",this.dragEnterEventHandler),e.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(e){if(!this.allowDrop(e))return this.allowDragoverStyling?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:e,element:this.treeDraggedElement.get()}),e.preventDefault(),this.allowDragoverStyling&&this.addClass()}onDragEnter(e){this.allowDrop(e)&&(e.preventDefault(),this.onDragEnterCallback.emit({event:e,element:this.treeDraggedElement.get()}))}onDragLeave(e){if(!this.allowDrop(e))return this.allowDragoverStyling?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:e,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass()}onDrop(e){this.allowDrop(e)&&(e.preventDefault(),this.onDropCallback.emit({event:e,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,As)}removeClass(){this.renderer.removeClass(this.el.nativeElement,As)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,Is)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,Is)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H),i.Rb(us),i.Rb(i.D))},e.\u0275dir=i.Mb({type:e,selectors:[["","treeDrop",""]],hostBindings:function(e,t){1&e&&i.lc("drop",function(e){return t.onDrop(e)})},inputs:{allowDragoverStyling:"allowDragoverStyling",treeAllowDrop:"treeAllowDrop"},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}}),e})(),Ps=(()=>{class e{constructor(e,t,n,i){this.el=e,this.renderer=t,this.treeDraggedElement=n,this.ngZone=i,this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let e=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{e.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(e){e.dataTransfer.setData("text",e.target.id),this.treeDraggedElement.set(this.draggedElement),this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragStart",e)}onDrag(e){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("drag",e)}onDragEnd(){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H),i.Rb(us),i.Rb(i.D))},e.\u0275dir=i.Mb({type:e,selectors:[["","treeDrag",""]],hostBindings:function(e,t){1&e&&i.lc("dragstart",function(e){return t.onDragStart(e)})("dragend",function(){return t.onDragEnd()})},inputs:{draggedElement:["treeDrag","draggedElement"],treeDragEnabled:"treeDragEnabled"}}),e})(),Fs=(()=>{class e{constructor(e,t,n){this.renderer=e,this.templateRef=t,this.viewContainerRef=n}set isOpen(e){e?(this._show(),this.isEnabled&&!1===this._isOpen&&this._animateOpen()):this.isEnabled?this._animateClose():this._hide(),this._isOpen=!!e}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let e=this.animateSpeed,t=this.animateAcceleration,n=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{const i=setInterval(()=>{if(!this._isOpen||!this.innerElement)return clearInterval(i);n+=e;const r=Math.round(n);this.renderer.setStyle(this.innerElement,"max-height",`${r}px`);const s=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;e*=t,t*=1.005,s<r&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(i))},17)})}_animateClose(){if(!this.innerElement)return;let e=this.animateSpeed,t=this.animateAcceleration,n=this.innerElement.getBoundingClientRect().height;const i=setInterval(()=>{if(this._isOpen||!this.innerElement)return clearInterval(i);n-=e,this.renderer.setStyle(this.innerElement,"max-height",`${n}px`),e*=t,t*=1.005,n<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(i))},17)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.O),i.Rb(i.S))},e.\u0275dir=i.Mb({type:e,selectors:[["","treeAnimateOpen",""]],inputs:{isOpen:["treeAnimateOpen","isOpen"],animateSpeed:["treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:["treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:["treeAnimateOpenEnabled","isEnabled"]}}),e})(),Ws=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({providers:[],imports:[[r.c]]}),e})()},ovuK:function(e,t,n){"use strict";t.a=function(e){return function(t){return e(t)}}},oxzT:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=function(e){return e.add="fa fa-plus",e.addCircle="fa fa-plus-circle",e.minusCircle="fa fa-minus-circle",e.edit="fa fa-pencil",e.destroy="fa fa-times",e.destroyCircle="fa fa-times-circle",e.exchange="fa fa-exchange",e.copy="fa fa-copy",e.clipboard="fa fa-clipboard",e.flatten="fa fa-chain-broken",e.trash="fa fa-trash-o",e.lock="fa fa-lock",e.unlock="fa fa-unlock",e.clone="fa fa-clone",e.undo="fa fa-undo",e.search="fa fa-search",e.start="fa fa-play",e.stop="fa fa-stop",e.analyse="fa fa-stethoscope",e.deepCheck="fa fa-cog",e.reweight="fa fa-balance-scale",e.left="fa fa-arrow-left",e.right="fa fa-arrow-right",e.down="fa fa-arrow-down",e.erase="fa fa-eraser",e.user="fa fa-user",e.users="fa fa-users",e.share="fa fa-share-alt",e.key="fa fa-key-modern",e.warning="fa fa-exclamation-triangle",e.info="fa fa-info",e.infoCircle="fa fa-info-circle",e.questionCircle="fa fa-question-circle-o",e.check="fa fa-check",e.show="fa fa-eye",e.paragraph="fa fa-paragraph",e.terminal="fa fa-terminal",e.magic="fa fa-magic",e.hourglass="fa fa-hourglass-o",e.filledHourglass="fa fa-hourglass",e.table="fa fa-table",e.spinner="fa fa-spinner",e.refresh="fa fa-refresh",e.bullseye="fa fa-bullseye",e.disk="fa fa-hdd-o",e.server="fa fa-server",e.filter="fa fa-filter",e.lineChart="fa fa-line-chart",e.signOut="fa fa-sign-out",e.health="fa fa-heartbeat",e.circle="fa fa-circle",e.bell="fa fa-bell",e.tag="fa fa-tag",e.leftArrow="fa fa-angle-left",e.rightArrow="fa fa-angle-right",e.leftArrowDouble="fa fa-angle-double-left",e.rightArrowDouble="fa fa-angle-double-right",e.flag="fa fa-flag",e.clearFilters="fa fa-window-close",e.download="fa fa-download",e.upload="fa fa-upload",e.close="fa fa-times",e.json="fa fa-file-code-o",e.text="fa fa-file-text",e.wrench="fa fa-wrench",e.enter="fa fa-sign-in",e.exit="fa fa-sign-out",e.large="fa fa-lg",e.large2x="fa fa-2x",e.large3x="fa fa-3x",e.stack="fa fa-stack",e.stack1x="fa fa-stack-1x",e.stack2x="fa fa-stack-2x",e.pulse="fa fa-pulse",e.spin="fa fa-spin",e.inverse="fa fa-inverse",e}({})},"p/rL":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_M\u025bkalo_Zuw\u025bnkalo_Zuluyekalo_Utikalo_S\u025btanburukalo_\u0254kut\u0254burukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_M\u025b_Zuw_Zul_Uti_S\u025bt_\u0254ku_Now_Des".split("_"),weekdays:"Kari_Nt\u025bn\u025bn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Nt\u025b_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm"},calendar:{sameDay:"[Bi l\u025br\u025b] LT",nextDay:"[Sini l\u025br\u025b] LT",nextWeek:"dddd [don l\u025br\u025b] LT",lastDay:"[Kunu l\u025br\u025b] LT",lastWeek:"dddd [t\u025bm\u025bnen l\u025br\u025b] LT",sameElse:"L"},relativeTime:{future:"%s k\u0254n\u0254",past:"a b\u025b %s b\u0254",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"l\u025br\u025b kelen",hh:"l\u025br\u025b %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("wd/R"))},p4Cf:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("oxzT"),r=n("8Y7J"),s=n("SVse"),o=n("G0yt");function a(e,t){if(1&e&&(r.Sb(0,"div",2),r.sc(1)),2&e){const e=r.nc();r.Fb(e.class),r.uc("innerHtml",e.html,r.Jc)}}const c=function(e){return[e]},l=["*"];let u=(()=>{class e{constructor(){this.icons=i.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-helper"]],inputs:{class:"class",html:"html"},ngContentSelectors:l,decls:3,vars:4,consts:[["popoverTpl",""],["aria-hidden","true",3,"ngClass","ngbPopover","click"],[3,"innerHtml"]],template:function(e,t){if(1&e&&(r.tc(),r.Pc(0,a,2,3,"ng-template",null,0,r.Qc),r.Xb(2,"i",1),r.lc("click",function(e){return e.preventDefault()}),r.Wb()),2&e){const e=r.Fc(1);r.Db(2),r.uc("ngClass",r.zc(2,c,t.icons.questionCircle))("ngbPopover",e)}},directives:[s.p,o.w],styles:["i[_ngcontent-%COMP%]{color:#2b99a8;cursor:pointer;padding-left:4px}"]}),e})()},pLZG:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e,t){return function(n){return n.lift(new s(e,t))}}class s{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new o(e,this.predicate,this.thisArg))}}class o extends i.a{constructor(e,t,n){super(e),this.predicate=t,this.thisArg=n,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}},pkCn:function(e,t,n){"use strict";var i=n("0Dky");e.exports=function(e,t){var n=[][e];return!!n&&i(function(){n.call(null,t||function(){throw 1},1)})}},ppaS:function(e,t,n){"use strict";n.d(t,"a",function(){return d});var i=n("8Y7J"),r=n("oxzT"),s=n("DNAf"),o=n("wnGv"),a=n("SVse");const c=["cdSelect"],l=function(e){return[e]};function u(e,t){if(1&e){const e=i.Yb();i.Xb(0,"span"),i.Xb(1,"span",4),i.Xb(2,"span",5),i.Rc(3),i.Wb(),i.Xb(4,"a",6),i.lc("click",function(){i.Ic(e);const n=t.$implicit;return i.nc(),i.Fc(1).removeItem(n)}),i.Sb(5,"i",7),i.Wb(),i.Wb(),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc();i.Db(3),i.Sc(e),i.Db(2),i.uc("ngClass",i.zc(2,l,n.icons.destroy))}}let d=(()=>{class e{constructor(){this.data=[],this.options=[],this.messages=new s.a({}),this.customBadges=!1,this.customBadgeValidators=[],this.selection=new i.p,this.icons=r.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-select-badges"]],viewQuery:function(e,t){if(1&e&&i.Wc(c,3),2&e){let e;i.Ec(e=i.mc())&&(t.cdSelect=e.first)}},inputs:{data:"data",options:"options",messages:"messages",selectionLimit:"selectionLimit",customBadges:"customBadges",customBadgeValidators:"customBadgeValidators"},outputs:{selection:"selection"},decls:4,vars:10,consts:[["elemClass","mr-2 select-menu-edit",3,"data","options","messages","selectionLimit","customBadges","customBadgeValidators","selection"],["cdSelect",""],[3,"ngClass"],[4,"ngFor","ngForOf"],[1,"badge","badge-dark","mr-2"],[1,"mr-2"],[1,"badge-remove",3,"click"],["aria-hidden","true",3,"ngClass"]],template:function(e,t){1&e&&(i.Xb(0,"cd-select",0,1),i.lc("selection",function(e){return t.selection.emit(e)}),i.Sb(2,"i",2),i.Wb(),i.Pc(3,u,6,4,"span",3)),2&e&&(i.uc("data",t.data)("options",t.options)("messages",t.messages)("selectionLimit",t.selectionLimit)("customBadges",t.customBadges)("customBadgeValidators",t.customBadgeValidators),i.Db(2),i.uc("ngClass",i.zc(8,l,t.icons.edit)),i.Db(1),i.uc("ngForOf",t.data))},directives:[o.a,a.p,a.q],styles:[".badge-remove[_ngcontent-%COMP%]{color:#fff}i.fa-pencil[_ngcontent-%COMP%]{font-size:1.1rem}"]}),e})()},pxpQ:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return a});var i=n("7o/Q"),r=n("WMd4");function s(e,t=0){return function(n){return n.lift(new o(e,t))}}class o{constructor(e,t=0){this.scheduler=e,this.delay=t}call(e,t){return t.subscribe(new a(e,this.scheduler,this.delay))}}class a extends i.a{constructor(e,t,n=0){super(e),this.scheduler=t,this.delay=n}static dispatch(e){const{notification:t,destination:n}=e;t.observe(n),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new c(e,this.destination)))}_next(e){this.scheduleMessage(r.a.createNext(e))}_error(e){this.scheduleMessage(r.a.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(r.a.createComplete()),this.unsubscribe()}}class c{constructor(e,t){this.notification=e,this.destination=t}}},pyRK:function(e,t,n){"use strict";var i=Object.prototype;t.a=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}},quSY:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("DH7j"),r=n("XoHu"),s=n("n6bG");const o=(()=>{function e(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e})();let a=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:a,_unsubscribe:l,_subscriptions:u}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(let e=0;e<n.length;++e)n[e].remove(this);if(Object(s.a)(l)){a&&(this._unsubscribe=void 0);try{l.call(this)}catch(d){t=d instanceof o?c(d.errors):[d]}}if(Object(i.a)(u)){let e=-1,n=u.length;for(;++e<n;){const n=u[e];if(Object(r.a)(n))try{n.unsubscribe()}catch(d){t=t||[],d instanceof o?t=t.concat(c(d.errors)):t.push(d)}}}if(t)throw new o(t)}add(t){let n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){const t=n;n=new e,n._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:i}=n;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}const r=this._subscriptions;return null===r?this._subscriptions=[n]:r.push(n),n}remove(e){const t=this._subscriptions;if(t){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}}var t;return e.EMPTY=((t=new e).closed=!0,t),e})();function c(e){return e.reduce((e,t)=>e.concat(t instanceof o?t.errors:t),[])}},qvJo:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["\u0925\u094b\u0921\u092f\u093e \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940","\u0925\u094b\u0921\u0947 \u0938\u0945\u0915\u0902\u0921"],ss:[e+" \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940",e+" \u0938\u0945\u0915\u0902\u0921"],m:["\u090f\u0915\u093e \u092e\u093f\u0923\u091f\u093e\u0928","\u090f\u0915 \u092e\u093f\u0928\u0942\u091f"],mm:[e+" \u092e\u093f\u0923\u091f\u093e\u0902\u0928\u0940",e+" \u092e\u093f\u0923\u091f\u093e\u0902"],h:["\u090f\u0915\u093e \u0935\u0930\u093e\u0928","\u090f\u0915 \u0935\u0930"],hh:[e+" \u0935\u0930\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u093e\u0902"],d:["\u090f\u0915\u093e \u0926\u093f\u0938\u093e\u0928","\u090f\u0915 \u0926\u0940\u0938"],dd:[e+" \u0926\u093f\u0938\u093e\u0902\u0928\u0940",e+" \u0926\u0940\u0938"],M:["\u090f\u0915\u093e \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928","\u090f\u0915 \u092e\u094d\u0939\u092f\u0928\u094b"],MM:[e+" \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928\u0940",e+" \u092e\u094d\u0939\u092f\u0928\u0947"],y:["\u090f\u0915\u093e \u0935\u0930\u094d\u0938\u093e\u0928","\u090f\u0915 \u0935\u0930\u094d\u0938"],yy:[e+" \u0935\u0930\u094d\u0938\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u094d\u0938\u093e\u0902"]};return i?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u092f_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),format:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092e\u093e\u0930\u094d\u091a\u093e\u091a\u094d\u092f\u093e_\u090f\u092a\u094d\u0930\u0940\u0932\u093e\u091a\u094d\u092f\u093e_\u092e\u0947\u092f\u093e\u091a\u094d\u092f\u093e_\u091c\u0942\u0928\u093e\u091a\u094d\u092f\u093e_\u091c\u0941\u0932\u092f\u093e\u091a\u094d\u092f\u093e_\u0911\u0917\u0938\u094d\u091f\u093e\u091a\u094d\u092f\u093e_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0911\u0915\u094d\u091f\u094b\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0921\u093f\u0938\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940._\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u092f\u0924\u093e\u0930_\u0938\u094b\u092e\u093e\u0930_\u092e\u0902\u0917\u0933\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u092c\u093f\u0930\u0947\u0938\u094d\u0924\u093e\u0930_\u0938\u0941\u0915\u094d\u0930\u093e\u0930_\u0936\u0947\u0928\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0906\u092f\u0924._\u0938\u094b\u092e._\u092e\u0902\u0917\u0933._\u092c\u0941\u0927._\u092c\u094d\u0930\u0947\u0938\u094d\u0924._\u0938\u0941\u0915\u094d\u0930._\u0936\u0947\u0928.".split("_"),weekdaysMin:"\u0906_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u092c\u094d\u0930\u0947_\u0938\u0941_\u0936\u0947".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LTS:"A h:mm:ss [\u0935\u093e\u091c\u0924\u093e\u0902]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",llll:"ddd, D MMM YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]"},calendar:{sameDay:"[\u0906\u092f\u091c] LT",nextDay:"[\u092b\u093e\u0932\u094d\u092f\u093e\u0902] LT",nextWeek:"[\u092b\u0941\u0921\u0932\u094b] dddd[,] LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092b\u093e\u091f\u0932\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s \u0906\u0926\u0940\u0902",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(\u0935\u0947\u0930)/,ordinal:function(e,t){switch(t){case"D":return e+"\u0935\u0947\u0930";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/\u0930\u093e\u0924\u0940|\u0938\u0915\u093e\u0933\u0940\u0902|\u0926\u0928\u092a\u093e\u0930\u093e\u0902|\u0938\u093e\u0902\u091c\u0947/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u0940"===t?e<4?e:e+12:"\u0938\u0915\u093e\u0933\u0940\u0902"===t?e:"\u0926\u0928\u092a\u093e\u0930\u093e\u0902"===t?e>12?e:e+12:"\u0938\u093e\u0902\u091c\u0947"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924\u0940":e<12?"\u0938\u0915\u093e\u0933\u0940\u0902":e<16?"\u0926\u0928\u092a\u093e\u0930\u093e\u0902":e<20?"\u0938\u093e\u0902\u091c\u0947":"\u0930\u093e\u0924\u0940"}})}(n("wd/R"))},rB9j:function(e,t,n){"use strict";var i=n("I+eb"),r=n("kmMV");i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},rKzb:function(e,t,n){"use strict";var i=n("4zBA"),r=n("4syw"),s=n("8YOa").getWeakData,o=n("glrk"),a=n("hh1v"),c=n("GarU"),l=n("ImZN"),u=n("tycR"),d=n("Gi26"),h=n("afO8"),f=h.set,p=h.getterFor,m=u.find,b=u.findIndex,g=i([].splice),_=0,v=function(e){return e.frozen||(e.frozen=new y)},y=function(){this.entries=[]},w=function(e,t){return m(e.entries,function(e){return e[0]===t})};y.prototype={get:function(e){var t=w(this,e);if(t)return t[1]},has:function(e){return!!w(this,e)},set:function(e,t){var n=w(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=b(this.entries,function(t){return t[0]===e});return~t&&g(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,i){var u=e(function(e,r){c(e,h),f(e,{type:t,id:_++,frozen:void 0}),null!=r&&l(r,e[i],{that:e,AS_ENTRIES:n})}),h=u.prototype,m=p(t),b=function(e,t,n){var i=m(e),r=s(o(t),!0);return!0===r?v(i).set(t,n):r[i.id]=n,e};return r(h,{delete:function(e){var t=m(this);if(!a(e))return!1;var n=s(e);return!0===n?v(t).delete(e):n&&d(n,t.id)&&delete n[t.id]},has:function(e){var t=m(this);if(!a(e))return!1;var n=s(e);return!0===n?v(t).has(e):n&&d(n,t.id)}}),r(h,n?{get:function(e){var t=m(this);if(a(e)){var n=s(e);return!0===n?v(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return b(this,e,t)}}:{add:function(e){return b(this,e,!0)}}),u}}},rW0t:function(e,t,n){"use strict";var i=n("glrk");e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},raLr:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443":"h"===n?t?"\u0433\u043e\u0434\u0438\u043d\u0430":"\u0433\u043e\u0434\u0438\u043d\u0443":e+" "+(i=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d",hh:t?"\u0433\u043e\u0434\u0438\u043d\u0430_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d":"\u0433\u043e\u0434\u0438\u043d\u0443_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u043d\u0456\u0432",MM:"\u043c\u0456\u0441\u044f\u0446\u044c_\u043c\u0456\u0441\u044f\u0446\u0456_\u043c\u0456\u0441\u044f\u0446\u0456\u0432",yy:"\u0440\u0456\u043a_\u0440\u043e\u043a\u0438_\u0440\u043e\u043a\u0456\u0432"}[n].split("_"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2]);var i,r}function n(e){return function(){return e+"\u043e"+(11===this.hours()?"\u0431":"")+"] LT"}}e.defineLocale("uk",{months:{format:"\u0441\u0456\u0447\u043d\u044f_\u043b\u044e\u0442\u043e\u0433\u043e_\u0431\u0435\u0440\u0435\u0437\u043d\u044f_\u043a\u0432\u0456\u0442\u043d\u044f_\u0442\u0440\u0430\u0432\u043d\u044f_\u0447\u0435\u0440\u0432\u043d\u044f_\u043b\u0438\u043f\u043d\u044f_\u0441\u0435\u0440\u043f\u043d\u044f_\u0432\u0435\u0440\u0435\u0441\u043d\u044f_\u0436\u043e\u0432\u0442\u043d\u044f_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430_\u0433\u0440\u0443\u0434\u043d\u044f".split("_"),standalone:"\u0441\u0456\u0447\u0435\u043d\u044c_\u043b\u044e\u0442\u0438\u0439_\u0431\u0435\u0440\u0435\u0437\u0435\u043d\u044c_\u043a\u0432\u0456\u0442\u0435\u043d\u044c_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u0435\u0440\u0432\u0435\u043d\u044c_\u043b\u0438\u043f\u0435\u043d\u044c_\u0441\u0435\u0440\u043f\u0435\u043d\u044c_\u0432\u0435\u0440\u0435\u0441\u0435\u043d\u044c_\u0436\u043e\u0432\u0442\u0435\u043d\u044c_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434_\u0433\u0440\u0443\u0434\u0435\u043d\u044c".split("_")},monthsShort:"\u0441\u0456\u0447_\u043b\u044e\u0442_\u0431\u0435\u0440_\u043a\u0432\u0456\u0442_\u0442\u0440\u0430\u0432_\u0447\u0435\u0440\u0432_\u043b\u0438\u043f_\u0441\u0435\u0440\u043f_\u0432\u0435\u0440_\u0436\u043e\u0432\u0442_\u043b\u0438\u0441\u0442_\u0433\u0440\u0443\u0434".split("_"),weekdays:function(e,t){var n={nominative:"\u043d\u0435\u0434\u0456\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044f_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),accusative:"\u043d\u0435\u0434\u0456\u043b\u044e_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044e_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),genitive:"\u043d\u0435\u0434\u0456\u043b\u0456_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043a\u0430_\u0432\u0456\u0432\u0442\u043e\u0440\u043a\u0430_\u0441\u0435\u0440\u0435\u0434\u0438_\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u0456_\u0441\u0443\u0431\u043e\u0442\u0438".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[\u0412\u0432\u0423\u0443]\]) ?dddd/.test(t)?"accusative":/\[?(?:\u043c\u0438\u043d\u0443\u043b\u043e\u0457|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u043e\u0457)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0440.",LLL:"D MMMM YYYY \u0440., HH:mm",LLLL:"dddd, D MMMM YYYY \u0440., HH:mm"},calendar:{sameDay:n("[\u0421\u044c\u043e\u0433\u043e\u0434\u043d\u0456 "),nextDay:n("[\u0417\u0430\u0432\u0442\u0440\u0430 "),lastDay:n("[\u0412\u0447\u043e\u0440\u0430 "),nextWeek:n("[\u0423] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0457] dddd [").call(this);case 1:case 2:case 4:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0433\u043e] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"%s \u0442\u043e\u043c\u0443",s:"\u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0433\u043e\u0434\u0438\u043d\u0443",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,M:"\u043c\u0456\u0441\u044f\u0446\u044c",MM:t,y:"\u0440\u0456\u043a",yy:t},meridiemParse:/\u043d\u043e\u0447\u0456|\u0440\u0430\u043d\u043a\u0443|\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0456":e<12?"\u0440\u0430\u043d\u043a\u0443":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u043e\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-\u0439";case"D":return e+"-\u0433\u043e";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},rpNk:function(e,t,n){"use strict";var i,r,s,o=n("0Dky"),a=n("Fib7"),c=n("fHMY"),l=n("4WOD"),u=n("busE"),d=n("tiKp"),h=n("xDBR"),f=d("iterator"),p=!1;[].keys&&("next"in(s=[].keys())?(r=l(l(s)))!==Object.prototype&&(i=r):p=!0),null==i||o(function(){var e={};return i[f].call(e)!==e})?i={}:h&&(i=c(i)),a(i[f])||u(i,f,function(){return this}),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},"s+uk":function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"J\xe4nner_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"J\xe4n._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},s7LF:function(e,t,n){"use strict";n.d(t,"a",function(){return le}),n.d(t,"b",function(){return d}),n.d(t,"c",function(){return F}),n.d(t,"d",function(){return p}),n.d(t,"e",function(){return he}),n.d(t,"f",function(){return Re}),n.d(t,"g",function(){return Ke}),n.d(t,"h",function(){return ue}),n.d(t,"i",function(){return We}),n.d(t,"j",function(){return de}),n.d(t,"k",function(){return Le}),n.d(t,"l",function(){return Ae}),n.d(t,"m",function(){return Ge}),n.d(t,"n",function(){return g}),n.d(t,"o",function(){return l}),n.d(t,"p",function(){return j}),n.d(t,"q",function(){return N}),n.d(t,"r",function(){return z}),n.d(t,"s",function(){return me}),n.d(t,"t",function(){return ye}),n.d(t,"u",function(){return ze}),n.d(t,"v",function(){return Se}),n.d(t,"w",function(){return Me}),n.d(t,"x",function(){return Je}),n.d(t,"y",function(){return Ue}),n.d(t,"z",function(){return Ne}),n.d(t,"A",function(){return y}),n.d(t,"B",function(){return we}),n.d(t,"C",function(){return Ve});var i=n("8Y7J"),r=n("SVse"),s=n("Cfvw"),o=n("cp0P"),a=n("lJxs");class c{}const l=new i.u("NgValueAccessor"),u={provide:l,useExisting:Object(i.W)(()=>d),multi:!0};let d=(()=>{class e extends c{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n))},e.\u0275dir=i.Mb({type:e,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(e,t){1&e&&i.lc("change",function(e){return t.onChange(e.target.checked)})("blur",function(){return t.onTouched()})},features:[i.Cb([u]),i.Ab]}),e})();const h={provide:l,useExisting:Object(i.W)(()=>p),multi:!0},f=new i.u("CompositionEventMode");let p=(()=>{class e{constructor(e,t,n){this._renderer=e,this._elementRef=t,this._compositionMode=n,this.onChange=e=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=Object(r.L)()?Object(r.L)().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n),i.Rb(f,8))},e.\u0275dir=i.Mb({type:e,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(e,t){1&e&&i.lc("input",function(e){return t._handleInput(e.target.value)})("blur",function(){return t.onTouched()})("compositionstart",function(){return t._compositionStart()})("compositionend",function(e){return t._compositionEnd(e.target.value)})},features:[i.Cb([h])]}),e})();function m(e){return null==e||0===e.length}function b(e){return null!=e&&"number"==typeof e.length}const g=new i.u("NgValidators"),_=new i.u("NgAsyncValidators"),v=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class y{static min(e){return function(e){return t=>{if(m(t.value)||m(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n<e?{min:{min:e,actual:t.value}}:null}}(e)}static max(e){return function(e){return t=>{if(m(t.value)||m(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n>e?{max:{max:e,actual:t.value}}:null}}(e)}static required(e){return w(e)}static requiredTrue(e){return function(e){return!0===e.value?null:{required:!0}}(e)}static email(e){return function(e){return m(e.value)||v.test(e.value)?null:{email:!0}}(e)}static minLength(e){return function(e){return t=>m(t.value)||!b(t.value)?null:t.value.length<e?{minlength:{requiredLength:e,actualLength:t.value.length}}:null}(e)}static maxLength(e){return function(e){return t=>b(t.value)&&t.value.length>e?{maxlength:{requiredLength:e,actualLength:t.value.length}}:null}(e)}static pattern(e){return function(e){if(!e)return D;let t,n;return"string"==typeof e?(n="","^"!==e.charAt(0)&&(n+="^"),n+=e,"$"!==e.charAt(e.length-1)&&(n+="$"),t=new RegExp(n)):(n=e.toString(),t=e),e=>{if(m(e.value))return null;const i=e.value;return t.test(i)?null:{pattern:{requiredPattern:n,actualValue:i}}}}(e)}static nullValidator(e){return null}static compose(e){return C(e)}static composeAsync(e){return L(e)}}function w(e){return m(e.value)?{required:!0}:null}function D(e){return null}function S(e){return null!=e}function x(e){const t=Object(i.ub)(e)?Object(s.a)(e):e;return Object(i.tb)(t),t}function k(e){let t={};return e.forEach(e=>{t=null!=e?Object.assign(Object.assign({},t),e):t}),0===Object.keys(t).length?null:t}function T(e,t){return t.map(t=>t(e))}function M(e){return e.map(e=>function(e){return!e.validate}(e)?e:t=>e.validate(t))}function C(e){if(!e)return null;const t=e.filter(S);return 0==t.length?null:function(e){return k(T(e,t))}}function O(e){return null!=e?C(M(e)):null}function L(e){if(!e)return null;const t=e.filter(S);return 0==t.length?null:function(e){const n=T(e,t).map(x);return Object(o.a)(n).pipe(Object(a.a)(k))}}function E(e){return null!=e?L(M(e)):null}function A(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function I(e){return e._rawValidators}function R(e){return e._rawAsyncValidators}let P=(()=>{class e{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=O(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=E(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e}),e})(),F=(()=>{class e extends P{get formDirective(){return null}get path(){return null}}return e.\u0275fac=function(t){return W(t||e)},e.\u0275dir=i.Mb({type:e,features:[i.Ab]}),e})();const W=i.Zb(F);class j extends P{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class Y{constructor(e){this._cd=e}is(e){var t,n;return!!(null===(n=null===(t=this._cd)||void 0===t?void 0:t.control)||void 0===n?void 0:n[e])}}let N=(()=>{class e extends Y{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(j,2))},e.\u0275dir=i.Mb({type:e,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(e,t){2&e&&i.Jb("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[i.Ab]}),e})(),z=(()=>{class e extends Y{constructor(e){super(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(F,10))},e.\u0275dir=i.Mb({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(e,t){2&e&&i.Jb("ng-untouched",t.is("untouched"))("ng-touched",t.is("touched"))("ng-pristine",t.is("pristine"))("ng-dirty",t.is("dirty"))("ng-valid",t.is("valid"))("ng-invalid",t.is("invalid"))("ng-pending",t.is("pending"))},features:[i.Ab]}),e})();function $(e,t){return[...t.path,e]}function H(e,t){B(e,t,!0),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&q(e,t)})}(e,t),function(e,t){const n=(e,n)=>{t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)};e.registerOnChange(n),t._registerOnDestroy(()=>{e._unregisterOnChange(n)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&q(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function(e,t){if(t.valueAccessor.setDisabledState){const n=e=>{t.valueAccessor.setDisabledState(e)};e.registerOnDisabledChange(n),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(n)})}}(e,t)}function X(e,t,n=!0){const i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),U(e,t,!0),e&&(t._invokeOnDestroyCallbacks(),e._registerOnCollectionChange(()=>{}))}function V(e,t){e.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function B(e,t,n){const i=I(e);null!==t.validator?e.setValidators(A(i,t.validator)):"function"==typeof i&&e.setValidators([i]);const r=R(e);if(null!==t.asyncValidator?e.setAsyncValidators(A(r,t.asyncValidator)):"function"==typeof r&&e.setAsyncValidators([r]),n){const n=()=>e.updateValueAndValidity();V(t._rawValidators,n),V(t._rawAsyncValidators,n)}}function U(e,t,n){let i=!1;if(null!==e){if(null!==t.validator){const n=I(e);if(Array.isArray(n)&&n.length>0){const r=n.filter(e=>e!==t.validator);r.length!==n.length&&(i=!0,e.setValidators(r))}}if(null!==t.asyncValidator){const n=R(e);if(Array.isArray(n)&&n.length>0){const r=n.filter(e=>e!==t.asyncValidator);r.length!==n.length&&(i=!0,e.setAsyncValidators(r))}}}if(n){const e=()=>{};V(t._rawValidators,e),V(t._rawAsyncValidators,e)}return i}function q(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function G(e,t){B(e,t,!1)}function J(e,t){if(!e.hasOwnProperty("model"))return!1;const n=e.model;return!!n.isFirstChange()||!Object.is(t,n.currentValue)}function K(e,t){e._syncPendingControls(),t.forEach(e=>{const t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function Q(e,t){if(!t)return null;let n,i,r;return Array.isArray(t),t.forEach(e=>{e.constructor===p?n=e:Object.getPrototypeOf(e.constructor)===c?i=e:r=e}),r||i||n||null}function Z(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ee="VALID",te="INVALID",ne="PENDING",ie="DISABLED";function re(e){return(ce(e)?e.validators:e)||null}function se(e){return Array.isArray(e)?O(e):e||null}function oe(e,t){return(ce(t)?t.asyncValidators:e)||null}function ae(e){return Array.isArray(e)?E(e):e||null}function ce(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class le{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=se(this._rawValidators),this._composedAsyncValidatorFn=ae(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===ee}get invalid(){return this.status===te}get pending(){return this.status==ne}get disabled(){return this.status===ie}get enabled(){return this.status!==ie}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=se(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=ae(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=ne,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=ie,this.errors=null,this._forEachChild(t=>{t.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=ee,this._forEachChild(t=>{t.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==ee&&this.status!==ne||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ie:ee}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=ne,this._hasOwnPendingAsyncValidator=!0;const t=x(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(t,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,n){if(null==t)return null;if(Array.isArray(t)||(t=t.split(".")),Array.isArray(t)&&0===t.length)return null;let i=e;return t.forEach(e=>{i=i instanceof de?i.controls.hasOwnProperty(e)?i.controls[e]:null:i instanceof he&&i.at(e)||null}),i}(this,e)}getError(e,t){const n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new i.p,this.statusChanges=new i.p}_calculateStatus(){return this._allControlsDisabled()?ie:this.errors?te:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ne)?ne:this._anyControlsHaveStatus(te)?te:ee}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){ce(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class ue extends le{constructor(e=null,t,n){super(re(t),oe(n,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){Z(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){Z(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class de extends le{constructor(e,t,n){super(re(t),oe(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((n,i)=>{n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,n)=>(e[n]=t instanceof ue?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet. If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const n=this.controls[t];n&&e(n,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const n=this.controls[t];if(this.contains(t)&&e(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,n)=>((t.enabled||this.disabled)&&(e[n]=t.value),e))}_reduceChildren(e,t){let n=e;return this._forEachChild((e,i)=>{n=t(n,e,i)}),n}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class he extends le{constructor(e,t,n){super(re(t),oe(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((e,n)=>{this.at(n)&&this.at(n).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((n,i)=>{n.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof ue?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet. If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,n)=>{e(t,n)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const fe={provide:F,useExisting:Object(i.W)(()=>me)},pe=(()=>Promise.resolve(null))();let me=(()=>{class e extends F{constructor(e,t){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new i.p,this.form=new de({},O(e),E(t))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){pe.then(()=>{const t=this._findContainer(e.path);e.control=t.registerControl(e.name,e.control),H(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){pe.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name),Z(this._directives,e)})}addFormGroup(e){pe.then(()=>{const t=this._findContainer(e.path),n=new de({});G(n,e),t.registerControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){pe.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,t){pe.then(()=>{this.form.get(e.path).setValue(t)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,K(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(g,10),i.Rb(_,10))},e.\u0275dir=i.Mb({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(e,t){1&e&&i.lc("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[i.Cb([fe]),i.Ab]}),e})(),be=(()=>{class e extends F{ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return $(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}}return e.\u0275fac=function(t){return ge(t||e)},e.\u0275dir=i.Mb({type:e,features:[i.Ab]}),e})();const ge=i.Zb(be),_e={provide:j,useExisting:Object(i.W)(()=>ye)},ve=(()=>Promise.resolve(null))();let ye=(()=>{class e extends j{constructor(e,t,n,r){super(),this.control=new ue,this._registered=!1,this.update=new i.p,this._parent=e,this._setValidators(t),this._setAsyncValidators(n),this.valueAccessor=Q(0,r)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),J(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?$(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){H(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){ve.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const t=e.isDisabled.currentValue,n=""===t||t&&"false"!==t;ve.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(F,9),i.Rb(g,10),i.Rb(_,10),i.Rb(l,10))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[i.Cb([_e]),i.Ab,i.Bb]}),e})(),we=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),e})();const De={provide:l,useExisting:Object(i.W)(()=>Se),multi:!0};let Se=(()=>{class e extends c{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n))},e.\u0275dir=i.Mb({type:e,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(e,t){1&e&&i.lc("input",function(e){return t.onChange(e.target.value)})("blur",function(){return t.onTouched()})},features:[i.Cb([De]),i.Ab]}),e})();const xe={provide:l,useExisting:Object(i.W)(()=>Me),multi:!0};let ke=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({}),e})(),Te=(()=>{class e{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:function(){return new e},token:e,providedIn:ke}),e})(),Me=(()=>{class e extends c{constructor(e,t,n,i){super(),this._renderer=e,this._elementRef=t,this._registry=n,this._injector=i,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(j),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}fireUncheck(e){this.writeValue(e)}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_checkName(){!this.name&&this.formControlName&&(this.name=this.formControlName)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n),i.Rb(Te),i.Rb(i.v))},e.\u0275dir=i.Mb({type:e,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(e,t){1&e&&i.lc("change",function(){return t.onChange()})("blur",function(){return t.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},features:[i.Cb([xe]),i.Ab]}),e})();const Ce=new i.u("NgModelWithFormControlWarning"),Oe={provide:F,useExisting:Object(i.W)(()=>Le)};let Le=(()=>{class e extends F{constructor(e,t){super(),this.validators=e,this.asyncValidators=t,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new i.p,this._setValidators(e),this._setAsyncValidators(t)}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(U(this.form,this,!1),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const t=this.form.get(e.path);return H(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}getControl(e){return this.form.get(e.path)}removeControl(e){X(e.control||null,e,!1),Z(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,t){this.form.get(e.path).setValue(t)}onSubmit(e){return this.submitted=!0,K(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach(e=>{const t=e.control,n=this.form.get(e.path);t!==n&&(X(t||null,e),n instanceof ue&&(H(n,e),e.control=n))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){const t=this.form.get(e.path);G(t,e),t.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){const t=this.form.get(e.path);t&&function(e,t){return U(e,t,!1)}(t,e)&&t.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){B(this.form,this,!1),this._oldForm&&U(this._oldForm,this,!1)}_checkFormPresent(){}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(g,10),i.Rb(_,10))},e.\u0275dir=i.Mb({type:e,selectors:[["","formGroup",""]],hostBindings:function(e,t){1&e&&i.lc("submit",function(e){return t.onSubmit(e)})("reset",function(){return t.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[i.Cb([Oe]),i.Ab,i.Bb]}),e})();const Ee={provide:F,useExisting:Object(i.W)(()=>Ae)};let Ae=(()=>{class e extends be{constructor(e,t,n){super(),this._parent=e,this._setValidators(t),this._setAsyncValidators(n)}_checkParentType(){Pe(this._parent)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(F,13),i.Rb(g,10),i.Rb(_,10))},e.\u0275dir=i.Mb({type:e,selectors:[["","formGroupName",""]],inputs:{name:["formGroupName","name"]},features:[i.Cb([Ee]),i.Ab]}),e})();const Ie={provide:F,useExisting:Object(i.W)(()=>Re)};let Re=(()=>{class e extends F{constructor(e,t,n){super(),this._parent=e,this._setValidators(t),this._setAsyncValidators(n)}ngOnInit(){this._checkParentType(),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return $(null==this.name?this.name:this.name.toString(),this._parent)}_checkParentType(){Pe(this._parent)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(F,13),i.Rb(g,10),i.Rb(_,10))},e.\u0275dir=i.Mb({type:e,selectors:[["","formArrayName",""]],inputs:{name:["formArrayName","name"]},features:[i.Cb([Ie]),i.Ab]}),e})();function Pe(e){return!(e instanceof Ae||e instanceof Le||e instanceof Re)}const Fe={provide:j,useExisting:Object(i.W)(()=>We)};let We=(()=>{class e extends j{constructor(e,t,n,r,s){super(),this._ngModelWarningConfig=s,this._added=!1,this.update=new i.p,this._ngModelWarningSent=!1,this._parent=e,this._setValidators(t),this._setAsyncValidators(n),this.valueAccessor=Q(0,r)}set isDisabled(e){}ngOnChanges(e){this._added||this._setUpControl(),J(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return $(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(F,13),i.Rb(g,10),i.Rb(_,10),i.Rb(l,10),i.Rb(Ce,8))},e.\u0275dir=i.Mb({type:e,selectors:[["","formControlName",""]],inputs:{isDisabled:["disabled","isDisabled"],name:["formControlName","name"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},features:[i.Cb([Fe]),i.Ab,i.Bb]}),e._ngModelWarningSentOnce=!1,e})();const je={provide:l,useExisting:Object(i.W)(()=>Ne),multi:!0};function Ye(e,t){return null==e?`${t}`:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}let Ne=(()=>{class e extends c{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(e){this._compareWith=e}writeValue(e){this.value=e;const t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=Ye(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(e){this.onChange=t=>{this.value=this._getOptionValue(t),e(this.value)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t),e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n))},e.\u0275dir=i.Mb({type:e,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(e,t){1&e&&i.lc("change",function(e){return t.onChange(e.target.value)})("blur",function(){return t.onTouched()})},inputs:{compareWith:"compareWith"},features:[i.Cb([je]),i.Ab]}),e})(),ze=(()=>{class e{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(e){null!=this._select&&(this._select._optionMap.set(this.id,e),this._setElementValue(Ye(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._setElementValue(e),this._select&&this._select.writeValue(this._select.value)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H),i.Rb(Ne,9))},e.\u0275dir=i.Mb({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),e})();const $e={provide:l,useExisting:Object(i.W)(()=>Xe),multi:!0};function He(e,t){return null==e?`${t}`:("string"==typeof t&&(t=`'${t}'`),t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}let Xe=(()=>{class e extends c{constructor(e,t){super(),this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=Object.is}set compareWith(e){this._compareWith=e}writeValue(e){let t;if(this.value=e,Array.isArray(e)){const n=e.map(e=>this._getOptionId(e));t=(e,t)=>{e._setSelected(n.indexOf(t.toString())>-1)}}else t=(e,t)=>{e._setSelected(!1)};this._optionMap.forEach(t)}registerOnChange(e){this.onChange=t=>{const n=[];if(void 0!==t.selectedOptions){const e=t.selectedOptions;for(let t=0;t<e.length;t++){const i=e.item(t),r=this._getOptionValue(i.value);n.push(r)}}else{const e=t.options;for(let t=0;t<e.length;t++){const i=e.item(t);if(i.selected){const e=this._getOptionValue(i.value);n.push(e)}}}this.value=n,e(n)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(e){const t=(this._idCounter++).toString();return this._optionMap.set(t,e),t}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t)._value,e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t)._value:e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.H),i.Rb(i.n))},e.\u0275dir=i.Mb({type:e,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(e,t){1&e&&i.lc("change",function(e){return t.onChange(e.target)})("blur",function(){return t.onTouched()})},inputs:{compareWith:"compareWith"},features:[i.Cb([$e]),i.Ab]}),e})(),Ve=(()=>{class e{constructor(e,t,n){this._element=e,this._renderer=t,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){null!=this._select&&(this._value=e,this._setElementValue(He(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(He(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H),i.Rb(Xe,9))},e.\u0275dir=i.Mb({type:e,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),e})();const Be={provide:g,useExisting:Object(i.W)(()=>Ue),multi:!0};let Ue=(()=>{class e{constructor(){this._required=!1}get required(){return this._required}set required(e){this._required=null!=e&&!1!==e&&"false"!=`${e}`,this._onChange&&this._onChange()}validate(e){return this.required?w(e):null}registerOnValidatorChange(e){this._onChange=e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(e,t){2&e&&i.Eb("required",t.required?"":null)},inputs:{required:"required"},features:[i.Cb([Be])]}),e})(),qe=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[[ke]]}),e})(),Ge=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[qe]}),e})(),Je=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:Ce,useValue:t.warnOnNgModelWithFormControl}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[qe]}),e})(),Ke=(()=>{class e{group(e,t=null){const n=this._reduceControls(e);let i,r=null,s=null;return null!=t&&(function(e){return void 0!==e.asyncValidators||void 0!==e.validators||void 0!==e.updateOn}(t)?(r=null!=t.validators?t.validators:null,s=null!=t.asyncValidators?t.asyncValidators:null,i=null!=t.updateOn?t.updateOn:void 0):(r=null!=t.validator?t.validator:null,s=null!=t.asyncValidator?t.asyncValidator:null)),new de(n,{asyncValidators:s,updateOn:i,validators:r})}control(e,t,n){return new ue(e,t,n)}array(e,t,n){const i=e.map(e=>this._createControl(e));return new he(i,t,n)}_reduceControls(e){const t={};return Object.keys(e).forEach(n=>{t[n]=this._createControl(e[n])}),t}_createControl(e){return e instanceof ue||e instanceof de||e instanceof he?e:Array.isArray(e)?this.control(e[0],e.length>1?e[1]:null,e.length>2?e[2]:null):this.control(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(i.Nb)({factory:function(){return new e},token:e,providedIn:Je}),e})()},sEFX:function(e,t,n){"use strict";var i=n("AO7/"),r=n("9d/t");e.exports=i?{}.toString:function(){return"[object "+r(this)+"]"}},sMBO:function(e,t,n){var i=n("g6v/"),r=n("Xnc8").EXISTS,s=n("4zBA"),o=n("m/L8").f,a=Function.prototype,c=s(a.toString),l=/^\s*function ([^ (]*)/,u=s(l.exec);i&&!r&&o(a,"name",{configurable:!0,get:function(){try{return u(l,c(this))[1]}catch(e){return""}}})},sVev:function(e,t,n){"use strict";n.d(t,"a",function(){return i});const i=(()=>{function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e})()},sb0X:function(e,t,n){"use strict";n.d(t,"a",function(){return f});var i=n("8Y7J"),r=n("s7LF"),s=n("LvDl"),o=n.n(s),a=n("oxzT"),c=n("ANnk"),l=n("SVse");const u=function(e,t){return[e,t]};function d(e,t){if(1&e&&(i.Xb(0,"span"),i.Sb(1,"i",2),i.Wb()),2&e){const e=i.nc();i.Db(1),i.uc("ngClass",i.Ac(1,u,e.icons.spinner,e.icons.spin))}}const h=["*"];let f=(()=>{class e{constructor(e){this.elRef=e,this.type="submit",this.disabled=!1,this.submitAction=new i.p,this.loading=!1,this.icons=a.a}ngOnInit(){this.form.statusChanges.subscribe(()=>{o.a.has(this.form.errors,"cdSubmitButton")&&(this.loading=!1,o.a.unset(this.form.errors,"cdSubmitButton"),this.form instanceof r.a&&this.form.updateValueAndValidity())})}submit(e){this.focusButton(),this.form instanceof r.k&&this.form.onSubmit(e),this.form.invalid?this.focusInvalid():(this.loading=!0,this.submitAction.emit())}focusButton(){this.elRef.nativeElement.offsetParent.querySelector(`button[type="${this.type}"]`).focus()}focusInvalid(){const e=this.elRef.nativeElement.offsetParent.querySelector("input.ng-invalid, select.ng-invalid");e&&e.focus()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-submit-button"]],inputs:{form:"form",type:"type",disabled:"disabled",btnClass:"btnClass"},outputs:{submitAction:"submitAction"},ngContentSelectors:h,decls:3,vars:4,consts:[[1,"btn","btn-accent","tc_submitButton",3,"type","ngClass","disabled","click"],[4,"ngIf"],[3,"ngClass"]],template:function(e,t){1&e&&(i.tc(),i.Xb(0,"button",0),i.lc("click",function(e){return t.submit(e)}),i.sc(1),i.Pc(2,d,2,4,"span",1),i.Wb()),2&e&&(i.uc("type",t.type)("ngClass",t.btnClass)("disabled",t.loading||t.disabled),i.Db(2),i.uc("ngIf",t.loading))},directives:[c.a,l.p,l.r],styles:[""]}),e})()},sne2:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"e",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"b",function(){return c}),n.d(t,"d",function(){return l});var i=n("AytR"),r=n("8Y7J");let s=(()=>{class e{}return e.organization="ceph",e.projectName="Ceph Dashboard",e.license="Free software (LGPL 2.1).",e.copyright="Copyright(c) "+i.a.year+" Ceph contributors.",e.cephLogo="assets/Ceph_Logo.svg",e})();var o=function(e){return e.CREATE="create",e.EDIT="edit",e.UPDATE="update",e.REMOVE="remove",e.DELETE="delete",e.ADD="add",e.COPY="copy",e.CLONE="clone",e.RECREATE="recreate",e.EXPIRE="expire",e}({}),a=function(e){return e.CREATE="Create",e.DELETE="Delete",e.ADD="Add",e.REMOVE="Remove",e.EDIT="Edit",e.CANCEL="Cancel",e.COPY="Copy",e.CLONE="Clone",e.UPDATE="Update",e.EVICT="Evict",e.SHOW="Show",e.RECREATE="Recreate",e.EXPIRE="Expire",e}({});let c=(()=>{class e{constructor(){this.CREATE="Create",this.DELETE="Delete",this.ADD="Add",this.SET="Set",this.SUBMIT="Submit",this.REMOVE="Remove",this.UNSET="Unset",this.EDIT="Edit",this.UPDATE="Update",this.CANCEL="Cancel",this.PREVIEW="Preview",this.MOVE="Move",this.NEXT="Next",this.BACK="Back",this.CLONE="Clone",this.COPY="Copy",this.DEEP_SCRUB="Deep Scrub",this.DESTROY="Destroy",this.EVICT="Evict",this.FLATTEN="Flatten",this.MARK_DOWN="Mark Down",this.MARK_IN="Mark In",this.MARK_LOST="Mark Lost",this.MARK_OUT="Mark Out",this.PROTECT="Protect",this.PURGE="Purge",this.RENAME="Rename",this.RESTORE="Restore",this.REWEIGHT="Reweight",this.ROLLBACK="Rollback",this.SCRUB="Scrub",this.SHOW="Show",this.TRASH="Move to Trash",this.UNPROTECT="Unprotect",this.CHANGE="Change",this.FLAGS="Flags",this.ENTER_MAINTENANCE="Enter Maintenance",this.EXIT_MAINTENANCE="Exit Maintenance",this.RECREATE="Recreate",this.EXPIRE="Expire"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),l=(()=>{class e{constructor(){this.CREATED="Created",this.DELETED="Deleted",this.ADDED="Added",this.REMOVED="Removed",this.EDITED="Edited",this.CANCELED="Canceled",this.PREVIEWED="Previewed",this.MOVED="Moved",this.CLONED="Cloned",this.COPIED="Copied",this.DEEP_SCRUBBED="Deep Scrubbed",this.DESTROYED="Destroyed",this.FLATTENED="Flattened",this.MARKED_DOWN="Marked Down",this.MARKED_IN="Marked In",this.MARKED_LOST="Marked Lost",this.MARKED_OUT="Marked Out",this.PROTECTED="Protected",this.PURGED="Purged",this.RENAMED="Renamed",this.RESTORED="Restored",this.REWEIGHTED="Reweighted",this.ROLLED_BACK="Rolled back",this.SCRUBBED="Scrubbed",this.SHOWED="Showed",this.TRASHED="Moved to Trash",this.UNPROTECTED="Unprotected",this.CHANGE="Change",this.RECREATED="Recreated",this.EXPIRED="Expired"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},sp3z:function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),monthsShort:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),weekdays:"\u0ead\u0eb2\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysShort:"\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysMin:"\u0e97_\u0e88_\u0ead\u0e84_\u0e9e_\u0e9e\u0eab_\u0eaa\u0e81_\u0eaa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"\u0ea7\u0eb1\u0e99dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2|\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87/,isPM:function(e){return"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"===e},meridiem:function(e,t,n){return e<12?"\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2":"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"},calendar:{sameDay:"[\u0ea1\u0eb7\u0ec9\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextDay:"[\u0ea1\u0eb7\u0ec9\u0ead\u0eb7\u0ec8\u0e99\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0edc\u0ec9\u0eb2\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastDay:"[\u0ea1\u0eb7\u0ec9\u0ea7\u0eb2\u0e99\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0ec1\u0ea5\u0ec9\u0ea7\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",sameElse:"L"},relativeTime:{future:"\u0ead\u0eb5\u0e81 %s",past:"%s\u0e9c\u0ec8\u0eb2\u0e99\u0ea1\u0eb2",s:"\u0e9a\u0ecd\u0ec8\u0ec0\u0e97\u0ebb\u0ec8\u0eb2\u0ec3\u0e94\u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",ss:"%d \u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",m:"1 \u0e99\u0eb2\u0e97\u0eb5",mm:"%d \u0e99\u0eb2\u0e97\u0eb5",h:"1 \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",hh:"%d \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",d:"1 \u0ea1\u0eb7\u0ec9",dd:"%d \u0ea1\u0eb7\u0ec9",M:"1 \u0ec0\u0e94\u0eb7\u0ead\u0e99",MM:"%d \u0ec0\u0e94\u0eb7\u0ead\u0e99",y:"1 \u0e9b\u0eb5",yy:"%d \u0e9b\u0eb5"},dayOfMonthOrdinalParse:/(\u0e97\u0eb5\u0ec8)\d{1,2}/,ordinal:function(e){return"\u0e97\u0eb5\u0ec8"+e}})}(n("wd/R"))},spCT:function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return r});var i=function(e){return e[e.Loading=0]="Loading",e[e.Ready=1]="Ready",e[e.Error=2]="Error",e[e.None=3]="None",e}({});class r{constructor(){this.loading=i.Loading}loadingStart(){this.loading=i.Loading}loadingReady(){this.loading=i.Ready}loadingError(){this.loading=i.Error}loadingNone(){this.loading=i.None}}},st4c:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var i=n("8Y7J"),r=n("IheW");let s=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/crush_rule",this.formTooltips={root:"The name of the node under which data should be placed.",failure_domain:"The type of CRUSH nodes across which we should separate replicas.",device_class:"The device class data should be placed on."}}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(i.ic(r.b))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"t+mt":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"t/zF":function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e,t){this.name=e,this.metadata=t}}},tGlX:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},tPH9:function(e,t,n){"use strict";t.a=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}},tT3J:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minu\u1e0d",mm:"%d minu\u1e0d",h:"sa\u025ba",hh:"%d tassa\u025bin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("wd/R"))},tUCv:function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("wd/R"))},tbfe:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),i=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,i){return e?/-MMM-/.test(i)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:i,longMonthsParse:i,shortMonthsParse:i,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},tiKp:function(e,t,n){var i=n("2oRo"),r=n("VpIT"),s=n("Gi26"),o=n("kOOl"),a=n("STAE"),c=n("/b8u"),l=r("wks"),u=i.Symbol,d=u&&u.for,h=c?u:u&&u.withoutSetter||o;e.exports=function(e){if(!s(l,e)||!a&&"string"!=typeof l[e]){var t="Symbol."+e;l[e]=a&&s(u,e)?u[e]:c&&d?d(t):h(t)}return l[e]}},tycR:function(e,t,n){var i=n("A2ZE"),r=n("4zBA"),s=n("RK3t"),o=n("ewvW"),a=n("B/qT"),c=n("ZfDv"),l=r([].push),u=function(e){var t=1==e,n=2==e,r=3==e,u=4==e,d=6==e,h=7==e,f=5==e||d;return function(p,m,b,g){for(var _,v,y=o(p),w=s(y),D=i(m,b),S=a(w),x=0,k=g||c,T=t?k(p,S):n||h?k(p,0):void 0;S>x;x++)if((f||x in w)&&(v=D(_=w[x],x,y),e))if(t)T[x]=v;else if(v)switch(e){case 3:return!0;case 5:return _;case 6:return x;case 2:l(T,_)}else switch(e){case 4:return!1;case 7:l(T,_)}return d?-1:r||u?u:T}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},tz6c:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var i=n("2Vo4"),r=n("pLZG"),s=n("lJxs"),o=n("SxV6"),a=n("+0ag"),c=n("mSOc"),l=n("8Y7J");let u=(()=>{class e{constructor(e,t){this.summaryservice=e,this.cephReleaseNamePipe=t,this.releaseDataSource=new i.a(null),this.releaseData$=this.releaseDataSource.asObservable(),this.summaryservice.subscribeOnce(e=>{const t=this.cephReleaseNamePipe.transform(e.version);this.releaseDataSource.next(t)})}urlGenerator(e,t="master"){const n=`https://docs.ceph.com/en/${"master"===t?"latest":t}/`,i="https://ceph.io/";return{iscsi:`${n}mgr/dashboard/#enabling-iscsi-management`,prometheus:`${n}mgr/dashboard/#enabling-prometheus-alerting`,"nfs-ganesha":`${n}mgr/dashboard/#configuring-nfs-ganesha-in-the-dashboard`,"rgw-nfs":`${n}radosgw/nfs`,rgw:`${n}mgr/dashboard/#enabling-the-object-gateway-management-frontend`,dashboard:`${n}mgr/dashboard`,grafana:`${n}mgr/dashboard/#enabling-the-embedding-of-grafana-dashboards`,orch:`${n}mgr/orchestrator`,pgs:`${i}pgcalc`,help:`${i}help/`,security:`${i}security/`,trademarks:`${i}legal-page/trademarks/`,"dashboard-landing-page-status":`${n}mgr/dashboard/#dashboard-landing-page-status`,"dashboard-landing-page-performance":`${n}mgr/dashboard/#dashboard-landing-page-performance`,"dashboard-landing-page-capacity":`${n}mgr/dashboard/#dashboard-landing-page-capacity`}[e]}subscribeOnce(e,t,n){return this.releaseData$.pipe(Object(r.a)(e=>!!e),Object(s.a)(t=>this.urlGenerator(e,t)),Object(o.a)()).subscribe(t,n)}}return e.\u0275fac=function(t){return new(t||e)(l.ic(c.a),l.ic(a.a))},e.\u0275prov=l.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},u3GI:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uE2L:function(e,t,n){"use strict";var i=n("AwXo");t.a=function(e,t,n){"__proto__"==t&&i.a?Object(i.a)(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},uEye:function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_m\xe5ndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._m\xe5._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_m\xe5_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I g\xe5r klokka] LT",lastWeek:"[F\xf8reg\xe5ande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein m\xe5nad",MM:"%d m\xe5nader",y:"eit \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uIqm:function(e,t,n){"use strict";n.d(t,"a",function(){return ye});var i=n("8Y7J"),r=n("w9WL"),s=n("LvDl"),o=n.n(s),a=n("PqYM"),c=n("HDdC"),l=n("e2NH"),u=n("x38r"),d=n("oxzT");class h{constructor(e){this.errorConfig={resetData:!0,displayError:!0},this.error=e}}var f=n("vCyI"),p=n("SVse"),m=n("G0yt"),b=n("s7LF"),g=n("dgut"),_=n("iInd"),v=n("4DD9"),y=n("o4+5"),w=n("zWsK"),D=n("yT6U"),S=n("TJUb"),x=n("efK2");const k=["tableCellBoldTpl"],T=["sparklineTpl"],M=["routerLinkTpl"],C=["checkIconTpl"],O=["perSecondTpl"],L=["executingTpl"],E=["classAddingTpl"],A=["badgeTpl"],I=["mapTpl"],R=["truncateTpl"],P=["rowDetailsTpl"];function F(e,t){1&e&&(i.Xb(0,"div",20),i.Xb(1,"div",21),i.sc(2),i.Wb(),i.Wb())}function W(e,t){if(1&e){const e=i.Yb();i.Vb(0),i.Xb(1,"button",36),i.lc("click",function(){i.Ic(e);const n=t.$implicit;return i.nc(3).onSelectFilter(n),!1}),i.Rc(2),i.Wb(),i.Ub()}if(2&e){const e=t.$implicit;i.Db(2),i.Sc(e.column.name)}}const j=function(e){return[e]};function Y(e,t){if(1&e&&i.Sb(0,"i",28),2&e){const e=i.nc(4);i.uc("ngClass",i.zc(1,j,e.icons.check))}}function N(e,t){if(1&e){const e=i.Yb();i.Vb(0),i.Xb(1,"button",36),i.lc("click",function(){i.Ic(e);const n=t.$implicit,r=i.nc(3);return r.onChangeFilter(r.selectedFilter,n),!1}),i.Rc(2),i.Pc(3,Y,1,3,"i",37),i.Wb(),i.Ub()}if(2&e){const e=t.$implicit,n=i.nc(3);i.Db(2),i.Tc(" ",e.formatted," "),i.Db(1),i.uc("ngIf",void 0!==n.selectedFilter.value&&n.selectedFilter.value.raw===e.raw)}}const z=function(e,t){return[e,t]};function $(e,t){if(1&e&&(i.Xb(0,"div",32),i.Xb(1,"div",33),i.Xb(2,"button",34),i.Sb(3,"i",28),i.Rc(4),i.Wb(),i.Xb(5,"div",29),i.Pc(6,W,3,1,"ng-container",30),i.Wb(),i.Wb(),i.Xb(7,"div",35),i.Xb(8,"button",34),i.Rc(9),i.Wb(),i.Xb(10,"div",29),i.Pc(11,N,4,2,"ng-container",30),i.Wb(),i.Wb(),i.Wb()),2&e){const e=i.nc(2);i.Db(3),i.uc("ngClass",i.Ac(7,z,e.icons.large,e.icons.filter)),i.Db(1),i.Tc(" ",e.selectedFilter.column.name," "),i.Db(2),i.uc("ngForOf",e.columnFilters),i.Db(2),i.Jb("disabled",0===e.selectedFilter.options.length),i.Db(1),i.Tc(" ",e.selectedFilter.value?e.selectedFilter.value.formatted:"Any"," "),i.Db(2),i.uc("ngForOf",e.selectedFilter.options)}}function H(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",38),i.Xb(1,"span",39),i.Xb(2,"span",40),i.Sb(3,"i",28),i.Wb(),i.Wb(),i.Xb(4,"input",41),i.lc("ngModelChange",function(t){return i.Ic(e),i.nc(2).search=t})("keyup",function(){return i.Ic(e),i.nc(2).updateFilter()}),i.Wb(),i.Xb(5,"div",42),i.Xb(6,"button",43),i.lc("click",function(){return i.Ic(e),i.nc(2).onClearSearch()}),i.Sb(7,"i"),i.Wb(),i.Wb(),i.Wb()}if(2&e){const e=i.nc(2);i.Db(3),i.uc("ngClass",i.zc(5,j,e.icons.search)),i.Db(1),i.uc("ngModel",e.search),i.Db(3),i.Gb("icon-prepend ",e.icons.destroy,"")}}function X(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",44),i.Xb(1,"input",45),i.lc("click",function(t){return i.Ic(e),i.nc(2).setLimit(t)})("keyup",function(t){return i.Ic(e),i.nc(2).setLimit(t)})("blur",function(t){return i.Ic(e),i.nc(2).setLimit(t)}),i.Wb(),i.Wb()}if(2&e){const e=i.nc(2);i.Db(1),i.uc("value",e.userConfig.limit)}}function V(e,t){if(1&e){const e=i.Yb();i.Xb(0,"button",36),i.lc("click",function(){i.Ic(e);const t=i.nc().$implicit;return i.nc(2).toggleColumn(t),!1}),i.Xb(1,"div",47),i.Sb(2,"input",48),i.Xb(3,"label",49),i.Rc(4),i.Wb(),i.Wb(),i.Wb()}if(2&e){const e=i.nc().$implicit;i.Db(2),i.uc("name",e.prop)("id",e.prop)("checked",!e.isHidden),i.Db(1),i.uc("for",e.prop),i.Db(1),i.Sc(e.name)}}function B(e,t){if(1&e&&(i.Vb(0),i.Pc(1,V,5,5,"button",46),i.Ub()),2&e){const e=t.$implicit;i.Db(1),i.uc("ngIf",""!==e.name)}}function U(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",50),i.Xb(1,"button",51),i.lc("click",function(){return i.Ic(e),i.nc(2).refreshBtn()}),i.Sb(2,"i",28),i.Wb(),i.Wb()}if(2&e){const e=i.nc(2);i.Db(1),i.Fb("btn btn-"+e.status.type),i.uc("ngbTooltip",e.status.msg),i.Db(1),i.Jb("fa-spin",e.updating||e.loadingIndicator),i.uc("ngClass",i.Ac(6,z,e.icons.large,e.icons.refresh))}}function q(e,t){if(1&e&&(i.Xb(0,"div",20),i.Xb(1,"div",21),i.sc(2,1),i.Wb(),i.Pc(3,$,12,10,"div",22),i.Pc(4,H,8,7,"div",23),i.Pc(5,X,2,1,"div",24),i.Xb(6,"div",25),i.Xb(7,"div",26),i.Xb(8,"button",27),i.Sb(9,"i",28),i.Wb(),i.Xb(10,"div",29),i.Pc(11,B,2,1,"ng-container",30),i.Wb(),i.Wb(),i.Wb(),i.Pc(12,U,3,9,"div",31),i.Wb()),2&e){const e=i.nc();i.Db(3),i.uc("ngIf",0!==e.columnFilters.length),i.Db(1),i.uc("ngIf",e.searchField),i.Db(1),i.uc("ngIf",e.limit),i.Db(4),i.uc("ngClass",i.Ac(6,z,e.icons.large,e.icons.table)),i.Db(2),i.uc("ngForOf",e.columns),i.Db(1),i.uc("ngIf",e.fetchData.observers.length>0)}}function G(e,t){if(1&e){const e=i.Yb();i.Xb(0,"span",56),i.Xb(1,"span",57),i.Rc(2),i.Wb(),i.Xb(3,"a",58),i.lc("click",function(){i.Ic(e);const t=i.nc().$implicit;return i.nc(2).onChangeFilter(t),!1}),i.Sb(4,"i",59),i.Wb(),i.Wb()}if(2&e){const e=i.nc().$implicit,t=i.nc(2);i.Db(2),i.Uc("",e.column.name,": ",e.value.formatted,""),i.Db(2),i.uc("ngClass",i.zc(3,j,t.icons.destroy))}}function J(e,t){if(1&e&&(i.Xb(0,"span"),i.Pc(1,G,5,5,"span",55),i.Wb()),2&e){const e=t.$implicit;i.Db(1),i.uc("ngIf",e.value)}}function K(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",20),i.Xb(1,"div",52),i.Pc(2,J,2,1,"span",30),i.Xb(3,"a",53),i.lc("click",function(){return i.Ic(e),i.nc().onClearFilters(),!1}),i.Vb(4),i.bc(5,54),i.Ub(),i.Wb(),i.Wb(),i.Wb()}if(2&e){const e=i.nc();i.Db(2),i.uc("ngForOf",e.columnFilters)}}function Q(e,t){1&e&&i.sc(0,2)}function Z(e,t){if(1&e&&(i.Xb(0,"span"),i.Rc(1),i.Vb(2),i.bc(3,64),i.Ub(),i.Rc(4," / "),i.Wb()),2&e){const e=i.nc().selectedCount;i.Db(1),i.Tc(" ",e," ")}}function ee(e,t){if(1&e&&(i.Xb(0,"span"),i.Rc(1),i.Vb(2),i.bc(3,65),i.Ub(),i.Rc(4," / "),i.Wb()),2&e){const e=i.nc().rowCount;i.Db(1),i.Tc(" ",e," ")}}function te(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",60),i.Pc(1,Z,5,1,"span",61),i.Pc(2,ee,5,1,"span",61),i.Xb(3,"span"),i.Rc(4),i.Vb(5),i.bc(6,62),i.Ub(),i.Wb(),i.Wb(),i.Xb(7,"datatable-pager",63),i.lc("change",function(t){return i.Ic(e),i.nc(),i.Fc(5).onFooterPage(t)}),i.Wb()}if(2&e){const e=t.rowCount,n=t.pageSize,r=t.curPage,s=i.nc();i.Db(1),i.uc("ngIf",s.selectionType),i.Db(1),i.uc("ngIf",e!=(null==s.data?null:s.data.length)),i.Db(2),i.Tc(" ",(null==s.data?null:s.data.length)||0," "),i.Db(3),i.uc("pagerLeftArrowIcon",s.paginationClasses.pagerLeftArrow)("pagerRightArrowIcon",s.paginationClasses.pagerRightArrow)("pagerPreviousIcon",s.paginationClasses.pagerPrevious)("pagerNextIcon",s.paginationClasses.pagerNext)("page",r)("size",n)("count",e)("hidden",!(e/n>1))}}function ne(e,t){if(1&e&&(i.Xb(0,"strong"),i.Rc(1),i.Wb()),2&e){const e=t.value;i.Db(1),i.Sc(e)}}function ie(e,t){if(1&e&&i.Sb(0,"cd-sparkline",66),2&e){const e=t.row;i.uc("data",t.value)("isBinary",e.cdIsBinary)}}function re(e,t){if(1&e&&(i.Xb(0,"a",67),i.Rc(1),i.Wb()),2&e){const e=t.row,n=t.value;i.uc("routerLink",i.zc(3,j,e.cdLink))("queryParams",e.cdParams),i.Db(1),i.Sc(n)}}function se(e,t){if(1&e&&(i.Sb(0,"i",68),i.oc(1,"boolean")),2&e){const e=t.value,n=i.nc();i.uc("ngClass",i.zc(4,j,n.icons.check))("hidden",!i.pc(1,2,e))}}function oe(e,t){1&e&&(i.Rc(0),i.oc(1,"dimless")),2&e&&i.Tc(" ",i.pc(1,1,t.value)," /s\n")}function ae(e,t){if(1&e&&i.Sb(0,"i",28),2&e){const e=i.nc(2);i.uc("ngClass",i.Ac(1,z,e.icons.spinner,e.icons.spin))}}function ce(e,t){if(1&e&&(i.Xb(0,"span",28),i.Rc(1),i.Wb()),2&e){const e=i.nc(),t=e.column,n=e.row;i.uc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.executingClass?t.customTemplateConfig.executingClass:"text-muted italic"),i.Db(1),i.Tc("(",n.cdExecuting,")")}}function le(e,t){if(1&e&&(i.Pc(0,ae,1,4,"i",37),i.Xb(1,"span",28),i.Rc(2),i.Wb(),i.Pc(3,ce,2,2,"span",37)),2&e){const e=t.column,n=t.row,r=t.value;i.uc("ngIf",n.cdExecuting),i.Db(1),i.uc("ngClass",null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.valueClass),i.Db(1),i.Tc(" ",r," "),i.Db(1),i.uc("ngIf",n.cdExecuting)}}function ue(e,t){if(1&e&&(i.Xb(0,"span"),i.oc(1,"pipeFunction"),i.Rc(2),i.Wb()),2&e){const e=t.value,n=i.nc();i.Fb(i.rc(1,4,e,n.useCustomClass,n)),i.Db(2),i.Sc(e)}}function de(e,t){if(1&e&&(i.Xb(0,"span",70),i.Rc(1),i.Wb()),2&e){const e=i.nc().$implicit,t=i.nc().column;i.uc("ngClass",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.map&&null!=t&&null!=t.customTemplateConfig&&null!=t.customTemplateConfig.map[e]&&t.customTemplateConfig.map[e].class?t.customTemplateConfig.map[e].class:null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.class?t.customTemplateConfig.class:"badge-primary"),i.Db(1),i.Tc(" ",null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.map&&null!=t&&null!=t.customTemplateConfig&&null!=t.customTemplateConfig.map[e]&&t.customTemplateConfig.map[e].value?t.customTemplateConfig.map[e].value:null!=t&&null!=t.customTemplateConfig&&t.customTemplateConfig.prefix?t.customTemplateConfig.prefix+e:e," ")}}function he(e,t){1&e&&(i.Xb(0,"span"),i.Rc(1,"\xa0"),i.Wb())}function fe(e,t){if(1&e&&(i.Xb(0,"span"),i.Pc(1,de,2,2,"span",69),i.Pc(2,he,2,0,"span",61),i.Wb()),2&e){const e=t.$implicit,n=t.last,r=i.nc().column;i.Db(1),i.uc("ngIf",null!=r&&null!=r.customTemplateConfig&&r.customTemplateConfig.map&&null!=r&&null!=r.customTemplateConfig&&null!=r.customTemplateConfig.map[e]&&r.customTemplateConfig.map[e].value?r.customTemplateConfig.map[e].value:null!=r&&null!=r.customTemplateConfig&&r.customTemplateConfig.prefix?r.customTemplateConfig.prefix+e:e),i.Db(1),i.uc("ngIf",!n)}}function pe(e,t){1&e&&(i.Pc(0,fe,3,2,"span",30),i.oc(1,"array")),2&e&&i.uc("ngForOf",i.pc(1,1,t.value))}function me(e,t){if(1&e&&(i.Xb(0,"span"),i.Rc(1),i.oc(2,"map"),i.Wb()),2&e){const e=t.column,n=t.value;i.Db(1),i.Sc(i.qc(2,1,n,null==e?null:e.customTemplateConfig))}}function be(e,t){if(1&e&&(i.Xb(0,"span",71),i.Rc(1),i.oc(2,"truncate"),i.Wb()),2&e){const e=t.column,n=t.value;i.uc("title",n),i.Db(1),i.Sc(i.rc(2,2,n,null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.length,null==e||null==e.customTemplateConfig?null:e.customTemplateConfig.omission))}}function ge(e,t){if(1&e){const e=i.Yb();i.Xb(0,"a",72),i.lc("click",function(n){i.Ic(e);const r=t.row,s=t.expanded;return i.nc().toggleExpandRow(r,s,n)}),i.Wb()}if(2&e){const e=t.expanded;i.Jb("expand-collapse-icon-right",!e)("expand-collapse-icon-down",e)}}const _e=[[["",8,"only-table-actions"]],[["",8,"table-actions"]],[["","cdTableDetail",""]]],ve=[".only-table-actions",".table-actions","[cdTableDetail]"];let ye=(()=>{class e{constructor(e,t){this.ngZone=e,this.cdRef=t,this.columnMode="flex",this.onlyActionHeader=!1,this.toolHeader=!0,this.searchField=!0,this.header=!0,this.footer=!0,this.limit=10,this.hasDetails=!1,this.autoReload=5e3,this.identifier="id",this.forceIdentifier=!1,this.selectionType=void 0,this.updateSelectionOnRefresh="onChange",this.updateExpandedOnRefresh="onChange",this.autoSave=!0,this.searchableObjects=!1,this.extraFilterableColumns=[],this.status=new l.a,this.fetchData=new i.p,this.updateSelection=new i.p,this.setExpandedRow=new i.p,this.columnFiltersChanged=new i.p,this.selection=new f.a,this.expanded=void 0,this.icons=d.a,this.cellTemplates={},this.search="",this.rows=[],this.loadingIndicator=!0,this.paginationClasses={pagerLeftArrow:d.a.leftArrowDouble,pagerRightArrow:d.a.rightArrowDouble,pagerPrevious:d.a.leftArrow,pagerNext:d.a.rightArrow},this.userConfig={},this.localStorage=window.localStorage,this.updating=!1,this.columnFilters=[]}get columnFiltered(){return o.a.some(this.columnFilters,e=>void 0!==e.value)}static prepareSearch(e){return(e=e.toLowerCase().replace(/,/g,"")).match(/['"][^'"]+['"]/)&&(e=e.replace(/['"][^'"]+['"]/g,e=>e.replace(/(['"])([^'"]+)(['"])/g,"$2").replace(/ /g,"+"))),e.split(" ").filter(e=>e)}ngOnInit(){if(this.localColumns=o.a.clone(this.columns),this.table.element.addEventListener("mouseenter",e=>e.stopPropagation()),this._addTemplates(),!this.sorts){const e=-1!==o.a.findIndex(this.localColumns,["prop",this.identifier]);this.sorts=this.createSortingDefinition(e?this.identifier:this.localColumns[0].prop+""),e||this.forceIdentifier||(this.identifier=this.localColumns[0].prop+"")}this.initUserConfig(),this.localColumns.forEach(e=>{e.cellTransformation&&(e.cellTemplate=this.cellTemplates[e.cellTransformation]),e.flexGrow||(e.flexGrow=e.prop+""===this.identifier?1:2),e.resizeable||(e.resizeable=!1)}),this.initExpandCollapseColumn(),this.initCheckboxColumn(),this.filterHiddenColumns(),this.initColumnFilters(),this.updateColumnFilterOptions(),this.updateSelection.emit(new f.a),this.fetchData.observers.length>0&&(this.loadingIndicator=!0),o.a.isInteger(this.autoReload)&&this.autoReload>0?this.ngZone.runOutsideAngular(()=>{this.reloadSubscriber=Object(a.a)(0,this.autoReload).subscribe(()=>{this.ngZone.run(()=>this.reloadData())})}):this.autoReload?this.useData():this.reloadData()}initUserConfig(){this.autoSave&&(this.tableName=this._calculateUniqueTableName(this.localColumns),this._loadUserConfig(),this._initUserConfigAutoSave()),this.userConfig.limit||(this.userConfig.limit=this.limit),this.userConfig.sorts||(this.userConfig.sorts=this.sorts),this.userConfig.columns?this.localColumns.forEach((e,t)=>{e.isHidden=this.userConfig.columns[t].isHidden}):this.updateUserColumns()}_calculateUniqueTableName(e){const t=e=>{if(!o.a.isString(e))return 0;let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)*n;return t};return e.reduce((e,n,i)=>(t(n.prop)+t(n.name))*(i+1)+e,0).toString()}_loadUserConfig(){const e=this.localStorage.getItem(this.tableName);e&&(this.userConfig=JSON.parse(e))}_initUserConfigAutoSave(){const e=new c.a(this._initUserConfigProxy.bind(this));this.saveSubscriber=e.subscribe(this._saveUserConfig.bind(this))}_initUserConfigProxy(e){this.userConfig=new Proxy(this.userConfig,{set:(t,n,i)=>(t[n]=i,e.next(t),!0)})}_saveUserConfig(e){this.localStorage.setItem(this.tableName,JSON.stringify(e))}updateUserColumns(){this.userConfig.columns=this.localColumns.map(e=>({prop:e.prop,name:e.name,isHidden:!!e.isHidden}))}initCheckboxColumn(){"multiClick"===this.selectionType&&this.localColumns.unshift({prop:void 0,resizeable:!1,sortable:!1,draggable:!1,checkboxable:!0,canAutoResize:!1,cellClass:"cd-datatable-checkbox",width:30})}initExpandCollapseColumn(){this.hasDetails&&this.localColumns.unshift({prop:void 0,resizeable:!1,sortable:!1,draggable:!1,isHidden:!1,canAutoResize:!1,cellClass:"cd-datatable-expand-collapse",width:40,cellTemplate:this.rowDetailsTpl})}filterHiddenColumns(){this.tableColumns=this.localColumns.filter(e=>!e.isHidden)}initColumnFilters(){let e=o.a.filter(this.localColumns,{filterable:!0});e=[...e,...this.extraFilterableColumns],this.columnFilters=e.map(e=>({column:e,options:[],value:e.filterInitValue?this.createColumnFilterOption(e.filterInitValue,e.pipe):void 0})),this.selectedFilter=o.a.first(this.columnFilters)}createColumnFilterOption(e,t){return{raw:o.a.toString(e),formatted:t?t.transform(e):o.a.toString(e)}}updateColumnFilterOptions(){this.columnFilters.forEach(e=>{let t=[];if(o.a.isUndefined(e.column.filterOptions)){const n=o.a.filter(o.a.map(this.data,e.column.prop),e=>o.a.isString(e)&&""!==e||o.a.isBoolean(e)||o.a.isFinite(e)||o.a.isDate(e));t=o.a.sortedUniq(n.sort())}else t=e.column.filterOptions;const n=t.map(t=>this.createColumnFilterOption(t,e.column.pipe));e.value&&o.a.isUndefined(o.a.find(n,{raw:e.value.raw}))&&(e.value=void 0),e.options=n})}onSelectFilter(e){this.selectedFilter=e}onChangeFilter(e,t){e.value=o.a.isEqual(e.value,t)?void 0:t,this.updateFilter()}doColumnFiltering(){const e=[];let t=[...this.data],n=[];return this.columnFilters.forEach(i=>{if(void 0===i.value)return;e.push({name:i.column.name,prop:i.column.prop,value:i.value});const s=o.a.partition(t,e=>{const t=Object(r.j)(i.column.prop)(e,i.column.prop);return o.a.isUndefined(i.column.filterPredicate)?`${t}`===i.value.raw:i.column.filterPredicate(e,i.value.raw)});t=s[0],n=[...n,...s[1]]}),this.columnFiltersChanged.emit({filters:e,data:t,dataOut:n}),o.a.forEach(this.selection.selected,e=>{void 0===o.a.find(t,{[this.identifier]:e[this.identifier]})&&(this.selection=new f.a,this.onSelect(this.selection))}),t}ngOnDestroy(){this.reloadSubscriber&&this.reloadSubscriber.unsubscribe(),this.saveSubscriber&&this.saveSubscriber.unsubscribe()}ngAfterContentChecked(){this.table&&this.table.element.clientWidth!==this.currentWidth&&(this.currentWidth=this.table.element.clientWidth,this.table.recalculate(),o.a.get(this.table,"cd").markForCheck())}_addTemplates(){this.cellTemplates.bold=this.tableCellBoldTpl,this.cellTemplates.checkIcon=this.checkIconTpl,this.cellTemplates.sparkline=this.sparklineTpl,this.cellTemplates.routerLink=this.routerLinkTpl,this.cellTemplates.perSecond=this.perSecondTpl,this.cellTemplates.executing=this.executingTpl,this.cellTemplates.classAdding=this.classAddingTpl,this.cellTemplates.badge=this.badgeTpl,this.cellTemplates.map=this.mapTpl,this.cellTemplates.truncate=this.truncateTpl}useCustomClass(e){if(!this.customCss)throw new Error("Custom classes are not set!");const t=Object.keys(this.customCss),n=Object.values(this.customCss).map((n,i)=>(o.a.isFunction(n)&&n(e)||n===e)&&t[i]).filter(e=>e).join(" ");return o.a.isEmpty(n)?void 0:n}ngOnChanges(e){e.data&&e.data.currentValue&&this.useData()}setLimit(e){const t=parseInt(e.target.value,10);t>0&&(this.userConfig.limit=t)}reloadData(){if(!this.updating){this.status=new l.a;const e=new h(()=>{e.errorConfig.displayError&&(this.status=new l.a("danger","Failed to load data.")),e.errorConfig.resetData&&(this.data=[]),this.useData()});this.fetchData.emit(e),this.updating=!0}}refreshBtn(){this.loadingIndicator=!0,this.reloadData()}rowIdentity(){return e=>{const t=e[this.identifier];if(o.a.isUndefined(t))throw new Error(`Wrong identifier "${this.identifier}" -> "${t}"`);return t}}useData(){this.data&&(this.updateColumnFilterOptions(),this.updateFilter(),this.reset(),this.updateSelected(),this.updateExpanded())}reset(){this.loadingIndicator=!1,this.updating=!1}updateSelected(){if("never"===this.updateSelectionOnRefresh)return;const e=[];this.selection.selected.forEach(t=>{for(const n of this.data)t[this.identifier]===n[this.identifier]&&e.push(n)}),"onChange"===this.updateSelectionOnRefresh&&o.a.isEqual(this.selection.selected,e)||(this.selection.selected=e,this.onSelect(this.selection))}updateExpanded(){if(o.a.isUndefined(this.expanded)||"never"===this.updateExpandedOnRefresh)return;const e=this.expanded[this.identifier],t=o.a.find(this.data,t=>e===t[this.identifier]);"onChange"===this.updateExpandedOnRefresh&&o.a.isEqual(this.expanded,t)||(this.expanded=t,this.setExpandedRow.emit(t))}onSelect(e){o.a.has(e,"selected")&&(this.selection.selected=e.selected),this.updateSelection.emit(o.a.clone(this.selection))}toggleColumn(e){const t=e.prop,n=!e.isHidden;n&&1===this.tableColumns.length?e.isHidden=!0:(o.a.find(this.localColumns,e=>e.prop===t).isHidden=n,this.updateColumns())}updateColumns(){this.updateUserColumns(),this.filterHiddenColumns();const e=this.userConfig.sorts[0].prop;o.a.find(this.tableColumns,t=>t.prop===e)||(this.userConfig.sorts=this.createSortingDefinition(this.tableColumns[0].prop)),this.table.recalculate(),this.cdRef.detectChanges()}createSortingDefinition(e){return[{prop:e,dir:r.i.asc}]}changeSorting({sorts:e}){this.userConfig.sorts=e}onClearSearch(){this.search="",this.updateFilter()}onClearFilters(){this.columnFilters.forEach(e=>{e.value=void 0}),this.selectedFilter=o.a.first(this.columnFilters),this.updateFilter()}updateFilter(){let t=0!==this.columnFilters.length?this.doColumnFiltering():this.data;if(this.search.length>0&&t){const n=this.localColumns.filter(e=>e.cellTransformation!==u.a.sparkline);t=this.subSearch(t,e.prepareSearch(this.search),n),this.table.offset=0}this.rows=t}subSearch(e,t,n){if(0===t.length||0===e.length)return e;const i=t.pop().replace(/\+/g," ").split(":"),r=[...n];return 2===i.length&&(n=r.filter(e=>-1!==e.name.toLowerCase().indexOf(i[0]))),e=this.basicDataSearch(o.a.last(i),e,n),this.subSearch(e,t,r)}basicDataSearch(e,t,n){return 0===e.length?t:t.filter(t=>n.filter(n=>{let i=o.a.get(t,n.prop);if(o.a.isUndefined(n.pipe)||(i=n.pipe.transform(i)),o.a.isUndefined(i)||o.a.isNull(i))return!1;if(o.a.isArray(i)?i=i.join(" "):(o.a.isNumber(i)||o.a.isBoolean(i))&&(i=i.toString()),o.a.isObjectLike(i)){if(!this.searchableObjects)return!1;i=JSON.stringify(i)}return-1!==i.toLowerCase().indexOf(e)}).length>0)}getRowClass(){return()=>({clickable:!o.a.isUndefined(this.selectionType)})}toggleExpandRow(e,t,n){n.stopPropagation(),t?(this.expanded=void 0,this.setExpandedRow.emit(void 0)):(this.expanded=e,this.table.rowDetail.collapseAllRows(),this.setExpandedRow.emit(e)),this.table.rowDetail.toggleExpandRow(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.D),i.Rb(i.i))},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-table"]],viewQuery:function(e,t){if(1&e&&(i.Wc(r.d,3),i.Wc(k,3),i.Wc(T,3),i.Wc(M,3),i.Wc(C,3),i.Wc(O,3),i.Wc(L,3),i.Wc(E,3),i.Wc(A,3),i.Wc(I,3),i.Wc(R,3),i.Wc(P,3)),2&e){let e;i.Ec(e=i.mc())&&(t.table=e.first),i.Ec(e=i.mc())&&(t.tableCellBoldTpl=e.first),i.Ec(e=i.mc())&&(t.sparklineTpl=e.first),i.Ec(e=i.mc())&&(t.routerLinkTpl=e.first),i.Ec(e=i.mc())&&(t.checkIconTpl=e.first),i.Ec(e=i.mc())&&(t.perSecondTpl=e.first),i.Ec(e=i.mc())&&(t.executingTpl=e.first),i.Ec(e=i.mc())&&(t.classAddingTpl=e.first),i.Ec(e=i.mc())&&(t.badgeTpl=e.first),i.Ec(e=i.mc())&&(t.mapTpl=e.first),i.Ec(e=i.mc())&&(t.truncateTpl=e.first),i.Ec(e=i.mc())&&(t.rowDetailsTpl=e.first)}},inputs:{data:"data",columns:"columns",sorts:"sorts",columnMode:"columnMode",onlyActionHeader:"onlyActionHeader",toolHeader:"toolHeader",searchField:"searchField",header:"header",footer:"footer",limit:"limit",hasDetails:"hasDetails",autoReload:"autoReload",identifier:"identifier",forceIdentifier:"forceIdentifier",selectionType:"selectionType",updateSelectionOnRefresh:"updateSelectionOnRefresh",updateExpandedOnRefresh:"updateExpandedOnRefresh",autoSave:"autoSave",searchableObjects:"searchableObjects",customCss:"customCss",extraFilterableColumns:"extraFilterableColumns",status:"status"},outputs:{fetchData:"fetchData",updateSelection:"updateSelection",setExpandedRow:"setExpandedRow",columnFiltersChanged:"columnFiltersChanged"},features:[i.Bb],ngContentSelectors:ve,decls:33,vars:17,consts:function(){let e,t,n,i,r;return e="Clear filters",t="total",n="selected",i="found",r="Expand/Collapse Row",[[1,"dataTables_wrapper"],["class","dataTables_header clearfix",4,"ngIf"],[1,"bootstrap","cd-datatable",3,"cssClasses","selectionType","selected","sorts","columns","columnMode","rows","rowClass","headerHeight","footerHeight","limit","loadingIndicator","rowIdentity","rowHeight","select","sort"],["table",""],["rowHeight","auto"],["detailRow",""],["ngx-datatable-row-detail-template",""],["ngx-datatable-footer-template",""],["tableCellBoldTpl",""],["sparklineTpl",""],["routerLinkTpl",""],["checkIconTpl",""],["perSecondTpl",""],["executingTpl",""],["classAddingTpl",""],["badgeTpl",""],["mapTpl",""],["truncateTpl",""],["ngx-datatable-cell-template",""],["rowDetailsTpl",""],[1,"dataTables_header","clearfix"],[1,"cd-datatable-actions"],["class","btn-group widget-toolbar",4,"ngIf"],["class","input-group search",4,"ngIf"],["class","input-group dataTables_paginate",4,"ngIf"],[1,"widget-toolbar"],["ngbDropdown","","autoClose","outside",1,"tc_menuitem"],["ngbDropdownToggle","",1,"btn","btn-light","tc_columnBtn"],[3,"ngClass"],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["class","widget-toolbar tc_refreshBtn",4,"ngIf"],[1,"btn-group","widget-toolbar"],["ngbDropdown","","placement","bottom-right",1,"tc_filter_name"],["ngbDropdownToggle","",1,"btn","btn-light"],["ngbDropdown","","placement","bottom-right",1,"tc_filter_option"],["ngbDropdownItem","",3,"click"],[3,"ngClass",4,"ngIf"],[1,"input-group","search"],[1,"input-group-prepend"],[1,"input-group-text"],["type","text",1,"form-control",3,"ngModel","ngModelChange","keyup"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"click"],[1,"input-group","dataTables_paginate"],["type","number","min","1","max","9999",1,"form-control",3,"value","click","keyup","blur"],["ngbDropdownItem","",3,"click",4,"ngIf"],[1,"custom-control","custom-checkbox","py-0"],["type","checkbox",1,"custom-control-input",3,"name","id","checked"],[1,"custom-control-label",3,"for"],[1,"widget-toolbar","tc_refreshBtn"],["type","button",3,"ngbTooltip","click"],[1,"filter-chips"],["href","",1,"tc_clearSelections",3,"click"],e,["class","badge badge-info mr-2",4,"ngIf"],[1,"badge","badge-info","mr-2"],[1,"mr-2"],[1,"badge-remove",3,"click"],["aria-hidden","true",3,"ngClass"],[1,"page-count"],[4,"ngIf"],t,[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change"],n,i,[3,"data","isBinary"],[3,"routerLink","queryParams"],[3,"ngClass","hidden"],["class","badge",3,"ngClass",4,"ngIf"],[1,"badge",3,"ngClass"],["data-toggle","tooltip",3,"title"],["href","javascript:void(0)","title",r,1,"expand-collapse-icon","tc_expand-collapse",3,"click"]]},template:function(e,t){1&e&&(i.tc(_e),i.Xb(0,"div",0),i.Pc(1,F,3,0,"div",1),i.Pc(2,q,13,9,"div",1),i.Pc(3,K,6,1,"div",1),i.Xb(4,"ngx-datatable",2,3),i.lc("select",function(e){return t.onSelect(e)})("sort",function(e){return t.changeSorting(e)}),i.Xb(6,"ngx-datatable-row-detail",4,5),i.Pc(8,Q,1,0,"ng-template",6),i.Wb(),i.Xb(9,"ngx-datatable-footer"),i.Pc(10,te,8,11,"ng-template",7),i.Wb(),i.Wb(),i.Wb(),i.Pc(11,ne,2,1,"ng-template",null,8,i.Qc),i.Pc(13,ie,1,2,"ng-template",null,9,i.Qc),i.Pc(15,re,2,5,"ng-template",null,10,i.Qc),i.Pc(17,se,2,6,"ng-template",null,11,i.Qc),i.Pc(19,oe,2,3,"ng-template",null,12,i.Qc),i.Pc(21,le,4,4,"ng-template",null,13,i.Qc),i.Pc(23,ue,3,8,"ng-template",null,14,i.Qc),i.Pc(25,pe,2,3,"ng-template",null,15,i.Qc),i.Pc(27,me,3,4,"ng-template",null,16,i.Qc),i.Pc(29,be,3,6,"ng-template",null,17,i.Qc),i.Pc(31,ge,1,4,"ng-template",18,19,i.Qc)),2&e&&(i.Db(1),i.uc("ngIf",t.onlyActionHeader),i.Db(1),i.uc("ngIf",t.toolHeader),i.Db(1),i.uc("ngIf",t.toolHeader&&t.columnFiltered),i.Db(1),i.uc("cssClasses",t.paginationClasses)("selectionType",t.selectionType)("selected",t.selection.selected)("sorts",t.userConfig.sorts)("columns",t.tableColumns)("columnMode",t.columnMode)("rows",t.rows)("rowClass",t.getRowClass())("headerHeight",t.header?"auto":0)("footerHeight",t.footer?"auto":0)("limit",t.userConfig.limit>0?t.userConfig.limit:void 0)("loadingIndicator",t.loadingIndicator)("rowIdentity",t.rowIdentity())("rowHeight","auto"))},directives:[p.r,r.d,r.f,r.g,r.e,r.b,r.a,m.i,m.m,p.p,m.k,p.q,m.j,b.d,b.q,b.t,m.D,r.c,g.a,_.h],pipes:[v.a,y.a,w.b,D.a,S.a,x.a],styles:['@charset "UTF-8";.dataTables_wrapper[_ngcontent-%COMP%]{margin-bottom:25px}.dataTables_wrapper[_ngcontent-%COMP%]   .separator[_ngcontent-%COMP%]{border-left:1px solid #00000017;display:inline-block;height:30px;margin-left:5px;padding-left:5px;vertical-align:middle}.dataTables_wrapper[_ngcontent-%COMP%]   .widget-toolbar[_ngcontent-%COMP%]{border-left:1px solid #00000017;float:right;padding:0 8px}.dataTables_wrapper[_ngcontent-%COMP%]   .widget-toolbar[_ngcontent-%COMP%]   .form-check[_ngcontent-%COMP%]{padding-left:0}.dataTables_wrapper[_ngcontent-%COMP%]   .dataTables_length[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{line-height:25px;text-align:right}.dataTables_header[_ngcontent-%COMP%]{background-color:#f8f9fa;border:1px solid #ced4da;border-bottom:0;padding:5px;position:relative}.dataTables_header[_ngcontent-%COMP%]   .cd-datatable-actions[_ngcontent-%COMP%]{float:left}.dataTables_header[_ngcontent-%COMP%]   .form-group[_ngcontent-%COMP%]{padding-left:8px}.dataTables_header[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]{border-left:1px solid #00000017;float:right;max-width:250px;padding-left:8px;padding-right:8px;width:40%}.dataTables_header[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]   .form-control[_ngcontent-%COMP%]{height:30px}.dataTables_header[_ngcontent-%COMP%]   .input-group.dataTables_paginate[_ngcontent-%COMP%]{min-width:85px;padding-right:8px;width:8%}.dataTables_header[_ngcontent-%COMP%]   .filter-chips[_ngcontent-%COMP%]{float:right;padding:0 8px}.dataTables_header[_ngcontent-%COMP%]   .filter-chips[_ngcontent-%COMP%]   .badge-remove[_ngcontent-%COMP%]{color:#fff}  cd-table .cd-datatable{border:1px solid #ced4da;margin-bottom:0;max-width:none!important}  cd-table .cd-datatable .progress-linear{display:block;height:5px;margin:0;padding:0;position:relative;width:100%}  cd-table .cd-datatable .progress-linear .container{background-color:#2b99a8}  cd-table .cd-datatable .progress-linear .container .bar{background-color:#2b99a8;height:100%;left:0;overflow:hidden;position:absolute;width:100%}  cd-table .cd-datatable .progress-linear .container .bar:before{animation:progress-loading 3s linear infinite;background-color:#2b99a8;content:"";display:block;height:100%;left:-200px;position:absolute;width:200px}  cd-table .cd-datatable .datatable-header{background-clip:padding-box;background-color:#f8f9fa;background-image:linear-gradient(180deg,#f8f9fa 0,#e9ecef);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#fffafafa",endColorstr="#ffededed",GradientType=0)}  cd-table .cd-datatable .datatable-header .sort-asc,   cd-table .cd-datatable .datatable-header .sort-desc{color:#2b99a8}  cd-table .cd-datatable .datatable-header .datatable-header-cell{border:0;border-bottom:1px solid #ced4da;border-left:1px solid #ced4da;padding:5px;font-weight:700;text-align:left}  cd-table .cd-datatable .datatable-header .datatable-header-cell .datatable-header-cell-label:after{font-family:ForkAwesome;font-weight:400;height:9px;left:10px;line-height:12px;position:relative;vertical-align:initial;width:12px}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable .datatable-header-cell-label:after{content:" \uf0dc"}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable.sort-active.sort-asc .datatable-header-cell-label:after{content:" \uf160"}  cd-table .cd-datatable .datatable-header .datatable-header-cell.sortable.sort-active.sort-desc .datatable-header-cell-label:after{content:" \uf161"}  cd-table .cd-datatable .datatable-header .datatable-header-cell:first-child{border-left:0}  cd-table .cd-datatable .datatable-body{margin-bottom:-6px}  cd-table .cd-datatable .datatable-body .empty-row{background-color:#c8ecf1;font-style:italic;font-weight:700;padding-bottom:5px;padding-top:5px;text-align:center}  cd-table .cd-datatable .datatable-body .datatable-body-row.clickable:hover .datatable-row-group{background-color:#c8ecf1;transition-duration:.3s;transition-property:background;transition-timing-function:linear}  cd-table .cd-datatable .datatable-body .datatable-body-row.datatable-row-even{background-color:#fff}  cd-table .cd-datatable .datatable-body .datatable-body-row.datatable-row-odd{background-color:#f8f9fa}  cd-table .cd-datatable .datatable-body .datatable-body-row.active,   cd-table .cd-datatable .datatable-body .datatable-body-row.active:hover{background-color:#9fdee6}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell{border:0;border-bottom:1px solid #ced4da;border-left:1px solid #ced4da;padding:5px}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell:first-child{border-left:0}  cd-table .cd-datatable .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{display:block;height:100%}  cd-table .cd-datatable .datatable-body .datatable-row-detail{border-bottom:2px solid #ced4da;overflow-y:visible!important;padding:20px}  cd-table .cd-datatable .datatable-body .expand-collapse-icon{display:block;height:100%;text-align:center}  cd-table .cd-datatable .datatable-body .expand-collapse-icon:hover{text-decoration:none}  cd-table .cd-datatable .datatable-body .expand-collapse-icon-right:before{color:#212529;font-family:ForkAwesome,sans-serif;font-size:1rem;line-height:1;content:"\uf105"}  cd-table .cd-datatable .datatable-body .expand-collapse-icon-down:before{color:#212529;font-family:ForkAwesome,sans-serif;font-size:1rem;line-height:1;content:"\uf107"}  cd-table .cd-datatable .datatable-footer .page-count,   cd-table .cd-datatable .datatable-footer .selected-count{font-style:italic;min-height:2rem;padding-left:.3rem;padding-top:.3rem}  cd-table .cd-datatable .cd-datatable-checkbox{text-align:center}@keyframes progress-loading{0%{left:-200px;width:15%}50%{width:30%}70%{width:70%}80%{left:50%}95%{left:120%}to{left:100%}}'],changeDetection:0}),e})()},uXwI:function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekund\u0113m_sekunde_sekundes".split("_"),m:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),mm:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),h:"stundas_stund\u0101m_stunda_stundas".split("_"),hh:"stundas_stund\u0101m_stunda_stundas".split("_"),d:"dienas_dien\u0101m_diena_dienas".split("_"),dd:"dienas_dien\u0101m_diena_dienas".split("_"),M:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),MM:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function i(e,i,r){return e+" "+n(t[r],e,i)}function r(e,i,r){return n(t[r],e,i)}e.defineLocale("lv",{months:"janv\u0101ris_febru\u0101ris_marts_apr\u012blis_maijs_j\u016bnijs_j\u016blijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_j\u016bn_j\u016bl_aug_sep_okt_nov_dec".split("_"),weekdays:"sv\u0113tdiena_pirmdiena_otrdiena_tre\u0161diena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[\u0160odien pulksten] LT",nextDay:"[R\u012bt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pag\u0101ju\u0161\u0101] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"p\u0113c %s",past:"pirms %s",s:function(e,t){return t?"da\u017eas sekundes":"da\u017e\u0101m sekund\u0113m"},ss:i,m:r,mm:i,h:r,hh:i,d:r,dd:i,M:r,MM:i,y:r,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uYzU:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e){switch(e){case"user:rbd":return"user:rbd (tcmu-runner)";default:return e}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"iscsiBackstore",type:e,pure:!0}),e})()},ufoC:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var i=function(e){return e.auth="Login",e.cephfs="CephFS",e.rbd="RBD",e.pool="Pool",e.osd="OSD",e.role="Role",e.user="User",e}({}),r=n("jVDg"),s=n("8Y7J");class o{constructor(e,t,n){this.running=e,this.failure=t,this.success=n}}class a{constructor(e,t,n){this.operation=e,this.involves=t,this.errors=n||(()=>({}))}failure(e){return "Failed to " + this.operation.failure + " " + this.involves(e) + ""}running(e){return`${this.operation.running} ${this.involves(e)}`}success(e){return`${this.operation.success} ${this.involves(e)}`}}let c=(()=>{class e{constructor(){this.defaultMessage=this.newTaskMessage(new o("Executing","execute","Executed"),e=>e&&(i[e.component]||e.component)||"unknown task",()=>({})),this.commonOperations={create:new o("Creating","create","Created"),update:new o("Updating","update","Updated"),delete:new o("Deleting","delete","Deleted"),add:new o("Adding","add","Added"),remove:new o("Removing","remove","Removed"),import:new o("Importing","import","Imported")},this.rbd={default:e=>"RBD '" + e.image_spec + "'",create:e=>{const t=new r.a(e.pool_name,e.namespace,e.image_name).toString();return "RBD '" + t + "'"},child:e=>{const t=new r.a(e.child_pool_name,e.child_namespace,e.child_image_name).toString();return "RBD '" + t + "'"},destination:e=>{const t=new r.a(e.dest_pool_name,e.dest_namespace,e.dest_image_name).toString();return "RBD '" + t + "'"},snapshot:e=>"RBD snapshot '" + e.image_spec + "@" + e.snapshot_name + "'"},this.rbd_mirroring={site_name:()=>"mirroring site name",bootstrap:()=>"bootstrap token",pool:e=>"mirror mode for pool '" + e.pool_name + "'",pool_peer:e=>"mirror peer for pool '" + e.pool_name + "'"},this.grafana={update_dashboards:()=>"all dashboards"},this.messages={"host/add":this.newTaskMessage(this.commonOperations.add,e=>this.host(e)),"host/remove":this.newTaskMessage(this.commonOperations.remove,e=>this.host(e)),"host/identify_device":this.newTaskMessage(new o("Identifying","identify","Identified"),e=>"device '" + e.device + "' on host '" + e.hostname + "'"),"osd/create":this.newTaskMessage(this.commonOperations.create,e=>"OSDs (DriveGroups: " + e.tracking_id + ")"),"osd/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.osd(e)),"pool/create":this.newTaskMessage(this.commonOperations.create,e=>this.pool(e),e=>({17:"Name is already used by " + this.pool(e) + "."})),"pool/edit":this.newTaskMessage(this.commonOperations.update,e=>this.pool(e),e=>({17:"Name is already used by " + this.pool(e) + "."})),"pool/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.pool(e)),"ecp/create":this.newTaskMessage(this.commonOperations.create,e=>this.ecp(e),e=>({17:"Name is already used by " + this.ecp(e) + "."})),"ecp/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.ecp(e)),"crushRule/create":this.newTaskMessage(this.commonOperations.create,e=>this.crushRule(e),e=>({17:"Name is already used by " + this.crushRule(e) + "."})),"crushRule/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.crushRule(e)),"rbd/create":this.newTaskMessage(this.commonOperations.create,this.rbd.create,e=>({17:"Name is already used by " + this.rbd.create(e) + "."})),"rbd/edit":this.newTaskMessage(this.commonOperations.update,this.rbd.default,e=>({17:"Name is already used by " + this.rbd.default(e) + "."})),"rbd/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd.default,e=>({16:"" + this.rbd.default(e) + " is busy.",39:"" + this.rbd.default(e) + " contains snapshots."})),"rbd/clone":this.newTaskMessage(new o("Cloning","clone","Cloned"),this.rbd.child,e=>({17:"Name is already used by " + this.rbd.child(e) + ".",22:"Snapshot of " + this.rbd.child(e) + " must be protected."})),"rbd/copy":this.newTaskMessage(new o("Copying","copy","Copied"),this.rbd.destination,e=>({17:"Name is already used by " + this.rbd.destination(e) + "."})),"rbd/flatten":this.newTaskMessage(new o("Flattening","flatten","Flattened"),this.rbd.default),"rbd/snap/create":this.newTaskMessage(this.commonOperations.create,this.rbd.snapshot,e=>({17:"Name is already used by " + this.rbd.snapshot(e) + "."})),"rbd/snap/edit":this.newTaskMessage(this.commonOperations.update,this.rbd.snapshot,e=>({16:"Cannot unprotect " + this.rbd.snapshot(e) + " because it contains child images."})),"rbd/snap/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd.snapshot,e=>({16:"Cannot delete " + this.rbd.snapshot(e) + " because it's protected."})),"rbd/snap/rollback":this.newTaskMessage(new o("Rolling back","rollback","Rolled back"),this.rbd.snapshot),"rbd/trash/move":this.newTaskMessage(new o("Moving","move","Moved"),e=>"image '" + e.image_spec + "' to trash",()=>({2:"Could not find image."})),"rbd/trash/restore":this.newTaskMessage(new o("Restoring","restore","Restored"),e=>"image '" + e.image_id_spec + "' into '" + e.new_image_name + "'",e=>({17:"Image name '" + e.new_image_name + "' is already in use."})),"rbd/trash/remove":this.newTaskMessage(new o("Deleting","delete","Deleted"),e=>"image '" + e.image_id_spec + "'"),"rbd/trash/purge":this.newTaskMessage(new o("Purging","purge","Purged"),e=>{let t="all pools";return e.pool_name&&(t=`'${e.pool_name}'`),"images from " + t + ""}),"rbd/mirroring/site_name/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.site_name,()=>({})),"rbd/mirroring/bootstrap/create":this.newTaskMessage(this.commonOperations.create,this.rbd_mirroring.bootstrap,()=>({})),"rbd/mirroring/bootstrap/import":this.newTaskMessage(this.commonOperations.import,this.rbd_mirroring.bootstrap,()=>({})),"rbd/mirroring/pool/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.pool,()=>({16:"Cannot disable mirroring because it contains a peer."})),"rbd/mirroring/peer/add":this.newTaskMessage(this.commonOperations.create,this.rbd_mirroring.pool_peer,()=>({})),"rbd/mirroring/peer/edit":this.newTaskMessage(this.commonOperations.update,this.rbd_mirroring.pool_peer,()=>({})),"rbd/mirroring/peer/delete":this.newTaskMessage(this.commonOperations.delete,this.rbd_mirroring.pool_peer,()=>({})),"iscsi/target/create":this.newTaskMessage(this.commonOperations.create,e=>this.iscsiTarget(e)),"iscsi/target/edit":this.newTaskMessage(this.commonOperations.update,e=>this.iscsiTarget(e)),"iscsi/target/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.iscsiTarget(e)),"nfs/create":this.newTaskMessage(this.commonOperations.create,e=>this.nfs(e)),"nfs/edit":this.newTaskMessage(this.commonOperations.update,e=>this.nfs(e)),"nfs/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.nfs(e)),"grafana/dashboards/update":this.newTaskMessage(this.commonOperations.update,this.grafana.update_dashboards,()=>({})),"service/create":this.newTaskMessage(this.commonOperations.create,e=>this.service(e)),"service/edit":this.newTaskMessage(this.commonOperations.update,e=>this.service(e)),"service/delete":this.newTaskMessage(this.commonOperations.delete,e=>this.service(e))}}newTaskMessage(e,t,n){return new a(e,t,n)}host(e){return "host '" + e.hostname + "'"}osd(e){return "OSD '" + e.svc_id + "'"}pool(e){return "pool '" + e.pool_name + "'"}ecp(e){return "erasure code profile '" + e.name + "'"}crushRule(e){return "crush rule '" + e.name + "'"}iscsiTarget(e){return "target '" + e.target_iqn + "'"}nfs(e){return "NFS '" + e.cluster_id + ":" + (e.export_id ? e.export_id : e.path) + "'"}service(e){return "Service '" + e.service_name + "'"}_getTaskTitle(e){return e.name&&e.name.startsWith("progress/")?this.newTaskMessage(new o(e.name.replace("progress/",""),"",e.name.replace("progress/","")),e=>""):this.messages[e.name]||this.defaultMessage}getSuccessTitle(e){return this._getTaskTitle(e).success(e.metadata)}getErrorMessage(e){return this._getTaskTitle(e).errors(e.metadata)[e.exception.code]||e.exception.detail}getErrorTitle(e){return this._getTaskTitle(e).failure(e.metadata)}getRunningTitle(e){return this._getTaskTitle(e).running(e.metadata)}getRunningText(e){return this._getTaskTitle(e).operation.running}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=s.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},uy83:function(e,t,n){var i=n("0Dky");e.exports=!i(function(){return Object.isExtensible(Object.preventExtensions({}))})},uyHG:function(e,t){var n,i="__lodash_hash_undefined__",r=/^\[object .+?Constructor\]$/,s="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,a=s||o||Function("return this")(),c=Array.prototype,l=Function.prototype,u=Object.prototype,d=a["__core-js_shared__"],h=(n=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",f=l.toString,p=u.hasOwnProperty,m=u.toString,b=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=c.splice,_=k(a,"Map"),v=k(Object,"create");function y(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function S(e,t){for(var n,i,r=e.length;r--;)if((n=e[r][0])===(i=t)||n!=n&&i!=i)return r;return-1}function x(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function k(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!M(e)||(t=e,h&&h in t))&&(function(e){var t=M(e)?m.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}(e)?b:r).test(function(e){if(null!=e){try{return f.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e));var t}(n)?n:void 0}function T(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o),o};return n.cache=new(T.Cache||D),n}function M(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}y.prototype.clear=function(){this.__data__=v?v(null):{}},y.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},y.prototype.get=function(e){var t=this.__data__;if(v){var n=t[e];return n===i?void 0:n}return p.call(t,e)?t[e]:void 0},y.prototype.has=function(e){var t=this.__data__;return v?void 0!==t[e]:p.call(t,e)},y.prototype.set=function(e,t){return this.__data__[e]=v&&void 0===t?i:t,this},w.prototype.clear=function(){this.__data__=[]},w.prototype.delete=function(e){var t=this.__data__,n=S(t,e);return!(n<0||(n==t.length-1?t.pop():g.call(t,n,1),0))},w.prototype.get=function(e){var t=this.__data__,n=S(t,e);return n<0?void 0:t[n][1]},w.prototype.has=function(e){return S(this.__data__,e)>-1},w.prototype.set=function(e,t){var n=this.__data__,i=S(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new y,map:new(_||w),string:new y}},D.prototype.delete=function(e){return x(this,e).delete(e)},D.prototype.get=function(e){return x(this,e).get(e)},D.prototype.has=function(e){return x(this,e).has(e)},D.prototype.set=function(e,t){return x(this,e).set(e,t),this},T.Cache=D,e.exports=T},vCyI:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{constructor(e){this._selected=[],e&&(this._selected=e),this.update()}update(){this.hasSelection=this._selected.length>0,this.hasSingleSelection=1===this._selected.length,this.hasMultiSelection=this._selected.length>1}set selected(e){this._selected=e,this.update()}get selected(){return this._selected}add(e){this._selected.push(e),this.update()}first(){return this.hasSelection?this._selected[0]:null}}},vJtL:function(e,t,n){"use strict";var i=n("8M4i"),r=n("IzLi");t.a=function(e){if(!Object(r.a)(e))return!1;var t=Object(i.a)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},vkgz:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("7o/Q"),r=n("KqfI"),s=n("n6bG");function o(e,t,n){return function(i){return i.lift(new a(e,t,n))}}class a{constructor(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}call(e,t){return t.subscribe(new c(e,this.nextOrObserver,this.error,this.complete))}}class c extends i.a{constructor(e,t,n,i){super(e),this._tapNext=r.a,this._tapError=r.a,this._tapComplete=r.a,this._tapError=n||r.a,this._tapComplete=i||r.a,Object(s.a)(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||r.a,this._tapError=t.error||r.a,this._tapComplete=t.complete||r.a)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}},w1tV:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("EQ5u"),r=n("x+ZX"),s=n("XNiG");function o(){return new s.a}function a(){return e=>{return Object(r.a)()((t=o,function(e){let n;n="function"==typeof t?t:function(){return t};const r=Object.create(e,i.b);return r.source=e,r.subjectFactory=n,r})(e));var t}}},w9WL:function(e,t,n){"use strict";n.d(t,"a",function(){return Pe}),n.d(t,"b",function(){return ue}),n.d(t,"c",function(){return ft}),n.d(t,"d",function(){return ut}),n.d(t,"e",function(){return Ne}),n.d(t,"f",function(){return Ye}),n.d(t,"g",function(){return je}),n.d(t,"h",function(){return xt}),n.d(t,"i",function(){return ct}),n.d(t,"j",function(){return ye});var i=n("8Y7J"),r=n("SVse"),s=n("XNiG"),o=n("xgIS"),a=n("2Vo4"),c=n("1G5W"),l=n("mrSG");const u=["*"];function d(e,t){1&e&&i.Sb(0,"datatable-progress")}function h(e,t){if(1&e&&i.Sb(0,"datatable-summary-row",9),2&e){const e=i.nc(2);i.uc("rowHeight",e.summaryHeight)("offsetX",e.offsetX)("innerWidth",e.innerWidth)("rows",e.rows)("columns",e.columns)}}function f(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-body-row",13),i.lc("treeAction",function(){i.Ic(e);const t=i.nc().$implicit;return i.nc(2).onTreeAction(t)})("activate",function(t){i.Ic(e);const n=i.nc().index,r=i.nc(2);return i.Fc(2).onActivate(t,r.indexes.first+n)}),i.Wb()}if(2&e){const e=i.nc().$implicit,t=i.nc(2),n=i.Fc(2);i.uc("isSelected",n.getRowSelected(e))("innerWidth",t.innerWidth)("offsetX",t.offsetX)("columns",t.columns)("rowHeight",t.getRowHeight(e))("row",e)("rowIndex",t.getRowIndex(e))("expanded",t.getRowExpanded(e))("rowClass",t.rowClass)("displayCheck",t.displayCheck)("treeStatus",e&&e.treeStatus)}}function p(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-body-row",15),i.lc("activate",function(n){i.Ic(e);const r=t.index;return i.nc(4),i.Fc(2).onActivate(n,r)}),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc(2).$implicit,r=i.nc(2),s=i.Fc(2);i.uc("isSelected",s.getRowSelected(e))("innerWidth",r.innerWidth)("offsetX",r.offsetX)("columns",r.columns)("rowHeight",r.getRowHeight(e))("row",e)("group",n.value)("rowIndex",r.getRowIndex(e))("expanded",r.getRowExpanded(e))("rowClass",r.rowClass)}}function m(e,t){if(1&e&&i.Pc(0,p,1,10,"datatable-body-row",14),2&e){const e=i.nc().$implicit,t=i.nc(2);i.uc("ngForOf",e.value)("ngForTrackBy",t.rowTrackingFn)}}function b(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-row-wrapper",10),i.lc("rowContextmenu",function(t){return i.Ic(e),i.nc(2).rowContextmenu.emit(t)}),i.Pc(1,f,1,11,"datatable-body-row",11),i.Pc(2,m,1,2,"ng-template",null,12,i.Qc),i.Wb()}if(2&e){const e=t.$implicit,n=t.index,r=i.Fc(3),s=i.nc(2);i.uc("groupedRows",s.groupedRows)("innerWidth",s.innerWidth)("ngStyle",s.getRowsStyles(e))("rowDetail",s.rowDetail)("groupHeader",s.groupHeader)("offsetX",s.offsetX)("detailRowHeight",s.getDetailRowHeight(e&&e[n],n))("row",e)("expanded",s.getRowExpanded(e))("rowIndex",s.getRowIndex(e&&e[n])),i.Db(1),i.uc("ngIf",!s.groupedRows)("ngIfElse",r)}}function g(e,t){if(1&e&&i.Sb(0,"datatable-summary-row",16),2&e){const e=i.nc(2);i.uc("ngStyle",e.getBottomSummaryRowStyles())("rowHeight",e.summaryHeight)("offsetX",e.offsetX)("innerWidth",e.innerWidth)("rows",e.rows)("columns",e.columns)}}function _(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-scroller",5),i.lc("scroll",function(t){return i.Ic(e),i.nc().onBodyScroll(t)}),i.Pc(1,h,1,5,"datatable-summary-row",6),i.Pc(2,b,4,12,"datatable-row-wrapper",7),i.Pc(3,g,1,6,"datatable-summary-row",8),i.Wb()}if(2&e){const e=i.nc();i.uc("scrollbarV",e.scrollbarV)("scrollbarH",e.scrollbarH)("scrollHeight",e.scrollHeight)("scrollWidth",null==e.columnGroupWidths?null:e.columnGroupWidths.total),i.Db(1),i.uc("ngIf",e.summaryRow&&"top"===e.summaryPosition),i.Db(1),i.uc("ngForOf",e.temp)("ngForTrackBy",e.rowTrackingFn),i.Db(1),i.uc("ngIf",e.summaryRow&&"bottom"===e.summaryPosition)}}function v(e,t){if(1&e&&i.Sb(0,"div",17),2&e){const e=i.nc();i.uc("innerHTML",e.emptyMessage,i.Jc)}}function y(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-header-cell",4),i.lc("resize",function(n){i.Ic(e);const r=t.$implicit;return i.nc(2).onColumnResized(n,r)})("longPressStart",function(t){return i.Ic(e),i.nc(2).onLongPressStart(t)})("longPressEnd",function(t){return i.Ic(e),i.nc(2).onLongPressEnd(t)})("sort",function(t){return i.Ic(e),i.nc(2).onSort(t)})("select",function(t){return i.Ic(e),i.nc(2).select.emit(t)})("columnContextmenu",function(t){return i.Ic(e),i.nc(2).columnContextmenu.emit(t)}),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc(2);i.uc("resizeEnabled",e.resizeable)("pressModel",e)("pressEnabled",n.reorderable&&e.draggable)("dragX",n.reorderable&&e.draggable&&e.dragging)("dragY",!1)("dragModel",e)("dragEventTarget",n.dragEventTarget)("headerHeight",n.headerHeight)("isTarget",e.isTarget)("targetMarkerTemplate",n.targetMarkerTemplate)("targetMarkerContext",e.targetMarkerContext)("column",e)("sortType",n.sortType)("sorts",n.sorts)("selectionType",n.selectionType)("sortAscendingIcon",n.sortAscendingIcon)("sortDescendingIcon",n.sortDescendingIcon)("sortUnsetIcon",n.sortUnsetIcon)("allRowsSelected",n.allRowsSelected)}}function w(e,t){if(1&e&&(i.Xb(0,"div",2),i.Pc(1,y,1,19,"datatable-header-cell",3),i.Wb()),2&e){const e=t.$implicit,n=i.nc();i.Fb("datatable-row-"+e.type),i.uc("ngStyle",n._styleByGroup[e.type]),i.Db(1),i.uc("ngForOf",e.columns)("ngForTrackBy",n.columnTrackingFn)}}function D(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-header",4),i.lc("sort",function(t){return i.Ic(e),i.nc().onColumnSort(t)})("resize",function(t){return i.Ic(e),i.nc().onColumnResize(t)})("reorder",function(t){return i.Ic(e),i.nc().onColumnReorder(t)})("select",function(t){return i.Ic(e),i.nc().onHeaderSelect(t)})("columnContextmenu",function(t){return i.Ic(e),i.nc().onColumnContextmenu(t)}),i.oc(1,"async"),i.Wb()}if(2&e){const e=i.nc();i.uc("sorts",e.sorts)("sortType",e.sortType)("scrollbarH",e.scrollbarH)("innerWidth",e._innerWidth)("offsetX",i.pc(1,15,e._offsetX))("dealsWithGroup",void 0!==e.groupedRows)("columns",e._internalColumns)("headerHeight",e.headerHeight)("reorderable",e.reorderable)("targetMarkerTemplate",e.targetMarkerTemplate)("sortAscendingIcon",e.cssClasses.sortAscending)("sortDescendingIcon",e.cssClasses.sortDescending)("sortUnsetIcon",e.cssClasses.sortUnset)("allRowsSelected",e.allRowsSelected)("selectionType",e.selectionType)}}function S(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-footer",5),i.lc("page",function(t){return i.Ic(e),i.nc().onFooterPage(t)}),i.Wb()}if(2&e){const e=i.nc();i.uc("rowCount",e.rowCount)("pageSize",e.pageSize)("offset",e.offset)("footerHeight",e.footerHeight)("footerTemplate",e.footer)("totalMessage",e.messages.totalMessage)("pagerLeftArrowIcon",e.cssClasses.pagerLeftArrow)("pagerRightArrowIcon",e.cssClasses.pagerRightArrow)("pagerPreviousIcon",e.cssClasses.pagerPrevious)("selectedCount",e.selected.length)("selectedMessage",!!e.selectionType&&e.messages.selectedMessage)("pagerNextIcon",e.cssClasses.pagerNext)}}function x(e,t){}function k(e,t){if(1&e&&i.Pc(0,x,0,0,"ng-template",5),2&e){const e=i.nc();i.uc("ngTemplateOutlet",e.targetMarkerTemplate)("ngTemplateOutletContext",e.targetMarkerContext)}}function T(e,t){if(1&e){const e=i.Yb();i.Xb(0,"label",6),i.Xb(1,"input",7),i.lc("change",function(){i.Ic(e);const t=i.nc();return t.select.emit(!t.allRowsSelected)}),i.Wb(),i.Wb()}if(2&e){const e=i.nc();i.Db(1),i.uc("checked",e.allRowsSelected)}}function M(e,t){if(1&e){const e=i.Yb();i.Xb(0,"span",8),i.Xb(1,"span",9),i.lc("click",function(){return i.Ic(e),i.nc().onSort()}),i.Wb(),i.Wb()}if(2&e){const e=i.nc();i.Db(1),i.uc("innerHTML",e.name,i.Jc)}}function C(e,t){}function O(e,t){if(1&e&&i.Pc(0,C,0,0,"ng-template",5),2&e){const e=i.nc();i.uc("ngTemplateOutlet",e.column.headerTemplate)("ngTemplateOutletContext",e.cellContext)}}function L(e,t){}const E=function(e,t,n,i,r){return{rowCount:e,pageSize:t,selectedCount:n,curPage:i,offset:r}};function A(e,t){if(1&e&&i.Pc(0,L,0,0,"ng-template",4),2&e){const e=i.nc();i.uc("ngTemplateOutlet",e.footerTemplate.template)("ngTemplateOutletContext",i.Dc(2,E,e.rowCount,e.pageSize,e.selectedCount,e.curPage,e.offset))}}function I(e,t){if(1&e&&(i.Xb(0,"span"),i.Rc(1),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.Uc(" ",null==e.selectedCount?null:e.selectedCount.toLocaleString()," ",e.selectedMessage," / ")}}function R(e,t){if(1&e&&(i.Xb(0,"div",5),i.Pc(1,I,2,2,"span",1),i.Rc(2),i.Wb()),2&e){const e=i.nc();i.Db(1),i.uc("ngIf",e.selectedMessage),i.Db(1),i.Uc(" ",null==e.rowCount?null:e.rowCount.toLocaleString()," ",e.totalMessage," ")}}function P(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-pager",6),i.lc("change",function(t){return i.Ic(e),i.nc().page.emit(t)}),i.Wb()}if(2&e){const e=i.nc();i.uc("pagerLeftArrowIcon",e.pagerLeftArrowIcon)("pagerRightArrowIcon",e.pagerRightArrowIcon)("pagerPreviousIcon",e.pagerPreviousIcon)("pagerNextIcon",e.pagerNextIcon)("page",e.curPage)("size",e.pageSize)("count",e.rowCount)("hidden",!e.isVisible)}}const F=function(e){return{"selected-count":e}};function W(e,t){if(1&e){const e=i.Yb();i.Xb(0,"li",6),i.Xb(1,"a",7),i.lc("click",function(){i.Ic(e);const n=t.$implicit;return i.nc().selectPage(n.number)}),i.Rc(2),i.Wb(),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc();i.Jb("active",e.number===n.page),i.Eb("aria-label","page "+e.number),i.Db(2),i.Tc(" ",e.text," ")}}function j(e,t){if(1&e){const e=i.Yb();i.Xb(0,"datatable-body-cell",3),i.lc("activate",function(n){i.Ic(e);const r=t.index;return i.nc(2).onActivate(n,r)})("treeAction",function(){return i.Ic(e),i.nc(2).onTreeAction()}),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc(2);i.uc("row",n.row)("group",n.group)("expanded",n.expanded)("isSelected",n.isSelected)("rowIndex",n.rowIndex)("column",e)("rowHeight",n.rowHeight)("displayCheck",n.displayCheck)("treeStatus",n.treeStatus)}}function Y(e,t){if(1&e&&(i.Xb(0,"div",1),i.Pc(1,j,1,9,"datatable-body-cell",2),i.Wb()),2&e){const e=t.$implicit,n=i.nc();i.Gb("datatable-row-",e.type," datatable-row-group"),i.uc("ngStyle",n._groupStyles[e.type]),i.Db(1),i.uc("ngForOf",e.columns)("ngForTrackBy",n.columnTrackingFn)}}function N(e,t){}function z(e,t){if(1&e&&i.Pc(0,N,0,0,"ng-template",4),2&e){const e=i.nc(2);i.uc("ngTemplateOutlet",e.groupHeader.template)("ngTemplateOutletContext",e.groupContext)}}function $(e,t){if(1&e&&(i.Xb(0,"div",3),i.Pc(1,z,1,2,void 0,1),i.Wb()),2&e){const e=i.nc();i.uc("ngStyle",e.getGroupHeaderStyle()),i.Db(1),i.uc("ngIf",e.groupHeader&&e.groupHeader.template)}}function H(e,t){1&e&&i.sc(0,0,["*ngIf","(groupHeader && groupHeader.template && expanded) || !groupHeader || !groupHeader.template"])}function X(e,t){}function V(e,t){if(1&e&&i.Pc(0,X,0,0,"ng-template",4),2&e){const e=i.nc(2);i.uc("ngTemplateOutlet",e.rowDetail.template)("ngTemplateOutletContext",e.rowContext)}}function B(e,t){if(1&e&&(i.Xb(0,"div",5),i.Pc(1,V,1,2,void 0,1),i.Wb()),2&e){const e=i.nc();i.Nc("height",e.detailRowHeight,"px"),i.Db(1),i.uc("ngIf",e.rowDetail&&e.rowDetail.template)}}const U=["cellTemplate"];function q(e,t){if(1&e){const e=i.Yb();i.Xb(0,"label",4),i.Xb(1,"input",5),i.lc("click",function(t){return i.Ic(e),i.nc().onCheckboxChange(t)}),i.Wb(),i.Wb()}if(2&e){const e=i.nc();i.Db(1),i.uc("checked",e.isSelected)}}function G(e,t){1&e&&i.Sb(0,"i",11)}function J(e,t){1&e&&i.Sb(0,"i",12)}function K(e,t){1&e&&i.Sb(0,"i",13)}function Q(e,t){if(1&e){const e=i.Yb();i.Xb(0,"button",7),i.lc("click",function(){return i.Ic(e),i.nc(2).onTreeAction()}),i.Xb(1,"span"),i.Pc(2,G,1,0,"i",8),i.Pc(3,J,1,0,"i",9),i.Pc(4,K,1,0,"i",10),i.Wb(),i.Wb()}if(2&e){const e=i.nc(2);i.uc("disabled","disabled"===e.treeStatus),i.Db(2),i.uc("ngIf","loading"===e.treeStatus),i.Db(1),i.uc("ngIf","collapsed"===e.treeStatus),i.Db(1),i.uc("ngIf","expanded"===e.treeStatus||"disabled"===e.treeStatus)}}function Z(e,t){}const ee=function(e){return{cellContext:e}};function te(e,t){if(1&e&&i.Pc(0,Z,0,0,"ng-template",14),2&e){const e=i.nc(2);i.uc("ngTemplateOutlet",e.column.treeToggleTemplate)("ngTemplateOutletContext",i.zc(2,ee,e.cellContext))}}function ne(e,t){if(1&e&&(i.Vb(0),i.Pc(1,Q,5,4,"button",6),i.Pc(2,te,1,4,void 0,2),i.Ub()),2&e){const e=i.nc();i.Db(1),i.uc("ngIf",!e.column.treeToggleTemplate),i.Db(1),i.uc("ngIf",e.column.treeToggleTemplate)}}function ie(e,t){if(1&e&&i.Sb(0,"span",15),2&e){const e=i.nc();i.uc("title",e.sanitizedValue)("innerHTML",e.value,i.Jc)}}function re(e,t){}function se(e,t){if(1&e&&i.Pc(0,re,0,0,"ng-template",14,16,i.Qc),2&e){const e=i.nc();i.uc("ngTemplateOutlet",e.column.cellTemplate)("ngTemplateOutletContext",e.cellContext)}}function oe(e,t){if(1&e&&i.Sb(0,"datatable-body-row",1),2&e){const e=i.nc();i.uc("innerWidth",e.innerWidth)("offsetX",e.offsetX)("columns",e._internalColumns)("rowHeight",e.rowHeight)("row",e.summaryRow)("rowIndex",-1)}}let ae=(()=>{class e{constructor(e){this.document=e,this.width=this.getWidth()}getWidth(){const e=this.document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",this.document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const n=this.document.createElement("div");n.style.width="100%",e.appendChild(n);const i=n.offsetWidth;return e.parentNode.removeChild(e),t-i}}return e.\u0275fac=function(t){return new(t||e)(i.ic(r.d))},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),ce=(()=>{class e{getDimensions(e){return e.getBoundingClientRect()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),le=(()=>{class e{constructor(){this.columnInputChanges=new s.a}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=i.Nb({token:e,factory:e.\u0275fac}),e})(),ue=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-footer-template",""]]}),e})(),de=(()=>{class e{constructor(e,t){this.element=e,this.zone=t,this.isVisible=!1,this.visible=new i.p}ngOnInit(){this.runCheck()}ngOnDestroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){const e=()=>{const{offsetHeight:t,offsetWidth:n}=this.element.nativeElement;t&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e(),50)}))};this.timeout=setTimeout(()=>e())}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.D))},e.\u0275dir=i.Mb({type:e,selectors:[["","visibilityObserver",""]],hostVars:2,hostBindings:function(e,t){2&e&&i.Jb("visible",t.isVisible)},outputs:{visible:"visible"}}),e})(),he=(()=>{class e{constructor(e){this.dragX=!0,this.dragY=!0,this.dragStart=new i.p,this.dragging=new i.p,this.dragEnd=new i.p,this.isDragging=!1,this.element=e.nativeElement}ngOnChanges(e){e.dragEventTarget&&e.dragEventTarget.currentValue&&this.dragModel.dragging&&this.onMousedown(e.dragEventTarget.currentValue)}ngOnDestroy(){this._destroySubscription()}onMouseup(e){this.isDragging&&(this.isDragging=!1,this.element.classList.remove("dragging"),this.subscription&&(this._destroySubscription(),this.dragEnd.emit({event:e,element:this.element,model:this.dragModel})))}onMousedown(e){if(e.target.classList.contains("draggable")&&(this.dragX||this.dragY)){e.preventDefault(),this.isDragging=!0;const t={x:e.clientX,y:e.clientY},n=Object(o.a)(document,"mouseup");this.subscription=n.subscribe(e=>this.onMouseup(e));const i=Object(o.a)(document,"mousemove").pipe(Object(c.a)(n)).subscribe(e=>this.move(e,t));this.subscription.add(i),this.dragStart.emit({event:e,element:this.element,model:this.dragModel})}}move(e,t){if(!this.isDragging)return;const n=e.clientY-t.y;this.dragX&&(this.element.style.left=e.clientX-t.x+"px"),this.dragY&&(this.element.style.top=`${n}px`),this.element.classList.add("dragging"),this.dragging.emit({event:e,element:this.element,model:this.dragModel})}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n))},e.\u0275dir=i.Mb({type:e,selectors:[["","draggable",""]],inputs:{dragX:"dragX",dragY:"dragY",dragEventTarget:"dragEventTarget",dragModel:"dragModel"},outputs:{dragStart:"dragStart",dragging:"dragging",dragEnd:"dragEnd"},features:[i.Bb]}),e})(),fe=(()=>{class e{constructor(e,t){this.renderer=t,this.resizeEnabled=!0,this.resize=new i.p,this.resizing=!1,this.element=e.nativeElement}ngAfterViewInit(){const e=this.renderer;this.resizeHandle=e.createElement("span"),e.addClass(this.resizeHandle,this.resizeEnabled?"resize-handle":"resize-handle--not-resizable"),e.appendChild(this.element,this.resizeHandle)}ngOnDestroy(){this._destroySubscription(),this.renderer.destroyNode?this.renderer.destroyNode(this.resizeHandle):this.resizeHandle&&this.renderer.removeChild(this.renderer.parentNode(this.resizeHandle),this.resizeHandle)}onMouseup(){this.resizing=!1,this.subscription&&!this.subscription.closed&&(this._destroySubscription(),this.resize.emit(this.element.clientWidth))}onMousedown(e){const t=e.target.classList.contains("resize-handle"),n=this.element.clientWidth,i=e.screenX;if(t){e.stopPropagation(),this.resizing=!0;const t=Object(o.a)(document,"mouseup");this.subscription=t.subscribe(e=>this.onMouseup());const r=Object(o.a)(document,"mousemove").pipe(Object(c.a)(t)).subscribe(e=>this.move(e,n,i));this.subscription.add(r)}}move(e,t,n){const i=t+(e.screenX-n);(!this.minWidth||i>=this.minWidth)&&(!this.maxWidth||i<=this.maxWidth)&&(this.element.style.width=`${i}px`)}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.H))},e.\u0275dir=i.Mb({type:e,selectors:[["","resizeable",""]],hostVars:2,hostBindings:function(e,t){1&e&&i.lc("mousedown",function(e){return t.onMousedown(e)}),2&e&&i.Jb("resizeable",t.resizeEnabled)},inputs:{resizeEnabled:"resizeEnabled",minWidth:"minWidth",maxWidth:"maxWidth"},outputs:{resize:"resize"}}),e})(),pe=(()=>{class e{constructor(e,t){this.document=t,this.reorder=new i.p,this.targetChanged=new i.p,this.differ=e.find({}).create()}ngAfterContentInit(){this.updateSubscriptions(),this.draggables.changes.subscribe(this.updateSubscriptions.bind(this))}ngOnDestroy(){this.draggables.forEach(e=>{e.dragStart.unsubscribe(),e.dragging.unsubscribe(),e.dragEnd.unsubscribe()})}updateSubscriptions(){const e=this.differ.diff(this.createMapDiffs());if(e){const t=({currentValue:e,previousValue:t})=>{n({previousValue:t}),e&&(e.dragStart.subscribe(this.onDragStart.bind(this)),e.dragging.subscribe(this.onDragging.bind(this)),e.dragEnd.subscribe(this.onDragEnd.bind(this)))},n=({previousValue:e})=>{e&&(e.dragStart.unsubscribe(),e.dragging.unsubscribe(),e.dragEnd.unsubscribe())};e.forEachAddedItem(t),e.forEachRemovedItem(n)}}onDragStart(){this.positions={};let e=0;for(const t of this.draggables.toArray()){const n=t.element,i=parseInt(n.offsetLeft.toString(),0);this.positions[t.dragModel.prop]={left:i,right:i+parseInt(n.offsetWidth.toString(),0),index:e++,element:n}}}onDragging({model:e,event:t}){const n=this.positions[e.prop],i=this.isTarget(e,t);i?this.lastDraggingIndex!==i.i&&(this.targetChanged.emit({prevIndex:this.lastDraggingIndex,newIndex:i.i,initialIndex:n.index}),this.lastDraggingIndex=i.i):this.lastDraggingIndex!==n.index&&(this.targetChanged.emit({prevIndex:this.lastDraggingIndex,initialIndex:n.index}),this.lastDraggingIndex=n.index)}onDragEnd({element:e,model:t,event:n}){const i=this.positions[t.prop],r=this.isTarget(t,n);r&&this.reorder.emit({prevIndex:i.index,newIndex:r.i,model:t}),this.lastDraggingIndex=void 0,e.style.left="auto"}isTarget(e,t){let n=0;const i=this.document.elementsFromPoint(t.x||t.clientX,t.y||t.clientY);for(const r in this.positions){const t=this.positions[r];if(e.prop!==r&&i.find(e=>e===t.element))return{pos:t,i:n};n++}}createMapDiffs(){return this.draggables.toArray().reduce((e,t)=>(e[t.dragModel.$$id]=t,e),{})}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.x),i.Rb(r.d))},e.\u0275dir=i.Mb({type:e,selectors:[["","orderable",""]],contentQueries:function(e,t,n){if(1&e&&i.Kb(n,he,1),2&e){let e;i.Ec(e=i.mc())&&(t.draggables=e)}},outputs:{reorder:"reorder",targetChanged:"targetChanged"}}),e})(),me=(()=>{class e{constructor(){this.pressEnabled=!0,this.duration=500,this.longPressStart=new i.p,this.longPressing=new i.p,this.longPressEnd=new i.p,this.mouseX=0,this.mouseY=0}get press(){return this.pressing}get isLongPress(){return this.isLongPressing}onMouseDown(e){if(1!==e.which||!this.pressEnabled)return;if(e.target.classList.contains("resize-handle"))return;this.mouseX=e.clientX,this.mouseY=e.clientY,this.pressing=!0,this.isLongPressing=!1;const t=Object(o.a)(document,"mouseup");this.subscription=t.subscribe(e=>this.onMouseup()),this.timeout=setTimeout(()=>{this.isLongPressing=!0,this.longPressStart.emit({event:e,model:this.pressModel}),this.subscription.add(Object(o.a)(document,"mousemove").pipe(Object(c.a)(t)).subscribe(e=>this.onMouseMove(e))),this.loop(e)},this.duration),this.loop(e)}onMouseMove(e){if(this.pressing&&!this.isLongPressing){const t=Math.abs(e.clientX-this.mouseX)>10,n=Math.abs(e.clientY-this.mouseY)>10;(t||n)&&this.endPress()}}loop(e){this.isLongPressing&&(this.timeout=setTimeout(()=>{this.longPressing.emit({event:e,model:this.pressModel}),this.loop(e)},50))}endPress(){clearTimeout(this.timeout),this.isLongPressing=!1,this.pressing=!1,this._destroySubscription(),this.longPressEnd.emit({model:this.pressModel})}onMouseup(){this.endPress()}ngOnDestroy(){this._destroySubscription()}_destroySubscription(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=void 0)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["","long-press",""]],hostVars:4,hostBindings:function(e,t){1&e&&i.lc("mousedown",function(e){return t.onMouseDown(e)}),2&e&&i.Jb("press",t.press)("longpress",t.isLongPress)},inputs:{pressEnabled:"pressEnabled",duration:"duration",pressModel:"pressModel"},outputs:{longPressStart:"longPressStart",longPressing:"longPressing",longPressEnd:"longPressEnd"}}),e})(),be=(()=>{class e{constructor(e,t,n){this.ngZone=e,this.renderer=n,this.scrollbarV=!1,this.scrollbarH=!1,this.scroll=new i.p,this.scrollYPos=0,this.scrollXPos=0,this.prevScrollYPos=0,this.prevScrollXPos=0,this._scrollEventListener=null,this.element=t.nativeElement}ngOnInit(){if(this.scrollbarV||this.scrollbarH){const e=this.renderer;this.parentElement=e.parentNode(e.parentNode(this.element)),this._scrollEventListener=this.onScrolled.bind(this),this.parentElement.addEventListener("scroll",this._scrollEventListener)}}ngOnDestroy(){this._scrollEventListener&&(this.parentElement.removeEventListener("scroll",this._scrollEventListener),this._scrollEventListener=null)}setOffset(e){this.parentElement&&(this.parentElement.scrollTop=e)}onScrolled(e){const t=e.currentTarget;requestAnimationFrame(()=>{this.scrollYPos=t.scrollTop,this.scrollXPos=t.scrollLeft,this.updateOffset()})}updateOffset(){let e;this.scrollYPos<this.prevScrollYPos?e="down":this.scrollYPos>this.prevScrollYPos&&(e="up"),this.scroll.emit({direction:e,scrollYPos:this.scrollYPos,scrollXPos:this.scrollXPos}),this.prevScrollYPos=this.scrollYPos,this.prevScrollXPos=this.scrollXPos}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.D),i.Rb(i.n),i.Rb(i.H))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-scroller"]],hostAttrs:[1,"datatable-scroll"],hostVars:4,hostBindings:function(e,t){2&e&&i.Nc("height",t.scrollHeight,"px")("width",t.scrollWidth,"px")},inputs:{scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth"},outputs:{scroll:"scroll"},ngContentSelectors:u,decls:1,vars:0,template:function(e,t){1&e&&(i.tc(),i.sc(0))},encapsulation:2,changeDetection:0}),e})(),ge=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-group-header-template",""]]}),e})(),_e=(()=>{class e{constructor(){this.rowHeight=0,this.toggle=new i.p}get template(){return this._templateInput||this._templateQuery}toggleExpandGroup(e){this.toggle.emit({type:"group",value:e})}expandAllGroups(){this.toggle.emit({type:"all",value:!0})}collapseAllGroups(){this.toggle.emit({type:"all",value:!1})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["ngx-datatable-group-header"]],contentQueries:function(e,t,n){if(1&e&&i.Kb(n,ge,3,i.O),2&e){let e;i.Ec(e=i.mc())&&(t._templateQuery=e.first)}},inputs:{rowHeight:"rowHeight",_templateInput:["template","_templateInput"]},outputs:{toggle:"toggle"}}),e})();function ve(){return""}function ye(e){return null==e?ve:"number"==typeof e?we:-1!==e.indexOf(".")?Se:De}function we(e,t){if(null==e)return"";if(!e||null==t)return e;const n=e[t];return null==n?"":n}function De(e,t){if(null==e)return"";if(!e||!t)return e;const n=e[t];return null==n?"":n}function Se(e,t){if(null==e)return"";if(!e||!t)return e;let n=e[t];if(void 0!==n)return n;n=e;const i=t.split(".");if(i.length)for(let r=0;r<i.length;r++)if(n=n[i[r]],null==n)return"";return n}function xe(e){return e&&(t=>ye(e)(t,e))}function ke(e,t,n){if(t&&n){const i={},r=e.length;let s=null;i[0]=new Te;const o=e.reduce((e,t)=>{const i=n(t);return-1===e.indexOf(i)&&e.push(i),e},[]);for(let t=0;t<r;t++)i[n(e[t])]=new Te(e[t]);for(let c=0;c<r;c++){s=i[n(e[c])];let r=0;const a=t(s.row);a&&o.indexOf(a)>-1&&(r=a),s.parent=i[r],s.row.level=s.parent.row.level+1,s.parent.children.push(s)}let a=[];return i[0].flatten(function(){a=[...a,this.row]},!0),a}return e}class Te{constructor(e=null){e||(e={level:-1,treeStatus:"expanded"}),this.row=e,this.parent=null,this.children=[]}flatten(e,t){if("expanded"===this.row.treeStatus)for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n];e.apply(i,Array.prototype.slice.call(arguments,2)),t&&i.flatten.apply(i,arguments)}}}function Me(e){return(e=(e=(e=e.replace(/[^a-zA-Z0-9 ]/g," ")).replace(/([a-z](?=[A-Z]))/g,"$1 ")).replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase()).replace(/([ 0-9]+)([a-zA-Z])/g,function(e,t,n){return t.trim()+n.toUpperCase()})}function Ce(e){if(!e)return;let t=!1;for(const n of e)n.$$id||(n.$$id=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)),Oe(n.prop)&&n.name&&(n.prop=Me(n.name)),n.$$valueGetter||(n.$$valueGetter=ye(n.prop)),!Oe(n.prop)&&Oe(n.name)&&(n.name=String(n.prop).replace(/([A-Z])/g,e=>` ${e}`).replace(/^./,e=>e.toUpperCase())),Oe(n.prop)&&Oe(n.name)&&(n.name=""),n.hasOwnProperty("resizeable")||(n.resizeable=!0),n.hasOwnProperty("sortable")||(n.sortable=!0),n.hasOwnProperty("draggable")||(n.draggable=!0),n.hasOwnProperty("canAutoResize")||(n.canAutoResize=!0),n.hasOwnProperty("width")||(n.width=150),n.hasOwnProperty("isTreeColumn")&&n.isTreeColumn&&!t?t=!0:n.isTreeColumn=!1}function Oe(e){return null==e}var Le=function(e){return e.standard="standard",e.flex="flex",e.force="force",e}({}),Ee=function(e){return e.single="single",e.multi="multi",e.multiClick="multiClick",e.cell="cell",e.checkbox="checkbox",e}({}),Ae=function(e){return e.single="single",e.multi="multi",e}({}),Ie=function(e){return e.header="header",e.body="body",e}({});let Re=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-header-template",""]]}),e})(),Pe=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-cell-template",""]]}),e})(),Fe=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-tree-toggle",""]]}),e})(),We=(()=>{class e{constructor(e){this.columnChangesService=e,this.isFirstChange=!0}get cellTemplate(){return this._cellTemplateInput||this._cellTemplateQuery}get headerTemplate(){return this._headerTemplateInput||this._headerTemplateQuery}get treeToggleTemplate(){return this._treeToggleTemplateInput||this._treeToggleTemplateQuery}ngOnChanges(){this.isFirstChange?this.isFirstChange=!1:this.columnChangesService.onInputChange()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(le))},e.\u0275dir=i.Mb({type:e,selectors:[["ngx-datatable-column"]],contentQueries:function(e,t,n){if(1&e&&(i.Kb(n,Pe,3,i.O),i.Kb(n,Re,3,i.O),i.Kb(n,Fe,3,i.O)),2&e){let e;i.Ec(e=i.mc())&&(t._cellTemplateQuery=e.first),i.Ec(e=i.mc())&&(t._headerTemplateQuery=e.first),i.Ec(e=i.mc())&&(t._treeToggleTemplateQuery=e.first)}},inputs:{name:"name",prop:"prop",frozenLeft:"frozenLeft",frozenRight:"frozenRight",flexGrow:"flexGrow",resizeable:"resizeable",comparator:"comparator",pipe:"pipe",sortable:"sortable",draggable:"draggable",canAutoResize:"canAutoResize",minWidth:"minWidth",width:"width",maxWidth:"maxWidth",checkboxable:"checkboxable",headerCheckboxable:"headerCheckboxable",headerClass:"headerClass",cellClass:"cellClass",isTreeColumn:"isTreeColumn",treeLevelIndent:"treeLevelIndent",summaryFunc:"summaryFunc",summaryTemplate:"summaryTemplate",_cellTemplateInput:["cellTemplate","_cellTemplateInput"],_headerTemplateInput:["headerTemplate","_headerTemplateInput"],_treeToggleTemplateInput:["treeToggleTemplate","_treeToggleTemplateInput"]},features:[i.Bb]}),e})(),je=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.O))},e.\u0275dir=i.Mb({type:e,selectors:[["","ngx-datatable-row-detail-template",""]]}),e})(),Ye=(()=>{class e{constructor(){this.rowHeight=0,this.toggle=new i.p}get template(){return this._templateInput||this._templateQuery}toggleExpandRow(e){this.toggle.emit({type:"row",value:e})}expandAllRows(){this.toggle.emit({type:"all",value:!0})}collapseAllRows(){this.toggle.emit({type:"all",value:!1})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["ngx-datatable-row-detail"]],contentQueries:function(e,t,n){if(1&e&&i.Kb(n,je,3,i.O),2&e){let e;i.Ec(e=i.mc())&&(t._templateQuery=e.first)}},inputs:{rowHeight:"rowHeight",_templateInput:["template","_templateInput"]},outputs:{toggle:"toggle"}}),e})(),Ne=(()=>{class e{get template(){return this._templateInput||this._templateQuery}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Mb({type:e,selectors:[["ngx-datatable-footer"]],contentQueries:function(e,t,n){if(1&e&&i.Kb(n,ue,1,i.O),2&e){let e;i.Ec(e=i.mc())&&(t._templateQuery=e.first)}},inputs:{footerHeight:"footerHeight",totalMessage:"totalMessage",selectedMessage:"selectedMessage",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon",_templateInput:["template","_templateInput"]}}),e})();function ze(e){const t={left:[],center:[],right:[]};if(e)for(const n of e)n.frozenLeft?t.left.push(n):n.frozenRight?t.right.push(n):t.center.push(n);return t}function $e(e,t){return{left:He(e.left),center:He(e.center),right:He(e.right),total:Math.floor(He(t))}}function He(e,t){let n=0;if(e)for(const i of e)n+=parseFloat(t&&i[t]?i[t]:i.width);return n}function Xe(e){const t=[],n=ze(e);return t.push({type:"left",columns:n.left}),t.push({type:"center",columns:n.center}),t.push({type:"right",columns:n.right}),t}class Ve{constructor(){this.treeArray=[]}clearCache(){this.treeArray=[]}initCache(e){const{rows:t,rowHeight:n,detailRowHeight:i,externalVirtual:r,rowCount:s,rowIndexes:o,rowExpansions:a}=e,c="function"==typeof n,l="function"==typeof i;if(!c&&isNaN(n))throw new Error(`Row Height cache initialization failed. Please ensure that 'rowHeight' is a\n        valid number or function value: (${n}) when 'scrollbarV' is enabled.`);if(!l&&isNaN(i))throw new Error(`Row Height cache initialization failed. Please ensure that 'detailRowHeight' is a\n        valid number or function value: (${i}) when 'scrollbarV' is enabled.`);const u=r?s:t.length;this.treeArray=new Array(u);for(let d=0;d<u;++d)this.treeArray[d]=0;for(let d=0;d<u;++d){const e=t[d];let r=n;c&&(r=n(e));const s=a.has(e);e&&s&&(r+=l?i(e,o.get(e)):i),this.update(d,r)}}getRowIndex(e){return 0===e?0:this.calcRowIndex(e)}update(e,t){if(!this.treeArray.length)throw new Error(`Update at index ${e} with value ${t} failed:\n        Row Height cache not initialized.`);const n=this.treeArray.length;for(e|=0;e<n;)this.treeArray[e]+=t,e|=e+1}query(e){if(!this.treeArray.length)throw new Error(`query at index ${e} failed: Fenwick tree array not initialized.`);let t=0;for(e|=0;e>=0;)t+=this.treeArray[e],e=(e&e+1)-1;return t}queryBetween(e,t){return this.query(t)-this.query(e-1)}calcRowIndex(e){if(!this.treeArray.length)return 0;let t=-1;const n=this.treeArray.length;for(let i=Math.pow(2,n.toString(2).length-1);0!==i;i>>=1){const r=t+i;r<n&&e>=this.treeArray[r]&&(e-=this.treeArray[r],t=r)}return t+1}}const Be={},Ue="undefined"!=typeof document?document.createElement("div").style:void 0,qe=function(){const e="undefined"!=typeof window?window.getComputedStyle(document.documentElement,""):void 0,t=void 0!==e?Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/):null,n=null!==t?t[1]:void 0,i=void 0!==n?"WebKit|Moz|MS|O".match(new RegExp("("+n+")","i"))[1]:void 0;return i?{dom:i,lowercase:n,css:`-${n}-`,js:n[0].toUpperCase()+n.substr(1)}:void 0}();function Ge(e){const t=Me(e);return Be[t]||(void 0!==qe&&void 0!==Ue[qe.css+e]?Be[t]=qe.css+e:void 0!==Ue[e]&&(Be[t]=e)),Be[t]}const Je="undefined"!=typeof window?Ge("transform"):void 0,Ke="undefined"!=typeof window?Ge("backfaceVisibility"):void 0,Qe="undefined"!=typeof window?!!Ge("transform"):void 0,Ze="undefined"!=typeof window?!!Ge("perspective"):void 0,et="undefined"!=typeof window?window.navigator.userAgent:"Chrome",tt=/Safari\//.test(et)&&!/Chrome\//.test(et);function nt(e,t,n){void 0!==Je&&Qe?!tt&&Ze?(e[Je]=`translate3d(${t}px, ${n}px, 0)`,e[Ke]="hidden"):e[Me(Je)]=`translate(${t}px, ${n}px)`:(e.top=`${n}px`,e.left=`${t}px`)}let it=(()=>{class e{constructor(e){this.cd=e,this.selected=[],this.scroll=new i.p,this.page=new i.p,this.activate=new i.p,this.select=new i.p,this.detailToggle=new i.p,this.rowContextmenu=new i.p(!1),this.treeAction=new i.p,this.rowHeightsCache=new Ve,this.temp=[],this.offsetY=0,this.indexes={},this.rowIndexes=new WeakMap,this.rowExpansions=[],this.getDetailRowHeight=(e,t)=>{if(!this.rowDetail)return 0;const n=this.rowDetail.rowHeight;return"function"==typeof n?n(e,t):n},this.rowTrackingFn=(e,t)=>{const n=this.getRowIndex(t);return this.trackByProp?t[this.trackByProp]:n}}set pageSize(e){this._pageSize=e,this.recalcLayout()}get pageSize(){return this._pageSize}set rows(e){this._rows=e,this.recalcLayout()}get rows(){return this._rows}set columns(e){this._columns=e;const t=ze(e);this.columnGroupWidths=$e(t,e)}get columns(){return this._columns}set offset(e){this._offset=e,(!this.scrollbarV||this.scrollbarV&&!this.virtualization)&&this.recalcLayout()}get offset(){return this._offset}set rowCount(e){this._rowCount=e,this.recalcLayout()}get rowCount(){return this._rowCount}get bodyWidth(){return this.scrollbarH?this.innerWidth+"px":"100%"}set bodyHeight(e){this._bodyHeight=this.scrollbarV?e+"px":"auto",this.recalcLayout()}get bodyHeight(){return this._bodyHeight}get selectEnabled(){return!!this.selectionType}get scrollHeight(){if(this.scrollbarV&&this.virtualization&&this.rowCount)return this.rowHeightsCache.query(this.rowCount-1)}ngOnInit(){this.rowDetail&&(this.listener=this.rowDetail.toggle.subscribe(({type:e,value:t})=>{"row"===e&&this.toggleRowExpansion(t),"all"===e&&this.toggleAllRows(t),this.updateIndexes(),this.updateRows(),this.cd.markForCheck()})),this.groupHeader&&(this.listener=this.groupHeader.toggle.subscribe(({type:e,value:t})=>{"group"===e&&this.toggleRowExpansion(t),"all"===e&&this.toggleAllRows(t),this.updateIndexes(),this.updateRows(),this.cd.markForCheck()}))}ngOnDestroy(){(this.rowDetail||this.groupHeader)&&this.listener.unsubscribe()}updateOffsetY(e){this.scroller&&(this.scrollbarV&&this.virtualization&&e?e=this.rowHeightsCache.query(this.pageSize*e-1):this.scrollbarV&&!this.virtualization&&(e=0),this.scroller.setOffset(e||0))}onBodyScroll(e){const t=e.scrollYPos,n=e.scrollXPos;this.offsetY===t&&this.offsetX===n||this.scroll.emit({offsetY:t,offsetX:n}),this.offsetY=t,this.offsetX=n,this.updateIndexes(),this.updatePage(e.direction),this.updateRows()}updatePage(e){let t=this.indexes.first/this.pageSize;"up"===e?t=Math.ceil(t):"down"===e&&(t=Math.floor(t)),void 0===e||isNaN(t)||this.page.emit({offset:t})}updateRows(){const{first:e,last:t}=this.indexes;let n=e,i=0;const r=[];if(this.groupedRows){let e=3;for(1===this.groupedRows.length&&(e=this.groupedRows[0].value.length);n<t&&n<this.groupedRows.length;){const e=this.groupedRows[n];this.rowIndexes.set(e,n),e.value&&e.value.forEach((e,t)=>{this.rowIndexes.set(e,`${n}-${t}`)}),r[i]=e,i++,n++}}else for(;n<t&&n<this.rowCount;){const e=this.rows[n];e&&(this.rowIndexes.set(e,n),r[i]=e),i++,n++}this.temp=r}getRowHeight(e){return"function"==typeof this.rowHeight?this.rowHeight(e):this.rowHeight}getGroupHeight(e){let t=0;if(e.value)for(let n=0;n<e.value.length;n++)t+=this.getRowAndDetailHeight(e.value[n]);return t}getRowAndDetailHeight(e){let t=this.getRowHeight(e);return this.getRowExpanded(e)&&(t+=this.getDetailRowHeight(e)),t}getRowsStyles(e){const t={};if(this.groupedRows&&(t.width=this.columnGroupWidths.total),this.scrollbarV&&this.virtualization){let n=0;if(this.groupedRows){const t=e[e.length-1];n=t?this.getRowIndex(t):0}else n=this.getRowIndex(e);nt(t,0,this.rowHeightsCache.query(n-1))}return t}getBottomSummaryRowStyles(){if(!this.scrollbarV||!this.rows||!this.rows.length)return null;const e={position:"absolute"};return nt(e,0,this.rowHeightsCache.query(this.rows.length-1)),e}hideIndicator(){setTimeout(()=>this.loadingIndicator=!1,500)}updateIndexes(){let e=0,t=0;if(this.scrollbarV)if(this.virtualization){const n=parseInt(this.bodyHeight,0);e=this.rowHeightsCache.getRowIndex(this.offsetY),t=this.rowHeightsCache.getRowIndex(n+this.offsetY)+1}else e=0,t=this.rowCount;else this.externalPaging||(e=Math.max(this.offset*this.pageSize,0)),t=Math.min(e+this.pageSize,this.rowCount);this.indexes={first:e,last:t}}refreshRowHeightCache(){if(this.scrollbarV&&(!this.scrollbarV||this.virtualization)&&(this.rowHeightsCache.clearCache(),this.rows&&this.rows.length)){const e=new Set;for(const t of this.rows)this.getRowExpanded(t)&&e.add(t);this.rowHeightsCache.initCache({rows:this.rows,rowHeight:this.rowHeight,detailRowHeight:this.getDetailRowHeight,externalVirtual:this.scrollbarV&&this.externalPaging,rowCount:this.rowCount,rowIndexes:this.rowIndexes,rowExpansions:e})}}getAdjustedViewPortIndex(){const e=this.indexes.first;return this.scrollbarV&&this.virtualization&&this.rowHeightsCache.query(e-1)<=this.offsetY?e-1:e}toggleRowExpansion(e){const t=this.getAdjustedViewPortIndex(),n=this.getRowExpandedIdx(e,this.rowExpansions),i=n>-1;if(this.scrollbarV&&this.virtualization){const t=this.getDetailRowHeight(e)*(i?-1:1),n=this.getRowIndex(e);this.rowHeightsCache.update(n,t)}i?this.rowExpansions.splice(n,1):this.rowExpansions.push(e),this.detailToggle.emit({rows:[e],currentIndex:t})}toggleAllRows(e){this.rowExpansions=[];const t=this.getAdjustedViewPortIndex();if(e)for(const n of this.rows)this.rowExpansions.push(n);this.scrollbarV&&this.recalcLayout(),this.detailToggle.emit({rows:this.rows,currentIndex:t})}recalcLayout(){this.refreshRowHeightCache(),this.updateIndexes(),this.updateRows()}columnTrackingFn(e,t){return t.$$id}stylesByGroup(e){const t=this.columnGroupWidths,n=this.offsetX,i={width:`${t[e]}px`};if("left"===e)nt(i,n,0);else if("right"===e){const e=parseInt(this.innerWidth+"",0);nt(i,-1*(t.total-e-n),0)}return i}getRowExpanded(e){if(0===this.rowExpansions.length&&this.groupExpansionDefault)for(const t of this.groupedRows)this.rowExpansions.push(t);return this.getRowExpandedIdx(e,this.rowExpansions)>-1}getRowExpandedIdx(e,t){if(!t||!t.length)return-1;const n=this.rowIdentity(e);return t.findIndex(e=>this.rowIdentity(e)===n)}getRowIndex(e){return this.rowIndexes.get(e)||0}onTreeAction(e){this.treeAction.emit({row:e})}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.i))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-body"]],viewQuery:function(e,t){if(1&e&&i.Wc(be,1),2&e){let e;i.Ec(e=i.mc())&&(t.scroller=e.first)}},hostAttrs:[1,"datatable-body"],hostVars:4,hostBindings:function(e,t){2&e&&i.Nc("width",t.bodyWidth)("height",t.bodyHeight)},inputs:{selected:"selected",pageSize:"pageSize",rows:"rows",columns:"columns",offset:"offset",rowCount:"rowCount",bodyHeight:"bodyHeight",offsetX:"offsetX",loadingIndicator:"loadingIndicator",scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",externalPaging:"externalPaging",rowHeight:"rowHeight",emptyMessage:"emptyMessage",selectionType:"selectionType",rowIdentity:"rowIdentity",rowDetail:"rowDetail",groupHeader:"groupHeader",selectCheck:"selectCheck",displayCheck:"displayCheck",trackByProp:"trackByProp",rowClass:"rowClass",groupedRows:"groupedRows",groupExpansionDefault:"groupExpansionDefault",innerWidth:"innerWidth",groupRowsBy:"groupRowsBy",virtualization:"virtualization",summaryRow:"summaryRow",summaryPosition:"summaryPosition",summaryHeight:"summaryHeight"},outputs:{scroll:"scroll",page:"page",activate:"activate",select:"select",detailToggle:"detailToggle",rowContextmenu:"rowContextmenu",treeAction:"treeAction"},decls:5,vars:9,consts:[[4,"ngIf"],[3,"selected","rows","selectCheck","selectEnabled","selectionType","rowIdentity","select","activate"],["selector",""],[3,"scrollbarV","scrollbarH","scrollHeight","scrollWidth","scroll",4,"ngIf"],["class","empty-row",3,"innerHTML",4,"ngIf"],[3,"scrollbarV","scrollbarH","scrollHeight","scrollWidth","scroll"],[3,"rowHeight","offsetX","innerWidth","rows","columns",4,"ngIf"],[3,"groupedRows","innerWidth","ngStyle","rowDetail","groupHeader","offsetX","detailRowHeight","row","expanded","rowIndex","rowContextmenu",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle","rowHeight","offsetX","innerWidth","rows","columns",4,"ngIf"],[3,"rowHeight","offsetX","innerWidth","rows","columns"],[3,"groupedRows","innerWidth","ngStyle","rowDetail","groupHeader","offsetX","detailRowHeight","row","expanded","rowIndex","rowContextmenu"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","rowIndex","expanded","rowClass","displayCheck","treeStatus","treeAction","activate",4,"ngIf","ngIfElse"],["groupedRowsTemplate",""],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","rowIndex","expanded","rowClass","displayCheck","treeStatus","treeAction","activate"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","group","rowIndex","expanded","rowClass","activate",4,"ngFor","ngForOf","ngForTrackBy"],["tabindex","-1",3,"isSelected","innerWidth","offsetX","columns","rowHeight","row","group","rowIndex","expanded","rowClass","activate"],[3,"ngStyle","rowHeight","offsetX","innerWidth","rows","columns"],[1,"empty-row",3,"innerHTML"]],template:function(e,t){1&e&&(i.Pc(0,d,1,0,"datatable-progress",0),i.Xb(1,"datatable-selection",1,2),i.lc("select",function(e){return t.select.emit(e)})("activate",function(e){return t.activate.emit(e)}),i.Pc(3,_,4,8,"datatable-scroller",3),i.Pc(4,v,1,1,"div",4),i.Wb()),2&e&&(i.uc("ngIf",t.loadingIndicator),i.Db(1),i.uc("selected",t.selected)("rows",t.rows)("selectCheck",t.selectCheck)("selectEnabled",t.selectEnabled)("selectionType",t.selectionType)("rowIdentity",t.rowIdentity),i.Db(2),i.uc("ngIf",null==t.rows?null:t.rows.length),i.Db(1),i.uc("ngIf",!(null!=t.rows&&t.rows.length||t.loadingIndicator)))},directives:function(){return[r.r,yt,pt,be,r.q,St,gt,r.s,bt]},encapsulation:2,changeDetection:0}),e})(),rt=(()=>{class e{constructor(e){this.cd=e,this.sort=new i.p,this.reorder=new i.p,this.resize=new i.p,this.select=new i.p,this.columnContextmenu=new i.p(!1),this._columnGroupWidths={total:100},this._styleByGroup={left:{},center:{},right:{}},this.destroyed=!1}set innerWidth(e){this._innerWidth=e,setTimeout(()=>{if(this._columns){const e=ze(this._columns);this._columnGroupWidths=$e(e,this._columns),this.setStylesByGroup()}})}get innerWidth(){return this._innerWidth}set headerHeight(e){this._headerHeight="auto"!==e?`${e}px`:e}get headerHeight(){return this._headerHeight}set columns(e){this._columns=e;const t=ze(e);this._columnsByPin=Xe(e),setTimeout(()=>{this._columnGroupWidths=$e(t,e),this.setStylesByGroup()})}get columns(){return this._columns}set offsetX(e){this._offsetX=e,this.setStylesByGroup()}get offsetX(){return this._offsetX}ngOnDestroy(){this.destroyed=!0}onLongPressStart({event:e,model:t}){t.dragging=!0,this.dragEventTarget=e}onLongPressEnd({event:e,model:t}){this.dragEventTarget=e,setTimeout(()=>{const e=this._columns.find(e=>e.$$id===t.$$id);e&&(e.dragging=!1)},5)}get headerWidth(){return this.scrollbarH?this.innerWidth+"px":"100%"}trackByGroups(e,t){return t.type}columnTrackingFn(e,t){return t.$$id}onColumnResized(e,t){e<=t.minWidth?e=t.minWidth:e>=t.maxWidth&&(e=t.maxWidth),this.resize.emit({column:t,prevValue:t.width,newValue:e})}onColumnReordered({prevIndex:e,newIndex:t,model:n}){const i=this.getColumn(t);i.isTarget=!1,i.targetMarkerContext=void 0,this.reorder.emit({column:n,prevValue:e,newValue:t})}onTargetChanged({prevIndex:e,newIndex:t,initialIndex:n}){if(e||0===e){const t=this.getColumn(e);t.isTarget=!1,t.targetMarkerContext=void 0}if(t||0===t){const e=this.getColumn(t);e.isTarget=!0,n!==t&&(e.targetMarkerContext={class:"targetMarker ".concat(n>t?"dragFromRight":"dragFromLeft")})}}getColumn(e){const t=this._columnsByPin[0].columns.length;if(e<t)return this._columnsByPin[0].columns[e];const n=this._columnsByPin[1].columns.length;return e<t+n?this._columnsByPin[1].columns[e-t]:this._columnsByPin[2].columns[e-t-n]}onSort({column:e,prevValue:t,newValue:n}){if(e.dragging)return;const i=this.calcNewSorts(e,t,n);this.sort.emit({sorts:i,column:e,prevValue:t,newValue:n})}calcNewSorts(e,t,n){let i=0;this.sorts||(this.sorts=[]);const r=this.sorts.map((t,n)=>((t=Object.assign({},t)).prop===e.prop&&(i=n),t));return void 0===n?r.splice(i,1):t?r[i].dir=n:(this.sortType===Ae.single&&r.splice(0,this.sorts.length),r.push({dir:n,prop:e.prop})),r}setStylesByGroup(){this._styleByGroup.left=this.calcStylesByGroup("left"),this._styleByGroup.center=this.calcStylesByGroup("center"),this._styleByGroup.right=this.calcStylesByGroup("right"),this.destroyed||this.cd.detectChanges()}calcStylesByGroup(e){const t=this._columnGroupWidths,n={width:`${t[e]}px`};return"center"===e?nt(n,-1*this.offsetX,0):"right"===e&&nt(n,-1*(t.total-this.innerWidth),0),n}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.i))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-header"]],hostAttrs:[1,"datatable-header"],hostVars:4,hostBindings:function(e,t){2&e&&i.Nc("height",t.headerHeight)("width",t.headerWidth)},inputs:{innerWidth:"innerWidth",headerHeight:"headerHeight",columns:"columns",offsetX:"offsetX",sorts:"sorts",sortAscendingIcon:"sortAscendingIcon",sortDescendingIcon:"sortDescendingIcon",sortUnsetIcon:"sortUnsetIcon",scrollbarH:"scrollbarH",dealsWithGroup:"dealsWithGroup",targetMarkerTemplate:"targetMarkerTemplate",sortType:"sortType",allRowsSelected:"allRowsSelected",selectionType:"selectionType",reorderable:"reorderable"},outputs:{sort:"sort",reorder:"reorder",resize:"resize",select:"select",columnContextmenu:"columnContextmenu"},decls:2,vars:4,consts:[["orderable","",1,"datatable-header-inner",3,"reorder","targetChanged"],[3,"class","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["resizeable","","long-press","","draggable","",3,"resizeEnabled","pressModel","pressEnabled","dragX","dragY","dragModel","dragEventTarget","headerHeight","isTarget","targetMarkerTemplate","targetMarkerContext","column","sortType","sorts","selectionType","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","resize","longPressStart","longPressEnd","sort","select","columnContextmenu",4,"ngFor","ngForOf","ngForTrackBy"],["resizeable","","long-press","","draggable","",3,"resizeEnabled","pressModel","pressEnabled","dragX","dragY","dragModel","dragEventTarget","headerHeight","isTarget","targetMarkerTemplate","targetMarkerContext","column","sortType","sorts","selectionType","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","resize","longPressStart","longPressEnd","sort","select","columnContextmenu"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.lc("reorder",function(e){return t.onColumnReordered(e)})("targetChanged",function(e){return t.onTargetChanged(e)}),i.Pc(1,w,2,5,"div",1),i.Wb()),2&e&&(i.Nc("width",t._columnGroupWidths.total,"px"),i.Db(1),i.uc("ngForOf",t._columnsByPin)("ngForTrackBy",t.trackByGroups))},directives:function(){return[pe,r.q,r.s,dt,fe,me,he]},encapsulation:2,changeDetection:0}),e})();function st(e,t,n){let i,r,s;n=n||{};let o=null,a=0;function c(){a=!1===n.leading?0:+new Date,o=null,s=e.apply(i,r)}return function(){const l=+new Date;a||!1!==n.leading||(a=l);const u=t-(l-a);return i=this,r=arguments,u<=0?(clearTimeout(o),o=null,a=l,s=e.apply(i,r)):o||!1===n.trailing||(o=setTimeout(c,u)),s}}function ot(e,t){for(const n of t){const t=e.indexOf(n);e.splice(t,1)}}function at(e,t=300){let n=0;for(const i of e)n+=i.width||t;return n}var ct=function(e){return e.asc="asc",e.desc="desc",e}({});function lt(e,t){if(null==e&&(e=0),null==t&&(t=0),e instanceof Date&&t instanceof Date){if(e<t)return-1;if(e>t)return 1}else if(isNaN(parseFloat(e))||!isFinite(e)||isNaN(parseFloat(t))||!isFinite(t)){if(e=String(e),t=String(t),e.toLowerCase()<t.toLowerCase())return-1;if(e.toLowerCase()>t.toLowerCase())return 1}else{if(parseFloat(e)<parseFloat(t))return-1;if(parseFloat(e)>parseFloat(t))return 1}return 0}let ut=(()=>{class e{constructor(e,t,n,r,s,o,c){this.scrollbarHelper=e,this.dimensionsHelper=t,this.cd=n,this.columnChangesService=o,this.configuration=c,this.selected=[],this.scrollbarV=!1,this.scrollbarH=!1,this.rowHeight=30,this.columnMode=Le.standard,this.headerHeight=30,this.footerHeight=0,this.externalPaging=!1,this.externalSorting=!1,this.loadingIndicator=!1,this.reorderable=!0,this.swapColumns=!0,this.sortType=Ae.single,this.sorts=[],this.cssClasses={sortAscending:"datatable-icon-up",sortDescending:"datatable-icon-down",sortUnset:"datatable-icon-sort-unset",pagerLeftArrow:"datatable-icon-left",pagerRightArrow:"datatable-icon-right",pagerPrevious:"datatable-icon-prev",pagerNext:"datatable-icon-skip"},this.messages={emptyMessage:"No data to display",totalMessage:"total",selectedMessage:"selected"},this.groupExpansionDefault=!1,this.selectAllRowsOnPage=!1,this.virtualization=!0,this.summaryRow=!1,this.summaryHeight=30,this.summaryPosition="top",this.scroll=new i.p,this.activate=new i.p,this.select=new i.p,this.sort=new i.p,this.page=new i.p,this.reorder=new i.p,this.resize=new i.p,this.tableContextmenu=new i.p(!1),this.treeAction=new i.p,this.rowCount=0,this._offsetX=new a.a(0),this._count=0,this._offset=0,this._subscriptions=[],this.rowIdentity=e=>this._groupRowsBy?e.key:e,this.element=r.nativeElement,this.rowDiffer=s.find({}).create(),this.configuration&&this.configuration.messages&&(this.messages=Object.assign({},this.configuration.messages))}set rows(e){this._rows=e,e&&(this._internalRows=[...e]),this.externalSorting||this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.recalculate(),this._rows&&this._groupRowsBy&&(this.groupedRows=this.groupArrayBy(this._rows,this._groupRowsBy)),this.cd.markForCheck()}get rows(){return this._rows}set groupRowsBy(e){e&&(this._groupRowsBy=e,this._rows&&this._groupRowsBy&&(this.groupedRows=this.groupArrayBy(this._rows,this._groupRowsBy)))}get groupRowsBy(){return this._groupRowsBy}set columns(e){e&&(this._internalColumns=[...e],Ce(this._internalColumns),this.recalculateColumns()),this._columns=e}get columns(){return this._columns}set limit(e){this._limit=e,this.recalculate()}get limit(){return this._limit}set count(e){this._count=e,this.recalculate()}get count(){return this._count}set offset(e){this._offset=e}get offset(){return Math.max(Math.min(this._offset,Math.ceil(this.rowCount/this.pageSize)-1),0)}get isFixedHeader(){const e=this.headerHeight;return"string"!=typeof e||"auto"!==e}get isFixedRow(){return"auto"!==this.rowHeight}get isVertScroll(){return this.scrollbarV}get isVirtualized(){return this.virtualization}get isHorScroll(){return this.scrollbarH}get isSelectable(){return void 0!==this.selectionType}get isCheckboxSelection(){return this.selectionType===Ee.checkbox}get isCellSelection(){return this.selectionType===Ee.cell}get isSingleSelection(){return this.selectionType===Ee.single}get isMultiSelection(){return this.selectionType===Ee.multi}get isMultiClickSelection(){return this.selectionType===Ee.multiClick}set columnTemplates(e){this._columnTemplates=e,this.translateColumns(e)}get columnTemplates(){return this._columnTemplates}get allRowsSelected(){let e=this.rows&&this.selected&&this.selected.length===this.rows.length;if(this.bodyComponent&&this.selectAllRowsOnPage){const t=this.bodyComponent.indexes;e=this.selected.length===t.last-t.first}return this.selected&&this.rows&&0!==this.rows.length&&e}ngOnInit(){this.recalculate()}ngAfterViewInit(){this.externalSorting||this.sortInternalRows(),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(()=>{this.recalculate(),this.externalPaging&&this.scrollbarV&&this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:0})})}ngAfterContentInit(){this.columnTemplates.changes.subscribe(e=>this.translateColumns(e)),this.listenForColumnInputChanges()}translateColumns(e){if(e){const t=e.toArray();t.length&&(this._internalColumns=function(e){const t=[];for(const n of e){const e={},i=Object.getOwnPropertyNames(n);for(const t of i)e[t]=n[t];n.headerTemplate&&(e.headerTemplate=n.headerTemplate),n.cellTemplate&&(e.cellTemplate=n.cellTemplate),n.summaryFunc&&(e.summaryFunc=n.summaryFunc),n.summaryTemplate&&(e.summaryTemplate=n.summaryTemplate),t.push(e)}return t}(t),Ce(this._internalColumns),this.recalculateColumns(),this.sortInternalRows(),this.cd.markForCheck())}}groupArrayBy(e,t){const n=new Map;return e.forEach(e=>{const i=e[t];n.has(i)?n.get(i).push(e):n.set(i,[e])}),Array.from(n,e=>({key:e[0],value:e[1]}))}ngDoCheck(){this.rowDiffer.diff(this.rows)&&(this.externalSorting?this._internalRows=[...this.rows]:this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.recalculatePages(),this.cd.markForCheck())}recalculate(){this.recalculateDims(),this.recalculateColumns(),this.cd.markForCheck()}onWindowResize(){this.recalculate()}recalculateColumns(e=this._internalColumns,t=-1,n=this.scrollbarH){if(!e)return;let i=this._innerWidth;return this.scrollbarV&&(i-=this.scrollbarHelper.width),this.columnMode===Le.force?function(e,t,n,i,r=300){const s=e.slice(n+1,e.length).filter(e=>!1!==e.canAutoResize);for(const d of s)d.$$oldWidth||(d.$$oldWidth=d.width);let o=0,a=!1,c=at(e,r),l=t-c;const u=[];do{o=l/s.length,a=c>=t;for(const e of s){if(a&&i)e.width=e.$$oldWidth||e.width||r;else{const t=(e.width||r)+o;e.minWidth&&t<e.minWidth?(e.width=e.minWidth,u.push(e)):e.maxWidth&&t>e.maxWidth?(e.width=e.maxWidth,u.push(e)):e.width=t}e.width=Math.max(0,e.width)}c=at(e),l=t-c,ot(s,u)}while(l>1&&0!==s.length)}(e,i,t,n):this.columnMode===Le.flex&&function(e,t){const n=function(e,t){let n=0;for(const i of e)n+=i.width;return n}(e),i=function(e){let t=0;for(const n of e)t+=n.flexGrow||0;return t}(e),r=ze(e);n!==t&&function(e,t,n){for(const s in e)for(const i of e[s])i.canAutoResize?i.width=0:(t-=i.width,n-=i.flexGrow?i.flexGrow:0);const i={};let r=t;do{const t=r/n;r=0;for(const n in e)for(const s of e[n])if(s.canAutoResize&&!i[s.prop]){const e=s.width+s.flexGrow*t;void 0!==s.minWidth&&e<s.minWidth?(r+=e-s.minWidth,s.width=s.minWidth,i[s.prop]=!0):s.width=e}}while(0!==r)}(r,t,i)}(e,i),e}recalculateDims(){const e=this.dimensionsHelper.getDimensions(this.element);if(this._innerWidth=Math.floor(e.width),this.scrollbarV){let t=e.height;this.headerHeight&&(t-=this.headerHeight),this.footerHeight&&(t-=this.footerHeight),this.bodyHeight=t}this.recalculatePages()}recalculatePages(){this.pageSize=this.calcPageSize(),this.rowCount=this.calcRowCount()}onBodyPage({offset:e}){this.externalPaging&&!this.virtualization||(this.offset=e,this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset}))}onBodyScroll(e){this._offsetX.next(e.offsetX),this.scroll.emit(e),this.cd.detectChanges()}onFooterPage(e){this.offset=e.page-1,this.bodyComponent.updateOffsetY(this.offset),this.page.emit({count:this.count,pageSize:this.pageSize,limit:this.limit,offset:this.offset}),this.selectAllRowsOnPage&&(this.selected=[],this.select.emit({selected:this.selected}))}calcPageSize(e=this.rows){if(this.scrollbarV&&this.virtualization){const e=Math.ceil(this.bodyHeight/this.rowHeight);return Math.max(e,0)}return void 0!==this.limit?this.limit:e?e.length:0}calcRowCount(e=this.rows){return this.externalPaging?this.count:e?this.groupedRows?this.groupedRows.length:null!=this.treeFromRelation&&null!=this.treeToRelation?this._internalRows.length:e.length:0}onColumnContextmenu({event:e,column:t}){this.tableContextmenu.emit({event:e,type:Ie.header,content:t})}onRowContextmenu({event:e,row:t}){this.tableContextmenu.emit({event:e,type:Ie.body,content:t})}onColumnResize({column:e,newValue:t}){if(void 0===e)return;let n;const i=this._internalColumns.map((i,r)=>((i=Object.assign({},i)).$$id===e.$$id&&(n=r,i.width=t,i.$$oldWidth=t),i));this.recalculateColumns(i,n),this._internalColumns=i,this.resize.emit({column:e,newValue:t})}onColumnReorder({column:e,newValue:t,prevValue:n}){const i=this._internalColumns.map(e=>Object.assign({},e));if(this.swapColumns){const r=i[t];i[t]=e,i[n]=r}else if(t>n){const e=i[n];for(let r=n;r<t;r++)i[r]=i[r+1];i[t]=e}else{const e=i[n];for(let r=n;r>t;r--)i[r]=i[r-1];i[t]=e}this._internalColumns=i,this.reorder.emit({column:e,newValue:t,prevValue:n})}onColumnSort(e){this.selectAllRowsOnPage&&(this.selected=[],this.select.emit({selected:this.selected})),this.sorts=e.sorts,!1===this.externalSorting&&this.sortInternalRows(),this._internalRows=ke(this._internalRows,xe(this.treeFromRelation),xe(this.treeToRelation)),this.offset=0,this.bodyComponent.updateOffsetY(this.offset),this.sort.emit(e)}onHeaderSelect(e){if(this.bodyComponent&&this.selectAllRowsOnPage){const e=this.bodyComponent.indexes.first,t=this.bodyComponent.indexes.last,n=this.selected.length===t-e;this.selected=[],n||this.selected.push(...this._internalRows.slice(e,t))}else{const e=this.selected.length===this.rows.length;this.selected=[],e||this.selected.push(...this.rows)}this.select.emit({selected:this.selected})}onBodySelect(e){this.select.emit(e)}onTreeAction(e){const t=e.row,n=this._rows.findIndex(t=>t[this.treeToRelation]===e.row[this.treeToRelation]);this.treeAction.emit({row:t,rowIndex:n})}ngOnDestroy(){this._subscriptions.forEach(e=>e.unsubscribe())}listenForColumnInputChanges(){this._subscriptions.push(this.columnChangesService.columnInputChanges$.subscribe(()=>{this.columnTemplates&&this.columnTemplates.notifyOnChanges()}))}sortInternalRows(){this._internalRows=function(e,t,n){if(!e)return[];if(!n||!n.length||!t)return[...e];const i=new Map;e.forEach((e,t)=>i.set(e,t));const r=[...e],s=t.reduce((e,t)=>(t.comparator&&"function"==typeof t.comparator&&(e[t.prop]=t.comparator),e),{}),o=n.map(e=>{const t=e.prop;return{prop:t,dir:e.dir,valueGetter:ye(t),compareFn:s[t]||lt}});return r.sort(function(e,t){for(const n of o){const{prop:i,valueGetter:r}=n,s=r(e,i),o=r(t,i),a=n.dir!==ct.desc?n.compareFn(s,o,e,t,n.dir):-n.compareFn(s,o,e,t,n.dir);if(0!==a)return a}return i.has(e)&&i.has(t)?i.get(e)<i.get(t)?-1:1:0})}(this._internalRows,this._internalColumns,this.sorts)}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(ae,4),i.Rb(ce,4),i.Rb(i.i),i.Rb(i.n),i.Rb(i.x),i.Rb(le),i.Rb("configuration",8))},e.\u0275cmp=i.Lb({type:e,selectors:[["ngx-datatable"]],contentQueries:function(e,t,n){if(1&e&&(i.Kb(n,Ye,1),i.Kb(n,_e,1),i.Kb(n,Ne,1),i.Kb(n,We,0)),2&e){let e;i.Ec(e=i.mc())&&(t.rowDetail=e.first),i.Ec(e=i.mc())&&(t.groupHeader=e.first),i.Ec(e=i.mc())&&(t.footer=e.first),i.Ec(e=i.mc())&&(t.columnTemplates=e)}},viewQuery:function(e,t){if(1&e&&(i.Wc(it,1),i.Wc(rt,1)),2&e){let e;i.Ec(e=i.mc())&&(t.bodyComponent=e.first),i.Ec(e=i.mc())&&(t.headerComponent=e.first)}},hostAttrs:[1,"ngx-datatable"],hostVars:22,hostBindings:function(e,t){1&e&&i.lc("resize",function(){return t.onWindowResize()},!1,i.Hc),2&e&&i.Jb("fixed-header",t.isFixedHeader)("fixed-row",t.isFixedRow)("scroll-vertical",t.isVertScroll)("virtualized",t.isVirtualized)("scroll-horz",t.isHorScroll)("selectable",t.isSelectable)("checkbox-selection",t.isCheckboxSelection)("cell-selection",t.isCellSelection)("single-selection",t.isSingleSelection)("multi-selection",t.isMultiSelection)("multi-click-selection",t.isMultiClickSelection)},inputs:{selected:"selected",scrollbarV:"scrollbarV",scrollbarH:"scrollbarH",rowHeight:"rowHeight",columnMode:"columnMode",headerHeight:"headerHeight",footerHeight:"footerHeight",externalPaging:"externalPaging",externalSorting:"externalSorting",loadingIndicator:"loadingIndicator",reorderable:"reorderable",swapColumns:"swapColumns",sortType:"sortType",sorts:"sorts",cssClasses:"cssClasses",messages:"messages",groupExpansionDefault:"groupExpansionDefault",selectAllRowsOnPage:"selectAllRowsOnPage",virtualization:"virtualization",summaryRow:"summaryRow",summaryHeight:"summaryHeight",summaryPosition:"summaryPosition",rowIdentity:"rowIdentity",rows:"rows",groupedRows:"groupedRows",groupRowsBy:"groupRowsBy",columns:"columns",limit:"limit",count:"count",offset:"offset",targetMarkerTemplate:"targetMarkerTemplate",selectionType:"selectionType",rowClass:"rowClass",selectCheck:"selectCheck",displayCheck:"displayCheck",trackByProp:"trackByProp",treeFromRelation:"treeFromRelation",treeToRelation:"treeToRelation"},outputs:{scroll:"scroll",activate:"activate",select:"select",sort:"sort",page:"page",reorder:"reorder",resize:"resize",tableContextmenu:"tableContextmenu",treeAction:"treeAction"},decls:5,vars:34,consts:[["visibilityObserver","",3,"visible"],[3,"sorts","sortType","scrollbarH","innerWidth","offsetX","dealsWithGroup","columns","headerHeight","reorderable","targetMarkerTemplate","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","selectionType","sort","resize","reorder","select","columnContextmenu",4,"ngIf"],[3,"groupRowsBy","groupedRows","rows","groupExpansionDefault","scrollbarV","scrollbarH","virtualization","loadingIndicator","externalPaging","rowHeight","rowCount","offset","trackByProp","columns","pageSize","offsetX","rowDetail","groupHeader","selected","innerWidth","bodyHeight","selectionType","emptyMessage","rowIdentity","rowClass","selectCheck","displayCheck","summaryRow","summaryHeight","summaryPosition","page","activate","rowContextmenu","select","scroll","treeAction"],[3,"rowCount","pageSize","offset","footerHeight","footerTemplate","totalMessage","pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","selectedCount","selectedMessage","pagerNextIcon","page",4,"ngIf"],[3,"sorts","sortType","scrollbarH","innerWidth","offsetX","dealsWithGroup","columns","headerHeight","reorderable","targetMarkerTemplate","sortAscendingIcon","sortDescendingIcon","sortUnsetIcon","allRowsSelected","selectionType","sort","resize","reorder","select","columnContextmenu"],[3,"rowCount","pageSize","offset","footerHeight","footerTemplate","totalMessage","pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","selectedCount","selectedMessage","pagerNextIcon","page"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.lc("visible",function(){return t.recalculate()}),i.Pc(1,D,2,17,"datatable-header",1),i.Xb(2,"datatable-body",2),i.lc("page",function(e){return t.onBodyPage(e)})("activate",function(e){return t.activate.emit(e)})("rowContextmenu",function(e){return t.onRowContextmenu(e)})("select",function(e){return t.onBodySelect(e)})("scroll",function(e){return t.onBodyScroll(e)})("treeAction",function(e){return t.onTreeAction(e)}),i.oc(3,"async"),i.Wb(),i.Pc(4,S,1,12,"datatable-footer",3),i.Wb()),2&e&&(i.Db(1),i.uc("ngIf",t.headerHeight),i.Db(1),i.uc("groupRowsBy",t.groupRowsBy)("groupedRows",t.groupedRows)("rows",t._internalRows)("groupExpansionDefault",t.groupExpansionDefault)("scrollbarV",t.scrollbarV)("scrollbarH",t.scrollbarH)("virtualization",t.virtualization)("loadingIndicator",t.loadingIndicator)("externalPaging",t.externalPaging)("rowHeight",t.rowHeight)("rowCount",t.rowCount)("offset",t.offset)("trackByProp",t.trackByProp)("columns",t._internalColumns)("pageSize",t.pageSize)("offsetX",i.pc(3,32,t._offsetX))("rowDetail",t.rowDetail)("groupHeader",t.groupHeader)("selected",t.selected)("innerWidth",t._innerWidth)("bodyHeight",t.bodyHeight)("selectionType",t.selectionType)("emptyMessage",t.messages.emptyMessage)("rowIdentity",t.rowIdentity)("rowClass",t.rowClass)("selectCheck",t.selectCheck)("displayCheck",t.displayCheck)("summaryRow",t.summaryRow)("summaryHeight",t.summaryHeight)("summaryPosition",t.summaryPosition),i.Db(2),i.uc("ngIf",t.footerHeight))},directives:function(){return[de,r.r,it,rt,ht]},pipes:function(){return[r.b]},styles:[".ngx-datatable{display:block;justify-content:center;overflow:hidden;position:relative;transform:translateZ(0)}.ngx-datatable [hidden]{display:none!important}.ngx-datatable *,.ngx-datatable :after,.ngx-datatable :before{box-sizing:border-box}.ngx-datatable.scroll-vertical .datatable-body{overflow-y:auto}.ngx-datatable.scroll-vertical.virtualized .datatable-body .datatable-row-wrapper{position:absolute}.ngx-datatable.scroll-horz .datatable-body{-webkit-overflow-scrolling:touch;overflow-x:auto}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner{white-space:nowrap}.ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-datatable.fixed-row .datatable-scroll,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row{white-space:nowrap}.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-cell,.ngx-datatable.fixed-row .datatable-scroll .datatable-body-row .datatable-body-group-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ngx-datatable .datatable-body-row,.ngx-datatable .datatable-header-inner,.ngx-datatable .datatable-row-center{-o-flex-flow:row;display:flex;flex-direction:row;flex-flow:row}.ngx-datatable .datatable-body-cell,.ngx-datatable .datatable-header-cell{display:inline-block;line-height:1.625;overflow-x:hidden;vertical-align:top}.ngx-datatable .datatable-body-cell:focus,.ngx-datatable .datatable-header-cell:focus{outline:none}.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-row-right{z-index:9}.ngx-datatable .datatable-row-center,.ngx-datatable .datatable-row-group,.ngx-datatable .datatable-row-left,.ngx-datatable .datatable-row-right{position:relative}.ngx-datatable .datatable-header{display:block;overflow:hidden}.ngx-datatable .datatable-header .datatable-header-inner{-webkit-align-items:stretch;align-items:stretch}.ngx-datatable .datatable-header .datatable-header-cell{display:inline-block;position:relative}.ngx-datatable .datatable-header .datatable-header-cell.sortable .datatable-header-cell-wrapper{cursor:pointer}.ngx-datatable .datatable-header .datatable-header-cell.longpress .datatable-header-cell-wrapper{cursor:move}.ngx-datatable .datatable-header .datatable-header-cell .sort-btn{cursor:pointer;display:inline-block;line-height:100%;vertical-align:middle}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell .resize-handle--not-resizable{bottom:0;display:inline-block;padding:0 4px;position:absolute;right:0;top:0;visibility:hidden;width:5px}.ngx-datatable .datatable-header .datatable-header-cell .resize-handle{cursor:ew-resize}.ngx-datatable .datatable-header .datatable-header-cell.resizeable:hover .resize-handle,.ngx-datatable .datatable-header .datatable-header-cell:hover .resize-handle--not-resizable{visibility:visible}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker{bottom:0;position:absolute;top:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromLeft{right:0}.ngx-datatable .datatable-header .datatable-header-cell .targetMarker.dragFromRight{left:0}.ngx-datatable .datatable-header .datatable-header-cell .datatable-header-cell-template-wrap{height:inherit}.ngx-datatable .datatable-body{display:block;position:relative;z-index:10}.ngx-datatable .datatable-body .datatable-scroll{display:inline-block}.ngx-datatable .datatable-body .datatable-row-detail{overflow-y:hidden}.ngx-datatable .datatable-body .datatable-row-wrapper{display:flex;flex-direction:column}.ngx-datatable .datatable-body .datatable-body-row{outline:none}.ngx-datatable .datatable-body .datatable-body-row>div{display:flex}.ngx-datatable .datatable-footer{display:block;overflow:auto;width:100%}.ngx-datatable .datatable-footer .datatable-footer-inner{align-items:center;display:flex;width:100%}.ngx-datatable .datatable-footer .selected-count .page-count{flex:1 1 40%}.ngx-datatable .datatable-footer .selected-count .datatable-pager{flex:1 1 60%}.ngx-datatable .datatable-footer .page-count{flex:1 1 20%}.ngx-datatable .datatable-footer .datatable-pager{flex:1 1 80%;text-align:right}.ngx-datatable .datatable-footer .datatable-pager .pager,.ngx-datatable .datatable-footer .datatable-pager .pager li{display:inline-block;list-style:none;margin:0;padding:0}.ngx-datatable .datatable-footer .datatable-pager .pager li,.ngx-datatable .datatable-footer .datatable-pager .pager li a{outline:none}.ngx-datatable .datatable-footer .datatable-pager .pager li a{cursor:pointer;display:inline-block}.ngx-datatable .datatable-footer .datatable-pager .pager li.disabled a{cursor:not-allowed}"],encapsulation:2,changeDetection:0}),Object(l.b)([function(e,t,n){return{configurable:!0,enumerable:n.enumerable,get:function(){return Object.defineProperty(this,t,{configurable:!0,enumerable:n.enumerable,value:st(n.value,5,void 0)}),this[t]}}}],e.prototype,"onWindowResize",null),e})(),dt=(()=>{class e{constructor(e){this.cd=e,this.sort=new i.p,this.select=new i.p,this.columnContextmenu=new i.p(!1),this.sortFn=this.onSort.bind(this),this.selectFn=this.select.emit.bind(this.select),this.cellContext={column:this.column,sortDir:this.sortDir,sortFn:this.sortFn,allRowsSelected:this.allRowsSelected,selectFn:this.selectFn}}set allRowsSelected(e){this._allRowsSelected=e,this.cellContext.allRowsSelected=e}get allRowsSelected(){return this._allRowsSelected}set column(e){this._column=e,this.cellContext.column=e,this.cd.markForCheck()}get column(){return this._column}set sorts(e){this._sorts=e,this.sortDir=this.calcSortDir(e),this.cellContext.sortDir=this.sortDir,this.sortClass=this.calcSortClass(this.sortDir),this.cd.markForCheck()}get sorts(){return this._sorts}get columnCssClasses(){let e="datatable-header-cell";if(this.column.sortable&&(e+=" sortable"),this.column.resizeable&&(e+=" resizeable"),this.column.headerClass)if("string"==typeof this.column.headerClass)e+=" "+this.column.headerClass;else if("function"==typeof this.column.headerClass){const t=this.column.headerClass({column:this.column});if("string"==typeof t)e+=t;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=` ${i}`)}}const t=this.sortDir;return t&&(e+=` sort-active sort-${t}`),e}get name(){return void 0===this.column.headerTemplate?this.column.name:void 0}get minWidth(){return this.column.minWidth}get maxWidth(){return this.column.maxWidth}get width(){return this.column.width}get isCheckboxable(){return this.column.checkboxable&&this.column.headerCheckboxable&&this.selectionType===Ee.checkbox}onContextmenu(e){this.columnContextmenu.emit({event:e,column:this.column})}ngOnInit(){this.sortClass=this.calcSortClass(this.sortDir)}calcSortDir(e){if(e&&this.column){const t=e.find(e=>e.prop===this.column.prop);if(t)return t.dir}}onSort(){if(!this.column.sortable)return;const e=(t=this.sortDir,this.sortType===Ae.single?t===ct.asc?ct.desc:ct.asc:t?t===ct.asc?ct.desc:void 0:ct.asc);var t;this.sort.emit({column:this.column,prevValue:this.sortDir,newValue:e})}calcSortClass(e){if(this.cellContext.column.sortable)return e===ct.asc?`sort-btn sort-asc ${this.sortAscendingIcon}`:e===ct.desc?`sort-btn sort-desc ${this.sortDescendingIcon}`:`sort-btn ${this.sortUnsetIcon}`}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.i))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-header-cell"]],hostAttrs:[1,"datatable-header-cell"],hostVars:11,hostBindings:function(e,t){1&e&&i.lc("contextmenu",function(e){return t.onContextmenu(e)}),2&e&&(i.Eb("title",t.name),i.Fb(t.columnCssClasses),i.Nc("min-width",t.minWidth,"px")("max-width",t.maxWidth,"px")("width",t.width,"px")("height",t.headerHeight,"px"))},inputs:{allRowsSelected:"allRowsSelected",column:"column",sorts:"sorts",sortType:"sortType",sortAscendingIcon:"sortAscendingIcon",sortDescendingIcon:"sortDescendingIcon",sortUnsetIcon:"sortUnsetIcon",isTarget:"isTarget",targetMarkerTemplate:"targetMarkerTemplate",targetMarkerContext:"targetMarkerContext",selectionType:"selectionType",headerHeight:"headerHeight"},outputs:{sort:"sort",select:"select",columnContextmenu:"columnContextmenu"},decls:6,vars:6,consts:[[1,"datatable-header-cell-template-wrap"],[4,"ngIf"],["class","datatable-checkbox",4,"ngIf"],["class","datatable-header-cell-wrapper",4,"ngIf"],[3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"datatable-checkbox"],["type","checkbox",3,"checked","change"],[1,"datatable-header-cell-wrapper"],[1,"datatable-header-cell-label","draggable",3,"innerHTML","click"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.Pc(1,k,1,2,void 0,1),i.Pc(2,T,2,1,"label",2),i.Pc(3,M,2,1,"span",3),i.Pc(4,O,1,2,void 0,1),i.Xb(5,"span",4),i.lc("click",function(){return t.onSort()}),i.Wb(),i.Wb()),2&e&&(i.Db(1),i.uc("ngIf",t.isTarget),i.Db(1),i.uc("ngIf",t.isCheckboxable),i.Db(1),i.uc("ngIf",!t.column.headerTemplate),i.Db(1),i.uc("ngIf",t.column.headerTemplate),i.Db(1),i.Fb(t.sortClass))},directives:[r.r,r.w],encapsulation:2,changeDetection:0}),e})(),ht=(()=>{class e{constructor(){this.selectedCount=0,this.page=new i.p}get isVisible(){return this.rowCount/this.pageSize>1}get curPage(){return this.offset+1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-footer"]],hostAttrs:[1,"datatable-footer"],inputs:{selectedCount:"selectedCount",footerHeight:"footerHeight",rowCount:"rowCount",pageSize:"pageSize",offset:"offset",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon",totalMessage:"totalMessage",footerTemplate:"footerTemplate",selectedMessage:"selectedMessage"},outputs:{page:"page"},decls:4,vars:8,consts:[[1,"datatable-footer-inner",3,"ngClass"],[4,"ngIf"],["class","page-count",4,"ngIf"],[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"page-count"],[3,"pagerLeftArrowIcon","pagerRightArrowIcon","pagerPreviousIcon","pagerNextIcon","page","size","count","hidden","change"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.Pc(1,A,1,8,void 0,1),i.Pc(2,R,3,3,"div",2),i.Pc(3,P,1,8,"datatable-pager",3),i.Wb()),2&e&&(i.Nc("height",t.footerHeight,"px"),i.uc("ngClass",i.zc(6,F,t.selectedMessage)),i.Db(1),i.uc("ngIf",t.footerTemplate),i.Db(1),i.uc("ngIf",!t.footerTemplate),i.Db(1),i.uc("ngIf",!t.footerTemplate))},directives:function(){return[r.p,r.r,r.w,ft]},encapsulation:2,changeDetection:0}),e})(),ft=(()=>{class e{constructor(){this.change=new i.p,this._count=0,this._page=1,this._size=0}set size(e){this._size=e,this.pages=this.calcPages()}get size(){return this._size}set count(e){this._count=e,this.pages=this.calcPages()}get count(){return this._count}set page(e){this._page=e,this.pages=this.calcPages()}get page(){return this._page}get totalPages(){const e=this.size<1?1:Math.ceil(this.count/this.size);return Math.max(e||0,1)}canPrevious(){return this.page>1}canNext(){return this.page<this.totalPages}prevPage(){this.selectPage(this.page-1)}nextPage(){this.selectPage(this.page+1)}selectPage(e){e>0&&e<=this.totalPages&&e!==this.page&&(this.page=e,this.change.emit({page:e}))}calcPages(e){const t=[];let n=1,i=this.totalPages;e=e||this.page,5<this.totalPages&&(n=e-Math.floor(2.5),i=e+Math.floor(2.5),n<1?(n=1,i=Math.min(n+5-1,this.totalPages)):i>this.totalPages&&(n=Math.max(this.totalPages-5+1,1),i=this.totalPages));for(let r=n;r<=i;r++)t.push({number:r,text:r});return t}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-pager"]],hostAttrs:[1,"datatable-pager"],inputs:{size:"size",count:"count",page:"page",pagerLeftArrowIcon:"pagerLeftArrowIcon",pagerRightArrowIcon:"pagerRightArrowIcon",pagerPreviousIcon:"pagerPreviousIcon",pagerNextIcon:"pagerNextIcon"},outputs:{change:"change"},decls:14,vars:21,consts:[[1,"pager"],["role","button","aria-label","go to first page","href","javascript:void(0)",3,"click"],["role","button","aria-label","go to previous page","href","javascript:void(0)",3,"click"],["role","button","class","pages",3,"active",4,"ngFor","ngForOf"],["role","button","aria-label","go to next page","href","javascript:void(0)",3,"click"],["role","button","aria-label","go to last page","href","javascript:void(0)",3,"click"],["role","button",1,"pages"],["href","javascript:void(0)",3,"click"]],template:function(e,t){1&e&&(i.Xb(0,"ul",0),i.Xb(1,"li"),i.Xb(2,"a",1),i.lc("click",function(){return t.selectPage(1)}),i.Sb(3,"i"),i.Wb(),i.Wb(),i.Xb(4,"li"),i.Xb(5,"a",2),i.lc("click",function(){return t.prevPage()}),i.Sb(6,"i"),i.Wb(),i.Wb(),i.Pc(7,W,3,4,"li",3),i.Xb(8,"li"),i.Xb(9,"a",4),i.lc("click",function(){return t.nextPage()}),i.Sb(10,"i"),i.Wb(),i.Wb(),i.Xb(11,"li"),i.Xb(12,"a",5),i.lc("click",function(){return t.selectPage(t.totalPages)}),i.Sb(13,"i"),i.Wb(),i.Wb(),i.Wb()),2&e&&(i.Db(1),i.Jb("disabled",!t.canPrevious()),i.Db(2),i.Fb(t.pagerPreviousIcon),i.Db(1),i.Jb("disabled",!t.canPrevious()),i.Db(2),i.Fb(t.pagerLeftArrowIcon),i.Db(1),i.uc("ngForOf",t.pages),i.Db(1),i.Jb("disabled",!t.canNext()),i.Db(2),i.Fb(t.pagerRightArrowIcon),i.Db(1),i.Jb("disabled",!t.canNext()),i.Db(2),i.Fb(t.pagerNextIcon))},directives:[r.q],encapsulation:2,changeDetection:0}),e})(),pt=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-progress"]],decls:3,vars:0,consts:[["role","progressbar",1,"progress-linear"],[1,"container"],[1,"bar"]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.Xb(1,"div",1),i.Sb(2,"div",2),i.Wb(),i.Wb())},encapsulation:2,changeDetection:0}),e})();var mt=function(e){return e[e.up=38]="up",e[e.down=40]="down",e[e.return=13]="return",e[e.escape=27]="escape",e[e.left=37]="left",e[e.right=39]="right",e}({});let bt=(()=>{class e{constructor(e,t,n,r){this.differs=e,this.scrollbarHelper=t,this.cd=n,this.treeStatus="collapsed",this.activate=new i.p,this.treeAction=new i.p,this._groupStyles={left:{},center:{},right:{}},this._element=r.nativeElement,this._rowDiffer=e.find({}).create()}set columns(e){this._columns=e,this.recalculateColumns(e),this.buildStylesByGroup()}get columns(){return this._columns}set innerWidth(e){if(this._columns){const e=ze(this._columns);this._columnGroupWidths=$e(e,this._columns)}this._innerWidth=e,this.recalculateColumns(),this.buildStylesByGroup()}get innerWidth(){return this._innerWidth}set offsetX(e){this._offsetX=e,this.buildStylesByGroup()}get offsetX(){return this._offsetX}get cssClass(){let e="datatable-body-row";if(this.isSelected&&(e+=" active"),this.rowIndex%2!=0&&(e+=" datatable-row-odd"),this.rowIndex%2==0&&(e+=" datatable-row-even"),this.rowClass){const t=this.rowClass(this.row);if("string"==typeof t)e+=` ${t}`;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=` ${i}`)}}return e}get columnsTotalWidths(){return this._columnGroupWidths.total}ngDoCheck(){this._rowDiffer.diff(this.row)&&this.cd.markForCheck()}trackByGroups(e,t){return t.type}columnTrackingFn(e,t){return t.$$id}buildStylesByGroup(){this._groupStyles.left=this.calcStylesByGroup("left"),this._groupStyles.center=this.calcStylesByGroup("center"),this._groupStyles.right=this.calcStylesByGroup("right"),this.cd.markForCheck()}calcStylesByGroup(e){const t=this._columnGroupWidths,n=this.offsetX,i={width:`${t[e]}px`};if("left"===e)nt(i,n,0);else if("right"===e){const e=parseInt(this.innerWidth+"",0);nt(i,-1*(t.total-e-n+this.scrollbarHelper.width),0)}return i}onActivate(e,t){e.cellIndex=t,e.rowElement=this._element,this.activate.emit(e)}onKeyDown(e){const t=e.keyCode;(t===mt.return||t===mt.down||t===mt.up||t===mt.left||t===mt.right)&&e.target===this._element&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,rowElement:this._element}))}onMouseenter(e){this.activate.emit({type:"mouseenter",event:e,row:this.row,rowElement:this._element})}recalculateColumns(e=this.columns){this._columns=e;const t=ze(this._columns);this._columnsByPin=Xe(this._columns),this._columnGroupWidths=$e(t,this._columns)}onTreeAction(){this.treeAction.emit()}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.x),i.Rb(ae,4),i.Rb(i.i),i.Rb(i.n))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-body-row"]],hostVars:6,hostBindings:function(e,t){1&e&&i.lc("keydown",function(e){return t.onKeyDown(e)})("mouseenter",function(e){return t.onMouseenter(e)}),2&e&&(i.Fb(t.cssClass),i.Nc("width",t.columnsTotalWidths,"px")("height",t.rowHeight,"px"))},inputs:{treeStatus:"treeStatus",columns:"columns",innerWidth:"innerWidth",offsetX:"offsetX",expanded:"expanded",rowClass:"rowClass",row:"row",group:"group",isSelected:"isSelected",rowIndex:"rowIndex",displayCheck:"displayCheck",rowHeight:"rowHeight"},outputs:{activate:"activate",treeAction:"treeAction"},decls:1,vars:2,consts:[[3,"class","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["tabindex","-1",3,"row","group","expanded","isSelected","rowIndex","column","rowHeight","displayCheck","treeStatus","activate","treeAction",4,"ngFor","ngForOf","ngForTrackBy"],["tabindex","-1",3,"row","group","expanded","isSelected","rowIndex","column","rowHeight","displayCheck","treeStatus","activate","treeAction"]],template:function(e,t){1&e&&i.Pc(0,Y,2,6,"div",0),2&e&&i.uc("ngForOf",t._columnsByPin)("ngForTrackBy",t.trackByGroups)},directives:function(){return[r.q,r.s,_t]},encapsulation:2,changeDetection:0}),e})(),gt=(()=>{class e{constructor(e,t){this.cd=e,this.differs=t,this.rowContextmenu=new i.p(!1),this.groupContext={group:this.row,expanded:this.expanded,rowIndex:this.rowIndex},this.rowContext={row:this.row,expanded:this.expanded,rowIndex:this.rowIndex},this._expanded=!1,this.rowDiffer=t.find({}).create()}set rowIndex(e){this._rowIndex=e,this.rowContext.rowIndex=e,this.groupContext.rowIndex=e,this.cd.markForCheck()}get rowIndex(){return this._rowIndex}set expanded(e){this._expanded=e,this.groupContext.expanded=e,this.rowContext.expanded=e,this.cd.markForCheck()}get expanded(){return this._expanded}ngDoCheck(){this.rowDiffer.diff(this.row)&&(this.rowContext.row=this.row,this.groupContext.group=this.row,this.cd.markForCheck())}onContextmenu(e){this.rowContextmenu.emit({event:e,row:this.row})}getGroupHeaderStyle(){const e={};return e.transform="translate3d("+this.offsetX+"px, 0px, 0px)",e["backface-visibility"]="hidden",e.width=this.innerWidth,e}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.i),i.Rb(i.x))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-row-wrapper"]],hostAttrs:[1,"datatable-row-wrapper"],hostBindings:function(e,t){1&e&&i.lc("contextmenu",function(e){return t.onContextmenu(e)})},inputs:{rowIndex:"rowIndex",expanded:"expanded",innerWidth:"innerWidth",rowDetail:"rowDetail",groupHeader:"groupHeader",offsetX:"offsetX",detailRowHeight:"detailRowHeight",row:"row",groupedRows:"groupedRows"},outputs:{rowContextmenu:"rowContextmenu"},ngContentSelectors:u,decls:3,vars:3,consts:[["class","datatable-group-header",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","datatable-row-detail",3,"height",4,"ngIf"],[1,"datatable-group-header",3,"ngStyle"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"datatable-row-detail"]],template:function(e,t){1&e&&(i.tc(),i.Pc(0,$,2,2,"div",0),i.Pc(1,H,1,0,"ng-content",1),i.Pc(2,B,2,3,"div",2)),2&e&&(i.uc("ngIf",t.groupHeader&&t.groupHeader.template),i.Db(1),i.uc("ngIf",t.groupHeader&&t.groupHeader.template&&t.expanded||!t.groupHeader||!t.groupHeader.template),i.Db(1),i.uc("ngIf",t.rowDetail&&t.rowDetail.template&&t.expanded))},directives:[r.r,r.s,r.w],encapsulation:2,changeDetection:0}),e})(),_t=(()=>{class e{constructor(e,t){this.cd=t,this.activate=new i.p,this.treeAction=new i.p,this.isFocused=!1,this.onCheckboxChangeFn=this.onCheckboxChange.bind(this),this.activateFn=this.activate.emit.bind(this.activate),this.cellContext={onCheckboxChangeFn:this.onCheckboxChangeFn,activateFn:this.activateFn,row:this.row,group:this.group,value:this.value,column:this.column,rowHeight:this.rowHeight,isSelected:this.isSelected,rowIndex:this.rowIndex,treeStatus:this.treeStatus,onTreeAction:this.onTreeAction.bind(this)},this._element=e.nativeElement}set group(e){this._group=e,this.cellContext.group=e,this.checkValueUpdates(),this.cd.markForCheck()}get group(){return this._group}set rowHeight(e){this._rowHeight=e,this.cellContext.rowHeight=e,this.checkValueUpdates(),this.cd.markForCheck()}get rowHeight(){return this._rowHeight}set isSelected(e){this._isSelected=e,this.cellContext.isSelected=e,this.cd.markForCheck()}get isSelected(){return this._isSelected}set expanded(e){this._expanded=e,this.cellContext.expanded=e,this.cd.markForCheck()}get expanded(){return this._expanded}set rowIndex(e){this._rowIndex=e,this.cellContext.rowIndex=e,this.checkValueUpdates(),this.cd.markForCheck()}get rowIndex(){return this._rowIndex}set column(e){this._column=e,this.cellContext.column=e,this.checkValueUpdates(),this.cd.markForCheck()}get column(){return this._column}set row(e){this._row=e,this.cellContext.row=e,this.checkValueUpdates(),this.cd.markForCheck()}get row(){return this._row}set sorts(e){this._sorts=e,this.calcSortDir=this.calcSortDir(e)}get sorts(){return this._sorts}set treeStatus(e){this._treeStatus="collapsed"!==e&&"expanded"!==e&&"loading"!==e&&"disabled"!==e?"collapsed":e,this.cellContext.treeStatus=this._treeStatus,this.checkValueUpdates(),this.cd.markForCheck()}get treeStatus(){return this._treeStatus}get columnCssClasses(){let e="datatable-body-cell";if(this.column.cellClass)if("string"==typeof this.column.cellClass)e+=" "+this.column.cellClass;else if("function"==typeof this.column.cellClass){const t=this.column.cellClass({row:this.row,group:this.group,column:this.column,value:this.value,rowHeight:this.rowHeight});if("string"==typeof t)e+=" "+t;else if("object"==typeof t){const n=Object.keys(t);for(const i of n)!0===t[i]&&(e+=` ${i}`)}}return this.sortDir||(e+=" sort-active"),this.isFocused&&(e+=" active"),this.sortDir===ct.asc&&(e+=" sort-asc"),this.sortDir===ct.desc&&(e+=" sort-desc"),e}get width(){return this.column.width}get minWidth(){return this.column.minWidth}get maxWidth(){return this.column.maxWidth}get height(){const e=this.rowHeight;return isNaN(e)?e:e+"px"}ngDoCheck(){this.checkValueUpdates()}ngOnDestroy(){this.cellTemplate&&this.cellTemplate.clear()}checkValueUpdates(){let e="";if(this.row&&this.column){const t=this.column.$$valueGetter(this.row,this.column.prop),n=this.column.pipe;n?e=n.transform(t):void 0!==e&&(e=t)}else e="";this.value!==e&&(this.value=e,this.cellContext.value=e,this.sanitizedValue=null!=e?this.stripHtml(e):e,this.cd.markForCheck())}onFocus(){this.isFocused=!0}onBlur(){this.isFocused=!1}onClick(e){this.activate.emit({type:"click",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element})}onDblClick(e){this.activate.emit({type:"dblclick",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element})}onKeyDown(e){const t=e.keyCode;(t===mt.return||t===mt.down||t===mt.up||t===mt.left||t===mt.right)&&e.target===this._element&&(e.preventDefault(),e.stopPropagation(),this.activate.emit({type:"keydown",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element}))}onCheckboxChange(e){this.activate.emit({type:"checkbox",event:e,row:this.row,group:this.group,rowHeight:this.rowHeight,column:this.column,value:this.value,cellElement:this._element,treeStatus:"collapsed"})}calcSortDir(e){if(!e)return;const t=e.find(e=>e.prop===this.column.prop);return t?t.dir:void 0}stripHtml(e){return e.replace?e.replace(/<\/?[^>]+(>|$)/g,""):e}onTreeAction(){this.treeAction.emit(this.row)}calcLeftMargin(e,t){return e.isTreeColumn?t.level*(null!=e.treeLevelIndent?e.treeLevelIndent:50):0}}return e.\u0275fac=function(t){return new(t||e)(i.Rb(i.n),i.Rb(i.i))},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-body-cell"]],viewQuery:function(e,t){if(1&e&&i.Wc(U,3,i.S),2&e){let e;i.Ec(e=i.mc())&&(t.cellTemplate=e.first)}},hostVars:10,hostBindings:function(e,t){1&e&&i.lc("focus",function(){return t.onFocus()})("blur",function(){return t.onBlur()})("click",function(e){return t.onClick(e)})("dblclick",function(e){return t.onDblClick(e)})("keydown",function(e){return t.onKeyDown(e)}),2&e&&(i.Fb(t.columnCssClasses),i.Nc("width",t.width,"px")("min-width",t.minWidth,"px")("max-width",t.maxWidth,"px")("height",t.height))},inputs:{group:"group",rowHeight:"rowHeight",isSelected:"isSelected",expanded:"expanded",rowIndex:"rowIndex",column:"column",row:"row",sorts:"sorts",treeStatus:"treeStatus",displayCheck:"displayCheck"},outputs:{activate:"activate",treeAction:"treeAction"},decls:5,vars:6,consts:[[1,"datatable-body-cell-label"],["class","datatable-checkbox",4,"ngIf"],[4,"ngIf"],[3,"title","innerHTML",4,"ngIf"],[1,"datatable-checkbox"],["type","checkbox",3,"checked","click"],["class","datatable-tree-button",3,"disabled","click",4,"ngIf"],[1,"datatable-tree-button",3,"disabled","click"],["class","icon datatable-icon-collapse",4,"ngIf"],["class","icon datatable-icon-up",4,"ngIf"],["class","icon datatable-icon-down",4,"ngIf"],[1,"icon","datatable-icon-collapse"],[1,"icon","datatable-icon-up"],[1,"icon","datatable-icon-down"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"title","innerHTML"],["cellTemplate",""]],template:function(e,t){1&e&&(i.Xb(0,"div",0),i.Pc(1,q,2,1,"label",1),i.Pc(2,ne,3,2,"ng-container",2),i.Pc(3,ie,1,2,"span",3),i.Pc(4,se,2,2,void 0,2),i.Wb()),2&e&&(i.Nc("margin-left",t.calcLeftMargin(t.column,t.row),"px"),i.Db(1),i.uc("ngIf",t.column.checkboxable&&(!t.displayCheck||t.displayCheck(t.row,t.column,t.value))),i.Db(1),i.uc("ngIf",t.column.isTreeColumn),i.Db(1),i.uc("ngIf",!t.column.cellTemplate),i.Db(1),i.uc("ngIf",t.column.cellTemplate))},directives:[r.r,r.w],encapsulation:2,changeDetection:0}),e})();function vt(e,t,n){const i=n(t,e);return i>-1?e.splice(i,1):e.push(t),e}let yt=(()=>{class e{constructor(){this.activate=new i.p,this.select=new i.p}selectRow(e,t,n){if(!this.selectEnabled)return;const i=this.selectionType===Ee.checkbox,r=this.selectionType===Ee.multiClick;let s=[];s=this.selectionType===Ee.multi||i||r?e.shiftKey?function(e,t,n,i,r){const s=n<i;for(let o=0;o<t.length;o++){const r=t[o],a=o>=i&&o<=n,c=o<=i&&o>=n;let l={start:0,end:0};l=s?{start:n,end:i}:{start:i,end:n+1},(s&&c||!s&&a)&&o>=l.start&&o<=l.end&&e.push(r)}return e}([],this.rows,t,this.prevIndex,this.getRowSelectedIdx.bind(this)):vt(e.ctrlKey||e.metaKey||r||i?[...this.selected]:[],n,this.getRowSelectedIdx.bind(this)):vt([],n,this.getRowSelectedIdx.bind(this)),"function"==typeof this.selectCheck&&(s=s.filter(this.selectCheck.bind(this))),this.selected.splice(0,this.selected.length),this.selected.push(...s),this.prevIndex=t,this.select.emit({selected:s})}onActivate(e,t){const{type:n,event:i,row:r}=e,s=this.selectionType===Ee.checkbox;!s&&("click"===n||"dblclick"===n)||s&&"checkbox"===n?this.selectRow(i,t,r):"keydown"===n&&(i.keyCode===mt.return?this.selectRow(i,t,r):this.onKeyboardFocus(e)),this.activate.emit(e)}onKeyboardFocus(e){const{keyCode:t}=e.event;if(t===mt.up||t===mt.down||t===mt.right||t===mt.left){const n=this.selectionType===Ee.cell;e.cellElement&&n?n&&this.focusCell(e.cellElement,e.rowElement,t,e.cellIndex):this.focusRow(e.rowElement,t)}}focusRow(e,t){const n=this.getPrevNextRow(e,t);n&&n.focus()}getPrevNextRow(e,t){const n=e.parentElement;if(n){let e;if(t===mt.up?e=n.previousElementSibling:t===mt.down&&(e=n.nextElementSibling),e&&e.children.length)return e.children[0]}}focusCell(e,t,n,i){let r;if(n===mt.left)r=e.previousElementSibling;else if(n===mt.right)r=e.nextElementSibling;else if(n===mt.up||n===mt.down){const e=this.getPrevNextRow(t,n);if(e){const t=e.getElementsByClassName("datatable-body-cell");t.length&&(r=t[i])}}r&&r.focus()}getRowSelected(e){return this.getRowSelectedIdx(e,this.selected)>-1}getRowSelectedIdx(e,t){if(!t||!t.length)return-1;const n=this.rowIdentity(e);return t.findIndex(e=>this.rowIdentity(e)===n)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-selection"]],inputs:{rows:"rows",selected:"selected",selectEnabled:"selectEnabled",selectionType:"selectionType",rowIdentity:"rowIdentity",selectCheck:"selectCheck"},outputs:{activate:"activate",select:"select"},ngContentSelectors:u,decls:1,vars:0,template:function(e,t){1&e&&(i.tc(),i.sc(0))},encapsulation:2,changeDetection:0}),e})();function wt(e){const t=e.filter(e=>!!e);return t.length?t.some(e=>"number"!=typeof e)?null:t.reduce((e,t)=>e+t):null}function Dt(e){return null}let St=(()=>{class e{constructor(){this.summaryRow={}}ngOnChanges(){this.columns&&this.rows&&(this.updateInternalColumns(),this.updateValues())}updateInternalColumns(){this._internalColumns=this.columns.map(e=>Object.assign(Object.assign({},e),{cellTemplate:e.summaryTemplate}))}updateValues(){this.summaryRow={},this.columns.filter(e=>!e.summaryTemplate).forEach(e=>{const t=this.rows.map(t=>t[e.prop]),n=this.getSummaryFunction(e);this.summaryRow[e.prop]=e.pipe?e.pipe.transform(n(t)):n(t)})}getSummaryFunction(e){return void 0===e.summaryFunc?wt:null===e.summaryFunc?Dt:e.summaryFunc}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["datatable-summary-row"]],hostAttrs:[1,"datatable-summary-row"],inputs:{rows:"rows",columns:"columns",rowHeight:"rowHeight",offsetX:"offsetX",innerWidth:"innerWidth"},features:[i.Bb],decls:1,vars:1,consts:[["tabindex","-1",3,"innerWidth","offsetX","columns","rowHeight","row","rowIndex",4,"ngIf"],["tabindex","-1",3,"innerWidth","offsetX","columns","rowHeight","row","rowIndex"]],template:function(e,t){1&e&&i.Pc(0,oe,1,6,"datatable-body-row",0),2&e&&i.uc("ngIf",t.summaryRow&&t._internalColumns)},directives:[r.r,bt],encapsulation:2}),e})(),xt=(()=>{class e{static forRoot(t){return{ngModule:e,providers:[{provide:"configuration",useValue:t}]}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({providers:[ae,ce,le],imports:[[r.c]]}),e})();"undefined"==typeof document||document.elementsFromPoint||(document.elementsFromPoint=function(e,t){const n=[],i=[];let r,s,o;for(;(r=document.elementFromPoint(e,t))&&-1===n.indexOf(r)&&null!=r;)n.push(r),i.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(s=i.length;o=i[--s];)n[s].style.setProperty("pointer-events",o.value?o.value:"",o.priority);return n})},wE6v:function(e,t,n){var i=n("2oRo"),r=n("xluM"),s=n("hh1v"),o=n("2bX/"),a=n("3Eq5"),c=n("SFrS"),l=n("tiKp"),u=i.TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!s(e)||o(e))return e;var n,i=a(e,d);if(i){if(void 0===t&&(t="default"),n=r(i,e,t),!s(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},wQk9:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),monthsShort:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),weekdays:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysShort:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysMin:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u2d30\u2d59\u2d37\u2d45 \u2d34] LT",nextDay:"[\u2d30\u2d59\u2d3d\u2d30 \u2d34] LT",nextWeek:"dddd [\u2d34] LT",lastDay:"[\u2d30\u2d5a\u2d30\u2d4f\u2d5c \u2d34] LT",lastWeek:"dddd [\u2d34] LT",sameElse:"L"},relativeTime:{future:"\u2d37\u2d30\u2d37\u2d45 \u2d59 \u2d62\u2d30\u2d4f %s",past:"\u2d62\u2d30\u2d4f %s",s:"\u2d49\u2d4e\u2d49\u2d3d",ss:"%d \u2d49\u2d4e\u2d49\u2d3d",m:"\u2d4e\u2d49\u2d4f\u2d53\u2d3a",mm:"%d \u2d4e\u2d49\u2d4f\u2d53\u2d3a",h:"\u2d59\u2d30\u2d44\u2d30",hh:"%d \u2d5c\u2d30\u2d59\u2d59\u2d30\u2d44\u2d49\u2d4f",d:"\u2d30\u2d59\u2d59",dd:"%d o\u2d59\u2d59\u2d30\u2d4f",M:"\u2d30\u2d62o\u2d53\u2d54",MM:"%d \u2d49\u2d62\u2d62\u2d49\u2d54\u2d4f",y:"\u2d30\u2d59\u2d33\u2d30\u2d59",yy:"%d \u2d49\u2d59\u2d33\u2d30\u2d59\u2d4f"},week:{dow:6,doy:12}})}(n("wd/R"))},"wd/R":function(e,t,n){(function(e){e.exports=function(){"use strict";var t,i;function r(){return t.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function f(e,t){for(var n in t)a(t,n)&&(e[n]=t[n]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,i){return xt(e,t,n,i,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function b(e){if(null==e._isValid){var t=m(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function g(e){var t=p(NaN);return null!=e?f(m(t),e):m(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),i=n.length>>>0;for(t=0;t<i;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var _=r.momentProperties=[],v=!1;function y(e,t){var n,i,r;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=m(t)),l(t._locale)||(e._locale=t._locale),_.length>0)for(n=0;n<_.length;n++)l(r=t[i=_[n]])||(e[i]=r);return e}function w(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,r.updateOffset(this),v=!1)}function D(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function S(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,t){var n=!0;return f(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var i,s,o,c=[];for(s=0;s<arguments.length;s++){if(i="","object"==typeof arguments[s]){for(o in i+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];c.push(i)}S(e+"\nArguments: "+Array.prototype.slice.call(c).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var k,T={};function M(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),T[e]||(S(t),T[e]=!0)}function C(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function O(e,t){var n,i=f({},e);for(n in t)a(t,n)&&(o(e[n])&&o(t[n])?(i[n]={},f(i[n],e[n]),f(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);for(n in e)a(e,n)&&!a(t,n)&&o(e[n])&&(i[n]=f({},i[n]));return i}function L(e){null!=e&&this.set(e)}function E(e,t,n){var i=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-i.length)).toString().substr(1)+i}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,k=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var A=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,I=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},P={};function F(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(P[e]=r),t&&(P[t[0]]=function(){return E(r.apply(this,arguments),t[1],t[2])}),n&&(P[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function W(e,t){return e.isValid()?(t=j(t,e.localeData()),R[t]=R[t]||function(e){var t,n,i,r=e.match(A);for(t=0,n=r.length;t<n;t++)r[t]=P[r[t]]?P[r[t]]:(i=r[t]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(t){var i,s="";for(i=0;i<n;i++)s+=C(r[i])?r[i].call(t,e):r[i];return s}}(t),R[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function i(e){return t.longDateFormat(e)||e}for(I.lastIndex=0;n>=0&&I.test(e);)e=e.replace(I,i),I.lastIndex=0,n-=1;return e}var Y={};function N(e,t){var n=e.toLowerCase();Y[n]=Y[n+"s"]=Y[t]=e}function z(e){return"string"==typeof e?Y[e]||Y[e.toLowerCase()]:void 0}function $(e){var t,n,i={};for(n in e)a(e,n)&&(t=z(n))&&(i[t]=e[n]);return i}var H={};function X(e,t){H[e]=t}function V(e){return e%4==0&&e%100!=0||e%400==0}function B(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function U(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=B(t)),n}function q(e,t){return function(n){return null!=n?(J(this,e,n),r.updateOffset(this,t),this):G(this,e)}}function G(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function J(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&V(e.year())&&1===e.month()&&29===e.date()?(n=U(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),De(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var K,Q=/\d/,Z=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,ie=/\d\d?/,re=/\d\d\d\d?/,se=/\d\d\d\d\d\d?/,oe=/\d{1,3}/,ae=/\d{1,4}/,ce=/[+-]?\d{1,6}/,le=/\d+/,ue=/[+-]?\d+/,de=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,fe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,n){K[e]=C(t)?t:function(e,i){return e&&n?n:t}}function me(e,t){return a(K,e)?K[e](t._strict,t._locale):new RegExp(be(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,r){return t||n||i||r})))}function be(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}K={};var ge,_e={};function ve(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),u(t)&&(i=function(e,n){n[t]=U(e)}),n=0;n<e.length;n++)_e[e[n]]=i}function ye(e,t){ve(e,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function we(e,t,n){null!=t&&a(_e,e)&&_e[e](t,n._a,n,e)}function De(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%12+12)%12;return e+=(t-n)/12,1===n?V(e)?29:28:31-n%7%2}ge=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},F("M",["MM",2],"Mo",function(){return this.month()+1}),F("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),F("MMMM",0,0,function(e){return this.localeData().months(this,e)}),N("month","M"),X("month",8),pe("M",ie),pe("MM",ie,Z),pe("MMM",function(e,t){return t.monthsShortRegex(e)}),pe("MMMM",function(e,t){return t.monthsRegex(e)}),ve(["M","MM"],function(e,t){t[1]=U(e)-1}),ve(["MMM","MMMM"],function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[1]=r:m(n).invalidMonth=e});var Se="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ke=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Te=fe,Me=fe;function Ce(e,t,n){var i,r,s,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=p([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,o))?r:null:-1!==(r=ge.call(this._longMonthsParse,o))?r:null:"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,o))||-1!==(r=ge.call(this._longMonthsParse,o))?r:null:-1!==(r=ge.call(this._longMonthsParse,o))||-1!==(r=ge.call(this._shortMonthsParse,o))?r:null}function Oe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=U(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),De(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Le(e){return null!=e?(Oe(this,e),r.updateOffset(this,!0),this):G(this,"Month")}function Ee(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],s=[];for(t=0;t<12;t++)n=p([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),s.sort(e),t=0;t<12;t++)i[t]=be(i[t]),r[t]=be(r[t]);for(t=0;t<24;t++)s[t]=be(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Ae(e){return V(e)?366:365}F("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),N("year","y"),X("year",1),pe("Y",ue),pe("YY",ie,Z),pe("YYYY",ae,te),pe("YYYYY",ce,ne),pe("YYYYYY",ce,ne),ve(["YYYYY","YYYYYY"],0),ve("YYYY",function(e,t){t[0]=2===e.length?r.parseTwoDigitYear(e):U(e)}),ve("YY",function(e,t){t[0]=r.parseTwoDigitYear(e)}),ve("Y",function(e,t){t[0]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return U(e)+(U(e)>68?1900:2e3)};var Ie=q("FullYear",!0);function Re(e,t,n,i,r,s,o){var a;return e<100&&e>=0?(a=new Date(e+400,t,n,i,r,s,o),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,i,r,s,o),a}function Pe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Fe(e,t,n){var i=7+t-n;return-(7+Pe(e,0,i).getUTCDay()-t)%7+i-1}function We(e,t,n,i,r){var s,o,a=1+7*(t-1)+(7+n-i)%7+Fe(e,i,r);return a<=0?o=Ae(s=e-1)+a:a>Ae(e)?(s=e+1,o=a-Ae(e)):(s=e,o=a),{year:s,dayOfYear:o}}function je(e,t,n){var i,r,s=Fe(e.year(),t,n),o=Math.floor((e.dayOfYear()-s-1)/7)+1;return o<1?i=o+Ye(r=e.year()-1,t,n):o>Ye(e.year(),t,n)?(i=o-Ye(e.year(),t,n),r=e.year()+1):(r=e.year(),i=o),{week:i,year:r}}function Ye(e,t,n){var i=Fe(e,t,n),r=Fe(e+1,t,n);return(Ae(e)-i+r)/7}function Ne(e,t){return e.slice(t,7).concat(e.slice(0,t))}F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),X("week",5),X("isoWeek",5),pe("w",ie),pe("ww",ie,Z),pe("W",ie),pe("WW",ie,Z),ye(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=U(e)}),F("d",0,"do","day"),F("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),F("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),F("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),X("day",11),X("weekday",11),X("isoWeekday",11),pe("d",ie),pe("e",ie),pe("E",ie),pe("dd",function(e,t){return t.weekdaysMinRegex(e)}),pe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),pe("dddd",function(e,t){return t.weekdaysRegex(e)}),ye(["dd","ddd","dddd"],function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:m(n).invalidWeekday=e}),ye(["d","e","E"],function(e,t,n,i){t[i]=U(e)});var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),He="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Xe=fe,Ve=fe,Be=fe;function Ue(e,t,n){var i,r,s,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=p([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,o))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._shortWeekdaysParse,o))||-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,o))||-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._minWeekdaysParse,o))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,o))||-1!==(r=ge.call(this._weekdaysParse,o))||-1!==(r=ge.call(this._shortWeekdaysParse,o))?r:null}function qe(){function e(e,t){return t.length-e.length}var t,n,i,r,s,o=[],a=[],c=[],l=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),i=be(this.weekdaysMin(n,"")),r=be(this.weekdaysShort(n,"")),s=be(this.weekdays(n,"")),o.push(i),a.push(r),c.push(s),l.push(i),l.push(r),l.push(s);o.sort(e),a.sort(e),c.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ge(){return this.hours()%12||12}function Je(e,t){F(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}F("H",["HH",2],0,"hour"),F("h",["hh",2],0,Ge),F("k",["kk",2],0,function(){return this.hours()||24}),F("hmm",0,0,function(){return""+Ge.apply(this)+E(this.minutes(),2)}),F("hmmss",0,0,function(){return""+Ge.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),Je("a",!0),Je("A",!1),N("hour","h"),X("hour",13),pe("a",Ke),pe("A",Ke),pe("H",ie),pe("h",ie),pe("k",ie),pe("HH",ie,Z),pe("hh",ie,Z),pe("kk",ie,Z),pe("hmm",re),pe("hmmss",se),pe("Hmm",re),pe("Hmmss",se),ve(["H","HH"],3),ve(["k","kk"],function(e,t,n){var i=U(e);t[3]=24===i?0:i}),ve(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ve(["h","hh"],function(e,t,n){t[3]=U(e),m(n).bigHour=!0}),ve("hmm",function(e,t,n){var i=e.length-2;t[3]=U(e.substr(0,i)),t[4]=U(e.substr(i)),m(n).bigHour=!0}),ve("hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=U(e.substr(0,i)),t[4]=U(e.substr(i,2)),t[5]=U(e.substr(r)),m(n).bigHour=!0}),ve("Hmm",function(e,t,n){var i=e.length-2;t[3]=U(e.substr(0,i)),t[4]=U(e.substr(i))}),ve("Hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=U(e.substr(0,i)),t[4]=U(e.substr(i,2)),t[5]=U(e.substr(r))});var Qe,Ze=q("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Se,monthsShort:xe,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:He,weekdaysShort:$e,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function it(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n<i;n+=1)if(e[n]!==t[n])return n;return i}function rt(e){return e?e.toLowerCase().replace("_","-"):e}function st(t){var i=null;if(void 0===tt[t]&&void 0!==e&&e&&e.exports)try{i=Qe._abbr,n("RnhZ")("./"+t),ot(i)}catch(r){tt[t]=null}return tt[t]}function ot(e,t){var n;return e&&((n=l(t)?ct(e):at(e,t))?Qe=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Qe._abbr}function at(e,t){if(null!==t){var n,i=et;if(t.abbr=e,null!=tt[e])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=tt[e]._config;else if(null!=t.parentLocale)if(null!=tt[t.parentLocale])i=tt[t.parentLocale]._config;else{if(null==(n=st(t.parentLocale)))return nt[t.parentLocale]||(nt[t.parentLocale]=[]),nt[t.parentLocale].push({name:e,config:t}),null;i=n._config}return tt[e]=new L(O(i,t)),nt[e]&&nt[e].forEach(function(e){at(e.name,e.config)}),ot(e),tt[e]}return delete tt[e],null}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Qe;if(!s(e)){if(t=st(e))return t;e=[e]}return function(e){for(var t,n,i,r,s=0;s<e.length;){for(t=(r=rt(e[s]).split("-")).length,n=(n=rt(e[s+1]))?n.split("-"):null;t>0;){if(i=st(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&it(r,n)>=t-1)break;t--}s++}return Qe}(e)}function lt(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>De(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var ut=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/Z|[+-]\d\d(?::?\d\d)?/,ft=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,bt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function _t(e){var t,n,i,r,s,o,a=e._i,c=ut.exec(a)||dt.exec(a);if(c){for(m(e).iso=!0,t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(c[1])){r=ft[t][0],i=!1!==ft[t][2];break}if(null==r)return void(e._isValid=!1);if(c[3]){for(t=0,n=pt.length;t<n;t++)if(pt[t][1].exec(c[3])){s=(c[2]||" ")+pt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!i&&null!=s)return void(e._isValid=!1);if(c[4]){if(!ht.exec(c[4]))return void(e._isValid=!1);o="Z"}e._f=r+(s||"")+(o||""),Dt(e)}else e._isValid=!1}function vt(e){var t,n,i,r,s,o,a,c,l,u=bt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){if(n=u[3],i=u[2],r=u[5],s=u[6],o=u[7],a=[(c=u[4],l=parseInt(c,10),l<=49?2e3+l:l<=999?1900+l:l),xe.indexOf(n),parseInt(i,10),parseInt(r,10),parseInt(s,10)],o&&a.push(parseInt(o,10)),!function(e,t,n){return!e||$e.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],t=a,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return gt[e];if(t)return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}(u[8],u[9],u[10]),e._d=Pe.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function yt(e,t,n){return null!=e?e:null!=t?t:n}function wt(e){var t,n,i,s,o,a=[];if(!e._d){for(i=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,i,r,s,o,a,c,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,o=4,n=yt(t.GG,e._a[0],je(kt(),1,4).year),i=yt(t.W,1),((r=yt(t.E,1))<1||r>7)&&(c=!0)):(s=e._locale._week.dow,o=e._locale._week.doy,l=je(kt(),s,o),n=yt(t.gg,e._a[0],l.year),i=yt(t.w,l.week),null!=t.d?((r=t.d)<0||r>6)&&(c=!0):null!=t.e?(r=t.e+s,(t.e<0||t.e>6)&&(c=!0)):r=s),i<1||i>Ye(n,s,o)?m(e)._overflowWeeks=!0:null!=c?m(e)._overflowWeekday=!0:(a=We(n,i,r,s,o),e._a[0]=a.year,e._dayOfYear=a.dayOfYear)}(e),null!=e._dayOfYear&&(o=yt(e._a[0],i[0]),(e._dayOfYear>Ae(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Pe(o,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=i[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Pe:Re).apply(null,a),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(m(e).weekdayMismatch=!0)}}function Dt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,s,o,a,c=""+e._i,l=c.length,u=0;for(i=j(e._f,e._locale).match(A)||[],t=0;t<i.length;t++)(n=(c.match(me(s=i[t],e))||[])[0])&&((o=c.substr(0,c.indexOf(n))).length>0&&m(e).unusedInput.push(o),c=c.slice(c.indexOf(n)+n.length),u+=n.length),P[s]?(n?m(e).empty=!1:m(e).unusedTokens.push(s),we(s,n,e)):e._strict&&!n&&m(e).unusedTokens.push(s);m(e).charsLeftOver=l-u,c.length>0&&m(e).unusedInput.push(c),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(a=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(a,e._a[0])),wt(e),lt(e)}else vt(e);else _t(e)}function St(e){var t=e._i,n=e._f;return e._locale=e._locale||ct(e._l),null===t||void 0===n&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),D(t)?new w(lt(t)):(d(t)?e._d=t:s(n)?function(e){var t,n,i,r,s,o,a=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)s=0,o=!1,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Dt(t),b(t)&&(o=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,a?s<i&&(i=s,n=t):(null==i||s<i||o)&&(i=s,n=t,o&&(a=!0));f(e,n||t)}(e):n?Dt(e):function(e){var t=e._i;l(t)?e._d=new Date(r.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=mt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,vt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=h(t.slice(0),function(e){return parseInt(e,10)}),wt(e)):o(t)?function(e){if(!e._d){var t=$(e._i);e._a=h([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),wt(e)}}(e):u(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),b(e)||(e._d=null),e))}function xt(e,t,n,i,r){var a,l={};return!0!==t&&!1!==t||(i=t,t=void 0),!0!==n&&!1!==n||(i=n,n=void 0),(o(e)&&c(e)||s(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=n,l._i=e,l._f=t,l._strict=i,(a=new w(lt(St(l))))._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function kt(e,t,n,i){return xt(e,t,n,i,!1)}r.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Tt=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Mt=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()});function Ct(e,t){var n,i;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return kt();for(n=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](n)||(n=t[i]);return n}var Ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Lt(e){var t=$(e),n=t.year||0,i=t.quarter||0,r=t.month||0,s=t.week||t.isoWeek||0,o=t.day||0,c=t.hour||0,l=t.minute||0,u=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,i=!1;for(t in e)if(a(e,t)&&(-1===ge.call(Ot,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Ot.length;++n)if(e[Ot[n]]){if(i)return!1;parseFloat(e[Ot[n]])!==U(e[Ot[n]])&&(i=!0)}return!0}(t),this._milliseconds=+d+1e3*u+6e4*l+1e3*c*60*60,this._days=+o+7*s,this._months=+r+3*i+12*n,this._data={},this._locale=ct(),this._bubble()}function Et(e){return e instanceof Lt}function At(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function It(e,t){F(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+E(~~(e/60),2)+t+E(~~e%60,2)})}It("Z",":"),It("ZZ",""),pe("Z",he),pe("ZZ",he),ve(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Pt(he,e)});var Rt=/([\+\-]|\d\d)/gi;function Pt(e,t){var n,i,r=(t||"").match(e);return null===r?null:0===(i=60*(n=((r[r.length-1]||[])+"").match(Rt)||["-",0,0])[1]+U(n[2]))?0:"+"===n[0]?i:-i}function Ft(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(D(e)||d(e)?e.valueOf():kt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):kt(e).local()}function Wt(e){return-Math.round(e._d.getTimezoneOffset())}function jt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Yt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Nt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zt(e,t){var n,i,r,s,o,c,l=e,d=null;return Et(e)?l={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(l={},t?l[t]=+e:l.milliseconds=+e):(d=Yt.exec(e))?(n="-"===d[1]?-1:1,l={y:0,d:U(d[2])*n,h:U(d[3])*n,m:U(d[4])*n,s:U(d[5])*n,ms:U(At(1e3*d[6]))*n}):(d=Nt.exec(e))?l={y:$t(d[2],n="-"===d[1]?-1:1),M:$t(d[3],n),w:$t(d[4],n),d:$t(d[5],n),h:$t(d[6],n),m:$t(d[7],n),s:$t(d[8],n)}:null==l?l={}:"object"==typeof l&&("from"in l||"to"in l)&&(s=kt(l.from),o=kt(l.to),r=s.isValid()&&o.isValid()?(o=Ft(o,s),s.isBefore(o)?c=Ht(s,o):((c=Ht(o,s)).milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0},(l={}).ms=r.milliseconds,l.M=r.months),i=new Lt(l),Et(e)&&a(e,"_locale")&&(i._locale=e._locale),Et(e)&&a(e,"_isValid")&&(i._isValid=e._isValid),i}function $t(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ht(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Xt(e,t){return function(n,i){var r;return null===i||isNaN(+i)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Vt(this,zt(n,i),e),this}}function Vt(e,t,n,i){var s=t._milliseconds,o=At(t._days),a=At(t._months);e.isValid()&&(i=null==i||i,a&&Oe(e,G(e,"Month")+a*n),o&&J(e,"Date",G(e,"Date")+o*n),s&&e._d.setTime(e._d.valueOf()+s*n),i&&r.updateOffset(e,o||a))}zt.fn=Lt.prototype,zt.invalid=function(){return zt(NaN)};var Bt=Xt(1,"add"),Ut=Xt(-1,"subtract");function qt(e){return"string"==typeof e||e instanceof String}function Gt(e){return D(e)||d(e)||qt(e)||u(e)||function(e){var t=s(e),n=!1;return t&&(n=0===e.filter(function(t){return!u(t)&&qt(e)}).length),t&&n}(e)||function(e){var t,n=o(e)&&!c(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)i=i||a(e,r[t]);return n&&i}(e)||null==e}function Jt(e){var t,n=o(e)&&!c(e),i=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)i=i||a(e,r[t]);return n&&i}function Kt(e,t){if(e.date()<t.date())return-Kt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,"months");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,"months")):(t-i)/(e.clone().add(n+1,"months")-i)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ct(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Zt=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}var tn=1e3,nn=6e4,rn=36e5,sn=126227808e5;function on(e,t){return(e%t+t)%t}function an(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-sn:new Date(e,t,n).valueOf()}function cn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-sn:Date.UTC(e,t,n)}function ln(e,t){return t.erasAbbrRegex(e)}function un(){var e,t,n=[],i=[],r=[],s=[],o=this.eras();for(e=0,t=o.length;e<t;++e)i.push(be(o[e].name)),n.push(be(o[e].abbr)),r.push(be(o[e].narrow)),s.push(be(o[e].name)),s.push(be(o[e].abbr)),s.push(be(o[e].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function dn(e,t){F(0,[e,e.length],0,t)}function hn(e,t,n,i,r){var s;return null==e?je(this,i,r).year:(t>(s=Ye(e,i,r))&&(t=s),fn.call(this,e,t,n,i,r))}function fn(e,t,n,i,r){var s=We(e,t,n,i,r),o=Pe(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}F("N",0,0,"eraAbbr"),F("NN",0,0,"eraAbbr"),F("NNN",0,0,"eraAbbr"),F("NNNN",0,0,"eraName"),F("NNNNN",0,0,"eraNarrow"),F("y",["y",1],"yo","eraYear"),F("y",["yy",2],0,"eraYear"),F("y",["yyy",3],0,"eraYear"),F("y",["yyyy",4],0,"eraYear"),pe("N",ln),pe("NN",ln),pe("NNN",ln),pe("NNNN",function(e,t){return t.erasNameRegex(e)}),pe("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ve(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?m(n).era=r:m(n).invalidEra=e}),pe("y",le),pe("yy",le),pe("yyy",le),pe("yyyy",le),pe("yo",function(e,t){return t._eraYearOrdinalRegex||le}),ve(["y","yy","yyy","yyyy"],0),ve(["yo"],function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),t[0]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,r):parseInt(e,10)}),F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),dn("gggg","weekYear"),dn("ggggg","weekYear"),dn("GGGG","isoWeekYear"),dn("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),X("weekYear",1),X("isoWeekYear",1),pe("G",ue),pe("g",ue),pe("GG",ie,Z),pe("gg",ie,Z),pe("GGGG",ae,te),pe("gggg",ae,te),pe("GGGGG",ce,ne),pe("ggggg",ce,ne),ye(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=U(e)}),ye(["gg","GG"],function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)}),F("Q",0,"Qo","quarter"),N("quarter","Q"),X("quarter",7),pe("Q",Q),ve("Q",function(e,t){t[1]=3*(U(e)-1)}),F("D",["DD",2],"Do","date"),N("date","D"),X("date",9),pe("D",ie),pe("DD",ie,Z),pe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ve(["D","DD"],2),ve("Do",function(e,t){t[2]=U(e.match(ie)[0])});var pn=q("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),X("dayOfYear",4),pe("DDD",oe),pe("DDDD",ee),ve(["DDD","DDDD"],function(e,t,n){n._dayOfYear=U(e)}),F("m",["mm",2],0,"minute"),N("minute","m"),X("minute",14),pe("m",ie),pe("mm",ie,Z),ve(["m","mm"],4);var mn=q("Minutes",!1);F("s",["ss",2],0,"second"),N("second","s"),X("second",15),pe("s",ie),pe("ss",ie,Z),ve(["s","ss"],5);var bn,gn,_n=q("Seconds",!1);for(F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),X("millisecond",16),pe("S",oe,Q),pe("SS",oe,Z),pe("SSS",oe,ee),bn="SSSS";bn.length<=9;bn+="S")pe(bn,le);function vn(e,t){t[6]=U(1e3*("0."+e))}for(bn="S";bn.length<=9;bn+="S")ve(bn,vn);gn=q("Milliseconds",!1),F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var yn=w.prototype;function wn(e){return e}yn.add=Bt,yn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Gt(arguments[0])?(e=arguments[0],t=void 0):Jt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||kt(),i=Ft(n,this).startOf("day"),s=r.calendarFormat(this,i)||"sameElse",o=t&&(C(t[s])?t[s].call(this,n):t[s]);return this.format(o||this.localeData().calendar(s,this,kt(n)))},yn.clone=function(){return new w(this)},yn.diff=function(e,t,n){var i,r,s;if(!this.isValid())return NaN;if(!(i=Ft(e,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=z(t)){case"year":s=Kt(this,i)/12;break;case"month":s=Kt(this,i);break;case"quarter":s=Kt(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-r)/864e5;break;case"week":s=(this-i-r)/6048e5;break;default:s=this-i}return n?s:B(s)},yn.endOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?cn:an,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=rn-on(t+(this._isUTC?0:this.utcOffset()*nn),rn)-1;break;case"minute":t=this._d.valueOf(),t+=nn-on(t,nn)-1;break;case"second":t=this._d.valueOf(),t+=tn-on(t,tn)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},yn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)},yn.from=function(e,t){return this.isValid()&&(D(e)&&e.isValid()||kt(e).isValid())?zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yn.fromNow=function(e){return this.from(kt(),e)},yn.to=function(e,t){return this.isValid()&&(D(e)&&e.isValid()||kt(e).isValid())?zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yn.toNow=function(e){return this.to(kt(),e)},yn.get=function(e){return C(this[e=z(e)])?this[e]():this},yn.invalidAt=function(){return m(this).overflow},yn.isAfter=function(e,t){var n=D(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},yn.isBefore=function(e,t){var n=D(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},yn.isBetween=function(e,t,n,i){var r=D(e)?e:kt(e),s=D(t)?t:kt(t);return!!(this.isValid()&&r.isValid()&&s.isValid())&&("("===(i=i||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===i[1]?this.isBefore(s,n):!this.isAfter(s,n))},yn.isSame=function(e,t){var n,i=D(e)?e:kt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=z(t)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},yn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},yn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},yn.isValid=function(){return b(this)},yn.lang=Zt,yn.locale=Qt,yn.localeData=en,yn.max=Mt,yn.min=Tt,yn.parsingFlags=function(){return f({},m(this))},yn.set=function(e,t){if("object"==typeof e){var n,i=function(e){var t,n=[];for(t in e)a(e,t)&&n.push({unit:t,priority:H[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=$(e));for(n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit])}else if(C(this[e=z(e)]))return this[e](t);return this},yn.startOf=function(e){var t,n;if(void 0===(e=z(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?cn:an,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=on(t+(this._isUTC?0:this.utcOffset()*nn),rn);break;case"minute":t=this._d.valueOf(),t-=on(t,nn);break;case"second":t=this._d.valueOf(),t-=on(t,tn)}return this._d.setTime(t),r.updateOffset(this,!0),this},yn.subtract=Ut,yn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},yn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},yn.toDate=function(){return new Date(this.valueOf())},yn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?W(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",W(n,"Z")):W(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",i="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+i+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(yn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),yn.toJSON=function(){return this.isValid()?this.toISOString():null},yn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yn.unix=function(){return Math.floor(this.valueOf()/1e3)},yn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yn.eraName=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].name;if(i[e].until<=n&&n<=i[e].since)return i[e].name}return""},yn.eraNarrow=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].narrow;if(i[e].until<=n&&n<=i[e].since)return i[e].narrow}return""},yn.eraAbbr=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].abbr;if(i[e].until<=n&&n<=i[e].since)return i[e].abbr}return""},yn.eraYear=function(){var e,t,n,i,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,i=this.clone().startOf("day").valueOf(),s[e].since<=i&&i<=s[e].until||s[e].until<=i&&i<=s[e].since)return(this.year()-r(s[e].since).year())*n+s[e].offset;return this.year()},yn.year=Ie,yn.isLeapYear=function(){return V(this.year())},yn.weekYear=function(e){return hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yn.isoWeekYear=function(e){return hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},yn.quarter=yn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},yn.month=Le,yn.daysInMonth=function(){return De(this.year(),this.month())},yn.week=yn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},yn.isoWeek=yn.isoWeeks=function(e){var t=je(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},yn.weeksInYear=function(){var e=this.localeData()._week;return Ye(this.year(),e.dow,e.doy)},yn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ye(this.weekYear(),e.dow,e.doy)},yn.isoWeeksInYear=function(){return Ye(this.year(),1,4)},yn.isoWeeksInISOWeekYear=function(){return Ye(this.isoWeekYear(),1,4)},yn.date=pn,yn.day=yn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},yn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},yn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},yn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},yn.hour=yn.hours=Ze,yn.minute=yn.minutes=mn,yn.second=yn.seconds=_n,yn.millisecond=yn.milliseconds=gn,yn.utcOffset=function(e,t,n){var i,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Pt(he,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=Wt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!t||this._changeInProgress?Vt(this,zt(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Wt(this)},yn.utc=function(e){return this.utcOffset(0,e)},yn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Wt(this),"m")),this},yn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Pt(de,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},yn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?kt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},yn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yn.isLocal=function(){return!!this.isValid()&&!this._isUTC},yn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yn.isUtc=jt,yn.isUTC=jt,yn.zoneAbbr=function(){return this._isUTC?"UTC":""},yn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yn.dates=x("dates accessor is deprecated. Use date instead.",pn),yn.months=x("months accessor is deprecated. Use month instead",Le),yn.years=x("years accessor is deprecated. Use year instead",Ie),yn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),yn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return y(t,this),(t=St(t))._a?(e=t._isUTC?p(t._a):kt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var i,r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),o=0;for(i=0;i<r;i++)U(e[i])!==U(t[i])&&o++;return o+s}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Dn=L.prototype;function Sn(e,t,n,i){var r=ct(),s=p().set(i,t);return r[n](s,e)}function xn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Sn(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Sn(e,i,n,"month");return r}function kn(e,t,n,i){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,s=ct(),o=e?s._week.dow:0,a=[];if(null!=n)return Sn(t,(n+o)%7,i,"day");for(r=0;r<7;r++)a[r]=Sn(t,(r+o)%7,i,"day");return a}Dn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return C(i)?i.call(t,n):i},Dn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(A).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Dn.invalidDate=function(){return this._invalidDate},Dn.ordinal=function(e){return this._ordinal.replace("%d",e)},Dn.preparse=wn,Dn.postformat=wn,Dn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return C(r)?r(e,t,n,i):r.replace(/%d/i,e)},Dn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)},Dn.set=function(e){var t,n;for(n in e)a(e,n)&&(C(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Dn.eras=function(e,t){var n,i,s,o=this._eras||ct("en")._eras;for(n=0,i=o.length;n<i;++n){switch(typeof o[n].since){case"string":s=r(o[n].since).startOf("day"),o[n].since=s.valueOf()}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":s=r(o[n].until).startOf("day").valueOf(),o[n].until=s.valueOf()}}return o},Dn.erasParse=function(e,t,n){var i,r,s,o,a,c=this.eras();for(e=e.toUpperCase(),i=0,r=c.length;i<r;++i)if(s=c[i].name.toUpperCase(),o=c[i].abbr.toUpperCase(),a=c[i].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return c[i];break;case"NNNN":if(s===e)return c[i];break;case"NNNNN":if(a===e)return c[i]}else if([s,o,a].indexOf(e)>=0)return c[i]},Dn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},Dn.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||un.call(this),e?this._erasAbbrRegex:this._erasRegex},Dn.erasNameRegex=function(e){return a(this,"_erasNameRegex")||un.call(this),e?this._erasNameRegex:this._erasRegex},Dn.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||un.call(this),e?this._erasNarrowRegex:this._erasRegex},Dn.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ke).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},Dn.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ke.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Dn.monthsParse=function(e,t,n){var i,r,s;if(this._monthsParseExact)return Ce.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=p([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},Dn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ee.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Me),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Dn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ee.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=Te),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Dn.week=function(e){return je(e,this._week.dow,this._week.doy).week},Dn.firstDayOfYear=function(){return this._week.doy},Dn.firstDayOfWeek=function(){return this._week.dow},Dn.weekdays=function(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ne(n,this._week.dow):e?n[e.day()]:n},Dn.weekdaysMin=function(e){return!0===e?Ne(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Dn.weekdaysShort=function(e){return!0===e?Ne(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Dn.weekdaysParse=function(e,t,n){var i,r,s;if(this._weekdaysParseExact)return Ue.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=p([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},Dn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Dn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ve),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Dn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Dn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Dn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ot("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===U(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=x("moment.lang is deprecated. Use moment.locale instead.",ot),r.langData=x("moment.langData is deprecated. Use moment.localeData instead.",ct);var Tn=Math.abs;function Mn(e,t,n,i){var r=zt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function Cn(e){return e<0?Math.floor(e):Math.ceil(e)}function On(e){return 4800*e/146097}function Ln(e){return 146097*e/4800}function En(e){return function(){return this.as(e)}}var An=En("ms"),In=En("s"),Rn=En("m"),Pn=En("h"),Fn=En("d"),Wn=En("w"),jn=En("M"),Yn=En("Q"),Nn=En("y");function zn(e){return function(){return this.isValid()?this._data[e]:NaN}}var $n=zn("milliseconds"),Hn=zn("seconds"),Xn=zn("minutes"),Vn=zn("hours"),Bn=zn("days"),Un=zn("months"),qn=zn("years"),Gn=Math.round,Jn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Kn(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}var Qn=Math.abs;function Zn(e){return(e>0)-(e<0)||+e}function ei(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,s,o,a,c=Qn(this._milliseconds)/1e3,l=Qn(this._days),u=Qn(this._months),d=this.asSeconds();return d?(e=B(c/60),t=B(e/60),c%=60,e%=60,n=B(u/12),u%=12,i=c?c.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",s=Zn(this._months)!==Zn(d)?"-":"",o=Zn(this._days)!==Zn(d)?"-":"",a=Zn(this._milliseconds)!==Zn(d)?"-":"",r+"P"+(n?s+n+"Y":"")+(u?s+u+"M":"")+(l?o+l+"D":"")+(t||e||c?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(c?a+i+"S":"")):"P0D"}var ti=Lt.prototype;return ti.isValid=function(){return this._isValid},ti.abs=function(){var e=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),e.milliseconds=Tn(e.milliseconds),e.seconds=Tn(e.seconds),e.minutes=Tn(e.minutes),e.hours=Tn(e.hours),e.months=Tn(e.months),e.years=Tn(e.years),this},ti.add=function(e,t){return Mn(this,e,t,1)},ti.subtract=function(e,t){return Mn(this,e,t,-1)},ti.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=z(e))||"quarter"===e||"year"===e)switch(n=this._months+On(t=this._days+i/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ln(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},ti.asMilliseconds=An,ti.asSeconds=In,ti.asMinutes=Rn,ti.asHours=Pn,ti.asDays=Fn,ti.asWeeks=Wn,ti.asMonths=jn,ti.asQuarters=Yn,ti.asYears=Nn,ti.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*U(this._months/12):NaN},ti._bubble=function(){var e,t,n,i,r,s=this._milliseconds,o=this._days,a=this._months,c=this._data;return s>=0&&o>=0&&a>=0||s<=0&&o<=0&&a<=0||(s+=864e5*Cn(Ln(a)+o),o=0,a=0),c.milliseconds=s%1e3,e=B(s/1e3),c.seconds=e%60,t=B(e/60),c.minutes=t%60,n=B(t/60),c.hours=n%24,o+=B(n/24),a+=r=B(On(o)),o-=Cn(Ln(r)),i=B(a/12),a%=12,c.days=o,c.months=a,c.years=i,this},ti.clone=function(){return zt(this)},ti.get=function(e){return e=z(e),this.isValid()?this[e+"s"]():NaN},ti.milliseconds=$n,ti.seconds=Hn,ti.minutes=Xn,ti.hours=Vn,ti.days=Bn,ti.weeks=function(){return B(this.days()/7)},ti.months=Un,ti.years=qn,ti.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,s=Jn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(s=Object.assign({},Jn,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),i=function(e,t,n,i){var r=zt(e).abs(),s=Gn(r.as("s")),o=Gn(r.as("m")),a=Gn(r.as("h")),c=Gn(r.as("d")),l=Gn(r.as("M")),u=Gn(r.as("w")),d=Gn(r.as("y")),h=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||a<=1&&["h"]||a<n.h&&["hh",a]||c<=1&&["d"]||c<n.d&&["dd",c];return null!=n.w&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),(h=h||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=i,Kn.apply(null,h)}(this,!r,s,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)},ti.toISOString=ei,ti.toString=ei,ti.toJSON=ei,ti.locale=Qt,ti.localeData=en,ti.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ei),ti.lang=Zt,F("X",0,0,"unix"),F("x",0,0,"valueOf"),pe("x",ue),pe("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ve("x",function(e,t,n){n._d=new Date(U(e))}),r.version="2.29.1",t=kt,r.fn=yn,r.min=function(){return Ct("isBefore",[].slice.call(arguments,0))},r.max=function(){return Ct("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(e){return kt(1e3*e)},r.months=function(e,t){return xn(e,t,"months")},r.isDate=d,r.locale=ot,r.invalid=g,r.duration=zt,r.isMoment=D,r.weekdays=function(e,t,n){return kn(e,t,n,"weekdays")},r.parseZone=function(){return kt.apply(null,arguments).parseZone()},r.localeData=ct,r.isDuration=Et,r.monthsShort=function(e,t){return xn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return kn(e,t,n,"weekdaysMin")},r.defineLocale=at,r.updateLocale=function(e,t){if(null!=t){var n,i,r=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(O(tt[e]._config,t)):(null!=(i=st(e))&&(r=i._config),t=O(r,t),null==i&&(t.abbr=e),(n=new L(t)).parentLocale=tt[e],tt[e]=n),ot(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===ot()&&ot(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return k(tt)},r.weekdaysShort=function(e,t,n){return kn(e,t,n,"weekdaysShort")},r.normalizeUnits=z,r.relativeTimeRounding=function(e){return void 0===e?Gn:"function"==typeof e&&(Gn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==Jn[e]&&(void 0===t?Jn[e]:(Jn[e]=t,"s"===e&&(Jn.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=yn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n("YuTi")(e))},wg0c:function(e,t,n){var i=n("2oRo"),r=n("0Dky"),s=n("4zBA"),o=n("V37c"),a=n("WKiH").trim,c=n("WJkJ"),l=i.parseInt,u=i.Symbol,d=u&&u.iterator,h=/^[+-]?0x/i,f=s(h.exec),p=8!==l(c+"08")||22!==l(c+"0x16")||d&&!r(function(){l(Object(d))});e.exports=p?function(e,t){var n=a(o(e));return l(n,t>>>0||(f(h,n)?16:10))}:l},wnGv:function(e,t,n){"use strict";n.d(t,"a",function(){return E});var i=n("8Y7J"),r=n("s7LF"),s=n("LvDl"),o=n.n(s),a=n("oxzT"),c=n("QFaf"),l=n("DNAf"),u=n("a96k"),d=n("SVse"),h=n("NwgZ"),f=n("ANnk"),p=n("f69J"),m=n("G0yt");function b(e,t){if(1&e&&(i.Xb(0,"span",12),i.Rc(1),i.Wb()),2&e){const e=i.nc().$implicit,t=i.nc(2);i.Db(1),i.Tc(" ",t.messages.customValidations[e]," ")}}function g(e,t){if(1&e&&(i.Vb(0),i.Pc(1,b,2,1,"span",11),i.Ub()),2&e){const e=t.$implicit;i.nc();const n=i.Fc(1),r=i.nc();i.Db(1),i.uc("ngIf",r.form.showError("filter",n)&&r.filter.hasError(e))}}const _=function(e){return[e]};function v(e,t){if(1&e&&i.Sb(0,"i",18),2&e){const e=i.nc(3);i.uc("ngClass",i.zc(1,_,e.icons.check))}}function y(e,t){if(1&e&&(i.Vb(0),i.Sb(1,"br"),i.Xb(2,"small",19),i.Rc(3),i.Wb(),i.Ub()),2&e){const e=i.nc().$implicit;i.Db(3),i.Tc(" ",e.description,"\xa0 ")}}const w=function(e){return{"help-block disabled":e}};function D(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",13),i.lc("click",function(){i.Ic(e);const n=t.$implicit;return i.nc(2).triggerSelection(n)}),i.Xb(1,"div",14),i.Pc(2,v,1,3,"i",15),i.Rc(3," \xa0 "),i.Wb(),i.Xb(4,"div",16),i.Rc(5),i.Pc(6,y,4,1,"ng-container",17),i.Wb(),i.Wb()}if(2&e){const e=t.$implicit,n=i.nc(2);i.uc("ngClass",i.zc(4,w,!(n.data.length!==n.selectionLimit&&e.enabled||e.selected))),i.Db(2),i.uc("ngIf",e.selected),i.Db(3),i.Tc(" ",e.name," "),i.Db(1),i.uc("ngIf",e.description)}}function S(e,t){if(1&e){const e=i.Yb();i.Xb(0,"div",20),i.lc("click",function(){return i.Ic(e),i.nc(2).addCustomOption()}),i.Xb(1,"div",14),i.Sb(2,"i",18),i.Rc(3," \xa0 "),i.Wb(),i.Xb(4,"div",16),i.Rc(5),i.Wb(),i.Wb()}if(2&e){const e=i.nc(2);i.Db(2),i.uc("ngClass",i.zc(3,_,e.icons.tag)),i.Db(3),i.Uc(" ",e.messages.add," '",e.filter.value,"' ")}}function x(e,t){if(1&e&&(i.Xb(0,"span",23),i.Rc(1),i.Wb()),2&e){const e=i.nc(3);i.uc("ngbTooltip",e.messages.selectionLimit.tooltip),i.Db(1),i.Tc(" ",e.messages.selectionLimit.text," ")}}function k(e,t){if(1&e&&(i.Xb(0,"div",21),i.Pc(1,x,2,2,"span",22),i.Wb()),2&e){const e=i.nc(2);i.Db(1),i.uc("ngIf",e.data.length===e.selectionLimit)}}function T(e,t){if(1&e){const e=i.Yb();i.Xb(0,"form",4,5),i.Xb(2,"div"),i.Xb(3,"input",6),i.lc("keyup",function(t){i.Ic(e);const n=i.nc();return 13==t.keyCode?n.selectOption():n.updateFilter()}),i.Wb(),i.Pc(4,g,2,1,"ng-container",7),i.Wb(),i.Wb(),i.Pc(5,D,7,6,"div",8),i.Pc(6,S,6,5,"div",9),i.Pc(7,k,2,1,"div",10)}if(2&e){const e=i.nc();i.uc("formGroup",e.form),i.Db(3),i.uc("placeholder",e.messages.filter),i.Db(1),i.uc("ngForOf",e.Object.keys(e.messages.customValidations)),i.Db(1),i.uc("ngForOf",e.filteredOptions),i.Db(1),i.uc("ngIf",e.isCreatable()),i.Db(1),i.uc("ngIf",e.data.length===e.selectionLimit)}}function M(e,t){if(1&e&&(i.Xb(0,"a",24),i.sc(1),i.Wb()),2&e){const e=i.nc(),t=i.Fc(1);i.uc("ngClass",e.elemClass)("ngbPopover",t)}}function C(e,t){if(1&e&&(i.Xb(0,"span",25),i.Rc(1),i.Wb()),2&e){const e=i.nc();i.Db(1),i.Tc(" ",e.messages.empty,"\n")}}function O(e,t){if(1&e&&(i.Xb(0,"span",25),i.Rc(1),i.Wb()),2&e){const e=i.nc();i.Db(1),i.Tc(" ",e.messages.noOptions,"\n")}}const L=["*"];let E=(()=>{class e{constructor(){this.data=[],this.options=[],this.messages=new l.a({}),this.customBadges=!1,this.customBadgeValidators=[],this.selection=new i.p,this.Object=Object,this.filteredOptions=[],this.icons=a.a}ngOnInit(){this.initFilter(),this.data.length>0&&this.initMissingOptions(),this.options=o.a.sortBy(this.options,["name"]),this.updateOptions()}initFilter(){this.filter=new r.h("",{validators:this.customBadgeValidators}),this.form=new c.a({filter:this.filter}),this.filteredOptions=[...this.options||[]]}initMissingOptions(){const e=this.options.map(e=>e.name);this.data.filter(t=>-1===e.indexOf(t)).forEach(e=>this.addOption(e)),this.forceOptionsToReflectData()}addOption(e){this.options.push(new u.a(!1,e,"")),this.options=o.a.sortBy(this.options,["name"]),this.triggerSelection(this.options.find(t=>t.name===e))}triggerSelection(e){!e||this.selectionLimit&&!e.selected&&this.data.length>=this.selectionLimit||(e.selected=!e.selected,this.updateOptions(),this.selection.emit({option:e}))}updateOptions(){this.data.splice(0,this.data.length),this.options.forEach(e=>{e.selected&&this.data.push(e.name)}),this.updateFilter()}updateFilter(){this.filteredOptions=this.options.filter(e=>e.name.includes(this.filter.value))}forceOptionsToReflectData(){this.options.forEach(e=>{-1!==this.data.indexOf(e.name)&&(e.selected=!0)})}ngOnChanges(){this.filter&&this.updateFilter(),this.options&&this.data&&0!==this.data.length&&this.forceOptionsToReflectData()}selectOption(){0===this.filteredOptions.length?this.addCustomOption():(this.triggerSelection(this.filteredOptions[0]),this.resetFilter())}addCustomOption(){this.isCreatable()&&(this.addOption(this.filter.value),this.resetFilter())}isCreatable(){return this.customBadges&&this.filter.valid&&this.filter.value.length>0&&this.filteredOptions.every(e=>e.name!==this.filter.value)}resetFilter(){this.filter.setValue(""),this.updateFilter()}removeItem(e){this.triggerSelection(this.options.find(t=>t.name===e&&t.selected))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.Lb({type:e,selectors:[["cd-select"]],inputs:{elemClass:"elemClass",data:"data",options:"options",messages:"messages",selectionLimit:"selectionLimit",customBadges:"customBadges",customBadgeValidators:"customBadgeValidators"},outputs:{selection:"selection"},features:[i.Bb],ngContentSelectors:L,decls:5,vars:3,consts:[["popTemplate",""],["class","select-menu-edit float-left","data-testid","select-menu-edit",3,"ngClass","ngbPopover",4,"ngIf"],["class","form-text text-muted float-left",4,"ngIf"],["class","form-text text-muted  float-left",4,"ngIf"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],["type","text","formControlName","filter",1,"form-control","text-center",3,"placeholder","keyup"],[4,"ngFor","ngForOf"],["class","select-menu-item",3,"ngClass","click",4,"ngFor","ngForOf"],["class","select-menu-item",3,"click",4,"ngIf"],["class","is-invalid",4,"ngIf"],["class","invalid-feedback text-center d-block",4,"ngIf"],[1,"invalid-feedback","text-center","d-block"],[1,"select-menu-item",3,"ngClass","click"],[1,"select-menu-item-icon"],["aria-hidden","true",3,"ngClass",4,"ngIf"],[1,"select-menu-item-content"],[4,"ngIf"],["aria-hidden","true",3,"ngClass"],[1,"form-text","text-muted"],[1,"select-menu-item",3,"click"],[1,"is-invalid"],["class","form-text text-muted text-center text-warning",3,"ngbTooltip",4,"ngIf"],[1,"form-text","text-muted","text-center","text-warning",3,"ngbTooltip"],["data-testid","select-menu-edit",1,"select-menu-edit","float-left",3,"ngClass","ngbPopover"],[1,"form-text","text-muted","float-left"]],template:function(e,t){1&e&&(i.tc(),i.Pc(0,T,8,6,"ng-template",null,0,i.Qc),i.Pc(2,M,2,2,"a",1),i.Pc(3,C,2,1,"span",2),i.Pc(4,O,2,1,"span",3)),2&e&&(i.Db(2),i.uc("ngIf",t.customBadges||t.options.length>0),i.Db(1),i.uc("ngIf",0===t.data.length&&!(!t.customBadges&&0===t.options.length)),i.Db(1),i.uc("ngIf",!t.customBadges&&0===t.options.length))},directives:[d.r,r.B,r.r,r.k,h.a,f.a,r.d,p.a,r.q,r.i,d.q,d.p,m.D,m.w],styles:[".select-menu-item[_ngcontent-%COMP%]{border-bottom:1px solid #00000017;cursor:pointer;display:block;font-size:1rem}.select-menu-item[_ngcontent-%COMP%]:hover{background-color:#e9ecef}.select-menu-item-icon[_ngcontent-%COMP%]{float:left;padding:.5em;width:3em}.select-menu-item-content[_ngcontent-%COMP%]{padding:.5em}.select-menu-item-content[_ngcontent-%COMP%]   .form-text[_ngcontent-%COMP%]{display:flex}"]}),e})()},"x+ZX":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(){return function(e){return e.lift(new s(e))}}class s{constructor(e){this.connectable=e}call(e,t){const{connectable:n}=this;n._refCount++;const i=new o(e,n),r=t.subscribe(i);return i.closed||(i.connection=n.connect()),r}}class o extends i.a{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:n}=this,i=e._connection;this.connection=null,!i||n&&i!==n||i.unsubscribe()}}},x38r:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=function(e){return e.bold="bold",e.sparkline="sparkline",e.perSecond="perSecond",e.checkIcon="checkIcon",e.routerLink="routerLink",e.executing="executing",e.classAdding="classAdding",e.badge="badge",e.map="map",e.truncate="truncate",e}({})},x6pH:function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"\u05d9\u05e0\u05d5\u05d0\u05e8_\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05d9\u05dc_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8_\u05e1\u05e4\u05d8\u05de\u05d1\u05e8_\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8_\u05e0\u05d5\u05d1\u05de\u05d1\u05e8_\u05d3\u05e6\u05de\u05d1\u05e8".split("_"),monthsShort:"\u05d9\u05e0\u05d5\u05f3_\u05e4\u05d1\u05e8\u05f3_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05f3_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05f3_\u05e1\u05e4\u05d8\u05f3_\u05d0\u05d5\u05e7\u05f3_\u05e0\u05d5\u05d1\u05f3_\u05d3\u05e6\u05de\u05f3".split("_"),weekdays:"\u05e8\u05d0\u05e9\u05d5\u05df_\u05e9\u05e0\u05d9_\u05e9\u05dc\u05d9\u05e9\u05d9_\u05e8\u05d1\u05d9\u05e2\u05d9_\u05d7\u05de\u05d9\u05e9\u05d9_\u05e9\u05d9\u05e9\u05d9_\u05e9\u05d1\u05ea".split("_"),weekdaysShort:"\u05d0\u05f3_\u05d1\u05f3_\u05d2\u05f3_\u05d3\u05f3_\u05d4\u05f3_\u05d5\u05f3_\u05e9\u05f3".split("_"),weekdaysMin:"\u05d0_\u05d1_\u05d2_\u05d3_\u05d4_\u05d5_\u05e9".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [\u05d1]MMMM YYYY",LLL:"D [\u05d1]MMMM YYYY HH:mm",LLLL:"dddd, D [\u05d1]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[\u05d4\u05d9\u05d5\u05dd \u05d1\u05be]LT",nextDay:"[\u05de\u05d7\u05e8 \u05d1\u05be]LT",nextWeek:"dddd [\u05d1\u05e9\u05e2\u05d4] LT",lastDay:"[\u05d0\u05ea\u05de\u05d5\u05dc \u05d1\u05be]LT",lastWeek:"[\u05d1\u05d9\u05d5\u05dd] dddd [\u05d4\u05d0\u05d7\u05e8\u05d5\u05df \u05d1\u05e9\u05e2\u05d4] LT",sameElse:"L"},relativeTime:{future:"\u05d1\u05e2\u05d5\u05d3 %s",past:"\u05dc\u05e4\u05e0\u05d9 %s",s:"\u05de\u05e1\u05e4\u05e8 \u05e9\u05e0\u05d9\u05d5\u05ea",ss:"%d \u05e9\u05e0\u05d9\u05d5\u05ea",m:"\u05d3\u05e7\u05d4",mm:"%d \u05d3\u05e7\u05d5\u05ea",h:"\u05e9\u05e2\u05d4",hh:function(e){return 2===e?"\u05e9\u05e2\u05ea\u05d9\u05d9\u05dd":e+" \u05e9\u05e2\u05d5\u05ea"},d:"\u05d9\u05d5\u05dd",dd:function(e){return 2===e?"\u05d9\u05d5\u05de\u05d9\u05d9\u05dd":e+" \u05d9\u05de\u05d9\u05dd"},M:"\u05d7\u05d5\u05d3\u05e9",MM:function(e){return 2===e?"\u05d7\u05d5\u05d3\u05e9\u05d9\u05d9\u05dd":e+" \u05d7\u05d5\u05d3\u05e9\u05d9\u05dd"},y:"\u05e9\u05e0\u05d4",yy:function(e){return 2===e?"\u05e9\u05e0\u05ea\u05d9\u05d9\u05dd":e%10==0&&10!==e?e+" \u05e9\u05e0\u05d4":e+" \u05e9\u05e0\u05d9\u05dd"}},meridiemParse:/\u05d0\u05d7\u05d4"\u05e6|\u05dc\u05e4\u05e0\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8|\u05d1\u05d1\u05d5\u05e7\u05e8|\u05d1\u05e2\u05e8\u05d1/i,isPM:function(e){return/^(\u05d0\u05d7\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05d1\u05e2\u05e8\u05d1)$/.test(e)},meridiem:function(e,t,n){return e<5?"\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8":e<10?"\u05d1\u05d1\u05d5\u05e7\u05e8":e<12?n?'\u05dc\u05e4\u05e0\u05d4"\u05e6':"\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":e<18?n?'\u05d0\u05d7\u05d4"\u05e6':"\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":"\u05d1\u05e2\u05e8\u05d1"}})}(n("wd/R"))},xDBR:function(e,t){e.exports=!1},xTzq:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var i=n("LvDl"),r=n.n(i);function s(...e){switch(e.length){case 1:return a.apply(void 0,e);case 3:return c.apply(void 0,e);default:throw new Error}}function o(e,t,n){const i=`__ignore_${t}`;Array.isArray(e[i])?e[i].push(n):e[i]=[n]}function a(e){for(const t of Object.getOwnPropertyNames(e.prototype)){const n=Object.getOwnPropertyDescriptor(e.prototype,t),i="constructor"===t;n.value instanceof Function&&!i&&(c(e.prototype,t,n),Object.defineProperty(e.prototype,t,n))}}function c(e,t,n){void 0===n&&(n=Object.getOwnPropertyDescriptor(e,t));const i=n.value;n.value=function(){const n=`__ignore_${t}`,s=e[n]||[],o=[];for(let e=0;e<arguments.length;e++)o[e]=r.a.isString(arguments[e])&&-1===s.indexOf(e)?encodeURIComponent(arguments[e]):arguments[e];const a=i.apply(this,o);return a}}},xbPD:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("7o/Q");function r(e=null){return t=>t.lift(new s(e))}class s{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new o(e,this.defaultValue))}}class o extends i.a{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}},xgIS:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("HDdC"),r=n("DH7j"),s=n("n6bG"),o=n("lJxs");function a(e,t,n,l){return Object(s.a)(n)&&(l=n,n=void 0),l?a(e,t,n).pipe(Object(o.a)(e=>Object(r.a)(e)?l(...e):l(e))):new i.a(i=>{c(e,t,function(e){i.next(arguments.length>1?Array.prototype.slice.call(arguments):e)},i,n)})}function c(e,t,n,i,r){let s;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){const i=e;e.addEventListener(t,n,r),s=()=>i.removeEventListener(t,n,r)}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){const i=e;e.on(t,n),s=()=>i.off(t,n)}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){const i=e;e.addListener(t,n),s=()=>i.removeListener(t,n)}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(let s=0,o=e.length;s<o;s++)c(e[s],t,n,i,r)}i.add(s)}},xluM:function(e,t){var n=Function.prototype.call;e.exports=n.bind?n.bind(n):function(){return n.apply(n,arguments)}},xrYK:function(e,t,n){var i=n("4zBA"),r=i({}.toString),s=i("".slice);e.exports=function(e){return s(r(e),8,-1)}},xs3f:function(e,t,n){var i=n("2oRo"),r=n("zk60"),s="__core-js_shared__",o=i[s]||r(s,{});e.exports=o},xutz:function(e,t,n){"use strict";(function(e){var i=n("XqMk"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===r&&i.a.process,a=function(){try{return s&&s.require&&s.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();t.a=a}).call(this,n("3UD+")(e))},yCtX:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("HDdC"),r=n("ngJS"),s=n("jZKg");function o(e,t){return t?Object(s.a)(e,t):new i.a(Object(r.a)(e))}},yGOH:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("8Y7J");let r=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({imports:[[]]}),e})()},yJti:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=function(e){return e[e.ValueOk=0]="ValueOk",e[e.ValueStale=1]="ValueStale",e[e.ValueNone=2]="ValueNone",e[e.ValueException=3]="ValueException",e}({})},yPMs:function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_N\xebntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_N\xebn_Dhj".split("_"),weekdays:"E Diel_E H\xebn\xeb_E Mart\xeb_E M\xebrkur\xeb_E Enjte_E Premte_E Shtun\xeb".split("_"),weekdaysShort:"Die_H\xebn_Mar_M\xebr_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_M\xeb_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot n\xeb] LT",nextDay:"[Nes\xebr n\xeb] LT",nextWeek:"dddd [n\xeb] LT",lastDay:"[Dje n\xeb] LT",lastWeek:"dddd [e kaluar n\xeb] LT",sameElse:"L"},relativeTime:{future:"n\xeb %s",past:"%s m\xeb par\xeb",s:"disa sekonda",ss:"%d sekonda",m:"nj\xeb minut\xeb",mm:"%d minuta",h:"nj\xeb or\xeb",hh:"%d or\xeb",d:"nj\xeb dit\xeb",dd:"%d dit\xeb",M:"nj\xeb muaj",MM:"%d muaj",y:"nj\xeb vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},yT6U:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n("LvDl"),r=n.n(i),s=n("8Y7J");let o=(()=>{class e{transform(e,t=!1){let n=e;return(!r.a.isArray(e)||r.a.isArray(e)&&t)&&(n=[e]),n}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=s.Qb({name:"array",type:e,pure:!0}),e})()},ylTp:function(e,t,n){"use strict";var i=n("Ju5/");t.a=i.a.Symbol},yoRg:function(e,t,n){var i=n("4zBA"),r=n("Gi26"),s=n("/GqU"),o=n("TWQb").indexOf,a=n("0BK2"),c=i([].push);e.exports=function(e,t){var n,i=s(e),l=0,u=[];for(n in i)!r(a,n)&&r(i,n)&&c(u,n);for(;t.length>l;)r(i,n=t[l++])&&(~o(u,n)||c(u,n));return u}},"z+Ro":function(e,t,n){"use strict";function i(e){return e&&"function"==typeof e.schedule}n.d(t,"a",function(){return i})},z1FC:function(e,t,n){!function(e){"use strict";function t(e,t,n,i){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n m\xedut","'iens m\xedut"],mm:[e+" m\xeduts",e+" m\xeduts"],h:["'n \xfeora","'iensa \xfeora"],hh:[e+" \xfeoras",e+" \xfeoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return i||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Mar\xe7_Avr\xefu_Mai_G\xfcn_Julia_Guscht_Setemvar_Listop\xe4ts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_G\xfcn_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"S\xfaladi_L\xfane\xe7i_Maitzi_M\xe1rcuri_Xh\xfaadi_Vi\xe9ner\xe7i_S\xe1turi".split("_"),weekdaysShort:"S\xfal_L\xfan_Mai_M\xe1r_Xh\xfa_Vi\xe9_S\xe1t".split("_"),weekdaysMin:"S\xfa_L\xfa_Ma_M\xe1_Xh_Vi_S\xe1".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi \xe0] LT",nextDay:"[dem\xe0 \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[ieiri \xe0] LT",lastWeek:"[s\xfcr el] dddd [lasteu \xe0] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z3Vd:function(e,t,n){!function(e){"use strict";var t="pagh_wa\u2019_cha\u2019_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,i,r){var s=function(e){var n=Math.floor(e%1e3/100),i=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),i>0&&(s+=(""!==s?" ":"")+t[i]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(i){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera\u2019 jar wa\u2019_tera\u2019 jar cha\u2019_tera\u2019 jar wej_tera\u2019 jar loS_tera\u2019 jar vagh_tera\u2019 jar jav_tera\u2019 jar Soch_tera\u2019 jar chorgh_tera\u2019 jar Hut_tera\u2019 jar wa\u2019maH_tera\u2019 jar wa\u2019maH wa\u2019_tera\u2019 jar wa\u2019maH cha\u2019".split("_"),monthsShort:"jar wa\u2019_jar cha\u2019_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa\u2019maH_jar wa\u2019maH wa\u2019_jar wa\u2019maH cha\u2019".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa\u2019leS] LT",nextWeek:"LLL",lastDay:"[wa\u2019Hu\u2019] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu\u2019":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa\u2019 tup",mm:n,h:"wa\u2019 rep",hh:n,d:"wa\u2019 jaj",dd:n,M:"wa\u2019 jar",MM:n,y:"wa\u2019 DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z6cu:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n("HDdC");function r(e,t){return new i.a(t?n=>t.schedule(s,0,{error:e,subscriber:n}):t=>t.error(e))}function s({error:e,subscriber:t}){t.error(e)}},zBJ4:function(e,t,n){var i=n("2oRo"),r=n("hh1v"),s=i.document,o=r(s)&&r(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},zKZe:function(e,t,n){var i=n("I+eb"),r=n("YNrV");i({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},zNnC:function(e,t,n){"use strict";n.d(t,"a",function(){return i});class i{getVersionHeaderValue(e,t){return`application/vnd.ceph.api.v${e}.${t}+json`}}},zUnb:function(e,t,n){"use strict";n.r(t);var i=n("cUpR"),r=n("8Y7J"),s=n("SVse"),o=n("IheW"),a=n("GS7A");function c(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function l(e){switch(e.length){case 0:return new a.d;case 1:return e[0];default:return new a.k(e)}}function u(e,t,n,i,r={},s={}){const o=[],c=[];let l=-1,u=null;if(i.forEach(e=>{const n=e.offset,i=n==l,d=i&&u||{};Object.keys(e).forEach(n=>{let i=n,c=e[n];if("offset"!==n)switch(i=t.normalizePropertyName(i,o),c){case a.l:c=r[n];break;case a.a:c=s[n];break;default:c=t.normalizeStyleValue(n,i,c,o)}d[i]=c}),i||c.push(d),u=d,l=n}),o.length){const e="\n - ";throw new Error(`Unable to animate due to the following errors:${e}${o.join(e)}`)}return c}function d(e,t,n,i){switch(t){case"start":e.onStart(()=>i(n&&h(n,"start",e)));break;case"done":e.onDone(()=>i(n&&h(n,"done",e)));break;case"destroy":e.onDestroy(()=>i(n&&h(n,"destroy",e)))}}function h(e,t,n){const i=n.totalTime,r=f(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==i?e.totalTime:i,!!n.disabled),s=e._data;return null!=s&&(r._data=s),r}function f(e,t,n,i,r="",s=0,o){return{element:e,triggerName:t,fromState:n,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function p(e,t,n){let i;return e instanceof Map?(i=e.get(t),i||e.set(t,i=n)):(i=e[t],i||(i=e[t]=n)),i}function m(e){const t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}let b=(e,t)=>!1,g=(e,t)=>!1,_=(e,t,n)=>[];const v=c();(v||"undefined"!=typeof Element)&&(b=(e,t)=>e.contains(t),g=(()=>{if(v||Element.prototype.matches)return(e,t)=>e.matches(t);{const e=Element.prototype,t=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;return t?(e,n)=>t.apply(e,[n]):g}})(),_=(e,t,n)=>{let i=[];if(n){const n=e.querySelectorAll(t);for(let e=0;e<n.length;e++)i.push(n[e])}else{const n=e.querySelector(t);n&&i.push(n)}return i});let y=null,w=!1;function D(e){y||(y=("undefined"!=typeof document?document.body:null)||{},w=!!y.style&&"WebkitAppearance"in y.style);let t=!0;return y.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in y.style,!t&&w)&&(t="Webkit"+e.charAt(0).toUpperCase()+e.substr(1)in y.style),t}const S=g,x=b,k=_;function T(e){const t={};return Object.keys(e).forEach(n=>{const i=n.replace(/([a-z])([A-Z])/g,"$1-$2");t[i]=e[n]}),t}let M=(()=>{class e{validateStyleProperty(e){return D(e)}matchesElement(e,t){return S(e,t)}containsElement(e,t){return x(e,t)}query(e,t,n){return k(e,t,n)}computeStyle(e,t,n){return n||""}animate(e,t,n,i,r,s=[],o){return new a.d(n,i)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),C=(()=>{class e{}return e.NOOP=new M,e})();const O="ng-enter",L="ng-leave",E="ng-trigger",A=".ng-trigger",I="ng-animating",R=".ng-animating";function P(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:F(parseFloat(t[1]),t[2])}function F(e,t){switch(t){case"s":return 1e3*e;default:return e}}function W(e,t,n){return e.hasOwnProperty("duration")?e:function(e,t,n){let i,r=0,s="";if("string"==typeof e){const n=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===n)return t.push(`The provided timing value "${e}" is invalid.`),{duration:0,delay:0,easing:""};i=F(parseFloat(n[1]),n[2]);const o=n[3];null!=o&&(r=F(parseFloat(o),n[4]));const a=n[5];a&&(s=a)}else i=e;if(!n){let n=!1,s=t.length;i<0&&(t.push("Duration values below 0 are not allowed for this animation step."),n=!0),r<0&&(t.push("Delay values below 0 are not allowed for this animation step."),n=!0),n&&t.splice(s,0,`The provided timing value "${e}" is invalid.`)}return{duration:i,delay:r,easing:s}}(e,t,n)}function j(e,t={}){return Object.keys(e).forEach(n=>{t[n]=e[n]}),t}function Y(e,t,n={}){if(t)for(let i in e)n[i]=e[i];else j(e,n);return n}function N(e,t,n){return n?t+":"+n+";":""}function z(e){let t="";for(let n=0;n<e.style.length;n++){const i=e.style.item(n);t+=N(0,i,e.style.getPropertyValue(i))}for(const n in e.style)e.style.hasOwnProperty(n)&&!n.startsWith("_")&&(t+=N(0,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.style[n]));e.setAttribute("style",t)}function $(e,t,n){e.style&&(Object.keys(t).forEach(i=>{const r=J(i);n&&!n.hasOwnProperty(i)&&(n[i]=e.style[r]),e.style[r]=t[i]}),c()&&z(e))}function H(e,t){e.style&&(Object.keys(t).forEach(t=>{const n=J(t);e.style[n]=""}),c()&&z(e))}function X(e){return Array.isArray(e)?1==e.length?e[0]:Object(a.f)(e):e}const V=new RegExp("{{\\s*(.+?)\\s*}}","g");function B(e){let t=[];if("string"==typeof e){let n;for(;n=V.exec(e);)t.push(n[1]);V.lastIndex=0}return t}function U(e,t,n){const i=e.toString(),r=i.replace(V,(e,i)=>{let r=t[i];return t.hasOwnProperty(i)||(n.push(`Please provide a value for the animation param ${i}`),r=""),r.toString()});return r==i?e:r}function q(e){const t=[];let n=e.next();for(;!n.done;)t.push(n.value),n=e.next();return t}const G=/-+([a-z0-9])/g;function J(e){return e.replace(G,(...e)=>e[1].toUpperCase())}function K(e,t){return 0===e||0===t}function Q(e,t,n){const i=Object.keys(n);if(i.length&&t.length){let s=t[0],o=[];if(i.forEach(e=>{s.hasOwnProperty(e)||o.push(e),s[e]=n[e]}),o.length)for(var r=1;r<t.length;r++){let n=t[r];o.forEach(function(t){n[t]=ee(e,t)})}}return t}function Z(e,t,n){switch(t.type){case 7:return e.visitTrigger(t,n);case 0:return e.visitState(t,n);case 1:return e.visitTransition(t,n);case 2:return e.visitSequence(t,n);case 3:return e.visitGroup(t,n);case 4:return e.visitAnimate(t,n);case 5:return e.visitKeyframes(t,n);case 6:return e.visitStyle(t,n);case 8:return e.visitReference(t,n);case 9:return e.visitAnimateChild(t,n);case 10:return e.visitAnimateRef(t,n);case 11:return e.visitQuery(t,n);case 12:return e.visitStagger(t,n);default:throw new Error(`Unable to resolve animation metadata node #${t.type}`)}}function ee(e,t){return window.getComputedStyle(e)[t]}const te="*";function ne(e,t){const n=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(e=>function(e,t,n){if(":"==e[0]){const i=function(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return t.push(`The transition alias value "${e}" is not supported`),"* => *"}}(e,n);if("function"==typeof i)return void t.push(i);e=i}const i=e.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push(`The provided transition expression "${e}" is not supported`),t;const r=i[1],s=i[2],o=i[3];t.push(se(r,o)),"<"!=s[0]||r==te&&o==te||t.push(se(o,r))}(e,n,t)):n.push(e),n}const ie=new Set(["true","1"]),re=new Set(["false","0"]);function se(e,t){const n=ie.has(e)||re.has(e),i=ie.has(t)||re.has(t);return(r,s)=>{let o=e==te||e==r,a=t==te||t==s;return!o&&n&&"boolean"==typeof r&&(o=r?ie.has(e):re.has(e)),!a&&i&&"boolean"==typeof s&&(a=s?ie.has(t):re.has(t)),o&&a}}const oe=new RegExp("s*:selfs*,?","g");function ae(e,t,n){return new ce(e).build(t,n)}class ce{constructor(e){this._driver=e}build(e,t){const n=new le(t);return this._resetContextStyleTimingState(n),Z(this,X(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0;const r=[],s=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(e=>{if(this._resetContextStyleTimingState(t),0==e.type){const n=e,i=n.name;i.toString().split(/\s*,\s*/).forEach(e=>{n.name=e,r.push(this.visitState(n,t))}),n.name=i}else if(1==e.type){const r=this.visitTransition(e,t);n+=r.queryCount,i+=r.depCount,s.push(r)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:r,transitions:s,queryCount:n,depCount:i,options:null}}visitState(e,t){const n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){const r=new Set,s=i||{};if(n.styles.forEach(e=>{if(ue(e)){const t=e;Object.keys(t).forEach(e=>{B(t[e]).forEach(e=>{s.hasOwnProperty(e)||r.add(e)})})}}),r.size){const n=q(r.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${n.join(", ")}`)}}return{type:0,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const n=Z(this,X(e.animation),t);return{type:1,matchers:ne(e.expr,t.errors),animation:n,queryCount:t.queryCount,depCount:t.depCount,options:de(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(e=>Z(this,e,t)),options:de(e.options)}}visitGroup(e,t){const n=t.currentTime;let i=0;const r=e.steps.map(e=>{t.currentTime=n;const r=Z(this,e,t);return i=Math.max(i,t.currentTime),r});return t.currentTime=i,{type:3,steps:r,options:de(e.options)}}visitAnimate(e,t){const n=function(e,t){let n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return he(W(e,t).duration,0,"");const i=e;if(i.split(/\s+/).some(e=>"{"==e.charAt(0)&&"{"==e.charAt(1))){const e=he(0,0,"");return e.dynamic=!0,e.strValue=i,e}return n=n||W(i,t),he(n.duration,n.delay,n.easing)}(e.timings,t.errors);let i;t.currentAnimateTimings=n;let r=e.styles?e.styles:Object(a.h)({});if(5==r.type)i=this.visitKeyframes(r,t);else{let r=e.styles,s=!1;if(!r){s=!0;const e={};n.easing&&(e.easing=n.easing),r=Object(a.h)(e)}t.currentTime+=n.duration+n.delay;const o=this.visitStyle(r,t);o.isEmptyStep=s,i=o}return t.currentAnimateTimings=null,{type:4,timings:n,style:i,options:null}}visitStyle(e,t){const n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){const n=[];Array.isArray(e.styles)?e.styles.forEach(e=>{"string"==typeof e?e==a.a?n.push(e):t.errors.push(`The provided style string value ${e} is not allowed.`):n.push(e)}):n.push(e.styles);let i=!1,r=null;return n.forEach(e=>{if(ue(e)){const t=e,n=t.easing;if(n&&(r=n,delete t.easing),!i)for(let e in t)if(t[e].toString().indexOf("{{")>=0){i=!0;break}}}),{type:6,styles:n,easing:r,offset:e.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(e,t){const n=t.currentAnimateTimings;let i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.delay),e.styles.forEach(e=>{"string"!=typeof e&&Object.keys(e).forEach(n=>{if(!this._driver.validateStyleProperty(n))return void t.errors.push(`The provided animation property "${n}" is not a supported CSS property for animations`);const s=t.collectedStyles[t.currentQuerySelector],o=s[n];let a=!0;o&&(r!=i&&r>=o.startTime&&i<=o.endTime&&(t.errors.push(`The CSS property "${n}" that exists between the times of "${o.startTime}ms" and "${o.endTime}ms" is also being animated in a parallel animation between the times of "${r}ms" and "${i}ms"`),a=!1),r=o.startTime),a&&(s[n]={startTime:r,endTime:i}),t.options&&function(e,t,n){const i=t.params||{},r=B(e);r.length&&r.forEach(e=>{i.hasOwnProperty(e)||n.push(`Unable to resolve the local animation param ${e} in the given list of values`)})}(e[n],t.options,t.errors)})})}visitKeyframes(e,t){const n={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),n;let i=0;const r=[];let s=!1,o=!1,a=0;const c=e.steps.map(e=>{const n=this._makeStyleAst(e,t);let c=null!=n.offset?n.offset:function(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(e=>{if(ue(e)&&e.hasOwnProperty("offset")){const n=e;t=parseFloat(n.offset),delete n.offset}});else if(ue(e)&&e.hasOwnProperty("offset")){const n=e;t=parseFloat(n.offset),delete n.offset}return t}(n.styles),l=0;return null!=c&&(i++,l=n.offset=c),o=o||l<0||l>1,s=s||l<a,a=l,r.push(l),n});o&&t.errors.push("Please ensure that all keyframe offsets are between 0 and 1"),s&&t.errors.push("Please ensure that all keyframe offsets are in order");const l=e.steps.length;let u=0;i>0&&i<l?t.errors.push("Not all style() steps within the declared keyframes() contain offsets"):0==i&&(u=1/(l-1));const d=l-1,h=t.currentTime,f=t.currentAnimateTimings,p=f.duration;return c.forEach((e,i)=>{const s=u>0?i==d?1:u*i:r[i],o=s*p;t.currentTime=h+f.delay+o,f.duration=o,this._validateStyleAst(e,t),e.offset=s,n.styles.push(e)}),n}visitReference(e,t){return{type:8,animation:Z(this,X(e.animation),t),options:de(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:de(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:de(e.options)}}visitQuery(e,t){const n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[r,s]=function(e){const t=!!e.split(/\s*,\s*/).find(e=>":self"==e);return t&&(e=e.replace(oe,"")),[e=e.replace(/@\*/g,A).replace(/@\w+/g,e=>".ng-trigger-"+e.substr(1)).replace(/:animating/g,R),t]}(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,p(t.collectedStyles,t.currentQuerySelector,{});const o=Z(this,X(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:o,originalSelector:e.selector,options:de(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const n="full"===e.timings?{duration:0,delay:0,easing:"full"}:W(e.timings,t.errors,!0);return{type:12,animation:Z(this,X(e.animation),t),timings:n,options:null}}}class le{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function ue(e){return!Array.isArray(e)&&"object"==typeof e}function de(e){var t;return e?(e=j(e)).params&&(e.params=(t=e.params)?j(t):null):e={},e}function he(e,t,n){return{duration:e,delay:t,easing:n}}function fe(e,t,n,i,r,s,o=null,a=!1){return{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class pe{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const me=new RegExp(":enter","g"),be=new RegExp(":leave","g");function ge(e,t,n,i,r,s={},o={},a,c,l=[]){return(new _e).buildKeyframes(e,t,n,i,r,s,o,a,c,l)}class _e{buildKeyframes(e,t,n,i,r,s,o,a,c,l=[]){c=c||new pe;const u=new ye(e,t,c,i,r,l,[]);u.options=a,u.currentTimeline.setStyles([s],null,u.errors,a),Z(this,n,u);const d=u.timelines.filter(e=>e.containsAnimation());if(d.length&&Object.keys(o).length){const e=d[d.length-1];e.allowOnlyTimelineStyles()||e.setStyles([o],null,u.errors,a)}return d.length?d.map(e=>e.buildKeyframes()):[fe(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const n=t.subInstructions.consume(t.element);if(n){const i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,s=this._visitSubInstructions(n,i,i.options);r!=s&&t.transformIntoNewTimeline(s)}t.previousNode=e}visitAnimateRef(e,t){const n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,n){let i=t.currentTimeline.currentTime;const r=null!=n.duration?P(n.duration):null,s=null!=n.delay?P(n.delay):null;return 0!==r&&e.forEach(e=>{const n=t.appendInstructionToTimeline(e,r,s);i=Math.max(i,n.duration+n.delay)}),i}visitReference(e,t){t.updateOptions(e.options,!0),Z(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const n=t.subContextCount;let i=t;const r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),null!=r.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ve);const e=P(r.delay);i.delayNextStep(e)}e.steps.length&&(e.steps.forEach(e=>Z(this,e,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const n=[];let i=t.currentTimeline.currentTime;const r=e.options&&e.options.delay?P(e.options.delay):0;e.steps.forEach(s=>{const o=t.createSubContext(e.options);r&&o.delayNextStep(r),Z(this,s,o),i=Math.max(i,o.currentTimeline.currentTime),n.push(o.currentTimeline)}),n.forEach(e=>t.currentTimeline.mergeTimelineCollectedStyles(e)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const n=e.strValue;return W(t.params?U(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());const r=e.style;5==r.type?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.getCurrentStyleProperties().length&&n.forwardFrame();const r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,s=t.createSubContext().currentTimeline;s.easing=n.easing,e.styles.forEach(e=>{s.forwardTime((e.offset||0)*r),s.setStyles(e.styles,e.easing,t.errors,t.options),s.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(s),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){const n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?P(i.delay):0;r&&(6===t.previousNode.type||0==n&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=ve);let s=n;const o=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=o.length;let a=null;o.forEach((n,i)=>{t.currentQueryIndex=i;const o=t.createSubContext(e.options,n);r&&o.delayNextStep(r),n===t.element&&(a=o.currentTimeline),Z(this,e.animation,o),o.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,o.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),a&&(t.currentTimeline.mergeTimelineCollectedStyles(a),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const n=t.parentContext,i=t.currentTimeline,r=e.timings,s=Math.abs(r.duration),o=s*(t.currentQueryTotal-1);let a=s*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":a=o-a;break;case"full":a=n.currentStaggerTime}const c=t.currentTimeline;a&&c.delayNextStep(a);const l=c.currentTime;Z(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-l+(i.startTime-n.currentTimeline.startTime)}}const ve={};class ye{constructor(e,t,n,i,r,s,o,a){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=s,this.timelines=o,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=ve,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=a||new we(this._driver,t,0),o.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const n=e;let i=this.options;null!=n.duration&&(i.duration=P(n.duration)),null!=n.delay&&(i.delay=P(n.delay));const r=n.params;if(r){let e=i.params;e||(e=this.options.params={}),Object.keys(r).forEach(n=>{t&&e.hasOwnProperty(n)||(e[n]=U(r[n],e,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const n=e.params={};Object.keys(t).forEach(e=>{n[e]=t[e]})}}return e}createSubContext(e=null,t,n){const i=t||this.element,r=new ye(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){const i={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},r=new De(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,i,r,s){let o=[];if(i&&o.push(this.element),e.length>0){e=(e=e.replace(me,"."+this._enterClassName)).replace(be,"."+this._leaveClassName);let t=this._driver.query(this.element,e,1!=n);0!==n&&(t=n<0?t.slice(t.length+n,t.length):t.slice(0,n)),o.push(...t)}return r||0!=o.length||s.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),o}}class we{constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new we(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(e=>{this._backFill[e]=this._globalTimelineStyles[e]||a.a,this._currentKeyframe[e]=a.a}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&(this._previousKeyframe.easing=t);const r=i&&i.params||{},s=function(e,t){const n={};let i;return e.forEach(e=>{"*"===e?(i=i||Object.keys(t),i.forEach(e=>{n[e]=a.a})):Y(e,!1,n)}),n}(e,this._globalTimelineStyles);Object.keys(s).forEach(e=>{const t=U(s[e],r,n);this._pendingStyles[e]=t,this._localTimelineStyles.hasOwnProperty(e)||(this._backFill[e]=this._globalTimelineStyles.hasOwnProperty(e)?this._globalTimelineStyles[e]:a.a),this._updateStyle(e,t)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(t=>{this._currentKeyframe[t]=e[t]}),Object.keys(this._localTimelineStyles).forEach(e=>{this._currentKeyframe.hasOwnProperty(e)||(this._currentKeyframe[e]=this._localTimelineStyles[e])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const n=this._styleSummary[t],i=e._styleSummary[t];(!n||i.time>n.time)&&this._updateStyle(t,i.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,n=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((r,s)=>{const o=Y(r,!0);Object.keys(o).forEach(n=>{const i=o[n];i==a.l?e.add(n):i==a.a&&t.add(n)}),n||(o.offset=s/this.duration),i.push(o)});const r=e.size?q(e.values()):[],s=t.size?q(t.values()):[];if(n){const e=i[0],t=j(e);e.offset=0,t.offset=1,i=[e,t]}return fe(this.element,i,r,s,this.duration,this.startTime,this.easing,!1)}}class De extends we{constructor(e,t,n,i,r,s,o=!1){super(e,t,s.delay),this.element=t,this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=o,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const r=[],s=n+t,o=t/s,a=Y(e[0],!1);a.offset=0,r.push(a);const c=Y(e[0],!1);c.offset=Se(o),r.push(c);const l=e.length-1;for(let i=1;i<=l;i++){let o=Y(e[i],!1);o.offset=Se((t+o.offset*n)/s),r.push(o)}n=s,t=0,i="",e=r}return fe(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}}function Se(e,t=3){const n=Math.pow(10,t-1);return Math.round(e*n)/n}class xe{}class ke extends xe{normalizePropertyName(e,t){return J(e)}normalizeStyleValue(e,t,n,i){let r="";const s=n.toString().trim();if(Te[t]&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const t=n.match(/^[+-]?[\d\.]+([a-z]*)$/);t&&0==t[1].length&&i.push(`Please provide a CSS unit value for ${e}:${n}`)}return s+r}}const Te=(()=>function(e){const t={};return e.forEach(e=>t[e]=!0),t}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function Me(e,t,n,i,r,s,o,a,c,l,u,d,h){return{type:0,element:e,triggerName:t,isRemovalTransition:r,fromState:n,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:c,preStyleProps:l,postStyleProps:u,totalTime:d,errors:h}}const Ce={};class Oe{constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return function(e,t,n,i,r){return e.some(e=>e(t,n,i,r))}(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){const i=this._stateStyles["*"],r=this._stateStyles[e],s=i?i.buildStyles(t,n):{};return r?r.buildStyles(t,n):s}build(e,t,n,i,r,s,o,a,c,l){const u=[],d=this.ast.options&&this.ast.options.params||Ce,h=this.buildStyles(n,o&&o.params||Ce,u),f=a&&a.params||Ce,m=this.buildStyles(i,f,u),b=new Set,g=new Map,_=new Map,v="void"===i,y={params:Object.assign(Object.assign({},d),f)},w=l?[]:ge(e,t,this.ast.animation,r,s,h,m,y,c,u);let D=0;if(w.forEach(e=>{D=Math.max(e.duration+e.delay,D)}),u.length)return Me(t,this._triggerName,n,i,v,h,m,[],[],g,_,D,u);w.forEach(e=>{const n=e.element,i=p(g,n,{});e.preStyleProps.forEach(e=>i[e]=!0);const r=p(_,n,{});e.postStyleProps.forEach(e=>r[e]=!0),n!==t&&b.add(n)});const S=q(b.values());return Me(t,this._triggerName,n,i,v,h,m,w,S,g,_,D)}}class Le{constructor(e,t){this.styles=e,this.defaultParams=t}buildStyles(e,t){const n={},i=j(this.defaultParams);return Object.keys(e).forEach(t=>{const n=e[t];null!=n&&(i[t]=n)}),this.styles.styles.forEach(e=>{if("string"!=typeof e){const r=e;Object.keys(r).forEach(e=>{let s=r[e];s.length>1&&(s=U(s,i,t)),n[e]=s})}}),n}}class Ee{constructor(e,t){this.name=e,this.ast=t,this.transitionFactories=[],this.states={},t.states.forEach(e=>{this.states[e.name]=new Le(e.style,e.options&&e.options.params||{})}),Ae(this.states,"true","1"),Ae(this.states,"false","0"),t.transitions.forEach(t=>{this.transitionFactories.push(new Oe(e,t,this.states))}),this.fallbackTransition=new Oe(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[(e,t)=>!0],options:null,queryCount:0,depCount:0},this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(r=>r.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}}function Ae(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}const Ie=new pe;class Re{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}register(e,t){const n=[],i=ae(this._driver,t,n);if(n.length)throw new Error(`Unable to build the animation due to the following errors: ${n.join("\n")}`);this._animations[e]=i}_buildPlayer(e,t,n){const i=e.element,r=u(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){const i=[],r=this._animations[e];let s;const o=new Map;if(r?(s=ge(this._driver,t,r,O,L,{},{},n,Ie,i),s.forEach(e=>{const t=p(o,e.element,{});e.postStyleProps.forEach(e=>t[e]=null)})):(i.push("The requested animation doesn't exist or has already been destroyed"),s=[]),i.length)throw new Error(`Unable to create the animation due to the following errors: ${i.join("\n")}`);o.forEach((e,t)=>{Object.keys(e).forEach(n=>{e[n]=this._driver.computeStyle(t,n,a.a)})});const c=l(s.map(e=>{const t=o.get(e.element);return this._buildPlayer(e,{},t)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,n,i){const r=f(t,"","","");return d(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if("register"==n)return void this.register(e,i[0]);if("create"==n)return void this.create(e,t,i[0]||{});const r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e)}}}const Pe="ng-animate-queued",Fe="ng-animate-disabled",We=".ng-animate-disabled",je=[],Ye={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ne={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0};class ze{constructor(e,t=""){this.namespaceId=t;const n=e&&e.hasOwnProperty("value");if(this.value=null!=(i=n?e.value:e)?i:null,n){const t=j(e);delete t.value,this.options=t}else this.options={};var i;this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const e=this.options.params;Object.keys(t).forEach(n=>{null==e[n]&&(e[n]=t[n])})}}}const $e="void",He=new ze($e);class Xe{constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,Ke(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${n}" because the animation trigger "${t}" doesn't exist!`);if(null==n||0==n.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if("start"!=(r=n)&&"done"!=r)throw new Error(`The provided animation trigger event "${n}" for the animation trigger "${t}" is not supported!`);var r;const s=p(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};s.push(o);const a=p(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(Ke(e,E),Ke(e,"ng-trigger-"+t),a[t]=He),()=>{this._engine.afterFlush(()=>{const e=s.indexOf(o);e>=0&&s.splice(e,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,n,i=!0){const r=this._getTrigger(t),s=new Be(this.id,t,e);let o=this._engine.statesByElement.get(e);o||(Ke(e,E),Ke(e,"ng-trigger-"+t),this._engine.statesByElement.set(e,o={}));let a=o[t];const c=new ze(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&a&&c.absorbOptions(a.options),o[t]=c,a||(a=He),c.value!==$e&&a.value===c.value){if(!function(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!=i.length)return!1;for(let r=0;r<n.length;r++){const i=n[r];if(!t.hasOwnProperty(i)||e[i]!==t[i])return!1}return!0}(a.params,c.params)){const t=[],n=r.matchStyles(a.value,a.params,t),i=r.matchStyles(c.value,c.params,t);t.length?this._engine.reportError(t):this._engine.afterFlush(()=>{H(e,n),$(e,i)})}return}const l=p(this._engine.playersByElement,e,[]);l.forEach(e=>{e.namespaceId==this.id&&e.triggerName==t&&e.queued&&e.destroy()});let u=r.matchTransition(a.value,c.value,e,c.params),d=!1;if(!u){if(!i)return;u=r.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:u,fromState:a,toState:c,player:s,isFallbackTransition:d}),d||(Ke(e,Pe),s.onStart(()=>{Qe(e,Pe)})),s.onDone(()=>{let t=this.players.indexOf(s);t>=0&&this.players.splice(t,1);const n=this._engine.playersByElement.get(e);if(n){let e=n.indexOf(s);e>=0&&n.splice(e,1)}}),this.players.push(s),l.push(s),s}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,n)=>{delete t[e]}),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(t=>t.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(e=>e.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const n=this._engine.driver.query(e,A,!0);n.forEach(e=>{if(e.__ng_removed)return;const n=this._engine.fetchNamespacesByElement(e);n.size?n.forEach(n=>n.triggerLeaveAnimation(e,t,!1,!0)):this.clearElementCache(e)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(e=>this.clearElementCache(e)))}triggerLeaveAnimation(e,t,n,i){const r=this._engine.statesByElement.get(e);if(r){const s=[];if(Object.keys(r).forEach(t=>{if(this._triggers[t]){const n=this.trigger(e,t,$e,i);n&&s.push(n)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),n&&l(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){const i=new Set;t.forEach(t=>{const r=t.name;if(i.has(r))return;i.add(r);const s=this._triggers[r].fallbackTransition,o=n[r]||He,a=new ze($e),c=new Be(this.id,r,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:r,transition:s,fromState:o,toState:a,player:c,isFallbackTransition:!0})})}}removeNode(e,t){const n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){const t=n.players.length?n.playersByQueriedElement.get(e):[];if(t&&t.length)i=!0;else{let t=e;for(;t=t.parentNode;)if(n.statesByElement.get(t)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{const i=e.__ng_removed;i&&i!==Ye||(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){Ke(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(n=>{const i=n.player;if(i.destroyed)return;const r=n.element,s=this._elementListeners.get(r);s&&s.forEach(t=>{if(t.name==n.triggerName){const i=f(r,n.triggerName,n.fromState.value,n.toState.value);i._data=e,d(n.player,t.phase,i,t.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((e,t)=>{const n=e.transition.ast.depCount,i=t.transition.ast.depCount;return 0==n||0==i?n-i:this._engine.driver.containsElement(e.element,t.element)?1:-1})}destroy(e){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(t=>t.element===e)||t,t}}class Ve{constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(e,t)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(t=>{t.queued&&e.push(t)})}),e}createNamespace(e,t){const n=new Xe(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){const n=this._namespaceList.length-1;if(n>=0){let i=!1;for(let r=n;r>=0;r--)if(this.driver.containsElement(this._namespaceList[r].hostElement,t)){this._namespaceList.splice(r+1,0,e),i=!0;break}i||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){if(!e)return;const n=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(n.hostElement),delete this._namespaceLookup[e];const t=this._namespaceList.indexOf(n);t>=0&&this._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(()=>n.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,n=this.statesByElement.get(e);if(n){const e=Object.keys(n);for(let i=0;i<e.length;i++){const r=n[e[i]].namespaceId;if(r){const e=this._fetchNamespace(r);e&&t.add(e)}}}return t}trigger(e,t,n,i){if(Ue(t)){const r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!Ue(t))return;const r=t.__ng_removed;if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;const e=this.collectedLeaveElements.indexOf(t);e>=0&&this.collectedLeaveElements.splice(e,1)}if(e){const i=this._fetchNamespace(e);i&&i.insertNode(t,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),Ke(e,Fe)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Qe(e,Fe))}removeNode(e,t,n,i){if(Ue(t)){const r=e?this._fetchNamespace(e):null;if(r?r.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i),n){const n=this.namespacesByHostElement.get(t);n&&n.id!==e&&n.removeNode(t,i)}}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,n,i){this.collectedLeaveElements.push(t),t.__ng_removed={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1}}listen(e,t,n,i,r){return Ue(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,A,!0);t.forEach(e=>this.destroyActiveAnimationsForElement(e)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,R,!0),t.forEach(e=>this.finishActiveQueriedAnimationOnElement(e)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(e=>{e.queued?e.markedForDestroy=!0:e.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(e=>e.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return l(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e.__ng_removed;if(t&&t.setForRemoval){if(e.__ng_removed=Ye,t.namespaceId){this.destroyInnerAnimations(e);const n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,We)&&this.markElementAsDisabled(e,!1),this.driver.query(e,We,!0).forEach(e=>{this.markElementAsDisabled(e,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((e,t)=>this._balanceNamespaceList(e,t)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++)Ke(this.collectedEnterElements[n],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const n=[];try{t=this._flushAnimations(n,e)}finally{for(let e=0;e<n.length;e++)n[e]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++)this.processLeaveNode(this.collectedLeaveElements[n]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(e=>e()),this._flushFns=[],this._whenQuietFns.length){const e=this._whenQuietFns;this._whenQuietFns=[],t.length?l(t).onDone(()=>{e.forEach(e=>e())}):e.forEach(e=>e())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const n=new pe,i=[],r=new Map,s=[],o=new Map,c=new Map,u=new Map,d=new Set;this.disabledNodes.forEach(e=>{d.add(e);const t=this.driver.query(e,".ng-animate-queued",!0);for(let n=0;n<t.length;n++)d.add(t[n])});const h=this.bodyNode,f=Array.from(this.statesByElement.keys()),m=Je(f,this.collectedEnterElements),b=new Map;let g=0;m.forEach((e,t)=>{const n=O+g++;b.set(t,n),e.forEach(e=>Ke(e,n))});const _=[],v=new Set,y=new Set;for(let a=0;a<this.collectedLeaveElements.length;a++){const e=this.collectedLeaveElements[a],t=e.__ng_removed;t&&t.setForRemoval&&(_.push(e),v.add(e),t.hasAnimation?this.driver.query(e,".ng-star-inserted",!0).forEach(e=>v.add(e)):y.add(e))}const w=new Map,D=Je(f,Array.from(v));D.forEach((e,t)=>{const n=L+g++;w.set(t,n),e.forEach(e=>Ke(e,n))}),e.push(()=>{m.forEach((e,t)=>{const n=b.get(t);e.forEach(e=>Qe(e,n))}),D.forEach((e,t)=>{const n=w.get(t);e.forEach(e=>Qe(e,n))}),_.forEach(e=>{this.processLeaveNode(e)})});const S=[],x=[];for(let a=this._namespaceList.length-1;a>=0;a--)this._namespaceList[a].drainQueuedTransitions(t).forEach(e=>{const t=e.player,r=e.element;if(S.push(t),this.collectedEnterElements.length){const e=r.__ng_removed;if(e&&e.setForMove)return void t.destroy()}const a=!h||!this.driver.containsElement(h,r),l=w.get(r),d=b.get(r),f=this._buildInstruction(e,n,d,l,a);if(f.errors&&f.errors.length)x.push(f);else{if(a)return t.onStart(()=>H(r,f.fromStyles)),t.onDestroy(()=>$(r,f.toStyles)),void i.push(t);if(e.isFallbackTransition)return t.onStart(()=>H(r,f.fromStyles)),t.onDestroy(()=>$(r,f.toStyles)),void i.push(t);f.timelines.forEach(e=>e.stretchStartingKeyframe=!0),n.append(r,f.timelines),s.push({instruction:f,player:t,element:r}),f.queriedElements.forEach(e=>p(o,e,[]).push(t)),f.preStyleProps.forEach((e,t)=>{const n=Object.keys(e);if(n.length){let e=c.get(t);e||c.set(t,e=new Set),n.forEach(t=>e.add(t))}}),f.postStyleProps.forEach((e,t)=>{const n=Object.keys(e);let i=u.get(t);i||u.set(t,i=new Set),n.forEach(e=>i.add(e))})}});if(x.length){const e=[];x.forEach(t=>{e.push(`@${t.triggerName} has failed due to:\n`),t.errors.forEach(t=>e.push(`- ${t}\n`))}),S.forEach(e=>e.destroy()),this.reportError(e)}const k=new Map,T=new Map;s.forEach(e=>{const t=e.element;n.has(t)&&(T.set(t,t),this._beforeAnimationBuild(e.player.namespaceId,e.instruction,k))}),i.forEach(e=>{const t=e.element;this._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(e=>{p(k,t,[]).push(e),e.destroy()})});const M=_.filter(e=>tt(e,c,u)),C=new Map;Ge(C,this.driver,y,u,a.a).forEach(e=>{tt(e,c,u)&&M.push(e)});const E=new Map;m.forEach((e,t)=>{Ge(E,this.driver,new Set(e),c,a.l)}),M.forEach(e=>{const t=C.get(e),n=E.get(e);C.set(e,Object.assign(Object.assign({},t),n))});const A=[],I=[],P={};s.forEach(e=>{const{element:t,player:s,instruction:o}=e;if(n.has(t)){if(d.has(t))return s.onDestroy(()=>$(t,o.toStyles)),s.disabled=!0,s.overrideTotalTime(o.totalTime),void i.push(s);let e=P;if(T.size>1){let n=t;const i=[];for(;n=n.parentNode;){const t=T.get(n);if(t){e=t;break}i.push(n)}i.forEach(t=>T.set(t,e))}const n=this._buildAnimation(s.namespaceId,o,k,r,E,C);if(s.setRealPlayer(n),e===P)A.push(s);else{const t=this.playersByElement.get(e);t&&t.length&&(s.parentPlayer=l(t)),i.push(s)}}else H(t,o.fromStyles),s.onDestroy(()=>$(t,o.toStyles)),I.push(s),d.has(t)&&i.push(s)}),I.forEach(e=>{const t=r.get(e.element);if(t&&t.length){const n=l(t);e.setRealPlayer(n)}}),i.forEach(e=>{e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(let a=0;a<_.length;a++){const e=_[a],t=e.__ng_removed;if(Qe(e,L),t&&t.hasAnimation)continue;let n=[];if(o.size){let t=o.get(e);t&&t.length&&n.push(...t);let i=this.driver.query(e,R,!0);for(let e=0;e<i.length;e++){let t=o.get(i[e]);t&&t.length&&n.push(...t)}}const i=n.filter(e=>!e.destroyed);i.length?Ze(this,e,i):this.processLeaveNode(e)}return _.length=0,A.forEach(e=>{this.players.push(e),e.onDone(()=>{e.destroy();const t=this.players.indexOf(e);this.players.splice(t,1)}),e.play()}),A}elementContainsData(e,t){let n=!1;const i=t.__ng_removed;return i&&i.setForRemoval&&(n=!0),this.playersByElement.has(t)&&(n=!0),this.playersByQueriedElement.has(t)&&(n=!0),this.statesByElement.has(t)&&(n=!0),this._fetchNamespace(e).elementContainsData(t)||n}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,i,r){let s=[];if(t){const t=this.playersByQueriedElement.get(e);t&&(s=t)}else{const t=this.playersByElement.get(e);if(t){const e=!r||r==$e;t.forEach(t=>{t.queued||(e||t.triggerName==i)&&s.push(t)})}}return(n||i)&&(s=s.filter(e=>!(n&&n!=e.namespaceId||i&&i!=e.triggerName))),s}_beforeAnimationBuild(e,t,n){const i=t.element,r=t.isRemovalTransition?void 0:e,s=t.isRemovalTransition?void 0:t.triggerName;for(const o of t.timelines){const e=o.element,a=e!==i,c=p(n,e,[]);this._getPreviousPlayers(e,a,r,s,t.toState).forEach(e=>{const t=e.getRealPlayer();t.beforeDestroy&&t.beforeDestroy(),e.destroy(),c.push(e)})}H(i,t.fromStyles)}_buildAnimation(e,t,n,i,r,s){const o=t.triggerName,c=t.element,d=[],h=new Set,f=new Set,m=t.timelines.map(t=>{const l=t.element;h.add(l);const p=l.__ng_removed;if(p&&p.removedBeforeQueried)return new a.d(t.duration,t.delay);const m=l!==c,b=function(e){const t=[];return et(e,t),t}((n.get(l)||je).map(e=>e.getRealPlayer())).filter(e=>!!e.element&&e.element===l),g=r.get(l),_=s.get(l),v=u(0,this._normalizer,0,t.keyframes,g,_),y=this._buildPlayer(t,v,b);if(t.subTimeline&&i&&f.add(l),m){const t=new Be(e,o,l);t.setRealPlayer(y),d.push(t)}return y});d.forEach(e=>{p(this.playersByQueriedElement,e.element,[]).push(e),e.onDone(()=>function(e,t,n){let i;if(e instanceof Map){if(i=e.get(t),i){if(i.length){const e=i.indexOf(n);i.splice(e,1)}0==i.length&&e.delete(t)}}else if(i=e[t],i){if(i.length){const e=i.indexOf(n);i.splice(e,1)}0==i.length&&delete e[t]}return i}(this.playersByQueriedElement,e.element,e))}),h.forEach(e=>Ke(e,I));const b=l(m);return b.onDestroy(()=>{h.forEach(e=>Qe(e,I)),$(c,t.toStyles)}),f.forEach(e=>{p(i,e,[]).push(b)}),b}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new a.d(e.duration,e.delay)}}class Be{constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n,this._player=new a.d,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(n=>d(e,t,void 0,n))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){p(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function Ue(e){return e&&1===e.nodeType}function qe(e,t){const n=e.style.display;return e.style.display=null!=t?t:"none",n}function Ge(e,t,n,i,r){const s=[];n.forEach(e=>s.push(qe(e)));const o=[];i.forEach((n,i)=>{const s={};n.forEach(e=>{const n=s[e]=t.computeStyle(i,e,r);n&&0!=n.length||(i.__ng_removed=Ne,o.push(i))}),e.set(i,s)});let a=0;return n.forEach(e=>qe(e,s[a++])),o}function Je(e,t){const n=new Map;if(e.forEach(e=>n.set(e,[])),0==t.length)return n;const i=new Set(t),r=new Map;function s(e){if(!e)return 1;let t=r.get(e);if(t)return t;const o=e.parentNode;return t=n.has(o)?o:i.has(o)?1:s(o),r.set(e,t),t}return t.forEach(e=>{const t=s(e);1!==t&&n.get(t).push(e)}),n}function Ke(e,t){if(e.classList)e.classList.add(t);else{let n=e.$$classes;n||(n=e.$$classes={}),n[t]=!0}}function Qe(e,t){if(e.classList)e.classList.remove(t);else{let n=e.$$classes;n&&delete n[t]}}function Ze(e,t,n){l(n).onDone(()=>e.processLeaveNode(t))}function et(e,t){for(let n=0;n<e.length;n++){const i=e[n];i instanceof a.k?et(i.players,t):t.push(i)}}function tt(e,t,n){const i=n.get(e);if(!i)return!1;let r=t.get(e);return r?i.forEach(e=>r.add(e)):t.set(e,i),n.delete(e),!0}class nt{constructor(e,t,n){this.bodyNode=e,this._driver=t,this._triggerCache={},this.onRemovalComplete=(e,t)=>{},this._transitionEngine=new Ve(e,t,n),this._timelineEngine=new Re(e,t,n),this._transitionEngine.onRemovalComplete=(e,t)=>this.onRemovalComplete(e,t)}registerTrigger(e,t,n,i,r){const s=e+"-"+i;let o=this._triggerCache[s];if(!o){const e=[],t=ae(this._driver,r,e);if(e.length)throw new Error(`The animation trigger "${i}" has failed to build due to the following errors:\n - ${e.join("\n - ")}`);o=function(e,t){return new Ee(e,t)}(i,t),this._triggerCache[s]=o}this._transitionEngine.registerTrigger(t,i,o)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n,i){this._transitionEngine.removeNode(e,t,i||!1,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if("@"==n.charAt(0)){const[e,r]=m(n);this._timelineEngine.command(e,t,r,i)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if("@"==n.charAt(0)){const[e,i]=m(n);return this._timelineEngine.listen(e,t,i,r)}return this._transitionEngine.listen(e,t,n,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function it(e,t){let n=null,i=null;return Array.isArray(t)&&t.length?(n=st(t[0]),t.length>1&&(i=st(t[t.length-1]))):t&&(n=st(t)),n||i?new rt(e,n,i):null}let rt=(()=>{class e{constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i,this._state=0;let r=e.initialStylesByElement.get(t);r||e.initialStylesByElement.set(t,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&$(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&($(this._element,this._initialStyles),this._endStyles&&($(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(e.initialStylesByElement.delete(this._element),this._startStyles&&(H(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(H(this._element,this._endStyles),this._endStyles=null),$(this._element,this._initialStyles),this._state=3)}}return e.initialStylesByElement=new WeakMap,e})();function st(e){let t=null;const n=Object.keys(e);for(let i=0;i<n.length;i++){const r=n[i];ot(r)&&(t=t||{},t[r]=e[r])}return t}function ot(e){return"display"===e||"position"===e}const at="animation",ct="animationend";class lt{constructor(e,t,n,i,r,s,o){this._element=e,this._name=t,this._duration=n,this._delay=i,this._easing=r,this._fillMode=s,this._onDoneFn=o,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=e=>this._handleCallback(e)}apply(){!function(e,t){const n=mt(e,"").trim();n.length&&(function(e,t){let n=0;for(let i=0;i<e.length;i++)","===e.charAt(i)&&n++}(n),t=`${n}, ${t}`),pt(e,"",t)}(this._element,`${this._duration}ms ${this._easing} ${this._delay}ms 1 normal ${this._fillMode} ${this._name}`),ft(this._element,this._eventFn,!1),this._startTime=Date.now()}pause(){ut(this._element,this._name,"paused")}resume(){ut(this._element,this._name,"running")}setPosition(e){const t=dt(this._element,this._name);this._position=e*this._duration,pt(this._element,"Delay",`-${this._position}ms`,t)}getPosition(){return this._position}_handleCallback(e){const t=e._ngTestManualTimestamp||Date.now(),n=1e3*parseFloat(e.elapsedTime.toFixed(3));e.animationName==this._name&&Math.max(t-this._startTime,0)>=this._delay&&n>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),ft(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(e,t){const n=mt(e,"").split(","),i=ht(n,t);i>=0&&(n.splice(i,1),pt(e,"",n.join(",")))}(this._element,this._name))}}function ut(e,t,n){pt(e,"PlayState",n,dt(e,t))}function dt(e,t){const n=mt(e,"");return n.indexOf(",")>0?ht(n.split(","),t):ht([n],t)}function ht(e,t){for(let n=0;n<e.length;n++)if(e[n].indexOf(t)>=0)return n;return-1}function ft(e,t,n){n?e.removeEventListener(ct,t):e.addEventListener(ct,t)}function pt(e,t,n,i){const r=at+t;if(null!=i){const t=e.style[r];if(t.length){const e=t.split(",");e[i]=n,n=e.join(",")}}e.style[r]=n}function mt(e,t){return e.style[at+t]||""}class bt{constructor(e,t,n,i,r,s,o,a){this.element=e,this.keyframes=t,this.animationName=n,this._duration=i,this._delay=r,this._finalStyles=o,this._specialStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=s||"linear",this.totalTime=i+r,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new lt(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(n=>{"offset"!=n&&(e[n]=t?this._finalStyles[n]:ee(this.element,n))})}this.currentSnapshot=e}}class gt extends a.d{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=T(t)}init(){!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){this._startingStyles&&(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class _t{constructor(){this._count=0,this._head=document.querySelector("head")}validateStyleProperty(e){return D(e)}matchesElement(e,t){return S(e,t)}containsElement(e,t){return x(e,t)}query(e,t,n){return k(e,t,n)}computeStyle(e,t,n){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,n){n=n.map(e=>T(e));let i=`@keyframes ${t} {\n`,r="";n.forEach(e=>{r=" ";const t=parseFloat(e.offset);i+=`${r}${100*t}% {\n`,r+=" ",Object.keys(e).forEach(t=>{const n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(i+=`${r}animation-timing-function: ${n};\n`));default:return void(i+=`${r}${t}: ${n};\n`)}}),i+=`${r}}\n`}),i+="}\n";const s=document.createElement("style");return s.textContent=i,s}animate(e,t,n,i,r,s=[],o){const a=s.filter(e=>e instanceof bt),c={};K(n,i)&&a.forEach(e=>{let t=e.currentSnapshot;Object.keys(t).forEach(e=>c[e]=t[e])});const l=function(e){let t={};return e&&(Array.isArray(e)?e:[e]).forEach(e=>{Object.keys(e).forEach(n=>{"offset"!=n&&"easing"!=n&&(t[n]=e[n])})}),t}(t=Q(e,t,c));if(0==n)return new gt(e,l);const u="gen_css_kf_"+this._count++,d=this.buildKeyframeElement(e,u,t);document.querySelector("head").appendChild(d);const h=it(e,t),f=new bt(e,t,u,n,i,r,l,h);return f.onDestroy(()=>{var e;(e=d).parentNode.removeChild(e)}),f}}class vt{constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,n){return e.animate(t,n)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:ee(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}}class yt{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(wt().toString()),this._cssKeyframesDriver=new _t}validateStyleProperty(e){return D(e)}matchesElement(e,t){return S(e,t)}containsElement(e,t){return x(e,t)}query(e,t,n){return k(e,t,n)}computeStyle(e,t,n){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,n,i,r,s=[],o){if(!o&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,i,r,s);const a={duration:n,delay:i,fill:0==i?"both":"forwards"};r&&(a.easing=r);const c={},l=s.filter(e=>e instanceof vt);K(n,i)&&l.forEach(e=>{let t=e.currentSnapshot;Object.keys(t).forEach(e=>c[e]=t[e])});const u=it(e,t=Q(e,t=t.map(e=>Y(e,!1)),c));return new vt(e,t,a,u)}}function wt(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}let Dt=(()=>{class e extends a.b{constructor(e,t){super(),this._nextAnimationId=0,this._renderer=e.createRenderer(t.body,{id:"0",encapsulation:r.T.None,styles:[],data:{animation:[]}})}build(e){const t=this._nextAnimationId.toString();this._nextAnimationId++;const n=Array.isArray(e)?Object(a.f)(e):e;return kt(this._renderer,null,t,"register",[n]),new St(t,this._renderer)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.I),r.ic(s.d))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();class St extends a.c{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new xt(this._id,e,t||{},this._renderer)}}class xt{constructor(e,t,n,i){this.id=e,this.element=t,this._renderer=i,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return kt(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset")}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function kt(e,t,n,i,r){return e.setProperty(t,`@@${n}:${i}`,r)}const Tt="@",Mt="@.disabled";let Ct=(()=>{class e{constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),t.onRemovalComplete=(e,t)=>{t&&t.parentNode(e)&&t.removeChild(e.parentNode,e)}}createRenderer(e,t){const n=this.delegate.createRenderer(e,t);if(!(e&&t&&t.data&&t.data.animation)){let e=this._rendererCache.get(n);return e||(e=new Ot("",n,this.engine),this._rendererCache.set(n,e)),e}const i=t.id,r=t.id+"-"+this._currentId;this._currentId++,this.engine.register(r,e);const s=t=>{Array.isArray(t)?t.forEach(s):this.engine.registerTrigger(i,r,e,t.name,t)};return t.data.animation.forEach(s),new Lt(this,r,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){e>=0&&e<this._microtaskId?this._zone.run(()=>t(n)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(e=>{const[t,n]=e;t(n)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([t,n]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.I),r.ic(nt),r.ic(r.D))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();class Ot{constructor(e,t,n){this.namespaceId=e,this.delegate=t,this.engine=n,this.destroyNode=this.delegate.destroyNode?e=>t.destroyNode(e):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n,i=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,n){this.engine.onRemove(this.namespaceId,t,this.delegate,n)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Tt&&t==Mt?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Lt extends Ot{constructor(e,t,n,i){super(t,n,i),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Tt?"."==t.charAt(1)&&t==Mt?this.disableAnimations(e,n=void 0===n||!!n):this.engine.process(this.namespaceId,e,t.substr(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Tt){const i=function(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(e);let r=t.substr(1),s="";return r.charAt(0)!=Tt&&([r,s]=function(e){const t=e.indexOf(".");return[e.substring(0,t),e.substr(t+1)]}(r)),this.engine.listen(this.namespaceId,i,r,s,e=>{this.factory.scheduleListenerCallback(e._data||-1,n,e)})}return this.delegate.listen(e,t,n)}}let Et=(()=>{class e extends nt{constructor(e,t,n){super(e.body,t,n)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(s.d),r.ic(C),r.ic(xe))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();const At=[{provide:C,useFactory:function(){return"function"==typeof wt()?new yt:new _t}},{provide:new r.u("AnimationModuleType"),useValue:"BrowserAnimations"},{provide:a.b,useClass:Dt},{provide:xe,useFactory:function(){return new ke}},{provide:nt,useClass:Et},{provide:r.I,useFactory:function(e,t,n){return new Ct(e,t,n)},deps:[i.e,nt,r.D]}];let It=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({providers:At,imports:[i.a]}),e})();var Rt=n("EApP"),Pt=n("iInd"),Ft=n("LvDl"),Wt=n.n(Ft),jt=n("mrSG"),Yt=n("xTzq");let Nt=(()=>{let e=class{constructor(e){this.http=e,this.baseURL="api/cephfs",this.baseUiURL="ui-api/cephfs"}list(){return this.http.get(`${this.baseURL}`)}lsDir(e,t){let n=`${this.baseUiURL}/${e}/ls_dir?depth=2`;return t&&(n+=`&path=${encodeURIComponent(t)}`),this.http.get(n)}getCephfs(e){return this.http.get(`${this.baseURL}/${e}`)}getTabs(e){return this.http.get(`ui-api/cephfs/${e}/tabs`)}getClients(e){return this.http.get(`${this.baseURL}/${e}/clients`)}evictClient(e,t){return this.http.delete(`${this.baseURL}/${e}/client/${t}`)}getMdsCounters(e){return this.http.get(`${this.baseURL}/${e}/mds_counters`)}mkSnapshot(e,t,n){let i=new o.e;return i=i.append("path",t),Wt.a.isUndefined(n)||(i=i.append("name",n)),this.http.post(`${this.baseURL}/${e}/snapshot`,null,{params:i})}rmSnapshot(e,t,n){let i=new o.e;return i=i.append("path",t),i=i.append("name",n),this.http.delete(`${this.baseURL}/${e}/snapshot`,{params:i})}quota(e,t,n){let i=new o.e;return i=i.append("path",t),this.http.put(`${this.baseURL}/${e}/quota`,n,{observe:"response",params:i})}};return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e=Object(jt.b)([Yt.a,Object(jt.d)("design:paramtypes",[o.b])],e),e})();var zt=n("+fVR"),$t=n("x38r"),Ht=n("vCyI"),Xt=n("a0VL"),Vt=n("uIqm"),Bt=n("PqYM"),Ut=n("VxPD"),qt=n("yJti"),Gt=n("aexS"),Jt=n("G0yt"),Kt=n("JP8w"),Qt=n("Fgil"),Zt=n("o4+5"),en=n("FSuO"),tn=n("wd/R"),nn=n.n(tn),rn=n("NEZu"),sn=n("hrfs");const on=["chartCanvas"],an=["chartTooltip"];let cn=(()=>{class e{constructor(){this.lhsCounter="mds_mem.ino",this.rhsCounter="mds_server.handle_client_request",this.chart={datasets:[{label:this.lhsCounter,yAxisID:"LHS",data:[],lineTension:.1},{label:this.rhsCounter,yAxisID:"RHS",data:[],lineTension:.1}],options:{title:{text:"",display:!0},responsive:!0,maintainAspectRatio:!1,legend:{position:"top"},scales:{xAxes:[{position:"top",type:"time",time:{displayFormats:{quarter:"MMM YYYY"}},ticks:{maxRotation:0}}],yAxes:[{id:"LHS",type:"linear",position:"left"},{id:"RHS",type:"linear",position:"right"}]},tooltips:{enabled:!1,mode:"index",intersect:!1,position:"nearest",callbacks:{title:(e,t)=>{let n=0;if(e.length>0){const i=e[0];n=t.datasets[i.datasetIndex].data[i.index].x}return n.toString()}}}},chartType:"line"}}ngOnInit(){Wt.a.isUndefined(this.mdsCounter)||(this.setChartTooltip(),this.updateChart())}ngOnChanges(){Wt.a.isUndefined(this.mdsCounter)||this.updateChart()}setChartTooltip(){const e=new rn.a(this.chartCanvas,this.chartTooltip,e=>e.caretX+"px",e=>e.caretY-e.height-23+"px");e.getTitle=e=>nn()(e,"x").format("LTS"),e.checkOffset=!0,Wt.a.merge(this.chart,{options:{title:{text:this.mdsCounter.name},tooltips:{custom:t=>e.customTooltips(t)}}})}updateChart(){const e=[{data:this.convertTimeSeries(this.mdsCounter[this.lhsCounter])},{data:this.deltaTimeSeries(this.mdsCounter[this.rhsCounter])}];Wt.a.merge(this.chart,{datasets:e}),this.chart.datasets=[...this.chart.datasets]}convertTimeSeries(e){const t=[];return Wt.a.each(e,e=>{t.push({x:1e3*e[0],y:e[1]})}),t.shift(),t}deltaTimeSeries(e){let t,n=e[0];const i=[];for(t=1;t<e.length;t++){const r=e[t];i.push({x:1e3*r[0],y:r[1]-n[1]}),n=r}return i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-chart"]],viewQuery:function(e,t){if(1&e&&(r.Wc(on,3),r.Wc(an,3)),2&e){let e;r.Ec(e=r.mc())&&(t.chartCanvas=e.first),r.Ec(e=r.mc())&&(t.chartTooltip=e.first)}},inputs:{mdsCounter:"mdsCounter"},features:[r.Bb],decls:6,vars:3,consts:[[1,"chart-container"],["baseChart","",3,"datasets","options","chartType"],["chartCanvas",""],[1,"chartjs-tooltip"],["chartTooltip",""]],template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Sb(1,"canvas",1,2),r.Xb(3,"div",3,4),r.Sb(5,"table"),r.Wb(),r.Wb()),2&e&&(r.Db(1),r.uc("datasets",t.chart.datasets)("options",t.chart.options)("chartType",t.chart.chartType))},directives:[sn.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:#000000b3;border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid #0000;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-container[_ngcontent-%COMP%]{height:500px;margin-bottom:20px;position:relative;width:100%}']}),e})();var ln=n("GgAd");const un=["poolUsageTpl"],dn=["activityTmpl"];function hn(e,t){if(1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",11),r.Sb(2,"cd-cephfs-chart",12),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.uc("mdsCounter",e)}}function fn(e,t){if(1&e&&r.Sb(0,"cd-usage-bar",13),2&e){const e=t.row;r.uc("total",e.size)("used",e.used)}}function pn(e,t){1&e&&(r.Rc(0),r.oc(1,"dimless")),2&e&&r.Uc(" ","standby-replay"===t.row.state?"Evts":"Reqs",": ",r.pc(1,2,t.value)," /s\n")}let mn=(()=>{class e{constructor(e,t){this.dimlessBinary=e,this.dimless=t,this.standbys=[],this.objectValues=Object.values}ngOnChanges(){this.setStandbys()}setStandbys(){this.standbys=[{key:"Standby daemons",value:this.data.standbys}]}ngOnInit(){this.columns={ranks:[{prop:"rank",name:"Rank"},{prop:"state",name:"State"},{prop:"mds",name:"Daemon"},{prop:"activity",name:"Activity",cellTemplate:this.activityTmpl},{prop:"dns",name:"Dentries",pipe:this.dimless},{prop:"inos",name:"Inodes",pipe:this.dimless},{prop:"dirs",name:"Dirs",pipe:this.dimless},{prop:"caps",name:"Caps",pipe:this.dimless}],pools:[{prop:"pool",name:"Pool"},{prop:"type",name:"Type"},{prop:"size",name:"Size",pipe:this.dimlessBinary},{name:"Usage",cellTemplate:this.poolUsageTpl,comparator:(e,t,n,i)=>{const r=n.used/n.avail,s=i.used/i.avail;return r===s?0:r>s?1:-1}}]}}trackByFn(e,t){return t.name}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Qt.a),r.Rb(Zt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-detail"]],viewQuery:function(e,t){if(1&e&&(r.Wc(un,3),r.Wc(dn,3)),2&e){let e;r.Ec(e=r.mc())&&(t.poolUsageTpl=e.first),r.Ec(e=r.mc())&&(t.activityTmpl=e.first)}},inputs:{data:"data"},features:[r.Bb],decls:19,vars:9,consts:function(){let e,t,n,i;return e="Ranks",t="Standbys",n="Pools",i="MDS performance counters",[[1,"row"],[1,"col-sm-6"],e,[3,"data","columns","toolHeader"],t,[3,"data"],n,i,["class","row",4,"ngFor","ngForOf","ngForTrackBy"],["poolUsageTpl",""],["activityTmpl",""],[1,"col-md-12"],[3,"mdsCounter"],[3,"total","used"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"legend"),r.bc(3,2),r.Wb(),r.Sb(4,"cd-table",3),r.Xb(5,"legend"),r.bc(6,4),r.Wb(),r.Sb(7,"cd-table-key-value",5),r.Wb(),r.Xb(8,"div",1),r.Xb(9,"legend"),r.bc(10,6),r.Wb(),r.Sb(11,"cd-table",3),r.Wb(),r.Wb(),r.Xb(12,"legend"),r.bc(13,7),r.Wb(),r.Pc(14,hn,3,1,"div",8),r.Pc(15,fn,1,2,"ng-template",null,9,r.Qc),r.Pc(17,pn,2,4,"ng-template",null,10,r.Qc)),2&e&&(r.Db(4),r.uc("data",t.data.ranks)("columns",t.columns.ranks)("toolHeader",!1),r.Db(3),r.uc("data",t.standbys),r.Db(4),r.uc("data",t.data.pools)("columns",t.columns.pools)("toolHeader",!1),r.Db(3),r.uc("ngForOf",t.objectValues(t.data.mdsCounters))("ngForTrackBy",t.trackByFn))},directives:[Vt.a,en.a,s.q,cn,ln.a],pipes:[Zt.a],styles:[".progress[_ngcontent-%COMP%]{margin-bottom:0}"]}),e})();var bn=n("0+/T"),gn=n("sne2"),_n=n("oxzT"),vn=n("mtw6"),yn=n("JK/P"),wn=n("9nlD"),Dn=n("S7zO");let Sn=(()=>{class e{constructor(e,t,n,i,s){this.cephfsService=e,this.modalService=t,this.notificationService=n,this.authStorageService=i,this.actionLabels=s,this.triggerApiUpdate=new r.p,this.selection=new Ht.a,this.permission=this.authStorageService.getPermissions().cephfs,this.tableActions=[{permission:"update",icon:_n.a.signOut,click:()=>this.evictClientModal(),name:this.actionLabels.EVICT}]}ngOnInit(){this.columns=[{prop:"id",name:"id"},{prop:"type",name:"type"},{prop:"state",name:"state"},{prop:"version",name:"version"},{prop:"hostname",name:"Host"},{prop:"root",name:"root"}]}updateSelection(e){this.selection=e}evictClient(e){this.cephfsService.evictClient(this.id,e).subscribe(()=>{this.triggerApiUpdate.emit(),this.modalRef.close(),this.notificationService.show(vn.a.success,"Evicted client '" + e + "'")},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}evictClientModal(){const e=this.selection.first().id;this.modalRef=this.modalService.show(bn.a,{itemDescription:"client",itemNames:[e],actionDescription:"evict",submitAction:()=>this.evictClient(e)})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Nt),r.Rb(yn.a),r.Rb(wn.a),r.Rb(Gt.a),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-clients"]],inputs:{id:"id",clients:"clients"},outputs:{triggerApiUpdate:"triggerApiUpdate"},decls:2,vars:7,consts:[["selectionType","single",3,"data","columns","status","autoReload","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(r.Xb(0,"cd-table",0),r.lc("fetchData",function(){return t.triggerApiUpdate.emit()})("updateSelection",function(e){return t.updateSelection(e)}),r.Sb(1,"cd-table-actions",1),r.Wb()),2&e&&(r.uc("data",t.clients.data)("columns",t.columns)("status",t.clients.status)("autoReload",-1),r.Db(1),r.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Vt.a,Dn.a],styles:[""]}),e})();var xn=n("s7LF"),kn=n("ohO+"),Tn=n("OLbh"),Mn=n("Rf2I"),Cn=n("1Ni5"),On=n("ANnk");const Ln=["origin"],En=function(e,t){return[e,t]};function An(e,t){if(1&e&&r.Sb(0,"i",5),2&e){const e=r.nc(2);r.uc("ngClass",r.Ac(1,En,e.icons.spinner,e.icons.spin))}}function In(e,t){if(1&e&&(r.Xb(0,"tree-root",10),r.Pc(1,An,1,4,"ng-template",null,11,r.Qc),r.Wb()),2&e){const e=r.nc();r.uc("nodes",e.nodes)("options",e.treeOptions)}}function Rn(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"legend"),r.bc(2,17),r.Wb(),r.Xb(3,"cd-table",18),r.lc("updateSelection",function(t){return r.Ic(e),r.nc(2).quota.updateSelection(t)}),r.Sb(4,"cd-table-actions",19),r.Wb(),r.Ub()}if(2&e){const e=r.nc(2);r.Db(3),r.uc("data",e.settings)("columns",e.quota.columns)("limit",0)("footer",!1)("onlyActionHeader",!0)("forceIdentifier",!0)("toolHeader",!1),r.Db(1),r.uc("permission",e.permission)("selection",e.quota.selection)("tableActions",e.quota.tableActions)}}function Pn(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",12),r.Xb(1,"div",2),r.Xb(2,"div",3),r.Rc(3),r.Wb(),r.Xb(4,"div",6),r.Pc(5,Rn,5,10,"ng-container",13),r.Xb(6,"legend"),r.bc(7,14),r.Wb(),r.Xb(8,"cd-table",15),r.lc("updateSelection",function(t){return r.Ic(e),r.nc().snapshot.updateSelection(t)}),r.Sb(9,"cd-table-actions",16),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(3),r.Tc(" ",e.selectedDir.path," "),r.Db(2),r.uc("ngIf","/"!==e.selectedDir.path),r.Db(3),r.uc("data",e.selectedDir.snapshots)("columns",e.snapshot.columns),r.Db(1),r.uc("permission",e.permission)("selection",e.snapshot.selection)("tableActions",e.snapshot.tableActions)}}function Fn(e,t){if(1&e){const e=r.Yb();r.Xb(0,"span",20),r.lc("click",function(){r.Ic(e);const n=t.value;return r.nc().selectOrigin(n)}),r.Rc(1),r.Wb()}if(2&e){const e=t.value;r.Db(1),r.Sc(e)}}let Wn=(()=>{class e{constructor(e,t,n,i,r,s,o){this.authStorageService=e,this.modalService=t,this.cephfsService=n,this.cdDatePipe=i,this.actionLabels=r,this.notificationService=s,this.dimlessBinaryPipe=o,this.icons=_n.a,this.loadingIndicator=!1,this.loading={},this.treeOptions={useVirtualScroll:!0,getChildren:e=>this.updateDirectory(e.id),actionMapping:{mouse:{click:this.selectAndShowNode.bind(this),expanderClick:this.selectAndShowNode.bind(this)}}}}selectAndShowNode(e,t,n){kn.a.TOGGLE_EXPANDED(e,t,n),this.selectNode(t)}selectNode(e){kn.a.TOGGLE_ACTIVE(void 0,e,void 0),this.selectedDir=this.getDirectory(e),"/"!==e.id&&this.setSettings(e)}ngOnInit(){this.permission=this.authStorageService.getPermissions().cephfs,this.setUpQuotaTable(),this.setUpSnapshotTable()}setUpQuotaTable(){this.quota={columns:[{prop:"row.name",name:"Name",flexGrow:1},{prop:"row.value",name:"Value",sortable:!1,flexGrow:1},{prop:"row.originPath",name:"Origin",sortable:!1,cellTemplate:this.originTmpl,flexGrow:1}],selection:new Ht.a,updateSelection:e=>{this.quota.selection=e},tableActions:[{name:this.actionLabels.SET,icon:_n.a.edit,permission:"update",visible:e=>!e.hasSelection||e.first()&&0===e.first().dirValue,click:()=>this.updateQuotaModal()},{name:this.actionLabels.UPDATE,icon:_n.a.edit,permission:"update",visible:e=>e.first()&&e.first().dirValue>0,click:()=>this.updateQuotaModal()},{name:this.actionLabels.UNSET,icon:_n.a.destroy,permission:"update",disable:e=>!e.hasSelection||e.first()&&0===e.first().dirValue,click:()=>this.unsetQuotaModal()}]}}setUpSnapshotTable(){this.snapshot={columns:[{prop:"name",name:"Name",flexGrow:1},{prop:"path",name:"Path",isHidden:!0,flexGrow:2},{prop:"created",name:"Created",flexGrow:1,pipe:this.cdDatePipe}],selection:new Ht.a,updateSelection:e=>{this.snapshot.selection=e},tableActions:[{name:this.actionLabels.CREATE,icon:_n.a.add,permission:"create",canBePrimary:e=>!e.hasSelection,click:()=>this.createSnapshot(),disable:()=>this.disableCreateSnapshot()},{name:this.actionLabels.DELETE,icon:_n.a.destroy,permission:"delete",click:()=>this.deleteSnapshotModal(),canBePrimary:e=>e.hasSelection,disable:e=>!e.hasSelection}]}}disableCreateSnapshot(){const e=this.selectedDir.path.split("/").slice(1);return e.length>=4&&"volumes"===e[0]&&"Cannot create snapshots for files/folders in the subvolume " + e[2] + ""}ngOnChanges(){this.selectedDir=void 0,this.dirs=[],this.requestedPaths=[],this.nodeIds={},this.id&&(this.setRootNode(),this.firstCall())}setRootNode(){this.nodes=[{name:"/",id:"/",isExpanded:!0}]}firstCall(){setTimeout(()=>{this.getNode("/").loadNodeChildren()},10)}updateDirectory(e){if(this.unsetLoadingIndicator(),this.requestedPaths.includes(e)){if(!0===this.loading[e])return}else this.requestedPaths.push(e);return new Promise(t=>{this.setLoadingIndicator(e,!0),this.cephfsService.lsDir(this.id,e).subscribe(n=>{this.updateTreeStructure(n),this.updateQuotaTable(),this.updateTree(),t(this.getChildren(e)),this.setLoadingIndicator(e,!1)})})}setLoadingIndicator(e,t){this.loading[e]=t,this.unsetLoadingIndicator()}getSubDirectories(e,t=this.dirs){return t.filter(t=>t.parent===e)}getChildren(e){const t=this.getSubTree(e);return Wt.a.sortBy(this.getSubDirectories(e),"path").map(e=>this.createNode(e,t))}createNode(e,t){return this.nodeIds[e.path]=e,t||this.getSubTree(e.parent),{name:e.name,id:e.path,hasChildren:this.getSubDirectories(e.path,t).length>0}}getSubTree(e){return this.dirs.filter(t=>t.parent&&t.parent.startsWith(e))}setSettings(e){const t=(e,t)=>e?t?t(e):e:"";this.settings=[this.getQuota(e,"max_files",t),this.getQuota(e,"max_bytes",e=>t(e,e=>this.dimlessBinaryPipe.transform(e)))]}getQuota(e,t,n){const i=e.id;e=this.getOrigin(e,t);const r=this.getDirectory(e),s=r.quotas[t];let o=s,a=r.path;if(e.id===i)if("/"===e.parent.id)o=0;else{const n=this.getDirectory(this.getOrigin(e.parent,t));o=n.quotas[t],a=n.path}return{row:{name:"max_bytes"===t?"Max size":"Max files",value:n(s),originPath:s?r.path:""},quotaKey:t,dirValue:this.nodeIds[i].quotas[t],nextTreeMaximum:{value:o,path:o?a:""}}}getOrigin(e,t){if(e.parent&&"/"!==e.parent.id){const n=this.getQuotaFromTree(e,t),i=this.getOrigin(e.parent,t),r=this.getQuotaFromTree(i,t);return 0===n||0!==r&&r<n?i:e}return e}getQuotaFromTree(e,t){return this.getDirectory(e).quotas[t]}getDirectory(e){return this.nodeIds[e.id]}selectOrigin(e){this.selectNode(this.getNode(e))}getNode(e){return this.treeComponent.treeModel.getNodeById(e)}updateQuotaModal(){const e=this.selectedDir.path,t=this.quota.selection.first(),n=t.nextTreeMaximum,i=t.quotaKey,r=t.dirValue;this.modalService.show(Mn.a,{titleText:this.getModalQuotaTitle(0===r?this.actionLabels.SET:this.actionLabels.UPDATE,e),message:n.value?"The inherited " + this.getQuotaValueFromPathMsg(n.value, n.path) + " is the maximum value to be used.":void 0,fields:[this.getQuotaFormField(t.row.name,i,r,n.value)],submitButtonText:"Save",onSubmit:e=>this.updateQuota(e)})}getModalQuotaTitle(e,t){return "" + e + " CephFS " + this.getQuotaName() + " quota for '" + t + "'"}getQuotaName(){return this.isBytesQuotaSelected()?"size":"files"}isBytesQuotaSelected(){return"max_bytes"===this.quota.selection.first().quotaKey}getQuotaValueFromPathMsg(e,t){return e=this.isBytesQuotaSelected()?this.dimlessBinaryPipe.transform(e):e,"" + this.getQuotaName() + " quota " + e + " from '" + t + "'"}getQuotaFormField(e,t,n,i){const r="max_bytes"===t,s=[r?Cn.a.binaryMin(0):xn.A.min(0)];i&&s.push(r?Cn.a.binaryMax(i):xn.A.max(i));const o={type:r?"binary":"number",label:e,name:t,value:n,validators:s,required:!0};return r||(o.errors={min:"Value has to be at least 0 or more",max:"Value has to be at most " + i + " or less"}),o}updateQuota(e,t){const n=this.selectedDir.path,i=this.quota.selection.first().quotaKey,r=0===this.selectedDir.quotas[i]?this.actionLabels.SET:0===e[i]?this.actionLabels.UNSET:"Updated";this.cephfsService.quota(this.id,n,e).subscribe(()=>{t&&t(),this.notificationService.show(vn.a.success,this.getModalQuotaTitle(r,n)),this.forceDirRefresh()})}unsetQuotaModal(){const e=this.selectedDir.path,t=this.quota.selection.first(),n=t.quotaKey,i=t.nextTreeMaximum,r=t.dirValue,s=this.getQuotaValueFromPathMsg(i.value,i.path),o=i.value>0?i.value>r?"in order to inherit " + s + "":"which isn't used because of the inheritance of " + s + "":"in order to have no quota on the directory";this.modalRef=this.modalService.show(Tn.a,{titleText:this.getModalQuotaTitle(this.actionLabels.UNSET,e),buttonText:this.actionLabels.UNSET,description:"" + this.actionLabels.UNSET + " " + this.getQuotaValueFromPathMsg(r, e) + " " + o + ".",onSubmit:()=>this.updateQuota({[n]:0},()=>this.modalRef.close())})}createSnapshot(){const e=this.selectedDir.path;this.modalService.show(Mn.a,{titleText:"Create Snapshot",message:"Please enter the name of the snapshot.",fields:[{type:"text",name:"name",value:`${nn()().toISOString(!0)}`,required:!0}],submitButtonText:"Create Snapshot",onSubmit:t=>{this.cephfsService.mkSnapshot(this.id,e,t.name).subscribe(t=>{this.notificationService.show(vn.a.success,"Created snapshot '" + t + "' for '" + e + "'"),this.forceDirRefresh()})}})}forceDirRefresh(e){if(!e){const t=this.selectedDir;if(!t)throw new Error("This function can only be called without path if an selection was made");e=t.parent?t.parent:t.path}this.getNode(e).loadNodeChildren()}updateTreeStructure(e){const t=(e,t)=>{const n=e.filter(e=>e.parent===t),i=n.map(e=>e.path);return{children:n,paths:i}};Wt.a.uniq(e.map(e=>e.parent).sort()).forEach(n=>{const i=t(e,n),r=t(this.dirs,n);r.children.forEach(e=>{i.paths.includes(e.path)||this.removeOldDirectory(e)}),i.children.forEach(e=>{r.paths.includes(e.path)?this.updateExistingDirectory(r.children,e):this.addNewDirectory(e)})})}removeOldDirectory(e){const t=e.path;Wt.a.remove(this.dirs,e=>e.path===t),delete this.nodeIds[t],this.updateDirectoriesParentNode(e)}updateDirectoriesParentNode(e){const t=e.parent;if(!t)return;const n=this.getNode(t);if(!n)return;const i=this.getChildren(t);n.data.children=i,n.data.hasChildren=i.length>0,this.treeComponent.treeModel.update()}addNewDirectory(e){this.dirs.push(e),this.nodeIds[e.path]=e,this.updateDirectoriesParentNode(e)}updateExistingDirectory(e,t){const n=e.find(e=>e.path===t.path);Object.assign(n,t)}updateQuotaTable(){const e=this.selectedDir?this.getNode(this.selectedDir.path):void 0;e&&"/"!==e.id&&this.setSettings(e)}updateTree(e=!1){this.loadingIndicator&&!e||(this.treeComponent.treeModel.update(),this.nodes=[...this.nodes],this.treeComponent.sizeChanged())}deleteSnapshotModal(){this.modalRef=this.modalService.show(bn.a,{itemDescription:"CephFs Snapshot",itemNames:this.snapshot.selection.selected.map(e=>e.name),submitAction:()=>this.deleteSnapshot()})}deleteSnapshot(){const e=this.selectedDir.path;this.snapshot.selection.selected.forEach(t=>{const n=t.name;this.cephfsService.rmSnapshot(this.id,e,n).subscribe(()=>{this.notificationService.show(vn.a.success,"Deleted snapshot '" + n + "' for '" + e + "'")})}),this.modalRef.close(),this.forceDirRefresh()}refreshAllDirectories(){this.loadingIndicator=!0,this.requestedPaths.map(e=>this.forceDirRefresh(e));const e=setInterval(()=>{this.updateTree(!0),this.loadingIndicator||clearInterval(e)},3e3)}unsetLoadingIndicator(){this.loadingIndicator&&(clearTimeout(this.loadingTimeout),this.loadingTimeout=setTimeout(()=>{if(Object.values(this.loading).some(e=>e))return this.unsetLoadingIndicator();this.loadingIndicator=!1,this.updateTree()},3e3))}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(yn.a),r.Rb(Nt),r.Rb(Xt.a),r.Rb(gn.b),r.Rb(wn.a),r.Rb(Qt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-directories"]],viewQuery:function(e,t){if(1&e&&(r.Wc(kn.b,1),r.Wc(Ln,3)),2&e){let e;r.Ec(e=r.mc())&&(t.treeComponent=e.first),r.Ec(e=r.mc())&&(t.originTmpl=e.first)}},inputs:{id:"id"},features:[r.Bb],decls:11,vars:10,consts:function(){let e,t;return e="Snapshots",t="Quotas",[[1,"row"],[1,"col-sm-4","pr-0"],[1,"card"],[1,"card-header"],["type","button",1,"btn","btn-light","pull-right",3,"click"],[3,"ngClass"],[1,"card-body"],[3,"nodes","options",4,"ngIf"],["class","col-sm-8 metadata",4,"ngIf"],["origin",""],[3,"nodes","options"],["loadingTemplate",""],[1,"col-sm-8","metadata"],[4,"ngIf"],e,["identifier","name","forceIdentifier","true","selectionType","multiClick",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],t,["selectionType","single","identifier","quotaKey",3,"data","columns","limit","footer","onlyActionHeader","forceIdentifier","toolHeader","updateSelection"],[1,"only-table-actions",3,"permission","selection","tableActions"],[1,"quota-origin",3,"click"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"div",2),r.Xb(3,"div",3),r.Xb(4,"button",4),r.lc("click",function(){return t.refreshAllDirectories()}),r.Sb(5,"i",5),r.Wb(),r.Wb(),r.Xb(6,"div",6),r.Pc(7,In,3,2,"tree-root",7),r.Wb(),r.Wb(),r.Wb(),r.Pc(8,Pn,10,7,"div",8),r.Wb(),r.Pc(9,Fn,2,1,"ng-template",null,9,r.Qc)),2&e&&(r.Db(4),r.Jb("disabled",t.loadingIndicator),r.Db(1),r.Jb("fa-spin",t.loadingIndicator),r.uc("ngClass",r.Ac(7,En,t.icons.large,t.icons.refresh)),r.Db(2),r.uc("ngIf",t.nodes),r.Db(1),r.uc("ngIf",t.selectedDir))},directives:[On.a,s.p,s.r,kn.b,Vt.a,Dn.a],styles:["cd-cephfs-directories tree-root .tree-children{overflow:inherit}.quota-origin[_ngcontent-%COMP%]{color:#2b99a8;cursor:pointer}.quota-origin[_ngcontent-%COMP%]:hover{color:#212529}"]}),e})();var jn=n("insk");function Yn(e,t){if(1&e&&r.Sb(0,"cd-cephfs-detail",15),2&e){const e=r.nc(2);r.uc("data",e.details)}}function Nn(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-cephfs-clients",16),r.lc("triggerApiUpdate",function(){return r.Ic(e),r.nc(2).refresh()}),r.Wb()}if(2&e){const e=r.nc(2);r.uc("id",e.id)("clients",e.clients)}}function zn(e,t){if(1&e&&r.Sb(0,"cd-cephfs-directories",17),2&e){const e=r.nc(2);r.uc("id",e.id)}}function $n(e,t){if(1&e&&r.Sb(0,"cd-grafana",18),2&e){const e=r.nc(2);r.uc("grafanaPath","mds-performance?var-mds_servers=mds."+e.grafanaId)}}function Hn(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"ul",1,2),r.lc("navChange",function(){return r.Ic(e),r.nc().softRefresh()}),r.Xb(3,"li",3),r.Xb(4,"a",4),r.bc(5,5),r.Wb(),r.Pc(6,Yn,1,1,"ng-template",6),r.Wb(),r.Xb(7,"li",7),r.Xb(8,"a",4),r.Vb(9),r.bc(10,8),r.Ub(),r.Xb(11,"span",9),r.Rc(12),r.Wb(),r.Wb(),r.Pc(13,Nn,1,2,"ng-template",6),r.Wb(),r.Xb(14,"li",10),r.Xb(15,"a",4),r.bc(16,11),r.Wb(),r.Pc(17,zn,1,1,"ng-template",6),r.Wb(),r.Xb(18,"li",12),r.Xb(19,"a",4),r.bc(20,13),r.Wb(),r.Pc(21,$n,1,1,"ng-template",6),r.Wb(),r.Wb(),r.Sb(22,"div",14),r.Ub()}if(2&e){const e=r.Fc(2),t=r.nc();r.Db(12),r.Sc(t.clients.data.length),r.Db(10),r.uc("ngbNavOutlet",e)}}let Xn=(()=>{class e{constructor(e,t,n){this.ngZone=e,this.authStorageService=t,this.cephfsService=n,this.clients={data:[],status:new Ut.a(qt.a.ValueNone)},this.details={standbys:"",pools:[],ranks:[],mdsCounters:{},name:""},this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){this.selection?this.selection.id!==this.id&&this.setupSelected(this.selection.id,this.selection.mdsmap.info):this.unsubscribeInterval()}setupSelected(e,t){this.id=e;const n=Wt.a.first(Object.values(t));this.grafanaId=n&&n.name,this.details={standbys:"",pools:[],ranks:[],mdsCounters:{},name:""},this.clients={data:[],status:new Ut.a(qt.a.ValueNone)},this.updateInterval()}updateInterval(){this.unsubscribeInterval(),this.subscribeInterval()}unsubscribeInterval(){this.reloadSubscriber&&this.reloadSubscriber.unsubscribe()}subscribeInterval(){this.ngZone.runOutsideAngular(()=>this.reloadSubscriber=Object(Bt.a)(0,5e3).subscribe(()=>this.ngZone.run(()=>this.refresh())))}refresh(){this.cephfsService.getTabs(this.id).subscribe(e=>{this.data=e,this.softRefresh()},()=>{this.clients.status=new Ut.a(qt.a.ValueException)})}softRefresh(){const e=Wt.a.cloneDeep(this.data);this.clients=e.clients,this.clients.status=new Ut.a(this.clients.status),this.details={standbys:e.standbys,pools:e.pools,ranks:e.ranks,mdsCounters:e.mds_counters,name:e.name}}ngOnDestroy(){this.unsubscribeInterval()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(r.D),r.Rb(Gt.a),r.Rb(Nt))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-tabs"]],inputs:{selection:"selection"},features:[r.Bb],decls:1,vars:1,consts:function(){let e,t,n,i;return e="Details",t="Clients",n="Directories",i="Performance Details",[[4,"ngIf"],["ngbNav","","cdStatefulTab","cephfs-tabs",1,"nav-tabs",3,"navChange"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","clients"],t,[1,"badge","badge-pill","badge-tab","ml-1"],["ngbNavItem","directories"],n,["ngbNavItem","performance-details"],i,[3,"ngbNavOutlet"],[3,"data"],[3,"id","clients","triggerApiUpdate"],[3,"id"],["uid","tbO9LAiZz","grafanaStyle","one",3,"grafanaPath"]]},template:function(e,t){1&e&&r.Pc(0,Hn,23,2,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,mn,Sn,Wn,jn.a],styles:[""]}),e})(),Vn=(()=>{class e extends zt.a{constructor(e,t){super(),this.cephfsService=e,this.cdDatePipe=t,this.filesystems=[],this.selection=new Ht.a}ngOnInit(){this.columns=[{name:"Name",prop:"mdsmap.fs_name",flexGrow:2},{name:"Created",prop:"mdsmap.created",flexGrow:2,pipe:this.cdDatePipe},{name:"Enabled",prop:"mdsmap.enabled",flexGrow:1,cellTransformation:$t.a.checkIcon}]}loadFilesystems(e){this.cephfsService.list().subscribe(e=>{this.filesystems=e},()=>{e.error()})}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Nt),r.Rb(Xt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-cephfs-list"]],features:[r.Ab],decls:2,vars:4,consts:[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","fetchData","setExpandedRow","updateSelection"],["cdTableDetail","",3,"selection"]],template:function(e,t){1&e&&(r.Xb(0,"cd-table",0),r.lc("fetchData",function(e){return t.loadFilesystems(e)})("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)}),r.Sb(1,"cd-cephfs-tabs",1),r.Wb()),2&e&&(r.uc("data",t.filesystems)("columns",t.columns)("hasDetails",!0),r.Db(1),r.uc("selection",t.expandedRow))},directives:[Vt.a,Xn],styles:[""]}),e})();var Bn=n("MuvH");let Un=(()=>{class e{static getType(e){const t=Wt.a.find(this.knownTypes,t=>t.name===e);if(void 0!==t)return t;throw new Error('Found unknown type "'+e+'" for config option.')}static getTypeValidators(t){const n=e.getType(t.type);if("bool"===n.name||"str"===n.name)return;const i={validators:[],patternHelpText:n.patternHelpText};return n.isNumberType?(t.max&&""!==t.max&&(i.max=t.max,i.validators.push(xn.A.max(t.max))),t.min&&""!==t.min?(i.min=t.min,i.validators.push(xn.A.min(t.min))):"defaultMin"in n&&(i.min=n.defaultMin,i.validators.push(xn.A.min(n.defaultMin))),i.validators.push("float"===t.type?Cn.a.decimalNumber():Cn.a.number(n.allowsNegative))):"addr"===t.type?i.validators=[Cn.a.ip()]:"uuid"===t.type&&(i.validators=[Cn.a.uuid()]),i}static getTypeStep(e,t){if(["uint","int","size","secs"].includes(e))return 1;if("float"===e){if(null!==t&&-1!==t.toString().indexOf(".")){const e=t.toString().split(".");return Math.pow(10,-e[1].length)}return.1}}}return e.knownTypes=[{name:"uint",inputType:"number",humanReadable:"Unsigned integer value",defaultMin:0,patternHelpText:"The entered value needs to be an unsigned number.",isNumberType:!0,allowsNegative:!1},{name:"int",inputType:"number",humanReadable:"Integer value",patternHelpText:"The entered value needs to be a number.",isNumberType:!0,allowsNegative:!0},{name:"size",inputType:"number",humanReadable:"Unsigned integer value (>=16bit)",defaultMin:0,patternHelpText:"The entered value needs to be a unsigned number.",isNumberType:!0,allowsNegative:!1},{name:"secs",inputType:"number",humanReadable:"Number of seconds",defaultMin:1,patternHelpText:"The entered value needs to be a number >= 1.",isNumberType:!0,allowsNegative:!1},{name:"float",inputType:"number",humanReadable:"Double value",patternHelpText:"The entered value needs to be a number or decimal.",isNumberType:!0,allowsNegative:!0},{name:"str",inputType:"text",humanReadable:"Text",isNumberType:!1},{name:"addr",inputType:"text",humanReadable:"IPv4 or IPv6 address",patternHelpText:"The entered value needs to be a valid IP address.",isNumberType:!1},{name:"uuid",inputType:"text",humanReadable:"UUID",patternHelpText:"The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8",isNumberType:!1},{name:"bool",inputType:"checkbox",humanReadable:"Boolean value",isNumberType:!1}],e})();var qn=n("spCT"),Gn=n("QFaf");class Jn{constructor(){this.value=[]}}var Kn=n("zc8c"),Qn=n("NwgZ"),Zn=n("ocLN"),ei=n("f69J"),ti=n("6+kj");function ni(e,t){1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",9),r.bc(2,20),r.Wb(),r.Xb(3,"div",11),r.Xb(4,"textarea",21),r.Rc(5,"            "),r.Wb(),r.Wb(),r.Wb())}function ii(e,t){1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",9),r.bc(2,22),r.Wb(),r.Xb(3,"div",11),r.Xb(4,"textarea",23),r.Rc(5,"            "),r.Wb(),r.Wb(),r.Wb())}function ri(e,t){1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",9),r.bc(2,24),r.Wb(),r.Xb(3,"div",11),r.Sb(4,"input",25),r.Wb(),r.Wb())}function si(e,t){1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",9),r.bc(2,26),r.Wb(),r.Xb(3,"div",11),r.Sb(4,"input",27),r.Wb(),r.Wb())}function oi(e,t){if(1&e&&(r.Xb(0,"span",30),r.Xb(1,"span",31),r.Rc(2),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Sc(e)}}function ai(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",9),r.bc(2,28),r.Wb(),r.Xb(3,"div",11),r.Pc(4,oi,3,1,"span",29),r.Wb(),r.Wb()),2&e){const e=r.nc(2);r.Db(4),r.uc("ngForOf",e.configForm.getValue("services"))}}function ci(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",32),r.Rc(2),r.Wb(),r.Xb(3,"div",11),r.Xb(4,"select",33),r.Xb(5,"option",34),r.bc(6,35),r.Wb(),r.Xb(7,"option",34),r.bc(8,36),r.Wb(),r.Xb(9,"option",34),r.bc(10,37),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.uc("for",e),r.Db(1),r.Tc("",e," "),r.Db(2),r.uc("formControlName",e),r.Db(1),r.uc("ngValue",null),r.Db(2),r.uc("ngValue",!0),r.Db(2),r.uc("ngValue",!1)}}function li(e,t){if(1&e&&(r.Xb(0,"span",40),r.Rc(1),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.Tc(" ",e.patternHelpText," ")}}function ui(e,t){if(1&e&&(r.Xb(0,"span",40),r.Rc(1),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.Tc(" ",e.patternHelpText," ")}}function di(e,t){if(1&e&&(r.Xb(0,"span",40),r.bc(1,41),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.fc(e.maxValue),r.cc(1)}}function hi(e,t){if(1&e&&(r.Xb(0,"span",40),r.bc(1,42),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.fc(e.minValue),r.cc(1)}}function fi(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",32),r.Rc(2),r.Wb(),r.Xb(3,"div",11),r.Sb(4,"input",38),r.Pc(5,li,2,1,"span",39),r.Pc(6,ui,2,1,"span",39),r.Pc(7,di,2,1,"span",39),r.Pc(8,hi,2,1,"span",39),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit;r.nc();const t=r.Fc(2),n=r.nc();r.Db(1),r.uc("for",e),r.Db(1),r.Tc("",e," "),r.Db(2),r.uc("type",n.inputType)("id",e)("placeholder",n.humanReadableType)("formControlName",e)("step",n.getStep(n.type,n.configForm.getValue(e))),r.Db(1),r.uc("ngIf",n.configForm.showError(e,t,"pattern")),r.Db(1),r.uc("ngIf",n.configForm.showError(e,t,"invalidUuid")),r.Db(1),r.uc("ngIf",n.configForm.showError(e,t,"max")),r.Db(1),r.uc("ngIf",n.configForm.showError(e,t,"min"))}}function pi(e,t){if(1&e&&(r.Vb(0),r.Pc(1,ci,11,6,"div",13),r.Pc(2,fi,9,11,"div",13),r.Ub()),2&e){const e=r.nc(2);r.Db(1),r.uc("ngIf","bool"===e.type),r.Db(1),r.uc("ngIf","bool"!==e.type)}}function mi(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",1),r.Xb(1,"form",2,3),r.Xb(3,"div",4),r.Xb(4,"div",5),r.Vb(5,6),r.Rc(6,"Edit"),r.Ub(),r.Rc(7),r.Wb(),r.Xb(8,"div",7),r.Xb(9,"div",8),r.Xb(10,"label",9),r.bc(11,10),r.Wb(),r.Xb(12,"div",11),r.Sb(13,"input",12),r.Wb(),r.Wb(),r.Pc(14,ni,6,0,"div",13),r.Pc(15,ii,6,0,"div",13),r.Pc(16,ri,5,0,"div",13),r.Pc(17,si,5,0,"div",13),r.Pc(18,ai,5,1,"div",13),r.Xb(19,"div",14),r.Xb(20,"h3",15),r.bc(21,16),r.Wb(),r.Pc(22,pi,3,2,"ng-container",17),r.Wb(),r.Wb(),r.Xb(23,"div",18),r.Xb(24,"cd-form-button-panel",19),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc().submit()}),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(1),r.uc("formGroup",e.configForm),r.Db(6),r.Tc(" ",e.configForm.getValue("name")," "),r.Db(7),r.uc("ngIf",e.configForm.getValue("desc")),r.Db(1),r.uc("ngIf",e.configForm.getValue("long_desc")),r.Db(1),r.uc("ngIf",""!==e.configForm.getValue("default")),r.Db(1),r.uc("ngIf",""!==e.configForm.getValue("daemon_default")),r.Db(1),r.uc("ngIf",e.configForm.getValue("services").length>0),r.Db(4),r.uc("ngForOf",e.availSections),r.Db(2),r.uc("form",e.configForm)("submitText",e.actionLabels.UPDATE)}}let bi=(()=>{class e extends qn.a{constructor(e,t,n,i,r){super(),this.actionLabels=e,this.route=t,this.router=n,this.configService=i,this.notificationService=r,this.availSections=["global","mon","mgr","osd","mds","client"],this.createForm()}createForm(){const e={name:new xn.h({value:null}),desc:new xn.h({value:null}),long_desc:new xn.h({value:null}),values:new xn.j({}),default:new xn.h({value:null}),daemon_default:new xn.h({value:null}),services:new xn.h([])};this.availSections.forEach(t=>{e.values.addControl(t,new xn.h(null))}),this.configForm=new Gn.a(e)}ngOnInit(){this.route.params.subscribe(e=>{this.configService.get(e.name).subscribe(e=>{this.setResponse(e),this.loadingReady()})})}getValidators(e){const t=Un.getTypeValidators(e);if(t)return this.patternHelpText=t.patternHelpText,"max"in t&&""!==t.max&&(this.maxValue=t.max),"min"in t&&""!==t.min&&(this.minValue=t.min),t.validators}getStep(e,t){return Un.getTypeStep(e,t)}setResponse(e){this.response=e;const t=this.getValidators(e);this.configForm.get("name").setValue(e.name),this.configForm.get("desc").setValue(e.desc),this.configForm.get("long_desc").setValue(e.long_desc),this.configForm.get("default").setValue(e.default),this.configForm.get("daemon_default").setValue(e.daemon_default),this.configForm.get("services").setValue(e.services),this.response.value&&this.response.value.forEach(e=>{let t=null;t="true"===e.value||"false"!==e.value&&e.value,this.configForm.get("values").get(e.section).setValue(t)}),this.availSections.forEach(e=>{this.configForm.get("values").get(e).setValidators(t)});const n=Un.getType(e.type);this.type=n.name,this.inputType=n.inputType,this.humanReadableType=n.humanReadable}createRequest(){const e=[];if(this.availSections.forEach(t=>{const n=this.configForm.getValue(t);null!==n&&""!==n&&e.push({section:t,value:n})}),!Wt.a.isEqual(this.response.value,e)){const t=new Jn;return t.name=this.configForm.getValue("name"),t.value=e,t}return null}submit(){const e=this.createRequest();e&&this.configService.create(e).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated config option " + e.name + ""),this.router.navigate(["/configuration"])},()=>{this.configForm.setErrors({cdSubmitButton:!0})}),this.router.navigate(["/configuration"])}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Pt.a),r.Rb(Pt.e),r.Rb(Bn.a),r.Rb(wn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-configuration-form"]],features:[r.Ab],decls:1,vars:1,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d;return e="Name",t="Values",n="Description",i="Long description",r="Default",s="Daemon default",o="Services",a="-- Default --",c="true",l="false",u="The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".",d="The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + ".",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","configForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],["i18",""],[1,"card-body"],[1,"form-group","row"],[1,"cd-col-form-label"],e,[1,"cd-col-form-input"],["type","text","id","name","formControlName","name","readonly","",1,"form-control"],["class","form-group row",4,"ngIf"],["formGroupName","values"],[1,"cd-header"],t,[4,"ngFor","ngForOf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],n,["id","desc","formControlName","desc","readonly","",1,"form-control","resize-vertical"],i,["id","long_desc","formControlName","long_desc","readonly","",1,"form-control","resize-vertical"],r,["type","text","id","default","formControlName","default","readonly","",1,"form-control"],s,["type","text","id","daemon_default","formControlName","daemon_default","readonly","",1,"form-control"],o,["class","form-component-badge",4,"ngFor","ngForOf"],[1,"form-component-badge"],[1,"badge","badge-dark"],[1,"cd-col-form-label",3,"for"],["id","pool","name","pool",1,"form-control","custom-select",3,"formControlName"],[3,"ngValue"],a,c,l,[1,"form-control",3,"type","id","placeholder","formControlName","step"],["class","invalid-feedback",4,"ngIf"],[1,"invalid-feedback"],u,d]},template:function(e,t){1&e&&r.Pc(0,mi,25,10,"div",0),2&e&&r.uc("cdFormLoading",t.loading)},directives:[Kn.a,xn.B,xn.r,Qn.a,xn.k,Zn.a,On.a,xn.d,ei.a,xn.q,xn.i,s.r,xn.l,s.q,ti.a,xn.z,xn.u,xn.C],styles:[".form-component-badge[_ngcontent-%COMP%]{display:block;height:34px}.form-component-badge[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{margin-top:7px}.resize-vertical[_ngcontent-%COMP%]{resize:vertical}"]}),e})();var gi=n("iExv");function _i(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Sb(2,"br"),r.Wb()),2&e){const e=t.$implicit,n=t.last;r.Db(1),r.Vc(" ",e.section,": ",e.value,"",n?"":",","")}}function vi(e,t){if(1&e&&(r.Xb(0,"span"),r.Xb(1,"span",23),r.Xb(2,"span",24),r.Rc(3),r.oc(4,"uppercase"),r.Wb(),r.Wb(),r.Wb()),2&e){const e=t.$implicit,n=r.nc(2);r.Db(1),r.vc("title",n.flags[e]),r.Db(2),r.Sc(r.pc(4,2,e))}}function yi(e,t){if(1&e&&(r.Xb(0,"span"),r.Xb(1,"span",24),r.Rc(2),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Sc(e)}}function wi(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"table",1),r.Xb(2,"tbody"),r.Xb(3,"tr"),r.Xb(4,"td",2),r.bc(5,3),r.Wb(),r.Xb(6,"td",4),r.Rc(7),r.Wb(),r.Wb(),r.Xb(8,"tr"),r.Xb(9,"td",5),r.bc(10,6),r.Wb(),r.Xb(11,"td"),r.Rc(12),r.Wb(),r.Wb(),r.Xb(13,"tr"),r.Xb(14,"td",5),r.bc(15,7),r.Wb(),r.Xb(16,"td"),r.Rc(17),r.Wb(),r.Wb(),r.Xb(18,"tr"),r.Xb(19,"td",5),r.bc(20,8),r.Wb(),r.Xb(21,"td"),r.Pc(22,_i,3,3,"span",9),r.Wb(),r.Wb(),r.Xb(23,"tr"),r.Xb(24,"td",5),r.bc(25,10),r.Wb(),r.Xb(26,"td"),r.Rc(27),r.Wb(),r.Wb(),r.Xb(28,"tr"),r.Xb(29,"td",5),r.bc(30,11),r.Wb(),r.Xb(31,"td"),r.Rc(32),r.Wb(),r.Wb(),r.Xb(33,"tr"),r.Xb(34,"td",5),r.bc(35,12),r.Wb(),r.Xb(36,"td"),r.Rc(37),r.Wb(),r.Wb(),r.Xb(38,"tr"),r.Xb(39,"td",5),r.bc(40,13),r.Wb(),r.Xb(41,"td"),r.Rc(42),r.Wb(),r.Wb(),r.Xb(43,"tr"),r.Xb(44,"td",5),r.bc(45,14),r.Wb(),r.Xb(46,"td"),r.Rc(47),r.Wb(),r.Wb(),r.Xb(48,"tr"),r.Xb(49,"td",5),r.bc(50,15),r.Wb(),r.Xb(51,"td"),r.Pc(52,vi,5,4,"span",9),r.Wb(),r.Wb(),r.Xb(53,"tr"),r.Xb(54,"td",5),r.bc(55,16),r.Wb(),r.Xb(56,"td"),r.Pc(57,yi,3,1,"span",9),r.Wb(),r.Wb(),r.Xb(58,"tr"),r.Xb(59,"td",5),r.bc(60,17),r.Wb(),r.Xb(61,"td"),r.Rc(62),r.Wb(),r.Wb(),r.Xb(63,"tr"),r.Xb(64,"td",5),r.bc(65,18),r.Wb(),r.Xb(66,"td"),r.Rc(67),r.Wb(),r.Wb(),r.Xb(68,"tr"),r.Xb(69,"td",5),r.bc(70,19),r.Wb(),r.Xb(71,"td"),r.Rc(72),r.oc(73,"booleanText"),r.Wb(),r.Wb(),r.Xb(74,"tr"),r.Xb(75,"td",5),r.bc(76,20),r.Wb(),r.Xb(77,"td"),r.Rc(78),r.Wb(),r.Wb(),r.Xb(79,"tr"),r.Xb(80,"td",5),r.bc(81,21),r.Wb(),r.Xb(82,"td"),r.Rc(83),r.Wb(),r.Wb(),r.Xb(84,"tr"),r.Xb(85,"td",5),r.bc(86,22),r.Wb(),r.Xb(87,"td"),r.Rc(88),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc();r.Db(7),r.Sc(e.selection.name),r.Db(5),r.Sc(e.selection.desc),r.Db(5),r.Sc(e.selection.long_desc),r.Db(5),r.uc("ngForOf",e.selection.value),r.Db(5),r.Sc(e.selection.default),r.Db(5),r.Sc(e.selection.daemon_default),r.Db(5),r.Sc(e.selection.type),r.Db(5),r.Sc(e.selection.min),r.Db(5),r.Sc(e.selection.max),r.Db(5),r.uc("ngForOf",e.selection.flags),r.Db(5),r.uc("ngForOf",e.selection.services),r.Db(5),r.Sc(e.selection.source),r.Db(5),r.Sc(e.selection.level),r.Db(5),r.Sc(r.pc(73,17,e.selection.can_update_at_runtime)),r.Db(6),r.Sc(e.selection.tags),r.Db(5),r.Sc(e.selection.enum_values),r.Db(5),r.Sc(e.selection.see_also)}}let Di=(()=>{class e{constructor(){this.flags={runtime:"The value can be updated at runtime.",no_mon_update:"Daemons/clients do not pull this value from the\n      monitor config database. We disallow setting this option via 'ceph config\n      set ...'. This option should be configured via ceph.conf or via the\n      command line.",startup:"Option takes effect only during daemon startup.",cluster_create:"Option only affects cluster creation.",create:"Option only affects daemon creation."}}ngOnChanges(){this.selection&&(this.selection.services=Wt.a.split(this.selection.services,","))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-configuration-details"]],inputs:{selection:"selection"},features:[r.Bb],decls:1,vars:1,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b;return e="Name",t="Description",n="Long description",i="Current values",r="Default",s="Daemon default",o="Type",a="Min",c="Max",l="Flags",u="Services",d="Source",h="Level",f="Can be updated at runtime (editable)",p="Tags",m="Enum values",b="See also",[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],e,[1,"w-75"],[1,"bold"],t,n,i,[4,"ngFor","ngForOf"],r,s,o,a,c,l,u,d,h,f,p,m,b,[3,"title"],[1,"badge","badge-dark","mr-2"]]},template:function(e,t){1&e&&r.Pc(0,wi,89,19,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,s.q],pipes:[gi.a,s.C],styles:[""]}),e})();const Si=["confValTpl"],xi=["confFlagTpl"];function ki(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Sb(2,"br"),r.Wb()),2&e){const e=t.$implicit,n=t.last;r.Db(1),r.Vc(" ",e.section,": ",e.value,"",n?"":",","")}}function Ti(e,t){if(1&e&&(r.Xb(0,"span"),r.Pc(1,ki,3,3,"span",5),r.Wb()),2&e){const e=r.nc().value;r.Db(1),r.uc("ngForOf",e)}}function Mi(e,t){1&e&&r.Pc(0,Ti,2,1,"span",4),2&e&&r.uc("ngIf",t.value)}let Ci=(()=>{class e extends zt.a{constructor(e,t,n){super(),this.authStorageService=e,this.configurationService=t,this.actionLabels=n,this.data=[],this.icons=_n.a,this.selection=new Ht.a,this.filters=[{name:"Level",prop:"level",filterOptions:["basic","advanced","dev"],filterInitValue:"basic",filterPredicate:(e,t)=>{let n;return function(e){e[e.basic=0]="basic",e[e.advanced=1]="advanced",e[e.dev=2]="dev"}(n||(n={})),n[e.level]<=n[t]}},{name:"Service",prop:"services",filterOptions:["mon","mgr","osd","mds","common","mds_client","rgw"],filterPredicate:(e,t)=>e.services.includes(t)},{name:"Source",prop:"source",filterOptions:["mon"],filterPredicate:(e,t)=>!!e.hasOwnProperty("source")&&e.source.includes(t)},{name:"Modified",prop:"modified",filterOptions:["yes","no"],filterPredicate:(e,t)=>!("yes"!==t||!e.hasOwnProperty("value"))||"no"===t&&!e.hasOwnProperty("value")}],this.permission=this.authStorageService.getPermissions().configOpt;const i=()=>this.selection.first()&&`${encodeURIComponent(this.selection.first().name)}`;this.tableActions=[{permission:"update",icon:_n.a.edit,routerLink:()=>`/configuration/edit/${i()}`,name:this.actionLabels.EDIT,disable:()=>!this.isEditable(this.selection)}]}ngOnInit(){this.columns=[{canAutoResize:!0,prop:"name",name:"Name"},{prop:"desc",name:"Description",cellClass:"wrap"},{prop:"value",name:"Current value",cellClass:"wrap",cellTemplate:this.confValTpl},{prop:"default",name:"Default",cellClass:"wrap"},{prop:"can_update_at_runtime",name:"Editable",cellTransformation:$t.a.checkIcon,flexGrow:.4,cellClass:"text-center"}]}updateSelection(e){this.selection=e}getConfigurationList(e){this.configurationService.getConfigData().subscribe(e=>{this.data=e},()=>{e.error()})}isEditable(e){return 1===e.selected.length&&e.selected[0].can_update_at_runtime}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Bn.a),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-configuration"]],viewQuery:function(e,t){if(1&e&&(r.Wc(Si,3),r.Wc(xi,1)),2&e){let e;r.Ec(e=r.mc())&&(t.confValTpl=e.first),r.Ec(e=r.mc())&&(t.confFlagTpl=e.first)}},features:[r.Ab],decls:5,vars:8,consts:[["selectionType","single",3,"data","columns","extraFilterableColumns","hasDetails","fetchData","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["confValTpl",""],[4,"ngIf"],[4,"ngFor","ngForOf"]],template:function(e,t){1&e&&(r.Xb(0,"cd-table",0),r.lc("fetchData",function(e){return t.getConfigurationList(e)})("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)}),r.Sb(1,"cd-table-actions",1),r.Sb(2,"cd-configuration-details",2),r.Wb(),r.Pc(3,Mi,1,1,"ng-template",null,3,r.Qc)),2&e&&(r.uc("data",t.data)("columns",t.columns)("extraFilterableColumns",t.filters)("hasDetails",!0),r.Db(1),r.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),r.Db(1),r.uc("selection",t.expandedRow))},directives:[Vt.a,Dn.a,Di,s.r,s.q],styles:[".filter[_ngcontent-%COMP%]{padding-right:8px}.fa-stack[_ngcontent-%COMP%]{font-size:.79rem}.fa-stack[_ngcontent-%COMP%]   .fa-stack-1x[_ngcontent-%COMP%]{margin-left:8px;margin-top:5px}  cd-configuration datatable-body-cell.wrap{word-break:break-all}"]}),e})();var Oi=n("cp0P"),Li=n("nYR2");let Ei=(()=>{class e{constructor(e){this.http=e,this.baseURL="api/cluster"}getStatus(){return this.http.get(`${this.baseURL}`,{headers:{Accept:"application/vnd.ceph.api.v0.1+json"}})}updateStatus(e){return this.http.put(`${this.baseURL}`,{status:e},{headers:{Accept:"application/vnd.ceph.api.v0.1+json"}})}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Ai=n("LRne"),Ii=n("lJxs"),Ri=n("Kqap"),Pi=n("BFxc"),Fi=n("xbPD"),Wi=n("mCNh");function ji(e,t,n){return 0===n?[t]:(e.push(t),e)}function Yi(){return function(e,t){return arguments.length>=2?function(n){return Object(Wi.a)(Object(Ri.a)(e,t),Object(Pi.a)(1),Object(Fi.a)(t))(n)}:function(t){return Object(Wi.a)(Object(Ri.a)((t,n,i)=>e(t,n,i+1)),Object(Pi.a)(1))(t)}}(ji,[])}var Ni=n("5+tZ"),zi=n("zNnC"),$i=n("nQ07");let Hi=(()=>{class e{calculateAdditionalData(e){if(!e.life_expectancy_min||!e.life_expectancy_max)return e.state="unknown",e;const t=e=>!!Number.parseFloat(e),n=(e,n)=>e&&n&&t(e)&&t(n)?nn.a.duration(nn()(e).diff(nn()(n))).asWeeks():null,i=nn.a.duration(nn()(nn.a.now()).diff(nn()(e.life_expectancy_stamp))).asWeeks(),r=n(e.life_expectancy_max,e.life_expectancy_stamp),s=n(e.life_expectancy_min,e.life_expectancy_stamp);return e.state=i>1?"stale":null!==r&&r<=2?"bad":null!==s&&s<=4?"warning":"good",e.life_expectancy_weeks={max:null!==r?Math.round(r):null,min:null!==s?Math.round(s):null},e}readable(e){return e.readableDaemons=e.daemons.join(" "),e}prepareDevice(e){return this.readable(this.calculateAdditionalData(e))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Xi=(()=>{class e extends zi.a{constructor(e,t){super(),this.http=e,this.deviceService=t,this.baseURL="api/host",this.baseUIURL="ui-api/host",this.predefinedLabels=["mon","mgr","osd","mds","rgw","nfs","iscsi","rbd","grafana"]}list(e){return this.http.get(this.baseURL,{headers:{Accept:"application/vnd.ceph.api.v1.1+json"},params:{facts:e}})}create(e,t,n,i){return this.http.post(this.baseURL,{hostname:e,addr:t,labels:n,status:i},{observe:"response",headers:{Accept:$i.a.cdVersionHeader("0","1")}})}delete(e){return this.http.delete(`${this.baseURL}/${e}`,{observe:"response"})}getDevices(e){return this.http.get(`${this.baseURL}/${e}/devices`).pipe(Object(Ii.a)(e=>e.map(e=>this.deviceService.prepareDevice(e))))}getSmartData(e){return this.http.get(`${this.baseURL}/${e}/smart`)}getDaemons(e){return this.http.get(`${this.baseURL}/${e}/daemons`)}getLabels(){return this.http.get(`${this.baseUIURL}/labels`)}update(e,t=!1,n=[],i=!1,r=!1){return this.http.put(`${this.baseURL}/${e}`,{update_labels:t,labels:n,maintenance:i,force:r},{headers:{Accept:this.getVersionHeaderValue(0,1)}})}identifyDevice(e,t,n){return this.http.post(`${this.baseURL}/${e}/identify_device`,{device:t,duration:n})}getInventoryParams(e){let t=new o.e;return e&&(t=t.append("refresh",Wt.a.toString(e))),t}getInventory(e,t){const n=this.getInventoryParams(t);return this.http.get(`${this.baseURL}/${e}/inventory`,{params:n})}inventoryList(e){const t=this.getInventoryParams(e);return this.http.get(`${this.baseUIURL}/inventory`,{params:t})}inventoryDeviceList(e,t){let n;return n=e?this.getInventory(e,t).pipe(Yi()):this.inventoryList(t),n.pipe(Object(Ni.a)(e=>{const t=Wt.a.flatMap(e,e=>e.devices.map(t=>(t.hostname=e.name,t.uid=t.device_id?t.device_id:`${t.hostname}-${t.path}`,t)));return Object(Ai.a)(t)}))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b),r.ic(Hi))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Vi=(()=>{class e{constructor(e,t){this.http=e,this.deviceService=t,this.path="api/osd",this.osdDevices=[],this.osdRecvSpeedModalPriorities={KNOWN_PRIORITIES:[{name:null,text:"-- Select the priority --",values:{osd_max_backfills:null,osd_recovery_max_active:null,osd_recovery_max_single_start:null,osd_recovery_sleep:null}},{name:"low",text:"Low",values:{osd_max_backfills:1,osd_recovery_max_active:1,osd_recovery_max_single_start:1,osd_recovery_sleep:.5}},{name:"default",text:"Default",values:{osd_max_backfills:1,osd_recovery_max_active:3,osd_recovery_max_single_start:1,osd_recovery_sleep:0}},{name:"high",text:"High",values:{osd_max_backfills:4,osd_recovery_max_active:4,osd_recovery_max_single_start:4,osd_recovery_sleep:0}}]}}create(e){const t={method:"drive_groups",data:e,tracking_id:Wt.a.join(Wt.a.map(e,"service_id"),", ")};return this.http.post(this.path,t,{observe:"response"})}getList(){return this.http.get(`${this.path}`)}getDetails(e){return this.http.get(`${this.path}/${e}`)}getSmartData(e){return this.http.get(`${this.path}/${e}/smart`)}scrub(e,t){return this.http.post(`${this.path}/${e}/scrub?deep=${t}`,null)}getFlags(){return this.http.get(`${this.path}/flags`)}updateFlags(e){return this.http.put(`${this.path}/flags`,{flags:e})}updateIndividualFlags(e,t){return this.http.put(`${this.path}/flags/individual`,{flags:e,ids:t})}markOut(e){return this.http.put(`${this.path}/${e}/mark`,{action:"out"})}markIn(e){return this.http.put(`${this.path}/${e}/mark`,{action:"in"})}markDown(e){return this.http.put(`${this.path}/${e}/mark`,{action:"down"})}reweight(e,t){return this.http.post(`${this.path}/${e}/reweight`,{weight:t})}update(e,t){return this.http.put(`${this.path}/${e}`,{device_class:t})}markLost(e){return this.http.put(`${this.path}/${e}/mark`,{action:"lost"})}purge(e){return this.http.post(`${this.path}/${e}/purge`,null)}destroy(e){return this.http.post(`${this.path}/${e}/destroy`,null)}delete(e,t,n){return this.http.delete(`${this.path}/${e}`,{observe:"response",params:{preserve_id:t?"true":"false",force:n?"true":"false"}})}safeToDestroy(e){return this.http.get(`${this.path}/safe_to_destroy?ids=${e}`)}safeToDelete(e){return this.http.get(`${this.path}/safe_to_delete?svc_ids=${e}`)}getDevices(e){return this.http.get(`${this.path}/${e}/devices`).pipe(Object(Ii.a)(e=>e.map(e=>this.deviceService.prepareDevice(e))))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b),r.ic(Hi))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Bi=n("kvvV"),Ui=n("kn/O"),qi=n("2Vo4");const Gi=[{stepIndex:1,isComplete:!1}];let Ji=(()=>{class e{constructor(){this.currentStep$=new qi.a(null),this.steps$=new qi.a(Gi),this.currentStep$.next(this.steps$.value[0])}setTotalSteps(e){const t=[];for(let n=1;n<=e;n++)t.push({stepIndex:n,isComplete:!1});this.steps$=new qi.a(t)}setCurrentStep(e){this.currentStep$.next(e)}getCurrentStep(){return this.currentStep$.asObservable()}getSteps(){return this.steps$.asObservable()}moveToNextStep(){this.currentStep$.next(this.steps$.value[this.currentStep$.value.stepIndex])}moveToPreviousStep(){this.currentStep$.next(this.steps$.value[this.currentStep$.value.stepIndex-1-1])}isLastStep(){return this.currentStep$.value.stepIndex===this.steps$.value.length}isFirstStep(){var e;return(null===(e=this.currentStep$.value)||void 0===e?void 0:e.stepIndex)-1==0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Ki=n("aXbf");class Qi{constructor(){this.reset(),this.formatterService=new Ki.a,this.deviceSelectionAttrs={"sys_api.vendor":{name:"vendor"},"sys_api.model":{name:"model"},device_id:{name:"device_id"},human_readable_type:{name:"rotational",formatter:e=>"hdd"===e.toLowerCase()},"sys_api.size":{name:"size",formatter:e=>this.formatterService.format_number(e,1024,["B","KB","MB","GB","TB","PB"]).replace(" ","")}}}reset(){this.spec={service_type:"osd",service_id:`dashboard-${Wt.a.now()}`}}setName(e){this.spec.service_id=e}setHostPattern(e){this.spec.host_pattern=e}setDeviceSelection(e,t){const n=`${e}_devices`;this.spec[n]={},t.forEach(e=>{const t=this.deviceSelectionAttrs[e.prop];t&&(this.spec[n][t.name]=t.formatter?t.formatter(e.value.raw):e.value.raw)})}clearDeviceSelection(e){delete this.spec[`${e}_devices`]}setSlots(e,t){const n=`${e}_slots`;0===t?delete this.spec[n]:this.spec[n]=t}setFeature(e,t){t?this.spec[e]=!0:delete this.spec[e]}}const Zi=function(e){return{active:e}};function er(e,t){if(1&e){const e=r.Yb();r.Xb(0,"ul",4),r.Xb(1,"li",5),r.Xb(2,"a",6),r.lc("click",function(){r.Ic(e);const n=t.$implicit;return r.nc().onStepClick(n)}),r.Xb(3,"span",7),r.bc(4,8),r.Wb(),r.Xb(5,"span"),r.bc(6,9),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=t.$implicit,n=t.index,i=r.nc();r.Db(2),r.uc("ngClass",r.zc(4,Zi,i.currentStep.stepIndex===e.stepIndex)),r.Db(1),r.uc("ngClass",r.zc(6,Zi,i.currentStep.stepIndex===e.stepIndex)),r.Db(1),r.fc(e.stepIndex),r.cc(4),r.Db(2),r.fc(i.stepsTitle[n]),r.cc(6)}}let tr=(()=>{class e{constructor(e){this.stepsService=e}ngOnInit(){this.stepsService.setTotalSteps(this.stepsTitle.length),this.steps=this.stepsService.getSteps(),this.currentStepSub=this.stepsService.getCurrentStep().subscribe(e=>{this.currentStep=e})}onStepClick(e){this.stepsService.setCurrentStep(e)}ngOnDestroy(){this.currentStepSub.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Ji))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-wizard"]],inputs:{stepsTitle:"stepsTitle"},decls:5,vars:3,consts:function(){let e,t;return e="" + "\ufffd0\ufffd" + "",t="" + "\ufffd0\ufffd" + "",[[1,"card-body"],[1,"row","m-7"],[1,"col"],["class","nav nav-pills flex-column",4,"ngFor","ngForOf"],[1,"nav","nav-pills","flex-column"],[1,"nav-item"],[1,"nav-link",3,"ngClass","click"],[1,"circle-step",3,"ngClass"],e,t]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"nav",2),r.Pc(3,er,7,8,"ul",3),r.oc(4,"async"),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(3),r.uc("ngForOf",r.pc(4,1,t.steps)))},directives:[s.q,s.p],pipes:[s.b],styles:[".card-body[_ngcontent-%COMP%]{padding-left:0}span.circle-step[_ngcontent-%COMP%]{background:#adb5bd;border-radius:.8em;color:#fff;display:inline-block;font-weight:700;line-height:1.6em;margin-right:5px;text-align:center;width:1.6em}span.circle-step.active[_ngcontent-%COMP%]{background-color:#2b99a8}.nav-pills[_ngcontent-%COMP%]   .nav-link[_ngcontent-%COMP%]{background-color:#fff;color:#343a40}.nav-pills[_ngcontent-%COMP%]   .nav-link.active[_ngcontent-%COMP%]{color:#2b99a8}"]}),e})();var nr=n("Z21x"),ir=n("quSY");let rr=(()=>{class e{constructor(e){this.http=e,this.url="api/orchestrator",this.disableMessages={noOrchestrator:"The feature is disabled because Orchestrator is not available.",missingFeature:"The Orchestrator backend doesn't support this feature."}}status(){return this.http.get(`${this.url}/status`)}hasFeature(e,t){return Wt.a.every(t,t=>Wt.a.get(e.features,`${t}.available`))}getTableActionDisableDesc(e,t){return!!e&&(e.available?!this.hasFeature(e,t)&&this.disableMessages.missingFeature:this.disableMessages.noOrchestrator)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var sr=n("DNAf"),or=function(e){return e.HOST_LIST="get_hosts",e.HOST_ADD="add_host",e.HOST_REMOVE="remove_host",e.HOST_LABEL_ADD="add_host_label",e.HOST_LABEL_REMOVE="remove_host_label",e.HOST_MAINTENANCE_ENTER="enter_host_maintenance",e.HOST_MAINTENANCE_EXIT="exit_host_maintenance",e.HOST_FACTS="get_facts",e.SERVICE_LIST="describe_service",e.SERVICE_CREATE="apply",e.SERVICE_EDIT="apply",e.SERVICE_DELETE="remove_service",e.SERVICE_RELOAD="service_action",e.DAEMON_LIST="list_daemons",e.OSD_GET_REMOVE_STATUS="remove_osds_status",e.OSD_CREATE="apply_drivegroups",e.OSD_DELETE="remove_osds",e.DEVICE_LIST="get_inventory",e.DEVICE_BLINK_LIGHT="blink_device_light",e}({}),ar=n("EgGo"),cr=n("TuBq"),lr=n.n(cr),ur=n("ajRT"),dr=n("p4Cf"),hr=n("IZUe"),fr=n("ppaS"),pr=n("8xTl");function mr(e,t){1&e&&(r.Xb(0,"span",29),r.bc(1,30),r.Wb())}function br(e,t){1&e&&(r.Xb(0,"span",29),r.bc(1,31),r.Wb())}function gr(e,t){1&e&&(r.Xb(0,"span",29),r.bc(1,35),r.Wb())}function _r(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",32),r.bc(2,33),r.Wb(),r.Xb(3,"div",15),r.Sb(4,"input",34),r.Pc(5,gr,2,0,"span",17),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(5),r.uc("ngIf",t.hostForm.showError("addr",e,"pattern"))}}function vr(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div"),r.Xb(1,"form",5,6),r.Xb(3,"div",7),r.Xb(4,"div",8),r.Xb(5,"label",9),r.Vb(6),r.bc(7,10),r.Ub(),r.Xb(8,"cd-helper"),r.Xb(9,"p"),r.bc(10,11),r.Wb(),r.Xb(11,"ul"),r.Xb(12,"li"),r.hc(13,12),r.Sb(14,"samp"),r.ec(),r.Wb(),r.Xb(15,"li"),r.hc(16,13),r.Sb(17,"samp"),r.ec(),r.Wb(),r.Xb(18,"li"),r.hc(19,14),r.Sb(20,"samp"),r.ec(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(21,"div",15),r.Xb(22,"input",16),r.lc("keyup",function(){return r.Ic(e),r.nc().checkHostNameValue()}),r.Wb(),r.Pc(23,mr,2,0,"span",17),r.Pc(24,br,2,0,"span",17),r.Wb(),r.Wb(),r.Pc(25,_r,6,1,"div",18),r.Xb(26,"div",8),r.Xb(27,"label",19),r.bc(28,20),r.Wb(),r.Xb(29,"div",15),r.Sb(30,"cd-select-badges",21),r.Wb(),r.Wb(),r.Xb(31,"div",8),r.Xb(32,"div",22),r.Xb(33,"div",23),r.Sb(34,"input",24),r.Xb(35,"label",25),r.bc(36,26),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(37,"div",27),r.Xb(38,"cd-form-button-panel",28),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc().submit()}),r.oc(39,"titlecase"),r.oc(40,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(2),t=r.nc();r.Db(1),r.uc("formGroup",t.hostForm),r.Db(22),r.uc("ngIf",t.hostForm.showError("hostname",e,"required")),r.Db(1),r.uc("ngIf",t.hostForm.showError("hostname",e,"uniqueName")),r.Db(1),r.uc("ngIf",!t.hostPattern),r.Db(5),r.uc("data",t.hostForm.controls.labels.value)("options",t.labelsOption)("customBadges",!0)("messages",t.messages),r.Db(8),r.uc("form",t.hostForm)("submitText",r.pc(39,10,t.action)+" "+r.pc(40,12,t.resource))}}let yr=(()=>{class e extends qn.a{constructor(e,t,n,i,r){super(),this.router=e,this.actionLabels=t,this.hostService=n,this.taskWrapper=i,this.activeModal=r,this.hostnameArray=[],this.hostPattern=!1,this.labelsOption=[],this.messages=new sr.a({empty:"There are no labels.",filter:"Filter or add labels",add:"Add label"}),this.resource="host",this.action=this.actionLabels.ADD}ngOnInit(){this.router.url.includes("hosts")&&(this.pageURL="hosts"),this.createForm(),this.hostService.list("false").subscribe(e=>{this.hostnames=e.map(e=>e.hostname),this.loadingReady()}),this.hostService.getLabels().subscribe(e=>{const t=new Set(e.concat(this.hostService.predefinedLabels));this.labelsOption=Array.from(t).map(e=>({enabled:!0,name:e,selected:!1,description:null}))})}checkHostNameValue(){const e=this.hostForm.get("hostname").value;this.hostPattern=!!e.match(/[()\[\]{},]/g)}createForm(){this.hostForm=new Gn.a({hostname:new xn.h("",{validators:[xn.A.required,Cn.a.custom("uniqueName",e=>this.hostnames&&-1!==this.hostnames.indexOf(e))]}),addr:new xn.h("",{validators:[Cn.a.ip()]}),labels:new xn.h([]),maintenance:new xn.h({value:!1,disabled:"hosts"!==this.pageURL})})}isCommaSeparatedPattern(e){return e.includes(",")}isRangeTypePattern(e){return e.includes("[")&&e.includes("]")&&!e.match(/(?![^(]*\)),/g)}replaceBraces(e){return e.replace(/(?<=\d)\s*-\s*(?=\d)/g,"..").replace(/\(/g,"{").replace(/\)/g,"}").replace(/\[/g,"{").replace(/]/g,"}")}checkHostNamePattern(e){if(this.isRangeTypePattern(e)){const t=this.replaceBraces(e);this.hostnameArray=lr()(t)}else if(this.isCommaSeparatedPattern(e)){let t=[];t=e.split(","),t.forEach(e=>{if(this.isRangeTypePattern(e)){const t=this.replaceBraces(e);this.hostnameArray=this.hostnameArray.concat(lr()(t))}else this.hostnameArray.push(e)})}else this.hostnameArray.push(e)}submit(){const e=this.hostForm.get("hostname").value;this.checkHostNamePattern(e),this.addr=this.hostForm.get("addr").value,this.status=this.hostForm.get("maintenance").value?"maintenance":"",this.allLabels=this.hostForm.get("labels").value,"hosts"===this.pageURL||this.allLabels.includes("_no_schedule")||this.allLabels.push("_no_schedule"),this.hostnameArray.forEach(e=>{this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("host/"+gn.e.ADD,{hostname:e}),call:this.hostService.create(e,this.addr,this.allLabels,this.status)}).subscribe({error:()=>{this.hostForm.setErrors({cdSubmitButton:!0})},complete:()=>{"hosts"===this.pageURL?this.router.navigate([this.pageURL,{outlets:{modal:null}}]):this.activeModal.close()}})})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e),r.Rb(gn.b),r.Rb(Xi),r.Rb(Ui.a),r.Rb(Jt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-host-form"]],features:[r.Ab],decls:7,vars:9,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Hostname",n="To add multiple hosts at once, you can enter:",i="a comma-separated list of hostnames " + "\ufffd#14\ufffd" + "(e.g.: example-01,example-02,example-03)" + "\ufffd/#14\ufffd" + ",",r="a range expression " + "\ufffd#17\ufffd" + "(e.g.: example-[01-03].ceph)" + "\ufffd/#17\ufffd" + ",",s="a comma separated range expression " + "\ufffd#20\ufffd" + "(e.g.: example-[01-05].lab.com,example2-[1-4].lab.com,example3-[001-006].lab.com)" + "\ufffd/#20\ufffd" + "",o="Labels",a="Maintenance Mode",c="This field is required.",l="The chosen hostname is already in use.",u="Network address",d="The value is not a valid IP address.",[[3,"pageURL","modalRef"],[1,"modal-title"],e,[1,"modal-content"],[4,"cdFormLoading"],["name","hostForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","hostname",1,"cd-col-form-label","required"],t,n,i,r,s,[1,"cd-col-form-input"],["type","text","placeholder","mon-123","id","hostname","name","hostname","formControlName","hostname","autofocus","",1,"form-control",3,"keyup"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],["for","labels",1,"cd-col-form-label"],o,["id","labels",3,"data","options","customBadges","messages"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","maintenance","type","checkbox","formControlName","maintenance",1,"custom-control-input"],["for","maintenance",1,"custom-control-label"],a,[1,"modal-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],c,l,["for","addr",1,"cd-col-form-label"],u,["type","text","placeholder","192.168.0.1","id","addr","name","addr","formControlName","addr",1,"form-control"],d]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Xb(1,"span",1),r.bc(2,2),r.oc(3,"titlecase"),r.oc(4,"upperFirst"),r.Wb(),r.Vb(5,3),r.Pc(6,vr,41,14,"div",4),r.Ub(),r.Wb()),2&e&&(r.uc("pageURL",t.pageURL)("modalRef",t.activeModal),r.Db(4),r.fc(r.pc(3,5,t.action))(r.pc(4,7,t.resource)),r.cc(2),r.Db(2),r.uc("cdFormLoading",t.loading))},directives:[ur.a,Kn.a,xn.B,xn.r,Qn.a,xn.k,Zn.a,dr.a,On.a,xn.d,ei.a,xn.q,xn.i,hr.a,s.r,fr.a,xn.b,ti.a],pipes:[s.A,pr.a],styles:[""]}),e})();n("jKX/");var wr=n("/NlG");const Dr=["deviceLocation"],Sr=["lifeExpectancy"],xr=["lifeExpectancyTimestamp"];function kr(e,t){if(1&e&&r.Sb(0,"cd-table",5),2&e){const e=r.nc();r.uc("data",e.devices)("columns",e.columns)}}function Tr(e,t){1&e&&(r.Xb(0,"cd-alert-panel",6),r.bc(1,7),r.Wb())}function Mr(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.Sc(e.dev)}}function Cr(e,t){1&e&&r.Pc(0,Mr,2,1,"span",8),2&e&&r.uc("ngForOf",t.value)}function Or(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.oc(2,"i18nPlural"),r.Wb()),2&e){const e=r.nc().value,t=r.nc();r.Db(1),r.Tc("> ",r.qc(2,1,e.min,t.translationMapping),"")}}function Lr(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.oc(2,"i18nPlural"),r.Wb()),2&e){const e=r.nc().value,t=r.nc();r.Db(1),r.Tc("< ",r.qc(2,1,e.max,t.translationMapping),"")}}function Er(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.oc(2,"i18nPlural"),r.Wb()),2&e){const e=r.nc().value,t=r.nc();r.Db(1),r.Uc("",e.min," to ",r.qc(2,2,e.max,t.translationMapping),"")}}function Ar(e,t){if(1&e&&(r.Pc(0,Or,3,4,"span",9),r.Pc(1,Lr,3,4,"span",9),r.Pc(2,Er,3,5,"span",9)),2&e){const e=t.value;r.uc("ngIf",e.min&&!e.max),r.Db(1),r.uc("ngIf",e.max&&!e.min),r.Db(1),r.uc("ngIf",e.max&&e.min)}}function Ir(e,t){1&e&&r.Rc(0),2&e&&r.Tc(" ",t.value,"\n")}let Rr=(()=>{class e{constructor(e,t,n){this.hostService=e,this.datePipe=t,this.osdService=n,this.hostname="",this.osdId=null,this.devices=null,this.columns=[],this.translationMapping={"=1":"# week",other:"# weeks"}}ngOnInit(){this.columns=[{prop:"devid",name:"Device ID",minWidth:200},{prop:"state",name:"State of Health",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{map:{good:{value:"Good",class:"badge-success"},warning:{value:"Warning",class:"badge-warning"},bad:{value:"Bad",class:"badge-danger"},stale:{value:"Stale",class:"badge-info"},unknown:{value:"Unknown",class:"badge-dark"}}}},{prop:"life_expectancy_weeks",name:"Life Expectancy",cellTemplate:this.lifeExpectancyTemplate},{prop:"life_expectancy_stamp",name:"Prediction Creation Date",cellTemplate:this.lifeExpectancyTimestampTemplate,pipe:this.datePipe,isHidden:!0},{prop:"location",name:"Device Name",cellTemplate:this.locationTemplate},{prop:"readableDaemons",name:"Daemons"}]}ngOnChanges(){const e=e=>this.devices=e;this.hostname?this.hostService.getDevices(this.hostname).subscribe(e):null!==this.osdId&&this.osdService.getDevices(this.osdId).subscribe(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Xi),r.Rb(s.e),r.Rb(Vi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-device-list"]],viewQuery:function(e,t){if(1&e&&(r.Wc(Dr,3),r.Wc(Sr,3),r.Wc(xr,3)),2&e){let e;r.Ec(e=r.mc())&&(t.locationTemplate=e.first),r.Ec(e=r.mc())&&(t.lifeExpectancyTemplate=e.first),r.Ec(e=r.mc())&&(t.lifeExpectancyTimestampTemplate=e.first)}},inputs:{hostname:"hostname",osdId:"osdId"},features:[r.Bb],decls:8,vars:2,consts:function(){let e;return e="Neither hostname nor OSD ID given",[[3,"data","columns",4,"ngIf"],["type","warning",4,"ngIf"],["deviceLocation",""],["lifeExpectancy",""],["lifeExpectancyTimestamp",""],[3,"data","columns"],["type","warning"],e,[4,"ngFor","ngForOf"],[4,"ngIf"]]},template:function(e,t){1&e&&(r.Pc(0,kr,1,2,"cd-table",0),r.Pc(1,Tr,2,0,"cd-alert-panel",1),r.Pc(2,Cr,1,1,"ng-template",null,2,r.Qc),r.Pc(4,Ar,3,3,"ng-template",null,3,r.Qc),r.Pc(6,Ir,1,1,"ng-template",null,4,r.Qc)),2&e&&(r.uc("ngIf",t.hostname||null!==t.osdId),r.Db(1),r.uc("ngIf",""===t.hostname&&null===t.osdId))},directives:[s.r,Vt.a,wr.a,s.q],pipes:[s.i],styles:[""]}),e})();var Pr=n("6qls");function Fr(e,t){1&e&&(r.Xb(0,"cd-alert-panel",2),r.bc(1,3),r.Wb())}function Wr(e,t){1&e&&(r.Xb(0,"cd-alert-panel",2),r.hc(1,4),r.Sb(2,"cd-doc",5),r.ec(),r.Wb())}let jr=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-orchestrator-doc-panel"]],inputs:{missingFeatures:"missingFeatures"},decls:3,vars:2,consts:function(){let e,t;return e="The feature is not supported in the current Orchestrator.",t="Orchestrator is not available. Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " on how to configure and enable the functionality.",[["type","info",4,"ngIf","ngIfElse"],["elseBlock",""],["type","info"],e,t,["section","orch"]]},template:function(e,t){if(1&e&&(r.Pc(0,Fr,2,0,"cd-alert-panel",0),r.Pc(1,Wr,3,0,"ng-template",null,1,r.Qc)),2&e){const e=r.Fc(2);r.uc("ngIf",t.missingFeatures)("ngIfElse",e)}},directives:[s.r,wr.a,Pr.a],styles:[""]}),e})(),Yr=(()=>{class e{constructor(e,t,n,i,s,o){this.authStorageService=e,this.dimlessBinary=t,this.modalService=n,this.notificationService=i,this.orchService=s,this.hostService=o,this.devices=[],this.showAvailDeviceOnly=!1,this.hiddenColumns=[],this.filterColumns=["hostname","human_readable_type","available","sys_api.vendor","sys_api.model","sys_api.size"],this.selectionType=void 0,this.filterChange=new r.p,this.fetchInventory=new r.p,this.icons=_n.a,this.columns=[],this.selection=new Ht.a,this.orchStatus=void 0,this.actionOrchFeatures={identify:[or.DEVICE_BLINK_LIGHT]}}ngOnInit(){this.permission=this.authStorageService.getPermissions().osd,this.tableActions=[{permission:"update",icon:_n.a.show,click:()=>this.identifyDevice(),name:"Identify",disable:e=>this.getDisable("identify",e),canBePrimary:e=>!e.hasSingleSelection,visible:()=>Wt.a.isString(this.selectionType)}];const e=[{name:"Hostname",prop:"hostname",flexGrow:1},{name:"Device path",prop:"path",flexGrow:1},{name:"Type",prop:"human_readable_type",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{map:{hdd:{value:"HDD",class:"badge-hdd"},ssd:{value:"SSD",class:"badge-ssd"}}}},{name:"Available",prop:"available",flexGrow:1,cellClass:"text-center",cellTransformation:$t.a.checkIcon},{name:"Vendor",prop:"sys_api.vendor",flexGrow:1},{name:"Model",prop:"sys_api.model",flexGrow:1},{name:"Size",prop:"sys_api.size",flexGrow:1,pipe:this.dimlessBinary},{name:"OSDs",prop:"osd_ids",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{class:"badge-dark",prefix:"osd."}}];this.columns=e.filter(e=>!this.hiddenColumns.includes(e.prop)),Wt.a.forEach(this.filterColumns,e=>{const t=Wt.a.find(this.columns,{prop:e});t&&(t.filterable=!0)}),this.fetchInventory.observers.length>0&&(this.fetchInventorySub=this.table.fetchData.subscribe(()=>{this.fetchInventory.emit()}))}getDevices(){this.showAvailDeviceOnly?this.hostService.inventoryDeviceList().subscribe(e=>{this.devices=Wt.a.filter(e,"available"),this.devices=[...this.devices]},()=>{this.devices=[]}):this.devices=[...this.devices]}ngOnDestroy(){this.fetchInventorySub&&this.fetchInventorySub.unsubscribe()}onColumnFiltersChanged(e){this.filterChange.emit(e)}getDisable(e,t){return!t.hasSingleSelection||this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}updateSelection(e){this.selection=e}identifyDevice(){const e=this.selection.first(),t=e.hostname,n=e.path||e.device_id;this.modalService.show(Mn.a,{titleText:"Identify device " + n + "",message:"Please enter the duration how long to blink the LED.",fields:[{type:"select",name:"duration",value:300,required:!0,typeConfig:{options:[{text:"1 minute",value:60},{text:"2 minutes",value:120},{text:"5 minutes",value:300},{text:"10 minutes",value:600},{text:"15 minutes",value:900}]}}],submitButtonText:"Execute",onSubmit:e=>{this.hostService.identifyDevice(t,n,e.duration).subscribe(()=>{this.notificationService.show(vn.a.success,"Identifying '" + n + "' started on host '" + t + "'")})}})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Qt.a),r.Rb(yn.a),r.Rb(wn.a),r.Rb(rr),r.Rb(Xi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-inventory-devices"]],viewQuery:function(e,t){if(1&e&&r.Wc(Vt.a,3),2&e){let e;r.Ec(e=r.mc())&&(t.table=e.first)}},inputs:{devices:"devices",showAvailDeviceOnly:"showAvailDeviceOnly",hiddenColumns:"hiddenColumns",filterColumns:"filterColumns",selectionType:"selectionType",orchStatus:"orchStatus"},outputs:{filterChange:"filterChange",fetchInventory:"fetchInventory"},decls:2,vars:8,consts:[["identifier","uid","columnMode","flex",3,"data","columns","forceIdentifier","selectionType","searchField","fetchData","updateSelection","columnFiltersChanged"],[1,"table-actions",3,"permission","selection","tableActions"]],template:function(e,t){1&e&&(r.Xb(0,"cd-table",0),r.lc("fetchData",function(){return t.getDevices()})("updateSelection",function(e){return t.updateSelection(e)})("columnFiltersChanged",function(e){return t.onColumnFiltersChanged(e)}),r.Sb(1,"cd-table-actions",1),r.Wb()),2&e&&(r.uc("data",t.devices)("columns",t.columns)("forceIdentifier",!0)("selectionType",t.selectionType)("searchField",!1),r.Db(1),r.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions))},directives:[Vt.a,Dn.a],styles:[".filter[_ngcontent-%COMP%]{padding-right:8px}.fa-stack[_ngcontent-%COMP%]{font-size:.79rem}.fa-stack[_ngcontent-%COMP%]   .fa-stack-1x[_ngcontent-%COMP%]{margin-left:8px;margin-top:5px}"]}),e})();function Nr(e,t){1&e&&r.Sb(0,"cd-orchestrator-doc-panel")}const zr=function(){return[]},$r=function(){return["hostname"]};function Hr(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"legend"),r.bc(2,1),r.Wb(),r.Xb(3,"div",2),r.Xb(4,"div",3),r.Xb(5,"cd-inventory-devices",4),r.lc("fetchInventory",function(){return r.Ic(e),r.nc().refresh()}),r.Wb(),r.Wb(),r.Wb(),r.Ub()}if(2&e){const e=r.nc();r.Db(5),r.uc("devices",e.devices)("hiddenColumns",void 0===e.hostname?r.yc(3,zr):r.yc(4,$r))("orchStatus",e.orchStatus)}}let Xr=(()=>{class e{constructor(e,t,n){this.orchService=e,this.hostService=t,this.ngZone=n,this.reloadInterval=5e3,this.firstRefresh=!0,this.icons=_n.a,this.showDocPanel=!1,this.devices=[]}ngOnInit(){this.orchService.status().subscribe(e=>{this.orchStatus=e,this.showDocPanel=!e.available,e.available&&this.ngZone.runOutsideAngular(()=>{this.reloadSubscriber=Object(Bt.a)(this.reloadInterval,this.reloadInterval).subscribe(()=>{this.ngZone.run(()=>{this.getInventory(!1)})})})})}ngOnDestroy(){var e;null===(e=this.reloadSubscriber)||void 0===e||e.unsubscribe()}ngOnChanges(){var e;(null===(e=this.orchStatus)||void 0===e?void 0:e.available)&&(this.devices=[],this.getInventory(!1))}getInventory(e){""!==this.hostname&&this.hostService.inventoryDeviceList(this.hostname,e).subscribe(e=>{this.devices=e},()=>{this.devices=[]})}refresh(){this.getInventory(!this.firstRefresh),this.firstRefresh=!1}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(rr),r.Rb(Xi),r.Rb(r.D))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-inventory"]],inputs:{hostname:"hostname"},features:[r.Bb],decls:2,vars:2,consts:function(){let e;return e="Physical Disks",[[4,"ngIf"],e,[1,"row"],[1,"col-md-12"],["selectionType","single",3,"devices","hiddenColumns","orchStatus","fetchInventory"]]},template:function(e,t){1&e&&(r.Pc(0,Nr,1,0,"cd-orchestrator-doc-panel",0),r.Pc(1,Hr,6,5,"ng-container",0)),2&e&&(r.uc("ngIf",t.showDocPanel),r.Db(1),r.uc("ngIf",null==t.orchStatus?null:t.orchStatus.available))},directives:[s.r,jr,Yr],styles:[""]}),e})(),Vr=(()=>{class e{constructor(e){this.http=e,this.url="api/service"}list(e){const t=e?{params:(new o.e).set("service_name",e)}:{};return this.http.get(this.url,t)}getDaemons(e){return this.http.get(`${this.url}/${e}/daemons`)}create(e){return this.http.post(this.url,{service_name:e.service_id?`${e.service_type}.${e.service_id}`:e.service_type,service_spec:e},{observe:"response"})}delete(e){return this.http.delete(`${this.url}/${e}`,{observe:"response"})}getKnownTypes(){return this.http.get(`${this.url}/known_types`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Br=n("Dwqy"),Ur=n("zWsK");const qr=["statusTpl"],Gr=["listTpl"],Jr=["daemonsTable"];function Kr(e,t){1&e&&r.Sb(0,"cd-orchestrator-doc-panel")}function Qr(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",6,7),r.lc("fetchData",function(t){return r.Ic(e),r.nc(2).getDaemons(t)}),r.Wb()}if(2&e){const e=r.nc(2);r.uc("data",e.daemons)("columns",e.columns)}}function Zr(e,t){if(1&e&&(r.Xb(0,"div"),r.Pc(1,Qr,2,2,"cd-table",5),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngIf",e.hasOrchestrator)}}function es(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",6,7),r.lc("fetchData",function(t){return r.Ic(e),r.nc(3).getDaemons(t)}),r.Wb()}if(2&e){const e=r.nc(3);r.uc("data",e.daemons)("columns",e.columns)}}function ts(e,t){if(1&e&&r.Pc(0,es,2,2,"cd-table",5),2&e){const e=r.nc(2);r.uc("ngIf",e.hasOrchestrator)}}function ns(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",6,17),r.lc("fetchData",function(t){return r.Ic(e),r.nc(3).getServices(t)}),r.Wb()}if(2&e){const e=r.nc(3);r.uc("data",e.services)("columns",e.serviceColumns)}}function is(e,t){if(1&e&&r.Pc(0,ns,2,2,"cd-table",5),2&e){const e=r.nc(2);r.uc("ngIf",e.hasOrchestrator)}}function rs(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",8,9),r.Xb(3,"li",10),r.Xb(4,"a",11),r.bc(5,12),r.Wb(),r.Pc(6,ts,1,1,"ng-template",13),r.Wb(),r.Xb(7,"li",14),r.Xb(8,"a",11),r.bc(9,15),r.Wb(),r.Pc(10,is,1,1,"ng-template",13),r.Wb(),r.Wb(),r.Sb(11,"div",16),r.Ub()),2&e){const e=r.Fc(2);r.Db(11),r.uc("ngbNavOutlet",e)}}function ss(e,t){if(1&e&&(r.Xb(0,"span",18),r.oc(1,"pipeFunction"),r.Rc(2),r.Wb()),2&e){const e=t.row,n=r.nc();r.uc("ngClass",r.qc(1,2,e,n.getStatusClass)),r.Db(2),r.Tc(" ",e.status_desc," ")}}const os=function(e){return[e]};function as(e,t){if(1&e&&(r.Xb(0,"span"),r.Sb(1,"i",25),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.uc("ngClass",r.zc(1,os,e.icons.infoCircle))}}function cs(e,t){if(1&e&&(r.Xb(0,"span"),r.Sb(1,"i",25),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.uc("ngClass",r.zc(1,os,e.icons.warning))}}function ls(e,t){if(1&e&&(r.Xb(0,"li",23),r.Xb(1,"b"),r.Rc(2),r.oc(3,"relativeDate"),r.Wb(),r.Xb(4,"span",24),r.Rc(5),r.Wb(),r.Sb(6,"br"),r.Pc(7,as,2,3,"span",0),r.Pc(8,cs,2,3,"span",0),r.Rc(9),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Tc("",r.pc(3,5,e.created)," - "),r.Db(3),r.Sc(e.subject),r.Db(2),r.uc("ngIf","INFO"===e.level),r.Db(1),r.uc("ngIf","ERROR"===e.level),r.Db(1),r.Tc(" ",e.message," ")}}function us(e,t){if(1&e&&(r.Xb(0,"ul",21),r.Pc(1,ls,10,7,"li",22),r.Wb()),2&e){const e=r.nc().value,t=r.nc();r.Db(1),r.uc("ngForOf",e)("ngForTrackBy",t.trackByFn)}}function ds(e,t){1&e&&(r.Xb(0,"div"),r.Xb(1,"span"),r.Rc(2,"No data available"),r.Wb(),r.Wb())}function hs(e,t){if(1&e&&r.Pc(0,ds,3,0,"div",0),2&e){const e=r.nc().value;r.uc("ngIf",0===(null==e?null:e.length))}}function fs(e,t){if(1&e&&(r.Pc(0,us,2,2,"ul",19),r.Pc(1,hs,1,1,"ng-template",null,20,r.Qc)),2&e){const e=t.value,n=r.Fc(2);r.uc("ngIf",null==e?null:e.length)("ngIfElse",n)}}let ps=(()=>{class e{constructor(e,t,n,i){this.hostService=e,this.cephServiceService=t,this.orchService=n,this.relativeDatePipe=i,this.icons=_n.a,this.daemons=[],this.services=[],this.columns=[],this.serviceColumns=[],this.hasOrchestrator=!1,this.showDocPanel=!1}ngOnInit(){this.columns=[{name:"Hostname",prop:"hostname",flexGrow:2,filterable:!0},{name:"Daemon type",prop:"daemon_type",flexGrow:1,filterable:!0},{name:"Daemon ID",prop:"daemon_id",flexGrow:1,filterable:!0},{name:"Container ID",prop:"container_id",flexGrow:2,filterable:!0,cellTransformation:$t.a.truncate,customTemplateConfig:{length:12}},{name:"Container Image name",prop:"container_image_name",flexGrow:3,filterable:!0},{name:"Container Image ID",prop:"container_image_id",flexGrow:2,filterable:!0,cellTransformation:$t.a.truncate,customTemplateConfig:{length:12}},{name:"Version",prop:"version",flexGrow:1,filterable:!0},{name:"Status",prop:"status_desc",flexGrow:1,filterable:!0,cellTemplate:this.statusTpl},{name:"Last Refreshed",prop:"last_refresh",pipe:this.relativeDatePipe,flexGrow:1},{name:"Daemon Events",prop:"events",flexGrow:5,cellTemplate:this.listTpl}],this.serviceColumns=[{name:"Service Name",prop:"service_name",flexGrow:2,filterable:!0},{name:"Service Type",prop:"service_type",flexGrow:1,filterable:!0},{name:"Service Events",prop:"events",flexGrow:5,cellTemplate:this.listTpl}],this.orchService.status().subscribe(e=>{this.hasOrchestrator=e.available,this.showDocPanel=!e.available})}ngOnChanges(){Wt.a.isUndefined(this.daemonsTable)||this.daemonsTable.reloadData()}ngAfterViewInit(){this.daemonsTableTplsSub=this.daemonsTableTpls.changes.subscribe(e=>{this.daemonsTable=e.first})}ngOnDestroy(){this.daemonsTableTplsSub&&this.daemonsTableTplsSub.unsubscribe(),this.serviceSub&&this.serviceSub.unsubscribe()}getStatusClass(e){return Wt.a.get({"-1":"badge-danger",0:"badge-warning",1:"badge-success"},e.status,"badge-dark")}getDaemons(e){let t;if(this.hostname)t=this.hostService.getDaemons(this.hostname);else{if(!this.serviceName)return void(this.daemons=[]);t=this.cephServiceService.getDaemons(this.serviceName)}t.subscribe(e=>{this.daemons=e},()=>{this.daemons=[],e.error()})}getServices(e){this.serviceSub=this.cephServiceService.list(this.serviceName).subscribe(e=>{this.services=e},()=>{this.services=[],e.error()})}trackByFn(e,t){return t.created}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Xi),r.Rb(Vr),r.Rb(rr),r.Rb(Br.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-service-daemon-list"]],viewQuery:function(e,t){if(1&e&&(r.Wc(qr,3),r.Wc(Gr,3),r.Wc(Jr,1)),2&e){let e;r.Ec(e=r.mc())&&(t.statusTpl=e.first),r.Ec(e=r.mc())&&(t.listTpl=e.first),r.Ec(e=r.mc())&&(t.daemonsTableTpls=e)}},inputs:{serviceName:"serviceName",hostname:"hostname",flag:"flag"},features:[r.Bb],decls:8,vars:3,consts:function(){let e,t;return e="Details",t="Service Events",[[4,"ngIf"],[4,"ngIf","ngIfElse"],["serviceDetailsTpl",""],["statusTpl",""],["listTpl",""],["columnMode","flex",3,"data","columns","fetchData",4,"ngIf"],["columnMode","flex",3,"data","columns","fetchData"],["daemonsTable",""],["ngbNav","","cdStatefulTab","service-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","service_events"],t,[3,"ngbNavOutlet"],["serviceTable",""],[1,"badge",3,"ngClass"],["class","list-group list-group-flush",4,"ngIf","ngIfElse"],["noEventsAvailable",""],[1,"list-group","list-group-flush"],["class","list-group-item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"list-group-item"],[1,"badge","badge-info"],["aria-hidden","true",3,"ngClass"]]},template:function(e,t){if(1&e&&(r.Pc(0,Kr,1,0,"cd-orchestrator-doc-panel",0),r.Pc(1,Zr,2,1,"div",1),r.Pc(2,rs,12,1,"ng-template",null,2,r.Qc),r.Pc(4,ss,3,5,"ng-template",null,3,r.Qc),r.Pc(6,fs,3,2,"ng-template",null,4,r.Qc)),2&e){const e=r.Fc(3);r.uc("ngIf",t.showDocPanel),r.Db(1),r.uc("ngIf","hostDetails"===t.flag)("ngIfElse",e)}},directives:[s.r,jr,Vt.a,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,s.p,s.q],pipes:[Ur.b,Br.a],styles:[".fa-info-circle[_ngcontent-%COMP%]{color:#2b99a8}.fa-exclamation-triangle[_ngcontent-%COMP%]{color:#ef5c55}.list-group-item[_ngcontent-%COMP%]{background-color:initial;border-width:0}"]}),e})();var ms=n("XFyV");const bs=["innerNav"];function gs(e,t){1&e&&(r.Xb(0,"cd-alert-panel",5),r.bc(1,6),r.Wb())}function _s(e,t){1&e&&(r.Xb(0,"cd-alert-panel",7),r.bc(1,8),r.Wb())}function vs(e,t){1&e&&(r.Xb(0,"cd-alert-panel",10),r.bc(1,11),r.Wb())}function ys(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"cd-alert-panel",20),r.Rc(2),r.Wb(),r.Ub()),2&e){const e=r.nc(2).$implicit;r.Db(2),r.Sc(e.value.userMessage)}}function ws(e,t){1&e&&(r.Xb(0,"cd-alert-panel",23),r.bc(1,24),r.Wb())}function Ds(e,t){1&e&&(r.Vb(0),r.Xb(1,"cd-alert-panel",26),r.bc(2,27),r.Wb(),r.Ub())}function Ss(e,t){1&e&&(r.Xb(0,"cd-alert-panel",28),r.bc(1,29),r.Wb())}function xs(e,t){if(1&e&&(r.Pc(0,Ds,3,0,"ng-container",0),r.Pc(1,Ss,2,0,"ng-template",null,25,r.Qc)),2&e){const e=r.Fc(2),t=r.nc(3).$implicit;r.uc("ngIf",t.value.info.smart_status.passed)("ngIfElse",e)}}function ks(e,t){if(1&e&&(r.Pc(0,ws,2,0,"cd-alert-panel",21),r.oc(1,"pipeFunction"),r.Pc(2,xs,3,2,"ng-template",null,22,r.Qc)),2&e){const e=r.Fc(3),t=r.nc(2).$implicit,n=r.nc(4);r.uc("ngIf",r.qc(1,2,null==t.value.info?null:t.value.info.smart_status,n.isEmpty))("ngIfElse",e)}}function Ts(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",36),2&e){const e=r.nc(4).$implicit;r.uc("renderObjects",!0)("data",e.value.info)}}function Ms(e,t){1&e&&(r.Xb(0,"cd-alert-panel",37),r.bc(1,38),r.Wb())}function Cs(e,t){if(1&e&&(r.Pc(0,Ts,1,2,"cd-table-key-value",34),r.oc(1,"pipeFunction"),r.Pc(2,Ms,2,0,"cd-alert-panel",35),r.oc(3,"pipeFunction")),2&e){const e=r.nc(3).$implicit,t=r.nc(4);r.uc("ngIf",!r.qc(1,2,e.value.info,t.isEmpty)),r.Db(2),r.uc("ngIf",r.qc(3,5,e.value.info,t.isEmpty))}}function Os(e,t){if(1&e&&r.Sb(0,"cd-table",42),2&e){const e=r.nc(4).$implicit,t=r.nc(4);r.uc("data",e.value.smart.attributes.table)("columns",t.smartDataColumns)}}function Ls(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",43),2&e){const e=r.nc(4).$implicit;r.uc("renderObjects",!0)("data",e.value.smart.nvmeData)}}function Es(e,t){1&e&&(r.Xb(0,"cd-alert-panel",44),r.bc(1,45),r.Wb())}function As(e,t){if(1&e&&(r.Pc(0,Os,1,2,"cd-table",39),r.Pc(1,Ls,1,2,"cd-table-key-value",40),r.Pc(2,Es,2,0,"cd-alert-panel",41)),2&e){const e=r.nc(3).$implicit;r.uc("ngIf",null==e.value.smart?null:e.value.smart.attributes),r.Db(1),r.uc("ngIf",null==e.value.smart?null:e.value.smart.nvmeData),r.Db(1),r.uc("ngIf",!(null!=e.value.smart&&e.value.smart.attributes||null!=e.value.smart&&e.value.smart.nvmeData))}}function Is(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",12,30),r.Xb(3,"li",31),r.Xb(4,"a",17),r.bc(5,32),r.Wb(),r.Pc(6,Cs,4,8,"ng-template",18),r.Wb(),r.Xb(7,"li",31),r.Xb(8,"a",17),r.bc(9,33),r.Wb(),r.Pc(10,As,3,3,"ng-template",18),r.Wb(),r.Wb(),r.Sb(11,"div",15),r.Ub()),2&e){const e=r.Fc(2);r.Db(3),r.uc("ngbNavItem",1),r.Db(4),r.uc("ngbNavItem",2),r.Db(4),r.uc("ngbNavOutlet",e)}}function Rs(e,t){if(1&e&&(r.Pc(0,ys,3,1,"ng-container",0),r.Pc(1,ks,4,5,"ng-template",null,19,r.Qc),r.Pc(3,Is,12,3,"ng-container",4),r.oc(4,"pipeFunction"),r.oc(5,"pipeFunction")),2&e){const e=r.Fc(2),t=r.nc().$implicit,n=r.nc(4);r.uc("ngIf",t.value.error)("ngIfElse",e),r.Db(3),r.uc("ngIf",!r.qc(4,3,t.value.info,n.isEmpty)||!r.qc(5,6,t.value.smart,n.isEmpty))}}function Ps(e,t){if(1&e&&(r.Xb(0,"li",16),r.Xb(1,"a",17),r.Rc(2),r.Wb(),r.Pc(3,Rs,6,9,"ng-template",18),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Uc("",e.value.device," (",e.value.identifier,")")}}function Fs(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",12,13),r.Pc(3,Ps,4,2,"li",14),r.oc(4,"keyvalue"),r.Wb(),r.Sb(5,"div",15),r.Ub()),2&e){const e=r.Fc(2),t=r.nc(3);r.Db(3),r.uc("ngForOf",r.pc(4,2,t.data)),r.Db(2),r.uc("ngbNavOutlet",e)}}function Ws(e,t){if(1&e&&(r.Vb(0),r.Pc(1,vs,2,0,"cd-alert-panel",9),r.oc(2,"pipeFunction"),r.Pc(3,Fs,6,4,"ng-container",4),r.oc(4,"pipeFunction"),r.Ub()),2&e){const e=r.nc(2);r.Db(1),r.uc("ngIf",r.qc(2,2,e.data,e.isEmpty)),r.Db(2),r.uc("ngIf",!r.qc(4,5,e.data,e.isEmpty))}}function js(e,t){if(1&e&&(r.Vb(0),r.Pc(1,gs,2,0,"cd-alert-panel",2),r.Pc(2,_s,2,0,"cd-alert-panel",3),r.Pc(3,Ws,5,8,"ng-container",4),r.Ub()),2&e){const e=r.nc();r.Db(1),r.uc("ngIf",e.error),r.Db(1),r.uc("ngIf",e.incompatible),r.Db(1),r.uc("ngIf",!e.error&&!e.incompatible)}}function Ys(e,t){1&e&&(r.Xb(0,"cd-loading-panel"),r.bc(1,46),r.Wb())}let Ns=(()=>{class e{constructor(e,t){this.osdService=e,this.hostService=t,this.osdId=null,this.hostname=null,this.loading=!1,this.incompatible=!1,this.error=!1,this.data={},this.isEmpty=Wt.a.isEmpty}isSmartError(e){return void 0!==Wt.a.get(e,"error")}isNvmeSmartData(e){return"nvme"===Wt.a.get(e,"device.protocol","").toLowerCase()}isHddSmartData(e){return"ata"===Wt.a.get(e,"device.protocol","").toLowerCase()}fetchData(e){const t={};Wt.a.each(e,(e,n)=>{if(this.isSmartError(e)){let i="";i=-22===e.smartctl_error_code?"Smartctl has received an unknown argument (error code " + e.smartctl_error_code + "). You may be using an incompatible version of smartmontools. Version >= 7.0 of smartmontools is required to successfully retrieve data.":"An error with error code " + e.smartctl_error_code + " occurred.",t[n]={error:e.error,smartctl_error_code:e.smartctl_error_code,smartctl_output:e.smartctl_output,userMessage:i,device:e.dev,identifier:e.nvme_vendor}}else 1!==e.json_format_version[0]?this.incompatible=!0:this.isHddSmartData(e)?t[n]=this.extractHddData(e):this.isNvmeSmartData(e)&&(t[n]=this.extractNvmeData(e))}),this.data=t,this.loading=!1}extractNvmeData(e){return{info:Wt.a.omitBy(e,(e,t)=>["nvme_smart_health_information_log"].includes(t)),smart:{nvmeData:e.nvme_smart_health_information_log},device:e.device.name,identifier:e.serial_number}}extractHddData(e){const t=Wt.a.omitBy(e,(e,t)=>["ata_smart_attributes","ata_smart_selective_self_test_log","ata_smart_data"].includes(t));return{info:t,smart:{attributes:e.ata_smart_attributes,data:e.ata_smart_data},device:t.device.name,identifier:t.serial_number}}updateData(){this.loading=!0,null!==this.osdId?this.osdService.getSmartData(this.osdId).subscribe({next:this.fetchData.bind(this),error:e=>{e.preventDefault(),this.error=e,this.loading=!1}}):null!==this.hostname&&this.hostService.getSmartData(this.hostname).subscribe({next:this.fetchData.bind(this),error:e=>{e.preventDefault(),this.error=e,this.loading=!1}})}ngOnInit(){this.smartDataColumns=[{prop:"id",name:"ID"},{prop:"name",name:"Name"},{prop:"raw.value",name:"Raw"},{prop:"thresh",name:"Threshold"},{prop:"value",name:"Value"},{prop:"when_failed",name:"When Failed"},{prop:"worst",name:"Worst"}]}ngOnChanges(e){this.data={},e.osdId?this.osdId=e.osdId.currentValue:e.hostname&&(this.hostname=e.hostname.currentValue),this.updateData()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Vi),r.Rb(Xi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-smart-list"]],viewQuery:function(e,t){if(1&e&&r.Wc(bs,1),2&e){let e;r.Ec(e=r.mc())&&(t.nav=e.first)}},inputs:{osdId:"osdId",hostname:"hostname"},features:[r.Bb],decls:3,vars:2,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f;return e="Failed to retrieve SMART data.",t="The data received has the JSON format version 2.x and is currently incompatible with the dashboard.",n="No SMART data available.",i="SMART overall-health self-assessment test result",r="unknown",s="SMART overall-health self-assessment test result",o="passed",a="SMART overall-health self-assessment test result",c="failed",l="Device Information",u="SMART",d="No device information available for this device.",h="No SMART data available for this device.",f="SMART data is loading.",[[4,"ngIf","ngIfElse"],["isLoading",""],["type","error",4,"ngIf"],["type","warning",4,"ngIf"],[4,"ngIf"],["type","error"],e,["type","warning"],t,["type","info",4,"ngIf"],["type","info"],n,["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","",4,"ngFor","ngForOf"],[3,"ngbNavOutlet"],["ngbNavItem",""],["ngbNavLink",""],["ngbNavContent",""],["noError",""],["id","alert-error","type","warning"],["id","alert-self-test-unknown","size","slim","type","warning","title",i,4,"ngIf","ngIfElse"],["hasSmartStatus",""],["id","alert-self-test-unknown","size","slim","type","warning","title",i],r,["selfTestFailed",""],["id","alert-self-test-passed","size","slim","type","info","title",s],o,["id","alert-self-test-failed","size","slim","type","warning","title",a],c,["innerNav","ngbNav"],[3,"ngbNavItem"],l,u,[3,"renderObjects","data",4,"ngIf"],["id","alert-device-info-unavailable","type","info",4,"ngIf"],[3,"renderObjects","data"],["id","alert-device-info-unavailable","type","info"],d,["updateSelectionOnRefresh","never",3,"data","columns",4,"ngIf"],["updateSelectionOnRefresh","never",3,"renderObjects","data",4,"ngIf"],["id","alert-device-smart-data-unavailable","type","info",4,"ngIf"],["updateSelectionOnRefresh","never",3,"data","columns"],["updateSelectionOnRefresh","never",3,"renderObjects","data"],["id","alert-device-smart-data-unavailable","type","info"],h,f]},template:function(e,t){if(1&e&&(r.Pc(0,js,4,3,"ng-container",0),r.Pc(1,Ys,2,0,"ng-template",null,1,r.Qc)),2&e){const e=r.Fc(2);r.uc("ngIf",!t.loading)("ngIfElse",e)}},directives:[s.r,wr.a,Jt.p,s.q,Jt.u,Jt.r,Jt.s,Jt.q,en.a,Vt.a,ms.a],pipes:[Ur.b,s.k],styles:[""]}),e})();function zs(e,t){if(1&e&&r.Sb(0,"cd-device-list",14),2&e){const e=r.nc(2);r.uc("hostname",e.selection.hostname)}}function $s(e,t){if(1&e&&r.Sb(0,"cd-inventory",14),2&e){const e=r.nc(3);r.uc("hostname",e.selectedHostname)}}function Hs(e,t){1&e&&(r.Xb(0,"li",15),r.Xb(1,"a",5),r.bc(2,16),r.Wb(),r.Pc(3,$s,1,1,"ng-template",7),r.Wb())}function Xs(e,t){if(1&e&&r.Sb(0,"cd-service-daemon-list",19),2&e){const e=r.nc(3);r.uc("hostname",e.selectedHostname)}}function Vs(e,t){1&e&&(r.Xb(0,"li",17),r.Xb(1,"a",5),r.bc(2,18),r.Wb(),r.Pc(3,Xs,1,1,"ng-template",7),r.Wb())}function Bs(e,t){if(1&e&&r.Sb(0,"cd-grafana",22),2&e){const e=r.nc(3);r.uc("grafanaPath","host-details?var-ceph_hosts="+e.selectedHostname)}}function Us(e,t){1&e&&(r.Xb(0,"li",20),r.Xb(1,"a",5),r.bc(2,21),r.Wb(),r.Pc(3,Bs,1,1,"ng-template",7),r.Wb())}function qs(e,t){if(1&e&&r.Sb(0,"cd-smart-list",14),2&e){const e=r.nc(3);r.uc("hostname",e.selectedHostname)}}function Gs(e,t){if(1&e&&r.Pc(0,qs,1,1,"cd-smart-list",23),2&e){const e=r.nc(2),t=r.Fc(2);r.uc("ngIf",e.selectedHostname)("ngIfElse",t)}}function Js(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",2,3),r.Xb(3,"li",4),r.Xb(4,"a",5),r.bc(5,6),r.Wb(),r.Pc(6,zs,1,1,"ng-template",7),r.Wb(),r.Pc(7,Hs,4,0,"li",8),r.Pc(8,Vs,4,0,"li",9),r.Pc(9,Us,4,0,"li",10),r.Xb(10,"li",11),r.Xb(11,"a",5),r.bc(12,12),r.Wb(),r.Pc(13,Gs,1,2,"ng-template",7),r.Wb(),r.Wb(),r.Sb(14,"div",13),r.Ub()),2&e){const e=r.Fc(2),t=r.nc();r.Db(7),r.uc("ngIf",t.permissions.hosts.read),r.Db(1),r.uc("ngIf",t.permissions.hosts.read),r.Db(1),r.uc("ngIf",t.permissions.grafana.read),r.Db(5),r.uc("ngbNavOutlet",e)}}function Ks(e,t){1&e&&(r.Xb(0,"cd-alert-panel",24),r.bc(1,25),r.Wb())}let Qs=(()=>{class e{get selectedHostname(){return void 0!==this.selection?this.selection.hostname:null}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-host-details"]],inputs:{permissions:"permissions",selection:"selection"},decls:3,vars:1,consts:function(){let e,t,n,i,r,s;return e="Devices",t="Device health",n="Physical Disks",i="Daemons",r="Performance Details",s="No hostname found.",[[4,"ngIf"],["noHostname",""],["ngbNav","","cdStatefulTab","host-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","devices"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","inventory",4,"ngIf"],["ngbNavItem","daemons",4,"ngIf"],["ngbNavItem","performance-details",4,"ngIf"],["ngbNavItem","device-health"],t,[3,"ngbNavOutlet"],[3,"hostname"],["ngbNavItem","inventory"],n,["ngbNavItem","daemons"],i,["flag","hostDetails",3,"hostname"],["ngbNavItem","performance-details"],r,["uid","rtOg0AiWz","grafanaStyle","four",3,"grafanaPath"],[3,"hostname",4,"ngIf","ngIfElse"],["type","error"],s]},template:function(e,t){1&e&&(r.Pc(0,Js,15,4,"ng-container",0),r.Pc(1,Ks,2,0,"ng-template",null,1,r.Qc)),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,Rr,Xr,ps,jn.a,Ns,wr.a],styles:[""]}),e})();const Zs=["servicesTpl"],eo=["maintenanceConfirmTpl"],to=["orchTmpl"],no=["flashTmpl"];function io(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",13,14),r.lc("fetchData",function(t){return r.Ic(e),r.nc().getHosts(t)})("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Xb(2,"div",15),r.Sb(3,"cd-table-actions",16),r.Wb(),r.Sb(4,"cd-host-details",17),r.Wb()}if(2&e){const e=r.nc();r.uc("data",e.hosts)("columns",e.columns)("hasDetails",e.hasTableDetails)("toolHeader",!e.hideToolHeader),r.Db(3),r.uc("permission",e.permissions.hosts)("selection",e.selection)("tableActions",e.tableActions),r.Db(1),r.uc("permissions",e.permissions)("selection",e.expandedRow)}}function ro(e,t){1&e&&r.Sb(0,"cd-grafana",19),2&e&&r.uc("grafanaPath","host-overview?")}function so(e,t){1&e&&(r.Xb(0,"li",2),r.Xb(1,"a",3),r.bc(2,18),r.Wb(),r.Pc(3,ro,1,1,"ng-template",5),r.Wb())}const oo=function(e){return[e]};function ao(e,t){if(1&e&&(r.Xb(0,"a",23),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc(2);r.uc("routerLink",r.zc(4,oo,e.cdLink))("queryParams",t.cdParams),r.Db(1),r.Uc("",e.type,".",e.id,"")}}function co(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.Uc(" ",e.type,".",e.id," ")}}function lo(e,t){1&e&&(r.Vb(0),r.Rc(1,", "),r.Ub())}function uo(e,t){if(1&e&&(r.Xb(0,"span"),r.Pc(1,ao,2,6,"a",21),r.Pc(2,co,2,2,"span",22),r.Pc(3,lo,2,0,"ng-container",22),r.Wb()),2&e){const e=t.$implicit,n=t.last;r.Db(1),r.uc("ngIf",e.canRead),r.Db(1),r.uc("ngIf",!e.canRead),r.Db(1),r.uc("ngIf",!n)}}function ho(e,t){1&e&&r.Pc(0,uo,4,3,"span",20),2&e&&r.uc("ngForOf",t.value)}function fo(e,t){if(1&e&&(r.Xb(0,"ul"),r.Xb(1,"li"),r.bc(2,24),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(2),r.fc(e),r.cc(2)}}function po(e,t){if(1&e&&(r.Xb(0,"div"),r.Pc(1,fo,3,1,"ul",22),r.Wb()),2&e){const e=t.last,n=r.nc(2);r.Db(1),r.uc("ngIf",!e||"1"==n.errorMessage.length)}}function mo(e,t){1&e&&(r.Vb(0),r.bc(1,25),r.Ub())}function bo(e,t){if(1&e&&(r.Pc(0,po,2,1,"div",20),r.Pc(1,mo,2,0,"ng-container",22)),2&e){const e=r.nc();r.uc("ngForOf",e.errorMessage),r.Db(1),r.uc("ngIf",e.showSubmit)}}function go(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,27),r.Wb())}function _o(e,t){1&e&&(r.Xb(0,"span",28),r.bc(1,29),r.Wb())}const vo="hosts";let yo=(()=>{class e extends zt.a{constructor(e,t,n,i,r,s,o,a,c){super(),this.authStorageService=e,this.dimlessBinary=t,this.hostService=n,this.actionLabels=i,this.modalService=r,this.taskWrapper=s,this.router=o,this.notificationService=a,this.orchService=c,this.sub=new ir.a,this.hiddenColumns=[],this.hideTitle=!1,this.hideSubmitBtn=!1,this.hasTableDetails=!0,this.hideToolHeader=!1,this.showGeneralActionsOnly=!1,this.columns=[],this.hosts=[],this.isLoadingHosts=!1,this.cdParams={fromLink:"/hosts"},this.selection=new Ht.a,this.isExecuting=!1,this.icons=_n.a,this.messages={nonOrchHost:"The feature is disabled because the selected host is not managed by Orchestrator."},this.actionOrchFeatures={add:[or.HOST_ADD],edit:[or.HOST_LABEL_ADD,or.HOST_LABEL_REMOVE],remove:[or.HOST_REMOVE],maintenance:[or.HOST_MAINTENANCE_ENTER,or.HOST_MAINTENANCE_EXIT]},this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{name:this.actionLabels.ADD,permission:"create",icon:_n.a.add,click:()=>this.router.url.includes("/hosts")?this.router.navigate([vo,{outlets:{modal:[gn.e.ADD]}}]):this.bsModalRef=this.modalService.show(yr),disable:e=>this.getDisable("add",e)},{name:this.actionLabels.EDIT,permission:"update",icon:_n.a.edit,click:()=>this.editAction(),disable:e=>this.getDisable("edit",e)},{name:this.actionLabels.REMOVE,permission:"delete",icon:_n.a.destroy,click:()=>this.deleteAction(),disable:e=>this.getDisable("remove",e)},{name:this.actionLabels.ENTER_MAINTENANCE,permission:"update",icon:_n.a.enter,click:()=>this.hostMaintenance(),disable:e=>this.getDisable("maintenance",e)||this.isExecuting||this.enableButton,visible:()=>!this.showGeneralActionsOnly},{name:this.actionLabels.EXIT_MAINTENANCE,permission:"update",icon:_n.a.exit,click:()=>this.hostMaintenance(),disable:e=>this.getDisable("maintenance",e)||this.isExecuting||!this.enableButton,visible:()=>!this.showGeneralActionsOnly}]}ngOnInit(){this.columns=[{name:"Hostname",prop:"hostname",flexGrow:1},{name:"Services",prop:"services",flexGrow:2,cellTemplate:this.servicesTpl},{name:"Labels",prop:"labels",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{class:"badge-dark"}},{name:"Status",prop:"status",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{map:{maintenance:{class:"badge-warning"}}}},{name:"Model",prop:"model",flexGrow:1},{name:"CPUs",prop:"cpu_count",flexGrow:.3},{name:"Cores",prop:"cpu_cores",flexGrow:.3},{name:"Total Memory",prop:"memory_total_bytes",pipe:this.dimlessBinary,flexGrow:.4},{name:"Raw Capacity",prop:"raw_capacity",pipe:this.dimlessBinary,flexGrow:.5},{name:"HDDs",prop:"hdd_count",flexGrow:.3},{name:"Flash",prop:"flash_count",headerTemplate:this.flashTmpl,flexGrow:.3},{name:"NICs",prop:"nic_count",flexGrow:.3}],this.columns=this.columns.filter(e=>!this.hiddenColumns.includes(e.prop))}ngOnDestroy(){this.sub.unsubscribe()}updateSelection(e){this.selection=e,this.enableButton=!1,this.selection.hasSelection&&"maintenance"===this.selection.first().status&&(this.enableButton=!0)}editAction(){this.hostService.getLabels().subscribe(e=>{const t=this.selection.first(),n=new Set(e.concat(this.hostService.predefinedLabels)),i=Array.from(n).map(e=>({enabled:!0,name:e}));this.modalService.show(Mn.a,{titleText:"Edit Host: " + t.hostname + "",fields:[{type:"select-badges",name:"labels",value:t.labels,label:"Labels",typeConfig:{customBadges:!0,options:i,messages:new sr.a({empty:"There are no labels.",filter:"Filter or add labels",add:"Add label"})}}],submitButtonText:"Edit Host",onSubmit:e=>{this.hostService.update(t.hostname,!0,e.labels).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated Host \"" + t.hostname + "\""),this.table.refreshBtn()})}})})}hostMaintenance(){this.isExecuting=!0;const e=this.selection.first();"maintenance"!==e.status?this.hostService.update(e.hostname,!1,[],!0).subscribe(()=>{this.isExecuting=!1,this.notificationService.show(vn.a.success,"\"" + e.hostname + "\" moved to maintenance"),this.table.refreshBtn()},t=>{if(this.isExecuting=!1,this.errorMessage=t.error.detail.split(/\n/),t.preventDefault(),!t.error.detail.includes("WARNING")||t.error.detail.includes("It is NOT safe to stop")||t.error.detail.includes("ALERT")||t.error.detail.includes("unsafe to stop"))this.notificationService.show(vn.a.error,"\"" + e.hostname + "\" cannot be put into maintenance","" + t.error.detail + "");else{const t={titleText:"Warning",buttonText:"Continue",warning:!0,bodyTpl:this.maintenanceConfirmTpl,showSubmit:!0,onSubmit:()=>{this.hostService.update(e.hostname,!1,[],!0,!0).subscribe(()=>{this.modalRef.close()},()=>this.modalRef.close())}};this.modalRef=this.modalService.show(Tn.a,t)}}):this.hostService.update(e.hostname,!1,[],!0).subscribe(()=>{this.isExecuting=!1,this.notificationService.show(vn.a.success,"\"" + e.hostname + "\" has exited maintenance"),this.table.refreshBtn()})}getDisable(e,t){if("remove"===e||"edit"===e||"maintenance"===e){if(!(null==t?void 0:t.hasSingleSelection))return!0;if(!Wt.a.every(t.selected,"sources.orchestrator"))return this.messages.nonOrchHost}return this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}deleteAction(){const e=this.selection.first().hostname;this.modalRef=this.modalService.show(bn.a,{itemDescription:"Host",itemNames:[e],actionDescription:"remove",submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("host/remove",{hostname:e}),call:this.hostService.delete(e)})})}checkHostsFactsAvailable(){const e=this.orchStatus.features;return!Wt.a.isEmpty(e)&&!!e.get_facts.available}transformHostsData(){if(this.checkHostsFactsAvailable())Wt.a.forEach(this.hosts,e=>{e.memory_total_bytes=1024*e.memory_total_kb,e.raw_capacity=e.hdd_capacity_bytes+e.flash_capacity_bytes});else for(let e=4;e<this.columns.length;e++)this.columns[e].prop="",this.columns[e].cellTemplate=this.orchTmpl}getHosts(e){if(this.isLoadingHosts)return;const t={mds:"cephfs",mon:"monitor",osd:"osd",rgw:"rgw","rbd-mirror":"rbdMirroring",mgr:"manager","tcmu-runner":"iscsi"};this.isLoadingHosts=!0,this.sub=this.orchService.status().pipe(Object(Ni.a)(e=>{this.orchStatus=e;const t=this.checkHostsFactsAvailable();return this.hostService.list(`${t}`)}),Object(Ii.a)(e=>e.map(e=>(e.services.map(e=>{e.cdLink=`/perf_counters/${e.type}/${encodeURIComponent(e.id)}`;const n=this.permissions[t[e.type]];return e.canRead=!!n&&n.read,e}),e)))).subscribe(e=>{this.hosts=e,this.transformHostsData(),this.isLoadingHosts=!1},()=>{this.isLoadingHosts=!1,e.error()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Qt.a),r.Rb(Xi),r.Rb(gn.b),r.Rb(yn.a),r.Rb(Ui.a),r.Rb(Pt.e),r.Rb(wn.a),r.Rb(rr))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-hosts"]],viewQuery:function(e,t){if(1&e&&(r.Wc(Vt.a,1),r.Wc(Zs,3),r.Wc(eo,3),r.Wc(to,3),r.Wc(no,3)),2&e){let e;r.Ec(e=r.mc())&&(t.table=e.first),r.Ec(e=r.mc())&&(t.servicesTpl=e.first),r.Ec(e=r.mc())&&(t.maintenanceConfirmTpl=e.first),r.Ec(e=r.mc())&&(t.orchTmpl=e.first),r.Ec(e=r.mc())&&(t.flashTmpl=e.first)}},inputs:{hiddenColumns:"hiddenColumns",hideTitle:"hideTitle",hideSubmitBtn:"hideSubmitBtn",hasTableDetails:"hasTableDetails",hideToolHeader:"hideToolHeader",showGeneralActionsOnly:"showGeneralActionsOnly"},features:[r.Cb([{provide:ar.a,useValue:new ar.a(vo)}]),r.Ab],decls:17,vars:2,consts:function(){let e,t,n,i,r,s,o,a;return e="Hosts List",t="Overall Performance",n="" + "\ufffd0\ufffd" + "",i="Are you sure you want to continue?",r="Data will be available only if Orchestrator is available.",s="Unavailable",o="SSD, NVMEs",a="Flash",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["servicesTpl",""],["maintenanceConfirmTpl",""],["orchTmpl",""],["flashTmpl",""],["name","modal"],["columnMode","flex","selectionType","single",3,"data","columns","hasDetails","toolHeader","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],["id","host-actions",1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"permissions","selection"],t,["uid","y0KGL0iZz","grafanaStyle","two",3,"grafanaPath"],[4,"ngFor","ngForOf"],["class","service-link",3,"routerLink","queryParams",4,"ngIf"],[4,"ngIf"],[1,"service-link",3,"routerLink","queryParams"],n,i,["ngbTooltip",r],s,["ngbTooltip",o],a]},template:function(e,t){if(1&e&&(r.Xb(0,"ul",0,1),r.Xb(2,"li",2),r.Xb(3,"a",3),r.bc(4,4),r.Wb(),r.Pc(5,io,5,9,"ng-template",5),r.Wb(),r.Pc(6,so,4,0,"li",6),r.Wb(),r.Sb(7,"div",7),r.Pc(8,ho,1,1,"ng-template",null,8,r.Qc),r.Pc(10,bo,2,2,"ng-template",null,9,r.Qc),r.Pc(12,go,2,0,"ng-template",null,10,r.Qc),r.Pc(14,_o,2,0,"ng-template",null,11,r.Qc),r.Sb(16,"router-outlet",12)),2&e){const e=r.Fc(1);r.Db(6),r.uc("ngIf",t.permissions.grafana.read),r.Db(1),r.uc("ngbNavOutlet",e)}},directives:[Jt.p,Jt.r,Jt.s,Jt.q,s.r,Jt.u,Pt.j,Vt.a,Dn.a,Qs,jn.a,s.q,Pt.h,Jt.D],styles:[""]}),e})();var wo=n("2EZI");let Do=(()=>{class e{constructor(e,t,n,i,s){this.activeModal=e,this.actionLabels=t,this.formBuilder=n,this.osdService=i,this.taskWrapper=s,this.driveGroups=[],this.submitAction=new r.p,this.action=t.CREATE,this.createForm()}createForm(){this.formGroup=this.formBuilder.group({})}onSubmit(){this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("osd/"+gn.e.CREATE,{tracking_id:Wt.a.join(Wt.a.map(this.driveGroups,"service_id"),", ")}),call:this.osdService.create(this.driveGroups)}).subscribe({error:()=>{this.formGroup.setErrors({cdSubmitButton:!0})},complete:()=>{this.submitAction.emit(),this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(gn.b),r.Rb(wo.a),r.Rb(Vi),r.Rb(Ui.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-creation-preview-modal"]],inputs:{driveGroups:"driveGroups"},outputs:{submitAction:"submitAction"},decls:15,vars:9,consts:function(){let e,t;return e="OSD creation preview",t="DriveGroups",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],t,[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Xb(7,"h4"),r.bc(8,7),r.Wb(),r.Xb(9,"pre"),r.Rc(10),r.oc(11,"json"),r.Wb(),r.Wb(),r.Xb(12,"div",8),r.Xb(13,"cd-form-button-panel",9),r.lc("submitActionEvent",function(){return t.onSubmit()}),r.oc(14,"titlecase"),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(4),r.uc("formGroup",t.formGroup),r.Db(6),r.Sc(r.pc(11,5,t.driveGroups)),r.Db(3),r.uc("form",t.formGroup)("submitText",r.pc(14,7,t.action)))},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,ti.a],pipes:[s.j,s.A],styles:[""]}),e})();const So=["inventoryDevices"];function xo(e,t){if(1&e&&(r.Xb(0,"span",16),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.Tc(" ",e," ")}}function ko(e,t){if(1&e&&(r.Xb(0,"cd-alert-panel",13),r.Vb(1),r.bc(2,14),r.Ub(),r.Pc(3,xo,2,1,"span",15),r.Wb()),2&e){const e=r.nc();r.uc("showTitle",!1),r.Db(3),r.uc("ngForOf",e.requiredFilters)}}function To(e,t){if(1&e&&(r.Xb(0,"div"),r.Xb(1,"p",17),r.Xb(2,"span"),r.bc(3,18),r.oc(4,"dimlessBinary"),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(4),r.fc(e.filteredDevices.length)(r.pc(4,2,e.capacity)),r.cc(3)}}const Mo=function(){return["available","osd_ids"]};let Co=(()=>{class e{constructor(e,t,n,i){this.formBuilder=e,this.activeModal=t,this.actionLabels=n,this.wizardStepService=i,this.submitAction=new r.p,this.icons=_n.a,this.filterColumns=[],this.devices=[],this.filteredDevices=[],this.capacity=0,this.canSubmit=!1,this.requiredFilters=[],this.action=n.ADD,this.createForm()}ngAfterViewInit(){const e=Wt.a.filter(this.inventoryDevices.columns,e=>this.filterColumns.includes(e.prop)&&"hostname"!==e.prop);setTimeout(()=>{this.requiredFilters=Wt.a.map(e,"name")},0)}createForm(){this.formGroup=this.formBuilder.group({})}onFilterChange(e){if(this.capacity=0,this.canSubmit=!1,Wt.a.isEmpty(e.filters))this.filteredDevices=[],this.event=void 0;else{const t=e.filters.filter(e=>"hostname"!==e.prop);this.canSubmit=!Wt.a.isEmpty(t),this.filteredDevices=e.data,this.capacity=Wt.a.sumBy(this.filteredDevices,"sys_api.size"),this.event=e}}onSubmit(){this.submitAction.emit(this.event),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wo.a),r.Rb(Jt.a),r.Rb(gn.b),r.Rb(Ji))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-devices-selection-modal"]],viewQuery:function(e,t){if(1&e&&r.Wc(So,1),2&e){let e;r.Ec(e=r.mc())&&(t.inventoryDevices=e.first)}},outputs:{submitAction:"submitAction"},decls:14,vars:15,consts:function(){let e,t,n;return e="" + "\ufffd0\ufffd" + " devices",t="At least one of these filters must be applied in order to proceed:",n="Number of devices: " + "\ufffd0\ufffd" + ". Raw capacity: " + "\ufffd1\ufffd" + ".",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],["type","warning","size","slim",3,"showTitle",4,"ngIf"],[3,"devices","filterColumns","showAvailDeviceOnly","hiddenColumns","filterChange"],["inventoryDevices",""],[4,"ngIf"],[1,"modal-footer"],[3,"form","disabled","submitText","submitActionEvent"],["type","warning","size","slim",3,"showTitle"],t,["class","badge badge-dark ml-2",4,"ngFor","ngForOf"],[1,"badge","badge-dark","ml-2"],[1,"text-center"],n]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Pc(7,ko,4,2,"cd-alert-panel",7),r.Xb(8,"cd-inventory-devices",8,9),r.lc("filterChange",function(e){return t.onFilterChange(e)}),r.Wb(),r.Pc(10,To,5,4,"div",10),r.Wb(),r.Xb(11,"div",11),r.Xb(12,"cd-form-button-panel",12),r.lc("submitActionEvent",function(){return t.onSubmit()}),r.oc(13,"titlecase"),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(2),r.fc(t.deviceType),r.cc(2),r.Db(2),r.uc("formGroup",t.formGroup),r.Db(3),r.uc("ngIf",!t.canSubmit),r.Db(1),r.uc("devices",t.devices)("filterColumns",t.filterColumns)("showAvailDeviceOnly",!0)("hiddenColumns",r.yc(14,Mo)),r.Db(2),r.uc("ngIf",t.canSubmit),r.Db(2),r.uc("form",t.formGroup)("disabled",!t.canSubmit||0===t.filteredDevices.length)("submitText",r.pc(13,12,t.action)))},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,s.r,Yr,ti.a,wr.a,s.q],pipes:[s.A,Qt.a],styles:[""]}),e})();function Oo(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,7),r.Wb())}function Lo(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,8),r.Wb())}function Eo(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,9),r.Wb())}const Ao=function(e){return[e]};function Io(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"button",10),r.lc("click",function(){return r.Ic(e),r.nc().showSelectionModal()}),r.Sb(2,"i",11),r.Vb(3),r.bc(4,12),r.Ub(),r.Wb(),r.Ub()}if(2&e){const e=r.nc();r.Db(1),r.uc("title",e.addButtonTooltip)("disabled",0===e.availDevices.length||!e.canSelect||e.expansionCanSelect),r.Db(1),r.uc("ngClass",r.zc(3,Ao,e.icons.add))}}function Ro(e,t){if(1&e&&(r.Xb(0,"span"),r.Xb(1,"span",19),r.Rc(2),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Uc("",e.name,": ",e.value.formatted,"")}}function Po(e,t){if(1&e&&(r.Xb(0,"div",20),r.Xb(1,"span"),r.bc(2,21),r.oc(3,"dimlessBinary"),r.Wb(),r.Wb()),2&e){const e=r.nc(2);r.Db(3),r.fc(r.pc(3,1,e.capacity)),r.cc(2)}}const Fo=function(){return["available","osd_ids"]},Wo=function(){return[]};function jo(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",13),r.Pc(1,Ro,3,2,"span",14),r.Xb(2,"a",15),r.lc("click",function(){return r.Ic(e),r.nc().clearDevices(),!1}),r.Sb(3,"i",11),r.Vb(4),r.bc(5,16),r.Ub(),r.Wb(),r.Wb(),r.Xb(6,"div"),r.Sb(7,"cd-inventory-devices",17),r.Wb(),r.Pc(8,Po,4,3,"div",18)}if(2&e){const e=r.nc();r.Db(1),r.uc("ngForOf",e.appliedFilters),r.Db(2),r.uc("ngClass",r.zc(6,Ao,e.icons.clearFilters)),r.Db(4),r.uc("devices",e.devices)("hiddenColumns",r.yc(8,Fo))("filterColumns",r.yc(9,Wo)),r.Db(1),r.uc("ngIf","data"===e.type)}}let Yo=(()=>{class e{constructor(e,t,n){this.modalService=e,this.osdService=t,this.router=n,this.selected=new r.p,this.cleared=new r.p,this.icons=_n.a,this.devices=[],this.capacity=0,this.appliedFilters=new Array,this.expansionCanSelect=!1,this.tooltips={noAvailDevices:"No available devices",addPrimaryFirst:"Please add primary devices first",addByFilters:"Add devices by using filters"},this.isOsdPage=this.router.url.includes("/osd")}ngOnInit(){var e,t,n;this.isOsdPage||(this.devices=(null===(e=this.osdService)||void 0===e?void 0:e.osdDevices[this.type])?this.osdService.osdDevices[this.type]:[],this.capacity=Wt.a.sumBy(this.devices,"sys_api.size"),this.expansionCanSelect=!!(null===(t=this.osdService)||void 0===t?void 0:t.osdDevices)&&(null===(n=this.osdService)||void 0===n?void 0:n.osdDevices.disableSelect)),this.updateAddButtonTooltip()}ngOnChanges(){this.updateAddButtonTooltip()}showSelectionModal(){let e=["human_readable_type","sys_api.vendor","sys_api.model","sys_api.size"];"data"===this.type&&(e=["hostname",...e]),this.modalService.show(Co,{hostname:this.hostname,deviceType:this.name,devices:this.availDevices,filterColumns:e},{size:"xl"}).componentInstance.submitAction.subscribe(e=>{this.devices=e.data,this.capacity=Wt.a.sumBy(this.devices,"sys_api.size"),this.appliedFilters=e.filters;const t=Wt.a.assign({type:this.type},e);this.isOsdPage||(this.osdService.osdDevices[this.type]=this.devices,this.osdService.osdDevices.disableSelect=this.canSelect||this.devices.length===this.availDevices.length,this.osdService.osdDevices[this.type].capacity=this.capacity),this.selected.emit(t)})}updateAddButtonTooltip(){this.addButtonTooltip="data"===this.type&&0===this.availDevices.length?this.tooltips.noAvailDevices:this.canSelect?0===this.availDevices.length?this.tooltips.noAvailDevices:this.tooltips.addByFilters:this.tooltips.addPrimaryFirst}clearDevices(){this.isOsdPage||(this.expansionCanSelect=!1,this.osdService.osdDevices.disableSelect=!1,this.osdService.osdDevices=[]);const e={type:this.type,clearedDevices:[...this.devices]};this.devices=[],this.cleared.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(yn.a),r.Rb(Vi),r.Rb(Pt.e))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-devices-selection-groups"]],inputs:{type:"type",name:"name",hostname:"hostname",availDevices:"availDevices",canSelect:"canSelect"},outputs:{selected:"selected",cleared:"cleared"},features:[r.Bb],decls:12,vars:6,consts:function(){let e,t,n,i,r,s,o;return e="" + "\ufffd0\ufffd" + " devices",t="The primary storage devices. These devices contain all OSD data.",n="Write-Ahead-Log devices. These devices are used for BlueStore\u2019s internal journal. It is only useful to use a WAL device if the device is faster than the primary device (e.g. NVME devices or SSDs). If there is only a small amount of fast storage available (e.g., less than a gigabyte), we recommend using it as a WAL device.",i="DB devices can be used for storing BlueStore\u2019s internal metadata. It is only helpful to provision a DB device if it is faster than the primary device (e.g. NVME devices or SSD).",r="Add",s="Clear",o="Raw capacity: " + "\ufffd0\ufffd" + "",[[1,"form-group","row"],["for","createDeleteButton",1,"cd-col-form-label"],e,[4,"ngIf"],[1,"cd-col-form-input"],[4,"ngIf","ngIfElse"],["blockClearDevices",""],t,n,i,["type","button","data-toggle","tooltip",1,"btn","btn-light",3,"title","disabled","click"],[3,"ngClass"],r,[1,"pb-2","my-2","border-bottom"],[4,"ngFor","ngForOf"],["href","",1,"tc_clearSelections",3,"click"],s,[3,"devices","hiddenColumns","filterColumns"],["class","float-right",4,"ngIf"],[1,"badge","badge-dark","mr-2"],[1,"float-right"],o]},template:function(e,t){if(1&e&&(r.Xb(0,"div",0),r.Xb(1,"label",1),r.Vb(2),r.bc(3,2),r.Ub(),r.Xb(4,"cd-helper"),r.Pc(5,Oo,2,0,"span",3),r.Pc(6,Lo,2,0,"span",3),r.Pc(7,Eo,2,0,"span",3),r.Wb(),r.Wb(),r.Xb(8,"div",4),r.Pc(9,Io,5,5,"ng-container",5),r.Pc(10,jo,9,10,"ng-template",null,6,r.Qc),r.Wb(),r.Wb()),2&e){const e=r.Fc(11);r.Db(3),r.fc(t.name),r.cc(3),r.Db(2),r.uc("ngIf","data"===t.type),r.Db(1),r.uc("ngIf","wal"===t.type),r.Db(1),r.uc("ngIf","db"===t.type),r.Db(2),r.uc("ngIf",0===t.devices.length)("ngIfElse",e)}},directives:[Zn.a,dr.a,s.r,On.a,s.p,s.q,Yr],pipes:[Qt.a],styles:[".tc_clearSelections[_ngcontent-%COMP%]{text-decoration:none}"]}),e})();const No=["dataDeviceSelectionGroups"],zo=["walDeviceSelectionGroups"],$o=["dbDeviceSelectionGroups"],Ho=["previewButtonPanel"];function Xo(e,t){1&e&&r.Sb(0,"cd-orchestrator-doc-panel")}function Vo(e,t){if(1&e&&(r.Xb(0,"div",23),r.bc(1,24),r.oc(2,"titlecase"),r.oc(3,"upperFirst"),r.Wb()),2&e){const e=r.nc(2);r.Db(3),r.fc(r.pc(2,2,e.action))(r.pc(3,4,e.resource)),r.cc(1)}}function Bo(e,t){1&e&&(r.Xb(0,"span",32),r.bc(1,33),r.Wb())}function Uo(e,t){if(1&e&&(r.Xb(0,"div",25),r.Xb(1,"label",26),r.Vb(2),r.bc(3,27),r.Ub(),r.Xb(4,"cd-helper"),r.Xb(5,"span"),r.bc(6,28),r.Wb(),r.Sb(7,"br"),r.Xb(8,"span"),r.bc(9,29),r.Wb(),r.Wb(),r.Wb(),r.Xb(10,"div",20),r.Sb(11,"input",30),r.Pc(12,Bo,2,0,"span",31),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(12),r.uc("ngIf",t.form.showError("walSlots",e,"min"))}}function qo(e,t){1&e&&(r.Xb(0,"span",32),r.bc(1,39),r.Wb())}function Go(e,t){if(1&e&&(r.Xb(0,"div",25),r.Xb(1,"label",34),r.Vb(2),r.bc(3,35),r.Ub(),r.Xb(4,"cd-helper"),r.Xb(5,"span"),r.bc(6,36),r.Wb(),r.Sb(7,"br"),r.Xb(8,"span"),r.bc(9,37),r.Wb(),r.Wb(),r.Wb(),r.Xb(10,"div",20),r.Sb(11,"input",38),r.Pc(12,qo,2,0,"span",31),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(12),r.uc("ngIf",t.form.showError("dbSlots",e,"min"))}}function Jo(e,t){if(1&e&&(r.Xb(0,"div",40),r.Sb(1,"input",41),r.Xb(2,"label",42),r.Rc(3),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.vc("id",e.key),r.vc("name",e.key),r.vc("formControlName",e.key),r.Db(1),r.vc("for",e.key),r.Db(1),r.Sc(e.desc)}}function Ko(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",43),r.Xb(1,"cd-form-button-panel",44,45),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc(2).submit()}),r.Wb(),r.Wb()}if(2&e){r.nc();const e=r.Fc(8),t=r.nc();r.Db(1),r.uc("form",t.form)("disabled",0===e.devices.length)("submitText",t.actionLabels.PREVIEW)}}function Qo(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",2),r.Xb(1,"form",3,4),r.Xb(3,"div",5),r.Pc(4,Vo,4,6,"div",6),r.Xb(5,"div",7),r.Xb(6,"fieldset"),r.Xb(7,"cd-osd-devices-selection-groups",8,9),r.lc("selected",function(t){return r.Ic(e),r.nc().onDevicesSelected(t)})("cleared",function(t){return r.Ic(e),r.nc().onDevicesCleared(t)}),r.Wb(),r.Wb(),r.Xb(9,"fieldset"),r.Xb(10,"legend"),r.bc(11,10),r.Wb(),r.Xb(12,"cd-osd-devices-selection-groups",11,12),r.lc("selected",function(t){return r.Ic(e),r.nc().onDevicesSelected(t)})("cleared",function(t){return r.Ic(e),r.nc().onDevicesCleared(t)}),r.Wb(),r.Pc(14,Uo,13,1,"div",13),r.Xb(15,"cd-osd-devices-selection-groups",14,15),r.lc("selected",function(t){return r.Ic(e),r.nc().onDevicesSelected(t)})("cleared",function(t){return r.Ic(e),r.nc().onDevicesCleared(t)}),r.Wb(),r.Pc(17,Go,13,1,"div",13),r.Wb(),r.Xb(18,"fieldset"),r.Xb(19,"legend"),r.bc(20,16),r.Wb(),r.Xb(21,"div",17),r.Xb(22,"label",18),r.bc(23,19),r.Wb(),r.Xb(24,"div",20),r.Pc(25,Jo,4,5,"div",21),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(26,Ko,3,3,"div",22),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(8),t=r.Fc(13),n=r.Fc(16),i=r.nc();r.Db(1),r.uc("formGroup",i.form),r.Db(3),r.uc("ngIf",!i.hideTitle),r.Db(3),r.uc("availDevices",i.availDevices)("canSelect",0!==i.availDevices.length),r.Db(5),r.uc("availDevices",i.availDevices)("canSelect",0!==e.devices.length),r.Db(2),r.uc("ngIf",0!==t.devices.length),r.Db(1),r.uc("availDevices",i.availDevices)("canSelect",0!==e.devices.length),r.Db(2),r.uc("ngIf",0!==n.devices.length),r.Db(8),r.uc("ngForOf",i.featureList),r.Db(1),r.uc("ngIf",!i.hideSubmitBtn)}}let Zo=(()=>{class e extends qn.a{constructor(e,t,n,i,s,o,a){super(),this.actionLabels=e,this.authStorageService=t,this.orchService=n,this.hostService=i,this.router=s,this.modalService=o,this.wizardStepService=a,this.hideTitle=!1,this.hideSubmitBtn=!1,this.emitDriveGroup=new r.p,this.icons=_n.a,this.columns=[],this.allDevices=[],this.availDevices=[],this.dataDeviceFilters=[],this.dbDeviceFilters=[],this.walDeviceFilters=[],this.hostname="",this.driveGroup=new Qi,this.featureList=[],this.hasOrchestrator=!0,this.resource="OSDs",this.action=this.actionLabels.CREATE,this.features={encrypted:{key:"encrypted",desc:"Encryption"}},this.featureList=Wt.a.map(this.features,(e,t)=>Object.assign(e,{key:t})),this.createForm()}ngOnInit(){this.orchService.status().subscribe(e=>{this.hasOrchestrator=e.available,e.available?this.getDataDevices():this.loadingNone()}),this.form.get("walSlots").valueChanges.subscribe(e=>this.setSlots("wal",e)),this.form.get("dbSlots").valueChanges.subscribe(e=>this.setSlots("db",e)),Wt.a.each(this.features,e=>{this.form.get("features").get(e.key).valueChanges.subscribe(t=>this.featureFormUpdate(e.key,t))})}createForm(){this.form=new Gn.a({walSlots:new xn.h(0,{validators:[xn.A.min(0)]}),dbSlots:new xn.h(0,{validators:[xn.A.min(0)]}),features:new Gn.a(this.featureList.reduce((e,t)=>(e[t.key]=new xn.h({value:!1,disabled:!0}),e),{}))})}getDataDevices(){this.hostService.inventoryDeviceList().subscribe(e=>{this.allDevices=Wt.a.filter(e,"available"),this.availDevices=[...this.allDevices],this.loadingReady()},()=>{this.allDevices=[],this.availDevices=[],this.loadingError()})}setSlots(e,t){"number"==typeof t&&t>=0&&this.driveGroup.setSlots(e,t)}featureFormUpdate(e,t){this.driveGroup.setFeature(e,t)}enableFeatures(){this.featureList.forEach(e=>{this.form.get(e.key).enable({emitEvent:!1})})}disableFeatures(){this.featureList.forEach(e=>{const t=this.form.get(e.key);t.disable({emitEvent:!1}),t.setValue(!1,{emitEvent:!1})})}onDevicesSelected(e){if(this.availDevices=e.dataOut,"data"===e.type){const t=Wt.a.find(e.filters,{prop:"hostname"});t?(this.hostname=t.value.raw,this.availDevices=e.dataOut.filter(e=>e.hostname===this.hostname),this.driveGroup.setHostPattern(this.hostname)):this.driveGroup.setHostPattern("*"),this.enableFeatures()}this.driveGroup.setDeviceSelection(e.type,e.filters),this.emitDriveGroup.emit(this.driveGroup)}onDevicesCleared(e){"data"===e.type?(this.availDevices=[...this.allDevices],this.walDeviceSelectionGroups.devices=[],this.dbDeviceSelectionGroups.devices=[],this.disableFeatures(),this.driveGroup.reset(),this.form.get("walSlots").setValue(0,{emitEvent:!1}),this.form.get("dbSlots").setValue(0,{emitEvent:!1})):(this.availDevices=[...this.availDevices,...e.clearedDevices],this.driveGroup.clearDeviceSelection(e.type),this.form.get(`${e.type}Slots`).setValue(0,{emitEvent:!1}))}submit(){const e=this.authStorageService.getUsername();this.driveGroup.setName(`dashboard-${e}-${Wt.a.now()}`),this.modalService.show(Do,{driveGroups:[this.driveGroup.spec]}).componentInstance.submitAction.subscribe(()=>{this.router.navigate(["/osd"])}),this.previewButtonPanel.submitButton.loading=!1}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Gt.a),r.Rb(rr),r.Rb(Xi),r.Rb(Pt.e),r.Rb(yn.a),r.Rb(Ji))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-form"]],viewQuery:function(e,t){if(1&e&&(r.Wc(No,1),r.Wc(zo,1),r.Wc($o,1),r.Wc(Ho,1)),2&e){let e;r.Ec(e=r.mc())&&(t.dataDeviceSelectionGroups=e.first),r.Ec(e=r.mc())&&(t.walDeviceSelectionGroups=e.first),r.Ec(e=r.mc())&&(t.dbDeviceSelectionGroups=e.first),r.Ec(e=r.mc())&&(t.previewButtonPanel=e.first)}},inputs:{hideTitle:"hideTitle",hideSubmitBtn:"hideSubmitBtn"},outputs:{emitDriveGroup:"emitDriveGroup"},features:[r.Ab],decls:2,vars:2,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d;return e="Shared devices",t="Configuration",n="Features",i="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",r="WAL slots",s="How many OSDs per WAL device.",o="Specify 0 to let Orchestrator backend decide it.",a="Value should be greater than or equal to 0",c="DB slots",l="How many OSDs per DB device.",u="Specify 0 to let Orchestrator backend decide it.",d="Value should be greater than or equal to 0",[[4,"ngIf"],["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],["class","card-header",4,"ngIf"],[1,"card-body"],["name","Primary","type","data",3,"availDevices","canSelect","selected","cleared"],["dataDeviceSelectionGroups",""],e,["name","WAL","type","wal",3,"availDevices","canSelect","selected","cleared"],["walDeviceSelectionGroups",""],["class","form-group row",4,"ngIf"],["name","DB","type","db",3,"availDevices","canSelect","selected","cleared"],["dbDeviceSelectionGroups",""],t,["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],n,[1,"cd-col-form-input"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["class","card-footer",4,"ngIf"],[1,"card-header"],i,[1,"form-group","row"],["for","walSlots",1,"cd-col-form-label"],r,s,o,["id","walSlots","name","walSlots","type","number","min","0","formControlName","walSlots",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"invalid-feedback"],a,["for","dbSlots",1,"cd-col-form-label"],c,l,u,["id","dbSlots","name","dbSlots","type","number","min","0","formControlName","dbSlots",1,"form-control"],d,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],[1,"card-footer"],["wrappingClass","text-right",3,"form","disabled","submitText","submitActionEvent"],["previewButtonPanel",""]]},template:function(e,t){1&e&&(r.Pc(0,Xo,1,0,"cd-orchestrator-doc-panel",0),r.Pc(1,Qo,27,12,"div",1)),2&e&&(r.uc("ngIf",!t.hasOrchestrator),r.Db(1),r.uc("cdFormLoading",t.loading))},directives:[s.r,Kn.a,jr,xn.B,xn.r,Qn.a,xn.k,Yo,Zn.a,xn.l,s.q,dr.a,On.a,xn.v,xn.d,ei.a,xn.q,xn.i,xn.b,ti.a],pipes:[s.A,pr.a],styles:[""]}),e})();var ea=n("3E0/");let ta=(()=>{class e{transform(e){if(Wt.a.isUndefined(e))return "no spec";if(Wt.a.get(e,"unmanaged",!1))return "unmanaged";const t=[],n=Wt.a.get(e,"placement.hosts"),i=Wt.a.get(e,"placement.count"),r=Wt.a.get(e,"placement.label"),s=Wt.a.get(e,"placement.host_pattern");return Wt.a.isArray(n)&&t.push(...n),Wt.a.isNumber(i)&&t.push("count:" + i + ""),Wt.a.isString(r)&&t.push("label:" + r + ""),Wt.a.isString(s)&&t.push(s),t.join(";")}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"placement",type:e,pure:!0}),e})();var na=n("XNiG"),ia=n("VRyK"),ra=n("7o/Q"),sa=n("D0XW");function oa(e,t=sa.a){return n=>n.lift(new aa(e,t))}class aa{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new ca(e,this.dueTime,this.scheduler))}}class ca extends ra.a{constructor(e,t,n){super(e),this.dueTime=t,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(la,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function la(e){e.debouncedNext()}var ua=n("/uUt"),da=n("pLZG"),ha=n("Ekvf"),fa=n("a96k"),pa=n("D4zM"),ma=n("cEzo");function ba(e,t){if(1&e&&(r.Xb(0,"option",29),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e),r.Db(1),r.Tc(" ",e," ")}}function ga(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,31),r.Wb())}function _a(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,36),r.Wb()),2&e&&r.uc("ngValue",null)}function va(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,37),r.Wb()),2&e&&r.uc("ngValue",null)}function ya(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,38),r.Wb()),2&e&&r.uc("ngValue",null)}function wa(e,t){if(1&e&&(r.Xb(0,"option",29),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.service_name),r.Db(1),r.Sc(e.service_name)}}function Da(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,39),r.Wb())}const Sa=function(){return["ingress"]},xa=function(e){return{required:e}};function ka(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",7),r.Xb(1,"label",32),r.bc(2,33),r.Wb(),r.Xb(3,"div",10),r.Xb(4,"select",34),r.lc("change",function(){return r.Ic(e),r.nc().prePopulateId()}),r.Pc(5,_a,2,1,"option",35),r.Pc(6,va,2,1,"option",35),r.Pc(7,ya,2,1,"option",35),r.Pc(8,wa,2,2,"option",14),r.Wb(),r.Pc(9,Da,2,0,"span",15),r.Wb(),r.Wb()}if(2&e){const e=r.nc(),t=r.Fc(7);r.Db(1),r.uc("ngClass",r.zc(7,xa,r.yc(6,Sa).includes(e.serviceForm.controls.service_type.value))),r.Db(4),r.uc("ngIf",null===e.services),r.Db(1),r.uc("ngIf",null!==e.services&&0===e.services.length),r.Db(1),r.uc("ngIf",null!==e.services&&e.services.length>0),r.Db(1),r.uc("ngForOf",e.services),r.Db(1),r.uc("ngIf",e.serviceForm.showError("backend_service",t,"required"))}}function Ta(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,40),r.Wb())}function Ma(e,t){1&e&&(r.Xb(0,"span",30),r.hc(1,41),r.Sb(2,"strong"),r.ec(),r.Wb())}function Ca(e,t){1&e&&(r.Xb(0,"div",7),r.Xb(1,"label",42),r.bc(2,43),r.Wb(),r.Xb(3,"div",10),r.Xb(4,"select",44),r.Xb(5,"option",45),r.bc(6,46),r.Wb(),r.Xb(7,"option",47),r.bc(8,48),r.Wb(),r.Wb(),r.Wb(),r.Wb())}function Oa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,52),r.Wb())}function La(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",7),r.Xb(1,"label",49),r.bc(2,50),r.Wb(),r.Xb(3,"div",10),r.Xb(4,"input",51),r.lc("focus",function(t){return r.Ic(e),r.nc().labelFocus.next(t.target.value)})("click",function(t){return r.Ic(e),r.nc().labelClick.next(t.target.value)}),r.Wb(),r.Pc(5,Oa,2,0,"span",15),r.Wb(),r.Wb()}if(2&e){const e=r.nc(),t=r.Fc(7);r.Db(4),r.uc("ngbTypeahead",e.searchLabels),r.Db(1),r.uc("ngIf",e.serviceForm.showError("label",t,"required"))}}function Ea(e,t){if(1&e&&(r.Xb(0,"div",7),r.Xb(1,"label",53),r.bc(2,54),r.Wb(),r.Xb(3,"div",10),r.Sb(4,"cd-select-badges",55),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(4),r.uc("data",e.serviceForm.controls.hosts.value)("options",e.hosts.options)("messages",e.hosts.messages)}}function Aa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,60),r.Wb())}function Ia(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,61),r.Wb())}function Ra(e,t){if(1&e&&(r.Xb(0,"div",7),r.Xb(1,"label",56),r.Xb(2,"span"),r.bc(3,57),r.Wb(),r.Xb(4,"cd-helper"),r.bc(5,58),r.Wb(),r.Wb(),r.Xb(6,"div",10),r.Sb(7,"input",59),r.Pc(8,Aa,2,0,"span",15),r.Pc(9,Ia,2,0,"span",15),r.Wb(),r.Wb()),2&e){const e=r.nc(),t=r.Fc(7);r.Db(8),r.uc("ngIf",e.serviceForm.showError("count",t,"min")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("count",t,"pattern"))}}function Pa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,65),r.Wb())}function Fa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,66),r.Wb())}function Wa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,67),r.Wb())}function ja(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",7),r.Xb(2,"label",62),r.bc(3,63),r.Wb(),r.Xb(4,"div",10),r.Sb(5,"input",64),r.Pc(6,Pa,2,0,"span",15),r.Pc(7,Fa,2,0,"span",15),r.Pc(8,Wa,2,0,"span",15),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc(),t=r.Fc(7);r.Db(6),r.uc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"pattern")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"min")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("rgw_frontend_port",t,"max"))}}function Ya(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,89),r.Wb()),2&e&&r.uc("ngValue",null)}function Na(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,90),r.Wb()),2&e&&r.uc("ngValue",null)}function za(e,t){1&e&&(r.Xb(0,"option",12),r.bc(1,91),r.Wb()),2&e&&r.uc("ngValue",null)}function $a(e,t){if(1&e&&(r.Xb(0,"option",29),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.pool_name),r.Db(1),r.Sc(e.pool_name)}}function Ha(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,92),r.Wb())}function Xa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,93),r.Wb())}function Va(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,94),r.Wb())}function Ba(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,95),r.Wb())}function Ua(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,96),r.Wb())}function qa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,97),r.Wb())}const Ga=function(){return["iscsi"]};function Ja(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",7),r.Xb(2,"label",68),r.bc(3,69),r.Wb(),r.Xb(4,"div",10),r.Xb(5,"select",70),r.Pc(6,Ya,2,1,"option",35),r.Pc(7,Na,2,1,"option",35),r.Pc(8,za,2,1,"option",35),r.Pc(9,$a,2,2,"option",14),r.Wb(),r.Pc(10,Ha,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(11,"div",7),r.Xb(12,"label",71),r.Xb(13,"span"),r.bc(14,72),r.Wb(),r.Xb(15,"cd-helper"),r.Xb(16,"span"),r.bc(17,73),r.Wb(),r.Sb(18,"br"),r.Xb(19,"span"),r.hc(20,74),r.Sb(21,"b"),r.ec(),r.Wb(),r.Wb(),r.Wb(),r.Xb(22,"div",10),r.Sb(23,"input",75),r.Wb(),r.Wb(),r.Xb(24,"div",7),r.Xb(25,"label",76),r.bc(26,77),r.Wb(),r.Xb(27,"div",10),r.Sb(28,"input",78),r.Pc(29,Xa,2,0,"span",15),r.Pc(30,Va,2,0,"span",15),r.Pc(31,Ba,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(32,"div",7),r.Xb(33,"label",79),r.bc(34,80),r.Wb(),r.Xb(35,"div",10),r.Sb(36,"input",81),r.Pc(37,Ua,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(38,"div",7),r.Xb(39,"label",82),r.bc(40,83),r.Wb(),r.Xb(41,"div",10),r.Xb(42,"div",84),r.Sb(43,"input",85),r.Xb(44,"span",86),r.Sb(45,"button",87),r.Sb(46,"cd-copy-2-clipboard-button",88),r.Wb(),r.Pc(47,qa,2,0,"span",15),r.Wb(),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc(),t=r.Fc(7);r.Db(6),r.uc("ngIf",null===e.pools),r.Db(1),r.uc("ngIf",e.pools&&0===e.pools.length),r.Db(1),r.uc("ngIf",e.pools&&e.pools.length>0),r.Db(1),r.uc("ngForOf",e.pools),r.Db(1),r.uc("ngIf",e.serviceForm.showError("pool",t,"required")),r.Db(19),r.uc("ngIf",e.serviceForm.showError("api_port",t,"pattern")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("api_port",t,"min")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("api_port",t,"max")),r.Db(2),r.uc("ngClass",r.zc(13,xa,r.yc(12,Ga).includes(e.serviceForm.controls.service_type.value))),r.Db(4),r.uc("ngIf",e.serviceForm.showError("api_user",t,"required")),r.Db(2),r.uc("ngClass",r.zc(16,xa,r.yc(15,Ga).includes(e.serviceForm.controls.service_type.value))),r.Db(8),r.uc("ngIf",e.serviceForm.showError("api_password",t,"required"))}}function Ka(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,114),r.Wb())}function Qa(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,115),r.Wb())}function Za(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,116),r.Wb())}function ec(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,117),r.Wb())}function tc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,118),r.Wb())}function nc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,119),r.Wb())}function ic(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,120),r.Wb())}function rc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,121),r.Wb())}function sc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,122),r.Wb())}function oc(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",7),r.Xb(2,"label",98),r.Xb(3,"span"),r.bc(4,99),r.Wb(),r.Xb(5,"cd-helper"),r.Xb(6,"span"),r.bc(7,100),r.Wb(),r.Wb(),r.Wb(),r.Xb(8,"div",10),r.Sb(9,"input",101),r.Pc(10,Ka,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(11,"div",7),r.Xb(12,"label",102),r.Xb(13,"span"),r.bc(14,103),r.Wb(),r.Xb(15,"cd-helper"),r.Xb(16,"span"),r.bc(17,104),r.Wb(),r.Wb(),r.Wb(),r.Xb(18,"div",10),r.Sb(19,"input",105),r.Pc(20,Qa,2,0,"span",15),r.Pc(21,Za,2,0,"span",15),r.Pc(22,ec,2,0,"span",15),r.Pc(23,tc,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(24,"div",7),r.Xb(25,"label",106),r.Xb(26,"span"),r.bc(27,107),r.Wb(),r.Xb(28,"cd-helper"),r.Xb(29,"span"),r.bc(30,108),r.Wb(),r.Wb(),r.Wb(),r.Xb(31,"div",10),r.Sb(32,"input",109),r.Pc(33,nc,2,0,"span",15),r.Pc(34,ic,2,0,"span",15),r.Pc(35,rc,2,0,"span",15),r.Pc(36,sc,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(37,"div",7),r.Xb(38,"label",110),r.Xb(39,"span"),r.bc(40,111),r.Wb(),r.Xb(41,"cd-helper"),r.Xb(42,"span"),r.bc(43,112),r.Wb(),r.Wb(),r.Wb(),r.Xb(44,"div",10),r.Sb(45,"input",113),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc(),t=r.Fc(7);r.Db(2),r.uc("ngClass",r.zc(13,xa,r.yc(12,Sa).includes(e.serviceForm.controls.service_type.value))),r.Db(8),r.uc("ngIf",e.serviceForm.showError("virtual_ip",t,"required")),r.Db(2),r.uc("ngClass",r.zc(16,xa,r.yc(15,Sa).includes(e.serviceForm.controls.service_type.value))),r.Db(8),r.uc("ngIf",e.serviceForm.showError("frontend_port",t,"pattern")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("frontend_port",t,"min")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("frontend_port",t,"max")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("frontend_port",t,"required")),r.Db(2),r.uc("ngClass",r.zc(19,xa,r.yc(18,Sa).includes(e.serviceForm.controls.service_type.value))),r.Db(8),r.uc("ngIf",e.serviceForm.showError("monitor_port",t,"pattern")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("monitor_port",t,"min")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("monitor_port",t,"max")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("monitor_port",t,"required"))}}function ac(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,131),r.Wb())}function cc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,132),r.Wb())}function lc(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",7),r.Xb(1,"label",126),r.Xb(2,"span"),r.bc(3,127),r.Wb(),r.Xb(4,"cd-helper"),r.bc(5,128),r.Wb(),r.Wb(),r.Xb(6,"div",10),r.Xb(7,"textarea",129),r.Rc(8,"              "),r.Wb(),r.Xb(9,"input",130),r.lc("change",function(t){return r.Ic(e),r.nc(2).fileUpload(t.target.files,"ssl_cert")}),r.Wb(),r.Pc(10,ac,2,0,"span",15),r.Pc(11,cc,2,0,"span",15),r.Wb(),r.Wb()}if(2&e){const e=r.nc(2),t=r.Fc(7);r.Db(10),r.uc("ngIf",e.serviceForm.showError("ssl_cert",t,"required")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("ssl_cert",t,"pattern"))}}function uc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,137),r.Wb())}function dc(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,138),r.Wb())}function hc(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",7),r.Xb(1,"label",133),r.Xb(2,"span"),r.bc(3,134),r.Wb(),r.Xb(4,"cd-helper"),r.bc(5,135),r.Wb(),r.Wb(),r.Xb(6,"div",10),r.Xb(7,"textarea",136),r.Rc(8,"              "),r.Wb(),r.Xb(9,"input",130),r.lc("change",function(t){return r.Ic(e),r.nc(2).fileUpload(t.target.files,"ssl_key")}),r.Wb(),r.Pc(10,uc,2,0,"span",15),r.Pc(11,dc,2,0,"span",15),r.Wb(),r.Wb()}if(2&e){const e=r.nc(2),t=r.Fc(7);r.Db(10),r.uc("ngIf",e.serviceForm.showError("ssl_key",t,"required")),r.Db(1),r.uc("ngIf",e.serviceForm.showError("ssl_key",t,"pattern"))}}function fc(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",7),r.Xb(2,"div",20),r.Xb(3,"div",21),r.Sb(4,"input",123),r.Xb(5,"label",124),r.bc(6,125),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(7,lc,12,2,"div",16),r.Pc(8,hc,12,2,"div",16),r.Ub()),2&e){const e=r.nc();r.Db(7),r.uc("ngIf",e.serviceForm.controls.ssl.value),r.Db(1),r.uc("ngIf",e.serviceForm.controls.ssl.value&&"rgw"!==e.serviceForm.controls.service_type.value)}}const pc=function(){return["mds","rgw","nfs","iscsi","ingress"]},mc=function(){return["rgw","iscsi","ingress"]};let bc=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o,a,c){super(),this.actionLabels=e,this.cephServiceService=t,this.formBuilder=n,this.hostService=i,this.poolService=r,this.router=s,this.taskWrapperService=o,this.route=a,this.activeModal=c,this.RGW_SVC_ID_PATTERN=/^([^.]+)(\.([^.]+)\.([^.]+))?$/,this.hiddenServices=[],this.editing=!1,this.serviceTypes=[],this.labelClick=new na.a,this.labelFocus=new na.a,this.services=[],this.searchLabels=e=>Object(ia.a)(e.pipe(oa(200),Object(ua.a)()),this.labelFocus,this.labelClick.pipe(Object(da.a)(()=>!this.typeahead.isPopupOpen()))).pipe(Object(Ii.a)(e=>this.labels.filter(t=>t.toLowerCase().indexOf(e.toLowerCase())>-1).slice(0,10))),this.resource="service",this.hosts={options:[],messages:new sr.a({empty:"There are no hosts.",filter:"Filter hosts"})},this.createForm()}createForm(){this.serviceForm=this.formBuilder.group({service_type:[null,[xn.A.required]],service_id:[null,[Cn.a.requiredIf({service_type:"mds"}),Cn.a.requiredIf({service_type:"nfs"}),Cn.a.requiredIf({service_type:"iscsi"}),Cn.a.requiredIf({service_type:"ingress"}),Cn.a.composeIf({service_type:"rgw"},[xn.A.required,Cn.a.custom("rgwPattern",e=>!Wt.a.isEmpty(e)&&!this.RGW_SVC_ID_PATTERN.test(e))])]],placement:["hosts"],label:[null,[Cn.a.requiredIf({placement:"label",unmanaged:!1})]],hosts:[[]],count:[null,[Cn.a.number(!1),xn.A.min(1)]],unmanaged:[!1],pool:[null,[Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],rgw_frontend_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],trusted_ip_list:[null],api_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],api_user:[null,[Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],api_password:[null,[Cn.a.requiredIf({service_type:"iscsi",unmanaged:!1})]],backend_service:[null,[Cn.a.requiredIf({service_type:"ingress",unmanaged:!1})]],virtual_ip:[null,[Cn.a.requiredIf({service_type:"ingress",unmanaged:!1})]],frontend_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],monitor_port:[null,[Cn.a.number(!1),xn.A.min(1),xn.A.max(65535)]],virtual_interface_networks:[null],ssl:[!1],ssl_cert:["",[Cn.a.composeIf({service_type:"rgw",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.pemCert()]),Cn.a.composeIf({service_type:"iscsi",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.sslCert()])]],ssl_key:["",[Cn.a.composeIf({service_type:"iscsi",unmanaged:!1,ssl:!0},[xn.A.required,Cn.a.sslPrivKey()])]]})}ngOnInit(){this.action=this.actionLabels.CREATE,this.router.url.includes("services/(modal:create")?this.pageURL="services":this.router.url.includes("services/(modal:edit")&&(this.editing=!0,this.pageURL="services",this.route.params.subscribe(e=>{this.serviceName=e.name,this.serviceType=e.type})),this.cephServiceService.getKnownTypes().subscribe(e=>{this.hiddenServices.push("osd","container"),this.serviceTypes=Wt.a.difference(e,this.hiddenServices).sort()}),this.hostService.list("false").subscribe(e=>{const t=[];Wt.a.forEach(e,e=>{if(Wt.a.get(e,"sources.orchestrator",!1)){const n=new fa.a(!1,Wt.a.get(e,"hostname"),"");t.push(n)}}),this.hosts.options=[...t]}),this.hostService.getLabels().subscribe(e=>{this.labels=e}),this.poolService.getList().subscribe(e=>{this.pools=e}),this.cephServiceService.list().subscribe(e=>{this.services=e.filter(e=>"rgw"===e.service_type)}),this.editing&&(this.action=this.actionLabels.EDIT,this.disableForEditing(this.serviceType),this.cephServiceService.list(this.serviceName).subscribe(e=>{var t,n,i,r,s,o,a,c,l,u,d,h,f;if(["service_type","service_id","unmanaged"].forEach(t=>{this.serviceForm.get(t).setValue(e[0][t])}),!e[0].unmanaged){const i=Object.keys(e[0].placement)[0];let r;r=["hosts","label"].indexOf(i)>=0?i:"hosts",this.serviceForm.get("placement").setValue(r),this.serviceForm.get("count").setValue(e[0].placement.count),(null===(t=e[0])||void 0===t?void 0:t.placement[r])&&this.serviceForm.get(r).setValue(null===(n=e[0])||void 0===n?void 0:n.placement[r])}switch(this.serviceType){case"iscsi":["pool","api_password","api_user","trusted_ip_list","api_port"].forEach(t=>{this.serviceForm.get(t).setValue(e[0].spec[t])}),this.serviceForm.get("ssl").setValue(null===(i=e[0].spec)||void 0===i?void 0:i.api_secure),(null===(r=e[0].spec)||void 0===r?void 0:r.api_secure)&&(this.serviceForm.get("ssl_cert").setValue(null===(s=e[0].spec)||void 0===s?void 0:s.ssl_cert),this.serviceForm.get("ssl_key").setValue(null===(o=e[0].spec)||void 0===o?void 0:o.ssl_key));break;case"rgw":this.serviceForm.get("rgw_frontend_port").setValue(null===(a=e[0].spec)||void 0===a?void 0:a.rgw_frontend_port),this.serviceForm.get("ssl").setValue(null===(c=e[0].spec)||void 0===c?void 0:c.ssl),(null===(l=e[0].spec)||void 0===l?void 0:l.ssl)&&this.serviceForm.get("ssl_cert").setValue(null===(u=e[0].spec)||void 0===u?void 0:u.rgw_frontend_ssl_certificate);break;case"ingress":["backend_service","virtual_ip","frontend_port","monitor_port","virtual_interface_networks","ssl"].forEach(t=>{this.serviceForm.get(t).setValue(e[0].spec[t])}),(null===(d=e[0].spec)||void 0===d?void 0:d.ssl)&&(this.serviceForm.get("ssl_cert").setValue(null===(h=e[0].spec)||void 0===h?void 0:h.ssl_cert),this.serviceForm.get("ssl_key").setValue(null===(f=e[0].spec)||void 0===f?void 0:f.ssl_key))}}))}disableForEditing(e){switch(["service_type","service_id"].forEach(e=>{this.serviceForm.get(e).disable()}),e){case"ingress":this.serviceForm.get("backend_service").disable()}}fileUpload(e,t){const n=e[0],i=new FileReader;i.addEventListener("load",e=>{const n=this.serviceForm.get(t);n.setValue(e.target.result),n.markAsDirty(),n.markAsTouched(),n.updateValueAndValidity()}),i.readAsText(n,"utf8")}prePopulateId(){const e=this.serviceForm.get("service_id"),t=this.serviceForm.getValue("backend_service");e.reset({value:t,disabled:!0})}onSubmit(){var e,t,n,i,r;const s=this,o=this.serviceForm.getRawValue(),a=o.service_type;let c=`service/${gn.e.CREATE}`;this.editing&&(c=`service/${gn.e.EDIT}`);const l={service_type:a,placement:{},unmanaged:o.unmanaged};let u;if("rgw"===a){const e=o.service_id.match(this.RGW_SVC_ID_PATTERN);u=e[1],e[3]&&(l.rgw_realm=e[3],l.rgw_zone=e[4])}else u=o.service_id;const d=u;let h=a;if(Wt.a.isString(d)&&!Wt.a.isEmpty(d)&&(h=`${a}.${d}`,l.service_id=d),!o.unmanaged){switch(o.placement){case"hosts":o.hosts.length>0&&(l.placement.hosts=o.hosts);break;case"label":l.placement.label=o.label}switch(Wt.a.isNumber(o.count)&&o.count>0&&(l.placement.count=o.count),a){case"rgw":Wt.a.isNumber(o.rgw_frontend_port)&&o.rgw_frontend_port>0&&(l.rgw_frontend_port=o.rgw_frontend_port),l.ssl=o.ssl,o.ssl&&(l.rgw_frontend_ssl_certificate=null===(e=o.ssl_cert)||void 0===e?void 0:e.trim());break;case"iscsi":l.pool=o.pool,Wt.a.isString(o.trusted_ip_list)&&!Wt.a.isEmpty(o.trusted_ip_list)&&(l.trusted_ip_list=o.trusted_ip_list.trim()),Wt.a.isNumber(o.api_port)&&o.api_port>0&&(l.api_port=o.api_port),l.api_user=o.api_user,l.api_password=o.api_password,l.api_secure=o.ssl,o.ssl&&(l.ssl_cert=null===(t=o.ssl_cert)||void 0===t?void 0:t.trim(),l.ssl_key=null===(n=o.ssl_key)||void 0===n?void 0:n.trim());break;case"ingress":l.backend_service=o.backend_service,l.service_id=o.backend_service,Wt.a.isString(o.virtual_ip)&&!Wt.a.isEmpty(o.virtual_ip)&&(l.virtual_ip=o.virtual_ip.trim()),Wt.a.isNumber(o.frontend_port)&&o.frontend_port>0&&(l.frontend_port=o.frontend_port),Wt.a.isNumber(o.monitor_port)&&o.monitor_port>0&&(l.monitor_port=o.monitor_port),l.ssl=o.ssl,o.ssl&&(l.ssl_cert=null===(i=o.ssl_cert)||void 0===i?void 0:i.trim(),l.ssl_key=null===(r=o.ssl_key)||void 0===r?void 0:r.trim()),l.virtual_interface_networks=o.virtual_interface_networks}}this.taskWrapperService.wrapTaskAroundCall({task:new Bi.a(c,{service_name:h}),call:this.cephServiceService.create(l)}).subscribe({error(){s.serviceForm.setErrors({cdSubmitButton:!0})},complete:()=>{"services"===this.pageURL?this.router.navigate([this.pageURL,{outlets:{modal:null}}]):this.activeModal.close()}})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Vr),r.Rb(wo.a),r.Rb(Xi),r.Rb(ha.a),r.Rb(Pt.e),r.Rb(Ui.a),r.Rb(Pt.a),r.Rb(Jt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-service-form"]],viewQuery:function(e,t){if(1&e&&r.Wc(Jt.G,1),2&e){let e;r.Ec(e=r.mc())&&(t.typeahead=e.first)}},inputs:{hiddenServices:"hiddenServices",editing:"editing",serviceName:"serviceName",serviceType:"serviceType"},features:[r.Ab],decls:45,vars:34,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y,w,D,S,x,k,T,M,C,O,L,E,A,I,R,P,F,W,j,Y,N,z,$,H,X,V,B,U,q,G,J,K,Q,Z,ee,te,ne,ie,re,se,oe,ae,ce,le,ue,de,he,fe,pe;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Type",n="-- Select a service type --",i="Id",r="Unmanaged",s="This field is required.",o="Backend Service",a="Loading...",c="-- No service available --",l="-- Select an existing RGW service --",u="This field is required.",d="This field is required.",h="The value does not match the pattern " + "\ufffd#2\ufffd" + "<service_id>[.<realm_name>.<zone_name>]" + "\ufffd/#2\ufffd" + ".",f="Placement",p="Hosts",m="Label",b="Label",g="This field is required.",_="Hosts",v="Count",y="Only that number of daemons will be created.",w="The value must be at least 1.",D="The entered value needs to be a number.",S="Port",x="The entered value needs to be a number.",k="The value must be at least 1.",T="The value cannot exceed 65535.",M="Pool",C="Trusted IPs",O="Comma separated list of IP addresses.",L="Please add the " + "\ufffd#21\ufffd" + "Ceph Manager" + "\ufffd/#21\ufffd" + " IP addresses here, otherwise the iSCSI gateways can't be reached.",E="Port",A="User",I="Password",R="Loading...",P="-- No pools available --",F="-- Select a pool --",W="This field is required.",j="The entered value needs to be a number.",Y="The value must be at least 1.",N="The value cannot exceed 65535.",z="This field is required.",$="This field is required.",H="Virtual IP",X="The virtual IP address and subnet (in CIDR notation) where the ingress service will be available.",V="Frontend Port",B="The port used to access the ingress service.",U="Monitor Port",q="The port used by haproxy for load balancer status.",G="CIDR Networks",J="A list of networks to identify which network interface to use for the virtual IP address.",K="This field is required.",Q="The entered value needs to be a number.",Z="The value must be at least 1.",ee="The value cannot exceed 65535.",te="This field is required.",ne="The entered value needs to be a number.",ie="The value must be at least 1.",re="The value cannot exceed 65535.",se="This field is required.",oe="SSL",ae="Certificate",ce="The SSL certificate in PEM format.",le="This field is required.",ue="Invalid SSL certificate.",de="Private key",he="The SSL private key in PEM format.",fe="This field is required.",pe="Invalid SSL private key.",[[3,"pageURL","modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","service_type",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["id","service_type","name","service_type","formControlName","service_type",1,"form-control","custom-select"],[3,"ngValue"],n,[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],["for","service_id",1,"cd-col-form-label",3,"ngClass"],i,["id","service_id","type","text","formControlName","service_id",1,"form-control"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","unmanaged","type","checkbox","formControlName","unmanaged",1,"custom-control-input"],["for","unmanaged",1,"custom-control-label"],r,[4,"ngIf"],[1,"modal-footer"],[1,"text-right"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],s,["for","backend_service",1,"cd-col-form-label",3,"ngClass"],o,["id","backend_service","name","backend_service","formControlName","backend_service",1,"form-control","custom-select",3,"change"],[3,"ngValue",4,"ngIf"],a,c,l,u,d,h,["for","placement",1,"cd-col-form-label"],f,["id","placement","formControlName","placement",1,"form-control","custom-select"],["value","hosts"],p,["value","label"],m,["for","label",1,"cd-col-form-label"],b,["id","label","type","text","formControlName","label",1,"form-control",3,"ngbTypeahead","focus","click"],g,["for","hosts",1,"cd-col-form-label"],_,["id","hosts",3,"data","options","messages"],["for","count",1,"cd-col-form-label"],v,y,["id","count","type","number","formControlName","count","min","1",1,"form-control"],w,D,["for","rgw_frontend_port",1,"cd-col-form-label"],S,["id","rgw_frontend_port","type","number","formControlName","rgw_frontend_port","min","1","max","65535",1,"form-control"],x,k,T,["for","pool",1,"cd-col-form-label","required"],M,["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],["for","trusted_ip_list",1,"cd-col-form-label"],C,O,L,["id","trusted_ip_list","type","text","formControlName","trusted_ip_list",1,"form-control"],["for","api_port",1,"cd-col-form-label"],E,["id","api_port","type","number","formControlName","api_port","min","1","max","65535",1,"form-control"],["for","api_user",1,"cd-col-form-label",3,"ngClass"],A,["id","api_user","type","text","formControlName","api_user",1,"form-control"],["for","api_password",1,"cd-col-form-label",3,"ngClass"],I,[1,"input-group"],["id","api_password","type","password","autocomplete","new-password","formControlName","api_password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","api_password",1,"btn","btn-light"],["source","api_password"],R,P,F,W,j,Y,N,z,$,["for","virtual_ip",1,"cd-col-form-label",3,"ngClass"],H,X,["id","virtual_ip","type","text","formControlName","virtual_ip",1,"form-control"],["for","frontend_port",1,"cd-col-form-label",3,"ngClass"],V,B,["id","frontend_port","type","number","formControlName","frontend_port","min","1","max","65535",1,"form-control"],["for","monitor_port",1,"cd-col-form-label",3,"ngClass"],U,q,["id","monitor_port","type","number","formControlName","monitor_port","min","1","max","65535",1,"form-control"],["for","virtual_interface_networks",1,"cd-col-form-label"],G,J,["id","virtual_interface_networks","type","text","formControlName","virtual_interface_networks",1,"form-control"],K,Q,Z,ee,te,ne,ie,re,se,["id","ssl","type","checkbox","formControlName","ssl",1,"custom-control-input"],["for","ssl",1,"custom-control-label"],oe,["for","ssl_cert",1,"cd-col-form-label"],ae,ce,["id","ssl_cert","formControlName","ssl_cert","rows","5",1,"form-control","resize-vertical","text-monospace","text-pre"],["type","file",3,"change"],le,ue,["for","ssl_key",1,"cd-col-form-label"],de,he,["id","ssl_key","formControlName","ssl_key","rows","5",1,"form-control","resize-vertical","text-monospace","text-pre"],fe,pe]},template:function(e,t){if(1&e&&(r.Xb(0,"cd-modal",0),r.Xb(1,"span",1),r.bc(2,2),r.oc(3,"titlecase"),r.oc(4,"upperFirst"),r.Wb(),r.Vb(5,3),r.Xb(6,"form",4,5),r.Xb(8,"div",6),r.Xb(9,"div",7),r.Xb(10,"label",8),r.bc(11,9),r.Wb(),r.Xb(12,"div",10),r.Xb(13,"select",11),r.Xb(14,"option",12),r.bc(15,13),r.Wb(),r.Pc(16,ba,2,2,"option",14),r.Wb(),r.Pc(17,ga,2,0,"span",15),r.Wb(),r.Wb(),r.Pc(18,ka,10,9,"div",16),r.Xb(19,"div",7),r.Xb(20,"label",17),r.bc(21,18),r.Wb(),r.Xb(22,"div",10),r.Sb(23,"input",19),r.Pc(24,Ta,2,0,"span",15),r.Pc(25,Ma,3,0,"span",15),r.Wb(),r.Wb(),r.Xb(26,"div",7),r.Xb(27,"div",20),r.Xb(28,"div",21),r.Sb(29,"input",22),r.Xb(30,"label",23),r.bc(31,24),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(32,Ca,9,0,"div",16),r.Pc(33,La,6,2,"div",16),r.Pc(34,Ea,5,3,"div",16),r.Pc(35,Ra,10,2,"div",16),r.Pc(36,ja,9,3,"ng-container",25),r.Pc(37,Ja,48,18,"ng-container",25),r.Pc(38,oc,46,21,"ng-container",25),r.Pc(39,fc,9,2,"ng-container",25),r.Wb(),r.Xb(40,"div",26),r.Xb(41,"div",27),r.Xb(42,"cd-form-button-panel",28),r.lc("submitActionEvent",function(){return t.onSubmit()}),r.oc(43,"titlecase"),r.oc(44,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e){const e=r.Fc(7);r.uc("pageURL",t.pageURL)("modalRef",t.activeModal),r.Db(4),r.fc(r.pc(3,22,t.action))(r.pc(4,24,t.resource)),r.cc(2),r.Db(2),r.uc("formGroup",t.serviceForm),r.Db(8),r.uc("ngValue",null),r.Db(2),r.uc("ngForOf",t.serviceTypes),r.Db(1),r.uc("ngIf",t.serviceForm.showError("service_type",e,"required")),r.Db(1),r.uc("ngIf","ingress"===t.serviceForm.controls.service_type.value),r.Db(2),r.uc("ngClass",r.zc(31,xa,r.yc(30,pc).includes(t.serviceForm.controls.service_type.value))),r.Db(4),r.uc("ngIf",t.serviceForm.showError("service_id",e,"required")),r.Db(1),r.uc("ngIf",t.serviceForm.showError("service_id",e,"rgwPattern")),r.Db(7),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&"label"===t.serviceForm.controls.placement.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&"hosts"===t.serviceForm.controls.placement.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&"rgw"===t.serviceForm.controls.service_type.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&"iscsi"===t.serviceForm.controls.service_type.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&"ingress"===t.serviceForm.controls.service_type.value),r.Db(1),r.uc("ngIf",!t.serviceForm.controls.unmanaged.value&&r.yc(33,mc).includes(t.serviceForm.controls.service_type.value)),r.Db(3),r.uc("form",t.serviceForm)("submitText",r.pc(43,26,t.action)+" "+r.pc(44,28,t.resource))}},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,Zn.a,On.a,xn.z,ei.a,xn.q,xn.i,xn.u,xn.C,s.q,s.r,s.p,xn.d,xn.b,ti.a,Jt.G,fr.a,dr.a,xn.v,pa.a,ma.a],pipes:[s.A,pr.a],styles:[""]}),e})();function gc(e,t){if(1&e&&(r.Vb(0),r.Sb(1,"cd-service-daemon-list",1),r.Ub()),2&e){const e=r.nc();r.Db(1),r.uc("serviceName",e.selection.service_name)}}let _c=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-service-details"]],inputs:{permissions:"permissions",selection:"selection"},decls:1,vars:1,consts:[[4,"ngIf"],[3,"serviceName"]],template:function(e,t){1&e&&r.Pc(0,gc,2,1,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,ps],styles:[""]}),e})();function vc(e,t){1&e&&r.Sb(0,"cd-orchestrator-doc-panel")}function yc(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"cd-table",2),r.lc("fetchData",function(t){return r.Ic(e),r.nc().getServices(t)})("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Sb(2,"cd-table-actions",3),r.Sb(3,"cd-service-details",4),r.Wb(),r.Ub()}if(2&e){const e=r.nc();r.Db(1),r.uc("data",e.services)("columns",e.columns)("autoReload",5e3)("hasDetails",e.hasDetails),r.Db(1),r.uc("permission",e.permissions.hosts)("selection",e.selection)("tableActions",e.tableActions),r.Db(1),r.uc("permissions",e.permissions)("selection",e.expandedRow)}}const wc="services";let Dc=(()=>{class e extends zt.a{constructor(e,t,n,i,r,s,o,a){super(),this.actionLabels=e,this.authStorageService=t,this.modalService=n,this.orchService=i,this.cephServiceService=r,this.relativeDatePipe=s,this.taskWrapperService=o,this.router=a,this.hiddenColumns=[],this.hiddenServices=[],this.hasDetails=!0,this.routedModal=!0,this.showDocPanel=!1,this.actionOrchFeatures={create:[or.SERVICE_CREATE],update:[or.SERVICE_EDIT],delete:[or.SERVICE_DELETE]},this.columns=[],this.services=[],this.isLoadingServices=!1,this.selection=new Ht.a,this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{permission:"create",icon:_n.a.add,click:()=>this.openModal(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection,disable:e=>this.getDisable("create",e)},{permission:"update",icon:_n.a.edit,click:()=>this.openModal(!0),name:this.actionLabels.EDIT,disable:e=>this.getDisable("update",e)},{permission:"delete",icon:_n.a.destroy,click:()=>this.deleteAction(),name:this.actionLabels.DELETE,disable:e=>this.getDisable("delete",e)}]}openModal(e=!1){var t,n,i;if(this.routedModal)this.router.navigate(e?[wc,{outlets:{modal:[gn.e.EDIT,this.selection.first().service_type,this.selection.first().service_name]}}]:[wc,{outlets:{modal:[gn.e.CREATE]}}]);else{let r={};r=e?{serviceName:null===(t=this.selection.first())||void 0===t?void 0:t.service_name,serviceType:null===(i=null===(n=this.selection)||void 0===n?void 0:n.first())||void 0===i?void 0:i.service_type,hiddenServices:this.hiddenServices,editing:e}:{hiddenServices:this.hiddenServices,editing:e},this.bsModalRef=this.modalService.show(bc,r,{size:"lg"})}}ngOnInit(){const e=[{name:"Service",prop:"service_name",flexGrow:1},{name:"Placement",prop:"",pipe:new ta,flexGrow:2},{name:"Running",prop:"status.running",flexGrow:1},{name:"Size",prop:"status.size",flexGrow:1},{name:"Last Refreshed",prop:"status.last_refresh",pipe:this.relativeDatePipe,flexGrow:1}];this.columns=e.filter(e=>!this.hiddenColumns.includes(e.prop)),this.orchService.status().subscribe(e=>{this.orchStatus=e,this.showDocPanel=!e.available})}ngOnChanges(){var e;(null===(e=this.orchStatus)||void 0===e?void 0:e.available)&&(this.services=[],this.table.reloadData())}getDisable(e,t){var n;return"delete"===e&&!(null==t?void 0:t.hasSingleSelection)||"update"===e&&["osd","container"].indexOf(null===(n=this.selection.first())||void 0===n?void 0:n.service_type)>=0||this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}getServices(e){this.isLoadingServices||(this.isLoadingServices=!0,this.cephServiceService.list().subscribe(e=>{this.services=e,this.services=this.services.filter(e=>!this.hiddenServices.includes(e.service_name)),this.isLoadingServices=!1},()=>{this.isLoadingServices=!1,this.services=[],e.error()}))}updateSelection(e){this.selection=e}deleteAction(){const e=this.selection.first();this.modalService.show(bn.a,{itemDescription:"Service",itemNames:[e.service_name],actionDescription:"delete",submitActionObservable:()=>this.taskWrapperService.wrapTaskAroundCall({task:new Bi.a(`service/${gn.e.DELETE}`,{service_name:e.service_name}),call:this.cephServiceService.delete(e.service_name)}).pipe(Object(ea.a)(5e3))})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Gt.a),r.Rb(yn.a),r.Rb(rr),r.Rb(Vr),r.Rb(Br.a),r.Rb(Ui.a),r.Rb(Pt.e))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-services"]],viewQuery:function(e,t){if(1&e&&r.Wc(Vt.a,3),2&e){let e;r.Ec(e=r.mc())&&(t.table=e.first)}},inputs:{hostname:"hostname",hiddenColumns:"hiddenColumns",hiddenServices:"hiddenServices",hasDetails:"hasDetails",routedModal:"routedModal"},features:[r.Cb([{provide:ar.a,useValue:new ar.a(wc)}]),r.Ab,r.Bb],decls:3,vars:2,consts:[[4,"ngIf"],["name","modal"],["identifier","service_name","forceIdentifier","true","columnMode","flex","selectionType","single",3,"data","columns","autoReload","hasDetails","fetchData","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"permissions","selection"]],template:function(e,t){1&e&&(r.Pc(0,vc,1,0,"cd-orchestrator-doc-panel",0),r.Pc(1,yc,4,9,"ng-container",0),r.Sb(2,"router-outlet",1)),2&e&&(r.uc("ngIf",t.showDocPanel),r.Db(1),r.uc("ngIf",null==t.orchStatus?null:t.orchStatus.available))},directives:[s.r,Pt.j,jr,Vt.a,Dn.a,_c],styles:[""]}),e})();const Sc=function(){return["services","status"]};let xc=(()=>{class e{constructor(e,t,n,i,r){this.wizardStepsService=e,this.cephServiceService=t,this.dimlessBinary=n,this.hostService=i,this.osdService=r,this.hosts=[],this.serviceOccurrences={},this.hostsCountPerService=[],this.uniqueServices=new Set,this.totalCapacity=0,this.services=[],this.totalCPUs=0,this.totalMemory=0}ngOnInit(){var e,t,n;let i=0,r=0,s=0,o=0,a=0,c=0;this.hostsByService={columns:[{prop:"service_type",name:"Services",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{class:"badge-dark"}},{name:"Number of Hosts",prop:"hosts_per_service",flexGrow:1}]},this.cephServiceService.list().subscribe(e=>{this.services=e,this.serviceCount=this.services.length,Wt.a.forEach(this.services,e=>{this.serviceOccurrences[e.service_type]=(this.serviceOccurrences[e.service_type]||0)+1,this.uniqueServices.add(e.service_type)}),this.uniqueServices.forEach(e=>{this.hostsCountPerService.push({service_type:e,hosts_per_service:this.serviceOccurrences[e]})}),this.hostsByService.data=[...this.hostsCountPerService]}),this.hostService.list("true").subscribe(e=>{this.hosts=e,this.hostsCount=this.hosts.length,Wt.a.forEach(this.hosts,e=>{this.totalCPUs=this.totalCPUs+e.cpu_count,this.totalMemory=this.totalMemory+1024*e.memory_total_kb}),this.totalMemory=this.dimlessBinary.transform(this.totalMemory)}),this.osdService.osdDevices.data&&(i=null===(e=this.osdService.osdDevices.data)||void 0===e?void 0:e.length,r=this.osdService.osdDevices.data.capacity),this.osdService.osdDevices.wal&&(s=null===(t=this.osdService.osdDevices.wal)||void 0===t?void 0:t.length,o=this.osdService.osdDevices.wal.capacity),this.osdService.osdDevices.db&&(a=null===(n=this.osdService.osdDevices.db)||void 0===n?void 0:n.length,c=this.osdService.osdDevices.db.capacity),this.totalDevices=i+s+a,this.osdService.osdDevices.totalDevices=this.totalDevices,this.totalCapacity=r+o+c}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Ji),r.Rb(Vr),r.Rb(Qt.a),r.Rb(Xi),r.Rb(Vi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-create-cluster-review"]],decls:35,vars:17,consts:function(){let e,t,n,i,r,s,o,a;return e="Cluster Resources",t="Hosts",n="Storage Capacity",i="Number of devices: " + "\ufffd0\ufffd" + ". Raw capacity: " + "\ufffd1\ufffd" + ".",r="CPUs",s="Memory",o="Hosts by Services",a="Host Details",[[1,"row"],[1,"col-lg-4"],[1,"cd-header"],e,[1,"table","table-striped"],[1,"bold"],t,n,i,r,s,[1,"col-lg-8"],o,[3,"data","columns","toolHeader"],a,[3,"hiddenColumns","hideToolHeader","hideTitle","hideSubmitBtn","hasTableDetails","showGeneralActionsOnly"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"fieldset"),r.Xb(3,"legend",2),r.bc(4,3),r.Wb(),r.Xb(5,"table",4),r.Xb(6,"tr"),r.Xb(7,"td",5),r.bc(8,6),r.Wb(),r.Xb(9,"td"),r.Rc(10),r.Wb(),r.Wb(),r.Xb(11,"tr"),r.Xb(12,"td",5),r.bc(13,7),r.Wb(),r.Xb(14,"td"),r.Xb(15,"span"),r.bc(16,8),r.oc(17,"dimlessBinary"),r.Wb(),r.Wb(),r.Wb(),r.Xb(18,"tr"),r.Xb(19,"td",5),r.bc(20,9),r.Wb(),r.Xb(21,"td"),r.Rc(22),r.Wb(),r.Wb(),r.Xb(23,"tr"),r.Xb(24,"td",5),r.bc(25,10),r.Wb(),r.Xb(26,"td"),r.Rc(27),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(28,"div",11),r.Xb(29,"legend",2),r.bc(30,12),r.Wb(),r.Sb(31,"cd-table",13),r.Wb(),r.Wb(),r.Xb(32,"legend",2),r.bc(33,14),r.Wb(),r.Sb(34,"cd-hosts",15)),2&e&&(r.Db(10),r.Sc(t.hostsCount),r.Db(7),r.fc(t.totalDevices)(r.pc(17,14,t.totalCapacity)),r.cc(16),r.Db(5),r.Sc(t.totalCPUs),r.Db(5),r.Sc(t.totalMemory),r.Db(4),r.uc("data",t.hostsByService.data)("columns",t.hostsByService.columns)("toolHeader",!1),r.Db(3),r.uc("hiddenColumns",r.yc(16,Sc))("hideToolHeader",!0)("hideTitle",!0)("hideSubmitBtn",!0)("hasTableDetails",!1)("showGeneralActionsOnly",!0))},directives:[Vt.a,yo],pipes:[Qt.a],styles:["cd-hosts[_ngcontent-%COMP%]     .nav{display:none}"]}),e})();const kc=["skipConfirmTpl"];function Tc(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",3),r.Xb(1,"div",4),r.Xb(2,"div",5),r.Sb(3,"img",6),r.Xb(4,"h3",7),r.bc(5,8),r.Wb(),r.Xb(6,"div",9),r.Xb(7,"h4",10),r.bc(8,11),r.Wb(),r.Xb(9,"div",12),r.Xb(10,"button",13),r.lc("click",function(){return r.Ic(e),r.nc().createCluster()}),r.bc(11,14),r.Wb(),r.Xb(12,"button",15),r.lc("click",function(){return r.Ic(e),r.nc().skipClusterCreation()}),r.bc(13,16),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(3),r.uc("src",e.projectConstants.cephLogo,r.Lc),r.Db(2),r.fc(e.projectConstants.projectName),r.cc(5)}}const Mc=function(){return["services"]};function Cc(e,t){1&e&&(r.Xb(0,"div",29),r.Xb(1,"h4",30),r.bc(2,31),r.Wb(),r.Sb(3,"br"),r.Sb(4,"cd-hosts",32),r.Wb()),2&e&&(r.Db(4),r.uc("hiddenColumns",r.yc(5,Mc))("hideTitle",!0)("hideSubmitBtn",!0)("hasTableDetails",!1)("showGeneralActionsOnly",!0))}function Oc(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",29),r.Xb(1,"h4",30),r.bc(2,33),r.Wb(),r.Sb(3,"br"),r.Xb(4,"div",34),r.Xb(5,"cd-osd-form",35),r.lc("emitDriveGroup",function(t){return r.Ic(e),r.nc(2).getDriveGroup(t)}),r.Wb(),r.Wb(),r.Wb()}2&e&&(r.Db(5),r.uc("hideTitle",!0)("hideSubmitBtn",!0))}const Lc=function(){return["mon","mgr","crash","agent"]},Ec=function(){return["status.running","status.size","status.last_refresh"]};function Ac(e,t){1&e&&(r.Xb(0,"div",29),r.Xb(1,"h4",30),r.bc(2,36),r.Wb(),r.Sb(3,"br"),r.Sb(4,"cd-services",37),r.Wb()),2&e&&(r.Db(4),r.uc("hasDetails",!1)("hiddenServices",r.yc(4,Lc))("hiddenColumns",r.yc(5,Ec))("routedModal",!1))}function Ic(e,t){1&e&&(r.Xb(0,"div",29),r.Sb(1,"cd-create-cluster-review"),r.Wb())}function Rc(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",17),r.Xb(1,"div",18),r.bc(2,19),r.Wb(),r.Xb(3,"div",20),r.Sb(4,"cd-wizard",21),r.Xb(5,"div",22),r.Vb(6,23),r.Pc(7,Cc,5,6,"div",24),r.Pc(8,Oc,6,2,"div",24),r.Pc(9,Ac,5,6,"div",24),r.Pc(10,Ic,2,0,"div",24),r.Ub(),r.Wb(),r.Wb(),r.Xb(11,"div",25),r.Xb(12,"button",26),r.lc("click",function(){return r.Ic(e),r.nc().onNextStep()}),r.bc(13,27),r.Wb(),r.Xb(14,"cd-back-button",28),r.lc("backAction",function(){return r.Ic(e),r.nc().onPreviousStep()}),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(4),r.uc("stepsTitle",e.stepTitles),r.Db(2),r.uc("ngSwitch",null==e.currentStep?null:e.currentStep.stepIndex),r.Db(1),r.uc("ngSwitchCase","1"),r.Db(1),r.uc("ngSwitchCase","2"),r.Db(1),r.uc("ngSwitchCase","3"),r.Db(1),r.uc("ngSwitchCase","4"),r.Db(3),r.fc(e.showSubmitButtonLabel()),r.cc(13),r.Db(1),r.uc("name",e.showCancelButtonLabel())}}function Pc(e,t){1&e&&(r.Xb(0,"span"),r.hc(1,38),r.Sb(2,"strong"),r.ec(),r.Wb(),r.Xb(3,"div",39),r.bc(4,40),r.Wb())}let Fc=(()=>{class e{constructor(e,t,n,i,s,o,a,c,l,u){this.authStorageService=e,this.wizardStepsService=t,this.router=n,this.hostService=i,this.notificationService=s,this.actionLabels=o,this.clusterService=a,this.modalService=c,this.taskWrapper=l,this.osdService=u,this.projectConstants=gn.c,this.stepTitles=["Add Hosts","Create OSDs","Create Services","Review"],this.startClusterCreation=!1,this.observables=[],this.driveGroup=new Qi,this.driveGroups=[],this.submitAction=new r.p,this.permissions=this.authStorageService.getPermissions(),this.currentStepSub=this.wizardStepsService.getCurrentStep().subscribe(e=>{this.currentStep=e}),this.currentStep.stepIndex=1}createCluster(){this.startClusterCreation=!0}skipClusterCreation(){const e={titleText:"Warning",buttonText:"Continue",warning:!0,bodyTpl:this.skipConfirmTpl,showSubmit:!0,onSubmit:()=>{this.clusterService.updateStatus("POST_INSTALLED").subscribe({error:()=>this.modalRef.close(),complete:()=>{this.notificationService.show(vn.a.info,"Cluster expansion skipped by user"),this.router.navigate(["/dashboard"]),this.modalRef.close()}})}};this.modalRef=this.modalService.show(Tn.a,e)}onSubmit(){if(this.hostService.list("false").subscribe(e=>{e.forEach(e=>{const t=e.labels.indexOf("_no_schedule",0);t>-1&&(e.labels.splice(t,1),this.observables.push(this.hostService.update(e.hostname,!0,e.labels)))}),Object(Oi.a)(this.observables).pipe(Object(Li.a)(()=>this.clusterService.updateStatus("POST_INSTALLED").subscribe(()=>{this.notificationService.show(vn.a.success,"Cluster expansion was successful"),this.router.navigate(["/dashboard"])}))).subscribe({error:e=>e.preventDefault()})}),this.driveGroup){const e=this.authStorageService.getUsername();this.driveGroup.setName(`dashboard-${e}-${Wt.a.now()}`),this.driveGroups.push(this.driveGroup.spec)}this.osdService.osdDevices.totalDevices>0&&this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("osd/"+gn.e.CREATE,{tracking_id:Wt.a.join(Wt.a.map(this.driveGroups,"service_id"),", ")}),call:this.osdService.create(this.driveGroups)}).subscribe({error:e=>e.preventDefault(),complete:()=>{this.submitAction.emit(),this.osdService.osdDevices=[]}})}getDriveGroup(e){this.driveGroup=e}onNextStep(){this.wizardStepsService.isLastStep()?this.onSubmit():(this.wizardStepsService.getCurrentStep().subscribe(e=>{this.currentStep=e}),this.wizardStepsService.moveToNextStep())}onPreviousStep(){this.wizardStepsService.isFirstStep()?this.router.navigate(["/dashboard"]):this.wizardStepsService.moveToPreviousStep()}showSubmitButtonLabel(){return this.wizardStepsService.isLastStep()?"Expand Cluster":this.actionLabels.NEXT}showCancelButtonLabel(){return this.wizardStepsService.isFirstStep()?this.actionLabels.CANCEL:this.actionLabels.BACK}ngOnDestroy(){this.currentStepSub.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Ji),r.Rb(Pt.e),r.Rb(Xi),r.Rb(wn.a),r.Rb(gn.b),r.Rb(Ei),r.Rb(yn.a),r.Rb(Ui.a),r.Rb(Vi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-create-cluster"]],viewQuery:function(e,t){if(1&e&&r.Wc(kc,3),2&e){let e;r.Ec(e=r.mc())&&(t.skipConfirmTpl=e.first)}},outputs:{submitAction:"submitAction"},decls:4,vars:2,consts:function(){let e,t,n,i,r,s,o,a,c,l,u;return e="Welcome to " + "\ufffd0\ufffd" + "",t="Please expand your cluster first",n="Expand Cluster",i="Skip",r="Expand Cluster",s="" + "\ufffd0\ufffd" + "",o="Add Hosts",a="Create OSDs",c="Create Services",l="You are about to skip the cluster expansion process. You\u2019ll need to " + "\ufffd#2\ufffd" + "navigate through the menu to add hosts and services." + "\ufffd/#2\ufffd" + "",u="Are you sure you want to continue?",[["class","container h-75",4,"ngIf"],["class","card",4,"ngIf"],["skipConfirmTpl",""],[1,"container","h-75"],[1,"row","h-100","justify-content-center","align-items-center"],[1,"blank-page"],["alt","Ceph",1,"img-fluid","mx-auto","d-block",3,"src"],[1,"text-center","m-2"],e,[1,"m-4"],[1,"text-center"],t,[1,"offset-md-2"],["name","expand-cluster",1,"btn","btn-accent","m-2",3,"click"],n,["name","skip-cluster-creation",1,"btn","btn-light",3,"click"],i,[1,"card"],[1,"card-header"],r,[1,"container-fluid"],[3,"stepsTitle"],[1,"card-body","vertical-line"],[3,"ngSwitch"],["class","ml-5",4,"ngSwitchCase"],[1,"card-footer"],["aria-label","Next",1,"btn","btn-accent","m-2","float-right",3,"click"],s,["aria-label","Close",1,"m-2","float-right",3,"name","backAction"],[1,"ml-5"],[1,"title"],o,[3,"hiddenColumns","hideTitle","hideSubmitBtn","hasTableDetails","showGeneralActionsOnly"],a,[1,"alignForm"],[3,"hideTitle","hideSubmitBtn","emitDriveGroup"],c,[3,"hasDetails","hiddenServices","hiddenColumns","routedModal"],l,[1,"mt-4"],u]},template:function(e,t){1&e&&(r.Pc(0,Tc,14,2,"div",0),r.Pc(1,Rc,15,8,"div",1),r.Pc(2,Pc,5,0,"ng-template",null,2,r.Qc)),2&e&&(r.uc("ngIf",!t.startClusterCreation),r.Db(1),r.uc("ngIf",t.startClusterCreation))},directives:[s.r,On.a,tr,s.t,s.u,nr.a,yo,Zo,Dc,xc],styles:[".container-fluid[_ngcontent-%COMP%]{align-items:flex-start;display:flex;padding-left:0;width:100%}.card-body[_ngcontent-%COMP%]{max-width:85%}.vertical-line[_ngcontent-%COMP%]{border-left:1px solid #ced4da}cd-wizard[_ngcontent-%COMP%]{width:15%}cd-hosts[_ngcontent-%COMP%]     .nav{display:none}.alignForm[_ngcontent-%COMP%]{margin-left:-1%}"]}),e})();var Wc=n("st4c"),jc=n("lOp/");const Yc=["tree"],Nc=function(e,t,n){return[e,t,n]};function zc(e,t){if(1&e&&r.Sb(0,"i",12),2&e){const e=r.nc();r.uc("ngClass",r.Bc(1,Nc,e.icons.large,e.icons.spinner,e.icons.spin))}}const $c=function(){return["in","up"]},Hc=function(){return["down","out","destroyed"]},Xc=function(e,t){return{"badge-success":e,"badge-danger":t}};function Vc(e,t){if(1&e&&(r.Xb(0,"span",15),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit;r.uc("ngClass",r.Ac(4,Xc,r.yc(2,$c).includes(e.data.status),r.yc(3,Hc).includes(e.data.status))),r.Db(1),r.Tc(" ",e.data.status," ")}}const Bc=function(e){return{"type-osd":e}};function Uc(e,t){if(1&e&&(r.Pc(0,Vc,2,7,"span",13),r.Xb(1,"span"),r.Rc(2,"\xa0"),r.Wb(),r.Sb(3,"span",14)),2&e){const e=t.$implicit;r.uc("ngIf",e.data.status),r.Db(3),r.uc("ngClass",r.zc(3,Bc,"osd"===e.data.type))("innerHTML",e.data.name,r.Jc)}}function qc(e,t){if(1&e&&(r.Xb(0,"div",16),r.Xb(1,"legend"),r.Rc(2),r.Wb(),r.Sb(3,"cd-table-key-value",17),r.Wb()),2&e){const e=r.nc();r.Db(2),r.Sc(e.metadataTitle),r.Db(1),r.uc("data",e.metadata)}}let Gc=(()=>{class e{constructor(e,t){this.crushRuleService=e,this.timerService=t,this.sub=new ir.a,this.icons=_n.a,this.loadingIndicator=!0,this.nodes=[],this.treeOptions={useVirtualScroll:!0,nodeHeight:22,actionMapping:{mouse:{click:this.onNodeSelected.bind(this)}}},this.metadataKeyMap={}}ngOnInit(){this.sub=this.timerService.get(()=>this.crushRuleService.getInfo(),5e3).subscribe(e=>{this.loadingIndicator=!1,this.nodes=this.abstractTreeData(e)})}ngOnDestroy(){this.sub.unsubscribe()}abstractTreeData(e){const t=e.nodes||[],n=e.roots||[],i={};if(0===t.length)return[{name:"No nodes!"}];const r=[];return t.reverse().forEach(e=>{n.includes(e.id)&&r.push(e.id),i[e.id]=this.generateTreeLeaf(e,i)}),r.map(e=>i[e])}generateTreeLeaf(e,t){const n=e.id;this.metadataKeyMap[n]=e;const i=[],r={name:e.name+" ("+e.type+")",status:e.status,cdId:n,type:e.type};return e.children&&(e.children.sort().forEach(e=>{i.push(t[e])}),r.children=i),r}onNodeSelected(e,t){if(kn.a.ACTIVATE(e,t,!0),void 0!==t.data.cdId){const e=this.metadataKeyMap[t.data.cdId],{name:n,type:i}=e,r=Object(jt.f)(e,["name","type","status"]);this.metadata=r,this.metadataTitle=n+" ("+i+")"}else delete this.metadata,delete this.metadataTitle}onUpdateData(){this.tree.treeModel.expandAll()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Wc.a),r.Rb(jc.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-crushmap"]],viewQuery:function(e,t){if(1&e&&r.Wc(Yc,1),2&e){let e;r.Ec(e=r.mc())&&(t.tree=e.first)}},decls:14,vars:4,consts:function(){let e;return e="CRUSH map viewer",[[1,"row"],[1,"col-sm-12","col-lg-12"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"col-sm-6","col-lg-6","tree-container"],[3,"ngClass",4,"ngIf"],[3,"nodes","options","updateData"],["tree",""],["treeNodeTemplate",""],["class","col-sm-6 col-lg-6 metadata",4,"ngIf"],[3,"ngClass"],["class","badge",3,"ngClass",4,"ngIf"],[1,"node-name",3,"ngClass","innerHTML"],[1,"badge",3,"ngClass"],[1,"col-sm-6","col-lg-6","metadata"],[3,"data"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"div",2),r.Xb(3,"div",3),r.bc(4,4),r.Wb(),r.Xb(5,"div",5),r.Xb(6,"div",0),r.Xb(7,"div",6),r.Pc(8,zc,1,5,"i",7),r.Xb(9,"tree-root",8,9),r.lc("updateData",function(){return t.onUpdateData()}),r.Pc(11,Uc,4,5,"ng-template",null,10,r.Qc),r.Wb(),r.Wb(),r.Pc(13,qc,4,2,"div",11),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(8),r.uc("ngIf",t.loadingIndicator),r.Db(1),r.uc("nodes",t.nodes)("options",t.treeOptions),r.Db(4),r.uc("ngIf",t.metadata))},directives:[s.r,kn.b,s.p,en.a],styles:[".tree-container[_ngcontent-%COMP%]{height:calc(100vh - 200px)}"]}),e})(),Jc=(()=>{class e{constructor(e){this.http=e}getLogs(){return this.http.get("api/logs/all")}validateDashboardUrl(e){return this.http.get(`api/grafana/validation/${e}`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Kc=n("Iab2");let Qc=(()=>{class e{download(e,t){Object(Kc.saveAs)(new Blob([e]),t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Zc=function(e){return[e]};function el(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",5),r.lc("click",function(){return r.Ic(e),r.nc().download("json")}),r.Sb(1,"i",2),r.Xb(2,"span"),r.Rc(3,"JSON"),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(1),r.uc("ngClass",r.zc(1,Zc,e.icons.json))}}function tl(e,t){if(1&e){const e=r.Yb();r.Xb(0,"button",5),r.lc("click",function(){return r.Ic(e),r.nc().download()}),r.Sb(1,"i",2),r.Xb(2,"span"),r.Rc(3,"Text"),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(1),r.uc("ngClass",r.zc(1,Zc,e.icons.text))}}let nl=(()=>{class e{constructor(e){this.textToDownloadService=e,this.title="Download",this.icons=_n.a}download(e){this.fileName=`${this.fileName}_${(new Date).toLocaleDateString()}`,"json"===e?this.textToDownloadService.download(JSON.stringify(this.objectItem,null,2),`${this.fileName}.json`):this.textToDownloadService.download(this.textItem,`${this.fileName}.txt`)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Qc))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-download-button"]],inputs:{objectItem:"objectItem",textItem:"textItem",fileName:"fileName",title:"title"},decls:6,vars:6,consts:[["ngbDropdown","","placement","bottom-right"],["type","button","ngbDropdownToggle","",1,"btn","btn-light","dropdown-toggle-split",3,"title"],[3,"ngClass"],["ngbDropdownMenu",""],["ngbDropdownItem","",3,"click",4,"ngIf"],["ngbDropdownItem","",3,"click"]],template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"button",1),r.Sb(2,"i",2),r.Wb(),r.Xb(3,"div",3),r.Pc(4,el,4,3,"button",4),r.Pc(5,tl,4,3,"button",4),r.Wb(),r.Wb()),2&e&&(r.Db(1),r.uc("title",t.title),r.Db(1),r.uc("ngClass",r.zc(4,Zc,t.icons.download)),r.Db(2),r.uc("ngIf",t.objectItem),r.Db(1),r.uc("ngIf",t.textItem))},directives:[Jt.i,On.a,Jt.m,s.p,Jt.k,s.r,Jt.j],styles:[""]}),e})();var il=n("E2fk");function rl(e,t){1&e&&r.Tb(0)}function sl(e,t){if(1&e&&(r.Xb(0,"div",19),r.Sb(1,"cd-download-button",20),r.Sb(2,"cd-copy-2-clipboard-button",21),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.uc("objectItem",e.clog)("textItem",e.clogText),r.Db(1),r.uc("source",e.clogText)("byId",!1)}}function ol(e,t){if(1&e&&(r.Xb(0,"p"),r.Xb(1,"span",22),r.Rc(2),r.oc(3,"cdDate"),r.Wb(),r.Xb(4,"span"),r.oc(5,"logPriority"),r.Rc(6),r.Wb(),r.Xb(7,"span",23),r.Rc(8),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Sc(r.pc(3,6,e.stamp)),r.Db(2),r.Gb("priority ",r.pc(5,8,e.priority),""),r.Db(2),r.Sc(e.priority),r.Db(2),r.Sc(e.message)}}function al(e,t){1&e&&r.Tb(0)}function cl(e,t){if(1&e&&(r.Xb(0,"div",14),r.Pc(1,sl,3,4,"div",15),r.Xb(2,"div",16),r.Pc(3,ol,9,10,"p",17),r.Pc(4,al,1,0,"ng-container",18),r.Wb(),r.Wb()),2&e){const e=r.nc(3),t=r.Fc(4);r.Db(1),r.uc("ngIf",e.clog.length),r.Db(2),r.uc("ngForOf",e.clog),r.Db(1),r.uc("ngIf",0!=e.clog.length)("ngIfElse",t)}}function ll(e,t){if(1&e&&r.Pc(0,cl,5,4,"div",13),2&e){const e=r.nc(2);r.uc("ngIf",e.clog)}}function ul(e,t){if(1&e&&(r.Xb(0,"div",19),r.Sb(1,"cd-download-button",24),r.Sb(2,"cd-copy-2-clipboard-button",21),r.Wb()),2&e){const e=r.nc(4);r.Db(1),r.uc("objectItem",e.audit_log)("textItem",e.auditLogText),r.Db(1),r.uc("source",e.auditLogText)("byId",!1)}}function dl(e,t){if(1&e&&(r.Xb(0,"p"),r.Xb(1,"span",22),r.Rc(2),r.oc(3,"cdDate"),r.Wb(),r.Xb(4,"span"),r.oc(5,"logPriority"),r.Rc(6),r.Wb(),r.Xb(7,"span",23),r.Rc(8),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(2),r.Sc(r.pc(3,6,e.stamp)),r.Db(2),r.Gb("priority ",r.pc(5,8,e.priority),""),r.Db(2),r.Sc(e.priority),r.Db(2),r.Sc(e.message)}}function hl(e,t){1&e&&r.Tb(0)}function fl(e,t){if(1&e&&(r.Xb(0,"div",14),r.Pc(1,ul,3,4,"div",15),r.Xb(2,"div",16),r.Pc(3,dl,9,10,"p",17),r.Pc(4,hl,1,0,"ng-container",18),r.Wb(),r.Wb()),2&e){const e=r.nc(3),t=r.Fc(4);r.Db(1),r.uc("ngIf",e.audit_log.length),r.Db(2),r.uc("ngForOf",e.audit_log),r.Db(1),r.uc("ngIf",0!=e.audit_log.length)("ngIfElse",t)}}function pl(e,t){if(1&e&&r.Pc(0,fl,5,4,"div",13),2&e){const e=r.nc(2);r.uc("ngIf",e.audit_log)}}function ml(e,t){if(1&e&&(r.Xb(0,"div"),r.Pc(1,rl,1,0,"ng-container",3),r.Xb(2,"ul",4,5),r.Xb(4,"li",6),r.Xb(5,"a",7),r.bc(6,8),r.Wb(),r.Pc(7,ll,1,1,"ng-template",9),r.Wb(),r.Xb(8,"li",10),r.Xb(9,"a",7),r.bc(10,11),r.Wb(),r.Pc(11,pl,1,1,"ng-template",9),r.Wb(),r.Wb(),r.Sb(12,"div",12),r.Wb()),2&e){const e=r.Fc(3);r.nc();const t=r.Fc(2);r.Db(1),r.uc("ngTemplateOutlet",t),r.Db(11),r.uc("ngbNavOutlet",e)}}function bl(e,t){if(1&e&&(r.Xb(0,"option",46),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.value),r.Db(1),r.Sc(e.name)}}const gl=function(e){return[e]};function _l(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",25),r.Xb(1,"div",26),r.Xb(2,"label",27),r.bc(3,28),r.Wb(),r.Xb(4,"select",29),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().priority=t})("ngModelChange",function(){return r.Ic(e),r.nc().filterLogs()}),r.Pc(5,bl,2,2,"option",30),r.Wb(),r.Wb(),r.Xb(6,"div",26),r.Xb(7,"label",31),r.bc(8,32),r.Wb(),r.Xb(9,"div",33),r.Xb(10,"div",34),r.Xb(11,"span",35),r.Sb(12,"i",36),r.Wb(),r.Wb(),r.Xb(13,"input",37),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().search=t})("keyup",function(){return r.Ic(e),r.nc().filterLogs()}),r.Wb(),r.Xb(14,"div",38),r.Xb(15,"button",39),r.lc("click",function(){return r.Ic(e),r.nc().clearSearchKey()}),r.Sb(16,"i"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(17,"div",26),r.Xb(18,"label",40),r.bc(19,41),r.Wb(),r.Xb(20,"div",33),r.Xb(21,"input",42,43),r.lc("click",function(){return r.Ic(e),r.Fc(22).open()})("ngModelChange",function(t){return r.Ic(e),r.nc().selectedDate=t})("ngModelChange",function(){return r.Ic(e),r.nc().filterLogs()}),r.Wb(),r.Xb(23,"span",38),r.Xb(24,"button",39),r.lc("click",function(){return r.Ic(e),r.nc().clearDate()}),r.Sb(25,"i"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(26,"div",26),r.Xb(27,"label"),r.bc(28,44),r.Wb(),r.Xb(29,"ngb-timepicker",45),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().startTime=t})("ngModelChange",function(){return r.Ic(e),r.nc().filterLogs()}),r.Wb(),r.Xb(30,"span"),r.Rc(31,"\xa0\u2014\xa0"),r.Wb(),r.Xb(32,"ngb-timepicker",45),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().endTime=t})("ngModelChange",function(){return r.Ic(e),r.nc().filterLogs()}),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(4),r.uc("ngModel",e.priority),r.Db(1),r.uc("ngForOf",e.priorities),r.Db(7),r.uc("ngClass",r.zc(16,gl,e.icons.search)),r.Db(1),r.uc("ngModel",e.search),r.Db(3),r.Gb("icon-prepend ",e.icons.destroy,""),r.Db(5),r.uc("maxDate",e.maxDate)("ngModel",e.selectedDate),r.Db(4),r.Gb("icon-prepend ",e.icons.destroy,""),r.Db(4),r.uc("spinners",!1)("ngModel",e.startTime),r.Db(3),r.uc("spinners",!1)("ngModel",e.endTime)}}function vl(e,t){if(1&e){const e=r.Yb();r.Xb(0,"span"),r.bc(1,47),r.Wb(),r.Xb(2,"span"),r.Rc(3,"\xa0"),r.Wb(),r.Xb(4,"a",48),r.lc("click",function(){return r.Ic(e),r.nc().resetFilter()}),r.bc(5,49),r.Wb()}}let yl=(()=>{class e{constructor(e,t,n){this.logsService=e,this.datePipe=t,this.ngZone=n,this.icons=_n.a,this.priorities=[{name:"Debug",value:"[DBG]"},{name:"Info",value:"[INF]"},{name:"Warning",value:"[WRN]"},{name:"Error",value:"[ERR]"},{name:"All",value:"All"}],this.priority="All",this.search="",this.startTime={hour:0,minute:0},this.endTime={hour:23,minute:59},this.maxDate={year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}ngOnInit(){this.getInfo(),this.ngZone.runOutsideAngular(()=>{this.interval=window.setInterval(()=>{this.ngZone.run(()=>{this.getInfo()})},5e3)})}ngOnDestroy(){clearInterval(this.interval)}getInfo(){this.logsService.getLogs().subscribe(e=>{this.contentData=e,this.clogText=this.logToText(this.contentData.clog),this.auditLogText=this.logToText(this.contentData.audit_log),this.filterLogs()})}abstractFilters(){var e,t,n,i,r,s,o,a;const c=this.priority,l=this.search.toLowerCase().replace(/,/g,"");let u;if(this.selectedDate){const e=this.selectedDate.month,t=this.selectedDate.day;u=`${this.selectedDate.year}-${e<=9?`0${e}`:`${e}`}-${t<=9?`0${t}`:`${t}`}`}else u="";return{priority:c,key:l,yearMonthDay:u,sTime:60*(null!==(t=null===(e=this.startTime)||void 0===e?void 0:e.hour)&&void 0!==t?t:0)+(null!==(i=null===(n=this.startTime)||void 0===n?void 0:n.minute)&&void 0!==i?i:0),eTime:60*(null!==(s=null===(r=this.endTime)||void 0===r?void 0:r.hour)&&void 0!==s?s:23)+(null!==(a=null===(o=this.endTime)||void 0===o?void 0:o.minute)&&void 0!==a?a:59)}}filterExecutor(e,t){return e.filter(e=>{const n=this.datePipe.transform(e.stamp,"mediumTime"),i=parseInt(n.split(":")[0],10),r=parseInt(n.split(":")[1],10);let s,o,a;return s="All"===t.priority?e.priority:t.priority,o=t.yearMonthDay?t.yearMonthDay:e.stamp,a=60*i+r,e.priority===s&&-1!==e.message.toLowerCase().indexOf(t.key)&&-1!==e.stamp.indexOf(o)&&a>=t.sTime&&a<=t.eTime})}filterLogs(){const e=this.abstractFilters();this.clog=this.filterExecutor(this.contentData.clog,e),this.audit_log=this.filterExecutor(this.contentData.audit_log,e)}clearSearchKey(){this.search="",this.filterLogs()}clearDate(){this.selectedDate=null,this.filterLogs()}resetFilter(){return this.priority="All",this.search="",this.selectedDate=null,this.startTime={hour:0,minute:0},this.endTime={hour:23,minute:59},this.filterLogs(),!1}logToText(e){let t="";for(const n of Object.keys(e))t=t+this.datePipe.transform(e[n].stamp,"medium")+"\t"+e[n].priority+"\t"+e[n].message+"\n";return t}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jc),r.Rb(s.e),r.Rb(r.D))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-logs"]],decls:5,vars:1,consts:function(){let e,t,n,i,r,s,o,a;return e="Cluster Logs",t="Audit Logs",n="Priority:",i="Keyword:",r="Date:",s="Time range:",o="No log entries found. Please try to select different filter options.",a="Reset filter.",[[4,"ngIf"],["logFiltersTpl",""],["noEntriesTpl",""],[4,"ngTemplateOutlet"],["ngbNav","","cdStatefulTab","logs",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","cluster-logs"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","audit-logs"],t,[3,"ngbNavOutlet"],["class","card bg-light mb-3",4,"ngIf"],[1,"card","bg-light","mb-3"],["class","btn-group","role","group",4,"ngIf"],[1,"card-body"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["role","group",1,"btn-group"],["fileName","cluster_log",3,"objectItem","textItem"],[3,"source","byId"],[1,"timestamp"],[1,"message"],["fileName","audit_log",3,"objectItem","textItem"],[1,"form-inline"],[1,"form-group"],["for","logs-priority"],n,["id","logs-priority",1,"form-control","custom-select",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["for","logs-keyword"],i,[1,"input-group"],[1,"input-group-prepend"],[1,"input-group-text"],[3,"ngClass"],["id","logs-keyword","type","text",1,"form-control",3,"ngModel","ngModelChange","keyup"],[1,"input-group-append"],["type","button",1,"btn","btn-light",3,"click"],["for","logs-date"],r,["id","logs-date","placeholder","YYYY-MM-DD","ngbDatepicker","",1,"form-control",3,"maxDate","ngModel","click","ngModelChange"],["d","ngbDatepicker"],s,[3,"spinners","ngModel","ngModelChange"],[3,"value"],o,["href","#",3,"click"],a]},template:function(e,t){1&e&&(r.Pc(0,ml,13,2,"div",0),r.Pc(1,_l,33,18,"ng-template",null,1,r.Qc),r.Pc(3,vl,6,0,"ng-template",null,2,r.Qc)),2&e&&r.uc("ngIf",t.contentData)},directives:[s.r,s.w,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,s.q,nl,ma.a,Zn.a,On.a,xn.z,ei.a,xn.q,xn.t,s.p,xn.d,Jt.n,Jt.B,xn.u,xn.C],pipes:[Xt.a,il.a],styles:["p[_ngcontent-%COMP%]{font-family:monospace}.card[_ngcontent-%COMP%]   .btn-group[_ngcontent-%COMP%]{margin-top:-45px;position:absolute;right:0}.card[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{display:flex}.card[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.card[_ngcontent-%COMP%]   .timestamp[_ngcontent-%COMP%]{flex-shrink:0;font-weight:700}.card[_ngcontent-%COMP%]   .priority[_ngcontent-%COMP%]{margin-left:.5rem}.card[_ngcontent-%COMP%]   .message[_ngcontent-%COMP%]{margin-left:1rem}.card[_ngcontent-%COMP%]   .err[_ngcontent-%COMP%]{color:#ef5c55}.card[_ngcontent-%COMP%]   .warn[_ngcontent-%COMP%]{color:#ffc200}.card[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{color:#2b99a8}.card[_ngcontent-%COMP%]   .debug[_ngcontent-%COMP%]{color:#495057}  cd-logs ngb-timepicker input.ngb-tp-input{width:3.5rem!important}"]}),e})(),wl=(()=>{class e{constructor(e){this.http=e,this.url="api/mgr/module"}list(){return this.http.get(`${this.url}`)}getConfig(e){return this.http.get(`${this.url}/${e}`)}updateConfig(e,t){return this.http.put(`${this.url}/${e}`,{config:t})}enable(e){return this.http.post(`${this.url}/${e}/enable`,null)}disable(e){return this.http.post(`${this.url}/${e}/disable`,null)}getOptions(e){return this.http.get(`${this.url}/${e}/options`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Dl(e,t){if(1&e&&(r.Xb(0,"cd-helper"),r.Rc(1),r.oc(2,"upperFirst"),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.Tc(" ",r.pc(2,1,e.value.long_desc||e.value.desc)," ")}}function Sl(e,t){if(1&e&&(r.Xb(0,"div",15),r.Xb(1,"div",16),r.Sb(2,"input",17),r.Sb(3,"label",18),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(2),r.vc("id",e.value.name),r.vc("formControlName",e.value.name),r.Db(1),r.vc("for",e.value.name)}}function xl(e,t){if(1&e&&r.Sb(0,"input",22),2&e){const e=r.nc(2).$implicit;r.vc("id",e.value.name),r.vc("formControlName",e.value.name)}}function kl(e,t){if(1&e&&(r.Xb(0,"option",25),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("ngValue",e),r.Db(1),r.Tc(" ",e," ")}}function Tl(e,t){if(1&e&&(r.Xb(0,"select",23),r.Pc(1,kl,2,2,"option",24),r.Wb()),2&e){const e=r.nc(2).$implicit;r.vc("id",e.value.name),r.vc("formControlName",e.value.name),r.Db(1),r.uc("ngForOf",e.value.enum_allowed)}}function Ml(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,27),r.Wb())}function Cl(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,28),r.Wb())}function Ol(e,t){if(1&e&&(r.Xb(0,"div",15),r.Pc(1,xl,1,2,"input",19),r.Pc(2,Tl,2,3,"select",20),r.Pc(3,Ml,2,0,"span",21),r.Pc(4,Cl,2,0,"span",21),r.Wb()),2&e){const e=r.nc().$implicit;r.nc();const t=r.Fc(2),n=r.nc();r.Db(1),r.uc("ngIf",0===e.value.enum_allowed.length),r.Db(1),r.uc("ngIf",e.value.enum_allowed.length>0),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"invalidUuid")),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}function Ll(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,30),r.Wb())}function El(e,t){if(1&e&&(r.Xb(0,"span",26),r.bc(1,31),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.fc(e.value.max),r.cc(1)}}function Al(e,t){if(1&e&&(r.Xb(0,"span",26),r.bc(1,32),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.fc(e.value.min),r.cc(1)}}function Il(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,33),r.Wb())}function Rl(e,t){if(1&e&&(r.Xb(0,"div",15),r.Sb(1,"input",29),r.Pc(2,Ll,2,0,"span",21),r.Pc(3,El,2,1,"span",21),r.Pc(4,Al,2,1,"span",21),r.Pc(5,Il,2,0,"span",21),r.Wb()),2&e){const e=r.nc().$implicit;r.nc();const t=r.Fc(2),n=r.nc();r.Db(1),r.vc("id",e.value.name),r.vc("formControlName",e.value.name),r.vc("min",e.value.min),r.vc("max",e.value.max),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"required")),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"max")),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"min")),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}function Pl(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,35),r.Wb())}function Fl(e,t){1&e&&(r.Xb(0,"span",26),r.bc(1,36),r.Wb())}function Wl(e,t){if(1&e&&(r.Xb(0,"div",15),r.Sb(1,"input",34),r.Pc(2,Pl,2,0,"span",21),r.Pc(3,Fl,2,0,"span",21),r.Wb()),2&e){const e=r.nc().$implicit;r.nc();const t=r.Fc(2),n=r.nc();r.Db(1),r.vc("id",e.value.name),r.vc("formControlName",e.value.name),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"required")),r.Db(1),r.uc("ngIf",n.mgrModuleForm.showError(e.value.name,t,"pattern"))}}const jl=function(){return["addr","str","uuid"]},Yl=function(){return["uint","int","size","secs"]};function Nl(e,t){if(1&e&&(r.Xb(0,"div",11),r.Xb(1,"label",12),r.Rc(2),r.Pc(3,Dl,3,3,"cd-helper",13),r.Wb(),r.Pc(4,Sl,4,3,"div",14),r.Pc(5,Ol,5,4,"div",14),r.Pc(6,Rl,6,8,"div",14),r.Pc(7,Wl,4,4,"div",14),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.vc("for",e.value.name),r.Db(1),r.Tc(" ",e.value.name," "),r.Db(1),r.uc("ngIf",e.value.long_desc||e.value.desc),r.Db(1),r.uc("ngIf","bool"===e.value.type),r.Db(1),r.uc("ngIf",r.yc(7,jl).includes(e.value.type)),r.Db(1),r.uc("ngIf",r.yc(8,Yl).includes(e.value.type)),r.Db(1),r.uc("ngIf","float"===e.value.type)}}function zl(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",1),r.Xb(1,"form",2,3),r.Xb(3,"div",4),r.Xb(4,"div",5),r.bc(5,6),r.Wb(),r.Xb(6,"div",7),r.Pc(7,Nl,8,9,"div",8),r.oc(8,"keyvalue"),r.Wb(),r.Xb(9,"div",9),r.Xb(10,"cd-form-button-panel",10),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc().onSubmit()}),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc();r.Db(1),r.uc("formGroup",e.mgrModuleForm),r.Db(6),r.uc("ngForOf",r.pc(8,4,e.moduleOptions)),r.Db(3),r.uc("form",e.mgrModuleForm)("submitText",e.actionLabels.UPDATE)}}let $l=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s){super(),this.actionLabels=e,this.route=t,this.router=n,this.formBuilder=i,this.mgrModuleService=r,this.notificationService=s,this.moduleName="",this.moduleOptions=[]}ngOnInit(){this.route.params.subscribe(e=>{this.moduleName=decodeURIComponent(e.name);const t=[this.mgrModuleService.getOptions(this.moduleName),this.mgrModuleService.getConfig(this.moduleName)];Object(Oi.a)(t).subscribe(e=>{this.moduleOptions=e[0],this.createForm(),this.mgrModuleForm.setValue(e[1]),this.loadingReady()},e=>{this.loadingError()})})}getValidators(e){const t=[];switch(e.type){case"addr":t.push(Cn.a.ip());break;case"uint":case"int":case"size":case"secs":t.push(Cn.a.number()),t.push(xn.A.required),Wt.a.isNumber(e.min)&&t.push(xn.A.min(e.min)),Wt.a.isNumber(e.max)&&t.push(xn.A.max(e.max));break;case"str":Wt.a.isNumber(e.min)&&t.push(xn.A.minLength(e.min)),Wt.a.isNumber(e.max)&&t.push(xn.A.maxLength(e.max));break;case"float":t.push(xn.A.required),t.push(Cn.a.decimalNumber());break;case"uuid":t.push(Cn.a.uuid())}return t}createForm(){const e={};Wt.a.forEach(this.moduleOptions,t=>{e[t.name]=[t.default_value,this.getValidators(t)]}),this.mgrModuleForm=this.formBuilder.group(e)}goToListView(){this.router.navigate(["/mgr-modules"])}onSubmit(){if(this.mgrModuleForm.pristine)return void this.goToListView();const e={};Wt.a.forEach(this.moduleOptions,t=>{const n=this.mgrModuleForm.get(t.name);n.dirty&&n.valid&&(e[t.name]=n.value)}),this.mgrModuleService.updateConfig(this.moduleName,e).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated options for module '" + this.moduleName + "'."),this.goToListView()},()=>{this.mgrModuleForm.setErrors({cdSubmitButton:!0})})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Pt.a),r.Rb(Pt.e),r.Rb(wo.a),r.Rb(wl),r.Rb(wn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-mgr-module-form"]],features:[r.Ab],decls:1,vars:1,consts:function(){let e,t,n,i,r,s,o,a,c;return e="Edit Manager module",t="The entered value is not a valid UUID, e.g.: 67dcac9f-2c03-4d6c-b7bd-1210b3a259a8",n="The entered value needs to be a valid IP address.",i="This field is required.",r="The entered value is too high! It must be lower or equal to " + "\ufffd0\ufffd" + ".",s="The entered value is too low! It must be greater or equal to " + "\ufffd0\ufffd" + ".",o="The entered value needs to be a number.",a="This field is required.",c="The entered value needs to be a number or decimal.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","mgrModuleForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],["class","form-group row",4,"ngFor","ngForOf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"form-group","row"],[1,"cd-col-form-label",3,"for"],[4,"ngIf"],["class","cd-col-form-input",4,"ngIf"],[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","formControlName"],[1,"custom-control-label",3,"for"],["class","form-control","type","text",3,"id","formControlName",4,"ngIf"],["class","form-control custom-select",3,"id","formControlName",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["type","text",1,"form-control",3,"id","formControlName"],[1,"form-control","custom-select",3,"id","formControlName"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[1,"invalid-feedback"],t,n,["type","number",1,"form-control",3,"id","formControlName","min","max"],i,r,s,o,["type","number",1,"form-control",3,"id","formControlName"],a,c]},template:function(e,t){1&e&&r.Pc(0,zl,11,6,"div",0),2&e&&r.uc("cdFormLoading",t.loading)},directives:[Kn.a,xn.B,xn.r,xn.k,Qn.a,s.q,ti.a,Zn.a,s.r,dr.a,On.a,xn.b,ei.a,xn.q,xn.i,xn.d,xn.z,xn.u,xn.C,xn.v],pipes:[s.k,pr.a],styles:[""]}),e})();var Hl=n("jtHE");const Xl=["*"],Vl=["templateOutlet"];function Bl(e,t){if(1&e&&(r.Xb(0,"div",6),r.Rc(1),r.Wb()),2&e){const e=r.nc(2);r.Db(1),r.Tc(" ",e.message||e.defaultMessage," ")}}function Ul(e,t){if(1&e&&(r.Xb(0,"div",3),r.Sb(1,"div",4),r.Pc(2,Bl,2,1,"div",5),r.Wb()),2&e){const e=r.nc();r.Db(2),r.uc("ngIf",e.message||e.defaultMessage)}}function ql(e,t){}function Gl(e,t){1&e&&r.Pc(0,ql,0,0,"ng-template",null,7,r.Qc)}const Jl=function(e){return{active:e}};let Kl=(()=>{class e{}return e.START="start",e.STOP="stop",e.UPDATE="update",e.RESET="reset",e.RESET_GLOBAL="reset_global",e.UNSUBSCRIBE="unsubscribe",e})();const Ql="block-ui-main";let Zl=(()=>{let e=class{constructor(){this.blockUISettings={},this.blockUIInstances={},this.blockUISubject=new Hl.a(1),this.blockUIObservable=this.blockUISubject.asObservable(),this.blockUIObservable.subscribe(this.blockUIMiddleware.bind(this))}getSettings(){return this.blockUISettings}updateSettings(e={}){this.blockUISettings=Object.assign(Object.assign({},this.blockUISettings),e)}decorate(e="block-ui-main"){const t={name:e,isActive:!1,blockCount:0,start:this.dispatch(this.blockUISubject,Kl.START,e),update:this.dispatch(this.blockUISubject,Kl.UPDATE,e),stop:this.dispatch(this.blockUISubject,Kl.STOP,e),reset:this.dispatch(this.blockUISubject,Kl.RESET,e),resetGlobal:this.dispatch(this.blockUISubject,Kl.RESET_GLOBAL,e),unsubscribe:this.dispatch(this.blockUISubject,Kl.UNSUBSCRIBE,e)};return this.blockUIInstances[e]=this.blockUIInstances[e]||t,t}observe(){return this.blockUIObservable}clearInstance(e){this.dispatch(this.blockUISubject,Kl.RESET,e)}blockUIMiddleware({action:e,name:t}){let n=null;switch(e){case Kl.START:n=!0;break;case Kl.STOP:case Kl.RESET:n=!1}null!==n&&(this.blockUIInstances[t].isActive=n)}dispatch(e,t,n="block-ui-main"){return i=>{e.next({name:n,action:t,message:i})}}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})(),eu=(()=>{let e=class{constructor(e){this.blockUI=e}ngOnInit(){this.name=this.name||Ql,this.template=this.template||this.blockUI.blockUISettings.template}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Zl))},e.\u0275cmp=r.Lb({type:e,selectors:[["block-ui"]],inputs:{name:"name",template:"template",message:"message",delayStart:"delayStart",delayStop:"delayStop"},ngContentSelectors:Xl,decls:2,vars:5,consts:[[3,"name","message","template","delayStart","delayStop"]],template:function(e,t){1&e&&(r.tc(),r.sc(0),r.Sb(1,"block-ui-content",0)),2&e&&(r.Db(1),r.uc("name",t.name)("message",t.message)("template",t.template)("delayStart",t.delayStart)("delayStop",t.delayStop))},directives:function(){return[tu]},encapsulation:2}),e})(),tu=(()=>{let e=class{constructor(e,t,n){this.blockUI=e,this.resolver=t,this.changeDetectionRef=n,this.name=Ql,this.defaultBlockState={startTimeouts:[],stopTimeouts:[],updateTimeouts:[],blockCount:0,startCallCount:0,stopCallCount:0},this.state=Object.assign({},this.defaultBlockState)}ngOnInit(){this.settings=this.blockUI.getSettings(),this.blockUISubscription=this.subscribeToBlockUI(this.blockUI.observe())}ngAfterViewInit(){try{if(!this.templateCmp)return!1;if(this.templateCmp instanceof r.O)this.templateOutlet.createEmbeddedView(this.templateCmp);else{const e=this.resolver.resolveComponentFactory(this.templateCmp);this.templateCompRef=this.templateOutlet.createComponent(e),this.updateBlockTemplate(this.message)}}catch(e){console.error("ng-block-ui:",e)}}ngAfterViewChecked(){this.detectChanges()}subscribeToBlockUI(e){return e.subscribe(e=>this.onDispatchedEvent(e))}onDispatchedEvent(e){switch(e.action){case Kl.START:this.onStart(e);break;case Kl.STOP:this.onStop(e);break;case Kl.UPDATE:this.onUpdate(e);break;case Kl.RESET:this.onReset(e);break;case Kl.RESET_GLOBAL:this.resetState();break;case Kl.UNSUBSCRIBE:this.onStop(e),this.onUnsubscribe(e.name)}}onStart({name:e,message:t}){if(e===this.name){const e=this.delayStart||this.settings.delayStart||0;this.state.startCallCount+=1;const n=setTimeout(()=>{this.state.blockCount+=1,this.showBlock(t),this.updateInstanceBlockCount()},e);this.state.startTimeouts.push(n)}}onStop({name:e}){if(e===this.name){const e=this.state.stopCallCount+1;if(this.state.startCallCount-e>=0){const t=this.delayStop||this.settings.delayStop||0;this.state.stopCallCount=e;const n=setTimeout(()=>{this.state.blockCount-=1,this.updateInstanceBlockCount(),this.detectChanges()},t);this.state.stopTimeouts.push(n)}}}onUpdate({name:e,message:t}){if(e===this.name){const e=this.delayStart||this.settings.delayStart||0;clearTimeout(this.state.updateTimeouts[0]);const n=setTimeout(()=>{this.updateMessage(t)},e);this.state.updateTimeouts.push(n)}}onReset({name:e}){e===this.name&&this.resetState()}updateMessage(e){this.showBlock(e)}showBlock(e){this.message=e||this.defaultMessage||this.settings.message,this.updateBlockTemplate(this.message),this.detectChanges()}updateBlockTemplate(e){this.templateCompRef&&this.templateCompRef instanceof r.l&&(this.templateCompRef.instance.message=e)}resetState(){[...this.state.startTimeouts,...this.state.stopTimeouts,...this.state.updateTimeouts].forEach(clearTimeout),this.state=Object.assign({},this.defaultBlockState),this.updateInstanceBlockCount(),this.detectChanges()}onUnsubscribe(e){this.blockUISubscription&&e===this.name&&this.blockUISubscription.unsubscribe()}updateInstanceBlockCount(){if(this.blockUI.blockUIInstances[this.name]){const{blockCount:e}=this.state;this.blockUI.blockUIInstances[this.name].blockCount=e}}detectChanges(){this.changeDetectionRef.destroyed||this.changeDetectionRef.detectChanges()}ngOnDestroy(){this.resetState(),this.onUnsubscribe(this.name),this.blockUI.clearInstance(this.name)}};return e.\u0275fac=function(t){return new(t||e)(r.Rb(Zl),r.Rb(r.k),r.Rb(r.i))},e.\u0275cmp=r.Lb({type:e,selectors:[["block-ui-content"]],viewQuery:function(e,t){if(1&e&&r.Wc(Vl,1,r.S),2&e){let e;r.Ec(e=r.mc())&&(t.templateOutlet=e.first)}},inputs:{name:"name",delayStart:"delayStart",delayStop:"delayStop",defaultMessage:["message","defaultMessage"],templateCmp:["template","templateCmp"]},decls:3,vars:9,consts:[[3,"ngClass"],["class","block-ui-spinner",4,"ngIf"],[4,"ngIf"],[1,"block-ui-spinner"],[1,"loader"],["class","message",4,"ngIf"],[1,"message"],["templateOutlet",""]],template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Pc(1,Ul,3,1,"div",1),r.Pc(2,Gl,2,0,void 0,2),r.Wb()),2&e&&(r.Hb("block-ui-wrapper ",t.name," ",t.className,""),r.uc("ngClass",r.zc(7,Jl,t.state.blockCount>0)),r.Db(1),r.uc("ngIf",!t.templateCmp),r.Db(1),r.uc("ngIf",t.templateCmp))},directives:[s.p,s.r],styles:["\n.block-ui-wrapper {\n  display: none;\n  position: fixed;\n  height: 100%;\n  width: 100%;\n  top: 0;\n  left: 0;\n  background: rgba(0, 0, 0, 0.70);\n  z-index: 30000;\n  cursor: wait;\n}\n\n.block-ui-wrapper.block-ui-wrapper--element {\n  position: absolute;\n}\n\n.block-ui-wrapper.active {\n  display: block;\n}\n\n.block-ui-wrapper.block-ui-main {\n  position: fixed;\n}\n\n.block-ui-spinner,\n.block-ui-template {\n  position: absolute;\n  top: 40%;\n  margin: 0 auto;\n  left: 0;\n  right: 0;\n  transform: translateY(-50%);\n}\n\n.block-ui-spinner > .message {\n  font-size: 1.3em;\n  text-align: center;\n  color: #fff;\n}\n\n.block-ui__element {\n  position: relative;\n}\n\n.loader,\n.loader:after {\n  border-radius: 50%;\n  width: 10em;\n  height: 10em;\n}\n.loader {\n  margin: 7px auto;\n  font-size: 5px;\n  position: relative;\n  text-indent: -9999em;\n  border-top: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-right: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);\n  border-left: 1.1em solid #ffffff;\n  -webkit-transform: translateZ(0);\n  -ms-transform: translateZ(0);\n  transform: translateZ(0);\n  -webkit-animation: load8 1.1s infinite linear;\n  animation: load8 1.1s infinite linear;\n}\n\n@-webkit-keyframes load8 {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n\n@keyframes load8 {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg);\n  }\n}\n"],encapsulation:2}),e})(),nu=(()=>{let e=class{constructor(e){this.blockUIInstance=e,this.globalDispatch=this.blockUIInstance.decorate()}start(e,t){this.dispatch(e,Kl.START,t)}stop(e){this.dispatch(e,Kl.STOP)}reset(e){this.dispatch(e,Kl.RESET)}resetGlobal(){this.globalDispatch.resetGlobal()}update(e,t){this.dispatch(e,Kl.UPDATE,t)}unsubscribe(e){this.dispatch(e,Kl.UNSUBSCRIBE)}isActive(e=null){const t=e?this.toArray(e):null,n=this.blockUIInstance.blockUIInstances;return Object.keys(n).some(e=>t?t.indexOf(n[e].name)>=0&&n[e].isActive:n[e].isActive)}dispatch(e=[],t,n){this.toArray(e).forEach(e=>this.blockUIInstance.decorate(e)[t](n))}toArray(e=[]){return"string"==typeof e?[e]:e}};return e.\u0275fac=function(t){return new(t||e)(r.ic(Zl))},e.\u0275prov=r.Nb({token:e,factory:function(t){return e.\u0275fac(t)}}),e})();var iu;const ru=new Zl,su=new r.u("BlockUIModuleSettings");function ou(e){return ru.updateSettings(e),ru}let au=(()=>{let e=iu=class{static forRoot(e={}){return{ngModule:iu,providers:[{provide:su,useValue:e},{provide:Zl,useFactory:ou,deps:[su]},nu]}}};return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c]]}),e})(),cu=1;function lu(e,t={}){return t.scopeToInstance?function(t,n){const i=`_${n}-block-ui`;Object.defineProperty(t,n,{get:function(){if(this[i])return this[i];const t=`${e}-${cu++}`;return this[i]=ru.decorate(t),this[i]},set:function(e){this[i]=e}})}:function(t,n){t[n]=ru.decorate(e)}}function uu(e,t){if(1&e&&(r.Vb(0),r.Sb(1,"cd-table-key-value",1),r.Ub()),2&e){const e=r.nc();r.Db(1),r.uc("data",e.module_config)}}let du=(()=>{class e{constructor(e){this.mgrModuleService=e}ngOnChanges(){this.selection&&this.mgrModuleService.getConfig(this.selection.name).subscribe(e=>{this.module_config=e})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wl))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-mgr-module-details"]],inputs:{selection:"selection"},features:[r.Bb],decls:1,vars:1,consts:[[4,"ngIf"],[3,"data"]],template:function(e,t){1&e&&r.Pc(0,uu,2,1,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,en.a],styles:[""]}),e})(),hu=(()=>{class e extends zt.a{constructor(e,t,n){super(),this.authStorageService=e,this.mgrModuleService=t,this.notificationService=n,this.columns=[],this.modules=[],this.selection=new Ht.a,this.permission=this.authStorageService.getPermissions().configOpt,this.columns=[{name:"Name",prop:"name",flexGrow:1},{name:"Enabled",prop:"enabled",flexGrow:1,cellClass:"text-center",cellTransformation:$t.a.checkIcon},{name:"Always-On",prop:"always_on",flexGrow:1,cellClass:"text-center",cellTransformation:$t.a.checkIcon}];const i=()=>this.selection.first()&&encodeURIComponent(this.selection.first().name);this.tableActions=[{name:"Edit",permission:"update",disable:()=>!this.selection.hasSelection||0===Object.values(this.selection.first().options).length,routerLink:()=>`/mgr-modules/edit/${i()}`,icon:_n.a.edit},{name:"Enable",permission:"update",click:()=>this.updateModuleState(),disable:()=>this.isTableActionDisabled("enabled"),icon:_n.a.start},{name:"Disable",permission:"update",click:()=>this.updateModuleState(),disable:()=>this.getTableActionDisabledDesc(),icon:_n.a.stop}]}getModuleList(e){this.mgrModuleService.list().subscribe(e=>{this.modules=e},()=>{e.error()})}updateSelection(e){this.selection=e}isTableActionDisabled(e){if(!this.selection.hasSelection)return!0;const t=this.selection.first();if("dashboard"===t.name)return!0;if(t.always_on)return!0;switch(e){case"enabled":return t.enabled;case"disabled":return!t.enabled}}getTableActionDisabledDesc(){var e;return(null===(e=this.selection.first())||void 0===e?void 0:e.always_on)?"This Manager module is always on.":this.isTableActionDisabled("disabled")}updateModuleState(){if(!this.selection.hasSelection)return;let e;const t=()=>{Object(Bt.a)(2e3).subscribe(()=>{this.mgrModuleService.list().subscribe(()=>{this.notificationService.suspendToasties(!1),this.blockUI.stop(),this.table.refreshBtn()},()=>{t()})})},n=this.selection.first();e=n.enabled?this.mgrModuleService.disable(n.name):this.mgrModuleService.enable(n.name),e.subscribe(()=>{},()=>{this.notificationService.suspendToasties(!0),this.blockUI.start("Reconnecting, please wait ..."),t()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(wl),r.Rb(wn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-mgr-module-list"]],viewQuery:function(e,t){if(1&e&&r.Wc(Vt.a,3),2&e){let e;r.Ec(e=r.mc())&&(t.table=e.first)}},features:[r.Ab],decls:4,vars:8,consts:[["columnMode","flex","selectionType","single","identifier","module",3,"autoReload","data","columns","hasDetails","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"]],template:function(e,t){1&e&&(r.Xb(0,"cd-table",0,1),r.lc("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)})("fetchData",function(e){return t.getModuleList(e)}),r.Sb(2,"cd-table-actions",2),r.Sb(3,"cd-mgr-module-details",3),r.Wb()),2&e&&(r.uc("autoReload",!1)("data",t.modules)("columns",t.columns)("hasDetails",!0),r.Db(2),r.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),r.Db(1),r.uc("selection",t.expandedRow))},directives:[Vt.a,Dn.a,du],styles:[""]}),Object(jt.b)([lu(),Object(jt.d)("design:type",Object)],e.prototype,"blockUI",void 0),e})(),fu=(()=>{class e{constructor(e){this.http=e}getMonitor(){return this.http.get("api/monitor")}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function pu(e,t){if(1&e&&(r.Xb(0,"table",11),r.Xb(1,"tr"),r.Xb(2,"td",12),r.bc(3,13),r.Wb(),r.Xb(4,"td"),r.Rc(5),r.Wb(),r.Wb(),r.Xb(6,"tr"),r.Xb(7,"td",12),r.bc(8,14),r.Wb(),r.Xb(9,"td"),r.Rc(10),r.oc(11,"relativeDate"),r.Wb(),r.Wb(),r.Xb(12,"tr"),r.Xb(13,"td",12),r.bc(14,15),r.Wb(),r.Xb(15,"td"),r.Rc(16),r.Wb(),r.Wb(),r.Xb(17,"tr"),r.Xb(18,"td",12),r.bc(19,16),r.Wb(),r.Xb(20,"td"),r.Rc(21),r.Wb(),r.Wb(),r.Xb(22,"tr"),r.Xb(23,"td",12),r.bc(24,17),r.Wb(),r.Xb(25,"td"),r.Rc(26),r.Wb(),r.Wb(),r.Xb(27,"tr"),r.Xb(28,"td",12),r.bc(29,18),r.Wb(),r.Xb(30,"td"),r.Rc(31),r.Wb(),r.Wb(),r.Xb(32,"tr"),r.Xb(33,"td",12),r.bc(34,19),r.Wb(),r.Xb(35,"td"),r.Rc(36),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(5),r.Sc(e.mon_status.monmap.fsid),r.Db(5),r.Sc(r.pc(11,7,e.mon_status.monmap.modified)),r.Db(6),r.Sc(e.mon_status.monmap.epoch),r.Db(5),r.Sc(e.mon_status.features.quorum_con),r.Db(5),r.Sc(e.mon_status.features.quorum_mon),r.Db(5),r.Sc(e.mon_status.features.required_con),r.Db(5),r.Sc(e.mon_status.features.required_mon)}}let mu=(()=>{class e{constructor(e){this.monitorService=e,this.inQuorum={columns:[{prop:"name",name:"Name",cellTransformation:$t.a.routerLink},{prop:"rank",name:"Rank"},{prop:"public_addr",name:"Public Address"},{prop:"cdOpenSessions",name:"Open Sessions",cellTransformation:$t.a.sparkline,comparator:(e,t)=>{const n=Wt.a.last(e),i=Wt.a.last(t);return n&&i&&n!==i?n>i?1:-1:0}}]},this.notInQuorum={columns:[{prop:"name",name:"Name",cellTransformation:$t.a.routerLink},{prop:"rank",name:"Rank"},{prop:"public_addr",name:"Public Address"}]}}refresh(){this.monitorService.getMonitor().subscribe(e=>{e.in_quorum.map(e=>(e.cdOpenSessions=e.stats.num_sessions.map(e=>e[1]),e.cdLink="/perf_counters/mon/"+e.name,e.cdParams={fromLink:"/monitor"},e)),e.out_quorum.map(e=>(e.cdLink="/perf_counters/mon/"+e.name,e.cdParams={fromLink:"/monitor"},e)),this.inQuorum.data=[...e.in_quorum],this.notInQuorum.data=[...e.out_quorum],this.mon_status=e.mon_status})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(fu))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-monitor"]],decls:13,vars:5,consts:function(){let e,t,n,i,r,s,o,a,c,l;return e="Status",t="In Quorum",n="Not In Quorum",i="Cluster ID",r="monmap modified",s="monmap epoch",o="quorum con",a="quorum mon",c="required con",l="required mon",[[1,"row"],[1,"col-lg-4"],[1,"cd-header"],e,["class","table table-striped",4,"ngIf"],[1,"col-lg-8"],[1,"in-quorum","cd-header"],t,[3,"data","columns"],n,[3,"data","columns","fetchData"],[1,"table","table-striped"],[1,"bold"],i,r,s,o,a,c,l]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"fieldset"),r.Xb(3,"legend",2),r.bc(4,3),r.Wb(),r.Pc(5,pu,37,9,"table",4),r.Wb(),r.Wb(),r.Xb(6,"div",5),r.Xb(7,"legend",6),r.bc(8,7),r.Wb(),r.Sb(9,"cd-table",8),r.Xb(10,"legend",6),r.bc(11,9),r.Wb(),r.Xb(12,"cd-table",10),r.lc("fetchData",function(){return t.refresh()}),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(5),r.uc("ngIf",t.mon_status),r.Db(4),r.uc("data",t.inQuorum.data)("columns",t.inQuorum.columns),r.Db(3),r.uc("data",t.notInQuorum.data)("columns",t.notInQuorum.columns))},directives:[s.r,Vt.a],pipes:[Br.a],styles:[""]}),e})();function bu(e,t){if(1&e&&(r.Xb(0,"span",18),r.bc(1,19),r.Wb()),2&e){const e=r.nc(2);r.uc("ngbTooltip",e.clusterWideTooltip)}}function gu(e,t){1&e&&r.Sb(0,"hr",20)}function _u(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",12),r.Xb(1,"input",13),r.lc("change",function(){r.Ic(e);const n=t.$implicit;return r.nc().changeValue(n)}),r.Wb(),r.Xb(2,"label",14),r.Xb(3,"strong"),r.Rc(4),r.Wb(),r.Pc(5,bu,2,1,"span",15),r.Sb(6,"br"),r.Xb(7,"span",16),r.Rc(8),r.Wb(),r.Wb(),r.Pc(9,gu,1,0,"hr",17),r.Wb()}if(2&e){const e=t.$implicit,n=t.last;r.Db(1),r.uc("checked",e.value)("indeterminate",e.indeterminate)("name",e.code)("id",e.code),r.Db(1),r.uc("for",e.code),r.Db(2),r.Sc(e.name),r.Db(1),r.uc("ngIf",e.clusterWide),r.Db(3),r.Sc(e.description),r.Db(1),r.uc("ngIf",!n)}}let vu=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.osdService=i,this.notificationService=r,this.initialSelection=[],this.osdFlagsForm=new xn.j({}),this.flags=[{code:"noup",name:"No Up",description:"OSDs are not allowed to start",value:!1,clusterWide:!1,indeterminate:!1},{code:"nodown",name:"No Down",description:"OSD failure reports are being ignored, such that the monitors will not mark OSDs down",value:!1,clusterWide:!1,indeterminate:!1},{code:"noin",name:"No In",description:"OSDs that were previously marked out will not be marked back in when they start",value:!1,clusterWide:!1,indeterminate:!1},{code:"noout",name:"No Out",description:"OSDs will not automatically be marked out after the configured interval",value:!1,clusterWide:!1,indeterminate:!1}],this.clusterWideTooltip="The flag has been enabled for the entire cluster.",this.permissions=this.authStorageService.getPermissions()}ngOnInit(){const e=this.selected.length;this.osdService.getFlags().subscribe(t=>{const n=this.getActivatedIndivFlags();this.flags.forEach(i=>{const r=n[i.code];t.includes(i.code)&&(i.clusterWide=!0),r===e?i.value=!0:r>0&&(i.indeterminate=!0)}),this.initialSelection=Wt.a.cloneDeep(this.flags)})}getActivatedIndivFlags(){const e={};return this.flags.forEach(t=>{e[t.code]=0}),[].concat(...this.selected.map(e=>e.state)).map(t=>{Object.keys(e).includes(t)&&(e[t]=e[t]+1)}),e}changeValue(e){e.value=!e.value,e.indeterminate=!1}resetSelection(){this.flags=Wt.a.cloneDeep(this.initialSelection)}submitAction(){const e={};this.flags.forEach(t=>{e[t.code]=t.indeterminate?null:t.value});const t=this.selected.map(e=>e.osd);this.osdService.updateIndividualFlags(e,t).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated OSD Flags"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(gn.b),r.Rb(Gt.a),r.Rb(Vi),r.Rb(wn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-flags-indiv-modal"]],decls:12,vars:6,consts:function(){let e,t,n;return e="Individual OSD Flags",t="Restore previous selection",n="Cluster-wide",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","osdFlagsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],t,[3,"form","showSubmit","submitText","submitActionEvent"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"checked","indeterminate","name","id","change"],["ng-class","['tc_' + key]",1,"custom-control-label",3,"for"],["class","badge badge-hdd ml-2",3,"ngbTooltip",4,"ngIf"],[1,"form-text","text-muted"],["class","m-1",4,"ngIf"],[1,"badge","badge-hdd","ml-2",3,"ngbTooltip"],n,[1,"m-1"]]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Pc(7,_u,10,9,"div",7),r.Wb(),r.Xb(8,"div",8),r.Xb(9,"button",9),r.lc("click",function(){return t.resetSelection()}),r.bc(10,10),r.Wb(),r.Xb(11,"cd-form-button-panel",11),r.lc("submitActionEvent",function(){return t.submitAction()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(4),r.uc("formGroup",t.osdFlagsForm),r.Db(3),r.uc("ngForOf",t.flags),r.Db(4),r.uc("form",t.osdFlagsForm)("showSubmit",t.permissions.osd.update)("submitText",t.actionLabels.UPDATE))},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,s.q,On.a,ti.a,ei.a,s.r,Jt.D],styles:[""]}),e})();var yu=n("f/UV");function wu(e,t){1&e&&r.Sb(0,"hr",15)}function Du(e,t){if(1&e&&(r.Xb(0,"div",10),r.Xb(1,"input",11),r.lc("change",function(){const e=t.$implicit;return e.value=!e.value}),r.Wb(),r.Xb(2,"label",12),r.Xb(3,"strong"),r.Rc(4),r.Wb(),r.Sb(5,"br"),r.Xb(6,"span",13),r.Rc(7),r.Wb(),r.Wb(),r.Pc(8,wu,1,0,"hr",14),r.Wb()),2&e){const e=t.$implicit,n=t.last;r.Db(1),r.uc("checked",e.value)("name",e.code)("id",e.code)("disabled",e.disabled),r.Db(1),r.uc("for",e.code),r.Db(2),r.Sc(e.name),r.Db(3),r.Sc(e.description),r.Db(1),r.uc("ngIf",!n)}}let Su=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.osdService=i,this.notificationService=r,this.osdFlagsForm=new xn.j({}),this.allFlags={noin:{code:"noin",name:"No In",value:!1,description:"OSDs that were previously marked out will not be marked back in when they start"},noout:{code:"noout",name:"No Out",value:!1,description:"OSDs will not automatically be marked out after the configured interval"},noup:{code:"noup",name:"No Up",value:!1,description:"OSDs are not allowed to start"},nodown:{code:"nodown",name:"No Down",value:!1,description:"OSD failure reports are being ignored, such that the monitors will not mark OSDs down"},pause:{code:"pause",name:"Pause",value:!1,description:"Pauses reads and writes"},noscrub:{code:"noscrub",name:"No Scrub",value:!1,description:"Scrubbing is disabled"},"nodeep-scrub":{code:"nodeep-scrub",name:"No Deep Scrub",value:!1,description:"Deep Scrubbing is disabled"},nobackfill:{code:"nobackfill",name:"No Backfill",value:!1,description:"Backfilling of PGs is suspended"},norebalance:{code:"norebalance",name:"No Rebalance",value:!1,description:"OSD will choose not to backfill unless PG is also degraded"},norecover:{code:"norecover",name:"No Recover",value:!1,description:"Recovery of PGs is suspended"},sortbitwise:{code:"sortbitwise",name:"Bitwise Sort",value:!1,description:"Use bitwise sort",disabled:!0},purged_snapdirs:{code:"purged_snapdirs",name:"Purged Snapdirs",value:!1,description:"OSDs have converted snapsets",disabled:!0},recovery_deletes:{code:"recovery_deletes",name:"Recovery Deletes",value:!1,description:"Deletes performed during recovery instead of peering",disabled:!0},pglog_hardlimit:{code:"pglog_hardlimit",name:"PG Log Hard Limit",value:!1,description:"Puts a hard limit on pg log length",disabled:!0}},this.unknownFlags=[],this.permissions=this.authStorageService.getPermissions()}ngOnInit(){this.osdService.getFlags().subscribe(e=>{e.forEach(e=>{this.allFlags[e]?this.allFlags[e].value=!0:this.unknownFlags.push(e)}),this.flags=Wt.a.toArray(this.allFlags)})}submitAction(){const e=this.flags.filter(e=>e.value).map(e=>e.code).concat(this.unknownFlags);this.osdService.updateFlags(e).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated OSD Flags"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(gn.b),r.Rb(Gt.a),r.Rb(Vi),r.Rb(wn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-flags-modal"]],decls:10,vars:6,consts:function(){let e;return e="Cluster-wide OSD Flags",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["name","osdFlagsForm","novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"checked","name","id","disabled","change"],["ng-class","['tc_' + key]",1,"custom-control-label",3,"for"],[1,"form-text","text-muted"],["class","m-1",4,"ngIf"],[1,"m-1"]]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Pc(7,Du,9,8,"div",7),r.Wb(),r.Xb(8,"div",8),r.Xb(9,"cd-form-button-panel",9),r.lc("submitActionEvent",function(){return t.submitAction()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(4),r.uc("formGroup",t.osdFlagsForm),r.Db(3),r.uc("ngForOf",t.flags),r.Db(2),r.uc("form",t.osdFlagsForm)("showSubmit",t.permissions.osd.update)("submitText",t.actionLabels.UPDATE))},directives:[ur.a,xn.B,xn.r,yu.a,Qn.a,xn.k,s.q,ti.a,On.a,ei.a,s.r],styles:[""]}),e})();function xu(e,t){if(1&e&&(r.Xb(0,"cd-helper"),r.Rc(1),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.Tc(" ",e.long_desc,"")}}function ku(e,t){if(1&e&&(r.Xb(0,"div",4),r.Xb(1,"label",5),r.Xb(2,"b"),r.Rc(3),r.Wb(),r.Sb(4,"br"),r.Xb(5,"span",6),r.Rc(6),r.Pc(7,xu,2,1,"cd-helper",7),r.Wb(),r.Wb(),r.Xb(8,"div",8),r.Xb(9,"div",9),r.Sb(10,"input",10),r.Sb(11,"label",11),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.uc("for",e.name),r.Db(2),r.Sc(e.text),r.Db(3),r.Tc(" ",e.desc," "),r.Db(1),r.uc("ngIf",e.long_desc),r.Db(3),r.uc("id",e.name)("formControlName",e.name),r.Db(1),r.uc("for",e.name)}}function Tu(e,t){if(1&e&&(r.Xb(0,"cd-helper"),r.Rc(1),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.Tc(" ",e.long_desc,"")}}const Mu=function(e){return[e]};function Cu(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",16),r.Xb(1,"button",17),r.lc("click",function(){r.Ic(e);const t=r.nc(2).$implicit;return r.nc().resetValue(t.name)}),r.Sb(2,"i",18),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(2),r.uc("ngClass",r.zc(1,Mu,e.icons.erase))}}function Ou(e,t){if(1&e&&(r.Xb(0,"span",19),r.Rc(1),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.Tc(" ",e.additionalTypeInfo.patternHelpText,"")}}function Lu(e,t){if(1&e&&(r.Xb(0,"span",19),r.Rc(1),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.Tc(" ",e.additionalTypeInfo.patternHelpText,"")}}function Eu(e,t){if(1&e&&(r.Xb(0,"span",19),r.bc(1,20),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.fc(e.maxValue),r.cc(1)}}function Au(e,t){if(1&e&&(r.Xb(0,"span",19),r.bc(1,21),r.Wb()),2&e){const e=r.nc(2).$implicit;r.Db(1),r.fc(e.minValue),r.cc(1)}}function Iu(e,t){if(1&e&&(r.Xb(0,"div",4),r.Xb(1,"label",5),r.Rc(2),r.Sb(3,"br"),r.Xb(4,"span",6),r.Rc(5),r.Pc(6,Tu,2,1,"cd-helper",7),r.Wb(),r.Wb(),r.Xb(7,"div",8),r.Xb(8,"div",12),r.Sb(9,"input",13),r.Pc(10,Cu,3,3,"div",14),r.Wb(),r.Pc(11,Ou,2,1,"span",15),r.Pc(12,Lu,2,1,"span",15),r.Pc(13,Eu,2,1,"span",15),r.Pc(14,Au,2,1,"span",15),r.Wb(),r.Wb()),2&e){const e=r.nc().$implicit,t=r.nc();r.Db(1),r.uc("for",e.name),r.Db(1),r.Tc("",e.text," "),r.Db(3),r.Tc(" ",e.desc," "),r.Db(1),r.uc("ngIf",e.long_desc),r.Db(3),r.uc("type",e.additionalTypeInfo.inputType)("id",e.name)("placeholder",e.additionalTypeInfo.humanReadable)("formControlName",e.name)("step",t.getStep(e.type,t.optionsForm.getValue(e.name))),r.Db(1),r.uc("ngIf",t.optionsFormShowReset),r.Db(1),r.uc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"pattern")),r.Db(1),r.uc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"invalidUuid")),r.Db(1),r.uc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"max")),r.Db(1),r.uc("ngIf",t.optionsForm.showError(e.name,t.optionsFormDir,"min"))}}function Ru(e,t){1&e&&r.Sb(0,"hr",22)}function Pu(e,t){if(1&e&&(r.Xb(0,"div"),r.Pc(1,ku,12,7,"div",2),r.Pc(2,Iu,15,14,"div",2),r.Pc(3,Ru,1,0,"hr",3),r.Wb()),2&e){const e=t.$implicit,n=t.last;r.Db(1),r.uc("ngIf","bool"===e.type),r.Db(1),r.uc("ngIf","bool"!==e.type),r.Db(1),r.uc("ngIf",!n)}}let Fu=(()=>{class e{constructor(e){this.configService=e,this.optionNames=[],this.optionsForm=new Gn.a({}),this.optionsFormDir=new xn.s([],[]),this.optionsFormGroupName="",this.optionsFormShowReset=!0,this.icons=_n.a,this.options=[],this.optionsFormGroup=new Gn.a({})}static optionNameToText(e){const t=["mon","mgr","osd","mds","client"];return e.split("_").filter((e,n)=>0!==n||!t.includes(e)).map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" ")}ngOnInit(){this.createForm(),this.loadStoredData()}createForm(){this.optionsForm.addControl(this.optionsFormGroupName,this.optionsFormGroup),this.optionNames.forEach(e=>{this.optionsFormGroup.addControl(e,new xn.h(null))})}getStep(e,t){return Un.getTypeStep(e,t)}loadStoredData(){this.configService.filter(this.optionNames).subscribe(t=>{this.options=t.map(t=>{const n=this.optionsForm.get(t.name),i=Un.getTypeValidators(t);return t.additionalTypeInfo=Un.getType(t.type),t.text=e.optionNameToText(t.name),t.value=Wt.a.find(t.value,e=>"osd"===e.section),t.value&&n.setValue("bool"===t.additionalTypeInfo.name?"true"===t.value.value:t.value.value),i&&(t.patternHelpText=i.patternHelpText,"max"in i&&""!==i.max&&(t.maxValue=i.max),"min"in i&&""!==i.min&&(t.minValue=i.min),n.setValidators(i.validators)),t})})}saveValues(){const e={};return this.optionNames.forEach(t=>{const n=this.optionsForm.getValue(t);null!==n&&""!==n&&(e[t]={section:"osd",value:n})}),this.configService.bulkCreate({options:e})}resetValue(e){this.configService.delete(e,"osd").subscribe(()=>{this.optionsForm.get(e).reset()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Bn.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-config-option"]],inputs:{optionNames:"optionNames",optionsForm:"optionsForm",optionsFormDir:"optionsFormDir",optionsFormGroupName:"optionsFormGroupName",optionsFormShowReset:"optionsFormShowReset"},decls:2,vars:2,consts:function(){let e,t,n;return e="Remove the custom configuration value. The default configuration will be inherited and used instead.",t="The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".",n="The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + ".",[[3,"formGroup"],[4,"ngFor","ngForOf"],["class","form-group row pt-2",4,"ngIf"],["class","my-2",4,"ngIf"],[1,"form-group","row","pt-2"],[1,"cd-col-form-label",3,"for"],[1,"text-muted"],[4,"ngIf"],[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","formControlName"],[1,"custom-control-label",3,"for"],[1,"input-group"],[1,"form-control",3,"type","id","placeholder","formControlName","step"],["class","input-group-append",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"input-group-append"],["type","button","data-toggle","button","title",e,1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],[1,"invalid-feedback"],t,n,[1,"my-2"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Pc(1,Pu,4,3,"div",1),r.Wb()),2&e&&(r.uc("formGroup",t.optionsFormGroup),r.Db(1),r.uc("ngForOf",t.options))},directives:[xn.r,xn.k,Qn.a,s.q,s.r,Zn.a,On.a,xn.b,ei.a,xn.q,xn.i,dr.a,xn.d,s.p],styles:[".custom-checkbox[_ngcontent-%COMP%]   input[_ngcontent-%COMP%], .custom-checkbox[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:pointer}.col-form-label[_ngcontent-%COMP%]{text-align:left}"]}),e})(),Wu=(()=>{class e{}return e.basicOptions=["osd_scrub_during_recovery","osd_scrub_begin_hour","osd_scrub_end_hour","osd_scrub_begin_week_day","osd_scrub_end_week_day","osd_scrub_min_interval","osd_scrub_max_interval","osd_deep_scrub_interval","osd_scrub_auto_repair","osd_max_scrubs","osd_scrub_priority","osd_scrub_sleep"],e.advancedOptions=["osd_scrub_auto_repair_num_errors","osd_debug_deep_scrub_sleep","osd_deep_scrub_keys","osd_deep_scrub_large_omap_object_key_threshold","osd_deep_scrub_large_omap_object_value_sum_threshold","osd_deep_scrub_randomize_ratio","osd_deep_scrub_stride","osd_deep_scrub_update_digest_min_age","osd_requested_scrub_priority","osd_scrub_backoff_ratio","osd_scrub_chunk_max","osd_scrub_chunk_min","osd_scrub_cost","osd_scrub_interval_randomize_ratio","osd_scrub_invalid_stats","osd_scrub_load_threshold","osd_scrub_max_preemptions"],e})();const ju=["basicOptionsValues"],Yu=["advancedOptionsValues"];function Nu(e,t){if(1&e){const e=r.Yb();r.Xb(0,"a",15),r.lc("click",function(){return r.Ic(e),r.nc().advancedEnabled=!0}),r.bc(1,16),r.Wb()}}function zu(e,t){if(1&e&&(r.Xb(0,"div"),r.Xb(1,"h3",17),r.bc(2,18),r.Wb(),r.Sb(3,"cd-config-option",7,19),r.Wb()),2&e){const e=r.nc(),t=r.Fc(7);r.Db(3),r.uc("optionNames",e.advancedOptions)("optionsForm",e.osdPgScrubForm)("optionsFormDir",t)("optionsFormGroupName","advancedFormGroup")}}let $u=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.authStorageService=t,this.notificationService=n,this.actionLabels=i,this.basicOptions=Wu.basicOptions,this.advancedOptions=Wu.advancedOptions,this.advancedEnabled=!1,this.osdPgScrubForm=new Gn.a({}),this.resource="PG scrub options",this.action=this.actionLabels.EDIT,this.permissions=this.authStorageService.getPermissions()}submitAction(){const e=[this.basicOptionsValues.saveValues()];this.advancedOptionsValues&&e.push(this.advancedOptionsValues.saveValues()),Object(Oi.a)(e).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated PG scrub options"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(Gt.a),r.Rb(wn.a),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-pg-scrub-modal"]],viewQuery:function(e,t){if(1&e&&(r.Wc(ju,3),r.Wc(Yu,1)),2&e){let e;r.Ec(e=r.mc())&&(t.basicOptionsValues=e.first),r.Ec(e=r.mc())&&(t.advancedOptionsValues=e.first)}},decls:19,vars:21,consts:function(){let e,t,n;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Advanced...",n="Advanced configuration options",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body","osd-modal"],[3,"optionNames","optionsForm","optionsFormDir","optionsFormGroupName"],["basicOptionsValues",""],[1,"row"],[1,"col-sm-12"],["class","pull-right margin-right-md",3,"click",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"pull-right","margin-right-md",3,"click"],t,[1,"page-header"],n,["advancedOptionsValues",""]]},template:function(e,t){if(1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.oc(3,"titlecase"),r.oc(4,"upperFirst"),r.Ub(),r.Vb(5,3),r.Xb(6,"form",4,5),r.Xb(8,"div",6),r.Sb(9,"cd-config-option",7,8),r.Xb(11,"div",9),r.Xb(12,"div",10),r.Pc(13,Nu,2,0,"a",11),r.Wb(),r.Wb(),r.Pc(14,zu,5,4,"div",12),r.Wb(),r.Xb(15,"div",13),r.Xb(16,"cd-form-button-panel",14),r.lc("submitActionEvent",function(){return t.submitAction()}),r.oc(17,"titlecase"),r.oc(18,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e){const e=r.Fc(7);r.uc("modalRef",t.activeModal),r.Db(4),r.fc(r.pc(3,13,t.action))(r.pc(4,15,t.resource)),r.cc(2),r.Db(2),r.uc("formGroup",t.osdPgScrubForm),r.Db(3),r.uc("optionNames",t.basicOptions)("optionsForm",t.osdPgScrubForm)("optionsFormDir",e)("optionsFormGroupName","basicFormGroup"),r.Db(4),r.uc("ngIf",!t.advancedEnabled),r.Db(1),r.uc("ngIf",t.advancedEnabled),r.Db(2),r.uc("form",t.osdPgScrubForm)("showSubmit",t.permissions.configOpt.update)("submitText",r.pc(17,17,t.action)+" "+r.pc(18,19,t.resource))}},directives:[ur.a,xn.B,xn.r,yu.a,Qn.a,xn.k,Fu,s.r,ti.a],pipes:[s.A,pr.a],styles:[""]}),e})();function Hu(e,t){if(1&e&&(r.Xb(0,"option",22),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.name),r.Db(1),r.Tc(" ",e.text," ")}}function Xu(e,t){1&e&&(r.Xb(0,"span",23),r.bc(1,24),r.Wb())}function Vu(e,t){if(1&e&&(r.Xb(0,"cd-helper"),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.Sc(e.value.desc)}}function Bu(e,t){1&e&&(r.Xb(0,"span",23),r.bc(1,29),r.Wb())}function Uu(e,t){if(1&e&&(r.Xb(0,"span",23),r.bc(1,30),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.fc(e.value.patternHelpText),r.cc(1)}}function qu(e,t){if(1&e&&(r.Xb(0,"span",23),r.bc(1,31),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.fc(e.value.maxValue),r.cc(1)}}function Gu(e,t){if(1&e&&(r.Xb(0,"span",23),r.bc(1,32),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.fc(e.value.minValue),r.cc(1)}}const Ju=function(e){return{required:e}};function Ku(e,t){if(1&e&&(r.Xb(0,"div",7),r.Xb(1,"label",25),r.Xb(2,"span",26),r.Rc(3),r.Wb(),r.Pc(4,Vu,2,1,"cd-helper",27),r.Wb(),r.Xb(5,"div",10),r.Sb(6,"input",28),r.Pc(7,Bu,2,0,"span",13),r.Pc(8,Uu,2,1,"span",13),r.Pc(9,qu,2,1,"span",13),r.Pc(10,Gu,2,1,"span",13),r.Wb(),r.Wb()),2&e){const e=t.$implicit,n=r.nc(),i=r.Fc(5);r.Db(1),r.uc("for",e.key),r.Db(1),r.uc("ngClass",r.zc(11,Ju,n.osdRecvSpeedForm.getValue("customizePriority"))),r.Db(1),r.Tc(" ",e.value.text," "),r.Db(1),r.uc("ngIf",e.value.desc),r.Db(2),r.uc("id",e.key)("formControlName",e.key)("readonly",!n.osdRecvSpeedForm.getValue("customizePriority")),r.Db(1),r.uc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,i,"required")),r.Db(1),r.uc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,i,"pattern")),r.Db(1),r.uc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,i,"max")),r.Db(1),r.uc("ngIf",n.osdRecvSpeedForm.getValue("customizePriority")&&n.osdRecvSpeedForm.showError(e.key,i,"min"))}}let Qu=(()=>{class e{constructor(e,t,n,i,r,s){this.activeModal=e,this.actionLabels=t,this.authStorageService=n,this.configService=i,this.notificationService=r,this.osdService=s,this.priorities=[],this.priorityAttrs={},this.permissions=this.authStorageService.getPermissions(),this.priorities=this.osdService.osdRecvSpeedModalPriorities.KNOWN_PRIORITIES,this.osdRecvSpeedForm=new Gn.a({priority:new xn.h(null,{validators:[xn.A.required]}),customizePriority:new xn.h(!1)}),this.priorityAttrs={osd_max_backfills:{text:"Max Backfills",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_max_active:{text:"Recovery Max Active",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_max_single_start:{text:"Recovery Max Single Start",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0},osd_recovery_sleep:{text:"Recovery Sleep",desc:"",patternHelpText:"",maxValue:void 0,minValue:void 0}},Object.keys(this.priorityAttrs).forEach(e=>{this.osdRecvSpeedForm.addControl(e,new xn.h(null,{validators:[xn.A.required]}))})}ngOnInit(){this.configService.filter(Object.keys(this.priorityAttrs)).subscribe(e=>{const t=this.getCurrentValues(e);this.detectPriority(t.values,e=>{this.setPriority(e)}),this.setDescription(t.configOptions),this.setValidators(t.configOptions)})}detectPriority(e,t){const n=Wt.a.find(this.priorities,t=>Wt.a.isEqual(t.values,e));return this.osdRecvSpeedForm.controls.customizePriority.setValue(!1),n?t(n):4===Object.entries(e).length?(this.osdRecvSpeedForm.controls.customizePriority.setValue(!0),t(Object({name:"custom",text:"Custom",values:e}))):t(this.priorities[0])}getCurrentValues(e){const t={values:{},configOptions:[]};return e.forEach(e=>{t.configOptions.push(e),"value"in e?e.value.forEach(n=>{"osd"===n.section&&(t.values[e.name]=Number(n.value))}):"default"in e&&null!==e.default&&(t.values[e.name]=Number(e.default))}),t}setDescription(e){e.forEach(e=>{""!==e.desc&&(this.priorityAttrs[e.name].desc=e.desc)})}setPriority(e){const t=Wt.a.find(this.priorities,e=>"custom"===e.name);"custom"===e.name?t||this.priorities.push(e):t&&this.priorities.splice(this.priorities.indexOf(t),1),this.osdRecvSpeedForm.controls.priority.setValue(e.name),Object.entries(e.values).forEach(([e,t])=>{this.osdRecvSpeedForm.controls[e].setValue(t)})}setValidators(e){e.forEach(e=>{const t=Un.getTypeValidators(e);t?(t.validators.push(xn.A.required),"max"in t&&""!==t.max&&(this.priorityAttrs[e.name].maxValue=t.max),"min"in t&&""!==t.min&&(this.priorityAttrs[e.name].minValue=t.min),this.priorityAttrs[e.name].patternHelpText=t.patternHelpText,this.osdRecvSpeedForm.controls[e.name].setValidators(t.validators)):this.osdRecvSpeedForm.controls[e.name].setValidators(xn.A.required)})}onCustomizePriorityChange(){const e={};if(Object.keys(this.priorityAttrs).forEach(t=>{e[t]=this.osdRecvSpeedForm.getValue(t)}),this.osdRecvSpeedForm.getValue("customizePriority")){const t={name:"custom",text:"Custom",values:e};this.setPriority(t)}else this.detectPriority(e,e=>{this.setPriority(e)})}onPriorityChange(e){const t=Wt.a.find(this.priorities,t=>t.name===e)||this.priorities[0];this.osdRecvSpeedForm.get("customizePriority").setValue(!1),this.setPriority(t)}submitAction(){const e={};Object.keys(this.priorityAttrs).forEach(t=>{e[t]={section:"osd",value:this.osdRecvSpeedForm.getValue(t)}}),this.configService.bulkCreate({options:e}).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated OSD recovery speed priority '" + this.osdRecvSpeedForm.getValue("priority") + "'"),this.activeModal.close()},()=>{this.activeModal.close()})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(gn.b),r.Rb(Gt.a),r.Rb(Bn.a),r.Rb(wn.a),r.Rb(Vi))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-recv-speed-modal"]],decls:24,vars:10,consts:function(){let e,t,n,i,r,s,o,a;return e="OSD Recovery Priority",t="Priority",n="Customize priority values",i="This field is required.",r="This field is required!",s="" + "\ufffd0\ufffd" + "",o="The entered value is too high! It must not be greater than " + "\ufffd0\ufffd" + ".",a="The entered value is too low! It must not be lower than " + "\ufffd0\ufffd" + ".",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],["novalidate","","cdFormScope","osd",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","priority",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["formControlName","priority","id","priority",1,"form-control","custom-select",3,"change"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["formControlName","customizePriority","id","customizePriority","name","customizePriority","type","checkbox",1,"custom-control-input",3,"change"],["for","customizePriority",1,"custom-control-label"],n,["class","form-group row",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],i,[1,"cd-col-form-label",3,"for"],[3,"ngClass"],[4,"ngIf"],["type","number",1,"form-control",3,"id","formControlName","readonly"],r,s,o,a]},template:function(e,t){if(1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Xb(7,"div",7),r.Xb(8,"label",8),r.bc(9,9),r.Wb(),r.Xb(10,"div",10),r.Xb(11,"select",11),r.lc("change",function(e){return t.onPriorityChange(e.target.value)}),r.Pc(12,Hu,2,2,"option",12),r.Wb(),r.Pc(13,Xu,2,0,"span",13),r.Wb(),r.Wb(),r.Xb(14,"div",7),r.Xb(15,"div",14),r.Xb(16,"div",15),r.Xb(17,"input",16),r.lc("change",function(){return t.onCustomizePriorityChange()}),r.Wb(),r.Xb(18,"label",17),r.bc(19,18),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(20,Ku,11,13,"div",19),r.oc(21,"keyvalue"),r.Wb(),r.Xb(22,"div",20),r.Xb(23,"cd-form-button-panel",21),r.lc("submitActionEvent",function(){return t.submitAction()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e){const e=r.Fc(5);r.uc("modalRef",t.activeModal),r.Db(4),r.uc("formGroup",t.osdRecvSpeedForm),r.Db(8),r.uc("ngForOf",t.priorities),r.Db(1),r.uc("ngIf",t.osdRecvSpeedForm.showError("priority",e,"required")),r.Db(7),r.uc("ngForOf",r.pc(21,8,t.priorityAttrs)),r.Db(3),r.uc("form",t.osdRecvSpeedForm)("submitText",t.actionLabels.UPDATE)("showSubmit",t.permissions.configOpt.update)}},directives:[ur.a,xn.B,xn.r,yu.a,Qn.a,xn.k,Zn.a,On.a,xn.z,ei.a,xn.q,xn.i,s.q,s.r,xn.b,ti.a,xn.u,xn.C,s.p,xn.v,xn.d,dr.a],pipes:[s.k],styles:[""]}),e})();function Zu(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,15),r.Wb())}function ed(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,16),r.Wb())}function td(e,t){if(1&e&&(r.Xb(0,"span",13),r.Pc(1,Zu,2,0,"span",14),r.Pc(2,ed,2,0,"span",14),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngIf",null==e.weight.errors?null:e.weight.errors.required),r.Db(1),r.uc("ngIf",(null==e.weight.errors?null:e.weight.errors.max)||(null==e.weight.errors?null:e.weight.errors.min))}}let nd=(()=>{class e{constructor(e,t,n,i){this.actionLabels=e,this.activeModal=t,this.osdService=n,this.fb=i,this.currentWeight=1}get weight(){return this.reweightForm.get("weight")}ngOnInit(){this.reweightForm=this.fb.group({weight:this.fb.control(this.currentWeight,[xn.A.required,xn.A.max(1),xn.A.min(0)])})}reweight(){this.osdService.reweight(this.osdId,this.reweightForm.value.weight).subscribe(()=>this.activeModal.close())}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(Jt.a),r.Rb(Vi),r.Rb(wo.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-reweight-modal"]],decls:14,vars:7,consts:function(){let e,t,n;return e="Reweight OSD: " + "\ufffd0\ufffd" + "",t="This field is required.",n="The value needs to be between 0 and 1.",[[3,"modalRef"],[1,"modal-title"],e,[1,"modal-content"],[3,"formGroup"],[1,"modal-body"],[1,"row"],["for","weight",1,"cd-col-form-label"],[1,"cd-col-form-input"],["id","weight","type","number","step","0.1","formControlName","weight","min","0","max","1",1,"form-control",3,"value"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],[4,"ngIf"],t,n]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Vb(1,1),r.bc(2,2),r.Ub(),r.Vb(3,3),r.Xb(4,"form",4),r.Xb(5,"div",5),r.Xb(6,"div",6),r.Xb(7,"label",7),r.Rc(8,"Weight"),r.Wb(),r.Xb(9,"div",8),r.Sb(10,"input",9),r.Pc(11,td,3,2,"span",10),r.Wb(),r.Wb(),r.Wb(),r.Xb(12,"div",11),r.Xb(13,"cd-form-button-panel",12),r.lc("submitActionEvent",function(){return t.reweight()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(2),r.fc(t.osdId),r.cc(2),r.Db(2),r.uc("formGroup",t.reweightForm),r.Db(6),r.uc("value",t.currentWeight),r.Db(1),r.uc("ngIf",t.weight.errors),r.Db(2),r.uc("form",t.reweightForm)("submitText",t.actionLabels.REWEIGHT))},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,On.a,xn.v,xn.d,ei.a,xn.q,xn.i,s.r,ti.a],styles:[""]}),e})();var id=n("FFMq");let rd=(()=>{class e{constructor(e,t,n,i,r){this.activeModal=e,this.actionLabels=t,this.osdService=n,this.notificationService=i,this.joinPipe=r,this.selected=[]}ngOnInit(){this.scrubForm=new xn.j({})}scrub(){Object(Oi.a)(this.selected.map(e=>this.osdService.scrub(e,this.deep))).subscribe(()=>{this.notificationService.show(vn.a.success,"" + (this.deep ? "Deep scrub" : "Scrub") + " was initialized in the following OSD(s): " + this.joinPipe.transform(this.selected) + ""),this.activeModal.close()},()=>this.activeModal.close())}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(gn.b),r.Rb(Vi),r.Rb(wn.a),r.Rb(id.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-scrub-modal"]],decls:13,vars:9,consts:function(){let e,t,n,i;return e="{VAR_SELECT, select, true {Deep } other {}}",e=r.gc(e,{VAR_SELECT:"\ufffd0\ufffd"}),t="OSDs " + e + "Scrub",n="{VAR_SELECT, select, true {deep } other {}}",n=r.gc(n,{VAR_SELECT:"\ufffd0\ufffd"}),i="You are about to apply a " + n + "scrub to the OSD(s): " + "\ufffd#9\ufffd" + "" + "\ufffd1\ufffd" + "" + "\ufffd/#9\ufffd" + ".",[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["name","scrubForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],i,[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(e,t){1&e&&(r.Xb(0,"cd-modal",0),r.Xb(1,"span",1),r.bc(2,2),r.Wb(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Xb(7,"p"),r.hc(8,7),r.Sb(9,"strong"),r.oc(10,"join"),r.ec(),r.Wb(),r.Wb(),r.Xb(11,"div",8),r.Xb(12,"cd-form-button-panel",9),r.lc("submitActionEvent",function(){return t.scrub()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e&&(r.uc("modalRef",t.activeModal),r.Db(2),r.fc(t.deep),r.cc(2),r.Db(2),r.uc("formGroup",t.scrubForm),r.Db(6),r.fc(t.deep)(r.pc(10,7,t.selected)),r.cc(8),r.Db(2),r.uc("form",t.scrubForm)("submitText",t.actionLabels.UPDATE))},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,ti.a],pipes:[id.a],styles:[""]}),e})();var sd=n("b5OY");function od(e,t){if(1&e&&r.Sb(0,"cd-device-list",17),2&e){const e=r.nc(2);r.uc("osdId",null==e.osd?null:e.osd.id)}}function ad(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",18),2&e){const e=r.nc(2);r.uc("data",null==e.osd||null==e.osd.details?null:e.osd.details.osd_map)}}function cd(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table-key-value",21),r.lc("fetchData",function(){return r.Ic(e),r.nc(3).refresh()}),r.Wb()}if(2&e){const e=r.nc(3);r.uc("data",null==e.osd||null==e.osd.details?null:e.osd.details.osd_metadata)}}function ld(e,t){1&e&&(r.Xb(0,"cd-alert-panel",22),r.bc(1,23),r.Wb())}function ud(e,t){if(1&e&&(r.Pc(0,cd,1,1,"cd-table-key-value",19),r.Pc(1,ld,2,0,"ng-template",null,20,r.Qc)),2&e){const e=r.Fc(2),t=r.nc(2);r.uc("ngIf",null==t.osd||null==t.osd.details?null:t.osd.details.osd_metadata)("ngIfElse",e)}}function dd(e,t){if(1&e&&r.Sb(0,"cd-smart-list",17),2&e){const e=r.nc(2);r.uc("osdId",null==e.osd?null:e.osd.id)}}function hd(e,t){if(1&e&&r.Sb(0,"cd-table-performance-counter",25),2&e){const e=r.nc(3);r.uc("serviceId",null==e.osd?null:e.osd.id)}}function fd(e,t){if(1&e&&r.Pc(0,hd,1,1,"cd-table-performance-counter",24),2&e){const e=r.nc(2);r.uc("ngIf",null==e.osd?null:e.osd.details)}}function pd(e,t){if(1&e&&r.Sb(0,"cd-grafana",28),2&e){const e=r.nc(3);r.uc("grafanaPath","osd-device-details?var-osd=osd."+e.osd.id)}}function md(e,t){1&e&&(r.Xb(0,"li",26),r.Xb(1,"a",4),r.bc(2,27),r.Wb(),r.Pc(3,pd,1,1,"ng-template",6),r.Wb())}function bd(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",1,2),r.Xb(3,"li",3),r.Xb(4,"a",4),r.bc(5,5),r.Wb(),r.Pc(6,od,1,1,"ng-template",6),r.Wb(),r.Xb(7,"li",7),r.Xb(8,"a",4),r.bc(9,8),r.Wb(),r.Pc(10,ad,1,1,"ng-template",6),r.Wb(),r.Xb(11,"li",9),r.Xb(12,"a",4),r.bc(13,10),r.Wb(),r.Pc(14,ud,3,2,"ng-template",6),r.Wb(),r.Xb(15,"li",11),r.Xb(16,"a",4),r.bc(17,12),r.Wb(),r.Pc(18,dd,1,1,"ng-template",6),r.Wb(),r.Xb(19,"li",13),r.Xb(20,"a",4),r.bc(21,14),r.Wb(),r.Pc(22,fd,1,1,"ng-template",6),r.Wb(),r.Pc(23,md,4,0,"li",15),r.Wb(),r.Sb(24,"div",16),r.Ub()),2&e){const e=r.Fc(2),t=r.nc();r.Db(23),r.uc("ngIf",t.grafanaPermission.read),r.Db(1),r.uc("ngbNavOutlet",e)}}let gd=(()=>{class e{constructor(e,t){this.osdService=e,this.authStorageService=t,this.grafanaPermission=this.authStorageService.getPermissions().grafana}ngOnChanges(){var e,t,n;(null===(e=this.osd)||void 0===e?void 0:e.id)!==(null===(t=this.selection)||void 0===t?void 0:t.id)&&(this.osd=this.selection),Wt.a.isNumber(null===(n=this.osd)||void 0===n?void 0:n.id)&&this.refresh()}refresh(){this.osdService.getDetails(this.osd.id).subscribe(e=>{this.osd.details=e})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Vi),r.Rb(Gt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-details"]],inputs:{selection:"selection"},features:[r.Bb],decls:1,vars:1,consts:function(){let e,t,n,i,r,s,o;return e="Devices",t="Attributes (OSD map)",n="Metadata",i="Device health",r="Performance counter",s="Metadata not available",o="Performance Details",[[4,"ngIf"],["ngbNav","","id","tabset-osd-details","cdStatefulTab","osd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","devices"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","attributes"],t,["ngbNavItem","metadata"],n,["ngbNavItem","device-health"],i,["ngbNavItem","performance-counter"],r,["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"osdId"],[3,"data"],[3,"data","fetchData",4,"ngIf","ngIfElse"],["noMetaData",""],[3,"data","fetchData"],["type","warning"],s,["serviceType","osd",3,"serviceId",4,"ngIf"],["serviceType","osd",3,"serviceId"],["ngbNavItem","performance-details"],o,["uid","CrAHE0iZz","grafanaStyle","three",3,"grafanaPath"]]},template:function(e,t){1&e&&r.Pc(0,bd,25,2,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,Rr,en.a,wr.a,Ns,sd.a,jn.a],styles:[""]}),e})();const _d=["osdUsageTpl"],vd=["markOsdConfirmationTpl"],yd=["criticalConfirmationTpl"],wd=["reweightBodyTpl"],Dd=["safeToDestroyBodyTpl"],Sd=["deleteOsdExtraTpl"],xd=["flagsTpl"],kd=function(){return{read:!0}};function Td(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",13),r.lc("fetchData",function(){return r.Ic(e),r.nc().getOsdList()})("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Xb(1,"div",14),r.Sb(2,"cd-table-actions",15),r.Sb(3,"cd-table-actions",16),r.Wb(),r.Sb(4,"cd-osd-details",17),r.Wb()}if(2&e){const e=r.nc();r.uc("data",e.osds)("columns",e.columns)("hasDetails",!0)("updateSelectionOnRefresh","never"),r.Db(2),r.uc("permission",e.permissions.osd)("selection",e.selection)("tableActions",e.tableActions),r.Db(1),r.uc("permission",r.yc(11,kd))("selection",e.selection)("tableActions",e.clusterWideActions),r.Db(1),r.uc("selection",e.expandedRow)}}function Md(e,t){1&e&&r.Sb(0,"cd-grafana",19),2&e&&r.uc("grafanaPath","osd-overview?")}function Cd(e,t){1&e&&(r.Xb(0,"li",2),r.Xb(1,"a",3),r.bc(2,18),r.Wb(),r.Pc(3,Md,1,1,"ng-template",5),r.Wb())}function Od(e,t){if(1&e&&(r.Vb(0),r.hc(1,20),r.Sb(2,"strong"),r.oc(3,"join"),r.Sb(4,"strong"),r.ec(),r.Ub()),2&e){const e=t.markActionDescription,n=t.osdIds;r.Db(4),r.fc(r.pc(3,2,n))(e),r.cc(1)}}function Ld(e,t){if(1&e&&(r.Xb(0,"div",23),r.Xb(1,"cd-alert-panel",24),r.bc(2,25),r.Wb(),r.Wb()),2&e){const e=r.nc(),t=e.actionDescription,n=e.message,i=r.nc();r.Db(2),r.fc(i.selection.hasSingleSelection)(t)(n),r.cc(2)}}function Ed(e,t){if(1&e&&(r.Pc(0,Ld,3,3,"div",21),r.Vb(1),r.hc(2,22),r.Sb(3,"strong"),r.oc(4,"join"),r.Sb(5,"strong"),r.ec(),r.Ub()),2&e){const e=t.actionDescription,n=t.osdIds;r.uc("ngIf",!t.safeToPerform),r.Db(5),r.fc(r.pc(4,3,n))(e),r.cc(2)}}function Ad(e,t){if(1&e&&(r.Xb(0,"span",28),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.Sc(e)}}function Id(e,t){if(1&e&&(r.Xb(0,"span",29),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.Sc(e)}}function Rd(e,t){if(1&e&&(r.Pc(0,Ad,2,1,"span",26),r.Pc(1,Id,2,1,"span",27)),2&e){const e=t.row;r.uc("ngForOf",e.cdClusterFlags),r.Db(1),r.uc("ngForOf",e.cdIndivFlags)}}function Pd(e,t){if(1&e&&r.Sb(0,"cd-usage-bar",30),2&e){const e=t.row;r.uc("total",e.stats.stat_bytes)("used",e.stats.stat_bytes_used)}}function Fd(e,t){1&e&&(r.Vb(0,31),r.Vb(1,32),r.Xb(2,"div",33),r.Xb(3,"div",34),r.Sb(4,"input",35),r.Xb(5,"label",36),r.bc(6,37),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Ub()),2&e&&r.uc("formGroup",t.form)}let Wd=(()=>{class e extends zt.a{constructor(e,t,n,i,r,s,o,a,c,l){super(),this.authStorageService=e,this.osdService=t,this.dimlessBinaryPipe=n,this.modalService=i,this.urlBuilder=r,this.router=s,this.taskWrapper=o,this.actionLabels=a,this.notificationService=c,this.orchService=l,this.icons=_n.a,this.selection=new Ht.a,this.osds=[],this.disabledFlags=["sortbitwise","purged_snapdirs","recovery_deletes","pglog_hardlimit"],this.indivFlagNames=["noup","nodown","noin","noout"],this.actionOrchFeatures={create:[or.OSD_CREATE],delete:[or.OSD_DELETE]},this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{name:this.actionLabels.CREATE,permission:"create",icon:_n.a.add,click:()=>this.router.navigate([this.urlBuilder.getCreate()]),disable:e=>this.getDisable("create",e),canBePrimary:e=>!e.hasSelection},{name:this.actionLabels.EDIT,permission:"update",icon:_n.a.edit,click:()=>this.editAction()},{name:this.actionLabels.FLAGS,permission:"update",icon:_n.a.flag,click:()=>this.configureFlagsIndivAction(),disable:()=>!this.hasOsdSelected},{name:this.actionLabels.SCRUB,permission:"update",icon:_n.a.analyse,click:()=>this.scrubAction(!1),disable:()=>!this.hasOsdSelected,canBePrimary:e=>e.hasSelection},{name:this.actionLabels.DEEP_SCRUB,permission:"update",icon:_n.a.deepCheck,click:()=>this.scrubAction(!0),disable:()=>!this.hasOsdSelected},{name:this.actionLabels.REWEIGHT,permission:"update",click:()=>this.reweight(),disable:()=>!this.hasOsdSelected||!this.selection.hasSingleSelection,icon:_n.a.reweight},{name:this.actionLabels.MARK_OUT,permission:"update",click:()=>this.showConfirmationModal("out",this.osdService.markOut),disable:()=>this.isNotSelectedOrInState("out"),icon:_n.a.left},{name:this.actionLabels.MARK_IN,permission:"update",click:()=>this.showConfirmationModal("in",this.osdService.markIn),disable:()=>this.isNotSelectedOrInState("in"),icon:_n.a.right},{name:this.actionLabels.MARK_DOWN,permission:"update",click:()=>this.showConfirmationModal("down",this.osdService.markDown),disable:()=>this.isNotSelectedOrInState("down"),icon:_n.a.down},{name:this.actionLabels.MARK_LOST,permission:"delete",click:()=>this.showCriticalConfirmationModal("Mark","OSD lost","marked lost",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",this.osdService.markLost),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.flatten},{name:this.actionLabels.PURGE,permission:"delete",click:()=>this.showCriticalConfirmationModal("Purge","OSD","purged",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",e=>(this.selection=new Ht.a,this.osdService.purge(e))),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.erase},{name:this.actionLabels.DESTROY,permission:"delete",click:()=>this.showCriticalConfirmationModal("destroy","OSD","destroyed",e=>this.osdService.safeToDestroy(JSON.stringify(e)),"is_safe_to_destroy",e=>(this.selection=new Ht.a,this.osdService.destroy(e))),disable:()=>this.isNotSelectedOrInState("up"),icon:_n.a.destroyCircle},{name:this.actionLabels.DELETE,permission:"delete",click:()=>this.delete(),disable:e=>this.getDisable("delete",e),icon:_n.a.destroy}]}static collectStates(e){const t=[e.in?"in":"out"];return e.up?t.push("up"):e.state.includes("destroyed")?t.push("destroyed"):t.push("down"),t}ngOnInit(){this.clusterWideActions=[{name:"Flags",icon:_n.a.flag,click:()=>this.configureFlagsAction(),permission:"read",visible:()=>this.permissions.osd.read},{name:"Recovery Priority",icon:_n.a.deepCheck,click:()=>this.configureQosParamsAction(),permission:"read",visible:()=>this.permissions.configOpt.read},{name:"PG scrub",icon:_n.a.analyse,click:()=>this.configurePgScrubAction(),permission:"read",visible:()=>this.permissions.configOpt.read}],this.columns=[{prop:"id",name:"ID",flexGrow:1,cellTransformation:$t.a.executing,customTemplateConfig:{valueClass:"bold"}},{prop:"host.name",name:"Host"},{prop:"collectedStates",name:"Status",flexGrow:1,cellTransformation:$t.a.badge,customTemplateConfig:{map:{in:{class:"badge-success"},up:{class:"badge-success"},down:{class:"badge-danger"},out:{class:"badge-danger"},destroyed:{class:"badge-danger"}}}},{prop:"tree.device_class",name:"Device class",flexGrow:1.2,cellTransformation:$t.a.badge,customTemplateConfig:{map:{hdd:{class:"badge-hdd"},ssd:{class:"badge-ssd"}}}},{prop:"stats.numpg",name:"PGs",flexGrow:1},{prop:"stats.stat_bytes",name:"Size",flexGrow:1,pipe:this.dimlessBinaryPipe},{prop:"state",name:"Flags",cellTemplate:this.flagsTpl},{prop:"stats.usage",name:"Usage",cellTemplate:this.osdUsageTpl},{prop:"stats_history.out_bytes",name:"Read bytes",cellTransformation:$t.a.sparkline},{prop:"stats_history.in_bytes",name:"Write bytes",cellTransformation:$t.a.sparkline},{prop:"stats.op_r",name:"Read ops",cellTransformation:$t.a.perSecond},{prop:"stats.op_w",name:"Write ops",cellTransformation:$t.a.perSecond}],this.orchService.status().subscribe(e=>this.orchStatus=e)}getDisable(e,t){if("delete"===e){if(!t.hasSelection)return!0;if(Wt.a.some(this.getSelectedOsds(),e=>{const t=Wt.a.get(e,"operational_status");return"deleting"===t||"unmanaged"===t}))return!0}return this.orchService.getTableActionDisableDesc(this.orchStatus,this.actionOrchFeatures[e])}getSelectedOsdIds(){const e=this.osds.map(e=>e.id);return this.selection.selected.map(e=>e.id).filter(t=>e.includes(t)).sort()}getSelectedOsds(){return this.osds.filter(e=>!Wt.a.isUndefined(e)&&this.getSelectedOsdIds().includes(e.id))}get hasOsdSelected(){return this.getSelectedOsdIds().length>0}updateSelection(e){this.selection=e}isNotSelectedOrInState(e){const t=this.getSelectedOsds();if(0===t.length)return!0;switch(e){case"in":return t.some(e=>1===e.in);case"out":return t.some(e=>1!==e.in);case"down":return t.some(e=>1!==e.up);case"up":return t.some(e=>1===e.up)}}getOsdList(){const t=[this.osdService.getList(),this.osdService.getFlags()];Object(Oi.a)(t).subscribe(t=>{this.osds=t[0].map(n=>{n.collectedStates=e.collectStates(n),n.stats_history.out_bytes=n.stats_history.op_out_bytes.map(e=>e[1]),n.stats_history.in_bytes=n.stats_history.op_in_bytes.map(e=>e[1]),n.stats.usage=n.stats.stat_bytes_used/n.stats.stat_bytes,n.cdIsBinary=!0,n.cdIndivFlags=n.state.filter(e=>this.indivFlagNames.includes(e)),n.cdClusterFlags=t[1].filter(e=>!this.disabledFlags.includes(e));const i=Wt.a.get(n,"operational_status","unmanaged");return"unmanaged"!==i&&"working"!==i&&(n.cdExecuting=i),n})})}editAction(){const e=Wt.a.filter(this.osds,["id",this.selection.first().id]).pop();this.modalService.show(Mn.a,{titleText:"Edit OSD: " + e.id + "",fields:[{type:"text",name:"deviceClass",value:e.tree.device_class,label:"Device class",required:!0}],submitButtonText:"Edit OSD",onSubmit:t=>{this.osdService.update(e.id,t.deviceClass).subscribe(()=>{this.notificationService.show(vn.a.success,"Updated OSD '" + e.id + "'"),this.getOsdList()})}})}scrubAction(e){if(!this.hasOsdSelected)return;const t={selected:this.getSelectedOsdIds(),deep:e};this.bsModalRef=this.modalService.show(rd,t)}configureFlagsAction(){this.bsModalRef=this.modalService.show(Su)}configureFlagsIndivAction(){const e={selected:this.getSelectedOsds()};this.bsModalRef=this.modalService.show(vu,e)}showConfirmationModal(e,t){const n=this.getSelectedOsdIds();this.bsModalRef=this.modalService.show(Tn.a,{titleText:"Mark OSD " + e + "",buttonText:"Mark " + e + "",bodyTpl:this.markOsdConfirmationTpl,bodyContext:{markActionDescription:e,osdIds:n},onSubmit:()=>{Object(Oi.a)(this.getSelectedOsdIds().map(e=>t.call(this.osdService,e))).subscribe(()=>this.bsModalRef.close())}})}reweight(){const e=this.osds.filter(e=>e.id===this.selection.first().id).pop();this.bsModalRef=this.modalService.show(nd,{currentWeight:e.weight,osdId:e.id})}delete(){const e=new Gn.a({preserve:new xn.h(!1)});this.showCriticalConfirmationModal("delete","OSD","deleted",e=>this.osdService.safeToDelete(JSON.stringify(e)),"is_safe_to_delete",t=>(this.selection=new Ht.a,this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("osd/"+gn.e.DELETE,{svc_id:t}),call:this.osdService.delete(t,e.value.preserve,!0)})),!0,e,this.deleteOsdExtraTpl)}showCriticalConfirmationModal(e,t,n,i,r,s,o=!1,a,c){i(this.getSelectedOsdIds()).subscribe(i=>{const l=this.modalService.show(bn.a,{actionDescription:e,itemDescription:t,bodyTemplate:this.criticalConfirmationTpl,bodyContext:{safeToPerform:i[r],message:i.message,actionDescription:n,osdIds:this.getSelectedOsdIds()},childFormGroup:a,childFormGroupTemplate:c,submitAction:()=>{const e=Object(Oi.a)(this.getSelectedOsdIds().map(e=>s.call(this.osdService,e)));o?e.subscribe({error:()=>{this.getOsdList(),l.close()},complete:()=>l.close()}):e.subscribe(()=>{this.getOsdList(),l.close()},()=>l.close())}})})}configureQosParamsAction(){this.bsModalRef=this.modalService.show(Qu)}configurePgScrubAction(){this.bsModalRef=this.modalService.show($u,void 0,{size:"lg"})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Vi),r.Rb(Qt.a),r.Rb(yn.a),r.Rb(ar.a),r.Rb(Pt.e),r.Rb(Ui.a),r.Rb(gn.b),r.Rb(wn.a),r.Rb(rr))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-osd-list"]],viewQuery:function(e,t){if(1&e&&(r.Wc(_d,3),r.Wc(vd,3),r.Wc(yd,3),r.Wc(wd,1),r.Wc(Dd,1),r.Wc(Sd,1),r.Wc(xd,3)),2&e){let e;r.Ec(e=r.mc())&&(t.osdUsageTpl=e.first),r.Ec(e=r.mc())&&(t.markOsdConfirmationTpl=e.first),r.Ec(e=r.mc())&&(t.criticalConfirmationTpl=e.first),r.Ec(e=r.mc())&&(t.reweightBodyTpl=e.first),r.Ec(e=r.mc())&&(t.safeToDestroyBodyTpl=e.first),r.Ec(e=r.mc())&&(t.deleteOsdExtraTpl=e.first),r.Ec(e=r.mc())&&(t.flagsTpl=e.first)}},features:[r.Cb([{provide:ar.a,useValue:new ar.a("osd")}]),r.Ab],decls:18,vars:2,consts:function(){let e,t,n,i,s,o,a;return e="OSDs List",t="Overall Performance",n="" + "[\ufffd#2\ufffd|\ufffd#4\ufffd]" + "OSD(s) " + "\ufffd0\ufffd" + "" + "[\ufffd/#2\ufffd|\ufffd/#4\ufffd]" + " will be marked " + "[\ufffd#2\ufffd|\ufffd#4\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#2\ufffd|\ufffd/#4\ufffd]" + " if you proceed.",n=r.gc(n),i="" + "[\ufffd#3\ufffd|\ufffd#5\ufffd]" + "OSD " + "\ufffd0\ufffd" + "" + "[\ufffd/#3\ufffd|\ufffd/#5\ufffd]" + " will be " + "[\ufffd#3\ufffd|\ufffd#5\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#3\ufffd|\ufffd/#5\ufffd]" + " if you proceed.",i=r.gc(i),s="{VAR_SELECT, select, true {OSD is} other {OSDs are}}",s=r.gc(s,{VAR_SELECT:"\ufffd0\ufffd"}),o="The " + s + " not safe to be " + "\ufffd1\ufffd" + "! " + "\ufffd2\ufffd" + "",a="Preserve OSD ID(s) for replacement.",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["markOsdConfirmationTpl",""],["criticalConfirmationTpl",""],["flagsTpl",""],["osdUsageTpl",""],["deleteOsdExtraTpl",""],["selectionType","multiClick",3,"data","columns","hasDetails","updateSelectionOnRefresh","fetchData","setExpandedRow","updateSelection"],[1,"table-actions","btn-toolbar"],["id","osd-actions",1,"btn-group",3,"permission","selection","tableActions"],["dropDownOnly","Cluster-wide configuration","btnColor","light","id","cluster-wide-actions",1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],t,["uid","lo02I1Aiz","grafanaStyle","four",3,"grafanaPath"],n,["class","danger",4,"ngIf"],i,[1,"danger"],["type","warning"],o,["class","badge badge-hdd mr-1",4,"ngFor","ngForOf"],["class","badge badge-info mr-1",4,"ngFor","ngForOf"],[1,"badge","badge-hdd","mr-1"],[1,"badge","badge-info","mr-1"],[3,"total","used"],[3,"formGroup"],["formGroupName","child"],[1,"form-group"],[1,"custom-control","custom-checkbox"],["type","checkbox","name","preserve","id","preserve","formControlName","preserve",1,"custom-control-input"],["for","preserve",1,"custom-control-label"],a]},template:function(e,t){if(1&e&&(r.Xb(0,"ul",0,1),r.Xb(2,"li",2),r.Xb(3,"a",3),r.bc(4,4),r.Wb(),r.Pc(5,Td,5,12,"ng-template",5),r.Wb(),r.Pc(6,Cd,4,0,"li",6),r.Wb(),r.Sb(7,"div",7),r.Pc(8,Od,5,4,"ng-template",null,8,r.Qc),r.Pc(10,Ed,6,5,"ng-template",null,9,r.Qc),r.Pc(12,Rd,2,2,"ng-template",null,10,r.Qc),r.Pc(14,Pd,1,2,"ng-template",null,11,r.Qc),r.Pc(16,Fd,7,1,"ng-template",null,12,r.Qc)),2&e){const e=r.Fc(1);r.Db(6),r.uc("ngIf",t.permissions.grafana.read),r.Db(1),r.uc("ngbNavOutlet",e)}},directives:[Jt.p,Jt.r,Jt.s,Jt.q,s.r,Jt.u,Vt.a,Dn.a,gd,jn.a,wr.a,s.q,ln.a,Qn.a,xn.r,xn.k,xn.l,Zn.a,On.a,xn.b,ei.a,xn.q,xn.i],pipes:[id.a],styles:[""]}),e})();var jd=n("20UP");let Yd=(()=>{class e{constructor(e,t){this.http=e,this.settingsService=t,this.baseURL="api/prometheus",this.settingsKey={alertmanager:"api/settings/alertmanager-api-host",prometheus:"api/settings/prometheus-api-host"}}ifAlertmanagerConfigured(e,t){this.settingsService.ifSettingConfigured(this.settingsKey.alertmanager,e,t)}disableAlertmanagerConfig(){this.settingsService.disableSetting(this.settingsKey.alertmanager)}ifPrometheusConfigured(e,t){this.settingsService.ifSettingConfigured(this.settingsKey.prometheus,e,t)}disablePrometheusConfig(){this.settingsService.disableSetting(this.settingsKey.prometheus)}getAlerts(e={}){return this.http.get(this.baseURL,{params:e})}getSilences(e={}){return this.http.get(`${this.baseURL}/silences`,{params:e})}getRules(e="all"){return this.http.get(`${this.baseURL}/rules`).pipe(Object(Ii.a)(t=>(["alerting","rewrites"].includes(e)&&t.groups.map(t=>{t.rules=t.rules.filter(t=>t.type===e)}),t)))}setSilence(e){return this.http.post(`${this.baseURL}/silence`,e,{observe:"response"})}expireSilence(e){return this.http.delete(`${this.baseURL}/silence/${e}`,{observe:"response"})}getNotifications(e){return this.http.get(`${this.baseURL}/notifications?from=${e&&e.id?e.id:"last"}`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b),r.ic(jd.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Nd=n("G1I9");let zd=(()=>{class e{constructor(e){this.notificationService=e}sendNotifications(e){e.forEach(e=>this.notificationService.show(e))}convertToCustomAlerts(e){return Wt.a.uniqWith(e.map(e=>({status:Wt.a.isObject(e.status)?e.status.state:this.getPrometheusNotificationStatus(e),name:e.labels.alertname,url:e.generatorURL,description:e.annotations.description,fingerprint:Wt.a.isObject(e.status)&&e.fingerprint})),Wt.a.isEqual)}getPrometheusNotificationStatus(e){const t=e.status;return"firing"===t?"active":t}convertAlertToNotification(e){return new Nd.b(this.formatType(e.status),`${e.name} (${e.status})`,this.appendSourceLink(e,e.description),void 0,"Prometheus")}formatType(e){return vn.a[Wt.a.findKey({error:["firing","active"],info:["suppressed","unprocessed"],success:["resolved"]},t=>t.includes(e))]}appendSourceLink(e,t){return`${t} <a href="${e.url}" target="_blank"><i class="${_n.a.lineChart}"></i></a>`}}return e.\u0275fac=function(t){return new(t||e)(r.ic(wn.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),$d=(()=>{class e{constructor(e,t){this.alertFormatter=e,this.prometheusService=t,this.canAlertsBeNotified=!1,this.alerts=[],this.rules=[]}getAlerts(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.prometheusService.getAlerts().subscribe(e=>this.handleAlerts(e),e=>{[404,504].includes(e.status)&&this.prometheusService.disableAlertmanagerConfig()})})}getRules(){this.prometheusService.ifPrometheusConfigured(()=>{this.prometheusService.getRules("alerting").subscribe(e=>{this.rules=e.groups.reduce((e,t)=>e.concat(t.rules.map(e=>(e.group=t.name,e))),[])})})}refresh(){this.getAlerts(),this.getRules()}handleAlerts(e){this.canAlertsBeNotified&&this.notifyOnAlertChanges(e,this.alerts),this.activeAlerts=Wt.a.reduce(this.alerts,(e,t)=>"active"===t.status.state?++e:e,0),this.alerts=e,this.canAlertsBeNotified=!0}notifyOnAlertChanges(e,t){const n=this.getChangedAlerts(this.alertFormatter.convertToCustomAlerts(e),this.alertFormatter.convertToCustomAlerts(t)),i=Wt.a.filter(n,e=>"suppressed"!==e.status).map(e=>this.alertFormatter.convertAlertToNotification(e));this.alertFormatter.sendNotifications(i)}getChangedAlerts(e,t){return Wt.a.differenceWith(e,t,Wt.a.isEqual).concat(this.getVanishedAlerts(e,t))}getVanishedAlerts(e,t){return Wt.a.differenceWith(t,e,(e,t)=>e.fingerprint===t.fingerprint).map(e=>(e.status="resolved",e))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(zd),r.ic(Yd))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Hd=(()=>{class e extends zt.a{constructor(e){super(),this.prometheusService=e,this.isPrometheusConfigured=!1,this.isAlertmanagerConfigured=!1}ngOnInit(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.isAlertmanagerConfigured=!0}),this.prometheusService.ifPrometheusConfigured(()=>{this.isPrometheusConfigured=!0})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Yd))},e.\u0275dir=r.Mb({type:e,features:[r.Ab]}),e})(),Xd=(()=>{class e{constructor(e){this.router=e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-prometheus-tabs"]],decls:11,vars:1,consts:function(){let e,t,n;return e="Active Alerts",t="Alerts",n="Silences",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/monitoring/active-alerts"],["ngbNavLink",""],e,["ngbNavItem","/monitoring/alerts"],t,["ngbNavItem","/monitoring/silences"],n]},template:function(e,t){1&e&&(r.Xb(0,"ul",0,1),r.lc("navChange",function(e){return t.router.navigate([e.nextId])}),r.Xb(2,"li",2),r.Xb(3,"a",3),r.bc(4,4),r.Wb(),r.Wb(),r.Xb(5,"li",5),r.Xb(6,"a",3),r.bc(7,6),r.Wb(),r.Wb(),r.Xb(8,"li",7),r.Xb(9,"a",3),r.bc(10,8),r.Wb(),r.Wb(),r.Wb()),2&e&&r.uc("activeId",t.router.url)},directives:[Jt.p,Jt.r,Jt.s],styles:[""]}),e})();const Vd=["externalLinkTpl"];function Bd(e,t){1&e&&(r.Xb(0,"cd-alert-panel",3),r.hc(1,4),r.Sb(2,"cd-doc",5),r.ec(),r.Wb())}function Ud(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",9),2&e){const e=r.nc(2);r.uc("renderObjects",!0)("hideEmpty",!0)("appendParentKey",!1)("data",e.expandedRow)("customCss",e.customCss)("autoReload",!1)}}function qd(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",6),r.lc("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Sb(1,"cd-table-actions",7),r.Pc(2,Ud,1,6,"cd-table-key-value",8),r.Wb()}if(2&e){const e=r.nc();r.uc("data",e.prometheusAlertService.alerts)("columns",e.columns)("forceIdentifier",!0)("customCss",e.customCss)("hasDetails",!0),r.Db(1),r.uc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),r.Db(1),r.uc("ngIf",e.expandedRow)}}const Gd=function(e){return[e]};function Jd(e,t){if(1&e&&(r.Xb(0,"a",10),r.Sb(1,"i",11),r.Rc(2," Source"),r.Wb()),2&e){const e=t.value,n=r.nc();r.uc("href",e,r.Lc),r.Db(1),r.uc("ngClass",r.zc(2,Gd,n.icons.lineChart))}}let Kd=(()=>{class e extends Hd{constructor(e,t,n,i,r){super(r),this.authStorageService=e,this.prometheusAlertService=t,this.urlBuilder=n,this.cdDatePipe=i,this.selection=new Ht.a,this.icons=_n.a,this.customCss={"badge badge-danger":"active","badge badge-warning":"unprocessed","badge badge-info":"suppressed"},this.permission=this.authStorageService.getPermissions().prometheus,this.tableActions=[{permission:"create",canBePrimary:e=>e.hasSingleSelection,disable:e=>!e.hasSingleSelection||e.first().cdExecuting,icon:_n.a.add,routerLink:()=>"/monitoring"+this.urlBuilder.getCreateFrom(this.selection.first().fingerprint),name:"Create Silence"}]}ngOnInit(){super.ngOnInit(),this.columns=[{name:"Name",prop:"labels.alertname",flexGrow:2},{name:"Job",prop:"labels.job",flexGrow:2},{name:"Severity",prop:"labels.severity"},{name:"State",prop:"status.state",cellTransformation:$t.a.classAdding},{name:"Started",prop:"startsAt",pipe:this.cdDatePipe},{name:"URL",prop:"generatorURL",sortable:!1,cellTemplate:this.externalLinkTpl}]}updateSelection(e){this.selection=e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb($d),r.Rb(ar.a),r.Rb(Xt.a),r.Rb(Yd))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-active-alert-list"]],viewQuery:function(e,t){if(1&e&&r.Wc(Vd,3),2&e){let e;r.Ec(e=r.mc())&&(t.externalLinkTpl=e.first)}},features:[r.Cb([{provide:ar.a,useValue:new ar.a("silences")}]),r.Ab],decls:5,vars:2,consts:function(){let e;return e="To see all active Prometheus alerts, please provide the URL to the API of Prometheus' Alertmanager as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",[["type","info",4,"ngIf"],["identifier","fingerprint","selectionType","single",3,"data","columns","forceIdentifier","customCss","hasDetails","setExpandedRow","updateSelection",4,"ngIf"],["externalLinkTpl",""],["type","info"],e,["section","prometheus"],["identifier","fingerprint","selectionType","single",3,"data","columns","forceIdentifier","customCss","hasDetails","setExpandedRow","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload",4,"ngIf"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload"],["target","_blank",3,"href"],[3,"ngClass"]]},template:function(e,t){1&e&&(r.Sb(0,"cd-prometheus-tabs"),r.Pc(1,Bd,3,0,"cd-alert-panel",0),r.Pc(2,qd,3,9,"cd-table",1),r.Pc(3,Jd,3,4,"ng-template",null,2,r.Qc)),2&e&&(r.Db(1),r.uc("ngIf",!t.isAlertmanagerConfigured),r.Db(1),r.uc("ngIf",t.isAlertmanagerConfigured))},directives:[Xd,s.r,wr.a,Pr.a,Vt.a,Dn.a,en.a,s.p],styles:[""]}),e})(),Qd=(()=>{class e{transform(e){const t=[[`${Math.floor(e/31536e3)}`,"years"],[`${Math.floor(e%31536e3/86400)}`,"days"],[`${Math.floor(e%86400/3600)}`,"hours"],[`${Math.floor(e%3600/60)}`,"minutes"],[`${Math.floor(e%60)}`,"seconds"]];let n="";for(let i=0,r=t.length;i<r;i++)"0"!==t[i][0]&&(n+=" "+t[i][0]+" "+("1"===t[i][0]?t[i][1].substr(0,t[i][1].length-1):t[i][1]));return n.trim()||"1 second"}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"duration",type:e,pure:!1}),e})();function Zd(e,t){1&e&&(r.Xb(0,"cd-alert-panel",2),r.hc(1,3),r.Sb(2,"cd-doc",4),r.ec(),r.Wb())}function eh(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",7),2&e){const e=r.nc(2);r.uc("data",e.expandedRow)("renderObjects",!0)("hideKeys",e.hideKeys)}}function th(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",5),r.lc("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Pc(1,eh,1,3,"cd-table-key-value",6),r.Wb()}if(2&e){const e=r.nc();r.uc("data",e.prometheusAlertService.rules)("columns",e.columns)("selectionType","single")("hasDetails",!0),r.Db(1),r.uc("ngIf",e.expandedRow)}}let nh=(()=>{class e extends Hd{constructor(e,t){super(t),this.prometheusAlertService=e,this.hideKeys=["alerts","type"]}ngOnInit(){super.ngOnInit(),this.columns=[{prop:"name",name:"Name"},{prop:"labels.severity",name:"Severity"},{prop:"group",name:"Group"},{prop:"duration",name:"Duration",pipe:new Qd},{prop:"query",name:"Query",isHidden:!0},{prop:"annotations.description",name:"Description"}]}}return e.\u0275fac=function(t){return new(t||e)(r.Rb($d),r.Rb(Yd))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-rules-list"]],features:[r.Ab],decls:3,vars:2,consts:function(){let e;return e="To see all configured Prometheus alerts, please provide the URL to the API of Prometheus as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",[["type","info",4,"ngIf"],[3,"data","columns","selectionType","hasDetails","setExpandedRow","updateSelection",4,"ngIf"],["type","info"],e,["section","prometheus"],[3,"data","columns","selectionType","hasDetails","setExpandedRow","updateSelection"],["cdTableDetail","",3,"data","renderObjects","hideKeys",4,"ngIf"],["cdTableDetail","",3,"data","renderObjects","hideKeys"]]},template:function(e,t){1&e&&(r.Sb(0,"cd-prometheus-tabs"),r.Pc(1,Zd,3,0,"cd-alert-panel",0),r.Pc(2,th,2,5,"cd-table",1)),2&e&&(r.Db(1),r.uc("ngIf",!t.isPrometheusConfigured),r.Db(1),r.uc("ngIf",t.isPrometheusConfigured))},directives:[Xd,s.r,wr.a,Pr.a,Vt.a,en.a],styles:[""]}),e})();var ih=n("WE5d");let rh=(()=>{class e{constructor(){this.valueAttributePath={alertname:"name",instance:"alerts.0.labels.instance",job:"alerts.0.labels.job",severity:"labels.severity"}}singleMatch(e,t){return this.multiMatch([e],t)}multiMatch(e,t){if(!e.some(e=>e.isRegex))return e.forEach(e=>{t=this.getMatchedRules(e,t)}),this.describeMatch(t)}getMatchedRules(e,t){const n=this.getAttributePath(e.name);return t.filter(t=>Wt.a.get(t,n)===e.value)}describeMatch(e){let t=0;return e.forEach(e=>t+=e.alerts.length),{status:this.getMatchText(e.length,t),cssClass:t?"has-success":"has-warning"}}getAttributePath(e){return this.valueAttributePath[e]}getMatchText(e,t){const n={noRule:"Your matcher seems to match no currently defined rule or active alert.",noAlerts:"no active alerts",alert:"1 active alert",alerts:"" + t + " active alerts",rule:"Matches 1 rule",rules:"Matches " + e + " rules"};return e?"" + (e > 1 ? n.rules : n.rule) + " with " + (t ? t > 1 ? n.alerts : n.alert : n.noAlerts) + ".":n.noRule}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),sh=(()=>{class e{calculateDuration(e,t){const n=+e,i=+t,r=this.getDuration(Math.abs(n-i));return n>i?"-"+r:r}getDuration(e){const t=new Date(e),n=t.getUTCHours(),i=t.getUTCMinutes(),r=(e,t)=>e?e+t:e;return[r(Math.floor(e/864e5),"d"),r(n,"h"),r(i,"m")].filter(e=>e).join(" ")}calculateDate(e,t,n){const i=+e;if(Wt.a.isNaN(i))return;const r=this.getDurationMs(t)*(n?-1:1);return new Date(i+r)}getDurationMs(e){return 6e4*(60*(24*this.getNumbersFromString(e,"d")+this.getNumbersFromString(e,"h"))+this.getNumbersFromString(e,"m"))}getNumbersFromString(e,t){const n=e.match(new RegExp(`[0-9 ]+${t}`,"i"));return n?parseInt(n[0],10):0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function oh(e,t){if(1&e&&(r.Xb(0,"option",27),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e),r.Db(1),r.Tc(" ",e," ")}}function ah(e,t){1&e&&(r.Xb(0,"span",28),r.bc(1,29),r.Wb())}function ch(e,t){1&e&&(r.Xb(0,"span",28),r.bc(1,30),r.Wb())}function lh(e,t){if(1&e&&(r.Xb(0,"div",31),r.Xb(1,"span"),r.Rc(2),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Gb("cd-col-form-offset ",e.matcherMatch.cssClass,""),r.Db(1),r.Gb("text-muted ",e.matcherMatch.cssClass,""),r.Db(1),r.Tc(" ",e.matcherMatch.status," ")}}let uh=(()=>{class e{constructor(e,t,n,i){this.formBuilder=e,this.silenceMatcher=t,this.activeModal=n,this.actionLabels=i,this.submitAction=new r.p,this.editMode=!1,this.nameAttributes=["alertname","instance","job","severity"],this.possibleValues=[],this.matcherMatch=void 0,this.valueClick=new na.a,this.valueFocus=new na.a,this.search=e=>Object(ia.a)(e.pipe(oa(200),Object(ua.a)()),this.valueFocus,this.valueClick.pipe(Object(da.a)(()=>!this.typeahead.isPopupOpen()))).pipe(Object(Ii.a)(e=>(""===e?this.possibleValues:this.possibleValues.filter(t=>t.toLowerCase().indexOf(e.toLowerCase())>-1)).slice(0,10))),this.createForm(),this.subscribeToChanges()}createForm(){this.form=this.formBuilder.group({name:[null,[xn.A.required]],value:[{value:"",disabled:!0},[xn.A.required]],isRegex:new xn.h(!1)})}subscribeToChanges(){this.form.get("name").valueChanges.subscribe(e=>{null!==e?(this.setPossibleValues(e),this.form.get("value").enable()):this.form.get("value").disable()}),this.form.get("value").valueChanges.subscribe(e=>{const t=this.form.value;t.value=e,this.matcherMatch=this.silenceMatcher.singleMatch(t,this.rules)})}setPossibleValues(e){this.possibleValues=Wt.a.sortedUniq(this.rules.map(t=>Wt.a.get(t,this.silenceMatcher.getAttributePath(e))).filter(e=>e))}getMode(){return this.editMode?this.actionLabels.EDIT:this.actionLabels.ADD}preFillControls(e){this.form.setValue(e)}onSubmit(){this.submitAction.emit(this.form.value),this.activeModal.close()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wo.a),r.Rb(rh),r.Rb(Jt.a),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-silence-matcher-modal"]],viewQuery:function(e,t){if(1&e&&r.Wc(Jt.G,3),2&e){let e;r.Ec(e=r.mc())&&(t.typeahead=e.first)}},outputs:{submitAction:"submitAction"},decls:31,vars:11,consts:function(){let e,t,n,i,s,o,a,c;return e="{VAR_SELECT, select, true {Edit} other {Add}}",e=r.gc(e,{VAR_SELECT:"\ufffd0\ufffd"}),t="" + e + " Matcher",n="Name",i="-- Select an attribute to match against --",s="Value",o="Use regular expression",a="This field is required!",c="This field is required!",[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],n,[1,"cd-col-form-input"],["id","name","formControlName","name","name","name",1,"form-control"],[3,"ngValue"],i,[3,"value",4,"ngFor","ngForOf"],["class","help-block",4,"ngIf"],["for","value",1,"cd-col-form-label","required"],s,["id","value","container","body","type","text","formControlName","value",1,"form-control",3,"ngbTypeahead","focus","click"],["id","match-state",3,"class",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","isRegex","name","is-regex","id","is-regex",1,"custom-control-input"],["for","is-regex",1,"custom-control-label"],o,[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"help-block"],a,c,["id","match-state"]]},template:function(e,t){if(1&e&&(r.Xb(0,"cd-modal",0),r.Xb(1,"span",1),r.bc(2,2),r.Wb(),r.Vb(3,3),r.Xb(4,"form",4,5),r.Xb(6,"div",6),r.Xb(7,"div",7),r.Xb(8,"label",8),r.bc(9,9),r.Wb(),r.Xb(10,"div",10),r.Xb(11,"select",11),r.Xb(12,"option",12),r.bc(13,13),r.Wb(),r.Pc(14,oh,2,2,"option",14),r.Wb(),r.Pc(15,ah,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(16,"div",7),r.Xb(17,"label",16),r.bc(18,17),r.Wb(),r.Xb(19,"div",10),r.Xb(20,"input",18),r.lc("focus",function(e){return t.valueFocus.next(e.target.value)})("click",function(e){return t.valueClick.next(e.target.value)}),r.Wb(),r.Pc(21,ch,2,0,"span",15),r.Wb(),r.Pc(22,lh,3,7,"div",19),r.Wb(),r.Xb(23,"div",7),r.Xb(24,"div",20),r.Xb(25,"div",21),r.Sb(26,"input",22),r.Xb(27,"label",23),r.bc(28,24),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(29,"div",25),r.Xb(30,"cd-form-button-panel",26),r.lc("submitActionEvent",function(){return t.onSubmit()}),r.Wb(),r.Wb(),r.Wb(),r.Ub(),r.Wb()),2&e){const e=r.Fc(5);r.uc("modalRef",t.activeModal),r.Db(2),r.fc(t.editMode),r.cc(2),r.Db(2),r.uc("formGroup",t.form),r.Db(8),r.uc("ngValue",null),r.Db(2),r.uc("ngForOf",t.nameAttributes),r.Db(1),r.uc("ngIf",t.form.showError("name",e,"required")),r.Db(5),r.uc("ngbTypeahead",t.search),r.Db(1),r.uc("ngIf",t.form.showError("value",e,"required")),r.Db(1),r.uc("ngIf",t.form.getValue("value")&&!t.form.getValue("isRegex")&&t.matcherMatch),r.Db(8),r.uc("form",t.form)("submitText",t.getMode())}},directives:[ur.a,xn.B,xn.r,Qn.a,xn.k,Zn.a,On.a,xn.z,ei.a,xn.q,xn.i,xn.u,xn.C,s.q,s.r,xn.d,Jt.G,xn.b,ti.a],styles:[""]}),e})();var dh=n("MAOJ");function hh(e,t){if(1&e&&(r.Vb(0),r.Sb(1,"input",53),r.Ub()),2&e){const e=r.nc().$implicit,t=r.nc(),n=t.index,i=t.matcher;r.Db(1),r.xc("id","matcher-",e.attribute,"-",n,""),r.uc("value",i[e.attribute])}}function fh(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",47),r.Xb(2,"div",54),r.Sb(3,"input",55),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc().$implicit,t=r.nc(),n=t.index,i=t.matcher;r.Db(3),r.xc("id","matcher-",e.attribute,"-",n,""),r.uc("checked",i[e.attribute])}}const ph=function(e){return[e]};function mh(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",51),r.Xb(2,"span",52),r.Sb(3,"i",38),r.Wb(),r.Wb(),r.Pc(4,hh,2,3,"ng-container",7),r.Pc(5,fh,4,3,"ng-container",7),r.Ub()),2&e){const e=t.$implicit;r.Db(2),r.uc("ngbTooltip",e.tooltip),r.Db(1),r.uc("ngClass",r.zc(4,ph,e.icon)),r.Db(1),r.uc("ngIf","isRegex"!==e.attribute),r.Db(1),r.uc("ngIf","isRegex"===e.attribute)}}function bh(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",46),r.Pc(1,mh,6,6,"ng-container",34),r.Xb(2,"span",47),r.Xb(3,"button",48),r.lc("click",function(){r.Ic(e);const n=t.index;return r.nc().showMatcherModal(n)}),r.Sb(4,"i",38),r.Wb(),r.Xb(5,"button",49),r.lc("click",function(){r.Ic(e);const n=t.index;return r.nc().deleteMatcher(n)}),r.Sb(6,"i",38),r.Wb(),r.Wb(),r.Wb(),r.Sb(7,"span",50)}if(2&e){const e=t.index,n=r.nc();r.Db(1),r.uc("ngForOf",n.matcherConfig),r.Db(2),r.wc("id","matcher-edit-",e,""),r.Db(1),r.uc("ngClass",r.zc(5,ph,n.icons.edit)),r.Db(1),r.wc("id","matcher-delete-",e,""),r.Db(1),r.uc("ngClass",r.zc(7,ph,n.icons.trash))}}function gh(e,t){1&e&&(r.Xb(0,"cd-helper"),r.bc(1,56),r.Wb())}function _h(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,58),r.Wb())}function vh(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,59),r.Wb())}function yh(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,60),r.Wb())}function wh(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,61),r.Wb())}function Dh(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,62),r.Wb())}const Sh=function(e,t){return{"text-warning":e,"text-danger":t}};function xh(e,t){if(1&e&&(r.Xb(0,"h5",38),r.Xb(1,"strong"),r.bc(2,63),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(4);r.uc("ngClass",r.Ac(1,Sh,!e.submitted,e.submitted))}}function kh(e,t){1&e&&r.Tb(0)}const Th=function(e,t){return{index:e,matcher:t}};function Mh(e,t){if(1&e&&(r.Xb(0,"span"),r.Pc(1,kh,1,0,"ng-container",64),r.Wb()),2&e){const e=t.$implicit,n=t.index;r.nc();const i=r.Fc(1);r.Db(1),r.uc("ngTemplateOutlet",i)("ngTemplateOutletContext",r.Ac(2,Th,n,e))}}function Ch(e,t){if(1&e&&(r.Xb(0,"div",65),r.Xb(1,"span"),r.Rc(2),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Gb("cd-col-form-offset ",e.matcherMatch.cssClass,""),r.Db(1),r.Gb("text-muted ",e.matcherMatch.cssClass,""),r.Db(1),r.Tc(" ",e.matcherMatch.status," ")}}function Oh(e,t){if(1&e&&r.Sb(0,"cd-date-time-picker",66),2&e){const e=r.nc();r.uc("control",e.form.get("startsAt"))("hasSeconds",!1)}}function Lh(e,t){if(1&e&&r.Sb(0,"cd-date-time-picker",66),2&e){const e=r.nc();r.uc("control",e.form.get("endsAt"))("hasSeconds",!1)}}const Eh=function(e){return{"btn-warning":e}};let Ah=(()=>{class e{constructor(e,t,n,i,r,s,o,a,c,l,u){this.router=e,this.authStorageService=t,this.formBuilder=n,this.prometheusService=i,this.notificationService=r,this.route=s,this.timeDiff=o,this.modalService=a,this.silenceMatcher=c,this.actionLabels=l,this.succeededLabels=u,this.icons=_n.a,this.recreate=!1,this.edit=!1,this.resource="silence",this.matchers=[],this.matcherMatch=void 0,this.matcherConfig=[{tooltip:"Attribute name",icon:this.icons.paragraph,attribute:"name"},{tooltip:"Value",icon:this.icons.terminal,attribute:"value"},{tooltip:"Regular expression",icon:this.icons.magic,attribute:"isRegex"}],this.datetimeFormat="YYYY-MM-DD HH:mm",this.init()}init(){this.chooseMode(),this.authenticate(),this.createForm(),this.setupDates(),this.getData()}chooseMode(){this.edit=this.router.url.startsWith("/monitoring/silences/edit"),this.recreate=this.router.url.startsWith("/monitoring/silences/recreate"),this.action=this.edit?this.actionLabels.EDIT:this.recreate?this.actionLabels.RECREATE:this.actionLabels.CREATE}authenticate(){if(this.permission=this.authStorageService.getPermissions().prometheus,!this.permission.read||!(this.edit?this.permission.update:this.permission.create))throw new ih.b}createForm(){const e=Cn.a.custom("format",e=>!(""===e||nn()(e,this.datetimeFormat).isValid()));this.form=this.formBuilder.group({startsAt:["",[xn.A.required,e]],duration:["2h",[xn.A.min(1)]],endsAt:["",[xn.A.required,e]],createdBy:[this.authStorageService.getUsername(),[xn.A.required]],comment:[null,[xn.A.required]]},{validators:Cn.a.custom("matcherRequired",()=>0===this.matchers.length)})}setupDates(){const e=nn()().format(this.datetimeFormat);this.form.silentSet("startsAt",e),this.updateDate(),this.subscribeDateChanges()}updateDate(e){const t=nn()(this.form.getValue(e?"endsAt":"startsAt"),this.datetimeFormat).toDate(),n=this.timeDiff.calculateDate(t,this.form.getValue("duration"),e);if(n){const t=nn()(n).format(this.datetimeFormat);this.form.silentSet(e?"startsAt":"endsAt",t)}}subscribeDateChanges(){this.form.get("startsAt").valueChanges.subscribe(()=>{this.onDateChange()}),this.form.get("duration").valueChanges.subscribe(()=>{this.updateDate()}),this.form.get("endsAt").valueChanges.subscribe(()=>{this.onDateChange(!0)})}onDateChange(e){const t=nn()(this.form.getValue("startsAt"),this.datetimeFormat),n=nn()(this.form.getValue("endsAt"),this.datetimeFormat);t.isBefore(n)?this.updateDuration():this.updateDate(e)}updateDuration(){const e=nn()(this.form.getValue("startsAt"),this.datetimeFormat).toDate(),t=nn()(this.form.getValue("endsAt"),this.datetimeFormat).toDate();this.form.silentSet("duration",this.timeDiff.calculateDuration(e,t))}getData(){this.getRules(),this.getModeSpecificData()}getRules(){this.prometheusService.ifPrometheusConfigured(()=>this.prometheusService.getRules().subscribe(e=>{this.rules=e.groups.reduce((e,t)=>Wt.a.concat(e,t.rules),[])},()=>{this.prometheusService.disablePrometheusConfig(),this.rules=[]}),()=>{this.rules=[],this.notificationService.show(vn.a.info,"Please add your Prometheus host to the dashboard configuration and refresh the page",void 0,void 0,"Prometheus")})}getModeSpecificData(){this.route.params.subscribe(e=>{e.id&&(this.edit||this.recreate?this.prometheusService.getSilences(e).subscribe(e=>{this.fillFormWithSilence(e[0])}):this.prometheusService.getAlerts(e).subscribe(e=>{this.fillFormByAlert(e[0])}))})}fillFormWithSilence(e){this.id=e.id,this.edit&&(["startsAt","endsAt"].forEach(t=>this.form.silentSet(t,nn()(e[t]).format(this.datetimeFormat))),this.updateDuration()),["createdBy","comment"].forEach(t=>this.form.silentSet(t,e[t])),this.matchers=e.matchers,this.validateMatchers()}validateMatchers(){this.rules?(this.matcherMatch=this.silenceMatcher.multiMatch(this.matchers,this.rules),this.form.markAsDirty(),this.form.updateValueAndValidity()):window.setTimeout(()=>this.validateMatchers(),100)}fillFormByAlert(e){const t=e.labels;Object.keys(t).forEach(e=>this.setMatcher({name:e,value:t[e],isRegex:!1}))}setMatcher(e,t){Wt.a.isNumber(t)?this.matchers[t]=e:this.matchers.push(e),this.validateMatchers()}showMatcherModal(e){const t=this.modalService.show(uh).componentInstance;t.rules=this.rules,Wt.a.isNumber(e)&&(t.editMode=!0,t.preFillControls(this.matchers[e])),t.submitAction.subscribe(t=>{this.setMatcher(t,e)})}deleteMatcher(e){this.matchers.splice(e,1),this.validateMatchers()}submit(){this.form.invalid||this.prometheusService.setSilence(this.getSubmitData()).subscribe(e=>{this.router.navigate(["/monitoring/silences"]),this.notificationService.show(vn.a.success,this.getNotificationTile(e.body.silenceId),void 0,void 0,"Prometheus")},()=>this.form.setErrors({cdSubmitButton:!0}))}getSubmitData(){const e=this.form.value;return delete e.duration,e.startsAt=nn()(e.startsAt,this.datetimeFormat).toISOString(),e.endsAt=nn()(e.endsAt,this.datetimeFormat).toISOString(),e.matchers=this.matchers,this.edit&&(e.id=this.id),e}getNotificationTile(e){let t;return t=this.edit?this.succeededLabels.EDITED:this.recreate?this.succeededLabels.RECREATED:this.succeededLabels.CREATED,`${t} ${this.resource} ${e}`}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e),r.Rb(Gt.a),r.Rb(wo.a),r.Rb(Yd),r.Rb(wn.a),r.Rb(Pt.a),r.Rb(sh),r.Rb(yn.a),r.Rb(rh),r.Rb(gn.b),r.Rb(gn.d))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-prometheus-form"]],decls:71,vars:30,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Creator",n="Comment",i="Start time",r="If the start time lies in the past the creation time will be used",s="Duration",o="End time",a="Matchers",c="Add matcher",l="Edit",u="Delete",d="Editing a silence will expire the old silence and recreate it as a new silence",h="This field is required!",f="This field is required!",p="This field is required!",m="This field is required!",b="This field is required!",g="A silence requires at least one matcher",[["matcherTpl",""],[1,"cd-col-form"],["name","form","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[4,"ngIf"],[1,"card-body"],[1,"form-group","row"],["for","created-by",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["formControlName","createdBy","id","created-by","name","created-by","type","text",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","comment",1,"cd-col-form-label","required"],n,["formControlName","comment","id","comment","name","comment","type","text",1,"form-control"],["for","starts-at",1,"cd-col-form-label"],[1,"required"],i,r,["formControlName","startsAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["ps","ngbPopover"],["for","duration",1,"cd-col-form-label","required"],s,["formControlName","duration","id","duration","name","duration","type","text",1,"form-control"],["for","ends-at",1,"cd-col-form-label","required"],o,["formControlName","endsAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["pe","ngbPopover"],a,[1,"cd-col-form-offset"],[3,"ngClass",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"row"],[1,"col-12"],["type","button","id","add-matcher",1,"btn","btn-light","float-right","my-3",3,"ngClass","click"],[3,"ngClass"],c,["id","match-state",3,"class",4,"ngIf"],[1,"card-footer"],[1,"text-right"],[3,"form","submitText","submitActionEvent"],["popStart",""],["popEnd",""],[1,"input-group","my-2"],[1,"input-group-append"],["type","button","ngbTooltip",l,1,"btn","btn-light",3,"id","click"],["type","button","ngbTooltip",u,1,"btn","btn-light",3,"id","click"],[1,"help-block"],[1,"input-group-prepend"],[1,"input-group-text",3,"ngbTooltip"],["type","text","disabled","","readonly","",1,"form-control",3,"id","value"],[1,"input-group-text"],["type","checkbox","disabled","","readonly","",3,"id","checked"],d,[1,"invalid-feedback"],h,f,p,m,b,g,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["id","match-state"],[3,"control","hasSeconds"]]},template:function(e,t){if(1&e){const e=r.Yb();r.Pc(0,bh,8,9,"ng-template",null,0,r.Qc),r.Xb(2,"div",1),r.Xb(3,"form",2,3),r.Xb(5,"div",4),r.Xb(6,"div",5),r.Xb(7,"span"),r.bc(8,6),r.oc(9,"titlecase"),r.oc(10,"upperFirst"),r.Wb(),r.Pc(11,gh,2,0,"cd-helper",7),r.Wb(),r.Xb(12,"div",8),r.Xb(13,"div",9),r.Xb(14,"label",10),r.bc(15,11),r.Wb(),r.Xb(16,"div",12),r.Sb(17,"input",13),r.Pc(18,_h,2,0,"span",14),r.Wb(),r.Wb(),r.Xb(19,"div",9),r.Xb(20,"label",15),r.bc(21,16),r.Wb(),r.Xb(22,"div",12),r.Xb(23,"textarea",17),r.Rc(24,"            "),r.Wb(),r.Pc(25,vh,2,0,"span",14),r.Wb(),r.Wb(),r.Xb(26,"div",9),r.Xb(27,"label",18),r.Xb(28,"span",19),r.bc(29,20),r.Wb(),r.Xb(30,"cd-helper"),r.bc(31,21),r.Wb(),r.Wb(),r.Xb(32,"div",12),r.Xb(33,"input",22,23),r.lc("click",function(){return r.Ic(e),r.Fc(34).open()})("keypress",function(){return r.Ic(e),r.Fc(34).close()}),r.Wb(),r.Pc(35,yh,2,0,"span",14),r.Wb(),r.Wb(),r.Xb(36,"div",9),r.Xb(37,"label",24),r.bc(38,25),r.Wb(),r.Xb(39,"div",12),r.Sb(40,"input",26),r.Pc(41,wh,2,0,"span",14),r.Wb(),r.Wb(),r.Xb(42,"div",9),r.Xb(43,"label",27),r.bc(44,28),r.Wb(),r.Xb(45,"div",12),r.Xb(46,"input",29,30),r.lc("click",function(){return r.Ic(e),r.Fc(47).open()})("keypress",function(){return r.Ic(e),r.Fc(47).close()}),r.Wb(),r.Pc(48,Dh,2,0,"span",14),r.Wb(),r.Wb(),r.Xb(49,"fieldset"),r.Xb(50,"legend",19),r.bc(51,31),r.Wb(),r.Xb(52,"div",32),r.Pc(53,xh,3,4,"h5",33),r.Pc(54,Mh,2,5,"span",34),r.Xb(55,"div",35),r.Xb(56,"div",36),r.Xb(57,"button",37),r.lc("click",function(){return t.showMatcherModal()}),r.Sb(58,"i",38),r.Vb(59),r.bc(60,39),r.Ub(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(61,Ch,3,7,"div",40),r.Wb(),r.Wb(),r.Xb(62,"div",41),r.Xb(63,"div",42),r.Xb(64,"cd-form-button-panel",43),r.lc("submitActionEvent",function(){return t.submit()}),r.oc(65,"titlecase"),r.oc(66,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Pc(67,Oh,1,2,"ng-template",null,44,r.Qc),r.Pc(69,Lh,1,2,"ng-template",null,45,r.Qc)}if(2&e){const e=r.Fc(4),n=r.Fc(68),i=r.Fc(70);r.Db(3),r.uc("formGroup",t.form),r.Db(7),r.fc(r.pc(9,18,t.action))(r.pc(10,20,t.resource)),r.cc(8),r.Db(1),r.uc("ngIf",t.edit),r.Db(7),r.uc("ngIf",t.form.showError("createdBy",e,"required")),r.Db(7),r.uc("ngIf",t.form.showError("comment",e,"required")),r.Db(8),r.uc("ngbPopover",n),r.Db(2),r.uc("ngIf",t.form.showError("startsAt",e,"required")),r.Db(6),r.uc("ngIf",t.form.showError("duration",e,"required")),r.Db(5),r.uc("ngbPopover",i),r.Db(2),r.uc("ngIf",t.form.showError("endsAt",e,"required")),r.Db(5),r.uc("ngIf",0===t.matchers.length),r.Db(1),r.uc("ngForOf",t.matchers),r.Db(3),r.uc("ngClass",r.zc(26,Eh,e.submitted&&0===t.matchers.length)),r.Db(1),r.uc("ngClass",r.zc(28,ph,t.icons.add)),r.Db(3),r.uc("ngIf",t.matchers.length&&t.matcherMatch),r.Db(3),r.uc("form",t.form)("submitText",r.pc(65,22,t.action)+" "+r.pc(66,24,t.resource))}},directives:[xn.B,xn.r,Qn.a,xn.k,s.r,Zn.a,On.a,xn.d,ei.a,xn.q,xn.i,dr.a,Jt.w,s.q,s.p,ti.a,Jt.D,s.w,dh.a],pipes:[s.A,pr.a],styles:["textarea[_ngcontent-%COMP%]{resize:vertical}"]}),e})();var Ih=n("w9WL"),Rh=n("HDdC");function Ph(e,t){1&e&&(r.Xb(0,"cd-alert-panel",2),r.hc(1,3),r.Sb(2,"cd-doc",4),r.ec(),r.Wb())}function Fh(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",8),2&e){const e=r.nc(2);r.uc("renderObjects",!0)("hideEmpty",!0)("appendParentKey",!1)("data",e.expandedRow)("customCss",e.customCss)("autoReload",!1)}}function Wh(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-table",5),r.lc("setExpandedRow",function(t){return r.Ic(e),r.nc().setExpandedRow(t)})("fetchData",function(){return r.Ic(e),r.nc().refresh()})("updateSelection",function(t){return r.Ic(e),r.nc().updateSelection(t)}),r.Sb(1,"cd-table-actions",6),r.Pc(2,Fh,1,6,"cd-table-key-value",7),r.Wb()}if(2&e){const e=r.nc();r.uc("data",e.silences)("columns",e.columns)("forceIdentifier",!0)("customCss",e.customCss)("sorts",e.sorts)("hasDetails",!0),r.Db(1),r.uc("permission",e.permission)("selection",e.selection)("tableActions",e.tableActions),r.Db(1),r.uc("ngIf",e.expandedRow)}}let jh=(()=>{class e extends Hd{constructor(e,t,n,i,r,s,o,a){super(a),this.authStorageService=e,this.cdDatePipe=t,this.modalService=n,this.notificationService=i,this.urlBuilder=r,this.actionLabels=s,this.succeededLabels=o,this.silences=[],this.selection=new Ht.a,this.customCss={"badge badge-danger":"active","badge badge-warning":"pending","badge badge-default":"expired"},this.sorts=[{prop:"endsAt",dir:Ih.i.desc}],this.permission=this.authStorageService.getPermissions().prometheus;const c=e=>e.first()&&e.first().status&&"expired"===e.first().status.state;this.tableActions=[{permission:"create",icon:_n.a.add,routerLink:()=>this.urlBuilder.getCreate(),canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"create",canBePrimary:e=>e.hasSingleSelection&&c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||e.first().cdExecuting&&c(e)||!c(e),icon:_n.a.copy,routerLink:()=>this.urlBuilder.getRecreate(this.selection.first().id),name:this.actionLabels.RECREATE},{permission:"update",icon:_n.a.edit,canBePrimary:e=>e.hasSingleSelection&&!c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||e.first().cdExecuting&&!c(e)||c(e),routerLink:()=>this.urlBuilder.getEdit(this.selection.first().id),name:this.actionLabels.EDIT},{permission:"delete",icon:_n.a.trash,canBePrimary:e=>e.hasSingleSelection&&!c(e),disable:e=>!e.hasSingleSelection||e.first().cdExecuting||c(e),click:()=>this.expireSilence(),name:this.actionLabels.EXPIRE}],this.columns=[{name:"ID",prop:"id",flexGrow:3},{name:"Created by",prop:"createdBy",flexGrow:2},{name:"Started",prop:"startsAt",pipe:this.cdDatePipe},{name:"Updated",prop:"updatedAt",pipe:this.cdDatePipe},{name:"Ends",prop:"endsAt",pipe:this.cdDatePipe},{name:"Status",prop:"status.state",cellTransformation:$t.a.classAdding}]}refresh(){this.prometheusService.ifAlertmanagerConfigured(()=>{this.prometheusService.getSilences().subscribe(e=>{this.silences=e},()=>{this.prometheusService.disableAlertmanagerConfig()})})}updateSelection(e){this.selection=e}expireSilence(){const e=this.selection.first().id,t="Silence",n="Prometheus";this.modalRef=this.modalService.show(bn.a,{itemDescription:t,itemNames:[e],actionDescription:this.actionLabels.EXPIRE,submitActionObservable:()=>new Rh.a(i=>{this.prometheusService.expireSilence(e).subscribe(()=>{this.notificationService.show(vn.a.success,`${this.succeededLabels.EXPIRED} ${t} ${e}`,void 0,void 0,n)},e=>{e.application=n,i.error(e)},()=>{i.complete(),this.refresh()})})})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(Xt.a),r.Rb(yn.a),r.Rb(wn.a),r.Rb(ar.a),r.Rb(gn.b),r.Rb(gn.d),r.Rb(Yd))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-silences-list"]],features:[r.Cb([{provide:ar.a,useValue:new ar.a("monitoring/silences")}]),r.Ab],decls:3,vars:2,consts:function(){let e;return e="To enable Silences, please provide the URL to the API of the Prometheus' Alertmanager as described in the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + ".",[["type","info",4,"ngIf"],["selectionType","single",3,"data","columns","forceIdentifier","customCss","sorts","hasDetails","setExpandedRow","fetchData","updateSelection",4,"ngIf"],["type","info"],e,["section","prometheus"],["selectionType","single",3,"data","columns","forceIdentifier","customCss","sorts","hasDetails","setExpandedRow","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload",4,"ngIf"],["cdTableDetail","",3,"renderObjects","hideEmpty","appendParentKey","data","customCss","autoReload"]]},template:function(e,t){1&e&&(r.Sb(0,"cd-prometheus-tabs"),r.Pc(1,Ph,3,0,"cd-alert-panel",0),r.Pc(2,Wh,3,10,"cd-table",1)),2&e&&(r.Db(1),r.uc("ngIf",!t.isAlertmanagerConfigured),r.Db(1),r.uc("ngIf",t.isAlertmanagerConfigured))},directives:[Xd,s.r,wr.a,Pr.a,Vt.a,Dn.a,en.a],styles:[""]}),e})(),Yh=(()=>{class e{constructor(e){this.http=e,this.url="api/telemetry"}getReport(){return this.http.get(`${this.url}/report`)}enable(e=!0){const t={enable:e};return e&&(t.license_name="sharing-1-0"),this.http.put(`${this.url}`,t)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Nh=(()=>{class e{constructor(){this.visible=!1,this.update=new r.p}setVisibility(e){this.visible=e,this.update.emit(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function zh(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div"),r.Rc(1," The plugin is already "),r.Xb(2,"b"),r.Rc(3,"enabled"),r.Wb(),r.Rc(4,". Click "),r.Xb(5,"b"),r.Rc(6,"Deactivate"),r.Wb(),r.Rc(7," to disable it.\xa0 "),r.Xb(8,"button",69),r.lc("click",function(){return r.Ic(e),r.nc(3).disableModule("The Telemetry module has been disabled successfully.")}),r.bc(9,70),r.Wb(),r.Wb()}}function $h(e,t){1&e&&(r.Xb(0,"span",71),r.bc(1,72),r.Wb())}function Hh(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div"),r.Xb(1,"form",4,5),r.Xb(3,"div",6),r.Xb(4,"div",7),r.bc(5,8),r.Wb(),r.Xb(6,"div",9),r.Xb(7,"p"),r.hc(8,10),r.Sb(9,"br"),r.Sb(10,"a",11),r.Sb(11,"br"),r.Sb(12,"br"),r.Sb(13,"b"),r.ec(),r.Wb(),r.Pc(14,zh,10,0,"div",12),r.Xb(15,"legend"),r.bc(16,13),r.Wb(),r.Xb(17,"p"),r.bc(18,14),r.Wb(),r.Xb(19,"div",15),r.Xb(20,"label",16),r.Vb(21),r.bc(22,17),r.Ub(),r.Xb(23,"cd-helper"),r.Vb(24),r.bc(25,18),r.Ub(),r.Xb(26,"ul"),r.Xb(27,"li"),r.bc(28,19),r.Wb(),r.Xb(29,"li"),r.bc(30,20),r.Wb(),r.Xb(31,"li"),r.bc(32,21),r.Wb(),r.Xb(33,"li"),r.bc(34,22),r.Wb(),r.Xb(35,"li"),r.bc(36,23),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(37,"div",24),r.Xb(38,"div",25),r.Sb(39,"input",26),r.Sb(40,"label",27),r.Wb(),r.Wb(),r.Wb(),r.Xb(41,"div",15),r.Xb(42,"label",28),r.Vb(43),r.bc(44,29),r.Ub(),r.Xb(45,"cd-helper"),r.Vb(46),r.bc(47,30),r.Ub(),r.Xb(48,"ul"),r.Xb(49,"li"),r.bc(50,31),r.Wb(),r.Xb(51,"li"),r.bc(52,32),r.Wb(),r.Xb(53,"li"),r.bc(54,33),r.Wb(),r.Xb(55,"li"),r.bc(56,34),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(57,"div",24),r.Xb(58,"div",25),r.Sb(59,"input",35),r.Sb(60,"label",36),r.Wb(),r.Wb(),r.Wb(),r.Xb(61,"div",15),r.Xb(62,"label",37),r.Vb(63),r.bc(64,38),r.Ub(),r.Sb(65,"cd-helper",39),r.Wb(),r.Xb(66,"div",24),r.Xb(67,"div",25),r.Sb(68,"input",40),r.Sb(69,"label",41),r.Wb(),r.Wb(),r.Wb(),r.Xb(70,"div",15),r.Xb(71,"label",42),r.Vb(72),r.bc(73,43),r.Ub(),r.Xb(74,"cd-helper"),r.Vb(75),r.bc(76,44),r.Ub(),r.Xb(77,"ul"),r.Xb(78,"li"),r.Rc(79,"Cluster description"),r.Wb(),r.Xb(80,"li"),r.Rc(81,"Contact email address"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(82,"div",24),r.Xb(83,"div",25),r.Sb(84,"input",45),r.Sb(85,"label",46),r.Wb(),r.Wb(),r.Wb(),r.Xb(86,"legend"),r.Vb(87),r.bc(88,47),r.Ub(),r.Xb(89,"cd-helper"),r.bc(90,48),r.Wb(),r.Wb(),r.Xb(91,"div",15),r.Xb(92,"label",49),r.bc(93,50),r.Wb(),r.Xb(94,"div",24),r.Sb(95,"input",51),r.Wb(),r.Wb(),r.Xb(96,"div",15),r.Xb(97,"label",52),r.bc(98,53),r.Wb(),r.Xb(99,"div",24),r.Sb(100,"input",54),r.Wb(),r.Wb(),r.Xb(101,"legend"),r.bc(102,55),r.Wb(),r.Xb(103,"div",15),r.Xb(104,"label",56),r.Vb(105),r.bc(106,57),r.Ub(),r.Xb(107,"cd-helper"),r.bc(108,58),r.Wb(),r.Wb(),r.Xb(109,"div",24),r.Sb(110,"input",59),r.Pc(111,$h,2,0,"span",60),r.Wb(),r.Wb(),r.Xb(112,"div",15),r.Xb(113,"label",61),r.Vb(114),r.bc(115,62),r.Ub(),r.Xb(116,"cd-helper"),r.Xb(117,"p"),r.bc(118,63),r.Wb(),r.Xb(119,"p"),r.bc(120,64),r.Wb(),r.Wb(),r.Wb(),r.Xb(121,"div",24),r.Sb(122,"input",65),r.Wb(),r.Wb(),r.Sb(123,"br"),r.Xb(124,"p"),r.hc(125,66),r.Sb(126,"b"),r.ec(),r.Wb(),r.Wb(),r.Xb(127,"div",67),r.Xb(128,"div",68),r.Xb(129,"button",69),r.lc("click",function(){return r.Ic(e),r.nc(2).next()}),r.Vb(130),r.Rc(131),r.Ub(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(2),t=r.nc(2);r.Db(1),r.uc("formGroup",t.configForm),r.Db(4),r.fc(t.step),r.cc(5),r.Db(8),r.fc(t.sendToUrl)(t.sendToDeviceUrl),r.cc(8),r.Db(1),r.uc("ngIf",t.moduleEnabled),r.Db(97),r.uc("ngIf",t.configForm.showError("interval",e,"min")),r.Db(20),r.Sc(t.actionLabels.NEXT)}}function Xh(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div"),r.Xb(1,"form",73,74),r.Xb(3,"div",6),r.Xb(4,"div",7),r.bc(5,75),r.Wb(),r.Xb(6,"div",9),r.Xb(7,"div",15),r.Xb(8,"label",76),r.hc(9,77),r.Sb(10,"cd-helper",78),r.ec(),r.Wb(),r.Xb(11,"div",24),r.Sb(12,"input",79),r.Wb(),r.Wb(),r.Xb(13,"div",15),r.Xb(14,"label",80),r.hc(15,81),r.Sb(16,"cd-helper",82),r.ec(),r.Wb(),r.Xb(17,"div",24),r.Sb(18,"textarea",83),r.Wb(),r.Wb(),r.Xb(19,"div",15),r.Xb(20,"div",84),r.Xb(21,"div",85),r.Sb(22,"cd-download-button",86),r.Sb(23,"cd-copy-2-clipboard-button",87),r.Wb(),r.Wb(),r.Wb(),r.Xb(24,"div",15),r.Xb(25,"div",84),r.Xb(26,"div",25),r.Sb(27,"input",88),r.Xb(28,"label",89),r.hc(29,90),r.Sb(30,"a",91),r.ec(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(31,"div",67),r.Xb(32,"div",68),r.Xb(33,"cd-form-button-panel",92),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc(2).onSubmit()})("backActionEvent",function(){return r.Ic(e),r.nc(2).back()}),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc(2);r.Db(1),r.uc("formGroup",e.previewForm),r.Db(4),r.fc(e.step),r.cc(5),r.Db(17),r.uc("objectItem",e.report),r.Db(11),r.uc("form",e.previewForm)("submitText",e.actionLabels.UPDATE)("cancelText",e.actionLabels.BACK)}}function Vh(e,t){if(1&e&&(r.Xb(0,"div",1),r.Vb(1,2),r.Pc(2,Hh,132,7,"div",3),r.Pc(3,Xh,34,6,"div",3),r.Ub(),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngSwitch",e.step),r.Db(1),r.uc("ngSwitchCase",1),r.Db(1),r.uc("ngSwitchCase",2)}}let Bh=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o){super(),this.actionLabels=e,this.formBuilder=t,this.mgrModuleService=n,this.notificationService=i,this.router=r,this.telemetryService=s,this.telemetryNotificationService=o,this.licenseAgrmt=!1,this.options={},this.requiredFields=["channel_basic","channel_crash","channel_device","channel_ident","interval","proxy","contact","description"],this.report=void 0,this.reportId=void 0,this.sendToUrl="",this.sendToDeviceUrl="",this.step=1}ngOnInit(){const e=[this.mgrModuleService.getOptions("telemetry"),this.mgrModuleService.getConfig("telemetry")];Object(Oi.a)(e).subscribe(e=>{const t=e[1];this.moduleEnabled=t.enabled,this.sendToUrl=t.url,this.sendToDeviceUrl=t.device_url,this.options=Wt.a.pick(e[0],this.requiredFields);const n=Wt.a.pick(t,this.requiredFields);this.createConfigForm(),this.configForm.setValue(n),this.loadingReady()},e=>{this.loadingError()})}createConfigForm(){const e={};Wt.a.forEach(Object.values(this.options),t=>{e[t.name]=[t.default_value,this.getValidators(t)]}),this.configForm=this.formBuilder.group(e)}createPreviewForm(){const e={report:JSON.stringify(this.report,null,2),reportId:this.reportId,licenseAgrmt:[this.licenseAgrmt,xn.A.requiredTrue]};this.previewForm=this.formBuilder.group(e)}getValidators(e){const t=[];switch(e.type){case"int":t.push(Cn.a.number()),t.push(xn.A.required),Wt.a.isNumber(e.min)&&t.push(xn.A.min(e.min)),Wt.a.isNumber(e.max)&&t.push(xn.A.max(e.max));break;case"str":Wt.a.isNumber(e.min)&&t.push(xn.A.minLength(e.min)),Wt.a.isNumber(e.max)&&t.push(xn.A.maxLength(e.max))}return t}getReport(){this.loadingStart(),this.telemetryService.getReport().subscribe(e=>{this.report=e,this.reportId=e.report.report_id,this.createPreviewForm(),this.loadingReady(),this.step++},e=>{this.loadingError()})}updateConfig(){const e={};Wt.a.forEach(Object.values(this.options),t=>{const n=this.configForm.get(t.name);n.dirty&&n.valid&&(e[t.name]=n.value)}),this.mgrModuleService.updateConfig("telemetry",e).subscribe(()=>{this.disableModule("Your settings have been applied successfully.  Due to privacy/legal reasons the Telemetry module is now disabled until you  complete the next step and accept the license.",()=>{this.getReport()})},()=>{this.configForm.setErrors({cdSubmitButton:!0})})}disableModule(e=null,t=null){this.telemetryService.enable(!1).subscribe(()=>{this.telemetryNotificationService.setVisibility(!0),e&&this.notificationService.show(vn.a.success,e),t?t():this.router.navigate([""])})}next(){this.configForm.pristine?this.getReport():this.updateConfig()}back(){this.step--}onSubmit(){this.telemetryService.enable().subscribe(()=>{this.telemetryNotificationService.setVisibility(!1),this.notificationService.show(vn.a.success,"The Telemetry module has been configured and activated successfully."),this.router.navigate([""])})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(wo.a),r.Rb(wl),r.Rb(wn.a),r.Rb(Pt.e),r.Rb(Yh),r.Rb(Nh))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-telemetry"]],features:[r.Ab],decls:1,vars:1,consts:function(){let e,t,n,i,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y,w,D,S,x,k,T,M,C,O,L,E,A,I,R,P,F,W,j,Y,N,z;return e="Step " + "\ufffd0\ufffd" + " of 2: Telemetry report configuration",t="The telemetry module sends anonymous data about this Ceph cluster back to the Ceph developers to help understand how Ceph is used and what problems users may be experiencing." + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + " This data is visualized on " + "\ufffd#10\ufffd" + "public dashboards" + "\ufffd/#10\ufffd" + " that allow the community to quickly see summary statistics on how many clusters are reporting, their total capacity and OSD count, and version distribution trends." + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + "" + "[\ufffd#9\ufffd\ufffd/#9\ufffd|\ufffd#11\ufffd\ufffd/#11\ufffd|\ufffd#12\ufffd\ufffd/#12\ufffd]" + " The data being reported does " + "\ufffd#13\ufffd" + "not" + "\ufffd/#13\ufffd" + " contain any sensitive data like pool names, object names, object contents, hostnames, or device serial numbers. It contains counters and statistics on how the cluster has been deployed, the version of Ceph, the distribution of the hosts and other parameters which help the project to gain a better understanding of the way Ceph is used. The data is sent secured to " + "\ufffd0\ufffd" + " and " + "\ufffd1\ufffd" + " (device report).",t=r.gc(t),n="Channels",i="The telemetry report is broken down into several \"channels\", each with a different type of information that can be configured below.",s="Basic",o="Includes basic information about the cluster:",a="Capacity of the cluster",c="Number of monitors, managers, OSDs, MDSs, object gateways, or other daemons",l="Software version currently being used",u="Number and types of RADOS pools and CephFS file systems",d="Names of configuration options that have been changed from their default (but not their values)",h="Crash",f="Includes information about daemon crashes:",p="Type of daemon",m="Version of the daemon",b="Operating system (OS distribution, kernel version)",g="Stack trace identifying where in the Ceph code the crash occurred",_="Device",v="Includes information about device metrics like anonymized SMART metrics.",y="Ident",w="Includes user-provided identifying information about the cluster:",D="Contact Information",S="Submitting any contact information is completely optional and disabled by default.",x="Contact",k="Description",T="My first Ceph cluster",M="Advanced Settings",C="Interval",O="The module compiles and sends a new report every 24 hours by default. You can adjust this interval by setting a different number of hours.",L="Proxy",E="If the cluster cannot directly connect to the configured telemetry endpoint (default telemetry.ceph.com), you can configure a HTTP/HTTPS proxy server by e.g. adding https://10.0.0.1:8080",A="You can also include a user:pass if needed e.g. https://ceph:telemetry@10.0.0.1:8080",I="" + "\ufffd#126\ufffd" + "Note:" + "\ufffd/#126\ufffd" + " By clicking 'Next' you will first see a preview of the report content before you can activate the automatic submission of your data.",R="Deactivate",P="The entered value is too low! It must be greater or equal to 8.",F="Step " + "\ufffd0\ufffd" + " of 2: Telemetry report preview",W="A randomized UUID to identify a particular cluster over the course of several telemetry reports.",j="Report ID " + "\ufffd#10\ufffd" + "" + "\ufffd/#10\ufffd" + "",Y="The actual telemetry data that will be submitted.",N="Report preview " + "\ufffd#16\ufffd" + "" + "\ufffd/#16\ufffd" + "",z="I agree to my telemetry data being submitted under the " + "\ufffd#30\ufffd" + "Community Data License Agreement - Sharing - Version 1.0" + "\ufffd/#30\ufffd" + "",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],[3,"ngSwitch"],[4,"ngSwitchCase"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],t,["href","https://telemetry-public.ceph.com/"],[4,"ngIf"],n,i,[1,"form-group","row"],["for","channel_basic",1,"cd-col-form-label"],s,o,a,c,l,u,d,[1,"cd-col-form-input"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","channel_basic","formControlName","channel_basic",1,"custom-control-input"],["for","channel_basic",1,"custom-control-label"],["for","channel_crash",1,"cd-col-form-label"],h,f,p,m,b,g,["type","checkbox","id","channel_crash","formControlName","channel_crash",1,"custom-control-input"],["for","channel_crash",1,"custom-control-label"],["for","channel_device",1,"cd-col-form-label"],_,["html",v],["type","checkbox","id","channel_device","formControlName","channel_device",1,"custom-control-input"],["for","channel_device",1,"custom-control-label"],["for","channel_ident",1,"cd-col-form-label"],y,w,["type","checkbox","id","channel_ident","formControlName","channel_ident",1,"custom-control-input"],["for","channel_ident",1,"custom-control-label"],D,S,["for","contact",1,"cd-col-form-label"],x,["id","contact","type","text","formControlName","contact","placeholder","Example User <user@example.com>",1,"form-control"],["for","description",1,"cd-col-form-label"],k,["id","description","type","text","formControlName","description","placeholder",T,1,"form-control"],M,["for","interval",1,"cd-col-form-label"],C,O,["id","interval","type","number","formControlName","interval",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","proxy",1,"cd-col-form-label"],L,E,A,["id","proxy","type","text","formControlName","proxy","placeholder","https://10.0.0.1:8080",1,"form-control"],I,[1,"card-footer"],[1,"button-group","text-right"],["type","button",1,"btn","btn-light",3,"click"],R,[1,"invalid-feedback"],P,["name","previewForm","novalidate","",3,"formGroup"],["frm","ngForm"],F,["for","reportId",1,"cd-col-form-label"],j,["html",W],["type","text","id","reportId","formControlName","reportId","readonly","",1,"form-control"],["for","report",1,"cd-col-form-label"],N,["html",Y],["id","report","formControlName","report","rows","15","readonly","",1,"form-control"],[1,"cd-col-form-offset"],["role","group",1,"btn-group"],["fileName","telemetry_report",3,"objectItem"],["source","report"],["type","checkbox","id","licenseAgrmt","name","licenseAgrmt","formControlName","licenseAgrmt",1,"custom-control-input"],["for","licenseAgrmt",1,"custom-control-label"],z,["href","https://cdla.io/sharing-1-0/"],[3,"form","submitText","cancelText","submitActionEvent","backActionEvent"]]},template:function(e,t){1&e&&r.Pc(0,Vh,4,3,"div",0),2&e&&r.uc("cdFormLoading",t.loading)},directives:[Kn.a,s.t,s.u,xn.B,xn.r,Qn.a,xn.k,s.r,Zn.a,dr.a,On.a,xn.b,ei.a,xn.q,xn.i,xn.d,xn.v,nl,ma.a,ti.a],styles:[""]}),e})();var Uh=n("Y7HM");function qh(e){const{subscriber:t,counter:n,period:i}=e;t.next(n),this.schedule({subscriber:t,counter:n+1,period:i},i)}let Gh=(()=>{class e{constructor(e){this.ngZone=e,this.intervalDataSource=new qi.a(null),this.intervalData$=this.intervalDataSource.asObservable();const t=parseInt(sessionStorage.getItem("dashboard_interval"),10)||5e3;this.setRefreshInterval(t)}setRefreshInterval(e){this.intervalTime=e,sessionStorage.setItem("dashboard_interval",e.toString()),this.intervalSubscription&&this.intervalSubscription.unsubscribe(),this.ngZone.runOutsideAngular(()=>{this.intervalSubscription=function(e=0,t=sa.a){return(!Object(Uh.a)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=sa.a),new Rh.a(n=>(n.add(t.schedule(qh,e,{subscriber:n,counter:0,period:e})),n))}(this.intervalTime).subscribe(()=>this.ngZone.run(()=>{this.intervalDataSource.next(this.intervalTime)}))})}getRefreshInterval(){return this.intervalTime}ngOnDestroy(){this.intervalSubscription&&this.intervalSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.D))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function Jh(e,t){if(1&e&&(r.Xb(0,"option",8),r.Rc(1),r.Wb()),2&e){const e=t.$implicit,n=r.nc();r.uc("value",n.intervalList[e]),r.Db(1),r.Sc(e)}}let Kh=(()=>{class e{constructor(e){this.refreshIntervalService=e,this.intervalList={"5 s":5e3,"10 s":1e4,"15 s":15e3,"30 s":3e4,"1 min":6e4,"3 min":18e4,"5 min":3e5},this.intervalKeys=Object.keys(this.intervalList)}ngOnInit(){this.selectedInterval=this.refreshIntervalService.getRefreshInterval()||5e3}changeRefreshInterval(e){this.refreshIntervalService.setRefreshInterval(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gh))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-refresh-selector"]],decls:8,vars:2,consts:function(){let e;return e="Refresh",[[1,"container-fluid"],[1,"row"],[1,"col","d-flex","justify-content-end"],[1,"form-inline"],["for","refreshInterval",1,"col-form-label","my-0","mx-2"],e,["id","refreshInterval","name","refreshInterval",1,"form-control","custom-select",3,"ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"div",2),r.Xb(3,"form",3),r.Xb(4,"label",4),r.bc(5,5),r.Wb(),r.Xb(6,"select",6),r.lc("change",function(e){return t.changeRefreshInterval(e.target.value)})("ngModelChange",function(e){return t.selectedInterval=e}),r.Pc(7,Jh,2,2,"option",7),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(6),r.uc("ngModel",t.selectedInterval),r.Db(1),r.uc("ngForOf",t.intervalKeys))},directives:[xn.B,xn.r,xn.s,On.a,xn.z,ei.a,xn.q,xn.t,s.q,xn.u,xn.C],styles:[""]}),e})();var Qh=n("d+Og");let Zh=(()=>{class e{constructor(e){this.http=e}getFullHealth(){return this.http.get("api/health/full")}getMinimalHealth(){return this.http.get("api/health/minimal")}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var ef=n("TKcr"),tf=n("ej+x");function nf(e,t){if(1&e&&(r.Xb(0,"div",6),r.hc(1,7),r.oc(2,"lowercase"),r.Sb(3,"cd-doc",8),r.oc(4,"lowercase"),r.ec(),r.Wb()),2&e){const e=r.nc();r.Db(3),r.wc("section","dashboard-landing-page-",r.pc(4,4,e.groupTitle),""),r.Db(1),r.fc(r.pc(2,2,e.groupTitle)),r.cc(1)}}const rf=function(e,t){return[e,t]},sf=["*"];let of=(()=>{class e{constructor(){this.icons=_n.a}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-info-group"]],inputs:{groupTitle:"groupTitle"},ngContentSelectors:sf,decls:11,vars:6,consts:function(){let e,t;return e="here",t="For an overview of " + "\ufffd0\ufffd" + " widgets click " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + "",[[1,"row"],["triggers","",1,"info-group-title",3,"ngbPopover"],["popInfo","ngbPopover"],["type","button",1,"popover-icon","btn","btn-link","p-0",3,"click"],[3,"ngClass"],["popInfoTemplate",""],[1,"text-center"],t,["docText",e,3,"section"]]},template:function(e,t){if(1&e){const e=r.Yb();r.tc(),r.Xb(0,"div",0),r.Xb(1,"div",1,2),r.Xb(3,"span"),r.Rc(4),r.Wb(),r.Xb(5,"button",3),r.lc("click",function(){return r.Ic(e),r.Fc(2).toggle()}),r.Sb(6,"i",4),r.Wb(),r.Wb(),r.Wb(),r.Xb(7,"div",0),r.sc(8),r.Wb(),r.Pc(9,nf,5,6,"ng-template",null,5,r.Qc)}if(2&e){const e=r.Fc(10);r.Db(1),r.uc("ngbPopover",e),r.Db(3),r.Sc(t.groupTitle),r.Db(2),r.uc("ngClass",r.Ac(3,rf,t.icons.infoCircle,t.icons.large))}},directives:[Jt.w,On.a,s.p,Pr.a],pipes:[s.o],styles:[".info-group-title[_ngcontent-%COMP%]{font-size:1.75rem;margin:0 0 .5vw .5vw}.popover-icon[_ngcontent-%COMP%]:focus{box-shadow:none}"]}),e})();function af(e,t){if(1&e&&(r.Xb(0,"a",6),r.Rc(1),r.Wb()),2&e){const e=r.nc();r.uc("routerLink",e.link),r.Db(1),r.Sc(e.cardTitle)}}function cf(e,t){if(1&e&&r.Rc(0),2&e){const e=r.nc();r.Tc(" ",e.cardTitle," ")}}const lf=["*"];let uf=(()=>{class e{constructor(){this.cardClass=""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-info-card"]],inputs:{cardTitle:"cardTitle",link:"link",cardClass:"cardClass",contentClass:"contentClass"},ngContentSelectors:lf,decls:8,vars:4,consts:[[1,"card","shadow-sm",3,"ngClass"],[1,"card-body","d-flex","align-items-center","justify-content-center"],[1,"card-title","m-4"],[3,"routerLink",4,"ngIf","ngIfElse"],["noLinkTitle",""],[1,"card-text","text-center",3,"ngClass"],[3,"routerLink"]],template:function(e,t){if(1&e&&(r.tc(),r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"h4",2),r.Pc(3,af,2,2,"a",3),r.Pc(4,cf,1,1,"ng-template",null,4,r.Qc),r.Wb(),r.Xb(6,"div",5),r.sc(7),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.Fc(5);r.uc("ngClass",t.cardClass),r.Db(3),r.uc("ngIf",t.link)("ngIfElse",e),r.Db(3),r.uc("ngClass",t.contentClass)}},directives:[s.p,s.r,Pt.h],styles:[".card[_ngcontent-%COMP%]{font-size:12px;border:.5px solid #dee2e6;border-radius:3px;height:100%}@media screen and (min-width:320px){.card[_ngcontent-%COMP%]{font-size:calc(12px + 9 * ((100vw - 320px) / 1728))}}@media screen and (min-width:2048px){.card[_ngcontent-%COMP%]{font-size:21px}}.card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding-top:40px!important}.card[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]   .card-title[_ngcontent-%COMP%]{left:-.6rem;position:absolute;top:-.3rem}.no-center[_ngcontent-%COMP%]{left:unset;position:unset;top:unset;transform:unset}.content-highlight[_ngcontent-%COMP%]{font-weight:700}"]}),e})();var df=n("MO+k");const hf=["chartCanvas"],ff=["chartTooltip"];let pf=(()=>{class e{constructor(e,t,n){this.dimlessBinary=e,this.dimless=t,this.cssHelper=n,this.config={},this.isBytesData=!1,this.showLabelAsTooltip=!1,this.prepareFn=new r.p,this.chartConfig={chartType:"doughnut",dataset:[{label:null,borderWidth:0}],colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-green"),this.cssHelper.propertyValue("chart-color-yellow"),this.cssHelper.propertyValue("chart-color-orange"),this.cssHelper.propertyValue("chart-color-red"),this.cssHelper.propertyValue("chart-color-blue")]}],options:{cutoutPercentage:90,events:["click","mouseout","touchstart"],legend:{display:!0,position:"right",labels:{boxWidth:10,usePointStyle:!1}},plugins:{center_text:!0},tooltips:{enabled:!0,displayColors:!1,backgroundColor:this.cssHelper.propertyValue("chart-color-tooltip-background"),cornerRadius:0,bodyFontSize:14,bodyFontStyle:"600",position:"nearest",xPadding:12,yPadding:12,callbacks:{label:(e,t)=>{let n=t.labels[e.index];return n.includes("%")||(n=`${n} (${t.datasets[e.datasetIndex].data[e.index]}%)`),n}}},title:{display:!1}}},this.doughnutChartPlugins=[{id:"center_text",beforeDraw(e){const t=new ef.a,n="Helvetica Neue, Helvetica, Arial, sans-serif";df.defaults.global.defaultFontFamily=n;const i=e.ctx;if(!e.options.plugins.center_text||!e.data.datasets[0].label)return;i.save();const r=e.data.datasets[0].label.split("\n"),s=(e.chartArea.left+e.chartArea.right)/2,o=(e.chartArea.top+e.chartArea.bottom)/2;i.textAlign="center",i.textBaseline="middle",i.font=`24px ${n}`,i.fillStyle=t.propertyValue("chart-color-center-text"),i.fillText(r[0],s,o-10),r.length>1&&(i.font=`14px ${n}`,i.fillStyle=t.propertyValue("chart-color-center-text-description"),i.fillText(r[1],s,o+10)),i.restore()}}]}ngOnInit(){new rn.a(this.chartCanvasRef,this.chartTooltipRef,(e,t)=>t+e.caretX+"px",(e,t)=>t+e.caretY-e.height-10+"px").getBody=e=>this.getChartTooltipBody(e),Wt.a.merge(this.chartConfig,this.config),this.prepareFn.emit([this.chartConfig,this.data])}ngOnChanges(){this.prepareFn.emit([this.chartConfig,this.data]),this.setChartSliceBorderWidth()}getChartTooltipBody(e){const t=e[0].split(": ");return this.showLabelAsTooltip?t[0]:(t[1]=this.isBytesData?this.dimlessBinary.transform(t[1]):this.dimless.transform(t[1]),t.join(": "))}setChartSliceBorderWidth(){let e=0;Wt.a.forEach(this.chartConfig.dataset[0].data,function(t){t>0&&(e+=1)}),this.chartConfig.dataset[0].borderWidth=e>1?1:0}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Qt.a),r.Rb(Zt.a),r.Rb(ef.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-health-pie"]],viewQuery:function(e,t){if(1&e&&(r.Wc(hf,3),r.Wc(ff,3)),2&e){let e;r.Ec(e=r.mc())&&(t.chartCanvasRef=e.first),r.Ec(e=r.mc())&&(t.chartTooltipRef=e.first)}},inputs:{data:"data",config:"config",isBytesData:"isBytesData",tooltipFn:"tooltipFn",showLabelAsTooltip:"showLabelAsTooltip"},outputs:{prepareFn:"prepareFn"},features:[r.Bb],decls:6,vars:6,consts:[[1,"chart-container"],["baseChart","",1,"chart-canvas",3,"datasets","chartType","options","labels","colors","plugins"],["chartCanvas",""],[1,"chartjs-tooltip"],["chartTooltip",""]],template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Sb(1,"canvas",1,2),r.Xb(3,"div",3,4),r.Sb(5,"table"),r.Wb(),r.Wb()),2&e&&(r.Db(1),r.uc("datasets",t.chartConfig.dataset)("chartType",t.chartConfig.chartType)("options",t.chartConfig.options)("labels",t.chartConfig.labels)("colors",t.chartConfig.colors)("plugins",t.doughnutChartPlugins))},directives:[sn.a],styles:['.chart-container[_ngcontent-%COMP%]{cursor:pointer;margin:auto;overflow:visible;position:absolute}canvas[_ngcontent-%COMP%]{user-select:none}.chartjs-tooltip[_ngcontent-%COMP%]{background:#000000b3;border-radius:3px;color:#fff;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;opacity:0;pointer-events:none;position:absolute;transform:translate(-50%);transition:all .1s ease}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]{transform:translate(-10%)}.chartjs-tooltip.transform-left[_ngcontent-%COMP%]:after{left:10%}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]{transform:translate(-90%)}.chartjs-tooltip.transform-right[_ngcontent-%COMP%]:after{left:90%}.chartjs-tooltip[_ngcontent-%COMP%]:after{border:5px solid #0000;border-top-color:#000;content:" ";left:50%;margin-left:-5px;position:absolute;top:100%}  .chartjs-tooltip-key{display:inline-block;height:10px;margin-right:10px;width:10px}.chart-canvas[_ngcontent-%COMP%], .chart-container[_ngcontent-%COMP%]{height:100%;margin-left:auto;margin-right:auto;position:unset;width:100%}.chart-canvas[_ngcontent-%COMP%]{max-height:100%;max-width:100%}']}),e})(),mf=(()=>{class e{transform(e){if(!e)return"";let t=0,n=0;Wt.a.each(e.osds,e=>{e.in&&t++,e.up&&n++});const i=[{content:`${e.osds.length} ${"total"}`,class:""}];i.push({content:"",class:"card-text-line-break"}),i.push({content:`${n} ${"up"}, ${t} ${"in"}`,class:""});const r=e.osds.length-n,s=e.osds.length-t;if(r>0||s>0){i.push({content:"",class:"card-text-line-break"});const e=r>0?`${r} ${"down"}`:"",t=s>0?`${s} ${"out"}`:"";i.push({content:`${e}${r>0&&s>0?", ":""}${t}`,class:"card-text-error"})}return i}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"osdSummary",type:e,pure:!0}),e})(),bf=(()=>{class e{transform(e){if(!e)return"";let t="",n="",i=0,r=0,s=0;Wt.a.each(e.standbys,()=>{i+=1}),e.standbys&&!e.filesystems?(t=`${i} ${"up"}`,n="no filesystems"):0===e.filesystems.length?t="no filesystems":(Wt.a.each(e.filesystems,e=>{Wt.a.each(e.mdsmap.info,e=>{"up:standby-replay"===e.state?s+=1:r+=1})}),t=`${r} ${"active"}`,n=`${i+s} ${"standby"}`);const o=e.standbys.map(e=>e.name).join(", "),a=o?`${"standby daemons"}: ${o}`:"",c=e.filesystems?e.filesystems.length:0,l=Object.values(c>0?e.filesystems[0].mdsmap.info:{}).map(e=>e.name).join(", ");let u=l?`${"active daemon"}: ${l}`:"";!r&&c>0&&(u=`${s} ${"standbyReplay"}`);const d=[{content:t,class:"popover-info",titleText:u}];return n&&(d.push({content:"",class:"card-text-line-break",titleText:""}),d.push({content:n,class:"popover-info",titleText:a})),d}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"mdsSummary",type:e,pure:!0}),e})();var gf=function(e){return e.HEALTH_ERR="health-color-error",e.HEALTH_WARN="health-color-warning",e.HEALTH_OK="health-color-healthy",e}({});let _f=(()=>{class e{constructor(e){this.cssHelper=e}transform(e){return Object.keys(gf).includes(e)?{color:this.cssHelper.propertyValue(gf[e])}:null}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(ef.a))},e.\u0275pipe=r.Qb({name:"healthColor",type:e,pure:!0}),e})(),vf=(()=>{class e{transform(e){return e?"" + e.monmap.mons.length.toString() + " (quorum " + e.quorum.join(", ") + ")":""}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"monSummary",type:e,pure:!0}),e})(),yf=(()=>{class e{transform(e){if(!e)return"";let t="n/a";const n=Wt.a.isUndefined(e.active_name)?"":`${"active daemon"}: ${e.active_name}`;n.length>0&&(t="1");const i=e.standbys.map(e=>e.name).join(", "),r=i?`${"standby daemons"}: ${i}`:"",s=e.standbys.length,o=[{content:`${t} ${"active"}`,class:"popover-info",titleText:n}];return o.push({content:"",class:"card-text-line-break",titleText:""}),o.push({content:`${s} ${"standby"}`,class:"popover-info",titleText:r}),o}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=r.Qb({name:"mgrSummary",type:e,pure:!0}),e})();function wf(e,t){1&e&&r.Tb(0)}function Df(e,t){if(1&e&&(r.Xb(0,"li"),r.Xb(1,"span",22),r.oc(2,"healthColor"),r.Rc(3),r.Wb(),r.Rc(4),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.uc("ngStyle",r.pc(2,3,e.severity)),r.Db(2),r.Sc(e.type),r.Db(1),r.Tc(": ",e.summary.message," ")}}function Sf(e,t){if(1&e&&(r.Pc(0,wf,1,0,"ng-container",20),r.Xb(1,"ul"),r.Pc(2,Df,5,5,"li",21),r.Wb()),2&e){r.nc(4);const e=r.Fc(5),t=r.nc();r.uc("ngTemplateOutlet",e),r.Db(2),r.uc("ngForOf",t.healthData.health.checks)}}function xf(e,t){1&e&&r.Sb(0,"i",23)}function kf(e,t){if(1&e&&(r.Vb(0),r.Pc(1,Sf,3,2,"ng-template",null,17,r.Qc),r.Xb(3,"div",18),r.oc(4,"healthColor"),r.Rc(5),r.Pc(6,xf,1,0,"i",19),r.Wb(),r.Ub()),2&e){const e=r.Fc(2),t=r.nc(4);r.Db(3),r.uc("ngStyle",r.pc(4,4,t.healthData.health.status))("ngbPopover",e),r.Db(2),r.Tc(" ",t.healthData.health.status," "),r.Db(1),r.uc("ngIf","HEALTH_OK"!=(null==t.healthData.health?null:t.healthData.health.status))}}function Tf(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",22),r.oc(2,"healthColor"),r.Rc(3),r.Wb(),r.Ub()),2&e){const e=r.nc(4);r.Db(1),r.uc("ngStyle",r.pc(2,2,e.healthData.health.status)),r.Db(2),r.Tc(" ",e.healthData.health.status," ")}}function Mf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",15),r.Pc(1,kf,7,6,"ng-container",16),r.Pc(2,Tf,4,4,"ng-container",16),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.uc("ngIf",(null==e.healthData.health||null==e.healthData.health.checks?null:e.healthData.health.checks.length)>0),r.Db(1),r.uc("ngIf",!(null!=e.healthData.health&&null!=e.healthData.health.checks&&e.healthData.health.checks.length))}}function Cf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",24),r.Rc(1),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",e.healthData.hosts," total ")}}function Of(e,t){if(1&e&&(r.Xb(0,"cd-info-card",25),r.Rc(1),r.oc(2,"monSummary"),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",r.pc(2,1,e.healthData.mon_status)," ")}}function Lf(e,t){if(1&e&&(r.Xb(0,"span",28),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("ngClass",e.class),r.Db(1),r.Tc(" ",e.content," ")}}function Ef(e,t){if(1&e&&(r.Xb(0,"cd-info-card",26),r.Pc(1,Lf,2,2,"span",27),r.Wb()),2&e){const e=t.ngIf;r.Db(1),r.uc("ngForOf",e)}}function Af(e,t){if(1&e&&(r.Xb(0,"span",31),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("ngClass",e.class)("title",null!=e.titleText?e.titleText:""),r.Db(1),r.Tc(" ",e.content," ")}}function If(e,t){if(1&e&&(r.Xb(0,"cd-info-card",29),r.Pc(1,Af,2,3,"span",30),r.oc(2,"mgrSummary"),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.uc("ngForOf",r.pc(2,1,e.healthData.mgr_map))}}function Rf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",32),r.Rc(1),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",e.healthData.rgw," total ")}}function Pf(e,t){if(1&e&&(r.Xb(0,"span",31),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("ngClass",e.class)("title",null!=e.titleText?e.titleText:""),r.Db(1),r.Tc(" ",e.content," ")}}function Ff(e,t){if(1&e&&(r.Xb(0,"cd-info-card",33),r.Pc(1,Pf,2,3,"span",30),r.Wb()),2&e){const e=t.ngIf;r.uc("contentClass",(e.length>1?"text-area-size-2":"")+" content-highlight"),r.Db(1),r.uc("ngForOf",e)}}const Wf=function(e){return{"card-text-error":e}};function jf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",34),r.Rc(1),r.Sb(2,"span",35),r.Rc(3),r.Xb(4,"span",28),r.Rc(5),r.Wb(),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",e.healthData.iscsi_daemons.up+e.healthData.iscsi_daemons.down," total "),r.Db(2),r.Tc(" ",e.healthData.iscsi_daemons.up," up, "),r.Db(1),r.uc("ngClass",r.zc(4,Wf,e.healthData.iscsi_daemons.down>0)),r.Db(1),r.Tc("",e.healthData.iscsi_daemons.down," down")}}function Yf(e,t){if(1&e&&(r.Xb(0,"cd-info-group",6),r.Pc(1,Mf,3,2,"cd-info-card",7),r.Pc(2,Cf,2,1,"cd-info-card",8),r.Pc(3,Of,3,3,"cd-info-card",9),r.Pc(4,Ef,2,1,"cd-info-card",10),r.oc(5,"osdSummary"),r.Pc(6,If,3,3,"cd-info-card",11),r.Pc(7,Rf,2,1,"cd-info-card",12),r.Pc(8,Ff,2,2,"cd-info-card",13),r.oc(9,"mdsSummary"),r.Pc(10,jf,6,6,"cd-info-card",14),r.Wb()),2&e){const e=r.nc().ngIf,t=r.nc();r.Db(1),r.uc("ngIf",null==t.healthData.health?null:t.healthData.health.status),r.Db(1),r.uc("ngIf",null!=t.healthData.hosts),r.Db(1),r.uc("ngIf",t.healthData.mon_status),r.Db(1),r.uc("ngIf",r.pc(5,8,t.healthData.osd_map)),r.Db(2),r.uc("ngIf",t.healthData.mgr_map),r.Db(1),r.uc("ngIf",e.rgw&&null!=t.healthData.rgw),r.Db(1),r.uc("ngIf",r.pc(9,10,e.cephfs&&t.healthData.fs_map)),r.Db(2),r.uc("ngIf",e.iscsi&&null!=t.healthData.iscsi_daemons)}}function Nf(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-info-card",42),r.Xb(1,"cd-health-pie",43),r.lc("prepareFn",function(t){return r.Ic(e),r.nc(3).prepareRawUsage(t[0],t[1])}),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.uc("data",e.healthData)("config",e.rawCapacityChartConfig)("isBytesData",!0)}}function zf(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-info-card",44),r.Xb(1,"cd-health-pie",45),r.lc("prepareFn",function(t){return r.Ic(e),r.nc(3).prepareObjects(t[0],t[1])}),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.uc("data",e.healthData)}}function $f(e,t){1&e&&r.Tb(0)}function Hf(e,t){if(1&e&&(r.Xb(0,"li"),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.Uc(" ",e.key,": ",e.value," ")}}function Xf(e,t){if(1&e&&(r.Pc(0,$f,1,0,"ng-container",20),r.Xb(1,"ul"),r.Pc(2,Hf,2,2,"li",21),r.oc(3,"keyvalue"),r.Wb()),2&e){r.nc(3);const e=r.Fc(5),t=r.nc();r.uc("ngTemplateOutlet",e),r.Db(2),r.uc("ngForOf",r.pc(3,2,t.healthData.pg_info.statuses))}}function Vf(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-info-card",46),r.Pc(1,Xf,4,4,"ng-template",null,47,r.Qc),r.Xb(3,"div",48),r.Xb(4,"div",49),r.Xb(5,"cd-health-pie",50),r.lc("prepareFn",function(t){return r.Ic(e),r.nc(3).preparePgStatus(t[0],t[1])}),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(2),t=r.nc(3);r.Db(4),r.uc("ngbPopover",e),r.Db(1),r.uc("data",t.healthData)("config",t.pgStatusChartConfig)}}function Bf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",51),r.Rc(1),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",e.healthData.pools.length," ")}}function Uf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",52),r.Rc(1),r.oc(2,"dimless"),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",r.pc(2,1,e.healthData.pg_info.pgs_per_osd)," ")}}function qf(e,t){if(1&e&&(r.Xb(0,"cd-info-group",36),r.Pc(1,Nf,2,3,"cd-info-card",37),r.Pc(2,zf,2,1,"cd-info-card",38),r.Pc(3,Vf,6,3,"cd-info-card",39),r.Pc(4,Bf,2,1,"cd-info-card",40),r.Pc(5,Uf,3,3,"cd-info-card",41),r.Wb()),2&e){const e=r.nc(2);r.Db(1),r.uc("ngIf",e.healthData.df),r.Db(1),r.uc("ngIf",null!=(null==e.healthData.pg_info||null==e.healthData.pg_info.object_stats?null:e.healthData.pg_info.object_stats.num_objects)),r.Db(1),r.uc("ngIf",e.healthData.pg_info),r.Db(1),r.uc("ngIf",e.healthData.pools),r.Db(1),r.uc("ngIf",e.healthData.pg_info)}}function Gf(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-info-card",58),r.Xb(1,"cd-health-pie",50),r.lc("prepareFn",function(t){return r.Ic(e),r.nc(3).prepareReadWriteRatio(t[0],t[1])}),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.uc("data",e.healthData)("config",e.clientStatsConfig)}}function Jf(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-info-card",59),r.Xb(1,"cd-health-pie",50),r.lc("prepareFn",function(t){return r.Ic(e),r.nc(3).prepareClientThroughput(t[0],t[1])}),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.uc("data",e.healthData)("config",e.clientStatsConfig)}}function Kf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",60),r.Rc(1),r.oc(2,"dimlessBinary"),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",r.pc(2,1,e.healthData.client_perf.recovering_bytes_per_sec)+"/s"," ")}}function Qf(e,t){if(1&e&&(r.Xb(0,"cd-info-card",61),r.Rc(1),r.Wb()),2&e){const e=r.nc(3);r.Db(1),r.Tc(" ",e.healthData.scrub_status," ")}}function Zf(e,t){if(1&e&&(r.Xb(0,"cd-info-group",53),r.Pc(1,Gf,2,2,"cd-info-card",54),r.Pc(2,Jf,2,2,"cd-info-card",55),r.Pc(3,Kf,3,3,"cd-info-card",56),r.Pc(4,Qf,2,1,"cd-info-card",57),r.Wb()),2&e){const e=r.nc(2);r.Db(1),r.uc("ngIf",e.healthData.client_perf),r.Db(1),r.uc("ngIf",e.healthData.client_perf),r.Db(1),r.uc("ngIf",e.healthData.client_perf),r.Db(1),r.uc("ngIf",e.healthData.scrub_status)}}const ep=function(e){return[e]};function tp(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"p",62),r.hc(2,63),r.Sb(3,"i",28),r.Sb(4,"a",64),r.ec(),r.Wb(),r.Ub()),2&e){const e=r.nc(3);r.Db(3),r.uc("ngClass",r.zc(1,ep,e.icons.infoCircle))}}function np(e,t){if(1&e&&r.Pc(0,tp,5,3,"ng-container",16),2&e){const e=r.nc(2);r.uc("ngIf",e.permissions.log.read)}}function ip(e,t){if(1&e&&(r.Xb(0,"div",1),r.Pc(1,Yf,11,12,"cd-info-group",2),r.Pc(2,qf,6,5,"cd-info-group",3),r.Pc(3,Zf,5,4,"cd-info-group",4),r.Pc(4,np,1,1,"ng-template",null,5,r.Qc),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngIf",(null==e.healthData.health?null:e.healthData.health.status)||e.healthData.mon_status||e.healthData.osd_map||e.healthData.mgr_map||null!=e.healthData.hosts||null!=e.healthData.rgw||e.healthData.fs_map||null!=e.healthData.iscsi_daemons),r.Db(1),r.uc("ngIf",e.healthData.pools||e.healthData.df||e.healthData.pg_info),r.Db(1),r.uc("ngIf",e.healthData.client_perf||e.healthData.scrub_status)}}let rp=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.healthService=e,this.authStorageService=t,this.pgCategoryService=n,this.featureToggles=i,this.refreshIntervalService=r,this.dimlessBinary=s,this.dimless=o,this.cssHelper=a,this.interval=new ir.a,this.icons=_n.a,this.clientStatsConfig={colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-cyan"),this.cssHelper.propertyValue("chart-color-purple")]}]},this.rawCapacityChartConfig={colors:[{backgroundColor:[this.cssHelper.propertyValue("chart-color-blue"),this.cssHelper.propertyValue("chart-color-gray")]}]},this.pgStatusChartConfig={options:{events:[""]}},this.permissions=this.authStorageService.getPermissions(),this.enabledFeature$=this.featureToggles.get()}ngOnInit(){this.interval=this.refreshIntervalService.intervalData$.subscribe(()=>{this.getHealth()})}ngOnDestroy(){this.interval.unsubscribe()}getHealth(){this.healthService.getMinimalHealth().subscribe(e=>{this.healthData=e})}prepareReadWriteRatio(e){const t=[],n=[],i=this.healthData.client_perf.write_op_per_sec+this.healthData.client_perf.read_op_per_sec;t.push(`${"Reads"}: ${this.dimless.transform(this.healthData.client_perf.read_op_per_sec)} ${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.read_op_per_sec,i)),t.push(`${"Writes"}: ${this.dimless.transform(this.healthData.client_perf.write_op_per_sec)} ${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.write_op_per_sec,i)),e.labels=t,e.dataset[0].data=n,e.dataset[0].label=`${this.dimless.transform(i)}\n${"IOPS"}`}prepareClientThroughput(e){const t=[],n=[],i=this.healthData.client_perf.read_bytes_sec+this.healthData.client_perf.write_bytes_sec;t.push(`${"Reads"}: ${this.dimlessBinary.transform(this.healthData.client_perf.read_bytes_sec)}${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.read_bytes_sec,i)),t.push(`${"Writes"}: ${this.dimlessBinary.transform(this.healthData.client_perf.write_bytes_sec)}${"/s"}`),n.push(this.calcPercentage(this.healthData.client_perf.write_bytes_sec,i)),e.labels=t,e.dataset[0].data=n,e.dataset[0].label=`${this.dimlessBinary.transform(i).replace(" ","\n")}${"/s"}`}prepareRawUsage(e,t){const n=this.calcPercentage(t.df.stats.total_bytes-t.df.stats.total_used_raw_bytes,t.df.stats.total_bytes),i=this.calcPercentage(t.df.stats.total_used_raw_bytes,t.df.stats.total_bytes);e.dataset[0].data=[i,n],e.labels=[`${"Used"}: ${this.dimlessBinary.transform(t.df.stats.total_used_raw_bytes)}`,`${"Avail."}: ${this.dimlessBinary.transform(t.df.stats.total_bytes-t.df.stats.total_used_raw_bytes)}`],e.dataset[0].label=`${i}%\nof ${this.dimlessBinary.transform(t.df.stats.total_bytes)}`}preparePgStatus(e,t){const n={};let i=0;Wt.a.forEach(t.pg_info.statuses,(e,t)=>{const r=this.pgCategoryService.getTypeByStates(t);Wt.a.isUndefined(n[r])&&(n[r]=0),n[r]+=e,i+=e});for(const r of this.pgCategoryService.getAllTypes())Wt.a.isUndefined(n[r])&&(n[r]=0);e.dataset[0].data=this.pgCategoryService.getAllTypes().map(e=>this.calcPercentage(n[e],i)),e.labels=[`${"Clean"}: ${this.dimless.transform(n.clean)}`,`${"Working"}: ${this.dimless.transform(n.working)}`,`${"Warning"}: ${this.dimless.transform(n.warning)}`,`${"Unknown"}: ${this.dimless.transform(n.unknown)}`],e.dataset[0].label=`${i}\n${"PGs"}`}prepareObjects(e,t){const n=t.pg_info.object_stats.num_object_copies,i=this.calcPercentage(n-t.pg_info.object_stats.num_objects_misplaced-t.pg_info.object_stats.num_objects_degraded-t.pg_info.object_stats.num_objects_unfound,n),r=this.calcPercentage(t.pg_info.object_stats.num_objects_misplaced,n),s=this.calcPercentage(t.pg_info.object_stats.num_objects_degraded,n),o=this.calcPercentage(t.pg_info.object_stats.num_objects_unfound,n);e.labels=[`${"Healthy"}: ${i}%`,`${"Misplaced"}: ${r}%`,`${"Degraded"}: ${s}%`,`${"Unfound"}: ${o}%`],e.dataset[0].data=[i,r,s,o],e.dataset[0].label=`${this.dimless.transform(t.pg_info.object_stats.num_objects)}\n${"objects"}`}isClientReadWriteChartShowable(){return(this.healthData.client_perf.read_op_per_sec||0)+(this.healthData.client_perf.write_op_per_sec||0)>0}calcPercentage(e,t){return Wt.a.isNumber(e)&&Wt.a.isNumber(t)&&0!==t?Math.round(e/t*100):0}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Zh),r.Rb(Gt.a),r.Rb(Qh.a),r.Rb(tf.a),r.Rb(Gh),r.Rb(Qt.a),r.Rb(Zt.a),r.Rb(ef.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-health"]],decls:2,vars:3,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y;return e="Status",t="Capacity",n="Performance",i="Cluster Status",r="Hosts",s="Monitors",o="OSDs",a="Managers",c="Object Gateways",l="Metadata Servers",u="iSCSI Gateways",d="Raw Capacity",h="Objects",f="PG Status",p="Pools",m="PGs per OSD",b="Client Read/Write",g="Client Throughput",_="Recovery Throughput",v="Scrubbing",y="" + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + " See " + "\ufffd#4\ufffd" + "Logs" + "\ufffd/#4\ufffd" + " for more details.",[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],["groupTitle",e,4,"ngIf"],["groupTitle",t,4,"ngIf"],["groupTitle",n,4,"ngIf"],["logsLink",""],["groupTitle",e],["cardTitle",i,"class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",r,"link","/hosts","class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",s,"link","/monitor","class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",o,"link","/osd","class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",a,"class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",c,"link","/rgw/daemon","class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",l,"class","cd-status-card",3,"contentClass",4,"ngIf"],["cardTitle",u,"link","/block/iscsi","class","cd-status-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",i,"contentClass","content-highlight",1,"cd-status-card"],[4,"ngIf"],["healthChecks",""],["popoverClass","info-card-popover-cluster-status",1,"info-card-content-clickable",3,"ngStyle","ngbPopover"],["class","fa fa-exclamation-triangle",4,"ngIf"],[4,"ngTemplateOutlet"],[4,"ngFor","ngForOf"],[3,"ngStyle"],[1,"fa","fa-exclamation-triangle"],["cardTitle",r,"link","/hosts","contentClass","content-highlight",1,"cd-status-card"],["cardTitle",s,"link","/monitor","contentClass","content-highlight",1,"cd-status-card"],["cardTitle",o,"link","/osd","contentClass","content-highlight",1,"cd-status-card"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],["cardTitle",a,"contentClass","content-highlight",1,"cd-status-card"],[3,"ngClass","title",4,"ngFor","ngForOf"],[3,"ngClass","title"],["cardTitle",c,"link","/rgw/daemon","contentClass","content-highlight",1,"cd-status-card"],["cardTitle",l,1,"cd-status-card",3,"contentClass"],["cardTitle",u,"link","/block/iscsi","contentClass","content-highlight",1,"cd-status-card"],[1,"card-text-line-break"],["groupTitle",t],["cardTitle",d,"class","cd-capacity-card cd-chart-card","contentClass","content-chart",4,"ngIf"],["cardTitle",h,"class","cd-capacity-card cd-chart-card","contentClass","content-chart",4,"ngIf"],["cardTitle",f,"class","cd-capacity-card cd-chart-card","contentClass","content-chart",4,"ngIf"],["cardTitle",p,"link","/pool","class","cd-capacity-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",m,"class","cd-capacity-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",d,"contentClass","content-chart",1,"cd-capacity-card","cd-chart-card"],[3,"data","config","isBytesData","prepareFn"],["cardTitle",h,"contentClass","content-chart",1,"cd-capacity-card","cd-chart-card"],[3,"data","prepareFn"],["cardTitle",f,"contentClass","content-chart",1,"cd-capacity-card","cd-chart-card"],["pgStatus",""],[1,"pg-status-popover-wrapper"],[3,"ngbPopover"],[3,"data","config","prepareFn"],["cardTitle",p,"link","/pool","contentClass","content-highlight",1,"cd-capacity-card"],["cardTitle",m,"contentClass","content-highlight",1,"cd-capacity-card"],["groupTitle",n],["cardTitle",b,"class","cd-performance-card cd-chart-card","contentClass","content-chart",4,"ngIf"],["cardTitle",g,"class","cd-performance-card cd-chart-card","contentClass","content-chart",4,"ngIf"],["cardTitle",_,"class","cd-performance-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",v,"class","cd-performance-card","contentClass","content-highlight",4,"ngIf"],["cardTitle",b,"contentClass","content-chart",1,"cd-performance-card","cd-chart-card"],["cardTitle",g,"contentClass","content-chart",1,"cd-performance-card","cd-chart-card"],["cardTitle",_,"contentClass","content-highlight",1,"cd-performance-card"],["cardTitle",v,"contentClass","content-highlight",1,"cd-performance-card"],[1,"logs-link"],y,["routerLink","/logs"]]},template:function(e,t){1&e&&(r.Pc(0,ip,6,3,"div",0),r.oc(1,"async")),2&e&&r.uc("ngIf",r.pc(1,1,t.healthData&&t.enabledFeature$))},directives:[s.r,of,uf,s.s,Jt.w,s.w,s.q,s.p,pf,Pt.h],pipes:[s.b,mf,bf,_f,vf,yf,s.k,Zt.a,Qt.a],styles:['cd-info-card[_ngcontent-%COMP%]{padding:0 .5vw}  cd-health .pg-status-popover-wrapper{position:relative}  cd-health .pg-status-popover-wrapper .popover{max-height:20vh;max-width:unset!important;min-width:unset!important;position:absolute;width:116%}  cd-health .pg-status-popover-wrapper .popover .popover-body{font-size:1rem;max-height:19vh;max-width:100%}.logs-link[_ngcontent-%COMP%]{text-align:center}.card-text-error[_ngcontent-%COMP%]{color:#ef5c55;display:inline}.card-text-line-break[_ngcontent-%COMP%]:after{content:"\\a";white-space:pre}.popover-info[_ngcontent-%COMP%]:hover{cursor:pointer}']}),e})();function sp(e,t){1&e&&r.Sb(0,"cd-health")}function op(e,t){}function ap(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",1,2),r.Xb(3,"li",3),r.Xb(4,"a",4),r.bc(5,5),r.Wb(),r.Pc(6,sp,1,0,"ng-template",6),r.Wb(),r.Xb(7,"li",3),r.Xb(8,"a",4),r.bc(9,7),r.Wb(),r.Pc(10,op,0,0,"ng-template",6),r.Wb(),r.Wb(),r.Sb(11,"div",8),r.Ub()),2&e){const e=r.Fc(2);r.Db(11),r.uc("ngbNavOutlet",e)}}function cp(e,t){1&e&&r.Sb(0,"cd-health")}let lp=(()=>{class e{constructor(){this.hasGrafana=!1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-dashboard"]],decls:4,vars:2,consts:function(){let e,t;return e="Health",t="Statistics",[[4,"ngIf"],["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e,["ngbNavContent",""],t,[3,"ngbNavOutlet"]]},template:function(e,t){1&e&&(r.Xb(0,"div"),r.Sb(1,"cd-refresh-selector"),r.Pc(2,ap,12,1,"ng-container",0),r.Pc(3,cp,1,0,"cd-health",0),r.Wb()),2&e&&(r.Db(2),r.uc("ngIf",t.hasGrafana),r.Db(1),r.uc("ngIf",!t.hasGrafana))},directives:[Kh,s.r,Jt.p,Jt.r,Jt.s,Jt.q,Jt.u,rp],styles:["div[_ngcontent-%COMP%]{padding-top:20px}"]}),e})();var up=n("JIr8"),dp=n("z6cu");let hp=(()=>{class e extends zi.a{constructor(e){super(),this.http=e,this.apiPath="api/nfs-ganesha",this.uiApiPath="ui-api/nfs-ganesha",this.nfsAccessType=[{value:"RW",help:"Allows all operations"},{value:"RO",help:"Allows only operations that do not modify the server"},{value:"NONE",help:"Allows no access at all"}],this.nfsFsal=[{value:"CEPH",descr:"CephFS",disabled:!1},{value:"RGW",descr:"Object Gateway",disabled:!1}],this.nfsSquash=["no_root_squash","root_id_squash","root_squash","all_squash"]}list(){return this.http.get(`${this.apiPath}/export`)}get(e,t){return this.http.get(`${this.apiPath}/export/${e}/${t}`)}create(e){return this.http.post(`${this.apiPath}/export`,e,{headers:{Accept:this.getVersionHeaderValue(2,0)},observe:"response"})}update(e,t,n){return this.http.put(`${this.apiPath}/export/${e}/${t}`,n,{headers:{Accept:this.getVersionHeaderValue(2,0)},observe:"response"})}delete(e,t){return this.http.delete(`${this.apiPath}/export/${e}/${t}`,{headers:{Accept:this.getVersionHeaderValue(2,0)},observe:"response"})}listClusters(){return this.http.get(`${this.apiPath}/cluster`,{headers:{Accept:this.getVersionHeaderValue(0,1)}})}lsDir(e,t){return e?this.http.get(`${this.uiApiPath}/lsdir/${e}?root_dir=${t}`):Object(dp.a)("Please specify a filesystem volume.")}fsals(){return this.http.get(`${this.uiApiPath}/fsals`)}filesystems(){return this.http.get(`${this.uiApiPath}/cephfs/filesystems`)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var fp=n("6HA4"),pp=n("eCU+"),mp=n("TYzs");const bp=["squashHelper"];function gp(e,t){1&e&&(r.Xb(0,"span",14),r.Xb(1,"span",15),r.bc(2,16),r.Wb(),r.Wb())}function _p(e,t){1&e&&(r.Xb(0,"span"),r.bc(1,37),r.Wb())}function vp(e,t){1&e&&(r.Xb(0,"span"),r.Vb(1),r.bc(2,38),r.Ub(),r.Sb(3,"br"),r.Vb(4),r.bc(5,39),r.Ub(),r.Rc(6," 192.168.0.10, 192.168.1.0/8 "),r.Wb())}function yp(e,t){if(1&e&&(r.Xb(0,"option",40),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.value),r.Db(1),r.Sc(e.value)}}function wp(e,t){if(1&e&&(r.Xb(0,"span",15),r.Rc(1),r.Wb()),2&e){const e=r.nc().index,t=r.nc();r.Db(1),r.Tc(" ",t.getAccessTypeHelp(e)," ")}}function Dp(e,t){1&e&&r.Tb(0)}function Sp(e,t){if(1&e&&(r.Xb(0,"option",40),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e),r.Db(1),r.Sc(e)}}function xp(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div"),r.Xb(1,"div",17),r.Xb(2,"div",18),r.Rc(3),r.oc(4,"ordinal"),r.Xb(5,"span",19),r.lc("click",function(){r.Ic(e);const n=t.index;return r.nc().removeClient(n)}),r.Rc(6,"\xd7"),r.Wb(),r.Wb(),r.Xb(7,"div",20),r.Xb(8,"div",0),r.Xb(9,"label",21),r.bc(10,22),r.Wb(),r.Xb(11,"div",23),r.Sb(12,"input",24),r.Xb(13,"span",25),r.Pc(14,_p,2,0,"span",26),r.Pc(15,vp,7,0,"span",26),r.Wb(),r.Wb(),r.Wb(),r.Xb(16,"div",0),r.Xb(17,"label",27),r.bc(18,28),r.Wb(),r.Xb(19,"div",23),r.Xb(20,"select",29),r.Xb(21,"option",30),r.Rc(22),r.Wb(),r.Pc(23,yp,2,2,"option",31),r.Wb(),r.Pc(24,wp,2,1,"span",32),r.Wb(),r.Wb(),r.Xb(25,"div",0),r.Xb(26,"label",33),r.Xb(27,"span"),r.bc(28,34),r.Wb(),r.Pc(29,Dp,1,0,"ng-container",35),r.Wb(),r.Xb(30,"div",23),r.Xb(31,"select",36),r.Xb(32,"option",30),r.Rc(33),r.Wb(),r.Pc(34,Sp,2,2,"option",31),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=t.$implicit,n=t.index,i=r.nc(),s=r.Fc(4);r.Db(1),r.uc("formGroup",e),r.Db(2),r.Tc(" ",r.pc(4,10,n+1)," "),r.Db(11),r.uc("ngIf",i.showError(n,"addresses",s,"required")),r.Db(1),r.uc("ngIf",i.showError(n,"addresses",s,"pattern")),r.Db(7),r.Sc(i.getNoAccessTypeDescr()),r.Db(1),r.uc("ngForOf",i.nfsAccessType),r.Db(1),r.uc("ngIf",i.getValue(n,"access_type")),r.Db(5),r.uc("ngTemplateOutlet",i.squashHelperTpl),r.Db(4),r.Sc(i.getNoSquashDescr()),r.Db(1),r.uc("ngForOf",i.nfsSquash)}}const kp=function(e){return[e]};let Tp=(()=>{class e{constructor(e){this.nfsService=e,this.nfsSquash=this.nfsService.nfsSquash,this.nfsAccessType=this.nfsService.nfsAccessType,this.icons=_n.a}ngOnInit(){Wt.a.forEach(this.clients,e=>{this.addClient().patchValue(e)}),this.clientsFormArray=this.form.get("clients")}getNoAccessTypeDescr(){return this.form.getValue("access_type")?`${this.form.getValue("access_type")} ${"(inherited from global config)"}`:"-- Select the access type --"}getAccessTypeHelp(e){const t=this.nfsAccessType.find(t=>this.getValue(e,"access_type")===t.value);return Wt.a.isObjectLike(t)?t.help:""}getNoSquashDescr(){return this.form.getValue("squash")?`${this.form.getValue("squash")} (${"inherited from global config"})`:"-- Select what kind of user id squashing is performed --"}addClient(){this.clientsFormArray=this.form.get("clients");const e="(([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3}).([0-9]{1,3})([/](\\d|[1-2]\\d|3[0-2]))?)",t=new Gn.a({addresses:new xn.h("",{validators:[xn.A.required,xn.A.pattern(`${e}([ ,]{1,2}${e})*`)]}),access_type:new xn.h(""),squash:new xn.h("")});return this.clientsFormArray.push(t),t}removeClient(e){this.clientsFormArray=this.form.get("clients"),this.clientsFormArray.removeAt(e)}showError(e,t,n,i){return this.form.controls.clients.controls[e].showError(t,n,i)}getValue(e,t){return this.clientsFormArray=this.form.get("clients"),this.clientsFormArray.at(e).getValue(t)}trackByFn(e){return e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(hp))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-nfs-form-client"]],contentQueries:function(e,t,n){if(1&e&&r.Kb(n,bp,3),2&e){let e;r.Ec(e=r.mc())&&(t.squashHelperTpl=e.first)}},inputs:{form:"form",clients:"clients"},decls:15,vars:7,consts:function(){let e,t,n,i,r,s,o,a,c;return e="Clients",t="Add clients",n="Any client can access",i="Addresses",r="Access Type",s="Squash",o="This field is required.",a="Must contain one or more comma-separated values",c="For example:",[[1,"form-group","row"],[1,"cd-col-form-label"],e,[1,"cd-col-form-input",3,"formGroup"],["formDir","ngForm"],["class","no-border text-muted",4,"ngIf"],["formArrayName","clients"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"row"],[1,"col-12"],[1,"float-right"],["name","add_client",1,"btn","btn-light",3,"click"],[3,"ngClass"],t,[1,"no-border","text-muted"],[1,"form-text","text-muted"],n,[1,"card",3,"formGroup"],[1,"card-header"],["name","remove_client","ngbTooltip","Remove",1,"float-right","clickable",3,"click"],[1,"card-body"],["for","addresses",1,"cd-col-form-label","required"],i,[1,"cd-col-form-input"],["type","text","name","addresses","id","addresses","formControlName","addresses","placeholder","192.168.0.10, 192.168.1.0/8",1,"form-control"],[1,"invalid-feedback"],[4,"ngIf"],["for","access_type",1,"cd-col-form-label"],r,["name","access_type","id","access_type","formControlName","access_type",1,"form-control","custom-select"],["value",""],[3,"value",4,"ngFor","ngForOf"],["class","form-text text-muted",4,"ngIf"],["for","squash",1,"cd-col-form-label"],s,[4,"ngTemplateOutlet"],["name","squash","id","squash","formControlName","squash",1,"form-control","custom-select"],o,a,c,[3,"value"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"label",1),r.bc(2,2),r.Wb(),r.Xb(3,"div",3,4),r.Pc(5,gp,3,0,"span",5),r.Vb(6,6),r.Pc(7,xp,35,12,"div",7),r.Ub(),r.Xb(8,"div",8),r.Xb(9,"div",9),r.Xb(10,"div",10),r.Xb(11,"button",11),r.lc("click",function(){return t.addClient()}),r.Sb(12,"i",12),r.Vb(13),r.bc(14,13),r.Ub(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(3),r.uc("formGroup",t.form),r.Db(2),r.uc("ngIf",0===t.form.get("clients").value.length),r.Db(2),r.uc("ngForOf",t.clientsFormArray.controls)("ngForTrackBy",t.trackByFn),r.Db(5),r.uc("ngClass",r.zc(5,kp,t.icons.add)))},directives:[Zn.a,xn.r,xn.k,Qn.a,s.r,xn.f,s.q,On.a,s.p,Jt.D,xn.d,ei.a,xn.q,xn.i,xn.z,xn.u,xn.C,s.w],pipes:[mp.a],styles:[""]}),e})();const Mp=["nfsClients"];function Cp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,53),r.Wb())}function Op(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,54),r.Wb())}function Lp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,55),r.Wb())}function Ep(e,t){if(1&e&&(r.Xb(0,"option",56),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.cluster_id),r.Db(1),r.Sc(e.cluster_id)}}const Ap=function(){return["create"]},Ip=function(e){return{modal:e}},Rp=function(e){return{outlets:e}},Pp=function(e){return["/services",e]};function Fp(e,t){1&e&&(r.Xb(0,"span",57),r.hc(1,58),r.Sb(2,"a",59),r.ec(),r.Wb()),2&e&&(r.Db(2),r.uc("routerLink",r.zc(6,Pp,r.zc(4,Rp,r.zc(2,Ip,r.yc(1,Ap))))))}function Wp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,60),r.Wb())}function jp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,61),r.Wb())}function Yp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,62),r.Wb())}function Np(e,t){if(1&e&&(r.Xb(0,"option",63),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.value)("disabled",e.disabled),r.Db(1),r.Sc(e.descr)}}function zp(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,64),r.Wb())}function $p(e,t){if(1&e&&(r.Xb(0,"span",57),r.bc(1,65),r.Wb()),2&e){const e=r.nc(2);r.Db(1),r.fc(e.fsalAvailabilityError),r.cc(1)}}function Hp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,69),r.Wb())}function Xp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,70),r.Wb())}function Vp(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,71),r.Wb())}function Bp(e,t){if(1&e&&(r.Xb(0,"option",56),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.name),r.Db(1),r.Sc(e.name)}}function Up(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,72),r.Wb())}function qp(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",8),r.Xb(1,"label",66),r.bc(2,67),r.Wb(),r.Xb(3,"div",13),r.Xb(4,"select",68),r.lc("change",function(){return r.Ic(e),r.nc(2).pathChangeHandler()}),r.Pc(5,Hp,2,0,"option",15),r.Pc(6,Xp,2,0,"option",15),r.Pc(7,Vp,2,0,"option",15),r.Pc(8,Bp,2,2,"option",16),r.Wb(),r.Pc(9,Up,2,0,"span",17),r.Wb(),r.Wb()}if(2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(5),r.uc("ngIf",null===t.allFsNames),r.Db(1),r.uc("ngIf",null!==t.allFsNames&&0===t.allFsNames.length),r.Db(1),r.uc("ngIf",null!==t.allFsNames&&t.allFsNames.length>0),r.Db(1),r.uc("ngForOf",t.allFsNames),r.Db(1),r.uc("ngIf",t.nfsForm.showError("fs_name",e,"required"))}}function Gp(e,t){1&e&&r.Sb(0,"input",79)}function Jp(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,80),r.Wb())}const Kp=function(e){return{required:e}};function Qp(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",73),r.bc(2,74),r.Wb(),r.Xb(3,"div",13),r.Xb(4,"div",26),r.Sb(5,"input",75),r.Xb(6,"label",76),r.bc(7,77),r.Wb(),r.Wb(),r.Sb(8,"br"),r.Pc(9,Gp,1,0,"input",78),r.Pc(10,Jp,2,0,"span",17),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(1),r.uc("ngClass",r.zc(3,Kp,t.nfsForm.getValue("security_label"))),r.Db(8),r.uc("ngIf",t.nfsForm.getValue("security_label")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("sec_label_xattr",e,"required"))}}function Zp(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,85),r.Wb())}function em(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,86),r.Wb())}function tm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,87),r.Wb())}function nm(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",8),r.Xb(1,"label",81),r.Xb(2,"span",10),r.bc(3,82),r.Wb(),r.Xb(4,"cd-helper"),r.Xb(5,"p"),r.bc(6,83),r.Wb(),r.Wb(),r.Wb(),r.Xb(7,"div",13),r.Xb(8,"input",84),r.lc("selectItem",function(){return r.Ic(e),r.nc(2).pathChangeHandler()})("blur",function(){return r.Ic(e),r.nc(2).pathChangeHandler()}),r.Wb(),r.Pc(9,Zp,2,0,"span",17),r.Pc(10,em,2,0,"span",17),r.Pc(11,tm,2,0,"span",17),r.Wb(),r.Wb()}if(2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(8),r.uc("ngbTypeahead",t.pathDataSource),r.Db(1),r.uc("ngIf",t.nfsForm.showError("path",e,"required")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("path",e,"pattern")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("path",e,"pathNameNotAllowed"))}}function im(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,90),r.Wb())}function rm(e,t){1&e&&(r.Xb(0,"span",57),r.hc(1,91),r.Sb(2,"a",92),r.ec(),r.Wb())}function sm(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",81),r.Xb(2,"span",10),r.bc(3,88),r.Wb(),r.Wb(),r.Xb(4,"div",13),r.Sb(5,"input",89),r.Pc(6,im,2,0,"span",17),r.Pc(7,rm,3,0,"span",17),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(5),r.uc("ngbTypeahead",t.bucketDataSource),r.Db(1),r.uc("ngIf",t.nfsForm.showError("path",e,"required")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("path",e,"bucketNameNotAllowed"))}}function om(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,93),r.Wb())}function am(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,99),r.Wb())}function cm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,100),r.Wb())}function lm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,101),r.Wb())}function um(e,t){if(1&e&&(r.Xb(0,"div",8),r.Xb(1,"label",94),r.Xb(2,"span",10),r.bc(3,95),r.Wb(),r.Xb(4,"cd-helper"),r.Xb(5,"p"),r.hc(6,96),r.Sb(7,"strong"),r.Sb(8,"strong"),r.ec(),r.Wb(),r.Xb(9,"p"),r.bc(10,97),r.Wb(),r.Wb(),r.Wb(),r.Xb(11,"div",13),r.Sb(12,"input",98),r.Pc(13,am,2,0,"span",17),r.Pc(14,cm,2,0,"span",17),r.Pc(15,lm,2,0,"span",17),r.Wb(),r.Wb()),2&e){r.nc();const e=r.Fc(2),t=r.nc();r.Db(13),r.uc("ngIf",t.nfsForm.showError("pseudo",e,"required")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("pseudo",e,"pseudoAlreadyExists")),r.Db(1),r.uc("ngIf",t.nfsForm.showError("pseudo",e,"pattern"))}}function dm(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,102),r.Wb())}function hm(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,103),r.Wb())}function fm(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,104),r.Wb())}function pm(e,t){if(1&e&&(r.Xb(0,"option",56),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e.value),r.Db(1),r.Sc(e.value)}}function mm(e,t){if(1&e&&(r.Xb(0,"span",105),r.Rc(1),r.Wb()),2&e){const e=r.nc(2);r.Db(1),r.Tc(" ",e.getAccessTypeHelp(e.nfsForm.getValue("access_type"))," ")}}function bm(e,t){1&e&&(r.Xb(0,"span",106),r.hc(1,107),r.Sb(2,"cd-doc",108),r.ec(),r.Wb())}function gm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,109),r.Wb())}function _m(e,t){1&e&&r.Tb(0)}function vm(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,110),r.Wb())}function ym(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,111),r.Wb())}function wm(e,t){1&e&&(r.Xb(0,"option",52),r.bc(1,112),r.Wb())}function Dm(e,t){if(1&e&&(r.Xb(0,"option",56),r.Rc(1),r.Wb()),2&e){const e=t.$implicit;r.uc("value",e),r.Db(1),r.Sc(e)}}function Sm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,113),r.Wb())}function xm(e,t){1&e&&(r.Xb(0,"span",57),r.bc(1,114),r.Wb())}function km(e,t){1&e&&(r.Xb(0,"cd-helper"),r.Xb(1,"ul",115),r.Xb(2,"li"),r.Xb(3,"span",116),r.Rc(4,"no_root_squash: "),r.Wb(),r.Xb(5,"span"),r.bc(6,117),r.Wb(),r.Wb(),r.Xb(7,"li"),r.Xb(8,"span",116),r.Rc(9,"root_id_squash: "),r.Wb(),r.Xb(10,"span"),r.bc(11,118),r.Wb(),r.Wb(),r.Xb(12,"li"),r.Xb(13,"span",116),r.Rc(14,"root_squash: "),r.Wb(),r.Xb(15,"span"),r.bc(16,119),r.Wb(),r.Wb(),r.Xb(17,"li"),r.Xb(18,"span",116),r.Rc(19,"all_squash: "),r.Wb(),r.Xb(20,"span"),r.bc(21,120),r.Wb(),r.Wb(),r.Wb(),r.Wb())}function Tm(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",1),r.Xb(1,"form",2,3),r.Xb(3,"div",4),r.Xb(4,"div",5),r.bc(5,6),r.oc(6,"titlecase"),r.oc(7,"upperFirst"),r.Wb(),r.Xb(8,"div",7),r.Xb(9,"div",8),r.Xb(10,"label",9),r.Xb(11,"span",10),r.bc(12,11),r.Wb(),r.Xb(13,"cd-helper"),r.Xb(14,"p"),r.bc(15,12),r.Wb(),r.Wb(),r.Wb(),r.Xb(16,"div",13),r.Xb(17,"select",14),r.Pc(18,Cp,2,0,"option",15),r.Pc(19,Op,2,0,"option",15),r.Pc(20,Lp,2,0,"option",15),r.Pc(21,Ep,2,2,"option",16),r.Wb(),r.Pc(22,Fp,3,8,"span",17),r.Wb(),r.Wb(),r.Xb(23,"div",18),r.Xb(24,"div",8),r.Xb(25,"label",19),r.bc(26,20),r.Wb(),r.Xb(27,"div",13),r.Xb(28,"select",21),r.lc("change",function(){return r.Ic(e),r.nc().fsalChangeHandler()}),r.Pc(29,Wp,2,0,"option",15),r.Pc(30,jp,2,0,"option",15),r.Pc(31,Yp,2,0,"option",15),r.Pc(32,Np,2,3,"option",22),r.Wb(),r.Pc(33,zp,2,0,"span",17),r.Pc(34,$p,2,1,"span",17),r.Wb(),r.Wb(),r.Pc(35,qp,10,5,"div",23),r.Wb(),r.Pc(36,Qp,11,5,"div",23),r.Pc(37,nm,12,4,"div",23),r.Pc(38,sm,8,3,"div",23),r.Xb(39,"div",8),r.Xb(40,"label",24),r.bc(41,25),r.Wb(),r.Xb(42,"div",13),r.Xb(43,"div",26),r.Sb(44,"input",27),r.Xb(45,"label",28),r.bc(46,29),r.Wb(),r.Wb(),r.Pc(47,om,2,0,"span",17),r.Wb(),r.Wb(),r.Pc(48,um,16,3,"div",23),r.Xb(49,"div",8),r.Xb(50,"label",30),r.bc(51,31),r.Wb(),r.Xb(52,"div",13),r.Xb(53,"select",32),r.lc("change",function(){return r.Ic(e),r.nc().accessTypeChangeHandler()}),r.Pc(54,dm,2,0,"option",15),r.Pc(55,hm,2,0,"option",15),r.Pc(56,fm,2,0,"option",15),r.Pc(57,pm,2,2,"option",16),r.Wb(),r.Pc(58,mm,2,1,"span",33),r.Pc(59,bm,3,0,"span",34),r.Pc(60,gm,2,0,"span",17),r.Wb(),r.Wb(),r.Xb(61,"div",8),r.Xb(62,"label",35),r.Xb(63,"span",10),r.bc(64,36),r.Wb(),r.Pc(65,_m,1,0,"ng-container",37),r.Wb(),r.Xb(66,"div",13),r.Xb(67,"select",38),r.Pc(68,vm,2,0,"option",15),r.Pc(69,ym,2,0,"option",15),r.Pc(70,wm,2,0,"option",15),r.Pc(71,Dm,2,2,"option",16),r.Wb(),r.Pc(72,Sm,2,0,"span",17),r.Wb(),r.Wb(),r.Xb(73,"div",8),r.Xb(74,"label",39),r.bc(75,40),r.Wb(),r.Xb(76,"div",13),r.Xb(77,"div",26),r.Sb(78,"input",41),r.Xb(79,"label",42),r.bc(80,43),r.Wb(),r.Wb(),r.Xb(81,"div",26),r.Sb(82,"input",44),r.Xb(83,"label",45),r.bc(84,46),r.Wb(),r.Wb(),r.Pc(85,xm,2,0,"span",17),r.Sb(86,"hr"),r.Wb(),r.Wb(),r.Xb(87,"cd-nfs-form-client",47,48),r.Pc(89,km,22,0,"ng-template",null,49,r.Qc),r.Wb(),r.Wb(),r.Xb(91,"div",50),r.Xb(92,"cd-form-button-panel",51),r.lc("submitActionEvent",function(){return r.Ic(e),r.nc().submitAction()}),r.oc(93,"titlecase"),r.oc(94,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(2),t=r.Fc(90),n=r.nc();r.Db(1),r.uc("formGroup",n.nfsForm),r.Db(6),r.fc(r.pc(6,38,n.action))(r.pc(7,40,n.resource)),r.cc(5),r.Db(11),r.uc("ngIf",null===n.allClusters),r.Db(1),r.uc("ngIf",null!==n.allClusters&&0===n.allClusters.length),r.Db(1),r.uc("ngIf",null!==n.allClusters&&n.allClusters.length>0),r.Db(1),r.uc("ngForOf",n.allClusters),r.Db(1),r.uc("ngIf",n.nfsForm.showError("cluster_id",e,"required")||0===(null==n.allClusters?null:n.allClusters.length)),r.Db(7),r.uc("ngIf",null===n.allFsals),r.Db(1),r.uc("ngIf",null!==n.allFsals&&0===n.allFsals.length),r.Db(1),r.uc("ngIf",null!==n.allFsals&&n.allFsals.length>0),r.Db(1),r.uc("ngForOf",n.allFsals),r.Db(1),r.uc("ngIf",n.nfsForm.showError("name",e,"required")),r.Db(1),r.uc("ngIf",n.fsalAvailabilityError),r.Db(1),r.uc("ngIf","CEPH"===n.nfsForm.getValue("name")),r.Db(1),r.uc("ngIf","CEPH"===n.nfsForm.getValue("name")),r.Db(1),r.uc("ngIf","CEPH"===n.nfsForm.getValue("name")),r.Db(1),r.uc("ngIf","RGW"===n.nfsForm.getValue("name")),r.Db(9),r.uc("ngIf",n.nfsForm.showError("protocolNfsv4",e,"required")),r.Db(1),r.uc("ngIf",n.nfsForm.getValue("protocolNfsv4")),r.Db(6),r.uc("ngIf",null===n.nfsAccessType),r.Db(1),r.uc("ngIf",null!==n.nfsAccessType&&0===n.nfsAccessType.length),r.Db(1),r.uc("ngIf",null!==n.nfsAccessType&&n.nfsAccessType.length>0),r.Db(1),r.uc("ngForOf",n.nfsAccessType),r.Db(1),r.uc("ngIf",n.nfsForm.getValue("access_type")),r.Db(1),r.uc("ngIf","RW"===n.nfsForm.getValue("access_type")&&"RGW"===n.nfsForm.getValue("name")),r.Db(1),r.uc("ngIf",n.nfsForm.showError("access_type",e,"required")),r.Db(5),r.uc("ngTemplateOutlet",t),r.Db(3),r.uc("ngIf",null===n.nfsSquash),r.Db(1),r.uc("ngIf",null!==n.nfsSquash&&0===n.nfsSquash.length),r.Db(1),r.uc("ngIf",null!==n.nfsSquash&&n.nfsSquash.length>0),r.Db(1),r.uc("ngForOf",n.nfsSquash),r.Db(1),r.uc("ngIf",n.nfsForm.showError("squash",e,"required")),r.Db(13),r.uc("ngIf",n.nfsForm.showError("transportUDP",e,"required")||n.nfsForm.showError("transportTCP",e,"required")),r.Db(2),r.uc("form",n.nfsForm)("clients",n.clients),r.Db(5),r.uc("form",n.nfsForm)("submitText",r.pc(93,42,n.action)+" "+r.pc(94,44,n.resource))}}let Mm=(()=>{class e extends qn.a{constructor(e,t,n,i,r,s,o,a,c,l){super(),this.authStorageService=e,this.nfsService=t,this.route=n,this.router=i,this.rgwBucketService=r,this.rgwSiteService=s,this.formBuilder=o,this.taskWrapper=a,this.cdRef=c,this.actionLabels=l,this.clients=[],this.isEdit=!1,this.cluster_id=null,this.export_id=null,this.allClusters=null,this.icons=_n.a,this.allFsals=[],this.allFsNames=null,this.fsalAvailabilityError=null,this.defaultAccessType={RGW:"RO"},this.nfsAccessType=this.nfsService.nfsAccessType,this.nfsSquash=this.nfsService.nfsSquash,this.pathDataSource=e=>e.pipe(oa(200),Object(ua.a)(),Object(Ni.a)(e=>this.getPathTypeahead(e)),Object(Ii.a)(e=>e)),this.bucketDataSource=e=>e.pipe(oa(200),Object(ua.a)(),Object(Ni.a)(e=>this.getBucketTypeahead(e))),this.permission=this.authStorageService.getPermissions().pool,this.resource="NFS export",this.createForm()}ngOnInit(){const e=[this.nfsService.listClusters(),this.nfsService.fsals(),this.nfsService.filesystems()];this.router.url.startsWith("/nfs/edit")&&(this.isEdit=!0),this.isEdit?(this.action=this.actionLabels.EDIT,this.route.params.subscribe(t=>{this.cluster_id=decodeURIComponent(t.cluster_id),this.export_id=decodeURIComponent(t.export_id),e.push(this.nfsService.get(this.cluster_id,this.export_id)),this.getData(e)}),this.nfsForm.get("cluster_id").disable()):(this.action=this.actionLabels.CREATE,this.getData(e))}getData(e){Object(Oi.a)(e).subscribe(e=>{this.resolveClusters(e[0]),this.resolveFsals(e[1]),this.resolveFilesystems(e[2]),e[3]&&this.resolveModel(e[3]),this.loadingReady()})}createForm(){this.nfsForm=new Gn.a({cluster_id:new xn.h("",{validators:[xn.A.required]}),fsal:new Gn.a({name:new xn.h("",{validators:[xn.A.required]}),fs_name:new xn.h("",{validators:[Cn.a.requiredIf({name:"CEPH"})]})}),path:new xn.h("/"),protocolNfsv4:new xn.h(!0),pseudo:new xn.h("",{validators:[Cn.a.requiredIf({protocolNfsv4:!0}),xn.A.pattern("^/[^><|&()]*$")]}),access_type:new xn.h("RW",{validators:[xn.A.required]}),squash:new xn.h(this.nfsSquash[0],{validators:[xn.A.required]}),transportUDP:new xn.h(!0,{validators:[Cn.a.requiredIf({transportTCP:!1},e=>!e)]}),transportTCP:new xn.h(!0,{validators:[Cn.a.requiredIf({transportUDP:!1},e=>!e)]}),clients:this.formBuilder.array([]),security_label:new xn.h(!1),sec_label_xattr:new xn.h("security.selinux",Cn.a.requiredIf({security_label:!0,"fsal.name":"CEPH"}))})}resolveModel(e){"CEPH"===e.fsal.name&&(e.sec_label_xattr=e.fsal.sec_label_xattr),e.protocolNfsv4=-1!==e.protocols.indexOf(4),delete e.protocols,e.transportTCP=-1!==e.transports.indexOf("TCP"),e.transportUDP=-1!==e.transports.indexOf("UDP"),delete e.transports,e.clients.forEach(e=>{let t="";e.addresses.forEach(e=>{t+=e+", "}),t.length>=2&&(t=t.substring(0,t.length-2)),e.addresses=t}),this.nfsForm.patchValue(e),this.setPathValidation(),this.clients=e.clients}resolveClusters(e){this.allClusters=[];for(const t of e)this.allClusters.push({cluster_id:t});!this.isEdit&&this.allClusters.length>0&&this.nfsForm.get("cluster_id").setValue(this.allClusters[0].cluster_id)}resolveFsals(e){e.forEach(e=>{const t=this.nfsService.nfsFsal.find(t=>e===t.value);Wt.a.isObjectLike(t)&&this.allFsals.push(t)}),!this.isEdit&&this.allFsals.length>0&&this.nfsForm.patchValue({fsal:{name:this.allFsals[0].value}})}resolveFilesystems(e){this.allFsNames=e,!this.isEdit&&e.length>0&&this.nfsForm.patchValue({fsal:{fs_name:e[0].name}})}fsalChangeHandler(){this.setPathValidation();const e=this.nfsForm.getValue("name");("RGW"===e?this.rgwSiteService.get("realms").pipe(Object(Ni.a)(e=>0===e.length?Object(Ai.a)(!0):this.rgwSiteService.isDefaultRealm().pipe(Object(Ni.a)(e=>{if(!e)throw new Error("Selected realm is not the default.");return Object(Ai.a)(!0)})))):this.nfsService.filesystems()).subscribe({next:()=>{this.setFsalAvailability(e,!0),this.isEdit||this.nfsForm.patchValue({path:"RGW"===e?"":"/",pseudo:this.generatePseudo(),access_type:this.updateAccessType()}),this.cdRef.detectChanges()},error:t=>{this.setFsalAvailability(e,!1,t),this.nfsForm.get("name").setValue("")}})}setFsalAvailability(e,t,n=""){this.allFsals=this.allFsals.map(i=>(i.value===e&&(i.disabled=!t,this.fsalAvailabilityError=i.disabled?"" + i.descr + " backend is not available. " + n + "":null),i))}accessTypeChangeHandler(){const e=this.nfsForm.getValue("name"),t=this.nfsForm.getValue("access_type");this.defaultAccessType[e]=t}setPathValidation(){const e=this.nfsForm.get("path");e.setValidators([xn.A.required]),"RGW"===this.nfsForm.getValue("name")?e.setAsyncValidators([Cn.a.bucketExistence(!0,this.rgwBucketService)]):e.setAsyncValidators([this.pathExistence(!0)]),this.isEdit&&e.markAsDirty()}getAccessTypeHelp(e){const t=this.nfsAccessType.find(t=>{if(e===t.value)return t});return Wt.a.isObjectLike(t)?t.help:""}getId(){return Wt.a.isString(this.nfsForm.getValue("cluster_id"))&&Wt.a.isString(this.nfsForm.getValue("path"))?this.nfsForm.getValue("cluster_id")+":"+this.nfsForm.getValue("path"):""}getPathTypeahead(e){if(!Wt.a.isString(e)||"/"===e)return Object(Ai.a)([]);const t=this.nfsForm.getValue("fsal").fs_name;return this.nfsService.lsDir(t,e).pipe(Object(Ii.a)(t=>t.paths.filter(t=>t.toLowerCase().includes(e)).slice(0,15)),Object(up.a)(()=>Object(Ai.a)(["Error while retrieving paths."])))}pathChangeHandler(){this.isEdit||this.nfsForm.patchValue({pseudo:this.generatePseudo()})}getBucketTypeahead(e){return Wt.a.isString(e)&&"/"!==e&&""!==e?this.rgwBucketService.list().pipe(Object(Ii.a)(t=>t.filter(t=>t.toLowerCase().includes(e)).slice(0,15)),Object(up.a)(()=>Object(Ai.a)(["Error while retrieving bucket names."]))):Object(Ai.a)([])}generatePseudo(){let e=this.nfsForm.getValue("pseudo");return this.nfsForm.get("pseudo")&&!this.nfsForm.get("pseudo").dirty&&(e=void 0,"CEPH"===this.nfsForm.getValue("fsal")&&(e="/cephfs",Wt.a.isString(this.nfsForm.getValue("path"))&&(e+=this.nfsForm.getValue("path")))),e}updateAccessType(){const e=this.nfsForm.getValue("name");let t=this.defaultAccessType[e];return t||(t="RW"),t}submitAction(){let e;const t=this.buildRequest();e=this.taskWrapper.wrapTaskAroundCall(this.isEdit?{task:new Bi.a("nfs/edit",{cluster_id:this.cluster_id,export_id:Wt.a.parseInt(this.export_id)}),call:this.nfsService.update(this.cluster_id,Wt.a.parseInt(this.export_id),t)}:{task:new Bi.a("nfs/create",{path:t.path,fsal:t.fsal,cluster_id:t.cluster_id}),call:this.nfsService.create(t)}),e.subscribe({error:e=>this.setFormErrors(e),complete:()=>this.router.navigate(["/nfs"])})}setFormErrors(e){e.error.detail&&e.error.detail.toString().includes(`Pseudo ${this.nfsForm.getValue("pseudo")} is already in use`)&&this.nfsForm.get("pseudo").setErrors({pseudoAlreadyExists:!0}),this.nfsForm.setErrors({cdSubmitButton:!0})}buildRequest(){const e=Wt.a.cloneDeep(this.nfsForm.value);return this.isEdit&&(e.export_id=Wt.a.parseInt(this.export_id)),"RGW"===e.fsal.name&&delete e.fsal.fs_name,e.protocols=[],e.protocolNfsv4?e.protocols.push(4):e.pseudo=null,delete e.protocolNfsv4,e.transports=[],e.transportTCP&&e.transports.push("TCP"),delete e.transportTCP,e.transportUDP&&e.transports.push("UDP"),delete e.transportUDP,e.clients.forEach(t=>{t.addresses=Wt.a.isString(t.addresses)?Wt()(t.addresses).split(/[ ,]+/).uniq().filter(e=>""!==e).value():[],t.squash||(t.squash=e.squash),t.access_type||(t.access_type=e.access_type)}),e.fsal.sec_label_xattr=!1===e.security_label||"RGW"===e.fsal.name?null:e.sec_label_xattr,delete e.sec_label_xattr,e}pathExistence(e){return t=>{if(t.pristine||!t.value)return Object(Ai.a)({required:!0});const n=this.nfsForm.getValue("fsal").fs_name;return this.nfsService.lsDir(n,t.value).pipe(Object(Ii.a)(n=>n.paths.includes(t.value)===e?null:{pathNameNotAllowed:!0}),Object(up.a)(()=>Object(Ai.a)({pathNameNotAllowed:!0})))}}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(hp),r.Rb(Pt.a),r.Rb(Pt.e),r.Rb(fp.a),r.Rb(pp.a),r.Rb(wo.a),r.Rb(Ui.a),r.Rb(r.i),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-nfs-form"]],viewQuery:function(e,t){if(1&e&&r.Wc(Mp,3),2&e){let e;r.Ec(e=r.mc())&&(t.nfsClients=e.first)}},features:[r.Ab],decls:1,vars:1,consts:function(){let e,t,n,i,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y,w,D,S,x,k,T,M,C,O,L,E,A,I,R,P,F,W,j,Y,N,z,$,H,X,V,B,U,q,G,J,K,Q,Z,ee,te,ne,ie;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Cluster",n="This is the ID of an NFS Service.",i="Storage Backend",s="NFS Protocol",o="NFSv4",a="Access Type",c="Squash",l="Transport Protocol",u="UDP",d="TCP",h="Loading...",f="-- No cluster available --",p="-- Select the cluster --",m="This field is required. To create a new NFS cluster, " + "\ufffd#2\ufffd" + "add a new NFS Service" + "\ufffd/#2\ufffd" + ".",b="Loading...",g="-- No data pools available --",_="-- Select the storage backend --",v="This field is required.",y="" + "\ufffd0\ufffd" + "",w="Volume",D="Loading...",S="-- No CephFS filesystem available --",x="-- Select the CephFS filesystem --",k="This field is required.",T="Security Label",M="Enable security label",C="This field is required.",O="CephFS Path",L="A path in a CephFS file system.",E="This field is required.",A="Path need to start with a '/' and can be followed by a word",I="The path does not exist in the selected volume.",R="Bucket",P="This field is required.",F="The bucket does not exist or is not in the default realm (if multiple realms are configured). To continue, " + "\ufffd#2\ufffd" + "create a new bucket" + "\ufffd/#2\ufffd" + ".",W="This field is required.",j="Pseudo",Y="The position that this " + "[\ufffd#7\ufffd|\ufffd#8\ufffd]" + "NFS v4" + "[\ufffd/#7\ufffd|\ufffd/#8\ufffd]" + " export occupies in the " + "[\ufffd#7\ufffd|\ufffd#8\ufffd]" + "Pseudo FS" + "[\ufffd/#7\ufffd|\ufffd/#8\ufffd]" + " (it must be unique).",Y=r.gc(Y),N="By using different Pseudo options, the same Path may be exported multiple times.",z="This field is required.",$="The pseudo is already in use by another export.",H="Pseudo needs to start with a '/' and can't contain any of the following: >, <, |, &, ( or ).",X="Loading...",V="-- No access type available --",B="-- Select the access type --",U="The Object Gateway NFS backend has a number of limitations which will seriously affect applications writing to the share. Please consult the " + "\ufffd#2\ufffd" + "" + "\ufffd/#2\ufffd" + " for details before enabling write access.",q="This field is required.",G="Loading...",J="-- No squash available --",K="--Select what kind of user id squashing is performed --",Q="This field is required.",Z="This field is required.",ee="No user id squashing is performed.",te="uid 0 and gid 0 are squashed to the Anonymous_Uid and Anonymous_Gid gid 0 in alt_groups lists is also squashed.",ne="uid 0 and gid of any value are squashed to the Anonymous_Uid and Anonymous_Gid alt_groups lists is discarded.",ie="All users are squashed.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","nfsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","cluster_id",1,"cd-col-form-label"],[1,"required"],t,n,[1,"cd-col-form-input"],["formControlName","cluster_id","name","cluster_id","id","cluster_id",1,"form-control","custom-select"],["value","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],["formGroupName","fsal"],["for","name",1,"cd-col-form-label","required"],i,["formControlName","name","name","name","id","name",1,"form-control","custom-select",3,"change"],[3,"value","disabled",4,"ngFor","ngForOf"],["class","form-group row",4,"ngIf"],["for","protocols",1,"cd-col-form-label","required"],s,[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","protocolNfsv4","name","protocolNfsv4","id","protocolNfsv4","disabled","",1,"custom-control-input"],["for","protocolNfsv4",1,"custom-control-label"],o,["for","access_type",1,"cd-col-form-label","required"],a,["formControlName","access_type","name","access_type","id","access_type",1,"form-control","custom-select",3,"change"],["class","form-text text-muted",4,"ngIf"],["class","form-text text-warning",4,"ngIf"],["for","squash",1,"cd-col-form-label"],c,[4,"ngTemplateOutlet"],["name","squash","formControlName","squash","id","squash",1,"form-control","custom-select"],["for","transports",1,"cd-col-form-label","required"],l,["type","checkbox","formControlName","transportUDP","name","transportUDP","id","transportUDP",1,"custom-control-input"],["for","transportUDP",1,"custom-control-label"],u,["type","checkbox","formControlName","transportTCP","name","transportTCP","id","transportTCP",1,"custom-control-input"],["for","transportTCP",1,"custom-control-label"],d,[3,"form","clients"],["nfsClients",""],["squashHelper",""],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["value",""],h,f,p,[3,"value"],[1,"invalid-feedback"],m,[1,"btn-link",3,"routerLink"],b,g,_,[3,"value","disabled"],v,y,["for","fs_name",1,"cd-col-form-label","required"],w,["formControlName","fs_name","name","fs_name","id","fs_name",1,"form-control","custom-select",3,"change"],D,S,x,k,["for","security_label",1,"cd-col-form-label",3,"ngClass"],T,["type","checkbox","formControlName","security_label","name","security_label","id","security_label",1,"custom-control-input"],["for","security_label",1,"custom-control-label"],M,["type","text","class","form-control","name","sec_label_xattr","id","sec_label_xattr","formControlName","sec_label_xattr",4,"ngIf"],["type","text","name","sec_label_xattr","id","sec_label_xattr","formControlName","sec_label_xattr",1,"form-control"],C,["for","path",1,"cd-col-form-label"],O,L,["type","text","name","path","id","path","data-testid","fs_path","formControlName","path",1,"form-control",3,"ngbTypeahead","selectItem","blur"],E,A,I,R,["type","text","name","path","id","path","data-testid","rgw_path","formControlName","path",1,"form-control",3,"ngbTypeahead"],P,F,["routerLink","/rgw/bucket/create",1,"btn-link"],W,["for","pseudo",1,"cd-col-form-label"],j,Y,N,["type","text","name","pseudo","id","pseudo","formControlName","pseudo",1,"form-control"],z,$,H,X,V,B,[1,"form-text","text-muted"],[1,"form-text","text-warning"],U,["section","rgw-nfs"],q,G,J,K,Q,Z,[1,"squash-helper"],[1,"squash-helper-item-value"],ee,te,ne,ie]},template:function(e,t){1&e&&r.Pc(0,Tm,95,46,"div",0),2&e&&r.uc("cdFormLoading",t.loading)},directives:[Kn.a,xn.B,xn.r,xn.k,Qn.a,Zn.a,dr.a,On.a,xn.z,ei.a,xn.q,xn.i,s.r,s.q,xn.l,xn.b,s.w,Tp,ti.a,xn.u,xn.C,Pt.h,s.p,xn.d,Jt.G,Pr.a],pipes:[s.A,pr.a],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}.squash-helper[_ngcontent-%COMP%]{padding-left:1rem}.squash-helper-item-value[_ngcontent-%COMP%]{font-weight:700}"]}),e})();var Cm=n("VTlA");function Om(e,t){if(1&e&&r.Sb(0,"cd-table-key-value",10),2&e){const e=r.nc(2);r.uc("data",e.data)}}function Lm(e,t){if(1&e&&r.Sb(0,"cd-table",11,12),2&e){const e=r.nc(2);r.uc("data",e.clients)("columns",e.clientsColumns)}}function Em(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"ul",1,2),r.Xb(3,"li",3),r.Xb(4,"a",4),r.bc(5,5),r.Wb(),r.Pc(6,Om,1,1,"ng-template",6),r.Wb(),r.Xb(7,"li",7),r.Xb(8,"a",4),r.bc(9,8),r.Wb(),r.Pc(10,Lm,2,2,"ng-template",6),r.Wb(),r.Wb(),r.Sb(11,"div",9),r.Ub()),2&e){const e=r.Fc(2),t=r.nc();r.Db(9),r.fc(t.clients.length),r.cc(9),r.Db(2),r.uc("ngbNavOutlet",e)}}let Am=(()=>{class e{constructor(){this.clients=[],this.clientsColumns=[{name:"Addresses",prop:"addresses",flexGrow:2},{name:"Access Type",prop:"access_type",flexGrow:1},{name:"Squash",prop:"squash",flexGrow:1}]}ngOnChanges(){this.selection&&(this.selectedItem=this.selection,this.clients=this.selectedItem.clients,this.data={},this.data["Cluster"]=this.selectedItem.cluster_id,this.data["NFS Protocol"]=this.selectedItem.protocols.map(e=>"NFSv"+e),this.data["Pseudo"]=this.selectedItem.pseudo,this.data["Access Type"]=this.selectedItem.access_type,this.data["Squash"]=this.selectedItem.squash,this.data["Transport"]=this.selectedItem.transports,this.data["Path"]=this.selectedItem.path,"CEPH"===this.selectedItem.fsal.name?(this.data["Storage Backend"]="CephFS",this.data["CephFS User"]=this.selectedItem.fsal.user_id,this.data["CephFS Filesystem"]=this.selectedItem.fsal.fs_name,this.data["Security Label"]=this.selectedItem.fsal.sec_label_xattr):(this.data["Storage Backend"]="Object Gateway",this.data["Object Gateway User"]=this.selectedItem.fsal.user_id))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-nfs-details"]],inputs:{selection:"selection"},features:[r.Bb],decls:1,vars:1,consts:function(){let e,t;return e="Details",t="Clients (" + "\ufffd0\ufffd" + ")",[[4,"ngIf"],["ngbNav","","cdStatefulTab","nfs-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","clients"],t,[3,"ngbNavOutlet"],[3,"data"],["columnMode","flex","identifier","addresses","forceIdentifier","true","selectionType","",3,"data","columns"],["table",""]]},template:function(e,t){1&e&&r.Pc(0,Em,12,2,"ng-container",0),2&e&&r.uc("ngIf",t.selection)},directives:[s.r,Jt.p,Kt.a,Jt.r,Jt.s,Jt.q,Jt.u,en.a,Vt.a],styles:[""]}),e})();const Im=["nfsState"],Rm=["nfsFsal"],Pm=["table"];function Fm(e,t){1&e&&(r.Vb(0),r.bc(1,7),r.Ub())}function Wm(e,t){1&e&&(r.Vb(0),r.bc(1,8),r.Ub())}function jm(e,t){if(1&e&&(r.Pc(0,Fm,2,0,"ng-container",6),r.Pc(1,Wm,2,0,"ng-container",6)),2&e){const e=t.value;r.uc("ngIf","CEPH"===e.name),r.Db(1),r.uc("ngIf","RGW"===e.name)}}let Ym=(()=>{class e extends zt.a{constructor(e,t,n,i,r,s){super(),this.authStorageService=e,this.modalService=t,this.nfsService=n,this.taskListService=i,this.taskWrapper=r,this.actionLabels=s,this.selection=new Ht.a,this.isDefaultCluster=!1,this.builders={"nfs/create":e=>({path:e.path,cluster_id:e.cluster_id,fsal:e.fsal})},this.permission=this.authStorageService.getPermissions().nfs;const o=()=>this.selection.first()&&`${encodeURI(this.selection.first().cluster_id)}/${encodeURI(this.selection.first().export_id)}`;this.tableActions=[{permission:"create",icon:_n.a.add,routerLink:()=>"/nfs/create",canBePrimary:e=>!e.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:_n.a.edit,routerLink:()=>`/nfs/edit/${o()}`,name:this.actionLabels.EDIT},{permission:"delete",icon:_n.a.destroy,click:()=>this.deleteNfsModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"Path",prop:"path",flexGrow:2,cellTransformation:$t.a.executing},{name:"Pseudo",prop:"pseudo",flexGrow:2},{name:"Cluster",prop:"cluster_id",flexGrow:2},{name:"Storage Backend",prop:"fsal",flexGrow:2,cellTemplate:this.nfsFsal},{name:"Access Type",prop:"access_type",flexGrow:2}],this.taskListService.init(()=>this.nfsService.list(),e=>this.prepareResponse(e),e=>this.exports=e,()=>this.onFetchError(),this.taskFilter,this.itemFilter,this.builders)}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}prepareResponse(e){let t=[];return e.forEach(e=>{e.id=`${e.cluster_id}:${e.export_id}`,e.state="LOADING",t=t.concat(e)}),t}onFetchError(){this.table.reset(),this.viewCacheStatus={status:qt.a.ValueException}}itemFilter(e,t){return e.cluster_id===t.metadata.cluster_id&&e.export_id===t.metadata.export_id}taskFilter(e){return["nfs/create","nfs/delete","nfs/edit"].includes(e.name)}updateSelection(e){this.selection=e}deleteNfsModal(){const e=this.selection.first().cluster_id,t=this.selection.first().export_id;this.modalRef=this.modalService.show(bn.a,{itemDescription:"NFS export",itemNames:[`${e}:${t}`],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new Bi.a("nfs/delete",{cluster_id:e,export_id:t}),call:this.nfsService.delete(e,t)})})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(yn.a),r.Rb(hp),r.Rb(Cm.a),r.Rb(Ui.a),r.Rb(gn.b))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-nfs-list"]],viewQuery:function(e,t){if(1&e&&(r.Wc(Im,1),r.Wc(Rm,3),r.Wc(Pm,3)),2&e){let e;r.Ec(e=r.mc())&&(t.nfsState=e.first),r.Ec(e=r.mc())&&(t.nfsFsal=e.first),r.Ec(e=r.mc())&&(t.table=e.first)}},features:[r.Cb([Cm.a]),r.Ab],decls:7,vars:7,consts:function(){let e,t;return e="CephFS",t="Object Gateway",[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["nfsFsal",""],[4,"ngIf"],e,t]},template:function(e,t){1&e&&(r.Xb(0,"cd-table",0,1),r.lc("setExpandedRow",function(e){return t.setExpandedRow(e)})("updateSelection",function(e){return t.updateSelection(e)}),r.Xb(2,"div",2),r.Sb(3,"cd-table-actions",3),r.Wb(),r.Sb(4,"cd-nfs-details",4),r.Wb(),r.Pc(5,jm,2,2,"ng-template",null,5,r.Qc)),2&e&&(r.uc("data",t.exports)("columns",t.columns)("hasDetails",!0),r.Db(3),r.uc("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),r.Db(1),r.uc("selection",t.expandedRow))},directives:[Vt.a,Dn.a,Am,s.r],styles:[""]}),e})(),Nm=(()=>{class e{constructor(t){this.route=t,this.route.queryParams.subscribe(t=>{this.fromLink=t.fromLink||e.defaultFromLink}),this.route.params.subscribe(e=>{this.serviceId=decodeURIComponent(e.id),this.serviceType=e.type})}}return e.defaultFromLink="/hosts",e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-performance-counter"]],decls:3,vars:4,consts:[[3,"serviceType","serviceId"]],template:function(e,t){1&e&&(r.Xb(0,"legend"),r.Rc(1),r.Wb(),r.Sb(2,"cd-table-performance-counter",0)),2&e&&(r.Db(1),r.Uc("",t.serviceType,".",t.serviceId,""),r.Db(1),r.uc("serviceType",t.serviceType)("serviceId",t.serviceId))},directives:[sd.a],styles:[""]}),e})();var zm=n("DSvg"),$m=n("Mxhz"),Hm=n("1nQr");function Xm(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,31),r.Wb())}function Vm(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,32),r.Wb())}function Bm(e,t){if(1&e&&r.Sb(0,"cd-helper",33),2&e){const e=r.nc();r.vc("html",e.passwordPolicyHelpText)}}function Um(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,34),r.Wb())}function qm(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,35),r.Wb())}function Gm(e,t){if(1&e&&(r.Xb(0,"span",30),r.Rc(1),r.Wb()),2&e){const e=r.nc();r.Db(1),r.Tc(" ",e.passwordValuation," ")}}function Jm(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,36),r.Wb())}function Km(e,t){1&e&&(r.Xb(0,"span",30),r.bc(1,37),r.Wb())}let Qm=(()=>{class e{constructor(e,t,n,i,r,s,o){this.actionLabels=e,this.notificationService=t,this.userService=n,this.authStorageService=i,this.formBuilder=r,this.router=s,this.passwordPolicyService=o,this.passwordPolicyHelpText="",this.icons=_n.a,this.action=this.actionLabels.CHANGE,this.resource="password",this.createForm()}createForm(){this.passwordPolicyService.getHelpText().subscribe(e=>{this.passwordPolicyHelpText=e}),this.userForm=this.formBuilder.group({oldpassword:[null,[xn.A.required,Cn.a.custom("notmatch",()=>this.userForm&&this.userForm.getValue("newpassword")===this.userForm.getValue("oldpassword"))]],newpassword:[null,[xn.A.required,Cn.a.custom("notmatch",()=>this.userForm&&this.userForm.getValue("oldpassword")===this.userForm.getValue("newpassword"))],[Cn.a.passwordPolicy(this.userService,()=>this.authStorageService.getUsername(),(e,t,n)=>{this.passwordStrengthLevelClass=this.passwordPolicyService.mapCreditsToCssClass(t),this.passwordValuation=Wt.a.defaultTo(n,"")})]],confirmnewpassword:[null,[xn.A.required]]},{validators:[Cn.a.match("newpassword","confirmnewpassword")]})}onSubmit(){if(this.userForm.pristine)return;const e=this.authStorageService.getUsername(),t=this.userForm.getValue("oldpassword"),n=this.userForm.getValue("newpassword");this.userService.changePassword(e,t,n).subscribe(()=>this.onPasswordChange(),()=>{this.userForm.setErrors({cdSubmitButton:!0})})}onPasswordChange(){this.notificationService.show(vn.a.success,"Updated user password\""),this.router.navigate(["/login"])}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(wn.a),r.Rb($m.a),r.Rb(Gt.a),r.Rb(wo.a),r.Rb(Pt.e),r.Rb(Hm.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-user-password-form"]],decls:48,vars:25,consts:function(){let e,t,n,i,r,s,o,a,c,l;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Old password",n="New password",i="Confirm new password",r="This field is required.",s="The old and new passwords must be different.",o="This field is required.",a="The old and new passwords must be different.",c="This field is required.",l="Password confirmation doesn't match the new password.",[[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","oldpassword",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],[1,"input-group"],["type","password","placeholder","Old password...","id","oldpassword","formControlName","oldpassword","autocomplete","new-password","autofocus","",1,"form-control"],[1,"input-group-append"],["cdPasswordButton","oldpassword",1,"btn","btn-light"],["class","invalid-feedback",4,"ngIf"],["for","newpassword",1,"cd-col-form-label"],[1,"required"],n,["class","text-pre-wrap",3,"html",4,"ngIf"],["type","password","placeholder","Password...","id","newpassword","autocomplete","new-password","formControlName","newpassword",1,"form-control"],["type","button","cdPasswordButton","newpassword",1,"btn","btn-light"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],["for","confirmnewpassword",1,"cd-col-form-label","required"],i,["type","password","autocomplete","new-password","placeholder","Confirm new password...","id","confirmnewpassword","formControlName","confirmnewpassword",1,"form-control"],["cdPasswordButton","confirmnewpassword",1,"btn","btn-light"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],r,s,[1,"text-pre-wrap",3,"html"],o,a,c,l]},template:function(e,t){if(1&e&&(r.Xb(0,"div",0),r.Xb(1,"form",1,2),r.Xb(3,"div",3),r.Xb(4,"div",4),r.bc(5,5),r.oc(6,"titlecase"),r.oc(7,"upperFirst"),r.Wb(),r.Xb(8,"div",6),r.Xb(9,"div",7),r.Xb(10,"label",8),r.bc(11,9),r.Wb(),r.Xb(12,"div",10),r.Xb(13,"div",11),r.Sb(14,"input",12),r.Xb(15,"span",13),r.Sb(16,"button",14),r.Wb(),r.Wb(),r.Pc(17,Xm,2,0,"span",15),r.Pc(18,Vm,2,0,"span",15),r.Wb(),r.Wb(),r.Xb(19,"div",7),r.Xb(20,"label",16),r.Xb(21,"span",17),r.bc(22,18),r.Wb(),r.Pc(23,Bm,1,1,"cd-helper",19),r.Wb(),r.Xb(24,"div",10),r.Xb(25,"div",11),r.Sb(26,"input",20),r.Xb(27,"span",13),r.Sb(28,"button",21),r.Wb(),r.Wb(),r.Xb(29,"div",22),r.Sb(30,"div",23),r.Wb(),r.Pc(31,Um,2,0,"span",15),r.Pc(32,qm,2,0,"span",15),r.Pc(33,Gm,2,1,"span",15),r.Wb(),r.Wb(),r.Xb(34,"div",7),r.Xb(35,"label",24),r.bc(36,25),r.Wb(),r.Xb(37,"div",10),r.Xb(38,"div",11),r.Sb(39,"input",26),r.Xb(40,"span",13),r.Sb(41,"button",27),r.Wb(),r.Wb(),r.Pc(42,Jm,2,0,"span",15),r.Pc(43,Km,2,0,"span",15),r.Wb(),r.Wb(),r.Wb(),r.Xb(44,"div",28),r.Xb(45,"cd-form-button-panel",29),r.lc("submitActionEvent",function(){return t.onSubmit()}),r.oc(46,"titlecase"),r.oc(47,"upperFirst"),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.Fc(2);r.Db(1),r.uc("formGroup",t.userForm),r.Db(6),r.fc(r.pc(6,17,t.action))(r.pc(7,19,t.resource)),r.cc(5),r.Db(10),r.uc("ngIf",t.userForm.showError("oldpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("oldpassword",e,"notmatch")),r.Db(5),r.uc("ngIf",t.passwordPolicyHelpText.length>0),r.Db(7),r.Fb(t.passwordStrengthLevelClass),r.vc("title",t.passwordValuation),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"notmatch")),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"passwordPolicy")),r.Db(9),r.uc("ngIf",t.userForm.showError("confirmnewpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("confirmnewpassword",e,"match")),r.Db(2),r.uc("form",t.userForm)("submitText",r.pc(46,21,t.action)+" "+r.pc(47,23,t.resource))}},directives:[xn.B,xn.r,xn.k,Qn.a,Zn.a,On.a,xn.d,ei.a,xn.q,xn.i,hr.a,pa.a,s.r,ti.a,dr.a],pipes:[s.A,pr.a],styles:[""]}),e})();function Zm(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,18),r.Wb())}function eb(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,19),r.Wb())}function tb(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,20),r.Wb())}function nb(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,21),r.Wb())}function ib(e,t){if(1&e&&(r.Xb(0,"span",17),r.Rc(1),r.Wb()),2&e){const e=r.nc();r.Db(1),r.Tc(" ",e.passwordValuation," ")}}function rb(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,22),r.Wb())}function sb(e,t){1&e&&(r.Xb(0,"span",17),r.bc(1,23),r.Wb())}let ob=(()=>{class e extends Qm{constructor(e,t,n,i,r,s,o,a){super(e,t,n,i,r,s,o),this.actionLabels=e,this.notificationService=t,this.userService=n,this.authStorageService=i,this.formBuilder=r,this.router=s,this.passwordPolicyService=o,this.authService=a}onPasswordChange(){this.authService.logout()}onCancel(){this.authService.logout()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(gn.b),r.Rb(wn.a),r.Rb($m.a),r.Rb(Gt.a),r.Rb(wo.a),r.Rb(Pt.e),r.Rb(Hm.a),r.Rb(zm.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-login-password-form"]],features:[r.Ab],decls:34,vars:19,consts:function(){let e,t,n,i,r,s,o,a;return e="Please set a new password.",t="You will be redirected to the login page afterwards.",n="This field is required.",i="The old and new passwords must be different.",r="This field is required.",s="The old and new passwords must be different.",o="This field is required.",a="Password confirmation doesn't match the new password.",[e,t,["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"form-group","has-feedback"],[1,"input-group"],["type","password","placeholder","Old password...","id","oldpassword","formControlName","oldpassword","autocomplete","new-password","autofocus","",1,"form-control"],[1,"input-group-append"],["cdPasswordButton","oldpassword",1,"btn","btn-outline-light","btn-password"],["class","invalid-feedback",4,"ngIf"],["type","password","placeholder","New password...","id","newpassword","autocomplete","new-password","formControlName","newpassword",1,"form-control"],["type","button","cdPasswordButton","newpassword",1,"btn","btn-outline-light","btn-password"],[1,"password-strength-level"],["data-toggle","tooltip",3,"title"],["type","password","autocomplete","new-password","placeholder","Confirm new password...","id","confirmnewpassword","formControlName","confirmnewpassword",1,"form-control"],["cdPasswordButton","confirmnewpassword",1,"btn","btn-outline-light","btn-password"],["wrappingClass","text-right",3,"form","disabled","submitText","submitActionEvent","backActionEvent"],[1,"invalid-feedback"],n,i,r,s,o,a]},template:function(e,t){if(1&e&&(r.Xb(0,"div"),r.Xb(1,"h2"),r.bc(2,0),r.Wb(),r.Xb(3,"h4"),r.bc(4,1),r.Wb(),r.Xb(5,"form",2,3),r.Xb(7,"div",4),r.Xb(8,"div",5),r.Sb(9,"input",6),r.Xb(10,"span",7),r.Sb(11,"button",8),r.Wb(),r.Wb(),r.Pc(12,Zm,2,0,"span",9),r.Pc(13,eb,2,0,"span",9),r.Wb(),r.Xb(14,"div",4),r.Xb(15,"div",5),r.Sb(16,"input",10),r.Xb(17,"span",7),r.Sb(18,"button",11),r.Wb(),r.Wb(),r.Xb(19,"div",12),r.Sb(20,"div",13),r.Wb(),r.Pc(21,tb,2,0,"span",9),r.Pc(22,nb,2,0,"span",9),r.Pc(23,ib,2,1,"span",9),r.Wb(),r.Xb(24,"div",4),r.Xb(25,"div",5),r.Sb(26,"input",14),r.Xb(27,"span",7),r.Sb(28,"button",15),r.Wb(),r.Wb(),r.Pc(29,rb,2,0,"span",9),r.Pc(30,sb,2,0,"span",9),r.Wb(),r.Xb(31,"cd-form-button-panel",16),r.lc("submitActionEvent",function(){return t.onSubmit()})("backActionEvent",function(){return t.onCancel()}),r.oc(32,"titlecase"),r.oc(33,"upperFirst"),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.Fc(6);r.Db(5),r.uc("formGroup",t.userForm),r.Db(7),r.uc("ngIf",t.userForm.showError("oldpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("oldpassword",e,"notmatch")),r.Db(7),r.Fb(t.passwordStrengthLevelClass),r.vc("title",t.passwordValuation),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"notmatch")),r.Db(1),r.uc("ngIf",t.userForm.showError("newpassword",e,"passwordPolicy")),r.Db(6),r.uc("ngIf",t.userForm.showError("confirmnewpassword",e,"required")),r.Db(1),r.uc("ngIf",t.userForm.showError("confirmnewpassword",e,"match")),r.Db(1),r.uc("form",t.userForm)("disabled",t.userForm.invalid)("submitText",r.pc(32,15,t.action)+" "+r.pc(33,17,t.resource))}},directives:[xn.B,xn.r,xn.k,Qn.a,Zn.a,On.a,xn.d,ei.a,xn.q,xn.i,hr.a,pa.a,s.r,ti.a],pipes:[s.A,pr.a],styles:["cd-login-password-form h4{margin:0 0 30px}  cd-login-password-form .form-group{background-color:#2e373d;border-left:4px solid #fff}  cd-login-password-form .form-group:focus-within{border-left:4px solid #ef5c55}  cd-login-password-form .btn-password,   cd-login-password-form .btn-password:focus,   cd-login-password-form .form-control,   cd-login-password-form .form-control:focus{background-color:#2e373d;border:0;box-shadow:none;color:#f8f9fa;filter:none;outline:none}  cd-login-password-form .form-control::placeholder{color:#6c757d}  cd-login-password-form .btn-password:focus{outline-color:#2b99a8}  cd-login-password-form button.btn:not(:first-child){margin-left:5px}@keyframes autofill{to{background-color:#2e373d;color:#f8f9fa}}input[_ngcontent-%COMP%]:-webkit-autofill{animation-fill-mode:both;animation-name:autofill;border-radius:0;box-shadow:inset 0 0 0 1000px #2e373d;-webkit-text-fill-color:#f8f9fa;-webkit-transition-property:none;transition-property:none}.invalid-feedback[_ngcontent-%COMP%]{padding-left:9px}.is-invalid.cd-form-control[_ngcontent-%COMP%]{border-color:#0000}"]}),e})();class ab{}function cb(e,t){1&e&&(r.Xb(0,"div",20),r.bc(1,21),r.Wb())}function lb(e,t){1&e&&(r.Xb(0,"div",20),r.bc(1,22),r.Wb())}function ub(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",1),r.Xb(1,"form",2,3),r.lc("ngSubmit",function(){return r.Ic(e),r.nc().login()}),r.Xb(3,"div",4),r.Xb(4,"label",5),r.bc(5,6),r.Wb(),r.Xb(6,"input",7,8),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().model.username=t}),r.Wb(),r.Pc(8,cb,2,0,"div",9),r.Wb(),r.Xb(9,"div",10),r.Xb(10,"div",11),r.Xb(11,"div",12),r.Xb(12,"label",13),r.bc(13,14),r.Wb(),r.Xb(14,"input",15,16),r.lc("ngModelChange",function(t){return r.Ic(e),r.nc().model.password=t}),r.Wb(),r.Pc(16,lb,2,0,"div",9),r.Wb(),r.Xb(17,"span",17),r.Sb(18,"button",18),r.Wb(),r.Wb(),r.Wb(),r.Sb(19,"input",19),r.Wb(),r.Wb()}if(2&e){const e=r.Fc(2),t=r.Fc(7),n=r.Fc(15),i=r.nc();r.Db(6),r.uc("ngModel",i.model.username),r.Eb("aria-invalid",t.invalid),r.Db(2),r.uc("ngIf",(e.submitted||t.dirty)&&t.invalid),r.Db(6),r.uc("ngModel",i.model.password),r.Eb("aria-invalid",n.invalid),r.Db(2),r.uc("ngIf",(e.submitted||n.dirty)&&n.invalid),r.Db(3),r.uc("disabled",e.invalid)}}let db=(()=>{class e{constructor(e,t,n,i,r){this.authService=e,this.authStorageService=t,this.modalService=n,this.route=i,this.router=r,this.model=new ab,this.isLoginActive=!1,this.postInstalled=!1}ngOnInit(){if(this.authStorageService.isLoggedIn())this.router.navigate([""]);else{this.modalService.dismissAll();let e=null;if(-1!==window.location.hash.indexOf("access_token=")){e=window.location.hash.split("access_token=")[1];const t=window.location.toString();window.history.replaceState({},document.title,t.split("?")[0])}this.authService.check(e).subscribe(e=>{e.login_url?(this.postInstalled="POST_INSTALLED"===e.cluster_status,"#/login"===e.login_url?this.isLoginActive=!0:window.location.replace(e.login_url)):(this.authStorageService.set(e.username,e.permissions,e.sso,e.pwdExpirationDate),this.router.navigate([""]))})}}login(){this.authService.login(this.model).subscribe(()=>{let e=Wt.a.get(this.route.snapshot.queryParams,"returnUrl",this.postInstalled?"/":"/expand-cluster");this.postInstalled||"/dashboard"!==this.route.snapshot.queryParams.returnUrl||(e="/expand-cluster"),this.router.navigate([e])})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(zm.a),r.Rb(Gt.a),r.Rb(yn.a),r.Rb(Pt.a),r.Rb(Pt.e))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-login"]],decls:1,vars:1,consts:function(){let e,t,n,i,r;return e="Username",t="Password",n="Log in",i="Username is required",r="Password is required",[["class","container",4,"ngIf"],[1,"container"],["name","loginForm","novalidate","",3,"ngSubmit"],["loginForm","ngForm"],[1,"form-group","has-feedback","d-flex","flex-column","py-3"],["for","username",1,"placeholder","pl-4"],e,["id","username","name","username","type","text","aria-labelledby","username","required","","autofocus","",1,"form-control","pl-4",3,"ngModel","ngModelChange"],["username","ngModel"],["class","invalid-feedback pl-4",4,"ngIf"],["id","password-div",1,"form-group","has-feedback"],[1,"input-group","d-flex","flex-nowrap"],[1,"d-flex","flex-column","flex-grow-1","py-3"],["for","password",1,"placeholder","pl-4"],t,["id","password","name","password","type","password","aria-labelledby","password","required","",1,"form-control","pl-4",3,"ngModel","ngModelChange"],["password","ngModel"],[1,"form-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-outline-light","btn-password","h-100","px-4"],["type","submit","value",n,1,"btn","btn-accent","px-5","py-2",3,"disabled"],[1,"invalid-feedback","pl-4"],i,r]},template:function(e,t){1&e&&r.Pc(0,ub,20,7,"div",0),2&e&&r.uc("ngIf",t.isLoginActive)},directives:[s.r,xn.B,xn.r,xn.s,Zn.a,On.a,xn.d,ei.a,xn.y,hr.a,xn.q,xn.t,pa.a],styles:["cd-login .form-group{background-color:#2e373d;border-left:4px solid #fff;height:auto;margin-bottom:2rem}  cd-login .form-group:focus-within{border-left:4px solid #ef5c55}  cd-login .btn-password,   cd-login .btn-password:focus,   cd-login .form-control,   cd-login .form-control:focus{background-color:#2e373d;border:0;box-shadow:none;color:#f8f9fa;filter:none;outline:none}  cd-login .placeholder{color:#6c757d}  cd-login .btn-password:focus{outline-color:#2b99a8}@keyframes autofill{to{background-color:#2e373d;color:#f8f9fa}}input[_ngcontent-%COMP%]:-webkit-autofill{animation-fill-mode:both;animation-name:autofill;border-radius:0;box-shadow:inset 0 0 0 1000px #2e373d;-webkit-text-fill-color:#f8f9fa;-webkit-transition-property:none;transition-property:none}"]}),e})();var hb=n("tz6c");function fb(e,t){if(1&e&&(r.Xb(0,"div"),r.Sb(1,"i",8),r.Sb(2,"br"),r.Sb(3,"br"),r.Sb(4,"br"),r.Xb(5,"h3"),r.Xb(6,"b"),r.Rc(7),r.Wb(),r.Wb(),r.Sb(8,"br"),r.Xb(9,"h4"),r.Rc(10),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(1),r.Fb(e.icon),r.Db(6),r.Sc(e.header),r.Db(3),r.Sc(e.message)}}function pb(e,t){1&e&&(r.Sb(0,"i",9),r.Sb(1,"br"),r.Sb(2,"br"),r.Sb(3,"br"),r.Xb(4,"h3"),r.hc(5,10),r.Sb(6,"b"),r.ec(),r.Wb(),r.Sb(7,"br"),r.Xb(8,"h4"),r.bc(9,11),r.Wb())}function mb(e,t){if(1&e&&(r.Xb(0,"div"),r.Xb(1,"h4"),r.hc(2,12),r.Sb(3,"a",13),r.ec(),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(3),r.vc("href",e.docUrl,r.Lc),r.fc(e.section_info),r.cc(2)}}let bb=(()=>{class e{constructor(e,t){this.router=e,this.docService=t}ngOnInit(){this.fetchData(),this.routerSubscription=this.router.events.pipe(Object(da.a)(e=>e instanceof Pt.b)).subscribe(()=>{this.fetchData()})}unloadHandler(e){e.returnValue=!1}fetchData(){try{this.router.onSameUrlNavigation="reload",this.message=history.state.message,this.header=history.state.header,this.section=history.state.section,this.section_info=history.state.section_info,this.icon=history.state.icon,this.source=history.state.source,this.docUrl=this.docService.urlGenerator(this.section)}catch(e){this.router.navigate(["/error"])}}ngOnDestroy(){this.routerSubscription&&this.routerSubscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e),r.Rb(hb.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-error"]],hostBindings:function(e,t){1&e&&r.lc("beforeunload",function(e){return t.unloadHandler(e)},!1,r.Hc)},decls:16,vars:4,consts:function(){let e,t,n,i;return e="Go To Dashboard",t="" + "\ufffd#6\ufffd" + "Page not Found" + "\ufffd/#6\ufffd" + "",n="Sorry, we couldn\u2019t find what you were looking for. The page you requested may have been changed or moved.",i="Please consult the " + "\ufffd#3\ufffd" + "documentation" + "\ufffd/#3\ufffd" + " on how to configure and enable the " + "\ufffd0\ufffd" + " management functionality.",[["target","_blank"],[1,"dashboard","row"],[1,"text-center","content"],[4,"ngIf","ngIfElse"],["elseBlock",""],[4,"ngIf"],[1,"btn","btn-primary",3,"routerLink"],e,["aria-hidden","true"],["aria-hidden","true",1,"fa","fa-exclamation-triangle"],t,n,i,[3,"href"]]},template:function(e,t){if(1&e&&(r.Xb(0,"head"),r.Xb(1,"title"),r.Rc(2,"Error Page"),r.Wb(),r.Sb(3,"base",0),r.Wb(),r.Xb(4,"div",1),r.Xb(5,"div",2),r.Sb(6,"br"),r.Pc(7,fb,11,5,"div",3),r.Pc(8,pb,10,0,"ng-template",null,4,r.Qc),r.Pc(10,mb,4,2,"div",5),r.Sb(11,"br"),r.Sb(12,"br"),r.Xb(13,"div"),r.Xb(14,"button",6),r.bc(15,7),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.Fc(9);r.Db(7),r.uc("ngIf",t.header&&t.message)("ngIfElse",e),r.Db(3),r.uc("ngIf",t.section),r.Db(4),r.uc("routerLink","/dashboard")}},directives:[s.r,On.a,Pt.f],styles:["h4[_ngcontent-%COMP%]{color:#495057}i[_ngcontent-%COMP%]{font-size:6em;margin-top:120px}.dashboard[_ngcontent-%COMP%], .text-center[_ngcontent-%COMP%]{background-color:#e9ecef}.dashboard[_ngcontent-%COMP%]{height:100%;position:relative}.content[_ngcontent-%COMP%]{left:50%;position:absolute;top:40%;transform:translate(-50%,-50%);width:100%}.row[_ngcontent-%COMP%]{display:block;margin-left:-29px;margin-right:-29px;padding-top:10em}.fa-exclamation-triangle[_ngcontent-%COMP%], .fa-lock[_ngcontent-%COMP%]{color:#ef5c55}.fa-wrench[_ngcontent-%COMP%]{color:#2b99a8}"]}),e})(),gb=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-blank-layout"]],decls:1,vars:0,template:function(e,t){1&e&&r.Sb(0,"router-outlet")},directives:[Pt.j],styles:[""]}),e})();var _b=n("AytR");let vb=(()=>{class e{constructor(e,t){this.http=e,this.localeId=t}getLocale(){return this.localeId||_b.a.default_lang}setLocale(e){document.cookie=`cd-lang=${e}`}getLanguages(){return this.http.get("ui-api/langs")}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b),r.ic(r.y))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var yb=function(e){return e.cs="\u010ce\u0161tina",e.de="Deutsch",e["en-US"]="English",e.es="Espa\xf1ol",e.fr="Fran\xe7ais",e.id="Bahasa Indonesia",e.it="Italiano",e.ja="\u65e5\u672c\u8a9e",e.ko="\ud55c\uad6d\uc5b4",e.pl="Polski",e.pt="Portugu\xeas (brasileiro)",e["zh-Hans"]="\u4e2d\u6587 (\u7b80\u4f53)",e["zh-Hant"]="\u4e2d\u6587 (\u7e41\u9ad4\uff09",e}({});function wb(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"button",4),r.lc("click",function(){r.Ic(e);const n=t.$implicit;return r.nc().changeLanguage(n.key)}),r.Rc(2),r.Wb(),r.Ub()}if(2&e){const e=t.$implicit;r.Db(2),r.Tc(" ",e.value," ")}}let Db=(()=>{class e{constructor(e){this.languageService=e,this.allLanguages=yb,this.supportedLanguages={}}ngOnInit(){this.selectedLanguage=this.languageService.getLocale(),this.languageService.getLanguages().subscribe(e=>{this.supportedLanguages=Wt.a.pick(yb,e)})}reloadWindow(){window.location.reload()}changeLanguage(e){this.languageService.setLocale(e),this.reloadWindow()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(vb))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-language-selector"]],decls:6,vars:4,consts:function(){let e;return e="Select a Language",[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","","title",e],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["ngbDropdownItem","",3,"click"]]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"a",1),r.Rc(2),r.Wb(),r.Xb(3,"div",2),r.Pc(4,wb,3,1,"ng-container",3),r.oc(5,"keyvalue"),r.Wb(),r.Wb()),2&e&&(r.Db(2),r.Tc(" ",t.allLanguages[t.selectedLanguage]," "),r.Db(2),r.uc("ngForOf",r.pc(5,2,t.supportedLanguages)))},directives:[Jt.i,Jt.m,Jt.k,s.q,On.a,Jt.j],pipes:[s.k],styles:[""]}),e})();function Sb(e,t){if(1&e&&(r.Xb(0,"li",10),r.Xb(1,"cd-doc",11),r.dc(2,12),r.Wb(),r.Wb()),2&e){const e=t.$implicit;r.Db(1),r.fc(e.text),r.cc(2),r.vc("section",e.section)}}let xb=(()=>{class e{constructor(){this.docItems=[{section:"help",text:"Help"},{section:"security",text:"Security"},{section:"trademarks",text:"Trademarks"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-login-layout"]],decls:15,vars:1,consts:function(){let e;return e="" + "\ufffd0\ufffd" + "",[[1,"login","full-height"],[1,"navbar","p-4"],[1,"navbar-brand"],[1,"form-inline"],[1,"container"],[1,"row","full-height","vertical-align"],[1,"col-sm-12","col-md-6","d-sm-block"],["src","assets/Ceph_Ceph_Logo_with_text_white.svg","alt","Ceph",1,"img-fluid"],[1,"list-inline"],["class","list-inline-item p-3",4,"ngFor","ngForOf"],[1,"list-inline-item","p-3"],["noSubscribe","true",3,"section",6,"docText"],["docText",e]]},template:function(e,t){1&e&&(r.Xb(0,"main",0),r.Xb(1,"header"),r.Xb(2,"nav",1),r.Sb(3,"a",2),r.Xb(4,"div",3),r.Sb(5,"cd-language-selector"),r.Wb(),r.Wb(),r.Wb(),r.Xb(6,"section"),r.Xb(7,"div",4),r.Xb(8,"div",5),r.Xb(9,"div",6),r.Sb(10,"router-outlet"),r.Wb(),r.Xb(11,"div",6),r.Sb(12,"img",7),r.Xb(13,"ul",8),r.Pc(14,Sb,3,2,"li",9),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(14),r.uc("ngForOf",t.docItems))},directives:[Jt.v,Db,Pt.j,s.q,Pr.a],styles:["cd-login-layout .login{background-color:#374249;background-image:url(ceph_background.e82dd79127290ddbe8cb.gif);background-position:100% 100%;background-repeat:no-repeat;color:#f8f9fa}  cd-login-layout .login header{position:absolute;width:100vw}  cd-login-layout .login header .navbar .dropdown-menu{margin-top:.2rem}  cd-login-layout .login header .navbar .dropdown-menu li a:hover{background-color:#2b99a8}  cd-login-layout .login section{display:inline-flex;min-height:100vh;width:100vw}  cd-login-layout .login .list-inline{margin-bottom:20%;margin-left:20%}  cd-login-layout .login a{color:#fff}  cd-login-layout .login a:hover{color:#adb5bd}"]}),e})();var kb=n("mSOc");let Tb=(()=>{class e{constructor(e,t,n){this.document=e,this.summaryService=t,this.cssHelper=n}init(){var e;this.url=null===(e=this.document.getElementById("cdFavicon"))||void 0===e?void 0:e.getAttribute("href"),this.sub=this.summaryService.subscribe(e=>{this.changeIcon(e.health_status)})}changeIcon(e){if(e===this.oldStatus)return;this.oldStatus=e;const t=this.document.getElementById("cdFavicon"),n=this.document.createElement("canvas");n.width=16,n.height=16;const i=n.getContext("2d"),r=this.document.createElement("img");r.src=this.url,r.onload=()=>{i.drawImage(r,0,0,16,16),Object.keys(gf).includes(e)&&(i.save(),i.globalCompositeOperation="destination-out",i.beginPath(),i.arc(n.width-4,4,6,0,2*Math.PI),i.fill(),i.restore(),i.beginPath(),i.arc(n.width-4,4,4,0,2*Math.PI),i.fillStyle=this.cssHelper.propertyValue(gf[e]),i.fill()),t.setAttribute("href",n.toDataURL("image/png"))}}ngOnDestroy(){var e;this.changeIcon(),null===(e=this.sub)||void 0===e||e.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(r.ic(s.d),r.ic(kb.a),r.ic(ef.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();var Mb=n("VXsX"),Cb=n("EY2u"),Ob=n("vkgz");class Lb{constructor(e,t){this.count=e,this.source=t}call(e,t){return t.subscribe(new Eb(e,this.count,this.source))}}class Eb extends ra.a{constructor(e,t,n){super(e),this.count=t,this.source=n}complete(){if(!this.isStopped){const{source:e,count:t}=this;if(0===t)return super.complete();t>-1&&(this.count=t-1),e.subscribe(this._unsubscribeAndRecycle())}}}let Ab=(()=>{class e{constructor(e){this.http=e,this.url="ui-api/motd"}get(){return this.http.get(this.url)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),Ib=(()=>{class e{constructor(e){this.motdService=e,this.motdSource=new qi.a(null),this.localStorageKey="dashboard_motd_hidden",this.motd$=this.motdSource.asObservable(),this.subscription=Object(Ai.a)(!0).pipe(Object(Ni.a)(()=>this.motdService.get()),Object(up.a)(e=>(Ft.isFunction(e.preventDefault)&&e.preventDefault(),Cb.a)),Object(Ob.a)(e=>this.processResponse(e)),Object(ea.a)(6e4),function(e=-1){return t=>0===e?Object(Cb.b)():t.lift(new Lb(e<0?-1:e-1,t))}()).subscribe()}ngOnDestroy(){this.subscription.unsubscribe()}hide(){const e=this.motdSource.getValue();if(e){const t=`${e.severity}:${e.md5}`;switch(e.severity){case"info":localStorage.setItem(this.localStorageKey,t),sessionStorage.removeItem(this.localStorageKey);break;case"warning":sessionStorage.setItem(this.localStorageKey,t),localStorage.removeItem(this.localStorageKey)}}this.motdSource.next(null)}processResponse(e){const t=sessionStorage.getItem(this.localStorageKey)||localStorage.getItem(this.localStorageKey);let n=Ft.isNull(t);if(!n&&e){const[i,r]=t.split(":");i===e.severity&&r===e.md5||(n=!0,sessionStorage.removeItem(this.localStorageKey),localStorage.removeItem(this.localStorageKey))}n&&this.motdSource.next(e)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(Ab))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Rb=n("oMSZ");function Pb(e,t){1&e&&(r.Xb(0,"div"),r.hc(1,3),r.Sb(2,"strong"),r.Sb(3,"a",4),r.ec(),r.Wb())}function Fb(e,t){if(1&e&&(r.Xb(0,"div"),r.hc(1,5),r.Sb(2,"strong"),r.Sb(3,"a",4),r.ec(),r.Wb()),2&e){const e=r.nc(2);r.Db(3),r.fc(e.expirationDays),r.cc(1)}}function Wb(e,t){if(1&e){const e=r.Yb();r.Xb(0,"ngb-alert",1),r.lc("close",function(t){return r.Ic(e),r.nc().close(t)}),r.Pc(1,Pb,4,0,"div",2),r.Pc(2,Fb,4,1,"div",2),r.Wb()}if(2&e){const e=r.nc();r.vc("type",e.alertType),r.Db(1),r.uc("ngIf",0===e.expirationDays),r.Db(1),r.uc("ngIf",e.expirationDays>0)}}let jb=(()=>{class e{constructor(e,t){this.settingsService=e,this.authStorageService=t,this.displayNotification=!1}ngOnInit(){this.settingsService.getStandardSettings().subscribe(e=>{this.pwdExpirationSettings=new Rb.a(e);const t=this.authStorageService.getPwdExpirationDate();t&&(this.expirationDays=this.getExpirationDays(t),this.alertType=this.expirationDays<=this.pwdExpirationSettings.pwdExpirationWarning2?"danger":"warning",this.displayNotification=this.expirationDays<=this.pwdExpirationSettings.pwdExpirationWarning1,this.authStorageService.isPwdDisplayedSource.next(this.displayNotification))})}ngOnDestroy(){this.authStorageService.isPwdDisplayedSource.next(!1)}getExpirationDays(e){const t=new Date,n=new Date(1e3*e);return Math.floor((n.valueOf()-t.valueOf())/864e5)}close(){this.authStorageService.isPwdDisplayedSource.next(!1),this.displayNotification=!1}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(jd.a),r.Rb(Gt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-pwd-expiration-notification"]],decls:1,vars:1,consts:function(){let e,t;return e="Your password will expire in " + "\ufffd#2\ufffd" + "less than 1" + "\ufffd/#2\ufffd" + " day. Click " + "\ufffd#3\ufffd" + "here" + "\ufffd/#3\ufffd" + " to change it now.",t="Your password will expire in " + "\ufffd#2\ufffd" + "" + "\ufffd0\ufffd" + "" + "\ufffd/#2\ufffd" + " day(s). Click " + "\ufffd#3\ufffd" + "here" + "\ufffd/#3\ufffd" + " to change it now.",[["class","no-margin-bottom",3,"type","close",4,"ngIf"],[1,"no-margin-bottom",3,"type","close"],[4,"ngIf"],e,["routerLink","/user-profile/edit",1,"alert-link"],t]},template:function(e,t){1&e&&r.Pc(0,Wb,3,3,"ngb-alert",0),2&e&&r.uc("ngIf",t.displayNotification)},directives:[s.r,Jt.b,Pt.h],styles:["cd-pwd-expiration-notification .no-margin-bottom{margin-bottom:0}"]}),e})();function Yb(e,t){if(1&e){const e=r.Yb();r.Xb(0,"ngb-alert",1),r.lc("close",function(t){return r.Ic(e),r.nc().close(t)}),r.Xb(1,"div"),r.hc(2,2),r.Sb(3,"a",3),r.Sb(4,"a",4),r.ec(),r.Wb(),r.Wb()}}let Nb=(()=>{class e{constructor(e,t,n,i){this.mgrModuleService=e,this.authStorageService=t,this.notificationService=n,this.telemetryNotificationService=i,this.displayNotification=!1}ngOnInit(){if(this.telemetryNotificationService.update.subscribe(e=>{this.displayNotification=e}),!this.isNotificationHidden()){const e=this.authStorageService.getPermissions().configOpt;Wt.a.every(Object.values(e))&&this.mgrModuleService.getConfig("telemetry").subscribe(e=>{e.enabled||this.telemetryNotificationService.setVisibility(!0)})}}ngOnDestroy(){this.telemetryNotificationService.setVisibility(!1)}isNotificationHidden(){return"true"===localStorage.getItem("telemetry_notification_hidden")}close(){this.telemetryNotificationService.setVisibility(!1),localStorage.setItem("telemetry_notification_hidden","true"),this.notificationService.show(vn.a.success,"Telemetry activation reminder muted","You can activate the module on the Telemetry configuration page (<b>Dashboard Settings</b> -> <b>Telemetry configuration</b>) at any time.")}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wl),r.Rb(Gt.a),r.Rb(wn.a),r.Rb(Nh))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-telemetry-notification"]],decls:1,vars:1,consts:function(){let e;return e="The Ceph community needs your help to continue improving: please " + "\ufffd#3\ufffd" + "Activate" + "[\ufffd/#3\ufffd|\ufffd/#4\ufffd]" + " the " + "\ufffd#4\ufffd" + "Telemetry" + "[\ufffd/#3\ufffd|\ufffd/#4\ufffd]" + " module.",e=r.gc(e),[["class","no-margin-bottom","type","warning",3,"close",4,"ngIf"],["type","warning",1,"no-margin-bottom",3,"close"],e,["routerLink","/telemetry",1,"btn","activate-button","alert-link","activate-text"],["href","https://docs.ceph.com/en/latest/mgr/telemetry/"]]},template:function(e,t){1&e&&r.Pc(0,Yb,5,0,"ngb-alert",0),2&e&&r.uc("ngIf",t.displayNotification)},directives:[s.r,Jt.b,Pt.h],styles:["cd-telemetry-notification .no-margin-bottom{margin-bottom:0}.activate-button[_ngcontent-%COMP%]{background-color:#fcecba;border:.5px solid #495057;border-radius:10%;padding:.1rem .4rem}.activate-text[_ngcontent-%COMP%]{color:#495057;font-weight:700}"]}),e})();var zb=n("Yrry");function $b(e,t){if(1&e){const e=r.Yb();r.Xb(0,"cd-alert-panel",1),r.lc("dismissed",function(){return r.Ic(e),r.nc().onDismissed()}),r.Sb(1,"span",2),r.oc(2,"sanitizeHtml"),r.Wb()}if(2&e){const e=r.nc();r.uc("showTitle",!1)("type",e.motd.severity)("dismissible","danger"!==e.motd.severity),r.Db(1),r.uc("innerHTML",r.pc(2,4,e.motd.message),r.Jc)}}let Hb=(()=>{class e{constructor(e){this.motdNotificationService=e,this.motd=void 0}ngOnInit(){this.subscription=this.motdNotificationService.motd$.subscribe(e=>{this.motd=e})}ngOnDestroy(){this.subscription.unsubscribe()}onDismissed(){this.motdNotificationService.hide()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Ib))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-motd"]],decls:1,vars:1,consts:[["size","slim",3,"showTitle","type","dismissible","dismissed",4,"ngIf"],["size","slim",3,"showTitle","type","dismissible","dismissed"],[3,"innerHTML"]],template:function(e,t){1&e&&r.Pc(0,$b,3,6,"cd-alert-panel",0),2&e&&r.uc("ngIf",t.motd)},directives:[s.r,wr.a],pipes:[zb.a],styles:[""]}),e})();var Xb=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),n=new Promise(function(t){return e._queue.push(t)});return t||this._dispatch(),n},e.prototype.runExclusive=function(e){return Object(jt.a)(this,void 0,void 0,function(){var t,n,i;return Object(jt.c)(this,function(r){switch(r.label){case 0:return[4,this.acquire()];case 1:t=r.sent(),n=t[0],i=t[1],r.label=2;case 2:return r.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,r.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");this._currentReleaser&&(this._currentReleaser(),this._currentReleaser=void 0)},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}(),Vb=function(){function e(){this._semaphore=new Xb(1)}return e.prototype.acquire=function(){return Object(jt.a)(this,void 0,void 0,function(){return Object(jt.c)(this,function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,e.sent()[1]]}})})},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();let Bb=(()=>{class e{constructor(e,t){this.alertFormatter=e,this.prometheusService=t,this.backendFailure=!1,this.notifications=[]}refresh(){this.backendFailure||this.prometheusService.getNotifications(Wt.a.last(this.notifications)).subscribe(e=>this.handleNotifications(e),()=>this.backendFailure=!0)}handleNotifications(e){0!==e.length&&(this.notifications.length>0&&this.alertFormatter.sendNotifications(Wt.a.flatten(e.map(e=>this.formatNotification(e)))),this.notifications=this.notifications.concat(e))}formatNotification(e){return this.alertFormatter.convertToCustomAlerts(e.alerts).map(e=>this.alertFormatter.convertAlertToNotification(e))}}return e.\u0275fac=function(t){return new(t||e)(r.ic(zd),r.ic(Yd))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Ub=n("ufoC"),qb=n("Hicy"),Gb=n("WF9J");const Jb=function(e,t){return[e,t]},Kb=function(e,t,n,i){return[e,t,n,i]};function Qb(e,t){if(1&e&&(r.Xb(0,"div"),r.Xb(1,"div",12),r.Xb(2,"div",13),r.Xb(3,"div",14),r.Xb(4,"span",15),r.Sb(5,"i",7),r.Sb(6,"i",7),r.Wb(),r.Wb(),r.Xb(7,"div",16),r.Xb(8,"div",17),r.Xb(9,"h6",18),r.Rc(10),r.Wb(),r.Xb(11,"div",19),r.Sb(12,"ngb-progressbar",20),r.Wb(),r.Xb(13,"p",21),r.Xb(14,"small",22),r.Rc(15),r.oc(16,"cdDate"),r.Wb(),r.Xb(17,"span",23),r.Rc(18),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Sb(19,"hr"),r.Wb()),2&e){const e=t.$implicit,n=r.nc(2);r.Db(4),r.uc("ngClass",r.Ac(11,Jb,n.icons.stack,n.icons.large2x)),r.Db(1),r.uc("ngClass",r.Ac(14,Jb,n.icons.stack2x,n.icons.circle)),r.Db(1),r.uc("ngClass",r.Cc(17,Kb,n.icons.stack1x,n.icons.spinner,n.icons.spin,n.icons.inverse)),r.Db(4),r.Sc(e.description),r.Db(2),r.uc("value",null==e?null:e.progress)("striped",!0)("animated",!0),r.Db(3),r.Tc(" ",r.pc(16,9,e.begin_time)," "),r.Db(3),r.Tc(" ",e.progress||0," % ")}}function Zb(e,t){if(1&e&&r.Pc(0,Qb,20,22,"div",11),2&e){const e=r.nc();r.uc("ngForOf",e.executingTasks)("ngForTrackBy",e.trackByFn)}}function eg(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"small"),r.Vb(2),r.bc(3,35),r.Ub(),r.Rc(4),r.oc(5,"duration"),r.Wb(),r.Sb(6,"br"),r.Ub()),2&e){const e=r.nc().$implicit;r.Db(4),r.Tc(" ",r.pc(5,1,e.duration)," ")}}const tg=function(e,t,n){return[e,t,n]},ng=function(e){return[e]};function ig(e,t){if(1&e){const e=r.Yb();r.Xb(0,"div",7),r.Xb(1,"div",29),r.Xb(2,"div",13),r.Xb(3,"div",14),r.Xb(4,"span",7),r.Sb(5,"i",7),r.Sb(6,"i",7),r.Wb(),r.Wb(),r.Xb(7,"div",30),r.Xb(8,"div",17),r.Xb(9,"button",31),r.lc("click",function(n){r.Ic(e);const i=t.index;return r.nc(3).remove(i),n.stopPropagation()}),r.Sb(10,"i",7),r.Wb(),r.Xb(11,"h6",18),r.Rc(12),r.Wb(),r.Sb(13,"p",32),r.Xb(14,"p",21),r.Pc(15,eg,7,3,"ng-container",24),r.Xb(16,"small",33),r.oc(17,"cdDate"),r.Rc(18),r.oc(19,"relativeDate"),r.Wb(),r.Sb(20,"i",34),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Sb(21,"hr"),r.Wb()}if(2&e){const e=t.$implicit,n=r.nc(3);r.uc("ngClass",e.borderClass),r.Db(4),r.uc("ngClass",r.Bc(16,tg,n.icons.stack,n.icons.large2x,e.textClass)),r.Db(1),r.uc("ngClass",r.Ac(20,Jb,n.icons.circle,n.icons.stack2x)),r.Db(1),r.uc("ngClass",r.Bc(23,tg,n.icons.stack1x,n.icons.inverse,e.iconClass)),r.Db(4),r.uc("ngClass",r.zc(27,ng,n.icons.trash)),r.Db(2),r.Sc(e.title),r.Db(1),r.uc("innerHtml",e.message,r.Jc),r.Db(2),r.uc("ngIf",e.duration),r.Db(1),r.uc("title",r.pc(17,12,e.timestamp)),r.Db(2),r.Sc(r.pc(19,14,e.timestamp)),r.Db(2),r.uc("ngClass",r.zc(29,ng,e.applicationClass))("title",e.application)}}function rg(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"button",25),r.lc("click",function(t){return r.Ic(e),r.nc(2).removeAll(),t.stopPropagation()}),r.Sb(2,"i",26),r.Rc(3," \xa0 "),r.Vb(4),r.bc(5,27),r.Ub(),r.Wb(),r.Sb(6,"hr"),r.Pc(7,ig,22,31,"div",28),r.Ub()}if(2&e){const e=r.nc(2);r.Db(2),r.uc("ngClass",r.zc(2,ng,e.icons.trash)),r.Db(5),r.uc("ngForOf",e.notifications)}}function sg(e,t){if(1&e&&r.Pc(0,rg,8,4,"ng-container",24),2&e){const e=r.nc();r.uc("ngIf",e.notifications.length>0)}}function og(e,t){1&e&&(r.Xb(0,"div"),r.Xb(1,"div",36),r.bc(2,37),r.Wb(),r.Wb())}function ag(e,t){if(1&e&&r.Pc(0,og,3,0,"div",24),2&e){const e=r.nc();r.uc("ngIf",0===e.notifications.length&&0===e.executingTasks.length)}}function cg(e,t){1&e&&r.Tb(0)}function lg(e,t){1&e&&r.Tb(0)}function ug(e,t){1&e&&r.Tb(0)}let dg=(()=>{class e{constructor(e,t,n,i,r,s,o,a){this.notificationService=e,this.summaryService=t,this.taskMessageService=n,this.prometheusNotificationService=i,this.authStorageService=r,this.prometheusAlertService=s,this.ngZone=o,this.cdRef=a,this.isSidebarOpened=!1,this.executingTasks=[],this.subs=new ir.a,this.icons=_n.a,this.last_task="",this.mutex=new Vb,this.simplebar={autoHide:!1},this.notifications=[]}ngOnDestroy(){window.clearInterval(this.interval),window.clearTimeout(this.timeout),this.subs.unsubscribe()}ngOnInit(){this.last_task=window.localStorage.getItem("last_task");const e=this.authStorageService.getPermissions();e.prometheus.read&&e.configOpt.read&&(this.triggerPrometheusAlerts(),this.ngZone.runOutsideAngular(()=>{this.interval=window.setInterval(()=>{this.ngZone.run(()=>{this.triggerPrometheusAlerts()})},5e3)})),this.subs.add(this.notificationService.data$.subscribe(e=>{this.notifications=Wt.a.orderBy(e,["timestamp"],["desc"]),this.cdRef.detectChanges()})),this.subs.add(this.notificationService.sidebarSubject.subscribe(e=>{this.isSidebarOpened=!e&&!this.isSidebarOpened,window.clearTimeout(this.timeout),this.timeout=window.setTimeout(()=>{this.cdRef.detectChanges()},0)})),this.subs.add(this.summaryService.subscribe(e=>{this._handleTasks(e.executing_tasks),this.mutex.acquire().then(t=>{Wt.a.filter(e.finished_tasks,e=>!this.last_task||nn()(e.end_time).isAfter(this.last_task)).forEach(e=>{const t=this.notificationService.finishedTaskToNotification(e,e.success),n=new Nd.a(t);n.timestamp=e.end_time,n.duration=e.duration,this.last_task&&!nn()(e.end_time).isAfter(this.last_task)||(this.last_task=e.end_time,window.localStorage.setItem("last_task",this.last_task)),this.notificationService.save(n)}),this.cdRef.detectChanges(),t()})}))}_handleTasks(e){for(const t of e)t.description=this.taskMessageService.getRunningTitle(t);this.executingTasks=e}triggerPrometheusAlerts(){this.prometheusAlertService.refresh(),this.prometheusNotificationService.refresh()}removeAll(){this.notificationService.removeAll()}remove(e){this.notificationService.remove(e)}closeSidebar(){this.isSidebarOpened=!1}trackByFn(e){return e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wn.a),r.Rb(kb.a),r.Rb(Ub.a),r.Rb(Bb),r.Rb(Gt.a),r.Rb($d),r.Rb(r.D),r.Rb(r.i))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-notifications-sidebar"]],hostVars:2,hostBindings:function(e,t){2&e&&r.Jb("active",t.isSidebarOpened)},decls:18,vars:6,consts:function(){let e,t,n,i,r;return e="Tasks and Notifications",t="Clear notifications",n="Remove notification",i="Duration:",r="There are no notifications.",[["tasksTpl",""],["notificationsTpl",""],["emptyTpl",""],[1,"card",3,"clickOutsideEnabled","clickOutside"],[1,"card-header"],e,["tabindex","-1","type","button",1,"close","float-right",3,"click"],[3,"ngClass"],[3,"options"],[1,"card-body"],[4,"ngTemplateOutlet"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"card","tc_task","border-0"],[1,"row","no-gutters"],[1,"col-md-2","text-center"],[1,"text-info",3,"ngClass"],[1,"col-md-9"],[1,"card-body","p-1"],[1,"card-title","bold"],[1,"mb-1"],["type","info",3,"value","striped","animated"],[1,"card-text","text-muted"],[1,"date","float-left"],[1,"float-right"],[4,"ngIf"],["type","button",1,"btn","btn-light","btn-block",3,"click"],["aria-hidden","true",3,"ngClass"],t,[3,"ngClass",4,"ngFor","ngForOf"],[1,"card","tc_notification","border-0"],[1,"col-md-10"],["title",n,1,"btn","btn-link","float-right","mt-0","pt-0",3,"click"],[1,"card-text",3,"innerHtml"],[1,"date",3,"title"],[1,"float-right","custom-icon",3,"ngClass","title"],i,[1,"message","text-center"],r]},template:function(e,t){if(1&e&&(r.Pc(0,Zb,1,2,"ng-template",null,0,r.Qc),r.Pc(2,sg,1,1,"ng-template",null,1,r.Qc),r.Pc(4,ag,1,1,"ng-template",null,2,r.Qc),r.Xb(6,"div",3),r.lc("clickOutside",function(){return t.closeSidebar()}),r.Xb(7,"div",4),r.Vb(8),r.bc(9,5),r.Ub(),r.Xb(10,"button",6),r.lc("click",function(){return t.closeSidebar()}),r.Xb(11,"span"),r.Sb(12,"i",7),r.Wb(),r.Wb(),r.Wb(),r.Xb(13,"ngx-simplebar",8),r.Xb(14,"div",9),r.Pc(15,cg,1,0,"ng-container",10),r.Pc(16,lg,1,0,"ng-container",10),r.Pc(17,ug,1,0,"ng-container",10),r.Wb(),r.Wb(),r.Wb()),2&e){const e=r.Fc(1),n=r.Fc(3),i=r.Fc(5);r.Db(6),r.uc("clickOutsideEnabled",t.isSidebarOpened),r.Db(6),r.uc("ngClass",t.icons.close),r.Db(1),r.uc("options",t.simplebar),r.Db(2),r.uc("ngTemplateOutlet",e),r.Db(1),r.uc("ngTemplateOutlet",n),r.Db(1),r.uc("ngTemplateOutlet",i)}},directives:[qb.a,On.a,s.p,Gb.a,s.w,s.q,Jt.z,s.r],pipes:[Xt.a,Br.a,Qd],styles:["[_nghost-%COMP%]{bottom:10px;max-width:90vw;position:fixed;right:-350px;top:53px;transition:all .6s;width:350px;z-index:9}.active[_nghost-%COMP%]{right:20px}.card[_ngcontent-%COMP%]{height:100%}.card-body[_ngcontent-%COMP%]{padding-left:0;padding-right:5px;padding-top:3px}ngx-simplebar[_ngcontent-%COMP%]{height:calc(100% - 42.2px)}.separator[_ngcontent-%COMP%]{background-color:#e9ecef;color:#6c757d;font-size:1rem;padding:5px 12px}.btn-block[_ngcontent-%COMP%]{width:98%}.btn-link[_ngcontent-%COMP%]   .fa-trash-o[_ngcontent-%COMP%]{color:#000}table[_ngcontent-%COMP%]{width:100%}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0;padding-bottom:1rem;padding-top:1rem}hr[_ngcontent-%COMP%]{margin-bottom:2px;margin-top:2px}.card-text[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),e})();function hg(e,t){1&e&&r.Sb(0,"span",5)}const fg=function(e){return{running:e}},pg=function(e){return[e]};let mg=(()=>{class e{constructor(e,t){this.notificationService=e,this.summaryService=t,this.icons=_n.a,this.hasRunningTasks=!1,this.hasNotifications=!1,this.subs=new ir.a}ngOnInit(){this.subs.add(this.summaryService.subscribe(e=>{this.hasRunningTasks=e.executing_tasks.length>0})),this.subs.add(this.notificationService.data$.subscribe(e=>{this.hasNotifications=e.length>0}))}ngOnDestroy(){this.subs.unsubscribe()}toggleSidebar(){this.notificationService.toggleSidebar()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(wn.a),r.Rb(kb.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-notifications"]],decls:5,vars:7,consts:function(){let e,t;return e="Tasks and Notifications",t="Tasks and Notifications",[["title",e,3,"ngClass","click"],[3,"ngClass"],["class","dot",4,"ngIf"],[1,"d-md-none"],t,[1,"dot"]]},template:function(e,t){1&e&&(r.Xb(0,"a",0),r.lc("click",function(){return t.toggleSidebar()}),r.Sb(1,"i",1),r.Pc(2,hg,1,0,"span",2),r.Xb(3,"span",3),r.bc(4,4),r.Wb(),r.Wb()),2&e&&(r.uc("ngClass",r.zc(3,fg,t.hasRunningTasks)),r.Db(1),r.uc("ngClass",r.zc(5,pg,t.icons.bell)),r.Db(1),r.uc("ngIf",t.hasNotifications))},directives:[s.p,s.r],styles:[".running[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#2b99a8}.running[_ngcontent-%COMP%]:hover   i[_ngcontent-%COMP%]{color:#fff}a[_ngcontent-%COMP%]   .dot[_ngcontent-%COMP%]{background-color:#2b99a8;border:2px solid #374249;border-radius:50%;height:11px;position:absolute;right:17px;top:10px;width:10px}a[_ngcontent-%COMP%]:hover   .dot[_ngcontent-%COMP%]{background-color:#fff;border-color:#2b99a8}"]}),e})();var bg=n("e0ae");let gg=(()=>{class e{constructor(e,t,n,i){this.activeModal=e,this.summaryService=t,this.userService=n,this.authStorageService=i,this.userPermission=this.authStorageService.getPermissions().user}ngOnInit(){this.projectConstants=gn.c,this.hostAddr=window.location.hostname,this.modalVariables=this.setVariables(),this.subs=this.summaryService.subscribe(e=>{const t=e.version.replace("ceph version ","").split(" ");this.hostAddr=e.mgr_host.replace(/(^\w+:|^)\/\//,"").replace(/\/$/,""),this.versionNumber=t[0],this.versionHash=t[1],this.versionName=t.slice(2,t.length).join(" ")})}ngOnDestroy(){this.subs.unsubscribe()}setVariables(){const e={};e.user=localStorage.getItem("dashboard_username"),e.role="user",this.userPermission.read&&this.userService.get(e.user).subscribe(t=>{e.role=t.roles});const t=Object(bg.a)();return e.browserName=t&&t.name?t.name:"Not detected",e.browserVersion=t&&t.version?t.version:"Not detected",e.browserOS=t&&t.os?t.os:"Not detected",e}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.a),r.Rb(kb.a),r.Rb($m.a),r.Rb(Gt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-about"]],decls:46,vars:13,consts:[[1,"about-container"],[1,"modal-header"],["type","button","aria-label","Close",1,"close","float-right",3,"click"],["aria-hidden","true"],[1,"modal-body"],["src","assets/Ceph_Ceph_Logo_with_text_red_white.svg",1,"ceph-logo",3,"alt"],[1,"product-versions"],[1,"modal-footer"],[1,"text-left"]],template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"div",1),r.Xb(2,"button",2),r.lc("click",function(){return t.activeModal.close()}),r.Xb(3,"span",3),r.Rc(4,"\xd7"),r.Wb(),r.Wb(),r.Wb(),r.Xb(5,"div",4),r.Sb(6,"img",5),r.Xb(7,"h3"),r.Xb(8,"strong"),r.Rc(9),r.Wb(),r.Wb(),r.Xb(10,"div",6),r.Xb(11,"strong"),r.Rc(12,"Version"),r.Wb(),r.Sb(13,"br"),r.Rc(14),r.Sb(15,"br"),r.Rc(16),r.Wb(),r.Sb(17,"br"),r.Xb(18,"dl"),r.Xb(19,"dt"),r.Rc(20,"Ceph Manager"),r.Wb(),r.Xb(21,"dd"),r.Rc(22),r.Wb(),r.Xb(23,"dt"),r.Rc(24,"User"),r.Wb(),r.Xb(25,"dd"),r.Rc(26),r.Wb(),r.Xb(27,"dt"),r.Rc(28,"User Role"),r.Wb(),r.Xb(29,"dd"),r.Rc(30),r.Wb(),r.Xb(31,"dt"),r.Rc(32,"Browser"),r.Wb(),r.Xb(33,"dd"),r.Rc(34),r.Wb(),r.Xb(35,"dt"),r.Rc(36,"Browser Version"),r.Wb(),r.Xb(37,"dd"),r.Rc(38),r.Wb(),r.Xb(39,"dt"),r.Rc(40,"Browser OS"),r.Wb(),r.Xb(41,"dd"),r.Rc(42),r.Wb(),r.Wb(),r.Wb(),r.Xb(43,"div",7),r.Xb(44,"div",8),r.Rc(45),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(6),r.vc("alt",t.projectConstants.organization),r.Db(3),r.Sc(t.projectConstants.projectName),r.Db(5),r.Uc(" ",t.versionNumber," ",t.versionHash," "),r.Db(2),r.Tc(" ",t.versionName," "),r.Db(6),r.Sc(t.hostAddr),r.Db(4),r.Sc(t.modalVariables.user),r.Db(4),r.Sc(t.modalVariables.role),r.Db(4),r.Sc(t.modalVariables.browserName),r.Db(4),r.Sc(t.modalVariables.browserVersion),r.Db(4),r.Sc(t.modalVariables.browserOS),r.Db(3),r.Uc(" ",t.projectConstants.copyright," ",t.projectConstants.license," "))},directives:[On.a],styles:[".about-container[_ngcontent-%COMP%]{background-color:#374249;background-image:url(ceph_background.e82dd79127290ddbe8cb.gif);background-position:100% 100%;background-repeat:no-repeat;color:#fff;text-shadow:1px 1px #374249}.product-versions[_ngcontent-%COMP%]{margin-top:30px}.product-versions[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{margin-right:10px}.modal-header[_ngcontent-%COMP%]{border-bottom:0}.modal-header[_ngcontent-%COMP%]   .close[_ngcontent-%COMP%]{color:#fff;font-size:2em}.modal-body[_ngcontent-%COMP%]{padding-left:80px;padding-right:80px}.ceph-logo[_ngcontent-%COMP%]{margin-bottom:30px;width:25%}.modal-footer[_ngcontent-%COMP%]{border-top:0;display:block;padding:15px 80px 35px}"]}),e})();const _g=function(e){return[e]},vg=function(e){return{disabled:e}};let yg=(()=>{class e{constructor(e,t){this.modalService=e,this.docService=t,this.icons=_n.a}ngOnInit(){this.docService.subscribeOnce("dashboard",e=>{this.docsUrl=e})}openAboutModal(){this.modalRef=this.modalService.show(gg,null,{size:"lg"})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(yn.a),r.Rb(hb.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-dashboard-help"]],decls:12,vars:7,consts:function(){let e,t,n,i,r;return e="Help",t="Help",n="documentation",i="API",r="About",[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","","title",e],[3,"ngClass"],[1,"d-md-none"],t,["ngbDropdownMenu",""],["ngbDropdownItem","","target","_blank",1,"text-capitalize",3,"ngClass","href"],n,["ngbDropdownItem","","href","/docs","target","_blank"],i,["ngbDropdownItem","",3,"click"],r]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"a",1),r.Sb(2,"i",2),r.Xb(3,"span",3),r.bc(4,4),r.Wb(),r.Wb(),r.Xb(5,"div",5),r.Xb(6,"a",6),r.bc(7,7),r.Wb(),r.Xb(8,"a",8),r.bc(9,9),r.Wb(),r.Xb(10,"button",10),r.lc("click",function(){return t.openAboutModal()}),r.bc(11,11),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(2),r.uc("ngClass",r.zc(3,_g,t.icons.questionCircle)),r.Db(4),r.vc("href",t.docsUrl,r.Lc),r.uc("ngClass",r.zc(5,vg,!t.docsUrl)))},directives:[Jt.i,Jt.m,s.p,Jt.k,Jt.j,On.a],styles:[""]}),e})();function wg(e,t){1&e&&(r.Xb(0,"button",9),r.bc(1,10),r.Wb())}function Dg(e,t){1&e&&(r.Xb(0,"button",11),r.bc(1,12),r.Wb())}const Sg=function(e){return[e]};function xg(e,t){if(1&e&&(r.Xb(0,"div",1),r.Xb(1,"a",2),r.Sb(2,"i",3),r.Xb(3,"span",4),r.bc(4,5),r.Wb(),r.Wb(),r.Xb(5,"div",6),r.Pc(6,wg,2,0,"button",7),r.Pc(7,Dg,2,0,"button",8),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(2),r.uc("ngClass",r.zc(3,Sg,e.icons.deepCheck)),r.Db(4),r.uc("ngIf",e.userPermission.read),r.Db(1),r.uc("ngIf",e.configOptPermission.read)}}let kg=(()=>{class e{constructor(e){this.authStorageService=e,this.icons=_n.a;const t=this.authStorageService.getPermissions();this.userPermission=t.user,this.configOptPermission=t.configOpt}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-administration"]],decls:1,vars:1,consts:function(){let e,t,n,i;return e="Dashboard Settings",t="Dashboard Settings",n="User management",i="Telemetry configuration",[["ngbDropdown","","placement","bottom-right",4,"ngIf"],["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","","title",e,1,"dropdown-toggle"],[3,"ngClass"],[1,"d-md-none"],t,["ngbDropdownMenu",""],["ngbDropdownItem","","routerLink","/user-management",4,"ngIf"],["ngbDropdownItem","","routerLink","/telemetry",4,"ngIf"],["ngbDropdownItem","","routerLink","/user-management"],n,["ngbDropdownItem","","routerLink","/telemetry"],i]},template:function(e,t){1&e&&r.Pc(0,xg,8,5,"div",0),2&e&&r.uc("ngIf",t.userPermission.read)},directives:[s.r,Jt.i,Jt.m,s.p,Jt.k,On.a,Jt.j,Pt.f],styles:[""]}),e})();const Tg=function(e){return[e]};function Mg(e,t){if(1&e&&(r.Xb(0,"button",12),r.Sb(1,"i",2),r.Xb(2,"span"),r.bc(3,13),r.Wb(),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngClass",r.zc(1,Tg,e.icons.lock))}}let Cg=(()=>{class e{constructor(e,t){this.authStorageService=e,this.authService=t,this.icons=_n.a}ngOnInit(){this.username=this.authStorageService.getUsername(),this.sso=this.authStorageService.isSSO()}logout(){this.authService.logout()}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(zm.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-identity"]],decls:15,vars:8,consts:function(){let e,t,n,i,r;return e="Logged in user",t="Logged in user",n="Signed in as " + "\ufffd#8\ufffd" + "" + "\ufffd0\ufffd" + "" + "\ufffd/#8\ufffd" + "",i="Sign out",r="Change password",[["ngbDropdown","","placement","bottom-right"],["ngbDropdownToggle","","title",e],[3,"ngClass"],[1,"d-md-none"],t,["ngbDropdownMenu",""],["ngbDropdownItem","","disabled",""],n,[1,"dropdown-divider"],["ngbDropdownItem","","routerLink","/user-profile/edit",4,"ngIf"],["ngbDropdownItem","",3,"click"],i,["ngbDropdownItem","","routerLink","/user-profile/edit"],r]},template:function(e,t){1&e&&(r.Xb(0,"div",0),r.Xb(1,"a",1),r.Sb(2,"i",2),r.Xb(3,"span",3),r.bc(4,4),r.Wb(),r.Wb(),r.Xb(5,"div",5),r.Xb(6,"button",6),r.hc(7,7),r.Sb(8,"strong"),r.ec(),r.Wb(),r.Sb(9,"li",8),r.Pc(10,Mg,4,3,"button",9),r.Xb(11,"button",10),r.lc("click",function(){return t.logout()}),r.Sb(12,"i",2),r.Xb(13,"span"),r.bc(14,11),r.Wb(),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(2),r.uc("ngClass",r.zc(4,Tg,t.icons.user)),r.Db(6),r.fc(t.username),r.cc(7),r.Db(2),r.uc("ngIf",!t.sso),r.Db(2),r.uc("ngClass",r.zc(6,Tg,t.icons.signOut)))},directives:[Jt.i,Jt.m,s.p,Jt.k,On.a,Jt.j,s.r,Pt.f],styles:[""]}),e})();function Og(e,t){1&e&&r.Tb(0)}function Lg(e,t){1&e&&r.Tb(0)}function Eg(e,t){if(1&e){const e=r.Yb();r.Xb(0,"li",21),r.Sb(1,"cd-language-selector",22),r.Wb(),r.Xb(2,"li",21),r.Xb(3,"cd-notifications",23),r.lc("click",function(){return r.Ic(e),r.nc().toggleRightSidebar()}),r.Wb(),r.Wb(),r.Xb(4,"li",21),r.Sb(5,"cd-dashboard-help",22),r.Wb(),r.Xb(6,"li",21),r.Sb(7,"cd-administration",22),r.Wb(),r.Xb(8,"li",21),r.Sb(9,"cd-identity",22),r.Wb()}}function Ag(e,t){1&e&&(r.Xb(0,"li",49),r.Xb(1,"a",50),r.bc(2,51),r.Wb(),r.Wb())}function Ig(e,t){1&e&&(r.Xb(0,"li",52),r.Xb(1,"a",53),r.bc(2,54),r.Wb(),r.Wb())}function Rg(e,t){1&e&&(r.Xb(0,"li",55),r.Xb(1,"a",56),r.bc(2,57),r.Wb(),r.Wb())}function Pg(e,t){1&e&&(r.Xb(0,"li",58),r.Xb(1,"a",59),r.bc(2,60),r.Wb(),r.Wb())}function Fg(e,t){1&e&&(r.Xb(0,"li",61),r.Xb(1,"a",62),r.bc(2,63),r.Wb(),r.Wb())}function Wg(e,t){1&e&&(r.Xb(0,"li",64),r.Xb(1,"a",65),r.bc(2,66),r.Wb(),r.Wb())}function jg(e,t){1&e&&(r.Xb(0,"li",67),r.Xb(1,"a",68),r.bc(2,69),r.Wb(),r.Wb())}function Yg(e,t){1&e&&(r.Xb(0,"li",70),r.Xb(1,"a",71),r.bc(2,72),r.Wb(),r.Wb())}function Ng(e,t){1&e&&(r.Xb(0,"li",73),r.Xb(1,"a",74),r.bc(2,75),r.Wb(),r.Wb())}function zg(e,t){if(1&e&&(r.Xb(0,"small",80),r.Rc(1),r.Wb()),2&e){const e=r.nc(5);r.Db(1),r.Sc(e.prometheusAlertService.activeAlerts)}}function $g(e,t){if(1&e&&(r.Xb(0,"li",76),r.Xb(1,"a",77),r.Vb(2),r.bc(3,78),r.Ub(),r.Pc(4,zg,2,1,"small",79),r.Wb(),r.Wb()),2&e){const e=r.nc(4);r.Db(4),r.uc("ngIf",e.prometheusAlertService.activeAlerts>0)}}function Hg(e,t){if(1&e){const e=r.Yb();r.Xb(0,"li",35),r.Xb(1,"a",36),r.lc("click",function(){return r.Ic(e),r.nc(3).toggleSubMenu("cluster")}),r.Vb(2),r.bc(3,37),r.Ub(),r.Wb(),r.Xb(4,"ul",38),r.Pc(5,Ag,3,0,"li",39),r.Pc(6,Ig,3,0,"li",40),r.Pc(7,Rg,3,0,"li",41),r.Pc(8,Pg,3,0,"li",42),r.Pc(9,Fg,3,0,"li",43),r.Pc(10,Wg,3,0,"li",44),r.Pc(11,jg,3,0,"li",45),r.Pc(12,Yg,3,0,"li",46),r.Pc(13,Ng,3,0,"li",47),r.Pc(14,$g,5,1,"li",48),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.Eb("aria-expanded","cluster"==e.displayedSubMenu),r.Db(3),r.uc("ngbCollapse","cluster"!==e.displayedSubMenu),r.Db(1),r.uc("ngIf",e.permissions.hosts.read),r.Db(1),r.uc("ngIf",e.permissions.hosts.read),r.Db(1),r.uc("ngIf",e.permissions.monitor.read),r.Db(1),r.uc("ngIf",e.permissions.hosts.read),r.Db(1),r.uc("ngIf",e.permissions.osd.read),r.Db(1),r.uc("ngIf",e.permissions.configOpt.read),r.Db(1),r.uc("ngIf",e.permissions.osd.read),r.Db(1),r.uc("ngIf",e.permissions.configOpt.read),r.Db(1),r.uc("ngIf",e.permissions.log.read),r.Db(1),r.uc("ngIf",e.permissions.prometheus.read)}}function Xg(e,t){1&e&&(r.Xb(0,"li",81),r.Xb(1,"a",82),r.bc(2,83),r.Wb(),r.Wb())}function Vg(e,t){1&e&&(r.Xb(0,"li",90),r.Xb(1,"a",91),r.bc(2,92),r.Wb(),r.Wb())}function Bg(e,t){if(1&e&&(r.Xb(0,"small",97),r.Rc(1),r.Wb()),2&e){const e=r.nc(5);r.Db(1),r.Sc(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.warnings)}}function Ug(e,t){if(1&e&&(r.Xb(0,"small",80),r.Rc(1),r.Wb()),2&e){const e=r.nc(5);r.Db(1),r.Sc(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.errors)}}function qg(e,t){if(1&e&&(r.Xb(0,"li",93),r.Xb(1,"a",94),r.Vb(2),r.bc(3,95),r.Ub(),r.Pc(4,Bg,2,1,"small",96),r.Pc(5,Ug,2,1,"small",79),r.Wb(),r.Wb()),2&e){const e=r.nc(4);r.Db(4),r.uc("ngIf",0!==(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.warnings)),r.Db(1),r.uc("ngIf",0!==(null==e.summaryData||null==e.summaryData.rbd_mirroring?null:e.summaryData.rbd_mirroring.errors))}}function Gg(e,t){1&e&&(r.Xb(0,"li",98),r.Xb(1,"a",99),r.bc(2,100),r.Wb(),r.Wb())}function Jg(e,t){if(1&e){const e=r.Yb();r.Xb(0,"li",84),r.Xb(1,"a",85),r.lc("click",function(){return r.Ic(e),r.nc(3).toggleSubMenu("block")}),r.Vb(2),r.bc(3,86),r.Ub(),r.Wb(),r.Xb(4,"ul",38),r.Pc(5,Vg,3,0,"li",87),r.Pc(6,qg,6,2,"li",88),r.Pc(7,Gg,3,0,"li",89),r.Wb(),r.Wb()}if(2&e){const e=r.nc().ngIf,t=r.nc(2);r.Db(1),r.uc("ngStyle",t.blockHealthColor()),r.Eb("aria-expanded","block"==t.displayedSubMenu),r.Db(3),r.uc("ngbCollapse","block"!==t.displayedSubMenu),r.Db(1),r.uc("ngIf",t.permissions.rbdImage.read&&e.rbd),r.Db(1),r.uc("ngIf",t.permissions.rbdMirroring.read&&e.mirroring),r.Db(1),r.uc("ngIf",t.permissions.iscsi.read&&e.iscsi)}}function Kg(e,t){1&e&&(r.Xb(0,"li",101),r.Xb(1,"a",102),r.bc(2,103),r.Wb(),r.Wb())}function Qg(e,t){1&e&&(r.Xb(0,"li",104),r.Xb(1,"a",105),r.bc(2,106),r.Wb(),r.Wb())}function Zg(e,t){if(1&e){const e=r.Yb();r.Xb(0,"li",107),r.Xb(1,"a",36),r.lc("click",function(){return r.Ic(e),r.nc(3).toggleSubMenu("rgw")}),r.Vb(2),r.bc(3,108),r.Ub(),r.Wb(),r.Xb(4,"ul",38),r.Xb(5,"li",109),r.Xb(6,"a",110),r.bc(7,111),r.Wb(),r.Wb(),r.Xb(8,"li",112),r.Xb(9,"a",113),r.bc(10,114),r.Wb(),r.Wb(),r.Xb(11,"li",115),r.Xb(12,"a",116),r.bc(13,117),r.Wb(),r.Wb(),r.Wb(),r.Wb()}if(2&e){const e=r.nc(3);r.Db(1),r.Eb("aria-expanded","rgw"==e.displayedSubMenu),r.Db(3),r.uc("ngbCollapse","rgw"!==e.displayedSubMenu)}}const e_=function(e){return[e]};function t_(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"li",25),r.Xb(2,"a",26),r.Xb(3,"span"),r.bc(4,27),r.Wb(),r.Rc(5,"\xa0 "),r.Sb(6,"i",28),r.oc(7,"healthColor"),r.Wb(),r.Wb(),r.Pc(8,Hg,15,12,"li",29),r.Pc(9,Xg,3,0,"li",30),r.Pc(10,Jg,8,6,"li",31),r.Pc(11,Kg,3,0,"li",32),r.Pc(12,Qg,3,0,"li",33),r.Pc(13,Zg,14,2,"li",34),r.Ub()),2&e){const e=t.ngIf,n=r.nc(2);r.Db(6),r.uc("ngClass",r.zc(10,e_,n.icons.health))("ngStyle",r.pc(7,8,null==n.summaryData?null:n.summaryData.health_status)),r.Db(2),r.uc("ngIf",n.permissions.hosts.read||n.permissions.monitor.read||n.permissions.osd.read||n.permissions.configOpt.read||n.permissions.log.read||n.permissions.prometheus.read),r.Db(1),r.uc("ngIf",n.permissions.pool.read),r.Db(1),r.uc("ngIf",(n.permissions.rbdImage.read||n.permissions.rbdMirroring.read||n.permissions.iscsi.read)&&(e.rbd||e.mirroring||e.iscsi)),r.Db(1),r.uc("ngIf",n.permissions.nfs.read&&e.nfs),r.Db(1),r.uc("ngIf",n.permissions.cephfs.read&&e.cephfs),r.Db(1),r.uc("ngIf",n.permissions.rgw.read&&e.rgw)}}function n_(e,t){if(1&e&&(r.Pc(0,t_,14,12,"ng-container",24),r.oc(1,"async")),2&e){const e=r.nc();r.uc("ngIf",r.pc(1,1,e.enabledFeature$))}}const i_=function(e){return{show:e}},r_=function(e){return{active:e}},s_=["*"];let o_=(()=>{class e{constructor(e,t,n,i,r,s){this.authStorageService=e,this.summaryService=t,this.featureToggles=n,this.telemetryNotificationService=i,this.prometheusAlertService=r,this.motdNotificationService=s,this.notifications=[],this.icons=_n.a,this.rightSidebarOpen=!1,this.showMenuSidebar=!0,this.displayedSubMenu="",this.simplebar={autoHide:!1},this.subs=new ir.a,this.permissions=this.authStorageService.getPermissions(),this.enabledFeature$=this.featureToggles.get()}get class(){return"top-notification-"+this.notifications.length}ngOnInit(){this.subs.add(this.summaryService.subscribe(e=>{this.summaryData=e})),this.subs.add(this.authStorageService.isPwdDisplayed$.subscribe(e=>{this.showTopNotification("isPwdDisplayed",e)})),this.subs.add(this.telemetryNotificationService.update.subscribe(e=>{this.showTopNotification("telemetryNotificationEnabled",e)})),this.subs.add(this.motdNotificationService.motd$.subscribe(e=>{this.showTopNotification("motdNotificationEnabled",Ft.isPlainObject(e))}))}ngOnDestroy(){this.subs.unsubscribe()}blockHealthColor(){if(this.summaryData&&this.summaryData.rbd_mirroring){if(this.summaryData.rbd_mirroring.errors>0)return{color:"#d9534f"};if(this.summaryData.rbd_mirroring.warnings>0)return{color:"#f0ad4e"}}}toggleSubMenu(e){this.displayedSubMenu=this.displayedSubMenu===e?"":e}toggleRightSidebar(){this.rightSidebarOpen=!this.rightSidebarOpen}showTopNotification(e,t){if(t)this.notifications.includes(e)||this.notifications.push(e);else{const t=this.notifications.indexOf(e);t>=0&&this.notifications.splice(t,1)}}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(kb.a),r.Rb(tf.a),r.Rb(Nh),r.Rb($d),r.Rb(Ib))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-navigation"]],hostVars:2,hostBindings:function(e,t){2&e&&r.Fb(t.class)},ngContentSelectors:s_,decls:29,vars:12,consts:function(){let e,t,n,i,r,s,o,a,c,l,u,d,h,f,p,m,b,g,_,v,y,w,D,S;return e="Toggle navigation",t="Dashboard",n="Cluster",i="Hosts",r="Physical Disks",s="Monitors",o="Services",a="OSDs",c="Configuration",l="CRUSH map",u="Manager Modules",d="Logs",h="Monitoring",f="Pools",p="Block",m="Images",b="Mirroring",g="iSCSI",_="NFS",v="File Systems",y="Object Gateway",w="Daemons",D="Users",S="Buckets",[[1,"cd-navbar-top"],[1,"navbar","fixed-top","navbar-expand-md","navbar-dark","cd-navbar-brand"],[1,"btn","btn-link","py-0",3,"click"],["aria-hidden","true",1,"fa","fa-bars","fa-2x"],["href","#",1,"navbar-brand","ml-2"],["src","assets/Ceph_Ceph_Logo_with_text_white.svg","alt","Ceph"],["type","button",1,"navbar-toggler",3,"click"],[1,"sr-only"],e,[1,""],[1,"fa","fa-navicon","fa-lg"],[1,"collapse","navbar-collapse",3,"ngClass"],[1,"nav","navbar-nav","cd-navbar-utility","my-2","my-md-0"],[4,"ngTemplateOutlet"],[1,"wrapper"],["id","sidebar",3,"ngClass"],[3,"options"],[1,"list-unstyled","components","cd-navbar-primary"],["id","content",3,"ngClass"],["cd_utilities",""],["cd_menu",""],[1,"nav-item"],[1,"cd-navbar"],[1,"cd-navbar",3,"click"],[4,"ngIf"],["routerLinkActive","active",1,"nav-item","tc_menuitem_dashboard"],["routerLink","/dashboard",1,"nav-link"],t,[3,"ngClass","ngStyle"],["routerLinkActive","active","class","nav-item tc_menuitem_cluster",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_pool",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_block",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_nfs",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_cephfs",4,"ngIf"],["routerLinkActive","active","class","nav-item tc_menuitem_rgw",4,"ngIf"],["routerLinkActive","active",1,"nav-item","tc_menuitem_cluster"],["aria-controls","collapseBasic",1,"nav-link","dropdown-toggle",3,"click"],n,[1,"list-unstyled",3,"ngbCollapse"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_hosts",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_inventory",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_monitor",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_cluster_services",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_osds",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_configuration",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_crush",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_modules",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_log",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_monitoring",4,"ngIf"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_hosts"],["routerLink","/hosts"],i,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_inventory"],["routerLink","/inventory"],r,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_monitor"],["routerLink","/monitor/"],s,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_cluster_services"],["routerLink","/services/"],o,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_osds"],["routerLink","/osd"],a,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_configuration"],["routerLink","/configuration"],c,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_crush"],["routerLink","/crush-map"],l,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_modules"],["routerLink","/mgr-modules"],u,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_log"],["routerLink","/logs"],d,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_monitoring"],["routerLink","/monitoring"],h,["class","badge badge-danger",4,"ngIf"],[1,"badge","badge-danger"],["routerLinkActive","active",1,"nav-item","tc_menuitem_pool"],["routerLink","/pool",1,"nav-link"],f,["routerLinkActive","active",1,"nav-item","tc_menuitem_block"],["aria-controls","collapseBasic",1,"nav-link","dropdown-toggle",3,"ngStyle","click"],p,["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_images",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_mirroring",4,"ngIf"],["routerLinkActive","active","class","tc_submenuitem tc_submenuitem_block_iscsi",4,"ngIf"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_images"],["routerLink","/block/rbd"],m,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_mirroring"],["routerLink","/block/mirroring"],b,["class","badge badge-warning",4,"ngIf"],[1,"badge","badge-warning"],["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_block_iscsi"],["routerLink","/block/iscsi"],g,["routerLinkActive","active",1,"nav-item","tc_menuitem_nfs"],["routerLink","/nfs",1,"nav-link"],_,["routerLinkActive","active",1,"nav-item","tc_menuitem_cephfs"],["routerLink","/cephfs",1,"nav-link"],v,["routerLinkActive","active",1,"nav-item","tc_menuitem_rgw"],y,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_daemons"],["routerLink","/rgw/daemon"],w,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_users"],["routerLink","/rgw/user"],D,["routerLinkActive","active",1,"tc_submenuitem","tc_submenuitem_rgw_buckets"],["routerLink","/rgw/bucket"],S]},template:function(e,t){if(1&e&&(r.tc(),r.Sb(0,"cd-pwd-expiration-notification"),r.Sb(1,"cd-telemetry-notification"),r.Sb(2,"cd-motd"),r.Sb(3,"cd-notifications-sidebar"),r.Xb(4,"div",0),r.Xb(5,"nav",1),r.Xb(6,"button",2),r.lc("click",function(){return t.showMenuSidebar=!t.showMenuSidebar}),r.Sb(7,"i",3),r.Wb(),r.Xb(8,"a",4),r.Sb(9,"img",5),r.Wb(),r.Xb(10,"button",6),r.lc("click",function(){return t.toggleRightSidebar()}),r.Xb(11,"span",7),r.bc(12,8),r.Wb(),r.Xb(13,"span",9),r.Sb(14,"i",10),r.Wb(),r.Wb(),r.Xb(15,"div",11),r.Xb(16,"ul",12),r.Pc(17,Og,1,0,"ng-container",13),r.Wb(),r.Wb(),r.Wb(),r.Wb(),r.Xb(18,"div",14),r.Xb(19,"nav",15),r.Xb(20,"ngx-simplebar",16),r.Xb(21,"ul",17),r.Pc(22,Lg,1,0,"ng-container",13),r.Wb(),r.Wb(),r.Wb(),r.Xb(23,"div",18),r.sc(24),r.Wb(),r.Wb(),r.Pc(25,Eg,10,0,"ng-template",null,19,r.Qc),r.Pc(27,n_,2,3,"ng-template",null,20,r.Qc)),2&e){const e=r.Fc(26),n=r.Fc(28);r.Db(15),r.uc("ngClass",r.zc(6,i_,t.rightSidebarOpen)),r.Db(2),r.uc("ngTemplateOutlet",e),r.Db(2),r.uc("ngClass",r.zc(8,r_,!t.showMenuSidebar)),r.Db(1),r.uc("options",t.simplebar),r.Db(2),r.uc("ngTemplateOutlet",n),r.Db(1),r.uc("ngClass",r.zc(10,r_,!t.showMenuSidebar))}},directives:[jb,Nb,Hb,dg,Jt.v,On.a,s.p,s.w,Gb.a,Db,mg,yg,kg,Cg,s.r,Pt.g,Pt.h,s.s,Jt.e],pipes:[s.b,_f],styles:['@charset "UTF-8";  cd-navigation .cd-navbar-top .cd-navbar-brand{background:#374249;border-top:4px solid #2b99a8}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand,   cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand:hover{color:#e9ecef;height:auto;padding:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-brand>img{height:25px}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler{border:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler:focus,   cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler:hover{outline:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-toggler .fa-navicon{color:#e9ecef}  cd-navigation .cd-navbar-top .cd-navbar-brand .navbar-collapse{padding:0}  cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>.active>a{background-color:#2b99a8;color:#e9ecef}  cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a,   cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a:focus,   cd-navigation .cd-navbar-top .cd-navbar-brand .cd-navbar-utility>li>.open>a:hover{background-color:initial;border-color:#0000;color:#e9ecef}  cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown]>a,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>a,   cd-navigation .cd-navbar-top .navbar-nav>li>a{color:#e9ecef;display:block;line-height:1;padding:13.5px 18px!important;position:relative;text-decoration:none}  cd-navigation .cd-navbar-top .navbar-nav .nav-link,   cd-navigation .cd-navbar-top .navbar-nav .nav-link:hover{color:#e9ecef}  cd-navigation .cd-navbar-top .navbar-nav>li:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown].open>a,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>[ngbDropdown]>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>.cd-navbar>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>li>a:hover{background-color:#2b99a8}  cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>[ngbDropdown]>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>[ngbDropdown]>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>a:hover,   cd-navigation .cd-navbar-top .navbar-nav>.open>.cd-navbar>li>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>a,   cd-navigation .cd-navbar-top .navbar-nav>.open>a:focus,   cd-navigation .cd-navbar-top .navbar-nav>.open>a:hover{background-color:initial;border-color:#0000;color:#e9ecef}@media (min-width:768px){  cd-navigation .cd-navbar-top .cd-navbar-utility{border-bottom:0;font-size:1.1rem;position:absolute;right:0;top:0}}@media (max-width:calc(768px - 1px)){  cd-navigation .cd-navbar-top .navbar-nav{margin:0}  cd-navigation .cd-navbar-top .navbar-nav .fa{margin-right:.5em}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu{background-color:#2b99a8;border:0;padding-bottom:0;padding-top:0}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu>li>a{color:#e9ecef;padding:5px 15px 5px 35px}  cd-navigation .cd-navbar-top .navbar-nav .open .dropdown-menu>.active>a{background-color:#2b99a8}  cd-navigation .cd-navbar-top .navbar-nav>li>a:hover{background-color:#2b99a8}}.cd-navbar-primary[_ngcontent-%COMP%]   .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .cd-navbar-primary[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .cd-navbar-primary[_ngcontent-%COMP%] > .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#2b99a8!important;border:0!important;color:#e9ecef!important}.wrapper[_ngcontent-%COMP%]{display:flex;width:100%}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]{background:#374249;bottom:0;color:#fff;left:0;overflow-y:auto;position:fixed;top:43px;transition:all .3s;width:200px;z-index:999}.wrapper[_ngcontent-%COMP%]   #sidebar.active[_ngcontent-%COMP%]{margin-left:-200px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul.component[_ngcontent-%COMP%]{margin:0;padding:20px 0}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:#fff;padding:10px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:#fff;display:block;font-size:1.1em;padding:10px 10px 10px 27px;text-decoration:none}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{background:#2b99a8;color:#fff}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   a[_ngcontent-%COMP%] > .badge[_ngcontent-%COMP%]{margin-left:5px}.wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .wrapper[_ngcontent-%COMP%]   #sidebar[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]   a[aria-expanded=true][_ngcontent-%COMP%]{color:#fff}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[_ngcontent-%COMP%]{position:relative}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[_ngcontent-%COMP%]:after{border:0;content:"\uf054";font-family:ForkAwesome;font-size:1rem;position:absolute;right:20px;transition:transform .3s ease-in-out}.wrapper[_ngcontent-%COMP%]   a.dropdown-toggle[aria-expanded=true][_ngcontent-%COMP%]:after{transform:rotate(90deg)}.wrapper[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{background:#4d5c66;font-size:.9em!important;padding-left:40px!important}.wrapper[_ngcontent-%COMP%]   .cd-navbar-primary[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus{outline:none}.wrapper[_ngcontent-%COMP%]   ngx-simplebar[_ngcontent-%COMP%]{height:100%}#content[_ngcontent-%COMP%]{bottom:0;position:absolute;right:0;top:43px;transition:all .3s;width:calc(100% - 200px)}#content.active[_ngcontent-%COMP%]{width:100vw}.top-notification-1[_nghost-%COMP%]   .cd-navbar-top[_ngcontent-%COMP%]   .cd-navbar-brand[_ngcontent-%COMP%]{top:37.6px}.top-notification-1[_nghost-%COMP%]   #sidebar[_ngcontent-%COMP%]{top:80.6px}.top-notification-1[_nghost-%COMP%]   #content[_ngcontent-%COMP%]{top:80.6px}.top-notification-1[_nghost-%COMP%]   cd-notifications-sidebar[_ngcontent-%COMP%]{top:90.6px}.top-notification-2[_nghost-%COMP%]   .cd-navbar-top[_ngcontent-%COMP%]   .cd-navbar-brand[_ngcontent-%COMP%]{top:75.2px}.top-notification-2[_nghost-%COMP%]   #sidebar[_ngcontent-%COMP%]{top:118.2px}.top-notification-2[_nghost-%COMP%]   #content[_ngcontent-%COMP%]{top:118.2px}.top-notification-2[_nghost-%COMP%]   cd-notifications-sidebar[_ngcontent-%COMP%]{top:128.2px}']}),e})();var a_=n("5yfJ"),c_=n("9xzX");function l_(e,t){if(1&e){const e=r.Yb();r.Vb(0),r.Xb(1,"button",8),r.lc("click",function(){r.Ic(e);const n=t.$implicit;return r.nc(3).onDaemonSelection(n)}),r.Rc(2),r.Wb(),r.Ub()}if(2&e){const e=t.$implicit;r.Db(2),r.Uc(" ",e.id," ( ",e.zonegroup_name," ) ")}}function u_(e,t){if(1&e&&(r.Vb(0),r.Xb(1,"div",1),r.Xb(2,"span",2),r.bc(3,3),r.Wb(),r.Xb(4,"div",4),r.Xb(5,"button",5),r.Rc(6),r.Wb(),r.Xb(7,"div",6),r.Pc(8,l_,3,2,"ng-container",7),r.Wb(),r.Wb(),r.Wb(),r.Ub()),2&e){const e=r.nc().ngIf;r.Db(6),r.Uc(" ",e.selectedDaemon.id," ( ",e.selectedDaemon.zonegroup_name," ) "),r.Db(2),r.uc("ngForOf",e.daemons)}}function d_(e,t){if(1&e&&(r.Vb(0),r.Pc(1,u_,9,3,"ng-container",0),r.Ub()),2&e){const e=t.ngIf,n=r.nc();r.Db(1),r.uc("ngIf",e.ftMap&&e.ftMap.rgw&&n.permissions.rgw.read&&n.isRgwRoute&&e.daemons.length>1)}}const h_=function(e,t,n){return{ftMap:e,daemons:t,selectedDaemon:n}};let f_=(()=>{class e{constructor(e,t,n,i,r){this.authStorageService=e,this.featureToggles=t,this.router=n,this.timerService=i,this.rgwDaemonService=r,this.REFRESH_INTERVAL=5e3,this.subs=new ir.a,this.rgwUrlPrefix="/rgw",this.isRgwRoute=document.location.href.includes(this.rgwUrlPrefix)}ngOnInit(){this.permissions=this.authStorageService.getPermissions(),this.featureToggleMap$=this.featureToggles.get(),this.subs.add(this.router.events.pipe(Object(da.a)(e=>e instanceof Pt.b)).subscribe(()=>this.isRgwRoute=this.router.url.startsWith(this.rgwUrlPrefix))),this.subs.add(this.timerService.get(()=>this.isRgwRoute?this.rgwDaemonService.list():a_.a,this.REFRESH_INTERVAL).subscribe())}ngOnDestroy(){this.subs.unsubscribe()}onDaemonSelection(e){this.rgwDaemonService.selectDaemon(e),this.reloadData()}reloadData(){const e=this.router.url;this.router.navigateByUrl(this.rgwUrlPrefix,{skipLocationChange:!0}).finally(()=>{this.router.navigate([e])})}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Gt.a),r.Rb(tf.a),r.Rb(Pt.e),r.Rb(jc.a),r.Rb(c_.a))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-context"]],decls:4,vars:11,consts:function(){let e,t;return e="Selected Object Gateway:",t="Select Object Gateway",[[4,"ngIf"],[1,"cd-context-bar","pt-3","pb-3"],[1,"mr-1"],e,["ngbDropdown","","placement","bottom-left",1,"d-inline-block","ml-2"],["ngbDropdownToggle","","title",t,1,"btn","btn-outline-info","ctx-bar-selected-rgw-daemon"],["ngbDropdownMenu",""],[4,"ngFor","ngForOf"],["ngbDropdownItem","",1,"ctx-bar-available-rgw-daemon",3,"click"]]},template:function(e,t){1&e&&(r.Pc(0,d_,2,1,"ng-container",0),r.oc(1,"async"),r.oc(2,"async"),r.oc(3,"async")),2&e&&r.uc("ngIf",r.Bc(7,h_,r.pc(1,1,t.featureToggleMap$),r.pc(2,3,t.rgwDaemonService.daemons$),r.pc(3,5,t.rgwDaemonService.selectedDaemon$)))},directives:[s.r,Jt.i,On.a,Jt.m,Jt.k,s.q,Jt.j],pipes:[s.b],styles:[".cd-context-bar[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}"]}),e})();var p_=n("GyhO"),m_=n("Cfvw"),b_=n("zx2A");class g_{constructor(e,t){this.keySelector=e,this.flushes=t}call(e,t){return t.subscribe(new __(e,this.keySelector,this.flushes))}}class __ extends b_.b{constructor(e,t,n){super(e),this.keySelector=t,this.values=new Set,n&&this.add(Object(b_.c)(n,new b_.a(this)))}notifyNext(){this.values.clear()}notifyError(e){this._error(e)}_next(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)}_useKeySelector(e){let t;const{destination:n}=this;try{t=this.keySelector(e)}catch(i){return void n.error(i)}this._finalizeNext(t,e)}_finalizeNext(e,t){const{values:n}=this;n.has(e)||(n.add(e),this.destination.next(t))}}var v_=n("SxV6");class y_{resolve(e){const t=e.routeConfig.data,n=null===t.path?null:this.getFullPath(e),i=[{text:"string"==typeof t.breadcrumbs?t.breadcrumbs:t.breadcrumbs.text||t.text||n,path:n}];return Object(Ai.a)(i)}getFullPath(e){return(e=>e.reduce((e,t)=>e+t.url.reduce((e,t)=>e+"/"+t.path,""),""))(e.pathFromRoot)}}function w_(e,t){if(1&e&&(r.Xb(0,"a",6),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit;r.uc("routerLink",e.path),r.Db(1),r.Sc(e.text)}}function D_(e,t){if(1&e&&(r.Xb(0,"span"),r.Rc(1),r.Wb()),2&e){const e=r.nc().$implicit;r.Db(1),r.Sc(e.text)}}const S_=function(e){return{active:e}};function x_(e,t){if(1&e&&(r.Xb(0,"li",3),r.Pc(1,w_,2,2,"a",4),r.Pc(2,D_,2,1,"span",5),r.Wb()),2&e){const e=t.$implicit,n=t.last,i=r.nc(2);r.uc("ngClass",r.zc(3,S_,n&&i.finished)),r.Db(1),r.uc("ngIf",!n&&null!==e.path),r.Db(1),r.uc("ngIf",n||null===e.path)}}function k_(e,t){if(1&e&&(r.Xb(0,"ol",1),r.Pc(1,x_,3,5,"li",2),r.Wb()),2&e){const e=r.nc();r.Db(1),r.uc("ngForOf",e.crumbs)}}let T_=(()=>{class e{constructor(e,t){this.router=e,this.injector=t,this.crumbs=[],this.finished=!1,this.defaultResolver=new y_,this.subscription=this.router.events.pipe(Object(da.a)(e=>e instanceof Pt.c)).subscribe(()=>{this.finished=!1}),this.subscription=this.router.events.pipe(Object(da.a)(e=>e instanceof Pt.b)).subscribe(()=>{var t;this._resolveCrumbs(e.routerState.snapshot.root).pipe(Object(Ni.a)(e=>e),(t=e=>e.text,e=>e.lift(new g_(t,void 0))),Yi(),Object(Ni.a)(e=>{const t=this.postProcess(e);return this.wrapIntoObservable(t).pipe(Object(v_.a)())})).subscribe(e=>{this.finished=!0,this.crumbs=e})})}ngOnDestroy(){this.subscription.unsubscribe()}_resolveCrumbs(e){let t;const n=e.routeConfig&&e.routeConfig.data;if(n&&n.breadcrumbs){let i;i=n.breadcrumbs.prototype instanceof y_?this.injector.get(n.breadcrumbs):this.defaultResolver;const r=i.resolve(e);t=this.wrapIntoObservable(r).pipe(Object(v_.a)())}else t=Object(Ai.a)([]);return e.firstChild&&(t=Object(p_.a)(t,this._resolveCrumbs(e.firstChild))),t}postProcess(e){const t=[];return e.forEach(e=>{const n=e.text.split("/");if(n.length>1){e.text=n[n.length-1];for(let e=0;e<n.length-1;e++)t.push({text:n[e],path:null})}t.push(e)}),t}isPromise(e){return e&&"function"==typeof e.then}wrapIntoObservable(e){return e instanceof Rh.a?e:this.isPromise(e)?Object(m_.a)(Promise.resolve(e)):Object(Ai.a)(e)}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e),r.Rb(r.v))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-breadcrumbs"]],decls:1,vars:1,consts:[["class","breadcrumb",4,"ngIf"],[1,"breadcrumb"],["class","breadcrumb-item",3,"ngClass",4,"ngFor","ngForOf"],[1,"breadcrumb-item",3,"ngClass"],["preserveFragment","",3,"routerLink",4,"ngIf"],[4,"ngIf"],["preserveFragment","",3,"routerLink"]],template:function(e,t){1&e&&r.Pc(0,k_,2,1,"ol",0),2&e&&r.uc("ngIf",t.crumbs.length)},directives:[s.r,s.q,s.p,Pt.h],styles:['@charset "UTF-8";.breadcrumb[_ngcontent-%COMP%]{background-color:initial;border-radius:0;margin-top:8px;padding:8px 0}.breadcrumb[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]:before{content:"\uf101";font-family:ForkAwesome;padding:0 5px 0 7px}']}),e})();const M_=function(e){return{dashboard:e}};let C_=(()=>{class e{constructor(e,t,n,i){this.router=e,this.summaryService=t,this.taskManagerService=n,this.faviconService=i,this.subs=new ir.a}ngOnInit(){this.subs.add(this.summaryService.startPolling()),this.subs.add(this.taskManagerService.init(this.summaryService)),this.faviconService.init()}ngOnDestroy(){this.subs.unsubscribe()}isDashboardPage(){return"/dashboard"===this.router.url}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Pt.e),r.Rb(kb.a),r.Rb(Mb.a),r.Rb(Tb))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-workbench-layout"]],features:[r.Cb([Tb])],decls:6,vars:3,consts:[[1,"container-fluid","h-100",3,"ngClass"]],template:function(e,t){1&e&&(r.Xb(0,"block-ui"),r.Xb(1,"cd-navigation"),r.Xb(2,"div",0),r.Sb(3,"cd-context"),r.Sb(4,"cd-breadcrumbs"),r.Sb(5,"router-outlet"),r.Wb(),r.Wb(),r.Wb()),2&e&&(r.Db(2),r.uc("ngClass",r.zc(1,M_,t.isDashboardPage())))},directives:[eu,o_,s.p,f_,T_,Pt.j],styles:[".dashboard[_ngcontent-%COMP%]{background-color:#e9ecef;margin:0;padding:0}.container-fluid[_ngcontent-%COMP%]{overflow:auto}"]}),e})();var O_=n("Avrn");let L_=(()=>{class e{constructor(e,t){this.router=e,this.authStorageService=t}canActivate(e,t){return!(this.authStorageService.isLoggedIn()&&!this.authStorageService.isSSO()&&this.authStorageService.getPwdUpdateRequired()&&(this.router.navigate(["/login-change-password"],{queryParams:{returnUrl:t.url}}),1))}canActivateChild(e,t){return this.canActivate(e,t)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(Pt.e),r.ic(Gt.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var E_=n("Vhfg");let A_=(()=>{class e{constructor(e,t,n){this.http=e,this.router=t,this.mgrModuleService=n}canActivate(e){return this.doCheck(e)}canActivateChild(e){return this.doCheck(e)}doCheck(t){if(t.url.length>0&&e.ALLOWLIST.includes(t.url[0].path))return Object(Ai.a)(!0);const n=t.data.moduleStatusGuardConfig;let i=!1;return n.backend&&this.mgrModuleService.getConfig("orchestrator").subscribe(e=>{i=n.backend===e.orchestrator},()=>(this.router.navigate([n.redirectTo]),Object(Ai.a)(!1))),this.http.get(`api/${n.apiPath}/status`).pipe(Object(Ii.a)(e=>(e.available||i||this.router.navigate([n.redirectTo||""],{state:{header:n.header,message:e.message,section:n.section,section_info:n.section_info,icon:_n.a.wrench}}),e.available)),Object(up.a)(()=>(this.router.navigate([n.redirectTo]),Object(Ai.a)(!1))))}}return e.ALLOWLIST=["501"],e.\u0275fac=function(t){return new(t||e)(r.ic(o.b),r.ic(Pt.e),r.ic(wl))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),I_=(()=>{class e{constructor(e){this.authStorageService=e}canActivate(){if(!this.authStorageService.isSSO())return!0;throw new ih.c}canActivateChild(){return this.canActivate()}}return e.\u0275fac=function(t){return new(t||e)(r.ic(Gt.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),R_=(()=>{class e extends y_{resolve(e){const t=[],n=e.queryParams.fromLink||null;let i="";switch(n){case"/monitor":i="Monitors";break;case"/hosts":i="Hosts"}return t.push({text:"Cluster",path:null}),t.push({text:i,path:n}),t.push({text:"Performance Counters",path:""}),t}}return e.\u0275fac=function(t){return P_(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();const P_=r.Zb(R_);let F_=(()=>{class e extends y_{resolve(e){const t=e.params.name;return[{text:`${Wt.a.startCase(t)}/Edit`,path:t}]}}return e.\u0275fac=function(t){return W_(t||e)},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})();const W_=r.Zb(F_),j_=[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"",component:C_,canActivate:[O_.a,L_],canActivateChild:[O_.a,L_],children:[{path:"dashboard",component:lp},{path:"error",component:bb},{path:"expand-cluster",component:Fc,canActivate:[A_],data:{moduleStatusGuardConfig:{apiPath:"orchestrator",redirectTo:"dashboard",backend:"cephadm"},breadcrumbs:"Expand Cluster"}},{path:"hosts",component:yo,data:{breadcrumbs:"Cluster/Hosts"},children:[{path:gn.e.ADD,component:yr,outlet:"modal"}]},{path:"monitor",component:mu,data:{breadcrumbs:"Cluster/Monitors"}},{path:"services",component:Dc,canActivate:[A_],data:{moduleStatusGuardConfig:{apiPath:"orchestrator",redirectTo:"error",section:"orch",section_info:"Orchestrator",header:"Orchestrator is not available"},breadcrumbs:"Cluster/Services"},children:[{path:gn.e.CREATE,component:bc,outlet:"modal"},{path:`${gn.e.EDIT}/:type/:name`,component:bc,outlet:"modal"}]},{path:"inventory",canActivate:[A_],component:Xr,data:{moduleStatusGuardConfig:{apiPath:"orchestrator",redirectTo:"error",section:"orch",section_info:"Orchestrator",header:"Orchestrator is not available"},breadcrumbs:"Cluster/Physical Disks"}},{path:"osd",data:{breadcrumbs:"Cluster/OSDs"},children:[{path:"",component:Wd},{path:gn.e.CREATE,component:Zo,data:{breadcrumbs:gn.a.CREATE}}]},{path:"configuration",data:{breadcrumbs:"Cluster/Configuration"},children:[{path:"",component:Ci},{path:"edit/:name",component:bi,data:{breadcrumbs:gn.a.EDIT}}]},{path:"crush-map",component:Gc,data:{breadcrumbs:"Cluster/CRUSH map"}},{path:"logs",component:yl,data:{breadcrumbs:"Cluster/Logs"}},{path:"telemetry",component:Bh,data:{breadcrumbs:"Telemetry configuration"}},{path:"monitoring",data:{breadcrumbs:"Cluster/Monitoring"},children:[{path:"",redirectTo:"active-alerts",pathMatch:"full"},{path:"active-alerts",data:{breadcrumbs:"Active Alerts"},component:Kd},{path:"alerts",data:{breadcrumbs:"Alerts"},component:nh},{path:"silences",data:{breadcrumbs:"Silences"},children:[{path:"",component:jh},{path:gn.e.CREATE,component:Ah,data:{breadcrumbs:`${gn.a.CREATE} Silence`}},{path:`${gn.e.CREATE}/:id`,component:Ah,data:{breadcrumbs:gn.a.CREATE}},{path:`${gn.e.EDIT}/:id`,component:Ah,data:{breadcrumbs:gn.a.EDIT}},{path:`${gn.e.RECREATE}/:id`,component:Ah,data:{breadcrumbs:gn.a.RECREATE}}]}]},{path:"perf_counters/:type/:id",component:Nm,data:{breadcrumbs:R_}},{path:"mgr-modules",data:{breadcrumbs:"Cluster/Manager Modules"},children:[{path:"",component:hu},{path:"edit/:name",component:$l,data:{breadcrumbs:F_}}]},{path:"pool",data:{breadcrumbs:"Pools"},loadChildren:()=>Promise.all([n.e(1),n.e(5)]).then(n.bind(null,"5azF")).then(e=>e.RoutedPoolModule)},{path:"block",data:{breadcrumbs:!0,text:"Block",path:null},loadChildren:()=>n.e(1).then(n.bind(null,"k/xb")).then(e=>e.RoutedBlockModule)},{path:"cephfs",component:Vn,canActivate:[E_.a],data:{breadcrumbs:"File Systems"}},{path:"rgw",canActivateChild:[E_.a,A_],data:{moduleStatusGuardConfig:{apiPath:"rgw",redirectTo:"error",section:"rgw",section_info:"Object Gateway",header:"The Object Gateway Service is not configured"},breadcrumbs:!0,text:"Object Gateway",path:null},loadChildren:()=>n.e(6).then(n.bind(null,"OkK6")).then(e=>e.RoutedRgwModule)},{path:"user-management",data:{breadcrumbs:"User management",path:null},loadChildren:()=>Promise.resolve().then(n.bind(null,"LceX")).then(e=>e.RoutedAuthModule)},{path:"user-profile",data:{breadcrumbs:"User profile",path:null},children:[{path:gn.e.EDIT,component:Qm,canActivate:[I_],data:{breadcrumbs:gn.a.EDIT}}]},{path:"nfs",canActivateChild:[E_.a,A_],data:{moduleStatusGuardConfig:{apiPath:"nfs-ganesha",redirectTo:"error",section:"nfs-ganesha",section_info:"NFS GANESHA",header:"NFS-Ganesha is not configured"},breadcrumbs:"NFS"},children:[{path:"",component:Ym},{path:gn.e.CREATE,component:Mm,data:{breadcrumbs:gn.a.CREATE}},{path:`${gn.e.EDIT}/:cluster_id/:export_id`,component:Mm,data:{breadcrumbs:gn.a.EDIT}}]}]},{path:"",component:xb,children:[{path:"login",component:db},{path:"login-change-password",component:ob,canActivate:[I_]}]},{path:"",component:gb,children:[{path:"**",redirectTo:"/error"}]}];let Y_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({providers:[F_,R_],imports:[[Pt.i.forRoot(j_,{useHash:!0,preloadingStrategy:Pt.d,relativeLinkResolution:"legacy"})],Pt.i]}),e})(),N_=(()=>{class e{constructor(e,t){e.autoClose="outside",e.container="body",e.placement="bottom",t.container="body"}}return e.\u0275fac=function(t){return new(t||e)(r.Rb(Jt.x),r.Rb(Jt.E))},e.\u0275cmp=r.Lb({type:e,selectors:[["cd-root"]],decls:1,vars:0,template:function(e,t){1&e&&r.Sb(0,"router-outlet")},directives:[Pt.j],styles:[""]}),e})();var z_=n("PCNd");let $_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c,z_.a,Y_,sn.b,kn.c,Jt.t]]}),e})();var H_=n("G6Q+"),X_=n("kJI8");let V_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[Y_,s.c,xn.x,z_.a,Jt.t]]}),e})(),B_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({providers:[Jt.a],imports:[[s.c,H_.a,Jt.t,z_.a,Pt.i,xn.m,xn.x,Jt.F,V_,Jt.H,Jt.C,kn.c,X_.a,Jt.h,Jt.y,Jt.l,Ur.a]]}),e})(),U_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[X_.a,s.c,Jt.t,z_.a,sn.b,Pt.i,Jt.y]]}),e})(),q_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[xn.x,Pt.i,z_.a,Jt.t,s.c,Jt.H,Jt.F]]}),e})(),G_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c,B_,U_,H_.a,$_,q_,z_.a]]}),e})();var J_=n("LceX");let K_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[s.c,J_.AuthModule,Jt.f,Jt.l,Y_,z_.a,Gb.b,Pt.i]]}),e})(),Q_=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e}),e.\u0275inj=r.Ob({imports:[[au.forRoot(),s.c,K_,Jt.l,Pt.i,z_.a],K_]}),e})(),Z_=(()=>{class e{constructor(e,t,n){this.router=e,this.authStorageService=t,this.notificationService=n}intercept(e,t){const n=e.headers.get("Accept");let i;return i=n&&n.startsWith("application/vnd.ceph.api.v")?e.clone():e.clone({setHeaders:{Accept:$i.a.cdVersionHeader("1","0")}}),t.handle(i).pipe(Object(up.a)(e=>{if(e instanceof o.d){let t;switch(e.status){case 400:const n=new Bi.a,i=e.error.task;Wt.a.isPlainObject(i)?(i.metadata.component=i.metadata.component||e.error.component,n.name=i.name,n.metadata=i.metadata):n.metadata=e.error,n.success=!1,n.exception=e.error,t=this.notificationService.notifyTask(n);break;case 401:this.authStorageService.remove(),this.router.navigate(["/login"]);break;case 403:this.router.navigate(["error"],{state:{message:"Sorry, you don\u2019t have permission to view this page or resource.",header:"Access Denied",icon:"fa fa-lock",source:"forbidden"}});break;default:t=this.prepareNotification(e)}e.preventDefault=()=>{this.notificationService.cancel(t)},e.ignoreStatusCode=function(e){this.status===e&&this.preventDefault()}}return Object(dp.a)(e)}))}prepareNotification(e){return this.notificationService.show(()=>{let t="";return Wt.a.isPlainObject(e.error)&&Wt.a.isString(e.error.detail)?t=e.error.detail:Wt.a.isString(e.error)?t=e.error:Wt.a.isString(e.message)&&(t=e.message),new Nd.b(vn.a.error,`${e.status} - ${e.statusText}`,t,void 0,e.application)})}}return e.\u0275fac=function(t){return new(t||e)(r.ic(Pt.e),r.ic(Gt.a),r.ic(wn.a))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),ev=(()=>{class e{constructor(e){this.http=e}jsError(e,t,n){return this.http.post("ui-api/logging/js-error",{url:e,message:t,stack:n})}}return e.\u0275fac=function(t){return new(t||e)(r.ic(o.b))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),tv=(()=>{class e{constructor(e,t){this.injector=e,this.router=t}handleError(e){const t=this.injector.get(ev),n=window.location.href;if(t.jsError(n,e&&e.message,e&&e.stack).subscribe(),!(e.rejection instanceof ih.a))throw e;setTimeout(()=>this.router.navigate(["error"],{state:{message:e.rejection.message,header:e.rejection.header,icon:e.rejection.icon}}),50)}}return e.\u0275fac=function(t){return new(t||e)(r.ic(r.v),r.ic(Pt.e))},e.\u0275prov=r.Nb({token:e,factory:e.\u0275fac}),e})(),nv=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=r.Pb({type:e,bootstrap:[N_]}),e.\u0275inj=r.Ob({providers:[{provide:r.o,useClass:tv},{provide:o.a,useClass:Z_,multi:!0},{provide:s.a,useValue:"/"+(window.location.pathname.split("/",1)[1]||"")}],imports:[[o.c,i.a,It,Rt.a.forRoot({positionClass:"toast-top-right",preventDuplicates:!0,enableHtml:!0}),Y_,Q_,z_.a,G_],z_.a]}),e})();_b.a.production&&Object(r.V)(),i.d().bootstrapModule(nv).then(e=>{if(Object(r.X)()){const t=e.injector.get(r.g).components[0];Object(i.c)(t)}}).catch(e=>console.log(e))},zWsK:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return r});var i=n("8Y7J");let r=(()=>{class e{transform(e,t,n){return n?t.call(n,e):t(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=i.Qb({name:"pipeFunction",type:e,pure:!0}),e})(),s=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=i.Pb({type:e}),e.\u0275inj=i.Ob({}),e})()},zc8c:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var i=n("/NlG"),r=n("XFyV"),s=n("spCT"),o=n("8Y7J");let a=(()=>{class e{constructor(e,t,n){this.templateRef=e,this.viewContainer=t,this.componentFactoryResolver=n}set cdFormLoading(e){let t,n;switch(this.viewContainer.clear(),e){case s.b.Loading:t=this.componentFactoryResolver.resolveComponentFactory(r.a),n=this.resolveNgContent("Loading form data..."),this.viewContainer.createComponent(t,null,null,n);break;case s.b.Ready:this.viewContainer.createEmbeddedView(this.templateRef);break;case s.b.Error:t=this.componentFactoryResolver.resolveComponentFactory(i.a),n=this.resolveNgContent("Form data could not be loaded."),this.viewContainer.createComponent(t,null,null,n).instance.type="error"}}resolveNgContent(e){return[[document.createTextNode(e)]]}}return e.\u0275fac=function(t){return new(t||e)(o.Rb(o.O),o.Rb(o.S),o.Rb(o.k))},e.\u0275dir=o.Mb({type:e,selectors:[["","cdFormLoading",""]],inputs:{cdFormLoading:"cdFormLoading"}}),e})()},zk60:function(e,t,n){var i=n("2oRo"),r=Object.defineProperty;e.exports=function(e,t){try{r(i,e,{value:t,configurable:!0,writable:!0})}catch(n){i[e]=t}return t}},zn8P:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="zn8P"},zx2A:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return c});var i=n("7o/Q"),r=n("HDdC"),s=n("SeVD");class o extends i.a{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class a extends i.a{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function c(e,t){if(!t.closed)return e instanceof r.a?e.subscribe(t):Object(s.a)(e)(t)}},zx6S:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,i){var r=t.words[i];return 1===i.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedelje] [u] LT","[pro\u0161log] [ponedeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))}},[[0,0]]]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.69188bf73a1e0d939338.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.69188bf73a1e0d939338.js
new file mode 100644 (file)
index 0000000..ef295f4
--- /dev/null
@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(e,t,n){e.exports=n("hN/g")},Enxc:function(e,t){},"hN/g":function(e,t,n){"use strict";n.r(t),n("Enxc"),n("pDpN")},pDpN:function(e,t,n){var o,r;void 0===(r="function"==typeof(o=function(){"use strict";!function(e){const t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function o(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");const r=e.__Zone_symbol_prefix||"__zone_symbol__";function s(e){return r+e}const i=!0===e[s("forceDuplicateZoneCheck")];if(e.Zone){if(i||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}class a{constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new l(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(e.Promise!==C.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=a.current;for(;e.parent;)e=e.parent;return e}static get current(){return z.zone}static get currentTask(){return j}static __load_patch(t,r){if(C.hasOwnProperty(t)){if(i)throw Error("Already loaded patch: "+t)}else if(!e["__Zone_disable_"+t]){const s="Zone:"+t;n(s),C[t]=r(e,a,O),o(s,s)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),o=this;return function(){return o.runGuarded(n,this,arguments,t)}}run(e,t,n,o){z={parent:z,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,o)}finally{z=z.parent}}runGuarded(e,t=null,n,o){z={parent:z,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,o)}catch(r){if(this._zoneDelegate.handleError(this,r))throw r}}finally{z=z.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");if(e.state===v&&(e.type===P||e.type===D))return;const o=e.state!=E;o&&e._transitionTo(E,T),e.runCount++;const r=j;j=e,z={parent:z,zone:this};try{e.type==D&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{e.state!==v&&e.state!==Z&&(e.type==P||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,E):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(v,E,v))),z=z.parent,j=r}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,v);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(n){throw e._transitionTo(Z,b,v),this._zoneDelegate.handleError(this,n),n}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(T,b),e}scheduleMicroTask(e,t,n,o){return this.scheduleTask(new u(S,e,t,n,o,void 0))}scheduleMacroTask(e,t,n,o,r){return this.scheduleTask(new u(D,e,t,n,o,r))}scheduleEventTask(e,t,n,o,r){return this.scheduleTask(new u(P,e,t,n,o,r))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");e._transitionTo(w,T,E);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(Z,w),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(v,w),e.runCount=0,e}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let o=0;o<n.length;o++)n[o]._updateTaskCount(e.type,t)}}a.__symbol__=s;const c={name:"",onHasTask:(e,t,n,o)=>e.hasTask(n,o),onScheduleTask:(e,t,n,o)=>e.scheduleTask(n,o),onInvokeTask:(e,t,n,o,r,s)=>e.invokeTask(n,o,r,s),onCancelTask:(e,t,n,o)=>e.cancelTask(n,o)};class l{constructor(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const o=n&&n.onHasTask;(o||t&&t._hasTaskZS)&&(this._hasTaskZS=o?n:c,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new a(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,o,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,o,r):t.apply(n,o)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=S)throw new Error("Task is missing scheduleFn.");k(t)}return n}invokeTask(e,t,n,o){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,o):t.callback.apply(n,o)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}_updateTaskCount(e,t){const n=this._taskCounts,o=n[e],r=n[e]=o+t;if(r<0)throw new Error("More tasks executed then were scheduled.");0!=o&&0!=r||this.hasTask(this.zone,{microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})}}class u{constructor(t,n,o,r,s,i){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=n,this.data=r,this.scheduleFn=s,this.cancelFn=i,!o)throw new Error("callback is not defined");this.callback=o;const a=this;this.invoke=t===P&&r&&r.useG?u.invokeTask:function(){return u.invokeTask.call(e,a,this,arguments)}}static invokeTask(e,t,n){e||(e=this),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&m(),I--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(v,b)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==v&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const h=s("setTimeout"),p=s("Promise"),f=s("then");let d,g=[],_=!1;function k(t){if(0===I&&0===g.length)if(d||e[p]&&(d=e[p].resolve(0)),d){let e=d[f];e||(e=d.then),e.call(d,m)}else e[h](m,0);t&&g.push(t)}function m(){if(!_){for(_=!0;g.length;){const t=g;g=[];for(let n=0;n<t.length;n++){const o=t[n];try{o.zone.runTask(o,null,null)}catch(e){O.onUnhandledError(e)}}}O.microtaskDrainDone(),_=!1}}const y={name:"NO ZONE"},v="notScheduled",b="scheduling",T="scheduled",E="running",w="canceling",Z="unknown",S="microTask",D="macroTask",P="eventTask",C={},O={symbol:s,currentZoneFrame:()=>z,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:k,showUncaughtError:()=>!a[s("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,setNativePromise:e=>{e&&"function"==typeof e.resolve&&(d=e.resolve(0))},patchEventPrototype:()=>N,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N};let z={parent:null,zone:new a(null,null)},j=null,I=0;function N(){}o("Zone","Zone"),e.Zone=a}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global),Zone.__load_patch("ZoneAwarePromise",(e,t,n)=>{const o=Object.getOwnPropertyDescriptor,r=Object.defineProperty,s=n.symbol,i=[],a=!0===e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=s("Promise"),l=s("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const t=i.shift();try{t.zone.runGuarded(()=>{throw t})}catch(e){h(e)}}};const u=s("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(o){}}function p(e){return e&&e.then}function f(e){return e}function d(e){return O.reject(e)}const g=s("state"),_=s("value"),k=s("finally"),m=s("parentPromiseValue"),y=s("parentPromiseState"),v=null,b=!0,T=!1;function E(e,t){return n=>{try{Z(e,t,n)}catch(o){Z(e,!1,o)}}}const w=s("currentTaskTrace");function Z(e,o,s){const c=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}}();if(e===s)throw new TypeError("Promise resolved with itself");if(e[g]===v){let h=null;try{"object"!=typeof s&&"function"!=typeof s||(h=s&&s.then)}catch(u){return c(()=>{Z(e,!1,u)})(),e}if(o!==T&&s instanceof O&&s.hasOwnProperty(g)&&s.hasOwnProperty(_)&&s[g]!==v)D(s),Z(e,s[g],s[_]);else if(o!==T&&"function"==typeof h)try{h.call(s,c(E(e,o)),c(E(e,!1)))}catch(u){c(()=>{Z(e,!1,u)})()}else{e[g]=o;const c=e[_];if(e[_]=s,e[k]===k&&o===b&&(e[g]=e[y],e[_]=e[m]),o===T&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&r(s,w,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<c.length;)P(e,c[t++],c[t++],c[t++],c[t++]);if(0==c.length&&o==T){e[g]=0;let o=s;if(!a)try{throw new Error("Uncaught (in promise): "+((l=s)&&l.toString===Object.prototype.toString?(l.constructor&&l.constructor.name||"")+": "+JSON.stringify(l):l?l.toString():Object.prototype.toString.call(l))+(s&&s.stack?"\n"+s.stack:""))}catch(u){o=u}o.rejection=s,o.promise=e,o.zone=t.current,o.task=t.currentTask,i.push(o),n.scheduleMicroTask()}}}var l;return e}const S=s("rejectionHandledHandler");function D(e){if(0===e[g]){try{const n=t[S];n&&"function"==typeof n&&n.call(this,{rejection:e[_],promise:e})}catch(n){}e[g]=T;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function P(e,t,n,o,r){D(e);const s=e[g],i=s?"function"==typeof o?o:f:"function"==typeof r?r:d;t.scheduleMicroTask("Promise.then",()=>{try{const o=e[_],r=!!n&&k===n[k];r&&(n[m]=o,n[y]=s);const a=t.run(i,void 0,r&&i!==d&&i!==f?[]:[o]);Z(n,!0,a)}catch(o){Z(n,!1,o)}},n)}const C=function(){};class O{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return Z(new this(null),b,e)}static reject(e){return Z(new this(null),T,e)}static race(e){let t,n,o=new this((e,o)=>{t=e,n=o});function r(e){t(e)}function s(e){n(e)}for(let i of e)p(i)||(i=this.resolve(i)),i.then(r,s);return o}static all(e){return O.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof O?this:O).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,o,r=new this((e,t)=>{n=e,o=t}),s=2,i=0;const a=[];for(let l of e){p(l)||(l=this.resolve(l));const e=i;try{l.then(o=>{a[e]=t?t.thenCallback(o):o,s--,0===s&&n(a)},r=>{t?(a[e]=t.errorCallback(r),s--,0===s&&n(a)):o(r)})}catch(c){o(c)}s++,i++}return s-=2,0===s&&n(a),r}constructor(e){const t=this;if(!(t instanceof O))throw new Error("Must be an instanceof Promise.");t[g]=v,t[_]=[];try{e&&e(E(t,b),E(t,T))}catch(n){Z(t,!1,n)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return O}then(e,n){let o=this.constructor[Symbol.species];o&&"function"==typeof o||(o=this.constructor||O);const r=new o(C),s=t.current;return this[g]==v?this[_].push(s,r,e,n):P(this,s,r,e,n),r}catch(e){return this.then(null,e)}finally(e){let n=this.constructor[Symbol.species];n&&"function"==typeof n||(n=O);const o=new n(C);o[k]=k;const r=t.current;return this[g]==v?this[_].push(r,o,e,e):P(this,r,o,e,e),o}}O.resolve=O.resolve,O.reject=O.reject,O.race=O.race,O.all=O.all;const z=e[c]=e.Promise,j=t.__symbol__("ZoneAwarePromise");let I=o(e,"Promise");I&&!I.configurable||(I&&delete I.writable,I&&delete I.value,I||(I={configurable:!0,enumerable:!0}),I.get=function(){return e[j]?e[j]:e[c]},I.set=function(t){t===O?e[j]=t:(e[c]=t,t.prototype[l]||R(t),n.setNativePromise(t))},r(e,"Promise",I)),e.Promise=O;const N=s("thenPatched");function R(e){const t=e.prototype,n=o(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const r=t.then;t[l]=r,e.prototype.then=function(e,t){return new O((e,t)=>{r.call(this,e,t)}).then(e,t)},e[N]=!0}if(n.patchThen=R,z){R(z);const t=e.fetch;"function"==typeof t&&(e[n.symbol("fetch")]=t,e.fetch=(x=t,function(){let e=x.apply(this,arguments);if(e instanceof O)return e;let t=e.constructor;return t[N]||R(t),e}))}var x;return Promise[t.__symbol__("uncaughtPromiseErrors")]=i,O});const e=Object.getOwnPropertyDescriptor,t=Object.defineProperty,n=Object.getPrototypeOf,o=Object.create,r=Array.prototype.slice,s="addEventListener",i="removeEventListener",a=Zone.__symbol__(s),c=Zone.__symbol__(i),l="true",u="false",h=Zone.__symbol__("");function p(e,t){return Zone.current.wrap(e,t)}function f(e,t,n,o,r){return Zone.current.scheduleMacroTask(e,t,n,o,r)}const d=Zone.__symbol__,g="undefined"!=typeof window,_=g?window:void 0,k=g&&_||"object"==typeof self&&self||global,m=[null];function y(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=p(e[n],t+"_"+n));return e}function v(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const b="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,T=!("nw"in k)&&void 0!==k.process&&"[object process]"==={}.toString.call(k.process),E=!T&&!b&&!(!g||!_.HTMLElement),w=void 0!==k.process&&"[object process]"==={}.toString.call(k.process)&&!b&&!(!g||!_.HTMLElement),Z={},S=function(e){if(!(e=e||k.event))return;let t=Z[e.type];t||(t=Z[e.type]=d("ON_PROPERTY"+e.type));const n=this||e.target||k,o=n[t];let r;if(E&&n===_&&"error"===e.type){const t=e;r=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===r&&e.preventDefault()}else r=o&&o.apply(this,arguments),null==r||r||e.preventDefault();return r};function D(n,o,r){let s=e(n,o);if(!s&&r&&e(r,o)&&(s={enumerable:!0,configurable:!0}),!s||!s.configurable)return;const i=d("on"+o+"patched");if(n.hasOwnProperty(i)&&n[i])return;delete s.writable,delete s.value;const a=s.get,c=s.set,l=o.substr(2);let u=Z[l];u||(u=Z[l]=d("ON_PROPERTY"+l)),s.set=function(e){let t=this;t||n!==k||(t=k),t&&(t[u]&&t.removeEventListener(l,S),c&&c.apply(t,m),"function"==typeof e?(t[u]=e,t.addEventListener(l,S,!1)):t[u]=null)},s.get=function(){let e=this;if(e||n!==k||(e=k),!e)return null;const t=e[u];if(t)return t;if(a){let t=a&&a.call(this);if(t)return s.set.call(this,t),"function"==typeof e.removeAttribute&&e.removeAttribute(o),t}return null},t(n,o,s),n[i]=!0}function P(e,t,n){if(t)for(let o=0;o<t.length;o++)D(e,"on"+t[o],n);else{const t=[];for(const n in e)"on"==n.substr(0,2)&&t.push(n);for(let o=0;o<t.length;o++)D(e,t[o],n)}}const C=d("originalInstance");function O(e){const n=k[e];if(!n)return;k[d(e)]=n,k[e]=function(){const t=y(arguments,e);switch(t.length){case 0:this[C]=new n;break;case 1:this[C]=new n(t[0]);break;case 2:this[C]=new n(t[0],t[1]);break;case 3:this[C]=new n(t[0],t[1],t[2]);break;case 4:this[C]=new n(t[0],t[1],t[2],t[3]);break;default:throw new Error("Arg list too long.")}},I(k[e],n);const o=new n(function(){});let r;for(r in o)"XMLHttpRequest"===e&&"responseBlob"===r||function(n){"function"==typeof o[n]?k[e].prototype[n]=function(){return this[C][n].apply(this[C],arguments)}:t(k[e].prototype,n,{set:function(t){"function"==typeof t?(this[C][n]=p(t,e+"."+n),I(this[C][n],t)):this[C][n]=t},get:function(){return this[C][n]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(k[e][r]=n[r])}function z(t,o,r){let s=t;for(;s&&!s.hasOwnProperty(o);)s=n(s);!s&&t[o]&&(s=t);const i=d(o);let a=null;if(s&&!(a=s[i])&&(a=s[i]=s[o],v(s&&e(s,o)))){const e=r(a,i,o);s[o]=function(){return e(this,arguments)},I(s[o],a)}return a}function j(e,t,n){let o=null;function r(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}o=z(e,t,e=>function(t,o){const s=n(t,o);return s.cbIdx>=0&&"function"==typeof o[s.cbIdx]?f(s.name,o[s.cbIdx],s,r):e.apply(t,o)})}function I(e,t){e[d("OriginalDelegate")]=t}let N=!1,R=!1;function x(){try{const e=_.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}function M(){if(N)return R;N=!0;try{const e=_.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(R=!0)}catch(e){}return R}Zone.__load_patch("toString",e=>{const t=Function.prototype.toString,n=d("OriginalDelegate"),o=d("Promise"),r=d("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[o];if(n)return t.call(n)}if(this===Error){const n=e[r];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return this instanceof Promise?"[object Promise]":i.call(this)}});let L=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){L=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(he){L=!1}const A={useG:!0},H={},F={},G=new RegExp("^"+h+"(\\w+)(true|false)$"),B=d("propagationStopped");function q(e,t){const n=(t?t(e):e)+u,o=(t?t(e):e)+l,r=h+n,s=h+o;H[e]={},H[e].false=r,H[e].true=s}function W(e,t,o){const r=o&&o.add||s,a=o&&o.rm||i,c=o&&o.listeners||"eventListeners",p=o&&o.rmAll||"removeAllListeners",f=d(r),g="."+r+":",_=function(e,t,n){if(e.isRemoved)return;const o=e.callback;"object"==typeof o&&o.handleEvent&&(e.callback=e=>o.handleEvent(e),e.originalDelegate=o),e.invoke(e,t,[n]);const r=e.options;r&&"object"==typeof r&&r.once&&t[a].call(t,n.type,e.originalDelegate?e.originalDelegate:e.callback,r)},k=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[H[t.type].false];if(o)if(1===o.length)_(o[0],n,t);else{const e=o.slice();for(let o=0;o<e.length&&(!t||!0!==t[B]);o++)_(e[o],n,t)}},m=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[H[t.type].true];if(o)if(1===o.length)_(o[0],n,t);else{const e=o.slice();for(let o=0;o<e.length&&(!t||!0!==t[B]);o++)_(e[o],n,t)}};function y(t,o){if(!t)return!1;let s=!0;o&&void 0!==o.useG&&(s=o.useG);const i=o&&o.vh;let _=!0;o&&void 0!==o.chkDup&&(_=o.chkDup);let y=!1;o&&void 0!==o.rt&&(y=o.rt);let v=t;for(;v&&!v.hasOwnProperty(r);)v=n(v);if(!v&&t[r]&&(v=t),!v)return!1;if(v[f])return!1;const b=o&&o.eventNameToString,E={},w=v[f]=v[r],Z=v[d(a)]=v[a],S=v[d(c)]=v[c],D=v[d(p)]=v[p];let P;function C(e,t){return!L&&"object"==typeof e&&e?!!e.capture:L&&t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?Object.assign(Object.assign({},e),{passive:!0}):e:{passive:!0}:e}o&&o.prepend&&(P=v[d(o.prepend)]=v[o.prepend]);const O=s?function(e){if(!E.isExisting)return w.call(E.target,E.eventName,E.capture?m:k,E.options)}:function(e){return w.call(E.target,E.eventName,e.invoke,E.options)},z=s?function(e){if(!e.isRemoved){const t=H[e.eventName];let n;t&&(n=t[e.capture?l:u]);const o=n&&e.target[n];if(o)for(let r=0;r<o.length;r++)if(o[r]===e){o.splice(r,1),e.isRemoved=!0,0===o.length&&(e.allRemoved=!0,e.target[n]=null);break}}if(e.allRemoved)return Z.call(e.target,e.eventName,e.capture?m:k,e.options)}:function(e){return Z.call(e.target,e.eventName,e.invoke,e.options)},j=o&&o.diff?o.diff:function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},N=Zone[d("BLACK_LISTED_EVENTS")],R=e[d("PASSIVE_EVENTS")],x=function(t,n,r,a,c=!1,h=!1){return function(){const p=this||e;let f=arguments[0];o&&o.transferEventName&&(f=o.transferEventName(f));let d=arguments[1];if(!d)return t.apply(this,arguments);if(T&&"uncaughtException"===f)return t.apply(this,arguments);let g=!1;if("function"!=typeof d){if(!d.handleEvent)return t.apply(this,arguments);g=!0}if(i&&!i(t,d,p,arguments))return;const k=L&&!!R&&-1!==R.indexOf(f),m=C(arguments[2],k);if(N)for(let e=0;e<N.length;e++)if(f===N[e])return k?t.call(p,f,d,m):t.apply(this,arguments);const y=!!m&&("boolean"==typeof m||m.capture),v=!(!m||"object"!=typeof m)&&m.once,w=Zone.current;let Z=H[f];Z||(q(f,b),Z=H[f]);const S=Z[y?l:u];let D,P=p[S],O=!1;if(P){if(O=!0,_)for(let e=0;e<P.length;e++)if(j(P[e],d))return}else P=p[S]=[];const z=p.constructor.name,I=F[z];I&&(D=I[f]),D||(D=z+n+(b?b(f):f)),E.options=m,v&&(E.options.once=!1),E.target=p,E.capture=y,E.eventName=f,E.isExisting=O;const x=s?A:void 0;x&&(x.taskData=E);const M=w.scheduleEventTask(D,d,x,r,a);return E.target=null,x&&(x.taskData=null),v&&(m.once=!0),(L||"boolean"!=typeof M.options)&&(M.options=m),M.target=p,M.capture=y,M.eventName=f,g&&(M.originalDelegate=d),h?P.unshift(M):P.push(M),c?p:void 0}};return v[r]=x(w,g,O,z,y),P&&(v.prependListener=x(P,".prependListener:",function(e){return P.call(E.target,E.eventName,e.invoke,E.options)},z,y,!0)),v[a]=function(){const t=this||e;let n=arguments[0];o&&o.transferEventName&&(n=o.transferEventName(n));const r=arguments[2],s=!!r&&("boolean"==typeof r||r.capture),a=arguments[1];if(!a)return Z.apply(this,arguments);if(i&&!i(Z,a,t,arguments))return;const c=H[n];let p;c&&(p=c[s?l:u]);const f=p&&t[p];if(f)for(let e=0;e<f.length;e++){const o=f[e];if(j(o,a))return f.splice(e,1),o.isRemoved=!0,0===f.length&&(o.allRemoved=!0,t[p]=null,"string"==typeof n)&&(t[h+"ON_PROPERTY"+n]=null),o.zone.cancelTask(o),y?t:void 0}return Z.apply(this,arguments)},v[c]=function(){const t=this||e;let n=arguments[0];o&&o.transferEventName&&(n=o.transferEventName(n));const r=[],s=U(t,b?b(n):n);for(let e=0;e<s.length;e++){const t=s[e];r.push(t.originalDelegate?t.originalDelegate:t.callback)}return r},v[p]=function(){const t=this||e;let n=arguments[0];if(n){o&&o.transferEventName&&(n=o.transferEventName(n));const e=H[n];if(e){const o=t[e.false],r=t[e.true];if(o){const e=o.slice();for(let t=0;t<e.length;t++){const o=e[t];this[a].call(this,n,o.originalDelegate?o.originalDelegate:o.callback,o.options)}}if(r){const e=r.slice();for(let t=0;t<e.length;t++){const o=e[t];this[a].call(this,n,o.originalDelegate?o.originalDelegate:o.callback,o.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=G.exec(e[t]);let o=n&&n[1];o&&"removeListener"!==o&&this[p].call(this,o)}this[p].call(this,"removeListener")}if(y)return this},I(v[r],w),I(v[a],Z),D&&I(v[p],D),S&&I(v[c],S),!0}let v=[];for(let n=0;n<t.length;n++)v[n]=y(t[n],o);return v}function U(e,t){if(!t){const n=[];for(let o in e){const r=G.exec(o);let s=r&&r[1];if(s&&(!t||s===t)){const t=e[o];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=H[t];n||(q(t),n=H[t]);const o=e[n.false],r=e[n.true];return o?r?o.concat(r):o.slice():r?r.slice():[]}function V(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[B]=!0,e&&e.apply(t,n)})}function $(e,t,n,o,r){const s=Zone.__symbol__(o);if(t[s])return;const i=t[s]=t[o];t[o]=function(s,a,c){return a&&a.prototype&&r.forEach(function(t){const r=`${n}.${o}::`+t,s=a.prototype;if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,r),e._redefineProperty(a.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}),i.call(t,s,a,c)},e.attachOriginToPatched(t[o],i)}const X=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],J=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],Y=["load"],K=["blur","error","focus","load","resize","scroll","messageerror"],Q=["bounce","finish","start"],ee=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],te=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ne=["close","error","open","message"],oe=["error","message"],re=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],X,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function se(e,t,n){if(!n||0===n.length)return t;const o=n.filter(t=>t.target===e);if(!o||0===o.length)return t;const r=o[0].ignoreProperties;return t.filter(e=>-1===r.indexOf(e))}function ie(e,t,n,o){e&&P(e,se(e,t,n),o)}function ae(e,t){if(T&&!w)return;if(Zone[e.symbol("patchEvents")])return;const o="undefined"!=typeof WebSocket,r=t.__Zone_ignore_on_properties;if(E){const e=window,t=x?[{target:e,ignoreProperties:["error"]}]:[];ie(e,re.concat(["messageerror"]),r?r.concat(t):r,n(e)),ie(Document.prototype,re,r),void 0!==e.SVGElement&&ie(e.SVGElement.prototype,re,r),ie(Element.prototype,re,r),ie(HTMLElement.prototype,re,r),ie(HTMLMediaElement.prototype,J,r),ie(HTMLFrameSetElement.prototype,X.concat(K),r),ie(HTMLBodyElement.prototype,X.concat(K),r),ie(HTMLFrameElement.prototype,Y,r),ie(HTMLIFrameElement.prototype,Y,r);const o=e.HTMLMarqueeElement;o&&ie(o.prototype,Q,r);const s=e.Worker;s&&ie(s.prototype,oe,r)}const s=t.XMLHttpRequest;s&&ie(s.prototype,ee,r);const i=t.XMLHttpRequestEventTarget;i&&ie(i&&i.prototype,ee,r),"undefined"!=typeof IDBIndex&&(ie(IDBIndex.prototype,te,r),ie(IDBRequest.prototype,te,r),ie(IDBOpenDBRequest.prototype,te,r),ie(IDBDatabase.prototype,te,r),ie(IDBTransaction.prototype,te,r),ie(IDBCursor.prototype,te,r)),o&&ie(WebSocket.prototype,ne,r)}Zone.__load_patch("util",(n,a,c)=>{c.patchOnProperties=P,c.patchMethod=z,c.bindArguments=y,c.patchMacroTask=j;const f=a.__symbol__("BLACK_LISTED_EVENTS"),d=a.__symbol__("UNPATCHED_EVENTS");n[d]&&(n[f]=n[d]),n[f]&&(a[f]=a[d]=n[f]),c.patchEventPrototype=V,c.patchEventTarget=W,c.isIEOrEdge=M,c.ObjectDefineProperty=t,c.ObjectGetOwnPropertyDescriptor=e,c.ObjectCreate=o,c.ArraySlice=r,c.patchClass=O,c.wrapWithCurrentZone=p,c.filterProperties=se,c.attachOriginToPatched=I,c._redefineProperty=Object.defineProperty,c.patchCallbacks=$,c.getGlobalObjects=()=>({globalSources:F,zoneSymbolEventNames:H,eventNames:re,isBrowser:E,isMix:w,isNode:T,TRUE_STR:l,FALSE_STR:u,ZONE_SYMBOL_PREFIX:h,ADD_EVENT_LISTENER_STR:s,REMOVE_EVENT_LISTENER_STR:i})});const ce=d("zoneTask");function le(e,t,n,o){let r=null,s=null;n+=o;const i={};function a(t){const n=t.data;return n.args[0]=function(){try{t.invoke.apply(this,arguments)}finally{t.data&&t.data.isPeriodic||("number"==typeof n.handleId?delete i[n.handleId]:n.handleId&&(n.handleId[ce]=null))}},n.handleId=r.apply(e,n.args),t}function c(e){return s(e.data.handleId)}r=z(e,t+=o,n=>function(r,s){if("function"==typeof s[0]){const e=f(t,s[0],{isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:void 0,args:s},a,c);if(!e)return e;const n=e.data.handleId;return"number"==typeof n?i[n]=e:n&&(n[ce]=e),n&&n.ref&&n.unref&&"function"==typeof n.ref&&"function"==typeof n.unref&&(e.ref=n.ref.bind(n),e.unref=n.unref.bind(n)),"number"==typeof n||n?n:e}return n.apply(e,s)}),s=z(e,n,t=>function(n,o){const r=o[0];let s;"number"==typeof r?s=i[r]:(s=r&&r[ce],s||(s=r)),s&&"string"==typeof s.type?"notScheduled"!==s.state&&(s.cancelFn&&s.data.isPeriodic||0===s.runCount)&&("number"==typeof r?delete i[r]:r&&(r[ce]=null),s.zone.cancelTask(s)):t.apply(e,o)})}function ue(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:o,TRUE_STR:r,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let c=0;c<n.length;c++){const e=n[c],t=i+(e+s),a=i+(e+r);o[e]={},o[e][s]=t,o[e][r]=a}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,[a&&a.prototype]),!0):void 0}Zone.__load_patch("legacy",e=>{const t=e[Zone.__symbol__("legacyPatch")];t&&t()}),Zone.__load_patch("timers",e=>{const t="set",n="clear";le(e,t,n,"Timeout"),le(e,t,n,"Interval"),le(e,t,n,"Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{le(e,"request","cancel","AnimationFrame"),le(e,"mozRequest","mozCancel","AnimationFrame"),le(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let o=0;o<n.length;o++)z(e,n[o],(n,o,r)=>function(o,s){return t.current.run(n,e,s,r)})}),Zone.__load_patch("EventTarget",(e,t,n)=>{(function(e,t){t.patchEventPrototype(e,t)})(e,n),ue(e,n);const o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),O("MutationObserver"),O("WebKitMutationObserver"),O("IntersectionObserver"),O("FileReader")}),Zone.__load_patch("on_property",(e,t,n)=>{ae(n,e)}),Zone.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:o}=t.getGlobalObjects();(n||o)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)}),Zone.__load_patch("XHR",(e,t)=>{!function(e){const u=e.XMLHttpRequest;if(!u)return;const h=u.prototype;let p=h[a],g=h[c];if(!p){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;p=e[a],g=e[c]}}const _="readystatechange",k="scheduled";function m(e){const o=e.data,i=o.target;i[s]=!1,i[l]=!1;const u=i[r];p||(p=i[a],g=i[c]),u&&g.call(i,_,u);const h=i[r]=()=>{if(i.readyState===i.DONE)if(!o.aborted&&i[s]&&e.state===k){const n=i[t.__symbol__("loadfalse")];if(n&&n.length>0){const r=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);o.aborted||e.state!==k||r.call(e)},n.push(e)}else e.invoke()}else o.aborted||!1!==i[s]||(i[l]=!0)};return p.call(i,_,h),i[n]||(i[n]=e),w.apply(i,o.args),i[s]=!0,e}function y(){}function v(e){const t=e.data;return t.aborted=!0,Z.apply(t.target,t.args)}const b=z(h,"open",()=>function(e,t){return e[o]=0==t[2],e[i]=t[1],b.apply(e,t)}),T=d("fetchTaskAborting"),E=d("fetchTaskScheduling"),w=z(h,"send",()=>function(e,n){if(!0===t.current[E])return w.apply(e,n);if(e[o])return w.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},o=f("XMLHttpRequest.send",y,t,m,v);e&&!0===e[l]&&!t.aborted&&o.state===k&&o.invoke()}}),Z=z(h,"abort",()=>function(e,o){const r=e[n];if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(!0===t.current[T])return Z.apply(e,o)})}(e);const n=d("xhrTask"),o=d("xhrSync"),r=d("xhrListener"),s=d("xhrScheduled"),i=d("xhrURL"),l=d("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,n){const o=t.constructor.name;for(let r=0;r<n.length;r++){const s=n[r],i=t[s];if(i){if(!v(e(t,s)))continue;t[s]=(e=>{const t=function(){return e.apply(this,y(arguments,o+"."+s))};return I(t,e),t})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){U(e,t).forEach(o=>{const r=e.PromiseRejectionEvent;if(r){const e=new r(t,{promise:n.promise,reason:n.rejection});o.invoke(e)}})}}e.PromiseRejectionEvent&&(t[d("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[d("rejectionHandledHandler")]=n("rejectionhandled"))})})?o.call(t,n,t,e):o)||(e.exports=r)}},[[1,0]]]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.b66d1515aae6fe3887b1.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/polyfills.b66d1515aae6fe3887b1.js
deleted file mode 100644 (file)
index 1bef004..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(e,t,n){e.exports=n("hN/g")},Enxc:function(e,t){},"hN/g":function(e,t,n){"use strict";n.r(t),n("Enxc"),n("pDpN")},pDpN:function(e,t,n){var o,r;void 0===(r="function"==typeof(o=function(){"use strict";!function(e){const t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function o(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");const r=e.__Zone_symbol_prefix||"__zone_symbol__";function s(e){return r+e}const i=!0===e[s("forceDuplicateZoneCheck")];if(e.Zone){if(i||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}class a{constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new l(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(e.Promise!==C.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=a.current;for(;e.parent;)e=e.parent;return e}static get current(){return z.zone}static get currentTask(){return j}static __load_patch(t,r){if(C.hasOwnProperty(t)){if(i)throw Error("Already loaded patch: "+t)}else if(!e["__Zone_disable_"+t]){const s="Zone:"+t;n(s),C[t]=r(e,a,O),o(s,s)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),o=this;return function(){return o.runGuarded(n,this,arguments,t)}}run(e,t,n,o){z={parent:z,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,o)}finally{z=z.parent}}runGuarded(e,t=null,n,o){z={parent:z,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,o)}catch(r){if(this._zoneDelegate.handleError(this,r))throw r}}finally{z=z.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");if(e.state===v&&(e.type===P||e.type===D))return;const o=e.state!=E;o&&e._transitionTo(E,T),e.runCount++;const r=j;j=e,z={parent:z,zone:this};try{e.type==D&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{e.state!==v&&e.state!==Z&&(e.type==P||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,E):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(v,E,v))),z=z.parent,j=r}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,v);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(n){throw e._transitionTo(Z,b,v),this._zoneDelegate.handleError(this,n),n}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(T,b),e}scheduleMicroTask(e,t,n,o){return this.scheduleTask(new u(S,e,t,n,o,void 0))}scheduleMacroTask(e,t,n,o,r){return this.scheduleTask(new u(D,e,t,n,o,r))}scheduleEventTask(e,t,n,o,r){return this.scheduleTask(new u(P,e,t,n,o,r))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");e._transitionTo(w,T,E);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(Z,w),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(v,w),e.runCount=0,e}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let o=0;o<n.length;o++)n[o]._updateTaskCount(e.type,t)}}a.__symbol__=s;const c={name:"",onHasTask:(e,t,n,o)=>e.hasTask(n,o),onScheduleTask:(e,t,n,o)=>e.scheduleTask(n,o),onInvokeTask:(e,t,n,o,r,s)=>e.invokeTask(n,o,r,s),onCancelTask:(e,t,n,o)=>e.cancelTask(n,o)};class l{constructor(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const o=n&&n.onHasTask;(o||t&&t._hasTaskZS)&&(this._hasTaskZS=o?n:c,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new a(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,o,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,o,r):t.apply(n,o)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=S)throw new Error("Task is missing scheduleFn.");k(t)}return n}invokeTask(e,t,n,o){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,o):t.callback.apply(n,o)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}_updateTaskCount(e,t){const n=this._taskCounts,o=n[e],r=n[e]=o+t;if(r<0)throw new Error("More tasks executed then were scheduled.");0!=o&&0!=r||this.hasTask(this.zone,{microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})}}class u{constructor(t,n,o,r,s,i){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=n,this.data=r,this.scheduleFn=s,this.cancelFn=i,!o)throw new Error("callback is not defined");this.callback=o;const a=this;this.invoke=t===P&&r&&r.useG?u.invokeTask:function(){return u.invokeTask.call(e,a,this,arguments)}}static invokeTask(e,t,n){e||(e=this),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&m(),I--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(v,b)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==v&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const h=s("setTimeout"),p=s("Promise"),f=s("then");let d,g=[],_=!1;function k(t){if(0===I&&0===g.length)if(d||e[p]&&(d=e[p].resolve(0)),d){let e=d[f];e||(e=d.then),e.call(d,m)}else e[h](m,0);t&&g.push(t)}function m(){if(!_){for(_=!0;g.length;){const t=g;g=[];for(let n=0;n<t.length;n++){const o=t[n];try{o.zone.runTask(o,null,null)}catch(e){O.onUnhandledError(e)}}}O.microtaskDrainDone(),_=!1}}const y={name:"NO ZONE"},v="notScheduled",b="scheduling",T="scheduled",E="running",w="canceling",Z="unknown",S="microTask",D="macroTask",P="eventTask",C={},O={symbol:s,currentZoneFrame:()=>z,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:k,showUncaughtError:()=>!a[s("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,setNativePromise:e=>{e&&"function"==typeof e.resolve&&(d=e.resolve(0))},patchEventPrototype:()=>N,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N};let z={parent:null,zone:new a(null,null)},j=null,I=0;function N(){}o("Zone","Zone"),e.Zone=a}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global),Zone.__load_patch("ZoneAwarePromise",(e,t,n)=>{const o=Object.getOwnPropertyDescriptor,r=Object.defineProperty,s=n.symbol,i=[],a=!0===e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=s("Promise"),l=s("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const t=i.shift();try{t.zone.runGuarded(()=>{throw t})}catch(e){h(e)}}};const u=s("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(o){}}function p(e){return e&&e.then}function f(e){return e}function d(e){return O.reject(e)}const g=s("state"),_=s("value"),k=s("finally"),m=s("parentPromiseValue"),y=s("parentPromiseState"),v=null,b=!0,T=!1;function E(e,t){return n=>{try{Z(e,t,n)}catch(o){Z(e,!1,o)}}}const w=s("currentTaskTrace");function Z(e,o,s){const c=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}}();if(e===s)throw new TypeError("Promise resolved with itself");if(e[g]===v){let h=null;try{"object"!=typeof s&&"function"!=typeof s||(h=s&&s.then)}catch(u){return c(()=>{Z(e,!1,u)})(),e}if(o!==T&&s instanceof O&&s.hasOwnProperty(g)&&s.hasOwnProperty(_)&&s[g]!==v)D(s),Z(e,s[g],s[_]);else if(o!==T&&"function"==typeof h)try{h.call(s,c(E(e,o)),c(E(e,!1)))}catch(u){c(()=>{Z(e,!1,u)})()}else{e[g]=o;const c=e[_];if(e[_]=s,e[k]===k&&o===b&&(e[g]=e[y],e[_]=e[m]),o===T&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&r(s,w,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<c.length;)P(e,c[t++],c[t++],c[t++],c[t++]);if(0==c.length&&o==T){e[g]=0;let o=s;if(!a)try{throw new Error("Uncaught (in promise): "+((l=s)&&l.toString===Object.prototype.toString?(l.constructor&&l.constructor.name||"")+": "+JSON.stringify(l):l?l.toString():Object.prototype.toString.call(l))+(s&&s.stack?"\n"+s.stack:""))}catch(u){o=u}o.rejection=s,o.promise=e,o.zone=t.current,o.task=t.currentTask,i.push(o),n.scheduleMicroTask()}}}var l;return e}const S=s("rejectionHandledHandler");function D(e){if(0===e[g]){try{const n=t[S];n&&"function"==typeof n&&n.call(this,{rejection:e[_],promise:e})}catch(n){}e[g]=T;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function P(e,t,n,o,r){D(e);const s=e[g],i=s?"function"==typeof o?o:f:"function"==typeof r?r:d;t.scheduleMicroTask("Promise.then",()=>{try{const o=e[_],r=!!n&&k===n[k];r&&(n[m]=o,n[y]=s);const a=t.run(i,void 0,r&&i!==d&&i!==f?[]:[o]);Z(n,!0,a)}catch(o){Z(n,!1,o)}},n)}const C=function(){};class O{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return Z(new this(null),b,e)}static reject(e){return Z(new this(null),T,e)}static race(e){let t,n,o=new this((e,o)=>{t=e,n=o});function r(e){t(e)}function s(e){n(e)}for(let i of e)p(i)||(i=this.resolve(i)),i.then(r,s);return o}static all(e){return O.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof O?this:O).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,o,r=new this((e,t)=>{n=e,o=t}),s=2,i=0;const a=[];for(let l of e){p(l)||(l=this.resolve(l));const e=i;try{l.then(o=>{a[e]=t?t.thenCallback(o):o,s--,0===s&&n(a)},r=>{t?(a[e]=t.errorCallback(r),s--,0===s&&n(a)):o(r)})}catch(c){o(c)}s++,i++}return s-=2,0===s&&n(a),r}constructor(e){const t=this;if(!(t instanceof O))throw new Error("Must be an instanceof Promise.");t[g]=v,t[_]=[];try{e&&e(E(t,b),E(t,T))}catch(n){Z(t,!1,n)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return O}then(e,n){let o=this.constructor[Symbol.species];o&&"function"==typeof o||(o=this.constructor||O);const r=new o(C),s=t.current;return this[g]==v?this[_].push(s,r,e,n):P(this,s,r,e,n),r}catch(e){return this.then(null,e)}finally(e){let n=this.constructor[Symbol.species];n&&"function"==typeof n||(n=O);const o=new n(C);o[k]=k;const r=t.current;return this[g]==v?this[_].push(r,o,e,e):P(this,r,o,e,e),o}}O.resolve=O.resolve,O.reject=O.reject,O.race=O.race,O.all=O.all;const z=e[c]=e.Promise,j=t.__symbol__("ZoneAwarePromise");let I=o(e,"Promise");I&&!I.configurable||(I&&delete I.writable,I&&delete I.value,I||(I={configurable:!0,enumerable:!0}),I.get=function(){return e[j]?e[j]:e[c]},I.set=function(t){t===O?e[j]=t:(e[c]=t,t.prototype[l]||R(t),n.setNativePromise(t))},r(e,"Promise",I)),e.Promise=O;const N=s("thenPatched");function R(e){const t=e.prototype,n=o(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const r=t.then;t[l]=r,e.prototype.then=function(e,t){return new O((e,t)=>{r.call(this,e,t)}).then(e,t)},e[N]=!0}if(n.patchThen=R,z){R(z);const t=e.fetch;"function"==typeof t&&(e[n.symbol("fetch")]=t,e.fetch=(x=t,function(){let e=x.apply(this,arguments);if(e instanceof O)return e;let t=e.constructor;return t[N]||R(t),e}))}var x;return Promise[t.__symbol__("uncaughtPromiseErrors")]=i,O});const e=Object.getOwnPropertyDescriptor,t=Object.defineProperty,n=Object.getPrototypeOf,o=Object.create,r=Array.prototype.slice,s="addEventListener",i="removeEventListener",a=Zone.__symbol__(s),c=Zone.__symbol__(i),l="true",u="false",h=Zone.__symbol__("");function p(e,t){return Zone.current.wrap(e,t)}function f(e,t,n,o,r){return Zone.current.scheduleMacroTask(e,t,n,o,r)}const d=Zone.__symbol__,g="undefined"!=typeof window,_=g?window:void 0,k=g&&_||"object"==typeof self&&self||global,m=[null];function y(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=p(e[n],t+"_"+n));return e}function v(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const b="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,T=!("nw"in k)&&void 0!==k.process&&"[object process]"==={}.toString.call(k.process),E=!T&&!b&&!(!g||!_.HTMLElement),w=void 0!==k.process&&"[object process]"==={}.toString.call(k.process)&&!b&&!(!g||!_.HTMLElement),Z={},S=function(e){if(!(e=e||k.event))return;let t=Z[e.type];t||(t=Z[e.type]=d("ON_PROPERTY"+e.type));const n=this||e.target||k,o=n[t];let r;if(E&&n===_&&"error"===e.type){const t=e;r=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===r&&e.preventDefault()}else r=o&&o.apply(this,arguments),null==r||r||e.preventDefault();return r};function D(n,o,r){let s=e(n,o);if(!s&&r&&e(r,o)&&(s={enumerable:!0,configurable:!0}),!s||!s.configurable)return;const i=d("on"+o+"patched");if(n.hasOwnProperty(i)&&n[i])return;delete s.writable,delete s.value;const a=s.get,c=s.set,l=o.substr(2);let u=Z[l];u||(u=Z[l]=d("ON_PROPERTY"+l)),s.set=function(e){let t=this;t||n!==k||(t=k),t&&(t[u]&&t.removeEventListener(l,S),c&&c.apply(t,m),"function"==typeof e?(t[u]=e,t.addEventListener(l,S,!1)):t[u]=null)},s.get=function(){let e=this;if(e||n!==k||(e=k),!e)return null;const t=e[u];if(t)return t;if(a){let t=a&&a.call(this);if(t)return s.set.call(this,t),"function"==typeof e.removeAttribute&&e.removeAttribute(o),t}return null},t(n,o,s),n[i]=!0}function P(e,t,n){if(t)for(let o=0;o<t.length;o++)D(e,"on"+t[o],n);else{const t=[];for(const n in e)"on"==n.substr(0,2)&&t.push(n);for(let o=0;o<t.length;o++)D(e,t[o],n)}}const C=d("originalInstance");function O(e){const n=k[e];if(!n)return;k[d(e)]=n,k[e]=function(){const t=y(arguments,e);switch(t.length){case 0:this[C]=new n;break;case 1:this[C]=new n(t[0]);break;case 2:this[C]=new n(t[0],t[1]);break;case 3:this[C]=new n(t[0],t[1],t[2]);break;case 4:this[C]=new n(t[0],t[1],t[2],t[3]);break;default:throw new Error("Arg list too long.")}},I(k[e],n);const o=new n((function(){}));let r;for(r in o)"XMLHttpRequest"===e&&"responseBlob"===r||function(n){"function"==typeof o[n]?k[e].prototype[n]=function(){return this[C][n].apply(this[C],arguments)}:t(k[e].prototype,n,{set:function(t){"function"==typeof t?(this[C][n]=p(t,e+"."+n),I(this[C][n],t)):this[C][n]=t},get:function(){return this[C][n]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(k[e][r]=n[r])}function z(t,o,r){let s=t;for(;s&&!s.hasOwnProperty(o);)s=n(s);!s&&t[o]&&(s=t);const i=d(o);let a=null;if(s&&!(a=s[i])&&(a=s[i]=s[o],v(s&&e(s,o)))){const e=r(a,i,o);s[o]=function(){return e(this,arguments)},I(s[o],a)}return a}function j(e,t,n){let o=null;function r(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}o=z(e,t,e=>function(t,o){const s=n(t,o);return s.cbIdx>=0&&"function"==typeof o[s.cbIdx]?f(s.name,o[s.cbIdx],s,r):e.apply(t,o)})}function I(e,t){e[d("OriginalDelegate")]=t}let N=!1,R=!1;function x(){try{const e=_.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}function M(){if(N)return R;N=!0;try{const e=_.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(R=!0)}catch(e){}return R}Zone.__load_patch("toString",e=>{const t=Function.prototype.toString,n=d("OriginalDelegate"),o=d("Promise"),r=d("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[o];if(n)return t.call(n)}if(this===Error){const n=e[r];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return this instanceof Promise?"[object Promise]":i.call(this)}});let L=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){L=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(he){L=!1}const A={useG:!0},H={},F={},G=new RegExp("^"+h+"(\\w+)(true|false)$"),B=d("propagationStopped");function q(e,t){const n=(t?t(e):e)+u,o=(t?t(e):e)+l,r=h+n,s=h+o;H[e]={},H[e].false=r,H[e].true=s}function W(e,t,o){const r=o&&o.add||s,a=o&&o.rm||i,c=o&&o.listeners||"eventListeners",p=o&&o.rmAll||"removeAllListeners",f=d(r),g="."+r+":",_=function(e,t,n){if(e.isRemoved)return;const o=e.callback;"object"==typeof o&&o.handleEvent&&(e.callback=e=>o.handleEvent(e),e.originalDelegate=o),e.invoke(e,t,[n]);const r=e.options;r&&"object"==typeof r&&r.once&&t[a].call(t,n.type,e.originalDelegate?e.originalDelegate:e.callback,r)},k=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[H[t.type].false];if(o)if(1===o.length)_(o[0],n,t);else{const e=o.slice();for(let o=0;o<e.length&&(!t||!0!==t[B]);o++)_(e[o],n,t)}},m=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[H[t.type].true];if(o)if(1===o.length)_(o[0],n,t);else{const e=o.slice();for(let o=0;o<e.length&&(!t||!0!==t[B]);o++)_(e[o],n,t)}};function y(t,o){if(!t)return!1;let s=!0;o&&void 0!==o.useG&&(s=o.useG);const i=o&&o.vh;let _=!0;o&&void 0!==o.chkDup&&(_=o.chkDup);let y=!1;o&&void 0!==o.rt&&(y=o.rt);let v=t;for(;v&&!v.hasOwnProperty(r);)v=n(v);if(!v&&t[r]&&(v=t),!v)return!1;if(v[f])return!1;const b=o&&o.eventNameToString,E={},w=v[f]=v[r],Z=v[d(a)]=v[a],S=v[d(c)]=v[c],D=v[d(p)]=v[p];let P;function C(e,t){return!L&&"object"==typeof e&&e?!!e.capture:L&&t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?Object.assign(Object.assign({},e),{passive:!0}):e:{passive:!0}:e}o&&o.prepend&&(P=v[d(o.prepend)]=v[o.prepend]);const O=s?function(e){if(!E.isExisting)return w.call(E.target,E.eventName,E.capture?m:k,E.options)}:function(e){return w.call(E.target,E.eventName,e.invoke,E.options)},z=s?function(e){if(!e.isRemoved){const t=H[e.eventName];let n;t&&(n=t[e.capture?l:u]);const o=n&&e.target[n];if(o)for(let r=0;r<o.length;r++)if(o[r]===e){o.splice(r,1),e.isRemoved=!0,0===o.length&&(e.allRemoved=!0,e.target[n]=null);break}}if(e.allRemoved)return Z.call(e.target,e.eventName,e.capture?m:k,e.options)}:function(e){return Z.call(e.target,e.eventName,e.invoke,e.options)},j=o&&o.diff?o.diff:function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},N=Zone[d("BLACK_LISTED_EVENTS")],R=e[d("PASSIVE_EVENTS")],x=function(t,n,r,a,c=!1,h=!1){return function(){const p=this||e;let f=arguments[0];o&&o.transferEventName&&(f=o.transferEventName(f));let d=arguments[1];if(!d)return t.apply(this,arguments);if(T&&"uncaughtException"===f)return t.apply(this,arguments);let g=!1;if("function"!=typeof d){if(!d.handleEvent)return t.apply(this,arguments);g=!0}if(i&&!i(t,d,p,arguments))return;const k=L&&!!R&&-1!==R.indexOf(f),m=C(arguments[2],k);if(N)for(let e=0;e<N.length;e++)if(f===N[e])return k?t.call(p,f,d,m):t.apply(this,arguments);const y=!!m&&("boolean"==typeof m||m.capture),v=!(!m||"object"!=typeof m)&&m.once,w=Zone.current;let Z=H[f];Z||(q(f,b),Z=H[f]);const S=Z[y?l:u];let D,P=p[S],O=!1;if(P){if(O=!0,_)for(let e=0;e<P.length;e++)if(j(P[e],d))return}else P=p[S]=[];const z=p.constructor.name,I=F[z];I&&(D=I[f]),D||(D=z+n+(b?b(f):f)),E.options=m,v&&(E.options.once=!1),E.target=p,E.capture=y,E.eventName=f,E.isExisting=O;const x=s?A:void 0;x&&(x.taskData=E);const M=w.scheduleEventTask(D,d,x,r,a);return E.target=null,x&&(x.taskData=null),v&&(m.once=!0),(L||"boolean"!=typeof M.options)&&(M.options=m),M.target=p,M.capture=y,M.eventName=f,g&&(M.originalDelegate=d),h?P.unshift(M):P.push(M),c?p:void 0}};return v[r]=x(w,g,O,z,y),P&&(v.prependListener=x(P,".prependListener:",(function(e){return P.call(E.target,E.eventName,e.invoke,E.options)}),z,y,!0)),v[a]=function(){const t=this||e;let n=arguments[0];o&&o.transferEventName&&(n=o.transferEventName(n));const r=arguments[2],s=!!r&&("boolean"==typeof r||r.capture),a=arguments[1];if(!a)return Z.apply(this,arguments);if(i&&!i(Z,a,t,arguments))return;const c=H[n];let p;c&&(p=c[s?l:u]);const f=p&&t[p];if(f)for(let e=0;e<f.length;e++){const o=f[e];if(j(o,a))return f.splice(e,1),o.isRemoved=!0,0===f.length&&(o.allRemoved=!0,t[p]=null,"string"==typeof n)&&(t[h+"ON_PROPERTY"+n]=null),o.zone.cancelTask(o),y?t:void 0}return Z.apply(this,arguments)},v[c]=function(){const t=this||e;let n=arguments[0];o&&o.transferEventName&&(n=o.transferEventName(n));const r=[],s=U(t,b?b(n):n);for(let e=0;e<s.length;e++){const t=s[e];r.push(t.originalDelegate?t.originalDelegate:t.callback)}return r},v[p]=function(){const t=this||e;let n=arguments[0];if(n){o&&o.transferEventName&&(n=o.transferEventName(n));const e=H[n];if(e){const o=t[e.false],r=t[e.true];if(o){const e=o.slice();for(let t=0;t<e.length;t++){const o=e[t];this[a].call(this,n,o.originalDelegate?o.originalDelegate:o.callback,o.options)}}if(r){const e=r.slice();for(let t=0;t<e.length;t++){const o=e[t];this[a].call(this,n,o.originalDelegate?o.originalDelegate:o.callback,o.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=G.exec(e[t]);let o=n&&n[1];o&&"removeListener"!==o&&this[p].call(this,o)}this[p].call(this,"removeListener")}if(y)return this},I(v[r],w),I(v[a],Z),D&&I(v[p],D),S&&I(v[c],S),!0}let v=[];for(let n=0;n<t.length;n++)v[n]=y(t[n],o);return v}function U(e,t){if(!t){const n=[];for(let o in e){const r=G.exec(o);let s=r&&r[1];if(s&&(!t||s===t)){const t=e[o];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=H[t];n||(q(t),n=H[t]);const o=e[n.false],r=e[n.true];return o?r?o.concat(r):o.slice():r?r.slice():[]}function V(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[B]=!0,e&&e.apply(t,n)})}function $(e,t,n,o,r){const s=Zone.__symbol__(o);if(t[s])return;const i=t[s]=t[o];t[o]=function(s,a,c){return a&&a.prototype&&r.forEach((function(t){const r=`${n}.${o}::`+t,s=a.prototype;if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,r),e._redefineProperty(a.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))})),i.call(t,s,a,c)},e.attachOriginToPatched(t[o],i)}const X=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],J=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],Y=["load"],K=["blur","error","focus","load","resize","scroll","messageerror"],Q=["bounce","finish","start"],ee=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],te=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ne=["close","error","open","message"],oe=["error","message"],re=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],X,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function se(e,t,n){if(!n||0===n.length)return t;const o=n.filter(t=>t.target===e);if(!o||0===o.length)return t;const r=o[0].ignoreProperties;return t.filter(e=>-1===r.indexOf(e))}function ie(e,t,n,o){e&&P(e,se(e,t,n),o)}function ae(e,t){if(T&&!w)return;if(Zone[e.symbol("patchEvents")])return;const o="undefined"!=typeof WebSocket,r=t.__Zone_ignore_on_properties;if(E){const e=window,t=x?[{target:e,ignoreProperties:["error"]}]:[];ie(e,re.concat(["messageerror"]),r?r.concat(t):r,n(e)),ie(Document.prototype,re,r),void 0!==e.SVGElement&&ie(e.SVGElement.prototype,re,r),ie(Element.prototype,re,r),ie(HTMLElement.prototype,re,r),ie(HTMLMediaElement.prototype,J,r),ie(HTMLFrameSetElement.prototype,X.concat(K),r),ie(HTMLBodyElement.prototype,X.concat(K),r),ie(HTMLFrameElement.prototype,Y,r),ie(HTMLIFrameElement.prototype,Y,r);const o=e.HTMLMarqueeElement;o&&ie(o.prototype,Q,r);const s=e.Worker;s&&ie(s.prototype,oe,r)}const s=t.XMLHttpRequest;s&&ie(s.prototype,ee,r);const i=t.XMLHttpRequestEventTarget;i&&ie(i&&i.prototype,ee,r),"undefined"!=typeof IDBIndex&&(ie(IDBIndex.prototype,te,r),ie(IDBRequest.prototype,te,r),ie(IDBOpenDBRequest.prototype,te,r),ie(IDBDatabase.prototype,te,r),ie(IDBTransaction.prototype,te,r),ie(IDBCursor.prototype,te,r)),o&&ie(WebSocket.prototype,ne,r)}Zone.__load_patch("util",(n,a,c)=>{c.patchOnProperties=P,c.patchMethod=z,c.bindArguments=y,c.patchMacroTask=j;const f=a.__symbol__("BLACK_LISTED_EVENTS"),d=a.__symbol__("UNPATCHED_EVENTS");n[d]&&(n[f]=n[d]),n[f]&&(a[f]=a[d]=n[f]),c.patchEventPrototype=V,c.patchEventTarget=W,c.isIEOrEdge=M,c.ObjectDefineProperty=t,c.ObjectGetOwnPropertyDescriptor=e,c.ObjectCreate=o,c.ArraySlice=r,c.patchClass=O,c.wrapWithCurrentZone=p,c.filterProperties=se,c.attachOriginToPatched=I,c._redefineProperty=Object.defineProperty,c.patchCallbacks=$,c.getGlobalObjects=()=>({globalSources:F,zoneSymbolEventNames:H,eventNames:re,isBrowser:E,isMix:w,isNode:T,TRUE_STR:l,FALSE_STR:u,ZONE_SYMBOL_PREFIX:h,ADD_EVENT_LISTENER_STR:s,REMOVE_EVENT_LISTENER_STR:i})});const ce=d("zoneTask");function le(e,t,n,o){let r=null,s=null;n+=o;const i={};function a(t){const n=t.data;return n.args[0]=function(){try{t.invoke.apply(this,arguments)}finally{t.data&&t.data.isPeriodic||("number"==typeof n.handleId?delete i[n.handleId]:n.handleId&&(n.handleId[ce]=null))}},n.handleId=r.apply(e,n.args),t}function c(e){return s(e.data.handleId)}r=z(e,t+=o,n=>function(r,s){if("function"==typeof s[0]){const e=f(t,s[0],{isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:void 0,args:s},a,c);if(!e)return e;const n=e.data.handleId;return"number"==typeof n?i[n]=e:n&&(n[ce]=e),n&&n.ref&&n.unref&&"function"==typeof n.ref&&"function"==typeof n.unref&&(e.ref=n.ref.bind(n),e.unref=n.unref.bind(n)),"number"==typeof n||n?n:e}return n.apply(e,s)}),s=z(e,n,t=>function(n,o){const r=o[0];let s;"number"==typeof r?s=i[r]:(s=r&&r[ce],s||(s=r)),s&&"string"==typeof s.type?"notScheduled"!==s.state&&(s.cancelFn&&s.data.isPeriodic||0===s.runCount)&&("number"==typeof r?delete i[r]:r&&(r[ce]=null),s.zone.cancelTask(s)):t.apply(e,o)})}function ue(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:o,TRUE_STR:r,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let c=0;c<n.length;c++){const e=n[c],t=i+(e+s),a=i+(e+r);o[e]={},o[e][s]=t,o[e][r]=a}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,[a&&a.prototype]),!0):void 0}Zone.__load_patch("legacy",e=>{const t=e[Zone.__symbol__("legacyPatch")];t&&t()}),Zone.__load_patch("timers",e=>{const t="set",n="clear";le(e,t,n,"Timeout"),le(e,t,n,"Interval"),le(e,t,n,"Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{le(e,"request","cancel","AnimationFrame"),le(e,"mozRequest","mozCancel","AnimationFrame"),le(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let o=0;o<n.length;o++)z(e,n[o],(n,o,r)=>function(o,s){return t.current.run(n,e,s,r)})}),Zone.__load_patch("EventTarget",(e,t,n)=>{(function(e,t){t.patchEventPrototype(e,t)})(e,n),ue(e,n);const o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),O("MutationObserver"),O("WebKitMutationObserver"),O("IntersectionObserver"),O("FileReader")}),Zone.__load_patch("on_property",(e,t,n)=>{ae(n,e)}),Zone.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:o}=t.getGlobalObjects();(n||o)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)}),Zone.__load_patch("XHR",(e,t)=>{!function(e){const u=e.XMLHttpRequest;if(!u)return;const h=u.prototype;let p=h[a],g=h[c];if(!p){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;p=e[a],g=e[c]}}const _="readystatechange",k="scheduled";function m(e){const o=e.data,i=o.target;i[s]=!1,i[l]=!1;const u=i[r];p||(p=i[a],g=i[c]),u&&g.call(i,_,u);const h=i[r]=()=>{if(i.readyState===i.DONE)if(!o.aborted&&i[s]&&e.state===k){const n=i[t.__symbol__("loadfalse")];if(n&&n.length>0){const r=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);o.aborted||e.state!==k||r.call(e)},n.push(e)}else e.invoke()}else o.aborted||!1!==i[s]||(i[l]=!0)};return p.call(i,_,h),i[n]||(i[n]=e),w.apply(i,o.args),i[s]=!0,e}function y(){}function v(e){const t=e.data;return t.aborted=!0,Z.apply(t.target,t.args)}const b=z(h,"open",()=>function(e,t){return e[o]=0==t[2],e[i]=t[1],b.apply(e,t)}),T=d("fetchTaskAborting"),E=d("fetchTaskScheduling"),w=z(h,"send",()=>function(e,n){if(!0===t.current[E])return w.apply(e,n);if(e[o])return w.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},o=f("XMLHttpRequest.send",y,t,m,v);e&&!0===e[l]&&!t.aborted&&o.state===k&&o.invoke()}}),Z=z(h,"abort",()=>function(e,o){const r=e[n];if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(!0===t.current[T])return Z.apply(e,o)})}(e);const n=d("xhrTask"),o=d("xhrSync"),r=d("xhrListener"),s=d("xhrScheduled"),i=d("xhrURL"),l=d("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,n){const o=t.constructor.name;for(let r=0;r<n.length;r++){const s=n[r],i=t[s];if(i){if(!v(e(t,s)))continue;t[s]=(e=>{const t=function(){return e.apply(this,y(arguments,o+"."+s))};return I(t,e),t})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){U(e,t).forEach(o=>{const r=e.PromiseRejectionEvent;if(r){const e=new r(t,{promise:n.promise,reason:n.rejection});o.invoke(e)}})}}e.PromiseRejectionEvent&&(t[d("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[d("rejectionHandledHandler")]=n("rejectionhandled"))})})?o.call(t,n,t,e):o)||(e.exports=r)}},[[1,0]]]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fc090c2eb8af922526a6.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fc090c2eb8af922526a6.js
new file mode 100644 (file)
index 0000000..796c52f
--- /dev/null
@@ -0,0 +1 @@
+!function(e){function r(r){for(var n,a,f=r[0],i=r[1],c=r[2],p=0,s=[];p<f.length;p++)a=f[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,c||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++)0!==o[t[f]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,f=document.createElement("script");f.charset="utf-8",f.timeout=120,a.nc&&f.setAttribute("nonce",a.nc),f.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"e0a29c1d4fcf893cf11d",5:"f6931a7617fe7f8fd244",6:"e0fafffe422f8212d682"}[e]+".js"}(e);var i=new Error;u=function(r){f.onerror=f.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",i.name="ChunkLoadError",i.type=n,i.request=u,t[1](i)}o[e]=void 0}};var c=setTimeout(function(){u({type:"timeout",target:f})},12e4);f.onerror=f.onload=u,document.head.appendChild(f)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var c=0;c<f.length;c++)r(f[c]);var l=i;t()}([]);
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fcd694c3eff5ef104b53.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/runtime.fcd694c3eff5ef104b53.js
deleted file mode 100644 (file)
index f5b4c83..0000000
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){function r(r){for(var n,u,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)u=i[p],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&s.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return a.push.apply(a,f||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(a.splice(r--,1),e=u(u.s=t[0]))}return e}var n={},o={0:0},a=[];function u(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,u),t.l=!0,t.exports}u.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+""+({}[e]||e)+"."+{1:"6da7b376fa1a8a3df154",5:"0a363eda73eafe0c0332",6:"115992dc55f8e1abedbc"}[e]+".js"}(e);var c=new Error;a=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(r)},u.m=e,u.c=n,u.d=function(e,r,t){u.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,r){if(1&r&&(e=u(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)u.d(t,n,(function(r){return e[r]}).bind(null,n));return t},u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,"a",r),r},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.p="",u.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);
\ No newline at end of file
index 75fc4357baa4005be1db0a05e135275af79c5dd6..c7c5ac49fd834d1828d10e36a6fe4028e080cc97 100644 (file)
@@ -1 +1 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Chart=e()}(this,(function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=t((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(n,i))*100,100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=(r=t,o=e[l],Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));u<s&&(s=u,a=l)}return a},a.keyword.rgb=function(t){return e[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,a[u]=255*(r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e);return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),(i+n)/2*100]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-i)+i)),255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i;e=t[1]/500+(n=(t[0]+16)/116),i=n-t[2]/200;var a=Math.pow(n,3),r=Math.pow(e,3),o=Math.pow(i,3);return n=a>.008856?a:(n-16/116)/7.787,e=r>.008856?r:(e-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[1];return e=t[2]/360*2*Math.PI,[t[0],n*Math.cos(e),n*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e,n=t[1]/100,i=t[2]/100,a=0;return(e=i<.5?2*n*i:2*n*(1-i))<1&&(a=(i-.5*e)/(1-e)),[t[0],100*e,100*a]},a.hsv.hcg=function(t){var e=t[2]/100,n=t[1]/100*e,i=0;return n<1&&(i=(e-n)/(1-n)),[t[0],100*n,100*i]},a.hcg.rgb=function(t){var e=t[1]/100,n=t[2]/100;if(0===e)return[255*n,255*n,255*n];var i,a=[0,0,0],r=t[0]/360%1*6,o=r%1,s=1-o;switch(Math.floor(r)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return[255*(e*a[0]+(i=(1-e)*n)),255*(e*a[1]+i),255*(e*a[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=1-t[2]/100,n=e-t[1]/100,i=0;return n<1&&(i=(e-n)/(1-n)),[t[0],100*n,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));function i(t,e){return function(n){return e(t(n))}}function a(t,e){for(var a=[e[t].parent,t],r=n[e[t].parent][t],o=e[t].parent;e[o].parent;)a.unshift(e[o].parent),r=i(n[e[o].parent][o],r),o=e[o].parent;return r.conversion=a,r}var r={};Object.keys(n).forEach((function(t){r[t]={},Object.defineProperty(r[t],"channels",{value:n[t].channels}),Object.defineProperty(r[t],"labels",{value:n[t].labels});var e=function(t){for(var e=function(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a<i;a++)t[e[a]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var a=i.pop(),r=Object.keys(n[a]),o=r.length,s=0;s<o;s++){var l=r[s],u=e[l];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,i.unshift(l))}return e}(t),i={},r=Object.keys(e),o=r.length,s=0;s<o;s++){var l=r[s];null!==e[l].parent&&(i[l]=a(l,e))}return i}(t);Object.keys(e).forEach((function(n){var i=e[n];r[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),r[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var o=r,s={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:u,getHsla:d,getRgb:function(t){var e=u(t);return e&&e.slice(0,3)},getHsl:function(t){var e=d(t);return e&&e.slice(0,3)},getHwb:h,getAlpha:function(t){var e=u(t);return e||(e=d(t))||(e=h(t))?e[3]:void 0},hexString:function(t,e){return e=void 0!==e&&3===t.length?e:t[3],"#"+p(t[0])+p(t[1])+p(t[2])+(e>=0&&e<1?p(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?c(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:c,percentString:function(t,e){return e<1||t[3]&&t[3]<1?f(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:f,hslString:function(t,e){return e<1||t[3]&&t[3]<1?g(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:g,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return v[t.slice(0,3)]}};function u(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;r<e.length;r++)e[r]=parseInt(i[r]+i[r],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(i=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=i[2],i=i[1],r=0;r<e.length;r++)e[r]=parseInt(i.slice(2*r,2*r+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=parseInt(i[r+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=Math.round(2.55*parseFloat(i[r+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=s[i[1]]))return}for(r=0;r<e.length;r++)e[r]=m(e[r],0,255);return n=n||0==n?m(n,0,1):1,e[3]=n,e}}function d(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function h(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function c(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function f(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function m(t,e,n){return Math.min(Math.max(e,t),n)}function p(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var v={};for(var b in s)v[s[b]]=b;var y=function(t){return t instanceof y?t:this instanceof y?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=l.getRgba(t))?this.setValues("rgb",e):(e=l.getHsla(t))?this.setValues("hsl",e):(e=l.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new y(t);var e};y.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&("[object Array]"===(e={}.toString.call(t=i[r]))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},y.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[r[t][0]]){var u=r[t];for(n=0;n<t.length;n++)a[t][n]=e[u[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(s[t][n],a[t][n])),a[t][n]=Math.round(i);for(var d in r)d!==t&&(a[d]=o[t][d](a[t]));return!0},y.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},y.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:(n===i[e]||(i[e]=n,this.setValues(t,i)),this)},"undefined"!=typeof window&&(window.Color=y);var x=y;function _(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var w,k={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return k.valueOrDefault(k.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(k.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(k.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=e[n],(a=t[n])instanceof Array&&r instanceof Array){if(!k.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(k.isArray(t))return t.map(k.clone);if(k.isObject(t)){for(var e=Object.create(t),n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=k.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){if(_(t)){var a=e[t],r=n[t];k.isObject(a)&&k.isObject(r)?k.merge(a,r,i):e[t]=k.clone(r)}},_mergerIf:function(t,e,n){if(_(t)){var i=e[t],a=n[t];k.isObject(i)&&k.isObject(a)?k.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=k.clone(a))}},merge:function(t,e,n){var i,a,r,o,s,l=k.isArray(e)?e:[e],u=l.length;if(!k.isObject(t))return t;for(i=(n=n||{}).merger||k._merger,a=0;a<u;++a)if(k.isObject(e=l[a]))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return k.merge(t,e,{merger:k._mergerIf})},extend:Object.assign||function(t){return k.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=k.inherits,t&&k.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},M=k;k.callCallback=k.callback,k.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var S={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-S.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*S.easeInBounce(2*t):.5*S.easeOutBounce(2*t-1)+.5}},D={effects:S};M.easingEffects=S;var C=Math.PI,P=C/180,T=2*C,O=C/2,A=C/4,F=2*C/3,I={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),s<u&&l<d?(t.arc(s,l,o,-C,-O),t.arc(u,l,o,-O,0),t.arc(u,d,o,0,O),t.arc(s,d,o,O,C)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-O,O),t.arc(s,l,o,O,C+O)):l<d?(t.arc(s,l,o,-C,0),t.arc(s,d,o,0,C)):t.arc(s,l,o,-C,C),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h=(r||0)*P;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(h),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=F,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=F,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),t.closePath();break;case"rectRounded":u=n-(d=.516*n),s=Math.cos(h+A)*u,l=Math.sin(h+A)*u,t.arc(i-s,a-l,d,h-C,h-O),t.arc(i+l,a-s,d,h-O,h),t.arc(i+s,a+l,d,h,h+O),t.arc(i-l,a+s,d,h+O,h+C),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}h+=A;case"rectRot":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":h+=A;case"cross":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),h+=A,s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(h)*n,a+Math.sin(h)*n)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){var n=1e-6;return t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},L=I;M.clear=I.clear,M.drawRoundedRectangle=function(t){t.beginPath(),I.roundedRect.apply(I,arguments)};var R={_set:function(t,e){return M.merge(this[t]||(this[t]={}),e)}};R._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var N=R,W=M.valueOrDefault,Y={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return M.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=N.global,n=W(t.fontSize,e.defaultFontSize),i={family:W(t.fontFamily,e.defaultFontFamily),lineHeight:M.options.toLineHeight(W(t.lineHeight,e.defaultLineHeight),n),size:n,style:W(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=function(t){return!t||M.isNullOrUndef(t.size)||M.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&M.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},z={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e==0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort((function(t,e){return t-e})).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e}},E=z;M.log10=z.log10;var V=M,H=L,B=Y,j=E;V.easing=D,V.canvas=H,V.options=B,V.math=j,V.rtl={getRtlAdapter:function(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(i=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};var U=function(t){V.extend(this,t),this.initialize.apply(this,arguments)};V.extend(U.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=V.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)==typeof(l=t[o]))if("string"===d){if((h=x(l)).valid&&(c=x(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if(V.isFinite(l)&&V.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t),e):(e._view=V.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return V.isNumber(this._model.x)&&V.isNumber(this._model.y)}}),U.extend=V.inherits;var G=U,q=G.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),Z=q;Object.defineProperty(q.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(q.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),N._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:V.noop,onComplete:V.noop}});var $={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=V.findIndex(this.animations,(function(e){return e.chart===t}));-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=V.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)e=(t=a[r]).chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),V.callback(t.render,[e,t],e),V.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(V.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},X=V.options.resolve,J=["push","pop","shift","splice","unshift"];function K(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(J.forEach((function(e){delete t[e]})),delete t._chartjs)}}var Q=function(t,e){this.initialize(t,e)};V.extend(Q.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,i=n.scales,a=t.getDataset(),r=n.options.scales;null!==e.xAxisID&&e.xAxisID in i&&!a.xAxisID||(e.xAxisID=a.xAxisID||r.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in i&&!a.yAxisID||(e.yAxisID=a.yAxisID||r.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&K(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,e,n=this,i=n.getDataset(),a=i.data||(i.data=[]);n._data!==a&&(n._data&&K(n._data,n),a&&Object.isExtensible(a)&&(e=n,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),J.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return V.each(t._chartjs.listeners,(function(t){"function"==typeof t[n]&&t[n].apply(t,e)})),a}})})))),n._data=a),n.resyncElements()},_configure:function(){var t=this;t._config=V.merge(Object.create(null),[t.chart.options.datasets[t._type],t.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&V._merger(t,e,n)}})},_update:function(t){var e=this;e._configure(),e._cachedDataOpts=null,e.update(t)},update:V.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this,i=n.getMeta(),a=i.dataset;return n._configure(),!1!==(e=a&&void 0===t?n._resolveDatasetElementOptions(a||{}):n._resolveDataElementOptions(i.data[t=t||0]||{},t)).fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},d=s.options.elements[o.datasetElementType.prototype._type]||{},h=o._datasetElementOptions,c={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=h.length;n<i;++n)a=h[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,c[a]=X([u[r],l[r],d[r]],f);return c},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,d=n._config,h=u.options.elements[n.dataElementType.prototype._type]||{},c=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},m={cacheable:!i};if(i=i||{},V.isArray(c))for(o=0,s=c.length;o<s;++o)f[l=c[o]]=X([i[l],d[l],h[l]],g,e,m);else for(o=0,s=(r=Object.keys(c)).length;o<s;++o)f[l=r[o]]=X([i[l],d[c[l]],d[l],h[l]],g,e,m);return m.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){V.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=V.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=X([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=X([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=X([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),t=0,e=(i=Object.keys(a)).length;t<e;++t)s[n=i[t]]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),Q.extend=V.inherits;var tt=Q,et=2*Math.PI;function nt(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?t.arc(o,s,e.innerRadius-a,i+(r=a/e.innerRadius),n-r,!0):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}N._set("global",{elements:{arc:{backgroundColor:N.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var it=G.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=V.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=et;for(;a>s;)a-=et;for(;a<o;)a+=et;return a>=o&&a<=s&&r>=n.innerRadius&&r<=n.outerRadius}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/et)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+et,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%et}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&function(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+et,nt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=et,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+et,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+et),a=0;a<n.fullCircles;++a)t.stroke()}(t,e,n,i),i&&nt(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}(e,n,a),e.restore()}}),at=V.valueOrDefault,rt=N.global.defaultColor;N._set("global",{elements:{line:{tension:.4,backgroundColor:rt,borderWidth:3,borderColor:rt,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var ot=G.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=N.global,u=l.elements.line,d=-1,h=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=V.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),h=o;break}h&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=at(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=at(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),(n=s[0]._view).skip||(r.moveTo(n.x,n.y),d=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===d?V.previousItem(s,t):s[d],n.skip||(d!==t-1&&!o||-1===d?r.moveTo(n.x,n.y):V.canvas.lineTo(r,e._view,n),d=t);h&&r.closePath(),r.stroke(),r.restore()}}}),st=V.valueOrDefault,lt=N.global.defaultColor;function ut(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}N._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:lt,borderColor:lt,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var dt=G.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ut,inXRange:ut,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=N.global,u=l.defaultColor;e.skip||(void 0===t||V.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=st(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,V.canvas.drawPoint(n,i,r,o,s,a))}}),ht=N.global.defaultColor;function ct(t){return t&&void 0!==t.width}function ft(t){var e,n,i,a,r;return ct(t)?(e=t.x-(r=t.width/2),n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function gt(t,e,n){return t===e?n:t===n?e:t}function mt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&ft(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}N._set("global",{elements:{rectangle:{backgroundColor:ht,borderColor:ht,borderSkipped:"bottom",borderWidth:0}}});var pt=G.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=ft(t),n=e.right-e.left,i=e.bottom-e.top,a=function(t,e,n){var i,a,r,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=gt(e,"left","right")):t.base<t.y&&(e=gt(e,"bottom","top")),n[e]=!0,n):n}(t);return V.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return mt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return ct(n)?mt(n,t,null):mt(n,null,e)},inXRange:function(t){return mt(this._view,t,null)},inYRange:function(t){return mt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return ct(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return ct(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),vt={},bt=ot,yt=dt,xt=pt;vt.Arc=it,vt.Line=bt,vt.Point=yt,vt.Rectangle=xt;var _t=V._deprecated,wt=V.valueOrDefault;N._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),N._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var kt=tt.extend({dataElementType:vt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;tt.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,_t("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),_t("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),_t("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),_t("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),_t("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},V.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),d=a.calculateBarValuePixels(a.index,e,i),h=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:d.base,r.x=l?n?s:d.head:h.center,r.y=l?h.center:n?s:d.head,r.height=l?h.size:void 0,r.width=l?void 0:h.size},_getStacks:function(t){var e,n,i=this._getIndexScale(),a=i._getMatchingVisibleMetas(this._type),r=i.options.stacked,o=a.length,s=[];for(e=0;e<o&&(n=a[e],(!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this,i=n._getIndexScale(),a=[];for(t=0,e=n.getMeta().data.length;t<e;++t)a.push(i.getPixelForValue(null,t,n.index));return{pixels:a,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,d=this,h=d.chart,c=d._getValueScale(),f=c.isHorizontal(),g=h.data.datasets,m=c._getMatchingVisibleMetas(d._type),p=c._parseValue(g[t].data[e]),v=n.minBarLength,b=c.options.stacked,y=d.getMeta().stack,x=void 0===p.start?0:p.max>=0&&p.min>=0?p.min:p.max,_=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,w=m.length;if(b||void 0===b&&void 0!==y)for(i=0;i<w&&(a=m[i]).index!==t;++i)a.stack===y&&(r=void 0===(u=c._parseValue(g[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=c.getPixelForValue(x),l=(s=c.getPixelForValue(x+_))-o,void 0!==v&&Math.abs(l)<v&&(l=v,s=_>=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=n.categoryPercentage;return null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o),i=r-(r-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:n.barPercentage,start:i}}(e,n,i):function(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=V.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return V.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}(e,n,i),r=this.getStackIndex(t,this.getMeta().stack),o=a.start+a.chunk*r+a.chunk/2,s=Math.min(wt(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),i=t.getMeta().data,a=t.getDataset(),r=i.length,o=0;for(V.canvas.clipArea(e.ctx,e.chartArea);o<r;++o){var s=n._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||i[o].draw()}V.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var t=this,e=V.extend({},tt.prototype._resolveDataElementOptions.apply(t,arguments)),n=t._getIndexScale().options,i=t._getValueScale().options;return e.barPercentage=wt(n.barPercentage,e.barPercentage),e.barThickness=wt(n.barThickness,e.barThickness),e.categoryPercentage=wt(n.categoryPercentage,e.categoryPercentage),e.maxBarThickness=wt(n.maxBarThickness,e.maxBarThickness),e.minBarLength=wt(i.minBarLength,e.minBarLength),e}}),Mt=V.valueOrDefault,St=V.options.resolve;N._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": ("+t.xLabel+", "+t.yLabel+", "+e.datasets[t.datasetIndex].data[t.index].r+")"}}}});var Dt=tt.extend({dataElementType:vt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta();V.each(n.data,(function(n,i){e.updateElement(n,i,t)}))},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Mt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Mt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Mt(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=tt.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=V.extend({},s)),s.radius=St([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),Ct=V.valueOrDefault,Pt=Math.PI,Tt=2*Pt,Ot=Pt/2;N._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-Ot,circumference:Tt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return V.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var At=tt.extend({dataElementType:vt.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i=this,a=i.chart,r=a.chartArea,o=a.options,s=1,l=1,u=0,d=0,h=i.getMeta(),c=h.data,f=o.cutoutPercentage/100||0,g=o.circumference,m=i._getRingWeight(i.index);if(g<Tt){var p=o.rotation%Tt,v=(p+=p>=Pt?-Tt:p<-Pt?Tt:0)+g,b=Math.cos(p),y=Math.sin(p),x=Math.cos(v),_=Math.sin(v),w=p<=0&&v>=0||v>=Tt,k=p<=Ot&&v>=Ot||v>=Tt+Ot,M=p<=-Ot&&v>=-Ot||v>=Pt+Ot,S=p===-Pt||v>=Pt?-1:Math.min(b,b*f,x,x*f),D=M?-1:Math.min(y,y*f,_,_*f),C=w?1:Math.max(b,b*f,x,x*f),P=k?1:Math.max(y,y*f,_,_*f);s=(C-S)/2,l=(P-D)/2,u=-(C+S)/2,d=-(P+D)/2}for(e=0,n=c.length;e<n;++e)c[e]._options=i._resolveDataElementOptions(c[e],e);for(a.borderWidth=i.getMaxBorderWidth(),a.outerRadius=Math.max(Math.min((r.right-r.left-a.borderWidth)/s,(r.bottom-r.top-a.borderWidth)/l)/2,0),a.innerRadius=Math.max(a.outerRadius*f,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(i._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=d*a.outerRadius,h.total=i.calculateTotal(),i.outerRadius=a.outerRadius-a.radiusLength*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-a.radiusLength*m,0),e=0,n=c.length;e<n;++e)i.updateElement(c[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate||t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/Tt),g=t._options||{};V.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,borderAlign:g.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:n&&s.animateScale?0:i.outerRadius,innerRadius:n&&s.animateScale?0:i.innerRadius,label:V.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var m=t._model;n&&s.animateRotate||(m.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,m.endAngle=m.startAngle+m.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return V.each(n.data,(function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))})),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?Tt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){t=(i=d.getDatasetMeta(e)).data,e!==this.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(u=(l=o.hoverBorderWidth)>(u=(s=o.borderWidth)>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Ct(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Ct(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Ct(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(Ct(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});N._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),N._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ft=kt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),It=V.valueOrDefault,Lt=V.options.resolve,Rt=V.canvas._isPointInArea;function Nt(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}function Wt(t,e,n){var i=n/2,a=Nt(t,i),r=Nt(e,i);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Yt(t){var e,n,i,a;return V.isObject(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a}}N._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var zt=tt.extend({datasetElementType:vt.Line,dataElementType:vt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i._config,l=i._showLine=It(s.showLine,i.chart.options.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(l&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r._xScale,c=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=h.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?c.getBasePixel():r.calculatePointY(d,e,u),t._xScale=h,t._yScale=c,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:It(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,n=e._config,i=t.custom||{},a=e.chart.options,r=a.elements.line,o=tt.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=It(n.spanGaps,a.spanGaps),o.tension=It(n.lineTension,r.tension),o.steppedLine=Lt([i.steppedLine,n.steppedLine,r.stepped]),o.clip=Yt(It(n.clip,Wt(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u=this.chart,d=this._yScale,h=0,c=0;if(d.options.stacked){for(o=+d.getRightValue(t),l=(s=u._getSortedVisibleDatasetMetas()).length,i=0;i<l&&(a=s[i]).index!==n;++i)"line"===a.type&&a.yAxisID===d.id&&((r=+d.getRightValue(u.data.datasets[a.index].data[e]))<0?c+=r||0:h+=r||0);return d.getPixelForValue(o<0?c+o:h+o)}return d.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.chart,r=this.getMeta(),o=r.dataset._model,s=a.chartArea,l=r.data||[];function u(t,e,n){return Math.max(Math.min(t,n),e)}if(o.spanGaps&&(l=l.filter((function(t){return!t._model.skip}))),"monotone"===o.cubicInterpolationMode)V.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)n=l[t]._model,i=V.splineCurve(V.previousItem(l,t)._model,n,V.nextItem(l,t)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)Rt(n=l[t]._model,s)&&(t>0&&Rt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&Rt(l[t+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this,n=e.chart,i=e.getMeta(),a=i.data||[],r=n.chartArea,o=n.canvas,s=0,l=a.length;for(e._showLine&&(V.canvas.clipArea(n.ctx,{left:!1===(t=i.dataset._model.clip).left?0:r.left-t.left,right:!1===t.right?o.width:r.right+t.right,top:!1===t.top?0:r.top-t.top,bottom:!1===t.bottom?o.height:r.bottom+t.bottom}),i.dataset.draw(),V.canvas.unclipArea(n.ctx));s<l;++s)a[s].draw(r)},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=It(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=It(n.hoverBorderWidth,n.borderWidth),e.radius=It(n.hoverRadius,n.radius)}}),Et=V.options.resolve;N._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var Vt=tt.extend({dataElementType:vt.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],d=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=d.length;e<n;++e)d[e]._options=a._resolveDataElementOptions(d[e],e),a.updateElement(d[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],m=g+(t.hidden?0:i._angles[e]),p=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};V.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:h,innerRadius:0,outerRadius:n?p:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:m,label:V.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return V.each(e.data,(function(e,i){isNaN(t.data[i])||e.hidden||n++})),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor,a=V.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();return isNaN(i.data[t])||a.data[t].hidden?0:Et([e.chart.options.elements.arc.angle,2*Math.PI/n],{chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index},t)}});N._set("pie",V.clone(N.doughnut)),N._set("pie",{cutoutPercentage:0});var Ht=At,Bt=V.valueOrDefault;N._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var jt=tt.extend({datasetElementType:vt.Line,dataElementType:vt.Point,linkScales:V.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:s.x,h=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:h,skip:a.skip||isNaN(d)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Bt(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=tt.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Bt(e.spanGaps,n.spanGaps),i.tension=Bt(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}for(a.dataset._model.spanGaps&&(o=o.filter((function(t){return!t._model.skip}))),t=0,e=o.length;t<e;++t)n=o[t]._model,i=V.splineCurve(V.previousItem(o,t,!0)._model,n,V.nextItem(o,t,!0)._model,n.tension),n.controlPointPreviousX=s(i.previous.x,r.left,r.right),n.controlPointPreviousY=s(i.previous.y,r.top,r.bottom),n.controlPointNextX=s(i.next.x,r.left,r.right),n.controlPointNextY=s(i.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Bt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Bt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Bt(n.hoverBorderWidth,n.borderWidth),e.radius=Bt(n.hoverRadius,n.radius)}});N._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),N._set("global",{datasets:{scatter:{showLine:!1}}});var Ut={bar:kt,bubble:Dt,doughnut:At,horizontalBar:Ft,line:zt,polarArea:Vt,pie:Ht,radar:jt,scatter:zt};function Gt(t,e){return t.native?{x:t.x,y:t.y}:V.getRelativePosition(t,e)}function qt(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(a=0,o=(n=l[i].data).length;a<o;++a)(s=n[a])._view.skip||e(s)}function Zt(t,e){var n=[];return qt(t,(function(t){t.inRange(e.x,e.y)&&n.push(t)})),n}function $t(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return qt(t,(function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}})),r}function Xt(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function Jt(t,e,n){var i=Gt(e,t);n.axis=n.axis||"x";var a=Xt(n.axis),r=n.intersect?Zt(t,i):$t(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach((function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)})),o):[]}var Kt={modes:{single:function(t,e){var n=Gt(e,t),i=[];return qt(t,(function(t){if(t.inRange(n.x,n.y))return i.push(t),i})),i.slice(0,1)},label:Jt,index:Jt,dataset:function(t,e,n){var i=Gt(e,t);n.axis=n.axis||"xy";var a=Xt(n.axis),r=n.intersect?Zt(t,i):$t(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return Jt(t,e,{intersect:!1})},point:function(t,e){return Zt(t,Gt(e,t))},nearest:function(t,e,n){var i=Gt(e,t);n.axis=n.axis||"xy";var a=Xt(n.axis);return $t(t,i,n.intersect,a)},x:function(t,e,n){var i=Gt(e,t),a=[],r=!1;return qt(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Gt(e,t),a=[],r=!1;return qt(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},Qt=V.extend;function te(t,e){return V.where(t,(function(t){return t.pos===e}))}function ee(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function ne(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function ie(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ne(o,t,"left","right"),a=e.outerHeight-ne(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function ae(t,e){var n,i=e.maxPadding;return n={left:0,top:0,right:0,bottom:0},(t?["left","right"]:["top","bottom"]).forEach((function(t){n[t]=Math.max(e[t],i[t])})),n}function re(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)(o=(r=t[i]).box).update(r.width||e.w,r.height||e.h,ae(r.horizontal,e)),ie(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&re(u,e,n)||l}function oe(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)o=(r=t[i]).box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}N._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var se,le={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)n.hasOwnProperty(i=a[o])&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=V.options.toPadding((t.options.layout||{}).padding),a=e-i.width,r=n-i.height,o=function(t){var e=function(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)a.push({index:e,box:i=t[e],pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}(t),n=ee(te(e,"left"),!0),i=ee(te(e,"right")),a=ee(te(e,"top"),!0),r=ee(te(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:te(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}(t.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:r/2}),d=Qt({maxPadding:Qt({},i),w:a,h:r,x:i.left,y:i.top},i);!function(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)(a=t[n]).width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}(s.concat(l),u),re(s,d,u),re(l,d,u)&&re(s,d,u),function(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(d),oe(o.leftAndTop,d,u),d.x+=d.w,d.y+=d.h,oe(o.rightAndBottom,d,u),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h},V.each(o.chartArea,(function(e){var n=e.box;Qt(n,t.chartArea),n.update(d.w,d.h)}))}}},ue=(se=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&se.default||se,de="chartjs-size-monitor",he="chartjs-render-monitor",ce=["animationstart","webkitAnimationStart"],fe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ge(t,e){var n=V.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(n){}return t}()&&{passive:!0};function pe(t,e,n){t.addEventListener(e,n,me)}function ve(t,e,n){t.removeEventListener(e,n,me)}function be(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function ye(t){var e=document.createElement("div");return e.className=t||"",e}var xe={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var n=t.$chartjs||(t.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(e.host?e:document.head,ue)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=ge(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=ge(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e.$chartjs){var n=e.$chartjs.initial;["height","width"].forEach((function(t){var i=n[t];V.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)})),V.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e.$chartjs}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n.$chartjs||(n.$chartjs={});pe(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=fe[t.type]||t.type,i=V.getRelativePosition(t,e);return be(n,e,i.x,i.y,t)}(e,t))})}else!function(t,e,n){var i,a,r,o,s=t.$chartjs||(t.$chartjs={}),l=s.resizer=function(t){var e=1e6,n=ye(de),i=ye(de+"-expand"),a=ye(de+"-shrink");i.appendChild(ye()),a.appendChild(ye()),n.appendChild(i),n.appendChild(a),n._reset=function(){i.scrollLeft=e,i.scrollTop=e,a.scrollLeft=e,a.scrollTop=e};var r=function(){n._reset(),t()};return pe(i,"scroll",r.bind(i,"expand")),pe(a,"scroll",r.bind(a,"shrink")),n}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(be("resize",n)),i&&i.clientWidth<a&&n.canvas&&e(be("resize",n))}},r=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,V.requestAnimFrame.call(window,(function(){r=!1,i.apply(a,o)})))}));!function(t,e){var n=t.$chartjs||(t.$chartjs={}),i=n.renderProxy=function(t){"chartjs-render-animation"===t.animationName&&e()};V.each(ce,(function(e){pe(t,e,i)})),n.reflow=!!t.offsetParent,t.classList.add(he)}(t,(function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}}))}(i,n,t)},removeEventListener:function(t,e,n){var i,a,r,o=t.canvas;if("resize"!==e){var s=((n.$chartjs||{}).proxies||{})[t.id+"_"+e];s&&ve(o,e,s)}else r=(a=(i=o).$chartjs||{}).resizer,delete a.resizer,function(t){var e=t.$chartjs||{},n=e.renderProxy;n&&(V.each(ce,(function(e){ve(t,e,n)})),delete e.renderProxy),t.classList.remove(he)}(i),r&&r.parentNode&&r.parentNode.removeChild(r)}};V.addEvent=pe,V.removeEvent=ve;var _e=V.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},xe._enabled?xe:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}});N._set("global",{plugins:{}});var we={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach((function(t){if(-1===n.indexOf(t)){var e=t.id,a=r[e];!1!==a&&(!0===a&&(a=V.clone(N.global.plugins[e])),n.push(t),i.push({plugin:t,options:a||{}}))}})),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},ke={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=V.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?V.merge(Object.create(null),[N.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=V.extend(n.defaults[t],e))},addScalesToLayout:function(t){V.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,le.addBox(t,e)}))}},Me=V.valueOrDefault,Se=V.rtl.getRtlAdapter;N._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:V.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:V.noop,beforeBody:V.noop,beforeLabel:V.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),V.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:V.noop,afterBody:V.noop,beforeFooter:V.noop,footer:V.noop,afterFooter:V.noop}}});var De={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=V.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Ce(t,e){return e&&(V.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Pe(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Te(t){var e=N.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Me(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Me(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Me(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Me(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Me(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Me(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Me(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Me(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Me(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Oe(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ae(t){return Ce([],Pe(t))}var Fe=G.extend({initialize:function(){this._model=Te(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Ce(o,Pe(i)),o=Ce(o,Pe(a)),Ce(o,Pe(r))},getBeforeBody:function(){return Ae(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return V.each(t,(function(t){var r={before:[],lines:[],after:[]};Ce(r.before,Pe(i.beforeLabel.call(n,t,e))),Ce(r.lines,i.label.call(n,t,e)),Ce(r.after,Pe(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return Ae(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Ce(r,Pe(n)),r=Ce(r,Pe(i)),Ce(r,Pe(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Te(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=De[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;e<n;++e)k.push((a=void 0,r=void 0,l=void 0,u=void 0,d=void 0,a=(i=m[e])._xScale,r=i._yScale||i._scale,o=i._index,u=(l=i._chart.getDatasetMeta(s=i._datasetIndex).controller)._getIndexScale(),d=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:r?r.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:d?""+d.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:i._model.x,y:i._model.y}));c.filter&&(k=k.filter((function(t){return c.filter(t,p)}))),c.itemSort&&(k=k.sort((function(t,e){return c.itemSort(t,e,p)}))),V.each(k,(function(t){_.push(c.callbacks.labelColor.call(h,t,h._chart)),w.push(c.callbacks.labelTextColor.call(h,t,h._chart))})),g.title=h.getTitle(k,p),g.beforeBody=h.getBeforeBody(k,p),g.body=h.getBody(k,p),g.afterBody=h.getAfterBody(k,p),g.footer=h.getFooter(k,p),g.x=x.x,g.y=x.y,g.caretPadding=c.caretPadding,g.labelColors=_,g.labelTextColors=w,g.dataPoints=k,y=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0),s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=(o+=e.beforeBody.length+e.afterBody.length)*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=V.fontString(u,e._titleFontStyle,e._titleFontFamily),V.each(e.title,f),n.font=V.fontString(d,e._bodyFontStyle,e._bodyFontFamily),V.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,V.each(r,(function(t){V.each(t.before,f),V.each(t.lines,f),V.each(t.after,f)})),c=0,n.font=V.fontString(h,e._footerFontStyle,e._footerFontFamily),V.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,g),b=function(t,e,n,i){var a=t.x,r=t.y,o=t.caretPadding,s=n.xAlign,l=n.yAlign,u=t.caretSize+o,d=t.cornerRadius+o;return"right"===s?a-=e.width:"center"===s&&((a-=e.width/2)+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===l?r+=u:r-="bottom"===l?e.height+u:e.height/2,"center"===l?"left"===s?a+=u:"right"===s&&(a-=u):"left"===s?a-=d:"right"===s&&(a+=d),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this.getCaretPosition(t,e,this._view);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Se(e.rtl,e.x,e.width);for(t.x=Oe(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=V.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,d,h=e.bodyFontSize,c=e.bodySpacing,f=e._bodyAlign,g=e.body,m=e.displayColors,p=0,v=m?Oe(e,"left"):0,b=Se(e.rtl,e.x,e.width),y=function(e){n.fillText(e,b.x(t.x+p),t.y+h/2),t.y+=h+c},x=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=V.fontString(h,e._bodyFontStyle,e._bodyFontFamily),t.x=Oe(e,x),n.fillStyle=e.bodyFontColor,V.each(e.beforeBody,y),p=m&&"right"!==x?"center"===f?h/2+1:h+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],r=e.labelColors[s],n.fillStyle=a=e.labelTextColors[s],V.each(i.before,y),l=0,d=(o=i.lines).length;l<d;++l){if(m){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,h),t.y,h,h),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,h),t.y,h,h),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),h-2),t.y+1,h-2,h-2),n.fillStyle=a}y(o[l])}V.each(i.after,y)}p=0,V.each(e.afterBody,y),t.y-=c},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Se(e.rtl,e.x,e.width);for(t.x=Oe(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=V.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,d=e.cornerRadius;n.beginPath(),n.moveTo(o+d,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-d,s),n.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-d),n.quadraticCurveTo(o+l,s+u,o+l-d,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+d,s+u),n.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+d),n.quadraticCurveTo(o,s,o+d,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity;this._options.enabled&&(e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length)&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,V.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),V.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!V.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}});Fe.positioners=De;var Ie=V.valueOrDefault;function Le(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)r=Ie((o=n[t][a]).type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),V.merge(e[t][a],!e[t][a].type||o.type&&o.type!==e[t][a].type?[ke.getScaleDefaults(r),o]:o)}else V._merger(t,e,n,i)}})}function Re(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=Le(a,r):"scale"===t?e[t]=V.merge(a,[ke.getScaleDefaults(r.type),r]):V._merger(t,e,n,i)}})}function Ne(t){var e=t.options;V.each(t.scales,(function(e){le.removeBox(t,e)})),e=Re(N.global,N[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function We(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(V.findIndex(t,a)>=0);return i}function Ye(t){return"top"===t||"bottom"===t}function ze(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}N._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Ee=function(t,e){return this.construct(t,e),this};V.extend(Ee.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Re(N.global,N[t.type],t.options||{}),t}(e);var i=_e.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=V.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Ee.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return we.notify(t,"beforeInit"),V.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),we.notify(t,"afterInit"),t},clear:function(){return V.canvas.clear(this),this},stop:function(){return $.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(V.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:V.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",V.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};we.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;V.each(e.xAxes,(function(t,n){t.id||(t.id=We(e.xAxes,"x-axis-",n))})),V.each(e.yAxes,(function(t,n){t.id||(t.id=We(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(i,(function(e){var i=e.options,r=i.id,o=Ie(i.type,e.dtype);Ye(i.position)!==Ye(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=ke.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),V.each(a,(function(t,e){t||delete n[e]})),t.scales=n,ke.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Ut[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;V.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),Ne(i),we._invalidate(i),!1!==we.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();for(e=0,n=i.data.datasets.length;e<n;e++)i.getDatasetMeta(e).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&V.each(a,(function(t){t.reset()})),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],we.notify(i,"afterUpdate"),i._layers.sort(ze("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){var t=this;!1!==we.notify(t,"beforeLayout")&&(le.update(this,this.width,this.height),t._layers=[],V.each(t.boxes,(function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())}),t),t._layers.forEach((function(t,e){t._idx=e})),we.notify(t,"afterScaleUpdate"),we.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==we.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);we.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==we.notify(e,"beforeDatasetUpdate",[i])&&(n.controller._update(),we.notify(e,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=Ie(t.duration,n&&n.duration),a=t.lazy;if(!1!==we.notify(e,"beforeRender")){var r=function(t){we.notify(e,"afterRender"),V.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new Z({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=e.currentStep,i=n/e.numSteps;t.draw((0,V.easing.effects[e.easing])(i),i,n)},onAnimationProgress:n.onProgress,onAnimationComplete:r});$.addAnimation(e,o,i,a)}else e.draw(),r(new Z({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),V.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==we.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),we.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=this,a=[];for(e=0,n=(i.data.datasets||[]).length;e<n;++e)t&&!i.isDatasetVisible(e)||a.push(i.getDatasetMeta(e));return a.sort(ze("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n,i=this;if(!1!==we.notify(i,"beforeDatasetsDraw",[t])){for(n=(e=i._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)i.drawDataset(e[n],t);we.notify(i,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==we.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),we.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==we.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),we.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return Kt.modes.single(this,t)},getElementsAtEvent:function(t){return Kt.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Kt.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=Kt.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return Kt.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:t}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),V.canvas.clear(n),_e.releaseContext(n.ctx),n.canvas=null,n.ctx=null),we.notify(n,"destroy"),delete Ee.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Fe({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};V.each(t.options.events,(function(i){_e.addEventListener(t,i,n),e[i]=n})),t.options.responsive&&(n=function(){t.resize()},_e.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,V.each(e,(function(e,n){_e.removeEventListener(t,n,e)})))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==we.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),we.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===t.type?[]:n.getElementsAtEventForMode(t,a.mode,a),V.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!V.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),Ee.instances={};var Ve=Ee;function He(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Be(t){this.options=t||{}}Ee.Controller=Ee,Ee.types={},V.configMerge=Re,V.scaleMerge=Le,V.extend(Be.prototype,{formats:He,parse:He,format:He,add:He,diff:He,startOf:He,endOf:He,_create:function(t){return t}}),Be.override=function(t){V.extend(Be.prototype,t)};var je={_date:Be},Ue={formatters:{values:function(t){return V.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=V.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=V.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(V.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},Ge=V.isArray,qe=V.isNullOrUndef,Ze=V.valueOrDefault,$e=V.valueAtIndexOrDefault;function Xe(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel,u=1e-6;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=r<e?i:-i)<s-u||o>l+u)))return o}function Je(t){return t.drawTicks?t.tickMarkLength:0}function Ke(t){var e,n;return t.display?(e=V.options._parseFont(t),n=V.options.toPadding(t.padding),e.lineHeight+n.height):0}function Qe(t,e){return V.extend(V.options._parseFont({fontFamily:Ze(e.fontFamily,t.fontFamily),fontSize:Ze(e.fontSize,t.fontSize),fontStyle:Ze(e.fontStyle,t.fontStyle),lineHeight:Ze(e.lineHeight,t.lineHeight)}),{color:V.options.resolve([e.fontColor,t.fontColor,N.global.defaultFontColor])})}function tn(t){var e=Qe(t,t.minor);return{minor:e,major:t.major.enabled?Qe(t,t.major):e}}function en(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)void 0!==(e=t[n])._index&&a.push(e);return a}function nn(t,e,n,i){var a,r,o,s,l=Ze(n,0),u=Math.min(Ze(i,t.length),t.length),d=0;for(e=Math.ceil(e),i&&(e=(a=i-n)/Math.floor(a/e)),s=l;s<0;)d++,s=Math.round(l+d*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,d++,s=Math.round(l+d*e)):delete o.label}N._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Ue.formatters.values,minor:{},major:{}}});var an=G.extend({zeroLineIndex:0,getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){V.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=V.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,r=l._convertTicksToLabels((s=d<o.length)?function(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}(o,d):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){V.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){V.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){V.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){V.callback(this.options.beforeDataLimits,[this])},determineDataLimits:V.noop,afterDataLimits:function(){V.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){V.callback(this.options.beforeBuildTicks,[this])},buildTicks:V.noop,afterBuildTicks:function(t){var e=this;return Ge(t)&&t.length?V.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=V.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){V.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){V.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){V.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,h=u.minRotation||0,c=u.maxRotation,f=h;!s._isVisible()||!u.display||h>=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-Je(l.gridLines)-u.padding-Ke(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=V.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=Je(o)+Ke(r)),u?s&&(e.height=Je(o)+Ke(r)):e.height=t.maxHeight,a.display&&s){var d=tn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=V.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y);e.height=Math.min(t.maxHeight,e.height+(_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p))+v);var w,k,M=t.getPixelForTick(0)-t.left,S=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?x*c.width+_*c.offset:_*(c.height-c.offset),k=l?_*(f.height-f.offset):x*f.width+_*f.offset):(w=c.width/2,k=f.width/2),t.paddingLeft=Math.max((w-M)*t.width/(t.width-M),0)+3,t.paddingRight=Math.max((k-S)*t.width/(t.width-S),0)+3}else e.width=Math.min(t.maxWidth,e.width+(a.mirror?0:g.width+v+p)),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(qe(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[],_=0,w=0;for(a=0;a<v;++a){if(s=n[a].label,t.font=u=(l=n[a].major?e.major:e.minor).string,d=i[u]=i[u]||{data:{},gc:[]},h=l.lineHeight,c=f=0,qe(s)||Ge(s)){if(Ge(s))for(r=0,o=s.length;r<o;++r)qe(g=s[r])||Ge(g)||(c=V.measureText(t,d.data,d.gc,c,g),f+=h)}else c=V.measureText(t,d.data,d.gc,c,s),f=h;b.push(c),y.push(f),x.push(h/2),_=Math.max(c,_),w=Math.max(f,w)}function k(t){return{width:b[t]||0,height:y[t]||0,offset:x[t]||0}}return function(t,e){V.each(t,(function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}}))}(i,v),m=b.indexOf(_),p=y.indexOf(w),{first:k(0),last:k(v-1),widest:k(m),highest:k(p)}}(t.ctx,tn(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return Ge(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(e=void 0,n=t=+this.getRightValue(t),i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:V.noop,getPixelForValue:V.noop,getValueForPixel:V.noop,getPixelForTick:function(t){var e=this,n=e.options.offset,i=e._ticks.length,a=1/Math.max(i-(n?0:1),1);return t<0||t>i-1?null:e.getPixelForDecimal(t*a+(n?a/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.options.ticks,s=o.maxTicksLimit||r._length/r._tickSize()+1,l=o.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}(t):[],u=l.length,d=l[0],h=l[u-1];if(u>s)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,o=e[++r*n]):delete a.label}(t,l,u/s),en(t);if(i=function(t,e,n,i){var a,r,o,s,l=function(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(o=0,s=(a=V.math._factorize(l)).length-1;o<s;o++)if((r=a[o])>u)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e<n;e++)nn(t,i,l[e],l[e+1]);return nn(t,i,V.isNullOrUndef(a=u>1?(h-d)/(u-1):null)?0:d-a,d),nn(t,i,h,V.isNullOrUndef(a)?t.length:h+a),en(t)}return nn(t,i),en(t)},_tickSize:function(){var t=this,e=t.options.ticks,n=V.toRadians(t.labelRotation),i=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),r=t._getLabelSizes(),o=e.autoSkipPadding||0,s=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return t.isHorizontal()?l*i>s*a?s/i:l/a:l*a<s*i?l/i:s/a},_isVisible:function(){var t,e,n,i=this,a=i.chart,r=i.options.display;if("auto"!==r)return!!r;for(t=0,e=a.data.datasets.length;t<e;++t)if(a.isDatasetVisible(t)&&((n=a.getDatasetMeta(t)).xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,m,p,v,b=this,y=b.chart,x=b.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,M=b.isHorizontal(),S=b._ticksToDraw,D=S.length+(k?1:0),C=Je(_),P=[],T=_.drawBorder?$e(_.lineWidth,0,0):0,O=T/2,A=V._alignPixel,F=function(t){return A(y,t,T)};for("top"===w?(e=F(b.bottom),s=b.bottom-C,u=e-O,h=F(t.top)+O,f=t.bottom):"bottom"===w?(e=F(b.top),h=t.top,f=F(t.bottom)-O,s=e+O,u=b.top+C):"left"===w?(e=F(b.right),o=b.right-C,l=e-O,d=F(t.left)+O,c=t.right):(e=F(b.left),d=t.left,c=F(t.right)-O,o=e+O,l=b.left+C),n=0;n<D;++n)qe((i=S[n]||{}).label)&&n<S.length||(n===b.zeroLineIndex&&x.offset===k?(g=_.zeroLineWidth,m=_.zeroLineColor,p=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=$e(_.lineWidth,n,1),m=$e(_.color,n,"rgba(0,0,0,0.1)"),p=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=Xe(b,i._index||n,k))&&(r=A(y,a,g),M?o=l=d=c=r:s=u=h=f=r,P.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,width:g,color:m,borderDash:p,borderDashOffset:v})));return P.ticksLength=D,P.borderValue=e,P},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.options,g=f.ticks,m=f.position,p=g.mirror,v=c.isHorizontal(),b=c._ticksToDraw,y=tn(g),x=g.padding,_=Je(f.gridLines),w=-V.toRadians(c.labelRotation),k=[];for("top"===m?(r=c.bottom-_-x,o=w?"left":"center"):"bottom"===m?(r=c.top+_+x,o=w?"right":"center"):"left"===m?(a=c.right-(p?0:_)-x,o=p?"left":"right"):(a=c.left+(p?0:_)+x,o=p?"right":"left"),t=0,e=b.length;t<e;++t)qe(i=(n=b[t]).label)||(s=c.getPixelForTick(n._index||t)+g.labelOffset,u=(l=n.major?y.major:y.minor).lineHeight,d=Ge(i)?i.length:1,v?(a=s,h="top"===m?((w?1:.5)-d)*u:(w?0:.5)*u):(r=s,h=(1-d)*u/2),k.push({x:a,y:r,rotation:w,label:i,font:l,textOffset:h,textAlign:o}));return k},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,d=V._alignPixel,h=n.drawBorder?$e(n.lineWidth,0,0):0,c=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=c.length;r<o;++r)a=(s=c[r]).color,(i=s.width)&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(h){var f,g,m,p,v=h,b=$e(n.lineWidth,c.ticksLength-1,1),y=c.borderValue;e.isHorizontal()?(f=d(u,e.left,v)-v/2,g=d(u,e.right,b)+b/2,m=p=y):(m=d(u,e.top,v)-v/2,p=d(u,e.bottom,b)+b/2,f=g=y),l.lineWidth=h,l.strokeStyle=$e(n.color,0),l.beginPath(),l.moveTo(f,m),l.lineTo(g,p),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,n,i,a,r,o,s,l,u=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,i=d.length;e<i;++e){if(o=(r=d[e]).font,u.save(),u.translate(r.x,r.y),u.rotate(r.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=r.textAlign,l=r.textOffset,Ge(s=r.label))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=Ze(i.fontColor,N.global.defaultFontColor),s=V.options._parseFont(i),l=V.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,h=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===d?t.bottom-u-l.bottom:t.top+u+l.top;else{var c="left"===d;a=c?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,h=c?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(h),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){var e=this;e._isVisible()&&(e._drawGrid(t),e._drawTitle(),e._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter((function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)}))}});an.prototype._draw=an.prototype.draw;var rn=an,on=V.isNullOrUndef,sn=rn.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a))>=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this,e=t._getLabels(),n=t.minIndex,i=t.maxIndex;t.ticks=0===n&&i===e.length-1?e:e.slice(n,i+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart;return i.getDatasetMeta(e).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[e].data[t]):n._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;rn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return on(e)||on(n)||(t=o.chart.data.datasets[n].data[e]),on(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=V.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,n=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(n,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}});sn._defaults={position:"bottom"};var ln=V.isNullOrUndef,un=rn.extend({getRightValue:function(t){return"string"==typeof t?+t:rn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=V.sign(t.min),i=V.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(t.min=null===t.min?e.suggestedMin:Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(t.max=null===t.max?e.suggestedMax:Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,i=n.stepSize,a=n.maxTicksLimit;return i?t=Math.ceil(e.max/i)-Math.floor(e.min/i)+1:(t=e._computeTickLimit(),a=a||11),a&&(t=Math.min(a,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:V.noop,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:V.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=V.niceNum((g-f)/u/l)*l;if(m<1e-14&&ln(d)&&ln(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=V.niceNum(r*m/u/l)*l),s||ln(c)?n=Math.pow(10,V._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!ln(d)&&V.almostWhole(d/m,m/1e3)&&(i=d),!ln(h)&&V.almostWhole(h/m,m/1e3)&&(a=h)),r=V.almostEquals(r=(a-i)/m,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(ln(d)?i:d);for(var p=1;p<r;++p)o.push(Math.round((i+p*m)*n)/n);return o.push(ln(h)?a:h),o}(i,t);t.handleDirectionalChanges(),t.max=V.max(a),t.min=V.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),rn.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;rn.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(a-i)/Math.max(n.length-1,1)/2,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),dn={position:"left",ticks:{callback:Ue.formatters.linear}};function hn(t,e,n,i){var a,r,o=t.options,s=function(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}(e,o.stacked,n),l=s.pos,u=s.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:r.min<0||r.max<0?u[a]+=r.min:l[a]+=r.max)}function cn(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var fn=un.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=r.stacked,u={},d=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<d;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<d;++t)n=o[(e=s[t]).index].data,l?hn(a,u,e,n):cn(a,e,n);V.each(u,(function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,V.min(i)),a.max=Math.max(a.max,V.max(i))})),a.min=V.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=V.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=V.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this;return e.getPixelForDecimal((+e.getRightValue(t)-e._startValue)/e._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}});fn._defaults=dn;var gn=V.valueOrDefault,mn=V.math.log10,pn={position:"left",ticks:{callback:Ue.formatters.logarithmic}};function vn(t,e){return V.isFinite(t)&&t>=0?t:e}var bn=rn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e)&&void 0!==e.stack){c=!0;break}if(s.stacked||c){var f={};for(t=0;t<u.length;t++){var g=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&h(e))for(void 0===f[g]&&(f[g]=[]),a=0,r=(i=u[t].data).length;a<r;a++){var m=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(m[a]=m[a]||0,m[a]+=n.max)}}V.each(f,(function(t){if(t.length>0){var e=V.min(t),n=V.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e))for(a=0,r=(i=u[t].data).length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=V.isFinite(o.min)?o.min:null,o.max=V.isFinite(o.max)?o.max:null,o.minNotZero=V.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=vn(e.min,t.min),t.max=vn(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(mn(t.min))-1),t.max=Math.pow(10,Math.floor(mn(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(mn(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(mn(t.min))+1):10),null===t.minNotZero&&(t.minNotZero=t.min>0?t.min:t.max<1?Math.pow(10,Math.floor(mn(t.max))):1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:vn(e.min),max:vn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=gn(t.min,Math.pow(10,Math.floor(mn(e.min)))),o=Math.floor(mn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(mn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(mn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10==++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=gn(t.max,r);return a.push(u),a}(i,t);t.max=V.max(a),t.min=V.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),rn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(mn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;rn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=gn(t.options.ticks.fontSize,N.global.defaultFontSize)/t._length),t._startValue=mn(e),t._valueOffset=n,t._valueRange=(mn(t.max)-mn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(mn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}});bn._defaults=pn;var yn=V.valueOrDefault,xn=V.valueAtIndexOrDefault,_n=V.options.resolve,wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ue.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function kn(t){var e=t.ticks;return e.display&&t.display?yn(e.fontSize,N.global.defaultFontSize)+2*e.backdropPaddingY:0}function Mn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Sn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Dn(t,e,n,i){var a,r,o=n.y+i/2;if(V.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function Cn(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function Pn(t){return V.isNumber(t)?t:0}var Tn=un.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=kn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;V.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);V.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/kn(this.options))},convertTicksToLabels:function(){var t=this;un.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=V.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?function(t){var e,n,i,a=V.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;e<d;e++){i=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,n=V.isArray(u=t.pointLabels[e])?{w:V.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=n;var h=t.getIndexAngle(e),c=V.toDegrees(h)%360,f=Mn(c,i.x,n.w,0,180),g=Mn(c,i.y,n.h,90,270);f.start<r.l&&(r.l=f.start,o.l=h),f.end>r.r&&(r.r=f.end,o.r=h),g.start<r.t&&(r.t=g.start,o.t=h),g.end>r.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(t):t.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Pn(a),r=Pn(r),o=Pn(o),s=Pn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=n+a.drawingArea,o=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((t+a.drawingArea+(a.width-e-a.drawingArea))/2+a.left),a.yCenter=Math.floor((r+o)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(V.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this,n=e.min,i=e.max;return e.getPointPositionForValue(t||0,e.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=yn(s.lineWidth,o.lineWidth),u=yn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=kn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=V.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=t.getPointPosition(s,r+(0===s?a/2:0)+5),u=xn(i.fontColor,s,N.global.defaultFontColor);e.fillStyle=u;var d=t.getIndexAngle(s),h=V.toDegrees(d);e.textAlign=Sn(h),Cn(h,t._pointLabelSizes[s],l),Dn(e,t.pointLabels[s],l,o.lineHeight)}e.restore()}(i),o.display&&V.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=xn(e.color,i-1),u=xn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}(i,o,e,n))})),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(_n([s.borderDash,o.borderDash,[]])),a.lineDashOffset=_n([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=V.options._parseFont(n),s=yn(n.fontColor,N.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",V.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:V.noop});Tn._defaults=wn;var On=V._deprecated,An=V.options.resolve,Fn=V.valueOrDefault,In=Number.MIN_SAFE_INTEGER||-9007199254740991,Ln=Number.MAX_SAFE_INTEGER||9007199254740991,Rn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(Rn);function Wn(t,e){return t-e}function Yn(t){return V.valueOrDefault(t.time.min,t.ticks.min)}function zn(t){return V.valueOrDefault(t.time.max,t.ticks.max)}function En(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(r=t[i=o+s>>1],!(a=t[i-1]||null))return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e];return r[i]+(o[i]-r[i])*(s?(n-r[e])/s:0)}function Vn(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),V.isFinite(o)||(o=n.parse(o))),o)}function Hn(t,e){if(V.isNullOrUndef(e))return null;var n=t.options.time,i=Vn(t,t.getRightValue(e));return null===i||n.round&&(i=+t._adapter.startOf(i,n.round)),i}function Bn(t,e,n,i){var a,r,o=Nn.length;for(a=Nn.indexOf(t);a<o-1;++a)if((r=Rn[Nn[a]]).common&&Math.ceil((n-e)/((r.steps?r.steps:Ln)*r.size))<=i)return Nn[a];return Nn[o-1]}function jn(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)o[a=e[i]]=i,r.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))(r=n[a])>=0&&(e[r].major=!0);return e}(t,r,o,n):r}var Un=rn.extend({initialize:function(){this.mergeTicksOptions(),rn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new je._date(e.adapters.date);return On("time scale",n.format,"time.format","time.parser"),On("time scale",n.min,"time.min","ticks.min"),On("time scale",n.max,"time.max","ticks.max"),V.mergeIf(n.displayFormats,i.formats()),rn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),rn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=Ln,f=In,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)p.push(Hn(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(V.isObject((a=l.data.datasets[t].data)[0]))for(m[t]=[],e=0,i=a.length;e<i;++e)r=Hn(s,a[e]),g.push(r),m[t][e]=r;else m[t]=p.slice(0),o||(g=g.concat(p),o=!0);else m[t]=[];p.length&&(c=Math.min(c,p[0]),f=Math.max(f,p[p.length-1])),g.length&&(g=n>1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}(g).sort(Wn):g.sort(Wn),c=Math.min(c,g[0]),f=Math.max(f,g[g.length-1])),c=Hn(s,Yn(d))||c,f=Hn(s,zn(d))||f,c=c===Ln?+u.startOf(Date.now(),h):c,f=f===In?+u.endOf(Date.now(),h)+1:f,s.min=Math.min(c,f),s.max=Math.max(c+1,f),s._table=[],s._timestamps={data:g,datasets:m,labels:p}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),c=s.source,f=o.distribution;for(u="data"===c||"auto"===c&&"series"===f?u.data:"labels"===c?u.labels:function(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||Bn(s.minUnit,e,n,i),u=An([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,h=e,c=[];if(d&&(h=+r.startOf(h,"isoWeek",d)),h=+r.startOf(h,d?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a<n;a=+r.add(a,u,l))c.push(a);return a!==n&&"ticks"!==o.bounds||c.push(a),c}(i,a,r,h),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=Hn(i,Yn(o))||a,r=Hn(i,zn(o))||r,t=0,e=u.length;t<e;++t)(n=u[t])>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?Bn(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=Nn.length-1;r>=Nn.indexOf(n);r--)if(Rn[o=Nn[r]].common&&t._adapter.diff(a,i,o)>=e-1)return o;return Nn[n?Nn.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=Nn.indexOf(t)+1,n=Nn.length;e<n;++e)if(Rn[Nn[e]].common)return Nn[e]}(i._unit):void 0,i._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)(s=t[a])>e&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],s=d[a],void 0!==(o=d[a-1])&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}(i._timestamps.data,a,r,f),i._offsets=function(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=En(t,"time",e[0],"pos"),s=1===e.length?1-r:(En(t,"time",e[1],"pos")-r)/2,o=En(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-En(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(i._table,d,0,0,o),s.reverse&&d.reverse(),jn(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return V.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(Vn(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(Vn(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this,r=a.options,o=r.time.displayFormats,s=a._majorUnit,l=o[s],u=n[e],d=r.ticks,h=s&&l&&u&&u.major,c=a._adapter.format(t,i||(h?l:o[a._unit])),f=h?d.major:d.minor,g=An([f.callback,f.userCallback,d.callback,d.userCallback]);return g?g(c,e,n):c},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this,n=e._offsets,i=En(e._table,"time",t,"pos");return e.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=Hn(i,t)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end,a=En(e._table,"pos",i,"time");return e._adapter._create(a)},_getLabelSize:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=V.toRadians(e.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),s=Fn(n.fontSize,N.global.defaultFontSize);return{w:i*r+s*o,h:i*o+s*r}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,jn(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}});Un._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var Gn={category:sn,linear:fn,logarithmic:bn,radialLinear:Tn,time:Un},qn=t((function(t,e){t.exports=function(){var e,n;function i(){return e.apply(null,arguments)}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return void 0===t}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function h(t,e){for(var n in e)d(e,n)&&(t[n]=e[n]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function c(t,e,n,i){return we(t,e,n,i,!0).utc()}function f(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function g(t){if(null==t._isValid){var e=f(t),i=n.call(e.parsedDateParts,(function(t){return null!=t})),a=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(a=a&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return a;t._isValid=a}return t._isValid}function m(t){var e=c(NaN);return null!=t?h(f(e),t):f(e).userInvalidated=!0,e}n=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var p=i.momentProperties=[];function v(t,e){var n,i,a;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=f(e)),o(e._locale)||(t._locale=e._locale),p.length>0)for(n=0;n<p.length;n++)o(a=e[i=p[n]])||(t[i]=a);return t}var b=!1;function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,i.updateOffset(this),b=!1)}function x(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=_(e)),n}function k(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&w(t[i])!==w(e[i]))&&o++;return o+r}function M(t){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,e){var n=!0;return h((function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,t),n){for(var a,r=[],o=0;o<arguments.length;o++){if(a="","object"==typeof arguments[o]){for(var s in a+="\n["+o+"] ",arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[o];r.push(a)}M(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)}),e)}var D,C={};function P(t,e){null!=i.deprecationHandler&&i.deprecationHandler(t,e),C[t]||(M(e),C[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function O(t,e){var n,i=h({},t);for(n in e)d(e,n)&&(r(t[n])&&r(e[n])?(i[n]={},h(i[n],t[n]),h(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)d(t,n)&&!d(e,n)&&r(t[n])&&(i[n]=h({},i[n]));return i}function A(t){null!=t&&this.set(t)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,D=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)d(t,e)&&n.push(e);return n};var F={};function I(t,e){var n=t.toLowerCase();F[n]=F[n+"s"]=F[e]=t}function L(t){return"string"==typeof t?F[t]||F[t.toLowerCase()]:void 0}function R(t){var e,n,i={};for(n in t)d(t,n)&&(e=L(n))&&(i[e]=t[n]);return i}var N={};function W(t,e){N[t]=e}function Y(t,e,n){var i=""+Math.abs(t);return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,e-i.length)).toString().substr(1)+i}var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},H={};function B(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(H[t]=a),e&&(H[e[0]]=function(){return Y(a.apply(this,arguments),e[1],e[2])}),n&&(H[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function j(t,e){return t.isValid()?(e=U(e,t.localeData()),V[e]=V[e]||function(t){var e,n,i,a=t.match(z);for(e=0,n=a.length;e<n;e++)a[e]=H[a[e]]?H[a[e]]:(i=a[e]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(e){var i,r="";for(i=0;i<n;i++)r+=T(a[i])?a[i].call(e,t):a[i];return r}}(e),V[e](t)):t.localeData().invalidDate()}function U(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(E.lastIndex=0;n>=0&&E.test(t);)t=t.replace(E,i),E.lastIndex=0,n-=1;return t}var G=/\d/,q=/\d\d/,Z=/\d{3}/,$=/\d{4}/,X=/[+-]?\d{6}/,J=/\d\d?/,K=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,nt=/[+-]?\d{1,6}/,it=/\d+/,at=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,ot=/Z|[+-]\d\d(?::?\d\d)?/gi,st=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lt={};function ut(t,e,n){lt[t]=T(e)?e:function(t,i){return t&&n?n:e}}function dt(t,e){return d(lt,t)?lt[t](e._strict,e._locale):new RegExp(ht(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,a){return e||n||i||a}))))}function ht(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ct={};function ft(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=w(t)}),n=0;n<t.length;n++)ct[t[n]]=i}function gt(t,e){ft(t,(function(t,n,i,a){i._w=i._w||{},e(t,i._w,i,a)}))}function mt(t,e,n){null!=e&&d(ct,t)&&ct[t](e,n._a,n,t)}function pt(t){return vt(t)?366:365}function vt(t){return t%4==0&&t%100!=0||t%400==0}B("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),B(0,["YY",2],0,(function(){return this.year()%100})),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),I("year","y"),W("year",1),ut("Y",at),ut("YY",J,q),ut("YYYY",et,$),ut("YYYYY",nt,X),ut("YYYYYY",nt,X),ft(["YYYYY","YYYYYY"],0),ft("YYYY",(function(t,e){e[0]=2===t.length?i.parseTwoDigitYear(t):w(t)})),ft("YY",(function(t,e){e[0]=i.parseTwoDigitYear(t)})),ft("Y",(function(t,e){e[0]=parseInt(t,10)})),i.parseTwoDigitYear=function(t){return w(t)+(w(t)>68?1900:2e3)};var bt,yt=xt("FullYear",!0);function xt(t,e){return function(n){return null!=n?(wt(this,t,n),i.updateOffset(this,e),this):_t(this,t)}}function _t(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function wt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&vt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),kt(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function kt(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%12+12)%12}(e);return t+=(e-n)/12,1===n?vt(t)?29:28:31-n%7%2}bt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},B("M",["MM",2],"Mo",(function(){return this.month()+1})),B("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),B("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),I("month","M"),W("month",8),ut("M",J),ut("MM",J,q),ut("MMM",(function(t,e){return e.monthsShortRegex(t)})),ut("MMMM",(function(t,e){return e.monthsRegex(t)})),ft(["M","MM"],(function(t,e){e[1]=w(t)-1})),ft(["MMM","MMMM"],(function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[1]=a:f(n).invalidMonth=t}));var Mt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,St="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Dt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ct(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=c([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))||-1!==(a=bt.call(this._longMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))||-1!==(a=bt.call(this._shortMonthsParse,o))?a:null}function Pt(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=w(e);else if(!s(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),kt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function Tt(t){return null!=t?(Pt(this,t),i.updateOffset(this,!0),this):_t(this,"Month")}var Ot=st,At=st;function Ft(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=c([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=ht(i[e]),a[e]=ht(a[e]);for(e=0;e<24;e++)r[e]=ht(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function It(t,e,n,i,a,r,o){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function Lt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Rt(t,e,n){var i=7+e-n;return-(7+Lt(t,0,i).getUTCDay()-e)%7+i-1}function Nt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Rt(t,i,a);return s<=0?o=pt(r=t-1)+s:s>pt(t)?(r=t+1,o=s-pt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function Wt(t,e,n){var i,a,r=Rt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Yt(a=t.year()-1,e,n):o>Yt(t.year(),e,n)?(i=o-Yt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Yt(t,e,n){var i=Rt(t,e,n),a=Rt(t+1,e,n);return(pt(t)-i+a)/7}function zt(t,e){return t.slice(e,7).concat(t.slice(0,e))}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),W("week",5),W("isoWeek",5),ut("w",J),ut("ww",J,q),ut("W",J),ut("WW",J,q),gt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=w(t)})),B("d",0,"do","day"),B("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),B("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),B("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),W("day",11),W("weekday",11),W("isoWeekday",11),ut("d",J),ut("e",J),ut("E",J),ut("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ut("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ut("dddd",(function(t,e){return e.weekdaysRegex(t)})),gt(["dd","ddd","dddd"],(function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:f(n).invalidWeekday=t})),gt(["d","e","E"],(function(t,e,n,i){e[i]=w(t)}));var Et="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ht="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Bt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=c([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null}var jt=st,Ut=st,Gt=st;function qt(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=c([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ht(s[e]),l[e]=ht(l[e]),u[e]=ht(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Zt(){return this.hours()%12||12}function $t(t,e){B(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Xt(t,e){return e._meridiemParse}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,(function(){return this.hours()||24})),B("hmm",0,0,(function(){return""+Zt.apply(this)+Y(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+Zt.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+Y(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)})),$t("a",!0),$t("A",!1),I("hour","h"),W("hour",13),ut("a",Xt),ut("A",Xt),ut("H",J),ut("h",J),ut("k",J),ut("HH",J,q),ut("hh",J,q),ut("kk",J,q),ut("hmm",K),ut("hmmss",Q),ut("Hmm",K),ut("Hmmss",Q),ft(["H","HH"],3),ft(["k","kk"],(function(t,e,n){var i=w(t);e[3]=24===i?0:i})),ft(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),ft(["h","hh"],(function(t,e,n){e[3]=w(t),f(n).bigHour=!0})),ft("hmm",(function(t,e,n){var i=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i)),f(n).bigHour=!0})),ft("hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i,2)),e[5]=w(t.substr(a)),f(n).bigHour=!0})),ft("Hmm",(function(t,e,n){var i=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i))})),ft("Hmmss",(function(t,e,n){var i=t.length-4,a=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i,2)),e[5]=w(t.substr(a))}));var Jt,Kt=xt("Hours",!0),Qt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:St,monthsShort:Dt,week:{dow:0,doy:6},weekdays:Et,weekdaysMin:Ht,weekdaysShort:Vt,meridiemParse:/[ap]\.?m?\.?/i},te={},ee={};function ne(t){return t?t.toLowerCase().replace("_","-"):t}function ie(e){var n=null;if(!te[e]&&t&&t.exports)try{n=Jt._abbr,function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}(),ae(n)}catch(i){}return te[e]}function ae(t,e){var n;return t&&((n=o(e)?oe(t):re(t,e))?Jt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Jt._abbr}function re(t,e){if(null!==e){var n,i=Qt;if(e.abbr=t,null!=te[t])P("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=te[t]._config;else if(null!=e.parentLocale)if(null!=te[e.parentLocale])i=te[e.parentLocale]._config;else{if(null==(n=ie(e.parentLocale)))return ee[e.parentLocale]||(ee[e.parentLocale]=[]),ee[e.parentLocale].push({name:t,config:e}),null;i=n._config}return te[t]=new A(O(i,e)),ee[t]&&ee[t].forEach((function(t){re(t.name,t.config)})),ae(t),te[t]}return delete te[t],null}function oe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Jt;if(!a(t)){if(e=ie(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r<t.length;){for(e=(a=ne(t[r]).split("-")).length,n=(n=ne(t[r+1]))?n.split("-"):null;e>0;){if(i=ie(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&k(a,n,!0)>=e-1)break;e--}r++}return Jt}(t)}function se(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[1]<0||n[1]>11?1:n[2]<1||n[2]>kt(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,f(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),f(t)._overflowWeeks&&-1===e&&(e=7),f(t)._overflowWeekday&&-1===e&&(e=8),f(t).overflow=e),t}function le(t,e,n){return null!=t?t:null!=e?e:n}function ue(t){var e,n,a,r,o,s=[];if(!t._d){for(a=function(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=le(e.GG,t._a[0],Wt(ke(),1,4).year),i=le(e.W,1),((a=le(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=Wt(ke(),r,o);n=le(e.gg,t._a[0],u.year),i=le(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Yt(n,r,o)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(s=Nt(n,i,a,r,o),t._a[0]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=le(t._a[0],a[0]),(t._dayOfYear>pt(o)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=Lt(o,0,t._dayOfYear),t._a[1]=n.getUTCMonth(),t._a[2]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=a[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Lt:It).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}var de=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,he=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ce=/Z|[+-]\d\d(?::?\d\d)?/,fe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ge=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],me=/^\/?Date\((\-?\d+)/i;function pe(t){var e,n,i,a,r,o,s=t._i,l=de.exec(s)||he.exec(s);if(l){for(f(t).iso=!0,e=0,n=fe.length;e<n;e++)if(fe[e][1].exec(l[1])){a=fe[e][0],i=!1!==fe[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=ge.length;e<n;e++)if(ge[e][1].exec(l[3])){r=(l[2]||" ")+ge[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!ce.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),xe(t)}else t._isValid=!1}var ve=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;var be={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ye(t){var e,n,i,a,r,o,s,l,u=ve.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){var d=(e=u[3],n=u[2],i=u[5],a=u[6],r=u[7],o=[(s=u[4],l=parseInt(s,10),l<=49?2e3+l:l<=999?1900+l:l),Dt.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(a,10)],r&&o.push(parseInt(r,10)),o);if(!function(t,e,n){return!t||Vt.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],d,t))return;t._a=d,t._tzm=function(t,e,n){if(t)return be[t];if(e)return 0;var i=parseInt(n,10),a=i%100;return(i-a)/100*60+a}(u[8],u[9],u[10]),t._d=Lt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),f(t).rfc2822=!0}else t._isValid=!1}function xe(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],f(t).empty=!0;var e,n,a,r,o,s=""+t._i,l=s.length,u=0;for(a=U(t._f,t._locale).match(z)||[],e=0;e<a.length;e++)(n=(s.match(dt(r=a[e],t))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&f(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),H[r]?(n?f(t).empty=!1:f(t).unusedTokens.push(r),mt(r,n,t)):t._strict&&!n&&f(t).unusedTokens.push(r);f(t).charsLeftOver=l-u,s.length>0&&f(t).unusedInput.push(s),t._a[3]<=12&&!0===f(t).bigHour&&t._a[3]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[3]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),ue(t),se(t)}else ye(t);else pe(t)}function _e(t){var e=t._i,n=t._f;return t._locale=t._locale||oe(t._l),null===e||void 0===n&&""===e?m({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),x(e)?new y(se(e)):(l(e)?t._d=e:a(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],xe(e),g(e)&&(r+=f(e).charsLeftOver,r+=10*f(e).unusedTokens.length,f(e).score=r,(null==i||r<i)&&(i=r,n=e));h(t,n||e)}(t):n?xe(t):function(t){var e=t._i;o(e)?t._d=new Date(i.now()):l(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=me.exec(t._i);null===e?(pe(t),!1===t._isValid&&(delete t._isValid,ye(t),!1===t._isValid&&(delete t._isValid,i.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):a(e)?(t._a=u(e.slice(0),(function(t){return parseInt(t,10)})),ue(t)):r(e)?function(t){if(!t._d){var e=R(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),ue(t)}}(t):s(e)?t._d=new Date(e):i.createFromInputFallback(t)}(t),g(t)||(t._d=null),t))}function we(t,e,n,i,o){var s,l={};return!0!==n&&!1!==n||(i=n,n=void 0),(r(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||a(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=o,l._l=n,l._i=t,l._f=e,l._strict=i,(s=new y(se(_e(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function ke(t,e,n,i){return we(t,e,n,i,!1)}i.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),i.ISO_8601=function(){},i.RFC_2822=function(){};var Me=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:m()})),Se=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:m()}));function De(t,e){var n,i;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return ke();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}var Ce=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Pe(t){var e=R(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||e.isoWeek||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===bt.call(Ce,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<Ce.length;++i)if(t[Ce[i]]){if(n)return!1;parseFloat(t[Ce[i]])!==w(t[Ce[i]])&&(n=!0)}return!0}(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=oe(),this._bubble()}function Te(t){return t instanceof Pe}function Oe(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Ae(t,e){B(t,0,0,(function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+Y(~~(t/60),2)+e+Y(~~t%60,2)}))}Ae("Z",":"),Ae("ZZ",""),ut("Z",ot),ut("ZZ",ot),ft(["Z","ZZ"],(function(t,e,n){n._useUTC=!0,n._tzm=Ie(ot,t)}));var Fe=/([\+\-]|\d\d)/gi;function Ie(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Fe)||["-",0,0],a=60*i[1]+w(i[2]);return 0===a?0:"+"===i[0]?a:-a}function Le(t,e){var n,a;return e._isUTC?(n=e.clone(),a=(x(t)||l(t)?t.valueOf():ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),i.updateOffset(n,!1),n):ke(t).local()}function Re(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ne(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var We=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(t,e){var n,i,a,r,o,l,u=t,h=null;return Te(t)?u={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(u={},e?u[e]=t:u.milliseconds=t):(h=We.exec(t))?(n="-"===h[1]?-1:1,u={y:0,d:w(h[2])*n,h:w(h[3])*n,m:w(h[4])*n,s:w(h[5])*n,ms:w(Oe(1e3*h[6]))*n}):(h=Ye.exec(t))?u={y:Ee(h[2],n="-"===h[1]?-1:1),M:Ee(h[3],n),w:Ee(h[4],n),d:Ee(h[5],n),h:Ee(h[6],n),m:Ee(h[7],n),s:Ee(h[8],n)}:null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(r=ke(u.from),o=ke(u.to),a=r.isValid()&&o.isValid()?(o=Le(o,r),r.isBefore(o)?l=Ve(r,o):((l=Ve(o,r)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),i=new Pe(u),Te(t)&&d(t,"_locale")&&(i._locale=t._locale),i}function Ee(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ve(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function He(t,e){return function(n,i){var a;return null===i||isNaN(+i)||(P(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=i,i=a),Be(this,ze(n="string"==typeof n?+n:n,i),t),this}}function Be(t,e,n,a){var r=e._milliseconds,o=Oe(e._days),s=Oe(e._months);t.isValid()&&(a=null==a||a,s&&Pt(t,_t(t,"Month")+s*n),o&&wt(t,"Date",_t(t,"Date")+o*n),r&&t._d.setTime(t._d.valueOf()+r*n),a&&i.updateOffset(t,o||s))}ze.fn=Pe.prototype,ze.invalid=function(){return ze(NaN)};var je=He(1,"add"),Ue=He(-1,"subtract");function Ge(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,"months");return-(n+(e-i<0?(e-i)/(i-t.clone().add(n-1,"months")):(e-i)/(t.clone().add(n+1,"months")-i)))||0}function qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=oe(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ze=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function $e(){return this._locale}var Xe=1e3,Je=6e4,Ke=36e5,Qe=126227808e5;function tn(t,e){return(t%e+e)%e}function en(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-Qe:new Date(t,e,n).valueOf()}function nn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-Qe:Date.UTC(t,e,n)}function an(t,e){B(0,[t,t.length],0,e)}function rn(t,e,n,i,a){var r;return null==t?Wt(this,i,a).year:(e>(r=Yt(t,i,a))&&(e=r),on.call(this,t,e,n,i,a))}function on(t,e,n,i,a){var r=Nt(t,e,n,i,a),o=Lt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),W("weekYear",1),W("isoWeekYear",1),ut("G",at),ut("g",at),ut("GG",J,q),ut("gg",J,q),ut("GGGG",et,$),ut("gggg",et,$),ut("GGGGG",nt,X),ut("ggggg",nt,X),gt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=w(t)})),gt(["gg","GG"],(function(t,e,n,a){e[a]=i.parseTwoDigitYear(t)})),B("Q",0,"Qo","quarter"),I("quarter","Q"),W("quarter",7),ut("Q",G),ft("Q",(function(t,e){e[1]=3*(w(t)-1)})),B("D",["DD",2],"Do","date"),I("date","D"),W("date",9),ut("D",J),ut("DD",J,q),ut("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),ft(["D","DD"],2),ft("Do",(function(t,e){e[2]=w(t.match(J)[0])}));var sn=xt("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),W("dayOfYear",4),ut("DDD",tt),ut("DDDD",Z),ft(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=w(t)})),B("m",["mm",2],0,"minute"),I("minute","m"),W("minute",14),ut("m",J),ut("mm",J,q),ft(["m","mm"],4);var ln=xt("Minutes",!1);B("s",["ss",2],0,"second"),I("second","s"),W("second",15),ut("s",J),ut("ss",J,q),ft(["s","ss"],5);var un,dn=xt("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),I("millisecond","ms"),W("millisecond",16),ut("S",tt,G),ut("SS",tt,q),ut("SSS",tt,Z),un="SSSS";un.length<=9;un+="S")ut(un,it);function hn(t,e){e[6]=w(1e3*("0."+t))}for(un="S";un.length<=9;un+="S")ft(un,hn);var cn=xt("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var fn=y.prototype;function gn(t){return t}fn.add=je,fn.calendar=function(t,e){var n=t||ke(),a=Le(n,this).startOf("day"),r=i.calendarFormat(this,a)||"sameElse",o=e&&(T(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,ke(n)))},fn.clone=function(){return new y(this)},fn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Le(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=L(e)){case"year":r=Ge(this,i)/12;break;case"month":r=Ge(this,i);break;case"quarter":r=Ge(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:_(r)},fn.endOf=function(t){var e;if(void 0===(t=L(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?nn:en;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Ke-tn(e+(this._isUTC?0:this.utcOffset()*Je),Ke)-1;break;case"minute":e=this._d.valueOf(),e+=Je-tn(e,Je)-1;break;case"second":e=this._d.valueOf(),e+=Xe-tn(e,Xe)-1}return this._d.setTime(e),i.updateOffset(this,!0),this},fn.format=function(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=j(this,t);return this.localeData().postformat(e)},fn.from=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||ke(t).isValid())?ze({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.fromNow=function(t){return this.from(ke(),t)},fn.to=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||ke(t).isValid())?ze({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.toNow=function(t){return this.to(ke(),t)},fn.get=function(t){return T(this[t=L(t)])?this[t]():this},fn.invalidAt=function(){return f(this).overflow},fn.isAfter=function(t,e){var n=x(t)?t:ke(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},fn.isBefore=function(t,e){var n=x(t)?t:ke(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},fn.isBetween=function(t,e,n,i){var a=x(t)?t:ke(t),r=x(e)?e:ke(e);return!!(this.isValid()&&a.isValid()&&r.isValid())&&("("===(i=i||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===i[1]?this.isBefore(r,n):!this.isAfter(r,n))},fn.isSame=function(t,e){var n,i=x(t)?t:ke(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},fn.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},fn.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},fn.isValid=function(){return g(this)},fn.lang=Ze,fn.locale=qe,fn.localeData=$e,fn.max=Se,fn.min=Me,fn.parsingFlags=function(){return h({},f(this))},fn.set=function(t,e){if("object"==typeof t)for(var n=function(t){var e=[];for(var n in t)e.push({unit:n,priority:N[n]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=R(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(T(this[t=L(t)]))return this[t](e);return this},fn.startOf=function(t){var e;if(void 0===(t=L(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?nn:en;switch(t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=tn(e+(this._isUTC?0:this.utcOffset()*Je),Ke);break;case"minute":e=this._d.valueOf(),e-=tn(e,Je);break;case"second":e=this._d.valueOf(),e-=tn(e,Xe)}return this._d.setTime(e),i.updateOffset(this,!0),this},fn.subtract=Ue,fn.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},fn.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},fn.toDate=function(){return new Date(this.valueOf())},fn.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?j(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",j(n,"Z")):j(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},fn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY";return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+e+'[")]')},fn.toJSON=function(){return this.isValid()?this.toISOString():null},fn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},fn.unix=function(){return Math.floor(this.valueOf()/1e3)},fn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},fn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},fn.year=yt,fn.isLeapYear=function(){return vt(this.year())},fn.weekYear=function(t){return rn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},fn.isoWeekYear=function(t){return rn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},fn.quarter=fn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},fn.month=Tt,fn.daysInMonth=function(){return kt(this.year(),this.month())},fn.week=fn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},fn.isoWeek=fn.isoWeeks=function(t){var e=Wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},fn.weeksInYear=function(){var t=this.localeData()._week;return Yt(this.year(),t.dow,t.doy)},fn.isoWeeksInYear=function(){return Yt(this.year(),1,4)},fn.date=sn,fn.day=fn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},fn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},fn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},fn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},fn.hour=fn.hours=Kt,fn.minute=fn.minutes=ln,fn.second=fn.seconds=dn,fn.millisecond=fn.milliseconds=cn,fn.utcOffset=function(t,e,n){var a,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ie(ot,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(a=Re(this)),this._offset=t,this._isUTC=!0,null!=a&&this.add(a,"m"),r!==t&&(!e||this._changeInProgress?Be(this,ze(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Re(this)},fn.utc=function(t){return this.utcOffset(0,t)},fn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Re(this),"m")),this},fn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ie(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},fn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?ke(t).utcOffset():0,(this.utcOffset()-t)%60==0)},fn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},fn.isLocal=function(){return!!this.isValid()&&!this._isUTC},fn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},fn.isUtc=Ne,fn.isUTC=Ne,fn.zoneAbbr=function(){return this._isUTC?"UTC":""},fn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},fn.dates=S("dates accessor is deprecated. Use date instead.",sn),fn.months=S("months accessor is deprecated. Use month instead",Tt),fn.years=S("years accessor is deprecated. Use year instead",yt),fn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),fn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=_e(t))._a){var e=t._isUTC?c(t._a):ke(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var mn=A.prototype;function pn(t,e,n,i){var a=oe(),r=c().set(i,e);return a[n](r,t)}function vn(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return pn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=pn(t,i,n,"month");return a}function bn(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var a,r=oe(),o=t?r._week.dow:0;if(null!=n)return pn(e,(n+o)%7,i,"day");var l=[];for(a=0;a<7;a++)l[a]=pn(e,(a+o)%7,i,"day");return l}mn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return T(i)?i.call(e,n):i},mn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},mn.invalidDate=function(){return this._invalidDate},mn.ordinal=function(t){return this._ordinal.replace("%d",t)},mn.preparse=gn,mn.postformat=gn,mn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return T(a)?a(t,e,n,i):a.replace(/%d/i,t)},mn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return T(n)?n(e):n.replace(/%s/i,e)},mn.set=function(t){var e,n;for(n in t)T(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},mn.months=function(t,e){return t?a(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Mt).test(e)?"format":"standalone"][t.month()]:a(this._months)?this._months:this._months.standalone},mn.monthsShort=function(t,e){return t?a(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Mt.test(e)?"format":"standalone"][t.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},mn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Ct.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=c([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},mn.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=At),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},mn.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Ot),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},mn.week=function(t){return Wt(t,this._week.dow,this._week.doy).week},mn.firstDayOfYear=function(){return this._week.doy},mn.firstDayOfWeek=function(){return this._week.dow},mn.weekdays=function(t,e){var n=a(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?zt(n,this._week.dow):t?n[t.day()]:n},mn.weekdaysMin=function(t){return!0===t?zt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},mn.weekdaysShort=function(t){return!0===t?zt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},mn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Bt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=c([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},mn.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=jt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},mn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ut),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},mn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},mn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},mn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ae("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=S("moment.lang is deprecated. Use moment.locale instead.",ae),i.langData=S("moment.langData is deprecated. Use moment.localeData instead.",oe);var yn=Math.abs;function xn(t,e,n,i){var a=ze(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function _n(t){return t<0?Math.floor(t):Math.ceil(t)}function wn(t){return 4800*t/146097}function kn(t){return 146097*t/4800}function Mn(t){return function(){return this.as(t)}}var Sn=Mn("ms"),Dn=Mn("s"),Cn=Mn("m"),Pn=Mn("h"),Tn=Mn("d"),On=Mn("w"),An=Mn("M"),Fn=Mn("Q"),In=Mn("y");function Ln(t){return function(){return this.isValid()?this._data[t]:NaN}}var Rn=Ln("milliseconds"),Nn=Ln("seconds"),Wn=Ln("minutes"),Yn=Ln("hours"),zn=Ln("days"),En=Ln("months"),Vn=Ln("years"),Hn=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,M:11};function jn(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var Un=Math.abs;function Gn(t){return(t>0)-(t<0)||+t}function qn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=Un(this._milliseconds)/1e3,i=Un(this._days),a=Un(this._months);t=_(n/60),e=_(t/60),n%=60,t%=60;var r=_(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Gn(this._months)!==Gn(h)?"-":"",g=Gn(this._days)!==Gn(h)?"-":"",m=Gn(this._milliseconds)!==Gn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var Zn=Pe.prototype;return Zn.isValid=function(){return this._isValid},Zn.abs=function(){var t=this._data;return this._milliseconds=yn(this._milliseconds),this._days=yn(this._days),this._months=yn(this._months),t.milliseconds=yn(t.milliseconds),t.seconds=yn(t.seconds),t.minutes=yn(t.minutes),t.hours=yn(t.hours),t.months=yn(t.months),t.years=yn(t.years),this},Zn.add=function(t,e){return xn(this,t,e,1)},Zn.subtract=function(t,e){return xn(this,t,e,-1)},Zn.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=L(t))||"quarter"===t||"year"===t)switch(n=this._months+wn(e=this._days+i/864e5),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(kn(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},Zn.asMilliseconds=Sn,Zn.asSeconds=Dn,Zn.asMinutes=Cn,Zn.asHours=Pn,Zn.asDays=Tn,Zn.asWeeks=On,Zn.asMonths=An,Zn.asQuarters=Fn,Zn.asYears=In,Zn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN},Zn._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*_n(kn(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=_(r/1e3),l.seconds=t%60,e=_(t/60),l.minutes=e%60,n=_(e/60),l.hours=n%24,o+=_(n/24),s+=a=_(wn(o)),o-=_n(kn(a)),i=_(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},Zn.clone=function(){return ze(this)},Zn.get=function(t){return t=L(t),this.isValid()?this[t+"s"]():NaN},Zn.milliseconds=Rn,Zn.seconds=Nn,Zn.minutes=Wn,Zn.hours=Yn,Zn.days=zn,Zn.weeks=function(){return _(this.days()/7)},Zn.months=En,Zn.years=Vn,Zn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=ze(t).abs(),a=Hn(i.as("s")),r=Hn(i.as("m")),o=Hn(i.as("h")),s=Hn(i.as("d")),l=Hn(i.as("M")),u=Hn(i.as("y")),d=a<=Bn.ss&&["s",a]||a<Bn.s&&["ss",a]||r<=1&&["m"]||r<Bn.m&&["mm",r]||o<=1&&["h"]||o<Bn.h&&["hh",o]||s<=1&&["d"]||s<Bn.d&&["dd",s]||l<=1&&["M"]||l<Bn.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=e,d[3]=+t>0,d[4]=n,jn.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},Zn.toISOString=qn,Zn.toString=qn,Zn.toJSON=qn,Zn.locale=qe,Zn.localeData=$e,Zn.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qn),Zn.lang=Ze,B("X",0,0,"unix"),B("x",0,0,"valueOf"),ut("x",at),ut("X",/[+-]?\d+(\.\d{1,3})?/),ft("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),ft("x",(function(t,e,n){n._d=new Date(w(t))})),i.version="2.24.0",e=ke,i.fn=fn,i.min=function(){return De("isBefore",[].slice.call(arguments,0))},i.max=function(){return De("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=c,i.unix=function(t){return ke(1e3*t)},i.months=function(t,e){return vn(t,e,"months")},i.isDate=l,i.locale=ae,i.invalid=m,i.duration=ze,i.isMoment=x,i.weekdays=function(t,e,n){return bn(t,e,n,"weekdays")},i.parseZone=function(){return ke.apply(null,arguments).parseZone()},i.localeData=oe,i.isDuration=Te,i.monthsShort=function(t,e){return vn(t,e,"monthsShort")},i.weekdaysMin=function(t,e,n){return bn(t,e,n,"weekdaysMin")},i.defineLocale=re,i.updateLocale=function(t,e){if(null!=e){var n,i,a=Qt;null!=(i=ie(t))&&(a=i._config),(n=new A(e=O(a,e))).parentLocale=te[t],te[t]=n,ae(t)}else null!=te[t]&&(null!=te[t].parentLocale?te[t]=te[t].parentLocale:null!=te[t]&&delete te[t]);return te[t]},i.locales=function(){return D(te)},i.weekdaysShort=function(t,e,n){return bn(t,e,n,"weekdaysShort")},i.normalizeUnits=L,i.relativeTimeRounding=function(t){return void 0===t?Hn:"function"==typeof t&&(Hn=t,!0)},i.relativeTimeThreshold=function(t,e){return void 0!==Bn[t]&&(void 0===e?Bn[t]:(Bn[t]=e,"s"===t&&(Bn.ss=e-1),!0))},i.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=fn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()})),Zn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};je._date.override("function"==typeof qn?{_id:"moment",formats:function(){return Zn},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=qn(t,e):t instanceof qn||(t=qn(t)),t.isValid()?t.valueOf():null},format:function(t,e){return qn(t).format(e)},add:function(t,e,n){return qn(t).add(e,n).valueOf()},diff:function(t,e,n){return qn(t).diff(qn(e),n)},startOf:function(t,e,n){return t=qn(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return qn(t).endOf(e).valueOf()},_create:function(t){return qn(t)}}:{}),N._set("global",{plugins:{filler:{propagate:!0}}});var $n={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return V.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function Xn(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function Jn(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e=s.ticks.reverse?o.max:o.min),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),d.push(r);return d}(t):function(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(V.isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}(t)}function Kn(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function Qn(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),$n[n](t))}function ti(t){return t&&!t.skip}function ei(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)V.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)V.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function ni(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o<s;++o)d=n(u=e[l=o%g]._view,l,i),h=ti(u),c=ti(d),r&&void 0===f&&h&&(s=g+(f=o+1)),h&&c?(b=p.push(u),y=v.push(d)):b&&y&&(m?(h&&p.push(u),c&&v.push(d)):(ei(t,p,v,b,y),b=y=0,p=[],v=[]));ei(t,p,v,b,y),t.closePath(),t.fillStyle=a,t.fill()}var ii={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof vt.Line&&(r={visible:t.isDatasetVisible(i),fill:Xn(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)(r=l[i])&&(r.fill=Kn(l,i,s),r.boundary=Jn(r),r.mapper=Qn(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)(e=l[n].$filler)&&e.visible&&(r=(i=e.el)._children||[],s=(a=i._view).backgroundColor||N.global.defaultColor,(o=e.mapper)&&s&&r.length&&(V.canvas.clipArea(u,t.chartArea),ni(u,r,o,a,s,i._loop),V.canvas.unclipArea(u)))}},ai=V.rtl.getRtlAdapter,ri=V.noop,oi=V.valueOrDefault;function si(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}N._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;e<n;e++)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[e].backgroundColor,r[e].label&&i.appendChild(document.createTextNode(r[e].label));return a.outerHTML}});var li=G.extend({initialize:function(t){var e=this;V.extend(e,t),e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1},beforeUpdate:ri,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ri,beforeSetDimensions:ri,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ri,beforeBuildLabels:ri,buildLabels:function(){var t=this,e=t.options.labels||{},n=V.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:ri,beforeFit:ri,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=V.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var d=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="middle",V.each(t.legendItems,(function(t,e){var i=si(n,o)+o/2+a.measureText(t.text).width;(0===e||d[d.length-1]+i+2*n.padding>l.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;V.each(t.legendItems,(function(t,e){var i=si(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:ri,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=N.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=ai(e.rtl,t.left,t.minSize.width),c=t.ctx,f=oi(n.fontColor,i.defaultFontColor),g=V.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=si(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},V.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;V.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=oi(i.lineWidth,r.borderWidth);if(c.fillStyle=oi(i.fillStyle,a),c.lineCap=oi(i.lineCap,r.borderCapStyle),c.lineDashOffset=oi(i.lineDashOffset,r.borderDashOffset),c.lineJoin=oi(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=oi(i.strokeStyle,a),c.setLineDash&&c.setLineDash(oi(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2);V.canvas.drawPoint(c,i.pointStyle,s,l,e+m/2,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x})),V.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(t>=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function ui(t,e){var n=new li({ctx:t.ctx,options:e,chart:t});le.configure(t,n,e),le.addBox(t,n),t.legend=n}var di={id:"legend",_element:li,beforeInit:function(t){var e=t.options.legend;e&&ui(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(V.mergeIf(e,N.global.legend),n?(le.configure(t,n,e),n.options=e):ui(t,e)):n&&(le.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},hi=V.noop;N._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var ci=G.extend({initialize:function(t){V.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:hi,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:hi,beforeSetDimensions:hi,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:hi,beforeBuildLabels:hi,buildLabels:hi,afterBuildLabels:hi,beforeFit:hi,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(V.isArray(n.text)?n.text.length:1)*V.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:hi,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=V.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=V.valueOrDefault(n.fontColor,N.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(V.isArray(g))for(var m=0,p=0;p<g.length;++p)e.fillText(g[p],0,m,i),m+=s;else e.fillText(g,0,0,i);e.restore()}}});function fi(t,e){var n=new ci({ctx:t.ctx,options:e,chart:t});le.configure(t,n,e),le.addBox(t,n),t.titleBlock=n}var gi={},mi=ii,pi=di,vi={id:"title",_element:ci,beforeInit:function(t){var e=t.options.title;e&&fi(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(V.mergeIf(e,N.global.title),n?(le.configure(t,n,e),n.options=e):fi(t,e)):n&&(le.removeBox(t,n),delete t.titleBlock)}};for(var bi in gi.filler=mi,gi.legend=pi,gi.title=vi,Ve.helpers=V,function(){function t(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return null!=t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=V._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),d=e(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?t(s,n,a):h,d?t(l,o,a):h):"none"}V.where=function(t,e){if(V.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return V.each(t,(function(t){e(t)&&n.push(t)})),n},V.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},V.findNextWhere=function(t,e,n){V.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},V.findPreviousWhere=function(t,e,n){V.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},V.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},V.almostEquals=function(t,e,n){return Math.abs(t-e)<n},V.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},V.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},V.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},V.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},V.toRadians=function(t){return t*(Math.PI/180)},V.toDegrees=function(t){return t*(180/Math.PI)},V._decimalPlaces=function(t){if(V.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},V.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},V.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},V.aliasPixel=function(t){return t%2==0?0:.5},V._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},V.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},V.EPSILON=Number.EPSILON||1e-14,V.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=e>0?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}i.mK=!n||n.model.skip?i.deltaK:!a||a.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?0:(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)a=d[e+1],(i=d[e]).model.skip||a.model.skip||(V.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(a=e<h-1?d[e+1]:null,(n=e>0?d[e-1]:null)&&!n.model.skip&&(i.model.controlPointPreviousX=i.model.x-(u=(i.model.x-n.model.x)/3),i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(i.model.controlPointNextX=i.model.x+(u=(a.model.x-i.model.x)/3),i.model.controlPointNextY=i.model.y+u*i.mK))},V.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},V.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},V.niceNum=function(t,e){var n=Math.floor(V.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},V.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},V.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(V.getStyle(r,"padding-left")),u=parseFloat(V.getStyle(r,"padding-top")),d=parseFloat(V.getStyle(r,"padding-right")),h=parseFloat(V.getStyle(r,"padding-bottom")),c=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/(o.right-o.left-l-d)*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/c*r.height/e.currentDevicePixelRatio)}},V.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},V.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},V._calculatePadding=function(t,e,n){return(e=V.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},V._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},V.getMaximumWidth=function(t){var e=V._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-V._calculatePadding(e,"padding-left",n)-V._calculatePadding(e,"padding-right",n),a=V.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},V.getMaximumHeight=function(t){var e=V._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-V._calculatePadding(e,"padding-top",n)-V._calculatePadding(e,"padding-bottom",n),a=V.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},V.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},V.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},V.fontString=function(t,e,n){return e+" "+t+"px "+n},V.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;o<c;o++)if(null!=(u=n[o])&&!0!==V.isArray(u))h=V.measureText(t,a,r,h,u);else if(V.isArray(u))for(s=0,l=u.length;s<l;s++)null==(d=u[s])||V.isArray(d)||(h=V.measureText(t,a,r,h,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return h},V.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},V.numberOfLabelLines=function(t){var e=1;return V.each(t,(function(t){V.isArray(t)&&t.length>e&&(e=t.length)})),e},V.color=x?function(t){return t instanceof CanvasGradient&&(t=N.global.defaultColor),x(t)}:function(t){return console.error("Color.js not found!"),t},V.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:V.color(t).saturate(.5).darken(.1).rgbString()}}(),Ve._adapters=je,Ve.Animation=Z,Ve.animationService=$,Ve.controllers=Ut,Ve.DatasetController=tt,Ve.defaults=N,Ve.Element=G,Ve.elements=vt,Ve.Interaction=Kt,Ve.layouts=le,Ve.platform=_e,Ve.plugins=we,Ve.Scale=rn,Ve.scaleService=ke,Ve.Ticks=Ue,Ve.Tooltip=Fe,Ve.helpers.each(Gn,(function(t,e){Ve.scaleService.registerScaleType(e,t,t._defaults)})),gi)gi.hasOwnProperty(bi)&&Ve.plugins.register(gi[bi]);Ve.platform.initialize();var yi=Ve;return"undefined"!=typeof window&&(window.Chart=Ve),Ve.Chart=Ve,Ve.Legend=gi.legend._element,Ve.Title=gi.title._element,Ve.pluginService=Ve.plugins,Ve.PluginBase=Ve.Element.extend({}),Ve.canvasHelpers=Ve.helpers.canvas,Ve.layoutService=Ve.layouts,Ve.LinearScaleBase=un,Ve.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){Ve[t]=function(e,n){return new Ve(e,Ve.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),yi}));
\ No newline at end of file
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Chart=e()}(this,function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=t(function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(n,i))*100,100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=(r=t,o=e[l],Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));u<s&&(s=u,a=l)}return a},a.keyword.rgb=function(t){return e[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,a[u]=255*(r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e);return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),(i+n)/2*100]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-i)+i)),255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i;e=t[1]/500+(n=(t[0]+16)/116),i=n-t[2]/200;var a=Math.pow(n,3),r=Math.pow(e,3),o=Math.pow(i,3);return n=a>.008856?a:(n-16/116)/7.787,e=r>.008856?r:(e-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[1];return e=t[2]/360*2*Math.PI,[t[0],n*Math.cos(e),n*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map(function(t){return t+t}).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e,n=t[1]/100,i=t[2]/100,a=0;return(e=i<.5?2*n*i:2*n*(1-i))<1&&(a=(i-.5*e)/(1-e)),[t[0],100*e,100*a]},a.hsv.hcg=function(t){var e=t[2]/100,n=t[1]/100*e,i=0;return n<1&&(i=(e-n)/(1-n)),[t[0],100*n,100*i]},a.hcg.rgb=function(t){var e=t[1]/100,n=t[2]/100;if(0===e)return[255*n,255*n,255*n];var i,a=[0,0,0],r=t[0]/360%1*6,o=r%1,s=1-o;switch(Math.floor(r)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return[255*(e*a[0]+(i=(1-e)*n)),255*(e*a[1]+i),255*(e*a[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=1-t[2]/100,n=e-t[1]/100,i=0;return n<1&&(i=(e-n)/(1-n)),[t[0],100*n,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});function i(t,e){return function(n){return e(t(n))}}function a(t,e){for(var a=[e[t].parent,t],r=n[e[t].parent][t],o=e[t].parent;e[o].parent;)a.unshift(e[o].parent),r=i(n[e[o].parent][o],r),o=e[o].parent;return r.conversion=a,r}var r={};Object.keys(n).forEach(function(t){r[t]={},Object.defineProperty(r[t],"channels",{value:n[t].channels}),Object.defineProperty(r[t],"labels",{value:n[t].labels});var e=function(t){for(var e=function(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a<i;a++)t[e[a]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var a=i.pop(),r=Object.keys(n[a]),o=r.length,s=0;s<o;s++){var l=r[s],u=e[l];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,i.unshift(l))}return e}(t),i={},r=Object.keys(e),o=r.length,s=0;s<o;s++){var l=r[s];null!==e[l].parent&&(i[l]=a(l,e))}return i}(t);Object.keys(e).forEach(function(n){var i=e[n];r[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),r[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)})});var o=r,s={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:u,getHsla:d,getRgb:function(t){var e=u(t);return e&&e.slice(0,3)},getHsl:function(t){var e=d(t);return e&&e.slice(0,3)},getHwb:h,getAlpha:function(t){var e=u(t);return e||(e=d(t))||(e=h(t))?e[3]:void 0},hexString:function(t,e){return e=void 0!==e&&3===t.length?e:t[3],"#"+p(t[0])+p(t[1])+p(t[2])+(e>=0&&e<1?p(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?c(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:c,percentString:function(t,e){return e<1||t[3]&&t[3]<1?f(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:f,hslString:function(t,e){return e<1||t[3]&&t[3]<1?g(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:g,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return v[t.slice(0,3)]}};function u(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;r<e.length;r++)e[r]=parseInt(i[r]+i[r],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(i=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=i[2],i=i[1],r=0;r<e.length;r++)e[r]=parseInt(i.slice(2*r,2*r+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=parseInt(i[r+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=Math.round(2.55*parseFloat(i[r+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=s[i[1]]))return}for(r=0;r<e.length;r++)e[r]=m(e[r],0,255);return n=n||0==n?m(n,0,1):1,e[3]=n,e}}function d(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function h(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function c(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function f(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function m(t,e,n){return Math.min(Math.max(e,t),n)}function p(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var v={};for(var b in s)v[s[b]]=b;var y=function(t){return t instanceof y?t:this instanceof y?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=l.getRgba(t))?this.setValues("rgb",e):(e=l.getHsla(t))?this.setValues("hsl",e):(e=l.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new y(t);var e};y.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&("[object Array]"===(e={}.toString.call(t=i[r]))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},y.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[r[t][0]]){var u=r[t];for(n=0;n<t.length;n++)a[t][n]=e[u[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(s[t][n],a[t][n])),a[t][n]=Math.round(i);for(var d in r)d!==t&&(a[d]=o[t][d](a[t]));return!0},y.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},y.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:(n===i[e]||(i[e]=n,this.setValues(t,i)),this)},"undefined"!=typeof window&&(window.Color=y);var x=y;function _(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var w,k={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return k.valueOrDefault(k.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(k.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(k.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=e[n],(a=t[n])instanceof Array&&r instanceof Array){if(!k.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(k.isArray(t))return t.map(k.clone);if(k.isObject(t)){for(var e=Object.create(t),n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=k.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){if(_(t)){var a=e[t],r=n[t];k.isObject(a)&&k.isObject(r)?k.merge(a,r,i):e[t]=k.clone(r)}},_mergerIf:function(t,e,n){if(_(t)){var i=e[t],a=n[t];k.isObject(i)&&k.isObject(a)?k.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=k.clone(a))}},merge:function(t,e,n){var i,a,r,o,s,l=k.isArray(e)?e:[e],u=l.length;if(!k.isObject(t))return t;for(i=(n=n||{}).merger||k._merger,a=0;a<u;++a)if(k.isObject(e=l[a]))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return k.merge(t,e,{merger:k._mergerIf})},extend:Object.assign||function(t){return k.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=k.inherits,t&&k.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},M=k;k.callCallback=k.callback,k.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var S={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-S.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*S.easeInBounce(2*t):.5*S.easeOutBounce(2*t-1)+.5}},D={effects:S};M.easingEffects=S;var C=Math.PI,P=C/180,T=2*C,O=C/2,A=C/4,F=2*C/3,I={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),s<u&&l<d?(t.arc(s,l,o,-C,-O),t.arc(u,l,o,-O,0),t.arc(u,d,o,0,O),t.arc(s,d,o,O,C)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-O,O),t.arc(s,l,o,O,C+O)):l<d?(t.arc(s,l,o,-C,0),t.arc(s,d,o,0,C)):t.arc(s,l,o,-C,C),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h=(r||0)*P;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(h),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=F,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=F,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),t.closePath();break;case"rectRounded":u=n-(d=.516*n),s=Math.cos(h+A)*u,l=Math.sin(h+A)*u,t.arc(i-s,a-l,d,h-C,h-O),t.arc(i+l,a-s,d,h-O,h),t.arc(i+s,a+l,d,h,h+O),t.arc(i-l,a+s,d,h+O,h+C),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}h+=A;case"rectRot":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":h+=A;case"cross":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),h+=A,s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(h)*n,a+Math.sin(h)*n)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){var n=1e-6;return t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},L=I;M.clear=I.clear,M.drawRoundedRectangle=function(t){t.beginPath(),I.roundedRect.apply(I,arguments)};var R={_set:function(t,e){return M.merge(this[t]||(this[t]={}),e)}};R._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var N=R,W=M.valueOrDefault,Y={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return M.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=N.global,n=W(t.fontSize,e.defaultFontSize),i={family:W(t.fontFamily,e.defaultFontFamily),lineHeight:M.options.toLineHeight(W(t.lineHeight,e.defaultLineHeight),n),size:n,style:W(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=function(t){return!t||M.isNullOrUndef(t.size)||M.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&M.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},z={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e==0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort(function(t,e){return t-e}).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e}},E=z;M.log10=z.log10;var V=M,H=L,B=Y,j=E;V.easing=D,V.canvas=H,V.options=B,V.math=j,V.rtl={getRtlAdapter:function(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(i=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};var U=function(t){V.extend(this,t),this.initialize.apply(this,arguments)};V.extend(U.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=V.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)==typeof(l=t[o]))if("string"===d){if((h=x(l)).valid&&(c=x(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if(V.isFinite(l)&&V.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t),e):(e._view=V.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return V.isNumber(this._model.x)&&V.isNumber(this._model.y)}}),U.extend=V.inherits;var G=U,q=G.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),Z=q;Object.defineProperty(q.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(q.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),N._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:V.noop,onComplete:V.noop}});var $={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=V.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=V.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)e=(t=a[r]).chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),V.callback(t.render,[e,t],e),V.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(V.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},X=V.options.resolve,J=["push","pop","shift","splice","unshift"];function K(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(J.forEach(function(e){delete t[e]}),delete t._chartjs)}}var Q=function(t,e){this.initialize(t,e)};V.extend(Q.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,i=n.scales,a=t.getDataset(),r=n.options.scales;null!==e.xAxisID&&e.xAxisID in i&&!a.xAxisID||(e.xAxisID=a.xAxisID||r.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in i&&!a.yAxisID||(e.yAxisID=a.yAxisID||r.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&K(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,e,n=this,i=n.getDataset(),a=i.data||(i.data=[]);n._data!==a&&(n._data&&K(n._data,n),a&&Object.isExtensible(a)&&(e=n,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),J.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return V.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),a}})}))),n._data=a),n.resyncElements()},_configure:function(){var t=this;t._config=V.merge(Object.create(null),[t.chart.options.datasets[t._type],t.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&V._merger(t,e,n)}})},_update:function(t){var e=this;e._configure(),e._cachedDataOpts=null,e.update(t)},update:V.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this,i=n.getMeta(),a=i.dataset;return n._configure(),!1!==(e=a&&void 0===t?n._resolveDatasetElementOptions(a||{}):n._resolveDataElementOptions(i.data[t=t||0]||{},t)).fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},d=s.options.elements[o.datasetElementType.prototype._type]||{},h=o._datasetElementOptions,c={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=h.length;n<i;++n)a=h[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,c[a]=X([u[r],l[r],d[r]],f);return c},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,d=n._config,h=u.options.elements[n.dataElementType.prototype._type]||{},c=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},m={cacheable:!i};if(i=i||{},V.isArray(c))for(o=0,s=c.length;o<s;++o)f[l=c[o]]=X([i[l],d[l],h[l]],g,e,m);else for(o=0,s=(r=Object.keys(c)).length;o<s;++o)f[l=r[o]]=X([i[l],d[c[l]],d[l],h[l]],g,e,m);return m.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){V.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=V.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=X([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=X([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=X([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),t=0,e=(i=Object.keys(a)).length;t<e;++t)s[n=i[t]]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),Q.extend=V.inherits;var tt=Q,et=2*Math.PI;function nt(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?t.arc(o,s,e.innerRadius-a,i+(r=a/e.innerRadius),n-r,!0):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}N._set("global",{elements:{arc:{backgroundColor:N.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var it=G.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=V.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=et;for(;a>s;)a-=et;for(;a<o;)a+=et;return a>=o&&a<=s&&r>=n.innerRadius&&r<=n.outerRadius}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/et)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+et,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%et}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&function(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+et,nt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=et,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+et,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+et),a=0;a<n.fullCircles;++a)t.stroke()}(t,e,n,i),i&&nt(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}(e,n,a),e.restore()}}),at=V.valueOrDefault,rt=N.global.defaultColor;N._set("global",{elements:{line:{tension:.4,backgroundColor:rt,borderWidth:3,borderColor:rt,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var ot=G.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=N.global,u=l.elements.line,d=-1,h=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=V.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),h=o;break}h&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=at(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=at(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),(n=s[0]._view).skip||(r.moveTo(n.x,n.y),d=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===d?V.previousItem(s,t):s[d],n.skip||(d!==t-1&&!o||-1===d?r.moveTo(n.x,n.y):V.canvas.lineTo(r,e._view,n),d=t);h&&r.closePath(),r.stroke(),r.restore()}}}),st=V.valueOrDefault,lt=N.global.defaultColor;function ut(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}N._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:lt,borderColor:lt,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var dt=G.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ut,inXRange:ut,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=N.global,u=l.defaultColor;e.skip||(void 0===t||V.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=st(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,V.canvas.drawPoint(n,i,r,o,s,a))}}),ht=N.global.defaultColor;function ct(t){return t&&void 0!==t.width}function ft(t){var e,n,i,a,r;return ct(t)?(e=t.x-(r=t.width/2),n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function gt(t,e,n){return t===e?n:t===n?e:t}function mt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&ft(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}N._set("global",{elements:{rectangle:{backgroundColor:ht,borderColor:ht,borderSkipped:"bottom",borderWidth:0}}});var pt=G.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=ft(t),n=e.right-e.left,i=e.bottom-e.top,a=function(t,e,n){var i,a,r,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=gt(e,"left","right")):t.base<t.y&&(e=gt(e,"bottom","top")),n[e]=!0,n):n}(t);return V.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return mt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return ct(n)?mt(n,t,null):mt(n,null,e)},inXRange:function(t){return mt(this._view,t,null)},inYRange:function(t){return mt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return ct(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return ct(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),vt={},bt=ot,yt=dt,xt=pt;vt.Arc=it,vt.Line=bt,vt.Point=yt,vt.Rectangle=xt;var _t=V._deprecated,wt=V.valueOrDefault;N._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),N._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var kt=tt.extend({dataElementType:vt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;tt.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,_t("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),_t("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),_t("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),_t("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),_t("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},V.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),d=a.calculateBarValuePixels(a.index,e,i),h=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:d.base,r.x=l?n?s:d.head:h.center,r.y=l?h.center:n?s:d.head,r.height=l?h.size:void 0,r.width=l?void 0:h.size},_getStacks:function(t){var e,n,i=this._getIndexScale(),a=i._getMatchingVisibleMetas(this._type),r=i.options.stacked,o=a.length,s=[];for(e=0;e<o&&(n=a[e],(!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this,i=n._getIndexScale(),a=[];for(t=0,e=n.getMeta().data.length;t<e;++t)a.push(i.getPixelForValue(null,t,n.index));return{pixels:a,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,d=this,h=d.chart,c=d._getValueScale(),f=c.isHorizontal(),g=h.data.datasets,m=c._getMatchingVisibleMetas(d._type),p=c._parseValue(g[t].data[e]),v=n.minBarLength,b=c.options.stacked,y=d.getMeta().stack,x=void 0===p.start?0:p.max>=0&&p.min>=0?p.min:p.max,_=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,w=m.length;if(b||void 0===b&&void 0!==y)for(i=0;i<w&&(a=m[i]).index!==t;++i)a.stack===y&&(r=void 0===(u=c._parseValue(g[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=c.getPixelForValue(x),l=(s=c.getPixelForValue(x+_))-o,void 0!==v&&Math.abs(l)<v&&(l=v,s=_>=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=n.categoryPercentage;return null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o),i=r-(r-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:n.barPercentage,start:i}}(e,n,i):function(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=V.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return V.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}(e,n,i),r=this.getStackIndex(t,this.getMeta().stack),o=a.start+a.chunk*r+a.chunk/2,s=Math.min(wt(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),i=t.getMeta().data,a=t.getDataset(),r=i.length,o=0;for(V.canvas.clipArea(e.ctx,e.chartArea);o<r;++o){var s=n._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||i[o].draw()}V.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var t=this,e=V.extend({},tt.prototype._resolveDataElementOptions.apply(t,arguments)),n=t._getIndexScale().options,i=t._getValueScale().options;return e.barPercentage=wt(n.barPercentage,e.barPercentage),e.barThickness=wt(n.barThickness,e.barThickness),e.categoryPercentage=wt(n.categoryPercentage,e.categoryPercentage),e.maxBarThickness=wt(n.maxBarThickness,e.maxBarThickness),e.minBarLength=wt(i.minBarLength,e.minBarLength),e}}),Mt=V.valueOrDefault,St=V.options.resolve;N._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": ("+t.xLabel+", "+t.yLabel+", "+e.datasets[t.datasetIndex].data[t.index].r+")"}}}});var Dt=tt.extend({dataElementType:vt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta();V.each(n.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Mt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Mt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Mt(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=tt.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=V.extend({},s)),s.radius=St([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),Ct=V.valueOrDefault,Pt=Math.PI,Tt=2*Pt,Ot=Pt/2;N._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-Ot,circumference:Tt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return V.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var At=tt.extend({dataElementType:vt.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i=this,a=i.chart,r=a.chartArea,o=a.options,s=1,l=1,u=0,d=0,h=i.getMeta(),c=h.data,f=o.cutoutPercentage/100||0,g=o.circumference,m=i._getRingWeight(i.index);if(g<Tt){var p=o.rotation%Tt,v=(p+=p>=Pt?-Tt:p<-Pt?Tt:0)+g,b=Math.cos(p),y=Math.sin(p),x=Math.cos(v),_=Math.sin(v),w=p<=0&&v>=0||v>=Tt,k=p<=Ot&&v>=Ot||v>=Tt+Ot,M=p<=-Ot&&v>=-Ot||v>=Pt+Ot,S=p===-Pt||v>=Pt?-1:Math.min(b,b*f,x,x*f),D=M?-1:Math.min(y,y*f,_,_*f),C=w?1:Math.max(b,b*f,x,x*f),P=k?1:Math.max(y,y*f,_,_*f);s=(C-S)/2,l=(P-D)/2,u=-(C+S)/2,d=-(P+D)/2}for(e=0,n=c.length;e<n;++e)c[e]._options=i._resolveDataElementOptions(c[e],e);for(a.borderWidth=i.getMaxBorderWidth(),a.outerRadius=Math.max(Math.min((r.right-r.left-a.borderWidth)/s,(r.bottom-r.top-a.borderWidth)/l)/2,0),a.innerRadius=Math.max(a.outerRadius*f,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(i._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=d*a.outerRadius,h.total=i.calculateTotal(),i.outerRadius=a.outerRadius-a.radiusLength*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-a.radiusLength*m,0),e=0,n=c.length;e<n;++e)i.updateElement(c[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate||t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/Tt),g=t._options||{};V.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,borderAlign:g.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:n&&s.animateScale?0:i.outerRadius,innerRadius:n&&s.animateScale?0:i.innerRadius,label:V.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var m=t._model;n&&s.animateRotate||(m.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,m.endAngle=m.startAngle+m.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return V.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?Tt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){t=(i=d.getDatasetMeta(e)).data,e!==this.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(u=(l=o.hoverBorderWidth)>(u=(s=o.borderWidth)>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Ct(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Ct(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Ct(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(Ct(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});N._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),N._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ft=kt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),It=V.valueOrDefault,Lt=V.options.resolve,Rt=V.canvas._isPointInArea;function Nt(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}function Wt(t,e,n){var i=n/2,a=Nt(t,i),r=Nt(e,i);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Yt(t){var e,n,i,a;return V.isObject(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a}}N._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var zt=tt.extend({datasetElementType:vt.Line,dataElementType:vt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i._config,l=i._showLine=It(s.showLine,i.chart.options.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(l&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r._xScale,c=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=h.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?c.getBasePixel():r.calculatePointY(d,e,u),t._xScale=h,t._yScale=c,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:It(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,n=e._config,i=t.custom||{},a=e.chart.options,r=a.elements.line,o=tt.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=It(n.spanGaps,a.spanGaps),o.tension=It(n.lineTension,r.tension),o.steppedLine=Lt([i.steppedLine,n.steppedLine,r.stepped]),o.clip=Yt(It(n.clip,Wt(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u=this.chart,d=this._yScale,h=0,c=0;if(d.options.stacked){for(o=+d.getRightValue(t),l=(s=u._getSortedVisibleDatasetMetas()).length,i=0;i<l&&(a=s[i]).index!==n;++i)"line"===a.type&&a.yAxisID===d.id&&((r=+d.getRightValue(u.data.datasets[a.index].data[e]))<0?c+=r||0:h+=r||0);return d.getPixelForValue(o<0?c+o:h+o)}return d.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.chart,r=this.getMeta(),o=r.dataset._model,s=a.chartArea,l=r.data||[];function u(t,e,n){return Math.max(Math.min(t,n),e)}if(o.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),"monotone"===o.cubicInterpolationMode)V.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)n=l[t]._model,i=V.splineCurve(V.previousItem(l,t)._model,n,V.nextItem(l,t)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)Rt(n=l[t]._model,s)&&(t>0&&Rt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&Rt(l[t+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this,n=e.chart,i=e.getMeta(),a=i.data||[],r=n.chartArea,o=n.canvas,s=0,l=a.length;for(e._showLine&&(V.canvas.clipArea(n.ctx,{left:!1===(t=i.dataset._model.clip).left?0:r.left-t.left,right:!1===t.right?o.width:r.right+t.right,top:!1===t.top?0:r.top-t.top,bottom:!1===t.bottom?o.height:r.bottom+t.bottom}),i.dataset.draw(),V.canvas.unclipArea(n.ctx));s<l;++s)a[s].draw(r)},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=It(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=It(n.hoverBorderWidth,n.borderWidth),e.radius=It(n.hoverRadius,n.radius)}}),Et=V.options.resolve;N._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var Vt=tt.extend({dataElementType:vt.Arc,linkScales:V.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],d=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=d.length;e<n;++e)d[e]._options=a._resolveDataElementOptions(d[e],e),a.updateElement(d[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],m=g+(t.hidden?0:i._angles[e]),p=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};V.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:h,innerRadius:0,outerRadius:n?p:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:m,label:V.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return V.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor,a=V.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();return isNaN(i.data[t])||a.data[t].hidden?0:Et([e.chart.options.elements.arc.angle,2*Math.PI/n],{chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index},t)}});N._set("pie",V.clone(N.doughnut)),N._set("pie",{cutoutPercentage:0});var Ht=At,Bt=V.valueOrDefault;N._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var jt=tt.extend({datasetElementType:vt.Line,dataElementType:vt.Point,linkScales:V.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:s.x,h=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:h,skip:a.skip||isNaN(d)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Bt(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=tt.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Bt(e.spanGaps,n.spanGaps),i.tension=Bt(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}for(a.dataset._model.spanGaps&&(o=o.filter(function(t){return!t._model.skip})),t=0,e=o.length;t<e;++t)n=o[t]._model,i=V.splineCurve(V.previousItem(o,t,!0)._model,n,V.nextItem(o,t,!0)._model,n.tension),n.controlPointPreviousX=s(i.previous.x,r.left,r.right),n.controlPointPreviousY=s(i.previous.y,r.top,r.bottom),n.controlPointNextX=s(i.next.x,r.left,r.right),n.controlPointNextY=s(i.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=V.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Bt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Bt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Bt(n.hoverBorderWidth,n.borderWidth),e.radius=Bt(n.hoverRadius,n.radius)}});N._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),N._set("global",{datasets:{scatter:{showLine:!1}}});var Ut={bar:kt,bubble:Dt,doughnut:At,horizontalBar:Ft,line:zt,polarArea:Vt,pie:Ht,radar:jt,scatter:zt};function Gt(t,e){return t.native?{x:t.x,y:t.y}:V.getRelativePosition(t,e)}function qt(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(a=0,o=(n=l[i].data).length;a<o;++a)(s=n[a])._view.skip||e(s)}function Zt(t,e){var n=[];return qt(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function $t(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return qt(t,function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}}),r}function Xt(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function Jt(t,e,n){var i=Gt(e,t);n.axis=n.axis||"x";var a=Xt(n.axis),r=n.intersect?Zt(t,i):$t(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach(function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)}),o):[]}var Kt={modes:{single:function(t,e){var n=Gt(e,t),i=[];return qt(t,function(t){if(t.inRange(n.x,n.y))return i.push(t),i}),i.slice(0,1)},label:Jt,index:Jt,dataset:function(t,e,n){var i=Gt(e,t);n.axis=n.axis||"xy";var a=Xt(n.axis),r=n.intersect?Zt(t,i):$t(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return Jt(t,e,{intersect:!1})},point:function(t,e){return Zt(t,Gt(e,t))},nearest:function(t,e,n){var i=Gt(e,t);n.axis=n.axis||"xy";var a=Xt(n.axis);return $t(t,i,n.intersect,a)},x:function(t,e,n){var i=Gt(e,t),a=[],r=!1;return qt(t,function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Gt(e,t),a=[],r=!1;return qt(t,function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a}}},Qt=V.extend;function te(t,e){return V.where(t,function(t){return t.pos===e})}function ee(t,e){return t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function ne(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function ie(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ne(o,t,"left","right"),a=e.outerHeight-ne(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function ae(t,e){var n,i=e.maxPadding;return n={left:0,top:0,right:0,bottom:0},(t?["left","right"]:["top","bottom"]).forEach(function(t){n[t]=Math.max(e[t],i[t])}),n}function re(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)(o=(r=t[i]).box).update(r.width||e.w,r.height||e.h,ae(r.horizontal,e)),ie(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&re(u,e,n)||l}function oe(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)o=(r=t[i]).box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}N._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var se,le={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)n.hasOwnProperty(i=a[o])&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=V.options.toPadding((t.options.layout||{}).padding),a=e-i.width,r=n-i.height,o=function(t){var e=function(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)a.push({index:e,box:i=t[e],pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}(t),n=ee(te(e,"left"),!0),i=ee(te(e,"right")),a=ee(te(e,"top"),!0),r=ee(te(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:te(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}(t.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:r/2}),d=Qt({maxPadding:Qt({},i),w:a,h:r,x:i.left,y:i.top},i);!function(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)(a=t[n]).width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}(s.concat(l),u),re(s,d,u),re(l,d,u)&&re(s,d,u),function(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(d),oe(o.leftAndTop,d,u),d.x+=d.w,d.y+=d.h,oe(o.rightAndBottom,d,u),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h},V.each(o.chartArea,function(e){var n=e.box;Qt(n,t.chartArea),n.update(d.w,d.h)})}}},ue=(se=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&se.default||se,de="chartjs-size-monitor",he="chartjs-render-monitor",ce=["animationstart","webkitAnimationStart"],fe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ge(t,e){var n=V.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(n){}return t}()&&{passive:!0};function pe(t,e,n){t.addEventListener(e,n,me)}function ve(t,e,n){t.removeEventListener(e,n,me)}function be(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function ye(t){var e=document.createElement("div");return e.className=t||"",e}var xe={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var n=t.$chartjs||(t.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(e.host?e:document.head,ue)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=ge(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=ge(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e.$chartjs){var n=e.$chartjs.initial;["height","width"].forEach(function(t){var i=n[t];V.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),V.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e.$chartjs}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n.$chartjs||(n.$chartjs={});pe(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=fe[t.type]||t.type,i=V.getRelativePosition(t,e);return be(n,e,i.x,i.y,t)}(e,t))})}else!function(t,e,n){var i,a,r,o,s=t.$chartjs||(t.$chartjs={}),l=s.resizer=function(t){var e=1e6,n=ye(de),i=ye(de+"-expand"),a=ye(de+"-shrink");i.appendChild(ye()),a.appendChild(ye()),n.appendChild(i),n.appendChild(a),n._reset=function(){i.scrollLeft=e,i.scrollTop=e,a.scrollLeft=e,a.scrollTop=e};var r=function(){n._reset(),t()};return pe(i,"scroll",r.bind(i,"expand")),pe(a,"scroll",r.bind(a,"shrink")),n}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(be("resize",n)),i&&i.clientWidth<a&&n.canvas&&e(be("resize",n))}},r=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,V.requestAnimFrame.call(window,function(){r=!1,i.apply(a,o)}))}));!function(t,e){var n=t.$chartjs||(t.$chartjs={}),i=n.renderProxy=function(t){"chartjs-render-animation"===t.animationName&&e()};V.each(ce,function(e){pe(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(he)}(t,function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}})}(i,n,t)},removeEventListener:function(t,e,n){var i,a,r,o=t.canvas;if("resize"!==e){var s=((n.$chartjs||{}).proxies||{})[t.id+"_"+e];s&&ve(o,e,s)}else r=(a=(i=o).$chartjs||{}).resizer,delete a.resizer,function(t){var e=t.$chartjs||{},n=e.renderProxy;n&&(V.each(ce,function(e){ve(t,e,n)}),delete e.renderProxy),t.classList.remove(he)}(i),r&&r.parentNode&&r.parentNode.removeChild(r)}};V.addEvent=pe,V.removeEvent=ve;var _e=V.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},xe._enabled?xe:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}});N._set("global",{plugins:{}});var we={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,a=r[e];!1!==a&&(!0===a&&(a=V.clone(N.global.plugins[e])),n.push(t),i.push({plugin:t,options:a||{}}))}}),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},ke={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=V.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?V.merge(Object.create(null),[N.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=V.extend(n.defaults[t],e))},addScalesToLayout:function(t){V.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,le.addBox(t,e)})}},Me=V.valueOrDefault,Se=V.rtl.getRtlAdapter;N._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:V.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:V.noop,beforeBody:V.noop,beforeLabel:V.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),V.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:V.noop,afterBody:V.noop,beforeFooter:V.noop,footer:V.noop,afterFooter:V.noop}}});var De={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=V.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Ce(t,e){return e&&(V.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Pe(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Te(t){var e=N.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Me(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Me(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Me(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Me(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Me(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Me(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Me(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Me(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Me(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Oe(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ae(t){return Ce([],Pe(t))}var Fe=G.extend({initialize:function(){this._model=Te(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Ce(o,Pe(i)),o=Ce(o,Pe(a)),Ce(o,Pe(r))},getBeforeBody:function(){return Ae(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return V.each(t,function(t){var r={before:[],lines:[],after:[]};Ce(r.before,Pe(i.beforeLabel.call(n,t,e))),Ce(r.lines,i.label.call(n,t,e)),Ce(r.after,Pe(i.afterLabel.call(n,t,e))),a.push(r)}),a},getAfterBody:function(){return Ae(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Ce(r,Pe(n)),r=Ce(r,Pe(i)),Ce(r,Pe(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Te(c),m=h._active,p=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},y={width:f.width,height:f.height},x={x:f.caretX,y:f.caretY};if(m.length){g.opacity=1;var _=[],w=[];x=De[c.position].call(h,m,h._eventPosition);var k=[];for(e=0,n=m.length;e<n;++e)k.push((a=void 0,r=void 0,l=void 0,u=void 0,d=void 0,a=(i=m[e])._xScale,r=i._yScale||i._scale,o=i._index,u=(l=i._chart.getDatasetMeta(s=i._datasetIndex).controller)._getIndexScale(),d=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:r?r.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:d?""+d.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:i._model.x,y:i._model.y}));c.filter&&(k=k.filter(function(t){return c.filter(t,p)})),c.itemSort&&(k=k.sort(function(t,e){return c.itemSort(t,e,p)})),V.each(k,function(t){_.push(c.callbacks.labelColor.call(h,t,h._chart)),w.push(c.callbacks.labelTextColor.call(h,t,h._chart))}),g.title=h.getTitle(k,p),g.beforeBody=h.getBeforeBody(k,p),g.body=h.getBody(k,p),g.afterBody=h.getAfterBody(k,p),g.footer=h.getFooter(k,p),g.x=x.x,g.y=x.y,g.caretPadding=c.caretPadding,g.labelColors=_,g.labelTextColors=w,g.dataPoints=k,y=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0),s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=(o+=e.beforeBody.length+e.afterBody.length)*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=V.fontString(u,e._titleFontStyle,e._titleFontFamily),V.each(e.title,f),n.font=V.fontString(d,e._bodyFontStyle,e._bodyFontFamily),V.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,V.each(r,function(t){V.each(t.before,f),V.each(t.lines,f),V.each(t.after,f)}),c=0,n.font=V.fontString(h,e._footerFontStyle,e._footerFontFamily),V.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,g),b=function(t,e,n,i){var a=t.x,r=t.y,o=t.caretPadding,s=n.xAlign,l=n.yAlign,u=t.caretSize+o,d=t.cornerRadius+o;return"right"===s?a-=e.width:"center"===s&&((a-=e.width/2)+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===l?r+=u:r-="bottom"===l?e.height+u:e.height/2,"center"===l?"left"===s?a+=u:"right"===s&&(a-=u):"left"===s?a-=d:"right"===s&&(a+=d),{x:a,y:r}}(g,y,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,y),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=y.width,g.height=y.height,g.caretX=x.x,g.caretY=x.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this.getCaretPosition(t,e,this._view);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Se(e.rtl,e.x,e.width);for(t.x=Oe(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=V.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,d,h=e.bodyFontSize,c=e.bodySpacing,f=e._bodyAlign,g=e.body,m=e.displayColors,p=0,v=m?Oe(e,"left"):0,b=Se(e.rtl,e.x,e.width),y=function(e){n.fillText(e,b.x(t.x+p),t.y+h/2),t.y+=h+c},x=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=V.fontString(h,e._bodyFontStyle,e._bodyFontFamily),t.x=Oe(e,x),n.fillStyle=e.bodyFontColor,V.each(e.beforeBody,y),p=m&&"right"!==x?"center"===f?h/2+1:h+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],r=e.labelColors[s],n.fillStyle=a=e.labelTextColors[s],V.each(i.before,y),l=0,d=(o=i.lines).length;l<d;++l){if(m){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,h),t.y,h,h),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,h),t.y,h,h),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),h-2),t.y+1,h-2,h-2),n.fillStyle=a}y(o[l])}V.each(i.after,y)}p=0,V.each(e.afterBody,y),t.y-=c},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Se(e.rtl,e.x,e.width);for(t.x=Oe(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=V.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,d=e.cornerRadius;n.beginPath(),n.moveTo(o+d,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-d,s),n.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-d),n.quadraticCurveTo(o+l,s+u,o+l-d,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+d,s+u),n.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+d),n.quadraticCurveTo(o,s,o+d,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity;this._options.enabled&&(e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length)&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,V.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),V.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!V.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}});Fe.positioners=De;var Ie=V.valueOrDefault;function Le(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)r=Ie((o=n[t][a]).type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),V.merge(e[t][a],!e[t][a].type||o.type&&o.type!==e[t][a].type?[ke.getScaleDefaults(r),o]:o)}else V._merger(t,e,n,i)}})}function Re(){return V.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=Le(a,r):"scale"===t?e[t]=V.merge(a,[ke.getScaleDefaults(r.type),r]):V._merger(t,e,n,i)}})}function Ne(t){var e=t.options;V.each(t.scales,function(e){le.removeBox(t,e)}),e=Re(N.global,N[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function We(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(V.findIndex(t,a)>=0);return i}function Ye(t){return"top"===t||"bottom"===t}function ze(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}N._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Ee=function(t,e){return this.construct(t,e),this};V.extend(Ee.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Re(N.global,N[t.type],t.options||{}),t}(e);var i=_e.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=V.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Ee.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return we.notify(t,"beforeInit"),V.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),we.notify(t,"afterInit"),t},clear:function(){return V.canvas.clear(this),this},stop:function(){return $.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(V.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:V.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",V.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};we.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;V.each(e.xAxes,function(t,n){t.id||(t.id=We(e.xAxes,"x-axis-",n))}),V.each(e.yAxes,function(t,n){t.id||(t.id=We(e.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(i,function(e){var i=e.options,r=i.id,o=Ie(i.type,e.dtype);Ye(i.position)!==Ye(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=ke.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),V.each(a,function(t,e){t||delete n[e]}),t.scales=n,ke.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Ut[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;V.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),Ne(i),we._invalidate(i),!1!==we.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();for(e=0,n=i.data.datasets.length;e<n;e++)i.getDatasetMeta(e).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&V.each(a,function(t){t.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],we.notify(i,"afterUpdate"),i._layers.sort(ze("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){var t=this;!1!==we.notify(t,"beforeLayout")&&(le.update(this,this.width,this.height),t._layers=[],V.each(t.boxes,function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())},t),t._layers.forEach(function(t,e){t._idx=e}),we.notify(t,"afterScaleUpdate"),we.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==we.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);we.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==we.notify(e,"beforeDatasetUpdate",[i])&&(n.controller._update(),we.notify(e,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=Ie(t.duration,n&&n.duration),a=t.lazy;if(!1!==we.notify(e,"beforeRender")){var r=function(t){we.notify(e,"afterRender"),V.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new Z({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=e.currentStep,i=n/e.numSteps;t.draw((0,V.easing.effects[e.easing])(i),i,n)},onAnimationProgress:n.onProgress,onAnimationComplete:r});$.addAnimation(e,o,i,a)}else e.draw(),r(new Z({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),V.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==we.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),we.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=this,a=[];for(e=0,n=(i.data.datasets||[]).length;e<n;++e)t&&!i.isDatasetVisible(e)||a.push(i.getDatasetMeta(e));return a.sort(ze("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n,i=this;if(!1!==we.notify(i,"beforeDatasetsDraw",[t])){for(n=(e=i._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)i.drawDataset(e[n],t);we.notify(i,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==we.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),we.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==we.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),we.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return Kt.modes.single(this,t)},getElementsAtEvent:function(t){return Kt.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Kt.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=Kt.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return Kt.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:t}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),V.canvas.clear(n),_e.releaseContext(n.ctx),n.canvas=null,n.ctx=null),we.notify(n,"destroy"),delete Ee.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Fe({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};V.each(t.options.events,function(i){_e.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},_e.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,V.each(e,function(e,n){_e.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==we.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),we.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===t.type?[]:n.getElementsAtEventForMode(t,a.mode,a),V.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!V.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),Ee.instances={};var Ve=Ee;function He(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Be(t){this.options=t||{}}Ee.Controller=Ee,Ee.types={},V.configMerge=Re,V.scaleMerge=Le,V.extend(Be.prototype,{formats:He,parse:He,format:He,add:He,diff:He,startOf:He,endOf:He,_create:function(t){return t}}),Be.override=function(t){V.extend(Be.prototype,t)};var je={_date:Be},Ue={formatters:{values:function(t){return V.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=V.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=V.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(V.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},Ge=V.isArray,qe=V.isNullOrUndef,Ze=V.valueOrDefault,$e=V.valueAtIndexOrDefault;function Xe(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel,u=1e-6;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=r<e?i:-i)<s-u||o>l+u)))return o}function Je(t){return t.drawTicks?t.tickMarkLength:0}function Ke(t){var e,n;return t.display?(e=V.options._parseFont(t),n=V.options.toPadding(t.padding),e.lineHeight+n.height):0}function Qe(t,e){return V.extend(V.options._parseFont({fontFamily:Ze(e.fontFamily,t.fontFamily),fontSize:Ze(e.fontSize,t.fontSize),fontStyle:Ze(e.fontStyle,t.fontStyle),lineHeight:Ze(e.lineHeight,t.lineHeight)}),{color:V.options.resolve([e.fontColor,t.fontColor,N.global.defaultFontColor])})}function tn(t){var e=Qe(t,t.minor);return{minor:e,major:t.major.enabled?Qe(t,t.major):e}}function en(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)void 0!==(e=t[n])._index&&a.push(e);return a}function nn(t,e,n,i){var a,r,o,s,l=Ze(n,0),u=Math.min(Ze(i,t.length),t.length),d=0;for(e=Math.ceil(e),i&&(e=(a=i-n)/Math.floor(a/e)),s=l;s<0;)d++,s=Math.round(l+d*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,d++,s=Math.round(l+d*e)):delete o.label}N._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Ue.formatters.values,minor:{},major:{}}});var an=G.extend({zeroLineIndex:0,getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){V.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=V.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,r=l._convertTicksToLabels((s=d<o.length)?function(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}(o,d):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){V.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){V.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){V.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){V.callback(this.options.beforeDataLimits,[this])},determineDataLimits:V.noop,afterDataLimits:function(){V.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){V.callback(this.options.beforeBuildTicks,[this])},buildTicks:V.noop,afterBuildTicks:function(t){var e=this;return Ge(t)&&t.length?V.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=V.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){V.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){V.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){V.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,h=u.minRotation||0,c=u.maxRotation,f=h;!s._isVisible()||!u.display||h>=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-Je(l.gridLines)-u.padding-Ke(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=V.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=Je(o)+Ke(r)),u?s&&(e.height=Je(o)+Ke(r)):e.height=t.maxHeight,a.display&&s){var d=tn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,m=h.highest,p=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=V.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y);e.height=Math.min(t.maxHeight,e.height+(_*g.width+x*(m.height-(b?m.offset:0))+(b?0:p))+v);var w,k,M=t.getPixelForTick(0)-t.left,S=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?x*c.width+_*c.offset:_*(c.height-c.offset),k=l?_*(f.height-f.offset):x*f.width+_*f.offset):(w=c.width/2,k=f.width/2),t.paddingLeft=Math.max((w-M)*t.width/(t.width-M),0)+3,t.paddingRight=Math.max((k-S)*t.width/(t.width-S),0)+3}else e.width=Math.min(t.maxWidth,e.width+(a.mirror?0:g.width+v+p)),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(qe(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map(function(t){return t.value}),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,m,p,v=n.length,b=[],y=[],x=[],_=0,w=0;for(a=0;a<v;++a){if(s=n[a].label,t.font=u=(l=n[a].major?e.major:e.minor).string,d=i[u]=i[u]||{data:{},gc:[]},h=l.lineHeight,c=f=0,qe(s)||Ge(s)){if(Ge(s))for(r=0,o=s.length;r<o;++r)qe(g=s[r])||Ge(g)||(c=V.measureText(t,d.data,d.gc,c,g),f+=h)}else c=V.measureText(t,d.data,d.gc,c,s),f=h;b.push(c),y.push(f),x.push(h/2),_=Math.max(c,_),w=Math.max(f,w)}function k(t){return{width:b[t]||0,height:y[t]||0,offset:x[t]||0}}return function(t,e){V.each(t,function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}})}(i,v),m=b.indexOf(_),p=y.indexOf(w),{first:k(0),last:k(v-1),widest:k(m),highest:k(p)}}(t.ctx,tn(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return Ge(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(e=void 0,n=t=+this.getRightValue(t),i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:V.noop,getPixelForValue:V.noop,getValueForPixel:V.noop,getPixelForTick:function(t){var e=this,n=e.options.offset,i=e._ticks.length,a=1/Math.max(i-(n?0:1),1);return t<0||t>i-1?null:e.getPixelForDecimal(t*a+(n?a/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.options.ticks,s=o.maxTicksLimit||r._length/r._tickSize()+1,l=o.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}(t):[],u=l.length,d=l[0],h=l[u-1];if(u>s)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,o=e[++r*n]):delete a.label}(t,l,u/s),en(t);if(i=function(t,e,n,i){var a,r,o,s,l=function(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(o=0,s=(a=V.math._factorize(l)).length-1;o<s;o++)if((r=a[o])>u)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e<n;e++)nn(t,i,l[e],l[e+1]);return nn(t,i,V.isNullOrUndef(a=u>1?(h-d)/(u-1):null)?0:d-a,d),nn(t,i,h,V.isNullOrUndef(a)?t.length:h+a),en(t)}return nn(t,i),en(t)},_tickSize:function(){var t=this,e=t.options.ticks,n=V.toRadians(t.labelRotation),i=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),r=t._getLabelSizes(),o=e.autoSkipPadding||0,s=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return t.isHorizontal()?l*i>s*a?s/i:l/a:l*a<s*i?l/i:s/a},_isVisible:function(){var t,e,n,i=this,a=i.chart,r=i.options.display;if("auto"!==r)return!!r;for(t=0,e=a.data.datasets.length;t<e;++t)if(a.isDatasetVisible(t)&&((n=a.getDatasetMeta(t)).xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,m,p,v,b=this,y=b.chart,x=b.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,M=b.isHorizontal(),S=b._ticksToDraw,D=S.length+(k?1:0),C=Je(_),P=[],T=_.drawBorder?$e(_.lineWidth,0,0):0,O=T/2,A=V._alignPixel,F=function(t){return A(y,t,T)};for("top"===w?(e=F(b.bottom),s=b.bottom-C,u=e-O,h=F(t.top)+O,f=t.bottom):"bottom"===w?(e=F(b.top),h=t.top,f=F(t.bottom)-O,s=e+O,u=b.top+C):"left"===w?(e=F(b.right),o=b.right-C,l=e-O,d=F(t.left)+O,c=t.right):(e=F(b.left),d=t.left,c=F(t.right)-O,o=e+O,l=b.left+C),n=0;n<D;++n)qe((i=S[n]||{}).label)&&n<S.length||(n===b.zeroLineIndex&&x.offset===k?(g=_.zeroLineWidth,m=_.zeroLineColor,p=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=$e(_.lineWidth,n,1),m=$e(_.color,n,"rgba(0,0,0,0.1)"),p=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=Xe(b,i._index||n,k))&&(r=A(y,a,g),M?o=l=d=c=r:s=u=h=f=r,P.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,width:g,color:m,borderDash:p,borderDashOffset:v})));return P.ticksLength=D,P.borderValue=e,P},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.options,g=f.ticks,m=f.position,p=g.mirror,v=c.isHorizontal(),b=c._ticksToDraw,y=tn(g),x=g.padding,_=Je(f.gridLines),w=-V.toRadians(c.labelRotation),k=[];for("top"===m?(r=c.bottom-_-x,o=w?"left":"center"):"bottom"===m?(r=c.top+_+x,o=w?"right":"center"):"left"===m?(a=c.right-(p?0:_)-x,o=p?"left":"right"):(a=c.left+(p?0:_)+x,o=p?"right":"left"),t=0,e=b.length;t<e;++t)qe(i=(n=b[t]).label)||(s=c.getPixelForTick(n._index||t)+g.labelOffset,u=(l=n.major?y.major:y.minor).lineHeight,d=Ge(i)?i.length:1,v?(a=s,h="top"===m?((w?1:.5)-d)*u:(w?0:.5)*u):(r=s,h=(1-d)*u/2),k.push({x:a,y:r,rotation:w,label:i,font:l,textOffset:h,textAlign:o}));return k},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,d=V._alignPixel,h=n.drawBorder?$e(n.lineWidth,0,0):0,c=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=c.length;r<o;++r)a=(s=c[r]).color,(i=s.width)&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(h){var f,g,m,p,v=h,b=$e(n.lineWidth,c.ticksLength-1,1),y=c.borderValue;e.isHorizontal()?(f=d(u,e.left,v)-v/2,g=d(u,e.right,b)+b/2,m=p=y):(m=d(u,e.top,v)-v/2,p=d(u,e.bottom,b)+b/2,f=g=y),l.lineWidth=h,l.strokeStyle=$e(n.color,0),l.beginPath(),l.moveTo(f,m),l.lineTo(g,p),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,n,i,a,r,o,s,l,u=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,i=d.length;e<i;++e){if(o=(r=d[e]).font,u.save(),u.translate(r.x,r.y),u.rotate(r.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=r.textAlign,l=r.textOffset,Ge(s=r.label))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=Ze(i.fontColor,N.global.defaultFontColor),s=V.options._parseFont(i),l=V.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,h=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===d?t.bottom-u-l.bottom:t.top+u+l.top;else{var c="left"===d;a=c?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,h=c?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(h),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){var e=this;e._isVisible()&&(e._drawGrid(t),e._drawTitle(),e._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter(function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)})}});an.prototype._draw=an.prototype.draw;var rn=an,on=V.isNullOrUndef,sn=rn.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a))>=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this,e=t._getLabels(),n=t.minIndex,i=t.maxIndex;t.ticks=0===n&&i===e.length-1?e:e.slice(n,i+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart;return i.getDatasetMeta(e).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[e].data[t]):n._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;rn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return on(e)||on(n)||(t=o.chart.data.datasets[n].data[e]),on(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=V.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,n=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(n,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}});sn._defaults={position:"bottom"};var ln=V.isNullOrUndef,un=rn.extend({getRightValue:function(t){return"string"==typeof t?+t:rn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=V.sign(t.min),i=V.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(t.min=null===t.min?e.suggestedMin:Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(t.max=null===t.max?e.suggestedMax:Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,i=n.stepSize,a=n.maxTicksLimit;return i?t=Math.ceil(e.max/i)-Math.floor(e.min/i)+1:(t=e._computeTickLimit(),a=a||11),a&&(t=Math.min(a,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:V.noop,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:V.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,m=V.niceNum((g-f)/u/l)*l;if(m<1e-14&&ln(d)&&ln(h))return[f,g];(r=Math.ceil(g/m)-Math.floor(f/m))>u&&(m=V.niceNum(r*m/u/l)*l),s||ln(c)?n=Math.pow(10,V._decimalPlaces(m)):(n=Math.pow(10,c),m=Math.ceil(m*n)/n),i=Math.floor(f/m)*m,a=Math.ceil(g/m)*m,s&&(!ln(d)&&V.almostWhole(d/m,m/1e3)&&(i=d),!ln(h)&&V.almostWhole(h/m,m/1e3)&&(a=h)),r=V.almostEquals(r=(a-i)/m,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(ln(d)?i:d);for(var p=1;p<r;++p)o.push(Math.round((i+p*m)*n)/n);return o.push(ln(h)?a:h),o}(i,t);t.handleDirectionalChanges(),t.max=V.max(a),t.min=V.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),rn.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;rn.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(a-i)/Math.max(n.length-1,1)/2,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),dn={position:"left",ticks:{callback:Ue.formatters.linear}};function hn(t,e,n,i){var a,r,o=t.options,s=function(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}(e,o.stacked,n),l=s.pos,u=s.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:r.min<0||r.max<0?u[a]+=r.min:l[a]+=r.max)}function cn(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var fn=un.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=r.stacked,u={},d=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<d;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<d;++t)n=o[(e=s[t]).index].data,l?hn(a,u,e,n):cn(a,e,n);V.each(u,function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,V.min(i)),a.max=Math.max(a.max,V.max(i))}),a.min=V.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=V.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=V.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this;return e.getPixelForDecimal((+e.getRightValue(t)-e._startValue)/e._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}});fn._defaults=dn;var gn=V.valueOrDefault,mn=V.math.log10,pn={position:"left",ticks:{callback:Ue.formatters.logarithmic}};function vn(t,e){return V.isFinite(t)&&t>=0?t:e}var bn=rn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e)&&void 0!==e.stack){c=!0;break}if(s.stacked||c){var f={};for(t=0;t<u.length;t++){var g=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&h(e))for(void 0===f[g]&&(f[g]=[]),a=0,r=(i=u[t].data).length;a<r;a++){var m=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(m[a]=m[a]||0,m[a]+=n.max)}}V.each(f,function(t){if(t.length>0){var e=V.min(t),n=V.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}})}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e))for(a=0,r=(i=u[t].data).length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=V.isFinite(o.min)?o.min:null,o.max=V.isFinite(o.max)?o.max:null,o.minNotZero=V.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=vn(e.min,t.min),t.max=vn(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(mn(t.min))-1),t.max=Math.pow(10,Math.floor(mn(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(mn(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(mn(t.min))+1):10),null===t.minNotZero&&(t.minNotZero=t.min>0?t.min:t.max<1?Math.pow(10,Math.floor(mn(t.max))):1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:vn(e.min),max:vn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=gn(t.min,Math.pow(10,Math.floor(mn(e.min)))),o=Math.floor(mn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(mn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(mn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10==++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=gn(t.max,r);return a.push(u),a}(i,t);t.max=V.max(a),t.min=V.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),rn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(mn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;rn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=gn(t.options.ticks.fontSize,N.global.defaultFontSize)/t._length),t._startValue=mn(e),t._valueOffset=n,t._valueRange=(mn(t.max)-mn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(mn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}});bn._defaults=pn;var yn=V.valueOrDefault,xn=V.valueAtIndexOrDefault,_n=V.options.resolve,wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ue.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function kn(t){var e=t.ticks;return e.display&&t.display?yn(e.fontSize,N.global.defaultFontSize)+2*e.backdropPaddingY:0}function Mn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Sn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Dn(t,e,n,i){var a,r,o=n.y+i/2;if(V.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function Cn(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function Pn(t){return V.isNumber(t)?t:0}var Tn=un.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=kn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;V.each(e.data.datasets,function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);V.each(a.data,function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/kn(this.options))},convertTicksToLabels:function(){var t=this;un.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(function(){var e=V.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""})},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?function(t){var e,n,i,a=V.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;e<d;e++){i=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,n=V.isArray(u=t.pointLabels[e])?{w:V.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=n;var h=t.getIndexAngle(e),c=V.toDegrees(h)%360,f=Mn(c,i.x,n.w,0,180),g=Mn(c,i.y,n.h,90,270);f.start<r.l&&(r.l=f.start,o.l=h),f.end>r.r&&(r.r=f.end,o.r=h),g.start<r.t&&(r.t=g.start,o.t=h),g.end>r.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(t):t.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Pn(a),r=Pn(r),o=Pn(o),s=Pn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=n+a.drawingArea,o=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((t+a.drawingArea+(a.width-e-a.drawingArea))/2+a.left),a.yCenter=Math.floor((r+o)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(V.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this,n=e.min,i=e.max;return e.getPointPositionForValue(t||0,e.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=yn(s.lineWidth,o.lineWidth),u=yn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=kn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=V.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=t.getPointPosition(s,r+(0===s?a/2:0)+5),u=xn(i.fontColor,s,N.global.defaultFontColor);e.fillStyle=u;var d=t.getIndexAngle(s),h=V.toDegrees(d);e.textAlign=Sn(h),Cn(h,t._pointLabelSizes[s],l),Dn(e,t.pointLabels[s],l,o.lineHeight)}e.restore()}(i),o.display&&V.each(i.ticks,function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=xn(e.color,i-1),u=xn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}(i,o,e,n))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(_n([s.borderDash,o.borderDash,[]])),a.lineDashOffset=_n([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=V.options._parseFont(n),s=yn(n.fontColor,N.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",V.each(t.ticks,function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))}),e.restore()}},_drawTitle:V.noop});Tn._defaults=wn;var On=V._deprecated,An=V.options.resolve,Fn=V.valueOrDefault,In=Number.MIN_SAFE_INTEGER||-9007199254740991,Ln=Number.MAX_SAFE_INTEGER||9007199254740991,Rn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(Rn);function Wn(t,e){return t-e}function Yn(t){return V.valueOrDefault(t.time.min,t.ticks.min)}function zn(t){return V.valueOrDefault(t.time.max,t.ticks.max)}function En(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(r=t[i=o+s>>1],!(a=t[i-1]||null))return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e];return r[i]+(o[i]-r[i])*(s?(n-r[e])/s:0)}function Vn(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),V.isFinite(o)||(o=n.parse(o))),o)}function Hn(t,e){if(V.isNullOrUndef(e))return null;var n=t.options.time,i=Vn(t,t.getRightValue(e));return null===i||n.round&&(i=+t._adapter.startOf(i,n.round)),i}function Bn(t,e,n,i){var a,r,o=Nn.length;for(a=Nn.indexOf(t);a<o-1;++a)if((r=Rn[Nn[a]]).common&&Math.ceil((n-e)/((r.steps?r.steps:Ln)*r.size))<=i)return Nn[a];return Nn[o-1]}function jn(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)o[a=e[i]]=i,r.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))(r=n[a])>=0&&(e[r].major=!0);return e}(t,r,o,n):r}var Un=rn.extend({initialize:function(){this.mergeTicksOptions(),rn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new je._date(e.adapters.date);return On("time scale",n.format,"time.format","time.parser"),On("time scale",n.min,"time.min","ticks.min"),On("time scale",n.max,"time.max","ticks.max"),V.mergeIf(n.displayFormats,i.formats()),rn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),rn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=Ln,f=In,g=[],m=[],p=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)p.push(Hn(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(V.isObject((a=l.data.datasets[t].data)[0]))for(m[t]=[],e=0,i=a.length;e<i;++e)r=Hn(s,a[e]),g.push(r),m[t][e]=r;else m[t]=p.slice(0),o||(g=g.concat(p),o=!0);else m[t]=[];p.length&&(c=Math.min(c,p[0]),f=Math.max(f,p[p.length-1])),g.length&&(g=n>1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}(g).sort(Wn):g.sort(Wn),c=Math.min(c,g[0]),f=Math.max(f,g[g.length-1])),c=Hn(s,Yn(d))||c,f=Hn(s,zn(d))||f,c=c===Ln?+u.startOf(Date.now(),h):c,f=f===In?+u.endOf(Date.now(),h)+1:f,s.min=Math.min(c,f),s.max=Math.max(c+1,f),s._table=[],s._timestamps={data:g,datasets:m,labels:p}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),c=s.source,f=o.distribution;for(u="data"===c||"auto"===c&&"series"===f?u.data:"labels"===c?u.labels:function(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||Bn(s.minUnit,e,n,i),u=An([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,h=e,c=[];if(d&&(h=+r.startOf(h,"isoWeek",d)),h=+r.startOf(h,d?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a<n;a=+r.add(a,u,l))c.push(a);return a!==n&&"ticks"!==o.bounds||c.push(a),c}(i,a,r,h),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=Hn(i,Yn(o))||a,r=Hn(i,zn(o))||r,t=0,e=u.length;t<e;++t)(n=u[t])>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?Bn(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=Nn.length-1;r>=Nn.indexOf(n);r--)if(Rn[o=Nn[r]].common&&t._adapter.diff(a,i,o)>=e-1)return o;return Nn[n?Nn.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=Nn.indexOf(t)+1,n=Nn.length;e<n;++e)if(Rn[Nn[e]].common)return Nn[e]}(i._unit):void 0,i._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)(s=t[a])>e&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],s=d[a],void 0!==(o=d[a-1])&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}(i._timestamps.data,a,r,f),i._offsets=function(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=En(t,"time",e[0],"pos"),s=1===e.length?1-r:(En(t,"time",e[1],"pos")-r)/2,o=En(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-En(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(i._table,d,0,0,o),s.reverse&&d.reverse(),jn(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return V.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(Vn(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(Vn(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this,r=a.options,o=r.time.displayFormats,s=a._majorUnit,l=o[s],u=n[e],d=r.ticks,h=s&&l&&u&&u.major,c=a._adapter.format(t,i||(h?l:o[a._unit])),f=h?d.major:d.minor,g=An([f.callback,f.userCallback,d.callback,d.userCallback]);return g?g(c,e,n):c},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this,n=e._offsets,i=En(e._table,"time",t,"pos");return e.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=Hn(i,t)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end,a=En(e._table,"pos",i,"time");return e._adapter._create(a)},_getLabelSize:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=V.toRadians(e.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),s=Fn(n.fontSize,N.global.defaultFontSize);return{w:i*r+s*o,h:i*o+s*r}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,jn(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}});Un._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var Gn={category:sn,linear:fn,logarithmic:bn,radialLinear:Tn,time:Un},qn=t(function(t,e){t.exports=function(){var e,n;function i(){return e.apply(null,arguments)}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return void 0===t}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function h(t,e){for(var n in e)d(e,n)&&(t[n]=e[n]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function c(t,e,n,i){return we(t,e,n,i,!0).utc()}function f(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function g(t){if(null==t._isValid){var e=f(t),i=n.call(e.parsedDateParts,function(t){return null!=t}),a=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(a=a&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return a;t._isValid=a}return t._isValid}function m(t){var e=c(NaN);return null!=t?h(f(e),t):f(e).userInvalidated=!0,e}n=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var p=i.momentProperties=[];function v(t,e){var n,i,a;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=f(e)),o(e._locale)||(t._locale=e._locale),p.length>0)for(n=0;n<p.length;n++)o(a=e[i=p[n]])||(t[i]=a);return t}var b=!1;function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,i.updateOffset(this),b=!1)}function x(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function _(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=_(e)),n}function k(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&w(t[i])!==w(e[i]))&&o++;return o+r}function M(t){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,e){var n=!0;return h(function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,t),n){for(var a,r=[],o=0;o<arguments.length;o++){if(a="","object"==typeof arguments[o]){for(var s in a+="\n["+o+"] ",arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[o];r.push(a)}M(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)},e)}var D,C={};function P(t,e){null!=i.deprecationHandler&&i.deprecationHandler(t,e),C[t]||(M(e),C[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function O(t,e){var n,i=h({},t);for(n in e)d(e,n)&&(r(t[n])&&r(e[n])?(i[n]={},h(i[n],t[n]),h(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)d(t,n)&&!d(e,n)&&r(t[n])&&(i[n]=h({},i[n]));return i}function A(t){null!=t&&this.set(t)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,D=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)d(t,e)&&n.push(e);return n};var F={};function I(t,e){var n=t.toLowerCase();F[n]=F[n+"s"]=F[e]=t}function L(t){return"string"==typeof t?F[t]||F[t.toLowerCase()]:void 0}function R(t){var e,n,i={};for(n in t)d(t,n)&&(e=L(n))&&(i[e]=t[n]);return i}var N={};function W(t,e){N[t]=e}function Y(t,e,n){var i=""+Math.abs(t);return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,e-i.length)).toString().substr(1)+i}var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},H={};function B(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(H[t]=a),e&&(H[e[0]]=function(){return Y(a.apply(this,arguments),e[1],e[2])}),n&&(H[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function j(t,e){return t.isValid()?(e=U(e,t.localeData()),V[e]=V[e]||function(t){var e,n,i,a=t.match(z);for(e=0,n=a.length;e<n;e++)a[e]=H[a[e]]?H[a[e]]:(i=a[e]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(e){var i,r="";for(i=0;i<n;i++)r+=T(a[i])?a[i].call(e,t):a[i];return r}}(e),V[e](t)):t.localeData().invalidDate()}function U(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(E.lastIndex=0;n>=0&&E.test(t);)t=t.replace(E,i),E.lastIndex=0,n-=1;return t}var G=/\d/,q=/\d\d/,Z=/\d{3}/,$=/\d{4}/,X=/[+-]?\d{6}/,J=/\d\d?/,K=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,nt=/[+-]?\d{1,6}/,it=/\d+/,at=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,ot=/Z|[+-]\d\d(?::?\d\d)?/gi,st=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lt={};function ut(t,e,n){lt[t]=T(e)?e:function(t,i){return t&&n?n:e}}function dt(t,e){return d(lt,t)?lt[t](e._strict,e._locale):new RegExp(ht(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a})))}function ht(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ct={};function ft(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=w(t)}),n=0;n<t.length;n++)ct[t[n]]=i}function gt(t,e){ft(t,function(t,n,i,a){i._w=i._w||{},e(t,i._w,i,a)})}function mt(t,e,n){null!=e&&d(ct,t)&&ct[t](e,n._a,n,t)}function pt(t){return vt(t)?366:365}function vt(t){return t%4==0&&t%100!=0||t%400==0}B("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),B(0,["YY",2],0,function(){return this.year()%100}),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),I("year","y"),W("year",1),ut("Y",at),ut("YY",J,q),ut("YYYY",et,$),ut("YYYYY",nt,X),ut("YYYYYY",nt,X),ft(["YYYYY","YYYYYY"],0),ft("YYYY",function(t,e){e[0]=2===t.length?i.parseTwoDigitYear(t):w(t)}),ft("YY",function(t,e){e[0]=i.parseTwoDigitYear(t)}),ft("Y",function(t,e){e[0]=parseInt(t,10)}),i.parseTwoDigitYear=function(t){return w(t)+(w(t)>68?1900:2e3)};var bt,yt=xt("FullYear",!0);function xt(t,e){return function(n){return null!=n?(wt(this,t,n),i.updateOffset(this,e),this):_t(this,t)}}function _t(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function wt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&vt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),kt(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function kt(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=function(t,e){return(t%12+12)%12}(e);return t+=(e-n)/12,1===n?vt(t)?29:28:31-n%7%2}bt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},B("M",["MM",2],"Mo",function(){return this.month()+1}),B("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),B("MMMM",0,0,function(t){return this.localeData().months(this,t)}),I("month","M"),W("month",8),ut("M",J),ut("MM",J,q),ut("MMM",function(t,e){return e.monthsShortRegex(t)}),ut("MMMM",function(t,e){return e.monthsRegex(t)}),ft(["M","MM"],function(t,e){e[1]=w(t)-1}),ft(["MMM","MMMM"],function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[1]=a:f(n).invalidMonth=t});var Mt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,St="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Dt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ct(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=c([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=bt.call(this._shortMonthsParse,o))||-1!==(a=bt.call(this._longMonthsParse,o))?a:null:-1!==(a=bt.call(this._longMonthsParse,o))||-1!==(a=bt.call(this._shortMonthsParse,o))?a:null}function Pt(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=w(e);else if(!s(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),kt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function Tt(t){return null!=t?(Pt(this,t),i.updateOffset(this,!0),this):_t(this,"Month")}var Ot=st,At=st;function Ft(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=c([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=ht(i[e]),a[e]=ht(a[e]);for(e=0;e<24;e++)r[e]=ht(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function It(t,e,n,i,a,r,o){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,i,a,r,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,a,r,o),s}function Lt(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Rt(t,e,n){var i=7+e-n;return-(7+Lt(t,0,i).getUTCDay()-e)%7+i-1}function Nt(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+Rt(t,i,a);return s<=0?o=pt(r=t-1)+s:s>pt(t)?(r=t+1,o=s-pt(t)):(r=t,o=s),{year:r,dayOfYear:o}}function Wt(t,e,n){var i,a,r=Rt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+Yt(a=t.year()-1,e,n):o>Yt(t.year(),e,n)?(i=o-Yt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function Yt(t,e,n){var i=Rt(t,e,n),a=Rt(t+1,e,n);return(pt(t)-i+a)/7}function zt(t,e){return t.slice(e,7).concat(t.slice(0,e))}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),W("week",5),W("isoWeek",5),ut("w",J),ut("ww",J,q),ut("W",J),ut("WW",J,q),gt(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=w(t)}),B("d",0,"do","day"),B("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),B("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),B("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),W("day",11),W("weekday",11),W("isoWeekday",11),ut("d",J),ut("e",J),ut("E",J),ut("dd",function(t,e){return e.weekdaysMinRegex(t)}),ut("ddd",function(t,e){return e.weekdaysShortRegex(t)}),ut("dddd",function(t,e){return e.weekdaysRegex(t)}),gt(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:f(n).invalidWeekday=t}),gt(["d","e","E"],function(t,e,n,i){e[i]=w(t)});var Et="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ht="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Bt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=c([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=bt.call(this._shortWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._minWeekdaysParse,o))?a:null:-1!==(a=bt.call(this._minWeekdaysParse,o))||-1!==(a=bt.call(this._weekdaysParse,o))||-1!==(a=bt.call(this._shortWeekdaysParse,o))?a:null}var jt=st,Ut=st,Gt=st;function qt(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=c([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ht(s[e]),l[e]=ht(l[e]),u[e]=ht(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Zt(){return this.hours()%12||12}function $t(t,e){B(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Xt(t,e){return e._meridiemParse}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,function(){return this.hours()||24}),B("hmm",0,0,function(){return""+Zt.apply(this)+Y(this.minutes(),2)}),B("hmmss",0,0,function(){return""+Zt.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),B("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),B("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),$t("a",!0),$t("A",!1),I("hour","h"),W("hour",13),ut("a",Xt),ut("A",Xt),ut("H",J),ut("h",J),ut("k",J),ut("HH",J,q),ut("hh",J,q),ut("kk",J,q),ut("hmm",K),ut("hmmss",Q),ut("Hmm",K),ut("Hmmss",Q),ft(["H","HH"],3),ft(["k","kk"],function(t,e,n){var i=w(t);e[3]=24===i?0:i}),ft(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ft(["h","hh"],function(t,e,n){e[3]=w(t),f(n).bigHour=!0}),ft("hmm",function(t,e,n){var i=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i)),f(n).bigHour=!0}),ft("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i,2)),e[5]=w(t.substr(a)),f(n).bigHour=!0}),ft("Hmm",function(t,e,n){var i=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i))}),ft("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[3]=w(t.substr(0,i)),e[4]=w(t.substr(i,2)),e[5]=w(t.substr(a))});var Jt,Kt=xt("Hours",!0),Qt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:St,monthsShort:Dt,week:{dow:0,doy:6},weekdays:Et,weekdaysMin:Ht,weekdaysShort:Vt,meridiemParse:/[ap]\.?m?\.?/i},te={},ee={};function ne(t){return t?t.toLowerCase().replace("_","-"):t}function ie(e){var n=null;if(!te[e]&&t&&t.exports)try{n=Jt._abbr,function(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}(),ae(n)}catch(i){}return te[e]}function ae(t,e){var n;return t&&((n=o(e)?oe(t):re(t,e))?Jt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Jt._abbr}function re(t,e){if(null!==e){var n,i=Qt;if(e.abbr=t,null!=te[t])P("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=te[t]._config;else if(null!=e.parentLocale)if(null!=te[e.parentLocale])i=te[e.parentLocale]._config;else{if(null==(n=ie(e.parentLocale)))return ee[e.parentLocale]||(ee[e.parentLocale]=[]),ee[e.parentLocale].push({name:t,config:e}),null;i=n._config}return te[t]=new A(O(i,e)),ee[t]&&ee[t].forEach(function(t){re(t.name,t.config)}),ae(t),te[t]}return delete te[t],null}function oe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Jt;if(!a(t)){if(e=ie(t))return e;t=[t]}return function(t){for(var e,n,i,a,r=0;r<t.length;){for(e=(a=ne(t[r]).split("-")).length,n=(n=ne(t[r+1]))?n.split("-"):null;e>0;){if(i=ie(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&k(a,n,!0)>=e-1)break;e--}r++}return Jt}(t)}function se(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[1]<0||n[1]>11?1:n[2]<1||n[2]>kt(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,f(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),f(t)._overflowWeeks&&-1===e&&(e=7),f(t)._overflowWeekday&&-1===e&&(e=8),f(t).overflow=e),t}function le(t,e,n){return null!=t?t:null!=e?e:n}function ue(t){var e,n,a,r,o,s=[];if(!t._d){for(a=function(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=le(e.GG,t._a[0],Wt(ke(),1,4).year),i=le(e.W,1),((a=le(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=Wt(ke(),r,o);n=le(e.gg,t._a[0],u.year),i=le(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>Yt(n,r,o)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(s=Nt(n,i,a,r,o),t._a[0]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=le(t._a[0],a[0]),(t._dayOfYear>pt(o)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=Lt(o,0,t._dayOfYear),t._a[1]=n.getUTCMonth(),t._a[2]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=a[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Lt:It).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}var de=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,he=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ce=/Z|[+-]\d\d(?::?\d\d)?/,fe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ge=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],me=/^\/?Date\((\-?\d+)/i;function pe(t){var e,n,i,a,r,o,s=t._i,l=de.exec(s)||he.exec(s);if(l){for(f(t).iso=!0,e=0,n=fe.length;e<n;e++)if(fe[e][1].exec(l[1])){a=fe[e][0],i=!1!==fe[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=ge.length;e<n;e++)if(ge[e][1].exec(l[3])){r=(l[2]||" ")+ge[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!ce.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),xe(t)}else t._isValid=!1}var ve=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;var be={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ye(t){var e,n,i,a,r,o,s,l,u=ve.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){var d=(e=u[3],n=u[2],i=u[5],a=u[6],r=u[7],o=[(s=u[4],l=parseInt(s,10),l<=49?2e3+l:l<=999?1900+l:l),Dt.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(a,10)],r&&o.push(parseInt(r,10)),o);if(!function(t,e,n){return!t||Vt.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],d,t))return;t._a=d,t._tzm=function(t,e,n){if(t)return be[t];if(e)return 0;var i=parseInt(n,10),a=i%100;return(i-a)/100*60+a}(u[8],u[9],u[10]),t._d=Lt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),f(t).rfc2822=!0}else t._isValid=!1}function xe(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],f(t).empty=!0;var e,n,a,r,o,s=""+t._i,l=s.length,u=0;for(a=U(t._f,t._locale).match(z)||[],e=0;e<a.length;e++)(n=(s.match(dt(r=a[e],t))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&f(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),H[r]?(n?f(t).empty=!1:f(t).unusedTokens.push(r),mt(r,n,t)):t._strict&&!n&&f(t).unusedTokens.push(r);f(t).charsLeftOver=l-u,s.length>0&&f(t).unusedInput.push(s),t._a[3]<=12&&!0===f(t).bigHour&&t._a[3]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[3]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),ue(t),se(t)}else ye(t);else pe(t)}function _e(t){var e=t._i,n=t._f;return t._locale=t._locale||oe(t._l),null===e||void 0===n&&""===e?m({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),x(e)?new y(se(e)):(l(e)?t._d=e:a(n)?function(t){var e,n,i,a,r;if(0===t._f.length)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],xe(e),g(e)&&(r+=f(e).charsLeftOver,r+=10*f(e).unusedTokens.length,f(e).score=r,(null==i||r<i)&&(i=r,n=e));h(t,n||e)}(t):n?xe(t):function(t){var e=t._i;o(e)?t._d=new Date(i.now()):l(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=me.exec(t._i);null===e?(pe(t),!1===t._isValid&&(delete t._isValid,ye(t),!1===t._isValid&&(delete t._isValid,i.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):a(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),ue(t)):r(e)?function(t){if(!t._d){var e=R(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),ue(t)}}(t):s(e)?t._d=new Date(e):i.createFromInputFallback(t)}(t),g(t)||(t._d=null),t))}function we(t,e,n,i,o){var s,l={};return!0!==n&&!1!==n||(i=n,n=void 0),(r(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||a(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=o,l._l=n,l._i=t,l._f=e,l._strict=i,(s=new y(se(_e(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function ke(t,e,n,i){return we(t,e,n,i,!1)}i.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),i.ISO_8601=function(){},i.RFC_2822=function(){};var Me=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:m()}),Se=S("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:m()});function De(t,e){var n,i;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return ke();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}var Ce=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Pe(t){var e=R(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||e.isoWeek||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===bt.call(Ce,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<Ce.length;++i)if(t[Ce[i]]){if(n)return!1;parseFloat(t[Ce[i]])!==w(t[Ce[i]])&&(n=!0)}return!0}(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=oe(),this._bubble()}function Te(t){return t instanceof Pe}function Oe(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Ae(t,e){B(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+Y(~~(t/60),2)+e+Y(~~t%60,2)})}Ae("Z",":"),Ae("ZZ",""),ut("Z",ot),ut("ZZ",ot),ft(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ie(ot,t)});var Fe=/([\+\-]|\d\d)/gi;function Ie(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Fe)||["-",0,0],a=60*i[1]+w(i[2]);return 0===a?0:"+"===i[0]?a:-a}function Le(t,e){var n,a;return e._isUTC?(n=e.clone(),a=(x(t)||l(t)?t.valueOf():ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),i.updateOffset(n,!1),n):ke(t).local()}function Re(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ne(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var We=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(t,e){var n,i,a,r,o,l,u=t,h=null;return Te(t)?u={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(u={},e?u[e]=t:u.milliseconds=t):(h=We.exec(t))?(n="-"===h[1]?-1:1,u={y:0,d:w(h[2])*n,h:w(h[3])*n,m:w(h[4])*n,s:w(h[5])*n,ms:w(Oe(1e3*h[6]))*n}):(h=Ye.exec(t))?u={y:Ee(h[2],n="-"===h[1]?-1:1),M:Ee(h[3],n),w:Ee(h[4],n),d:Ee(h[5],n),h:Ee(h[6],n),m:Ee(h[7],n),s:Ee(h[8],n)}:null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(r=ke(u.from),o=ke(u.to),a=r.isValid()&&o.isValid()?(o=Le(o,r),r.isBefore(o)?l=Ve(r,o):((l=Ve(o,r)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),i=new Pe(u),Te(t)&&d(t,"_locale")&&(i._locale=t._locale),i}function Ee(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ve(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function He(t,e){return function(n,i){var a;return null===i||isNaN(+i)||(P(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=i,i=a),Be(this,ze(n="string"==typeof n?+n:n,i),t),this}}function Be(t,e,n,a){var r=e._milliseconds,o=Oe(e._days),s=Oe(e._months);t.isValid()&&(a=null==a||a,s&&Pt(t,_t(t,"Month")+s*n),o&&wt(t,"Date",_t(t,"Date")+o*n),r&&t._d.setTime(t._d.valueOf()+r*n),a&&i.updateOffset(t,o||s))}ze.fn=Pe.prototype,ze.invalid=function(){return ze(NaN)};var je=He(1,"add"),Ue=He(-1,"subtract");function Ge(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,"months");return-(n+(e-i<0?(e-i)/(i-t.clone().add(n-1,"months")):(e-i)/(t.clone().add(n+1,"months")-i)))||0}function qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=oe(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ze=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});function $e(){return this._locale}var Xe=1e3,Je=6e4,Ke=36e5,Qe=126227808e5;function tn(t,e){return(t%e+e)%e}function en(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-Qe:new Date(t,e,n).valueOf()}function nn(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-Qe:Date.UTC(t,e,n)}function an(t,e){B(0,[t,t.length],0,e)}function rn(t,e,n,i,a){var r;return null==t?Wt(this,i,a).year:(e>(r=Yt(t,i,a))&&(e=r),on.call(this,t,e,n,i,a))}function on(t,e,n,i,a){var r=Nt(t,e,n,i,a),o=Lt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}B(0,["gg",2],0,function(){return this.weekYear()%100}),B(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),W("weekYear",1),W("isoWeekYear",1),ut("G",at),ut("g",at),ut("GG",J,q),ut("gg",J,q),ut("GGGG",et,$),ut("gggg",et,$),ut("GGGGG",nt,X),ut("ggggg",nt,X),gt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=w(t)}),gt(["gg","GG"],function(t,e,n,a){e[a]=i.parseTwoDigitYear(t)}),B("Q",0,"Qo","quarter"),I("quarter","Q"),W("quarter",7),ut("Q",G),ft("Q",function(t,e){e[1]=3*(w(t)-1)}),B("D",["DD",2],"Do","date"),I("date","D"),W("date",9),ut("D",J),ut("DD",J,q),ut("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ft(["D","DD"],2),ft("Do",function(t,e){e[2]=w(t.match(J)[0])});var sn=xt("Date",!0);B("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),W("dayOfYear",4),ut("DDD",tt),ut("DDDD",Z),ft(["DDD","DDDD"],function(t,e,n){n._dayOfYear=w(t)}),B("m",["mm",2],0,"minute"),I("minute","m"),W("minute",14),ut("m",J),ut("mm",J,q),ft(["m","mm"],4);var ln=xt("Minutes",!1);B("s",["ss",2],0,"second"),I("second","s"),W("second",15),ut("s",J),ut("ss",J,q),ft(["s","ss"],5);var un,dn=xt("Seconds",!1);for(B("S",0,0,function(){return~~(this.millisecond()/100)}),B(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,function(){return 10*this.millisecond()}),B(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),B(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),B(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),B(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),B(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),W("millisecond",16),ut("S",tt,G),ut("SS",tt,q),ut("SSS",tt,Z),un="SSSS";un.length<=9;un+="S")ut(un,it);function hn(t,e){e[6]=w(1e3*("0."+t))}for(un="S";un.length<=9;un+="S")ft(un,hn);var cn=xt("Milliseconds",!1);B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var fn=y.prototype;function gn(t){return t}fn.add=je,fn.calendar=function(t,e){var n=t||ke(),a=Le(n,this).startOf("day"),r=i.calendarFormat(this,a)||"sameElse",o=e&&(T(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,ke(n)))},fn.clone=function(){return new y(this)},fn.diff=function(t,e,n){var i,a,r;if(!this.isValid())return NaN;if(!(i=Le(t,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),e=L(e)){case"year":r=Ge(this,i)/12;break;case"month":r=Ge(this,i);break;case"quarter":r=Ge(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-a)/864e5;break;case"week":r=(this-i-a)/6048e5;break;default:r=this-i}return n?r:_(r)},fn.endOf=function(t){var e;if(void 0===(t=L(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?nn:en;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Ke-tn(e+(this._isUTC?0:this.utcOffset()*Je),Ke)-1;break;case"minute":e=this._d.valueOf(),e+=Je-tn(e,Je)-1;break;case"second":e=this._d.valueOf(),e+=Xe-tn(e,Xe)-1}return this._d.setTime(e),i.updateOffset(this,!0),this},fn.format=function(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=j(this,t);return this.localeData().postformat(e)},fn.from=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||ke(t).isValid())?ze({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.fromNow=function(t){return this.from(ke(),t)},fn.to=function(t,e){return this.isValid()&&(x(t)&&t.isValid()||ke(t).isValid())?ze({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.toNow=function(t){return this.to(ke(),t)},fn.get=function(t){return T(this[t=L(t)])?this[t]():this},fn.invalidAt=function(){return f(this).overflow},fn.isAfter=function(t,e){var n=x(t)?t:ke(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},fn.isBefore=function(t,e){var n=x(t)?t:ke(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},fn.isBetween=function(t,e,n,i){var a=x(t)?t:ke(t),r=x(e)?e:ke(e);return!!(this.isValid()&&a.isValid()&&r.isValid())&&("("===(i=i||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===i[1]?this.isBefore(r,n):!this.isAfter(r,n))},fn.isSame=function(t,e){var n,i=x(t)?t:ke(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=L(e)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},fn.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},fn.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},fn.isValid=function(){return g(this)},fn.lang=Ze,fn.locale=qe,fn.localeData=$e,fn.max=Se,fn.min=Me,fn.parsingFlags=function(){return h({},f(this))},fn.set=function(t,e){if("object"==typeof t)for(var n=function(t){var e=[];for(var n in t)e.push({unit:n,priority:N[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}(t=R(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(T(this[t=L(t)]))return this[t](e);return this},fn.startOf=function(t){var e;if(void 0===(t=L(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?nn:en;switch(t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=tn(e+(this._isUTC?0:this.utcOffset()*Je),Ke);break;case"minute":e=this._d.valueOf(),e-=tn(e,Je);break;case"second":e=this._d.valueOf(),e-=tn(e,Xe)}return this._d.setTime(e),i.updateOffset(this,!0),this},fn.subtract=Ue,fn.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},fn.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},fn.toDate=function(){return new Date(this.valueOf())},fn.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?j(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",j(n,"Z")):j(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},fn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY";return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+e+'[")]')},fn.toJSON=function(){return this.isValid()?this.toISOString():null},fn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},fn.unix=function(){return Math.floor(this.valueOf()/1e3)},fn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},fn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},fn.year=yt,fn.isLeapYear=function(){return vt(this.year())},fn.weekYear=function(t){return rn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},fn.isoWeekYear=function(t){return rn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},fn.quarter=fn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},fn.month=Tt,fn.daysInMonth=function(){return kt(this.year(),this.month())},fn.week=fn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},fn.isoWeek=fn.isoWeeks=function(t){var e=Wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},fn.weeksInYear=function(){var t=this.localeData()._week;return Yt(this.year(),t.dow,t.doy)},fn.isoWeeksInYear=function(){return Yt(this.year(),1,4)},fn.date=sn,fn.day=fn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},fn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},fn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},fn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},fn.hour=fn.hours=Kt,fn.minute=fn.minutes=ln,fn.second=fn.seconds=dn,fn.millisecond=fn.milliseconds=cn,fn.utcOffset=function(t,e,n){var a,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ie(ot,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(a=Re(this)),this._offset=t,this._isUTC=!0,null!=a&&this.add(a,"m"),r!==t&&(!e||this._changeInProgress?Be(this,ze(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Re(this)},fn.utc=function(t){return this.utcOffset(0,t)},fn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Re(this),"m")),this},fn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ie(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},fn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?ke(t).utcOffset():0,(this.utcOffset()-t)%60==0)},fn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},fn.isLocal=function(){return!!this.isValid()&&!this._isUTC},fn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},fn.isUtc=Ne,fn.isUTC=Ne,fn.zoneAbbr=function(){return this._isUTC?"UTC":""},fn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},fn.dates=S("dates accessor is deprecated. Use date instead.",sn),fn.months=S("months accessor is deprecated. Use month instead",Tt),fn.years=S("years accessor is deprecated. Use year instead",yt),fn.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),fn.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=_e(t))._a){var e=t._isUTC?c(t._a):ke(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var mn=A.prototype;function pn(t,e,n,i){var a=oe(),r=c().set(i,e);return a[n](r,t)}function vn(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return pn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=pn(t,i,n,"month");return a}function bn(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var a,r=oe(),o=t?r._week.dow:0;if(null!=n)return pn(e,(n+o)%7,i,"day");var l=[];for(a=0;a<7;a++)l[a]=pn(e,(a+o)%7,i,"day");return l}mn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return T(i)?i.call(e,n):i},mn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},mn.invalidDate=function(){return this._invalidDate},mn.ordinal=function(t){return this._ordinal.replace("%d",t)},mn.preparse=gn,mn.postformat=gn,mn.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return T(a)?a(t,e,n,i):a.replace(/%d/i,t)},mn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return T(n)?n(e):n.replace(/%s/i,e)},mn.set=function(t){var e,n;for(n in t)T(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},mn.months=function(t,e){return t?a(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Mt).test(e)?"format":"standalone"][t.month()]:a(this._months)?this._months:this._months.standalone},mn.monthsShort=function(t,e){return t?a(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Mt.test(e)?"format":"standalone"][t.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},mn.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return Ct.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=c([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},mn.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=At),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},mn.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||Ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Ot),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},mn.week=function(t){return Wt(t,this._week.dow,this._week.doy).week},mn.firstDayOfYear=function(){return this._week.doy},mn.firstDayOfWeek=function(){return this._week.dow},mn.weekdays=function(t,e){var n=a(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?zt(n,this._week.dow):t?n[t.day()]:n},mn.weekdaysMin=function(t){return!0===t?zt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},mn.weekdaysShort=function(t){return!0===t?zt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},mn.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Bt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=c([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},mn.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=jt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},mn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ut),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},mn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},mn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},mn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ae("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=S("moment.lang is deprecated. Use moment.locale instead.",ae),i.langData=S("moment.langData is deprecated. Use moment.localeData instead.",oe);var yn=Math.abs;function xn(t,e,n,i){var a=ze(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function _n(t){return t<0?Math.floor(t):Math.ceil(t)}function wn(t){return 4800*t/146097}function kn(t){return 146097*t/4800}function Mn(t){return function(){return this.as(t)}}var Sn=Mn("ms"),Dn=Mn("s"),Cn=Mn("m"),Pn=Mn("h"),Tn=Mn("d"),On=Mn("w"),An=Mn("M"),Fn=Mn("Q"),In=Mn("y");function Ln(t){return function(){return this.isValid()?this._data[t]:NaN}}var Rn=Ln("milliseconds"),Nn=Ln("seconds"),Wn=Ln("minutes"),Yn=Ln("hours"),zn=Ln("days"),En=Ln("months"),Vn=Ln("years"),Hn=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,M:11};function jn(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}var Un=Math.abs;function Gn(t){return(t>0)-(t<0)||+t}function qn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=Un(this._milliseconds)/1e3,i=Un(this._days),a=Un(this._months);t=_(n/60),e=_(t/60),n%=60,t%=60;var r=_(a/12),o=a%=12,s=i,l=e,u=t,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Gn(this._months)!==Gn(h)?"-":"",g=Gn(this._days)!==Gn(h)?"-":"",m=Gn(this._milliseconds)!==Gn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var Zn=Pe.prototype;return Zn.isValid=function(){return this._isValid},Zn.abs=function(){var t=this._data;return this._milliseconds=yn(this._milliseconds),this._days=yn(this._days),this._months=yn(this._months),t.milliseconds=yn(t.milliseconds),t.seconds=yn(t.seconds),t.minutes=yn(t.minutes),t.hours=yn(t.hours),t.months=yn(t.months),t.years=yn(t.years),this},Zn.add=function(t,e){return xn(this,t,e,1)},Zn.subtract=function(t,e){return xn(this,t,e,-1)},Zn.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=L(t))||"quarter"===t||"year"===t)switch(n=this._months+wn(e=this._days+i/864e5),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(kn(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},Zn.asMilliseconds=Sn,Zn.asSeconds=Dn,Zn.asMinutes=Cn,Zn.asHours=Pn,Zn.asDays=Tn,Zn.asWeeks=On,Zn.asMonths=An,Zn.asQuarters=Fn,Zn.asYears=In,Zn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN},Zn._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*_n(kn(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=_(r/1e3),l.seconds=t%60,e=_(t/60),l.minutes=e%60,n=_(e/60),l.hours=n%24,o+=_(n/24),s+=a=_(wn(o)),o-=_n(kn(a)),i=_(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},Zn.clone=function(){return ze(this)},Zn.get=function(t){return t=L(t),this.isValid()?this[t+"s"]():NaN},Zn.milliseconds=Rn,Zn.seconds=Nn,Zn.minutes=Wn,Zn.hours=Yn,Zn.days=zn,Zn.weeks=function(){return _(this.days()/7)},Zn.months=En,Zn.years=Vn,Zn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var i=ze(t).abs(),a=Hn(i.as("s")),r=Hn(i.as("m")),o=Hn(i.as("h")),s=Hn(i.as("d")),l=Hn(i.as("M")),u=Hn(i.as("y")),d=a<=Bn.ss&&["s",a]||a<Bn.s&&["ss",a]||r<=1&&["m"]||r<Bn.m&&["mm",r]||o<=1&&["h"]||o<Bn.h&&["hh",o]||s<=1&&["d"]||s<Bn.d&&["dd",s]||l<=1&&["M"]||l<Bn.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=e,d[3]=+t>0,d[4]=n,jn.apply(null,d)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},Zn.toISOString=qn,Zn.toString=qn,Zn.toJSON=qn,Zn.locale=qe,Zn.localeData=$e,Zn.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qn),Zn.lang=Ze,B("X",0,0,"unix"),B("x",0,0,"valueOf"),ut("x",at),ut("X",/[+-]?\d+(\.\d{1,3})?/),ft("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),ft("x",function(t,e,n){n._d=new Date(w(t))}),i.version="2.24.0",e=ke,i.fn=fn,i.min=function(){return De("isBefore",[].slice.call(arguments,0))},i.max=function(){return De("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=c,i.unix=function(t){return ke(1e3*t)},i.months=function(t,e){return vn(t,e,"months")},i.isDate=l,i.locale=ae,i.invalid=m,i.duration=ze,i.isMoment=x,i.weekdays=function(t,e,n){return bn(t,e,n,"weekdays")},i.parseZone=function(){return ke.apply(null,arguments).parseZone()},i.localeData=oe,i.isDuration=Te,i.monthsShort=function(t,e){return vn(t,e,"monthsShort")},i.weekdaysMin=function(t,e,n){return bn(t,e,n,"weekdaysMin")},i.defineLocale=re,i.updateLocale=function(t,e){if(null!=e){var n,i,a=Qt;null!=(i=ie(t))&&(a=i._config),(n=new A(e=O(a,e))).parentLocale=te[t],te[t]=n,ae(t)}else null!=te[t]&&(null!=te[t].parentLocale?te[t]=te[t].parentLocale:null!=te[t]&&delete te[t]);return te[t]},i.locales=function(){return D(te)},i.weekdaysShort=function(t,e,n){return bn(t,e,n,"weekdaysShort")},i.normalizeUnits=L,i.relativeTimeRounding=function(t){return void 0===t?Hn:"function"==typeof t&&(Hn=t,!0)},i.relativeTimeThreshold=function(t,e){return void 0!==Bn[t]&&(void 0===e?Bn[t]:(Bn[t]=e,"s"===t&&(Bn.ss=e-1),!0))},i.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=fn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()}),Zn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};je._date.override("function"==typeof qn?{_id:"moment",formats:function(){return Zn},parse:function(t,e){return"string"==typeof t&&"string"==typeof e?t=qn(t,e):t instanceof qn||(t=qn(t)),t.isValid()?t.valueOf():null},format:function(t,e){return qn(t).format(e)},add:function(t,e,n){return qn(t).add(e,n).valueOf()},diff:function(t,e,n){return qn(t).diff(qn(e),n)},startOf:function(t,e,n){return t=qn(t),"isoWeek"===e?t.isoWeekday(n).valueOf():t.startOf(e).valueOf()},endOf:function(t,e){return qn(t).endOf(e).valueOf()},_create:function(t){return qn(t)}}:{}),N._set("global",{plugins:{filler:{propagate:!0}}});var $n={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return V.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function Xn(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function Jn(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e=s.ticks.reverse?o.max:o.min),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),d.push(r);return d}(t):function(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(V.isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}(t)}function Kn(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function Qn(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),$n[n](t))}function ti(t){return t&&!t.skip}function ei(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)V.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)V.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function ni(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,m=i.spanGaps,p=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o<s;++o)d=n(u=e[l=o%g]._view,l,i),h=ti(u),c=ti(d),r&&void 0===f&&h&&(s=g+(f=o+1)),h&&c?(b=p.push(u),y=v.push(d)):b&&y&&(m?(h&&p.push(u),c&&v.push(d)):(ei(t,p,v,b,y),b=y=0,p=[],v=[]));ei(t,p,v,b,y),t.closePath(),t.fillStyle=a,t.fill()}var ii={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof vt.Line&&(r={visible:t.isDatasetVisible(i),fill:Xn(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)(r=l[i])&&(r.fill=Kn(l,i,s),r.boundary=Jn(r),r.mapper=Qn(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)(e=l[n].$filler)&&e.visible&&(r=(i=e.el)._children||[],s=(a=i._view).backgroundColor||N.global.defaultColor,(o=e.mapper)&&s&&r.length&&(V.canvas.clipArea(u,t.chartArea),ni(u,r,o,a,s,i._loop),V.canvas.unclipArea(u)))}},ai=V.rtl.getRtlAdapter,ri=V.noop,oi=V.valueOrDefault;function si(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}N._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map(function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;e<n;e++)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[e].backgroundColor,r[e].label&&i.appendChild(document.createTextNode(r[e].label));return a.outerHTML}});var li=G.extend({initialize:function(t){var e=this;V.extend(e,t),e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1},beforeUpdate:ri,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ri,beforeSetDimensions:ri,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ri,beforeBuildLabels:ri,buildLabels:function(){var t=this,e=t.options.labels||{},n=V.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:ri,beforeFit:ri,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=V.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var d=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="middle",V.each(t.legendItems,function(t,e){var i=si(n,o)+o/2+a.measureText(t.text).width;(0===e||d[d.length-1]+i+2*n.padding>l.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding}),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],m=n.padding,p=0,v=0;V.each(t.legendItems,function(t,e){var i=si(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(m+=p+n.padding,f.push(p),g.push(v),p=0,v=0),p=Math.max(p,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}}),m+=p,f.push(p),g.push(v),l.width+=m}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:ri,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=N.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=ai(e.rtl,t.left,t.minSize.width),c=t.ctx,f=oi(n.fontColor,i.defaultFontColor),g=V.options._parseFont(n),m=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var p=si(n,m),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},y=t.isHorizontal();d=y?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},V.rtl.overrideTextDirection(t.ctx,e.textDirection);var x=m+n.padding;V.each(t.legendItems,function(e,i){var f=c.measureText(e.text).width,g=p+m/2+f,_=d.x,w=d.y;h.setWidth(t.minSize.width),y?i>0&&_+g+n.padding>t.left+t.minSize.width&&(w=d.y+=x,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&w+x>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,w=d.y=t.top+b(o,s[d.line]));var k=h.x(_);!function(t,e,i){if(!(isNaN(p)||p<=0)){c.save();var o=oi(i.lineWidth,r.borderWidth);if(c.fillStyle=oi(i.fillStyle,a),c.lineCap=oi(i.lineCap,r.borderCapStyle),c.lineDashOffset=oi(i.lineDashOffset,r.borderDashOffset),c.lineJoin=oi(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=oi(i.strokeStyle,a),c.setLineDash&&c.setLineDash(oi(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=p*Math.SQRT2/2,l=h.xPlus(t,p/2);V.canvas.drawPoint(c,i.pointStyle,s,l,e+m/2,i.rotation)}else c.fillRect(h.leftForLtr(t,p),e,p,m),0!==o&&c.strokeRect(h.leftForLtr(t,p),e,p,m);c.restore()}}(k,w,e),v[i].left=h.leftForLtr(k,v[i].width),v[i].top=w,function(t,e,n,i){var a=m/2,r=h.xPlus(t,p+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(k,w,e,f),y?d.x+=g+n.padding:d.y+=x}),V.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(t>=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function ui(t,e){var n=new li({ctx:t.ctx,options:e,chart:t});le.configure(t,n,e),le.addBox(t,n),t.legend=n}var di={id:"legend",_element:li,beforeInit:function(t){var e=t.options.legend;e&&ui(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(V.mergeIf(e,N.global.legend),n?(le.configure(t,n,e),n.options=e):ui(t,e)):n&&(le.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},hi=V.noop;N._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var ci=G.extend({initialize:function(t){V.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:hi,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:hi,beforeSetDimensions:hi,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:hi,beforeBuildLabels:hi,buildLabels:hi,afterBuildLabels:hi,beforeFit:hi,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(V.isArray(n.text)?n.text.length:1)*V.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:hi,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=V.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=V.valueOrDefault(n.fontColor,N.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(V.isArray(g))for(var m=0,p=0;p<g.length;++p)e.fillText(g[p],0,m,i),m+=s;else e.fillText(g,0,0,i);e.restore()}}});function fi(t,e){var n=new ci({ctx:t.ctx,options:e,chart:t});le.configure(t,n,e),le.addBox(t,n),t.titleBlock=n}var gi={},mi=ii,pi=di,vi={id:"title",_element:ci,beforeInit:function(t){var e=t.options.title;e&&fi(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(V.mergeIf(e,N.global.title),n?(le.configure(t,n,e),n.options=e):fi(t,e)):n&&(le.removeBox(t,n),delete t.titleBlock)}};for(var bi in gi.filler=mi,gi.legend=pi,gi.title=vi,Ve.helpers=V,function(){function t(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return null!=t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=V._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),d=e(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?t(s,n,a):h,d?t(l,o,a):h):"none"}V.where=function(t,e){if(V.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return V.each(t,function(t){e(t)&&n.push(t)}),n},V.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},V.findNextWhere=function(t,e,n){V.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},V.findPreviousWhere=function(t,e,n){V.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},V.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},V.almostEquals=function(t,e,n){return Math.abs(t-e)<n},V.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},V.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},V.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},V.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},V.toRadians=function(t){return t*(Math.PI/180)},V.toDegrees=function(t){return t*(180/Math.PI)},V._decimalPlaces=function(t){if(V.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},V.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},V.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},V.aliasPixel=function(t){return t%2==0?0:.5},V._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},V.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},V.EPSILON=Number.EPSILON||1e-14,V.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=e>0?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}i.mK=!n||n.model.skip?i.deltaK:!a||a.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?0:(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)a=d[e+1],(i=d[e]).model.skip||a.model.skip||(V.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(a=e<h-1?d[e+1]:null,(n=e>0?d[e-1]:null)&&!n.model.skip&&(i.model.controlPointPreviousX=i.model.x-(u=(i.model.x-n.model.x)/3),i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(i.model.controlPointNextX=i.model.x+(u=(a.model.x-i.model.x)/3),i.model.controlPointNextY=i.model.y+u*i.mK))},V.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},V.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},V.niceNum=function(t,e){var n=Math.floor(V.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},V.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},V.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(V.getStyle(r,"padding-left")),u=parseFloat(V.getStyle(r,"padding-top")),d=parseFloat(V.getStyle(r,"padding-right")),h=parseFloat(V.getStyle(r,"padding-bottom")),c=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/(o.right-o.left-l-d)*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/c*r.height/e.currentDevicePixelRatio)}},V.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},V.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},V._calculatePadding=function(t,e,n){return(e=V.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},V._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},V.getMaximumWidth=function(t){var e=V._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-V._calculatePadding(e,"padding-left",n)-V._calculatePadding(e,"padding-right",n),a=V.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},V.getMaximumHeight=function(t){var e=V._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-V._calculatePadding(e,"padding-top",n)-V._calculatePadding(e,"padding-bottom",n),a=V.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},V.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},V.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},V.fontString=function(t,e,n){return e+" "+t+"px "+n},V.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;o<c;o++)if(null!=(u=n[o])&&!0!==V.isArray(u))h=V.measureText(t,a,r,h,u);else if(V.isArray(u))for(s=0,l=u.length;s<l;s++)null==(d=u[s])||V.isArray(d)||(h=V.measureText(t,a,r,h,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return h},V.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},V.numberOfLabelLines=function(t){var e=1;return V.each(t,function(t){V.isArray(t)&&t.length>e&&(e=t.length)}),e},V.color=x?function(t){return t instanceof CanvasGradient&&(t=N.global.defaultColor),x(t)}:function(t){return console.error("Color.js not found!"),t},V.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:V.color(t).saturate(.5).darken(.1).rgbString()}}(),Ve._adapters=je,Ve.Animation=Z,Ve.animationService=$,Ve.controllers=Ut,Ve.DatasetController=tt,Ve.defaults=N,Ve.Element=G,Ve.elements=vt,Ve.Interaction=Kt,Ve.layouts=le,Ve.platform=_e,Ve.plugins=we,Ve.Scale=rn,Ve.scaleService=ke,Ve.Ticks=Ue,Ve.Tooltip=Fe,Ve.helpers.each(Gn,function(t,e){Ve.scaleService.registerScaleType(e,t,t._defaults)}),gi)gi.hasOwnProperty(bi)&&Ve.plugins.register(gi[bi]);Ve.platform.initialize();var yi=Ve;return"undefined"!=typeof window&&(window.Chart=Ve),Ve.Chart=Ve,Ve.Legend=gi.legend._element,Ve.Title=gi.title._element,Ve.pluginService=Ve.plugins,Ve.PluginBase=Ve.Element.extend({}),Ve.canvasHelpers=Ve.helpers.canvas,Ve.layoutService=Ve.layouts,Ve.LinearScaleBase=un,Ve.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(t){Ve[t]=function(e,n){return new Ve(e,Ve.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}}),yi});
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.0520b6222fe6dab25bab.css b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.0520b6222fe6dab25bab.css
new file mode 100644 (file)
index 0000000..0fac726
--- /dev/null
@@ -0,0 +1,19 @@
+@charset "UTF-8";.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #fff}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:#0000;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px 3px 3px 3px;background-position:15px;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z'/%3E%3C/svg%3E")}.toast-error{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z'/%3E%3C/svg%3E")}.toast-success{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z'/%3E%3C/svg%3E")}.toast-warning{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512' width='576' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z'/%3E%3C/svg%3E")}.toast-container.toast-bottom-center .ngx-toastr,.toast-container.toast-top-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-bottom-full-width .ngx-toastr,.toast-container.toast-top-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media (max-width:240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media (min-width:241px) and (max-width:480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media (min-width:481px) and (max-width:768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}}.tree-children.tree-children-no-padding{padding-left:0}.tree-children{overflow:hidden}.node-drop-slot{display:block;height:2px}.node-drop-slot.is-dragging-over{background:#dfe;height:20px;border:2px dotted #888}.toggle-children-wrapper-expanded .toggle-children{transform:rotate(90deg)}.toggle-children-wrapper-collapsed .toggle-children{transform:rotate(0)}.toggle-children-wrapper{padding:2px 3px 5px 1px}.toggle-children{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ1dWlkOjY1RTYzOTA2ODZDRjExREJBNkUyRDg4N0NFQUNCNDA3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkYzRkRFQjcxODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkYzRkRFQjcwODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTk5NzA1OGEtZDI3OC00NDZkLWE4ODgtNGM4MGQ4YWI1NzNmIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzRkZmQxMGMtY2NlNS0xMTc4LWE5OGQtY2NkZmM5ODk5YWYwIi8+IDxkYzp0aXRsZT4gPHJkZjpBbHQ+IDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+Z2x5cGhpY29uczwvcmRmOmxpPiA8L3JkZjpBbHQ+IDwvZGM6dGl0bGU+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5iogFwAAAGhJREFUeNpiYGBgKABigf///zOQg0EARH4A4gZyDIIZ8B/JoAJKDIDhB0CcQIkBRBtEyABkgxwoMQCGD6AbRKoBGAYxQgXIBRuZGKgAKPIC3QLxArnRSHZCIjspk52ZKMrOFBUoAAEGAKnq593MQAZtAAAAAElFTkSuQmCC");height:8px;width:9px;background-size:contain;background-repeat:no-repeat;background-position:50%}.toggle-children,.toggle-children-placeholder{display:inline-block;position:relative;top:1px}.toggle-children-placeholder{height:10px;width:10px;padding-right:3px}.node-content-wrapper{display:inline-block;padding:2px 5px;border-radius:2px;transition:background-color .15s,box-shadow .15s}.node-wrapper{display:flex;align-items:flex-start}.node-content-wrapper-active,.node-content-wrapper-active.node-content-wrapper-focused,.node-content-wrapper.node-content-wrapper-active:hover{background:#beebff}.node-content-wrapper-focused{background:#e7f4f9}.node-content-wrapper:hover{background:#f7fbff}.node-content-wrapper-active,.node-content-wrapper-focused,.node-content-wrapper:hover{box-shadow:inset 0 0 1px #999}.node-content-wrapper.is-dragging-over{background:#dfe;box-shadow:inset 0 0 1px #999}.node-content-wrapper.is-dragging-over-disabled{opacity:.5}tree-viewport{-webkit-tap-highlight-color:transparent;height:100%;overflow:auto;display:block}.tree-children{padding-left:20px}.empty-tree-drop-slot .node-drop-slot{height:20px;min-width:100px}.angular-tree-component{width:100%;position:relative;display:inline-block;cursor:pointer;-webkit-touch-callout:none;user-select:none}tree-root .angular-tree-component-rtl{direction:rtl}tree-root .angular-tree-component-rtl .toggle-children-wrapper-collapsed .toggle-children{transform:rotate(180deg)!important}tree-root .angular-tree-component-rtl .tree-children{padding-right:20px;padding-left:0}tree-node-checkbox{padding:1px}:root{--gray-100:#f8f9fa;--gray-200:#e9ecef;--gray-300:#dee2e6;--gray-400:#ced4da;--gray-500:#adb5bd;--gray-600:#6c757d;--gray-700:#495057;--gray-800:#343a40;--gray-900:#212529;--black:#000;--barley-white:#fcecba;--fg-color-over-dark-bg:#fff;--fg-hover-color-over-dark-bg:#adb5bd;--body-color-bright:#f8f9fa;--body-bg:#fff;--body-color:#212529;--body-bg-alt:#e9ecef;--health-color-error:red;--health-color-healthy:#0b0;--health-color-warning:orange;--chart-color-red:#c9190b;--chart-color-blue:#06c;--chart-color-orange:#ef9234;--chart-color-yellow:#f6d173;--chart-color-green:#7cc674;--chart-color-gray:#ededed;--chart-color-cyan:#73c5c5;--chart-color-purple:#3c3d99;--chart-color-center-text:#151515;--chart-color-center-text-description:#72767b;--chart-color-tooltip-background:#000;--card-cap-bg:#f8f9fa;--grid-gutter-width:30px;--datatable-divider-color:#00000017;--nav-tabs-margin-bottom:1rem;--tooltip-color:#fff;--tooltip-bg:#212529;--screen-sm-min:576px;--screen-md-min:768px;--screen-lg-min:992px;--screen-xl-min:1200px;--screen-xs-max:calc(576px - 1px);--screen-sm-max:calc(768px - 1px);--screen-md-max:calc(992px - 1px);--screen-lg-max:calc(1200px - 1px);--navbar-height:43px;--top-notification-height:37.6px;--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#a94442;--red:#ef5c55;--orange:#fd7e14;--yellow:#ffc200;--green:#0b0;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#2b99a8;--secondary:#374249;--success:#0b0;--info:#2b99a8;--warning:#ffc200;--danger:#ef5c55;--light:#f8f9fa;--dark:#777;--accent:#ef5c55;--warning-dark:#fd7e14;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--breakpoint-2xl:1450px;--font-family-sans-serif:"Helvetica Neue",Helvetica,Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}
+/*!
+ * Bootstrap v4.5.2 (https://getbootstrap.com/)
+ * Copyright 2011-2020 The Bootstrap Authors
+ * Copyright 2011-2020 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
+ */*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:initial;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}a{color:#2b99a8;text-decoration:none;background-color:initial}a:hover{color:#1b626b;text-decoration:underline}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{border-style:none}img,svg{vertical-align:middle}svg{overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:initial}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid #0000001a}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"— "}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#a94442;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row,cd-about dl{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.cd-col-form,.cd-col-form-input,.cd-col-form-label,.cd-col-form-offset,.col,.col-1,.col-2,.col-2xl,.col-2xl-1,.col-2xl-2,.col-2xl-3,.col-2xl-4,.col-2xl-5,.col-2xl-6,.col-2xl-7,.col-2xl-8,.col-2xl-9,.col-2xl-10,.col-2xl-11,.col-2xl-12,.col-2xl-auto,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto,cd-about dd,cd-about dt,cd-health cd-info-card,cd-health cd-info-card.cd-capacity-card,cd-health cd-info-card.cd-chart-card,cd-health cd-info-card.cd-performance-card,cd-health cd-info-card.cd-status-card,cd-modal .cd-col-form-input,cd-modal .cd-col-form-label,cd-modal .cd-col-form-offset{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-1>*{flex:0 0 100%;max-width:100%}.row-cols-2>*{flex:0 0 50%;max-width:50%}.row-cols-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-4>*{flex:0 0 25%;max-width:25%}.row-cols-5>*{flex:0 0 20%;max-width:20%}.row-cols-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-auto{flex:0 0 auto;width:auto;max-width:100%}.col-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-3{flex:0 0 25%;max-width:25%}.col-4,cd-about dt{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-8,cd-about dd{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.cd-col-form,.col-12,cd-health cd-info-card{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}@media (min-width:576px){.col-sm{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-sm-1>*{flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-sm-4>*{flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-sm-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-3{flex:0 0 25%;max-width:25%}.cd-col-form-label,.col-sm-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-sm-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form-input,.cd-col-form-offset,.col-sm-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-sm-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-sm-12,cd-health cd-info-card{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.cd-col-form-offset,.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}}@media (min-width:768px){.col-md{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-md-1>*{flex:0 0 100%;max-width:100%}.row-cols-md-2>*{flex:0 0 50%;max-width:50%}.row-cols-md-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-md-4>*{flex:0 0 25%;max-width:25%}.row-cols-md-5>*{flex:0 0 20%;max-width:20%}.row-cols-md-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-auto{flex:0 0 auto;width:auto;max-width:100%}.col-md-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-3{flex:0 0 25%;max-width:25%}.cd-col-form-label,.col-md-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-md-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6,cd-health cd-info-card{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form-input,.cd-col-form-offset,.col-md-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-md-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-md-12,cd-health cd-info-card.cd-chart-card{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}}@media (min-width:992px){.col-lg{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-lg-1>*{flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-lg-4>*{flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-lg-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.cd-col-form-label,.col-lg-3,cd-health cd-info-card.cd-capacity-card{flex:0 0 25%;max-width:25%}.col-lg-4,cd-health cd-info-card,cd-modal .cd-col-form-label{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-lg-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-lg-6,cd-health cd-info-card.cd-chart-card,cd-health cd-info-card.cd-performance-card{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form,.col-lg-8,cd-modal .cd-col-form-input,cd-modal .cd-col-form-offset{flex:0 0 66.6666666667%;max-width:66.6666666667%}.cd-col-form-input,.cd-col-form-offset,.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-lg-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.cd-col-form-offset,.offset-lg-3{margin-left:25%}.offset-lg-4,cd-modal .cd-col-form-offset{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}}@media (min-width:1200px){.col-xl,cd-health cd-info-card.cd-capacity-card,cd-health cd-info-card.cd-performance-card{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-xl-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-3,cd-health cd-info-card.cd-status-card{flex:0 0 25%;max-width:25%}.col-xl-4,cd-health cd-info-card.cd-chart-card{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-xl-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.cd-col-form,.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-xl-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-xl-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}}@media (min-width:1450px){.col-2xl{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-2xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-2xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-2xl-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-2xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-2xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-2xl-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-2xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-2xl-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2xl-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-2xl-3,cd-health cd-info-card.cd-chart-card{flex:0 0 25%;max-width:25%}.col-2xl-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-2xl-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-2xl-6{flex:0 0 50%;max-width:50%}.col-2xl-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-2xl-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-2xl-9{flex:0 0 75%;max-width:75%}.col-2xl-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-2xl-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-2xl-12{flex:0 0 100%;max-width:100%}.order-2xl-first{order:-1}.order-2xl-last{order:13}.order-2xl-0{order:0}.order-2xl-1{order:1}.order-2xl-2{order:2}.order-2xl-3{order:3}.order-2xl-4{order:4}.order-2xl-5{order:5}.order-2xl-6{order:6}.order-2xl-7{order:7}.order-2xl-8{order:8}.order-2xl-9{order:9}.order-2xl-10{order:10}.order-2xl-11{order:11}.order-2xl-12{order:12}.offset-2xl-0{margin-left:0}.offset-2xl-1{margin-left:8.3333333333%}.offset-2xl-2{margin-left:16.6666666667%}.offset-2xl-3{margin-left:25%}.offset-2xl-4{margin-left:33.3333333333%}.offset-2xl-5{margin-left:41.6666666667%}.offset-2xl-6{margin-left:50%}.offset-2xl-7{margin-left:58.3333333333%}.offset-2xl-8{margin-left:66.6666666667%}.offset-2xl-9{margin-left:75%}.offset-2xl-10{margin-left:83.3333333333%}.offset-2xl-11{margin-left:91.6666666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:#0000000d}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#c4e2e7}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#91cad2}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#b2d9e0}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#c7cacc}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#979da0}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#babdc0}.table-success,.table-success>td,.table-success>th{background-color:#b8ecb8}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#7adc7a}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#a4e7a4}.table-info,.table-info>td,.table-info>th{background-color:#c4e2e7}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#91cad2}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#b2d9e0}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeb8}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7a}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe89f}.table-danger,.table-danger>td,.table-danger>th{background-color:#fbd1cf}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#f7aaa7}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f9bab7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#d9d9d9}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#b8b8b8}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#ccc}.table-accent,.table-accent>td,.table-accent>th{background-color:#fbd1cf}.table-accent tbody+tbody,.table-accent td,.table-accent th,.table-accent thead th{border-color:#f7aaa7}.table-hover .table-accent:hover,.table-hover .table-accent:hover>td,.table-hover .table-accent:hover>th{background-color:#f9bab7}.table-warning-dark,.table-warning-dark>td,.table-warning-dark>th{background-color:#fedbbd}.table-warning-dark tbody+tbody,.table-warning-dark td,.table-warning-dark th,.table-warning-dark thead th{border-color:#febc85}.table-hover .table-warning-dark:hover,.table-hover .table-warning-dark:hover>td,.table-hover .table-warning-dark:hover>th{background-color:#fecda4}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:#ffffff0d}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:hsla(0,0%,100%,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}@media (max-width:1449.98px){.table-responsive-2xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-2xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.cd-form-control,.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.cd-form-control,.form-control{transition:none}}.cd-form-control::-ms-expand,.form-control::-ms-expand{background-color:initial;border:0}.cd-form-control:-moz-focusring,.form-control:-moz-focusring{color:#0000;text-shadow:0 0 0 #495057}.cd-form-control:focus,.form-control:focus{color:#495057;background-color:#fff;border-color:#76d0dc;box-shadow:0 0 0 .2rem #2b99a840}.cd-form-control::placeholder,.form-control::placeholder{color:#6c757d;opacity:1}.cd-form-control:disabled,.form-control:disabled,.form-control[readonly],[readonly].cd-form-control{background-color:#e9ecef;opacity:1}input[type=date].cd-form-control,input[type=date].form-control,input[type=datetime-local].cd-form-control,input[type=datetime-local].form-control,input[type=month].cd-form-control,input[type=month].form-control,input[type=time].cd-form-control,input[type=time].form-control{-moz-appearance:none;appearance:none}select.cd-form-control:focus::-ms-value,select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.cd-col-form-label,.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:initial;border:solid #0000;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size],select[multiple].cd-form-control,select[size].cd-form-control,textarea.cd-form-control,textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:flex;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:inline-flex;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:100%;color:#0b0}.valid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:#00bb00e6;border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.is-valid.cd-form-control,.was-validated .cd-form-control:valid,.was-validated .form-control:valid{border-color:#0b0;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%230b0' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.is-valid.cd-form-control:focus,.was-validated .cd-form-control:valid:focus,.was-validated .form-control:valid:focus{border-color:#0b0;box-shadow:0 0 0 .2rem #00bb0040}.was-validated textarea.cd-form-control:valid,.was-validated textarea.form-control:valid,textarea.form-control.is-valid,textarea.is-valid.cd-form-control{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#0b0;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%230b0' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#0b0;box-shadow:0 0 0 .2rem #00bb0040}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#0b0}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#0b0}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{border-color:#0b0}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{border-color:#0e0;background-color:#0e0}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem #00bb0040}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#0b0}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#0b0;box-shadow:0 0 0 .2rem #00bb0040}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:100%;color:#ef5c55}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:#ef5c55e6;border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.is-invalid.cd-form-control,.was-validated .cd-form-control:invalid,.was-validated .form-control:invalid{border-color:#ef5c55;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ef5c55' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c55' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.is-invalid.cd-form-control:focus,.was-validated .cd-form-control:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#ef5c55;box-shadow:0 0 0 .2rem #ef5c5540}.was-validated textarea.cd-form-control:invalid,.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid,textarea.is-invalid.cd-form-control{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#ef5c55;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ef5c55' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c55' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#ef5c55;box-shadow:0 0 0 .2rem #ef5c5540}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#ef5c55}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#ef5c55}.custom-control-input.is-invalid~.custom-control-label:before,.was-validated .custom-control-input:invalid~.custom-control-label:before{border-color:#ef5c55}.custom-control-input.is-invalid:checked~.custom-control-label:before,.was-validated .custom-control-input:invalid:checked~.custom-control-label:before{border-color:#f38984;background-color:#f38984}.custom-control-input.is-invalid:focus~.custom-control-label:before,.was-validated .custom-control-input:invalid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem #ef5c5540}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#ef5c55}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#ef5c55;box-shadow:0 0 0 .2rem #ef5c5540}.form-inline{display:flex;flex-flow:row wrap;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{justify-content:center}.form-inline .form-group,.form-inline label{display:flex;align-items:center;margin-bottom:0}.form-inline .form-group{flex:0 0 auto;flex-flow:row wrap}.form-inline .cd-form-control,.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:flex;align-items:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{align-items:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;user-select:none;background-color:initial;border:1px solid #0000;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem #2b99a840}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-primary.focus,.btn-primary:focus,.btn-primary:hover{color:#fff;background-color:#237d8a;border-color:#21747f}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem #4ba8b580}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#21747f;border-color:#1e6b75}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #4ba8b580}.btn-secondary{color:#fff;background-color:#374249;border-color:#374249}.btn-secondary.focus,.btn-secondary:focus,.btn-secondary:hover{color:#fff;background-color:#272e33;border-color:#21282c}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem #555e6480}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#374249;border-color:#374249}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#21282c;border-color:#1c2125}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #555e6480}.btn-success{color:#fff;background-color:#0b0;border-color:#0b0}.btn-success.focus,.btn-success:focus,.btn-success:hover{color:#fff;background-color:#009500;border-color:#080}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem #26c52680}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#0b0;border-color:#0b0}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#080;border-color:#007b00}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #26c52680}.btn-info{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-info.focus,.btn-info:focus,.btn-info:hover{color:#fff;background-color:#237d8a;border-color:#21747f}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem #4ba8b580}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#21747f;border-color:#1e6b75}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #4ba8b580}.btn-warning{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-warning.focus,.btn-warning:focus,.btn-warning:hover{color:#212529;background-color:#d9a500;border-color:#cc9b00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem #deaa0680}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#cc9b00;border-color:#bf9200}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #deaa0680}.btn-danger{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-danger.focus,.btn-danger:focus,.btn-danger:hover{color:#fff;background-color:#ec3a32;border-color:#eb2f26}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem #f1746f80}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#eb2f26;border-color:#ea241b}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #f1746f80}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light.focus,.btn-light:focus,.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem #d8d9db80}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #d8d9db80}.btn-dark{color:#fff;background-color:#777;border-color:#777}.btn-dark.focus,.btn-dark:focus,.btn-dark:hover{color:#fff;background-color:#646464;border-color:#5e5e5e}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem #8b8b8b80}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#777;border-color:#777}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#5e5e5e;border-color:#575757}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #8b8b8b80}.btn-accent{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-accent.focus,.btn-accent:focus,.btn-accent:hover{color:#fff;background-color:#ec3a32;border-color:#eb2f26}.btn-accent.focus,.btn-accent:focus{box-shadow:0 0 0 .2rem #f1746f80}.btn-accent.disabled,.btn-accent:disabled{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-accent:not(:disabled):not(.disabled).active,.btn-accent:not(:disabled):not(.disabled):active,.show>.btn-accent.dropdown-toggle{color:#fff;background-color:#eb2f26;border-color:#ea241b}.btn-accent:not(:disabled):not(.disabled).active:focus,.btn-accent:not(:disabled):not(.disabled):active:focus,.show>.btn-accent.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #f1746f80}.btn-warning-dark{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-warning-dark.focus,.btn-warning-dark:focus,.btn-warning-dark:hover{color:#fff;background-color:#e96b02;border-color:#dc6502}.btn-warning-dark.focus,.btn-warning-dark:focus{box-shadow:0 0 0 .2rem #dc711780}.btn-warning-dark.disabled,.btn-warning-dark:disabled{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-warning-dark:not(:disabled):not(.disabled).active,.btn-warning-dark:not(:disabled):not(.disabled):active,.show>.btn-warning-dark.dropdown-toggle{color:#fff;background-color:#dc6502;border-color:#cf5f02}.btn-warning-dark:not(:disabled):not(.disabled).active:focus,.btn-warning-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-warning-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #dc711780}.btn-outline-primary{color:#2b99a8;border-color:#2b99a8}.btn-outline-primary:hover{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem #2b99a880}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#2b99a8;background-color:initial}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #2b99a880}.btn-outline-secondary{color:#374249;border-color:#374249}.btn-outline-secondary:hover{color:#fff;background-color:#374249;border-color:#374249}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem #37424980}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#374249;background-color:initial}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#374249;border-color:#374249}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #37424980}.btn-outline-success{color:#0b0;border-color:#0b0}.btn-outline-success:hover{color:#fff;background-color:#0b0;border-color:#0b0}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem #00bb0080}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#0b0;background-color:initial}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#0b0;border-color:#0b0}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #00bb0080}.btn-outline-info{color:#2b99a8;border-color:#2b99a8}.btn-outline-info:hover{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem #2b99a880}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#2b99a8;background-color:initial}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #2b99a880}.btn-outline-warning{color:#ffc200;border-color:#ffc200}.btn-outline-warning:hover{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem #ffc20080}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc200;background-color:initial}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #ffc20080}.btn-outline-danger{color:#ef5c55;border-color:#ef5c55}.btn-outline-danger:hover{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem #ef5c5580}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#ef5c55;background-color:initial}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #ef5c5580}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem #f8f9fa80}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:initial}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #f8f9fa80}.btn-outline-dark{color:#777;border-color:#777}.btn-outline-dark:hover{color:#fff;background-color:#777;border-color:#777}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem #77777780}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#777;background-color:initial}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#777;border-color:#777}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #77777780}.btn-outline-accent{color:#ef5c55;border-color:#ef5c55}.btn-outline-accent:hover{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-accent.focus,.btn-outline-accent:focus{box-shadow:0 0 0 .2rem #ef5c5580}.btn-outline-accent.disabled,.btn-outline-accent:disabled{color:#ef5c55;background-color:initial}.btn-outline-accent:not(:disabled):not(.disabled).active,.btn-outline-accent:not(:disabled):not(.disabled):active,.show>.btn-outline-accent.dropdown-toggle{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-accent:not(:disabled):not(.disabled).active:focus,.btn-outline-accent:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-accent.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #ef5c5580}.btn-outline-warning-dark{color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark:hover{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark.focus,.btn-outline-warning-dark:focus{box-shadow:0 0 0 .2rem #fd7e1480}.btn-outline-warning-dark.disabled,.btn-outline-warning-dark:disabled{color:#fd7e14;background-color:initial}.btn-outline-warning-dark:not(:disabled):not(.disabled).active,.btn-outline-warning-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-warning-dark.dropdown-toggle{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-warning-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem #fd7e1480}.btn-link{font-weight:400;color:#2b99a8;text-decoration:none}.btn-link:hover{color:#1b626b}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid #0000;border-bottom:0;border-left:.3em solid #0000}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #00000026;border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}@media (min-width:1450px){.dropdown-menu-2xl-left{right:auto;left:0}.dropdown-menu-2xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid #0000;border-bottom:.3em solid;border-left:.3em solid #0000}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid #0000;border-right:0;border-bottom:.3em solid #0000;border-left:.3em solid}.dropright .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-toggle:after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid #0000;border-right:.3em solid;border-bottom:.3em solid #0000}.dropleft .dropdown-toggle:empty:after{margin-left:0}.dropleft .dropdown-toggle:before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:initial;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#2b99a8}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:initial}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split:after,.dropright .dropdown-toggle-split:after,.dropup .dropdown-toggle-split:after{margin-left:0}.dropleft .dropdown-toggle-split:before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.cd-form-control,.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.cd-form-control+.cd-form-control,.input-group>.cd-form-control+.custom-file,.input-group>.cd-form-control+.custom-select,.input-group>.cd-form-control+.form-control,.input-group>.custom-file+.cd-form-control,.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.cd-form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.cd-form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.cd-form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.cd-form-control:focus,.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.cd-form-control:not(:last-child),.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.cd-form-control:not(:first-child),.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:flex;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label:after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.cd-form-control:not(textarea),.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.cd-form-control,.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.cd-form-control:not(textarea),.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.cd-form-control,.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label:before{color:#fff;border-color:#2b99a8;background-color:#2b99a8}.custom-control-input:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem #2b99a840}.custom-control-input:focus:not(:checked)~.custom-control-label:before{border-color:#76d0dc}.custom-control-input:not(:disabled):active~.custom-control-label:before{color:#fff;background-color:#9fdee6;border-color:#9fdee6}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label:before,.custom-control-input[disabled]~.custom-control-label:before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label:before{pointer-events:none;background-color:#fff;border:1px solid #adb5bd}.custom-control-label:after,.custom-control-label:before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:""}.custom-control-label:after{background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label:before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:before{border-color:#2b99a8;background-color:#2b99a8}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label:before,.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label:before{background-color:#2b99a880}.custom-radio .custom-control-label:before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label:before{background-color:#2b99a880}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label:before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label:after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label:after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label:after{background-color:#fff;transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label:before{background-color:#2b99a880}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#76d0dc;outline:0;box-shadow:0 0 0 .2rem #2b99a840}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:#0000;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{display:inline-block;margin-bottom:0}.custom-file,.custom-file-input{position:relative;width:100%;height:calc(1.5em + .75rem + 2px)}.custom-file-input{z-index:2;margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#76d0dc;box-shadow:0 0 0 .2rem #2b99a840}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label:after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]:after{content:attr(data-browse)}.custom-file-label{left:0;z-index:1;height:calc(1.5em + .75rem + 2px);font-weight:400;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label,.custom-file-label:after{position:absolute;top:0;right:0;padding:.375rem .75rem;line-height:1.5;color:#495057}.custom-file-label:after{bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:initial;-moz-appearance:none;appearance:none}.custom-range:focus{outline:none}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem #2b99a840}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem #2b99a840}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem #2b99a840}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#2b99a8;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#9fdee6}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:#0000;cursor:pointer;background-color:#dee2e6;border-color:#0000;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#2b99a8;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#9fdee6}.custom-range::-moz-range-track{width:100%;height:.5rem;color:#0000;cursor:pointer;background-color:#dee2e6;border-color:#0000;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#2b99a8;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#9fdee6}.custom-range::-ms-track{width:100%;height:.5rem;color:#0000;cursor:pointer;background-color:initial;border-color:#0000;border-width:.5rem}.custom-range::-ms-fill-lower,.custom-range::-ms-fill-upper{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label:before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label:before,.custom-file-label,.custom-select{transition:none}}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid #0000;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:initial;border-color:#0000}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#2b99a8}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:initial;border:1px solid #0000;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat 50%;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media (max-width:1449.98px){.navbar-expand-2xl>.container,.navbar-expand-2xl>.container-fluid,.navbar-expand-2xl>.container-lg,.navbar-expand-2xl>.container-md,.navbar-expand-2xl>.container-sm,.navbar-expand-2xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1450px){.navbar-expand-2xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-2xl .navbar-nav{flex-direction:row}.navbar-expand-2xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-2xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-2xl>.container,.navbar-expand-2xl>.container-fluid,.navbar-expand-2xl>.container-lg,.navbar-expand-2xl>.container-md,.navbar-expand-2xl>.container-sm,.navbar-expand-2xl>.container-xl{flex-wrap:nowrap}.navbar-expand-2xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-2xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:#000000e6}.navbar-light .navbar-nav .nav-link{color:#00000080}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:#000000b3}.navbar-light .navbar-nav .nav-link.disabled{color:#0000004d}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:#000000e6}.navbar-light .navbar-toggler{color:#00000080;border-color:#0000001a}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:#00000080}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:#000000e6}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:#ffffff80}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:#ffffffbf}.navbar-dark .navbar-nav .nav-link.disabled{color:#ffffff40}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:#ffffff80;border-color:#ffffff1a}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:#ffffff80}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card,pre{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:initial;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr,pre>hr{margin-right:0;margin-left:0}.card>.list-group,pre>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child,pre>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child,pre>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer,pre>.card-header+.list-group,pre>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:#f8f9fa;border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:#f8f9fa;border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card,.card-deck pre{margin-bottom:15px}@media (min-width:576px){.card-deck{display:flex;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card,.card-deck pre{flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card,.card-group>pre{margin-bottom:15px}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card,.card-group>pre{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card,.card-group>.card+pre,.card-group>pre+.card,.card-group>pre+pre{margin-left:0;border-left:0}.card-group>.card:not(:last-child),.card-group>pre:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top,.card-group>pre:not(:last-child) .card-header,.card-group>pre:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom,.card-group>pre:not(:last-child) .card-footer,.card-group>pre:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child),.card-group>pre:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top,.card-group>pre:not(:first-child) .card-header,.card-group>pre:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom,.card-group>pre:not(:first-child) .card-footer,.card-group>pre:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card,.card-columns pre{margin-bottom:.75rem}@media (min-width:576px){.card-columns{column-count:3;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card,.card-columns pre{display:inline-block;width:100%}}.accordion{overflow-anchor:none}.accordion>.card,.accordion>pre{overflow:hidden}.accordion>.card:not(:last-of-type),.accordion>pre:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type),.accordion>pre:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header,.accordion>pre>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb,.breadcrumb-item{display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item:before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination,cd-table .cd-datatable .datatable-footer .datatable-pager ul{display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#2b99a8;background-color:#fff;border:1px solid #dee2e6}.page-link:hover,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a:hover{z-index:2;color:#1b626b;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem #2b99a840}.page-item:first-child .page-link,.page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link,.page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link,.page-item.active cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.active .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.active a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item.active a{z-index:3;color:#fff;background-color:#2b99a8;border-color:#2b99a8}.page-item.disabled .page-link,.page-item.disabled cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.disabled .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.disabled a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item.disabled a{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg a{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link,.pagination-lg .page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg .page-item:first-child a{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link,.pagination-lg .page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg .page-item:last-child a{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm a{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link,.pagination-sm .page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm .page-item:first-child a{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link,.pagination-sm .page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm .page-item:last-child a{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:1rem;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:initial;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#2b99a8}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#21747f}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem #2b99a880}.badge-secondary{color:#fff;background-color:#374249}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#21282c}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem #37424980}.badge-success{color:#fff;background-color:#0b0}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#080}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem #00bb0080}.badge-info{color:#fff;background-color:#2b99a8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#21747f}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem #2b99a880}.badge-warning{color:#212529;background-color:#ffc200}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#cc9b00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem #ffc20080}.badge-danger{color:#fff;background-color:#ef5c55}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#eb2f26}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem #ef5c5580}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem #f8f9fa80}.badge-dark{color:#fff;background-color:#777}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#5e5e5e}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem #77777780}.badge-accent{color:#fff;background-color:#ef5c55}a.badge-accent:focus,a.badge-accent:hover{color:#fff;background-color:#eb2f26}a.badge-accent.focus,a.badge-accent:focus{outline:0;box-shadow:0 0 0 .2rem #ef5c5580}.badge-warning-dark{color:#212529;background-color:#fd7e14}a.badge-warning-dark:focus,a.badge-warning-dark:hover{color:#212529;background-color:#dc6502}a.badge-warning-dark.focus,a.badge-warning-dark:focus{outline:0;box-shadow:0 0 0 .2rem #fd7e1480}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid #0000;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#165057;background-color:#d5ebee;border-color:#c4e2e7}.alert-primary hr{border-top-color:#b2d9e0}.alert-primary .alert-link{color:#0c2b2e}.alert-secondary{color:#1d2226;background-color:#d7d9db;border-color:#c7cacc}.alert-secondary hr{border-top-color:#babdc0}.alert-secondary .alert-link{color:#070809}.alert-success{color:#006100;background-color:#ccf1cc;border-color:#b8ecb8}.alert-success hr{border-top-color:#a4e7a4}.alert-success .alert-link{color:#002e00}.alert-info{color:#165057;background-color:#d5ebee;border-color:#c4e2e7}.alert-info hr{border-top-color:#b2d9e0}.alert-info .alert-link{color:#0c2b2e}.alert-warning{color:#856500;background-color:#fff3cc;border-color:#ffeeb8}.alert-warning hr{border-top-color:#ffe89f}.alert-warning .alert-link{color:#523e00}.alert-danger{color:#7c302c;background-color:#fcdedd;border-color:#fbd1cf}.alert-danger hr{border-top-color:#f9bab7}.alert-danger .alert-link{color:#56211f}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#3e3e3e;background-color:#e4e4e4;border-color:#d9d9d9}.alert-dark hr{border-top-color:#ccc}.alert-dark .alert-link{color:#252525}.alert-accent{color:#7c302c;background-color:#fcdedd;border-color:#fbd1cf}.alert-accent hr{border-top-color:#f9bab7}.alert-accent .alert-link{color:#56211f}.alert-warning-dark{color:#84420a;background-color:#ffe5d0;border-color:#fedbbd}.alert-warning-dark hr{border-top-color:#fecda4}.alert-warning-dark .alert-link{color:#552a06}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}.progress{height:1rem;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress,.progress-bar{display:flex;overflow:hidden}.progress-bar{flex-direction:column;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#2b99a8;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,#ffffff26 25%,#0000 0,#0000 50%,#ffffff26 0,#ffffff26 75%,#0000 0,#0000);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.media{display:flex;align-items:flex-start}.media-body{flex:1}.list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#2b99a8;border-color:#2b99a8}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1450px){.list-group-horizontal-2xl{flex-direction:row}.list-group-horizontal-2xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-2xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-2xl>.list-group-item.active{margin-top:0}.list-group-horizontal-2xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-2xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#165057;background-color:#c4e2e7}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#165057;background-color:#b2d9e0}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#165057;border-color:#165057}.list-group-item-secondary{color:#1d2226;background-color:#c7cacc}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#1d2226;background-color:#babdc0}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#1d2226;border-color:#1d2226}.list-group-item-success{color:#006100;background-color:#b8ecb8}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#006100;background-color:#a4e7a4}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#006100;border-color:#006100}.list-group-item-info{color:#165057;background-color:#c4e2e7}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#165057;background-color:#b2d9e0}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#165057;border-color:#165057}.list-group-item-warning{color:#856500;background-color:#ffeeb8}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856500;background-color:#ffe89f}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856500;border-color:#856500}.list-group-item-danger{color:#7c302c;background-color:#fbd1cf}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#7c302c;background-color:#f9bab7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#7c302c;border-color:#7c302c}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#3e3e3e;background-color:#d9d9d9}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#3e3e3e;background-color:#ccc}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#3e3e3e;border-color:#3e3e3e}.list-group-item-accent{color:#7c302c;background-color:#fbd1cf}.list-group-item-accent.list-group-item-action:focus,.list-group-item-accent.list-group-item-action:hover{color:#7c302c;background-color:#f9bab7}.list-group-item-accent.list-group-item-action.active{color:#fff;background-color:#7c302c;border-color:#7c302c}.list-group-item-warning-dark{color:#84420a;background-color:#fedbbd}.list-group-item-warning-dark.list-group-item-action:focus,.list-group-item-warning-dark.list-group-item-action:hover{color:#84420a;background-color:#fecda4}.list-group-item-warning-dark.list-group-item-action.active{color:#fff;background-color:#84420a;border-color:#84420a}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:initial;border:0}a.close.disabled{pointer-events:none}.toast{flex-basis:350px;max-width:350px;font-size:.875rem;background-color:#ffffffd9;background-clip:padding-box;border:1px solid #0000001a;box-shadow:0 .25rem .75rem #0000001a;opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:flex;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:#ffffffd9;background-clip:padding-box;border-bottom:1px solid #0000000d;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translateY(-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered:before{display:block;height:calc(100vh - 1rem);height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable:before{content:none}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid #0003;border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered:before{height:calc(100vh - 3.5rem);height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow:before{position:absolute;content:"";border-color:#0000;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow:before,.bs-tooltip-top .arrow:before{top:0;border-width:.4rem .4rem 0;border-top-color:#212529}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow:before,.bs-tooltip-right .arrow:before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#212529}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow:before,.bs-tooltip-bottom .arrow:before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#212529}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow:before,.bs-tooltip-left .arrow:before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#212529}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#212529;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:350px;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:1rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid #0003;border-radius:.3rem}.popover,.popover .arrow{position:absolute;display:block}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow:after,.popover .arrow:before{position:absolute;display:block;content:"";border-color:#0000;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow:before,.bs-popover-top>.arrow:before{bottom:0;border-width:.5rem .5rem 0;border-top-color:#00000040}.bs-popover-auto[x-placement^=top]>.arrow:after,.bs-popover-top>.arrow:after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow:before,.bs-popover-right>.arrow:before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:#00000040}.bs-popover-auto[x-placement^=right]>.arrow:after,.bs-popover-right>.arrow:after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow:before,.bs-popover-bottom>.arrow:before{top:0;border-width:0 .5rem .5rem;border-bottom-color:#00000040}.bs-popover-auto[x-placement^=bottom]>.arrow:after,.bs-popover-bottom>.arrow:after{top:1px;border-width:0 .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow:before,.bs-popover-left>.arrow:before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:#00000040}.bs-popover-auto[x-placement^=left]>.arrow:after,.bs-popover-left>.arrow:after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner:after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:flex;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:initial;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid #0000;border-bottom:10px solid #0000;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@keyframes spinner-border{to{transform:rotate(1turn)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid;border-right:.25em solid #0000;border-radius:50%;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:initial!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#2b99a8!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#21747f!important}.bg-secondary{background-color:#374249!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#21282c!important}.bg-success{background-color:#0b0!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#080!important}.bg-info{background-color:#2b99a8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#21747f!important}.bg-warning{background-color:#ffc200!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#cc9b00!important}.bg-danger{background-color:#ef5c55!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#eb2f26!important}.bg-light,pre{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#777!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#5e5e5e!important}.bg-accent{background-color:#ef5c55!important}a.bg-accent:focus,a.bg-accent:hover,button.bg-accent:focus,button.bg-accent:hover{background-color:#eb2f26!important}.bg-warning-dark{background-color:#fd7e14!important}a.bg-warning-dark:focus,a.bg-warning-dark:hover,button.bg-warning-dark:focus,button.bg-warning-dark:hover{background-color:#dc6502!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:initial!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom,.cd-header,legend{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#2b99a8!important}.border-secondary{border-color:#374249!important}.border-success{border-color:#0b0!important}.border-info{border-color:#2b99a8!important}.border-warning{border-color:#ffc200!important}.border-danger{border-color:#ef5c55!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#777!important}.border-accent{border-color:#ef5c55!important}.border-warning-dark{border-color:#fd7e14!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex,cd-health cd-info-card{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media (min-width:1450px){.d-2xl-none{display:none!important}.d-2xl-inline{display:inline!important}.d-2xl-inline-block{display:inline-block!important}.d-2xl-block{display:block!important}.d-2xl-table{display:table!important}.d-2xl-table-row{display:table-row!important}.d-2xl-table-cell{display:table-cell!important}.d-2xl-flex{display:flex!important}.d-2xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.8571428571%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column,cd-health cd-info-card{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}@media (min-width:576px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}}@media (min-width:768px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}}@media (min-width:1450px){.flex-2xl-row{flex-direction:row!important}.flex-2xl-column{flex-direction:column!important}.flex-2xl-row-reverse{flex-direction:row-reverse!important}.flex-2xl-column-reverse{flex-direction:column-reverse!important}.flex-2xl-wrap{flex-wrap:wrap!important}.flex-2xl-nowrap{flex-wrap:nowrap!important}.flex-2xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-2xl-fill{flex:1 1 auto!important}.flex-2xl-grow-0{flex-grow:0!important}.flex-2xl-grow-1{flex-grow:1!important}.flex-2xl-shrink-0{flex-shrink:0!important}.flex-2xl-shrink-1{flex-shrink:1!important}.justify-content-2xl-start{justify-content:flex-start!important}.justify-content-2xl-end{justify-content:flex-end!important}.justify-content-2xl-center{justify-content:center!important}.justify-content-2xl-between{justify-content:space-between!important}.justify-content-2xl-around{justify-content:space-around!important}.align-items-2xl-start{align-items:flex-start!important}.align-items-2xl-end{align-items:flex-end!important}.align-items-2xl-center{align-items:center!important}.align-items-2xl-baseline{align-items:baseline!important}.align-items-2xl-stretch{align-items:stretch!important}.align-content-2xl-start{align-content:flex-start!important}.align-content-2xl-end{align-content:flex-end!important}.align-content-2xl-center{align-content:center!important}.align-content-2xl-between{align-content:space-between!important}.align-content-2xl-around{align-content:space-around!important}.align-content-2xl-stretch{align-content:stretch!important}.align-self-2xl-auto{align-self:auto!important}.align-self-2xl-start{align-self:flex-start!important}.align-self-2xl-end{align-self:flex-end!important}.align-self-2xl-center{align-self:center!important}.align-self-2xl-baseline{align-self:baseline!important}.align-self-2xl-stretch{align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}@media (min-width:1450px){.float-2xl-left{float:left!important}.float-2xl-right{float:right!important}.float-2xl-none{float:none!important}}.user-select-all{user-select:all!important}.user-select-auto{user-select:auto!important}.user-select-none{user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports (position:sticky){.sticky-top{position:sticky;top:0;z-index:1020}}.sr-only{white-space:nowrap}.sr-only-focusable:active,.sr-only-focusable:focus{white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem #00000026!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.btn-toolbar cd-table-actions.btn-group,.mr-2,.mx-2,cd-logs label{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3,cd-logs .form-inline>.form-group{margin-right:1rem!important}.mb-3,.my-3,cd-logs .form-inline>.form-group{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.cd-header,.mt-4,.my-4,legend{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.cd-header,.mb-4,.my-4,cd-health cd-info-card,legend{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.cd-header,.pb-1,.py-1,legend{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2,cd-table .cd-datatable .datatable-footer,pre{padding:.5rem!important}.pt-2,.py-2,cd-info-card .card .card-body .card-text,cd-info-card pre .card-body .card-text{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2,cd-info-card .card,cd-info-card pre{padding-bottom:.5rem!important}.pl-2,.px-2,cd-info-card .card .card-body .card-title,cd-info-card pre .card-body .card-title{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}@media (min-width:1450px){.m-2xl-0{margin:0!important}.mt-2xl-0,.my-2xl-0{margin-top:0!important}.mr-2xl-0,.mx-2xl-0{margin-right:0!important}.mb-2xl-0,.my-2xl-0{margin-bottom:0!important}.ml-2xl-0,.mx-2xl-0{margin-left:0!important}.m-2xl-1{margin:.25rem!important}.mt-2xl-1,.my-2xl-1{margin-top:.25rem!important}.mr-2xl-1,.mx-2xl-1{margin-right:.25rem!important}.mb-2xl-1,.my-2xl-1{margin-bottom:.25rem!important}.ml-2xl-1,.mx-2xl-1{margin-left:.25rem!important}.m-2xl-2{margin:.5rem!important}.mt-2xl-2,.my-2xl-2{margin-top:.5rem!important}.mr-2xl-2,.mx-2xl-2{margin-right:.5rem!important}.mb-2xl-2,.my-2xl-2{margin-bottom:.5rem!important}.ml-2xl-2,.mx-2xl-2{margin-left:.5rem!important}.m-2xl-3{margin:1rem!important}.mt-2xl-3,.my-2xl-3{margin-top:1rem!important}.mr-2xl-3,.mx-2xl-3{margin-right:1rem!important}.mb-2xl-3,.my-2xl-3{margin-bottom:1rem!important}.ml-2xl-3,.mx-2xl-3{margin-left:1rem!important}.m-2xl-4{margin:1.5rem!important}.mt-2xl-4,.my-2xl-4{margin-top:1.5rem!important}.mr-2xl-4,.mx-2xl-4{margin-right:1.5rem!important}.mb-2xl-4,.my-2xl-4{margin-bottom:1.5rem!important}.ml-2xl-4,.mx-2xl-4{margin-left:1.5rem!important}.m-2xl-5{margin:3rem!important}.mt-2xl-5,.my-2xl-5{margin-top:3rem!important}.mr-2xl-5,.mx-2xl-5{margin-right:3rem!important}.mb-2xl-5,.my-2xl-5{margin-bottom:3rem!important}.ml-2xl-5,.mx-2xl-5{margin-left:3rem!important}.p-2xl-0{padding:0!important}.pt-2xl-0,.py-2xl-0{padding-top:0!important}.pr-2xl-0,.px-2xl-0{padding-right:0!important}.pb-2xl-0,.py-2xl-0{padding-bottom:0!important}.pl-2xl-0,.px-2xl-0{padding-left:0!important}.p-2xl-1{padding:.25rem!important}.pt-2xl-1,.py-2xl-1{padding-top:.25rem!important}.pr-2xl-1,.px-2xl-1{padding-right:.25rem!important}.pb-2xl-1,.py-2xl-1{padding-bottom:.25rem!important}.pl-2xl-1,.px-2xl-1{padding-left:.25rem!important}.p-2xl-2{padding:.5rem!important}.pt-2xl-2,.py-2xl-2{padding-top:.5rem!important}.pr-2xl-2,.px-2xl-2{padding-right:.5rem!important}.pb-2xl-2,.py-2xl-2{padding-bottom:.5rem!important}.pl-2xl-2,.px-2xl-2{padding-left:.5rem!important}.p-2xl-3{padding:1rem!important}.pt-2xl-3,.py-2xl-3{padding-top:1rem!important}.pr-2xl-3,.px-2xl-3{padding-right:1rem!important}.pb-2xl-3,.py-2xl-3{padding-bottom:1rem!important}.pl-2xl-3,.px-2xl-3{padding-left:1rem!important}.p-2xl-4{padding:1.5rem!important}.pt-2xl-4,.py-2xl-4{padding-top:1.5rem!important}.pr-2xl-4,.px-2xl-4{padding-right:1.5rem!important}.pb-2xl-4,.py-2xl-4{padding-bottom:1.5rem!important}.pl-2xl-4,.px-2xl-4{padding-left:1.5rem!important}.p-2xl-5{padding:3rem!important}.pt-2xl-5,.py-2xl-5{padding-top:3rem!important}.pr-2xl-5,.px-2xl-5{padding-right:3rem!important}.pb-2xl-5,.py-2xl-5{padding-bottom:3rem!important}.pl-2xl-5,.px-2xl-5{padding-left:3rem!important}.m-2xl-n1{margin:-.25rem!important}.mt-2xl-n1,.my-2xl-n1{margin-top:-.25rem!important}.mr-2xl-n1,.mx-2xl-n1{margin-right:-.25rem!important}.mb-2xl-n1,.my-2xl-n1{margin-bottom:-.25rem!important}.ml-2xl-n1,.mx-2xl-n1{margin-left:-.25rem!important}.m-2xl-n2{margin:-.5rem!important}.mt-2xl-n2,.my-2xl-n2{margin-top:-.5rem!important}.mr-2xl-n2,.mx-2xl-n2{margin-right:-.5rem!important}.mb-2xl-n2,.my-2xl-n2{margin-bottom:-.5rem!important}.ml-2xl-n2,.mx-2xl-n2{margin-left:-.5rem!important}.m-2xl-n3{margin:-1rem!important}.mt-2xl-n3,.my-2xl-n3{margin-top:-1rem!important}.mr-2xl-n3,.mx-2xl-n3{margin-right:-1rem!important}.mb-2xl-n3,.my-2xl-n3{margin-bottom:-1rem!important}.ml-2xl-n3,.mx-2xl-n3{margin-left:-1rem!important}.m-2xl-n4{margin:-1.5rem!important}.mt-2xl-n4,.my-2xl-n4{margin-top:-1.5rem!important}.mr-2xl-n4,.mx-2xl-n4{margin-right:-1.5rem!important}.mb-2xl-n4,.my-2xl-n4{margin-bottom:-1.5rem!important}.ml-2xl-n4,.mx-2xl-n4{margin-left:-1.5rem!important}.m-2xl-n5{margin:-3rem!important}.mt-2xl-n5,.my-2xl-n5{margin-top:-3rem!important}.mr-2xl-n5,.mx-2xl-n5{margin-right:-3rem!important}.mb-2xl-n5,.my-2xl-n5{margin-bottom:-3rem!important}.ml-2xl-n5,.mx-2xl-n5{margin-left:-3rem!important}.m-2xl-auto{margin:auto!important}.mt-2xl-auto,.my-2xl-auto{margin-top:auto!important}.mr-2xl-auto,.mx-2xl-auto{margin-right:auto!important}.mb-2xl-auto,.my-2xl-auto{margin-bottom:auto!important}.ml-2xl-auto,.mx-2xl-auto{margin-left:auto!important}}.stretched-link:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:#0000}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width:1450px){.text-2xl-left{text-align:left!important}.text-2xl-right{text-align:right!important}.text-2xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold,cd-about dt{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#2b99a8!important}a.text-primary:focus,a.text-primary:hover{color:#1b626b!important}.text-secondary{color:#374249!important}a.text-secondary:focus,a.text-secondary:hover{color:#161b1d!important}.text-success{color:#0b0!important}a.text-success:focus,a.text-success:hover{color:#006f00!important}.text-info{color:#2b99a8!important}a.text-info:focus,a.text-info:hover{color:#1b626b!important}.text-warning{color:#ffc200!important}a.text-warning:focus,a.text-warning:hover{color:#b38800!important}.text-danger{color:#ef5c55!important}a.text-danger:focus,a.text-danger:hover{color:#e21f15!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#777!important}a.text-dark:focus,a.text-dark:hover{color:#515151!important}.text-accent{color:#ef5c55!important}a.text-accent:focus,a.text-accent:hover{color:#e21f15!important}.text-warning-dark{color:#fd7e14!important}a.text-warning-dark:focus,a.text-warning-dark:hover{color:#c35a02!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:#00000080!important}.text-white-50{color:#ffffff80!important}.text-hide{font:0/0 a;color:#0000;text-shadow:none;background-color:initial;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,:after,:before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]:after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}
+/*!
+Fork Awesome 1.1.7
+License - https://forkaweso.me/Fork-Awesome/license
+
+Copyright 2018 Dave Gandy & Fork Awesome
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */@font-face{font-family:ForkAwesome;src:url(forkawesome-webfont.e182ad6df04f9177b326.eot?v=1.1.7);src:url(forkawesome-webfont.e182ad6df04f9177b326.eot?#iefix&v=1.1.7) format("embedded-opentype"),url(forkawesome-webfont.7c20758e3e7c7dff7c8d.woff2?v=1.1.7) format("woff2"),url(forkawesome-webfont.2dfb5f36fc148e26e398.woff?v=1.1.7) format("woff"),url(forkawesome-webfont.ee4d8bfd0af89fc714a2.ttf?v=1.1.7) format("truetype"),url(forkawesome-webfont.86541105409e56d17291.svg?v=1.1.7#forkawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 ForkAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa,.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s linear infinite}.fa-pulse{animation:fa-spin 1s steps(8) infinite}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before,.fa-sync:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before,.fa-video:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell-o:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-globe-e:before{content:""}.fa-globe-w:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-community:before,.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus-g:before,.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before,.fa-utensils:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before,.fa-pound:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:""}.fa-sort-alpha-desc:before,.fa-sort-alpha-up:before{content:""}.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:""}.fa-sort-amount-desc:before,.fa-sort-amount-up:before{content:""}.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:""}.fa-sort-numeric-desc:before,.fa-sort-numeric-up:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before,.fa-utensil-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before,.fa-heading:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before,.fa-closed-captioning:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before,.fa-gem:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-medium-square:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo-v:before,.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-phone-volume:before,.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.fa-mastodon:before{content:""}.fa-mastodon-alt:before{content:""}.fa-fork-awesome:before,.fa-fork-circle:before{content:""}.fa-peertube:before{content:""}.fa-diaspora:before{content:""}.fa-friendica:before{content:""}.fa-gnu-social:before{content:""}.fa-liberapay-square:before{content:""}.fa-liberapay:before{content:""}.fa-scuttlebutt:before,.fa-ssb:before{content:""}.fa-hubzilla:before{content:""}.fa-social-home:before{content:""}.fa-artstation:before{content:""}.fa-discord:before{content:""}.fa-discord-alt:before{content:""}.fa-patreon:before{content:""}.fa-snowdrift:before{content:""}.fa-activitypub:before{content:""}.fa-ethereum:before{content:""}.fa-keybase:before{content:""}.fa-shaarli:before{content:""}.fa-shaarli-o:before{content:""}.fa-cut-key:before,.fa-key-modern:before{content:""}.fa-xmpp:before{content:""}.fa-archive-org:before{content:""}.fa-freedombox:before{content:""}.fa-facebook-messenger:before{content:""}.fa-debian:before{content:""}.fa-mastodon-square:before{content:""}.fa-tipeee:before{content:""}.fa-react:before{content:""}.fa-dogmazic:before{content:""}.fa-zotero:before{content:""}.fa-nodejs:before{content:""}.fa-nextcloud:before{content:""}.fa-nextcloud-square:before{content:""}.fa-hackaday:before{content:""}.fa-laravel:before{content:""}.fa-signalapp:before{content:""}.fa-gnupg:before{content:""}.fa-php:before{content:""}.fa-ffmpeg:before{content:""}.fa-joplin:before{content:""}.fa-syncthing:before{content:""}.fa-inkscape:before{content:""}.fa-matrix-org:before{content:""}.fa-pixelfed:before{content:""}.fa-bootstrap:before{content:""}.fa-dev-to:before{content:""}.fa-hashnode:before{content:""}.fa-jirafeau:before{content:""}.fa-emby:before{content:""}.fa-wikidata:before{content:""}.fa-gimp:before{content:""}.fa-c:before{content:""}.fa-digitalocean:before{content:""}.fa-att:before{content:""}.fa-gitea:before{content:""}.fa-file-epub:before{content:""}.fa-python:before{content:""}.fa-archlinux:before{content:""}.fa-pleroma:before{content:""}.fa-unsplash:before{content:""}.fa-hackster:before{content:""}.fa-spell-check:before{content:""}.fa-moon:before{content:""}.fa-sun:before{content:""}.fa-f-droid:before{content:""}.fa-biometric:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.info-card-popover-cluster-status{max-height:20vh;max-width:23vw}.info-card-popover-cluster-status .popover-body{font-size:1rem;max-height:19vh;max-width:100%;overflow:auto}@media (max-width:calc(1200px - 1px)){.info-card-popover-cluster-status{max-width:31vw}}@media (max-width:calc(992px - 1px)){.info-card-popover-cluster-status{max-width:46vw}}@media (max-width:calc(768px - 1px)){.info-card-popover-cluster-status{max-width:83vw}}.info-card-content-clickable{border:1px solid #e9ecef;border-radius:3px;cursor:pointer;padding:7px}.info-card-content-clickable:hover{background-color:#e9ecef;border-color:#ced4da}html{background-color:#fff}body,html{font-size:12px;height:100%;width:100%}option{font-style:normal;font-weight:400}.full-height{height:100vh}.full-width{width:100vw}.vertical-align{align-items:center;display:flex}.horizontal-align{display:flex;justify-content:center}.loading{left:50%;position:absolute;top:50%}.margin-right-md{margin-right:15px}.no-border{border:0;box-shadow:0 0 0!important}.italic{font-style:italic}.bold{font-weight:700}.text-right{text-align:right}.text-monospace{font-family:monospace}.text-pre-wrap{white-space:pre-wrap}.text-pre{white-space:pre}.border-danger{border-left:4px solid #ef5c55}.border-info{border-left:4px solid #2b99a8}.border-success{border-left:4px solid #0b0}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:initial}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{background-color:#2b99a8;border-color:#2b99a8}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{border-color:#adb5bd}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem #2b99a840}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label:before{border-color:#76d0dc}.btn-light{background-color:#fff;border-color:#ced4da!important}.btn-light:hover{background-color:#dee2e6;border-color:#6c757d!important}.btn-light:disabled{background-color:#e9ecef;border-color:#ced4da!important}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:0}.btn.disabled{border:0;box-shadow:none}.btn-primary .badge{background-color:#e9ecef;color:#2b99a8}.btn-group>.btn>i.fa,.cd-datatable-actions button.btn i.fa{margin-right:5px}.card-footer button.btn:not(:first-child){margin-left:5px}.dropdown-menu{min-width:50px;z-index:999999}.dropdown-menu button.dropdown-item:focus{outline:none}.dropdown-menu>li>a{cursor:pointer}.dropdown-menu>li>a>i.fa{margin-right:5px}.dropdown-menu>.active>a{background-color:#2b99a8;color:#e9ecef}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#21747f}.dataTables_wrapper .dropdown-menu>li.dropdown-divider{cursor:auto}.required:after{color:#ef5c55;content:"*";font-size:1.167rem;padding-left:4px}.form-footer{display:flex;width:100%}.cd-form-control,.form-control{display:table-cell}.cd-form-control:focus,.form-control:focus{border-color:#2b99a8cc;box-shadow:0 0 3px 2px #2b99a880;outline:0}.custom-checkbox{padding-top:7px}cd-modal .modal{background-color:#0006;display:block}cd-modal .modal-dialog{max-width:70vh}.invalid-feedback{display:block}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{padding:0 30px}.ceph-icon{background:url(Ceph_Logo.487a0001b327fa7f5232.svg)}.prometheus-icon{background:url(prometheus_logo.8b3183e5a2db0e87bb2b.svg)}.custom-icon{background-clip:padding-box;background-repeat:no-repeat;background-size:contain;margin-right:8px;padding:10px}.nav-tabs{margin-bottom:1rem}#toast-container{margin-top:2vw}@media (max-width:1600px){#toast-container{margin-top:2.5vw}}@media (max-width:calc(992px - 1px)){#toast-container{margin-top:9vw}}@media (max-width:900px){#toast-container{margin-top:10vw}}@media (max-width:319px){#toast-container{margin-top:11vw}}@media (max-width:260px){#toast-container{margin-top:14vw}}.toast-message>ul{margin:0;padding-left:1rem}.noscript{padding-top:5em}@media (min-width:576px){.cd-col-form-label,.col-form-label{text-align:right}}.cd-col-form-label,.col-form-label{font-weight:700}.password-strength-level{flex:100%;margin-top:2px}.password-strength-level .ok,.password-strength-level .strong,.password-strength-level .very-strong,.password-strength-level .weak{border-radius:.25rem;height:13px}.password-strength-level .weak{background:#ef5c55;width:25%}.password-strength-level .ok{background:#ffc200;width:50%}.password-strength-level .strong{background:#0b0;width:75%}.password-strength-level .very-strong{background:#006f00;width:100%}.badge-background-gray,.badge-hdd{background-color:#6c757d;color:#fff}.badge-background-primary,.badge-ssd{background-color:#2b99a8;color:#fff}.badge-tab{background-color:#e9ecef;color:#495057}tree-root tree-viewport{min-height:1em}tags-input .tags{border:1px solid #ced4da;border-radius:4px;box-shadow:inset 0 1px 1px #00000017}.card-header{font-size:1.3em}.card-body h2:first-child{margin-top:0}.disabled{pointer-events:none}.clickable,a{cursor:pointer}
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.7918cb8dc788b3eedc95.css b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/styles.7918cb8dc788b3eedc95.css
deleted file mode 100644 (file)
index e1d8f15..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-@charset "UTF-8";.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #fff}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px 3px 3px 3px;background-position:15px;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z'/%3E%3C/svg%3E")}.toast-error{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z'/%3E%3C/svg%3E")}.toast-success{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z'/%3E%3C/svg%3E")}.toast-warning{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512' width='576' height='512'%3E%3Cpath fill='rgb(255,255,255)' d='M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z'/%3E%3C/svg%3E")}.toast-container.toast-bottom-center .ngx-toastr,.toast-container.toast-top-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-bottom-full-width .ngx-toastr,.toast-container.toast-top-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media (max-width:240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media (min-width:241px) and (max-width:480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media (min-width:481px) and (max-width:768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}}.tree-children.tree-children-no-padding{padding-left:0}.tree-children{overflow:hidden}.node-drop-slot{display:block;height:2px}.node-drop-slot.is-dragging-over{background:#dfe;height:20px;border:2px dotted #888}.toggle-children-wrapper-expanded .toggle-children{transform:rotate(90deg)}.toggle-children-wrapper-collapsed .toggle-children{transform:rotate(0)}.toggle-children-wrapper{padding:2px 3px 5px 1px}.toggle-children{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ1dWlkOjY1RTYzOTA2ODZDRjExREJBNkUyRDg4N0NFQUNCNDA3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkYzRkRFQjcxODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkYzRkRFQjcwODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTk5NzA1OGEtZDI3OC00NDZkLWE4ODgtNGM4MGQ4YWI1NzNmIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzRkZmQxMGMtY2NlNS0xMTc4LWE5OGQtY2NkZmM5ODk5YWYwIi8+IDxkYzp0aXRsZT4gPHJkZjpBbHQ+IDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+Z2x5cGhpY29uczwvcmRmOmxpPiA8L3JkZjpBbHQ+IDwvZGM6dGl0bGU+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5iogFwAAAGhJREFUeNpiYGBgKABigf///zOQg0EARH4A4gZyDIIZ8B/JoAJKDIDhB0CcQIkBRBtEyABkgxwoMQCGD6AbRKoBGAYxQgXIBRuZGKgAKPIC3QLxArnRSHZCIjspk52ZKMrOFBUoAAEGAKnq593MQAZtAAAAAElFTkSuQmCC");height:8px;width:9px;background-size:contain;background-repeat:no-repeat;background-position:50%}.toggle-children,.toggle-children-placeholder{display:inline-block;position:relative;top:1px}.toggle-children-placeholder{height:10px;width:10px;padding-right:3px}.node-content-wrapper{display:inline-block;padding:2px 5px;border-radius:2px;transition:background-color .15s,box-shadow .15s}.node-wrapper{display:flex;align-items:flex-start}.node-content-wrapper-active,.node-content-wrapper-active.node-content-wrapper-focused,.node-content-wrapper.node-content-wrapper-active:hover{background:#beebff}.node-content-wrapper-focused{background:#e7f4f9}.node-content-wrapper:hover{background:#f7fbff}.node-content-wrapper-active,.node-content-wrapper-focused,.node-content-wrapper:hover{box-shadow:inset 0 0 1px #999}.node-content-wrapper.is-dragging-over{background:#dfe;box-shadow:inset 0 0 1px #999}.node-content-wrapper.is-dragging-over-disabled{opacity:.5}tree-viewport{-webkit-tap-highlight-color:transparent;height:100%;overflow:auto;display:block}.tree-children{padding-left:20px}.empty-tree-drop-slot .node-drop-slot{height:20px;min-width:100px}.angular-tree-component{width:100%;position:relative;display:inline-block;cursor:pointer;-webkit-touch-callout:none;user-select:none}tree-root .angular-tree-component-rtl{direction:rtl}tree-root .angular-tree-component-rtl .toggle-children-wrapper-collapsed .toggle-children{transform:rotate(180deg)!important}tree-root .angular-tree-component-rtl .tree-children{padding-right:20px;padding-left:0}tree-node-checkbox{padding:1px}:root{--gray-100:#f8f9fa;--gray-200:#e9ecef;--gray-300:#dee2e6;--gray-400:#ced4da;--gray-500:#adb5bd;--gray-600:#6c757d;--gray-700:#495057;--gray-800:#343a40;--gray-900:#212529;--black:#000;--barley-white:#fcecba;--fg-color-over-dark-bg:#fff;--fg-hover-color-over-dark-bg:#adb5bd;--body-color-bright:#f8f9fa;--body-bg:#fff;--body-color:#212529;--body-bg-alt:#e9ecef;--health-color-error:red;--health-color-healthy:#0b0;--health-color-warning:orange;--chart-color-red:#c9190b;--chart-color-blue:#06c;--chart-color-orange:#ef9234;--chart-color-yellow:#f6d173;--chart-color-green:#7cc674;--chart-color-gray:#ededed;--chart-color-cyan:#73c5c5;--chart-color-purple:#3c3d99;--chart-color-center-text:#151515;--chart-color-center-text-description:#72767b;--chart-color-tooltip-background:#000;--card-cap-bg:#f8f9fa;--grid-gutter-width:30px;--datatable-divider-color:rgba(0,0,0,0.09);--nav-tabs-margin-bottom:1rem;--tooltip-color:#fff;--tooltip-bg:#212529;--screen-sm-min:576px;--screen-md-min:768px;--screen-lg-min:992px;--screen-xl-min:1200px;--screen-xs-max:calc(576px - 1px);--screen-sm-max:calc(768px - 1px);--screen-md-max:calc(992px - 1px);--screen-lg-max:calc(1200px - 1px);--navbar-height:43px;--top-notification-height:37.6px;--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#a94442;--red:#ef5c55;--orange:#fd7e14;--yellow:#ffc200;--green:#0b0;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#2b99a8;--secondary:#374249;--success:#0b0;--info:#2b99a8;--warning:#ffc200;--danger:#ef5c55;--light:#f8f9fa;--dark:#777;--accent:#ef5c55;--warning-dark:#fd7e14;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--breakpoint-2xl:1450px;--font-family-sans-serif:"Helvetica Neue",Helvetica,Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}
-/*!
- * Bootstrap v4.5.2 (https://getbootstrap.com/)
- * Copyright 2011-2020 The Bootstrap Authors
- * Copyright 2011-2020 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- */*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:initial;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{font-style:normal;line-height:inherit}address,dl,ol,ul{margin-bottom:1rem}dl,ol,ul{margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}a{color:#2b99a8;text-decoration:none;background-color:initial}a:hover{color:#1b626b;text-decoration:underline}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{border-style:none}img,svg{vertical-align:middle}svg{overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:initial}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem}.display-1,.display-2{font-weight:300;line-height:1.2}.display-2{font-size:5.5rem}.display-3{font-size:4.5rem}.display-3,.display-4{font-weight:300;line-height:1.2}.display-4{font-size:3.5rem}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer:before{content:"— "}.img-fluid,.img-thumbnail{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#a94442;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row,cd-about dl{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.cd-col-form,.cd-col-form-input,.cd-col-form-label,.cd-col-form-offset,.col,.col-1,.col-2,.col-2xl,.col-2xl-1,.col-2xl-2,.col-2xl-3,.col-2xl-4,.col-2xl-5,.col-2xl-6,.col-2xl-7,.col-2xl-8,.col-2xl-9,.col-2xl-10,.col-2xl-11,.col-2xl-12,.col-2xl-auto,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-auto,.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-auto,.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-auto,.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-auto,cd-about dd,cd-about dt,cd-health cd-info-card,cd-health cd-info-card.cd-capacity-card,cd-health cd-info-card.cd-chart-card,cd-health cd-info-card.cd-performance-card,cd-health cd-info-card.cd-status-card,cd-modal .cd-col-form-input,cd-modal .cd-col-form-label,cd-modal .cd-col-form-offset{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-1>*{flex:0 0 100%;max-width:100%}.row-cols-2>*{flex:0 0 50%;max-width:50%}.row-cols-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-4>*{flex:0 0 25%;max-width:25%}.row-cols-5>*{flex:0 0 20%;max-width:20%}.row-cols-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-auto{flex:0 0 auto;width:auto;max-width:100%}.col-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-3{flex:0 0 25%;max-width:25%}.col-4,cd-about dt{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-8,cd-about dd{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.cd-col-form,.col-12,cd-health cd-info-card{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}@media (min-width:576px){.col-sm{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-sm-1>*{flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-sm-4>*{flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-sm-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-3{flex:0 0 25%;max-width:25%}.cd-col-form-label,.col-sm-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-sm-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form-input,.cd-col-form-offset,.col-sm-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-sm-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-sm-12,cd-health cd-info-card{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.cd-col-form-offset,.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}}@media (min-width:768px){.col-md{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-md-1>*{flex:0 0 100%;max-width:100%}.row-cols-md-2>*{flex:0 0 50%;max-width:50%}.row-cols-md-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-md-4>*{flex:0 0 25%;max-width:25%}.row-cols-md-5>*{flex:0 0 20%;max-width:20%}.row-cols-md-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-auto{flex:0 0 auto;width:auto;max-width:100%}.col-md-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-3{flex:0 0 25%;max-width:25%}.cd-col-form-label,.col-md-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-md-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6,cd-health cd-info-card{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form-input,.cd-col-form-offset,.col-md-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-md-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-md-12,cd-health cd-info-card.cd-chart-card{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}}@media (min-width:992px){.col-lg{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-lg-1>*{flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-lg-4>*{flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-lg-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.cd-col-form-label,.col-lg-3,cd-health cd-info-card.cd-capacity-card{flex:0 0 25%;max-width:25%}.col-lg-4,cd-health cd-info-card,cd-modal .cd-col-form-label{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-lg-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-lg-6,cd-health cd-info-card.cd-chart-card,cd-health cd-info-card.cd-performance-card{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.cd-col-form,.col-lg-8,cd-modal .cd-col-form-input,cd-modal .cd-col-form-offset{flex:0 0 66.6666666667%;max-width:66.6666666667%}.cd-col-form-input,.cd-col-form-offset,.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-lg-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.cd-col-form-offset,.offset-lg-3{margin-left:25%}.offset-lg-4,cd-modal .cd-col-form-offset{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}}@media (min-width:1200px){.col-xl,cd-health cd-info-card.cd-capacity-card,cd-health cd-info-card.cd-performance-card{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-xl-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-3,cd-health cd-info-card.cd-status-card{flex:0 0 25%;max-width:25%}.col-xl-4,cd-health cd-info-card.cd-chart-card{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-xl-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.cd-col-form,.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-xl-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-xl-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}}@media (min-width:1450px){.col-2xl{flex-basis:0;flex-grow:1;max-width:100%}.row-cols-2xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-2xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-2xl-3>*{flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-2xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-2xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-2xl-6>*{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-2xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-2xl-1{flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2xl-2{flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-2xl-3,cd-health cd-info-card.cd-chart-card{flex:0 0 25%;max-width:25%}.col-2xl-4{flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-2xl-5{flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-2xl-6{flex:0 0 50%;max-width:50%}.col-2xl-7{flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-2xl-8{flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-2xl-9{flex:0 0 75%;max-width:75%}.col-2xl-10{flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-2xl-11{flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-2xl-12{flex:0 0 100%;max-width:100%}.order-2xl-first{order:-1}.order-2xl-last{order:13}.order-2xl-0{order:0}.order-2xl-1{order:1}.order-2xl-2{order:2}.order-2xl-3{order:3}.order-2xl-4{order:4}.order-2xl-5{order:5}.order-2xl-6{order:6}.order-2xl-7{order:7}.order-2xl-8{order:8}.order-2xl-9{order:9}.order-2xl-10{order:10}.order-2xl-11{order:11}.order-2xl-12{order:12}.offset-2xl-0{margin-left:0}.offset-2xl-1{margin-left:8.3333333333%}.offset-2xl-2{margin-left:16.6666666667%}.offset-2xl-3{margin-left:25%}.offset-2xl-4{margin-left:33.3333333333%}.offset-2xl-5{margin-left:41.6666666667%}.offset-2xl-6{margin-left:50%}.offset-2xl-7{margin-left:58.3333333333%}.offset-2xl-8{margin-left:66.6666666667%}.offset-2xl-9{margin-left:75%}.offset-2xl-10{margin-left:83.3333333333%}.offset-2xl-11{margin-left:91.6666666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered,.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#c4e2e7}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#91cad2}.table-hover .table-primary:hover,.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#b2d9e0}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#c7cacc}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#979da0}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#babdc0}.table-success,.table-success>td,.table-success>th{background-color:#b8ecb8}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#7adc7a}.table-hover .table-success:hover,.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#a4e7a4}.table-info,.table-info>td,.table-info>th{background-color:#c4e2e7}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#91cad2}.table-hover .table-info:hover,.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#b2d9e0}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeb8}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7a}.table-hover .table-warning:hover,.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe89f}.table-danger,.table-danger>td,.table-danger>th{background-color:#fbd1cf}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#f7aaa7}.table-hover .table-danger:hover,.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f9bab7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover,.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#d9d9d9}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#b8b8b8}.table-hover .table-dark:hover,.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#ccc}.table-accent,.table-accent>td,.table-accent>th{background-color:#fbd1cf}.table-accent tbody+tbody,.table-accent td,.table-accent th,.table-accent thead th{border-color:#f7aaa7}.table-hover .table-accent:hover,.table-hover .table-accent:hover>td,.table-hover .table-accent:hover>th{background-color:#f9bab7}.table-warning-dark,.table-warning-dark>td,.table-warning-dark>th{background-color:#fedbbd}.table-warning-dark tbody+tbody,.table-warning-dark td,.table-warning-dark th,.table-warning-dark thead th{border-color:#febc85}.table-hover .table-warning-dark:hover,.table-hover .table-warning-dark:hover>td,.table-hover .table-warning-dark:hover>th{background-color:#fecda4}.table-active,.table-active>td,.table-active>th,.table-hover .table-active:hover,.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:hsla(0,0%,100%,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:hsla(0,0%,100%,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}@media (max-width:1449.98px){.table-responsive-2xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-2xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.cd-form-control,.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.cd-form-control,.form-control{transition:none}}.cd-form-control::-ms-expand,.form-control::-ms-expand{background-color:initial;border:0}.cd-form-control:-moz-focusring,.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.cd-form-control:focus,.form-control:focus{color:#495057;background-color:#fff;border-color:#76d0dc;box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.cd-form-control::placeholder,.form-control::placeholder{color:#6c757d;opacity:1}.cd-form-control:disabled,.form-control:disabled,.form-control[readonly],[readonly].cd-form-control{background-color:#e9ecef;opacity:1}input[type=date].cd-form-control,input[type=date].form-control,input[type=datetime-local].cd-form-control,input[type=datetime-local].form-control,input[type=month].cd-form-control,input[type=month].form-control,input[type=time].cd-form-control,input[type=time].form-control{-moz-appearance:none;appearance:none}select.cd-form-control:focus::-ms-value,select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.cd-col-form-label,.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:initial;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size],select[multiple].cd-form-control,select[size].cd-form-control,textarea.cd-form-control,textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:flex;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:inline-flex;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:100%;color:#0b0}.valid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(0,187,0,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.is-valid.cd-form-control,.was-validated .cd-form-control:valid,.was-validated .form-control:valid{border-color:#0b0;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%230b0' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.is-valid.cd-form-control:focus,.was-validated .cd-form-control:valid:focus,.was-validated .form-control:valid:focus{border-color:#0b0;box-shadow:0 0 0 .2rem rgba(0,187,0,.25)}.was-validated textarea.cd-form-control:valid,.was-validated textarea.form-control:valid,textarea.form-control.is-valid,textarea.is-valid.cd-form-control{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#0b0;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%230b0' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#0b0;box-shadow:0 0 0 .2rem rgba(0,187,0,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#0b0}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#0b0}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{border-color:#0b0}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{border-color:#0e0;background-color:#0e0}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(0,187,0,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#0b0}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#0b0;box-shadow:0 0 0 .2rem rgba(0,187,0,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:100%;color:#ef5c55}.invalid-tooltip{position:absolute;top:100%;left:0;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(239,92,85,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.is-invalid.cd-form-control,.was-validated .cd-form-control:invalid,.was-validated .form-control:invalid{border-color:#ef5c55;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ef5c55' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c55' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.is-invalid.cd-form-control:focus,.was-validated .cd-form-control:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#ef5c55;box-shadow:0 0 0 .2rem rgba(239,92,85,.25)}.was-validated textarea.cd-form-control:invalid,.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid,textarea.is-invalid.cd-form-control{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#ef5c55;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ef5c55' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef5c55' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#ef5c55;box-shadow:0 0 0 .2rem rgba(239,92,85,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#ef5c55}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#ef5c55}.custom-control-input.is-invalid~.custom-control-label:before,.was-validated .custom-control-input:invalid~.custom-control-label:before{border-color:#ef5c55}.custom-control-input.is-invalid:checked~.custom-control-label:before,.was-validated .custom-control-input:invalid:checked~.custom-control-label:before{border-color:#f38984;background-color:#f38984}.custom-control-input.is-invalid:focus~.custom-control-label:before,.was-validated .custom-control-input:invalid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(239,92,85,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label:before,.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#ef5c55}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#ef5c55;box-shadow:0 0 0 .2rem rgba(239,92,85,.25)}.form-inline{display:flex;flex-flow:row wrap;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{justify-content:center}.form-inline .form-group,.form-inline label{display:flex;align-items:center;margin-bottom:0}.form-inline .form-group{flex:0 0 auto;flex-flow:row wrap}.form-inline .cd-form-control,.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:flex;align-items:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{align-items:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;user-select:none;background-color:initial;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-primary.focus,.btn-primary:focus,.btn-primary:hover{color:#fff;background-color:#237d8a;border-color:#21747f}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(75,168,181,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#21747f;border-color:#1e6b75}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(75,168,181,.5)}.btn-secondary{color:#fff;background-color:#374249;border-color:#374249}.btn-secondary.focus,.btn-secondary:focus,.btn-secondary:hover{color:#fff;background-color:#272e33;border-color:#21282c}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(85,94,100,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#374249;border-color:#374249}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#21282c;border-color:#1c2125}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(85,94,100,.5)}.btn-success{color:#fff;background-color:#0b0;border-color:#0b0}.btn-success.focus,.btn-success:focus,.btn-success:hover{color:#fff;background-color:#009500;border-color:#080}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(38,197,38,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#0b0;border-color:#0b0}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#080;border-color:#007b00}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,197,38,.5)}.btn-info{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-info.focus,.btn-info:focus,.btn-info:hover{color:#fff;background-color:#237d8a;border-color:#21747f}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(75,168,181,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#21747f;border-color:#1e6b75}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(75,168,181,.5)}.btn-warning{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-warning.focus,.btn-warning:focus,.btn-warning:hover{color:#212529;background-color:#d9a500;border-color:#cc9b00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(222,170,6,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#cc9b00;border-color:#bf9200}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,6,.5)}.btn-danger{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-danger.focus,.btn-danger:focus,.btn-danger:hover{color:#fff;background-color:#ec3a32;border-color:#eb2f26}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(241,116,111,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#eb2f26;border-color:#ea241b}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(241,116,111,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light.focus,.btn-light:focus,.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#777;border-color:#777}.btn-dark.focus,.btn-dark:focus,.btn-dark:hover{color:#fff;background-color:#646464;border-color:#5e5e5e}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem hsla(0,0%,54.5%,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#777;border-color:#777}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#5e5e5e;border-color:#575757}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem hsla(0,0%,54.5%,.5)}.btn-accent{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-accent.focus,.btn-accent:focus,.btn-accent:hover{color:#fff;background-color:#ec3a32;border-color:#eb2f26}.btn-accent.focus,.btn-accent:focus{box-shadow:0 0 0 .2rem rgba(241,116,111,.5)}.btn-accent.disabled,.btn-accent:disabled{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-accent:not(:disabled):not(.disabled).active,.btn-accent:not(:disabled):not(.disabled):active,.show>.btn-accent.dropdown-toggle{color:#fff;background-color:#eb2f26;border-color:#ea241b}.btn-accent:not(:disabled):not(.disabled).active:focus,.btn-accent:not(:disabled):not(.disabled):active:focus,.show>.btn-accent.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(241,116,111,.5)}.btn-warning-dark{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-warning-dark.focus,.btn-warning-dark:focus,.btn-warning-dark:hover{color:#fff;background-color:#e96b02;border-color:#dc6502}.btn-warning-dark.focus,.btn-warning-dark:focus{box-shadow:0 0 0 .2rem rgba(220,113,23,.5)}.btn-warning-dark.disabled,.btn-warning-dark:disabled{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-warning-dark:not(:disabled):not(.disabled).active,.btn-warning-dark:not(:disabled):not(.disabled):active,.show>.btn-warning-dark.dropdown-toggle{color:#fff;background-color:#dc6502;border-color:#cf5f02}.btn-warning-dark:not(:disabled):not(.disabled).active:focus,.btn-warning-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-warning-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,113,23,.5)}.btn-outline-primary{color:#2b99a8;border-color:#2b99a8}.btn-outline-primary:hover{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#2b99a8;background-color:initial}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.btn-outline-secondary{color:#374249;border-color:#374249}.btn-outline-secondary:hover{color:#fff;background-color:#374249;border-color:#374249}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(55,66,73,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#374249;background-color:initial}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#374249;border-color:#374249}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(55,66,73,.5)}.btn-outline-success{color:#0b0;border-color:#0b0}.btn-outline-success:hover{color:#fff;background-color:#0b0;border-color:#0b0}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(0,187,0,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#0b0;background-color:initial}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#0b0;border-color:#0b0}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,187,0,.5)}.btn-outline-info{color:#2b99a8;border-color:#2b99a8}.btn-outline-info:hover{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#2b99a8;background-color:initial}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#2b99a8;border-color:#2b99a8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.btn-outline-warning{color:#ffc200;border-color:#ffc200}.btn-outline-warning:hover{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,194,0,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc200;background-color:initial}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc200;border-color:#ffc200}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,194,0,.5)}.btn-outline-danger{color:#ef5c55;border-color:#ef5c55}.btn-outline-danger:hover{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#ef5c55;background-color:initial}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:initial}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#777;border-color:#777}.btn-outline-dark:hover{color:#fff;background-color:#777;border-color:#777}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem hsla(0,0%,46.7%,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#777;background-color:initial}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#777;border-color:#777}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem hsla(0,0%,46.7%,.5)}.btn-outline-accent{color:#ef5c55;border-color:#ef5c55}.btn-outline-accent:hover{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-accent.focus,.btn-outline-accent:focus{box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.btn-outline-accent.disabled,.btn-outline-accent:disabled{color:#ef5c55;background-color:initial}.btn-outline-accent:not(:disabled):not(.disabled).active,.btn-outline-accent:not(:disabled):not(.disabled):active,.show>.btn-outline-accent.dropdown-toggle{color:#fff;background-color:#ef5c55;border-color:#ef5c55}.btn-outline-accent:not(:disabled):not(.disabled).active:focus,.btn-outline-accent:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-accent.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.btn-outline-warning-dark{color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark:hover{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark.focus,.btn-outline-warning-dark:focus{box-shadow:0 0 0 .2rem rgba(253,126,20,.5)}.btn-outline-warning-dark.disabled,.btn-outline-warning-dark:disabled{color:#fd7e14;background-color:initial}.btn-outline-warning-dark:not(:disabled):not(.disabled).active,.btn-outline-warning-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-warning-dark.dropdown-toggle{color:#212529;background-color:#fd7e14;border-color:#fd7e14}.btn-outline-warning-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-warning-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(253,126,20,.5)}.btn-link{font-weight:400;color:#2b99a8;text-decoration:none}.btn-link:hover{color:#1b626b}.btn-link.focus,.btn-link:focus,.btn-link:hover{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty:after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}@media (min-width:1450px){.dropdown-menu-2xl-left{right:auto;left:0}.dropdown-menu-2xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty:after{margin-left:0}.dropright .dropdown-toggle:after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";display:none}.dropleft .dropdown-toggle:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty:after{margin-left:0}.dropleft .dropdown-toggle:before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:initial;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#2b99a8}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:initial}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split:after,.dropright .dropdown-toggle-split:after,.dropup .dropdown-toggle-split:after{margin-left:0}.dropleft .dropdown-toggle-split:before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio],.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.cd-form-control,.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.cd-form-control+.cd-form-control,.input-group>.cd-form-control+.custom-file,.input-group>.cd-form-control+.custom-select,.input-group>.cd-form-control+.form-control,.input-group>.custom-file+.cd-form-control,.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.cd-form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.cd-form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.cd-form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.cd-form-control:focus,.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.cd-form-control:not(:last-child),.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.cd-form-control:not(:first-child),.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:flex;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label:after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.cd-form-control:not(textarea),.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.cd-form-control,.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.cd-form-control:not(textarea),.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.cd-form-control,.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;z-index:1;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label:before{color:#fff;border-color:#2b99a8;background-color:#2b99a8}.custom-control-input:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label:before{border-color:#76d0dc}.custom-control-input:not(:disabled):active~.custom-control-label:before{color:#fff;background-color:#9fdee6;border-color:#9fdee6}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label:before,.custom-control-input[disabled]~.custom-control-label:before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label:before{pointer-events:none;background-color:#fff;border:1px solid #adb5bd}.custom-control-label:after,.custom-control-label:before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:""}.custom-control-label:after{background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label:before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:before{border-color:#2b99a8;background-color:#2b99a8}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label:before,.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label:before{background-color:rgba(43,153,168,.5)}.custom-radio .custom-control-label:before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label:after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(43,153,168,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label:before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label:after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label:after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label:after{background-color:#fff;transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label:before{background-color:rgba(43,153,168,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#76d0dc;outline:0;box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{display:inline-block;margin-bottom:0}.custom-file,.custom-file-input{position:relative;width:100%;height:calc(1.5em + .75rem + 2px)}.custom-file-input{z-index:2;margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#76d0dc;box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label:after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]:after{content:attr(data-browse)}.custom-file-label{left:0;z-index:1;height:calc(1.5em + .75rem + 2px);font-weight:400;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label,.custom-file-label:after{position:absolute;top:0;right:0;padding:.375rem .75rem;line-height:1.5;color:#495057}.custom-file-label:after{bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:initial;-moz-appearance:none;appearance:none}.custom-range:focus{outline:none}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(43,153,168,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(43,153,168,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(43,153,168,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#2b99a8;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#9fdee6}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#2b99a8;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#9fdee6}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#2b99a8;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#9fdee6}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:initial;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower,.custom-range::-ms-fill-upper{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label:before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label:before,.custom-file-label,.custom-select{transition:none}}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:initial;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#2b99a8}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;padding:.5rem 1rem}.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:initial;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat 50%;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media (max-width:1449.98px){.navbar-expand-2xl>.container,.navbar-expand-2xl>.container-fluid,.navbar-expand-2xl>.container-lg,.navbar-expand-2xl>.container-md,.navbar-expand-2xl>.container-sm,.navbar-expand-2xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1450px){.navbar-expand-2xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-2xl .navbar-nav{flex-direction:row}.navbar-expand-2xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-2xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-2xl>.container,.navbar-expand-2xl>.container-fluid,.navbar-expand-2xl>.container-lg,.navbar-expand-2xl>.container-md,.navbar-expand-2xl>.container-sm,.navbar-expand-2xl>.container-xl{flex-wrap:nowrap}.navbar-expand-2xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-2xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand,.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a,.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand,.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:hsla(0,0%,100%,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:hsla(0,0%,100%,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:hsla(0,0%,100%,.5);border-color:hsla(0,0%,100%,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:hsla(0,0%,100%,.5)}.navbar-dark .navbar-text a,.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card,pre{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:initial;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr,pre>hr{margin-right:0;margin-left:0}.card>.list-group,pre>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child,pre>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child,pre>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card>.card-header+.list-group,.card>.list-group+.card-footer,pre>.card-header+.list-group,pre>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem}.card-subtitle,.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:#f8f9fa;border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-footer{padding:.75rem 1.25rem;background-color:#f8f9fa;border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-bottom:-.75rem;border-bottom:0}.card-header-pills,.card-header-tabs{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card,.card-deck pre{margin-bottom:15px}@media (min-width:576px){.card-deck{display:flex;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card,.card-deck pre{flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card,.card-group>pre{margin-bottom:15px}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card,.card-group>pre{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card,.card-group>.card+pre,.card-group>pre+.card,.card-group>pre+pre{margin-left:0;border-left:0}.card-group>.card:not(:last-child),.card-group>pre:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top,.card-group>pre:not(:last-child) .card-header,.card-group>pre:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom,.card-group>pre:not(:last-child) .card-footer,.card-group>pre:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child),.card-group>pre:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top,.card-group>pre:not(:first-child) .card-header,.card-group>pre:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom,.card-group>pre:not(:first-child) .card-footer,.card-group>pre:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card,.card-columns pre{margin-bottom:.75rem}@media (min-width:576px){.card-columns{column-count:3;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card,.card-columns pre{display:inline-block;width:100%}}.accordion{overflow-anchor:none}.accordion>.card,.accordion>pre{overflow:hidden}.accordion>.card:not(:last-of-type),.accordion>pre:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type),.accordion>pre:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header,.accordion>pre>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb,.breadcrumb-item{display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item:before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover:before{text-decoration:underline;text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination,cd-table .cd-datatable .datatable-footer .datatable-pager ul{display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#2b99a8;background-color:#fff;border:1px solid #dee2e6}.page-link:hover,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a:hover{z-index:2;color:#1b626b;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus,cd-table .cd-datatable .datatable-footer .datatable-pager ul li a:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.page-item:first-child .page-link,.page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link,.page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link,.page-item.active cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.active .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.active a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item.active a{z-index:3;color:#fff;background-color:#2b99a8;border-color:#2b99a8}.page-item.disabled .page-link,.page-item.disabled cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.disabled .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul li.disabled a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .page-item.disabled a{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg a{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link,.pagination-lg .page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg .page-item:first-child a{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link,.pagination-lg .page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,.pagination-lg cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-lg li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-lg .page-item:last-child a{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm a{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link,.pagination-sm .page-item:first-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:first-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:first-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm .page-item:first-child a{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link,.pagination-sm .page-item:last-child cd-table .cd-datatable .datatable-footer .datatable-pager ul li a,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child .page-link,.pagination-sm cd-table .cd-datatable .datatable-footer .datatable-pager ul li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:last-child .page-link,cd-table .cd-datatable .datatable-footer .datatable-pager ul .pagination-sm li:last-child a,cd-table .cd-datatable .datatable-footer .datatable-pager ul li .pagination-sm .page-item:last-child a{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:1rem;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:initial;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#2b99a8}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#21747f}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.badge-secondary{color:#fff;background-color:#374249}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#21282c}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(55,66,73,.5)}.badge-success{color:#fff;background-color:#0b0}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#080}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,187,0,.5)}.badge-info{color:#fff;background-color:#2b99a8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#21747f}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(43,153,168,.5)}.badge-warning{color:#212529;background-color:#ffc200}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#cc9b00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,194,0,.5)}.badge-danger{color:#fff;background-color:#ef5c55}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#eb2f26}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#777}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#5e5e5e}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem hsla(0,0%,46.7%,.5)}.badge-accent{color:#fff;background-color:#ef5c55}a.badge-accent:focus,a.badge-accent:hover{color:#fff;background-color:#eb2f26}a.badge-accent.focus,a.badge-accent:focus{outline:0;box-shadow:0 0 0 .2rem rgba(239,92,85,.5)}.badge-warning-dark{color:#212529;background-color:#fd7e14}a.badge-warning-dark:focus,a.badge-warning-dark:hover{color:#212529;background-color:#dc6502}a.badge-warning-dark.focus,a.badge-warning-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(253,126,20,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#165057;background-color:#d5ebee;border-color:#c4e2e7}.alert-primary hr{border-top-color:#b2d9e0}.alert-primary .alert-link{color:#0c2b2e}.alert-secondary{color:#1d2226;background-color:#d7d9db;border-color:#c7cacc}.alert-secondary hr{border-top-color:#babdc0}.alert-secondary .alert-link{color:#070809}.alert-success{color:#006100;background-color:#ccf1cc;border-color:#b8ecb8}.alert-success hr{border-top-color:#a4e7a4}.alert-success .alert-link{color:#002e00}.alert-info{color:#165057;background-color:#d5ebee;border-color:#c4e2e7}.alert-info hr{border-top-color:#b2d9e0}.alert-info .alert-link{color:#0c2b2e}.alert-warning{color:#856500;background-color:#fff3cc;border-color:#ffeeb8}.alert-warning hr{border-top-color:#ffe89f}.alert-warning .alert-link{color:#523e00}.alert-danger{color:#7c302c;background-color:#fcdedd;border-color:#fbd1cf}.alert-danger hr{border-top-color:#f9bab7}.alert-danger .alert-link{color:#56211f}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#3e3e3e;background-color:#e4e4e4;border-color:#d9d9d9}.alert-dark hr{border-top-color:#ccc}.alert-dark .alert-link{color:#252525}.alert-accent{color:#7c302c;background-color:#fcdedd;border-color:#fbd1cf}.alert-accent hr{border-top-color:#f9bab7}.alert-accent .alert-link{color:#56211f}.alert-warning-dark{color:#84420a;background-color:#ffe5d0;border-color:#fedbbd}.alert-warning-dark hr{border-top-color:#fecda4}.alert-warning-dark .alert-link{color:#552a06}@keyframes progress-bar-stripes{0%{background-position:1rem 0}to{background-position:0 0}}.progress{height:1rem;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress,.progress-bar{display:flex;overflow:hidden}.progress-bar{flex-direction:column;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#2b99a8;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.media{display:flex;align-items:flex-start}.media-body{flex:1}.list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#2b99a8;border-color:#2b99a8}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1450px){.list-group-horizontal-2xl{flex-direction:row}.list-group-horizontal-2xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-2xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-2xl>.list-group-item.active{margin-top:0}.list-group-horizontal-2xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-2xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#165057;background-color:#c4e2e7}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#165057;background-color:#b2d9e0}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#165057;border-color:#165057}.list-group-item-secondary{color:#1d2226;background-color:#c7cacc}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#1d2226;background-color:#babdc0}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#1d2226;border-color:#1d2226}.list-group-item-success{color:#006100;background-color:#b8ecb8}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#006100;background-color:#a4e7a4}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#006100;border-color:#006100}.list-group-item-info{color:#165057;background-color:#c4e2e7}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#165057;background-color:#b2d9e0}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#165057;border-color:#165057}.list-group-item-warning{color:#856500;background-color:#ffeeb8}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856500;background-color:#ffe89f}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856500;border-color:#856500}.list-group-item-danger{color:#7c302c;background-color:#fbd1cf}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#7c302c;background-color:#f9bab7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#7c302c;border-color:#7c302c}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#3e3e3e;background-color:#d9d9d9}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#3e3e3e;background-color:#ccc}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#3e3e3e;border-color:#3e3e3e}.list-group-item-accent{color:#7c302c;background-color:#fbd1cf}.list-group-item-accent.list-group-item-action:focus,.list-group-item-accent.list-group-item-action:hover{color:#7c302c;background-color:#f9bab7}.list-group-item-accent.list-group-item-action.active{color:#fff;background-color:#7c302c;border-color:#7c302c}.list-group-item-warning-dark{color:#84420a;background-color:#fedbbd}.list-group-item-warning-dark.list-group-item-action:focus,.list-group-item-warning-dark.list-group-item-action:hover{color:#84420a;background-color:#fecda4}.list-group-item-warning-dark.list-group-item-action.active{color:#fff;background-color:#84420a;border-color:#84420a}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:initial;border:0}a.close.disabled{pointer-events:none}.toast{flex-basis:350px;max-width:350px;font-size:.875rem;background-color:hsla(0,0%,100%,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:flex;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:hsla(0,0%,100%,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05);border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translateY(-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered:before{display:block;height:calc(100vh - 1rem);height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable:before{content:none}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered:before{height:calc(100vh - 3.5rem);height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow:before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow:before,.bs-tooltip-top .arrow:before{top:0;border-width:.4rem .4rem 0;border-top-color:#212529}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow:before,.bs-tooltip-right .arrow:before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#212529}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow:before,.bs-tooltip-bottom .arrow:before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#212529}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow:before,.bs-tooltip-left .arrow:before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#212529}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#212529;border-radius:.25rem}.popover{top:0;left:0;z-index:1060;max-width:350px;font-family:Helvetica Neue,Helvetica,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:1rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover,.popover .arrow{position:absolute;display:block}.popover .arrow{width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow:after,.popover .arrow:before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow:before,.bs-popover-top>.arrow:before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow:after,.bs-popover-top>.arrow:after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow:before,.bs-popover-right>.arrow:before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow:after,.bs-popover-right>.arrow:after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow:before,.bs-popover-bottom>.arrow:before{top:0;border-width:0 .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow:after,.bs-popover-bottom>.arrow:after{top:1px;border-width:0 .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header:before,.bs-popover-bottom .popover-header:before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow:before,.bs-popover-left>.arrow:before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow:after,.bs-popover-left>.arrow:after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner:after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:flex;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:initial;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@keyframes spinner-border{to{transform:rotate(1turn)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid;border-right:.25em solid transparent;border-radius:50%;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:initial!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#2b99a8!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#21747f!important}.bg-secondary{background-color:#374249!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#21282c!important}.bg-success{background-color:#0b0!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#080!important}.bg-info{background-color:#2b99a8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#21747f!important}.bg-warning{background-color:#ffc200!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#cc9b00!important}.bg-danger{background-color:#ef5c55!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#eb2f26!important}.bg-light,pre{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#777!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#5e5e5e!important}.bg-accent{background-color:#ef5c55!important}a.bg-accent:focus,a.bg-accent:hover,button.bg-accent:focus,button.bg-accent:hover{background-color:#eb2f26!important}.bg-warning-dark{background-color:#fd7e14!important}a.bg-warning-dark:focus,a.bg-warning-dark:hover,button.bg-warning-dark:focus,button.bg-warning-dark:hover{background-color:#dc6502!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:initial!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom,.cd-header,legend{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#2b99a8!important}.border-secondary{border-color:#374249!important}.border-success{border-color:#0b0!important}.border-info{border-color:#2b99a8!important}.border-warning{border-color:#ffc200!important}.border-danger{border-color:#ef5c55!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#777!important}.border-accent{border-color:#ef5c55!important}.border-warning-dark{border-color:#fd7e14!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important}.rounded-right,.rounded-top{border-top-right-radius:.25rem!important}.rounded-bottom,.rounded-right{border-bottom-right-radius:.25rem!important}.rounded-bottom,.rounded-left{border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix:after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex,cd-health cd-info-card{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media (min-width:1450px){.d-2xl-none{display:none!important}.d-2xl-inline{display:inline!important}.d-2xl-inline-block{display:inline-block!important}.d-2xl-block{display:block!important}.d-2xl-table{display:table!important}.d-2xl-table-row{display:table-row!important}.d-2xl-table-cell{display:table-cell!important}.d-2xl-flex{display:flex!important}.d-2xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive:before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9:before{padding-top:42.8571428571%}.embed-responsive-16by9:before{padding-top:56.25%}.embed-responsive-4by3:before{padding-top:75%}.embed-responsive-1by1:before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column,cd-health cd-info-card{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}@media (min-width:576px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}}@media (min-width:768px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}}@media (min-width:1450px){.flex-2xl-row{flex-direction:row!important}.flex-2xl-column{flex-direction:column!important}.flex-2xl-row-reverse{flex-direction:row-reverse!important}.flex-2xl-column-reverse{flex-direction:column-reverse!important}.flex-2xl-wrap{flex-wrap:wrap!important}.flex-2xl-nowrap{flex-wrap:nowrap!important}.flex-2xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-2xl-fill{flex:1 1 auto!important}.flex-2xl-grow-0{flex-grow:0!important}.flex-2xl-grow-1{flex-grow:1!important}.flex-2xl-shrink-0{flex-shrink:0!important}.flex-2xl-shrink-1{flex-shrink:1!important}.justify-content-2xl-start{justify-content:flex-start!important}.justify-content-2xl-end{justify-content:flex-end!important}.justify-content-2xl-center{justify-content:center!important}.justify-content-2xl-between{justify-content:space-between!important}.justify-content-2xl-around{justify-content:space-around!important}.align-items-2xl-start{align-items:flex-start!important}.align-items-2xl-end{align-items:flex-end!important}.align-items-2xl-center{align-items:center!important}.align-items-2xl-baseline{align-items:baseline!important}.align-items-2xl-stretch{align-items:stretch!important}.align-content-2xl-start{align-content:flex-start!important}.align-content-2xl-end{align-content:flex-end!important}.align-content-2xl-center{align-content:center!important}.align-content-2xl-between{align-content:space-between!important}.align-content-2xl-around{align-content:space-around!important}.align-content-2xl-stretch{align-content:stretch!important}.align-self-2xl-auto{align-self:auto!important}.align-self-2xl-start{align-self:flex-start!important}.align-self-2xl-end{align-self:flex-end!important}.align-self-2xl-center{align-self:center!important}.align-self-2xl-baseline{align-self:baseline!important}.align-self-2xl-stretch{align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}@media (min-width:1450px){.float-2xl-left{float:left!important}.float-2xl-right{float:right!important}.float-2xl-none{float:none!important}}.user-select-all{user-select:all!important}.user-select-auto{user-select:auto!important}.user-select-none{user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.fixed-top{top:0}.fixed-bottom,.fixed-top{position:fixed;right:0;left:0;z-index:1030}.fixed-bottom{bottom:0}@supports (position:sticky){.sticky-top{position:sticky;top:0;z-index:1020}}.sr-only{white-space:nowrap}.sr-only-focusable:active,.sr-only-focusable:focus{white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.btn-toolbar cd-table-actions.btn-group,.mr-2,.mx-2,cd-logs label{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3,cd-logs .form-inline>.form-group{margin-right:1rem!important}.mb-3,.my-3,cd-logs .form-inline>.form-group{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.cd-header,.mt-4,.my-4,legend{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.cd-header,.mb-4,.my-4,cd-health cd-info-card,legend{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.cd-header,.pb-1,.py-1,legend{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2,cd-table .cd-datatable .datatable-footer,pre{padding:.5rem!important}.pt-2,.py-2,cd-info-card .card .card-body .card-text,cd-info-card pre .card-body .card-text{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2,cd-info-card .card,cd-info-card pre{padding-bottom:.5rem!important}.pl-2,.px-2,cd-info-card .card .card-body .card-title,cd-info-card pre .card-body .card-title{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}@media (min-width:1450px){.m-2xl-0{margin:0!important}.mt-2xl-0,.my-2xl-0{margin-top:0!important}.mr-2xl-0,.mx-2xl-0{margin-right:0!important}.mb-2xl-0,.my-2xl-0{margin-bottom:0!important}.ml-2xl-0,.mx-2xl-0{margin-left:0!important}.m-2xl-1{margin:.25rem!important}.mt-2xl-1,.my-2xl-1{margin-top:.25rem!important}.mr-2xl-1,.mx-2xl-1{margin-right:.25rem!important}.mb-2xl-1,.my-2xl-1{margin-bottom:.25rem!important}.ml-2xl-1,.mx-2xl-1{margin-left:.25rem!important}.m-2xl-2{margin:.5rem!important}.mt-2xl-2,.my-2xl-2{margin-top:.5rem!important}.mr-2xl-2,.mx-2xl-2{margin-right:.5rem!important}.mb-2xl-2,.my-2xl-2{margin-bottom:.5rem!important}.ml-2xl-2,.mx-2xl-2{margin-left:.5rem!important}.m-2xl-3{margin:1rem!important}.mt-2xl-3,.my-2xl-3{margin-top:1rem!important}.mr-2xl-3,.mx-2xl-3{margin-right:1rem!important}.mb-2xl-3,.my-2xl-3{margin-bottom:1rem!important}.ml-2xl-3,.mx-2xl-3{margin-left:1rem!important}.m-2xl-4{margin:1.5rem!important}.mt-2xl-4,.my-2xl-4{margin-top:1.5rem!important}.mr-2xl-4,.mx-2xl-4{margin-right:1.5rem!important}.mb-2xl-4,.my-2xl-4{margin-bottom:1.5rem!important}.ml-2xl-4,.mx-2xl-4{margin-left:1.5rem!important}.m-2xl-5{margin:3rem!important}.mt-2xl-5,.my-2xl-5{margin-top:3rem!important}.mr-2xl-5,.mx-2xl-5{margin-right:3rem!important}.mb-2xl-5,.my-2xl-5{margin-bottom:3rem!important}.ml-2xl-5,.mx-2xl-5{margin-left:3rem!important}.p-2xl-0{padding:0!important}.pt-2xl-0,.py-2xl-0{padding-top:0!important}.pr-2xl-0,.px-2xl-0{padding-right:0!important}.pb-2xl-0,.py-2xl-0{padding-bottom:0!important}.pl-2xl-0,.px-2xl-0{padding-left:0!important}.p-2xl-1{padding:.25rem!important}.pt-2xl-1,.py-2xl-1{padding-top:.25rem!important}.pr-2xl-1,.px-2xl-1{padding-right:.25rem!important}.pb-2xl-1,.py-2xl-1{padding-bottom:.25rem!important}.pl-2xl-1,.px-2xl-1{padding-left:.25rem!important}.p-2xl-2{padding:.5rem!important}.pt-2xl-2,.py-2xl-2{padding-top:.5rem!important}.pr-2xl-2,.px-2xl-2{padding-right:.5rem!important}.pb-2xl-2,.py-2xl-2{padding-bottom:.5rem!important}.pl-2xl-2,.px-2xl-2{padding-left:.5rem!important}.p-2xl-3{padding:1rem!important}.pt-2xl-3,.py-2xl-3{padding-top:1rem!important}.pr-2xl-3,.px-2xl-3{padding-right:1rem!important}.pb-2xl-3,.py-2xl-3{padding-bottom:1rem!important}.pl-2xl-3,.px-2xl-3{padding-left:1rem!important}.p-2xl-4{padding:1.5rem!important}.pt-2xl-4,.py-2xl-4{padding-top:1.5rem!important}.pr-2xl-4,.px-2xl-4{padding-right:1.5rem!important}.pb-2xl-4,.py-2xl-4{padding-bottom:1.5rem!important}.pl-2xl-4,.px-2xl-4{padding-left:1.5rem!important}.p-2xl-5{padding:3rem!important}.pt-2xl-5,.py-2xl-5{padding-top:3rem!important}.pr-2xl-5,.px-2xl-5{padding-right:3rem!important}.pb-2xl-5,.py-2xl-5{padding-bottom:3rem!important}.pl-2xl-5,.px-2xl-5{padding-left:3rem!important}.m-2xl-n1{margin:-.25rem!important}.mt-2xl-n1,.my-2xl-n1{margin-top:-.25rem!important}.mr-2xl-n1,.mx-2xl-n1{margin-right:-.25rem!important}.mb-2xl-n1,.my-2xl-n1{margin-bottom:-.25rem!important}.ml-2xl-n1,.mx-2xl-n1{margin-left:-.25rem!important}.m-2xl-n2{margin:-.5rem!important}.mt-2xl-n2,.my-2xl-n2{margin-top:-.5rem!important}.mr-2xl-n2,.mx-2xl-n2{margin-right:-.5rem!important}.mb-2xl-n2,.my-2xl-n2{margin-bottom:-.5rem!important}.ml-2xl-n2,.mx-2xl-n2{margin-left:-.5rem!important}.m-2xl-n3{margin:-1rem!important}.mt-2xl-n3,.my-2xl-n3{margin-top:-1rem!important}.mr-2xl-n3,.mx-2xl-n3{margin-right:-1rem!important}.mb-2xl-n3,.my-2xl-n3{margin-bottom:-1rem!important}.ml-2xl-n3,.mx-2xl-n3{margin-left:-1rem!important}.m-2xl-n4{margin:-1.5rem!important}.mt-2xl-n4,.my-2xl-n4{margin-top:-1.5rem!important}.mr-2xl-n4,.mx-2xl-n4{margin-right:-1.5rem!important}.mb-2xl-n4,.my-2xl-n4{margin-bottom:-1.5rem!important}.ml-2xl-n4,.mx-2xl-n4{margin-left:-1.5rem!important}.m-2xl-n5{margin:-3rem!important}.mt-2xl-n5,.my-2xl-n5{margin-top:-3rem!important}.mr-2xl-n5,.mx-2xl-n5{margin-right:-3rem!important}.mb-2xl-n5,.my-2xl-n5{margin-bottom:-3rem!important}.ml-2xl-n5,.mx-2xl-n5{margin-left:-3rem!important}.m-2xl-auto{margin:auto!important}.mt-2xl-auto,.my-2xl-auto{margin-top:auto!important}.mr-2xl-auto,.mx-2xl-auto{margin-right:auto!important}.mb-2xl-auto,.my-2xl-auto{margin-bottom:auto!important}.ml-2xl-auto,.mx-2xl-auto{margin-left:auto!important}}.stretched-link:after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:transparent}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width:1450px){.text-2xl-left{text-align:left!important}.text-2xl-right{text-align:right!important}.text-2xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold,cd-about dt{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#2b99a8!important}a.text-primary:focus,a.text-primary:hover{color:#1b626b!important}.text-secondary{color:#374249!important}a.text-secondary:focus,a.text-secondary:hover{color:#161b1d!important}.text-success{color:#0b0!important}a.text-success:focus,a.text-success:hover{color:#006f00!important}.text-info{color:#2b99a8!important}a.text-info:focus,a.text-info:hover{color:#1b626b!important}.text-warning{color:#ffc200!important}a.text-warning:focus,a.text-warning:hover{color:#b38800!important}.text-danger{color:#ef5c55!important}a.text-danger:focus,a.text-danger:hover{color:#e21f15!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#777!important}a.text-dark:focus,a.text-dark:hover{color:#515151!important}.text-accent{color:#ef5c55!important}a.text-accent:focus,a.text-accent:hover{color:#e21f15!important}.text-warning-dark{color:#fd7e14!important}a.text-warning-dark:focus,a.text-warning-dark:hover{color:#c35a02!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:hsla(0,0%,100%,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:initial;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,:after,:before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]:after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}.container,body{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}
-/*!
-Fork Awesome 1.1.7
-License - https://forkaweso.me/Fork-Awesome/license
-
-Copyright 2018 Dave Gandy & Fork Awesome
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */@font-face{font-family:ForkAwesome;src:url(forkawesome-webfont.e182ad6df04f9177b326.eot?v=1.1.7);src:url(forkawesome-webfont.e182ad6df04f9177b326.eot?#iefix&v=1.1.7) format("embedded-opentype"),url(forkawesome-webfont.7c20758e3e7c7dff7c8d.woff2?v=1.1.7) format("woff2"),url(forkawesome-webfont.2dfb5f36fc148e26e398.woff?v=1.1.7) format("woff"),url(forkawesome-webfont.ee4d8bfd0af89fc714a2.ttf?v=1.1.7) format("truetype"),url(forkawesome-webfont.86541105409e56d17291.svg?v=1.1.7#forkawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 ForkAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa,.fa-fw{width:1.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s linear infinite}.fa-pulse{animation:fa-spin 1s steps(8) infinite}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before,.fa-sync:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before,.fa-video:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell-o:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-globe-e:before{content:""}.fa-globe-w:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-community:before,.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus-g:before,.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before,.fa-utensils:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before,.fa-pound:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:""}.fa-sort-alpha-desc:before,.fa-sort-alpha-up:before{content:""}.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:""}.fa-sort-amount-desc:before,.fa-sort-amount-up:before{content:""}.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:""}.fa-sort-numeric-desc:before,.fa-sort-numeric-up:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before,.fa-utensil-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before,.fa-heading:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before,.fa-closed-captioning:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before,.fa-gem:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-medium-square:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo-v:before,.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-phone-volume:before,.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.fa-mastodon:before{content:""}.fa-mastodon-alt:before{content:""}.fa-fork-awesome:before,.fa-fork-circle:before{content:""}.fa-peertube:before{content:""}.fa-diaspora:before{content:""}.fa-friendica:before{content:""}.fa-gnu-social:before{content:""}.fa-liberapay-square:before{content:""}.fa-liberapay:before{content:""}.fa-scuttlebutt:before,.fa-ssb:before{content:""}.fa-hubzilla:before{content:""}.fa-social-home:before{content:""}.fa-artstation:before{content:""}.fa-discord:before{content:""}.fa-discord-alt:before{content:""}.fa-patreon:before{content:""}.fa-snowdrift:before{content:""}.fa-activitypub:before{content:""}.fa-ethereum:before{content:""}.fa-keybase:before{content:""}.fa-shaarli:before{content:""}.fa-shaarli-o:before{content:""}.fa-cut-key:before,.fa-key-modern:before{content:""}.fa-xmpp:before{content:""}.fa-archive-org:before{content:""}.fa-freedombox:before{content:""}.fa-facebook-messenger:before{content:""}.fa-debian:before{content:""}.fa-mastodon-square:before{content:""}.fa-tipeee:before{content:""}.fa-react:before{content:""}.fa-dogmazic:before{content:""}.fa-zotero:before{content:""}.fa-nodejs:before{content:""}.fa-nextcloud:before{content:""}.fa-nextcloud-square:before{content:""}.fa-hackaday:before{content:""}.fa-laravel:before{content:""}.fa-signalapp:before{content:""}.fa-gnupg:before{content:""}.fa-php:before{content:""}.fa-ffmpeg:before{content:""}.fa-joplin:before{content:""}.fa-syncthing:before{content:""}.fa-inkscape:before{content:""}.fa-matrix-org:before{content:""}.fa-pixelfed:before{content:""}.fa-bootstrap:before{content:""}.fa-dev-to:before{content:""}.fa-hashnode:before{content:""}.fa-jirafeau:before{content:""}.fa-emby:before{content:""}.fa-wikidata:before{content:""}.fa-gimp:before{content:""}.fa-c:before{content:""}.fa-digitalocean:before{content:""}.fa-att:before{content:""}.fa-gitea:before{content:""}.fa-file-epub:before{content:""}.fa-python:before{content:""}.fa-archlinux:before{content:""}.fa-pleroma:before{content:""}.fa-unsplash:before{content:""}.fa-hackster:before{content:""}.fa-spell-check:before{content:""}.fa-moon:before{content:""}.fa-sun:before{content:""}.fa-f-droid:before{content:""}.fa-biometric:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.info-card-popover-cluster-status{max-height:20vh;max-width:23vw}.info-card-popover-cluster-status .popover-body{font-size:1rem;max-height:19vh;max-width:100%;overflow:auto}@media (max-width:calc(1200px - 1px)){.info-card-popover-cluster-status{max-width:31vw}}@media (max-width:calc(992px - 1px)){.info-card-popover-cluster-status{max-width:46vw}}@media (max-width:calc(768px - 1px)){.info-card-popover-cluster-status{max-width:83vw}}.info-card-content-clickable{border:1px solid #e9ecef;border-radius:3px;cursor:pointer;padding:7px}.info-card-content-clickable:hover{background-color:#e9ecef;border-color:#ced4da}html{background-color:#fff}body,html{font-size:12px;height:100%;width:100%}option{font-style:normal;font-weight:400}.full-height{height:100vh}.full-width{width:100vw}.vertical-align{align-items:center;display:flex}.horizontal-align{display:flex;justify-content:center}.loading{left:50%;position:absolute;top:50%}.margin-right-md{margin-right:15px}.no-border{border:0;box-shadow:0 0 0!important}.italic{font-style:italic}.bold{font-weight:700}.text-right{text-align:right}.text-monospace{font-family:monospace}.text-pre-wrap{white-space:pre-wrap}.text-pre{white-space:pre}.border-danger{border-left:4px solid #ef5c55}.border-info{border-left:4px solid #2b99a8}.border-success{border-left:4px solid #0b0}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:initial}.custom-control-input.is-valid:checked~.custom-control-label:before,.was-validated .custom-control-input:valid:checked~.custom-control-label:before{background-color:#2b99a8;border-color:#2b99a8}.custom-control-input.is-valid~.custom-control-label:before,.was-validated .custom-control-input:valid~.custom-control-label:before{border-color:#adb5bd}.custom-control-input.is-valid:focus~.custom-control-label:before,.was-validated .custom-control-input:valid:focus~.custom-control-label:before{box-shadow:0 0 0 .2rem rgba(43,153,168,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label:before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label:before{border-color:#76d0dc}.btn-light{background-color:#fff;border-color:#ced4da!important}.btn-light:hover{background-color:#dee2e6;border-color:#6c757d!important}.btn-light:disabled{background-color:#e9ecef;border-color:#ced4da!important}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:0}.btn.disabled{border:0;box-shadow:none}.btn-primary .badge{background-color:#e9ecef;color:#2b99a8}.btn-group>.btn>i.fa,.cd-datatable-actions button.btn i.fa{margin-right:5px}.card-footer button.btn:not(:first-child){margin-left:5px}.dropdown-menu{min-width:50px;z-index:999999}.dropdown-menu button.dropdown-item:focus{outline:none}.dropdown-menu>li>a{cursor:pointer}.dropdown-menu>li>a>i.fa{margin-right:5px}.dropdown-menu>.active>a{background-color:#2b99a8;color:#e9ecef}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#21747f}.dataTables_wrapper .dropdown-menu>li.dropdown-divider{cursor:auto}.required:after{color:#ef5c55;content:"*";font-size:1.167rem;padding-left:4px}.form-footer{display:flex;width:100%}.cd-form-control,.form-control{display:table-cell}.cd-form-control:focus,.form-control:focus{border-color:rgba(43,153,168,.8);box-shadow:0 0 3px 2px rgba(43,153,168,.5);outline:0}.custom-checkbox{padding-top:7px}.invalid-feedback{display:block}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{padding:0 30px}.ceph-icon{background:url(Ceph_Logo.487a0001b327fa7f5232.svg)}.prometheus-icon{background:url(prometheus_logo.8b3183e5a2db0e87bb2b.svg)}.custom-icon{background-clip:padding-box;background-repeat:no-repeat;background-size:contain;margin-right:8px;padding:10px}.nav-tabs{margin-bottom:1rem}#toast-container{margin-top:2vw}@media (max-width:1600px){#toast-container{margin-top:2.5vw}}@media (max-width:calc(992px - 1px)){#toast-container{margin-top:9vw}}@media (max-width:900px){#toast-container{margin-top:10vw}}@media (max-width:319px){#toast-container{margin-top:11vw}}@media (max-width:260px){#toast-container{margin-top:14vw}}.toast-message>ul{margin:0;padding-left:1rem}.noscript{padding-top:5em}@media (min-width:576px){.cd-col-form-label,.col-form-label{text-align:right}}.cd-col-form-label,.col-form-label{font-weight:700}.password-strength-level{flex:100%;margin-top:2px}.password-strength-level .ok,.password-strength-level .strong,.password-strength-level .very-strong,.password-strength-level .weak{border-radius:.25rem;height:13px}.password-strength-level .weak{background:#ef5c55;width:25%}.password-strength-level .ok{background:#ffc200;width:50%}.password-strength-level .strong{background:#0b0;width:75%}.password-strength-level .very-strong{background:#006f00;width:100%}.badge-background-gray,.badge-hdd{background-color:#6c757d;color:#fff}.badge-background-primary,.badge-ssd{background-color:#2b99a8;color:#fff}.badge-tab{background-color:#e9ecef;color:#495057}tree-root tree-viewport{min-height:1em}tags-input .tags{border:1px solid #ced4da;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.09)}.card-header{font-size:1.3em}.card-body h2:first-child{margin-top:0}.disabled{pointer-events:none}.clickable,a{cursor:pointer}
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui-bundle.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui-bundle.js
deleted file mode 100644 (file)
index d3afaab..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=540)}([function(e,t,n){"use strict";e.exports=n(126)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:$(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",v="delete",m=5,g=1<<m,y=g-1,b={},_={value:!1},w={value:!1};function E(e){return e.value=!1,e}function x(e){e&&(e.value=!0)}function C(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function A(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function O(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function I(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var N=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function J(e){return e&&"number"==typeof e.length}function $(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=N,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t($,n),$.of=function(){return $(arguments)},$.prototype.toSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq {","}")},$.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},$.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},$.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,$),K.prototype.toKeyedSeq=function(){return this},t(Y,$),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,$),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},$.isSeq=ae,$.Keyed=K,$.Set=G,$.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function le(e){return J(e)?new te(e):V(e)?new oe(e):z(e)?new re(e):void 0}function pe(e,t,n,r){var o=e._cache;if(o){for(var a=o.length-1,i=0;i<=a;i++){var s=o[n?a-i:i];if(!1===t(s[1],r?s[0]:i,e))return i+1}return i}return e.__iterateUncached(t,n)}function fe(e,t,n,r){var o=e._cache;if(o){var a=o.length-1,i=0;return new F((function(){var e=o[n?a-i:i];return i++>a?q():U(t,r?e[0]:i-1,e[1])}))}return e.__iteratorUncached(t,n)}function he(e,t){return t?de(t,e,"",{"":e}):ve(e)}function de(e,t,n,r){return Array.isArray(t)?e.call(r,n,Y(t).map((function(n,r){return de(e,n,r,t)}))):me(t)?e.call(r,n,K(t).map((function(n,r){return de(e,n,r,t)}))):t}function ve(e){return Array.isArray(e)?Y(e).map(ve).toList():me(e)?K(e).map(ve).toMap():e}function me(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ge(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ye(e,t){if(e===t)return!0;if(!i(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&ge(o[1],e)&&(n||ge(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var a=e;e=t,t=a}var p=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):o?!ge(t,e.get(r,b)):!ge(e.get(r,b),t))return p=!1,!1}));return p&&e.size===f}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function _e(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(_e(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Q)return Q;Q=this}}function Ee(){throw TypeError("Abstract")}function xe(){}function Ce(){}function Se(){}$.prototype[ee]=!0,t(te,Y),te.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?q():U(e,o,n[t?r-o++:o++])}))},t(ne,K),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,a=0;a<=o;a++){var i=r[t?o-a:a];if(!1===e(n[i],i,this))return a+1}return a},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,a=0;return new F((function(){var i=r[t?o-a:a];return a++>o?q():U(e,i,n[i])}))},ne.prototype[d]=!0,t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=W(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=W(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,Y),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,a=0;a<o.length;)if(!1===e(o[a],a++,this))return a;for(;!(n=r.next()).done;){var i=n.value;if(o[a]=i,!1===e(i,a++,this))break}return a},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(be,Y),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return ge(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return j(e,t,n)?this:new be(this._value,I(t,n)-T(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return ge(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return ge(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},be.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):q()}))},be.prototype.equals=function(e){return e instanceof be?ge(this._value,e._value):ye(e)},t(we,Y),we.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},we.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},we.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},we.prototype.slice=function(e,t){return j(e,t,this.size)?this:(e=T(e,this.size),(t=I(t,this.size))<=e?new we(0,0):new we(this.get(e,this._end),this.get(t,this._end),this._step))},we.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},we.prototype.lastIndexOf=function(e){return this.indexOf(e)},we.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,a=0;a<=n;a++){if(!1===e(o,a,this))return a+1;o+=t?-r:r}return a},we.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,a=0;return new F((function(){var i=o;return o+=t?-r:r,a>n?q():U(e,a++,i)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:ye(this,e)},t(Ee,n),t(xe,Ee),t(Ce,Ee),t(Se,Ee),Ee.Keyed=xe,Ee.Indexed=Ce,Ee.Set=Se;var Ae="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function Oe(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Fe?je(e):Te(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return Ie(e);if("function"==typeof e.toString)return Te(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function je(e){var t=ze[e];return void 0===t&&(t=Te(e),qe===Ue&&(qe=0,ze={}),qe++,ze[e]=t),t}function Te(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}function Ie(e){var t;if(De&&void 0!==(t=Re.get(e)))return t;if(void 0!==(t=e[Be]))return t;if(!Ne){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Be]))return t;if(void 0!==(t=Me(e)))return t}if(t=++Le,1073741824&Le&&(Le=0),De)Re.set(e,t);else{if(void 0!==Pe&&!1===Pe(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Ne)Object.defineProperty(e,Be,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Be]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Be]=t}}return t}var Pe=Object.isExtensible,Ne=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function Me(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Re,De="function"==typeof WeakMap;De&&(Re=new WeakMap);var Le=0,Be="__immutablehash__";"function"==typeof Symbol&&(Be=Symbol(Be));var Fe=16,Ue=255,qe=0,ze={};function Ve(e){_e(e!==1/0,"Cannot perform this action with an infinite size.")}function We(e){return null==e?ot():He(e)&&!l(e)?e:ot().withMutations((function(t){var n=r(e);Ve(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function He(e){return!(!e||!e[$e])}t(We,xe),We.of=function(){var t=e.call(arguments,0);return ot().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},We.prototype.toString=function(){return this.__toString("Map {","}")},We.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},We.prototype.set=function(e,t){return at(this,e,t)},We.prototype.setIn=function(e,t){return this.updateIn(e,b,(function(){return t}))},We.prototype.remove=function(e){return at(this,e,b)},We.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return b}))},We.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},We.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=mt(this,En(e),t,n);return r===b?void 0:r},We.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ot()},We.prototype.merge=function(){return ft(this,void 0,arguments)},We.prototype.mergeWith=function(t){return ft(this,t,e.call(arguments,1))},We.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},We.prototype.mergeDeep=function(){return ft(this,ht,arguments)},We.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ft(this,dt(t),n)},We.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},We.prototype.sort=function(e){return zt(pn(this,e))},We.prototype.sortBy=function(e,t){return zt(pn(this,t,e))},We.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},We.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new C)},We.prototype.asImmutable=function(){return this.__ensureOwner()},We.prototype.wasAltered=function(){return this.__altered},We.prototype.__iterator=function(e,t){return new et(this,e,t)},We.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},We.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},We.isMap=He;var Je,$e="@@__IMMUTABLE_MAP__@@",Ke=We.prototype;function Ye(e,t){this.ownerID=e,this.entries=t}function Ge(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ze(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Xe(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Qe(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return U(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var o=Object.create(Ke);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function ot(){return Je||(Je=rt(0))}function at(e,t,n){var r,o;if(e._root){var a=E(_),i=E(w);if(r=it(e._root,e.__ownerID,0,void 0,t,n,a,i),!i.value)return e;o=e.size+(a.value?n===b?-1:1:0)}else{if(n===b)return e;o=1,r=new Ye(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(o,r):ot()}function it(e,t,n,r,o,a,i,s){return e?e.update(t,n,r,o,a,i,s):a===b?e:(x(s),x(i),new Qe(t,r,[o,a]))}function st(e){return e.constructor===Qe||e.constructor===Xe}function ut(e,t,n,r,o){if(e.keyHash===r)return new Xe(t,r,[e.entry,o]);var a,i=(0===n?e.keyHash:e.keyHash>>>n)&y,s=(0===n?r:r>>>n)&y;return new Ge(t,1<<i|1<<s,i===s?[ut(e,t,n+m,r,o)]:(a=new Qe(t,r,o),i<s?[e,a]:[a,e]))}function ct(e,t,n,r){e||(e=new C);for(var o=new Qe(e,Oe(n),[n,r]),a=0;a<t.length;a++){var i=t[a];o=o.update(e,0,void 0,i[0],i[1])}return o}function lt(e,t,n,r){for(var o=0,a=0,i=new Array(n),s=0,u=1,c=t.length;s<c;s++,u<<=1){var l=t[s];void 0!==l&&s!==r&&(o|=u,i[a++]=l)}return new Ge(e,o,i)}function pt(e,t,n,r,o){for(var a=0,i=new Array(g),s=0;0!==n;s++,n>>>=1)i[s]=1&n?t[a++]:void 0;return i[r]=o,new Ze(e,a+1,i)}function ft(e,t,n){for(var o=[],a=0;a<n.length;a++){var s=n[a],u=r(s);i(s)||(u=u.map((function(e){return he(e)}))),o.push(u)}return vt(e,t,o)}function ht(e,t,n){return e&&e.mergeDeep&&i(t)?e.mergeDeep(t):ge(e,t)?e:t}function dt(e){return function(t,n,r){if(t&&t.mergeDeepWith&&i(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return ge(t,o)?t:o}}function vt(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,b,(function(e){return e===b?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function mt(e,t,n,r){var o=e===b,a=t.next();if(a.done){var i=o?n:e,s=r(i);return s===i?e:s}_e(o||e&&e.set,"invalid keyPath");var u=a.value,c=o?b:e.get(u,b),l=mt(c,t,n,r);return l===c?e:l===b?e.remove(u):(o?ot():e).set(u,l)}function gt(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function yt(e,t,n,r){var o=r?e:S(e);return o[t]=n,o}function bt(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var a=new Array(o),i=0,s=0;s<o;s++)s===t?(a[s]=n,i=-1):a[s]=e[s+i];return a}function _t(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),a=0,i=0;i<r;i++)i===t&&(a=1),o[i]=e[i+a];return o}Ke[$e]=!0,Ke[v]=Ke.remove,Ke.removeIn=Ke.deleteIn,Ye.prototype.get=function(e,t,n,r){for(var o=this.entries,a=0,i=o.length;a<i;a++)if(ge(n,o[a][0]))return o[a][1];return r},Ye.prototype.update=function(e,t,n,r,o,a,i){for(var s=o===b,u=this.entries,c=0,l=u.length;c<l&&!ge(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(i),(s||!p)&&x(a),!s||1!==u.length){if(!p&&!s&&u.length>=wt)return ct(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ye(e,h)}},Ge.prototype.get=function(e,t,n,r){void 0===t&&(t=Oe(n));var o=1<<((0===e?t:t>>>e)&y),a=this.bitmap;return 0==(a&o)?r:this.nodes[gt(a&o-1)].get(e+m,t,n,r)},Ge.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=Oe(r));var s=(0===t?n:n>>>t)&y,u=1<<s,c=this.bitmap,l=0!=(c&u);if(!l&&o===b)return this;var p=gt(c&u-1),f=this.nodes,h=l?f[p]:void 0,d=it(h,e,t+m,n,r,o,a,i);if(d===h)return this;if(!l&&d&&f.length>=Et)return pt(e,f,c,s,d);if(l&&!d&&2===f.length&&st(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&st(d))return d;var v=e&&e===this.ownerID,g=l?d?c:c^u:c|u,_=l?d?yt(f,p,d,v):_t(f,p,v):bt(f,p,d,v);return v?(this.bitmap=g,this.nodes=_,this):new Ge(e,g,_)},Ze.prototype.get=function(e,t,n,r){void 0===t&&(t=Oe(n));var o=(0===e?t:t>>>e)&y,a=this.nodes[o];return a?a.get(e+m,t,n,r):r},Ze.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=Oe(r));var s=(0===t?n:n>>>t)&y,u=o===b,c=this.nodes,l=c[s];if(u&&!l)return this;var p=it(l,e,t+m,n,r,o,a,i);if(p===l)return this;var f=this.count;if(l){if(!p&&--f<xt)return lt(e,c,f,s)}else f++;var h=e&&e===this.ownerID,d=yt(c,s,p,h);return h?(this.count=f,this.nodes=d,this):new Ze(e,f,d)},Xe.prototype.get=function(e,t,n,r){for(var o=this.entries,a=0,i=o.length;a<i;a++)if(ge(n,o[a][0]))return o[a][1];return r},Xe.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=Oe(r));var s=o===b;if(n!==this.keyHash)return s?this:(x(i),x(a),ut(this,e,t,n,[r,o]));for(var u=this.entries,c=0,l=u.length;c<l&&!ge(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(x(i),(s||!p)&&x(a),s&&2===l)return new Qe(e,this.keyHash,u[1^c]);var f=e&&e===this.ownerID,h=f?u:S(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Xe(e,this.keyHash,h)},Qe.prototype.get=function(e,t,n,r){return ge(n,this.entry[0])?this.entry[1]:r},Qe.prototype.update=function(e,t,n,r,o,a,i){var s=o===b,u=ge(r,this.entry[0]);return(u?o===this.entry[1]:s)?this:(x(i),s?void x(a):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Qe(e,this.keyHash,[r,o]):(x(a),ut(this,e,t,Oe(r),[r,o])))},Ye.prototype.iterate=Xe.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},Ge.prototype.iterate=Ze.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var a=n[t?o-r:r];if(a&&!1===a.iterate(e,t))return!1}},Qe.prototype.iterate=function(e,t){return e(this.entry)},t(et,F),et.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return tt(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return tt(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var a=r.nodes[this._reverse?n-o:o];if(a){if(a.entry)return tt(e,a.entry);t=this._stack=nt(a,t)}continue}t=this._stack=this._stack.__prev}return q()};var wt=g/4,Et=g/2,xt=g/4;function Ct(e){var t=Mt();if(null==e)return t;if(St(e))return e;var n=o(e),r=n.size;return 0===r?t:(Ve(r),r>0&&r<g?Nt(0,r,m,null,new Ot(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function St(e){return!(!e||!e[At])}t(Ct,Ce),Ct.of=function(){return this(arguments)},Ct.prototype.toString=function(){return this.__toString("List [","]")},Ct.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Bt(this,e+=this._origin);return n&&n.array[e&y]}return t},Ct.prototype.set=function(e,t){return Rt(this,e,t)},Ct.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},Ct.prototype.insert=function(e,t){return this.splice(e,0,t)},Ct.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Mt()},Ct.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Ft(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},Ct.prototype.pop=function(){return Ft(this,0,-1)},Ct.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Ft(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},Ct.prototype.shift=function(){return Ft(this,1)},Ct.prototype.merge=function(){return Ut(this,void 0,arguments)},Ct.prototype.mergeWith=function(t){return Ut(this,t,e.call(arguments,1))},Ct.prototype.mergeDeep=function(){return Ut(this,ht,arguments)},Ct.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return Ut(this,dt(t),n)},Ct.prototype.setSize=function(e){return Ft(this,0,e)},Ct.prototype.slice=function(e,t){var n=this.size;return j(e,t,n)?this:Ft(this,T(e,n),I(t,n))},Ct.prototype.__iterator=function(e,t){var n=0,r=Pt(this,t);return new F((function(){var t=r();return t===It?q():U(e,n++,t)}))},Ct.prototype.__iterate=function(e,t){for(var n,r=0,o=Pt(this,t);(n=o())!==It&&!1!==e(n,r++,this););return r},Ct.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Nt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},Ct.isList=St;var At="@@__IMMUTABLE_LIST__@@",kt=Ct.prototype;function Ot(e,t){this.array=e,this.ownerID=t}kt[At]=!0,kt[v]=kt.remove,kt.setIn=Ke.setIn,kt.deleteIn=kt.removeIn=Ke.removeIn,kt.update=Ke.update,kt.updateIn=Ke.updateIn,kt.mergeIn=Ke.mergeIn,kt.mergeDeepIn=Ke.mergeDeepIn,kt.withMutations=Ke.withMutations,kt.asMutable=Ke.asMutable,kt.asImmutable=Ke.asImmutable,kt.wasAltered=Ke.wasAltered,Ot.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&y;if(r>=this.array.length)return new Ot([],e);var o,a=0===r;if(t>0){var i=this.array[r];if((o=i&&i.removeBefore(e,t-m,n))===i&&a)return this}if(a&&!o)return this;var s=Lt(this,e);if(!a)for(var u=0;u<r;u++)s.array[u]=void 0;return o&&(s.array[r]=o),s},Ot.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&y;if(o>=this.array.length)return this;if(t>0){var a=this.array[o];if((r=a&&a.removeAfter(e,t-m,n))===a&&o===this.array.length-1)return this}var i=Lt(this,e);return i.array.splice(o+1),r&&(i.array[o]=r),i};var jt,Tt,It={};function Pt(e,t){var n=e._origin,r=e._capacity,o=qt(r),a=e._tail;return i(e._root,e._level,0);function i(e,t,n){return 0===t?s(e,n):u(e,t,n)}function s(e,i){var s=i===o?a&&a.array:e&&e.array,u=i>n?0:n-i,c=r-i;return c>g&&(c=g),function(){if(u===c)return It;var e=t?--c:u++;return s&&s[e]}}function u(e,o,a){var s,u=e&&e.array,c=a>n?0:n-a>>o,l=1+(r-a>>o);return l>g&&(l=g),function(){for(;;){if(s){var e=s();if(e!==It)return e;s=null}if(c===l)return It;var n=t?--l:c++;s=i(u&&u[n],o-m,a+(n<<o))}}}}function Nt(e,t,n,r,o,a,i){var s=Object.create(kt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=a,s.__hash=i,s.__altered=!1,s}function Mt(){return jt||(jt=Nt(0,0,m))}function Rt(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Ft(e,t).set(0,n):Ft(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,a=E(w);return t>=qt(e._capacity)?r=Dt(r,e.__ownerID,0,t,n,a):o=Dt(o,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Nt(e._origin,e._capacity,e._level,o,r):e}function Dt(e,t,n,r,o,a){var i,s=r>>>n&y,u=e&&s<e.array.length;if(!u&&void 0===o)return e;if(n>0){var c=e&&e.array[s],l=Dt(c,t,n-m,r,o,a);return l===c?e:((i=Lt(e,t)).array[s]=l,i)}return u&&e.array[s]===o?e:(x(a),i=Lt(e,t),void 0===o&&s===i.array.length-1?i.array.pop():i.array[s]=o,i)}function Lt(e,t){return t&&e&&t===e.ownerID?e:new Ot(e?e.array.slice():[],t)}function Bt(e,t){if(t>=qt(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&y],r-=m;return n}}function Ft(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new C,o=e._origin,a=e._capacity,i=o+t,s=void 0===n?a:n<0?a+n:o+n;if(i===o&&s===a)return e;if(i>=s)return e.clear();for(var u=e._level,c=e._root,l=0;i+l<0;)c=new Ot(c&&c.array.length?[void 0,c]:[],r),l+=1<<(u+=m);l&&(i+=l,o+=l,s+=l,a+=l);for(var p=qt(a),f=qt(s);f>=1<<u+m;)c=new Ot(c&&c.array.length?[c]:[],r),u+=m;var h=e._tail,d=f<p?Bt(e,s-1):f>p?new Ot([],r):h;if(h&&f>p&&i<a&&h.array.length){for(var v=c=Lt(c,r),g=u;g>m;g-=m){var b=p>>>g&y;v=v.array[b]=Lt(v.array[b],r)}v.array[p>>>m&y]=h}if(s<a&&(d=d&&d.removeAfter(r,0,s)),i>=f)i-=f,s-=f,u=m,c=null,d=d&&d.removeBefore(r,0,i);else if(i>o||f<p){for(l=0;c;){var _=i>>>u&y;if(_!==f>>>u&y)break;_&&(l+=(1<<u)*_),u-=m,c=c.array[_]}c&&i>o&&(c=c.removeBefore(r,u,i-l)),c&&f<p&&(c=c.removeAfter(r,u,f-l)),l&&(i-=l,s-=l)}return e.__ownerID?(e.size=s-i,e._origin=i,e._capacity=s,e._level=u,e._root=c,e._tail=d,e.__hash=void 0,e.__altered=!0,e):Nt(i,s,u,c,d)}function Ut(e,t,n){for(var r=[],a=0,s=0;s<n.length;s++){var u=n[s],c=o(u);c.size>a&&(a=c.size),i(u)||(c=c.map((function(e){return he(e)}))),r.push(c)}return a>e.size&&(e=e.setSize(a)),vt(e,t,r)}function qt(e){return e<g?0:e-1>>>m<<m}function zt(e){return null==e?Ht():Vt(e)?e:Ht().withMutations((function(t){var n=r(e);Ve(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Vt(e){return He(e)&&l(e)}function Wt(e,t,n,r){var o=Object.create(zt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function Ht(){return Tt||(Tt=Wt(ot(),Mt()))}function Jt(e,t,n){var r,o,a=e._map,i=e._list,s=a.get(t),u=void 0!==s;if(n===b){if(!u)return e;i.size>=g&&i.size>=2*a.size?(r=(o=i.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=a.remove(t),o=s===i.size-1?i.pop():i.set(s,void 0))}else if(u){if(n===i.get(s)[1])return e;r=a,o=i.set(s,[t,n])}else r=a.set(t,i.size),o=i.set(i.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Wt(r,o)}function $t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Kt(e){this._iter=e,this.size=e.size}function Yt(e){this._iter=e,this.size=e.size}function Gt(e){this._iter=e,this.size=e.size}function Zt(e){var t=bn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=_n,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(t===R){var r=e.__iterator(t,n);return new F((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(t===M?N:M,n)},t}function Xt(e,t,n){var r=bn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var a=e.get(r,b);return a===b?o:t.call(n,a,r,e)},r.__iterateUncached=function(r,o){var a=this;return e.__iterate((function(e,o,i){return!1!==r(t.call(n,e,o,i),o,a)}),o)},r.__iteratorUncached=function(r,o){var a=e.__iterator(R,o);return new F((function(){var o=a.next();if(o.done)return o;var i=o.value,s=i[0];return U(r,s,t.call(n,i[1],s,e),o)}))},r}function Qt(e,t){var n=bn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Zt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=_n,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function en(e,t,n,r){var o=bn(e);return r&&(o.has=function(r){var o=e.get(r,b);return o!==b&&!!t.call(n,o,r,e)},o.get=function(r,o){var a=e.get(r,b);return a!==b&&t.call(n,a,r,e)?a:o}),o.__iterateUncached=function(o,a){var i=this,s=0;return e.__iterate((function(e,a,u){if(t.call(n,e,a,u))return s++,o(e,r?a:s-1,i)}),a),s},o.__iteratorUncached=function(o,a){var i=e.__iterator(R,a),s=0;return new F((function(){for(;;){var a=i.next();if(a.done)return a;var u=a.value,c=u[0],l=u[1];if(t.call(n,l,c,e))return U(o,r?c:s++,l,a)}}))},o}function tn(e,t,n){var r=We().asMutable();return e.__iterate((function(o,a){r.update(t.call(n,o,a,e),0,(function(e){return e+1}))})),r.asImmutable()}function nn(e,t,n){var r=s(e),o=(l(e)?zt():We()).asMutable();e.__iterate((function(a,i){o.update(t.call(n,a,i,e),(function(e){return(e=e||[]).push(r?[i,a]:a),e}))}));var a=yn(e);return o.map((function(t){return vn(e,a(t))}))}function rn(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),j(t,n,o))return e;var a=T(t,o),i=I(n,o);if(a!=a||i!=i)return rn(e.toSeq().cacheResult(),t,n,r);var s,u=i-a;u==u&&(s=u<0?0:u);var c=bn(e);return c.size=0===s?s:e.size&&s||void 0,!r&&ae(e)&&s>=0&&(c.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+a,n):n}),c.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var i=0,u=!0,c=0;return e.__iterate((function(e,n){if(!u||!(u=i++<a))return c++,!1!==t(e,r?n:c-1,o)&&c!==s})),c},c.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),i=0,u=0;return new F((function(){for(;i++<a;)o.next();if(++u>s)return q();var e=o.next();return r||t===M?e:U(t,u-1,t===N?void 0:e.value[1],e)}))},c}function on(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){var a=this;if(o)return this.cacheResult().__iterate(r,o);var i=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++i&&r(e,o,a)})),i},r.__iteratorUncached=function(r,o){var a=this;if(o)return this.cacheResult().__iterator(r,o);var i=e.__iterator(R,o),s=!0;return new F((function(){if(!s)return q();var e=i.next();if(e.done)return e;var o=e.value,u=o[0],c=o[1];return t.call(n,c,u,a)?r===R?e:U(r,u,c,e):(s=!1,q())}))},r}function an(e,t,n,r){var o=bn(e);return o.__iterateUncached=function(o,a){var i=this;if(a)return this.cacheResult().__iterate(o,a);var s=!0,u=0;return e.__iterate((function(e,a,c){if(!s||!(s=t.call(n,e,a,c)))return u++,o(e,r?a:u-1,i)})),u},o.__iteratorUncached=function(o,a){var i=this;if(a)return this.cacheResult().__iterator(o,a);var s=e.__iterator(R,a),u=!0,c=0;return new F((function(){var e,a,l;do{if((e=s.next()).done)return r||o===M?e:U(o,c++,o===N?void 0:e.value[1],e);var p=e.value;a=p[0],l=p[1],u&&(u=t.call(n,l,a,i))}while(u);return o===R?e:U(o,a,l,e)}))},o}function sn(e,t){var n=s(e),o=[e].concat(t).map((function(e){return i(e)?n&&(e=r(e)):e=n?se(e):ue(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var a=o[0];if(a===e||n&&s(a)||u(e)&&u(a))return a}var c=new te(o);return n?c=c.toKeyedSeq():u(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),c}function un(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){var a=0,s=!1;function u(e,c){var l=this;e.__iterate((function(e,o){return(!t||c<t)&&i(e)?u(e,c+1):!1===r(e,n?o:a++,l)&&(s=!0),!s}),o)}return u(e,0),a},r.__iteratorUncached=function(r,o){var a=e.__iterator(r,o),s=[],u=0;return new F((function(){for(;a;){var e=a.next();if(!1===e.done){var c=e.value;if(r===R&&(c=c[1]),t&&!(s.length<t)||!i(c))return n?e:U(r,u++,c,e);s.push(a),a=c.__iterator(r,o)}else a=s.pop()}return q()}))},r}function cn(e,t,n){var r=yn(e);return e.toSeq().map((function(o,a){return r(t.call(n,o,a,e))})).flatten(!0)}function ln(e,t){var n=bn(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,a=0;return e.__iterate((function(e,r){return(!a||!1!==n(t,a++,o))&&!1!==n(e,a++,o)}),r),a},n.__iteratorUncached=function(n,r){var o,a=e.__iterator(M,r),i=0;return new F((function(){return(!o||i%2)&&(o=a.next()).done?o:i%2?U(n,i++,t):U(n,i++,o.value,o)}))},n}function pn(e,t,n){t||(t=wn);var r=s(e),o=0,a=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return a.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){a[t].length=2}:function(e,t){a[t]=e[1]}),r?K(a):u(e)?Y(a):G(a)}function fn(e,t,n){if(t||(t=wn),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return hn(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return hn(t,e,n)?n:e}))}function hn(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function dn(e,t,r){var o=bn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var a=r.map((function(e){return e=n(e),W(o?e.reverse():e)})),i=0,s=!1;return new F((function(){var n;return s||(n=a.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?q():U(e,i++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function vn(e,t){return ae(e)?t:e.constructor(t)}function mn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function gn(e){return Ve(e.size),A(e)}function yn(e){return s(e)?r:u(e)?o:a}function bn(e){return Object.create((s(e)?K:u(e)?Y:G).prototype)}function _n(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):$.prototype.cacheResult.call(this)}function wn(e,t){return e>t?1:e<t?-1:0}function En(e){var t=W(e);if(!t){if(!J(e))throw new TypeError("Expected iterable or array-like: "+e);t=W(n(e))}return t}function xn(e,t){var n,r=function(a){if(a instanceof r)return a;if(!(this instanceof r))return new r(a);if(!n){n=!0;var i=Object.keys(e);kn(o,i),o.size=i.length,o._name=t,o._keys=i,o._defaultValues=e}this._map=We(a)},o=r.prototype=Object.create(Cn);return o.constructor=r,r}t(zt,We),zt.of=function(){return this(arguments)},zt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},zt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Ht()},zt.prototype.set=function(e,t){return Jt(this,e,t)},zt.prototype.remove=function(e){return Jt(this,e,b)},zt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},zt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},zt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},zt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Wt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},zt.isOrderedMap=Vt,zt.prototype[d]=!0,zt.prototype[v]=zt.prototype.remove,t($t,K),$t.prototype.get=function(e,t){return this._iter.get(e,t)},$t.prototype.has=function(e){return this._iter.has(e)},$t.prototype.valueSeq=function(){return this._iter.valueSeq()},$t.prototype.reverse=function(){var e=this,t=Qt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},$t.prototype.map=function(e,t){var n=this,r=Xt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},$t.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?gn(this):0,function(o){return e(o,t?--n:n++,r)}),t)},$t.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?gn(this):0;return new F((function(){var o=n.next();return o.done?o:U(e,t?--r:r++,o.value,o)}))},$t.prototype[d]=!0,t(Kt,Y),Kt.prototype.includes=function(e){return this._iter.includes(e)},Kt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Kt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value,t)}))},t(Yt,G),Yt.prototype.has=function(e){return this._iter.includes(e)},Yt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Yt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){var t=n.next();return t.done?t:U(e,t.value,t.value,t)}))},t(Gt,K),Gt.prototype.entrySeq=function(){return this._iter.toSeq()},Gt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){mn(t);var r=i(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},Gt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){mn(r);var o=i(r);return U(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Kt.prototype.cacheResult=$t.prototype.cacheResult=Yt.prototype.cacheResult=Gt.prototype.cacheResult=_n,t(xn,xe),xn.prototype.toString=function(){return this.__toString(An(this)+" {","}")},xn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},xn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},xn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=Sn(this,ot()))},xn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+An(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:Sn(this,n)},xn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:Sn(this,t)},xn.prototype.wasAltered=function(){return this._map.wasAltered()},xn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},xn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},xn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?Sn(this,t,e):(this.__ownerID=e,this._map=t,this)};var Cn=xn.prototype;function Sn(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function An(e){return e._name||e.constructor.name||"Record"}function kn(e,t){try{t.forEach(On.bind(void 0,e))}catch(e){}}function On(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){_e(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function jn(e){return null==e?Dn():Tn(e)&&!l(e)?e:Dn().withMutations((function(t){var n=a(e);Ve(n.size),n.forEach((function(e){return t.add(e)}))}))}function Tn(e){return!(!e||!e[Pn])}Cn[v]=Cn.remove,Cn.deleteIn=Cn.removeIn=Ke.removeIn,Cn.merge=Ke.merge,Cn.mergeWith=Ke.mergeWith,Cn.mergeIn=Ke.mergeIn,Cn.mergeDeep=Ke.mergeDeep,Cn.mergeDeepWith=Ke.mergeDeepWith,Cn.mergeDeepIn=Ke.mergeDeepIn,Cn.setIn=Ke.setIn,Cn.update=Ke.update,Cn.updateIn=Ke.updateIn,Cn.withMutations=Ke.withMutations,Cn.asMutable=Ke.asMutable,Cn.asImmutable=Ke.asImmutable,t(jn,Se),jn.of=function(){return this(arguments)},jn.fromKeys=function(e){return this(r(e).keySeq())},jn.prototype.toString=function(){return this.__toString("Set {","}")},jn.prototype.has=function(e){return this._map.has(e)},jn.prototype.add=function(e){return Mn(this,this._map.set(e,!0))},jn.prototype.remove=function(e){return Mn(this,this._map.remove(e))},jn.prototype.clear=function(){return Mn(this,this._map.clear())},jn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)a(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},jn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return a(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},jn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return a(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},jn.prototype.merge=function(){return this.union.apply(this,arguments)},jn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},jn.prototype.sort=function(e){return Ln(pn(this,e))},jn.prototype.sortBy=function(e,t){return Ln(pn(this,t,e))},jn.prototype.wasAltered=function(){return this._map.wasAltered()},jn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},jn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},jn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},jn.isSet=Tn;var In,Pn="@@__IMMUTABLE_SET__@@",Nn=jn.prototype;function Mn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function Rn(e,t){var n=Object.create(Nn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Dn(){return In||(In=Rn(ot()))}function Ln(e){return null==e?zn():Bn(e)?e:zn().withMutations((function(t){var n=a(e);Ve(n.size),n.forEach((function(e){return t.add(e)}))}))}function Bn(e){return Tn(e)&&l(e)}Nn[Pn]=!0,Nn[v]=Nn.remove,Nn.mergeDeep=Nn.merge,Nn.mergeDeepWith=Nn.mergeWith,Nn.withMutations=Ke.withMutations,Nn.asMutable=Ke.asMutable,Nn.asImmutable=Ke.asImmutable,Nn.__empty=Dn,Nn.__make=Rn,t(Ln,jn),Ln.of=function(){return this(arguments)},Ln.fromKeys=function(e){return this(r(e).keySeq())},Ln.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ln.isOrderedSet=Bn;var Fn,Un=Ln.prototype;function qn(e,t){var n=Object.create(Un);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function zn(){return Fn||(Fn=qn(Ht()))}function Vn(e){return null==e?Yn():Wn(e)?e:Yn().unshiftAll(e)}function Wn(e){return!(!e||!e[Jn])}Un[d]=!0,Un.__empty=zn,Un.__make=qn,t(Vn,Ce),Vn.of=function(){return this(arguments)},Vn.prototype.toString=function(){return this.__toString("Stack [","]")},Vn.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},Vn.prototype.peek=function(){return this._head&&this._head.value},Vn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kn(e,t)},Vn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Ve(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kn(t,n)},Vn.prototype.pop=function(){return this.slice(1)},Vn.prototype.unshift=function(){return this.push.apply(this,arguments)},Vn.prototype.unshiftAll=function(e){return this.pushAll(e)},Vn.prototype.shift=function(){return this.pop.apply(this,arguments)},Vn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yn()},Vn.prototype.slice=function(e,t){if(j(e,t,this.size))return this;var n=T(e,this.size);if(I(t,this.size)!==this.size)return Ce.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Kn(r,o)},Vn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Vn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Vn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return q()}))},Vn.isStack=Wn;var Hn,Jn="@@__IMMUTABLE_STACK__@@",$n=Vn.prototype;function Kn(e,t,n,r){var o=Object.create($n);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Yn(){return Hn||(Hn=Kn(0))}function Gn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}$n[Jn]=!0,$n.withMutations=Ke.withMutations,$n.asMutable=Ke.asMutable,$n.asImmutable=Ke.asImmutable,$n.wasAltered=Ke.wasAltered,n.Iterator=F,Gn(n,{toArray:function(){Ve(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Kt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new $t(this,!0)},toMap:function(){return We(this.toKeyedSeq())},toObject:function(){Ve(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return zt(this.toKeyedSeq())},toOrderedSet:function(){return Ln(s(this)?this.valueSeq():this)},toSet:function(){return jn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Yt(this)},toSeq:function(){return u(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Vn(s(this)?this.valueSeq():this)},toList:function(){return Ct(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return vn(this,sn(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return ge(t,e)}))},entries:function(){return this.__iterator(R)},every:function(e,t){Ve(this.size);var n=!0;return this.__iterate((function(r,o,a){if(!e.call(t,r,o,a))return n=!1,!1})),n},filter:function(e,t){return vn(this,en(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Ve(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Ve(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(N)},map:function(e,t){return vn(this,Xt(this,e,t))},reduce:function(e,t,n){var r,o;return Ve(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,a,i){o?(o=!1,r=t):r=e.call(n,r,t,a,i)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return vn(this,Qt(this,!0))},slice:function(e,t){return vn(this,rn(this,e,t,!0))},some:function(e,t){return!this.every(tr(e),t)},sort:function(e){return vn(this,pn(this,e))},values:function(){return this.__iterator(M)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return A(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tn(this,e,t)},equals:function(e){return ye(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(er).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(tr(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,a){if(e.call(t,n,o,a))return r=[o,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(O)},flatMap:function(e,t){return vn(this,cn(this,e,t))},flatten:function(e){return vn(this,un(this,e,!0))},fromEntrySeq:function(){return new Gt(this)},get:function(e,t){return this.find((function(t,n){return ge(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=En(e);!(n=o.next()).done;){var a=n.value;if((r=r&&r.get?r.get(a,b):b)===b)return t}return r},groupBy:function(e,t){return nn(this,e,t)},has:function(e){return this.get(e,b)!==b},hasIn:function(e){return this.getIn(e,b)!==b},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ge(t,e)}))},keySeq:function(){return this.toSeq().map(Qn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return fn(this,e)},maxBy:function(e,t){return fn(this,t,e)},min:function(e){return fn(this,e?nr(e):ar)},minBy:function(e,t){return fn(this,t?nr(t):ar,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return vn(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return vn(this,an(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(tr(e),t)},sortBy:function(e,t){return vn(this,pn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return vn(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return vn(this,on(this,e,t))},takeUntil:function(e,t){return this.takeWhile(tr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ir(this))}});var Zn=n.prototype;Zn[p]=!0,Zn[B]=Zn.values,Zn.__toJS=Zn.toArray,Zn.__toStringMapper=rr,Zn.inspect=Zn.toSource=function(){return this.toString()},Zn.chain=Zn.flatMap,Zn.contains=Zn.includes,Gn(r,{flip:function(){return vn(this,Zt(this))},mapEntries:function(e,t){var n=this,r=0;return vn(this,this.toSeq().map((function(o,a){return e.call(t,[a,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return vn(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var Xn=r.prototype;function Qn(e,t){return t}function er(e,t){return[t,e]}function tr(e){return function(){return!e.apply(this,arguments)}}function nr(e){return function(){return-e.apply(this,arguments)}}function rr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function or(){return S(arguments)}function ar(e,t){return e<t?1:e>t?-1:0}function ir(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return sr(e.__iterate(n?t?function(e,t){r=31*r+ur(Oe(e),Oe(t))|0}:function(e,t){r=r+ur(Oe(e),Oe(t))|0}:t?function(e){r=31*r+Oe(e)|0}:function(e){r=r+Oe(e)|0}),r)}function sr(e,t){return t=Ae(t,3432918353),t=Ae(t<<15|t>>>-15,461845907),t=Ae(t<<13|t>>>-13,5),t=Ae((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ke((t=Ae(t^t>>>13,3266489909))^t>>>16)}function ur(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Xn[f]=!0,Xn[B]=Zn.entries,Xn.__toJS=Zn.toObject,Xn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rr(e)},Gn(o,{toKeyedSeq:function(){return new $t(this,!1)},filter:function(e,t){return vn(this,en(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return vn(this,Qt(this,!1))},slice:function(e,t){return vn(this,rn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=T(e,e<0?this.count():this.size);var r=this.slice(0,e);return vn(this,1===n?r:r.concat(S(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return vn(this,un(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return vn(this,ln(this,e))},interleave:function(){var e=[this].concat(S(arguments)),t=dn(this.toSeq(),Y.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),vn(this,n)},keySeq:function(){return we(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return vn(this,an(this,e,t,!1))},zip:function(){return vn(this,dn(this,or,[this].concat(S(arguments))))},zipWith:function(e){var t=S(arguments);return t[0]=this,vn(this,dn(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Gn(a,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),a.prototype.has=Zn.includes,a.prototype.contains=a.prototype.includes,Gn(K,r.prototype),Gn(Y,o.prototype),Gn(G,a.prototype),Gn(xe,r.prototype),Gn(Ce,o.prototype),Gn(Se,a.prototype),{Iterable:n,Seq:$,Collection:Ee,Map:We,OrderedMap:zt,List:Ct,Stack:Vn,Set:jn,OrderedSet:Ln,Record:xn,Range:we,Repeat:be,is:ge,fromJS:he}}()},function(e,t,n){e.exports=n(579)},function(e,t,n){var r=n(240);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";(function(e){n.d(t,"t",(function(){return ve})),n.d(t,"A",(function(){return me})),n.d(t,"i",(function(){return ge})),n.d(t,"w",(function(){return ye})),n.d(t,"r",(function(){return be})),n.d(t,"u",(function(){return _e})),n.d(t,"s",(function(){return we})),n.d(t,"p",(function(){return Ee})),n.d(t,"v",(function(){return xe})),n.d(t,"y",(function(){return Ce})),n.d(t,"z",(function(){return Se})),n.d(t,"K",(function(){return Ae})),n.d(t,"f",(function(){return ke})),n.d(t,"n",(function(){return Oe})),n.d(t,"h",(function(){return je})),n.d(t,"E",(function(){return Te})),n.d(t,"L",(function(){return Ve})),n.d(t,"o",(function(){return Ke})),n.d(t,"D",(function(){return Ye})),n.d(t,"a",(function(){return Ge})),n.d(t,"I",(function(){return Ze})),n.d(t,"b",(function(){return Xe})),n.d(t,"H",(function(){return Qe})),n.d(t,"G",(function(){return et})),n.d(t,"F",(function(){return tt})),n.d(t,"k",(function(){return nt})),n.d(t,"d",(function(){return rt})),n.d(t,"g",(function(){return ot})),n.d(t,"m",(function(){return at})),n.d(t,"l",(function(){return it})),n.d(t,"e",(function(){return st})),n.d(t,"J",(function(){return ut})),n.d(t,"x",(function(){return ct})),n.d(t,"B",(function(){return lt})),n.d(t,"C",(function(){return pt})),n.d(t,"j",(function(){return ft})),n.d(t,"c",(function(){return ht})),n.d(t,"q",(function(){return vt}));var r=n(99),o=n.n(r),a=n(167),i=n.n(a),s=n(58),u=n.n(s),c=n(12),l=n.n(c),p=n(32),f=n.n(p),h=n(18),d=n.n(h),v=(n(37),n(35)),m=n.n(v),g=(n(23),n(17),n(208)),y=n.n(g),b=n(21),_=n.n(b),w=n(22),E=n.n(w),x=(n(30),n(15)),C=n.n(x),S=n(13),A=n.n(S),k=n(16),O=n.n(k),j=n(2),T=n.n(j),I=n(51),P=n.n(I),N=n(85),M=n.n(N),R=n(6),D=n.n(R),L=n(14),B=n.n(L),F=n(20),U=n.n(F),q=n(1),z=n.n(q),V=n(507),W=n(508),H=n.n(W),J=n(283),$=n.n(J),K=n(284),Y=n.n(K),G=n(209),Z=n.n(G),X=n(342),Q=n.n(X),ee=n(121),te=n.n(ee),ne=n(68),re=n.n(ne),oe=n(142),ae=n(27),ie=n(510),se=n.n(ie),ue=n(144),ce=n(511),le=n.n(ce),pe=n(512),fe=n.n(pe),he="default",de=function(e){return z.a.Iterable.isIterable(e)};function ve(e){try{var t=JSON.parse(e);if(t&&"object"===U()(t))return t}catch(e){}return!1}function me(e){return _e(e)?de(e)?e.toJS():e:{}}function ge(e){var t,n;if(de(e))return e;if(e instanceof ae.a.File)return e;if(!_e(e))return e;if(B()(e))return D()(n=z.a.Seq(e)).call(n,ge).toList();if(re()(M()(e))){var r,o=function(e){if(!re()(M()(e)))return e;var t,n={},r="_**[]",o={},a=P()(M()(e).call(e));try{for(a.s();!(t=a.n()).done;){var i=t.value;if(n[i[0]]||o[i[0]]&&o[i[0]].containsMultiple){var s,u,c,l;if(!o[i[0]])o[i[0]]={containsMultiple:!0,length:1},n[T()(c=T()(l="".concat(i[0])).call(l,r)).call(c,o[i[0]].length)]=n[i[0]],delete n[i[0]];o[i[0]].length+=1,n[T()(s=T()(u="".concat(i[0])).call(u,r)).call(s,o[i[0]].length)]=i[1]}else n[i[0]]=i[1]}}catch(e){a.e(e)}finally{a.f()}return n}(e);return D()(r=z.a.OrderedMap(o)).call(r,ge)}return D()(t=z.a.OrderedMap(e)).call(t,ge)}function ye(e){return B()(e)?e:[e]}function be(e){return"function"==typeof e}function _e(e){return!!e&&"object"===U()(e)}function we(e){return"function"==typeof e}function Ee(e){return B()(e)}var xe=Y.a;function Ce(e,t){var n;return E()(n=C()(e)).call(n,(function(n,r){return n[r]=t(e[r],r),n}),{})}function Se(e,t){var n;return E()(n=C()(e)).call(n,(function(n,r){var o=t(e[r],r);return o&&"object"===U()(o)&&_()(n,o),n}),{})}function Ae(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function ke(e){var t,n=e.keySeq();return n.contains(he)?he:y()(t=A()(n).call(n,(function(e){return"2"===(e+"")[0]}))).call(t).first()}function Oe(e,t){if(!z.a.Iterable.isIterable(e))return z.a.List();var n=e.getIn(B()(t)?t:[t]);return z.a.List.isList(n)?n:z.a.List()}function je(e){var t,n=[/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i];if(m()(n).call(n,(function(n){return null!==(t=n.exec(e))})),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function Te(e){return t=e.replace(/\.[^./]*$/,""),$()(H()(t));var t}var Ie=function(e,t){if(e>t)return"Value must be less than ".concat(t)},Pe=function(e,t){if(e<t)return"Value must be greater than ".concat(t)},Ne=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},Me=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},Re=function(e){if(e&&!(e instanceof ae.a.File))return"Value must be a file"},De=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},Le=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},Be=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},Fe=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},Ue=function(e,t){var n;if(e.length>t)return T()(n="Value must be no longer than ".concat(t," character")).call(n,1!==t?"s":"")},qe=function(e,t){var n;if(e.length<t)return T()(n="Value must be at least ".concat(t," character")).call(n,1!==t?"s":"")},ze=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},Ve=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.isOAS3,o=void 0!==r&&r,a=n.bypassRequiredCheck,i=void 0!==a&&a,s=[],u=e.get("required"),c=Object(ue.a)(e,{isOAS3:o}),l=c.schema,p=c.parameterContentMediaType;if(!l)return s;var f=l.get("required"),h=l.get("maximum"),d=l.get("minimum"),v=l.get("type"),g=l.get("format"),y=l.get("maxLength"),b=l.get("minLength"),_=l.get("pattern");if(v&&(u||f||t)){var w="string"===v&&t,E="array"===v&&B()(t)&&t.length,x="array"===v&&z.a.List.isList(t)&&t.count(),C="array"===v&&"string"==typeof t&&t,S="file"===v&&t instanceof ae.a.File,A="boolean"===v&&(t||!1===t),k="number"===v&&(t||0===t),j="integer"===v&&(t||0===t),T="object"===v&&"object"===U()(t)&&null!==t,I="object"===v&&"string"==typeof t&&t,P=[w,E,x,C,S,A,k,j,T,I],N=m()(P).call(P,(function(e){return!!e}));if((u||f)&&!N&&!i)return s.push("Required field is not provided"),s;if("object"===v&&"string"==typeof t&&(null===p||"application/json"===p))try{JSON.parse(t)}catch(e){return s.push("Parameter string value must be valid JSON"),s}if(_){var M=ze(t,_);M&&s.push(M)}if(y||0===y){var R=Ue(t,y);R&&s.push(R)}if(b){var D=qe(t,b);D&&s.push(D)}if(h||0===h){var L=Ie(t,h);L&&s.push(L)}if(d||0===d){var F=Pe(t,d);F&&s.push(F)}if("string"===v){var q;if(!(q="date-time"===g?Be(t):"uuid"===g?Fe(t):Le(t)))return s;s.push(q)}else if("boolean"===v){var V=De(t);if(!V)return s;s.push(V)}else if("number"===v){var W=Ne(t);if(!W)return s;s.push(W)}else if("integer"===v){var H=Me(t);if(!H)return s;s.push(H)}else if("array"===v){var J;if(!x||!t.count())return s;J=l.getIn(["items","type"]),O()(t).call(t,(function(e,t){var n;"number"===J?n=Ne(e):"integer"===J?n=Me(e):"string"===J&&(n=Le(e)),n&&s.push({index:t,error:n})}))}else if("file"===v){var $=Re(t);if(!$)return s;s.push($)}}return s},We=function(e,t){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e':null;var n=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=n[1]}return Object(oe.memoizedCreateXMLExample)(e,t)},He=[{when:/json/,shouldStringifyTypes:["string"]}],Je=["object"],$e=function(e,t,n){var r=Object(oe.memoizedSampleFromSchema)(e,t),o=U()(r),a=E()(He).call(He,(function(e,t){var r;return t.when.test(n)?T()(r=[]).call(r,d()(e),d()(t.shouldStringifyTypes)):e}),Je);return Q()(a,(function(e){return e===o}))?f()(r,null,2):r},Ke=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return/xml/.test(t)?We(e,n):$e(e,n,t)},Ye=function(){var e={},t=ae.a.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=r[1]&&decodeURIComponent(r[1])||"")}return e},Ge=function(t){return(t instanceof e?t:e.from(t.toString(),"utf-8")).toString("base64")},Ze={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},Xe=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},Qe=function(e,t,n){return!!Z()(n,(function(n){return te()(e[n],t[n])}))};function et(e){return"string"!=typeof e||""===e?"":Object(V.sanitizeUrl)(e)}function tt(e){return!(!e||l()(e).call(e,"localhost")>=0||l()(e).call(e,"127.0.0.1")>=0||"none"===e)}function nt(e){if(!z.a.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=u()(e).call(e,(function(e,t){return i()(t).call(t,"2")&&C()(e.get("content")||{}).length>0})),n=e.get("default")||z.a.OrderedMap(),r=(n.get("content")||z.a.OrderedMap()).keySeq().toJS().length?n:null;return t||r}var rt=function(e){return"string"==typeof e||e instanceof String?o()(e).call(e).replace(/\s/g,"%20"):""},ot=function(e){return se()(rt(e).replace(/%20/g,"_"))},at=function(e){return A()(e).call(e,(function(e,t){return/^x-/.test(t)}))},it=function(e){return A()(e).call(e,(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)}))};function st(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==U()(e)||B()(e)||null===e||!t)return e;var o=_()({},e);return O()(n=C()(o)).call(n,(function(e){e===t&&r(o[e],e)?delete o[e]:o[e]=st(o[e],t,r)})),o}function ut(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"===U()(e)&&null!==e)try{return f()(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function ct(e){return"number"==typeof e?e.toString():e}function lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.returnAll,r=void 0!==n&&n,o=t.allowHashes,a=void 0===o||o;if(!z.a.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");var i,s,u,c=e.get("name"),l=e.get("in"),p=[];e&&e.hashCode&&l&&c&&a&&p.push(T()(i=T()(s="".concat(l,".")).call(s,c,".hash-")).call(i,e.hashCode()));l&&c&&p.push(T()(u="".concat(l,".")).call(u,c));return p.push(c),r?p:p[0]||""}function pt(e,t){var n,r=lt(e,{returnAll:!0});return A()(n=D()(r).call(r,(function(e){return t[e]}))).call(n,(function(e){return void 0!==e}))[0]}function ft(){return dt(le()(32).toString("base64"))}function ht(e){return dt(fe()("sha256").update(e).digest("base64"))}function dt(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var vt=function(e){return!e||!(!de(e)||!e.isEmpty())}}).call(this,n(76).Buffer)},function(e,t,n){var r=n(240);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(e,o.key,o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}},function(e,t,n){e.exports=n(584)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(897),o=n(900);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=r(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t,n){var r=n(464),o=n(205),a=n(911),i=n(912);e.exports=function(e){var t=a();return function(){var n,a=o(e);if(t){var s=o(this).constructor;n=r(a,arguments,s)}else n=a.apply(this,arguments);return i(this,n)}}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(990)()},function(e,t,n){e.exports=n(641)},function(e,t,n){e.exports=n(576)},function(e,t,n){e.exports=n(593)},function(e,t,n){e.exports=n(544)},function(e,t,n){e.exports=n(404)},function(e,t,n){var r=n(400),o=n(663),a=n(180),i=n(403);e.exports=function(e,t){return r(e)||o(e,t)||a(e,t)||i()}},function(e,t,n){var r=n(644),o=n(392),a=n(180),i=n(652);e.exports=function(e){return r(e)||o(e)||a(e)||i()}},function(e,t,n){"use strict";function r(e,t){return e===t}function o(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}n.d(t,"a",(function(){return i}));var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=0,s=r.pop(),u=a(r),c=e.apply(void 0,[function(){return i++,s.apply(null,arguments)}].concat(n)),l=e((function(){for(var e=[],t=u.length,n=0;n<t;n++)e.push(u[n].apply(null,arguments));return c.apply(null,e)}));return l.resultFunc=s,l.dependencies=u,l.recomputations=function(){return i},l.resetRecomputations=function(){return i=0},l}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,a=null;return function(){return o(t,n,arguments)||(a=e.apply(null,arguments)),n=arguments,a}}))},function(e,t,n){var r=n(546),o=n(177);function a(t){return e.exports=a="function"==typeof o&&"symbol"==typeof r?function(e){return typeof e}:function(e){return e&&"function"==typeof o&&e.constructor===o&&e!==o.prototype?"symbol":typeof e},a(t)}e.exports=a},function(e,t,n){e.exports=n(600)},function(e,t,n){e.exports=n(588)},function(e,t,n){e.exports=n(597)},function(e,t,n){"use strict";var r=n(41),o=n(104).f,a=n(356),i=n(34),s=n(107),u=n(70),c=n(52),l=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,p,f,h,d,v,m,g,y=e.target,b=e.global,_=e.stat,w=e.proto,E=b?r:_?r[y]:(r[y]||{}).prototype,x=b?i:i[y]||(i[y]={}),C=x.prototype;for(f in t)n=!a(b?f:y+(_?".":"#")+f,e.forced)&&E&&c(E,f),d=x[f],n&&(v=e.noTargetGet?(g=o(E,f))&&g.value:E[f]),h=n&&v?v:t[f],n&&typeof d==typeof h||(m=e.bind&&n?s(h,r):e.wrap&&n?l(h):w&&"function"==typeof h?s(Function.call,h):h,(e.sham||h&&h.sham||d&&d.sham)&&u(m,"sham",!0),x[f]=m,w&&(c(i,p=y+"Prototype")||u(i,p,{}),i[p][f]=h,e.real&&C&&!C[f]&&u(C,f,h)))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],l=0;(u=new Error(t.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t,n){var r=n(240),o=n(834),a=n(838),i=n(843),s=n(445),u=n(848),c=n(446),l=n(447),p=n(3);function f(e,t){var n=l(e);if(c){var r=c(e);t&&(r=u(r).call(r,(function(t){return s(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n,u=null!=arguments[t]?arguments[t]:{};if(t%2)i(n=f(Object(u),!0)).call(n,(function(t){p(e,t,u[t])}));else if(a)o(e,a(u));else{var c;i(c=f(Object(u))).call(c,(function(t){r(e,t,s(u,t))}))}}return e}},function(e,t,n){"use strict";t.a=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t=0,n=["File","Blob","FormData"];t<n.length;t++){var r=n[t];r in window&&(e[r]=window[r])}}catch(e){console.error(e)}return e}()},function(e,t,n){"use strict";var r=n(1),o="<<anonymous>>",a={listOf:function(e){return c(e,"List",r.List.isList)},mapOf:function(e,t){return p(e,t,"Map",r.Map.isMap)},orderedMapOf:function(e,t){return p(e,t,"OrderedMap",r.OrderedMap.isOrderedMap)},setOf:function(e){return c(e,"Set",r.Set.isSet)},orderedSetOf:function(e){return c(e,"OrderedSet",r.OrderedSet.isOrderedSet)},stackOf:function(e){return c(e,"Stack",r.Stack.isStack)},iterableOf:function(e){return c(e,"Iterable",r.Iterable.isIterable)},recordOf:function(e){return s((function(t,n,o,a,s){for(var u=arguments.length,c=Array(u>5?u-5:0),l=5;l<u;l++)c[l-5]=arguments[l];var p=t[n];if(!(p instanceof r.Record)){var f=i(p);return new Error("Invalid "+a+" `"+s+"` of type `"+f+"` supplied to `"+o+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var v=p.toObject(),m=d.apply(void 0,[v,h,o,a,s+"."+h].concat(c));if(m)return m}}}))},shape:h,contains:h,mapContains:function(e){return f(e,"Map",r.Map.isMap)},list:u("List",r.List.isList),map:u("Map",r.Map.isMap),orderedMap:u("OrderedMap",r.OrderedMap.isOrderedMap),set:u("Set",r.Set.isSet),orderedSet:u("OrderedSet",r.OrderedSet.isOrderedSet),stack:u("Stack",r.Stack.isStack),seq:u("Seq",r.Seq.isSeq),record:u("Record",(function(e){return e instanceof r.Record})),iterable:u("Iterable",r.Iterable.isIterable)};function i(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof r.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function s(e){function t(t,n,r,a,i,s){for(var u=arguments.length,c=Array(u>6?u-6:0),l=6;l<u;l++)c[l-6]=arguments[l];if(s=s||r,a=a||o,null!=n[r])return e.apply(void 0,[n,r,a,i,s].concat(c));var p=i;return t?new Error("Required "+p+" `"+s+"` was not specified in `"+a+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function u(e,t){return s((function(n,r,o,a,s){var u=n[r];if(!t(u)){var c=i(u);return new Error("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+o+"`, expected `"+e+"`.")}return null}))}function c(e,t,n){return s((function(r,o,a,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=s,d=i(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+a+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+a+"` for propType `"+u+"`, expected a function.");for(var v=f.toArray(),m=0,g=v.length;m<g;m++){var y=e.apply(void 0,[v,m,a,s,u+"["+m+"]"].concat(l));if(y instanceof Error)return y}}))}function l(e){return s((function(t,n,r,o,a){for(var i=arguments.length,s=Array(i>5?i-5:0),u=5;u<i;u++)s[u-5]=arguments[u];var c=t[n];if("function"!=typeof e)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+r+"` for propType `"+a+"`, expected a function.");for(var l=c.keySeq().toArray(),p=0,f=l.length;p<f;p++){var h=e.apply(void 0,[l,p,r,o,a+" -> key("+l[p]+")"].concat(s));if(h instanceof Error)return h}}))}function p(e,t,n,r){return s((function(){for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return c(e,n,r).apply(void 0,a)||t&&l(t).apply(void 0,a)}))}function f(e){var t=void 0===arguments[1]?"Iterable":arguments[1],n=void 0===arguments[2]?r.Iterable.isIterable:arguments[2];function o(r,o,a,s,u){for(var c=arguments.length,l=Array(c>5?c-5:0),p=5;p<c;p++)l[p-5]=arguments[p];var f=r[o];if(!n(f)){var h=i(f),d=s;return new Error("Invalid "+d+" `"+u+"` of type `"+h+"` supplied to `"+a+"`, expected an Immutable.js "+t+".")}var v=f.toObject();for(var m in e){var g=e[m];if(g){var y=g.apply(void 0,[v,m,a,s,u+"."+m].concat(l));if(y)return y}}}return s(o)}function h(e){return f(e)}e.exports=a},function(e,t,n){var r=n(895);function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}e.exports=o},function(e,t,n){e.exports=n(602)},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){e.exports=n(541)},function(e,t,n){"use strict";var r=n(81);e.exports=r},function(e,t){e.exports={}},function(e,t,n){e.exports=n(659)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){e.exports=n(653)},function(e,t,n){"use strict";n.r(t),n.d(t,"isOAS3",(function(){return c})),n.d(t,"isSwagger2",(function(){return l})),n.d(t,"OAS3ComponentWrapFactory",(function(){return p}));var r=n(29),o=n.n(r),a=n(167),i=n.n(a),s=n(0),u=n.n(s);function c(e){var t=e.get("openapi");return"string"==typeof t&&(i()(t).call(t,"3.0.")&&t.length>4)}function l(e){var t=e.get("swagger");return"string"==typeof t&&i()(t).call(t,"2.0")}function p(e){return function(t,n){return function(r){return n&&n.specSelectors&&n.specSelectors.specJson?c(n.specSelectors.specJson())?u.a.createElement(e,o()({},r,n,{Ori:t})):u.a.createElement(t,r):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}}},function(e,t,n){var r=n(41),o=n(228),a=n(52),i=n(174),s=n(229),u=n(361),c=o("wks"),l=r.Symbol,p=u?l:l&&l.withoutSetter||i;e.exports=function(e){return a(c,e)||(s&&a(l,e)?c[e]=l[e]:c[e]=p("Symbol."+e)),c[e]}},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=i(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var p=0;p<s.length;p++)a.call(n,s[p])&&(u[s[p]]=n[s[p]])}}return u}},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(53))},function(e,t,n){"use strict";var r=n(31),o=n(137),a=n(465),i=(n(25),o.ID_ATTRIBUTE_NAME),s=a,u="__reactInternalInstance$"+Math.random().toString(36).slice(2);function c(e,t){return 1===e.nodeType&&e.getAttribute(i)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function l(e){for(var t;t=e._renderedComponent;)e=t;return e}function p(e,t){var n=l(e);n._hostNode=t,t[u]=n}function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var a in n)if(n.hasOwnProperty(a)){var i=n[a],u=l(i)._domID;if(0!==u){for(;null!==o;o=o.nextSibling)if(c(o,u)){p(i,o);continue e}r("32",u)}}e._flags|=s.hasCachedChildNodes}}function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[u]);e=r.pop())t=n,r.length&&f(n,e);return t}var d={getClosestInstanceFromNode:h,getInstanceFromNode:function(e){var t=h(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())f(e,e._hostNode);return e._hostNode},precacheChildNodes:f,precacheNode:p,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[u],e._hostNode=null)}};e.exports=d},function(e,t,n){e.exports=n(863)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34);e.exports=function(e){return r[e+"Prototype"]}},function(e,t,n){var r=n(191);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SPEC",(function(){return Q})),n.d(t,"UPDATE_URL",(function(){return ee})),n.d(t,"UPDATE_JSON",(function(){return te})),n.d(t,"UPDATE_PARAM",(function(){return ne})),n.d(t,"UPDATE_EMPTY_PARAM_INCLUSION",(function(){return re})),n.d(t,"VALIDATE_PARAMS",(function(){return oe})),n.d(t,"SET_RESPONSE",(function(){return ae})),n.d(t,"SET_REQUEST",(function(){return ie})),n.d(t,"SET_MUTATED_REQUEST",(function(){return se})),n.d(t,"LOG_REQUEST",(function(){return ue})),n.d(t,"CLEAR_RESPONSE",(function(){return ce})),n.d(t,"CLEAR_REQUEST",(function(){return le})),n.d(t,"CLEAR_VALIDATE_PARAMS",(function(){return pe})),n.d(t,"UPDATE_OPERATION_META_VALUE",(function(){return fe})),n.d(t,"UPDATE_RESOLVED",(function(){return he})),n.d(t,"UPDATE_RESOLVED_SUBTREE",(function(){return de})),n.d(t,"SET_SCHEME",(function(){return ve})),n.d(t,"updateSpec",(function(){return me})),n.d(t,"updateResolved",(function(){return ge})),n.d(t,"updateUrl",(function(){return ye})),n.d(t,"updateJsonSpec",(function(){return be})),n.d(t,"parseToJson",(function(){return _e})),n.d(t,"resolveSpec",(function(){return Ee})),n.d(t,"requestResolvedSubtree",(function(){return Se})),n.d(t,"changeParam",(function(){return Ae})),n.d(t,"changeParamByIdentity",(function(){return ke})),n.d(t,"updateResolvedSubtree",(function(){return Oe})),n.d(t,"invalidateResolvedSubtreeCache",(function(){return je})),n.d(t,"validateParams",(function(){return Te})),n.d(t,"updateEmptyParamInclusion",(function(){return Ie})),n.d(t,"clearValidateParams",(function(){return Pe})),n.d(t,"changeConsumesValue",(function(){return Ne})),n.d(t,"changeProducesValue",(function(){return Me})),n.d(t,"setResponse",(function(){return Re})),n.d(t,"setRequest",(function(){return De})),n.d(t,"setMutatedRequest",(function(){return Le})),n.d(t,"logRequest",(function(){return Be})),n.d(t,"executeRequest",(function(){return Fe})),n.d(t,"execute",(function(){return Ue})),n.d(t,"clearResponse",(function(){return qe})),n.d(t,"clearRequest",(function(){return ze})),n.d(t,"setScheme",(function(){return Ve}));var r=n(26),o=n.n(r),a=n(56),i=n.n(a),s=n(344),u=n.n(s),c=n(21),l=n.n(c),p=n(15),f=n.n(p),h=n(2),d=n.n(h),v=n(13),m=n.n(v),g=n(16),y=n.n(g),b=n(12),_=n.n(b),w=n(77),E=n.n(w),x=n(43),C=n.n(x),S=n(100),A=n.n(S),k=n(22),O=n.n(k),j=n(83),T=n.n(j),I=n(345),P=n.n(I),N=n(6),M=n.n(N),R=n(14),D=n.n(R),L=n(20),B=n.n(L),F=n(101),U=n.n(F),q=n(1),z=n(122),V=n.n(z),W=n(141),H=n.n(W),J=n(210),$=n.n(J),K=n(514),Y=n.n(K),G=n(346),Z=n.n(G),X=n(4),Q="spec_update_spec",ee="spec_update_url",te="spec_update_json",ne="spec_update_param",re="spec_update_empty_param_inclusion",oe="spec_validate_param",ae="spec_set_response",ie="spec_set_request",se="spec_set_mutated_request",ue="spec_log_request",ce="spec_clear_response",le="spec_clear_request",pe="spec_clear_validate_param",fe="spec_update_operation_meta_value",he="spec_update_resolved",de="spec_update_resolved_subtree",ve="set_scheme";function me(e){var t,n=(t=e,$()(t)?t:"").replace(/\t/g,"  ");if("string"==typeof e)return{type:Q,payload:n}}function ge(e){return{type:he,payload:e}}function ye(e){return{type:ee,payload:e}}function be(e){return{type:te,payload:e}}var _e=function(e){return function(t){var n=t.specActions,r=t.specSelectors,o=t.errActions,a=r.specStr,i=null;try{e=e||a(),o.clear({source:"parser"}),i=U.a.safeLoad(e)}catch(e){return console.error(e),o.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return i&&"object"===B()(i)?n.updateJsonSpec(i):{}}},we=!1,Ee=function(e,t){return function(n){var r=n.specActions,o=n.specSelectors,a=n.errActions,i=n.fn,s=i.fetch,u=i.resolve,c=i.AST,l=void 0===c?{}:c,p=n.getConfigs;we||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),we=!0);var f=p(),h=f.modelPropertyMacro,d=f.parameterMacro,v=f.requestInterceptor,m=f.responseInterceptor;void 0===e&&(e=o.specJson()),void 0===t&&(t=o.url());var g=l.getLineNumberForPath?l.getLineNumberForPath:function(){},y=o.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:h,parameterMacro:d,requestInterceptor:v,responseInterceptor:m}).then((function(e){var t=e.spec,n=e.errors;if(a.clear({type:"thrown"}),D()(n)&&n.length>0){var o=M()(n).call(n,(function(e){return console.error(e),e.line=e.fullPath?g(y,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",P()(e,"message",{enumerable:!0,value:e.message}),e}));a.newThrownErrBatch(o)}return r.updateResolved(t)}))}},xe=[],Ce=Y()(T()(C.a.mark((function e(){var t,n,r,o,a,i,s,u,c,l,p,f,h,d,v,m,g;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xe.system){e.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),e.abrupt("return");case 4:if(n=t.errActions,r=t.errSelectors,o=t.fn,a=o.resolveSubtree,i=o.AST,s=void 0===i?{}:i,u=t.specSelectors,c=t.specActions,a){e.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),e.abrupt("return");case 8:return l=s.getLineNumberForPath?s.getLineNumberForPath:function(){},p=u.specStr(),f=t.getConfigs(),h=f.modelPropertyMacro,d=f.parameterMacro,v=f.requestInterceptor,m=f.responseInterceptor,e.prev=11,e.next=14,O()(xe).call(xe,function(){var e=T()(C.a.mark((function e(t,o){var i,s,c,f,g,y,b;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return i=e.sent,s=i.resultMap,c=i.specWithCurrentSubtrees,e.next=7,a(c,o,{baseDoc:u.url(),modelPropertyMacro:h,parameterMacro:d,requestInterceptor:v,responseInterceptor:m});case 7:return f=e.sent,g=f.errors,y=f.spec,r.allErrors().size&&n.clearBy((function(e){var t;return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!A()(t=e.get("fullPath")).call(t,(function(e,t){return e===o[t]||void 0===o[t]}))})),D()(g)&&g.length>0&&(b=M()(g).call(g,(function(e){return e.line=e.fullPath?l(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",P()(e,"message",{enumerable:!0,value:e.message}),e})),n.newThrownErrBatch(b)),Z()(s,o,y),Z()(c,o,y),e.abrupt("return",{resultMap:s,specWithCurrentSubtrees:c});case 15:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),E.a.resolve({resultMap:(u.specResolvedSubtree([])||Object(q.Map)()).toJS(),specWithCurrentSubtrees:u.specJson().toJS()}));case 14:g=e.sent,delete xe.system,xe=[],e.next=22;break;case 19:e.prev=19,e.t0=e.catch(11),console.error(e.t0);case 22:c.updateResolvedSubtree([],g.resultMap);case 23:case"end":return e.stop()}}),e,null,[[11,19]])}))),35),Se=function(e){return function(t){var n;_()(n=M()(xe).call(xe,(function(e){return e.join("@@")}))).call(n,e.join("@@"))>-1||(xe.push(e),xe.system=t,Ce())}};function Ae(e,t,n,r,o){return{type:ne,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:o}}}function ke(e,t,n,r){return{type:ne,payload:{path:e,param:t,value:n,isXml:r}}}var Oe=function(e,t){return{type:de,payload:{path:e,value:t}}},je=function(){return{type:de,payload:{path:[],value:Object(q.Map)()}}},Te=function(e,t){return{type:oe,payload:{pathMethod:e,isOAS3:t}}},Ie=function(e,t,n,r){return{type:re,payload:{pathMethod:e,paramName:t,paramIn:n,includeEmptyValue:r}}};function Pe(e){return{type:pe,payload:{pathMethod:e}}}function Ne(e,t){return{type:fe,payload:{path:e,value:t,key:"consumes_value"}}}function Me(e,t){return{type:fe,payload:{path:e,value:t,key:"produces_value"}}}var Re=function(e,t,n){return{payload:{path:e,method:t,res:n},type:ae}},De=function(e,t,n){return{payload:{path:e,method:t,req:n},type:ie}},Le=function(e,t,n){return{payload:{path:e,method:t,req:n},type:se}},Be=function(e){return{payload:e,type:ue}},Fe=function(e){return function(t){var n,r,o=t.fn,a=t.specActions,i=t.specSelectors,s=t.getConfigs,c=t.oas3Selectors,p=e.pathName,h=e.method,v=e.operation,g=s(),b=g.requestInterceptor,_=g.responseInterceptor,w=v.toJS();v&&v.get("parameters")&&y()(n=m()(r=v.get("parameters")).call(r,(function(e){return e&&!0===e.get("allowEmptyValue")}))).call(n,(function(t){if(i.parameterInclusionSettingFor([p,h],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};var n=Object(X.C)(t,e.parameters);(!n||n&&0===n.size)&&(e.parameters[t.get("name")]="")}}));if(e.contextUrl=V()(i.url()).toString(),w&&w.operationId?e.operationId=w.operationId:w&&p&&h&&(e.operationId=o.opId(w,p,h)),i.isOAS3()){var E,x=d()(E="".concat(p,":")).call(E,h);e.server=c.selectedServer(x)||c.selectedServer();var S=c.serverVariables({server:e.server,namespace:x}).toJS(),A=c.serverVariables({server:e.server}).toJS();e.serverVariables=f()(S).length?S:A,e.requestContentType=c.requestContentType(p,h),e.responseContentType=c.responseContentType(p,h)||"*/*";var k=c.requestBodyValue(p,h),O=c.requestBodyInclusionSetting(p,h);if(Object(X.t)(k))e.requestBody=JSON.parse(k);else if(k&&k.toJS){var j;e.requestBody=m()(j=M()(k).call(k,(function(e){return q.Map.isMap(e)?e.get("value"):e}))).call(j,(function(e,t){return(D()(e)?0!==e.length:!Object(X.q)(e))||O.get(t)})).toJS()}else e.requestBody=k}var I=l()({},e);I=o.buildRequest(I),a.setRequest(e.pathName,e.method,I);var P=function(){var t=T()(C.a.mark((function t(n){var r,o;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.apply(undefined,[n]);case 2:return r=t.sent,o=l()({},r),a.setMutatedRequest(e.pathName,e.method,o),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();e.requestInterceptor=P,e.responseInterceptor=_;var N=u()();return o.execute(e).then((function(t){t.duration=u()()-N,a.setResponse(e.pathName,e.method,t)})).catch((function(t){console.error(t),a.setResponse(e.pathName,e.method,{error:!0,err:H()(t)})}))}},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=i()(e,["path","method"]);return function(e){var a=e.fn.fetch,i=e.specSelectors,s=e.specActions,u=i.specJsonWithResolvedSubtrees().toJS(),c=i.operationScheme(t,n),l=i.contentTypeValues([t,n]).toJS(),p=l.requestContentType,f=l.responseContentType,h=/xml/i.test(p),d=i.parameterValues([t,n],h).toJS();return s.executeRequest(o()(o()({},r),{},{fetch:a,spec:u,pathName:t,method:n,parameters:d,requestContentType:p,scheme:c,responseContentType:f}))}};function qe(e,t){return{type:ce,payload:{path:e,method:t}}}function ze(e,t){return{type:le,payload:{path:e,method:t}}}function Ve(e,t,n){return{type:ve,payload:{scheme:e,path:t,method:n}}}},function(e,t,n){var r=n(36);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(34),o=n(52),a=n(227),i=n(63).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||i(t,e,{value:a.f(e)})}},function(e,t,n){"use strict";var r=n(160),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];e.exports=function(e,t){var n,i;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,i={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){i[String(t)]=e}))})),i),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){var r=n(401),o=n(241),a=n(673),i=n(177),s=n(180);e.exports=function(e,t){var n;if(void 0===i||null==a(e)){if(o(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var u=0,c=function(){};return{s:c,n:function(){return u>=e.length?{done:!0}:{done:!1,value:e[u++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,p=!0,f=!1;return{s:function(){n=r(e)},n:function(){var e=n.next();return p=e.done,e},e:function(e){f=!0,l=e},f:function(){try{p||null==n.return||n.return()}finally{if(f)throw l}}}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(44);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(448),o=n(446),a=n(854);e.exports=function(e,t){if(null==e)return{};var n,i,s=a(e,t);if(o){var u=o(e);for(i=0;i<u.length;i++)n=u[i],r(t).call(t,n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){e.exports=n(637)},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return b})),n.d(t,"e",(function(){return _})),n.d(t,"c",(function(){return E})),n.d(t,"a",(function(){return x})),n.d(t,"d",(function(){return C}));var r=n(51),o=n.n(r),a=n(16),i=n.n(a),s=n(35),u=n.n(s),c=n(2),l=n.n(c),p=n(20),f=n.n(p),h=n(59),d=n.n(h),v=n(351),m=n.n(v),g=function(e){return String.prototype.toLowerCase.call(e)},y=function(e){return e.replace(/[^\w]/gi,"_")};function b(e){var t=e.openapi;return!!t&&m()(t,"3")}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.v2OperationIdCompatibilityMode;if(!e||"object"!==f()(e))return null;var a=(e.operationId||"").replace(/\s/g,"");return a.length?y(e.operationId):w(t,n,{v2OperationIdCompatibilityMode:o})}function w(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.v2OperationIdCompatibilityMode;if(o){var a,i,s=l()(a="".concat(t.toLowerCase(),"_")).call(a,e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return(s=s||l()(i="".concat(e.substring(1),"_")).call(i,t)).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return l()(n="".concat(g(t))).call(n,y(e))}function E(e,t){var n;return l()(n="".concat(g(t),"-")).call(n,e)}function x(e,t){return e&&e.paths?function(e,t){return function(e,t,n){if(!e||"object"!==f()(e)||!e.paths||"object"!==f()(e.paths))return null;var r=e.paths;for(var o in r)for(var a in r[o])if("PARAMETERS"!==a.toUpperCase()){var i=r[o][a];if(i&&"object"===f()(i)){var s={spec:e,pathName:o,method:a.toUpperCase(),operation:i},u=t(s);if(n&&u)return s}}return}(e,t,!0)||null}(e,(function(e){var n,r=e.pathName,o=e.method,a=e.operation;if(!a||"object"!==f()(a))return!1;var i=a.operationId,s=_(a,r,o),c=E(r,o);return u()(n=[s,c,i]).call(n,(function(e){return e&&e===t}))})):null}function C(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var a in n){var s=n[a];if(d()(s)){var c=s.parameters,p=function(e){var n=s[e];if(!d()(n))return"continue";var p=_(n,a,e);if(p){r[p]?r[p].push(n):r[p]=[n];var f=r[p];if(f.length>1)i()(f).call(f,(function(e,t){var n;e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=l()(n="".concat(p)).call(n,t+1)}));else if(void 0!==n.operationId){var h=f[0];h.__originalOperationId=h.__originalOperationId||n.operationId,h.operationId=p}}if("parameters"!==e){var v=[],m={};for(var g in t)"produces"!==g&&"consumes"!==g&&"security"!==g||(m[g]=t[g],v.push(m));if(c&&(m.parameters=c,v.push(m)),v.length){var y,b=o()(v);try{for(b.s();!(y=b.n()).done;){var w=y.value;for(var E in w)if(n[E]){if("parameters"===E){var x,C=o()(w[E]);try{var S=function(){var e,t=x.value;u()(e=n[E]).call(e,(function(e){return e.name&&e.name===t.name||e.$ref&&e.$ref===t.$ref||e.$$ref&&e.$$ref===t.$$ref||e===t}))||n[E].push(t)};for(C.s();!(x=C.n()).done;)S()}catch(e){C.e(e)}finally{C.f()}}}else n[E]=w[E]}}catch(e){b.e(e)}finally{b.f()}}}};for(var f in s)p(f)}}return t.$$normalized=!0,e}},function(e,t,n){"use strict";n.r(t),n.d(t,"NEW_THROWN_ERR",(function(){return a})),n.d(t,"NEW_THROWN_ERR_BATCH",(function(){return i})),n.d(t,"NEW_SPEC_ERR",(function(){return s})),n.d(t,"NEW_SPEC_ERR_BATCH",(function(){return u})),n.d(t,"NEW_AUTH_ERR",(function(){return c})),n.d(t,"CLEAR",(function(){return l})),n.d(t,"CLEAR_BY",(function(){return p})),n.d(t,"newThrownErr",(function(){return f})),n.d(t,"newThrownErrBatch",(function(){return h})),n.d(t,"newSpecErr",(function(){return d})),n.d(t,"newSpecErrBatch",(function(){return v})),n.d(t,"newAuthErr",(function(){return m})),n.d(t,"clear",(function(){return g})),n.d(t,"clearBy",(function(){return y}));var r=n(141),o=n.n(r),a="err_new_thrown_err",i="err_new_thrown_err_batch",s="err_new_spec_err",u="err_new_spec_err_batch",c="err_new_auth_err",l="err_clear",p="err_clear_by";function f(e){return{type:a,payload:o()(e)}}function h(e){return{type:i,payload:e}}function d(e){return{type:s,payload:e}}function v(e){return{type:u,payload:e}}function m(e){return{type:c,payload:e}}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_SELECTED_SERVER",(function(){return r})),n.d(t,"UPDATE_REQUEST_BODY_VALUE",(function(){return o})),n.d(t,"UPDATE_REQUEST_BODY_INCLUSION",(function(){return a})),n.d(t,"UPDATE_ACTIVE_EXAMPLES_MEMBER",(function(){return i})),n.d(t,"UPDATE_REQUEST_CONTENT_TYPE",(function(){return s})),n.d(t,"UPDATE_RESPONSE_CONTENT_TYPE",(function(){return u})),n.d(t,"UPDATE_SERVER_VARIABLE_VALUE",(function(){return c})),n.d(t,"SET_REQUEST_BODY_VALIDATE_ERROR",(function(){return l})),n.d(t,"CLEAR_REQUEST_BODY_VALIDATE_ERROR",(function(){return p})),n.d(t,"setSelectedServer",(function(){return f})),n.d(t,"setRequestBodyValue",(function(){return h})),n.d(t,"setRequestBodyInclusion",(function(){return d})),n.d(t,"setActiveExamplesMember",(function(){return v})),n.d(t,"setRequestContentType",(function(){return m})),n.d(t,"setResponseContentType",(function(){return g})),n.d(t,"setServerVariableValue",(function(){return y})),n.d(t,"setRequestBodyValidateError",(function(){return b})),n.d(t,"clearRequestBodyValidateError",(function(){return _})),n.d(t,"initRequestBodyValidateError",(function(){return w}));var r="oas3_set_servers",o="oas3_set_request_body_value",a="oas3_set_request_body_inclusion",i="oas3_set_active_examples_member",s="oas3_set_request_content_type",u="oas3_set_response_content_type",c="oas3_set_server_variable_value",l="oas3_set_request_body_validate_error",p="oas3_clear_request_body_validate_error";function f(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}function h(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:t,pathMethod:n}}}function d(e){var t=e.value,n=e.pathMethod,r=e.name;return{type:a,payload:{value:t,pathMethod:n,name:r}}}function v(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextName;return{type:i,payload:{name:t,pathMethod:n,contextType:r,contextName:o}}}function m(e){var t=e.value,n=e.pathMethod;return{type:s,payload:{value:t,pathMethod:n}}}function g(e){var t=e.value,n=e.path,r=e.method;return{type:u,payload:{value:t,path:n,method:r}}}function y(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:c,payload:{server:t,namespace:n,key:r,val:o}}}var b=function(e){var t=e.path,n=e.method,r=e.validationErrors;return{type:l,payload:{path:t,method:n,validationErrors:r}}},_=function(e){var t=e.path,n=e.method;return{type:p,payload:{path:t,method:n}}},w=function(e){var t=e.pathMethod;return{type:p,payload:{path:t[0],method:t[1]}}}},function(e,t,n){var r=n(48),o=n(355),a=n(54),i=n(173),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=i(t,!0),a(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(48),o=n(36),a=n(52),i=Object.defineProperty,s={},u=function(e){throw e};e.exports=function(e,t){if(a(s,e))return s[e];t||(t={});var n=[][e],c=!!a(t,"ACCESSORS")&&t.ACCESSORS,l=a(t,0)?t[0]:u,p=a(t,1)?t[1]:void 0;return s[e]=!!n&&!o((function(){if(c&&!r)return!0;var e={length:-1};c?i(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,l,p)}))}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(76),o=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=i),a(o,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var i=o.apply(null,r);i&&e.push(i)}else if("object"===a)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(112),o=n(59);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(172),o=n(125);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(48),o=n(63),a=n(105);e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(34),o=n(41),a=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r=n(125);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r,o,a,i=n(363),s=n(41),u=n(44),c=n(70),l=n(52),p=n(175),f=n(150),h=s.WeakMap;if(i){var d=new h,v=d.get,m=d.has,g=d.set;r=function(e,t){return g.call(d,e,t),t},o=function(e){return v.call(d,e)||{}},a=function(e){return m.call(d,e)}}else{var y=p("state");f[y]=!0,r=function(e,t){return c(e,y,t),t},o=function(e){return l(e,y)?e[y]:{}},a=function(e){return l(e,y)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(406),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t,n){"use strict";e.exports={debugTool:null}},function(e,t,n){"use strict";(function(e){var r=n(582),o=n(583),a=n(372);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var a,i=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=n;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var p=!0,f=0;f<u;f++)if(c(e,a+f)!==c(t,f)){p=!1;break}if(p)return a}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var i=0;i<r;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[n+i]=s}return i}function _(e,t,n,r){return V(q(t,e.length-n),e,n,r)}function w(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return w(e,t,n,r)}function x(e,t,n,r){return V(z(t),e,n,r)}function C(e,t,n,r){return V(function(e,t){for(var n,r,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)r=(n=e.charCodeAt(i))>>8,o=n%256,a.push(o),a.push(r);return a}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,s,u,c=e[o],l=null,p=c>239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=p}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=k));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):v.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(r,o),l=e.slice(t,n),p=0;p<s;++p)if(c[p]!==l[p]){a=c[p],i=l[p];break}return a<i?-1:i<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function O(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function j(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function T(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",a=t;a<n;++a)o+=U(e[a]);return o}function I(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-n,2);o<a;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-n,4);o<a;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function D(e,t,n,r,o,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,a){return a||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,a){return a||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var a=0;a<o;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var a=n-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,a=r-n;if(this===e&&n<t&&t<r)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var i=u.isBuffer(e)?e:q(new u(e,r).toString()),s=i.length;for(a=0;a<n-t;++a)this[a+t]=i[a%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){var n;t=t||1/0;for(var r=e.length,o=null,a=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(53))},function(e,t,n){e.exports=n(858)},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(149),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){n(176);var r=n(552),o=n(41),a=n(97),i=n(70),s=n(109),u=n(39)("toStringTag");for(var c in r){var l=o[c],p=l&&l.prototype;p&&a(p)!==u&&i(p,u,c),s[c]=s.Array}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(469),i=n(120),s=n(470),u=n(138),c=n(198),l=n(25),p=[],f=0,h=a.getPooled(),d=!1,v=null;function m(){E.ReactReconcileTransaction&&v||r("123")}var g=[{initialize:function(){this.dirtyComponentsLength=p.length},close:function(){this.dirtyComponentsLength!==p.length?(p.splice(0,this.dirtyComponentsLength),w()):p.length=0}},{initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}}];function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=a.getPooled(),this.reconcileTransaction=E.ReactReconcileTransaction.getPooled(!0)}function b(e,t){return e._mountOrder-t._mountOrder}function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.length),p.sort(b),f++;for(var n=0;n<t;n++){var o,a=p[n],i=a._pendingCallbacks;if(a._pendingCallbacks=null,s.logTopLevelRenders){var c=a;a._currentElement.type.isReactTopLevelWrapper&&(c=a._renderedComponent),o="React update: "+c.getName(),console.time(o)}if(u.performUpdateIfNecessary(a,e.reconcileTransaction,f),o&&console.timeEnd(o),i)for(var l=0;l<i.length;l++)e.callbackQueue.enqueue(i[l],a.getPublicInstance())}}o(y.prototype,c,{getTransactionWrappers:function(){return g},destructor:function(){this.dirtyComponentsLength=null,a.release(this.callbackQueue),this.callbackQueue=null,E.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return c.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),i.addPoolingTo(y);var w=function(){for(;p.length||d;){if(p.length){var e=y.getPooled();e.perform(_,null,e),y.release(e)}if(d){d=!1;var t=h;h=a.getPooled(),t.notifyAll(),a.release(t)}}};var E={ReactReconcileTransaction:null,batchedUpdates:function(e,t,n,r,o,a){return m(),v.batchedUpdates(e,t,n,r,o,a)},enqueueUpdate:function e(t){m(),v.isBatchingUpdates?(p.push(t),null==t._updateBatchNumber&&(t._updateBatchNumber=f+1)):v.batchedUpdates(e,t)},flushBatchedUpdates:w,injection:{injectReconcileTransaction:function(e){e||r("126"),E.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){e||r("127"),"function"!=typeof e.batchedUpdates&&r("128"),"boolean"!=typeof e.isBatchingUpdates&&r("129"),v=e}},asap:function(e,t){l(v.isBatchingUpdates,"ReactUpdates.asap: Can't enqueue an asap callback in a context whereupdates are not being batched."),h.enqueue(e,t),d=!0}};e.exports=E},function(e,t,n){var r=n(864);function o(e,t,n,o,a,i,s){try{var u=e[i](s),c=u.value}catch(e){return void n(e)}u.done?t(c):r.resolve(c).then(o,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new r((function(r,a){var i=e.apply(t,n);function s(e){o(i,r,a,s,u,"next",e)}function u(e){o(i,r,a,s,u,"throw",e)}s(void 0)}))}}},function(e,t,n){"use strict";(function(t){function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach((function(e,a){"object"==typeof e&&null!==e?Array.isArray(e)?t[a]=o(e):n(e)?t[a]=r(e):t[a]=i({},e):t[a]=e})),t}function a(e,t){return"__proto__"===t?void 0:e[t]}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,s=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach((function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(c){return t=a(s,c),(e=a(u,c))===s?void 0:"object"!=typeof e||null===e?void(s[c]=e):Array.isArray(e)?void(s[c]=o(e)):n(e)?void(s[c]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(s[c]=i({},e)):void(s[c]=i(t,e))}))})),s}}).call(this,n(76).Buffer)},function(e,t,n){e.exports=n(675)},function(e,t,n){"use strict";n.r(t),n.d(t,"SHOW_AUTH_POPUP",(function(){return h})),n.d(t,"AUTHORIZE",(function(){return d})),n.d(t,"LOGOUT",(function(){return v})),n.d(t,"PRE_AUTHORIZE_OAUTH2",(function(){return m})),n.d(t,"AUTHORIZE_OAUTH2",(function(){return g})),n.d(t,"VALIDATE",(function(){return y})),n.d(t,"CONFIGURE_AUTH",(function(){return b})),n.d(t,"RESTORE_AUTHORIZATION",(function(){return _})),n.d(t,"showDefinitions",(function(){return w})),n.d(t,"authorize",(function(){return E})),n.d(t,"authorizeWithPersistOption",(function(){return x})),n.d(t,"logout",(function(){return C})),n.d(t,"logoutWithPersistOption",(function(){return S})),n.d(t,"preAuthorizeImplicit",(function(){return A})),n.d(t,"authorizeOauth2",(function(){return k})),n.d(t,"authorizeOauth2WithPersistOption",(function(){return O})),n.d(t,"authorizePassword",(function(){return j})),n.d(t,"authorizeApplication",(function(){return T})),n.d(t,"authorizeAccessCodeWithFormParams",(function(){return I})),n.d(t,"authorizeAccessCodeWithBasicAuthentication",(function(){return P})),n.d(t,"authorizeRequest",(function(){return N})),n.d(t,"configureAuth",(function(){return M})),n.d(t,"restoreAuthorization",(function(){return R})),n.d(t,"persistAuthorizationIfNeeded",(function(){return D}));var r=n(20),o=n.n(r),a=n(21),i=n.n(a),s=n(32),u=n.n(s),c=n(122),l=n.n(c),p=n(27),f=n(4),h="show_popup",d="authorize",v="logout",m="pre_authorize_oauth2",g="authorize_oauth2",y="validate",b="configure_auth",_="restore_authorization";function w(e){return{type:h,payload:e}}function E(e){return{type:d,payload:e}}var x=function(e){return function(t){var n=t.authActions;n.authorize(e),n.persistAuthorizationIfNeeded()}};function C(e){return{type:v,payload:e}}var S=function(e){return function(t){var n=t.authActions;n.logout(e),n.persistAuthorizationIfNeeded()}},A=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,a=e.token,i=e.isValid,s=o.schema,c=o.name,l=s.get("flow");delete p.a.swaggerUIRedirectOauth2,"accessCode"===l||i||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),a.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:u()(a)}):n.authorizeOauth2WithPersistOption({auth:o,token:a})}};function k(e){return{type:g,payload:e}}var O=function(e){return function(t){var n=t.authActions;n.authorizeOauth2(e),n.persistAuthorizationIfNeeded()}},j=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.name,a=e.username,s=e.password,u=e.passwordType,c=e.clientId,l=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" "),username:a,password:s},h={};switch(u){case"request-body":!function(e,t,n){t&&i()(e,{client_id:t});n&&i()(e,{client_secret:n})}(p,c,l);break;case"basic":h.Authorization="Basic "+Object(f.a)(c+":"+l);break;default:console.warn("Warning: invalid passwordType ".concat(u," was passed, not including client id and secret"))}return n.authorizeRequest({body:Object(f.b)(p),url:r.get("tokenUrl"),name:o,headers:h,query:{},auth:e})}};var T=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,a=e.name,i=e.clientId,s=e.clientSecret,u={Authorization:"Basic "+Object(f.a)(i+":"+s)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:Object(f.b)(c),name:a,url:r.get("tokenUrl"),auth:e,headers:u})}},I=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,a=t.name,i=t.clientId,s=t.clientSecret,u=t.codeVerifier,c={grant_type:"authorization_code",code:t.code,client_id:i,client_secret:s,redirect_uri:n,code_verifier:u};return r.authorizeRequest({body:Object(f.b)(c),name:a,url:o.get("tokenUrl"),auth:t})}},P=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,a=t.name,i=t.clientId,s=t.clientSecret,u={Authorization:"Basic "+Object(f.a)(i+":"+s)},c={grant_type:"authorization_code",code:t.code,client_id:i,redirect_uri:n};return r.authorizeRequest({body:Object(f.b)(c),name:a,url:o.get("tokenUrl"),auth:t,headers:u})}},N=function(e){return function(t){var n,r=t.fn,a=t.getConfigs,s=t.authActions,c=t.errActions,p=t.oas3Selectors,f=t.specSelectors,h=t.authSelectors,d=e.body,v=e.query,m=void 0===v?{}:v,g=e.headers,y=void 0===g?{}:g,b=e.name,_=e.url,w=e.auth,E=(h.getConfigs()||{}).additionalQueryStringParams;if(f.isOAS3()){var x=p.selectedServer();n=l()(_,p.serverEffectiveValue({server:x}),!0)}else n=l()(_,f.url(),!0);"object"===o()(E)&&(n.query=i()({},n.query,E));var C=n.toString(),S=i()({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},y);r.fetch({url:C,method:"post",headers:S,query:m,body:d,requestInterceptor:a().requestInterceptor,responseInterceptor:a().responseInterceptor}).then((function(e){var t=JSON.parse(e.data),n=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?n||r?c.newAuthErr({authId:b,level:"error",source:"auth",message:u()(t)}):s.authorizeOauth2WithPersistOption({auth:w,token:t}):c.newAuthErr({authId:b,level:"error",source:"auth",message:e.statusText})})).catch((function(e){var t=new Error(e).message;if(e.response&&e.response.data){var n=e.response.data;try{var r="string"==typeof n?JSON.parse(n):n;r.error&&(t+=", error: ".concat(r.error)),r.error_description&&(t+=", description: ".concat(r.error_description))}catch(e){}}c.newAuthErr({authId:b,level:"error",source:"auth",message:t})}))}};function M(e){return{type:b,payload:e}}function R(e){return{type:_,payload:e}}var D=function(){return function(e){var t=e.authSelectors;if((0,e.getConfigs)().persistAuthorization){var n=t.authorized();localStorage.setItem("authorized",u()(n.toJS()))}}}},function(e,t,n){var r=n(232),o=n(63).f,a=n(70),i=n(52),s=n(550),u=n(39)("toStringTag");e.exports=function(e,t,n,c){if(e){var l=n?e:e.prototype;i(l,u)||o(l,u,{configurable:!0,value:t}),c&&!r&&a(l,"toString",s)}}},function(e,t,n){var r=n(107),o=n(172),a=n(72),i=n(79),s=n(235),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,l=4==e,p=6==e,f=5==e||p;return function(h,d,v,m){for(var g,y,b=a(h),_=o(b),w=r(d,v,3),E=i(_.length),x=0,C=m||s,S=t?C(h,E):n?C(h,0):void 0;E>x;x++)if((f||x in _)&&(y=w(g=_[x],x,b),e))if(t)S[x]=y;else if(y)switch(e){case 3:return!0;case 5:return g;case 6:return x;case 2:u.call(S,g)}else if(l)return!1;return p?-1:c||l?l:S}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(e,t,n){"use strict";e.exports={current:null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,c=[],l=!1,p=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p<t;)u&&u[p].run();p=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(40),o=n(120),a=n(81),i=(n(33),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function u(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){0;var s=o[i];s?this[i]=s(n):"target"===i?this.target=r:this[i]=n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}r(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<i.length;n++)this[i[n]]=null}}),u.Interface=s,u.augmentClass=function(e,t){var n=this,a=function(){};a.prototype=n.prototype;var i=new a;r(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=r({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(u,o.fourArgumentPooler),e.exports=u},function(e,t,n){var r=n(405);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"lastError",(function(){return M})),n.d(t,"url",(function(){return R})),n.d(t,"specStr",(function(){return D})),n.d(t,"specSource",(function(){return L})),n.d(t,"specJson",(function(){return B})),n.d(t,"specResolved",(function(){return F})),n.d(t,"specResolvedSubtree",(function(){return U})),n.d(t,"specJsonWithResolvedSubtrees",(function(){return z})),n.d(t,"spec",(function(){return V})),n.d(t,"isOAS3",(function(){return W})),n.d(t,"info",(function(){return H})),n.d(t,"externalDocs",(function(){return J})),n.d(t,"version",(function(){return $})),n.d(t,"semver",(function(){return K})),n.d(t,"paths",(function(){return Y})),n.d(t,"operations",(function(){return G})),n.d(t,"consumes",(function(){return Z})),n.d(t,"produces",(function(){return X})),n.d(t,"security",(function(){return Q})),n.d(t,"securityDefinitions",(function(){return ee})),n.d(t,"findDefinition",(function(){return te})),n.d(t,"definitions",(function(){return ne})),n.d(t,"basePath",(function(){return re})),n.d(t,"host",(function(){return oe})),n.d(t,"schemes",(function(){return ae})),n.d(t,"operationsWithRootInherited",(function(){return ie})),n.d(t,"tags",(function(){return se})),n.d(t,"tagDetails",(function(){return ue})),n.d(t,"operationsWithTags",(function(){return ce})),n.d(t,"taggedOperations",(function(){return le})),n.d(t,"responses",(function(){return pe})),n.d(t,"requests",(function(){return fe})),n.d(t,"mutatedRequests",(function(){return he})),n.d(t,"responseFor",(function(){return de})),n.d(t,"requestFor",(function(){return ve})),n.d(t,"mutatedRequestFor",(function(){return me})),n.d(t,"allowTryItOutFor",(function(){return ge})),n.d(t,"parameterWithMetaByIdentity",(function(){return ye})),n.d(t,"parameterInclusionSettingFor",(function(){return be})),n.d(t,"parameterWithMeta",(function(){return _e})),n.d(t,"operationWithMeta",(function(){return we})),n.d(t,"getParameter",(function(){return Ee})),n.d(t,"hasHost",(function(){return xe})),n.d(t,"parameterValues",(function(){return Ce})),n.d(t,"parametersIncludeIn",(function(){return Se})),n.d(t,"parametersIncludeType",(function(){return Ae})),n.d(t,"contentTypeValues",(function(){return ke})),n.d(t,"currentProducesFor",(function(){return Oe})),n.d(t,"producesOptionsFor",(function(){return je})),n.d(t,"consumesOptionsFor",(function(){return Te})),n.d(t,"operationScheme",(function(){return Ie})),n.d(t,"canExecuteScheme",(function(){return Pe})),n.d(t,"validateBeforeExecute",(function(){return Ne})),n.d(t,"getOAS3RequiredRequestBodyContentType",(function(){return Me}));var r=n(14),o=n.n(r),a=n(17),i=n.n(a),s=n(35),u=n.n(s),c=n(208),l=n.n(c),p=n(22),f=n.n(p),h=n(58),d=n.n(h),v=n(13),m=n.n(v),g=n(6),y=n.n(g),b=n(12),_=n.n(b),w=n(16),E=n.n(w),x=n(23),C=n.n(x),S=n(2),A=n.n(S),k=n(18),O=n.n(k),j=n(19),T=n(4),I=n(1),P=["get","put","post","delete","options","head","patch","trace"],N=function(e){return e||Object(I.Map)()},M=Object(j.a)(N,(function(e){return e.get("lastError")})),R=Object(j.a)(N,(function(e){return e.get("url")})),D=Object(j.a)(N,(function(e){return e.get("spec")||""})),L=Object(j.a)(N,(function(e){return e.get("specSource")||"not-editor"})),B=Object(j.a)(N,(function(e){return e.get("json",Object(I.Map)())})),F=Object(j.a)(N,(function(e){return e.get("resolved",Object(I.Map)())})),U=function(e,t){var n;return e.getIn(A()(n=["resolvedSubtrees"]).call(n,O()(t)),void 0)},q=function e(t,n){return I.Map.isMap(t)&&I.Map.isMap(n)?n.get("$$ref")?n:Object(I.OrderedMap)().mergeWith(e,t,n):n},z=Object(j.a)(N,(function(e){return Object(I.OrderedMap)().mergeWith(q,e.get("json"),e.get("resolvedSubtrees"))})),V=function(e){return B(e)},W=Object(j.a)(V,(function(){return!1})),H=Object(j.a)(V,(function(e){return Re(e&&e.get("info"))})),J=Object(j.a)(V,(function(e){return Re(e&&e.get("externalDocs"))})),$=Object(j.a)(H,(function(e){return e&&e.get("version")})),K=Object(j.a)($,(function(e){var t;return C()(t=/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e)).call(t,1)})),Y=Object(j.a)(z,(function(e){return e.get("paths")})),G=Object(j.a)(Y,(function(e){if(!e||e.size<1)return Object(I.List)();var t=Object(I.List)();return e&&E()(e)?(E()(e).call(e,(function(e,n){if(!e||!E()(e))return{};E()(e).call(e,(function(e,r){var o;_()(P).call(P,r)<0||(t=t.push(Object(I.fromJS)({path:n,method:r,operation:e,id:A()(o="".concat(r,"-")).call(o,n)})))}))})),t):Object(I.List)()})),Z=Object(j.a)(V,(function(e){return Object(I.Set)(e.get("consumes"))})),X=Object(j.a)(V,(function(e){return Object(I.Set)(e.get("produces"))})),Q=Object(j.a)(V,(function(e){return e.get("security",Object(I.List)())})),ee=Object(j.a)(V,(function(e){return e.get("securityDefinitions")})),te=function(e,t){var n=e.getIn(["resolvedSubtrees","definitions",t],null),r=e.getIn(["json","definitions",t],null);return n||r||null},ne=Object(j.a)(V,(function(e){var t=e.get("definitions");return I.Map.isMap(t)?t:Object(I.Map)()})),re=Object(j.a)(V,(function(e){return e.get("basePath")})),oe=Object(j.a)(V,(function(e){return e.get("host")})),ae=Object(j.a)(V,(function(e){return e.get("schemes",Object(I.Map)())})),ie=Object(j.a)(G,Z,X,(function(e,t,n){return y()(e).call(e,(function(e){return e.update("operation",(function(e){if(e){if(!I.Map.isMap(e))return;return e.withMutations((function(e){return e.get("consumes")||e.update("consumes",(function(e){return Object(I.Set)(e).merge(t)})),e.get("produces")||e.update("produces",(function(e){return Object(I.Set)(e).merge(n)})),e}))}return Object(I.Map)()}))}))})),se=Object(j.a)(V,(function(e){var t=e.get("tags",Object(I.List)());return I.List.isList(t)?m()(t).call(t,(function(e){return I.Map.isMap(e)})):Object(I.List)()})),ue=function(e,t){var n,r=se(e)||Object(I.List)();return d()(n=m()(r).call(r,I.Map.isMap)).call(n,(function(e){return e.get("name")===t}),Object(I.Map)())},ce=Object(j.a)(ie,se,(function(e,t){return f()(e).call(e,(function(e,t){var n=Object(I.Set)(t.getIn(["operation","tags"]));return n.count()<1?e.update("default",Object(I.List)(),(function(e){return e.push(t)})):f()(n).call(n,(function(e,n){return e.update(n,Object(I.List)(),(function(e){return e.push(t)}))}),e)}),f()(t).call(t,(function(e,t){return e.set(t.get("name"),Object(I.List)())}),Object(I.OrderedMap)()))})),le=function(e){return function(t){var n,r=(0,t.getConfigs)(),o=r.tagsSorter,a=r.operationsSorter;return y()(n=ce(e).sortBy((function(e,t){return t}),(function(e,t){var n="function"==typeof o?o:T.I.tagsSorter[o];return n?n(e,t):null}))).call(n,(function(t,n){var r="function"==typeof a?a:T.I.operationsSorter[a],o=r?l()(t).call(t,r):t;return Object(I.Map)({tagDetails:ue(e,n),operations:o})}))}},pe=Object(j.a)(N,(function(e){return e.get("responses",Object(I.Map)())})),fe=Object(j.a)(N,(function(e){return e.get("requests",Object(I.Map)())})),he=Object(j.a)(N,(function(e){return e.get("mutatedRequests",Object(I.Map)())})),de=function(e,t,n){return pe(e).getIn([t,n],null)},ve=function(e,t,n){return fe(e).getIn([t,n],null)},me=function(e,t,n){return he(e).getIn([t,n],null)},ge=function(){return!0},ye=function(e,t,n){var r,o,a=z(e).getIn(A()(r=["paths"]).call(r,O()(t),["parameters"]),Object(I.OrderedMap)()),i=e.getIn(A()(o=["meta","paths"]).call(o,O()(t),["parameters"]),Object(I.OrderedMap)()),s=y()(a).call(a,(function(e){var t,r,o,a=i.get(A()(t="".concat(n.get("in"),".")).call(t,n.get("name"))),s=i.get(A()(r=A()(o="".concat(n.get("in"),".")).call(o,n.get("name"),".hash-")).call(r,n.hashCode()));return Object(I.OrderedMap)().merge(e,a,s)}));return d()(s).call(s,(function(e){return e.get("in")===n.get("in")&&e.get("name")===n.get("name")}),Object(I.OrderedMap)())},be=function(e,t,n,r){var o,a,i=A()(o="".concat(r,".")).call(o,n);return e.getIn(A()(a=["meta","paths"]).call(a,O()(t),["parameter_inclusions",i]),!1)},_e=function(e,t,n,r){var o,a=z(e).getIn(A()(o=["paths"]).call(o,O()(t),["parameters"]),Object(I.OrderedMap)()),i=d()(a).call(a,(function(e){return e.get("in")===r&&e.get("name")===n}),Object(I.OrderedMap)());return ye(e,t,i)},we=function(e,t,n){var r,o=z(e).getIn(["paths",t,n],Object(I.OrderedMap)()),a=e.getIn(["meta","paths",t,n],Object(I.OrderedMap)()),i=y()(r=o.get("parameters",Object(I.List)())).call(r,(function(r){return ye(e,[t,n],r)}));return Object(I.OrderedMap)().merge(o,a).set("parameters",i)};function Ee(e,t,n,r){var o;t=t||[];var a=e.getIn(A()(o=["meta","paths"]).call(o,O()(t),["parameters"]),Object(I.fromJS)([]));return d()(a).call(a,(function(e){return I.Map.isMap(e)&&e.get("name")===n&&e.get("in")===r}))||Object(I.Map)()}var xe=Object(j.a)(V,(function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]}));function Ce(e,t,n){var r;t=t||[];var o=we.apply(void 0,A()(r=[e]).call(r,O()(t))).get("parameters",Object(I.List)());return f()(o).call(o,(function(e,t){var r=n&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(Object(T.B)(t,{allowHashes:!1}),r)}),Object(I.fromJS)({}))}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(I.List.isList(e))return u()(e).call(e,(function(e){return I.Map.isMap(e)&&e.get("in")===t}))}function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(I.List.isList(e))return u()(e).call(e,(function(e){return I.Map.isMap(e)&&e.get("type")===t}))}function ke(e,t){var n,r;t=t||[];var o=z(e).getIn(A()(n=["paths"]).call(n,O()(t)),Object(I.fromJS)({})),a=e.getIn(A()(r=["meta","paths"]).call(r,O()(t)),Object(I.fromJS)({})),i=Oe(e,t),s=o.get("parameters")||new I.List,u=a.get("consumes_value")?a.get("consumes_value"):Ae(s,"file")?"multipart/form-data":Ae(s,"formData")?"application/x-www-form-urlencoded":void 0;return Object(I.fromJS)({requestContentType:u,responseContentType:i})}function Oe(e,t){var n,r;t=t||[];var o=z(e).getIn(A()(n=["paths"]).call(n,O()(t)),null);if(null!==o){var a=e.getIn(A()(r=["meta","paths"]).call(r,O()(t),["produces_value"]),null),i=o.getIn(["produces",0],null);return a||i||"application/json"}}function je(e,t){var n;t=t||[];var r=z(e),o=r.getIn(A()(n=["paths"]).call(n,O()(t)),null);if(null!==o){var a=t,s=i()(a,1)[0],u=o.get("produces",null),c=r.getIn(["paths",s,"produces"],null),l=r.getIn(["produces"],null);return u||c||l}}function Te(e,t){var n;t=t||[];var r=z(e),o=r.getIn(A()(n=["paths"]).call(n,O()(t)),null);if(null!==o){var a=t,s=i()(a,1)[0],u=o.get("consumes",null),c=r.getIn(["paths",s,"consumes"],null),l=r.getIn(["consumes"],null);return u||c||l}}var Ie=function(e,t,n){var r=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),a=o()(r)?r[1]:null;return e.getIn(["scheme",t,n])||e.getIn(["scheme","_defaultScheme"])||a||""},Pe=function(e,t,n){var r;return _()(r=["http","https"]).call(r,Ie(e,t,n))>-1},Ne=function(e,t){var n;t=t||[];var r=e.getIn(A()(n=["meta","paths"]).call(n,O()(t),["parameters"]),Object(I.fromJS)([])),o=!0;return E()(r).call(r,(function(e){var t=e.get("errors");t&&t.count()&&(o=!1)})),o},Me=function(e,t){var n,r,o={requestBody:!1,requestContentType:{}},a=e.getIn(A()(n=["resolvedSubtrees","paths"]).call(n,O()(t),["requestBody"]),Object(I.fromJS)([]));return a.size<1||(a.getIn(["required"])&&(o.requestBody=a.getIn(["required"])),E()(r=a.getIn(["content"]).entrySeq()).call(r,(function(e){var t=e[0];if(e[1].getIn(["schema","required"])){var n=e[1].getIn(["schema","required"]).toJS();o.requestContentType[t]=n}}))),o};function Re(e){return I.Map.isMap(e)?e:new I.Map}},function(e,t){e.exports=!0},function(e,t,n){"use strict";var r=n(362).charAt,o=n(73),a=n(230),i="String Iterator",s=o.set,u=o.getterFor(i);a(String,"String",(function(e){s(this,{type:i,string:String(e),index:0})}),(function(){var e,t=u(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(232),o=n(106),a=n(39)("toStringTag"),i="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:i?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){e.exports=n(626)},function(e,t,n){e.exports=n(829)},function(e,t,n){"use strict";var r=n(871);e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_LAYOUT",(function(){return o})),n.d(t,"UPDATE_FILTER",(function(){return a})),n.d(t,"UPDATE_MODE",(function(){return i})),n.d(t,"SHOW",(function(){return s})),n.d(t,"updateLayout",(function(){return u})),n.d(t,"updateFilter",(function(){return c})),n.d(t,"show",(function(){return l})),n.d(t,"changeMode",(function(){return p}));var r=n(4),o="layout_update_layout",a="layout_update_filter",i="layout_update_mode",s="layout_show";function u(e){return{type:o,payload:e}}function c(e){return{type:a,payload:e}}function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=Object(r.w)(e),{type:s,payload:{thing:e,shown:t}}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=Object(r.w)(e),{type:i,payload:{thing:e,mode:t}}}},function(e,t,n){"use strict";var r=n(1054),o=n(1055);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),p=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(1056);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var _=u.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=i.exec(b);if(w){var E=(w=w[0]).toLowerCase();this.protocol=E,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===b.substr(0,2);!x||w&&m[w]||(b=b.substr(2),this.slashes=!0)}if(!m[w]&&(x||w&&!g[w])){for(var C,S,A=-1,k=0;k<f.length;k++){-1!==(O=b.indexOf(f[k]))&&(-1===A||O<A)&&(A=O)}-1!==(S=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(C=b.slice(0,S),b=b.slice(S+1),this.auth=decodeURIComponent(C)),A=-1;for(k=0;k<p.length;k++){var O;-1!==(O=b.indexOf(p[k]))&&(-1===A||O<A)&&(A=O)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var j="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!j)for(var T=this.hostname.split(/\./),I=(k=0,T.length);k<I;k++){var P=T[k];if(P&&!P.match(h)){for(var N="",M=0,R=P.length;M<R;M++)P.charCodeAt(M)>127?N+="x":N+=P[M];if(!N.match(h)){var D=T.slice(0,k),L=T.slice(k+1),B=P.match(d);B&&(D.push(B[1]),L.unshift(B[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[E])for(k=0,I=l.length;k<I;k++){var q=l[k];if(-1!==b.indexOf(q)){var z=encodeURIComponent(q);z===q&&(z=escape(q)),b=b.split(q).join(z)}}var V=b.indexOf("#");-1!==V&&(this.hash=b.substr(V),b=b.slice(0,V));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,W)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[E]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var H=this.search||"";this.path=F+H}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",a=!1,i="";this.host?a=e+this.host:this.hostname&&(a=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(i=y.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==a?(a="//"+(a||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):a||(a=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+a+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},a.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(o.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var n=new a,r=Object.keys(this),i=0;i<r.length;i++){var s=r[i];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=e[l])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var p=Object.keys(e),f=0;f<p.length;f++){var h=p[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||m[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var v=n.pathname||"",y=n.search||"";n.path=v+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||b||n.host&&e.pathname,E=w,x=n.pathname&&n.pathname.split("/")||[],C=(d=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(C&&(n.hostname="",n.port=null,n.host&&(""===x[0]?x[0]=n.host:x.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===x[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,x=d;else if(d.length)x||(x=[]),x.pop(),x=x.concat(d),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(C)n.hostname=n.host=x.shift(),(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=x.slice(-1)[0],A=(n.host||e.host||x.length>1)&&("."===S||".."===S)||""===S,k=0,O=x.length;O>=0;O--)"."===(S=x[O])?x.splice(O,1):".."===S?(x.splice(O,1),k++):k&&(x.splice(O,1),k--);if(!w&&!E)for(;k--;k)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),A&&"/"!==x.join("/").substr(-1)&&x.push("");var j,T=""===x[0]||x[0]&&"/"===x[0].charAt(0);C&&(n.hostname=n.host=T?"":x.length?x.shift():"",(j=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=j.shift(),n.host=n.hostname=j.shift()));return(w=w||n.host&&x.length)&&!T&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(48),o=n(171),a=n(105),i=n(69),s=n(173),u=n(52),c=n(355),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=i(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(u(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(78);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r,o=n(54),a=n(231),i=n(226),s=n(150),u=n(368),c=n(223),l=n(175),p=l("IE_PROTO"),f=function(){},h=function(e){return"<script>"+e+"</"+"script>"},d=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;d=r?function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=c("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F);for(var n=i.length;n--;)delete d.prototype[i[n]];return d()};s[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=o(e),n=new f,f.prototype=null,n[p]=e):n=d(),void 0===t?n:a(n,t)}},function(e,t){e.exports={}},function(e,t,n){var r=n(70);e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:r(e,t,n)}},function(e,t,n){"use strict";var r=n(36);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},function(e,t,n){var r=n(128),o=n(679),a=n(680),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(697),o=n(700);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(419),o=n(737),a=n(129);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(192),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=p;var a=n(157);a.inherits=n(65);var i=n(429),s=n(256);a.inherits(p,i);for(var u=o(s.prototype),c=0;c<u.length;c++){var l=u[c];p.prototype[l]||(p.prototype[l]=s.prototype[l])}function p(e){if(!(this instanceof p))return new p(e);i.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),p.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(436)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";var r=n(772),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){},function(e,t,n){var r=n(54),o=n(397),a=n(79),i=n(107),s=n(156),u=n(396),c=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,n,l,p){var f,h,d,v,m,g,y,b=i(t,n,l?2:1);if(p)f=e;else{if("function"!=typeof(h=s(e)))throw TypeError("Target is not iterable");if(o(h)){for(d=0,v=a(e.length);v>d;d++)if((m=l?b(r(y=e[d])[0],y[1]):b(e[d]))&&m instanceof c)return m;return new c(!1)}f=h.call(e)}for(g=f.next;!(y=g.call(f)).done;)if("object"==typeof(m=u(f,b,y.value,l))&&m&&m instanceof c)return m;return new c(!1)}).stop=function(e){return new c(!0,e)}},function(e,t,n){"use strict";var r=n(31),o=(n(25),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),a=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},i=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||i,n.poolSize||(n.poolSize=10),n.release=a,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},threeArgumentPooler:function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},fourArgumentPooler:function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)}};e.exports=s},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){"use strict";(function(t){var r=n(892),o=n(893),a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,s=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(s,"")}var c=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||r);if("blob:"===e.protocol)o=new h(unescape(e.pathname),{});else if("string"===i)for(n in o=new h(e,{}),l)delete o[n];else if("object"===i){for(n in e)n in l||(o[n]=e[n]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function f(e){e=u(e);var t=i.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var a,i,s,l,d,v,m=c.slice(),g=typeof t,y=this,b=0;for("object"!==g&&"string"!==g&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),t=p(t),a=!(i=f(e||"")).protocol&&!i.slashes,y.slashes=i.slashes||a&&t.slashes,y.protocol=i.protocol||t.protocol||"",e=i.rest,i.slashes||(m[3]=[/(.*)/,"pathname"]);b<m.length;b++)"function"!=typeof(l=m[b])?(s=l[0],v=l[1],s!=s?y[v]=e:"string"==typeof s?~(d=e.indexOf(s))&&("number"==typeof l[2]?(y[v]=e.slice(0,d),e=e.slice(d+l[2])):(y[v]=e.slice(d),e=e.slice(0,d))):(d=s.exec(e))&&(y[v]=d[1],e=e.slice(0,d.index)),y[v]=y[v]||a&&l[3]&&t[v]||"",l[4]&&(y[v]=y[v].toLowerCase())):e=l(e);n&&(y.query=n(y.query)),a&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],a=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(a=!0),n.splice(r,1),i--);return a&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(y.pathname,t.pathname)),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(l=y.auth.split(":"),y.username=l[0]||"",y.password=l[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}h.prototype={set:function(e,t,n){var a=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),a[e]=t;break;case"port":a[e]=t,r(t,a.protocol)?t&&(a.host=a.hostname+":"+t):(a.host=a.hostname,a[e]="");break;case"hostname":a[e]=t,a.port&&(t+=":"+a.port),a.host=t;break;case"host":a[e]=t,/:\d+$/.test(t)?(t=t.split(":"),a.port=t.pop(),a.hostname=t.join(":")):(a.hostname=t,a.port="");break;case"protocol":a.protocol=t.toLowerCase(),a.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";a[e]=t.charAt(0)!==i?i+t:t}else a[e]=t;break;default:a[e]=t}for(var s=0;s<c.length;s++){var u=c[s];u[4]&&(a[u[1]]=a[u[1]].toLowerCase())}return a.origin=a.protocol&&a.host&&"file:"!==a.protocol?a.protocol+"//"+a.host:"null",a.href=a.toString(),a},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var a=r+(n.slashes?"//":"");return n.username&&(a+=n.username,n.password&&(a+=":"+n.password),a+="@"),a+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(a+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(a+=n.hash),a}},h.extractProtocol=f,h.location=p,h.trimLeft=u,h.qs=o,e.exports=h}).call(this,n(53))},function(e,t,n){e.exports=n(1073)},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var r=n(6),o=n.n(r),a=n(13),i=n.n(a),s=n(513),u=n.n(s),c=[n(287),n(288)];function l(e){var t,n={jsSpec:{}},r=u()(c,(function(e,t){try{var r=t.transform(e,n);return i()(r).call(r,(function(e){return!!e}))}catch(t){return console.error("Transformer error:",t),e}}),e);return o()(t=i()(r).call(r,(function(e){return!!e}))).call(t,(function(e){return!e.get("line")&&e.get("path"),e}))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";var r=n(40),o=n(379),a=n(607),i=n(612),s=n(127),u=n(613),c=n(617),l=n(618),p=n(620),f=s.createElement,h=s.createFactory,d=s.cloneElement,v=r,m={Children:{map:a.map,forEach:a.forEach,count:a.count,toArray:a.toArray,only:p},Component:o.Component,PureComponent:o.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:l,createFactory:h,createMixin:function(e){return e},DOM:i,version:c,__spread:v};e.exports=m},function(e,t,n){"use strict";var r=n(40),o=n(89),a=(n(33),n(381),Object.prototype.hasOwnProperty),i=n(382),s={key:!0,ref:!0,__self:!0,__source:!0};function u(e){return void 0!==e.ref}function c(e){return void 0!==e.key}var l=function(e,t,n,r,o,a,s){return{$$typeof:i,type:e,key:t,ref:n,props:s,_owner:a}};l.createElement=function(e,t,n){var r,i={},p=null,f=null;if(null!=t)for(r in u(t)&&(f=t.ref),c(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source,t)a.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);var h=arguments.length-2;if(1===h)i.children=n;else if(h>1){for(var d=Array(h),v=0;v<h;v++)d[v]=arguments[v+2];0,i.children=d}if(e&&e.defaultProps){var m=e.defaultProps;for(r in m)void 0===i[r]&&(i[r]=m[r])}return l(e,p,f,0,0,o.current,i)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceKey=function(e,t){return l(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},l.cloneElement=function(e,t,n){var i,p,f=r({},e.props),h=e.key,d=e.ref,v=(e._self,e._source,e._owner);if(null!=t)for(i in u(t)&&(d=t.ref,v=o.current),c(t)&&(h=""+t.key),e.type&&e.type.defaultProps&&(p=e.type.defaultProps),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==p?f[i]=p[i]:f[i]=t[i]);var m=arguments.length-2;if(1===m)f.children=n;else if(m>1){for(var g=Array(m),y=0;y<m;y++)g[y]=arguments[y+2];f.children=g}return l(e.type,h,d,0,0,v,f)},l.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},e.exports=l},function(e,t,n){var r=n(74).Symbol;e.exports=r},function(e,t,n){var r=n(68),o=n(249);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(55),o=n(252),a=n(745),i=n(93);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},function(e,t,n){var r=n(181);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},function(e,t,n){"use strict";var r=n(116);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){var r=n(66).Buffer;function o(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,o=this._blockSize,a=e.length,i=this._len,s=0;s<a;){for(var u=i%o,c=Math.min(a-s,o-u),l=0;l<c;l++)n[u+l]=e[s+l];s+=c,(i+=c)%o==0&&this._update(n)}return this._len+=a,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){"use strict";function r(e){return null==e}e.exports.isNothing=r,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:r(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,o,a;if(t)for(n=0,r=(a=Object.keys(t)).length;n<r;n+=1)e[o=a[n]]=t[o];return e}},function(e,t,n){"use strict";var r=n(135),o=n(160),a=n(50);function i(e,t,n){var r=[];return e.include.forEach((function(e){n=i(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=i(this,"implicit",[]),this.compiledExplicit=i(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every((function(e){return e instanceof s})))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof a})))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},function(e,t,n){"use strict";var r=n(31);n(25);function o(e,t){return(e&t)===t}var a={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=a,n=e.Properties||{},i=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};for(var p in e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute),n){s.properties.hasOwnProperty(p)&&r("48",p);var f=p.toLowerCase(),h=n[p],d={attributeName:f,attributeNamespace:null,propertyName:p,mutationMethod:null,mustUseProperty:o(h,t.MUST_USE_PROPERTY),hasBooleanValue:o(h,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(h,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(h,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(h,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||r("50",p),u.hasOwnProperty(p)){var v=u[p];d.attributeName=v}i.hasOwnProperty(p)&&(d.attributeNamespace=i[p]),c.hasOwnProperty(p)&&(d.propertyName=c[p]),l.hasOwnProperty(p)&&(d.mutationMethod=l[p]),s.properties[p]=d}}},i=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",s={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:i,ATTRIBUTE_NAME_CHAR:i+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<s._isCustomAttributeFunctions.length;t++){if((0,s._isCustomAttributeFunctions[t])(e))return!0}return!1},injection:a};e.exports=s},function(e,t,n){"use strict";var r=n(921);n(75),n(33);function o(){r.attachRefs(this,this._currentElement)}var a={mountComponent:function(e,t,n,r,a,i){var s=e.mountComponent(t,n,r,a,i);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(o,e),s},getHostNode:function(e){return e.getHostNode()},unmountComponent:function(e,t){r.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,a){var i=e._currentElement;if(t!==i||a!==e._context){0;var s=r.shouldUpdateRefs(i,t);s&&r.detachRefs(e,i),e.receiveComponent(t,n,a),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t,n){e._updateBatchNumber===n&&e.performUpdateIfNecessary(t)}};e.exports=a},function(e,t,n){"use strict";var r=n(269),o=n(200),a=n(270),i=n(474),s="undefined"!=typeof document&&"number"==typeof document.documentMode||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&/\bEdge\/\d/.test(navigator.userAgent);function u(e){if(s){var t=e.node,n=e.children;if(n.length)for(var r=0;r<n.length;r++)c(t,n[r],null);else null!=e.html?o(t,e.html):null!=e.text&&i(t,e.text)}}var c=a((function(e,t,n){11===t.node.nodeType||1===t.node.nodeType&&"object"===t.node.nodeName.toLowerCase()&&(null==t.node.namespaceURI||t.node.namespaceURI===r.html)?(u(t),e.insertBefore(t.node,n)):(e.insertBefore(t.node,n),u(t))}));function l(){return this.node.nodeName}function p(e){return{node:e,children:[],html:null,text:null,toString:l}}p.insertTreeBefore=c,p.replaceChildWithTree=function(e,t){e.parentNode.replaceChild(t.node,e),u(t)},p.queueChild=function(e,t){s?e.children.push(t):e.node.appendChild(t.node)},p.queueHTML=function(e,t){s?e.html=t:o(e.node,t)},p.queueText=function(e,t){s?e.text=t:i(e.node,t)},e.exports=p},function(e,t,n){var r=n(197),o=n(460);e.exports=function(e,t,n,a){var i=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=a?a(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),i?o(n,c,l):r(n,c,l)}return n}},function(e,t,n){"use strict";function r(e,t){var n;return n=Array.isArray(e)?[]:{},t.push(e),Object.keys(e).forEach((function(o){var a=e[o];"function"!=typeof a&&(a&&"object"==typeof a?-1!==t.indexOf(e[o])?n[o]="[Circular]":n[o]=r(e[o],t.slice(0)):n[o]=a)})),"string"==typeof e.name&&(n.name=e.name),"string"==typeof e.message&&(n.message=e.message),"string"==typeof e.stack&&(n.stack=e.stack),n}e.exports=function(e){return"object"==typeof e?r(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){"use strict";n.r(t),n.d(t,"sampleFromSchema",(function(){return E})),n.d(t,"inferSchema",(function(){return x})),n.d(t,"sampleXmlFromSchema",(function(){return C})),n.d(t,"createXMLExample",(function(){return S})),n.d(t,"memoizedCreateXMLExample",(function(){return A})),n.d(t,"memoizedSampleFromSchema",(function(){return k}));var r=n(16),o=n.n(r),a=n(6),i=n.n(a),s=n(14),u=n.n(s),c=n(12),l=n.n(c),p=n(2),f=n.n(p),h=n(4),d=n(509),v=n.n(d),m=n(343),g=n.n(m),y=n(207),b=n.n(y),_={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},string_date:function(){return(new Date).toISOString().substring(0,10)},string_uuid:function(){return"3fa85f64-5717-4562-b3fc-2c963f66afa6"},string_hostname:function(){return"example.com"},string_ipv4:function(){return"198.51.100.42"},string_ipv6:function(){return"2001:0db8:5b96:0000:0000:426f:8e17:642a"},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},w=function(e){var t,n=e=Object(h.A)(e),r=n.type,o=n.format,a=_[f()(t="".concat(r,"_")).call(t,o)]||_[r];return Object(h.s)(a)?a(e):"Unknown Type: "+e.type},E=function e(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=Object(h.A)(t),s=a.type,c=a.example,p=a.properties,f=a.additionalProperties,d=a.items,v=o.includeReadOnly,m=o.includeWriteOnly;if(void 0!==c)return Object(h.e)(c,"$$ref",(function(e){return"string"==typeof e&&l()(e).call(e,"#")>-1}));if(!s)if(p)s="object";else{if(!d)return;s="array"}if("object"===s){var g=Object(h.A)(p),y={};for(var b in g)g[b]&&g[b].deprecated||g[b]&&g[b].readOnly&&!v||g[b]&&g[b].writeOnly&&!m||(y[b]=e(g[b],o));if(!0===f)y.additionalProp1={};else if(f)for(var _=Object(h.A)(f),E=e(_,o),x=1;x<4;x++)y["additionalProp"+x]=E;return y}return"array"===s?u()(d.anyOf)?i()(n=d.anyOf).call(n,(function(t){return e(t,o)})):u()(d.oneOf)?i()(r=d.oneOf).call(r,(function(t){return e(t,o)})):[e(d,o)]:t.enum?t.default?t.default:Object(h.w)(t.enum)[0]:"file"!==s?w(t):void 0},x=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},C=function e(t){var n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=b()({},Object(h.A)(t)),s=i.type,c=i.properties,l=i.additionalProperties,p=i.items,d=i.example,v=a.includeReadOnly,m=a.includeWriteOnly,g=i.default,y={},_={},E=t.xml,x=E.name,C=E.prefix,S=E.namespace,A=i.enum;if(!s)if(c||l)s="object";else{if(!p)return;s="array"}if(n=(C?C+":":"")+(x=x||"notagname"),S){var k=C?"xmlns:"+C:"xmlns";_[k]=S}if("array"===s&&p){if(p.xml=p.xml||E||{},p.xml.name=p.xml.name||E.name,E.wrapped)return y[n]=[],u()(d)?o()(d).call(d,(function(t){p.example=t,y[n].push(e(p,a))})):u()(g)?o()(g).call(g,(function(t){p.default=t,y[n].push(e(p,a))})):y[n]=[e(p,a)],_&&y[n].push({_attr:_}),y;var O=[];return u()(d)?(o()(d).call(d,(function(t){p.example=t,O.push(e(p,a))})),O):u()(g)?(o()(g).call(g,(function(t){p.default=t,O.push(e(p,a))})),O):e(p,a)}if("object"===s){var j=Object(h.A)(c);for(var T in y[n]=[],d=d||{},j)if(j.hasOwnProperty(T)&&(!j[T].readOnly||v)&&(!j[T].writeOnly||m))if(j[T].xml=j[T].xml||{},j[T].xml.attribute){var I=u()(j[T].enum)&&j[T].enum[0],P=j[T].example,N=j[T].default;_[j[T].xml.name||T]=void 0!==P&&P||void 0!==d[T]&&d[T]||void 0!==N&&N||I||w(j[T])}else{j[T].xml.name=j[T].xml.name||T,void 0===j[T].example&&void 0!==d[T]&&(j[T].example=d[T]);var M,R=e(j[T]);if(u()(R))y[n]=f()(M=y[n]).call(M,R);else y[n].push(R)}return!0===l?y[n].push({additionalProp:"Anything can be here"}):l&&y[n].push({additionalProp:w(l)}),_&&y[n].push({_attr:_}),y}return r=void 0!==d?d:void 0!==g?g:u()(A)?A[0]:w(t),y[n]=_?[{_attr:_},r]:r,y};function S(e,t){var n=C(e,t);if(n)return v()(n,{declaration:!0,indent:"\t"})}var A=g()(S),k=g()(E)},function(e,t,n){"use strict";n.r(t),n.d(t,"UPDATE_CONFIGS",(function(){return a})),n.d(t,"TOGGLE_CONFIGS",(function(){return i})),n.d(t,"update",(function(){return s})),n.d(t,"toggle",(function(){return u})),n.d(t,"loaded",(function(){return c}));var r=n(3),o=n.n(r),a="configs_update",i="configs_toggle";function s(e,t){return{type:a,payload:o()({},e,t)}}function u(e){return{type:i,payload:e}}var c=function(){return function(e){var t=e.getConfigs,n=e.authActions;if(t().persistAuthorization){var r=localStorage.getItem("authorized");r&&n.restoreAuthorization({authorized:JSON.parse(r)})}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(37),o=n.n(r),a=n(13),i=n.n(a),s=n(1),u=n.n(s),c=u.a.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isOAS3;if(!u.a.Map.isMap(e))return{schema:u.a.Map(),parameterContentMediaType:null};if(!n)return"body"===e.get("in")?{schema:e.get("schema",u.a.Map()),parameterContentMediaType:null}:{schema:i()(e).call(e,(function(e,t){return o()(c).call(c,t)})),parameterContentMediaType:null};if(e.get("content")){var r=e.get("content",u.a.Map({})).keySeq(),a=r.first();return{schema:e.getIn(["content",a,"schema"],u.a.Map()),parameterContentMediaType:a}}return{schema:e.get("schema",u.a.Map()),parameterContentMediaType:null}}},function(e,t,n){var r=n(1080);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"createStore",(function(){return S})),n.d(t,"combineReducers",(function(){return k})),n.d(t,"bindActionCreators",(function(){return j})),n.d(t,"applyMiddleware",(function(){return P})),n.d(t,"compose",(function(){return T}));var r=n(505),o="object"==typeof self&&self&&self.Object===Object&&self,a=(r.a||o||Function("return this")()).Symbol,i=Object.prototype,s=i.hasOwnProperty,u=i.toString,c=a?a.toStringTag:void 0;var l=function(e){var t=s.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[c]=n:delete e[c]),o},p=Object.prototype.toString;var f=function(e){return p.call(e)},h=a?a.toStringTag:void 0;var d=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":h&&h in Object(e)?l(e):f(e)};var v=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object);var m=function(e){return null!=e&&"object"==typeof e},g=Function.prototype,y=Object.prototype,b=g.toString,_=y.hasOwnProperty,w=b.call(Object);var E=function(e){if(!m(e)||"[object Object]"!=d(e))return!1;var t=v(e);if(null===t)return!0;var n=_.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&b.call(n)==w},x=n(341),C="@@redux/INIT";function S(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(S)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,a=t,i=[],s=i,u=!1;function c(){s===i&&(s=i.slice())}function l(){return a}function p(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),s.push(e),function(){if(t){t=!1,c();var n=s.indexOf(e);s.splice(n,1)}}}function f(e){if(!E(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,a=o(a,e)}finally{u=!1}for(var t=i=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:C}),(r={dispatch:f,subscribe:p,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,f({type:C})}})[x.a]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(l())}return n(),{unsubscribe:t(n)}}})[x.a]=function(){return this},e},r}function A(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function k(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var a=Object.keys(n);var i=void 0;try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:C}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+C+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){i=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var u=a[s],c=n[u],l=e[u],p=c(l,t);if(void 0===p){var f=A(u,t);throw new Error(f)}o[u]=p,r=r||p!==l}return r?o:e}}function O(e,t){return function(){return t(e.apply(void 0,arguments))}}function j(e,t){if("function"==typeof e)return O(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),r={},o=0;o<n.length;o++){var a=n[o],i=e[a];"function"==typeof i&&(r[a]=O(i,t))}return r}function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function P(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var a,i=e(n,r,o),s=i.dispatch,u={getState:i.getState,dispatch:function(e){return s(e)}};return a=t.map((function(e){return e(u)})),s=T.apply(void 0,a)(i.dispatch),I({},i,{dispatch:s})}}}},function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(203),a=n(282),i=n(282);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var s=n(203);t.JsonPatchError=s.PatchError,t.deepClone=s._deepClone,t.escapePathComponent=s.escapePathComponent,t.unescapePathComponent=s.unescapePathComponent;var u=new WeakMap,c=function(e){this.observers=new Map,this.obj=e},l=function(e,t){this.callback=e,this.observer=t};function p(e,t){t.unobserve()}function f(e,t){var n,r=function(e){return u.get(e)}(e);if(r){var a=function(e,t){return e.observers.get(t)}(r,t);n=a&&a.observer}else r=new c(e),u.set(e,r);if(n)return n;if(n={},r.value=o._deepClone(e),t){n.callback=t,n.next=null;var i=function(){h(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(i)};"undefined"!=typeof window&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=[],n.object=e,n.unobserve=function(){h(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(r,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},r.observers.set(t,new l(t,n)),n}function h(e,t){void 0===t&&(t=!1);var n=u.get(e.object);d(n.value,e.object,e.patches,"",t),e.patches.length&&a.applyPatch(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function d(e,t,n,r,a){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=o._objectKeys(t),s=o._objectKeys(e),u=!1,c=s.length-1;c>=0;c--){var l=e[f=s[c]];if(!o.hasOwnProperty(t,f)||void 0===t[f]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(a&&n.push({op:"test",path:r+"/"+o.escapePathComponent(f),value:o._deepClone(l)}),n.push({op:"remove",path:r+"/"+o.escapePathComponent(f)}),u=!0):(a&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}),!0);else{var p=t[f];"object"==typeof l&&null!=l&&"object"==typeof p&&null!=p?d(l,p,n,r+"/"+o.escapePathComponent(f),a):l!==p&&(!0,a&&n.push({op:"test",path:r+"/"+o.escapePathComponent(f),value:o._deepClone(l)}),n.push({op:"replace",path:r+"/"+o.escapePathComponent(f),value:o._deepClone(p)}))}}if(u||i.length!=s.length)for(c=0;c<i.length;c++){var f=i[c];o.hasOwnProperty(e,f)||void 0===t[f]||n.push({op:"add",path:r+"/"+o.escapePathComponent(f),value:o._deepClone(t[f])})}}}function v(e,t,n){void 0===n&&(n=!1);var r=[];return d(e,t,r,"",n),r}t.unobserve=p,t.observe=f,t.generate=h,t.compare=v;var m=n(282),g=n(203);t.default=r({},m,{unobserve:p,observe:f,generate:h,compare:v,JsonPatchError:g.PatchError,deepClone:o._deepClone,escapePathComponent:o.escapePathComponent,unescapePathComponent:g.unescapePathComponent})},function(e,t,n){var r=n(358),o=n(226);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(52),o=n(72),a=n(175),i=n(367),s=a("IE_PROTO"),u=Object.prototype;e.exports=i?Object.getPrototypeOf:function(e){return e=o(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},function(e,t,n){var r=n(106);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){"use strict";var r=n(173),o=n(63),a=n(105);e.exports=function(e,t,n){var i=r(t);i in e?o.f(e,i,a(0,n)):e[i]=n}},function(e,t,n){var r=n(36),o=n(39),a=n(236),i=o("species");e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[i]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,n){"use strict";e.exports=function(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}},function(e,t,n){var r=n(97),o=n(109),a=n(39)("iterator");e.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||o[r(e)]}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(76).Buffer)},function(e,t,n){var r=n(110);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(78),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(136);e.exports=new r({include:[n(457)],implicit:[n(881),n(882)],explicit:[n(883),n(884),n(885),n(886)]})},function(e,t,n){"use strict";var r=n(163),o=n(263),a=n(466),i=n(467),s=(n(33),r.getListener);function u(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return s(e,r)}(e,n,t);r&&(n._dispatchListeners=a(n._dispatchListeners,r),n._dispatchInstances=a(n._dispatchInstances,e))}function c(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwoPhase(e._targetInst,u,e)}function l(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?o.getParentInstance(t):null;o.traverseTwoPhase(n,u,e)}}function p(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=s(e,r);o&&(n._dispatchListeners=a(n._dispatchListeners,o),n._dispatchInstances=a(n._dispatchInstances,e))}}function f(e){e&&e.dispatchConfig.registrationName&&p(e._targetInst,0,e)}var h={accumulateTwoPhaseDispatches:function(e){i(e,c)},accumulateTwoPhaseDispatchesSkipTarget:function(e){i(e,l)},accumulateDirectDispatches:function(e){i(e,f)},accumulateEnterLeaveDispatches:function(e,t,n,r){o.traverseEnterLeave(n,r,p,e,t)}};e.exports=h},function(e,t,n){"use strict";var r=n(31),o=n(262),a=n(263),i=n(264),s=n(466),u=n(467),c=(n(25),{}),l=null,p=function(e,t){e&&(a.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},f=function(e){return p(e,!0)},h=function(e){return p(e,!1)},d=function(e){return"."+e._rootNodeID};var v={injection:{injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&r("94",t,typeof n);var a=d(e);(c[t]||(c[t]={}))[a]=n;var i=o.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=c[t];if(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r}(t,e._currentElement.type,e._currentElement.props))return null;var r=d(e);return n&&n[r]},deleteListener:function(e,t){var n=o.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=c[t];r&&delete r[d(e)]},deleteAllListeners:function(e){var t=d(e);for(var n in c)if(c.hasOwnProperty(n)&&c[n][t]){var r=o.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete c[n][t]}},extractEvents:function(e,t,n,r){for(var a,i=o.plugins,u=0;u<i.length;u++){var c=i[u];if(c){var l=c.extractEvents(e,t,n,r);l&&(a=s(a,l))}}return a},enqueueEvents:function(e){e&&(l=s(l,e))},processEventQueue:function(e){var t=l;l=null,u(t,e?f:h),l&&r("95"),i.rethrowCaughtError()},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=v},function(e,t,n){"use strict";var r=n(92),o=n(265),a={view:function(e){if(e.view)return e.view;var t=o(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,a),e.exports=i},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){"use strict";n.r(t),n.d(t,"parseYamlConfig",(function(){return a}));var r=n(101),o=n.n(r),a=function(e,t){try{return o.a.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,n){e.exports=n(632)},function(e,t,n){"use strict";n.r(t),n.d(t,"makeMappedContainer",(function(){return O})),n.d(t,"render",(function(){return j})),n.d(t,"getComponent",(function(){return P}));var r=n(20),o=n.n(r),a=n(15),i=n.n(a),s=n(21),u=n.n(s),c=n(29),l=n.n(c),p=n(7),f=n.n(p),h=n(5),d=n.n(h),v=n(8),m=n.n(v),g=n(9),y=n.n(g),b=n(0),_=n.n(b),w=n(515),E=n.n(w),x=n(347),C=n(516),S=n.n(C),A=function(e,t,n){var r=function(e,t){return function(n){m()(o,n);var r=y()(o);function o(){return f()(this,o),r.apply(this,arguments)}return d()(o,[{key:"render",value:function(){return _.a.createElement(t,l()({},e(),this.props,this.context))}}]),o}(b.Component)}(e,t),o=Object(x.connect)((function(n,r){var o=u()({},r,e());return(t.prototype.mapStateToProps||function(e){return{state:e}})(n,o)}))(r);return n?function(e,t){return function(n){m()(o,n);var r=y()(o);function o(){return f()(this,o),r.apply(this,arguments)}return d()(o,[{key:"render",value:function(){return _.a.createElement(x.Provider,{store:e},_.a.createElement(t,l()({},this.props,this.context)))}}]),o}(b.Component)}(n,o):o},k=function(e,t,n,r){for(var o in t){var a=t[o];"function"==typeof a&&a(n[o],r[o],e())}},O=function(e,t,n,r,o,a){return function(t){m()(s,t);var r=y()(s);function s(t,n){var o;return f()(this,s),o=r.call(this,t,n),k(e,a,t,{}),o}return d()(s,[{key:"componentWillReceiveProps",value:function(t){k(e,a,t,this.props)}},{key:"render",value:function(){var e=S()(this.props,a?i()(a):[]),t=n(o,"root");return _.a.createElement(t,e)}}]),s}(b.Component)},j=function(e,t,n,r,o){var a=n(e,t,r,"App","root");E.a.render(_.a.createElement(a,null),o)},T=function(e){var t=e.name;return _.a.createElement("div",{className:"fallback"},"😱 ",_.a.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))},I=function(e){var t=function(e){return!(e.prototype&&e.prototype.isReactComponent)}(e)?function(e){return function(t){m()(r,t);var n=y()(r);function r(){return f()(this,r),n.apply(this,arguments)}return d()(r,[{key:"render",value:function(){return e(this.props)}}]),r}(b.Component)}(e):e,n=t.prototype.render;return t.prototype.render=function(){try{for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return n.apply(this,r)}catch(e){return console.error(e),_.a.createElement(T,{error:e,name:t.name})}},t},P=function(e,t,n,r,a){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if("string"!=typeof r)throw new TypeError("Need a string, to fetch a component. Was given a "+o()(r));var s=n(r);return s?a?"root"===a?A(e,s,t()):A(e,I(s)):I(s):(i.failSilently||e().log.warn("Could not find component:",r),null)}},function(e,t,n){e.exports=n(1062)},function(e,t,n){"use strict";n.r(t),n.d(t,"setHash",(function(){return r}));var r=function(e){return e?history.pushState(null,null,"#".concat(e)):window.location.hash=""}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(36),o=n(106),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(44);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(228),o=n(174),a=r("keys");e.exports=function(e){return a[e]||(a[e]=o(e))}},function(e,t,n){"use strict";var r=n(69),o=n(234),a=n(109),i=n(73),s=n(230),u="Array Iterator",c=i.set,l=i.getterFor(u);e.exports=s(Array,"Array",(function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})}),(function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),a.Arguments=a.Array,o("keys"),o("values"),o("entries")},function(e,t,n){e.exports=n(553)},function(e,t){},function(e,t,n){"use strict";e.exports={}},function(e,t,n){var r=n(393),o=n(650),a=n(391);e.exports=function(e,t){var n;if(e){if("string"==typeof e)return a(e,t);var i=o(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?r(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(e,t):void 0}}},function(e,t,n){var r=n(112),o=n(90);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(113)(Object,"create");e.exports=r},function(e,t,n){var r=n(705),o=n(706),a=n(707),i=n(708),s=n(709);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(121);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(711);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(716),o=n(744),a=n(253),i=n(55),s=n(749);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):s(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(739),o=n(243),a=n(740),i=n(741),s=n(742),u=n(112),c=n(411),l="[object Map]",p="[object Promise]",f="[object Set]",h="[object WeakMap]",d="[object DataView]",v=c(r),m=c(o),g=c(a),y=c(i),b=c(s),_=u;(r&&_(new r(new ArrayBuffer(1)))!=d||o&&_(new o)!=l||a&&_(a.resolve())!=p||i&&_(new i)!=f||s&&_(new s)!=h)&&(_=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case v:return d;case m:return l;case g:return p;case y:return f;case b:return h}return t}),e.exports=_},function(e,t,n){var r=n(130),o=n(131);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,i,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,o)}));default:for(a=new Array(s-1),i=0;i<a.length;)a[i++]=arguments[i];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(91))},function(e,t,n){"use strict";e.exports=n(777)("forEach")},function(e,t,n){"use strict";var r=n(438),o=n(435),a=n(257),i=n(786);(e.exports=function(e,t){var n,a,s,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=s=!0,a=!1):(n=i.call(e,"c"),a=i.call(e,"e"),s=i.call(e,"w")),c={value:t,configurable:n,enumerable:a,writable:s},u?r(o(u),c):c}).gs=function(e,t,n){var s,u,c,l;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(c=n,n=void 0):(c=t,t=n=void 0),null==e?(s=!0,u=!1):(s=i.call(e,"c"),u=i.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:u},c?r(o(c),l):l}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,n){"use strict";var r=n(136);e.exports=r.DEFAULT=new r({include:[n(161)],explicit:[n(887),n(888),n(889)]})},function(e,t,n){var r=n(460),o=n(121),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var i=e[t];a.call(e,t)&&o(i,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){"use strict";var r=n(31),o=(n(25),{}),a={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,n,o,a,i,s,u){var c,l;this.isInTransaction()&&r("27");try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,n,o,a,i,s,u),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return l},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var r=t[n];try{this.wrapperInitData[n]=o,this.wrapperInitData[n]=r.initialize?r.initialize.call(this):null}finally{if(this.wrapperInitData[n]===o)try{this.initializeAll(n+1)}catch(e){}}}},closeAll:function(e){this.isInTransaction()||r("28");for(var t=this.transactionWrappers,n=e;n<t.length;n++){var a,i=t[n],s=this.wrapperInitData[n];try{a=!0,s!==o&&i.close&&i.close.call(this,s),a=!1}finally{if(a)try{this.closeAll(n+1)}catch(e){}}}this.wrapperInitData.length=0}};e.exports=a},function(e,t,n){"use strict";var r=n(164),o=n(473),a={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:n(267),button:function(e){var t=e.button;return"which"in e?t:2===t?2:4===t?1:0},buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},pageX:function(e){return"pageX"in e?e.pageX:e.clientX+o.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+o.currentScrollTop}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,a),e.exports=i},function(e,t,n){"use strict";var r,o=n(57),a=n(269),i=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(270)((function(e,t){if(e.namespaceURI!==a.svg||"innerHTML"in e)e.innerHTML=t;else{(r=r||document.createElement("div")).innerHTML="<svg>"+t+"</svg>";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}}));if(o.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(u=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=u},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){return"boolean"==typeof e||"number"==typeof e?""+e:function(e){var t,n=""+e,o=r.exec(n);if(!o)return n;var a="",i=0,s=0;for(i=o.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}s!==i&&(a+=n.substring(s,i)),s=i+1,a+=t}return s!==i?a+n.substring(s,i):a}(e)}},function(e,t,n){"use strict";var r,o=n(40),a=n(262),i=n(942),s=n(473),u=n(943),c=n(266),l={},p=!1,f=0,h={topAbort:"abort",topAnimationEnd:u("animationend")||"animationend",topAnimationIteration:u("animationiteration")||"animationiteration",topAnimationStart:u("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:u("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},d="_reactListenersID"+String(Math.random()).slice(2);var v=o({},i,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=function(e){return Object.prototype.hasOwnProperty.call(e,d)||(e[d]=f++,l[e[d]]={}),l[e[d]]}(n),o=a.registrationNameDependencies[e],i=0;i<o.length;i++){var s=o[i];r.hasOwnProperty(s)&&r[s]||("topWheel"===s?c("wheel")?v.ReactEventListener.trapBubbledEvent("topWheel","wheel",n):c("mousewheel")?v.ReactEventListener.trapBubbledEvent("topWheel","mousewheel",n):v.ReactEventListener.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===s?c("scroll",!0)?v.ReactEventListener.trapCapturedEvent("topScroll","scroll",n):v.ReactEventListener.trapBubbledEvent("topScroll","scroll",v.ReactEventListener.WINDOW_HANDLE):"topFocus"===s||"topBlur"===s?(c("focus",!0)?(v.ReactEventListener.trapCapturedEvent("topFocus","focus",n),v.ReactEventListener.trapCapturedEvent("topBlur","blur",n)):c("focusin")&&(v.ReactEventListener.trapBubbledEvent("topFocus","focusin",n),v.ReactEventListener.trapBubbledEvent("topBlur","focusout",n)),r.topBlur=!0,r.topFocus=!0):h.hasOwnProperty(s)&&v.ReactEventListener.trapBubbledEvent(s,h[s],n),r[s]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},supportsEventPageXY:function(){if(!document.createEvent)return!1;var e=document.createEvent("MouseEvent");return null!=e&&"pageX"in e},ensureScrollValueMonitoring:function(){if(void 0===r&&(r=v.supportsEventPageXY()),!r&&!p){var e=s.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),p=!0}}});e.exports=v},function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=Object.prototype.hasOwnProperty;function a(e,t){return o.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)a(e,r)&&t.push(r);return t}function s(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e,t){var n;for(var r in e)if(a(e,r)){if(e[r]===t)return s(r)+"/";if("object"==typeof e[r]&&""!=(n=u(e[r],t)))return s(r)+"/"+n}return""}function c(e,t){var n=[e];for(var r in t){var o="object"==typeof t[r]?JSON.stringify(t[r],null,2):t[r];void 0!==o&&n.push(r+": "+o)}return n.join("\n")}t.hasOwnProperty=a,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=s,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=u,t.getPath=function(e,t){if(e===t)return"/";var n=u(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var l=function(e){function t(t,n,r,o,a){var i=this.constructor,s=e.call(this,c(t,{name:n,index:r,operation:o,tree:a}))||this;return s.name=n,s.index=r,s.operation=o,s.tree=a,Object.setPrototypeOf(s,i.prototype),s.message=c(t,{name:n,index:r,operation:o,tree:a}),s}return r(t,e),t}(Error);t.PatchError=l},function(e,t,n){var r=n(150),o=n(44),a=n(52),i=n(63).f,s=n(174),u=n(1052),c=s("meta"),l=0,p=Object.isExtensible||function(){return!0},f=function(e){i(e,c,{value:{objectID:"O"+ ++l,weakData:{}}})},h=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,c)){if(!p(e))return"F";if(!t)return"E";f(e)}return e[c].objectID},getWeakData:function(e,t){if(!a(e,c)){if(!p(e))return!0;if(!t)return!1;f(e)}return e[c].weakData},onFreeze:function(e){return u&&h.REQUIRED&&p(e)&&!a(e,c)&&f(e),e}};r[c]=!0},function(e,t,n){var r=n(907),o=n(463);function a(t){return e.exports=a=o?r:function(e){return e.__proto__||r(e)},a(t)}e.exports=a},function(e,t,n){var r=n(112),o=n(279),a=n(90),i=Function.prototype,s=Object.prototype,u=i.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e){return null===e?"null":void 0===e?"undefined":"object"===(void 0===e?"undefined":r(e))?Array.isArray(e)?"array":"object":void 0===e?"undefined":r(e)}function a(e){return"object"===o(e)?s(e):"array"===o(e)?i(e):e}function i(e){return e.map(a)}function s(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=a(e[n]));return t}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={arrayBehaviour:n.arrayBehaviour||"replace"},a=t.map((function(e){return e||{}})),c=e||{},l=0;l<a.length;l++)for(var p=a[l],f=Object.keys(p),h=0;h<f.length;h++){var d=f[h],v=p[d],m=o(v),g=o(c[d]);if("object"===m)if("undefined"!==g){var y="object"===g?c[d]:{};c[d]=u({},[y,s(v)],r)}else c[d]=s(v);else if("array"===m)if("array"===g){var b=i(v);c[d]="merge"===r.arrayBehaviour?c[d].concat(b):b}else c[d]=i(v);else c[d]=v}return c}e.exports=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return u(e,n)},e.exports.noMutate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u({},t)},e.exports.withOptions=function(e,t,n){return u(e,t,n)}},function(e,t,n){e.exports=n(665)},function(e,t,n){var r=n(715)(n(752));e.exports=r},function(e,t,n){var r=n(112),o=n(55),a=n(90);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},function(e,t,n){e.exports=n(1032)},function(e,t,n){var r=n(1036),o=n(496)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},function(e,t,n){var r=n(197),o=n(140),a=n(1060),i=n(129),s=n(189),u=n(114),c=Object.prototype.hasOwnProperty,l=a((function(e,t){if(s(t)||i(t))o(t,u(t),e);else for(var n in t)c.call(t,n)&&r(e,n,t[n])}));e.exports=l},function(e,t,n){(function(t){!function(){"use strict";e.exports=function(e){return(e instanceof t?e:t.from(e.toString(),"binary")).toString("base64")}}()}).call(this,n(76).Buffer)},function(e,t,n){e.exports=n(1067)},function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n(2),o=n.n(r),a=n(15),i=n.n(a),s=n(20),u=n.n(s),c=n(7),l=n.n(c),p=n(5),f=n.n(p),h=n(10),d=n.n(h),v=n(8),m=n.n(v),g=n(9),y=n.n(g),b=n(3),_=n.n(b),w=n(0),E=n.n(w),x=n(122),C=n.n(x),S=(n(11),n(4)),A=n(27),k=function(e){m()(n,e);var t=y()(n);function n(e,r){var o;l()(this,n),o=t.call(this,e,r),_()(d()(o),"getDefinitionUrl",(function(){var e=o.props.specSelectors;return new C.a(e.url(),A.a.location).toString()}));var a=(0,e.getConfigs)().validatorUrl;return o.state={url:o.getDefinitionUrl(),validatorUrl:void 0===a?"https://validator.swagger.io/validator":a},o}return f()(n,[{key:"componentWillReceiveProps",value:function(e){var t=(0,e.getConfigs)().validatorUrl;this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===t?"https://validator.swagger.io/validator":t})}},{key:"render",value:function(){var e,t,n=(0,this.props.getConfigs)().spec,r=Object(S.G)(this.state.validatorUrl);return"object"===u()(n)&&i()(n).length?null:this.state.url&&Object(S.F)(this.state.validatorUrl)&&Object(S.F)(this.state.url)?E.a.createElement("span",{className:"float-right"},E.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o()(e="".concat(r,"/debug?url=")).call(e,encodeURIComponent(this.state.url))},E.a.createElement(O,{src:o()(t="".concat(r,"?url=")).call(t,encodeURIComponent(this.state.url)),alt:"Online validator badge"}))):null}}]),n}(E.a.Component),O=function(e){m()(n,e);var t=y()(n);function n(e){var r;return l()(this,n),(r=t.call(this,e)).state={loaded:!1,error:!1},r}return f()(n,[{key:"componentDidMount",value:function(){var e=this,t=new Image;t.onload=function(){e.setState({loaded:!0})},t.onerror=function(){e.setState({error:!0})},t.src=this.props.src}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.src!==this.props.src){var n=new Image;n.onload=function(){t.setState({loaded:!0})},n.onerror=function(){t.setState({error:!0})},n.src=e.src}}},{key:"render",value:function(){return this.state.error?E.a.createElement("img",{alt:"Error"}):this.state.loaded?E.a.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}]),n}(E.a.Component)},function(e,t,n){"use strict";var r=n(1081).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},function(e,t,n){"use strict";var r;function o(e){return(r=r||document.createElement("textarea")).innerHTML="&"+e+";",r.value}n.d(t,"a",(function(){return ke}));var a=Object.prototype.hasOwnProperty;function i(e,t){return!!e&&a.call(e,t)}function s(e){var t=[].slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}var u=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function c(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function p(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var f=/&([a-z#][a-z0-9]{1,31});/gi,h=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function d(e,t){var n=0,r=o(t);return t!==r?r:35===t.charCodeAt(0)&&h.test(t)&&l(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?p(n):e}function v(e){return e.indexOf("&")<0?e:e.replace(f,d)}var m=/[&<>"]/,g=/[&<>"]/g,y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function b(e){return y[e]}function _(e){return m.test(e)?e.replace(g,b):e}var w={};function E(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?E(e,t+2):t}w.blockquote_open=function(){return"<blockquote>\n"},w.blockquote_close=function(e,t){return"</blockquote>"+x(e,t)},w.code=function(e,t){return e[t].block?"<pre><code>"+_(e[t].content)+"</code></pre>"+x(e,t):"<code>"+_(e[t].content)+"</code>"},w.fence=function(e,t,n,r,o){var a,s,u=e[t],l="",p=n.langPrefix;if(u.params){if(s=(a=u.params.split(/\s+/g)).join(" "),i(o.rules.fence_custom,a[0]))return o.rules.fence_custom[a[0]](e,t,n,r,o);l=' class="'+p+_(v(c(s)))+'"'}return"<pre><code"+l+">"+(n.highlight&&n.highlight.apply(n.highlight,[u.content].concat(a))||_(u.content))+"</code></pre>"+x(e,t)},w.fence_custom={},w.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},w.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},w.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+x(e,t)},w.bullet_list_open=function(){return"<ul>\n"},w.bullet_list_close=function(e,t){return"</ul>"+x(e,t)},w.list_item_open=function(){return"<li>"},w.list_item_close=function(){return"</li>\n"},w.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},w.ordered_list_close=function(e,t){return"</ol>"+x(e,t)},w.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},w.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?x(e,t):"")},w.link_open=function(e,t,n){var r=e[t].title?' title="'+_(v(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+_(e[t].href)+'"'+r+o+">"},w.link_close=function(){return"</a>"},w.image=function(e,t,n){var r=' src="'+_(e[t].src)+'"',o=e[t].title?' title="'+_(v(e[t].title))+'"':"";return"<img"+r+(' alt="'+(e[t].alt?_(v(c(e[t].alt))):"")+'"')+o+(n.xhtmlOut?" /":"")+">"},w.table_open=function(){return"<table>\n"},w.table_close=function(){return"</table>\n"},w.thead_open=function(){return"<thead>\n"},w.thead_close=function(){return"</thead>\n"},w.tbody_open=function(){return"<tbody>\n"},w.tbody_close=function(){return"</tbody>\n"},w.tr_open=function(){return"<tr>"},w.tr_close=function(){return"</tr>\n"},w.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},w.th_close=function(){return"</th>"},w.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},w.td_close=function(){return"</td>"},w.strong_open=function(){return"<strong>"},w.strong_close=function(){return"</strong>"},w.em_open=function(){return"<em>"},w.em_close=function(){return"</em>"},w.del_open=function(){return"<del>"},w.del_close=function(){return"</del>"},w.ins_open=function(){return"<ins>"},w.ins_close=function(){return"</ins>"},w.mark_open=function(){return"<mark>"},w.mark_close=function(){return"</mark>"},w.sub=function(e,t){return"<sub>"+_(e[t].content)+"</sub>"},w.sup=function(e,t){return"<sup>"+_(e[t].content)+"</sup>"},w.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},w.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},w.text=function(e,t){return _(e[t].content)},w.htmlblock=function(e,t){return e[t].content},w.htmltag=function(e,t){return e[t].content},w.abbr_open=function(e,t){return'<abbr title="'+_(v(e[t].title))+'">'},w.abbr_close=function(){return"</abbr>"},w.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},w.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},w.footnote_block_close=function(){return"</ol>\n</section>\n"},w.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'"  class="footnote-item">'},w.footnote_close=function(){return"</li>\n"},w.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},w.dl_open=function(){return"<dl>\n"},w.dt_open=function(){return"<dt>"},w.dd_open=function(){return"<dd>"},w.dl_close=function(){return"</dl>\n"},w.dt_close=function(){return"</dt>\n"},w.dd_close=function(){return"</dd>\n"};var x=w.getBreak=function(e,t){return(t=E(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};function C(){this.rules=s({},w),this.getBreak=w.getBreak}function S(){this.__rules__=[],this.__cache__=null}function A(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function k(e,t){var n,r,o,a=-1,i=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<i;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0===--n){r=!0;break}e.parser.skipToken(e)}return r?(a=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=s,e.isInLabel=u,a}function O(e,t,n,r){var o,a,i,s,u,c;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if((a=k(o=new A(e,t,n,r,[]),1))<0||58!==e.charCodeAt(a+1))return-1;for(s=o.posMax,i=a+2;i<s&&10!==o.src.charCodeAt(i);i++);return u=e.slice(2,a),0===(c=e.slice(a+2,i).trim()).length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+u]&&(r.abbreviations[":"+u]=c),i)}function j(e){var t=v(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}function T(e,t){var n,r,o,a=t,i=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<i;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return o=j(c(e.src.slice(a+1,t))),!!e.parser.validateLink(o)&&(e.pos=t+1,e.linkContent=o,!0);92===n&&t+1<i?t+=2:t++}return!1}for(r=0;t<i&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<i)t+=2;else{if(40===n&&++r>1)break;if(41===n&&--r<0)break;t++}return a!==t&&(o=c(e.src.slice(a,t)),!!e.parser.validateLink(o)&&(e.linkContent=o,e.pos=t,!0))}function I(e,t){var n,r=t,o=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t<o;){if((n=e.src.charCodeAt(t))===a)return e.pos=t+1,e.linkContent=c(e.src.slice(r+1,t)),!0;92===n&&t+1<o?t+=2:t++}return!1}function P(e){return e.trim().replace(/\s+/g," ").toUpperCase()}function N(e,t,n,r){var o,a,i,s,u,c,l,p,f;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if((a=k(o=new A(e,t,n,r,[]),0))<0||58!==e.charCodeAt(a+1))return-1;for(s=o.posMax,i=a+2;i<s&&(32===(u=o.src.charCodeAt(i))||10===u);i++);if(!T(o,i))return-1;for(l=o.linkContent,c=i=o.pos,i+=1;i<s&&(32===(u=o.src.charCodeAt(i))||10===u);i++);for(i<s&&c!==i&&I(o,i)?(p=o.linkContent,i=o.pos):(p="",i=c);i<s&&32===o.src.charCodeAt(i);)i++;return i<s&&10!==o.src.charCodeAt(i)?-1:(f=P(e.slice(1,a)),void 0===r.references[f]&&(r.references[f]={title:p,href:l}),i)}C.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,a=0,i="";o--;)i+=r[e[a].type](e,a++,t,n,this);return i},C.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,a=-1,i="";++a<o;)"inline"===e[a].type?i+=this.renderInline(e[a].children,t,n):i+=r[e[a].type](e,a,t,n,this);return i},S.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},S.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))}))}))},S.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},S.prototype.before=function(e,t,n,r){var o=this.__find__(e),a=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},S.prototype.after=function(e,t,n,r){var o=this.__find__(e),a=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},S.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},S.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach((function(e){e.enabled=!1})),e.forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0}),this),this.__cache__=null},S.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1}),this),this.__cache__=null},S.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},A.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},A.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},A.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},A.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};var M=" \n()[]'\".,!?-";function R(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var D=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,L=/\((c|tm|r|p)\)/gi,B={c:"©",r:"®",p:"§",tm:"™"};var F=/['"]/,U=/['"]/g,q=/[-\s()\[\]]/;function z(e,t){return!(t<0||t>=e.length)&&!q.test(e[t])}function V(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var W=[["block",function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}],["abbr",function(e){var t,n,r,o,a=e.tokens;if(!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("paragraph_open"===a[t-1].type&&"inline"===a[t].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=O(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}],["references",function(e){var t,n,r,o,a=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=a.length-1;t<n;t++)if("inline"===a[t].type&&"paragraph_open"===a[t-1].type&&"paragraph_close"===a[t+1].type){for(r=a[t].content;r.length&&!((o=N(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();a[t].content=r,r.length||(a[t-1].tight=!0,a[t+1].tight=!0)}}],["inline",function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}],["footnote_tail",function(e){var t,n,r,o,a,i,s,u,c,l=0,p=!1,f={};if(e.env.footnotes&&(e.tokens=e.tokens.filter((function(e){return"footnote_reference_open"===e.type?(p=!0,u=[],c=e.label,!1):"footnote_reference_close"===e.type?(p=!1,f[":"+c]=u,!1):(p&&u.push(e),!p)})),e.env.footnotes.list)){for(i=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:l++}),t=0,n=i.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:l++}),i[t].tokens?((s=[]).push({type:"paragraph_open",tight:!1,level:l++}),s.push({type:"inline",content:"",level:l,children:i[t].tokens}),s.push({type:"paragraph_close",tight:!1,level:--l})):i[t].label&&(s=f[":"+i[t].label]),e.tokens=e.tokens.concat(s),a="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=i[t].count>0?i[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:l});a&&e.tokens.push(a),e.tokens.push({type:"footnote_close",level:--l})}e.tokens.push({type:"footnote_block_close",level:--l})}}],["abbr2",function(e){var t,n,r,o,a,i,s,u,c,l,p,f,h=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(f="(^|["+M.split("").map(R).join("")+"])("+Object.keys(e.env.abbreviations).map((function(e){return e.substr(1)})).sort((function(e,t){return t.length-e.length})).map(R).join("|")+")($|["+M.split("").map(R).join("")+"])",e.env.abbrRegExp=new RegExp(f,"g")),l=e.env.abbrRegExp,n=0,r=h.length;n<r;n++)if("inline"===h[n].type)for(t=(o=h[n].children).length-1;t>=0;t--)if("text"===(a=o[t]).type){for(u=0,i=a.content,l.lastIndex=0,c=a.level,s=[];p=l.exec(i);)l.lastIndex>u&&s.push({type:"text",content:i.slice(u,p.index+p[1].length),level:c}),s.push({type:"abbr_open",title:e.env.abbreviations[":"+p[2]],level:c++}),s.push({type:"text",content:p[2],level:c}),s.push({type:"abbr_close",level:--c}),u=l.lastIndex-p[3].length;s.length&&(u<i.length&&s.push({type:"text",content:i.slice(u),level:c}),h[n].children=o=[].concat(o.slice(0,t),s,o.slice(t+1)))}}],["replacements",function(e){var t,n,r,o,a,i;if(e.options.typographer)for(a=e.tokens.length-1;a>=0;a--)if("inline"===e.tokens[a].type)for(t=(o=e.tokens[a].children).length-1;t>=0;t--)"text"===(n=o[t]).type&&(r=n.content,r=(i=r).indexOf("(")<0?i:i.replace(L,(function(e,t){return B[t.toLowerCase()]})),D.test(r)&&(r=r.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=r)}],["smartquotes",function(e){var t,n,r,o,a,i,s,u,c,l,p,f,h,d,v,m,g;if(e.options.typographer)for(g=[],v=e.tokens.length-1;v>=0;v--)if("inline"===e.tokens[v].type)for(m=e.tokens[v].children,g.length=0,t=0;t<m.length;t++)if("text"===(n=m[t]).type&&!F.test(n.text)){for(s=m[t].level,h=g.length-1;h>=0&&!(g[h].level<=s);h--);g.length=h+1,a=0,i=(r=n.content).length;e:for(;a<i&&(U.lastIndex=a,o=U.exec(r));)if(u=!z(r,o.index-1),a=o.index+1,d="'"===o[0],(c=!z(r,a))||u){if(p=!c,f=!u)for(h=g.length-1;h>=0&&(l=g[h],!(g[h].level<s));h--)if(l.single===d&&g[h].level===s){l=g[h],d?(m[l.token].content=V(m[l.token].content,l.pos,e.options.quotes[2]),n.content=V(n.content,o.index,e.options.quotes[3])):(m[l.token].content=V(m[l.token].content,l.pos,e.options.quotes[0]),n.content=V(n.content,o.index,e.options.quotes[1])),g.length=h;continue e}p?g.push({token:t,pos:o.index,single:d,level:s}):f&&d&&(n.content=V(n.content,o.index,"’"))}else d&&(n.content=V(n.content,o.index,"’"))}}]];function H(){this.options={},this.ruler=new S;for(var e=0;e<W.length;e++)this.ruler.push(W[e][0],W[e][1])}function J(e,t,n,r,o){var a,i,s,u,c,l,p;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",l=0,p=!1,s=u=l=0,c=(i=this.src).length;u<c;u++){if(a=i.charCodeAt(u),!p){if(32===a){l++;continue}p=!0}10!==a&&u!==c-1||(10!==a&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(l),p=!1,l=0,s=u+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function $(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])||42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n||r<o&&32!==e.src.charCodeAt(r)?-1:r}function K(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}H.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},J.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},J.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},J.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},J.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},J.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},J.prototype.getLines=function(e,t,n,r){var o,a,i,s,u,c=e;if(e>=t)return"";if(c+1===t)return a=this.bMarks[c]+Math.min(this.tShift[c],n),i=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(a,i);for(s=new Array(t-e),o=0;c<t;c++,o++)(u=this.tShift[c])>n&&(u=n),u<0&&(u=0),a=this.bMarks[c]+u,i=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],s[o]=this.src.slice(a,i);return s.join("")};var Y={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(e){Y[e]=!0}));var G=/^<([a-zA-Z]{1,15})[\s\/>]/,Z=/^<\/([a-zA-Z]{1,15})[\s>]/;function X(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function Q(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return o>=a||126!==(r=e.src.charCodeAt(o++))&&58!==r||o===(n=e.skipSpaces(o))||n>=a?-1:n}var ee=[["code",function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}],["fences",function(e,t,n,r){var o,a,i,s,u,c=!1,l=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(l+3>p)return!1;if(126!==(o=e.src.charCodeAt(l))&&96!==o)return!1;if(u=l,(a=(l=e.skipChars(l,o))-u)<3)return!1;if((i=e.src.slice(l,p).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(s=t;!(++s>=n)&&!((l=u=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.tShift[s]<e.blkIndent);)if(e.src.charCodeAt(l)===o&&!(e.tShift[s]-e.blkIndent>=4||(l=e.skipChars(l,o))-u<a||(l=e.skipSpaces(l))<p)){c=!0;break}return a=e.tShift[t],e.line=s+(c?1:0),e.tokens.push({type:"fence",params:i,content:e.getLines(t+1,s,a,!0),lines:[t,e.line],level:e.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(e,t,n,r){var o,a,i,s,u,c,l,p,f,h,d,v=e.bMarks[t]+e.tShift[t],m=e.eMarks[t];if(v>m)return!1;if(62!==e.src.charCodeAt(v++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(v)&&v++,u=e.blkIndent,e.blkIndent=0,s=[e.bMarks[t]],e.bMarks[t]=v,a=(v=v<m?e.skipSpaces(v):v)>=m,i=[e.tShift[t]],e.tShift[t]=v-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((v=e.bMarks[o]+e.tShift[o])>=(m=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(v++)){if(a)break;for(d=!1,f=0,h=p.length;f<h;f++)if(p[f](e,o,n,!0)){d=!0;break}if(d)break;s.push(e.bMarks[o]),i.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(v)&&v++,s.push(e.bMarks[o]),e.bMarks[o]=v,a=(v=v<m?e.skipSpaces(v):v)>=m,i.push(e.tShift[o]),e.tShift[o]=v-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:l=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,l[1]=e.line,f=0;f<i.length;f++)e.bMarks[f+t]=s[f],e.tShift[f+t]=i[f];return e.blkIndent=u,!0},["paragraph","blockquote","list"]],["hr",function(e,t,n,r){var o,a,i,s=e.bMarks[t],u=e.eMarks[t];if((s+=e.tShift[t])>u)return!1;if(42!==(o=e.src.charCodeAt(s++))&&45!==o&&95!==o)return!1;for(a=1;s<u;){if((i=e.src.charCodeAt(s++))!==o&&32!==i)return!1;i===o&&a++}return!(a<3)&&(r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level})),!0)},["paragraph","blockquote","list"]],["list",function(e,t,n,r){var o,a,i,s,u,c,l,p,f,h,d,v,m,g,y,b,_,w,E,x,C,S=!0;if((p=K(e,t))>=0)v=!0;else{if(!((p=$(e,t))>=0))return!1;v=!1}if(e.level>=e.options.maxNesting)return!1;if(d=e.src.charCodeAt(p-1),r)return!0;for(g=e.tokens.length,v?(l=e.bMarks[t]+e.tShift[t],h=Number(e.src.substr(l,p-l-1)),e.tokens.push({type:"ordered_list_open",order:h,lines:b=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:b=[t,0],level:e.level++}),o=t,y=!1,w=e.parser.ruler.getRules("list");!(!(o<n)||((f=(m=e.skipSpaces(p))>=e.eMarks[o]?1:m-p)>4&&(f=1),f<1&&(f=1),a=p-e.bMarks[o]+f,e.tokens.push({type:"list_item_open",lines:_=[t,0],level:e.level++}),s=e.blkIndent,u=e.tight,i=e.tShift[t],c=e.parentType,e.tShift[t]=m-e.bMarks[t],e.blkIndent=a,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!y||(S=!1),y=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=s,e.tShift[t]=i,e.tight=u,e.parentType=c,e.tokens.push({type:"list_item_close",level:--e.level}),o=t=e.line,_[1]=o,m=e.bMarks[t],o>=n)||e.isEmpty(o)||e.tShift[o]<e.blkIndent);){for(C=!1,E=0,x=w.length;E<x;E++)if(w[E](e,o,n,!0)){C=!0;break}if(C)break;if(v){if((p=K(e,o))<0)break}else if((p=$(e,o))<0)break;if(d!==e.src.charCodeAt(p-1))break}return e.tokens.push({type:v?"ordered_list_close":"bullet_list_close",level:--e.level}),b[1]=o,e.line=o,S&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,g),!0},["paragraph","blockquote"]],["footnote",function(e,t,n,r){var o,a,i,s,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(c+4>l)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(s=c+2;s<l;s++){if(32===e.src.charCodeAt(s))return!1;if(93===e.src.charCodeAt(s))break}return s!==c+2&&(!(s+1>=l||58!==e.src.charCodeAt(++s))&&(r||(s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),u=e.src.slice(c+2,s-2),e.env.footnotes.refs[":"+u]=-1,e.tokens.push({type:"footnote_reference_open",label:u,level:e.level++}),o=e.bMarks[t],a=e.tShift[t],i=e.parentType,e.tShift[t]=e.skipSpaces(s)-s,e.bMarks[t]=s,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=i,e.blkIndent-=4,e.tShift[t]=a,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level})),!0))},["paragraph"]],["heading",function(e,t,n,r){var o,a,i,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(s>=u)return!1;if(35!==(o=e.src.charCodeAt(s))||s>=u)return!1;for(a=1,o=e.src.charCodeAt(++s);35===o&&s<u&&a<=6;)a++,o=e.src.charCodeAt(++s);return!(a>6||s<u&&32!==o)&&(r||(u=e.skipCharsBack(u,32,s),(i=e.skipCharsBack(u,35,s))>s&&32===e.src.charCodeAt(i-1)&&(u=i),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:a,lines:[t,e.line],level:e.level}),s<u&&e.tokens.push({type:"inline",content:e.src.slice(s,u).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:a,level:e.level})),!0)},["paragraph","blockquote"]],["lheading",function(e,t,n){var r,o,a,i=t+1;return!(i>=n)&&(!(e.tShift[i]<e.blkIndent)&&(!(e.tShift[i]-e.blkIndent>3)&&(!((o=e.bMarks[i]+e.tShift[i])>=(a=e.eMarks[i]))&&((45===(r=e.src.charCodeAt(o))||61===r)&&(o=e.skipChars(o,r),!((o=e.skipSpaces(o))<a)&&(o=e.bMarks[t]+e.tShift[t],e.line=i+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),!0))))))}],["htmlblock",function(e,t,n,r){var o,a,i,s=e.bMarks[t],u=e.eMarks[t],c=e.tShift[t];if(s+=c,!e.options.html)return!1;if(c>3||s+2>=u)return!1;if(60!==e.src.charCodeAt(s))return!1;if(33===(o=e.src.charCodeAt(s+1))||63===o){if(r)return!0}else{if(47!==o&&!function(e){var t=32|e;return t>=97&&t<=122}(o))return!1;if(47===o){if(!(a=e.src.slice(s,u).match(Z)))return!1}else if(!(a=e.src.slice(s,u).match(G)))return!1;if(!0!==Y[a[1].toLowerCase()])return!1;if(r)return!0}for(i=t+1;i<e.lineMax&&!e.isEmpty(i);)i++;return e.line=i,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,i,0,!0)}),!0},["paragraph","blockquote"]],["table",function(e,t,n,r){var o,a,i,s,u,c,l,p,f,h,d;if(t+2>n)return!1;if(u=t+1,e.tShift[u]<e.blkIndent)return!1;if((i=e.bMarks[u]+e.tShift[u])>=e.eMarks[u])return!1;if(124!==(o=e.src.charCodeAt(i))&&45!==o&&58!==o)return!1;if(a=X(e,t+1),!/^[-:| ]+$/.test(a))return!1;if((c=a.split("|"))<=2)return!1;for(p=[],s=0;s<c.length;s++){if(!(f=c[s].trim())){if(0===s||s===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(f))return!1;58===f.charCodeAt(f.length-1)?p.push(58===f.charCodeAt(0)?"center":"right"):58===f.charCodeAt(0)?p.push("left"):p.push("")}if(-1===(a=X(e,t).trim()).indexOf("|"))return!1;if(c=a.replace(/^\||\|$/g,"").split("|"),p.length!==c.length)return!1;if(r)return!0;for(e.tokens.push({type:"table_open",lines:h=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"th_open",align:p[s],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[s].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:d=[t+2,0],level:e.level++}),u=t+2;u<n&&!(e.tShift[u]<e.blkIndent)&&-1!==(a=X(e,u).trim()).indexOf("|");u++){for(c=a.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),s=0;s<c.length;s++)e.tokens.push({type:"td_open",align:p[s],level:e.level++}),l=c[s].substring(124===c[s].charCodeAt(0)?1:0,124===c[s].charCodeAt(c[s].length-1)?c[s].length-1:c[s].length).trim(),e.tokens.push({type:"inline",content:l,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),h[1]=d[1]=u,e.line=u,!0},["paragraph"]],["deflist",function(e,t,n,r){var o,a,i,s,u,c,l,p,f,h,d,v,m,g;if(r)return!(e.ddIndent<0)&&Q(e,t)>=0;if(l=t+1,e.isEmpty(l)&&++l>n)return!1;if(e.tShift[l]<e.blkIndent)return!1;if((o=Q(e,l))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:u=[t,0],level:e.level++}),i=t,a=l;e:for(;;){for(g=!0,m=!1,e.tokens.push({type:"dt_open",lines:[i,i],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(i,i+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[i,i],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:s=[l,0],level:e.level++}),v=e.tight,f=e.ddIndent,p=e.blkIndent,d=e.tShift[a],h=e.parentType,e.blkIndent=e.ddIndent=e.tShift[a]+2,e.tShift[a]=o-e.bMarks[a],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,a,n,!0),e.tight&&!m||(g=!1),m=e.line-a>1&&e.isEmpty(e.line-1),e.tShift[a]=d,e.tight=v,e.parentType=h,e.blkIndent=p,e.ddIndent=f,e.tokens.push({type:"dd_close",level:--e.level}),s[1]=l=e.line,l>=n)break e;if(e.tShift[l]<e.blkIndent)break e;if((o=Q(e,l))<0)break;a=l}if(l>=n)break;if(i=l,e.isEmpty(i))break;if(e.tShift[i]<e.blkIndent)break;if((a=i+1)>=n)break;if(e.isEmpty(a)&&a++,a>=n)break;if(e.tShift[a]<e.blkIndent)break;if((o=Q(e,a))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),u[1]=l,e.line=l,g&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0},["paragraph"]],["paragraph",function(e,t){var n,r,o,a,i,s,u=t+1;if(u<(n=e.lineMax)&&!e.isEmpty(u))for(s=e.parser.ruler.getRules("paragraph");u<n&&!e.isEmpty(u);u++)if(!(e.tShift[u]-e.blkIndent>3)){for(o=!1,a=0,i=s.length;a<i;a++)if(s[a](e,u,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}]];function te(){this.ruler=new S;for(var e=0;e<ee.length;e++)this.ruler.push(ee[e][0],ee[e][1],{alt:(ee[e][2]||[]).slice()})}te.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),a=o.length,i=t,s=!1;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n))&&!(e.tShift[i]<e.blkIndent);){for(r=0;r<a&&!o[r](e,i,n,!1);r++);if(e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),(i=e.line)<n&&e.isEmpty(i)){if(s=!0,++i<n&&"list"===e.parentType&&e.isEmpty(i))break;e.line=i}}};var ne=/[\n\t]/g,re=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,oe=/\u00a0/g;function ae(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}te.prototype.parse=function(e,t,n,r){var o,a=0,i=0;if(!e)return[];(e=(e=e.replace(oe," ")).replace(re,"\n")).indexOf("\t")>=0&&(e=e.replace(ne,(function(t,n){var r;return 10===e.charCodeAt(n)?(a=n+1,i=0,t):(r="    ".slice((n-a-i)%4),i=n-a+1,r)}))),o=new J(e,this,t,n,r),this.tokenize(o,o.line,o.lineMax)};for(var ie=[],se=0;se<256;se++)ie.push(0);function ue(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function ce(e,t){var n,r,o,a=t,i=!0,s=!0,u=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;a<u&&e.src.charCodeAt(a)===c;)a++;return a>=u&&(i=!1),(o=a-t)>=4?i=s=!1:(32!==(r=a<u?e.src.charCodeAt(a):-1)&&10!==r||(i=!1),32!==n&&10!==n||(s=!1),95===c&&(ue(n)&&(i=!1),ue(r)&&(s=!1))),{can_open:i,can_close:s,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){ie[e.charCodeAt(0)]=1}));var le=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var pe=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var fe=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],he=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,de=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function ve(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var me=ve(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),ge=ve(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",me)(),ye=ve(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",ge)(),be=ve(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",ye)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var _e=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,we=/^&([a-z][a-z0-9]{1,31});/i;var Ee=[["text",function(e,t){for(var n=e.pos;n<e.posMax&&!ae(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["newline",function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var a=n-2;a>=0;a--)if(32!==e.pending.charCodeAt(a)){e.pending=e.pending.substring(0,a+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}],["escape",function(e,t){var n,r=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<o){if((n=e.src.charCodeAt(r))<256&&0!==ie[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),r++;r<o&&32===e.src.charCodeAt(r);)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}],["backticks",function(e,t){var n,r,o,a,i,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(o=e.src.slice(n,s),a=i=s;-1!==(a=e.src.indexOf("`",i));){for(i=a+1;i<r&&96===e.src.charCodeAt(i);)i++;if(i-a===o.length)return t||e.push({type:"code",content:e.src.slice(s,a).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=i,!0}return t||(e.pending+=o),e.pos+=o.length,!0}],["del",function(e,t){var n,r,o,a,i,s=e.posMax,u=e.pos;if(126!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(126!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(a=u>0?e.src.charCodeAt(u-1):-1,i=e.src.charCodeAt(u+2),126===a)return!1;if(126===i)return!1;if(32===i||10===i)return!1;for(r=u+2;r<s&&126===e.src.charCodeAt(r);)r++;if(r>u+3)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(a=e.src.charCodeAt(e.pos-1),126!==(i=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&126!==a&&(32!==a&&10!==a?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}],["ins",function(e,t){var n,r,o,a,i,s=e.posMax,u=e.pos;if(43!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(43!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(a=u>0?e.src.charCodeAt(u-1):-1,i=e.src.charCodeAt(u+2),43===a)return!1;if(43===i)return!1;if(32===i||10===i)return!1;for(r=u+2;r<s&&43===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(a=e.src.charCodeAt(e.pos-1),43!==(i=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&43!==a&&(32!==a&&10!==a?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}],["mark",function(e,t){var n,r,o,a,i,s=e.posMax,u=e.pos;if(61!==e.src.charCodeAt(u))return!1;if(t)return!1;if(u+4>=s)return!1;if(61!==e.src.charCodeAt(u+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(a=u>0?e.src.charCodeAt(u-1):-1,i=e.src.charCodeAt(u+2),61===a)return!1;if(61===i)return!1;if(32===i||10===i)return!1;for(r=u+2;r<s&&61===e.src.charCodeAt(r);)r++;if(r!==u+2)return e.pos+=r-u,t||(e.pending+=e.src.slice(u,r)),!0;for(e.pos=u+2,o=1;e.pos+1<s;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(a=e.src.charCodeAt(e.pos-1),61!==(i=e.pos+2<s?e.src.charCodeAt(e.pos+2):-1)&&61!==a&&(32!==a&&10!==a?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=u+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=s,!0):(e.pos=u,!1)}],["emphasis",function(e,t){var n,r,o,a,i,s,u,c=e.posMax,l=e.pos,p=e.src.charCodeAt(l);if(95!==p&&42!==p)return!1;if(t)return!1;if(n=(u=ce(e,l)).delims,!u.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(l,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=l+n,s=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==p)e.parser.skipToken(e);else{if(r=(u=ce(e,e.pos)).delims,u.can_close){for(a=s.pop(),i=r;a!==i;){if(i<a){s.push(a-i);break}if(i-=a,0===s.length)break;e.pos+=a,a=s.pop()}if(0===s.length){n=a,o=!0;break}e.pos+=r;continue}u.can_open&&s.push(r),e.pos+=r}return o?(e.posMax=e.pos,e.pos=l+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=l,!1)}],["sub",function(e,t){var n,r,o=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(r=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sub",level:e.level,content:r.replace(le,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=a,!1)}],["sup",function(e,t){var n,r,o=e.posMax,a=e.pos;if(94!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=a+1;e.pos<o;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&a+1!==e.pos?(r=e.src.slice(a+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,t||e.push({type:"sup",level:e.level,content:r.replace(pe,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=a,!1)}],["links",function(e,t){var n,r,o,a,i,s,u,c,l=!1,p=e.pos,f=e.posMax,h=e.pos,d=e.src.charCodeAt(h);if(33===d&&(l=!0,d=e.src.charCodeAt(++h)),91!==d)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=h+1,(r=k(e,h))<0)return!1;if((s=r+1)<f&&40===e.src.charCodeAt(s)){for(s++;s<f&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s>=f)return!1;for(h=s,T(e,s)?(a=e.linkContent,s=e.pos):a="",h=s;s<f&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<f&&h!==s&&I(e,s))for(i=e.linkContent,s=e.pos;s<f&&(32===(c=e.src.charCodeAt(s))||10===c);s++);else i="";if(s>=f||41!==e.src.charCodeAt(s))return e.pos=p,!1;s++}else{if(e.linkLevel>0)return!1;for(;s<f&&(32===(c=e.src.charCodeAt(s))||10===c);s++);if(s<f&&91===e.src.charCodeAt(s)&&(h=s+1,(s=k(e,s))>=0?o=e.src.slice(h,s++):s=h-1),o||(void 0===o&&(s=r+1),o=e.src.slice(n,r)),!(u=e.env.references[P(o)]))return e.pos=p,!1;a=u.href,i=u.title}return t||(e.pos=n,e.posMax=r,l?e.push({type:"image",src:a,title:i,alt:e.src.substr(n,r-n),level:e.level}):(e.push({type:"link_open",href:a,title:i,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=s,e.posMax=f,!0}],["footnote_inline",function(e,t){var n,r,o,a,i=e.posMax,s=e.pos;return!(s+2>=i)&&(94===e.src.charCodeAt(s)&&(91===e.src.charCodeAt(s+1)&&(!(e.level>=e.options.maxNesting)&&(n=s+2,!((r=k(e,s+1))<0)&&(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=r,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,a=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(a)},e.linkLevel--),e.pos=r+1,e.posMax=i,!0)))))}],["footnote_ref",function(e,t){var n,r,o,a,i=e.posMax,s=e.pos;if(s+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(s))return!1;if(94!==e.src.charCodeAt(s+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=s+2;r<i;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return r!==s+2&&(!(r>=i)&&(r++,n=e.src.slice(s+2,r-1),void 0!==e.env.footnotes.refs[":"+n]&&(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],a=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:a,level:e.level})),e.pos=r,e.posMax=i,!0)))}],["autolink",function(e,t){var n,r,o,a,i,s=e.pos;return 60===e.src.charCodeAt(s)&&(!((n=e.src.slice(s)).indexOf(">")<0)&&((r=n.match(de))?!(fe.indexOf(r[1].toLowerCase())<0)&&(i=j(a=r[0].slice(1,-1)),!!e.parser.validateLink(a)&&(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:a,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=r[0].length,!0)):!!(o=n.match(he))&&(i=j("mailto:"+(a=o[0].slice(1,-1))),!!e.parser.validateLink(i)&&(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:a,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=o[0].length,!0))))}],["htmltag",function(e,t){var n,r,o,a=e.pos;return!!e.options.html&&(o=e.posMax,!(60!==e.src.charCodeAt(a)||a+2>=o)&&(!(33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n))&&(!!(r=e.src.slice(a).match(be))&&(t||e.push({type:"htmltag",content:e.src.slice(a,a+r[0].length),level:e.level}),e.pos+=r[0].length,!0))))}],["entity",function(e,t){var n,r,a=e.pos,i=e.posMax;if(38!==e.src.charCodeAt(a))return!1;if(a+1<i)if(35===e.src.charCodeAt(a+1)){if(r=e.src.slice(a).match(_e))return t||(n="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),e.pending+=l(n)?p(n):p(65533)),e.pos+=r[0].length,!0}else if(r=e.src.slice(a).match(we)){var s=o(r[1]);if(r[1]!==s)return t||(e.pending+=s),e.pos+=r[0].length,!0}return t||(e.pending+="&"),e.pos++,!0}]];function xe(){this.ruler=new S;for(var e=0;e<Ee.length;e++)this.ruler.push(Ee[e][0],Ee[e][1]);this.validateLink=Ce}function Ce(e){var t=e.trim().toLowerCase();return-1===(t=v(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}xe.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,a=e.pos;if((n=e.cacheGet(a))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(a,e.pos);e.pos++,e.cacheSet(a,e.pos)}},xe.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,a=e.posMax;e.pos<a;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=a)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},xe.prototype.parse=function(e,t,n,r){var o=new A(e,this,t,n,r);this.tokenize(o)};var Se={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function Ae(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function ke(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new xe,this.block=new te,this.core=new H,this.renderer=new C,this.ruler=new S,this.options={},this.configure(Se[e]),this.set(t||{})}ke.prototype.set=function(e){s(this.options,e)},ke.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)}))},ke.prototype.use=function(e,t){return e(this,t),this},ke.prototype.parse=function(e,t){var n=new Ae(this,e,t);return this.core.process(n),n.tokens},ke.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},ke.prototype.parseInline=function(e,t){var n=new Ae(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},ke.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return me}));var r=n(0),o=n.n(r),a=(n(11),n(218));function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function s(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function u(e){throw new Error("Unhandled case for value: '"+e+"'")}var c=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=n?n.split(r):[],a=e.split(r);t=a.shift();)-1===i(o,t)&&o.push(t);return this.getAttrs().class=o.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=n?n.split(r):[],a=e.split(r);o.length&&(t=a.shift());){var s=i(o,t);-1!==s&&o.splice(s,1)}return this.getAttrs().class=o.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}();var l=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new c({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),o=0,a=r.length;o<a;o++)n.push(t+"-"+r[o]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?function(e,t,n){var r,o;null==n?(n="&hellip;",o=3,r=8):(o=n.length,r=n.length);var a=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},i=function(e,t){var r=t/2,o=Math.ceil(r),a=-1*Math.floor(r),i="";return a<0&&(i=e.substr(a)),e.substr(0,o)+n+i};if(e.length<=t)return e;var s=t-o,u=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(u.query){var c=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(u.query=u.query.substr(0,c[1].length),e=a(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=a(u)),e.length<=t)return e;var l="";if(u.host&&(l+=u.host),l.length>=s)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,s+r):i(l,s).substr(0,s+r);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p){if((l+p).length>=s)return(l+p).length==t?(l+p).substr(0,t):(l+i(p,s-l.length)).substr(0,s+r);l+=p}if(u.fragment){var f="#"+u.fragment;if((l+f).length>=s)return(l+f).length==t?(l+f).substr(0,t):(l+i(f,s-l.length)).substr(0,s+r);l+=f}if(u.scheme&&u.host){var h=u.scheme+"://";if((l+h).length<s)return(h+l).substr(0,t)}if(l.length<=t)return l;var d="";return s>0&&(d=l.substr(-1*Math.floor(s/2))),(l.substr(0,Math.ceil(s/2))+n+d).substr(0,s+r)}(e,n):"middle"===r?function(e,t,n){if(e.length<=t)return e;var r,o;null==n?(n="&hellip;",r=8,o=3):(r=n.length,o=n.length);var a=t-o,i="";return a>0&&(i=e.substr(-1*Math.floor(a/2))),(e.substr(0,Math.ceil(a/2))+n+i).substr(0,a+r)}(e,n):function(e,t,n){return function(e,t,n){var r;return e.length>t&&(null==n?(n="&hellip;",r=3):r=n.length,e=e.substring(0,t-r)+n),e}(e,t,n)}(e,n)},e}(),p=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function h(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var d=function(){return(d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var v,m=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return h(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(p),g=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return h(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(p),y=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return h(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(p),b=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return h(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(p),_=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return h(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch(e){return t}},t}(p),w=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},E=/[A-Za-z]/,x=/[\d]/,C=/[\D]/,S=/\s/,A=/['"]/,k=/[\x00-\x1F\x7F]/,O=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,j=O+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,T=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,I=j+T,P=j+T,N="(?:["+T+"]{1,3}\\.){3}["+T+"]{1,3}",M="["+P+"](?:["+P+"\\-]{0,61}["+P+"])?",R=function(e){return"(?=("+M+"))\\"+e},D=function(e){return"(?:"+R(e)+"(?:\\."+R(e+1)+"){0,126}|"+N+")"},L=(new RegExp("["+P+".\\-]*["+P+"\\-]"),new RegExp("["+P+"]")),B=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,F=new RegExp("["+P+"!#$%&'*+/=?^_`{|}~-]"),U=new RegExp("^"+B.source+"$"),q=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=F,t.strictTldRegex=U,t}return h(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,o=[],a=e.length,i=new z,s={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,l=0,p=i;c<a;){var f=e.charAt(c);switch(l){case 0:h(f);break;case 1:v(e.charAt(c-1),f);break;case 2:g(f);break;case 3:y(f);break;case 4:b(f);break;case 5:_(f);break;case 6:w(f);break;case 7:E(f);break;default:u(l)}c++}return S(),o;function h(e){"m"===e?x(1):n.test(e)&&x()}function v(e,t){":"===e?n.test(t)?(l=2,p=new z(d({},p,{hasMailtoPrefix:!0}))):C():s[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:C())}function g(e){"."===e?l=3:"@"===e?l=4:n.test(e)||C()}function y(e){"."===e||"@"===e?C():n.test(e)?l=2:C()}function b(e){L.test(e)?l=5:C()}function _(e){"."===e?l=7:"-"===e?l=6:L.test(e)||S()}function w(e){"-"===e||"."===e?S():L.test(e)?l=5:S()}function E(e){"."===e||"-"===e?S():L.test(e)?(l=5,p=new z(d({},p,{hasDomainDot:!0}))):S()}function x(e){void 0===e&&(e=2),l=e,p=new z({idx:c})}function C(){l=0,p=i}function S(){if(p.hasDomainDot){var n=e.slice(p.idx,c);/[-.]$/.test(n)&&(n=n.slice(0,-1));var a=p.hasMailtoPrefix?n.slice("mailto:".length):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(a)&&o.push(new m({tagBuilder:t,matchedText:n,offset:p.idx,email:a}))}C()}},t}(w),z=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},V=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+O+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),W=(v=new RegExp("[/?#](?:["+P+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+P+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,D(2),")","|","(","(//)?",/(?:www\.)/.source,D(6),")","|","(","(//)?",D(10)+"\\.",B.source,"(?![-"+I+"])",")",")","(?::[0-9]+)?","(?:"+v.source+")?"].join(""),"gi")),H=new RegExp("["+P+"]"),J=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=W,n.wordCharRegExp=H,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return h(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,o=this.stripTrailingSlash,a=this.decodePercentEncoding,i=this.tagBuilder,s=[],u=function(){var n=t[0],u=t[1],l=t[4],p=t[5],f=t[9],h=t.index,d=p||f,v=e.charAt(h-1);if(!V.isValid(n,u))return"continue";if(h>0&&"@"===v)return"continue";if(h>0&&d&&c.wordCharRegExp.test(v))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),c.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var m=c.matchHasInvalidCharAfterTld(n,u);m>-1&&(n=n.substr(0,m))}var g=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(g){var y=n.indexOf(g);n=n.substr(y),u=u.substr(y),h+=y}var b=u?"scheme":l?"www":"tld",w=!!u;s.push(new _({tagBuilder:i,matchedText:n,offset:h,urlMatchType:b,url:n,protocolUrlMatch:w,protocolRelativeMatch:!!d,stripPrefix:r,stripTrailingSlash:o,decodePercentEncoding:a}))},c=this;null!==(t=n.exec(e));)u();return s},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,o=0,a=e.length-1;o<a;o++){var i=e.charAt(o);i===t?r++:i===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+P+"]*[-"+P+"]\\.[-"+P+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(w),$=new RegExp("#[_"+P+"]{1,139}(?![_"+P+"])","g"),K=new RegExp("[^"+P+"]"),Y=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=$,n.nonWordCharRegex=K,n.serviceName=t.serviceName,n}return h(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,o=this.serviceName,a=this.tagBuilder,i=[];null!==(t=n.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||r.test(u)){var c=t[0],l=t[0].slice(1);i.push(new g({tagBuilder:a,matchedText:c,offset:s,serviceName:o,hashtag:l}))}}return i},t}(w),G=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/g,Z=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=G,t}return h(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,o=[];null!==(t=n.exec(e));){var a=t[0],i=a.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),c=e.substr(t.index+a.length,1),l=!u.match(/\d/)&&!c.match(/\d/);this.testMatch(t[3])&&this.testMatch(a)&&l&&o.push(new b({tagBuilder:r,matchedText:a,offset:t.index,number:i,plusSign:s}))}return o},t.prototype.testMatch=function(e){return C.test(e)},t}(w),X=new RegExp("@[_"+P+"]{1,50}(?![_"+P+"])","g"),Q=new RegExp("@[_."+P+"]{1,30}(?![_"+P+"])","g"),ee=new RegExp("@[-_."+P+"]{1,50}(?![-_"+P+"])","g"),te=new RegExp("[^"+P+"]"),ne=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:X,instagram:Q,soundcloud:ee},n.nonWordCharRegex=te,n.serviceName=t.serviceName,n}return h(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],o=this.nonWordCharRegex,a=this.tagBuilder,i=[];if(!r)return i;for(;null!==(t=r.exec(e));){var s=t.index,u=e.charAt(s-1);if(0===s||o.test(u)){var c=t[0].replace(/\.+$/g,""),l=c.slice(1);i.push(new y({tagBuilder:a,matchedText:c,offset:s,serviceName:n,mention:l}))}}return i},t}(w);function re(e,t){for(var n,r=t.onOpenTag,o=t.onCloseTag,a=t.onText,i=t.onComment,s=t.onDoctype,c=new oe,l=0,p=e.length,f=0,h=0,v=c;l<p;){var m=e.charAt(l);switch(f){case 0:g(m);break;case 1:y(m);break;case 2:_(m);break;case 3:b(m);break;case 4:w(m);break;case 5:C(m);break;case 6:O(m);break;case 7:j(m);break;case 8:T(m);break;case 9:I(m);break;case 10:P(m);break;case 11:N(m);break;case 12:M(m);break;case 13:R(m);break;case 14:D(m);break;case 15:L(m);break;case 16:B(m);break;case 17:F(m);break;case 18:U(m);break;case 19:q(m);break;case 20:z(m);break;default:u(f)}l++}function g(e){"<"===e&&W()}function y(e){"!"===e?f=13:"/"===e?(f=2,v=new oe(d({},v,{isClosing:!0}))):"<"===e?W():E.test(e)?(f=3,v=new oe(d({},v,{isOpening:!0}))):(f=0,v=c)}function b(e){S.test(e)?(v=new oe(d({},v,{name:J()})),f=4):"<"===e?W():"/"===e?(v=new oe(d({},v,{name:J()})),f=12):">"===e?(v=new oe(d({},v,{name:J()})),H()):E.test(e)||x.test(e)||":"===e||V()}function _(e){">"===e?V():E.test(e)?f=3:V()}function w(e){S.test(e)||("/"===e?f=12:">"===e?H():"<"===e?W():"="===e||A.test(e)||k.test(e)?V():f=5)}function C(e){S.test(e)?f=6:"/"===e?f=12:"="===e?f=7:">"===e?H():"<"===e?W():A.test(e)&&V()}function O(e){S.test(e)||("/"===e?f=12:"="===e?f=7:">"===e?H():"<"===e?W():A.test(e)?V():f=5)}function j(e){S.test(e)||('"'===e?f=8:"'"===e?f=9:/[>=`]/.test(e)?V():"<"===e?W():f=10)}function T(e){'"'===e&&(f=11)}function I(e){"'"===e&&(f=11)}function P(e){S.test(e)?f=4:">"===e?H():"<"===e&&W()}function N(e){S.test(e)?f=4:"/"===e?f=12:">"===e?H():"<"===e?W():(f=4,l--)}function M(e){">"===e?(v=new oe(d({},v,{isClosing:!0})),H()):f=4}function R(t){"--"===e.substr(l,2)?(l+=2,v=new oe(d({},v,{type:"comment"})),f=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,v=new oe(d({},v,{type:"doctype"})),f=20):V()}function D(e){"-"===e?f=15:">"===e?V():f=16}function L(e){"-"===e?f=18:">"===e?V():f=16}function B(e){"-"===e&&(f=17)}function F(e){f="-"===e?18:16}function U(e){">"===e?H():"!"===e?f=19:"-"===e||(f=16)}function q(e){"-"===e?f=17:">"===e?H():f=16}function z(e){">"===e?H():"<"===e&&W()}function V(){f=0,v=c}function W(){f=1,v=new oe({idx:l})}function H(){var t=e.slice(h,v.idx);t&&a(t,h),"comment"===v.type?i(v.idx):"doctype"===v.type?s(v.idx):(v.isOpening&&r(v.name,v.idx),v.isClosing&&o(v.name,v.idx)),V(),h=l+1}function J(){var t=v.idx+(v.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),a(n,h),h=l+1)}var oe=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},ae=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&"twitter"!==n&&"instagram"!==n&&"soundcloud"!==n)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,o=[];return re(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var a=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r}(e,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),i=n;a.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,i);o.push.apply(o,r)}i+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var n=e[t],r=n.getOffset(),o=n.getMatchedText().length,a=r+o;if(t+1<e.length){if(e[t+1].getOffset()===r){var i=e[t+1].getMatchedText().length>o?t:t+1;e.splice(i,1);continue}e[t+1].getOffset()<a&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||s(e,(function(e){return"hashtag"===e.getType()})),this.email||s(e,(function(e){return"email"===e.getType()})),this.phone||s(e,(function(e){return"phone"===e.getType()})),this.mention||s(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||s(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||s(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||s(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],o=0,a=n.length;o<a;o++){for(var i=n[o].parseMatches(e),s=0,u=i.length;s<u;s++)i[s].setOffset(t+i[s].getOffset());r.push.apply(r,i)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),n=[],r=0,o=0,a=t.length;o<a;o++){var i=t[o];n.push(e.substring(r,i.getOffset())),n.push(this.createMatchReturnVal(i)),r=i.getOffset()+i.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof c?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new Y({tagBuilder:e,serviceName:this.hashtag}),new q({tagBuilder:e}),new Z({tagBuilder:e}),new ne({tagBuilder:e,serviceName:this.mention}),new J({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new l({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.1",e.AnchorTagBuilder=l,e.HtmlTag=c,e.matcher={Email:q,Hashtag:Y,Matcher:w,Mention:ne,Phone:Z,Url:J},e.match={Email:m,Hashtag:g,Match:p,Mention:y,Phone:b,Url:_},e}(),ie=/www|@|\:\/\//;function se(e){return/^<\/a\s*>/i.test(e)}function ue(){var e=[],t=new ae({stripPrefix:!1,url:!0,email:!0,replaceFn:function(t){switch(t.getType()){case"url":e.push({text:t.matchedText,url:t.getUrl()});break;case"email":e.push({text:t.matchedText,url:"mailto:"+t.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}function ce(e){var t,n,r,o,a,i,s,u,c,l,p,f,h,d,v=e.tokens,m=null;for(n=0,r=v.length;n<r;n++)if("inline"===v[n].type)for(p=0,t=(o=v[n].children).length-1;t>=0;t--)if("link_close"!==(a=o[t]).type){if("htmltag"===a.type&&(d=a.content,/^<a[>\s]/i.test(d)&&p>0&&p--,se(a.content)&&p++),!(p>0)&&"text"===a.type&&ie.test(a.content)){if(m||(f=(m=ue()).links,h=m.autolinker),i=a.content,f.length=0,h.link(i),!f.length)continue;for(s=[],l=a.level,u=0;u<f.length;u++)e.inline.validateLink(f[u].url)&&((c=i.indexOf(f[u].text))&&s.push({type:"text",content:i.slice(0,c),level:l}),s.push({type:"link_open",href:f[u].url,title:"",level:l++}),s.push({type:"text",content:f[u].text,level:l}),s.push({type:"link_close",level:--l}),i=i.slice(c+f[u].text.length));i.length&&s.push({type:"text",content:i,level:l}),v[n].children=o=[].concat(o.slice(0,t),s,o.slice(t+1))}}else for(t--;o[t].level!==a.level&&"link_open"!==o[t].type;)t--}function le(e){e.core.ruler.push("linkify",ce)}var pe=n(222),fe=n.n(pe),he=n(67),de=n.n(he);function ve(e){var t=e.source,n=e.className,r=void 0===n?"":n,i=e.getConfigs;if("string"!=typeof t)return null;var s=new a.a({html:!0,typographer:!0,breaks:!0,linkTarget:"_blank"}).use(le);s.core.ruler.disable(["replacements","smartquotes"]);var u=i().useUnsafeMarkdown,c=s.render(t),l=me(c,{useUnsafeMarkdown:u});return t&&c&&l?o.a.createElement("div",{className:de()(r,"markdown"),dangerouslySetInnerHTML:{__html:l}}):null}fe.a.addHook&&fe.a.addHook("beforeSanitizeElements",(function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e})),ve.defaultProps={getConfigs:function(){return{useUnsafeMarkdown:!1}}};t.a=ve;function me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.useUnsafeMarkdown,r=void 0!==n&&n,o=r,a=r?[]:["style","class"];return r&&!me.hasWarnedAboutDeprecation&&(console.warn("useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0."),me.hasWarnedAboutDeprecation=!0),fe.a.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style"],ALLOW_DATA_ATTR:o,FORBID_ATTR:a})}me.hasWarnedAboutDeprecation=!1},function(e,t,n){"use strict";n.d(t,"a",(function(){return R}));var r=n(6),o=n.n(r),a=n(29),i=n.n(a),s=n(12),u=n.n(s),c=n(2),l=n.n(c),p=n(7),f=n.n(p),h=n(5),d=n.n(h),v=n(10),m=n.n(v),g=n(8),y=n.n(g),b=n(9),_=n.n(b),w=n(3),E=n.n(w),x=n(0),C=n.n(x),S=n(1),A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var T=function(e){function t(){return O(this,t),j(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),k(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.state||{};return!(this.updateOnProps||Object.keys(A({},e,this.props))).every((function(n){return Object(S.is)(e[n],t.props[n])}))||!(this.updateOnStates||Object.keys(A({},n,r))).every((function(e){return Object(S.is)(n[e],r[e])}))}}]),t}(C.a.Component),I=n(28),P=n.n(I),N=n(11),M=n.n(N),R=function(e){y()(r,e);var t=_()(r);function r(){var e,n;f()(this,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=t.call.apply(t,l()(e=[this]).call(e,a)),E()(m()(n),"getModelName",(function(e){return-1!==u()(e).call(e,"#/definitions/")?e.replace(/^.*#\/definitions\//,""):-1!==u()(e).call(e,"#/components/schemas/")?e.replace(/^.*#\/components\/schemas\//,""):void 0})),E()(m()(n),"getRefSchema",(function(e){return n.props.specSelectors.findDefinition(e)})),n}return d()(r,[{key:"render",value:function(){var e=this.props,t=e.getComponent,r=e.getConfigs,o=e.specSelectors,a=e.schema,s=e.required,u=e.name,c=e.isRef,l=e.specPath,p=e.displayName,f=e.includeReadOnly,h=e.includeWriteOnly,d=t("ObjectModel"),v=t("ArrayModel"),m=t("PrimitiveModel"),g="object",y=a&&a.get("$$ref");if(!u&&y&&(u=this.getModelName(y)),!a&&y&&(a=this.getRefSchema(u)),!a)return C.a.createElement("span",{className:"model model-title"},C.a.createElement("span",{className:"model-title__text"},p||u),C.a.createElement("img",{src:n(503),height:"20px",width:"20px"}));var b=o.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!y,g=a&&a.get("type")||g){case"object":return C.a.createElement(d,i()({className:"object"},this.props,{specPath:l,getConfigs:r,schema:a,name:u,deprecated:b,isRef:c,includeReadOnly:f,includeWriteOnly:h}));case"array":return C.a.createElement(v,i()({className:"array"},this.props,{getConfigs:r,schema:a,name:u,deprecated:b,required:s,includeReadOnly:f,includeWriteOnly:h}));case"string":case"number":case"integer":case"boolean":default:return C.a.createElement(m,i()({},this.props,{getComponent:t,getConfigs:r,schema:a,name:u,deprecated:b,required:s}))}}}]),r}(T);E()(R,"propTypes",{schema:o()(P.a).isRequired,getComponent:M.a.func.isRequired,getConfigs:M.a.func.isRequired,specSelectors:M.a.object.isRequired,name:M.a.string,displayName:M.a.string,isRef:M.a.bool,required:M.a.bool,expandDepth:M.a.number,depth:M.a.number,specPath:P.a.list.isRequired,includeReadOnly:M.a.bool,includeWriteOnly:M.a.bool})},function(e,t,n){"use strict";var r=n(1034),o=n(1035),a=n(499);e.exports={formats:a,parse:o,stringify:r}},function(e,t,n){e.exports=function(){"use strict";var e=Object.freeze||function(e){return e},t=e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),n=e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),r=e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o=e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),a=e(["#text"]),i=Object.freeze||function(e){return e},s=i(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","minlength","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),l=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p=Object.hasOwnProperty,f=Object.setPrototypeOf,h=("undefined"!=typeof Reflect&&Reflect).apply;function d(e,t){f&&f(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=r.toLowerCase();o!==r&&(Object.isFrozen(t)||(t[n]=o),r=o)}e[r]=!0}return e}function v(e){var t={},n=void 0;for(n in e)h(p,e,[n])&&(t[n]=e[n]);return t}h||(h=function(e,t,n){return e.apply(t,n)});var m=Object.seal||function(e){return e},g=m(/\{\{[\s\S]*|[\s\S]*\}\}/gm),y=m(/<%[\s\S]*|[\s\S]*%>/gm),b=m(/^data-[\-\w.\u00B7-\uFFFF]/),_=m(/^aria-[\-\w]+$/),w=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),E=m(/^(?:\w+script|data):/i),x=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function S(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var A=("undefined"!=typeof Reflect&&Reflect).apply,k=Array.prototype.slice,O=Object.freeze,j=function(){return"undefined"==typeof window?null:window};A||(A=function(e,t,n){return e.apply(t,n)});var T=function(e,t){if("object"!==(void 0===e?"undefined":C(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j(),i=function(e){return I(e)};if(i.version="2.0.7",i.removed=[],!e||!e.document||9!==e.document.nodeType)return i.isSupported=!1,i;var p=e.document,f=!1,h=!1,m=e.document,P=e.DocumentFragment,N=e.HTMLTemplateElement,M=e.Node,R=e.NodeFilter,D=e.NamedNodeMap,L=void 0===D?e.NamedNodeMap||e.MozNamedAttrMap:D,B=e.Text,F=e.Comment,U=e.DOMParser,q=e.TrustedTypes;if("function"==typeof N){var z=m.createElement("template");z.content&&z.content.ownerDocument&&(m=z.content.ownerDocument)}var V=T(q,p),W=V?V.createHTML(""):"",H=m,J=H.implementation,$=H.createNodeIterator,K=H.getElementsByTagName,Y=H.createDocumentFragment,G=p.importNode,Z={};i.isSupported=J&&void 0!==J.createHTMLDocument&&9!==m.documentMode;var X=g,Q=y,ee=b,te=_,ne=E,re=x,oe=w,ae=null,ie=d({},[].concat(S(t),S(n),S(r),S(o),S(a))),se=null,ue=d({},[].concat(S(s),S(u),S(c),S(l))),ce=null,le=null,pe=!0,fe=!0,he=!1,de=!1,ve=!1,me=!1,ge=!1,ye=!1,be=!1,_e=!1,we=!1,Ee=!1,xe=!0,Ce=!0,Se=!1,Ae={},ke=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Oe=d({},["audio","video","img","source","image"]),je=null,Te=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ie=null,Pe=m.createElement("form"),Ne=function(e){Ie&&Ie===e||(e&&"object"===(void 0===e?"undefined":C(e))||(e={}),ae="ALLOWED_TAGS"in e?d({},e.ALLOWED_TAGS):ie,se="ALLOWED_ATTR"in e?d({},e.ALLOWED_ATTR):ue,je="ADD_URI_SAFE_ATTR"in e?d(v(Te),e.ADD_URI_SAFE_ATTR):Te,ce="FORBID_TAGS"in e?d({},e.FORBID_TAGS):{},le="FORBID_ATTR"in e?d({},e.FORBID_ATTR):{},Ae="USE_PROFILES"in e&&e.USE_PROFILES,pe=!1!==e.ALLOW_ARIA_ATTR,fe=!1!==e.ALLOW_DATA_ATTR,he=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.SAFE_FOR_JQUERY||!1,ve=e.SAFE_FOR_TEMPLATES||!1,me=e.WHOLE_DOCUMENT||!1,be=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,we=e.RETURN_DOM_IMPORT||!1,Ee=e.RETURN_TRUSTED_TYPE||!1,ye=e.FORCE_BODY||!1,xe=!1!==e.SANITIZE_DOM,Ce=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,oe=e.ALLOWED_URI_REGEXP||oe,ve&&(fe=!1),_e&&(be=!0),Ae&&(ae=d({},[].concat(S(a))),se=[],!0===Ae.html&&(d(ae,t),d(se,s)),!0===Ae.svg&&(d(ae,n),d(se,u),d(se,l)),!0===Ae.svgFilters&&(d(ae,r),d(se,u),d(se,l)),!0===Ae.mathMl&&(d(ae,o),d(se,c),d(se,l))),e.ADD_TAGS&&(ae===ie&&(ae=v(ae)),d(ae,e.ADD_TAGS)),e.ADD_ATTR&&(se===ue&&(se=v(se)),d(se,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&d(je,e.ADD_URI_SAFE_ATTR),Ce&&(ae["#text"]=!0),me&&d(ae,["html","head","body"]),ae.table&&(d(ae,["tbody"]),delete ce.tbody),O&&O(e),Ie=e)},Me=function(e){i.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=W}},Re=function(e,t){try{i.removed.push({attribute:t.getAttributeNode(e),from:t})}catch(e){i.removed.push({attribute:null,from:t})}t.removeAttribute(e)},De=function(e){var t=void 0,n=void 0;if(ye)e="<remove></remove>"+e;else{var r=e.match(/^[\s]+/);(n=r&&r[0])&&(e=e.slice(n.length))}if(f)try{t=(new U).parseFromString(e,"text/html")}catch(e){}if(h&&d(ce,["title"]),!t||!t.documentElement){var o=(t=J.createHTMLDocument("")).body;o.parentNode.removeChild(o.parentNode.firstElementChild),o.outerHTML=V?V.createHTML(e):e}return e&&n&&t.body.insertBefore(m.createTextNode(n),t.body.childNodes[0]||null),K.call(t,me?"html":"body")[0]};i.isSupported&&(function(){try{De('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img")&&(f=!0)}catch(e){}}(),function(){try{var e=De("<x/><title>&lt;/title&gt;&lt;img&gt;");/<\/title/.test(e.querySelector("title").innerHTML)&&(h=!0)}catch(e){}}());var Le=function(e){return $.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,(function(){return R.FILTER_ACCEPT}),!1)},Be=function(e){return!(e instanceof B||e instanceof F||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof L&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI)},Fe=function(e){return"object"===(void 0===M?"undefined":C(M))?e instanceof M:e&&"object"===(void 0===e?"undefined":C(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ue=function(e,t,n){Z[e]&&Z[e].forEach((function(e){e.call(i,t,n,Ie)}))},qe=function(e){var t=void 0;if(Ue("beforeSanitizeElements",e,null),Be(e))return Me(e),!0;var n=e.nodeName.toLowerCase();if(Ue("uponSanitizeElement",e,{tagName:n,allowedTags:ae}),("svg"===n||"math"===n)&&0!==e.querySelectorAll("p, br").length)return Me(e),!0;if(!ae[n]||ce[n]){if(Ce&&!ke[n]&&"function"==typeof e.insertAdjacentHTML)try{var r=e.innerHTML;e.insertAdjacentHTML("AfterEnd",V?V.createHTML(r):r)}catch(e){}return Me(e),!0}return"noscript"===n&&/<\/noscript/i.test(e.innerHTML)||"noembed"===n&&/<\/noembed/i.test(e.innerHTML)?(Me(e),!0):(!de||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(i.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"&lt;"):e.innerHTML=e.textContent.replace(/</g,"&lt;")),ve&&3===e.nodeType&&(t=(t=(t=e.textContent).replace(X," ")).replace(Q," "),e.textContent!==t&&(i.removed.push({element:e.cloneNode()}),e.textContent=t)),Ue("afterSanitizeElements",e,null),!1)},ze=function(e,t,n){if(xe&&("id"===t||"name"===t)&&(n in m||n in Pe))return!1;if(fe&&ee.test(t));else if(pe&&te.test(t));else{if(!se[t]||le[t])return!1;if(je[t]);else if(oe.test(n.replace(re,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==n.indexOf("data:")||!Oe[e])if(he&&!ne.test(n.replace(re,"")));else if(n)return!1}return!0},Ve=function(e){var t=void 0,n=void 0,r=void 0,o=void 0,a=void 0;Ue("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};for(a=s.length;a--;){var c=t=s[a],l=c.name,p=c.namespaceURI;if(n=t.value.trim(),r=l.toLowerCase(),u.attrName=r,u.attrValue=n,u.keepAttr=!0,Ue("uponSanitizeAttribute",e,u),n=u.attrValue,"name"===r&&"IMG"===e.nodeName&&s.id)o=s.id,s=A(k,s,[]),Re("id",e),Re(l,e),s.indexOf(o)>a&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===n&&u.keepAttr&&(se[r]||!le[r]))continue;"id"===l&&e.setAttribute(l,""),Re(l,e)}if(u.keepAttr)if(/svg|math/i.test(e.namespaceURI)&&new RegExp("</("+Object.keys(ke).join("|")+")","i").test(n))Re(l,e);else{ve&&(n=(n=n.replace(X," ")).replace(Q," "));var f=e.nodeName.toLowerCase();if(ze(f,r,n))try{p?e.setAttributeNS(p,l,n):e.setAttribute(l,n),i.removed.pop()}catch(e){}}}Ue("afterSanitizeAttributes",e,null)}},We=function e(t){var n=void 0,r=Le(t);for(Ue("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ue("uponSanitizeShadowNode",n,null),qe(n)||(n.content instanceof P&&e(n.content),Ve(n));Ue("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t,n){var r=void 0,o=void 0,a=void 0,s=void 0,u=void 0;if(t||(t="\x3c!--\x3e"),"string"!=typeof t&&!Fe(t)){if("function"!=typeof t.toString)throw new TypeError("toString is not a function");if("string"!=typeof(t=t.toString()))throw new TypeError("dirty is not a string, aborting")}if(!i.isSupported){if("object"===C(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(Fe(t))return e.toStaticHTML(t.outerHTML)}return t}if(ge||Ne(n),i.removed=[],Se);else if(t instanceof M)1===(o=(r=De("\x3c!--\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!be&&!ve&&!me&&Ee&&-1===t.indexOf("<"))return V?V.createHTML(t):t;if(!(r=De(t)))return be?null:W}r&&ye&&Me(r.firstChild);for(var c=Le(Se?t:r);a=c.nextNode();)3===a.nodeType&&a===s||qe(a)||(a.content instanceof P&&We(a.content),Ve(a),s=a);if(s=null,Se)return t;if(be){if(_e)for(u=Y.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return we&&(u=G.call(p,u,!0)),u}var l=me?r.outerHTML:r.innerHTML;return ve&&(l=(l=l.replace(X," ")).replace(Q," ")),V&&Ee?V.createHTML(l):l},i.setConfig=function(e){Ne(e),ge=!0},i.clearConfig=function(){Ie=null,ge=!1},i.isValidAttribute=function(e,t,n){Ie||Ne({});var r=e.toLowerCase(),o=t.toLowerCase();return ze(r,o,n)},i.addHook=function(e,t){"function"==typeof t&&(Z[e]=Z[e]||[],Z[e].push(t))},i.removeHook=function(e){Z[e]&&Z[e].pop()},i.removeHooks=function(e){Z[e]&&(Z[e]=[])},i.removeAllHooks=function(){Z={}},i}return I()}()},function(e,t,n){var r=n(41),o=n(44),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},function(e,t,n){var r=n(69),o=n(79),a=n(225),i=function(e){return function(t,n,i){var s,u=r(t),c=o(u.length),l=a(i,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r=n(149),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(39);t.f=r},function(e,t,n){var r=n(95),o=n(360);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(36);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(e,t,n){"use strict";var r=n(24),o=n(365),a=n(151),i=n(233),s=n(87),u=n(70),c=n(110),l=n(39),p=n(95),f=n(109),h=n(366),d=h.IteratorPrototype,v=h.BUGGY_SAFARI_ITERATORS,m=l("iterator"),g="keys",y="values",b="entries",_=function(){return this};e.exports=function(e,t,n,l,h,w,E){o(n,t,l);var x,C,S,A=function(e){if(e===h&&I)return I;if(!v&&e in j)return j[e];switch(e){case g:case y:case b:return function(){return new n(this,e)}}return function(){return new n(this)}},k=t+" Iterator",O=!1,j=e.prototype,T=j[m]||j["@@iterator"]||h&&j[h],I=!v&&T||A(h),P="Array"==t&&j.entries||T;if(P&&(x=a(P.call(new e)),d!==Object.prototype&&x.next&&(p||a(x)===d||(i?i(x,d):"function"!=typeof x[m]&&u(x,m,_)),s(x,k,!0,!0),p&&(f[k]=_))),h==y&&T&&T.name!==y&&(O=!0,I=function(){return T.call(this)}),p&&!E||j[m]===I||u(j,m,I),f[t]=I,h)if(C={values:A(y),keys:w?I:A(g),entries:A(b)},E)for(S in C)(v||O||!(S in j))&&c(j,S,C[S]);else r({target:t,proto:!0,forced:v||O},C);return C}},function(e,t,n){var r=n(48),o=n(63),a=n(54),i=n(148);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),s=r.length,u=0;s>u;)o.f(e,n=r[u++],t[n]);return e}},function(e,t,n){var r={};r[n(39)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r=n(54),o=n(551);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),o(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(44),o=n(152),a=n(39)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[a])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t,n){var r,o,a=n(41),i=n(237),s=a.process,u=s&&s.versions,c=u&&u.v8;c?o=(r=c.split("."))[0]+r[1]:i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t,n){var r=n(71);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(358),o=n(226).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){e.exports=n(595)},function(e,t,n){e.exports=n(645)},function(e,t,n){var r=n(694),o=n(710),a=n(712),i=n(713),s=n(714);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(113)(n(74),"Map");e.exports=r},function(e,t,n){var r=n(183),o=n(718),a=n(719),i=n(720),s=n(721),u=n(722);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=s,c.prototype.set=u,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(732),o=n(418),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return a.call(e,t)})))}:o;e.exports=s},function(e,t,n){var r=n(734),o=n(90),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(74),o=n(735),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;e.exports=u}).call(this,n(187)(e))},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(406),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s}).call(this,n(187)(e))},function(e,t,n){var r=n(55),o=n(181),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(i.test(e)||!a.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function o(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arguments))}var a;"error"!==t&&(a=function(n){e.removeListener(t,o),r(n)},e.once("error",a)),e.once(t,o)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function p(e,t,n,r){var o,a,i,s;if(c(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),i=a[t]),void 0===i)i=a[t]=n,++e._eventsCount;else if("function"==typeof i?i=a[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=l(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var c=u.length,l=m(u,c);for(n=0;n<c;++n)a(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return p(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return p(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,a,i;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){i=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(o=a[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(429)).Stream=t,t.Readable=t,t.Writable=n(256),t.Duplex=n(115),t.Transform=n(434),t.PassThrough=n(767)},function(e,t,n){"use strict";(function(t,r,o){var a=n(192);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;y.WritableState=g;var c=n(157);c.inherits=n(65);var l={deprecate:n(766)},p=n(430),f=n(66).Buffer,h=o.Uint8Array||function(){};var d,v=n(431);function m(){}function g(e,t){s=s||n(115),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var p=!1===e.decodeStrings;this.decodeStrings=!p,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(a.nextTick(o,r),a.nextTick(C,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),C(e,t))}(e,n,r,t,o);else{var i=E(n);i||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?u(_,e,n,i,o):_(e,n,i,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function y(e){if(s=s||n(115),!(d.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),p.call(this)}function b(e,t,n,r,o,a,i){t.writelen=r,t.writecb=i,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),C(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,p=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,p),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,p),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):d=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,o=this._writableState,i=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=m),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,i=!1;return null===n?i=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i&&(e.emit("error",i),a.nextTick(r,i),o=!1),o}(this,o,e,n))&&(o.pendingcb++,i=function(e,t,n,r,o,a){if(!n){var i=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==i&&(n=!0,o="buffer",r=i)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,a);return u}(this,o,s,e,t,n)),i},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=v.destroy,y.prototype._undestroy=v.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(91),n(432).setImmediate,n(53))},function(e,t,n){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(792)()?Array.from:n(793)},function(e,t,n){"use strict";var r=n(806),o=n(117),a=n(132),i=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(e){var t,n,l,p;if(!r(e))return i.apply(this,arguments);for(n=o(a(this).length),l=arguments[1],t=l=isNaN(l)?0:l>=0?c(l):o(this.length)-c(u(l));t<n;++t)if(s.call(this,t)&&(p=this[t],r(p)))return t;return-1}},function(e,t,n){"use strict";(function(t,n){var r,o;r=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},o=function(e){var t,n,o=document.createTextNode(""),a=0;return new e((function(){var e;if(t)n&&(t=n.concat(t));else{if(!n)return;t=n}if(n=t,t=null,"function"==typeof n)return e=n,n=null,void e();for(o.data=a=++a%2;n;)e=n.shift(),n.length||(n=null),e()})).observe(o,{characterData:!0}),function(e){r(e),t?"function"==typeof t?t=[t,e]:t.push(e):(t=e,o.data=a=++a%2)}},e.exports=function(){if("object"==typeof t&&t&&"function"==typeof t.nextTick)return t.nextTick;if("object"==typeof document&&document){if("function"==typeof MutationObserver)return o(MutationObserver);if("function"==typeof WebKitMutationObserver)return o(WebKitMutationObserver)}return"function"==typeof n?function(e){n(r(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(r(e),0)}:null}()}).call(this,n(91),n(432).setImmediate)},function(e,t,n){"use strict";var r=n(136);e.exports=new r({explicit:[n(874),n(875),n(876)]})},function(e,t,n){"use strict";var r=n(31),o=(n(25),null),a={};function i(){if(o)for(var e in a){var t=a[e],n=o.indexOf(e);if(n>-1||r("96",e),!c.plugins[n]){t.extractEvents||r("97",e),c.plugins[n]=t;var i=t.eventTypes;for(var u in i)s(i[u],t,u)||r("98",u,e)}}}function s(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n),c.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var a in o){if(o.hasOwnProperty(a))u(o[a],t,n)}return!0}return!!e.registrationName&&(u(e.registrationName,t,n),!0)}function u(e,t,n){c.registrationNameModules[e]&&r("100",e),c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){o&&r("101"),o=Array.prototype.slice.call(e),i()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];a.hasOwnProperty(n)&&a[n]===o||(a[n]&&r("102",n),a[n]=o,t=!0)}t&&i()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){for(var e in o=null,a)a.hasOwnProperty(e)&&delete a[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=c},function(e,t,n){"use strict";var r,o,a=n(31),i=n(264);n(25),n(33);function s(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getNodeFromInstance(r),t?i.invokeGuardedCallbackWithCatch(o,n,e):i.invokeGuardedCallback(o,n,e),e.currentTarget=null}var u={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&a("103"),e.currentTarget=t?u.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)s(e,t,n[o],r[o]);else n&&s(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null},executeDispatchesInOrderStopAtTrue:function(e){var t=function(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}(e);return e._dispatchInstances=null,e._dispatchListeners=null,t},hasDispatches:function(e){return!!e._dispatchListeners},getInstanceFromNode:function(e){return r.getInstanceFromNode(e)},getNodeFromInstance:function(e){return r.getNodeFromInstance(e)},isAncestor:function(e,t){return o.isAncestor(e,t)},getLowestCommonAncestor:function(e,t){return o.getLowestCommonAncestor(e,t)},getParentInstance:function(e){return o.getParentInstance(e)},traverseTwoPhase:function(e,t,n){return o.traverseTwoPhase(e,t,n)},traverseEnterLeave:function(e,t,n,r,a){return o.traverseEnterLeave(e,t,n,r,a)},injection:{injectComponentTree:function(e){r=e},injectTreeTraversal:function(e){o=e}}};e.exports=u},function(e,t,n){"use strict";var r=null;function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}var a={invokeGuardedCallback:o,invokeGuardedCallbackWithCatch:o,rethrowCaughtError:function(){if(r){var e=r;throw r=null,e}}};e.exports=a},function(e,t,n){"use strict";e.exports=function(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}},function(e,t,n){"use strict";var r,o=n(57);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,a=n in document;if(!a){var i=document.createElement("div");i.setAttribute(n,"return;"),a="function"==typeof i[n]}return!a&&r&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(139),o=n(927),a=(n(42),n(75),n(270)),i=n(200),s=n(474);function u(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var c=a((function(e,t,n){e.insertBefore(t,n)}));function l(e,t,n){r.insertTreeBefore(e,t,n)}function p(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var a=o.nextSibling;if(c(e,o,r),o===n)break;o=a}}(e,t[0],t[1],n):c(e,t,n)}function f(e,t){if(Array.isArray(t)){var n=t[1];h(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function h(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var d={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&c(r,document.createTextNode(n),o):n?(s(o,n),h(r,o,t)):h(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":l(e,r.content,u(e,r.afterNode));break;case"MOVE_EXISTING":p(e,r.fromNode,u(e,r.afterNode));break;case"SET_MARKUP":i(e,r.content);break;case"TEXT_CONTENT":s(e,r.content);break;case"REMOVE_NODE":f(e,r.fromNode)}}}};e.exports=d},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction((function(){return e(t,n,r,o)}))}:e}},function(e,t,n){"use strict";var r=n(31),o=n(945),a=n(383)(n(126).isValidElement),i=(n(25),n(33),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function s(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function u(e){s(e),(null!=e.value||null!=e.onChange)&&r("88")}function c(e){s(e),(null!=e.checked||null!=e.onChange)&&r("89")}var l={value:function(e,t,n){return!e[t]||i[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:a.func},p={};function f(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var h={checkPropTypes:function(e,t,n){for(var r in l){if(l.hasOwnProperty(r))var a=l[r](t,r,e,"prop",null,o);if(a instanceof Error&&!(a.message in p)){p[a.message]=!0;f(n)}}},getValue:function(e){return e.valueLink?(u(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(c(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(u(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(c(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=h},function(e,t,n){"use strict";var r=n(31),o=(n(25),!1),a={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),a.replaceNodeWithMarkup=e.replaceNodeWithMarkup,a.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=a},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var i=0;i<n.length;i++)if(!r.call(t,n[i])||!o(e[n[i]],t[n[i]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,a=typeof t;return"string"===o||"number"===o?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,(function(e){return t[e]}))}};e.exports=r},function(e,t,n){"use strict";var r=n(31),o=(n(89),n(165)),a=(n(75),n(82));n(25),n(33);function i(e){a.enqueueUpdate(e)}function s(e,t){var n=o.get(e);return n||null}var u={isMounted:function(e){var t=o.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){u.validateCallback(t,n);var r=s(e);if(!r)return null;r._pendingCallbacks?r._pendingCallbacks.push(t):r._pendingCallbacks=[t],i(r)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],i(e)},enqueueForceUpdate:function(e){var t=s(e);t&&(t._pendingForceUpdate=!0,i(t))},enqueueReplaceState:function(e,t,n){var r=s(e);r&&(r._pendingStateQueue=[t],r._pendingReplaceState=!0,null!=n&&(u.validateCallback(n,"replaceState"),r._pendingCallbacks?r._pendingCallbacks.push(n):r._pendingCallbacks=[n]),i(r))},enqueueSetState:function(e,t){var n=s(e);n&&((n._pendingStateQueue||(n._pendingStateQueue=[])).push(t),i(n))},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,i(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&r("122",t,function(e){var t=typeof e;if("object"!==t)return t;var n=e.constructor&&e.constructor.name||t,r=Object.keys(e);return r.length>0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}(e))}};e.exports=u},function(e,t,n){"use strict";n(40);var r=n(81),o=(n(33),r);e.exports=o},function(e,t,n){"use strict";e.exports=function(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}},function(e,t,n){var r=n(421)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(415);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var a=t[r],i=a.obj[a.prop],s=Object.keys(i),u=0;u<s.length;++u){var c=s[u],l=i[c];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(t.push({obj:i,prop:c}),n.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],a=0;a<n.length;++a)void 0!==n[a]&&r.push(n[a]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var o="",i=0;i<r.length;++i){var s=r.charCodeAt(i);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?o+=r.charAt(i):s<128?o+=a[s]:s<2048?o+=a[192|s>>6]+a[128|63&s]:s<55296||s>=57344?o+=a[224|s>>12]+a[128|s>>6&63]+a[128|63&s]:(i+=1,s=65536+((1023&s)<<10|1023&r.charCodeAt(i)),o+=a[240|s>>18]+a[128|s>>12&63]+a[128|s>>6&63]+a[128|63&s])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,a){if(!n)return t;if("object"!=typeof n){if(o(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(a&&(a.plainObjects||a.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return o(t)&&!o(n)&&(s=i(t,a)),o(t)&&o(n)?(n.forEach((function(n,o){if(r.call(t,o)){var i=t[o];i&&"object"==typeof i&&n&&"object"==typeof n?t[o]=e(i,n,a):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var i=n[o];return r.call(t,o)?t[o]=e(t[o],i,a):t[o]=i,t}),s)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1048),o=n(203);t.JsonPatchError=o.PatchError,t.deepClone=o._deepClone;var a={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=s(n,this.path);r&&(r=o._deepClone(r));var a=u(n,{op:"remove",path:this.from}).removed;return u(n,{op:"add",path:this.path,value:a}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=s(n,this.from);return u(n,{op:"add",path:this.path,value:o._deepClone(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:r(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},i={add:function(e,t,n){return o.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:a.move,copy:a.copy,test:a.test,_get:a._get};function s(e,t){if(""==t)return e;var n={op:"_get",path:t};return u(e,n),n.value}function u(e,n,u,c,l,f){if(void 0===u&&(u=!1),void 0===c&&(c=!0),void 0===l&&(l=!0),void 0===f&&(f=0),u&&("function"==typeof u?u(n,0,e,n.path):p(n,0)),""===n.path){var h={newDocument:e};if("add"===n.op)return h.newDocument=n.value,h;if("replace"===n.op)return h.newDocument=n.value,h.removed=e,h;if("move"===n.op||"copy"===n.op)return h.newDocument=s(e,n.from),"move"===n.op&&(h.removed=e),h;if("test"===n.op){if(h.test=r(e,n.value),!1===h.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",f,n,e);return h.newDocument=e,h}if("remove"===n.op)return h.removed=e,h.newDocument=null,h;if("_get"===n.op)return n.value=e,h;if(u)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",f,n,e);return h}c||(e=o._deepClone(e));var d=(n.path||"").split("/"),v=e,m=1,g=d.length,y=void 0,b=void 0,_=void 0;for(_="function"==typeof u?u:p;;){if(b=d[m],l&&"__proto__"==b)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(u&&void 0===y&&(void 0===v[b]?y=d.slice(0,m).join("/"):m==g-1&&(y=n.path),void 0!==y&&_(n,0,e,y)),m++,Array.isArray(v)){if("-"===b)b=v.length;else{if(u&&!o.isInteger(b))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",f,n,e);o.isInteger(b)&&(b=~~b)}if(m>=g){if(u&&"add"===n.op&&b>v.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",f,n,e);if(!1===(h=i[n.op].call(n,v,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",f,n,e);return h}}else if(b&&-1!=b.indexOf("~")&&(b=o.unescapePathComponent(b)),m>=g){if(!1===(h=a[n.op].call(n,v,b,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",f,n,e);return h}v=v[b]}}function c(e,n,r,a,i){if(void 0===a&&(a=!0),void 0===i&&(i=!0),r&&!Array.isArray(n))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(e=o._deepClone(e));for(var s=new Array(n.length),c=0,l=n.length;c<l;c++)s[c]=u(e,n[c],r,!0,i,c),e=s[c].newDocument;return s.newDocument=e,s}function l(e,n,r){var o=u(e,n);if(!1===o.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",r,n,e);return o.newDocument}function p(e,n,r,i){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",n,e,r);if(!a[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",n,e,r);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",n,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&o.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,e,r);if(r)if("add"==e.op){var s=e.path.split("/").length,u=i.split("/").length;if(s!==u+1&&s!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,e,r)}else if("move"===e.op||"copy"===e.op){var c=f([{op:"_get",path:e.from,value:void 0}],r);if(c&&"OPERATION_PATH_UNRESOLVABLE"===c.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,e,r)}}function f(e,n,r){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)c(o._deepClone(n),o._deepClone(e),r||!0);else{r=r||p;for(var a=0;a<e.length;a++)r(e[a],a,n,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}t.getValueByPointer=s,t.applyOperation=u,t.applyPatch=c,t.applyReducer=l,t.validator=p,t.validate=f,t.default={JsonPatchError:t.JsonPatchError,deepClone:t.deepClone,getValueByPointer:s,applyOperation:u,applyPatch:c,applyReducer:l,validator:p,validate:f}},function(e,t,n){var r=n(681)("toUpperCase");e.exports=r},function(e,t,n){var r=n(242);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){"use strict";n.r(t);var r=n(286),o=n(61),a=n(289);t.default=function(e){return{statePlugins:{err:{reducers:Object(r.default)(e),actions:o,selectors:a}}}}},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n.n(r),a=n(100),i=n.n(a),s=n(13),u=n.n(s),c=n(2),l=n.n(c),p=n(6),f=n.n(p),h=n(21),d=n.n(h),v=n(61),m=n(1),g=n(124),y={line:0,level:"error",message:"Unknown error"};t.default=function(){var e;return e={},o()(e,v.NEW_THROWN_ERR,(function(e,t){var n=t.payload,r=d()(y,n,{type:"thrown"});return e.update("errors",(function(e){return(e||Object(m.List)()).push(Object(m.fromJS)(r))})).update("errors",(function(e){return Object(g.default)(e)}))})),o()(e,v.NEW_THROWN_ERR_BATCH,(function(e,t){var n=t.payload;return n=f()(n).call(n,(function(e){return Object(m.fromJS)(d()(y,e,{type:"thrown"}))})),e.update("errors",(function(e){var t;return l()(t=e||Object(m.List)()).call(t,Object(m.fromJS)(n))})).update("errors",(function(e){return Object(g.default)(e)}))})),o()(e,v.NEW_SPEC_ERR,(function(e,t){var n=t.payload,r=Object(m.fromJS)(n);return r=r.set("type","spec"),e.update("errors",(function(e){return(e||Object(m.List)()).push(Object(m.fromJS)(r)).sortBy((function(e){return e.get("line")}))})).update("errors",(function(e){return Object(g.default)(e)}))})),o()(e,v.NEW_SPEC_ERR_BATCH,(function(e,t){var n=t.payload;return n=f()(n).call(n,(function(e){return Object(m.fromJS)(d()(y,e,{type:"spec"}))})),e.update("errors",(function(e){var t;return l()(t=e||Object(m.List)()).call(t,Object(m.fromJS)(n))})).update("errors",(function(e){return Object(g.default)(e)}))})),o()(e,v.NEW_AUTH_ERR,(function(e,t){var n=t.payload,r=Object(m.fromJS)(d()({},n));return r=r.set("type","auth"),e.update("errors",(function(e){return(e||Object(m.List)()).push(Object(m.fromJS)(r))})).update("errors",(function(e){return Object(g.default)(e)}))})),o()(e,v.CLEAR,(function(e,t){var n,r=t.payload;if(!r||!e.get("errors"))return e;var o=u()(n=e.get("errors")).call(n,(function(e){var t;return i()(t=e.keySeq()).call(t,(function(t){var n=e.get(t),o=r[t];return!o||n!==o}))}));return e.merge({errors:o})})),o()(e,v.CLEAR_BY,(function(e,t){var n,r=t.payload;if(!r||"function"!=typeof r)return e;var o=u()(n=e.get("errors")).call(n,(function(e){return r(e)}));return e.merge({errors:o})})),e}},function(e,t,n){"use strict";n.r(t),n.d(t,"transform",(function(){return p}));var r=n(22),o=n.n(r),a=n(23),i=n.n(a),s=n(12),u=n.n(s),c=n(6),l=n.n(c);function p(e){return l()(e).call(e,(function(e){var t,n="is not of a type(s)",r=u()(t=e.get("message")).call(t,n);if(r>-1){var a,s,c=i()(a=e.get("message")).call(a,r+n.length).split(",");return e.set("message",i()(s=e.get("message")).call(s,0,r)+function(e){return o()(e).call(e,(function(e,t,n,r){return n===r.length-1&&r.length>1?e+"or "+t:r[n+1]&&r.length>2?e+t+", ":r[n+1]?e+t+" ":e+t}),"should be a")}(c))}return e}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"transform",(function(){return r}));n(12),n(6),n(46),n(1);function r(e,t){t.jsSpec;return e}},function(e,t,n){"use strict";n.r(t),n.d(t,"allErrors",(function(){return a})),n.d(t,"lastError",(function(){return i}));var r=n(1),o=n(19),a=Object(o.a)((function(e){return e}),(function(e){return e.get("errors",Object(r.List)())})),i=Object(o.a)(a,(function(e){return e.last()}))},function(e,t,n){"use strict";n.r(t);var r=n(291),o=n(102),a=n(292);t.default=function(){return{statePlugins:{layout:{reducers:r.default,actions:o,selectors:a}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(3),a=n.n(o),i=n(2),s=n.n(i),u=n(1),c=n(102);t.default=(r={},a()(r,c.UPDATE_LAYOUT,(function(e,t){return e.set("layout",t.payload)})),a()(r,c.UPDATE_FILTER,(function(e,t){return e.set("filter",t.payload)})),a()(r,c.SHOW,(function(e,t){var n=t.payload.shown,r=Object(u.fromJS)(t.payload.thing);return e.update("shown",Object(u.fromJS)({}),(function(e){return e.set(r,n)}))})),a()(r,c.UPDATE_MODE,(function(e,t){var n,r=t.payload.thing,o=t.payload.mode;return e.setIn(s()(n=["modes"]).call(n,r),(o||"")+"")})),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"current",(function(){return l})),n.d(t,"currentFilter",(function(){return p})),n.d(t,"isShown",(function(){return f})),n.d(t,"whatMode",(function(){return h})),n.d(t,"showSummary",(function(){return d}));var r=n(2),o=n.n(r),a=n(18),i=n.n(a),s=n(19),u=n(4),c=n(1),l=function(e){return e.get("layout")},p=function(e){return e.get("filter")},f=function(e,t,n){return t=Object(u.w)(t),e.get("shown",Object(c.fromJS)({})).get(Object(c.fromJS)(t),n)},h=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=Object(u.w)(t),e.getIn(o()(n=["modes"]).call(n,i()(t)),r)},d=Object(s.a)((function(e){return e}),(function(e){return!f(e,"editor")}))},function(e,t,n){"use strict";n.r(t);var r=n(294),o=n(47),a=n(94),i=n(295);t.default=function(){return{statePlugins:{spec:{wrapActions:i,reducers:r.default,actions:o,selectors:a}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(3),a=n.n(o),i=n(21),s=n.n(i),u=n(6),c=n.n(u),l=n(22),p=n.n(l),f=n(2),h=n.n(f),d=n(18),v=n.n(d),m=n(1),g=n(4),y=n(27),b=n(94),_=n(47);t.default=(r={},a()(r,_.UPDATE_SPEC,(function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e})),a()(r,_.UPDATE_URL,(function(e,t){return e.set("url",t.payload+"")})),a()(r,_.UPDATE_JSON,(function(e,t){return e.set("json",Object(g.i)(t.payload))})),a()(r,_.UPDATE_RESOLVED,(function(e,t){return e.setIn(["resolved"],Object(g.i)(t.payload))})),a()(r,_.UPDATE_RESOLVED_SUBTREE,(function(e,t){var n,r=t.payload,o=r.value,a=r.path;return e.setIn(h()(n=["resolvedSubtrees"]).call(n,v()(a)),Object(g.i)(o))})),a()(r,_.UPDATE_PARAM,(function(e,t){var n,r,o=t.payload,a=o.path,i=o.paramName,s=o.paramIn,u=o.param,c=o.value,l=o.isXml,p=u?Object(g.B)(u):h()(n="".concat(s,".")).call(n,i),f=l?"value_xml":"value";return e.setIn(h()(r=["meta","paths"]).call(r,v()(a),["parameters",p,f]),c)})),a()(r,_.UPDATE_EMPTY_PARAM_INCLUSION,(function(e,t){var n,r,o=t.payload,a=o.pathMethod,i=o.paramName,s=o.paramIn,u=o.includeEmptyValue;if(!i||!s)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;var c=h()(n="".concat(s,".")).call(n,i);return e.setIn(h()(r=["meta","paths"]).call(r,v()(a),["parameter_inclusions",c]),u)})),a()(r,_.VALIDATE_PARAMS,(function(e,t){var n,r,o=t.payload,a=o.pathMethod,i=o.isOAS3,s=Object(b.specJsonWithResolvedSubtrees)(e).getIn(h()(n=["paths"]).call(n,v()(a))),u=Object(b.parameterValues)(e,a).toJS();return e.updateIn(h()(r=["meta","paths"]).call(r,v()(a),["parameters"]),Object(m.fromJS)({}),(function(t){var n;return p()(n=s.get("parameters",Object(m.List)())).call(n,(function(t,n){var r=Object(g.C)(n,u),o=Object(b.parameterInclusionSettingFor)(e,a,n.get("name"),n.get("in")),s=Object(g.L)(n,r,{bypassRequiredCheck:o,isOAS3:i});return t.setIn([Object(g.B)(n),"errors"],Object(m.fromJS)(s))}),t)}))})),a()(r,_.CLEAR_VALIDATE_PARAMS,(function(e,t){var n,r=t.payload.pathMethod;return e.updateIn(h()(n=["meta","paths"]).call(n,v()(r),["parameters"]),Object(m.fromJS)([]),(function(e){return c()(e).call(e,(function(e){return e.set("errors",Object(m.fromJS)([]))}))}))})),a()(r,_.SET_RESPONSE,(function(e,t){var n,r=t.payload,o=r.res,a=r.path,i=r.method;(n=o.error?s()({error:!0,name:o.err.name,message:o.err.message,statusCode:o.err.statusCode},o.err.response):o).headers=n.headers||{};var u=e.setIn(["responses",a,i],Object(g.i)(n));return y.a.Blob&&o.data instanceof y.a.Blob&&(u=u.setIn(["responses",a,i,"text"],o.data)),u})),a()(r,_.SET_REQUEST,(function(e,t){var n=t.payload,r=n.req,o=n.path,a=n.method;return e.setIn(["requests",o,a],Object(g.i)(r))})),a()(r,_.SET_MUTATED_REQUEST,(function(e,t){var n=t.payload,r=n.req,o=n.path,a=n.method;return e.setIn(["mutatedRequests",o,a],Object(g.i)(r))})),a()(r,_.UPDATE_OPERATION_META_VALUE,(function(e,t){var n,r,o,a,i,s,u=t.payload,c=u.path,l=u.value,p=u.key,f=h()(n=["paths"]).call(n,v()(c)),d=h()(r=["meta","paths"]).call(r,v()(c));return e.getIn(h()(o=["json"]).call(o,v()(f)))||e.getIn(h()(a=["resolved"]).call(a,v()(f)))||e.getIn(h()(i=["resolvedSubtrees"]).call(i,v()(f)))?e.setIn(h()(s=[]).call(s,v()(d),[p]),Object(m.fromJS)(l)):e})),a()(r,_.CLEAR_RESPONSE,(function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["responses",r,o])})),a()(r,_.CLEAR_REQUEST,(function(e,t){var n=t.payload,r=n.path,o=n.method;return e.deleteIn(["requests",r,o])})),a()(r,_.SET_SCHEME,(function(e,t){var n=t.payload,r=n.scheme,o=n.path,a=n.method;return o&&a?e.setIn(["scheme",o,a],r):o||a?void 0:e.setIn(["scheme","_defaultScheme"],r)})),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"updateSpec",(function(){return c})),n.d(t,"updateJsonSpec",(function(){return l})),n.d(t,"executeRequest",(function(){return p})),n.d(t,"validateParams",(function(){return f}));var r=n(16),o=n.n(r),a=n(15),i=n.n(a),s=n(46),u=n.n(s),c=function(e,t){var n=t.specActions;return function(){e.apply(void 0,arguments),n.parseToJson.apply(n,arguments)}},l=function(e,t){var n=t.specActions;return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];e.apply(void 0,r),n.invalidateResolvedSubtreeCache();var s=r[0],c=u()(s,["paths"])||{},l=i()(c);o()(l).call(l,(function(e){u()(c,[e]).$ref&&n.requestResolvedSubtree(["paths",e])})),n.requestResolvedSubtree(["components","securitySchemes"])}},p=function(e,t){var n=t.specActions;return function(t){return n.logRequest(t),e(t)}},f=function(e,t){var n=t.specSelectors;return function(t){return e(t,n.isOAS3())}}},function(e,t,n){"use strict";n.r(t);var r=n(30),o=n.n(r),a=n(168),i=n(4);t.default=function(e){var t=e.getComponents,n=e.getStore,r=e.getSystem,s=a.getComponent,u=a.render,c=a.makeMappedContainer,l=Object(i.v)(o()(s).call(s,null,r,n,t));return{rootInjects:{getComponent:l,makeMappedContainer:Object(i.v)(o()(c).call(c,null,r,n,l,t)),render:o()(u).call(u,null,r,n,s,t)}}}},function(e,t,n){"use strict";n.r(t);var r=n(142);t.default=function(){return{fn:r}}},function(e,t,n){"use strict";n.r(t);var r=n(30),o=n.n(r);t.default=function(e){var t=e.configs,n={debug:0,info:1,log:2,warn:3,error:4},r=function(e){return n[e]||-1},a=t.logLevel,i=r(a);function s(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];r(e)>=i&&(t=console)[e].apply(t,o)}return s.warn=o()(s).call(s,null,"warn"),s.error=o()(s).call(s,null,"error"),s.info=o()(s).call(s,null,"info"),s.debug=o()(s).call(s,null,"debug"),{rootInjects:{log:s}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"loaded",(function(){return r}));var r=function(e,t){return function(){e.apply(void 0,arguments);var n=t.getConfigs().withCredentials;void 0!==n&&(t.fn.fetch.withCredentials="string"==typeof n?"true"===n:!!n)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"preauthorizeBasic",(function(){return h})),n.d(t,"preauthorizeApiKey",(function(){return d}));var r=n(3),o=n.n(r),a=n(2),i=n.n(a),s=n(30),u=n.n(s),c=n(301),l=n(86),p=n(302),f=n(303);function h(e,t,n,r){var a,s=e.authActions.authorize,u=e.specSelectors,c=u.specJson,l=(0,u.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],p=c().getIn(i()(a=[]).call(a,l,[t]));return p?s(o()({},t,{value:{username:n,password:r},schema:p.toJS()})):null}function d(e,t,n){var r,a=e.authActions.authorize,s=e.specSelectors,u=s.specJson,c=(0,s.isOAS3)()?["components","securitySchemes"]:["securityDefinitions"],l=u().getIn(i()(r=[]).call(r,c,[t]));return l?a(o()({},t,{value:n,schema:l.toJS()})):null}t.default=function(){return{afterLoad:function(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=u()(d).call(d,null,e),this.rootInjects.preauthorizeBasic=u()(h).call(h,null,e)},statePlugins:{auth:{reducers:c.default,actions:l,selectors:p},spec:{wrapActions:f}}}}},function(e,t,n){"use strict";n.r(t);var r,o=n(3),a=n.n(o),i=n(21),s=n.n(i),u=n(17),c=n.n(u),l=n(16),p=n.n(l),f=n(1),h=n(4),d=n(86);t.default=(r={},a()(r,d.SHOW_AUTH_POPUP,(function(e,t){var n=t.payload;return e.set("showDefinitions",n)})),a()(r,d.AUTHORIZE,(function(e,t){var n,r=t.payload,o=Object(f.fromJS)(r),a=e.get("authorized")||Object(f.Map)();return p()(n=o.entrySeq()).call(n,(function(t){var n=c()(t,2),r=n[0],o=n[1];if(!Object(h.s)(o.getIn))return e.set("authorized",a);var i=o.getIn(["schema","type"]);if("apiKey"===i||"http"===i)a=a.set(r,o);else if("basic"===i){var s=o.getIn(["value","username"]),u=o.getIn(["value","password"]);a=(a=a.setIn([r,"value"],{username:s,header:"Basic "+Object(h.a)(s+":"+u)})).setIn([r,"schema"],o.get("schema"))}})),e.set("authorized",a)})),a()(r,d.AUTHORIZE_OAUTH2,(function(e,t){var n,r=t.payload,o=r.auth,a=r.token;o.token=s()({},a),n=Object(f.fromJS)(o);var i=e.get("authorized")||Object(f.Map)();return i=i.set(n.get("name"),n),e.set("authorized",i)})),a()(r,d.LOGOUT,(function(e,t){var n=t.payload,r=e.get("authorized").withMutations((function(e){p()(n).call(n,(function(t){e.delete(t)}))}));return e.set("authorized",r)})),a()(r,d.CONFIGURE_AUTH,(function(e,t){var n=t.payload;return e.set("configs",n)})),a()(r,d.RESTORE_AUTHORIZATION,(function(e,t){var n=t.payload;return e.set("authorized",Object(f.fromJS)(n.authorized))})),r)},function(e,t,n){"use strict";n.r(t),n.d(t,"shownDefinitions",(function(){return _})),n.d(t,"definitionsToAuthorize",(function(){return w})),n.d(t,"getDefinitionsByNames",(function(){return E})),n.d(t,"definitionsForRequirements",(function(){return x})),n.d(t,"authorized",(function(){return C})),n.d(t,"isAuthorized",(function(){return S})),n.d(t,"getConfigs",(function(){return A}));var r=n(15),o=n.n(r),a=n(6),i=n.n(a),s=n(12),u=n.n(s),c=n(35),l=n.n(c),p=n(13),f=n.n(p),h=n(17),d=n.n(h),v=n(16),m=n.n(v),g=n(19),y=n(1),b=function(e){return e},_=Object(g.a)(b,(function(e){return e.get("showDefinitions")})),w=Object(g.a)(b,(function(){return function(e){var t,n=e.specSelectors.securityDefinitions()||Object(y.Map)({}),r=Object(y.List)();return m()(t=n.entrySeq()).call(t,(function(e){var t=d()(e,2),n=t[0],o=t[1],a=Object(y.Map)();a=a.set(n,o),r=r.push(a)})),r}})),E=function(e,t){return function(e){var n,r=e.specSelectors;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");var o=r.securityDefinitions(),a=Object(y.List)();return m()(n=t.valueSeq()).call(n,(function(e){var t,n=Object(y.Map)();m()(t=e.entrySeq()).call(t,(function(e){var t,r,a=d()(e,2),i=a[0],s=a[1],u=o.get(i);"oauth2"===u.get("type")&&s.size&&(t=u.get("scopes"),m()(r=t.keySeq()).call(r,(function(e){s.contains(e)||(t=t.delete(e))})),u=u.set("allowedScopes",t));n=n.set(i,u)})),a=a.push(n)})),a}},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(y.List)();return function(e){var n=e.authSelectors.definitionsToAuthorize()||Object(y.List)();return f()(n).call(n,(function(e){return l()(t).call(t,(function(t){return t.get(e.keySeq().first())}))}))}},C=Object(g.a)(b,(function(e){return e.get("authorized")||Object(y.Map)()})),S=function(e,t){return function(e){var n,r=e.authSelectors.authorized();return y.List.isList(t)?!!f()(n=t.toJS()).call(n,(function(e){var t,n;return-1===u()(t=i()(n=o()(e)).call(n,(function(e){return!!r.get(e)}))).call(t,!1)})).length:null}},A=Object(g.a)(b,(function(e){return e.get("configs")}))},function(e,t,n){"use strict";n.r(t),n.d(t,"execute",(function(){return a}));var r=n(26),o=n.n(r),a=function(e,t){var n=t.authSelectors,r=t.specSelectors;return function(t){var a=t.path,i=t.method,s=t.operation,u=t.extras,c={authorized:n.authorized()&&n.authorized().toJS(),definitions:r.securityDefinitions()&&r.securityDefinitions().toJS(),specSecurity:r.security()&&r.security().toJS()};return e(o()({path:a,method:i,operation:s,securities:c},u))}}},function(e,t,n){"use strict";n.r(t);var r=n(4);t.default=function(){return{fn:{shallowEqualKeys:r.H}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m}));var r=n(32),o=n.n(r),a=n(12),i=n.n(a),s=n(2),u=n.n(s),c=n(169),l=n.n(c),p=n(21),f=n.n(p),h=n(19),d=n(1),v=n(27);function m(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:function(e){return function(n){var r=n.errActions,o=n.specSelectors,a=n.specActions,i=n.getConfigs,s=t.fetch,c=i();function p(t){if(t instanceof Error||t.status>=400)return a.updateLoadingStatus("failed"),r.newThrownErr(f()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in v.a?t=new l.a(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===v.a.location.protocol){var n=f()(new Error("Possible mixed-content issue? The page was loaded over https:// but a ".concat(t.protocol,"// URL was specified. Check that you are not attempting to load mixed content.")),{source:"fetch"});return void r.newThrownErr(n)}if(t.origin!==v.a.location.origin){var o,a=f()(new Error(u()(o="Possible cross-origin (CORS) issue? The URL origin (".concat(t.origin,") does not match the page (")).call(o,v.a.location.origin,"). Check the server returns the correct 'Access-Control-Allow-*' headers.")),{source:"fetch"});r.newThrownErr(a)}}catch(e){return}}());a.updateLoadingStatus("success"),a.updateSpec(t.text),o.url()!==e&&a.updateUrl(e)}e=e||o.url(),a.updateLoadingStatus("loading"),r.clear({source:"fetch"}),s({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)}},updateLoadingStatus:function(e){var t,n=[null,"loading","failed","success","failedConfig"];-1===i()(n).call(n,e)&&console.error(u()(t="Error: ".concat(e," is not one of ")).call(t,o()(n)));return{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:function(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:{loadingStatus:Object(h.a)((function(e){return e||Object(d.Map)()}),(function(e){return e.get("loadingStatus")||null}))}}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"downloadConfig",(function(){return o})),n.d(t,"getConfigByUrl",(function(){return a}));var r=n(166),o=function(e){return function(t){return(0,t.fn.fetch)(e)}},a=function(e,t){return function(n){var o=n.specActions;if(e)return o.downloadConfig(e).then(a,a);function a(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("failedConfig"),o.updateLoadingStatus("failedConfig"),o.updateUrl(""),console.error(n.statusText+" "+e.url),t(null)):t(Object(r.parseYamlConfig)(n.text))}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"get",(function(){return a}));var r=n(14),o=n.n(r),a=function(e,t){return e.getIn(o()(t)?t:[t])}},function(e,t,n){"use strict";n.r(t);var r,o=n(3),a=n.n(o),i=n(1),s=n(143);t.default=(r={},a()(r,s.UPDATE_CONFIGS,(function(e,t){return e.merge(Object(i.fromJS)(t.payload))})),a()(r,s.TOGGLE_CONFIGS,(function(e,t){var n=t.payload,r=e.get(n);return e.set(n,!r)})),r)},function(e,t,n){"use strict";n.r(t);var r=n(310),o=n(311),a=n(312);t.default=function(){return[r.default,{statePlugins:{configs:{wrapActions:{loaded:function(e,t){return function(){e.apply(void 0,arguments);var n=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(n)}}}}},wrapComponents:{operation:o.default,OperationTag:a.default}}]}},function(e,t,n){"use strict";n.r(t),n.d(t,"show",(function(){return A})),n.d(t,"scrollTo",(function(){return k})),n.d(t,"parseDeepLinkHash",(function(){return O})),n.d(t,"readyToScroll",(function(){return j})),n.d(t,"scrollToElement",(function(){return T})),n.d(t,"clearScrollTo",(function(){return I}));var r,o=n(3),a=n.n(o),i=n(12),s=n.n(i),u=n(6),c=n.n(u),l=n(23),p=n.n(l),f=n(2),h=n.n(f),d=n(17),v=n.n(d),m=n(14),g=n.n(m),y=n(170),b=n(526),_=n.n(b),w=n(4),E=n(1),x=n.n(E),C="layout_scroll_to",S="layout_clear_scroll",A=function(e,t){var n=t.getConfigs,r=t.layoutSelectors;return function(){for(var t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];if(e.apply(void 0,o),n().deepLinking)try{var i=o[0],s=o[1];i=g()(i)?i:[i];var u=r.urlHashArrayFromIsShownKey(i);if(!u.length)return;var c,l=v()(u,2),p=l[0],f=l[1];if(!s)return Object(y.setHash)("/");if(2===u.length)Object(y.setHash)(Object(w.d)(h()(c="/".concat(encodeURIComponent(p),"/")).call(c,encodeURIComponent(f))));else 1===u.length&&Object(y.setHash)(Object(w.d)("/".concat(encodeURIComponent(p))))}catch(e){console.error(e)}}},k=function(e){return{type:C,payload:g()(e)?e:[e]}},O=function(e){return function(t){var n=t.layoutActions,r=t.layoutSelectors;if((0,t.getConfigs)().deepLinking&&e){var o,a=p()(e).call(e,1);"!"===a[0]&&(a=p()(a).call(a,1)),"/"===a[0]&&(a=p()(a).call(a,1));var i=c()(o=a.split("/")).call(o,(function(e){return e||""})),u=r.isShownKeyFromUrlHashArray(i),l=v()(u,3),f=l[0],h=l[1],d=void 0===h?"":h,m=l[2],g=void 0===m?"":m;if("operations"===f){var y=r.isShownKeyFromUrlHashArray([d]);s()(d).call(d,"_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(c()(y).call(y,(function(e){return e.replace(/_/g," ")})),!0)),n.show(y,!0)}(s()(d).call(d,"_")>-1||s()(g).call(g,"_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),n.show(c()(u).call(u,(function(e){return e.replace(/_/g," ")})),!0)),n.show(u,!0),n.scrollTo(u)}}},j=function(e,t){return function(n){var r=n.layoutSelectors.getScrollToKey();x.a.is(r,Object(E.fromJS)(e))&&(n.layoutActions.scrollToElement(t),n.layoutActions.clearScrollTo())}},T=function(e,t){return function(n){try{t=t||n.fn.getScrollParent(e),_.a.createScroller(t).to(e)}catch(e){console.error(e)}}},I=function(){return{type:S}};t.default={fn:{getScrollParent:function(e,t){var n=document.documentElement,r=getComputedStyle(e),o="absolute"===r.position,a=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===r.position)return n;for(var i=e;i=i.parentElement;)if(r=getComputedStyle(i),(!o||"static"!==r.position)&&a.test(r.overflow+r.overflowY+r.overflowX))return i;return n}},statePlugins:{layout:{actions:{scrollToElement:T,scrollTo:k,clearScrollTo:I,readyToScroll:j,parseDeepLinkHash:O},selectors:{getScrollToKey:function(e){return e.get("scrollToKey")},isShownKeyFromUrlHashArray:function(e,t){var n=v()(t,2),r=n[0],o=n[1];return o?["operations",r,o]:r?["operations-tag",r]:[]},urlHashArrayFromIsShownKey:function(e,t){var n=v()(t,3),r=n[0],o=n[1],a=n[2];return"operations"==r?[o,a]:"operations-tag"==r?[o]:[]}},reducers:(r={},a()(r,C,(function(e,t){return e.set("scrollToKey",x.a.fromJS(t.payload))})),a()(r,S,(function(e){return e.delete("scrollToKey")})),r),wrapActions:{show:A}}}}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(7),i=n.n(a),s=n(5),u=n.n(s),c=n(10),l=n.n(c),p=n(8),f=n.n(p),h=n(9),d=n.n(h),v=n(3),m=n.n(v),g=n(0),y=n.n(g);n(28);t.default=function(e,t){return function(n){f()(a,n);var r=d()(a);function a(){var e,n;i()(this,a);for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=r.call.apply(r,o()(e=[this]).call(e,u)),m()(l()(n),"onLoad",(function(e){var r=n.props.operation,o=r.toObject(),a=o.tag,i=o.operationId,s=r.toObject().isShownKey;s=s||["operations",a,i],t.layoutActions.readyToScroll(s,e)})),n}return u()(a,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),a}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),a=n(7),i=n.n(a),s=n(5),u=n.n(s),c=n(10),l=n.n(c),p=n(8),f=n.n(p),h=n(9),d=n.n(h),v=n(3),m=n.n(v),g=n(0),y=n.n(g);n(11);t.default=function(e,t){return function(n){f()(a,n);var r=d()(a);function a(){var e,n;i()(this,a);for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=r.call.apply(r,o()(e=[this]).call(e,u)),m()(l()(n),"onLoad",(function(e){var r=["operations-tag",n.props.tag];t.layoutActions.readyToScroll(r,e)})),n}return u()(a,[{key:"render",value:function(){return y.a.createElement("span",{ref:this.onLoad},y.a.createElement(e,this.props))}}]),a}(y.a.Component)}},function(e,t,n){"use strict";n.r(t);var r=n(314);t.default=function(){return{fn:{opsFilter:r.default}}}},function(e,t,n){"use strict";n.r(t);var r=n(12),o=n.n(r),a=n(13),i=n.n(a);t.default=function(e,t){return i()(e).call(e,(function(e,n){return-1!==o()(n).call(n,t)}))}},function(e,t,n){"use strict";n.r(t);var r=n(215),o=n.n(r),a=!1;t.default=function(){return{statePlugins:{spec:{wrapActions:{updateSpec:function(e){return function(){return a=!0,e.apply(void 0,arguments)}},updateJsonSpec:function(e,t){return function(){var n=t.getConfigs().onComplete;return a&&"function"==typeof n&&(o()(n,0),a=!1),e.apply(void 0,arguments)}}}}}}}},function(e,t,n){"use strict";n.r(t);var r=n(317),o=n(318),a=n(319),i=n(320),s=n(329),u=n(62),c=n(336),l=n(337);t.default=function(){return{components:i.default,wrapComponents:s.default,statePlugins:{spec:{wrapSelectors:r,selectors:a},auth:{wrapSelectors:o},oas3:{actions:u,reducers:l.default,selectors:c}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitions",(function(){return h})),n.d(t,"hasHost",(function(){return d})),n.d(t,"securityDefinitions",(function(){return v})),n.d(t,"host",(function(){return m})),n.d(t,"basePath",(function(){return g})),n.d(t,"consumes",(function(){return y})),n.d(t,"produces",(function(){return b})),n.d(t,"schemes",(function(){return _})),n.d(t,"servers",(function(){return w})),n.d(t,"isOAS3",(function(){return E})),n.d(t,"isSwagger2",(function(){return x}));var r=n(19),o=n(94),a=n(1),i=n(38);function s(e){return function(t,n){return function(){var r=n.getSystem().specSelectors.specJson();return Object(i.isOAS3)(r)?e.apply(void 0,arguments):t.apply(void 0,arguments)}}}var u=function(e){return e||Object(a.Map)()},c=s(Object(r.a)((function(){return null}))),l=Object(r.a)(u,(function(e){return e.get("json",Object(a.Map)())})),p=Object(r.a)(u,(function(e){return e.get("resolved",Object(a.Map)())})),f=function(e){var t=p(e);return t.count()<1&&(t=l(e)),t},h=s(Object(r.a)(f,(function(e){var t=e.getIn(["components","schemas"]);return a.Map.isMap(t)?t:Object(a.Map)()}))),d=s((function(e){return f(e).hasIn(["servers",0])})),v=s(Object(r.a)(o.specJsonWithResolvedSubtrees,(function(e){return e.getIn(["components","securitySchemes"])||null}))),m=c,g=c,y=c,b=c,_=c,w=s(Object(r.a)(f,(function(e){return e.getIn(["servers"])||Object(a.Map)()}))),E=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(i.isOAS3)(a.Map.isMap(e)?e:Object(a.Map)())}},x=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(i.isSwagger2)(a.Map.isMap(e)?e:Object(a.Map)())}}},function(e,t,n){"use strict";n.r(t),n.d(t,"definitionsToAuthorize",(function(){return g}));var r=n(3),o=n.n(r),a=n(13),i=n.n(a),s=n(17),u=n.n(s),c=n(16),l=n.n(c),p=n(2),f=n.n(p),h=n(19),d=n(1),v=n(38);var m,g=(m=Object(h.a)((function(e){return e}),(function(e){return e.specSelectors.securityDefinitions()}),(function(e,t){var n,r=Object(d.List)();return t?(l()(n=t.entrySeq()).call(n,(function(e){var t,n=u()(e,2),a=n[0],s=n[1],c=s.get("type");"oauth2"===c&&l()(t=s.get("flows").entrySeq()).call(t,(function(e){var t=u()(e,2),n=t[0],c=t[1],l=Object(d.fromJS)({flow:n,authorizationUrl:c.get("authorizationUrl"),tokenUrl:c.get("tokenUrl"),scopes:c.get("scopes"),type:s.get("type")});r=r.push(new d.Map(o()({},a,i()(l).call(l,(function(e){return void 0!==e})))))})),"http"!==c&&"apiKey"!==c||(r=r.push(new d.Map(o()({},a,s))))})),r):r})),function(e,t){return function(n){for(var r,o=t.getSystem().specSelectors.specJson(),a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];return Object(v.isOAS3)(o)?m.apply(void 0,f()(r=[t]).call(r,i)):e.apply(void 0,i)}})},function(e,t,n){"use strict";n.r(t),n.d(t,"servers",(function(){return l})),n.d(t,"isSwagger2",(function(){return p}));var r=n(19),o=n(1),a=n(38);var i,s=function(e){return e||Object(o.Map)()},u=Object(r.a)(s,(function(e){return e.get("json",Object(o.Map)())})),c=Object(r.a)(s,(function(e){return e.get("resolved",Object(o.Map)())})),l=(i=Object(r.a)((function(e){var t=c(e);return t.count()<1&&(t=u(e)),t}),(function(e){return e.getIn(["servers"])||Object(o.Map)()})),function(){return function(e){var t=e.getSystem().specSelectors.specJson();if(Object(a.isOAS3)(t)){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return i.apply(void 0,r)}return null}}),p=function(e,t){return function(){var e=t.getSystem().specSelectors.specJson();return Object(a.isSwagger2)(e)}}},function(e,t,n){"use strict";n.r(t);var r=n(321),o=n(322),a=n(323),i=n(324),s=n(325),u=n(326),c=n(327),l=n(328);t.default={Callbacks:r.default,HttpAuth:c.default,RequestBody:o.default,Servers:i.default,ServersContainer:s.default,RequestBodyEditor:u.default,OperationServers:l.default,operationLink:a.default}},function(e,t,n){"use strict";n.r(t);var r=n(29),o=n.n(r),a=n(17),i=n.n(a),s=n(6),u=n.n(s),c=n(0),l=n.n(c),p=(n(11),n(28),n(1));t.default=function(e){var t,n=e.callbacks,r=e.getComponent,a=e.specPath,s=r("OperationContainer",!0);if(!n)return l.a.createElement("span",null,"No callbacks");var c=u()(t=n.entrySeq()).call(t,(function(t){var n,r=i()(t,2),c=r[0],f=r[1];return l.a.createElement("div",{key:c},l.a.createElement("h2",null,c),u()(n=f.entrySeq()).call(n,(function(t){var n,r=i()(t,2),f=r[0],h=r[1];return"$$ref"===f?null:l.a.createElement("div",{key:f},u()(n=h.entrySeq()).call(n,(function(t){var n=i()(t,2),r=n[0],u=n[1];if("$$ref"===r)return null;var h=Object(p.fromJS)({operation:u});return l.a.createElement(s,o()({},e,{op:h,key:r,tag:"",method:r,path:f,specPath:a.push(c,f,r),allowTryItOut:!1}))})))})))}));return l.a.createElement("div",null,c)}},function(e,t,n){"use strict";n.r(t);var r=n(14),o=n.n(r),a=n(2),i=n.n(a),s=n(37),u=n.n(s),c=n(17),l=n.n(c),p=n(6),f=n.n(p),h=n(12),d=n.n(h),v=n(0),m=n.n(v),g=(n(11),n(28),n(1)),y=n(4);function b(e,t,n){var r=e.getIn(["content",t]),o=r.get("schema").toJS(),a=void 0!==r.get("example")?Object(y.J)(r.get("example")):null,i=r.getIn(["examples",n,"value"]);return r.get("examples")?Object(y.J)(i)||"":Object(y.J)(a||Object(y.o)(o,t,{includeWriteOnly:!0})||"")}t.default=function(e){var t=e.requestBody,n=e.requestBodyValue,r=e.requestBodyInclusionSetting,a=e.requestBodyErrors,s=e.getComponent,c=e.getConfigs,p=e.specSelectors,h=e.fn,v=e.contentType,_=e.isExecute,w=e.specPath,E=e.onChange,x=e.onChangeIncludeEmpty,C=e.activeExamplesKey,S=e.updateActiveExamplesKey,A=function(e){var t={key:e,shouldDispatchInit:!1,defaultValue:!0};return"no value"===r.get(e,"no value")&&(t.shouldDispatchInit=!0),t},k=s("Markdown",!0),O=s("modelExample"),j=s("RequestBodyEditor"),T=s("highlightCode"),I=s("ExamplesSelectValueRetainer"),P=s("Example"),N=s("ParameterIncludeEmpty"),M=c().showCommonExtensions,R=t&&t.get("description")||null,D=t&&t.get("content")||new g.OrderedMap;v=v||D.keySeq().first()||"";var L=D.get(v,Object(g.OrderedMap)()),B=L.get("schema",Object(g.OrderedMap)()),F=L.get("examples",null);if(a=g.List.isList(a)?a:Object(g.List)(),!L.size)return null;var U="object"===L.getIn(["schema","type"]);if("application/octet-stream"===v||0===d()(v).call(v,"image/")||0===d()(v).call(v,"audio/")||0===d()(v).call(v,"video/")){var q=s("Input");return _?m.a.createElement(q,{type:"file",onChange:function(e){E(e.target.files[0])}}):m.a.createElement("i",null,"Example values are not available for ",m.a.createElement("code",null,"application/octet-stream")," media types.")}if(U&&("application/x-www-form-urlencoded"===v||0===d()(v).call(v,"multipart/"))&&B.get("properties",Object(g.OrderedMap)()).size>0){var z,V=s("JsonSchemaForm"),W=s("ParameterExt"),H=B.get("properties",Object(g.OrderedMap)());return n=g.Map.isMap(n)?n:Object(g.OrderedMap)(),m.a.createElement("div",{className:"table-container"},R&&m.a.createElement(k,{source:R}),m.a.createElement("table",null,m.a.createElement("tbody",null,g.Map.isMap(H)&&f()(z=H.entrySeq()).call(z,(function(e){var t,c,p=l()(e,2),d=p[0],v=p[1],b=M?Object(y.l)(v):null,w=u()(t=B.get("required",Object(g.List)())).call(t,d),C=v.get("type"),S=v.get("format"),O=v.get("description"),j=n.getIn([d,"value"]),T=n.getIn([d,"errors"])||a,I=v.get("default")||v.get("example")||"";""===I&&("object"===C?I=Object(y.o)(v,!1,{includeWriteOnly:!0}):"array"===C&&(I=[])),"string"!=typeof I&&"object"===C&&(I=Object(y.J)(I));var P="string"===C&&("binary"===S||"base64"===S);return m.a.createElement("tr",{key:d,className:"parameters","data-property-name":d},m.a.createElement("td",{className:"parameters-col_name"},m.a.createElement("div",{className:w?"parameter__name required":"parameter__name"},d,w?m.a.createElement("span",null," *"):null),m.a.createElement("div",{className:"parameter__type"},C,S&&m.a.createElement("span",{className:"prop-format"},"($",S,")"),M&&b.size?f()(c=b.entrySeq()).call(c,(function(e){var t,n=l()(e,2),r=n[0],o=n[1];return m.a.createElement(W,{key:i()(t="".concat(r,"-")).call(t,o),xKey:r,xVal:o})})):null),m.a.createElement("div",{className:"parameter__deprecated"},v.get("deprecated")?"deprecated":null)),m.a.createElement("td",{className:"parameters-col_description"},m.a.createElement(k,{source:O}),_?m.a.createElement("div",null,m.a.createElement(V,{fn:h,dispatchInitialValue:!P,schema:v,description:d,getComponent:s,value:void 0===j?I:j,required:w,errors:T,onChange:function(e){E(e,[d])}}),w?null:m.a.createElement(N,{onChange:function(e){return x(d,e)},isIncluded:r.get(d)||!1,isIncludedOptions:A(d),isDisabled:o()(j)?0!==j.length:!Object(y.q)(j)})):null))})))))}return m.a.createElement("div",null,R&&m.a.createElement(k,{source:R}),F?m.a.createElement(I,{examples:F,currentKey:C,currentUserInputValue:n,onSelect:function(e){S(e)},updateValue:E,defaultToFirstExample:!0,getComponent:s}):null,_?m.a.createElement("div",null,m.a.createElement(j,{value:n,errors:a,defaultValue:b(t,v,C),onChange:E,getComponent:s})):m.a.createElement(O,{getComponent:s,getConfigs:c,specSelectors:p,expandDepth:1,isExecute:_,schema:L.get("schema"),specPath:w.push("content",v),example:m.a.createElement(T,{className:"body-param__example",getConfigs:c,value:Object(y.J)(n)||b(t,v,C)}),includeWriteOnly:!0}),F?m.a.createElement(P,{example:F.get(C),getComponent:s,getConfigs:c}):null)}},function(e,t,n){"use strict";n.r(t);var r=n(6),o=n.n(r),a=n(32),i=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),p=n(8),f=n.n(p),h=n(9),d=n.n(h),v=n(0),m=n.n(v),g=(n(11),n(28),function(e){f()(n,e);var t=d()(n);function n(){return u()(this,n),t.apply(this,arguments)}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.link,n=e.name,r=(0,e.getComponent)("Markdown",!0),a=t.get("operationId")||t.get("operationRef"),s=t.get("parameters")&&t.get("parameters").toJS(),u=t.get("description");return m.a.createElement("div",{className:"operation-link"},m.a.createElement("div",{className:"description"},m.a.createElement("b",null,m.a.createElement("code",null,n)),u?m.a.createElement(r,{source:u}):null),m.a.createElement("pre",null,"Operation `",a,"`",m.a.createElement("br",null),m.a.createElement("br",null),"Parameters ",function(e,t){var n;if("string"!=typeof t)return"";return o()(n=t.split("\n")).call(n,(function(t,n){return n>0?Array(e+1).join(" ")+t:t})).join("\n")}(0,i()(s,null,2))||"{}",m.a.createElement("br",null)))}}]),n}(v.Component));t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return C}));var r=n(6),o=n.n(r),a=n(58),i=n.n(a),s=n(2),u=n.n(s),c=n(7),l=n.n(c),p=n(5),f=n.n(p),h=n(10),d=n.n(h),v=n(8),m=n.n(v),g=n(9),y=n.n(g),b=n(3),_=n.n(b),w=n(0),E=n.n(w),x=n(1),C=(n(11),n(28),function(e){m()(n,e);var t=y()(n);function n(){var e,r;l()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,u()(e=[this]).call(e,a)),_()(d()(r),"onServerChange",(function(e){r.setServer(e.target.value)})),_()(d()(r),"onServerVariableValueChange",(function(e){var t=r.props,n=t.setServerVariableValue,o=t.currentServer,a=e.target.getAttribute("data-variable"),i=e.target.value;"function"==typeof n&&n({server:o,key:a,val:i})})),_()(d()(r),"setServer",(function(e){(0,r.props.setSelectedServer)(e)})),r}return f()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.servers;e.currentServer||this.setServer(t.first().get("url"))}},{key:"componentWillReceiveProps",value:function(e){var t=e.servers,n=e.setServerVariableValue,r=e.getServerVariable;if(this.props.currentServer!==e.currentServer||this.props.servers!==e.servers){var a=i()(t).call(t,(function(t){return t.get("url")===e.currentServer}));if(!a)return this.setServer(t.first().get("url"));var s=a.get("variables")||Object(x.OrderedMap)();o()(s).call(s,(function(t,o){r(e.currentServer,o)||n({server:e.currentServer,key:o,val:t.get("default")||""})}))}}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.servers,a=n.currentServer,s=n.getServerVariable,u=n.getEffectiveServerValue,c=(i()(r).call(r,(function(e){return e.get("url")===a}))||Object(x.OrderedMap)()).get("variables")||Object(x.OrderedMap)(),l=0!==c.size;return E.a.createElement("div",{className:"servers"},E.a.createElement("label",{htmlFor:"servers"},E.a.createElement("select",{onChange:this.onServerChange,value:a},o()(e=r.valueSeq()).call(e,(function(e){return E.a.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&" - ".concat(e.get("description")))})).toArray())),l?E.a.createElement("div",null,E.a.createElement("div",{className:"computed-url"},"Computed URL:",E.a.createElement("code",null,u(a))),E.a.createElement("h4",null,"Server variables"),E.a.createElement("table",null,E.a.createElement("tbody",null,o()(c).call(c,(function(e,n){var r;return E.a.createElement("tr",{key:n},E.a.createElement("td",null,n),E.a.createElement("td",null,e.get("enum")?E.a.createElement("select",{"data-variable":n,onChange:t.onServerVariableValueChange},o()(r=e.get("enum")).call(r,(function(e){return E.a.createElement("option",{selected:e===s(a,n),key:e,value:e},e)}))):E.a.createElement("input",{type:"text",value:s(a,n)||"",onChange:t.onServerVariableValueChange,"data-variable":n})))}))))):null)}}]),n}(E.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return h}));var r=n(7),o=n.n(r),a=n(5),i=n.n(a),s=n(8),u=n.n(s),c=n(9),l=n.n(c),p=n(0),f=n.n(p),h=(n(11),function(e){u()(n,e);var t=l()(n);function n(){return o()(this,n),t.apply(this,arguments)}return i()(n,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.oas3Selectors,r=e.oas3Actions,o=e.getComponent,a=t.servers(),i=o("Servers");return a&&a.size?f.a.createElement("div",null,f.a.createElement("span",{className:"servers-title"},"Servers"),f.a.createElement(i,{servers:a,currentServer:n.selectedServer(),setSelectedServer:r.setSelectedServer,setServerVariableValue:r.setServerVariableValue,getServerVariable:n.serverVariableValue,getEffectiveServerValue:n.serverEffectiveValue})):null}}]),n}(f.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return w}));var r=n(7),o=n.n(r),a=n(5),i=n.n(a),s=n(10),u=n.n(s),c=n(8),l=n.n(c),p=n(9),f=n.n(p),h=n(3),d=n.n(h),v=n(0),m=n.n(v),g=(n(11),n(67)),y=n.n(g),b=n(4),_=Function.prototype,w=function(e){l()(n,e);var t=f()(n);function n(e,r){var a;return o()(this,n),a=t.call(this,e,r),d()(u()(a),"applyDefaultValue",(function(e){var t=e||a.props,n=t.onChange,r=t.defaultValue;return a.setState({value:r}),n(r)})),d()(u()(a),"onChange",(function(e){a.props.onChange(Object(b.J)(e))})),d()(u()(a),"onDomChange",(function(e){var t=e.target.value;a.setState({value:t},(function(){return a.onChange(t)}))})),a.state={value:Object(b.J)(e.value)||e.defaultValue},e.onChange(e.value),a}return i()(n,[{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:Object(b.J)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.errors,r=this.state.value,o=n.size>0,a=t("TextArea");return m.a.createElement("div",{className:"body-param"},m.a.createElement(a,{className:y()("body-param__text",{invalid:o}),title:n.size?n.join(", "):"",value:r,onChange:this.onDomChange}))}}]),n}(v.PureComponent);d()(w,"defaultProps",{onChange:_})},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return x}));var r=n(6),o=n.n(r),a=n(13),i=n.n(a),s=n(21),u=n.n(s),c=n(7),l=n.n(c),p=n(5),f=n.n(p),h=n(10),d=n.n(h),v=n(8),m=n.n(v),g=n(9),y=n.n(g),b=n(3),_=n.n(b),w=n(0),E=n.n(w),x=(n(11),function(e){m()(n,e);var t=y()(n);function n(e,r){var o;l()(this,n),o=t.call(this,e,r),_()(d()(o),"onChange",(function(e){var t=o.props.onChange,n=e.target,r=n.value,a=n.name,i=u()({},o.state.value);a?i[a]=r:i=r,o.setState({value:i},(function(){return t(o.state)}))}));var a=o.props,i=a.name,s=a.schema,c=o.getValue();return o.state={name:i,schema:s,value:c},o}return f()(n,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e,t,n=this.props,r=n.schema,a=n.getComponent,s=n.errSelectors,u=n.name,c=a("Input"),l=a("Row"),p=a("Col"),f=a("authError"),h=a("Markdown",!0),d=a("JumpToPath",!0),v=(r.get("scheme")||"").toLowerCase(),m=this.getValue(),g=i()(e=s.allErrors()).call(e,(function(e){return e.get("authId")===u}));if("basic"===v){var y,b=m?m.get("username"):null;return E.a.createElement("div",null,E.a.createElement("h4",null,E.a.createElement("code",null,u||r.get("name")),"  (http, Basic)",E.a.createElement(d,{path:["securityDefinitions",u]})),b&&E.a.createElement("h6",null,"Authorized"),E.a.createElement(l,null,E.a.createElement(h,{source:r.get("description")})),E.a.createElement(l,null,E.a.createElement("label",null,"Username:"),b?E.a.createElement("code",null," ",b," "):E.a.createElement(p,null,E.a.createElement(c,{type:"text",required:"required",name:"username",onChange:this.onChange}))),E.a.createElement(l,null,E.a.createElement("label",null,"Password:"),b?E.a.createElement("code",null," ****** "):E.a.createElement(p,null,E.a.createElement(c,{autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),o()(y=g.valueSeq()).call(y,(function(e,t){return E.a.createElement(f,{error:e,key:t})})))}return"bearer"===v?E.a.createElement("div",null,E.a.createElement("h4",null,E.a.createElement("code",null,u||r.get("name")),"  (http, Bearer)",E.a.createElement(d,{path:["securityDefinitions",u]})),m&&E.a.createElement("h6",null,"Authorized"),E.a.createElement(l,null,E.a.createElement(h,{source:r.get("description")})),E.a.createElement(l,null,E.a.createElement("label",null,"Value:"),m?E.a.createElement("code",null," ****** "):E.a.createElement(p,null,E.a.createElement(c,{type:"text",onChange:this.onChange}))),o()(t=g.valueSeq()).call(t,(function(e,t){return E.a.createElement(f,{error:e,key:t})}))):E.a.createElement("div",null,E.a.createElement("em",null,E.a.createElement("b",null,u)," HTTP authentication: unsupported scheme ","'".concat(v,"'")))}}]),n}(E.a.Component))},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return w}));var r=n(26),o=n.n(r),a=n(2),i=n.n(a),s=n(7),u=n.n(s),c=n(5),l=n.n(c),p=n(10),f=n.n(p),h=n(8),d=n.n(h),v=n(9),m=n.n(v),g=n(3),y=n.n(g),b=n(0),_=n.n(b),w=(n(11),n(28),function(e){d()(n,e);var t=m()(n);function n(){var e,r;u()(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return r=t.call.apply(t,i()(e=[this]).call(e,s)),y()(f()(r),"setSelectedServer",(function(e){var t,n=r.props,o=n.path,a=n.method;return r.forceUpdate(),r.props.setSelectedServer(e,i()(t="".concat(o,":")).call(t,a))})),y()(f()(r),"setServerVariableValue",(function(e){var t,n=r.props,a=n.path,s=n.method;return r.forceUpdate(),r.props.setServerVariableValue(o()(o()({},e),{},{namespace:i()(t="".concat(a,":")).call(t,s)}))})),y()(f()(r),"getSelectedServer",(function(){var e,t=r.props,n=t.path,o=t.method;return r.props.getSelectedServer(i()(e="".concat(n,":")).call(e,o))})),y()(f()(r),"getServerVariable",(function(e,t){var n,o=r.props,a=o.path,s=o.method;return r.props.getServerVariable({namespace:i()(n="".concat(a,":")).call(n,s),server:e},t)})),y()(f()(r),"getEffectiveServerValue",(function(e){var t,n=r.props,o=n.path,a=n.method;return r.props.getEffectiveServerValue({server:e,namespace:i()(t="".concat(o,":")).call(t,a)})})),r}return l()(n,[{key:"render",value:function(){var e=this.props,t=e.operationServers,n=e.pathServers,r=e.getComponent;if(!t&&!n)return null;var o=r("Servers"),a=t||n,i=t?"operation":"path";return _.a.createElement("div",{className:"opblock-section operation-servers"},_.a.createElement("div",{className:"opblock-section-header"},_.a.createElement("div",{className:"tab-header"},_.a.createElement("h4",{className:"opblock-title"},"Servers"))),_.a.createElement("div",{className:"opblock-description-wrapper"},_.a.createElement("h4",{className:"message"},"These ",i,"-level options override the global server options."),_.a.createElement(o,{servers:a,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}]),n}(_.a.Component))},function(e,t,n){"use strict";n.r(t);var r=n(330),o=n(331),a=n(332),i=n(333),s=n(334),u=n(335);t.default={Markdown:r.default,AuthItem:o.default,JsonSchema_string:u.default,VersionStamp:a.default,model:s.default,onlineValidatorBadge:i.default}},function(e,t,n){"use strict";n.r(t),n.d(t,"Markdown",(function(){return h}));var r=n(99),o=n.n(r),a=n(0),i=n.n(a),s=(n(11),n(67)),u=n.n(s),c=n(218),l=n(38),p=n(219),f=new c.a("commonmark");f.block.ruler.enable(["table"]),f.set({linkTarget:"_blank"});var h=function(e){var t=e.source,n=e.className,r=void 0===n?"":n,a=e.getConfigs;if("string"!=typeof t)return null;if(t){var s,c=a().useUnsafeMarkdown,l=f.render(t),h=Object(p.b)(l,{useUnsafeMarkdown:c});return"string"==typeof h&&(s=o()(h).call(h)),i.a.createElement("div",{dangerouslySetInnerHTML:{__html:s},className:u()(r,"renderedMarkdown")})}return null};h.defaultProps={getConfigs:function(){return{useUnsafeMarkdown:!1}}},t.default=Object(l.OAS3ComponentWrapFactory)(h)},function(e,t,n){"use strict";n.r(t);var r=n(56),o=n.n(r),a=n(0),i=n.n(a),s=n(38);t.default=Object(s.OAS3ComponentWrapFactory)((function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,a=n.getComponent,s=n.errSelectors,u=n.authorized,c=n.onAuthChange,l=n.name,p=a("HttpAuth");return"http"===r.get("type")?i.a.createElement(p,{key:l,schema:r,name:l,errSelectors:s,authorized:u,getComponent:a,onChange:c}):i.a.createElement(t,n)}))},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(38);t.default=Object(a.OAS3ComponentWrapFactory)((function(e){var t=e.Ori;return o.a.createElement("span",null,o.a.createElement(t,e),o.a.createElement("small",{className:"version-stamp"},o.a.createElement("pre",{className:"version"},"OAS3")))}))},function(e,t,n){"use strict";n.r(t);var r=n(38),o=n(216);t.default=Object(r.OAS3ComponentWrapFactory)(o.a)},function(e,t,n){"use strict";n.r(t);var r=n(29),o=n.n(r),a=n(7),i=n.n(a),s=n(5),u=n.n(s),c=n(8),l=n.n(c),p=n(9),f=n.n(p),h=n(0),d=n.n(h),v=(n(11),n(38)),m=n(220),g=function(e){l()(n,e);var t=f()(n);function n(){return i()(this,n),t.apply(this,arguments)}return u()(n,[{key:"render",value:function(){var e=this.props,t=e.getConfigs,n=["model-box"],r=null;return!0===e.schema.get("deprecated")&&(n.push("deprecated"),r=d.a.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),d.a.createElement("div",{className:n.join(" ")},r,d.a.createElement(m.a,o()({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),n}(h.Component);t.default=Object(v.OAS3ComponentWrapFactory)(g)},function(e,t,n){"use strict";n.r(t);var r=n(56),o=n.n(r),a=n(0),i=n.n(a),s=n(38);t.default=Object(s.OAS3ComponentWrapFactory)((function(e){var t=e.Ori,n=o()(e,["Ori"]),r=n.schema,a=n.getComponent,s=n.errors,u=n.onChange,c=r&&r.get?r.get("format"):null,l=r&&r.get?r.get("type"):null,p=a("Input");return l&&"string"===l&&c&&("binary"===c||"base64"===c)?i.a.createElement(p,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:function(e){u(e.target.files[0])},disabled:t.isDisabled}):i.a.createElement(t,n)}))},function(e,t,n){"use strict";n.r(t),n.d(t,"selectedServer",(function(){return b})),n.d(t,"requestBodyValue",(function(){return _})),n.d(t,"requestBodyInclusionSetting",(function(){return w})),n.d(t,"requestBodyErrors",(function(){return E})),n.d(t,"activeExamplesMember",(function(){return x})),n.d(t,"requestContentType",(function(){return C})),n.d(t,"responseContentType",(function(){return S})),n.d(t,"serverVariableValue",(function(){return A})),n.d(t,"serverVariables",(function(){return k})),n.d(t,"serverEffectiveValue",(function(){return O})),n.d(t,"validateBeforeExecute",(function(){return j})),n.d(t,"validateShallowRequired",(function(){return T}));var r=n(12),o=n.n(r),a=n(15),i=n.n(a),s=n(16),u=n.n(s),c=n(6),l=n.n(c),p=n(18),f=n.n(p),h=n(2),d=n.n(h),v=n(1),m=n(38);function g(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(t){var r=t.getSystem().specSelectors.specJson();return Object(m.isOAS3)(r)?e.apply(void 0,n):null}}}var y,b=g((function(e,t){var n=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(n)||""})),_=g((function(e,t,n){return e.getIn(["requestData",t,n,"bodyValue"])||null})),w=g((function(e,t,n){return e.getIn(["requestData",t,n,"bodyInclusion"])||Object(v.Map)()})),E=g((function(e,t,n){return e.getIn(["requestData",t,n,"errors"])||null})),x=g((function(e,t,n,r,o){return e.getIn(["examples",t,n,r,o,"activeExample"])||null})),C=g((function(e,t,n){return e.getIn(["requestData",t,n,"requestContentType"])||null})),S=g((function(e,t,n){return e.getIn(["requestData",t,n,"responseContentType"])||null})),A=g((function(e,t,n){var r;if("string"!=typeof t){var o=t.server,a=t.namespace;r=a?[a,"serverVariableValues",o,n]:["serverVariableValues",o,n]}else{r=["serverVariableValues",t,n]}return e.getIn(r)||null})),k=g((function(e,t){var n;if("string"!=typeof t){var r=t.server,o=t.namespace;n=o?[o,"serverVariableValues",r]:["serverVariableValues",r]}else{n=["serverVariableValues",t]}return e.getIn(n)||Object(v.OrderedMap)()})),O=g((function(e,t){var n,r;if("string"!=typeof t){var o=t.server,a=t.namespace;r=o,n=a?e.getIn([a,"serverVariableValues",r]):e.getIn(["serverVariableValues",r])}else r=t,n=e.getIn(["serverVariableValues",r]);n=n||Object(v.OrderedMap)();var i=r;return l()(n).call(n,(function(e,t){i=i.replace(new RegExp("{".concat(t,"}"),"g"),e)})),i})),j=(y=function(e,t){return function(e,t){var n;return t=t||[],!!e.getIn(d()(n=["requestData"]).call(n,f()(t),["bodyValue"]))}(e,t)},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){var n,r,o=e.getSystem().specSelectors.specJson(),a=d()(n=[]).call(n,t)[1]||[];return!o.getIn(d()(r=["paths"]).call(r,f()(a),["requestBody","required"]))||y.apply(void 0,t)}}),T=function(e,t){var n,r=t.oas3RequiredRequestBodyContentType,a=t.oas3RequestBodyValue,s=[];if(!v.Map.isMap(a))return s;var c=[];return u()(n=i()(r.requestContentType)).call(n,(function(e){var t=r.requestContentType[e];u()(t).call(t,(function(e){o()(c).call(c,e)<0&&c.push(e)}))})),u()(c).call(c,(function(e){a.getIn([e,"value"])||s.push(e)})),s}},function(e,t,n){"use strict";n.r(t);var r,o=n(3),a=n.n(o),i=n(22),s=n.n(i),u=n(16),c=n.n(u),l=n(23),p=n.n(l),f=n(123),h=n.n(f),d=n(354),v=n.n(d),m=n(17),g=n.n(m),y=n(1),b=n(62);t.default=(r={},a()(r,b.UPDATE_SELECTED_SERVER,(function(e,t){var n=t.payload,r=n.selectedServerUrl,o=n.namespace,a=o?[o,"selectedServer"]:["selectedServer"];return e.setIn(a,r)})),a()(r,b.UPDATE_REQUEST_BODY_VALUE,(function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,a=g()(o,2),i=a[0],s=a[1];if(!y.Map.isMap(r))return e.setIn(["requestData",i,s,"bodyValue"],r);var u,l=e.getIn(["requestData",i,s,"bodyValue"])||Object(y.Map)();y.Map.isMap(l)||(l=Object(y.Map)());var f=h()(r).call(r),d=v()(f),m=p()(d).call(d,0);return c()(m).call(m,(function(e){var t=r.getIn([e]);l.has(e)&&y.Map.isMap(t)||(u=l.setIn([e,"value"],t))})),e.setIn(["requestData",i,s,"bodyValue"],u)})),a()(r,b.UPDATE_REQUEST_BODY_INCLUSION,(function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,a=n.name,i=g()(o,2),s=i[0],u=i[1];return e.setIn(["requestData",s,u,"bodyInclusion",a],r)})),a()(r,b.UPDATE_ACTIVE_EXAMPLES_MEMBER,(function(e,t){var n=t.payload,r=n.name,o=n.pathMethod,a=n.contextType,i=n.contextName,s=g()(o,2),u=s[0],c=s[1];return e.setIn(["examples",u,c,a,i,"activeExample"],r)})),a()(r,b.UPDATE_REQUEST_CONTENT_TYPE,(function(e,t){var n=t.payload,r=n.value,o=n.pathMethod,a=g()(o,2),i=a[0],s=a[1];return e.setIn(["requestData",i,s,"requestContentType"],r)})),a()(r,b.UPDATE_RESPONSE_CONTENT_TYPE,(function(e,t){var n=t.payload,r=n.value,o=n.path,a=n.method;return e.setIn(["requestData",o,a,"responseContentType"],r)})),a()(r,b.UPDATE_SERVER_VARIABLE_VALUE,(function(e,t){var n=t.payload,r=n.server,o=n.namespace,a=n.key,i=n.val,s=o?[o,"serverVariableValues",r,a]:["serverVariableValues",r,a];return e.setIn(s,i)})),a()(r,b.SET_REQUEST_BODY_VALIDATE_ERROR,(function(e,t){var n=t.payload,r=n.path,o=n.method,a=n.validationErrors,i=[];if(i.push("Required field is not provided"),a.missingBodyValue)return e.setIn(["requestData",r,o,"errors"],Object(y.fromJS)(i));if(a.missingRequiredKeys&&a.missingRequiredKeys.length>0){var u=a.missingRequiredKeys;return e.updateIn(["requestData",r,o,"bodyValue"],Object(y.fromJS)({}),(function(e){return s()(u).call(u,(function(e,t){return e.setIn([t,"errors"],Object(y.fromJS)(i))}),e)}))}return console.warn("unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR"),e})),a()(r,b.CLEAR_REQUEST_BODY_VALIDATE_ERROR,(function(e,t){var n=t.payload,r=n.path,o=n.method,a=e.getIn(["requestData",r,o,"bodyValue"]);if(!y.Map.isMap(a))return e.setIn(["requestData",r,o,"errors"],Object(y.fromJS)([]));var i=h()(a).call(a),u=v()(i),c=p()(u).call(u,0);return c?e.updateIn(["requestData",r,o,"bodyValue"],Object(y.fromJS)({}),(function(e){return s()(c).call(c,(function(e,t){return e.setIn([t,"errors"],Object(y.fromJS)([]))}),e)})):e})),r)},function(e,t,n){"use strict";n.r(t);var r,o=n(123),a=n.n(o),i=n(16),s=n.n(i),u=n(4),c=n(1092),l={};s()(r=a()(c).call(c)).call(r,(function(e){if("./index.js"!==e){var t=c(e);l[Object(u.E)(e)]=t.default?t.default:t}})),t.default=l},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"path",(function(){return Nn})),n.d(r,"query",(function(){return Mn})),n.d(r,"header",(function(){return Dn})),n.d(r,"cookie",(function(){return Ln}));var o=n(2),a=n.n(o),i=n(43),s=n.n(i),u=n(83),c=n.n(u),l=n(16),p=n.n(l),f=n(13),h=n.n(f),d=n(51),v=n.n(d),m=n(517),g=n.n(m),y=n(15),b=n.n(y),_=n(6),w=n.n(_),E=n(100),x=n.n(E),C=n(32),S=n.n(C),A=n(35),k=n.n(A),O=n(14),j=n.n(O),T=n(20),I=n.n(T),P=n(17),N=n.n(P),M=n(211),R=n.n(M),D=n(22),L=n.n(D),B=n(85),F=n.n(B),U=n(37),q=n.n(U),z=n(12),V=n.n(z),W=(n(1033),n(221)),H=n.n(W),J=n(101),$=n.n(J),K=n(212),Y=n.n(K),G=n(68),Z=n.n(G),X=n(76),Q=n(58),ee=n.n(Q),te=n(7),ne=n.n(te),re=n(5),oe=n.n(re),ae=n(518),ie=n.n(ae),se=n(205),ue=n.n(se),ce=n(8),le=n.n(ce),pe=n(9),fe=n.n(pe),he=n(519),de=function(e){var t=function(e,t){return{name:e,value:t}};return Z()(e.prototype.set)||Z()(e.prototype.get)||Z()(e.prototype.getAll)||Z()(e.prototype.has)?e:function(e){le()(r,e);var n=fe()(r);function r(e){var t;return ne()(this,r),(t=n.call(this,e)).entryList=[],t}return oe()(r,[{key:"append",value:function(e,n,o){return this.entryList.push(t(e,n)),ie()(ue()(r.prototype),"append",this).call(this,e,n,o)}},{key:"set",value:function(e,n){var r,o=t(e,n);this.entryList=h()(r=this.entryList).call(r,(function(t){return t.name!==e})),this.entryList.push(o)}},{key:"get",value:function(e){var t,n=ee()(t=this.entryList).call(t,(function(t){return t.name===e}));return void 0===n?null:n}},{key:"getAll",value:function(e){var t,n;return w()(t=h()(n=this.entryList).call(n,(function(t){return t.name===e}))).call(t,(function(e){return e.value}))}},{key:"has",value:function(e){var t;return k()(t=this.entryList).call(t,(function(t){return t.name===e}))}}]),r}(e)}(n.n(he).a),ve=n(23),me=n.n(ve),ge=n(18),ye=n.n(ge),be=n(76).Buffer,_e=function(e){return V()(":/?#[]@!$&'()*+,;=").call(":/?#[]@!$&'()*+,;=",e)>-1},we=function(e){return/^[a-z0-9\-._~]+$/i.test(e)};function Ee(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.escape,o=arguments.length>2?arguments[2]:void 0;return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&r?o?JSON.parse(e):w()(t=ye()(e)).call(t,(function(e){var t,n;return we(e)||_e(e)&&"unsafe"===r?e:w()(t=w()(n=be.from(e).toJSON().data||[]).call(n,(function(e){var t;return me()(t="0".concat(e.toString(16).toUpperCase())).call(t,-2)}))).call(t,(function(e){return"%".concat(e)})).join("")})).join(""):e}function xe(e){var t=e.value;return j()(t)?function(e){var t,n=e.key,r=e.value,o=e.style,i=e.explode,s=e.escape,u=function(e){return Ee(e,{escape:s})};if("simple"===o)return w()(r).call(r,(function(e){return u(e)})).join(",");if("label"===o)return".".concat(w()(r).call(r,(function(e){return u(e)})).join("."));if("matrix"===o)return L()(t=w()(r).call(r,(function(e){return u(e)}))).call(t,(function(e,t){var r,o,s;return!e||i?a()(o=a()(s="".concat(e||"",";")).call(s,n,"=")).call(o,t):a()(r="".concat(e,",")).call(r,t)}),"");if("form"===o){var c=i?"&".concat(n,"="):",";return w()(r).call(r,(function(e){return u(e)})).join(c)}if("spaceDelimited"===o){var l=i?"".concat(n,"="):"";return w()(r).call(r,(function(e){return u(e)})).join(" ".concat(l))}if("pipeDelimited"===o){var p=i?"".concat(n,"="):"";return w()(r).call(r,(function(e){return u(e)})).join("|".concat(p))}return}(e):"object"===I()(t)?function(e){var t=e.key,n=e.value,r=e.style,o=e.explode,i=e.escape,s=function(e){return Ee(e,{escape:i})},u=b()(n);if("simple"===r)return L()(u).call(u,(function(e,t){var r,i,u,c=s(n[t]),l=o?"=":",",p=e?"".concat(e,","):"";return a()(r=a()(i=a()(u="".concat(p)).call(u,t)).call(i,l)).call(r,c)}),"");if("label"===r)return L()(u).call(u,(function(e,t){var r,i,u,c=s(n[t]),l=o?"=":".",p=e?"".concat(e,"."):".";return a()(r=a()(i=a()(u="".concat(p)).call(u,t)).call(i,l)).call(r,c)}),"");if("matrix"===r&&o)return L()(u).call(u,(function(e,t){var r,o,i=s(n[t]),u=e?"".concat(e,";"):";";return a()(r=a()(o="".concat(u)).call(o,t,"=")).call(r,i)}),"");if("matrix"===r)return L()(u).call(u,(function(e,r){var o,i,u=s(n[r]),c=e?"".concat(e,","):";".concat(t,"=");return a()(o=a()(i="".concat(c)).call(i,r,",")).call(o,u)}),"");if("form"===r)return L()(u).call(u,(function(e,t){var r,i,u,c,l=s(n[t]),p=e?a()(r="".concat(e)).call(r,o?"&":","):"",f=o?"=":",";return a()(i=a()(u=a()(c="".concat(p)).call(c,t)).call(u,f)).call(i,l)}),"");return}(e):function(e){var t,n=e.key,r=e.value,o=e.style,i=e.escape,s=function(e){return Ee(e,{escape:i})};if("simple"===o)return s(r);if("label"===o)return".".concat(s(r));if("matrix"===o)return a()(t=";".concat(n,"=")).call(t,s(r));if("form"===o)return s(r);if("deepObject"===o)return s(r,{},!0);return}(e)}var Ce={serializeRes:je,mergeInQueryOrForm:Ue};function Se(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=c()(s.a.mark((function e(t){var n,r,o,a,i,u,c=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:{},"object"===I()(t)&&(t=(n=t).url),n.headers=n.headers||{},Ce.mergeInQueryOrForm(n),n.headers&&p()(r=b()(n.headers)).call(r,(function(e){var t=n.headers[e];"string"==typeof t&&(n.headers[e]=t.replace(/\n+/g," "))})),!n.requestInterceptor){e.next=12;break}return e.next=8,n.requestInterceptor(n);case 8:if(e.t0=e.sent,e.t0){e.next=11;break}e.t0=n;case 11:n=e.t0;case 12:return o=n.headers["content-type"]||n.headers["Content-Type"],/multipart\/form-data/i.test(o)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]),e.prev=14,e.next=17,(n.userFetch||fetch)(n.url,n);case 17:return a=e.sent,e.next=20,Ce.serializeRes(a,t,n);case 20:if(a=e.sent,!n.responseInterceptor){e.next=28;break}return e.next=24,n.responseInterceptor(a);case 24:if(e.t1=e.sent,e.t1){e.next=27;break}e.t1=a;case 27:a=e.t1;case 28:e.next=39;break;case 30:if(e.prev=30,e.t2=e.catch(14),a){e.next=34;break}throw e.t2;case 34:throw(i=new Error(a.statusText)).status=a.status,i.statusCode=a.status,i.responseError=e.t2,i;case 39:if(a.ok){e.next=45;break}throw(u=new Error(a.statusText)).status=a.status,u.statusCode=a.status,u.response=a,u;case 45:return e.abrupt("return",a);case 46:case"end":return e.stop()}}),e,null,[[14,30]])})))).apply(this,arguments)}var ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(e)};function Oe(e,t){return t&&(0===V()(t).call(t,"application/json")||V()(t).call(t,"+json")>0)?JSON.parse(e):$.a.safeLoad(e)}function je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.loadSpec,o=void 0!==r&&r,a={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:Ie(e.headers)},i=a.headers["content-type"],s=o||ke(i),u=s?e.text:e.blob||e.buffer;return u.call(e).then((function(e){if(a.text=e,a.data=e,s)try{var t=Oe(e,i);a.body=t,a.obj=t}catch(e){a.parseError=e}return a}))}function Te(e){return q()(e).call(e,", ")?e.split(", "):e}function Ie(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Z()(F()(t))?L()(e=R()(F()(t).call(t))).call(e,(function(e,t){var n=N()(t,2),r=n[0],o=n[1];return e[r]=Te(o),e}),{}):{}}function Pe(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!==I()(e)||"string"!=typeof e.uri):"undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||(void 0!==X.Buffer&&e instanceof X.Buffer||null!==e&&"object"===I()(e)&&"function"==typeof e.pipe))}function Ne(e,t){return j()(e)&&k()(e).call(e,(function(e){return Pe(e,t)}))}var Me={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Re={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function De(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.collectionFormat,o=t.allowEmptyValue,a=t.serializationOption,i=t.encoding,s="object"!==I()(t)||j()(t)?t:t.value,u=n?function(e){return e.toString()}:function(e){return encodeURIComponent(e)},c=u(e);if(void 0===s&&o)return[[c,""]];if(Pe(s)||Ne(s))return[[c,s]];if(a)return Le(e,s,n,a);if(i){var l;if(k()(l=[I()(i.style),I()(i.explode),I()(i.allowReserved)]).call(l,(function(e){return"undefined"!==e})))return Le(e,s,n,Y()(i,["style","explode","allowReserved"]));if(i.contentType){if("application/json"===i.contentType){var p="string"==typeof s?s:S()(s);return[[c,u(p)]]}return[[c,u(s.toString())]]}return"object"!==I()(s)?[[c,u(s)]]:j()(s)&&x()(s).call(s,(function(e){return"object"!==I()(e)}))?[[c,w()(s).call(s,u).join(",")]]:[[c,u(S()(s))]]}return"object"!==I()(s)?[[c,u(s)]]:j()(s)?"multi"===r?[[c,w()(s).call(s,u)]]:[[c,w()(s).call(s,u).join(Re[r||"csv"])]]:[[c,""]]}function Le(e,t,n,r){var o,i,s,u=r.style||"form",c=void 0===r.explode?"form"===u:r.explode,l=!n&&(r&&r.allowReserved?"unsafe":"reserved"),p=function(e){return Ee(e,{escape:l})},f=n?function(e){return e}:function(e){return Ee(e,{escape:l})};return"object"!==I()(t)?[[f(e),p(t)]]:j()(t)?c?[[f(e),w()(t).call(t,p)]]:[[f(e),w()(t).call(t,p).join(Me[u])]]:"deepObject"===u?w()(i=b()(t)).call(i,(function(n){var r;return[f(a()(r="".concat(e,"[")).call(r,n,"]")),p(t[n])]})):c?w()(s=b()(t)).call(s,(function(e){return[f(e),p(t[e])]})):[[f(e),w()(o=b()(t)).call(o,(function(e){var n;return[a()(n="".concat(f(e),",")).call(n,p(t[e]))]})).join(",")]]}function Be(e){var t;return L()(t=g()(e)).call(t,(function(e,t){var n,r=N()(t,2),o=r[0],a=r[1],i=v()(De(o,a,!0));try{for(i.s();!(n=i.n()).done;){var s=N()(n.value,2),u=s[0],c=s[1];if(j()(c)){var l,p=v()(c);try{for(p.s();!(l=p.n()).done;){var f=l.value;e.append(u,f)}}catch(e){p.e(e)}finally{p.f()}}else e.append(u,c)}}catch(e){i.e(e)}finally{i.f()}return e}),new de)}function Fe(e){var t,n=L()(t=b()(e)).call(t,(function(t,n){var r,o=v()(De(n,e[n]));try{for(o.s();!(r=o.n()).done;){var a=N()(r.value,2),i=a[0],s=a[1];t[i]=s}}catch(e){o.e(e)}finally{o.f()}return t}),{});return H.a.stringify(n,{encode:!1,indices:!1})||""}function Ue(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,n=void 0===t?"":t,r=e.query,o=e.form,a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=h()(t).call(t,(function(e){return e})).join("&");return r?"?".concat(r):""};if(o){var i,s=k()(i=b()(o)).call(i,(function(e){var t=o[e].value;return Pe(t)||Ne(t)})),u=e.headers["content-type"]||e.headers["Content-Type"];s||/multipart\/form-data/i.test(u)?e.body=Be(e.form):e.body=Fe(o),delete e.form}if(r){var c=n.split("?"),l=N()(c,2),f=l[0],d=l[1],v="";if(d){var m=H.a.parse(d),g=b()(r);p()(g).call(g,(function(e){return delete m[e]})),v=H.a.stringify(m,{encode:!0})}var y=a(v,Fe(r));e.url=f+y,delete e.query}return e}var qe=n(520),ze=n.n(qe),Ve=n(26),We=n.n(Ve),He=n(77),Je=n.n(He),$e=n(30),Ke=n.n($e),Ye=n(348),Ge=n.n(Ye),Ze=n(21),Xe=n.n(Ze),Qe=n(209),et=n.n(Qe),tt=n(349),nt=n.n(tt),rt=n(3),ot=n.n(rt),at=n(147),it=n(84),st=n.n(it),ut=n(521),ct=n.n(ut),lt={add:function(e,t){return{op:"add",path:e,value:t}},replace:ft,remove:function(e){return{op:"remove",path:e}},merge:function(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function(e,t){return{type:"context",path:e,value:t}},getIn:function(e,t){return L()(t).call(t,(function(e,t){return void 0!==t&&e?e[t]:e}),e)},applyPatch:function(e,t,n){if(n=n||{},"merge"===(t=We()(We()({},t),{},{path:t.path&&pt(t.path)})).op){var r=St(e,t.path);Xe()(r,t.value),at.applyPatch(e,[ft(t.path,r)])}else if("mergeDeep"===t.op){var o=St(e,t.path);for(var i in t.value){var s=t.value[i],u=j()(s);if(u){var c=o[i]||[];o[i]=a()(c).call(c,s)}else if(bt(s)&&!u){var l=We()({},o[i]);for(var p in s){if(Object.prototype.hasOwnProperty.call(l,p)){l=st()(ct()(l),s);break}Xe()(l,ot()({},p,s[p]))}o[i]=l}else o[i]=s}}else if("add"===t.op&&""===t.path&&bt(t.value)){var f,h=L()(f=b()(t.value)).call(f,(function(e,n){return e.push({op:"add",path:"/".concat(pt(n)),value:t.value[n]}),e}),[]);at.applyPatch(e,h)}else if("replace"===t.op&&""===t.path){var d=t.value;n.allowMetaPatches&&t.meta&&xt(t)&&(j()(t.value)||bt(t.value))&&(d=We()(We()({},d),t.meta)),e=d}else if(at.applyPatch(e,[t]),n.allowMetaPatches&&t.meta&&xt(t)&&(j()(t.value)||bt(t.value))){var v=St(e,t.path),m=We()(We()({},v),t.meta);at.applyPatch(e,[ft(t.path,m)])}return e},parentPathMatch:function(e,t){if(!j()(t))return!1;for(var n=0,r=t.length;n<r;n+=1)if(t[n]!==e[n])return!1;return!0},flatten:gt,fullyNormalizeArray:function(e){return yt(gt(mt(e)))},normalizeArray:mt,isPromise:function(e){return bt(e)&&_t(e.then)},forEachNew:function(e,t){try{return ht(e,vt,t)}catch(e){return e}},forEachNewPrimitive:function(e,t){try{return ht(e,dt,t)}catch(e){return e}},isJsonPatch:wt,isContextPatch:function(e){return Ct(e)&&"context"===e.type},isPatch:Ct,isMutation:Et,isAdditiveMutation:xt,isGenerator:function(e){return"[object GeneratorFunction]"===Object.prototype.toString.call(e)},isFunction:_t,isObject:bt,isError:function(e){return e instanceof Error}};function pt(e){return j()(e)?e.length<1?"":"/".concat(w()(e).call(e,(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")})).join("/")):e}function ft(e,t,n){return{op:"replace",path:e,value:t,meta:n}}function ht(e,t,n){var r;return yt(gt(w()(r=h()(e).call(e,xt)).call(r,(function(e){return t(e.value,n,e.path)}))||[]))}function dt(e,t,n){return n=n||[],j()(e)?w()(e).call(e,(function(e,r){return dt(e,t,a()(n).call(n,r))})):bt(e)?w()(r=b()(e)).call(r,(function(r){return dt(e[r],t,a()(n).call(n,r))})):t(e,n[n.length-1],n);var r}function vt(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-1],n);o&&(r=a()(r).call(r,o))}if(j()(e)){var i=w()(e).call(e,(function(e,r){return vt(e,t,a()(n).call(n,r))}));i&&(r=a()(r).call(r,i))}else if(bt(e)){var s,u=w()(s=b()(e)).call(s,(function(r){return vt(e[r],t,a()(n).call(n,r))}));u&&(r=a()(r).call(r,u))}return r=gt(r)}function mt(e){return j()(e)?e:[e]}function gt(e){var t,n,r;return(n=a()(t=[])).call.apply(n,a()(r=[t]).call(r,ye()(w()(e).call(e,(function(e){return j()(e)?gt(e):e})))))}function yt(e){return h()(e).call(e,(function(e){return void 0!==e}))}function bt(e){return e&&"object"===I()(e)}function _t(e){return e&&"function"==typeof e}function wt(e){if(Ct(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function Et(e){return wt(e)||Ct(e)&&"mutation"===e.type}function xt(e){return Et(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function Ct(e){return e&&"object"===I()(e)}function St(e,t){try{return at.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}var At=n(522),kt=n.n(At),Ot=n(523),jt=n(350),Tt=n.n(jt),It=n(103),Pt=n.n(It);function Nt(e,t){function n(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.message=n[0],t&&t.apply(this,n)}return n.prototype=new Error,n.prototype.name=e,n.prototype.constructor=n,n}var Mt=n(524),Rt=n.n(Mt),Dt=n(210),Lt=n.n(Dt),Bt=["properties"],Ft=["properties"],Ut=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],qt=["schema/example","items/example"];function zt(e){var t=e[e.length-1],n=e[e.length-2],r=e.join("/");return V()(Bt).call(Bt,t)>-1&&-1===V()(Ft).call(Ft,n)||V()(Ut).call(Ut,r)>-1||k()(qt).call(qt,(function(e){return V()(r).call(r,e)>-1}))}function Vt(e,t){var n,r=e.split("#"),o=N()(r,2),i=o[0],s=o[1],u=Pt.a.resolve(i||"",t||"");return s?a()(n="".concat(u,"#")).call(n,s):u}var Wt="application/json, application/yaml",Ht=new RegExp("^([a-z]+://|//)","i"),Jt=Nt("JSONRefError",(function(e,t,n){this.originalError=n,Xe()(this,t||{})})),$t={},Kt=new kt.a,Yt=[function(e){return"paths"===e[0]&&"responses"===e[3]&&"content"===e[5]&&"example"===e[7]},function(e){return"paths"===e[0]&&"requestBody"===e[3]&&"content"===e[4]&&"example"===e[6]}],Gt={key:"$ref",plugin:function(e,t,n,r){var o=r.getInstance(),i=me()(n).call(n,0,-1);if(!zt(i)&&(s=i,!k()(Yt).call(Yt,(function(e){return e(s)})))){var s,u=r.getContext(n).baseDoc;if("string"!=typeof e)return new Jt("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:u,fullPath:n});var c,l,p,f=tn(e),h=f[0],d=f[1]||"";try{c=u||h?Qt(h,u):null}catch(t){return en(t,{pointer:d,$ref:e,basePath:c,fullPath:n})}if(function(e,t,n,r){var o,i,s=Kt.get(r);s||(s={},Kt.set(r,s));var u=function(e){if(0===e.length)return"";return"/".concat(w()(e).call(e,un).join("/"))}(n),c=a()(o="".concat(t||"<specmap-base>","#")).call(o,e),l=u.replace(/allOf\/\d+\/?/g,""),p=r.contextTree.get([]).baseDoc;if(t==p&&cn(l,e))return!0;var f="";if(k()(n).call(n,(function(e){var t,n;return f=a()(t="".concat(f,"/")).call(t,un(e)),s[f]&&k()(n=s[f]).call(n,(function(e){return cn(e,c)||cn(c,e)}))})))return!0;return void(s[l]=a()(i=s[l]||[]).call(i,c))}(d,c,i,r)&&!o.useCircularStructures){var v=Vt(e,c);return e===v?null:lt.replace(n,v)}if(null==c?(p=an(d),void 0===(l=r.get(p))&&(l=new Jt("Could not resolve reference: ".concat(e),{pointer:d,$ref:e,baseDoc:u,fullPath:n}))):l=null!=(l=nn(c,d)).__value?l.__value:l.catch((function(t){throw en(t,{pointer:d,$ref:e,baseDoc:u,fullPath:n})})),l instanceof Error)return[lt.remove(n),l];var m=Vt(e,c),g=lt.replace(i,l,{$$ref:m});if(c&&c!==u)return[g,lt.context(i,{baseDoc:c})];try{if(!function(e,t){var n,r=[e];return L()(n=t.path).call(n,(function(e,t){return r.push(e[t]),e[t]}),e),o(t.value);function o(e){var t;return lt.isObject(e)&&(V()(r).call(r,e)>=0||k()(t=b()(e)).call(t,(function(t){return o(e[t])})))}}(r.state,g)||o.useCircularStructures)return g}catch(e){return null}}}},Zt=Xe()(Gt,{docCache:$t,absoluteify:Qt,clearCache:function(e){var t;void 0!==e?delete $t[e]:p()(t=b()($t)).call(t,(function(e){delete $t[e]}))},JSONRefError:Jt,wrapError:en,getDoc:rn,split:tn,extractFromDoc:nn,fetchJSON:function(e){return Object(Ot.fetch)(e,{headers:{Accept:Wt},loadSpec:!0}).then((function(e){return e.text()})).then((function(e){return $.a.safeLoad(e)}))},extract:on,jsonPointerToArray:an,unescapeJsonPointerToken:sn}),Xt=Zt;function Qt(e,t){if(!Ht.test(e)){var n;if(!t)throw new Jt(a()(n="Tried to resolve a relative URL, without having a basePath. path: '".concat(e,"' basePath: '")).call(n,t,"'"));return Pt.a.resolve(t,e)}return e}function en(e,t){var n,r;e&&e.response&&e.response.body?n=a()(r="".concat(e.response.body.code," ")).call(r,e.response.body.message):n=e.message;return new Jt("Could not resolve reference: ".concat(n),t,e)}function tn(e){return(e+"").split("#")}function nn(e,t){var n=$t[e];if(n&&!lt.isPromise(n))try{var r=on(t,n);return Xe()(Je.a.resolve(r),{__value:r})}catch(e){return Je.a.reject(e)}return rn(e).then((function(e){return on(t,e)}))}function rn(e){var t=$t[e];return t?lt.isPromise(t)?t:Je.a.resolve(t):($t[e]=Zt.fetchJSON(e).then((function(t){return $t[e]=t,t})),$t[e])}function on(e,t){var n=an(e);if(n.length<1)return t;var r=lt.getIn(t,n);if(void 0===r)throw new Jt("Could not resolve pointer: ".concat(e," does not exist in document"),{pointer:e});return r}function an(e){var t;if("string"!=typeof e)throw new TypeError("Expected a string, got a ".concat(I()(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:w()(t=e.split("/")).call(t,sn)}function sn(e){return"string"!=typeof e?e:Tt.a.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function un(e){return Tt.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function cn(e,t){if(!(n=t)||"/"===n||"#"===n)return!0;var n,r=e.charAt(t.length),o=me()(t).call(t,-1);return 0===V()(e).call(e,t)&&(!r||"/"===r||"#"===r)&&"#"!==o}var ln={key:"allOf",plugin:function(e,t,n,r,o){if(!o.meta||!o.meta.$$ref){var i=me()(n).call(n,0,-1);if(!zt(i)){if(!j()(e)){var s=new TypeError("allOf must be an array");return s.fullPath=n,s}var u=!1,c=o.value;p()(i).call(i,(function(e){c&&(c=c[e])})),delete(c=We()({},c)).allOf;var l,f=[];if(f.push(r.replace(i,{})),p()(e).call(e,(function(e,t){if(!r.isObject(e)){if(u)return null;u=!0;var o=new TypeError("Elements in allOf must be objects");return o.fullPath=n,f.push(o)}f.push(r.mergeDeep(i,e));var s=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.specmap,i=r.getBaseUrlForNodePath,s=void 0===i?function(e){var n;return o.getContext(a()(n=[]).call(n,ye()(t),ye()(e))).baseDoc}:i,u=r.targetKeys,c=void 0===u?["$ref","$$ref"]:u,l=[];return p()(n=Rt()(e)).call(n,(function(){if(q()(c).call(c,this.key)&&Lt()(this.node)){var e=this.path,n=a()(t).call(t,this.path),r=Vt(this.node,s(e));l.push(o.replace(n,r))}})),l}(e,me()(n).call(n,0,-1),{getBaseUrlForNodePath:function(e){var o;return r.getContext(a()(o=[]).call(o,ye()(n),[t],ye()(e))).baseDoc},specmap:r});f.push.apply(f,ye()(s))})),f.push(r.mergeDeep(i,c)),!c.$$ref)f.push(r.remove(a()(l=[]).call(l,i,"$$ref")));return f}}}},pn={key:"parameters",plugin:function(e,t,n,r){if(j()(e)&&e.length){var o=Xe()([],e),a=me()(n).call(n,0,-1),i=We()({},lt.getIn(r.spec,a));return p()(e).call(e,(function(e,t){try{o[t].default=r.parameterMacro(i,e)}catch(e){var a=new Error(e);return a.fullPath=n,a}})),lt.replace(n,o)}return lt.replace(n,e)}},fn={key:"properties",plugin:function(e,t,n,r){var o=We()({},e);for(var a in e)try{o[a].default=r.modelPropertyMacro(o[a])}catch(e){var i=new Error(e);return i.fullPath=n,i}return lt.replace(n,o)}},hn=function(){function e(t){ne()(this,e),this.root=dn(t||{})}return oe()(e,[{key:"set",value:function(e,t){var n=this.getParent(e,!0);if(n){var r=e[e.length-1],o=n.children;o[r]?vn(o[r],t,n):o[r]=dn(t,n)}else vn(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t,n,r=this.root,o=0;o<e.length&&(n=e[o],(t=r.children)[n]);o+=1)r=t[n];return r&&r.protoValue}},{key:"getParent",value:function(e,t){var n;return!e||e.length<1?null:e.length<2?this.root:L()(n=me()(e).call(e,0,-1)).call(n,(function(e,n){if(!e)return e;var r=e.children;return!r[n]&&t&&(r[n]=dn(null,e)),r[n]}),this.root)}}]),e}();function dn(e,t){return vn({children:{}},e,t)}function vn(e,t,n){var r;return e.value=t||{},e.protoValue=n?We()(We()({},n.protoValue),e.value):e.value,p()(r=b()(e.children)).call(r,(function(t){var n=e.children[t];e.children[t]=vn(n,n.value,e)})),e}var mn=function(){function e(t){var n,r,o,a,i,s,u=this;ne()(this,e),Xe()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new hn,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:Xe()(Ge()(this),lt,{getInstance:function(){return u}}),allowMetaPatches:!1},t),this.get=Ke()(n=this._get).call(n,this),this.getContext=Ke()(r=this._getContext).call(r,this),this.hasRun=Ke()(o=this._hasRun).call(o,this),this.wrappedPlugins=h()(a=w()(i=this.plugins).call(i,Ke()(s=this.wrapPlugin).call(s,this))).call(a,lt.isFunction),this.patches.push(lt.add([],this.spec)),this.patches.push(lt.context([],this.context)),this.updatePatches(this.patches)}return oe()(e,null,[{key:"getPluginName",value:function(e){return e.pluginName}},{key:"getPatchesOfType",value:function(e,t){return h()(e).call(e,t)}}]),oe()(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console).log.apply(t,r)}}},{key:"verbose",value:function(e){if("verbose"===this.debugLevel){for(var t,n,r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];(t=console).log.apply(t,a()(n=["[".concat(e,"]   ")]).call(n,o))}}},{key:"wrapPlugin",value:function(e,t){var n,r,o,i=this.pathDiscriminator,u=null;return e[this.pluginProp]?(u=e,n=e[this.pluginProp]):lt.isFunction(e)?n=e:lt.isObject(e)&&(r=e,o=function(e,t){return!j()(e)||x()(e).call(e,(function(e,n){return e===t[n]}))},n=s.a.mark((function e(t,n){var u,c,l,p,f,d;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d=function(e,t,l){var p,f,h,v,m,g,y,_,w,E,x,C,S;return s.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(lt.isObject(e)){s.next=6;break}if(r.key!==t[t.length-1]){s.next=4;break}return s.next=4,r.plugin(e,r.key,t,n);case 4:s.next=30;break;case 6:p=t.length-1,f=t[p],h=V()(t).call(t,"properties"),v="properties"===f&&p===h,m=n.allowMetaPatches&&c[e.$$ref],g=0,y=b()(e);case 12:if(!(g<y.length)){s.next=30;break}if(_=y[g],w=e[_],E=a()(t).call(t,_),x=lt.isObject(w),C=e.$$ref,m){s.next=22;break}if(!x){s.next=22;break}return n.allowMetaPatches&&C&&(c[C]=!0),s.delegateYield(d(w,E,l),"t0",22);case 22:if(v||_!==r.key){s.next=27;break}if(S=o(i,t),i&&!S){s.next=27;break}return s.next=27,r.plugin(w,_,E,n,l);case 27:g++,s.next=12;break;case 30:case"end":return s.stop()}}),u)},u=s.a.mark(d),c={},l=v()(h()(t).call(t,lt.isAdditiveMutation)),e.prev=4,l.s();case 6:if((p=l.n()).done){e.next=11;break}return f=p.value,e.delegateYield(d(f.value,f.path,f),"t0",9);case 9:e.next=6;break;case 11:e.next=16;break;case 13:e.prev=13,e.t1=e.catch(4),l.e(e.t1);case 16:return e.prev=16,l.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])}))),Xe()(Ke()(n).call(n,u),{pluginName:e.name||t,isGenerator:lt.isGenerator(n)})}},{key:"nextPlugin",value:function(){var e=this;return et()(this.wrappedPlugins,(function(t){return e.getMutationsForPlugin(t).length>0}))}},{key:"nextPromisedPatch",value:function(){var e;if(this.promisedPatches.length>0)return Je.a.race(w()(e=this.promisedPatches).call(e,(function(e){return e.value})))}},{key:"getPluginHistory",value:function(e){var t=this.constructor.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"updatePluginHistory",value:function(e,t){var n=this.constructor.getPluginName(e);this.pluginHistory[n]=this.pluginHistory[n]||[],this.pluginHistory[n].push(t)}},{key:"updatePatches",value:function(e){var t,n=this;p()(t=lt.normalizeArray(e)).call(t,(function(e){if(e instanceof Error)n.errors.push(e);else try{if(!lt.isObject(e))return void n.debug("updatePatches","Got a non-object patch",e);if(n.showDebug&&n.allPatches.push(e),lt.isPromise(e.value))return n.promisedPatches.push(e),void n.promisedPatchThen(e);if(lt.isContextPatch(e))return void n.setContext(e.path,e.value);if(lt.isMutation(e))return void n.updateMutations(e)}catch(e){console.error(e),n.errors.push(e)}}))}},{key:"updateMutations",value:function(e){"object"===I()(e.value)&&!j()(e.value)&&this.allowMetaPatches&&(e.value=We()({},e.value));var t=lt.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t,n,r=V()(t=this.promisedPatches).call(t,e);r<0?this.debug("Tried to remove a promisedPatch that isn't there!"):ze()(n=this.promisedPatches).call(n,r,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then((function(n){var r=We()(We()({},e),{},{value:n});t.removePromisedPatch(e),t.updatePatches(r)})).catch((function(n){t.removePromisedPatch(e),t.updatePatches(n)})),e.value}},{key:"getMutations",value:function(e,t){var n;return e=e||0,"number"!=typeof t&&(t=this.mutations.length),me()(n=this.mutations).call(n,e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return lt.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"dispatch",value:function(){var e,t=this,n=this,r=this.nextPlugin();if(!r){var o=this.nextPromisedPatch();if(o)return o.then((function(){return t.dispatch()})).catch((function(){return t.dispatch()}));var i={spec:this.state,errors:this.errors};return this.showDebug&&(i.patches=this.allPatches),Je.a.resolve(i)}if(n.pluginCount=n.pluginCount||{},n.pluginCount[r]=(n.pluginCount[r]||0)+1,n.pluginCount[r]>100)return Je.a.resolve({spec:n.state,errors:a()(e=n.errors).call(e,new Error("We've reached a hard limit of ".concat(100," plugin runs")))});if(r!==this.currentPlugin&&this.promisedPatches.length){var s,u=w()(s=this.promisedPatches).call(s,(function(e){return e.value}));return Je.a.all(w()(u).call(u,(function(e){return e.then(nt.a,nt.a)}))).then((function(){return t.dispatch()}))}return function(){n.currentPlugin=r;var e=n.getCurrentMutations(),t=n.mutations.length-1;try{if(r.isGenerator){var o,a=v()(r(e,n.getLib()));try{for(a.s();!(o=a.n()).done;){c(o.value)}}catch(e){a.e(e)}finally{a.f()}}else{c(r(e,n.getLib()))}}catch(e){console.error(e),c([Xe()(Ge()(e),{plugin:r})])}finally{n.updatePluginHistory(r,{mutationIndex:t})}return n.dispatch()}();function c(e){e&&(e=lt.fullyNormalizeArray(e),n.updatePatches(e,r))}}}]),e}();var gn={refs:Xt,allOf:ln,parameters:pn,properties:fn},yn=n(60);function bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestInterceptor,r=t.responseInterceptor,o=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:n,responseInterceptor:r,headers:{Accept:Wt},credentials:o}).then((function(e){return e.body}))}}function _n(e){var t=e.fetch,n=e.spec,r=e.url,o=e.mode,a=e.allowMetaPatches,i=void 0===a||a,u=e.pathDiscriminator,l=e.modelPropertyMacro,p=e.parameterMacro,f=e.requestInterceptor,h=e.responseInterceptor,d=e.skipNormalization,v=e.useCircularStructures,m=e.http,g=e.baseDoc;return g=g||r,m=t||m||Se,n?y(n):bn(m,{requestInterceptor:f,responseInterceptor:h})(g).then(y);function y(e){g&&(gn.refs.docCache[g]=e),gn.refs.fetchJSON=bn(m,{requestInterceptor:f,responseInterceptor:h});var t,n=[gn.refs];return"function"==typeof p&&n.push(gn.parameters),"function"==typeof l&&n.push(gn.properties),"strict"!==o&&n.push(gn.allOf),(t={spec:e,context:{baseDoc:g},plugins:n,allowMetaPatches:i,pathDiscriminator:u,parameterMacro:p,modelPropertyMacro:l,useCircularStructures:v},new mn(t).dispatch()).then(d?function(){var e=c()(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}():yn.d)}}var wn=n(56),En=n.n(wn),xn=n(46),Cn=n.n(xn),Sn=n(206),An=n.n(Sn),kn=n(55),On=n.n(kn),jn=n(525),Tn=n.n(jn),In={body:function(e){var t=e.req,n=e.value;t.body=n},header:function(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{},void 0!==r&&(t.headers[n.name]=r)},query:function(e){var t,n=e.req,r=e.value,o=e.parameter;n.query=n.query||{},!1===r&&"boolean"===o.type&&(r="false");0===r&&V()(t=["number","integer"]).call(t,o.type)>-1&&(r="0");if(r)n.query[o.name]={collectionFormat:o.collectionFormat,value:r};else if(o.allowEmptyValue&&void 0!==r){var a=o.name;n.query[a]=n.query[a]||{},n.query[a].allowEmptyValue=!0}},path:function(e){var t=e.req,n=e.value,r=e.parameter;t.url=t.url.split("{".concat(r.name,"}")).join(encodeURIComponent(n))},formData:function(e){var t=e.req,n=e.value,r=e.parameter;(n||r.allowEmptyValue)&&(t.form=t.form||{},t.form[r.name]={value:n,allowEmptyValue:r.allowEmptyValue,collectionFormat:r.collectionFormat})}};function Pn(e,t){return q()(t).call(t,"application/json")?"string"==typeof e?e:S()(e):e.toString()}function Nn(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,a=r.style,i=r.explode,s=r.content;if(s){var u=b()(s)[0];t.url=t.url.split("{".concat(o,"}")).join(Ee(Pn(n,u),{escape:!0}))}else{var c=xe({key:r.name,value:n,style:a||"simple",explode:i||!1,escape:!0});t.url=t.url.split("{".concat(o,"}")).join(c)}}function Mn(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{},r.content){var o=b()(r.content)[0];t.query[r.name]=Pn(n,o)}else if(!1===n&&(n="false"),0===n&&(n="0"),n)t.query[r.name]={value:n,serializationOption:Y()(r,["style","explode","allowReserved"])};else if(r.allowEmptyValue&&void 0!==n){var a=r.name;t.query[a]=t.query[a]||{},t.query[a].allowEmptyValue=!0}}var Rn=["accept","authorization","content-type"];function Dn(e){var t=e.req,n=e.parameter,r=e.value;if(t.headers=t.headers||{},!(V()(Rn).call(Rn,n.name.toLowerCase())>-1))if(n.content){var o=b()(n.content)[0];t.headers[n.name]=Pn(r,o)}else void 0!==r&&(t.headers[n.name]=xe({key:n.name,value:r,style:n.style||"simple",explode:void 0!==n.explode&&n.explode,escape:!1}))}function Ln(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||{};var o=I()(r);if(n.content){var i,s=b()(n.content)[0];t.headers.Cookie=a()(i="".concat(n.name,"=")).call(i,Pn(r,s))}else if("undefined"!==o){var u="object"===o&&!j()(r)&&n.explode?"":"".concat(n.name,"=");t.headers.Cookie=u+xe({key:n.name,value:r,escape:!1,style:n.style||"form",explode:void 0!==n.explode&&n.explode})}}var Bn=n(213),Fn=n.n(Bn),Un=n(214),qn=n.n(Un);function zn(e,t){var n=e.operation,r=e.requestBody,o=e.securities,i=e.spec,s=e.attachContentTypeForEmptyPayload,u=e.requestContentType;t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,s=e.spec,u=Fn()({},t),c=r.authorized,l=void 0===c?{}:c,f=i.security||s.security||[],h=l&&!!b()(l).length,d=Cn()(s,["components","securitySchemes"])||{};if(u.headers=u.headers||{},u.query=u.query||{},!b()(r).length||!h||!f||j()(i.security)&&!i.security.length)return t;return p()(f).call(f,(function(e){var t;p()(t=b()(e)).call(t,(function(e){var t=l[e],n=d[e];if(t){var r=t.value||t,o=n.type;if(t)if("apiKey"===o)"query"===n.in&&(u.query[n.name]=r),"header"===n.in&&(u.headers[n.name]=r),"cookie"===n.in&&(u.cookies[n.name]=r);else if("http"===o){if(/^basic$/i.test(n.scheme)){var i,s=r.username||"",c=r.password||"",p=qn()(a()(i="".concat(s,":")).call(i,c));u.headers.Authorization="Basic ".concat(p)}/^bearer$/i.test(n.scheme)&&(u.headers.Authorization="Bearer ".concat(r))}else if("oauth2"===o){var f,h=t.token||{},v=h[n["x-tokenName"]||"access_token"],m=h.token_type;m&&"bearer"!==m.toLowerCase()||(m="Bearer"),u.headers.Authorization=a()(f="".concat(m," ")).call(f,v)}}}))})),u}({request:t,securities:o,operation:n,spec:i});var c=n.requestBody||{},l=b()(c.content||{}),f=u&&V()(l).call(l,u)>-1;if(r||s){if(u&&f)t.headers["Content-Type"]=u;else if(!u){var h=l[0];h&&(t.headers["Content-Type"]=h,u=h)}}else u&&f&&(t.headers["Content-Type"]=u);if(r)if(u){if(V()(l).call(l,u)>-1)if("application/x-www-form-urlencoded"===u||"multipart/form-data"===u)if("object"===I()(r)){var d,v=(c.content[u]||{}).encoding||{};t.form={},p()(d=b()(r)).call(d,(function(e){t.form[e]={value:r[e],encoding:v[e]||{}}}))}else t.form=r;else t.body=r}else t.body=r;return t}function Vn(e,t){var n,r,o=e.spec,i=e.operation,s=e.securities,u=e.requestContentType,c=e.attachContentTypeForEmptyPayload;if((t=function(e){var t=e.request,n=e.securities,r=void 0===n?{}:n,o=e.operation,i=void 0===o?{}:o,s=e.spec,u=Fn()({},t),c=r.authorized,l=void 0===c?{}:c,f=r.specSecurity,h=void 0===f?[]:f,d=i.security||h,v=l&&!!b()(l).length,m=s.securityDefinitions;if(u.headers=u.headers||{},u.query=u.query||{},!b()(r).length||!v||!d||j()(i.security)&&!i.security.length)return t;return p()(d).call(d,(function(e){var t;p()(t=b()(e)).call(t,(function(e){var t=l[e];if(t){var n=t.token,r=t.value||t,o=m[e],i=o.type,s=o["x-tokenName"]||"access_token",c=n&&n[s],p=n&&n.token_type;if(t)if("apiKey"===i){var f="query"===o.in?"query":"headers";u[f]=u[f]||{},u[f][o.name]=r}else if("basic"===i)if(r.header)u.headers.authorization=r.header;else{var h,d=r.username||"",v=r.password||"";r.base64=qn()(a()(h="".concat(d,":")).call(h,v)),u.headers.authorization="Basic ".concat(r.base64)}else if("oauth2"===i&&c){var g;p=p&&"bearer"!==p.toLowerCase()?p:"Bearer",u.headers.authorization=a()(g="".concat(p," ")).call(g,c)}}}))})),u}({request:t,securities:s,operation:i,spec:o})).body||t.form||c)if(u)t.headers["Content-Type"]=u;else if(j()(i.consumes)){var l=N()(i.consumes,1);t.headers["Content-Type"]=l[0]}else if(j()(o.consumes)){var f=N()(o.consumes,1);t.headers["Content-Type"]=f[0]}else i.parameters&&h()(n=i.parameters).call(n,(function(e){return"file"===e.type})).length?t.headers["Content-Type"]="multipart/form-data":i.parameters&&h()(r=i.parameters).call(r,(function(e){return"formData"===e.in})).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(u){var d,v,m=i.parameters&&h()(d=i.parameters).call(d,(function(e){return"body"===e.in})).length>0,g=i.parameters&&h()(v=i.parameters).call(v,(function(e){return"formData"===e.in})).length>0;(m||g)&&(t.headers["Content-Type"]=u)}return t}var Wn=function(e){return j()(e)?e:[]},Hn=Nt("OperationNotFoundError",(function(e,t,n){this.originalError=n,Xe()(this,t||{})})),Jn={buildRequest:Kn};function $n(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,a=e.pathName,i=e.method,s=e.parameters,u=e.securities,c=En()(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),l=t||n||Se;a&&i&&!o&&(o=Object(yn.c)(a,i));var p=Jn.buildRequest(We()({spec:r,operationId:o,parameters:s,securities:u,http:l},c));return p.body&&(An()(p.body)||On()(p.body))&&(p.body=S()(p.body)),l(p)}function Kn(e){var t,n,o=e.spec,i=e.operationId,s=e.responseContentType,u=e.scheme,c=e.requestInterceptor,l=e.responseInterceptor,f=e.contextUrl,d=e.userFetch,v=e.server,m=e.serverVariables,g=e.http,y=e.parameters,_=e.parameterBuilders,E=Object(yn.b)(o);_||(_=E?r:In);var x={url:"",credentials:g&&g.withCredentials?"include":"same-origin",headers:{},cookies:{}};c&&(x.requestInterceptor=c),l&&(x.responseInterceptor=l),d&&(x.userFetch=d);var C=Object(yn.a)(o,i);if(!C)throw new Hn("Operation ".concat(i," not found"));var S,A=C.operation,k=void 0===A?{}:A,O=C.method,T=C.pathName;if(x.url+=(S={spec:o,scheme:u,contextUrl:f,server:v,serverVariables:m,pathName:T,method:O},Object(yn.b)(S.spec)?function(e){var t=e.spec,n=e.pathName,r=e.method,o=e.server,i=e.contextUrl,s=e.serverVariables,u=void 0===s?{}:s,c=Cn()(t,["paths",n,(r||"").toLowerCase(),"servers"])||Cn()(t,["paths",n,"servers"])||Cn()(t,["servers"]),l="",f=null;if(o&&c&&c.length){var h=w()(c).call(c,(function(e){return e.url}));V()(h).call(h,o)>-1&&(l=o,f=c[V()(h).call(h,o)])}if(!l&&c&&c.length){l=c[0].url;var d=N()(c,1);f=d[0]}if(V()(l).call(l,"{")>-1){var v=function(e){for(var t,n=[],r=/{([^}]+)}/g;t=r.exec(e);)n.push(t[1]);return n}(l);p()(v).call(v,(function(e){if(f.variables&&f.variables[e]){var t=f.variables[e],n=u[e]||t.default,r=new RegExp("{".concat(e,"}"),"g");l=l.replace(r,n)}}))}return function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=Pt.a.parse(n),i=Pt.a.parse(r),s=Yn(o.protocol)||Yn(i.protocol)||"",u=o.host||i.host,c=o.pathname||"";return"/"===(e=s&&u?a()(t="".concat(s,"://")).call(t,u+c):c)[e.length-1]?me()(e).call(e,0,-1):e}(l,i)}(S):function(e){var t,n,r=e.spec,o=e.scheme,i=e.contextUrl,s=void 0===i?"":i,u=Pt.a.parse(s),c=j()(r.schemes)?r.schemes[0]:null,l=o||c||Yn(u.protocol)||"http",p=r.host||u.host||"",f=r.basePath||"";return"/"===(t=l&&p?a()(n="".concat(l,"://")).call(n,p+f):f)[t.length-1]?me()(t).call(t,0,-1):t}(S)),!i)return delete x.cookies,x;x.url+=T,x.method="".concat(O).toUpperCase(),y=y||{};var I=o.paths[T]||{};s&&(x.headers.accept=s);var P=function(e){var t,n={};p()(e).call(e,(function(e){n[e.in]||(n[e.in]={}),n[e.in][e.name]=e}));var r=[];return p()(t=b()(n)).call(t,(function(e){var t;p()(t=b()(n[e])).call(t,(function(t){r.push(n[e][t])}))})),r}(a()(t=a()(n=[]).call(n,Wn(k.parameters))).call(t,Wn(I.parameters)));p()(P).call(P,(function(e){var t,n,r=_[e.in];if("body"===e.in&&e.schema&&e.schema.properties&&(t=y),void 0===(t=e&&e.name&&y[e.name]))t=e&&e.name&&y[a()(n="".concat(e.in,".")).call(n,e.name)];else if(function(e,t){return h()(t).call(t,(function(t){return t.name===e}))}(e.name,P).length>1){var i;console.warn(a()(i="Parameter '".concat(e.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(i,e.name,"' and the passed-in parameter values did not define an 'in' value."))}if(null!==t){if(void 0!==e.default&&void 0===t&&(t=e.default),void 0===t&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter ".concat(e.name," is not provided"));if(E&&e.schema&&"object"===e.schema.type&&"string"==typeof t)try{t=JSON.parse(t)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}r&&r({req:x,parameter:e,value:t,operation:k,spec:o})}}));var M=We()(We()({},e),{},{operation:k});if((x=E?zn(M,x):Vn(M,x)).cookies&&b()(x.cookies).length){var R,D=L()(R=b()(x.cookies)).call(R,(function(e,t){var n=x.cookies[t];return e+(e?"&":"")+Tn.a.serialize(t,n)}),"");x.headers.Cookie=D}return x.cookies&&delete x.cookies,Ue(x),x}var Yn=function(e){return e?e.replace(/\W/g,""):null};function Gn(e,t){return Zn.apply(this,arguments)}function Zn(){return(Zn=c()(s.a.mark((function e(t,n){var r,o,a,i,u,c,l,p,f,h,d,v,m=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>2&&void 0!==m[2]?m[2]:{},o=r.returnEntireTree,a=r.baseDoc,i=r.requestInterceptor,u=r.responseInterceptor,c=r.parameterMacro,l=r.modelPropertyMacro,p=r.useCircularStructures,f={pathDiscriminator:n,baseDoc:a,requestInterceptor:i,responseInterceptor:u,parameterMacro:c,modelPropertyMacro:l,useCircularStructures:p},h=Object(yn.d)({spec:t}),d=h.spec,e.next=6,_n(We()(We()({},f),{},{spec:d,allowMetaPatches:!0,skipNormalization:!0}));case 6:return v=e.sent,!o&&j()(n)&&n.length&&(v.spec=Cn()(v.spec,n)||null),e.abrupt("return",v);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xn=n(299);t.default=function(e){var t,n,r,o=e.configs,i=e.getConfigs;return{fn:{fetch:(t=Se,n=o.preFetch,r=o.postFetch,r=r||function(e){return e},n=n||function(e){return e},function(e){return"string"==typeof e&&(e={url:e}),Ce.mergeInQueryOrForm(e),e=n(e),r(t(e))}),buildRequest:Kn,execute:$n,resolve:_n,resolveSubtree:function(e,t,n){var r;if(void 0===n){var o=i();n={modelPropertyMacro:o.modelPropertyMacro,parameterMacro:o.parameterMacro,requestInterceptor:o.requestInterceptor,responseInterceptor:o.responseInterceptor}}for(var s=arguments.length,u=new Array(s>3?s-3:0),c=3;c<s;c++)u[c-3]=arguments[c];return Gn.apply(void 0,a()(r=[e,t,n]).call(r,u))},serializeRes:je,opId:yn.e},statePlugins:{configs:{wrapActions:Xn}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return c}));var r=n(166),o=n(143),a=n(306),i=n(307),s=n(308),u={getLocalConfig:function(){return Object(r.parseYamlConfig)('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')}};function c(){return{statePlugins:{spec:{actions:a,selectors:u},configs:{reducers:s.default,actions:o,selectors:i}}}}},function(e,t,n){"use strict";(function(e,r){var o,a=n(504);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var i=Object(a.a)(o);t.a=i}).call(this,n(53),n(621)(e))},function(e,t,n){var r=n(414),o=n(186),a=n(755),i=n(55),s=n(428);e.exports=function(e,t,n){var u=i(e)?r:a;return n&&s(e,t,n)&&(t=void 0),u(e,o(t,3))}},function(e,t,n){"use strict";var r=n(435),o=n(437),a=n(776);e.exports=function(e){var t,i=r(arguments[1]);return i.normalizer||0!==(t=i.length=o(i.length,e.length,i.async))&&(i.primitive?!1===t?i.normalizer=n(803):t>1&&(i.normalizer=n(804)(t)):i.normalizer=!1===t?n(805)():1===t?n(809)():n(810)(t)),i.async&&n(811),i.promise&&n(812),i.dispose&&n(818),i.maxAge&&n(819),i.max&&n(822),i.refCounter&&n(824),a(e,i)}},function(e,t,n){e.exports=n(855)},function(e,t,n){e.exports=n(870)},function(e,t,n){var r=n(459);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t,n){"use strict";t.__esModule=!0,t.connect=t.Provider=void 0;var r=a(n(989)),o=a(n(991));function a(e){return e&&e.__esModule?e:{default:e}}t.Provider=r.default,t.connect=o.default},function(e,t,n){e.exports=n(1047)},function(e,t){e.exports=function(){}},function(e,t,n){"use strict";var r=t,o=n(76).Buffer;function a(e,t){try{return decodeURIComponent(e)}catch(n){return r.unescapeBuffer(e,t).toString()}}r.unescapeBuffer=function(e,t){for(var n,r,a,i=new o(e.length),s=0,u=0,c=0;u<=e.length;u++){var l=u<e.length?e.charCodeAt(u):NaN;switch(s){case 0:switch(l){case 37:n=0,r=0,s=1;break;case 43:t&&(l=32);default:i[c++]=l}break;case 1:if(a=l,l>=48&&l<=57)n=l-48;else if(l>=65&&l<=70)n=l-65+10;else{if(!(l>=97&&l<=102)){i[c++]=37,i[c++]=l,s=0;break}n=l-97+10}s=2;break;case 2:if(s=0,l>=48&&l<=57)r=l-48;else if(l>=65&&l<=70)r=l-65+10;else{if(!(l>=97&&l<=102)){i[c++]=37,i[c++]=a,i[c++]=l;break}r=l-97+10}i[c++]=16*n+r}}return i.slice(0,c-1)},r.unescape=a;for(var i=new Array(256),s=0;s<256;++s)i[s]="%"+((s<16?"0":"")+s.toString(16)).toUpperCase();r.escape=function(e){"string"!=typeof e&&(e+="");for(var t="",n=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);if(!(33===o||45===o||46===o||95===o||126===o||o>=39&&o<=42||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122))if(r-n>0&&(t+=e.slice(n,r)),o<128)n=r+1,t+=i[o];else if(o<2048)n=r+1,t+=i[192|o>>6]+i[128|63&o];else if(o<55296||o>=57344)n=r+1,t+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o];else{var a;if(!(++r<e.length))throw new URIError("URI malformed");a=1023&e.charCodeAt(r),n=r+1,t+=i[240|(o=65536+((1023&o)<<10|a))>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o]}}return 0===n?e:n<e.length?t+e.slice(n):t};var u=function(e){return"string"==typeof e?e:"number"==typeof e&&isFinite(e)?""+e:"boolean"==typeof e?e?"true":"false":""};function c(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}r.stringify=r.encode=function(e,t,n,o){t=t||"&",n=n||"=";var a=r.escape;if(o&&"function"==typeof o.encodeURIComponent&&(a=o.encodeURIComponent),null!==e&&"object"==typeof e){for(var i=Object.keys(e),s=i.length,c=s-1,l="",p=0;p<s;++p){var f=i[p],h=e[f],d=a(u(f))+n;if(Array.isArray(h)){for(var v=h.length,m=v-1,g=0;g<v;++g)l+=d+a(u(h[g])),g<m&&(l+=t);v&&p<c&&(l+=t)}else l+=d+a(u(h)),p<c&&(l+=t)}return l}return""},r.parse=r.decode=function(e,t,n,o){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;"string"!=typeof t&&(t+="");var s=n.length,u=t.length,l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var p=1/0;l>0&&(p=l);var f=r.unescape;o&&"function"==typeof o.decodeURIComponent&&(f=o.decodeURIComponent);for(var h=f!==a,d=[],v=0,m=0,g=0,y="",b="",_=h,w=h,E=0,x=0;x<e.length;++x){var C=e.charCodeAt(x);if(C!==t.charCodeAt(m)){if(m=0,w||(37===C?E=1:E>0&&(C>=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102)?3==++E&&(w=!0):E=0),g<s){if(C===n.charCodeAt(g)){if(++g===s)v<(A=x-g+1)&&(y+=e.slice(v,A)),E=0,v=x+1;continue}g=0,_||(37===C?E=1:E>0&&(C>=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102)?3==++E&&(_=!0):E=0)}43===C&&(g<s?(x-v>0&&(y+=e.slice(v,x)),y+="%20",_=!0):(x-v>0&&(b+=e.slice(v,x)),b+="%20",w=!0),v=x+1)}else if(++m===u){var S,A=x-m+1;if(g<s?v<A&&(y+=e.slice(v,A)):v<A&&(b+=e.slice(v,A)),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y))i[y]=b,d[d.length]=y;else(S=i[y])instanceof Array?S[S.length]=b:i[y]=[S,b];if(0==--p)break;_=w=h,E=0,y=b="",v=x+1,m=g=0}}p>0&&(v<e.length||g>0)&&(v<e.length&&(g<s?y+=e.slice(v):m<u&&(b+=e.slice(v))),_&&(y=c(y,f)),w&&(b=c(b,f)),-1===d.indexOf(y)?(i[y]=b,d[d.length]=y):(S=i[y])instanceof Array?S[S.length]=b:i[y]=[S,b]);return i}},function(e,t,n){var r=n(1059),o=n(405),a=n(425),i=n(93);e.exports=function(e,t,n){return e=i(e),n=null==n?0:r(a(n),0,e.length),t=o(t),e.slice(n,n+t.length)==t}},function(e,t,n){"use strict";var r=n(1076),o=n(1077);t.highlight=i,t.highlightAuto=function(e,t){var n,s,u,c,l=t||{},p=l.subset||r.listLanguages(),f=l.prefix,h=p.length,d=-1;null==f&&(f=a);if("string"!=typeof e)throw o("Expected `string` for value, got `%s`",e);s={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++d<h;)c=p[d],r.getLanguage(c)&&((u=i(c,e,t)).language=c,u.relevance>s.relevance&&(s=u),u.relevance>n.relevance&&(s=n,n=u));s.language&&(n.secondBest=s);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,o=e;t&&((o={})[e]=t);for(n in o)r.registerAliases(o[n],{languageName:n})},s.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},s.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},s.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],o=e.rootNode.children,a=t?{type:"element",tagName:"span",properties:{className:[t]},children:o}:o;r.children=r.children.concat(a)},s.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],o={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(o),t.push(o)},s.prototype.closeNode=function(){this.stack.pop()},s.prototype.closeAllNodes=u,s.prototype.finalize=u,s.prototype.toHTML=function(){return""};var a="hljs-";function i(e,t,n){var i,u=r.configure({}),c=(n||{}).prefix;if("string"!=typeof e)throw o("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw o("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw o("Expected `string` for value, got `%s`",t);if(null==c&&(c=a),r.configure({__emitter:s,classPrefix:c}),i=r.highlight(e,t,!0),r.configure(u),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function s(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function u(){}},function(e,t,n){"use strict";var r=n(1090).DebounceInput;r.DebounceInput=r,e.exports=r},function(e,t,n){var r=n(400),o=n(392),a=n(180),i=n(403);e.exports=function(e){return r(e)||o(e)||a(e)||i()}},function(e,t,n){var r=n(48),o=n(36),a=n(223);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(36),o=/#|\.prototype\./,a=function(e,t){var n=s[i(e)];return n==c||n!=u&&("function"==typeof t?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=a.data={},u=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},function(e,t,n){n(545);var r=n(34);e.exports=r.Object.keys},function(e,t,n){var r=n(52),o=n(69),a=n(224).indexOf,i=n(150);e.exports=function(e,t){var n,s=o(e),u=0,c=[];for(n in s)!r(i,n)&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){n(49)("iterator")},function(e,t,n){var r=n(41),o=n(549),a="__core-js_shared__",i=r[a]||o(a,{});e.exports=i},function(e,t,n){var r=n(229);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(149),o=n(125),a=function(e){return function(t,n){var a,i,s=String(o(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(a=s.charCodeAt(u))<55296||a>56319||u+1===c||(i=s.charCodeAt(u+1))<56320||i>57343?e?s.charAt(u):a:e?s.slice(u,u+2):i-56320+(a-55296<<10)+65536}};e.exports={codeAt:a(!1),charAt:a(!0)}},function(e,t,n){var r=n(41),o=n(364),a=r.WeakMap;e.exports="function"==typeof a&&/native code/.test(o(a))},function(e,t,n){var r=n(360),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){"use strict";var r=n(366).IteratorPrototype,o=n(108),a=n(105),i=n(87),s=n(109),u=function(){return this};e.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=o(r,{next:a(1,n)}),i(e,c,!1,!0),s[c]=u,e}},function(e,t,n){"use strict";var r,o,a,i=n(151),s=n(70),u=n(52),c=n(39),l=n(95),p=c("iterator"),f=!1;[].keys&&("next"in(a=[].keys())?(o=i(i(a)))!==Object.prototype&&(r=o):f=!0),null==r&&(r={}),l||u(r,p)||s(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},function(e,t,n){var r=n(36);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(71);e.exports=r("document","documentElement")},function(e,t,n){"use strict";var r=n(24),o=n(36),a=n(152),i=n(44),s=n(72),u=n(79),c=n(153),l=n(235),p=n(154),f=n(39),h=n(236),d=f("isConcatSpreadable"),v=9007199254740991,m="Maximum allowed index exceeded",g=h>=51||!o((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),y=p("concat"),b=function(e){if(!i(e))return!1;var t=e[d];return void 0!==t?!!t:a(e)};r({target:"Array",proto:!0,forced:!g||!y},{concat:function(e){var t,n,r,o,a,i=s(this),p=l(i,0),f=0;for(t=-1,r=arguments.length;t<r;t++)if(b(a=-1===t?i:arguments[t])){if(f+(o=u(a.length))>v)throw TypeError(m);for(n=0;n<o;n++,f++)n in a&&c(p,f,a[n])}else{if(f>=v)throw TypeError(m);c(p,f++,a)}return p.length=f,p}})},function(e,t,n){"use strict";var r=n(24),o=n(41),a=n(71),i=n(95),s=n(48),u=n(229),c=n(361),l=n(36),p=n(52),f=n(152),h=n(44),d=n(54),v=n(72),m=n(69),g=n(173),y=n(105),b=n(108),_=n(148),w=n(238),E=n(555),x=n(239),C=n(104),S=n(63),A=n(171),k=n(70),O=n(110),j=n(228),T=n(175),I=n(150),P=n(174),N=n(39),M=n(227),R=n(49),D=n(87),L=n(73),B=n(88).forEach,F=T("hidden"),U="Symbol",q=N("toPrimitive"),z=L.set,V=L.getterFor(U),W=Object.prototype,H=o.Symbol,J=a("JSON","stringify"),$=C.f,K=S.f,Y=E.f,G=A.f,Z=j("symbols"),X=j("op-symbols"),Q=j("string-to-symbol-registry"),ee=j("symbol-to-string-registry"),te=j("wks"),ne=o.QObject,re=!ne||!ne.prototype||!ne.prototype.findChild,oe=s&&l((function(){return 7!=b(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=$(W,t);r&&delete W[t],K(e,t,n),r&&e!==W&&K(W,t,r)}:K,ae=function(e,t){var n=Z[e]=b(H.prototype);return z(n,{type:U,tag:e,description:t}),s||(n.description=t),n},ie=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof H},se=function(e,t,n){e===W&&se(X,t,n),d(e);var r=g(t,!0);return d(n),p(Z,r)?(n.enumerable?(p(e,F)&&e[F][r]&&(e[F][r]=!1),n=b(n,{enumerable:y(0,!1)})):(p(e,F)||K(e,F,y(1,{})),e[F][r]=!0),oe(e,r,n)):K(e,r,n)},ue=function(e,t){d(e);var n=m(t),r=_(n).concat(fe(n));return B(r,(function(t){s&&!ce.call(n,t)||se(e,t,n[t])})),e},ce=function(e){var t=g(e,!0),n=G.call(this,t);return!(this===W&&p(Z,t)&&!p(X,t))&&(!(n||!p(this,t)||!p(Z,t)||p(this,F)&&this[F][t])||n)},le=function(e,t){var n=m(e),r=g(t,!0);if(n!==W||!p(Z,r)||p(X,r)){var o=$(n,r);return!o||!p(Z,r)||p(n,F)&&n[F][r]||(o.enumerable=!0),o}},pe=function(e){var t=Y(m(e)),n=[];return B(t,(function(e){p(Z,e)||p(I,e)||n.push(e)})),n},fe=function(e){var t=e===W,n=Y(t?X:m(e)),r=[];return B(n,(function(e){!p(Z,e)||t&&!p(W,e)||r.push(Z[e])})),r};(u||(O((H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=P(e),n=function(e){this===W&&n.call(X,e),p(this,F)&&p(this[F],t)&&(this[F][t]=!1),oe(this,t,y(1,e))};return s&&re&&oe(W,t,{configurable:!0,set:n}),ae(t,e)}).prototype,"toString",(function(){return V(this).tag})),O(H,"withoutSetter",(function(e){return ae(P(e),e)})),A.f=ce,S.f=se,C.f=le,w.f=E.f=pe,x.f=fe,M.f=function(e){return ae(N(e),e)},s&&(K(H.prototype,"description",{configurable:!0,get:function(){return V(this).description}}),i||O(W,"propertyIsEnumerable",ce,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:H}),B(_(te),(function(e){R(e)})),r({target:U,stat:!0,forced:!u},{for:function(e){var t=String(e);if(p(Q,t))return Q[t];var n=H(t);return Q[t]=n,ee[n]=t,n},keyFor:function(e){if(!ie(e))throw TypeError(e+" is not a symbol");if(p(ee,e))return ee[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(e,t){return void 0===t?b(e):ue(b(e),t)},defineProperty:se,defineProperties:ue,getOwnPropertyDescriptor:le}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:pe,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:l((function(){x.f(1)}))},{getOwnPropertySymbols:function(e){return x.f(v(e))}}),J)&&r({target:"JSON",stat:!0,forced:!u||l((function(){var e=H();return"[null]"!=J([e])||"{}"!=J({a:e})||"{}"!=J(Object(e))}))},{stringify:function(e,t,n){for(var r,o=[e],a=1;arguments.length>a;)o.push(arguments[a++]);if(r=t,(h(t)||void 0!==e)&&!ie(e))return f(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ie(t))return t}),o[1]=t,J.apply(null,o)}});H.prototype[q]||k(H.prototype,q,H.prototype.valueOf),D(H,U),I[F]=!0},function(e,t,n){var r=n(577),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?r:t}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){n(594);var r=n(34);e.exports=r.Array.isArray},function(e,t,n){n(596);var r=n(34).Object,o=e.exports=function(e,t,n){return r.defineProperty(e,t,n)};r.defineProperty.sham&&(o.sham=!0)},function(e,t,n){var r=n(598),o=Array.prototype;e.exports=function(e){var t=e.slice;return e===o||e instanceof Array&&t===o.slice?r:t}},function(e,t,n){n(601);var r=n(34);e.exports=r.Object.assign},function(e,t,n){"use strict";var r=n(48),o=n(36),a=n(148),i=n(239),s=n(171),u=n(72),c=n(172),l=Object.assign,p=Object.defineProperty;e.exports=!l||o((function(){if(r&&1!==l({b:1},l(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||a(l({},t)).join("")!=o}))?function(e,t){for(var n=u(e),o=arguments.length,l=1,p=i.f,f=s.f;o>l;)for(var h,d=c(arguments[l++]),v=p?a(d).concat(p(d)):a(d),m=v.length,g=0;m>g;)h=v[g++],r&&!f.call(d,h)||(n[h]=d[h]);return n}:l},function(e,t,n){"use strict";var r=n(78),o=n(44),a=[].slice,i={},s=function(e,t,n){if(!(t in i)){for(var r=[],o=0;o<t;o++)r[o]="a["+o+"]";i[t]=Function("C,a","return new C("+r.join(",")+")")}return i[t](e,n)};e.exports=Function.bind||function(e){var t=r(this),n=a.call(arguments,1),i=function(){var r=n.concat(a.call(arguments));return this instanceof i?s(t,r.length,r):t.apply(e,r)};return o(t.prototype)&&(i.prototype=t.prototype),i}},function(e,t,n){"use strict";var r=n(155),o=n(40),a=n(380),i=(n(381),n(179));n(25),n(606);function s(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||a}function u(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||a}function c(){}s.prototype.isReactComponent={},s.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&r("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},c.prototype=s.prototype,u.prototype=new c,u.prototype.constructor=u,o(u.prototype,s.prototype),u.prototype.isPureReactComponent=!0,e.exports={Component:s,PureComponent:u}},function(e,t,n){"use strict";n(33);var r={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=r},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=n(614);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";e.exports=n(615)},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e&&"@@redux/INIT"===e.type?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t,n){var r=n(636);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,n){var r=n(39)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,n){var r=n(642),o=Array.prototype;e.exports=function(e){var t=e.indexOf;return e===o||e instanceof Array&&t===o.indexOf?r:t}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(393),o=n(399),a=n(177);e.exports=function(e){if(void 0!==a&&o(Object(e)))return r(e)}},function(e,t,n){e.exports=n(646)},function(e,t,n){n(96),n(647);var r=n(34);e.exports=r.Array.from},function(e,t,n){"use strict";var r=n(107),o=n(72),a=n(396),i=n(397),s=n(79),u=n(153),c=n(156);e.exports=function(e){var t,n,l,p,f,h,d=o(e),v="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,y=void 0!==g,b=c(d),_=0;if(y&&(g=r(g,m>2?arguments[2]:void 0,2)),null==b||v==Array&&i(b))for(n=new v(t=s(d.length));t>_;_++)h=y?g(d[_],_):d[_],u(n,_,h);else for(f=(p=b.call(d)).next,n=new v;!(l=f.call(p)).done;_++)h=y?a(p,g,[l.value,_],!0):l.value,u(n,_,h);return n.length=_,n}},function(e,t,n){var r=n(54);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},function(e,t,n){var r=n(39),o=n(109),a=r("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||i[a]===e)}},function(e,t,n){var r=n(39)("iterator"),o=!1;try{var a=0,i={next:function(){return{done:!!a++}},return:function(){o=!0}};i[r]=function(){return this},Array.from(i,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n}},function(e,t,n){e.exports=n(648)},function(e,t,n){var r=n(241);e.exports=function(e){if(r(e))return e}},function(e,t,n){e.exports=n(664)},function(e,t,n){var r=n(54),o=n(156);e.exports=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){n(80);var r=n(669),o=n(97),a=Array.prototype,i={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.forEach;return e===a||e instanceof Array&&t===a.forEach||i.hasOwnProperty(o(e))?r:t}},function(e,t,n){var r=n(128),o=n(407),a=n(55),i=n(181),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(53))},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t){e.exports=function(e,t,n,r){var o=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);return n}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(723),o=n(90);e.exports=function e(t,n,a,i,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,s))}},function(e,t,n){var r=n(724),o=n(414),a=n(727);e.exports=function(e,t,n,i,s,u){var c=1&n,l=e.length,p=t.length;if(l!=p&&!(c&&p>l))return!1;var f=u.get(e);if(f&&u.get(t))return f==t;var h=-1,d=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var m=e[h],g=t[h];if(i)var y=c?i(g,m,h,t,e,u):i(m,g,h,e,t,u);if(void 0!==y){if(y)continue;d=!1;break}if(v){if(!o(t,(function(e,t){if(!a(v,t)&&(m===e||s(m,e,n,i,u)))return v.push(t)}))){d=!1;break}}else if(m!==g&&!s(m,g,n,i,u)){d=!1;break}}return u.delete(e),u.delete(t),d}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t,n){var r=n(74).Uint8Array;e.exports=r},function(e,t,n){var r=n(417),o=n(246),a=n(114);e.exports=function(e){return r(e,a,o)}},function(e,t,n){var r=n(245),o=n(55);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(733),o=n(247),a=n(55),i=n(248),s=n(188),u=n(420),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),l=!n&&o(e),p=!n&&!l&&i(e),f=!n&&!l&&!p&&u(e),h=n||l||p||f,d=h?r(e.length,String):[],v=d.length;for(var m in e)!t&&!c.call(e,m)||h&&("length"==m||p&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,v))||d.push(m);return d}},function(e,t,n){var r=n(736),o=n(250),a=n(251),i=a&&a.isTypedArray,s=i?o(i):r;e.exports=s},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(59);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(747),o=n(748);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(754);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(59),o=n(181),a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}},function(e,t,n){var r=n(756),o=n(759)(r);e.exports=o},function(e,t,n){var r=n(121),o=n(129),a=n(188),i=n(59);e.exports=function(e,t,n){if(!i(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&a(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";(function(t,r){var o=n(192);e.exports=b;var a,i=n(372);b.ReadableState=y;n(254).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(430),c=n(66).Buffer,l=t.Uint8Array||function(){};var p=n(157);p.inherits=n(65);var f=n(762),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var d,v=n(763),m=n(431);p.inherits(b,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(a=a||n(115));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,i=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(i||0===i)?i:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(433).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(a=a||n(115),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,n,r,o){var a,i=e._readableState;null===t?(i.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,C(e)}(e,i)):(o||(a=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(i,t)),a?e.emit("error",a):i.objectMode||t&&t.length>0?("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?i.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,i,t,!0):i.ended?e.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?w(e,i,t,!1):A(e,i)):w(e,i,t,!1))):r||(i.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(i)}function w(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&C(e)),A(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=m.destroy,b.prototype._undestroy=m.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),_(this,e,t,!1,n)},b.prototype.unshift=function(e){return _(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=n(433).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var E=8388608;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function C(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),T(e)}function A(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function O(e){h("readable nexttick read 0"),e.read(0)}function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var a=n.data,i=e>a.length?a.length:e;if(i===a.length?o+=a:o+=a.slice(0,e),0===(e-=i)){i===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(i));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,i),0===(e-=i)){i===a.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(i));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(N,t,e))}function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):C(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",o=!0),t.ended||t.reading?h("reading or ended",o=!1):o&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(n,t))),null===(r=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",p),e.removeListener("error",m),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",v),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||p())}function l(){h("onend"),e.end()}a.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var p=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",p);var f=!1;var d=!1;function v(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==M(a.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function m(t){h("onerror",t),b(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),n.unpipe(e)}return n.on("data",v),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",g),e.once("finish",y),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)r[a].emit("unpipe",this,n);return this}var i=M(t.pipes,e);return-1===i||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&C(this):o.nextTick(O,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(j,e,t))}(this,e)),this},b.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(h("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<g.length;a++)e.on(g[a],this.emit.bind(this,g[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=I}).call(this,n(53),n(91))},function(e,t,n){e.exports=n(254).EventEmitter},function(e,t,n){"use strict";var r=n(192);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return a||i?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(765),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(53))},function(e,t,n){"use strict";var r=n(66).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=p,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=i(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=i(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=i(t[r]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=i;var r=n(115),o=n(157);function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){u(e,t,n)})):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(65),o.inherits(i,r),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";var r=n(116),o=Array.prototype.forEach,a=Object.create,i=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=a(null);return o.call(arguments,(function(e){r(e)&&i(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(117);e.exports=function(e,t,n){var o;return isNaN(e)?(o=t)>=0?n&&o?o-1:o:1:!1!==e&&r(e)}},function(e,t,n){"use strict";e.exports=n(780)()?Object.assign:n(781)},function(e,t,n){"use strict";var r,o,a,i,s,u=n(117),c=function(e,t){return t};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===c.length?(r={configurable:!0,writable:!1,enumerable:!1},o=Object.defineProperty,e.exports=function(e,t){return t=u(t),e.length===t?e:(r.value=t,o(e,"length",r))}):(i=n(440),s=[],a=function(e){var t,n=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++n).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var n;if(t=u(t),e.length===t)return e;n=a(t)(e);try{i(n,e)}catch(e){}return n})},function(e,t,n){"use strict";var r=n(132),o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var n,u=Object(r(t));if(e=Object(r(e)),i(u).forEach((function(r){try{o(e,r,a(t,r))}catch(e){n=e}})),"function"==typeof s&&s(u).forEach((function(r){try{o(e,r,a(t,r))}catch(e){n=e}})),void 0!==n)throw n;return e}},function(e,t,n){"use strict";var r=n(98),o=n(193),a=Function.prototype.call;e.exports=function(e,t){var n={},i=arguments[2];return r(t),o(e,(function(e,r,o,s){n[r]=a.call(t,i,e,r,o,s)})),n}},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){var r=n(65),o=n(133),a=n(66).Buffer,i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,u=0|this._e,d=0|this._f,v=0|this._g,m=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+h(n[g-15])+n[g-16];for(var y=0;y<64;++y){var b=m+f(u)+c(u,d,v)+i[y]+n[y]|0,_=p(r)+l(r,o,a)|0;m=v,v=d,d=u,u=s+b|0,s=a,a=o,o=r,r=b+_|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(65),o=n(133),a=n(66).Buffer,i=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function p(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}r(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,a=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,x=0|this._dl,C=0|this._el,S=0|this._fl,A=0|this._gl,k=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var j=t[O-30],T=t[O-30+1],I=h(j,T),P=d(T,j),N=v(j=t[O-4],T=t[O-4+1]),M=m(T,j),R=t[O-14],D=t[O-14+1],L=t[O-32],B=t[O-32+1],F=P+D|0,U=I+R+g(F,P)|0;U=(U=U+N+g(F=F+M|0,M)|0)+L+g(F=F+B|0,B)|0,t[O]=U,t[O+1]=F}for(var q=0;q<160;q+=2){U=t[q],F=t[q+1];var z=l(n,r,o),V=l(_,w,E),W=p(n,_),H=p(_,n),J=f(s,C),$=f(C,s),K=i[q],Y=i[q+1],G=c(s,u,y),Z=c(C,S,A),X=k+$|0,Q=b+J+g(X,k)|0;Q=(Q=(Q=Q+G+g(X=X+Z|0,Z)|0)+K+g(X=X+Y|0,Y)|0)+U+g(X=X+F|0,F)|0;var ee=H+V|0,te=W+z+g(ee,H)|0;b=y,k=A,y=u,A=S,u=s,S=C,s=a+Q+g(C=x+X|0,x)|0,a=o,x=E,o=r,E=w,r=n,w=_,n=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+x|0,this._el=this._el+C|0,this._fl=this._fl+S|0,this._gl=this._gl+A|0,this._hl=this._hl+k|0,this._ah=this._ah+n+g(this._al,_)|0,this._bh=this._bh+r+g(this._bl,w)|0,this._ch=this._ch+o+g(this._cl,E)|0,this._dh=this._dh+a+g(this._dl,x)|0,this._eh=this._eh+s+g(this._el,C)|0,this._fh=this._fh+u+g(this._fl,S)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,k)|0},u.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){e.exports=n(845)},function(e,t,n){e.exports=n(850)},function(e,t,n){e.exports=n(852)},function(e,t,n){e.exports=n(853)},function(e,t,n){n(178),n(96),n(80),n(859),n(456),n(862);var r=n(34);e.exports=r.Promise},function(e,t,n){var r=n(41);e.exports=r.Promise},function(e,t,n){"use strict";var r=n(71),o=n(63),a=n(39),i=n(48),s=a("species");e.exports=function(e){var t=r(e),n=o.f;i&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(54),o=n(78),a=n(39)("species");e.exports=function(e,t){var n,i=r(e).constructor;return void 0===i||null==(n=r(i)[a])?t:o(n)}},function(e,t,n){var r,o,a,i=n(41),s=n(36),u=n(106),c=n(107),l=n(368),p=n(223),f=n(454),h=i.location,d=i.setImmediate,v=i.clearImmediate,m=i.process,g=i.MessageChannel,y=i.Dispatch,b=0,_={},w="onreadystatechange",E=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},x=function(e){return function(){E(e)}},C=function(e){E(e.data)},S=function(e){i.postMessage(e+"",h.protocol+"//"+h.host)};d&&v||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(b),b},v=function(e){delete _[e]},"process"==u(m)?r=function(e){m.nextTick(x(e))}:y&&y.now?r=function(e){y.now(x(e))}:g&&!f?(a=(o=new g).port2,o.port1.onmessage=C,r=c(a.postMessage,a,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||s(S)||"file:"===h.protocol?r=w in p("script")?function(e){l.appendChild(p("script")).onreadystatechange=function(){l.removeChild(this),E(e)}}:function(e){setTimeout(x(e),0)}:(r=S,i.addEventListener("message",C,!1))),e.exports={set:d,clear:v}},function(e,t,n){var r=n(237);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var r=n(54),o=n(44),a=n(159);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(24),o=n(78),a=n(159),i=n(195),s=n(119);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=a.f(t),r=n.resolve,u=n.reject,c=i((function(){var n=o(t.resolve),a=[],i=0,u=1;s(e,(function(e){var o=i++,s=!1;a.push(void 0),u++,n.call(t,e).then((function(e){s||(s=!0,a[o]={status:"fulfilled",value:e},--u||r(a))}),(function(e){s||(s=!0,a[o]={status:"rejected",reason:e},--u||r(a))}))})),--u||r(a)}));return c.error&&u(c.value),n.promise}})},function(e,t,n){"use strict";var r=n(136);e.exports=new r({include:[n(458)]})},function(e,t,n){"use strict";var r=n(136);e.exports=new r({include:[n(261)],implicit:[n(877),n(878),n(879),n(880)]})},function(e,t,n){var r=n(197),o=n(130),a=n(188),i=n(59),s=n(131);e.exports=function(e,t,n,u){if(!i(e))return e;for(var c=-1,l=(t=o(t,e)).length,p=l-1,f=e;null!=f&&++c<l;){var h=s(t[c]),d=n;if(c!=p){var v=f[h];void 0===(d=u?u(v,h,f):void 0)&&(d=i(v)?v:a(t[c+1])?[]:{})}r(f,h,d),f=f[h]}return e}},function(e,t,n){var r=n(461);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(113),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){n(899);var r=n(34).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){e.exports=n(901)},function(e,t,n){e.exports=n(904)},function(e,t,n){"use strict";e.exports={hasCachedChildNodes:1}},function(e,t,n){"use strict";var r=n(31);n(25);e.exports=function(e,t){return null==t&&r("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}},function(e,t,n){"use strict";e.exports=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}},function(e,t,n){"use strict";var r=n(57),o=null;e.exports=function(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}},function(e,t,n){"use strict";var r=n(31);var o=n(120),a=(n(25),function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._callbacks=null,this._contexts=null,this._arg=t}return e.prototype.enqueue=function(e,t){this._callbacks=this._callbacks||[],this._callbacks.push(e),this._contexts=this._contexts||[],this._contexts.push(t)},e.prototype.notifyAll=function(){var e=this._callbacks,t=this._contexts,n=this._arg;if(e&&t){e.length!==t.length&&r("24"),this._callbacks=null,this._contexts=null;for(var o=0;o<e.length;o++)e[o].call(t[o],n);e.length=0,t.length=0}},e.prototype.checkpoint=function(){return this._callbacks?this._callbacks.length:0},e.prototype.rollback=function(e){this._callbacks&&this._contexts&&(this._callbacks.length=e,this._contexts.length=e)},e.prototype.reset=function(){this._callbacks=null,this._contexts=null},e.prototype.destructor=function(){this.reset()},e}());e.exports=o.addPoolingTo(a)},function(e,t,n){"use strict";e.exports={logTopLevelRenders:!1}},function(e,t,n){"use strict";var r=n(42);function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function a(e){return e._wrapperState.valueTracker}var i={_getTrackerFromNode:function(e){return a(r.getInstanceFromNode(e))},track:function(e){if(!a(e)){var t=r.getNodeFromInstance(e),n=o(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),s=""+t[n];t.hasOwnProperty(n)||"function"!=typeof i.get||"function"!=typeof i.set||(Object.defineProperty(t,n,{enumerable:i.enumerable,configurable:!0,get:function(){return i.get.call(this)},set:function(e){s=""+e,i.set.call(this,e)}}),function(e,t){e._wrapperState.valueTracker=t}(e,{getValue:function(){return s},setValue:function(e){s=""+e},stopTracking:function(){!function(e){e._wrapperState.valueTracker=null}(e),delete t[n]}}))}},updateValueIfChanged:function(e){if(!e)return!1;var t=a(e);if(!t)return i.track(e),!0;var n,s,u=t.getValue(),c=((n=r.getNodeFromInstance(e))&&(s=o(n)?""+n.checked:n.value),s);return c!==u&&(t.setValue(c),!0)},stopTracking:function(e){var t=a(e);t&&t.stopTracking()}};e.exports=i},function(e,t,n){"use strict";var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";var r=n(57),o=n(201),a=n(200),i=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){3!==e.nodeType?a(e,o(t)):e.nodeValue=t})),e.exports=i},function(e,t,n){"use strict";e.exports=function(e){try{e.focus()}catch(e){}}},function(e,t,n){"use strict";var r={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var o=["Webkit","ms","Moz","O"];Object.keys(r).forEach((function(e){o.forEach((function(t){r[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=r[e]}))}));var a={isUnitlessNumber:r,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};e.exports=a},function(e,t,n){"use strict";var r=n(137),o=(n(42),n(75),n(941)),a=(n(33),new RegExp("^["+r.ATTRIBUTE_NAME_START_CHAR+"]["+r.ATTRIBUTE_NAME_CHAR+"]*$")),i={},s={};function u(e){return!!s.hasOwnProperty(e)||!i.hasOwnProperty(e)&&(a.test(e)?(s[e]=!0,!0):(i[e]=!0,!1))}function c(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}var l={createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},setAttributeForID:function(e,t){e.setAttribute(r.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return r.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(r.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=r.properties.hasOwnProperty(e)?r.properties[e]:null;if(n){if(c(n,t))return"";var a=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&!0===t?a+'=""':a+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},createMarkupForCustomAttribute:function(e,t){return u(e)&&null!=t?e+"="+o(t):""},setValueForProperty:function(e,t,n){var o=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(o){var a=o.mutationMethod;if(a)a(e,n);else{if(c(o,n))return void this.deleteValueForProperty(e,t);if(o.mustUseProperty)e[o.propertyName]=n;else{var i=o.attributeName,s=o.attributeNamespace;s?e.setAttributeNS(s,i,""+n):o.hasBooleanValue||o.hasOverloadedBooleanValue&&!0===n?e.setAttribute(i,""):e.setAttribute(i,""+n)}}}else if(r.isCustomAttribute(t))return void l.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){u(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=r.properties.hasOwnProperty(t)?r.properties[t]:null;if(n){var o=n.mutationMethod;if(o)o(e,void 0);else if(n.mustUseProperty){var a=n.propertyName;n.hasBooleanValue?e[a]=!1:e[a]=""}else e.removeAttribute(n.attributeName)}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};e.exports=l},function(e,t,n){"use strict";var r=n(40),o=n(271),a=n(42),i=n(82),s=(n(33),!1);function u(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this._wrapperState.pendingUpdate=!1;var e=this._currentElement.props,t=o.getValue(e);null!=t&&c(this,Boolean(e.multiple),t)}}function c(e,t,n){var r,o,i=a.getNodeFromInstance(e).options;if(t){for(r={},o=0;o<n.length;o++)r[""+n[o]]=!0;for(o=0;o<i.length;o++){var s=r.hasOwnProperty(i[o].value);i[o].selected!==s&&(i[o].selected=s)}}else{for(r=""+n,o=0;o<i.length;o++)if(i[o].value===r)return void(i[o].selected=!0);i.length&&(i[0].selected=!0)}}var l={getHostProps:function(e,t){return r({},t,{onChange:e._wrapperState.onChange,value:void 0})},mountWrapper:function(e,t){var n=o.getValue(t);e._wrapperState={pendingUpdate:!1,initialValue:null!=n?n:t.defaultValue,listeners:null,onChange:p.bind(e),wasMultiple:Boolean(t.multiple)},void 0===t.value||void 0===t.defaultValue||s||(s=!0)},getSelectValueContext:function(e){return e._wrapperState.initialValue},postUpdateWrapper:function(e){var t=e._currentElement.props;e._wrapperState.initialValue=void 0;var n=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=Boolean(t.multiple);var r=o.getValue(t);null!=r?(e._wrapperState.pendingUpdate=!1,c(e,Boolean(t.multiple),r)):n!==Boolean(t.multiple)&&(null!=t.defaultValue?c(e,Boolean(t.multiple),t.defaultValue):c(e,Boolean(t.multiple),t.multiple?[]:""))}};function p(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return this._rootNodeID&&(this._wrapperState.pendingUpdate=!0),i.asap(u,this),n}e.exports=l},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(950),i=n(481),s=n(482),u=(n(951),n(25),n(33),function(e){this.construct(e)});function c(e,t){var n;if(null===e||!1===e)n=i.create(c);else if("object"==typeof e){var o=e,a=o.type;if("function"!=typeof a&&"string"!=typeof a){var l="";0,l+=function(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}(o._owner),r("130",null==a?a:typeof a,l)}"string"==typeof o.type?n=s.createInternalComponent(o):!function(e){return"function"==typeof e&&void 0!==e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}(o.type)?n=new u(o):(n=new o.type(o)).getHostNode||(n.getHostNode=n.getNativeNode)}else"string"==typeof e||"number"==typeof e?n=s.createInstanceForText(e):r("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}o(u.prototype,a,{_instantiateReactComponent:c}),e.exports=c},function(e,t,n){"use strict";var r=n(31),o=n(126),a=(n(25),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||!1===e?a.EMPTY:o.isValidElement(e)?"function"==typeof e.type?a.COMPOSITE:a.HOST:void r("26",e)}});e.exports=a},function(e,t,n){"use strict";var r,o={injectEmptyComponentFactory:function(e){r=e}},a={create:function(e){return r(e)}};a.injection=o,e.exports=a},function(e,t,n){"use strict";var r=n(31),o=(n(25),null),a=null;var i={createInternalComponent:function(e){return o||r("111",e.type),new o(e)},createInstanceForText:function(e){return new a(e)},isTextComponent:function(e){return e instanceof a},injection:{injectGenericComponentClass:function(e){o=e},injectTextComponentClass:function(e){a=e}}};e.exports=i},function(e,t,n){"use strict";var r=n(31),o=(n(89),n(952)),a=n(953),i=(n(25),n(275));n(33);function s(e,t){return e&&"object"==typeof e&&null!=e.key?i.escape(e.key):t.toString(36)}function u(e,t,n,c){var l,p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===o)return n(c,e,""===t?"."+s(e,0):t),1;var f=0,h=""===t?".":t+":";if(Array.isArray(e))for(var d=0;d<e.length;d++)f+=u(l=e[d],h+s(l,d),n,c);else{var v=a(e);if(v){var m,g=v.call(e);if(v!==e.entries)for(var y=0;!(m=g.next()).done;)f+=u(l=m.value,h+s(l,y++),n,c);else for(;!(m=g.next()).done;){var b=m.value;b&&(f+=u(l=b[1],h+i.escape(b[0])+":"+s(l,0),n,c))}}else if("object"===p){var _=String(e);r("31","[object Object]"===_?"object with keys {"+Object.keys(e).join(", ")+"}":_,"")}}return f}e.exports=function(e,t,n){return null==e?0:u(e,"",t,n)}},function(e,t,n){"use strict";var r,o,a,i,s,u,c,l=n(155),p=n(89);n(25),n(33);function f(e){var t=Function.prototype.toString,n=Object.prototype.hasOwnProperty,r=RegExp("^"+t.call(n).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");try{var o=t.call(e);return r.test(o)}catch(e){return!1}}if("function"==typeof Array.from&&"function"==typeof Map&&f(Map)&&null!=Map.prototype&&"function"==typeof Map.prototype.keys&&f(Map.prototype.keys)&&"function"==typeof Set&&f(Set)&&null!=Set.prototype&&"function"==typeof Set.prototype.keys&&f(Set.prototype.keys)){var h=new Map,d=new Set;r=function(e,t){h.set(e,t)},o=function(e){return h.get(e)},a=function(e){h.delete(e)},i=function(){return Array.from(h.keys())},s=function(e){d.add(e)},u=function(e){d.delete(e)},c=function(){return Array.from(d.keys())}}else{var v={},m={},g=function(e){return"."+e},y=function(e){return parseInt(e.substr(1),10)};r=function(e,t){var n=g(e);v[n]=t},o=function(e){var t=g(e);return v[t]},a=function(e){var t=g(e);delete v[t]},i=function(){return Object.keys(v).map(y)},s=function(e){var t=g(e);m[t]=!0},u=function(e){var t=g(e);delete m[t]},c=function(){return Object.keys(m).map(y)}}var b=[];function _(e){var t=o(e);if(t){var n=t.childIDs;a(e),n.forEach(_)}}function w(e,t,n){return"\n    in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")}function E(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type.displayName||e.type.name||"Unknown"}function x(e){var t,n=C.getDisplayName(e),r=C.getElement(e),o=C.getOwnerID(e);return o&&(t=C.getDisplayName(o)),w(n,r&&r._source,t)}var C={onSetChildren:function(e,t){var n=o(e);n||l("144"),n.childIDs=t;for(var r=0;r<t.length;r++){var a=t[r],i=o(a);i||l("140"),null==i.childIDs&&"object"==typeof i.element&&null!=i.element&&l("141"),i.isMounted||l("71"),null==i.parentID&&(i.parentID=e),i.parentID!==e&&l("142",a,i.parentID,e)}},onBeforeMountComponent:function(e,t,n){r(e,{element:t,parentID:n,text:null,childIDs:[],isMounted:!1,updateCount:0})},onBeforeUpdateComponent:function(e,t){var n=o(e);n&&n.isMounted&&(n.element=t)},onMountComponent:function(e){var t=o(e);t||l("144"),t.isMounted=!0,0===t.parentID&&s(e)},onUpdateComponent:function(e){var t=o(e);t&&t.isMounted&&t.updateCount++},onUnmountComponent:function(e){var t=o(e);t&&(t.isMounted=!1,0===t.parentID&&u(e));b.push(e)},purgeUnmountedComponents:function(){if(!C._preventPurging){for(var e=0;e<b.length;e++){_(b[e])}b.length=0}},isMounted:function(e){var t=o(e);return!!t&&t.isMounted},getCurrentStackAddendum:function(e){var t="";if(e){var n=E(e),r=e._owner;t+=w(n,e._source,r&&r.getName())}var o=p.current,a=o&&o._debugID;return t+=C.getStackAddendumByID(a)},getStackAddendumByID:function(e){for(var t="";e;)t+=x(e),e=C.getParentID(e);return t},getChildIDs:function(e){var t=o(e);return t?t.childIDs:[]},getDisplayName:function(e){var t=C.getElement(e);return t?E(t):null},getElement:function(e){var t=o(e);return t?t.element:null},getOwnerID:function(e){var t=C.getElement(e);return t&&t._owner?t._owner._debugID:null},getParentID:function(e){var t=o(e);return t?t.parentID:null},getSource:function(e){var t=o(e),n=t?t.element:null;return null!=n?n._source:null},getText:function(e){var t=C.getElement(e);return"string"==typeof t?t:"number"==typeof t?""+t:null},getUpdateCount:function(e){var t=o(e);return t?t.updateCount:0},getRootIDs:c,getRegisteredIDs:i,pushNonStandardWarningStack:function(e,t){if("function"==typeof console.reactStack){var n=[],r=p.current,o=r&&r._debugID;try{for(e&&n.push({name:o?C.getDisplayName(o):null,fileName:t?t.fileName:null,lineNumber:t?t.lineNumber:null});o;){var a=C.getElement(o),i=C.getParentID(o),s=C.getOwnerID(o),u=s?C.getDisplayName(s):null,c=a&&a._source;n.push({name:u,fileName:c?c.fileName:null,lineNumber:c?c.lineNumber:null}),o=i}}catch(e){}console.reactStack(n)}},popNonStandardWarningStack:function(){"function"==typeof console.reactStackEnd&&console.reactStackEnd()}};e.exports=C},function(e,t,n){"use strict";var r=n(81),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};e.exports=o},function(e,t,n){"use strict";var r=n(965),o=n(967),a=n(475),i=n(487);var s={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=i();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t,n=i(),r=e.focusedElem,u=e.selectionRange;n!==r&&(t=r,o(document.documentElement,t))&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,u),a(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if(void 0===o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&e.nodeName&&"input"===e.nodeName.toLowerCase()){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",o-n),a.select()}else r.setOffsets(e,t)}};e.exports=s},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=n(31),o=n(139),a=n(137),i=n(126),s=n(202),u=(n(89),n(42)),c=n(982),l=n(983),p=n(470),f=n(165),h=(n(75),n(984)),d=n(138),v=n(276),m=n(82),g=n(179),y=n(479),b=(n(25),n(200)),_=n(274),w=(n(33),a.ID_ATTRIBUTE_NAME),E=a.ROOT_ATTRIBUTE_NAME,x={};function C(e){return e?9===e.nodeType?e.documentElement:e.firstChild:null}function S(e,t,n,r,o){var a;if(p.logTopLevelRenders){var i=e._currentElement.props.child.type;a="React mount: "+("string"==typeof i?i:i.displayName||i.name),console.time(a)}var s=d.mountComponent(e,n,null,c(e,t),o,0);a&&console.timeEnd(a),e._renderedComponent._topLevelWrapper=e,N._mountImageIntoNode(s,t,e,r,n)}function A(e,t,n,r){var o=m.ReactReconcileTransaction.getPooled(!n&&l.useCreateElement);o.perform(S,null,e,t,o,n,r),m.ReactReconcileTransaction.release(o)}function k(e,t,n){for(0,d.unmountComponent(e,n),9===t.nodeType&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function O(e){var t=C(e);if(t){var n=u.getInstanceFromNode(t);return!(!n||!n._hostParent)}}function j(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function T(e){var t=function(e){var t=C(e),n=t&&u.getInstanceFromNode(t);return n&&!n._hostParent?n:null}(e);return t?t._hostContainerInfo._topLevelWrapper:null}var I=1,P=function(){this.rootID=I++};P.prototype.isReactComponent={},P.prototype.render=function(){return this.props.child},P.isReactTopLevelWrapper=!0;var N={TopLevelWrapper:P,_instancesByReactRootID:x,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r,o){return N.scrollMonitor(r,(function(){v.enqueueElementInternal(e,t,n),o&&v.enqueueCallbackInternal(e,o)})),e},_renderNewRootComponent:function(e,t,n,o){j(t)||r("37"),s.ensureScrollValueMonitoring();var a=y(e,!1);m.batchedUpdates(A,a,t,n,o);var i=a._instance.rootID;return x[i]=a,a},renderSubtreeIntoContainer:function(e,t,n,o){return null!=e&&f.has(e)||r("38"),N._renderSubtreeIntoContainer(e,t,n,o)},_renderSubtreeIntoContainer:function(e,t,n,o){v.validateCallback(o,"ReactDOM.render"),i.isValidElement(t)||r("39","string"==typeof t?" Instead of passing a string like 'div', pass React.createElement('div') or <div />.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />.":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,s=i.createElement(P,{child:t});if(e){var u=f.get(e);a=u._processChildContext(u._context)}else a=g;var c=T(n);if(c){var l=c._currentElement.props.child;if(_(l,t)){var p=c._renderedComponent.getPublicInstance(),h=o&&function(){o.call(p)};return N._updateRootComponent(c,s,a,n,h),p}N.unmountComponentAtNode(n)}var d,m=C(n),y=m&&!(!(d=m).getAttribute||!d.getAttribute(w)),b=O(n),E=y&&!c&&!b,x=N._renderNewRootComponent(s,n,E,a)._renderedComponent.getPublicInstance();return o&&o.call(x),x},render:function(e,t,n){return N._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){j(e)||r("40");var t=T(e);if(!t){O(e),1===e.nodeType&&e.hasAttribute(E);return!1}return delete x[t._instance.rootID],m.batchedUpdates(k,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,a,i){if(j(t)||r("41"),a){var s=C(t);if(h.canReuseMarkup(e,s))return void u.precacheNode(n,s);var c=s.getAttribute(h.CHECKSUM_ATTR_NAME);s.removeAttribute(h.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(h.CHECKSUM_ATTR_NAME,c);var p=e,f=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}(p,l),d=" (client) "+p.substring(f-20,f+20)+"\n (server) "+l.substring(f-20,f+20);9===t.nodeType&&r("42",d)}if(9===t.nodeType&&r("43"),i.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);o.insertTreeBefore(t,e,null)}else b(t,e),u.precacheNode(n,t.firstChild)}};e.exports=N},function(e,t,n){"use strict";var r=n(480);e.exports=function(e){for(var t;(t=e._renderedNodeType)===r.COMPOSITE;)e=e._renderedComponent;return t===r.HOST?e._renderedComponent:t===r.EMPTY?null:void 0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(11),a=(r=o)&&r.__esModule?r:{default:r};t.default=a.default.shape({subscribe:a.default.func.isRequired,dispatch:a.default.func.isRequired,getState:a.default.func.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){var r=n(244),o=n(996),a=n(197),i=n(997),s=n(998),u=n(1001),c=n(1002),l=n(1003),p=n(1004),f=n(416),h=n(495),d=n(190),v=n(1005),m=n(1006),g=n(1011),y=n(55),b=n(248),_=n(1013),w=n(59),E=n(1015),x=n(114),C="[object Arguments]",S="[object Function]",A="[object Object]",k={};k[C]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[A]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[S]=k["[object WeakMap]"]=!1,e.exports=function e(t,n,O,j,T,I){var P,N=1&n,M=2&n,R=4&n;if(O&&(P=T?O(t,j,T,I):O(t)),void 0!==P)return P;if(!w(t))return t;var D=y(t);if(D){if(P=v(t),!N)return c(t,P)}else{var L=d(t),B=L==S||"[object GeneratorFunction]"==L;if(b(t))return u(t,N);if(L==A||L==C||B&&!T){if(P=M||B?{}:g(t),!N)return M?p(t,s(P,t)):l(t,i(P,t))}else{if(!k[L])return T?t:{};P=m(t,L,N)}}I||(I=new r);var F=I.get(t);if(F)return F;I.set(t,P),E(t)?t.forEach((function(r){P.add(e(r,n,O,r,t,I))})):_(t)&&t.forEach((function(r,o){P.set(o,e(r,n,O,o,t,I))}));var U=R?M?h:f:M?keysIn:x,q=D?void 0:U(t);return o(q||t,(function(r,o){q&&(r=t[o=r]),a(P,o,e(r,n,O,o,t,I))})),P}},function(e,t,n){var r=n(419),o=n(999),a=n(129);e.exports=function(e){return a(e)?r(e,!0):o(e)}},function(e,t,n){var r=n(245),o=n(279),a=n(246),i=n(418),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:i;e.exports=s},function(e,t,n){var r=n(417),o=n(494),a=n(493);e.exports=function(e){return r(e,a,o)}},function(e,t,n){var r=n(1021),o=n(497),a=n(498);e.exports=function(e){return a(o(e,void 0,r),e+"")}},function(e,t,n){var r=n(1024),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,s=o(a.length-t,0),u=Array(s);++i<s;)u[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(u),r(e,this,c)}}},function(e,t,n){var r=n(1025),o=n(1027)(r);e.exports=o},function(e,t,n){"use strict";var r=String.prototype.replace,o=/%20/g,a=n(281),i={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=a.assign({default:i.RFC3986,formatters:{RFC1738:function(e){return r.call(e,o,"+")},RFC3986:function(e){return String(e)}}},i)},function(e,t,n){"use strict";var r=n(24),o=n(41),a=n(204),i=n(36),s=n(70),u=n(119),c=n(134),l=n(44),p=n(87),f=n(63).f,h=n(88).forEach,d=n(48),v=n(73),m=v.set,g=v.getterFor;e.exports=function(e,t,n){var v,y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),_=y?"set":"add",w=o[e],E=w&&w.prototype,x={};if(d&&"function"==typeof w&&(b||E.forEach&&!i((function(){(new w).entries().next()})))){v=t((function(t,n){m(c(t,v,e),{type:e,collection:new w}),null!=n&&u(n,t[_],t,y)}));var C=g(e);h(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(e){var t="add"==e||"set"==e;!(e in E)||b&&"clear"==e||s(v.prototype,e,(function(n,r){var o=C(this).collection;if(!t&&b&&!l(n))return"get"==e&&void 0;var a=o[e](0===n?0:n,r);return t?this:a}))})),b||f(v.prototype,"size",{configurable:!0,get:function(){return C(this).collection.size}})}else v=n.getConstructor(t,e,y,_),a.REQUIRED=!0;return p(v,e,!1,!0),x[e]=v,r({global:!0,forced:!0},x),b||n.setStrong(v,e,y),v}},function(e,t,n){var r=n(36),o=n(39),a=n(95),i=o("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},function(e,t,n){"use strict";n(176);var r=n(24),o=n(71),a=n(501),i=n(110),s=n(158),u=n(87),c=n(365),l=n(73),p=n(134),f=n(52),h=n(107),d=n(97),v=n(54),m=n(44),g=n(108),y=n(105),b=n(402),_=n(156),w=n(39),E=o("fetch"),x=o("Headers"),C=w("iterator"),S="URLSearchParams",A="URLSearchParamsIterator",k=l.set,O=l.getterFor(S),j=l.getterFor(A),T=/\+/g,I=Array(4),P=function(e){return I[e-1]||(I[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},N=function(e){try{return decodeURIComponent(e)}catch(t){return e}},M=function(e){var t=e.replace(T," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(P(n--),N);return t}},R=/[!'()~]|%20/g,D={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},L=function(e){return D[e]},B=function(e){return encodeURIComponent(e).replace(R,L)},F=function(e,t){if(t)for(var n,r,o=t.split("&"),a=0;a<o.length;)(n=o[a++]).length&&(r=n.split("="),e.push({key:M(r.shift()),value:M(r.join("="))}))},U=function(e){this.entries.length=0,F(this.entries,e)},q=function(e,t){if(e<t)throw TypeError("Not enough arguments")},z=c((function(e,t){k(this,{type:A,iterator:b(O(e).entries),kind:t})}),"Iterator",(function(){var e=j(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),V=function(){p(this,V,S);var e,t,n,r,o,a,i,s,u,c=arguments.length>0?arguments[0]:void 0,l=this,h=[];if(k(l,{type:S,entries:h,updateURL:function(){},updateSearchParams:U}),void 0!==c)if(m(c))if("function"==typeof(e=_(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((i=(a=(o=b(v(r.value))).next).call(o)).done||(s=a.call(o)).done||!a.call(o).done)throw TypeError("Expected sequence with length 2");h.push({key:i.value+"",value:s.value+""})}else for(u in c)f(c,u)&&h.push({key:u,value:c[u]+""});else F(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},W=V.prototype;s(W,{append:function(e,t){q(arguments.length,2);var n=O(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){q(arguments.length,1);for(var t=O(this),n=t.entries,r=e+"",o=0;o<n.length;)n[o].key===r?n.splice(o,1):o++;t.updateURL()},get:function(e){q(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){q(arguments.length,1);for(var t=O(this).entries,n=e+"",r=[],o=0;o<t.length;o++)t[o].key===n&&r.push(t[o].value);return r},has:function(e){q(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){q(arguments.length,1);for(var n,r=O(this),o=r.entries,a=!1,i=e+"",s=t+"",u=0;u<o.length;u++)(n=o[u]).key===i&&(a?o.splice(u--,1):(a=!0,n.value=s));a||o.push({key:i,value:s}),r.updateURL()},sort:function(){var e,t,n,r=O(this),o=r.entries,a=o.slice();for(o.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===n&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,n=O(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),o=0;o<n.length;)r((t=n[o++]).value,t.key,this)},keys:function(){return new z(this,"keys")},values:function(){return new z(this,"values")},entries:function(){return new z(this,"entries")}},{enumerable:!0}),i(W,C,W.entries),i(W,"toString",(function(){for(var e,t=O(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(B(e.key)+"="+B(e.value));return n.join("&")}),{enumerable:!0}),u(V,S),r({global:!0,forced:!a},{URLSearchParams:V}),a||"function"!=typeof E||"function"!=typeof x||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,o=[e];return arguments.length>1&&(m(t=arguments[1])&&(n=t.body,d(n)===S&&((r=t.headers?new x(t.headers):new x).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:y(0,String(n)),headers:y(0,r)}))),o.push(t)),E.apply(this,o)}}),e.exports={URLSearchParams:V,getState:O}},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(53))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineReducers=void 0;var r,o=n(622),a=(r=o)&&r.__esModule?r:{default:r};t.combineReducers=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeUrl=void 0;var r=/^(%20|\s)*(javascript|data|vbscript)/im,o=/[^\x20-\x7EÀ-ž]/gim,a=/^([^:]+):/gm,i=[".","/"];t.sanitizeUrl=function(e){if(!e)return"about:blank";var t=e.replace(o,"").trim();if(function(e){return i.indexOf(e[0])>-1}(t))return t;var n=t.match(a);if(!n)return t;var s=n[0];return r.test(s)?"about:blank":t}},function(e,t,n){var r=n(678),o=n(686)((function(e,t,n){return t=t.toLowerCase(),e+(n?r(t):t)}));e.exports=o},function(e,t,n){(function(t){var r=n(760),o=n(761).Stream;function a(e,t,n){n=n||0;var o,i,s=(o=t,new Array(n||0).join(o||"")),u=e;if("object"==typeof e&&((u=e[i=Object.keys(e)[0]])&&u._elem))return u._elem.name=i,u._elem.icount=n,u._elem.indent=t,u._elem.indents=s,u._elem.interrupt=u,u._elem;var c,l=[],p=[];function f(e){Object.keys(e).forEach((function(t){l.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))}))}switch(typeof u){case"object":if(null===u)break;u._attr&&f(u._attr),u._cdata&&p.push(("<![CDATA["+u._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),u.forEach&&(c=!1,p.push(""),u.forEach((function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?f(e._attr):p.push(a(e,t,n+1)):(p.pop(),c=!0,p.push(r(e)))})),c||p.push(""));break;default:p.push(r(u))}return{name:i,interrupt:!1,attributes:l,content:p,icount:n,indents:s,indent:t}}function i(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt?1:t.content.length;function o(){for(;t.content.length;){var o=t.content.shift();if(void 0!==o){if(a(o))return;i(e,o)}}e(!1,(r>1?t.indents:"")+(t.name?"</"+t.name+">":"")+(t.indent&&!n?"\n":"")),n&&n()}function a(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=o,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(r?t.name?">":"":t.name?"/>":"")+(t.indent&&r>1?"\n":"")),!r)return e(!1,t.indent?"\n":"");a(t)||o()}e.exports=function(e,n){"object"!=typeof n&&(n={indent:n});var r,s,u=n.stream?new o:null,c="",l=!1,p=n.indent?!0===n.indent?"    ":n.indent:"",f=!0;function h(e){f?t.nextTick(e):e()}function d(e,t){if(void 0!==t&&(c+=t),e&&!l&&(u=u||new o,l=!0),e&&l){var n=c;h((function(){u.emit("data",n)})),c=""}}function v(e,t){i(d,a(e,p,p?1:0),t)}function m(){if(u){var e=c;h((function(){u.emit("data",e),u.emit("end"),u.readable=!1,u.emit("close")}))}}return h((function(){f=!1})),n.declaration&&(r=n.declaration,s={version:"1.0",encoding:r.encoding||"UTF-8"},r.standalone&&(s.standalone=r.standalone),v({"?xml":{_attr:s}}),c=c.replace("/>","?>")),e&&e.forEach?e.forEach((function(t,n){var r;n+1===e.length&&(r=m),v(t,r)})):v(e,m),u?(u.readable=!0,u):c},e.exports.element=e.exports.Element=function(){var e=Array.prototype.slice.call(arguments),t={_elem:a(e),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,n=this._elem.indent;i(this.append,a(e,n,this._elem.icount+(n?1:0)),(function(){t.append(!0)}))},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return t}}).call(this,n(91))},function(e,t,n){(function(t){var n;n=void 0!==t?t:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),r=n.length,o=-1,a="",i=n.charCodeAt(0);++o<r;)0!=(t=n.charCodeAt(o))?a+=t>=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==i?"\\"+t.toString(16)+" ":0==o&&1==r&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):a+="�";return a};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)}).call(this,n(53))},function(e,t,n){"use strict";(function(t,r){var o=65536,a=4294967295;var i=n(66).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>a)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(e);if(e>0)if(e>o)for(var u=0;u<e;u+=o)s.getRandomValues(n.slice(u,u+o));else s.getRandomValues(n);if("function"==typeof t)return r.nextTick((function(){t(null,n)}));return n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(53),n(91))},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(825),t.sha1=n(826),t.sha224=n(827),t.sha256=n(443),t.sha384=n(828),t.sha512=n(444)},function(e,t,n){var r=n(410),o=n(427),a=n(186),i=n(833),s=n(55);e.exports=function(e,t,n){var u=s(e)?r:i,c=arguments.length<3;return u(e,a(t,4),n,c,o)}},function(e,t,n){var r=n(59),o=n(894),a=n(426),i=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,p,f,h,d=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,d=t,p=e.apply(r,n)}function b(e){return d=e,f=setTimeout(w,t),v?y(e):p}function _(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-d>=l}function w(){var e=o();if(_(e))return E(e);f=setTimeout(w,function(e){var n=t-(e-h);return m?s(n,l-(e-d)):n}(e))}function E(e){return f=void 0,g&&u?y(e):(u=c=void 0,p)}function x(){var e=o(),n=_(e);if(u=arguments,c=this,h=e,n){if(void 0===f)return b(h);if(m)return clearTimeout(f),f=setTimeout(w,t),y(h)}return void 0===f&&(f=setTimeout(w,t)),p}return t=a(t)||0,r(n)&&(v=!!n.leading,l=(m="maxWait"in n)?i(a(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==f&&clearTimeout(f),d=0,u=h=c=f=void 0},x.flush=function(){return void 0===f?p:E(o())},x}},function(e,t,n){"use strict";e.exports=n(913)},function(e,t,n){var r=n(407),o=n(492),a=n(1017),i=n(130),s=n(140),u=n(1020),c=n(496),l=n(495),p=c((function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,(function(t){return t=i(t,e),c||(c=t.length>1),t})),s(e,l(e),n),c&&(n=o(n,7,u));for(var p=t.length;p--;)a(n,t[p]);return n}));e.exports=p},function(e,t,n){e.exports=n(1028)},function(e,t,n){var r=n(445),o=n(1038),a=n(1042);function i(t,n,s){return"undefined"!=typeof Reflect&&o?e.exports=i=o:e.exports=i=function(e,t,n){var o=a(e,t);if(o){var i=r(o,t);return i.get?i.get.call(n):i.value}},i(t,n,s||t)}e.exports=i},function(e,t){e.exports=window.FormData},function(e,t,n){e.exports=n(1043)},function(e,t,n){var r=n(492);e.exports=function(e){return r(e,5)}},function(e,t,n){e.exports=n(1049)},function(e,t){var n=function(e){function t(){this.fetch=!1,this.DOMException=e.DOMException}return t.prototype=e,new t}("undefined"!=typeof self?self:this);!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,i="ArrayBuffer"in e;if(i)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];w.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function x(e,n){return new Promise((function(r,a){var i=new b(e,n);if(i.signal&&i.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",u)}),s.send(void 0===i._bodyInit?null:i._bodyInit)}))}x.polyfill=!0,e.fetch||(e.fetch=x,e.Headers=f,e.Request=b,e.Response=w),t.Headers=f,t.Request=b,t.Response=w,t.fetch=x}({})}(n),delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},function(e,t){var n=e.exports=function(e){return new r(e)};function r(e){this.value=e}function o(e,t,n){var r=[],o=[],s=!0;return function e(p){var f=n?a(p):p,h={},d=!0,v={node:f,node_:p,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){v.isRoot||(v.parent.node[v.key]=e),v.node=e,t&&(d=!1)},delete:function(e){delete v.parent.node[v.key],e&&(d=!1)},remove:function(e){u(v.parent.node)?v.parent.node.splice(v.key,1):delete v.parent.node[v.key],e&&(d=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){s=!1},block:function(){d=!1}};if(!s)return v;function m(){if("object"==typeof v.node&&null!==v.node){v.keys&&v.node_===v.node||(v.keys=i(v.node)),v.isLeaf=0==v.keys.length;for(var e=0;e<o.length;e++)if(o[e].node_===p){v.circular=o[e];break}}else v.isLeaf=!0,v.keys=null;v.notLeaf=!v.isLeaf,v.notRoot=!v.isRoot}m();var g=t.call(v,v.node);return void 0!==g&&v.update&&v.update(g),h.before&&h.before.call(v,v.node),d?("object"!=typeof v.node||null===v.node||v.circular||(o.push(v),m(),c(v.keys,(function(t,o){r.push(t),h.pre&&h.pre.call(v,v.node[t],t);var a=e(v.node[t]);n&&l.call(v.node,t)&&(v.node[t]=a.node),a.isLast=o==v.keys.length-1,a.isFirst=0==o,h.post&&h.post.call(v,a),r.pop()})),o.pop()),h.after&&h.after.call(v,v.node),v):v}(e).node}function a(e){if("object"==typeof e&&null!==e){var t;if(u(e))t=[];else if("[object Date]"===s(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===s(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===s(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===s(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===s(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===s(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return c(i(e),(function(n){t[n]=e[n]})),t}return e}r.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r)){t=void 0;break}t=t[r]}return t},r.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!l.call(t,r))return!1;t=t[r]}return!0},r.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];l.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},r.prototype.map=function(e){return o(this.value,e,!0)},r.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},r.prototype.reduce=function(e,t){var n=1===arguments.length,r=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(r=e.call(this,r,t))})),r},r.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},r.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},r.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if("object"==typeof r&&null!==r){var s=a(r);return e.push(r),t.push(s),c(i(r),(function(e){s[e]=n(r[e])})),e.pop(),t.pop(),s}return r}(this.value)};var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function s(e){return Object.prototype.toString.call(e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};c(i(r.prototype),(function(e){n[e]=function(t){var n=[].slice.call(arguments,1),o=new r(t);return o[e].apply(o,n)}}));var l=Object.hasOwnProperty||function(e,t){return t in e}},function(e,t,n){"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},i=e.split(a),u=o.decode||r,c=0;c<i.length;c++){var l=i[c],p=l.indexOf("=");if(!(p<0)){var f=l.substr(0,p).trim(),h=l.substr(++p,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),null==n[f]&&(n[f]=s(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},a=r.encode||o;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var s=a(t);if(s&&!i.test(s))throw new TypeError("argument val is invalid");var u=e+"="+s;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(c)}if(r.domain){if(!i.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!i.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,o=encodeURIComponent,a=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){var r,o,a;o=[],r=function(){"use strict";var e=function(e){return e&&"getComputedStyle"in window&&"smooth"===window.getComputedStyle(e)["scroll-behavior"]};if("undefined"==typeof window||!("document"in window))return{};var t=function(t,n,r){var o;n=n||999,r||0===r||(r=9);var a=function(e){o=e},i=function(){clearTimeout(o),a(0)},s=function(e){return Math.max(0,t.getTopOf(e)-r)},u=function(r,o,s){if(i(),0===o||o&&o<0||e(t.body))t.toY(r),s&&s();else{var u=t.getY(),c=Math.max(0,r)-u,l=(new Date).getTime();o=o||Math.min(Math.abs(c),n),function e(){a(setTimeout((function(){var n=Math.min(1,((new Date).getTime()-l)/o),r=Math.max(0,Math.floor(u+c*(n<.5?2*n*n:n*(4-2*n)-1)));t.toY(r),n<1&&t.getHeight()+r<t.body.scrollHeight?e():(setTimeout(i,99),s&&s())}),9))}()}},c=function(e,t,n){u(s(e),t,n)},l=function(e,n,o){var a=e.getBoundingClientRect().height,i=t.getTopOf(e)+a,l=t.getHeight(),p=t.getY(),f=p+l;s(e)<p||a+r>l?c(e,n,o):i+r>f?u(i-l+r,n,o):o&&o()},p=function(e,n,r,o){u(Math.max(0,t.getTopOf(e)-t.getHeight()/2+(r||e.getBoundingClientRect().height/2)),n,o)};return{setup:function(e,t){return(0===e||e)&&(n=e),(0===t||t)&&(r=t),{defaultDuration:n,edgeOffset:r}},to:c,toY:u,intoView:l,center:p,stop:i,moving:function(){return!!o},getY:t.getY,getTopOf:t.getTopOf}},n=document.documentElement,r=function(){return window.scrollY||n.scrollTop},o=t({body:document.scrollingElement||document.body,toY:function(e){window.scrollTo(0,e)},getY:r,getHeight:function(){return window.innerHeight||n.clientHeight},getTopOf:function(e){return e.getBoundingClientRect().top+r()-n.offsetTop}});if(o.createScroller=function(e,r,o){return t({body:e,toY:function(t){e.scrollTop=t},getY:function(){return e.scrollTop},getHeight:function(){return Math.min(e.clientHeight,window.innerHeight||n.clientHeight)},getTopOf:function(e){return e.offsetTop}},r,o)},"addEventListener"in window&&!window.noZensmooth&&!e(document.body)){var a="history"in window&&"pushState"in history,i=a&&"scrollRestoration"in history;i&&(history.scrollRestoration="auto"),window.addEventListener("load",(function(){i&&(setTimeout((function(){history.scrollRestoration="manual"}),9),window.addEventListener("popstate",(function(e){e.state&&"zenscrollY"in e.state&&o.toY(e.state.zenscrollY)}),!1)),window.location.hash&&setTimeout((function(){var e=o.setup().edgeOffset;if(e){var t=document.getElementById(window.location.href.split("#")[1]);if(t){var n=Math.max(0,o.getTopOf(t)-e),r=o.getY()-n;0<=r&&r<9&&window.scrollTo(0,n)}}}),9)}),!1);var s=new RegExp("(^|\\s)noZensmooth(\\s|$)");window.addEventListener("click",(function(e){for(var t=e.target;t&&"A"!==t.tagName;)t=t.parentNode;if(!(!t||1!==e.which||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)){if(i){var n=history.state&&"object"==typeof history.state?history.state:{};n.zenscrollY=o.getY();try{history.replaceState(n,"")}catch(e){}}var r=t.getAttribute("href")||"";if(0===r.indexOf("#")&&!s.test(t.className)){var u=0,c=document.getElementById(r.substring(1));if("#"!==r){if(!c)return;u=o.getTopOf(c)}e.preventDefault();var l=function(){window.location=r},p=o.setup().edgeOffset;p&&(u=Math.max(0,u-p),a&&(l=function(){history.pushState({},"",r)})),o.toY(u,null,l)}}}),!1)}return o}(),void 0===(a="function"==typeof r?r.apply(t,o):r)||(e.exports=a)},function(e,t,n){e.exports=n(1069)},function(e,t,n){var r=n(1079);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){e.exports=function(e){var t={literal:"true false null"},n=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],r=[e.QUOTE_STRING_MODE,e.C_NUMBER_MODE],o={end:",",endsWithParent:!0,excludeEnd:!0,contains:r,keywords:t},a={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE],illegal:"\\n"},e.inherit(o,{begin:/:/})].concat(n),illegal:"\\S"},i={begin:"\\[",end:"\\]",contains:[e.inherit(o)],illegal:"\\S"};return r.push(a,i),n.forEach((function(e){r.push(e)})),{name:"JSON",contains:r,keywords:t,illegal:"\\S"}}},function(e,t){const n="[A-Za-z$_][0-9A-Za-z$_]*",r=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],o=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function i(e){return s("(?=",e,")")}function s(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}e.exports=function(e){var t=n,u="<>",c="</>",l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},p={$pattern:n,keyword:r.join(" "),literal:o.join(" "),built_in:a.join(" ")},f={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:p,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},v={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]};h.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,v,m,f,e.REGEXP_MODE];var g=h.contains.concat([{begin:/\(/,end:/\)/,contains:["self"].concat(h.contains,[e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE])},e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:g};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:p,contains:[e.SHEBANG({binary:"node",relevance:5}),{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,v,m,e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,f,{begin:s(/[{,\n]\s*/,i(s(/(((\/\/.*)|(\/\*(.|\n)*\*\/))\s*)*/,t+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:t+i("\\s*:"),relevance:0}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,contains:g}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:u,end:c},{begin:l.begin,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:t}),y],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+t+"\\()",end:/{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:t}),{begin:/\(\)/},y]}],illegal:/#(?!!)/}}},function(e,t){e.exports=function(e){var t={className:"symbol",begin:"&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;"},n={begin:"\\s",contains:[{className:"meta-keyword",begin:"#?[a-z_][a-z1-9_-]+",illegal:"\\n"}]},r=e.inherit(n,{begin:"\\(",end:"\\)"}),o=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),i={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[t]},{begin:/'/,end:/'/,contains:[t]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"<![a-z]",end:">",relevance:10,contains:[n,a,o,r,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"<![a-z]",end:">",contains:[n,r,a,o]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:"<style(?=\\s|>)",end:">",keywords:{name:"style"},contains:[i],starts:{end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"<script(?=\\s|>)",end:">",keywords:{name:"script"},contains:[i],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},i]}]}}},function(e,t){e.exports=function(e){var t="true false yes no null",n="[\\w#;/?:@&=+$,.~*\\'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]},o=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},i={end:",",endsWithParent:!0,excludeEnd:!0,contains:[],keywords:t,relevance:0},s={begin:"{",end:"}",contains:[i],illegal:"\\n",relevance:0},u={begin:"\\[",end:"\\]",contains:[i],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},a,{className:"number",begin:e.C_NUMBER_RE+"\\b"},s,u,r],l=[...c];return l.pop(),l.push(o),i.contains=l,{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:c}}},function(e,t){e.exports=function(e){var t="HTTP/[0-9\\.]+";return{name:"HTTP",aliases:["https"],illegal:"\\S",contains:[{begin:"^"+t,end:"$",contains:[{className:"number",begin:"\\b\\d{3}\\b"}]},{begin:"^[A-Z]+ (.*?) "+t+"$",returnBegin:!0,end:"$",contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{begin:t},{className:"keyword",begin:"[A-Z]+"}]},{className:"attribute",begin:"^\\w",end:": ",excludeEnd:!0,illegal:"\\n|\\s|=",starts:{end:"$",relevance:0}},{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}]}}},function(e,t){e.exports=function(e){const t={},n={begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},n]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,r]};r.contains.push(o);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},i=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),s={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b-?[a-z\._]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[i,e.SHEBANG(),s,a,e.HASH_COMMENT_MODE,o,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}},function(e,t){e.exports=function(e,t,n){var r=new Blob([e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var o=window.URL.createObjectURL(r),a=document.createElement("a");a.style.display="none",a.href=o,a.setAttribute("download",t),void 0===a.download&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(o)}}},function(e,t,n){e.exports=n(1084)},function(e,t,n){"use strict";var r=n(1089),o=function(e){return/<\/+[^>]+>/.test(e)},a=function(e){return/<[^>]+\/>/.test(e)};function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return""!==e.trim()})).map((function(e){return{value:e,type:s(e)}}))}function s(e){return o(e)?"ClosingTag":function(e){return function(e){return/<[^>!]+>/.test(e)}(e)&&!o(e)&&!a(e)}(e)?"OpeningTag":a(e)?"SelfClosingTag":"Text"}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.indentor,o=t.textNodesOnSameLine,a=0,s=[];n=n||"    ";var u=i(e).map((function(e,t,i){var u=e.value,c=e.type;"ClosingTag"===c&&a--;var l=r(n,a),p=l+u;if("OpeningTag"===c&&a++,o){var f=i[t-1],h=i[t-2];"ClosingTag"===c&&"Text"===f.type&&"OpeningTag"===h.type&&(p=""+l+h.value+f.value+u,s.push(t-2,t-1))}return p}));return s.forEach((function(e){return u[e]=null})),u.filter((function(e){return!!e})).join("\n")}},function(e,t,n){var r=n(93);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){e.exports=n(1093)},function(e,t,n){var r=n(542);e.exports=r},function(e,t,n){n(543);var r=n(34);r.JSON||(r.JSON={stringify:JSON.stringify}),e.exports=function(e,t,n){return r.JSON.stringify.apply(null,arguments)}},function(e,t,n){var r=n(24),o=n(71),a=n(36),i=o("JSON","stringify"),s=/[\uD800-\uDFFF]/g,u=/^[\uD800-\uDBFF]$/,c=/^[\uDC00-\uDFFF]$/,l=function(e,t,n){var r=n.charAt(t-1),o=n.charAt(t+1);return u.test(e)&&!c.test(o)||c.test(e)&&!u.test(r)?"\\u"+e.charCodeAt(0).toString(16):e},p=a((function(){return'"\\udf06\\ud834"'!==i("\udf06\ud834")||'"\\udead"'!==i("\udead")}));i&&r({target:"JSON",stat:!0,forced:p},{stringify:function(e,t,n){var r=i.apply(null,arguments);return"string"==typeof r?r.replace(s,l):r}})},function(e,t,n){var r=n(357);e.exports=r},function(e,t,n){var r=n(24),o=n(72),a=n(148);r({target:"Object",stat:!0,forced:n(36)((function(){a(1)}))},{keys:function(e){return a(o(e))}})},function(e,t,n){e.exports=n(547)},function(e,t,n){var r=n(548);e.exports=r},function(e,t,n){n(359),n(96),n(80);var r=n(227);e.exports=r.f("iterator")},function(e,t,n){var r=n(41),o=n(70);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){"use strict";var r=n(232),o=n(97);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t,n){var r=n(44);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var r=n(554);n(571),n(572),n(573),n(574),n(575),e.exports=r},function(e,t,n){n(369),n(178),n(370),n(556),n(557),n(558),n(559),n(359),n(560),n(561),n(562),n(563),n(564),n(565),n(566),n(567),n(568),n(569),n(570);var r=n(34);e.exports=r.Symbol},function(e,t,n){var r=n(69),o=n(238).f,a={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return i&&"[object Window]"==a.call(e)?function(e){try{return o(e)}catch(e){return i.slice()}}(e):o(r(e))}},function(e,t,n){n(49)("asyncIterator")},function(e,t){},function(e,t,n){n(49)("hasInstance")},function(e,t,n){n(49)("isConcatSpreadable")},function(e,t,n){n(49)("match")},function(e,t,n){n(49)("matchAll")},function(e,t,n){n(49)("replace")},function(e,t,n){n(49)("search")},function(e,t,n){n(49)("species")},function(e,t,n){n(49)("split")},function(e,t,n){n(49)("toPrimitive")},function(e,t,n){n(49)("toStringTag")},function(e,t,n){n(49)("unscopables")},function(e,t,n){n(87)(Math,"Math",!0)},function(e,t,n){var r=n(41);n(87)(r.JSON,"JSON",!0)},function(e,t,n){n(49)("asyncDispose")},function(e,t,n){n(49)("dispose")},function(e,t,n){n(49)("observable")},function(e,t,n){n(49)("patternMatch")},function(e,t,n){n(49)("replaceAll")},function(e,t,n){var r=n(371);e.exports=r},function(e,t,n){n(578);var r=n(45);e.exports=r("Array").filter},function(e,t,n){"use strict";var r=n(24),o=n(88).filter,a=n(154),i=n(64),s=a("filter"),u=i("filter");r({target:"Array",proto:!0,forced:!s||!u},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(580);e.exports=r},function(e,t,n){var r=n(581),o=Array.prototype;e.exports=function(e){var t=e.concat;return e===o||e instanceof Array&&t===o.concat?r:t}},function(e,t,n){n(369);var r=n(45);e.exports=r("Array").concat},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],i=n[1],s=new a(function(e,t,n){return 3*(t+n)/4-n}(0,r,i)),u=0,l=i>0?r-4:r,p=0;p<l;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===i&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,s[u++]=255&t);1===i&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,u=n-o;s<u;s+=i)a.push(l(e,s,s+i>u?u:s+i));1===o?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=i.length;s<u;++s)r[s]=i[s],o[i.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var a,i,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+p],p+=f,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=r;l>0;i=256*i+e[t+p],p+=f,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,r),a-=c}return(h?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,p=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,d=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(i++,u/=2),i+p>=l?(s=0,i=l):i+p>=1?(s=(t*u-1)*Math.pow(2,o),i+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=255&s,h+=d,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;e[n+h]=255&i,h+=d,i/=256,c-=8);e[n+h-d]|=128*v}},function(e,t,n){var r=n(585);e.exports=r},function(e,t,n){var r=n(586),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?r:t}},function(e,t,n){n(587);var r=n(45);e.exports=r("Array").map},function(e,t,n){"use strict";var r=n(24),o=n(88).map,a=n(154),i=n(64),s=a("map"),u=i("map");r({target:"Array",proto:!0,forced:!s||!u},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(589);e.exports=r},function(e,t,n){var r=n(590),o=Array.prototype;e.exports=function(e){var t=e.reduce;return e===o||e instanceof Array&&t===o.reduce?r:t}},function(e,t,n){n(591);var r=n(45);e.exports=r("Array").reduce},function(e,t,n){"use strict";var r=n(24),o=n(592).left,a=n(111),i=n(64),s=a("reduce"),u=i("reduce",{1:0});r({target:"Array",proto:!0,forced:!s||!u},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(78),o=n(72),a=n(172),i=n(79),s=function(e){return function(t,n,s,u){r(n);var c=o(t),l=a(c),p=i(c.length),f=e?p-1:0,h=e?-1:1;if(s<2)for(;;){if(f in l){u=l[f],f+=h;break}if(f+=h,e?f<0:p<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:p>f;f+=h)f in l&&(u=n(u,l[f],f,c));return u}};e.exports={left:s(!1),right:s(!0)}},function(e,t,n){var r=n(373);e.exports=r},function(e,t,n){n(24)({target:"Array",stat:!0},{isArray:n(152)})},function(e,t,n){var r=n(374);e.exports=r},function(e,t,n){var r=n(24),o=n(48);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:n(63).f})},function(e,t,n){var r=n(375);e.exports=r},function(e,t,n){n(599);var r=n(45);e.exports=r("Array").slice},function(e,t,n){"use strict";var r=n(24),o=n(44),a=n(152),i=n(225),s=n(79),u=n(69),c=n(153),l=n(39),p=n(154),f=n(64),h=p("slice"),d=f("slice",{ACCESSORS:!0,0:0,1:2}),v=l("species"),m=[].slice,g=Math.max;r({target:"Array",proto:!0,forced:!h||!d},{slice:function(e,t){var n,r,l,p=u(this),f=s(p.length),h=i(e,f),d=i(void 0===t?f:t,f);if(a(p)&&("function"!=typeof(n=p.constructor)||n!==Array&&!a(n.prototype)?o(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return m.call(p,h,d);for(r=new(void 0===n?Array:n)(g(d-h,0)),l=0;h<d;h++,l++)h in p&&c(r,l,p[h]);return r.length=l,r}})},function(e,t,n){var r=n(376);e.exports=r},function(e,t,n){var r=n(24),o=n(377);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,n){var r=n(603);e.exports=r},function(e,t,n){var r=n(604),o=Function.prototype;e.exports=function(e){var t=e.bind;return e===o||e instanceof Function&&t===o.bind?r:t}},function(e,t,n){n(605);var r=n(45);e.exports=r("Function").bind},function(e,t,n){n(24)({target:"Function",proto:!0},{bind:n(378)})},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r=n(608),o=n(127),a=n(81),i=n(609),s=r.twoArgumentPooler,u=r.fourArgumentPooler,c=/\/+/g;function l(e){return(""+e).replace(c,"$&/")}function p(e,t){this.func=e,this.context=t,this.count=0}function f(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function d(e,t,n){var r=e.result,i=e.keyPrefix,s=e.func,u=e.context,c=s.call(u,t,e.count++);Array.isArray(c)?v(c,r,n,a.thatReturnsArgument):null!=c&&(o.isValidElement(c)&&(c=o.cloneAndReplaceKey(c,i+(!c.key||t&&t.key===c.key?"":l(c.key)+"/")+n)),r.push(c))}function v(e,t,n,r,o){var a="";null!=n&&(a=l(n)+"/");var s=h.getPooled(t,a,r,o);i(e,d,s),h.release(s)}function m(e,t,n){return null}p.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},r.addPoolingTo(p,s),h.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},r.addPoolingTo(h,u);var g={forEach:function(e,t,n){if(null==e)return e;var r=p.getPooled(t,n);i(e,f,r),p.release(r)},map:function(e,t,n){if(null==e)return e;var r=[];return v(e,r,null,t,n),r},mapIntoWithKeyPrefixInternal:v,count:function(e,t){return i(e,m,null)},toArray:function(e){var t=[];return v(e,t,null,a.thatReturnsArgument),t}};e.exports=g},function(e,t,n){"use strict";var r=n(155),o=(n(25),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),a=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},i=o,s={addPoolingTo:function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||i,n.poolSize||(n.poolSize=10),n.release=a,n},oneArgumentPooler:o,twoArgumentPooler:function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},threeArgumentPooler:function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},fourArgumentPooler:function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)}};e.exports=s},function(e,t,n){"use strict";var r=n(155),o=(n(89),n(382)),a=n(610),i=(n(25),n(611));n(33);function s(e,t){return e&&"object"==typeof e&&null!=e.key?i.escape(e.key):t.toString(36)}function u(e,t,n,c){var l,p=typeof e;if("undefined"!==p&&"boolean"!==p||(e=null),null===e||"string"===p||"number"===p||"object"===p&&e.$$typeof===o)return n(c,e,""===t?"."+s(e,0):t),1;var f=0,h=""===t?".":t+":";if(Array.isArray(e))for(var d=0;d<e.length;d++)f+=u(l=e[d],h+s(l,d),n,c);else{var v=a(e);if(v){var m,g=v.call(e);if(v!==e.entries)for(var y=0;!(m=g.next()).done;)f+=u(l=m.value,h+s(l,y++),n,c);else for(;!(m=g.next()).done;){var b=m.value;b&&(f+=u(l=b[1],h+i.escape(b[0])+":"+s(l,0),n,c))}}else if("object"===p){var _=String(e);r("31","[object Object]"===_?"object with keys {"+Object.keys(e).join(", ")+"}":_,"")}}return f}e.exports=function(e,t,n){return null==e?0:u(e,"",t,n)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator;e.exports=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,(function(e){return t[e]}))}};e.exports=r},function(e,t,n){"use strict";var r=n(127).createFactory,o={a:r("a"),abbr:r("abbr"),address:r("address"),area:r("area"),article:r("article"),aside:r("aside"),audio:r("audio"),b:r("b"),base:r("base"),bdi:r("bdi"),bdo:r("bdo"),big:r("big"),blockquote:r("blockquote"),body:r("body"),br:r("br"),button:r("button"),canvas:r("canvas"),caption:r("caption"),cite:r("cite"),code:r("code"),col:r("col"),colgroup:r("colgroup"),data:r("data"),datalist:r("datalist"),dd:r("dd"),del:r("del"),details:r("details"),dfn:r("dfn"),dialog:r("dialog"),div:r("div"),dl:r("dl"),dt:r("dt"),em:r("em"),embed:r("embed"),fieldset:r("fieldset"),figcaption:r("figcaption"),figure:r("figure"),footer:r("footer"),form:r("form"),h1:r("h1"),h2:r("h2"),h3:r("h3"),h4:r("h4"),h5:r("h5"),h6:r("h6"),head:r("head"),header:r("header"),hgroup:r("hgroup"),hr:r("hr"),html:r("html"),i:r("i"),iframe:r("iframe"),img:r("img"),input:r("input"),ins:r("ins"),kbd:r("kbd"),keygen:r("keygen"),label:r("label"),legend:r("legend"),li:r("li"),link:r("link"),main:r("main"),map:r("map"),mark:r("mark"),menu:r("menu"),menuitem:r("menuitem"),meta:r("meta"),meter:r("meter"),nav:r("nav"),noscript:r("noscript"),object:r("object"),ol:r("ol"),optgroup:r("optgroup"),option:r("option"),output:r("output"),p:r("p"),param:r("param"),picture:r("picture"),pre:r("pre"),progress:r("progress"),q:r("q"),rp:r("rp"),rt:r("rt"),ruby:r("ruby"),s:r("s"),samp:r("samp"),script:r("script"),section:r("section"),select:r("select"),small:r("small"),source:r("source"),span:r("span"),strong:r("strong"),style:r("style"),sub:r("sub"),summary:r("summary"),sup:r("sup"),table:r("table"),tbody:r("tbody"),td:r("td"),textarea:r("textarea"),tfoot:r("tfoot"),th:r("th"),thead:r("thead"),time:r("time"),title:r("title"),tr:r("tr"),track:r("track"),u:r("u"),ul:r("ul"),var:r("var"),video:r("video"),wbr:r("wbr"),circle:r("circle"),clipPath:r("clipPath"),defs:r("defs"),ellipse:r("ellipse"),g:r("g"),image:r("image"),line:r("line"),linearGradient:r("linearGradient"),mask:r("mask"),path:r("path"),pattern:r("pattern"),polygon:r("polygon"),polyline:r("polyline"),radialGradient:r("radialGradient"),rect:r("rect"),stop:r("stop"),svg:r("svg"),text:r("text"),tspan:r("tspan")};e.exports=o},function(e,t,n){"use strict";var r=n(127).isValidElement,o=n(383);e.exports=o(r)},function(e,t,n){"use strict";var r=n(384),o=n(40),a=n(385),i=n(616),s=Function.call.bind(Object.prototype.hasOwnProperty);function u(){return null}e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",l={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:h(u),arrayOf:function(e){return h((function(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new f("Invalid "+o+" `"+i+"` of type `"+m(s)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<s.length;u++){var c=e(s,u,r,o,i+"["+u+"]",a);if(c instanceof Error)return c}return null}))},element:h((function(t,n,r,o,a){var i=t[n];return e(i)?null:new f("Invalid "+o+" `"+a+"` of type `"+m(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:h((function(e,t,n,o,a){var i=e[t];return r.isValidElementType(i)?null:new f("Invalid "+o+" `"+a+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,a){if(!(t[n]instanceof e)){var i=e.name||c;return new f("Invalid "+o+" `"+a+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+i+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return v(e[t])?null:new f("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,n,r,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],c=m(u);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var l in u)if(s(u,l)){var p=e(u,l,r,o,i+"."+l,a);if(p instanceof Error)return p}return null}))},oneOf:function(e){if(!Array.isArray(e))return u;return h((function(t,n,r,o,a){for(var i=t[n],s=0;s<e.length;s++)if(p(i,e[s]))return null;var u=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new f("Invalid "+o+" `"+a+"` of value `"+String(i)+"` supplied to `"+r+"`, expected one of "+u+".")}))},oneOfType:function(e){if(!Array.isArray(e))return u;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return y(n),u}return h((function(t,n,r,o,i){for(var s=0;s<e.length;s++)if(null==(0,e[s])(t,n,r,o,i,a))return null;return new f("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}))},shape:function(e){return h((function(t,n,r,o,i){var s=t[n],u=m(s);if("object"!==u)return new f("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var l=e[c];if(l){var p=l(s,c,r,o,i+"."+c,a);if(p)return p}}return null}))},exact:function(e){return h((function(t,n,r,i,s){var u=t[n],c=m(u);if("object"!==c)return new f("Invalid "+i+" `"+s+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var l=o({},t[n],e);for(var p in l){var h=e[p];if(!h)return new f("Invalid "+i+" `"+s+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null,"  ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null,"  "));var d=h(u,p,r,i,s+"."+p,a);if(d)return d}return null}))}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e){this.message=e,this.stack=""}function h(e){function n(n,r,o,i,s,u,l){if((i=i||c,u=u||o,l!==a)&&t){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}return null==r[o]?n?null===r[o]?new f("The "+s+" `"+u+"` is marked as required in `"+i+"`, but its value is `null`."):new f("The "+s+" `"+u+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(r,o,i,s,u)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function d(e){return h((function(t,n,r,o,a,i){var s=t[n];return m(s)!==e?new f("Invalid "+o+" `"+a+"` of type `"+g(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null}))}function v(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(v);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,a=r.call(t);if(r!==t.entries){for(;!(o=a.next()).done;)if(!v(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!v(i[1]))return!1}return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function g(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=g(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return f.prototype=Error.prototype,l.checkPropTypes=i,l.resetWarningCache=i.resetWarningCache,l.PropTypes=l,l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case i:case u:case s:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case c:return e;default:return t}}case m:case v:case a:return t}}}function y(e){return g(e)===f}t.typeOf=g,t.AsyncMode=p,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=h,t.Fragment=i,t.Lazy=m,t.Memo=v,t.Portal=a,t.Profiler=u,t.StrictMode=s,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===u||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===v||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h)},t.isAsyncMode=function(e){return y(e)||g(e)===p},t.isConcurrentMode=y,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return g(e)===h},t.isFragment=function(e){return g(e)===i},t.isLazy=function(e){return g(e)===m},t.isMemo=function(e){return g(e)===v},t.isPortal=function(e){return g(e)===a},t.isProfiler=function(e){return g(e)===u},t.isStrictMode=function(e){return g(e)===s},t.isSuspense=function(e){return g(e)===d}},function(e,t,n){"use strict";function r(e,t,n,r,o){}r.resetWarningCache=function(){0},e.exports=r},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(379).Component,o=n(127).isValidElement,a=n(380),i=n(619);e.exports=i(r,o,a)},function(e,t,n){"use strict";var r=n(40),o=n(179),a=n(25),i="mixins";e.exports=function(e,t,n){var s=[],u={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},c={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},l={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)f(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=r({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=r({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=d(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=r({},e.propTypes,t)},statics:function(e,t){!function(e,t){if(!t)return;for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(a(!(n in l),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){var o=c.hasOwnProperty(n)?c[n]:null;return a("DEFINE_MANY_MERGED"===o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=d(e[n],r))}e[n]=r}}}(e,t)},autobind:function(){}};function p(e,t){var n=u.hasOwnProperty(t)?u[t]:null;b.hasOwnProperty(t)&&a("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&a("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function f(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),a(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(i)&&l.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==i){var c=n[s],f=r.hasOwnProperty(s);if(p(f,s),l.hasOwnProperty(s))l[s](e,c);else{var h=u.hasOwnProperty(s);if("function"==typeof c&&!h&&!f&&!1!==n.autobind)o.push(s,c),r[s]=c;else if(f){var m=u[s];a(h&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,s),"DEFINE_MANY_MERGED"===m?r[s]=d(r[s],c):"DEFINE_MANY"===m&&(r[s]=v(r[s],c))}else r[s]=c}}}else;}function h(e,t){for(var n in a(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."),t)t.hasOwnProperty(n)&&(a(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return h(o,n),h(o,r),o}}function v(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function m(e,t){return t.bind(e)}var g={componentDidMount:function(){this.__isMounted=!0}},y={componentWillUnmount:function(){this.__isMounted=!1}},b={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return r(_.prototype,e.prototype,b),function(e){var t=function(e,r,i){this.__reactAutoBindPairs.length&&function(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=m(e,o)}}(this),this.props=e,this.context=r,this.refs=o,this.updater=i||n,this.state=null;var s=this.getInitialState?this.getInitialState():null;a("object"==typeof s&&!Array.isArray(s),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=s};for(var r in t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],s.forEach(f.bind(null,t)),f(t,g),f(t,e),f(t,y),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),a(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),u)t.prototype[r]||(t.prototype[r]=null);return t}}},function(e,t,n){"use strict";var r=n(155),o=n(127);n(25);e.exports=function(e){return o.isValidElement(e)||r("143"),e}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r},i=n(623);t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default.Map,n=Object.keys(e);return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(),o=arguments[1];return r.withMutations((function(t){n.forEach((function(n){var r=(0,e[n])(t.get(n),o);(0,i.validateNextState)(r,n,o),t.set(n,r)}))}))}},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateNextState=t.getUnexpectedInvocationParameterMessage=t.getStateName=void 0;var r=i(n(386)),o=i(n(624)),a=i(n(625));function i(e){return e&&e.__esModule?e:{default:e}}t.getStateName=r.default,t.getUnexpectedInvocationParameterMessage=o.default,t.validateNextState=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(1)),o=a(n(386));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){var a=Object.keys(t);if(!a.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var i=(0,o.default)(n);if(!r.default.Iterable.isIterable(e))return"The "+i+' is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties: "'+a.join('", "')+'".';var s=e.keySeq().toArray().filter((function(e){return!t.hasOwnProperty(e)}));return s.length>0?"Unexpected "+(1===s.length?"property":"properties")+' "'+s.join('", "')+'" found in '+i+'. Expected to find one of the known reducer property names instead: "'+a.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(void 0===e)throw new Error('Reducer "'+t+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.')},e.exports=t.default},function(e,t,n){var r=n(627);e.exports=r},function(e,t,n){var r=n(628),o=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===o||e instanceof String&&t===o.trim?r:t}},function(e,t,n){n(629);var r=n(45);e.exports=r("String").trim},function(e,t,n){"use strict";var r=n(24),o=n(630).trim;r({target:"String",proto:!0,forced:n(631)("trim")},{trim:function(){return o(this)}})},function(e,t,n){var r=n(125),o="["+n(387)+"]",a=RegExp("^"+o+o+"*"),i=RegExp(o+o+"*$"),s=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(a,"")),2&e&&(n=n.replace(i,"")),n}};e.exports={start:s(1),end:s(2),trim:s(3)}},function(e,t,n){var r=n(36),o=n(387);e.exports=function(e){return r((function(){return!!o[e]()||"​\85᠎"!="​\85᠎"[e]()||o[e].name!==e}))}},function(e,t,n){var r=n(633);e.exports=r},function(e,t,n){var r=n(634),o=String.prototype;e.exports=function(e){var t=e.startsWith;return"string"==typeof e||e===o||e instanceof String&&t===o.startsWith?r:t}},function(e,t,n){n(635);var r=n(45);e.exports=r("String").startsWith},function(e,t,n){"use strict";var r,o=n(24),a=n(104).f,i=n(79),s=n(388),u=n(125),c=n(389),l=n(95),p="".startsWith,f=Math.min,h=c("startsWith");o({target:"String",proto:!0,forced:!!(l||h||(r=a(String.prototype,"startsWith"),!r||r.writable))&&!h},{startsWith:function(e){var t=String(u(this));s(e);var n=i(f(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return p?p.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){var r=n(44),o=n(106),a=n(39)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(638);e.exports=r},function(e,t,n){var r=n(639),o=Array.prototype;e.exports=function(e){var t=e.find;return e===o||e instanceof Array&&t===o.find?r:t}},function(e,t,n){n(640);var r=n(45);e.exports=r("Array").find},function(e,t,n){"use strict";var r=n(24),o=n(88).find,a=n(234),i=n(64),s="find",u=!0,c=i(s);s in[]&&Array(1).find((function(){u=!1})),r({target:"Array",proto:!0,forced:u||!c},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a(s)},function(e,t,n){var r=n(390);e.exports=r},function(e,t,n){n(643);var r=n(45);e.exports=r("Array").indexOf},function(e,t,n){"use strict";var r=n(24),o=n(224).indexOf,a=n(111),i=n(64),s=[].indexOf,u=!!s&&1/[1].indexOf(1,-0)<0,c=a("indexOf"),l=i("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:u||!c||!l},{indexOf:function(e){return u?s.apply(this,arguments)||0:o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(241),o=n(391);e.exports=function(e){if(r(e))return o(e)}},function(e,t,n){var r=n(373);e.exports=r},function(e,t,n){var r=n(394);e.exports=r},function(e,t,n){var r=n(24),o=n(395);r({target:"Array",stat:!0,forced:!n(398)((function(e){Array.from(e)}))},{from:o})},function(e,t,n){n(80),n(96);var r=n(649);e.exports=r},function(e,t,n){var r=n(97),o=n(39),a=n(109),i=o("iterator");e.exports=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||a.hasOwnProperty(r(t))}},function(e,t,n){e.exports=n(651)},function(e,t,n){var r=n(375);e.exports=r},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){var r=n(654);e.exports=r},function(e,t,n){var r=n(655),o=n(657),a=Array.prototype,i=String.prototype;e.exports=function(e){var t=e.includes;return e===a||e instanceof Array&&t===a.includes?r:"string"==typeof e||e===i||e instanceof String&&t===i.includes?o:t}},function(e,t,n){n(656);var r=n(45);e.exports=r("Array").includes},function(e,t,n){"use strict";var r=n(24),o=n(224).includes,a=n(234);r({target:"Array",proto:!0,forced:!n(64)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},function(e,t,n){n(658);var r=n(45);e.exports=r("String").includes},function(e,t,n){"use strict";var r=n(24),o=n(388),a=n(125);r({target:"String",proto:!0,forced:!n(389)("includes")},{includes:function(e){return!!~String(a(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(660);e.exports=r},function(e,t,n){var r=n(661),o=Array.prototype;e.exports=function(e){var t=e.some;return e===o||e instanceof Array&&t===o.some?r:t}},function(e,t,n){n(662);var r=n(45);e.exports=r("Array").some},function(e,t,n){"use strict";var r=n(24),o=n(88).some,a=n(111),i=n(64),s=a("some"),u=i("some");r({target:"Array",proto:!0,forced:!s||!u},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(401),o=n(399),a=n(177);e.exports=function(e,t){if(void 0!==a&&o(Object(e))){var n=[],i=!0,s=!1,u=void 0;try{for(var c,l=r(e);!(i=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);i=!0);}catch(e){s=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(s)throw u}}return n}}},function(e,t,n){n(80),n(96);var r=n(402);e.exports=r},function(e,t,n){var r=n(666);e.exports=r},function(e,t,n){var r=n(667),o=Array.prototype;e.exports=function(e){var t=e.sort;return e===o||e instanceof Array&&t===o.sort?r:t}},function(e,t,n){n(668);var r=n(45);e.exports=r("Array").sort},function(e,t,n){"use strict";var r=n(24),o=n(78),a=n(72),i=n(36),s=n(111),u=[],c=u.sort,l=i((function(){u.sort(void 0)})),p=i((function(){u.sort(null)})),f=s("sort");r({target:"Array",proto:!0,forced:l||!p||!f},{sort:function(e){return void 0===e?c.call(a(this)):c.call(a(this),o(e))}})},function(e,t,n){var r=n(670);e.exports=r},function(e,t,n){n(671);var r=n(45);e.exports=r("Array").forEach},function(e,t,n){"use strict";var r=n(24),o=n(672);r({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},function(e,t,n){"use strict";var r=n(88).forEach,o=n(111),a=n(64),i=o("forEach"),s=a("forEach");e.exports=i&&s?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},function(e,t,n){e.exports=n(674)},function(e,t,n){n(80),n(96);var r=n(156);e.exports=r},function(e,t,n){n(80);var r=n(676),o=n(97),a=Array.prototype,i={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.entries;return e===a||e instanceof Array&&t===a.entries||i.hasOwnProperty(o(e))?r:t}},function(e,t,n){var r=n(677);e.exports=r},function(e,t,n){n(176);var r=n(45);e.exports=r("Array").entries},function(e,t,n){var r=n(93),o=n(283);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(128),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[s]=n:delete e[s]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(682),o=n(409),a=n(683),i=n(93);e.exports=function(e){return function(t){t=i(t);var n=o(t)?a(t):void 0,s=n?n[0]:t.charAt(0),u=n?r(n,1).join(""):t.slice(1);return s[e]()+u}}},function(e,t,n){var r=n(408);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t,n){var r=n(684),o=n(409),a=n(685);e.exports=function(e){return o(e)?a(e):r(e)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",a="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+o+")"+"?",c="[\\ufe0e\\ufe0f]?",l=c+u+("(?:\\u200d(?:"+[a,i,s].join("|")+")"+c+u+")*"),p="(?:"+[a+r+"?",r,i,s,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+p+l,"g");e.exports=function(e){return e.match(f)||[]}},function(e,t,n){var r=n(410),o=n(687),a=n(690),i=RegExp("['’]","g");e.exports=function(e){return function(t){return r(a(o(t).replace(i,"")),e,"")}}},function(e,t,n){var r=n(688),o=n(93),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(a,r).replace(i,"")}},function(e,t,n){var r=n(689)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(691),o=n(692),a=n(93),i=n(693);e.exports=function(e,t,n){return e=a(e),void 0===(t=n?void 0:t)?o(e)?i(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\u2700-\\u27bf",r="a-z\\xdf-\\xf6\\xf8-\\xff",o="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",i="["+a+"]",s="\\d+",u="[\\u2700-\\u27bf]",c="["+r+"]",l="[^\\ud800-\\udfff"+a+s+n+r+o+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",h="["+o+"]",d="(?:"+c+"|"+l+")",v="(?:"+h+"|"+l+")",m="(?:['’](?:d|ll|m|re|s|t|ve))?",g="(?:['’](?:D|LL|M|RE|S|T|VE))?",y="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",b="[\\ufe0e\\ufe0f]?",_=b+y+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",p,f].join("|")+")"+b+y+")*"),w="(?:"+[u,p,f].join("|")+")"+_,E=RegExp([h+"?"+c+"+"+m+"(?="+[i,h,"$"].join("|")+")",v+"+"+g+"(?="+[i,h+d,"$"].join("|")+")",h+"?"+d+"+"+m,h+"+"+g,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",s,w].join("|"),"g");e.exports=function(e){return e.match(E)||[]}},function(e,t,n){var r=n(695),o=n(183),a=n(243);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},function(e,t,n){var r=n(696),o=n(701),a=n(702),i=n(703),s=n(704);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(182);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(68),o=n(698),a=n(59),i=n(411),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,p=c.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:s).test(i(e))}},function(e,t,n){var r,o=n(699),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},function(e,t,n){var r=n(74)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(182),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(182),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(182);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(184),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(184);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(184);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(184);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(185);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(185);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(185);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(185);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(186),o=n(129),a=n(114);e.exports=function(e){return function(t,n,i){var s=Object(t);if(!o(t)){var u=r(n,3);t=a(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,i);return c>-1?s[u?t[c]:c]:void 0}}},function(e,t,n){var r=n(717),o=n(743),a=n(423);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(244),o=n(412);e.exports=function(e,t,n,a){var i=n.length,s=i,u=!a;if(null==e)return!s;for(e=Object(e);i--;){var c=n[i];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<s;){var l=(c=n[i])[0],p=e[l],f=c[1];if(u&&c[2]){if(void 0===p&&!(l in e))return!1}else{var h=new r;if(a)var d=a(p,f,l,e,t,h);if(!(void 0===d?o(f,p,3,a,h):d))return!1}}return!0}},function(e,t,n){var r=n(183);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(183),o=n(243),a=n(242);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(244),o=n(413),a=n(728),i=n(731),s=n(190),u=n(55),c=n(248),l=n(420),p="[object Arguments]",f="[object Array]",h="[object Object]",d=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,g){var y=u(e),b=u(t),_=y?f:s(e),w=b?f:s(t),E=(_=_==p?h:_)==h,x=(w=w==p?h:w)==h,C=_==w;if(C&&c(e)){if(!c(t))return!1;y=!0,E=!1}if(C&&!E)return g||(g=new r),y||l(e)?o(e,t,n,v,m,g):a(e,t,_,n,v,m,g);if(!(1&n)){var S=E&&d.call(e,"__wrapped__"),A=x&&d.call(t,"__wrapped__");if(S||A){var k=S?e.value():e,O=A?t.value():t;return g||(g=new r),m(k,O,n,v,g)}}return!!C&&(g||(g=new r),i(e,t,n,v,m,g))}},function(e,t,n){var r=n(242),o=n(725),a=n(726);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(128),o=n(415),a=n(121),i=n(413),s=n(729),u=n(730),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,p,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!p(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var d=1&r;if(h||(h=u),e.size!=t.size&&!d)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var m=i(h(e),h(t),r,c,p,f);return f.delete(e),m;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(416),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var p=l;p--;){var f=c[p];if(!(u?f in t:o.call(t,f)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var d=!0;s.set(e,t),s.set(t,e);for(var v=u;++p<l;){var m=e[f=c[p]],g=t[f];if(a)var y=u?a(g,m,f,t,e,s):a(m,g,f,e,t,s);if(!(void 0===y?m===g||i(m,g,n,a,s):y)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(d=!1)}return s.delete(e),s.delete(t),d}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(112),o=n(90);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(112),o=n(249),a=n(90),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},function(e,t,n){var r=n(189),o=n(738),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(421)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(113)(n(74),"DataView");e.exports=r},function(e,t,n){var r=n(113)(n(74),"Promise");e.exports=r},function(e,t,n){var r=n(113)(n(74),"Set");e.exports=r},function(e,t,n){var r=n(113)(n(74),"WeakMap");e.exports=r},function(e,t,n){var r=n(422),o=n(114);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},function(e,t,n){var r=n(412),o=n(46),a=n(424),i=n(252),s=n(422),u=n(423),c=n(131);e.exports=function(e,t){return i(e)&&s(t)?u(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},function(e,t,n){var r=n(746),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)})),t}));e.exports=i},function(e,t,n){var r=n(284);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(130),o=n(247),a=n(55),i=n(188),s=n(249),u=n(131);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,p=!1;++c<l;){var f=u(t[c]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++c!=l?p:!!(l=null==e?0:e.length)&&s(l)&&i(f,l)&&(a(e)||o(e))}},function(e,t,n){var r=n(750),o=n(751),a=n(252),i=n(131);e.exports=function(e){return a(e)?r(i(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(191);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(753),o=n(186),a=n(425),i=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:a(n);return u<0&&(u=i(s+u,0)),r(e,o(t,3),u)}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}},function(e,t,n){var r=n(426),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(427);e.exports=function(e,t){var n;return r(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}},function(e,t,n){var r=n(757),o=n(114);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(758)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),s=i.length;s--;){var u=i[e?s:++o];if(!1===n(a[u],u,a))break}return t}}},function(e,t,n){var r=n(129);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,s=Object(n);(t?i--:++i<a)&&!1!==o(s[i],i,s););return n}}},function(e,t){var n={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,(function(e,t){return n[t]})):e}},function(e,t,n){e.exports=o;var r=n(254).EventEmitter;function o(){r.call(this)}n(65)(o,r),o.Readable=n(255),o.Writable=n(768),o.Duplex=n(769),o.Transform=n(770),o.PassThrough=n(771),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var i=!1;function s(){i||(i=!0,e.end())}function u(){i||(i=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}function l(){n.removeListener("data",o),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("error",c),e.on("error",c),n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(66).Buffer,o=n(764);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,a=r.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,n=a,o=s,t.copy(n,o),s+=i.data.length,i=i.next;return a},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,a,i,s,u=1,c={},l=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){d(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){a.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&d(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(i+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(53),n(91))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(53))},function(e,t,n){"use strict";e.exports=a;var r=n(434),o=n(157);function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}o.inherits=n(65),o.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(256)},function(e,t,n){e.exports=n(115)},function(e,t,n){e.exports=n(255).Transform},function(e,t,n){e.exports=n(255).PassThrough},function(e,t,n){"use strict";var r=n(773),o=Math.abs,a=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*a(o(e)):e}},function(e,t,n){"use strict";e.exports=n(774)()?Math.sign:n(775)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(98),o=n(193),a=n(118),i=n(778),s=n(437);e.exports=function e(t){var n,u,c;if(r(t),(n=Object(arguments[1])).async&&n.promise)throw new Error("Options 'async' and 'promise' cannot be used together");return hasOwnProperty.call(t,"__memoized__")&&!n.force?t:(u=s(n.length,t.length,n.async&&a.async),c=i(t,u,n),o(a,(function(e,t){n[t]&&e(n[t],c,n)})),e.__profiler__&&e.__profiler__(c),c.updateEnv(),c.memoized)}},function(e,t,n){"use strict";var r=n(98),o=n(132),a=Function.prototype.bind,i=Function.prototype.call,s=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,c){var l,p=arguments[2],f=arguments[3];return n=Object(o(n)),r(c),l=s(n),f&&l.sort("function"==typeof f?a.call(f,n):void 0),"function"!=typeof e&&(e=l[e]),i.call(e,l,(function(e,r){return u.call(n,e)?i.call(c,p,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r=n(779),o=n(439),a=n(194),i=n(789).methods,s=n(790),u=n(802),c=Function.prototype.apply,l=Function.prototype.call,p=Object.create,f=Object.defineProperties,h=i.on,d=i.emit;e.exports=function(e,t,n){var i,v,m,g,y,b,_,w,E,x,C,S,A,k,O,j=p(null);return v=!1!==t?t:isNaN(e.length)?1:e.length,n.normalizer&&(x=u(n.normalizer),m=x.get,g=x.set,y=x.delete,b=x.clear),null!=n.resolvers&&(O=s(n.resolvers)),k=m?o((function(t){var n,o,a=arguments;if(O&&(a=O(a)),null!==(n=m(a))&&hasOwnProperty.call(j,n))return C&&i.emit("get",n,a,this),j[n];if(o=1===a.length?l.call(e,this,a[0]):c.call(e,this,a),null===n){if(null!==(n=m(a)))throw r("Circular invocation","CIRCULAR_INVOCATION");n=g(a)}else if(hasOwnProperty.call(j,n))throw r("Circular invocation","CIRCULAR_INVOCATION");return j[n]=o,S&&i.emit("set",n,null,o),o}),v):0===t?function(){var t;if(hasOwnProperty.call(j,"data"))return C&&i.emit("get","data",arguments,this),j.data;if(t=arguments.length?c.call(e,this,arguments):l.call(e,this),hasOwnProperty.call(j,"data"))throw r("Circular invocation","CIRCULAR_INVOCATION");return j.data=t,S&&i.emit("set","data",null,t),t}:function(t){var n,o,a=arguments;if(O&&(a=O(arguments)),o=String(a[0]),hasOwnProperty.call(j,o))return C&&i.emit("get",o,a,this),j[o];if(n=1===a.length?l.call(e,this,a[0]):c.call(e,this,a),hasOwnProperty.call(j,o))throw r("Circular invocation","CIRCULAR_INVOCATION");return j[o]=n,S&&i.emit("set",o,null,n),n},i={original:e,memoized:k,profileName:n.profileName,get:function(e){return O&&(e=O(e)),m?m(e):String(e[0])},has:function(e){return hasOwnProperty.call(j,e)},delete:function(e){var t;hasOwnProperty.call(j,e)&&(y&&y(e),t=j[e],delete j[e],A&&i.emit("delete",e,t))},clear:function(){var e=j;b&&b(),j=p(null),i.emit("clear",e)},on:function(e,t){return"get"===e?C=!0:"set"===e?S=!0:"delete"===e&&(A=!0),h.call(this,e,t)},emit:d,updateEnv:function(){e=i.original}},_=m?o((function(e){var t,n=arguments;O&&(n=O(n)),null!==(t=m(n))&&i.delete(t)}),v):0===t?function(){return i.delete("data")}:function(e){return O&&(e=O(arguments)[0]),i.delete(e)},w=o((function(){var e,n=arguments;return 0===t?j.data:(O&&(n=O(n)),e=m?m(n):String(n[0]),j[e])})),E=o((function(){var e,n=arguments;return 0===t?i.has("data"):(O&&(n=O(n)),null!==(e=m?m(n):String(n[0]))&&i.has(e))})),f(k,{__memoized__:a(!0),delete:a(_),clear:a(i.clear),_get:a(w),_has:a(E)}),i}},function(e,t,n){"use strict";var r=n(438),o=n(785),a=n(116),i=Error.captureStackTrace;t=e.exports=function(e){var n=new Error(e),s=arguments[1],u=arguments[2];return a(u)||o(s)&&(u=s,s=null),a(u)&&r(n,u),a(s)&&(n.code=s),i&&i(n,t),n}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(782),o=n(132),a=Math.max;e.exports=function(e,t){var n,i,s,u=a(arguments.length,2);for(e=Object(o(e)),s=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},i=1;i<u;++i)r(t=arguments[i]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(783)()?Object.keys:n(784)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(116),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r=n(116),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";e.exports=n(787)()?String.prototype.contains:n(788)},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o,a,i,s,u,c,l=n(194),p=n(98),f=Function.prototype.apply,h=Function.prototype.call,d=Object.create,v=Object.defineProperty,m=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return p(t),o=this,r.call(this,e,n=function(){a.call(o,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:r=function(e,t){var n;return p(t),g.call(this,"__ee__")?n=this.__ee__:(n=y.value=d(null),v(this,"__ee__",y),y.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},once:o,off:a=function(e,t){var n,r,o,a;if(p(t),!g.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(a=0;o=r[a];++a)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[a?0:1]:r.splice(a,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},emit:i=function(e){var t,n,r,o,a;if(g.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,a=new Array(n-1),t=1;t<n;++t)a[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)f.call(r,this,a)}else switch(arguments.length){case 1:h.call(o,this);break;case 2:h.call(o,this,arguments[1]);break;case 3:h.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,a=new Array(n-1),t=1;t<n;++t)a[t-1]=arguments[t];f.call(o,this,a)}}},u={on:l(r),once:l(o),off:l(a),emit:l(i)},c=m({},u),e.exports=t=function(e){return null==e?d(c):m(Object(e),u)},t.methods=s},function(e,t,n){"use strict";var r,o=n(791),a=n(116),i=n(98),s=Array.prototype.slice;r=function(e){return this.map((function(t,n){return t?t(e[n]):e[n]})).concat(s.call(e,this.length))},e.exports=function(e){return(e=o(e)).forEach((function(e){a(e)&&i(e)})),r.bind(e)}},function(e,t,n){"use strict";var r=n(258),o=Array.isArray;e.exports=function(e){return o(e)?e:r(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(794).iterator,o=n(799),a=n(800),i=n(117),s=n(98),u=n(132),c=n(116),l=n(801),p=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;e.exports=function(e){var t,n,v,m,g,y,b,_,w,E,x=arguments[1],C=arguments[2];if(e=Object(u(e)),c(x)&&s(x),this&&this!==Array&&a(this))t=this;else{if(!x){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((m=new Array(1))[0]=e[0],m);if(p(e)){for(m=new Array(g=e.length),n=0;n<g;++n)m[n]=e[n];return m}}m=[]}if(!p(e))if(void 0!==(w=e[r])){for(b=s(w).call(e),t&&(m=new t),_=b.next(),n=0;!_.done;)E=x?f.call(x,C,_.value,n):_.value,t?(h.value=E,d(m,n,h)):m[n]=E,_=b.next(),++n;g=n}else if(l(e)){for(g=e.length,t&&(m=new t),n=0,v=0;n<g;++n)E=e[n],n+1<g&&(y=E.charCodeAt(0))>=55296&&y<=56319&&(E+=e[++n]),E=x?f.call(x,C,E,v):E,t?(h.value=E,d(m,v,h)):m[v]=E,++v;g=v}if(void 0===g)for(g=i(e.length),t&&(m=new t(g)),n=0;n<g;++n)E=x?f.call(x,C,e[n],n):e[n],t?(h.value=E,d(m,n,h)):m[n]=E;return t&&(h.value=null,m.length=g),m}},function(e,t,n){"use strict";e.exports=n(795)()?Symbol:n(796)},function(e,t,n){"use strict";var r={object:!0,symbol:!0};e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(e,t,n){"use strict";var r,o,a,i,s=n(194),u=n(797),c=Object.create,l=Object.defineProperties,p=Object.defineProperty,f=Object.prototype,h=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),i=!0}catch(e){}}var d,v=(d=c(null),function(e){for(var t,n,r=0;d[e+(r||"")];)++r;return d[e+=r||""]=!0,p(f,t="@@"+e,s.gs(null,(function(e){n||(n=!0,p(this,t,s(e)),n=!1)}))),t});a=function(e){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return o(e)},e.exports=o=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?r(t):(n=c(a.prototype),t=void 0===t?"":String(t),l(n,{__description__:s("",t),__name__:s("",v(t))}))},l(o,{for:s((function(e){return h[e]?h[e]:h[e]=o(String(e))})),keyFor:s((function(e){var t;for(t in u(e),h)if(h[t]===e)return t})),hasInstance:s("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:s("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:s("",r&&r.iterator||o("iterator")),match:s("",r&&r.match||o("match")),replace:s("",r&&r.replace||o("replace")),search:s("",r&&r.search||o("search")),species:s("",r&&r.species||o("species")),split:s("",r&&r.split||o("split")),toPrimitive:s("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:s("",r&&r.toStringTag||o("toStringTag")),unscopables:s("",r&&r.unscopables||o("unscopables"))}),l(a.prototype,{constructor:s(o),toString:s("",(function(){return this.__name__}))}),l(o.prototype,{toString:s((function(){return"Symbol ("+u(this).__description__+")"})),valueOf:s((function(){return u(this)}))}),p(o.prototype,o.toPrimitive,s("",(function(){var e=u(this);return"symbol"==typeof e?e:e.toString()}))),p(o.prototype,o.toStringTag,s("c","Symbol")),p(a.prototype,o.toStringTag,s("c",o.prototype[o.toStringTag])),p(a.prototype,o.toPrimitive,s("c",o.prototype[o.toPrimitive]))},function(e,t,n){"use strict";var r=n(798);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(n(436));e.exports=function(e){return"function"==typeof e&&r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";var r=n(98);e.exports=function(e){var t;return"function"==typeof e?{set:e,get:e}:(t={get:r(e.get)},void 0!==e.set?(t.set=r(e.set),e.delete&&(t.delete=r(e.delete)),e.clear&&(t.clear=r(e.clear)),t):(t.set=t.get,t))}},function(e,t,n){"use strict";e.exports=function(e){var t,n,r=e.length;if(!r)return"\ 2";for(t=String(e[n=0]);--r;)t+="\ 1"+e[++n];return t}},function(e,t,n){"use strict";e.exports=function(e){return e?function(t){for(var n=String(t[0]),r=0,o=e;--o;)n+="\ 1"+t[++r];return n}:function(){return""}}},function(e,t,n){"use strict";var r=n(259),o=Object.create;e.exports=function(){var e=0,t=[],n=o(null);return{get:function(e){var n,o=0,a=t,i=e.length;if(0===i)return a[i]||null;if(a=a[i]){for(;o<i-1;){if(-1===(n=r.call(a[0],e[o])))return null;a=a[1][n],++o}return-1===(n=r.call(a[0],e[o]))?null:a[1][n]||null}return null},set:function(o){var a,i=0,s=t,u=o.length;if(0===u)s[u]=++e;else{for(s[u]||(s[u]=[[],[]]),s=s[u];i<u-1;)-1===(a=r.call(s[0],o[i]))&&(a=s[0].push(o[i])-1,s[1].push([[],[]])),s=s[1][a],++i;-1===(a=r.call(s[0],o[i]))&&(a=s[0].push(o[i])-1),s[1][a]=++e}return n[e]=o,e},delete:function(e){var o,a=0,i=t,s=n[e],u=s.length,c=[];if(0===u)delete i[u];else if(i=i[u]){for(;a<u-1;){if(-1===(o=r.call(i[0],s[a])))return;c.push(i,o),i=i[1][o],++a}if(-1===(o=r.call(i[0],s[a])))return;for(e=i[1][o],i[0].splice(o,1),i[1].splice(o,1);!i[0].length&&c.length;)o=c.pop(),(i=c.pop())[0].splice(o,1),i[1].splice(o,1)}delete n[e]},clear:function(){t=[],n=o(null)}}}},function(e,t,n){"use strict";e.exports=n(807)()?Number.isNaN:n(808)},function(e,t,n){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},function(e,t,n){"use strict";e.exports=function(e){return e!=e}},function(e,t,n){"use strict";var r=n(259);e.exports=function(){var e=0,t=[],n=[];return{get:function(e){var o=r.call(t,e[0]);return-1===o?null:n[o]},set:function(r){return t.push(r[0]),n.push(++e),e},delete:function(e){var o=r.call(n,e);-1!==o&&(t.splice(o,1),n.splice(o,1))},clear:function(){t=[],n=[]}}}},function(e,t,n){"use strict";var r=n(259),o=Object.create;e.exports=function(e){var t=0,n=[[],[]],a=o(null);return{get:function(t){for(var o,a=0,i=n;a<e-1;){if(-1===(o=r.call(i[0],t[a])))return null;i=i[1][o],++a}return-1===(o=r.call(i[0],t[a]))?null:i[1][o]||null},set:function(o){for(var i,s=0,u=n;s<e-1;)-1===(i=r.call(u[0],o[s]))&&(i=u[0].push(o[s])-1,u[1].push([[],[]])),u=u[1][i],++s;return-1===(i=r.call(u[0],o[s]))&&(i=u[0].push(o[s])-1),u[1][i]=++t,a[t]=o,t},delete:function(t){for(var o,i=0,s=n,u=[],c=a[t];i<e-1;){if(-1===(o=r.call(s[0],c[i])))return;u.push(s,o),s=s[1][o],++i}if(-1!==(o=r.call(s[0],c[i]))){for(t=s[1][o],s[0].splice(o,1),s[1].splice(o,1);!s[0].length&&u.length;)o=u.pop(),(s=u.pop())[0].splice(o,1),s[1].splice(o,1);delete a[t]}},clear:function(){n=[[],[]],a=o(null)}}}},function(e,t,n){"use strict";var r=n(258),o=n(441),a=n(440),i=n(439),s=n(260),u=Array.prototype.slice,c=Function.prototype.apply,l=Object.create;n(118).async=function(e,t){var n,p,f,h=l(null),d=l(null),v=t.memoized,m=t.original;t.memoized=i((function(e){var t=arguments,r=t[t.length-1];return"function"==typeof r&&(n=r,t=u.call(t,0,-1)),v.apply(p=this,f=t)}),v);try{a(t.memoized,v)}catch(e){}t.on("get",(function(e){var r,o,a;if(n){if(h[e])return"function"==typeof h[e]?h[e]=[h[e],n]:h[e].push(n),void(n=null);r=n,o=p,a=f,n=p=f=null,s((function(){var i;hasOwnProperty.call(d,e)?(i=d[e],t.emit("getasync",e,a,o),c.call(r,i.context,i.args)):(n=r,p=o,f=a,v.apply(o,a))}))}})),t.original=function(){var e,o,a,i;return n?(e=r(arguments),o=function e(n){var o,a,u=e.id;if(null!=u){if(delete e.id,o=h[u],delete h[u],o)return a=r(arguments),t.has(u)&&(n?t.delete(u):(d[u]={context:this,args:a},t.emit("setasync",u,"function"==typeof o?1:o.length))),"function"==typeof o?i=c.call(o,this,a):o.forEach((function(e){i=c.call(e,this,a)}),this),i}else s(c.bind(e,this,arguments))},a=n,n=p=f=null,e.push(o),i=c.call(m,this,e),o.cb=a,n=o,i):c.call(m,this,arguments)},t.on("set",(function(e){n?(h[e]?"function"==typeof h[e]?h[e]=[h[e],n.cb]:h[e].push(n.cb):h[e]=n.cb,delete n.cb,n.id=e,n=null):t.delete(e)})),t.on("delete",(function(e){var n;hasOwnProperty.call(h,e)||d[e]&&(n=d[e],delete d[e],t.emit("deleteasync",e,u.call(n.args,1)))})),t.on("clear",(function(){var e=d;d=l(null),t.emit("clearasync",o(e,(function(e){return u.call(e.args,1)})))}))}},function(e,t,n){"use strict";var r=n(441),o=n(813),a=n(814),i=n(816),s=n(442),u=n(260),c=Object.create,l=o("then","then:finally","done","done:finally");n(118).promise=function(e,t){var n=c(null),o=c(null),p=c(null);if(!0===e)e=null;else if(e=a(e),!l[e])throw new TypeError("'"+i(e)+"' is not valid promise mode");t.on("set",(function(r,a,i){var c=!1;if(!s(i))return o[r]=i,void t.emit("setasync",r,1);n[r]=1,p[r]=i;var l=function(e){var a=n[r];if(c)throw new Error("Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode)\nConsider to rely on 'then' or 'done' mode instead.");a&&(delete n[r],o[r]=e,t.emit("setasync",r,a))},f=function(){c=!0,n[r]&&(delete n[r],delete p[r],t.delete(r))},h=e;if(h||(h="then"),"then"===h){var d=function(){u(f)};"function"==typeof(i=i.then((function(e){u(l.bind(this,e))}),d)).finally&&i.finally(d)}else if("done"===h){if("function"!=typeof i.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");i.done(l,f)}else if("done:finally"===h){if("function"!=typeof i.done)throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if("function"!=typeof i.finally)throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");i.done(l),i.finally(f)}})),t.on("get",(function(e,r,o){var a;if(n[e])++n[e];else{a=p[e];var i=function(){t.emit("getasync",e,r,o)};s(a)?"function"==typeof a.done?a.done(i):a.then((function(){u(i)})):i()}})),t.on("delete",(function(e){if(delete p[e],n[e])delete n[e];else if(hasOwnProperty.call(o,e)){var r=o[e];delete o[e],t.emit("deleteasync",e,[r])}})),t.on("clear",(function(){var e=o;o=c(null),n=c(null),p=c(null),t.emit("clearasync",r(e,(function(e){return[e]})))}))}},function(e,t,n){"use strict";var r=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){t[e]=!0})),t}},function(e,t,n){"use strict";var r=n(132),o=n(815);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";var r=n(257);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},function(e,t,n){"use strict";var r=n(817),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,(function(e){return JSON.stringify(e).slice(1,-1)}))}},function(e,t,n){"use strict";var r=n(257);e.exports=function(e){try{return e&&r(e.toString)?e.toString():String(e)}catch(e){return"<Non-coercible to string value>"}}},function(e,t,n){"use strict";var r=n(98),o=n(193),a=n(118),i=Function.prototype.apply;a.dispose=function(e,t,n){var s;if(r(e),n.async&&a.async||n.promise&&a.promise)return t.on("deleteasync",s=function(t,n){i.call(e,null,n)}),void t.on("clearasync",(function(e){o(e,(function(e,t){s(t,e)}))}));t.on("delete",s=function(t,n){e(n)}),t.on("clear",(function(e){o(e,(function(e,t){s(t,e)}))}))}},function(e,t,n){"use strict";var r=n(258),o=n(193),a=n(260),i=n(442),s=n(820),u=n(118),c=Function.prototype,l=Math.max,p=Math.min,f=Object.create;u.maxAge=function(e,t,n){var h,d,v,m;(e=s(e))&&(h=f(null),d=n.async&&u.async||n.promise&&u.promise?"async":"",t.on("set"+d,(function(n){h[n]=setTimeout((function(){t.delete(n)}),e),"function"==typeof h[n].unref&&h[n].unref(),m&&(m[n]&&"nextTick"!==m[n]&&clearTimeout(m[n]),m[n]=setTimeout((function(){delete m[n]}),v),"function"==typeof m[n].unref&&m[n].unref())})),t.on("delete"+d,(function(e){clearTimeout(h[e]),delete h[e],m&&("nextTick"!==m[e]&&clearTimeout(m[e]),delete m[e])})),n.preFetch&&(v=!0===n.preFetch||isNaN(n.preFetch)?.333:l(p(Number(n.preFetch),1),0))&&(m={},v=(1-v)*e,t.on("get"+d,(function(e,o,s){m[e]||(m[e]="nextTick",a((function(){var a;"nextTick"===m[e]&&(delete m[e],t.delete(e),n.async&&(o=r(o)).push(c),a=t.memoized.apply(s,o),n.promise&&i(a)&&("function"==typeof a.done?a.done(c,c):a.then(c,c)))})))}))),t.on("clear"+d,(function(){o(h,(function(e){clearTimeout(e)})),h={},m&&(o(m,(function(e){"nextTick"!==e&&clearTimeout(e)})),m={})})))}},function(e,t,n){"use strict";var r=n(117),o=n(821);e.exports=function(e){if((e=r(e))>o)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(117),o=n(823),a=n(118);a.max=function(e,t,n){var i,s,u;(e=r(e))&&(s=o(e),i=n.async&&a.async||n.promise&&a.promise?"async":"",t.on("set"+i,u=function(e){void 0!==(e=s.hit(e))&&t.delete(e)}),t.on("get"+i,u),t.on("delete"+i,s.delete),t.on("clear"+i,s.clear))}},function(e,t,n){"use strict";var r=n(117),o=Object.create,a=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n=0,i=1,s=o(null),u=o(null),c=0;return e=r(e),{hit:function(r){var o=u[r],l=++c;if(s[l]=r,u[r]=l,!o){if(++n<=e)return;return r=s[i],t(r),r}if(delete s[o],i===o)for(;!a.call(s,++i);)continue},delete:t=function(e){var t=u[e];if(t&&(delete s[t],delete u[e],--n,i===t)){if(!n)return c=0,void(i=1);for(;!a.call(s,++i);)continue}},clear:function(){n=0,i=1,s=o(null),u=o(null),c=0}}}},function(e,t,n){"use strict";var r=n(194),o=n(118),a=Object.create,i=Object.defineProperties;o.refCounter=function(e,t,n){var s,u;s=a(null),u=n.async&&o.async||n.promise&&o.promise?"async":"",t.on("set"+u,(function(e,t){s[e]=t||1})),t.on("get"+u,(function(e){++s[e]})),t.on("delete"+u,(function(e){delete s[e]})),t.on("clear"+u,(function(){s={}})),i(t.memoized,{deleteRef:r((function(){var e=t.get(arguments);return null===e?null:s[e]?!--s[e]&&(t.delete(e),!0):null})),getRefCount:r((function(){var e=t.get(arguments);return null===e?0:s[e]?s[e]:0}))})}},function(e,t,n){var r=n(65),o=n(133),a=n(66).Buffer,i=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,u=0|this._e,p=0;p<16;++p)n[p]=e.readInt32BE(4*p);for(;p<80;++p)n[p]=n[p-3]^n[p-8]^n[p-14]^n[p-16];for(var f=0;f<80;++f){var h=~~(f/20),d=0|((t=r)<<5|t>>>27)+l(h,o,a,s)+u+n[f]+i[h];u=s,s=a,a=c(o),o=r,r=d}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(65),o=n(133),a=n(66).Buffer,i=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function p(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,a=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var d=~~(h/20),v=c(r)+p(d,o,a,s)+u+n[h]+i[d]|0;u=s,s=a,a=l(o),o=r,r=v}this._a=r+this._a|0,this._b=o+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,n){var r=n(65),o=n(443),a=n(133),i=n(66).Buffer,s=new Array(64);function u(){this.init(),this._w=s,a.call(this,64,56)}r(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=i.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,n){var r=n(65),o=n(444),a=n(133),i=n(66).Buffer,s=new Array(160);function u(){this.init(),this._w=s,a.call(this,128,112)}r(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=i.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,n){var r=n(830);e.exports=r},function(e,t,n){var r=n(831),o=Array.prototype;e.exports=function(e){var t=e.every;return e===o||e instanceof Array&&t===o.every?r:t}},function(e,t,n){n(832);var r=n(45);e.exports=r("Array").every},function(e,t,n){"use strict";var r=n(24),o=n(88).every,a=n(111),i=n(64),s=a("every"),u=i("every");r({target:"Array",proto:!0,forced:!s||!u},{every:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t){e.exports=function(e,t,n,r,o){return o(e,(function(e,o,a){n=r?(r=!1,e):t(n,e,o,a)})),n}},function(e,t,n){e.exports=n(835)},function(e,t,n){var r=n(836);e.exports=r},function(e,t,n){n(837);var r=n(34).Object,o=e.exports=function(e,t){return r.defineProperties(e,t)};r.defineProperties.sham&&(o.sham=!0)},function(e,t,n){var r=n(24),o=n(48);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperties:n(231)})},function(e,t,n){e.exports=n(839)},function(e,t,n){var r=n(840);e.exports=r},function(e,t,n){n(841);var r=n(34);e.exports=r.Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(24),o=n(48),a=n(842),i=n(69),s=n(104),u=n(153);r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,n,r=i(e),o=s.f,c=a(r),l={},p=0;c.length>p;)void 0!==(n=o(r,t=c[p++]))&&u(l,t,n);return l}})},function(e,t,n){var r=n(71),o=n(238),a=n(239),i=n(54);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(i(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){e.exports=n(844)},function(e,t,n){var r=n(404);e.exports=r},function(e,t,n){var r=n(846);e.exports=r},function(e,t,n){n(847);var r=n(34).Object,o=e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)};r.getOwnPropertyDescriptor.sham&&(o.sham=!0)},function(e,t,n){var r=n(24),o=n(36),a=n(69),i=n(104).f,s=n(48),u=o((function(){i(1)}));r({target:"Object",stat:!0,forced:!s||u,sham:!s},{getOwnPropertyDescriptor:function(e,t){return i(a(e),t)}})},function(e,t,n){e.exports=n(849)},function(e,t,n){var r=n(371);e.exports=r},function(e,t,n){var r=n(851);e.exports=r},function(e,t,n){n(370);var r=n(34);e.exports=r.Object.getOwnPropertySymbols},function(e,t,n){var r=n(357);e.exports=r},function(e,t,n){var r=n(390);e.exports=r},function(e,t,n){var r=n(448),o=n(447);e.exports=function(e,t){if(null==e)return{};var n,a,i={},s=o(e);for(a=0;a<s.length;a++)n=s[a],r(t).call(t,n)>=0||(i[n]=e[n]);return i}},function(e,t,n){var r=n(856);e.exports=r},function(e,t,n){n(857);var r=n(34);e.exports=r.Date.now},function(e,t,n){n(24)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},function(e,t,n){var r=n(449);e.exports=r},function(e,t,n){"use strict";var r,o,a,i,s=n(24),u=n(95),c=n(41),l=n(71),p=n(450),f=n(110),h=n(158),d=n(87),v=n(451),m=n(44),g=n(78),y=n(134),b=n(106),_=n(364),w=n(119),E=n(398),x=n(452),C=n(453).set,S=n(860),A=n(455),k=n(861),O=n(159),j=n(195),T=n(73),I=n(356),P=n(39),N=n(236),M=P("species"),R="Promise",D=T.get,L=T.set,B=T.getterFor(R),F=p,U=c.TypeError,q=c.document,z=c.process,V=l("fetch"),W=O.f,H=W,J="process"==b(z),$=!!(q&&q.createEvent&&c.dispatchEvent),K="unhandledrejection",Y=I(R,(function(){if(!(_(F)!==String(F))){if(66===N)return!0;if(!J&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!F.prototype.finally)return!0;if(N>=51&&/native code/.test(F))return!1;var e=F.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[M]=t,!(e.then((function(){}))instanceof t)})),G=Y||!E((function(e){F.all(e).catch((function(){}))})),Z=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},X=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;S((function(){for(var o=t.value,a=1==t.state,i=0;r.length>i;){var s,u,c,l=r[i++],p=a?l.ok:l.fail,f=l.resolve,h=l.reject,d=l.domain;try{p?(a||(2===t.rejection&&ne(e,t),t.rejection=1),!0===p?s=o:(d&&d.enter(),s=p(o),d&&(d.exit(),c=!0)),s===l.promise?h(U("Promise-chain cycle")):(u=Z(s))?u.call(s,f,h):f(s)):h(o)}catch(e){d&&!c&&d.exit(),h(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&ee(e,t)}))}},Q=function(e,t,n){var r,o;$?((r=q.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},(o=c["on"+e])?o(r):e===K&&k("Unhandled promise rejection",n)},ee=function(e,t){C.call(c,(function(){var n,r=t.value;if(te(t)&&(n=j((function(){J?z.emit("unhandledRejection",r,e):Q(K,e,r)})),t.rejection=J||te(t)?2:1,n.error))throw n.value}))},te=function(e){return 1!==e.rejection&&!e.parent},ne=function(e,t){C.call(c,(function(){J?z.emit("rejectionHandled",e):Q("rejectionhandled",e,t.value)}))},re=function(e,t,n,r){return function(o){e(t,n,o,r)}},oe=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,X(e,t,!0))},ae=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw U("Promise can't be resolved itself");var o=Z(n);o?S((function(){var r={done:!1};try{o.call(n,re(ae,e,r,t),re(oe,e,r,t))}catch(n){oe(e,r,n,t)}})):(t.value=n,t.state=1,X(e,t,!1))}catch(n){oe(e,{done:!1},n,t)}}};Y&&(F=function(e){y(this,F,R),g(e),r.call(this);var t=D(this);try{e(re(ae,this,t),re(oe,this,t))}catch(e){oe(this,t,e)}},(r=function(e){L(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=h(F.prototype,{then:function(e,t){var n=B(this),r=W(x(this,F));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=J?z.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&X(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=D(e);this.promise=e,this.resolve=re(ae,e,t),this.reject=re(oe,e,t)},O.f=W=function(e){return e===F||e===a?new o(e):H(e)},u||"function"!=typeof p||(i=p.prototype.then,f(p.prototype,"then",(function(e,t){var n=this;return new F((function(e,t){i.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof V&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return A(F,V.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:Y},{Promise:F}),d(F,R,!1,!0),v(R),a=l(R),s({target:R,stat:!0,forced:Y},{reject:function(e){var t=W(this);return t.reject.call(void 0,e),t.promise}}),s({target:R,stat:!0,forced:u||Y},{resolve:function(e){return A(u&&this===a?F:this,e)}}),s({target:R,stat:!0,forced:G},{all:function(e){var t=this,n=W(t),r=n.resolve,o=n.reject,a=j((function(){var n=g(t.resolve),a=[],i=0,s=1;w(e,(function(e){var u=i++,c=!1;a.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,a[u]=e,--s||r(a))}),o)})),--s||r(a)}));return a.error&&o(a.value),n.promise},race:function(e){var t=this,n=W(t),r=n.reject,o=j((function(){var o=g(t.resolve);w(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(e,t,n){var r,o,a,i,s,u,c,l,p=n(41),f=n(104).f,h=n(106),d=n(453).set,v=n(454),m=p.MutationObserver||p.WebKitMutationObserver,g=p.process,y=p.Promise,b="process"==h(g),_=f(p,"queueMicrotask"),w=_&&_.value;w||(r=function(){var e,t;for(b&&(e=g.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?i():a=void 0,e}}a=void 0,e&&e.enter()},b?i=function(){g.nextTick(r)}:m&&!v?(s=!0,u=document.createTextNode(""),new m(r).observe(u,{characterData:!0}),i=function(){u.data=s=!s}):y&&y.resolve?(c=y.resolve(void 0),l=c.then,i=function(){l.call(c,r)}):i=function(){d.call(p,r)}),e.exports=w||function(e){var t={fn:e,next:void 0};a&&(a.next=t),o||(o=t,i()),a=t}},function(e,t,n){var r=n(41);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var r=n(24),o=n(95),a=n(450),i=n(36),s=n(71),u=n(452),c=n(455),l=n(110);r({target:"Promise",proto:!0,real:!0,forced:!!a&&i((function(){a.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return c(t,e()).then((function(){return n}))}:e,n?function(n){return c(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof a||a.prototype.finally||l(a.prototype,"finally",s("Promise").prototype.finally)},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),i=new O(r||[]);return a._invoke=function(e,t,n){var r=p;return function(o,a){if(r===h)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw a;return T()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=S(i,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?d:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p="suspendedStart",f="suspendedYield",h="executing",d="completed",v={};function m(){}function g(){}function y(){}var b={};b[a]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(j([])));w&&w!==n&&r.call(w,a)&&(b=w);var E=y.prototype=m.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,s){var u=l(e[o],e,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(p).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,s)}))}s(u.arg)}var o;this._invoke=function(e,r){function a(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(a,a):a()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function j(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:T}}function T(){return{value:t,done:!0}}return g.prototype=E.constructor=y,y.constructor=g,g.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},x(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(c(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},x(E),u(E,s,"Generator"),E[a]=function(){return this},E.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=j,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:j(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){e.exports=n(865)},function(e,t,n){var r=n(449);n(866),n(867),n(868),n(869),e.exports=r},function(e,t,n){"use strict";var r=n(24),o=n(48),a=n(151),i=n(233),s=n(108),u=n(63),c=n(105),l=n(119),p=n(70),f=n(73),h=f.set,d=f.getterFor("AggregateError"),v=function(e,t){var n=this;if(!(n instanceof v))return new v(e,t);i&&(n=i(new Error(t),a(n)));var r=[];return l(e,r.push,r),o?h(n,{errors:r,type:"AggregateError"}):n.errors=r,void 0!==t&&p(n,"message",String(t)),n};v.prototype=s(Error.prototype,{constructor:c(5,v),message:c(5,""),name:c(5,"AggregateError")}),o&&u.f(v.prototype,"errors",{get:function(){return d(this).errors},configurable:!0}),r({global:!0},{AggregateError:v})},function(e,t,n){n(456)},function(e,t,n){"use strict";var r=n(24),o=n(159),a=n(195);r({target:"Promise",stat:!0},{try:function(e){var t=o.f(this),n=a(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}})},function(e,t,n){"use strict";var r=n(24),o=n(78),a=n(71),i=n(159),s=n(195),u=n(119),c="No one promise resolved";r({target:"Promise",stat:!0},{any:function(e){var t=this,n=i.f(t),r=n.resolve,l=n.reject,p=s((function(){var n=o(t.resolve),i=[],s=0,p=1,f=!1;u(e,(function(e){var o=s++,u=!1;i.push(void 0),p++,n.call(t,e).then((function(e){u||f||(f=!0,r(e))}),(function(e){u||f||(u=!0,i[o]=e,--p||l(new(a("AggregateError"))(i,c)))}))})),--p||l(new(a("AggregateError"))(i,c))}));return p.error&&l(p.value),n.promise}})},function(e,t,n){var r=n(374);e.exports=r},function(e,t,n){"use strict";var r=n(872),o=n(891);function a(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(50),e.exports.Schema=n(136),e.exports.FAILSAFE_SCHEMA=n(261),e.exports.JSON_SCHEMA=n(458),e.exports.CORE_SCHEMA=n(457),e.exports.DEFAULT_SAFE_SCHEMA=n(161),e.exports.DEFAULT_FULL_SCHEMA=n(196),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(160),e.exports.MINIMAL_SCHEMA=n(261),e.exports.SAFE_SCHEMA=n(161),e.exports.DEFAULT_SCHEMA=n(196),e.exports.scan=a("scan"),e.exports.parse=a("parse"),e.exports.compose=a("compose"),e.exports.addConstructor=a("addConstructor")},function(e,t,n){"use strict";var r=n(135),o=n(160),a=n(873),i=n(161),s=n(196),u=Object.prototype.hasOwnProperty,c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,l=/[\x85\u2028\u2029]/,p=/[,\[\]\{\}]/,f=/^(?:!|!!|![a-z\-]+!)$/i,h=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function d(e){return Object.prototype.toString.call(e)}function v(e){return 10===e||13===e}function m(e){return 9===e||32===e}function g(e){return 9===e||32===e||10===e||13===e}function y(e){return 44===e||91===e||93===e||123===e||125===e}function b(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function _(e){return 48===e?"\0":97===e?"\a":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"\e":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"\85":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function w(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var E=new Array(256),x=new Array(256),C=0;C<256;C++)E[C]=_(C)?1:0,x[C]=_(C);function S(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function A(e,t){return new o(t,new a(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function k(e,t){throw A(e,t)}function O(e,t){e.onWarning&&e.onWarning.call(null,A(e,t))}var j={YAML:function(e,t,n){var r,o,a;null!==e.version&&k(e,"duplication of %YAML directive"),1!==n.length&&k(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&k(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),a=parseInt(r[2],10),1!==o&&k(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,1!==a&&2!==a&&O(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&k(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],f.test(r)||k(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&k(e,'there is a previously declared suffix for "'+r+'" tag handle'),h.test(o)||k(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=o}};function T(e,t,n,r){var o,a,i,s;if(t<n){if(s=e.input.slice(t,n),r)for(o=0,a=s.length;o<a;o+=1)9===(i=s.charCodeAt(o))||32<=i&&i<=1114111||k(e,"expected valid JSON character");else c.test(s)&&k(e,"the stream contains non-printable characters");e.result+=s}}function I(e,t,n,o){var a,i,s,c;for(r.isObject(n)||k(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,c=(a=Object.keys(n)).length;s<c;s+=1)i=a[s],u.call(t,i)||(t[i]=n[i],o[i]=!0)}function P(e,t,n,r,o,a,i,s){var c,l;if(Array.isArray(o))for(c=0,l=(o=Array.prototype.slice.call(o)).length;c<l;c+=1)Array.isArray(o[c])&&k(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===d(o[c])&&(o[c]="[object Object]");if("object"==typeof o&&"[object Object]"===d(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(a))for(c=0,l=a.length;c<l;c+=1)I(e,t,a[c],n);else I(e,t,a,n);else e.json||u.call(n,o)||!u.call(t,o)||(e.line=i||e.line,e.position=s||e.position,k(e,"duplicated mapping key")),t[o]=a,delete n[o];return t}function N(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):k(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function M(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){for(;m(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!v(o))break;for(N(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&O(e,"deficient indentation"),r}function R(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!g(t)))}function D(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function L(e,t){var n,r,o=e.tag,a=e.anchor,i=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),r=e.input.charCodeAt(e.position);0!==r&&45===r&&g(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,M(e,!0,-1)&&e.lineIndent<=t)i.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,U(e,t,3,!1,!0),i.push(e.result),M(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)k(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=o,e.anchor=a,e.kind="sequence",e.result=i,!0)}function B(e){var t,n,r,o,a=!1,i=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&k(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(a=!0,o=e.input.charCodeAt(++e.position)):33===o?(i=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,a){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):k(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!g(o);)33===o&&(i?k(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),f.test(n)||k(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),p.test(r)&&k(e,"tag suffix cannot contain flow indicator characters")}return r&&!h.test(r)&&k(e,"tag name cannot contain such characters: "+r),a?e.tag=r:u.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:k(e,'undeclared tag handle "'+n+'"'),!0}function F(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&k(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!g(n)&&!y(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&k(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function U(e,t,n,o,a){var i,s,c,l,p,f,h,d,_=1,C=!1,S=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=c=4===n||3===n,o&&M(e,!0,-1)&&(C=!0,e.lineIndent>t?_=1:e.lineIndent===t?_=0:e.lineIndent<t&&(_=-1)),1===_)for(;B(e)||F(e);)M(e,!0,-1)?(C=!0,c=i,e.lineIndent>t?_=1:e.lineIndent===t?_=0:e.lineIndent<t&&(_=-1)):c=!1;if(c&&(c=C||a),1!==_&&4!==n||(h=1===n||2===n?t:t+1,d=e.position-e.lineStart,1===_?c&&(L(e,d)||function(e,t,n){var r,o,a,i,s,u=e.tag,c=e.anchor,l={},p={},f=null,h=null,d=null,v=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),a=e.line,i=e.position,63!==s&&58!==s||!g(r)){if(!U(e,n,2,!1,!0))break;if(e.line===a){for(s=e.input.charCodeAt(e.position);m(s);)s=e.input.charCodeAt(++e.position);if(58===s)g(s=e.input.charCodeAt(++e.position))||k(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(P(e,l,p,f,h,null),f=h=d=null),y=!0,v=!1,o=!1,f=e.tag,h=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;k(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;k(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(v&&(P(e,l,p,f,h,null),f=h=d=null),y=!0,v=!0,o=!0):v?(v=!1,o=!0):k(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===a||e.lineIndent>t)&&(U(e,t,4,!0,o)&&(v?h=e.result:d=e.result),v||(P(e,l,p,f,h,d,a,i),f=h=d=null),M(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)k(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&P(e,l,p,f,h,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=l),y}(e,d,h))||function(e,t){var n,r,o,a,i,s,u,c,l,p,f=!0,h=e.tag,d=e.anchor,v={};if(91===(p=e.input.charCodeAt(e.position)))o=93,s=!1,r=[];else{if(123!==p)return!1;o=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),p=e.input.charCodeAt(++e.position);0!==p;){if(M(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=h,e.anchor=d,e.kind=s?"mapping":"sequence",e.result=r,!0;f||k(e,"missed comma between flow collection entries"),l=null,a=i=!1,63===p&&g(e.input.charCodeAt(e.position+1))&&(a=i=!0,e.position++,M(e,!0,t)),n=e.line,U(e,t,1,!1,!0),c=e.tag,u=e.result,M(e,!0,t),p=e.input.charCodeAt(e.position),!i&&e.line!==n||58!==p||(a=!0,p=e.input.charCodeAt(++e.position),M(e,!0,t),U(e,t,1,!1,!0),l=e.result),s?P(e,r,v,c,u,l):a?r.push(P(e,null,v,c,u,l)):r.push(u),M(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(f=!0,p=e.input.charCodeAt(++e.position)):f=!1}k(e,"unexpected end of the stream within a flow collection")}(e,h)?S=!0:(s&&function(e,t){var n,o,a,i,s,u=1,c=!1,l=!1,p=t,f=0,h=!1;if(124===(i=e.input.charCodeAt(e.position)))o=!1;else{if(62!==i)return!1;o=!0}for(e.kind="scalar",e.result="";0!==i;)if(43===(i=e.input.charCodeAt(++e.position))||45===i)1===u?u=43===i?3:2:k(e,"repeat of a chomping mode identifier");else{if(!((a=48<=(s=i)&&s<=57?s-48:-1)>=0))break;0===a?k(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?k(e,"repeat of an indentation width identifier"):(p=t+a-1,l=!0)}if(m(i)){do{i=e.input.charCodeAt(++e.position)}while(m(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!v(i)&&0!==i)}for(;0!==i;){for(N(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!l||e.lineIndent<p)&&32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>p&&(p=e.lineIndent),v(i))f++;else{if(e.lineIndent<p){3===u?e.result+=r.repeat("\n",c?1+f:f):1===u&&c&&(e.result+="\n");break}for(o?m(i)?(h=!0,e.result+=r.repeat("\n",c?1+f:f)):h?(h=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,l=!0,f=0,n=e.position;!v(i)&&0!==i;)i=e.input.charCodeAt(++e.position);T(e,n,e.position,!1)}}return!0}(e,h)||function(e,t){var n,r,o;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(T(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,o=e.position}else v(n)?(T(e,r,o,!0),D(e,M(e,!1,t)),r=o=e.position):e.position===e.lineStart&&R(e)?k(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);k(e,"unexpected end of the stream within a single quoted scalar")}(e,h)||function(e,t){var n,r,o,a,i,s,u;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return T(e,n,e.position,!0),e.position++,!0;if(92===s){if(T(e,n,e.position,!0),v(s=e.input.charCodeAt(++e.position)))M(e,!1,t);else if(s<256&&E[s])e.result+=x[s],e.position++;else if((i=120===(u=s)?2:117===u?4:85===u?8:0)>0){for(o=i,a=0;o>0;o--)(i=b(s=e.input.charCodeAt(++e.position)))>=0?a=(a<<4)+i:k(e,"expected hexadecimal character");e.result+=w(a),e.position++}else k(e,"unknown escape sequence");n=r=e.position}else v(s)?(T(e,n,r,!0),D(e,M(e,!1,t)),n=r=e.position):e.position===e.lineStart&&R(e)?k(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}k(e,"unexpected end of the stream within a double quoted scalar")}(e,h)?S=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!g(r)&&!y(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&k(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||k(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],M(e,!0,-1),!0}(e)?function(e,t,n){var r,o,a,i,s,u,c,l,p=e.kind,f=e.result;if(g(l=e.input.charCodeAt(e.position))||y(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(g(r=e.input.charCodeAt(e.position+1))||n&&y(r)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,i=!1;0!==l;){if(58===l){if(g(r=e.input.charCodeAt(e.position+1))||n&&y(r))break}else if(35===l){if(g(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&R(e)||n&&y(l))break;if(v(l)){if(s=e.line,u=e.lineStart,c=e.lineIndent,M(e,!1,-1),e.lineIndent>=t){i=!0,l=e.input.charCodeAt(e.position);continue}e.position=a,e.line=s,e.lineStart=u,e.lineIndent=c;break}}i&&(T(e,o,a,!1),D(e,e.line-s),o=a=e.position,i=!1),m(l)||(a=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,o,a,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,h,1===n)&&(S=!0,null===e.tag&&(e.tag="?")):(S=!0,null===e.tag&&null===e.anchor||k(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===_&&(S=c&&L(e,d))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(l=0,p=e.implicitTypes.length;l<p;l+=1)if((f=e.implicitTypes[l]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else u.call(e.typeMap[e.kind||"fallback"],e.tag)?(f=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&f.kind!==e.kind&&k(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result)?(e.result=f.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):k(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):k(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||S}function q(e){var t,n,r,o,a=e.position,i=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(M(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(i=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!g(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&k(e,"directive name must not be less than one character in length");0!==o;){for(;m(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!v(o));break}if(v(o))break;for(t=e.position;0!==o&&!g(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&N(e),u.call(j,n)?j[n](e,n,r):O(e,'unknown document directive "'+n+'"')}M(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,M(e,!0,-1)):i&&k(e,"directives end mark is expected"),U(e,e.lineIndent-1,4,!1,!0),M(e,!0,-1),e.checkLineBreaks&&l.test(e.input.slice(a,e.position))&&O(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&R(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,M(e,!0,-1)):e.position<e.length-1&&k(e,"end of the stream or a document separator is expected")}function z(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new S(e,t);for(n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)q(n);return n.documents}function V(e,t,n){var r,o,a=z(e,n);if("function"!=typeof t)return a;for(r=0,o=a.length;r<o;r+=1)t(a[r])}function W(e,t){var n=z(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=V,e.exports.load=W,e.exports.safeLoadAll=function(e,t,n){if("function"!=typeof t)return V(e,r.extend({schema:i},n));V(e,t,r.extend({schema:i},n))},e.exports.safeLoad=function(e,t){return W(e,r.extend({schema:i},t))}},function(e,t,n){"use strict";var r=n(135);function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=o}o.prototype.getSnippet=function(e,t){var n,o,a,i,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",o=this.position;o>0&&-1==="\0\r\n\85\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){n=" ... ",o+=5;break}for(a="",i=this.position;i<this.buffer.length&&-1==="\0\r\n\85\u2028\u2029".indexOf(this.buffer.charAt(i));)if((i+=1)-this.position>t/2-1){a=" ... ",i-=5;break}return s=this.buffer.slice(o,i),r.repeat(" ",e)+n+s+a+"\n"+r.repeat(" ",e+this.position-o+n.length)+"^"},o.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=o},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(135),o=n(50);function a(e){return 48<=e&&e<=55}function i(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,o=0,s=!1;if(!r)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===r)return!0;if("b"===(t=e[++o])){for(o++;o<r;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(o++;o<r;o++)if("_"!==(t=e[o])){if(!(48<=(n=e.charCodeAt(o))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}for(;o<r;o++)if("_"!==(t=e[o])){if(!a(e.charCodeAt(o)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;o<r;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!i(e.charCodeAt(o)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,n,r=e,o=1,a=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(o=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?o*parseInt(r.slice(2),2):"x"===r[1]?o*parseInt(r,16):o*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach((function(e){a.unshift(parseInt(e,10))})),r=0,n=1,a.forEach((function(e){r+=e*n,n*=60})),o*r):o*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,n){"use strict";var r=n(135),o=n(50),a=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var i=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!a.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,o;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){o.unshift(parseFloat(e,10))})),t=0,r=1,o.forEach((function(e){t+=e*r,r*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),i.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},function(e,t,n){"use strict";var r=n(50),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==a.exec(e))},construct:function(e){var t,n,r,i,s,u,c,l,p=0,f=null;if(null===(t=o.exec(e))&&(t=a.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],u=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),l=new Date(Date.UTC(n,r,i,s,u,c,p)),f&&l.setTime(l.getTime()-f),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,n){"use strict";var r;try{r=n(76).Buffer}catch(e){}var o=n(50),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,i=a;for(n=0;n<o;n++)if(!((t=i.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,o=e.replace(/[\r\n=]/g,""),i=o.length,s=a,u=0,c=[];for(t=0;t<i;t++)t%4==0&&t&&(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|s.indexOf(o.charAt(t));return 0===(n=i%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",o=0,i=e.length,s=a;for(t=0;t<i;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0===(n=i%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},function(e,t,n){"use strict";var r=n(50),o=Object.prototype.hasOwnProperty,a=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,s,u=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==a.call(r))return!1;for(i in r)if(o.call(r,i)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,n){"use strict";var r=n(50),o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,i,s=e;for(i=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==o.call(r))return!1;if(1!==(a=Object.keys(r)).length)return!1;i[t]=[a[0],r[a[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,o,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1)r=i[t],o=Object.keys(r),a[t]=[o[0],r[o[0]]];return a}})},function(e,t,n){"use strict";var r=n(50),o=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,n){"use strict";var r=n(50);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,n){"use strict";var r;try{r=n(890)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var o=n(50);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",o=r.parse(n,{range:!0}),a=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach((function(e){a.push(e.name)})),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(a,n.slice(t[0]+1,t[1]-1)):new Function(a,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(t,n){if(void 0===e){var r=new Error("Cannot find module 'esprima'");throw r.code="MODULE_NOT_FOUND",r}t.exports=e},function(e,t,n){"use strict";var r=n(135),o=n(160),a=n(196),i=n(161),s=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},l=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function p(e){var t,n,a;if(t=e.toString(16).toUpperCase(),e<=255)n="x",a=2;else if(e<=65535)n="u",a=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");n="U",a=8}return"\\"+n+r.repeat("0",a-t.length)+t}function f(e){this.schema=e.schema||a,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,o,a,i,s,c;if(null===t)return{};for(n={},o=0,a=(r=Object.keys(t)).length;o<a;o+=1)i=r[o],s=String(t[i]),"!!"===i.slice(0,2)&&(i="tag:yaml.org,2002:"+i.slice(2)),(c=e.compiledTypeMap.fallback[i])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[i]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function h(e,t){for(var n,o=r.repeat(" ",t),a=0,i=-1,s="",u=e.length;a<u;)-1===(i=e.indexOf("\n",a))?(n=e.slice(a),a=u):(n=e.slice(a,i+1),a=i+1),n.length&&"\n"!==n&&(s+=o),s+=n;return s}function d(e,t){return"\n"+r.repeat(" ",e.indent*t)}function v(e){return 32===e||9===e}function m(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function g(e){return m(e)&&65279!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&58!==e&&35!==e}function y(e){return/^\n* /.test(e)}function b(e,t,n,r,o){var a,i,s,u=!1,c=!1,l=-1!==r,p=-1,f=m(s=e.charCodeAt(0))&&65279!==s&&!v(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&!v(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(!m(i=e.charCodeAt(a)))return 5;f=f&&g(i)}else{for(a=0;a<e.length;a++){if(10===(i=e.charCodeAt(a)))u=!0,l&&(c=c||a-p-1>r&&" "!==e[p+1],p=a);else if(!m(i))return 5;f=f&&g(i)}c=c||l&&a-p-1>r&&" "!==e[p+1]}return u||c?n>9&&y(e)?5:c?4:3:f&&!o(e)?1:2}function _(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==l.indexOf(t))return"'"+t+"'";var a=e.indent*Math.max(1,n),i=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;switch(b(t,s,e.indent,i,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}))){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+w(t,e.indent)+E(h(t,a));case 4:return">"+w(t,e.indent)+E(h(function(e,t){var n,r,o=/(\n+)([^\n]*)/g,a=(s=e.indexOf("\n"),s=-1!==s?s:e.length,o.lastIndex=s,x(e.slice(0,s),t)),i="\n"===e[0]||" "===e[0];var s;for(;r=o.exec(e);){var u=r[1],c=r[2];n=" "===c[0],a+=u+(i||n||""===c?"":"\n")+x(c,t),i=n}return a}(t,i),a));case 5:return'"'+function(e){for(var t,n,r,o="",a=0;a<e.length;a++)(t=e.charCodeAt(a))>=55296&&t<=56319&&(n=e.charCodeAt(a+1))>=56320&&n<=57343?(o+=p(1024*(t-55296)+n-56320+65536),a++):o+=!(r=c[t])&&m(t)?e[a]:r||p(t);return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function w(e,t){var n=y(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function E(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function x(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,a=0,i=0,s=0,u="";n=o.exec(e);)(s=n.index)-a>t&&(r=i>a?i:s,u+="\n"+e.slice(a,r),a=r+1),i=s;return u+="\n",e.length-a>t&&i>a?u+=e.slice(a,i)+"\n"+e.slice(i+1):u+=e.slice(a),u.slice(1)}function C(e,t,n){var r,a,i,c,l,p;for(i=0,c=(a=n?e.explicitTypes:e.implicitTypes).length;i<c;i+=1)if(((l=a[i]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(p=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===s.call(l.represent))r=l.represent(t,p);else{if(!u.call(l.represent,p))throw new o("!<"+l.tag+'> tag resolver accepts not "'+p+'" style');r=l.represent[p](t,p)}e.dump=r}return!0}return!1}function S(e,t,n,r,a,i){e.tag=null,e.dump=n,C(e,n,!1)||C(e,n,!0);var u=s.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,l,p="[object Object]"===u||"[object Array]"===u;if(p&&(l=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||l||2!==e.indent&&t>0)&&(a=!1),l&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(p&&l&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var a,i,s,u,c,l,p="",f=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(a=0,i=h.length;a<i;a+=1)l="",r&&0===a||(l+=d(e,t)),u=n[s=h[a]],S(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=d(e,t)),S(e,t+1,u,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?l+=":":l+=": ",p+=l+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,a),l&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,a,i,s,u="",c=e.tag,l=Object.keys(n);for(r=0,o=l.length;r<o;r+=1)s=e.condenseFlow?'"':"",0!==r&&(s+=", "),i=n[a=l[r]],S(e,t,a,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),S(e,t,i,!1,!1)&&(u+=s+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),l&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var f=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(!function(e,t,n,r){var o,a,i="",s=e.tag;for(o=0,a=n.length;o<a;o+=1)S(e,t+1,n[o],!0,!0)&&(r&&0===o||(i+=d(e,t)),e.dump&&10===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}(e,f,e.dump,a),l&&(e.dump="&ref_"+c+e.dump)):(!function(e,t,n){var r,o,a="",i=e.tag;for(r=0,o=n.length;r<o;r+=1)S(e,t,n[r],!1,!1)&&(0!==r&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=i,e.dump="["+a+"]"}(e,f,e.dump),l&&(e.dump="&ref_"+c+" "+e.dump))}else{if("[object String]"!==u){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&_(e,e.dump,t,i)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function A(e,t){var n,r,o=[],a=[];for(k(e,o,a),n=0,r=a.length;n<r;n+=1)t.duplicates.push(o[a[n]]);t.usedDuplicates=new Array(r)}function k(e,t,n){var r,o,a;if(null!==e&&"object"==typeof e)if(-1!==(o=t.indexOf(e)))-1===n.indexOf(o)&&n.push(o);else if(t.push(e),Array.isArray(e))for(o=0,a=e.length;o<a;o+=1)k(e[o],t,n);else for(o=0,a=(r=Object.keys(e)).length;o<a;o+=1)k(e[r[o]],t,n)}function O(e,t){var n=new f(t=t||{});return n.noRefs||A(e,n),S(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=O,e.exports.safeDump=function(e,t){return O(e,r.extend({schema:i},t))}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,o,a=[];for(o in"string"!=typeof t&&(t="?"),e)if(r.call(e,o)){if((n=e[o])||null!=n&&!isNaN(n)||(n=""),o=encodeURIComponent(o),n=encodeURIComponent(n),null===o||null===n)continue;a.push(o+"="+n)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var a=o(t[1]),i=o(t[2]);null===a||null===i||a in r||(r[a]=i)}return r}},function(e,t,n){var r=n(74);e.exports=function(){return r.Date.now()}},function(e,t,n){e.exports=n(896)},function(e,t,n){var r=n(376);e.exports=r},function(e,t,n){e.exports=n(898)},function(e,t,n){var r=n(462);e.exports=r},function(e,t,n){n(24)({target:"Object",stat:!0,sham:!n(48)},{create:n(108)})},function(e,t,n){var r=n(463);function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t,e},o(t,n)}e.exports=o},function(e,t,n){var r=n(902);e.exports=r},function(e,t,n){n(903);var r=n(34);e.exports=r.Object.setPrototypeOf},function(e,t,n){n(24)({target:"Object",stat:!0},{setPrototypeOf:n(233)})},function(e,t,n){var r=n(905);e.exports=r},function(e,t,n){n(906);var r=n(34);e.exports=r.Reflect.construct},function(e,t,n){var r=n(24),o=n(71),a=n(78),i=n(54),s=n(44),u=n(108),c=n(378),l=n(36),p=o("Reflect","construct"),f=l((function(){function e(){}return!(p((function(){}),[],e)instanceof e)})),h=!l((function(){p((function(){}))})),d=f||h;r({target:"Reflect",stat:!0,forced:d,sham:d},{construct:function(e,t){a(e),i(t);var n=arguments.length<3?e:a(arguments[2]);if(h&&!f)return p(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(c.apply(e,r))}var o=n.prototype,l=u(s(o)?o:Object.prototype),d=Function.apply.call(e,l,t);return s(d)?d:l}})},function(e,t,n){e.exports=n(908)},function(e,t,n){var r=n(909);e.exports=r},function(e,t,n){n(910);var r=n(34);e.exports=r.Object.getPrototypeOf},function(e,t,n){var r=n(24),o=n(36),a=n(72),i=n(151),s=n(367);r({target:"Object",stat:!0,forced:o((function(){i(1)})),sham:!s},{getPrototypeOf:function(e){return i(a(e))}})},function(e,t,n){var r=n(464);e.exports=function(){if("undefined"==typeof Reflect||!r)return!1;if(r.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(r(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t,n){var r=n(20),o=n(10);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";var r=n(42),o=n(914),a=n(488),i=n(138),s=n(82),u=n(986),c=n(987),l=n(489),p=n(988);n(33);o.inject();var f={findDOMNode:c,render:a.render,unmountComponentAtNode:a.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=l(e)),e?r.getNodeFromInstance(e):null}},Mount:a,Reconciler:i}),e.exports=f},function(e,t,n){"use strict";var r=n(915),o=n(916),a=n(920),i=n(923),s=n(924),u=n(925),c=n(926),l=n(932),p=n(42),f=n(957),h=n(958),d=n(959),v=n(960),m=n(961),g=n(963),y=n(964),b=n(970),_=n(971),w=n(972),E=!1;e.exports={inject:function(){E||(E=!0,g.EventEmitter.injectReactEventListener(m),g.EventPluginHub.injectEventPluginOrder(i),g.EventPluginUtils.injectComponentTree(p),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:s,ChangeEventPlugin:a,SelectEventPlugin:_,BeforeInputEventPlugin:o}),g.HostComponent.injectGenericComponentClass(l),g.HostComponent.injectTextComponentClass(d),g.DOMProperty.injectDOMPropertyConfig(r),g.DOMProperty.injectDOMPropertyConfig(u),g.DOMProperty.injectDOMPropertyConfig(b),g.EmptyComponent.injectEmptyComponentFactory((function(e){return new f(e)})),g.Updates.injectReconcileTransaction(y),g.Updates.injectBatchingStrategy(v),g.Component.injectEnvironment(c))}}},function(e,t,n){"use strict";e.exports={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}}},function(e,t,n){"use strict";var r=n(162),o=n(57),a=n(917),i=n(918),s=n(919),u=[9,13,27,32],c=o.canUseDOM&&"CompositionEvent"in window,l=null;o.canUseDOM&&"documentMode"in document&&(l=document.documentMode);var p,f=o.canUseDOM&&"TextEvent"in window&&!l&&!("object"==typeof(p=window.opera)&&"function"==typeof p.version&&parseInt(p.version(),10)<=12),h=o.canUseDOM&&(!c||l&&l>8&&l<=11);var d=String.fromCharCode(32),v={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},m=!1;function g(e,t){switch(e){case"topKeyUp":return-1!==u.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function y(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}var b=null;function _(e,t,n,o){var s,u;if(c?s=function(e){switch(e){case"topCompositionStart":return v.compositionStart;case"topCompositionEnd":return v.compositionEnd;case"topCompositionUpdate":return v.compositionUpdate}}(e):b?g(e,n)&&(s=v.compositionEnd):function(e,t){return"topKeyDown"===e&&229===t.keyCode}(e,n)&&(s=v.compositionStart),!s)return null;h&&(b||s!==v.compositionStart?s===v.compositionEnd&&b&&(u=b.getData()):b=a.getPooled(o));var l=i.getPooled(s,t,n,o);if(u)l.data=u;else{var p=y(n);null!==p&&(l.data=p)}return r.accumulateTwoPhaseDispatches(l),l}function w(e,t,n,o){var i;if(!(i=f?function(e,t){switch(e){case"topCompositionEnd":return y(t);case"topKeyPress":return 32!==t.which?null:(m=!0,d);case"topTextInput":var n=t.data;return n===d&&m?null:n;default:return null}}(e,n):function(e,t){if(b){if("topCompositionEnd"===e||!c&&g(e,t)){var n=b.getData();return a.release(b),b=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!function(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return h?null:t.data;default:return null}}(e,n)))return null;var u=s.getPooled(v.beforeInput,t,n,o);return u.data=i,r.accumulateTwoPhaseDispatches(u),u}var E={eventTypes:v,extractEvents:function(e,t,n,r){return[_(e,t,n,r),w(e,t,n,r)]}};e.exports=E},function(e,t,n){"use strict";var r=n(40),o=n(120),a=n(468);function i(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}r(i.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(i),e.exports=i},function(e,t,n){"use strict";var r=n(92);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(92);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{data:null}),e.exports=o},function(e,t,n){"use strict";var r=n(163),o=n(162),a=n(57),i=n(42),s=n(82),u=n(92),c=n(471),l=n(265),p=n(266),f=n(472),h={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}};function d(e,t,n){var r=u.getPooled(h.change,e,t,n);return r.type="change",o.accumulateTwoPhaseDispatches(r),r}var v=null,m=null;var g=!1;function y(e){var t=d(m,e,l(e));s.batchedUpdates(b,t)}function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}function _(){v&&(v.detachEvent("onchange",y),v=null,m=null)}function w(e,t){var n=c.updateValueIfChanged(e),r=!0===t.simulated&&I._allowSimulatedPassThrough;if(n||r)return e}function E(e,t){if("topChange"===e)return t}function x(e,t,n){"topFocus"===e?(_(),function(e,t){m=t,(v=e).attachEvent("onchange",y)}(t,n)):"topBlur"===e&&_()}a.canUseDOM&&(g=p("change")&&(!document.documentMode||document.documentMode>8));var C=!1;function S(){v&&(v.detachEvent("onpropertychange",A),v=null,m=null)}function A(e){"value"===e.propertyName&&w(m,e)&&y(e)}function k(e,t,n){"topFocus"===e?(S(),function(e,t){m=t,(v=e).attachEvent("onpropertychange",A)}(t,n)):"topBlur"===e&&S()}function O(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return w(m,n)}function j(e,t,n){if("topClick"===e)return w(t,n)}function T(e,t,n){if("topInput"===e||"topChange"===e)return w(t,n)}a.canUseDOM&&(C=p("input")&&(!document.documentMode||document.documentMode>9));var I={eventTypes:h,_allowSimulatedPassThrough:!0,_isInputEventSupported:C,extractEvents:function(e,t,n,r){var o,a,s,u,c=t?i.getNodeFromInstance(t):window;if("select"===(u=(s=c).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type?g?o=E:a=x:f(c)?C?o=T:(o=O,a=k):function(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}(c)&&(o=j),o){var l=o(e,t,n);if(l)return d(l,n,r)}a&&a(e,c,t),"topBlur"===e&&function(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}(t,c)}};e.exports=I},function(e,t,n){"use strict";var r=n(922),o={};o.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}(n,e,t._owner)}},o.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var o=null,a=null;return null!==t&&"object"==typeof t&&(o=t.ref,a=t._owner),n!==o||"string"==typeof o&&a!==r},o.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&function(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}(n,e,t._owner)}},e.exports=o},function(e,t,n){"use strict";var r=n(31);n(25);function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var a={addComponentAsRefTo:function(e,t,n){o(n)||r("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(n)||r("120");var a=n.getPublicInstance();a&&a.refs[t]===e.getPublicInstance()&&n.detachRef(t)}};e.exports=a},function(e,t,n){"use strict";e.exports=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"]},function(e,t,n){"use strict";var r=n(162),o=n(42),a=n(199),i={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:i,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u,c,l;if(s.window===s)u=s;else{var p=s.ownerDocument;u=p?p.defaultView||p.parentWindow:window}if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;l=f?o.getClosestInstanceFromNode(f):null}else c=null,l=t;if(c===l)return null;var h=null==c?u:o.getNodeFromInstance(c),d=null==l?u:o.getNodeFromInstance(l),v=a.getPooled(i.mouseLeave,c,n,s);v.type="mouseleave",v.target=h,v.relatedTarget=d;var m=a.getPooled(i.mouseEnter,l,n,s);return m.type="mouseenter",m.target=d,m.relatedTarget=h,r.accumulateEnterLeaveDispatches(v,m,c,l),[v,m]}};e.exports=s},function(e,t,n){"use strict";var r=n(137),o=r.injection.MUST_USE_PROPERTY,a=r.injection.HAS_BOOLEAN_VALUE,i=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|a,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:a,defer:a,dir:0,disabled:a,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|a,muted:o|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:s,rowSpan:i,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:o|a,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:i,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");("number"!==e.type||!1===e.hasAttribute("value")||e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e)&&e.setAttribute("value",""+t)}}};e.exports=c},function(e,t,n){"use strict";var r=n(268),o={processChildrenUpdates:n(931).dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";var r=n(31),o=n(139),a=n(57),i=n(928),s=n(81),u=(n(25),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(a.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=i(t,s)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=n(57),o=n(929),a=n(930),i=n(25),s=r.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;e.exports=function(e,t){var n=s;s||i(!1);var r=function(e){var t=e.match(u);return t&&t[1].toLowerCase()}(e),c=r&&a(r);if(c){n.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t||i(!1),o(p).forEach(t));for(var f=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return f}},function(e,t,n){"use strict";var r=n(25);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},function(e,t,n){"use strict";var r=n(57),o=n(25),a=r.canUseDOM?document.createElement("div"):null,i={},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,'<svg xmlns="http://www.w3.org/2000/svg">',"</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c};["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"].forEach((function(e){p[e]=l,i[e]=!0})),e.exports=function(e){return a||o(!1),p.hasOwnProperty(e)||(e="*"),i.hasOwnProperty(e)||(a.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",i[e]=!a.firstChild),i[e]?p[e]:null}},function(e,t,n){"use strict";var r=n(268),o=n(42),a={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=a},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(933),i=n(934),s=n(139),u=n(269),c=n(137),l=n(477),p=n(163),f=n(262),h=n(202),d=n(465),v=n(42),m=n(944),g=n(946),y=n(478),b=n(947),_=(n(75),n(948)),w=n(955),E=(n(81),n(201)),x=(n(25),n(266),n(273),n(471)),C=(n(277),n(33),d),S=p.deleteListener,A=v.getNodeFromInstance,k=h.listenTo,O=f.registrationNameModules,j={string:!0,number:!0},T="style",I={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null};function P(e,t){t&&(W[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",function(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}(e)))}function N(e,t,n,r){if(!(r instanceof w)){0;var o=e._hostContainerInfo,a=o._node&&11===o._node.nodeType?o._node:o._ownerDocument;k(t,a),r.getReactMountReady().enqueue(M,{inst:e,registrationName:t,listener:n})}}function M(){var e=this;p.putListener(e.inst,e.registrationName,e.listener)}function R(){m.postMountWrapper(this)}function D(){b.postMountWrapper(this)}function L(){g.postMountWrapper(this)}var B={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"};function F(){x.track(this)}function U(){var e=this;e._rootNodeID||r("63");var t=A(e);switch(t||r("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[h.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":for(var n in e._wrapperState.listeners=[],B)B.hasOwnProperty(n)&&e._wrapperState.listeners.push(h.trapBubbledEvent(n,B[n],t));break;case"source":e._wrapperState.listeners=[h.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[h.trapBubbledEvent("topError","error",t),h.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[h.trapBubbledEvent("topReset","reset",t),h.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[h.trapBubbledEvent("topInvalid","invalid",t)]}}function q(){y.postUpdateWrapper(this)}var z={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},V={listing:!0,pre:!0,textarea:!0},W=o({menuitem:!0},z),H=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,J={},$={}.hasOwnProperty;function K(e,t){return e.indexOf("-")>=0||null!=t.is}var Y=1;function G(e){var t=e.type;!function(e){$.call(J,e)||(H.test(e)||r("65",e),J[e]=!0)}(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}G.displayName="ReactDOMComponent",G.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Y++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o,i,c,p=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(U,this);break;case"input":m.mountWrapper(this,p,t),p=m.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(U,this);break;case"option":g.mountWrapper(this,p,t),p=g.getHostProps(this,p);break;case"select":y.mountWrapper(this,p,t),p=y.getHostProps(this,p),e.getReactMountReady().enqueue(U,this);break;case"textarea":b.mountWrapper(this,p,t),p=b.getHostProps(this,p),e.getReactMountReady().enqueue(F,this),e.getReactMountReady().enqueue(U,this)}if(P(this,p),null!=t?(o=t._namespaceURI,i=t._tag):n._tag&&(o=n._namespaceURI,i=n._tag),(null==o||o===u.svg&&"foreignobject"===i)&&(o=u.html),o===u.html&&("svg"===this._tag?o=u.svg:"math"===this._tag&&(o=u.mathml)),this._namespaceURI=o,e.useCreateElement){var f,h=n._ownerDocument;if(o===u.html)if("script"===this._tag){var d=h.createElement("div"),_=this._currentElement.type;d.innerHTML="<"+_+"></"+_+">",f=d.removeChild(d.firstChild)}else f=p.is?h.createElement(this._currentElement.type,p.is):h.createElement(this._currentElement.type);else f=h.createElementNS(o,this._currentElement.type);v.precacheNode(this,f),this._flags|=C.hasCachedChildNodes,this._hostParent||l.setAttributeForRoot(f),this._updateDOMProperties(null,p,e);var w=s(f);this._createInitialChildren(e,p,r,w),c=w}else{var E=this._createOpenTagMarkupAndPutListeners(e,p),x=this._createContentMarkup(e,p,r);c=!x&&z[this._tag]?E+"/>":E+">"+x+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(R,this),p.autoFocus&&e.getReactMountReady().enqueue(a.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(D,this),p.autoFocus&&e.getReactMountReady().enqueue(a.focusDOMComponent,this);break;case"select":case"button":p.autoFocus&&e.getReactMountReady().enqueue(a.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(L,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var a=t[r];if(null!=a)if(O.hasOwnProperty(r))a&&N(this,r,a,e);else{r===T&&(a&&(a=this._previousStyleCopy=o({},t.style)),a=i.createMarkupForStyles(a,this));var s=null;null!=this._tag&&K(this._tag,t)?I.hasOwnProperty(r)||(s=l.createMarkupForCustomAttribute(r,a)):s=l.createMarkupForProperty(r,a),s&&(n+=" "+s)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+l.createMarkupForRoot()),n+=" "+l.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var a=j[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)r=E(a);else if(null!=i){r=this.mountChildren(i,e,n).join("")}}return V[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&s.queueHTML(r,o.__html);else{var a=j[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)""!==a&&s.queueText(r,a);else if(null!=i)for(var u=this.mountChildren(i,e,n),c=0;c<u.length;c++)s.queueChild(r,u[c])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,a=this._currentElement.props;switch(this._tag){case"input":o=m.getHostProps(this,o),a=m.getHostProps(this,a);break;case"option":o=g.getHostProps(this,o),a=g.getHostProps(this,a);break;case"select":o=y.getHostProps(this,o),a=y.getHostProps(this,a);break;case"textarea":o=b.getHostProps(this,o),a=b.getHostProps(this,a)}switch(P(this,a),this._updateDOMProperties(o,a,e),this._updateDOMChildren(o,a,e,r),this._tag){case"input":m.updateWrapper(this),x.updateValueIfChanged(this);break;case"textarea":b.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(q,this)}},_updateDOMProperties:function(e,t,n){var r,a,s;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if(r===T){var u=this._previousStyleCopy;for(a in u)u.hasOwnProperty(a)&&((s=s||{})[a]="");this._previousStyleCopy=null}else O.hasOwnProperty(r)?e[r]&&S(this,r):K(this._tag,e)?I.hasOwnProperty(r)||l.deleteValueForAttribute(A(this),r):(c.properties[r]||c.isCustomAttribute(r))&&l.deleteValueForProperty(A(this),r);for(r in t){var p=t[r],f=r===T?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&p!==f&&(null!=p||null!=f))if(r===T)if(p?p=this._previousStyleCopy=o({},p):this._previousStyleCopy=null,f){for(a in f)!f.hasOwnProperty(a)||p&&p.hasOwnProperty(a)||((s=s||{})[a]="");for(a in p)p.hasOwnProperty(a)&&f[a]!==p[a]&&((s=s||{})[a]=p[a])}else s=p;else if(O.hasOwnProperty(r))p?N(this,r,p,n):f&&S(this,r);else if(K(this._tag,t))I.hasOwnProperty(r)||l.setValueForAttribute(A(this),r,p);else if(c.properties[r]||c.isCustomAttribute(r)){var h=A(this);null!=p?l.setValueForProperty(h,r,p):l.deleteValueForProperty(h,r)}}s&&i.setValueForStyles(A(this),s,this)},_updateDOMChildren:function(e,t,n,r){var o=j[typeof e.children]?e.children:null,a=j[typeof t.children]?t.children:null,i=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=a?null:t.children,l=null!=o||null!=i,p=null!=a||null!=s;null!=u&&null==c?this.updateChildren(null,n,r):l&&!p&&this.updateTextContent(""),null!=a?o!==a&&this.updateTextContent(""+a):null!=s?i!==s&&this.updateMarkup(""+s):null!=c&&this.updateChildren(c,n,r)},getHostNode:function(){return A(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":x.stopTracking(this);break;case"html":case"head":case"body":r("66",this._tag)}this.unmountChildren(e),v.uncacheNode(this),p.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return A(this)}},o(G.prototype,G.Mixin,_.Mixin),e.exports=G},function(e,t,n){"use strict";var r=n(42),o=n(475),a={focusDOMComponent:function(){o(r.getNodeFromInstance(this))}};e.exports=a},function(e,t,n){"use strict";var r=n(476),o=n(57),a=(n(75),n(935),n(937)),i=n(938),s=n(940),u=(n(33),s((function(e){return i(e)}))),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=0===r.indexOf("--"),i=e[r];0,null!=i&&(n+=u(r)+":",n+=a(r,i,t,o)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var i in t)if(t.hasOwnProperty(i)){var s=0===i.indexOf("--");0;var u=a(i,t[i],n,s);if("float"!==i&&"cssFloat"!==i||(i=l),s)o.setProperty(i,u);else if(u)o[i]=u;else{var p=c&&r.shorthandPropertyExpansions[i];if(p)for(var f in p)o[f]="";else o[i]=""}}}};e.exports=f},function(e,t,n){"use strict";var r=n(936),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},function(e,t,n){"use strict";var r=/-(.)/g;e.exports=function(e){return e.replace(r,(function(e,t){return t.toUpperCase()}))}},function(e,t,n){"use strict";var r=n(476),o=(n(33),r.isUnitlessNumber);e.exports=function(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var a=isNaN(t);return r||a||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},function(e,t,n){"use strict";var r=n(939),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},function(e,t,n){"use strict";var r=/([A-Z])/g;e.exports=function(e){return e.replace(r,"-$1").toLowerCase()}},function(e,t,n){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},function(e,t,n){"use strict";var r=n(201);e.exports=function(e){return'"'+r(e)+'"'}},function(e,t,n){"use strict";var r=n(163);var o={handleTopLevel:function(e,t,n,o){!function(e){r.enqueueEvents(e),r.processEventQueue(!1)}(r.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";var r=n(57);function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}var a={animationend:o("Animation","AnimationEnd"),animationiteration:o("Animation","AnimationIteration"),animationstart:o("Animation","AnimationStart"),transitionend:o("Transition","TransitionEnd")},i={},s={};r.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),e.exports=function(e){if(i[e])return i[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return i[e]=t[n];return""}},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(477),i=n(271),s=n(42),u=n(82);n(25),n(33);function c(){this._rootNodeID&&p.updateWrapper(this)}function l(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}var p={getHostProps:function(e,t){var n=i.getValue(t),r=i.getChecked(t);return o({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:f.bind(e),controlled:l(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&a.setValueForProperty(s.getNodeFromInstance(e),"checked",n||!1);var r=s.getNodeFromInstance(e),o=i.getValue(t);if(null!=o)if(0===o&&""===r.value)r.value="0";else if("number"===t.type){var u=parseFloat(r.value,10)||0;(o!=u||o==u&&r.value!=o)&&(r.value=""+o)}else r.value!==""+o&&(r.value=""+o);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}};function f(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);u.asap(c,this);var o=t.name;if("radio"===t.type&&null!=o){for(var a=s.getNodeFromInstance(this),l=a;l.parentNode;)l=l.parentNode;for(var p=l.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;f<p.length;f++){var h=p[f];if(h!==a&&h.form===a.form){var d=s.getInstanceFromNode(h);d||r("90"),u.asap(c,d)}}}return n}e.exports=p},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(40),o=n(126),a=n(42),i=n(478),s=(n(33),!1);function u(e){var t="";return o.Children.forEach(e,(function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:s||(s=!0))})),t}var c={mountWrapper:function(e,t,n){var r=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(r=i.getSelectValueContext(o))}var a,s=null;if(null!=r)if(a=null!=t.value?t.value+"":u(t.children),s=!1,Array.isArray(r)){for(var c=0;c<r.length;c++)if(""+r[c]===a){s=!0;break}}else s=""+r===a;e._wrapperState={selected:s}},postMountWrapper:function(e){var t=e._currentElement.props;null!=t.value&&a.getNodeFromInstance(e).setAttribute("value",t.value)},getHostProps:function(e,t){var n=r({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=u(t.children);return o&&(n.children=o),n}};e.exports=c},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(271),i=n(42),s=n(82);n(25),n(33);function u(){this._rootNodeID&&c.updateWrapper(this)}var c={getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&r("91"),o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=a.getValue(t),o=n;if(null==n){var i=t.defaultValue,s=t.children;null!=s&&(null!=i&&r("92"),Array.isArray(s)&&(s.length<=1||r("93"),s=s[0]),i=""+s),null==i&&(i=""),o=i}e._wrapperState={initialValue:""+o,listeners:null,onChange:l.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=i.getNodeFromInstance(e),r=a.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=i.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}};function l(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);return s.asap(u,this),n}e.exports=c},function(e,t,n){"use strict";var r=n(31),o=n(272),a=(n(165),n(75),n(89),n(138)),i=n(949),s=(n(81),n(954));n(25);function u(e,t){return t&&(e=e||[]).push(t),e}function c(e,t){o.processChildrenUpdates(e,t)}var l={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return i.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,a){var u;return u=s(t,0),i.updateChildren(e,u,n,r,o,this,this._hostContainerInfo,a,0),u},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var s in r)if(r.hasOwnProperty(s)){var u=r[s];0;var c=a.mountComponent(u,t,this,this._hostContainerInfo,n,0);u._mountIndex=i++,o.push(c)}return o},updateTextContent:function(e){var t,n=this._renderedChildren;for(var o in i.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"TEXT_CONTENT",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateMarkup:function(e){var t,n=this._renderedChildren;for(var o in i.unmountChildren(n,!1),n)n.hasOwnProperty(o)&&r("118");c(this,[(t=e,{type:"SET_MARKUP",content:t,fromIndex:null,fromNode:null,toIndex:null,afterNode:null})])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},i=[],s=this._reconcilerUpdateChildren(r,e,i,o,t,n);if(s||r){var l,p=null,f=0,h=0,d=0,v=null;for(l in s)if(s.hasOwnProperty(l)){var m=r&&r[l],g=s[l];m===g?(p=u(p,this.moveChild(m,v,f,h)),h=Math.max(m._mountIndex,h),m._mountIndex=f):(m&&(h=Math.max(m._mountIndex,h)),p=u(p,this._mountChildAtIndex(g,i[d],v,f,t,n)),d++),f++,v=a.getHostNode(g)}for(l in o)o.hasOwnProperty(l)&&(p=u(p,this._unmountChild(r[l],o[l])));p&&c(this,p),this._renderedChildren=s}},unmountChildren:function(e){var t=this._renderedChildren;i.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return function(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:a.getHostNode(e),toIndex:n,afterNode:t}}(e,t,n)},createChild:function(e,t,n){return function(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}(n,t,e._mountIndex)},removeChild:function(e,t){return function(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}(e,t)},_mountChildAtIndex:function(e,t,n,r,o,a){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}};e.exports=l},function(e,t,n){"use strict";(function(t){var r=n(138),o=n(479),a=(n(275),n(274)),i=n(483);n(33);function s(e,t,n,r){var a=void 0===e[n];null!=t&&a&&(e[n]=o(t,!0))}void 0!==t&&t.env;var u={instantiateChildren:function(e,t,n,r){if(null==e)return null;var o={};return i(e,s,o),o},updateChildren:function(e,t,n,i,s,u,c,l,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){var d=(h=e&&e[f])&&h._currentElement,v=t[f];if(null!=h&&a(d,v))r.receiveComponent(h,v,s,l),t[f]=h;else{h&&(i[f]=r.getHostNode(h),r.unmountComponent(h,!1));var m=o(v,!0);t[f]=m;var g=r.mountComponent(m,s,u,c,l,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],i[f]=r.getHostNode(h),r.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];r.unmountComponent(o,t)}}};e.exports=u}).call(this,n(91))},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(126),i=n(272),s=n(89),u=n(264),c=n(165),l=(n(75),n(480)),p=n(138),f=n(179),h=(n(25),n(273)),d=n(274),v=(n(33),0),m=1,g=2;function y(e){}function b(e,t){0}y.prototype.render=function(){var e=c.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return b(e,t),t};var _=1,w={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,o){this._context=o,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var i,s=this._currentElement.props,u=this._processContext(o),l=this._currentElement.type,p=e.getUpdateQueue(),h=function(e){return!(!e.prototype||!e.prototype.isReactComponent)}(l),d=this._constructComponent(h,s,u,p);h||null!=d&&null!=d.render?!function(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}(l)?this._compositeType=v:this._compositeType=m:(i=d,b(),null===d||!1===d||a.isValidElement(d)||r("105",l.displayName||l.name||"Component"),d=new y(l),this._compositeType=g),d.props=s,d.context=u,d.refs=f,d.updater=p,this._instance=d,c.set(d,this);var w,E=d.state;return void 0===E&&(d.state=E=null),("object"!=typeof E||Array.isArray(E))&&r("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,w=d.unstable_handleError?this.performInitialMountWithErrorHandling(i,t,n,e,o):this.performInitialMount(i,t,n,e,o),d.componentDidMount&&e.getReactMountReady().enqueue(d.componentDidMount,d),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var a,i=r.checkpoint();try{a=this.performInitialMount(e,t,n,r,o)}catch(s){r.rollback(i),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),i=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(i),a=this.performInitialMount(e,t,n,r,o)}return a},performInitialMount:function(e,t,n,r,o){var a=this._instance;a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),void 0===e&&(e=this._renderValidatedComponent());var i=l.getType(e);this._renderedNodeType=i;var s=this._instantiateReactComponent(e,i!==l.EMPTY);return this._renderedComponent=s,p.mountComponent(s,r,t,n,this._processChildContext(o),0)},getHostNode:function(){return p.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";u.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(p.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,c.remove(t)}},_maskContext:function(e){var t=this._currentElement.type.contextTypes;if(!t)return f;var n={};for(var r in t)n[r]=e[r];return n},_processContext:function(e){return this._maskContext(e)},_processChildContext:function(e){var t,n=this._currentElement.type,a=this._instance;if(a.getChildContext&&(t=a.getChildContext()),t){for(var i in"object"!=typeof n.childContextTypes&&r("107",this.getName()||"ReactCompositeComponent"),t)i in n.childContextTypes||r("108",this.getName()||"ReactCompositeComponent",i);return o({},e,t)}return e},_checkContextTypes:function(e,t,n){0},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?p.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,o,a){var i=this._instance;null==i&&r("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===a?s=i.context:(s=this._processContext(a),u=!0);var c=t.props,l=n.props;t!==n&&(u=!0),u&&i.componentWillReceiveProps&&i.componentWillReceiveProps(l,s);var p=this._processPendingState(l,s),f=!0;this._pendingForceUpdate||(i.shouldComponentUpdate?f=i.shouldComponentUpdate(l,p,s):this._compositeType===m&&(f=!h(c,l)||!h(i.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,s,e,a)):(this._currentElement=n,this._context=a,i.props=l,i.state=p,i.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,a=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(a&&1===r.length)return r[0];for(var i=o({},a?r[0]:n.state),s=a?1:0;s<r.length;s++){var u=r[s];o(i,"function"==typeof u?u.call(n,i,e,t):u)}return i},_performComponentUpdate:function(e,t,n,r,o,a){var i,s,u,c=this._instance,l=Boolean(c.componentDidUpdate);l&&(i=c.props,s=c.state,u=c.context),c.componentWillUpdate&&c.componentWillUpdate(t,n,r),this._currentElement=e,this._context=a,c.props=t,c.state=n,c.context=r,this._updateRenderedComponent(o,a),l&&o.getReactMountReady().enqueue(c.componentDidUpdate.bind(c,i,s,u),c)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(d(r,o))p.receiveComponent(n,o,e,this._processChildContext(t));else{var a=p.getHostNode(n);p.unmountComponent(n,!1);var i=l.getType(o);this._renderedNodeType=i;var s=this._instantiateReactComponent(o,i!==l.EMPTY);this._renderedComponent=s;var u=p.mountComponent(s,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),0);this._replaceNodeWithMarkup(a,u,n)}},_replaceNodeWithMarkup:function(e,t,n){i.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){return this._instance.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==g){s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{s.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||a.isValidElement(e)||r("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&r("110");var o=t.getPublicInstance();(n.refs===f?n.refs={}:n.refs)[e]=o},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===g?null:e},_instantiateReactComponent:null};e.exports=w},function(e,t,n){"use strict";var r=1;e.exports=function(){return r++}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.iterator;e.exports=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}},function(e,t,n){"use strict";(function(t){n(275);var r=n(483);n(33);function o(e,t,n,r){if(e&&"object"==typeof e){var o=e;0,void 0===o[n]&&null!=t&&(o[n]=t)}}void 0!==t&&t.env,e.exports=function(e,t){if(null==e)return e;var n={};return r(e,o,n),n}}).call(this,n(91))},function(e,t,n){"use strict";var r=n(40),o=n(120),a=n(198),i=(n(75),n(956)),s=[];var u={enqueue:function(){}};function c(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new i(this)}var l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};r(c.prototype,a,l),o.addPoolingTo(c),e.exports=c},function(e,t,n){"use strict";var r=n(276);n(33);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&r.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&r.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&r.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&r.enqueueSetState(e,t)},e}();e.exports=o},function(e,t,n){"use strict";var r=n(40),o=n(139),a=n(42),i=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(i.prototype,{mountComponent:function(e,t,n,r){var i=n._idCounter++;this._domID=i,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument.createComment(s);return a.precacheNode(this,u),o(u)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return a.getNodeFromInstance(this)},unmountComponent:function(){a.uncacheNode(this)}}),e.exports=i},function(e,t,n){"use strict";var r=n(31);n(25);function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(var n=0,o=e;o;o=o._hostParent)n++;for(var a=0,i=t;i;i=i._hostParent)a++;for(;n-a>0;)e=e._hostParent,n--;for(;a-n>0;)t=t._hostParent,a--;for(var s=n;s--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}e.exports={isAncestor:function(e,t){"_hostNode"in e||r("35"),"_hostNode"in t||r("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1},getLowestCommonAncestor:o,getParentInstance:function(e){return"_hostNode"in e||r("36"),e._hostParent},traverseTwoPhase:function(e,t,n){for(var r,o=[];e;)o.push(e),e=e._hostParent;for(r=o.length;r-- >0;)t(o[r],"captured",n);for(r=0;r<o.length;r++)t(o[r],"bubbled",n)},traverseEnterLeave:function(e,t,n,r,a){for(var i=e&&t?o(e,t):null,s=[];e&&e!==i;)s.push(e),e=e._hostParent;for(var u,c=[];t&&t!==i;)c.push(t),t=t._hostParent;for(u=0;u<s.length;u++)n(s[u],"bubbled",r);for(u=c.length;u-- >0;)n(c[u],"captured",a)}}},function(e,t,n){"use strict";var r=n(31),o=n(40),a=n(268),i=n(139),s=n(42),u=n(201),c=(n(25),n(277),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,a=" react-text: "+o+" ",c=" /react-text ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,p=l.createComment(a),f=l.createComment(c),h=i(l.createDocumentFragment());return i.queueChild(h,i(p)),this._stringText&&i.queueChild(h,i(l.createTextNode(this._stringText))),i.queueChild(h,i(f)),s.precacheNode(this,p),this._closingComment=f,h}var d=u(this._stringText);return e.renderToStaticMarkup?d:"\x3c!--"+a+"--\x3e"+d+"\x3c!--"+" /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();a.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this).nextSibling;;){if(null==t&&r("67",this._domID),8===t.nodeType&&" /react-text "===t.nodeValue){this._closingComment=t;break}t=t.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";var r=n(40),o=n(82),a=n(198),i=n(81),s={initialize:i,close:function(){p.isBatchingUpdates=!1}},u=[{initialize:i,close:o.flushBatchedUpdates.bind(o)},s];function c(){this.reinitializeTransaction()}r(c.prototype,a,{getTransactionWrappers:function(){return u}});var l=new c,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,a){var i=p.isBatchingUpdates;return p.isBatchingUpdates=!0,i?e(t,n,r,o,a):l.perform(e,null,t,n,r,o,a)}};e.exports=p},function(e,t,n){"use strict";var r=n(40),o=n(485),a=n(57),i=n(120),s=n(42),u=n(82),c=n(265),l=n(962);function p(e){for(;e._hostParent;)e=e._hostParent;var t=s.getNodeFromInstance(e).parentNode;return s.getClosestInstanceFromNode(t)}function f(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function h(e){var t=c(e.nativeEvent),n=s.getClosestInstanceFromNode(t),r=n;do{e.ancestors.push(r),r=r&&p(r)}while(r);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],v._handleTopLevel(e.topLevelType,n,e.nativeEvent,c(e.nativeEvent))}function d(e){e(l(window))}r(f.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),i.addPoolingTo(f,i.twoArgumentPooler);var v={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:a.canUseDOM?window:null,setHandleTopLevel:function(e){v._handleTopLevel=e},setEnabled:function(e){v._enabled=!!e},isEnabled:function(){return v._enabled},trapBubbledEvent:function(e,t,n){return n?o.listen(n,t,v.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?o.capture(n,t,v.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=d.bind(null,e);o.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(v._enabled){var n=f.getPooled(e,t);try{u.batchedUpdates(h,n)}finally{f.release(n)}}}};e.exports=v},function(e,t,n){"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},function(e,t,n){"use strict";var r=n(137),o=n(163),a=n(263),i=n(272),s=n(481),u=n(202),c=n(482),l=n(82),p={Component:i.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:o.injection,EventPluginUtils:a.injection,EventEmitter:u.injection,HostComponent:c.injection,Updates:l.injection};e.exports=p},function(e,t,n){"use strict";var r=n(40),o=n(469),a=n(120),i=n(202),s=n(486),u=(n(75),n(198)),c=n(276),l=[{initialize:s.getSelectionInformation,close:s.restoreSelection},{initialize:function(){var e=i.isEnabled();return i.setEnabled(!1),e},close:function(e){i.setEnabled(e)}},{initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}}];function p(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var f={getTransactionWrappers:function(){return l},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};r(p.prototype,u,f),a.addPoolingTo(p),e.exports=p},function(e,t,n){"use strict";var r=n(57),o=n(966),a=n(468);function i(e,t,n,r){return e===n&&t===r}var s=r.canUseDOM&&"selection"in document&&!("getSelection"in window),u={getOffsets:s?function(e){var t=document.selection.createRange(),n=t.text.length,r=t.duplicate();r.moveToElementText(e),r.setEndPoint("EndToStart",t);var o=r.text.length;return{start:o,end:o+n}}:function(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=i(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var l=i(c.startContainer,c.startOffset,c.endContainer,c.endOffset)?0:c.toString().length,p=l+u,f=document.createRange();f.setStart(n,r),f.setEnd(o,a);var h=f.collapsed;return{start:h?p:l,end:h?l:p}},setOffsets:s?function(e,t){var n,r,o=document.selection.createRange().duplicate();void 0===t.end?r=n=t.start:t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}:function(e,t){if(window.getSelection){var n=window.getSelection(),r=e[a()].length,i=Math.min(t.start,r),s=void 0===t.end?i:Math.min(t.end,r);if(!n.extend&&i>s){var u=s;s=i,i=u}var c=o(e,i),l=o(e,s);if(c&&l){var p=document.createRange();p.setStart(c.node,c.offset),n.removeAllRanges(),i>s?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}};e.exports=u},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}e.exports=function(e,t){for(var n=r(e),a=0,i=0;n;){if(3===n.nodeType){if(i=a+n.textContent.length,a<=t&&i>=t)return{node:n,offset:t-a};a=i}n=r(o(n))}}},function(e,t,n){"use strict";var r=n(968);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=n(969);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r="http://www.w3.org/1999/xlink",o="http://www.w3.org/XML/1998/namespace",a={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},i={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r,xlinkArcrole:r,xlinkHref:r,xlinkRole:r,xlinkShow:r,xlinkTitle:r,xlinkType:r,xmlBase:o,xmlLang:o,xmlSpace:o},DOMAttributeNames:{}};Object.keys(a).forEach((function(e){i.Properties[e]=0,a[e]&&(i.DOMAttributeNames[e]=a[e])})),e.exports=i},function(e,t,n){"use strict";var r=n(162),o=n(57),a=n(42),i=n(486),s=n(92),u=n(487),c=n(472),l=n(273),p=o.canUseDOM&&"documentMode"in document&&document.documentMode<=11,f={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},h=null,d=null,v=null,m=!1,g=!1;function y(e,t){if(m||null==h||h!==u())return null;var n=function(e){if("selectionStart"in e&&i.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}(h);if(!v||!l(v,n)){v=n;var o=s.getPooled(f.select,d,e,t);return o.type="select",o.target=h,r.accumulateTwoPhaseDispatches(o),o}return null}var b={eventTypes:f,extractEvents:function(e,t,n,r){if(!g)return null;var o=t?a.getNodeFromInstance(t):window;switch(e){case"topFocus":(c(o)||"true"===o.contentEditable)&&(h=o,d=t,v=null);break;case"topBlur":h=null,d=null,v=null;break;case"topMouseDown":m=!0;break;case"topContextMenu":case"topMouseUp":return m=!1,y(n,r);case"topSelectionChange":if(p)break;case"topKeyDown":case"topKeyUp":return y(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(g=!0)}};e.exports=b},function(e,t,n){"use strict";var r=n(31),o=n(485),a=n(162),i=n(42),s=n(973),u=n(974),c=n(92),l=n(975),p=n(976),f=n(199),h=n(978),d=n(979),v=n(980),m=n(164),g=n(981),y=n(81),b=n(278),_=(n(25),{}),w={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach((function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};_[e]=o,w[r]=o}));var E={};function x(e){return"."+e._rootNodeID}function C(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var S={eventTypes:_,extractEvents:function(e,t,n,o){var i,y=w[e];if(!y)return null;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":i=c;break;case"topKeyPress":if(0===b(n))return null;case"topKeyDown":case"topKeyUp":i=p;break;case"topBlur":case"topFocus":i=l;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":i=f;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":i=h;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":i=d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":i=s;break;case"topTransitionEnd":i=v;break;case"topScroll":i=m;break;case"topWheel":i=g;break;case"topCopy":case"topCut":case"topPaste":i=u}i||r("86",e);var _=i.getPooled(y,t,n,o);return a.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if("onClick"===t&&!C(e._tag)){var r=x(e),a=i.getNodeFromInstance(e);E[r]||(E[r]=o.listen(a,"click",y))}},willDeleteListener:function(e,t){if("onClick"===t&&!C(e._tag)){var n=x(e);E[n].remove(),delete E[n]}}};e.exports=S},function(e,t,n){"use strict";var r=n(92);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{animationName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(92),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,o),e.exports=a},function(e,t,n){"use strict";var r=n(164);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{relatedTarget:null}),e.exports=o},function(e,t,n){"use strict";var r=n(164),o=n(278),a={key:n(977),location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:n(267),charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};function i(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(i,a),e.exports=i},function(e,t,n){"use strict";var r=n(278),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=function(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}},function(e,t,n){"use strict";var r=n(199);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{dataTransfer:null}),e.exports=o},function(e,t,n){"use strict";var r=n(164),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:n(267)};function a(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(a,o),e.exports=a},function(e,t,n){"use strict";var r=n(92);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{propertyName:null,elapsedTime:null,pseudoElement:null}),e.exports=o},function(e,t,n){"use strict";var r=n(199);function o(e,t,n,o){return r.call(this,e,t,n,o)}r.augmentClass(o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),e.exports=o},function(e,t,n){"use strict";n(277);e.exports=function(e,t){return{_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?9===t.nodeType?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null}}},function(e,t,n){"use strict";e.exports={useCreateElement:!0,useFiber:!1}},function(e,t,n){"use strict";var r=n(985),o=/\/?>/,a=/^<\!\-\-/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return a.test(e)?e:e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=i},function(e,t,n){"use strict";var r=65521;e.exports=function(e){for(var t=1,n=0,o=0,a=e.length,i=-4&a;o<i;){for(var s=Math.min(o+4096,i);o<s;o+=4)n+=(t+=e.charCodeAt(o))+(t+=e.charCodeAt(o+1))+(t+=e.charCodeAt(o+2))+(t+=e.charCodeAt(o+3));t%=r,n%=r}for(;o<a;o++)n+=t+=e.charCodeAt(o);return(t%=r)|(n%=r)<<16}},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r=n(31),o=(n(89),n(42)),a=n(165),i=n(489);n(25),n(33);e.exports=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=a.get(e);if(t)return(t=i(t))?o.getNodeFromInstance(t):null;"function"==typeof e.render?r("44"):r("45",Object.keys(e))}},function(e,t,n){"use strict";var r=n(488);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(0),o=i(n(11)),a=i(n(490));i(n(491));function i(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.store=n.store,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){return r.Children.only(this.props.children)},t}(r.Component);t.default=s,s.propTypes={store:a.default.isRequired,children:o.default.element.isRequired},s.childContextTypes={store:a.default.isRequired}},function(e,t,n){"use strict";var r=n(385);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},w=Boolean(e),E=e||d,x=void 0;x="function"==typeof t?t:t?(0,s.default)(t):v;var C=n||m,S=l.pure,A=void 0===S||S,k=l.withRef,O=void 0!==k&&k,j=A&&C!==m,T=_++;return function(e){var t="Connect("+g(e)+")";var n=function(n){function a(e,r){p(this,a);var o=f(this,n.call(this,e,r));o.version=T,o.store=e.store||r.store,(0,c.default)(o.store,'Could not find "store" in either the context or props of "'+t+'". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "'+t+'".');var i=o.store.getState();return o.state={storeState:i},o.clearCache(),o}return h(a,n),a.prototype.shouldComponentUpdate=function(){return!A||this.haveOwnPropsChanged||this.hasStoreStateChanged},a.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState();return this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n)},a.prototype.configureFinalMapState=function(e,t){var n=E(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:E,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},a.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch;return this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n)},a.prototype.configureFinalMapDispatch=function(e,t){var n=x(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:x,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},a.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,i.default)(e,this.stateProps))&&(this.stateProps=e,!0)},a.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,i.default)(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},a.prototype.updateMergedPropsIfNeeded=function(){var e,t,n,r=(e=this.stateProps,t=this.dispatchProps,n=this.props,C(e,t,n));return!(this.mergedProps&&j&&(0,i.default)(r,this.mergedProps))&&(this.mergedProps=r,!0)},a.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},a.prototype.trySubscribe=function(){w&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},a.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},a.prototype.componentDidMount=function(){this.trySubscribe()},a.prototype.componentWillReceiveProps=function(e){A&&(0,i.default)(e,this.props)||(this.haveOwnPropsChanged=!0)},a.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},a.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},a.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!A||t!==e){if(A&&!this.doStatePropsDependOnOwnProps){var n=b(this.updateStatePropsIfNeeded,this);if(!n)return;n===y&&(this.statePropsPrecalculationError=y.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},a.prototype.getWrappedInstance=function(){return(0,c.default)(O,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},a.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,a=this.haveStatePropsBeenPrecalculated,i=this.statePropsPrecalculationError,s=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,i)throw i;var u=!0,c=!0;A&&s&&(u=n||t&&this.doStatePropsDependOnOwnProps,c=t&&this.doDispatchPropsDependOnOwnProps);var l=!1,p=!1;a?l=!0:u&&(l=this.updateStatePropsIfNeeded()),c&&(p=this.updateDispatchPropsIfNeeded());return!(!!(l||p||t)&&this.updateMergedPropsIfNeeded())&&s?s:(this.renderedElement=O?(0,o.createElement)(e,r({},this.mergedProps,{ref:"wrappedInstance"})):(0,o.createElement)(e,this.mergedProps),this.renderedElement)},a}(o.Component);return n.displayName=t,n.WrappedComponent=e,n.contextTypes={store:a.default},n.propTypes={store:a.default},(0,u.default)(n,e)}};var o=n(0),a=l(n(490)),i=l(n(992)),s=l(n(993)),u=(l(n(491)),l(n(206)),l(n(994))),c=l(n(995));function l(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(e){return{}},v=function(e){return{dispatch:e}},m=function(e,t,n){return r({},n,e,t)};function g(e){return e.displayName||e.name||"Component"}var y={value:null};function b(e,t){try{return e.apply(t)}catch(e){return y.value=e,y}}var _=0},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!o.call(t,n[a])||e[n[a]]!==t[n[a]])return!1;return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return function(t){return(0,r.bindActionCreators)(e,t)}};var r=n(146)},function(e,t,n){"use strict";var r=n(384),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,l=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var i=l(n);p&&(i=i.concat(p(n)));for(var s=u(t),v=u(n),m=0;m<i.length;++m){var g=i[m];if(!(a[g]||r&&r[g]||v&&v[g]||s&&s[g])){var y=f(n,g);try{c(t,g,y)}catch(e){}}}}return t}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],l=0;(u=new Error(t.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t,n){var r=n(140),o=n(114);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(140),o=n(493);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(59),o=n(189),a=n(1e3),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&n.push(s);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){(function(e){var r=n(74),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(187)(e))},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(140),o=n(246);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(140),o=n(494);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(280),o=n(1007),a=n(1008),i=n(1009),s=n(1010);e.exports=function(e,t,n){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Set]":return new u;case"[object Symbol]":return i(e)}}},function(e,t,n){var r=n(280);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(128),o=r?r.prototype:void 0,a=o?o.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},function(e,t,n){var r=n(280);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(1012),o=n(279),a=n(189);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:r(o(e))}},function(e,t,n){var r=n(59),o=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},function(e,t,n){var r=n(1014),o=n(250),a=n(251),i=a&&a.isMap,s=i?o(i):r;e.exports=s},function(e,t,n){var r=n(190),o=n(90);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(1016),o=n(250),a=n(251),i=a&&a.isSet,s=i?o(i):r;e.exports=s},function(e,t,n){var r=n(190),o=n(90);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},function(e,t,n){var r=n(130),o=n(1018),a=n(1019),i=n(131);e.exports=function(e,t){return t=r(t,e),null==(e=a(e,t))||delete e[i(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(191),o=n(408);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(206);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(1022);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(245),o=n(1023);e.exports=function e(t,n,a,i,s){var u=-1,c=t.length;for(a||(a=o),s||(s=[]);++u<c;){var l=t[u];n>0&&a(l)?n>1?e(l,n-1,a,i,s):r(s,l):i||(s[s.length]=l)}return s}},function(e,t,n){var r=n(128),o=n(247),a=n(55),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(1026),o=n(461),a=n(253),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var o=n(),a=16-(o-r);if(r=o,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(1029);e.exports=r},function(e,t,n){n(1030);var r=n(34);e.exports=r.Object.entries},function(e,t,n){var r=n(24),o=n(1031).entries;r({target:"Object",stat:!0},{entries:function(e){return o(e)}})},function(e,t,n){var r=n(48),o=n(148),a=n(69),i=n(171).f,s=function(e){return function(t){for(var n,s=a(t),u=o(s),c=u.length,l=0,p=[];c>l;)n=u[l++],r&&!i.call(s,n)||p.push(e?[n,s[n]]:s[n]);return p}};e.exports={entries:s(!0),values:s(!1)}},function(e,t,n){var r=n(394);e.exports=r},function(e,t){!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,i="ArrayBuffer"in e;if(i)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=l(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];w.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function x(e,n){return new Promise((function(r,a){var i=new b(e,n);if(i.signal&&i.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new w(o,n))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(i.method,i.url,!0),"include"===i.credentials?s.withCredentials=!0:"omit"===i.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),i.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&i.signal.removeEventListener("abort",u)}),s.send(void 0===i._bodyInit?null:i._bodyInit)}))}x.polyfill=!0,e.fetch||(e.fetch=x,e.Headers=f,e.Request=b,e.Response=w),t.Headers=f,t.Request=b,t.Response=w,t.fetch=x}({})}("undefined"!=typeof self?self:this)},function(e,t,n){"use strict";var r=n(281),o=n(499),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,p=o.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,format:p,formatter:o.formatters[p],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},h=function e(t,n,o,a,i,u,l,p,h,d,v,m,g){var y,b=t;if("function"==typeof l?b=l(n,b):b instanceof Date?b=d(b):"comma"===o&&s(b)&&(b=r.maybeMap(b,(function(e){return e instanceof Date?d(e):e})).join(",")),null===b){if(a)return u&&!m?u(n,f.encoder,g,"key"):n;b=""}if("string"==typeof(y=b)||"number"==typeof y||"boolean"==typeof y||"symbol"==typeof y||"bigint"==typeof y||r.isBuffer(b))return u?[v(m?n:u(n,f.encoder,g,"key"))+"="+v(u(b,f.encoder,g,"value"))]:[v(n)+"="+v(String(b))];var _,w=[];if(void 0===b)return w;if(s(l))_=l;else{var E=Object.keys(b);_=p?E.sort(p):E}for(var x=0;x<_.length;++x){var C=_[x],S=b[C];if(!i||null!==S){var A=s(b)?"function"==typeof o?o(n,C):n:n+(h?"."+C:"["+C+"]");c(w,e(S,A,o,a,i,u,l,p,h,d,v,m,g))}}return w};e.exports=function(e,t){var n,r=e,u=function(e){if(!e)return f;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=o.formatters[n],i=f.filter;return("function"==typeof e.filter||s(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:void 0===e.allowDots?f.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof u.filter?r=(0,u.filter)("",r):s(u.filter)&&(n=u.filter);var l,p=[];if("object"!=typeof r||null===r)return"";l=t&&t.arrayFormat in i?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=i[l];n||(n=Object.keys(r)),u.sort&&n.sort(u.sort);for(var v=0;v<n.length;++v){var m=n[v];u.skipNulls&&null===r[m]||c(p,h(r[m],m,d,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.formatter,u.encodeValuesOnly,u.charset))}var g=p.join(u.delimiter),y=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}},function(e,t,n){"use strict";var r=n(281),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(a),c=s?a.slice(0,s.index):a,l=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var p=0;n.depth>0&&null!==(s=i.exec(a))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+a.slice(s.index)+"]"),function(e,t,n,r){for(var o=r?t:u(t,n),a=e.length-1;a>=0;--a){var i,s=e[a];if("[]"===s&&n.parseArrays)i=[].concat(o);else{i=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);n.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(i=[])[l]=o:i[c]=o:i={0:o}}o=i}return o}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var n,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,p),h=-1,d=t.charset;if(t.charsetSentinel)for(n=0;n<f.length;++n)0===f[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[n]?d="utf-8":"utf8=%26%2310003%3B"===f[n]&&(d="iso-8859-1"),h=n,n=f.length);for(n=0;n<f.length;++n)if(n!==h){var v,m,g=f[n],y=g.indexOf("]="),b=-1===y?g.indexOf("="):y+1;-1===b?(v=t.decoder(g,i.decoder,d,"key"),m=t.strictNullHandling?null:""):(v=t.decoder(g.slice(0,b),i.decoder,d,"key"),m=r.maybeMap(u(g.slice(b+1),t),(function(e){return t.decoder(e,i.decoder,d,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===d&&(m=s(m)),g.indexOf("[]=")>-1&&(m=a(m)?[m]:m),o.call(c,v)?c[v]=r.combine(c[v],m):c[v]=m}return c}(e,n):e,p=n.plainObjects?Object.create(null):{},f=Object.keys(l),h=0;h<f.length;++h){var d=f[h],v=c(d,l[d],n,"string"==typeof e);p=r.merge(p,v,n)}return r.compact(p)}},function(e,t,n){var r=n(1037),o=n(424);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},function(e,t,n){var r=n(191),o=n(459),a=n(130);e.exports=function(e,t,n){for(var i=-1,s=t.length,u={};++i<s;){var c=t[i],l=r(e,c);n(l,c)&&o(u,a(c,e),l)}return u}},function(e,t,n){e.exports=n(1039)},function(e,t,n){var r=n(1040);e.exports=r},function(e,t,n){n(1041);var r=n(34);e.exports=r.Reflect.get},function(e,t,n){var r=n(24),o=n(44),a=n(54),i=n(52),s=n(104),u=n(151);r({target:"Reflect",stat:!0},{get:function e(t,n){var r,c,l=arguments.length<3?t:arguments[2];return a(t)===l?t[n]:(r=s.f(t,n))?i(r,"value")?r.value:void 0===r.get?void 0:r.get.call(l):o(c=u(t))?e(c,n,l):void 0}})},function(e,t,n){var r=n(205);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,n){var r=n(1044);e.exports=r},function(e,t,n){var r=n(1045),o=Array.prototype;e.exports=function(e){var t=e.splice;return e===o||e instanceof Array&&t===o.splice?r:t}},function(e,t,n){n(1046);var r=n(45);e.exports=r("Array").splice},function(e,t,n){"use strict";var r=n(24),o=n(225),a=n(149),i=n(79),s=n(72),u=n(235),c=n(153),l=n(154),p=n(64),f=l("splice"),h=p("splice",{ACCESSORS:!0,0:0,1:2}),d=Math.max,v=Math.min,m=9007199254740991,g="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!f||!h},{splice:function(e,t){var n,r,l,p,f,h,y=s(this),b=i(y.length),_=o(e,b),w=arguments.length;if(0===w?n=r=0:1===w?(n=0,r=b-_):(n=w-2,r=v(d(a(t),0),b-_)),b+n-r>m)throw TypeError(g);for(l=u(y,r),p=0;p<r;p++)(f=_+p)in y&&c(l,p,y[f]);if(l.length=r,n<r){for(p=_;p<b-r;p++)h=p+n,(f=p+r)in y?y[h]=y[f]:delete y[h];for(p=b;p>b-r+n;p--)delete y[p-1]}else if(n>r)for(p=b-r;p>_;p--)h=p+n-1,(f=p+r-1)in y?y[h]=y[f]:delete y[h];for(p=0;p<n;p++)y[p+_]=arguments[p+2];return y.length=b-r+n,l}})},function(e,t,n){var r=n(462);e.exports=r},function(e,t,n){"use strict";var r=Array.isArray,o=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var i,s,u,c=r(t),l=r(n);if(c&&l){if((s=t.length)!=n.length)return!1;for(i=s;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(c!=l)return!1;var p=t instanceof Date,f=n instanceof Date;if(p!=f)return!1;if(p&&f)return t.getTime()==n.getTime();var h=t instanceof RegExp,d=n instanceof RegExp;if(h!=d)return!1;if(h&&d)return t.toString()==n.toString();var v=o(t);if((s=v.length)!==o(n).length)return!1;for(i=s;0!=i--;)if(!a.call(n,v[i]))return!1;for(i=s;0!=i--;)if(!e(t[u=v[i]],n[u]))return!1;return!0}return t!=t&&n!=n}},function(e,t,n){var r=n(1050);e.exports=r},function(e,t,n){n(178),n(1051),n(80);var r=n(34);e.exports=r.WeakMap},function(e,t,n){"use strict";var r,o=n(41),a=n(158),i=n(204),s=n(500),u=n(1053),c=n(44),l=n(73).enforce,p=n(363),f=!o.ActiveXObject&&"ActiveXObject"in o,h=Object.isExtensible,d=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},v=e.exports=s("WeakMap",d,u);if(p&&f){r=u.getConstructor(d,"WeakMap",!0),i.REQUIRED=!0;var m=v.prototype,g=m.delete,y=m.has,b=m.get,_=m.set;a(m,{delete:function(e){if(c(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new r),g.call(this,e)||t.frozen.delete(e)}return g.call(this,e)},has:function(e){if(c(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new r),y.call(this,e)||t.frozen.has(e)}return y.call(this,e)},get:function(e){if(c(e)&&!h(e)){var t=l(this);return t.frozen||(t.frozen=new r),y.call(this,e)?b.call(this,e):t.frozen.get(e)}return b.call(this,e)},set:function(e,t){if(c(e)&&!h(e)){var n=l(this);n.frozen||(n.frozen=new r),y.call(this,e)?_.call(this,e,t):n.frozen.set(e,t)}else _.call(this,e,t);return this}})}},function(e,t,n){var r=n(36);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(e,t,n){"use strict";var r=n(158),o=n(204).getWeakData,a=n(54),i=n(44),s=n(134),u=n(119),c=n(88),l=n(52),p=n(73),f=p.set,h=p.getterFor,d=c.find,v=c.findIndex,m=0,g=function(e){return e.frozen||(e.frozen=new y)},y=function(){this.entries=[]},b=function(e,t){return d(e.entries,(function(e){return e[0]===t}))};y.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var n=b(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,c){var p=e((function(e,r){s(e,p,t),f(e,{type:t,id:m++,frozen:void 0}),null!=r&&u(r,e[c],e,n)})),d=h(t),v=function(e,t,n){var r=d(e),i=o(a(t),!0);return!0===i?g(r).set(t,n):i[r.id]=n,e};return r(p.prototype,{delete:function(e){var t=d(this);if(!i(e))return!1;var n=o(e);return!0===n?g(t).delete(e):n&&l(n,t.id)&&delete n[t.id]},has:function(e){var t=d(this);if(!i(e))return!1;var n=o(e);return!0===n?g(t).has(e):n&&l(n,t.id)}}),r(p.prototype,n?{get:function(e){var t=d(this);if(i(e)){var n=o(e);return!0===n?g(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),p}}},function(e,t,n){(function(e,r){var o;!function(a){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var s,u=2147483647,c=36,l=/^xn--/,p=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,v=String.fromCharCode;function m(e){throw RangeError(h[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function _(e){return g(e,(function(e){var t="";return e>65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=v(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,n){var r=0;for(e=n?d(e/700):e>>1,e+=d(e/t);e>455;r+=c)e=d(e/35);return d(r+36*e/(e+38))}function x(e){var t,n,r,o,a,i,s,l,p,f,h,v=[],g=e.length,y=0,b=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&m("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(a=y,i=1,s=c;o>=g&&m("invalid-input"),((l=(h=e.charCodeAt(o++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:c)>=c||l>d((u-y)/i))&&m("overflow"),y+=l*i,!(l<(p=s<=w?1:s>=w+26?26:s-w));s+=c)i>d(u/(f=c-p))&&m("overflow"),i*=f;w=E(y-a,t=v.length+1,0==a),d(y/t)>u-b&&m("overflow"),b+=d(y/t),y%=t,v.splice(y++,0,b)}return _(v)}function C(e){var t,n,r,o,a,i,s,l,p,f,h,g,y,_,x,C=[];for(g=(e=b(e)).length,t=128,n=0,a=72,i=0;i<g;++i)(h=e[i])<128&&C.push(v(h));for(r=o=C.length,o&&C.push("-");r<g;){for(s=u,i=0;i<g;++i)(h=e[i])>=t&&h<s&&(s=h);for(s-t>d((u-n)/(y=r+1))&&m("overflow"),n+=(s-t)*y,t=s,i=0;i<g;++i)if((h=e[i])<t&&++n>u&&m("overflow"),h==t){for(l=n,p=c;!(l<(f=p<=a?1:p>=a+26?26:p-a));p+=c)x=l-f,_=c-f,C.push(v(w(f+x%_,0))),l=d(x/_);C.push(v(w(l,0))),a=E(n,y,r==o),n=0,++r}++n,++t}return C.join("")}s={version:"1.3.2",ucs2:{decode:b,encode:_},decode:x,encode:C,toASCII:function(e){return y(e,(function(e){return p.test(e)?"xn--"+C(e):e}))},toUnicode:function(e){return y(e,(function(e){return l.test(e)?x(e.slice(4).toLowerCase()):e}))}},void 0===(o=function(){return s}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(187)(e),n(53))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(1057),t.encode=t.stringify=n(1058)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,a){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var p,f,h,d,v=e[l].replace(s,"%20"),m=v.indexOf(n);m>=0?(p=v.substr(0,m),f=v.substr(m+1)):(p=v,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(i,h)?o(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),(function(i){var s=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[i]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t){e.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},function(e,t,n){var r=n(1061),o=n(428);e.exports=function(e){return r((function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(n[0],n[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var u=n[r];u&&e(t,u,r,i)}return t}))}},function(e,t,n){var r=n(253),o=n(497),a=n(498);e.exports=function(e,t){return a(o(e,t,r),e+"")}},function(e,t,n){var r=n(1063);e.exports=r},function(e,t,n){n(1064),n(1066),n(502);var r=n(34);e.exports=r.URL},function(e,t,n){"use strict";n(96);var r,o=n(24),a=n(48),i=n(501),s=n(41),u=n(231),c=n(110),l=n(134),p=n(52),f=n(377),h=n(395),d=n(362).codeAt,v=n(1065),m=n(87),g=n(502),y=n(73),b=s.URL,_=g.URLSearchParams,w=g.getState,E=y.set,x=y.getterFor("URL"),C=Math.floor,S=Math.pow,A="Invalid scheme",k="Invalid host",O="Invalid port",j=/[A-Za-z]/,T=/[\d+-.A-Za-z]/,I=/\d/,P=/^(0x|0X)/,N=/^[0-7]+$/,M=/^\d+$/,R=/^[\dA-Fa-f]+$/,D=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,L=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,B=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,F=/[\u0009\u000A\u000D]/g,U=function(e,t){var n,r,o;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return k;if(!(n=z(t.slice(1,-1))))return k;e.host=n}else if(G(e)){if(t=v(t),D.test(t))return k;if(null===(n=q(t)))return k;e.host=n}else{if(L.test(t))return k;for(n="",r=h(t),o=0;o<r.length;o++)n+=K(r[o],W);e.host=n}},q=function(e){var t,n,r,o,a,i,s,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(o=u[r]))return e;if(a=10,o.length>1&&"0"==o.charAt(0)&&(a=P.test(o)?16:8,o=o.slice(8==a?1:2)),""===o)i=0;else{if(!(10==a?M:8==a?N:R).test(o))return e;i=parseInt(o,a)}n.push(i)}for(r=0;r<t;r++)if(i=n[r],r==t-1){if(i>=S(256,5-t))return null}else if(i>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*S(256,3-r);return s},z=function(e){var t,n,r,o,a,i,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,p=0,f=function(){return e.charAt(p)};if(":"==f()){if(":"!=e.charAt(1))return;p+=2,l=++c}for(;f();){if(8==c)return;if(":"!=f()){for(t=n=0;n<4&&R.test(f());)t=16*t+parseInt(f(),16),p++,n++;if("."==f()){if(0==n)return;if(p-=n,c>6)return;for(r=0;f();){if(o=null,r>0){if(!("."==f()&&r<4))return;p++}if(!I.test(f()))return;for(;I.test(f());){if(a=parseInt(f(),10),null===o)o=a;else{if(0==o)return;o=10*o+a}if(o>255)return;p++}u[c]=256*u[c]+o,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==f()){if(p++,!f())return}else if(f())return;u[c++]=t}else{if(null!==l)return;p++,l=++c}}if(null!==l)for(i=c-l,c=7;0!=c&&i>0;)s=u[c],u[c--]=u[l+i-1],u[l+--i]=s;else if(8!=c)return;return u},V=function(e){var t,n,r,o;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=C(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,o=0,a=0;a<8;a++)0!==e[a]?(o>n&&(t=r,n=o),r=null,o=0):(null===r&&(r=a),++o);return o>n&&(t=r,n=o),t}(e),n=0;n<8;n++)o&&0===e[n]||(o&&(o=!1),r===n?(t+=n?":":"::",o=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},W={},H=f({},W,{" ":1,'"':1,"<":1,">":1,"`":1}),J=f({},H,{"#":1,"?":1,"{":1,"}":1}),$=f({},J,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(e,t){var n=d(e,0);return n>32&&n<127&&!p(t,e)?e:encodeURIComponent(e)},Y={ftp:21,file:null,http:80,https:443,ws:80,wss:443},G=function(e){return p(Y,e.scheme)},Z=function(e){return""!=e.username||""!=e.password},X=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Q=function(e,t){var n;return 2==e.length&&j.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ee=function(e){var t;return e.length>1&&Q(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&Q(t[0],!0)||t.pop()},ne=function(e){return"."===e||"%2e"===e.toLowerCase()},re={},oe={},ae={},ie={},se={},ue={},ce={},le={},pe={},fe={},he={},de={},ve={},me={},ge={},ye={},be={},_e={},we={},Ee={},xe={},Ce=function(e,t,n,o){var a,i,s,u,c,l=n||re,f=0,d="",v=!1,m=!1,g=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(B,"")),t=t.replace(F,""),a=h(t);f<=a.length;){switch(i=a[f],l){case re:if(!i||!j.test(i)){if(n)return A;l=ae;continue}d+=i.toLowerCase(),l=oe;break;case oe:if(i&&(T.test(i)||"+"==i||"-"==i||"."==i))d+=i.toLowerCase();else{if(":"!=i){if(n)return A;d="",l=ae,f=0;continue}if(n&&(G(e)!=p(Y,d)||"file"==d&&(Z(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,n)return void(G(e)&&Y[e.scheme]==e.port&&(e.port=null));d="","file"==e.scheme?l=me:G(e)&&o&&o.scheme==e.scheme?l=ie:G(e)?l=le:"/"==a[f+1]?(l=se,f++):(e.cannotBeABaseURL=!0,e.path.push(""),l=we)}break;case ae:if(!o||o.cannotBeABaseURL&&"#"!=i)return A;if(o.cannotBeABaseURL&&"#"==i){e.scheme=o.scheme,e.path=o.path.slice(),e.query=o.query,e.fragment="",e.cannotBeABaseURL=!0,l=xe;break}l="file"==o.scheme?me:ue;continue;case ie:if("/"!=i||"/"!=a[f+1]){l=ue;continue}l=pe,f++;break;case se:if("/"==i){l=fe;break}l=_e;continue;case ue:if(e.scheme=o.scheme,i==r)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query;else if("/"==i||"\\"==i&&G(e))l=ce;else if("?"==i)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query="",l=Ee;else{if("#"!=i){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.path.pop(),l=_e;continue}e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query,e.fragment="",l=xe}break;case ce:if(!G(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,l=_e;continue}l=fe}else l=pe;break;case le:if(l=pe,"/"!=i||"/"!=d.charAt(f+1))continue;f++;break;case pe:if("/"!=i&&"\\"!=i){l=fe;continue}break;case fe:if("@"==i){v&&(d="%40"+d),v=!0,s=h(d);for(var y=0;y<s.length;y++){var b=s[y];if(":"!=b||g){var _=K(b,$);g?e.password+=_:e.username+=_}else g=!0}d=""}else if(i==r||"/"==i||"?"==i||"#"==i||"\\"==i&&G(e)){if(v&&""==d)return"Invalid authority";f-=h(d).length+1,d="",l=he}else d+=i;break;case he:case de:if(n&&"file"==e.scheme){l=ye;continue}if(":"!=i||m){if(i==r||"/"==i||"?"==i||"#"==i||"\\"==i&&G(e)){if(G(e)&&""==d)return k;if(n&&""==d&&(Z(e)||null!==e.port))return;if(u=U(e,d))return u;if(d="",l=be,n)return;continue}"["==i?m=!0:"]"==i&&(m=!1),d+=i}else{if(""==d)return k;if(u=U(e,d))return u;if(d="",l=ve,n==de)return}break;case ve:if(!I.test(i)){if(i==r||"/"==i||"?"==i||"#"==i||"\\"==i&&G(e)||n){if(""!=d){var w=parseInt(d,10);if(w>65535)return O;e.port=G(e)&&w===Y[e.scheme]?null:w,d=""}if(n)return;l=be;continue}return O}d+=i;break;case me:if(e.scheme="file","/"==i||"\\"==i)l=ge;else{if(!o||"file"!=o.scheme){l=_e;continue}if(i==r)e.host=o.host,e.path=o.path.slice(),e.query=o.query;else if("?"==i)e.host=o.host,e.path=o.path.slice(),e.query="",l=Ee;else{if("#"!=i){ee(a.slice(f).join(""))||(e.host=o.host,e.path=o.path.slice(),te(e)),l=_e;continue}e.host=o.host,e.path=o.path.slice(),e.query=o.query,e.fragment="",l=xe}}break;case ge:if("/"==i||"\\"==i){l=ye;break}o&&"file"==o.scheme&&!ee(a.slice(f).join(""))&&(Q(o.path[0],!0)?e.path.push(o.path[0]):e.host=o.host),l=_e;continue;case ye:if(i==r||"/"==i||"\\"==i||"?"==i||"#"==i){if(!n&&Q(d))l=_e;else if(""==d){if(e.host="",n)return;l=be}else{if(u=U(e,d))return u;if("localhost"==e.host&&(e.host=""),n)return;d="",l=be}continue}d+=i;break;case be:if(G(e)){if(l=_e,"/"!=i&&"\\"!=i)continue}else if(n||"?"!=i)if(n||"#"!=i){if(i!=r&&(l=_e,"/"!=i))continue}else e.fragment="",l=xe;else e.query="",l=Ee;break;case _e:if(i==r||"/"==i||"\\"==i&&G(e)||!n&&("?"==i||"#"==i)){if(".."===(c=(c=d).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(te(e),"/"==i||"\\"==i&&G(e)||e.path.push("")):ne(d)?"/"==i||"\\"==i&&G(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Q(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(i==r||"?"==i||"#"==i))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==i?(e.query="",l=Ee):"#"==i&&(e.fragment="",l=xe)}else d+=K(i,J);break;case we:"?"==i?(e.query="",l=Ee):"#"==i?(e.fragment="",l=xe):i!=r&&(e.path[0]+=K(i,W));break;case Ee:n||"#"!=i?i!=r&&("'"==i&&G(e)?e.query+="%27":e.query+="#"==i?"%23":K(i,W)):(e.fragment="",l=xe);break;case xe:i!=r&&(e.fragment+=K(i,H))}f++}},Se=function(e){var t,n,r=l(this,Se,"URL"),o=arguments.length>1?arguments[1]:void 0,i=String(e),s=E(r,{type:"URL"});if(void 0!==o)if(o instanceof Se)t=x(o);else if(n=Ce(t={},String(o)))throw TypeError(n);if(n=Ce(s,i,null,t))throw TypeError(n);var u=s.searchParams=new _,c=w(u);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(u)||null},a||(r.href=ke.call(r),r.origin=Oe.call(r),r.protocol=je.call(r),r.username=Te.call(r),r.password=Ie.call(r),r.host=Pe.call(r),r.hostname=Ne.call(r),r.port=Me.call(r),r.pathname=Re.call(r),r.search=De.call(r),r.searchParams=Le.call(r),r.hash=Be.call(r))},Ae=Se.prototype,ke=function(){var e=x(this),t=e.scheme,n=e.username,r=e.password,o=e.host,a=e.port,i=e.path,s=e.query,u=e.fragment,c=t+":";return null!==o?(c+="//",Z(e)&&(c+=n+(r?":"+r:"")+"@"),c+=V(o),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},Oe=function(){var e=x(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&G(e)?t+"://"+V(e.host)+(null!==n?":"+n:""):"null"},je=function(){return x(this).scheme+":"},Te=function(){return x(this).username},Ie=function(){return x(this).password},Pe=function(){var e=x(this),t=e.host,n=e.port;return null===t?"":null===n?V(t):V(t)+":"+n},Ne=function(){var e=x(this).host;return null===e?"":V(e)},Me=function(){var e=x(this).port;return null===e?"":String(e)},Re=function(){var e=x(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},De=function(){var e=x(this).query;return e?"?"+e:""},Le=function(){return x(this).searchParams},Be=function(){var e=x(this).fragment;return e?"#"+e:""},Fe=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&u(Ae,{href:Fe(ke,(function(e){var t=x(this),n=String(e),r=Ce(t,n);if(r)throw TypeError(r);w(t.searchParams).updateSearchParams(t.query)})),origin:Fe(Oe),protocol:Fe(je,(function(e){var t=x(this);Ce(t,String(e)+":",re)})),username:Fe(Te,(function(e){var t=x(this),n=h(String(e));if(!X(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=K(n[r],$)}})),password:Fe(Ie,(function(e){var t=x(this),n=h(String(e));if(!X(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=K(n[r],$)}})),host:Fe(Pe,(function(e){var t=x(this);t.cannotBeABaseURL||Ce(t,String(e),he)})),hostname:Fe(Ne,(function(e){var t=x(this);t.cannotBeABaseURL||Ce(t,String(e),de)})),port:Fe(Me,(function(e){var t=x(this);X(t)||(""==(e=String(e))?t.port=null:Ce(t,e,ve))})),pathname:Fe(Re,(function(e){var t=x(this);t.cannotBeABaseURL||(t.path=[],Ce(t,e+"",be))})),search:Fe(De,(function(e){var t=x(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Ce(t,e,Ee)),w(t.searchParams).updateSearchParams(t.query)})),searchParams:Fe(Le),hash:Fe(Be,(function(e){var t=x(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Ce(t,e,xe)):t.fragment=null}))}),c(Ae,"toJSON",(function(){return ke.call(this)}),{enumerable:!0}),c(Ae,"toString",(function(){return ke.call(this)}),{enumerable:!0}),b){var Ue=b.createObjectURL,qe=b.revokeObjectURL;Ue&&c(Se,"createObjectURL",(function(e){return Ue.apply(b,arguments)})),qe&&c(Se,"revokeObjectURL",(function(e){return qe.apply(b,arguments)}))}m(Se,"URL"),o({global:!0,forced:!i,sham:!a},{URL:Se})},function(e,t,n){"use strict";var r=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",s=Math.floor,u=String.fromCharCode,c=function(e){return e+22+75*(e<26)},l=function(e,t,n){var r=0;for(e=n?s(e/700):e>>1,e+=s(e/t);e>455;r+=36)e=s(e/35);return s(r+36*e/(e+38))},p=function(e){var t,n,o=[],a=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),n--)}else t.push(o)}return t}(e)).length,p=128,f=0,h=72;for(t=0;t<e.length;t++)(n=e[t])<128&&o.push(u(n));var d=o.length,v=d;for(d&&o.push("-");v<a;){var m=r;for(t=0;t<e.length;t++)(n=e[t])>=p&&n<m&&(m=n);var g=v+1;if(m-p>s((r-f)/g))throw RangeError(i);for(f+=(m-p)*g,p=m,t=0;t<e.length;t++){if((n=e[t])<p&&++f>r)throw RangeError(i);if(n==p){for(var y=f,b=36;;b+=36){var _=b<=h?1:b>=h+26?26:b-h;if(y<_)break;var w=y-_,E=36-_;o.push(u(c(_+w%E))),y=s(w/E)}o.push(u(c(y))),h=l(f,g,v==d),f=0,++v}}++f,++p}return o.join("")};e.exports=function(e){var t,n,r=[],i=e.toLowerCase().replace(a,".").split(".");for(t=0;t<i.length;t++)n=i[t],r.push(o.test(n)?"xn--"+p(n):n);return r.join(".")}},function(e,t){},function(e,t,n){n(1068);var r=n(34);e.exports=r.setTimeout},function(e,t,n){var r=n(24),o=n(41),a=n(237),i=[].slice,s=function(e){return function(t,n){var r=arguments.length>2,o=r?i.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(a)},{setTimeout:s(o.setTimeout),setInterval:s(o.setInterval)})},function(e,t,n){var r=n(1070);e.exports=r},function(e,t,n){n(1071),n(178),n(96),n(80);var r=n(34);e.exports=r.Map},function(e,t,n){"use strict";var r=n(500),o=n(1072);e.exports=r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},function(e,t,n){"use strict";var r=n(63).f,o=n(108),a=n(158),i=n(107),s=n(134),u=n(119),c=n(230),l=n(451),p=n(48),f=n(204).fastKey,h=n(73),d=h.set,v=h.getterFor;e.exports={getConstructor:function(e,t,n,c){var l=e((function(e,r){s(e,l,t),d(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),p||(e.size=0),null!=r&&u(r,e[c],e,n)})),h=v(t),m=function(e,t,n){var r,o,a=h(e),i=g(e,t);return i?i.value=n:(a.last=i={index:o=f(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=i),r&&(r.next=i),p?a.size++:e.size++,"F"!==o&&(a.index[o]=i)),e},g=function(e,t){var n,r=h(e),o=f(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return a(l.prototype,{clear:function(){for(var e=h(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,n=h(t),r=g(t,e);if(r){var o=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=o),o&&(o.previous=a),n.first==r&&(n.first=o),n.last==r&&(n.last=a),p?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=h(this),r=i(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),a(l.prototype,n?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),p&&r(l.prototype,"size",{get:function(){return h(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",o=v(t),a=v(r);c(e,t,(function(e,t){d(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),l(t)}}},function(e,t,n){n(80);var r=n(1074),o=n(97),a=Array.prototype,i={DOMTokenList:!0,NodeList:!0};e.exports=function(e){var t=e.keys;return e===a||e instanceof Array&&t===a.keys||i.hasOwnProperty(o(e))?r:t}},function(e,t,n){var r=n(1075);e.exports=r},function(e,t,n){n(176);var r=n(45);e.exports=r("Array").keys},function(e,t){function n(e){Object.freeze(e);var t="function"==typeof e;return Object.getOwnPropertyNames(e).forEach((function(r){!Object.hasOwnProperty.call(e,r)||null===e[r]||"object"!=typeof e[r]&&"function"!=typeof e[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(e[r])||n(e[r])})),e}class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(e,...t){var n={};for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}function i(e){return e.nodeName.toLowerCase()}var s=Object.freeze({__proto__:null,escapeHTML:o,inherit:a,nodeStream:function(e){var t=[];return function e(n,r){for(var o=n.firstChild;o;o=o.nextSibling)3===o.nodeType?r+=o.nodeValue.length:1===o.nodeType&&(t.push({event:"start",offset:r,node:o}),r=e(o,r),i(o).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:o}));return r}(e,0),t},mergeStreams:function(e,t,n){var r=0,a="",s=[];function u(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function c(e){a+="<"+i(e)+[].map.call(e.attributes,(function(e){return" "+e.nodeName+'="'+o(e.value)+'"'})).join("")+">"}function l(e){a+="</"+i(e)+">"}function p(e){("start"===e.event?c:l)(e.node)}for(;e.length||t.length;){var f=u();if(a+=o(n.substring(r,f[0].offset)),r=f[0].offset,f===e){s.reverse().forEach(l);do{p(f.splice(0,1)[0]),f=u()}while(f===e&&f.length&&f[0].offset===r);s.reverse().forEach(c)}else"start"===f[0].event?s.push(f[0].node):s.pop(),p(f.splice(0,1)[0])}return a+o(n.substr(r))}});const u=e=>!!e.kind;class c{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!u(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){u(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class p extends l{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new c(this,this.options).value()}finalize(){return!0}}function f(e){return e?"string"==typeof e?e:e.source:null}const h="[a-zA-Z]\\w*",d="[a-zA-Z_]\\w*",v="\\b\\d+(\\.\\d+)?",m="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g="\\b(0b[01]+)",y={begin:"\\\\[\\s\\S]",relevance:0},b={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[y]},_={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[y]},w={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},E=function(e,t,n={}){var r=a({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(w),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},x=E("//","$"),C=E("/\\*","\\*/"),S=E("#","$"),A={className:"number",begin:v,relevance:0},k={className:"number",begin:m,relevance:0},O={className:"number",begin:g,relevance:0},j={className:"number",begin:v+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},T={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[y,{begin:/\[/,end:/\]/,relevance:0,contains:[y]}]}]},I={className:"title",begin:h,relevance:0},P={className:"title",begin:d,relevance:0},N={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var M=Object.freeze({__proto__:null,IDENT_RE:h,UNDERSCORE_IDENT_RE:d,NUMBER_RE:v,C_NUMBER_RE:m,BINARY_NUMBER_RE:g,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map((e=>f(e))).join("")}(t,/.*\b/,e.binary,/\b.*/)),a({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:y,APOS_STRING_MODE:b,QUOTE_STRING_MODE:_,PHRASAL_WORDS_MODE:w,COMMENT:E,C_LINE_COMMENT_MODE:x,C_BLOCK_COMMENT_MODE:C,HASH_COMMENT_MODE:S,NUMBER_MODE:A,C_NUMBER_MODE:k,BINARY_NUMBER_MODE:O,CSS_NUMBER_MODE:j,REGEXP_MODE:T,TITLE_MODE:I,UNDERSCORE_TITLE_MODE:P,METHOD_GUARD:N,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}}),R="of and for in not or if then".split(" ");function D(e){function t(t,n){return new RegExp(f(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(function(e,t="|"){for(var n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,o="",a=0;a<e.length;a++){var i=r+=1,s=f(e[a]);for(a>0&&(o+=t),o+="(";s.length>0;){var u=n.exec(s);if(null==u){o+=s;break}o+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),"\\"===u[0][0]&&u[1]?o+="\\"+String(Number(u[1])+i):(o+=u[0],"("===u[0]&&r++)}o+=")"}return o}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;const n=t.exec(e);return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),n}}function o(e,t){const n=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==n&&"."!==r||t.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return function n(i,s){const u=i;if(i.compiled)return u;i.compiled=!0,i.__beforeBegin=null,i.keywords=i.keywords||i.beginKeywords;let c=null;if("object"==typeof i.keywords&&(c=i.keywords.$pattern,delete i.keywords.$pattern),i.keywords&&(i.keywords=function(e,t){var n={};"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(t){r(t,e[t])}));return n;function r(e,r){t&&(r=r.toLowerCase()),r.split(" ").forEach((function(t){var r=t.split("|");n[r[0]]=[e,B(r[0],r[1])]}))}}(i.keywords,e.case_insensitive)),i.lexemes&&c)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return u.keywordPatternRe=t(i.lexemes||c||/\w+/,!0),s&&(i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",i.__beforeBegin=o),i.begin||(i.begin=/\B|\b/),u.beginRe=t(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(u.endRe=t(i.end)),u.terminator_end=f(i.end)||"",i.endsWithParent&&s.terminator_end&&(u.terminator_end+=(i.end?"|":"")+s.terminator_end)),i.illegal&&(u.illegalRe=t(i.illegal)),void 0===i.relevance&&(i.relevance=1),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(t){return a(e,{variants:null},t)})));if(e.cached_variants)return e.cached_variants;if(L(e))return a(e,{starts:e.starts?a(e.starts):null});if(Object.isFrozen(e))return a(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,u)})),i.starts&&n(i.starts,s),u.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminator_end&&t.addRule(e.terminator_end,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(u),u}(e)}function L(e){return!!e&&(e.endsWithParent||L(e.starts))}function B(e,t){return t?Number(t):function(e){return R.includes(e.toLowerCase())}(e)?0:1}const F=o,U=a,{nodeStream:q,mergeStreams:z}=s,V=Symbol("nomatch");var W=function(e){var t=[],o=Object.create(null),a=Object.create(null),i=[],s=!0,u=/(^(<[^>]+>|\t|)+|\n)/gm,c="Could not find the language '{}', did you forget to load/include a language module?";const l={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:p};function h(e){return f.noHighlightRe.test(e)}function d(e,t,n,r){var o={code:t,language:e};x("before:highlight",o);var a=o.result?o.result:v(o.language,o.code,n,r);return a.code=o.code,x("after:highlight",a),a}function v(e,t,n,a){var i=t;function u(e,t){var n=E.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function l(){null!=S.subLanguage?function(){if(""!==O){var e=null;if("string"==typeof S.subLanguage){if(!o[S.subLanguage])return void k.addText(O);e=v(S.subLanguage,O,!0,A[S.subLanguage]),A[S.subLanguage]=e.top}else e=m(O,S.subLanguage.length?S.subLanguage:null);S.relevance>0&&(j+=e.relevance),k.addSublanguage(e.emitter,e.language)}}():function(){if(!S.keywords)return void k.addText(O);let e=0;S.keywordPatternRe.lastIndex=0;let t=S.keywordPatternRe.exec(O),n="";for(;t;){n+=O.substring(e,t.index);const r=u(S,t);if(r){const[e,o]=r;k.addText(n),n="",j+=o,k.addKeyword(t[0],e)}else n+=t[0];e=S.keywordPatternRe.lastIndex,t=S.keywordPatternRe.exec(O)}n+=O.substr(e),k.addText(n)}(),O=""}function p(e){return e.className&&k.openNode(e.className),S=Object.create(e,{parent:{value:S}})}function h(e,t,n){let o=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(o){if(e["on:end"]){const n=new r(e);e["on:end"](t,n),n.ignore&&(o=!1)}if(o){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,t,n)}function d(e){return 0===S.matcher.regexIndex?(O+=e[0],1):(P=!0,0)}function g(e){var t=e[0],n=e.rule;const o=new r(n),a=[n.__beforeBegin,n["on:begin"]];for(const n of a)if(n&&(n(e,o),o.ignore))return d(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?O+=t:(n.excludeBegin&&(O+=t),l(),n.returnBegin||n.excludeBegin||(O=t)),p(n),n.returnBegin?0:t.length}function y(e){var t=e[0],n=i.substr(e.index),r=h(S,e,n);if(!r)return V;var o=S;o.skip?O+=t:(o.returnEnd||o.excludeEnd||(O+=t),l(),o.excludeEnd&&(O=t));do{S.className&&k.closeNode(),S.skip||S.subLanguage||(j+=S.relevance),S=S.parent}while(S!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),p(r.starts)),o.returnEnd?0:t.length}var b={};function w(t,r){var o=r&&r[0];if(O+=t,null==o)return l(),0;if("begin"===b.type&&"end"===r.type&&b.index===r.index&&""===o){if(O+=i.slice(r.index,r.index+1),!s){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=b.rule,t}return 1}if(b=r,"begin"===r.type)return g(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(S.className||"<unnamed>")+'"');throw e.mode=S,e}if("end"===r.type){var a=y(r);if(a!==V)return a}if("illegal"===r.type&&""===o)return 1;if(I>1e5&&I>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return O+=o,o.length}var E=_(e);if(!E)throw console.error(c.replace("{}",e)),new Error('Unknown language: "'+e+'"');var x=D(E),C="",S=a||x,A={},k=new f.__emitter(f);!function(){for(var e=[],t=S;t!==E;t=t.parent)t.className&&e.unshift(t.className);e.forEach((e=>k.openNode(e)))}();var O="",j=0,T=0,I=0,P=!1;try{for(S.matcher.considerAll();;){I++,P?P=!1:(S.matcher.lastIndex=T,S.matcher.considerAll());const e=S.matcher.exec(i);if(!e)break;const t=w(i.substring(T,e.index),e);T=e.index+t}return w(i.substr(T)),k.closeAllNodes(),k.finalize(),C=k.toHTML(),{relevance:j,value:C,language:e,illegal:!1,emitter:k,top:S}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:i.slice(T-100,T+100),mode:t.mode},sofar:C,relevance:0,value:F(i),emitter:k};if(s)return{illegal:!1,relevance:0,value:F(i),emitter:k,language:e,top:S,errorRaised:t};throw t}}function m(e,t){t=t||f.languages||Object.keys(o);var n=function(e){const t={relevance:0,emitter:new f.__emitter(f),value:F(e),illegal:!1,top:l};return t.emitter.addText(e),t}(e),r=n;return t.filter(_).filter(E).forEach((function(t){var o=v(t,e,!1);o.language=t,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o)})),r.language&&(n.second_best=r),n}function g(e){return f.tabReplace||f.useBR?e.replace(u,(e=>"\n"===e?f.useBR?"<br>":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e)):e}function y(e){let t=null;const n=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=f.languageDetectRe.exec(t);if(n){var r=_(n[1]);return r||(console.warn(c.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>h(e)||_(e)))}(e);if(h(n))return;x("before:highlightBlock",{block:e,language:n}),f.useBR?(t=document.createElement("div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n")):t=e;const r=t.textContent,o=n?d(n,r,!0):m(r),i=q(t);if(i.length){const e=document.createElement("div");e.innerHTML=o.value,o.value=z(i,q(e),r)}o.value=g(o.value),x("after:highlightBlock",{block:e,result:o}),e.innerHTML=o.value,e.className=function(e,t,n){var r=t?a[t]:n,o=[e.trim()];return e.match(/\bhljs\b/)||o.push("hljs"),e.includes(r)||o.push(r),o.join(" ").trim()}(e.className,n,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const b=()=>{if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");t.forEach.call(e,y)}};function _(e){return e=(e||"").toLowerCase(),o[e]||o[a[e]]}function w(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{a[e]=t}))}function E(e){var t=_(e);return t&&!t.disableAutodetect}function x(e,t){var n=e;i.forEach((function(e){e[n]&&e[n](t)}))}Object.assign(e,{highlight:d,highlightAuto:m,fixMarkup:g,highlightBlock:y,configure:function(e){f=U(f,e)},initHighlighting:b,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",b,!1)},registerLanguage:function(t,n){var r=null;try{r=n(e)}catch(e){if(console.error("Language definition for '{}' could not be registered.".replace("{}",t)),!s)throw e;console.error(e),r=l}r.name||(r.name=t),o[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&w(r.aliases,{languageName:t})},listLanguages:function(){return Object.keys(o)},getLanguage:_,registerAliases:w,requireLanguage:function(e){var t=_(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:E,inherit:U,addPlugin:function(e){i.push(e)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="10.1.2";for(const e in M)"object"==typeof M[e]&&n(M[e]);return Object.assign(e,M),e}({});e.exports=W},function(e,t,n){"use strict";var r=n(1078),o=a(Error);function a(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=o,o.eval=a(EvalError),o.range=a(RangeError),o.reference=a(ReferenceError),o.syntax=a(SyntaxError),o.type=a(TypeError),o.uri=a(URIError),o.create=a},function(e,t,n){!function(){var t;function n(e){for(var t,n,r,o,a=1,i=[].slice.call(arguments),s=0,u=e.length,c="",l=!1,p=!1,f=function(){return i[a++]},h=function(){for(var n="";/\d/.test(e[s]);)n+=e[s++],t=e[s];return n.length>0?parseInt(n):null};s<u;++s)if(t=e[s],l)switch(l=!1,"."==t?(p=!1,t=e[++s]):"0"==t&&"."==e[s+1]?(p=!0,t=e[s+=2]):p=!0,o=h(),t){case"b":c+=parseInt(f(),10).toString(2);break;case"c":c+="string"==typeof(n=f())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(f(),10);break;case"f":r=String(parseFloat(f()).toFixed(o||6)),c+=p?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(f());break;case"o":c+="0"+parseInt(f(),10).toString(8);break;case"s":c+=f();break;case"x":c+="0x"+parseInt(f(),10).toString(16);break;case"X":c+="0x"+parseInt(f(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?l=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=s(n(0)),i=s(n(1082));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(t.CopyToClipboard=function(e){function t(){var e,n,r;u(this,t);for(var o=arguments.length,s=Array(o),l=0;l<o;l++)s[l]=arguments[l];return n=r=c(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onClick=function(e){var t=r.props,n=t.text,o=t.onCopy,s=t.children,u=t.options,c=a.default.Children.only(s),l=(0,i.default)(n,u);o&&o(n,l),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(e)},c(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["text","onCopy","options","children"]),o=a.default.Children.only(t);return a.default.cloneElement(o,r({},n,{onClick:this.onClick}))}}]),t}(a.default.PureComponent)).defaultProps={onCopy:void 0,options:void 0}},function(e,t,n){"use strict";var r=n(1083),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,s,u,c,l=!1;t||(t={}),n=t.debug||!1;try{if(i=r(),s=document.createRange(),u=document.getSelection(),(c=document.createElement("span")).textContent=e,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=o[t.format]||o.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(c),s.selectNodeContents(c),u.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(s):u.removeAllRanges()),c&&document.body.removeChild(c),i()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){var r=n(1085);e.exports=r},function(e,t,n){var r=n(1086),o=Array.prototype;e.exports=function(e){var t=e.lastIndexOf;return e===o||e instanceof Array&&t===o.lastIndexOf?r:t}},function(e,t,n){n(1087);var r=n(45);e.exports=r("Array").lastIndexOf},function(e,t,n){var r=n(24),o=n(1088);r({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},function(e,t,n){"use strict";var r=n(69),o=n(149),a=n(79),i=n(111),s=n(64),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,p=i("lastIndexOf"),f=s("indexOf",{ACCESSORS:!0,1:0}),h=l||!p||!f;e.exports=h?function(e){if(l)return c.apply(this,arguments)||0;var t=r(this),n=a(t.length),i=n-1;for(arguments.length>1&&(i=u(i,o(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:c},function(e,t,n){"use strict";var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebounceInput=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=s(n(0)),i=s(n(1091));function s(e){return e&&e.__esModule?e:{default:e}}(t.DebounceInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){e.persist();var t=n.state.value;n.setState({value:e.target.value},(function(){var o=n.state.value;o.length>=n.props.minLength?n.notify(e):t.length>o.length&&n.notify(r({},e,{target:r({},e.target,{value:""})}))}))},n.onKeyDown=function(e){var t=n.props.onKeyDown;"Enter"===e.key&&n.forceNotify(e),t&&t(e)},n.onBlur=function(e){var t=n.props.onBlur;n.forceNotify(e),t&&t(e)},n.createNotifier=function(e){if(e<0)n.notify=function(){return null};else if(0===e)n.notify=n.doNotify;else{var t=(0,i.default)((function(e){n.isDebouncing=!1,n.doNotify(e)}),e);n.notify=function(e){n.isDebouncing=!0,t(e)},n.flush=function(){return t.flush()},n.cancel=function(){n.isDebouncing=!1,t.cancel()}}},n.doNotify=function(){var e=n.props.onChange;e.apply(void 0,arguments)},n.forceNotify=function(e){if(n.isDebouncing){n.cancel&&n.cancel();var t=n.state.value,o=n.props.minLength;t.length>=o?n.doNotify(e):n.doNotify(r({},e,{target:r({},e.target,{value:t})}))}},n.state={value:e.value||""},n.isDebouncing=!1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentWillMount",value:function(){this.createNotifier(this.props.debounceTimeout)}},{key:"componentWillReceiveProps",value:function(e){var t=e.value,n=e.debounceTimeout;this.isDebouncing||(void 0!==t&&this.state.value!==t&&this.setState({value:t}),n!==this.props.debounceTimeout&&this.createNotifier(n))}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var e=this.props,t=e.element,n=(e.onChange,e.value,e.minLength,e.debounceTimeout,e.forceNotifyByEnter),o=e.forceNotifyOnBlur,i=e.onKeyDown,s=e.onBlur,u=e.inputRef,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"]),l=void 0;l=n?{onKeyDown:this.onKeyDown}:i?{onKeyDown:i}:{};var p=void 0;p=o?{onBlur:this.onBlur}:s?{onBlur:s}:{};var f=u?{ref:u}:{};return a.default.createElement(t,r({},c,{onChange:this.onChange,value:this.state.value},l,p,f))}}]),t}(a.default.PureComponent)).defaultProps={element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=s||u||Function("return this")(),l=Object.prototype.toString,p=Math.max,f=Math.min,h=function(){return c.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=o.test(e);return s||a.test(e)?i(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,a,i,s,u,c=0,l=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,a=o;return r=o=void 0,c=t,i=e.apply(a,n)}function b(e){return c=e,s=setTimeout(w,t),l?y(e):i}function _(e){var n=e-u;return void 0===u||n>=t||n<0||m&&e-c>=a}function w(){var e=h();if(_(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-u);return m?f(n,a-(e-c)):n}(e))}function E(e){return s=void 0,g&&r?y(e):(r=o=void 0,i)}function x(){var e=h(),n=_(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return b(u);if(m)return s=setTimeout(w,t),y(u)}return void 0===s&&(s=setTimeout(w,t)),i}return t=v(t)||0,d(n)&&(l=!!n.leading,a=(m="maxWait"in n)?p(v(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=o=s=void 0},x.flush=function(){return void 0===s?i:E(h())},x}}).call(this,n(53))},function(e,t,n){var r={"./all.js":338,"./auth/actions.js":86,"./auth/index.js":300,"./auth/reducers.js":301,"./auth/selectors.js":302,"./auth/spec-wrap-actions.js":303,"./configs/actions.js":143,"./configs/helpers.js":166,"./configs/index.js":340,"./configs/reducers.js":308,"./configs/selectors.js":307,"./configs/spec-actions.js":306,"./deep-linking/helpers.js":170,"./deep-linking/index.js":309,"./deep-linking/layout.js":310,"./deep-linking/operation-tag-wrapper.jsx":312,"./deep-linking/operation-wrapper.jsx":311,"./download-url.js":305,"./err/actions.js":61,"./err/error-transformers/hook.js":124,"./err/error-transformers/transformers/not-of-type.js":287,"./err/error-transformers/transformers/parameter-oneof.js":288,"./err/index.js":285,"./err/reducers.js":286,"./err/selectors.js":289,"./filter/index.js":313,"./filter/opsFilter.js":314,"./layout/actions.js":102,"./layout/index.js":290,"./layout/reducers.js":291,"./layout/selectors.js":292,"./logs/index.js":298,"./oas3/actions.js":62,"./oas3/auth-extensions/wrap-selectors.js":318,"./oas3/components/callbacks.jsx":321,"./oas3/components/http-auth.jsx":327,"./oas3/components/index.js":320,"./oas3/components/operation-link.jsx":323,"./oas3/components/operation-servers.jsx":328,"./oas3/components/request-body-editor.jsx":326,"./oas3/components/request-body.jsx":322,"./oas3/components/servers-container.jsx":325,"./oas3/components/servers.jsx":324,"./oas3/helpers.jsx":38,"./oas3/index.js":316,"./oas3/reducers.js":337,"./oas3/selectors.js":336,"./oas3/spec-extensions/selectors.js":319,"./oas3/spec-extensions/wrap-selectors.js":317,"./oas3/wrap-components/auth-item.jsx":331,"./oas3/wrap-components/index.js":329,"./oas3/wrap-components/json-schema-string.jsx":335,"./oas3/wrap-components/markdown.jsx":330,"./oas3/wrap-components/model.jsx":334,"./oas3/wrap-components/online-validator-badge.js":333,"./oas3/wrap-components/version-stamp.jsx":332,"./on-complete/index.js":315,"./samples/fn.js":142,"./samples/index.js":297,"./spec/actions.js":47,"./spec/index.js":293,"./spec/reducers.js":294,"./spec/selectors.js":94,"./spec/wrap-actions.js":295,"./swagger-js/configs-wrap-actions.js":299,"./swagger-js/index.js":339,"./util/index.js":304,"./view/index.js":296,"./view/root-injects.jsx":168};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=1092},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"Container",(function(){return Gn})),n.d(r,"Col",(function(){return Xn})),n.d(r,"Row",(function(){return Qn})),n.d(r,"Button",(function(){return er})),n.d(r,"TextArea",(function(){return tr})),n.d(r,"Input",(function(){return nr})),n.d(r,"Select",(function(){return rr})),n.d(r,"Link",(function(){return or})),n.d(r,"Collapse",(function(){return ir}));var o={};n.r(o),n.d(o,"JsonSchemaForm",(function(){return Gr})),n.d(o,"JsonSchema_string",(function(){return Zr})),n.d(o,"JsonSchema_array",(function(){return Xr})),n.d(o,"JsonSchemaArrayItemText",(function(){return Qr})),n.d(o,"JsonSchemaArrayItemFile",(function(){return eo})),n.d(o,"JsonSchema_boolean",(function(){return to})),n.d(o,"JsonSchema_object",(function(){return no}));var a=n(32),i=n.n(a),s=n(15),u=n.n(s),c=n(20),l=n.n(c),p=n(13),f=n.n(p),h=n(2),d=n.n(h),v=n(84),m=n.n(v),g=n(6),y=n.n(g),b=n(22),_=n.n(b),w=n(14),E=n.n(w),x=n(3),C=n.n(x),S=n(23),A=n.n(S),k=n(21),O=n.n(k),j=n(30),T=n.n(j),I=n(7),P=n.n(I),N=n(5),M=n.n(N),R=n(0),D=n.n(R),L=n(146),B=n(1),F=n.n(B),U=n(506),q=n(141),z=n.n(q),V=n(207),W=n.n(V),H=n(61),J=n(27),$=n(4),K=function(e){return e};var Y=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P()(this,e),m()(this,{state:{},plugins:[],system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},n),this.getSystem=T()(t=this._getSystem).call(t,this),this.store=ee(K,Object(B.fromJS)(this.state),this.getSystem),this.buildSystem(!1),this.register(this.plugins)}return M()(e,[{key:"getStore",value:function(){return this.store}},{key:"register",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=G(e,this.getSystem());X(this.system,n),t&&this.buildSystem();var r=Z.call(this.system,e,this.getSystem());r&&this.buildSystem()}},{key:"buildSystem",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,n=this.getStore().getState;this.boundSystem=O()({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(n,this.getSystem),this.getStateThunks(n),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}},{key:"_getSystem",value:function(){return this.boundSystem}},{key:"getRootInjects",value:function(){var e,t,n;return O()({getSystem:this.getSystem,getStore:T()(e=this.getStore).call(e,this),getComponents:T()(t=this.getComponents).call(t,this),getState:this.getStore().getState,getConfigs:T()(n=this._getConfigs).call(n,this),Im:F.a,React:D.a},this.system.rootInjects||{})}},{key:"_getConfigs",value:function(){return this.system.configs}},{key:"getConfigs",value:function(){return{configs:this.system.configs}}},{key:"setConfigs",value:function(e){this.system.configs=e}},{key:"rebuildReducer",value:function(){var e,t,n,r;this.store.replaceReducer((r=this.system.statePlugins,e=Object($.y)(r,(function(e){return e.reducers})),n=_()(t=u()(e)).call(t,(function(t,n){return t[n]=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new B.Map,n=arguments.length>1?arguments[1]:void 0;if(!e)return t;var r=e[n.type];if(r){var o=Q(r)(t,n);return null===o?t:o}return t}}(e[n]),t}),{}),u()(n).length?Object(U.combineReducers)(n):K))}},{key:"getType",value:function(e){var t=e[0].toUpperCase()+A()(e).call(e,1);return Object($.z)(this.system.statePlugins,(function(n,r){var o=n[e];if(o)return C()({},r+t,o)}))}},{key:"getSelectors",value:function(){return this.getType("selectors")}},{key:"getActions",value:function(){var e=this.getType("actions");return Object($.y)(e,(function(e){return Object($.z)(e,(function(e,t){if(Object($.r)(e))return C()({},t,e)}))}))}},{key:"getWrappedAndBoundActions",value:function(e){var t=this,n=this.getBoundActions(e);return Object($.y)(n,(function(e,n){var r=t.system.statePlugins[A()(n).call(n,0,-7)].wrapActions;return r?Object($.y)(e,(function(e,n){var o=r[n];return o?(E()(o)||(o=[o]),_()(o).call(o,(function(e,n){var r=function(){return n(e,t.getSystem()).apply(void 0,arguments)};if(!Object($.r)(r))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return Q(r)}),e||Function.prototype)):e})):e}))}},{key:"getWrappedAndBoundSelectors",value:function(e,t){var n=this,r=this.getBoundSelectors(e,t);return Object($.y)(r,(function(t,r){var o=[A()(r).call(r,0,-9)],a=n.system.statePlugins[o].wrapSelectors;return a?Object($.y)(t,(function(t,r){var i=a[r];return i?(E()(i)||(i=[i]),_()(i).call(i,(function(t,r){var a=function(){for(var a,i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];return r(t,n.getSystem()).apply(void 0,d()(a=[e().getIn(o)]).call(a,s))};if(!Object($.r)(a))throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)");return a}),t||Function.prototype)):t})):t}))}},{key:"getStates",value:function(e){var t;return _()(t=u()(this.system.statePlugins)).call(t,(function(t,n){return t[n]=e.get(n),t}),{})}},{key:"getStateThunks",value:function(e){var t;return _()(t=u()(this.system.statePlugins)).call(t,(function(t,n){return t[n]=function(){return e().get(n)},t}),{})}},{key:"getFn",value:function(){return{fn:this.system.fn}}},{key:"getComponents",value:function(e){var t=this,n=this.system.components[e];return E()(n)?_()(n).call(n,(function(e,n){return n(e,t.getSystem())})):void 0!==e?this.system.components[e]:this.system.components}},{key:"getBoundSelectors",value:function(e,t){return Object($.y)(this.getSelectors(),(function(n,r){var o=[A()(r).call(r,0,-9)],a=function(){return e().getIn(o)};return Object($.y)(n,(function(e){return function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var s=Q(e).apply(null,d()(n=[a()]).call(n,o));return"function"==typeof s&&(s=Q(s)(t())),s}}))}))}},{key:"getBoundActions",value:function(e){e=e||this.getStore().dispatch;var t=this.getActions(),n=function e(t){return"function"!=typeof t?Object($.y)(t,(function(t){return e(t)})):function(){var e=null;try{e=t.apply(void 0,arguments)}catch(t){e={type:H.NEW_THROWN_ERR,error:!0,payload:z()(t)}}finally{return e}}};return Object($.y)(t,(function(t){return Object(L.bindActionCreators)(n(t),e)}))}},{key:"getMapStateToProps",value:function(){var e=this;return function(){return O()({},e.getSystem())}}},{key:"getMapDispatchToProps",value:function(e){var t=this;return function(n){return m()({},t.getWrappedAndBoundActions(n),t.getFn(),e)}}}]),e}();function G(e,t){return Object($.u)(e)&&!Object($.p)(e)?W()({},e):Object($.s)(e)?G(e(t),t):Object($.p)(e)?_()(n=y()(e).call(e,(function(e){return G(e,t)}))).call(n,X,{}):{};var n}function Z(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.hasLoaded,a=o;return Object($.u)(e)&&!Object($.p)(e)&&"function"==typeof e.afterLoad&&(a=!0,Q(e.afterLoad).call(this,t)),Object($.s)(e)?Z.call(this,e(t),t,{hasLoaded:a}):Object($.p)(e)?y()(e).call(e,(function(e){return Z.call(n,e,t,{hasLoaded:a})})):a}function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object($.u)(e))return{};if(!Object($.u)(t))return e;t.wrapComponents&&(Object($.y)(t.wrapComponents,(function(n,r){var o=e.components&&e.components[r];o&&E()(o)?(e.components[r]=d()(o).call(o,[n]),delete t.wrapComponents[r]):o&&(e.components[r]=[o,n],delete t.wrapComponents[r])})),u()(t.wrapComponents).length||delete t.wrapComponents);var n=e.statePlugins;if(Object($.u)(n))for(var r in n){var o=n[r];if(Object($.u)(o)&&Object($.u)(o.wrapActions)){var a=o.wrapActions;for(var i in a){var s,c=a[i];if(E()(c)||(c=[c],a[i]=c),t&&t.statePlugins&&t.statePlugins[r]&&t.statePlugins[r].wrapActions&&t.statePlugins[r].wrapActions[i])t.statePlugins[r].wrapActions[i]=d()(s=a[i]).call(s,t.statePlugins[r].wrapActions[i])}}}return m()(e,t)}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.logErrors,r=void 0===n||n;return"function"!=typeof e?e:function(){try{for(var t,n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return e.call.apply(e,d()(t=[this]).call(t,o))}catch(e){return r&&console.error(e),null}}}function ee(e,t,n){return function(e,t,n){var r=[Object($.K)(n)],o=J.a.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||L.compose;return Object(L.createStore)(e,t,o(L.applyMiddleware.apply(void 0,r)))}(e,t,n)}var te=n(285),ne=n(290),re=n(293),oe=n(296),ae=n(297),ie=n(298),se=n(339),ue=n(300),ce=n(304),le=n(305),pe=n(340),fe=n(309),he=n(313),de=n(315),ve=n(12),me=n.n(ve),ge=n(10),ye=n.n(ge),be=n(8),_e=n.n(be),we=n(9),Ee=n.n(we),xe=(n(11),n(28),n(60)),Ce=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"toggleShown",(function(){var e=o.props,t=e.layoutActions,n=e.tag,r=e.operationId,a=e.isShown,i=o.getResolvedSubtree();a||void 0!==i||o.requestResolvedSubtree(),t.show(["operations",n,r],!a)})),C()(ye()(o),"onCancelClick",(function(){o.setState({tryItOutEnabled:!o.state.tryItOutEnabled})})),C()(ye()(o),"onTryoutClick",(function(){o.setState({tryItOutEnabled:!o.state.tryItOutEnabled})})),C()(ye()(o),"onExecute",(function(){o.setState({executeInProgress:!0})})),C()(ye()(o),"getResolvedSubtree",(function(){var e=o.props,t=e.specSelectors,n=e.path,r=e.method,a=e.specPath;return a?t.specResolvedSubtree(a.toJS()):t.specResolvedSubtree(["paths",n,r])})),C()(ye()(o),"requestResolvedSubtree",(function(){var e=o.props,t=e.specActions,n=e.path,r=e.method,a=e.specPath;return a?t.requestResolvedSubtree(a.toJS()):t.requestResolvedSubtree(["paths",n,r])})),o.state={tryItOutEnabled:!1,executeInProgress:!1},o}return M()(n,[{key:"mapStateToProps",value:function(e,t){var n,r=t.op,o=t.layoutSelectors,a=(0,t.getConfigs)(),i=a.docExpansion,s=a.deepLinking,u=a.displayOperationId,c=a.displayRequestDuration,l=a.supportedSubmitMethods,p=o.showSummary(),f=r.getIn(["operation","__originalOperationId"])||r.getIn(["operation","operationId"])||Object(xe.e)(r.get("operation"),t.path,t.method)||r.get("id"),h=["operations",t.tag,f],v=s&&"false"!==s,m=me()(l).call(l,t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),g=r.getIn(["operation","security"])||t.specSelectors.security();return{operationId:f,isDeepLinkingEnabled:v,showSummary:p,displayOperationId:u,displayRequestDuration:c,allowTryItOut:m,security:g,isAuthorized:t.authSelectors.isAuthorized(g),isShown:o.isShown(h,"full"===i),jumpToKey:d()(n="paths.".concat(t.path,".")).call(n,t.method),response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}},{key:"componentDidMount",value:function(){var e=this.props.isShown,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}},{key:"componentWillReceiveProps",value:function(e){var t=e.response,n=e.isShown,r=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),n&&void 0===r&&this.requestResolvedSubtree()}},{key:"render",value:function(){var e=this.props,t=e.op,n=e.tag,r=e.path,o=e.method,a=e.security,i=e.isAuthorized,s=e.operationId,u=e.showSummary,c=e.isShown,l=e.jumpToKey,p=e.allowTryItOut,f=e.response,h=e.request,d=e.displayOperationId,v=e.displayRequestDuration,m=e.isDeepLinkingEnabled,g=e.specPath,y=e.specSelectors,b=e.specActions,_=e.getComponent,w=e.getConfigs,E=e.layoutSelectors,x=e.layoutActions,C=e.authActions,S=e.authSelectors,A=e.oas3Actions,k=e.oas3Selectors,O=e.fn,j=_("operation"),T=this.getResolvedSubtree()||Object(B.Map)(),I=Object(B.fromJS)({op:T,tag:n,path:r,summary:t.getIn(["operation","summary"])||"",deprecated:T.get("deprecated")||t.getIn(["operation","deprecated"])||!1,method:o,security:a,isAuthorized:i,operationId:s,originalOperationId:T.getIn(["operation","__originalOperationId"]),showSummary:u,isShown:c,jumpToKey:l,allowTryItOut:p,request:h,displayOperationId:d,displayRequestDuration:v,isDeepLinkingEnabled:m,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return D.a.createElement(j,{operation:I,response:f,request:h,isShown:c,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:g,specActions:b,specSelectors:y,oas3Actions:A,oas3Selectors:k,layoutActions:x,layoutSelectors:E,authActions:C,authSelectors:S,getComponent:_,getConfigs:w,fn:O})}}]),n}(R.PureComponent);C()(Ce,"defaultProps",{showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1});var Se=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"getLayout",value:function(){var e=this.props,t=e.getComponent,n=e.layoutSelectors.current(),r=t(n,!0);return r||function(){return D.a.createElement("h1",null,' No layout defined for "',n,'" ')}}},{key:"render",value:function(){var e=this.getLayout();return D.a.createElement(e,null)}}]),n}(D.a.Component);Se.defaultProps={};var Ae=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"close",(function(){r.props.authActions.showDefinitions(!1)})),r}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.authSelectors,r=t.authActions,o=t.getComponent,a=t.errSelectors,i=t.specSelectors,s=t.fn.AST,u=void 0===s?{}:s,c=n.shownDefinitions(),l=o("auths");return D.a.createElement("div",{className:"dialog-ux"},D.a.createElement("div",{className:"backdrop-ux"}),D.a.createElement("div",{className:"modal-ux"},D.a.createElement("div",{className:"modal-dialog-ux"},D.a.createElement("div",{className:"modal-ux-inner"},D.a.createElement("div",{className:"modal-ux-header"},D.a.createElement("h3",null,"Available authorizations"),D.a.createElement("button",{type:"button",className:"close-modal",onClick:this.close},D.a.createElement("svg",{width:"20",height:"20"},D.a.createElement("use",{href:"#close",xlinkHref:"#close"})))),D.a.createElement("div",{className:"modal-ux-content"},y()(e=c.valueSeq()).call(e,(function(e,t){return D.a.createElement(l,{key:t,AST:u,definitions:e,getComponent:o,errSelectors:a,authSelectors:n,authActions:r,specSelectors:i})})))))))}}]),n}(D.a.Component),ke=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.isAuthorized,n=e.showPopup,r=e.onClick,o=(0,e.getComponent)("authorizationPopup",!0);return D.a.createElement("div",{className:"auth-wrapper"},D.a.createElement("button",{className:t?"btn authorize locked":"btn authorize unlocked",onClick:r},D.a.createElement("span",null,"Authorize"),D.a.createElement("svg",{width:"20",height:"20"},D.a.createElement("use",{href:t?"#locked":"#unlocked",xlinkHref:t?"#locked":"#unlocked"}))),n&&D.a.createElement(o,null))}}]),n}(D.a.Component),Oe=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.authActions,n=e.authSelectors,r=e.specSelectors,o=e.getComponent,a=r.securityDefinitions(),i=n.definitionsToAuthorize(),s=o("authorizeBtn");return a?D.a.createElement(s,{onClick:function(){return t.showDefinitions(i)},isAuthorized:!!n.authorized().size,showPopup:!!n.shownDefinitions(),getComponent:o}):null}}]),n}(D.a.Component),je=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onClick",(function(e){e.stopPropagation();var t=r.props.onClick;t&&t()})),r}return M()(n,[{key:"render",value:function(){var e=this.props.isAuthorized;return D.a.createElement("button",{className:e?"authorization__btn locked":"authorization__btn unlocked","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},D.a.createElement("svg",{width:"20",height:"20"},D.a.createElement("use",{href:e?"#locked":"#unlocked",xlinkHref:e?"#locked":"#unlocked"})))}}]),n}(D.a.Component),Te=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onAuthChange",(function(e){var t=e.name;o.setState(C()({},t,e))})),C()(ye()(o),"submitAuth",(function(e){e.preventDefault(),o.props.authActions.authorizeWithPersistOption(o.state)})),C()(ye()(o),"logoutClick",(function(e){e.preventDefault();var t=o.props,n=t.authActions,r=t.definitions,a=y()(r).call(r,(function(e,t){return t})).toArray();o.setState(_()(a).call(a,(function(e,t){return e[t]="",e}),{})),n.logoutWithPersistOption(a)})),C()(ye()(o),"close",(function(e){e.preventDefault(),o.props.authActions.showDefinitions(!1)})),o.state={},o}return M()(n,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.definitions,o=n.getComponent,a=n.authSelectors,i=n.errSelectors,s=o("AuthItem"),u=o("oauth2",!0),c=o("Button"),l=a.authorized(),p=f()(r).call(r,(function(e,t){return!!l.get(t)})),h=f()(r).call(r,(function(e){return"oauth2"!==e.get("type")})),d=f()(r).call(r,(function(e){return"oauth2"===e.get("type")}));return D.a.createElement("div",{className:"auth-container"},!!h.size&&D.a.createElement("form",{onSubmit:this.submitAuth},y()(h).call(h,(function(e,n){return D.a.createElement(s,{key:n,schema:e,name:n,getComponent:o,onAuthChange:t.onAuthChange,authorized:l,errSelectors:i})})).toArray(),D.a.createElement("div",{className:"auth-btn-wrapper"},h.size===p.size?D.a.createElement(c,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):D.a.createElement(c,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),D.a.createElement(c,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),d&&d.size?D.a.createElement("div",null,D.a.createElement("div",{className:"scope-def"},D.a.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),D.a.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),y()(e=f()(r).call(r,(function(e){return"oauth2"===e.get("type")}))).call(e,(function(e,t){return D.a.createElement("div",{key:t},D.a.createElement(u,{authorized:l,schema:e,name:t}))})).toArray()):null)}}]),n}(D.a.Component),Ie=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.schema,r=t.name,o=t.getComponent,a=t.onAuthChange,i=t.authorized,s=t.errSelectors,u=o("apiKeyAuth"),c=o("basicAuth"),l=n.get("type");switch(l){case"apiKey":e=D.a.createElement(u,{key:r,schema:n,name:r,errSelectors:s,authorized:i,getComponent:o,onChange:a});break;case"basic":e=D.a.createElement(c,{key:r,schema:n,name:r,errSelectors:s,authorized:i,getComponent:o,onChange:a});break;default:e=D.a.createElement("div",{key:r},"Unknown security definition type ",l)}return D.a.createElement("div",{key:"".concat(r,"-jump")},e)}}]),n}(D.a.Component),Pe=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props.error,t=e.get("level"),n=e.get("message"),r=e.get("source");return D.a.createElement("div",{className:"errors"},D.a.createElement("b",null,r," ",t),D.a.createElement("span",null,n))}}]),n}(D.a.Component),Ne=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onChange",(function(e){var t=o.props.onChange,n=e.target.value,r=O()({},o.state,{value:n});o.setState(r),t(r)}));var a=o.props,i=a.name,s=a.schema,u=o.getValue();return o.state={name:i,schema:s,value:u},o}return M()(n,[{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.authorized;return n&&n.getIn([t,"value"])}},{key:"render",value:function(){var e,t,n=this.props,r=n.schema,o=n.getComponent,a=n.errSelectors,i=n.name,s=o("Input"),u=o("Row"),c=o("Col"),l=o("authError"),p=o("Markdown",!0),h=o("JumpToPath",!0),d=this.getValue(),v=f()(e=a.allErrors()).call(e,(function(e){return e.get("authId")===i}));return D.a.createElement("div",null,D.a.createElement("h4",null,D.a.createElement("code",null,i||r.get("name")),"  (apiKey)",D.a.createElement(h,{path:["securityDefinitions",i]})),d&&D.a.createElement("h6",null,"Authorized"),D.a.createElement(u,null,D.a.createElement(p,{source:r.get("description")})),D.a.createElement(u,null,D.a.createElement("p",null,"Name: ",D.a.createElement("code",null,r.get("name")))),D.a.createElement(u,null,D.a.createElement("p",null,"In: ",D.a.createElement("code",null,r.get("in")))),D.a.createElement(u,null,D.a.createElement("label",null,"Value:"),d?D.a.createElement("code",null," ****** "):D.a.createElement(c,null,D.a.createElement(s,{type:"text",onChange:this.onChange}))),y()(t=v.valueSeq()).call(t,(function(e,t){return D.a.createElement(l,{error:e,key:t})})))}}]),n}(D.a.Component),Me=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onChange",(function(e){var t=o.props.onChange,n=e.target,r=n.value,a=n.name,i=o.state.value;i[a]=r,o.setState({value:i}),t(o.state)}));var a=o.props,i=a.schema,s=a.name,u=o.getValue().username;return o.state={name:s,schema:i,value:u?{username:u}:{}},o}return M()(n,[{key:"getValue",value:function(){var e=this.props,t=e.authorized,n=e.name;return t&&t.getIn([n,"value"])||{}}},{key:"render",value:function(){var e,t,n=this.props,r=n.schema,o=n.getComponent,a=n.name,i=n.errSelectors,s=o("Input"),u=o("Row"),c=o("Col"),l=o("authError"),p=o("JumpToPath",!0),h=o("Markdown",!0),d=this.getValue().username,v=f()(e=i.allErrors()).call(e,(function(e){return e.get("authId")===a}));return D.a.createElement("div",null,D.a.createElement("h4",null,"Basic authorization",D.a.createElement(p,{path:["securityDefinitions",a]})),d&&D.a.createElement("h6",null,"Authorized"),D.a.createElement(u,null,D.a.createElement(h,{source:r.get("description")})),D.a.createElement(u,null,D.a.createElement("label",null,"Username:"),d?D.a.createElement("code",null," ",d," "):D.a.createElement(c,null,D.a.createElement(s,{type:"text",required:"required",name:"username",onChange:this.onChange}))),D.a.createElement(u,null,D.a.createElement("label",null,"Password:"),d?D.a.createElement("code",null," ****** "):D.a.createElement(c,null,D.a.createElement(s,{autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),y()(t=v.valueSeq()).call(t,(function(e,t){return D.a.createElement(l,{error:e,key:t})})))}}]),n}(D.a.Component);function Re(e){var t=e.example,n=e.showValue,r=e.getComponent,o=e.getConfigs,a=r("Markdown",!0),i=r("highlightCode");return t?D.a.createElement("div",{className:"example"},t.get("description")?D.a.createElement("section",{className:"example__section"},D.a.createElement("div",{className:"example__section-header"},"Example Description"),D.a.createElement("p",null,D.a.createElement(a,{source:t.get("description")}))):null,n&&t.has("value")?D.a.createElement("section",{className:"example__section"},D.a.createElement("div",{className:"example__section-header"},"Example Value"),D.a.createElement(i,{getConfigs:o,value:Object($.J)(t.get("value"))})):null):null}var De=n(527),Le=n.n(De),Be=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"_onSelect",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSyntheticChange,o=void 0!==n&&n;"function"==typeof r.props.onSelect&&r.props.onSelect(e,{isSyntheticChange:o})})),C()(ye()(r),"_onDomSelect",(function(e){if("function"==typeof r.props.onSelect){var t=e.target.selectedOptions[0].getAttribute("value");r._onSelect(t,{isSyntheticChange:!1})}})),C()(ye()(r),"getCurrentExample",(function(){var e=r.props,t=e.examples,n=e.currentExampleKey,o=t.get(n),a=t.keySeq().first(),i=t.get(a);return o||i||Le()({})})),r}return M()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.onSelect,n=e.examples;if("function"==typeof t){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"componentWillReceiveProps",value:function(e){var t=e.currentExampleKey,n=e.examples;if(n!==this.props.examples&&!n.has(t)){var r=n.first(),o=n.keyOf(r);this._onSelect(o,{isSyntheticChange:!0})}}},{key:"render",value:function(){var e=this.props,t=e.examples,n=e.currentExampleKey,r=e.isValueModified,o=e.isModifiedValueAvailable,a=e.showLabels;return D.a.createElement("div",{className:"examples-select"},a?D.a.createElement("span",{className:"examples-select__section-label"},"Examples: "):null,D.a.createElement("select",{onChange:this._onDomSelect,value:o&&r?"__MODIFIED__VALUE__":n||""},o?D.a.createElement("option",{value:"__MODIFIED__VALUE__"},"[Modified value]"):null,y()(t).call(t,(function(e,t){return D.a.createElement("option",{key:t,value:t},e.get("summary")||t)})).valueSeq()))}}]),n}(D.a.PureComponent);C()(Be,"defaultProps",{examples:F.a.Map({}),onSelect:function(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=console).log.apply(e,d()(t=["DEBUG: ExamplesSelect was not given an onSelect callback"]).call(t,r))},currentExampleKey:null,showLabels:!0});var Fe=n(58),Ue=n.n(Fe),qe=function(e){return B.List.isList(e)?e:Object($.J)(e)},ze=function(e){_e()(n,e);var t=Ee()(n);function n(e){var r;P()(this,n),r=t.call(this,e),C()(ye()(r),"_getStateForCurrentNamespace",(function(){var e=r.props.currentNamespace;return(r.state[e]||Object(B.Map)()).toObject()})),C()(ye()(r),"_setStateForCurrentNamespace",(function(e){var t=r.props.currentNamespace;return r._setStateForNamespace(t,e)})),C()(ye()(r),"_setStateForNamespace",(function(e,t){var n=(r.state[e]||Object(B.Map)()).mergeDeep(t);return r.setState(C()({},e,n))})),C()(ye()(r),"_isCurrentUserInputSameAsExampleValue",(function(){var e=r.props.currentUserInputValue;return r._getCurrentExampleValue()===e})),C()(ye()(r),"_getValueForExample",(function(e,t){var n=(t||r.props).examples;return qe((n||Object(B.Map)({})).getIn([e,"value"]))})),C()(ye()(r),"_getCurrentExampleValue",(function(e){var t=(e||r.props).currentKey;return r._getValueForExample(t,e||r.props)})),C()(ye()(r),"_onExamplesSelect",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSyntheticChange,o=r.props,a=o.onSelect,i=o.updateValue,s=o.currentUserInputValue,u=r._getStateForCurrentNamespace(),c=u.lastUserEditedValue,l=r._getValueForExample(e);if("__MODIFIED__VALUE__"===e)return i(qe(c)),r._setStateForCurrentNamespace({isModifiedValueSelected:!0});if("function"==typeof a){for(var p,f=arguments.length,h=new Array(f>2?f-2:0),v=2;v<f;v++)h[v-2]=arguments[v];a.apply(void 0,d()(p=[e,{isSyntheticChange:n}]).call(p,h))}r._setStateForCurrentNamespace({lastDownstreamValue:l,isModifiedValueSelected:n&&!!s&&s!==l}),n||"function"==typeof i&&i(qe(l))}));var o=r._getCurrentExampleValue();return r.state=C()({},e.currentNamespace,Object(B.Map)({lastUserEditedValue:r.props.currentUserInputValue,lastDownstreamValue:o,isModifiedValueSelected:r.props.currentUserInputValue!==o})),r}return M()(n,[{key:"componentWillReceiveProps",value:function(e){var t=e.currentUserInputValue,n=e.examples,r=e.onSelect,o=this._getStateForCurrentNamespace(),a=o.lastUserEditedValue,i=o.lastDownstreamValue,s=this._getValueForExample(e.currentKey,e),u=Ue()(n).call(n,(function(e){return e.get("value")===t||Object($.J)(e.get("value"))===t}));u?r(n.keyOf(u),{isSyntheticChange:!0}):t!==this.props.currentUserInputValue&&t!==a&&t!==i&&this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:t!==s})}},{key:"render",value:function(){var e=this.props,t=e.currentUserInputValue,n=e.examples,r=e.currentKey,o=e.getComponent,a=this._getStateForCurrentNamespace(),i=a.lastDownstreamValue,s=a.lastUserEditedValue,u=a.isModifiedValueSelected,c=o("ExamplesSelect");return D.a.createElement(c,{examples:n,currentExampleKey:r,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!s&&s!==i,isValueModified:void 0!==t&&u&&t!==this._getCurrentExampleValue()})}}]),n}(D.a.PureComponent);C()(ze,"defaultProps",{examples:Object(B.Map)({}),currentNamespace:"__DEFAULT__NAMESPACE__",onSelect:function(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=console).log.apply(e,d()(t=["ExamplesSelectValueRetainer: no `onSelect` function was provided"]).call(t,r))},updateValue:function(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=console).log.apply(e,d()(t=["ExamplesSelectValueRetainer: no `updateValue` function was provided"]).call(t,r))}});var Ve=n(37),We=n.n(Ve),He=n(123),Je=n.n(He),$e=n(211),Ke=n.n($e);var Ye=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;P()(this,n),o=t.call(this,e,r),C()(ye()(o),"close",(function(e){e.preventDefault(),o.props.authActions.showDefinitions(!1)})),C()(ye()(o),"authorize",(function(){var e=o.props,t=e.authActions,n=e.errActions,r=e.getConfigs,a=e.authSelectors,i=r(),s=a.getConfigs();n.clear({authId:name,type:"auth",source:"auth"}),function(e){var t=e.auth,n=e.authActions,r=e.errActions,o=e.configs,a=e.authConfigs,i=void 0===a?{}:a,s=t.schema,u=t.scopes,c=t.name,l=t.clientId,p=s.get("flow"),f=[];switch(p){case"password":return void n.authorizePassword(t);case"application":return void n.authorizeApplication(t);case"accessCode":f.push("response_type=code");break;case"implicit":f.push("response_type=token");break;case"clientCredentials":return void n.authorizeApplication(t);case"authorizationCode":f.push("response_type=code")}"string"==typeof l&&f.push("client_id="+encodeURIComponent(l));var h=o.oauth2RedirectUrl;if(void 0!==h){f.push("redirect_uri="+encodeURIComponent(h));var d=[];if(E()(u)?d=u:F.a.List.isList(u)&&(d=u.toArray()),d.length>0){var v=i.scopeSeparator||" ";f.push("scope="+encodeURIComponent(d.join(v)))}var m=Object($.a)(new Date);if(f.push("state="+encodeURIComponent(m)),void 0!==i.realm&&f.push("realm="+encodeURIComponent(i.realm)),"authorizationCode"===p&&i.usePkceWithAuthorizationCodeGrant){var g=Object($.j)(),b=Object($.c)(g);f.push("code_challenge="+b),f.push("code_challenge_method=S256"),t.codeVerifier=g}var _=i.additionalQueryStringParams;for(var w in _){var x;void 0!==_[w]&&f.push(y()(x=[w,_[w]]).call(x,encodeURIComponent).join("="))}var C,S=s.get("authorizationUrl"),A=[Object($.G)(S),f.join("&")].join(-1===me()(S).call(S,"?")?"?":"&");C="implicit"===p?n.preAuthorizeImplicit:i.useBasicAuthenticationWithAccessCodeGrant?n.authorizeAccessCodeWithBasicAuthentication:n.authorizeAccessCodeWithFormParams,J.a.swaggerUIRedirectOauth2={auth:t,state:m,redirectUrl:h,callback:C,errCb:r.newAuthErr},J.a.open(A)}else r.newAuthErr({authId:c,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."})}({auth:o.state,authActions:t,errActions:n,configs:i,authConfigs:s})})),C()(ye()(o),"onScopeChange",(function(e){var t,n,r=e.target,a=r.checked,i=r.dataset.value;if(a&&-1===me()(t=o.state.scopes).call(t,i)){var s,u=d()(s=o.state.scopes).call(s,[i]);o.setState({scopes:u})}else if(!a&&me()(n=o.state.scopes).call(n,i)>-1){var c;o.setState({scopes:f()(c=o.state.scopes).call(c,(function(e){return e!==i}))})}})),C()(ye()(o),"onInputChange",(function(e){var t=e.target,n=t.dataset.name,r=t.value,a=C()({},n,r);o.setState(a)})),C()(ye()(o),"selectScopes",(function(e){var t;e.target.dataset.all?o.setState({scopes:Ke()(Je()(t=o.props.schema.get("allowedScopes")||o.props.schema.get("scopes")).call(t))}):o.setState({scopes:[]})})),C()(ye()(o),"logout",(function(e){e.preventDefault();var t=o.props,n=t.authActions,r=t.errActions,a=t.name;r.clear({authId:a,type:"auth",source:"auth"}),n.logoutWithPersistOption([a])}));var a=o.props,i=a.name,s=a.schema,u=a.authorized,c=a.authSelectors,l=u&&u.get(i),p=c.getConfigs()||{},h=l&&l.get("username")||"",v=l&&l.get("clientId")||p.clientId||"",m=l&&l.get("clientSecret")||p.clientSecret||"",g=l&&l.get("passwordType")||"basic",b=l&&l.get("scopes")||p.scopes||[];return"string"==typeof b&&(b=b.split(p.scopeSeparator||" ")),o.state={appName:p.appName,name:i,schema:s,scopes:b,clientId:v,clientSecret:m,username:h,password:"",passwordType:g},o}return M()(n,[{key:"render",value:function(){var e,t,n=this,r=this.props,o=r.schema,a=r.getComponent,i=r.authSelectors,s=r.errSelectors,u=r.name,c=r.specSelectors,l=a("Input"),p=a("Row"),h=a("Col"),v=a("Button"),m=a("authError"),g=a("JumpToPath",!0),b=a("Markdown",!0),_=a("InitializedInput"),w=c.isOAS3,E="implicit",x="password",C=w()?"authorizationCode":"accessCode",S=w()?"clientCredentials":"application",A=o.get("flow"),k=o.get("allowedScopes")||o.get("scopes"),O=!!i.authorized().get(u),j=f()(e=s.allErrors()).call(e,(function(e){return e.get("authId")===u})),T=!f()(j).call(j,(function(e){return"validation"===e.get("source")})).size,I=o.get("description");return D.a.createElement("div",null,D.a.createElement("h4",null,u," (OAuth2, ",o.get("flow"),") ",D.a.createElement(g,{path:["securityDefinitions",u]})),this.state.appName?D.a.createElement("h5",null,"Application: ",this.state.appName," "):null,I&&D.a.createElement(b,{source:o.get("description")}),O&&D.a.createElement("h6",null,"Authorized"),(A===E||A===C)&&D.a.createElement("p",null,"Authorization URL: ",D.a.createElement("code",null,o.get("authorizationUrl"))),(A===x||A===C||A===S)&&D.a.createElement("p",null,"Token URL:",D.a.createElement("code",null," ",o.get("tokenUrl"))),D.a.createElement("p",{className:"flow"},"Flow: ",D.a.createElement("code",null,o.get("flow"))),A!==x?null:D.a.createElement(p,null,D.a.createElement(p,null,D.a.createElement("label",{htmlFor:"oauth_username"},"username:"),O?D.a.createElement("code",null," ",this.state.username," "):D.a.createElement(h,{tablet:10,desktop:10},D.a.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange}))),D.a.createElement(p,null,D.a.createElement("label",{htmlFor:"oauth_password"},"password:"),O?D.a.createElement("code",null," ****** "):D.a.createElement(h,{tablet:10,desktop:10},D.a.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),D.a.createElement(p,null,D.a.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),O?D.a.createElement("code",null," ",this.state.passwordType," "):D.a.createElement(h,{tablet:10,desktop:10},D.a.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},D.a.createElement("option",{value:"basic"},"Authorization header"),D.a.createElement("option",{value:"request-body"},"Request body"))))),(A===S||A===E||A===C||A===x)&&(!O||O&&this.state.clientId)&&D.a.createElement(p,null,D.a.createElement("label",{htmlFor:"client_id"},"client_id:"),O?D.a.createElement("code",null," ****** "):D.a.createElement(h,{tablet:10,desktop:10},D.a.createElement(_,{id:"client_id",type:"text",required:A===x,initialValue:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(A===S||A===C||A===x)&&D.a.createElement(p,null,D.a.createElement("label",{htmlFor:"client_secret"},"client_secret:"),O?D.a.createElement("code",null," ****** "):D.a.createElement(h,{tablet:10,desktop:10},D.a.createElement(_,{id:"client_secret",initialValue:this.state.clientSecret,type:"password","data-name":"clientSecret",onChange:this.onInputChange}))),!O&&k&&k.size?D.a.createElement("div",{className:"scopes"},D.a.createElement("h2",null,"Scopes:",D.a.createElement("a",{onClick:this.selectScopes,"data-all":!0},"select all"),D.a.createElement("a",{onClick:this.selectScopes},"select none")),y()(k).call(k,(function(e,t){var r,o,a,i,s;return D.a.createElement(p,{key:t},D.a.createElement("div",{className:"checkbox"},D.a.createElement(l,{"data-value":t,id:d()(r=d()(o="".concat(t,"-")).call(o,A,"-checkbox-")).call(r,n.state.name),disabled:O,checked:We()(a=n.state.scopes).call(a,t),type:"checkbox",onChange:n.onScopeChange}),D.a.createElement("label",{htmlFor:d()(i=d()(s="".concat(t,"-")).call(s,A,"-checkbox-")).call(i,n.state.name)},D.a.createElement("span",{className:"item"}),D.a.createElement("div",{className:"text"},D.a.createElement("p",{className:"name"},t),D.a.createElement("p",{className:"description"},e)))))})).toArray()):null,y()(t=j.valueSeq()).call(t,(function(e,t){return D.a.createElement(m,{error:e,key:t})})),D.a.createElement("div",{className:"auth-btn-wrapper"},T&&(O?D.a.createElement(v,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):D.a.createElement(v,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),D.a.createElement(v,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}]),n}(D.a.Component),Ge=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onClick",(function(){var e=r.props,t=e.specActions,n=e.path,o=e.method;t.clearResponse(n,o),t.clearRequest(n,o)})),r}return M()(n,[{key:"render",value:function(){return D.a.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}]),n}(R.Component),Ze=function(e){var t=e.headers;return D.a.createElement("div",null,D.a.createElement("h5",null,"Response headers"),D.a.createElement("pre",{className:"microlight"},t))},Xe=function(e){var t=e.duration;return D.a.createElement("div",null,D.a.createElement("h5",null,"Request duration"),D.a.createElement("pre",{className:"microlight"},t," ms"))},Qe=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"shouldComponentUpdate",value:function(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}},{key:"render",value:function(){var e,t=this.props,n=t.response,r=t.getComponent,o=t.getConfigs,a=t.displayRequestDuration,i=t.specSelectors,s=t.path,c=t.method,l=o().showMutatedRequest?i.mutatedRequestFor(s,c):i.requestFor(s,c),p=n.get("status"),f=l.get("url"),h=n.get("headers").toJS(),v=n.get("notDocumented"),m=n.get("error"),g=n.get("text"),b=n.get("duration"),_=u()(h),w=h["content-type"]||h["Content-Type"],E=r("curl"),x=r("responseBody"),C=y()(_).call(_,(function(e){return D.a.createElement("span",{className:"headerline",key:e}," ",e,": ",h[e]," ")})),S=0!==C.length;return D.a.createElement("div",null,l&&D.a.createElement(E,{request:l,getConfigs:o}),f&&D.a.createElement("div",null,D.a.createElement("h4",null,"Request URL"),D.a.createElement("div",{className:"request-url"},D.a.createElement("pre",{className:"microlight"},f))),D.a.createElement("h4",null,"Server response"),D.a.createElement("table",{className:"responses-table live-responses-table"},D.a.createElement("thead",null,D.a.createElement("tr",{className:"responses-header"},D.a.createElement("td",{className:"col_header response-col_status"},"Code"),D.a.createElement("td",{className:"col_header response-col_description"},"Details"))),D.a.createElement("tbody",null,D.a.createElement("tr",{className:"response"},D.a.createElement("td",{className:"response-col_status"},p,v?D.a.createElement("div",{className:"response-undocumented"},D.a.createElement("i",null," Undocumented ")):null),D.a.createElement("td",{className:"response-col_description"},m?D.a.createElement("span",null,d()(e="".concat(n.get("name"),": ")).call(e,n.get("message"))):null,g?D.a.createElement(x,{content:g,contentType:w,url:f,headers:h,getConfigs:o,getComponent:r}):null,S?D.a.createElement(Ze,{headers:C}):null,a&&b?D.a.createElement(Xe,{duration:b}):null)))))}}]),n}(D.a.Component),et=n(216),tt=["get","put","post","delete","options","head","patch"],nt=d()(tt).call(tt,["trace"]),rt=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.oas3Selectors,o=e.layoutSelectors,a=e.layoutActions,i=e.getConfigs,s=e.fn,u=t.taggedOperations(),c=n("OperationContainer",!0),l=n("OperationTag"),p=i().maxDisplayedTags,f=o.currentFilter();return f&&!0!==f&&"true"!==f&&"false"!==f&&(u=s.opsFilter(u,f)),p&&!isNaN(p)&&p>=0&&(u=A()(u).call(u,0,p)),D.a.createElement("div",null,y()(u).call(u,(function(e,s){var u=e.get("operations");return D.a.createElement(l,{key:"operation-"+s,tagObj:e,tag:s,oas3Selectors:r,layoutSelectors:o,layoutActions:a,getConfigs:i,getComponent:n,specUrl:t.url()},y()(u).call(u,(function(e){var n,r=e.get("path"),o=e.get("method"),a=F.a.List(["paths",r,o]),i=t.isOAS3()?nt:tt;return-1===me()(i).call(i,o)?null:D.a.createElement(c,{key:d()(n="".concat(r,"-")).call(n,o),specPath:a,op:e,path:r,method:o,tag:s})})).toArray())})).toArray(),u.size<1?D.a.createElement("h3",null," No operations defined in spec! "):null)}}]),n}(D.a.Component),ot=n(169),at=n.n(ot);function it(e){return e.match(/^(?:[a-z]+:)?\/\//i)}function st(e,t){return e?it(e)?(n=e).match(/^\/\//i)?d()(r="".concat(window.location.protocol)).call(r,n):n:new at.a(e,t).href:t;var n,r}function ut(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.selectedServer,o=void 0===r?"":r;if(e){if(it(e))return e;var a=st(o,t);return new at.a(e,a).href}}var ct=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.tagObj,r=t.tag,o=t.children,a=t.oas3Selectors,i=t.layoutSelectors,s=t.layoutActions,u=t.getConfigs,c=t.getComponent,l=t.specUrl,p=u(),f=p.docExpansion,h=p.deepLinking,d=h&&"false"!==h,v=c("Collapse"),m=c("Markdown",!0),g=c("DeepLink"),b=c("Link"),_=n.getIn(["tagDetails","description"],null),w=n.getIn(["tagDetails","externalDocs","description"]),E=n.getIn(["tagDetails","externalDocs","url"]);Object($.s)(a)&&Object($.s)(a.selectedServer)&&(e=ut(E,l,{selectedServer:a.selectedServer()}));var x=["operations-tag",r],C=i.isShown(x,"full"===f||"list"===f);return D.a.createElement("div",{className:C?"opblock-tag-section is-open":"opblock-tag-section"},D.a.createElement("h4",{onClick:function(){return s.show(x,!C)},className:_?"opblock-tag":"opblock-tag no-desc",id:y()(x).call(x,(function(e){return Object($.g)(e)})).join("-"),"data-tag":r,"data-is-open":C},D.a.createElement(g,{enabled:d,isShown:C,path:Object($.d)(r),text:r}),_?D.a.createElement("small",null,D.a.createElement(m,{source:_})):D.a.createElement("small",null),D.a.createElement("div",null,w?D.a.createElement("small",null,w,e?": ":null,e?D.a.createElement(b,{href:Object($.G)(e),onClick:function(e){return e.stopPropagation()},target:"_blank"},e):null):null),D.a.createElement("button",{className:"expand-operation",title:C?"Collapse operation":"Expand operation",onClick:function(){return s.show(x,!C)}},D.a.createElement("svg",{className:"arrow",width:"20",height:"20"},D.a.createElement("use",{href:C?"#large-arrow-down":"#large-arrow",xlinkHref:C?"#large-arrow-down":"#large-arrow"})))),D.a.createElement(v,{isOpened:C},o))}}]),n}(D.a.Component);C()(ct,"defaultProps",{tagObj:F.a.fromJS({}),tag:""});var lt=function(e){_e()(r,e);var t=Ee()(r);function r(){return P()(this,r),t.apply(this,arguments)}return M()(r,[{key:"render",value:function(){var e=this.props,t=e.specPath,r=e.response,o=e.request,a=e.toggleShown,i=e.onTryoutClick,s=e.onCancelClick,u=e.onExecute,c=e.fn,l=e.getComponent,p=e.getConfigs,f=e.specActions,h=e.specSelectors,d=e.authActions,v=e.authSelectors,m=e.oas3Actions,g=e.oas3Selectors,y=this.props.operation,b=y.toJS(),_=b.deprecated,w=b.isShown,E=b.path,x=b.method,C=b.op,S=b.tag,A=b.operationId,k=b.allowTryItOut,O=b.displayRequestDuration,j=b.tryItOutEnabled,T=b.executeInProgress,I=C.description,P=C.externalDocs,N=C.schemes,M=P?ut(P.url,h.url(),{selectedServer:g.selectedServer()}):"",R=y.getIn(["op"]),L=R.get("responses"),B=Object($.n)(R,["parameters"]),F=h.operationScheme(E,x),U=["operations",S,A],q=Object($.m)(R),z=l("responses"),V=l("parameters"),W=l("execute"),H=l("clear"),J=l("Collapse"),K=l("Markdown",!0),Y=l("schemes"),G=l("OperationServers"),Z=l("OperationExt"),X=l("OperationSummary"),Q=l("Link"),ee=p().showExtensions;if(L&&r&&r.size>0){var te=!L.get(String(r.get("status")))&&!L.get("default");r=r.set("notDocumented",te)}var ne=[E,x];return D.a.createElement("div",{className:_?"opblock opblock-deprecated":w?"opblock opblock-".concat(x," is-open"):"opblock opblock-".concat(x),id:Object($.g)(U.join("-"))},D.a.createElement(X,{operationProps:y,toggleShown:a,getComponent:l,authActions:d,authSelectors:v,specPath:t}),D.a.createElement(J,{isOpened:w},D.a.createElement("div",{className:"opblock-body"},R&&R.size||null===R?null:D.a.createElement("img",{height:"32px",width:"32px",src:n(503),className:"opblock-loading-animation"}),_&&D.a.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),I&&D.a.createElement("div",{className:"opblock-description-wrapper"},D.a.createElement("div",{className:"opblock-description"},D.a.createElement(K,{source:I}))),M?D.a.createElement("div",{className:"opblock-external-docs-wrapper"},D.a.createElement("h4",{className:"opblock-title_normal"},"Find more details"),D.a.createElement("div",{className:"opblock-external-docs"},D.a.createElement("span",{className:"opblock-external-docs__description"},D.a.createElement(K,{source:P.description})),D.a.createElement(Q,{target:"_blank",className:"opblock-external-docs__link",href:Object($.G)(M)},M))):null,R&&R.size?D.a.createElement(V,{parameters:B,specPath:t.push("parameters"),operation:R,onChangeKey:ne,onTryoutClick:i,onCancelClick:s,tryItOutEnabled:j,allowTryItOut:k,fn:c,getComponent:l,specActions:f,specSelectors:h,pathMethod:[E,x],getConfigs:p,oas3Actions:m,oas3Selectors:g}):null,j?D.a.createElement(G,{getComponent:l,path:E,method:x,operationServers:R.get("servers"),pathServers:h.paths().getIn([E,"servers"]),getSelectedServer:g.selectedServer,setSelectedServer:m.setSelectedServer,setServerVariableValue:m.setServerVariableValue,getServerVariable:g.serverVariableValue,getEffectiveServerValue:g.serverEffectiveValue}):null,j&&k&&N&&N.size?D.a.createElement("div",{className:"opblock-schemes"},D.a.createElement(Y,{schemes:N,path:E,method:x,specActions:f,currentScheme:F})):null,D.a.createElement("div",{className:j&&r&&k?"btn-group":"execute-wrapper"},j&&k?D.a.createElement(W,{operation:R,specActions:f,specSelectors:h,oas3Selectors:g,oas3Actions:m,path:E,method:x,onExecute:u}):null,j&&r&&k?D.a.createElement(H,{specActions:f,path:E,method:x}):null),T?D.a.createElement("div",{className:"loading-container"},D.a.createElement("div",{className:"loading"})):null,L?D.a.createElement(z,{responses:L,request:o,tryItOutResponse:r,getComponent:l,getConfigs:p,specSelectors:h,oas3Actions:m,oas3Selectors:g,specActions:f,produces:h.producesOptionsFor([E,x]),producesValue:h.currentProducesFor([E,x]),specPath:t.push("responses"),path:E,method:x,displayRequestDuration:O,fn:c}):null,ee&&q.size?D.a.createElement(Z,{extensions:q,getComponent:l}):null)))}}]),r}(R.PureComponent);C()(lt,"defaultProps",{operation:null,response:null,request:null,specPath:Object(B.List)(),summary:""});var pt=n(93),ft=n.n(pt),ht=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.toggleShown,n=e.getComponent,r=e.authActions,o=e.authSelectors,a=e.operationProps,i=e.specPath,s=a.toJS(),u=s.summary,c=s.isAuthorized,l=s.method,p=s.op,f=s.showSummary,h=s.operationId,d=s.originalOperationId,v=s.displayOperationId,m=p.summary,g=a.get("security"),y=n("authorizeOperationBtn"),b=n("OperationSummaryMethod"),_=n("OperationSummaryPath"),w=n("JumpToPath",!0);return D.a.createElement("div",{className:"opblock-summary opblock-summary-".concat(l),onClick:t},D.a.createElement(b,{method:l}),D.a.createElement(_,{getComponent:n,operationProps:a,specPath:i}),f?D.a.createElement("div",{className:"opblock-summary-description"},ft()(m||u)):null,v&&(d||h)?D.a.createElement("span",{className:"opblock-summary-operation-id"},d||h):null,g&&g.count()?D.a.createElement(y,{isAuthorized:c,onClick:function(){var e=o.definitionsForRequirements(g);r.showDefinitions(e)}}):null,D.a.createElement(w,{path:i}))}}]),n}(R.PureComponent);C()(ht,"defaultProps",{operationProps:null,specPath:Object(B.List)(),summary:""});var dt=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props.method;return D.a.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}]),n}(R.PureComponent);C()(dt,"defaultProps",{operationProps:null});var vt=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onCopyCapture",(function(e){e.clipboardData.setData("text/plain",r.props.operationProps.get("path")),e.preventDefault()})),r}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.operationProps.toJS(),o=r.deprecated,a=r.isShown,i=r.path,s=r.tag,u=r.operationId,c=r.isDeepLinkingEnabled,l=n("DeepLink");return D.a.createElement("span",{className:o?"opblock-summary-path__deprecated":"opblock-summary-path",onCopyCapture:this.onCopyCapture,"data-path":i},D.a.createElement(l,{enabled:c,isShown:a,path:Object($.d)(d()(e="".concat(s,"/")).call(e,u)),text:i.replace(/\//g,"​/")}))}}]),n}(R.PureComponent),mt=n(17),gt=n.n(mt),yt=function(e){var t,n=e.extensions,r=(0,e.getComponent)("OperationExtRow");return D.a.createElement("div",{className:"opblock-section"},D.a.createElement("div",{className:"opblock-section-header"},D.a.createElement("h4",null,"Extensions")),D.a.createElement("div",{className:"table-container"},D.a.createElement("table",null,D.a.createElement("thead",null,D.a.createElement("tr",null,D.a.createElement("td",{className:"col_header"},"Field"),D.a.createElement("td",{className:"col_header"},"Value"))),D.a.createElement("tbody",null,y()(t=n.entrySeq()).call(t,(function(e){var t,n=gt()(e,2),o=n[0],a=n[1];return D.a.createElement(r,{key:d()(t="".concat(o,"-")).call(t,a),xKey:o,xVal:a})}))))))},bt=function(e){var t=e.xKey,n=e.xVal,r=n?n.toJS?n.toJS():n:null;return D.a.createElement("tr",null,D.a.createElement("td",null,t),D.a.createElement("td",null,i()(r)))},_t=n(528),wt=n.n(_t),Et=n(145),xt=n.n(Et),Ct=n(529),St=n.n(Ct);function At(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return e.reduce((function(e,t){return xt()({},e,n[t])}),t)}function kt(e){return e.join(" ")}function Ot(e){var t=e.node,n=e.stylesheet,r=e.style,o=void 0===r?{}:r,a=e.useInlineStyles,i=e.key,s=t.properties,u=t.type,c=t.tagName,l=t.value;if("text"===u)return l;if(c){var p=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,o){return Ot({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(o)})}))}}(n,a),f=a&&s.className&&s.className.filter((function(e){return!n[e]})),h=f&&f.length?f:void 0,d=a?xt()({},s,{className:h&&kt(h)},{style:At(s.className,Object.assign({},s.style,o),n)}):xt()({},s,{className:kt(s.className)}),v=p(t.children);return D.a.createElement(c,St()({key:i},d),v)}}var jt=/\n/g;function Tt(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,o=void 0===r?{float:"left",paddingRight:"10px"}:r,a=e.numberStyle,i=void 0===a?{}:a,s=e.startingLineNumber;return D.a.createElement("code",{style:Object.assign({},n,o)},function(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map((function(e,t){var o=t+n;return D.a.createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof r?r(o):r},"".concat(o,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:i,startingLineNumber:s}))}function It(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Pt(e,t,n){var r,o,a={display:"inline-block",minWidth:(r=n,o=r.toString().length,"".concat(o,"em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},i="function"==typeof e?e(t):e;return xt()({},a,i)}function Nt(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,o=e.largestLineNumber,a=e.showInlineLineNumbers,i=e.lineProps,s=void 0===i?{}:i,u=e.className,c=void 0===u?[]:u,l="function"==typeof s?s(n):s;if(l.className=c,n&&a){var p=Pt(r,n,o);t.unshift(It(n,p))}return{type:"element",tagName:"span",properties:l,children:t}}function Mt(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0;r<e.length;r++){var o=e[r];if("text"===o.type)n.push(Nt({children:[o],className:t}));else if(o.children){var a=t.concat(o.properties.className);n=n.concat(Mt(o.children,a))}}return n}function Rt(e,t,n,r,o,a,i,s){var u,c=Mt(e.value),l=[],p=-1,f=0;function h(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Nt({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:i,showInlineLineNumbers:o,lineProps:n,className:r})}function d(e,t){if(t&&o){var n=Pt(s,t,i);e.unshift(It(t,n))}return e}function v(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?h(e,n,r):d(e,n)}for(var m=function(){var e=c[f],t=e.children[0].value;if(t.match(jt)){var n=t.split("\n");n.forEach((function(t,o){var i=r&&l.length+a,s={type:"text",value:"".concat(t,"\n")};if(0===o){var u=v(c.slice(p+1,f).concat(Nt({children:[s],className:e.properties.className})),i);l.push(u)}else if(o===n.length-1){if(c[f+1]&&c[f+1].children&&c[f+1].children[0]){var h=Nt({children:[{type:"text",value:"".concat(t)}],className:e.properties.className});c.splice(f+1,0,h)}else{var d=v([s],i,e.properties.className);l.push(d)}}else{var m=v([s],i,e.properties.className);l.push(m)}})),p=f}f++};f<c.length;)m();if(p!==c.length-1){var g=c.slice(p+1,c.length);if(g&&g.length){var y=v(g,l.length+a);l.push(y)}}return t?l:(u=[]).concat.apply(u,l)}function Dt(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Ot({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function Lt(e){return e&&void 0!==e.highlightAuto}var Bt,Ft,Ut=n(352),qt=n.n(Ut),zt=(Bt=qt.a,Ft={},function(e){var t=e.language,n=e.children,r=e.style,o=void 0===r?Ft:r,a=e.customStyle,i=void 0===a?{}:a,s=e.codeTagProps,u=void 0===s?{className:t?"language-".concat(t):void 0,style:o['code[class*="language-"]']}:s,c=e.useInlineStyles,l=void 0===c||c,p=e.showLineNumbers,f=void 0!==p&&p,h=e.showInlineLineNumbers,d=void 0!==h&&h,v=e.startingLineNumber,m=void 0===v?1:v,g=e.lineNumberContainerStyle,y=e.lineNumberStyle,b=void 0===y?{}:y,_=e.wrapLines,w=e.lineProps,E=void 0===w?{}:w,x=e.renderer,C=e.PreTag,S=void 0===C?"pre":C,A=e.CodeTag,k=void 0===A?"code":A,O=e.code,j=void 0===O?Array.isArray(n)?n[0]:n:O,T=e.astGenerator,I=wt()(e,["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"]);T=T||Bt;var P=f?D.a.createElement(Tt,{containerStyle:g,codeStyle:u.style||{},numberStyle:b,startingLineNumber:m,codeString:j}):null,N=o.hljs||o['pre[class*="language-"]']||{backgroundColor:"#fff"},M=Lt(T)?"hljs":"prismjs",R=l?Object.assign({},I,{style:Object.assign({},N,i)}):Object.assign({},I,{className:I.className?"".concat(M," ").concat(I.className):M,style:Object.assign({},i)});if(!T)return D.a.createElement(S,R,P,D.a.createElement(k,u,j));_=!(!x||void 0!==_)||_,x=x||Dt;var L=[{type:"text",value:j}],B=function(e){var t=e.astGenerator,n=e.language,r=e.code,o=e.defaultCodeValue;if(Lt(t)){var a=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:o,language:"text"}:a?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:o}}catch(e){return{value:o}}}({astGenerator:T,language:t,code:j,defaultCodeValue:L});null===B.language&&(B.value=L);var F=Rt(B,_,E,f,d,m,B.value.length+m,b);return D.a.createElement(S,R,D.a.createElement(k,u,!d&&P,x({rows:F,stylesheet:o,useInlineStyles:l})))});zt.registerLanguage=qt.a.registerLanguage;var Vt=zt,Wt=n(531),Ht=n.n(Wt).a,Jt=n(530),$t=n.n(Jt).a,Kt=n(532),Yt=n.n(Kt).a,Gt=n(535),Zt=n.n(Gt).a,Xt=n(533),Qt=n.n(Xt).a,en=n(534),tn=n.n(en).a,nn={hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#333",color:"white"},"hljs-name":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-code":{fontStyle:"italic",color:"#888"},"hljs-emphasis":{fontStyle:"italic"},"hljs-tag":{color:"#62c8f3"},"hljs-variable":{color:"#ade5fc"},"hljs-template-variable":{color:"#ade5fc"},"hljs-selector-id":{color:"#ade5fc"},"hljs-selector-class":{color:"#ade5fc"},"hljs-string":{color:"#a2fca2"},"hljs-bullet":{color:"#d36363"},"hljs-type":{color:"#ffa"},"hljs-title":{color:"#ffa"},"hljs-section":{color:"#ffa"},"hljs-attribute":{color:"#ffa"},"hljs-quote":{color:"#ffa"},"hljs-built_in":{color:"#ffa"},"hljs-builtin-name":{color:"#ffa"},"hljs-number":{color:"#d36363"},"hljs-symbol":{color:"#d36363"},"hljs-keyword":{color:"#fcc28c"},"hljs-selector-tag":{color:"#fcc28c"},"hljs-literal":{color:"#fcc28c"},"hljs-comment":{color:"#888"},"hljs-deletion":{color:"#333",backgroundColor:"#fc9b9b"},"hljs-regexp":{color:"#c6b4f0"},"hljs-link":{color:"#c6b4f0"},"hljs-meta":{color:"#fc9b9b"},"hljs-addition":{backgroundColor:"#a2fca2",color:"#333"}};Vt.registerLanguage("json",$t),Vt.registerLanguage("js",Ht),Vt.registerLanguage("xml",Yt),Vt.registerLanguage("yaml",Qt),Vt.registerLanguage("http",tn),Vt.registerLanguage("bash",Zt);var rn={agate:nn,arta:{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#222",color:"#aaa"},"hljs-subst":{color:"#aaa"},"hljs-section":{color:"#fff",fontWeight:"bold"},"hljs-comment":{color:"#444"},"hljs-quote":{color:"#444"},"hljs-meta":{color:"#444"},"hljs-string":{color:"#ffcc33"},"hljs-symbol":{color:"#ffcc33"},"hljs-bullet":{color:"#ffcc33"},"hljs-regexp":{color:"#ffcc33"},"hljs-number":{color:"#00cc66"},"hljs-addition":{color:"#00cc66"},"hljs-built_in":{color:"#32aaee"},"hljs-builtin-name":{color:"#32aaee"},"hljs-literal":{color:"#32aaee"},"hljs-type":{color:"#32aaee"},"hljs-template-variable":{color:"#32aaee"},"hljs-attribute":{color:"#32aaee"},"hljs-link":{color:"#32aaee"},"hljs-keyword":{color:"#6644aa"},"hljs-selector-tag":{color:"#6644aa"},"hljs-name":{color:"#6644aa"},"hljs-selector-id":{color:"#6644aa"},"hljs-selector-class":{color:"#6644aa"},"hljs-title":{color:"#bb1166"},"hljs-variable":{color:"#bb1166"},"hljs-deletion":{color:"#bb1166"},"hljs-template-tag":{color:"#bb1166"},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},monokai:{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#272822",color:"#ddd"},"hljs-tag":{color:"#f92672"},"hljs-keyword":{color:"#f92672",fontWeight:"bold"},"hljs-selector-tag":{color:"#f92672",fontWeight:"bold"},"hljs-literal":{color:"#f92672",fontWeight:"bold"},"hljs-strong":{color:"#f92672"},"hljs-name":{color:"#f92672"},"hljs-code":{color:"#66d9ef"},"hljs-class .hljs-title":{color:"white"},"hljs-attribute":{color:"#bf79db"},"hljs-symbol":{color:"#bf79db"},"hljs-regexp":{color:"#bf79db"},"hljs-link":{color:"#bf79db"},"hljs-string":{color:"#a6e22e"},"hljs-bullet":{color:"#a6e22e"},"hljs-subst":{color:"#a6e22e"},"hljs-title":{color:"#a6e22e",fontWeight:"bold"},"hljs-section":{color:"#a6e22e",fontWeight:"bold"},"hljs-emphasis":{color:"#a6e22e"},"hljs-type":{color:"#a6e22e",fontWeight:"bold"},"hljs-built_in":{color:"#a6e22e"},"hljs-builtin-name":{color:"#a6e22e"},"hljs-selector-attr":{color:"#a6e22e"},"hljs-selector-pseudo":{color:"#a6e22e"},"hljs-addition":{color:"#a6e22e"},"hljs-variable":{color:"#a6e22e"},"hljs-template-tag":{color:"#a6e22e"},"hljs-template-variable":{color:"#a6e22e"},"hljs-comment":{color:"#75715e"},"hljs-quote":{color:"#75715e"},"hljs-deletion":{color:"#75715e"},"hljs-meta":{color:"#75715e"},"hljs-doctag":{fontWeight:"bold"},"hljs-selector-id":{fontWeight:"bold"}},nord:{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#2E3440",color:"#D8DEE9"},"hljs-subst":{color:"#D8DEE9"},"hljs-selector-tag":{color:"#81A1C1"},"hljs-selector-id":{color:"#8FBCBB",fontWeight:"bold"},"hljs-selector-class":{color:"#8FBCBB"},"hljs-selector-attr":{color:"#8FBCBB"},"hljs-selector-pseudo":{color:"#88C0D0"},"hljs-addition":{backgroundColor:"rgba(163, 190, 140, 0.5)"},"hljs-deletion":{backgroundColor:"rgba(191, 97, 106, 0.5)"},"hljs-built_in":{color:"#8FBCBB"},"hljs-type":{color:"#8FBCBB"},"hljs-class":{color:"#8FBCBB"},"hljs-function":{color:"#88C0D0"},"hljs-function > .hljs-title":{color:"#88C0D0"},"hljs-keyword":{color:"#81A1C1"},"hljs-literal":{color:"#81A1C1"},"hljs-symbol":{color:"#81A1C1"},"hljs-number":{color:"#B48EAD"},"hljs-regexp":{color:"#EBCB8B"},"hljs-string":{color:"#A3BE8C"},"hljs-title":{color:"#8FBCBB"},"hljs-params":{color:"#D8DEE9"},"hljs-bullet":{color:"#81A1C1"},"hljs-code":{color:"#8FBCBB"},"hljs-emphasis":{fontStyle:"italic"},"hljs-formula":{color:"#8FBCBB"},"hljs-strong":{fontWeight:"bold"},"hljs-link:hover":{textDecoration:"underline"},"hljs-quote":{color:"#4C566A"},"hljs-comment":{color:"#4C566A"},"hljs-doctag":{color:"#8FBCBB"},"hljs-meta":{color:"#5E81AC"},"hljs-meta-keyword":{color:"#5E81AC"},"hljs-meta-string":{color:"#A3BE8C"},"hljs-attr":{color:"#8FBCBB"},"hljs-attribute":{color:"#D8DEE9"},"hljs-builtin-name":{color:"#81A1C1"},"hljs-name":{color:"#81A1C1"},"hljs-section":{color:"#88C0D0"},"hljs-tag":{color:"#81A1C1"},"hljs-variable":{color:"#D8DEE9"},"hljs-template-variable":{color:"#D8DEE9"},"hljs-template-tag":{color:"#5E81AC"},"abnf .hljs-attribute":{color:"#88C0D0"},"abnf .hljs-symbol":{color:"#EBCB8B"},"apache .hljs-attribute":{color:"#88C0D0"},"apache .hljs-section":{color:"#81A1C1"},"arduino .hljs-built_in":{color:"#88C0D0"},"aspectj .hljs-meta":{color:"#D08770"},"aspectj > .hljs-title":{color:"#88C0D0"},"bnf .hljs-attribute":{color:"#8FBCBB"},"clojure .hljs-name":{color:"#88C0D0"},"clojure .hljs-symbol":{color:"#EBCB8B"},"coq .hljs-built_in":{color:"#88C0D0"},"cpp .hljs-meta-string":{color:"#8FBCBB"},"css .hljs-built_in":{color:"#88C0D0"},"css .hljs-keyword":{color:"#D08770"},"diff .hljs-meta":{color:"#8FBCBB"},"ebnf .hljs-attribute":{color:"#8FBCBB"},"glsl .hljs-built_in":{color:"#88C0D0"},"groovy .hljs-meta:not(:first-child)":{color:"#D08770"},"haxe .hljs-meta":{color:"#D08770"},"java .hljs-meta":{color:"#D08770"},"ldif .hljs-attribute":{color:"#8FBCBB"},"lisp .hljs-name":{color:"#88C0D0"},"lua .hljs-built_in":{color:"#88C0D0"},"moonscript .hljs-built_in":{color:"#88C0D0"},"nginx .hljs-attribute":{color:"#88C0D0"},"nginx .hljs-section":{color:"#5E81AC"},"pf .hljs-built_in":{color:"#88C0D0"},"processing .hljs-built_in":{color:"#88C0D0"},"scss .hljs-keyword":{color:"#81A1C1"},"stylus .hljs-keyword":{color:"#81A1C1"},"swift .hljs-meta":{color:"#D08770"},"vim .hljs-built_in":{color:"#88C0D0",fontStyle:"italic"},"yaml .hljs-meta":{color:"#D08770"}},obsidian:{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"#282b2e",color:"#e0e2e4"},"hljs-keyword":{color:"#93c763",fontWeight:"bold"},"hljs-selector-tag":{color:"#93c763",fontWeight:"bold"},"hljs-literal":{color:"#93c763",fontWeight:"bold"},"hljs-selector-id":{color:"#93c763"},"hljs-number":{color:"#ffcd22"},"hljs-attribute":{color:"#668bb0"},"hljs-code":{color:"white"},"hljs-class .hljs-title":{color:"white"},"hljs-section":{color:"white",fontWeight:"bold"},"hljs-regexp":{color:"#d39745"},"hljs-link":{color:"#d39745"},"hljs-meta":{color:"#557182"},"hljs-tag":{color:"#8cbbad"},"hljs-name":{color:"#8cbbad",fontWeight:"bold"},"hljs-bullet":{color:"#8cbbad"},"hljs-subst":{color:"#8cbbad"},"hljs-emphasis":{color:"#8cbbad"},"hljs-type":{color:"#8cbbad",fontWeight:"bold"},"hljs-built_in":{color:"#8cbbad"},"hljs-selector-attr":{color:"#8cbbad"},"hljs-selector-pseudo":{color:"#8cbbad"},"hljs-addition":{color:"#8cbbad"},"hljs-variable":{color:"#8cbbad"},"hljs-template-tag":{color:"#8cbbad"},"hljs-template-variable":{color:"#8cbbad"},"hljs-string":{color:"#ec7600"},"hljs-symbol":{color:"#ec7600"},"hljs-comment":{color:"#818e96"},"hljs-quote":{color:"#818e96"},"hljs-deletion":{color:"#818e96"},"hljs-selector-class":{color:"#A082BD"},"hljs-doctag":{fontWeight:"bold"},"hljs-title":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"}},"tomorrow-night":{"hljs-comment":{color:"#969896"},"hljs-quote":{color:"#969896"},"hljs-variable":{color:"#cc6666"},"hljs-template-variable":{color:"#cc6666"},"hljs-tag":{color:"#cc6666"},"hljs-name":{color:"#cc6666"},"hljs-selector-id":{color:"#cc6666"},"hljs-selector-class":{color:"#cc6666"},"hljs-regexp":{color:"#cc6666"},"hljs-deletion":{color:"#cc6666"},"hljs-number":{color:"#de935f"},"hljs-built_in":{color:"#de935f"},"hljs-builtin-name":{color:"#de935f"},"hljs-literal":{color:"#de935f"},"hljs-type":{color:"#de935f"},"hljs-params":{color:"#de935f"},"hljs-meta":{color:"#de935f"},"hljs-link":{color:"#de935f"},"hljs-attribute":{color:"#f0c674"},"hljs-string":{color:"#b5bd68"},"hljs-symbol":{color:"#b5bd68"},"hljs-bullet":{color:"#b5bd68"},"hljs-addition":{color:"#b5bd68"},"hljs-title":{color:"#81a2be"},"hljs-section":{color:"#81a2be"},"hljs-keyword":{color:"#b294bb"},"hljs-selector-tag":{color:"#b294bb"},hljs:{display:"block",overflowX:"auto",background:"#1d1f21",color:"#c5c8c6",padding:"0.5em"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}}},on=u()(rn),an=function(e){return We()(on).call(on,e)?rn[e]:(console.warn("Request style '".concat(e,"' is not available, returning default instead")),nn)},sn=n(46),un=n.n(sn),cn=n(536),ln=n.n(cn),pn=n(217),fn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"downloadText",(function(){ln()(r.props.value,r.props.fileName||"response.txt")})),C()(ye()(r),"preventYScrollingBeyondElement",(function(e){var t=e.target,n=e.nativeEvent.deltaY,r=t.scrollHeight,o=t.offsetHeight,a=t.scrollTop;r>o&&(0===a&&n<0||o+a>=r&&n>0)&&e.preventDefault()})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,r=e.downloadable,o=e.getConfigs,a=e.canCopy,i=o?o():{syntaxHighlight:{activated:!0,theme:"agate"}};n=n||"";var s=un()(i,"syntaxHighlight.activated")?D.a.createElement(Vt,{className:n+" microlight",onWheel:this.preventYScrollingBeyondElement,style:an(un()(i,"syntaxHighlight.theme"))},t):D.a.createElement("pre",{onWheel:this.preventYScrollingBeyondElement,className:n+" microlight"},t);return D.a.createElement("div",{className:"highlight-code"},r?D.a.createElement("div",{className:"download-contents",onClick:this.downloadText},"Download"):null,a?D.a.createElement("div",{className:"copy-to-clipboard"},D.a.createElement(pn.CopyToClipboard,{text:t},D.a.createElement("button",null))):null,s)}}]),n}(R.Component),hn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onChangeProducesWrapper",(function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)})),C()(ye()(r),"onResponseContentTypeChange",(function(e){var t=e.controlsAcceptHeader,n=e.value,o=r.props,a=o.oas3Actions,i=o.path,s=o.method;t&&a.setResponseContentType({value:n,path:i,method:s})})),r}return M()(n,[{key:"render",value:function(){var e,t=this,r=this.props,o=r.responses,a=r.tryItOutResponse,i=r.getComponent,s=r.getConfigs,u=r.specSelectors,c=r.fn,l=r.producesValue,p=r.displayRequestDuration,f=r.specPath,h=r.path,d=r.method,v=r.oas3Selectors,m=r.oas3Actions,g=Object($.f)(o),b=i("contentType"),_=i("liveResponse"),w=i("response"),E=this.props.produces&&this.props.produces.size?this.props.produces:n.defaultProps.produces,x=u.isOAS3()?Object($.k)(o):null;return D.a.createElement("div",{className:"responses-wrapper"},D.a.createElement("div",{className:"opblock-section-header"},D.a.createElement("h4",null,"Responses"),u.isOAS3()?null:D.a.createElement("label",null,D.a.createElement("span",null,"Response content type"),D.a.createElement(b,{value:l,onChange:this.onChangeProducesWrapper,contentTypes:E,className:"execute-content-type"}))),D.a.createElement("div",{className:"responses-inner"},a?D.a.createElement("div",null,D.a.createElement(_,{response:a,getComponent:i,getConfigs:s,specSelectors:u,path:this.props.path,method:this.props.method,displayRequestDuration:p}),D.a.createElement("h4",null,"Responses")):null,D.a.createElement("table",{className:"responses-table"},D.a.createElement("thead",null,D.a.createElement("tr",{className:"responses-header"},D.a.createElement("td",{className:"col_header response-col_status"},"Code"),D.a.createElement("td",{className:"col_header response-col_description"},"Description"),u.isOAS3()?D.a.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),D.a.createElement("tbody",null,y()(e=o.entrySeq()).call(e,(function(e){var n=gt()(e,2),r=n[0],o=n[1],p=a&&a.get("status")==r?"response_current":"";return D.a.createElement(w,{key:r,path:h,method:d,specPath:f.push(r),isDefault:g===r,fn:c,className:p,code:r,response:o,specSelectors:u,controlsAcceptHeader:o===x,onContentTypeChange:t.onResponseContentTypeChange,contentType:l,getConfigs:s,activeExamplesKey:v.activeExamplesMember(h,d,"responses",r),oas3Actions:m,getComponent:i})})).toArray()))))}}]),n}(D.a.Component);C()(hn,"defaultProps",{tryItOutResponse:null,produces:Object(B.fromJS)(["application/json"]),displayRequestDuration:!1});var dn=n(67),vn=n.n(dn),mn=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"_onContentTypeChange",(function(e){var t=o.props,n=t.onContentTypeChange,r=t.controlsAcceptHeader;o.setState({responseContentType:e}),n({value:e,controlsAcceptHeader:r})})),C()(ye()(o),"getTargetExamplesKey",(function(){var e=o.props,t=e.response,n=e.contentType,r=e.activeExamplesKey,a=o.state.responseContentType||n,i=t.getIn(["content",a],Object(B.Map)({})).get("examples",null).keySeq().first();return r||i})),o.state={responseContentType:""},o}return M()(n,[{key:"render",value:function(){var e,t,n,r,o=this.props,a=o.path,i=o.method,s=o.code,u=o.response,c=o.className,l=o.specPath,p=o.fn,f=o.getComponent,h=o.getConfigs,d=o.specSelectors,v=o.contentType,m=o.controlsAcceptHeader,g=o.oas3Actions,b=p.inferSchema,_=d.isOAS3(),w=u.get("headers"),E=u.get("links"),x=f("headers"),C=f("highlightCode"),S=f("modelExample"),A=f("Markdown",!0),k=f("operationLink"),O=f("contentType"),j=f("ExamplesSelect"),T=f("Example"),I=this.state.responseContentType||v,P=u.getIn(["content",I],Object(B.Map)({})),N=P.get("examples",null);if(_){var M=P.get("schema");n=M?b(M.toJS()):null,r=M?Object(B.List)(["content",this.state.responseContentType,"schema"]):l}else n=u.get("schema"),r=u.has("schema")?l.push("schema"):l;if(_){var R=P.get("schema",Object(B.Map)({}));if(N){var L=this.getTargetExamplesKey(),F=N.get(L,Object(B.Map)({}));t=Object($.J)(F.get("value"))}else t=void 0!==P.get("example")?Object($.J)(P.get("example")):Object($.o)(R.toJS(),this.state.responseContentType,{includeReadOnly:!0})}else t=u.getIn(["examples",I])?u.getIn(["examples",I]):n?Object($.o)(n.toJS(),I,{includeReadOnly:!0,includeWriteOnly:!0}):null;var U=function(e,t,n){return null!=e?D.a.createElement("div",null,D.a.createElement(t,{className:"example",getConfigs:n,value:Object($.J)(e)})):null}(t,C,h);return D.a.createElement("tr",{className:"response "+(c||""),"data-code":s},D.a.createElement("td",{className:"response-col_status"},s),D.a.createElement("td",{className:"response-col_description"},D.a.createElement("div",{className:"response-col_description__inner"},D.a.createElement(A,{source:u.get("description")})),_&&u.get("content")?D.a.createElement("section",{className:"response-controls"},D.a.createElement("div",{className:vn()("response-control-media-type",{"response-control-media-type--accept-controller":m})},D.a.createElement("small",{className:"response-control-media-type__title"},"Media type"),D.a.createElement(O,{value:this.state.responseContentType,contentTypes:u.get("content")?u.get("content").keySeq():Object(B.Seq)(),onChange:this._onContentTypeChange}),m?D.a.createElement("small",{className:"response-control-media-type__accept-message"},"Controls ",D.a.createElement("code",null,"Accept")," header."):null),N?D.a.createElement("div",{className:"response-control-examples"},D.a.createElement("small",{className:"response-control-examples__title"},"Examples"),D.a.createElement(j,{examples:N,currentExampleKey:this.getTargetExamplesKey(),onSelect:function(e){return g.setActiveExamplesMember({name:e,pathMethod:[a,i],contextType:"responses",contextName:s})},showLabels:!1})):null):null,U||n?D.a.createElement(S,{specPath:r,getComponent:f,getConfigs:h,specSelectors:d,schema:Object($.i)(n),example:U,includeReadOnly:!0}):null,_&&N?D.a.createElement(T,{example:N.get(this.getTargetExamplesKey(),Object(B.Map)({})),getComponent:f,getConfigs:h,omitValue:!0}):null,w?D.a.createElement(x,{headers:w,getComponent:f}):null),_?D.a.createElement("td",{className:"response-col_links"},E?y()(e=E.toSeq()).call(e,(function(e,t){return D.a.createElement(k,{key:t,name:t,link:e,getComponent:f})})):D.a.createElement("i",null,"No links")):null)}}]),n}(D.a.Component);C()(mn,"defaultProps",{response:Object(B.fromJS)({}),onContentTypeChange:function(){}});var gn=n(537),yn=n.n(gn),bn=n(538),_n=n.n(bn),wn=n(539),En=n.n(wn),xn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"state",{parsedContent:null}),C()(ye()(r),"updateParsedContent",(function(e){var t=r.props.content;if(e!==t)if(t&&t instanceof Blob){var n=new FileReader;n.onload=function(){r.setState({parsedContent:n.result})},n.readAsText(t)}else r.setState({parsedContent:t.toString()})})),r}return M()(n,[{key:"componentDidMount",value:function(){this.updateParsedContent(null)}},{key:"componentDidUpdate",value:function(e){this.updateParsedContent(e.content)}},{key:"render",value:function(){var e,t,n=this.props,r=n.content,o=n.contentType,a=n.url,s=n.headers,u=void 0===s?{}:s,c=n.getConfigs,l=n.getComponent,p=this.state.parsedContent,f=l("highlightCode"),h="response_"+(new Date).getTime();if(a=a||"",/^application\/octet-stream/i.test(o)||u["Content-Disposition"]&&/attachment/i.test(u["Content-Disposition"])||u["content-disposition"]&&/attachment/i.test(u["content-disposition"])||u["Content-Description"]&&/File Transfer/i.test(u["Content-Description"])||u["content-description"]&&/File Transfer/i.test(u["content-description"]))if("Blob"in window){var d=o||"text/html",v=r instanceof Blob?r:new Blob([r],{type:d}),m=window.URL.createObjectURL(v),g=[d,a.substr(yn()(a).call(a,"/")+1),m].join(":"),y=u["content-disposition"]||u["Content-Disposition"];if(void 0!==y){var b=Object($.h)(y);null!==b&&(g=b)}t=J.a.navigator&&J.a.navigator.msSaveOrOpenBlob?D.a.createElement("div",null,D.a.createElement("a",{href:m,onClick:function(){return J.a.navigator.msSaveOrOpenBlob(v,g)}},"Download file")):D.a.createElement("div",null,D.a.createElement("a",{href:m,download:g},"Download file"))}else t=D.a.createElement("pre",{className:"microlight"},"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(o)){try{e=i()(JSON.parse(r),null,"  ")}catch(t){e="can't parse JSON.  Raw result:\n\n"+r}t=D.a.createElement(f,{downloadable:!0,fileName:"".concat(h,".json"),value:e,getConfigs:c,canCopy:!0})}else/xml/i.test(o)?(e=_n()(r,{textNodesOnSameLine:!0,indentor:"  "}),t=D.a.createElement(f,{downloadable:!0,fileName:"".concat(h,".xml"),value:e,getConfigs:c,canCopy:!0})):t="text/html"===En()(o)||/text\/plain/.test(o)?D.a.createElement(f,{downloadable:!0,fileName:"".concat(h,".html"),value:r,getConfigs:c,canCopy:!0}):/^image\//i.test(o)?We()(o).call(o,"svg")?D.a.createElement("div",null," ",r," "):D.a.createElement("img",{className:"full-width",src:window.URL.createObjectURL(r)}):/^audio\//i.test(o)?D.a.createElement("pre",{className:"microlight"},D.a.createElement("audio",{controls:!0},D.a.createElement("source",{src:a,type:o}))):"string"==typeof r?D.a.createElement(f,{downloadable:!0,fileName:"".concat(h,".txt"),value:r,getConfigs:c,canCopy:!0}):r.size>0?p?D.a.createElement("div",null,D.a.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),D.a.createElement(f,{downloadable:!0,fileName:"".concat(h,".txt"),value:p,getConfigs:c,canCopy:!0})):D.a.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return t?D.a.createElement("div",null,D.a.createElement("h5",null,"Response body"),t):null}}]),n}(D.a.PureComponent),Cn=n(18),Sn=n.n(Cn),An=function(e){_e()(n,e);var t=Ee()(n);function n(e){var r;return P()(this,n),r=t.call(this,e),C()(ye()(r),"onChange",(function(e,t,n){var o=r.props;(0,o.specActions.changeParamByIdentity)(o.onChangeKey,e,t,n)})),C()(ye()(r),"onChangeConsumesWrapper",(function(e){var t=r.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)})),C()(ye()(r),"toggleTab",(function(e){return"parameters"===e?r.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?r.setState({callbackVisible:!0,parametersVisible:!1}):void 0})),r.state={callbackVisible:!1,parametersVisible:!0},r}return M()(n,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.onTryoutClick,o=n.onCancelClick,a=n.parameters,i=n.allowTryItOut,s=n.tryItOutEnabled,u=n.specPath,c=n.fn,l=n.getComponent,p=n.getConfigs,h=n.specSelectors,v=n.specActions,m=n.pathMethod,g=n.oas3Actions,b=n.oas3Selectors,_=n.operation,w=l("parameterRow"),E=l("TryItOutButton"),x=l("contentType"),C=l("Callbacks",!0),S=l("RequestBody",!0),k=s&&i,O=h.isOAS3(),j=_.get("requestBody");return D.a.createElement("div",{className:"opblock-section"},D.a.createElement("div",{className:"opblock-section-header"},O?D.a.createElement("div",{className:"tab-header"},D.a.createElement("div",{onClick:function(){return t.toggleTab("parameters")},className:"tab-item ".concat(this.state.parametersVisible&&"active")},D.a.createElement("h4",{className:"opblock-title"},D.a.createElement("span",null,"Parameters"))),_.get("callbacks")?D.a.createElement("div",{onClick:function(){return t.toggleTab("callbacks")},className:"tab-item ".concat(this.state.callbackVisible&&"active")},D.a.createElement("h4",{className:"opblock-title"},D.a.createElement("span",null,"Callbacks"))):null):D.a.createElement("div",{className:"tab-header"},D.a.createElement("h4",{className:"opblock-title"},"Parameters")),i?D.a.createElement(E,{enabled:s,onCancelClick:o,onTryoutClick:r}):null),this.state.parametersVisible?D.a.createElement("div",{className:"parameters-container"},a.count()?D.a.createElement("div",{className:"table-container"},D.a.createElement("table",{className:"parameters"},D.a.createElement("thead",null,D.a.createElement("tr",null,D.a.createElement("th",{className:"col_header parameters-col_name"},"Name"),D.a.createElement("th",{className:"col_header parameters-col_description"},"Description"))),D.a.createElement("tbody",null,function(e,t){var n,r;return y()(n=f()(r=e.valueSeq()).call(r,F.a.Map.isMap)).call(n,t)}(a,(function(e,n){var r;return D.a.createElement(w,{fn:c,specPath:u.push(n.toString()),getComponent:l,getConfigs:p,rawParam:e,param:h.parameterWithMetaByIdentity(m,e),key:d()(r="".concat(e.get("in"),".")).call(r,e.get("name")),onChange:t.onChange,onChangeConsumes:t.onChangeConsumesWrapper,specSelectors:h,specActions:v,oas3Actions:g,oas3Selectors:b,pathMethod:m,isExecute:k})})).toArray()))):D.a.createElement("div",{className:"opblock-description-wrapper"},D.a.createElement("p",null,"No parameters"))):null,this.state.callbackVisible?D.a.createElement("div",{className:"callbacks-container opblock-description-wrapper"},D.a.createElement(C,{callbacks:Object(B.Map)(_.get("callbacks")),specPath:A()(u).call(u,0,-1).push("callbacks")})):null,O&&j&&this.state.parametersVisible&&D.a.createElement("div",{className:"opblock-section opblock-section-request-body"},D.a.createElement("div",{className:"opblock-section-header"},D.a.createElement("h4",{className:"opblock-title parameter__name ".concat(j.get("required")&&"required")},"Request body"),D.a.createElement("label",null,D.a.createElement(x,{value:b.requestContentType.apply(b,Sn()(m)),contentTypes:j.get("content",Object(B.List)()).keySeq(),onChange:function(e){g.setRequestContentType({value:e,pathMethod:m}),g.initRequestBodyValidateError({pathMethod:m})},className:"body-param-content-type"}))),D.a.createElement("div",{className:"opblock-description-wrapper"},D.a.createElement(S,{specPath:A()(u).call(u,0,-1).push("requestBody"),requestBody:j,requestBodyValue:b.requestBodyValue.apply(b,Sn()(m)),requestBodyInclusionSetting:b.requestBodyInclusionSetting.apply(b,Sn()(m)),requestBodyErrors:b.requestBodyErrors.apply(b,Sn()(m)),isExecute:k,getConfigs:p,activeExamplesKey:b.activeExamplesMember.apply(b,d()(e=Sn()(m)).call(e,["requestBody","requestBody"])),updateActiveExamplesKey:function(e){t.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:t.props.pathMethod,contextType:"requestBody",contextName:"requestBody"})},onChange:function(e,t){if(t){var n=b.requestBodyValue.apply(b,Sn()(m)),r=B.Map.isMap(n)?n:Object(B.Map)();return g.setRequestBodyValue({pathMethod:m,value:r.setIn(t,e)})}g.setRequestBodyValue({value:e,pathMethod:m})},onChangeIncludeEmpty:function(e,t){g.setRequestBodyInclusion({pathMethod:m,value:t,name:e})},contentType:b.requestContentType.apply(b,Sn()(m))}))))}}]),n}(R.Component);C()(An,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]});var kn=function(e){var t=e.xKey,n=e.xVal;return D.a.createElement("div",{className:"parameter__extension"},t,": ",String(n))},On={onChange:function(){},isIncludedOptions:{}},jn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onCheckboxChange",(function(e){(0,r.props.onChange)(e.target.checked)})),r}return M()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isIncludedOptions,n=e.onChange,r=t.shouldDispatchInit,o=t.defaultValue;r&&n(o)}},{key:"render",value:function(){var e=this.props,t=e.isIncluded,n=e.isDisabled;return D.a.createElement("div",null,D.a.createElement("label",{className:vn()("parameter__empty_value_toggle",{disabled:n})},D.a.createElement("input",{type:"checkbox",disabled:n,checked:!n&&t,onChange:this.onCheckboxChange}),"Send empty value"))}}]),n}(R.Component);C()(jn,"defaultProps",On);var Tn=n(144),In=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onChangeWrapper",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=o.props,r=n.onChange,a=n.rawParam;return r(a,""===e||e&&0===e.size?null:e,t)})),C()(ye()(o),"_onExampleSelect",(function(e){o.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:o.props.pathMethod,contextType:"parameters",contextName:o.getParamKey()})})),C()(ye()(o),"onChangeIncludeEmpty",(function(e){var t=o.props,n=t.specActions,r=t.param,a=t.pathMethod,i=r.get("name"),s=r.get("in");return n.updateEmptyParamInclusion(a,i,s,e)})),C()(ye()(o),"setDefaultValue",(function(){var e=o.props,t=e.specSelectors,n=e.pathMethod,r=e.rawParam,a=e.oas3Selectors,i=t.parameterWithMetaByIdentity(n,r)||Object(B.Map)(),s=Object(Tn.a)(i,{isOAS3:t.isOAS3()}).schema,u=i.get("content",Object(B.Map)()).keySeq().first(),c=s?Object($.o)(s.toJS(),u,{includeWriteOnly:!0}):null;if(i&&void 0===i.get("value")&&"body"!==i.get("in")){var l;if(t.isSwagger2())l=void 0!==i.get("x-example")?i.get("x-example"):void 0!==i.getIn(["schema","example"])?i.getIn(["schema","example"]):s&&s.getIn(["default"]);else if(t.isOAS3()){var p,f=a.activeExamplesMember.apply(a,d()(p=Sn()(n)).call(p,["parameters",o.getParamKey()]));l=void 0!==i.getIn(["examples",f,"value"])?i.getIn(["examples",f,"value"]):void 0!==i.getIn(["content",u,"example"])?i.getIn(["content",u,"example"]):void 0!==i.get("example")?i.get("example"):void 0!==(s&&s.get("example"))?s&&s.get("example"):void 0!==(s&&s.get("default"))?s&&s.get("default"):i.get("default")}void 0===l||B.List.isList(l)||(l=Object($.J)(l)),void 0!==l?o.onChangeWrapper(l):s&&"object"===s.get("type")&&c&&!i.get("examples")&&o.onChangeWrapper(B.List.isList(c)?c:Object($.J)(c))}})),o.setDefaultValue(),o}return M()(n,[{key:"componentWillReceiveProps",value:function(e){var t,n=e.specSelectors,r=e.pathMethod,o=e.rawParam,a=n.isOAS3(),i=n.parameterWithMetaByIdentity(r,o)||new B.Map;if(i=i.isEmpty()?o:i,a){var s=Object(Tn.a)(i,{isOAS3:a}).schema;t=s?s.get("enum"):void 0}else t=i?i.get("enum"):void 0;var u,c=i?i.get("value"):void 0;void 0!==c?u=c:o.get("required")&&t&&t.size&&(u=t.first()),void 0!==u&&u!==c&&this.onChangeWrapper(Object($.x)(u)),this.setDefaultValue()}},{key:"getParamKey",value:function(){var e,t=this.props.param;return t?d()(e="".concat(t.get("name"),"-")).call(e,t.get("in")):null}},{key:"render",value:function(){var e,t,n,r,o=this.props,a=o.param,i=o.rawParam,s=o.getComponent,u=o.getConfigs,c=o.isExecute,l=o.fn,p=o.onChangeConsumes,f=o.specSelectors,h=o.pathMethod,v=o.specPath,m=o.oas3Selectors,g=f.isOAS3(),b=u(),_=b.showExtensions,w=b.showCommonExtensions;if(a||(a=i),!i)return null;var E,x,C,S,A=s("JsonSchemaForm"),k=s("ParamBody"),O=a.get("in"),j="body"!==O?null:D.a.createElement(k,{getComponent:s,getConfigs:u,fn:l,param:a,consumes:f.consumesOptionsFor(h),consumesValue:f.contentTypeValues(h).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:p,isExecute:c,specSelectors:f,pathMethod:h}),T=s("modelExample"),I=s("Markdown",!0),P=s("ParameterExt"),N=s("ParameterIncludeEmpty"),M=s("ExamplesSelectValueRetainer"),R=s("Example"),L=Object(Tn.a)(a,{isOAS3:g}).schema,F=f.parameterWithMetaByIdentity(h,i)||Object(B.Map)(),U=L?L.get("format"):null,q=L?L.get("type"):null,z=L?L.getIn(["items","type"]):null,V="formData"===O,W="FormData"in J.a,H=a.get("required"),K=F?F.get("value"):"",Y=w?Object($.l)(L):null,G=_?Object($.m)(a):null,Z=!1;return void 0!==a&&L&&(E=L.get("items")),void 0!==E?(x=E.get("enum"),C=E.get("default")):L&&(x=L.get("enum")),x&&x.size&&x.size>0&&(Z=!0),void 0!==a&&(L&&(C=L.get("default")),void 0===C&&(C=a.get("default")),void 0===(S=a.get("example"))&&(S=a.get("x-example"))),D.a.createElement("tr",{"data-param-name":a.get("name"),"data-param-in":a.get("in")},D.a.createElement("td",{className:"parameters-col_name"},D.a.createElement("div",{className:H?"parameter__name required":"parameter__name"},a.get("name"),H?D.a.createElement("span",null," *"):null),D.a.createElement("div",{className:"parameter__type"},q,z&&"[".concat(z,"]"),U&&D.a.createElement("span",{className:"prop-format"},"($",U,")")),D.a.createElement("div",{className:"parameter__deprecated"},g&&a.get("deprecated")?"deprecated":null),D.a.createElement("div",{className:"parameter__in"},"(",a.get("in"),")"),w&&Y.size?y()(e=Y.entrySeq()).call(e,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement(P,{key:d()(t="".concat(r,"-")).call(t,o),xKey:r,xVal:o})})):null,_&&G.size?y()(G).call(G,(function(e,t){var n;return D.a.createElement(P,{key:d()(n="".concat(t,"-")).call(n,e),xKey:t,xVal:e})})):null),D.a.createElement("td",{className:"parameters-col_description"},a.get("description")?D.a.createElement(I,{source:a.get("description")}):null,!j&&c||!Z?null:D.a.createElement(I,{className:"parameter__enum",source:"<i>Available values</i> : "+y()(x).call(x,(function(e){return e})).toArray().join(", ")}),!j&&c||void 0===C?null:D.a.createElement(I,{className:"parameter__default",source:"<i>Default value</i> : "+C}),!j&&c||void 0===S?null:D.a.createElement(I,{source:"<i>Example</i> : "+S}),V&&!W&&D.a.createElement("div",null,"Error: your browser does not support FormData"),g&&a.get("examples")?D.a.createElement("section",{className:"parameter-controls"},D.a.createElement(M,{examples:a.get("examples"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:s,defaultToFirstExample:!0,currentKey:m.activeExamplesMember.apply(m,d()(t=Sn()(h)).call(t,["parameters",this.getParamKey()])),currentUserInputValue:K})):null,j?null:D.a.createElement(A,{fn:l,getComponent:s,value:K,required:H,disabled:!c,description:a.get("description")?d()(n="".concat(a.get("name")," - ")).call(n,a.get("description")):"".concat(a.get("name")),onChange:this.onChangeWrapper,errors:F.get("errors"),schema:L}),j&&L?D.a.createElement(T,{getComponent:s,specPath:v.push("schema"),getConfigs:u,isExecute:c,specSelectors:f,schema:L,example:j,includeWriteOnly:!0}):null,!j&&c&&a.get("allowEmptyValue")?D.a.createElement(N,{onChange:this.onChangeIncludeEmpty,isIncluded:f.parameterInclusionSettingFor(h,a.get("name"),a.get("in")),isDisabled:!Object($.q)(K)}):null,g&&a.get("examples")?D.a.createElement(R,{example:a.getIn(["examples",m.activeExamplesMember.apply(m,d()(r=Sn()(h)).call(r,["parameters",this.getParamKey()]))]),getComponent:s,getConfigs:u}):null))}}]),n}(R.Component),Pn=n(215),Nn=n.n(Pn),Mn=n(16),Rn=n.n(Mn),Dn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"handleValidateParameters",(function(){var e=r.props,t=e.specSelectors,n=e.specActions,o=e.path,a=e.method;return n.validateParams([o,a]),t.validateBeforeExecute([o,a])})),C()(ye()(r),"handleValidateRequestBody",(function(){var e=r.props,t=e.path,n=e.method,o=e.specSelectors,a=e.oas3Selectors,i=e.oas3Actions,s={missingBodyValue:!1,missingRequiredKeys:[]};i.clearRequestBodyValidateError({path:t,method:n});var u=o.getOAS3RequiredRequestBodyContentType([t,n]),c=a.requestBodyValue(t,n);if(!a.validateBeforeExecute([t,n]))return s.missingBodyValue=!0,i.setRequestBodyValidateError({path:t,method:n,validationErrors:s}),!1;if(!u)return!0;var l=a.validateShallowRequired({oas3RequiredRequestBodyContentType:u,oas3RequestBodyValue:c});return!l||l.length<1||(Rn()(l).call(l,(function(e){s.missingRequiredKeys.push(e)})),i.setRequestBodyValidateError({path:t,method:n,validationErrors:s}),!1)})),C()(ye()(r),"handleValidationResultPass",(function(){var e=r.props,t=e.specActions,n=e.operation,o=e.path,a=e.method;r.props.onExecute&&r.props.onExecute(),t.execute({operation:n,path:o,method:a})})),C()(ye()(r),"handleValidationResultFail",(function(){var e=r.props,t=e.specActions,n=e.path,o=e.method;t.clearValidateParams([n,o]),Nn()((function(){t.validateParams([n,o])}),40)})),C()(ye()(r),"handleValidationResult",(function(e){e?r.handleValidationResultPass():r.handleValidationResultFail()})),C()(ye()(r),"onClick",(function(){var e=r.handleValidateParameters(),t=r.handleValidateRequestBody(),n=e&&t;r.handleValidationResult(n)})),C()(ye()(r),"onChangeProducesWrapper",(function(e){return r.props.specActions.changeProducesValue([r.props.path,r.props.method],e)})),r}return M()(n,[{key:"render",value:function(){return D.a.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick},"Execute")}}]),n}(R.Component),Ln=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.headers,r=t.getComponent,o=r("Property"),a=r("Markdown",!0);return n&&n.size?D.a.createElement("div",{className:"headers-wrapper"},D.a.createElement("h4",{className:"headers__title"},"Headers:"),D.a.createElement("table",{className:"headers"},D.a.createElement("thead",null,D.a.createElement("tr",{className:"header-row"},D.a.createElement("th",{className:"header-col"},"Name"),D.a.createElement("th",{className:"header-col"},"Description"),D.a.createElement("th",{className:"header-col"},"Type"))),D.a.createElement("tbody",null,y()(e=n.entrySeq()).call(e,(function(e){var t=gt()(e,2),n=t[0],r=t[1];if(!F.a.Map.isMap(r))return null;var i=r.get("description"),s=r.getIn(["schema"])?r.getIn(["schema","type"]):r.getIn(["type"]),u=r.getIn(["schema","example"]);return D.a.createElement("tr",{key:n},D.a.createElement("td",{className:"header-col"},n),D.a.createElement("td",{className:"header-col"},i?D.a.createElement(a,{source:i}):null),D.a.createElement("td",{className:"header-col"},s," ",u?D.a.createElement(o,{propKey:"Example",propVal:u,propClass:"header-example"}):null))})).toArray()))):null}}]),n}(D.a.Component),Bn=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.editorActions,n=e.errSelectors,r=e.layoutSelectors,o=e.layoutActions,a=(0,e.getComponent)("Collapse");if(t&&t.jumpToLine)var i=t.jumpToLine;var s=n.allErrors(),u=f()(s).call(s,(function(e){return"thrown"===e.get("type")||"error"===e.get("level")}));if(!u||u.count()<1)return null;var c=r.isShown(["errorPane"],!0),l=u.sortBy((function(e){return e.get("line")}));return D.a.createElement("pre",{className:"errors-wrapper"},D.a.createElement("hgroup",{className:"error"},D.a.createElement("h4",{className:"errors__title"},"Errors"),D.a.createElement("button",{className:"btn errors__clear-btn",onClick:function(){return o.show(["errorPane"],!c)}},c?"Hide":"Show")),D.a.createElement(a,{isOpened:c,animated:!0},D.a.createElement("div",{className:"errors"},y()(l).call(l,(function(e,t){var n=e.get("type");return"thrown"===n||"auth"===n?D.a.createElement(Fn,{key:t,error:e.get("error")||e,jumpToLine:i}):"spec"===n?D.a.createElement(Un,{key:t,error:e,jumpToLine:i}):void 0})))))}}]),n}(D.a.Component),Fn=function(e){var t=e.error,n=e.jumpToLine;if(!t)return null;var r=t.get("line");return D.a.createElement("div",{className:"error-wrapper"},t?D.a.createElement("div",null,D.a.createElement("h4",null,t.get("source")&&t.get("level")?qn(t.get("source"))+" "+t.get("level"):"",t.get("path")?D.a.createElement("small",null," at ",t.get("path")):null),D.a.createElement("span",{className:"message thrown"},t.get("message")),D.a.createElement("div",{className:"error-line"},r&&n?D.a.createElement("a",{onClick:T()(n).call(n,null,r)},"Jump to line ",r):null)):null)},Un=function(e){var t=e.error,n=e.jumpToLine,r=null;return t.get("path")?r=B.List.isList(t.get("path"))?D.a.createElement("small",null,"at ",t.get("path").join(".")):D.a.createElement("small",null,"at ",t.get("path")):t.get("line")&&!n&&(r=D.a.createElement("small",null,"on line ",t.get("line"))),D.a.createElement("div",{className:"error-wrapper"},t?D.a.createElement("div",null,D.a.createElement("h4",null,qn(t.get("source"))+" "+t.get("level")," ",r),D.a.createElement("span",{className:"message"},t.get("message")),D.a.createElement("div",{className:"error-line"},n?D.a.createElement("a",{onClick:T()(n).call(n,null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function qn(e){var t;return y()(t=(e||"").split(" ")).call(t,(function(e){return e[0].toUpperCase()+A()(e).call(e,1)})).join(" ")}Fn.defaultProps={jumpToLine:null};var zn=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onChangeWrapper",(function(e){return r.props.onChange(e.target.value)})),r}return M()(n,[{key:"componentDidMount",value:function(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}},{key:"componentWillReceiveProps",value:function(e){var t;e.contentTypes&&e.contentTypes.size&&(We()(t=e.contentTypes).call(t,e.value)||e.onChange(e.contentTypes.first()))}},{key:"render",value:function(){var e=this.props,t=e.contentTypes,n=e.className,r=e.value;return t&&t.size?D.a.createElement("div",{className:"content-type-wrapper "+(n||"")},D.a.createElement("select",{className:"content-type",value:r||"",onChange:this.onChangeWrapper},y()(t).call(t,(function(e){return D.a.createElement("option",{key:e,value:e},e)})).toArray())):null}}]),n}(D.a.Component);C()(zn,"defaultProps",{onChange:function(){},value:null,contentTypes:Object(B.fromJS)(["application/json"])});var Vn=n(29),Wn=n.n(Vn),Hn=n(56),Jn=n.n(Hn),$n=n(99),Kn=n.n($n);function Yn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Kn()(e=f()(n).call(n,(function(e){return!!e})).join(" ")).call(e)}var Gn=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.fullscreen,n=e.full,r=Jn()(e,["fullscreen","full"]);if(t)return D.a.createElement("section",r);var o="swagger-container"+(n?"-full":"");return D.a.createElement("section",Wn()({},r,{className:Yn(r.className,o)}))}}]),n}(D.a.Component),Zn={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"},Xn=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.keepContents,o=(t.mobile,t.tablet,t.desktop,t.large,Jn()(t,["hide","keepContents","mobile","tablet","desktop","large"]));if(n&&!r)return D.a.createElement("span",null);var a=[];for(var i in Zn)if(Zn.hasOwnProperty(i)){var s=Zn[i];if(i in this.props){var u=this.props[i];if(u<1){a.push("none"+s);continue}a.push("block"+s),a.push("col-"+u+s)}}n&&a.push("hidden");var c=Yn.apply(void 0,d()(e=[o.className]).call(e,a));return D.a.createElement("section",Wn()({},o,{className:c}))}}]),n}(D.a.Component),Qn=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){return D.a.createElement("div",Wn()({},this.props,{className:Yn(this.props.className,"wrapper")}))}}]),n}(D.a.Component),er=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){return D.a.createElement("button",Wn()({},this.props,{className:Yn(this.props.className,"button")}))}}]),n}(D.a.Component);C()(er,"defaultProps",{className:""});var tr=function(e){return D.a.createElement("textarea",e)},nr=function(e){return D.a.createElement("input",e)},rr=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o,a;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onChange",(function(e){var t,n,r=o.props,a=r.onChange,i=r.multiple,s=A()([]).call(e.target.options);i?t=y()(n=f()(s).call(s,(function(e){return e.selected}))).call(n,(function(e){return e.value})):t=e.target.value;o.setState({value:t}),a&&a(t)})),a=e.value?e.value:e.multiple?[""]:"",o.state={value:a},o}return M()(n,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.props.value&&this.setState({value:e.value})}},{key:"render",value:function(){var e,t,n=this.props,r=n.allowedValues,o=n.multiple,a=n.allowEmptyValue,i=n.disabled,s=(null===(e=this.state.value)||void 0===e||null===(t=e.toJS)||void 0===t?void 0:t.call(e))||this.state.value;return D.a.createElement("select",{className:this.props.className,multiple:o,value:s,onChange:this.onChange,disabled:i},a?D.a.createElement("option",{value:""},"--"):null,y()(r).call(r,(function(e,t){return D.a.createElement("option",{key:t,value:String(e)},String(e))})))}}]),n}(D.a.Component);C()(rr,"defaultProps",{multiple:!1,allowEmptyValue:!0});var or=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){return D.a.createElement("a",Wn()({},this.props,{rel:"noopener noreferrer",className:Yn(this.props.className,"link")}))}}]),n}(D.a.Component),ar=function(e){var t=e.children;return D.a.createElement("div",{className:"no-margin"}," ",t," ")},ir=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"renderNotAnimated",value:function(){return this.props.isOpened?D.a.createElement(ar,null,this.props.children):D.a.createElement("noscript",null)}},{key:"render",value:function(){var e=this.props,t=e.animated,n=e.isOpened,r=e.children;return t?(r=n?r:null,D.a.createElement(ar,null,r)):this.renderNotAnimated()}}]),n}(D.a.Component);C()(ir,"defaultProps",{isOpened:!1,animated:!1});var sr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r,o;P()(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return(o=t.call.apply(t,d()(e=[this]).call(e,i))).setTagShown=T()(r=o._setTagShown).call(r,ye()(o)),o}return M()(n,[{key:"_setTagShown",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"showOp",value:function(e,t){this.props.layoutActions.show(e,t)}},{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=e.layoutActions,o=e.getComponent,a=t.taggedOperations(),i=o("Collapse");return D.a.createElement("div",null,D.a.createElement("h4",{className:"overview-title"},"Overview"),y()(a).call(a,(function(e,t){var o=e.get("operations"),a=["overview-tags",t],s=n.isShown(a,!0);return D.a.createElement("div",{key:"overview-"+t},D.a.createElement("h4",{onClick:function(){return r.show(a,!s)},className:"link overview-tag"}," ",s?"-":"+",t),D.a.createElement(i,{isOpened:s,animated:!0},y()(o).call(o,(function(e){var t=e.toObject(),o=t.path,a=t.method,i=t.id,s="operations",u=i,c=n.isShown([s,u]);return D.a.createElement(ur,{key:i,path:o,method:a,id:o+"-"+a,shown:c,showOpId:u,showOpIdPrefix:s,href:"#operation-".concat(u),onClick:r.show})})).toArray()))})).toArray(),a.size<1&&D.a.createElement("h3",null," No operations defined in spec! "))}}]),n}(D.a.Component),ur=function(e){_e()(n,e);var t=Ee()(n);function n(e){var r,o;return P()(this,n),(o=t.call(this,e)).onClick=T()(r=o._onClick).call(r,ye()(o)),o}return M()(n,[{key:"_onClick",value:function(){var e=this.props,t=e.showOpId,n=e.showOpIdPrefix;(0,e.onClick)([n,t],!e.shown)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.method,r=e.shown,o=e.href;return D.a.createElement(or,{href:o,onClick:this.onClick,className:"block opblock-link ".concat(r?"shown":"")},D.a.createElement("div",null,D.a.createElement("small",{className:"bold-label-".concat(n)},n.toUpperCase()),D.a.createElement("span",{className:"bold-label"},t)))}}]),n}(D.a.Component),cr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"componentDidMount",value:function(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.defaultValue,Jn()(t,["value","defaultValue"]));return D.a.createElement("input",Wn()({},n,{ref:function(t){return e.inputRef=t}}))}}]),n}(D.a.Component),lr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.host,n=e.basePath;return D.a.createElement("pre",{className:"base-url"},"[ Base URL: ",t,n," ]")}}]),n}(D.a.Component),pr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.data,n=e.getComponent,r=e.selectedServer,o=e.url,a=t.get("name")||"the developer",i=ut(t.get("url"),o,{selectedServer:r}),s=t.get("email"),u=n("Link");return D.a.createElement("div",{className:"info__contact"},i&&D.a.createElement("div",null,D.a.createElement(u,{href:Object($.G)(i),target:"_blank"},a," - Website")),s&&D.a.createElement(u,{href:Object($.G)("mailto:".concat(s))},i?"Send email to ".concat(a):"Contact ".concat(a)))}}]),n}(D.a.Component),fr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.license,n=e.getComponent,r=e.selectedServer,o=e.url,a=n("Link"),i=t.get("name")||"License",s=ut(t.get("url"),o,{selectedServer:r});return D.a.createElement("div",{className:"info__license"},s?D.a.createElement(a,{target:"_blank",href:Object($.G)(s)},i):D.a.createElement("span",null,i))}}]),n}(D.a.Component),hr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.url,n=(0,e.getComponent)("Link");return D.a.createElement(n,{target:"_blank",href:Object($.G)(t)},D.a.createElement("span",{className:"url"}," ",t))}}]),n}(D.a.PureComponent),dr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.info,n=e.url,r=e.host,o=e.basePath,a=e.getComponent,i=e.externalDocs,s=e.selectedServer,u=e.url,c=t.get("version"),l=t.get("description"),p=t.get("title"),f=ut(t.get("termsOfService"),u,{selectedServer:s}),h=t.get("contact"),d=t.get("license"),v=ut(i&&i.get("url"),u,{selectedServer:s}),m=i&&i.get("description"),g=a("Markdown",!0),y=a("Link"),b=a("VersionStamp"),_=a("InfoUrl"),w=a("InfoBasePath");return D.a.createElement("div",{className:"info"},D.a.createElement("hgroup",{className:"main"},D.a.createElement("h2",{className:"title"},p,c&&D.a.createElement(b,{version:c})),r||o?D.a.createElement(w,{host:r,basePath:o}):null,n&&D.a.createElement(_,{getComponent:a,url:n})),D.a.createElement("div",{className:"description"},D.a.createElement(g,{source:l})),f&&D.a.createElement("div",{className:"info__tos"},D.a.createElement(y,{target:"_blank",href:Object($.G)(f)},"Terms of service")),h&&h.size?D.a.createElement(pr,{getComponent:a,data:h,selectedServer:s,url:n}):null,d&&d.size?D.a.createElement(fr,{getComponent:a,license:d,selectedServer:s,url:n}):null,i?D.a.createElement(y,{className:"info__extdocs",target:"_blank",href:Object($.G)(v)},m||v):null)}}]),n}(D.a.Component),vr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.getComponent,r=e.oas3Selectors,o=t.info(),a=t.url(),i=t.basePath(),s=t.host(),u=t.externalDocs(),c=r.selectedServer(),l=n("info");return D.a.createElement("div",null,o&&o.count()?D.a.createElement(l,{info:o,url:a,host:s,basePath:i,externalDocs:u,getComponent:n,selectedServer:c}):null)}}]),n}(D.a.Component),mr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){return null}}]),n}(D.a.Component),gr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){return D.a.createElement("div",{className:"footer"})}}]),n}(D.a.Component),yr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onFilterChange",(function(e){var t=e.target.value;r.props.layoutActions.updateFilter(t)})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.specSelectors,n=e.layoutSelectors,r=(0,e.getComponent)("Col"),o="loading"===t.loadingStatus(),a="failed"===t.loadingStatus(),i=n.currentFilter(),s=["operation-filter-input"];return a&&s.push("failed"),o&&s.push("loading"),D.a.createElement("div",null,null===i||!1===i||"false"===i?null:D.a.createElement("div",{className:"filter-container"},D.a.createElement(r,{className:"filter wrapper",mobile:12},D.a.createElement("input",{className:s.join(" "),placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===i||"true"===i?"":i,disabled:o}))))}}]),n}(D.a.Component),br=Function.prototype,_r=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"updateValues",(function(e){var t=e.param,n=e.isExecute,r=e.consumesValue,a=void 0===r?"":r,i=/xml/i.test(a),s=/json/i.test(a),u=i?t.get("value_xml"):t.get("value");if(void 0!==u){var c=!u&&s?"{}":u;o.setState({value:c}),o.onChange(c,{isXml:i,isEditBox:n})}else i?o.onChange(o.sample("xml"),{isXml:i,isEditBox:n}):o.onChange(o.sample(),{isEditBox:n})})),C()(ye()(o),"sample",(function(e){var t=o.props,n=t.param,r=(0,t.fn.inferSchema)(n.toJS());return Object($.o)(r,e,{includeWriteOnly:!0})})),C()(ye()(o),"onChange",(function(e,t){var n=t.isEditBox,r=t.isXml;o.setState({value:e,isEditBox:n}),o._onChange(e,r)})),C()(ye()(o),"_onChange",(function(e,t){(o.props.onChange||br)(e,t)})),C()(ye()(o),"handleOnChange",(function(e){var t=o.props.consumesValue,n=/xml/i.test(t),r=e.target.value;o.onChange(r,{isXml:n})})),C()(ye()(o),"toggleIsEditBox",(function(){return o.setState((function(e){return{isEditBox:!e.isEditBox}}))})),o.state={isEditBox:!1,value:""},o}return M()(n,[{key:"componentDidMount",value:function(){this.updateValues.call(this,this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateValues.call(this,e)}},{key:"render",value:function(){var e=this.props,t=e.onChangeConsumes,r=e.param,o=e.isExecute,a=e.specSelectors,i=e.pathMethod,s=e.getConfigs,u=e.getComponent,c=u("Button"),l=u("TextArea"),p=u("highlightCode"),f=u("contentType"),h=(a?a.parameterWithMetaByIdentity(i,r):r).get("errors",Object(B.List)()),d=a.contentTypeValues(i).get("requestContentType"),v=this.props.consumes&&this.props.consumes.size?this.props.consumes:n.defaultProp.consumes,m=this.state,g=m.value,y=m.isEditBox;return D.a.createElement("div",{className:"body-param","data-param-name":r.get("name"),"data-param-in":r.get("in")},y&&o?D.a.createElement(l,{className:"body-param__text"+(h.count()?" invalid":""),value:g,onChange:this.handleOnChange}):g&&D.a.createElement(p,{className:"body-param__example",getConfigs:s,value:g}),D.a.createElement("div",{className:"body-param-options"},o?D.a.createElement("div",{className:"body-param-edit"},D.a.createElement(c,{className:y?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},y?"Cancel":"Edit")):null,D.a.createElement("label",{htmlFor:""},D.a.createElement("span",null,"Parameter content type"),D.a.createElement(f,{value:d,contentTypes:v,onChange:t,className:"body-param-content-type"}))))}}]),n}(R.PureComponent);C()(_r,"defaultProp",{consumes:Object(B.fromJS)(["application/json"]),param:Object(B.fromJS)({}),onChange:br,onChangeConsumes:br});var wr=n(85),Er=n.n(wr),xr=n(51),Cr=n.n(xr),Sr=function(e){var t,n="_**[]";return me()(e).call(e,n)<0?e:Kn()(t=e.split(n)[0]).call(t)};var Ar=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.request,n=e.getConfigs,r=function(e){var t,n=[],r=!1,o=e.get("headers");if(n.push("curl"),e.get("curlOptions")&&n.push.apply(n,Sn()(e.get("curlOptions"))),n.push("-X",e.get("method")),n.push('"'.concat(e.get("url"),'"')),o&&o.size){var a,s,u=Cr()(Er()(a=e.get("headers")).call(a));try{for(u.s();!(s=u.n()).done;){var c,l=s.value,p=gt()(l,2),f=p[0],h=p[1];n.push("-H "),n.push(d()(c='"'.concat(f,": ")).call(c,h.replace(/\$/g,"\\$"),'"')),r=r||/^content-type$/i.test(f)&&/^multipart\/form-data$/i.test(h)}}catch(e){u.e(e)}finally{u.f()}}if(e.get("body"))if(r&&We()(t=["POST","PUT","PATCH"]).call(t,e.get("method"))){var v,m=Cr()(e.get("body").entrySeq());try{for(m.s();!(v=m.n()).done;){var g,y,b,_=gt()(v.value,2),w=_[0],E=_[1],x=Sr(w);n.push("-F"),E instanceof J.a.File?n.push(d()(g=d()(y='"'.concat(x,"=@")).call(y,E.name)).call(g,E.type?";type=".concat(E.type):"",'"')):n.push(d()(b='"'.concat(x,"=")).call(b,E,'"'))}}catch(e){m.e(e)}finally{m.f()}}else{n.push("-d");var C=e.get("body");if(B.Map.isMap(C)){var S,A=[],k=Cr()(e.get("body").entrySeq());try{for(k.s();!(S=k.n()).done;){var O,j,T,I=gt()(S.value,2),P=I[0],N=I[1],M=Sr(P);N instanceof J.a.File?A.push(d()(O=d()(j='"'.concat(M,'":{"name":"')).call(j,N.name,'"')).call(O,N.type?',"type":"'.concat(N.type,'"'):"","}")):A.push(d()(T='"'.concat(M,'":')).call(T,i()(N).replace(/\\n/g,"").replace("$","\\$")))}}catch(e){k.e(e)}finally{k.f()}n.push("{".concat(A.join(),"}"))}else n.push(i()(e.get("body")).replace(/\\n/g,"").replace(/\$/g,"\\$"))}else e.get("body")||"POST"!==e.get("method")||(n.push("-d"),n.push('""'));return n.join(" ")}(t),o=n(),a=un()(o,"syntaxHighlight.activated")?D.a.createElement(Vt,{language:"bash",className:"curl microlight",onWheel:this.preventYScrollingBeyondElement,style:an(un()(o,"syntaxHighlight.theme"))},r):D.a.createElement("textarea",{readOnly:!0,className:"curl",value:r});return D.a.createElement("div",{className:"curl-command"},D.a.createElement("h4",null,"Curl"),D.a.createElement("div",{className:"copy-to-clipboard"},D.a.createElement(pn.CopyToClipboard,{text:r},D.a.createElement("button",null))),D.a.createElement("div",null,a))}}]),n}(D.a.Component),kr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onChange",(function(e){r.setScheme(e.target.value)})),C()(ye()(r),"setScheme",(function(e){var t=r.props,n=t.path,o=t.method;t.specActions.setScheme(e,n,o)})),r}return M()(n,[{key:"componentWillMount",value:function(){var e=this.props.schemes;this.setScheme(e.first())}},{key:"componentWillReceiveProps",value:function(e){var t;this.props.currentScheme&&We()(t=e.schemes).call(t,this.props.currentScheme)||this.setScheme(e.schemes.first())}},{key:"render",value:function(){var e,t=this.props,n=t.schemes,r=t.currentScheme;return D.a.createElement("label",{htmlFor:"schemes"},D.a.createElement("span",{className:"schemes-title"},"Schemes"),D.a.createElement("select",{onChange:this.onChange,value:r},y()(e=n.valueSeq()).call(e,(function(e){return D.a.createElement("option",{value:e,key:e},e)})).toArray()))}}]),n}(D.a.Component),Or=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.specActions,n=e.specSelectors,r=e.getComponent,o=n.operationScheme(),a=n.schemes(),i=r("schemes");return a&&a.size?D.a.createElement(i,{currentScheme:o,schemes:a,specActions:t}):null}}]),n}(D.a.Component),jr=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;P()(this,n),o=t.call(this,e,r),C()(ye()(o),"toggleCollapsed",(function(){o.props.onToggle&&o.props.onToggle(o.props.modelName,!o.state.expanded),o.setState({expanded:!o.state.expanded})})),C()(ye()(o),"onLoad",(function(e){if(e&&o.props.layoutSelectors){var t=o.props.layoutSelectors.getScrollToKey();F.a.is(t,o.props.specPath)&&o.toggleCollapsed(),o.props.layoutActions.readyToScroll(o.props.specPath,e.parentElement)}}));var a=o.props,i=a.expanded,s=a.collapsedContent;return o.state={expanded:i,collapsedContent:s||n.defaultProps.collapsedContent},o}return M()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.hideSelfOnExpand,n=e.expanded,r=e.modelName;t&&n&&this.props.onToggle(r,n)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.classes;return this.state.expanded&&this.props.hideSelfOnExpand?D.a.createElement("span",{className:n||""},this.props.children):D.a.createElement("span",{className:n||"",ref:this.onLoad},t&&D.a.createElement("span",{onClick:this.toggleCollapsed,className:"pointer"},t),D.a.createElement("span",{onClick:this.toggleCollapsed,className:"pointer"},D.a.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")})),this.state.expanded?this.props.children:this.state.collapsedContent)}}]),n}(R.Component);C()(jr,"defaultProps",{collapsedContent:"{...}",expanded:!1,title:null,onToggle:function(){},hideSelfOnExpand:!1,specPath:F.a.List([])});var Tr=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;P()(this,n),o=t.call(this,e,r),C()(ye()(o),"activeTab",(function(e){var t=e.target.dataset.name;o.setState({activeTab:t})}));var a=o.props,i=a.getConfigs,s=a.isExecute,u=i().defaultModelRendering,c=u;return"example"!==u&&"model"!==u&&(c="example"),s&&(c="example"),o.state={activeTab:c},o}return M()(n,[{key:"componentWillReceiveProps",value:function(e){e.isExecute&&!this.props.isExecute&&this.props.example&&this.setState({activeTab:"example"})}},{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.specSelectors,r=e.schema,o=e.example,a=e.isExecute,i=e.getConfigs,s=e.specPath,u=e.includeReadOnly,c=e.includeWriteOnly,l=i().defaultModelExpandDepth,p=t("ModelWrapper"),f=t("highlightCode"),h=n.isOAS3();return D.a.createElement("div",{className:"model-example"},D.a.createElement("ul",{className:"tab"},D.a.createElement("li",{className:"tabitem"+("example"===this.state.activeTab?" active":"")},D.a.createElement("a",{className:"tablinks","data-name":"example",onClick:this.activeTab},a?"Edit Value":"Example Value")),r?D.a.createElement("li",{className:"tabitem"+("model"===this.state.activeTab?" active":"")},D.a.createElement("a",{className:"tablinks"+(a?" inactive":""),"data-name":"model",onClick:this.activeTab},h?"Schema":"Model")):null),D.a.createElement("div",null,"example"===this.state.activeTab?o||D.a.createElement(f,{value:"(no example available)",getConfigs:i}):null,"model"===this.state.activeTab&&D.a.createElement(p,{schema:r,getComponent:t,getConfigs:i,specSelectors:n,expandDepth:l,specPath:s,includeReadOnly:u,includeWriteOnly:c})))}}]),n}(D.a.Component),Ir=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onToggle",(function(e,t){r.props.layoutActions&&r.props.layoutActions.show(r.props.fullPath,t)})),r}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.getConfigs,o=n("Model");return this.props.layoutSelectors&&(e=this.props.layoutSelectors.isShown(this.props.fullPath)),D.a.createElement("div",{className:"model-box"},D.a.createElement(o,Wn()({},this.props,{getConfigs:r,expanded:e,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}]),n}(R.Component),Pr=n(220),Nr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"getSchemaBasePath",(function(){return r.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"]})),C()(ye()(r),"getCollapsedContent",(function(){return" "})),C()(ye()(r),"handleToggle",(function(e,t){var n,o;(r.props.layoutActions.show(d()(n=[]).call(n,Sn()(r.getSchemaBasePath()),[e]),t),t)&&r.props.specActions.requestResolvedSubtree(d()(o=[]).call(o,Sn()(r.getSchemaBasePath()),[e]))})),C()(ye()(r),"onLoadModels",(function(e){e&&r.props.layoutActions.readyToScroll(r.getSchemaBasePath(),e)})),C()(ye()(r),"onLoadModel",(function(e){if(e){var t,n=e.getAttribute("data-name");r.props.layoutActions.readyToScroll(d()(t=[]).call(t,Sn()(r.getSchemaBasePath()),[n]),e)}})),r}return M()(n,[{key:"render",value:function(){var e,t=this,n=this.props,r=n.specSelectors,o=n.getComponent,a=n.layoutSelectors,i=n.layoutActions,s=n.getConfigs,u=r.definitions(),c=s(),l=c.docExpansion,p=c.defaultModelsExpandDepth;if(!u.size||p<0)return null;var f=this.getSchemaBasePath(),h=a.isShown(f,p>0&&"none"!==l),v=r.isOAS3(),m=o("ModelWrapper"),g=o("Collapse"),b=o("ModelCollapse"),_=o("JumpToPath");return D.a.createElement("section",{className:h?"models is-open":"models",ref:this.onLoadModels},D.a.createElement("h4",{onClick:function(){return i.show(f,!h)}},D.a.createElement("span",null,v?"Schemas":"Models"),D.a.createElement("svg",{width:"20",height:"20"},D.a.createElement("use",{xlinkHref:h?"#large-arrow-down":"#large-arrow"}))),D.a.createElement(g,{isOpened:h},y()(e=u.entrySeq()).call(e,(function(e){var n,u=gt()(e,1)[0],c=d()(n=[]).call(n,Sn()(f),[u]),l=F.a.List(c),h=r.specResolvedSubtree(c),v=r.specJson().getIn(c),g=B.Map.isMap(h)?h:F.a.Map(),y=B.Map.isMap(v)?v:F.a.Map(),w=g.get("title")||y.get("title")||u,E=a.isShown(c,!1);E&&0===g.size&&y.size>0&&t.props.specActions.requestResolvedSubtree(c);var x=D.a.createElement(m,{name:u,expandDepth:p,schema:g||F.a.Map(),displayName:w,fullPath:c,specPath:l,getComponent:o,specSelectors:r,getConfigs:s,layoutSelectors:a,layoutActions:i,includeReadOnly:!0,includeWriteOnly:!0}),C=D.a.createElement("span",{className:"model-box"},D.a.createElement("span",{className:"model model-title"},w));return D.a.createElement("div",{id:"model-".concat(u),className:"model-container",key:"models-section-".concat(u),"data-name":u,ref:t.onLoadModel},D.a.createElement("span",{className:"models-jump-to-path"},D.a.createElement(_,{specPath:l})),D.a.createElement(b,{classes:"model-box",collapsedContent:t.getCollapsedContent(u),onToggle:t.handleToggle,title:C,displayName:w,modelName:u,specPath:l,layoutSelectors:a,layoutActions:i,hideSelfOnExpand:!0,expanded:p>0&&E},x))})).toArray()))}}]),n}(R.Component),Mr=function(e){var t=e.value,n=(0,e.getComponent)("ModelCollapse"),r=D.a.createElement("span",null,"Array [ ",t.count()," ]");return D.a.createElement("span",{className:"prop-enum"},"Enum:",D.a.createElement("br",null),D.a.createElement(n,{collapsedContent:r},"[ ",t.join(", ")," ]"))},Rr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t,n,r,o=this.props,a=o.schema,s=o.name,u=o.displayName,c=o.isRef,l=o.getComponent,p=o.getConfigs,h=o.depth,v=o.onToggle,m=o.expanded,g=o.specPath,b=Jn()(o,["schema","name","displayName","isRef","getComponent","getConfigs","depth","onToggle","expanded","specPath"]),_=b.specSelectors,w=b.expandDepth,E=b.includeReadOnly,x=b.includeWriteOnly,C=_.isOAS3;if(!a)return null;var S=p().showExtensions,k=a.get("description"),O=a.get("properties"),j=a.get("additionalProperties"),T=a.get("title")||u||s,I=a.get("required"),P=f()(a).call(a,(function(e,t){var n;return-1!==me()(n=["maxProperties","minProperties","nullable","example"]).call(n,t)})),N=a.get("deprecated"),M=l("JumpToPath",!0),R=l("Markdown",!0),L=l("Model"),F=l("ModelCollapse"),U=l("Property"),q=function(){return D.a.createElement("span",{className:"model-jump-to-path"},D.a.createElement(M,{specPath:g}))},z=D.a.createElement("span",null,D.a.createElement("span",null,"{"),"...",D.a.createElement("span",null,"}"),c?D.a.createElement(q,null):""),V=_.isOAS3()?a.get("anyOf"):null,W=_.isOAS3()?a.get("oneOf"):null,H=_.isOAS3()?a.get("not"):null,J=T&&D.a.createElement("span",{className:"model-title"},c&&a.get("$$ref")&&D.a.createElement("span",{className:"model-hint"},a.get("$$ref")),D.a.createElement("span",{className:"model-title__text"},T));return D.a.createElement("span",{className:"model"},D.a.createElement(F,{modelName:s,title:J,onToggle:v,expanded:!!m||h<=w,collapsedContent:z},D.a.createElement("span",{className:"brace-open object"},"{"),c?D.a.createElement(q,null):null,D.a.createElement("span",{className:"inner-object"},D.a.createElement("table",{className:"model"},D.a.createElement("tbody",null,k?D.a.createElement("tr",{className:"description"},D.a.createElement("td",null,"description:"),D.a.createElement("td",null,D.a.createElement(R,{source:k}))):null,N?D.a.createElement("tr",{className:"property"},D.a.createElement("td",null,"deprecated:"),D.a.createElement("td",null,"true")):null,O&&O.size?y()(e=f()(t=O.entrySeq()).call(t,(function(e){var t=gt()(e,2)[1];return(!t.get("readOnly")||E)&&(!t.get("writeOnly")||x)}))).call(e,(function(e){var t,n,r=gt()(e,2),o=r[0],a=r[1],i=C()&&a.get("deprecated"),u=B.List.isList(I)&&I.contains(o),c=["property-row"];return i&&c.push("deprecated"),u&&c.push("required"),D.a.createElement("tr",{key:o,className:c.join(" ")},D.a.createElement("td",null,o,u&&D.a.createElement("span",{className:"star"},"*")),D.a.createElement("td",null,D.a.createElement(L,Wn()({key:d()(t=d()(n="object-".concat(s,"-")).call(n,o,"_")).call(t,a)},b,{required:u,getComponent:l,specPath:g.push("properties",o),getConfigs:p,schema:a,depth:h+1}))))})).toArray():null,S?D.a.createElement("tr",null,D.a.createElement("td",null," ")):null,S?y()(n=a.entrySeq()).call(n,(function(e){var t=gt()(e,2),n=t[0],r=t[1];if("x-"===A()(n).call(n,0,2)){var o=r?r.toJS?r.toJS():r:null;return D.a.createElement("tr",{key:n,className:"extension"},D.a.createElement("td",null,n),D.a.createElement("td",null,i()(o)))}})).toArray():null,j&&j.size?D.a.createElement("tr",null,D.a.createElement("td",null,"< * >:"),D.a.createElement("td",null,D.a.createElement(L,Wn()({},b,{required:!1,getComponent:l,specPath:g.push("additionalProperties"),getConfigs:p,schema:j,depth:h+1})))):null,V?D.a.createElement("tr",null,D.a.createElement("td",null,"anyOf ->"),D.a.createElement("td",null,y()(V).call(V,(function(e,t){return D.a.createElement("div",{key:t},D.a.createElement(L,Wn()({},b,{required:!1,getComponent:l,specPath:g.push("anyOf",t),getConfigs:p,schema:e,depth:h+1})))})))):null,W?D.a.createElement("tr",null,D.a.createElement("td",null,"oneOf ->"),D.a.createElement("td",null,y()(W).call(W,(function(e,t){return D.a.createElement("div",{key:t},D.a.createElement(L,Wn()({},b,{required:!1,getComponent:l,specPath:g.push("oneOf",t),getConfigs:p,schema:e,depth:h+1})))})))):null,H?D.a.createElement("tr",null,D.a.createElement("td",null,"not ->"),D.a.createElement("td",null,D.a.createElement("div",null,D.a.createElement(L,Wn()({},b,{required:!1,getComponent:l,specPath:g.push("not"),getConfigs:p,schema:H,depth:h+1}))))):null))),D.a.createElement("span",{className:"brace-close"},"}")),P.size?y()(r=P.entrySeq()).call(r,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement(U,{key:d()(t="".concat(r,"-")).call(t,o),propKey:r,propVal:o,propClass:"property"})})):null)}}]),n}(R.Component),Dr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t=this.props,n=t.getComponent,r=t.getConfigs,o=t.schema,a=t.depth,i=t.expandDepth,s=t.name,u=t.displayName,c=t.specPath,l=o.get("description"),p=o.get("items"),h=o.get("title")||u||s,v=f()(o).call(o,(function(e,t){var n;return-1===me()(n=["type","items","description","$$ref"]).call(n,t)})),m=n("Markdown",!0),g=n("ModelCollapse"),b=n("Model"),_=n("Property"),w=h&&D.a.createElement("span",{className:"model-title"},D.a.createElement("span",{className:"model-title__text"},h));return D.a.createElement("span",{className:"model"},D.a.createElement(g,{title:w,expanded:a<=i,collapsedContent:"[...]"},"[",v.size?y()(e=v.entrySeq()).call(e,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement(_,{key:d()(t="".concat(r,"-")).call(t,o),propKey:r,propVal:o,propClass:"property"})})):null,l?D.a.createElement(m,{source:l}):v.size?D.a.createElement("div",{className:"markdown"}):null,D.a.createElement("span",null,D.a.createElement(b,Wn()({},this.props,{getConfigs:r,specPath:c.push("items"),name:null,schema:p,required:!1,depth:a+1}))),"]"))}}]),n}(R.Component),Lr="property primitive",Br=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e,t,n,r=this.props,o=r.schema,a=r.getComponent,i=r.getConfigs,s=r.name,u=r.displayName,c=r.depth,l=i().showExtensions;if(!o||!o.get)return D.a.createElement("div",null);var p=o.get("type"),h=o.get("format"),v=o.get("xml"),m=o.get("enum"),g=o.get("title")||u||s,b=o.get("description"),_=Object($.m)(o),w=f()(o).call(o,(function(e,t){var n;return-1===me()(n=["enum","type","format","description","$$ref"]).call(n,t)})).filterNot((function(e,t){return _.has(t)})),E=a("Markdown",!0),x=a("EnumModel"),C=a("Property");return D.a.createElement("span",{className:"model"},D.a.createElement("span",{className:"prop"},s&&D.a.createElement("span",{className:"".concat(1===c&&"model-title"," prop-name")},g),D.a.createElement("span",{className:"prop-type"},p),h&&D.a.createElement("span",{className:"prop-format"},"($",h,")"),w.size?y()(e=w.entrySeq()).call(e,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement(C,{key:d()(t="".concat(r,"-")).call(t,o),propKey:r,propVal:o,propClass:Lr})})):null,l&&_.size?y()(t=_.entrySeq()).call(t,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement(C,{key:d()(t="".concat(r,"-")).call(t,o),propKey:r,propVal:o,propClass:Lr})})):null,b?D.a.createElement(E,{source:b}):null,v&&v.size?D.a.createElement("span",null,D.a.createElement("br",null),D.a.createElement("span",{className:Lr},"xml:"),y()(n=v.entrySeq()).call(n,(function(e){var t,n=gt()(e,2),r=n[0],o=n[1];return D.a.createElement("span",{key:d()(t="".concat(r,"-")).call(t,o),className:Lr},D.a.createElement("br",null),"   ",r,": ",String(o))})).toArray()):null,m&&D.a.createElement(x,{value:m,getComponent:a})))}}]),n}(R.Component),Fr=function(e){var t=e.propKey,n=e.propVal,r=e.propClass;return D.a.createElement("span",{className:r},D.a.createElement("br",null),t,": ",String(n))},Ur=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.onTryoutClick,n=e.onCancelClick,r=e.enabled;return D.a.createElement("div",{className:"try-out"},r?D.a.createElement("button",{className:"btn try-out__btn cancel",onClick:n},"Cancel"):D.a.createElement("button",{className:"btn try-out__btn",onClick:t},"Try it out "))}}]),n}(D.a.Component);C()(Ur,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,enabled:!1});var qr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.bypass,n=e.isSwagger2,r=e.isOAS3,o=e.alsoShow;return t?D.a.createElement("div",null,this.props.children):n&&r?D.a.createElement("div",{className:"version-pragma"},o,D.a.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},D.a.createElement("div",null,D.a.createElement("h3",null,"Unable to render this definition"),D.a.createElement("p",null,D.a.createElement("code",null,"swagger")," and ",D.a.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),D.a.createElement("p",null,"Supported version fields are ",D.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",D.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",D.a.createElement("code",null,"openapi: 3.0.0"),").")))):n||r?D.a.createElement("div",null,this.props.children):D.a.createElement("div",{className:"version-pragma"},o,D.a.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},D.a.createElement("div",null,D.a.createElement("h3",null,"Unable to render this definition"),D.a.createElement("p",null,"The provided definition does not specify a valid version field."),D.a.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",D.a.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",D.a.createElement("code",null,"openapi: 3.0.n")," (for example, ",D.a.createElement("code",null,"openapi: 3.0.0"),")."))))}}]),n}(D.a.PureComponent);C()(qr,"defaultProps",{alsoShow:null,children:null,bypass:!1});var zr=function(e){var t=e.version;return D.a.createElement("small",null,D.a.createElement("pre",{className:"version"}," ",t," "))},Vr=function(e){var t=e.enabled,n=e.path,r=e.text;return D.a.createElement("a",{className:"nostyle",onClick:t?function(e){return e.preventDefault()}:null,href:t?"#/".concat(n):null},D.a.createElement("span",null,r))},Wr=function(){return D.a.createElement("div",null,D.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"svg-assets"},D.a.createElement("defs",null,D.a.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},D.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),D.a.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},D.a.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),D.a.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},D.a.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),D.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},D.a.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),D.a.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},D.a.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),D.a.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},D.a.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),D.a.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},D.a.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})))))},Hr=n(219),Jr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.errSelectors,n=e.specSelectors,r=e.getComponent,o=r("SvgAssets"),a=r("InfoContainer",!0),i=r("VersionPragmaFilter"),s=r("operations",!0),u=r("Models",!0),c=r("Row"),l=r("Col"),p=r("errors",!0),f=r("ServersContainer",!0),h=r("SchemesContainer",!0),d=r("AuthorizeBtnContainer",!0),v=r("FilterContainer",!0),m=n.isSwagger2(),g=n.isOAS3(),y=!n.specStr(),b=n.loadingStatus(),_=null;if("loading"===b&&(_=D.a.createElement("div",{className:"info"},D.a.createElement("div",{className:"loading-container"},D.a.createElement("div",{className:"loading"})))),"failed"===b&&(_=D.a.createElement("div",{className:"info"},D.a.createElement("div",{className:"loading-container"},D.a.createElement("h4",{className:"title"},"Failed to load API definition."),D.a.createElement(p,null)))),"failedConfig"===b){var w=t.lastError(),E=w?w.get("message"):"";_=D.a.createElement("div",{className:"info failed-config"},D.a.createElement("div",{className:"loading-container"},D.a.createElement("h4",{className:"title"},"Failed to load remote configuration."),D.a.createElement("p",null,E)))}if(!_&&y&&(_=D.a.createElement("h4",null,"No API definition provided.")),_)return D.a.createElement("div",{className:"swagger-ui"},D.a.createElement("div",{className:"loading-container"},_));var x=n.servers(),C=n.schemes(),S=x&&x.size,A=C&&C.size,k=!!n.securityDefinitions();return D.a.createElement("div",{className:"swagger-ui"},D.a.createElement(o,null),D.a.createElement(i,{isSwagger2:m,isOAS3:g,alsoShow:D.a.createElement(p,null)},D.a.createElement(p,null),D.a.createElement(c,{className:"information-container"},D.a.createElement(l,{mobile:12},D.a.createElement(a,null))),S||A||k?D.a.createElement("div",{className:"scheme-container"},D.a.createElement(l,{className:"schemes wrapper",mobile:12},S?D.a.createElement(f,null):null,A?D.a.createElement(h,null):null,k?D.a.createElement(d,null):null)):null,D.a.createElement(v,null),D.a.createElement(c,null,D.a.createElement(l,{mobile:12,desktop:12},D.a.createElement(s,null))),D.a.createElement(c,null,D.a.createElement(l,{mobile:12,desktop:12},D.a.createElement(u,null)))))}}]),n}(D.a.Component),$r=n(353),Kr=n.n($r),Yr={value:"",onChange:function(){},schema:{},keyName:"",required:!1,errors:Object(B.List)()},Gr=function(e){_e()(n,e);var t=Ee()(n);function n(){return P()(this,n),t.apply(this,arguments)}return M()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.dispatchInitialValue,n=e.value,r=e.onChange;t&&r(n)}},{key:"render",value:function(){var e,t=this.props,n=t.schema,r=t.errors,o=t.value,a=t.onChange,i=t.getComponent,s=t.fn,u=t.disabled,c=n&&n.get?n.get("format"):null,l=n&&n.get?n.get("type"):null,p=function(e){return i(e,!1,{failSilently:!0})},f=l?p(c?d()(e="JsonSchema_".concat(l,"_")).call(e,c):"JsonSchema_".concat(l)):i("JsonSchema_string");return f||(f=i("JsonSchema_string")),D.a.createElement(f,Wn()({},this.props,{errors:r,fn:s,getComponent:i,value:o,onChange:a,schema:n,disabled:u}))}}]),n}(R.Component);C()(Gr,"defaultProps",Yr);var Zr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onChange",(function(e){var t=r.props.schema&&"file"===r.props.schema.get("type")?e.target.files[0]:e.target.value;r.props.onChange(t,r.props.keyName)})),C()(ye()(r),"onEnumChange",(function(e){return r.props.onChange(e)})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.schema,o=e.errors,a=e.required,i=e.description,s=e.disabled,u=r&&r.get?r.get("enum"):null,c=r&&r.get?r.get("format"):null,l=r&&r.get?r.get("type"):null,p=r&&r.get?r.get("in"):null;if(n||(n=""),o=o.toJS?o.toJS():[],u){var f=t("Select");return D.a.createElement(f,{className:o.length?"invalid":"",title:o.length?o:"",allowedValues:u,value:n,allowEmptyValue:!a,disabled:s,onChange:this.onEnumChange})}var h=s||p&&"formData"===p&&!("FormData"in window),d=t("Input");return l&&"file"===l?D.a.createElement(d,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:this.onChange,disabled:h}):D.a.createElement(Kr.a,{type:c&&"password"===c?"password":"text",className:o.length?"invalid":"",title:o.length?o:"",value:n,minLength:0,debounceTimeout:350,placeholder:i,onChange:this.onChange,disabled:h})}}]),n}(R.Component);C()(Zr,"defaultProps",Yr);var Xr=function(e){_e()(n,e);var t=Ee()(n);function n(e,r){var o;return P()(this,n),o=t.call(this,e,r),C()(ye()(o),"onChange",(function(){o.props.onChange(o.state.value)})),C()(ye()(o),"onItemChange",(function(e,t){o.setState((function(n){return{value:n.value.set(t,e)}}),o.onChange)})),C()(ye()(o),"removeItem",(function(e){o.setState((function(t){return{value:t.value.delete(e)}}),o.onChange)})),C()(ye()(o),"addItem",(function(){var e=ro(o.state.value);o.setState((function(){return{value:e.push(Object($.o)(o.state.schema.get("items"),!1,{includeWriteOnly:!0}))}}),o.onChange)})),C()(ye()(o),"onEnumChange",(function(e){o.setState((function(){return{value:e}}),o.onChange)})),o.state={value:ro(e.value),schema:e.schema},o}return M()(n,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value}),e.schema!==this.state.schema&&this.setState({schema:e.schema})}},{key:"render",value:function(){var e=this,t=this.props,n=t.getComponent,r=t.required,o=t.schema,a=t.errors,i=t.fn,s=t.disabled;a=a.toJS?a.toJS():[];var u,c,l=this.state.value,p=!!(l&&l.count&&l.count()>0),h=o.getIn(["items","enum"]),v=o.getIn(["items","type"]),m=o.getIn(["items","format"]),g=o.getIn(["items","schema"]),b=!1,_="file"===v||"string"===v&&"binary"===m;v&&m?u=n(d()(c="JsonSchema_".concat(v,"_")).call(c,m)):"boolean"!==v&&"array"!==v&&"object"!==v||(u=n("JsonSchema_".concat(v)));if(u||_||(b=!0),h){var w=n("Select");return D.a.createElement(w,{className:a.length?"invalid":"",title:a.length?a:"",multiple:!0,value:l,disabled:s,allowedValues:h,allowEmptyValue:!r,onChange:this.onEnumChange})}var E=n("Button");return D.a.createElement("div",{className:"json-schema-array"},p?y()(l).call(l,(function(t,r){if(a.length){var o=f()(a).call(a,(function(e){return e.index===r}));o.length&&(a=[o[0].error+r])}return D.a.createElement("div",{key:r,className:"json-schema-form-item"},_?D.a.createElement(eo,{value:t,onChange:function(t){return e.onItemChange(t,r)},disabled:s,errors:a,getComponent:n}):b?D.a.createElement(Qr,{value:t,onChange:function(t){return e.onItemChange(t,r)},disabled:s,errors:a}):D.a.createElement(u,Wn()({},e.props,{value:t,onChange:function(t){return e.onItemChange(t,r)},disabled:s,errors:a,schema:g,getComponent:n,fn:i})),s?null:D.a.createElement(E,{className:"btn btn-sm json-schema-form-item-remove",onClick:function(){return e.removeItem(r)}}," - "))})):null,s?null:D.a.createElement(E,{className:"btn btn-sm json-schema-form-item-add ".concat(a.length?"invalid":null),onClick:this.addItem},"Add item"))}}]),n}(R.PureComponent);C()(Xr,"defaultProps",Yr);var Qr=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onChange",(function(e){var t=e.target.value;r.props.onChange(t,r.props.keyName)})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.errors,r=e.description,o=e.disabled;return t||(t=""),n=n.toJS?n.toJS():[],D.a.createElement(Kr.a,{type:"text",className:n.length?"invalid":"",title:n.length?n:"",value:t,minLength:0,debounceTimeout:350,placeholder:r,onChange:this.onChange,disabled:o})}}]),n}(R.Component);C()(Qr,"defaultProps",Yr);var eo=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onFileChange",(function(e){var t=e.target.files[0];r.props.onChange(t,r.props.keyName)})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.errors,r=e.disabled,o=t("Input"),a=r||!("FormData"in window);return D.a.createElement(o,{type:"file",className:n.length?"invalid":"",title:n.length?n:"",onChange:this.onFileChange,disabled:a})}}]),n}(R.Component);C()(eo,"defaultProps",Yr);var to=function(e){_e()(n,e);var t=Ee()(n);function n(){var e,r;P()(this,n);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,d()(e=[this]).call(e,a)),C()(ye()(r),"onEnumChange",(function(e){return r.props.onChange(e)})),r}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.schema,a=e.required,i=e.disabled;r=r.toJS?r.toJS():[];var s=o&&o.get?o.get("enum"):null,u=!s||!a,c=!s&&Object(B.fromJS)(["true","false"]),l=t("Select");return D.a.createElement(l,{className:r.length?"invalid":"",title:r.length?r:"",value:String(n),disabled:i,allowedValues:s||c,allowEmptyValue:u,onChange:this.onEnumChange})}}]),n}(R.Component);C()(to,"defaultProps",Yr);var no=function(e){_e()(n,e);var t=Ee()(n);function n(){var e;return P()(this,n),e=t.call(this),C()(ye()(e),"onChange",(function(t){e.props.onChange(t)})),C()(ye()(e),"handleOnChange",(function(t){var n=t.target.value;e.onChange(n)})),e}return M()(n,[{key:"render",value:function(){var e=this.props,t=e.getComponent,n=e.value,r=e.errors,o=e.disabled,a=t("TextArea");return D.a.createElement("div",null,D.a.createElement(a,{className:vn()({invalid:r.size}),title:r.size?r.join(", "):"",value:Object($.J)(n),disabled:o,onChange:this.handleOnChange}))}}]),n}(R.PureComponent);function ro(e){return B.List.isList(e)?e:Object(B.List)()}C()(no,"defaultProps",Yr);var oo=function(){var e={components:{App:Se,authorizationPopup:Ae,authorizeBtn:ke,AuthorizeBtnContainer:Oe,authorizeOperationBtn:je,auths:Te,AuthItem:Ie,authError:Pe,oauth2:Ye,apiKeyAuth:Ne,basicAuth:Me,clear:Ge,liveResponse:Qe,InitializedInput:cr,info:dr,InfoContainer:vr,JumpToPath:mr,onlineValidatorBadge:et.a,operations:rt,operation:lt,OperationSummary:ht,OperationSummaryMethod:dt,OperationSummaryPath:vt,highlightCode:fn,responses:hn,response:mn,responseBody:xn,parameters:An,parameterRow:In,execute:Dn,headers:Ln,errors:Bn,contentType:zn,overview:sr,footer:gr,FilterContainer:yr,ParamBody:_r,curl:Ar,schemes:kr,SchemesContainer:Or,modelExample:Tr,ModelWrapper:Ir,ModelCollapse:jr,Model:Pr.a,Models:Nr,EnumModel:Mr,ObjectModel:Rr,ArrayModel:Dr,PrimitiveModel:Br,Property:Fr,TryItOutButton:Ur,Markdown:Hr.a,BaseLayout:Jr,VersionPragmaFilter:qr,VersionStamp:zr,OperationExt:yt,OperationExtRow:bt,ParameterExt:kn,ParameterIncludeEmpty:jn,OperationTag:ct,OperationContainer:Ce,DeepLink:Vr,InfoUrl:hr,InfoBasePath:lr,SvgAssets:Wr,Example:Re,ExamplesSelect:Be,ExamplesSelectValueRetainer:ze}},t={components:r},n={components:o};return[pe.default,ce.default,ie.default,oe.default,re.default,te.default,ne.default,ae.default,e,t,se.default,n,ue.default,le.default,fe.default,he.default,de.default]},ao=n(316);function io(){return[oo,ao.default]}var so=n(338);var uo=!0,co="g252f956",lo="3.35.1",po="ip-172-31-21-173",fo="Thu, 08 Oct 2020 23:05:53 GMT";function ho(e){var t;J.a.versions=J.a.versions||{},J.a.versions.swaggerUi={version:lo,gitRevision:co,gitDirty:uo,buildTimestamp:fo,machine:po};var n={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:d()(t="".concat(window.location.protocol,"//")).call(t,window.location.host,"/oauth2-redirect.html"),persistAuthorization:!1,configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,requestInterceptor:function(e){return e},responseInterceptor:function(e){return e},showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],presets:[io],plugins:[],initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:"agate"}},r=Object($.D)(),o=e.domNode;delete e.domNode;var a=m()({},n,e,r),s={system:{configs:a.configs},plugins:a.presets,state:m()({layout:{layout:a.layout,filter:f()(a)},spec:{spec:"",url:a.url}},a.initialState)};if(a.initialState)for(var c in a.initialState)a.initialState.hasOwnProperty(c)&&void 0===a.initialState[c]&&delete s.state[c];var p=new Y(s);p.register([a.plugins,function(){return{fn:a.fn,components:a.components,state:a.state}}]);var h=p.getSystem(),v=function(e){var t=h.specSelectors.getLocalConfig?h.specSelectors.getLocalConfig():{},n=m()({},t,a,e||{},r);if(o&&(n.domNode=o),p.setConfigs(n),h.configsActions.loaded(),null!==e&&(!r.url&&"object"===l()(n.spec)&&u()(n.spec).length?(h.specActions.updateUrl(""),h.specActions.updateLoadingStatus("success"),h.specActions.updateSpec(i()(n.spec))):h.specActions.download&&n.url&&!n.urls&&(h.specActions.updateUrl(n.url),h.specActions.download(n.url))),n.domNode)h.render(n.domNode,"App");else if(n.dom_id){var s=document.querySelector(n.dom_id);h.render(s,"App")}else null===n.dom_id||null===n.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return h},g=r.config||a.configUrl;return g&&h.specActions&&h.specActions.getConfigByUrl&&(!h.specActions.getConfigByUrl||h.specActions.getConfigByUrl({url:g,loadRemoteConfig:!0,requestInterceptor:a.requestInterceptor,responseInterceptor:a.responseInterceptor},v))?(h.specActions.getConfigByUrl(g,v),h):v()}ho.presets={apis:io},ho.plugins=so.default;t.default=ho}]).default}));
-//# sourceMappingURL=swagger-ui-bundle.js.map
\ No newline at end of file
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui.css b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/swagger-ui.css
deleted file mode 100644 (file)
index 03c6235..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.swagger-ui{
-  /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:sans-serif;color:#3b4151}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui template{display:none}.swagger-ui [hidden]{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODYyRjhERDU2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODYyRjhERDQ2N0YyMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QTY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3QjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCS01IAAABMSURBVHjaYmR4/5+BFPBfAMFm/MBgx8RAGWCn1AAmSg34Q6kBDKMGMDCwICeMIemF/5QawEipAWwUhwEjMDvbAWlWkvVBwu8vQIABAEwBCph8U6c0AAAAAElFTkSuQmCC) repeat 0 0}.swagger-ui .debug-grid-8-solid{background:#fff url(data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAAAAD/4QMxaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzExMSA3OS4xNTgzMjUsIDIwMTUvMDkvMTAtMDE6MTA6MjAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIxMjI0OTczNjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkIxMjI0OTc0NjdCMzExRTZCMkJDRTI0MDgxMDAyMTcxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QjEyMjQ5NzE2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QjEyMjQ5NzI2N0IzMTFFNkIyQkNFMjQwODEwMDIxNzEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7/7gAOQWRvYmUAZMAAAAAB/9sAhAAbGhopHSlBJiZBQi8vL0JHPz4+P0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHAR0pKTQmND8oKD9HPzU/R0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAAIAAgDASIAAhEBAxEB/8QAWQABAQAAAAAAAAAAAAAAAAAAAAYBAQEAAAAAAAAAAAAAAAAAAAIEEAEBAAMBAAAAAAAAAAAAAAABADECA0ERAAEDBQAAAAAAAAAAAAAAAAARITFBUWESIv/aAAwDAQACEQMRAD8AoOnTV1QTD7JJshP3vSM3P//Z) repeat 0 0}.swagger-ui .debug-grid-16-solid{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzY3MkJEN0U2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzY3MkJEN0Y2N0M1MTFFNkIyQkNFMjQwODEwMDIxNzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3QzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3RDY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pve6J3kAAAAzSURBVHjaYvz//z8D0UDsMwMjSRoYP5Gq4SPNbRjVMEQ1fCRDg+in/6+J1AJUxsgAEGAA31BAJMS0GYEAAAAASUVORK5CYII=) repeat 0 0}.swagger-ui .border-box,.swagger-ui a,.swagger-ui article,.swagger-ui body,.swagger-ui code,.swagger-ui dd,.swagger-ui div,.swagger-ui dl,.swagger-ui dt,.swagger-ui fieldset,.swagger-ui footer,.swagger-ui form,.swagger-ui h1,.swagger-ui h2,.swagger-ui h3,.swagger-ui h4,.swagger-ui h5,.swagger-ui h6,.swagger-ui header,.swagger-ui html,.swagger-ui input[type=email],.swagger-ui input[type=number],.swagger-ui input[type=password],.swagger-ui input[type=tel],.swagger-ui input[type=text],.swagger-ui input[type=url],.swagger-ui legend,.swagger-ui li,.swagger-ui main,.swagger-ui ol,.swagger-ui p,.swagger-ui pre,.swagger-ui section,.swagger-ui table,.swagger-ui td,.swagger-ui textarea,.swagger-ui th,.swagger-ui tr,.swagger-ui ul{box-sizing:border-box}.swagger-ui .aspect-ratio{height:0;position:relative}.swagger-ui .aspect-ratio--16x9{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1{padding-bottom:100%}.swagger-ui .aspect-ratio--object{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}@media screen and (min-width:30em){.swagger-ui .aspect-ratio-ns{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-ns{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-ns{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-ns{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-ns{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-ns{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-ns{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-ns{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-ns{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-ns{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-ns{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-ns{padding-bottom:100%}.swagger-ui .aspect-ratio--object-ns{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .aspect-ratio-m{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-m{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-m{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-m{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-m{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-m{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-m{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-m{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-m{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-m{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-m{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-m{padding-bottom:100%}.swagger-ui .aspect-ratio--object-m{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}@media screen and (min-width:60em){.swagger-ui .aspect-ratio-l{height:0;position:relative}.swagger-ui .aspect-ratio--16x9-l{padding-bottom:56.25%}.swagger-ui .aspect-ratio--9x16-l{padding-bottom:177.77%}.swagger-ui .aspect-ratio--4x3-l{padding-bottom:75%}.swagger-ui .aspect-ratio--3x4-l{padding-bottom:133.33%}.swagger-ui .aspect-ratio--6x4-l{padding-bottom:66.6%}.swagger-ui .aspect-ratio--4x6-l{padding-bottom:150%}.swagger-ui .aspect-ratio--8x5-l{padding-bottom:62.5%}.swagger-ui .aspect-ratio--5x8-l{padding-bottom:160%}.swagger-ui .aspect-ratio--7x5-l{padding-bottom:71.42%}.swagger-ui .aspect-ratio--5x7-l{padding-bottom:140%}.swagger-ui .aspect-ratio--1x1-l{padding-bottom:100%}.swagger-ui .aspect-ratio--object-l{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:100}}.swagger-ui img{max-width:100%}.swagger-ui .cover{background-size:cover!important}.swagger-ui .contain{background-size:contain!important}@media screen and (min-width:30em){.swagger-ui .cover-ns{background-size:cover!important}.swagger-ui .contain-ns{background-size:contain!important}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cover-m{background-size:cover!important}.swagger-ui .contain-m{background-size:contain!important}}@media screen and (min-width:60em){.swagger-ui .cover-l{background-size:cover!important}.swagger-ui .contain-l{background-size:contain!important}}.swagger-ui .bg-center{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left{background-repeat:no-repeat;background-position:0}@media screen and (min-width:30em){.swagger-ui .bg-center-ns{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-ns{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-ns{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-ns{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-ns{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bg-center-m{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-m{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-m{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-m{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-m{background-repeat:no-repeat;background-position:0}}@media screen and (min-width:60em){.swagger-ui .bg-center-l{background-repeat:no-repeat;background-position:50%}.swagger-ui .bg-top-l{background-repeat:no-repeat;background-position:top}.swagger-ui .bg-right-l{background-repeat:no-repeat;background-position:100%}.swagger-ui .bg-bottom-l{background-repeat:no-repeat;background-position:bottom}.swagger-ui .bg-left-l{background-repeat:no-repeat;background-position:0}}.swagger-ui .outline{outline:1px solid}.swagger-ui .outline-transparent{outline:1px solid transparent}.swagger-ui .outline-0{outline:0}@media screen and (min-width:30em){.swagger-ui .outline-ns{outline:1px solid}.swagger-ui .outline-transparent-ns{outline:1px solid transparent}.swagger-ui .outline-0-ns{outline:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .outline-m{outline:1px solid}.swagger-ui .outline-transparent-m{outline:1px solid transparent}.swagger-ui .outline-0-m{outline:0}}@media screen and (min-width:60em){.swagger-ui .outline-l{outline:1px solid}.swagger-ui .outline-transparent-l{outline:1px solid transparent}.swagger-ui .outline-0-l{outline:0}}.swagger-ui .ba{border-style:solid;border-width:1px}.swagger-ui .bt{border-top-style:solid;border-top-width:1px}.swagger-ui .br{border-right-style:solid;border-right-width:1px}.swagger-ui .bb{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl{border-left-style:solid;border-left-width:1px}.swagger-ui .bn{border-style:none;border-width:0}@media screen and (min-width:30em){.swagger-ui .ba-ns{border-style:solid;border-width:1px}.swagger-ui .bt-ns{border-top-style:solid;border-top-width:1px}.swagger-ui .br-ns{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-ns{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-ns{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-ns{border-style:none;border-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ba-m{border-style:solid;border-width:1px}.swagger-ui .bt-m{border-top-style:solid;border-top-width:1px}.swagger-ui .br-m{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-m{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-m{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-m{border-style:none;border-width:0}}@media screen and (min-width:60em){.swagger-ui .ba-l{border-style:solid;border-width:1px}.swagger-ui .bt-l{border-top-style:solid;border-top-width:1px}.swagger-ui .br-l{border-right-style:solid;border-right-width:1px}.swagger-ui .bb-l{border-bottom-style:solid;border-bottom-width:1px}.swagger-ui .bl-l{border-left-style:solid;border-left-width:1px}.swagger-ui .bn-l{border-style:none;border-width:0}}.swagger-ui .b--black{border-color:#000}.swagger-ui .b--near-black{border-color:#111}.swagger-ui .b--dark-gray{border-color:#333}.swagger-ui .b--mid-gray{border-color:#555}.swagger-ui .b--gray{border-color:#777}.swagger-ui .b--silver{border-color:#999}.swagger-ui .b--light-silver{border-color:#aaa}.swagger-ui .b--moon-gray{border-color:#ccc}.swagger-ui .b--light-gray{border-color:#eee}.swagger-ui .b--near-white{border-color:#f4f4f4}.swagger-ui .b--white{border-color:#fff}.swagger-ui .b--white-90{border-color:hsla(0,0%,100%,.9)}.swagger-ui .b--white-80{border-color:hsla(0,0%,100%,.8)}.swagger-ui .b--white-70{border-color:hsla(0,0%,100%,.7)}.swagger-ui .b--white-60{border-color:hsla(0,0%,100%,.6)}.swagger-ui .b--white-50{border-color:hsla(0,0%,100%,.5)}.swagger-ui .b--white-40{border-color:hsla(0,0%,100%,.4)}.swagger-ui .b--white-30{border-color:hsla(0,0%,100%,.3)}.swagger-ui .b--white-20{border-color:hsla(0,0%,100%,.2)}.swagger-ui .b--white-10{border-color:hsla(0,0%,100%,.1)}.swagger-ui .b--white-05{border-color:hsla(0,0%,100%,.05)}.swagger-ui .b--white-025{border-color:hsla(0,0%,100%,.025)}.swagger-ui .b--white-0125{border-color:hsla(0,0%,100%,.0125)}.swagger-ui .b--black-90{border-color:rgba(0,0,0,.9)}.swagger-ui .b--black-80{border-color:rgba(0,0,0,.8)}.swagger-ui .b--black-70{border-color:rgba(0,0,0,.7)}.swagger-ui .b--black-60{border-color:rgba(0,0,0,.6)}.swagger-ui .b--black-50{border-color:rgba(0,0,0,.5)}.swagger-ui .b--black-40{border-color:rgba(0,0,0,.4)}.swagger-ui .b--black-30{border-color:rgba(0,0,0,.3)}.swagger-ui .b--black-20{border-color:rgba(0,0,0,.2)}.swagger-ui .b--black-10{border-color:rgba(0,0,0,.1)}.swagger-ui .b--black-05{border-color:rgba(0,0,0,.05)}.swagger-ui .b--black-025{border-color:rgba(0,0,0,.025)}.swagger-ui .b--black-0125{border-color:rgba(0,0,0,.0125)}.swagger-ui .b--dark-red{border-color:#e7040f}.swagger-ui .b--red{border-color:#ff4136}.swagger-ui .b--light-red{border-color:#ff725c}.swagger-ui .b--orange{border-color:#ff6300}.swagger-ui .b--gold{border-color:#ffb700}.swagger-ui .b--yellow{border-color:gold}.swagger-ui .b--light-yellow{border-color:#fbf1a9}.swagger-ui .b--purple{border-color:#5e2ca5}.swagger-ui .b--light-purple{border-color:#a463f2}.swagger-ui .b--dark-pink{border-color:#d5008f}.swagger-ui .b--hot-pink{border-color:#ff41b4}.swagger-ui .b--pink{border-color:#ff80cc}.swagger-ui .b--light-pink{border-color:#ffa3d7}.swagger-ui .b--dark-green{border-color:#137752}.swagger-ui .b--green{border-color:#19a974}.swagger-ui .b--light-green{border-color:#9eebcf}.swagger-ui .b--navy{border-color:#001b44}.swagger-ui .b--dark-blue{border-color:#00449e}.swagger-ui .b--blue{border-color:#357edd}.swagger-ui .b--light-blue{border-color:#96ccff}.swagger-ui .b--lightest-blue{border-color:#cdecff}.swagger-ui .b--washed-blue{border-color:#f6fffe}.swagger-ui .b--washed-green{border-color:#e8fdf5}.swagger-ui .b--washed-yellow{border-color:#fffceb}.swagger-ui .b--washed-red{border-color:#ffdfdf}.swagger-ui .b--transparent{border-color:transparent}.swagger-ui .b--inherit{border-color:inherit}.swagger-ui .br0{border-radius:0}.swagger-ui .br1{border-radius:.125rem}.swagger-ui .br2{border-radius:.25rem}.swagger-ui .br3{border-radius:.5rem}.swagger-ui .br4{border-radius:1rem}.swagger-ui .br-100{border-radius:100%}.swagger-ui .br-pill{border-radius:9999px}.swagger-ui .br--bottom{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left{border-top-right-radius:0;border-bottom-right-radius:0}@media screen and (min-width:30em){.swagger-ui .br0-ns{border-radius:0}.swagger-ui .br1-ns{border-radius:.125rem}.swagger-ui .br2-ns{border-radius:.25rem}.swagger-ui .br3-ns{border-radius:.5rem}.swagger-ui .br4-ns{border-radius:1rem}.swagger-ui .br-100-ns{border-radius:100%}.swagger-ui .br-pill-ns{border-radius:9999px}.swagger-ui .br--bottom-ns{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-ns{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-ns{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-ns{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .br0-m{border-radius:0}.swagger-ui .br1-m{border-radius:.125rem}.swagger-ui .br2-m{border-radius:.25rem}.swagger-ui .br3-m{border-radius:.5rem}.swagger-ui .br4-m{border-radius:1rem}.swagger-ui .br-100-m{border-radius:100%}.swagger-ui .br-pill-m{border-radius:9999px}.swagger-ui .br--bottom-m{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-m{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-m{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-m{border-top-right-radius:0;border-bottom-right-radius:0}}@media screen and (min-width:60em){.swagger-ui .br0-l{border-radius:0}.swagger-ui .br1-l{border-radius:.125rem}.swagger-ui .br2-l{border-radius:.25rem}.swagger-ui .br3-l{border-radius:.5rem}.swagger-ui .br4-l{border-radius:1rem}.swagger-ui .br-100-l{border-radius:100%}.swagger-ui .br-pill-l{border-radius:9999px}.swagger-ui .br--bottom-l{border-top-left-radius:0;border-top-right-radius:0}.swagger-ui .br--top-l{border-bottom-left-radius:0;border-bottom-right-radius:0}.swagger-ui .br--right-l{border-top-left-radius:0;border-bottom-left-radius:0}.swagger-ui .br--left-l{border-top-right-radius:0;border-bottom-right-radius:0}}.swagger-ui .b--dotted{border-style:dotted}.swagger-ui .b--dashed{border-style:dashed}.swagger-ui .b--solid{border-style:solid}.swagger-ui .b--none{border-style:none}@media screen and (min-width:30em){.swagger-ui .b--dotted-ns{border-style:dotted}.swagger-ui .b--dashed-ns{border-style:dashed}.swagger-ui .b--solid-ns{border-style:solid}.swagger-ui .b--none-ns{border-style:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .b--dotted-m{border-style:dotted}.swagger-ui .b--dashed-m{border-style:dashed}.swagger-ui .b--solid-m{border-style:solid}.swagger-ui .b--none-m{border-style:none}}@media screen and (min-width:60em){.swagger-ui .b--dotted-l{border-style:dotted}.swagger-ui .b--dashed-l{border-style:dashed}.swagger-ui .b--solid-l{border-style:solid}.swagger-ui .b--none-l{border-style:none}}.swagger-ui .bw0{border-width:0}.swagger-ui .bw1{border-width:.125rem}.swagger-ui .bw2{border-width:.25rem}.swagger-ui .bw3{border-width:.5rem}.swagger-ui .bw4{border-width:1rem}.swagger-ui .bw5{border-width:2rem}.swagger-ui .bt-0{border-top-width:0}.swagger-ui .br-0{border-right-width:0}.swagger-ui .bb-0{border-bottom-width:0}.swagger-ui .bl-0{border-left-width:0}@media screen and (min-width:30em){.swagger-ui .bw0-ns{border-width:0}.swagger-ui .bw1-ns{border-width:.125rem}.swagger-ui .bw2-ns{border-width:.25rem}.swagger-ui .bw3-ns{border-width:.5rem}.swagger-ui .bw4-ns{border-width:1rem}.swagger-ui .bw5-ns{border-width:2rem}.swagger-ui .bt-0-ns{border-top-width:0}.swagger-ui .br-0-ns{border-right-width:0}.swagger-ui .bb-0-ns{border-bottom-width:0}.swagger-ui .bl-0-ns{border-left-width:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .bw0-m{border-width:0}.swagger-ui .bw1-m{border-width:.125rem}.swagger-ui .bw2-m{border-width:.25rem}.swagger-ui .bw3-m{border-width:.5rem}.swagger-ui .bw4-m{border-width:1rem}.swagger-ui .bw5-m{border-width:2rem}.swagger-ui .bt-0-m{border-top-width:0}.swagger-ui .br-0-m{border-right-width:0}.swagger-ui .bb-0-m{border-bottom-width:0}.swagger-ui .bl-0-m{border-left-width:0}}@media screen and (min-width:60em){.swagger-ui .bw0-l{border-width:0}.swagger-ui .bw1-l{border-width:.125rem}.swagger-ui .bw2-l{border-width:.25rem}.swagger-ui .bw3-l{border-width:.5rem}.swagger-ui .bw4-l{border-width:1rem}.swagger-ui .bw5-l{border-width:2rem}.swagger-ui .bt-0-l{border-top-width:0}.swagger-ui .br-0-l{border-right-width:0}.swagger-ui .bb-0-l{border-bottom-width:0}.swagger-ui .bl-0-l{border-left-width:0}}.swagger-ui .shadow-1{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}@media screen and (min-width:30em){.swagger-ui .shadow-1-ns{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-ns{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-ns{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-ns{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-ns{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .shadow-1-m{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-m{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-m{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-m{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-m{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}@media screen and (min-width:60em){.swagger-ui .shadow-1-l{box-shadow:0 0 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-2-l{box-shadow:0 0 8px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-3-l{box-shadow:2px 2px 4px 2px rgba(0,0,0,.2)}.swagger-ui .shadow-4-l{box-shadow:2px 2px 8px 0 rgba(0,0,0,.2)}.swagger-ui .shadow-5-l{box-shadow:4px 4px 8px 0 rgba(0,0,0,.2)}}.swagger-ui .pre{overflow-x:auto;overflow-y:hidden;overflow:scroll}.swagger-ui .top-0{top:0}.swagger-ui .right-0{right:0}.swagger-ui .bottom-0{bottom:0}.swagger-ui .left-0{left:0}.swagger-ui .top-1{top:1rem}.swagger-ui .right-1{right:1rem}.swagger-ui .bottom-1{bottom:1rem}.swagger-ui .left-1{left:1rem}.swagger-ui .top-2{top:2rem}.swagger-ui .right-2{right:2rem}.swagger-ui .bottom-2{bottom:2rem}.swagger-ui .left-2{left:2rem}.swagger-ui .top--1{top:-1rem}.swagger-ui .right--1{right:-1rem}.swagger-ui .bottom--1{bottom:-1rem}.swagger-ui .left--1{left:-1rem}.swagger-ui .top--2{top:-2rem}.swagger-ui .right--2{right:-2rem}.swagger-ui .bottom--2{bottom:-2rem}.swagger-ui .left--2{left:-2rem}.swagger-ui .absolute--fill{top:0;right:0;bottom:0;left:0}@media screen and (min-width:30em){.swagger-ui .top-0-ns{top:0}.swagger-ui .left-0-ns{left:0}.swagger-ui .right-0-ns{right:0}.swagger-ui .bottom-0-ns{bottom:0}.swagger-ui .top-1-ns{top:1rem}.swagger-ui .left-1-ns{left:1rem}.swagger-ui .right-1-ns{right:1rem}.swagger-ui .bottom-1-ns{bottom:1rem}.swagger-ui .top-2-ns{top:2rem}.swagger-ui .left-2-ns{left:2rem}.swagger-ui .right-2-ns{right:2rem}.swagger-ui .bottom-2-ns{bottom:2rem}.swagger-ui .top--1-ns{top:-1rem}.swagger-ui .right--1-ns{right:-1rem}.swagger-ui .bottom--1-ns{bottom:-1rem}.swagger-ui .left--1-ns{left:-1rem}.swagger-ui .top--2-ns{top:-2rem}.swagger-ui .right--2-ns{right:-2rem}.swagger-ui .bottom--2-ns{bottom:-2rem}.swagger-ui .left--2-ns{left:-2rem}.swagger-ui .absolute--fill-ns{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .top-0-m{top:0}.swagger-ui .left-0-m{left:0}.swagger-ui .right-0-m{right:0}.swagger-ui .bottom-0-m{bottom:0}.swagger-ui .top-1-m{top:1rem}.swagger-ui .left-1-m{left:1rem}.swagger-ui .right-1-m{right:1rem}.swagger-ui .bottom-1-m{bottom:1rem}.swagger-ui .top-2-m{top:2rem}.swagger-ui .left-2-m{left:2rem}.swagger-ui .right-2-m{right:2rem}.swagger-ui .bottom-2-m{bottom:2rem}.swagger-ui .top--1-m{top:-1rem}.swagger-ui .right--1-m{right:-1rem}.swagger-ui .bottom--1-m{bottom:-1rem}.swagger-ui .left--1-m{left:-1rem}.swagger-ui .top--2-m{top:-2rem}.swagger-ui .right--2-m{right:-2rem}.swagger-ui .bottom--2-m{bottom:-2rem}.swagger-ui .left--2-m{left:-2rem}.swagger-ui .absolute--fill-m{top:0;right:0;bottom:0;left:0}}@media screen and (min-width:60em){.swagger-ui .top-0-l{top:0}.swagger-ui .left-0-l{left:0}.swagger-ui .right-0-l{right:0}.swagger-ui .bottom-0-l{bottom:0}.swagger-ui .top-1-l{top:1rem}.swagger-ui .left-1-l{left:1rem}.swagger-ui .right-1-l{right:1rem}.swagger-ui .bottom-1-l{bottom:1rem}.swagger-ui .top-2-l{top:2rem}.swagger-ui .left-2-l{left:2rem}.swagger-ui .right-2-l{right:2rem}.swagger-ui .bottom-2-l{bottom:2rem}.swagger-ui .top--1-l{top:-1rem}.swagger-ui .right--1-l{right:-1rem}.swagger-ui .bottom--1-l{bottom:-1rem}.swagger-ui .left--1-l{left:-1rem}.swagger-ui .top--2-l{top:-2rem}.swagger-ui .right--2-l{right:-2rem}.swagger-ui .bottom--2-l{bottom:-2rem}.swagger-ui .left--2-l{left:-2rem}.swagger-ui .absolute--fill-l{top:0;right:0;bottom:0;left:0}}.swagger-ui .cf:after,.swagger-ui .cf:before{content:" ";display:table}.swagger-ui .cf:after{clear:both}.swagger-ui .cf{*zoom:1}.swagger-ui .cl{clear:left}.swagger-ui .cr{clear:right}.swagger-ui .cb{clear:both}.swagger-ui .cn{clear:none}@media screen and (min-width:30em){.swagger-ui .cl-ns{clear:left}.swagger-ui .cr-ns{clear:right}.swagger-ui .cb-ns{clear:both}.swagger-ui .cn-ns{clear:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .cl-m{clear:left}.swagger-ui .cr-m{clear:right}.swagger-ui .cb-m{clear:both}.swagger-ui .cn-m{clear:none}}@media screen and (min-width:60em){.swagger-ui .cl-l{clear:left}.swagger-ui .cr-l{clear:right}.swagger-ui .cb-l{clear:both}.swagger-ui .cn-l{clear:none}}.swagger-ui .flex{display:flex}.swagger-ui .inline-flex{display:inline-flex}.swagger-ui .flex-auto{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none{flex:none}.swagger-ui .flex-column{flex-direction:column}.swagger-ui .flex-row{flex-direction:row}.swagger-ui .flex-wrap{flex-wrap:wrap}.swagger-ui .flex-nowrap{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse{flex-direction:column-reverse}.swagger-ui .flex-row-reverse{flex-direction:row-reverse}.swagger-ui .items-start{align-items:flex-start}.swagger-ui .items-end{align-items:flex-end}.swagger-ui .items-center{align-items:center}.swagger-ui .items-baseline{align-items:baseline}.swagger-ui .items-stretch{align-items:stretch}.swagger-ui .self-start{align-self:flex-start}.swagger-ui .self-end{align-self:flex-end}.swagger-ui .self-center{align-self:center}.swagger-ui .self-baseline{align-self:baseline}.swagger-ui .self-stretch{align-self:stretch}.swagger-ui .justify-start{justify-content:flex-start}.swagger-ui .justify-end{justify-content:flex-end}.swagger-ui .justify-center{justify-content:center}.swagger-ui .justify-between{justify-content:space-between}.swagger-ui .justify-around{justify-content:space-around}.swagger-ui .content-start{align-content:flex-start}.swagger-ui .content-end{align-content:flex-end}.swagger-ui .content-center{align-content:center}.swagger-ui .content-between{align-content:space-between}.swagger-ui .content-around{align-content:space-around}.swagger-ui .content-stretch{align-content:stretch}.swagger-ui .order-0{order:0}.swagger-ui .order-1{order:1}.swagger-ui .order-2{order:2}.swagger-ui .order-3{order:3}.swagger-ui .order-4{order:4}.swagger-ui .order-5{order:5}.swagger-ui .order-6{order:6}.swagger-ui .order-7{order:7}.swagger-ui .order-8{order:8}.swagger-ui .order-last{order:99999}.swagger-ui .flex-grow-0{flex-grow:0}.swagger-ui .flex-grow-1{flex-grow:1}.swagger-ui .flex-shrink-0{flex-shrink:0}.swagger-ui .flex-shrink-1{flex-shrink:1}@media screen and (min-width:30em){.swagger-ui .flex-ns{display:flex}.swagger-ui .inline-flex-ns{display:inline-flex}.swagger-ui .flex-auto-ns{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-ns{flex:none}.swagger-ui .flex-column-ns{flex-direction:column}.swagger-ui .flex-row-ns{flex-direction:row}.swagger-ui .flex-wrap-ns{flex-wrap:wrap}.swagger-ui .flex-nowrap-ns{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-ns{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-ns{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-ns{flex-direction:row-reverse}.swagger-ui .items-start-ns{align-items:flex-start}.swagger-ui .items-end-ns{align-items:flex-end}.swagger-ui .items-center-ns{align-items:center}.swagger-ui .items-baseline-ns{align-items:baseline}.swagger-ui .items-stretch-ns{align-items:stretch}.swagger-ui .self-start-ns{align-self:flex-start}.swagger-ui .self-end-ns{align-self:flex-end}.swagger-ui .self-center-ns{align-self:center}.swagger-ui .self-baseline-ns{align-self:baseline}.swagger-ui .self-stretch-ns{align-self:stretch}.swagger-ui .justify-start-ns{justify-content:flex-start}.swagger-ui .justify-end-ns{justify-content:flex-end}.swagger-ui .justify-center-ns{justify-content:center}.swagger-ui .justify-between-ns{justify-content:space-between}.swagger-ui .justify-around-ns{justify-content:space-around}.swagger-ui .content-start-ns{align-content:flex-start}.swagger-ui .content-end-ns{align-content:flex-end}.swagger-ui .content-center-ns{align-content:center}.swagger-ui .content-between-ns{align-content:space-between}.swagger-ui .content-around-ns{align-content:space-around}.swagger-ui .content-stretch-ns{align-content:stretch}.swagger-ui .order-0-ns{order:0}.swagger-ui .order-1-ns{order:1}.swagger-ui .order-2-ns{order:2}.swagger-ui .order-3-ns{order:3}.swagger-ui .order-4-ns{order:4}.swagger-ui .order-5-ns{order:5}.swagger-ui .order-6-ns{order:6}.swagger-ui .order-7-ns{order:7}.swagger-ui .order-8-ns{order:8}.swagger-ui .order-last-ns{order:99999}.swagger-ui .flex-grow-0-ns{flex-grow:0}.swagger-ui .flex-grow-1-ns{flex-grow:1}.swagger-ui .flex-shrink-0-ns{flex-shrink:0}.swagger-ui .flex-shrink-1-ns{flex-shrink:1}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .flex-m{display:flex}.swagger-ui .inline-flex-m{display:inline-flex}.swagger-ui .flex-auto-m{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-m{flex:none}.swagger-ui .flex-column-m{flex-direction:column}.swagger-ui .flex-row-m{flex-direction:row}.swagger-ui .flex-wrap-m{flex-wrap:wrap}.swagger-ui .flex-nowrap-m{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-m{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-m{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-m{flex-direction:row-reverse}.swagger-ui .items-start-m{align-items:flex-start}.swagger-ui .items-end-m{align-items:flex-end}.swagger-ui .items-center-m{align-items:center}.swagger-ui .items-baseline-m{align-items:baseline}.swagger-ui .items-stretch-m{align-items:stretch}.swagger-ui .self-start-m{align-self:flex-start}.swagger-ui .self-end-m{align-self:flex-end}.swagger-ui .self-center-m{align-self:center}.swagger-ui .self-baseline-m{align-self:baseline}.swagger-ui .self-stretch-m{align-self:stretch}.swagger-ui .justify-start-m{justify-content:flex-start}.swagger-ui .justify-end-m{justify-content:flex-end}.swagger-ui .justify-center-m{justify-content:center}.swagger-ui .justify-between-m{justify-content:space-between}.swagger-ui .justify-around-m{justify-content:space-around}.swagger-ui .content-start-m{align-content:flex-start}.swagger-ui .content-end-m{align-content:flex-end}.swagger-ui .content-center-m{align-content:center}.swagger-ui .content-between-m{align-content:space-between}.swagger-ui .content-around-m{align-content:space-around}.swagger-ui .content-stretch-m{align-content:stretch}.swagger-ui .order-0-m{order:0}.swagger-ui .order-1-m{order:1}.swagger-ui .order-2-m{order:2}.swagger-ui .order-3-m{order:3}.swagger-ui .order-4-m{order:4}.swagger-ui .order-5-m{order:5}.swagger-ui .order-6-m{order:6}.swagger-ui .order-7-m{order:7}.swagger-ui .order-8-m{order:8}.swagger-ui .order-last-m{order:99999}.swagger-ui .flex-grow-0-m{flex-grow:0}.swagger-ui .flex-grow-1-m{flex-grow:1}.swagger-ui .flex-shrink-0-m{flex-shrink:0}.swagger-ui .flex-shrink-1-m{flex-shrink:1}}@media screen and (min-width:60em){.swagger-ui .flex-l{display:flex}.swagger-ui .inline-flex-l{display:inline-flex}.swagger-ui .flex-auto-l{flex:1 1 auto;min-width:0;min-height:0}.swagger-ui .flex-none-l{flex:none}.swagger-ui .flex-column-l{flex-direction:column}.swagger-ui .flex-row-l{flex-direction:row}.swagger-ui .flex-wrap-l{flex-wrap:wrap}.swagger-ui .flex-nowrap-l{flex-wrap:nowrap}.swagger-ui .flex-wrap-reverse-l{flex-wrap:wrap-reverse}.swagger-ui .flex-column-reverse-l{flex-direction:column-reverse}.swagger-ui .flex-row-reverse-l{flex-direction:row-reverse}.swagger-ui .items-start-l{align-items:flex-start}.swagger-ui .items-end-l{align-items:flex-end}.swagger-ui .items-center-l{align-items:center}.swagger-ui .items-baseline-l{align-items:baseline}.swagger-ui .items-stretch-l{align-items:stretch}.swagger-ui .self-start-l{align-self:flex-start}.swagger-ui .self-end-l{align-self:flex-end}.swagger-ui .self-center-l{align-self:center}.swagger-ui .self-baseline-l{align-self:baseline}.swagger-ui .self-stretch-l{align-self:stretch}.swagger-ui .justify-start-l{justify-content:flex-start}.swagger-ui .justify-end-l{justify-content:flex-end}.swagger-ui .justify-center-l{justify-content:center}.swagger-ui .justify-between-l{justify-content:space-between}.swagger-ui .justify-around-l{justify-content:space-around}.swagger-ui .content-start-l{align-content:flex-start}.swagger-ui .content-end-l{align-content:flex-end}.swagger-ui .content-center-l{align-content:center}.swagger-ui .content-between-l{align-content:space-between}.swagger-ui .content-around-l{align-content:space-around}.swagger-ui .content-stretch-l{align-content:stretch}.swagger-ui .order-0-l{order:0}.swagger-ui .order-1-l{order:1}.swagger-ui .order-2-l{order:2}.swagger-ui .order-3-l{order:3}.swagger-ui .order-4-l{order:4}.swagger-ui .order-5-l{order:5}.swagger-ui .order-6-l{order:6}.swagger-ui .order-7-l{order:7}.swagger-ui .order-8-l{order:8}.swagger-ui .order-last-l{order:99999}.swagger-ui .flex-grow-0-l{flex-grow:0}.swagger-ui .flex-grow-1-l{flex-grow:1}.swagger-ui .flex-shrink-0-l{flex-shrink:0}.swagger-ui .flex-shrink-1-l{flex-shrink:1}}.swagger-ui .dn{display:none}.swagger-ui .di{display:inline}.swagger-ui .db{display:block}.swagger-ui .dib{display:inline-block}.swagger-ui .dit{display:inline-table}.swagger-ui .dt{display:table}.swagger-ui .dtc{display:table-cell}.swagger-ui .dt-row{display:table-row}.swagger-ui .dt-row-group{display:table-row-group}.swagger-ui .dt-column{display:table-column}.swagger-ui .dt-column-group{display:table-column-group}.swagger-ui .dt--fixed{table-layout:fixed;width:100%}@media screen and (min-width:30em){.swagger-ui .dn-ns{display:none}.swagger-ui .di-ns{display:inline}.swagger-ui .db-ns{display:block}.swagger-ui .dib-ns{display:inline-block}.swagger-ui .dit-ns{display:inline-table}.swagger-ui .dt-ns{display:table}.swagger-ui .dtc-ns{display:table-cell}.swagger-ui .dt-row-ns{display:table-row}.swagger-ui .dt-row-group-ns{display:table-row-group}.swagger-ui .dt-column-ns{display:table-column}.swagger-ui .dt-column-group-ns{display:table-column-group}.swagger-ui .dt--fixed-ns{table-layout:fixed;width:100%}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .dn-m{display:none}.swagger-ui .di-m{display:inline}.swagger-ui .db-m{display:block}.swagger-ui .dib-m{display:inline-block}.swagger-ui .dit-m{display:inline-table}.swagger-ui .dt-m{display:table}.swagger-ui .dtc-m{display:table-cell}.swagger-ui .dt-row-m{display:table-row}.swagger-ui .dt-row-group-m{display:table-row-group}.swagger-ui .dt-column-m{display:table-column}.swagger-ui .dt-column-group-m{display:table-column-group}.swagger-ui .dt--fixed-m{table-layout:fixed;width:100%}}@media screen and (min-width:60em){.swagger-ui .dn-l{display:none}.swagger-ui .di-l{display:inline}.swagger-ui .db-l{display:block}.swagger-ui .dib-l{display:inline-block}.swagger-ui .dit-l{display:inline-table}.swagger-ui .dt-l{display:table}.swagger-ui .dtc-l{display:table-cell}.swagger-ui .dt-row-l{display:table-row}.swagger-ui .dt-row-group-l{display:table-row-group}.swagger-ui .dt-column-l{display:table-column}.swagger-ui .dt-column-group-l{display:table-column-group}.swagger-ui .dt--fixed-l{table-layout:fixed;width:100%}}.swagger-ui .fl{float:left;_display:inline}.swagger-ui .fr{float:right;_display:inline}.swagger-ui .fn{float:none}@media screen and (min-width:30em){.swagger-ui .fl-ns{float:left;_display:inline}.swagger-ui .fr-ns{float:right;_display:inline}.swagger-ui .fn-ns{float:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .fl-m{float:left;_display:inline}.swagger-ui .fr-m{float:right;_display:inline}.swagger-ui .fn-m{float:none}}@media screen and (min-width:60em){.swagger-ui .fl-l{float:left;_display:inline}.swagger-ui .fr-l{float:right;_display:inline}.swagger-ui .fn-l{float:none}}.swagger-ui .sans-serif{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica,helvetica neue,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.swagger-ui .serif{font-family:georgia,serif}.swagger-ui .system-sans-serif{font-family:sans-serif}.swagger-ui .system-serif{font-family:serif}.swagger-ui .code,.swagger-ui code{font-family:Consolas,monaco,monospace}.swagger-ui .courier{font-family:Courier Next,courier,monospace}.swagger-ui .helvetica{font-family:helvetica neue,helvetica,sans-serif}.swagger-ui .avenir{font-family:avenir next,avenir,sans-serif}.swagger-ui .athelas{font-family:athelas,georgia,serif}.swagger-ui .georgia{font-family:georgia,serif}.swagger-ui .times{font-family:times,serif}.swagger-ui .bodoni{font-family:Bodoni MT,serif}.swagger-ui .calisto{font-family:Calisto MT,serif}.swagger-ui .garamond{font-family:garamond,serif}.swagger-ui .baskerville{font-family:baskerville,serif}.swagger-ui .i{font-style:italic}.swagger-ui .fs-normal{font-style:normal}@media screen and (min-width:30em){.swagger-ui .i-ns{font-style:italic}.swagger-ui .fs-normal-ns{font-style:normal}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .i-m{font-style:italic}.swagger-ui .fs-normal-m{font-style:normal}}@media screen and (min-width:60em){.swagger-ui .i-l{font-style:italic}.swagger-ui .fs-normal-l{font-style:normal}}.swagger-ui .normal{font-weight:400}.swagger-ui .b{font-weight:700}.swagger-ui .fw1{font-weight:100}.swagger-ui .fw2{font-weight:200}.swagger-ui .fw3{font-weight:300}.swagger-ui .fw4{font-weight:400}.swagger-ui .fw5{font-weight:500}.swagger-ui .fw6{font-weight:600}.swagger-ui .fw7{font-weight:700}.swagger-ui .fw8{font-weight:800}.swagger-ui .fw9{font-weight:900}@media screen and (min-width:30em){.swagger-ui .normal-ns{font-weight:400}.swagger-ui .b-ns{font-weight:700}.swagger-ui .fw1-ns{font-weight:100}.swagger-ui .fw2-ns{font-weight:200}.swagger-ui .fw3-ns{font-weight:300}.swagger-ui .fw4-ns{font-weight:400}.swagger-ui .fw5-ns{font-weight:500}.swagger-ui .fw6-ns{font-weight:600}.swagger-ui .fw7-ns{font-weight:700}.swagger-ui .fw8-ns{font-weight:800}.swagger-ui .fw9-ns{font-weight:900}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .normal-m{font-weight:400}.swagger-ui .b-m{font-weight:700}.swagger-ui .fw1-m{font-weight:100}.swagger-ui .fw2-m{font-weight:200}.swagger-ui .fw3-m{font-weight:300}.swagger-ui .fw4-m{font-weight:400}.swagger-ui .fw5-m{font-weight:500}.swagger-ui .fw6-m{font-weight:600}.swagger-ui .fw7-m{font-weight:700}.swagger-ui .fw8-m{font-weight:800}.swagger-ui .fw9-m{font-weight:900}}@media screen and (min-width:60em){.swagger-ui .normal-l{font-weight:400}.swagger-ui .b-l{font-weight:700}.swagger-ui .fw1-l{font-weight:100}.swagger-ui .fw2-l{font-weight:200}.swagger-ui .fw3-l{font-weight:300}.swagger-ui .fw4-l{font-weight:400}.swagger-ui .fw5-l{font-weight:500}.swagger-ui .fw6-l{font-weight:600}.swagger-ui .fw7-l{font-weight:700}.swagger-ui .fw8-l{font-weight:800}.swagger-ui .fw9-l{font-weight:900}}.swagger-ui .input-reset{-webkit-appearance:none;-moz-appearance:none}.swagger-ui .button-reset::-moz-focus-inner,.swagger-ui .input-reset::-moz-focus-inner{border:0;padding:0}.swagger-ui .h1{height:1rem}.swagger-ui .h2{height:2rem}.swagger-ui .h3{height:4rem}.swagger-ui .h4{height:8rem}.swagger-ui .h5{height:16rem}.swagger-ui .h-25{height:25%}.swagger-ui .h-50{height:50%}.swagger-ui .h-75{height:75%}.swagger-ui .h-100{height:100%}.swagger-ui .min-h-100{min-height:100%}.swagger-ui .vh-25{height:25vh}.swagger-ui .vh-50{height:50vh}.swagger-ui .vh-75{height:75vh}.swagger-ui .vh-100{height:100vh}.swagger-ui .min-vh-100{min-height:100vh}.swagger-ui .h-auto{height:auto}.swagger-ui .h-inherit{height:inherit}@media screen and (min-width:30em){.swagger-ui .h1-ns{height:1rem}.swagger-ui .h2-ns{height:2rem}.swagger-ui .h3-ns{height:4rem}.swagger-ui .h4-ns{height:8rem}.swagger-ui .h5-ns{height:16rem}.swagger-ui .h-25-ns{height:25%}.swagger-ui .h-50-ns{height:50%}.swagger-ui .h-75-ns{height:75%}.swagger-ui .h-100-ns{height:100%}.swagger-ui .min-h-100-ns{min-height:100%}.swagger-ui .vh-25-ns{height:25vh}.swagger-ui .vh-50-ns{height:50vh}.swagger-ui .vh-75-ns{height:75vh}.swagger-ui .vh-100-ns{height:100vh}.swagger-ui .min-vh-100-ns{min-height:100vh}.swagger-ui .h-auto-ns{height:auto}.swagger-ui .h-inherit-ns{height:inherit}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .h1-m{height:1rem}.swagger-ui .h2-m{height:2rem}.swagger-ui .h3-m{height:4rem}.swagger-ui .h4-m{height:8rem}.swagger-ui .h5-m{height:16rem}.swagger-ui .h-25-m{height:25%}.swagger-ui .h-50-m{height:50%}.swagger-ui .h-75-m{height:75%}.swagger-ui .h-100-m{height:100%}.swagger-ui .min-h-100-m{min-height:100%}.swagger-ui .vh-25-m{height:25vh}.swagger-ui .vh-50-m{height:50vh}.swagger-ui .vh-75-m{height:75vh}.swagger-ui .vh-100-m{height:100vh}.swagger-ui .min-vh-100-m{min-height:100vh}.swagger-ui .h-auto-m{height:auto}.swagger-ui .h-inherit-m{height:inherit}}@media screen and (min-width:60em){.swagger-ui .h1-l{height:1rem}.swagger-ui .h2-l{height:2rem}.swagger-ui .h3-l{height:4rem}.swagger-ui .h4-l{height:8rem}.swagger-ui .h5-l{height:16rem}.swagger-ui .h-25-l{height:25%}.swagger-ui .h-50-l{height:50%}.swagger-ui .h-75-l{height:75%}.swagger-ui .h-100-l{height:100%}.swagger-ui .min-h-100-l{min-height:100%}.swagger-ui .vh-25-l{height:25vh}.swagger-ui .vh-50-l{height:50vh}.swagger-ui .vh-75-l{height:75vh}.swagger-ui .vh-100-l{height:100vh}.swagger-ui .min-vh-100-l{min-height:100vh}.swagger-ui .h-auto-l{height:auto}.swagger-ui .h-inherit-l{height:inherit}}.swagger-ui .tracked{letter-spacing:.1em}.swagger-ui .tracked-tight{letter-spacing:-.05em}.swagger-ui .tracked-mega{letter-spacing:.25em}@media screen and (min-width:30em){.swagger-ui .tracked-ns{letter-spacing:.1em}.swagger-ui .tracked-tight-ns{letter-spacing:-.05em}.swagger-ui .tracked-mega-ns{letter-spacing:.25em}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tracked-m{letter-spacing:.1em}.swagger-ui .tracked-tight-m{letter-spacing:-.05em}.swagger-ui .tracked-mega-m{letter-spacing:.25em}}@media screen and (min-width:60em){.swagger-ui .tracked-l{letter-spacing:.1em}.swagger-ui .tracked-tight-l{letter-spacing:-.05em}.swagger-ui .tracked-mega-l{letter-spacing:.25em}}.swagger-ui .lh-solid{line-height:1}.swagger-ui .lh-title{line-height:1.25}.swagger-ui .lh-copy{line-height:1.5}@media screen and (min-width:30em){.swagger-ui .lh-solid-ns{line-height:1}.swagger-ui .lh-title-ns{line-height:1.25}.swagger-ui .lh-copy-ns{line-height:1.5}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .lh-solid-m{line-height:1}.swagger-ui .lh-title-m{line-height:1.25}.swagger-ui .lh-copy-m{line-height:1.5}}@media screen and (min-width:60em){.swagger-ui .lh-solid-l{line-height:1}.swagger-ui .lh-title-l{line-height:1.25}.swagger-ui .lh-copy-l{line-height:1.5}}.swagger-ui .link{text-decoration:none}.swagger-ui .link,.swagger-ui .link:link,.swagger-ui .link:visited{transition:color .15s ease-in}.swagger-ui .link:hover{transition:color .15s ease-in}.swagger-ui .link:active{transition:color .15s ease-in}.swagger-ui .link:focus{transition:color .15s ease-in;outline:1px dotted currentColor}.swagger-ui .list{list-style-type:none}.swagger-ui .mw-100{max-width:100%}.swagger-ui .mw1{max-width:1rem}.swagger-ui .mw2{max-width:2rem}.swagger-ui .mw3{max-width:4rem}.swagger-ui .mw4{max-width:8rem}.swagger-ui .mw5{max-width:16rem}.swagger-ui .mw6{max-width:32rem}.swagger-ui .mw7{max-width:48rem}.swagger-ui .mw8{max-width:64rem}.swagger-ui .mw9{max-width:96rem}.swagger-ui .mw-none{max-width:none}@media screen and (min-width:30em){.swagger-ui .mw-100-ns{max-width:100%}.swagger-ui .mw1-ns{max-width:1rem}.swagger-ui .mw2-ns{max-width:2rem}.swagger-ui .mw3-ns{max-width:4rem}.swagger-ui .mw4-ns{max-width:8rem}.swagger-ui .mw5-ns{max-width:16rem}.swagger-ui .mw6-ns{max-width:32rem}.swagger-ui .mw7-ns{max-width:48rem}.swagger-ui .mw8-ns{max-width:64rem}.swagger-ui .mw9-ns{max-width:96rem}.swagger-ui .mw-none-ns{max-width:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .mw-100-m{max-width:100%}.swagger-ui .mw1-m{max-width:1rem}.swagger-ui .mw2-m{max-width:2rem}.swagger-ui .mw3-m{max-width:4rem}.swagger-ui .mw4-m{max-width:8rem}.swagger-ui .mw5-m{max-width:16rem}.swagger-ui .mw6-m{max-width:32rem}.swagger-ui .mw7-m{max-width:48rem}.swagger-ui .mw8-m{max-width:64rem}.swagger-ui .mw9-m{max-width:96rem}.swagger-ui .mw-none-m{max-width:none}}@media screen and (min-width:60em){.swagger-ui .mw-100-l{max-width:100%}.swagger-ui .mw1-l{max-width:1rem}.swagger-ui .mw2-l{max-width:2rem}.swagger-ui .mw3-l{max-width:4rem}.swagger-ui .mw4-l{max-width:8rem}.swagger-ui .mw5-l{max-width:16rem}.swagger-ui .mw6-l{max-width:32rem}.swagger-ui .mw7-l{max-width:48rem}.swagger-ui .mw8-l{max-width:64rem}.swagger-ui .mw9-l{max-width:96rem}.swagger-ui .mw-none-l{max-width:none}}.swagger-ui .w1{width:1rem}.swagger-ui .w2{width:2rem}.swagger-ui .w3{width:4rem}.swagger-ui .w4{width:8rem}.swagger-ui .w5{width:16rem}.swagger-ui .w-10{width:10%}.swagger-ui .w-20{width:20%}.swagger-ui .w-25{width:25%}.swagger-ui .w-30{width:30%}.swagger-ui .w-33{width:33%}.swagger-ui .w-34{width:34%}.swagger-ui .w-40{width:40%}.swagger-ui .w-50{width:50%}.swagger-ui .w-60{width:60%}.swagger-ui .w-70{width:70%}.swagger-ui .w-75{width:75%}.swagger-ui .w-80{width:80%}.swagger-ui .w-90{width:90%}.swagger-ui .w-100{width:100%}.swagger-ui .w-third{width:33.33333%}.swagger-ui .w-two-thirds{width:66.66667%}.swagger-ui .w-auto{width:auto}@media screen and (min-width:30em){.swagger-ui .w1-ns{width:1rem}.swagger-ui .w2-ns{width:2rem}.swagger-ui .w3-ns{width:4rem}.swagger-ui .w4-ns{width:8rem}.swagger-ui .w5-ns{width:16rem}.swagger-ui .w-10-ns{width:10%}.swagger-ui .w-20-ns{width:20%}.swagger-ui .w-25-ns{width:25%}.swagger-ui .w-30-ns{width:30%}.swagger-ui .w-33-ns{width:33%}.swagger-ui .w-34-ns{width:34%}.swagger-ui .w-40-ns{width:40%}.swagger-ui .w-50-ns{width:50%}.swagger-ui .w-60-ns{width:60%}.swagger-ui .w-70-ns{width:70%}.swagger-ui .w-75-ns{width:75%}.swagger-ui .w-80-ns{width:80%}.swagger-ui .w-90-ns{width:90%}.swagger-ui .w-100-ns{width:100%}.swagger-ui .w-third-ns{width:33.33333%}.swagger-ui .w-two-thirds-ns{width:66.66667%}.swagger-ui .w-auto-ns{width:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .w1-m{width:1rem}.swagger-ui .w2-m{width:2rem}.swagger-ui .w3-m{width:4rem}.swagger-ui .w4-m{width:8rem}.swagger-ui .w5-m{width:16rem}.swagger-ui .w-10-m{width:10%}.swagger-ui .w-20-m{width:20%}.swagger-ui .w-25-m{width:25%}.swagger-ui .w-30-m{width:30%}.swagger-ui .w-33-m{width:33%}.swagger-ui .w-34-m{width:34%}.swagger-ui .w-40-m{width:40%}.swagger-ui .w-50-m{width:50%}.swagger-ui .w-60-m{width:60%}.swagger-ui .w-70-m{width:70%}.swagger-ui .w-75-m{width:75%}.swagger-ui .w-80-m{width:80%}.swagger-ui .w-90-m{width:90%}.swagger-ui .w-100-m{width:100%}.swagger-ui .w-third-m{width:33.33333%}.swagger-ui .w-two-thirds-m{width:66.66667%}.swagger-ui .w-auto-m{width:auto}}@media screen and (min-width:60em){.swagger-ui .w1-l{width:1rem}.swagger-ui .w2-l{width:2rem}.swagger-ui .w3-l{width:4rem}.swagger-ui .w4-l{width:8rem}.swagger-ui .w5-l{width:16rem}.swagger-ui .w-10-l{width:10%}.swagger-ui .w-20-l{width:20%}.swagger-ui .w-25-l{width:25%}.swagger-ui .w-30-l{width:30%}.swagger-ui .w-33-l{width:33%}.swagger-ui .w-34-l{width:34%}.swagger-ui .w-40-l{width:40%}.swagger-ui .w-50-l{width:50%}.swagger-ui .w-60-l{width:60%}.swagger-ui .w-70-l{width:70%}.swagger-ui .w-75-l{width:75%}.swagger-ui .w-80-l{width:80%}.swagger-ui .w-90-l{width:90%}.swagger-ui .w-100-l{width:100%}.swagger-ui .w-third-l{width:33.33333%}.swagger-ui .w-two-thirds-l{width:66.66667%}.swagger-ui .w-auto-l{width:auto}}.swagger-ui .overflow-visible{overflow:visible}.swagger-ui .overflow-hidden{overflow:hidden}.swagger-ui .overflow-scroll{overflow:scroll}.swagger-ui .overflow-auto{overflow:auto}.swagger-ui .overflow-x-visible{overflow-x:visible}.swagger-ui .overflow-x-hidden{overflow-x:hidden}.swagger-ui .overflow-x-scroll{overflow-x:scroll}.swagger-ui .overflow-x-auto{overflow-x:auto}.swagger-ui .overflow-y-visible{overflow-y:visible}.swagger-ui .overflow-y-hidden{overflow-y:hidden}.swagger-ui .overflow-y-scroll{overflow-y:scroll}.swagger-ui .overflow-y-auto{overflow-y:auto}@media screen and (min-width:30em){.swagger-ui .overflow-visible-ns{overflow:visible}.swagger-ui .overflow-hidden-ns{overflow:hidden}.swagger-ui .overflow-scroll-ns{overflow:scroll}.swagger-ui .overflow-auto-ns{overflow:auto}.swagger-ui .overflow-x-visible-ns{overflow-x:visible}.swagger-ui .overflow-x-hidden-ns{overflow-x:hidden}.swagger-ui .overflow-x-scroll-ns{overflow-x:scroll}.swagger-ui .overflow-x-auto-ns{overflow-x:auto}.swagger-ui .overflow-y-visible-ns{overflow-y:visible}.swagger-ui .overflow-y-hidden-ns{overflow-y:hidden}.swagger-ui .overflow-y-scroll-ns{overflow-y:scroll}.swagger-ui .overflow-y-auto-ns{overflow-y:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .overflow-visible-m{overflow:visible}.swagger-ui .overflow-hidden-m{overflow:hidden}.swagger-ui .overflow-scroll-m{overflow:scroll}.swagger-ui .overflow-auto-m{overflow:auto}.swagger-ui .overflow-x-visible-m{overflow-x:visible}.swagger-ui .overflow-x-hidden-m{overflow-x:hidden}.swagger-ui .overflow-x-scroll-m{overflow-x:scroll}.swagger-ui .overflow-x-auto-m{overflow-x:auto}.swagger-ui .overflow-y-visible-m{overflow-y:visible}.swagger-ui .overflow-y-hidden-m{overflow-y:hidden}.swagger-ui .overflow-y-scroll-m{overflow-y:scroll}.swagger-ui .overflow-y-auto-m{overflow-y:auto}}@media screen and (min-width:60em){.swagger-ui .overflow-visible-l{overflow:visible}.swagger-ui .overflow-hidden-l{overflow:hidden}.swagger-ui .overflow-scroll-l{overflow:scroll}.swagger-ui .overflow-auto-l{overflow:auto}.swagger-ui .overflow-x-visible-l{overflow-x:visible}.swagger-ui .overflow-x-hidden-l{overflow-x:hidden}.swagger-ui .overflow-x-scroll-l{overflow-x:scroll}.swagger-ui .overflow-x-auto-l{overflow-x:auto}.swagger-ui .overflow-y-visible-l{overflow-y:visible}.swagger-ui .overflow-y-hidden-l{overflow-y:hidden}.swagger-ui .overflow-y-scroll-l{overflow-y:scroll}.swagger-ui .overflow-y-auto-l{overflow-y:auto}}.swagger-ui .static{position:static}.swagger-ui .relative{position:relative}.swagger-ui .absolute{position:absolute}.swagger-ui .fixed{position:fixed}@media screen and (min-width:30em){.swagger-ui .static-ns{position:static}.swagger-ui .relative-ns{position:relative}.swagger-ui .absolute-ns{position:absolute}.swagger-ui .fixed-ns{position:fixed}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .static-m{position:static}.swagger-ui .relative-m{position:relative}.swagger-ui .absolute-m{position:absolute}.swagger-ui .fixed-m{position:fixed}}@media screen and (min-width:60em){.swagger-ui .static-l{position:static}.swagger-ui .relative-l{position:relative}.swagger-ui .absolute-l{position:absolute}.swagger-ui .fixed-l{position:fixed}}.swagger-ui .o-100{opacity:1}.swagger-ui .o-90{opacity:.9}.swagger-ui .o-80{opacity:.8}.swagger-ui .o-70{opacity:.7}.swagger-ui .o-60{opacity:.6}.swagger-ui .o-50{opacity:.5}.swagger-ui .o-40{opacity:.4}.swagger-ui .o-30{opacity:.3}.swagger-ui .o-20{opacity:.2}.swagger-ui .o-10{opacity:.1}.swagger-ui .o-05{opacity:.05}.swagger-ui .o-025{opacity:.025}.swagger-ui .o-0{opacity:0}.swagger-ui .rotate-45{transform:rotate(45deg)}.swagger-ui .rotate-90{transform:rotate(90deg)}.swagger-ui .rotate-135{transform:rotate(135deg)}.swagger-ui .rotate-180{transform:rotate(180deg)}.swagger-ui .rotate-225{transform:rotate(225deg)}.swagger-ui .rotate-270{transform:rotate(270deg)}.swagger-ui .rotate-315{transform:rotate(315deg)}@media screen and (min-width:30em){.swagger-ui .rotate-45-ns{transform:rotate(45deg)}.swagger-ui .rotate-90-ns{transform:rotate(90deg)}.swagger-ui .rotate-135-ns{transform:rotate(135deg)}.swagger-ui .rotate-180-ns{transform:rotate(180deg)}.swagger-ui .rotate-225-ns{transform:rotate(225deg)}.swagger-ui .rotate-270-ns{transform:rotate(270deg)}.swagger-ui .rotate-315-ns{transform:rotate(315deg)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .rotate-45-m{transform:rotate(45deg)}.swagger-ui .rotate-90-m{transform:rotate(90deg)}.swagger-ui .rotate-135-m{transform:rotate(135deg)}.swagger-ui .rotate-180-m{transform:rotate(180deg)}.swagger-ui .rotate-225-m{transform:rotate(225deg)}.swagger-ui .rotate-270-m{transform:rotate(270deg)}.swagger-ui .rotate-315-m{transform:rotate(315deg)}}@media screen and (min-width:60em){.swagger-ui .rotate-45-l{transform:rotate(45deg)}.swagger-ui .rotate-90-l{transform:rotate(90deg)}.swagger-ui .rotate-135-l{transform:rotate(135deg)}.swagger-ui .rotate-180-l{transform:rotate(180deg)}.swagger-ui .rotate-225-l{transform:rotate(225deg)}.swagger-ui .rotate-270-l{transform:rotate(270deg)}.swagger-ui .rotate-315-l{transform:rotate(315deg)}}.swagger-ui .black-90{color:rgba(0,0,0,.9)}.swagger-ui .black-80{color:rgba(0,0,0,.8)}.swagger-ui .black-70{color:rgba(0,0,0,.7)}.swagger-ui .black-60{color:rgba(0,0,0,.6)}.swagger-ui .black-50{color:rgba(0,0,0,.5)}.swagger-ui .black-40{color:rgba(0,0,0,.4)}.swagger-ui .black-30{color:rgba(0,0,0,.3)}.swagger-ui .black-20{color:rgba(0,0,0,.2)}.swagger-ui .black-10{color:rgba(0,0,0,.1)}.swagger-ui .black-05{color:rgba(0,0,0,.05)}.swagger-ui .white-90{color:hsla(0,0%,100%,.9)}.swagger-ui .white-80{color:hsla(0,0%,100%,.8)}.swagger-ui .white-70{color:hsla(0,0%,100%,.7)}.swagger-ui .white-60{color:hsla(0,0%,100%,.6)}.swagger-ui .white-50{color:hsla(0,0%,100%,.5)}.swagger-ui .white-40{color:hsla(0,0%,100%,.4)}.swagger-ui .white-30{color:hsla(0,0%,100%,.3)}.swagger-ui .white-20{color:hsla(0,0%,100%,.2)}.swagger-ui .white-10{color:hsla(0,0%,100%,.1)}.swagger-ui .black{color:#000}.swagger-ui .near-black{color:#111}.swagger-ui .dark-gray{color:#333}.swagger-ui .mid-gray{color:#555}.swagger-ui .gray{color:#777}.swagger-ui .silver{color:#999}.swagger-ui .light-silver{color:#aaa}.swagger-ui .moon-gray{color:#ccc}.swagger-ui .light-gray{color:#eee}.swagger-ui .near-white{color:#f4f4f4}.swagger-ui .white{color:#fff}.swagger-ui .dark-red{color:#e7040f}.swagger-ui .red{color:#ff4136}.swagger-ui .light-red{color:#ff725c}.swagger-ui .orange{color:#ff6300}.swagger-ui .gold{color:#ffb700}.swagger-ui .yellow{color:gold}.swagger-ui .light-yellow{color:#fbf1a9}.swagger-ui .purple{color:#5e2ca5}.swagger-ui .light-purple{color:#a463f2}.swagger-ui .dark-pink{color:#d5008f}.swagger-ui .hot-pink{color:#ff41b4}.swagger-ui .pink{color:#ff80cc}.swagger-ui .light-pink{color:#ffa3d7}.swagger-ui .dark-green{color:#137752}.swagger-ui .green{color:#19a974}.swagger-ui .light-green{color:#9eebcf}.swagger-ui .navy{color:#001b44}.swagger-ui .dark-blue{color:#00449e}.swagger-ui .blue{color:#357edd}.swagger-ui .light-blue{color:#96ccff}.swagger-ui .lightest-blue{color:#cdecff}.swagger-ui .washed-blue{color:#f6fffe}.swagger-ui .washed-green{color:#e8fdf5}.swagger-ui .washed-yellow{color:#fffceb}.swagger-ui .washed-red{color:#ffdfdf}.swagger-ui .color-inherit{color:inherit}.swagger-ui .bg-black-90{background-color:rgba(0,0,0,.9)}.swagger-ui .bg-black-80{background-color:rgba(0,0,0,.8)}.swagger-ui .bg-black-70{background-color:rgba(0,0,0,.7)}.swagger-ui .bg-black-60{background-color:rgba(0,0,0,.6)}.swagger-ui .bg-black-50{background-color:rgba(0,0,0,.5)}.swagger-ui .bg-black-40{background-color:rgba(0,0,0,.4)}.swagger-ui .bg-black-30{background-color:rgba(0,0,0,.3)}.swagger-ui .bg-black-20{background-color:rgba(0,0,0,.2)}.swagger-ui .bg-black-10{background-color:rgba(0,0,0,.1)}.swagger-ui .bg-black-05{background-color:rgba(0,0,0,.05)}.swagger-ui .bg-white-90{background-color:hsla(0,0%,100%,.9)}.swagger-ui .bg-white-80{background-color:hsla(0,0%,100%,.8)}.swagger-ui .bg-white-70{background-color:hsla(0,0%,100%,.7)}.swagger-ui .bg-white-60{background-color:hsla(0,0%,100%,.6)}.swagger-ui .bg-white-50{background-color:hsla(0,0%,100%,.5)}.swagger-ui .bg-white-40{background-color:hsla(0,0%,100%,.4)}.swagger-ui .bg-white-30{background-color:hsla(0,0%,100%,.3)}.swagger-ui .bg-white-20{background-color:hsla(0,0%,100%,.2)}.swagger-ui .bg-white-10{background-color:hsla(0,0%,100%,.1)}.swagger-ui .bg-black{background-color:#000}.swagger-ui .bg-near-black{background-color:#111}.swagger-ui .bg-dark-gray{background-color:#333}.swagger-ui .bg-mid-gray{background-color:#555}.swagger-ui .bg-gray{background-color:#777}.swagger-ui .bg-silver{background-color:#999}.swagger-ui .bg-light-silver{background-color:#aaa}.swagger-ui .bg-moon-gray{background-color:#ccc}.swagger-ui .bg-light-gray{background-color:#eee}.swagger-ui .bg-near-white{background-color:#f4f4f4}.swagger-ui .bg-white{background-color:#fff}.swagger-ui .bg-transparent{background-color:transparent}.swagger-ui .bg-dark-red{background-color:#e7040f}.swagger-ui .bg-red{background-color:#ff4136}.swagger-ui .bg-light-red{background-color:#ff725c}.swagger-ui .bg-orange{background-color:#ff6300}.swagger-ui .bg-gold{background-color:#ffb700}.swagger-ui .bg-yellow{background-color:gold}.swagger-ui .bg-light-yellow{background-color:#fbf1a9}.swagger-ui .bg-purple{background-color:#5e2ca5}.swagger-ui .bg-light-purple{background-color:#a463f2}.swagger-ui .bg-dark-pink{background-color:#d5008f}.swagger-ui .bg-hot-pink{background-color:#ff41b4}.swagger-ui .bg-pink{background-color:#ff80cc}.swagger-ui .bg-light-pink{background-color:#ffa3d7}.swagger-ui .bg-dark-green{background-color:#137752}.swagger-ui .bg-green{background-color:#19a974}.swagger-ui .bg-light-green{background-color:#9eebcf}.swagger-ui .bg-navy{background-color:#001b44}.swagger-ui .bg-dark-blue{background-color:#00449e}.swagger-ui .bg-blue{background-color:#357edd}.swagger-ui .bg-light-blue{background-color:#96ccff}.swagger-ui .bg-lightest-blue{background-color:#cdecff}.swagger-ui .bg-washed-blue{background-color:#f6fffe}.swagger-ui .bg-washed-green{background-color:#e8fdf5}.swagger-ui .bg-washed-yellow{background-color:#fffceb}.swagger-ui .bg-washed-red{background-color:#ffdfdf}.swagger-ui .bg-inherit{background-color:inherit}.swagger-ui .hover-black:focus,.swagger-ui .hover-black:hover{color:#000}.swagger-ui .hover-near-black:focus,.swagger-ui .hover-near-black:hover{color:#111}.swagger-ui .hover-dark-gray:focus,.swagger-ui .hover-dark-gray:hover{color:#333}.swagger-ui .hover-mid-gray:focus,.swagger-ui .hover-mid-gray:hover{color:#555}.swagger-ui .hover-gray:focus,.swagger-ui .hover-gray:hover{color:#777}.swagger-ui .hover-silver:focus,.swagger-ui .hover-silver:hover{color:#999}.swagger-ui .hover-light-silver:focus,.swagger-ui .hover-light-silver:hover{color:#aaa}.swagger-ui .hover-moon-gray:focus,.swagger-ui .hover-moon-gray:hover{color:#ccc}.swagger-ui .hover-light-gray:focus,.swagger-ui .hover-light-gray:hover{color:#eee}.swagger-ui .hover-near-white:focus,.swagger-ui .hover-near-white:hover{color:#f4f4f4}.swagger-ui .hover-white:focus,.swagger-ui .hover-white:hover{color:#fff}.swagger-ui .hover-black-90:focus,.swagger-ui .hover-black-90:hover{color:rgba(0,0,0,.9)}.swagger-ui .hover-black-80:focus,.swagger-ui .hover-black-80:hover{color:rgba(0,0,0,.8)}.swagger-ui .hover-black-70:focus,.swagger-ui .hover-black-70:hover{color:rgba(0,0,0,.7)}.swagger-ui .hover-black-60:focus,.swagger-ui .hover-black-60:hover{color:rgba(0,0,0,.6)}.swagger-ui .hover-black-50:focus,.swagger-ui .hover-black-50:hover{color:rgba(0,0,0,.5)}.swagger-ui .hover-black-40:focus,.swagger-ui .hover-black-40:hover{color:rgba(0,0,0,.4)}.swagger-ui .hover-black-30:focus,.swagger-ui .hover-black-30:hover{color:rgba(0,0,0,.3)}.swagger-ui .hover-black-20:focus,.swagger-ui .hover-black-20:hover{color:rgba(0,0,0,.2)}.swagger-ui .hover-black-10:focus,.swagger-ui .hover-black-10:hover{color:rgba(0,0,0,.1)}.swagger-ui .hover-white-90:focus,.swagger-ui .hover-white-90:hover{color:hsla(0,0%,100%,.9)}.swagger-ui .hover-white-80:focus,.swagger-ui .hover-white-80:hover{color:hsla(0,0%,100%,.8)}.swagger-ui .hover-white-70:focus,.swagger-ui .hover-white-70:hover{color:hsla(0,0%,100%,.7)}.swagger-ui .hover-white-60:focus,.swagger-ui .hover-white-60:hover{color:hsla(0,0%,100%,.6)}.swagger-ui .hover-white-50:focus,.swagger-ui .hover-white-50:hover{color:hsla(0,0%,100%,.5)}.swagger-ui .hover-white-40:focus,.swagger-ui .hover-white-40:hover{color:hsla(0,0%,100%,.4)}.swagger-ui .hover-white-30:focus,.swagger-ui .hover-white-30:hover{color:hsla(0,0%,100%,.3)}.swagger-ui .hover-white-20:focus,.swagger-ui .hover-white-20:hover{color:hsla(0,0%,100%,.2)}.swagger-ui .hover-white-10:focus,.swagger-ui .hover-white-10:hover{color:hsla(0,0%,100%,.1)}.swagger-ui .hover-inherit:focus,.swagger-ui .hover-inherit:hover{color:inherit}.swagger-ui .hover-bg-black:focus,.swagger-ui .hover-bg-black:hover{background-color:#000}.swagger-ui .hover-bg-near-black:focus,.swagger-ui .hover-bg-near-black:hover{background-color:#111}.swagger-ui .hover-bg-dark-gray:focus,.swagger-ui .hover-bg-dark-gray:hover{background-color:#333}.swagger-ui .hover-bg-mid-gray:focus,.swagger-ui .hover-bg-mid-gray:hover{background-color:#555}.swagger-ui .hover-bg-gray:focus,.swagger-ui .hover-bg-gray:hover{background-color:#777}.swagger-ui .hover-bg-silver:focus,.swagger-ui .hover-bg-silver:hover{background-color:#999}.swagger-ui .hover-bg-light-silver:focus,.swagger-ui .hover-bg-light-silver:hover{background-color:#aaa}.swagger-ui .hover-bg-moon-gray:focus,.swagger-ui .hover-bg-moon-gray:hover{background-color:#ccc}.swagger-ui .hover-bg-light-gray:focus,.swagger-ui .hover-bg-light-gray:hover{background-color:#eee}.swagger-ui .hover-bg-near-white:focus,.swagger-ui .hover-bg-near-white:hover{background-color:#f4f4f4}.swagger-ui .hover-bg-white:focus,.swagger-ui .hover-bg-white:hover{background-color:#fff}.swagger-ui .hover-bg-transparent:focus,.swagger-ui .hover-bg-transparent:hover{background-color:transparent}.swagger-ui .hover-bg-black-90:focus,.swagger-ui .hover-bg-black-90:hover{background-color:rgba(0,0,0,.9)}.swagger-ui .hover-bg-black-80:focus,.swagger-ui .hover-bg-black-80:hover{background-color:rgba(0,0,0,.8)}.swagger-ui .hover-bg-black-70:focus,.swagger-ui .hover-bg-black-70:hover{background-color:rgba(0,0,0,.7)}.swagger-ui .hover-bg-black-60:focus,.swagger-ui .hover-bg-black-60:hover{background-color:rgba(0,0,0,.6)}.swagger-ui .hover-bg-black-50:focus,.swagger-ui .hover-bg-black-50:hover{background-color:rgba(0,0,0,.5)}.swagger-ui .hover-bg-black-40:focus,.swagger-ui .hover-bg-black-40:hover{background-color:rgba(0,0,0,.4)}.swagger-ui .hover-bg-black-30:focus,.swagger-ui .hover-bg-black-30:hover{background-color:rgba(0,0,0,.3)}.swagger-ui .hover-bg-black-20:focus,.swagger-ui .hover-bg-black-20:hover{background-color:rgba(0,0,0,.2)}.swagger-ui .hover-bg-black-10:focus,.swagger-ui .hover-bg-black-10:hover{background-color:rgba(0,0,0,.1)}.swagger-ui .hover-bg-white-90:focus,.swagger-ui .hover-bg-white-90:hover{background-color:hsla(0,0%,100%,.9)}.swagger-ui .hover-bg-white-80:focus,.swagger-ui .hover-bg-white-80:hover{background-color:hsla(0,0%,100%,.8)}.swagger-ui .hover-bg-white-70:focus,.swagger-ui .hover-bg-white-70:hover{background-color:hsla(0,0%,100%,.7)}.swagger-ui .hover-bg-white-60:focus,.swagger-ui .hover-bg-white-60:hover{background-color:hsla(0,0%,100%,.6)}.swagger-ui .hover-bg-white-50:focus,.swagger-ui .hover-bg-white-50:hover{background-color:hsla(0,0%,100%,.5)}.swagger-ui .hover-bg-white-40:focus,.swagger-ui .hover-bg-white-40:hover{background-color:hsla(0,0%,100%,.4)}.swagger-ui .hover-bg-white-30:focus,.swagger-ui .hover-bg-white-30:hover{background-color:hsla(0,0%,100%,.3)}.swagger-ui .hover-bg-white-20:focus,.swagger-ui .hover-bg-white-20:hover{background-color:hsla(0,0%,100%,.2)}.swagger-ui .hover-bg-white-10:focus,.swagger-ui .hover-bg-white-10:hover{background-color:hsla(0,0%,100%,.1)}.swagger-ui .hover-dark-red:focus,.swagger-ui .hover-dark-red:hover{color:#e7040f}.swagger-ui .hover-red:focus,.swagger-ui .hover-red:hover{color:#ff4136}.swagger-ui .hover-light-red:focus,.swagger-ui .hover-light-red:hover{color:#ff725c}.swagger-ui .hover-orange:focus,.swagger-ui .hover-orange:hover{color:#ff6300}.swagger-ui .hover-gold:focus,.swagger-ui .hover-gold:hover{color:#ffb700}.swagger-ui .hover-yellow:focus,.swagger-ui .hover-yellow:hover{color:gold}.swagger-ui .hover-light-yellow:focus,.swagger-ui .hover-light-yellow:hover{color:#fbf1a9}.swagger-ui .hover-purple:focus,.swagger-ui .hover-purple:hover{color:#5e2ca5}.swagger-ui .hover-light-purple:focus,.swagger-ui .hover-light-purple:hover{color:#a463f2}.swagger-ui .hover-dark-pink:focus,.swagger-ui .hover-dark-pink:hover{color:#d5008f}.swagger-ui .hover-hot-pink:focus,.swagger-ui .hover-hot-pink:hover{color:#ff41b4}.swagger-ui .hover-pink:focus,.swagger-ui .hover-pink:hover{color:#ff80cc}.swagger-ui .hover-light-pink:focus,.swagger-ui .hover-light-pink:hover{color:#ffa3d7}.swagger-ui .hover-dark-green:focus,.swagger-ui .hover-dark-green:hover{color:#137752}.swagger-ui .hover-green:focus,.swagger-ui .hover-green:hover{color:#19a974}.swagger-ui .hover-light-green:focus,.swagger-ui .hover-light-green:hover{color:#9eebcf}.swagger-ui .hover-navy:focus,.swagger-ui .hover-navy:hover{color:#001b44}.swagger-ui .hover-dark-blue:focus,.swagger-ui .hover-dark-blue:hover{color:#00449e}.swagger-ui .hover-blue:focus,.swagger-ui .hover-blue:hover{color:#357edd}.swagger-ui .hover-light-blue:focus,.swagger-ui .hover-light-blue:hover{color:#96ccff}.swagger-ui .hover-lightest-blue:focus,.swagger-ui .hover-lightest-blue:hover{color:#cdecff}.swagger-ui .hover-washed-blue:focus,.swagger-ui .hover-washed-blue:hover{color:#f6fffe}.swagger-ui .hover-washed-green:focus,.swagger-ui .hover-washed-green:hover{color:#e8fdf5}.swagger-ui .hover-washed-yellow:focus,.swagger-ui .hover-washed-yellow:hover{color:#fffceb}.swagger-ui .hover-washed-red:focus,.swagger-ui .hover-washed-red:hover{color:#ffdfdf}.swagger-ui .hover-bg-dark-red:focus,.swagger-ui .hover-bg-dark-red:hover{background-color:#e7040f}.swagger-ui .hover-bg-red:focus,.swagger-ui .hover-bg-red:hover{background-color:#ff4136}.swagger-ui .hover-bg-light-red:focus,.swagger-ui .hover-bg-light-red:hover{background-color:#ff725c}.swagger-ui .hover-bg-orange:focus,.swagger-ui .hover-bg-orange:hover{background-color:#ff6300}.swagger-ui .hover-bg-gold:focus,.swagger-ui .hover-bg-gold:hover{background-color:#ffb700}.swagger-ui .hover-bg-yellow:focus,.swagger-ui .hover-bg-yellow:hover{background-color:gold}.swagger-ui .hover-bg-light-yellow:focus,.swagger-ui .hover-bg-light-yellow:hover{background-color:#fbf1a9}.swagger-ui .hover-bg-purple:focus,.swagger-ui .hover-bg-purple:hover{background-color:#5e2ca5}.swagger-ui .hover-bg-light-purple:focus,.swagger-ui .hover-bg-light-purple:hover{background-color:#a463f2}.swagger-ui .hover-bg-dark-pink:focus,.swagger-ui .hover-bg-dark-pink:hover{background-color:#d5008f}.swagger-ui .hover-bg-hot-pink:focus,.swagger-ui .hover-bg-hot-pink:hover{background-color:#ff41b4}.swagger-ui .hover-bg-pink:focus,.swagger-ui .hover-bg-pink:hover{background-color:#ff80cc}.swagger-ui .hover-bg-light-pink:focus,.swagger-ui .hover-bg-light-pink:hover{background-color:#ffa3d7}.swagger-ui .hover-bg-dark-green:focus,.swagger-ui .hover-bg-dark-green:hover{background-color:#137752}.swagger-ui .hover-bg-green:focus,.swagger-ui .hover-bg-green:hover{background-color:#19a974}.swagger-ui .hover-bg-light-green:focus,.swagger-ui .hover-bg-light-green:hover{background-color:#9eebcf}.swagger-ui .hover-bg-navy:focus,.swagger-ui .hover-bg-navy:hover{background-color:#001b44}.swagger-ui .hover-bg-dark-blue:focus,.swagger-ui .hover-bg-dark-blue:hover{background-color:#00449e}.swagger-ui .hover-bg-blue:focus,.swagger-ui .hover-bg-blue:hover{background-color:#357edd}.swagger-ui .hover-bg-light-blue:focus,.swagger-ui .hover-bg-light-blue:hover{background-color:#96ccff}.swagger-ui .hover-bg-lightest-blue:focus,.swagger-ui .hover-bg-lightest-blue:hover{background-color:#cdecff}.swagger-ui .hover-bg-washed-blue:focus,.swagger-ui .hover-bg-washed-blue:hover{background-color:#f6fffe}.swagger-ui .hover-bg-washed-green:focus,.swagger-ui .hover-bg-washed-green:hover{background-color:#e8fdf5}.swagger-ui .hover-bg-washed-yellow:focus,.swagger-ui .hover-bg-washed-yellow:hover{background-color:#fffceb}.swagger-ui .hover-bg-washed-red:focus,.swagger-ui .hover-bg-washed-red:hover{background-color:#ffdfdf}.swagger-ui .hover-bg-inherit:focus,.swagger-ui .hover-bg-inherit:hover{background-color:inherit}.swagger-ui .pa0{padding:0}.swagger-ui .pa1{padding:.25rem}.swagger-ui .pa2{padding:.5rem}.swagger-ui .pa3{padding:1rem}.swagger-ui .pa4{padding:2rem}.swagger-ui .pa5{padding:4rem}.swagger-ui .pa6{padding:8rem}.swagger-ui .pa7{padding:16rem}.swagger-ui .pl0{padding-left:0}.swagger-ui .pl1{padding-left:.25rem}.swagger-ui .pl2{padding-left:.5rem}.swagger-ui .pl3{padding-left:1rem}.swagger-ui .pl4{padding-left:2rem}.swagger-ui .pl5{padding-left:4rem}.swagger-ui .pl6{padding-left:8rem}.swagger-ui .pl7{padding-left:16rem}.swagger-ui .pr0{padding-right:0}.swagger-ui .pr1{padding-right:.25rem}.swagger-ui .pr2{padding-right:.5rem}.swagger-ui .pr3{padding-right:1rem}.swagger-ui .pr4{padding-right:2rem}.swagger-ui .pr5{padding-right:4rem}.swagger-ui .pr6{padding-right:8rem}.swagger-ui .pr7{padding-right:16rem}.swagger-ui .pb0{padding-bottom:0}.swagger-ui .pb1{padding-bottom:.25rem}.swagger-ui .pb2{padding-bottom:.5rem}.swagger-ui .pb3{padding-bottom:1rem}.swagger-ui .pb4{padding-bottom:2rem}.swagger-ui .pb5{padding-bottom:4rem}.swagger-ui .pb6{padding-bottom:8rem}.swagger-ui .pb7{padding-bottom:16rem}.swagger-ui .pt0{padding-top:0}.swagger-ui .pt1{padding-top:.25rem}.swagger-ui .pt2{padding-top:.5rem}.swagger-ui .pt3{padding-top:1rem}.swagger-ui .pt4{padding-top:2rem}.swagger-ui .pt5{padding-top:4rem}.swagger-ui .pt6{padding-top:8rem}.swagger-ui .pt7{padding-top:16rem}.swagger-ui .pv0{padding-top:0;padding-bottom:0}.swagger-ui .pv1{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0{padding-left:0;padding-right:0}.swagger-ui .ph1{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0{margin:0}.swagger-ui .ma1{margin:.25rem}.swagger-ui .ma2{margin:.5rem}.swagger-ui .ma3{margin:1rem}.swagger-ui .ma4{margin:2rem}.swagger-ui .ma5{margin:4rem}.swagger-ui .ma6{margin:8rem}.swagger-ui .ma7{margin:16rem}.swagger-ui .ml0{margin-left:0}.swagger-ui .ml1{margin-left:.25rem}.swagger-ui .ml2{margin-left:.5rem}.swagger-ui .ml3{margin-left:1rem}.swagger-ui .ml4{margin-left:2rem}.swagger-ui .ml5{margin-left:4rem}.swagger-ui .ml6{margin-left:8rem}.swagger-ui .ml7{margin-left:16rem}.swagger-ui .mr0{margin-right:0}.swagger-ui .mr1{margin-right:.25rem}.swagger-ui .mr2{margin-right:.5rem}.swagger-ui .mr3{margin-right:1rem}.swagger-ui .mr4{margin-right:2rem}.swagger-ui .mr5{margin-right:4rem}.swagger-ui .mr6{margin-right:8rem}.swagger-ui .mr7{margin-right:16rem}.swagger-ui .mb0{margin-bottom:0}.swagger-ui .mb1{margin-bottom:.25rem}.swagger-ui .mb2{margin-bottom:.5rem}.swagger-ui .mb3{margin-bottom:1rem}.swagger-ui .mb4{margin-bottom:2rem}.swagger-ui .mb5{margin-bottom:4rem}.swagger-ui .mb6{margin-bottom:8rem}.swagger-ui .mb7{margin-bottom:16rem}.swagger-ui .mt0{margin-top:0}.swagger-ui .mt1{margin-top:.25rem}.swagger-ui .mt2{margin-top:.5rem}.swagger-ui .mt3{margin-top:1rem}.swagger-ui .mt4{margin-top:2rem}.swagger-ui .mt5{margin-top:4rem}.swagger-ui .mt6{margin-top:8rem}.swagger-ui .mt7{margin-top:16rem}.swagger-ui .mv0{margin-top:0;margin-bottom:0}.swagger-ui .mv1{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0{margin-left:0;margin-right:0}.swagger-ui .mh1{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7{margin-left:16rem;margin-right:16rem}@media screen and (min-width:30em){.swagger-ui .pa0-ns{padding:0}.swagger-ui .pa1-ns{padding:.25rem}.swagger-ui .pa2-ns{padding:.5rem}.swagger-ui .pa3-ns{padding:1rem}.swagger-ui .pa4-ns{padding:2rem}.swagger-ui .pa5-ns{padding:4rem}.swagger-ui .pa6-ns{padding:8rem}.swagger-ui .pa7-ns{padding:16rem}.swagger-ui .pl0-ns{padding-left:0}.swagger-ui .pl1-ns{padding-left:.25rem}.swagger-ui .pl2-ns{padding-left:.5rem}.swagger-ui .pl3-ns{padding-left:1rem}.swagger-ui .pl4-ns{padding-left:2rem}.swagger-ui .pl5-ns{padding-left:4rem}.swagger-ui .pl6-ns{padding-left:8rem}.swagger-ui .pl7-ns{padding-left:16rem}.swagger-ui .pr0-ns{padding-right:0}.swagger-ui .pr1-ns{padding-right:.25rem}.swagger-ui .pr2-ns{padding-right:.5rem}.swagger-ui .pr3-ns{padding-right:1rem}.swagger-ui .pr4-ns{padding-right:2rem}.swagger-ui .pr5-ns{padding-right:4rem}.swagger-ui .pr6-ns{padding-right:8rem}.swagger-ui .pr7-ns{padding-right:16rem}.swagger-ui .pb0-ns{padding-bottom:0}.swagger-ui .pb1-ns{padding-bottom:.25rem}.swagger-ui .pb2-ns{padding-bottom:.5rem}.swagger-ui .pb3-ns{padding-bottom:1rem}.swagger-ui .pb4-ns{padding-bottom:2rem}.swagger-ui .pb5-ns{padding-bottom:4rem}.swagger-ui .pb6-ns{padding-bottom:8rem}.swagger-ui .pb7-ns{padding-bottom:16rem}.swagger-ui .pt0-ns{padding-top:0}.swagger-ui .pt1-ns{padding-top:.25rem}.swagger-ui .pt2-ns{padding-top:.5rem}.swagger-ui .pt3-ns{padding-top:1rem}.swagger-ui .pt4-ns{padding-top:2rem}.swagger-ui .pt5-ns{padding-top:4rem}.swagger-ui .pt6-ns{padding-top:8rem}.swagger-ui .pt7-ns{padding-top:16rem}.swagger-ui .pv0-ns{padding-top:0;padding-bottom:0}.swagger-ui .pv1-ns{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-ns{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-ns{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-ns{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-ns{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-ns{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-ns{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-ns{padding-left:0;padding-right:0}.swagger-ui .ph1-ns{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-ns{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-ns{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-ns{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-ns{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-ns{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-ns{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-ns{margin:0}.swagger-ui .ma1-ns{margin:.25rem}.swagger-ui .ma2-ns{margin:.5rem}.swagger-ui .ma3-ns{margin:1rem}.swagger-ui .ma4-ns{margin:2rem}.swagger-ui .ma5-ns{margin:4rem}.swagger-ui .ma6-ns{margin:8rem}.swagger-ui .ma7-ns{margin:16rem}.swagger-ui .ml0-ns{margin-left:0}.swagger-ui .ml1-ns{margin-left:.25rem}.swagger-ui .ml2-ns{margin-left:.5rem}.swagger-ui .ml3-ns{margin-left:1rem}.swagger-ui .ml4-ns{margin-left:2rem}.swagger-ui .ml5-ns{margin-left:4rem}.swagger-ui .ml6-ns{margin-left:8rem}.swagger-ui .ml7-ns{margin-left:16rem}.swagger-ui .mr0-ns{margin-right:0}.swagger-ui .mr1-ns{margin-right:.25rem}.swagger-ui .mr2-ns{margin-right:.5rem}.swagger-ui .mr3-ns{margin-right:1rem}.swagger-ui .mr4-ns{margin-right:2rem}.swagger-ui .mr5-ns{margin-right:4rem}.swagger-ui .mr6-ns{margin-right:8rem}.swagger-ui .mr7-ns{margin-right:16rem}.swagger-ui .mb0-ns{margin-bottom:0}.swagger-ui .mb1-ns{margin-bottom:.25rem}.swagger-ui .mb2-ns{margin-bottom:.5rem}.swagger-ui .mb3-ns{margin-bottom:1rem}.swagger-ui .mb4-ns{margin-bottom:2rem}.swagger-ui .mb5-ns{margin-bottom:4rem}.swagger-ui .mb6-ns{margin-bottom:8rem}.swagger-ui .mb7-ns{margin-bottom:16rem}.swagger-ui .mt0-ns{margin-top:0}.swagger-ui .mt1-ns{margin-top:.25rem}.swagger-ui .mt2-ns{margin-top:.5rem}.swagger-ui .mt3-ns{margin-top:1rem}.swagger-ui .mt4-ns{margin-top:2rem}.swagger-ui .mt5-ns{margin-top:4rem}.swagger-ui .mt6-ns{margin-top:8rem}.swagger-ui .mt7-ns{margin-top:16rem}.swagger-ui .mv0-ns{margin-top:0;margin-bottom:0}.swagger-ui .mv1-ns{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-ns{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-ns{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-ns{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-ns{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-ns{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-ns{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-ns{margin-left:0;margin-right:0}.swagger-ui .mh1-ns{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-ns{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-ns{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-ns{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-ns{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-ns{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-ns{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .pa0-m{padding:0}.swagger-ui .pa1-m{padding:.25rem}.swagger-ui .pa2-m{padding:.5rem}.swagger-ui .pa3-m{padding:1rem}.swagger-ui .pa4-m{padding:2rem}.swagger-ui .pa5-m{padding:4rem}.swagger-ui .pa6-m{padding:8rem}.swagger-ui .pa7-m{padding:16rem}.swagger-ui .pl0-m{padding-left:0}.swagger-ui .pl1-m{padding-left:.25rem}.swagger-ui .pl2-m{padding-left:.5rem}.swagger-ui .pl3-m{padding-left:1rem}.swagger-ui .pl4-m{padding-left:2rem}.swagger-ui .pl5-m{padding-left:4rem}.swagger-ui .pl6-m{padding-left:8rem}.swagger-ui .pl7-m{padding-left:16rem}.swagger-ui .pr0-m{padding-right:0}.swagger-ui .pr1-m{padding-right:.25rem}.swagger-ui .pr2-m{padding-right:.5rem}.swagger-ui .pr3-m{padding-right:1rem}.swagger-ui .pr4-m{padding-right:2rem}.swagger-ui .pr5-m{padding-right:4rem}.swagger-ui .pr6-m{padding-right:8rem}.swagger-ui .pr7-m{padding-right:16rem}.swagger-ui .pb0-m{padding-bottom:0}.swagger-ui .pb1-m{padding-bottom:.25rem}.swagger-ui .pb2-m{padding-bottom:.5rem}.swagger-ui .pb3-m{padding-bottom:1rem}.swagger-ui .pb4-m{padding-bottom:2rem}.swagger-ui .pb5-m{padding-bottom:4rem}.swagger-ui .pb6-m{padding-bottom:8rem}.swagger-ui .pb7-m{padding-bottom:16rem}.swagger-ui .pt0-m{padding-top:0}.swagger-ui .pt1-m{padding-top:.25rem}.swagger-ui .pt2-m{padding-top:.5rem}.swagger-ui .pt3-m{padding-top:1rem}.swagger-ui .pt4-m{padding-top:2rem}.swagger-ui .pt5-m{padding-top:4rem}.swagger-ui .pt6-m{padding-top:8rem}.swagger-ui .pt7-m{padding-top:16rem}.swagger-ui .pv0-m{padding-top:0;padding-bottom:0}.swagger-ui .pv1-m{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-m{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-m{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-m{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-m{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-m{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-m{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-m{padding-left:0;padding-right:0}.swagger-ui .ph1-m{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-m{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-m{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-m{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-m{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-m{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-m{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-m{margin:0}.swagger-ui .ma1-m{margin:.25rem}.swagger-ui .ma2-m{margin:.5rem}.swagger-ui .ma3-m{margin:1rem}.swagger-ui .ma4-m{margin:2rem}.swagger-ui .ma5-m{margin:4rem}.swagger-ui .ma6-m{margin:8rem}.swagger-ui .ma7-m{margin:16rem}.swagger-ui .ml0-m{margin-left:0}.swagger-ui .ml1-m{margin-left:.25rem}.swagger-ui .ml2-m{margin-left:.5rem}.swagger-ui .ml3-m{margin-left:1rem}.swagger-ui .ml4-m{margin-left:2rem}.swagger-ui .ml5-m{margin-left:4rem}.swagger-ui .ml6-m{margin-left:8rem}.swagger-ui .ml7-m{margin-left:16rem}.swagger-ui .mr0-m{margin-right:0}.swagger-ui .mr1-m{margin-right:.25rem}.swagger-ui .mr2-m{margin-right:.5rem}.swagger-ui .mr3-m{margin-right:1rem}.swagger-ui .mr4-m{margin-right:2rem}.swagger-ui .mr5-m{margin-right:4rem}.swagger-ui .mr6-m{margin-right:8rem}.swagger-ui .mr7-m{margin-right:16rem}.swagger-ui .mb0-m{margin-bottom:0}.swagger-ui .mb1-m{margin-bottom:.25rem}.swagger-ui .mb2-m{margin-bottom:.5rem}.swagger-ui .mb3-m{margin-bottom:1rem}.swagger-ui .mb4-m{margin-bottom:2rem}.swagger-ui .mb5-m{margin-bottom:4rem}.swagger-ui .mb6-m{margin-bottom:8rem}.swagger-ui .mb7-m{margin-bottom:16rem}.swagger-ui .mt0-m{margin-top:0}.swagger-ui .mt1-m{margin-top:.25rem}.swagger-ui .mt2-m{margin-top:.5rem}.swagger-ui .mt3-m{margin-top:1rem}.swagger-ui .mt4-m{margin-top:2rem}.swagger-ui .mt5-m{margin-top:4rem}.swagger-ui .mt6-m{margin-top:8rem}.swagger-ui .mt7-m{margin-top:16rem}.swagger-ui .mv0-m{margin-top:0;margin-bottom:0}.swagger-ui .mv1-m{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-m{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-m{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-m{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-m{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-m{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-m{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-m{margin-left:0;margin-right:0}.swagger-ui .mh1-m{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-m{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-m{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-m{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-m{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-m{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-m{margin-left:16rem;margin-right:16rem}}@media screen and (min-width:60em){.swagger-ui .pa0-l{padding:0}.swagger-ui .pa1-l{padding:.25rem}.swagger-ui .pa2-l{padding:.5rem}.swagger-ui .pa3-l{padding:1rem}.swagger-ui .pa4-l{padding:2rem}.swagger-ui .pa5-l{padding:4rem}.swagger-ui .pa6-l{padding:8rem}.swagger-ui .pa7-l{padding:16rem}.swagger-ui .pl0-l{padding-left:0}.swagger-ui .pl1-l{padding-left:.25rem}.swagger-ui .pl2-l{padding-left:.5rem}.swagger-ui .pl3-l{padding-left:1rem}.swagger-ui .pl4-l{padding-left:2rem}.swagger-ui .pl5-l{padding-left:4rem}.swagger-ui .pl6-l{padding-left:8rem}.swagger-ui .pl7-l{padding-left:16rem}.swagger-ui .pr0-l{padding-right:0}.swagger-ui .pr1-l{padding-right:.25rem}.swagger-ui .pr2-l{padding-right:.5rem}.swagger-ui .pr3-l{padding-right:1rem}.swagger-ui .pr4-l{padding-right:2rem}.swagger-ui .pr5-l{padding-right:4rem}.swagger-ui .pr6-l{padding-right:8rem}.swagger-ui .pr7-l{padding-right:16rem}.swagger-ui .pb0-l{padding-bottom:0}.swagger-ui .pb1-l{padding-bottom:.25rem}.swagger-ui .pb2-l{padding-bottom:.5rem}.swagger-ui .pb3-l{padding-bottom:1rem}.swagger-ui .pb4-l{padding-bottom:2rem}.swagger-ui .pb5-l{padding-bottom:4rem}.swagger-ui .pb6-l{padding-bottom:8rem}.swagger-ui .pb7-l{padding-bottom:16rem}.swagger-ui .pt0-l{padding-top:0}.swagger-ui .pt1-l{padding-top:.25rem}.swagger-ui .pt2-l{padding-top:.5rem}.swagger-ui .pt3-l{padding-top:1rem}.swagger-ui .pt4-l{padding-top:2rem}.swagger-ui .pt5-l{padding-top:4rem}.swagger-ui .pt6-l{padding-top:8rem}.swagger-ui .pt7-l{padding-top:16rem}.swagger-ui .pv0-l{padding-top:0;padding-bottom:0}.swagger-ui .pv1-l{padding-top:.25rem;padding-bottom:.25rem}.swagger-ui .pv2-l{padding-top:.5rem;padding-bottom:.5rem}.swagger-ui .pv3-l{padding-top:1rem;padding-bottom:1rem}.swagger-ui .pv4-l{padding-top:2rem;padding-bottom:2rem}.swagger-ui .pv5-l{padding-top:4rem;padding-bottom:4rem}.swagger-ui .pv6-l{padding-top:8rem;padding-bottom:8rem}.swagger-ui .pv7-l{padding-top:16rem;padding-bottom:16rem}.swagger-ui .ph0-l{padding-left:0;padding-right:0}.swagger-ui .ph1-l{padding-left:.25rem;padding-right:.25rem}.swagger-ui .ph2-l{padding-left:.5rem;padding-right:.5rem}.swagger-ui .ph3-l{padding-left:1rem;padding-right:1rem}.swagger-ui .ph4-l{padding-left:2rem;padding-right:2rem}.swagger-ui .ph5-l{padding-left:4rem;padding-right:4rem}.swagger-ui .ph6-l{padding-left:8rem;padding-right:8rem}.swagger-ui .ph7-l{padding-left:16rem;padding-right:16rem}.swagger-ui .ma0-l{margin:0}.swagger-ui .ma1-l{margin:.25rem}.swagger-ui .ma2-l{margin:.5rem}.swagger-ui .ma3-l{margin:1rem}.swagger-ui .ma4-l{margin:2rem}.swagger-ui .ma5-l{margin:4rem}.swagger-ui .ma6-l{margin:8rem}.swagger-ui .ma7-l{margin:16rem}.swagger-ui .ml0-l{margin-left:0}.swagger-ui .ml1-l{margin-left:.25rem}.swagger-ui .ml2-l{margin-left:.5rem}.swagger-ui .ml3-l{margin-left:1rem}.swagger-ui .ml4-l{margin-left:2rem}.swagger-ui .ml5-l{margin-left:4rem}.swagger-ui .ml6-l{margin-left:8rem}.swagger-ui .ml7-l{margin-left:16rem}.swagger-ui .mr0-l{margin-right:0}.swagger-ui .mr1-l{margin-right:.25rem}.swagger-ui .mr2-l{margin-right:.5rem}.swagger-ui .mr3-l{margin-right:1rem}.swagger-ui .mr4-l{margin-right:2rem}.swagger-ui .mr5-l{margin-right:4rem}.swagger-ui .mr6-l{margin-right:8rem}.swagger-ui .mr7-l{margin-right:16rem}.swagger-ui .mb0-l{margin-bottom:0}.swagger-ui .mb1-l{margin-bottom:.25rem}.swagger-ui .mb2-l{margin-bottom:.5rem}.swagger-ui .mb3-l{margin-bottom:1rem}.swagger-ui .mb4-l{margin-bottom:2rem}.swagger-ui .mb5-l{margin-bottom:4rem}.swagger-ui .mb6-l{margin-bottom:8rem}.swagger-ui .mb7-l{margin-bottom:16rem}.swagger-ui .mt0-l{margin-top:0}.swagger-ui .mt1-l{margin-top:.25rem}.swagger-ui .mt2-l{margin-top:.5rem}.swagger-ui .mt3-l{margin-top:1rem}.swagger-ui .mt4-l{margin-top:2rem}.swagger-ui .mt5-l{margin-top:4rem}.swagger-ui .mt6-l{margin-top:8rem}.swagger-ui .mt7-l{margin-top:16rem}.swagger-ui .mv0-l{margin-top:0;margin-bottom:0}.swagger-ui .mv1-l{margin-top:.25rem;margin-bottom:.25rem}.swagger-ui .mv2-l{margin-top:.5rem;margin-bottom:.5rem}.swagger-ui .mv3-l{margin-top:1rem;margin-bottom:1rem}.swagger-ui .mv4-l{margin-top:2rem;margin-bottom:2rem}.swagger-ui .mv5-l{margin-top:4rem;margin-bottom:4rem}.swagger-ui .mv6-l{margin-top:8rem;margin-bottom:8rem}.swagger-ui .mv7-l{margin-top:16rem;margin-bottom:16rem}.swagger-ui .mh0-l{margin-left:0;margin-right:0}.swagger-ui .mh1-l{margin-left:.25rem;margin-right:.25rem}.swagger-ui .mh2-l{margin-left:.5rem;margin-right:.5rem}.swagger-ui .mh3-l{margin-left:1rem;margin-right:1rem}.swagger-ui .mh4-l{margin-left:2rem;margin-right:2rem}.swagger-ui .mh5-l{margin-left:4rem;margin-right:4rem}.swagger-ui .mh6-l{margin-left:8rem;margin-right:8rem}.swagger-ui .mh7-l{margin-left:16rem;margin-right:16rem}}.swagger-ui .na1{margin:-.25rem}.swagger-ui .na2{margin:-.5rem}.swagger-ui .na3{margin:-1rem}.swagger-ui .na4{margin:-2rem}.swagger-ui .na5{margin:-4rem}.swagger-ui .na6{margin:-8rem}.swagger-ui .na7{margin:-16rem}.swagger-ui .nl1{margin-left:-.25rem}.swagger-ui .nl2{margin-left:-.5rem}.swagger-ui .nl3{margin-left:-1rem}.swagger-ui .nl4{margin-left:-2rem}.swagger-ui .nl5{margin-left:-4rem}.swagger-ui .nl6{margin-left:-8rem}.swagger-ui .nl7{margin-left:-16rem}.swagger-ui .nr1{margin-right:-.25rem}.swagger-ui .nr2{margin-right:-.5rem}.swagger-ui .nr3{margin-right:-1rem}.swagger-ui .nr4{margin-right:-2rem}.swagger-ui .nr5{margin-right:-4rem}.swagger-ui .nr6{margin-right:-8rem}.swagger-ui .nr7{margin-right:-16rem}.swagger-ui .nb1{margin-bottom:-.25rem}.swagger-ui .nb2{margin-bottom:-.5rem}.swagger-ui .nb3{margin-bottom:-1rem}.swagger-ui .nb4{margin-bottom:-2rem}.swagger-ui .nb5{margin-bottom:-4rem}.swagger-ui .nb6{margin-bottom:-8rem}.swagger-ui .nb7{margin-bottom:-16rem}.swagger-ui .nt1{margin-top:-.25rem}.swagger-ui .nt2{margin-top:-.5rem}.swagger-ui .nt3{margin-top:-1rem}.swagger-ui .nt4{margin-top:-2rem}.swagger-ui .nt5{margin-top:-4rem}.swagger-ui .nt6{margin-top:-8rem}.swagger-ui .nt7{margin-top:-16rem}@media screen and (min-width:30em){.swagger-ui .na1-ns{margin:-.25rem}.swagger-ui .na2-ns{margin:-.5rem}.swagger-ui .na3-ns{margin:-1rem}.swagger-ui .na4-ns{margin:-2rem}.swagger-ui .na5-ns{margin:-4rem}.swagger-ui .na6-ns{margin:-8rem}.swagger-ui .na7-ns{margin:-16rem}.swagger-ui .nl1-ns{margin-left:-.25rem}.swagger-ui .nl2-ns{margin-left:-.5rem}.swagger-ui .nl3-ns{margin-left:-1rem}.swagger-ui .nl4-ns{margin-left:-2rem}.swagger-ui .nl5-ns{margin-left:-4rem}.swagger-ui .nl6-ns{margin-left:-8rem}.swagger-ui .nl7-ns{margin-left:-16rem}.swagger-ui .nr1-ns{margin-right:-.25rem}.swagger-ui .nr2-ns{margin-right:-.5rem}.swagger-ui .nr3-ns{margin-right:-1rem}.swagger-ui .nr4-ns{margin-right:-2rem}.swagger-ui .nr5-ns{margin-right:-4rem}.swagger-ui .nr6-ns{margin-right:-8rem}.swagger-ui .nr7-ns{margin-right:-16rem}.swagger-ui .nb1-ns{margin-bottom:-.25rem}.swagger-ui .nb2-ns{margin-bottom:-.5rem}.swagger-ui .nb3-ns{margin-bottom:-1rem}.swagger-ui .nb4-ns{margin-bottom:-2rem}.swagger-ui .nb5-ns{margin-bottom:-4rem}.swagger-ui .nb6-ns{margin-bottom:-8rem}.swagger-ui .nb7-ns{margin-bottom:-16rem}.swagger-ui .nt1-ns{margin-top:-.25rem}.swagger-ui .nt2-ns{margin-top:-.5rem}.swagger-ui .nt3-ns{margin-top:-1rem}.swagger-ui .nt4-ns{margin-top:-2rem}.swagger-ui .nt5-ns{margin-top:-4rem}.swagger-ui .nt6-ns{margin-top:-8rem}.swagger-ui .nt7-ns{margin-top:-16rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .na1-m{margin:-.25rem}.swagger-ui .na2-m{margin:-.5rem}.swagger-ui .na3-m{margin:-1rem}.swagger-ui .na4-m{margin:-2rem}.swagger-ui .na5-m{margin:-4rem}.swagger-ui .na6-m{margin:-8rem}.swagger-ui .na7-m{margin:-16rem}.swagger-ui .nl1-m{margin-left:-.25rem}.swagger-ui .nl2-m{margin-left:-.5rem}.swagger-ui .nl3-m{margin-left:-1rem}.swagger-ui .nl4-m{margin-left:-2rem}.swagger-ui .nl5-m{margin-left:-4rem}.swagger-ui .nl6-m{margin-left:-8rem}.swagger-ui .nl7-m{margin-left:-16rem}.swagger-ui .nr1-m{margin-right:-.25rem}.swagger-ui .nr2-m{margin-right:-.5rem}.swagger-ui .nr3-m{margin-right:-1rem}.swagger-ui .nr4-m{margin-right:-2rem}.swagger-ui .nr5-m{margin-right:-4rem}.swagger-ui .nr6-m{margin-right:-8rem}.swagger-ui .nr7-m{margin-right:-16rem}.swagger-ui .nb1-m{margin-bottom:-.25rem}.swagger-ui .nb2-m{margin-bottom:-.5rem}.swagger-ui .nb3-m{margin-bottom:-1rem}.swagger-ui .nb4-m{margin-bottom:-2rem}.swagger-ui .nb5-m{margin-bottom:-4rem}.swagger-ui .nb6-m{margin-bottom:-8rem}.swagger-ui .nb7-m{margin-bottom:-16rem}.swagger-ui .nt1-m{margin-top:-.25rem}.swagger-ui .nt2-m{margin-top:-.5rem}.swagger-ui .nt3-m{margin-top:-1rem}.swagger-ui .nt4-m{margin-top:-2rem}.swagger-ui .nt5-m{margin-top:-4rem}.swagger-ui .nt6-m{margin-top:-8rem}.swagger-ui .nt7-m{margin-top:-16rem}}@media screen and (min-width:60em){.swagger-ui .na1-l{margin:-.25rem}.swagger-ui .na2-l{margin:-.5rem}.swagger-ui .na3-l{margin:-1rem}.swagger-ui .na4-l{margin:-2rem}.swagger-ui .na5-l{margin:-4rem}.swagger-ui .na6-l{margin:-8rem}.swagger-ui .na7-l{margin:-16rem}.swagger-ui .nl1-l{margin-left:-.25rem}.swagger-ui .nl2-l{margin-left:-.5rem}.swagger-ui .nl3-l{margin-left:-1rem}.swagger-ui .nl4-l{margin-left:-2rem}.swagger-ui .nl5-l{margin-left:-4rem}.swagger-ui .nl6-l{margin-left:-8rem}.swagger-ui .nl7-l{margin-left:-16rem}.swagger-ui .nr1-l{margin-right:-.25rem}.swagger-ui .nr2-l{margin-right:-.5rem}.swagger-ui .nr3-l{margin-right:-1rem}.swagger-ui .nr4-l{margin-right:-2rem}.swagger-ui .nr5-l{margin-right:-4rem}.swagger-ui .nr6-l{margin-right:-8rem}.swagger-ui .nr7-l{margin-right:-16rem}.swagger-ui .nb1-l{margin-bottom:-.25rem}.swagger-ui .nb2-l{margin-bottom:-.5rem}.swagger-ui .nb3-l{margin-bottom:-1rem}.swagger-ui .nb4-l{margin-bottom:-2rem}.swagger-ui .nb5-l{margin-bottom:-4rem}.swagger-ui .nb6-l{margin-bottom:-8rem}.swagger-ui .nb7-l{margin-bottom:-16rem}.swagger-ui .nt1-l{margin-top:-.25rem}.swagger-ui .nt2-l{margin-top:-.5rem}.swagger-ui .nt3-l{margin-top:-1rem}.swagger-ui .nt4-l{margin-top:-2rem}.swagger-ui .nt5-l{margin-top:-4rem}.swagger-ui .nt6-l{margin-top:-8rem}.swagger-ui .nt7-l{margin-top:-16rem}}.swagger-ui .collapse{border-collapse:collapse;border-spacing:0}.swagger-ui .striped--light-silver:nth-child(odd){background-color:#aaa}.swagger-ui .striped--moon-gray:nth-child(odd){background-color:#ccc}.swagger-ui .striped--light-gray:nth-child(odd){background-color:#eee}.swagger-ui .striped--near-white:nth-child(odd){background-color:#f4f4f4}.swagger-ui .stripe-light:nth-child(odd){background-color:hsla(0,0%,100%,.1)}.swagger-ui .stripe-dark:nth-child(odd){background-color:rgba(0,0,0,.1)}.swagger-ui .strike{text-decoration:line-through}.swagger-ui .underline{text-decoration:underline}.swagger-ui .no-underline{text-decoration:none}@media screen and (min-width:30em){.swagger-ui .strike-ns{text-decoration:line-through}.swagger-ui .underline-ns{text-decoration:underline}.swagger-ui .no-underline-ns{text-decoration:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .strike-m{text-decoration:line-through}.swagger-ui .underline-m{text-decoration:underline}.swagger-ui .no-underline-m{text-decoration:none}}@media screen and (min-width:60em){.swagger-ui .strike-l{text-decoration:line-through}.swagger-ui .underline-l{text-decoration:underline}.swagger-ui .no-underline-l{text-decoration:none}}.swagger-ui .tl{text-align:left}.swagger-ui .tr{text-align:right}.swagger-ui .tc{text-align:center}.swagger-ui .tj{text-align:justify}@media screen and (min-width:30em){.swagger-ui .tl-ns{text-align:left}.swagger-ui .tr-ns{text-align:right}.swagger-ui .tc-ns{text-align:center}.swagger-ui .tj-ns{text-align:justify}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .tl-m{text-align:left}.swagger-ui .tr-m{text-align:right}.swagger-ui .tc-m{text-align:center}.swagger-ui .tj-m{text-align:justify}}@media screen and (min-width:60em){.swagger-ui .tl-l{text-align:left}.swagger-ui .tr-l{text-align:right}.swagger-ui .tc-l{text-align:center}.swagger-ui .tj-l{text-align:justify}}.swagger-ui .ttc{text-transform:capitalize}.swagger-ui .ttl{text-transform:lowercase}.swagger-ui .ttu{text-transform:uppercase}.swagger-ui .ttn{text-transform:none}@media screen and (min-width:30em){.swagger-ui .ttc-ns{text-transform:capitalize}.swagger-ui .ttl-ns{text-transform:lowercase}.swagger-ui .ttu-ns{text-transform:uppercase}.swagger-ui .ttn-ns{text-transform:none}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ttc-m{text-transform:capitalize}.swagger-ui .ttl-m{text-transform:lowercase}.swagger-ui .ttu-m{text-transform:uppercase}.swagger-ui .ttn-m{text-transform:none}}@media screen and (min-width:60em){.swagger-ui .ttc-l{text-transform:capitalize}.swagger-ui .ttl-l{text-transform:lowercase}.swagger-ui .ttu-l{text-transform:uppercase}.swagger-ui .ttn-l{text-transform:none}}.swagger-ui .f-6,.swagger-ui .f-headline{font-size:6rem}.swagger-ui .f-5,.swagger-ui .f-subheadline{font-size:5rem}.swagger-ui .f1{font-size:3rem}.swagger-ui .f2{font-size:2.25rem}.swagger-ui .f3{font-size:1.5rem}.swagger-ui .f4{font-size:1.25rem}.swagger-ui .f5{font-size:1rem}.swagger-ui .f6{font-size:.875rem}.swagger-ui .f7{font-size:.75rem}@media screen and (min-width:30em){.swagger-ui .f-6-ns,.swagger-ui .f-headline-ns{font-size:6rem}.swagger-ui .f-5-ns,.swagger-ui .f-subheadline-ns{font-size:5rem}.swagger-ui .f1-ns{font-size:3rem}.swagger-ui .f2-ns{font-size:2.25rem}.swagger-ui .f3-ns{font-size:1.5rem}.swagger-ui .f4-ns{font-size:1.25rem}.swagger-ui .f5-ns{font-size:1rem}.swagger-ui .f6-ns{font-size:.875rem}.swagger-ui .f7-ns{font-size:.75rem}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .f-6-m,.swagger-ui .f-headline-m{font-size:6rem}.swagger-ui .f-5-m,.swagger-ui .f-subheadline-m{font-size:5rem}.swagger-ui .f1-m{font-size:3rem}.swagger-ui .f2-m{font-size:2.25rem}.swagger-ui .f3-m{font-size:1.5rem}.swagger-ui .f4-m{font-size:1.25rem}.swagger-ui .f5-m{font-size:1rem}.swagger-ui .f6-m{font-size:.875rem}.swagger-ui .f7-m{font-size:.75rem}}@media screen and (min-width:60em){.swagger-ui .f-6-l,.swagger-ui .f-headline-l{font-size:6rem}.swagger-ui .f-5-l,.swagger-ui .f-subheadline-l{font-size:5rem}.swagger-ui .f1-l{font-size:3rem}.swagger-ui .f2-l{font-size:2.25rem}.swagger-ui .f3-l{font-size:1.5rem}.swagger-ui .f4-l{font-size:1.25rem}.swagger-ui .f5-l{font-size:1rem}.swagger-ui .f6-l{font-size:.875rem}.swagger-ui .f7-l{font-size:.75rem}}.swagger-ui .measure{max-width:30em}.swagger-ui .measure-wide{max-width:34em}.swagger-ui .measure-narrow{max-width:20em}.swagger-ui .indent{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps{font-variant:small-caps}.swagger-ui .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width:30em){.swagger-ui .measure-ns{max-width:30em}.swagger-ui .measure-wide-ns{max-width:34em}.swagger-ui .measure-narrow-ns{max-width:20em}.swagger-ui .indent-ns{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-ns{font-variant:small-caps}.swagger-ui .truncate-ns{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .measure-m{max-width:30em}.swagger-ui .measure-wide-m{max-width:34em}.swagger-ui .measure-narrow-m{max-width:20em}.swagger-ui .indent-m{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-m{font-variant:small-caps}.swagger-ui .truncate-m{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@media screen and (min-width:60em){.swagger-ui .measure-l{max-width:30em}.swagger-ui .measure-wide-l{max-width:34em}.swagger-ui .measure-narrow-l{max-width:20em}.swagger-ui .indent-l{text-indent:1em;margin-top:0;margin-bottom:0}.swagger-ui .small-caps-l{font-variant:small-caps}.swagger-ui .truncate-l{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.swagger-ui .overflow-container{overflow-y:scroll}.swagger-ui .center{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto{margin-right:auto}.swagger-ui .ml-auto{margin-left:auto}@media screen and (min-width:30em){.swagger-ui .center-ns{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-ns{margin-right:auto}.swagger-ui .ml-auto-ns{margin-left:auto}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .center-m{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-m{margin-right:auto}.swagger-ui .ml-auto-m{margin-left:auto}}@media screen and (min-width:60em){.swagger-ui .center-l{margin-right:auto;margin-left:auto}.swagger-ui .mr-auto-l{margin-right:auto}.swagger-ui .ml-auto-l{margin-left:auto}}.swagger-ui .clip{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}@media screen and (min-width:30em){.swagger-ui .clip-ns{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .clip-m{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}@media screen and (min-width:60em){.swagger-ui .clip-l{position:fixed!important;_position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}}.swagger-ui .ws-normal{white-space:normal}.swagger-ui .nowrap{white-space:nowrap}.swagger-ui .pre{white-space:pre}@media screen and (min-width:30em){.swagger-ui .ws-normal-ns{white-space:normal}.swagger-ui .nowrap-ns{white-space:nowrap}.swagger-ui .pre-ns{white-space:pre}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .ws-normal-m{white-space:normal}.swagger-ui .nowrap-m{white-space:nowrap}.swagger-ui .pre-m{white-space:pre}}@media screen and (min-width:60em){.swagger-ui .ws-normal-l{white-space:normal}.swagger-ui .nowrap-l{white-space:nowrap}.swagger-ui .pre-l{white-space:pre}}.swagger-ui .v-base{vertical-align:baseline}.swagger-ui .v-mid{vertical-align:middle}.swagger-ui .v-top{vertical-align:top}.swagger-ui .v-btm{vertical-align:bottom}@media screen and (min-width:30em){.swagger-ui .v-base-ns{vertical-align:baseline}.swagger-ui .v-mid-ns{vertical-align:middle}.swagger-ui .v-top-ns{vertical-align:top}.swagger-ui .v-btm-ns{vertical-align:bottom}}@media screen and (min-width:30em) and (max-width:60em){.swagger-ui .v-base-m{vertical-align:baseline}.swagger-ui .v-mid-m{vertical-align:middle}.swagger-ui .v-top-m{vertical-align:top}.swagger-ui .v-btm-m{vertical-align:bottom}}@media screen and (min-width:60em){.swagger-ui .v-base-l{vertical-align:baseline}.swagger-ui .v-mid-l{vertical-align:middle}.swagger-ui .v-top-l{vertical-align:top}.swagger-ui .v-btm-l{vertical-align:bottom}}.swagger-ui .dim{opacity:1;transition:opacity .15s ease-in}.swagger-ui .dim:focus,.swagger-ui .dim:hover{opacity:.5;transition:opacity .15s ease-in}.swagger-ui .dim:active{opacity:.8;transition:opacity .15s ease-out}.swagger-ui .glow{transition:opacity .15s ease-in}.swagger-ui .glow:focus,.swagger-ui .glow:hover{opacity:1;transition:opacity .15s ease-in}.swagger-ui .hide-child .child{opacity:0;transition:opacity .15s ease-in}.swagger-ui .hide-child:active .child,.swagger-ui .hide-child:focus .child,.swagger-ui .hide-child:hover .child{opacity:1;transition:opacity .15s ease-in}.swagger-ui .underline-hover:focus,.swagger-ui .underline-hover:hover{text-decoration:underline}.swagger-ui .grow{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-out}.swagger-ui .grow:focus,.swagger-ui .grow:hover{transform:scale(1.05)}.swagger-ui .grow:active{transform:scale(.9)}.swagger-ui .grow-large{-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-in-out}.swagger-ui .grow-large:focus,.swagger-ui .grow-large:hover{transform:scale(1.2)}.swagger-ui .grow-large:active{transform:scale(.95)}.swagger-ui .pointer:hover{cursor:pointer}.swagger-ui .shadow-hover{cursor:pointer;position:relative;transition:all .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:after{content:"";box-shadow:0 0 16px 2px rgba(0,0,0,.2);border-radius:inherit;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;transition:opacity .5s cubic-bezier(.165,.84,.44,1)}.swagger-ui .shadow-hover:focus:after,.swagger-ui .shadow-hover:hover:after{opacity:1}.swagger-ui .bg-animate,.swagger-ui .bg-animate:focus,.swagger-ui .bg-animate:hover{transition:background-color .15s ease-in-out}.swagger-ui .z-0{z-index:0}.swagger-ui .z-1{z-index:1}.swagger-ui .z-2{z-index:2}.swagger-ui .z-3{z-index:3}.swagger-ui .z-4{z-index:4}.swagger-ui .z-5{z-index:5}.swagger-ui .z-999{z-index:999}.swagger-ui .z-9999{z-index:9999}.swagger-ui .z-max{z-index:2147483647}.swagger-ui .z-inherit{z-index:inherit}.swagger-ui .z-initial{z-index:auto}.swagger-ui .z-unset{z-index:unset}.swagger-ui .nested-copy-line-height ol,.swagger-ui .nested-copy-line-height p,.swagger-ui .nested-copy-line-height ul{line-height:1.5}.swagger-ui .nested-headline-line-height h1,.swagger-ui .nested-headline-line-height h2,.swagger-ui .nested-headline-line-height h3,.swagger-ui .nested-headline-line-height h4,.swagger-ui .nested-headline-line-height h5,.swagger-ui .nested-headline-line-height h6{line-height:1.25}.swagger-ui .nested-list-reset ol,.swagger-ui .nested-list-reset ul{padding-left:0;margin-left:0;list-style-type:none}.swagger-ui .nested-copy-indent p+p{text-indent:.1em;margin-top:0;margin-bottom:0}.swagger-ui .nested-copy-seperator p+p{margin-top:1.5em}.swagger-ui .nested-img img{width:100%;max-width:100%;display:block}.swagger-ui .nested-links a{color:#357edd;transition:color .15s ease-in}.swagger-ui .nested-links a:focus,.swagger-ui .nested-links a:hover{color:#96ccff;transition:color .15s ease-in}.swagger-ui .wrapper{width:100%;max-width:1460px;margin:0 auto;padding:0 20px;box-sizing:border-box}.swagger-ui .opblock-tag-section{display:flex;flex-direction:column}.swagger-ui .opblock-tag{display:flex;align-items:center;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui .opblock-tag:hover{background:rgba(0,0,0,.02)}.swagger-ui .opblock-tag{font-size:24px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-tag.no-desc span{flex:1}.swagger-ui .opblock-tag svg{transition:all .4s}.swagger-ui .opblock-tag small{font-size:14px;font-weight:400;flex:1;padding:0 10px;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__type{font-size:12px;padding:5px 0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .parameter-controls{margin-top:.75em}.swagger-ui .examples__title{display:block;font-size:1.1em;font-weight:700;margin-bottom:.75em}.swagger-ui .examples__section{margin-top:1.5em}.swagger-ui .examples__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .examples-select{margin-bottom:.75em}.swagger-ui .examples-select__section-label{font-weight:700;font-size:.9rem;margin-right:.5rem}.swagger-ui .example__section{margin-top:1.5em}.swagger-ui .example__section-header{font-weight:700;font-size:.9rem;margin-bottom:.5rem}.swagger-ui .view-line-link{position:relative;top:3px;width:20px;margin:0 5px;cursor:pointer;transition:all .5s}.swagger-ui .opblock{margin:0 0 15px;border:1px solid #000;border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.19)}.swagger-ui .opblock .tab-header{display:flex;flex:1}.swagger-ui .opblock .tab-header .tab-item{padding:0 40px;cursor:pointer}.swagger-ui .opblock .tab-header .tab-item:first-of-type{padding:0 40px 0 0}.swagger-ui .opblock .tab-header .tab-item.active h4 span{position:relative}.swagger-ui .opblock .tab-header .tab-item.active h4 span:after{position:absolute;bottom:-15px;left:50%;width:120%;height:4px;content:"";transform:translateX(-50%);background:grey}.swagger-ui .opblock.is-open .opblock-summary{border-bottom:1px solid #000}.swagger-ui .opblock .opblock-section-header{display:flex;align-items:center;padding:8px 20px;min-height:50px;background:hsla(0,0%,100%,.8);box-shadow:0 1px 2px rgba(0,0,0,.1)}.swagger-ui .opblock .opblock-section-header>label{font-size:12px;font-weight:700;display:flex;align-items:center;margin:0 0 0 auto;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-section-header>label>span{padding:0 10px 0 0}.swagger-ui .opblock .opblock-section-header h4{font-size:14px;flex:1;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary-method{font-size:14px;font-weight:700;min-width:80px;padding:6px 15px;text-align:center;border-radius:3px;background:#000;text-shadow:0 1px 0 rgba(0,0,0,.1);font-family:sans-serif;color:#fff}.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:16px;display:flex;align-items:center;word-break:break-word;padding:0 10px;font-family:monospace;font-weight:600;color:#3b4151}@media (max-width:768px){.swagger-ui .opblock .opblock-summary-operation-id,.swagger-ui .opblock .opblock-summary-path,.swagger-ui .opblock .opblock-summary-path__deprecated{font-size:12px}}.swagger-ui .opblock .opblock-summary-path{flex-shrink:0;max-width:calc(100% - 110px - 15rem)}.swagger-ui .opblock .opblock-summary-path__deprecated{text-decoration:line-through}.swagger-ui .opblock .opblock-summary-operation-id{font-size:14px}.swagger-ui .opblock .opblock-summary-description{font-size:13px;flex:1 1 auto;word-break:break-word;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock .opblock-summary{display:flex;align-items:center;padding:5px;cursor:pointer}.swagger-ui .opblock .opblock-summary .view-line-link{position:relative;top:2px;width:0;margin:0;cursor:pointer;transition:all .5s}.swagger-ui .opblock .opblock-summary:hover .view-line-link{width:18px;margin:0 5px}.swagger-ui .opblock.opblock-post{border-color:#49cc90;background:rgba(73,204,144,.1)}.swagger-ui .opblock.opblock-post .opblock-summary-method{background:#49cc90}.swagger-ui .opblock.opblock-post .opblock-summary{border-color:#49cc90}.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span:after{background:#49cc90}.swagger-ui .opblock.opblock-put{border-color:#fca130;background:rgba(252,161,48,.1)}.swagger-ui .opblock.opblock-put .opblock-summary-method{background:#fca130}.swagger-ui .opblock.opblock-put .opblock-summary{border-color:#fca130}.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span:after{background:#fca130}.swagger-ui .opblock.opblock-delete{border-color:#f93e3e;background:rgba(249,62,62,.1)}.swagger-ui .opblock.opblock-delete .opblock-summary-method{background:#f93e3e}.swagger-ui .opblock.opblock-delete .opblock-summary{border-color:#f93e3e}.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span:after{background:#f93e3e}.swagger-ui .opblock.opblock-get{border-color:#61affe;background:rgba(97,175,254,.1)}.swagger-ui .opblock.opblock-get .opblock-summary-method{background:#61affe}.swagger-ui .opblock.opblock-get .opblock-summary{border-color:#61affe}.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span:after{background:#61affe}.swagger-ui .opblock.opblock-patch{border-color:#50e3c2;background:rgba(80,227,194,.1)}.swagger-ui .opblock.opblock-patch .opblock-summary-method{background:#50e3c2}.swagger-ui .opblock.opblock-patch .opblock-summary{border-color:#50e3c2}.swagger-ui .opblock.opblock-patch .tab-header .tab-item.active h4 span:after{background:#50e3c2}.swagger-ui .opblock.opblock-head{border-color:#9012fe;background:rgba(144,18,254,.1)}.swagger-ui .opblock.opblock-head .opblock-summary-method{background:#9012fe}.swagger-ui .opblock.opblock-head .opblock-summary{border-color:#9012fe}.swagger-ui .opblock.opblock-head .tab-header .tab-item.active h4 span:after{background:#9012fe}.swagger-ui .opblock.opblock-options{border-color:#0d5aa7;background:rgba(13,90,167,.1)}.swagger-ui .opblock.opblock-options .opblock-summary-method{background:#0d5aa7}.swagger-ui .opblock.opblock-options .opblock-summary{border-color:#0d5aa7}.swagger-ui .opblock.opblock-options .tab-header .tab-item.active h4 span:after{background:#0d5aa7}.swagger-ui .opblock.opblock-deprecated{opacity:.6;border-color:#ebebeb;background:hsla(0,0%,92.2%,.1)}.swagger-ui .opblock.opblock-deprecated .opblock-summary-method{background:#ebebeb}.swagger-ui .opblock.opblock-deprecated .opblock-summary{border-color:#ebebeb}.swagger-ui .opblock.opblock-deprecated .tab-header .tab-item.active h4 span:after{background:#ebebeb}.swagger-ui .opblock .opblock-schemes{padding:8px 20px}.swagger-ui .opblock .opblock-schemes .schemes-title{padding:0 10px 0 0}.swagger-ui .filter .operation-filter-input{width:100%;margin:20px 0;padding:10px;border:2px solid #d8dde7}.swagger-ui .download-url-wrapper .failed,.swagger-ui .filter .failed{color:red}.swagger-ui .download-url-wrapper .loading,.swagger-ui .filter .loading{color:#aaa}.swagger-ui .model-example{margin-top:1em}.swagger-ui .tab{display:flex;padding:0;list-style:none}.swagger-ui .tab li{font-size:12px;min-width:60px;padding:0;cursor:pointer;font-family:sans-serif;color:#3b4151}.swagger-ui .tab li:first-of-type{position:relative;padding-left:0;padding-right:12px}.swagger-ui .tab li:first-of-type:after{position:absolute;top:0;right:6px;width:1px;height:100%;content:"";background:rgba(0,0,0,.2)}.swagger-ui .tab li.active{font-weight:700}.swagger-ui .opblock-description-wrapper,.swagger-ui .opblock-external-docs-wrapper,.swagger-ui .opblock-title_normal{font-size:12px;margin:0 0 5px;padding:15px 20px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper h4,.swagger-ui .opblock-external-docs-wrapper h4,.swagger-ui .opblock-title_normal h4{font-size:12px;margin:0 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-description-wrapper p,.swagger-ui .opblock-external-docs-wrapper p,.swagger-ui .opblock-title_normal p{font-size:14px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .opblock-external-docs-wrapper h4{padding-left:0}.swagger-ui .execute-wrapper{padding:20px;text-align:right}.swagger-ui .execute-wrapper .btn{width:100%;padding:8px 40px}.swagger-ui .body-param-options{display:flex;flex-direction:column}.swagger-ui .body-param-options .body-param-edit{padding:10px 0}.swagger-ui .body-param-options label{padding:8px 0}.swagger-ui .body-param-options label select{margin:3px 0 0}.swagger-ui .responses-inner{padding:20px}.swagger-ui .responses-inner h4,.swagger-ui .responses-inner h5{font-size:12px;margin:10px 0 5px;font-family:sans-serif;color:#3b4151}.swagger-ui .responses-inner .curl{white-space:normal}.swagger-ui .response-col_status{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_status .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links{padding-left:2em;max-width:40em;font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .response-col_links .response-undocumented{font-size:11px;font-family:monospace;font-weight:600;color:#909090}.swagger-ui .response-col_links .operation-link{margin-bottom:1.5em}.swagger-ui .response-col_links .operation-link .description{margin-bottom:.5em}.swagger-ui .opblock-body .opblock-loading-animation{display:block;margin:3em auto}.swagger-ui .opblock-body pre.microlight{font-size:12px;margin:0;padding:10px;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;border-radius:4px;background:#333;overflow-wrap:break-word;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .opblock-body pre.microlight .headerline{display:block}.swagger-ui .highlight-code{position:relative}.swagger-ui .highlight-code>.microlight{overflow-y:auto;max-height:400px;min-height:6em}.swagger-ui .curl-command{position:relative}.swagger-ui .download-contents{position:absolute;bottom:10px;right:10px;cursor:pointer;background:#7d8293;text-align:center;padding:5px;border-radius:4px;font-family:sans-serif;font-weight:600;color:#fff;font-size:14px;height:30px;width:75px}.swagger-ui .scheme-container{margin:0 0 20px;padding:30px 0;background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.15)}.swagger-ui .scheme-container .schemes{display:flex;align-items:flex-end}.swagger-ui .scheme-container .schemes>label{font-size:12px;font-weight:700;display:flex;flex-direction:column;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .scheme-container .schemes>label select{min-width:130px;text-transform:uppercase}.swagger-ui .loading-container{padding:40px 0 60px;margin-top:1em;min-height:1px;display:flex;justify-content:center;align-items:center;flex-direction:column}.swagger-ui .loading-container .loading{position:relative}.swagger-ui .loading-container .loading:after{font-size:10px;font-weight:700;position:absolute;top:50%;left:50%;content:"loading";transform:translate(-50%,-50%);text-transform:uppercase;font-family:sans-serif;color:#3b4151}.swagger-ui .loading-container .loading:before{position:absolute;top:50%;left:50%;display:block;width:60px;height:60px;margin:-30px;content:"";-webkit-animation:rotation 1s linear infinite,opacity .5s;animation:rotation 1s linear infinite,opacity .5s;opacity:1;border:2px solid rgba(85,85,85,.1);border-top-color:rgba(0,0,0,.6);border-radius:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}@-webkit-keyframes rotation{to{transform:rotate(1turn)}}@keyframes rotation{to{transform:rotate(1turn)}}.swagger-ui .response-controls{padding-top:1em;display:flex}.swagger-ui .response-control-media-type{margin-right:1em}.swagger-ui .response-control-media-type--accept-controller select{border-color:green}.swagger-ui .response-control-media-type__accept-message{color:green;font-size:.7em}.swagger-ui .response-control-examples__title,.swagger-ui .response-control-media-type__title{display:block;margin-bottom:.2em;font-size:.7em}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.swagger-ui .hidden{display:none}.swagger-ui .no-margin{height:auto;border:none;margin:0;padding:0}.swagger-ui .float-right{float:right}.swagger-ui img.full-width{width:100%}.swagger-ui .svg-assets{position:absolute;width:0;height:0}.swagger-ui section h3{font-family:sans-serif;color:#3b4151}.swagger-ui a.nostyle{display:inline}.swagger-ui a.nostyle,.swagger-ui a.nostyle:visited{text-decoration:inherit;color:inherit;cursor:pointer}.swagger-ui .fallback{padding:1em;color:#aaa}.swagger-ui .version-pragma{height:100%;padding:5em 0}.swagger-ui .version-pragma__message{display:flex;justify-content:center;height:100%;font-size:1.2em;text-align:center;line-height:1.5em;padding:0 .6em}.swagger-ui .version-pragma__message>div{max-width:55ch;flex:1}.swagger-ui .version-pragma__message code{background-color:#dedede;padding:4px 4px 2px;white-space:pre}.swagger-ui .opblock-link{font-weight:400}.swagger-ui .opblock-link.shown{font-weight:700}.swagger-ui span.token-string{color:#555}.swagger-ui span.token-not-formatted{color:#555;font-weight:700}.swagger-ui .btn{font-size:14px;font-weight:700;padding:5px 23px;transition:all .3s;border:2px solid grey;border-radius:4px;background:transparent;box-shadow:0 1px 2px rgba(0,0,0,.1);font-family:sans-serif;color:#3b4151}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{border-color:#ff6060;background-color:transparent;font-family:sans-serif;color:#ff6060}.swagger-ui .btn.authorize{line-height:1;display:inline;color:#49cc90;border-color:#49cc90;background-color:transparent}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;color:#fff;border-color:#4990e2}.swagger-ui .btn-group{display:flex;padding:30px}.swagger-ui .btn-group .btn{flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{padding:0 10px;border:none;background:none}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .expand-methods,.swagger-ui .expand-operation{border:none;background:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{width:20px;height:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{transition:all .3s;fill:#707070}.swagger-ui button{cursor:pointer;outline:none}.swagger-ui button.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .copy-to-clipboard{position:absolute;bottom:10px;right:100px;width:30px;height:30px;background:#7d8293;border-radius:4px;border:none}.swagger-ui .copy-to-clipboard button{padding-left:25px;border:none;height:25px;background:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" aria-hidden="true"><path fill="%23fff" fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg>') 50% no-repeat}.swagger-ui .curl-command .copy-to-clipboard{bottom:5px;right:10px;width:20px;height:20px}.swagger-ui .curl-command .copy-to-clipboard button{padding-left:18px;height:18px}.swagger-ui select{font-size:14px;font-weight:700;padding:5px 40px 5px 10px;border:2px solid #41444e;border-radius:4px;background:#f7f7f7 url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13.418 7.859a.695.695 0 01.978 0 .68.68 0 010 .969l-3.908 3.83a.697.697 0 01-.979 0l-3.908-3.83a.68.68 0 010-.969.695.695 0 01.978 0L10 11l3.418-3.141z"/></svg>') right 10px center no-repeat;background-size:20px;box-shadow:0 1px 2px 0 rgba(0,0,0,.25);font-family:sans-serif;color:#3b4151;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui select[multiple]{margin:5px 0;padding:5px;background:#f7f7f7}.swagger-ui select.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui .opblock-body select{min-width:230px}@media (max-width:768px){.swagger-ui .opblock-body select{min-width:180px}}.swagger-ui label{font-size:12px;font-weight:700;margin:0 0 5px;font-family:sans-serif;color:#3b4151}@media (max-width:768px){.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text]{max-width:175px}}.swagger-ui input[type=email],.swagger-ui input[type=file],.swagger-ui input[type=password],.swagger-ui input[type=search],.swagger-ui input[type=text],.swagger-ui textarea{min-width:100px;margin:5px 0;padding:8px 10px;border:1px solid #d9d9d9;border-radius:4px;background:#fff}.swagger-ui input[type=email].invalid,.swagger-ui input[type=file].invalid,.swagger-ui input[type=password].invalid,.swagger-ui input[type=search].invalid,.swagger-ui input[type=text].invalid,.swagger-ui textarea.invalid{-webkit-animation:shake .4s 1;animation:shake .4s 1;border-color:#f93e3e;background:#feebeb}.swagger-ui input[disabled],.swagger-ui select[disabled],.swagger-ui textarea[disabled]{background-color:#fafafa;color:#888;cursor:not-allowed}.swagger-ui select[disabled]{border-color:#888}.swagger-ui textarea[disabled]{background-color:#41444e;color:#fff}@-webkit-keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}.swagger-ui textarea{font-size:12px;width:100%;min-height:280px;padding:10px;border:none;border-radius:4px;outline:none;background:hsla(0,0%,100%,.8);font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui textarea:focus{border:2px solid #61affe}.swagger-ui textarea.curl{font-size:12px;min-height:100px;margin:0;padding:10px;resize:none;border-radius:4px;background:#41444e;font-family:monospace;font-weight:600;color:#fff}.swagger-ui .checkbox{padding:5px 0 10px;transition:opacity .5s;color:#303030}.swagger-ui .checkbox label{display:flex}.swagger-ui .checkbox p{font-weight:400!important;font-style:italic;margin:0!important;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .checkbox input[type=checkbox]{display:none}.swagger-ui .checkbox input[type=checkbox]+label>.item{position:relative;top:3px;display:inline-block;width:16px;height:16px;margin:0 8px 0 0;padding:5px;cursor:pointer;border-radius:1px;background:#e8e8e8;box-shadow:0 0 0 2px #e8e8e8;flex:none}.swagger-ui .checkbox input[type=checkbox]+label>.item:active{transform:scale(.9)}.swagger-ui .checkbox input[type=checkbox]:checked+label>.item{background:#e8e8e8 url('data:image/svg+xml;charset=utf-8,<svg width="10" height="8" viewBox="3 7 10 8" xmlns="http://www.w3.org/2000/svg"><path fill="%2341474E" fill-rule="evenodd" d="M6.333 15L3 11.667l1.333-1.334 2 2L11.667 7 13 8.333z"/></svg>') 50% no-repeat}.swagger-ui .dialog-ux{position:fixed;z-index:9999;top:0;right:0;bottom:0;left:0}.swagger-ui .dialog-ux .backdrop-ux{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8)}.swagger-ui .dialog-ux .modal-ux{position:absolute;z-index:9999;top:50%;left:50%;width:100%;min-width:300px;max-width:650px;transform:translate(-50%,-50%);border:1px solid #ebebeb;border-radius:4px;background:#fff;box-shadow:0 10px 30px 0 rgba(0,0,0,.2)}.swagger-ui .dialog-ux .modal-ux-content{overflow-y:auto;max-height:540px;padding:20px}.swagger-ui .dialog-ux .modal-ux-content p{font-size:12px;margin:0 0 5px;color:#41444e;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-content h4{font-size:18px;font-weight:600;margin:15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .dialog-ux .modal-ux-header{display:flex;padding:12px 0;border-bottom:1px solid #ebebeb;align-items:center}.swagger-ui .dialog-ux .modal-ux-header .close-modal{padding:0 10px;border:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swagger-ui .dialog-ux .modal-ux-header h3{font-size:20px;font-weight:600;margin:0;padding:0 20px;flex:1;font-family:sans-serif;color:#3b4151}.swagger-ui .model{font-size:12px;font-weight:300;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .model .deprecated span,.swagger-ui .model .deprecated td{color:#a0a0a0!important}.swagger-ui .model .deprecated>td:first-of-type{text-decoration:line-through}.swagger-ui .model-toggle{font-size:10px;position:relative;top:6px;display:inline-block;margin:auto .3em;cursor:pointer;transition:transform .15s ease-in;transform:rotate(90deg);transform-origin:50% 50%}.swagger-ui .model-toggle.collapsed{transform:rotate(0deg)}.swagger-ui .model-toggle:after{display:block;width:20px;height:20px;content:"";background:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>') 50% no-repeat;background-size:100%}.swagger-ui .model-jump-to-path{position:relative;cursor:pointer}.swagger-ui .model-jump-to-path .view-line-link{position:absolute;top:-.4em;cursor:pointer}.swagger-ui .model-title{position:relative}.swagger-ui .model-title:hover .model-hint{visibility:visible}.swagger-ui .model-hint{position:absolute;top:-1.8em;visibility:hidden;padding:.1em .5em;white-space:nowrap;color:#ebebeb;border-radius:4px;background:rgba(0,0,0,.7)}.swagger-ui .model p{margin:0 0 1em}.swagger-ui .model .property{color:#999;font-style:italic}.swagger-ui .model .property.primitive{color:#6b6b6b}.swagger-ui table.model tr.description{color:#666;font-weight:400}.swagger-ui table.model tr.description td:first-child{font-weight:700}.swagger-ui table.model tr.property-row.required td:first-child{font-weight:700}.swagger-ui table.model tr.property-row td{vertical-align:top}.swagger-ui table.model tr.property-row td:first-child{padding-right:.2em}.swagger-ui table.model tr.property-row .star{color:red}.swagger-ui table.model tr.extension{color:#777}.swagger-ui table.model tr.extension td:last-child{vertical-align:top}.swagger-ui section.models{margin:30px 0;border:1px solid rgba(59,65,81,.3);border-radius:4px}.swagger-ui section.models .pointer{cursor:pointer}.swagger-ui section.models.is-open{padding:0 0 20px}.swagger-ui section.models.is-open h4{margin:0 0 5px;border-bottom:1px solid rgba(59,65,81,.3)}.swagger-ui section.models h4{font-size:16px;display:flex;align-items:center;margin:0;padding:10px 20px 10px 10px;cursor:pointer;transition:all .2s;font-family:sans-serif;color:#606060}.swagger-ui section.models h4 svg{transition:all .4s}.swagger-ui section.models h4 span{flex:1}.swagger-ui section.models h4:hover{background:rgba(0,0,0,.02)}.swagger-ui section.models h5{font-size:16px;margin:0 0 10px;font-family:sans-serif;color:#707070}.swagger-ui section.models .model-jump-to-path{position:relative;top:5px}.swagger-ui section.models .model-container{margin:0 20px 15px;position:relative;transition:all .5s;border-radius:4px;background:rgba(0,0,0,.05)}.swagger-ui section.models .model-container:hover{background:rgba(0,0,0,.07)}.swagger-ui section.models .model-container:first-of-type{margin:20px}.swagger-ui section.models .model-container:last-of-type{margin:0 20px}.swagger-ui section.models .model-container .models-jump-to-path{position:absolute;top:8px;right:5px;opacity:.65}.swagger-ui section.models .model-box{background:none}.swagger-ui .model-box{padding:10px;display:inline-block;border-radius:4px;background:rgba(0,0,0,.1)}.swagger-ui .model-box .model-jump-to-path{position:relative;top:4px}.swagger-ui .model-box.deprecated{opacity:.5}.swagger-ui .model-title{font-size:16px;font-family:sans-serif;color:#505050}.swagger-ui .model-title img{margin-left:1em;position:relative;bottom:0}.swagger-ui .model-deprecated-warning{font-size:16px;font-weight:600;margin-right:1em;font-family:sans-serif;color:#f93e3e}.swagger-ui span>span.model .brace-close{padding:0 0 0 10px}.swagger-ui .prop-name{display:inline-block;margin-right:1em}.swagger-ui .prop-type{color:#55a}.swagger-ui .prop-enum{display:block}.swagger-ui .prop-format{color:#606060}.swagger-ui .servers>label{font-size:12px;margin:-20px 15px 0 0;font-family:sans-serif;color:#3b4151}.swagger-ui .servers>label select{min-width:130px;max-width:100%}.swagger-ui .servers h4.message{padding-bottom:2em}.swagger-ui .servers table tr{width:30em}.swagger-ui .servers table td{display:inline-block;max-width:15em;vertical-align:middle;padding-top:10px;padding-bottom:10px}.swagger-ui .servers table td:first-of-type{padding-right:1em}.swagger-ui .servers table td input{width:100%;height:100%}.swagger-ui .servers .computed-url{margin:2em 0}.swagger-ui .servers .computed-url code{display:inline-block;padding:4px;font-size:16px;margin:0 1em}.swagger-ui .servers-title{font-size:12px;font-weight:700}.swagger-ui .operation-servers h4.message{margin-bottom:2em}.swagger-ui table{width:100%;padding:0 10px;border-collapse:collapse}.swagger-ui table.model tbody tr td{padding:0;vertical-align:top}.swagger-ui table.model tbody tr td:first-of-type{width:174px;padding:0 0 0 2em}.swagger-ui table.headers td{font-size:12px;font-weight:300;vertical-align:middle;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui table.headers .header-example{color:#999;font-style:italic}.swagger-ui table tbody tr td{padding:10px 0 0;vertical-align:top}.swagger-ui table tbody tr td:first-of-type{min-width:6em;padding:10px 0}.swagger-ui table thead tr td,.swagger-ui table thead tr th{font-size:12px;font-weight:700;padding:12px 0;text-align:left;border-bottom:1px solid rgba(59,65,81,.2);font-family:sans-serif;color:#3b4151}.swagger-ui .parameters-col_description{width:99%;margin-bottom:2em}.swagger-ui .parameters-col_description input[type=text]{width:100%;max-width:340px}.swagger-ui .parameters-col_description select{border-width:1px}.swagger-ui .parameter__name{font-size:16px;font-weight:400;margin-right:.75em;font-family:sans-serif;color:#3b4151}.swagger-ui .parameter__name.required{font-weight:700}.swagger-ui .parameter__name.required span{color:red}.swagger-ui .parameter__name.required:after{font-size:10px;position:relative;top:-6px;padding:5px;content:"required";color:rgba(255,0,0,.6)}.swagger-ui .parameter__extension,.swagger-ui .parameter__in{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:grey}.swagger-ui .parameter__deprecated{font-size:12px;font-style:italic;font-family:monospace;font-weight:600;color:red}.swagger-ui .parameter__empty_value_toggle{display:block;font-size:13px;padding-top:5px;padding-bottom:12px}.swagger-ui .parameter__empty_value_toggle input{margin-right:7px}.swagger-ui .parameter__empty_value_toggle.disabled{opacity:.7}.swagger-ui .table-container{padding:20px}.swagger-ui .response-col_description{width:99%}.swagger-ui .response-col_links{min-width:6em}.swagger-ui .topbar{padding:10px 0;background-color:#1b1b1b}.swagger-ui .topbar .topbar-wrapper,.swagger-ui .topbar a{display:flex;align-items:center}.swagger-ui .topbar a{font-size:1.5em;font-weight:700;flex:1;max-width:300px;text-decoration:none;font-family:sans-serif;color:#fff}.swagger-ui .topbar a span{margin:0;padding:0 10px}.swagger-ui .topbar .download-url-wrapper{display:flex;flex:3;justify-content:flex-end}.swagger-ui .topbar .download-url-wrapper input[type=text]{width:100%;margin:0;border:2px solid #62a03f;border-radius:4px 0 0 4px;outline:none}.swagger-ui .topbar .download-url-wrapper .select-label{display:flex;align-items:center;width:100%;max-width:600px;margin:0;color:#f0f0f0}.swagger-ui .topbar .download-url-wrapper .select-label span{font-size:16px;flex:1;padding:0 10px 0 0;text-align:right}.swagger-ui .topbar .download-url-wrapper .select-label select{flex:2;width:100%;border:2px solid #62a03f;outline:none;box-shadow:none}.swagger-ui .topbar .download-url-wrapper .download-url-button{font-size:16px;font-weight:700;padding:4px 30px;border:none;border-radius:0 4px 4px 0;background:#62a03f;font-family:sans-serif;color:#fff}.swagger-ui .info{margin:50px 0}.swagger-ui .info.failed-config{max-width:880px;margin-left:auto;margin-right:auto;text-align:center}.swagger-ui .info hgroup.main{margin:0 0 20px}.swagger-ui .info hgroup.main a{font-size:12px}.swagger-ui .info pre{font-size:14px}.swagger-ui .info li,.swagger-ui .info p,.swagger-ui .info table{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .info h1,.swagger-ui .info h2,.swagger-ui .info h3,.swagger-ui .info h4,.swagger-ui .info h5{font-family:sans-serif;color:#3b4151}.swagger-ui .info a{font-size:14px;transition:all .4s;font-family:sans-serif;color:#4990e2}.swagger-ui .info a:hover{color:#1f69c0}.swagger-ui .info>div{margin:0 0 5px}.swagger-ui .info .base-url{font-size:12px;font-weight:300!important;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .info .title{font-size:36px;margin:0;font-family:sans-serif;color:#3b4151}.swagger-ui .info .title small{font-size:10px;position:relative;top:-5px;display:inline-block;margin:0 0 0 5px;padding:2px 4px;vertical-align:super;border-radius:57px;background:#7d8492}.swagger-ui .info .title small.version-stamp{background-color:#89bf04}.swagger-ui .info .title small pre{margin:0;padding:0;font-family:sans-serif;color:#fff}.swagger-ui .auth-btn-wrapper{display:flex;padding:10px 0;justify-content:center}.swagger-ui .auth-btn-wrapper .btn-done{margin-right:1em}.swagger-ui .auth-wrapper{display:flex;flex:1;justify-content:flex-end}.swagger-ui .auth-wrapper .authorize{padding-right:20px;margin-right:10px}.swagger-ui .auth-container{margin:0 0 10px;padding:10px 20px;border-bottom:1px solid #ebebeb}.swagger-ui .auth-container:last-of-type{margin:0;padding:10px 20px;border:0}.swagger-ui .auth-container h4{margin:5px 0 15px!important}.swagger-ui .auth-container .wrapper{margin:0;padding:0}.swagger-ui .auth-container input[type=password],.swagger-ui .auth-container input[type=text]{min-width:230px}.swagger-ui .auth-container .errors{font-size:12px;padding:10px;border-radius:4px;background-color:#fee;color:red;margin:1em;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .auth-container .errors b{text-transform:capitalize;margin-right:1em}.swagger-ui .scopes h2{font-size:14px;font-family:sans-serif;color:#3b4151}.swagger-ui .scopes h2 a{font-size:12px;color:#4990e2;cursor:pointer;padding-left:10px;text-decoration:underline}.swagger-ui .scope-def{padding:0 0 20px}.swagger-ui .errors-wrapper{margin:20px;padding:10px 20px;-webkit-animation:scaleUp .5s;animation:scaleUp .5s;border:2px solid #f93e3e;border-radius:4px;background:rgba(249,62,62,.1)}.swagger-ui .errors-wrapper .error-wrapper{margin:0 0 10px}.swagger-ui .errors-wrapper .errors h4{font-size:14px;margin:0;font-family:monospace;font-weight:600;color:#3b4151}.swagger-ui .errors-wrapper .errors small{color:#606060}.swagger-ui .errors-wrapper .errors .message{white-space:pre-line}.swagger-ui .errors-wrapper .errors .message.thrown{max-width:100%}.swagger-ui .errors-wrapper .errors .error-line{text-decoration:underline;cursor:pointer}.swagger-ui .errors-wrapper hgroup{display:flex;align-items:center}.swagger-ui .errors-wrapper hgroup h4{font-size:20px;margin:0;flex:1;font-family:sans-serif;color:#3b4151}@-webkit-keyframes scaleUp{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes scaleUp{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}.swagger-ui .Resizer.vertical.disabled{display:none}.swagger-ui .markdown p,.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown p,.swagger-ui .renderedMarkdown pre{margin:1em auto}.swagger-ui .markdown pre,.swagger-ui .renderedMarkdown pre{color:#000;font-weight:400;white-space:pre-wrap;background:none;padding:0;overflow-wrap:break-word}.swagger-ui .markdown code,.swagger-ui .renderedMarkdown code{font-size:14px;padding:5px 7px;border-radius:4px;background:rgba(0,0,0,.05);font-family:monospace;font-weight:600;color:#9012fe}.swagger-ui .markdown pre>code,.swagger-ui .renderedMarkdown pre>code{display:block}
-
-/*# sourceMappingURL=swagger-ui.css.map*/
\ No newline at end of file
index de2e31f278e23e5bc2368ab480412bc66ac74a1c..ea95bfbcdd808e3e704fac24a0ff902a166f7f09 100644 (file)
   "requires": true,
   "dependencies": {
     "@aduh95/viz.js": {
-      "version": "3.4.0",
-      "resolved": "https://registry.npmjs.org/@aduh95/viz.js/-/viz.js-3.4.0.tgz",
-      "integrity": "sha512-KI2nVf9JdwWCXqK6RVf+9/096G7VWN4Z84mnynlyZKao2xQENW8WNEjLmvdlxS5X8PNWXFC1zqwm7tveOXw/4A==",
+      "version": "3.5.0",
+      "resolved": "https://registry.npmjs.org/@aduh95/viz.js/-/viz.js-3.5.0.tgz",
+      "integrity": "sha512-ahLdpRAoGsdgEfy2SGV2wnnHrBSLDHuwA32v+BoNGnz1gqajr8VMzF8y6mIQt28hHi4LQ272wqSi78DK4YdT2g==",
       "dev": true
     },
     "@angular-devkit/architect": {
-      "version": "0.1002.3",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1002.3.tgz",
-      "integrity": "sha512-7ainXRNO1njZ6bBbJXGpMzCh0OYrzuIRe/+zRj0ncV1YfEsJb2yWBuiza0+y2Ljco7hdd4wr+7eJm7cfn+NvAw==",
+      "version": "0.1102.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1102.14.tgz",
+      "integrity": "sha512-965TVXuBtRb8RySgxRxUEO+YTd7mT0xiqVHSe+MHvMtUCmEE9vwRofFZl6axkK5ri4fiomiMnOVE19aw4spgNQ==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "10.2.3",
-        "rxjs": "6.6.2"
-      },
-      "dependencies": {
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
-          "dev": true,
-          "requires": {
-            "tslib": "^1.9.0"
-          }
-        },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
-          "dev": true
-        }
+        "@angular-devkit/core": "11.2.14",
+        "rxjs": "6.6.3"
       }
     },
     "@angular-devkit/build-angular": {
-      "version": "0.1002.3",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-0.1002.3.tgz",
-      "integrity": "sha512-NjM8H2AUpLjcf+3mKYd99VbFgN4kwT++IBmR9BRQkqOZ4fD63g8jLPzC0KTsWGIVkZtR9Qc88YW/5sC8C3SVFQ==",
-      "dev": true,
-      "requires": {
-        "@angular-devkit/architect": "0.1002.3",
-        "@angular-devkit/build-optimizer": "0.1002.3",
-        "@angular-devkit/build-webpack": "0.1002.3",
-        "@angular-devkit/core": "10.2.3",
-        "@babel/core": "7.11.1",
-        "@babel/generator": "7.11.0",
-        "@babel/plugin-transform-runtime": "7.11.0",
-        "@babel/preset-env": "7.11.0",
-        "@babel/runtime": "7.11.2",
-        "@babel/template": "7.10.4",
+      "version": "0.1102.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-0.1102.14.tgz",
+      "integrity": "sha512-SyX9SK3qfpk6xNIrxpxYi8zxP/cN2kny4I+XYbkKvgGiE3qhkrC/PRJE9OWj0sloekLD0CDfFWOvIiw3GMc4Tg==",
+      "dev": true,
+      "requires": {
+        "@angular-devkit/architect": "0.1102.14",
+        "@angular-devkit/build-optimizer": "0.1102.14",
+        "@angular-devkit/build-webpack": "0.1102.14",
+        "@angular-devkit/core": "11.2.14",
+        "@babel/core": "7.12.10",
+        "@babel/generator": "7.12.11",
+        "@babel/plugin-transform-async-to-generator": "7.12.1",
+        "@babel/plugin-transform-runtime": "7.12.10",
+        "@babel/preset-env": "7.12.11",
+        "@babel/runtime": "7.12.5",
+        "@babel/template": "7.12.7",
+        "@discoveryjs/json-ext": "0.5.2",
         "@jsdevtools/coverage-istanbul-loader": "3.0.5",
-        "@ngtools/webpack": "10.2.3",
-        "autoprefixer": "9.8.6",
-        "babel-loader": "8.1.0",
+        "@ngtools/webpack": "11.2.14",
+        "ansi-colors": "4.1.1",
+        "autoprefixer": "10.2.4",
+        "babel-loader": "8.2.2",
         "browserslist": "^4.9.1",
         "cacache": "15.0.5",
         "caniuse-lite": "^1.0.30001032",
-        "circular-dependency-plugin": "5.2.0",
-        "copy-webpack-plugin": "6.0.3",
-        "core-js": "3.6.4",
-        "css-loader": "4.2.2",
-        "cssnano": "4.1.10",
-        "file-loader": "6.0.0",
+        "circular-dependency-plugin": "5.2.2",
+        "copy-webpack-plugin": "6.3.2",
+        "core-js": "3.8.3",
+        "critters": "0.0.7",
+        "css-loader": "5.0.1",
+        "cssnano": "5.0.2",
+        "file-loader": "6.2.0",
         "find-cache-dir": "3.3.1",
         "glob": "7.1.6",
-        "jest-worker": "26.3.0",
+        "https-proxy-agent": "5.0.0",
+        "inquirer": "7.3.3",
+        "jest-worker": "26.6.2",
         "karma-source-map-support": "1.4.0",
-        "less-loader": "6.2.0",
-        "license-webpack-plugin": "2.3.0",
+        "less": "4.1.1",
+        "less-loader": "7.3.0",
+        "license-webpack-plugin": "2.3.11",
         "loader-utils": "2.0.0",
-        "mini-css-extract-plugin": "0.10.0",
+        "mini-css-extract-plugin": "1.3.5",
         "minimatch": "3.0.4",
-        "open": "7.2.0",
-        "parse5": "6.0.1",
-        "parse5-htmlparser2-tree-adapter": "6.0.1",
+        "open": "7.4.0",
+        "ora": "5.3.0",
+        "parse5-html-rewriting-stream": "6.0.1",
         "pnp-webpack-plugin": "1.6.4",
-        "postcss": "7.0.32",
-        "postcss-import": "12.0.1",
-        "postcss-loader": "3.0.0",
-        "raw-loader": "4.0.1",
+        "postcss": "8.2.15",
+        "postcss-import": "14.0.0",
+        "postcss-loader": "4.2.0",
+        "raw-loader": "4.0.2",
         "regenerator-runtime": "0.13.7",
-        "resolve-url-loader": "3.1.2",
+        "resolve-url-loader": "4.0.0",
         "rimraf": "3.0.2",
-        "rollup": "2.26.5",
-        "rxjs": "6.6.2",
-        "sass": "1.26.10",
-        "sass-loader": "10.0.1",
-        "semver": "7.3.2",
+        "rollup": "2.38.4",
+        "rxjs": "6.6.3",
+        "sass": "1.32.6",
+        "sass-loader": "10.1.1",
+        "semver": "7.3.4",
         "source-map": "0.7.3",
-        "source-map-loader": "1.0.2",
+        "source-map-loader": "1.1.3",
         "source-map-support": "0.5.19",
-        "speed-measure-webpack-plugin": "1.3.3",
-        "style-loader": "1.2.1",
+        "speed-measure-webpack-plugin": "1.4.2",
+        "style-loader": "2.0.0",
         "stylus": "0.54.8",
-        "stylus-loader": "3.0.2",
-        "terser": "5.3.0",
-        "terser-webpack-plugin": "4.1.0",
+        "stylus-loader": "4.3.3",
+        "terser": "5.5.1",
+        "terser-webpack-plugin": "4.2.3",
+        "text-table": "0.2.0",
         "tree-kill": "1.2.2",
-        "webpack": "4.44.1",
+        "webpack": "4.44.2",
         "webpack-dev-middleware": "3.7.2",
-        "webpack-dev-server": "3.11.0",
-        "webpack-merge": "4.2.2",
-        "webpack-sources": "1.4.3",
-        "webpack-subresource-integrity": "1.4.1",
+        "webpack-dev-server": "3.11.2",
+        "webpack-merge": "5.7.3",
+        "webpack-sources": "2.2.0",
+        "webpack-subresource-integrity": "1.5.2",
         "worker-plugin": "5.0.0"
       },
       "dependencies": {
         "@babel/core": {
-          "version": "7.11.1",
-          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.1.tgz",
-          "integrity": "sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==",
+          "version": "7.12.10",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz",
+          "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==",
           "dev": true,
           "requires": {
             "@babel/code-frame": "^7.10.4",
-            "@babel/generator": "^7.11.0",
-            "@babel/helper-module-transforms": "^7.11.0",
-            "@babel/helpers": "^7.10.4",
-            "@babel/parser": "^7.11.1",
-            "@babel/template": "^7.10.4",
-            "@babel/traverse": "^7.11.0",
-            "@babel/types": "^7.11.0",
+            "@babel/generator": "^7.12.10",
+            "@babel/helper-module-transforms": "^7.12.1",
+            "@babel/helpers": "^7.12.5",
+            "@babel/parser": "^7.12.10",
+            "@babel/template": "^7.12.7",
+            "@babel/traverse": "^7.12.10",
+            "@babel/types": "^7.12.10",
             "convert-source-map": "^1.7.0",
             "debug": "^4.1.0",
             "gensync": "^1.0.0-beta.1",
             "json5": "^2.1.2",
             "lodash": "^4.17.19",
-            "resolve": "^1.3.2",
             "semver": "^5.4.1",
             "source-map": "^0.5.0"
           },
           }
         },
         "@babel/generator": {
-          "version": "7.11.0",
-          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz",
-          "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==",
+          "version": "7.12.11",
+          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz",
+          "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==",
           "dev": true,
           "requires": {
-            "@babel/types": "^7.11.0",
+            "@babel/types": "^7.12.11",
             "jsesc": "^2.5.1",
             "source-map": "^0.5.0"
           },
             }
           }
         },
+        "@babel/runtime": {
+          "version": "7.12.5",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz",
+          "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==",
+          "dev": true,
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@babel/template": {
-          "version": "7.10.4",
-          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz",
-          "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==",
+          "version": "7.12.7",
+          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz",
+          "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==",
           "dev": true,
           "requires": {
             "@babel/code-frame": "^7.10.4",
-            "@babel/parser": "^7.10.4",
-            "@babel/types": "^7.10.4"
+            "@babel/parser": "^7.12.7",
+            "@babel/types": "^7.12.7"
           }
         },
         "core-js": {
-          "version": "3.6.4",
-          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
-          "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==",
+          "version": "3.8.3",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.3.tgz",
+          "integrity": "sha512-KPYXeVZYemC2TkNEkX/01I+7yd+nX3KddKwZ1Ww7SKWdI2wQprSgLmrTddT8nw92AjEklTsPBoSdQBhbI1bQ6Q==",
           "dev": true
         },
         "glob": {
             "path-is-absolute": "^1.0.0"
           }
         },
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "regenerator-runtime": {
+          "version": "0.13.7",
+          "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
+          "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
+          "dev": true
+        },
+        "semver": {
+          "version": "7.3.4",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+          "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "lru-cache": "^6.0.0"
           }
         },
-        "semver": {
-          "version": "7.3.2",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
-          "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
-          "dev": true
-        },
         "source-map": {
           "version": "0.7.3",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
           "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
           "dev": true
-        },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
-          "dev": true
         }
       }
     },
     "@angular-devkit/build-optimizer": {
-      "version": "0.1002.3",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.1002.3.tgz",
-      "integrity": "sha512-/0KbxVmmvt3S7ghk5zUH8/PWjW8ki0uSmPsnjopY8jRgAxuXN/7PXZbqswItNlUBoEj34hj2UADBUJVic7fcnQ==",
+      "version": "0.1102.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.1102.14.tgz",
+      "integrity": "sha512-1j69rFqE6tPMO0lQvOH8ogF7vE+p+Ws1/OtdZKUkZPOerIbQ8A3n5wzCx6/ZzMVhBQ3sXNhaShb4b9/1YuwU/g==",
       "dev": true,
       "requires": {
         "loader-utils": "2.0.0",
         "source-map": "0.7.3",
-        "tslib": "2.0.1",
-        "typescript": "4.0.2",
-        "webpack-sources": "1.4.3"
+        "tslib": "2.1.0",
+        "typescript": "4.1.5",
+        "webpack-sources": "2.2.0"
       },
       "dependencies": {
         "source-map": {
           "dev": true
         },
         "tslib": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
-          "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==",
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
+          "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==",
           "dev": true
         },
         "typescript": {
-          "version": "4.0.2",
-          "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
-          "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
+          "version": "4.1.5",
+          "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz",
+          "integrity": "sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==",
           "dev": true
         }
       }
     },
     "@angular-devkit/build-webpack": {
-      "version": "0.1002.3",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1002.3.tgz",
-      "integrity": "sha512-ngvPPA3VuYGYV275PM6X0pVI0Nl/uWx4eu2S6SUFe6mniN4BQkUHAyeCUMIbM3hkau/NAcF9xUs5AvZ9GDpvPw==",
+      "version": "0.1102.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1102.14.tgz",
+      "integrity": "sha512-+dJvzrwjbHY0bNr8fUDVbn4D4pAT/h1YVpGVyaoX7q66LN0x61zRC3e10gJ/Mr54l3yfc26M0OPD9KG8iZRbCA==",
+      "dev": true,
+      "requires": {
+        "@angular-devkit/architect": "0.1102.14",
+        "@angular-devkit/core": "11.2.14",
+        "rxjs": "6.6.3"
+      }
+    },
+    "@angular-devkit/core": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-11.2.14.tgz",
+      "integrity": "sha512-Ad1fHqLxDwhkQgLPqq9i+G65NSOoIHXQx7ILcSPACKurV3XLS1RO9BgP/BDaqHAG+WslUAPbMStaTzzPm+9dNw==",
+      "dev": true,
+      "requires": {
+        "ajv": "6.12.6",
+        "fast-json-stable-stringify": "2.1.0",
+        "magic-string": "0.25.7",
+        "rxjs": "6.6.3",
+        "source-map": "0.7.3"
+      },
+      "dependencies": {
+        "source-map": {
+          "version": "0.7.3",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+          "dev": true
+        }
+      }
+    },
+    "@angular-devkit/schematics": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-11.2.14.tgz",
+      "integrity": "sha512-Ol6+0qdGKzuVJm5gCtQr47X0OCihTfAxI4h047cHYhPFIGGPSvkG/QeJMZugflgoobi2k/xcYokOu/VAkRtWbQ==",
+      "dev": true,
+      "requires": {
+        "@angular-devkit/core": "11.2.14",
+        "ora": "5.3.0",
+        "rxjs": "6.6.3"
+      }
+    },
+    "@angular/animations": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-11.2.14.tgz",
+      "integrity": "sha512-Heq/nNrCmb3jbkusu+BQszOecfFI/31Oxxj+CDQkqqYpBcswk6bOJLoEE472o+vmgxaXbgeflU9qbIiCQhpMFA==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/cli": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-11.2.14.tgz",
+      "integrity": "sha512-8Ud7vcUK7CKjzT2Ks1glLhleAPIC5ChcrA15XtOb7k+/uMHBkMscP/UKymbVQiBjCJlglbzJoyj8cpVYTZY5KA==",
       "dev": true,
       "requires": {
-        "@angular-devkit/architect": "0.1002.3",
-        "@angular-devkit/core": "10.2.3",
-        "rxjs": "6.6.2"
+        "@angular-devkit/architect": "0.1102.14",
+        "@angular-devkit/core": "11.2.14",
+        "@angular-devkit/schematics": "11.2.14",
+        "@schematics/angular": "11.2.14",
+        "@schematics/update": "0.1102.14",
+        "@yarnpkg/lockfile": "1.1.0",
+        "ansi-colors": "4.1.1",
+        "debug": "4.3.1",
+        "ini": "2.0.0",
+        "inquirer": "7.3.3",
+        "jsonc-parser": "3.0.0",
+        "npm-package-arg": "8.1.0",
+        "npm-pick-manifest": "6.1.0",
+        "open": "7.4.0",
+        "ora": "5.3.0",
+        "pacote": "11.2.4",
+        "resolve": "1.19.0",
+        "rimraf": "3.0.2",
+        "semver": "7.3.4",
+        "symbol-observable": "3.0.0",
+        "universal-analytics": "0.4.23",
+        "uuid": "8.3.2"
       },
       "dependencies": {
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "debug": {
+          "version": "4.3.1",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "ms": "2.1.2"
           }
         },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+        "resolve": {
+          "version": "1.19.0",
+          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
+          "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
+          "dev": true,
+          "requires": {
+            "is-core-module": "^2.1.0",
+            "path-parse": "^1.0.6"
+          }
+        },
+        "semver": {
+          "version": "7.3.4",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+          "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^6.0.0"
+          }
+        },
+        "symbol-observable": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-3.0.0.tgz",
+          "integrity": "sha512-6tDOXSHiVjuCaasQSWTmHUWn4PuG7qa3+1WT031yTc/swT7+rLiw3GOrFxaH1E3lLP09dH3bVuVDf2gK5rxG3Q==",
+          "dev": true
+        },
+        "uuid": {
+          "version": "8.3.2",
+          "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+          "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
           "dev": true
         }
       }
     },
-    "@angular-devkit/core": {
-      "version": "10.2.3",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.2.3.tgz",
-      "integrity": "sha512-pMM1v9Xjqx6YLOQxQYs0D+03H6XPDZLS8cyEtoQX2iYdh8qlKHZVbJa2WsfzwMoIPtgcXfQAXn113VEgrQPLFA==",
+    "@angular/common": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/common/-/common-11.2.14.tgz",
+      "integrity": "sha512-ZSLV/3j7eCTyLf/8g4yBFLWySjiLz3vLJAGWscYoUpnJWMnug1VRu6zoF/COxCbtORgE+Wz6K0uhfS6MziBGVw==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/compiler": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.2.14.tgz",
+      "integrity": "sha512-XBOK3HgA+/y6Cz7kOX4zcJYmgJ264XnfcbXUMU2cD7Ac+mbNhLPKohWrEiSWalfcjnpf5gRfufQrQP7lpAGu0A==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/compiler-cli": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-11.2.14.tgz",
+      "integrity": "sha512-A7ltnCp03/EVqK/Q3tVUDsokgz5GHW3dSPGl0Csk7Ys5uBB9ibHTmVt4eiXA4jt0+6Bk+mKxwe5BEDqLvwYFAg==",
       "dev": true,
       "requires": {
-        "ajv": "6.12.4",
-        "fast-json-stable-stringify": "2.1.0",
-        "magic-string": "0.25.7",
-        "rxjs": "6.6.2",
-        "source-map": "0.7.3"
+        "@babel/core": "^7.8.6",
+        "@babel/types": "^7.8.6",
+        "canonical-path": "1.0.0",
+        "chokidar": "^3.0.0",
+        "convert-source-map": "^1.5.1",
+        "dependency-graph": "^0.7.2",
+        "fs-extra": "4.0.2",
+        "magic-string": "^0.25.0",
+        "minimist": "^1.2.0",
+        "reflect-metadata": "^0.1.2",
+        "semver": "^6.3.0",
+        "source-map": "^0.6.1",
+        "sourcemap-codec": "^1.4.8",
+        "tslib": "^2.0.0",
+        "yargs": "^16.2.0"
       },
       "dependencies": {
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "@babel/core": {
+          "version": "7.15.8",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.8.tgz",
+          "integrity": "sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og==",
+          "dev": true,
+          "requires": {
+            "@babel/code-frame": "^7.15.8",
+            "@babel/generator": "^7.15.8",
+            "@babel/helper-compilation-targets": "^7.15.4",
+            "@babel/helper-module-transforms": "^7.15.8",
+            "@babel/helpers": "^7.15.4",
+            "@babel/parser": "^7.15.8",
+            "@babel/template": "^7.15.4",
+            "@babel/traverse": "^7.15.4",
+            "@babel/types": "^7.15.6",
+            "convert-source-map": "^1.7.0",
+            "debug": "^4.1.0",
+            "gensync": "^1.0.0-beta.2",
+            "json5": "^2.1.2",
+            "semver": "^6.3.0",
+            "source-map": "^0.5.0"
+          },
+          "dependencies": {
+            "source-map": {
+              "version": "0.5.7",
+              "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+              "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+              "dev": true
+            }
+          }
+        },
+        "semver": {
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+          "dev": true
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
+      }
+    },
+    "@angular/core": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/core/-/core-11.2.14.tgz",
+      "integrity": "sha512-vpR4XqBGitk1Faph37CSpemwIYTmJ3pdIVNoHKP6jLonpWu+0azkchf0f7oD8/2ivj2F81opcIw0tcsy/D/5Vg==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/forms": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-11.2.14.tgz",
+      "integrity": "sha512-4LWqY6KEIk1AZQFnk+4PJSOCamlD4tumuVN06gO4D0dZo9Cx+GcvW6pM6N0CPubRvPs3sScCnu20WT11HNWC1w==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/language-service": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-11.2.14.tgz",
+      "integrity": "sha512-3+0F0X4r1WeNOV6VmaMzYnJENPVmLX2/MX3/lugwZPNYKVXl/oGyh/4PB8ktntIj0tnxQuErzqRSeucNStNGRw==",
+      "dev": true
+    },
+    "@angular/localize": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-11.2.14.tgz",
+      "integrity": "sha512-ssMuquxxqxA98LgEICEO/3JdmSflWxu5rlm/HPo28bnGiZ4IzDamZjJ1cu4S6RgsonJ1drB3Z8wkidXfEYZiWA==",
+      "requires": {
+        "@babel/core": "7.8.3",
+        "glob": "7.1.2",
+        "yargs": "^16.2.0"
+      }
+    },
+    "@angular/platform-browser": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-11.2.14.tgz",
+      "integrity": "sha512-fb7b7ss/gRoP8wLAN17W62leMgjynuyjEPU2eUoAAazsG9f2cgM+z3rK29GYncDVyYQxZUZYnjSqvL6GSXx86A==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/platform-browser-dynamic": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.2.14.tgz",
+      "integrity": "sha512-TWTPdFs6iBBcp+/YMsgCRQwdHpWGq8KjeJDJ2tfatGgBD3Gqt2YaHOMST1zPW6RkrmupytTejuVqXzeaKWFxuw==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@angular/router": {
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@angular/router/-/router-11.2.14.tgz",
+      "integrity": "sha512-3aYBmj+zrEL9yf/ntIQxHIYaWShZOBKP3U07X2mX+TPMpGlvHDnR7L6bWhQVZwewzMMz7YVR16ldg50IFuAlfA==",
+      "requires": {
+        "tslib": "^2.0.0"
+      }
+    },
+    "@applitools/dom-capture": {
+      "version": "11.0.1",
+      "resolved": "https://registry.npmjs.org/@applitools/dom-capture/-/dom-capture-11.0.1.tgz",
+      "integrity": "sha512-6W9qbm8Hvn2jzy0Y7LfVc4sOOHza8C8MvLFI/q60bjyti1lpaddZaePkdE+UJi/6cGkDaCQNjOJTLJAm2xvW8g==",
+      "dev": true,
+      "requires": {
+        "@applitools/dom-shared": "1.0.5",
+        "@applitools/functional-commons": "1.6.0"
+      },
+      "dependencies": {
+        "@applitools/dom-shared": {
+          "version": "1.0.5",
+          "resolved": "https://registry.npmjs.org/@applitools/dom-shared/-/dom-shared-1.0.5.tgz",
+          "integrity": "sha512-O2zgnnqVi3/Atq7EQjURLa73XNaDFJCj8wHht6WQtxIv1EWYnPutNTmnJSKwK7FnbJAg65OVjZylcz4EezyYZA==",
+          "dev": true
+        }
+      }
+    },
+    "@applitools/dom-shared": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/@applitools/dom-shared/-/dom-shared-1.0.7.tgz",
+      "integrity": "sha512-F0VO2YZVakHfEhilgyQzb4gNQ/By5RLcIAnUOL1uU4Th56k8+ls2qLWRbCsOpDeaiobLF8gKeQSTW8PtMlNoUQ==",
+      "dev": true
+    },
+    "@applitools/dom-snapshot": {
+      "version": "4.5.9",
+      "resolved": "https://registry.npmjs.org/@applitools/dom-snapshot/-/dom-snapshot-4.5.9.tgz",
+      "integrity": "sha512-YBFRMdVHCItD16mgodQHrwQjlZinZ1t9sY7wMTA38N/BgUXT+tlToidKTiej/vhQbAz9kayFU6L/3Xbp2WxOjg==",
+      "dev": true,
+      "requires": {
+        "@applitools/dom-shared": "1.0.7",
+        "@applitools/functional-commons": "1.6.0",
+        "css-tree": "1.0.0-alpha.39",
+        "pako": "1.0.11"
+      },
+      "dependencies": {
+        "css-tree": {
+          "version": "1.0.0-alpha.39",
+          "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.39.tgz",
+          "integrity": "sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "mdn-data": "2.0.6",
+            "source-map": "^0.6.1"
           }
         },
+        "mdn-data": {
+          "version": "2.0.6",
+          "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.6.tgz",
+          "integrity": "sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA==",
+          "dev": true
+        },
         "source-map": {
-          "version": "0.7.3",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
-          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
           "dev": true
+        }
+      }
+    },
+    "@applitools/driver": {
+      "version": "1.2.6",
+      "resolved": "https://registry.npmjs.org/@applitools/driver/-/driver-1.2.6.tgz",
+      "integrity": "sha512-t+6FQtmOuo9yZebu1xsKPfzEjduYGIS6OqlPSNp9dJcRH4G5hFXzbfZF8jyLKyuZbdjZHBGoCSoBD6/15JV7/w==",
+      "dev": true,
+      "requires": {
+        "@applitools/snippets": "2.1.7",
+        "@applitools/types": "1.0.14",
+        "@applitools/utils": "1.2.3"
+      },
+      "dependencies": {
+        "@applitools/types": {
+          "version": "1.0.14",
+          "resolved": "https://registry.npmjs.org/@applitools/types/-/types-1.0.14.tgz",
+          "integrity": "sha512-Exfi8EOGGBwpRpaLizXmsUXInXGXNU26qup7AjLJSJLYETwn3Q3W+0aLHBUbdFA87w9fPCQjXJuZxJgqsNpVig==",
+          "dev": true
+        }
+      }
+    },
+    "@applitools/eyes-cypress": {
+      "version": "3.22.6",
+      "resolved": "https://registry.npmjs.org/@applitools/eyes-cypress/-/eyes-cypress-3.22.6.tgz",
+      "integrity": "sha512-iqWVvqguHsUWajIL/e0iOOxadUG00ndcZTkxUupHyJ8G6kjs3XP6uqc+ROiFRNvco1kNL1If/zVgzcZCRlmTlA==",
+      "dev": true,
+      "requires": {
+        "@applitools/dom-snapshot": "4.5.9",
+        "@applitools/functional-commons": "1.6.0",
+        "@applitools/visual-grid-client": "15.8.36",
+        "body-parser": "1.19.0",
+        "chalk": "3.0.0",
+        "cors": "2.8.5",
+        "express": "4.17.1",
+        "lodash.flatten": "4.4.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
         },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+        "chalk": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+          "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
         }
       }
     },
-    "@angular-devkit/schematics": {
-      "version": "10.1.6",
-      "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-10.1.6.tgz",
-      "integrity": "sha512-ObV7GdFPgw8YXLOKCVg26ahfm4PGIhPGuYBb+hKo3fTyCge1o04Z7B+NGcD6QTxSkWSI+bVs9anbAt+DErgXuA==",
+    "@applitools/eyes-sdk-core": {
+      "version": "12.23.17",
+      "resolved": "https://registry.npmjs.org/@applitools/eyes-sdk-core/-/eyes-sdk-core-12.23.17.tgz",
+      "integrity": "sha512-1COGZQG5ANapX0AhDLVqi99Rf7vdsoyZKpfG7USvDaYt3rNZaEj6zgagoHhSN5bZisldCr5BftOzr78dOy1g2Q==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "10.1.6",
-        "ora": "5.0.0",
-        "rxjs": "6.6.2"
+        "@applitools/dom-capture": "11.0.1",
+        "@applitools/dom-snapshot": "4.5.9",
+        "@applitools/driver": "1.2.6",
+        "@applitools/isomorphic-fetch": "3.0.0",
+        "@applitools/logger": "1.0.4",
+        "@applitools/screenshoter": "3.2.7",
+        "@applitools/snippets": "2.1.7",
+        "@applitools/types": "1.0.15",
+        "@applitools/utils": "1.2.3",
+        "axios": "0.21.4",
+        "chalk": "3.0.0",
+        "cosmiconfig": "6.0.0",
+        "dateformat": "3.0.3",
+        "debug": "4.2.0",
+        "deepmerge": "4.2.2",
+        "stack-trace": "0.0.10",
+        "tunnel": "0.0.6"
       },
       "dependencies": {
-        "@angular-devkit/core": {
-          "version": "10.1.6",
-          "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.1.6.tgz",
-          "integrity": "sha512-RhZCbX2I+ukR6/yu1OxwtyveBkQy+knRSQ7oxsBbwkS4M0XzmUswlf0p8lTfJI9pxrJnc2SODatMfEKeOYWmkA==",
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
           "dev": true,
           "requires": {
-            "ajv": "6.12.4",
-            "fast-json-stable-stringify": "2.1.0",
-            "magic-string": "0.25.7",
-            "rxjs": "6.6.2",
-            "source-map": "0.7.3"
+            "color-convert": "^2.0.1"
           }
         },
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "chalk": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+          "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
           }
         },
-        "source-map": {
-          "version": "0.7.3",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
-          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
           "dev": true
         },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+        "cosmiconfig": {
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
+          "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
+          "dev": true,
+          "requires": {
+            "@types/parse-json": "^4.0.0",
+            "import-fresh": "^3.1.0",
+            "parse-json": "^5.0.0",
+            "path-type": "^4.0.0",
+            "yaml": "^1.7.2"
+          }
+        },
+        "debug": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
+          "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
+          "dev": true,
+          "requires": {
+            "ms": "2.1.2"
+          }
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
+    "@applitools/functional-commons": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/@applitools/functional-commons/-/functional-commons-1.6.0.tgz",
+      "integrity": "sha512-fwiF0CbeYHDEOTD/NKaFgaI8LvRcGYG2GaJJiRwcedKko16sQ8F3TK5wXfj2Ytjf+8gjwHwsEEX550z3yvDWxA==",
+      "dev": true
+    },
+    "@applitools/http-commons": {
+      "version": "2.4.5",
+      "resolved": "https://registry.npmjs.org/@applitools/http-commons/-/http-commons-2.4.5.tgz",
+      "integrity": "sha512-w1lP9aljD6FLp/wgifj/oyj/bTCiAH2PuwDJci5QKJAeymqPoRGrKvykoKOegpa5OjdmZSPD/kW40ZTHSsST5Q==",
+      "dev": true,
+      "requires": {
+        "@applitools/functional-commons": "^1.5.5",
+        "@applitools/monitoring-commons": "^1.0.19",
+        "agentkeepalive": "^4.1.0",
+        "debug": "^4.1.1",
+        "lodash.merge": "^4.6.2",
+        "node-fetch": "^2.6.0"
+      },
+      "dependencies": {
+        "node-fetch": {
+          "version": "2.6.5",
+          "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
+          "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
+          "dev": true,
+          "requires": {
+            "whatwg-url": "^5.0.0"
+          }
+        }
+      }
+    },
+    "@applitools/isomorphic-fetch": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/@applitools/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz",
+      "integrity": "sha512-7rutaN/2M5wYjOIOTKS/Zuc1Na90fJNEAqvo/jCxt7nSD1kYscHV3aCk9t7RD59gmzLMvUTIxFbjl4RUMV8qfg==",
+      "dev": true,
+      "requires": {
+        "node-fetch": "^2.3.0",
+        "whatwg-fetch": ">=0.10.0"
+      },
+      "dependencies": {
+        "node-fetch": {
+          "version": "2.6.5",
+          "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
+          "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
+          "dev": true,
+          "requires": {
+            "whatwg-url": "^5.0.0"
+          }
+        }
+      }
+    },
+    "@applitools/jsdom": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/@applitools/jsdom/-/jsdom-1.0.3.tgz",
+      "integrity": "sha512-Iy/Sw7GCzbVYdhg/yveTnss6mNma1Gr+MtYQhcd4ahG7aDyiHXYAAx8XSqO56dozaRz5trJVjQ4K8vf7NS+R+A==",
+      "dev": true,
+      "requires": {
+        "abab": "^2.0.0",
+        "acorn": "^7.4.1",
+        "acorn-globals": "^4.3.2",
+        "array-equal": "^1.0.0",
+        "cssom": "^0.4.1",
+        "cssstyle": "^2.0.0",
+        "data-urls": "^1.1.0",
+        "domexception": "^1.0.1",
+        "escodegen": "^1.11.1",
+        "html-encoding-sniffer": "^1.0.2",
+        "nwsapi": "^2.2.0",
+        "parse5": "5.1.0",
+        "pn": "^1.1.0",
+        "request": "^2.88.0",
+        "request-promise-native": "^1.0.7",
+        "saxes": "^3.1.9",
+        "symbol-tree": "^3.2.2",
+        "tough-cookie": "^3.0.1",
+        "w3c-hr-time": "^1.0.1",
+        "w3c-xmlserializer": "^1.1.2",
+        "webidl-conversions": "^4.0.2",
+        "whatwg-encoding": "^1.0.5",
+        "whatwg-mimetype": "^2.3.0",
+        "whatwg-url": "^7.0.0",
+        "ws": "^7.0.0",
+        "xml-name-validator": "^3.0.0"
+      },
+      "dependencies": {
+        "acorn": {
+          "version": "7.4.1",
+          "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+          "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+          "dev": true
+        },
+        "parse5": {
+          "version": "5.1.0",
+          "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz",
+          "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==",
+          "dev": true
+        },
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+          "dev": true
+        },
+        "tough-cookie": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz",
+          "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==",
+          "dev": true,
+          "requires": {
+            "ip-regex": "^2.1.0",
+            "psl": "^1.1.28",
+            "punycode": "^2.1.1"
+          }
+        },
+        "tr46": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
+          "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
+          "dev": true,
+          "requires": {
+            "punycode": "^2.1.0"
+          }
+        },
+        "webidl-conversions": {
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
+          "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+          "dev": true
+        },
+        "whatwg-url": {
+          "version": "7.1.0",
+          "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
+          "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
+          "dev": true,
+          "requires": {
+            "lodash.sortby": "^4.7.0",
+            "tr46": "^1.0.1",
+            "webidl-conversions": "^4.0.2"
+          }
+        },
+        "ws": {
+          "version": "7.5.5",
+          "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
+          "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
           "dev": true
         }
       }
     },
-    "@angular/animations": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-10.1.5.tgz",
-      "integrity": "sha512-RbUIluxgE5pSWWdODlcEAQuRqc/D1A2v275zBsMFjwJg3/cZl/z+RWcFJedHpJHEtbz7Aay1UWHu9jhXfA8elg==",
+    "@applitools/logger": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/@applitools/logger/-/logger-1.0.4.tgz",
+      "integrity": "sha512-GQ/OdEVUY4fnkNLXVswSxaBncIfQqsfy+H1JyI85XGTjWIH4LqV/GQqnaiet2o4SHabGe8vHs0eyoWyT0WgAnQ==",
+      "dev": true,
+      "requires": {
+        "@applitools/utils": "1.2.3",
+        "chalk": "3.0.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+          "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
+    "@applitools/monitoring-commons": {
+      "version": "1.0.19",
+      "resolved": "https://registry.npmjs.org/@applitools/monitoring-commons/-/monitoring-commons-1.0.19.tgz",
+      "integrity": "sha512-rzEOvGoiEF4KnK0PJ9I0btdwnaNlIPLYhjF1vTEG15PoucbbKpix9fYusxWlDG7kMiZya8ZycVPc0woVlNaHRQ==",
+      "dev": true,
+      "requires": {
+        "debug": "^4.1.0"
+      }
+    },
+    "@applitools/screenshoter": {
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/@applitools/screenshoter/-/screenshoter-3.2.7.tgz",
+      "integrity": "sha512-g3whjP3odQuACEYz1RyULRZuCQGnfEMcskjYTkIqx3dUHiy9EwEMTCdRo25m6QrRDoDf2I8nHk+2FhG47DO/vQ==",
+      "dev": true,
       "requires": {
-        "tslib": "^2.0.0"
+        "@applitools/snippets": "2.1.7",
+        "@applitools/utils": "1.2.3",
+        "png-async": "0.9.4"
       }
     },
-    "@angular/cli": {
-      "version": "10.1.6",
-      "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-10.1.6.tgz",
-      "integrity": "sha512-KGhYnV152aN4rZhjWHYexgCwhvb/0D0rxo0qS0tf4raEGXXuk0Inmy7da0uuu3lUNLCZFhu9lWc5+CdQydr81Q==",
+    "@applitools/snippets": {
+      "version": "2.1.7",
+      "resolved": "https://registry.npmjs.org/@applitools/snippets/-/snippets-2.1.7.tgz",
+      "integrity": "sha512-Tr4Gj7Qov/oPy+8WI4oVmmubxqpOzr8P3Wjzpl6rA57xKLg6/TiIg5oZNb4+jEmO2ShjNYLaEwRWHl7kPgb4fw==",
+      "dev": true
+    },
+    "@applitools/types": {
+      "version": "1.0.15",
+      "resolved": "https://registry.npmjs.org/@applitools/types/-/types-1.0.15.tgz",
+      "integrity": "sha512-14NqC8IrHLsl4najKJLuKcswHyKT0mIWIUiVwlv0MldItBPc2ylyYnxM6UDoRX9UGNcaPdx1GyWUdq8YpLrUJw==",
+      "dev": true
+    },
+    "@applitools/utils": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/@applitools/utils/-/utils-1.2.3.tgz",
+      "integrity": "sha512-MZXsrzeHTvjFLzpfyKRDUmZWzNxH3gWd3reqYf+1kYimALKB3CO82VDNmkaGJykrRbxEP03Yqha7fHJj9eKslQ==",
+      "dev": true
+    },
+    "@applitools/visual-grid-client": {
+      "version": "15.8.36",
+      "resolved": "https://registry.npmjs.org/@applitools/visual-grid-client/-/visual-grid-client-15.8.36.tgz",
+      "integrity": "sha512-YTIcWK76QZJYcrCDW8bEf0YHsmSSZ8lMmHMvxiMRzA+wo8QS0Vuw2eira5c/XCHo6dgC2tEMADWYIS6iE09Igg==",
       "dev": true,
       "requires": {
-        "@angular-devkit/architect": "0.1001.6",
-        "@angular-devkit/core": "10.1.6",
-        "@angular-devkit/schematics": "10.1.6",
-        "@schematics/angular": "10.1.6",
-        "@schematics/update": "0.1001.6",
-        "@yarnpkg/lockfile": "1.1.0",
-        "ansi-colors": "4.1.1",
-        "debug": "4.1.1",
-        "ini": "1.3.5",
-        "inquirer": "7.3.3",
-        "npm-package-arg": "8.0.1",
-        "npm-pick-manifest": "6.1.0",
-        "open": "7.2.0",
-        "pacote": "9.5.12",
-        "read-package-tree": "5.3.1",
-        "rimraf": "3.0.2",
-        "semver": "7.3.2",
-        "symbol-observable": "1.2.0",
-        "universal-analytics": "0.4.23",
-        "uuid": "8.3.0"
+        "@applitools/eyes-sdk-core": "12.23.17",
+        "@applitools/functional-commons": "1.6.0",
+        "@applitools/http-commons": "2.4.5",
+        "@applitools/isomorphic-fetch": "3.0.0",
+        "@applitools/jsdom": "1.0.3",
+        "abort-controller": "3.0.0",
+        "chalk": "3.0.0",
+        "he": "1.2.0",
+        "lodash.mapvalues": "4.6.0",
+        "mime-types": "2.1.27",
+        "mkdirp": "0.5.5",
+        "postcss-value-parser": "4.1.0",
+        "throat": "5.0.0"
       },
       "dependencies": {
-        "@angular-devkit/architect": {
-          "version": "0.1001.6",
-          "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1001.6.tgz",
-          "integrity": "sha512-Wy10cGRdZ/g+akXbWfv0sq/pjVJrhrilSChe03ovu8nOsbcyZp76z+rnqf3YBYN6yZpWaBB80cW4QC/ar7Kv4Q==",
-          "dev": true,
-          "requires": {
-            "@angular-devkit/core": "10.1.6",
-            "rxjs": "6.6.2"
-          }
-        },
-        "@angular-devkit/core": {
-          "version": "10.1.6",
-          "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.1.6.tgz",
-          "integrity": "sha512-RhZCbX2I+ukR6/yu1OxwtyveBkQy+knRSQ7oxsBbwkS4M0XzmUswlf0p8lTfJI9pxrJnc2SODatMfEKeOYWmkA==",
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
           "dev": true,
           "requires": {
-            "ajv": "6.12.4",
-            "fast-json-stable-stringify": "2.1.0",
-            "magic-string": "0.25.7",
-            "rxjs": "6.6.2",
-            "source-map": "0.7.3"
+            "color-convert": "^2.0.1"
           }
         },
-        "ansi-colors": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
-          "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
-          "dev": true
-        },
-        "debug": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
-          "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+        "chalk": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+          "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
           "dev": true,
           "requires": {
-            "ms": "^2.1.1"
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
           }
         },
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "color-name": "~1.1.4"
           }
         },
-        "semver": {
-          "version": "7.3.2",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
-          "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
           "dev": true
         },
-        "source-map": {
-          "version": "0.7.3",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
-          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+        "mime-db": {
+          "version": "1.44.0",
+          "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
+          "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
           "dev": true
         },
-        "uuid": {
-          "version": "8.3.0",
-          "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz",
-          "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==",
-          "dev": true
-        }
-      }
-    },
-    "@angular/common": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/common/-/common-10.1.5.tgz",
-      "integrity": "sha512-xo10mSQYuf6x1XrnTfwt3Rs7JtSMkSyrJtAS/vNQKdBP/8zmn6pP9zRpp7vhQ5qF+W3HN8rPLb+YI2F6uaGjBg==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/compiler": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-10.1.5.tgz",
-      "integrity": "sha512-3LyFkEzs6P6YYKkE/6E4PasMd58EBddOt9kR9kPmj9Atv/BLY3nc5RSWkOe4rK4GnBVP+ByzQiT9Fn5CiQnG/g==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/compiler-cli": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-10.1.5.tgz",
-      "integrity": "sha512-AJ4eOHUxgDdfq/EagUlhJ6HaNlHajtmPkhXp2HmNMNN1nPN55VZSvN43Co2gdAHiFENqsTNlnQH630aXaDyVbQ==",
-      "dev": true,
-      "requires": {
-        "canonical-path": "1.0.0",
-        "chokidar": "^3.0.0",
-        "convert-source-map": "^1.5.1",
-        "dependency-graph": "^0.7.2",
-        "fs-extra": "4.0.2",
-        "magic-string": "^0.25.0",
-        "minimist": "^1.2.0",
-        "reflect-metadata": "^0.1.2",
-        "semver": "^6.3.0",
-        "source-map": "^0.6.1",
-        "sourcemap-codec": "^1.4.8",
-        "tslib": "^2.0.0",
-        "yargs": "15.3.0"
-      },
-      "dependencies": {
-        "semver": {
-          "version": "6.3.0",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
-          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
-          "dev": true
+        "mime-types": {
+          "version": "2.1.27",
+          "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
+          "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
+          "dev": true,
+          "requires": {
+            "mime-db": "1.44.0"
+          }
         },
-        "source-map": {
-          "version": "0.6.1",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
-          "dev": true
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
         }
       }
     },
-    "@angular/core": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/core/-/core-10.1.5.tgz",
-      "integrity": "sha512-B8j1B5vkBmzyan78kMJhw7dfhe7znmujbeDU7qRgRcIllc9pVJv7D133Yze6JFiLVg21PfyFYs8FBJNeq39hxQ==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/forms": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-10.1.5.tgz",
-      "integrity": "sha512-fkXKCwXL0XeFMUkmzJpm+FHYrv1CCfFGxYEBQ/bzfd3Op+dFJqEPiOwK3wG943Y09THday6H509RwwEIyF/4yw==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/language-service": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-10.1.5.tgz",
-      "integrity": "sha512-D3y97MciUx8txpwkRnMPOhPI1fyPJCGL0JwNOO0jq1qNKMzwRRetaacKUkv1apCZWU7r2PuL2GlJM6tIX5Ml3Q==",
-      "dev": true
-    },
-    "@angular/localize": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-10.1.5.tgz",
-      "integrity": "sha512-wEiF9lLWulTwGFqFJ4dJ+mBiyylE0amJR4leUGHKu6iwjPUQUBCqReCapfvLLTfgt3nbq7DtVqlqxj7KW7w+xg==",
-      "requires": {
-        "@babel/core": "7.8.3",
-        "glob": "7.1.2",
-        "yargs": "15.3.0"
-      }
-    },
-    "@angular/platform-browser": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-10.1.5.tgz",
-      "integrity": "sha512-qMAoPHt6dgXMtieI4zx/s5yX7FFRRUDp1R4GMBCZHPN3p66WdEVxBJo4p5RWhZJioXpUwKz8Xvc+Rrh7r0KDBA==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/platform-browser-dynamic": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-10.1.5.tgz",
-      "integrity": "sha512-wxHm1UFCtB+oU+IJ6pACGmjO9H8KVzJOLYL5hp2w0k8s7k7Zg73f6BdRgWWEEYv6uYIfF77qtKwgbH0X5H9S+w==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
-    "@angular/router": {
-      "version": "10.1.5",
-      "resolved": "https://registry.npmjs.org/@angular/router/-/router-10.1.5.tgz",
-      "integrity": "sha512-tY88ZzoBrc9K67wi5V1NLnurd3r9bYR2csZ6/zJeOE+Vdxz9ChSaglgh9T0vQdbVEAjVGPP5QtYaFO2Xv4qOIg==",
-      "requires": {
-        "tslib": "^2.0.0"
-      }
-    },
     "@babel/code-frame": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
-      "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz",
+      "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==",
       "requires": {
-        "@babel/highlight": "^7.12.13"
+        "@babel/highlight": "^7.14.5"
       }
     },
     "@babel/compat-data": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz",
-      "integrity": "sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q==",
+      "version": "7.15.0",
+      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz",
+      "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==",
       "dev": true
     },
     "@babel/core": {
       }
     },
     "@babel/generator": {
-      "version": "7.14.1",
-      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz",
-      "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==",
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz",
+      "integrity": "sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g==",
       "requires": {
-        "@babel/types": "^7.14.1",
+        "@babel/types": "^7.15.6",
         "jsesc": "^2.5.1",
         "source-map": "^0.5.0"
       }
     },
     "@babel/helper-annotate-as-pure": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz",
-      "integrity": "sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz",
+      "integrity": "sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.12.13"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-builder-binary-assignment-operator-visitor": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz",
-      "integrity": "sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz",
+      "integrity": "sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q==",
       "dev": true,
       "requires": {
-        "@babel/helper-explode-assignable-expression": "^7.12.13",
-        "@babel/types": "^7.12.13"
+        "@babel/helper-explode-assignable-expression": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-compilation-targets": {
-      "version": "7.13.16",
-      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz",
-      "integrity": "sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz",
+      "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==",
       "dev": true,
       "requires": {
-        "@babel/compat-data": "^7.13.15",
-        "@babel/helper-validator-option": "^7.12.17",
-        "browserslist": "^4.14.5",
+        "@babel/compat-data": "^7.15.0",
+        "@babel/helper-validator-option": "^7.14.5",
+        "browserslist": "^4.16.6",
         "semver": "^6.3.0"
       },
       "dependencies": {
       }
     },
     "@babel/helper-create-class-features-plugin": {
-      "version": "7.14.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.1.tgz",
-      "integrity": "sha512-r8rsUahG4ywm0QpGcCrLaUSOuNAISR3IZCg4Fx05Ozq31aCUrQsTLH6KPxy0N5ULoQ4Sn9qjNdGNtbPWAC6hYg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz",
+      "integrity": "sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw==",
       "dev": true,
       "requires": {
-        "@babel/helper-annotate-as-pure": "^7.12.13",
-        "@babel/helper-function-name": "^7.12.13",
-        "@babel/helper-member-expression-to-functions": "^7.13.12",
-        "@babel/helper-optimise-call-expression": "^7.12.13",
-        "@babel/helper-replace-supers": "^7.13.12",
-        "@babel/helper-split-export-declaration": "^7.12.13"
+        "@babel/helper-annotate-as-pure": "^7.15.4",
+        "@babel/helper-function-name": "^7.15.4",
+        "@babel/helper-member-expression-to-functions": "^7.15.4",
+        "@babel/helper-optimise-call-expression": "^7.15.4",
+        "@babel/helper-replace-supers": "^7.15.4",
+        "@babel/helper-split-export-declaration": "^7.15.4"
       }
     },
     "@babel/helper-create-regexp-features-plugin": {
-      "version": "7.12.17",
-      "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz",
-      "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz",
+      "integrity": "sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A==",
       "dev": true,
       "requires": {
-        "@babel/helper-annotate-as-pure": "^7.12.13",
+        "@babel/helper-annotate-as-pure": "^7.14.5",
         "regexpu-core": "^4.7.1"
       }
     },
     "@babel/helper-explode-assignable-expression": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz",
-      "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz",
+      "integrity": "sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.13.0"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-function-name": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz",
-      "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz",
+      "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==",
       "requires": {
-        "@babel/helper-get-function-arity": "^7.12.13",
-        "@babel/template": "^7.12.13",
-        "@babel/types": "^7.12.13"
+        "@babel/helper-get-function-arity": "^7.15.4",
+        "@babel/template": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-get-function-arity": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz",
-      "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz",
+      "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==",
       "requires": {
-        "@babel/types": "^7.12.13"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-hoist-variables": {
-      "version": "7.13.16",
-      "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.16.tgz",
-      "integrity": "sha512-1eMtTrXtrwscjcAeO4BVK+vvkxaLJSPFz1w1KLawz6HLNi9bPFGBNwwDyVfiu1Tv/vRRFYfoGaKhmAQPGPn5Wg==",
-      "dev": true,
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz",
+      "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==",
       "requires": {
-        "@babel/traverse": "^7.13.15",
-        "@babel/types": "^7.13.16"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-member-expression-to-functions": {
-      "version": "7.13.12",
-      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz",
-      "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz",
+      "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.13.12"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-module-imports": {
-      "version": "7.13.12",
-      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz",
-      "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz",
+      "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.13.12"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-module-transforms": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz",
-      "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==",
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz",
+      "integrity": "sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-imports": "^7.13.12",
-        "@babel/helper-replace-supers": "^7.13.12",
-        "@babel/helper-simple-access": "^7.13.12",
-        "@babel/helper-split-export-declaration": "^7.12.13",
-        "@babel/helper-validator-identifier": "^7.14.0",
-        "@babel/template": "^7.12.13",
-        "@babel/traverse": "^7.14.0",
-        "@babel/types": "^7.14.0"
+        "@babel/helper-module-imports": "^7.15.4",
+        "@babel/helper-replace-supers": "^7.15.4",
+        "@babel/helper-simple-access": "^7.15.4",
+        "@babel/helper-split-export-declaration": "^7.15.4",
+        "@babel/helper-validator-identifier": "^7.15.7",
+        "@babel/template": "^7.15.4",
+        "@babel/traverse": "^7.15.4",
+        "@babel/types": "^7.15.6"
       }
     },
     "@babel/helper-optimise-call-expression": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz",
-      "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz",
+      "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.12.13"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-plugin-utils": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz",
-      "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz",
+      "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==",
       "dev": true
     },
     "@babel/helper-remap-async-to-generator": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz",
-      "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz",
+      "integrity": "sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-annotate-as-pure": "^7.12.13",
-        "@babel/helper-wrap-function": "^7.13.0",
-        "@babel/types": "^7.13.0"
+        "@babel/helper-annotate-as-pure": "^7.15.4",
+        "@babel/helper-wrap-function": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-replace-supers": {
-      "version": "7.13.12",
-      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz",
-      "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz",
+      "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==",
       "dev": true,
       "requires": {
-        "@babel/helper-member-expression-to-functions": "^7.13.12",
-        "@babel/helper-optimise-call-expression": "^7.12.13",
-        "@babel/traverse": "^7.13.0",
-        "@babel/types": "^7.13.12"
+        "@babel/helper-member-expression-to-functions": "^7.15.4",
+        "@babel/helper-optimise-call-expression": "^7.15.4",
+        "@babel/traverse": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-simple-access": {
-      "version": "7.13.12",
-      "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz",
-      "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz",
+      "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.13.12"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-skip-transparent-expression-wrappers": {
-      "version": "7.12.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz",
-      "integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz",
+      "integrity": "sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A==",
       "dev": true,
       "requires": {
-        "@babel/types": "^7.12.1"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-split-export-declaration": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz",
-      "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz",
+      "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==",
       "requires": {
-        "@babel/types": "^7.12.13"
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helper-validator-identifier": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
-      "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A=="
+      "version": "7.15.7",
+      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
+      "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w=="
     },
     "@babel/helper-validator-option": {
-      "version": "7.12.17",
-      "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz",
-      "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz",
+      "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==",
       "dev": true
     },
     "@babel/helper-wrap-function": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz",
-      "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz",
+      "integrity": "sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw==",
       "dev": true,
       "requires": {
-        "@babel/helper-function-name": "^7.12.13",
-        "@babel/template": "^7.12.13",
-        "@babel/traverse": "^7.13.0",
-        "@babel/types": "^7.13.0"
+        "@babel/helper-function-name": "^7.15.4",
+        "@babel/template": "^7.15.4",
+        "@babel/traverse": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/helpers": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz",
-      "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz",
+      "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==",
       "requires": {
-        "@babel/template": "^7.12.13",
-        "@babel/traverse": "^7.14.0",
-        "@babel/types": "^7.14.0"
+        "@babel/template": "^7.15.4",
+        "@babel/traverse": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/highlight": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
-      "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
+      "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
       "requires": {
-        "@babel/helper-validator-identifier": "^7.14.0",
+        "@babel/helper-validator-identifier": "^7.14.5",
         "chalk": "^2.0.0",
         "js-tokens": "^4.0.0"
       }
     },
     "@babel/parser": {
-      "version": "7.14.1",
-      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz",
-      "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q=="
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.8.tgz",
+      "integrity": "sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA=="
     },
     "@babel/plugin-proposal-async-generator-functions": {
-      "version": "7.13.15",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz",
-      "integrity": "sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA==",
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.8.tgz",
+      "integrity": "sha512-2Z5F2R2ibINTc63mY7FLqGfEbmofrHU9FitJW1Q7aPaKFhiPvSq6QEt/BoWN5oME3GVyjcRuNNSRbb9LC0CSWA==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-remap-async-to-generator": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-remap-async-to-generator": "^7.15.4",
         "@babel/plugin-syntax-async-generators": "^7.8.4"
       }
     },
     "@babel/plugin-proposal-class-properties": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz",
-      "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz",
+      "integrity": "sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-class-features-plugin": "^7.13.0",
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-create-class-features-plugin": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-proposal-dynamic-import": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz",
-      "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz",
+      "integrity": "sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-dynamic-import": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-export-namespace-from": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz",
-      "integrity": "sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz",
+      "integrity": "sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-export-namespace-from": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-json-strings": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz",
-      "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz",
+      "integrity": "sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-json-strings": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-logical-assignment-operators": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz",
-      "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz",
+      "integrity": "sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
       }
     },
     "@babel/plugin-proposal-nullish-coalescing-operator": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz",
-      "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz",
+      "integrity": "sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-numeric-separator": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz",
-      "integrity": "sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz",
+      "integrity": "sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-numeric-separator": "^7.10.4"
       }
     },
     "@babel/plugin-proposal-object-rest-spread": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz",
-      "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==",
+      "version": "7.15.6",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz",
+      "integrity": "sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg==",
       "dev": true,
       "requires": {
-        "@babel/compat-data": "^7.13.8",
-        "@babel/helper-compilation-targets": "^7.13.8",
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/compat-data": "^7.15.0",
+        "@babel/helper-compilation-targets": "^7.15.4",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
-        "@babel/plugin-transform-parameters": "^7.13.0"
+        "@babel/plugin-transform-parameters": "^7.15.4"
       }
     },
     "@babel/plugin-proposal-optional-catch-binding": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz",
-      "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz",
+      "integrity": "sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-optional-chaining": {
-      "version": "7.13.12",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz",
-      "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz",
+      "integrity": "sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1",
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5",
         "@babel/plugin-syntax-optional-chaining": "^7.8.3"
       }
     },
     "@babel/plugin-proposal-private-methods": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz",
-      "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz",
+      "integrity": "sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-class-features-plugin": "^7.13.0",
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-create-class-features-plugin": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-proposal-unicode-property-regex": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz",
-      "integrity": "sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz",
+      "integrity": "sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-regexp-features-plugin": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-create-regexp-features-plugin": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-syntax-async-generators": {
       }
     },
     "@babel/plugin-syntax-top-level-await": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz",
-      "integrity": "sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz",
+      "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-arrow-functions": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz",
-      "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz",
+      "integrity": "sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-async-to-generator": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz",
-      "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==",
+      "version": "7.12.1",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz",
+      "integrity": "sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-imports": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-remap-async-to-generator": "^7.13.0"
+        "@babel/helper-module-imports": "^7.12.1",
+        "@babel/helper-plugin-utils": "^7.10.4",
+        "@babel/helper-remap-async-to-generator": "^7.12.1"
       }
     },
     "@babel/plugin-transform-block-scoped-functions": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz",
-      "integrity": "sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz",
+      "integrity": "sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-block-scoping": {
-      "version": "7.14.1",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.1.tgz",
-      "integrity": "sha512-2mQXd0zBrwfp0O1moWIhPpEeTKDvxyHcnma3JATVP1l+CctWBuot6OJG8LQ4DnBj4ZZPSmlb/fm4mu47EOAnVA==",
+      "version": "7.15.3",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz",
+      "integrity": "sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-classes": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz",
-      "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz",
+      "integrity": "sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg==",
       "dev": true,
       "requires": {
-        "@babel/helper-annotate-as-pure": "^7.12.13",
-        "@babel/helper-function-name": "^7.12.13",
-        "@babel/helper-optimise-call-expression": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-replace-supers": "^7.13.0",
-        "@babel/helper-split-export-declaration": "^7.12.13",
+        "@babel/helper-annotate-as-pure": "^7.15.4",
+        "@babel/helper-function-name": "^7.15.4",
+        "@babel/helper-optimise-call-expression": "^7.15.4",
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-replace-supers": "^7.15.4",
+        "@babel/helper-split-export-declaration": "^7.15.4",
         "globals": "^11.1.0"
       }
     },
     "@babel/plugin-transform-computed-properties": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz",
-      "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz",
+      "integrity": "sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-destructuring": {
-      "version": "7.13.17",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz",
-      "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==",
+      "version": "7.14.7",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz",
+      "integrity": "sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-dotall-regex": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz",
-      "integrity": "sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz",
+      "integrity": "sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-regexp-features-plugin": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-create-regexp-features-plugin": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-duplicate-keys": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz",
-      "integrity": "sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz",
+      "integrity": "sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-exponentiation-operator": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz",
-      "integrity": "sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz",
+      "integrity": "sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA==",
       "dev": true,
       "requires": {
-        "@babel/helper-builder-binary-assignment-operator-visitor": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-builder-binary-assignment-operator-visitor": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-for-of": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz",
-      "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz",
+      "integrity": "sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-function-name": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz",
-      "integrity": "sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz",
+      "integrity": "sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-function-name": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-function-name": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-literals": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz",
-      "integrity": "sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz",
+      "integrity": "sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-member-expression-literals": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz",
-      "integrity": "sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz",
+      "integrity": "sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-modules-amd": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz",
-      "integrity": "sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz",
+      "integrity": "sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-transforms": "^7.14.0",
-        "@babel/helper-plugin-utils": "^7.13.0",
+        "@babel/helper-module-transforms": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5",
         "babel-plugin-dynamic-import-node": "^2.3.3"
       }
     },
     "@babel/plugin-transform-modules-commonjs": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.0.tgz",
-      "integrity": "sha512-EX4QePlsTaRZQmw9BsoPeyh5OCtRGIhwfLquhxGp5e32w+dyL8htOcDwamlitmNFK6xBZYlygjdye9dbd9rUlQ==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz",
+      "integrity": "sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-transforms": "^7.14.0",
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-simple-access": "^7.13.12",
+        "@babel/helper-module-transforms": "^7.15.4",
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-simple-access": "^7.15.4",
         "babel-plugin-dynamic-import-node": "^2.3.3"
       }
     },
     "@babel/plugin-transform-modules-systemjs": {
-      "version": "7.13.8",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz",
-      "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz",
+      "integrity": "sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw==",
       "dev": true,
       "requires": {
-        "@babel/helper-hoist-variables": "^7.13.0",
-        "@babel/helper-module-transforms": "^7.13.0",
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-validator-identifier": "^7.12.11",
+        "@babel/helper-hoist-variables": "^7.15.4",
+        "@babel/helper-module-transforms": "^7.15.4",
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-validator-identifier": "^7.14.9",
         "babel-plugin-dynamic-import-node": "^2.3.3"
       }
     },
     "@babel/plugin-transform-modules-umd": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.0.tgz",
-      "integrity": "sha512-nPZdnWtXXeY7I87UZr9VlsWme3Y0cfFFE41Wbxz4bbaexAjNMInXPFUpRRUJ8NoMm0Cw+zxbqjdPmLhcjfazMw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz",
+      "integrity": "sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-transforms": "^7.14.0",
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-module-transforms": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-named-capturing-groups-regex": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz",
-      "integrity": "sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA==",
+      "version": "7.14.9",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz",
+      "integrity": "sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-regexp-features-plugin": "^7.12.13"
+        "@babel/helper-create-regexp-features-plugin": "^7.14.5"
       }
     },
     "@babel/plugin-transform-new-target": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz",
-      "integrity": "sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz",
+      "integrity": "sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-object-super": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz",
-      "integrity": "sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz",
+      "integrity": "sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13",
-        "@babel/helper-replace-supers": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-replace-supers": "^7.14.5"
       }
     },
     "@babel/plugin-transform-parameters": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz",
-      "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz",
+      "integrity": "sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-property-literals": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz",
-      "integrity": "sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz",
+      "integrity": "sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-regenerator": {
-      "version": "7.13.15",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.13.15.tgz",
-      "integrity": "sha512-Bk9cOLSz8DiurcMETZ8E2YtIVJbFCPGW28DJWUakmyVWtQSm6Wsf0p4B4BfEr/eL2Nkhe/CICiUiMOCi1TPhuQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz",
+      "integrity": "sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg==",
       "dev": true,
       "requires": {
         "regenerator-transform": "^0.14.2"
       }
     },
     "@babel/plugin-transform-reserved-words": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz",
-      "integrity": "sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz",
+      "integrity": "sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-runtime": {
-      "version": "7.11.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.11.0.tgz",
-      "integrity": "sha512-LFEsP+t3wkYBlis8w6/kmnd6Kb1dxTd+wGJ8MlxTGzQo//ehtqlVL4S9DNUa53+dtPSQobN2CXx4d81FqC58cw==",
+      "version": "7.12.10",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.10.tgz",
+      "integrity": "sha512-xOrUfzPxw7+WDm9igMgQCbO3cJKymX7dFdsgRr1eu9n3KjjyU4pptIXbXPseQDquw+W+RuJEJMHKHNsPNNm3CA==",
       "dev": true,
       "requires": {
-        "@babel/helper-module-imports": "^7.10.4",
+        "@babel/helper-module-imports": "^7.12.5",
         "@babel/helper-plugin-utils": "^7.10.4",
-        "resolve": "^1.8.1",
         "semver": "^5.5.1"
       }
     },
     "@babel/plugin-transform-shorthand-properties": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz",
-      "integrity": "sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz",
+      "integrity": "sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-spread": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz",
-      "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==",
+      "version": "7.15.8",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.15.8.tgz",
+      "integrity": "sha512-/daZ8s2tNaRekl9YJa9X4bzjpeRZLt122cpgFnQPLGUe61PH8zMEBmYqKkW5xF5JUEh5buEGXJoQpqBmIbpmEQ==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0",
-        "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1"
+        "@babel/helper-plugin-utils": "^7.14.5",
+        "@babel/helper-skip-transparent-expression-wrappers": "^7.15.4"
       }
     },
     "@babel/plugin-transform-sticky-regex": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz",
-      "integrity": "sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz",
+      "integrity": "sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-template-literals": {
-      "version": "7.13.0",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz",
-      "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz",
+      "integrity": "sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.13.0"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-typeof-symbol": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz",
-      "integrity": "sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz",
+      "integrity": "sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-unicode-escapes": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz",
-      "integrity": "sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz",
+      "integrity": "sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA==",
       "dev": true,
       "requires": {
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/plugin-transform-unicode-regex": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz",
-      "integrity": "sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA==",
+      "version": "7.14.5",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz",
+      "integrity": "sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw==",
       "dev": true,
       "requires": {
-        "@babel/helper-create-regexp-features-plugin": "^7.12.13",
-        "@babel/helper-plugin-utils": "^7.12.13"
+        "@babel/helper-create-regexp-features-plugin": "^7.14.5",
+        "@babel/helper-plugin-utils": "^7.14.5"
       }
     },
     "@babel/preset-env": {
-      "version": "7.11.0",
-      "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.0.tgz",
-      "integrity": "sha512-2u1/k7rG/gTh02dylX2kL3S0IJNF+J6bfDSp4DI2Ma8QN6Y9x9pmAax59fsCk6QUQG0yqH47yJWA+u1I1LccAg==",
+      "version": "7.12.11",
+      "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.11.tgz",
+      "integrity": "sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw==",
       "dev": true,
       "requires": {
-        "@babel/compat-data": "^7.11.0",
-        "@babel/helper-compilation-targets": "^7.10.4",
-        "@babel/helper-module-imports": "^7.10.4",
+        "@babel/compat-data": "^7.12.7",
+        "@babel/helper-compilation-targets": "^7.12.5",
+        "@babel/helper-module-imports": "^7.12.5",
         "@babel/helper-plugin-utils": "^7.10.4",
-        "@babel/plugin-proposal-async-generator-functions": "^7.10.4",
-        "@babel/plugin-proposal-class-properties": "^7.10.4",
-        "@babel/plugin-proposal-dynamic-import": "^7.10.4",
-        "@babel/plugin-proposal-export-namespace-from": "^7.10.4",
-        "@babel/plugin-proposal-json-strings": "^7.10.4",
-        "@babel/plugin-proposal-logical-assignment-operators": "^7.11.0",
-        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
-        "@babel/plugin-proposal-numeric-separator": "^7.10.4",
-        "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
-        "@babel/plugin-proposal-optional-catch-binding": "^7.10.4",
-        "@babel/plugin-proposal-optional-chaining": "^7.11.0",
-        "@babel/plugin-proposal-private-methods": "^7.10.4",
-        "@babel/plugin-proposal-unicode-property-regex": "^7.10.4",
+        "@babel/helper-validator-option": "^7.12.11",
+        "@babel/plugin-proposal-async-generator-functions": "^7.12.1",
+        "@babel/plugin-proposal-class-properties": "^7.12.1",
+        "@babel/plugin-proposal-dynamic-import": "^7.12.1",
+        "@babel/plugin-proposal-export-namespace-from": "^7.12.1",
+        "@babel/plugin-proposal-json-strings": "^7.12.1",
+        "@babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
+        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
+        "@babel/plugin-proposal-numeric-separator": "^7.12.7",
+        "@babel/plugin-proposal-object-rest-spread": "^7.12.1",
+        "@babel/plugin-proposal-optional-catch-binding": "^7.12.1",
+        "@babel/plugin-proposal-optional-chaining": "^7.12.7",
+        "@babel/plugin-proposal-private-methods": "^7.12.1",
+        "@babel/plugin-proposal-unicode-property-regex": "^7.12.1",
         "@babel/plugin-syntax-async-generators": "^7.8.0",
-        "@babel/plugin-syntax-class-properties": "^7.10.4",
+        "@babel/plugin-syntax-class-properties": "^7.12.1",
         "@babel/plugin-syntax-dynamic-import": "^7.8.0",
         "@babel/plugin-syntax-export-namespace-from": "^7.8.3",
         "@babel/plugin-syntax-json-strings": "^7.8.0",
         "@babel/plugin-syntax-object-rest-spread": "^7.8.0",
         "@babel/plugin-syntax-optional-catch-binding": "^7.8.0",
         "@babel/plugin-syntax-optional-chaining": "^7.8.0",
-        "@babel/plugin-syntax-top-level-await": "^7.10.4",
-        "@babel/plugin-transform-arrow-functions": "^7.10.4",
-        "@babel/plugin-transform-async-to-generator": "^7.10.4",
-        "@babel/plugin-transform-block-scoped-functions": "^7.10.4",
-        "@babel/plugin-transform-block-scoping": "^7.10.4",
-        "@babel/plugin-transform-classes": "^7.10.4",
-        "@babel/plugin-transform-computed-properties": "^7.10.4",
-        "@babel/plugin-transform-destructuring": "^7.10.4",
-        "@babel/plugin-transform-dotall-regex": "^7.10.4",
-        "@babel/plugin-transform-duplicate-keys": "^7.10.4",
-        "@babel/plugin-transform-exponentiation-operator": "^7.10.4",
-        "@babel/plugin-transform-for-of": "^7.10.4",
-        "@babel/plugin-transform-function-name": "^7.10.4",
-        "@babel/plugin-transform-literals": "^7.10.4",
-        "@babel/plugin-transform-member-expression-literals": "^7.10.4",
-        "@babel/plugin-transform-modules-amd": "^7.10.4",
-        "@babel/plugin-transform-modules-commonjs": "^7.10.4",
-        "@babel/plugin-transform-modules-systemjs": "^7.10.4",
-        "@babel/plugin-transform-modules-umd": "^7.10.4",
-        "@babel/plugin-transform-named-capturing-groups-regex": "^7.10.4",
-        "@babel/plugin-transform-new-target": "^7.10.4",
-        "@babel/plugin-transform-object-super": "^7.10.4",
-        "@babel/plugin-transform-parameters": "^7.10.4",
-        "@babel/plugin-transform-property-literals": "^7.10.4",
-        "@babel/plugin-transform-regenerator": "^7.10.4",
-        "@babel/plugin-transform-reserved-words": "^7.10.4",
-        "@babel/plugin-transform-shorthand-properties": "^7.10.4",
-        "@babel/plugin-transform-spread": "^7.11.0",
-        "@babel/plugin-transform-sticky-regex": "^7.10.4",
-        "@babel/plugin-transform-template-literals": "^7.10.4",
-        "@babel/plugin-transform-typeof-symbol": "^7.10.4",
-        "@babel/plugin-transform-unicode-escapes": "^7.10.4",
-        "@babel/plugin-transform-unicode-regex": "^7.10.4",
+        "@babel/plugin-syntax-top-level-await": "^7.12.1",
+        "@babel/plugin-transform-arrow-functions": "^7.12.1",
+        "@babel/plugin-transform-async-to-generator": "^7.12.1",
+        "@babel/plugin-transform-block-scoped-functions": "^7.12.1",
+        "@babel/plugin-transform-block-scoping": "^7.12.11",
+        "@babel/plugin-transform-classes": "^7.12.1",
+        "@babel/plugin-transform-computed-properties": "^7.12.1",
+        "@babel/plugin-transform-destructuring": "^7.12.1",
+        "@babel/plugin-transform-dotall-regex": "^7.12.1",
+        "@babel/plugin-transform-duplicate-keys": "^7.12.1",
+        "@babel/plugin-transform-exponentiation-operator": "^7.12.1",
+        "@babel/plugin-transform-for-of": "^7.12.1",
+        "@babel/plugin-transform-function-name": "^7.12.1",
+        "@babel/plugin-transform-literals": "^7.12.1",
+        "@babel/plugin-transform-member-expression-literals": "^7.12.1",
+        "@babel/plugin-transform-modules-amd": "^7.12.1",
+        "@babel/plugin-transform-modules-commonjs": "^7.12.1",
+        "@babel/plugin-transform-modules-systemjs": "^7.12.1",
+        "@babel/plugin-transform-modules-umd": "^7.12.1",
+        "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.1",
+        "@babel/plugin-transform-new-target": "^7.12.1",
+        "@babel/plugin-transform-object-super": "^7.12.1",
+        "@babel/plugin-transform-parameters": "^7.12.1",
+        "@babel/plugin-transform-property-literals": "^7.12.1",
+        "@babel/plugin-transform-regenerator": "^7.12.1",
+        "@babel/plugin-transform-reserved-words": "^7.12.1",
+        "@babel/plugin-transform-shorthand-properties": "^7.12.1",
+        "@babel/plugin-transform-spread": "^7.12.1",
+        "@babel/plugin-transform-sticky-regex": "^7.12.7",
+        "@babel/plugin-transform-template-literals": "^7.12.1",
+        "@babel/plugin-transform-typeof-symbol": "^7.12.10",
+        "@babel/plugin-transform-unicode-escapes": "^7.12.1",
+        "@babel/plugin-transform-unicode-regex": "^7.12.1",
         "@babel/preset-modules": "^0.1.3",
-        "@babel/types": "^7.11.0",
-        "browserslist": "^4.12.0",
-        "core-js-compat": "^3.6.2",
-        "invariant": "^2.2.2",
-        "levenary": "^1.1.1",
+        "@babel/types": "^7.12.11",
+        "core-js-compat": "^3.8.0",
         "semver": "^5.5.0"
       }
     },
     "@babel/preset-modules": {
-      "version": "0.1.4",
-      "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz",
-      "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==",
+      "version": "0.1.5",
+      "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz",
+      "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==",
       "dev": true,
       "requires": {
         "@babel/helper-plugin-utils": "^7.0.0",
       }
     },
     "@babel/runtime": {
-      "version": "7.11.2",
-      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz",
-      "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==",
-      "dev": true,
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz",
+      "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==",
       "requires": {
         "regenerator-runtime": "^0.13.4"
       }
     },
+    "@babel/runtime-corejs3": {
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz",
+      "integrity": "sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg==",
+      "requires": {
+        "core-js-pure": "^3.16.0",
+        "regenerator-runtime": "^0.13.4"
+      }
+    },
     "@babel/template": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
-      "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz",
+      "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==",
       "requires": {
-        "@babel/code-frame": "^7.12.13",
-        "@babel/parser": "^7.12.13",
-        "@babel/types": "^7.12.13"
+        "@babel/code-frame": "^7.14.5",
+        "@babel/parser": "^7.15.4",
+        "@babel/types": "^7.15.4"
       }
     },
     "@babel/traverse": {
-      "version": "7.14.0",
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz",
-      "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==",
-      "requires": {
-        "@babel/code-frame": "^7.12.13",
-        "@babel/generator": "^7.14.0",
-        "@babel/helper-function-name": "^7.12.13",
-        "@babel/helper-split-export-declaration": "^7.12.13",
-        "@babel/parser": "^7.14.0",
-        "@babel/types": "^7.14.0",
+      "version": "7.15.4",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz",
+      "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==",
+      "requires": {
+        "@babel/code-frame": "^7.14.5",
+        "@babel/generator": "^7.15.4",
+        "@babel/helper-function-name": "^7.15.4",
+        "@babel/helper-hoist-variables": "^7.15.4",
+        "@babel/helper-split-export-declaration": "^7.15.4",
+        "@babel/parser": "^7.15.4",
+        "@babel/types": "^7.15.4",
         "debug": "^4.1.0",
         "globals": "^11.1.0"
       }
     },
     "@babel/types": {
-      "version": "7.14.1",
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz",
-      "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==",
+      "version": "7.15.6",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz",
+      "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==",
       "requires": {
-        "@babel/helper-validator-identifier": "^7.14.0",
+        "@babel/helper-validator-identifier": "^7.14.9",
         "to-fast-properties": "^2.0.0"
       }
     },
       "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
       "dev": true
     },
+    "@braintree/sanitize-url": {
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-5.0.2.tgz",
+      "integrity": "sha512-NBEJlHWrhQucLhZGHtSxM2loSaNUMajC7KOYJLyfcdW/6goVoff2HoYI3bz8YCDN0wKGbxtUL0gx2dvHpvnWlw=="
+    },
     "@circlon/angular-tree-component": {
       "version": "10.0.0",
       "resolved": "https://registry.npmjs.org/@circlon/angular-tree-component/-/angular-tree-component-10.0.0.tgz",
           "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==",
           "dev": true
         },
+        "cosmiconfig": {
+          "version": "5.2.1",
+          "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
+          "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
+          "dev": true,
+          "requires": {
+            "import-fresh": "^2.0.0",
+            "is-directory": "^0.3.1",
+            "js-yaml": "^3.13.1",
+            "parse-json": "^4.0.0"
+          }
+        },
         "fs-extra": {
           "version": "8.1.0",
           "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
           }
         },
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "path-is-absolute": "^1.0.0"
           }
         },
+        "import-fresh": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
+          "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
+          "dev": true,
+          "requires": {
+            "caller-path": "^2.0.0",
+            "resolve-from": "^3.0.0"
+          }
+        },
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
+        "resolve-from": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+          "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+          "dev": true
+        },
         "semver": {
           "version": "6.3.0",
           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
         "ansi-colors": "^4.1.1",
         "fancy-log": "^1.3.3",
         "typescript": "^4.0.3"
-      },
-      "dependencies": {
-        "ansi-colors": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
-          "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
-          "dev": true
-        },
-        "typescript": {
-          "version": "4.2.4",
-          "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
-          "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
-          "dev": true
-        }
       }
     },
     "@compodoc/ngd-transformer": {
       }
     },
     "@cypress/request": {
-      "version": "2.88.5",
-      "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.5.tgz",
-      "integrity": "sha512-TzEC1XMi1hJkywWpRfD2clreTa/Z+lOrXDCxxBTBPEcY5azdPi56A6Xw+O4tWJnaJH3iIE7G5aDXZC6JgRZLcA==",
+      "version": "2.88.6",
+      "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.6.tgz",
+      "integrity": "sha512-z0UxBE/+qaESAHY9p9sM2h8Y4XqtsbDCt0/DPOrqA/RZgKi4PkxdpXyK4wCCnSk1xHqWHZZAE+gV6aDAR6+caQ==",
       "dev": true,
       "requires": {
         "aws-sign2": "~0.7.0",
         "isstream": "~0.1.2",
         "json-stringify-safe": "~5.0.1",
         "mime-types": "~2.1.19",
-        "oauth-sign": "~0.9.0",
         "performance-now": "^2.1.0",
         "qs": "~6.5.2",
         "safe-buffer": "^5.1.2",
         "tough-cookie": "~2.5.0",
         "tunnel-agent": "^0.6.0",
-        "uuid": "^3.3.2"
+        "uuid": "^8.3.2"
       },
       "dependencies": {
+        "performance-now": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+          "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+          "dev": true
+        },
         "qs": {
           "version": "6.5.2",
           "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
           "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
           "dev": true
+        },
+        "uuid": {
+          "version": "8.3.2",
+          "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+          "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+          "dev": true
         }
       }
     },
         }
       }
     },
+    "@discoveryjs/json-ext": {
+      "version": "0.5.2",
+      "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz",
+      "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==",
+      "dev": true
+    },
     "@dsherret/to-absolute-glob": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
       }
     },
     "@hapi/hoek": {
-      "version": "9.2.0",
-      "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.0.tgz",
-      "integrity": "sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug==",
+      "version": "9.2.1",
+      "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
+      "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==",
       "dev": true
     },
     "@hapi/topo": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz",
-      "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==",
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
+      "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
       "dev": true,
       "requires": {
         "@hapi/hoek": "^9.0.0"
         "resolve-from": "^5.0.0"
       },
       "dependencies": {
+        "camelcase": {
+          "version": "5.3.1",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+          "dev": true
+        },
         "resolve-from": {
           "version": "5.0.0",
           "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "jest-worker": {
-          "version": "26.6.2",
-          "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
-          "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
-          "dev": true,
-          "requires": {
-            "@types/node": "*",
-            "merge-stream": "^2.0.0",
-            "supports-color": "^7.0.0"
-          }
-        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
         "source-map": "^0.6.0"
       },
       "dependencies": {
-        "callsites": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
-          "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
-          "dev": true
-        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
         "schema-utils": "^2.7.0"
       }
     },
+    "@juggle/resize-observer": {
+      "version": "3.3.1",
+      "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.3.1.tgz",
+      "integrity": "sha512-zMM9Ds+SawiUkakS7y94Ymqx+S0ORzpG3frZirN3l+UlXUmSUR7hF4wxCVqW+ei94JzV5kt0uXBcoOEAuiydrw=="
+    },
+    "@kyleshockey/object-assign-deep": {
+      "version": "0.4.2",
+      "resolved": "https://registry.npmjs.org/@kyleshockey/object-assign-deep/-/object-assign-deep-0.4.2.tgz",
+      "integrity": "sha1-hJAPDu/DcnmPR1G1JigwuCCJIuw="
+    },
+    "@kyleshockey/xml": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/@kyleshockey/xml/-/xml-1.0.2.tgz",
+      "integrity": "sha512-iMo32MPLcI9cPxs3YL5kmKxKgDmkSZDCFEqIT5eRk7d/Ll8r4X3SwGYSigzALd6+RHWlFEmjL1QyaQ15xDZFlw==",
+      "requires": {
+        "stream": "^0.0.2"
+      }
+    },
     "@mrmlnc/readdir-enhanced": {
       "version": "2.2.1",
       "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
       }
     },
     "@ngtools/webpack": {
-      "version": "10.2.3",
-      "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-10.2.3.tgz",
-      "integrity": "sha512-h7JJMMca1bHY/0Prpxu2P3bvnC6pUKmBAfqN0h0HaRN9LTU9IDWtDRTIL1Aqhs/tcTUio/DowVKnVi2CWHAOmg==",
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-11.2.14.tgz",
+      "integrity": "sha512-6q57tEWtUJRsxfTKE19L20iXvNesfVy8hrVdyzVk64DZQh0lIl4/xZT4d5bJCWOuQQDaAeZK4YbEFcYJn7k1yw==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "10.2.3",
-        "enhanced-resolve": "4.3.0",
-        "webpack-sources": "1.4.3"
+        "@angular-devkit/core": "11.2.14",
+        "enhanced-resolve": "5.7.0",
+        "webpack-sources": "2.2.0"
       }
     },
     "@nodelib/fs.scandir": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz",
-      "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==",
+      "version": "2.1.5",
+      "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+      "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
       "dev": true,
       "requires": {
-        "@nodelib/fs.stat": "2.0.4",
+        "@nodelib/fs.stat": "2.0.5",
         "run-parallel": "^1.1.9"
       }
     },
     "@nodelib/fs.stat": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz",
-      "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==",
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+      "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
       "dev": true
     },
     "@nodelib/fs.walk": {
-      "version": "1.2.6",
-      "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz",
-      "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==",
+      "version": "1.2.8",
+      "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+      "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
       "dev": true,
       "requires": {
-        "@nodelib/fs.scandir": "2.1.4",
+        "@nodelib/fs.scandir": "2.1.5",
         "fastq": "^1.6.0"
       }
     },
+    "@npmcli/ci-detect": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz",
+      "integrity": "sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q==",
+      "dev": true
+    },
+    "@npmcli/git": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz",
+      "integrity": "sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw==",
+      "dev": true,
+      "requires": {
+        "@npmcli/promise-spawn": "^1.3.2",
+        "lru-cache": "^6.0.0",
+        "mkdirp": "^1.0.4",
+        "npm-pick-manifest": "^6.1.1",
+        "promise-inflight": "^1.0.1",
+        "promise-retry": "^2.0.1",
+        "semver": "^7.3.5",
+        "which": "^2.0.2"
+      },
+      "dependencies": {
+        "hosted-git-info": {
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz",
+          "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^6.0.0"
+          }
+        },
+        "npm-package-arg": {
+          "version": "8.1.5",
+          "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz",
+          "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==",
+          "dev": true,
+          "requires": {
+            "hosted-git-info": "^4.0.1",
+            "semver": "^7.3.4",
+            "validate-npm-package-name": "^3.0.0"
+          }
+        },
+        "npm-pick-manifest": {
+          "version": "6.1.1",
+          "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz",
+          "integrity": "sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA==",
+          "dev": true,
+          "requires": {
+            "npm-install-checks": "^4.0.0",
+            "npm-normalize-package-bin": "^1.0.1",
+            "npm-package-arg": "^8.1.2",
+            "semver": "^7.3.4"
+          }
+        },
+        "promise-retry": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
+          "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",
+          "dev": true,
+          "requires": {
+            "err-code": "^2.0.2",
+            "retry": "^0.12.0"
+          }
+        },
+        "semver": {
+          "version": "7.3.5",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+          "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^6.0.0"
+          }
+        },
+        "which": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+          "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+          "dev": true,
+          "requires": {
+            "isexe": "^2.0.0"
+          }
+        }
+      }
+    },
+    "@npmcli/installed-package-contents": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz",
+      "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==",
+      "dev": true,
+      "requires": {
+        "npm-bundled": "^1.1.1",
+        "npm-normalize-package-bin": "^1.0.1"
+      }
+    },
     "@npmcli/move-file": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz",
       "requires": {
         "mkdirp": "^1.0.4",
         "rimraf": "^3.0.2"
+      }
+    },
+    "@npmcli/node-gyp": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.3.tgz",
+      "integrity": "sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA==",
+      "dev": true
+    },
+    "@npmcli/promise-spawn": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz",
+      "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==",
+      "dev": true,
+      "requires": {
+        "infer-owner": "^1.0.4"
+      }
+    },
+    "@npmcli/run-script": {
+      "version": "1.8.6",
+      "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz",
+      "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==",
+      "dev": true,
+      "requires": {
+        "@npmcli/node-gyp": "^1.0.2",
+        "@npmcli/promise-spawn": "^1.3.2",
+        "node-gyp": "^7.1.0",
+        "read-package-json-fast": "^2.0.1"
       },
       "dependencies": {
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
+        "read-package-json-fast": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz",
+          "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==",
+          "dev": true,
+          "requires": {
+            "json-parse-even-better-errors": "^2.3.0",
+            "npm-normalize-package-bin": "^1.0.1"
+          }
         }
       }
     },
       }
     },
     "@schematics/angular": {
-      "version": "10.1.6",
-      "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-10.1.6.tgz",
-      "integrity": "sha512-+240dJ0B0th2LIhM1p8PeqFqe8unPIu7YghYJngwCzRuDpB0nvhdIdd4trNrd1eBYkYCMus25glZGJT2UuCLhg==",
+      "version": "11.2.14",
+      "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-11.2.14.tgz",
+      "integrity": "sha512-nErn5BFYp4HB7mOkt23kF+dyM6zPxolejM8eXQ5vd/rdhcc6ROaMZ0EmeEAWkfqB3+vqaSDz/D2Nm/IjJlyW/Q==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "10.1.6",
-        "@angular-devkit/schematics": "10.1.6",
-        "jsonc-parser": "2.3.0"
-      },
-      "dependencies": {
-        "@angular-devkit/core": {
-          "version": "10.1.6",
-          "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.1.6.tgz",
-          "integrity": "sha512-RhZCbX2I+ukR6/yu1OxwtyveBkQy+knRSQ7oxsBbwkS4M0XzmUswlf0p8lTfJI9pxrJnc2SODatMfEKeOYWmkA==",
-          "dev": true,
-          "requires": {
-            "ajv": "6.12.4",
-            "fast-json-stable-stringify": "2.1.0",
-            "magic-string": "0.25.7",
-            "rxjs": "6.6.2",
-            "source-map": "0.7.3"
-          }
-        },
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
-          "dev": true,
-          "requires": {
-            "tslib": "^1.9.0"
-          }
-        },
-        "source-map": {
-          "version": "0.7.3",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
-          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
-          "dev": true
-        },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
-          "dev": true
-        }
+        "@angular-devkit/core": "11.2.14",
+        "@angular-devkit/schematics": "11.2.14",
+        "jsonc-parser": "3.0.0"
       }
     },
     "@schematics/update": {
-      "version": "0.1001.6",
-      "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1001.6.tgz",
-      "integrity": "sha512-s1K8soOZsBhA++ivxq417yw3UKDmOgjsUtQQAwNbePV7o+Qwqjbjj24ki7nwNSjzkyh4d6yEj3xgCHBqTmT4lw==",
+      "version": "0.1102.14",
+      "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.1102.14.tgz",
+      "integrity": "sha512-OsWuC0iyNjpST1+hVUUZAegXAFpEFpS5uKYSQF3jsbyw8XHx7oA5/HbEwyr2WkX2EdV1tKrDLz6BrD5b8W6EYw==",
       "dev": true,
       "requires": {
-        "@angular-devkit/core": "10.1.6",
-        "@angular-devkit/schematics": "10.1.6",
+        "@angular-devkit/core": "11.2.14",
+        "@angular-devkit/schematics": "11.2.14",
         "@yarnpkg/lockfile": "1.1.0",
-        "ini": "1.3.5",
+        "ini": "2.0.0",
         "npm-package-arg": "^8.0.0",
-        "pacote": "9.5.12",
-        "semver": "7.3.2",
+        "pacote": "11.2.4",
+        "semver": "7.3.4",
         "semver-intersect": "1.4.0"
       },
       "dependencies": {
-        "@angular-devkit/core": {
-          "version": "10.1.6",
-          "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-10.1.6.tgz",
-          "integrity": "sha512-RhZCbX2I+ukR6/yu1OxwtyveBkQy+knRSQ7oxsBbwkS4M0XzmUswlf0p8lTfJI9pxrJnc2SODatMfEKeOYWmkA==",
-          "dev": true,
-          "requires": {
-            "ajv": "6.12.4",
-            "fast-json-stable-stringify": "2.1.0",
-            "magic-string": "0.25.7",
-            "rxjs": "6.6.2",
-            "source-map": "0.7.3"
-          }
-        },
-        "rxjs": {
-          "version": "6.6.2",
-          "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
-          "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
+        "semver": {
+          "version": "7.3.4",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
+          "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
           "dev": true,
           "requires": {
-            "tslib": "^1.9.0"
+            "lru-cache": "^6.0.0"
           }
-        },
-        "semver": {
-          "version": "7.3.2",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
-          "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
-          "dev": true
-        },
-        "source-map": {
-          "version": "0.7.3",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
-          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
-          "dev": true
-        },
-        "tslib": {
-          "version": "1.14.1",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
-          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
-          "dev": true
         }
       }
     },
       },
       "dependencies": {
         "@babel/core": {
-          "version": "7.14.0",
-          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.0.tgz",
-          "integrity": "sha512-8YqpRig5NmIHlMLw09zMlPTvUVMILjqCOtVgu+TVNWEBvy9b5I3RRyhqnrV4hjgEK7n8P9OqvkWJAFmEL6Wwfw==",
-          "dev": true,
-          "requires": {
-            "@babel/code-frame": "^7.12.13",
-            "@babel/generator": "^7.14.0",
-            "@babel/helper-compilation-targets": "^7.13.16",
-            "@babel/helper-module-transforms": "^7.14.0",
-            "@babel/helpers": "^7.14.0",
-            "@babel/parser": "^7.14.0",
-            "@babel/template": "^7.12.13",
-            "@babel/traverse": "^7.14.0",
-            "@babel/types": "^7.14.0",
+          "version": "7.15.8",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.8.tgz",
+          "integrity": "sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og==",
+          "dev": true,
+          "requires": {
+            "@babel/code-frame": "^7.15.8",
+            "@babel/generator": "^7.15.8",
+            "@babel/helper-compilation-targets": "^7.15.4",
+            "@babel/helper-module-transforms": "^7.15.8",
+            "@babel/helpers": "^7.15.4",
+            "@babel/parser": "^7.15.8",
+            "@babel/template": "^7.15.4",
+            "@babel/traverse": "^7.15.4",
+            "@babel/types": "^7.15.6",
             "convert-source-map": "^1.7.0",
             "debug": "^4.1.0",
             "gensync": "^1.0.0-beta.2",
         "tslib": "^2.0.0"
       }
     },
+    "@tootallnate/once": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
+      "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
+      "dev": true
+    },
+    "@trysound/sax": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
+      "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",
+      "dev": true
+    },
     "@types/babel__core": {
-      "version": "7.1.14",
-      "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz",
-      "integrity": "sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==",
+      "version": "7.1.16",
+      "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz",
+      "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==",
       "dev": true,
       "requires": {
         "@babel/parser": "^7.1.0",
       }
     },
     "@types/babel__generator": {
-      "version": "7.6.2",
-      "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz",
-      "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==",
+      "version": "7.6.3",
+      "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz",
+      "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==",
       "dev": true,
       "requires": {
         "@babel/types": "^7.0.0"
       }
     },
     "@types/babel__template": {
-      "version": "7.4.0",
-      "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz",
-      "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==",
+      "version": "7.4.1",
+      "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz",
+      "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==",
       "dev": true,
       "requires": {
         "@babel/parser": "^7.1.0",
       }
     },
     "@types/babel__traverse": {
-      "version": "7.11.1",
-      "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.1.tgz",
-      "integrity": "sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw==",
+      "version": "7.14.2",
+      "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz",
+      "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==",
       "dev": true,
       "requires": {
         "@babel/types": "^7.3.0"
       }
     },
+    "@types/brace-expansion": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/@types/brace-expansion/-/brace-expansion-1.1.0.tgz",
+      "integrity": "sha512-SaU/Kgp6z40CiF9JxlsrSrBEa+8YIry9IiCPhhYSNekeEhIAkY7iyu9aZ+5dSQIdo7mf86MUVvxWYm5GAzB/0g==",
+      "dev": true
+    },
     "@types/chart.js": {
-      "version": "2.9.32",
-      "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.32.tgz",
-      "integrity": "sha512-d45JiRQwEOlZiKwukjqmqpbqbYzUX2yrXdH9qVn6kXpPDsTYCo6YbfFOlnUaJ8S/DhJwbBJiLsMjKpW5oP8B2A==",
+      "version": "2.9.34",
+      "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.34.tgz",
+      "integrity": "sha512-CtZVk+kh1IN67dv+fB0CWmCLCRrDJgqOj15qPic2B1VCMovNO6B7Vhf/TgPpNscjhAL1j+qUntDMWb9A4ZmPTg==",
       "requires": {
         "moment": "^2.10.2"
       }
       "integrity": "sha512-g1QUuhYVVAamfCifK7oB7G3aIl4BbOyzDOqVyUfEr4tfBKrXfeH+M+Tg7HKCXSrbzxYdhyCP7z9WbKo0R2hBCw=="
     },
     "@types/glob": {
-      "version": "7.1.3",
-      "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
-      "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==",
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
+      "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
       "dev": true,
       "requires": {
         "@types/minimatch": "*",
         "@types/node": "*"
       }
     },
+    "@types/hast": {
+      "version": "2.3.4",
+      "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz",
+      "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==",
+      "requires": {
+        "@types/unist": "*"
+      }
+    },
     "@types/istanbul-lib-coverage": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
       }
     },
     "@types/json-schema": {
-      "version": "7.0.7",
-      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz",
-      "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==",
+      "version": "7.0.9",
+      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
+      "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==",
       "dev": true
     },
     "@types/lodash": {
       "dev": true
     },
     "@types/mdast": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.3.tgz",
-      "integrity": "sha512-SXPBMnFVQg1s00dlMCc/jCdvPqdE4mXaMMCeRlxLDmTAEoegHT53xKtkDnzDTOcmMHUfcjyf36/YYZ6SxRdnsw==",
+      "version": "3.0.10",
+      "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.10.tgz",
+      "integrity": "sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==",
       "dev": true,
       "requires": {
         "@types/unist": "*"
       }
     },
     "@types/minimatch": {
-      "version": "3.0.4",
-      "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz",
-      "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==",
+      "version": "3.0.5",
+      "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
+      "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
       "dev": true
     },
     "@types/minimist": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz",
-      "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==",
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz",
+      "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
       "dev": true
     },
     "@types/node": {
       "dev": true
     },
     "@types/normalize-package-data": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
-      "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz",
+      "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==",
       "dev": true
     },
     "@types/parse-json": {
       "dev": true
     },
     "@types/prettier": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.2.3.tgz",
-      "integrity": "sha512-PijRCG/K3s3w1We6ynUKdxEc5AcuuH3NBmMDP8uvKVp6X43UY7NQlTzczakXP3DJR0F4dfNQIGjU2cUeRYs2AA==",
-      "dev": true
-    },
-    "@types/q": {
-      "version": "1.5.4",
-      "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz",
-      "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==",
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
+      "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==",
       "dev": true
     },
     "@types/simplebar": {
       "dev": true
     },
     "@types/sinonjs__fake-timers": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz",
-      "integrity": "sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg==",
+      "version": "6.0.4",
+      "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz",
+      "integrity": "sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A==",
       "dev": true
     },
     "@types/sizzle": {
       "dev": true
     },
     "@types/stack-utils": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz",
-      "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz",
+      "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==",
       "dev": true
     },
-    "@types/unist": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz",
-      "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==",
+    "@types/swagger-ui": {
+      "version": "3.52.0",
+      "resolved": "https://registry.npmjs.org/@types/swagger-ui/-/swagger-ui-3.52.0.tgz",
+      "integrity": "sha512-SlufixEmh+8CLHNgTfAfCT1icNOF7bXboWabhHr1+hIolqlvfwYJGe7HgRcpI3ChE7HWASmEKLkMu34rxseJjQ==",
       "dev": true
     },
+    "@types/unist": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz",
+      "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ=="
+    },
     "@types/vfile": {
       "version": "3.0.2",
       "resolved": "https://registry.npmjs.org/@types/vfile/-/vfile-3.0.2.tgz",
       }
     },
     "@types/webpack-sources": {
-      "version": "0.1.8",
-      "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz",
-      "integrity": "sha512-JHB2/xZlXOjzjBB6fMOpH1eQAfsrpqVVIbneE0Rok16WXwFaznaI5vfg75U5WgGJm7V9W1c4xeRQDjX/zwvghA==",
+      "version": "0.1.9",
+      "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.9.tgz",
+      "integrity": "sha512-bvzMnzqoK16PQIC8AYHNdW45eREJQMd6WG/msQWX5V2+vZmODCOPb4TJcbgRljTZZTwTM4wUMcsI8FftNA7new==",
       "dev": true,
       "requires": {
         "@types/node": "*",
       }
     },
     "@types/yargs": {
-      "version": "15.0.13",
-      "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz",
-      "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==",
+      "version": "15.0.14",
+      "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz",
+      "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==",
       "dev": true,
       "requires": {
         "@types/yargs-parser": "*"
       }
     },
     "@types/yargs-parser": {
-      "version": "20.2.0",
-      "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz",
-      "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==",
+      "version": "20.2.1",
+      "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
+      "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==",
       "dev": true
     },
     "@webassemblyjs/ast": {
       "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==",
       "dev": true
     },
-    "JSONStream": {
-      "version": "1.3.5",
-      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
-      "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
-      "dev": true,
-      "requires": {
-        "jsonparse": "^1.2.0",
-        "through": ">=2.2.7 <3"
-      }
-    },
     "abab": {
       "version": "2.0.5",
       "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
       "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==",
       "dev": true
     },
+    "abbrev": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+      "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+      "dev": true
+    },
+    "abort-controller": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
+      "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
+      "dev": true,
+      "requires": {
+        "event-target-shim": "^5.0.0"
+      }
+    },
     "accepts": {
       "version": "1.3.7",
       "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
       "dev": true
     },
     "acorn-globals": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
-      "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
+      "version": "4.3.4",
+      "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz",
+      "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==",
       "dev": true,
       "requires": {
-        "acorn": "^7.1.1",
-        "acorn-walk": "^7.1.1"
-      },
-      "dependencies": {
-        "acorn": {
-          "version": "7.4.1",
-          "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
-          "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
-          "dev": true
-        }
+        "acorn": "^6.0.1",
+        "acorn-walk": "^6.0.1"
       }
     },
     "acorn-node": {
           "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
           "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
           "dev": true
+        },
+        "acorn-walk": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
+          "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+          "dev": true
         }
       }
     },
     "acorn-walk": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
-      "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+      "version": "6.2.0",
+      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz",
+      "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==",
       "dev": true
     },
     "adjust-sourcemap-loader": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-3.0.0.tgz",
-      "integrity": "sha512-YBrGyT2/uVQ/c6Rr+t6ZJXniY03YtHGMJQYal368burRGYKqhx9qGTWqcBU5s1CwYY9E/ri63RYyG1IacMZtqw==",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-4.0.0.tgz",
+      "integrity": "sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==",
       "dev": true,
       "requires": {
         "loader-utils": "^2.0.0",
       }
     },
     "agent-base": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
-      "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
+      "version": "6.0.2",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+      "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
       "dev": true,
       "requires": {
-        "es6-promisify": "^5.0.0"
+        "debug": "4"
       }
     },
     "agentkeepalive": {
-      "version": "3.5.2",
-      "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz",
-      "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==",
+      "version": "4.1.4",
+      "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz",
+      "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==",
       "dev": true,
       "requires": {
+        "debug": "^4.1.0",
+        "depd": "^1.1.2",
         "humanize-ms": "^1.2.1"
       }
     },
       }
     },
     "ajv": {
-      "version": "6.12.4",
-      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
-      "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
+      "version": "6.12.6",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+      "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
       "dev": true,
       "requires": {
         "fast-deep-equal": "^3.1.1",
       "optional": true
     },
     "ansi-colors": {
-      "version": "3.2.4",
-      "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
-      "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
+      "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
       "dev": true
     },
     "ansi-escapes": {
       "dev": true,
       "requires": {
         "type-fest": "^0.21.3"
+      },
+      "dependencies": {
+        "type-fest": {
+          "version": "0.21.3",
+          "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
+          "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
+          "dev": true
+        }
       }
     },
     "ansi-gray": {
       "dev": true
     },
     "ansi-regex": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
-      "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
     },
     "ansi-styles": {
       "version": "3.2.1",
       }
     },
     "apache-crypt": {
-      "version": "1.2.4",
-      "resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.4.tgz",
-      "integrity": "sha512-Icze5ny5W5uv3xgMgl8U+iGmRCC0iIDrb2PVPuRBtL3Zy1Y5TMewXP1Vtc4r5X9eNNBEk7KYPu0Qby9m/PmcHg==",
+      "version": "1.2.5",
+      "resolved": "https://registry.npmjs.org/apache-crypt/-/apache-crypt-1.2.5.tgz",
+      "integrity": "sha512-ICnYQH+DFVmw+S4Q0QY2XRXD8Ne8ewh8HgbuFH4K7022zCxgHM0Hz1xkRnUlEfAXNbwp1Cnhbedu60USIfDxvg==",
       "dev": true,
       "requires": {
         "unix-crypt-td-js": "^1.1.4"
       }
     },
     "apache-md5": {
-      "version": "1.1.5",
-      "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.5.tgz",
-      "integrity": "sha512-sbLEIMQrkV7RkIruqTPXxeCMkAAycv4yzTkBzRgOR1BrR5UB7qZtupqxkersTJSf0HZ3sbaNRrNV80TnnM7cUw==",
+      "version": "1.1.7",
+      "resolved": "https://registry.npmjs.org/apache-md5/-/apache-md5-1.1.7.tgz",
+      "integrity": "sha512-JtHjzZmJxtzfTSjsCyHgPR155HBe5WGyUyHTaEkfy46qhwCFKx1Epm6nAxgUG3WfUZP1dWhGqj9Z2NOBeZ+uBw==",
       "dev": true
     },
     "app-root-path": {
       "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==",
       "dev": true
     },
+    "are-we-there-yet": {
+      "version": "1.1.7",
+      "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
+      "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
+      "dev": true,
+      "requires": {
+        "delegates": "^1.0.0",
+        "readable-stream": "^2.0.6"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
+      }
+    },
     "arg": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
       "version": "1.0.10",
       "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
       "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
-      "dev": true,
       "requires": {
         "sprintf-js": "~1.0.2"
       }
       "requires": {
         "ast-types-flow": "0.0.7",
         "commander": "^2.11.0"
+      },
+      "dependencies": {
+        "commander": {
+          "version": "2.20.3",
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+          "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+          "dev": true
+        }
       }
     },
-    "arity-n": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz",
-      "integrity": "sha1-2edrEXM+CFacCEeuezmyhgswt0U=",
-      "dev": true
-    },
     "arr-diff": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
       "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
       "dev": true
     },
+    "array-equal": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
+      "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=",
+      "dev": true
+    },
     "array-find-index": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
     "asap": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
-      "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
-      "dev": true
+      "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
     },
     "asn1": {
       "version": "0.2.4",
       "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
       "dev": true
     },
+    "autolinker": {
+      "version": "3.14.3",
+      "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-3.14.3.tgz",
+      "integrity": "sha512-t81i2bCpS+s+5FIhatoww9DmpjhbdiimuU9ATEuLxtZMQ7jLv9fyFn7SWNG8IkEfD4AmYyirL1ss9k1aqVWRvg==",
+      "requires": {
+        "tslib": "^1.9.3"
+      },
+      "dependencies": {
+        "tslib": {
+          "version": "1.14.1",
+          "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+          "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+        }
+      }
+    },
     "autoprefixer": {
-      "version": "9.8.6",
-      "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.6.tgz",
-      "integrity": "sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg==",
+      "version": "10.2.4",
+      "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.4.tgz",
+      "integrity": "sha512-DCCdUQiMD+P/as8m3XkeTUkUKuuRqLGcwD0nll7wevhqoJfMRpJlkFd1+MQh1pvupjiQuip42lc/VFvfUTMSKw==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.12.0",
-        "caniuse-lite": "^1.0.30001109",
+        "browserslist": "^4.16.1",
+        "caniuse-lite": "^1.0.30001181",
         "colorette": "^1.2.1",
+        "fraction.js": "^4.0.13",
         "normalize-range": "^0.1.2",
-        "num2fraction": "^1.2.2",
-        "postcss": "^7.0.32",
         "postcss-value-parser": "^4.1.0"
       }
     },
       "dev": true
     },
     "axios": {
-      "version": "0.21.1",
-      "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
-      "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
+      "version": "0.21.4",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
+      "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
       "dev": true,
       "requires": {
-        "follow-redirects": "^1.10.0"
+        "follow-redirects": "^1.14.0"
       }
     },
     "axobject-query": {
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
       }
     },
     "babel-loader": {
-      "version": "8.1.0",
-      "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz",
-      "integrity": "sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw==",
+      "version": "8.2.2",
+      "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.2.tgz",
+      "integrity": "sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g==",
       "dev": true,
       "requires": {
-        "find-cache-dir": "^2.1.0",
+        "find-cache-dir": "^3.3.1",
         "loader-utils": "^1.4.0",
-        "mkdirp": "^0.5.3",
-        "pify": "^4.0.1",
+        "make-dir": "^3.1.0",
         "schema-utils": "^2.6.5"
       },
       "dependencies": {
-        "find-cache-dir": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
-          "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
-          "dev": true,
-          "requires": {
-            "commondir": "^1.0.1",
-            "make-dir": "^2.0.0",
-            "pkg-dir": "^3.0.0"
-          }
-        },
         "json5": {
           "version": "1.0.1",
           "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
       }
     },
     "babel-plugin-istanbul": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz",
-      "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==",
+      "version": "6.1.1",
+      "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz",
+      "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==",
       "dev": true,
       "requires": {
         "@babel/helper-plugin-utils": "^7.0.0",
         "@istanbuljs/load-nyc-config": "^1.0.0",
         "@istanbuljs/schema": "^0.1.2",
-        "istanbul-lib-instrument": "^4.0.0",
+        "istanbul-lib-instrument": "^5.0.4",
         "test-exclude": "^6.0.0"
+      },
+      "dependencies": {
+        "@babel/core": {
+          "version": "7.15.8",
+          "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.8.tgz",
+          "integrity": "sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og==",
+          "dev": true,
+          "requires": {
+            "@babel/code-frame": "^7.15.8",
+            "@babel/generator": "^7.15.8",
+            "@babel/helper-compilation-targets": "^7.15.4",
+            "@babel/helper-module-transforms": "^7.15.8",
+            "@babel/helpers": "^7.15.4",
+            "@babel/parser": "^7.15.8",
+            "@babel/template": "^7.15.4",
+            "@babel/traverse": "^7.15.4",
+            "@babel/types": "^7.15.6",
+            "convert-source-map": "^1.7.0",
+            "debug": "^4.1.0",
+            "gensync": "^1.0.0-beta.2",
+            "json5": "^2.1.2",
+            "semver": "^6.3.0",
+            "source-map": "^0.5.0"
+          }
+        },
+        "istanbul-lib-instrument": {
+          "version": "5.0.4",
+          "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.0.4.tgz",
+          "integrity": "sha512-W6jJF9rLGEISGoCyXRqa/JCGQGmmxPO10TMu7izaUTynxvBvTjqzAIIGCK9USBmIbQAaSWD6XJPrM9Pv5INknw==",
+          "dev": true,
+          "requires": {
+            "@babel/core": "^7.12.3",
+            "@babel/parser": "^7.14.7",
+            "@istanbuljs/schema": "^0.1.2",
+            "istanbul-lib-coverage": "^3.0.0",
+            "semver": "^6.3.0"
+          }
+        },
+        "semver": {
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+          "dev": true
+        }
       }
     },
     "babel-plugin-jest-hoist": {
       "version": "6.26.0",
       "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
       "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
-      "dev": true,
       "requires": {
         "core-js": "^2.4.0",
         "regenerator-runtime": "^0.11.0"
         "core-js": {
           "version": "2.6.12",
           "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
-          "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
-          "dev": true
+          "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
         },
         "regenerator-runtime": {
           "version": "0.11.1",
           "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
-          "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
-          "dev": true
+          "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
         }
       }
     },
     "base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
-      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
-      "dev": true
+      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
     },
     "basic-auth": {
       "version": "2.0.1",
       "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
       "dev": true
     },
+    "bl": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
+      "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
+      "dev": true,
+      "requires": {
+        "buffer": "^5.5.0",
+        "inherits": "^2.0.4",
+        "readable-stream": "^3.4.0"
+      }
+    },
     "blob-util": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
           "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
           "dev": true
+        },
+        "qs": {
+          "version": "6.7.0",
+          "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
+          "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
+          "dev": true
         }
       }
     },
         "safe-buffer": "^5.2.0"
       },
       "dependencies": {
-        "readable-stream": {
-          "version": "3.6.0",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
-          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
-          "dev": true,
-          "requires": {
-            "inherits": "^2.0.3",
-            "string_decoder": "^1.1.1",
-            "util-deprecate": "^1.0.1"
-          }
-        },
         "safe-buffer": {
           "version": "5.2.1",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
       }
     },
     "browserslist": {
-      "version": "4.16.6",
-      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",
-      "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==",
+      "version": "4.17.5",
+      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.5.tgz",
+      "integrity": "sha512-I3ekeB92mmpctWBoLXe0d5wPS2cBuRvvW0JyyJHMrk9/HmP2ZjrTboNAZ8iuGqaEIlKguljbQY32OkOJIRrgoA==",
       "dev": true,
       "requires": {
-        "caniuse-lite": "^1.0.30001219",
-        "colorette": "^1.2.2",
-        "electron-to-chromium": "^1.3.723",
+        "caniuse-lite": "^1.0.30001271",
+        "electron-to-chromium": "^1.3.878",
         "escalade": "^3.1.1",
-        "node-releases": "^1.1.71"
+        "node-releases": "^2.0.1",
+        "picocolors": "^1.0.0"
       }
     },
     "bs-logger": {
         "node-int64": "^0.4.0"
       }
     },
+    "btoa": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
+      "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
+    },
     "buffer": {
-      "version": "4.9.2",
-      "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz",
-      "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
+      "version": "5.7.1",
+      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+      "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
       "dev": true,
       "requires": {
-        "base64-js": "^1.0.2",
-        "ieee754": "^1.1.4",
-        "isarray": "^1.0.0"
+        "base64-js": "^1.3.1",
+        "ieee754": "^1.1.13"
       }
     },
     "buffer-crc32": {
       "dev": true
     },
     "buffer-from": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
-      "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
       "dev": true
     },
     "buffer-indexof": {
       },
       "dependencies": {
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "once": "^1.3.0",
             "path-is-absolute": "^1.0.0"
           }
-        },
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
         }
       }
     },
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
       "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
-      "dev": true,
       "requires": {
         "function-bind": "^1.1.1",
         "get-intrinsic": "^1.0.2"
       "dev": true,
       "requires": {
         "callsites": "^2.0.0"
+      },
+      "dependencies": {
+        "callsites": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
+          "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
+          "dev": true
+        }
       }
     },
     "caller-path": {
       "dev": true
     },
     "callsites": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
-      "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+      "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
       "dev": true
     },
     "camelcase": {
-      "version": "5.3.1",
-      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
-      "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
+      "version": "6.2.0",
+      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz",
+      "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==",
+      "dev": true
     },
     "camelcase-keys": {
       "version": "6.2.2",
         "camelcase": "^5.3.1",
         "map-obj": "^4.0.0",
         "quick-lru": "^4.0.1"
+      },
+      "dependencies": {
+        "camelcase": {
+          "version": "5.3.1",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+          "dev": true
+        }
       }
     },
     "can-use-dom": {
       }
     },
     "caniuse-lite": {
-      "version": "1.0.30001228",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",
-      "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==",
+      "version": "1.0.30001271",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz",
+      "integrity": "sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==",
       "dev": true
     },
     "canonical-path": {
     "character-entities": {
       "version": "1.2.4",
       "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz",
-      "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==",
-      "dev": true
+      "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw=="
     },
     "character-entities-html4": {
       "version": "1.1.4",
     "character-entities-legacy": {
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz",
-      "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==",
-      "dev": true
+      "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA=="
     },
     "character-reference-invalid": {
       "version": "1.1.4",
       "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz",
-      "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==",
-      "dev": true
+      "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg=="
     },
     "chardet": {
       "version": "0.7.0",
       "dev": true
     },
     "cheerio": {
-      "version": "1.0.0-rc.9",
-      "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.9.tgz",
-      "integrity": "sha512-QF6XVdrLONO6DXRF5iaolY+odmhj2CLj+xzNod7INPWMi/x9X4SOylH0S/vaPpX+AUU6t04s34SQNh7DbkuCng==",
+      "version": "1.0.0-rc.10",
+      "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz",
+      "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==",
       "dev": true,
       "requires": {
-        "cheerio-select": "^1.4.0",
-        "dom-serializer": "^1.3.1",
+        "cheerio-select": "^1.5.0",
+        "dom-serializer": "^1.3.2",
         "domhandler": "^4.2.0",
         "htmlparser2": "^6.1.0",
         "parse5": "^6.0.1",
         "tslib": "^2.2.0"
       },
       "dependencies": {
-        "dom-serializer": {
-          "version": "1.3.1",
-          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.1.tgz",
-          "integrity": "sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q==",
-          "dev": true,
-          "requires": {
-            "domelementtype": "^2.0.1",
-            "domhandler": "^4.0.0",
-            "entities": "^2.0.0"
-          }
-        },
-        "domelementtype": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
-          "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
-          "dev": true
-        },
         "tslib": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz",
-          "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==",
+          "version": "2.3.1",
+          "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
+          "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==",
           "dev": true
         }
       }
     },
     "cheerio-select": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.4.0.tgz",
-      "integrity": "sha512-sobR3Yqz27L553Qa7cK6rtJlMDbiKPdNywtR95Sj/YgfpLfy0u6CGJuaBKe5YE/vTc23SCRKxWSdlon/w6I/Ew==",
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz",
+      "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==",
       "dev": true,
       "requires": {
-        "css-select": "^4.1.2",
-        "css-what": "^5.0.0",
+        "css-select": "^4.1.3",
+        "css-what": "^5.0.1",
         "domelementtype": "^2.2.0",
         "domhandler": "^4.2.0",
-        "domutils": "^2.6.0"
-      },
-      "dependencies": {
-        "css-select": {
-          "version": "4.1.2",
-          "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.2.tgz",
-          "integrity": "sha512-nu5ye2Hg/4ISq4XqdLY2bEatAcLIdt3OYGFc9Tm9n7VSlFBcfRv0gBNksHRgSdUDQGtN3XrZ94ztW+NfzkFSUw==",
-          "dev": true,
-          "requires": {
-            "boolbase": "^1.0.0",
-            "css-what": "^5.0.0",
-            "domhandler": "^4.2.0",
-            "domutils": "^2.6.0",
-            "nth-check": "^2.0.0"
-          }
-        },
-        "css-what": {
-          "version": "5.0.0",
-          "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.0.tgz",
-          "integrity": "sha512-qxyKHQvgKwzwDWC/rGbT821eJalfupxYW2qbSJSAtdSTimsr/MlaGONoNLllaUPZWf8QnbcKM/kPVYUQuEKAFA==",
-          "dev": true
-        },
-        "dom-serializer": {
-          "version": "1.3.1",
-          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.1.tgz",
-          "integrity": "sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q==",
-          "dev": true,
-          "requires": {
-            "domelementtype": "^2.0.1",
-            "domhandler": "^4.0.0",
-            "entities": "^2.0.0"
-          }
-        },
-        "domelementtype": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
-          "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
-          "dev": true
-        },
-        "domutils": {
-          "version": "2.6.0",
-          "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.6.0.tgz",
-          "integrity": "sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==",
-          "dev": true,
-          "requires": {
-            "dom-serializer": "^1.0.1",
-            "domelementtype": "^2.2.0",
-            "domhandler": "^4.2.0"
-          }
-        },
-        "nth-check": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
-          "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==",
-          "dev": true,
-          "requires": {
-            "boolbase": "^1.0.0"
-          }
-        }
+        "domutils": "^2.7.0"
       }
     },
     "chokidar": {
-      "version": "3.5.1",
-      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz",
-      "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==",
+      "version": "3.5.2",
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
+      "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==",
       "dev": true,
       "requires": {
-        "anymatch": "~3.1.1",
+        "anymatch": "~3.1.2",
         "braces": "~3.0.2",
         "fsevents": "2.1.3",
-        "glob-parent": "~5.1.0",
+        "glob-parent": "~5.1.2",
         "is-binary-path": "~2.1.0",
         "is-glob": "~4.0.1",
         "normalize-path": "~3.0.0",
-        "readdirp": "~3.5.0"
+        "readdirp": "~3.6.0"
       },
       "dependencies": {
         "fsevents": {
       }
     },
     "circular-dependency-plugin": {
-      "version": "5.2.0",
-      "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.0.tgz",
-      "integrity": "sha512-7p4Kn/gffhQaavNfyDFg7LS5S/UT1JAjyGd4UqR2+jzoYF02eDkj0Ec3+48TsIa4zghjLY87nQHIh/ecK9qLdw==",
+      "version": "5.2.2",
+      "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz",
+      "integrity": "sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ==",
       "dev": true
     },
     "cjs-module-lexer": {
         }
       }
     },
+    "classnames": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz",
+      "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA=="
+    },
     "clean-stack": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
       }
     },
     "cli-spinners": {
-      "version": "2.6.0",
-      "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz",
-      "integrity": "sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q==",
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz",
+      "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==",
       "dev": true
     },
     "cli-table3": {
       "dev": true
     },
     "cliui": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
-      "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+      "version": "7.0.4",
+      "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+      "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
       "requires": {
         "string-width": "^4.2.0",
         "strip-ansi": "^6.0.0",
-        "wrap-ansi": "^6.2.0"
+        "wrap-ansi": "^7.0.0"
       }
     },
     "clone": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
-      "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
+      "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
       "dev": true
     },
+    "clone-deep": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
+      "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
+      "dev": true,
+      "requires": {
+        "is-plain-object": "^2.0.4",
+        "kind-of": "^6.0.2",
+        "shallow-clone": "^3.0.0"
+      }
+    },
     "clone-regexp": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz",
       "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
       "dev": true
     },
-    "coa": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz",
-      "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==",
-      "dev": true,
-      "requires": {
-        "@types/q": "^1.5.1",
-        "chalk": "^2.4.1",
-        "q": "^1.1.2"
-      }
-    },
     "code-block-writer": {
       "version": "7.3.1",
       "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-7.3.1.tgz",
         "object-visit": "^1.0.0"
       }
     },
-    "color": {
-      "version": "3.1.3",
-      "resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz",
-      "integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==",
-      "dev": true,
-      "requires": {
-        "color-convert": "^1.9.1",
-        "color-string": "^1.5.4"
-      }
-    },
     "color-convert": {
       "version": "1.9.3",
       "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
       "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
       "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
     },
-    "color-string": {
-      "version": "1.5.5",
-      "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz",
-      "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==",
-      "dev": true,
-      "requires": {
-        "color-name": "^1.0.0",
-        "simple-swizzle": "^0.2.2"
-      }
-    },
     "color-support": {
       "version": "1.1.3",
       "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
       "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
       "dev": true
     },
+    "colord": {
+      "version": "2.9.1",
+      "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.1.tgz",
+      "integrity": "sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw==",
+      "dev": true
+    },
     "colorette": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
-      "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz",
+      "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==",
       "dev": true
     },
     "colors": {
         "delayed-stream": "~1.0.0"
       }
     },
+    "comma-separated-tokens": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz",
+      "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw=="
+    },
     "commander": {
-      "version": "2.20.3",
-      "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
-      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
+      "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
       "dev": true
     },
     "common-tags": {
       "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
       "dev": true
     },
-    "compose-function": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz",
-      "integrity": "sha1-ntZ18TzFRQHTCVCkhv9qe6OrGF8=",
-      "dev": true,
-      "requires": {
-        "arity-n": "^1.0.4"
-      }
-    },
     "compressible": {
       "version": "2.0.18",
       "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
         "inherits": "^2.0.3",
         "readable-stream": "^2.2.2",
         "typedarray": "^0.0.6"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "connect": {
       "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==",
       "dev": true
     },
+    "console-control-strings": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
+      "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
+      "dev": true
+    },
     "constants-browserify": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
       "dev": true
     },
     "convert-source-map": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
-      "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
+      "version": "1.8.0",
+      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
+      "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
       "requires": {
         "safe-buffer": "~5.1.1"
       }
     },
     "cookie": {
-      "version": "0.4.0",
-      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
-      "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==",
-      "dev": true
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
+      "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
     },
     "cookie-signature": {
       "version": "1.0.6",
       },
       "dependencies": {
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "path-is-absolute": "^1.0.0"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
       "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
       "dev": true
     },
+    "copy-to-clipboard": {
+      "version": "3.3.1",
+      "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz",
+      "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==",
+      "requires": {
+        "toggle-selection": "^1.0.6"
+      }
+    },
     "copy-webpack-plugin": {
-      "version": "6.0.3",
-      "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.0.3.tgz",
-      "integrity": "sha512-q5m6Vz4elsuyVEIUXr7wJdIdePWTubsqVbEMvf1WQnHGv0Q+9yPRu7MtYFPt+GBOXRav9lvIINifTQ1vSCs+eA==",
+      "version": "6.3.2",
+      "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.3.2.tgz",
+      "integrity": "sha512-MgJ1uouLIbDg4ST1GzqrGQyKoXY5iPqi6fghFqarijam7FQcBa/r6Rg0VkoIuzx75Xq8iAMghyOueMkWUQ5OaA==",
       "dev": true,
       "requires": {
-        "cacache": "^15.0.4",
+        "cacache": "^15.0.5",
         "fast-glob": "^3.2.4",
         "find-cache-dir": "^3.3.1",
         "glob-parent": "^5.1.1",
         "globby": "^11.0.1",
         "loader-utils": "^2.0.0",
         "normalize-path": "^3.0.0",
-        "p-limit": "^3.0.1",
-        "schema-utils": "^2.7.0",
-        "serialize-javascript": "^4.0.0",
+        "p-limit": "^3.0.2",
+        "schema-utils": "^3.0.0",
+        "serialize-javascript": "^5.0.1",
         "webpack-sources": "^1.4.3"
       },
       "dependencies": {
           "requires": {
             "yocto-queue": "^0.1.0"
           }
+        },
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
         }
       }
     },
     "core-js": {
-      "version": "3.12.1",
-      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.12.1.tgz",
-      "integrity": "sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw=="
+      "version": "3.19.0",
+      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.19.0.tgz",
+      "integrity": "sha512-L1TpFRWXZ76vH1yLM+z6KssLZrP8Z6GxxW4auoCj+XiViOzNPJCAuTIkn03BGdFe6Z5clX5t64wRIRypsZQrUg=="
     },
     "core-js-compat": {
-      "version": "3.12.1",
-      "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.1.tgz",
-      "integrity": "sha512-i6h5qODpw6EsHAoIdQhKoZdWn+dGBF3dSS8m5tif36RlWvW3A6+yu2S16QHUo3CrkzrnEskMAt9f8FxmY9fhWQ==",
+      "version": "3.19.0",
+      "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.19.0.tgz",
+      "integrity": "sha512-R09rKZ56ccGBebjTLZHvzDxhz93YPT37gBm6qUhnwj3Kt7aCjjZWD1injyNbyeFHxNKfeZBSyds6O9n3MKq1sw==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.16.6",
+        "browserslist": "^4.17.5",
         "semver": "7.0.0"
       },
       "dependencies": {
         }
       }
     },
+    "core-js-pure": {
+      "version": "3.19.0",
+      "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.19.0.tgz",
+      "integrity": "sha512-UEQk8AxyCYvNAs6baNoPqDADv7BX0AmBLGxVsrAifPPx/C8EAzV4Q+2ZUJqVzfI2TQQEZITnwUkWcHpgc/IubQ=="
+    },
     "core-util-is": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
-      "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
       "dev": true
     },
     "cors": {
       }
     },
     "cosmiconfig": {
-      "version": "5.2.1",
-      "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
-      "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
+      "version": "7.0.1",
+      "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz",
+      "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==",
       "dev": true,
       "requires": {
-        "import-fresh": "^2.0.0",
-        "is-directory": "^0.3.1",
-        "js-yaml": "^3.13.1",
-        "parse-json": "^4.0.0"
+        "@types/parse-json": "^4.0.0",
+        "import-fresh": "^3.2.1",
+        "parse-json": "^5.0.0",
+        "path-type": "^4.0.0",
+        "yaml": "^1.10.0"
       }
     },
     "create-ecdh": {
         "sha.js": "^2.4.8"
       }
     },
+    "create-react-class": {
+      "version": "15.7.0",
+      "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz",
+      "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==",
+      "requires": {
+        "loose-envify": "^1.3.1",
+        "object-assign": "^4.1.1"
+      }
+    },
+    "critters": {
+      "version": "0.0.7",
+      "resolved": "https://registry.npmjs.org/critters/-/critters-0.0.7.tgz",
+      "integrity": "sha512-qUF2SaAWFYjNPdCcPpu68p2DnHiosia84yx5mPTlUMQjkjChR+n6sO1/I7yn2U2qNDgSPTd2SoaTIDQcUL+EwQ==",
+      "dev": true,
+      "requires": {
+        "chalk": "^4.1.0",
+        "css": "^3.0.0",
+        "parse5": "^6.0.1",
+        "parse5-htmlparser2-tree-adapter": "^6.0.1",
+        "pretty-bytes": "^5.3.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
+    "cross-fetch": {
+      "version": "3.1.4",
+      "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz",
+      "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==",
+      "requires": {
+        "node-fetch": "2.6.1"
+      },
+      "dependencies": {
+        "node-fetch": {
+          "version": "2.6.1",
+          "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
+          "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
+        }
+      }
+    },
     "cross-spawn": {
       "version": "6.0.5",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
       }
     },
     "crypto-js": {
-      "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz",
-      "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==",
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
+      "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==",
       "dev": true
     },
     "css": {
-      "version": "2.2.4",
-      "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
-      "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz",
+      "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==",
       "dev": true,
       "requires": {
-        "inherits": "^2.0.3",
+        "inherits": "^2.0.4",
         "source-map": "^0.6.1",
-        "source-map-resolve": "^0.5.2",
-        "urix": "^0.1.0"
+        "source-map-resolve": "^0.6.0"
       },
       "dependencies": {
         "source-map": {
       }
     },
     "css-color-names": {
-      "version": "0.0.4",
-      "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
-      "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=",
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-1.0.1.tgz",
+      "integrity": "sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA==",
       "dev": true
     },
     "css-declaration-sorter": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz",
-      "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==",
+      "version": "6.1.3",
+      "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz",
+      "integrity": "sha512-SvjQjNRZgh4ULK1LDJ2AduPKUKxIqmtU7ZAyi47BTV+M90Qvxr9AB6lKlLbDUfXqI9IQeYA8LbAsCZPpJEV3aA==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.1",
         "timsort": "^0.3.0"
       }
     },
     "css-loader": {
-      "version": "4.2.2",
-      "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-4.2.2.tgz",
-      "integrity": "sha512-omVGsTkZPVwVRpckeUnLshPp12KsmMSLqYxs12+RzM9jRR5Y+Idn/tBffjXRvOE+qW7if24cuceFJqYR5FmGBg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.0.1.tgz",
+      "integrity": "sha512-cXc2ti9V234cq7rJzFKhirb2L2iPy8ZjALeVJAozXYz9te3r4eqLSixNAbMDJSgJEQywqXzs8gonxaboeKqwiw==",
       "dev": true,
       "requires": {
-        "camelcase": "^6.0.0",
+        "camelcase": "^6.2.0",
         "cssesc": "^3.0.0",
-        "icss-utils": "^4.1.1",
+        "icss-utils": "^5.0.0",
         "loader-utils": "^2.0.0",
-        "postcss": "^7.0.32",
-        "postcss-modules-extract-imports": "^2.0.0",
-        "postcss-modules-local-by-default": "^3.0.3",
-        "postcss-modules-scope": "^2.2.0",
-        "postcss-modules-values": "^3.0.0",
+        "postcss": "^8.1.4",
+        "postcss-modules-extract-imports": "^3.0.0",
+        "postcss-modules-local-by-default": "^4.0.0",
+        "postcss-modules-scope": "^3.0.0",
+        "postcss-modules-values": "^4.0.0",
         "postcss-value-parser": "^4.1.0",
-        "schema-utils": "^2.7.0",
+        "schema-utils": "^3.0.0",
         "semver": "^7.3.2"
       },
       "dependencies": {
-        "camelcase": {
-          "version": "6.2.0",
-          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz",
-          "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==",
-          "dev": true
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
         },
         "semver": {
           "version": "7.3.5",
       "dev": true,
       "requires": {
         "css": "^2.0.0"
+      },
+      "dependencies": {
+        "css": {
+          "version": "2.2.4",
+          "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
+          "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==",
+          "dev": true,
+          "requires": {
+            "inherits": "^2.0.3",
+            "source-map": "^0.6.1",
+            "source-map-resolve": "^0.5.2",
+            "urix": "^0.1.0"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
+        "source-map-resolve": {
+          "version": "0.5.3",
+          "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
+          "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+          "dev": true,
+          "requires": {
+            "atob": "^2.1.2",
+            "decode-uri-component": "^0.2.0",
+            "resolve-url": "^0.2.1",
+            "source-map-url": "^0.4.0",
+            "urix": "^0.1.0"
+          }
+        }
       }
     },
     "css-select": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz",
-      "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==",
+      "version": "4.1.3",
+      "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz",
+      "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==",
       "dev": true,
       "requires": {
         "boolbase": "^1.0.0",
-        "css-what": "^3.2.1",
-        "domutils": "^1.7.0",
-        "nth-check": "^1.0.2"
+        "css-what": "^5.0.0",
+        "domhandler": "^4.2.0",
+        "domutils": "^2.6.0",
+        "nth-check": "^2.0.0"
       }
     },
-    "css-select-base-adapter": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz",
-      "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==",
-      "dev": true
-    },
     "css-selector-tokenizer": {
       "version": "0.7.3",
       "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.3.tgz",
       }
     },
     "css-tree": {
-      "version": "1.0.0-alpha.37",
-      "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz",
-      "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==",
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
+      "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
       "dev": true,
       "requires": {
-        "mdn-data": "2.0.4",
+        "mdn-data": "2.0.14",
         "source-map": "^0.6.1"
       },
       "dependencies": {
       }
     },
     "css-what": {
-      "version": "3.4.2",
-      "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz",
-      "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==",
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz",
+      "integrity": "sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==",
       "dev": true
     },
+    "css.escape": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
+      "integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s="
+    },
     "cssauron": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz",
       "dev": true
     },
     "cssnano": {
-      "version": "4.1.10",
-      "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
-      "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.0.2.tgz",
+      "integrity": "sha512-8JK3EnPsjQsULme9/e5M2hF564f/480hwsdcHvQ7ZtAIMfQ1O3SCfs+b8Mjf5KJxhYApyRshR2QSovEJi2K72Q==",
       "dev": true,
       "requires": {
-        "cosmiconfig": "^5.0.0",
-        "cssnano-preset-default": "^4.0.7",
-        "is-resolvable": "^1.0.0",
-        "postcss": "^7.0.0"
+        "cosmiconfig": "^7.0.0",
+        "cssnano-preset-default": "^5.0.1",
+        "is-resolvable": "^1.1.0"
       }
     },
     "cssnano-preset-default": {
-      "version": "4.0.8",
-      "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.8.tgz",
-      "integrity": "sha512-LdAyHuq+VRyeVREFmuxUZR1TXjQm8QQU/ktoo/x7bz+SdOge1YKc5eMN6pRW7YWBmyq59CqYba1dJ5cUukEjLQ==",
-      "dev": true,
-      "requires": {
-        "css-declaration-sorter": "^4.0.1",
-        "cssnano-util-raw-cache": "^4.0.1",
-        "postcss": "^7.0.0",
-        "postcss-calc": "^7.0.1",
-        "postcss-colormin": "^4.0.3",
-        "postcss-convert-values": "^4.0.1",
-        "postcss-discard-comments": "^4.0.2",
-        "postcss-discard-duplicates": "^4.0.2",
-        "postcss-discard-empty": "^4.0.1",
-        "postcss-discard-overridden": "^4.0.1",
-        "postcss-merge-longhand": "^4.0.11",
-        "postcss-merge-rules": "^4.0.3",
-        "postcss-minify-font-values": "^4.0.2",
-        "postcss-minify-gradients": "^4.0.2",
-        "postcss-minify-params": "^4.0.2",
-        "postcss-minify-selectors": "^4.0.2",
-        "postcss-normalize-charset": "^4.0.1",
-        "postcss-normalize-display-values": "^4.0.2",
-        "postcss-normalize-positions": "^4.0.2",
-        "postcss-normalize-repeat-style": "^4.0.2",
-        "postcss-normalize-string": "^4.0.2",
-        "postcss-normalize-timing-functions": "^4.0.2",
-        "postcss-normalize-unicode": "^4.0.1",
-        "postcss-normalize-url": "^4.0.1",
-        "postcss-normalize-whitespace": "^4.0.2",
-        "postcss-ordered-values": "^4.1.2",
-        "postcss-reduce-initial": "^4.0.3",
-        "postcss-reduce-transforms": "^4.0.2",
-        "postcss-svgo": "^4.0.3",
-        "postcss-unique-selectors": "^4.0.1"
-      }
-    },
-    "cssnano-util-get-arguments": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz",
-      "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=",
-      "dev": true
-    },
-    "cssnano-util-get-match": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz",
-      "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=",
-      "dev": true
-    },
-    "cssnano-util-raw-cache": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz",
-      "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
-    },
-    "cssnano-util-same-parent": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz",
-      "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==",
+      "version": "5.1.4",
+      "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.1.4.tgz",
+      "integrity": "sha512-sPpQNDQBI3R/QsYxQvfB4mXeEcWuw0wGtKtmS5eg8wudyStYMgKOQT39G07EbW1LB56AOYrinRS9f0ig4Y3MhQ==",
+      "dev": true,
+      "requires": {
+        "css-declaration-sorter": "^6.0.3",
+        "cssnano-utils": "^2.0.1",
+        "postcss-calc": "^8.0.0",
+        "postcss-colormin": "^5.2.0",
+        "postcss-convert-values": "^5.0.1",
+        "postcss-discard-comments": "^5.0.1",
+        "postcss-discard-duplicates": "^5.0.1",
+        "postcss-discard-empty": "^5.0.1",
+        "postcss-discard-overridden": "^5.0.1",
+        "postcss-merge-longhand": "^5.0.2",
+        "postcss-merge-rules": "^5.0.2",
+        "postcss-minify-font-values": "^5.0.1",
+        "postcss-minify-gradients": "^5.0.2",
+        "postcss-minify-params": "^5.0.1",
+        "postcss-minify-selectors": "^5.1.0",
+        "postcss-normalize-charset": "^5.0.1",
+        "postcss-normalize-display-values": "^5.0.1",
+        "postcss-normalize-positions": "^5.0.1",
+        "postcss-normalize-repeat-style": "^5.0.1",
+        "postcss-normalize-string": "^5.0.1",
+        "postcss-normalize-timing-functions": "^5.0.1",
+        "postcss-normalize-unicode": "^5.0.1",
+        "postcss-normalize-url": "^5.0.2",
+        "postcss-normalize-whitespace": "^5.0.1",
+        "postcss-ordered-values": "^5.0.2",
+        "postcss-reduce-initial": "^5.0.1",
+        "postcss-reduce-transforms": "^5.0.1",
+        "postcss-svgo": "^5.0.2",
+        "postcss-unique-selectors": "^5.0.1"
+      }
+    },
+    "cssnano-utils": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-2.0.1.tgz",
+      "integrity": "sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==",
       "dev": true
     },
     "csso": {
       "dev": true,
       "requires": {
         "css-tree": "^1.1.2"
-      },
-      "dependencies": {
-        "css-tree": {
-          "version": "1.1.3",
-          "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
-          "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==",
-          "dev": true,
-          "requires": {
-            "mdn-data": "2.0.14",
-            "source-map": "^0.6.1"
-          }
-        },
-        "mdn-data": {
-          "version": "2.0.14",
-          "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
-          "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
-          "dev": true
-        },
-        "source-map": {
-          "version": "0.6.1",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
-          "dev": true
-        }
       }
     },
     "cssom": {
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "dev": true
         },
         "is-stream": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
-          "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+          "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
           "dev": true
         },
         "jsonfile": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
       "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
-      "dev": true,
       "requires": {
         "es5-ext": "^0.10.50",
         "type": "^1.0.1"
       "dev": true
     },
     "dash-ast": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
-      "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-2.0.1.tgz",
+      "integrity": "sha512-5TXltWJGc+RdnabUGzhRae1TRq6m4gr+3K2wQX0is5/F2yS6MJXJvLyI3ErAnsAXuJoGqvfVD5icRgim07DrxQ==",
       "dev": true
     },
     "dashdash": {
       }
     },
     "data-urls": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
-      "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz",
+      "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==",
       "dev": true,
       "requires": {
-        "abab": "^2.0.3",
-        "whatwg-mimetype": "^2.3.0",
-        "whatwg-url": "^8.0.0"
+        "abab": "^2.0.0",
+        "whatwg-mimetype": "^2.2.0",
+        "whatwg-url": "^7.0.0"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+          "dev": true
+        },
+        "tr46": {
+          "version": "1.0.1",
+          "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
+          "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
+          "dev": true,
+          "requires": {
+            "punycode": "^2.1.0"
+          }
+        },
+        "webidl-conversions": {
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
+          "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+          "dev": true
+        },
+        "whatwg-url": {
+          "version": "7.1.0",
+          "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
+          "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
+          "dev": true,
+          "requires": {
+            "lodash.sortby": "^4.7.0",
+            "tr46": "^1.0.1",
+            "webidl-conversions": "^4.0.2"
+          }
+        }
       }
     },
     "date-fns": {
       "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
       "dev": true
     },
+    "dateformat": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz",
+      "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==",
+      "dev": true
+    },
     "debug": {
-      "version": "4.3.1",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
-      "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+      "version": "4.3.2",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
+      "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
       "requires": {
         "ms": "2.1.2"
       }
     },
-    "debuglog": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz",
-      "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=",
-      "dev": true
-    },
     "decache": {
       "version": "4.6.0",
       "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.0.tgz",
     "decamelize": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
-      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
+      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+      "dev": true
     },
     "decamelize-keys": {
       "version": "1.1.0",
       }
     },
     "decimal.js": {
-      "version": "10.2.1",
-      "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz",
-      "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==",
+      "version": "10.3.1",
+      "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz",
+      "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==",
       "dev": true
     },
     "decode-uri-component": {
         "regexp.prototype.flags": "^1.2.0"
       }
     },
+    "deep-extend": {
+      "version": "0.6.0",
+      "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+      "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
+    },
     "deep-is": {
-      "version": "0.1.3",
-      "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
-      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+      "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
       "dev": true
     },
     "deepmerge": {
       "dev": true,
       "requires": {
         "clone": "^1.0.2"
-      },
-      "dependencies": {
-        "clone": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
-          "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
-          "dev": true
-        }
       }
     },
     "define-properties": {
           },
           "dependencies": {
             "glob": {
-              "version": "7.1.7",
-              "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-              "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+              "version": "7.2.0",
+              "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+              "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
               "dev": true,
               "requires": {
                 "fs.realpath": "^1.0.0",
       "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
       "dev": true
     },
+    "delegates": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
+      "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
+      "dev": true
+    },
     "depd": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
       "dev": true
     },
     "detect-node": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.5.tgz",
-      "integrity": "sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw==",
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
+      "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==",
       "dev": true
     },
-    "dezalgo": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz",
-      "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=",
-      "dev": true,
-      "requires": {
-        "asap": "^2.0.0",
-        "wrappy": "1"
-      }
-    },
     "dfa": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz",
       "dev": true
     },
     "dns-packet": {
-      "version": "1.3.1",
-      "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz",
-      "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==",
+      "version": "1.3.4",
+      "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
+      "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
       "dev": true,
       "requires": {
         "ip": "^1.1.0",
       }
     },
     "dom-serializer": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
-      "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
+      "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
       "dev": true,
       "requires": {
         "domelementtype": "^2.0.1",
+        "domhandler": "^4.2.0",
         "entities": "^2.0.0"
-      },
-      "dependencies": {
-        "domelementtype": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
-          "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
-          "dev": true
-        }
       }
     },
     "domain-browser": {
       "dev": true
     },
     "domelementtype": {
-      "version": "1.3.1",
-      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
-      "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
+      "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
       "dev": true
     },
     "domexception": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
-      "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
+      "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
       "dev": true,
       "requires": {
-        "webidl-conversions": "^5.0.0"
+        "webidl-conversions": "^4.0.2"
       },
       "dependencies": {
         "webidl-conversions": {
-          "version": "5.0.0",
-          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
-          "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
+          "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
           "dev": true
         }
       }
     },
     "domhandler": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz",
-      "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==",
+      "version": "4.2.2",
+      "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.2.tgz",
+      "integrity": "sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w==",
       "dev": true,
       "requires": {
         "domelementtype": "^2.2.0"
-      },
-      "dependencies": {
-        "domelementtype": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
-          "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
-          "dev": true
-        }
       }
     },
+    "dompurify": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.3.tgz",
+      "integrity": "sha512-dqnqRkPMAjOZE0FogZ+ceJNM2dZ3V/yNOuFB7+39qpO93hHhfRpHw3heYQC7DPK9FqbQTfBKUJhiSfz4MvXYwg=="
+    },
     "domutils": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
-      "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+      "version": "2.8.0",
+      "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
+      "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
       "dev": true,
       "requires": {
-        "dom-serializer": "0",
-        "domelementtype": "1"
+        "dom-serializer": "^1.0.1",
+        "domelementtype": "^2.2.0",
+        "domhandler": "^4.2.0"
       }
     },
     "dot": {
       "dev": true,
       "requires": {
         "readable-stream": "^2.0.2"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "duplexify": {
         "inherits": "^2.0.1",
         "readable-stream": "^2.0.0",
         "stream-shift": "^1.0.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "ecc-jsbn": {
       "dev": true
     },
     "electron-to-chromium": {
-      "version": "1.3.727",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz",
-      "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==",
+      "version": "1.3.880",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.880.tgz",
+      "integrity": "sha512-iwIP/6WoeSimzUKJIQtjtpVDsK8Ir8qQCMXsUBwg+rxJR2Uh3wTNSbxoYRfs+3UWx/9MAnPIxVZCyWkm8MT0uw==",
       "dev": true
     },
     "elegant-spinner": {
         }
       }
     },
+    "emitter-component": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.1.1.tgz",
+      "integrity": "sha1-Bl4tvtaVm/RwZ57avq95gdEAOrY="
+    },
     "emittery": {
       "version": "0.7.2",
       "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz",
       "version": "0.1.13",
       "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
       "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
-      "dev": true,
       "requires": {
         "iconv-lite": "^0.6.2"
       }
       }
     },
     "enhanced-resolve": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz",
-      "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==",
+      "version": "5.7.0",
+      "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz",
+      "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==",
       "dev": true,
       "requires": {
-        "graceful-fs": "^4.1.2",
-        "memory-fs": "^0.5.0",
-        "tapable": "^1.0.0"
+        "graceful-fs": "^4.2.4",
+        "tapable": "^2.2.0"
       }
     },
     "entities": {
       "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
       "dev": true
     },
+    "env-paths": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+      "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+      "dev": true
+    },
     "err-code": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz",
-      "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=",
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
+      "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==",
       "dev": true
     },
     "errno": {
       }
     },
     "es-abstract": {
-      "version": "1.18.0",
-      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz",
-      "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==",
+      "version": "1.19.1",
+      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz",
+      "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==",
       "dev": true,
       "requires": {
         "call-bind": "^1.0.2",
         "es-to-primitive": "^1.2.1",
         "function-bind": "^1.1.1",
         "get-intrinsic": "^1.1.1",
+        "get-symbol-description": "^1.0.0",
         "has": "^1.0.3",
         "has-symbols": "^1.0.2",
-        "is-callable": "^1.2.3",
+        "internal-slot": "^1.0.3",
+        "is-callable": "^1.2.4",
         "is-negative-zero": "^2.0.1",
-        "is-regex": "^1.1.2",
-        "is-string": "^1.0.5",
-        "object-inspect": "^1.9.0",
+        "is-regex": "^1.1.4",
+        "is-shared-array-buffer": "^1.0.1",
+        "is-string": "^1.0.7",
+        "is-weakref": "^1.0.1",
+        "object-inspect": "^1.11.0",
         "object-keys": "^1.1.1",
         "object.assign": "^4.1.2",
         "string.prototype.trimend": "^1.0.4",
         "string.prototype.trimstart": "^1.0.4",
-        "unbox-primitive": "^1.0.0"
+        "unbox-primitive": "^1.0.1"
       }
     },
     "es-to-primitive": {
       "version": "0.10.53",
       "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
       "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
-      "dev": true,
       "requires": {
         "es6-iterator": "~2.0.3",
         "es6-symbol": "~3.1.3",
         "next-tick": "~1.0.0"
+      },
+      "dependencies": {
+        "next-tick": {
+          "version": "1.0.0",
+          "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
+          "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
+        }
       }
     },
     "es6-iterator": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
       "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
-      "dev": true,
       "requires": {
         "d": "1",
         "es5-ext": "^0.10.35",
         "event-emitter": "~0.3.5"
       }
     },
-    "es6-promise": {
-      "version": "4.2.8",
-      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
-      "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
-      "dev": true
-    },
-    "es6-promisify": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
-      "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
-      "dev": true,
-      "requires": {
-        "es6-promise": "^4.0.3"
-      }
-    },
     "es6-set": {
       "version": "0.1.5",
       "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
       "version": "3.1.3",
       "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
       "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
-      "dev": true,
       "requires": {
         "d": "^1.0.1",
         "ext": "^1.1.2"
       }
     },
+    "es6-weak-map": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
+      "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
+      "requires": {
+        "d": "1",
+        "es5-ext": "^0.10.46",
+        "es6-iterator": "^2.0.3",
+        "es6-symbol": "^3.1.1"
+      }
+    },
     "escalade": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
-      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
-      "dev": true
+      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
     },
     "escape-html": {
       "version": "1.0.3",
     "esprima": {
       "version": "4.0.1",
       "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
-      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
-      "dev": true
+      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
     },
     "esrecurse": {
       "version": "4.3.0",
       },
       "dependencies": {
         "estraverse": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
-          "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+          "version": "5.3.0",
+          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+          "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
           "dev": true
         }
       }
       "version": "0.3.5",
       "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
       "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=",
-      "dev": true,
       "requires": {
         "d": "1",
         "es5-ext": "~0.10.14"
         "through": "~2.3.1"
       }
     },
+    "event-target-shim": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
+      "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
+      "dev": true
+    },
     "eventemitter2": {
-      "version": "6.4.4",
-      "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.4.tgz",
-      "integrity": "sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw==",
+      "version": "6.4.5",
+      "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.5.tgz",
+      "integrity": "sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw==",
       "dev": true
     },
     "eventemitter3": {
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
           "dev": true
         },
+        "cookie": {
+          "version": "0.4.0",
+          "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
+          "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==",
+          "dev": true
+        },
         "debug": {
           "version": "2.6.9",
           "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
           "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
           "dev": true
+        },
+        "qs": {
+          "version": "6.7.0",
+          "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
+          "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
+          "dev": true
         }
       }
     },
     "ext": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
-      "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
-      "dev": true,
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz",
+      "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==",
       "requires": {
-        "type": "^2.0.0"
+        "type": "^2.5.0"
       },
       "dependencies": {
         "type": {
           "version": "2.5.0",
           "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz",
-          "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==",
-          "dev": true
+          "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw=="
         }
       }
     },
             "ms": "2.0.0"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "ms": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
       "dev": true
     },
     "fast-glob": {
-      "version": "3.2.5",
-      "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
-      "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==",
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz",
+      "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==",
       "dev": true,
       "requires": {
         "@nodelib/fs.stat": "^2.0.2",
         "@nodelib/fs.walk": "^1.2.3",
-        "glob-parent": "^5.1.0",
+        "glob-parent": "^5.1.2",
         "merge2": "^1.3.0",
-        "micromatch": "^4.0.2",
-        "picomatch": "^2.2.1"
+        "micromatch": "^4.0.4"
       }
     },
+    "fast-json-patch": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.0.tgz",
+      "integrity": "sha512-IhpytlsVTRndz0hU5t0/MGzS/etxLlfrpG5V5M9mVbuj9TrJLWaMfsox9REM5rkuGX0T+5qjpe8XA1o0gZ42nA=="
+    },
     "fast-json-stable-stringify": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
       "dev": true
     },
     "fastq": {
-      "version": "1.11.0",
-      "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz",
-      "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==",
+      "version": "1.13.0",
+      "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
+      "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
       "dev": true,
       "requires": {
         "reusify": "^1.0.4"
       }
     },
+    "fault": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz",
+      "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==",
+      "requires": {
+        "format": "^0.2.0"
+      }
+    },
     "faye-websocket": {
-      "version": "0.10.0",
-      "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz",
-      "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=",
+      "version": "0.11.4",
+      "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
+      "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
       "dev": true,
       "requires": {
         "websocket-driver": ">=0.5.1"
         "bser": "2.1.1"
       }
     },
+    "fbjs": {
+      "version": "0.8.18",
+      "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.18.tgz",
+      "integrity": "sha512-EQaWFK+fEPSoibjNy8IxUtaFOMXcWsY0JaVrQoZR9zC8N2Ygf9iDITPWjUTVIax95b6I742JFLqASHfsag/vKA==",
+      "requires": {
+        "core-js": "^1.0.0",
+        "isomorphic-fetch": "^2.1.1",
+        "loose-envify": "^1.0.0",
+        "object-assign": "^4.1.0",
+        "promise": "^7.1.1",
+        "setimmediate": "^1.0.5",
+        "ua-parser-js": "^0.7.30"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "1.2.7",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
+          "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY="
+        }
+      }
+    },
     "fd-slicer": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
       }
     },
     "file-loader": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz",
-      "integrity": "sha512-/aMOAYEFXDdjG0wytpTL5YQLfZnnTmLNjn+AIrJ/6HVnTfDqLsVKUUwkDf4I4kgex36BvjuXEn/TX9B/1ESyqQ==",
+      "version": "6.2.0",
+      "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz",
+      "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==",
       "dev": true,
       "requires": {
         "loader-utils": "^2.0.0",
-        "schema-utils": "^2.6.5"
+        "schema-utils": "^3.0.0"
+      },
+      "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        }
       }
     },
     "file-saver": {
         "commondir": "^1.0.1",
         "make-dir": "^3.0.2",
         "pkg-dir": "^4.1.0"
-      },
-      "dependencies": {
-        "make-dir": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
-          "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
-          "dev": true,
-          "requires": {
-            "semver": "^6.0.0"
-          }
-        },
-        "pkg-dir": {
-          "version": "4.2.0",
-          "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
-          "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
-          "dev": true,
-          "requires": {
-            "find-up": "^4.0.0"
-          }
-        },
-        "semver": {
-          "version": "6.3.0",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
-          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
-          "dev": true
-        }
       }
     },
     "find-up": {
       "version": "4.1.0",
       "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
       "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+      "dev": true,
       "requires": {
         "locate-path": "^5.0.0",
         "path-exists": "^4.0.0"
       }
     },
     "flatted": {
-      "version": "3.1.1",
-      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
-      "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz",
+      "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
       "dev": true
     },
     "flush-write-stream": {
       "requires": {
         "inherits": "^2.0.3",
         "readable-stream": "^2.3.6"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "follow-redirects": {
-      "version": "1.14.1",
-      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
-      "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
+      "version": "1.14.4",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
+      "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
       "dev": true
     },
     "fontkit": {
         "unicode-trie": "^0.3.0"
       },
       "dependencies": {
-        "clone": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
-          "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
-          "dev": true
-        },
         "pako": {
           "version": "0.2.9",
           "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
         "mime-types": "^2.1.12"
       }
     },
+    "form-data-encoder": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.6.0.tgz",
+      "integrity": "sha512-P97AVaOB8hZaniiKK3f46zxQcchQXI8EgBnX+2+719gLv5ZbDSf3J1XtIuAQ8xbGLU4vZYhy7xwhFtK8U5u9Nw=="
+    },
+    "format": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
+      "integrity": "sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs="
+    },
+    "formdata-node": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.3.1.tgz",
+      "integrity": "sha512-8xKSa9et4zb+yziWsD/bI+EYjdg1z2p9EpKr+o+Yk12F/wP66bmDdvjj2ZXd2K/MJlR3HBzWnuV7f82jzHRqCA==",
+      "requires": {
+        "node-domexception": "1.0.0",
+        "web-streams-polyfill": "4.0.0-beta.1"
+      }
+    },
     "forwarded": {
-      "version": "0.1.2",
-      "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
-      "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+      "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+      "dev": true
+    },
+    "fraction.js": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.1.1.tgz",
+      "integrity": "sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg==",
       "dev": true
     },
     "fragment-cache": {
       "requires": {
         "inherits": "^2.0.1",
         "readable-stream": "^2.0.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "fs-extra": {
         "iferr": "^0.1.5",
         "imurmurhash": "^0.1.4",
         "readable-stream": "1 || 2"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
+      }
+    },
+    "fs.realpath": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
+    },
+    "function-bind": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+    },
+    "gauge": {
+      "version": "2.7.4",
+      "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
+      "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
+      "dev": true,
+      "requires": {
+        "aproba": "^1.0.3",
+        "console-control-strings": "^1.0.0",
+        "has-unicode": "^2.0.0",
+        "object-assign": "^4.1.0",
+        "signal-exit": "^3.0.0",
+        "string-width": "^1.0.1",
+        "strip-ansi": "^3.0.1",
+        "wide-align": "^1.1.0"
+      },
+      "dependencies": {
+        "ansi-regex": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+          "dev": true
+        },
+        "is-fullwidth-code-point": {
+          "version": "1.0.0",
+          "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+          "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+          "dev": true,
+          "requires": {
+            "number-is-nan": "^1.0.0"
+          }
+        },
+        "string-width": {
+          "version": "1.0.2",
+          "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+          "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+          "dev": true,
+          "requires": {
+            "code-point-at": "^1.0.0",
+            "is-fullwidth-code-point": "^1.0.0",
+            "strip-ansi": "^3.0.0"
+          }
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "dev": true,
+          "requires": {
+            "ansi-regex": "^2.0.0"
+          }
+        }
       }
     },
-    "fs.realpath": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
-      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
-    },
-    "fsevents": {
-      "dev": true,
-      "optional": true,
-      "version": "2.1.3"
-    },
-    "function-bind": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
-      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
-    },
-    "genfun": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz",
-      "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==",
-      "dev": true
-    },
     "gensync": {
       "version": "1.0.0-beta.2",
       "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
       "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
-      "dev": true,
       "requires": {
         "function-bind": "^1.1.1",
         "has": "^1.0.3",
         "pump": "^3.0.0"
       }
     },
+    "get-symbol-description": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
+      "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
+      "dev": true,
+      "requires": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.1.1"
+      }
+    },
     "get-value": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
       },
       "dependencies": {
         "async": {
-          "version": "3.2.0",
-          "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
-          "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==",
+          "version": "3.2.1",
+          "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz",
+          "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==",
           "dev": true
         }
       }
         "ini": "^1.3.4",
         "is-windows": "^1.0.1",
         "which": "^1.2.14"
+      },
+      "dependencies": {
+        "ini": {
+          "version": "1.3.8",
+          "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+          "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+          "dev": true
+        }
       }
     },
     "globals": {
       "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="
     },
     "globby": {
-      "version": "11.0.3",
-      "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz",
-      "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==",
+      "version": "11.0.4",
+      "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz",
+      "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==",
       "dev": true,
       "requires": {
         "array-union": "^2.1.0",
       }
     },
     "graceful-fs": {
-      "version": "4.2.6",
-      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
-      "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
+      "version": "4.2.8",
+      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
+      "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
       "dev": true
     },
     "growly": {
     "has-symbols": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
-      "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
+      "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
+    },
+    "has-tostringtag": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
+      "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
+      "dev": true,
+      "requires": {
+        "has-symbols": "^1.0.2"
+      }
+    },
+    "has-unicode": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
+      "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
       "dev": true
     },
     "has-value": {
         "safe-buffer": "^5.2.0"
       },
       "dependencies": {
-        "readable-stream": {
-          "version": "3.6.0",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
-          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
-          "dev": true,
-          "requires": {
-            "inherits": "^2.0.3",
-            "string_decoder": "^1.1.1",
-            "util-deprecate": "^1.0.1"
-          }
-        },
         "safe-buffer": {
           "version": "5.2.1",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
         "minimalistic-assert": "^1.0.1"
       }
     },
-    "hex-color-regex": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
-      "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==",
+    "hast-util-parse-selector": {
+      "version": "2.2.5",
+      "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
+      "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ=="
+    },
+    "hastscript": {
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz",
+      "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==",
+      "requires": {
+        "@types/hast": "^2.0.0",
+        "comma-separated-tokens": "^1.0.0",
+        "hast-util-parse-selector": "^2.0.0",
+        "property-information": "^5.0.0",
+        "space-separated-tokens": "^1.0.0"
+      }
+    },
+    "he": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+      "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
       "dev": true
     },
+    "highlight.js": {
+      "version": "10.7.3",
+      "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz",
+      "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A=="
+    },
     "hmac-drbg": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
         "minimalistic-crypto-utils": "^1.0.1"
       }
     },
+    "hoist-non-react-statics": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
+      "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
+      "requires": {
+        "react-is": "^16.7.0"
+      }
+    },
     "homedir-polyfill": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
         "obuf": "^1.0.0",
         "readable-stream": "^2.0.1",
         "wbuf": "^1.1.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
-    "hsl-regex": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz",
-      "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=",
-      "dev": true
-    },
-    "hsla-regex": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz",
-      "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=",
-      "dev": true
-    },
     "html-encoding-sniffer": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
-      "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz",
+      "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==",
       "dev": true,
       "requires": {
-        "whatwg-encoding": "^1.0.5"
+        "whatwg-encoding": "^1.0.1"
       }
     },
     "html-entities": {
         "chalk": "^2.4.1",
         "commander": "^2.12.2",
         "glob": "^7.1.2"
+      },
+      "dependencies": {
+        "commander": {
+          "version": "2.20.3",
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+          "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+          "dev": true
+        }
       }
     },
     "html-tags": {
         "promise": "^8.0.2"
       },
       "dependencies": {
+        "dom-serializer": {
+          "version": "0.2.2",
+          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
+          "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
+          "dev": true,
+          "requires": {
+            "domelementtype": "^2.0.1",
+            "entities": "^2.0.0"
+          },
+          "dependencies": {
+            "domelementtype": {
+              "version": "2.2.0",
+              "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
+              "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
+              "dev": true
+            },
+            "entities": {
+              "version": "2.2.0",
+              "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
+              "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
+              "dev": true
+            }
+          }
+        },
+        "domelementtype": {
+          "version": "1.3.1",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+          "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+          "dev": true
+        },
         "domhandler": {
           "version": "2.4.2",
           "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
             "domelementtype": "1"
           }
         },
+        "domutils": {
+          "version": "1.7.0",
+          "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
+          "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+          "dev": true,
+          "requires": {
+            "dom-serializer": "0",
+            "domelementtype": "1"
+          }
+        },
         "entities": {
           "version": "1.1.2",
           "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
             "readable-stream": "^3.1.1"
           }
         },
-        "readable-stream": {
-          "version": "3.6.0",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
-          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+        "promise": {
+          "version": "8.1.0",
+          "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz",
+          "integrity": "sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q==",
           "dev": true,
           "requires": {
-            "inherits": "^2.0.3",
-            "string_decoder": "^1.1.1",
-            "util-deprecate": "^1.0.1"
+            "asap": "~2.0.6"
           }
         }
       }
         "domhandler": "^4.0.0",
         "domutils": "^2.5.2",
         "entities": "^2.0.0"
-      },
-      "dependencies": {
-        "dom-serializer": {
-          "version": "1.3.1",
-          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.1.tgz",
-          "integrity": "sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q==",
-          "dev": true,
-          "requires": {
-            "domelementtype": "^2.0.1",
-            "domhandler": "^4.0.0",
-            "entities": "^2.0.0"
-          }
-        },
-        "domelementtype": {
-          "version": "2.2.0",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
-          "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
-          "dev": true
-        },
-        "domutils": {
-          "version": "2.6.0",
-          "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.6.0.tgz",
-          "integrity": "sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==",
-          "dev": true,
-          "requires": {
-            "dom-serializer": "^1.0.1",
-            "domelementtype": "^2.2.0",
-            "domhandler": "^4.2.0"
-          }
-        }
       }
     },
     "http-auth": {
       }
     },
     "http-cache-semantics": {
-      "version": "3.8.1",
-      "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz",
-      "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==",
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
+      "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
       "dev": true
     },
     "http-deceiver": {
         }
       }
     },
+    "http-parser-js": {
+      "version": "0.5.3",
+      "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz",
+      "integrity": "sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg==",
+      "dev": true
+    },
     "http-proxy": {
       "version": "1.18.1",
       "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
       }
     },
     "http-proxy-agent": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz",
-      "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==",
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
+      "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
       "dev": true,
       "requires": {
-        "agent-base": "4",
-        "debug": "3.1.0"
-      },
-      "dependencies": {
-        "debug": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
-          "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
-          "dev": true,
-          "requires": {
-            "ms": "2.0.0"
-          }
-        },
-        "ms": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
-          "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
-          "dev": true
-        }
+        "@tootallnate/once": "1",
+        "agent-base": "6",
+        "debug": "4"
       }
     },
     "http-proxy-middleware": {
       "dev": true
     },
     "https-proxy-agent": {
-      "version": "2.2.4",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
-      "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
+      "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
       "dev": true,
       "requires": {
-        "agent-base": "^4.3.0",
-        "debug": "^3.1.0"
-      },
-      "dependencies": {
-        "debug": {
-          "version": "3.2.7",
-          "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
-          "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
-          "dev": true,
-          "requires": {
-            "ms": "^2.1.1"
-          }
-        }
+        "agent-base": "6",
+        "debug": "4"
       }
     },
     "human-signals": {
       }
     },
     "iconv-lite": {
-      "version": "0.6.2",
-      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",
-      "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",
-      "dev": true,
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
       "requires": {
         "safer-buffer": ">= 2.1.2 < 3.0.0"
       }
     },
     "icss-utils": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz",
-      "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.14"
-      }
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
+      "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
+      "dev": true
     },
     "identity-obj-proxy": {
       "version": "3.0.0",
     "ieee754": {
       "version": "1.2.1",
       "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
-      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
-      "dev": true
+      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
     },
     "iferr": {
       "version": "0.1.5",
       "dev": true,
       "optional": true
     },
-    "import-cwd": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz",
-      "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=",
-      "dev": true,
-      "requires": {
-        "import-from": "^2.1.0"
-      }
+    "immutable": {
+      "version": "3.8.2",
+      "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz",
+      "integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM="
     },
     "import-fresh": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
-      "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
-      "dev": true,
-      "requires": {
-        "caller-path": "^2.0.0",
-        "resolve-from": "^3.0.0"
-      }
-    },
-    "import-from": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz",
-      "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=",
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+      "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
       "dev": true,
       "requires": {
-        "resolve-from": "^3.0.0"
+        "parent-module": "^1.0.0",
+        "resolve-from": "^4.0.0"
       }
     },
     "import-lazy": {
       "requires": {
         "pkg-dir": "^3.0.0",
         "resolve-cwd": "^2.0.0"
+      },
+      "dependencies": {
+        "find-up": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+          "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+          "dev": true,
+          "requires": {
+            "locate-path": "^3.0.0"
+          }
+        },
+        "locate-path": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+          "dev": true,
+          "requires": {
+            "p-locate": "^3.0.0",
+            "path-exists": "^3.0.0"
+          }
+        },
+        "p-locate": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+          "dev": true,
+          "requires": {
+            "p-limit": "^2.0.0"
+          }
+        },
+        "path-exists": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+          "dev": true
+        },
+        "pkg-dir": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
+          "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
+          "dev": true,
+          "requires": {
+            "find-up": "^3.0.0"
+          }
+        }
       }
     },
     "imurmurhash": {
       "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
     },
     "ini": {
-      "version": "1.3.5",
-      "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
-      "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz",
+      "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==",
       "dev": true
     },
     "inquirer": {
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
         "ipaddr.js": "^1.9.0"
       }
     },
+    "internal-slot": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
+      "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
+      "dev": true,
+      "requires": {
+        "get-intrinsic": "^1.1.0",
+        "has": "^1.0.3",
+        "side-channel": "^1.0.4"
+      }
+    },
     "invariant": {
       "version": "2.2.4",
       "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
       "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
-      "dev": true,
       "requires": {
         "loose-envify": "^1.0.0"
       }
       }
     },
     "is-absolute-url": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz",
-      "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=",
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz",
+      "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==",
       "dev": true
     },
     "is-accessor-descriptor": {
     "is-alphabetical": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz",
-      "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==",
-      "dev": true
+      "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg=="
     },
     "is-alphanumeric": {
       "version": "1.0.0",
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz",
       "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==",
-      "dev": true,
       "requires": {
         "is-alphabetical": "^1.0.0",
         "is-decimal": "^1.0.0"
       }
     },
     "is-arguments": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz",
-      "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==",
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
+      "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
       "dev": true,
       "requires": {
-        "call-bind": "^1.0.0"
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
       }
     },
     "is-arrayish": {
       "dev": true
     },
     "is-bigint": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz",
-      "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==",
-      "dev": true
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+      "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+      "dev": true,
+      "requires": {
+        "has-bigints": "^1.0.1"
+      }
     },
     "is-binary-path": {
       "version": "2.1.0",
       }
     },
     "is-boolean-object": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz",
-      "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==",
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+      "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
       "dev": true,
       "requires": {
-        "call-bind": "^1.0.2"
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
       }
     },
     "is-buffer": {
       "dev": true
     },
     "is-callable": {
-      "version": "1.2.3",
-      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
-      "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
+      "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
       "dev": true
     },
     "is-ci": {
         "ci-info": "^2.0.0"
       }
     },
-    "is-color-stop": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz",
-      "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=",
-      "dev": true,
-      "requires": {
-        "css-color-names": "^0.0.4",
-        "hex-color-regex": "^1.1.0",
-        "hsl-regex": "^1.0.0",
-        "hsla-regex": "^1.0.0",
-        "rgb-regex": "^1.0.1",
-        "rgba-regex": "^1.0.0"
-      }
-    },
     "is-core-module": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
-      "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
+      "version": "2.8.0",
+      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
+      "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
       "requires": {
         "has": "^1.0.3"
       }
       }
     },
     "is-date-object": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz",
-      "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==",
-      "dev": true
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+      "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+      "dev": true,
+      "requires": {
+        "has-tostringtag": "^1.0.0"
+      }
     },
     "is-decimal": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz",
-      "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==",
-      "dev": true
+      "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw=="
     },
     "is-descriptor": {
       "version": "0.1.6",
       "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
       "dev": true
     },
+    "is-dom": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-dom/-/is-dom-1.1.0.tgz",
+      "integrity": "sha512-u82f6mvhYxRPKpw8V1N0W8ce1xXwOrQtgGcxl6UCL5zBmZu3is/18K0rR7uFCnMDuAsS/3W54mGL4vsaFUQlEQ==",
+      "requires": {
+        "is-object": "^1.0.1",
+        "is-window": "^1.0.2"
+      }
+    },
     "is-extendable": {
       "version": "0.1.1",
       "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
       "dev": true
     },
     "is-glob": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
-      "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
       "dev": true,
       "requires": {
         "is-extglob": "^2.1.1"
     "is-hexadecimal": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz",
-      "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==",
-      "dev": true
+      "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw=="
     },
     "is-installed-globally": {
       "version": "0.3.2",
       "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==",
       "dev": true
     },
+    "is-lambda": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz",
+      "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=",
+      "dev": true
+    },
     "is-negated-glob": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
       "dev": true
     },
     "is-number-object": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz",
-      "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==",
-      "dev": true
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
+      "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
+      "dev": true,
+      "requires": {
+        "has-tostringtag": "^1.0.0"
+      }
     },
     "is-obj": {
       "version": "2.0.0",
       "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
       "dev": true
     },
+    "is-object": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz",
+      "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA=="
+    },
     "is-observable": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz",
       }
     },
     "is-plain-obj": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
-      "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
+      "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
       "dev": true
     },
     "is-plain-object": {
     "is-promise": {
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
-      "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
-      "dev": true
+      "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
     },
     "is-regex": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz",
-      "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==",
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+      "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
       "dev": true,
       "requires": {
         "call-bind": "^1.0.2",
-        "has-symbols": "^1.0.2"
+        "has-tostringtag": "^1.0.0"
       }
     },
     "is-regexp": {
       "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
       "dev": true
     },
+    "is-shared-array-buffer": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz",
+      "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==",
+      "dev": true
+    },
     "is-stream": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
-      "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
-      "dev": true
+      "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
     },
     "is-string": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz",
-      "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==",
-      "dev": true
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+      "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+      "dev": true,
+      "requires": {
+        "has-tostringtag": "^1.0.0"
+      }
     },
     "is-symbol": {
       "version": "1.0.4",
       "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
       "dev": true
     },
+    "is-weakref": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz",
+      "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==",
+      "dev": true,
+      "requires": {
+        "call-bind": "^1.0.0"
+      }
+    },
     "is-what": {
       "version": "3.14.1",
       "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
       "integrity": "sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==",
       "dev": true
     },
+    "is-window": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-window/-/is-window-1.0.2.tgz",
+      "integrity": "sha1-LIlspT25feRdPDMTOmXYyfVjSA0="
+    },
     "is-windows": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
       "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
       "dev": true
     },
+    "isomorphic-fetch": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
+      "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
+      "requires": {
+        "node-fetch": "^1.0.1",
+        "whatwg-fetch": ">=0.10.0"
+      }
+    },
+    "isomorphic-form-data": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-2.0.0.tgz",
+      "integrity": "sha512-TYgVnXWeESVmQSg4GLVbalmQ+B4NPi/H4eWxqALKj63KsUrcu301YDjBqaOw3h+cbak7Na4Xyps3BiptHtxTfg==",
+      "dev": true,
+      "requires": {
+        "form-data": "^2.3.2"
+      }
+    },
     "isstream": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
       "dev": true
     },
     "istanbul-lib-coverage": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz",
-      "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==",
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz",
+      "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==",
       "dev": true
     },
     "istanbul-lib-instrument": {
           "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "make-dir": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
-          "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
-          "dev": true,
-          "requires": {
-            "semver": "^6.0.0"
-          }
-        },
-        "semver": {
-          "version": "6.3.0",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
-          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
-          "dev": true
-        },
         "supports-color": {
           "version": "7.2.0",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
       }
     },
     "istanbul-lib-source-maps": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz",
-      "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==",
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz",
+      "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==",
       "dev": true,
       "requires": {
         "debug": "^4.1.1",
       }
     },
     "istanbul-reports": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz",
-      "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==",
+      "version": "3.0.5",
+      "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz",
+      "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==",
       "dev": true,
       "requires": {
         "html-escaper": "^2.0.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
             "color-convert": "^2.0.1"
           }
         },
+        "camelcase": {
+          "version": "5.3.1",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+          "dev": true
+        },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
             "supports-color": "^7.1.0"
           }
         },
+        "cliui": {
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
+          "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+          "dev": true,
+          "requires": {
+            "string-width": "^4.2.0",
+            "strip-ansi": "^6.0.0",
+            "wrap-ansi": "^6.2.0"
+          }
+        },
         "color-convert": {
           "version": "2.0.1",
           "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
           "dev": true
         },
         "import-local": {
-          "version": "3.0.2",
-          "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz",
-          "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==",
+          "version": "3.0.3",
+          "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz",
+          "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==",
           "dev": true,
           "requires": {
             "pkg-dir": "^4.2.0",
             "yargs": "^15.4.1"
           }
         },
-        "pkg-dir": {
-          "version": "4.2.0",
-          "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
-          "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
-          "dev": true,
-          "requires": {
-            "find-up": "^4.0.0"
-          }
-        },
         "resolve-cwd": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz",
             "has-flag": "^4.0.0"
           }
         },
+        "wrap-ansi": {
+          "version": "6.2.0",
+          "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+          "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.0.0",
+            "string-width": "^4.1.0",
+            "strip-ansi": "^6.0.0"
+          }
+        },
+        "y18n": {
+          "version": "4.0.3",
+          "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+          "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+          "dev": true
+        },
         "yargs": {
           "version": "15.4.1",
           "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
             "y18n": "^4.0.0",
             "yargs-parser": "^18.1.2"
           }
+        },
+        "yargs-parser": {
+          "version": "18.1.3",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+          "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+          "dev": true,
+          "requires": {
+            "camelcase": "^5.0.0",
+            "decamelize": "^1.2.0"
+          }
         }
       }
     },
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "dev": true
         },
         "is-stream": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
-          "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+          "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
           "dev": true
         },
         "npm-run-path": {
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "jest-worker": {
-          "version": "26.6.2",
-          "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
-          "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
-          "dev": true,
-          "requires": {
-            "@types/node": "*",
-            "merge-stream": "^2.0.0",
-            "supports-color": "^7.0.0"
-          }
-        },
         "supports-color": {
           "version": "7.2.0",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "jest-worker": {
-          "version": "26.6.2",
-          "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
-          "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
-          "dev": true,
-          "requires": {
-            "@types/node": "*",
-            "merge-stream": "^2.0.0",
-            "supports-color": "^7.0.0"
-          }
-        },
         "supports-color": {
           "version": "7.2.0",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
             "color-convert": "^2.0.1"
           }
         },
+        "camelcase": {
+          "version": "5.3.1",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+          "dev": true
+        },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
             "supports-color": "^7.1.0"
           }
         },
+        "cliui": {
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
+          "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+          "dev": true,
+          "requires": {
+            "string-width": "^4.2.0",
+            "strip-ansi": "^6.0.0",
+            "wrap-ansi": "^6.2.0"
+          }
+        },
         "color-convert": {
           "version": "2.0.1",
           "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
           "dev": true
         },
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "has-flag": "^4.0.0"
           }
         },
+        "wrap-ansi": {
+          "version": "6.2.0",
+          "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+          "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.0.0",
+            "string-width": "^4.1.0",
+            "strip-ansi": "^6.0.0"
+          }
+        },
+        "y18n": {
+          "version": "4.0.3",
+          "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+          "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+          "dev": true
+        },
         "yargs": {
           "version": "15.4.1",
           "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
             "y18n": "^4.0.0",
             "yargs-parser": "^18.1.2"
           }
+        },
+        "yargs-parser": {
+          "version": "18.1.3",
+          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+          "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+          "dev": true,
+          "requires": {
+            "camelcase": "^5.0.0",
+            "decamelize": "^1.2.0"
+          }
         }
       }
     },
           "dev": true
         },
         "@types/yargs": {
-          "version": "13.0.11",
-          "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.11.tgz",
-          "integrity": "sha512-NRqD6T4gktUrDi1o1wLH3EKC1o2caCr7/wR87ODcbVITQF106OM3sFN92ysZ++wqelOd1CTzatnOBRDYYG6wGQ==",
+          "version": "13.0.12",
+          "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.12.tgz",
+          "integrity": "sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==",
           "dev": true,
           "requires": {
             "@types/yargs-parser": "*"
             }
           }
         },
-        "callsites": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
-          "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
-          "dev": true
-        },
         "escape-string-regexp": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
             "to-regex": "^3.0.2"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "slash": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
             "color-convert": "^2.0.1"
           }
         },
-        "camelcase": {
-          "version": "6.2.0",
-          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz",
-          "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==",
-          "dev": true
-        },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           }
         },
         "@types/istanbul-reports": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz",
-          "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==",
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
+          "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
           "dev": true,
           "requires": {
             "@types/istanbul-lib-report": "*"
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
       }
     },
     "jest-worker": {
-      "version": "26.3.0",
-      "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz",
-      "integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==",
+      "version": "26.6.2",
+      "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
+      "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
       "dev": true,
       "requires": {
         "@types/node": "*",
       "dev": true
     },
     "joi": {
-      "version": "17.4.0",
-      "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz",
-      "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==",
+      "version": "17.4.2",
+      "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.2.tgz",
+      "integrity": "sha512-Lm56PP+n0+Z2A2rfRvsfWVDXGEWjXxatPopkQ8qQ5mxCEhwHG+Ettgg5o98FFaxilOxozoa14cFhrE/hOzh/Nw==",
       "dev": true,
       "requires": {
         "@hapi/hoek": "^9.0.0",
         "@sideway/pinpoint": "^2.0.0"
       }
     },
+    "js-file-download": {
+      "version": "0.4.12",
+      "resolved": "https://registry.npmjs.org/js-file-download/-/js-file-download-0.4.12.tgz",
+      "integrity": "sha512-rML+NkoD08p5Dllpjo0ffy4jRHeY6Zsapvr/W86N7E0yuzAO6qa5X9+xog6zQNlH102J7IXljNY2FtS6Lj3ucg=="
+    },
     "js-tokens": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
       "version": "3.14.1",
       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
       "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
-      "dev": true,
       "requires": {
         "argparse": "^1.0.7",
         "esprima": "^4.0.0"
       "dev": true
     },
     "jsdom": {
-      "version": "16.5.3",
-      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.3.tgz",
-      "integrity": "sha512-Qj1H+PEvUsOtdPJ056ewXM4UJPCi4hhLA8wpiz9F2YvsRBhuFsXxtrIFAgGBDynQA9isAMGE91PfUYbdMPXuTA==",
+      "version": "16.7.0",
+      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz",
+      "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==",
       "dev": true,
       "requires": {
         "abab": "^2.0.5",
-        "acorn": "^8.1.0",
+        "acorn": "^8.2.4",
         "acorn-globals": "^6.0.0",
         "cssom": "^0.4.4",
         "cssstyle": "^2.3.0",
         "decimal.js": "^10.2.1",
         "domexception": "^2.0.1",
         "escodegen": "^2.0.0",
+        "form-data": "^3.0.0",
         "html-encoding-sniffer": "^2.0.1",
-        "is-potential-custom-element-name": "^1.0.0",
+        "http-proxy-agent": "^4.0.1",
+        "https-proxy-agent": "^5.0.0",
+        "is-potential-custom-element-name": "^1.0.1",
         "nwsapi": "^2.2.0",
         "parse5": "6.0.1",
-        "request": "^2.88.2",
-        "request-promise-native": "^1.0.9",
         "saxes": "^5.0.1",
         "symbol-tree": "^3.2.4",
         "tough-cookie": "^4.0.0",
         "whatwg-encoding": "^1.0.5",
         "whatwg-mimetype": "^2.3.0",
         "whatwg-url": "^8.5.0",
-        "ws": "^7.4.4",
+        "ws": "^7.4.6",
         "xml-name-validator": "^3.0.0"
       },
       "dependencies": {
         "acorn": {
-          "version": "8.2.4",
-          "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz",
-          "integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==",
+          "version": "8.5.0",
+          "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
+          "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
+          "dev": true
+        },
+        "acorn-globals": {
+          "version": "6.0.0",
+          "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
+          "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
+          "dev": true,
+          "requires": {
+            "acorn": "^7.1.1",
+            "acorn-walk": "^7.1.1"
+          },
+          "dependencies": {
+            "acorn": {
+              "version": "7.4.1",
+              "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+              "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+              "dev": true
+            }
+          }
+        },
+        "acorn-walk": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
+          "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
           "dev": true
         },
+        "data-urls": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
+          "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
+          "dev": true,
+          "requires": {
+            "abab": "^2.0.3",
+            "whatwg-mimetype": "^2.3.0",
+            "whatwg-url": "^8.0.0"
+          }
+        },
+        "domexception": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
+          "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
+          "dev": true,
+          "requires": {
+            "webidl-conversions": "^5.0.0"
+          },
+          "dependencies": {
+            "webidl-conversions": {
+              "version": "5.0.0",
+              "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
+              "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
+              "dev": true
+            }
+          }
+        },
         "escodegen": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz",
           }
         },
         "estraverse": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
-          "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
+          "version": "5.3.0",
+          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+          "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+          "dev": true
+        },
+        "form-data": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
+          "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
+          "dev": true,
+          "requires": {
+            "asynckit": "^0.4.0",
+            "combined-stream": "^1.0.8",
+            "mime-types": "^2.1.12"
+          }
+        },
+        "html-encoding-sniffer": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
+          "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
+          "dev": true,
+          "requires": {
+            "whatwg-encoding": "^1.0.5"
+          }
+        },
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
           "dev": true
         },
+        "saxes": {
+          "version": "5.0.1",
+          "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
+          "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
+          "dev": true,
+          "requires": {
+            "xmlchars": "^2.2.0"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
             "universalify": "^0.1.2"
           }
         },
+        "tr46": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
+          "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
+          "dev": true,
+          "requires": {
+            "punycode": "^2.1.1"
+          }
+        },
+        "w3c-xmlserializer": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
+          "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
+          "dev": true,
+          "requires": {
+            "xml-name-validator": "^3.0.0"
+          }
+        },
+        "webidl-conversions": {
+          "version": "6.1.0",
+          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
+          "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
+          "dev": true
+        },
+        "whatwg-url": {
+          "version": "8.7.0",
+          "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz",
+          "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==",
+          "dev": true,
+          "requires": {
+            "lodash": "^4.7.0",
+            "tr46": "^2.1.0",
+            "webidl-conversions": "^6.1.0"
+          }
+        },
         "ws": {
-          "version": "7.4.5",
-          "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz",
-          "integrity": "sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==",
+          "version": "7.5.5",
+          "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
+          "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
           "dev": true
         }
       }
       }
     },
     "jsonc-parser": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.0.tgz",
-      "integrity": "sha512-b0EBt8SWFNnixVdvoR2ZtEGa9ZqLhbJnOjezn+WP+8kspFm+PFYDN8Z4Bc7pRlDjvuVcADSUkroIuTWWn/YiIA==",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz",
+      "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==",
       "dev": true
     },
     "jsonfile": {
       "dev": true
     },
     "klona": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz",
-      "integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==",
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.5.tgz",
+      "integrity": "sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==",
       "dev": true
     },
     "known-css-properties": {
       }
     },
     "less": {
-      "version": "3.13.1",
-      "resolved": "https://registry.npmjs.org/less/-/less-3.13.1.tgz",
-      "integrity": "sha512-SwA1aQXGUvp+P5XdZslUOhhLnClSLIjWvJhmd+Vgib5BFIr9lMNlQwmwUNOjXThF/A0x+MCYYPeWEfeWiLRnTw==",
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/less/-/less-4.1.1.tgz",
+      "integrity": "sha512-w09o8tZFPThBscl5d0Ggp3RcrKIouBoQscnOMgFH3n5V3kN/CXGHNfCkRPtxJk6nKryDXaV9aHLK55RXuH4sAw==",
       "dev": true,
       "requires": {
         "copy-anything": "^2.0.1",
         "image-size": "~0.5.0",
         "make-dir": "^2.1.0",
         "mime": "^1.4.1",
-        "native-request": "^1.0.5",
+        "needle": "^2.5.2",
+        "parse-node-version": "^1.0.1",
         "source-map": "~0.6.0",
         "tslib": "^1.10.0"
       },
       "dependencies": {
+        "make-dir": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+          "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "pify": "^4.0.1",
+            "semver": "^5.6.0"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
       }
     },
     "less-loader": {
-      "version": "6.2.0",
-      "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-6.2.0.tgz",
-      "integrity": "sha512-Cl5h95/Pz/PWub/tCBgT1oNMFeH1WTD33piG80jn5jr12T4XbxZcjThwNXDQ7AG649WEynuIzO4b0+2Tn9Qolg==",
+      "version": "7.3.0",
+      "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-7.3.0.tgz",
+      "integrity": "sha512-Mi8915g7NMaLlgi77mgTTQvK022xKRQBIVDSyfl3ErTuBhmZBQab0mjeJjNNqGbdR+qrfTleKXqbGI4uEFavxg==",
       "dev": true,
       "requires": {
-        "clone": "^2.1.2",
-        "less": "^3.11.3",
+        "klona": "^2.0.4",
         "loader-utils": "^2.0.0",
-        "schema-utils": "^2.7.0"
+        "schema-utils": "^3.0.0"
+      },
+      "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        }
       }
     },
     "leven": {
       "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
       "dev": true
     },
-    "levenary": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz",
-      "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==",
-      "dev": true,
-      "requires": {
-        "leven": "^3.1.0"
-      }
-    },
     "levn": {
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
       }
     },
     "license-webpack-plugin": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-2.3.0.tgz",
-      "integrity": "sha512-JK/DXrtN6UeYQSgkg5q1+pgJ8aiKPL9tnz9Wzw+Ikkf+8mJxG56x6t8O+OH/tAeF/5NREnelTEMyFtbJNkjH4w==",
+      "version": "2.3.11",
+      "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-2.3.11.tgz",
+      "integrity": "sha512-0iVGoX5vx0WDy8dmwTTpOOMYiGqILyUbDeVMFH52AjgBlS58lHwOlFMSoqg5nY8Kxl6+FRKyUZY/UdlQaOyqDw==",
       "dev": true,
       "requires": {
         "@types/webpack-sources": "^0.1.5",
         "webpack-sources": "^1.2.0"
+      },
+      "dependencies": {
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
+        }
       }
     },
     "liftoff": {
           "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
           "dev": true
         },
+        "cors": {
+          "version": "2.8.5",
+          "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
+          "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
+          "dev": true,
+          "requires": {
+            "object-assign": "^4",
+            "vary": "^1"
+          }
+        },
         "debug": {
           "version": "2.6.9",
           "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
             }
           }
         },
-        "faye-websocket": {
-          "version": "0.11.3",
-          "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz",
-          "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==",
-          "dev": true,
-          "requires": {
-            "websocket-driver": ">=0.5.1"
-          }
-        },
         "fill-range": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
           }
         },
         "fsevents": {
-          "dev": true,
-          "optional": true,
           "version": "2.1.3"
         },
         "glob-parent": {
             "is-wsl": "^1.1.0"
           }
         },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
         "readdirp": {
           "version": "2.2.1",
           "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
             "statuses": "~1.5.0"
           }
         },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        },
         "to-regex-range": {
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
         "strip-bom": "^3.0.0"
       },
       "dependencies": {
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
         "pify": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
       "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+      "dev": true,
       "requires": {
         "p-locate": "^4.1.0"
       }
       "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
       "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
     },
+    "lodash.flatten": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
+      "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
+      "dev": true
+    },
+    "lodash.mapvalues": {
+      "version": "4.6.0",
+      "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz",
+      "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=",
+      "dev": true
+    },
     "lodash.memoize": {
       "version": "4.1.2",
       "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
       "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4="
     },
+    "lodash.merge": {
+      "version": "4.6.2",
+      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+      "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+      "dev": true
+    },
     "lodash.once": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
       "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=",
       "dev": true
     },
+    "lodash.sortby": {
+      "version": "4.7.0",
+      "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
+      "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=",
+      "dev": true
+    },
     "lodash.throttle": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
       "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
-      "dev": true,
       "requires": {
         "js-tokens": "^3.0.0 || ^4.0.0"
       }
         "signal-exit": "^3.0.0"
       }
     },
+    "lowlight": {
+      "version": "1.20.0",
+      "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz",
+      "integrity": "sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==",
+      "requires": {
+        "fault": "^1.0.0",
+        "highlight.js": "~10.7.0"
+      }
+    },
     "lru-cache": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
         "yallist": "^4.0.0"
       }
     },
+    "lru-queue": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
+      "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=",
+      "requires": {
+        "es5-ext": "~0.10.2"
+      }
+    },
     "lunr": {
       "version": "2.3.9",
       "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
       "dev": true
     },
     "macos-release": {
-      "version": "2.4.1",
-      "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz",
-      "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==",
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.5.0.tgz",
+      "integrity": "sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g==",
       "dev": true
     },
     "magic-string": {
       }
     },
     "make-dir": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
-      "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
-      "dev": true,
-      "requires": {
-        "pify": "^4.0.1",
-        "semver": "^5.6.0"
-      }
-    },
-    "make-error": {
-      "version": "1.3.6",
-      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
-      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
-      "dev": true
-    },
-    "make-fetch-happen": {
-      "version": "5.0.2",
-      "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz",
-      "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==",
-      "dev": true,
-      "requires": {
-        "agentkeepalive": "^3.4.1",
-        "cacache": "^12.0.0",
-        "http-cache-semantics": "^3.8.1",
-        "http-proxy-agent": "^2.1.0",
-        "https-proxy-agent": "^2.2.3",
-        "lru-cache": "^5.1.1",
-        "mississippi": "^3.0.0",
-        "node-fetch-npm": "^2.0.2",
-        "promise-retry": "^1.1.1",
-        "socks-proxy-agent": "^4.0.0",
-        "ssri": "^6.0.0"
-      },
-      "dependencies": {
-        "cacache": {
-          "version": "12.0.4",
-          "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz",
-          "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==",
-          "dev": true,
-          "requires": {
-            "bluebird": "^3.5.5",
-            "chownr": "^1.1.1",
-            "figgy-pudding": "^3.5.1",
-            "glob": "^7.1.4",
-            "graceful-fs": "^4.1.15",
-            "infer-owner": "^1.0.3",
-            "lru-cache": "^5.1.1",
-            "mississippi": "^3.0.0",
-            "mkdirp": "^0.5.1",
-            "move-concurrently": "^1.0.1",
-            "promise-inflight": "^1.0.1",
-            "rimraf": "^2.6.3",
-            "ssri": "^6.0.1",
-            "unique-filename": "^1.1.1",
-            "y18n": "^4.0.0"
-          }
-        },
-        "chownr": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
-          "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
-          "dev": true
-        },
-        "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
-          "dev": true,
-          "requires": {
-            "fs.realpath": "^1.0.0",
-            "inflight": "^1.0.4",
-            "inherits": "2",
-            "minimatch": "^3.0.4",
-            "once": "^1.3.0",
-            "path-is-absolute": "^1.0.0"
-          }
-        },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
-        "rimraf": {
-          "version": "2.7.1",
-          "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
-          "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
-          "dev": true,
-          "requires": {
-            "glob": "^7.1.3"
-          }
-        },
-        "ssri": {
-          "version": "6.0.2",
-          "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
-          "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+      "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+      "dev": true,
+      "requires": {
+        "semver": "^6.0.0"
+      },
+      "dependencies": {
+        "semver": {
+          "version": "6.3.0",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+          "dev": true
+        }
+      }
+    },
+    "make-error": {
+      "version": "1.3.6",
+      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+      "dev": true
+    },
+    "make-fetch-happen": {
+      "version": "8.0.14",
+      "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz",
+      "integrity": "sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ==",
+      "dev": true,
+      "requires": {
+        "agentkeepalive": "^4.1.3",
+        "cacache": "^15.0.5",
+        "http-cache-semantics": "^4.1.0",
+        "http-proxy-agent": "^4.0.1",
+        "https-proxy-agent": "^5.0.0",
+        "is-lambda": "^1.0.1",
+        "lru-cache": "^6.0.0",
+        "minipass": "^3.1.3",
+        "minipass-collect": "^1.0.2",
+        "minipass-fetch": "^1.3.2",
+        "minipass-flush": "^1.0.5",
+        "minipass-pipeline": "^1.2.4",
+        "promise-retry": "^2.0.1",
+        "socks-proxy-agent": "^5.0.0",
+        "ssri": "^8.0.0"
+      },
+      "dependencies": {
+        "promise-retry": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
+          "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",
           "dev": true,
           "requires": {
-            "figgy-pudding": "^3.5.1"
+            "err-code": "^2.0.2",
+            "retry": "^0.12.0"
           }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
         }
       }
     },
       }
     },
     "makeerror": {
-      "version": "1.0.11",
-      "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz",
-      "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=",
+      "version": "1.0.12",
+      "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",
+      "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==",
       "dev": true,
       "requires": {
-        "tmpl": "1.0.x"
+        "tmpl": "1.0.5"
       }
     },
     "map-age-cleaner": {
       "dev": true
     },
     "map-obj": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz",
-      "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==",
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz",
+      "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==",
       "dev": true
     },
     "map-stream": {
       "dev": true
     },
     "mdn-data": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz",
-      "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==",
+      "version": "2.0.14",
+      "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
+      "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
       "dev": true
     },
     "media-typer": {
         "p-is-promise": "^2.0.0"
       }
     },
+    "memoizee": {
+      "version": "0.4.15",
+      "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
+      "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
+      "requires": {
+        "d": "^1.0.1",
+        "es5-ext": "^0.10.53",
+        "es6-weak-map": "^2.0.3",
+        "event-emitter": "^0.3.5",
+        "is-promise": "^2.2.2",
+        "lru-queue": "^0.1.0",
+        "next-tick": "^1.1.0",
+        "timers-ext": "^0.1.7"
+      }
+    },
     "memory-fs": {
-      "version": "0.5.0",
-      "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
-      "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
+      "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
       "dev": true,
       "requires": {
         "errno": "^0.1.3",
         "readable-stream": "^2.0.1"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "memorystream": {
           }
         },
         "normalize-package-data": {
-          "version": "3.0.2",
-          "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz",
-          "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==",
+          "version": "3.0.3",
+          "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz",
+          "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==",
           "dev": true,
           "requires": {
             "hosted-git-info": "^4.0.1",
-            "resolve": "^1.20.0",
+            "is-core-module": "^2.5.0",
             "semver": "^7.3.4",
             "validate-npm-package-license": "^3.0.1"
           }
           "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz",
           "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==",
           "dev": true
-        },
-        "yargs-parser": {
-          "version": "20.2.7",
-          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
-          "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
-          "dev": true
         }
       }
     },
       "dev": true
     },
     "mime-db": {
-      "version": "1.47.0",
-      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
-      "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
+      "version": "1.50.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
+      "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
       "dev": true
     },
     "mime-types": {
-      "version": "2.1.30",
-      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
-      "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+      "version": "2.1.33",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
+      "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
       "dev": true,
       "requires": {
-        "mime-db": "1.47.0"
+        "mime-db": "1.50.0"
       }
     },
     "mimic-fn": {
       "dev": true
     },
     "mini-css-extract-plugin": {
-      "version": "0.10.0",
-      "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.10.0.tgz",
-      "integrity": "sha512-QgKgJBjaJhxVPwrLNqqwNS0AGkuQQ31Hp4xGXEK/P7wehEg6qmNtReHKai3zRXqY60wGVWLYcOMJK2b98aGc3A==",
+      "version": "1.3.5",
+      "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.5.tgz",
+      "integrity": "sha512-tvmzcwqJJXau4OQE5vT72pRT18o2zF+tQJp8CWchqvfQnTlflkzS+dANYcRdyPRWUWRkfmeNTKltx0NZI/b5dQ==",
       "dev": true,
       "requires": {
-        "loader-utils": "^1.1.0",
-        "normalize-url": "1.9.1",
-        "schema-utils": "^1.0.0",
+        "loader-utils": "^2.0.0",
+        "schema-utils": "^3.0.0",
         "webpack-sources": "^1.1.0"
       },
       "dependencies": {
-        "json5": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
-          "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
-          "dev": true,
-          "requires": {
-            "minimist": "^1.2.0"
-          }
-        },
-        "loader-utils": {
-          "version": "1.4.0",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
-          "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
           "dev": true,
           "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^1.0.1"
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
           }
         },
-        "normalize-url": {
-          "version": "1.9.1",
-          "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
-          "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=",
-          "dev": true,
-          "requires": {
-            "object-assign": "^4.0.1",
-            "prepend-http": "^1.0.0",
-            "query-string": "^4.1.0",
-            "sort-keys": "^1.0.0"
-          }
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
         },
-        "schema-utils": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
-          "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
           "dev": true,
           "requires": {
-            "ajv": "^6.1.0",
-            "ajv-errors": "^1.0.0",
-            "ajv-keywords": "^3.1.0"
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
           }
         }
       }
         "arrify": "^1.0.1",
         "is-plain-obj": "^1.1.0",
         "kind-of": "^6.0.3"
+      },
+      "dependencies": {
+        "is-plain-obj": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+          "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+          "dev": true
+        }
       }
     },
     "minipass": {
-      "version": "3.1.3",
-      "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz",
-      "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==",
+      "version": "3.1.5",
+      "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz",
+      "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==",
       "dev": true,
       "requires": {
         "yallist": "^4.0.0"
         "minipass": "^3.0.0"
       }
     },
+    "minipass-fetch": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz",
+      "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==",
+      "dev": true,
+      "requires": {
+        "encoding": "^0.1.12",
+        "minipass": "^3.1.0",
+        "minipass-sized": "^1.0.3",
+        "minizlib": "^2.0.0"
+      }
+    },
     "minipass-flush": {
       "version": "1.0.5",
       "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz",
         "minipass": "^3.0.0"
       }
     },
+    "minipass-json-stream": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz",
+      "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==",
+      "dev": true,
+      "requires": {
+        "jsonparse": "^1.3.1",
+        "minipass": "^3.0.0"
+      }
+    },
     "minipass-pipeline": {
       "version": "1.2.4",
       "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",
         "minipass": "^3.0.0"
       }
     },
+    "minipass-sized": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz",
+      "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==",
+      "dev": true,
+      "requires": {
+        "minipass": "^3.0.0"
+      }
+    },
     "minizlib": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
       }
     },
     "mkdirp": {
-      "version": "0.5.5",
-      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
-      "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
-      "dev": true,
-      "requires": {
-        "minimist": "^1.2.5"
-      }
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+      "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+      "dev": true
     },
     "mobx": {
       "version": "4.14.1",
             "ms": "2.0.0"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "ms": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
       },
       "dependencies": {
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "path-is-absolute": "^1.0.0"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
       }
     },
     "mri": {
-      "version": "1.1.6",
-      "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
-      "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==",
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+      "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
       "dev": true
     },
     "ms": {
       "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
       "dev": true
     },
+    "nanocolors": {
+      "version": "0.1.12",
+      "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz",
+      "integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
+      "dev": true
+    },
+    "nanoid": {
+      "version": "3.1.30",
+      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
+      "integrity": "sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==",
+      "dev": true
+    },
     "nanomatch": {
       "version": "1.2.13",
       "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
         "to-regex": "^3.0.1"
       }
     },
-    "native-request": {
-      "version": "1.0.8",
-      "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.0.8.tgz",
-      "integrity": "sha512-vU2JojJVelUGp6jRcLwToPoWGxSx23z/0iX+I77J3Ht17rf2INGjrhOoQnjVo60nQd8wVsgzKkPfRXBiVdD2ag==",
-      "dev": true,
-      "optional": true
-    },
     "natural-compare": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
       "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
       "dev": true
     },
+    "needle": {
+      "version": "2.9.1",
+      "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz",
+      "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "debug": "^3.2.6",
+        "iconv-lite": "^0.4.4",
+        "sax": "^1.2.4"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "3.2.7",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+          "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ms": "^2.1.1"
+          }
+        },
+        "iconv-lite": {
+          "version": "0.4.24",
+          "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+          "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safer-buffer": ">= 2.1.2 < 3"
+          }
+        }
+      }
+    },
     "negotiator": {
       "version": "0.6.2",
       "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
       "dev": true
     },
     "next-tick": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
-      "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
-      "dev": true
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
+      "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
     },
     "ng-block-ui": {
       "version": "3.0.2",
       "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
       "dev": true
     },
-    "node-fetch-npm": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz",
-      "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==",
-      "dev": true,
+    "node-domexception": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+      "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
+    },
+    "node-fetch": {
+      "version": "1.7.3",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
+      "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
       "requires": {
         "encoding": "^0.1.11",
-        "json-parse-better-errors": "^1.0.0",
-        "safe-buffer": "^5.1.1"
+        "is-stream": "^1.0.1"
       }
     },
     "node-forge": {
       "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==",
       "dev": true
     },
+    "node-gyp": {
+      "version": "7.1.2",
+      "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz",
+      "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==",
+      "dev": true,
+      "requires": {
+        "env-paths": "^2.2.0",
+        "glob": "^7.1.4",
+        "graceful-fs": "^4.2.3",
+        "nopt": "^5.0.0",
+        "npmlog": "^4.1.2",
+        "request": "^2.88.2",
+        "rimraf": "^3.0.2",
+        "semver": "^7.3.2",
+        "tar": "^6.0.2",
+        "which": "^2.0.2"
+      },
+      "dependencies": {
+        "glob": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+          "dev": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        },
+        "semver": {
+          "version": "7.3.5",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+          "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
+          "dev": true,
+          "requires": {
+            "lru-cache": "^6.0.0"
+          }
+        },
+        "which": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+          "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+          "dev": true,
+          "requires": {
+            "isexe": "^2.0.0"
+          }
+        }
+      }
+    },
     "node-int64": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
         "vm-browserify": "^1.0.1"
       },
       "dependencies": {
-        "punycode": {
-          "version": "1.4.1",
-          "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
-          "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
-          "dev": true
+        "buffer": {
+          "version": "4.9.2",
+          "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz",
+          "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
+          "dev": true,
+          "requires": {
+            "base64-js": "^1.0.2",
+            "ieee754": "^1.1.4",
+            "isarray": "^1.0.0"
+          }
+        },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          },
+          "dependencies": {
+            "string_decoder": {
+              "version": "1.1.1",
+              "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+              "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+              "dev": true,
+              "requires": {
+                "safe-buffer": "~5.1.0"
+              }
+            }
+          }
         }
       }
     },
       }
     },
     "node-releases": {
-      "version": "1.1.71",
-      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz",
-      "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
+      "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
       "dev": true
     },
+    "nopt": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
+      "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
+      "dev": true,
+      "requires": {
+        "abbrev": "1"
+      }
+    },
     "normalize-package-data": {
       "version": "2.5.0",
       "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
       "dev": true
     },
     "normalize-url": {
-      "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz",
-      "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==",
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
+      "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==",
       "dev": true
     },
     "npm-bundled": {
       "dev": true
     },
     "npm-package-arg": {
-      "version": "8.0.1",
-      "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.0.1.tgz",
-      "integrity": "sha512-/h5Fm6a/exByzFSTm7jAyHbgOqErl9qSNJDQF32Si/ZzgwT2TERVxRxn3Jurw1wflgyVVAxnFR4fRHPM7y1ClQ==",
+      "version": "8.1.0",
+      "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz",
+      "integrity": "sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==",
       "dev": true,
       "requires": {
-        "hosted-git-info": "^3.0.2",
+        "hosted-git-info": "^3.0.6",
         "semver": "^7.0.0",
         "validate-npm-package-name": "^3.0.0"
       },
       }
     },
     "npm-packlist": {
-      "version": "1.4.8",
-      "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz",
-      "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==",
+      "version": "2.2.2",
+      "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz",
+      "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==",
       "dev": true,
       "requires": {
-        "ignore-walk": "^3.0.1",
-        "npm-bundled": "^1.0.1",
+        "glob": "^7.1.6",
+        "ignore-walk": "^3.0.3",
+        "npm-bundled": "^1.1.1",
         "npm-normalize-package-bin": "^1.0.1"
+      },
+      "dependencies": {
+        "glob": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+          "dev": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        }
       }
     },
     "npm-pick-manifest": {
       }
     },
     "npm-registry-fetch": {
-      "version": "4.0.7",
-      "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.7.tgz",
-      "integrity": "sha512-cny9v0+Mq6Tjz+e0erFAB+RYJ/AVGzkjnISiobqP8OWj9c9FLoZZu8/SPSKJWE17F1tk4018wfjV+ZbIbqC7fQ==",
+      "version": "9.0.0",
+      "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz",
+      "integrity": "sha512-PuFYYtnQ8IyVl6ib9d3PepeehcUeHN9IO5N/iCRhyg9tStQcqGQBRVHmfmMWPDERU3KwZoHFvbJ4FPXPspvzbA==",
       "dev": true,
       "requires": {
-        "JSONStream": "^1.3.4",
-        "bluebird": "^3.5.1",
-        "figgy-pudding": "^3.4.1",
-        "lru-cache": "^5.1.1",
-        "make-fetch-happen": "^5.0.0",
-        "npm-package-arg": "^6.1.0",
-        "safe-buffer": "^5.2.0"
-      },
-      "dependencies": {
-        "hosted-git-info": {
-          "version": "2.8.9",
-          "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
-          "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
-          "dev": true
-        },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
-        "npm-package-arg": {
-          "version": "6.1.1",
-          "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
-          "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==",
-          "dev": true,
-          "requires": {
-            "hosted-git-info": "^2.7.1",
-            "osenv": "^0.1.5",
-            "semver": "^5.6.0",
-            "validate-npm-package-name": "^3.0.0"
-          }
-        },
-        "safe-buffer": {
-          "version": "5.2.1",
-          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
-          "dev": true
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
-        }
+        "@npmcli/ci-detect": "^1.0.0",
+        "lru-cache": "^6.0.0",
+        "make-fetch-happen": "^8.0.9",
+        "minipass": "^3.1.3",
+        "minipass-fetch": "^1.3.0",
+        "minipass-json-stream": "^1.0.1",
+        "minizlib": "^2.0.0",
+        "npm-package-arg": "^8.0.0"
       }
     },
     "npm-run-all": {
         "path-key": "^2.0.0"
       }
     },
+    "npmlog": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
+      "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
+      "dev": true,
+      "requires": {
+        "are-we-there-yet": "~1.1.2",
+        "console-control-strings": "~1.1.0",
+        "gauge": "~2.7.3",
+        "set-blocking": "~2.0.0"
+      }
+    },
     "nth-check": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
-      "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
+      "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
       "dev": true,
       "requires": {
-        "boolbase": "~1.0.0"
+        "boolbase": "^1.0.0"
       }
     },
     "num2fraction": {
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
-      "dev": true
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
     },
     "object-copy": {
       "version": "0.1.0",
       }
     },
     "object-inspect": {
-      "version": "1.10.3",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz",
-      "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==",
-      "dev": true
+      "version": "1.11.0",
+      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
+      "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
     },
     "object-is": {
       "version": "1.1.5",
         "isobject": "^3.0.0"
       }
     },
-    "object.getownpropertydescriptors": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz",
-      "integrity": "sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ==",
-      "dev": true,
-      "requires": {
-        "call-bind": "^1.0.2",
-        "define-properties": "^1.1.3",
-        "es-abstract": "^1.18.0-next.2"
-      }
-    },
     "object.map": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
         "isobject": "^3.0.1"
       }
     },
-    "object.values": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz",
-      "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==",
-      "dev": true,
-      "requires": {
-        "call-bind": "^1.0.2",
-        "define-properties": "^1.1.3",
-        "es-abstract": "^1.18.0-next.2",
-        "has": "^1.0.3"
-      }
-    },
     "obuf": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
       }
     },
     "open": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/open/-/open-7.2.0.tgz",
-      "integrity": "sha512-4HeyhxCvBTI5uBePsAdi55C5fmqnWZ2e2MlmvWi5KW5tdH5rxoiv/aMtbeVxKZc3eWkT1GymMnLG8XC4Rq4TDQ==",
+      "version": "7.4.0",
+      "resolved": "https://registry.npmjs.org/open/-/open-7.4.0.tgz",
+      "integrity": "sha512-PGoBCX/lclIWlpS/R2PQuIR4NJoXh6X5AwVzE7WXnWRGvHg7+4TBCgsujUgiPpm0K1y4qvQeWnCWVTpTKZBtvA==",
       "dev": true,
       "requires": {
         "is-docker": "^2.0.0",
       }
     },
     "ora": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/ora/-/ora-5.0.0.tgz",
-      "integrity": "sha512-s26qdWqke2kjN/wC4dy+IQPBIMWBJlSU/0JZhk30ZDBLelW25rv66yutUWARMigpGPzcXHb+Nac5pNhN/WsARw==",
+      "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/ora/-/ora-5.3.0.tgz",
+      "integrity": "sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==",
       "dev": true,
       "requires": {
+        "bl": "^4.0.3",
         "chalk": "^4.1.0",
         "cli-cursor": "^3.1.0",
-        "cli-spinners": "^2.4.0",
+        "cli-spinners": "^2.5.0",
         "is-interactive": "^1.0.0",
         "log-symbols": "^4.0.0",
-        "mute-stream": "0.0.8",
         "strip-ansi": "^6.0.0",
         "wcwidth": "^1.0.1"
       },
           }
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
       "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=",
       "dev": true
     },
-    "os-homedir": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
-      "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
-      "dev": true
-    },
     "os-locale": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
       "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
       "dev": true
     },
-    "osenv": {
-      "version": "0.1.5",
-      "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
-      "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
-      "dev": true,
-      "requires": {
-        "os-homedir": "^1.0.0",
-        "os-tmpdir": "^1.0.0"
-      }
-    },
     "ospath": {
       "version": "1.2.2",
       "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz",
       "version": "2.3.0",
       "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
       "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
-      "requires": {
-        "p-try": "^2.0.0"
-      }
-    },
-    "p-locate": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
-      "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
-      "requires": {
-        "p-limit": "^2.2.0"
-      }
-    },
-    "p-map": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
-      "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
-      "dev": true,
-      "requires": {
-        "aggregate-error": "^3.0.0"
-      }
-    },
-    "p-retry": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz",
-      "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==",
       "dev": true,
       "requires": {
-        "retry": "^0.12.0"
+        "p-try": "^2.0.0"
       }
-    },
-    "p-try": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
-      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
-    },
-    "pacote": {
-      "version": "9.5.12",
-      "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.12.tgz",
-      "integrity": "sha512-BUIj/4kKbwWg4RtnBncXPJd15piFSVNpTzY0rysSr3VnMowTYgkGKcaHrbReepAkjTr8lH2CVWRi58Spg2CicQ==",
-      "dev": true,
-      "requires": {
-        "bluebird": "^3.5.3",
-        "cacache": "^12.0.2",
-        "chownr": "^1.1.2",
-        "figgy-pudding": "^3.5.1",
-        "get-stream": "^4.1.0",
-        "glob": "^7.1.3",
-        "infer-owner": "^1.0.4",
-        "lru-cache": "^5.1.1",
-        "make-fetch-happen": "^5.0.0",
-        "minimatch": "^3.0.4",
-        "minipass": "^2.3.5",
-        "mississippi": "^3.0.0",
-        "mkdirp": "^0.5.1",
-        "normalize-package-data": "^2.4.0",
-        "npm-normalize-package-bin": "^1.0.0",
-        "npm-package-arg": "^6.1.0",
-        "npm-packlist": "^1.1.12",
-        "npm-pick-manifest": "^3.0.0",
-        "npm-registry-fetch": "^4.0.0",
-        "osenv": "^0.1.5",
-        "promise-inflight": "^1.0.1",
-        "promise-retry": "^1.1.1",
-        "protoduck": "^5.0.1",
-        "rimraf": "^2.6.2",
-        "safe-buffer": "^5.1.2",
-        "semver": "^5.6.0",
-        "ssri": "^6.0.1",
-        "tar": "^4.4.10",
-        "unique-filename": "^1.1.1",
-        "which": "^1.3.1"
-      },
-      "dependencies": {
-        "cacache": {
-          "version": "12.0.4",
-          "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz",
-          "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==",
-          "dev": true,
-          "requires": {
-            "bluebird": "^3.5.5",
-            "chownr": "^1.1.1",
-            "figgy-pudding": "^3.5.1",
-            "glob": "^7.1.4",
-            "graceful-fs": "^4.1.15",
-            "infer-owner": "^1.0.3",
-            "lru-cache": "^5.1.1",
-            "mississippi": "^3.0.0",
-            "mkdirp": "^0.5.1",
-            "move-concurrently": "^1.0.1",
-            "promise-inflight": "^1.0.1",
-            "rimraf": "^2.6.3",
-            "ssri": "^6.0.1",
-            "unique-filename": "^1.1.1",
-            "y18n": "^4.0.0"
-          }
-        },
-        "chownr": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
-          "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
-          "dev": true
-        },
-        "fs-minipass": {
-          "version": "1.2.7",
-          "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
-          "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
-          "dev": true,
-          "requires": {
-            "minipass": "^2.6.0"
-          }
-        },
-        "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
-          "dev": true,
-          "requires": {
-            "fs.realpath": "^1.0.0",
-            "inflight": "^1.0.4",
-            "inherits": "2",
-            "minimatch": "^3.0.4",
-            "once": "^1.3.0",
-            "path-is-absolute": "^1.0.0"
-          }
-        },
-        "hosted-git-info": {
-          "version": "2.8.9",
-          "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
-          "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
-          "dev": true
-        },
-        "lru-cache": {
-          "version": "5.1.1",
-          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-          "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-          "dev": true,
-          "requires": {
-            "yallist": "^3.0.2"
-          }
-        },
-        "minipass": {
-          "version": "2.9.0",
-          "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
-          "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
-          "dev": true,
-          "requires": {
-            "safe-buffer": "^5.1.2",
-            "yallist": "^3.0.0"
-          }
-        },
-        "minizlib": {
-          "version": "1.3.3",
-          "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
-          "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
-          "dev": true,
-          "requires": {
-            "minipass": "^2.9.0"
-          }
-        },
-        "npm-package-arg": {
-          "version": "6.1.1",
-          "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
-          "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==",
-          "dev": true,
-          "requires": {
-            "hosted-git-info": "^2.7.1",
-            "osenv": "^0.1.5",
-            "semver": "^5.6.0",
-            "validate-npm-package-name": "^3.0.0"
-          }
-        },
-        "npm-pick-manifest": {
-          "version": "3.0.2",
-          "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz",
-          "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==",
-          "dev": true,
-          "requires": {
-            "figgy-pudding": "^3.5.1",
-            "npm-package-arg": "^6.0.0",
-            "semver": "^5.4.1"
-          }
-        },
-        "rimraf": {
-          "version": "2.7.1",
-          "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
-          "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
-          "dev": true,
-          "requires": {
-            "glob": "^7.1.3"
-          }
-        },
-        "ssri": {
-          "version": "6.0.2",
-          "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
-          "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
-          "dev": true,
-          "requires": {
-            "figgy-pudding": "^3.5.1"
-          }
-        },
-        "tar": {
-          "version": "4.4.13",
-          "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
-          "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
-          "dev": true,
-          "requires": {
-            "chownr": "^1.1.1",
-            "fs-minipass": "^1.2.5",
-            "minipass": "^2.8.6",
-            "minizlib": "^1.2.1",
-            "mkdirp": "^0.5.0",
-            "safe-buffer": "^5.1.2",
-            "yallist": "^3.0.3"
-          }
-        },
-        "yallist": {
-          "version": "3.1.1",
-          "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
-          "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
-          "dev": true
-        }
+    },
+    "p-locate": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+      "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+      "dev": true,
+      "requires": {
+        "p-limit": "^2.2.0"
+      }
+    },
+    "p-map": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
+      "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
+      "dev": true,
+      "requires": {
+        "aggregate-error": "^3.0.0"
+      }
+    },
+    "p-retry": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz",
+      "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==",
+      "dev": true,
+      "requires": {
+        "retry": "^0.12.0"
+      }
+    },
+    "p-try": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+      "dev": true
+    },
+    "pacote": {
+      "version": "11.2.4",
+      "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.2.4.tgz",
+      "integrity": "sha512-GfTeVQGJ6WyBQbQD4t3ocHbyOmTQLmWjkCKSZPmKiGFKYKNUaM5U2gbLzUW8WG1XmS9yQFnsTFA0k3o1+q4klQ==",
+      "dev": true,
+      "requires": {
+        "@npmcli/git": "^2.0.1",
+        "@npmcli/installed-package-contents": "^1.0.5",
+        "@npmcli/promise-spawn": "^1.2.0",
+        "@npmcli/run-script": "^1.3.0",
+        "cacache": "^15.0.5",
+        "chownr": "^2.0.0",
+        "fs-minipass": "^2.1.0",
+        "infer-owner": "^1.0.4",
+        "minipass": "^3.1.3",
+        "mkdirp": "^1.0.3",
+        "npm-package-arg": "^8.0.1",
+        "npm-packlist": "^2.1.4",
+        "npm-pick-manifest": "^6.0.0",
+        "npm-registry-fetch": "^9.0.0",
+        "promise-retry": "^1.1.1",
+        "read-package-json-fast": "^1.1.3",
+        "rimraf": "^3.0.2",
+        "ssri": "^8.0.0",
+        "tar": "^6.1.0"
       }
     },
     "pako": {
         "cyclist": "^1.0.1",
         "inherits": "^2.0.3",
         "readable-stream": "^2.1.5"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "parent-module": {
       "dev": true,
       "requires": {
         "callsites": "^3.0.0"
-      },
-      "dependencies": {
-        "callsites": {
-          "version": "3.1.0",
-          "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
-          "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
-          "dev": true
-        }
       }
     },
     "parse-asn1": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz",
       "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==",
-      "dev": true,
       "requires": {
         "character-entities": "^1.0.0",
         "character-entities-legacy": "^1.0.0",
       }
     },
     "parse-json": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
-      "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+      "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
       "dev": true,
       "requires": {
+        "@babel/code-frame": "^7.0.0",
         "error-ex": "^1.3.1",
-        "json-parse-better-errors": "^1.0.1"
+        "json-parse-even-better-errors": "^2.3.0",
+        "lines-and-columns": "^1.1.6"
       }
     },
     "parse-node-version": {
       "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
       "dev": true
     },
+    "parse5-html-rewriting-stream": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/parse5-html-rewriting-stream/-/parse5-html-rewriting-stream-6.0.1.tgz",
+      "integrity": "sha512-vwLQzynJVEfUlURxgnf51yAJDQTtVpNyGD8tKi2Za7m+akukNHxCcUQMAa/mUGLhCeicFdpy7Tlvj8ZNKadprg==",
+      "dev": true,
+      "requires": {
+        "parse5": "^6.0.1",
+        "parse5-sax-parser": "^6.0.1"
+      }
+    },
     "parse5-htmlparser2-tree-adapter": {
       "version": "6.0.1",
       "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz",
         "parse5": "^6.0.1"
       }
     },
+    "parse5-sax-parser": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/parse5-sax-parser/-/parse5-sax-parser-6.0.1.tgz",
+      "integrity": "sha512-kXX+5S81lgESA0LsDuGjAlBybImAChYRMT+/uKCEXFBFOeEhS52qUCydGhU3qLRD8D9DVjaUo821WK7DM4iCeg==",
+      "dev": true,
+      "requires": {
+        "parse5": "^6.0.1"
+      }
+    },
     "parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
     "path-exists": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
-      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="
+      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+      "dev": true
     },
     "path-is-absolute": {
       "version": "1.0.1",
       "dev": true
     },
     "path-parse": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
-      "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
     },
     "path-root": {
       "version": "0.1.1",
       }
     },
     "pdfkit": {
-      "version": "0.12.1",
-      "resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.12.1.tgz",
-      "integrity": "sha512-ruNLx49hVW3ePJziKjHtWdTHN1VZHLCUCcbui/vx4lYwFLEM1d8W0L7ObYPbN8EifK7s281ZMugCLgSbk+KRhg==",
+      "version": "0.12.3",
+      "resolved": "https://registry.npmjs.org/pdfkit/-/pdfkit-0.12.3.tgz",
+      "integrity": "sha512-+qDLgm2yq6WOKcxTb43lDeo3EtMIDQs0CK1RNqhHC9iT6u0KOmgwAClkYh9xFw2ATbmUZzt4f7KMwDCOfPDluA==",
       "dev": true,
       "requires": {
-        "crypto-js": "^3.3.0",
+        "crypto-js": "^4.0.0",
         "fontkit": "^1.8.1",
         "linebreak": "^1.0.2",
         "png-js": "^1.0.0"
       }
     },
     "pdfmake": {
-      "version": "0.1.71",
-      "resolved": "https://registry.npmjs.org/pdfmake/-/pdfmake-0.1.71.tgz",
-      "integrity": "sha512-uXUy+NZ8R5pwJ6rYLJRu7VRw/w5ogBScNk440CHpMZ6Z0+E1uc1XvwK4I1U5ry0UZQ3qPD0dpSvbzAkRBKYoJA==",
+      "version": "0.1.72",
+      "resolved": "https://registry.npmjs.org/pdfmake/-/pdfmake-0.1.72.tgz",
+      "integrity": "sha512-xZrPS+Safjf1I8ZYtMoXX83E6C6Pd1zFwa168yNTeeJWHclqf1z9DoYajjlY2uviN7gGyxwVZeou39uSk1oh1g==",
       "dev": true,
       "requires": {
         "iconv-lite": "^0.6.2",
       "dev": true
     },
     "performance-now": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
-      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz",
+      "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU="
+    },
+    "picocolors": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+      "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
       "dev": true
     },
     "picomatch": {
-      "version": "2.2.3",
-      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",
-      "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==",
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
+      "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
       "dev": true
     },
     "pidtree": {
       }
     },
     "pkg-dir": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
-      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+      "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
       "dev": true,
       "requires": {
-        "find-up": "^3.0.0"
-      },
-      "dependencies": {
-        "find-up": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
-          "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
-          "dev": true,
-          "requires": {
-            "locate-path": "^3.0.0"
-          }
-        },
-        "locate-path": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
-          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
-          "dev": true,
-          "requires": {
-            "p-locate": "^3.0.0",
-            "path-exists": "^3.0.0"
-          }
-        },
-        "p-locate": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
-          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
-          "dev": true,
-          "requires": {
-            "p-limit": "^2.0.0"
-          }
-        },
-        "path-exists": {
-          "version": "3.0.0",
-          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
-          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
-          "dev": true
-        }
+        "find-up": "^4.0.0"
       }
     },
+    "pn": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
+      "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==",
+      "dev": true
+    },
+    "png-async": {
+      "version": "0.9.4",
+      "resolved": "https://registry.npmjs.org/png-async/-/png-async-0.9.4.tgz",
+      "integrity": "sha512-B//AXX9TkneKfgtOpT1mdUnnhk2BImGD+a98vImsMU8uo1dBeHyW/kM2erWZ/CsYteTPU/xKG+t6T62heHkC3A==",
+      "dev": true
+    },
     "png-js": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/png-js/-/png-js-1.0.0.tgz",
           "requires": {
             "ms": "^2.1.1"
           }
+        },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
         }
       }
     },
       "dev": true
     },
     "postcss": {
-      "version": "7.0.32",
-      "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",
-      "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==",
+      "version": "8.2.15",
+      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.15.tgz",
+      "integrity": "sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q==",
       "dev": true,
       "requires": {
-        "chalk": "^2.4.2",
-        "source-map": "^0.6.1",
-        "supports-color": "^6.1.0"
+        "colorette": "^1.2.2",
+        "nanoid": "^3.1.23",
+        "source-map": "^0.6.1"
       },
       "dependencies": {
         "source-map": {
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
           "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
           "dev": true
-        },
-        "supports-color": {
-          "version": "6.1.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
-          "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
-          "dev": true,
-          "requires": {
-            "has-flag": "^3.0.0"
-          }
         }
       }
     },
     "postcss-calc": {
-      "version": "7.0.5",
-      "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.5.tgz",
-      "integrity": "sha512-1tKHutbGtLtEZF6PT4JSihCHfIVldU72mZ8SdZHIYriIZ9fh9k9aWSppaT8rHsyI3dX+KSR+W+Ix9BMY3AODrg==",
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.0.0.tgz",
+      "integrity": "sha512-5NglwDrcbiy8XXfPM11F3HeC6hoT9W7GUH/Zi5U/p7u3Irv4rHhdDcIZwG0llHXV4ftsBjpfWMXAnXNl4lnt8g==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.27",
         "postcss-selector-parser": "^6.0.2",
         "postcss-value-parser": "^4.0.2"
       }
     },
     "postcss-colormin": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz",
-      "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==",
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.2.0.tgz",
+      "integrity": "sha512-+HC6GfWU3upe5/mqmxuqYZ9B2Wl4lcoUUNkoaX59nEWV4EtADCMiBqui111Bu8R8IvaZTmqmxrqOAqjbHIwXPw==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.0.0",
-        "color": "^3.0.0",
-        "has": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "browserslist": "^4.16.6",
+        "caniuse-api": "^3.0.0",
+        "colord": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-convert-values": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz",
-      "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.0.1.tgz",
+      "integrity": "sha512-C3zR1Do2BkKkCgC0g3sF8TS0koF2G+mN8xxayZx3f10cIRmTaAnpgpRQZjNekTZxM2ciSPoh2IWJm0VZx8NoQg==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-discard-comments": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz",
-      "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz",
+      "integrity": "sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==",
+      "dev": true
     },
     "postcss-discard-duplicates": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz",
-      "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz",
+      "integrity": "sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==",
+      "dev": true
     },
     "postcss-discard-empty": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz",
-      "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz",
+      "integrity": "sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==",
+      "dev": true
     },
     "postcss-discard-overridden": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz",
-      "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz",
+      "integrity": "sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==",
+      "dev": true
     },
     "postcss-html": {
       "version": "0.36.0",
         "htmlparser2": "^3.10.0"
       },
       "dependencies": {
+        "dom-serializer": {
+          "version": "0.2.2",
+          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
+          "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
+          "dev": true,
+          "requires": {
+            "domelementtype": "^2.0.1",
+            "entities": "^2.0.0"
+          },
+          "dependencies": {
+            "domelementtype": {
+              "version": "2.2.0",
+              "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
+              "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==",
+              "dev": true
+            },
+            "entities": {
+              "version": "2.2.0",
+              "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
+              "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
+              "dev": true
+            }
+          }
+        },
+        "domelementtype": {
+          "version": "1.3.1",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+          "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
+          "dev": true
+        },
         "domhandler": {
           "version": "2.4.2",
           "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
             "domelementtype": "1"
           }
         },
+        "domutils": {
+          "version": "1.7.0",
+          "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
+          "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+          "dev": true,
+          "requires": {
+            "dom-serializer": "0",
+            "domelementtype": "1"
+          }
+        },
         "entities": {
           "version": "1.1.2",
           "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
             "inherits": "^2.0.1",
             "readable-stream": "^3.1.1"
           }
-        },
-        "readable-stream": {
-          "version": "3.6.0",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
-          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
-          "dev": true,
-          "requires": {
-            "inherits": "^2.0.3",
-            "string_decoder": "^1.1.1",
-            "util-deprecate": "^1.0.1"
-          }
         }
       }
     },
     "postcss-import": {
-      "version": "12.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-12.0.1.tgz",
-      "integrity": "sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw==",
+      "version": "14.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.0.0.tgz",
+      "integrity": "sha512-gFDDzXhqr9ELmnLHgCC3TbGfA6Dm/YMb/UN8/f7Uuq4fL7VTk2vOIj6hwINEwbokEmp123bLD7a5m+E+KIetRg==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.1",
-        "postcss-value-parser": "^3.2.3",
+        "postcss-value-parser": "^4.0.0",
         "read-cache": "^1.0.0",
         "resolve": "^1.1.7"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
       }
     },
     "postcss-jsx": {
       "dev": true,
       "requires": {
         "postcss": "^7.0.14"
-      }
-    },
-    "postcss-load-config": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.2.tgz",
-      "integrity": "sha512-/rDeGV6vMUo3mwJZmeHfEDvwnTKKqQ0S7OHUi/kJvvtx3aWtyWG2/0ZWnzCt2keEclwN6Tf0DST2v9kITdOKYw==",
-      "dev": true,
-      "requires": {
-        "cosmiconfig": "^5.0.0",
-        "import-cwd": "^2.0.0"
-      }
-    },
-    "postcss-loader": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz",
-      "integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==",
-      "dev": true,
-      "requires": {
-        "loader-utils": "^1.1.0",
-        "postcss": "^7.0.0",
-        "postcss-load-config": "^2.0.0",
-        "schema-utils": "^1.0.0"
       },
       "dependencies": {
-        "json5": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
-          "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
           "dev": true,
           "requires": {
-            "minimist": "^1.2.0"
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
           }
         },
-        "loader-utils": {
-          "version": "1.4.0",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
-          "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
+      }
+    },
+    "postcss-loader": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-4.2.0.tgz",
+      "integrity": "sha512-mqgScxHqbiz1yxbnNcPdKYo/6aVt+XExURmEbQlviFVWogDbM4AJ0A/B+ZBpYsJrTRxKw7HyRazg9x0Q9SWwLA==",
+      "dev": true,
+      "requires": {
+        "cosmiconfig": "^7.0.0",
+        "klona": "^2.0.4",
+        "loader-utils": "^2.0.0",
+        "schema-utils": "^3.0.0",
+        "semver": "^7.3.4"
+      },
+      "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
           "dev": true,
           "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^1.0.1"
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
           }
         },
-        "schema-utils": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
-          "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
+        "semver": {
+          "version": "7.3.5",
+          "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+          "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
           "dev": true,
           "requires": {
-            "ajv": "^6.1.0",
-            "ajv-errors": "^1.0.0",
-            "ajv-keywords": "^3.1.0"
+            "lru-cache": "^6.0.0"
           }
         }
       }
           "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
           "dev": true
         },
+        "is-plain-obj": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+          "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+          "dev": true
+        },
         "parse-entities": {
           "version": "1.2.2",
           "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz",
       "dev": true
     },
     "postcss-merge-longhand": {
-      "version": "4.0.11",
-      "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz",
-      "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.0.2.tgz",
+      "integrity": "sha512-BMlg9AXSI5G9TBT0Lo/H3PfUy63P84rVz3BjCFE9e9Y9RXQZD3+h3YO1kgTNsNJy7bBc1YQp8DmSnwLIW5VPcw==",
       "dev": true,
       "requires": {
-        "css-color-names": "0.0.4",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0",
-        "stylehacks": "^4.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "css-color-names": "^1.0.1",
+        "postcss-value-parser": "^4.1.0",
+        "stylehacks": "^5.0.1"
       }
     },
     "postcss-merge-rules": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz",
-      "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.0.2.tgz",
+      "integrity": "sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.0.0",
+        "browserslist": "^4.16.6",
         "caniuse-api": "^3.0.0",
-        "cssnano-util-same-parent": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-selector-parser": "^3.0.0",
-        "vendors": "^1.0.0"
-      },
-      "dependencies": {
-        "postcss-selector-parser": {
-          "version": "3.1.2",
-          "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz",
-          "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==",
-          "dev": true,
-          "requires": {
-            "dot-prop": "^5.2.0",
-            "indexes-of": "^1.0.1",
-            "uniq": "^1.0.1"
-          }
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-selector-parser": "^6.0.5",
+        "vendors": "^1.0.3"
       }
     },
     "postcss-minify-font-values": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz",
-      "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.0.1.tgz",
+      "integrity": "sha512-7JS4qIsnqaxk+FXY1E8dHBDmraYFWmuL6cgt0T1SWGRO5bzJf8sUoelwa4P88LEWJZweHevAiDKxHlofuvtIoA==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-minify-gradients": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz",
-      "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.0.2.tgz",
+      "integrity": "sha512-7Do9JP+wqSD6Prittitt2zDLrfzP9pqKs2EcLX7HJYxsxCOwrrcLt4x/ctQTsiOw+/8HYotAoqNkrzItL19SdQ==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-arguments": "^4.0.0",
-        "is-color-stop": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "colord": "^2.6",
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-minify-params": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz",
-      "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.0.1.tgz",
+      "integrity": "sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw==",
       "dev": true,
       "requires": {
-        "alphanum-sort": "^1.0.0",
-        "browserslist": "^4.0.0",
-        "cssnano-util-get-arguments": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0",
+        "alphanum-sort": "^1.0.2",
+        "browserslist": "^4.16.0",
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0",
         "uniqs": "^2.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
       }
     },
     "postcss-minify-selectors": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz",
-      "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==",
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.1.0.tgz",
+      "integrity": "sha512-NzGBXDa7aPsAcijXZeagnJBKBPMYLaJJzB8CQh6ncvyl2sIndLVWfbcDi0SBjRWk5VqEjXvf8tYwzoKf4Z07og==",
       "dev": true,
       "requires": {
-        "alphanum-sort": "^1.0.0",
-        "has": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-selector-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-selector-parser": {
-          "version": "3.1.2",
-          "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz",
-          "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==",
-          "dev": true,
-          "requires": {
-            "dot-prop": "^5.2.0",
-            "indexes-of": "^1.0.1",
-            "uniq": "^1.0.1"
-          }
-        }
+        "alphanum-sort": "^1.0.2",
+        "postcss-selector-parser": "^6.0.5"
       }
     },
     "postcss-modules-extract-imports": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz",
-      "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.5"
-      }
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
+      "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
+      "dev": true
     },
     "postcss-modules-local-by-default": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz",
-      "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz",
+      "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==",
       "dev": true,
       "requires": {
-        "icss-utils": "^4.1.1",
-        "postcss": "^7.0.32",
+        "icss-utils": "^5.0.0",
         "postcss-selector-parser": "^6.0.2",
         "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-modules-scope": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz",
-      "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==",
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz",
+      "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.6",
-        "postcss-selector-parser": "^6.0.0"
+        "postcss-selector-parser": "^6.0.4"
       }
     },
     "postcss-modules-values": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz",
-      "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz",
+      "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==",
       "dev": true,
       "requires": {
-        "icss-utils": "^4.0.0",
-        "postcss": "^7.0.6"
+        "icss-utils": "^5.0.0"
       }
     },
     "postcss-normalize-charset": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz",
-      "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==",
-      "dev": true,
-      "requires": {
-        "postcss": "^7.0.0"
-      }
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz",
+      "integrity": "sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==",
+      "dev": true
     },
     "postcss-normalize-display-values": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz",
-      "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.0.1.tgz",
+      "integrity": "sha512-uupdvWk88kLDXi5HEyI9IaAJTE3/Djbcrqq8YgjvAVuzgVuqIk3SuJWUisT2gaJbZm1H9g5k2w1xXilM3x8DjQ==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-match": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-positions": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz",
-      "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.0.1.tgz",
+      "integrity": "sha512-rvzWAJai5xej9yWqlCb1OWLd9JjW2Ex2BCPzUJrbaXmtKtgfL8dBMOOMTX6TnvQMtjk3ei1Lswcs78qKO1Skrg==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-arguments": "^4.0.0",
-        "has": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-repeat-style": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz",
-      "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.0.1.tgz",
+      "integrity": "sha512-syZ2itq0HTQjj4QtXZOeefomckiV5TaUO6ReIEabCh3wgDs4Mr01pkif0MeVwKyU/LHEkPJnpwFKRxqWA/7O3w==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-arguments": "^4.0.0",
-        "cssnano-util-get-match": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-string": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz",
-      "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.0.1.tgz",
+      "integrity": "sha512-Ic8GaQ3jPMVl1OEn2U//2pm93AXUcF3wz+OriskdZ1AOuYV25OdgS7w9Xu2LO5cGyhHCgn8dMXh9bO7vi3i9pA==",
       "dev": true,
       "requires": {
-        "has": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-timing-functions": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz",
-      "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.0.1.tgz",
+      "integrity": "sha512-cPcBdVN5OsWCNEo5hiXfLUnXfTGtSFiBU9SK8k7ii8UD7OLuznzgNRYkLZow11BkQiiqMcgPyh4ZqXEEUrtQ1Q==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-match": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-unicode": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz",
-      "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.0.1.tgz",
+      "integrity": "sha512-kAtYD6V3pK0beqrU90gpCQB7g6AOfP/2KIPCVBKJM2EheVsBQmx/Iof+9zR9NFKLAx4Pr9mDhogB27pmn354nA==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "browserslist": "^4.16.0",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-url": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz",
-      "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz",
+      "integrity": "sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ==",
       "dev": true,
       "requires": {
-        "is-absolute-url": "^2.0.0",
-        "normalize-url": "^3.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "is-absolute-url": "^3.0.3",
+        "normalize-url": "^6.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-normalize-whitespace": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz",
-      "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.0.1.tgz",
+      "integrity": "sha512-iPklmI5SBnRvwceb/XH568yyzK0qRVuAG+a1HFUsFRf11lEJTiQQa03a4RSCQvLKdcpX7XsI1Gen9LuLoqwiqA==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-ordered-values": {
-      "version": "4.1.2",
-      "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz",
-      "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.0.2.tgz",
+      "integrity": "sha512-8AFYDSOYWebJYLyJi3fyjl6CqMEG/UVworjiyK1r573I56kb3e879sCJLGvR3merj+fAdPpVplXKQZv+ey6CgQ==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-arguments": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-reduce-initial": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz",
-      "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz",
+      "integrity": "sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.0.0",
-        "caniuse-api": "^3.0.0",
-        "has": "^1.0.0",
-        "postcss": "^7.0.0"
+        "browserslist": "^4.16.0",
+        "caniuse-api": "^3.0.0"
       }
     },
     "postcss-reduce-transforms": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz",
-      "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.0.1.tgz",
+      "integrity": "sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA==",
       "dev": true,
       "requires": {
-        "cssnano-util-get-match": "^4.0.0",
-        "has": "^1.0.0",
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "cssnano-utils": "^2.0.1",
+        "postcss-value-parser": "^4.1.0"
       }
     },
     "postcss-reporter": {
           "requires": {
             "chalk": "^2.0.1"
           }
+        },
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
         }
       }
     },
       "dev": true,
       "requires": {
         "postcss": "^7.0.26"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "postcss-sass": {
       "requires": {
         "gonzales-pe": "^4.3.0",
         "postcss": "^7.0.21"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "postcss-scss": {
       "dev": true,
       "requires": {
         "postcss": "^7.0.6"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "postcss-selector-parser": {
       "requires": {
         "lodash": "^4.17.14",
         "postcss": "^7.0.17"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "postcss-svgo": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.3.tgz",
-      "integrity": "sha512-NoRbrcMWTtUghzuKSoIm6XV+sJdvZ7GZSc3wdBN0W19FTtp2ko8NqLsgoh/m9CzNhU3KLPvQmjIwtaNFkaFTvw==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.0.2.tgz",
+      "integrity": "sha512-YzQuFLZu3U3aheizD+B1joQ94vzPfE6BNUcSYuceNxlVnKKsOtdo6hL9/zyC168Q8EwfLSgaDSalsUGa9f2C0A==",
       "dev": true,
       "requires": {
-        "postcss": "^7.0.0",
-        "postcss-value-parser": "^3.0.0",
-        "svgo": "^1.0.0"
-      },
-      "dependencies": {
-        "postcss-value-parser": {
-          "version": "3.3.1",
-          "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
-          "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
-          "dev": true
-        }
+        "postcss-value-parser": "^4.1.0",
+        "svgo": "^2.3.0"
       }
     },
     "postcss-syntax": {
       "dev": true
     },
     "postcss-unique-selectors": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz",
-      "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.0.1.tgz",
+      "integrity": "sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w==",
       "dev": true,
       "requires": {
-        "alphanum-sort": "^1.0.0",
-        "postcss": "^7.0.0",
+        "alphanum-sort": "^1.0.2",
+        "postcss-selector-parser": "^6.0.5",
         "uniqs": "^2.0.0"
       }
     },
       "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
       "dev": true
     },
-    "prepend-http": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
-      "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
-      "dev": true
-    },
     "prettier": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz",
           "dev": true
         },
         "is-stream": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
-          "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+          "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
           "dev": true
         },
         "multimatch": {
         }
       }
     },
+    "prismjs": {
+      "version": "1.25.0",
+      "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
+      "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg=="
+    },
     "process": {
       "version": "0.11.10",
       "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
       "dev": true
     },
     "promise": {
-      "version": "8.1.0",
-      "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz",
-      "integrity": "sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q==",
-      "dev": true,
+      "version": "7.3.1",
+      "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
+      "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
       "requires": {
-        "asap": "~2.0.6"
+        "asap": "~2.0.3"
       }
     },
     "promise-inflight": {
         "retry": "^0.10.0"
       },
       "dependencies": {
+        "err-code": {
+          "version": "1.1.2",
+          "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz",
+          "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=",
+          "dev": true
+        },
         "retry": {
           "version": "0.10.1",
           "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz",
       }
     },
     "prompts": {
-      "version": "2.4.1",
-      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.1.tgz",
-      "integrity": "sha512-EQyfIuO2hPDsX1L/blblV+H7I0knhgAd82cVneCwcdND9B8AuCDuRcBH6yIcG4dFzlOUqbazQqwGjx5xmsNLuQ==",
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+      "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
       "dev": true,
       "requires": {
         "kleur": "^3.0.3",
         "sisteransi": "^1.0.5"
       }
     },
-    "protoduck": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz",
-      "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==",
-      "dev": true,
+    "prop-types": {
+      "version": "15.7.2",
+      "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
+      "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
+      "requires": {
+        "loose-envify": "^1.4.0",
+        "object-assign": "^4.1.1",
+        "react-is": "^16.8.1"
+      }
+    },
+    "property-information": {
+      "version": "5.6.0",
+      "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
+      "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==",
       "requires": {
-        "genfun": "^5.0.0"
+        "xtend": "^4.0.0"
       }
     },
     "proxy-addr": {
-      "version": "2.0.6",
-      "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
-      "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+      "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
       "dev": true,
       "requires": {
-        "forwarded": "~0.1.2",
+        "forwarded": "0.2.0",
         "ipaddr.js": "1.9.1"
       }
     },
       }
     },
     "punycode": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
-      "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
-      "dev": true
-    },
-    "q": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
-      "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
-      "dev": true
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
+      "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
     },
     "qs": {
-      "version": "6.7.0",
-      "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
-      "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
-      "dev": true
-    },
-    "query-string": {
-      "version": "4.3.4",
-      "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
-      "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
-      "dev": true,
+      "version": "6.10.1",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
+      "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
       "requires": {
-        "object-assign": "^4.1.0",
-        "strict-uri-encode": "^1.0.0"
+        "side-channel": "^1.0.4"
       }
     },
     "querystring": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
-      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
-      "dev": true
+      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
     },
     "querystring-es3": {
       "version": "0.2.1",
     "querystringify": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
-      "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
-      "dev": true
+      "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
     },
     "queue-microtask": {
       "version": "1.2.3",
         "through2": "^2.0.0"
       }
     },
+    "raf": {
+      "version": "3.4.1",
+      "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
+      "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
+      "requires": {
+        "performance-now": "^2.1.0"
+      },
+      "dependencies": {
+        "performance-now": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+          "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+        }
+      }
+    },
     "ramda": {
       "version": "0.26.1",
       "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz",
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
       "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
-      "dev": true,
       "requires": {
         "safe-buffer": "^5.1.0"
       }
       }
     },
     "raw-loader": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.1.tgz",
-      "integrity": "sha512-baolhQBSi3iNh1cglJjA0mYzga+wePk7vdEX//1dTFd+v4TsQlQE0jitJSNF1OIP82rdYulH7otaVmdlDaJ64A==",
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
+      "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
       "dev": true,
       "requires": {
         "loader-utils": "^2.0.0",
-        "schema-utils": "^2.6.5"
+        "schema-utils": "^3.0.0"
+      },
+      "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        }
+      }
+    },
+    "react": {
+      "version": "15.7.0",
+      "resolved": "https://registry.npmjs.org/react/-/react-15.7.0.tgz",
+      "integrity": "sha512-5/MMRYmpmM0sMTHGLossnJCrmXQIiJilD6y3YN3TzAwGFj6zdnMtFv6xmi65PHKRV+pehIHpT7oy67Sr6s9AHA==",
+      "requires": {
+        "create-react-class": "^15.6.0",
+        "fbjs": "^0.8.9",
+        "loose-envify": "^1.1.0",
+        "object-assign": "^4.1.0",
+        "prop-types": "^15.5.10"
+      }
+    },
+    "react-copy-to-clipboard": {
+      "version": "5.0.3",
+      "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.3.tgz",
+      "integrity": "sha512-9S3j+m+UxDZOM0Qb8mhnT/rMR0NGSrj9A/073yz2DSxPMYhmYFBMYIdI2X4o8AjOjyFsSNxDRnCX6s/gRxpriw==",
+      "requires": {
+        "copy-to-clipboard": "^3",
+        "prop-types": "^15.5.8"
+      }
+    },
+    "react-debounce-input": {
+      "version": "3.2.5",
+      "resolved": "https://registry.npmjs.org/react-debounce-input/-/react-debounce-input-3.2.5.tgz",
+      "integrity": "sha512-WDc9nvZ8E/cT4nW1RlD/r+Nsc5Z5+Jmj2v9HT9RzsPtxkwRTQUBCKJvdt1fCYy5ME/nQPoqVYmWUWSv7whGmig==",
+      "requires": {
+        "lodash.debounce": "^4",
+        "prop-types": "^15.7.2"
+      }
+    },
+    "react-dom": {
+      "version": "15.7.0",
+      "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.7.0.tgz",
+      "integrity": "sha512-mpjXqC2t1FuYsILOLCj0kg6pbg460byZkVA/80VtDmKU/pYmoTdHOtaMcTRIDiyXLz4sIur0cQ04nOC6iGndJg==",
+      "requires": {
+        "fbjs": "^0.8.9",
+        "loose-envify": "^1.1.0",
+        "object-assign": "^4.1.0",
+        "prop-types": "^15.5.10"
+      }
+    },
+    "react-immutable-proptypes": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/react-immutable-proptypes/-/react-immutable-proptypes-2.2.0.tgz",
+      "integrity": "sha512-Vf4gBsePlwdGvSZoLSBfd4HAP93HDauMY4fDjXhreg/vg6F3Fj/MXDNyTbltPC/xZKmZc+cjLu3598DdYK6sgQ==",
+      "requires": {
+        "invariant": "^2.2.2"
+      }
+    },
+    "react-immutable-pure-component": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/react-immutable-pure-component/-/react-immutable-pure-component-1.2.4.tgz",
+      "integrity": "sha512-zPXaFWxaF4+ztVMFNMlCFkrhjpb9MPcL3JnXUpb6wKGF1+vBoSgClFbpbOsZAji7gm+RHBE24H44Lday2xxPjw=="
+    },
+    "react-inspector": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/react-inspector/-/react-inspector-2.3.1.tgz",
+      "integrity": "sha512-tUUK7t3KWgZEIUktOYko5Ic/oYwvjEvQUFAGC1UeMeDaQ5za2yZFtItJa2RTwBJB//NxPr000WQK6sEbqC6y0Q==",
+      "requires": {
+        "babel-runtime": "^6.26.0",
+        "is-dom": "^1.0.9",
+        "prop-types": "^15.6.1"
       }
     },
     "react-is": {
       "version": "16.13.1",
       "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
-      "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
-      "dev": true
+      "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
+    },
+    "react-motion": {
+      "version": "0.5.2",
+      "resolved": "https://registry.npmjs.org/react-motion/-/react-motion-0.5.2.tgz",
+      "integrity": "sha512-9q3YAvHoUiWlP3cK0v+w1N5Z23HXMj4IF4YuvjvWegWqNPfLXsOBE/V7UvQGpXxHFKRQQcNcVQE31g9SB/6qgQ==",
+      "requires": {
+        "performance-now": "^0.2.0",
+        "prop-types": "^15.5.8",
+        "raf": "^3.1.0"
+      }
+    },
+    "react-redux": {
+      "version": "4.4.10",
+      "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-4.4.10.tgz",
+      "integrity": "sha512-tjL0Bmpkj75Td0k+lXlF8Fc8a9GuXFv/3ahUOCXExWs/jhsKiQeTffdH0j5byejCGCRL4tvGFYlrwBF1X/Aujg==",
+      "requires": {
+        "create-react-class": "^15.5.1",
+        "hoist-non-react-statics": "^3.3.0",
+        "invariant": "^2.0.0",
+        "lodash": "^4.17.11",
+        "loose-envify": "^1.4.0",
+        "prop-types": "^15.7.2"
+      }
+    },
+    "react-syntax-highlighter": {
+      "version": "15.4.4",
+      "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.4.4.tgz",
+      "integrity": "sha512-PsOFHNTzkb3OroXdoR897eKN5EZ6grht1iM+f1lJSq7/L0YVnkJaNVwC3wEUYPOAmeyl5xyer1DjL6MrumO6Zw==",
+      "requires": {
+        "@babel/runtime": "^7.3.1",
+        "highlight.js": "^10.4.1",
+        "lowlight": "^1.17.0",
+        "prismjs": "^1.22.0",
+        "refractor": "^3.2.0"
+      }
     },
     "read-cache": {
       "version": "1.0.0",
         }
       }
     },
-    "read-package-json": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz",
-      "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==",
+    "read-package-json-fast": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-1.2.2.tgz",
+      "integrity": "sha512-39DbPJjkltEzfXJXB6D8/Ir3GFOU2YbSKa2HaB/Y3nKrc/zY+0XrALpID6/13ezWyzqvOHrBbR4t4cjQuTdBVQ==",
       "dev": true,
       "requires": {
-        "glob": "^7.1.1",
         "json-parse-even-better-errors": "^2.3.0",
-        "normalize-package-data": "^2.0.0",
-        "npm-normalize-package-bin": "^1.0.0"
-      }
-    },
-    "read-package-tree": {
-      "version": "5.3.1",
-      "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz",
-      "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==",
-      "dev": true,
-      "requires": {
-        "read-package-json": "^2.0.0",
-        "readdir-scoped-modules": "^1.0.0",
-        "util-promisify": "^2.1.0"
+        "npm-normalize-package-bin": "^1.0.1"
       }
     },
     "read-pkg": {
         "type-fest": "^0.6.0"
       },
       "dependencies": {
-        "parse-json": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
-          "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
-          "dev": true,
-          "requires": {
-            "@babel/code-frame": "^7.0.0",
-            "error-ex": "^1.3.1",
-            "json-parse-even-better-errors": "^2.3.0",
-            "lines-and-columns": "^1.1.6"
-          }
-        },
         "type-fest": {
           "version": "0.6.0",
           "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
       }
     },
     "readable-stream": {
-      "version": "2.3.7",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
-      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
-      "dev": true,
-      "requires": {
-        "core-util-is": "~1.0.0",
-        "inherits": "~2.0.3",
-        "isarray": "~1.0.0",
-        "process-nextick-args": "~2.0.0",
-        "safe-buffer": "~5.1.1",
-        "string_decoder": "~1.1.1",
-        "util-deprecate": "~1.0.1"
-      }
-    },
-    "readdir-scoped-modules": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz",
-      "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==",
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+      "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
       "dev": true,
       "requires": {
-        "debuglog": "^1.0.1",
-        "dezalgo": "^1.0.0",
-        "graceful-fs": "^4.1.2",
-        "once": "^1.3.0"
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
       }
     },
     "readdirp": {
-      "version": "3.5.0",
-      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz",
-      "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==",
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+      "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
       "dev": true,
       "requires": {
         "picomatch": "^2.2.1"
         "strip-indent": "^3.0.0"
       }
     },
+    "redux": {
+      "version": "3.7.2",
+      "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz",
+      "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==",
+      "requires": {
+        "lodash": "^4.2.1",
+        "lodash-es": "^4.2.1",
+        "loose-envify": "^1.1.0",
+        "symbol-observable": "^1.0.3"
+      }
+    },
+    "redux-immutable": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/redux-immutable/-/redux-immutable-3.1.0.tgz",
+      "integrity": "sha1-yvvWhuBxEmERm5wolgk13EeknQo=",
+      "requires": {
+        "immutable": "^3.8.1"
+      }
+    },
     "reflect-metadata": {
       "version": "0.1.13",
       "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
       "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==",
       "dev": true
     },
+    "refractor": {
+      "version": "3.5.0",
+      "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.5.0.tgz",
+      "integrity": "sha512-QwPJd3ferTZ4cSPPjdP5bsYHMytwWYnAN5EEnLtGvkqp/FCCnGsBgxrm9EuIDnjUC3Uc/kETtvVi7fSIVC74Dg==",
+      "requires": {
+        "hastscript": "^6.0.0",
+        "parse-entities": "^2.0.0",
+        "prismjs": "~1.25.0"
+      }
+    },
     "regenerate": {
       "version": "1.4.2",
       "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
       "dev": true
     },
     "regenerate-unicode-properties": {
-      "version": "8.2.0",
-      "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz",
-      "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==",
+      "version": "9.0.0",
+      "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz",
+      "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==",
       "dev": true,
       "requires": {
-        "regenerate": "^1.4.0"
+        "regenerate": "^1.4.2"
       }
     },
     "regenerator-runtime": {
-      "version": "0.13.7",
-      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
-      "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
-      "dev": true
+      "version": "0.13.9",
+      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+      "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
     },
     "regenerator-transform": {
       "version": "0.14.5",
       }
     },
     "regexpu-core": {
-      "version": "4.7.1",
-      "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz",
-      "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==",
+      "version": "4.8.0",
+      "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz",
+      "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==",
       "dev": true,
       "requires": {
-        "regenerate": "^1.4.0",
-        "regenerate-unicode-properties": "^8.2.0",
-        "regjsgen": "^0.5.1",
-        "regjsparser": "^0.6.4",
-        "unicode-match-property-ecmascript": "^1.0.4",
-        "unicode-match-property-value-ecmascript": "^1.2.0"
+        "regenerate": "^1.4.2",
+        "regenerate-unicode-properties": "^9.0.0",
+        "regjsgen": "^0.5.2",
+        "regjsparser": "^0.7.0",
+        "unicode-match-property-ecmascript": "^2.0.0",
+        "unicode-match-property-value-ecmascript": "^2.0.0"
       }
     },
     "regjsgen": {
       "dev": true
     },
     "regjsparser": {
-      "version": "0.6.9",
-      "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz",
-      "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==",
+      "version": "0.7.0",
+      "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz",
+      "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==",
       "dev": true,
       "requires": {
         "jsesc": "~0.5.0"
         "mdast-util-to-markdown": "^0.6.0"
       }
     },
+    "remarkable": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/remarkable/-/remarkable-2.0.1.tgz",
+      "integrity": "sha512-YJyMcOH5lrR+kZdmB0aJJ4+93bEojRZ1HGDn9Eagu6ibg7aVZhc3OWbbShRid+Q5eAfsEqWxpe+g5W5nYNfNiA==",
+      "requires": {
+        "argparse": "^1.0.10",
+        "autolinker": "^3.11.0"
+      }
+    },
     "remove-trailing-separator": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
     "repeat-string": {
       "version": "1.6.1",
       "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
-      "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
-      "dev": true
+      "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
     },
     "replace-ext": {
       "version": "1.0.0",
         "uuid": "^3.3.2"
       },
       "dependencies": {
+        "performance-now": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+          "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+          "dev": true
+        },
         "qs": {
           "version": "6.5.2",
           "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
     "require-main-filename": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
-      "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
+      "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+      "dev": true
     },
     "requires-port": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
-      "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
-      "dev": true
+      "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
     },
-    "resize-observer-polyfill": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
-      "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
+    "reselect": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.1.tgz",
+      "integrity": "sha512-Jjt8Us6hAWJpjucyladHvUGR+q1mHHgWtGDXlhvvKyNyIeQ3bjuWLDX0bsTLhbm/gd4iXEACBlODUHBlLWiNnA=="
     },
     "resolve": {
       "version": "1.20.0",
       "dev": true,
       "requires": {
         "resolve-from": "^3.0.0"
+      },
+      "dependencies": {
+        "resolve-from": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+          "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+          "dev": true
+        }
       }
     },
     "resolve-dir": {
       }
     },
     "resolve-from": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
-      "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+      "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
       "dev": true
     },
     "resolve-url": {
       "dev": true
     },
     "resolve-url-loader": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.2.tgz",
-      "integrity": "sha512-QEb4A76c8Mi7I3xNKXlRKQSlLBwjUV/ULFMP+G7n3/7tJZ8MG5wsZ3ucxP1Jz8Vevn6fnJsxDx9cIls+utGzPQ==",
-      "dev": true,
-      "requires": {
-        "adjust-sourcemap-loader": "3.0.0",
-        "camelcase": "5.3.1",
-        "compose-function": "3.0.3",
-        "convert-source-map": "1.7.0",
-        "es6-iterator": "2.0.3",
-        "loader-utils": "1.2.3",
-        "postcss": "7.0.21",
-        "rework": "1.0.1",
-        "rework-visit": "1.0.0",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-4.0.0.tgz",
+      "integrity": "sha512-05VEMczVREcbtT7Bz+C+96eUO5HDNvdthIiMB34t7FcF8ehcu4wC0sSgPUubs3XW2Q3CNLJk/BJrCU9wVRymiA==",
+      "dev": true,
+      "requires": {
+        "adjust-sourcemap-loader": "^4.0.0",
+        "convert-source-map": "^1.7.0",
+        "loader-utils": "^2.0.0",
+        "postcss": "^7.0.35",
         "source-map": "0.6.1"
       },
       "dependencies": {
-        "emojis-list": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",
-          "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
           "dev": true
         },
-        "json5": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
-          "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
-          "dev": true,
-          "requires": {
-            "minimist": "^1.2.0"
-          }
-        },
-        "loader-utils": {
-          "version": "1.2.3",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz",
-          "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==",
-          "dev": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^2.0.0",
-            "json5": "^1.0.1"
-          }
-        },
         "postcss": {
-          "version": "7.0.21",
-          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz",
-          "integrity": "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ==",
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
           "dev": true,
           "requires": {
-            "chalk": "^2.4.2",
-            "source-map": "^0.6.1",
-            "supports-color": "^6.1.0"
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
           }
         },
         "source-map": {
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
           "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
           "dev": true
-        },
-        "supports-color": {
-          "version": "6.1.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
-          "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
-          "dev": true,
-          "requires": {
-            "has-flag": "^3.0.0"
-          }
         }
       }
     },
       "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
       "dev": true
     },
-    "rework": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/rework/-/rework-1.0.1.tgz",
-      "integrity": "sha1-MIBqhBNCtUUQqkEQhQzUhTQUSqc=",
-      "dev": true,
-      "requires": {
-        "convert-source-map": "^0.3.3",
-        "css": "^2.0.0"
-      },
-      "dependencies": {
-        "convert-source-map": {
-          "version": "0.3.5",
-          "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz",
-          "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=",
-          "dev": true
-        }
-      }
-    },
-    "rework-visit": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/rework-visit/-/rework-visit-1.0.0.tgz",
-      "integrity": "sha1-mUWygD8hni96ygCtuLyfZA+ELJo=",
-      "dev": true
-    },
-    "rgb-regex": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz",
-      "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=",
-      "dev": true
-    },
-    "rgba-regex": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz",
-      "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
-      "dev": true
-    },
     "rimraf": {
       "version": "3.0.2",
       "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
       },
       "dependencies": {
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
       }
     },
     "rollup": {
-      "version": "2.26.5",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.5.tgz",
-      "integrity": "sha512-rCyFG3ZtQdnn9YwfuAVH0l/Om34BdO5lwCA0W6Hq+bNB21dVEBbCRxhaHOmu1G7OBFDWytbzAC104u7rxHwGjA==",
+      "version": "2.38.4",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.38.4.tgz",
+      "integrity": "sha512-B0LcJhjiwKkTl79aGVF/u5KdzsH8IylVfV56Ut6c9ouWLJcUK17T83aZBetNYSnZtXf2OHD4+2PbmRW+Fp5ulg==",
       "dev": true,
       "requires": {
         "fsevents": "2.1.3"
     "safer-buffer": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
-      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
-      "dev": true
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
     },
     "sane": {
       "version": "4.1.0",
       }
     },
     "sass": {
-      "version": "1.26.10",
-      "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.10.tgz",
-      "integrity": "sha512-bzN0uvmzfsTvjz0qwccN1sPm2HxxpNI/Xa+7PlUEMS+nQvbyuEK7Y0qFqxlPHhiNHb1Ze8WQJtU31olMObkAMw==",
+      "version": "1.32.6",
+      "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.6.tgz",
+      "integrity": "sha512-1bcDHDcSqeFtMr0JXI3xc/CXX6c4p0wHHivJdru8W7waM7a1WjKMm4m/Z5sY7CbVw4Whi2Chpcw6DFfSWwGLzQ==",
       "dev": true,
       "requires": {
         "chokidar": ">=2.0.0 <4.0.0"
       }
     },
     "sass-loader": {
-      "version": "10.0.1",
-      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.0.1.tgz",
-      "integrity": "sha512-b2PSldKVTS3JcFPHSrEXh3BeAfR7XknGiGCAO5aHruR3Pf3kqLP3Gb2ypXLglRrAzgZkloNxLZ7GXEGDX0hBUQ==",
+      "version": "10.1.1",
+      "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.1.tgz",
+      "integrity": "sha512-W6gVDXAd5hR/WHsPicvZdjAWHBcEJ44UahgxcIE196fW2ong0ZHMPO1kZuI5q0VlvMQZh32gpv69PLWQm70qrw==",
       "dev": true,
       "requires": {
-        "klona": "^2.0.3",
+        "klona": "^2.0.4",
         "loader-utils": "^2.0.0",
         "neo-async": "^2.6.2",
-        "schema-utils": "^2.7.0",
+        "schema-utils": "^3.0.0",
         "semver": "^7.3.2"
       },
       "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        },
         "semver": {
           "version": "7.3.5",
           "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
       "dev": true
     },
     "saxes": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
-      "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
+      "version": "3.1.11",
+      "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz",
+      "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==",
       "dev": true,
       "requires": {
-        "xmlchars": "^2.2.0"
+        "xmlchars": "^2.1.1"
       }
     },
     "schema-utils": {
       }
     },
     "scope-analyzer": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/scope-analyzer/-/scope-analyzer-2.1.1.tgz",
-      "integrity": "sha512-azEAihtQ9mEyZGhfgTJy3IbOWEzeOrYbg7NcYEshPKnKd+LZmC3TNd5dmDxbLBsTG/JVWmCp+vDJ03vJjeXMHg==",
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/scope-analyzer/-/scope-analyzer-2.1.2.tgz",
+      "integrity": "sha512-5cfCmsTYV/wPaRIItNxatw02ua/MThdIUNnUOCYp+3LSEJvnG804ANw2VLaavNILIfWXF1D1G2KNANkBBvInwQ==",
       "dev": true,
       "requires": {
         "array-from": "^2.1.1",
-        "dash-ast": "^1.0.0",
+        "dash-ast": "^2.0.1",
         "es6-map": "^0.1.5",
         "es6-set": "^0.1.5",
         "es6-symbol": "^3.1.1",
         }
       }
     },
+    "serialize-error": {
+      "version": "8.1.0",
+      "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-8.1.0.tgz",
+      "integrity": "sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ==",
+      "requires": {
+        "type-fest": "^0.20.2"
+      }
+    },
     "serialize-javascript": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
-      "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz",
+      "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==",
       "dev": true,
       "requires": {
         "randombytes": "^2.1.0"
     "set-blocking": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
-      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
+      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+      "dev": true
     },
     "set-value": {
       "version": "2.0.1",
     "setimmediate": {
       "version": "1.0.5",
       "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
-      "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
-      "dev": true
+      "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
     },
     "setprototypeof": {
       "version": "1.1.1",
       "version": "2.4.11",
       "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
       "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
+      "requires": {
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "shallow-clone": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
+      "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
       "dev": true,
       "requires": {
-        "inherits": "^2.0.1",
-        "safe-buffer": "^5.0.1"
+        "kind-of": "^6.0.2"
       }
     },
     "shallow-copy": {
       "dev": true
     },
     "shell-quote": {
-      "version": "1.7.2",
-      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz",
-      "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
+      "version": "1.7.3",
+      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
+      "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
       "dev": true
     },
     "shellwords": {
       "dev": true,
       "optional": true
     },
-    "signal-exit": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
-      "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
-      "dev": true
-    },
-    "simple-swizzle": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
-      "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
-      "dev": true,
+    "side-channel": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+      "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
       "requires": {
-        "is-arrayish": "^0.3.1"
-      },
-      "dependencies": {
-        "is-arrayish": {
-          "version": "0.3.2",
-          "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
-          "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
-          "dev": true
-        }
+        "call-bind": "^1.0.0",
+        "get-intrinsic": "^1.0.2",
+        "object-inspect": "^1.9.0"
       }
     },
+    "signal-exit": {
+      "version": "3.0.5",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz",
+      "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==",
+      "dev": true
+    },
     "simplebar": {
-      "version": "5.3.3",
-      "resolved": "https://registry.npmjs.org/simplebar/-/simplebar-5.3.3.tgz",
-      "integrity": "sha512-OfuSX47Axq9aR6rp9WK3YefAg+1Qw3UKKxS46PdElPpd+FWXMj17/nispYxsHtU3F7mv+ilmqELWmRt7KUgHgg==",
+      "version": "5.3.6",
+      "resolved": "https://registry.npmjs.org/simplebar/-/simplebar-5.3.6.tgz",
+      "integrity": "sha512-FJUMbV+hNDd/m+1/fvD41TXKd5mSdlI5zgBygkaQIV3SffNbcLhSbJT6ufTs8ZNRLJ6i+qc/KCFMqWmvlGWMhA==",
       "requires": {
+        "@juggle/resize-observer": "^3.3.1",
         "can-use-dom": "^0.1.0",
         "core-js": "^3.0.1",
         "lodash.debounce": "^4.0.8",
         "lodash.memoize": "^4.1.2",
-        "lodash.throttle": "^4.1.1",
-        "resize-observer-polyfill": "^1.5.1"
+        "lodash.throttle": "^4.1.1"
       }
     },
     "simplebar-angular": {
       "dev": true
     },
     "smart-buffer": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz",
-      "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==",
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
+      "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
       "dev": true
     },
     "snapdragon": {
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
           "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
           "dev": true
+        },
+        "source-map-resolve": {
+          "version": "0.5.3",
+          "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
+          "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+          "dev": true,
+          "requires": {
+            "atob": "^2.1.2",
+            "decode-uri-component": "^0.2.0",
+            "resolve-url": "^0.2.1",
+            "source-map-url": "^0.4.0",
+            "urix": "^0.1.0"
+          }
         }
       }
     },
       }
     },
     "sockjs": {
-      "version": "0.3.20",
-      "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.20.tgz",
-      "integrity": "sha512-SpmVOVpdq0DJc0qArhF3E5xsxvaiqGNb73XfgBpK1y3UD5gs8DSo8aCTsuT5pX8rssdc2NDIzANwP9eCAiSdTA==",
+      "version": "0.3.21",
+      "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz",
+      "integrity": "sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw==",
       "dev": true,
       "requires": {
-        "faye-websocket": "^0.10.0",
+        "faye-websocket": "^0.11.3",
         "uuid": "^3.4.0",
-        "websocket-driver": "0.6.5"
+        "websocket-driver": "^0.7.4"
       }
     },
     "sockjs-client": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz",
-      "integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==",
+      "version": "1.5.2",
+      "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.5.2.tgz",
+      "integrity": "sha512-ZzRxPBISQE7RpzlH4tKJMQbHM9pabHluk0WBaxAQ+wm/UieeBVBou0p4wVnSQGN9QmpAZygQ0cDIypWuqOFmFQ==",
       "dev": true,
       "requires": {
-        "debug": "^3.2.5",
+        "debug": "^3.2.6",
         "eventsource": "^1.0.7",
-        "faye-websocket": "~0.11.1",
-        "inherits": "^2.0.3",
-        "json3": "^3.3.2",
-        "url-parse": "^1.4.3"
+        "faye-websocket": "^0.11.3",
+        "inherits": "^2.0.4",
+        "json3": "^3.3.3",
+        "url-parse": "^1.5.3"
       },
       "dependencies": {
         "debug": {
           "requires": {
             "ms": "^2.1.1"
           }
-        },
-        "faye-websocket": {
-          "version": "0.11.3",
-          "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz",
-          "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==",
-          "dev": true,
-          "requires": {
-            "websocket-driver": ">=0.5.1"
-          }
         }
       }
     },
     "socks": {
-      "version": "2.3.3",
-      "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz",
-      "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==",
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz",
+      "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==",
       "dev": true,
       "requires": {
-        "ip": "1.1.5",
+        "ip": "^1.1.5",
         "smart-buffer": "^4.1.0"
       }
     },
     "socks-proxy-agent": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz",
-      "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==",
-      "dev": true,
-      "requires": {
-        "agent-base": "~4.2.1",
-        "socks": "~2.3.2"
-      },
-      "dependencies": {
-        "agent-base": {
-          "version": "4.2.1",
-          "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
-          "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
-          "dev": true,
-          "requires": {
-            "es6-promisify": "^5.0.0"
-          }
-        }
-      }
-    },
-    "sort-keys": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
-      "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz",
+      "integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==",
       "dev": true,
       "requires": {
-        "is-plain-obj": "^1.0.0"
+        "agent-base": "^6.0.2",
+        "debug": "4",
+        "socks": "^2.3.3"
       }
     },
     "source-list-map": {
       "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
     },
     "source-map-loader": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-1.0.2.tgz",
-      "integrity": "sha512-oX8d6ndRjN+tVyjj6PlXSyFPhDdVAPsZA30nD3/II8g4uOv8fCz0DMn5sy8KtVbDfKQxOpGwGJnK3xIW3tauDw==",
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-1.1.3.tgz",
+      "integrity": "sha512-6YHeF+XzDOrT/ycFJNI53cgEsp/tHTMl37hi7uVyqFAlTXW109JazaQCkbc+jjoL2637qkH1amLi+JzrIpt5lA==",
       "dev": true,
       "requires": {
-        "data-urls": "^2.0.0",
+        "abab": "^2.0.5",
         "iconv-lite": "^0.6.2",
         "loader-utils": "^2.0.0",
-        "schema-utils": "^2.7.0",
-        "source-map": "^0.6.1"
+        "schema-utils": "^3.0.0",
+        "source-map": "^0.6.1",
+        "whatwg-mimetype": "^2.3.0"
       },
       "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
       }
     },
     "source-map-resolve": {
-      "version": "0.5.3",
-      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
-      "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+      "version": "0.6.0",
+      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz",
+      "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==",
       "dev": true,
       "requires": {
         "atob": "^2.1.2",
-        "decode-uri-component": "^0.2.0",
-        "resolve-url": "^0.2.1",
-        "source-map-url": "^0.4.0",
-        "urix": "^0.1.0"
+        "decode-uri-component": "^0.2.0"
       }
     },
     "source-map-support": {
       "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
       "dev": true
     },
+    "space-separated-tokens": {
+      "version": "1.1.5",
+      "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
+      "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA=="
+    },
     "spdx-correct": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
       }
     },
     "spdx-license-ids": {
-      "version": "3.0.7",
-      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz",
-      "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==",
+      "version": "3.0.10",
+      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz",
+      "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==",
       "dev": true
     },
     "spdy": {
         "obuf": "^1.1.2",
         "readable-stream": "^3.0.6",
         "wbuf": "^1.7.3"
-      },
-      "dependencies": {
-        "readable-stream": {
-          "version": "3.6.0",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
-          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
-          "dev": true,
-          "requires": {
-            "inherits": "^2.0.3",
-            "string_decoder": "^1.1.1",
-            "util-deprecate": "^1.0.1"
-          }
-        }
       }
     },
     "specificity": {
       "dev": true
     },
     "speed-measure-webpack-plugin": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.3.tgz",
-      "integrity": "sha512-2ljD4Ch/rz2zG3HsLsnPfp23osuPBS0qPuz9sGpkNXTN1Ic4M+W9xB8l8rS8ob2cO4b1L+WTJw/0AJwWYVgcxQ==",
+      "version": "1.4.2",
+      "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.4.2.tgz",
+      "integrity": "sha512-AtVzD0bnIy2/B0fWqJpJgmhcrfWFhBlduzSo0uwplr/QvB33ZNZj2NEth3NONgdnZJqicK0W0mSxnLSbsVCDbw==",
       "dev": true,
       "requires": {
-        "chalk": "^2.0.1"
+        "chalk": "^4.1.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
       }
     },
     "split": {
     "sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
-      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
-      "dev": true
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
     },
     "sshpk": {
       "version": "1.16.1",
       "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==",
       "dev": true
     },
+    "stack-trace": {
+      "version": "0.0.10",
+      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
+      "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=",
+      "dev": true
+    },
     "stack-utils": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz",
-      "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==",
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz",
+      "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==",
       "dev": true,
       "requires": {
         "escape-string-regexp": "^2.0.0"
             "which": "^2.0.1"
           }
         },
+        "debug": {
+          "version": "4.3.1",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+          "dev": true,
+          "requires": {
+            "ms": "2.1.2"
+          }
+        },
         "execa": {
           "version": "3.4.0",
           "resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz",
           }
         },
         "is-stream": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
-          "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+          "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
           "dev": true
         },
         "npm-run-path": {
           "requires": {
             "source-map": "^0.5.6"
           }
+        },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
         }
       }
     },
       "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
       "dev": true
     },
+    "stream": {
+      "version": "0.0.2",
+      "resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz",
+      "integrity": "sha1-f1Nj8Ff2WSxVlfALyAon9c7B8O8=",
+      "requires": {
+        "emitter-component": "^1.1.1"
+      }
+    },
     "stream-browserify": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz",
       "requires": {
         "inherits": "~2.0.1",
         "readable-stream": "^2.0.2"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "stream-combiner": {
         "readable-stream": "^2.3.6",
         "to-arraybuffer": "^1.0.0",
         "xtend": "^4.0.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "stream-shift": {
       "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
       "dev": true
     },
-    "strict-uri-encode": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
-      "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
-      "dev": true
-    },
     "string-length": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
       }
     },
     "string-width": {
-      "version": "4.2.2",
-      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
-      "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
       "requires": {
         "emoji-regex": "^8.0.0",
         "is-fullwidth-code-point": "^3.0.0",
-        "strip-ansi": "^6.0.0"
+        "strip-ansi": "^6.0.1"
       }
     },
     "string.prototype.padend": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz",
-      "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==",
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz",
+      "integrity": "sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg==",
       "dev": true,
       "requires": {
         "call-bind": "^1.0.2",
         "define-properties": "^1.1.3",
-        "es-abstract": "^1.18.0-next.2"
+        "es-abstract": "^1.19.1"
       }
     },
     "string.prototype.trimend": {
       }
     },
     "string_decoder": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
       "dev": true,
       "requires": {
-        "safe-buffer": "~5.1.0"
+        "safe-buffer": "~5.2.0"
+      },
+      "dependencies": {
+        "safe-buffer": {
+          "version": "5.2.1",
+          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+          "dev": true
+        }
       }
     },
     "stringify-entities": {
       }
     },
     "strip-ansi": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
-      "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
       "requires": {
-        "ansi-regex": "^5.0.0"
+        "ansi-regex": "^5.0.1"
       }
     },
     "strip-bom": {
       }
     },
     "style-loader": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz",
-      "integrity": "sha512-ByHSTQvHLkWE9Ir5+lGbVOXhxX10fbprhLvdg96wedFZb4NDekDPxVKv5Fwmio+QcMlkkNfuK+5W1peQ5CUhZg==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-2.0.0.tgz",
+      "integrity": "sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ==",
       "dev": true,
       "requires": {
         "loader-utils": "^2.0.0",
-        "schema-utils": "^2.6.6"
+        "schema-utils": "^3.0.0"
+      },
+      "dependencies": {
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        }
       }
     },
     "style-search": {
       "dev": true
     },
     "stylehacks": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz",
-      "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==",
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.0.1.tgz",
+      "integrity": "sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA==",
       "dev": true,
       "requires": {
-        "browserslist": "^4.0.0",
-        "postcss": "^7.0.0",
-        "postcss-selector-parser": "^3.0.0"
-      },
-      "dependencies": {
-        "postcss-selector-parser": {
-          "version": "3.1.2",
-          "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz",
-          "integrity": "sha512-h7fJ/5uWuRVyOtkO45pnt1Ih40CEleeyCHzipqAZO2e5H20g25Y48uYnFUiShvY4rZWNJ/Bib/KVPmanaCtOhA==",
-          "dev": true,
-          "requires": {
-            "dot-prop": "^5.2.0",
-            "indexes-of": "^1.0.1",
-            "uniq": "^1.0.1"
-          }
-        }
+        "browserslist": "^4.16.0",
+        "postcss-selector-parser": "^6.0.4"
       }
     },
     "stylelint": {
             "color-convert": "^2.0.1"
           }
         },
+        "autoprefixer": {
+          "version": "9.8.8",
+          "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.8.tgz",
+          "integrity": "sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==",
+          "dev": true,
+          "requires": {
+            "browserslist": "^4.12.0",
+            "caniuse-lite": "^1.0.30001109",
+            "normalize-range": "^0.1.2",
+            "num2fraction": "^1.2.2",
+            "picocolors": "^0.2.1",
+            "postcss": "^7.0.32",
+            "postcss-value-parser": "^4.1.0"
+          }
+        },
         "balanced-match": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz",
           "dev": true
         },
         "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",
-          "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==",
+          "version": "4.1.2",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
           "dev": true,
           "requires": {
             "ansi-styles": "^4.1.0",
           "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
           "dev": true
         },
-        "cosmiconfig": {
-          "version": "7.0.0",
-          "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz",
-          "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==",
-          "dev": true,
-          "requires": {
-            "@types/parse-json": "^4.0.0",
-            "import-fresh": "^3.2.1",
-            "parse-json": "^5.0.0",
-            "path-type": "^4.0.0",
-            "yaml": "^1.10.0"
-          }
-        },
         "global-modules": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
           "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
           "dev": true
         },
-        "import-fresh": {
-          "version": "3.3.0",
-          "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
-          "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
-          "dev": true,
-          "requires": {
-            "parent-module": "^1.0.0",
-            "resolve-from": "^4.0.0"
-          },
-          "dependencies": {
-            "resolve-from": {
-              "version": "4.0.0",
-              "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
-              "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
-              "dev": true
-            }
-          }
-        },
-        "parse-json": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
-          "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
-          "dev": true,
-          "requires": {
-            "@babel/code-frame": "^7.0.0",
-            "error-ex": "^1.3.1",
-            "json-parse-even-better-errors": "^2.3.0",
-            "lines-and-columns": "^1.1.6"
-          }
+        "ini": {
+          "version": "1.3.8",
+          "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+          "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+          "dev": true
+        },
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
         },
         "postcss": {
-          "version": "7.0.35",
-          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz",
-          "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==",
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
           "dev": true,
           "requires": {
-            "chalk": "^2.4.2",
-            "source-map": "^0.6.1",
-            "supports-color": "^6.1.0"
-          },
-          "dependencies": {
-            "ansi-styles": {
-              "version": "3.2.1",
-              "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
-              "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
-              "dev": true,
-              "requires": {
-                "color-convert": "^1.9.0"
-              }
-            },
-            "chalk": {
-              "version": "2.4.2",
-              "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
-              "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
-              "dev": true,
-              "requires": {
-                "ansi-styles": "^3.2.1",
-                "escape-string-regexp": "^1.0.5",
-                "supports-color": "^5.3.0"
-              },
-              "dependencies": {
-                "supports-color": {
-                  "version": "5.5.0",
-                  "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
-                  "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
-                  "dev": true,
-                  "requires": {
-                    "has-flag": "^3.0.0"
-                  }
-                }
-              }
-            },
-            "color-convert": {
-              "version": "1.9.3",
-              "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
-              "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
-              "dev": true,
-              "requires": {
-                "color-name": "1.1.3"
-              }
-            },
-            "color-name": {
-              "version": "1.1.3",
-              "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
-              "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
-              "dev": true
-            },
-            "has-flag": {
-              "version": "3.0.0",
-              "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
-              "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
-              "dev": true
-            },
-            "supports-color": {
-              "version": "6.1.0",
-              "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
-              "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
-              "dev": true,
-              "requires": {
-                "has-flag": "^3.0.0"
-              }
-            }
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
           }
         },
         "resolve-from": {
           "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
           "dev": true
         },
+        "autoprefixer": {
+          "version": "9.8.8",
+          "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.8.tgz",
+          "integrity": "sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==",
+          "dev": true,
+          "requires": {
+            "browserslist": "^4.12.0",
+            "caniuse-lite": "^1.0.30001109",
+            "normalize-range": "^0.1.2",
+            "num2fraction": "^1.2.2",
+            "picocolors": "^0.2.1",
+            "postcss": "^7.0.32",
+            "postcss-value-parser": "^4.1.0"
+          }
+        },
         "braces": {
           "version": "2.3.2",
           "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
             "quick-lru": "^1.0.0"
           }
         },
+        "cosmiconfig": {
+          "version": "5.2.1",
+          "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
+          "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
+          "dev": true,
+          "requires": {
+            "import-fresh": "^2.0.0",
+            "is-directory": "^0.3.1",
+            "js-yaml": "^3.13.1",
+            "parse-json": "^4.0.0"
+          }
+        },
         "dir-glob": {
           "version": "2.2.2",
           "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
           "dev": true
         },
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             }
           }
         },
+        "import-fresh": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
+          "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
+          "dev": true,
+          "requires": {
+            "caller-path": "^2.0.0",
+            "resolve-from": "^3.0.0"
+          },
+          "dependencies": {
+            "resolve-from": {
+              "version": "3.0.0",
+              "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+              "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+              "dev": true
+            }
+          }
+        },
         "indent-string": {
           "version": "3.2.0",
           "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
           "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
           "dev": true
         },
+        "ini": {
+          "version": "1.3.8",
+          "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+          "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+          "dev": true
+        },
         "is-fullwidth-code-point": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
             }
           }
         },
+        "is-plain-obj": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+          "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+          "dev": true
+        },
         "known-css-properties": {
           "version": "0.16.0",
           "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.16.0.tgz",
           "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
           "dev": true
         },
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
         "path-exists": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
             }
           }
         },
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
         "postcss-selector-parser": {
           "version": "3.1.2",
           "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.2.tgz",
             "is-fullwidth-code-point": "^2.0.0"
           }
         },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
         "strip-ansi": {
           "version": "5.2.0",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
         "lodash": "^4.17.15",
         "postcss": "^7.0.31",
         "postcss-sorting": "^5.0.1"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "stylelint-scss": {
-      "version": "3.19.0",
-      "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.19.0.tgz",
-      "integrity": "sha512-Ic5bsmpS4wVucOw44doC1Yi9f5qbeVL4wPFiEOaUElgsOuLEN6Ofn/krKI8BeNL2gAn53Zu+IcVV4E345r6rBw==",
+      "version": "3.21.0",
+      "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.21.0.tgz",
+      "integrity": "sha512-CMI2wSHL+XVlNExpauy/+DbUcB/oUZLARDtMIXkpV/5yd8nthzylYd1cdHeDMJVBXeYHldsnebUX6MoV5zPW4A==",
       "dev": true,
       "requires": {
         "lodash": "^4.17.15",
           }
         },
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "path-is-absolute": "^1.0.0"
           }
         },
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
-        },
         "ms": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
       }
     },
     "stylus-loader": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/stylus-loader/-/stylus-loader-3.0.2.tgz",
-      "integrity": "sha512-+VomPdZ6a0razP+zinir61yZgpw2NfljeSsdUF5kJuEzlo3khXhY19Fn6l8QQz1GRJGtMCo8nG5C04ePyV7SUA==",
+      "version": "4.3.3",
+      "resolved": "https://registry.npmjs.org/stylus-loader/-/stylus-loader-4.3.3.tgz",
+      "integrity": "sha512-PpWB5PnCXUzW4WMYhCvNzAHJBjIBPMXwsdfkkKuA9W7k8OQFMl/19/AQvaWsxz2IptxUlCseyJ6TY/eEKJ4+UQ==",
       "dev": true,
       "requires": {
-        "loader-utils": "^1.0.2",
-        "lodash.clonedeep": "^4.5.0",
-        "when": "~3.6.x"
+        "fast-glob": "^3.2.4",
+        "klona": "^2.0.4",
+        "loader-utils": "^2.0.0",
+        "normalize-path": "^3.0.0",
+        "schema-utils": "^3.0.0"
       },
       "dependencies": {
-        "json5": {
-          "version": "1.0.1",
-          "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
-          "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
-          "dev": true,
-          "requires": {
-            "minimist": "^1.2.0"
-          }
-        },
-        "loader-utils": {
-          "version": "1.4.0",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
-          "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
           "dev": true,
           "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^1.0.1"
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
           }
         }
       }
       "dev": true,
       "requires": {
         "postcss": "^7.0.2"
+      },
+      "dependencies": {
+        "picocolors": {
+          "version": "0.2.1",
+          "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
+          "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
+          "dev": true
+        },
+        "postcss": {
+          "version": "7.0.39",
+          "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
+          "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
+          "dev": true,
+          "requires": {
+            "picocolors": "^0.2.1",
+            "source-map": "^0.6.1"
+          }
+        },
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        }
       }
     },
     "supports-color": {
       }
     },
     "svgo": {
-      "version": "1.3.2",
-      "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
-      "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==",
-      "dev": true,
+      "version": "2.7.0",
+      "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.7.0.tgz",
+      "integrity": "sha512-aDLsGkre4fTDCWvolyW+fs8ZJFABpzLXbtdK1y71CKnHzAnpDxKXPj2mNKj+pyOXUCzFHzuxRJ94XOFygOWV3w==",
+      "dev": true,
+      "requires": {
+        "@trysound/sax": "0.2.0",
+        "commander": "^7.2.0",
+        "css-select": "^4.1.3",
+        "css-tree": "^1.1.3",
+        "csso": "^4.2.0",
+        "nanocolors": "^0.1.12",
+        "stable": "^0.1.8"
+      }
+    },
+    "swagger-client": {
+      "version": "3.17.0",
+      "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.17.0.tgz",
+      "integrity": "sha512-d8DOEME49wTXm+uT+lBAjJ5D6IDjEHdbkqa7MbcslR2c+oHIhi13ObwleVWGfr89MPkWgBl6RBq9VUHmrBJRbg==",
+      "requires": {
+        "@babel/runtime-corejs3": "^7.11.2",
+        "btoa": "^1.2.1",
+        "cookie": "~0.4.1",
+        "cross-fetch": "^3.1.4",
+        "deep-extend": "~0.6.0",
+        "fast-json-patch": "^3.0.0-1",
+        "form-data-encoder": "^1.4.3",
+        "formdata-node": "^4.0.0",
+        "js-yaml": "^4.1.0",
+        "lodash": "^4.17.21",
+        "qs": "^6.9.4",
+        "traverse": "~0.6.6",
+        "url": "~0.11.0"
+      },
+      "dependencies": {
+        "argparse": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+          "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+        },
+        "js-yaml": {
+          "version": "4.1.0",
+          "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+          "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+          "requires": {
+            "argparse": "^2.0.1"
+          }
+        }
+      }
+    },
+    "swagger-ui": {
+      "version": "3.49.0",
+      "resolved": "https://registry.npmjs.org/swagger-ui/-/swagger-ui-3.49.0.tgz",
+      "integrity": "sha512-O/3Ac/CVMoTRuCCz724hI+l+f6dN3Oj65iZGWubkBR+SNnTqfPeqwpURTWLkldGJa/JiMNHBYdKBxzWmClfcMw==",
       "requires": {
-        "chalk": "^2.4.1",
-        "coa": "^2.0.2",
-        "css-select": "^2.0.0",
-        "css-select-base-adapter": "^0.1.1",
-        "css-tree": "1.0.0-alpha.37",
-        "csso": "^4.0.2",
+        "@babel/runtime-corejs3": "^7.14.0",
+        "@braintree/sanitize-url": "^5.0.1",
+        "@kyleshockey/object-assign-deep": "^0.4.2",
+        "@kyleshockey/xml": "^1.0.2",
+        "base64-js": "^1.5.1",
+        "classnames": "^2.3.1",
+        "css.escape": "1.5.1",
+        "deep-extend": "0.6.0",
+        "dompurify": "^2.2.8",
+        "ieee754": "^1.2.1",
+        "immutable": "^3.x.x",
+        "js-file-download": "^0.4.12",
         "js-yaml": "^3.13.1",
-        "mkdirp": "~0.5.1",
-        "object.values": "^1.1.0",
-        "sax": "~1.2.4",
-        "stable": "^0.1.8",
-        "unquote": "~1.1.1",
-        "util.promisify": "~1.0.0"
+        "lodash": "^4.17.21",
+        "memoizee": "^0.4.15",
+        "prop-types": "^15.7.2",
+        "randombytes": "^2.1.0",
+        "react": "=15.7.0",
+        "react-copy-to-clipboard": "5.0.3",
+        "react-debounce-input": "^3.2.3",
+        "react-dom": "=15.7.0",
+        "react-immutable-proptypes": "2.2.0",
+        "react-immutable-pure-component": "^1.1.1",
+        "react-inspector": "^2.3.0",
+        "react-motion": "^0.5.2",
+        "react-redux": "=4.4.10",
+        "react-syntax-highlighter": "^15.4.3",
+        "redux": "=3.7.2",
+        "redux-immutable": "3.1.0",
+        "remarkable": "^2.0.1",
+        "reselect": "^4.0.0",
+        "serialize-error": "^8.1.0",
+        "sha.js": "^2.4.11",
+        "swagger-client": "^3.13.3",
+        "url-parse": "^1.5.1",
+        "xml-but-prettier": "^1.0.1",
+        "zenscroll": "^4.0.2"
       }
     },
-    "swagger-ui-dist": {
-      "version": "3.35.1",
-      "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.35.1.tgz",
-      "integrity": "sha512-ltrCX8+YWsqDBvCdLJwnO6VsgjV/uzLm+cTEUe0DZ1fAXIxUnNjvE/aAjXiRfNppUnCbUgZvJK1LYPAjF7W1XA=="
-    },
     "symbol-observable": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
-      "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==",
-      "dev": true
+      "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
     },
     "symbol-tree": {
       "version": "3.2.4",
       "dev": true
     },
     "table": {
-      "version": "6.7.0",
-      "resolved": "https://registry.npmjs.org/table/-/table-6.7.0.tgz",
-      "integrity": "sha512-SAM+5p6V99gYiiy2gT5ArdzgM1dLDed0nkrWmG6Fry/bUS/m9x83BwpJUOf1Qj/x2qJd+thL6IkIx7qPGRxqBw==",
+      "version": "6.7.2",
+      "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz",
+      "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==",
       "dev": true,
       "requires": {
         "ajv": "^8.0.1",
         "lodash.clonedeep": "^4.5.0",
         "lodash.truncate": "^4.4.2",
         "slice-ansi": "^4.0.0",
-        "string-width": "^4.2.0",
-        "strip-ansi": "^6.0.0"
+        "string-width": "^4.2.3",
+        "strip-ansi": "^6.0.1"
       },
       "dependencies": {
         "ajv": {
-          "version": "8.3.0",
-          "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.3.0.tgz",
-          "integrity": "sha512-RYE7B5An83d7eWnDR8kbdaIFqmKCNsP16ay1hDbJEU+sa0e3H9SebskCt0Uufem6cfAVu7Col6ubcn/W+Sm8/Q==",
+          "version": "8.6.3",
+          "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz",
+          "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==",
           "dev": true,
           "requires": {
             "fast-deep-equal": "^3.1.1",
       }
     },
     "tapable": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
-      "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==",
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+      "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
       "dev": true
     },
     "tar": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
-      "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
+      "version": "6.1.11",
+      "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
+      "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
       "dev": true,
       "requires": {
         "chownr": "^2.0.0",
         "minizlib": "^2.1.1",
         "mkdirp": "^1.0.3",
         "yallist": "^4.0.0"
-      },
-      "dependencies": {
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
-        }
       }
     },
     "terminal-link": {
       }
     },
     "terser": {
-      "version": "5.3.0",
-      "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.0.tgz",
-      "integrity": "sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg==",
+      "version": "5.5.1",
+      "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz",
+      "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==",
       "dev": true,
       "requires": {
         "commander": "^2.20.0",
-        "source-map": "~0.6.1",
-        "source-map-support": "~0.5.12"
+        "source-map": "~0.7.2",
+        "source-map-support": "~0.5.19"
       },
       "dependencies": {
+        "commander": {
+          "version": "2.20.3",
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+          "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+          "dev": true
+        },
         "source-map": {
-          "version": "0.6.1",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "version": "0.7.3",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+          "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
           "dev": true
         }
       }
     },
     "terser-webpack-plugin": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-4.1.0.tgz",
-      "integrity": "sha512-0ZWDPIP8BtEDZdChbufcXUigOYk6dOX/P/X0hWxqDDcVAQLb8Yy/0FAaemSfax3PAA67+DJR778oz8qVbmy4hA==",
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-4.2.3.tgz",
+      "integrity": "sha512-jTgXh40RnvOrLQNgIkwEKnQ8rmHjHK4u+6UBEi+W+FPmvb+uo+chJXntKe7/3lW5mNysgSWD60KyesnhW8D6MQ==",
       "dev": true,
       "requires": {
         "cacache": "^15.0.5",
         "find-cache-dir": "^3.3.1",
-        "jest-worker": "^26.3.0",
+        "jest-worker": "^26.5.0",
         "p-limit": "^3.0.2",
-        "schema-utils": "^2.6.6",
-        "serialize-javascript": "^4.0.0",
+        "schema-utils": "^3.0.0",
+        "serialize-javascript": "^5.0.1",
         "source-map": "^0.6.1",
-        "terser": "^5.0.0",
+        "terser": "^5.3.4",
         "webpack-sources": "^1.4.3"
       },
       "dependencies": {
             "yocto-queue": "^0.1.0"
           }
         },
+        "schema-utils": {
+          "version": "3.1.1",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",
+          "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==",
+          "dev": true,
+          "requires": {
+            "@types/json-schema": "^7.0.8",
+            "ajv": "^6.12.5",
+            "ajv-keywords": "^3.5.2"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
           "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
           "dev": true
+        },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
         }
       }
     },
       },
       "dependencies": {
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
         }
       }
     },
+    "text-table": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+      "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+      "dev": true
+    },
     "throat": {
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz",
       "requires": {
         "readable-stream": "~2.3.6",
         "xtend": "~4.0.1"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
       }
     },
     "thunky": {
         "setimmediate": "^1.0.4"
       }
     },
+    "timers-ext": {
+      "version": "0.1.7",
+      "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
+      "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
+      "requires": {
+        "es5-ext": "~0.10.46",
+        "next-tick": "1"
+      }
+    },
     "timsort": {
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
       }
     },
     "tmpl": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
-      "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=",
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
+      "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==",
       "dev": true
     },
     "to-arraybuffer": {
         "is-number": "^7.0.0"
       }
     },
+    "toggle-selection": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
+      "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI="
+    },
     "toidentifier": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
       "requires": {
         "psl": "^1.1.28",
         "punycode": "^2.1.1"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+          "dev": true
+        }
       }
     },
     "tr46": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz",
-      "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==",
-      "dev": true,
-      "requires": {
-        "punycode": "^2.1.1"
-      }
+      "version": "0.0.3",
+      "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+      "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
+      "dev": true
     },
     "transifex-i18ntool": {
       "version": "1.1.0",
     "traverse": {
       "version": "0.6.6",
       "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz",
-      "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=",
-      "dev": true
+      "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc="
     },
     "tree-kill": {
       "version": "1.2.2",
       "dev": true
     },
     "trim-newlines": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
-      "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz",
+      "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==",
       "dev": true
     },
     "trim-trailing-lines": {
         "yargs-parser": "20.x"
       },
       "dependencies": {
-        "mkdirp": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
-          "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
-          "dev": true
-        },
         "semver": {
           "version": "7.3.5",
           "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
           "requires": {
             "lru-cache": "^6.0.0"
           }
-        },
-        "yargs-parser": {
-          "version": "20.2.7",
-          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
-          "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
-          "dev": true
         }
       }
     },
           },
           "dependencies": {
             "is-glob": {
-              "version": "4.0.1",
-              "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
-              "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+              "version": "4.0.3",
+              "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+              "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
               "dev": true,
               "requires": {
                 "is-extglob": "^2.1.1"
         "tsutils": "^2.29.0"
       },
       "dependencies": {
+        "commander": {
+          "version": "2.20.3",
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+          "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+          "dev": true
+        },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
         "tslib": {
           "version": "1.14.1",
           "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
       "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
       "dev": true
     },
+    "tunnel": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
+      "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
+      "dev": true
+    },
     "tunnel-agent": {
       "version": "0.6.0",
       "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
     "type": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
-      "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==",
-      "dev": true
+      "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
     },
     "type-check": {
       "version": "0.3.2",
       "dev": true
     },
     "type-fest": {
-      "version": "0.21.3",
-      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
-      "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
-      "dev": true
+      "version": "0.20.2",
+      "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+      "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="
     },
     "type-is": {
       "version": "1.6.18",
       }
     },
     "typescript": {
-      "version": "3.9.6",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz",
-      "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==",
+      "version": "4.1.6",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz",
+      "integrity": "sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow==",
       "dev": true
     },
+    "ua-parser-js": {
+      "version": "0.7.31",
+      "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz",
+      "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ=="
+    },
     "uglify-js": {
-      "version": "3.13.6",
-      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.6.tgz",
-      "integrity": "sha512-rRprLwl8RVaS+Qvx3Wh5hPfPBn9++G6xkGlUupya0s5aDmNjI7z3lnRLB3u7sN4OmbB0pWgzhM9BEJyiWAwtAA==",
+      "version": "3.14.2",
+      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz",
+      "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==",
       "dev": true,
       "optional": true
     },
       }
     },
     "unicode-canonical-property-names-ecmascript": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
-      "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
+      "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==",
       "dev": true
     },
     "unicode-match-property-ecmascript": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz",
-      "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz",
+      "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==",
       "dev": true,
       "requires": {
-        "unicode-canonical-property-names-ecmascript": "^1.0.4",
-        "unicode-property-aliases-ecmascript": "^1.0.4"
+        "unicode-canonical-property-names-ecmascript": "^2.0.0",
+        "unicode-property-aliases-ecmascript": "^2.0.0"
       }
     },
     "unicode-match-property-value-ecmascript": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz",
-      "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz",
+      "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==",
       "dev": true
     },
     "unicode-properties": {
       }
     },
     "unicode-property-aliases-ecmascript": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz",
-      "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==",
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz",
+      "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==",
       "dev": true
     },
     "unicode-trie": {
       }
     },
     "unified": {
-      "version": "9.2.1",
-      "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.1.tgz",
-      "integrity": "sha512-juWjuI8Z4xFg8pJbnEZ41b5xjGUWGHqXALmBZ3FC3WX0PIx1CZBIIJ6mXbYMcf6Yw4Fi0rFUTA1cdz/BglbOhA==",
+      "version": "9.2.2",
+      "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz",
+      "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==",
       "dev": true,
       "requires": {
         "bail": "^1.0.0",
           "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
           "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==",
           "dev": true
-        },
-        "is-plain-obj": {
-          "version": "2.1.0",
-          "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
-          "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
-          "dev": true
         }
       }
     },
       "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
       "dev": true
     },
-    "unquote": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz",
-      "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=",
-      "dev": true
-    },
     "unset-value": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
       "dev": true,
       "requires": {
         "punycode": "^2.1.0"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+          "dev": true
+        }
       }
     },
     "urix": {
       "version": "0.11.0",
       "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
       "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
-      "dev": true,
       "requires": {
         "punycode": "1.3.2",
         "querystring": "0.2.0"
-      },
-      "dependencies": {
-        "punycode": {
-          "version": "1.3.2",
-          "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
-          "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
-          "dev": true
-        }
       }
     },
     "url-parse": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
-      "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
-      "dev": true,
+      "version": "1.5.3",
+      "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
+      "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
       "requires": {
         "querystringify": "^2.1.1",
         "requires-port": "^1.0.0"
       "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
       "dev": true
     },
-    "util-promisify": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz",
-      "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=",
-      "dev": true,
-      "requires": {
-        "object.getownpropertydescriptors": "^2.0.3"
-      }
-    },
-    "util.promisify": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz",
-      "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==",
-      "dev": true,
-      "requires": {
-        "define-properties": "^1.1.3",
-        "es-abstract": "^1.17.2",
-        "has-symbols": "^1.0.1",
-        "object.getownpropertydescriptors": "^2.1.0"
-      }
-    },
     "utils-merge": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
         "assert-plus": "^1.0.0",
         "core-util-is": "1.0.2",
         "extsprintf": "^1.2.0"
+      },
+      "dependencies": {
+        "core-util-is": {
+          "version": "1.0.2",
+          "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+          "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+          "dev": true
+        }
       }
     },
     "vfile": {
       }
     },
     "w3c-xmlserializer": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
-      "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz",
+      "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==",
       "dev": true,
       "requires": {
+        "domexception": "^1.0.1",
+        "webidl-conversions": "^4.0.2",
         "xml-name-validator": "^3.0.0"
+      },
+      "dependencies": {
+        "webidl-conversions": {
+          "version": "4.0.2",
+          "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
+          "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+          "dev": true
+        }
       }
     },
     "wait-on": {
       }
     },
     "walker": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz",
-      "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=",
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
+      "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==",
       "dev": true,
       "requires": {
-        "makeerror": "1.0.x"
+        "makeerror": "1.0.12"
       }
     },
     "watchpack": {
           }
         },
         "fsevents": {
-          "dev": true,
-          "optional": true,
           "version": "2.1.3"
         },
         "glob-parent": {
             "to-regex": "^3.0.2"
           }
         },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
         "readdirp": {
           "version": "2.2.1",
           "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
             "readable-stream": "^2.0.2"
           }
         },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        },
         "to-regex-range": {
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
         "defaults": "^1.0.3"
       }
     },
+    "web-streams-polyfill": {
+      "version": "4.0.0-beta.1",
+      "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz",
+      "integrity": "sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ=="
+    },
     "webidl-conversions": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
-      "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+      "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
       "dev": true
     },
     "webpack": {
-      "version": "4.44.1",
-      "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.1.tgz",
-      "integrity": "sha512-4UOGAohv/VGUNQJstzEywwNxqX417FnjZgZJpJQegddzPmTvph37eBIRbRTfdySXzVtJXLJfbMN3mMYhM6GdmQ==",
+      "version": "4.44.2",
+      "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz",
+      "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==",
       "dev": true,
       "requires": {
         "@webassemblyjs/ast": "1.9.0",
           "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
           "dev": true
         },
+        "commander": {
+          "version": "2.20.3",
+          "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+          "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+          "dev": true
+        },
+        "enhanced-resolve": {
+          "version": "4.5.0",
+          "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz",
+          "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==",
+          "dev": true,
+          "requires": {
+            "graceful-fs": "^4.1.2",
+            "memory-fs": "^0.5.0",
+            "tapable": "^1.0.0"
+          },
+          "dependencies": {
+            "memory-fs": {
+              "version": "0.5.0",
+              "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz",
+              "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==",
+              "dev": true,
+              "requires": {
+                "errno": "^0.1.3",
+                "readable-stream": "^2.0.1"
+              }
+            }
+          }
+        },
         "fill-range": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
             "pkg-dir": "^3.0.0"
           }
         },
+        "find-up": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+          "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+          "dev": true,
+          "requires": {
+            "locate-path": "^3.0.0"
+          }
+        },
         "glob": {
-          "version": "7.1.7",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
-          "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+          "version": "7.2.0",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+          "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
           "dev": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "json5": "^1.0.1"
           }
         },
+        "locate-path": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+          "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+          "dev": true,
+          "requires": {
+            "p-locate": "^3.0.0",
+            "path-exists": "^3.0.0"
+          }
+        },
         "lru-cache": {
           "version": "5.1.1",
           "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
             "yallist": "^3.0.2"
           }
         },
-        "memory-fs": {
-          "version": "0.4.1",
-          "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
-          "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
+        "make-dir": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+          "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
           "dev": true,
           "requires": {
-            "errno": "^0.1.3",
-            "readable-stream": "^2.0.1"
+            "pify": "^4.0.1",
+            "semver": "^5.6.0"
           }
         },
         "micromatch": {
             "to-regex": "^3.0.2"
           }
         },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        },
+        "p-locate": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+          "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+          "dev": true,
+          "requires": {
+            "p-limit": "^2.0.0"
+          }
+        },
+        "path-exists": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+          "dev": true
+        },
+        "pkg-dir": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
+          "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
+          "dev": true,
+          "requires": {
+            "find-up": "^3.0.0"
+          }
+        },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
         "rimraf": {
           "version": "2.7.1",
           "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
             "ajv-keywords": "^3.1.0"
           }
         },
+        "serialize-javascript": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
+          "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
+          "dev": true,
+          "requires": {
+            "randombytes": "^2.1.0"
+          }
+        },
         "source-map": {
           "version": "0.6.1",
           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
             "figgy-pudding": "^3.5.1"
           }
         },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        },
+        "tapable": {
+          "version": "1.1.3",
+          "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz",
+          "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==",
+          "dev": true
+        },
         "terser": {
           "version": "4.8.0",
           "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz",
             "repeat-string": "^1.6.1"
           }
         },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
+        },
+        "y18n": {
+          "version": "4.0.3",
+          "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+          "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+          "dev": true
+        },
         "yallist": {
           "version": "3.1.1",
           "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
         "webpack-log": "^2.0.0"
       },
       "dependencies": {
-        "memory-fs": {
-          "version": "0.4.1",
-          "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
-          "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=",
-          "dev": true,
-          "requires": {
-            "errno": "^0.1.3",
-            "readable-stream": "^2.0.1"
-          }
-        },
         "mime": {
           "version": "2.5.2",
           "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz",
           "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==",
           "dev": true
+        },
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
         }
       }
     },
     "webpack-dev-server": {
-      "version": "3.11.0",
-      "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz",
-      "integrity": "sha512-PUxZ+oSTxogFQgkTtFndEtJIPNmml7ExwufBZ9L2/Xyyd5PnOL5UreWe5ZT7IU25DSdykL9p1MLQzmLh2ljSeg==",
+      "version": "3.11.2",
+      "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz",
+      "integrity": "sha512-A80BkuHRQfCiNtGBS1EMf2ChTUs0x+B3wGDFmOeT4rmJOHhHTCH2naNxIHhmkr0/UillP4U3yeIyv1pNp+QDLQ==",
       "dev": true,
       "requires": {
         "ansi-html": "0.0.7",
         "p-retry": "^3.0.1",
         "portfinder": "^1.0.26",
         "schema-utils": "^1.0.0",
-        "selfsigned": "^1.10.7",
+        "selfsigned": "^1.10.8",
         "semver": "^6.3.0",
         "serve-index": "^1.9.1",
-        "sockjs": "0.3.20",
-        "sockjs-client": "1.4.0",
+        "sockjs": "^0.3.21",
+        "sockjs-client": "^1.5.0",
         "spdy": "^4.0.2",
         "strip-ansi": "^3.0.1",
         "supports-color": "^6.1.0",
             }
           }
         },
+        "camelcase": {
+          "version": "5.3.1",
+          "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+          "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+          "dev": true
+        },
         "chokidar": {
           "version": "2.1.8",
           "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
           }
         },
         "fsevents": {
-          "dev": true,
-          "optional": true,
           "version": "2.1.3"
         },
         "glob-parent": {
             }
           }
         },
-        "is-absolute-url": {
-          "version": "3.0.3",
-          "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz",
-          "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==",
-          "dev": true
-        },
         "is-binary-path": {
           "version": "1.0.1",
           "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
           "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
           "dev": true
         },
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "dev": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
         "readdirp": {
           "version": "2.2.1",
           "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
             }
           }
         },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "dev": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        },
         "strip-ansi": {
           "version": "3.0.1",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
             }
           }
         },
+        "y18n": {
+          "version": "4.0.3",
+          "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+          "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+          "dev": true
+        },
         "yargs": {
           "version": "13.3.2",
           "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
       "requires": {
         "ansi-colors": "^3.0.0",
         "uuid": "^3.3.2"
+      },
+      "dependencies": {
+        "ansi-colors": {
+          "version": "3.2.4",
+          "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
+          "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
+          "dev": true
+        }
       }
     },
     "webpack-merge": {
-      "version": "4.2.2",
-      "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz",
-      "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==",
+      "version": "5.7.3",
+      "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz",
+      "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==",
       "dev": true,
       "requires": {
-        "lodash": "^4.17.15"
+        "clone-deep": "^4.0.1",
+        "wildcard": "^2.0.0"
       }
     },
     "webpack-sources": {
-      "version": "1.4.3",
-      "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
-      "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz",
+      "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==",
       "dev": true,
       "requires": {
-        "source-list-map": "^2.0.0",
-        "source-map": "~0.6.1"
+        "source-list-map": "^2.0.1",
+        "source-map": "^0.6.1"
       },
       "dependencies": {
         "source-map": {
       }
     },
     "webpack-subresource-integrity": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-1.4.1.tgz",
-      "integrity": "sha512-XMLFInbGbB1HV7K4vHWANzc1CN0t/c4bBvnlvGxGwV45yE/S/feAXIm8dJsCkzqWtSKnmaEgTp/meyeThxG4Iw==",
+      "version": "1.5.2",
+      "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-1.5.2.tgz",
+      "integrity": "sha512-GBWYBoyalbo5YClwWop9qe6Zclp8CIXYGIz12OPclJhIrSplDxs1Ls1JDMH8xBPPrg1T6ISaTW9Y6zOrwEiAzw==",
       "dev": true,
       "requires": {
         "webpack-sources": "^1.3.0"
+      },
+      "dependencies": {
+        "source-map": {
+          "version": "0.6.1",
+          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+          "dev": true
+        },
+        "webpack-sources": {
+          "version": "1.4.3",
+          "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
+          "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
+          "dev": true,
+          "requires": {
+            "source-list-map": "^2.0.0",
+            "source-map": "~0.6.1"
+          }
+        }
       }
     },
     "websocket-driver": {
-      "version": "0.6.5",
-      "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz",
-      "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=",
+      "version": "0.7.4",
+      "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
+      "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
       "dev": true,
       "requires": {
+        "http-parser-js": ">=0.5.1",
+        "safe-buffer": ">=5.1.0",
         "websocket-extensions": ">=0.1.1"
       }
     },
         }
       }
     },
+    "whatwg-fetch": {
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz",
+      "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA=="
+    },
     "whatwg-mimetype": {
       "version": "2.3.0",
       "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
       "dev": true
     },
     "whatwg-url": {
-      "version": "8.5.0",
-      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.5.0.tgz",
-      "integrity": "sha512-fy+R77xWv0AiqfLl4nuGUlQ3/6b5uNfQ4WAbGQVMYshCTCCPK9psC1nWh3XHuxGVCtlcDDQPQW1csmmIQo+fwg==",
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+      "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
       "dev": true,
       "requires": {
-        "lodash": "^4.7.0",
-        "tr46": "^2.0.2",
-        "webidl-conversions": "^6.1.0"
+        "tr46": "~0.0.3",
+        "webidl-conversions": "^3.0.0"
       }
     },
-    "when": {
-      "version": "3.6.4",
-      "resolved": "https://registry.npmjs.org/when/-/when-3.6.4.tgz",
-      "integrity": "sha1-RztRfsFZ4rhQBUl6E5g/CVQS404=",
-      "dev": true
-    },
     "which": {
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
     "which-module": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
-      "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
+      "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+      "dev": true
+    },
+    "wide-align": {
+      "version": "1.1.5",
+      "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
+      "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
+      "dev": true,
+      "requires": {
+        "string-width": "^1.0.2 || 2 || 3 || 4"
+      }
+    },
+    "wildcard": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz",
+      "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==",
+      "dev": true
     },
     "windows-release": {
       "version": "3.3.3",
       }
     },
     "wrap-ansi": {
-      "version": "6.2.0",
-      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
-      "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+      "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
       "requires": {
         "ansi-styles": "^4.0.0",
         "string-width": "^4.1.0",
       "dev": true,
       "requires": {
         "mkdirp": "^0.5.1"
+      },
+      "dependencies": {
+        "mkdirp": {
+          "version": "0.5.5",
+          "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+          "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+          "dev": true,
+          "requires": {
+            "minimist": "^1.2.5"
+          }
+        }
       }
     },
     "write-file-atomic": {
       }
     },
     "ws": {
-      "version": "6.2.1",
-      "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
-      "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
+      "version": "6.2.2",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
+      "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
       "dev": true,
       "requires": {
         "async-limiter": "~1.0.0"
       "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=",
       "dev": true
     },
+    "xml-but-prettier": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/xml-but-prettier/-/xml-but-prettier-1.0.1.tgz",
+      "integrity": "sha1-9aMyZ+1CzNTjVcYlV6XjmwH7QPM=",
+      "requires": {
+        "repeat-string": "^1.5.2"
+      }
+    },
     "xml-js": {
       "version": "1.6.11",
       "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz",
     "xtend": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
-      "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
-      "dev": true
+      "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
     },
     "y18n": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
-      "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
+      "version": "5.0.8",
+      "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+      "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
     },
     "yallist": {
       "version": "4.0.0",
       "dev": true
     },
     "yargs": {
-      "version": "15.3.0",
-      "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.0.tgz",
-      "integrity": "sha512-g/QCnmjgOl1YJjGsnUg2SatC7NUYEiLXJqxNOQU9qSpjzGtGXda9b+OKccr1kLTy8BN9yqEyqfq5lxlwdc13TA==",
+      "version": "16.2.0",
+      "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
+      "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
       "requires": {
-        "cliui": "^6.0.0",
-        "decamelize": "^1.2.0",
-        "find-up": "^4.1.0",
-        "get-caller-file": "^2.0.1",
+        "cliui": "^7.0.2",
+        "escalade": "^3.1.1",
+        "get-caller-file": "^2.0.5",
         "require-directory": "^2.1.1",
-        "require-main-filename": "^2.0.0",
-        "set-blocking": "^2.0.0",
         "string-width": "^4.2.0",
-        "which-module": "^2.0.0",
-        "y18n": "^4.0.0",
-        "yargs-parser": "^18.1.0"
+        "y18n": "^5.0.5",
+        "yargs-parser": "^20.2.2"
       }
     },
     "yargs-parser": {
-      "version": "18.1.3",
-      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
-      "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
-      "requires": {
-        "camelcase": "^5.0.0",
-        "decamelize": "^1.2.0"
-      }
+      "version": "20.2.9",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
+      "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="
     },
     "yauzl": {
       "version": "2.10.0",
       "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
       "dev": true
     },
+    "zenscroll": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/zenscroll/-/zenscroll-4.0.2.tgz",
+      "integrity": "sha1-6NV3TRwHOKR7z6hynzcS4t7d6yU="
+    },
     "zone.js": {
       "version": "0.10.3",
       "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.10.3.tgz",
index 67832c4cdd9b42f2f56b87f766b0a7506c265e1b..a83f9e66bdb9e24974207f0327951ab04b12e32c 100644 (file)
@@ -13,7 +13,7 @@
     "postbuild:localize": "node cd --res",
     "env_build": "node cd --env",
     "i18n": "npm run i18n:extract && npm run i18n:push && npm run i18n:pull && npm run i18n:merge",
-    "i18n:extract": "ng xi18n --output-path src/locale --ivy --progress=false",
+    "i18n:extract": "ng extract-i18n --output-path src/locale --progress=false",
     "i18n:push": "npx i18ntool push -c i18n.config.json",
     "i18n:pull": "npx i18ntool pull -c i18n.config.json",
     "i18n:merge": "npx i18ntool merge -c i18n.config.json",
     "testURL": "http://localhost/"
   },
   "dependencies": {
-    "@angular/animations": "10.1.5",
-    "@angular/common": "10.1.5",
-    "@angular/compiler": "10.1.5",
-    "@angular/core": "10.1.5",
-    "@angular/forms": "10.1.5",
-    "@angular/localize": "10.1.5",
-    "@angular/platform-browser": "10.1.5",
-    "@angular/platform-browser-dynamic": "10.1.5",
-    "@angular/router": "10.1.5",
+    "@angular/animations": "11.2.14",
+    "@angular/common": "11.2.14",
+    "@angular/compiler": "11.2.14",
+    "@angular/core": "11.2.14",
+    "@angular/forms": "11.2.14",
+    "@angular/localize": "11.2.14",
+    "@angular/platform-browser": "11.2.14",
+    "@angular/platform-browser-dynamic": "11.2.14",
+    "@angular/router": "11.2.14",
     "@circlon/angular-tree-component": "10.0.0",
     "@ng-bootstrap/ng-bootstrap": "7.0.0",
     "@swimlane/ngx-datatable": "18.0.0",
     "ngx-toastr": "13.1.0",
     "rxjs": "6.6.3",
     "simplebar-angular": "2.3.0",
-    "swagger-ui-dist": "3.35.1",
+    "swagger-ui": "3.49.0",
     "tslib": "2.0.2",
     "zone.js": "0.10.3"
   },
   "devDependencies": {
-    "@angular-devkit/build-angular": "0.1002.3",
-    "@angular/cli": "10.1.6",
-    "@angular/compiler-cli": "10.1.5",
-    "@angular/language-service": "10.1.5",
+    "@angular-devkit/build-angular": "0.1102.14",
+    "@angular/cli": "11.2.14",
+    "@angular/compiler-cli": "11.2.14",
+    "@angular/language-service": "11.2.14",
+    "@applitools/eyes-cypress": "^3.22.0",
     "@compodoc/compodoc": "1.1.11",
+    "@types/brace-expansion": "^1.1.0",
     "@types/jest": "26.0.14",
     "@types/lodash": "4.14.161",
     "@types/node": "12.12.62",
     "@types/simplebar": "5.1.1",
+    "@types/swagger-ui": "3.52.0",
     "codelyzer": "6.0.1",
     "cypress": "5.3.0",
     "cypress-multi-reporters": "1.4.0",
     "html-linter": "1.1.1",
     "htmllint-cli": "0.0.7",
     "identity-obj-proxy": "3.0.0",
+    "isomorphic-form-data": "2.0.0",
     "jest": "26.5.2",
     "jest-canvas-mock": "2.3.0",
     "jest-preset-angular": "8.3.1",
     "transifex-i18ntool": "1.1.0",
     "ts-node": "9.0.0",
     "tslint": "6.1.3",
-    "typescript": "3.9.6"
+    "typescript": "4.1.6"
   },
   "resolutions": {
     "fsevents": "2.1.3"
index b1a9984dd548f651324d5b4e96e2433530a02fd6..afd0d0c01dc5fba269ce2058cb63998076d89e02 100644 (file)
@@ -6,6 +6,7 @@ import _ from 'lodash';
 import { CephfsListComponent } from './ceph/cephfs/cephfs-list/cephfs-list.component';
 import { ConfigurationFormComponent } from './ceph/cluster/configuration/configuration-form/configuration-form.component';
 import { ConfigurationComponent } from './ceph/cluster/configuration/configuration.component';
+import { CreateClusterComponent } from './ceph/cluster/create-cluster/create-cluster.component';
 import { CrushmapComponent } from './ceph/cluster/crushmap/crushmap.component';
 import { HostFormComponent } from './ceph/cluster/hosts/host-form/host-form.component';
 import { HostsComponent } from './ceph/cluster/hosts/hosts.component';
@@ -87,15 +88,28 @@ const routes: Routes = [
       { path: 'error', component: ErrorComponent },
 
       // Cluster
+      {
+        path: 'expand-cluster',
+        component: CreateClusterComponent,
+        canActivate: [ModuleStatusGuardService],
+        data: {
+          moduleStatusGuardConfig: {
+            apiPath: 'orchestrator',
+            redirectTo: 'dashboard',
+            backend: 'cephadm'
+          },
+          breadcrumbs: 'Expand Cluster'
+        }
+      },
       {
         path: 'hosts',
+        component: HostsComponent,
         data: { breadcrumbs: 'Cluster/Hosts' },
         children: [
-          { path: '', component: HostsComponent },
           {
-            path: URLVerbs.CREATE,
+            path: URLVerbs.ADD,
             component: HostFormComponent,
-            data: { breadcrumbs: ActionLabels.CREATE }
+            outlet: 'modal'
           }
         ]
       },
@@ -106,7 +120,8 @@ const routes: Routes = [
       },
       {
         path: 'services',
-        canActivateChild: [ModuleStatusGuardService],
+        component: ServicesComponent,
+        canActivate: [ModuleStatusGuardService],
         data: {
           moduleStatusGuardConfig: {
             apiPath: 'orchestrator',
@@ -118,11 +133,15 @@ const routes: Routes = [
           breadcrumbs: 'Cluster/Services'
         },
         children: [
-          { path: '', component: ServicesComponent },
           {
             path: URLVerbs.CREATE,
             component: ServiceFormComponent,
-            data: { breadcrumbs: ActionLabels.CREATE }
+            outlet: 'modal'
+          },
+          {
+            path: `${URLVerbs.EDIT}/:type/:name`,
+            component: ServiceFormComponent,
+            outlet: 'modal'
           }
         ]
       },
@@ -361,7 +380,8 @@ const routes: Routes = [
   imports: [
     RouterModule.forRoot(routes, {
       useHash: true,
-      preloadingStrategy: PreloadAllModules
+      preloadingStrategy: PreloadAllModules,
+      relativeLinkResolution: 'legacy'
     })
   ],
   exports: [RouterModule],
index f27ea2ce7c4b9381fb042c63f5a57491eef18db3..fbbd28b202b95447431f7c8f81ca7ae692c5a572 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, Input, OnInit } from '@angular/core';
-import { NgForm, Validators } from '@angular/forms';
+import { NgForm, ValidatorFn, Validators } from '@angular/forms';
 
 import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
 
@@ -19,7 +19,7 @@ export class IscsiSettingComponent implements OnInit {
   limits: object;
 
   ngOnInit() {
-    const validators = [];
+    const validators: ValidatorFn[] = [];
     if ('min' in this.limits) {
       validators.push(Validators.min(this.limits['min']));
     }
index 2fc58ac5719e4fd107d72cea40550342a5b1d82d..852866a86db2c4fa0961ae7321081e2cfc5fb6e4 100644 (file)
@@ -5,7 +5,7 @@
         [formGroup]="targetForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
 
       <div class="card-body">
                formArrayName="initiators">
             <div class="card mb-2"
                  *ngFor="let initiator of initiators.controls; let ii = index"
-                 [formGroupName]="ii">
+                 [formGroup]="initiator">
               <div class="card-header">
                 <ng-container i18n>Initiator</ng-container>: {{ initiator.getValue('client_iqn') }}
                 <button type="button"
                formArrayName="groups">
             <div class="card mb-2"
                  *ngFor="let group of groups.controls; let gi = index"
-                 [formGroupName]="gi">
+                 [formGroup]="group">
               <div class="card-header">
                 <ng-container i18n>Group</ng-container>: {{ group.getValue('group_id') }}
                 <button type="button"
index 6a12cb64f166b88a56d79d94e619b3f704f28843..75c004fabe9d306070b2645dcb048e82ad7a63b4 100644 (file)
@@ -5,7 +5,7 @@
         [formGroup]="rbdForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
       <div class="card-body">
 
index 875814d57bc68f8daffe0e926b75f7e8d68b5107..7287beefcf2bb8b90da7e9505ab35bb3b4f814ec 100644 (file)
        [innerHtml]="'Only available for RBD images with <strong>fast-diff</strong> enabled'"></div>
 </ng-template>
 
+<ng-template #provisionedNotAvailableTooltipTpl
+             let-row="row">
+  <span *ngIf="row.disk_usage === null; else provisioned"
+        [ngbTooltip]="usageNotAvailableTooltipTpl"
+        placement="top"
+        i18n>N/A</span>
+  <ng-template #provisioned
+               i18n>{{row.disk_usage | dimlessBinary}}</ng-template>
+</ng-template>
+
+<ng-template #totalProvisionedNotAvailableTooltipTpl
+             let-row="row">
+  <span *ngIf="row.total_disk_usage === null; else totalProvisioned"
+        [ngbTooltip]="usageNotAvailableTooltipTpl"
+        placement="top"
+        i18n>N/A</span>
+  <ng-template #totalProvisioned
+               i18n>{{row.total_disk_usage | dimlessBinary}}</ng-template>
+</ng-template>
+
 <ng-template #parentTpl
              let-value="value">
   <span *ngIf="value">{{ value.pool_name }}<span
index ed898a2fcf2f84a4fd6008b3d87721a942d9c6a0..89b70071814d864a2a8e38379becda8b8250f245 100644 (file)
@@ -94,6 +94,43 @@ describe('RbdListComponent', () => {
     });
   });
 
+  describe('handling of provisioned columns', () => {
+    const images = [
+      {
+        name: 'img1',
+        pool_name: 'rbd',
+        features: ['layering', 'exclusive-lock'],
+        disk_usage: null,
+        total_disk_usage: null
+      },
+      {
+        name: 'img2',
+        pool_name: 'rbd',
+        features: ['layering', 'exclusive-lock', 'object-map', 'fast-diff'],
+        disk_usage: 1024,
+        total_disk_usage: 1024
+      }
+    ];
+
+    beforeEach(() => {
+      component.images = images;
+      refresh({ executing_tasks: [], finished_tasks: [] });
+      spyOn(rbdService, 'list').and.callFake(() =>
+        of([{ pool_name: 'rbd', status: 1, value: images }])
+      );
+      fixture.detectChanges();
+    });
+
+    it('should display N/A for Provisioned & Total Provisioned columns if disk usage is null', () => {
+      const spans = fixture.debugElement.nativeElement.querySelectorAll(
+        '.datatable-body-cell-label span'
+      );
+      // check image with disk usage = null
+      expect(spans[6].textContent).toBe('N/A');
+      expect(spans[7].textContent).toBe('N/A');
+    });
+  });
+
   describe('handling of deletion', () => {
     beforeEach(() => {
       fixture.detectChanges();
index 8bc297da62fd09d9394a427ff3e3b248ce100c3d..0ffb25695c8d2e5e3e54c93e42778ac2cb7764a5 100644 (file)
@@ -56,6 +56,10 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
   deleteTpl: TemplateRef<any>;
   @ViewChild('removingStatTpl', { static: true })
   removingStatTpl: TemplateRef<any>;
+  @ViewChild('provisionedNotAvailableTooltipTpl', { static: true })
+  provisionedNotAvailableTooltipTpl: TemplateRef<any>;
+  @ViewChild('totalProvisionedNotAvailableTooltipTpl', { static: true })
+  totalProvisionedNotAvailableTooltipTpl: TemplateRef<any>;
 
   permission: Permission;
   tableActions: CdTableAction[];
@@ -230,14 +234,16 @@ export class RbdListComponent extends ListWithDetails implements OnInit {
         prop: 'disk_usage',
         cellClass: 'text-center',
         flexGrow: 1,
-        pipe: this.dimlessBinaryPipe
+        pipe: this.dimlessBinaryPipe,
+        cellTemplate: this.provisionedNotAvailableTooltipTpl
       },
       {
         name: $localize`Total provisioned`,
         prop: 'total_disk_usage',
         cellClass: 'text-center',
         flexGrow: 1,
-        pipe: this.dimlessBinaryPipe
+        pipe: this.dimlessBinaryPipe,
+        cellTemplate: this.totalProvisionedNotAvailableTooltipTpl
       },
       {
         name: $localize`Parent`,
index 3b15b0aae69ec519f93526fa9ae0b0ff212dea35..da8a2cd25b505993c264ae01d499d3941e8e6115 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create rbdSnapshot@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index cc58c38b8dc9c8cdaf6cf0081913a727465bed69..610bb79baebc781eea8a1f2e4f78a40b04ea007d 100644 (file)
@@ -5,6 +5,7 @@ import { RouterModule } from '@angular/router';
 
 import { TreeModule } from '@circlon/angular-tree-component';
 import {
+  NgbActiveModal,
   NgbDatepickerModule,
   NgbDropdownModule,
   NgbNavModule,
@@ -21,6 +22,8 @@ import { CephSharedModule } from '../shared/ceph-shared.module';
 import { ConfigurationDetailsComponent } from './configuration/configuration-details/configuration-details.component';
 import { ConfigurationFormComponent } from './configuration/configuration-form/configuration-form.component';
 import { ConfigurationComponent } from './configuration/configuration.component';
+import { CreateClusterReviewComponent } from './create-cluster/create-cluster-review.component';
+import { CreateClusterComponent } from './create-cluster/create-cluster.component';
 import { CrushmapComponent } from './crushmap/crushmap.component';
 import { HostDetailsComponent } from './hosts/host-details/host-details.component';
 import { HostFormComponent } from './hosts/host-form/host-form.component';
@@ -105,14 +108,16 @@ import { TelemetryComponent } from './telemetry/telemetry.component';
     OsdCreationPreviewModalComponent,
     RulesListComponent,
     ActiveAlertListComponent,
-    HostFormComponent,
     ServiceDetailsComponent,
     ServiceDaemonListComponent,
     TelemetryComponent,
     PrometheusTabsComponent,
     ServiceFormComponent,
     OsdFlagsIndivModalComponent,
-    PlacementPipe
-  ]
+    PlacementPipe,
+    CreateClusterComponent,
+    CreateClusterReviewComponent
+  ],
+  providers: [NgbActiveModal]
 })
 export class ClusterModule {}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.html
new file mode 100644 (file)
index 0000000..812598f
--- /dev/null
@@ -0,0 +1,50 @@
+<div class="row">
+  <div class="col-lg-4">
+    <fieldset>
+      <legend class="cd-header"
+              i18n>Cluster Resources</legend>
+      <table class="table table-striped">
+        <tr>
+          <td i18n
+              class="bold">Hosts</td>
+          <td>{{ hostsCount }}</td>
+        </tr>
+        <tr>
+          <td i18n
+              class="bold">Storage Capacity</td>
+          <td><span i18n>Number of devices: {{ totalDevices }}. Raw capacity:
+            {{ totalCapacity | dimlessBinary }}.</span></td>
+        </tr>
+        <tr>
+          <td i18n
+              class="bold">CPUs</td>
+          <td>{{ totalCPUs }}</td>
+        </tr>
+        <tr>
+          <td i18n
+              class="bold">Memory</td>
+          <td>{{ totalMemory }}</td>
+        </tr>
+      </table>
+    </fieldset>
+  </div>
+
+  <div class="col-lg-8">
+    <legend i18n
+            class="cd-header">Hosts by Services</legend>
+    <cd-table [data]="hostsByService['data']"
+              [columns]="hostsByService['columns']"
+              [toolHeader]="false">
+    </cd-table>
+  </div>
+</div>
+
+<legend i18n
+        class="cd-header">Host Details</legend>
+<cd-hosts [hiddenColumns]="['services', 'status']"
+          [hideToolHeader]="true"
+          [hideTitle]="true"
+          [hideSubmitBtn]="true"
+          [hasTableDetails]="false"
+          [showGeneralActionsOnly]="true">
+</cd-hosts>
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.scss b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.scss
new file mode 100644 (file)
index 0000000..beecca0
--- /dev/null
@@ -0,0 +1,5 @@
+cd-hosts {
+  ::ng-deep .nav {
+    display: none;
+  }
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.spec.ts
new file mode 100644 (file)
index 0000000..3d9652b
--- /dev/null
@@ -0,0 +1,55 @@
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import _ from 'lodash';
+import { ToastrModule } from 'ngx-toastr';
+import { of } from 'rxjs';
+
+import { CephModule } from '~/app/ceph/ceph.module';
+import { CoreModule } from '~/app/core/core.module';
+import { CephServiceService } from '~/app/shared/api/ceph-service.service';
+import { SharedModule } from '~/app/shared/shared.module';
+import { configureTestBed } from '~/testing/unit-test-helper';
+import { CreateClusterReviewComponent } from './create-cluster-review.component';
+
+describe('CreateClusterReviewComponent', () => {
+  let component: CreateClusterReviewComponent;
+  let fixture: ComponentFixture<CreateClusterReviewComponent>;
+  let cephServiceService: CephServiceService;
+  let serviceListSpy: jasmine.Spy;
+
+  configureTestBed({
+    imports: [HttpClientTestingModule, SharedModule, ToastrModule.forRoot(), CephModule, CoreModule]
+  });
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(CreateClusterReviewComponent);
+    component = fixture.componentInstance;
+    cephServiceService = TestBed.inject(CephServiceService);
+    serviceListSpy = spyOn(cephServiceService, 'list');
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+
+  it('should verify host metadata calculations', () => {
+    const hostnames = ['ceph.test1', 'ceph.test2'];
+    const payload = [
+      {
+        hostname: hostnames[0],
+        service_type: ['mgr', 'mon']
+      },
+      {
+        hostname: hostnames[1],
+        service_type: ['mgr', 'alertmanager']
+      }
+    ];
+    serviceListSpy.and.callFake(() => of(payload));
+    fixture.detectChanges();
+    expect(serviceListSpy).toHaveBeenCalled();
+
+    expect(component.serviceCount).toBe(2);
+    expect(component.uniqueServices.size).toBe(2);
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster-review.component.ts
new file mode 100644 (file)
index 0000000..8960f39
--- /dev/null
@@ -0,0 +1,117 @@
+import { Component, OnInit } from '@angular/core';
+
+import _ from 'lodash';
+
+import { CephServiceService } from '~/app/shared/api/ceph-service.service';
+import { HostService } from '~/app/shared/api/host.service';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
+import { CephServiceSpec } from '~/app/shared/models/service.interface';
+import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
+
+@Component({
+  selector: 'cd-create-cluster-review',
+  templateUrl: './create-cluster-review.component.html',
+  styleUrls: ['./create-cluster-review.component.scss']
+})
+export class CreateClusterReviewComponent implements OnInit {
+  hosts: object[] = [];
+  hostsByService: object;
+  hostsCount: number;
+  serviceCount: number;
+  serviceOccurrences = {};
+  hostsCountPerService: object[] = [];
+  uniqueServices: Set<string> = new Set();
+  totalDevices: number;
+  totalCapacity = 0;
+  services: Array<CephServiceSpec> = [];
+  totalCPUs = 0;
+  totalMemory = 0;
+
+  constructor(
+    public wizardStepsService: WizardStepsService,
+    public cephServiceService: CephServiceService,
+    private dimlessBinary: DimlessBinaryPipe,
+    public hostService: HostService,
+    private osdService: OsdService
+  ) {}
+
+  ngOnInit() {
+    let dataDevices = 0;
+    let dataDeviceCapacity = 0;
+    let walDevices = 0;
+    let walDeviceCapacity = 0;
+    let dbDevices = 0;
+    let dbDeviceCapacity = 0;
+
+    this.hostsByService = {
+      columns: [
+        {
+          prop: 'service_type',
+          name: $localize`Services`,
+          flexGrow: 1,
+          cellTransformation: CellTemplate.badge,
+          customTemplateConfig: {
+            class: 'badge-dark'
+          }
+        },
+        {
+          name: $localize`Number of Hosts`,
+          prop: 'hosts_per_service',
+          flexGrow: 1
+        }
+      ]
+    };
+
+    this.cephServiceService.list().subscribe((resp: Array<CephServiceSpec>) => {
+      this.services = resp;
+      this.serviceCount = this.services.length;
+
+      _.forEach(this.services, (serviceKey) => {
+        this.serviceOccurrences[serviceKey['service_type']] =
+          (this.serviceOccurrences[serviceKey['service_type']] || 0) + 1;
+        this.uniqueServices.add(serviceKey['service_type']);
+      });
+
+      this.uniqueServices.forEach((serviceType) => {
+        this.hostsCountPerService.push({
+          service_type: serviceType,
+          hosts_per_service: this.serviceOccurrences[serviceType]
+        });
+      });
+
+      this.hostsByService['data'] = [...this.hostsCountPerService];
+    });
+
+    this.hostService.list('true').subscribe((resp: object[]) => {
+      this.hosts = resp;
+      this.hostsCount = this.hosts.length;
+      _.forEach(this.hosts, (hostKey) => {
+        this.totalCPUs = this.totalCPUs + hostKey['cpu_count'];
+        // convert to bytes
+        this.totalMemory = this.totalMemory + hostKey['memory_total_kb'] * 1024;
+      });
+      this.totalMemory = this.dimlessBinary.transform(this.totalMemory);
+    });
+
+    if (this.osdService.osdDevices['data']) {
+      dataDevices = this.osdService.osdDevices['data']?.length;
+      dataDeviceCapacity = this.osdService.osdDevices['data']['capacity'];
+    }
+
+    if (this.osdService.osdDevices['wal']) {
+      walDevices = this.osdService.osdDevices['wal']?.length;
+      walDeviceCapacity = this.osdService.osdDevices['wal']['capacity'];
+    }
+
+    if (this.osdService.osdDevices['db']) {
+      dbDevices = this.osdService.osdDevices['db']?.length;
+      dbDeviceCapacity = this.osdService.osdDevices['db']['capacity'];
+    }
+
+    this.totalDevices = dataDevices + walDevices + dbDevices;
+    this.osdService.osdDevices['totalDevices'] = this.totalDevices;
+    this.totalCapacity = dataDeviceCapacity + walDeviceCapacity + dbDeviceCapacity;
+  }
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.html
new file mode 100644 (file)
index 0000000..4a4bb10
--- /dev/null
@@ -0,0 +1,95 @@
+<div class="container h-75"
+     *ngIf="!startClusterCreation">
+  <div class="row h-100 justify-content-center align-items-center">
+    <div class="blank-page">
+      <!-- htmllint img-req-src="false" -->
+      <img [src]="projectConstants.cephLogo"
+           alt="Ceph"
+           class="img-fluid mx-auto d-block">
+      <h3 class="text-center m-2"
+          i18n>Welcome to {{ projectConstants.projectName }}</h3>
+
+      <div class="m-4">
+        <h4 class="text-center"
+            i18n>Please expand your cluster first</h4>
+        <div class="offset-md-2">
+          <button class="btn btn-accent m-2"
+                  name="expand-cluster"
+                  (click)="createCluster()"
+                  i18n>Expand Cluster</button>
+          <button class="btn btn-light"
+                  name="skip-cluster-creation"
+                  (click)="skipClusterCreation()"
+                  i18n>Skip</button>
+        </div>
+      </div>
+    </div>
+  </div>
+</div>
+
+<div class="card"
+     *ngIf="startClusterCreation">
+  <div class="card-header"
+       i18n>Expand Cluster</div>
+  <div class="container-fluid">
+    <cd-wizard [stepsTitle]="stepTitles"></cd-wizard>
+    <div class="card-body vertical-line">
+      <ng-container [ngSwitch]="currentStep?.stepIndex">
+        <div *ngSwitchCase="'1'"
+             class="ml-5">
+          <h4 class="title"
+              i18n>Add Hosts</h4>
+          <br>
+          <cd-hosts [hiddenColumns]="['services']"
+                    [hideTitle]="true"
+                    [hideSubmitBtn]="true"
+                    [hasTableDetails]="false"
+                    [showGeneralActionsOnly]="true"></cd-hosts>
+        </div>
+        <div *ngSwitchCase="'2'"
+             class="ml-5">
+          <h4 class="title"
+              i18n>Create OSDs</h4>
+          <br>
+          <div class="alignForm">
+            <cd-osd-form [hideTitle]="true"
+                         [hideSubmitBtn]="true"
+                         (emitDriveGroup)="getDriveGroup($event)"></cd-osd-form>
+          </div>
+        </div>
+        <div *ngSwitchCase="'3'"
+             class="ml-5">
+          <h4 class="title"
+              i18n>Create Services</h4>
+          <br>
+          <cd-services [hasDetails]="false"
+                       [hiddenServices]="['mon', 'mgr', 'crash', 'agent']"
+                       [hiddenColumns]="['status.running', 'status.size', 'status.last_refresh']"
+                       [routedModal]="false"></cd-services>
+        </div>
+        <div *ngSwitchCase="'4'"
+             class="ml-5">
+          <cd-create-cluster-review></cd-create-cluster-review>
+        </div>
+      </ng-container>
+    </div>
+  </div>
+  <div class="card-footer">
+    <button class="btn btn-accent m-2 float-right"
+            (click)="onNextStep()"
+            aria-label="Next"
+            i18n>{{ showSubmitButtonLabel() }}</button>
+    <cd-back-button class="m-2 float-right"
+                    aria-label="Close"
+                    (backAction)="onPreviousStep()"
+                    [name]="showCancelButtonLabel()"></cd-back-button>
+  </div>
+</div>
+
+<ng-template #skipConfirmTpl>
+  <span i18n>You are about to skip the cluster expansion process.
+             You’ll need to <strong>navigate through the menu to add hosts and services.</strong></span>
+
+  <div class="mt-4"
+       i18n>Are you sure you want to continue?</div>
+</ng-template>
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.scss b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.scss
new file mode 100644 (file)
index 0000000..a2e8889
--- /dev/null
@@ -0,0 +1,30 @@
+@use './src/styles/vendor/variables' as vv;
+
+.container-fluid {
+  align-items: flex-start;
+  display: flex;
+  padding-left: 0;
+  width: 100%;
+}
+
+.card-body {
+  max-width: 85%;
+}
+
+.vertical-line {
+  border-left: 1px solid vv.$gray-400;
+}
+
+cd-wizard {
+  width: 15%;
+}
+
+cd-hosts {
+  ::ng-deep .nav {
+    display: none;
+  }
+}
+
+.alignForm {
+  margin-left: -1%;
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.spec.ts
new file mode 100644 (file)
index 0000000..3e0b7f7
--- /dev/null
@@ -0,0 +1,153 @@
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { ToastrModule } from 'ngx-toastr';
+
+import { CephModule } from '~/app/ceph/ceph.module';
+import { CoreModule } from '~/app/core/core.module';
+import { HostService } from '~/app/shared/api/host.service';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { ConfirmationModalComponent } from '~/app/shared/components/confirmation-modal/confirmation-modal.component';
+import { LoadingPanelComponent } from '~/app/shared/components/loading-panel/loading-panel.component';
+import { AppConstants } from '~/app/shared/constants/app.constants';
+import { ModalService } from '~/app/shared/services/modal.service';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
+import { SharedModule } from '~/app/shared/shared.module';
+import { configureTestBed } from '~/testing/unit-test-helper';
+import { CreateClusterComponent } from './create-cluster.component';
+
+describe('CreateClusterComponent', () => {
+  let component: CreateClusterComponent;
+  let fixture: ComponentFixture<CreateClusterComponent>;
+  let wizardStepService: WizardStepsService;
+  let hostService: HostService;
+  let osdService: OsdService;
+  let modalServiceShowSpy: jasmine.Spy;
+  const projectConstants: typeof AppConstants = AppConstants;
+
+  configureTestBed(
+    {
+      imports: [
+        HttpClientTestingModule,
+        RouterTestingModule,
+        ToastrModule.forRoot(),
+        SharedModule,
+        CoreModule,
+        CephModule
+      ]
+    },
+    [LoadingPanelComponent]
+  );
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(CreateClusterComponent);
+    component = fixture.componentInstance;
+    wizardStepService = TestBed.inject(WizardStepsService);
+    hostService = TestBed.inject(HostService);
+    osdService = TestBed.inject(OsdService);
+    modalServiceShowSpy = spyOn(TestBed.inject(ModalService), 'show').and.returnValue({
+      // mock the close function, it might be called if there are async tests.
+      close: jest.fn()
+    });
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+
+  it('should have project name as heading in welcome screen', () => {
+    const heading = fixture.debugElement.query(By.css('h3')).nativeElement;
+    expect(heading.innerHTML).toBe(`Welcome to ${projectConstants.projectName}`);
+  });
+
+  it('should show confirmation modal when cluster creation is skipped', () => {
+    component.skipClusterCreation();
+    expect(modalServiceShowSpy.calls.any()).toBeTruthy();
+    expect(modalServiceShowSpy.calls.first().args[0]).toBe(ConfirmationModalComponent);
+  });
+
+  it('should show the wizard when cluster creation is started', () => {
+    component.createCluster();
+    fixture.detectChanges();
+    const nativeEl = fixture.debugElement.nativeElement;
+    expect(nativeEl.querySelector('cd-wizard')).not.toBe(null);
+  });
+
+  it('should have title Add Hosts', () => {
+    component.createCluster();
+    fixture.detectChanges();
+    const heading = fixture.debugElement.query(By.css('.title')).nativeElement;
+    expect(heading.innerHTML).toBe('Add Hosts');
+  });
+
+  it('should show the host list when cluster creation as first step', () => {
+    component.createCluster();
+    fixture.detectChanges();
+    const nativeEl = fixture.debugElement.nativeElement;
+    expect(nativeEl.querySelector('cd-hosts')).not.toBe(null);
+  });
+
+  it('should move to next step and show the second page', () => {
+    const wizardStepServiceSpy = spyOn(wizardStepService, 'moveToNextStep').and.callThrough();
+    component.createCluster();
+    fixture.detectChanges();
+    component.onNextStep();
+    fixture.detectChanges();
+    expect(wizardStepServiceSpy).toHaveBeenCalledTimes(1);
+  });
+
+  it('should show the button labels correctly', () => {
+    component.createCluster();
+    fixture.detectChanges();
+    let submitBtnLabel = component.showSubmitButtonLabel();
+    expect(submitBtnLabel).toEqual('Next');
+    let cancelBtnLabel = component.showCancelButtonLabel();
+    expect(cancelBtnLabel).toEqual('Cancel');
+
+    component.onNextStep();
+    fixture.detectChanges();
+    submitBtnLabel = component.showSubmitButtonLabel();
+    expect(submitBtnLabel).toEqual('Next');
+    cancelBtnLabel = component.showCancelButtonLabel();
+    expect(cancelBtnLabel).toEqual('Back');
+
+    component.onNextStep();
+    fixture.detectChanges();
+    submitBtnLabel = component.showSubmitButtonLabel();
+    expect(submitBtnLabel).toEqual('Next');
+    cancelBtnLabel = component.showCancelButtonLabel();
+    expect(cancelBtnLabel).toEqual('Back');
+
+    // Last page of the wizard
+    component.onNextStep();
+    fixture.detectChanges();
+    submitBtnLabel = component.showSubmitButtonLabel();
+    expect(submitBtnLabel).toEqual('Expand Cluster');
+    cancelBtnLabel = component.showCancelButtonLabel();
+    expect(cancelBtnLabel).toEqual('Back');
+  });
+
+  it('should ensure osd creation did not happen when no devices are selected', () => {
+    const osdServiceSpy = spyOn(osdService, 'create').and.callThrough();
+    component.onSubmit();
+    fixture.detectChanges();
+    expect(osdServiceSpy).toBeCalledTimes(0);
+  });
+
+  it('should ensure osd creation did happen when devices are selected', () => {
+    const osdServiceSpy = spyOn(osdService, 'create').and.callThrough();
+    osdService.osdDevices['totalDevices'] = 1;
+    component.onSubmit();
+    fixture.detectChanges();
+    expect(osdServiceSpy).toBeCalledTimes(1);
+  });
+
+  it('should ensure host list call happened', () => {
+    const hostServiceSpy = spyOn(hostService, 'list').and.callThrough();
+    component.onSubmit();
+    expect(hostServiceSpy).toHaveBeenCalledTimes(1);
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/create-cluster/create-cluster.component.ts
new file mode 100644 (file)
index 0000000..743902b
--- /dev/null
@@ -0,0 +1,183 @@
+import { Component, EventEmitter, OnDestroy, Output, TemplateRef, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+
+import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
+import _ from 'lodash';
+import { forkJoin, Subscription } from 'rxjs';
+import { finalize } from 'rxjs/operators';
+
+import { ClusterService } from '~/app/shared/api/cluster.service';
+import { HostService } from '~/app/shared/api/host.service';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { ConfirmationModalComponent } from '~/app/shared/components/confirmation-modal/confirmation-modal.component';
+import { ActionLabelsI18n, AppConstants, URLVerbs } from '~/app/shared/constants/app.constants';
+import { NotificationType } from '~/app/shared/enum/notification-type.enum';
+import { FinishedTask } from '~/app/shared/models/finished-task';
+import { Permissions } from '~/app/shared/models/permissions';
+import { WizardStepModel } from '~/app/shared/models/wizard-steps';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { ModalService } from '~/app/shared/services/modal.service';
+import { NotificationService } from '~/app/shared/services/notification.service';
+import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
+import { DriveGroup } from '../osd/osd-form/drive-group.model';
+
+@Component({
+  selector: 'cd-create-cluster',
+  templateUrl: './create-cluster.component.html',
+  styleUrls: ['./create-cluster.component.scss']
+})
+export class CreateClusterComponent implements OnDestroy {
+  @ViewChild('skipConfirmTpl', { static: true })
+  skipConfirmTpl: TemplateRef<any>;
+  currentStep: WizardStepModel;
+  currentStepSub: Subscription;
+  permissions: Permissions;
+  projectConstants: typeof AppConstants = AppConstants;
+  stepTitles = ['Add Hosts', 'Create OSDs', 'Create Services', 'Review'];
+  startClusterCreation = false;
+  observables: any = [];
+  modalRef: NgbModalRef;
+  driveGroup = new DriveGroup();
+  driveGroups: Object[] = [];
+
+  @Output()
+  submitAction = new EventEmitter();
+
+  constructor(
+    private authStorageService: AuthStorageService,
+    private wizardStepsService: WizardStepsService,
+    private router: Router,
+    private hostService: HostService,
+    private notificationService: NotificationService,
+    private actionLabels: ActionLabelsI18n,
+    private clusterService: ClusterService,
+    private modalService: ModalService,
+    private taskWrapper: TaskWrapperService,
+    private osdService: OsdService
+  ) {
+    this.permissions = this.authStorageService.getPermissions();
+    this.currentStepSub = this.wizardStepsService
+      .getCurrentStep()
+      .subscribe((step: WizardStepModel) => {
+        this.currentStep = step;
+      });
+    this.currentStep.stepIndex = 1;
+  }
+
+  createCluster() {
+    this.startClusterCreation = true;
+  }
+
+  skipClusterCreation() {
+    const modalVariables = {
+      titleText: $localize`Warning`,
+      buttonText: $localize`Continue`,
+      warning: true,
+      bodyTpl: this.skipConfirmTpl,
+      showSubmit: true,
+      onSubmit: () => {
+        this.clusterService.updateStatus('POST_INSTALLED').subscribe({
+          error: () => this.modalRef.close(),
+          complete: () => {
+            this.notificationService.show(
+              NotificationType.info,
+              $localize`Cluster expansion skipped by user`
+            );
+            this.router.navigate(['/dashboard']);
+            this.modalRef.close();
+          }
+        });
+      }
+    };
+    this.modalRef = this.modalService.show(ConfirmationModalComponent, modalVariables);
+  }
+
+  onSubmit() {
+    this.hostService.list('false').subscribe((hosts) => {
+      hosts.forEach((host) => {
+        const index = host['labels'].indexOf('_no_schedule', 0);
+        if (index > -1) {
+          host['labels'].splice(index, 1);
+          this.observables.push(this.hostService.update(host['hostname'], true, host['labels']));
+        }
+      });
+      forkJoin(this.observables)
+        .pipe(
+          finalize(() =>
+            this.clusterService.updateStatus('POST_INSTALLED').subscribe(() => {
+              this.notificationService.show(
+                NotificationType.success,
+                $localize`Cluster expansion was successful`
+              );
+              this.router.navigate(['/dashboard']);
+            })
+          )
+        )
+        .subscribe({
+          error: (error) => error.preventDefault()
+        });
+    });
+    if (this.driveGroup) {
+      const user = this.authStorageService.getUsername();
+      this.driveGroup.setName(`dashboard-${user}-${_.now()}`);
+      this.driveGroups.push(this.driveGroup.spec);
+    }
+
+    if (this.osdService.osdDevices['totalDevices'] > 0) {
+      this.taskWrapper
+        .wrapTaskAroundCall({
+          task: new FinishedTask('osd/' + URLVerbs.CREATE, {
+            tracking_id: _.join(_.map(this.driveGroups, 'service_id'), ', ')
+          }),
+          call: this.osdService.create(this.driveGroups)
+        })
+        .subscribe({
+          error: (error) => error.preventDefault(),
+          complete: () => {
+            this.submitAction.emit();
+            this.osdService.osdDevices = [];
+          }
+        });
+    }
+  }
+
+  getDriveGroup(driveGroup: DriveGroup) {
+    this.driveGroup = driveGroup;
+  }
+
+  onNextStep() {
+    if (!this.wizardStepsService.isLastStep()) {
+      this.wizardStepsService.getCurrentStep().subscribe((step: WizardStepModel) => {
+        this.currentStep = step;
+      });
+      this.wizardStepsService.moveToNextStep();
+    } else {
+      this.onSubmit();
+    }
+  }
+
+  onPreviousStep() {
+    if (!this.wizardStepsService.isFirstStep()) {
+      this.wizardStepsService.moveToPreviousStep();
+    } else {
+      this.router.navigate(['/dashboard']);
+    }
+  }
+
+  showSubmitButtonLabel() {
+    return !this.wizardStepsService.isLastStep()
+      ? this.actionLabels.NEXT
+      : $localize`Expand Cluster`;
+  }
+
+  showCancelButtonLabel() {
+    return !this.wizardStepsService.isFirstStep()
+      ? this.actionLabels.BACK
+      : this.actionLabels.CANCEL;
+  }
+
+  ngOnDestroy(): void {
+    this.currentStepSub.unsubscribe();
+  }
+}
index 2296d7ddae847db80191672d4a83d11315fa6fce..66fe42f7fa845d11759751ee0368a9cd45c79269 100644 (file)
-<div class="cd-col-form"
-     *cdFormLoading="loading">
-  <form name="hostForm"
-        #formDir="ngForm"
-        [formGroup]="hostForm"
-        novalidate>
-    <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
-           class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
+<cd-modal [pageURL]="pageURL"
+          [modalRef]="activeModal">
+  <span class="modal-title"
+        i18n>{{ action | titlecase }} {{ resource | upperFirst }}</span>
 
-      <div class="card-body">
+  <ng-container class="modal-content">
 
-        <!-- Hostname -->
-        <div class="form-group row">
-          <label class="cd-col-form-label required"
-                 for="hostname"
-                 i18n>Hostname</label>
-          <div class="cd-col-form-input">
-            <input class="form-control"
-                   type="text"
-                   placeholder="mon-123"
-                   id="hostname"
-                   name="hostname"
-                   formControlName="hostname"
-                   autofocus>
-            <span class="invalid-feedback"
-                  *ngIf="hostForm.showError('hostname', formDir, 'required')"
-                  i18n>This field is required.</span>
-            <span class="invalid-feedback"
-                  *ngIf="hostForm.showError('hostname', formDir, 'uniqueName')"
-                  i18n>The chosen hostname is already in use.</span>
+    <div *cdFormLoading="loading">
+      <form name="hostForm"
+            #formDir="ngForm"
+            [formGroup]="hostForm"
+            novalidate>
+
+        <div class="modal-body">
+
+          <!-- Hostname -->
+          <div class="form-group row">
+            <label class="cd-col-form-label required"
+                   for="hostname">
+            <ng-container i18n>Hostname</ng-container>
+            <cd-helper>
+              <p i18n>To add multiple hosts at once, you can enter:</p>
+              <ul>
+                <li i18n>a comma-separated list of hostnames <samp>(e.g.: example-01,example-02,example-03)</samp>,</li>
+                <li i18n>a range expression <samp>(e.g.: example-[01-03].ceph)</samp>,</li>
+                <li i18n>a comma separated range expression <samp>(e.g.: example-[01-05].lab.com,example2-[1-4].lab.com,example3-[001-006].lab.com)</samp></li>
+              </ul>
+            </cd-helper>
+            </label>
+            <div class="cd-col-form-input">
+              <input class="form-control"
+                     type="text"
+                     placeholder="mon-123"
+                     id="hostname"
+                     name="hostname"
+                     formControlName="hostname"
+                     autofocus
+                     (keyup)="checkHostNameValue()">
+              <span class="invalid-feedback"
+                    *ngIf="hostForm.showError('hostname', formDir, 'required')"
+                    i18n>This field is required.</span>
+              <span class="invalid-feedback"
+                    *ngIf="hostForm.showError('hostname', formDir, 'uniqueName')"
+                    i18n>The chosen hostname is already in use.</span>
+            </div>
           </div>
-        </div>
 
-        <!-- Address -->
-        <div class="form-group row">
-          <label class="cd-col-form-label"
-                 for="addr"
-                 i18n>Nework address</label>
-          <div class="cd-col-form-input">
-            <input class="form-control"
-                   type="text"
-                   placeholder="192.168.0.1"
-                   id="addr"
-                   name="addr"
-                   formControlName="addr">
-            <span class="invalid-feedback"
-                  *ngIf="hostForm.showError('addr', formDir, 'pattern')"
-                  i18n>The value is not a valid IP address.</span>
+          <!-- Address -->
+          <div class="form-group row"
+               *ngIf="!hostPattern">
+            <label class="cd-col-form-label"
+                   for="addr"
+                   i18n>Network address</label>
+            <div class="cd-col-form-input">
+              <input class="form-control"
+                     type="text"
+                     placeholder="192.168.0.1"
+                     id="addr"
+                     name="addr"
+                     formControlName="addr">
+              <span class="invalid-feedback"
+                    *ngIf="hostForm.showError('addr', formDir, 'pattern')"
+                    i18n>The value is not a valid IP address.</span>
+            </div>
           </div>
-        </div>
 
-        <!-- Labels -->
-        <div class="form-group row">
-          <label i18n
-                 for="labels"
-                 class="cd-col-form-label">Labels</label>
-          <div class="cd-col-form-input">
-            <cd-select-badges id="labels"
-                              [data]="hostForm.controls.labels.value"
-                              [customBadges]="true"
-                              [messages]="messages">
-            </cd-select-badges>
+          <!-- Labels -->
+          <div class="form-group row">
+            <label i18n
+                   for="labels"
+                   class="cd-col-form-label">Labels</label>
+            <div class="cd-col-form-input">
+              <cd-select-badges id="labels"
+                                [data]="hostForm.controls.labels.value"
+                                [options]="labelsOption"
+                                [customBadges]="true"
+                                [messages]="messages">
+              </cd-select-badges>
+            </div>
           </div>
-        </div>
 
-        <!-- Maintenance Mode -->
-        <div class="form-group row">
-          <div class="cd-col-form-offset">
-            <div class="custom-control custom-checkbox">
-              <input class="custom-control-input"
-                     id="maintenance"
-                     type="checkbox"
-                     formControlName="maintenance">
-              <label class="custom-control-label"
-                     for="maintenance"
-                     i18n>Maintenance Mode</label>
+          <!-- Maintenance Mode -->
+          <div class="form-group row">
+            <div class="cd-col-form-offset">
+              <div class="custom-control custom-checkbox">
+                <input class="custom-control-input"
+                       id="maintenance"
+                       type="checkbox"
+                       formControlName="maintenance">
+                <label class="custom-control-label"
+                       for="maintenance"
+                       i18n>Maintenance Mode</label>
+              </div>
             </div>
           </div>
         </div>
-      </div>
 
-      <div class="card-footer">
-        <cd-form-button-panel (submitActionEvent)="submit()"
-                              [form]="hostForm"
-                              [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
-                              wrappingClass="text-right"></cd-form-button-panel>
-      </div>
+        <div class="modal-footer">
+          <cd-form-button-panel (submitActionEvent)="submit()"
+                                [form]="hostForm"
+                                [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
+                                wrappingClass="text-right"></cd-form-button-panel>
+        </div>
+      </form>
     </div>
-  </form>
-</div>
+  </ng-container>
+</cd-modal>
index dbb834ea8c82cc7fa37ef6b0ac829638e09386db..ed85d96cb1baba33e1ebf5bd546c214df46c24e4 100644 (file)
@@ -3,6 +3,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
 import { ReactiveFormsModule } from '@angular/forms';
 import { RouterTestingModule } from '@angular/router/testing';
 
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
 
 import { LoadingPanelComponent } from '~/app/shared/components/loading-panel/loading-panel.component';
@@ -24,7 +25,8 @@ describe('HostFormComponent', () => {
         ReactiveFormsModule,
         ToastrModule.forRoot()
       ],
-      declarations: [HostFormComponent]
+      declarations: [HostFormComponent],
+      providers: [NgbActiveModal]
     },
     [LoadingPanelComponent]
   );
@@ -32,6 +34,7 @@ describe('HostFormComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(HostFormComponent);
     component = fixture.componentInstance;
+    component.ngOnInit();
     formHelper = new FormHelper(component.hostForm);
     fixture.detectChanges();
   });
@@ -40,6 +43,11 @@ describe('HostFormComponent', () => {
     expect(component).toBeTruthy();
   });
 
+  it('should open the form in a modal', () => {
+    const nativeEl = fixture.debugElement.nativeElement;
+    expect(nativeEl.querySelector('cd-modal')).not.toBe(null);
+  });
+
   it('should validate the network address is valid', fakeAsync(() => {
     formHelper.setValue('addr', '115.42.150.37', true);
     tick();
@@ -73,4 +81,88 @@ describe('HostFormComponent', () => {
     component.submit();
     expect(component.status).toBe('maintenance');
   });
+
+  it('should expand the hostname correctly', () => {
+    component.hostForm.get('hostname').setValue('ceph-node-00.cephlab.com');
+    fixture.detectChanges();
+    component.submit();
+    expect(component.hostnameArray).toStrictEqual(['ceph-node-00.cephlab.com']);
+
+    component.hostnameArray = [];
+
+    component.hostForm.get('hostname').setValue('ceph-node-[00-10].cephlab.com');
+    fixture.detectChanges();
+    component.submit();
+    expect(component.hostnameArray).toStrictEqual([
+      'ceph-node-00.cephlab.com',
+      'ceph-node-01.cephlab.com',
+      'ceph-node-02.cephlab.com',
+      'ceph-node-03.cephlab.com',
+      'ceph-node-04.cephlab.com',
+      'ceph-node-05.cephlab.com',
+      'ceph-node-06.cephlab.com',
+      'ceph-node-07.cephlab.com',
+      'ceph-node-08.cephlab.com',
+      'ceph-node-09.cephlab.com',
+      'ceph-node-10.cephlab.com'
+    ]);
+
+    component.hostnameArray = [];
+
+    component.hostForm.get('hostname').setValue('ceph-node-00.cephlab.com,ceph-node-1.cephlab.com');
+    fixture.detectChanges();
+    component.submit();
+    expect(component.hostnameArray).toStrictEqual([
+      'ceph-node-00.cephlab.com',
+      'ceph-node-1.cephlab.com'
+    ]);
+
+    component.hostnameArray = [];
+
+    component.hostForm
+      .get('hostname')
+      .setValue('ceph-mon-[01-05].lab.com,ceph-osd-[1-4].lab.com,ceph-rgw-[001-006].lab.com');
+    fixture.detectChanges();
+    component.submit();
+    expect(component.hostnameArray).toStrictEqual([
+      'ceph-mon-01.lab.com',
+      'ceph-mon-02.lab.com',
+      'ceph-mon-03.lab.com',
+      'ceph-mon-04.lab.com',
+      'ceph-mon-05.lab.com',
+      'ceph-osd-1.lab.com',
+      'ceph-osd-2.lab.com',
+      'ceph-osd-3.lab.com',
+      'ceph-osd-4.lab.com',
+      'ceph-rgw-001.lab.com',
+      'ceph-rgw-002.lab.com',
+      'ceph-rgw-003.lab.com',
+      'ceph-rgw-004.lab.com',
+      'ceph-rgw-005.lab.com',
+      'ceph-rgw-006.lab.com'
+    ]);
+
+    component.hostnameArray = [];
+
+    component.hostForm
+      .get('hostname')
+      .setValue('ceph-(mon-[00-04],osd-[001-005],rgw-[1-3]).lab.com');
+    fixture.detectChanges();
+    component.submit();
+    expect(component.hostnameArray).toStrictEqual([
+      'ceph-mon-00.lab.com',
+      'ceph-mon-01.lab.com',
+      'ceph-mon-02.lab.com',
+      'ceph-mon-03.lab.com',
+      'ceph-mon-04.lab.com',
+      'ceph-osd-001.lab.com',
+      'ceph-osd-002.lab.com',
+      'ceph-osd-003.lab.com',
+      'ceph-osd-004.lab.com',
+      'ceph-osd-005.lab.com',
+      'ceph-rgw-1.lab.com',
+      'ceph-rgw-2.lab.com',
+      'ceph-rgw-3.lab.com'
+    ]);
+  });
 });
index b90312ff855f2f305904961cea58fc9139ffdae4..a36f1fbacaff3bde9de3164fea341d82f690dbbd 100644 (file)
@@ -2,8 +2,12 @@ import { Component, OnInit } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import expand from 'brace-expansion';
+
 import { HostService } from '~/app/shared/api/host.service';
 import { SelectMessages } from '~/app/shared/components/select/select-messages.model';
+import { SelectOption } from '~/app/shared/components/select/select-option.model';
 import { ActionLabelsI18n, URLVerbs } from '~/app/shared/constants/app.constants';
 import { CdForm } from '~/app/shared/forms/cd-form';
 import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
@@ -21,9 +25,13 @@ export class HostFormComponent extends CdForm implements OnInit {
   action: string;
   resource: string;
   hostnames: string[];
+  hostnameArray: string[] = [];
   addr: string;
   status: string;
-  allLabels: any;
+  allLabels: string[];
+  pageURL: string;
+  hostPattern = false;
+  labelsOption: Array<SelectOption> = [];
 
   messages = new SelectMessages({
     empty: $localize`There are no labels.`,
@@ -35,21 +43,38 @@ export class HostFormComponent extends CdForm implements OnInit {
     private router: Router,
     private actionLabels: ActionLabelsI18n,
     private hostService: HostService,
-    private taskWrapper: TaskWrapperService
+    private taskWrapper: TaskWrapperService,
+    public activeModal: NgbActiveModal
   ) {
     super();
     this.resource = $localize`host`;
-    this.action = this.actionLabels.CREATE;
-    this.createForm();
+    this.action = this.actionLabels.ADD;
   }
 
   ngOnInit() {
-    this.hostService.list().subscribe((resp: any[]) => {
+    if (this.router.url.includes('hosts')) {
+      this.pageURL = 'hosts';
+    }
+    this.createForm();
+    this.hostService.list('false').subscribe((resp: any[]) => {
       this.hostnames = resp.map((host) => {
         return host['hostname'];
       });
       this.loadingReady();
     });
+
+    this.hostService.getLabels().subscribe((resp: string[]) => {
+      const uniqueLabels = new Set(resp.concat(this.hostService.predefinedLabels));
+      this.labelsOption = Array.from(uniqueLabels).map((label) => {
+        return { enabled: true, name: label, selected: false, description: null };
+      });
+    });
+  }
+
+  // check if hostname is a single value or pattern to hide network address field
+  checkHostNameValue() {
+    const hostNames = this.hostForm.get('hostname').value;
+    hostNames.match(/[()\[\]{},]/g) ? (this.hostPattern = true) : (this.hostPattern = false);
   }
 
   private createForm() {
@@ -66,29 +91,81 @@ export class HostFormComponent extends CdForm implements OnInit {
         validators: [CdValidators.ip()]
       }),
       labels: new FormControl([]),
-      maintenance: new FormControl(false)
+      maintenance: new FormControl({ value: false, disabled: this.pageURL !== 'hosts' })
     });
   }
 
+  private isCommaSeparatedPattern(hostname: string) {
+    // eg. ceph-node-01.cephlab.com,ceph-node-02.cephlab.com
+    return hostname.includes(',');
+  }
+
+  private isRangeTypePattern(hostname: string) {
+    // check if it is a range expression or comma separated range expression
+    // eg. ceph-mon-[01-05].lab.com,ceph-osd-[02-08].lab.com,ceph-rgw-[01-09]
+    return hostname.includes('[') && hostname.includes(']') && !hostname.match(/(?![^(]*\)),/g);
+  }
+
+  private replaceBraces(hostname: string) {
+    // pattern to replace range [0-5] to [0..5](valid expression for brace expansion)
+    // replace any kind of brackets with curly braces
+    return hostname
+      .replace(/(?<=\d)\s*-\s*(?=\d)/g, '..')
+      .replace(/\(/g, '{')
+      .replace(/\)/g, '}')
+      .replace(/\[/g, '{')
+      .replace(/]/g, '}');
+  }
+
+  // expand hostnames in case hostname is a pattern
+  private checkHostNamePattern(hostname: string) {
+    if (this.isRangeTypePattern(hostname)) {
+      const hostnameRange = this.replaceBraces(hostname);
+      this.hostnameArray = expand(hostnameRange);
+    } else if (this.isCommaSeparatedPattern(hostname)) {
+      let hostArray = [];
+      hostArray = hostname.split(',');
+      hostArray.forEach((host: string) => {
+        if (this.isRangeTypePattern(host)) {
+          const hostnameRange = this.replaceBraces(host);
+          this.hostnameArray = this.hostnameArray.concat(expand(hostnameRange));
+        } else {
+          this.hostnameArray.push(host);
+        }
+      });
+    } else {
+      // single hostname
+      this.hostnameArray.push(hostname);
+    }
+  }
+
   submit() {
     const hostname = this.hostForm.get('hostname').value;
+    this.checkHostNamePattern(hostname);
     this.addr = this.hostForm.get('addr').value;
     this.status = this.hostForm.get('maintenance').value ? 'maintenance' : '';
     this.allLabels = this.hostForm.get('labels').value;
-    this.taskWrapper
-      .wrapTaskAroundCall({
-        task: new FinishedTask('host/' + URLVerbs.CREATE, {
-          hostname: hostname
-        }),
-        call: this.hostService.create(hostname, this.addr, this.allLabels, this.status)
-      })
-      .subscribe({
-        error: () => {
-          this.hostForm.setErrors({ cdSubmitButton: true });
-        },
-        complete: () => {
-          this.router.navigate(['/hosts']);
-        }
-      });
+    if (this.pageURL !== 'hosts' && !this.allLabels.includes('_no_schedule')) {
+      this.allLabels.push('_no_schedule');
+    }
+    this.hostnameArray.forEach((hostName: string) => {
+      this.taskWrapper
+        .wrapTaskAroundCall({
+          task: new FinishedTask('host/' + URLVerbs.ADD, {
+            hostname: hostName
+          }),
+          call: this.hostService.create(hostName, this.addr, this.allLabels, this.status)
+        })
+        .subscribe({
+          error: () => {
+            this.hostForm.setErrors({ cdSubmitButton: true });
+          },
+          complete: () => {
+            this.pageURL === 'hosts'
+              ? this.router.navigate([this.pageURL, { outlets: { modal: null } }])
+              : this.activeModal.close();
+          }
+        });
+    });
   }
 }
index f31adf9e5c0e79bc21bb172c3ce629c23f9f105a..3b310d45650278151fd344a8f8f9ab0921578a7c 100644 (file)
@@ -5,14 +5,16 @@
     <a ngbNavLink
        i18n>Hosts List</a>
     <ng-template ngbNavContent>
-      <cd-table [data]="hosts"
+      <cd-table #table
+                [data]="hosts"
                 [columns]="columns"
                 columnMode="flex"
                 (fetchData)="getHosts($event)"
                 selectionType="single"
-                [hasDetails]="true"
+                [hasDetails]="hasTableDetails"
                 (setExpandedRow)="setExpandedRow($event)"
-                (updateSelection)="updateSelection($event)">
+                (updateSelection)="updateSelection($event)"
+                [toolHeader]="!hideToolHeader">
         <div class="table-actions btn-toolbar">
           <cd-table-actions [permission]="permissions.hosts"
                             [selection]="selection"
   <ng-container i18n
                 *ngIf="showSubmit">Are you sure you want to continue?</ng-container>
 </ng-template>
+
+<ng-template #orchTmpl>
+  <span i18n
+        i18n-ngbTooltip
+        ngbTooltip="Data will be available only if Orchestrator is available.">Unavailable</span>
+</ng-template>
+
+<ng-template #flashTmpl>
+  <span i18n
+        i18n-ngbTooltip
+        ngbTooltip="SSD, NVMEs">Flash</span>
+</ng-template>
+<router-outlet name="modal"></router-outlet>
index f4d400f3230c8cf8424c5a040c21d432aa468737..4535a55911b87250449feb76ea6929dd10f23693 100644 (file)
@@ -12,6 +12,7 @@ import { CoreModule } from '~/app/core/core.module';
 import { HostService } from '~/app/shared/api/host.service';
 import { OrchestratorService } from '~/app/shared/api/orchestrator.service';
 import { TableActionsComponent } from '~/app/shared/datatable/table-actions/table-actions.component';
+import { CdTableFetchDataContext } from '~/app/shared/models/cd-table-fetch-data-context';
 import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
 import { OrchestratorFeature } from '~/app/shared/models/orchestrator.enum';
 import { Permissions } from '~/app/shared/models/permissions';
@@ -99,23 +100,107 @@ describe('HostsComponent', () => {
           }
         ],
         hostname: hostname,
-        ceph_version: 'ceph version Development',
         labels: ['foo', 'bar']
       }
     ];
 
+    OrchestratorHelper.mockStatus(false);
+    hostListSpy.and.callFake(() => of(payload));
+    fixture.detectChanges();
+
+    component.getHosts(new CdTableFetchDataContext(() => undefined));
+    fixture.detectChanges();
+
+    const spans = fixture.debugElement.nativeElement.querySelectorAll(
+      '.datatable-body-cell-label span'
+    );
+    expect(spans[0].textContent).toBe(hostname);
+  });
+
+  it('should test if host facts are tranformed correctly if orch available', () => {
+    const features = [OrchestratorFeature.HOST_FACTS];
+    const payload = [
+      {
+        hostname: 'host_test',
+        services: [
+          {
+            type: 'osd',
+            id: '0'
+          }
+        ],
+        cpu_count: 2,
+        cpu_cores: 1,
+        memory_total_kb: 1024,
+        hdd_count: 4,
+        hdd_capacity_bytes: 1024,
+        flash_count: 4,
+        flash_capacity_bytes: 1024,
+        nic_count: 1
+      }
+    ];
+    OrchestratorHelper.mockStatus(true, features);
+    hostListSpy.and.callFake(() => of(payload));
+    fixture.detectChanges();
+
+    component.getHosts(new CdTableFetchDataContext(() => undefined));
+    expect(hostListSpy).toHaveBeenCalled();
+    expect(component.hosts[0]['cpu_count']).toEqual(2);
+    expect(component.hosts[0]['memory_total_bytes']).toEqual(1048576);
+    expect(component.hosts[0]['raw_capacity']).toEqual(2048);
+    expect(component.hosts[0]['hdd_count']).toEqual(4);
+    expect(component.hosts[0]['flash_count']).toEqual(4);
+    expect(component.hosts[0]['cpu_cores']).toEqual(1);
+    expect(component.hosts[0]['nic_count']).toEqual(1);
+  });
+
+  it('should test if host facts are unavailable if no orch available', () => {
+    const payload = [
+      {
+        hostname: 'host_test',
+        services: [
+          {
+            type: 'osd',
+            id: '0'
+          }
+        ]
+      }
+    ];
+    OrchestratorHelper.mockStatus(false);
+    hostListSpy.and.callFake(() => of(payload));
+    fixture.detectChanges();
+
+    component.getHosts(new CdTableFetchDataContext(() => undefined));
+    fixture.detectChanges();
+
+    const spans = fixture.debugElement.nativeElement.querySelectorAll(
+      '.datatable-body-cell-label span'
+    );
+    expect(spans[7].textContent).toBe('Unavailable');
+  });
+
+  it('should test if host facts are unavailable if get_fatcs orch feature is not available', () => {
+    const payload = [
+      {
+        hostname: 'host_test',
+        services: [
+          {
+            type: 'osd',
+            id: '0'
+          }
+        ]
+      }
+    ];
     OrchestratorHelper.mockStatus(true);
     hostListSpy.and.callFake(() => of(payload));
     fixture.detectChanges();
 
-    return fixture.whenStable().then(() => {
-      fixture.detectChanges();
+    component.getHosts(new CdTableFetchDataContext(() => undefined));
+    fixture.detectChanges();
 
-      const spans = fixture.debugElement.nativeElement.querySelectorAll(
-        '.datatable-body-cell-label span'
-      );
-      expect(spans[0].textContent).toBe(hostname);
-    });
+    const spans = fixture.debugElement.nativeElement.querySelectorAll(
+      '.datatable-body-cell-label span'
+    );
+    expect(spans[7].textContent).toBe('Unavailable');
   });
 
   it('should show force maintenance modal when it is safe to stop host', () => {
@@ -182,33 +267,33 @@ describe('HostsComponent', () => {
       const tests = [
         {
           expectResults: {
-            Create: { disabled: false, disableDesc: '' },
+            Add: { disabled: false, disableDesc: '' },
             Edit: { disabled: true, disableDesc: '' },
-            Delete: { disabled: true, disableDesc: '' }
+            Remove: { disabled: true, disableDesc: '' }
           }
         },
         {
           selectRow: fakeHosts[0], // non-orchestrator host
           expectResults: {
-            Create: { disabled: false, disableDesc: '' },
+            Add: { disabled: false, disableDesc: '' },
             Edit: { disabled: true, disableDesc: component.messages.nonOrchHost },
-            Delete: { disabled: true, disableDesc: component.messages.nonOrchHost }
+            Remove: { disabled: true, disableDesc: component.messages.nonOrchHost }
           }
         },
         {
           selectRow: fakeHosts[1], // orchestrator host
           expectResults: {
-            Create: { disabled: false, disableDesc: '' },
+            Add: { disabled: false, disableDesc: '' },
             Edit: { disabled: false, disableDesc: '' },
-            Delete: { disabled: false, disableDesc: '' }
+            Remove: { disabled: false, disableDesc: '' }
           }
         }
       ];
 
       const features = [
-        OrchestratorFeature.HOST_CREATE,
+        OrchestratorFeature.HOST_ADD,
         OrchestratorFeature.HOST_LABEL_ADD,
-        OrchestratorFeature.HOST_DELETE,
+        OrchestratorFeature.HOST_REMOVE,
         OrchestratorFeature.HOST_LABEL_REMOVE
       ];
       await testTableActions(true, features, tests);
@@ -222,25 +307,25 @@ describe('HostsComponent', () => {
       const tests = [
         {
           expectResults: {
-            Create: resultNoOrchestrator,
+            Add: resultNoOrchestrator,
             Edit: { disabled: true, disableDesc: '' },
-            Delete: { disabled: true, disableDesc: '' }
+            Remove: { disabled: true, disableDesc: '' }
           }
         },
         {
           selectRow: fakeHosts[0], // non-orchestrator host
           expectResults: {
-            Create: resultNoOrchestrator,
+            Add: resultNoOrchestrator,
             Edit: { disabled: true, disableDesc: component.messages.nonOrchHost },
-            Delete: { disabled: true, disableDesc: component.messages.nonOrchHost }
+            Remove: { disabled: true, disableDesc: component.messages.nonOrchHost }
           }
         },
         {
           selectRow: fakeHosts[1], // orchestrator host
           expectResults: {
-            Create: resultNoOrchestrator,
+            Add: resultNoOrchestrator,
             Edit: resultNoOrchestrator,
-            Delete: resultNoOrchestrator
+            Remove: resultNoOrchestrator
           }
         }
       ];
@@ -255,25 +340,25 @@ describe('HostsComponent', () => {
       const tests = [
         {
           expectResults: {
-            Create: resultMissingFeatures,
+            Add: resultMissingFeatures,
             Edit: { disabled: true, disableDesc: '' },
-            Delete: { disabled: true, disableDesc: '' }
+            Remove: { disabled: true, disableDesc: '' }
           }
         },
         {
           selectRow: fakeHosts[0], // non-orchestrator host
           expectResults: {
-            Create: resultMissingFeatures,
+            Add: resultMissingFeatures,
             Edit: { disabled: true, disableDesc: component.messages.nonOrchHost },
-            Delete: { disabled: true, disableDesc: component.messages.nonOrchHost }
+            Remove: { disabled: true, disableDesc: component.messages.nonOrchHost }
           }
         },
         {
           selectRow: fakeHosts[1], // orchestrator host
           expectResults: {
-            Create: resultMissingFeatures,
+            Add: resultMissingFeatures,
             Edit: resultMissingFeatures,
-            Delete: resultMissingFeatures
+            Remove: resultMissingFeatures
           }
         }
       ];
index 8c559a748b05dff82aa9069d1a9871e27f2609be..9b5408a4a88151a6714b57257ed5fe760d987fdd 100644 (file)
@@ -1,8 +1,10 @@
-import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
+import { Component, Input, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
 import { Router } from '@angular/router';
 
 import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import _ from 'lodash';
+import { Subscription } from 'rxjs';
+import { map, mergeMap } from 'rxjs/operators';
 
 import { HostService } from '~/app/shared/api/host.service';
 import { OrchestratorService } from '~/app/shared/api/orchestrator.service';
@@ -11,7 +13,7 @@ import { ConfirmationModalComponent } from '~/app/shared/components/confirmation
 import { CriticalConfirmationModalComponent } from '~/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
 import { FormModalComponent } from '~/app/shared/components/form-modal/form-modal.component';
 import { SelectMessages } from '~/app/shared/components/select/select-messages.model';
-import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
+import { ActionLabelsI18n, URLVerbs } from '~/app/shared/constants/app.constants';
 import { TableComponent } from '~/app/shared/datatable/table/table.component';
 import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
 import { Icons } from '~/app/shared/enum/icons.enum';
@@ -24,12 +26,13 @@ import { FinishedTask } from '~/app/shared/models/finished-task';
 import { OrchestratorFeature } from '~/app/shared/models/orchestrator.enum';
 import { OrchestratorStatus } from '~/app/shared/models/orchestrator.interface';
 import { Permissions } from '~/app/shared/models/permissions';
-import { CephShortVersionPipe } from '~/app/shared/pipes/ceph-short-version.pipe';
+import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 import { ModalService } from '~/app/shared/services/modal.service';
 import { NotificationService } from '~/app/shared/services/notification.service';
 import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
 import { URLBuilderService } from '~/app/shared/services/url-builder.service';
+import { HostFormComponent } from './host-form/host-form.component';
 
 const BASE_URL = 'hosts';
 
@@ -39,13 +42,37 @@ const BASE_URL = 'hosts';
   styleUrls: ['./hosts.component.scss'],
   providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }]
 })
-export class HostsComponent extends ListWithDetails implements OnInit {
+export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit {
+  private sub = new Subscription();
+
   @ViewChild(TableComponent)
   table: TableComponent;
   @ViewChild('servicesTpl', { static: true })
   public servicesTpl: TemplateRef<any>;
   @ViewChild('maintenanceConfirmTpl', { static: true })
   maintenanceConfirmTpl: TemplateRef<any>;
+  @ViewChild('orchTmpl', { static: true })
+  orchTmpl: TemplateRef<any>;
+  @ViewChild('flashTmpl', { static: true })
+  flashTmpl: TemplateRef<any>;
+
+  @Input()
+  hiddenColumns: string[] = [];
+
+  @Input()
+  hideTitle = false;
+
+  @Input()
+  hideSubmitBtn = false;
+
+  @Input()
+  hasTableDetails = true;
+
+  @Input()
+  hideToolHeader = false;
+
+  @Input()
+  showGeneralActionsOnly = false;
 
   permissions: Permissions;
   columns: Array<CdTableColumn> = [];
@@ -58,6 +85,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
   isExecuting = false;
   errorMessage: string;
   enableButton: boolean;
+  bsModalRef: NgbModalRef;
 
   icons = Icons;
 
@@ -67,9 +95,9 @@ export class HostsComponent extends ListWithDetails implements OnInit {
 
   orchStatus: OrchestratorStatus;
   actionOrchFeatures = {
-    create: [OrchestratorFeature.HOST_CREATE],
+    add: [OrchestratorFeature.HOST_ADD],
     edit: [OrchestratorFeature.HOST_LABEL_ADD, OrchestratorFeature.HOST_LABEL_REMOVE],
-    delete: [OrchestratorFeature.HOST_DELETE],
+    remove: [OrchestratorFeature.HOST_REMOVE],
     maintenance: [
       OrchestratorFeature.HOST_MAINTENANCE_ENTER,
       OrchestratorFeature.HOST_MAINTENANCE_EXIT
@@ -78,9 +106,8 @@ export class HostsComponent extends ListWithDetails implements OnInit {
 
   constructor(
     private authStorageService: AuthStorageService,
+    private dimlessBinary: DimlessBinaryPipe,
     private hostService: HostService,
-    private cephShortVersionPipe: CephShortVersionPipe,
-    private urlBuilder: URLBuilderService,
     private actionLabels: ActionLabelsI18n,
     private modalService: ModalService,
     private taskWrapper: TaskWrapperService,
@@ -92,11 +119,14 @@ export class HostsComponent extends ListWithDetails implements OnInit {
     this.permissions = this.authStorageService.getPermissions();
     this.tableActions = [
       {
-        name: this.actionLabels.CREATE,
+        name: this.actionLabels.ADD,
         permission: 'create',
         icon: Icons.add,
-        click: () => this.router.navigate([this.urlBuilder.getCreate()]),
-        disable: (selection: CdTableSelection) => this.getDisable('create', selection)
+        click: () =>
+          this.router.url.includes('/hosts')
+            ? this.router.navigate([BASE_URL, { outlets: { modal: [URLVerbs.ADD] } }])
+            : (this.bsModalRef = this.modalService.show(HostFormComponent)),
+        disable: (selection: CdTableSelection) => this.getDisable('add', selection)
       },
       {
         name: this.actionLabels.EDIT,
@@ -106,11 +136,11 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         disable: (selection: CdTableSelection) => this.getDisable('edit', selection)
       },
       {
-        name: this.actionLabels.DELETE,
+        name: this.actionLabels.REMOVE,
         permission: 'delete',
         icon: Icons.destroy,
         click: () => this.deleteAction(),
-        disable: (selection: CdTableSelection) => this.getDisable('delete', selection)
+        disable: (selection: CdTableSelection) => this.getDisable('remove', selection)
       },
       {
         name: this.actionLabels.ENTER_MAINTENANCE,
@@ -118,7 +148,8 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         icon: Icons.enter,
         click: () => this.hostMaintenance(),
         disable: (selection: CdTableSelection) =>
-          this.getDisable('maintenance', selection) || this.isExecuting || this.enableButton
+          this.getDisable('maintenance', selection) || this.isExecuting || this.enableButton,
+        visible: () => !this.showGeneralActionsOnly
       },
       {
         name: this.actionLabels.EXIT_MAINTENANCE,
@@ -126,7 +157,8 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         icon: Icons.exit,
         click: () => this.hostMaintenance(),
         disable: (selection: CdTableSelection) =>
-          this.getDisable('maintenance', selection) || this.isExecuting || !this.enableButton
+          this.getDisable('maintenance', selection) || this.isExecuting || !this.enableButton,
+        visible: () => !this.showGeneralActionsOnly
       }
     ];
   }
@@ -141,7 +173,7 @@ export class HostsComponent extends ListWithDetails implements OnInit {
       {
         name: $localize`Services`,
         prop: 'services',
-        flexGrow: 3,
+        flexGrow: 2,
         cellTemplate: this.servicesTpl
       },
       {
@@ -165,17 +197,59 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         }
       },
       {
-        name: $localize`Version`,
-        prop: 'ceph_version',
-        flexGrow: 1,
-        pipe: this.cephShortVersionPipe
+        name: $localize`Model`,
+        prop: 'model',
+        flexGrow: 1
+      },
+      {
+        name: $localize`CPUs`,
+        prop: 'cpu_count',
+        flexGrow: 0.3
+      },
+      {
+        name: $localize`Cores`,
+        prop: 'cpu_cores',
+        flexGrow: 0.3
+      },
+      {
+        name: $localize`Total Memory`,
+        prop: 'memory_total_bytes',
+        pipe: this.dimlessBinary,
+        flexGrow: 0.4
+      },
+      {
+        name: $localize`Raw Capacity`,
+        prop: 'raw_capacity',
+        pipe: this.dimlessBinary,
+        flexGrow: 0.5
+      },
+      {
+        name: $localize`HDDs`,
+        prop: 'hdd_count',
+        flexGrow: 0.3
+      },
+      {
+        name: $localize`Flash`,
+        prop: 'flash_count',
+        headerTemplate: this.flashTmpl,
+        flexGrow: 0.3
+      },
+      {
+        name: $localize`NICs`,
+        prop: 'nic_count',
+        flexGrow: 0.3
       }
     ];
-    this.orchService.status().subscribe((status: OrchestratorStatus) => {
-      this.orchStatus = status;
+
+    this.columns = this.columns.filter((col: any) => {
+      return !this.hiddenColumns.includes(col.prop);
     });
   }
 
+  ngOnDestroy() {
+    this.sub.unsubscribe();
+  }
+
   updateSelection(selection: CdTableSelection) {
     this.selection = selection;
     this.enableButton = false;
@@ -189,7 +263,8 @@ export class HostsComponent extends ListWithDetails implements OnInit {
   editAction() {
     this.hostService.getLabels().subscribe((resp: string[]) => {
       const host = this.selection.first();
-      const allLabels = resp.map((label) => {
+      const labels = new Set(resp.concat(this.hostService.predefinedLabels));
+      const allLabels = Array.from(labels).map((label) => {
         return { enabled: true, name: label };
       });
       this.modalService.show(FormModalComponent, {
@@ -287,10 +362,10 @@ export class HostsComponent extends ListWithDetails implements OnInit {
   }
 
   getDisable(
-    action: 'create' | 'edit' | 'delete' | 'maintenance',
+    action: 'add' | 'edit' | 'remove' | 'maintenance',
     selection: CdTableSelection
   ): boolean | string {
-    if (action === 'delete' || action === 'edit' || action === 'maintenance') {
+    if (action === 'remove' || action === 'edit' || action === 'maintenance') {
       if (!selection?.hasSingleSelection) {
         return true;
       }
@@ -309,15 +384,41 @@ export class HostsComponent extends ListWithDetails implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       itemDescription: 'Host',
       itemNames: [hostname],
-      actionDescription: 'delete',
+      actionDescription: 'remove',
       submitActionObservable: () =>
         this.taskWrapper.wrapTaskAroundCall({
-          task: new FinishedTask('host/delete', { hostname: hostname }),
+          task: new FinishedTask('host/remove', { hostname: hostname }),
           call: this.hostService.delete(hostname)
         })
     });
   }
 
+  checkHostsFactsAvailable() {
+    const orchFeatures = this.orchStatus.features;
+    if (!_.isEmpty(orchFeatures)) {
+      if (orchFeatures.get_facts.available) {
+        return true;
+      }
+      return false;
+    }
+    return false;
+  }
+
+  transformHostsData() {
+    if (this.checkHostsFactsAvailable()) {
+      _.forEach(this.hosts, (hostKey) => {
+        hostKey['memory_total_bytes'] = hostKey['memory_total_kb'] * 1024;
+        hostKey['raw_capacity'] = hostKey['hdd_capacity_bytes'] + hostKey['flash_capacity_bytes'];
+      });
+    } else {
+      // mark host facts columns unavailable
+      for (let column = 4; column < this.columns.length; column++) {
+        this.columns[column]['prop'] = '';
+        this.columns[column]['cellTemplate'] = this.orchTmpl;
+      }
+    }
+  }
+
   getHosts(context: CdTableFetchDataContext) {
     if (this.isLoadingHosts) {
       return;
@@ -332,24 +433,36 @@ export class HostsComponent extends ListWithDetails implements OnInit {
       'tcmu-runner': 'iscsi'
     };
     this.isLoadingHosts = true;
-    this.hostService.list().subscribe(
-      (resp: any[]) => {
-        resp.map((host) => {
-          host.services.map((service: any) => {
-            service.cdLink = `/perf_counters/${service.type}/${encodeURIComponent(service.id)}`;
-            const permission = this.permissions[typeToPermissionKey[service.type]];
-            service.canRead = permission ? permission.read : false;
-            return service;
-          });
-          return host;
-        });
-        this.hosts = resp;
-        this.isLoadingHosts = false;
-      },
-      () => {
-        this.isLoadingHosts = false;
-        context.error();
-      }
-    );
+    this.sub = this.orchService
+      .status()
+      .pipe(
+        mergeMap((orchStatus) => {
+          this.orchStatus = orchStatus;
+          const factsAvailable = this.checkHostsFactsAvailable();
+          return this.hostService.list(`${factsAvailable}`);
+        }),
+        map((hostList: object[]) =>
+          hostList.map((host) => {
+            host['services'].map((service: any) => {
+              service.cdLink = `/perf_counters/${service.type}/${encodeURIComponent(service.id)}`;
+              const permission = this.permissions[typeToPermissionKey[service.type]];
+              service.canRead = permission ? permission.read : false;
+              return service;
+            });
+            return host;
+          })
+        )
+      )
+      .subscribe(
+        (hostList) => {
+          this.hosts = hostList;
+          this.transformHostsData();
+          this.isLoadingHosts = false;
+        },
+        () => {
+          this.isLoadingHosts = false;
+          context.error();
+        }
+      );
   }
 }
index 244bd8162cf4d597eb99884f2bb9fb56ae07677b..54cee708d263407cc9e365d33e444f558a089781 100644 (file)
@@ -4,7 +4,7 @@
           [forceIdentifier]="true"
           [selectionType]="selectionType"
           columnMode="flex"
-          [autoReload]="false"
+          (fetchData)="getDevices()"
           [searchField]="false"
           (updateSelection)="updateSelection($event)"
           (columnFiltersChanged)="onColumnFiltersChanged($event)">
index 5fce0381cd2a5c51c2d3b3ae2c9458a80d79aa0f..29a3ece96d8ae6c695283f5ea3610ef9d368ede9 100644 (file)
@@ -7,6 +7,7 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
+import { HostService } from '~/app/shared/api/host.service';
 import { OrchestratorService } from '~/app/shared/api/orchestrator.service';
 import { TableActionsComponent } from '~/app/shared/datatable/table-actions/table-actions.component';
 import { CdTableAction } from '~/app/shared/models/cd-table-action';
@@ -23,6 +24,7 @@ describe('InventoryDevicesComponent', () => {
   let component: InventoryDevicesComponent;
   let fixture: ComponentFixture<InventoryDevicesComponent>;
   let orchService: OrchestratorService;
+  let hostService: HostService;
 
   const fakeAuthStorageService = {
     getPermissions: () => {
@@ -59,6 +61,7 @@ describe('InventoryDevicesComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(InventoryDevicesComponent);
     component = fixture.componentInstance;
+    hostService = TestBed.inject(HostService);
     orchService = TestBed.inject(OrchestratorService);
   });
 
@@ -70,6 +73,15 @@ describe('InventoryDevicesComponent', () => {
     expect(component.columns.every((column) => Boolean(column.prop))).toBeTruthy();
   });
 
+  it('should call inventoryDataList only when showOnlyAvailableData is true', () => {
+    const hostServiceSpy = spyOn(hostService, 'inventoryDeviceList').and.callThrough();
+    component.getDevices();
+    expect(hostServiceSpy).toBeCalledTimes(0);
+    component.showAvailDeviceOnly = true;
+    component.getDevices();
+    expect(hostServiceSpy).toBeCalledTimes(1);
+  });
+
   describe('table actions', () => {
     const fakeDevices = require('./fixtures/inventory_list_response.json');
 
index fa778d5b4f29bbb49e0c5195cb728df0c2fbdb40..e0d82cb1975db7e749cdb6c9bfe7bfe020b3fcc5 100644 (file)
@@ -43,6 +43,7 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
   // Devices
   @Input() devices: InventoryDevice[] = [];
 
+  @Input() showAvailDeviceOnly = false;
   // Do not display these columns
   @Input() hiddenColumns: string[] = [];
 
@@ -175,6 +176,22 @@ export class InventoryDevicesComponent implements OnInit, OnDestroy {
     }
   }
 
+  getDevices() {
+    if (this.showAvailDeviceOnly) {
+      this.hostService.inventoryDeviceList().subscribe(
+        (devices: InventoryDevice[]) => {
+          this.devices = _.filter(devices, 'available');
+          this.devices = [...this.devices];
+        },
+        () => {
+          this.devices = [];
+        }
+      );
+    } else {
+      this.devices = [...this.devices];
+    }
+  }
+
   ngOnDestroy() {
     if (this.fetchInventorySub) {
       this.fetchInventorySub.unsubscribe();
index da24403dee1e11895eb81de93385a1c6e8eaf0c8..dd60f7959fd9d1eac78772a5812ecd044302dcc0 100644 (file)
@@ -52,17 +52,16 @@ describe('InventoryComponent', () => {
   describe('after ngOnInit', () => {
     it('should load devices', () => {
       fixture.detectChanges();
-      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(1, undefined, false);
       component.refresh(); // click refresh button
-      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(2, undefined, true);
+      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(1, undefined, false);
 
       const newHost = 'host0';
       component.hostname = newHost;
       fixture.detectChanges();
       component.ngOnChanges();
-      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(3, newHost, false);
+      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(2, newHost, false);
       component.refresh(); // click refresh button
-      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(4, newHost, true);
+      expect(hostService.inventoryDeviceList).toHaveBeenNthCalledWith(3, newHost, true);
     });
   });
 });
index bfbf3dcf143b426318cc5535e9d56b763b5ffe5e..8b1f59eac371c922d991abbe2cac964936dff1f9 100644 (file)
@@ -19,7 +19,7 @@
               (click)="showSelectionModal()"
               data-toggle="tooltip"
               [title]="addButtonTooltip"
-              [disabled]="availDevices.length === 0 || !canSelect">
+              [disabled]="availDevices.length === 0 || !canSelect || expansionCanSelect">
         <i [ngClass]="[icons.add]"></i>
         <ng-container i18n>Add</ng-container>
       </button>
index 0d9250000616cfc69c9c50946170b8bcbc7517d4..dea6746cf95125511231bcc1f3722b3f078f08eb 100644 (file)
@@ -2,6 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { FormsModule } from '@angular/forms';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { RouterTestingModule } from '@angular/router/testing';
 
 import { ToastrModule } from 'ngx-toastr';
 
@@ -34,7 +35,8 @@ describe('OsdDevicesSelectionGroupsComponent', () => {
       FormsModule,
       HttpClientTestingModule,
       SharedModule,
-      ToastrModule.forRoot()
+      ToastrModule.forRoot(),
+      RouterTestingModule
     ],
     declarations: [OsdDevicesSelectionGroupsComponent, InventoryDevicesComponent]
   });
@@ -92,8 +94,10 @@ describe('OsdDevicesSelectionGroupsComponent', () => {
 
   describe('with devices selected', () => {
     beforeEach(() => {
+      component.isOsdPage = true;
       component.availDevices = [];
       component.devices = devices;
+      component.ngOnInit();
       fixture.detectChanges();
     });
 
index bbeb8b0f0cee3891db3ec9504f60bb19a191a1cc..cff0cbc0563fc8a39f146933a256042bd47fb204 100644 (file)
@@ -1,8 +1,10 @@
 import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
+import { Router } from '@angular/router';
 
 import _ from 'lodash';
 
 import { InventoryDevice } from '~/app/ceph/cluster/inventory/inventory-devices/inventory-device.model';
+import { OsdService } from '~/app/shared/api/osd.service';
 import { Icons } from '~/app/shared/enum/icons.enum';
 import { CdTableColumnFiltersChange } from '~/app/shared/models/cd-table-column-filters-change';
 import { ModalService } from '~/app/shared/services/modal.service';
@@ -37,7 +39,9 @@ export class OsdDevicesSelectionGroupsComponent implements OnInit, OnChanges {
   icons = Icons;
   devices: InventoryDevice[] = [];
   capacity = 0;
-  appliedFilters: any[] = [];
+  appliedFilters = new Array();
+  expansionCanSelect = false;
+  isOsdPage: boolean;
 
   addButtonTooltip: String;
   tooltips = {
@@ -46,9 +50,24 @@ export class OsdDevicesSelectionGroupsComponent implements OnInit, OnChanges {
     addByFilters: $localize`Add devices by using filters`
   };
 
-  constructor(private modalService: ModalService) {}
+  constructor(
+    private modalService: ModalService,
+    public osdService: OsdService,
+    private router: Router
+  ) {
+    this.isOsdPage = this.router.url.includes('/osd');
+  }
 
   ngOnInit() {
+    if (!this.isOsdPage) {
+      this.osdService?.osdDevices[this.type]
+        ? (this.devices = this.osdService.osdDevices[this.type])
+        : (this.devices = []);
+      this.capacity = _.sumBy(this.devices, 'sys_api.size');
+      this.osdService?.osdDevices
+        ? (this.expansionCanSelect = this.osdService?.osdDevices['disableSelect'])
+        : (this.expansionCanSelect = false);
+    }
     this.updateAddButtonTooltip();
   }
 
@@ -75,6 +94,12 @@ export class OsdDevicesSelectionGroupsComponent implements OnInit, OnChanges {
       this.capacity = _.sumBy(this.devices, 'sys_api.size');
       this.appliedFilters = result.filters;
       const event = _.assign({ type: this.type }, result);
+      if (!this.isOsdPage) {
+        this.osdService.osdDevices[this.type] = this.devices;
+        this.osdService.osdDevices['disableSelect'] =
+          this.canSelect || this.devices.length === this.availDevices.length;
+        this.osdService.osdDevices[this.type]['capacity'] = this.capacity;
+      }
       this.selected.emit(event);
     });
   }
@@ -95,6 +120,11 @@ export class OsdDevicesSelectionGroupsComponent implements OnInit, OnChanges {
   }
 
   clearDevices() {
+    if (!this.isOsdPage) {
+      this.expansionCanSelect = false;
+      this.osdService.osdDevices['disableSelect'] = false;
+      this.osdService.osdDevices = [];
+    }
     const event = {
       type: this.type,
       clearedDevices: [...this.devices]
index 30effc21b53e2baa84ec6dd6ed2309a2ed80b69d..3e53d5c410cd2ceef6a12e5130883f1ea12804bf 100644 (file)
@@ -20,6 +20,7 @@
         <cd-inventory-devices #inventoryDevices
                               [devices]="devices"
                               [filterColumns]="filterColumns"
+                              [showAvailDeviceOnly]="true"
                               [hiddenColumns]="['available', 'osd_ids']"
                               (filterChange)="onFilterChange($event)">
         </cd-inventory-devices>
index fe77a4fe4d8a04d3305d47f110b214891150dcf8..edfe9d6a7c3e208243e3a1dc63ca764da9da3bdd 100644 (file)
@@ -11,6 +11,7 @@ import { Icons } from '~/app/shared/enum/icons.enum';
 import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder';
 import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
 import { CdTableColumnFiltersChange } from '~/app/shared/models/cd-table-column-filters-change';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
 
 @Component({
   selector: 'cd-osd-devices-selection-modal',
@@ -42,7 +43,8 @@ export class OsdDevicesSelectionModalComponent implements AfterViewInit {
   constructor(
     private formBuilder: CdFormBuilder,
     public activeModal: NgbActiveModal,
-    public actionLabels: ActionLabelsI18n
+    public actionLabels: ActionLabelsI18n,
+    public wizardStepService: WizardStepsService
   ) {
     this.action = actionLabels.ADD;
     this.createForm();
index e85223c80e39ce950830871a5f9f6eddeb036f6f..93c9e9adcbbf0484aeed02dfb40905a5eb7bf6e1 100644 (file)
@@ -1,6 +1,7 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule } from '@angular/forms';
+import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
@@ -26,7 +27,8 @@ describe('OsdFlagsIndivModalComponent', () => {
       ReactiveFormsModule,
       SharedModule,
       ToastrModule.forRoot(),
-      NgbTooltipModule
+      NgbTooltipModule,
+      RouterTestingModule
     ],
     declarations: [OsdFlagsIndivModalComponent],
     providers: [NgbActiveModal]
index 0f1a5de6dee88d291c0743e2194b7a14012f64a6..59a17362f6f834eb55da7c9f3999e8e90202dbbc 100644 (file)
@@ -8,7 +8,8 @@
         novalidate>
     <div class="card">
       <div i18n="form title|Example: Create Pool@@formTitle"
-           class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
+           class="card-header"
+           *ngIf="!hideTitle">{{ action | titlecase }} {{ resource | upperFirst }}</div>
       <div class="card-body">
         <fieldset>
           <cd-osd-devices-selection-groups #dataDeviceSelectionGroups
           </div>
         </fieldset>
       </div>
-      <div class="card-footer">
+      <div class="card-footer"
+           *ngIf="!hideSubmitBtn">
         <cd-form-button-panel #previewButtonPanel
                               (submitActionEvent)="submit()"
                               [form]="form"
index 7b6c44742a75684c5eaabc7252341bfe64bf68ce..9f229b66f8c24e7466968d2c52d6141320b53af0 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
 import { FormControl, Validators } from '@angular/forms';
 import { Router } from '@angular/router';
 
@@ -15,6 +15,7 @@ import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
 import { CdTableColumn } from '~/app/shared/models/cd-table-column';
 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 import { ModalService } from '~/app/shared/services/modal.service';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
 import { OsdCreationPreviewModalComponent } from '../osd-creation-preview-modal/osd-creation-preview-modal.component';
 import { DevicesSelectionChangeEvent } from '../osd-devices-selection-groups/devices-selection-change-event.interface';
 import { DevicesSelectionClearEvent } from '../osd-devices-selection-groups/devices-selection-clear-event.interface';
@@ -40,6 +41,14 @@ export class OsdFormComponent extends CdForm implements OnInit {
   @ViewChild('previewButtonPanel')
   previewButtonPanel: FormButtonPanelComponent;
 
+  @Input()
+  hideTitle = false;
+
+  @Input()
+  hideSubmitBtn = false;
+
+  @Output() emitDriveGroup: EventEmitter<DriveGroup> = new EventEmitter();
+
   icons = Icons;
 
   form: CdFormGroup;
@@ -68,7 +77,8 @@ export class OsdFormComponent extends CdForm implements OnInit {
     private orchService: OrchestratorService,
     private hostService: HostService,
     private router: Router,
-    private modalService: ModalService
+    private modalService: ModalService,
+    public wizardStepService: WizardStepsService
   ) {
     super();
     this.resource = $localize`OSDs`;
@@ -182,6 +192,8 @@ export class OsdFormComponent extends CdForm implements OnInit {
       this.enableFeatures();
     }
     this.driveGroup.setDeviceSelection(event.type, event.filters);
+
+    this.emitDriveGroup.emit(this.driveGroup);
   }
 
   onDevicesCleared(event: DevicesSelectionClearEvent) {
index 841f41b575a6d9c2ddb581b8d234c7d44a579cc3..fa263672246a803cc4e834f2f2e5ffb96df75476 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index 0066784a86409b49fa0cc617c5717ce9b7ed6e9e..4ae7e8a31b33d37306dbd9b7ca66b4183db55904 100644 (file)
@@ -9,9 +9,10 @@
 <cd-table *ngIf="isPrometheusConfigured"
           [data]="prometheusAlertService.rules"
           [columns]="columns"
+          [selectionType]="'single'"
           [hasDetails]="true"
-          (updateSelection)="setExpandedRow($event)"
-          [selectionType]="'single'">
+          (setExpandedRow)="setExpandedRow($event)"
+          (updateSelection)="updateSelection($event)">
   <cd-table-key-value cdTableDetail
                       *ngIf="expandedRow"
                       [data]="expandedRow"
index ce8928f7f0266e5c7700b8dd4f3ea5ab9d3312d9..02f04a06a4bcdd9ad8a497000862ad312b7ae9de 100644 (file)
@@ -63,9 +63,7 @@
         novalidate>
     <div class="card">
       <div class="card-header">
-        <span i18n="@@formTitle">
-          {{ action | titlecase }} {{ resource | upperFirst }}
-        </span>
+        <span i18n>{{ action | titlecase }} {{ resource | upperFirst }}</span>
         <cd-helper *ngIf="edit"
                    i18n>Editing a silence will expire the old silence and recreate it as a new silence</cd-helper>
       </div>
index 5a8116d5a288ac3ed3701c8af682999e6bf1896f..3aeb04eade7afde501fd649179cd1b4f0f8313b5 100644 (file)
 
 <ng-template #listTpl
              let-events="value">
-  <div *ngIf="events.length == 0 || events == undefined">
-    <span>No data available</span>
-  </div>
-  <div *ngIf="events.length != 0 && events != undefined"
-       class="ul-margin">
-    <ul *ngFor="let event of events; trackBy:trackByFn">
-      <li><b>{{ event.created | relativeDate }} - </b>
+  <ul class="list-group list-group-flush"
+      *ngIf="events?.length else noEventsAvailable">
+    <li class="list-group-item"
+        *ngFor="let event of events; trackBy:trackByFn">
+      <b>{{ event.created | relativeDate }} - </b>
       <span class="badge badge-info">{{ event.subject }}</span><br>
-      <span *ngIf="event.level == 'INFO'">
+      <span *ngIf="event.level === 'INFO'">
       <i [ngClass]="[icons.infoCircle]"
          aria-hidden="true"></i>
       </span>
-      <span *ngIf="event.level == 'ERROR'">
+      <span *ngIf="event.level === 'ERROR'">
       <i [ngClass]="[icons.warning]"
          aria-hidden="true"></i>
       </span>
-      {{ event.message }}</li>
-    </ul>
-  </div>
+      {{ event.message }}
+    </li>
+  </ul>
+  <ng-template #noEventsAvailable>
+    <div *ngIf="events?.length === 0">
+      <span>No data available</span>
+    </div>
+  </ng-template>
 </ng-template>
index e24a734451b7e0958b336e0a945bca5cac2d6cce..5582d300ddac868077730438d00ad9739e139c58 100644 (file)
@@ -1,12 +1,13 @@
-<div class="cd-col-form">
-  <form #frm="ngForm"
-        [formGroup]="serviceForm"
-        novalidate>
-    <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
-           class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
+<cd-modal [pageURL]="pageURL"
+          [modalRef]="activeModal">
+  <span class="modal-title"
+        i18n>{{ action | titlecase }} {{ resource | upperFirst }}</span>
+  <ng-container class="modal-content">
+    <form #frm="ngForm"
+          [formGroup]="serviceForm"
+          novalidate>
+      <div class="modal-body">
 
-      <div class="card-body">
         <!-- Service type -->
         <div class="form-group row">
           <label class="cd-col-form-label required"
           </div>
         </div>
 
-        <!-- NFS -->
-        <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'nfs'">
-          <!-- pool -->
-          <div class="form-group row">
-            <label i18n
-                   class="cd-col-form-label required"
-                   for="pool">Pool</label>
-            <div class="cd-col-form-input">
-              <select id="pool"
-                      name="pool"
-                      class="form-control custom-select"
-                      formControlName="pool">
-                <option *ngIf="pools === null"
-                        [ngValue]="null"
-                        i18n>Loading...</option>
-                <option *ngIf="pools !== null && pools.length === 0"
-                        [ngValue]="null"
-                        i18n>-- No pools available --</option>
-                <option *ngIf="pools !== null && pools.length > 0"
-                        [ngValue]="null"
-                        i18n>-- Select a pool --</option>
-                <option *ngFor="let pool of pools"
-                        [value]="pool.pool_name">{{ pool.pool_name }}</option>
-              </select>
-              <span class="invalid-feedback"
-                    *ngIf="serviceForm.showError('pool', frm, 'required')"
-                    i18n>This field is required.</span>
-            </div>
-          </div>
-
-          <!-- namespace -->
-          <div class="form-group row">
-            <label i18n
-                   class="cd-col-form-label"
-                   for="namespace">Namespace</label>
-            <div class="cd-col-form-input">
-              <input id="namespace"
-                     class="form-control"
-                     type="text"
-                     formControlName="namespace">
-            </div>
-          </div>
-        </ng-container>
-
         <!-- RGW -->
         <ng-container *ngIf="!serviceForm.controls.unmanaged.value && serviceForm.controls.service_type.value === 'rgw'">
           <!-- rgw_frontend_port -->
                 <option *ngIf="pools === null"
                         [ngValue]="null"
                         i18n>Loading...</option>
-                <option *ngIf="pools !== null && pools.length === 0"
+                <option *ngIf="pools && pools.length === 0"
                         [ngValue]="null"
                         i18n>-- No pools available --</option>
-                <option *ngIf="pools !== null && pools.length > 0"
+                <option *ngIf="pools && pools.length > 0"
                         [ngValue]="null"
                         i18n>-- Select a pool --</option>
                 <option *ngFor="let pool of pools"
         </ng-container>
       </div>
 
-      <div class="card-footer">
+      <div class="modal-footer">
         <div class="text-right">
           <cd-form-button-panel (submitActionEvent)="onSubmit()"
                                 [form]="serviceForm"
                                 [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel>
         </div>
       </div>
-    </div>
-  </form>
-</div>
+    </form>
+  </ng-container>
+</cd-modal>
index 11c0663efd246fa85685ac7482d8b06a62735dd8..a1078b81ba2abd3da8bfb80b7ea5d31104d503ca 100644 (file)
@@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms';
 import { By } from '@angular/platform-browser';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgbActiveModal, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
 import _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
 
@@ -23,6 +23,7 @@ describe('ServiceFormComponent', () => {
 
   configureTestBed({
     declarations: [ServiceFormComponent],
+    providers: [NgbActiveModal],
     imports: [
       HttpClientTestingModule,
       NgbTypeaheadModule,
@@ -36,6 +37,7 @@ describe('ServiceFormComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(ServiceFormComponent);
     component = fixture.componentInstance;
+    component.ngOnInit();
     form = component.serviceForm;
     formHelper = new FormHelper(form);
     fixture.detectChanges();
@@ -142,28 +144,14 @@ describe('ServiceFormComponent', () => {
     describe('should test service nfs', () => {
       beforeEach(() => {
         formHelper.setValue('service_type', 'nfs');
-        formHelper.setValue('pool', 'foo');
       });
 
-      it('should submit nfs with namespace', () => {
-        formHelper.setValue('namespace', 'bar');
+      it('should submit nfs', () => {
         component.onSubmit();
         expect(cephServiceService.create).toHaveBeenCalledWith({
           service_type: 'nfs',
           placement: {},
-          unmanaged: false,
-          pool: 'foo',
-          namespace: 'bar'
-        });
-      });
-
-      it('should submit nfs w/o namespace', () => {
-        component.onSubmit();
-        expect(cephServiceService.create).toHaveBeenCalledWith({
-          service_type: 'nfs',
-          placement: {},
-          unmanaged: false,
-          pool: 'foo'
+          unmanaged: false
         });
       });
     });
@@ -445,5 +433,22 @@ x4Ea7kGVgx9kWh5XjWz9wjZvY49UKIT5ppIAWPMbLl3UpfckiuNhTA==
         formHelper.expectError('monitor_port', 'pattern');
       });
     });
+
+    describe('check edit fields', () => {
+      beforeEach(() => {
+        component.editing = true;
+      });
+
+      it('should check whether edit field is correctly loaded', () => {
+        const cephServiceSpy = spyOn(cephServiceService, 'list').and.callThrough();
+        component.ngOnInit();
+        expect(cephServiceSpy).toBeCalledTimes(2);
+        expect(component.action).toBe('Edit');
+        const serviceType = fixture.debugElement.query(By.css('#service_type')).nativeElement;
+        const serviceId = fixture.debugElement.query(By.css('#service_id')).nativeElement;
+        expect(serviceType.disabled).toBeTruthy();
+        expect(serviceId.disabled).toBeTruthy();
+      });
+    });
   });
 });
index cb80a2571c0ae73a2a474b555d0f2bdf54aa339c..6db898f0aa847cf4c350085703a031e913a84b10 100644 (file)
@@ -1,8 +1,8 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, Input, OnInit, ViewChild } from '@angular/core';
 import { AbstractControl, Validators } from '@angular/forms';
-import { Router } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
 
-import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
+import { NgbActiveModal, NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
 import _ from 'lodash';
 import { merge, Observable, Subject } from 'rxjs';
 import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators';
@@ -31,6 +31,14 @@ export class ServiceFormComponent extends CdForm implements OnInit {
   @ViewChild(NgbTypeahead, { static: false })
   typeahead: NgbTypeahead;
 
+  @Input() hiddenServices: string[] = [];
+
+  @Input() editing = false;
+
+  @Input() serviceName: string;
+
+  @Input() serviceType: string;
+
   serviceForm: CdFormGroup;
   action: string;
   resource: string;
@@ -41,6 +49,7 @@ export class ServiceFormComponent extends CdForm implements OnInit {
   labelFocus = new Subject<string>();
   pools: Array<object>;
   services: Array<CephServiceSpec> = [];
+  pageURL: string;
 
   constructor(
     public actionLabels: ActionLabelsI18n,
@@ -49,7 +58,9 @@ export class ServiceFormComponent extends CdForm implements OnInit {
     private hostService: HostService,
     private poolService: PoolService,
     private router: Router,
-    private taskWrapperService: TaskWrapperService
+    private taskWrapperService: TaskWrapperService,
+    private route: ActivatedRoute,
+    public activeModal: NgbActiveModal
   ) {
     super();
     this.resource = $localize`service`;
@@ -111,22 +122,16 @@ export class ServiceFormComponent extends CdForm implements OnInit {
       hosts: [[]],
       count: [null, [CdValidators.number(false), Validators.min(1)]],
       unmanaged: [false],
-      // NFS & iSCSI
+      // iSCSI
       pool: [
         null,
         [
-          CdValidators.requiredIf({
-            service_type: 'nfs',
-            unmanaged: false
-          }),
           CdValidators.requiredIf({
             service_type: 'iscsi',
             unmanaged: false
           })
         ]
       ],
-      // NFS
-      namespace: [null],
       // RGW
       rgw_frontend_port: [
         null,
@@ -216,13 +221,25 @@ export class ServiceFormComponent extends CdForm implements OnInit {
 
   ngOnInit(): void {
     this.action = this.actionLabels.CREATE;
+    if (this.router.url.includes('services/(modal:create')) {
+      this.pageURL = 'services';
+    } else if (this.router.url.includes('services/(modal:edit')) {
+      this.editing = true;
+      this.pageURL = 'services';
+      this.route.params.subscribe((params: { type: string; name: string }) => {
+        this.serviceName = params.name;
+        this.serviceType = params.type;
+      });
+    }
     this.cephServiceService.getKnownTypes().subscribe((resp: Array<string>) => {
       // Remove service types:
       // osd       - This is deployed a different way.
       // container - This should only be used in the CLI.
-      this.serviceTypes = _.difference(resp, ['container', 'osd']).sort();
+      this.hiddenServices.push('osd', 'container');
+
+      this.serviceTypes = _.difference(resp, this.hiddenServices).sort();
     });
-    this.hostService.list().subscribe((resp: object[]) => {
+    this.hostService.list('false').subscribe((resp: object[]) => {
       const options: SelectOption[] = [];
       _.forEach(resp, (host: object) => {
         if (_.get(host, 'sources.orchestrator', false)) {
@@ -241,10 +258,79 @@ export class ServiceFormComponent extends CdForm implements OnInit {
     this.cephServiceService.list().subscribe((services: CephServiceSpec[]) => {
       this.services = services.filter((service: any) => service.service_type === 'rgw');
     });
+
+    if (this.editing) {
+      this.action = this.actionLabels.EDIT;
+      this.disableForEditing(this.serviceType);
+      this.cephServiceService.list(this.serviceName).subscribe((response: CephServiceSpec[]) => {
+        const formKeys = ['service_type', 'service_id', 'unmanaged'];
+        formKeys.forEach((keys) => {
+          this.serviceForm.get(keys).setValue(response[0][keys]);
+        });
+        if (!response[0]['unmanaged']) {
+          const placementKey = Object.keys(response[0]['placement'])[0];
+          let placementValue: string;
+          ['hosts', 'label'].indexOf(placementKey) >= 0
+            ? (placementValue = placementKey)
+            : (placementValue = 'hosts');
+          this.serviceForm.get('placement').setValue(placementValue);
+          this.serviceForm.get('count').setValue(response[0]['placement']['count']);
+          if (response[0]?.placement[placementValue]) {
+            this.serviceForm.get(placementValue).setValue(response[0]?.placement[placementValue]);
+          }
+        }
+        switch (this.serviceType) {
+          case 'iscsi':
+            const specKeys = ['pool', 'api_password', 'api_user', 'trusted_ip_list', 'api_port'];
+            specKeys.forEach((key) => {
+              this.serviceForm.get(key).setValue(response[0].spec[key]);
+            });
+            this.serviceForm.get('ssl').setValue(response[0].spec?.api_secure);
+            if (response[0].spec?.api_secure) {
+              this.serviceForm.get('ssl_cert').setValue(response[0].spec?.ssl_cert);
+              this.serviceForm.get('ssl_key').setValue(response[0].spec?.ssl_key);
+            }
+            break;
+          case 'rgw':
+            this.serviceForm.get('rgw_frontend_port').setValue(response[0].spec?.rgw_frontend_port);
+            this.serviceForm.get('ssl').setValue(response[0].spec?.ssl);
+            if (response[0].spec?.ssl) {
+              this.serviceForm
+                .get('ssl_cert')
+                .setValue(response[0].spec?.rgw_frontend_ssl_certificate);
+            }
+            break;
+          case 'ingress':
+            const ingressSpecKeys = [
+              'backend_service',
+              'virtual_ip',
+              'frontend_port',
+              'monitor_port',
+              'virtual_interface_networks',
+              'ssl'
+            ];
+            ingressSpecKeys.forEach((key) => {
+              this.serviceForm.get(key).setValue(response[0].spec[key]);
+            });
+            if (response[0].spec?.ssl) {
+              this.serviceForm.get('ssl_cert').setValue(response[0].spec?.ssl_cert);
+              this.serviceForm.get('ssl_key').setValue(response[0].spec?.ssl_key);
+            }
+            break;
+        }
+      });
+    }
   }
 
-  goToListView() {
-    this.router.navigate(['/services']);
+  disableForEditing(serviceType: string) {
+    const disableForEditKeys = ['service_type', 'service_id'];
+    disableForEditKeys.forEach((key) => {
+      this.serviceForm.get(key).disable();
+    });
+    switch (serviceType) {
+      case 'ingress':
+        this.serviceForm.get('backend_service').disable();
+    }
   }
 
   searchLabels = (text$: Observable<string>) => {
@@ -283,8 +369,12 @@ export class ServiceFormComponent extends CdForm implements OnInit {
 
   onSubmit() {
     const self = this;
-    const values: object = this.serviceForm.value;
+    const values: object = this.serviceForm.getRawValue();
     const serviceType: string = values['service_type'];
+    let taskUrl = `service/${URLVerbs.CREATE}`;
+    if (this.editing) {
+      taskUrl = `service/${URLVerbs.EDIT}`;
+    }
     const serviceSpec: object = {
       service_type: serviceType,
       placement: {},
@@ -322,19 +412,13 @@ export class ServiceFormComponent extends CdForm implements OnInit {
         serviceSpec['placement']['count'] = values['count'];
       }
       switch (serviceType) {
-        case 'nfs':
-          serviceSpec['pool'] = values['pool'];
-          if (_.isString(values['namespace']) && !_.isEmpty(values['namespace'])) {
-            serviceSpec['namespace'] = values['namespace'];
-          }
-          break;
         case 'rgw':
           if (_.isNumber(values['rgw_frontend_port']) && values['rgw_frontend_port'] > 0) {
             serviceSpec['rgw_frontend_port'] = values['rgw_frontend_port'];
           }
           serviceSpec['ssl'] = values['ssl'];
           if (values['ssl']) {
-            serviceSpec['rgw_frontend_ssl_certificate'] = values['ssl_cert'].trim();
+            serviceSpec['rgw_frontend_ssl_certificate'] = values['ssl_cert']?.trim();
           }
           break;
         case 'iscsi':
@@ -349,8 +433,8 @@ export class ServiceFormComponent extends CdForm implements OnInit {
           serviceSpec['api_password'] = values['api_password'];
           serviceSpec['api_secure'] = values['ssl'];
           if (values['ssl']) {
-            serviceSpec['ssl_cert'] = values['ssl_cert'].trim();
-            serviceSpec['ssl_key'] = values['ssl_key'].trim();
+            serviceSpec['ssl_cert'] = values['ssl_cert']?.trim();
+            serviceSpec['ssl_key'] = values['ssl_key']?.trim();
           }
           break;
         case 'ingress':
@@ -367,16 +451,17 @@ export class ServiceFormComponent extends CdForm implements OnInit {
           }
           serviceSpec['ssl'] = values['ssl'];
           if (values['ssl']) {
-            serviceSpec['ssl_cert'] = values['ssl_cert'].trim();
-            serviceSpec['ssl_key'] = values['ssl_key'].trim();
+            serviceSpec['ssl_cert'] = values['ssl_cert']?.trim();
+            serviceSpec['ssl_key'] = values['ssl_key']?.trim();
           }
           serviceSpec['virtual_interface_networks'] = values['virtual_interface_networks'];
           break;
       }
     }
+
     this.taskWrapperService
       .wrapTaskAroundCall({
-        task: new FinishedTask(`service/${URLVerbs.CREATE}`, {
+        task: new FinishedTask(taskUrl, {
           service_name: serviceName
         }),
         call: this.cephServiceService.create(serviceSpec)
@@ -385,8 +470,10 @@ export class ServiceFormComponent extends CdForm implements OnInit {
         error() {
           self.serviceForm.setErrors({ cdSubmitButton: true });
         },
-        complete() {
-          self.goToListView();
+        complete: () => {
+          this.pageURL === 'services'
+            ? this.router.navigate([this.pageURL, { outlets: { modal: null } }])
+            : this.activeModal.close();
         }
       });
   }
index f6f66ee51485f337197a1fffa136b93db2fb7946..36ab431fc96b32b73b5bbfb0688a3781a9096e14 100644 (file)
@@ -8,7 +8,7 @@
             selectionType="single"
             [autoReload]="5000"
             (fetchData)="getServices($event)"
-            [hasDetails]="true"
+            [hasDetails]="hasDetails"
             (setExpandedRow)="setExpandedRow($event)"
             (updateSelection)="updateSelection($event)">
     <cd-table-actions class="table-actions"
@@ -22,3 +22,4 @@
     </cd-service-details>
   </cd-table>
 </ng-container>
+<router-outlet name="modal"></router-outlet>
index 7cba81ee49eab486c95e88cbbdb70609058c48db..318a54a6ee4589f892f65c327617a4b1e6f897cd 100644 (file)
@@ -1,5 +1,7 @@
 import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
 
+import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
 import { delay } from 'rxjs/operators';
 
 import { CephServiceService } from '~/app/shared/api/ceph-service.service';
@@ -24,6 +26,7 @@ import { ModalService } from '~/app/shared/services/modal.service';
 import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
 import { URLBuilderService } from '~/app/shared/services/url-builder.service';
 import { PlacementPipe } from './placement.pipe';
+import { ServiceFormComponent } from './service-form/service-form.component';
 
 const BASE_URL = 'services';
 
@@ -42,13 +45,21 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
   // Do not display these columns
   @Input() hiddenColumns: string[] = [];
 
+  @Input() hiddenServices: string[] = [];
+
+  @Input() hasDetails = true;
+
+  @Input() routedModal = true;
+
   permissions: Permissions;
   tableActions: CdTableAction[];
   showDocPanel = false;
+  bsModalRef: NgbModalRef;
 
   orchStatus: OrchestratorStatus;
   actionOrchFeatures = {
     create: [OrchestratorFeature.SERVICE_CREATE],
+    update: [OrchestratorFeature.SERVICE_EDIT],
     delete: [OrchestratorFeature.SERVICE_DELETE]
   };
 
@@ -65,7 +76,7 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
     private cephServiceService: CephServiceService,
     private relativeDatePipe: RelativeDatePipe,
     private taskWrapperService: TaskWrapperService,
-    private urlBuilder: URLBuilderService
+    private router: Router
   ) {
     super();
     this.permissions = this.authStorageService.getPermissions();
@@ -73,11 +84,18 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
       {
         permission: 'create',
         icon: Icons.add,
-        routerLink: () => this.urlBuilder.getCreate(),
+        click: () => this.openModal(),
         name: this.actionLabels.CREATE,
         canBePrimary: (selection: CdTableSelection) => !selection.hasSelection,
         disable: (selection: CdTableSelection) => this.getDisable('create', selection)
       },
+      {
+        permission: 'update',
+        icon: Icons.edit,
+        click: () => this.openModal(true),
+        name: this.actionLabels.EDIT,
+        disable: (selection: CdTableSelection) => this.getDisable('update', selection)
+      },
       {
         permission: 'delete',
         icon: Icons.destroy,
@@ -88,6 +106,39 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
     ];
   }
 
+  openModal(edit = false) {
+    if (this.routedModal) {
+      edit
+        ? this.router.navigate([
+            BASE_URL,
+            {
+              outlets: {
+                modal: [
+                  URLVerbs.EDIT,
+                  this.selection.first().service_type,
+                  this.selection.first().service_name
+                ]
+              }
+            }
+          ])
+        : this.router.navigate([BASE_URL, { outlets: { modal: [URLVerbs.CREATE] } }]);
+    } else {
+      let initialState = {};
+      edit
+        ? (initialState = {
+            serviceName: this.selection.first()?.service_name,
+            serviceType: this.selection?.first()?.service_type,
+            hiddenServices: this.hiddenServices,
+            editing: edit
+          })
+        : (initialState = {
+            hiddenServices: this.hiddenServices,
+            editing: edit
+          });
+      this.bsModalRef = this.modalService.show(ServiceFormComponent, initialState, { size: 'lg' });
+    }
+  }
+
   ngOnInit() {
     const columns = [
       {
@@ -136,12 +187,21 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
     }
   }
 
-  getDisable(action: 'create' | 'delete', selection: CdTableSelection): boolean | string {
+  getDisable(
+    action: 'create' | 'update' | 'delete',
+    selection: CdTableSelection
+  ): boolean | string {
     if (action === 'delete') {
       if (!selection?.hasSingleSelection) {
         return true;
       }
     }
+    if (action === 'update') {
+      const disableEditServices = ['osd', 'container'];
+      if (disableEditServices.indexOf(this.selection.first()?.service_type) >= 0) {
+        return true;
+      }
+    }
     return this.orchService.getTableActionDisableDesc(
       this.orchStatus,
       this.actionOrchFeatures[action]
@@ -156,6 +216,9 @@ export class ServicesComponent extends ListWithDetails implements OnChanges, OnI
     this.cephServiceService.list().subscribe(
       (services: CephServiceSpec[]) => {
         this.services = services;
+        this.services = this.services.filter((col: any) => {
+          return !this.hiddenServices.includes(col.service_name);
+        });
         this.isLoadingServices = false;
       },
       () => {
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/models/nfs.fsal.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/models/nfs.fsal.ts
new file mode 100644 (file)
index 0000000..f204ac6
--- /dev/null
@@ -0,0 +1,5 @@
+export interface NfsFSAbstractionLayer {
+  value: string;
+  descr: string;
+  disabled: boolean;
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-cluster-type.enum.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-cluster-type.enum.ts
deleted file mode 100644 (file)
index 7a775e5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-export enum NFSClusterType {
-  user = 'user',
-  orchestrator = 'orchestrator'
-}
index 3abae2ee88e999e82faf3ad1e4ceac5b93b1d894..fcf5305393cba5a345a07bab57369e11bafb3d48 100644 (file)
@@ -25,18 +25,15 @@ describe('NfsDetailsComponent', () => {
     fixture = TestBed.createComponent(NfsDetailsComponent);
     component = fixture.componentInstance;
 
-    component.selection = undefined;
     component.selection = {
       export_id: 1,
       path: '/qwe',
       fsal: { name: 'CEPH', user_id: 'fs', fs_name: 1 },
       cluster_id: 'cluster1',
-      daemons: ['node1', 'node2'],
       pseudo: '/qwe',
-      tag: 'asd',
       access_type: 'RW',
       squash: 'no_root_squash',
-      protocols: [3, 4],
+      protocols: [4],
       transports: ['TCP', 'UDP'],
       clients: [
         {
@@ -44,9 +41,7 @@ describe('NfsDetailsComponent', () => {
           access_type: 'RW',
           squash: 'root_id_squash'
         }
-      ],
-      id: 'cluster1:1',
-      state: 'LOADING'
+      ]
     };
     component.ngOnChanges();
     fixture.detectChanges();
@@ -62,8 +57,7 @@ describe('NfsDetailsComponent', () => {
       'CephFS Filesystem': 1,
       'CephFS User': 'fs',
       Cluster: 'cluster1',
-      Daemons: ['node1', 'node2'],
-      'NFS Protocol': ['NFSv3', 'NFSv4'],
+      'NFS Protocol': ['NFSv4'],
       Path: '/qwe',
       Pseudo: '/qwe',
       'Security Label': undefined,
@@ -77,7 +71,7 @@ describe('NfsDetailsComponent', () => {
     const newData = _.assignIn(component.selection, {
       fsal: {
         name: 'RGW',
-        rgw_user_id: 'rgw_user_id'
+        user_id: 'user-id'
       }
     });
     component.selection = newData;
@@ -85,9 +79,8 @@ describe('NfsDetailsComponent', () => {
     expect(component.data).toEqual({
       'Access Type': 'RW',
       Cluster: 'cluster1',
-      Daemons: ['node1', 'node2'],
-      'NFS Protocol': ['NFSv3', 'NFSv4'],
-      'Object Gateway User': 'rgw_user_id',
+      'NFS Protocol': ['NFSv4'],
+      'Object Gateway User': 'user-id',
       Path: '/qwe',
       Pseudo: '/qwe',
       Squash: 'no_root_squash',
index 25a42416f7e36e68212f23fdf7a556ffead99371..5a84bd52e9da96f90da70cd8f48484edea83840f 100644 (file)
@@ -45,7 +45,6 @@ export class NfsDetailsComponent implements OnChanges {
 
       this.data = {};
       this.data[$localize`Cluster`] = this.selectedItem.cluster_id;
-      this.data[$localize`Daemons`] = this.selectedItem.daemons;
       this.data[$localize`NFS Protocol`] = this.selectedItem.protocols.map(
         (protocol: string) => 'NFSv' + protocol
       );
@@ -62,7 +61,7 @@ export class NfsDetailsComponent implements OnChanges {
         this.data[$localize`Security Label`] = this.selectedItem.fsal.sec_label_xattr;
       } else {
         this.data[$localize`Storage Backend`] = $localize`Object Gateway`;
-        this.data[$localize`Object Gateway User`] = this.selectedItem.fsal.rgw_user_id;
+        this.data[$localize`Object Gateway User`] = this.selectedItem.fsal.user_id;
       }
     }
   }
index 4f84f8e03b75ee86ae1905a4f18fdb9bb301354c..074bb8d79ce943f9f5427e8efa1677e098dfda6f 100644 (file)
     </span>
 
     <ng-container formArrayName="clients">
-      <div *ngFor="let item of form.get('clients').value; let index = index; trackBy: trackByFn">
+      <div *ngFor="let item of clientsFormArray.controls; let index = index; trackBy: trackByFn">
         <div class="card"
-             [formGroupName]="index">
+             [formGroup]="item">
           <div class="card-header">
             {{ (index + 1) | ordinal }}
             <span class="float-right clickable"
+                  name="remove_client"
                   (click)="removeClient(index)"
                   ngbTooltip="Remove">&times;</span>
           </div>
@@ -26,7 +27,7 @@
             <!-- Addresses -->
             <div class="form-group row">
               <label i18n
-                     class="cd-col-form-label"
+                     class="cd-col-form-label required"
                      for="addresses">Addresses</label>
               <div class="cd-col-form-input">
                 <input type="text"
 
             <!-- Squash -->
             <div class="form-group row">
-              <label i18n
-                     class="cd-col-form-label"
-                     for="squash">Squash</label>
+              <label class="cd-col-form-label"
+                     for="squash">
+                <span i18n>Squash</span>
+                <ng-container *ngTemplateOutlet="squashHelperTpl"></ng-container>
+              </label>
               <div class="cd-col-form-input">
                 <select class="form-control custom-select"
                         name="squash"
@@ -94,7 +97,8 @@
       <div class="col-12">
         <div class="float-right">
           <button class="btn btn-light "
-                  (click)="addClient()">
+                  (click)="addClient()"
+                  name="add_client">
             <i [ngClass]="[icons.add]"></i>
             <ng-container i18n>Add clients</ng-container>
           </button>
index 8423f177567952303c4f9979174d73d8492393ea..942e96e2eb9674aef87266bcab7beaf624878f83 100644 (file)
@@ -1,4 +1,4 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
 import { FormArray, FormControl, NgForm, Validators } from '@angular/forms';
 
 import _ from 'lodash';
@@ -19,9 +19,12 @@ export class NfsFormClientComponent implements OnInit {
   @Input()
   clients: any[];
 
+  @ContentChild('squashHelper', { static: true }) squashHelperTpl: TemplateRef<any>;
+
   nfsSquash: any[] = this.nfsService.nfsSquash;
   nfsAccessType: any[] = this.nfsService.nfsAccessType;
   icons = Icons;
+  clientsFormArray: FormArray;
 
   constructor(private nfsService: NfsService) {}
 
@@ -30,6 +33,7 @@ export class NfsFormClientComponent implements OnInit {
       const fg = this.addClient();
       fg.patchValue(client);
     });
+    this.clientsFormArray = this.form.get('clients') as FormArray;
   }
 
   getNoAccessTypeDescr() {
@@ -54,11 +58,10 @@ export class NfsFormClientComponent implements OnInit {
   }
 
   addClient() {
-    const clients = this.form.get('clients') as FormArray;
+    this.clientsFormArray = this.form.get('clients') as FormArray;
 
     const REGEX_IP = `(([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\.([0-9]{1,3})([/](\\d|[1-2]\\d|3[0-2]))?)`;
     const REGEX_LIST_IP = `${REGEX_IP}([ ,]{1,2}${REGEX_IP})*`;
-
     const fg = new CdFormGroup({
       addresses: new FormControl('', {
         validators: [Validators.required, Validators.pattern(REGEX_LIST_IP)]
@@ -67,13 +70,13 @@ export class NfsFormClientComponent implements OnInit {
       squash: new FormControl('')
     });
 
-    clients.push(fg);
+    this.clientsFormArray.push(fg);
     return fg;
   }
 
   removeClient(index: number) {
-    const clients = this.form.get('clients') as FormArray;
-    clients.removeAt(index);
+    this.clientsFormArray = this.form.get('clients') as FormArray;
+    this.clientsFormArray.removeAt(index);
   }
 
   showError(index: number, control: string, formDir: NgForm, x: string) {
@@ -81,8 +84,8 @@ export class NfsFormClientComponent implements OnInit {
   }
 
   getValue(index: number, control: string) {
-    const clients = this.form.get('clients') as FormArray;
-    const client = clients.at(index) as CdFormGroup;
+    this.clientsFormArray = this.form.get('clients') as FormArray;
+    const client = this.clientsFormArray.at(index) as CdFormGroup;
     return client.getValue(control);
   }
 
index 3da1e5820f70e8aa651d2cfe3aa07f444ee27fb3..97a59ae32606577f5020a660591bc7629d0f1ab3 100644 (file)
@@ -5,22 +5,25 @@
         [formGroup]="nfsForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
 
       <div class="card-body">
         <!-- cluster_id -->
-        <div class="form-group row"
-             *ngIf="!isDefaultCluster">
-          <label class="cd-col-form-label required"
-                 for="cluster_id"
-                 i18n>Cluster</label>
+        <div class="form-group row">
+          <label class="cd-col-form-label"
+                 for="cluster_id">
+            <span class="required"
+                  i18n>Cluster</span>
+            <cd-helper>
+              <p i18n>This is the ID of an NFS Service.</p>
+            </cd-helper>
+          </label>
           <div class="cd-col-form-input">
             <select class="form-control custom-select"
                     formControlName="cluster_id"
                     name="cluster_id"
-                    id="cluster_id"
-                    (change)="onClusterChange()">
+                    id="cluster_id">
               <option *ngIf="allClusters === null"
                       value=""
                       i18n>Loading...</option>
                       [value]="cluster.cluster_id">{{ cluster.cluster_id }}</option>
             </select>
             <span class="invalid-feedback"
-                  *ngIf="nfsForm.showError('cluster_id', formDir, 'required')"
-                  i18n>This field is required.</span>
-          </div>
-        </div>
-
-        <!-- daemons -->
-        <div class="form-group row"
-             *ngIf="clusterType">
-          <label class="cd-col-form-label"
-                 for="daemons">
-            <ng-container i18n>Daemons</ng-container>
-          </label>
-          <div class="cd-col-form-input">
-            <ng-container *ngFor="let daemon of nfsForm.getValue('daemons'); let i = index">
-              <div class="input-group cd-mb">
-                <input class="cd-form-control"
-                       type="text"
-                       [value]="daemon"
-                       disabled />
-                <span *ngIf="clusterType === 'user'"
-                      class="input-group-append">
-                  <button class="btn btn-light"
-                          type="button"
-                          (click)="removeDaemon(i, daemon)">
-                    <i [ngClass]="[icons.destroy]"
-                       aria-hidden="true"></i>
-                  </button>
-                </span>
-              </div>
-            </ng-container>
-
-            <div *ngIf="clusterType === 'user'"
-                 class="row">
-              <div class="col-md-12">
-                <cd-select [data]="nfsForm.get('daemons').value"
-                           [options]="daemonsSelections"
-                           [messages]="daemonsMessages"
-                           (selection)="onDaemonSelection()"
-                           elemClass="btn btn-light float-right">
-                  <i [ngClass]="[icons.add]"></i>
-                  <ng-container i18n>Add daemon</ng-container>
-                </cd-select>
-              </div>
-            </div>
-
-            <div *ngIf="clusterType === 'orchestrator'"
-                 class="row">
-              <div class="col-md-12">
-                <button type="button"
-                        class="btn btn-light float-right"
-                        (click)="onToggleAllDaemonsSelection()">
-                  <i [ngClass]="[icons.add]"></i>
-                  <ng-container *ngIf="nfsForm.getValue('daemons').length === 0; else hasDaemons"
-                                i18n>Add all daemons</ng-container>
-                  <ng-template #hasDaemons>
-                    <ng-container i18n>Remove all daemons</ng-container>
-                  </ng-template>
-                </button>
-              </div>
-            </div>
+                  *ngIf="nfsForm.showError('cluster_id', formDir, 'required') || allClusters?.length === 0"
+                  i18n>This field is required.
+                       To create a new NFS cluster, <a [routerLink]="['/services', {outlets: {modal: ['create']}}]"
+                                                       class="btn-link">add a new NFS Service</a>.</span>
           </div>
         </div>
 
                         value=""
                         i18n>-- Select the storage backend --</option>
                 <option *ngFor="let fsal of allFsals"
-                        [value]="fsal.value">{{ fsal.descr }}</option>
+                        [value]="fsal.value"
+                        [disabled]="fsal.disabled">{{ fsal.descr }}</option>
               </select>
               <span class="invalid-feedback"
                     *ngIf="nfsForm.showError('name', formDir, 'required')"
                     i18n>This field is required.</span>
-            </div>
-          </div>
-
-          <!-- RGW user -->
-          <div class="form-group row"
-               *ngIf="nfsForm.getValue('name') === 'RGW'">
-            <label class="cd-col-form-label required"
-                   for="rgw_user_id"
-                   i18n>Object Gateway User</label>
-            <div class="cd-col-form-input">
-              <select class="form-control custom-select"
-                      formControlName="rgw_user_id"
-                      name="rgw_user_id"
-                      id="rgw_user_id"
-                      (change)="rgwUserIdChangeHandler()">
-                <option *ngIf="allRgwUsers === null"
-                        value=""
-                        i18n>Loading...</option>
-                <option *ngIf="allRgwUsers !== null && allRgwUsers.length === 0"
-                        value=""
-                        i18n>-- No users available --</option>
-                <option *ngIf="allRgwUsers !== null && allRgwUsers.length > 0"
-                        value=""
-                        i18n>-- Select the object gateway user --</option>
-                <option *ngFor="let rgwUserId of allRgwUsers"
-                        [value]="rgwUserId">{{ rgwUserId }}</option>
-              </select>
-              <span class="invalid-feedback"
-                    *ngIf="nfsForm.showError('rgw_user_id', formDir, 'required')"
-                    i18n>This field is required.</span>
-            </div>
-          </div>
-
-          <!-- CephFS user_id -->
-          <div class="form-group row"
-               *ngIf="nfsForm.getValue('name') === 'CEPH'">
-            <label class="cd-col-form-label required"
-                   for="user_id"
-                   i18n>CephFS User ID</label>
-            <div class="cd-col-form-input">
-              <select class="form-control custom-select"
-                      formControlName="user_id"
-                      name="user_id"
-                      id="user_id">
-                <option *ngIf="allCephxClients === null"
-                        value=""
-                        i18n>Loading...</option>
-                <option *ngIf="allCephxClients !== null && allCephxClients.length === 0"
-                        value=""
-                        i18n>-- No clients available --</option>
-                <option *ngIf="allCephxClients !== null && allCephxClients.length > 0"
-                        value=""
-                        i18n>-- Select the cephx client --</option>
-                <option *ngFor="let client of allCephxClients"
-                        [value]="client">{{ client }}</option>
-              </select>
               <span class="invalid-feedback"
-                    *ngIf="nfsForm.showError('user_id', formDir, 'required')"
-                    i18n>This field is required.</span>
+                    *ngIf="fsalAvailabilityError"
+                    i18n>{{ fsalAvailabilityError }}</span>
             </div>
           </div>
 
-          <!-- CephFS fs_name -->
+          <!-- CephFS Volume -->
           <div class="form-group row"
                *ngIf="nfsForm.getValue('name') === 'CEPH'">
             <label class="cd-col-form-label required"
                    for="fs_name"
-                   i18n>CephFS Name</label>
+                   i18n>Volume</label>
             <div class="cd-col-form-input">
               <select class="form-control custom-select"
                       formControlName="fs_name"
                       name="fs_name"
                       id="fs_name"
-                      (change)="rgwUserIdChangeHandler()">
+                      (change)="pathChangeHandler()">
                 <option *ngIf="allFsNames === null"
                         value=""
                         i18n>Loading...</option>
         <!-- Path -->
         <div class="form-group row"
              *ngIf="nfsForm.getValue('name') === 'CEPH'">
-          <label class="cd-col-form-label required"
-                 for="path"
-                 i18n>CephFS Path</label>
+          <label class="cd-col-form-label"
+                 for="path">
+            <span class="required"
+                  i18n>CephFS Path</span>
+            <cd-helper>
+              <p i18n>A path in a CephFS file system.</p>
+            </cd-helper>
+          </label>
           <div class="cd-col-form-input">
             <input type="text"
                    class="form-control"
                    name="path"
                    id="path"
+                   data-testid="fs_path"
                    formControlName="path"
                    [ngbTypeahead]="pathDataSource"
                    (selectItem)="pathChangeHandler()"
             <span class="invalid-feedback"
                   *ngIf="nfsForm.showError('path', formDir, 'pattern')"
                   i18n>Path need to start with a '/' and can be followed by a word</span>
-            <span class="form-text text-muted"
-                  *ngIf="isNewDirectory && !nfsForm.showError('path', formDir)"
-                  i18n>New directory will be created</span>
+            <span class="invalid-feedback"
+                  *ngIf="nfsForm.showError('path', formDir, 'pathNameNotAllowed')"
+                  i18n>The path does not exist in the selected volume.</span>
           </div>
         </div>
 
         <!-- Bucket -->
         <div class="form-group row"
              *ngIf="nfsForm.getValue('name') === 'RGW'">
-          <label class="cd-col-form-label required"
-                 for="path"
-                 i18n>Path</label>
+          <label class="cd-col-form-label"
+                 for="path">
+            <span class="required"
+                  i18n>Bucket</span>
+          </label>
           <div class="cd-col-form-input">
             <input type="text"
                    class="form-control"
                    name="path"
                    id="path"
+                   data-testid="rgw_path"
                    formControlName="path"
-                   [ngbTypeahead]="bucketDataSource"
-                   (selectItem)="bucketChangeHandler()"
-                   (blur)="bucketChangeHandler()">
+                   [ngbTypeahead]="bucketDataSource">
 
             <span class="invalid-feedback"
                   *ngIf="nfsForm.showError('path', formDir, 'required')"
                   i18n>This field is required.</span>
-
             <span class="invalid-feedback"
-                  *ngIf="nfsForm.showError('path', formDir, 'pattern')"
-                  i18n>Path can only be a single '/' or a word</span>
-
-            <span class="form-text text-muted"
-                  *ngIf="isNewBucket && !nfsForm.showError('path', formDir)"
-                  i18n>New bucket will be created</span>
+                  *ngIf="nfsForm.showError('path', formDir, 'bucketNameNotAllowed')"
+                  i18n>The bucket does not exist or is not in the default realm (if multiple realms are configured).
+                       To continue, <a routerLink="/rgw/bucket/create"
+                                       class="btn-link">create a new bucket</a>.</span>
           </div>
         </div>
 
                  for="protocols"
                  i18n>NFS Protocol</label>
           <div class="cd-col-form-input">
-            <div class="custom-control custom-checkbox">
-              <input type="checkbox"
-                     class="custom-control-input"
-                     id="protocolNfsv3"
-                     name="protocolNfsv3"
-                     formControlName="protocolNfsv3"
-                     disabled>
-              <label i18n
-                     class="custom-control-label"
-                     for="protocolNfsv3">NFSv3</label>
-            </div>
             <div class="custom-control custom-checkbox">
               <input type="checkbox"
                      class="custom-control-input"
                      formControlName="protocolNfsv4"
                      name="protocolNfsv4"
-                     id="protocolNfsv4">
+                     id="protocolNfsv4"
+                     disabled>
               <label i18n
                      class="custom-control-label"
                      for="protocolNfsv4">NFSv4</label>
             </div>
             <span class="invalid-feedback"
-                  *ngIf="nfsForm.showError('protocolNfsv3', formDir, 'required') ||
-                  nfsForm.showError('protocolNfsv4', formDir, 'required')"
+                  *ngIf="nfsForm.showError('protocolNfsv4', formDir, 'required')"
                   i18n>This field is required.</span>
           </div>
         </div>
 
-        <!-- Tag -->
-        <div class="form-group row"
-             *ngIf="nfsForm.getValue('protocolNfsv3')">
-          <label class="cd-col-form-label"
-                 for="tag">
-            <ng-container i18n>NFS Tag</ng-container>
-            <cd-helper>
-              <p i18n>Alternative access for <strong>NFS v3</strong> mounts (it must not have a leading /).</p>
-              <p i18n>Clients may not mount subdirectories (i.e. if Tag = foo, the client may not mount foo/baz).</p>
-              <p i18n>By using different Tag options, the same Path may be exported multiple times.</p>
-            </cd-helper>
-          </label>
-          <div class="cd-col-form-input">
-            <input type="text"
-                   class="form-control"
-                   name="tag"
-                   id="tag"
-                   formControlName="tag">
-          </div>
-        </div>
-
         <!-- Pseudo -->
         <div class="form-group row"
              *ngIf="nfsForm.getValue('protocolNfsv4')">
             <span class="invalid-feedback"
                   *ngIf="nfsForm.showError('pseudo', formDir, 'required')"
                   i18n>This field is required.</span>
+            <span class="invalid-feedback"
+                  *ngIf="nfsForm.showError('pseudo', formDir, 'pseudoAlreadyExists')"
+                  i18n>The pseudo is already in use by another export.</span>
             <span class="invalid-feedback"
                   *ngIf="nfsForm.showError('pseudo', formDir, 'pattern')"
                   i18n>Pseudo needs to start with a '/' and can't contain any of the following: &gt;, &lt;, |, &, ( or ).</span>
 
         <!-- Squash -->
         <div class="form-group row">
-          <label class="cd-col-form-label required"
-                 for="squash"
-                 i18n>Squash</label>
+          <label class="cd-col-form-label"
+                 for="squash">
+            <span class="required"
+                  i18n>Squash</span>
+            <ng-container *ngTemplateOutlet="squashHelper"></ng-container>
+          </label>
           <div class="cd-col-form-input">
             <select class="form-control custom-select"
                     name="squash"
         <cd-nfs-form-client [form]="nfsForm"
                             [clients]="clients"
                             #nfsClients>
+          <ng-template #squashHelper>
+            <cd-helper>
+              <ul class="squash-helper">
+                <li>
+                  <span class="squash-helper-item-value">no_root_squash: </span>
+                  <span i18n>No user id squashing is performed.</span>
+                </li>
+                <li>
+                  <span class="squash-helper-item-value">root_id_squash: </span>
+                  <span i18n>uid 0 and gid 0 are squashed to the Anonymous_Uid and Anonymous_Gid gid 0 in alt_groups lists is also squashed.</span>
+                </li>
+                <li>
+                  <span class="squash-helper-item-value">root_squash: </span>
+                  <span i18n>uid 0 and gid of any value are squashed to the Anonymous_Uid and Anonymous_Gid alt_groups lists is discarded.</span>
+                </li>
+                <li>
+                  <span class="squash-helper-item-value">all_squash: </span>
+                  <span i18n>All users are squashed.</span>
+                </li>
+              </ul>
+            </cd-helper>
+          </ng-template>
         </cd-nfs-form-client>
 
       </div>
index cebcc8877a217ba752a01478da5bfe4d296ed08c..4d892a120fc64f735d4ba921574256f677c9f8c6 100644 (file)
@@ -1,3 +1,11 @@
 .cd-mb {
   margin-bottom: 10px;
 }
+
+.squash-helper {
+  padding-left: 1rem;
+}
+
+.squash-helper-item-value {
+  font-weight: bold;
+}
index e567abfb562b69cea1be27e0608d46da8ef91f56..7cf3d61387a436a138b1b3d92630c1f980478065 100644 (file)
@@ -6,14 +6,15 @@ import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
 import { ToastrModule } from 'ngx-toastr';
+import { Observable, of } from 'rxjs';
 
+import { NfsFormClientComponent } from '~/app/ceph/nfs/nfs-form-client/nfs-form-client.component';
+import { NfsFormComponent } from '~/app/ceph/nfs/nfs-form/nfs-form.component';
+import { Directory } from '~/app/shared/api/nfs.service';
 import { LoadingPanelComponent } from '~/app/shared/components/loading-panel/loading-panel.component';
 import { SharedModule } from '~/app/shared/shared.module';
 import { ActivatedRouteStub } from '~/testing/activated-route-stub';
 import { configureTestBed, RgwHelper } from '~/testing/unit-test-helper';
-import { NFSClusterType } from '../nfs-cluster-type.enum';
-import { NfsFormClientComponent } from '../nfs-form-client/nfs-form-client.component';
-import { NfsFormComponent } from './nfs-form.component';
 
 describe('NfsFormComponent', () => {
   let component: NfsFormComponent;
@@ -50,38 +51,9 @@ describe('NfsFormComponent', () => {
     RgwHelper.selectDaemon();
     fixture.detectChanges();
 
-    httpTesting.expectOne('api/nfs-ganesha/daemon').flush([
-      { daemon_id: 'node1', cluster_id: 'cluster1', cluster_type: NFSClusterType.user },
-      { daemon_id: 'node2', cluster_id: 'cluster1', cluster_type: NFSClusterType.user },
-      { daemon_id: 'node5', cluster_id: 'cluster2', cluster_type: NFSClusterType.orchestrator }
-    ]);
     httpTesting.expectOne('ui-api/nfs-ganesha/fsals').flush(['CEPH', 'RGW']);
-    httpTesting.expectOne('ui-api/nfs-ganesha/cephx/clients').flush(['admin', 'fs', 'rgw']);
     httpTesting.expectOne('ui-api/nfs-ganesha/cephfs/filesystems').flush([{ id: 1, name: 'a' }]);
-    httpTesting
-      .expectOne(`api/rgw/user?${RgwHelper.DAEMON_QUERY_PARAM}`)
-      .flush(['test', 'dev', 'tenant$user']);
-    const user_dev = {
-      suspended: 0,
-      user_id: 'dev',
-      keys: ['a']
-    };
-    httpTesting.expectOne(`api/rgw/user/dev?${RgwHelper.DAEMON_QUERY_PARAM}`).flush(user_dev);
-    const user_test = {
-      suspended: 1,
-      user_id: 'test',
-      keys: ['a']
-    };
-    httpTesting.expectOne(`api/rgw/user/test?${RgwHelper.DAEMON_QUERY_PARAM}`).flush(user_test);
-    const tenantUser = {
-      suspended: 0,
-      tenant: 'tenant',
-      user_id: 'user',
-      keys: ['a']
-    };
-    httpTesting
-      .expectOne(`api/rgw/user/tenant%24user?${RgwHelper.DAEMON_QUERY_PARAM}`)
-      .flush(tenantUser);
+    httpTesting.expectOne('api/nfs-ganesha/cluster').flush(['mynfs']);
     httpTesting.verify();
   });
 
@@ -90,32 +62,26 @@ describe('NfsFormComponent', () => {
   });
 
   it('should process all data', () => {
-    expect(component.allDaemons).toEqual({ cluster1: ['node1', 'node2'], cluster2: ['node5'] });
-    expect(component.isDefaultCluster).toEqual(false);
     expect(component.allFsals).toEqual([
-      { descr: 'CephFS', value: 'CEPH' },
-      { descr: 'Object Gateway', value: 'RGW' }
+      { descr: 'CephFS', value: 'CEPH', disabled: false },
+      { descr: 'Object Gateway', value: 'RGW', disabled: false }
     ]);
-    expect(component.allCephxClients).toEqual(['admin', 'fs', 'rgw']);
     expect(component.allFsNames).toEqual([{ id: 1, name: 'a' }]);
-    expect(component.allRgwUsers).toEqual(['dev', 'tenant$user']);
+    expect(component.allClusters).toEqual([{ cluster_id: 'mynfs' }]);
   });
 
   it('should create the form', () => {
     expect(component.nfsForm.value).toEqual({
       access_type: 'RW',
       clients: [],
-      cluster_id: '',
-      daemons: [],
-      fsal: { fs_name: 'a', name: '', rgw_user_id: '', user_id: '' },
-      path: '',
-      protocolNfsv3: false,
+      cluster_id: 'mynfs',
+      fsal: { fs_name: 'a', name: 'CEPH' },
+      path: '/',
       protocolNfsv4: true,
       pseudo: '',
       sec_label_xattr: 'security.selinux',
       security_label: false,
-      squash: '',
-      tag: '',
+      squash: 'no_root_squash',
       transportTCP: true,
       transportUDP: true
     });
@@ -123,31 +89,9 @@ describe('NfsFormComponent', () => {
   });
 
   it('should prepare data when selecting an cluster', () => {
-    expect(component.allDaemons).toEqual({ cluster1: ['node1', 'node2'], cluster2: ['node5'] });
-    expect(component.daemonsSelections).toEqual([]);
-    expect(component.clusterType).toBeNull();
-
     component.nfsForm.patchValue({ cluster_id: 'cluster1' });
-    component.onClusterChange();
-
-    expect(component.daemonsSelections).toEqual([
-      { description: '', name: 'node1', selected: false, enabled: true },
-      { description: '', name: 'node2', selected: false, enabled: true }
-    ]);
-    expect(component.clusterType).toBe(NFSClusterType.user);
 
     component.nfsForm.patchValue({ cluster_id: 'cluster2' });
-    component.onClusterChange();
-    expect(component.clusterType).toBe(NFSClusterType.orchestrator);
-    expect(component.daemonsSelections).toEqual([]);
-  });
-
-  it('should clean data when changing cluster', () => {
-    component.nfsForm.patchValue({ cluster_id: 'cluster1', daemons: ['node1'] });
-    component.nfsForm.patchValue({ cluster_id: 'node2' });
-    component.onClusterChange();
-
-    expect(component.nfsForm.getValue('daemons')).toEqual([]);
   });
 
   it('should not allow changing cluster in edit mode', () => {
@@ -156,13 +100,8 @@ describe('NfsFormComponent', () => {
     expect(component.nfsForm.get('cluster_id').disabled).toBeTruthy();
   });
 
-  it('should mark NFSv4 protocol as required', () => {
-    component.nfsForm.patchValue({
-      protocolNfsv4: false
-    });
-    component.nfsForm.updateValueAndValidity({ emitEvent: false });
-    expect(component.nfsForm.valid).toBeFalsy();
-    expect(component.nfsForm.get('protocolNfsv4').hasError('required')).toBeTruthy();
+  it('should mark NFSv4 protocol as enabled always', () => {
+    expect(component.nfsForm.get('protocolNfsv4')).toBeTruthy();
   });
 
   describe('should submit request', () => {
@@ -171,29 +110,16 @@ describe('NfsFormComponent', () => {
         access_type: 'RW',
         clients: [],
         cluster_id: 'cluster1',
-        daemons: ['node2'],
-        fsal: { name: 'CEPH', user_id: 'fs', fs_name: 1, rgw_user_id: '' },
+        fsal: { name: 'CEPH', fs_name: 1 },
         path: '/foo',
-        protocolNfsv3: true,
         protocolNfsv4: true,
         pseudo: '/baz',
         squash: 'no_root_squash',
-        tag: 'bar',
         transportTCP: true,
         transportUDP: true
       });
     });
 
-    it('should remove "pseudo" requirement when NFS v4 disabled', () => {
-      component.nfsForm.patchValue({
-        protocolNfsv4: false,
-        pseudo: ''
-      });
-
-      component.nfsForm.updateValueAndValidity({ emitEvent: false });
-      expect(component.nfsForm.valid).toBeTruthy();
-    });
-
     it('should call update', () => {
       activatedRoute.setParams({ cluster_id: 'cluster1', export_id: '1' });
       component.isEdit = true;
@@ -208,15 +134,13 @@ describe('NfsFormComponent', () => {
         access_type: 'RW',
         clients: [],
         cluster_id: 'cluster1',
-        daemons: ['node2'],
-        export_id: '1',
-        fsal: { fs_name: 1, name: 'CEPH', sec_label_xattr: null, user_id: 'fs' },
+        export_id: 1,
+        fsal: { fs_name: 1, name: 'CEPH', sec_label_xattr: null },
         path: '/foo',
-        protocols: [3, 4],
+        protocols: [4],
         pseudo: '/baz',
         security_label: false,
         squash: 'no_root_squash',
-        tag: 'bar',
         transports: ['TCP', 'UDP']
       });
     });
@@ -231,21 +155,55 @@ describe('NfsFormComponent', () => {
         access_type: 'RW',
         clients: [],
         cluster_id: 'cluster1',
-        daemons: ['node2'],
         fsal: {
           fs_name: 1,
           name: 'CEPH',
-          sec_label_xattr: null,
-          user_id: 'fs'
+          sec_label_xattr: null
         },
         path: '/foo',
-        protocols: [3, 4],
+        protocols: [4],
         pseudo: '/baz',
         security_label: false,
         squash: 'no_root_squash',
-        tag: 'bar',
         transports: ['TCP', 'UDP']
       });
     });
   });
+
+  describe('pathExistence', () => {
+    beforeEach(() => {
+      component['nfsService']['lsDir'] = jest.fn(
+        (): Observable<Directory> => of({ paths: ['/path1'] })
+      );
+      component.nfsForm.get('name').setValue('CEPH');
+      component.setPathValidation();
+    });
+
+    const testValidator = (pathName: string, valid: boolean, expectedError?: string) => {
+      const path = component.nfsForm.get('path');
+      path.setValue(pathName);
+      path.markAsDirty();
+      path.updateValueAndValidity();
+
+      if (valid) {
+        expect(path.errors).toBe(null);
+      } else {
+        expect(path.hasError(expectedError)).toBeTruthy();
+      }
+    };
+
+    it('path cannot be empty', () => {
+      testValidator('', false, 'required');
+    });
+
+    it('path that does not exist should be invalid', () => {
+      testValidator('/path2', false, 'pathNameNotAllowed');
+      expect(component['nfsService']['lsDir']).toHaveBeenCalledTimes(1);
+    });
+
+    it('path that exists should be valid', () => {
+      testValidator('/path1', true);
+      expect(component['nfsService']['lsDir']).toHaveBeenCalledTimes(1);
+    });
+  });
 });
index 3e23b9878b95d82c9bdc3feb6efe9e679d97aae2..a56c1105e08e49c2b89b9ac41fb5c7b9faec0d61 100644 (file)
@@ -1,15 +1,21 @@
 import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
-import { FormControl, Validators } from '@angular/forms';
+import {
+  AbstractControl,
+  AsyncValidatorFn,
+  FormControl,
+  ValidationErrors,
+  Validators
+} from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import _ from 'lodash';
 import { forkJoin, Observable, of } from 'rxjs';
-import { debounceTime, distinctUntilChanged, map, mergeMap } from 'rxjs/operators';
+import { catchError, debounceTime, distinctUntilChanged, map, mergeMap } from 'rxjs/operators';
 
-import { NfsService } from '~/app/shared/api/nfs.service';
-import { RgwUserService } from '~/app/shared/api/rgw-user.service';
-import { SelectMessages } from '~/app/shared/components/select/select-messages.model';
-import { SelectOption } from '~/app/shared/components/select/select-option.model';
+import { NfsFSAbstractionLayer } from '~/app/ceph/nfs/models/nfs.fsal';
+import { Directory, NfsService } from '~/app/shared/api/nfs.service';
+import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service';
+import { RgwSiteService } from '~/app/shared/api/rgw-site.service';
 import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
 import { Icons } from '~/app/shared/enum/icons.enum';
 import { CdForm } from '~/app/shared/forms/cd-form';
@@ -18,9 +24,9 @@ import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
 import { CdValidators } from '~/app/shared/forms/cd-validators';
 import { FinishedTask } from '~/app/shared/models/finished-task';
 import { Permission } from '~/app/shared/models/permissions';
+import { CdHttpErrorResponse } from '~/app/shared/services/api-interceptor.service';
 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service';
-import { NFSClusterType } from '../nfs-cluster-type.enum';
 import { NfsFormClientComponent } from '../nfs-form-client/nfs-form-client.component';
 
 @Component({
@@ -39,21 +45,14 @@ export class NfsFormComponent extends CdForm implements OnInit {
   isEdit = false;
 
   cluster_id: string = null;
-  clusterType: string = null;
   export_id: string = null;
 
-  isNewDirectory = false;
-  isNewBucket = false;
-  isDefaultCluster = false;
-
-  allClusters: { cluster_id: string; cluster_type: string }[] = null;
-  allDaemons = {};
+  allClusters: { cluster_id: string }[] = null;
   icons = Icons;
 
   allFsals: any[] = [];
-  allRgwUsers: any[] = [];
-  allCephxClients: any[] = null;
   allFsNames: any[] = null;
+  fsalAvailabilityError: string = null;
 
   defaultAccessType = { RGW: 'RO' };
   nfsAccessType: any[] = this.nfsService.nfsAccessType;
@@ -62,15 +61,12 @@ export class NfsFormComponent extends CdForm implements OnInit {
   action: string;
   resource: string;
 
-  daemonsSelections: SelectOption[] = [];
-  daemonsMessages = new SelectMessages({ noOptions: $localize`There are no daemons available.` });
-
   pathDataSource = (text$: Observable<string>) => {
     return text$.pipe(
       debounceTime(200),
       distinctUntilChanged(),
       mergeMap((token: string) => this.getPathTypeahead(token)),
-      map((val: any) => val.paths)
+      map((val: string[]) => val)
     );
   };
 
@@ -87,7 +83,8 @@ export class NfsFormComponent extends CdForm implements OnInit {
     private nfsService: NfsService,
     private route: ActivatedRoute,
     private router: Router,
-    private rgwUserService: RgwUserService,
+    private rgwBucketService: RgwBucketService,
+    private rgwSiteService: RgwSiteService,
     private formBuilder: CdFormBuilder,
     private taskWrapper: TaskWrapperService,
     private cdRef: ChangeDetectorRef,
@@ -101,9 +98,8 @@ export class NfsFormComponent extends CdForm implements OnInit {
 
   ngOnInit() {
     const promises: Observable<any>[] = [
-      this.nfsService.daemon(),
+      this.nfsService.listClusters(),
       this.nfsService.fsals(),
-      this.nfsService.clients(),
       this.nfsService.filesystems()
     ];
 
@@ -129,12 +125,11 @@ export class NfsFormComponent extends CdForm implements OnInit {
 
   getData(promises: Observable<any>[]) {
     forkJoin(promises).subscribe((data: any[]) => {
-      this.resolveDaemons(data[0]);
+      this.resolveClusters(data[0]);
       this.resolveFsals(data[1]);
-      this.resolveClients(data[2]);
-      this.resolveFilesystems(data[3]);
-      if (data[4]) {
-        this.resolveModel(data[4]);
+      this.resolveFilesystems(data[2]);
+      if (data[3]) {
+        this.resolveModel(data[3]);
       }
 
       this.loadingReady();
@@ -146,49 +141,20 @@ export class NfsFormComponent extends CdForm implements OnInit {
       cluster_id: new FormControl('', {
         validators: [Validators.required]
       }),
-      daemons: new FormControl([]),
       fsal: new CdFormGroup({
         name: new FormControl('', {
           validators: [Validators.required]
         }),
-        user_id: new FormControl('', {
-          validators: [
-            CdValidators.requiredIf({
-              name: 'CEPH'
-            })
-          ]
-        }),
         fs_name: new FormControl('', {
           validators: [
             CdValidators.requiredIf({
               name: 'CEPH'
             })
           ]
-        }),
-        rgw_user_id: new FormControl('', {
-          validators: [
-            CdValidators.requiredIf({
-              name: 'RGW'
-            })
-          ]
         })
       }),
-      path: new FormControl(''),
-      protocolNfsv3: new FormControl(false, {
-        validators: [
-          CdValidators.requiredIf({ protocolNfsv4: false }, (value: boolean) => {
-            return !value;
-          })
-        ]
-      }),
-      protocolNfsv4: new FormControl(true, {
-        validators: [
-          CdValidators.requiredIf({ protocolNfsv3: false }, (value: boolean) => {
-            return !value;
-          })
-        ]
-      }),
-      tag: new FormControl(''),
+      path: new FormControl('/'),
+      protocolNfsv4: new FormControl(true),
       pseudo: new FormControl('', {
         validators: [
           CdValidators.requiredIf({ protocolNfsv4: true }),
@@ -198,7 +164,7 @@ export class NfsFormComponent extends CdForm implements OnInit {
       access_type: new FormControl('RW', {
         validators: [Validators.required]
       }),
-      squash: new FormControl('', {
+      squash: new FormControl(this.nfsSquash[0], {
         validators: [Validators.required]
       }),
       transportUDP: new FormControl(true, {
@@ -229,15 +195,6 @@ export class NfsFormComponent extends CdForm implements OnInit {
       res.sec_label_xattr = res.fsal.sec_label_xattr;
     }
 
-    if (this.clusterType === NFSClusterType.user) {
-      this.daemonsSelections = _.map(
-        this.allDaemons[res.cluster_id],
-        (daemon) => new SelectOption(res.daemons.indexOf(daemon) !== -1, daemon, '')
-      );
-      this.daemonsSelections = [...this.daemonsSelections];
-    }
-
-    res.protocolNfsv3 = res.protocols.indexOf(3) !== -1;
     res.protocolNfsv4 = res.protocols.indexOf(4) !== -1;
     delete res.protocols;
 
@@ -261,31 +218,13 @@ export class NfsFormComponent extends CdForm implements OnInit {
     this.clients = res.clients;
   }
 
-  resolveDaemons(daemons: Record<string, any>) {
-    daemons = _.sortBy(daemons, ['daemon_id']);
-    const clusters = _.groupBy(daemons, 'cluster_id');
-
+  resolveClusters(clusters: string[]) {
     this.allClusters = [];
-    _.forIn(clusters, (cluster, cluster_id) => {
-      this.allClusters.push({ cluster_id: cluster_id, cluster_type: cluster[0].cluster_type });
-      this.allDaemons[cluster_id] = [];
-    });
-
-    _.forEach(daemons, (daemon) => {
-      this.allDaemons[daemon.cluster_id].push(daemon.daemon_id);
-    });
-
-    if (this.isEdit) {
-      this.clusterType = _.find(this.allClusters, { cluster_id: this.cluster_id })?.cluster_type;
+    for (const cluster of clusters) {
+      this.allClusters.push({ cluster_id: cluster });
     }
-
-    const hasOneCluster = _.isArray(this.allClusters) && this.allClusters.length === 1;
-    this.isDefaultCluster = hasOneCluster && this.allClusters[0].cluster_id === '_default_';
-    if (hasOneCluster) {
-      this.nfsForm.patchValue({
-        cluster_id: this.allClusters[0].cluster_id
-      });
-      this.onClusterChange();
+    if (!this.isEdit && this.allClusters.length > 0) {
+      this.nfsForm.get('cluster_id').setValue(this.allClusters[0].cluster_id);
     }
   }
 
@@ -297,33 +236,20 @@ export class NfsFormComponent extends CdForm implements OnInit {
 
       if (_.isObjectLike(fsalItem)) {
         this.allFsals.push(fsalItem);
-        if (fsalItem.value === 'RGW') {
-          this.rgwUserService.list().subscribe((result: any) => {
-            result.forEach((user: Record<string, any>) => {
-              if (user.suspended === 0 && user.keys.length > 0) {
-                const userId = user.tenant ? `${user.tenant}$${user.user_id}` : user.user_id;
-                this.allRgwUsers.push(userId);
-              }
-            });
-          });
-        }
       }
     });
-
-    if (this.allFsals.length === 1 && _.isUndefined(this.nfsForm.getValue('fsal'))) {
+    if (!this.isEdit && this.allFsals.length > 0) {
       this.nfsForm.patchValue({
-        fsal: this.allFsals[0]
+        fsal: {
+          name: this.allFsals[0].value
+        }
       });
     }
   }
 
-  resolveClients(clients: any[]) {
-    this.allCephxClients = clients;
-  }
-
   resolveFilesystems(filesystems: any[]) {
     this.allFsNames = filesystems;
-    if (filesystems.length === 1) {
+    if (!this.isEdit && filesystems.length > 0) {
       this.nfsForm.patchValue({
         fsal: {
           fs_name: filesystems[0].name
@@ -333,15 +259,57 @@ export class NfsFormComponent extends CdForm implements OnInit {
   }
 
   fsalChangeHandler() {
-    this.nfsForm.patchValue({
-      tag: this._generateTag(),
-      pseudo: this._generatePseudo(),
-      access_type: this._updateAccessType()
+    this.setPathValidation();
+    const fsalValue = this.nfsForm.getValue('name');
+    const checkAvailability =
+      fsalValue === 'RGW'
+        ? this.rgwSiteService.get('realms').pipe(
+            mergeMap((realms: string[]) =>
+              realms.length === 0
+                ? of(true)
+                : this.rgwSiteService.isDefaultRealm().pipe(
+                    mergeMap((isDefaultRealm) => {
+                      if (!isDefaultRealm) {
+                        throw new Error('Selected realm is not the default.');
+                      }
+                      return of(true);
+                    })
+                  )
+            )
+          )
+        : this.nfsService.filesystems();
+
+    checkAvailability.subscribe({
+      next: () => {
+        this.setFsalAvailability(fsalValue, true);
+        if (!this.isEdit) {
+          this.nfsForm.patchValue({
+            path: fsalValue === 'RGW' ? '' : '/',
+            pseudo: this.generatePseudo(),
+            access_type: this.updateAccessType()
+          });
+        }
+
+        this.cdRef.detectChanges();
+      },
+      error: (error) => {
+        this.setFsalAvailability(fsalValue, false, error);
+        this.nfsForm.get('name').setValue('');
+      }
     });
+  }
 
-    this.setPathValidation();
+  private setFsalAvailability(fsalValue: string, available: boolean, errorMessage: string = '') {
+    this.allFsals = this.allFsals.map((fsalItem: NfsFSAbstractionLayer) => {
+      if (fsalItem.value === fsalValue) {
+        fsalItem.disabled = !available;
 
-    this.cdRef.detectChanges();
+        this.fsalAvailabilityError = fsalItem.disabled
+          ? $localize`${fsalItem.descr} backend is not available. ${errorMessage}`
+          : null;
+      }
+      return fsalItem;
+    });
   }
 
   accessTypeChangeHandler() {
@@ -351,21 +319,17 @@ export class NfsFormComponent extends CdForm implements OnInit {
   }
 
   setPathValidation() {
+    const path = this.nfsForm.get('path');
+    path.setValidators([Validators.required]);
     if (this.nfsForm.getValue('name') === 'RGW') {
-      this.nfsForm
-        .get('path')
-        .setValidators([Validators.required, Validators.pattern('^(/|[^/><|&()#?]+)$')]);
+      path.setAsyncValidators([CdValidators.bucketExistence(true, this.rgwBucketService)]);
     } else {
-      this.nfsForm
-        .get('path')
-        .setValidators([Validators.required, Validators.pattern('^/[^><|&()?]*$')]);
+      path.setAsyncValidators([this.pathExistence(true)]);
     }
-  }
 
-  rgwUserIdChangeHandler() {
-    this.nfsForm.patchValue({
-      pseudo: this._generatePseudo()
-    });
+    if (this.isEdit) {
+      path.markAsDirty();
+    }
   }
 
   getAccessTypeHelp(accessType: string) {
@@ -387,60 +351,44 @@ export class NfsFormComponent extends CdForm implements OnInit {
     return '';
   }
 
-  getPathTypeahead(path: any) {
+  private getPathTypeahead(path: any) {
     if (!_.isString(path) || path === '/') {
       return of([]);
     }
 
     const fsName = this.nfsForm.getValue('fsal').fs_name;
-    return this.nfsService.lsDir(fsName, path);
+    return this.nfsService.lsDir(fsName, path).pipe(
+      map((result: Directory) =>
+        result.paths.filter((dirName: string) => dirName.toLowerCase().includes(path)).slice(0, 15)
+      ),
+      catchError(() => of([$localize`Error while retrieving paths.`]))
+    );
   }
 
   pathChangeHandler() {
-    this.nfsForm.patchValue({
-      pseudo: this._generatePseudo()
-    });
-
-    const path = this.nfsForm.getValue('path');
-    this.getPathTypeahead(path).subscribe((res: any) => {
-      this.isNewDirectory = path !== '/' && res.paths.indexOf(path) === -1;
-    });
-  }
-
-  bucketChangeHandler() {
-    this.nfsForm.patchValue({
-      tag: this._generateTag(),
-      pseudo: this._generatePseudo()
-    });
-
-    const bucket = this.nfsForm.getValue('path');
-    this.getBucketTypeahead(bucket).subscribe((res: any) => {
-      this.isNewBucket = bucket !== '' && res.indexOf(bucket) === -1;
-    });
+    if (!this.isEdit) {
+      this.nfsForm.patchValue({
+        pseudo: this.generatePseudo()
+      });
+    }
   }
 
-  getBucketTypeahead(path: string): Observable<any> {
-    const rgwUserId = this.nfsForm.getValue('rgw_user_id');
-
-    if (_.isString(rgwUserId) && _.isString(path) && path !== '/' && path !== '') {
-      return this.nfsService.buckets(rgwUserId);
+  private getBucketTypeahead(path: string): Observable<any> {
+    if (_.isString(path) && path !== '/' && path !== '') {
+      return this.rgwBucketService.list().pipe(
+        map((bucketList) =>
+          bucketList
+            .filter((bucketName: string) => bucketName.toLowerCase().includes(path))
+            .slice(0, 15)
+        ),
+        catchError(() => of([$localize`Error while retrieving bucket names.`]))
+      );
     } else {
       return of([]);
     }
   }
 
-  _generateTag() {
-    let newTag = this.nfsForm.getValue('tag');
-    if (!this.nfsForm.get('tag').dirty) {
-      newTag = undefined;
-      if (this.nfsForm.getValue('fsal') === 'RGW') {
-        newTag = this.nfsForm.getValue('path');
-      }
-    }
-    return newTag;
-  }
-
-  _generatePseudo() {
+  private generatePseudo() {
     let newPseudo = this.nfsForm.getValue('pseudo');
     if (this.nfsForm.get('pseudo') && !this.nfsForm.get('pseudo').dirty) {
       newPseudo = undefined;
@@ -449,19 +397,12 @@ export class NfsFormComponent extends CdForm implements OnInit {
         if (_.isString(this.nfsForm.getValue('path'))) {
           newPseudo += this.nfsForm.getValue('path');
         }
-      } else if (this.nfsForm.getValue('fsal') === 'RGW') {
-        if (_.isString(this.nfsForm.getValue('rgw_user_id'))) {
-          newPseudo = '/' + this.nfsForm.getValue('rgw_user_id');
-          if (_.isString(this.nfsForm.getValue('path'))) {
-            newPseudo += '/' + this.nfsForm.getValue('path');
-          }
-        }
       }
     }
     return newPseudo;
   }
 
-  _updateAccessType() {
+  private updateAccessType() {
     const name = this.nfsForm.getValue('name');
     let accessType = this.defaultAccessType[name];
 
@@ -472,57 +413,17 @@ export class NfsFormComponent extends CdForm implements OnInit {
     return accessType;
   }
 
-  onClusterChange() {
-    const cluster_id = this.nfsForm.getValue('cluster_id');
-    this.clusterType = _.find(this.allClusters, { cluster_id: cluster_id })?.cluster_type;
-    if (this.clusterType === NFSClusterType.user) {
-      this.daemonsSelections = _.map(
-        this.allDaemons[cluster_id],
-        (daemon) => new SelectOption(false, daemon, '')
-      );
-      this.daemonsSelections = [...this.daemonsSelections];
-    } else {
-      this.daemonsSelections = [];
-    }
-    this.nfsForm.patchValue({ daemons: [] });
-  }
-
-  removeDaemon(index: number, daemon: string) {
-    this.daemonsSelections.forEach((value) => {
-      if (value.name === daemon) {
-        value.selected = false;
-      }
-    });
-
-    const daemons = this.nfsForm.get('daemons');
-    daemons.value.splice(index, 1);
-    daemons.setValue(daemons.value);
-
-    return false;
-  }
-
-  onDaemonSelection() {
-    this.nfsForm.get('daemons').setValue(this.nfsForm.getValue('daemons'));
-  }
-
-  onToggleAllDaemonsSelection() {
-    const cluster_id = this.nfsForm.getValue('cluster_id');
-    const daemons =
-      this.nfsForm.getValue('daemons').length === 0 ? this.allDaemons[cluster_id] : [];
-    this.nfsForm.patchValue({ daemons: daemons });
-  }
-
   submitAction() {
     let action: Observable<any>;
-    const requestModel = this._buildRequest();
+    const requestModel = this.buildRequest();
 
     if (this.isEdit) {
       action = this.taskWrapper.wrapTaskAroundCall({
         task: new FinishedTask('nfs/edit', {
           cluster_id: this.cluster_id,
-          export_id: this.export_id
+          export_id: _.parseInt(this.export_id)
         }),
-        call: this.nfsService.update(this.cluster_id, this.export_id, requestModel)
+        call: this.nfsService.update(this.cluster_id, _.parseInt(this.export_id), requestModel)
       });
     } else {
       // Create
@@ -537,36 +438,35 @@ export class NfsFormComponent extends CdForm implements OnInit {
     }
 
     action.subscribe({
-      error: () => this.nfsForm.setErrors({ cdSubmitButton: true }),
+      error: (errorResponse: CdHttpErrorResponse) => this.setFormErrors(errorResponse),
       complete: () => this.router.navigate(['/nfs'])
     });
   }
 
-  _buildRequest() {
-    const requestModel: any = _.cloneDeep(this.nfsForm.value);
-
-    if (_.isUndefined(requestModel.tag) || requestModel.tag === '') {
-      requestModel.tag = null;
+  private setFormErrors(errorResponse: CdHttpErrorResponse) {
+    if (
+      errorResponse.error.detail &&
+      errorResponse.error.detail
+        .toString()
+        .includes(`Pseudo ${this.nfsForm.getValue('pseudo')} is already in use`)
+    ) {
+      this.nfsForm.get('pseudo').setErrors({ pseudoAlreadyExists: true });
     }
+    this.nfsForm.setErrors({ cdSubmitButton: true });
+  }
+
+  private buildRequest() {
+    const requestModel: any = _.cloneDeep(this.nfsForm.value);
 
     if (this.isEdit) {
-      requestModel.export_id = this.export_id;
+      requestModel.export_id = _.parseInt(this.export_id);
     }
 
-    if (requestModel.fsal.name === 'CEPH') {
-      delete requestModel.fsal.rgw_user_id;
-    } else {
+    if (requestModel.fsal.name === 'RGW') {
       delete requestModel.fsal.fs_name;
-      delete requestModel.fsal.user_id;
     }
 
     requestModel.protocols = [];
-    if (requestModel.protocolNfsv3) {
-      requestModel.protocols.push(3);
-    } else {
-      requestModel.tag = null;
-    }
-    delete requestModel.protocolNfsv3;
     if (requestModel.protocolNfsv4) {
       requestModel.protocols.push(4);
     } else {
@@ -613,4 +513,21 @@ export class NfsFormComponent extends CdForm implements OnInit {
 
     return requestModel;
   }
+
+  private pathExistence(requiredExistenceResult: boolean): AsyncValidatorFn {
+    return (control: AbstractControl): Observable<ValidationErrors | null> => {
+      if (control.pristine || !control.value) {
+        return of({ required: true });
+      }
+      const fsName = this.nfsForm.getValue('fsal').fs_name;
+      return this.nfsService.lsDir(fsName, control.value).pipe(
+        map((directory: Directory) =>
+          directory.paths.includes(control.value) === requiredExistenceResult
+            ? null
+            : { pathNameNotAllowed: true }
+        ),
+        catchError(() => of({ pathNameNotAllowed: true }))
+      );
+    };
+  }
 }
index d02a05c23d82a8d7fe5f86ede12d609bcacd7ed2..5e43cdd658cb45d71a598751fc454bceecb61fea 100644 (file)
@@ -58,7 +58,6 @@ describe('NfsListComponent', () => {
     beforeEach(() => {
       fixture.detectChanges();
       spyOn(nfsService, 'list').and.callThrough();
-      httpTesting.expectOne('api/nfs-ganesha/daemon').flush([]);
     });
 
     afterEach(() => {
@@ -126,9 +125,6 @@ describe('NfsListComponent', () => {
       refresh(new Summary());
       spyOn(nfsService, 'list').and.callFake(() => of(exports));
       fixture.detectChanges();
-
-      const req = httpTesting.expectOne('api/nfs-ganesha/daemon');
-      req.flush([]);
     });
 
     it('should gets all exports without tasks', () => {
index 70ff67eaf8c78b6cf1e365bfc3d0d5e476aa6b3b..d5d0c2639300c322820a59b3c539c97942828aa2 100644 (file)
@@ -118,11 +118,6 @@ export class NfsListComponent extends ListWithDetails implements OnInit, OnDestr
         prop: 'cluster_id',
         flexGrow: 2
       },
-      {
-        name: $localize`Daemons`,
-        prop: 'daemons',
-        flexGrow: 2
-      },
       {
         name: $localize`Storage Backend`,
         prop: 'fsal',
@@ -136,32 +131,14 @@ export class NfsListComponent extends ListWithDetails implements OnInit, OnDestr
       }
     ];
 
-    this.nfsService.daemon().subscribe(
-      (daemons: any) => {
-        const clusters = _(daemons)
-          .map((daemon) => daemon.cluster_id)
-          .uniq()
-          .value();
-
-        this.isDefaultCluster = clusters.length === 1 && clusters[0] === '_default_';
-        this.columns[2].isHidden = this.isDefaultCluster;
-        if (this.table) {
-          this.table.updateColumns();
-        }
-
-        this.taskListService.init(
-          () => this.nfsService.list(),
-          (resp) => this.prepareResponse(resp),
-          (exports) => (this.exports = exports),
-          () => this.onFetchError(),
-          this.taskFilter,
-          this.itemFilter,
-          this.builders
-        );
-      },
-      () => {
-        this.onFetchError();
-      }
+    this.taskListService.init(
+      () => this.nfsService.list(),
+      (resp) => this.prepareResponse(resp),
+      (exports) => (this.exports = exports),
+      () => this.onFetchError(),
+      this.taskFilter,
+      this.itemFilter,
+      this.builders
     );
   }
 
index 7bf328df4eb720c3bdbda6c58e5310cfd8593f1b..3329742f413698bc61523a2b6373bdfd5cc68f94 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index 92cecabc91581a3b4c7792c3230919e2b1e6f621..7d4834d521455cb2d34d708d4a176e3f153a8937 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index 499692129318fcd9cf569d5e6a2e27bf84b074ca..445f2a5acc85ffec12fd63afca7177485ce7b8dd 100644 (file)
@@ -3,6 +3,7 @@ export class RgwDaemon {
   service_map_id: string;
   version: string;
   server_hostname: string;
+  realm_name: string;
   zonegroup_name: string;
   zone_name: string;
   default: boolean;
index be46e01524ea7cf23cffab6fb68d5d9e282753a8..4cdb9935ddac1bfbda7598c727a42d6eeb14b495 100644 (file)
@@ -5,7 +5,7 @@
         [formGroup]="bucketForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
 
       <div class="card-body">
@@ -46,9 +46,9 @@
                   i18n>This field is required.</span>
             <span class="invalid-feedback"
                   *ngIf="bucketForm.showError('bid', frm, 'bucketNameInvalid')"
-                  i18n>The value is not valid.</span>
+                  i18n>Bucket names can only contain lowercase letters, numbers, periods and hyphens.</span>
             <span class="invalid-feedback"
-                  *ngIf="bucketForm.showError('bid', frm, 'bucketNameExists')"
+                  *ngIf="bucketForm.showError('bid', frm, 'bucketNameNotAllowed')"
                   i18n>The chosen name is already in use.</span>
             <span class="invalid-feedback"
                   *ngIf="bucketForm.showError('bid', frm, 'containsUpperCase')"
@@ -61,7 +61,7 @@
                   i18n>Bucket names cannot be formatted as IP address.</span>
             <span class="invalid-feedback"
                   *ngIf="bucketForm.showError('bid', frm, 'onlyLowerCaseAndNumbers')"
-                  i18n>Bucket names can only contain lowercase letters, numbers, and hyphens.</span>
+                  i18n>Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens.</span>
             <span class="invalid-feedback"
                   *ngIf="bucketForm.showError('bid', frm, 'shouldBeInRange')"
                   i18n>Bucket names must be 3 to 63 characters long.</span>
index a2d8854adc873feea0cfdf03d753b3d84dff6381..704d7918465df24c8b9c4fbb928a625c72ffaca8 100644 (file)
@@ -1,12 +1,12 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
+import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule } from '@angular/forms';
 import { Router } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
 
 import _ from 'lodash';
 import { ToastrModule } from 'ngx-toastr';
-import { of as observableOf, throwError } from 'rxjs';
+import { of as observableOf } from 'rxjs';
 
 import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service';
 import { RgwSiteService } from '~/app/shared/api/rgw-site.service';
@@ -54,92 +54,12 @@ describe('RgwBucketFormComponent', () => {
   });
 
   describe('bucketNameValidator', () => {
-    const testValidator = (name: string, valid: boolean, expectedError?: string) => {
-      rgwBucketServiceGetSpy.and.returnValue(throwError('foo'));
-      formHelper.setValue('bid', name, true);
-      tick();
-      if (valid) {
-        formHelper.expectValid('bid');
-      } else {
-        formHelper.expectError('bid', expectedError);
-      }
-    };
-
     it('should validate empty name', fakeAsync(() => {
       formHelper.expectErrorChange('bid', '', 'required', true);
     }));
+  });
 
-    it('bucket names cannot be formatted as IP address', fakeAsync(() => {
-      const testIPs = ['1.1.1.01', '001.1.1.01', '127.0.0.1'];
-      for (const ip of testIPs) {
-        testValidator(ip, false, 'ipAddress');
-      }
-    }));
-
-    it('bucket name must be >= 3 characters long (1/2)', fakeAsync(() => {
-      testValidator('ab', false, 'shouldBeInRange');
-    }));
-
-    it('bucket name must be >= 3 characters long (2/2)', fakeAsync(() => {
-      testValidator('abc', true);
-    }));
-
-    it('bucket name must be <= than 63 characters long (1/2)', fakeAsync(() => {
-      testValidator(_.repeat('a', 64), false, 'shouldBeInRange');
-    }));
-
-    it('bucket name must be <= than 63 characters long (2/2)', fakeAsync(() => {
-      testValidator(_.repeat('a', 63), true);
-    }));
-
-    it('bucket names must not contain uppercase characters or underscores (1/2)', fakeAsync(() => {
-      testValidator('iAmInvalid', false, 'containsUpperCase');
-    }));
-
-    it('bucket names can only contain lowercase letters, numbers, and hyphens', fakeAsync(() => {
-      testValidator('$$$', false, 'onlyLowerCaseAndNumbers');
-    }));
-
-    it('bucket names must not contain uppercase characters or underscores (2/2)', fakeAsync(() => {
-      testValidator('i_am_invalid', false, 'containsUpperCase');
-    }));
-
-    it('bucket names must start and end with letters or numbers', fakeAsync(() => {
-      testValidator('abcd-', false, 'lowerCaseOrNumber');
-    }));
-
-    it('bucket names with invalid labels (1/3)', fakeAsync(() => {
-      testValidator('abc.1def.Ghi2', false, 'containsUpperCase');
-    }));
-
-    it('bucket names with invalid labels (2/3)', fakeAsync(() => {
-      testValidator('abc.1_xy', false, 'containsUpperCase');
-    }));
-
-    it('bucket names with invalid labels (3/3)', fakeAsync(() => {
-      testValidator('abc.*def', false, 'lowerCaseOrNumber');
-    }));
-
-    it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (1/3)', fakeAsync(() => {
-      testValidator('xyz.abc', true);
-    }));
-
-    it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (2/3)', fakeAsync(() => {
-      testValidator('abc.1-def', true);
-    }));
-
-    it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (3/3)', fakeAsync(() => {
-      testValidator('abc.ghi2', true);
-    }));
-
-    it('bucket names must be unique', fakeAsync(() => {
-      testValidator('bucket-name-is-unique', true);
-    }));
-
-    it('bucket names must not contain spaces', fakeAsync(() => {
-      testValidator('bucket name  with   spaces', false, 'onlyLowerCaseAndNumbers');
-    }));
-
+  describe('zonegroup and placement targets', () => {
     it('should get zonegroup and placement targets', () => {
       const payload: Record<string, any> = {
         zonegroup: 'default',
index 80ff2c8538a5a24ed8ab1295f80a4e9ce05bfb41..1d5aede396eae52b8fd6ec2d22738b670550ccea 100644 (file)
@@ -1,10 +1,9 @@
 import { Component, OnInit } from '@angular/core';
-import { AbstractControl, AsyncValidatorFn, ValidationErrors, Validators } from '@angular/forms';
+import { Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import _ from 'lodash';
-import { forkJoin, Observable, of as observableOf, timer as observableTimer } from 'rxjs';
-import { map, switchMapTo } from 'rxjs/operators';
+import { forkJoin } from 'rxjs';
 
 import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service';
 import { RgwSiteService } from '~/app/shared/api/rgw-site.service';
@@ -72,7 +71,13 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
     });
     this.bucketForm = this.formBuilder.group({
       id: [null],
-      bid: [null, [Validators.required], this.editing ? [] : [this.bucketNameValidator()]],
+      bid: [
+        null,
+        [Validators.required],
+        this.editing
+          ? []
+          : [CdValidators.bucketName(), CdValidators.bucketExistence(false, this.rgwBucketService)]
+      ],
       owner: [null, [Validators.required]],
       'placement-target': [null, this.editing ? [] : [Validators.required]],
       versioning: [null],
@@ -225,108 +230,6 @@ export class RgwBucketFormComponent extends CdForm implements OnInit {
     }
   }
 
-  /**
-   * Validate the bucket name. In general, bucket names should follow domain
-   * name constraints:
-   * - Bucket names must be unique.
-   * - Bucket names cannot be formatted as IP address.
-   * - Bucket names can be between 3 and 63 characters long.
-   * - Bucket names must not contain uppercase characters or underscores.
-   * - Bucket names must start with a lowercase letter or number.
-   * - Bucket names must be a series of one or more labels. Adjacent
-   *   labels are separated by a single period (.). Bucket names can
-   *   contain lowercase letters, numbers, and hyphens. Each label must
-   *   start and end with a lowercase letter or a number.
-   */
-  bucketNameValidator(): AsyncValidatorFn {
-    return (control: AbstractControl): Observable<ValidationErrors | null> => {
-      // Exit immediately if user has not interacted with the control yet
-      // or the control value is empty.
-      if (control.pristine || control.value === '') {
-        return observableOf(null);
-      }
-      const constraints = [];
-      let errorName: string;
-      // - Bucket names cannot be formatted as IP address.
-      constraints.push(() => {
-        const ipv4Rgx = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i;
-        const ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;
-        const name = this.bucketForm.get('bid').value;
-        let notIP = true;
-        if (ipv4Rgx.test(name) || ipv6Rgx.test(name)) {
-          errorName = 'ipAddress';
-          notIP = false;
-        }
-        return notIP;
-      });
-      // - Bucket names can be between 3 and 63 characters long.
-      constraints.push((name: string) => {
-        if (!_.inRange(name.length, 3, 64)) {
-          errorName = 'shouldBeInRange';
-          return false;
-        }
-        return true;
-      });
-      // - Bucket names must not contain uppercase characters or underscores.
-      // - Bucket names must start with a lowercase letter or number.
-      // - Bucket names must be a series of one or more labels. Adjacent
-      //   labels are separated by a single period (.). Bucket names can
-      //   contain lowercase letters, numbers, and hyphens. Each label must
-      //   start and end with a lowercase letter or a number.
-      constraints.push((name: string) => {
-        const labels = _.split(name, '.');
-        return _.every(labels, (label) => {
-          // Bucket names must not contain uppercase characters or underscores.
-          if (label !== _.toLower(label) || label.includes('_')) {
-            errorName = 'containsUpperCase';
-            return false;
-          }
-          // Bucket names can contain lowercase letters, numbers, and hyphens.
-          if (!/^\S*$/.test(name) || !/[0-9a-z-]/.test(label)) {
-            errorName = 'onlyLowerCaseAndNumbers';
-            return false;
-          }
-          // Each label must start and end with a lowercase letter or a number.
-          return _.every([0, label.length - 1], (index) => {
-            errorName = 'lowerCaseOrNumber';
-            return /[a-z]/.test(label[index]) || _.isInteger(_.parseInt(label[index]));
-          });
-        });
-      });
-      if (!_.every(constraints, (func: Function) => func(control.value))) {
-        return observableTimer().pipe(
-          map(() => {
-            switch (errorName) {
-              case 'onlyLowerCaseAndNumbers':
-                return { onlyLowerCaseAndNumbers: true };
-              case 'shouldBeInRange':
-                return { shouldBeInRange: true };
-              case 'ipAddress':
-                return { ipAddress: true };
-              case 'containsUpperCase':
-                return { containsUpperCase: true };
-              case 'lowerCaseOrNumber':
-                return { lowerCaseOrNumber: true };
-              default:
-                return { bucketNameInvalid: true };
-            }
-          })
-        );
-      }
-      // - Bucket names must be unique.
-      return observableTimer().pipe(
-        switchMapTo(this.rgwBucketService.exists.call(this.rgwBucketService, control.value)),
-        map((resp: boolean) => {
-          if (!resp) {
-            return null;
-          } else {
-            return { bucketNameExists: true };
-          }
-        })
-      );
-    };
-  }
-
   areMfaCredentialsRequired() {
     return (
       this.isMfaDeleteEnabled !== this.isMfaDeleteAlreadyEnabled ||
index 515a0697dbc601faa59baf3c4f7365b059f0b191..479da864a44a6d4e8c049be00f7efa92a3b7f262 100644 (file)
@@ -140,7 +140,7 @@ export class RgwBucketListComponent extends ListWithDetails implements OnInit {
 
   getBucketList(context: CdTableFetchDataContext) {
     this.setTableRefreshTimeout();
-    this.rgwBucketService.list().subscribe(
+    this.rgwBucketService.list(true).subscribe(
       (resp: object[]) => {
         this.buckets = resp;
         this.transformBucketData();
index 4278b0c0d3a59c7b59c5f616db7d8debc62a50f8..ecf0bedf961d0d5fb5942e91bcd453daffd93554 100644 (file)
@@ -1,5 +1,6 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
 import { RouterTestingModule } from '@angular/router/testing';
 
@@ -7,6 +8,8 @@ import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
 import { PerformanceCounterModule } from '~/app/ceph/performance-counter/performance-counter.module';
+import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
+import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
 import { RgwSiteService } from '~/app/shared/api/rgw-site.service';
 import { Permissions } from '~/app/shared/models/permissions';
 import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
@@ -20,7 +23,18 @@ describe('RgwDaemonListComponent', () => {
   let fixture: ComponentFixture<RgwDaemonListComponent>;
   let getPermissionsSpy: jasmine.Spy;
   let getRealmsSpy: jasmine.Spy;
+  let listDaemonsSpy: jest.SpyInstance;
   const permissions = new Permissions({ grafana: ['read'] });
+  const daemon: RgwDaemon = {
+    id: '8000',
+    service_map_id: '4803',
+    version: 'ceph version',
+    server_hostname: 'ceph',
+    realm_name: 'realm1',
+    zonegroup_name: 'zg1-realm1',
+    zone_name: 'zone1-zg1-realm1',
+    default: true
+  };
 
   const expectTabsAndHeading = (length: number, heading: string) => {
     const tabs = TabHelper.getTextContents(fixture);
@@ -45,6 +59,9 @@ describe('RgwDaemonListComponent', () => {
     getPermissionsSpy.and.returnValue(new Permissions({}));
     getRealmsSpy = spyOn(TestBed.inject(RgwSiteService), 'get');
     getRealmsSpy.and.returnValue(of([]));
+    listDaemonsSpy = jest
+      .spyOn(TestBed.inject(RgwDaemonService), 'list')
+      .mockReturnValue(of([daemon]));
     fixture = TestBed.createComponent(RgwDaemonListComponent);
     component = fixture.componentInstance;
   });
@@ -54,6 +71,18 @@ describe('RgwDaemonListComponent', () => {
     expect(component).toBeTruthy();
   });
 
+  it('should show a row with daemon info', fakeAsync(() => {
+    fixture.detectChanges();
+    tick();
+    expect(listDaemonsSpy).toHaveBeenCalledTimes(1);
+    expect(component.daemons).toEqual([daemon]);
+    expect(fixture.debugElement.query(By.css('cd-table')).nativeElement.textContent).toContain(
+      'total 1'
+    );
+
+    fixture.destroy();
+  }));
+
   it('should only show Daemons List tab', () => {
     fixture.detectChanges();
 
index cb8ce571335d44203285a5dace19af7efd1a557d..c620843fb8acd85dabd90f6bbb4d49217a3770e3 100644 (file)
@@ -1,7 +1,6 @@
 import { Component, OnInit } from '@angular/core';
 
-import { take } from 'rxjs/operators';
-
+import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
 import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
 import { RgwSiteService } from '~/app/shared/api/rgw-site.service';
 import { ListWithDetails } from '~/app/shared/classes/list-with-details.class';
@@ -18,7 +17,7 @@ import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
 })
 export class RgwDaemonListComponent extends ListWithDetails implements OnInit {
   columns: CdTableColumn[] = [];
-  daemons: object[] = [];
+  daemons: RgwDaemon[] = [];
   grafanaPermission: Permission;
   isMultiSite: boolean;
 
@@ -44,14 +43,19 @@ export class RgwDaemonListComponent extends ListWithDetails implements OnInit {
         prop: 'server_hostname',
         flexGrow: 2
       },
+      {
+        name: $localize`Zone`,
+        prop: 'zone_name',
+        flexGrow: 2
+      },
       {
         name: $localize`Zone Group`,
         prop: 'zonegroup_name',
         flexGrow: 2
       },
       {
-        name: $localize`Zone`,
-        prop: 'zone_name',
+        name: $localize`Realm`,
+        prop: 'realm_name',
         flexGrow: 2
       },
       {
@@ -67,13 +71,12 @@ export class RgwDaemonListComponent extends ListWithDetails implements OnInit {
   }
 
   getDaemonList(context: CdTableFetchDataContext) {
-    this.rgwDaemonService.daemons$.pipe(take(1)).subscribe(
-      (resp: object[]) => {
-        this.daemons = resp;
-      },
-      () => {
-        context.error();
-      }
-    );
+    this.rgwDaemonService.list().subscribe(this.updateDaemons, () => {
+      context.error();
+    });
   }
+
+  private updateDaemons = (daemons: RgwDaemon[]) => {
+    this.daemons = daemons;
+  };
 }
index 24cf4ab5f548837b68610758f7f7ae11d1cef826..288297c25b3346d30b4c79da6550efd4540a27a7 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index ebd648d021acb46202b43c7ef6f30f54d1eaea61..2283f4c546f053982c7def5fbd5d9937c9abc555 100644 (file)
                   </div>
                 </td>
               </tr>
+              <tr *ngIf="user.mfa_ids?.length">
+                <td i18n
+                    class="bold">MFAs(Id)</td>
+                <td>{{ user.mfa_ids | join}}</td>
+              </tr>
             </tbody>
           </table>
 
index 126fdf44ff26468b1a7a8d258ccdb63615b010a2..62519cdf478c975e4e88d5b970c418fce53a6235 100644 (file)
@@ -71,4 +71,24 @@ describe('RgwUserDetailsComponent', () => {
 
     expect(detailsTab[11].textContent).toEqual('No');
   });
+
+  it('should show mfa ids only if length > 0', () => {
+    component.selection = {
+      uid: 'dashboard',
+      email: '',
+      system: 'true',
+      keys: [],
+      swift_keys: [],
+      mfa_ids: ['testMFA1', 'testMFA2']
+    };
+
+    component.ngOnChanges();
+    fixture.detectChanges();
+
+    const detailsTab = fixture.debugElement.nativeElement.querySelectorAll(
+      '.table.table-striped.table-bordered tr td'
+    );
+    expect(detailsTab[14].textContent).toEqual('MFAs(Id)');
+    expect(detailsTab[15].textContent).toEqual('testMFA1, testMFA2');
+  });
 });
index c0c619b3ec4e760b330d4abfe61d6d05f42c0fa5..bbf0c1688cc9c52f78c2403d7b764b5928479628 100644 (file)
@@ -4,7 +4,7 @@
         [formGroup]="userForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
 
       <div class="card-body">
index e48aaa7c406409de9f70440c9a81244ca1d2790e..34cccb9409d6bcc595c55c03e497061ef9574957 100644 (file)
@@ -1,6 +1,5 @@
 import { Component, NgZone, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
-import _ from 'lodash';
 import { forkJoin as observableForkJoin, Observable, Subscriber } from 'rxjs';
 
 import { RgwUserService } from '~/app/shared/api/rgw-user.service';
index a68534286c17cd75d79f78478824347c67c2d4ec..e51bc813f08df0b2270273a0c46cf532c3182382 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
index cbe5ae3976dd829d99d8a39e17552b25053b6be1..716342c9e6c9ad0736a11eb46133e62590cee209 100644 (file)
@@ -1,5 +1,5 @@
 <cd-modal [modalRef]="bsModalRef">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
+  <ng-container i18n="form title"
                 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
   <ng-container class="modal-content">
     <form #frm="ngForm"
index 200a6c544a6fbb4ba4401a41da1ccb75ccd9fc3a..00f3cf0f249dc2e6586616ad17031a00e252bc4c 100644 (file)
@@ -1,7 +1,6 @@
 <cd-modal [modalRef]="activeModal">
-  <ng-container i18n="form title|Example: Create Pool@@formTitle"
-                class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}
-  </ng-container>
+  <ng-container i18n="form title"
+                class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
 
   <ng-container class="modal-content">
     <div class="modal-body">
index 15a7275739f36d08c088bd0ba1238bbf6182b8f2..fc02e9bdeeefbad495ddd56826f61b5b30f99f29 100644 (file)
@@ -1,7 +1,11 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { Router } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
 
+import { of } from 'rxjs';
+
+import { AuthService } from '~/app/shared/api/auth.service';
 import { configureTestBed } from '~/testing/unit-test-helper';
 import { AuthModule } from '../auth.module';
 import { LoginComponent } from './login.component';
@@ -9,6 +13,8 @@ import { LoginComponent } from './login.component';
 describe('LoginComponent', () => {
   let component: LoginComponent;
   let fixture: ComponentFixture<LoginComponent>;
+  let routerNavigateSpy: jasmine.Spy;
+  let authServiceLoginSpy: jasmine.Spy;
 
   configureTestBed({
     imports: [RouterTestingModule, HttpClientTestingModule, AuthModule]
@@ -17,6 +23,10 @@ describe('LoginComponent', () => {
   beforeEach(() => {
     fixture = TestBed.createComponent(LoginComponent);
     component = fixture.componentInstance;
+    routerNavigateSpy = spyOn(TestBed.inject(Router), 'navigate');
+    routerNavigateSpy.and.returnValue(true);
+    authServiceLoginSpy = spyOn(TestBed.inject(AuthService), 'login');
+    authServiceLoginSpy.and.returnValue(of(null));
     fixture.detectChanges();
   });
 
@@ -29,4 +39,20 @@ describe('LoginComponent', () => {
     component.ngOnInit();
     expect(component['modalService'].hasOpenModals()).toBeFalsy();
   });
+
+  it('should not show create cluster wizard if cluster creation was successful', () => {
+    component.postInstalled = true;
+    component.login();
+
+    expect(routerNavigateSpy).toHaveBeenCalledTimes(1);
+    expect(routerNavigateSpy).toHaveBeenCalledWith(['/']);
+  });
+
+  it('should show create cluster wizard if cluster creation was failed', () => {
+    component.postInstalled = false;
+    component.login();
+
+    expect(routerNavigateSpy).toHaveBeenCalledTimes(1);
+    expect(routerNavigateSpy).toHaveBeenCalledWith(['/expand-cluster']);
+  });
 });
index 868ba66a002489cbd1e7ab3f48cfb2e8e46c7861..a98548f94c766086934804eb8618ddc91a42ec22 100644 (file)
@@ -17,6 +17,7 @@ export class LoginComponent implements OnInit {
   model = new Credentials();
   isLoginActive = false;
   returnUrl: string;
+  postInstalled = false;
 
   constructor(
     private authService: AuthService,
@@ -43,6 +44,7 @@ export class LoginComponent implements OnInit {
       }
       this.authService.check(token).subscribe((login: any) => {
         if (login.login_url) {
+          this.postInstalled = login.cluster_status === 'POST_INSTALLED';
           if (login.login_url === '#/login') {
             this.isLoginActive = true;
           } else {
@@ -63,7 +65,11 @@ export class LoginComponent implements OnInit {
 
   login() {
     this.authService.login(this.model).subscribe(() => {
-      const url = _.get(this.route.snapshot.queryParams, 'returnUrl', '/');
+      const urlPath = this.postInstalled ? '/' : '/expand-cluster';
+      let url = _.get(this.route.snapshot.queryParams, 'returnUrl', urlPath);
+      if (!this.postInstalled && this.route.snapshot.queryParams['returnUrl'] === '/dashboard') {
+        url = '/expand-cluster';
+      }
       this.router.navigate([url]);
     });
   }
index ce395236545ecd163942dbc184112bfe73b69262..08904c1c2b3366fed37bf5c6c06fe3290af31d8c 100644 (file)
@@ -5,7 +5,7 @@
         [formGroup]="roleForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
       <div class="card-body">
 
index 098b15e97af1ad27eb527e6cdf28d7dadcc5d77f..df97face81a3f215f2f02669375975ef2ab6668f 100644 (file)
@@ -5,7 +5,7 @@
         [formGroup]="userForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
       <div class="card-body">
 
index 64a679a32ba1b04f1d13de18a0262060f8433d13..83eb409446e0c11f6a8b8fce58cd5556f74580b7 100644 (file)
@@ -3,7 +3,7 @@
         [formGroup]="userForm"
         novalidate>
     <div class="card">
-      <div i18n="form title|Example: Create Pool@@formTitle"
+      <div i18n="form title"
            class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
 
       <div class="card-body">
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.spec.ts
new file mode 100644 (file)
index 0000000..0d521a8
--- /dev/null
@@ -0,0 +1,11 @@
+import { ApiClient } from '~/app/shared/api/api-client';
+
+class MockApiClient extends ApiClient {}
+
+describe('ApiClient', () => {
+  const service = new MockApiClient();
+
+  it('should get the version header value', () => {
+    expect(service.getVersionHeaderValue(1, 2)).toBe('application/vnd.ceph.api.v1.2+json');
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/api-client.ts
new file mode 100644 (file)
index 0000000..06583eb
--- /dev/null
@@ -0,0 +1,5 @@
+export abstract class ApiClient {
+  getVersionHeaderValue(major: number, minor: number) {
+    return `application/vnd.ceph.api.v${major}.${minor}+json`;
+  }
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.spec.ts
new file mode 100644 (file)
index 0000000..758f670
--- /dev/null
@@ -0,0 +1,42 @@
+import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
+import { fakeAsync, TestBed } from '@angular/core/testing';
+
+import { configureTestBed } from '~/testing/unit-test-helper';
+import { ClusterService } from './cluster.service';
+
+describe('ClusterService', () => {
+  let service: ClusterService;
+  let httpTesting: HttpTestingController;
+
+  configureTestBed({
+    imports: [HttpClientTestingModule],
+    providers: [ClusterService]
+  });
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({});
+    service = TestBed.inject(ClusterService);
+    httpTesting = TestBed.inject(HttpTestingController);
+  });
+
+  afterEach(() => {
+    httpTesting.verify();
+  });
+
+  it('should be created', () => {
+    expect(service).toBeTruthy();
+  });
+
+  it('should call getStatus', () => {
+    service.getStatus().subscribe();
+    const req = httpTesting.expectOne('api/cluster');
+    expect(req.request.method).toBe('GET');
+  });
+
+  it('should update cluster status', fakeAsync(() => {
+    service.updateStatus('fakeStatus').subscribe();
+    const req = httpTesting.expectOne('api/cluster');
+    expect(req.request.method).toBe('PUT');
+    expect(req.request.body).toEqual({ status: 'fakeStatus' });
+  }));
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.ts
new file mode 100644 (file)
index 0000000..6b435d6
--- /dev/null
@@ -0,0 +1,27 @@
+import { HttpClient } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+
+import { Observable } from 'rxjs';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class ClusterService {
+  baseURL = 'api/cluster';
+
+  constructor(private http: HttpClient) {}
+
+  getStatus(): Observable<string> {
+    return this.http.get<string>(`${this.baseURL}`, {
+      headers: { Accept: 'application/vnd.ceph.api.v0.1+json' }
+    });
+  }
+
+  updateStatus(status: string) {
+    return this.http.put(
+      `${this.baseURL}`,
+      { status: status },
+      { headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } }
+    );
+  }
+}
index 8a7de5e25d6341b3da26067126c49cb0114ad4af..797f94455a2528a7e0a6c975454e9404d32e702e 100644 (file)
@@ -28,8 +28,8 @@ describe('HostService', () => {
 
   it('should call list', fakeAsync(() => {
     let result;
-    service.list().subscribe((resp) => (result = resp));
-    const req = httpTesting.expectOne('api/host');
+    service.list('true').subscribe((resp) => (result = resp));
+    const req = httpTesting.expectOne('api/host?facts=true');
     expect(req.request.method).toBe('GET');
     req.flush(['foo', 'bar']);
     tick();
index 7f8956baa263d1919219e475b87088d05b408384..f7294f36d21a991afee196803af64decac009462 100644 (file)
@@ -7,6 +7,8 @@ import { map, mergeMap, toArray } from 'rxjs/operators';
 
 import { InventoryDevice } from '~/app/ceph/cluster/inventory/inventory-devices/inventory-device.model';
 import { InventoryHost } from '~/app/ceph/cluster/inventory/inventory-host.model';
+import { ApiClient } from '~/app/shared/api/api-client';
+import { CdHelperClass } from '~/app/shared/classes/cd-helper.class';
 import { Daemon } from '../models/daemon.interface';
 import { CdDevice } from '../models/devices';
 import { SmartDataResponseV1 } from '../models/smart';
@@ -15,21 +17,28 @@ import { DeviceService } from '../services/device.service';
 @Injectable({
   providedIn: 'root'
 })
-export class HostService {
+export class HostService extends ApiClient {
   baseURL = 'api/host';
   baseUIURL = 'ui-api/host';
 
-  constructor(private http: HttpClient, private deviceService: DeviceService) {}
+  predefinedLabels = ['mon', 'mgr', 'osd', 'mds', 'rgw', 'nfs', 'iscsi', 'rbd', 'grafana'];
 
-  list(): Observable<object[]> {
-    return this.http.get<object[]>(this.baseURL);
+  constructor(private http: HttpClient, private deviceService: DeviceService) {
+    super();
+  }
+
+  list(facts: string): Observable<object[]> {
+    return this.http.get<object[]>(this.baseURL, {
+      headers: { Accept: 'application/vnd.ceph.api.v1.1+json' },
+      params: { facts: facts }
+    });
   }
 
   create(hostname: string, addr: string, labels: string[], status: string) {
     return this.http.post(
       this.baseURL,
       { hostname: hostname, addr: addr, labels: labels, status: status },
-      { observe: 'response', headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } }
+      { observe: 'response', headers: { Accept: CdHelperClass.cdVersionHeader('0', '1') } }
     );
   }
 
@@ -70,7 +79,7 @@ export class HostService {
         maintenance: maintenance,
         force: force
       },
-      { headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } }
+      { headers: { Accept: this.getVersionHeaderValue(0, 1) } }
     );
   }
 
index 07f5a1890fbd38bce42a2bfc419fd78d995d14ee..139fa490bfd82ef1684ce9fcc5eab6a69503120a 100644 (file)
@@ -1,5 +1,5 @@
 import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
-import { TestBed } from '@angular/core/testing';
+import { fakeAsync, TestBed, tick } from '@angular/core/testing';
 
 import { configureTestBed } from '~/testing/unit-test-helper';
 import { NfsService } from './nfs.service';
@@ -46,8 +46,8 @@ describe('NfsService', () => {
   });
 
   it('should call update', () => {
-    service.update('cluster_id', 'export_id', 'foo').subscribe();
-    const req = httpTesting.expectOne('api/nfs-ganesha/export/cluster_id/export_id');
+    service.update('cluster_id', 1, 'foo').subscribe();
+    const req = httpTesting.expectOne('api/nfs-ganesha/export/cluster_id/1');
     expect(req.request.body).toEqual('foo');
     expect(req.request.method).toBe('PUT');
   });
@@ -64,27 +64,11 @@ describe('NfsService', () => {
     expect(req.request.method).toBe('GET');
   });
 
-  it('should call buckets', () => {
-    service.buckets('user_foo').subscribe();
-    const req = httpTesting.expectOne('ui-api/nfs-ganesha/rgw/buckets?user_id=user_foo');
-    expect(req.request.method).toBe('GET');
-  });
-
-  it('should call daemon', () => {
-    service.daemon().subscribe();
-    const req = httpTesting.expectOne('api/nfs-ganesha/daemon');
-    expect(req.request.method).toBe('GET');
-  });
-
-  it('should call start', () => {
-    service.start('host_name').subscribe();
-    const req = httpTesting.expectOne('api/nfs-ganesha/service/host_name/start');
-    expect(req.request.method).toBe('PUT');
-  });
-
-  it('should call stop', () => {
-    service.stop('host_name').subscribe();
-    const req = httpTesting.expectOne('api/nfs-ganesha/service/host_name/stop');
-    expect(req.request.method).toBe('PUT');
-  });
+  it('should not call lsDir if volume is not provided', fakeAsync(() => {
+    service.lsDir('', 'foo_dir').subscribe({
+      error: (error: string) => expect(error).toEqual('Please specify a filesystem volume.')
+    });
+    tick();
+    httpTesting.expectNone('ui-api/nfs-ganesha/lsdir/?root_dir=foo_dir');
+  }));
 });
index 997faab9344e4b49347eb6cd472814ab381dfb73..636335673978f57619adf54f648830404070182e 100644 (file)
@@ -1,10 +1,19 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
+import { Observable, throwError } from 'rxjs';
+
+import { NfsFSAbstractionLayer } from '~/app/ceph/nfs/models/nfs.fsal';
+import { ApiClient } from '~/app/shared/api/api-client';
+
+export interface Directory {
+  paths: string[];
+}
+
 @Injectable({
   providedIn: 'root'
 })
-export class NfsService {
+export class NfsService extends ApiClient {
   apiPath = 'api/nfs-ganesha';
   uiApiPath = 'ui-api/nfs-ganesha';
 
@@ -17,34 +26,30 @@ export class NfsService {
       value: 'RO',
       help: $localize`Allows only operations that do not modify the server`
     },
-    {
-      value: 'MDONLY',
-      help: $localize`Does not allow read or write operations, but allows any other operation`
-    },
-    {
-      value: 'MDONLY_RO',
-      help: $localize`Does not allow read, write, or any operation that modifies file attributes or directory content`
-    },
     {
       value: 'NONE',
       help: $localize`Allows no access at all`
     }
   ];
 
-  nfsFsal = [
+  nfsFsal: NfsFSAbstractionLayer[] = [
     {
       value: 'CEPH',
-      descr: $localize`CephFS`
+      descr: $localize`CephFS`,
+      disabled: false
     },
     {
       value: 'RGW',
-      descr: $localize`Object Gateway`
+      descr: $localize`Object Gateway`,
+      disabled: false
     }
   ];
 
   nfsSquash = ['no_root_squash', 'root_id_squash', 'root_squash', 'all_squash'];
 
-  constructor(private http: HttpClient) {}
+  constructor(private http: HttpClient) {
+    super();
+  }
 
   list() {
     return this.http.get(`${this.apiPath}/export`);
@@ -55,29 +60,37 @@ export class NfsService {
   }
 
   create(nfs: any) {
-    return this.http.post(`${this.apiPath}/export`, nfs, { observe: 'response' });
+    return this.http.post(`${this.apiPath}/export`, nfs, {
+      headers: { Accept: this.getVersionHeaderValue(2, 0) },
+      observe: 'response'
+    });
   }
 
-  update(clusterId: string, id: string, nfs: any) {
-    return this.http.put(`${this.apiPath}/export/${clusterId}/${id}`, nfs, { observe: 'response' });
+  update(clusterId: string, id: number, nfs: any) {
+    return this.http.put(`${this.apiPath}/export/${clusterId}/${id}`, nfs, {
+      headers: { Accept: this.getVersionHeaderValue(2, 0) },
+      observe: 'response'
+    });
   }
 
   delete(clusterId: string, exportId: string) {
     return this.http.delete(`${this.apiPath}/export/${clusterId}/${exportId}`, {
+      headers: { Accept: this.getVersionHeaderValue(2, 0) },
       observe: 'response'
     });
   }
 
-  lsDir(fs_name: string, root_dir: string) {
-    return this.http.get(`${this.uiApiPath}/lsdir/${fs_name}?root_dir=${root_dir}`);
-  }
-
-  buckets(user_id: string) {
-    return this.http.get(`${this.uiApiPath}/rgw/buckets?user_id=${user_id}`);
+  listClusters() {
+    return this.http.get(`${this.apiPath}/cluster`, {
+      headers: { Accept: this.getVersionHeaderValue(0, 1) }
+    });
   }
 
-  clients() {
-    return this.http.get(`${this.uiApiPath}/cephx/clients`);
+  lsDir(fs_name: string, root_dir: string): Observable<Directory> {
+    if (!fs_name) {
+      return throwError($localize`Please specify a filesystem volume.`);
+    }
+    return this.http.get<Directory>(`${this.uiApiPath}/lsdir/${fs_name}?root_dir=${root_dir}`);
   }
 
   fsals() {
@@ -87,20 +100,4 @@ export class NfsService {
   filesystems() {
     return this.http.get(`${this.uiApiPath}/cephfs/filesystems`);
   }
-
-  daemon() {
-    return this.http.get(`${this.apiPath}/daemon`);
-  }
-
-  start(host_name: string) {
-    return this.http.put(`${this.apiPath}/service/${host_name}/start`, null, {
-      observe: 'response'
-    });
-  }
-
-  stop(host_name: string) {
-    return this.http.put(`${this.apiPath}/service/${host_name}/stop`, null, {
-      observe: 'response'
-    });
-  }
 }
index 9bff8083936e1fd2d6f07d89a05fa6e9a939a16f..e33f2c3fc0fa1df8cac30fcc2dd4e36693485678 100644 (file)
@@ -5,6 +5,7 @@ import _ from 'lodash';
 import { map } from 'rxjs/operators';
 
 import { CdDevice } from '../models/devices';
+import { InventoryDeviceType } from '../models/inventory-device-type.model';
 import { SmartDataResponseV1 } from '../models/smart';
 import { DeviceService } from '../services/device.service';
 
@@ -13,6 +14,7 @@ import { DeviceService } from '../services/device.service';
 })
 export class OsdService {
   private path = 'api/osd';
+  osdDevices: InventoryDeviceType[] = [];
 
   osdRecvSpeedModalPriorities = {
     KNOWN_PRIORITIES: [
index 6e3fbf660ca2f740f59e2023c59c1aa9b4853073..b22b67e349123c244dc7ad0f24c2f7c8c9fe4001 100644 (file)
@@ -29,7 +29,15 @@ describe('RgwBucketService', () => {
 
   it('should call list', () => {
     service.list().subscribe();
-    const req = httpTesting.expectOne(`api/rgw/bucket?${RgwHelper.DAEMON_QUERY_PARAM}&stats=true`);
+    const req = httpTesting.expectOne(`api/rgw/bucket?${RgwHelper.DAEMON_QUERY_PARAM}&stats=false`);
+    expect(req.request.method).toBe('GET');
+  });
+
+  it('should call list with stats and user id', () => {
+    service.list(true, 'test-name').subscribe();
+    const req = httpTesting.expectOne(
+      `api/rgw/bucket?${RgwHelper.DAEMON_QUERY_PARAM}&stats=true&uid=test-name`
+    );
     expect(req.request.method).toBe('GET');
   });
 
index 47126f186d19c4b8bf61198f9543ff589d8e6adc..fc88bfa7181649658c4c04005d7dd12ef750f7a7 100644 (file)
@@ -5,6 +5,7 @@ import _ from 'lodash';
 import { of as observableOf } from 'rxjs';
 import { catchError, mapTo } from 'rxjs/operators';
 
+import { ApiClient } from '~/app/shared/api/api-client';
 import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
 import { cdEncode } from '~/app/shared/decorators/cd-encode';
 
@@ -12,19 +13,27 @@ import { cdEncode } from '~/app/shared/decorators/cd-encode';
 @Injectable({
   providedIn: 'root'
 })
-export class RgwBucketService {
+export class RgwBucketService extends ApiClient {
   private url = 'api/rgw/bucket';
 
-  constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) {}
+  constructor(private http: HttpClient, private rgwDaemonService: RgwDaemonService) {
+    super();
+  }
 
   /**
    * Get the list of buckets.
    * @return Observable<Object[]>
    */
-  list() {
+  list(stats: boolean = false, uid: string = '') {
     return this.rgwDaemonService.request((params: HttpParams) => {
-      params = params.append('stats', 'true');
-      return this.http.get(this.url, { params: params });
+      params = params.append('stats', stats.toString());
+      if (uid) {
+        params = params.append('uid', uid);
+      }
+      return this.http.get(this.url, {
+        headers: { Accept: this.getVersionHeaderValue(1, 1) },
+        params: params
+      });
     });
   }
 
index 6f96c6ab51a593754d0f116d1c08e3aad6dc5272..93ef3378693672386fefbd25c5057661e704d10d 100644 (file)
@@ -50,7 +50,7 @@ describe('RgwDaemonService', () => {
     expect(service['daemons'].getValue()).toEqual(daemonList);
   });
 
-  it('should get daemon ', () => {
+  it('should call "get daemon"', () => {
     service.get('foo').subscribe();
     const req = httpTesting.expectOne('api/rgw/daemon/foo');
     expect(req.request.method).toBe('GET');
index bc81dacf47e0c9174055c2c3f615e4fd8f249db4..c947f3ed4559728f3b5d006cd80877057dc84294 100644 (file)
@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
 
 import _ from 'lodash';
 import { BehaviorSubject, Observable, of, throwError } from 'rxjs';
-import { mergeMap, retryWhen, take, tap } from 'rxjs/operators';
+import { mergeMap, take, tap } from 'rxjs/operators';
 
 import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
 import { cdEncode } from '~/app/shared/decorators/cd-encode';
@@ -59,17 +59,15 @@ export class RgwDaemonService {
   request(next: (params: HttpParams) => Observable<any>) {
     return this.selectedDaemon.pipe(
       mergeMap((daemon: RgwDaemon) =>
-        // If there is no selected daemon, retrieve daemon list (default daemon will be selected)
-        // and try again if daemon list is not empty.
+        // If there is no selected daemon, retrieve daemon list so default daemon will be selected.
         _.isEmpty(daemon)
-          ? this.list().pipe(mergeMap((daemons) => throwError(!_.isEmpty(daemons))))
+          ? this.list().pipe(
+              mergeMap((daemons) =>
+                _.isEmpty(daemons) ? throwError('No RGW daemons found!') : this.selectedDaemon$
+              )
+            )
           : of(daemon)
       ),
-      retryWhen((error) =>
-        error.pipe(
-          mergeMap((hasToRetry) => (hasToRetry ? error : throwError('No RGW daemons found!')))
-        )
-      ),
       take(1),
       mergeMap((daemon: RgwDaemon) => {
         let params = new HttpParams();
index 545179dcf1abe44f7ccc7d8ebc90fb237e89226e..49589c83f4e071a23a75a77a621713435585ef6b 100644 (file)
@@ -1,6 +1,10 @@
 import { HttpClient, HttpParams } from '@angular/common/http';
 import { Injectable } from '@angular/core';
 
+import { Observable } from 'rxjs';
+import { map, mergeMap } from 'rxjs/operators';
+
+import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
 import { RgwDaemonService } from '~/app/shared/api/rgw-daemon.service';
 import { cdEncode } from '~/app/shared/decorators/cd-encode';
 
@@ -21,4 +25,14 @@ export class RgwSiteService {
       return this.http.get(this.url, { params: params });
     });
   }
+
+  isDefaultRealm(): Observable<boolean> {
+    return this.get('default-realm').pipe(
+      mergeMap((defaultRealm: string) =>
+        this.rgwDaemonService.selectedDaemon$.pipe(
+          map((selectedDaemon: RgwDaemon) => selectedDaemon.realm_name === defaultRealm)
+        )
+      )
+    );
+  }
 }
index 5c872b42fd83a98fb1cc6038f9b3998b4df180fb..25057312536ac11acb3faba7a1e22f8b2ca6e8a7 100644 (file)
@@ -21,4 +21,8 @@ export class CdHelperClass {
 
     return hasChanges;
   }
+
+  static cdVersionHeader(major_ver: string, minor_ver: string) {
+    return `application/vnd.ceph.api.v${major_ver}.${minor_ver}+json`;
+  }
 }
index ef8b423a3a70c55e583e331197e5b0852935b319..a6d0624d31885d162000fc39dbc6b09078f6ab9f 100644 (file)
@@ -45,6 +45,7 @@ import { SparklineComponent } from './sparkline/sparkline.component';
 import { SubmitButtonComponent } from './submit-button/submit-button.component';
 import { TelemetryNotificationComponent } from './telemetry-notification/telemetry-notification.component';
 import { UsageBarComponent } from './usage-bar/usage-bar.component';
+import { WizardComponent } from './wizard/wizard.component';
 
 @NgModule({
   imports: [
@@ -93,7 +94,8 @@ import { UsageBarComponent } from './usage-bar/usage-bar.component';
     Copy2ClipboardButtonComponent,
     DownloadButtonComponent,
     FormButtonPanelComponent,
-    MotdComponent
+    MotdComponent,
+    WizardComponent
   ],
   providers: [],
   exports: [
@@ -120,7 +122,8 @@ import { UsageBarComponent } from './usage-bar/usage-bar.component';
     Copy2ClipboardButtonComponent,
     DownloadButtonComponent,
     FormButtonPanelComponent,
-    MotdComponent
+    MotdComponent,
+    WizardComponent
   ]
 })
 export class ComponentsModule {}
index 5cbd4f58c52fa4515e72ce129db817d96abc5e48..657e0d6053f89fbc5b2bf94dccb26a0746b4cb4d 100644 (file)
@@ -1,13 +1,19 @@
-<div class="modal-header">
-  <h4 class="modal-title float-left">
-    <ng-content select=".modal-title"></ng-content>
-  </h4>
-  <button type="button"
-          class="close float-right"
-          aria-label="Close"
-          (click)="close()">
-    <span aria-hidden="true">&times;</span>
-  </button>
-</div>
+<div [ngClass]="pageURL ? 'modal' : ''">
+  <div [ngClass]="pageURL ? 'modal-dialog' : ''">
+    <div class="modal-content">
+      <div class="modal-header">
+        <h4 class="modal-title float-left">
+          <ng-content select=".modal-title"></ng-content>
+        </h4>
+        <button type="button"
+                class="close float-right"
+                aria-label="Close"
+                (click)="close()">
+          <span aria-hidden="true">&times;</span>
+        </button>
+      </div>
 
-<ng-content select=".modal-content"></ng-content>
+      <ng-content select=".modal-content"></ng-content>
+    </div>
+  </div>
+</div>
index d3ee1ca2abd19feb7f58f5ef52dff2a2b9f61352..cf08bef10090d7713f8740131dd256a7711b64e0 100644 (file)
@@ -1,4 +1,6 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { Router } from '@angular/router';
+import { RouterTestingModule } from '@angular/router/testing';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
@@ -8,14 +10,18 @@ import { ModalComponent } from './modal.component';
 describe('ModalComponent', () => {
   let component: ModalComponent;
   let fixture: ComponentFixture<ModalComponent>;
+  let routerNavigateSpy: jasmine.Spy;
 
   configureTestBed({
-    declarations: [ModalComponent]
+    declarations: [ModalComponent],
+    imports: [RouterTestingModule]
   });
 
   beforeEach(() => {
     fixture = TestBed.createComponent(ModalComponent);
     component = fixture.componentInstance;
+    routerNavigateSpy = spyOn(TestBed.inject(Router), 'navigate');
+    routerNavigateSpy.and.returnValue(true);
     fixture.detectChanges();
   });
 
@@ -38,4 +44,11 @@ describe('ModalComponent', () => {
     component.close();
     expect(component.modalRef.close).toHaveBeenCalled();
   });
+
+  it('should hide the routed modal', () => {
+    component.pageURL = 'hosts';
+    component.close();
+    expect(routerNavigateSpy).toHaveBeenCalledTimes(1);
+    expect(routerNavigateSpy).toHaveBeenCalledWith(['hosts', { outlets: { modal: null } }]);
+  });
 });
index 730da6d62527b811a1056cdd79fc8351506d212a..25e06e62af188470e62f81ccc5f2e99ea924e21d 100644 (file)
@@ -1,4 +1,5 @@
 import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Router } from '@angular/router';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 
@@ -10,6 +11,8 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 export class ModalComponent {
   @Input()
   modalRef: NgbActiveModal;
+  @Input()
+  pageURL: string;
 
   /**
    * Should be a function that is triggered when the modal is hidden.
@@ -17,8 +20,12 @@ export class ModalComponent {
   @Output()
   hide = new EventEmitter();
 
+  constructor(private router: Router) {}
+
   close() {
-    this.modalRef?.close();
+    this.pageURL
+      ? this.router.navigate([this.pageURL, { outlets: { modal: null } }])
+      : this.modalRef?.close();
     this.hide.emit();
   }
 }
index 190944311bed978827b41cf838c9e9d6143dfc84..1533b94395eb457a3c112e1335642487585d1202 100644 (file)
@@ -63,6 +63,7 @@
 <a class="select-menu-edit float-left"
    [ngClass]="elemClass"
    [ngbPopover]="popTemplate"
+   data-testid="select-menu-edit"
    *ngIf="customBadges || options.length > 0">
   <ng-content></ng-content>
 </a>
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.html b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.html
new file mode 100644 (file)
index 0000000..25aa3e1
--- /dev/null
@@ -0,0 +1,19 @@
+<div class="card-body">
+  <div class="row m-7">
+    <nav class="col">
+      <ul class="nav nav-pills flex-column"
+          *ngFor="let step of steps | async; let i = index;">
+        <li class="nav-item">
+          <a class="nav-link"
+             (click)="onStepClick(step)"
+             [ngClass]="{active: currentStep.stepIndex === step.stepIndex}">
+            <span class="circle-step"
+                  [ngClass]="{active: currentStep.stepIndex === step.stepIndex}"
+                  i18n>{{ step.stepIndex }}</span>
+            <span i18n>{{ stepsTitle[i] }}</span>
+          </a>
+        </li>
+      </ul>
+    </nav>
+  </div>
+</div>
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.scss b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.scss
new file mode 100644 (file)
index 0000000..80e3550
--- /dev/null
@@ -0,0 +1,30 @@
+@use './src/styles/vendor/variables' as vv;
+
+.card-body {
+  padding-left: 0;
+}
+
+span.circle-step {
+  background: vv.$gray-500;
+  border-radius: 0.8em;
+  color: vv.$white;
+  display: inline-block;
+  font-weight: bold;
+  line-height: 1.6em;
+  margin-right: 5px;
+  text-align: center;
+  width: 1.6em;
+
+  &.active {
+    background-color: vv.$primary;
+  }
+}
+
+.nav-pills .nav-link {
+  background-color: vv.$white;
+  color: vv.$gray-800;
+
+  &.active {
+    color: vv.$primary;
+  }
+}
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.spec.ts
new file mode 100644 (file)
index 0000000..b42578f
--- /dev/null
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SharedModule } from '~/app/shared/shared.module';
+import { configureTestBed } from '~/testing/unit-test-helper';
+import { WizardComponent } from './wizard.component';
+
+describe('WizardComponent', () => {
+  let component: WizardComponent;
+  let fixture: ComponentFixture<WizardComponent>;
+
+  configureTestBed({
+    imports: [SharedModule]
+  });
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(WizardComponent);
+    component = fixture.componentInstance;
+    component.stepsTitle = ['Add Hosts', 'Review'];
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/wizard/wizard.component.ts
new file mode 100644 (file)
index 0000000..d46aa48
--- /dev/null
@@ -0,0 +1,39 @@
+import { Component, Input, OnDestroy, OnInit } from '@angular/core';
+
+import * as _ from 'lodash';
+import { Observable, Subscription } from 'rxjs';
+
+import { WizardStepModel } from '~/app/shared/models/wizard-steps';
+import { WizardStepsService } from '~/app/shared/services/wizard-steps.service';
+
+@Component({
+  selector: 'cd-wizard',
+  templateUrl: './wizard.component.html',
+  styleUrls: ['./wizard.component.scss']
+})
+export class WizardComponent implements OnInit, OnDestroy {
+  @Input()
+  stepsTitle: string[];
+
+  steps: Observable<WizardStepModel[]>;
+  currentStep: WizardStepModel;
+  currentStepSub: Subscription;
+
+  constructor(private stepsService: WizardStepsService) {}
+
+  ngOnInit(): void {
+    this.stepsService.setTotalSteps(this.stepsTitle.length);
+    this.steps = this.stepsService.getSteps();
+    this.currentStepSub = this.stepsService.getCurrentStep().subscribe((step: WizardStepModel) => {
+      this.currentStep = step;
+    });
+  }
+
+  onStepClick(step: WizardStepModel) {
+    this.stepsService.setCurrentStep(step);
+  }
+
+  ngOnDestroy(): void {
+    this.currentStepSub.unsubscribe();
+  }
+}
index 05d6b5c53a9ada733670502178c1c865389cd0fb..5b668ad9000deb1f893fe16def1deac443615547 100644 (file)
@@ -7,6 +7,7 @@ export class AppConstants {
   public static readonly projectName = 'Ceph Dashboard';
   public static readonly license = 'Free software (LGPL 2.1).';
   public static readonly copyright = 'Copyright(c) ' + environment.year + ' Ceph contributors.';
+  public static readonly cephLogo = 'assets/Ceph_Logo.svg';
 }
 
 export enum URLVerbs {
index 307407a2fc58398358f36f418ef9831865d3d1a9..9741b1e6377b82b471ab5081a30feced20284b9b 100644 (file)
@@ -1,5 +1,5 @@
 import { Injectable } from '@angular/core';
-import { FormBuilder } from '@angular/forms';
+import { AbstractControlOptions, FormBuilder } from '@angular/forms';
 
 import { CdFormGroup } from './cd-form-group';
 
@@ -12,7 +12,7 @@ import { CdFormGroup } from './cd-form-group';
 export class CdFormBuilder extends FormBuilder {
   group(
     controlsConfig: { [key: string]: any },
-    extra: { [key: string]: any } | null = null
+    extra: AbstractControlOptions | null = null
   ): CdFormGroup {
     const form = super.group(controlsConfig, extra);
     return new CdFormGroup(form.controls, form.validator, form.asyncValidator);
index 557a179cc5aff63629d7f08a544a814e16648279..5cf90fdea5cb3b68af08cda544bc2391c686e749 100644 (file)
@@ -1,11 +1,24 @@
 import { fakeAsync, tick } from '@angular/core/testing';
 import { FormControl, Validators } from '@angular/forms';
 
+import _ from 'lodash';
 import { of as observableOf } from 'rxjs';
 
+import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service';
+import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
+import { CdValidators } from '~/app/shared/forms/cd-validators';
 import { FormHelper } from '~/testing/unit-test-helper';
-import { CdFormGroup } from './cd-form-group';
-import { CdValidators } from './cd-validators';
+
+let mockBucketExists = observableOf(true);
+jest.mock('~/app/shared/api/rgw-bucket.service', () => {
+  return {
+    RgwBucketService: jest.fn().mockImplementation(() => {
+      return {
+        exists: () => mockBucketExists
+      };
+    })
+  };
+});
 
 describe('CdValidators', () => {
   let formHelper: FormHelper;
@@ -755,4 +768,139 @@ describe('CdValidators', () => {
       });
     });
   });
+  describe('bucket', () => {
+    const testValidator = (name: string, valid: boolean, expectedError?: string) => {
+      formHelper.setValue('x', name, true);
+      tick();
+      if (valid) {
+        formHelper.expectValid('x');
+      } else {
+        formHelper.expectError('x', expectedError);
+      }
+    };
+
+    describe('bucketName', () => {
+      beforeEach(() => {
+        form = new CdFormGroup({
+          x: new FormControl('', null, CdValidators.bucketName())
+        });
+        formHelper = new FormHelper(form);
+      });
+
+      it('bucket name cannot be empty', fakeAsync(() => {
+        testValidator('', false, 'required');
+      }));
+
+      it('bucket names cannot be formatted as IP address', fakeAsync(() => {
+        const testIPs = ['1.1.1.01', '001.1.1.01', '127.0.0.1'];
+        for (const ip of testIPs) {
+          testValidator(ip, false, 'ipAddress');
+        }
+      }));
+
+      it('bucket name must be >= 3 characters long (1/2)', fakeAsync(() => {
+        testValidator('ab', false, 'shouldBeInRange');
+      }));
+
+      it('bucket name must be >= 3 characters long (2/2)', fakeAsync(() => {
+        testValidator('abc', true);
+      }));
+
+      it('bucket name must be <= than 63 characters long (1/2)', fakeAsync(() => {
+        testValidator(_.repeat('a', 64), false, 'shouldBeInRange');
+      }));
+
+      it('bucket name must be <= than 63 characters long (2/2)', fakeAsync(() => {
+        testValidator(_.repeat('a', 63), true);
+      }));
+
+      it('bucket names must not contain uppercase characters or underscores (1/2)', fakeAsync(() => {
+        testValidator('iAmInvalid', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names can only contain lowercase letters, numbers, periods and hyphens', fakeAsync(() => {
+        testValidator('bk@2', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names must not contain uppercase characters or underscores (2/2)', fakeAsync(() => {
+        testValidator('i_am_invalid', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names must start and end with letters or numbers', fakeAsync(() => {
+        testValidator('abcd-', false, 'lowerCaseOrNumber');
+      }));
+
+      it('bucket labels cannot be empty', fakeAsync(() => {
+        testValidator('bk.', false, 'onlyLowerCaseAndNumbers');
+      }));
+
+      it('bucket names with invalid labels (1/3)', fakeAsync(() => {
+        testValidator('abc.1def.Ghi2', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names with invalid labels (2/3)', fakeAsync(() => {
+        testValidator('abc.1_xy', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names with invalid labels (3/3)', fakeAsync(() => {
+        testValidator('abc.*def', false, 'bucketNameInvalid');
+      }));
+
+      it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (1/3)', fakeAsync(() => {
+        testValidator('xyz.abc', true);
+      }));
+
+      it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (2/3)', fakeAsync(() => {
+        testValidator('abc.1-def', true);
+      }));
+
+      it('bucket names must be a series of one or more labels and can contain lowercase letters, numbers, and hyphens (3/3)', fakeAsync(() => {
+        testValidator('abc.ghi2', true);
+      }));
+
+      it('bucket names must be unique', fakeAsync(() => {
+        testValidator('bucket-name-is-unique', true);
+      }));
+
+      it('bucket names must not contain spaces', fakeAsync(() => {
+        testValidator('bucket name  with   spaces', false, 'bucketNameInvalid');
+      }));
+    });
+
+    describe('bucketExistence', () => {
+      const rgwBucketService = new RgwBucketService(undefined, undefined);
+
+      beforeEach(() => {
+        form = new CdFormGroup({
+          x: new FormControl('', null, CdValidators.bucketExistence(false, rgwBucketService))
+        });
+        formHelper = new FormHelper(form);
+      });
+
+      it('bucket name cannot be empty', fakeAsync(() => {
+        testValidator('', false, 'required');
+      }));
+
+      it('bucket name should not exist but it does', fakeAsync(() => {
+        testValidator('testName', false, 'bucketNameNotAllowed');
+      }));
+
+      it('bucket name should not exist and it does not', fakeAsync(() => {
+        mockBucketExists = observableOf(false);
+        testValidator('testName', true);
+      }));
+
+      it('bucket name should exist but it does not', fakeAsync(() => {
+        form.get('x').setAsyncValidators(CdValidators.bucketExistence(true, rgwBucketService));
+        mockBucketExists = observableOf(false);
+        testValidator('testName', false, 'bucketNameNotAllowed');
+      }));
+
+      it('bucket name should exist and it does', fakeAsync(() => {
+        form.get('x').setAsyncValidators(CdValidators.bucketExistence(true, rgwBucketService));
+        mockBucketExists = observableOf(true);
+        testValidator('testName', true);
+      }));
+    });
+  });
 });
index 53fcc747b9f2acd97b7417056390806ec31f75d1..22371a50f71ecd0b85b65dd54842443c54a5ee65 100644 (file)
@@ -10,8 +10,9 @@ import _ from 'lodash';
 import { Observable, of as observableOf, timer as observableTimer } from 'rxjs';
 import { map, switchMapTo, take } from 'rxjs/operators';
 
-import { DimlessBinaryPipe } from '../pipes/dimless-binary.pipe';
-import { FormatterService } from '../services/formatter.service';
+import { RgwBucketService } from '~/app/shared/api/rgw-bucket.service';
+import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe';
+import { FormatterService } from '~/app/shared/services/formatter.service';
 
 export function isEmptyInputValue(value: any): boolean {
   return value == null || value.length === 0;
@@ -494,4 +495,118 @@ export class CdValidators {
       );
     };
   }
+
+  /**
+   * Validate the bucket name. In general, bucket names should follow domain
+   * name constraints:
+   * - Bucket names must be unique.
+   * - Bucket names cannot be formatted as IP address.
+   * - Bucket names can be between 3 and 63 characters long.
+   * - Bucket names must not contain uppercase characters or underscores.
+   * - Bucket names must start with a lowercase letter or number.
+   * - Bucket names must be a series of one or more labels. Adjacent
+   *   labels are separated by a single period (.). Bucket names can
+   *   contain lowercase letters, numbers, and hyphens. Each label must
+   *   start and end with a lowercase letter or a number.
+   */
+  static bucketName(): AsyncValidatorFn {
+    return (control: AbstractControl): Observable<ValidationErrors | null> => {
+      if (control.pristine || !control.value) {
+        return observableOf({ required: true });
+      }
+      const constraints = [];
+      let errorName: string;
+      // - Bucket names cannot be formatted as IP address.
+      constraints.push(() => {
+        const ipv4Rgx = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i;
+        const ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;
+        const name = control.value;
+        let notIP = true;
+        if (ipv4Rgx.test(name) || ipv6Rgx.test(name)) {
+          errorName = 'ipAddress';
+          notIP = false;
+        }
+        return notIP;
+      });
+      // - Bucket names can be between 3 and 63 characters long.
+      constraints.push((name: string) => {
+        if (!_.inRange(name.length, 3, 64)) {
+          errorName = 'shouldBeInRange';
+          return false;
+        }
+        // Bucket names can only contain lowercase letters, numbers, periods and hyphens.
+        if (!/^[0-9a-z.-]+$/.test(control.value)) {
+          errorName = 'bucketNameInvalid';
+          return false;
+        }
+        return true;
+      });
+      // - Bucket names must not contain uppercase characters or underscores.
+      // - Bucket names must start with a lowercase letter or number.
+      // - Bucket names must be a series of one or more labels. Adjacent
+      //   labels are separated by a single period (.). Bucket names can
+      //   contain lowercase letters, numbers, and hyphens. Each label must
+      //   start and end with a lowercase letter or a number.
+      constraints.push((name: string) => {
+        const labels = _.split(name, '.');
+        return _.every(labels, (label) => {
+          // Bucket names must not contain uppercase characters or underscores.
+          if (label !== _.toLower(label) || label.includes('_')) {
+            errorName = 'containsUpperCase';
+            return false;
+          }
+          // Bucket labels can contain lowercase letters, numbers, and hyphens.
+          if (!/^[0-9a-z-]+$/.test(label)) {
+            errorName = 'onlyLowerCaseAndNumbers';
+            return false;
+          }
+          // Each label must start and end with a lowercase letter or a number.
+          return _.every([0, label.length - 1], (index) => {
+            errorName = 'lowerCaseOrNumber';
+            return /[a-z]/.test(label[index]) || _.isInteger(_.parseInt(label[index]));
+          });
+        });
+      });
+      if (!_.every(constraints, (func: Function) => func(control.value))) {
+        return observableOf(
+          (() => {
+            switch (errorName) {
+              case 'onlyLowerCaseAndNumbers':
+                return { onlyLowerCaseAndNumbers: true };
+              case 'shouldBeInRange':
+                return { shouldBeInRange: true };
+              case 'ipAddress':
+                return { ipAddress: true };
+              case 'containsUpperCase':
+                return { containsUpperCase: true };
+              case 'lowerCaseOrNumber':
+                return { lowerCaseOrNumber: true };
+              default:
+                return { bucketNameInvalid: true };
+            }
+          })()
+        );
+      }
+
+      return observableOf(null);
+    };
+  }
+
+  static bucketExistence(
+    requiredExistenceResult: boolean,
+    rgwBucketService: RgwBucketService
+  ): AsyncValidatorFn {
+    return (control: AbstractControl): Observable<ValidationErrors | null> => {
+      if (control.pristine || !control.value) {
+        return observableOf({ required: true });
+      }
+      return rgwBucketService
+        .exists(control.value)
+        .pipe(
+          map((existenceResult: boolean) =>
+            existenceResult === requiredExistenceResult ? null : { bucketNameNotAllowed: true }
+          )
+        );
+    };
+  }
 }
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/inventory-device-type.model.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/inventory-device-type.model.ts
new file mode 100644 (file)
index 0000000..2155c2d
--- /dev/null
@@ -0,0 +1,9 @@
+import { InventoryDevice } from '~/app/ceph/cluster/inventory/inventory-devices/inventory-device.model';
+
+export interface InventoryDeviceType {
+  type: string;
+  capacity: number;
+  devices: InventoryDevice[];
+  canSelect: boolean;
+  totalDevices: number;
+}
index 8c740f4e01756fd1b02c887ffb85d3c902086880..077db0855a82b444e70d2464ca8d51803a47b2c9 100644 (file)
@@ -1,14 +1,16 @@
 export enum OrchestratorFeature {
   HOST_LIST = 'get_hosts',
-  HOST_CREATE = 'add_host',
-  HOST_DELETE = 'remove_host',
+  HOST_ADD = 'add_host',
+  HOST_REMOVE = 'remove_host',
   HOST_LABEL_ADD = 'add_host_label',
   HOST_LABEL_REMOVE = 'remove_host_label',
   HOST_MAINTENANCE_ENTER = 'enter_host_maintenance',
   HOST_MAINTENANCE_EXIT = 'exit_host_maintenance',
+  HOST_FACTS = 'get_facts',
 
   SERVICE_LIST = 'describe_service',
   SERVICE_CREATE = 'apply',
+  SERVICE_EDIT = 'apply',
   SERVICE_DELETE = 'remove_service',
   SERVICE_RELOAD = 'service_action',
   DAEMON_LIST = 'list_daemons',
index 151e0bd2987cfdaf74f497fbab412223acacf0d4..dd64422e10f40d83afe57bc38551e517a40a1ee4 100644 (file)
@@ -14,4 +14,32 @@ export interface CephServiceSpec {
   service_id: string;
   unmanaged: boolean;
   status: CephServiceStatus;
+  spec: CephServiceAdditionalSpec;
+  placement: CephServicePlacement;
+}
+
+export interface CephServiceAdditionalSpec {
+  backend_service: string;
+  api_user: string;
+  api_password: string;
+  api_port: number;
+  api_secure: boolean;
+  rgw_frontend_port: number;
+  trusted_ip_list: string[];
+  virtual_ip: string;
+  frontend_port: number;
+  monitor_port: number;
+  virtual_interface_networks: string[];
+  pool: string;
+  rgw_frontend_ssl_certificate: string;
+  ssl: boolean;
+  ssl_cert: string;
+  ssl_key: string;
+}
+
+export interface CephServicePlacement {
+  count: number;
+  placement: string;
+  hosts: string[];
+  label: string;
 }
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/wizard-steps.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/models/wizard-steps.ts
new file mode 100644 (file)
index 0000000..177feb4
--- /dev/null
@@ -0,0 +1,4 @@
+export interface WizardStepModel {
+  stepIndex: number;
+  isComplete: boolean;
+}
index cf7ddd342e0ea3b024a31332e8acdee0bd01ab4c..fb7a9f73395f00ca5b381cac6b5f6bdd2202082f 100644 (file)
@@ -12,6 +12,7 @@ import _ from 'lodash';
 import { Observable, throwError as observableThrowError } from 'rxjs';
 import { catchError } from 'rxjs/operators';
 
+import { CdHelperClass } from '~/app/shared/classes/cd-helper.class';
 import { NotificationType } from '../enum/notification-type.enum';
 import { CdNotificationConfig } from '../models/cd-notification';
 import { FinishedTask } from '../models/finished-task';
@@ -34,7 +35,6 @@ export class ApiInterceptorService implements HttpInterceptor {
   ) {}
 
   intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
-    const defaultVersion = '1.0';
     const acceptHeader = request.headers.get('Accept');
     let reqWithVersion: HttpRequest<any>;
     if (acceptHeader && acceptHeader.startsWith('application/vnd.ceph.api.v')) {
@@ -42,7 +42,7 @@ export class ApiInterceptorService implements HttpInterceptor {
     } else {
       reqWithVersion = request.clone({
         setHeaders: {
-          Accept: `application/vnd.ceph.api.v${defaultVersion}+json`
+          Accept: CdHelperClass.cdVersionHeader('1', '0')
         }
       });
     }
index 0948fc878a9e0eb77bed08c016ba60d06e2bcc29..8cce3a8bf8ca115ed14838dfca13c033fb3c0e5b 100644 (file)
@@ -4,9 +4,10 @@ import { fakeAsync, TestBed, tick } from '@angular/core/testing';
 import { ActivatedRouteSnapshot, Router, Routes } from '@angular/router';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { of as observableOf } from 'rxjs';
+import { of as observableOf, throwError } from 'rxjs';
 
 import { configureTestBed } from '~/testing/unit-test-helper';
+import { MgrModuleService } from '../api/mgr-module.service';
 import { ModuleStatusGuardService } from './module-status-guard.service';
 
 describe('ModuleStatusGuardService', () => {
@@ -15,6 +16,7 @@ describe('ModuleStatusGuardService', () => {
   let router: Router;
   let route: ActivatedRouteSnapshot;
   let ngZone: NgZone;
+  let mgrModuleService: MgrModuleService;
 
   @Component({ selector: 'cd-foo', template: '' })
   class FooComponent {}
@@ -25,9 +27,20 @@ describe('ModuleStatusGuardService', () => {
 
   const routes: Routes = [{ path: '**', component: FooComponent }];
 
-  const testCanActivate = (getResult: {}, activateResult: boolean, urlResult: string) => {
+  const testCanActivate = (
+    getResult: {},
+    activateResult: boolean,
+    urlResult: string,
+    backend = 'cephadm',
+    configOptPermission = true
+  ) => {
     let result: boolean;
     spyOn(httpClient, 'get').and.returnValue(observableOf(getResult));
+    const orchBackend = { orchestrator: backend };
+    const getConfigSpy = spyOn(mgrModuleService, 'getConfig');
+    configOptPermission
+      ? getConfigSpy.and.returnValue(observableOf(orchBackend))
+      : getConfigSpy.and.returnValue(throwError({}));
     ngZone.run(() => {
       service.canActivateChild(route).subscribe((resp) => {
         result = resp;
@@ -48,13 +61,15 @@ describe('ModuleStatusGuardService', () => {
   beforeEach(() => {
     service = TestBed.inject(ModuleStatusGuardService);
     httpClient = TestBed.inject(HttpClient);
+    mgrModuleService = TestBed.inject(MgrModuleService);
     router = TestBed.inject(Router);
     route = new ActivatedRouteSnapshot();
     route.url = [];
     route.data = {
       moduleStatusGuardConfig: {
         apiPath: 'bar',
-        redirectTo: '/foo'
+        redirectTo: '/foo',
+        backend: 'rook'
       }
     };
     ngZone = TestBed.inject(NgZone);
@@ -76,4 +91,12 @@ describe('ModuleStatusGuardService', () => {
   it('should test canActivateChild with status unavailable', fakeAsync(() => {
     testCanActivate(null, false, '/foo');
   }));
+
+  it('should redirect normally if the backend provided matches the current backend', fakeAsync(() => {
+    testCanActivate({ available: true, message: 'foo' }, true, '/', 'rook');
+  }));
+
+  it('should redirect to the "redirectTo" link for user without sufficient permission', fakeAsync(() => {
+    testCanActivate({ available: true, message: 'foo' }, true, '/foo', 'rook', false);
+  }));
 });
index 171f34adfe6b48e09f6ba6aeceeabb08032509e3..97c7251fbfac1a2da5651d0cff2183800e1c924f 100644 (file)
@@ -5,7 +5,8 @@ import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router } from '@
 import { of as observableOf } from 'rxjs';
 import { catchError, map } from 'rxjs/operators';
 
-import { Icons } from '../enum/icons.enum';
+import { MgrModuleService } from '~/app/shared/api/mgr-module.service';
+import { Icons } from '~/app/shared/enum/icons.enum';
 
 /**
  * This service checks if a route can be activated by executing a
@@ -39,7 +40,11 @@ export class ModuleStatusGuardService implements CanActivate, CanActivateChild {
   // TODO: Hotfix - remove ALLOWLIST'ing when a generic ErrorComponent is implemented
   static readonly ALLOWLIST: string[] = ['501'];
 
-  constructor(private http: HttpClient, private router: Router) {}
+  constructor(
+    private http: HttpClient,
+    private router: Router,
+    private mgrModuleService: MgrModuleService
+  ) {}
 
   canActivate(route: ActivatedRouteSnapshot) {
     return this.doCheck(route);
@@ -54,9 +59,21 @@ export class ModuleStatusGuardService implements CanActivate, CanActivateChild {
       return observableOf(true);
     }
     const config = route.data['moduleStatusGuardConfig'];
+    let backendCheck = false;
+    if (config.backend) {
+      this.mgrModuleService.getConfig('orchestrator').subscribe(
+        (resp) => {
+          backendCheck = config.backend === resp['orchestrator'];
+        },
+        () => {
+          this.router.navigate([config.redirectTo]);
+          return observableOf(false);
+        }
+      );
+    }
     return this.http.get(`api/${config.apiPath}/status`).pipe(
       map((resp: any) => {
-        if (!resp.available) {
+        if (!resp.available && !backendCheck) {
           this.router.navigate([config.redirectTo || ''], {
             state: {
               header: config.header,
index c39bb0c26b6951601ae470cbba5e3d05709a37c6..5adabe2115370d9c65ab4232a7325e0c343bc594 100644 (file)
@@ -114,10 +114,8 @@ export class TaskMessageService {
 
   messages = {
     // Host tasks
-    'host/create': this.newTaskMessage(this.commonOperations.create, (metadata) =>
-      this.host(metadata)
-    ),
-    'host/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
+    'host/add': this.newTaskMessage(this.commonOperations.add, (metadata) => this.host(metadata)),
+    'host/remove': this.newTaskMessage(this.commonOperations.remove, (metadata) =>
       this.host(metadata)
     ),
     'host/identify_device': this.newTaskMessage(
@@ -336,6 +334,9 @@ export class TaskMessageService {
     'service/create': this.newTaskMessage(this.commonOperations.create, (metadata) =>
       this.service(metadata)
     ),
+    'service/edit': this.newTaskMessage(this.commonOperations.update, (metadata) =>
+      this.service(metadata)
+    ),
     'service/delete': this.newTaskMessage(this.commonOperations.delete, (metadata) =>
       this.service(metadata)
     )
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.spec.ts
new file mode 100644 (file)
index 0000000..47c2149
--- /dev/null
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { WizardStepsService } from './wizard-steps.service';
+
+describe('WizardStepsService', () => {
+  let service: WizardStepsService;
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({});
+    service = TestBed.inject(WizardStepsService);
+  });
+
+  it('should be created', () => {
+    expect(service).toBeTruthy();
+  });
+});
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/wizard-steps.service.ts
new file mode 100644 (file)
index 0000000..e0fb2be
--- /dev/null
@@ -0,0 +1,58 @@
+import { Injectable } from '@angular/core';
+
+import { BehaviorSubject, Observable } from 'rxjs';
+
+import { WizardStepModel } from '~/app/shared/models/wizard-steps';
+
+const initialStep = [{ stepIndex: 1, isComplete: false }];
+
+@Injectable({
+  providedIn: 'root'
+})
+export class WizardStepsService {
+  steps$: BehaviorSubject<WizardStepModel[]>;
+  currentStep$: BehaviorSubject<WizardStepModel> = new BehaviorSubject<WizardStepModel>(null);
+
+  constructor() {
+    this.steps$ = new BehaviorSubject<WizardStepModel[]>(initialStep);
+    this.currentStep$.next(this.steps$.value[0]);
+  }
+
+  setTotalSteps(step: number) {
+    const steps: WizardStepModel[] = [];
+    for (let i = 1; i <= step; i++) {
+      steps.push({ stepIndex: i, isComplete: false });
+    }
+    this.steps$ = new BehaviorSubject<WizardStepModel[]>(steps);
+  }
+
+  setCurrentStep(step: WizardStepModel): void {
+    this.currentStep$.next(step);
+  }
+
+  getCurrentStep(): Observable<WizardStepModel> {
+    return this.currentStep$.asObservable();
+  }
+
+  getSteps(): Observable<WizardStepModel[]> {
+    return this.steps$.asObservable();
+  }
+
+  moveToNextStep(): void {
+    const index = this.currentStep$.value.stepIndex;
+    this.currentStep$.next(this.steps$.value[index]);
+  }
+
+  moveToPreviousStep(): void {
+    const index = this.currentStep$.value.stepIndex - 1;
+    this.currentStep$.next(this.steps$.value[index - 1]);
+  }
+
+  isLastStep(): boolean {
+    return this.currentStep$.value.stepIndex === this.steps$.value.length;
+  }
+
+  isFirstStep(): boolean {
+    return this.currentStep$.value?.stepIndex - 1 === 0;
+  }
+}
index cca9bd5d5d9d84723aee92be7cec83590c7d8ddc..3c6ddbf80c998b714a26c6ce8974499c5104f527 100644 (file)
 }
 
 cd-modal {
+  .modal {
+    /* stylelint-disable */
+    background-color: rgba(0, 0, 0, 0.4);
+    /* stylelint-enable */
+    display: block;
+  }
+
+  .modal-dialog {
+    max-width: 70vh;
+  }
+
   .cd-col-form-label {
     @extend .col-lg-4;
   }
index de9b536bfc88fb6a96ba4e1ae693a61cb502500d..47afe2e25042d45df1e574e26077cc3cd3367eed 100644 (file)
@@ -27,7 +27,7 @@ from mgr_util import ServerConfigException, build_url, \
     create_self_signed_cert, get_default_addr, verify_tls_files
 
 from . import mgr
-from .controllers import generate_routes, json_error_page
+from .controllers import Router, json_error_page
 from .grafana import push_local_dashboards
 from .services.auth import AuthManager, AuthManagerTool, JwtManager
 from .services.exception import dashboard_exception_handler
@@ -109,8 +109,6 @@ class CherryPyConfig(object):
         else:
             server_port = self.get_localized_module_option('ssl_server_port', 8443)  # type: ignore
 
-        if server_addr == '::':
-            server_addr = self.get_mgr_ip()  # type: ignore
         if server_addr is None:
             raise ServerConfigException(
                 'no server_addr configured; '
@@ -193,6 +191,8 @@ class CherryPyConfig(object):
         self._url_prefix = prepare_url_prefix(self.get_module_option(  # type: ignore
             'url_prefix', default=''))
 
+        if server_addr in ['::', '0.0.0.0']:
+            server_addr = self.get_mgr_ip()  # type: ignore
         base_url = build_url(
             scheme='https' if use_ssl else 'http',
             host=server_addr,
@@ -330,7 +330,7 @@ class Module(MgrModule, CherryPyConfig):
         # about to start serving
         self.set_uri(uri)
 
-        mapper, parent_urls = generate_routes(self.url_prefix)
+        mapper, parent_urls = Router.generate_routes(self.url_prefix)
 
         config = {}
         for purl in parent_urls:
index 921dadb0471d01011c3647591d0eb1d12aa587d3..7ae1f99eb691a27db27df84ee60b51a619a25467 100644 (file)
@@ -2038,6 +2038,67 @@ paths:
       - jwt: []
       tags:
       - Cephfs
+  /api/cluster:
+    get:
+      parameters: []
+      responses:
+        '200':
+          content:
+            application/vnd.ceph.api.v0.1+json:
+              type: object
+          description: OK
+        '400':
+          description: Operation exception. Please check the response body for details.
+        '401':
+          description: Unauthenticated access. Please login first.
+        '403':
+          description: Unauthorized access. Please check your permissions.
+        '500':
+          description: Unexpected error. Please check the response body for the stack
+            trace.
+      security:
+      - jwt: []
+      summary: Get the cluster status
+      tags:
+      - Cluster
+    put:
+      parameters: []
+      requestBody:
+        content:
+          application/json:
+            schema:
+              properties:
+                status:
+                  description: Cluster Status
+                  type: string
+              required:
+              - status
+              type: object
+      responses:
+        '200':
+          content:
+            application/vnd.ceph.api.v0.1+json:
+              type: object
+          description: Resource updated.
+        '202':
+          content:
+            application/vnd.ceph.api.v0.1+json:
+              type: object
+          description: Operation is still executing. Please check the task queue.
+        '400':
+          description: Operation exception. Please check the response body for details.
+        '401':
+          description: Unauthenticated access. Please login first.
+        '403':
+          description: Unauthorized access. Please check your permissions.
+        '500':
+          description: Unexpected error. Please check the response body for the stack
+            trace.
+      security:
+      - jwt: []
+      summary: Update the cluster status
+      tags:
+      - Cluster
   /api/cluster_conf:
     get:
       parameters: []
@@ -3153,10 +3214,16 @@ paths:
         name: sources
         schema:
           type: string
+      - default: false
+        description: Host Facts
+        in: query
+        name: facts
+        schema:
+          type: boolean
       responses:
         '200':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v1.1+json:
               schema:
                 properties:
                   addr:
@@ -4893,37 +4960,14 @@ paths:
       summary: Get Monitor Details
       tags:
       - Monitor
-  /api/nfs-ganesha/daemon:
+  /api/nfs-ganesha/cluster:
     get:
       parameters: []
       responses:
         '200':
           content:
-            application/vnd.ceph.api.v1.0+json:
-              schema:
-                items:
-                  properties:
-                    cluster_id:
-                      description: Cluster identifier
-                      type: string
-                    cluster_type:
-                      description: Cluster type
-                      type: string
-                    daemon_id:
-                      description: Daemon identifier
-                      type: string
-                    desc:
-                      description: Status description
-                      type: string
-                    status:
-                      description: Status of daemon
-                      type: integer
-                  type: object
-                required:
-                - daemon_id
-                - cluster_id
-                - cluster_type
-                type: array
+            application/vnd.ceph.api.v0.1+json:
+              type: object
           description: OK
         '400':
           description: Operation exception. Please check the response body for details.
@@ -4936,7 +4980,6 @@ paths:
             trace.
       security:
       - jwt: []
-      summary: List NFS-Ganesha daemons information
       tags:
       - NFS-Ganesha
   /api/nfs-ganesha/export:
@@ -4976,31 +5019,23 @@ paths:
                     cluster_id:
                       description: Cluster identifier
                       type: string
-                    daemons:
-                      description: List of NFS Ganesha daemons identifiers
-                      items:
-                        type: string
-                      type: array
                     export_id:
                       description: Export ID
                       type: integer
                     fsal:
                       description: FSAL configuration
                       properties:
-                        filesystem:
-                          description: CephFS filesystem ID
+                        fs_name:
+                          description: CephFS filesystem name
                           type: string
                         name:
                           description: name of FSAL
                           type: string
-                        rgw_user_id:
-                          description: RGW user id
-                          type: string
                         sec_label_xattr:
                           description: Name of xattr for security label
                           type: string
                         user_id:
-                          description: CephX user id
+                          description: User id
                           type: string
                       required:
                       - name
@@ -5022,9 +5057,6 @@ paths:
                     squash:
                       description: Export squash policy
                       type: string
-                    tag:
-                      description: NFSv3 export tag
-                      type: string
                     transports:
                       description: List of transport types
                       items:
@@ -5035,9 +5067,7 @@ paths:
                 - export_id
                 - path
                 - cluster_id
-                - daemons
                 - pseudo
-                - tag
                 - access_type
                 - squash
                 - security_label
@@ -5095,29 +5125,18 @@ paths:
                 cluster_id:
                   description: Cluster identifier
                   type: string
-                daemons:
-                  description: List of NFS Ganesha daemons identifiers
-                  items:
-                    type: string
-                  type: array
                 fsal:
                   description: FSAL configuration
                   properties:
-                    filesystem:
-                      description: CephFS filesystem ID
+                    fs_name:
+                      description: CephFS filesystem name
                       type: string
                     name:
                       description: name of FSAL
                       type: string
-                    rgw_user_id:
-                      description: RGW user id
-                      type: string
                     sec_label_xattr:
                       description: Name of xattr for security label
                       type: string
-                    user_id:
-                      description: CephX user id
-                      type: string
                   required:
                   - name
                   type: object
@@ -5132,19 +5151,12 @@ paths:
                 pseudo:
                   description: Pseudo FS path
                   type: string
-                reload_daemons:
-                  default: true
-                  description: Trigger reload of NFS-Ganesha daemons configuration
-                  type: boolean
                 security_label:
                   description: Security label
                   type: string
                 squash:
                   description: Export squash policy
                   type: string
-                tag:
-                  description: NFSv3 export tag
-                  type: string
                 transports:
                   description: List of transport types
                   items:
@@ -5153,9 +5165,7 @@ paths:
               required:
               - path
               - cluster_id
-              - daemons
               - pseudo
-              - tag
               - access_type
               - squash
               - security_label
@@ -5167,7 +5177,7 @@ paths:
       responses:
         '201':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               schema:
                 properties:
                   access_type:
@@ -5197,31 +5207,23 @@ paths:
                   cluster_id:
                     description: Cluster identifier
                     type: string
-                  daemons:
-                    description: List of NFS Ganesha daemons identifiers
-                    items:
-                      type: string
-                    type: array
                   export_id:
                     description: Export ID
                     type: integer
                   fsal:
                     description: FSAL configuration
                     properties:
-                      filesystem:
-                        description: CephFS filesystem ID
+                      fs_name:
+                        description: CephFS filesystem name
                         type: string
                       name:
                         description: name of FSAL
                         type: string
-                      rgw_user_id:
-                        description: RGW user id
-                        type: string
                       sec_label_xattr:
                         description: Name of xattr for security label
                         type: string
                       user_id:
-                        description: CephX user id
+                        description: User id
                         type: string
                     required:
                     - name
@@ -5243,9 +5245,6 @@ paths:
                   squash:
                     description: Export squash policy
                     type: string
-                  tag:
-                    description: NFSv3 export tag
-                    type: string
                   transports:
                     description: List of transport types
                     items:
@@ -5255,9 +5254,7 @@ paths:
                 - export_id
                 - path
                 - cluster_id
-                - daemons
                 - pseudo
-                - tag
                 - access_type
                 - squash
                 - security_label
@@ -5269,7 +5266,7 @@ paths:
           description: Resource created.
         '202':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               type: object
           description: Operation is still executing. Please check the task queue.
         '400':
@@ -5301,21 +5298,15 @@ paths:
         required: true
         schema:
           type: integer
-      - default: true
-        description: Trigger reload of NFS-Ganesha daemons configuration
-        in: query
-        name: reload_daemons
-        schema:
-          type: boolean
       responses:
         '202':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               type: object
           description: Operation is still executing. Please check the task queue.
         '204':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               type: object
           description: Resource deleted.
         '400':
@@ -5345,7 +5336,7 @@ paths:
         name: export_id
         required: true
         schema:
-          type: integer
+          type: string
       responses:
         '200':
           content:
@@ -5379,31 +5370,23 @@ paths:
                   cluster_id:
                     description: Cluster identifier
                     type: string
-                  daemons:
-                    description: List of NFS Ganesha daemons identifiers
-                    items:
-                      type: string
-                    type: array
                   export_id:
                     description: Export ID
                     type: integer
                   fsal:
                     description: FSAL configuration
                     properties:
-                      filesystem:
-                        description: CephFS filesystem ID
+                      fs_name:
+                        description: CephFS filesystem name
                         type: string
                       name:
                         description: name of FSAL
                         type: string
-                      rgw_user_id:
-                        description: RGW user id
-                        type: string
                       sec_label_xattr:
                         description: Name of xattr for security label
                         type: string
                       user_id:
-                        description: CephX user id
+                        description: User id
                         type: string
                     required:
                     - name
@@ -5425,9 +5408,6 @@ paths:
                   squash:
                     description: Export squash policy
                     type: string
-                  tag:
-                    description: NFSv3 export tag
-                    type: string
                   transports:
                     description: List of transport types
                     items:
@@ -5437,9 +5417,7 @@ paths:
                 - export_id
                 - path
                 - cluster_id
-                - daemons
                 - pseudo
-                - tag
                 - access_type
                 - squash
                 - security_label
@@ -5506,29 +5484,18 @@ paths:
                     - squash
                     type: object
                   type: array
-                daemons:
-                  description: List of NFS Ganesha daemons identifiers
-                  items:
-                    type: string
-                  type: array
                 fsal:
                   description: FSAL configuration
                   properties:
-                    filesystem:
-                      description: CephFS filesystem ID
+                    fs_name:
+                      description: CephFS filesystem name
                       type: string
                     name:
                       description: name of FSAL
                       type: string
-                    rgw_user_id:
-                      description: RGW user id
-                      type: string
                     sec_label_xattr:
                       description: Name of xattr for security label
                       type: string
-                    user_id:
-                      description: CephX user id
-                      type: string
                   required:
                   - name
                   type: object
@@ -5543,19 +5510,12 @@ paths:
                 pseudo:
                   description: Pseudo FS path
                   type: string
-                reload_daemons:
-                  default: true
-                  description: Trigger reload of NFS-Ganesha daemons configuration
-                  type: boolean
                 security_label:
                   description: Security label
                   type: string
                 squash:
                   description: Export squash policy
                   type: string
-                tag:
-                  description: NFSv3 export tag
-                  type: string
                 transports:
                   description: List of transport types
                   items:
@@ -5563,9 +5523,7 @@ paths:
                   type: array
               required:
               - path
-              - daemons
               - pseudo
-              - tag
               - access_type
               - squash
               - security_label
@@ -5577,7 +5535,7 @@ paths:
       responses:
         '200':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               schema:
                 properties:
                   access_type:
@@ -5607,31 +5565,23 @@ paths:
                   cluster_id:
                     description: Cluster identifier
                     type: string
-                  daemons:
-                    description: List of NFS Ganesha daemons identifiers
-                    items:
-                      type: string
-                    type: array
                   export_id:
                     description: Export ID
                     type: integer
                   fsal:
                     description: FSAL configuration
                     properties:
-                      filesystem:
-                        description: CephFS filesystem ID
+                      fs_name:
+                        description: CephFS filesystem name
                         type: string
                       name:
                         description: name of FSAL
                         type: string
-                      rgw_user_id:
-                        description: RGW user id
-                        type: string
                       sec_label_xattr:
                         description: Name of xattr for security label
                         type: string
                       user_id:
-                        description: CephX user id
+                        description: User id
                         type: string
                     required:
                     - name
@@ -5653,9 +5603,6 @@ paths:
                   squash:
                     description: Export squash policy
                     type: string
-                  tag:
-                    description: NFSv3 export tag
-                    type: string
                   transports:
                     description: List of transport types
                     items:
@@ -5665,9 +5612,7 @@ paths:
                 - export_id
                 - path
                 - cluster_id
-                - daemons
                 - pseudo
-                - tag
                 - access_type
                 - squash
                 - security_label
@@ -5679,7 +5624,7 @@ paths:
           description: Resource updated.
         '202':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v2.0+json:
               type: object
           description: Operation is still executing. Please check the task queue.
         '400':
@@ -7439,10 +7384,15 @@ paths:
         name: daemon_name
         schema:
           type: string
+      - allowEmptyValue: true
+        in: query
+        name: uid
+        schema:
+          type: string
       responses:
         '200':
           content:
-            application/vnd.ceph.api.v1.0+json:
+            application/vnd.ceph.api.v1.1+json:
               type: object
           description: OK
         '400':
@@ -10309,6 +10259,8 @@ tags:
   name: Auth
 - description: Cephfs Management API
   name: Cephfs
+- description: Get Cluster Details
+  name: Cluster
 - description: Manage Cluster Configurations
   name: ClusterConfiguration
 - description: Crush Rule Management API
@@ -10339,7 +10291,7 @@ tags:
   name: MonPerfCounter
 - description: Get Monitor Details
   name: Monitor
-- description: NFS-Ganesha Management API
+- description: NFS-Ganesha Cluster Management API
   name: NFS-Ganesha
 - description: OSD management API
   name: OSD
index ea50652346a4a678147d0c68f8b9d2f985f1deec..0cce9244469dd40d0e1062a3d43b3bd7fdbfc678 100644 (file)
@@ -9,7 +9,7 @@ from mgr_module import CLICommand, Option
 
 from ..controllers.cephfs import CephFS
 from ..controllers.iscsi import Iscsi, IscsiTarget
-from ..controllers.nfsganesha import NFSGanesha, NFSGaneshaExports, NFSGaneshaService
+from ..controllers.nfs import NFSGanesha, NFSGaneshaExports
 from ..controllers.rbd import Rbd, RbdSnapshot, RbdTrash
 from ..controllers.rbd_mirroring import RbdMirroringPoolMode, \
     RbdMirroringPoolPeer, RbdMirroringSummary
@@ -42,7 +42,7 @@ Feature2Controller = {
     Features.ISCSI: [Iscsi, IscsiTarget],
     Features.CEPHFS: [CephFS],
     Features.RGW: [Rgw, RgwDaemon, RgwBucket, RgwUser],
-    Features.NFS: [NFSGanesha, NFSGaneshaService, NFSGaneshaExports],
+    Features.NFS: [NFSGanesha, NFSGaneshaExports],
 }
 
 
@@ -138,7 +138,7 @@ class FeatureToggles(I.CanMgr, I.Setupable, I.HasOptions,
 
     @PM.add_hook
     def get_controllers(self):
-        from ..controllers import ApiController, ControllerDoc, EndpointDoc, RESTController
+        from ..controllers import APIDoc, APIRouter, EndpointDoc, RESTController
 
         FEATURES_SCHEMA = {
             "rbd": (bool, ''),
@@ -149,8 +149,8 @@ class FeatureToggles(I.CanMgr, I.Setupable, I.HasOptions,
             "nfs": (bool, '')
         }
 
-        @ApiController('/feature_toggles')
-        @ControllerDoc("Manage Features API", "FeatureTogglesEndpoint")
+        @APIRouter('/feature_toggles')
+        @APIDoc("Manage Features API", "FeatureTogglesEndpoint")
         class FeatureTogglesEndpoint(RESTController):
             @EndpointDoc("Get List Of Features",
                          responses={200: FEATURES_SCHEMA})
index 0600135ac231cc7ad0489c1cee4fb25df7122920..22d6a294a39444550191b427c3863467985644aa 100644 (file)
@@ -79,9 +79,9 @@ class Motd(SP):
 
     @PM.add_hook
     def get_controllers(self):
-        from ..controllers import RESTController, UiApiController
+        from ..controllers import RESTController, UIRouter
 
-        @UiApiController('/motd')
+        @UIRouter('/motd')
         class MessageOfTheDay(RESTController):
             def list(_) -> Optional[Dict]:  # pylint: disable=no-self-argument
                 value: str = self.get_option(self.NAME)
index 917547b9095535a009c22289953611de9b4b8306..be4c91a04dd73f4c868c7a1ea1d5f520008811b5 100644 (file)
@@ -5,7 +5,7 @@ flake8-colors==0.1.6
 #flake8-docstrings
 #pep8-naming
 rstcheck==3.3.1
-autopep8
-pyfakefs
+autopep8==1.5.7
+pyfakefs==4.5.0
 isort==5.5.3
-pytest
+pytest==6.2.4
index 25b205ce883dd43bc37247bb4186a79f925886d7..8ff943566621d951c396933da9526ed645fa5871 100644 (file)
@@ -1,4 +1,4 @@
 pytest
 pytest-cov
 pytest-instafail
-pyfakefs
+pyfakefs==4.5.0
index 4e8497793c3f3bd37ae29754c670c2694e8c85b9..c9653e3c18bbb763ebb0cb6fc7e4e24a5e380684 100755 (executable)
@@ -41,7 +41,7 @@ setup_teuthology() {
     TEMP_DIR=`mktemp -d`
     cd $TEMP_DIR
 
-    virtualenv --python=${TEUTHOLOGY_PYTHON_BIN:-/usr/bin/python3} venv
+    ${TEUTHOLOGY_PYTHON_BIN:-/usr/bin/python3} -m venv venv
     source venv/bin/activate
     pip install -U pip 'setuptools >= 12'
     pip install git+https://github.com/ceph/teuthology#egg=teuthology[test]
@@ -56,7 +56,7 @@ setup_coverage() {
     # In CI environment we cannot install coverage in system, so we install it in a dedicated venv
     # so only coverage is available when adding this path.
     cd $TEMP_DIR
-    virtualenv --python=/usr/bin/python3 coverage-venv
+    /usr/bin/python3 -m venv coverage-venv
     source coverage-venv/bin/activate
     cd $CURR_DIR
     pip install coverage==4.5.2
index a4d0fbca9c74b0b80ff7b0f165b7aae8a0f083ac..3492b96549806baa9de025f5ddc8dde336916a99 100644 (file)
@@ -266,13 +266,15 @@ class CephService(object):
                     except SendCommandError:
                         # Try to retrieve SMART data from another daemon.
                         continue
-                else:
+                elif 'mon' in svc_type:
                     try:
                         dev_smart_data = CephService.send_command(
-                            svc_type, 'device get-health-metrics', svc_id, devid=device['devid'])
+                            svc_type, 'device query-daemon-health-metrics', who=daemon)
                     except SendCommandError:
                         # Try to retrieve SMART data from another daemon.
                         continue
+                else:
+                    dev_smart_data = {}
                 for dev_id, dev_data in dev_smart_data.items():
                     if 'error' in dev_data:
                         logger.warning(
diff --git a/ceph/src/pybind/mgr/dashboard/services/cephx.py b/ceph/src/pybind/mgr/dashboard/services/cephx.py
deleted file mode 100644 (file)
index 60303ad..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import absolute_import
-
-from .ceph_service import CephService
-
-
-class CephX(object):
-    @classmethod
-    def _entities_map(cls, entity_type=None):
-        auth_dump = CephService.send_command("mon", "auth list")
-        result = {}
-        for auth_entry in auth_dump['auth_dump']:
-            entity = auth_entry['entity']
-            if not entity_type or entity.startswith('{}.'.format(entity_type)):
-                entity_id = entity[entity.find('.')+1:]
-                result[entity_id] = auth_entry
-        return result
-
-    @classmethod
-    def _clients_map(cls):
-        return cls._entities_map("client")
-
-    @classmethod
-    def list_clients(cls):
-        return list(cls._clients_map())
-
-    @classmethod
-    def get_client_key(cls, client_id):
-        return cls._clients_map()[client_id]['key']
diff --git a/ceph/src/pybind/mgr/dashboard/services/cluster.py b/ceph/src/pybind/mgr/dashboard/services/cluster.py
new file mode 100644 (file)
index 0000000..aad517a
--- /dev/null
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+from enum import Enum
+
+from .. import mgr
+
+
+class ClusterModel:
+
+    class Status(Enum):
+        INSTALLED = 0
+        POST_INSTALLED = 1
+
+    status: Status
+
+    def __init__(self, status=Status.INSTALLED.name):
+        self.status = self.Status[status]
+
+    def dict(self):
+        return {'status': self.status.name}
+
+    def to_db(self):
+        mgr.set_store('cluster/status', self.status.name)
+
+    @classmethod
+    def from_db(cls):
+        return cls(status=mgr.get_store('cluster/status', cls.Status.INSTALLED.name))
diff --git a/ceph/src/pybind/mgr/dashboard/services/ganesha.py b/ceph/src/pybind/mgr/dashboard/services/ganesha.py
deleted file mode 100644 (file)
index 9799f83..0000000
+++ /dev/null
@@ -1,1129 +0,0 @@
-# -*- coding: utf-8 -*-
-# pylint: disable=too-many-lines
-from __future__ import absolute_import
-
-import logging
-import os
-import re
-from typing import Any, Dict, List, Optional, cast
-
-from ceph.deployment.service_spec import NFSServiceSpec
-from orchestrator import DaemonDescription, OrchestratorError, ServiceDescription
-
-from .. import mgr
-from ..exceptions import DashboardException
-from ..settings import Settings
-from .cephfs import CephFS
-from .cephx import CephX
-from .orchestrator import OrchClient
-from .rgw_client import NoCredentialsException, NoRgwDaemonsException, RequestException, RgwClient
-
-logger = logging.getLogger('ganesha')
-
-
-class NFSException(DashboardException):
-    def __init__(self, msg):
-        super(NFSException, self).__init__(component="nfs", msg=msg)
-
-
-class Ganesha(object):
-    @classmethod
-    def _get_clusters_locations(cls):
-        # pylint: disable=too-many-branches
-        # Get Orchestrator clusters
-        orch_result = cls._get_orch_clusters_locations()
-
-        # Get user-defined clusters
-        location_list_str = Settings.GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE
-        if not orch_result and not location_list_str:
-            raise NFSException("NFS-Ganesha cluster is not detected. "
-                               "Please set the GANESHA_RADOS_POOL_NAMESPACE "
-                               "setting or deploy an NFS-Ganesha cluster with the Orchestrator.")
-        result = {}  # type: ignore
-        location_list = [loc.strip() for loc in location_list_str.split(
-            ",")] if location_list_str else []
-        for location in location_list:
-            if not location:
-                raise NFSException("Invalid Ganesha cluster RADOS "
-                                   "[cluster_id:]pool/namespace setting: {}"
-                                   .format(location))
-            if location.count(':') < 1:
-                # default cluster_id
-                if location.count('/') > 1:
-                    raise NFSException("Invalid Ganesha RADOS pool/namespace "
-                                       "setting: {}".format(location))
-                # in this case accept pool/namespace only
-                cluster = "_default_"
-                if location.count('/') == 0:
-                    pool, namespace = location, None
-                else:
-                    pool, namespace = location.split('/', 1)
-            else:
-                cluster = location[:location.find(':')]
-                pool_nm = location[location.find(':')+1:]
-                if pool_nm.count('/') == 0:
-                    pool, namespace = pool_nm, None
-                else:
-                    pool, namespace = pool_nm.split('/', 1)
-
-            # Check pool/namespace collision.
-            for clusters in [orch_result, result]:
-                for cluster_name, cluster_data in clusters.items():
-                    if cluster_data['pool'] == pool and cluster_data['namespace'] == namespace:
-                        raise NFSException(
-                            f'Pool `{pool}` and namespace `{namespace}` are already in use by '
-                            f"""NFS-Ganesha cluster called `{cluster_name}`{" that is deployed by "
-                            "the Orchestrator" if cluster_data['type'] == ClusterType.ORCHESTRATOR
-                            else ''}. """
-                            'Please update GANESHA_RADOS_POOL_NAMESPACE setting.'
-                        )
-
-            if cluster in orch_result:
-                # cephadm might have set same cluster settings, ask the user to remove it.
-                raise NFSException(
-                    'Detected a conflicting NFS-Ganesha cluster name `{0}`. There exists an '
-                    'NFS-Ganesha cluster called `{0}` that is deployed by the Orchestrator. '
-                    'Please remove or rename the cluster from the GANESHA_RADOS_POOL_NAMESPACE '
-                    'setting.'.format(cluster))
-
-            if cluster in result:
-                raise NFSException("Duplicate Ganesha cluster definition in "
-                                   "the setting: {}".format(location_list_str))
-            result[cluster] = {
-                'pool': pool,
-                'namespace': namespace,
-                'type': ClusterType.USER,
-                'daemon_conf': None
-            }
-        return {**orch_result, **result}
-
-    @classmethod
-    def _get_orch_clusters_locations(cls):
-        orch_result = {}  # type: ignore
-        services = cls._get_orch_nfs_services()
-        for service in services:
-            spec = cast(NFSServiceSpec, service.spec)
-            try:
-                orch_result[spec.service_id] = {
-                    'pool': spec.pool,
-                    'namespace': spec.namespace,
-                    'type': ClusterType.ORCHESTRATOR,
-                    'daemon_conf': spec.rados_config_name()
-                }
-            except AttributeError as ex:
-                logger.warning('Error when getting NFS service from the Orchestrator. %s', str(ex))
-                continue
-        return orch_result
-
-    @classmethod
-    def get_ganesha_clusters(cls):
-        return list(cls._get_clusters_locations())
-
-    @staticmethod
-    def _get_orch_nfs_services() -> List[ServiceDescription]:
-        try:
-            return OrchClient.instance().services.list('nfs')
-        except (RuntimeError, OrchestratorError, ImportError):
-            return []
-
-    @classmethod
-    def parse_rados_url(cls, rados_url):
-        if not rados_url.startswith("rados://"):
-            raise NFSException("Invalid NFS Ganesha RADOS configuration URL: {}"
-                               .format(rados_url))
-        rados_url = rados_url[8:]
-        url_comps = rados_url.split("/")
-        if len(url_comps) < 2 or len(url_comps) > 3:
-            raise NFSException("Invalid NFS Ganesha RADOS configuration URL: "
-                               "rados://{}".format(rados_url))
-        if len(url_comps) == 2:
-            return url_comps[0], None, url_comps[1]
-        return url_comps
-
-    @classmethod
-    def make_rados_url(cls, pool, namespace, obj):
-        if namespace:
-            return "rados://{}/{}/{}".format(pool, namespace, obj)
-        return "rados://{}/{}".format(pool, obj)
-
-    @classmethod
-    def get_cluster(cls, cluster_id):
-        locations = cls._get_clusters_locations()
-        if cluster_id not in locations:
-            raise NFSException("Cluster not found: cluster_id={}"
-                               .format(cluster_id))
-        return locations[cluster_id]
-
-    @classmethod
-    def fsals_available(cls):
-        result = []
-        if CephFS.list_filesystems():
-            result.append("CEPH")
-        try:
-            if RgwClient.admin_instance().is_service_online() and \
-                    RgwClient.admin_instance().is_system_user():
-                result.append("RGW")
-        except (DashboardException, NoCredentialsException, RequestException,
-                NoRgwDaemonsException):
-            pass
-        return result
-
-
-class GaneshaConfParser(object):
-    def __init__(self, raw_config):
-        self.pos = 0
-        self.text = ""
-        self.clean_config(raw_config)
-
-    def clean_config(self, raw_config):
-        for line in raw_config.split("\n"):
-            cardinal_idx = line.find('#')
-            if cardinal_idx == -1:
-                self.text += line
-            else:
-                # remove comments
-                self.text += line[:cardinal_idx]
-            if line.startswith("%"):
-                self.text += "\n"
-
-    def remove_all_whitespaces(self):
-        new_text = ""
-        in_string = False
-        in_section = False
-        for i, cha in enumerate(self.text):
-            if in_section:
-                if cha != '"' and self.text[i-1] != '\\':
-                    new_text += cha
-                elif cha == '\n':
-                    new_text += cha
-                    in_section = False
-                elif i == (len(self.text)-1):
-                    if cha != '"' and self.text[i-1] != '\\':
-                        new_text += cha
-                    in_section = False
-            elif not in_section and (i == 0 or self.text[i-1] == '\n') and cha == '%':
-                in_section = True
-                new_text += cha
-            elif in_string or cha not in [' ', '\n', '\t']:
-                new_text += cha
-            elif cha == '"' and self.text[i-1] != '\\':
-                in_string = not in_string
-        self.text = new_text
-
-    def stream(self):
-        return self.text[self.pos:]
-
-    def parse_block_name(self):
-        idx = self.stream().find('{')
-        if idx == -1:
-            raise Exception("Cannot find block name")
-        block_name = self.stream()[:idx]
-        self.pos += idx+1
-        return block_name
-
-    def parse_block_or_section(self):
-        if self.stream().startswith("%url"):
-            # section line
-            self.pos += self.stream().find('rados://')
-            idx = self.stream().find('\n')
-            if idx == -1:
-                value = self.stream()
-                self.pos += len(self.stream())
-            else:
-                value = self.stream()[:idx]
-                self.pos += idx+1
-            block_dict = {'block_name': '%url', 'value': value}
-            return block_dict
-
-        block_name = self.parse_block_name().upper()
-        block_dict = {'block_name': block_name}
-        self.parse_block_body(block_dict)
-        if self.stream()[0] != '}':
-            raise Exception("No closing bracket '}' found at the end of block")
-        self.pos += 1
-        return block_dict
-
-    def parse_parameter_value(self, raw_value):
-        colon_idx = raw_value.find(',')
-
-        if colon_idx == -1:
-            try:
-                return int(raw_value)
-            except ValueError:
-                if raw_value == "true":
-                    return True
-                if raw_value == "false":
-                    return False
-                if raw_value.find('"') == 0:
-                    return raw_value[1:-1]
-                return raw_value
-        else:
-            return [self.parse_parameter_value(v.strip())
-                    for v in raw_value.split(',')]
-
-    def parse_stanza(self, block_dict):
-        equal_idx = self.stream().find('=')
-        semicolon_idx = self.stream().find(';')
-        if equal_idx == -1:
-            raise Exception("Malformed stanza: no equal symbol found.")
-        parameter_name = self.stream()[:equal_idx].lower()
-        parameter_value = self.stream()[equal_idx+1:semicolon_idx]
-        block_dict[parameter_name] = self.parse_parameter_value(
-            parameter_value)
-        self.pos += semicolon_idx+1
-
-    def parse_block_body(self, block_dict):
-        last_pos = self.pos
-        while True:
-            semicolon_idx = self.stream().find(';')
-            lbracket_idx = self.stream().find('{')
-            rbracket_idx = self.stream().find('}')
-
-            if rbracket_idx == 0:
-                # block end
-                return
-
-            if (semicolon_idx != -1 and lbracket_idx != -1
-                    and semicolon_idx < lbracket_idx) \
-                    or (semicolon_idx != -1 and lbracket_idx == -1):
-                self.parse_stanza(block_dict)
-            elif (semicolon_idx != -1 and lbracket_idx != -1
-                  and semicolon_idx > lbracket_idx) or (
-                      semicolon_idx == -1 and lbracket_idx != -1):
-                if '_blocks_' not in block_dict:
-                    block_dict['_blocks_'] = []
-                block_dict['_blocks_'].append(self.parse_block_or_section())
-            else:
-                raise Exception("Malformed stanza: no semicolon found.")
-
-            if last_pos == self.pos:
-                raise Exception("Infinite loop while parsing block content")
-            last_pos = self.pos
-
-    def parse(self):
-        self.remove_all_whitespaces()
-        blocks = []
-        while self.stream():
-            block_dict = self.parse_block_or_section()
-            blocks.append(block_dict)
-        return blocks
-
-    @staticmethod
-    def _indentation(depth, size=4):
-        conf_str = ""
-        for _ in range(0, depth*size):
-            conf_str += " "
-        return conf_str
-
-    @staticmethod
-    def write_block_body(block, depth=0):
-        def format_val(key, val):
-            if isinstance(val, list):
-                return ', '.join([format_val(key, v) for v in val])
-            if isinstance(val, bool):
-                return str(val).lower()
-            if isinstance(val, int) or (block['block_name'] == 'CLIENT'
-                                        and key == 'clients'):
-                return '{}'.format(val)
-            return '"{}"'.format(val)
-
-        conf_str = ""
-        for key, val in block.items():
-            if key == 'block_name':
-                continue
-            if key == '_blocks_':
-                for blo in val:
-                    conf_str += GaneshaConfParser.write_block(blo, depth)
-            elif val:
-                conf_str += GaneshaConfParser._indentation(depth)
-                conf_str += '{} = {};\n'.format(key, format_val(key, val))
-        return conf_str
-
-    @staticmethod
-    def write_block(block, depth):
-        if block['block_name'] == "%url":
-            return '%url "{}"\n\n'.format(block['value'])
-
-        conf_str = ""
-        conf_str += GaneshaConfParser._indentation(depth)
-        conf_str += format(block['block_name'])
-        conf_str += " {\n"
-        conf_str += GaneshaConfParser.write_block_body(block, depth+1)
-        conf_str += GaneshaConfParser._indentation(depth)
-        conf_str += "}\n\n"
-        return conf_str
-
-    @staticmethod
-    def write_conf(blocks):
-        if not isinstance(blocks, list):
-            blocks = [blocks]
-        conf_str = ""
-        for block in blocks:
-            conf_str += GaneshaConfParser.write_block(block, 0)
-        return conf_str
-
-
-class FSal(object):
-    def __init__(self, name):
-        self.name = name
-
-    @classmethod
-    def validate_path(cls, _):
-        raise NotImplementedError()
-
-    def validate(self):
-        raise NotImplementedError()
-
-    def fill_keys(self):
-        raise NotImplementedError()
-
-    def create_path(self, path):
-        raise NotImplementedError()
-
-    @staticmethod
-    def from_fsal_block(fsal_block):
-        if fsal_block['name'] == "CEPH":
-            return CephFSFSal.from_fsal_block(fsal_block)
-        if fsal_block['name'] == 'RGW':
-            return RGWFSal.from_fsal_block(fsal_block)
-        return None
-
-    def to_fsal_block(self):
-        raise NotImplementedError()
-
-    @staticmethod
-    def from_dict(fsal_dict):
-        if fsal_dict['name'] == "CEPH":
-            return CephFSFSal.from_dict(fsal_dict)
-        if fsal_dict['name'] == 'RGW':
-            return RGWFSal.from_dict(fsal_dict)
-        return None
-
-    def to_dict(self):
-        raise NotImplementedError()
-
-
-class RGWFSal(FSal):
-    def __init__(self, name, rgw_user_id, access_key, secret_key):
-        super(RGWFSal, self).__init__(name)
-        self.rgw_user_id = rgw_user_id
-        self.access_key = access_key
-        self.secret_key = secret_key
-
-    @classmethod
-    def validate_path(cls, path):
-        return path == "/" or re.match(r'^[^/><|&()#?]+$', path)
-
-    def validate(self):
-        if not self.rgw_user_id:
-            raise NFSException('RGW user must be specified')
-
-        if not RgwClient.admin_instance().user_exists(self.rgw_user_id):
-            raise NFSException("RGW user '{}' does not exist"
-                               .format(self.rgw_user_id))
-
-    def fill_keys(self):
-        keys = RgwClient.admin_instance().get_user_keys(self.rgw_user_id)
-        self.access_key = keys['access_key']
-        self.secret_key = keys['secret_key']
-
-    def create_path(self, path):
-        if path == '/':  # nothing to do
-            return
-        rgw = RgwClient.instance(self.rgw_user_id)
-        try:
-            exists = rgw.bucket_exists(path, self.rgw_user_id)
-            logger.debug('Checking existence of RGW bucket "%s" for user "%s": %s',
-                         path, self.rgw_user_id, exists)
-        except RequestException as exp:
-            if exp.status_code == 403:
-                raise NFSException('Cannot create bucket "{}" as it already '
-                                   'exists, and belongs to other user.'
-                                   .format(path))
-            raise exp
-        if not exists:
-            logger.info('Creating new RGW bucket "%s" for user "%s"', path,
-                        self.rgw_user_id)
-            rgw.create_bucket(path)
-
-    @classmethod
-    def from_fsal_block(cls, fsal_block):
-        return cls(fsal_block['name'],
-                   fsal_block['user_id'],
-                   fsal_block['access_key_id'],
-                   fsal_block['secret_access_key'])
-
-    def to_fsal_block(self):
-        return {
-            'block_name': 'FSAL',
-            'name': self.name,
-            'user_id': self.rgw_user_id,
-            'access_key_id': self.access_key,
-            'secret_access_key': self.secret_key
-        }
-
-    @classmethod
-    def from_dict(cls, fsal_dict):
-        return cls(fsal_dict['name'], fsal_dict['rgw_user_id'], None, None)
-
-    def to_dict(self):
-        return {
-            'name': self.name,
-            'rgw_user_id': self.rgw_user_id
-        }
-
-
-class CephFSFSal(FSal):
-    def __init__(self, name, user_id=None, fs_name=None, sec_label_xattr=None,
-                 cephx_key=None):
-        super(CephFSFSal, self).__init__(name)
-        self.fs_name = fs_name
-        self.user_id = user_id
-        self.sec_label_xattr = sec_label_xattr
-        self.cephx_key = cephx_key
-
-    @classmethod
-    def validate_path(cls, path):
-        return re.match(r'^/[^><|&()?]*$', path)
-
-    def validate(self):
-        if self.user_id and self.user_id not in CephX.list_clients():
-            raise NFSException("cephx user '{}' does not exist"
-                               .format(self.user_id))
-
-    def fill_keys(self):
-        if self.user_id:
-            self.cephx_key = CephX.get_client_key(self.user_id)
-
-    def create_path(self, path):
-        cfs = CephFS(self.fs_name)
-        if path == os.sep:
-            return
-        cfs.mk_dirs(path)
-
-    @classmethod
-    def from_fsal_block(cls, fsal_block):
-        return cls(fsal_block['name'],
-                   fsal_block.get('user_id', None),
-                   fsal_block.get('filesystem', None),
-                   fsal_block.get('sec_label_xattr', None),
-                   fsal_block.get('secret_access_key', None))
-
-    def to_fsal_block(self):
-        result = {
-            'block_name': 'FSAL',
-            'name': self.name,
-        }
-        if self.user_id:
-            result['user_id'] = self.user_id
-        if self.fs_name:
-            result['filesystem'] = self.fs_name
-        if self.sec_label_xattr:
-            result['sec_label_xattr'] = self.sec_label_xattr
-        if self.cephx_key:
-            result['secret_access_key'] = self.cephx_key
-        return result
-
-    @classmethod
-    def from_dict(cls, fsal_dict):
-        return cls(fsal_dict['name'], fsal_dict['user_id'],
-                   fsal_dict['fs_name'], fsal_dict['sec_label_xattr'], None)
-
-    def to_dict(self):
-        return {
-            'name': self.name,
-            'user_id': self.user_id,
-            'fs_name': self.fs_name,
-            'sec_label_xattr': self.sec_label_xattr
-        }
-
-
-class Client(object):
-    def __init__(self, addresses, access_type=None, squash=None):
-        self.addresses = addresses
-        self.access_type = access_type
-        self.squash = GaneshaConf.format_squash(squash)
-
-    @classmethod
-    def from_client_block(cls, client_block):
-        addresses = client_block['clients']
-        if not isinstance(addresses, list):
-            addresses = [addresses]
-        return cls(addresses,
-                   client_block.get('access_type', None),
-                   client_block.get('squash', None))
-
-    def to_client_block(self):
-        result = {
-            'block_name': 'CLIENT',
-            'clients': self.addresses,
-        }
-        if self.access_type:
-            result['access_type'] = self.access_type
-        if self.squash:
-            result['squash'] = self.squash
-        return result
-
-    @classmethod
-    def from_dict(cls, client_dict):
-        return cls(client_dict['addresses'], client_dict['access_type'],
-                   client_dict['squash'])
-
-    def to_dict(self):
-        return {
-            'addresses': self.addresses,
-            'access_type': self.access_type,
-            'squash': self.squash
-        }
-
-
-class Export(object):
-    # pylint: disable=R0902
-    def __init__(self, export_id, path, fsal, cluster_id, daemons, pseudo=None,
-                 tag=None, access_type=None, squash=None,
-                 attr_expiration_time=None, security_label=False,
-                 protocols=None, transports=None, clients=None):
-        self.export_id = export_id
-        self.path = GaneshaConf.format_path(path)
-        self.fsal = fsal
-        self.cluster_id = cluster_id
-        self.daemons = set(daemons)
-        self.pseudo = GaneshaConf.format_path(pseudo)
-        self.tag = tag
-        self.access_type = access_type
-        self.squash = GaneshaConf.format_squash(squash)
-        if attr_expiration_time is None:
-            self.attr_expiration_time = 0
-        else:
-            self.attr_expiration_time = attr_expiration_time
-        self.security_label = security_label
-        self.protocols = {GaneshaConf.format_protocol(p) for p in protocols}
-        self.transports = set(transports)
-        self.clients = clients
-
-    def validate(self):
-        # pylint: disable=R0912
-        if not self.fsal.validate_path(self.path):
-            raise NFSException("Export path ({}) is invalid.".format(self.path))
-
-        if not self.protocols:
-            raise NFSException(
-                "No NFS protocol version specified for the export.")
-
-        if not self.transports:
-            raise NFSException(
-                "No network transport type specified for the export.")
-
-        for t in self.transports:
-            match = re.match(r'^TCP$|^UDP$', t)
-            if not match:
-                raise NFSException(
-                    "'{}' is an invalid network transport type identifier"
-                    .format(t))
-
-        self.fsal.validate()
-
-        if 4 in self.protocols:
-            if not self.pseudo:
-                raise NFSException(
-                    "Pseudo path is required when NFSv4 protocol is used")
-            match = re.match(r'^/[^><|&()]*$', self.pseudo)
-            if not match:
-                raise NFSException(
-                    "Export pseudo path ({}) is invalid".format(self.pseudo))
-
-        if self.tag:
-            match = re.match(r'^[^/><|:&()]+$', self.tag)
-            if not match:
-                raise NFSException(
-                    "Export tag ({}) is invalid".format(self.tag))
-
-        if self.fsal.name == 'RGW' and 4 not in self.protocols and not self.tag:
-            raise NFSException(
-                "Tag is mandatory for RGW export when using only NFSv3")
-
-    @classmethod
-    def from_export_block(cls, export_block, cluster_id, defaults):
-        logger.debug("parsing export block: %s", export_block)
-
-        fsal_block = [b for b in export_block['_blocks_']
-                      if b['block_name'] == "FSAL"]
-
-        protocols = export_block.get('protocols', defaults['protocols'])
-        if not isinstance(protocols, list):
-            protocols = [protocols]
-
-        transports = export_block.get('transports', defaults['transports'])
-        if not isinstance(transports, list):
-            transports = [transports]
-
-        client_blocks = [b for b in export_block['_blocks_']
-                         if b['block_name'] == "CLIENT"]
-
-        return cls(export_block['export_id'],
-                   export_block['path'],
-                   FSal.from_fsal_block(fsal_block[0]),
-                   cluster_id,
-                   [],
-                   export_block.get('pseudo', None),
-                   export_block.get('tag', None),
-                   export_block.get('access_type', defaults['access_type']),
-                   export_block.get('squash', defaults['squash']),
-                   export_block.get('attr_expiration_time', None),
-                   export_block.get('security_label', False),
-                   protocols,
-                   transports,
-                   [Client.from_client_block(client)
-                    for client in client_blocks])
-
-    def to_export_block(self, defaults):
-        # pylint: disable=too-many-branches
-        result = {
-            'block_name': 'EXPORT',
-            'export_id': self.export_id,
-            'path': self.path
-        }
-        if self.pseudo:
-            result['pseudo'] = self.pseudo
-        if self.tag:
-            result['tag'] = self.tag
-        if 'access_type' not in defaults \
-                or self.access_type != defaults['access_type']:
-            result['access_type'] = self.access_type
-        if 'squash' not in defaults or self.squash != defaults['squash']:
-            result['squash'] = self.squash
-        if self.fsal.name == 'CEPH':
-            result['attr_expiration_time'] = self.attr_expiration_time
-            result['security_label'] = self.security_label
-        if 'protocols' not in defaults:
-            result['protocols'] = list(self.protocols)
-        else:
-            def_proto = defaults['protocols']
-            if not isinstance(def_proto, list):
-                def_proto = set([def_proto])
-            if self.protocols != def_proto:
-                result['protocols'] = list(self.protocols)
-        if 'transports' not in defaults:
-            result['transports'] = list(self.transports)
-        else:
-            def_transp = defaults['transports']
-            if not isinstance(def_transp, list):
-                def_transp = set([def_transp])
-            if self.transports != def_transp:
-                result['transports'] = list(self.transports)
-
-        result['_blocks_'] = [self.fsal.to_fsal_block()]
-        result['_blocks_'].extend([client.to_client_block()
-                                   for client in self.clients])
-        return result
-
-    @classmethod
-    def from_dict(cls, export_id, ex_dict, old_export=None):
-        return cls(export_id,
-                   ex_dict['path'],
-                   FSal.from_dict(ex_dict['fsal']),
-                   ex_dict['cluster_id'],
-                   ex_dict['daemons'],
-                   ex_dict['pseudo'],
-                   ex_dict['tag'],
-                   ex_dict['access_type'],
-                   ex_dict['squash'],
-                   old_export.attr_expiration_time if old_export else None,
-                   ex_dict['security_label'],
-                   ex_dict['protocols'],
-                   ex_dict['transports'],
-                   [Client.from_dict(client) for client in ex_dict['clients']])
-
-    def to_dict(self):
-        return {
-            'export_id': self.export_id,
-            'path': self.path,
-            'fsal': self.fsal.to_dict(),
-            'cluster_id': self.cluster_id,
-            'daemons': sorted(list(self.daemons)),
-            'pseudo': self.pseudo,
-            'tag': self.tag,
-            'access_type': self.access_type,
-            'squash': self.squash,
-            'security_label': self.security_label,
-            'protocols': sorted(list(self.protocols)),
-            'transports': sorted(list(self.transports)),
-            'clients': [client.to_dict() for client in self.clients]
-        }
-
-
-class ClusterType(object):
-
-    # Ganesha clusters deployed by the Orchestrator.
-    ORCHESTRATOR = 'orchestrator'
-
-    # Ganesha clusters deployed manually by the user. Specified by using the
-    # GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE setting.
-    USER = 'user'
-
-
-class GaneshaConf(object):
-    # pylint: disable=R0902
-
-    def __init__(self, cluster_id, rados_pool, rados_namespace, daemon_confs=None):
-        self.cluster_id = cluster_id
-        self.rados_pool = rados_pool
-        self.rados_namespace = rados_namespace
-        self.daemon_confs = daemon_confs if daemon_confs is not None else []
-        self.export_conf_blocks = []  # type: ignore
-        self.daemons_conf_blocks = {}  # type: ignore
-        self._defaults = {}
-        self.exports = {}
-
-        self._read_raw_config()
-
-        # load defaults
-        def_block = [b for b in self.export_conf_blocks
-                     if b['block_name'] == "EXPORT_DEFAULTS"]
-        self.export_defaults = def_block[0] if def_block else {}
-        self._defaults = self.ganesha_defaults(self.export_defaults)
-
-        for export_block in [block for block in self.export_conf_blocks
-                             if block['block_name'] == "EXPORT"]:
-            export = Export.from_export_block(export_block, cluster_id,
-                                              self._defaults)
-            self.exports[export.export_id] = export
-
-        # link daemons to exports
-        self._link_daemons_to_exports()
-
-    def _link_daemons_to_exports(self):
-        raise NotImplementedError()
-
-    @classmethod
-    def instance(cls, cluster_id):
-        cluster = Ganesha.get_cluster(cluster_id)
-        if cluster['type'] == ClusterType.ORCHESTRATOR:
-            return GaneshaConfOrchestrator(cluster_id, cluster['pool'], cluster['namespace'],
-                                           [cluster['daemon_conf']])
-        if cluster['type'] == ClusterType.USER:
-            return GaneshaConfUser(cluster_id, cluster['pool'], cluster['namespace'])
-        raise NFSException('Unknown cluster type `{}` for cluster `{}`'.format(
-            cluster['type'], cluster_id))
-
-    def _read_raw_config(self):
-
-        def _read_rados_obj(_obj):
-            size, _ = _obj.stat()
-            return _obj.read(size).decode("utf-8")
-
-        with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-            if self.rados_namespace:
-                ioctx.set_namespace(self.rados_namespace)
-            objs = ioctx.list_objects()
-            for obj in objs:
-                if obj.key.startswith("export-"):
-                    raw_config = _read_rados_obj(obj)
-                    logger.debug("read export configuration from rados "
-                                 "object %s/%s/%s:\n%s", self.rados_pool,
-                                 self.rados_namespace, obj.key, raw_config)
-                    self.export_conf_blocks.extend(
-                        GaneshaConfParser(raw_config).parse())
-                elif not self.daemon_confs and obj.key.startswith("conf-"):
-                    # Read all `conf-xxx` for daemon configs.
-                    raw_config = _read_rados_obj(obj)
-                    logger.debug("read daemon configuration from rados "
-                                 "object %s/%s/%s:\n%s", self.rados_pool,
-                                 self.rados_namespace, obj.key, raw_config)
-                    idx = obj.key.find('-')
-                    self.daemons_conf_blocks[obj.key[idx+1:]] = \
-                        GaneshaConfParser(raw_config).parse()
-
-            if self.daemon_confs:
-                # When daemon configs are provided.
-                for conf in self.daemon_confs:
-                    size, _ = ioctx.stat(conf)
-                    raw_config = ioctx.read(conf, size).decode("utf-8")
-                    logger.debug("read daemon configuration from rados "
-                                 "object %s/%s/%s:\n%s", self.rados_pool,
-                                 self.rados_namespace, conf, raw_config)
-                    self.daemons_conf_blocks[conf] = \
-                        GaneshaConfParser(raw_config).parse()
-
-    def _write_raw_config(self, conf_block, obj):
-        raw_config = GaneshaConfParser.write_conf(conf_block)
-        with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-            if self.rados_namespace:
-                ioctx.set_namespace(self.rados_namespace)
-            ioctx.write_full(obj, raw_config.encode('utf-8'))
-            logger.debug(
-                "write configuration into rados object %s/%s/%s:\n%s",
-                self.rados_pool, self.rados_namespace, obj, raw_config)
-
-    @classmethod
-    def ganesha_defaults(cls, export_defaults):
-        """
-        According to
-        https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/export.txt
-        """
-        return {
-            'access_type': export_defaults.get('access_type', 'NONE'),
-            'protocols': export_defaults.get('protocols', [3, 4]),
-            'transports': export_defaults.get('transports', ['TCP', 'UDP']),
-            'squash': export_defaults.get('squash', 'root_squash')
-        }
-
-    @classmethod
-    def format_squash(cls, squash):
-        if squash is None:
-            return None
-        if squash.lower() in ["no_root_squash", "noidsquash", "none"]:
-            return "no_root_squash"
-        if squash.lower() in ["rootid", "root_id_squash", "rootidsquash"]:
-            return "root_id_squash"
-        if squash.lower() in ["root", "root_squash", "rootsquash"]:
-            return "root_squash"
-        if squash.lower() in ["all", "all_squash", "allsquash",
-                              "all_anonymous", "allanonymous"]:
-            return "all_squash"
-        logger.error("could not parse squash value: %s", squash)
-        raise NFSException("'{}' is an invalid squash option".format(squash))
-
-    @classmethod
-    def format_protocol(cls, protocol):
-        if str(protocol) in ["NFSV3", "3", "V3", "NFS3"]:
-            return 3
-        if str(protocol) in ["NFSV4", "4", "V4", "NFS4"]:
-            return 4
-        logger.error("could not parse protocol value: %s", protocol)
-        raise NFSException("'{}' is an invalid NFS protocol version identifier"
-                           .format(protocol))
-
-    @classmethod
-    def format_path(cls, path):
-        if path is not None:
-            path = path.strip()
-            if len(path) > 1 and path[-1] == '/':
-                path = path[:-1]
-        return path
-
-    def validate(self, export: Export):
-        export.validate()
-
-        if 4 in export.protocols:  # NFSv4 protocol
-            len_prefix = 1
-            parent_export = None
-            for ex in self.list_exports():
-                if export.tag and ex.tag == export.tag:
-                    raise NFSException(
-                        "Another export exists with the same tag: {}"
-                        .format(export.tag))
-
-                if export.pseudo and ex.pseudo == export.pseudo:
-                    raise NFSException(
-                        "Another export exists with the same pseudo path: {}"
-                        .format(export.pseudo))
-
-                if not ex.pseudo:
-                    continue
-
-                if export.pseudo[:export.pseudo.rfind('/')+1].startswith(ex.pseudo):
-                    if export.pseudo[len(ex.pseudo)] == '/':
-                        if len(ex.pseudo) > len_prefix:
-                            len_prefix = len(ex.pseudo)
-                            parent_export = ex
-
-            if len_prefix > 1:
-                # validate pseudo path
-                idx = len(parent_export.pseudo)  # type: ignore
-                idx = idx + 1 if idx > 1 else idx
-                real_path = "{}/{}".format(
-                    parent_export.path  # type: ignore
-                    if len(parent_export.path) > 1 else "",  # type: ignore
-                    export.pseudo[idx:])
-                if export.fsal.name == 'CEPH':
-                    cfs = CephFS()
-                    if export.path != real_path and not cfs.dir_exists(real_path):
-                        raise NFSException(
-                            "Pseudo path ({}) invalid, path {} does not exist."
-                            .format(export.pseudo, real_path))
-
-    def _gen_export_id(self):
-        exports = sorted(self.exports)
-        nid = 1
-        for e_id in exports:
-            if e_id == nid:
-                nid += 1
-            else:
-                break
-        return nid
-
-    def _persist_daemon_configuration(self):
-        raise NotImplementedError()
-
-    def _save_export(self, export):
-        self.validate(export)
-        export.fsal.create_path(export.path)
-        export.fsal.fill_keys()
-        self.exports[export.export_id] = export
-        conf_block = export.to_export_block(self.export_defaults)
-        self._write_raw_config(conf_block, "export-{}".format(export.export_id))
-        self._persist_daemon_configuration()
-
-    def _delete_export(self, export_id):
-        self._persist_daemon_configuration()
-        with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-            if self.rados_namespace:
-                ioctx.set_namespace(self.rados_namespace)
-            ioctx.remove_object("export-{}".format(export_id))
-
-    def list_exports(self):
-        return [ex for _, ex in self.exports.items()]
-
-    def create_export(self, ex_dict):
-        ex_id = self._gen_export_id()
-        export = Export.from_dict(ex_id, ex_dict)
-        self._save_export(export)
-        return ex_id
-
-    def has_export(self, export_id):
-        return export_id in self.exports
-
-    def update_export(self, ex_dict):
-        if ex_dict['export_id'] not in self.exports:
-            return None
-        old_export = self.exports[ex_dict['export_id']]
-        del self.exports[ex_dict['export_id']]
-        export = Export.from_dict(ex_dict['export_id'], ex_dict, old_export)
-        self._save_export(export)
-        self.exports[export.export_id] = export
-        return old_export
-
-    def remove_export(self, export_id):
-        if export_id not in self.exports:
-            return None
-        export = self.exports[export_id]
-        del self.exports[export_id]
-        self._delete_export(export_id)
-        return export
-
-    def get_export(self, export_id):
-        if export_id in self.exports:
-            return self.exports[export_id]
-        return None
-
-    def list_daemons(self) -> List[Dict[str, Any]]:
-        raise NotImplementedError()
-
-    def list_daemon_confs(self):
-        return self.daemons_conf_blocks.keys()
-
-    def reload_daemons(self, daemons):
-        with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-            if self.rados_namespace:
-                ioctx.set_namespace(self.rados_namespace)
-            for daemon_id in daemons:
-                ioctx.notify("conf-{}".format(daemon_id))
-
-
-class GaneshaConfOrchestrator(GaneshaConf):
-    @classmethod
-    def _get_orch_nfs_instances(cls,
-                                service_name: Optional[str] = None) -> List[DaemonDescription]:
-        try:
-            return OrchClient.instance().services.\
-                list_daemons(service_name=service_name, daemon_type="nfs")
-        except (RuntimeError, OrchestratorError, ImportError):
-            return []
-
-    def _link_daemons_to_exports(self):
-        instances = self._get_orch_nfs_instances('nfs.{}'.format(self.cluster_id))
-        daemon_ids = {instance.daemon_id for instance in instances}
-        for _, daemon_blocks in self.daemons_conf_blocks.items():
-            for block in daemon_blocks:
-                if block['block_name'] == "%url":
-                    rados_url = block['value']
-                    _, _, obj = Ganesha.parse_rados_url(rados_url)
-                    if obj.startswith("export-"):
-                        export_id = int(obj[obj.find('-')+1:])
-                        self.exports[export_id].daemons.update(daemon_ids)
-
-    def validate(self, export: Export):
-        daemons_list = {d['daemon_id'] for d in self.list_daemons()}
-        if export.daemons and set(export.daemons) != daemons_list:
-            raise NFSException('Export should be linked to all daemons.')
-        super().validate(export)
-
-    def _persist_daemon_configuration(self):
-        daemon_map = {}  # type: ignore
-        for daemon_id in self.list_daemon_confs():
-            daemon_map[daemon_id] = []
-
-        for daemon_id in self.list_daemon_confs():
-            for _, ex in self.exports.items():
-                if ex.daemons:
-                    daemon_map[daemon_id].append({
-                        'block_name': "%url",
-                        'value': Ganesha.make_rados_url(
-                            self.rados_pool, self.rados_namespace,
-                            "export-{}".format(ex.export_id))
-                    })
-        for daemon_id, conf_blocks in daemon_map.items():
-            self._write_raw_config(conf_blocks, daemon_id)
-
-    def list_daemons(self) -> List[Dict[str, Any]]:
-        instances = self._get_orch_nfs_instances('nfs.{}'.format(self.cluster_id))
-        return [{
-            'cluster_id': self.cluster_id,
-            'daemon_id': instance.daemon_id,
-            'cluster_type': ClusterType.ORCHESTRATOR,
-            'status': instance.status,
-            'status_desc': instance.status_desc
-        } for instance in instances]
-
-    def reload_daemons(self, daemons):
-        with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-            if self.rados_namespace:
-                ioctx.set_namespace(self.rados_namespace)
-            for daemon_id in self.list_daemon_confs():
-                ioctx.notify(daemon_id)
-
-
-class GaneshaConfUser(GaneshaConf):
-
-    def _link_daemons_to_exports(self):
-        for daemon_id, daemon_blocks in self.daemons_conf_blocks.items():
-            for block in daemon_blocks:
-                if block['block_name'] == "%url":
-                    rados_url = block['value']
-                    _, _, obj = Ganesha.parse_rados_url(rados_url)
-                    if obj.startswith("export-"):
-                        export_id = int(obj[obj.find('-')+1:])
-                        self.exports[export_id].daemons.add(daemon_id)
-
-    def validate(self, export: Export):
-        daemons_list = [d['daemon_id'] for d in self.list_daemons()]
-        for daemon_id in export.daemons:
-            if daemon_id not in daemons_list:
-                raise NFSException("Daemon '{}' does not exist".format(daemon_id))
-        super().validate(export)
-
-    def _persist_daemon_configuration(self):
-        daemon_map = {}  # type: ignore
-        for daemon_id in self.list_daemon_confs():
-            daemon_map[daemon_id] = []
-
-        for _, ex in self.exports.items():
-            for daemon in ex.daemons:
-                daemon_map[daemon].append({
-                    'block_name': "%url",
-                    'value': Ganesha.make_rados_url(
-                        self.rados_pool, self.rados_namespace,
-                        "export-{}".format(ex.export_id))
-                })
-        for daemon_id, conf_blocks in daemon_map.items():
-            self._write_raw_config(conf_blocks, "conf-{}".format(daemon_id))
-
-    def list_daemons(self) -> List[Dict[str, Any]]:
-        return [{
-            'cluster_id': self.cluster_id,
-            'cluster_type': ClusterType.USER,
-            'daemon_id': daemon_id,
-            'status': 1,
-            'status_desc': 'running'
-        } for daemon_id in self.list_daemon_confs()]
index 8891e8e3d3c6bcf46fcda63eec181e971ea820dd..58f87bda17d1c991557e663cb74166e90b4026d5 100644 (file)
@@ -67,6 +67,10 @@ class HostManger(ResourceManager):
     def add(self, hostname: str, addr: str, labels: List[str]):
         return self.api.add_host(HostSpec(hostname, addr=addr, labels=labels))
 
+    @wait_api_result
+    def get_facts(self, hostname: Optional[str] = None) -> List[Dict[str, Any]]:
+        return self.api.get_facts(hostname)
+
     @wait_api_result
     def remove(self, hostname: str):
         return self.api.remove_host(hostname)
@@ -189,8 +193,8 @@ class OrchClient(object):
 
 class OrchFeature(object):
     HOST_LIST = 'get_hosts'
-    HOST_CREATE = 'add_host'
-    HOST_DELETE = 'remove_host'
+    HOST_ADD = 'add_host'
+    HOST_REMOVE = 'remove_host'
     HOST_LABEL_ADD = 'add_host_label'
     HOST_LABEL_REMOVE = 'remove_host_label'
     HOST_MAINTENANCE_ENTER = 'enter_host_maintenance'
@@ -198,6 +202,7 @@ class OrchFeature(object):
 
     SERVICE_LIST = 'describe_service'
     SERVICE_CREATE = 'apply'
+    SERVICE_EDIT = 'apply'
     SERVICE_DELETE = 'remove_service'
     SERVICE_RELOAD = 'service_action'
     DAEMON_LIST = 'list_daemons'
index e5f614ade228e6024cd542b6948ce1093567ff48..915f6d7fe17c4db57dc8e7be423b2042007a0b6f 100644 (file)
@@ -308,6 +308,9 @@ class RgwClient(RestClient):
     def _get_realms_info(self):  # type: () -> dict
         return json_str_to_object(self.proxy('GET', 'realm?list', None, None))
 
+    def _get_realm_info(self, realm_id: str) -> Dict[str, Any]:
+        return json_str_to_object(self.proxy('GET', f'realm?id={realm_id}', None, None))
+
     @staticmethod
     def _rgw_settings():
         return (Settings.RGW_API_ACCESS_KEY,
@@ -580,6 +583,16 @@ class RgwClient(RestClient):
 
         return []
 
+    def get_default_realm(self) -> str:
+        realms_info = self._get_realms_info()
+        if 'default_info' in realms_info and realms_info['default_info']:
+            realm_info = self._get_realm_info(realms_info['default_info'])
+            if 'name' in realm_info and realm_info['name']:
+                return realm_info['name']
+        raise DashboardException(msg='Default realm not found.',
+                                 http_status_code=404,
+                                 component='rgw')
+
     @RestClient.api_get('/{bucket_name}?versioning')
     def get_bucket_versioning(self, bucket_name, request=None):
         """
index 9075cdc65fc857d27e14e73bdb1cd89b126d0c78..ba005c480d52ae8eea2d9094da0d96d88f1a9e83 100644 (file)
@@ -6,6 +6,7 @@ import json
 import logging
 import threading
 import time
+from typing import Any, Dict
 from unittest.mock import Mock
 
 import cherrypy
@@ -14,8 +15,9 @@ from cherrypy.test import helper
 from mgr_module import HandleCommandResult
 from pyfakefs import fake_filesystem
 
-from .. import DEFAULT_VERSION, mgr
+from .. import mgr
 from ..controllers import generate_controller_routes, json_error_page
+from ..controllers._version import APIVersion
 from ..module import Module
 from ..plugins import PLUGIN_MANAGER, debug, feature_toggles  # noqa
 from ..services.auth import AuthManagerTool
@@ -101,12 +103,18 @@ class ControllerTestCase(helper.CPWebCase):
     _endpoints_cache = {}
 
     @classmethod
-    def setup_controllers(cls, ctrl_classes, base_url=''):
+    def setup_controllers(cls, ctrl_classes, base_url='', cp_config: Dict[str, Any] = None):
         if not isinstance(ctrl_classes, list):
             ctrl_classes = [ctrl_classes]
         mapper = cherrypy.dispatch.RoutesDispatcher()
         endpoint_list = []
         for ctrl in ctrl_classes:
+            ctrl._cp_config = {
+                'tools.dashboard_exception_handler.on': True,
+                'tools.authenticate.on': False
+            }
+            if cp_config:
+                ctrl._cp_config.update(cp_config)
             inst = ctrl()
 
             # We need to cache the controller endpoints because
@@ -153,18 +161,18 @@ class ControllerTestCase(helper.CPWebCase):
         if cls._request_logging:
             cherrypy.config.update({'tools.request_logging.on': False})
 
-    def _request(self, url, method, data=None, headers=None, version=DEFAULT_VERSION):
+    def _request(self, url, method, data=None, headers=None, version=APIVersion.DEFAULT):
         if not data:
             b = None
             if version:
-                h = [('Accept', 'application/vnd.ceph.api.v{}+json'.format(version)),
+                h = [('Accept', version.to_mime_type()),
                      ('Content-Length', '0')]
             else:
                 h = None
         else:
             b = json.dumps(data)
             if version is not None:
-                h = [('Accept', 'application/vnd.ceph.api.v{}+json'.format(version)),
+                h = [('Accept', version.to_mime_type()),
                      ('Content-Type', 'application/json'),
                      ('Content-Length', str(len(b)))]
 
@@ -176,19 +184,19 @@ class ControllerTestCase(helper.CPWebCase):
             h = headers
         self.getPage(url, method=method, body=b, headers=h)
 
-    def _get(self, url, headers=None, version=DEFAULT_VERSION):
+    def _get(self, url, headers=None, version=APIVersion.DEFAULT):
         self._request(url, 'GET', headers=headers, version=version)
 
-    def _post(self, url, data=None, version=DEFAULT_VERSION):
+    def _post(self, url, data=None, version=APIVersion.DEFAULT):
         self._request(url, 'POST', data, version=version)
 
-    def _delete(self, url, data=None, version=DEFAULT_VERSION):
+    def _delete(self, url, data=None, version=APIVersion.DEFAULT):
         self._request(url, 'DELETE', data, version=version)
 
-    def _put(self, url, data=None, version=DEFAULT_VERSION):
+    def _put(self, url, data=None, version=APIVersion.DEFAULT):
         self._request(url, 'PUT', data, version=version)
 
-    def _task_request(self, method, url, data, timeout, version=DEFAULT_VERSION):
+    def _task_request(self, method, url, data, timeout, version=APIVersion.DEFAULT):
         self._request(url, method, data, version=version)
         if self.status != '202 Accepted':
             logger.info("task finished immediately")
@@ -254,13 +262,13 @@ class ControllerTestCase(helper.CPWebCase):
             self.status = 500
         self.body = json.dumps(thread.res_task['exception'])
 
-    def _task_post(self, url, data=None, timeout=60, version=DEFAULT_VERSION):
+    def _task_post(self, url, data=None, timeout=60, version=APIVersion.DEFAULT):
         self._task_request('POST', url, data, timeout, version=version)
 
-    def _task_delete(self, url, timeout=60, version=DEFAULT_VERSION):
+    def _task_delete(self, url, timeout=60, version=APIVersion.DEFAULT):
         self._task_request('DELETE', url, None, timeout, version=version)
 
-    def _task_put(self, url, data=None, timeout=60, version=DEFAULT_VERSION):
+    def _task_put(self, url, data=None, timeout=60, version=APIVersion.DEFAULT):
         self._task_request('PUT', url, data, timeout, version=version)
 
     def json_body(self):
index f64664caa4000993ec2d0be6f1f8fa9745361ed4..7a75bda6dd35937794b47905d19fe764b165858a 100644 (file)
@@ -15,7 +15,7 @@ from ..security import Permission, Scope
 from ..services.access_control import SYSTEM_ROLES, AccessControlDB, \
     PasswordPolicy, load_access_control_db, password_hash
 from ..settings import Settings
-from . import CLICommandTestMixin, CmdException  # pylint: disable=no-name-in-module
+from ..tests import CLICommandTestMixin, CmdException
 
 
 class AccessControlTest(unittest.TestCase, CLICommandTestMixin):
index b2e83379efc8de3da51b70af3ab58427a59fde23..854d76468c21fe17185968be01105568a27811eb 100644 (file)
@@ -10,12 +10,12 @@ except ImportError:
     import unittest.mock as mock
 
 from .. import mgr
-from ..controllers import Controller, RESTController
-from . import ControllerTestCase, KVStoreMockMixin  # pylint: disable=no-name-in-module
+from ..controllers import RESTController, Router
+from ..tests import ControllerTestCase, KVStoreMockMixin
 
 
 # pylint: disable=W0613
-@Controller('/foo', secure=False)
+@Router('/foo', secure=False)
 class FooResource(RESTController):
     def create(self, password):
         pass
index 6f1d2a084ec461741c4bb270e5c70f8069d12b7a..d9755de98e45ad1f8af3528fcc0cc9d2c9bbb1ce 100644 (file)
@@ -1,7 +1,15 @@
 import unittest
+from unittest.mock import Mock, patch
 
 from .. import mgr
+from ..controllers.auth import Auth
 from ..services.auth import JwtManager
+from ..tests import ControllerTestCase
+
+mgr.get_module_option.return_value = JwtManager.JWT_TOKEN_TTL
+mgr.get_store.return_value = 'jwt_secret'
+mgr.ACCESS_CTRL_DB = Mock()
+mgr.ACCESS_CTRL_DB.get_attempt.return_value = 1
 
 
 class JwtManagerTest(unittest.TestCase):
@@ -18,3 +26,41 @@ class JwtManagerTest(unittest.TestCase):
         self.assertIsInstance(decoded_token, dict)
         self.assertEqual(decoded_token['iss'], 'ceph-dashboard')
         self.assertEqual(decoded_token['username'], 'my-username')
+
+
+class AuthTest(ControllerTestCase):
+
+    @classmethod
+    def setup_server(cls):
+        cls.setup_controllers([Auth])
+
+    def test_request_not_authorized(self):
+        self.setup_controllers([Auth], cp_config={'tools.authenticate.on': True})
+        self._post('/api/auth/logout')
+        self.assertStatus(401)
+
+    @patch('dashboard.controllers.auth.JwtManager.gen_token', Mock(return_value='my-token'))
+    @patch('dashboard.controllers.auth.AuthManager.authenticate', Mock(return_value={
+        'permissions': {'rgw': ['read']},
+        'pwdExpirationDate': 1000000,
+        'pwdUpdateRequired': False
+    }))
+    def test_login(self):
+        self._post('/api/auth', {'username': 'my-user', 'password': 'my-pass'})
+        self.assertStatus(201)
+        self.assertJsonBody({
+            'token': 'my-token',
+            'username': 'my-user',
+            'permissions': {'rgw': ['read']},
+            'pwdExpirationDate': 1000000,
+            'sso': False,
+            'pwdUpdateRequired': False
+        })
+
+    @patch('dashboard.controllers.auth.JwtManager', Mock())
+    def test_logout(self):
+        self._post('/api/auth/logout')
+        self.assertStatus(200)
+        self.assertJsonBody({
+            'redirect_url': '#/login'
+        })
index 9a8ca674c23634639192b8ab5e46a00d9eb3c172..40f6eb9efa464d4c0888479899505de3fcc04394 100644 (file)
@@ -126,4 +126,7 @@ def test_get_smart_data_from_appropriate_ceph_command(send_command):
     ]
     CephService._get_smart_data_by_device({'devid': '1', 'daemons': ['osd.1', 'mon.1']})
     send_command.assert_has_calls([mock.call('mon', 'osd tree'),
-                                   mock.call('mon', 'device get-health-metrics', '1', devid='1')])
+                                   mock.call('osd', 'smart', '1', devid='1'),
+                                   mock.call('mon', 'osd tree'),
+                                   mock.call('mon', 'device query-daemon-health-metrics',
+                                             who='mon.1')])
index 5c35cab329cd6e980b120c6973ef70d07972cb55..ae4253543841d122d0b69ea97f2eed5d2e5804a9 100644 (file)
@@ -7,7 +7,7 @@ except ImportError:
     from unittest.mock import patch, Mock
 
 from ..controllers.cephfs import CephFS
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 
 class MetaDataMock(object):
index bacef3677d787af894f69dee7730262fe5f14e1f..4b91b110391e15477eb8f4045ef9beb542338c9d 100644 (file)
@@ -1,11 +1,11 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from ..controllers import ApiController, BaseController, Controller, Endpoint, RESTController
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..controllers import APIRouter, BaseController, Endpoint, RESTController, Router
+from ..tests import ControllerTestCase
 
 
-@Controller("/btest/{key}", base_url="/ui", secure=False)
+@Router("/btest/{key}", base_url="/ui", secure=False)
 class BTest(BaseController):
     @Endpoint()
     def test1(self, key, opt=1):
@@ -37,7 +37,7 @@ class BTest(BaseController):
         return {'key': key, 'opt': opt}
 
 
-@ApiController("/rtest/{key}", secure=False)
+@APIRouter("/rtest/{key}", secure=False)
 class RTest(RESTController):
     RESOURCE_ID = 'skey/ekey'
 
@@ -71,7 +71,7 @@ class RTest(RESTController):
         return {'key': key, 'skey': skey, 'ekey': ekey, 'opt': opt}
 
 
-@Controller("/", secure=False)
+@Router("/", secure=False)
 class Root(BaseController):
     @Endpoint(json_response=False)
     def __call__(self):
index 072985e8bf89416420810376cd25419a2f867cdd..5291edb3bb77f6ef1ecebf351ea3503b091f5a52 100644 (file)
@@ -2,14 +2,15 @@
 from __future__ import absolute_import
 
 from ..api.doc import SchemaType
-from ..controllers import ApiController, ControllerDoc, Endpoint, EndpointDoc, RESTController
+from ..controllers import ENDPOINT_MAP, APIDoc, APIRouter, Endpoint, EndpointDoc, RESTController
+from ..controllers._version import APIVersion
 from ..controllers.docs import Docs
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 
 # Dummy controller and endpoint that can be assigned with @EndpointDoc and @GroupDoc
-@ControllerDoc("Group description", group="FooGroup")
-@ApiController("/doctest/", secure=False)
+@APIDoc("Group description", group="FooGroup")
+@APIRouter("/doctest/", secure=False)
 class DecoratedController(RESTController):
     RESOURCE_ID = 'doctest'
 
@@ -29,11 +30,11 @@ class DecoratedController(RESTController):
         },
     )
     @Endpoint(json_response=False)
-    @RESTController.Resource('PUT', version='0.1')
+    @RESTController.Resource('PUT', version=APIVersion(0, 1))
     def decorated_func(self, parameter):
         pass
 
-    @RESTController.MethodMap(version='0.1')
+    @RESTController.MethodMap(version=APIVersion(0, 1))
     def list(self):
         pass
 
@@ -65,6 +66,7 @@ class DocDecoratorsTest(ControllerTestCase):
 class DocsTest(ControllerTestCase):
     @classmethod
     def setup_server(cls):
+        ENDPOINT_MAP.clear()
         cls.setup_controllers([DecoratedController, Docs], "/test")
 
     def test_type_to_str(self):
@@ -86,7 +88,7 @@ class DocsTest(ControllerTestCase):
 
         expected_response_content = {
             '200': {
-                'application/vnd.ceph.api.v0.1+json': {
+                APIVersion(0, 1).to_mime_type(): {
                     'schema': {'type': 'array',
                                'items': {'type': 'object', 'properties': {
                                    'my_prop': {
@@ -94,7 +96,7 @@ class DocsTest(ControllerTestCase):
                                        'description': '200 property desc.'}}},
                                'required': ['my_prop']}}},
             '202': {
-                'application/vnd.ceph.api.v0.1+json': {
+                APIVersion(0, 1).to_mime_type(): {
                     'schema': {'type': 'object',
                                'properties': {'my_prop': {
                                    'type': 'string',
@@ -110,7 +112,7 @@ class DocsTest(ControllerTestCase):
     def test_gen_method_paths(self):
         outcome = Docs().gen_paths(False)['/api/doctest/']['get']
 
-        self.assertEqual({'application/vnd.ceph.api.v0.1+json': {'type': 'object'}},
+        self.assertEqual({APIVersion(0, 1).to_mime_type(): {'type': 'object'}},
                          outcome['responses']['200']['content'])
 
     def test_gen_paths_all(self):
@@ -119,5 +121,5 @@ class DocsTest(ControllerTestCase):
             self.assertTrue(any(base in key.split('/')[1] for base in ['api', 'ui-api']))
 
     def test_gen_tags(self):
-        outcome = Docs()._gen_tags(False)[0]
-        self.assertEqual({'description': 'Group description', 'name': 'FooGroup'}, outcome)
+        outcome = Docs._gen_tags(False)
+        self.assertEqual([{'description': 'Group description', 'name': 'FooGroup'}], outcome)
index 8ff1490708ff0e0e4c01a41dd331670b1f369282..d1b032a514f30cdd33b773803d6b241495705214 100644 (file)
@@ -2,7 +2,7 @@
 
 from .. import mgr
 from ..controllers.erasure_code_profile import ErasureCodeProfile
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 
 class ErasureCodeProfileTest(ControllerTestCase):
@@ -21,8 +21,6 @@ class ErasureCodeProfileTest(ControllerTestCase):
             'fs_map': {'filesystems': []},
 
         }[key]
-        # pylint: disable=protected-access
-        ErasureCodeProfile._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([ErasureCodeProfile])
 
     def test_list(self):
index bbf9090957204ea2e386b5c2513a9ad5fe50721f..2a9e840b8987b5f9cc5e8d9720bb4dd716c0e8cd 100644 (file)
@@ -5,16 +5,16 @@ import time
 
 import rados
 
-from ..controllers import Controller, Endpoint, RESTController, Task
+from ..controllers import Endpoint, RESTController, Router, Task
 from ..services.ceph_service import SendCommandError
 from ..services.exception import handle_rados_error, \
     handle_send_command_error, serialize_dashboard_exception
+from ..tests import ControllerTestCase
 from ..tools import NotificationQueue, TaskManager, ViewCache
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
 
 
 # pylint: disable=W0613
-@Controller('foo', secure=False)
+@Router('foo', secure=False)
 class FooResource(RESTController):
 
     @Endpoint()
index 571b8c286c859893c2b058e894fa4016dd39fe8f..dcc41b25eb1023295931a16ee1a7b89f83629827 100644 (file)
@@ -9,7 +9,7 @@ except ImportError:
     from unittest.mock import Mock, patch
 
 from ..plugins.feature_toggles import Actions, Features, FeatureToggles
-from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
+from ..tests import KVStoreMockMixin
 
 
 class SettingsTest(unittest.TestCase, KVStoreMockMixin):
@@ -23,8 +23,8 @@ class SettingsTest(unittest.TestCase, KVStoreMockMixin):
         cls.mgr = mgr
 
         # Populate real endpoint map
-        from ..controllers import load_controllers
-        cls.controllers = load_controllers()
+        from ..controllers import BaseController
+        cls.controllers = BaseController.load_controllers()
 
         # Initialize FeatureToggles plugin
         cls.plugin = FeatureToggles()
diff --git a/ceph/src/pybind/mgr/dashboard/tests/test_ganesha.py b/ceph/src/pybind/mgr/dashboard/tests/test_ganesha.py
deleted file mode 100644 (file)
index f9cc44a..0000000
+++ /dev/null
@@ -1,1058 +0,0 @@
-# -*- coding: utf-8 -*-
-# pylint: disable=too-many-lines
-from __future__ import absolute_import
-
-import unittest
-from unittest.mock import MagicMock, Mock, patch
-from urllib.parse import urlencode
-
-from ceph.deployment.service_spec import NFSServiceSpec
-from orchestrator import DaemonDescription, ServiceDescription
-
-from .. import mgr
-from ..controllers.nfsganesha import NFSGaneshaUi
-from ..services import ganesha
-from ..services.ganesha import ClusterType, Export, GaneshaConf, GaneshaConfParser, NFSException
-from ..settings import Settings
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
-from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
-
-
-class GaneshaConfTest(unittest.TestCase, KVStoreMockMixin):
-    daemon_raw_config = """
-NFS_CORE_PARAM {
-            Enable_NLM = false;
-            Enable_RQUOTA = false;
-            Protocols = 4;
-            NFS_Port = 14000;
-        }
-
-        MDCACHE {
-           Dir_Chunk = 0;
-        }
-
-        NFSv4 {
-           RecoveryBackend = rados_cluster;
-           Minor_Versions = 1, 2;
-        }
-
-        RADOS_KV {
-           pool = nfs-ganesha;
-           namespace = vstart;
-           UserId = vstart;
-           nodeid = a;
-        }
-
-        RADOS_URLS {
-       Userid = vstart;
-       watch_url = 'rados://nfs-ganesha/vstart/conf-nfs.vstart';
-        }
-
-    %url rados://nfs-ganesha/vstart/conf-nfs.vstart
-"""
-
-    export_1 = """
-EXPORT {
-    Export_ID=1;
-    Protocols = 4;
-    Path = /;
-    Pseudo = /cephfs_a/;
-    Access_Type = RW;
-    Protocols = 4;
-    Attr_Expiration_Time = 0;
-    # Delegations = R;
-    # Squash = root;
-
-    FSAL {
-        Name = CEPH;
-        Filesystem = "a";
-        User_Id = "ganesha";
-        # Secret_Access_Key = "YOUR SECRET KEY HERE";
-    }
-
-    CLIENT
-    {
-        Clients = 192.168.0.10, 192.168.1.0/8;
-        Squash = None;
-    }
-
-    CLIENT
-    {
-        Clients = 192.168.0.0/16;
-        Squash = All;
-        Access_Type = RO;
-    }
-}
-"""
-
-    export_2 = """
-EXPORT
-{
-    Export_ID=2;
-
-    Path = "/";
-
-    Pseudo = "/rgw";
-
-    Access_Type = RW;
-
-    squash = AllAnonymous;
-
-    Protocols = 4, 3;
-
-    Transports = TCP, UDP;
-
-    FSAL {
-        Name = RGW;
-        User_Id = "testuser";
-        Access_Key_Id ="access_key";
-        Secret_Access_Key = "secret_key";
-    }
-}
-"""
-
-    conf_nodea = '''
-%url "rados://ganesha/ns/export-2"
-
-%url "rados://ganesha/ns/export-1"'''
-
-    conf_nodeb = '%url "rados://ganesha/ns/export-1"'
-
-    conf_nfs_foo = '''
-%url "rados://ganesha2/ns2/export-1"
-
-%url "rados://ganesha2/ns2/export-2"'''
-
-    class RObject(object):
-        def __init__(self, key, raw):
-            self.key = key
-            self.raw = raw
-
-        def read(self, _):
-            return self.raw.encode('utf-8')
-
-        def stat(self):
-            return len(self.raw), None
-
-    def _ioctx_write_full_mock(self, key, content):
-        if key not in self.temp_store[self.temp_store_namespace]:
-            self.temp_store[self.temp_store_namespace][key] = \
-                GaneshaConfTest.RObject(key, content.decode('utf-8'))
-        else:
-            self.temp_store[self.temp_store_namespace][key].raw = content.decode('utf-8')
-
-    def _ioctx_remove_mock(self, key):
-        del self.temp_store[self.temp_store_namespace][key]
-
-    def _ioctx_list_objects_mock(self):
-        return [obj for _, obj in self.temp_store[self.temp_store_namespace].items()]
-
-    def _ioctl_stat_mock(self, key):
-        return self.temp_store[self.temp_store_namespace][key].stat()
-
-    def _ioctl_read_mock(self, key, size):
-        return self.temp_store[self.temp_store_namespace][key].read(size)
-
-    def _ioctx_set_namespace_mock(self, namespace):
-        self.temp_store_namespace = namespace
-
-    @staticmethod
-    def _set_user_defined_clusters_location(clusters_pool_namespace='ganesha/ns'):
-        Settings.GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE = clusters_pool_namespace
-
-    def setUp(self):
-        self.mock_kv_store()
-
-        self.clusters = {
-            'foo': {
-                'pool': 'ganesha2',
-                'namespace': 'ns2',
-                'type': ClusterType.ORCHESTRATOR,
-                'daemon_conf': 'conf-nfs.foo',
-                'daemons': ['foo.host_a', 'foo.host_b'],
-                'exports': {
-                    1: ['foo.host_a', 'foo.host_b'],
-                    2: ['foo.host_a', 'foo.host_b'],
-                    3: ['foo.host_a', 'foo.host_b']  # for new-added export
-                }
-            }
-        }
-
-        # Unset user-defined location.
-        self._set_user_defined_clusters_location('')
-
-        self.temp_store_namespace = None
-        self._reset_temp_store()
-
-        self.io_mock = MagicMock()
-        self.io_mock.set_namespace.side_effect = self._ioctx_set_namespace_mock
-        self.io_mock.read = self._ioctl_read_mock
-        self.io_mock.stat = self._ioctl_stat_mock
-        self.io_mock.list_objects.side_effect = self._ioctx_list_objects_mock
-        self.io_mock.write_full.side_effect = self._ioctx_write_full_mock
-        self.io_mock.remove_object.side_effect = self._ioctx_remove_mock
-
-        ioctx_mock = MagicMock()
-        ioctx_mock.__enter__ = Mock(return_value=(self.io_mock))
-        ioctx_mock.__exit__ = Mock(return_value=None)
-
-        mgr.rados = MagicMock()
-        mgr.rados.open_ioctx.return_value = ioctx_mock
-
-        self._mock_orchestrator(True)
-
-        ganesha.CephX = MagicMock()
-        ganesha.CephX.list_clients.return_value = ['ganesha']
-        ganesha.CephX.get_client_key.return_value = 'ganesha'
-
-        ganesha.CephFS = MagicMock()
-
-    def _reset_temp_store(self):
-        self.temp_store_namespace = None
-        self.temp_store = {
-            'ns': {
-                'export-1': GaneshaConfTest.RObject("export-1", self.export_1),
-                'export-2': GaneshaConfTest.RObject("export-2", self.export_2),
-                'conf-nodea': GaneshaConfTest.RObject("conf-nodea", self.conf_nodea),
-                'conf-nodeb': GaneshaConfTest.RObject("conf-nodeb", self.conf_nodeb),
-            },
-            'ns2': {
-                'export-1': GaneshaConfTest.RObject("export-1", self.export_1),
-                'export-2': GaneshaConfTest.RObject("export-2", self.export_2),
-                'conf-nfs.foo': GaneshaConfTest.RObject("conf-nfs.foo", self.conf_nfs_foo)
-            }
-        }
-
-    def _mock_orchestrator(self, enable):
-        # mock nfs services
-        cluster_info = self.clusters['foo']
-        orch_nfs_services = [
-            ServiceDescription(spec=NFSServiceSpec(service_id='foo',
-                                                   pool=cluster_info['pool'],
-                                                   namespace=cluster_info['namespace']))
-        ] if enable else []
-        # pylint: disable=protected-access
-        ganesha.Ganesha._get_orch_nfs_services = Mock(return_value=orch_nfs_services)
-
-        # mock nfs daemons
-        def _get_nfs_instances(service_name=None):
-            if not enable:
-                return []
-            instances = {
-                'nfs.foo': [
-                    DaemonDescription(daemon_id='foo.host_a', status=1),
-                    DaemonDescription(daemon_id='foo.host_b', status=1)
-                ],
-                'nfs.bar': [
-                    DaemonDescription(daemon_id='bar.host_c', status=1)
-                ]
-            }
-            if service_name is not None:
-                return instances[service_name]
-            result = []
-            for _, daemons in instances.items():
-                result.extend(daemons)
-            return result
-        ganesha.GaneshaConfOrchestrator._get_orch_nfs_instances = Mock(
-            side_effect=_get_nfs_instances)
-
-    def test_parse_daemon_raw_config(self):
-        expected_daemon_config = [
-            {
-                "block_name": "NFS_CORE_PARAM",
-                "enable_nlm": False,
-                "enable_rquota": False,
-                "protocols": 4,
-                "nfs_port": 14000
-            },
-            {
-                "block_name": "MDCACHE",
-                "dir_chunk": 0
-            },
-            {
-                "block_name": "NFSV4",
-                "recoverybackend": "rados_cluster",
-                "minor_versions": [1, 2]
-            },
-            {
-                "block_name": "RADOS_KV",
-                "pool": "nfs-ganesha",
-                "namespace": "vstart",
-                "userid": "vstart",
-                "nodeid": "a"
-            },
-            {
-                "block_name": "RADOS_URLS",
-                "userid": "vstart",
-                "watch_url": "'rados://nfs-ganesha/vstart/conf-nfs.vstart'"
-            },
-            {
-                "block_name": "%url",
-                "value": "rados://nfs-ganesha/vstart/conf-nfs.vstart"
-            }
-        ]
-        daemon_config = GaneshaConfParser(self.daemon_raw_config).parse()
-        self.assertEqual(daemon_config, expected_daemon_config)
-
-    def test_export_parser_1(self):
-        blocks = GaneshaConfParser(self.export_1).parse()
-        self.assertIsInstance(blocks, list)
-        self.assertEqual(len(blocks), 1)
-        export = Export.from_export_block(blocks[0], '_default_',
-                                          GaneshaConf.ganesha_defaults({}))
-
-        self.assertEqual(export.export_id, 1)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/cephfs_a")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "root_squash")
-        self.assertEqual(export.protocols, {4})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "CEPH")
-        self.assertEqual(export.fsal.user_id, "ganesha")
-        self.assertEqual(export.fsal.fs_name, "a")
-        self.assertEqual(export.fsal.sec_label_xattr, None)
-        self.assertEqual(len(export.clients), 2)
-        self.assertEqual(export.clients[0].addresses,
-                         ["192.168.0.10", "192.168.1.0/8"])
-        self.assertEqual(export.clients[0].squash, "no_root_squash")
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.clients[1].addresses, ["192.168.0.0/16"])
-        self.assertEqual(export.clients[1].squash, "all_squash")
-        self.assertEqual(export.clients[1].access_type, "RO")
-        self.assertEqual(export.cluster_id, '_default_')
-        self.assertEqual(export.attr_expiration_time, 0)
-        self.assertEqual(export.security_label, False)
-
-    def test_export_parser_2(self):
-        blocks = GaneshaConfParser(self.export_2).parse()
-        self.assertIsInstance(blocks, list)
-        self.assertEqual(len(blocks), 1)
-        export = Export.from_export_block(blocks[0], '_default_',
-                                          GaneshaConf.ganesha_defaults({}))
-
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/rgw")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key")
-        self.assertEqual(export.fsal.secret_key, "secret_key")
-        self.assertEqual(len(export.clients), 0)
-        self.assertEqual(export.cluster_id, '_default_')
-
-    def test_daemon_conf_parser_a(self):
-        blocks = GaneshaConfParser(self.conf_nodea).parse()
-        self.assertIsInstance(blocks, list)
-        self.assertEqual(len(blocks), 2)
-        self.assertEqual(blocks[0]['block_name'], "%url")
-        self.assertEqual(blocks[0]['value'], "rados://ganesha/ns/export-2")
-        self.assertEqual(blocks[1]['block_name'], "%url")
-        self.assertEqual(blocks[1]['value'], "rados://ganesha/ns/export-1")
-
-    def test_daemon_conf_parser_b(self):
-        blocks = GaneshaConfParser(self.conf_nodeb).parse()
-        self.assertIsInstance(blocks, list)
-        self.assertEqual(len(blocks), 1)
-        self.assertEqual(blocks[0]['block_name'], "%url")
-        self.assertEqual(blocks[0]['value'], "rados://ganesha/ns/export-1")
-
-    def test_ganesha_conf(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_ganesha_conf(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_ganesha_conf(self, cluster, expected_exports):
-        ganesha_conf = GaneshaConf.instance(cluster)
-        exports = ganesha_conf.exports
-
-        self.assertEqual(len(exports.items()), 2)
-        self.assertIn(1, exports)
-        self.assertIn(2, exports)
-
-        # export_id = 1 asserts
-        export = exports[1]
-        self.assertEqual(export.export_id, 1)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/cephfs_a")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "root_squash")
-        self.assertEqual(export.protocols, {4})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "CEPH")
-        self.assertEqual(export.fsal.user_id, "ganesha")
-        self.assertEqual(export.fsal.fs_name, "a")
-        self.assertEqual(export.fsal.sec_label_xattr, None)
-        self.assertEqual(len(export.clients), 2)
-        self.assertEqual(export.clients[0].addresses,
-                         ["192.168.0.10", "192.168.1.0/8"])
-        self.assertEqual(export.clients[0].squash, "no_root_squash")
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.clients[1].addresses, ["192.168.0.0/16"])
-        self.assertEqual(export.clients[1].squash, "all_squash")
-        self.assertEqual(export.clients[1].access_type, "RO")
-        self.assertEqual(export.attr_expiration_time, 0)
-        self.assertEqual(export.security_label, False)
-        self.assertSetEqual(export.daemons, set(expected_exports[1]))
-
-        # export_id = 2 asserts
-        export = exports[2]
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/rgw")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key")
-        self.assertEqual(export.fsal.secret_key, "secret_key")
-        self.assertEqual(len(export.clients), 0)
-        self.assertSetEqual(export.daemons, set(expected_exports[2]))
-
-    def test_config_dict(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_config_dict(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_config_dict(self, cluster, expected_exports):
-        conf = GaneshaConf.instance(cluster)
-        export = conf.exports[1]
-        ex_dict = export.to_dict()
-        self.assertDictEqual(ex_dict, {
-            'daemons': expected_exports[1],
-            'export_id': 1,
-            'path': '/',
-            'pseudo': '/cephfs_a',
-            'cluster_id': cluster,
-            'tag': None,
-            'access_type': 'RW',
-            'squash': 'root_squash',
-            'security_label': False,
-            'protocols': [4],
-            'transports': ['TCP', 'UDP'],
-            'clients': [{
-                'addresses': ["192.168.0.10", "192.168.1.0/8"],
-                'access_type': None,
-                'squash': 'no_root_squash'
-            }, {
-                'addresses': ["192.168.0.0/16"],
-                'access_type': 'RO',
-                'squash': 'all_squash'
-            }],
-            'fsal': {
-                'name': 'CEPH',
-                'user_id': 'ganesha',
-                'fs_name': 'a',
-                'sec_label_xattr': None
-            }
-        })
-
-        export = conf.exports[2]
-        ex_dict = export.to_dict()
-        self.assertDictEqual(ex_dict, {
-            'daemons': expected_exports[2],
-            'export_id': 2,
-            'path': '/',
-            'pseudo': '/rgw',
-            'cluster_id': cluster,
-            'tag': None,
-            'access_type': 'RW',
-            'squash': 'all_squash',
-            'security_label': False,
-            'protocols': [3, 4],
-            'transports': ['TCP', 'UDP'],
-            'clients': [],
-            'fsal': {
-                'name': 'RGW',
-                'rgw_user_id': 'testuser'
-            }
-        })
-
-    def test_config_from_dict(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_config_from_dict(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_config_from_dict(self, cluster_id, expected_exports):
-        export = Export.from_dict(1, {
-            'daemons': expected_exports[1],
-            'export_id': 1,
-            'path': '/',
-            'cluster_id': cluster_id,
-            'pseudo': '/cephfs_a',
-            'tag': None,
-            'access_type': 'RW',
-            'squash': 'root_squash',
-            'security_label': True,
-            'protocols': [4],
-            'transports': ['TCP', 'UDP'],
-            'clients': [{
-                'addresses': ["192.168.0.10", "192.168.1.0/8"],
-                'access_type': None,
-                'squash': 'no_root_squash'
-            }, {
-                'addresses': ["192.168.0.0/16"],
-                'access_type': 'RO',
-                'squash': 'all_squash'
-            }],
-            'fsal': {
-                'name': 'CEPH',
-                'user_id': 'ganesha',
-                'fs_name': 'a',
-                'sec_label_xattr': 'security.selinux'
-            }
-        })
-
-        self.assertEqual(export.export_id, 1)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/cephfs_a")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "root_squash")
-        self.assertEqual(export.protocols, {4})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "CEPH")
-        self.assertEqual(export.fsal.user_id, "ganesha")
-        self.assertEqual(export.fsal.fs_name, "a")
-        self.assertEqual(export.fsal.sec_label_xattr, 'security.selinux')
-        self.assertEqual(len(export.clients), 2)
-        self.assertEqual(export.clients[0].addresses,
-                         ["192.168.0.10", "192.168.1.0/8"])
-        self.assertEqual(export.clients[0].squash, "no_root_squash")
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.clients[1].addresses, ["192.168.0.0/16"])
-        self.assertEqual(export.clients[1].squash, "all_squash")
-        self.assertEqual(export.clients[1].access_type, "RO")
-        self.assertEqual(export.daemons, set(expected_exports[1]))
-        self.assertEqual(export.cluster_id, cluster_id)
-        self.assertEqual(export.attr_expiration_time, 0)
-        self.assertEqual(export.security_label, True)
-
-        export = Export.from_dict(2, {
-            'daemons': expected_exports[2],
-            'export_id': 2,
-            'path': '/',
-            'pseudo': '/rgw',
-            'cluster_id': cluster_id,
-            'tag': None,
-            'access_type': 'RW',
-            'squash': 'all_squash',
-            'security_label': False,
-            'protocols': [4, 3],
-            'transports': ['TCP', 'UDP'],
-            'clients': [],
-            'fsal': {
-                'name': 'RGW',
-                'rgw_user_id': 'testuser'
-            }
-        })
-
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/rgw")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertIsNone(export.fsal.access_key)
-        self.assertIsNone(export.fsal.secret_key)
-        self.assertEqual(len(export.clients), 0)
-        self.assertEqual(export.daemons, set(expected_exports[2]))
-        self.assertEqual(export.cluster_id, cluster_id)
-
-    def test_gen_raw_config(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_gen_raw_config(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_gen_raw_config(self, cluster_id, expected_exports):
-        conf = GaneshaConf.instance(cluster_id)
-        # pylint: disable=W0212
-        export = conf.exports[1]
-        del conf.exports[1]
-        conf._save_export(export)
-        conf = GaneshaConf.instance(cluster_id)
-        exports = conf.exports
-        self.assertEqual(len(exports.items()), 2)
-        self.assertIn(1, exports)
-        self.assertIn(2, exports)
-
-        # export_id = 1 asserts
-        export = exports[1]
-        self.assertEqual(export.export_id, 1)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/cephfs_a")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "root_squash")
-        self.assertEqual(export.protocols, {4})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "CEPH")
-        self.assertEqual(export.fsal.user_id, "ganesha")
-        self.assertEqual(export.fsal.fs_name, "a")
-        self.assertEqual(export.fsal.sec_label_xattr, None)
-        self.assertEqual(len(export.clients), 2)
-        self.assertEqual(export.clients[0].addresses,
-                         ["192.168.0.10", "192.168.1.0/8"])
-        self.assertEqual(export.clients[0].squash, "no_root_squash")
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.clients[1].addresses, ["192.168.0.0/16"])
-        self.assertEqual(export.clients[1].squash, "all_squash")
-        self.assertEqual(export.clients[1].access_type, "RO")
-        self.assertEqual(export.daemons, set(expected_exports[1]))
-        self.assertEqual(export.cluster_id, cluster_id)
-        self.assertEqual(export.attr_expiration_time, 0)
-        self.assertEqual(export.security_label, False)
-
-        # export_id = 2 asserts
-        export = exports[2]
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/rgw")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key")
-        self.assertEqual(export.fsal.secret_key, "secret_key")
-        self.assertEqual(len(export.clients), 0)
-        self.assertEqual(export.daemons, set(expected_exports[2]))
-        self.assertEqual(export.cluster_id, cluster_id)
-
-    def test_update_export(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_update_export(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_update_export(self, cluster_id, expected_exports):
-        ganesha.RgwClient = MagicMock()
-        admin_inst_mock = MagicMock()
-        admin_inst_mock.get_user_keys.return_value = {
-            'access_key': 'access_key',
-            'secret_key': 'secret_key'
-        }
-        ganesha.RgwClient.admin_instance.return_value = admin_inst_mock
-
-        conf = GaneshaConf.instance(cluster_id)
-        conf.update_export({
-            'export_id': 2,
-            'daemons': expected_exports[2],
-            'path': 'bucket',
-            'pseudo': '/rgw/bucket',
-            'cluster_id': cluster_id,
-            'tag': 'bucket_tag',
-            'access_type': 'RW',
-            'squash': 'all_squash',
-            'security_label': False,
-            'protocols': [4, 3],
-            'transports': ['TCP', 'UDP'],
-            'clients': [{
-                'addresses': ["192.168.0.0/16"],
-                'access_type': None,
-                'squash': None
-            }],
-            'fsal': {
-                'name': 'RGW',
-                'rgw_user_id': 'testuser'
-            }
-        })
-
-        conf = GaneshaConf.instance(cluster_id)
-        export = conf.get_export(2)
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "bucket")
-        self.assertEqual(export.pseudo, "/rgw/bucket")
-        self.assertEqual(export.tag, "bucket_tag")
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key")
-        self.assertEqual(export.fsal.secret_key, "secret_key")
-        self.assertEqual(len(export.clients), 1)
-        self.assertEqual(export.clients[0].addresses, ["192.168.0.0/16"])
-        self.assertIsNone(export.clients[0].squash)
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.daemons, set(expected_exports[2]))
-        self.assertEqual(export.cluster_id, cluster_id)
-
-    def test_remove_export(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_remove_export(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_remove_export(self, cluster_id, expected_exports):
-        conf = GaneshaConf.instance(cluster_id)
-        conf.remove_export(1)
-        exports = conf.list_exports()
-        self.assertEqual(len(exports), 1)
-        self.assertEqual(2, exports[0].export_id)
-        export = conf.get_export(2)
-        self.assertEqual(export.export_id, 2)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/rgw")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key")
-        self.assertEqual(export.fsal.secret_key, "secret_key")
-        self.assertEqual(len(export.clients), 0)
-        self.assertEqual(export.daemons, set(expected_exports[2]))
-        self.assertEqual(export.cluster_id, cluster_id)
-
-    def test_create_export_rgw(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_create_export_rgw(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_create_export_rgw(self, cluster_id, expected_exports):
-        ganesha.RgwClient = MagicMock()
-        admin_inst_mock = MagicMock()
-        admin_inst_mock.get_user_keys.return_value = {
-            'access_key': 'access_key2',
-            'secret_key': 'secret_key2'
-        }
-        ganesha.RgwClient.admin_instance.return_value = admin_inst_mock
-
-        conf = GaneshaConf.instance(cluster_id)
-        ex_id = conf.create_export({
-            'daemons': expected_exports[3],
-            'path': 'bucket',
-            'pseudo': '/rgw/bucket',
-            'tag': 'bucket_tag',
-            'cluster_id': cluster_id,
-            'access_type': 'RW',
-            'squash': 'all_squash',
-            'security_label': False,
-            'protocols': [4, 3],
-            'transports': ['TCP', 'UDP'],
-            'clients': [{
-                'addresses': ["192.168.0.0/16"],
-                'access_type': None,
-                'squash': None
-            }],
-            'fsal': {
-                'name': 'RGW',
-                'rgw_user_id': 'testuser'
-            }
-        })
-
-        conf = GaneshaConf.instance(cluster_id)
-        exports = conf.list_exports()
-        self.assertEqual(len(exports), 3)
-        export = conf.get_export(ex_id)
-        self.assertEqual(export.export_id, ex_id)
-        self.assertEqual(export.path, "bucket")
-        self.assertEqual(export.pseudo, "/rgw/bucket")
-        self.assertEqual(export.tag, "bucket_tag")
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4, 3})
-        self.assertEqual(export.transports, {"TCP", "UDP"})
-        self.assertEqual(export.fsal.name, "RGW")
-        self.assertEqual(export.fsal.rgw_user_id, "testuser")
-        self.assertEqual(export.fsal.access_key, "access_key2")
-        self.assertEqual(export.fsal.secret_key, "secret_key2")
-        self.assertEqual(len(export.clients), 1)
-        self.assertEqual(export.clients[0].addresses, ["192.168.0.0/16"])
-        self.assertIsNone(export.clients[0].squash)
-        self.assertIsNone(export.clients[0].access_type)
-        self.assertEqual(export.daemons, set(expected_exports[3]))
-        self.assertEqual(export.cluster_id, cluster_id)
-
-    def test_create_export_cephfs(self):
-        for cluster_id, info in self.clusters.items():
-            self._do_test_create_export_cephfs(cluster_id, info['exports'])
-            self._reset_temp_store()
-
-    def _do_test_create_export_cephfs(self, cluster_id, expected_exports):
-        ganesha.CephX = MagicMock()
-        ganesha.CephX.list_clients.return_value = ["fs"]
-        ganesha.CephX.get_client_key.return_value = "fs_key"
-
-        ganesha.CephFS = MagicMock()
-        ganesha.CephFS.dir_exists.return_value = True
-
-        conf = GaneshaConf.instance(cluster_id)
-        ex_id = conf.create_export({
-            'daemons': expected_exports[3],
-            'path': '/',
-            'pseudo': '/cephfs2',
-            'cluster_id': cluster_id,
-            'tag': None,
-            'access_type': 'RW',
-            'squash': 'all_squash',
-            'security_label': True,
-            'protocols': [4],
-            'transports': ['TCP'],
-            'clients': [],
-            'fsal': {
-                'name': 'CEPH',
-                'user_id': 'fs',
-                'fs_name': None,
-                'sec_label_xattr': 'security.selinux'
-            }
-        })
-
-        conf = GaneshaConf.instance(cluster_id)
-        exports = conf.list_exports()
-        self.assertEqual(len(exports), 3)
-        export = conf.get_export(ex_id)
-        self.assertEqual(export.export_id, ex_id)
-        self.assertEqual(export.path, "/")
-        self.assertEqual(export.pseudo, "/cephfs2")
-        self.assertIsNone(export.tag)
-        self.assertEqual(export.access_type, "RW")
-        self.assertEqual(export.squash, "all_squash")
-        self.assertEqual(export.protocols, {4})
-        self.assertEqual(export.transports, {"TCP"})
-        self.assertEqual(export.fsal.name, "CEPH")
-        self.assertEqual(export.fsal.user_id, "fs")
-        self.assertEqual(export.fsal.cephx_key, "fs_key")
-        self.assertEqual(export.fsal.sec_label_xattr, "security.selinux")
-        self.assertIsNone(export.fsal.fs_name)
-        self.assertEqual(len(export.clients), 0)
-        self.assertEqual(export.daemons, set(expected_exports[3]))
-        self.assertEqual(export.cluster_id, cluster_id)
-        self.assertEqual(export.attr_expiration_time, 0)
-        self.assertEqual(export.security_label, True)
-
-    def test_reload_daemons(self):
-        # Fail to import call in Python 3.8, see https://bugs.python.org/issue35753
-        mock_call = unittest.mock.call
-
-        # Orchestrator cluster: reload all daemon config objects.
-        conf = GaneshaConf.instance('foo')
-        calls = [mock_call(conf) for conf in conf.list_daemon_confs()]
-        for daemons in [[], ['a', 'b']]:
-            conf.reload_daemons(daemons)
-            self.io_mock.notify.assert_has_calls(calls)
-            self.io_mock.reset_mock()
-
-        # User-defined cluster: reload daemons in the parameter
-        self._set_user_defined_clusters_location()
-        conf = GaneshaConf.instance('_default_')
-        calls = [mock_call('conf-{}'.format(daemon)) for daemon in ['nodea', 'nodeb']]
-        conf.reload_daemons(['nodea', 'nodeb'])
-        self.io_mock.notify.assert_has_calls(calls)
-
-    def test_list_daemons(self):
-        for cluster_id, info in self.clusters.items():
-            instance = GaneshaConf.instance(cluster_id)
-            daemons = instance.list_daemons()
-            for daemon in daemons:
-                self.assertEqual(daemon['cluster_id'], cluster_id)
-                self.assertEqual(daemon['cluster_type'], info['type'])
-                self.assertIn('daemon_id', daemon)
-                self.assertIn('status', daemon)
-                self.assertIn('status_desc', daemon)
-            self.assertEqual([daemon['daemon_id'] for daemon in daemons], info['daemons'])
-
-    def test_validate_orchestrator(self):
-        cluster_id = 'foo'
-        cluster_info = self.clusters[cluster_id]
-        instance = GaneshaConf.instance(cluster_id)
-        export = MagicMock()
-
-        # export can be linked to none or all daemons
-        export_daemons = [[], cluster_info['daemons']]
-        for daemons in export_daemons:
-            export.daemons = daemons
-            instance.validate(export)
-
-        # raise if linking to partial or non-exist daemons
-        export_daemons = [cluster_info['daemons'][:1], 'xxx']
-        for daemons in export_daemons:
-            with self.assertRaises(NFSException):
-                export.daemons = daemons
-                instance.validate(export)
-
-    def test_validate_user(self):
-        self._set_user_defined_clusters_location()
-        cluster_id = '_default_'
-        instance = GaneshaConf.instance(cluster_id)
-        export = MagicMock()
-
-        # export can be linked to none, partial, or all daemons
-        fake_daemons = ['nodea', 'nodeb']
-        export_daemons = [[], fake_daemons[:1], fake_daemons]
-        for daemons in export_daemons:
-            export.daemons = daemons
-            instance.validate(export)
-
-        # raise if linking to non-exist daemons
-        export_daemons = ['xxx']
-        for daemons in export_daemons:
-            with self.assertRaises(NFSException):
-                export.daemons = daemons
-                instance.validate(export)
-
-    def _verify_locations(self, locations, cluster_ids):
-        for cluster_id in cluster_ids:
-            self.assertIn(cluster_id, locations)
-            cluster = locations.pop(cluster_id)
-            self.assertDictEqual(cluster, {key: cluster[key] for key in [
-                'pool', 'namespace', 'type', 'daemon_conf']})
-        self.assertDictEqual(locations, {})
-
-    def test_get_cluster_locations(self):
-        # pylint: disable=protected-access
-
-        # There is only a Orchestrator cluster.
-        self._mock_orchestrator(True)
-        locations = ganesha.Ganesha._get_clusters_locations()
-        self._verify_locations(locations, ['foo'])
-
-        # No cluster.
-        self._mock_orchestrator(False)
-        with self.assertRaises(NFSException):
-            ganesha.Ganesha._get_clusters_locations()
-
-        # There is only a user-defined cluster.
-        self._set_user_defined_clusters_location()
-        self._mock_orchestrator(False)
-        locations = ganesha.Ganesha._get_clusters_locations()
-        self._verify_locations(locations, ['_default_'])
-
-        # There are both Orchestrator cluster and user-defined cluster.
-        self._set_user_defined_clusters_location()
-        self._mock_orchestrator(True)
-        locations = ganesha.Ganesha._get_clusters_locations()
-        self._verify_locations(locations, ['foo', '_default_'])
-
-    def test_get_cluster_locations_conflict(self):
-        # pylint: disable=protected-access
-
-        # Pool/namespace collision.
-        self._set_user_defined_clusters_location('ganesha2/ns2')
-        with self.assertRaises(NFSException) as ctx:
-            ganesha.Ganesha._get_clusters_locations()
-        self.assertIn('already in use', str(ctx.exception))
-
-        # Cluster name collision with orch. cluster.
-        self._set_user_defined_clusters_location('foo:ganesha/ns')
-        with self.assertRaises(NFSException) as ctx:
-            ganesha.Ganesha._get_clusters_locations()
-        self.assertIn('Detected a conflicting NFS-Ganesha cluster', str(ctx.exception))
-
-        # Cluster name collision with user-defined cluster.
-        self._set_user_defined_clusters_location('cluster1:ganesha/ns,cluster1:fake-pool/fake-ns')
-        with self.assertRaises(NFSException) as ctx:
-            ganesha.Ganesha._get_clusters_locations()
-        self.assertIn('Duplicate Ganesha cluster definition', str(ctx.exception))
-
-
-class NFSGaneshaUiControllerTest(ControllerTestCase):
-    @classmethod
-    def setup_server(cls):
-        # pylint: disable=protected-access
-        NFSGaneshaUi._cp_config['tools.authenticate.on'] = False
-        cls.setup_controllers([NFSGaneshaUi])
-
-    @classmethod
-    def _create_ls_dir_url(cls, fs_name, query_params):
-        api_url = '/ui-api/nfs-ganesha/lsdir/{}'.format(fs_name)
-        if query_params is not None:
-            return '{}?{}'.format(api_url, urlencode(query_params))
-        return api_url
-
-    @patch('dashboard.controllers.nfsganesha.CephFS')
-    def test_lsdir(self, cephfs_class):
-        cephfs_class.return_value.ls_dir.return_value = [
-            {'path': '/foo'},
-            {'path': '/foo/bar'}
-        ]
-        mocked_ls_dir = cephfs_class.return_value.ls_dir
-
-        reqs = [
-            {
-                'params': None,
-                'cephfs_ls_dir_args': ['/', 1],
-                'path0': '/',
-                'status': 200
-            },
-            {
-                'params': {'root_dir': '/', 'depth': '1'},
-                'cephfs_ls_dir_args': ['/', 1],
-                'path0': '/',
-                'status': 200
-            },
-            {
-                'params': {'root_dir': '', 'depth': '1'},
-                'cephfs_ls_dir_args': ['/', 1],
-                'path0': '/',
-                'status': 200
-            },
-            {
-                'params': {'root_dir': '/foo', 'depth': '3'},
-                'cephfs_ls_dir_args': ['/foo', 3],
-                'path0': '/foo',
-                'status': 200
-            },
-            {
-                'params': {'root_dir': 'foo', 'depth': '6'},
-                'cephfs_ls_dir_args': ['/foo', 5],
-                'path0': '/foo',
-                'status': 200
-            },
-            {
-                'params': {'root_dir': '/', 'depth': '-1'},
-                'status': 400
-            },
-            {
-                'params': {'root_dir': '/', 'depth': 'abc'},
-                'status': 400
-            }
-        ]
-
-        for req in reqs:
-            self._get(self._create_ls_dir_url('a', req['params']))
-            self.assertStatus(req['status'])
-
-            # Returned paths should contain root_dir as first element
-            if req['status'] == 200:
-                paths = self.json_body()['paths']
-                self.assertEqual(paths[0], req['path0'])
-                cephfs_class.assert_called_once_with('a')
-
-            # Check the arguments passed to `CephFS.ls_dir`.
-            if req.get('cephfs_ls_dir_args'):
-                mocked_ls_dir.assert_called_once_with(*req['cephfs_ls_dir_args'])
-            else:
-                mocked_ls_dir.assert_not_called()
-            mocked_ls_dir.reset_mock()
-            cephfs_class.reset_mock()
-
-    @patch('dashboard.controllers.nfsganesha.cephfs')
-    @patch('dashboard.controllers.nfsganesha.CephFS')
-    def test_lsdir_non_existed_dir(self, cephfs_class, cephfs):
-        cephfs.ObjectNotFound = Exception
-        cephfs.PermissionError = Exception
-        cephfs_class.return_value.ls_dir.side_effect = cephfs.ObjectNotFound()
-        self._get(self._create_ls_dir_url('a', {'root_dir': '/foo', 'depth': '3'}))
-        cephfs_class.assert_called_once_with('a')
-        cephfs_class.return_value.ls_dir.assert_called_once_with('/foo', 3)
-        self.assertStatus(200)
-        self.assertJsonBody({'paths': []})
index d9b15e8231e5b0006b9b91c0ce6b5b201ef22fda..f54219c9f132c0cc6a5bde185b70a8ab9e7129d0 100644 (file)
@@ -11,14 +11,12 @@ from requests import RequestException
 from ..controllers.grafana import Grafana
 from ..grafana import GrafanaRestClient
 from ..settings import Settings
-from . import ControllerTestCase, KVStoreMockMixin  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase, KVStoreMockMixin
 
 
 class GrafanaTest(ControllerTestCase, KVStoreMockMixin):
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-        Grafana._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Grafana])
 
     def setUp(self):
index 1b1b6b7063902f04a571bdc715e7320bf6e63dd5..0b788626048df87c8f4a001370de49b17b1a70c7 100644 (file)
@@ -10,7 +10,7 @@ except ImportError:
 
 from .. import mgr
 from ..controllers.home import HomeController, LanguageMixin
-from . import ControllerTestCase, FakeFsMixin  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase, FakeFsMixin
 
 logger = logging.getLogger()
 
index 6d719a0fc92218052c64f36e9a1927ef5da95932..07915aee29b21fd8e767db594a41e81bde45eacc 100644 (file)
@@ -6,18 +6,20 @@ from unittest import mock
 from orchestrator import HostSpec, InventoryHost
 
 from .. import mgr
+from ..controllers._version import APIVersion
 from ..controllers.host import Host, HostUi, get_device_osd_map, get_hosts, get_inventories
+from ..tests import ControllerTestCase
 from ..tools import NotificationQueue, TaskManager
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
 
 
 @contextlib.contextmanager
-def patch_orch(available: bool, hosts: Optional[List[HostSpec]] = None,
+def patch_orch(available: bool, missing_features: Optional[List[str]] = None,
+               hosts: Optional[List[HostSpec]] = None,
                inventory: Optional[List[dict]] = None):
     with mock.patch('dashboard.controllers.orchestrator.OrchClient.instance') as instance:
         fake_client = mock.Mock()
         fake_client.available.return_value = available
-        fake_client.get_missing_features.return_value = []
+        fake_client.get_missing_features.return_value = missing_features
 
         if hosts is not None:
             fake_client.hosts.list.return_value = hosts
@@ -42,8 +44,6 @@ class HostControllerTest(ControllerTestCase):
     def setup_server(cls):
         NotificationQueue.start_queue()
         TaskManager.init()
-        # pylint: disable=protected-access
-        Host._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Host])
 
     @classmethod
@@ -51,7 +51,7 @@ class HostControllerTest(ControllerTestCase):
         NotificationQueue.stop()
 
     @mock.patch('dashboard.controllers.host.get_hosts')
-    def test_host_list(self, mock_get_hosts):
+    def test_host_list_with_sources(self, mock_get_hosts):
         hosts = [{
             'hostname': 'host-0',
             'sources': {
@@ -72,33 +72,116 @@ class HostControllerTest(ControllerTestCase):
             }
         }]
 
-        def _get_hosts(from_ceph=True, from_orchestrator=True):
-            _hosts = []
-            if from_ceph:
-                _hosts.append(hosts[0])
-            if from_orchestrator:
-                _hosts.append(hosts[1])
-                _hosts.append(hosts[2])
-            return _hosts
+        def _get_hosts(sources=None):
+            if sources == 'ceph':
+                return hosts[0]
+            if sources == 'orchestrator':
+                return hosts[1:]
+            if sources == 'ceph, orchestrator':
+                return hosts[2]
+            return hosts
 
         mock_get_hosts.side_effect = _get_hosts
 
-        self._get(self.URL_HOST)
+        self._get(self.URL_HOST, version=APIVersion(1, 1))
         self.assertStatus(200)
         self.assertJsonBody(hosts)
 
-        self._get('{}?sources=ceph'.format(self.URL_HOST))
+        self._get('{}?sources=ceph'.format(self.URL_HOST), version=APIVersion(1, 1))
         self.assertStatus(200)
-        self.assertJsonBody([hosts[0]])
+        self.assertJsonBody(hosts[0])
 
-        self._get('{}?sources=orchestrator'.format(self.URL_HOST))
+        self._get('{}?sources=orchestrator'.format(self.URL_HOST), version=APIVersion(1, 1))
         self.assertStatus(200)
         self.assertJsonBody(hosts[1:])
 
-        self._get('{}?sources=ceph,orchestrator'.format(self.URL_HOST))
+        self._get('{}?sources=ceph,orchestrator'.format(self.URL_HOST), version=APIVersion(1, 1))
         self.assertStatus(200)
         self.assertJsonBody(hosts)
 
+    @mock.patch('dashboard.controllers.host.get_hosts')
+    def test_host_list_with_facts(self, mock_get_hosts):
+        hosts_without_facts = [{
+            'hostname': 'host-0',
+            'sources': {
+                'ceph': True,
+                'orchestrator': False
+            }
+        }, {
+            'hostname': 'host-1',
+            'sources': {
+                'ceph': False,
+                'orchestrator': True
+            }
+        }]
+
+        hosts_facts = [{
+            'hostname': 'host-0',
+            'cpu_count': 1,
+            'memory_total_kb': 1024
+        }, {
+            'hostname': 'host-1',
+            'cpu_count': 2,
+            'memory_total_kb': 1024
+        }]
+
+        hosts_with_facts = [{
+            'hostname': 'host-0',
+            'sources': {
+                'ceph': True,
+                'orchestrator': False
+            },
+            'cpu_count': 1,
+            'memory_total_kb': 1024
+        }, {
+            'hostname': 'host-1',
+            'sources': {
+                'ceph': False,
+                'orchestrator': True
+            },
+            'cpu_count': 2,
+            'memory_total_kb': 1024
+        }]
+        # test with orchestrator available
+        with patch_orch(True, hosts=hosts_without_facts) as fake_client:
+            mock_get_hosts.return_value = hosts_without_facts
+            fake_client.hosts.get_facts.return_value = hosts_facts
+            # test with ?facts=true
+            self._get('{}?facts=true'.format(self.URL_HOST), version=APIVersion(1, 1))
+            self.assertStatus(200)
+            self.assertHeader('Content-Type',
+                              'application/vnd.ceph.api.v1.1+json')
+            self.assertJsonBody(hosts_with_facts)
+
+            # test with ?facts=false
+            self._get('{}?facts=false'.format(self.URL_HOST), version=APIVersion(1, 1))
+            self.assertStatus(200)
+            self.assertHeader('Content-Type',
+                              'application/vnd.ceph.api.v1.1+json')
+            self.assertJsonBody(hosts_without_facts)
+
+        # test with orchestrator available but orch backend!=cephadm
+        with patch_orch(True, missing_features=['get_facts']) as fake_client:
+            mock_get_hosts.return_value = hosts_without_facts
+            # test with ?facts=true
+            self._get('{}?facts=true'.format(self.URL_HOST), version=APIVersion(1, 1))
+            self.assertStatus(400)
+
+        # test with no orchestrator available
+        with patch_orch(False):
+            mock_get_hosts.return_value = hosts_without_facts
+
+            # test with ?facts=true
+            self._get('{}?facts=true'.format(self.URL_HOST), version=APIVersion(1, 1))
+            self.assertStatus(400)
+
+            # test with ?facts=false
+            self._get('{}?facts=false'.format(self.URL_HOST), version=APIVersion(1, 1))
+            self.assertStatus(200)
+            self.assertHeader('Content-Type',
+                              'application/vnd.ceph.api.v1.1+json')
+            self.assertJsonBody(hosts_without_facts)
+
     def test_get_1(self):
         mgr.list_servers.return_value = []
 
@@ -135,7 +218,7 @@ class HostControllerTest(ControllerTestCase):
                 'labels': 'mon',
                 'status': 'maintenance'
             }
-            self._post(self.URL_HOST, payload, version='0.1')
+            self._post(self.URL_HOST, payload, version=APIVersion(0, 1))
             self.assertStatus(201)
             mock_add_host.assert_called()
 
@@ -149,7 +232,7 @@ class HostControllerTest(ControllerTestCase):
             fake_client.hosts.add_label = mock.Mock()
 
             payload = {'update_labels': True, 'labels': ['bbb', 'ccc']}
-            self._put('{}/node0'.format(self.URL_HOST), payload, version='0.1')
+            self._put('{}/node0'.format(self.URL_HOST), payload, version=APIVersion(0, 1))
             self.assertStatus(200)
             self.assertHeader('Content-Type',
                               'application/vnd.ceph.api.v0.1+json')
@@ -157,8 +240,9 @@ class HostControllerTest(ControllerTestCase):
             fake_client.hosts.add_label.assert_called_once_with('node0', 'ccc')
 
             # return 400 if type other than List[str]
-            self._put('{}/node0'.format(self.URL_HOST), {'update_labels': True,
-                                                         'labels': 'ddd'}, version='0.1')
+            self._put('{}/node0'.format(self.URL_HOST),
+                      {'update_labels': True, 'labels': 'ddd'},
+                      version=APIVersion(0, 1))
             self.assertStatus(400)
 
     def test_host_maintenance(self):
@@ -169,25 +253,29 @@ class HostControllerTest(ControllerTestCase):
         ]
         with patch_orch(True, hosts=orch_hosts):
             # enter maintenance mode
-            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True}, version='0.1')
+            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True},
+                      version=APIVersion(0, 1))
             self.assertStatus(200)
             self.assertHeader('Content-Type',
                               'application/vnd.ceph.api.v0.1+json')
 
             # force enter maintenance mode
             self._put('{}/node1'.format(self.URL_HOST), {'maintenance': True, 'force': True},
-                      version='0.1')
+                      version=APIVersion(0, 1))
             self.assertStatus(200)
 
             # exit maintenance mode
-            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True}, version='0.1')
+            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True},
+                      version=APIVersion(0, 1))
             self.assertStatus(200)
-            self._put('{}/node1'.format(self.URL_HOST), {'maintenance': True}, version='0.1')
+            self._put('{}/node1'.format(self.URL_HOST), {'maintenance': True},
+                      version=APIVersion(0, 1))
             self.assertStatus(200)
 
         # maintenance without orchestrator service
         with patch_orch(False):
-            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True}, version='0.1')
+            self._put('{}/node0'.format(self.URL_HOST), {'maintenance': True},
+                      version=APIVersion(0, 1))
             self.assertStatus(503)
 
     @mock.patch('dashboard.controllers.host.time')
@@ -250,8 +338,6 @@ class HostUiControllerTest(ControllerTestCase):
 
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-        HostUi._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([HostUi])
 
     def test_labels(self):
index 4060c6c4a044cc4c752e7fa60e417b1e47445c02..7728a496b9ebbf14cbf879f1e2b50a041042f8c9 100644 (file)
@@ -17,11 +17,8 @@ from ..controllers.iscsi import Iscsi, IscsiTarget
 from ..rest_client import RequestException
 from ..services.iscsi_client import IscsiClient
 from ..services.orchestrator import OrchClient
+from ..tests import CLICommandTestMixin, CmdException, ControllerTestCase, KVStoreMockMixin
 from ..tools import NotificationQueue, TaskManager
-from . import CLICommandTestMixin  # pylint: disable=no-name-in-module
-from . import CmdException  # pylint: disable=no-name-in-module
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
-from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
 
 
 class IscsiTestCli(unittest.TestCase, CLICommandTestMixin):
@@ -84,9 +81,6 @@ class IscsiTestController(ControllerTestCase, KVStoreMockMixin):
         TaskManager.init()
         OrchClient.instance().available = lambda: False
         mgr.rados.side_effect = None
-        # pylint: disable=protected-access
-        Iscsi._cp_config['tools.authenticate.on'] = False
-        IscsiTarget._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Iscsi, IscsiTarget])
 
     @classmethod
diff --git a/ceph/src/pybind/mgr/dashboard/tests/test_nfs.py b/ceph/src/pybind/mgr/dashboard/tests/test_nfs.py
new file mode 100644 (file)
index 0000000..087ca18
--- /dev/null
@@ -0,0 +1,229 @@
+# -*- coding: utf-8 -*-
+# pylint: disable=too-many-lines
+from copy import deepcopy
+from unittest.mock import Mock, patch
+from urllib.parse import urlencode
+
+from .. import mgr
+from ..controllers._version import APIVersion
+from ..controllers.nfs import NFSGaneshaExports, NFSGaneshaUi
+from ..tests import ControllerTestCase
+from ..tools import NotificationQueue, TaskManager
+
+
+class NFSGaneshaExportsTest(ControllerTestCase):
+    _nfs_module_export = {
+        "export_id": 1,
+        "path": "bk1",
+        "cluster_id": "myc",
+        "pseudo": "/bk-ps",
+        "access_type": "RO",
+        "squash": "root_id_squash",
+        "security_label": False,
+        "protocols": [
+            4
+        ],
+        "transports": [
+            "TCP",
+            "UDP"
+        ],
+        "fsal": {
+            "name": "RGW",
+            "user_id": "dashboard",
+            "access_key_id": "UUU5YVVOQ2P5QTOPYNAN",
+            "secret_access_key": "7z87tMUUsHr67ZWx12pCbWkp9UyOldxhDuPY8tVN"
+        },
+        "clients": []
+    }
+
+    @classmethod
+    def setUpClass(cls):
+        super().setUpClass()
+        cls._expected_export = deepcopy(cls._nfs_module_export)
+        del cls._expected_export['fsal']['access_key_id']
+        del cls._expected_export['fsal']['secret_access_key']
+
+    @classmethod
+    def tearDownClass(cls):
+        super().tearDownClass()
+        NotificationQueue.stop()
+
+    @classmethod
+    def setup_server(cls):
+        NotificationQueue.start_queue()
+        TaskManager.init()
+        cls.setup_controllers([NFSGaneshaExports])
+
+    def test_list_exports(self):
+        mgr.remote = Mock(return_value=[self._nfs_module_export])
+
+        self._get('/api/nfs-ganesha/export')
+        self.assertStatus(200)
+        self.assertJsonBody([self._expected_export])
+
+    def test_get_export(self):
+        mgr.remote = Mock(return_value=self._nfs_module_export)
+
+        self._get('/api/nfs-ganesha/export/myc/1')
+        self.assertStatus(200)
+        self.assertJsonBody(self._expected_export)
+
+    def test_create_export(self):
+        export_mgr = Mock()
+        created_nfs_export = deepcopy(self._nfs_module_export)
+        created_nfs_export['pseudo'] = 'new-pseudo'
+        created_nfs_export['export_id'] = 2
+        export_mgr.get_export_by_pseudo.side_effect = [None, created_nfs_export]
+        export_mgr.apply_export.return_value = (0, '', '')
+        mgr.remote.return_value = export_mgr
+
+        export_create_body = deepcopy(self._expected_export)
+        del export_create_body['export_id']
+        export_create_body['pseudo'] = created_nfs_export['pseudo']
+
+        self._post('/api/nfs-ganesha/export',
+                   export_create_body,
+                   version=APIVersion(2, 0))
+        self.assertStatus(201)
+        expected_body = export_create_body
+        expected_body['export_id'] = created_nfs_export['export_id']
+        self.assertJsonBody(export_create_body)
+
+    def test_create_export_with_existing_pseudo_fails(self):
+        export_mgr = Mock()
+        export_mgr.get_export_by_pseudo.return_value = self._nfs_module_export
+        mgr.remote.return_value = export_mgr
+
+        export_create_body = deepcopy(self._expected_export)
+        del export_create_body['export_id']
+
+        self._post('/api/nfs-ganesha/export',
+                   export_create_body,
+                   version=APIVersion(2, 0))
+        self.assertStatus(400)
+        response = self.json_body()
+        self.assertIn(f'Pseudo {export_create_body["pseudo"]} is already in use',
+                      response['detail'])
+
+    def test_set_export(self):
+        export_mgr = Mock()
+        updated_nfs_export = deepcopy(self._nfs_module_export)
+        updated_nfs_export['pseudo'] = 'updated-pseudo'
+        export_mgr.get_export_by_pseudo.return_value = updated_nfs_export
+        export_mgr.apply_export.return_value = (0, '', '')
+        mgr.remote.return_value = export_mgr
+
+        updated_export_body = deepcopy(self._expected_export)
+        updated_export_body['pseudo'] = updated_nfs_export['pseudo']
+
+        self._put('/api/nfs-ganesha/export/myc/2',
+                  updated_export_body,
+                  version=APIVersion(2, 0))
+        self.assertStatus(200)
+        self.assertJsonBody(updated_export_body)
+
+    def test_delete_export(self):
+        mgr.remote = Mock(side_effect=[self._nfs_module_export, None])
+
+        self._delete('/api/nfs-ganesha/export/myc/2',
+                     version=APIVersion(2, 0))
+        self.assertStatus(204)
+
+    def test_delete_export_not_found(self):
+        mgr.remote = Mock(return_value=None)
+
+        self._delete('/api/nfs-ganesha/export/myc/3',
+                     version=APIVersion(2, 0))
+        self.assertStatus(404)
+
+
+class NFSGaneshaUiControllerTest(ControllerTestCase):
+    @classmethod
+    def setup_server(cls):
+        cls.setup_controllers([NFSGaneshaUi])
+
+    @classmethod
+    def _create_ls_dir_url(cls, fs_name, query_params):
+        api_url = '/ui-api/nfs-ganesha/lsdir/{}'.format(fs_name)
+        if query_params is not None:
+            return '{}?{}'.format(api_url, urlencode(query_params))
+        return api_url
+
+    @patch('dashboard.controllers.nfs.CephFS')
+    def test_lsdir(self, cephfs_class):
+        cephfs_class.return_value.ls_dir.return_value = [
+            {'path': '/foo'},
+            {'path': '/foo/bar'}
+        ]
+        mocked_ls_dir = cephfs_class.return_value.ls_dir
+
+        reqs = [
+            {
+                'params': None,
+                'cephfs_ls_dir_args': ['/', 1],
+                'path0': '/',
+                'status': 200
+            },
+            {
+                'params': {'root_dir': '/', 'depth': '1'},
+                'cephfs_ls_dir_args': ['/', 1],
+                'path0': '/',
+                'status': 200
+            },
+            {
+                'params': {'root_dir': '', 'depth': '1'},
+                'cephfs_ls_dir_args': ['/', 1],
+                'path0': '/',
+                'status': 200
+            },
+            {
+                'params': {'root_dir': '/foo', 'depth': '3'},
+                'cephfs_ls_dir_args': ['/foo', 3],
+                'path0': '/foo',
+                'status': 200
+            },
+            {
+                'params': {'root_dir': 'foo', 'depth': '6'},
+                'cephfs_ls_dir_args': ['/foo', 5],
+                'path0': '/foo',
+                'status': 200
+            },
+            {
+                'params': {'root_dir': '/', 'depth': '-1'},
+                'status': 400
+            },
+            {
+                'params': {'root_dir': '/', 'depth': 'abc'},
+                'status': 400
+            }
+        ]
+
+        for req in reqs:
+            self._get(self._create_ls_dir_url('a', req['params']))
+            self.assertStatus(req['status'])
+
+            # Returned paths should contain root_dir as first element
+            if req['status'] == 200:
+                paths = self.json_body()['paths']
+                self.assertEqual(paths[0], req['path0'])
+                cephfs_class.assert_called_once_with('a')
+
+            # Check the arguments passed to `CephFS.ls_dir`.
+            if req.get('cephfs_ls_dir_args'):
+                mocked_ls_dir.assert_called_once_with(*req['cephfs_ls_dir_args'])
+            else:
+                mocked_ls_dir.assert_not_called()
+            mocked_ls_dir.reset_mock()
+            cephfs_class.reset_mock()
+
+    @patch('dashboard.controllers.nfs.cephfs')
+    @patch('dashboard.controllers.nfs.CephFS')
+    def test_lsdir_non_existed_dir(self, cephfs_class, cephfs):
+        cephfs.ObjectNotFound = Exception
+        cephfs.PermissionError = Exception
+        cephfs_class.return_value.ls_dir.side_effect = cephfs.ObjectNotFound()
+        self._get(self._create_ls_dir_url('a', {'root_dir': '/foo', 'depth': '3'}))
+        cephfs_class.assert_called_once_with('a')
+        cephfs_class.return_value.ls_dir.assert_called_once_with('/foo', 3)
+        self.assertStatus(200)
+        self.assertJsonBody({'paths': []})
index d9ee85cf3053fd79891537eba7b1db852047d48e..ded06ba50e49327ee8b743429acb4323b6307604 100644 (file)
@@ -6,7 +6,7 @@ from orchestrator import Orchestrator as OrchestratorBase
 
 from ..controllers.orchestrator import Orchestrator
 from ..services.orchestrator import OrchFeature
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 
 class OrchestratorControllerTest(ControllerTestCase):
@@ -15,8 +15,6 @@ class OrchestratorControllerTest(ControllerTestCase):
 
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-        Orchestrator._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Orchestrator])
 
     @mock.patch('dashboard.controllers.orchestrator.OrchClient.instance')
index 669dd63bbf8b64f941e6897e530c594e7c09dd18..790c9b359262cab34c0bea42fd5707e2aef68a6b 100644 (file)
@@ -9,8 +9,8 @@ from ceph.deployment.service_spec import PlacementSpec  # type: ignore
 
 from .. import mgr
 from ..controllers.osd import Osd
+from ..tests import ControllerTestCase
 from ..tools import NotificationQueue, TaskManager
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
 from .helper import update_dict  # pylint: disable=import-error
 
 
@@ -191,7 +191,6 @@ class OsdHelper(object):
 class OsdTest(ControllerTestCase):
     @classmethod
     def setup_server(cls):
-        Osd._cp_config['tools.authenticate.on'] = False  # pylint: disable=protected-access
         cls.setup_controllers([Osd])
         NotificationQueue.start_queue()
         TaskManager.init()
index cb4d1afc21844f53c1c80d081bdba5b3250779b7..572f82a416187df4476cb196b9e95f1b9638c910 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from . import CLICommandTestMixin, ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import CLICommandTestMixin, ControllerTestCase
 
 
 class TestPluginDebug(ControllerTestCase, CLICommandTestMixin):
index d5cdb63e0e5c03e1be3745590d090085d03759a1..02e2b641ca470d5f1a253a90751553289bcba5d6 100644 (file)
@@ -9,8 +9,8 @@ except ImportError:
 
 from ..controllers.pool import Pool
 from ..controllers.task import Task
+from ..tests import ControllerTestCase
 from ..tools import NotificationQueue, TaskManager
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
 
 
 class MockTask(object):
@@ -23,8 +23,6 @@ class MockTask(object):
 class PoolControllerTest(ControllerTestCase):
     @classmethod
     def setup_server(cls):
-        Task._cp_config['tools.authenticate.on'] = False
-        Pool._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Pool, Task])
 
     @mock.patch('dashboard.services.progress.get_progress_tasks')
index 14b2dca9ba2521e2c8bbe5b52c36fb518b300423..cd2fb3e8dd3994ce6a5430b7c70b90d959a18018 100644 (file)
@@ -7,7 +7,7 @@ except ImportError:
 
 from .. import mgr
 from ..controllers.prometheus import Prometheus, PrometheusNotifications, PrometheusReceiver
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 
 class PrometheusControllerTest(ControllerTestCase):
@@ -24,8 +24,6 @@ class PrometheusControllerTest(ControllerTestCase):
             'PROMETHEUS_API_HOST': cls.prometheus_host
         }
         mgr.get_module_option.side_effect = settings.get
-        Prometheus._cp_config['tools.authenticate.on'] = False
-        PrometheusNotifications._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Prometheus, PrometheusNotifications, PrometheusReceiver])
 
     def test_rules(self):
index 9f83bad83e1236ed0601d85cb488bf000ed89100..e064089706a644a1cde5ae5f7bbbd0193d55310b 100644 (file)
@@ -11,7 +11,7 @@ from .. import mgr
 from ..controllers.rbd_mirroring import RbdMirroring, RbdMirroringPoolBootstrap, RbdMirroringSummary
 from ..controllers.summary import Summary
 from ..services import progress
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
 
 mock_list_servers = [{
     'hostname': 'ceph-host',
@@ -51,10 +51,6 @@ class RbdMirroringControllerTest(ControllerTestCase):
 
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-        RbdMirroring._cp_config['tools.authenticate.on'] = False
-        # pylint: enable=protected-access
-
         cls.setup_controllers([RbdMirroring])
 
     @mock.patch('dashboard.controllers.rbd_mirroring.rbd.RBD')
@@ -82,10 +78,6 @@ class RbdMirroringPoolBootstrapControllerTest(ControllerTestCase):
 
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-        RbdMirroringPoolBootstrap._cp_config['tools.authenticate.on'] = False
-        # pylint: enable=protected-access
-
         cls.setup_controllers([RbdMirroringPoolBootstrap])
 
     @mock.patch('dashboard.controllers.rbd_mirroring.rbd.RBD')
@@ -149,11 +141,6 @@ class RbdMirroringSummaryControllerTest(ControllerTestCase):
         progress.get_progress_tasks = mock.MagicMock()
         progress.get_progress_tasks.return_value = ([], [])
 
-        # pylint: disable=protected-access
-        RbdMirroringSummary._cp_config['tools.authenticate.on'] = False
-        Summary._cp_config['tools.authenticate.on'] = False
-        # pylint: enable=protected-access
-
         cls.setup_controllers([RbdMirroringSummary, Summary], '/test')
 
     @mock.patch('dashboard.controllers.rbd_mirroring.rbd.RBD')
index b4abbdea36b97cde32509d8c8532acc597bf4586..b320298515ac5f426eb986a686e9d319761baf78 100644 (file)
@@ -7,14 +7,14 @@ try:
 except ImportError:
     import unittest.mock as mock
 
-from ..controllers import Controller, RESTController, Task
+from ..controllers import RESTController, Router, Task
 from ..controllers.task import Task as TaskController
 from ..services import progress
+from ..tests import ControllerTestCase
 from ..tools import NotificationQueue, TaskManager
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
 
 
-@Controller('/test/task', secure=False)
+@Router('/test/task', secure=False)
 class TaskTest(RESTController):
     sleep_time = 0.0
 
@@ -58,8 +58,6 @@ class TaskControllerTest(ControllerTestCase):
 
         NotificationQueue.start_queue()
         TaskManager.init()
-        TaskTest._cp_config['tools.authenticate.on'] = False
-        TaskController._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([TaskTest, TaskController])
 
     @classmethod
index 2f71489f352252feac33f2202cc81ebdcb792201..0f500a6545cdaa5ded8dce6c62ef8de66b91307f 100644 (file)
@@ -4,13 +4,12 @@ from .. import mgr
 from ..controllers.rgw import Rgw, RgwDaemon, RgwUser
 from ..rest_client import RequestException
 from ..services.rgw_client import RgwClient
-from . import ControllerTestCase, RgwStub  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase, RgwStub
 
 
 class RgwControllerTestCase(ControllerTestCase):
     @classmethod
     def setup_server(cls):
-        Rgw._cp_config['tools.authenticate.on'] = False  # pylint: disable=protected-access
         cls.setup_controllers([Rgw], '/test')
 
     def setUp(self) -> None:
@@ -61,7 +60,6 @@ class RgwControllerTestCase(ControllerTestCase):
 class RgwDaemonControllerTestCase(ControllerTestCase):
     @classmethod
     def setup_server(cls):
-        RgwDaemon._cp_config['tools.authenticate.on'] = False  # pylint: disable=protected-access
         cls.setup_controllers([RgwDaemon], '/test')
 
     @patch('dashboard.services.rgw_client.RgwClient._get_user_id', Mock(
@@ -77,12 +75,14 @@ class RgwDaemonControllerTestCase(ControllerTestCase):
             {
                 'ceph_version': 'ceph version master (dev)',
                 'id': 'daemon1',
+                'realm_name': 'realm1',
                 'zonegroup_name': 'zg1',
                 'zone_name': 'zone1'
             },
             {
                 'ceph_version': 'ceph version master (dev)',
                 'id': 'daemon2',
+                'realm_name': 'realm2',
                 'zonegroup_name': 'zg2',
                 'zone_name': 'zone2'
             }]
@@ -93,6 +93,7 @@ class RgwDaemonControllerTestCase(ControllerTestCase):
             'service_map_id': '4832',
             'version': 'ceph version master (dev)',
             'server_hostname': 'host1',
+            'realm_name': 'realm1',
             'zonegroup_name': 'zg1',
             'zone_name': 'zone1', 'default': True
         },
@@ -101,6 +102,7 @@ class RgwDaemonControllerTestCase(ControllerTestCase):
             'service_map_id': '5356',
             'version': 'ceph version master (dev)',
             'server_hostname': 'host1',
+            'realm_name': 'realm2',
             'zonegroup_name': 'zg2',
             'zone_name': 'zone2',
             'default': False
@@ -116,7 +118,6 @@ class RgwDaemonControllerTestCase(ControllerTestCase):
 class RgwUserControllerTestCase(ControllerTestCase):
     @classmethod
     def setup_server(cls):
-        RgwUser._cp_config['tools.authenticate.on'] = False  # pylint: disable=protected-access
         cls.setup_controllers([RgwUser], '/test')
 
     @patch('dashboard.controllers.rgw.RgwRESTController.proxy')
index f8a8f2f689d2ebab6e274700561015d9b9f01bfe..d23bdec2ca5133927dee6432cd3205a7b802bf50 100644 (file)
@@ -9,7 +9,7 @@ from ..exceptions import DashboardException
 from ..services.rgw_client import NoCredentialsException, \
     NoRgwDaemonsException, RgwClient, _parse_frontend_config
 from ..settings import Settings
-from . import CLICommandTestMixin, RgwStub  # pylint: disable=no-name-in-module
+from ..tests import CLICommandTestMixin, RgwStub
 
 
 @patch('dashboard.services.rgw_client.RgwClient._get_user_id', Mock(
index 6e382b9d40f7d1ccd0c9297fa793da43b84eff4c..e204b566ab50043b83e5c1209cd7d72dc83ddc71 100644 (file)
@@ -9,7 +9,7 @@ from mgr_module import ERROR_MSG_EMPTY_INPUT_FILE
 from .. import settings
 from ..controllers.settings import Settings as SettingsController
 from ..settings import Settings, handle_option_command
-from . import ControllerTestCase, KVStoreMockMixin  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase, KVStoreMockMixin
 
 
 class SettingsTest(unittest.TestCase, KVStoreMockMixin):
@@ -130,9 +130,6 @@ class SettingsTest(unittest.TestCase, KVStoreMockMixin):
 class SettingsControllerTest(ControllerTestCase, KVStoreMockMixin):
     @classmethod
     def setup_server(cls):
-        # pylint: disable=protected-access
-
-        SettingsController._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([SettingsController])
 
     @classmethod
index ab565137a18f98759b7992f719b9689f3935baa1..5594738d173b4d6c08d6807da32bf8cd7441f32e 100644 (file)
@@ -6,7 +6,7 @@ import errno
 import unittest
 
 from ..services.sso import load_sso_db
-from . import CLICommandTestMixin, CmdException  # pylint: disable=no-name-in-module
+from ..tests import CLICommandTestMixin, CmdException
 
 
 class AccessControlTest(unittest.TestCase, CLICommandTestMixin):
index c9cd11bafc8333b457284f8827f00ba23e0aa00f..eaae3e2959e0c7374b3c38c8f9b3113c9dad0248 100644 (file)
@@ -11,15 +11,16 @@ try:
 except ImportError:
     from unittest.mock import patch
 
-from .. import DEFAULT_VERSION
-from ..controllers import ApiController, BaseController, Controller, Proxy, RESTController
+from ..controllers import APIRouter, BaseController, Proxy, RESTController, Router
+from ..controllers._version import APIVersion
 from ..services.exception import handle_rados_error
-from ..tools import dict_contains_path, dict_get, json_str_to_object, partial_dict
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..tests import ControllerTestCase
+from ..tools import dict_contains_path, dict_get, json_str_to_object, \
+    merge_list_of_dicts_by_key, partial_dict
 
 
 # pylint: disable=W0613
-@Controller('/foo', secure=False)
+@Router('/foo', secure=False)
 class FooResource(RESTController):
     elems = []
 
@@ -44,20 +45,20 @@ class FooResource(RESTController):
         return dict(key=key, newdata=newdata)
 
 
-@Controller('/foo/:key/:method', secure=False)
+@Router('/foo/:key/:method', secure=False)
 class FooResourceDetail(RESTController):
     def list(self, key, method):
         return {'detail': (key, [method])}
 
 
-@ApiController('/rgw/proxy', secure=False)
+@APIRouter('/rgw/proxy', secure=False)
 class GenerateControllerRoutesController(BaseController):
     @Proxy()
     def __call__(self, path, **params):
         pass
 
 
-@ApiController('/fooargs', secure=False)
+@APIRouter('/fooargs', secure=False)
 class FooArgs(RESTController):
     def set(self, code, name=None, opt1=None, opt2=None):
         return {'code': code, 'name': name, 'opt1': opt1, 'opt2': opt2}
@@ -87,8 +88,7 @@ class RESTControllerTest(ControllerTestCase):
         self.assertStatus(204)
         self._get("/foo")
         self.assertStatus('200 OK')
-        self.assertHeader('Content-Type',
-                          'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION))
+        self.assertHeader('Content-Type', APIVersion.DEFAULT.to_mime_type())
         self.assertBody('[]')
 
     def test_fill(self):
@@ -99,19 +99,16 @@ class RESTControllerTest(ControllerTestCase):
                 self._post("/foo", data)
                 self.assertJsonBody(data)
                 self.assertStatus(201)
-                self.assertHeader('Content-Type',
-                                  'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION))
+                self.assertHeader('Content-Type', APIVersion.DEFAULT.to_mime_type())
 
             self._get("/foo")
             self.assertStatus('200 OK')
-            self.assertHeader('Content-Type',
-                              'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION))
+            self.assertHeader('Content-Type', APIVersion.DEFAULT.to_mime_type())
             self.assertJsonBody([data] * 5)
 
             self._put('/foo/0', {'newdata': 'newdata'})
             self.assertStatus('200 OK')
-            self.assertHeader('Content-Type',
-                              'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION))
+            self.assertHeader('Content-Type', APIVersion.DEFAULT.to_mime_type())
             self.assertJsonBody({'newdata': 'newdata', 'key': '0'})
 
     def test_not_implemented(self):
@@ -202,3 +199,13 @@ class TestFunctions(unittest.TestCase):
         self.assertFalse(dict_get({'foo': {'bar': False}}, 'foo.bar'))
         self.assertIsNone(dict_get({'foo': {'bar': False}}, 'foo.bar.baz'))
         self.assertEqual(dict_get({'foo': {'bar': False}, 'baz': 'xyz'}, 'baz'), 'xyz')
+
+    def test_merge_list_of_dicts_by_key(self):
+        expected_result = [{'a': 1, 'b': 2, 'c': 3}, {'a': 4, 'b': 5, 'c': 6}]
+        self.assertEqual(expected_result, merge_list_of_dicts_by_key(
+            [{'a': 1, 'b': 2}, {'a': 4, 'b': 5}], [{'a': 1, 'c': 3}, {'a': 4, 'c': 6}], 'a'))
+
+        expected_result = [{'a': 1, 'b': 2}, {'a': 4, 'b': 5, 'c': 6}]
+        self.assertEqual(expected_result, merge_list_of_dicts_by_key(
+            [{'a': 1, 'b': 2}, {'a': 4, 'b': 5}], [{}, {'a': 4, 'c': 6}], 'a'))
+        self.assertRaises(TypeError, merge_list_of_dicts_by_key, None)
index 666b388bf28844731b3f61c021b2f345be6d532f..0a77a299e98d53b1b5c8ffb9fe7e3d97db2d0623 100644 (file)
@@ -3,26 +3,32 @@ from __future__ import absolute_import
 
 import unittest
 
-from ..controllers import ApiController, RESTController
-from . import ControllerTestCase  # pylint: disable=no-name-in-module
+from ..controllers._api_router import APIRouter
+from ..controllers._rest_controller import RESTController
+from ..controllers._version import APIVersion
+from ..tests import ControllerTestCase
 
 
-@ApiController("/vtest", secure=False)
+@APIRouter("/vtest", secure=False)
 class VTest(RESTController):
     RESOURCE_ID = "vid"
 
-    @RESTController.MethodMap(version="0.1")
+    @RESTController.MethodMap(version=APIVersion(0, 1))
     def list(self):
         return {'version': ""}
 
     def get(self):
         return {'version': ""}
 
-    @RESTController.Collection('GET', version="1.0")
+    @RESTController.Collection('GET', version=APIVersion(1, 0))
     def vmethod(self):
         return {'version': '1.0'}
 
-    @RESTController.Collection('GET', version="2.0")
+    @RESTController.Collection('GET', version=APIVersion(1, 1))
+    def vmethodv1_1(self):
+        return {'version': '1.1'}
+
+    @RESTController.Collection('GET', version=APIVersion(2, 0))
     def vmethodv2(self):
         return {'version': '2.0'}
 
@@ -34,27 +40,40 @@ class RESTVersioningTest(ControllerTestCase, unittest.TestCase):
 
     def test_list(self):
         for (version, expected_status) in [
-                ("0.1", 200),
-                ("2.0", 415)
+                ((0, 1), 200),
+                ((2, 0), 415)
         ]:
             with self.subTest(version=version):
-                self._get('/test/api/vtest', version=version)
+                self._get('/test/api/vtest', version=APIVersion._make(version))
                 self.assertStatus(expected_status)
 
     def test_v1(self):
         for (version, expected_status) in [
-                ("1.0", 200),
-                ("2.0", 415)
+                ((1, 0), 200),
+                ((2, 0), 415)
         ]:
             with self.subTest(version=version):
-                self._get('/test/api/vtest/vmethod', version=version)
+                self._get('/test/api/vtest/vmethod',
+                          version=APIVersion._make(version))
                 self.assertStatus(expected_status)
 
     def test_v2(self):
         for (version, expected_status) in [
-                ("2.0", 200),
-                ("1.0", 415)
+                ((2, 0), 200),
+                ((1, 0), 415)
+        ]:
+            with self.subTest(version=version):
+                self._get('/test/api/vtest/vmethodv2',
+                          version=APIVersion._make(version))
+                self.assertStatus(expected_status)
+
+    def test_backward_compatibility(self):
+        for (version, expected_status) in [
+                ((1, 1), 200),
+                ((1, 0), 200),
+                ((2, 0), 415)
         ]:
             with self.subTest(version=version):
-                self._get('/test/api/vtest/vmethodv2', version=version)
+                self._get('/test/api/vtest/vmethodv1_1',
+                          version=APIVersion._make(version))
                 self.assertStatus(expected_status)
index 7e22ec91bec3ec2e462cdbd82fcb59931d5638b6..1ae194219ec6d4ca2665b05d093b9e183ca64e09 100644 (file)
@@ -829,3 +829,13 @@ def find_object_in_list(key, value, iterable):
         if key in obj and obj[key] == value:
             return obj
     return None
+
+
+def merge_list_of_dicts_by_key(target_list: list, source_list: list, key: str):
+    target_list = {d[key]: d for d in target_list}
+    for sdict in source_list:
+        if bool(sdict):
+            if sdict[key] in target_list:
+                target_list[sdict[key]].update(sdict)
+    target_list = [value for value in target_list.values()]
+    return target_list
index e54ca1f00244caa382c77272e2d63ed89fa68661..0f43ac0bb878ebea5a2012d7f66c398d7bc64fa5 100644 (file)
@@ -251,6 +251,10 @@ class Module(MgrModule):
         for daemon, counters in self.get_all_perf_counters().items():
             svc_type, svc_id = daemon.split(".", 1)
             metadata = self.get_metadata(svc_type, svc_id)
+            if metadata is not None:
+                hostname = metadata['hostname']
+            else:
+                hostname = 'N/A'
 
             for path, counter_info in counters.items():
                 if counter_info['type'] & self.PERFCOUNTER_HISTOGRAM:
@@ -263,7 +267,7 @@ class Module(MgrModule):
                     "tags": {
                         "ceph_daemon": daemon,
                         "type_instance": path,
-                        "host": metadata['hostname'],
+                        "host": hostname,
                         "fsid": self.get_fsid()
                     },
                     "time": now,
index afdd5ae77b9a1ce17331703e81646bcc67771eb9..1e12d1f27a25c07959ed0d01ca5c1709fc40a606 100644 (file)
@@ -1026,12 +1026,12 @@ class Module(MgrModule):
         },
         {
             "cmd": "k8sevents set-access name=key,type=CephString",
-            "desc": "Set kubernetes access credentials. <key> must be cacrt or token and use -i <filename> syntax.\ne.g. ceph k8sevents set-access cacrt -i /root/ca.crt",
+            "desc": "Set kubernetes access credentials. <key> must be cacrt or token and use -i <filename> syntax (e.g., ceph k8sevents set-access cacrt -i /root/ca.crt).",
             "perm": "rw"
         },
         {
             "cmd": "k8sevents set-config name=key,type=CephString name=value,type=CephString",
-            "desc": "Set kubernetes config paramters. <key> must be server or namespace.\ne.g. ceph k8sevents set-config server https://localhost:30433",
+            "desc": "Set kubernetes config paramters. <key> must be server or namespace (e.g., ceph k8sevents set-config server https://localhost:30433).",
             "perm": "rw"
         },
         {
index ecc46fe8f969971597ff13f748a48e233993a65d..94113e765eef5371a464f3d8e0a89be1d51490ac 100644 (file)
@@ -79,6 +79,9 @@ PG_STATES = [
     "wait",
 ]
 
+NFS_GANESHA_SUPPORTED_FSALS = ['CEPH', 'RGW']
+NFS_POOL_NAME = '.nfs'
+
 
 class CommandResult(object):
     """
@@ -322,7 +325,7 @@ class CLICommand(object):
 
     @staticmethod
     def load_func_metadata(f: HandlerFuncType) -> Tuple[str, Dict[str, Any], int, str]:
-        desc = inspect.getdoc(f) or ''
+        desc = (inspect.getdoc(f) or '').replace('\n', ' ')
         full_argspec = inspect.getfullargspec(f)
         arg_spec = full_argspec.annotations
         first_default = len(arg_spec)
@@ -1320,6 +1323,34 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin):
         """
         self._ceph_send_command(result, svc_type, svc_id, command, tag, inbuf)
 
+    def tool_exec(
+        self,
+        args: List[str],
+        timeout: int = 10,
+        stdin: Optional[bytes] = None
+    ) -> Tuple[int, str, str]:
+        try:
+            tool = args.pop(0)
+            cmd = [
+                tool,
+                '-k', str(self.get_ceph_option('keyring')),
+                '-n', f'mgr.{self.get_mgr_id()}',
+            ] + args
+            self.log.debug('exec: ' + ' '.join(cmd))
+            p = subprocess.run(
+                cmd,
+                input=stdin,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                timeout=timeout,
+            )
+        except subprocess.TimeoutExpired as ex:
+            self.log.error(ex)
+            return -errno.ETIMEDOUT, '', str(ex)
+        if p.returncode:
+            self.log.error(f'Non-zero return from {cmd}: {p.stderr.decode()}')
+        return p.returncode, p.stdout.decode(), p.stderr.decode()
+
     def set_health_checks(self, checks: HealthChecksT) -> None:
         """
         Set the module's current map of health checks.  Argument is a
index 608a92bf541bfaf014901eeb27813d5a19929f83..aef90b55fe5f4afedfeb704754a691a599da077a 100644 (file)
@@ -27,6 +27,10 @@ class DirectoryState:
             f' purging={self.purging}]'
 
 class Policy:
+    # number of seconds after which a directory can be reshuffled
+    # to other mirror daemon instances.
+    DIR_SHUFFLE_THROTTLE_INTERVAL = 300
+
     def __init__(self):
         self.dir_states = {}
         self.instance_to_dir_map = {}
@@ -54,7 +58,8 @@ class Policy:
         """
         log.debug(f'can_shuffle_dir: {dir_path}')
         dir_state = self.dir_states[dir_path]
-        return StateTransition.is_idle(dir_state.state)
+        return StateTransition.is_idle(dir_state.state) and \
+            (time.time() - dir_state['mapped_time']) > Policy.DIR_SHUFFLE_THROTTLE_INTERVAL
 
     def set_state(self, dir_state, state, ignore_current_state=False):
         if not ignore_current_state and dir_state.state == state:
index a3295514c2d9b269b78b8eb4fe03fd081228647a..ad9e550435d801eb36eaa6317a695061d1b76436 100644 (file)
@@ -749,14 +749,9 @@ class FSSnapshotMirror:
         except MirrorException as me:
             return me.args[0], '', me.args[1]
 
-    def daemon_status(self, filesystem):
+    def daemon_status(self):
         try:
             with self.lock:
-                if not self.filesystem_exist(filesystem):
-                    raise MirrorException(-errno.ENOENT, f'filesystem {filesystem} does not exist')
-                fspolicy = self.pool_policy.get(filesystem, None)
-                if not fspolicy:
-                    raise MirrorException(-errno.EINVAL, f'filesystem {filesystem} is not mirrored')
                 daemons = []
                 sm = self.mgr.get('service_map')
                 daemon_entry = sm['services'].get('cephfs-mirror', None)
index 19b0f76edbac9bbfcb9f24548ca04ed1b0fc141c..b9223111ae902507aa3f52ea374d1adce0ae0cf7 100644 (file)
@@ -97,7 +97,6 @@ class Module(MgrModule):
         return self.fs_snapshot_mirror.show_distribution(fs_name)
 
     @CLIReadCommand('fs snapshot mirror daemon status')
-    def snapshot_mirror_daemon_status(self,
-                                      fs_name: str):
+    def snapshot_mirror_daemon_status(self):
         """Get mirror daemon status"""
-        return self.fs_snapshot_mirror.daemon_status(fs_name)
+        return self.fs_snapshot_mirror.daemon_status()
index 8f210ac9247ea49624b20582ca8206e56055fbcd..4e22577887e8b1ac39fbdc082f37153609ebaccd 100644 (file)
@@ -1 +1,7 @@
+# flake8: noqa
+
+import os
+if 'UNITTEST' in os.environ:
+    import tests
+
 from .module import Module
index 6368b8d2c4e0313542a8f7bf6713e3499fe75d94..721eda2bdfe721d223ad2d6d9aa7bd9dca21ccf1 100644 (file)
@@ -1,17 +1,23 @@
 import logging
-import socket
 import json
 import re
-from typing import cast, Dict, List, Any, Union, Optional
+import socket
+from typing import cast, Dict, List, Any, Union, Optional, TYPE_CHECKING, Tuple
 
+from mgr_module import NFS_POOL_NAME as POOL_NAME
 from ceph.deployment.service_spec import NFSServiceSpec, PlacementSpec, IngressSpec
 
 import orchestrator
 
 from .exception import NFSInvalidOperation, ClusterNotFound
-from .utils import POOL_NAME, available_clusters, restart_nfs_service
+from .utils import available_clusters, restart_nfs_service
 from .export import NFSRados, exception_handler
 
+if TYPE_CHECKING:
+    from nfs.module import Module
+    from mgr_module import MgrModule
+
+
 log = logging.getLogger(__name__)
 
 
@@ -28,84 +34,79 @@ def resolve_ip(hostname: str) -> str:
         raise NFSInvalidOperation(f"Cannot resolve IP for host {hostname}: {e}")
 
 
-def cluster_setter(func):
-    def set_pool_ns_clusterid(nfs, *args, **kwargs):
-        nfs._set_pool_namespace(kwargs['cluster_id'])
-        nfs._set_cluster_id(kwargs['cluster_id'])
-        return func(nfs, *args, **kwargs)
-    return set_pool_ns_clusterid
-
-
-def create_ganesha_pool(mgr, pool):
+def create_ganesha_pool(mgr: 'MgrModule') -> None:
     pool_list = [p['pool_name'] for p in mgr.get_osdmap().dump().get('pools', [])]
-    if pool not in pool_list:
-        mgr.check_mon_command({'prefix': 'osd pool create', 'pool': pool})
+    if POOL_NAME not in pool_list:
+        mgr.check_mon_command({'prefix': 'osd pool create', 'pool': POOL_NAME})
         mgr.check_mon_command({'prefix': 'osd pool application enable',
-                               'pool': pool,
+                               'pool': POOL_NAME,
                                'app': 'nfs'})
+        log.debug("Successfully created nfs-ganesha pool %s", POOL_NAME)
 
 
 class NFSCluster:
-    def __init__(self, mgr):
-        self.pool_name = POOL_NAME
-        self.pool_ns = ''
+    def __init__(self, mgr: 'Module') -> None:
         self.mgr = mgr
 
-    def _set_cluster_id(self, cluster_id):
-        self.cluster_id = cluster_id
-
-    def _set_pool_namespace(self, cluster_id):
-        self.pool_ns = cluster_id
+    def _get_common_conf_obj_name(self, cluster_id: str) -> str:
+        return f'conf-nfs.{cluster_id}'
 
-    def _get_common_conf_obj_name(self):
-        return f'conf-nfs.{self.cluster_id}'
+    def _get_user_conf_obj_name(self, cluster_id: str) -> str:
+        return f'userconf-nfs.{cluster_id}'
 
-    def _get_user_conf_obj_name(self):
-        return f'userconf-nfs.{self.cluster_id}'
-
-    def _call_orch_apply_nfs(self, placement, virtual_ip=None):
+    def _call_orch_apply_nfs(
+            self,
+            cluster_id: str,
+            placement: Optional[str],
+            virtual_ip: Optional[str] = None,
+            port: Optional[int] = None,
+    ) -> None:
+        if not port:
+            port = 2049   # default nfs port
         if virtual_ip:
             # nfs + ingress
             # run NFS on non-standard port
-            spec = NFSServiceSpec(service_type='nfs', service_id=self.cluster_id,
-                                  pool=self.pool_name, namespace=self.pool_ns,
+            spec = NFSServiceSpec(service_type='nfs', service_id=cluster_id,
                                   placement=PlacementSpec.from_string(placement),
                                   # use non-default port so we don't conflict with ingress
-                                  port=12049)
+                                  port=10000 + port)   # semi-arbitrary, fix me someday
             completion = self.mgr.apply_nfs(spec)
             orchestrator.raise_if_exception(completion)
             ispec = IngressSpec(service_type='ingress',
-                                service_id='nfs.' + self.cluster_id,
-                                backend_service='nfs.' + self.cluster_id,
-                                frontend_port=2049,  # default nfs port
-                                monitor_port=9049,
+                                service_id='nfs.' + cluster_id,
+                                backend_service='nfs.' + cluster_id,
+                                frontend_port=port,
+                                monitor_port=7000 + port,   # semi-arbitrary, fix me someday
                                 virtual_ip=virtual_ip)
             completion = self.mgr.apply_ingress(ispec)
             orchestrator.raise_if_exception(completion)
         else:
             # standalone nfs
-            spec = NFSServiceSpec(service_type='nfs', service_id=self.cluster_id,
-                                  pool=self.pool_name, namespace=self.pool_ns,
-                                  placement=PlacementSpec.from_string(placement))
+            spec = NFSServiceSpec(service_type='nfs', service_id=cluster_id,
+                                  placement=PlacementSpec.from_string(placement),
+                                  port=port)
             completion = self.mgr.apply_nfs(spec)
             orchestrator.raise_if_exception(completion)
+        log.debug("Successfully deployed nfs daemons with cluster id %s and placement %s", cluster_id, placement)
 
-    def create_empty_rados_obj(self):
-        common_conf = self._get_common_conf_obj_name()
-        NFSRados(self.mgr, self.pool_ns).write_obj('', self._get_common_conf_obj_name())
-        log.info(f"Created empty object:{common_conf}")
-
-    def delete_config_obj(self):
-        NFSRados(self.mgr, self.pool_ns).remove_all_obj()
-        log.info(f"Deleted {self._get_common_conf_obj_name()} object and all objects in "
-                 f"{self.pool_ns}")
-
-    @cluster_setter
-    def create_nfs_cluster(self,
-                           cluster_id: str,
-                           placement: Optional[str],
-                           virtual_ip: Optional[str],
-                           ingress: Optional[bool] = None):
+    def create_empty_rados_obj(self, cluster_id: str) -> None:
+        common_conf = self._get_common_conf_obj_name(cluster_id)
+        NFSRados(self.mgr, cluster_id).write_obj('', self._get_common_conf_obj_name(cluster_id))
+        log.info("Created empty object:%s", common_conf)
+
+    def delete_config_obj(self, cluster_id: str) -> None:
+        NFSRados(self.mgr, cluster_id).remove_all_obj()
+        log.info("Deleted %s object and all objects in %s",
+                 self._get_common_conf_obj_name(cluster_id), cluster_id)
+
+    def create_nfs_cluster(
+            self,
+            cluster_id: str,
+            placement: Optional[str],
+            virtual_ip: Optional[str],
+            ingress: Optional[bool] = None,
+            port: Optional[int] = None,
+    ) -> Tuple[int, str, str]:
         try:
             if virtual_ip and not ingress:
                 raise NFSInvalidOperation('virtual_ip can only be provided with ingress enabled')
@@ -116,54 +117,54 @@ class NFSCluster:
                 raise NFSInvalidOperation(f"cluster id {cluster_id} is invalid. "
                                           f"{invalid_str.group()} is char not permitted")
 
-            create_ganesha_pool(self.mgr, self.pool_name)
+            create_ganesha_pool(self.mgr)
 
-            self.create_empty_rados_obj()
+            self.create_empty_rados_obj(cluster_id)
 
             if cluster_id not in available_clusters(self.mgr):
-                self._call_orch_apply_nfs(placement, virtual_ip)
+                self._call_orch_apply_nfs(cluster_id, placement, virtual_ip, port)
                 return 0, "NFS Cluster Created Successfully", ""
             return 0, "", f"{cluster_id} cluster already exists"
         except Exception as e:
             return exception_handler(e, f"NFS Cluster {cluster_id} could not be created")
 
-    @cluster_setter
-    def delete_nfs_cluster(self, cluster_id):
+    def delete_nfs_cluster(self, cluster_id: str) -> Tuple[int, str, str]:
         try:
             cluster_list = available_clusters(self.mgr)
             if cluster_id in cluster_list:
                 self.mgr.export_mgr.delete_all_exports(cluster_id)
-                completion = self.mgr.remove_service('ingress.nfs.' + self.cluster_id)
+                completion = self.mgr.remove_service('ingress.nfs.' + cluster_id)
                 orchestrator.raise_if_exception(completion)
-                completion = self.mgr.remove_service('nfs.' + self.cluster_id)
+                completion = self.mgr.remove_service('nfs.' + cluster_id)
                 orchestrator.raise_if_exception(completion)
-                self.delete_config_obj()
+                self.delete_config_obj(cluster_id)
                 return 0, "NFS Cluster Deleted Successfully", ""
             return 0, "", "Cluster does not exist"
         except Exception as e:
             return exception_handler(e, f"Failed to delete NFS Cluster {cluster_id}")
 
-    def list_nfs_cluster(self):
+    def list_nfs_cluster(self) -> Tuple[int, str, str]:
         try:
             return 0, '\n'.join(available_clusters(self.mgr)), ""
         except Exception as e:
             return exception_handler(e, "Failed to list NFS Cluster")
 
     def _show_nfs_cluster_info(self, cluster_id: str) -> Dict[str, Any]:
-        self._set_cluster_id(cluster_id)
         completion = self.mgr.list_daemons(daemon_type='nfs')
-        orchestrator.raise_if_exception(completion)
-        backends: List[Dict[str, Union[str, int]]] = []
         # Here completion.result is a list DaemonDescription objects
-        for cluster in completion.result:
-            if self.cluster_id == cluster.service_id():
+        clusters = orchestrator.raise_if_exception(completion)
+        backends: List[Dict[str, Union[Any]]] = []
+
+        for cluster in clusters:
+            if cluster_id == cluster.service_id():
+                assert cluster.hostname
                 try:
                     if cluster.ip:
                         ip = cluster.ip
                     else:
                         c = self.mgr.get_hosts()
                         orchestrator.raise_if_exception(c)
-                        hosts = [h for h in c.result
+                        hosts = [h for h in c.result or []
                                  if h.hostname == cluster.hostname]
                         if hosts:
                             ip = resolve_ip(hosts[0].addr)
@@ -171,10 +172,10 @@ class NFSCluster:
                             # sigh
                             ip = resolve_ip(cluster.hostname)
                     backends.append({
-                            "hostname": cluster.hostname,
-                            "ip": ip,
-                            "port": cluster.ports[0]
-                            })
+                        "hostname": cluster.hostname,
+                        "ip": ip,
+                        "port": cluster.ports[0] if cluster.ports else None
+                    })
                 except orchestrator.OrchestratorError:
                     continue
 
@@ -183,20 +184,20 @@ class NFSCluster:
             'backend': backends,
         }
         sc = self.mgr.describe_service(service_type='ingress')
-        orchestrator.raise_if_exception(sc)
-        for i in sc.result:
+        services = orchestrator.raise_if_exception(sc)
+        for i in services:
             spec = cast(IngressSpec, i.spec)
             if spec.backend_service == f'nfs.{cluster_id}':
-                r['virtual_ip'] = i.virtual_ip.split('/')[0]
+                r['virtual_ip'] = i.virtual_ip.split('/')[0] if i.virtual_ip else None
                 if i.ports:
                     r['port'] = i.ports[0]
                     if len(i.ports) > 1:
                         r['monitor_port'] = i.ports[1]
+        log.debug("Successfully fetched %s info: %s", cluster_id, r)
         return r
 
-    def show_nfs_cluster_info(self, cluster_id=None):
+    def show_nfs_cluster_info(self, cluster_id: Optional[str] = None) -> Tuple[int, str, str]:
         try:
-            cluster_ls = []
             info_res = {}
             if cluster_id:
                 cluster_ls = [cluster_id]
@@ -211,38 +212,47 @@ class NFSCluster:
         except Exception as e:
             return exception_handler(e, "Failed to show info for cluster")
 
-    @cluster_setter
-    def set_nfs_cluster_config(self, cluster_id, nfs_config):
+    def get_nfs_cluster_config(self, cluster_id: str) -> Tuple[int, str, str]:
+        try:
+            if cluster_id in available_clusters(self.mgr):
+                rados_obj = NFSRados(self.mgr, cluster_id)
+                conf = rados_obj.read_obj(self._get_user_conf_obj_name(cluster_id))
+                return 0, conf or "", ""
+            raise ClusterNotFound()
+        except Exception as e:
+            return exception_handler(e, f"Fetching NFS-Ganesha Config failed for {cluster_id}")
+
+    def set_nfs_cluster_config(self, cluster_id: str, nfs_config: str) -> Tuple[int, str, str]:
         try:
             if cluster_id in available_clusters(self.mgr):
-                rados_obj = NFSRados(self.mgr, self.pool_ns)
+                rados_obj = NFSRados(self.mgr, cluster_id)
                 if rados_obj.check_user_config():
                     return 0, "", "NFS-Ganesha User Config already exists"
-                rados_obj.write_obj(nfs_config, self._get_user_conf_obj_name(),
-                                    self._get_common_conf_obj_name())
+                rados_obj.write_obj(nfs_config, self._get_user_conf_obj_name(cluster_id),
+                                    self._get_common_conf_obj_name(cluster_id))
+                log.debug("Successfully saved %s's user config: \n %s", cluster_id, nfs_config)
                 restart_nfs_service(self.mgr, cluster_id)
                 return 0, "NFS-Ganesha Config Set Successfully", ""
             raise ClusterNotFound()
         except NotImplementedError:
             return 0, "NFS-Ganesha Config Added Successfully "\
-                    "(Manual Restart of NFS PODS required)", ""
+                "(Manual Restart of NFS PODS required)", ""
         except Exception as e:
             return exception_handler(e, f"Setting NFS-Ganesha Config failed for {cluster_id}")
 
-    @cluster_setter
-    def reset_nfs_cluster_config(self, cluster_id):
+    def reset_nfs_cluster_config(self, cluster_id: str) -> Tuple[int, str, str]:
         try:
             if cluster_id in available_clusters(self.mgr):
-                rados_obj = NFSRados(self.mgr, self.pool_ns)
+                rados_obj = NFSRados(self.mgr, cluster_id)
                 if not rados_obj.check_user_config():
                     return 0, "", "NFS-Ganesha User Config does not exist"
-                rados_obj.remove_obj(self._get_user_conf_obj_name(),
-                                     self._get_common_conf_obj_name())
+                rados_obj.remove_obj(self._get_user_conf_obj_name(cluster_id),
+                                     self._get_common_conf_obj_name(cluster_id))
                 restart_nfs_service(self.mgr, cluster_id)
                 return 0, "NFS-Ganesha Config Reset Successfully", ""
             raise ClusterNotFound()
         except NotImplementedError:
             return 0, "NFS-Ganesha Config Removed Successfully "\
-                    "(Manual Restart of NFS PODS required)", ""
+                "(Manual Restart of NFS PODS required)", ""
         except Exception as e:
             return exception_handler(e, f"Resetting NFS-Ganesha Config failed for {cluster_id}")
index 00a9ebe154cb4483790aba9cbc286a10f0c4bca7..6c6e3d9f35468578993fe119d439e8cb5df7ae0a 100644 (file)
@@ -1,31 +1,32 @@
 import errno
+from typing import Optional
 
 
 class NFSException(Exception):
-    def __init__(self, errno, err_msg):
+    def __init__(self, err_msg: str, errno: int = -1) -> None:
         super(NFSException, self).__init__(errno, err_msg)
         self.errno = errno
         self.err_msg = err_msg
 
-    def __str__(self):
+    def __str__(self) -> str:
         return self.err_msg
 
 
 class NFSInvalidOperation(NFSException):
-    def __init__(self, err_msg):
-        super(NFSInvalidOperation, self).__init__(-errno.EINVAL, err_msg)
+    def __init__(self, err_msg: str) -> None:
+        super(NFSInvalidOperation, self).__init__(err_msg, -errno.EINVAL)
 
 
 class NFSObjectNotFound(NFSException):
-    def __init__(self, err_msg):
-        super(NFSObjectNotFound, self).__init__(-errno.ENOENT, err_msg)
+    def __init__(self, err_msg: str) -> None:
+        super(NFSObjectNotFound, self).__init__(err_msg, -errno.ENOENT)
 
 
 class FSNotFound(NFSObjectNotFound):
-    def __init__(self, fs_name):
+    def __init__(self, fs_name: Optional[str]) -> None:
         super(FSNotFound, self).__init__(f'filesystem {fs_name} not found')
 
 
 class ClusterNotFound(NFSObjectNotFound):
-    def __init__(self):
+    def __init__(self) -> None:
         super(ClusterNotFound, self).__init__('cluster does not exist')
index 6db66ed798b9ed96ea6d96bdc993821e8fd6378c..e864c7e36608771cc25aac7258614fe4e2c0e380 100644 (file)
@@ -1,78 +1,96 @@
 import errno
 import json
 import logging
-from typing import List
-from os.path import isabs, normpath
+from typing import List, Any, Dict, Tuple, Optional, TYPE_CHECKING, TypeVar, Callable, cast
+from os.path import normpath
 
 from rados import TimedOut, ObjectNotFound
 
-from .export_utils import GaneshaConfParser, Export
-from .exception import NFSException, NFSInvalidOperation, NFSObjectNotFound, FSNotFound, \
-        ClusterNotFound
-from .utils import POOL_NAME, available_clusters, restart_nfs_service, check_fs
+from mgr_module import NFS_POOL_NAME as POOL_NAME, NFS_GANESHA_SUPPORTED_FSALS
+
+from .export_utils import GaneshaConfParser, Export, RawBlock, CephFSFSAL, RGWFSAL
+from .exception import NFSException, NFSInvalidOperation, FSNotFound, \
+    ClusterNotFound
+from .utils import available_clusters, check_fs, restart_nfs_service
+
+if TYPE_CHECKING:
+    from nfs.module import Module
+
+FuncT = TypeVar('FuncT', bound=Callable)
 
 log = logging.getLogger(__name__)
 
 
-def export_cluster_checker(func):
-    def cluster_check(fs_export, *args, **kwargs):
+def export_cluster_checker(func: FuncT) -> FuncT:
+    def cluster_check(
+            export: 'ExportMgr',
+            *args: Any,
+            **kwargs: Any
+    ) -> Tuple[int, str, str]:
         """
-        This method checks if cluster exists and sets rados namespace.
+        This method checks if cluster exists
         """
-        if kwargs['cluster_id'] not in available_clusters(fs_export.mgr):
+        if kwargs['cluster_id'] not in available_clusters(export.mgr):
             return -errno.ENOENT, "", "Cluster does not exists"
-        fs_export.rados_namespace = kwargs['cluster_id']
-        return func(fs_export, *args, **kwargs)
-    return cluster_check
+        return func(export, *args, **kwargs)
+    return cast(FuncT, cluster_check)
 
 
-def exception_handler(exception_obj, log_msg=""):
+def exception_handler(
+        exception_obj: Exception,
+        log_msg: str = ""
+) -> Tuple[int, str, str]:
     if log_msg:
         log.exception(log_msg)
     return getattr(exception_obj, 'errno', -1), "", str(exception_obj)
 
 
 class NFSRados:
-    def __init__(self, mgr, namespace):
+    def __init__(self, mgr: 'Module', namespace: str) -> None:
         self.mgr = mgr
         self.pool = POOL_NAME
         self.namespace = namespace
 
-    def _make_rados_url(self, obj):
+    def _make_rados_url(self, obj: str) -> str:
         return "rados://{}/{}/{}".format(self.pool, self.namespace, obj)
 
-    def _create_url_block(self, obj_name):
-        return {'block_name': '%url', 'value': self._make_rados_url(obj_name)}
-
-    def write_obj(self, conf_block, obj, config_obj=''):
-        if 'export-' in obj:
-            conf_block = GaneshaConfParser.write_block(conf_block)
+    def _create_url_block(self, obj_name: str) -> RawBlock:
+        return RawBlock('%url', values={'value': self._make_rados_url(obj_name)})
 
+    def write_obj(self, conf_block: str, obj: str, config_obj: str = '') -> None:
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             ioctx.write_full(obj, conf_block.encode('utf-8'))
             if not config_obj:
                 # Return after creating empty common config object
                 return
-            log.debug("write configuration into rados object "
-                      f"{self.pool}/{self.namespace}/{obj}:\n{conf_block}")
+            log.debug("write configuration into rados object %s/%s/%s",
+                      self.pool, self.namespace, obj)
 
             # Add created obj url to common config obj
             ioctx.append(config_obj, GaneshaConfParser.write_block(
                          self._create_url_block(obj)).encode('utf-8'))
             ExportMgr._check_rados_notify(ioctx, config_obj)
-            log.debug(f"Added {obj} url to {config_obj}")
+            log.debug("Added %s url to %s", obj, config_obj)
+
+    def read_obj(self, obj: str) -> Optional[str]:
+        with self.mgr.rados.open_ioctx(self.pool) as ioctx:
+            ioctx.set_namespace(self.namespace)
+            try:
+                return ioctx.read(obj, 1048576).decode()
+            except ObjectNotFound:
+                return None
 
-    def update_obj(self, conf_block, obj, config_obj):
+    def update_obj(self, conf_block: str, obj: str, config_obj: str) -> None:
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             ioctx.write_full(obj, conf_block.encode('utf-8'))
-            log.debug("write configuration into rados object "
-                      f"{self.pool}/{self.namespace}/{obj}:\n{conf_block}")
+            log.debug("write configuration into rados object %s/%s/%s",
+                      self.pool, self.namespace, obj)
             ExportMgr._check_rados_notify(ioctx, config_obj)
-            log.debug(f"Update export {obj} in {config_obj}")
+            log.debug("Update export %s in %s", obj, config_obj)
 
-    def remove_obj(self, obj, config_obj):
+    def remove_obj(self, obj: str, config_obj: str) -> None:
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             export_urls = ioctx.read(config_obj)
@@ -81,15 +99,15 @@ class NFSRados:
             ioctx.remove_object(obj)
             ioctx.write_full(config_obj, export_urls)
             ExportMgr._check_rados_notify(ioctx, config_obj)
-            log.debug("Object deleted: {}".format(url))
+            log.debug("Object deleted: %s", url)
 
-    def remove_all_obj(self):
+    def remove_all_obj(self) -> None:
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             for obj in ioctx.list_objects():
                 obj.remove()
 
-    def check_user_config(self):
+    def check_user_config(self) -> bool:
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             for obj in ioctx.list_objects():
@@ -98,88 +116,25 @@ class NFSRados:
         return False
 
 
-class ValidateExport:
-    @staticmethod
-    def pseudo_path(path):
-        if not isabs(path) or path == "/":
-            raise NFSInvalidOperation(f"pseudo path {path} is invalid. It should be an absolute "
-                                      "path and it cannot be just '/'.")
-
-    @staticmethod
-    def squash(squash):
-        valid_squash_ls = ["root", "root_squash", "rootsquash", "rootid", "root_id_squash",
-                           "rootidsquash", "all", "all_squash", "allsquash", "all_anomnymous",
-                           "allanonymous", "no_root_squash", "none", "noidsquash"]
-        if squash not in valid_squash_ls:
-            raise NFSInvalidOperation(f"squash {squash} not in valid list {valid_squash_ls}")
-
-    @staticmethod
-    def security_label(label):
-        if not isinstance(label, bool):
-            raise NFSInvalidOperation('Only boolean values allowed')
-
-    @staticmethod
-    def protocols(proto):
-        for p in proto:
-            if p not in [3, 4]:
-                raise NFSInvalidOperation(f"Invalid protocol {p}")
-        if 3 in proto:
-            log.warning("NFS V3 is an old version, it might not work")
-
-    @staticmethod
-    def transport(transport):
-        valid_transport = ["UDP", "TCP"]
-        for trans in transport:
-            if trans.upper() not in valid_transport:
-                raise NFSInvalidOperation(f'{trans} is not a valid transport protocol')
-
-    @staticmethod
-    def access_type(access_type):
-        valid_ones = ['RW', 'RO']
-        if access_type not in valid_ones:
-            raise NFSInvalidOperation(f'{access_type} is invalid, valid access type are'
-                                      f'{valid_ones}')
-
-    @staticmethod
-    def fsal(mgr, old, new):
-        if old.name != new['name']:
-            raise NFSInvalidOperation('FSAL name change not allowed')
-        if old.user_id != new['user_id']:
-            raise NFSInvalidOperation('User ID modification is not allowed')
-        if new['sec_label_xattr']:
-            raise NFSInvalidOperation('Security label xattr cannot be changed')
-        if old.fs_name != new['fs_name']:
-            if not check_fs(mgr, new['fs_name']):
-                raise FSNotFound(new['fs_name'])
-            return 1
-
-    @staticmethod
-    def _client(client):
-        ValidateExport.access_type(client['access_type'])
-        ValidateExport.squash(client['squash'])
-
-    @staticmethod
-    def clients(clients_ls):
-        for client in clients_ls:
-            ValidateExport._client(client)
-
-
 class ExportMgr:
-    def __init__(self, mgr, namespace=None, export_ls=None):
+    def __init__(
+            self,
+            mgr: 'Module',
+            export_ls: Optional[Dict[str, List[Export]]] = None
+    ) -> None:
         self.mgr = mgr
         self.rados_pool = POOL_NAME
-        self.rados_namespace = namespace
-        self._exports = export_ls
+        self._exports: Optional[Dict[str, List[Export]]] = export_ls
 
     @staticmethod
-    def _check_rados_notify(ioctx, obj):
+    def _check_rados_notify(ioctx: Any, obj: str) -> None:
         try:
             ioctx.notify(obj)
         except TimedOut:
-            log.exception(f"Ganesha timed out")
+            log.exception("Ganesha timed out")
 
     @property
-    def exports(self):
+    def exports(self) -> Dict[str, List[Export]]:
         if self._exports is None:
             self._exports = {}
             log.info("Begin export parsing")
@@ -187,26 +142,96 @@ class ExportMgr:
                 self.export_conf_objs = []  # type: List[Export]
                 self._read_raw_config(cluster_id)
                 self.exports[cluster_id] = self.export_conf_objs
-                log.info(f"Exports parsed successfully {self.exports.items()}")
+                log.info("Exports parsed successfully %s", self.exports.items())
         return self._exports
 
-    def _fetch_export(self, pseudo_path):
+    def _fetch_export(
+            self,
+            cluster_id: str,
+            pseudo_path: str
+    ) -> Optional[Export]:
         try:
-            for ex in self.exports[self.rados_namespace]:
+            for ex in self.exports[cluster_id]:
                 if ex.pseudo == pseudo_path:
                     return ex
+            return None
         except KeyError:
-            pass
-
-    def _delete_user(self, entity):
-        self.mgr.check_mon_command({
-            'prefix': 'auth rm',
-            'entity': 'client.{}'.format(entity),
+            log.info('no exports for cluster %s', cluster_id)
+            return None
+
+    def _fetch_export_id(
+            self,
+            cluster_id: str,
+            export_id: int
+    ) -> Optional[Export]:
+        try:
+            for ex in self.exports[cluster_id]:
+                if ex.export_id == export_id:
+                    return ex
+            return None
+        except KeyError:
+            log.info(f'no exports for cluster {cluster_id}')
+            return None
+
+    def _delete_export_user(self, export: Export) -> None:
+        if isinstance(export.fsal, CephFSFSAL):
+            assert export.fsal.user_id
+            self.mgr.check_mon_command({
+                'prefix': 'auth rm',
+                'entity': 'client.{}'.format(export.fsal.user_id),
             })
-        log.info(f"Export user deleted is {entity}")
+            log.info("Deleted export user %s", export.fsal.user_id)
+        elif isinstance(export.fsal, RGWFSAL):
+            # do nothing; we're using the bucket owner creds.
+            pass
 
-    def _gen_export_id(self):
-        exports = sorted([ex.export_id for ex in self.exports[self.rados_namespace]])
+    def _create_export_user(self, export: Export) -> None:
+        if isinstance(export.fsal, CephFSFSAL):
+            fsal = cast(CephFSFSAL, export.fsal)
+            assert fsal.fs_name
+
+            # is top-level or any client rw?
+            rw = export.access_type.lower() == 'rw'
+            for c in export.clients:
+                if c.access_type.lower() == 'rw':
+                    rw = True
+                    break
+
+            fsal.user_id = f"nfs.{export.cluster_id}.{export.export_id}"
+            fsal.cephx_key = self._create_user_key(
+                export.cluster_id, fsal.user_id, export.path, fsal.fs_name, not rw
+            )
+            log.debug("Successfully created user %s for cephfs path %s", fsal.user_id, export.path)
+
+        elif isinstance(export.fsal, RGWFSAL):
+            rgwfsal = cast(RGWFSAL, export.fsal)
+            if not rgwfsal.user_id:
+                assert export.path
+                ret, out, err = self.mgr.tool_exec(
+                    ['radosgw-admin', 'bucket', 'stats', '--bucket', export.path]
+                )
+                if ret:
+                    raise NFSException(f'Failed to fetch owner for bucket {export.path}')
+                j = json.loads(out)
+                owner = j.get('owner', '')
+                rgwfsal.user_id = owner
+            assert rgwfsal.user_id
+            ret, out, err = self.mgr.tool_exec([
+                'radosgw-admin', 'user', 'info', '--uid', rgwfsal.user_id
+            ])
+            if ret:
+                raise NFSException(
+                    f'Failed to fetch key for bucket {export.path} owner {rgwfsal.user_id}'
+                )
+            j = json.loads(out)
+
+            # FIXME: make this more tolerate of unexpected output?
+            rgwfsal.access_key_id = j['keys'][0]['access_key']
+            rgwfsal.secret_access_key = j['keys'][0]['secret_key']
+            log.debug("Successfully fetched user %s for RGW path %s", rgwfsal.user_id, export.path)
+
+    def _gen_export_id(self, cluster_id: str) -> int:
+        exports = sorted([ex.export_id for ex in self.exports[cluster_id]])
         nid = 1
         for e_id in exports:
             if e_id == nid:
@@ -215,7 +240,7 @@ class ExportMgr:
                 break
         return nid
 
-    def _read_raw_config(self, rados_namespace):
+    def _read_raw_config(self, rados_namespace: str) -> None:
         with self.mgr.rados.open_ioctx(self.rados_pool) as ioctx:
             ioctx.set_namespace(rados_namespace)
             for obj in ioctx.list_objects():
@@ -224,53 +249,68 @@ class ExportMgr:
                     raw_config = obj.read(size)
                     raw_config = raw_config.decode("utf-8")
                     log.debug("read export configuration from rados "
-                              "object %s/%s/%s:\n%s", self.rados_pool,
-                              rados_namespace, obj.key, raw_config)
+                              "object %s/%s/%s", self.rados_pool,
+                              rados_namespace, obj.key)
                     self.export_conf_objs.append(Export.from_export_block(
                         GaneshaConfParser(raw_config).parse()[0], rados_namespace))
 
-    def _save_export(self, export):
-        self.exports[self.rados_namespace].append(export)
-        NFSRados(self.mgr, self.rados_namespace).write_obj(export.to_export_block(),
-                 f'export-{export.export_id}', f'conf-nfs.{export.cluster_id}')
-
-    def _delete_export(self, cluster_id, pseudo_path, export_obj=None):
+    def _save_export(self, cluster_id: str, export: Export) -> None:
+        self.exports[cluster_id].append(export)
+        NFSRados(self.mgr, cluster_id).write_obj(
+            GaneshaConfParser.write_block(export.to_export_block()),
+            f'export-{export.export_id}',
+            f'conf-nfs.{export.cluster_id}'
+        )
+
+    def _delete_export(
+            self,
+            cluster_id: str,
+            pseudo_path: Optional[str],
+            export_obj: Optional[Export] = None
+    ) -> Tuple[int, str, str]:
         try:
             if export_obj:
-                export = export_obj
+                export: Optional[Export] = export_obj
             else:
-                export = self._fetch_export(pseudo_path)
+                assert pseudo_path
+                export = self._fetch_export(cluster_id, pseudo_path)
 
             if export:
                 if pseudo_path:
-                    NFSRados(self.mgr, self.rados_namespace).remove_obj(
-                             f'export-{export.export_id}', f'conf-nfs.{cluster_id}')
+                    NFSRados(self.mgr, cluster_id).remove_obj(
+                        f'export-{export.export_id}', f'conf-nfs.{cluster_id}')
                 self.exports[cluster_id].remove(export)
-                self._delete_user(export.fsal.user_id)
+                self._delete_export_user(export)
                 if not self.exports[cluster_id]:
                     del self.exports[cluster_id]
+                    log.debug("Deleted all exports for cluster %s", cluster_id)
                 return 0, "Successfully deleted export", ""
             return 0, "", "Export does not exist"
         except Exception as e:
             return exception_handler(e, f"Failed to delete {pseudo_path} export for {cluster_id}")
 
-    def _fetch_export_obj(self, ex_id):
+    def _fetch_export_obj(self, cluster_id: str, ex_id: int) -> Optional[Export]:
         try:
             with self.mgr.rados.open_ioctx(self.rados_pool) as ioctx:
-                ioctx.set_namespace(self.rados_namespace)
-                export = Export.from_export_block(GaneshaConfParser(ioctx.read(f"export-{ex_id}"
-                    ).decode("utf-8")).parse()[0], self.rados_namespace)
+                ioctx.set_namespace(cluster_id)
+                export = Export.from_export_block(
+                    GaneshaConfParser(
+                        ioctx.read(f"export-{ex_id}").decode("utf-8")
+                    ).parse()[0],
+                    cluster_id
+                )
                 return export
         except ObjectNotFound:
-            log.exception(f"Export ID: {ex_id} not found")
+            log.exception("Export ID: %s not found", ex_id)
+        return None
 
-    def _update_export(self, export):
-        self.exports[self.rados_namespace].append(export)
-        NFSRados(self.mgr, self.rados_namespace).update_obj(
-                GaneshaConfParser.write_block(export.to_export_block()),
-                f'export-{export.export_id}', f'conf-nfs.{export.cluster_id}')
+    def _update_export(self, cluster_id: str, export: Export) -> None:
+        self.exports[cluster_id].append(export)
+        NFSRados(self.mgr, cluster_id).update_obj(
+            GaneshaConfParser.write_block(export.to_export_block()),
+            f'export-{export.export_id}', f'conf-nfs.{export.cluster_id}')
 
-    def format_path(self, path):
+    def format_path(self, path: str) -> str:
         if path:
             path = normpath(path.strip())
             if path[:2] == "//":
@@ -278,130 +318,170 @@ class ExportMgr:
         return path
 
     @export_cluster_checker
-    def create_export(self, **kwargs):
+    def create_export(self, addr: Optional[List[str]] = None, **kwargs: Any) -> Tuple[int, str, str]:
+        # if addr(s) are provided, construct client list and adjust outer block
+        clients = []
+        if addr:
+            clients = [{
+                'addresses': addr,
+                'access_type': 'ro' if kwargs['read_only'] else 'rw',
+                'squash': kwargs['squash'],
+            }]
+            kwargs['squash'] = 'none'
+        kwargs['clients'] = clients
+
+        if clients:
+            kwargs['access_type'] = "none"
+        elif kwargs['read_only']:
+            kwargs['access_type'] = "RO"
+        else:
+            kwargs['access_type'] = "RW"
+
+        if kwargs['cluster_id'] not in self.exports:
+            self.exports[kwargs['cluster_id']] = []
+
         try:
             fsal_type = kwargs.pop('fsal_type')
             if fsal_type == 'cephfs':
-                return FSExport(self).create_export(**kwargs)
+                return self.create_cephfs_export(**kwargs)
+            if fsal_type == 'rgw':
+                return self.create_rgw_export(**kwargs)
             raise NotImplementedError()
         except Exception as e:
             return exception_handler(e, f"Failed to create {kwargs['pseudo_path']} export for {kwargs['cluster_id']}")
 
     @export_cluster_checker
-    def delete_export(self, cluster_id, pseudo_path):
+    def delete_export(self,
+                      cluster_id: str,
+                      pseudo_path: str) -> Tuple[int, str, str]:
         return self._delete_export(cluster_id, pseudo_path)
 
-    def delete_all_exports(self, cluster_id):
+    def delete_all_exports(self, cluster_id: str) -> None:
         try:
             export_list = list(self.exports[cluster_id])
         except KeyError:
             log.info("No exports to delete")
             return
-        self.rados_namespace = cluster_id
         for export in export_list:
             ret, out, err = self._delete_export(cluster_id=cluster_id, pseudo_path=None,
                                                 export_obj=export)
             if ret != 0:
-                raise NFSException(-1, f"Failed to delete exports: {err} and {ret}")
-        log.info(f"All exports successfully deleted for cluster id: {cluster_id}")
+                raise NFSException(f"Failed to delete exports: {err} and {ret}")
+        log.info("All exports successfully deleted for cluster id: %s", cluster_id)
+
+    def list_all_exports(self) -> List[Dict[str, Any]]:
+        r = []
+        for cluster_id, ls in self.exports.items():
+            r.extend([e.to_dict() for e in ls])
+        return r
 
     @export_cluster_checker
-    def list_exports(self, cluster_id, detailed):
+    def list_exports(self,
+                     cluster_id: str,
+                     detailed: bool = False) -> Tuple[int, str, str]:
         try:
             if detailed:
-                result = [export.to_dict() for export in self.exports[cluster_id]]
+                result_d = [export.to_dict() for export in self.exports[cluster_id]]
+                return 0, json.dumps(result_d, indent=2), ''
             else:
-                result = [export.pseudo for export in self.exports[cluster_id]]
-            return 0, json.dumps(result, indent=2), ''
+                result_ps = [export.pseudo for export in self.exports[cluster_id]]
+                return 0, json.dumps(result_ps, indent=2), ''
+
         except KeyError:
-            log.warning(f"No exports to list for {cluster_id}")
+            log.warning("No exports to list for %s", cluster_id)
             return 0, '', ''
         except Exception as e:
             return exception_handler(e, f"Failed to list exports for {cluster_id}")
 
+    def _get_export_dict(self, cluster_id: str, pseudo_path: str) -> Optional[Dict[str, Any]]:
+        export = self._fetch_export(cluster_id, pseudo_path)
+        if export:
+            return export.to_dict()
+        log.warning(f"No {pseudo_path} export to show for {cluster_id}")
+        return None
+
     @export_cluster_checker
-    def get_export(self, cluster_id, pseudo_path):
+    def get_export(
+            self,
+            cluster_id: str,
+            pseudo_path: str,
+    ) -> Tuple[int, str, str]:
         try:
-            export = self._fetch_export(pseudo_path)
-            if export:
-                return 0, json.dumps(export.to_dict(), indent=2), ''
-            log.warning(f"No {pseudo_path} export to show for {cluster_id}")
+            export_dict = self._get_export_dict(cluster_id, pseudo_path)
+            if export_dict:
+                return 0, json.dumps(export_dict, indent=2), ''
+            log.warning("No %s export to show for %s", pseudo_path, cluster_id)
             return 0, '', ''
         except Exception as e:
             return exception_handler(e, f"Failed to get {pseudo_path} export for {cluster_id}")
 
-    def update_export(self, export_config):
+    def get_export_by_id(
+            self,
+            cluster_id: str,
+            export_id: int
+    ) -> Optional[Dict[str, Any]]:
+        export = self._fetch_export_id(cluster_id, export_id)
+        return export.to_dict() if export else None
+
+    def get_export_by_pseudo(
+            self,
+            cluster_id: str,
+            pseudo_path: str
+    ) -> Optional[Dict[str, Any]]:
+        export = self._fetch_export(cluster_id, pseudo_path)
+        return export.to_dict() if export else None
+
+    def apply_export(self, cluster_id: str, export_config: str) -> Tuple[int, str, str]:
         try:
-            new_export = json.loads(export_config)
+            if not export_config:
+                raise NFSInvalidOperation("Empty Config!!")
+            try:
+                j = json.loads(export_config)
+            except ValueError:
+                # okay, not JSON.  is it an EXPORT block?
+                try:
+                    blocks = GaneshaConfParser(export_config).parse()
+                    exports = [
+                        Export.from_export_block(block, cluster_id)
+                        for block in blocks
+                    ]
+                    j = [export.to_dict() for export in exports]
+                except Exception as ex:
+                    raise NFSInvalidOperation(f"Input must be JSON or a ganesha EXPORT block: {ex}")
+
             # check export type
-            return FSExport(self).update_export(new_export)
+            if isinstance(j, list):
+                ret, out, err = (0, '', '')
+                for export in j:
+                    try:
+                        r, o, e = self._apply_export(cluster_id, export)
+                    except Exception as ex:
+                        r, o, e = exception_handler(ex, f'Failed to apply export: {ex}')
+                        if r:
+                            ret = r
+                    if o:
+                        out += o + '\n'
+                    if e:
+                        err += e + '\n'
+                return ret, out, err
+            else:
+                r, o, e = self._apply_export(cluster_id, j)
+                return r, o, e
         except NotImplementedError:
             return 0, " Manual Restart of NFS PODS required for successful update of exports", ""
         except Exception as e:
             return exception_handler(e, f'Failed to update export: {e}')
 
-
-class FSExport(ExportMgr):
-    def __init__(self, export_mgr_obj):
-        super().__init__(export_mgr_obj.mgr, export_mgr_obj.rados_namespace,
-                         export_mgr_obj._exports)
-
-    def _validate_export(self, new_export_dict):
-        if new_export_dict['cluster_id'] not in available_clusters(self.mgr):
-            raise ClusterNotFound()
-
-        export = self._fetch_export(new_export_dict['pseudo'])
-        out_msg = ''
-        if export:
-            # Check if export id matches
-            if export.export_id != new_export_dict['export_id']:
-                raise NFSInvalidOperation('Export ID changed, Cannot update export')
-        else:
-            # Fetch export based on export id object
-            export = self._fetch_export_obj(new_export_dict['export_id'])
-            if not export:
-                raise NFSObjectNotFound('Export does not exist')
-            else:
-                new_export_dict['pseudo'] = self.format_path(new_export_dict['pseudo'])
-                ValidateExport.pseudo_path(new_export_dict['pseudo'])
-                log.debug(f"Pseudo path has changed from {export.pseudo} to "
-                          f"{new_export_dict['pseudo']}")
-        # Check if squash changed
-        if export.squash != new_export_dict['squash']:
-            if new_export_dict['squash']:
-                new_export_dict['squash'] = new_export_dict['squash'].lower()
-                ValidateExport.squash(new_export_dict['squash'])
-            log.debug(f"squash has changed from {export.squash} to {new_export_dict['squash']}")
-        # Security label check
-        if export.security_label != new_export_dict['security_label']:
-            ValidateExport.security_label(new_export_dict['security_label'])
-        # Protocol Checking
-        if export.protocols != new_export_dict['protocols']:
-            ValidateExport.protocols(new_export_dict['protocols'])
-        # Transport checking
-        if export.transports != new_export_dict['transports']:
-            ValidateExport.transport(new_export_dict['transports'])
-        # Path check
-        if export.path != new_export_dict['path']:
-            new_export_dict['path'] = self.format_path(new_export_dict['path'])
-            out_msg = 'update caps'
-        # Check Access Type
-        if export.access_type != new_export_dict['access_type']:
-            ValidateExport.access_type(new_export_dict['access_type'])
-        # Fsal block check
-        if export.fsal != new_export_dict['fsal']:
-            ret = ValidateExport.fsal(self.mgr, export.fsal, new_export_dict['fsal'])
-            if ret == 1 and not out_msg:
-                out_msg = 'update caps'
-        # Check client block
-        if export.clients != new_export_dict['clients']:
-            ValidateExport.clients(new_export_dict['clients'])
-        log.debug(f'Validation succeeded for Export {export.pseudo}')
-        return export, out_msg
-
-    def _update_user_id(self, path, access_type, fs_name, user_id):
+    def _update_user_id(
+            self,
+            cluster_id: str,
+            path: str,
+            access_type: str,
+            fs_name: str,
+            user_id: str
+    ) -> None:
         osd_cap = 'allow rw pool={} namespace={}, allow rw tag cephfs data={}'.format(
-                self.rados_pool, self.rados_namespace, fs_name)
+            self.rados_pool, cluster_id, fs_name)
         access_type = 'r' if access_type == 'RO' else 'rw'
 
         self.mgr.check_mon_command({
@@ -409,78 +489,262 @@ class FSExport(ExportMgr):
             'entity': f'client.{user_id}',
             'caps': ['mon', 'allow r', 'osd', osd_cap, 'mds', 'allow {} path={}'.format(
                 access_type, path)],
-            })
-
-        log.info(f"Export user updated {user_id}")
-
-    def _create_user_key(self, entity, path, fs_name, fs_ro):
+        })
+
+        log.info("Export user updated %s", user_id)
+
+    def _create_user_key(
+            self,
+            cluster_id: str,
+            entity: str,
+            path: str,
+            fs_name: str,
+            fs_ro: bool
+    ) -> str:
         osd_cap = 'allow rw pool={} namespace={}, allow rw tag cephfs data={}'.format(
-                self.rados_pool, self.rados_namespace, fs_name)
+            self.rados_pool, cluster_id, fs_name)
         access_type = 'r' if fs_ro else 'rw'
+        nfs_caps = [
+            'mon', 'allow r',
+            'osd', osd_cap,
+            'mds', 'allow {} path={}'.format(access_type, path)
+        ]
 
-        ret, out, err = self.mgr.check_mon_command({
+        ret, out, err = self.mgr.mon_command({
             'prefix': 'auth get-or-create',
             'entity': 'client.{}'.format(entity),
-            'caps': ['mon', 'allow r', 'osd', osd_cap, 'mds', 'allow {} path={}'.format(
-                access_type, path)],
+            'caps': nfs_caps,
             'format': 'json',
+        })
+        if ret == -errno.EINVAL and 'does not match' in err:
+            ret, out, err = self.mgr.mon_command({
+                'prefix': 'auth caps',
+                'entity': 'client.{}'.format(entity),
+                'caps': nfs_caps,
+                'format': 'json',
+            })
+            if err:
+                raise NFSException(f'Failed to update caps for {entity}: {err}')
+            ret, out, err = self.mgr.mon_command({
+                'prefix': 'auth get',
+                'entity': 'client.{}'.format(entity),
+                'format': 'json',
             })
+            if err:
+                raise NFSException(f'Failed to fetch caps for {entity}: {err}')
 
         json_res = json.loads(out)
-        log.info("Export user created is {}".format(json_res[0]['entity']))
-        return json_res[0]['entity'], json_res[0]['key']
+        log.info("Export user created is %s", json_res[0]['entity'])
+        return json_res[0]['key']
+
+    def create_export_from_dict(self,
+                                cluster_id: str,
+                                ex_id: int,
+                                ex_dict: Dict[str, Any]) -> Export:
+        pseudo_path = ex_dict.get("pseudo")
+        if not pseudo_path:
+            raise NFSInvalidOperation("export must specify pseudo path")
+
+        path = ex_dict.get("path")
+        if path is None:
+            raise NFSInvalidOperation("export must specify path")
+        path = self.format_path(path)
+
+        fsal = ex_dict.get("fsal", {})
+        fsal_type = fsal.get("name")
+        if fsal_type == NFS_GANESHA_SUPPORTED_FSALS[1]:
+            if '/' in path and path != '/':
+                raise NFSInvalidOperation('"/" is not allowed in path with bucket name')
+        elif fsal_type == NFS_GANESHA_SUPPORTED_FSALS[0]:
+            fs_name = fsal.get("fs_name")
+            if not fs_name:
+                raise NFSInvalidOperation("export FSAL must specify fs_name")
+            if not check_fs(self.mgr, fs_name):
+                raise FSNotFound(fs_name)
+
+            user_id = f"nfs.{cluster_id}.{ex_id}"
+            if "user_id" in fsal and fsal["user_id"] != user_id:
+                raise NFSInvalidOperation(f"export FSAL user_id must be '{user_id}'")
+        else:
+            raise NFSInvalidOperation(f"NFS Ganesha supported FSALs are {NFS_GANESHA_SUPPORTED_FSALS}."
+                                      "Export must specify any one of it.")
+
+        ex_dict["fsal"] = fsal
+        ex_dict["cluster_id"] = cluster_id
+        export = Export.from_dict(ex_id, ex_dict)
+        export.validate(self.mgr)
+        log.debug("Successfully created %s export-%s from dict for cluster %s",
+                  fsal_type, ex_id, cluster_id)
+        return export
+
+    def create_cephfs_export(self,
+                             fs_name: str,
+                             cluster_id: str,
+                             pseudo_path: str,
+                             read_only: bool,
+                             path: str,
+                             squash: str,
+                             access_type: str,
+                             clients: list = []) -> Tuple[int, str, str]:
+        pseudo_path = self.format_path(pseudo_path)
 
-    def create_export(self, fs_name, cluster_id, pseudo_path, read_only, path):
-        if not check_fs(self.mgr, fs_name):
-            raise FSNotFound(fs_name)
+        if not self._fetch_export(cluster_id, pseudo_path):
+            export = self.create_export_from_dict(
+                cluster_id,
+                self._gen_export_id(cluster_id),
+                {
+                    "pseudo": pseudo_path,
+                    "path": path,
+                    "access_type": access_type,
+                    "squash": squash,
+                    "fsal": {
+                        "name": NFS_GANESHA_SUPPORTED_FSALS[0],
+                        "fs_name": fs_name,
+                    },
+                    "clients": clients,
+                }
+            )
+            log.debug("creating cephfs export %s", export)
+            self._create_export_user(export)
+            self._save_export(cluster_id, export)
+            result = {
+                "bind": export.pseudo,
+                "fs": fs_name,
+                "path": export.path,
+                "cluster": cluster_id,
+                "mode": export.access_type,
+            }
+            return (0, json.dumps(result, indent=4), '')
+        return 0, "", "Export already exists"
 
+    def create_rgw_export(self,
+                          cluster_id: str,
+                          pseudo_path: str,
+                          access_type: str,
+                          read_only: bool,
+                          squash: str,
+                          bucket: Optional[str] = None,
+                          user_id: Optional[str] = None,
+                          clients: list = []) -> Tuple[int, str, str]:
         pseudo_path = self.format_path(pseudo_path)
-        ValidateExport.pseudo_path(pseudo_path)
 
-        if cluster_id not in self.exports:
-            self.exports[cluster_id] = []
-
-        if not self._fetch_export(pseudo_path):
-            ex_id = self._gen_export_id()
-            user_id = f"{cluster_id}{ex_id}"
-            user_out, key = self._create_user_key(user_id, path, fs_name, read_only)
-            access_type = "RW"
-            if read_only:
-                access_type = "RO"
-            ex_dict = {
-                    'path': self.format_path(path),
-                    'pseudo': pseudo_path,
-                    'cluster_id': cluster_id,
-                    'access_type': access_type,
-                    'fsal': {"name": "CEPH", "user_id": user_id,
-                             "fs_name": fs_name, "sec_label_xattr": ""},
-                    'clients': []
-                    }
-            export = Export.from_dict(ex_id, ex_dict)
-            export.fsal.cephx_key = key
-            self._save_export(export)
+        if not bucket and not user_id:
+            return -errno.EINVAL, "", "Must specify either bucket or user_id"
+
+        if not self._fetch_export(cluster_id, pseudo_path):
+            export = self.create_export_from_dict(
+                cluster_id,
+                self._gen_export_id(cluster_id),
+                {
+                    "pseudo": pseudo_path,
+                    "path": bucket or '/',
+                    "access_type": access_type,
+                    "squash": squash,
+                    "fsal": {
+                        "name": NFS_GANESHA_SUPPORTED_FSALS[1],
+                        "user_id": user_id,
+                    },
+                    "clients": clients,
+                }
+            )
+            log.debug("creating rgw export %s", export)
+            self._create_export_user(export)
+            self._save_export(cluster_id, export)
             result = {
-                    "bind": pseudo_path,
-                    "fs": fs_name,
-                    "path": path,
-                    "cluster": cluster_id,
-                    "mode": access_type,
-                    }
+                "bind": export.pseudo,
+                "path": export.path,
+                "cluster": cluster_id,
+                "mode": export.access_type,
+                "squash": export.squash,
+            }
             return (0, json.dumps(result, indent=4), '')
         return 0, "", "Export already exists"
 
-    def update_export(self, new_export):
-        old_export, update_user_caps = self._validate_export(new_export)
-        if update_user_caps:
-            self._update_user_id(new_export['path'], new_export['access_type'],
-                                 new_export['fsal']['fs_name'], new_export['fsal']['user_id'])
-        new_export = Export.from_dict(new_export['export_id'], new_export)
-        new_export.fsal.cephx_key = old_export.fsal.cephx_key
-        self._update_export(new_export)
-        export_ls = self.exports[self.rados_namespace]
-        if old_export not in export_ls:
-            # This happens when export is fetched by ID
-            old_export = self._fetch_export(old_export.pseudo)
-        export_ls.remove(old_export)
+    def _apply_export(
+            self,
+            cluster_id: str,
+            new_export_dict: Dict,
+    ) -> Tuple[int, str, str]:
+        for k in ['path', 'pseudo']:
+            if k not in new_export_dict:
+                raise NFSInvalidOperation(f'Export missing required field {k}')
+        if cluster_id not in available_clusters(self.mgr):
+            raise ClusterNotFound()
+        if cluster_id not in self.exports:
+            self.exports[cluster_id] = []
+
+        new_export_dict['path'] = self.format_path(new_export_dict['path'])
+        new_export_dict['pseudo'] = self.format_path(new_export_dict['pseudo'])
+
+        old_export = self._fetch_export(cluster_id, new_export_dict['pseudo'])
+        if old_export:
+            # Check if export id matches
+            if new_export_dict.get('export_id'):
+                if old_export.export_id != new_export_dict.get('export_id'):
+                    raise NFSInvalidOperation('Export ID changed, Cannot update export')
+            else:
+                new_export_dict['export_id'] = old_export.export_id
+        elif new_export_dict.get('export_id'):
+            old_export = self._fetch_export_obj(cluster_id, new_export_dict['export_id'])
+            if old_export:
+                # re-fetch via old pseudo
+                old_export = self._fetch_export(cluster_id, old_export.pseudo)
+                assert old_export
+                log.debug("export %s pseudo %s -> %s",
+                          old_export.export_id, old_export.pseudo, new_export_dict['pseudo'])
+
+        new_export = self.create_export_from_dict(
+            cluster_id,
+            new_export_dict.get('export_id', self._gen_export_id(cluster_id)),
+            new_export_dict
+        )
+
+        if not old_export:
+            self._create_export_user(new_export)
+            self._save_export(cluster_id, new_export)
+            return 0, f'Added export {new_export.pseudo}', ''
+
+        if old_export.fsal.name != new_export.fsal.name:
+            raise NFSInvalidOperation('FSAL change not allowed')
+        if old_export.pseudo != new_export.pseudo:
+            log.debug('export %s pseudo %s -> %s',
+                      new_export.export_id, old_export.pseudo, new_export.pseudo)
+
+        if old_export.fsal.name == NFS_GANESHA_SUPPORTED_FSALS[0]:
+            old_fsal = cast(CephFSFSAL, old_export.fsal)
+            new_fsal = cast(CephFSFSAL, new_export.fsal)
+            if old_fsal.user_id != new_fsal.user_id:
+                self._delete_export_user(old_export)
+                self._create_export_user(new_export)
+            elif (
+                old_export.path != new_export.path
+                or old_fsal.fs_name != new_fsal.fs_name
+            ):
+                self._update_user_id(
+                    cluster_id,
+                    new_export.path,
+                    new_export.access_type,
+                    cast(str, new_fsal.fs_name),
+                    cast(str, new_fsal.user_id)
+                )
+                new_fsal.cephx_key = old_fsal.cephx_key
+            else:
+                new_fsal.cephx_key = old_fsal.cephx_key
+        if old_export.fsal.name == NFS_GANESHA_SUPPORTED_FSALS[1]:
+            old_rgw_fsal = cast(RGWFSAL, old_export.fsal)
+            new_rgw_fsal = cast(RGWFSAL, new_export.fsal)
+            if old_rgw_fsal.user_id != new_rgw_fsal.user_id:
+                self._delete_export_user(old_export)
+                self._create_export_user(new_export)
+            elif old_rgw_fsal.access_key_id != new_rgw_fsal.access_key_id:
+                raise NFSInvalidOperation('access_key_id change is not allowed')
+            elif old_rgw_fsal.secret_access_key != new_rgw_fsal.secret_access_key:
+                raise NFSInvalidOperation('secret_access_key change is not allowed')
+
+        self.exports[cluster_id].remove(old_export)
+        self._update_export(cluster_id, new_export)
+
+        # TODO: detect whether the update is such that a reload is sufficient
         restart_nfs_service(self.mgr, new_export.cluster_id)
-        return 0, "Successfully updated export", ""
+
+        return 0, f"Updated export {new_export.pseudo}", ""
index 2cfe00f8220b221602158a96220af5d7eddc113a..8733545362eaeb0d77b42a22b14a248953e6f1d1 100644 (file)
@@ -1,33 +1,64 @@
+from typing import cast, List, Dict, Any, Optional, TYPE_CHECKING
+from os.path import isabs
+
+from mgr_module import NFS_GANESHA_SUPPORTED_FSALS
+
+from .exception import NFSInvalidOperation, FSNotFound
+from .utils import check_fs
+
+if TYPE_CHECKING:
+    from nfs.module import Module
+
+
+class RawBlock():
+    def __init__(self, block_name: str, blocks: List['RawBlock'] = [], values: Dict[str, Any] = {}):
+        if not values:  # workaround mutable default argument
+            values = {}
+        if not blocks:  # workaround mutable default argument
+            blocks = []
+        self.block_name = block_name
+        self.blocks = blocks
+        self.values = values
+
+    def __eq__(self, other: Any) -> bool:
+        if not isinstance(other, RawBlock):
+            return False
+        return self.block_name == other.block_name and \
+            self.blocks == other.blocks and \
+            self.values == other.values
+
+    def __repr__(self) -> str:
+        return f'RawBlock({self.block_name!r}, {self.blocks!r}, {self.values!r})'
+
+
 class GaneshaConfParser:
-    def __init__(self, raw_config):
+    def __init__(self, raw_config: str):
         self.pos = 0
         self.text = ""
-        self.clean_config(raw_config)
-
-    def clean_config(self, raw_config):
         for line in raw_config.split("\n"):
-            self.text += line
+            line = line.lstrip()
+
             if line.startswith("%"):
+                self.text += line.replace('"', "")
                 self.text += "\n"
+            else:
+                self.text += "".join(line.split())
 
-    def remove_whitespaces_quotes(self):
-        if self.text.startswith("%url"):
-            self.text = self.text.replace('"', "")
-        else:
-            self.text = "".join(self.text.split())
-
-    def stream(self):
+    def stream(self) -> str:
         return self.text[self.pos:]
 
-    def parse_block_name(self):
+    def last_context(self) -> str:
+        return f'"...{self.text[max(0, self.pos - 30):self.pos]}<here>{self.stream()[:30]}"'
+
+    def parse_block_name(self) -> str:
         idx = self.stream().find('{')
         if idx == -1:
-            raise Exception("Cannot find block name")
+            raise Exception(f"Cannot find block name at {self.last_context()}")
         block_name = self.stream()[:idx]
-        self.pos += idx+1
+        self.pos += idx + 1
         return block_name
 
-    def parse_block_or_section(self):
+    def parse_block_or_section(self) -> RawBlock:
         if self.stream().startswith("%url "):
             # section line
             self.pos += 5
@@ -37,18 +68,18 @@ class GaneshaConfParser:
                 self.pos += len(value)
             else:
                 value = self.stream()[:idx]
-                self.pos += idx+1
-            block_dict = {'block_name': '%url', 'value': value}
+                self.pos += idx + 1
+            block_dict = RawBlock('%url', values={'value': value})
             return block_dict
 
-        block_dict = {'block_name': self.parse_block_name().upper()}
+        block_dict = RawBlock(self.parse_block_name().upper())
         self.parse_block_body(block_dict)
         if self.stream()[0] != '}':
             raise Exception("No closing bracket '}' found at the end of block")
         self.pos += 1
         return block_dict
 
-    def parse_parameter_value(self, raw_value):
+    def parse_parameter_value(self, raw_value: str) -> Any:
         if raw_value.find(',') != -1:
             return [self.parse_parameter_value(v.strip())
                     for v in raw_value.split(',')]
@@ -63,17 +94,17 @@ class GaneshaConfParser:
                 return raw_value[1:-1]
             return raw_value
 
-    def parse_stanza(self, block_dict):
+    def parse_stanza(self, block_dict: RawBlock) -> None:
         equal_idx = self.stream().find('=')
         if equal_idx == -1:
             raise Exception("Malformed stanza: no equal symbol found.")
         semicolon_idx = self.stream().find(';')
         parameter_name = self.stream()[:equal_idx].lower()
-        parameter_value = self.stream()[equal_idx+1:semicolon_idx]
-        block_dict[parameter_name] = self.parse_parameter_value(parameter_value)
-        self.pos += semicolon_idx+1
+        parameter_value = self.stream()[equal_idx + 1:semicolon_idx]
+        block_dict.values[parameter_name] = self.parse_parameter_value(parameter_value)
+        self.pos += semicolon_idx + 1
 
-    def parse_block_body(self, block_dict):
+    def parse_block_body(self, block_dict: RawBlock) -> None:
         while True:
             if self.stream().find('}') == 0:
                 # block end
@@ -88,148 +119,229 @@ class GaneshaConfParser:
 
             if is_semicolon and ((is_lbracket and is_semicolon_lt_lbracket) or not is_lbracket):
                 self.parse_stanza(block_dict)
-            elif is_lbracket and ((is_semicolon and not is_semicolon_lt_lbracket) or
-                                  (not is_semicolon)):
-                if '_blocks_' not in block_dict:
-                    block_dict['_blocks_'] = []
-                block_dict['_blocks_'].append(self.parse_block_or_section())
+            elif is_lbracket and ((is_semicolon and not is_semicolon_lt_lbracket)
+                                  or (not is_semicolon)):
+                block_dict.blocks.append(self.parse_block_or_section())
             else:
                 raise Exception("Malformed stanza: no semicolon found.")
 
             if last_pos == self.pos:
                 raise Exception("Infinite loop while parsing block content")
 
-    def parse(self):
-        self.remove_whitespaces_quotes()
+    def parse(self) -> List[RawBlock]:
         blocks = []
         while self.stream():
             blocks.append(self.parse_block_or_section())
         return blocks
 
     @staticmethod
-    def _indentation(depth, size=4):
+    def _indentation(depth: int, size: int = 4) -> str:
         conf_str = ""
-        for _ in range(0, depth*size):
+        for _ in range(0, depth * size):
             conf_str += " "
         return conf_str
 
     @staticmethod
-    def write_block_body(block, depth=0):
-        def format_val(key, val):
+    def write_block_body(block: RawBlock, depth: int = 0) -> str:
+        def format_val(key: str, val: str) -> str:
             if isinstance(val, list):
                 return ', '.join([format_val(key, v) for v in val])
             if isinstance(val, bool):
                 return str(val).lower()
-            if isinstance(val, int) or (block['block_name'] == 'CLIENT'
+            if isinstance(val, int) or (block.block_name == 'CLIENT'
                                         and key == 'clients'):
                 return '{}'.format(val)
             return '"{}"'.format(val)
 
         conf_str = ""
-        for key, val in block.items():
-            if key == 'block_name':
-                continue
-            elif key == '_blocks_':
-                for blo in val:
-                    conf_str += GaneshaConfParser.write_block(blo, depth)
-            elif val:
+        for blo in block.blocks:
+            conf_str += GaneshaConfParser.write_block(blo, depth)
+
+        for key, val in block.values.items():
+            if val is not None:
                 conf_str += GaneshaConfParser._indentation(depth)
                 conf_str += '{} = {};\n'.format(key, format_val(key, val))
         return conf_str
 
     @staticmethod
-    def write_block(block, depth=0):
-        if block['block_name'] == "%url":
-            return '%url "{}"\n\n'.format(block['value'])
+    def write_block(block: RawBlock, depth: int = 0) -> str:
+        if block.block_name == "%url":
+            return '%url "{}"\n\n'.format(block.values['value'])
 
         conf_str = ""
         conf_str += GaneshaConfParser._indentation(depth)
-        conf_str += format(block['block_name'])
+        conf_str += format(block.block_name)
         conf_str += " {\n"
-        conf_str += GaneshaConfParser.write_block_body(block, depth+1)
+        conf_str += GaneshaConfParser.write_block_body(block, depth + 1)
         conf_str += GaneshaConfParser._indentation(depth)
         conf_str += "}\n"
         return conf_str
 
 
-class CephFSFSal:
-    def __init__(self, name, user_id=None, fs_name=None, sec_label_xattr=None,
-                 cephx_key=None):
+class FSAL(object):
+    def __init__(self, name: str) -> None:
         self.name = name
+
+    @classmethod
+    def from_dict(cls, fsal_dict: Dict[str, Any]) -> 'FSAL':
+        if fsal_dict.get('name') == NFS_GANESHA_SUPPORTED_FSALS[0]:
+            return CephFSFSAL.from_dict(fsal_dict)
+        if fsal_dict.get('name') == NFS_GANESHA_SUPPORTED_FSALS[1]:
+            return RGWFSAL.from_dict(fsal_dict)
+        raise NFSInvalidOperation(f'Unknown FSAL {fsal_dict.get("name")}')
+
+    @classmethod
+    def from_fsal_block(cls, fsal_block: RawBlock) -> 'FSAL':
+        if fsal_block.values.get('name') == NFS_GANESHA_SUPPORTED_FSALS[0]:
+            return CephFSFSAL.from_fsal_block(fsal_block)
+        if fsal_block.values.get('name') == NFS_GANESHA_SUPPORTED_FSALS[1]:
+            return RGWFSAL.from_fsal_block(fsal_block)
+        raise NFSInvalidOperation(f'Unknown FSAL {fsal_block.values.get("name")}')
+
+    def to_fsal_block(self) -> RawBlock:
+        raise NotImplementedError
+
+    def to_dict(self) -> Dict[str, Any]:
+        raise NotImplementedError
+
+
+class CephFSFSAL(FSAL):
+    def __init__(self,
+                 name: str,
+                 user_id: Optional[str] = None,
+                 fs_name: Optional[str] = None,
+                 sec_label_xattr: Optional[str] = None,
+                 cephx_key: Optional[str] = None) -> None:
+        super().__init__(name)
+        assert name == 'CEPH'
         self.fs_name = fs_name
         self.user_id = user_id
         self.sec_label_xattr = sec_label_xattr
         self.cephx_key = cephx_key
 
     @classmethod
-    def from_fsal_block(cls, fsal_block):
-        return cls(fsal_block['name'],
-                   fsal_block.get('user_id', None),
-                   fsal_block.get('filesystem', None),
-                   fsal_block.get('sec_label_xattr', None),
-                   fsal_block.get('secret_access_key', None))
-
-    def to_fsal_block(self):
-        result = {
-            'block_name': 'FSAL',
-            'name': self.name,
-        }
+    def from_fsal_block(cls, fsal_block: RawBlock) -> 'CephFSFSAL':
+        return cls(fsal_block.values['name'],
+                   fsal_block.values.get('user_id'),
+                   fsal_block.values.get('filesystem'),
+                   fsal_block.values.get('sec_label_xattr'),
+                   fsal_block.values.get('secret_access_key'))
+
+    def to_fsal_block(self) -> RawBlock:
+        result = RawBlock('FSAL', values={'name': self.name})
+
         if self.user_id:
-            result['user_id'] = self.user_id
+            result.values['user_id'] = self.user_id
         if self.fs_name:
-            result['filesystem'] = self.fs_name
+            result.values['filesystem'] = self.fs_name
         if self.sec_label_xattr:
-            result['sec_label_xattr'] = self.sec_label_xattr
+            result.values['sec_label_xattr'] = self.sec_label_xattr
         if self.cephx_key:
-            result['secret_access_key'] = self.cephx_key
+            result.values['secret_access_key'] = self.cephx_key
         return result
 
     @classmethod
-    def from_dict(cls, fsal_dict):
-        return cls(fsal_dict['name'], fsal_dict['user_id'],
-                   fsal_dict['fs_name'], fsal_dict['sec_label_xattr'], None)
+    def from_dict(cls, fsal_dict: Dict[str, Any]) -> 'CephFSFSAL':
+        return cls(fsal_dict['name'],
+                   fsal_dict.get('user_id'),
+                   fsal_dict.get('fs_name'),
+                   fsal_dict.get('sec_label_xattr'),
+                   fsal_dict.get('cephx_key'))
+
+    def to_dict(self) -> Dict[str, str]:
+        r = {'name': self.name}
+        if self.user_id:
+            r['user_id'] = self.user_id
+        if self.fs_name:
+            r['fs_name'] = self.fs_name
+        if self.sec_label_xattr:
+            r['sec_label_xattr'] = self.sec_label_xattr
+        return r
+
+
+class RGWFSAL(FSAL):
+    def __init__(self,
+                 name: str,
+                 user_id: Optional[str] = None,
+                 access_key_id: Optional[str] = None,
+                 secret_access_key: Optional[str] = None
+                 ) -> None:
+        super().__init__(name)
+        assert name == 'RGW'
+        # RGW user uid
+        self.user_id = user_id
+        # S3 credentials
+        self.access_key_id = access_key_id
+        self.secret_access_key = secret_access_key
 
-    def to_dict(self):
-        return {
-            'name': self.name,
-            'user_id': self.user_id,
-            'fs_name': self.fs_name,
-            'sec_label_xattr': self.sec_label_xattr
-        }
+    @classmethod
+    def from_fsal_block(cls, fsal_block: RawBlock) -> 'RGWFSAL':
+        return cls(fsal_block.values['name'],
+                   fsal_block.values.get('user_id'),
+                   fsal_block.values.get('access_key_id'),
+                   fsal_block.values.get('secret_access_key'))
+
+    def to_fsal_block(self) -> RawBlock:
+        result = RawBlock('FSAL', values={'name': self.name})
+
+        if self.user_id:
+            result.values['user_id'] = self.user_id
+        if self.access_key_id:
+            result.values['access_key_id'] = self.access_key_id
+        if self.secret_access_key:
+            result.values['secret_access_key'] = self.secret_access_key
+        return result
+
+    @classmethod
+    def from_dict(cls, fsal_dict: Dict[str, str]) -> 'RGWFSAL':
+        return cls(fsal_dict['name'],
+                   fsal_dict.get('user_id'),
+                   fsal_dict.get('access_key_id'),
+                   fsal_dict.get('secret_access_key'))
+
+    def to_dict(self) -> Dict[str, str]:
+        r = {'name': self.name}
+        if self.user_id:
+            r['user_id'] = self.user_id
+        if self.access_key_id:
+            r['access_key_id'] = self.access_key_id
+        if self.secret_access_key:
+            r['secret_access_key'] = self.secret_access_key
+        return r
 
 
 class Client:
-    def __init__(self, addresses, access_type=None, squash=None):
+    def __init__(self,
+                 addresses: List[str],
+                 access_type: str,
+                 squash: str):
         self.addresses = addresses
         self.access_type = access_type
         self.squash = squash
 
     @classmethod
-    def from_client_block(cls, client_block):
-        addresses = client_block['clients']
-        if not isinstance(addresses, list):
+    def from_client_block(cls, client_block: RawBlock) -> 'Client':
+        addresses = client_block.values.get('clients', [])
+        if isinstance(addresses, str):
             addresses = [addresses]
         return cls(addresses,
-                   client_block.get('access_type', None),
-                   client_block.get('squash', None))
+                   client_block.values.get('access_type', None),
+                   client_block.values.get('squash', None))
 
-    def to_client_block(self):
-        result = {
-            'block_name': 'CLIENT',
-            'clients': self.addresses,
-        }
+    def to_client_block(self) -> RawBlock:
+        result = RawBlock('CLIENT', values={'clients': self.addresses})
         if self.access_type:
-            result['access_type'] = self.access_type
+            result.values['access_type'] = self.access_type
         if self.squash:
-            result['squash'] = self.squash
+            result.values['squash'] = self.squash
         return result
 
     @classmethod
-    def from_dict(cls, client_dict):
+    def from_dict(cls, client_dict: Dict[str, Any]) -> 'Client':
         return cls(client_dict['addresses'], client_dict['access_type'],
                    client_dict['squash'])
 
-    def to_dict(self):
+    def to_dict(self) -> Dict[str, Any]:
         return {
             'addresses': self.addresses,
             'access_type': self.access_type,
@@ -238,8 +350,19 @@ class Client:
 
 
 class Export:
-    def __init__(self, export_id, path, cluster_id, pseudo, access_type, squash, security_label,
-            protocols, transports, fsal, clients=None):
+    def __init__(
+            self,
+            export_id: int,
+            path: str,
+            cluster_id: str,
+            pseudo: str,
+            access_type: str,
+            squash: str,
+            security_label: bool,
+            protocols: List[int],
+            transports: List[str],
+            fsal: FSAL,
+            clients: Optional[List[Client]] = None) -> None:
         self.export_id = export_id
         self.path = path
         self.fsal = fsal
@@ -251,40 +374,41 @@ class Export:
         self.security_label = security_label
         self.protocols = protocols
         self.transports = transports
-        self.clients = clients
+        self.clients: List[Client] = clients or []
 
     @classmethod
-    def from_export_block(cls, export_block, cluster_id):
-        fsal_block = [b for b in export_block['_blocks_']
-                      if b['block_name'] == "FSAL"]
+    def from_export_block(cls, export_block: RawBlock, cluster_id: str) -> 'Export':
+        fsal_blocks = [b for b in export_block.blocks
+                       if b.block_name == "FSAL"]
 
-        client_blocks = [b for b in export_block['_blocks_']
-                         if b['block_name'] == "CLIENT"]
+        client_blocks = [b for b in export_block.blocks
+                         if b.block_name == "CLIENT"]
 
-        protocols = export_block.get('protocols')
+        protocols = export_block.values.get('protocols')
         if not isinstance(protocols, list):
             protocols = [protocols]
 
-        transports = export_block.get('transports')
-        if not isinstance(transports, list):
+        transports = export_block.values.get('transports')
+        if isinstance(transports, str):
             transports = [transports]
+        elif not transports:
+            transports = []
 
-        return cls(export_block['export_id'],
-                   export_block['path'],
+        return cls(export_block.values['export_id'],
+                   export_block.values['path'],
                    cluster_id,
-                   export_block['pseudo'],
-                   export_block['access_type'],
-                   export_block['squash'],
-                   export_block['security_label'],
+                   export_block.values['pseudo'],
+                   export_block.values.get('access_type', 'none'),
+                   export_block.values.get('squash', 'no_root_squash'),
+                   export_block.values.get('security_label', True),
                    protocols,
                    transports,
-                   CephFSFSal.from_fsal_block(fsal_block[0]),
+                   FSAL.from_fsal_block(fsal_blocks[0]),
                    [Client.from_client_block(client)
                     for client in client_blocks])
 
-    def to_export_block(self):
-        result = {
-            'block_name': 'EXPORT',
+    def to_export_block(self) -> RawBlock:
+        result = RawBlock('EXPORT', values={
             'export_id': self.export_id,
             'path': self.path,
             'pseudo': self.pseudo,
@@ -294,27 +418,30 @@ class Export:
             'security_label': self.security_label,
             'protocols': self.protocols,
             'transports': self.transports,
-        }
-        result['_blocks_'] = [self.fsal.to_fsal_block()]
-        result['_blocks_'].extend([client.to_client_block()
-                                   for client in self.clients])
+        })
+        result.blocks = [
+            self.fsal.to_fsal_block()
+        ] + [
+            client.to_client_block()
+            for client in self.clients
+        ]
         return result
 
     @classmethod
-    def from_dict(cls, export_id, ex_dict):
+    def from_dict(cls, export_id: int, ex_dict: Dict[str, Any]) -> 'Export':
         return cls(export_id,
-                   ex_dict['path'],
+                   ex_dict.get('path', '/'),
                    ex_dict['cluster_id'],
                    ex_dict['pseudo'],
-                   ex_dict.get('access_type', 'R'),
+                   ex_dict.get('access_type', 'RO'),
                    ex_dict.get('squash', 'no_root_squash'),
                    ex_dict.get('security_label', True),
                    ex_dict.get('protocols', [4]),
                    ex_dict.get('transports', ['TCP']),
-                   CephFSFSal.from_dict(ex_dict['fsal']),
-                   [Client.from_dict(client) for client in ex_dict['clients']])
+                   FSAL.from_dict(ex_dict.get('fsal', {})),
+                   [Client.from_dict(client) for client in ex_dict.get('clients', [])])
 
-    def to_dict(self):
+    def to_dict(self) -> Dict[str, Any]:
         return {
             'export_id': self.export_id,
             'path': self.path,
@@ -328,3 +455,67 @@ class Export:
             'fsal': self.fsal.to_dict(),
             'clients': [client.to_dict() for client in self.clients]
         }
+
+    @staticmethod
+    def validate_access_type(access_type: str) -> None:
+        valid_access_types = ['rw', 'ro', 'none']
+        if not isinstance(access_type, str) or access_type.lower() not in valid_access_types:
+            raise NFSInvalidOperation(
+                f'{access_type} is invalid, valid access type are'
+                f'{valid_access_types}'
+            )
+
+    @staticmethod
+    def validate_squash(squash: str) -> None:
+        valid_squash_ls = [
+            "root", "root_squash", "rootsquash", "rootid", "root_id_squash",
+            "rootidsquash", "all", "all_squash", "allsquash", "all_anomnymous",
+            "allanonymous", "no_root_squash", "none", "noidsquash",
+        ]
+        if squash.lower() not in valid_squash_ls:
+            raise NFSInvalidOperation(
+                f"squash {squash} not in valid list {valid_squash_ls}"
+            )
+
+    def validate(self, mgr: 'Module') -> None:
+        if not isabs(self.pseudo) or self.pseudo == "/":
+            raise NFSInvalidOperation(
+                f"pseudo path {self.pseudo} is invalid. It should be an absolute "
+                "path and it cannot be just '/'."
+            )
+
+        self.validate_squash(self.squash)
+        self.validate_access_type(self.access_type)
+
+        if not isinstance(self.security_label, bool):
+            raise NFSInvalidOperation('security_label must be a boolean value')
+
+        for p in self.protocols:
+            if p not in [3, 4]:
+                raise NFSInvalidOperation(f"Invalid protocol {p}")
+
+        valid_transport = ["UDP", "TCP"]
+        for trans in self.transports:
+            if trans.upper() not in valid_transport:
+                raise NFSInvalidOperation(f'{trans} is not a valid transport protocol')
+
+        for client in self.clients:
+            if client.squash:
+                self.validate_squash(client.squash)
+            if client.access_type:
+                self.validate_access_type(client.access_type)
+
+        if self.fsal.name == NFS_GANESHA_SUPPORTED_FSALS[0]:
+            fs = cast(CephFSFSAL, self.fsal)
+            if not fs.fs_name or not check_fs(mgr, fs.fs_name):
+                raise FSNotFound(fs.fs_name)
+        elif self.fsal.name == NFS_GANESHA_SUPPORTED_FSALS[1]:
+            rgw = cast(RGWFSAL, self.fsal)  # noqa
+            pass
+        else:
+            raise NFSInvalidOperation('FSAL {self.fsal.name} not supported')
+
+    def __eq__(self, other: Any) -> bool:
+        if not isinstance(other, Export):
+            return False
+        return self.to_dict() == other.to_dict()
index e32c7d30b1b55c35b5feeefbc822a1b40c05cecf..403f89f3a97367061a5d9cbc1624773b84a9cec5 100644 (file)
@@ -1,12 +1,13 @@
 import logging
 import threading
-from typing import Tuple, Optional, List
+from typing import Tuple, Optional, List, Dict, Any
 
 from mgr_module import MgrModule, CLICommand, Option, CLICheckNonemptyFileInput
 import orchestrator
 
 from .export import ExportMgr
 from .cluster import NFSCluster
+from .utils import available_clusters
 
 log = logging.getLogger(__name__)
 
@@ -14,7 +15,7 @@ log = logging.getLogger(__name__)
 class Module(orchestrator.OrchestratorClientMixin, MgrModule):
     MODULE_OPTIONS: List[Option] = []
 
-    def __init__(self, *args, **kwargs):
+    def __init__(self, *args: str, **kwargs: Any) -> None:
         self.inited = False
         self.lock = threading.Lock()
         super(Module, self).__init__(*args, **kwargs)
@@ -24,64 +25,92 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
             self.inited = True
 
     @CLICommand('nfs export create cephfs', perm='rw')
-    def _cmd_nfs_export_create_cephfs(self,
-                                      fsname: str,
-                                      clusterid: str,
-                                      binding: str,
-                                      readonly: bool = False,
-                                      path: str = '/') -> Tuple[int, str, str]:
-        """Create a cephfs export"""
-        # TODO Extend export creation for rgw.
+    def _cmd_nfs_export_create_cephfs(
+            self,
+            cluster_id: str,
+            pseudo_path: str,
+            fsname: str,
+            path: Optional[str] = '/',
+            readonly: Optional[bool] = False,
+            client_addr: Optional[List[str]] = None,
+            squash: str = 'none',
+    ) -> Tuple[int, str, str]:
+        """Create a CephFS export"""
         return self.export_mgr.create_export(fsal_type='cephfs', fs_name=fsname,
-                                             cluster_id=clusterid, pseudo_path=binding,
-                                             read_only=readonly, path=path)
+                                             cluster_id=cluster_id, pseudo_path=pseudo_path,
+                                             read_only=readonly, path=path,
+                                             squash=squash, addr=client_addr)
+
+    @CLICommand('nfs export create rgw', perm='rw')
+    def _cmd_nfs_export_create_rgw(
+            self,
+            cluster_id: str,
+            pseudo_path: str,
+            bucket: Optional[str] = None,
+            user_id: Optional[str] = None,
+            readonly: Optional[bool] = False,
+            client_addr: Optional[List[str]] = None,
+            squash: str = 'none',
+    ) -> Tuple[int, str, str]:
+        """Create an RGW export"""
+        return self.export_mgr.create_export(fsal_type='rgw', bucket=bucket,
+                                             user_id=user_id,
+                                             cluster_id=cluster_id, pseudo_path=pseudo_path,
+                                             read_only=readonly, squash=squash,
+                                             addr=client_addr)
 
     @CLICommand('nfs export rm', perm='rw')
-    def _cmd_nfs_export_rm(self, clusterid: str, binding: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_export_rm(self, cluster_id: str, pseudo_path: str) -> Tuple[int, str, str]:
         """Remove a cephfs export"""
-        return self.export_mgr.delete_export(cluster_id=clusterid, pseudo_path=binding)
+        return self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
 
     @CLICommand('nfs export delete', perm='rw')
-    def _cmd_nfs_export_delete(self, clusterid: str, binding: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_export_delete(self, cluster_id: str, pseudo_path: str) -> Tuple[int, str, str]:
         """Delete a cephfs export (DEPRECATED)"""
-        return self.export_mgr.delete_export(cluster_id=clusterid, pseudo_path=binding)
+        return self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
 
     @CLICommand('nfs export ls', perm='r')
-    def _cmd_nfs_export_ls(self, clusterid: str, detailed: bool = False) -> Tuple[int, str, str]:
+    def _cmd_nfs_export_ls(self, cluster_id: str, detailed: bool = False) -> Tuple[int, str, str]:
         """List exports of a NFS cluster"""
-        return self.export_mgr.list_exports(cluster_id=clusterid, detailed=detailed)
+        return self.export_mgr.list_exports(cluster_id=cluster_id, detailed=detailed)
 
-    @CLICommand('nfs export get', perm='r')
-    def _cmd_nfs_export_get(self, clusterid: str, binding: str) -> Tuple[int, str, str]:
+    @CLICommand('nfs export info', perm='r')
+    def _cmd_nfs_export_info(self, cluster_id: str, pseudo_path: str) -> Tuple[int, str, str]:
         """Fetch a export of a NFS cluster given the pseudo path/binding"""
-        return self.export_mgr.get_export(cluster_id=clusterid, pseudo_path=binding)
+        return self.export_mgr.get_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
+
+    @CLICommand('nfs export get', perm='r')
+    def _cmd_nfs_export_get(self, cluster_id: str, pseudo_path: str) -> Tuple[int, str, str]:
+        """Fetch a export of a NFS cluster given the pseudo path/binding (DEPRECATED)"""
+        return self.export_mgr.get_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
 
-    @CLICommand('nfs export update', perm='rw')
-    @CLICheckNonemptyFileInput(desc='CephFS Export configuration')
-    def _cmd_nfs_export_update(self, inbuf: str) -> Tuple[int, str, str]:
-        """Update an export of a NFS cluster by `-i <json_file>`"""
-        # The export <json_file> is passed to -i and it's processing is handled by the Ceph CLI.
-        return self.export_mgr.update_export(export_config=inbuf)
+    @CLICommand('nfs export apply', perm='rw')
+    @CLICheckNonemptyFileInput(desc='Export JSON or Ganesha EXPORT specification')
+    def _cmd_nfs_export_apply(self, cluster_id: str, inbuf: str) -> Tuple[int, str, str]:
+        """Create or update an export by `-i <json_or_ganesha_export_file>`"""
+        return self.export_mgr.apply_export(cluster_id, export_config=inbuf)
 
     @CLICommand('nfs cluster create', perm='rw')
     def _cmd_nfs_cluster_create(self,
-                                clusterid: str,
-                                placement: Optional[str]=None,
-                                ingress: Optional[bool]=None,
-                                virtual_ip: Optional[str]=None) -> Tuple[int, str, str]:
+                                cluster_id: str,
+                                placement: Optional[str] = None,
+                                ingress: Optional[bool] = None,
+                                virtual_ip: Optional[str] = None,
+                                port: Optional[int] = None) -> Tuple[int, str, str]:
         """Create an NFS Cluster"""
-        return self.nfs.create_nfs_cluster(cluster_id=clusterid, placement=placement,
-                                           virtual_ip=virtual_ip, ingress=ingress)
+        return self.nfs.create_nfs_cluster(cluster_id=cluster_id, placement=placement,
+                                           virtual_ip=virtual_ip, ingress=ingress,
+                                           port=port)
 
     @CLICommand('nfs cluster rm', perm='rw')
-    def _cmd_nfs_cluster_rm(self, clusterid: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_rm(self, cluster_id: str) -> Tuple[int, str, str]:
         """Removes an NFS Cluster"""
-        return self.nfs.delete_nfs_cluster(cluster_id=clusterid)
+        return self.nfs.delete_nfs_cluster(cluster_id=cluster_id)
 
     @CLICommand('nfs cluster delete', perm='rw')
-    def _cmd_nfs_cluster_delete(self, clusterid: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_delete(self, cluster_id: str) -> Tuple[int, str, str]:
         """Removes an NFS Cluster (DEPRECATED)"""
-        return self.nfs.delete_nfs_cluster(cluster_id=clusterid)
+        return self.nfs.delete_nfs_cluster(cluster_id=cluster_id)
 
     @CLICommand('nfs cluster ls', perm='r')
     def _cmd_nfs_cluster_ls(self) -> Tuple[int, str, str]:
@@ -89,17 +118,37 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return self.nfs.list_nfs_cluster()
 
     @CLICommand('nfs cluster info', perm='r')
-    def _cmd_nfs_cluster_info(self, clusterid: Optional[str] = None) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_info(self, cluster_id: Optional[str] = None) -> Tuple[int, str, str]:
         """Displays NFS Cluster info"""
-        return self.nfs.show_nfs_cluster_info(cluster_id=clusterid)
+        return self.nfs.show_nfs_cluster_info(cluster_id=cluster_id)
+
+    @CLICommand('nfs cluster config get', perm='r')
+    def _cmd_nfs_cluster_config_get(self, cluster_id: str) -> Tuple[int, str, str]:
+        """Fetch NFS-Ganesha config"""
+        return self.nfs.get_nfs_cluster_config(cluster_id=cluster_id)
 
     @CLICommand('nfs cluster config set', perm='rw')
     @CLICheckNonemptyFileInput(desc='NFS-Ganesha Configuration')
-    def _cmd_nfs_cluster_config_set(self, clusterid: str, inbuf: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_config_set(self, cluster_id: str, inbuf: str) -> Tuple[int, str, str]:
         """Set NFS-Ganesha config by `-i <config_file>`"""
-        return self.nfs.set_nfs_cluster_config(cluster_id=clusterid, nfs_config=inbuf)
+        return self.nfs.set_nfs_cluster_config(cluster_id=cluster_id, nfs_config=inbuf)
 
     @CLICommand('nfs cluster config reset', perm='rw')
-    def _cmd_nfs_cluster_config_reset(self, clusterid: str) -> Tuple[int, str, str]:
+    def _cmd_nfs_cluster_config_reset(self, cluster_id: str) -> Tuple[int, str, str]:
         """Reset NFS-Ganesha Config to default"""
-        return self.nfs.reset_nfs_cluster_config(cluster_id=clusterid)
+        return self.nfs.reset_nfs_cluster_config(cluster_id=cluster_id)
+
+    def fetch_nfs_export_obj(self) -> ExportMgr:
+        return self.export_mgr
+
+    def export_ls(self) -> List[Dict[Any, Any]]:
+        return self.export_mgr.list_all_exports()
+
+    def export_get(self, cluster_id: str, export_id: int) -> Optional[Dict[str, Any]]:
+        return self.export_mgr.get_export_by_id(cluster_id, export_id)
+
+    def export_rm(self, cluster_id: str, pseudo: str) -> None:
+        self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo)
+
+    def cluster_ls(self) -> List[str]:
+        return available_clusters(self)
diff --git a/ceph/src/pybind/mgr/nfs/tests/__init__.py b/ceph/src/pybind/mgr/nfs/tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ceph/src/pybind/mgr/nfs/tests/test_nfs.py b/ceph/src/pybind/mgr/nfs/tests/test_nfs.py
new file mode 100644 (file)
index 0000000..4688679
--- /dev/null
@@ -0,0 +1,1020 @@
+# flake8: noqa
+import json
+import pytest
+from typing import Optional, Tuple, Iterator, List, Any
+
+from contextlib import contextmanager
+from unittest import mock
+from unittest.mock import MagicMock
+from mgr_module import MgrModule, NFS_POOL_NAME
+
+from rados import ObjectNotFound
+
+from ceph.deployment.service_spec import NFSServiceSpec
+from nfs import Module
+from nfs.export import ExportMgr
+from nfs.export_utils import GaneshaConfParser, Export, RawBlock
+from nfs.cluster import NFSCluster
+from orchestrator import ServiceDescription, DaemonDescription, OrchResult
+
+
+class TestNFS:
+    cluster_id = "foo"
+    export_1 = """
+EXPORT {
+    Export_ID=1;
+    Protocols = 4;
+    Path = /;
+    Pseudo = /cephfs_a/;
+    Access_Type = RW;
+    Protocols = 4;
+    Attr_Expiration_Time = 0;
+    # Squash = root;
+
+    FSAL {
+        Name = CEPH;
+        Filesystem = "a";
+        User_Id = "ganesha";
+        # Secret_Access_Key = "YOUR SECRET KEY HERE";
+    }
+
+    CLIENT
+    {
+        Clients = 192.168.0.10, 192.168.1.0/8;
+        Squash = None;
+    }
+
+    CLIENT
+    {
+        Clients = 192.168.0.0/16;
+        Squash = All;
+        Access_Type = RO;
+    }
+}
+"""
+
+    export_2 = """
+EXPORT
+{
+    Export_ID=2;
+    Path = "/";
+    Pseudo = "/rgw";
+    Access_Type = RW;
+    squash = AllAnonymous;
+    Protocols = 4, 3;
+    Transports = TCP, UDP;
+
+    FSAL {
+        Name = RGW;
+        User_Id = "nfs.foo.bucket";
+        Access_Key_Id ="the_access_key";
+        Secret_Access_Key = "the_secret_key";
+    }
+}
+"""
+    export_3 = """
+EXPORT {
+    FSAL {
+        name = "CEPH";
+        user_id = "nfs.foo.1";
+        filesystem = "a";
+        secret_access_key = "AQCjU+hgjyReLBAAddJa0Dza/ZHqjX5+JiePMA==";
+    }
+    export_id = 1;
+    path = "/";
+    pseudo = "/a";
+    access_type = "RW";
+    squash = "none";
+    attr_expiration_time = 0;
+    security_label = true;
+    protocols = 4;
+    transports = "TCP";
+}
+"""
+
+    conf_nfs_foo = f'''
+%url "rados://{NFS_POOL_NAME}/{cluster_id}/export-1"
+
+%url "rados://{NFS_POOL_NAME}/{cluster_id}/export-2"'''
+
+    class RObject(object):
+        def __init__(self, key: str, raw: str) -> None:
+            self.key = key
+            self.raw = raw
+
+        def read(self, _: Optional[int]) -> bytes:
+            return self.raw.encode('utf-8')
+
+        def stat(self) -> Tuple[int, None]:
+            return len(self.raw), None
+
+    def _ioctx_write_full_mock(self, key: str, content: bytes) -> None:
+        if key not in self.temp_store[self.temp_store_namespace]:
+            self.temp_store[self.temp_store_namespace][key] = \
+                TestNFS.RObject(key, content.decode('utf-8'))
+        else:
+            self.temp_store[self.temp_store_namespace][key].raw = content.decode('utf-8')
+
+    def _ioctx_remove_mock(self, key: str) -> None:
+        del self.temp_store[self.temp_store_namespace][key]
+
+    def _ioctx_list_objects_mock(self) -> List['TestNFS.RObject']:
+        r = [obj for _, obj in self.temp_store[self.temp_store_namespace].items()]
+        return r
+
+    def _ioctl_stat_mock(self, key):
+        return self.temp_store[self.temp_store_namespace][key].stat()
+
+    def _ioctl_read_mock(self, key: str, size: Optional[Any] = None) -> bytes:
+        if key not in self.temp_store[self.temp_store_namespace]:
+            raise ObjectNotFound
+        return self.temp_store[self.temp_store_namespace][key].read(size)
+
+    def _ioctx_set_namespace_mock(self, namespace: str) -> None:
+        self.temp_store_namespace = namespace
+
+    def _reset_temp_store(self) -> None:
+        self.temp_store_namespace = None
+        self.temp_store = {
+            'foo': {
+                'export-1': TestNFS.RObject("export-1", self.export_1),
+                'export-2': TestNFS.RObject("export-2", self.export_2),
+                'conf-nfs.foo': TestNFS.RObject("conf-nfs.foo", self.conf_nfs_foo)
+            }
+        }
+
+    @contextmanager
+    def _mock_orchestrator(self, enable: bool) -> Iterator:
+        self.io_mock = MagicMock()
+        self.io_mock.set_namespace.side_effect = self._ioctx_set_namespace_mock
+        self.io_mock.read = self._ioctl_read_mock
+        self.io_mock.stat = self._ioctl_stat_mock
+        self.io_mock.list_objects.side_effect = self._ioctx_list_objects_mock
+        self.io_mock.write_full.side_effect = self._ioctx_write_full_mock
+        self.io_mock.remove_object.side_effect = self._ioctx_remove_mock
+
+        # mock nfs services
+        orch_nfs_services = [
+            ServiceDescription(spec=NFSServiceSpec(service_id=self.cluster_id))
+        ] if enable else []
+
+        orch_nfs_daemons = [
+            DaemonDescription('nfs', 'foo.mydaemon', 'myhostname')
+        ] if enable else []
+
+        def mock_exec(cls, args):
+            if args[1:3] == ['bucket', 'stats']:
+                bucket_info = {
+                    "owner": "bucket_owner_user",
+                }
+                return 0, json.dumps(bucket_info), ''
+            u = {
+                "user_id": "abc",
+                "display_name": "foo",
+                "email": "",
+                "suspended": 0,
+                "max_buckets": 1000,
+                "subusers": [],
+                "keys": [
+                    {
+                        "user": "abc",
+                        "access_key": "the_access_key",
+                        "secret_key": "the_secret_key"
+                    }
+                ],
+                "swift_keys": [],
+                "caps": [],
+                "op_mask": "read, write, delete",
+                "default_placement": "",
+                "default_storage_class": "",
+                "placement_tags": [],
+                "bucket_quota": {
+                    "enabled": False,
+                    "check_on_raw": False,
+                    "max_size": -1,
+                    "max_size_kb": 0,
+                    "max_objects": -1
+                },
+                "user_quota": {
+                    "enabled": False,
+                    "check_on_raw": False,
+                    "max_size": -1,
+                    "max_size_kb": 0,
+                    "max_objects": -1
+                },
+                "temp_url_keys": [],
+                "type": "rgw",
+                "mfa_ids": []
+            }
+            if args[2] == 'list':
+                return 0, json.dumps([u]), ''
+            return 0, json.dumps(u), ''
+
+        def mock_describe_service(cls, *args, **kwargs):
+            if kwargs['service_type'] == 'nfs':
+                return OrchResult(orch_nfs_services)
+            return OrchResult([])
+
+        def mock_list_daemons(cls, *args, **kwargs):
+            if kwargs['daemon_type'] == 'nfs':
+                return OrchResult(orch_nfs_daemons)
+            return OrchResult([])
+
+        with mock.patch('nfs.module.Module.describe_service', mock_describe_service) as describe_service, \
+             mock.patch('nfs.module.Module.list_daemons', mock_list_daemons) as list_daemons, \
+                mock.patch('nfs.module.Module.rados') as rados, \
+                mock.patch('nfs.export.available_clusters',
+                           return_value=[self.cluster_id]), \
+                mock.patch('nfs.export.restart_nfs_service'), \
+                mock.patch('nfs.cluster.restart_nfs_service'), \
+                mock.patch.object(MgrModule, 'tool_exec', mock_exec), \
+                mock.patch('nfs.export.check_fs', return_value=True), \
+                mock.patch('nfs.export_utils.check_fs', return_value=True), \
+                mock.patch('nfs.export.ExportMgr._create_user_key',
+                           return_value='thekeyforclientabc'):
+
+            rados.open_ioctx.return_value.__enter__.return_value = self.io_mock
+            rados.open_ioctx.return_value.__exit__ = mock.Mock(return_value=None)
+
+            self._reset_temp_store()
+
+            yield
+
+    def test_parse_daemon_raw_config(self) -> None:
+        expected_daemon_config = [
+            RawBlock('NFS_CORE_PARAM', values={
+                "enable_nlm": False,
+                "enable_rquota": False,
+                "protocols": 4,
+                "nfs_port": 14000
+            }),
+            RawBlock('MDCACHE', values={
+                "dir_chunk": 0
+            }),
+            RawBlock('NFSV4', values={
+                "recoverybackend": "rados_cluster",
+                "minor_versions": [1, 2]
+            }),
+            RawBlock('RADOS_KV', values={
+                "pool": NFS_POOL_NAME,
+                "namespace": "vstart",
+                "userid": "vstart",
+                "nodeid": "a"
+            }),
+            RawBlock('RADOS_URLS', values={
+                "userid": "vstart",
+                "watch_url": f"'rados://{NFS_POOL_NAME}/vstart/conf-nfs.vstart'"
+            }),
+            RawBlock('%url', values={
+                "value": f"rados://{NFS_POOL_NAME}/vstart/conf-nfs.vstart"
+            })
+        ]
+        daemon_raw_config = """
+NFS_CORE_PARAM {
+            Enable_NLM = false;
+            Enable_RQUOTA = false;
+            Protocols = 4;
+            NFS_Port = 14000;
+        }
+
+        MDCACHE {
+           Dir_Chunk = 0;
+        }
+
+        NFSv4 {
+           RecoveryBackend = rados_cluster;
+           Minor_Versions = 1, 2;
+        }
+
+        RADOS_KV {
+           pool = {};
+           namespace = vstart;
+           UserId = vstart;
+           nodeid = a;
+        }
+
+        RADOS_URLS {
+       Userid = vstart;
+       watch_url = 'rados://{}/vstart/conf-nfs.vstart';
+        }
+
+    %url rados://{}/vstart/conf-nfs.vstart
+""".replace('{}', NFS_POOL_NAME)
+        daemon_config = GaneshaConfParser(daemon_raw_config).parse()
+        assert daemon_config == expected_daemon_config
+
+    def _validate_export_1(self, export: Export):
+        assert export.export_id == 1
+        assert export.path == "/"
+        assert export.pseudo == "/cephfs_a/"
+        assert export.access_type == "RW"
+        # assert export.squash == "root_squash"  # probably correct value
+        assert export.squash == "no_root_squash"
+        assert export.protocols == [4]
+        #        assert export.transports == {"TCP", "UDP"}
+        assert export.fsal.name == "CEPH"
+        assert export.fsal.user_id == "ganesha"
+        assert export.fsal.fs_name == "a"
+        assert export.fsal.sec_label_xattr == None
+        assert len(export.clients) == 2
+        assert export.clients[0].addresses == \
+            ["192.168.0.10", "192.168.1.0/8"]
+        # assert export.clients[0].squash ==  "no_root_squash"  # probably correct value
+        assert export.clients[0].squash == "None"
+        assert export.clients[0].access_type is None
+        assert export.clients[1].addresses == ["192.168.0.0/16"]
+        # assert export.clients[1].squash ==  "all_squash"  # probably correct value
+        assert export.clients[1].squash == "All"
+        assert export.clients[1].access_type == "RO"
+        assert export.cluster_id == 'foo'
+        assert export.attr_expiration_time == 0
+        # assert export.security_label == False  # probably correct value
+        assert export.security_label == True
+
+    def test_export_parser_1(self) -> None:
+        blocks = GaneshaConfParser(self.export_1).parse()
+        assert isinstance(blocks, list)
+        assert len(blocks) == 1
+        export = Export.from_export_block(blocks[0], self.cluster_id)
+        self._validate_export_1(export)
+
+    def _validate_export_2(self, export: Export):
+        assert export.export_id == 2
+        assert export.path == "/"
+        assert export.pseudo == "/rgw"
+        assert export.access_type == "RW"
+        # assert export.squash == "all_squash"  # probably correct value
+        assert export.squash == "AllAnonymous"
+        assert export.protocols == [4, 3]
+        assert set(export.transports) == {"TCP", "UDP"}
+        assert export.fsal.name == "RGW"
+        assert export.fsal.user_id == "nfs.foo.bucket"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 0
+        assert export.cluster_id == 'foo'
+
+    def test_export_parser_2(self) -> None:
+        blocks = GaneshaConfParser(self.export_2).parse()
+        assert isinstance(blocks, list)
+        assert len(blocks) == 1
+        export = Export.from_export_block(blocks[0], self.cluster_id)
+        self._validate_export_2(export)
+
+    def test_daemon_conf_parser(self) -> None:
+        blocks = GaneshaConfParser(self.conf_nfs_foo).parse()
+        assert isinstance(blocks, list)
+        assert len(blocks) == 2
+        assert blocks[0].block_name == "%url"
+        assert blocks[0].values['value'] == f"rados://{NFS_POOL_NAME}/{self.cluster_id}/export-1"
+        assert blocks[1].block_name == "%url"
+        assert blocks[1].values['value'] == f"rados://{NFS_POOL_NAME}/{self.cluster_id}/export-2"
+
+    def _do_mock_test(self, func) -> None:
+        with self._mock_orchestrator(True):
+            func()
+            self._reset_temp_store()
+
+    def test_ganesha_conf(self) -> None:
+        self._do_mock_test(self._do_test_ganesha_conf)
+
+    def _do_test_ganesha_conf(self) -> None:
+        nfs_mod = Module('nfs', '', '')
+        ganesha_conf = ExportMgr(nfs_mod)
+        exports = ganesha_conf.exports[self.cluster_id]
+
+        assert len(exports) == 2
+
+        self._validate_export_1([e for e in exports if e.export_id == 1][0])
+        self._validate_export_2([e for e in exports if e.export_id == 2][0])
+
+    def test_config_dict(self) -> None:
+        self._do_mock_test(self._do_test_config_dict)
+
+    def _do_test_config_dict(self) -> None:
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+        export = [e for e in conf.exports['foo'] if e.export_id == 1][0]
+        ex_dict = export.to_dict()
+
+        assert ex_dict == {'access_type': 'RW',
+                           'clients': [{'access_type': None,
+                                        'addresses': ['192.168.0.10', '192.168.1.0/8'],
+                                        'squash': 'None'},
+                                       {'access_type': 'RO',
+                                        'addresses': ['192.168.0.0/16'],
+                                        'squash': 'All'}],
+                           'cluster_id': self.cluster_id,
+                           'export_id': 1,
+                           'fsal': {'fs_name': 'a', 'name': 'CEPH', 'user_id': 'ganesha'},
+                           'path': '/',
+                           'protocols': [4],
+                           'pseudo': '/cephfs_a/',
+                           'security_label': True,
+                           'squash': 'no_root_squash',
+                           'transports': []}
+
+        export = [e for e in conf.exports['foo'] if e.export_id == 2][0]
+        ex_dict = export.to_dict()
+        assert ex_dict == {'access_type': 'RW',
+                           'clients': [],
+                           'cluster_id': self.cluster_id,
+                           'export_id': 2,
+                           'fsal': {'name': 'RGW',
+                                    'access_key_id': 'the_access_key',
+                                    'secret_access_key': 'the_secret_key',
+                                    'user_id': 'nfs.foo.bucket'},
+                           'path': '/',
+                           'protocols': [3, 4],
+                           'pseudo': '/rgw',
+                           'security_label': True,
+                           'squash': 'AllAnonymous',
+                           'transports': ['TCP', 'UDP']}
+
+    def test_config_from_dict(self) -> None:
+        self._do_mock_test(self._do_test_config_from_dict)
+
+    def _do_test_config_from_dict(self) -> None:
+        export = Export.from_dict(1, {
+            'export_id': 1,
+            'path': '/',
+            'cluster_id': self.cluster_id,
+            'pseudo': '/cephfs_a',
+            'access_type': 'RW',
+            'squash': 'root_squash',
+            'security_label': True,
+            'protocols': [4],
+            'transports': ['TCP', 'UDP'],
+            'clients': [{
+                'addresses': ["192.168.0.10", "192.168.1.0/8"],
+                'access_type': None,
+                'squash': 'no_root_squash'
+            }, {
+                'addresses': ["192.168.0.0/16"],
+                'access_type': 'RO',
+                'squash': 'all_squash'
+            }],
+            'fsal': {
+                'name': 'CEPH',
+                'user_id': 'ganesha',
+                'fs_name': 'a',
+                'sec_label_xattr': 'security.selinux'
+            }
+        })
+
+        assert export.export_id == 1
+        assert export.path == "/"
+        assert export.pseudo == "/cephfs_a"
+        assert export.access_type == "RW"
+        assert export.squash == "root_squash"
+        assert set(export.protocols) == {4}
+        assert set(export.transports) == {"TCP", "UDP"}
+        assert export.fsal.name == "CEPH"
+        assert export.fsal.user_id == "ganesha"
+        assert export.fsal.fs_name == "a"
+        assert export.fsal.sec_label_xattr == 'security.selinux'
+        assert len(export.clients) == 2
+        assert export.clients[0].addresses == \
+            ["192.168.0.10", "192.168.1.0/8"]
+        assert export.clients[0].squash == "no_root_squash"
+        assert export.clients[0].access_type is None
+        assert export.clients[1].addresses == ["192.168.0.0/16"]
+        assert export.clients[1].squash == "all_squash"
+        assert export.clients[1].access_type == "RO"
+        assert export.cluster_id == self.cluster_id
+        assert export.attr_expiration_time == 0
+        assert export.security_label
+
+        export = Export.from_dict(2, {
+            'export_id': 2,
+            'path': 'bucket',
+            'pseudo': '/rgw',
+            'cluster_id': self.cluster_id,
+            'access_type': 'RW',
+            'squash': 'all_squash',
+            'security_label': False,
+            'protocols': [4, 3],
+            'transports': ['TCP', 'UDP'],
+            'clients': [],
+            'fsal': {
+                'name': 'RGW',
+                'user_id': 'rgw.foo.bucket',
+                'access_key_id': 'the_access_key',
+                'secret_access_key': 'the_secret_key'
+            }
+        })
+
+        assert export.export_id == 2
+        assert export.path == "bucket"
+        assert export.pseudo == "/rgw"
+        assert export.access_type == "RW"
+        assert export.squash == "all_squash"
+        assert set(export.protocols) == {4, 3}
+        assert set(export.transports) == {"TCP", "UDP"}
+        assert export.fsal.name == "RGW"
+        assert export.fsal.user_id == "rgw.foo.bucket"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 0
+        assert export.cluster_id == self.cluster_id
+
+    @pytest.mark.parametrize(
+        "block",
+        [
+            export_1,
+            export_2,
+        ]
+    )
+    def test_export_from_to_export_block(self, block):
+        blocks = GaneshaConfParser(block).parse()
+        export = Export.from_export_block(blocks[0], self.cluster_id)
+        newblock = export.to_export_block()
+        export2 = Export.from_export_block(newblock, self.cluster_id)
+        newblock2 = export2.to_export_block()
+        assert newblock == newblock2
+
+    @pytest.mark.parametrize(
+        "block",
+        [
+            export_1,
+            export_2,
+        ]
+    )
+    def test_export_from_to_dict(self, block):
+        blocks = GaneshaConfParser(block).parse()
+        export = Export.from_export_block(blocks[0], self.cluster_id)
+        j = export.to_dict()
+        export2 = Export.from_dict(j['export_id'], j)
+        j2 = export2.to_dict()
+        assert j == j2
+
+    @pytest.mark.parametrize(
+        "block",
+        [
+            export_1,
+            export_2,
+        ]
+    )
+    def test_export_validate(self, block):
+        blocks = GaneshaConfParser(block).parse()
+        export = Export.from_export_block(blocks[0], self.cluster_id)
+        nfs_mod = Module('nfs', '', '')
+        with mock.patch('nfs.export_utils.check_fs', return_value=True):
+            export.validate(nfs_mod)
+
+    def test_update_export(self):
+        self._do_mock_test(self._do_test_update_export)
+
+    def _do_test_update_export(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+        r = conf.apply_export(self.cluster_id, json.dumps({
+            'export_id': 2,
+            'path': 'bucket',
+            'pseudo': '/rgw/bucket',
+            'cluster_id': self.cluster_id,
+            'access_type': 'RW',
+            'squash': 'all_squash',
+            'security_label': False,
+            'protocols': [4, 3],
+            'transports': ['TCP', 'UDP'],
+            'clients': [{
+                'addresses': ["192.168.0.0/16"],
+                'access_type': None,
+                'squash': None
+            }],
+            'fsal': {
+                'name': 'RGW',
+                'user_id': 'nfs.foo.bucket',
+                'access_key_id': 'the_access_key',
+                'secret_access_key': 'the_secret_key',
+            }
+        }))
+        assert r[0] == 0
+
+        export = conf._fetch_export('foo', '/rgw/bucket')
+        assert export.export_id == 2
+        assert export.path == "bucket"
+        assert export.pseudo == "/rgw/bucket"
+        assert export.access_type == "RW"
+        assert export.squash == "all_squash"
+        assert export.protocols == [4, 3]
+        assert export.transports == ["TCP", "UDP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash is None
+        assert export.clients[0].access_type is None
+        assert export.cluster_id == self.cluster_id
+
+        # do it again, with changes
+        r = conf.apply_export(self.cluster_id, json.dumps({
+            'export_id': 2,
+            'path': 'newbucket',
+            'pseudo': '/rgw/bucket',
+            'cluster_id': self.cluster_id,
+            'access_type': 'RO',
+            'squash': 'root',
+            'security_label': False,
+            'protocols': [4],
+            'transports': ['TCP'],
+            'clients': [{
+                'addresses': ["192.168.10.0/16"],
+                'access_type': None,
+                'squash': None
+            }],
+            'fsal': {
+                'name': 'RGW',
+                'user_id': 'nfs.foo.newbucket',
+                'access_key_id': 'the_access_key',
+                'secret_access_key': 'the_secret_key',
+            }
+        }))
+        assert r[0] == 0
+
+        export = conf._fetch_export('foo', '/rgw/bucket')
+        assert export.export_id == 2
+        assert export.path == "newbucket"
+        assert export.pseudo == "/rgw/bucket"
+        assert export.access_type == "RO"
+        assert export.squash == "root"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash is None
+        assert export.clients[0].access_type is None
+        assert export.cluster_id == self.cluster_id
+
+        # again, but without export_id
+        r = conf.apply_export(self.cluster_id, json.dumps({
+            'path': 'newestbucket',
+            'pseudo': '/rgw/bucket',
+            'cluster_id': self.cluster_id,
+            'access_type': 'RW',
+            'squash': 'root',
+            'security_label': False,
+            'protocols': [4],
+            'transports': ['TCP'],
+            'clients': [{
+                'addresses': ["192.168.10.0/16"],
+                'access_type': None,
+                'squash': None
+            }],
+            'fsal': {
+                'name': 'RGW',
+                'user_id': 'nfs.foo.newestbucket',
+                'access_key_id': 'the_access_key',
+                'secret_access_key': 'the_secret_key',
+            }
+        }))
+        assert r[0] == 0
+
+        export = conf._fetch_export(self.cluster_id, '/rgw/bucket')
+        assert export.export_id == 2
+        assert export.path == "newestbucket"
+        assert export.pseudo == "/rgw/bucket"
+        assert export.access_type == "RW"
+        assert export.squash == "root"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash is None
+        assert export.clients[0].access_type is None
+        assert export.cluster_id == self.cluster_id
+
+    def test_update_export_with_ganesha_conf(self):
+        self._do_mock_test(self._do_test_update_export_with_ganesha_conf)
+
+    def _do_test_update_export_with_ganesha_conf(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+        r = conf.apply_export(self.cluster_id, self.export_3)
+        assert r[0] == 0
+
+    def test_update_export_with_list(self):
+        self._do_mock_test(self._do_test_update_export_with_list)
+
+    def _do_test_update_export_with_list(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+        r = conf.apply_export(self.cluster_id, json.dumps([
+            {
+                'path': 'bucket',
+                'pseudo': '/rgw/bucket',
+                'cluster_id': self.cluster_id,
+                'access_type': 'RW',
+                'squash': 'root',
+                'security_label': False,
+                'protocols': [4],
+                'transports': ['TCP'],
+                'clients': [{
+                    'addresses': ["192.168.0.0/16"],
+                    'access_type': None,
+                    'squash': None
+                }],
+                'fsal': {
+                    'name': 'RGW',
+                    'user_id': 'nfs.foo.bucket',
+                    'access_key_id': 'the_access_key',
+                    'secret_access_key': 'the_secret_key',
+                }
+            },
+            {
+                'path': 'bucket2',
+                'pseudo': '/rgw/bucket2',
+                'cluster_id': self.cluster_id,
+                'access_type': 'RO',
+                'squash': 'root',
+                'security_label': False,
+                'protocols': [4],
+                'transports': ['TCP'],
+                'clients': [{
+                    'addresses': ["192.168.0.0/16"],
+                    'access_type': None,
+                    'squash': None
+                }],
+                'fsal': {
+                    'name': 'RGW',
+                    'user_id': 'nfs.foo.bucket2',
+                    'access_key_id': 'the_access_key',
+                    'secret_access_key': 'the_secret_key',
+                }
+            },
+        ]))
+        assert r[0] == 0
+
+        export = conf._fetch_export('foo', '/rgw/bucket')
+        assert export.export_id == 3
+        assert export.path == "bucket"
+        assert export.pseudo == "/rgw/bucket"
+        assert export.access_type == "RW"
+        assert export.squash == "root"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash is None
+        assert export.clients[0].access_type is None
+        assert export.cluster_id == self.cluster_id
+
+        export = conf._fetch_export('foo', '/rgw/bucket2')
+        assert export.export_id == 4
+        assert export.path == "bucket2"
+        assert export.pseudo == "/rgw/bucket2"
+        assert export.access_type == "RO"
+        assert export.squash == "root"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash is None
+        assert export.clients[0].access_type is None
+        assert export.cluster_id == self.cluster_id
+
+    def test_remove_export(self) -> None:
+        self._do_mock_test(self._do_test_remove_export)
+
+    def _do_test_remove_export(self) -> None:
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+        assert len(conf.exports[self.cluster_id]) == 2
+        assert conf.delete_export(cluster_id=self.cluster_id,
+                                  pseudo_path="/rgw") == (0, "Successfully deleted export", "")
+        exports = conf.exports[self.cluster_id]
+        assert len(exports) == 1
+        assert exports[0].export_id == 1
+
+    def test_create_export_rgw_bucket(self):
+        self._do_mock_test(self._do_test_create_export_rgw_bucket)
+
+    def _do_test_create_export_rgw_bucket(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 2
+
+        r = conf.create_export(
+            fsal_type='rgw',
+            cluster_id=self.cluster_id,
+            bucket='bucket',
+            pseudo_path='/mybucket',
+            read_only=False,
+            squash='root',
+            addr=["192.168.0.0/16"]
+        )
+        assert r[0] == 0
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 3
+
+        export = conf._fetch_export('foo', '/mybucket')
+        assert export.export_id
+        assert export.path == "bucket"
+        assert export.pseudo == "/mybucket"
+        assert export.access_type == "none"
+        assert export.squash == "none"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.user_id == "bucket_owner_user"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash == 'root'
+        assert export.clients[0].access_type == 'rw'
+        assert export.clients[0].addresses == ["192.168.0.0/16"]
+        assert export.cluster_id == self.cluster_id
+
+    def test_create_export_rgw_bucket_user(self):
+        self._do_mock_test(self._do_test_create_export_rgw_bucket_user)
+
+    def _do_test_create_export_rgw_bucket_user(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 2
+
+        r = conf.create_export(
+            fsal_type='rgw',
+            cluster_id=self.cluster_id,
+            bucket='bucket',
+            user_id='other_user',
+            pseudo_path='/mybucket',
+            read_only=False,
+            squash='root',
+            addr=["192.168.0.0/16"]
+        )
+        assert r[0] == 0
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 3
+
+        export = conf._fetch_export('foo', '/mybucket')
+        assert export.export_id
+        assert export.path == "bucket"
+        assert export.pseudo == "/mybucket"
+        assert export.access_type == "none"
+        assert export.squash == "none"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash == 'root'
+        assert export.fsal.user_id == "other_user"
+        assert export.clients[0].access_type == 'rw'
+        assert export.clients[0].addresses == ["192.168.0.0/16"]
+        assert export.cluster_id == self.cluster_id
+        
+    def test_create_export_rgw_user(self):
+        self._do_mock_test(self._do_test_create_export_rgw_user)
+
+    def _do_test_create_export_rgw_user(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 2
+
+        r = conf.create_export(
+            fsal_type='rgw',
+            cluster_id=self.cluster_id,
+            user_id='some_user',
+            pseudo_path='/mybucket',
+            read_only=False,
+            squash='root',
+            addr=["192.168.0.0/16"]
+        )
+        assert r[0] == 0
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 3
+
+        export = conf._fetch_export('foo', '/mybucket')
+        assert export.export_id
+        assert export.path == "/"
+        assert export.pseudo == "/mybucket"
+        assert export.access_type == "none"
+        assert export.squash == "none"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "RGW"
+        assert export.fsal.access_key_id == "the_access_key"
+        assert export.fsal.secret_access_key == "the_secret_key"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash == 'root'
+        assert export.fsal.user_id == "some_user"
+        assert export.clients[0].access_type == 'rw'
+        assert export.clients[0].addresses == ["192.168.0.0/16"]
+        assert export.cluster_id == self.cluster_id
+        
+    def test_create_export_cephfs(self):
+        self._do_mock_test(self._do_test_create_export_cephfs)
+
+    def _do_test_create_export_cephfs(self):
+        nfs_mod = Module('nfs', '', '')
+        conf = ExportMgr(nfs_mod)
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 2
+
+        r = conf.create_export(
+            fsal_type='cephfs',
+            cluster_id=self.cluster_id,
+            fs_name='myfs',
+            path='/',
+            pseudo_path='/cephfs2',
+            read_only=False,
+            squash='root',
+            addr=["192.168.1.0/8"],
+        )
+        assert r[0] == 0
+
+        exports = conf.list_exports(cluster_id=self.cluster_id)
+        ls = json.loads(exports[1])
+        assert len(ls) == 3
+
+        export = conf._fetch_export('foo', '/cephfs2')
+        assert export.export_id
+        assert export.path == "/"
+        assert export.pseudo == "/cephfs2"
+        assert export.access_type == "none"
+        assert export.squash == "none"
+        assert export.protocols == [4]
+        assert export.transports == ["TCP"]
+        assert export.fsal.name == "CEPH"
+        assert export.fsal.user_id == "nfs.foo.3"
+        assert export.fsal.cephx_key == "thekeyforclientabc"
+        assert len(export.clients) == 1
+        assert export.clients[0].squash == 'root'
+        assert export.clients[0].access_type == 'rw'
+        assert export.clients[0].addresses == ["192.168.1.0/8"]
+        assert export.cluster_id == self.cluster_id
+
+    def _do_test_cluster_ls(self):
+        nfs_mod = Module('nfs', '', '')
+        cluster = NFSCluster(nfs_mod)
+
+        rc, out, err = cluster.list_nfs_cluster()
+        assert rc == 0
+        assert out == self.cluster_id
+
+    def test_cluster_ls(self):
+        self._do_mock_test(self._do_test_cluster_ls)
+
+    def _do_test_cluster_info(self):
+        nfs_mod = Module('nfs', '', '')
+        cluster = NFSCluster(nfs_mod)
+
+        rc, out, err = cluster.show_nfs_cluster_info(self.cluster_id)
+        assert rc == 0
+        assert json.loads(out) == {"foo": {"virtual_ip": None, "backend": []}}
+
+    def test_cluster_info(self):
+        self._do_mock_test(self._do_test_cluster_info)
+
+    def _do_test_cluster_config(self):
+        nfs_mod = Module('nfs', '', '')
+        cluster = NFSCluster(nfs_mod)
+
+        rc, out, err = cluster.get_nfs_cluster_config(self.cluster_id)
+        assert rc == 0
+        assert out == ""
+
+        rc, out, err = cluster.set_nfs_cluster_config(self.cluster_id, '# foo\n')
+        assert rc == 0
+
+        rc, out, err = cluster.get_nfs_cluster_config(self.cluster_id)
+        assert rc == 0
+        assert out == "# foo\n"
+
+        rc, out, err = cluster.reset_nfs_cluster_config(self.cluster_id)
+        assert rc == 0
+
+        rc, out, err = cluster.get_nfs_cluster_config(self.cluster_id)
+        assert rc == 0
+        assert out == ""
+
+    def test_cluster_config(self):
+        self._do_mock_test(self._do_test_cluster_config)
index f899e1ce91329a68f5d32e29f070d4f82356eb86..00552dfc0de12c18f4e987047d187027b602d0af 100644 (file)
@@ -1,9 +1,12 @@
+from typing import List, TYPE_CHECKING
+
 import orchestrator
 
-POOL_NAME = 'nfs-ganesha'
+if TYPE_CHECKING:
+    from nfs.module import Module
 
 
-def available_clusters(mgr):
+def available_clusters(mgr: 'Module') -> List[str]:
     '''
     This method returns list of available cluster ids.
     Service name is service_type.service_id
@@ -15,20 +18,21 @@ def available_clusters(mgr):
     # TODO check cephadm cluster list with rados pool conf objects
     completion = mgr.describe_service(service_type='nfs')
     orchestrator.raise_if_exception(completion)
+    assert completion.result is not None
     return [cluster.spec.service_id for cluster in completion.result
             if cluster.spec.service_id]
 
 
-def restart_nfs_service(mgr, cluster_id):
+def restart_nfs_service(mgr: 'Module', cluster_id: str) -> None:
     '''
     This methods restarts the nfs daemons
     '''
     completion = mgr.service_action(action='restart',
-                                    service_name='nfs.'+cluster_id)
+                                    service_name='nfs.' + cluster_id)
     orchestrator.raise_if_exception(completion)
 
 
-def check_fs(mgr, fs_name):
+def check_fs(mgr: 'Module', fs_name: str) -> bool:
     '''
     This method checks if given fs is valid
     '''
index 22f5c5640dc5a36ee75fd6979205083faf5dbc32..18eb1d9be6376f7cf2d1e0527d7ba92ea1d2a9fd 100644 (file)
@@ -124,6 +124,7 @@ def handle_orch_error(f: Callable[..., T]) -> Callable[..., 'OrchResult[T]']:
         try:
             return OrchResult(f(*args, **kwargs))
         except Exception as e:
+            logger.exception(e)
             return OrchResult(None, exception=e)
 
     return cast(Callable[..., OrchResult[T]], wrapper)
@@ -376,6 +377,12 @@ class Orchestrator(object):
         """
         raise NotImplementedError()
 
+    def get_facts(self, hostname: Optional[str] = None) -> OrchResult[List[Dict[str, Any]]]:
+        """
+        Return hosts metadata(gather_facts).
+        """
+        raise NotImplementedError()
+
     def add_host_label(self, host: str, label: str) -> OrchResult[str]:
         """
         Add a host label
@@ -484,7 +491,7 @@ class Orchestrator(object):
         """
         raise NotImplementedError()
 
-    def remove_service(self, service_name: str) -> OrchResult[str]:
+    def remove_service(self, service_name: str, force: bool = False) -> OrchResult[str]:
         """
         Remove a service (a collection of daemons).
 
@@ -548,11 +555,13 @@ class Orchestrator(object):
 
     def remove_osds(self, osd_ids: List[str],
                     replace: bool = False,
-                    force: bool = False) -> OrchResult[str]:
+                    force: bool = False,
+                    zap: bool = False) -> OrchResult[str]:
         """
         :param osd_ids: list of OSD IDs
         :param replace: marks the OSD as being destroyed. See :ref:`orchestrator-osd-replace`
         :param force: Forces the OSD removal process without waiting for the data to be drained first.
+        :param zap: Zap/Erase all devices associated with the OSDs (DESTROYS DATA)
         Note that this can only remove OSDs that were successfully
         created (i.e. got an OSD ID).
         """
@@ -647,6 +656,9 @@ class Orchestrator(object):
     def upgrade_check(self, image: Optional[str], version: Optional[str]) -> OrchResult[str]:
         raise NotImplementedError()
 
+    def upgrade_ls(self, image: Optional[str], tags: bool) -> OrchResult[Dict[Any, Any]]:
+        raise NotImplementedError()
+
     def upgrade_start(self, image: Optional[str], version: Optional[str]) -> OrchResult[str]:
         raise NotImplementedError()
 
@@ -829,6 +841,7 @@ class DaemonDescription(object):
         # This is the <foo> in mds.<foo>, the ID that will appear
         # in the FSMap/ServiceMap.
         self.daemon_id: Optional[str] = daemon_id
+        self.daemon_name = self.name()
 
         # Some daemon types have a numeric rank assigned
         self.rank: Optional[int] = rank
@@ -962,6 +975,7 @@ class DaemonDescription(object):
         out['daemon_type'] = self.daemon_type
         out['daemon_id'] = self.daemon_id
         out['service_name'] = self._service_name
+        out['daemon_name'] = self.name()
         out['hostname'] = self.hostname
         out['container_id'] = self.container_id
         out['container_image_id'] = self.container_image_id
@@ -998,6 +1012,7 @@ class DaemonDescription(object):
         out: Dict[str, Any] = OrderedDict()
         out['daemon_type'] = self.daemon_type
         out['daemon_id'] = self.daemon_id
+        out['daemon_name'] = self.name()
         out['hostname'] = self.hostname
         out['container_id'] = self.container_id
         out['container_image_id'] = self.container_image_id
@@ -1039,6 +1054,8 @@ class DaemonDescription(object):
                 c[k] = str_to_datetime(c[k])
         events = [OrchestratorEvent.from_json(e) for e in event_strs]
         status_int = c.pop('status', None)
+        if 'daemon_name' in c:
+            del c['daemon_name']
         status = DaemonDescriptionStatus(status_int) if status_int is not None else None
         return cls(events=events, status=status, **c)
 
@@ -1071,7 +1088,6 @@ class ServiceDescription(object):
                  spec: ServiceSpec,
                  container_image_id: Optional[str] = None,
                  container_image_name: Optional[str] = None,
-                 rados_config_location: Optional[str] = None,
                  service_url: Optional[str] = None,
                  last_refresh: Optional[datetime.datetime] = None,
                  created: Optional[datetime.datetime] = None,
@@ -1087,10 +1103,6 @@ class ServiceDescription(object):
         self.container_image_id = container_image_id      # image hash
         self.container_image_name = container_image_name  # image friendly name
 
-        # Location of the service configuration when stored in rados
-        # object. Format: "rados://<pool>/[<namespace/>]<object>"
-        self.rados_config_location = rados_config_location
-
         # If the service exposes REST-like API, this attribute should hold
         # the URL.
         self.service_url = service_url
@@ -1129,7 +1141,6 @@ class ServiceDescription(object):
         status = {
             'container_image_id': self.container_image_id,
             'container_image_name': self.container_image_name,
-            'rados_config_location': self.rados_config_location,
             'service_url': self.service_url,
             'size': self.size,
             'running': self.running,
@@ -1152,7 +1163,6 @@ class ServiceDescription(object):
         status = {
             'container_image_id': self.container_image_id,
             'container_image_name': self.container_image_name,
-            'rados_config_location': self.rados_config_location,
             'service_url': self.service_url,
             'size': self.size,
             'running': self.running,
index a556c91c0bbf63862326e83b68fb22a38517d9fd..19bc7b5bca9b61cc83cc5532735edc2be7ded80b 100644 (file)
@@ -159,6 +159,7 @@ def preview_table_osd(data: List) -> str:
     table.align = 'l'
     table.left_padding_width = 0
     table.right_padding_width = 2
+    notes = ''
     for osd_data in data:
         if osd_data.get('service_type') != 'osd':
             continue
@@ -167,6 +168,8 @@ def preview_table_osd(data: List) -> str:
                 if spec.get('error'):
                     return spec.get('message')
                 dg_name = spec.get('osdspec')
+                if spec.get('notes', []):
+                    notes += '\n'.join(spec.get('notes')) + '\n'
                 for osd in spec.get('data', []):
                     db_path = osd.get('block_db', '-')
                     wal_path = osd.get('block_wal', '-')
@@ -174,7 +177,7 @@ def preview_table_osd(data: List) -> str:
                     if not block_data:
                         continue
                     table.add_row(('osd', dg_name, host, block_data, db_path, wal_path))
-    return table.get_string()
+    return notes + table.get_string()
 
 
 def preview_table_services(data: List) -> str:
@@ -462,27 +465,27 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                 "On": "On",
                 "Off": "Off",
                 True: "Yes",
-                False: "No",
+                False: "",
             }
 
             out = []
             if wide:
                 table = PrettyTable(
-                    ['Hostname', 'Path', 'Type', 'Transport', 'RPM', 'Vendor', 'Model',
-                     'Serial', 'Size', 'Health', 'Ident', 'Fault', 'Available',
-                     'Reject Reasons'],
+                    ['HOST', 'PATH', 'TYPE', 'TRANSPORT', 'RPM', 'DEVICE ID', 'SIZE',
+                     'HEALTH', 'IDENT', 'FAULT',
+                     'AVAILABLE', 'REJECT REASONS'],
                     border=False)
             else:
                 table = PrettyTable(
-                    ['Hostname', 'Path', 'Type', 'Serial', 'Size',
-                     'Health', 'Ident', 'Fault', 'Available'],
+                    ['HOST', 'PATH', 'TYPE', 'DEVICE ID', 'SIZE',
+                     'AVAILABLE', 'REJECT REASONS'],
                     border=False)
             table.align = 'l'
             table._align['SIZE'] = 'r'
             table.left_padding_width = 0
             table.right_padding_width = 2
             for host_ in sorted(inv_hosts, key=lambda h: h.name):  # type: InventoryHost
-                for d in host_.devices.devices:  # type: Device
+                for d in sorted(host_.devices.devices, key=lambda d: d.path):  # type: Device
 
                     led_ident = 'N/A'
                     led_fail = 'N/A'
@@ -490,24 +493,17 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                         led_ident = d.lsm_data['ledSupport']['IDENTstatus']
                         led_fail = d.lsm_data['ledSupport']['FAILstatus']
 
-                    if d.device_id is not None:
-                        fallback_serial = d.device_id.split('_')[-1]
-                    else:
-                        fallback_serial = ""
-
                     if wide:
                         table.add_row(
                             (
                                 host_.name,
                                 d.path,
                                 d.human_readable_type,
-                                d.lsm_data.get('transport', 'Unknown'),
-                                d.lsm_data.get('rpm', 'Unknown'),
-                                d.sys_api.get('vendor') or 'N/A',
-                                d.sys_api.get('model') or 'N/A',
-                                d.lsm_data.get('serialNum', fallback_serial),
+                                d.lsm_data.get('transport', ''),
+                                d.lsm_data.get('rpm', ''),
+                                d.device_id,
                                 format_dimless(d.sys_api.get('size', 0), 5),
-                                d.lsm_data.get('health', 'Unknown'),
+                                d.lsm_data.get('health', ''),
                                 display_map[led_ident],
                                 display_map[led_fail],
                                 display_map[d.available],
@@ -520,12 +516,10 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                                 host_.name,
                                 d.path,
                                 d.human_readable_type,
-                                d.lsm_data.get('serialNum', fallback_serial),
+                                d.device_id,
                                 format_dimless(d.sys_api.get('size', 0), 5),
-                                d.lsm_data.get('health', 'Unknown'),
-                                display_map[led_ident],
-                                display_map[led_fail],
-                                display_map[d.available]
+                                display_map[d.available],
+                                ', '.join(d.rejected_reasons)
                             )
                         )
             out.append(table.get_string())
@@ -604,10 +598,15 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                 else:
                     refreshed = nice_delta(now, s.last_refresh, ' ago')
 
+                if s.spec.service_type == 'osd':
+                    running = str(s.running)
+                else:
+                    running = '{}/{}'.format(s.running, s.size)
+
                 table.add_row((
                     s.spec.service_name(),
                     s.get_port_summary(),
-                    '%d/%d' % (s.running, s.size),
+                    running,
                     refreshed,
                     nice_delta(now, s.created),
                     pl,
@@ -823,9 +822,10 @@ Usage:
     def _osd_rm_start(self,
                       osd_id: List[str],
                       replace: bool = False,
-                      force: bool = False) -> HandleCommandResult:
+                      force: bool = False,
+                      zap: bool = False) -> HandleCommandResult:
         """Remove OSD daemons"""
-        completion = self.remove_osds(osd_id, replace=replace, force=force)
+        completion = self.remove_osds(osd_id, replace=replace, force=force, zap=zap)
         raise_if_exception(completion)
         return HandleCommandResult(stdout=completion.result_str())
 
@@ -850,14 +850,17 @@ Usage:
             out = to_format(report, format, many=True, cls=None)
         else:
             table = PrettyTable(
-                ['OSD_ID', 'HOST', 'STATE', 'PG_COUNT', 'REPLACE', 'FORCE', 'DRAIN_STARTED_AT'],
+                ['OSD', 'HOST', 'STATE', 'PGS', 'REPLACE', 'FORCE', 'ZAP',
+                 'DRAIN STARTED AT'],
                 border=False)
             table.align = 'l'
+            table._align['PGS'] = 'r'
             table.left_padding_width = 0
             table.right_padding_width = 2
             for osd in sorted(report, key=lambda o: o.osd_id):
                 table.add_row([osd.osd_id, osd.hostname, osd.drain_status_human(),
-                               osd.get_pg_count(), osd.replace, osd.replace, osd.drain_started_at])
+                               osd.get_pg_count(), osd.replace, osd.force, osd.zap,
+                               osd.drain_started_at or ''])
             out = table.get_string()
 
         return HandleCommandResult(stdout=out)
@@ -907,9 +910,9 @@ Usage:
     @_cli_write_command('orch daemon add rgw')
     def _rgw_add(self,
                  svc_id: str,
+                 placement: Optional[str] = None,
                  port: Optional[int] = None,
                  ssl: bool = False,
-                 placement: Optional[str] = None,
                  inbuf: Optional[str] = None) -> HandleCommandResult:
         """Start RGW daemon(s)"""
         if inbuf:
@@ -926,8 +929,6 @@ Usage:
     @_cli_write_command('orch daemon add nfs')
     def _nfs_add(self,
                  svc_id: str,
-                 pool: str,
-                 namespace: Optional[str] = None,
                  placement: Optional[str] = None,
                  inbuf: Optional[str] = None) -> HandleCommandResult:
         """Start NFS daemon(s)"""
@@ -936,8 +937,6 @@ Usage:
 
         spec = NFSServiceSpec(
             service_id=svc_id,
-            pool=pool,
-            namespace=namespace,
             placement=PlacementSpec.from_string(placement),
         )
         return self._daemon_add_misc(spec)
@@ -981,7 +980,9 @@ Usage:
         return HandleCommandResult(stdout=completion.result_str())
 
     @_cli_write_command('orch daemon redeploy')
-    def _daemon_action_redeploy(self, name: str, image: Optional[str] = None) -> HandleCommandResult:
+    def _daemon_action_redeploy(self,
+                                name: str,
+                                image: Optional[str] = None) -> HandleCommandResult:
         """Redeploy a daemon (with a specifc image)"""
         if '.' not in name:
             raise OrchestratorError('%s is not a valid daemon name' % name)
@@ -1012,7 +1013,7 @@ Usage:
         """Remove a service"""
         if service_name in ['mon', 'mgr'] and not force:
             raise OrchestratorError('The mon and mgr services cannot be removed')
-        completion = self.remove_service(service_name)
+        completion = self.remove_service(service_name, force=force)
         raise_if_exception(completion)
         return HandleCommandResult(stdout=completion.result_str())
 
@@ -1095,11 +1096,11 @@ Usage:
     @_cli_write_command('orch apply rgw')
     def _apply_rgw(self,
                    svc_id: str,
+                   placement: Optional[str] = None,
                    realm: Optional[str] = None,
                    zone: Optional[str] = None,
                    port: Optional[int] = None,
                    ssl: bool = False,
-                   placement: Optional[str] = None,
                    dry_run: bool = False,
                    format: Format = Format.plain,
                    unmanaged: bool = False,
@@ -1134,8 +1135,6 @@ Usage:
                    svc_id: str,
                    placement: Optional[str] = None,
                    format: Format = Format.plain,
-                   pool: Optional[str] = None,
-                   namespace: Optional[str] = None,
                    port: Optional[int] = None,
                    dry_run: bool = False,
                    unmanaged: bool = False,
@@ -1147,8 +1146,6 @@ Usage:
 
         spec = NFSServiceSpec(
             service_id=svc_id,
-            pool=pool,
-            namespace=namespace,
             port=port,
             placement=PlacementSpec.from_string(placement),
             unmanaged=unmanaged,
@@ -1331,6 +1328,16 @@ Usage:
         raise_if_exception(completion)
         return HandleCommandResult(stdout=completion.result_str())
 
+    @_cli_read_command('orch upgrade ls')
+    def _upgrade_ls(self,
+                    image: Optional[str] = None,
+                    tags: bool = False) -> HandleCommandResult:
+        """Check for available versions (or tags) we can upgrade to"""
+        completion = self.upgrade_ls(image, tags)
+        r = raise_if_exception(completion)
+        out = json.dumps(r, indent=4)
+        return HandleCommandResult(stdout=out)
+
     @_cli_write_command('orch upgrade status')
     def _upgrade_status(self) -> HandleCommandResult:
         """Check service versions vs available and target containers"""
index 35f4b64b8782df4ca866d630f258bdd0585eddf6..5b421d09c53e23164d1e987e5c7f089573665691 100644 (file)
@@ -12,9 +12,10 @@ from mgr_module import HandleCommandResult
 
 from test_orchestrator import TestOrchestrator as _TestOrchestrator
 
-from orchestrator import InventoryHost, DaemonDescription, ServiceDescription, DaemonDescriptionStatus
+from orchestrator import InventoryHost, DaemonDescription, ServiceDescription, DaemonDescriptionStatus, OrchResult
 from orchestrator import OrchestratorValidationError
 from orchestrator.module import to_format, Format, OrchestratorCli, preview_table_osd
+from unittest import mock
 
 
 def _test_resource(data, resource_class, extra=None):
@@ -84,6 +85,7 @@ def test_apply():
 def test_yaml():
     y = """daemon_type: crash
 daemon_id: ubuntu
+daemon_name: crash.ubuntu
 hostname: ubuntu
 status: 1
 status_desc: starting
@@ -141,6 +143,21 @@ def test_handle_command():
         retval=-2, stdout='', stderr='No orchestrator configured (try `ceph orch set backend`)')
 
 
+r = OrchResult([ServiceDescription(spec=ServiceSpec(service_type='osd'), running=123)])
+
+
+@mock.patch("orchestrator.OrchestratorCli.describe_service", return_value=r)
+def test_orch_ls(_describe_service):
+    cmd = {
+        'prefix': 'orch ls',
+    }
+    m = OrchestratorCli('orchestrator', 0, 0)
+    r = m._handle_command(None, cmd)
+    out = 'NAME  PORTS  RUNNING  REFRESHED  AGE  PLACEMENT  \n' \
+          'osd              123  -          -               '
+    assert r == HandleCommandResult(retval=0, stdout=out, stderr='')
+
+
 def test_preview_table_osd_smoke():
     data = [
         {
index c57a5feb35dcd067c7f40d4273cd220c638936b3..d3d960cdfb0f48a067b0946294bca61b9eacfa8a 100644 (file)
@@ -131,11 +131,11 @@ class PgAutoscaler(MgrModule):
             default='scale-up',
             type='str',
             desc='pg_autoscale profiler',
-            long_desc=('Determines the behavior of the autoscaler algorithm '
+            long_desc=('Determines the behavior of the autoscaler algorithm, '
                        '`scale-up` means that it starts out with minmum pgs '
-                       'and scales up when there is pressure, `scale-down` '
-                       'means starts out with full pgs and scales down when '
-                       'there is pressure '),
+                       'and scales up when there is pressure'
+                       '`scale-down means start out with full pgs and scales'
+                       'down when there is pressure'),
             runtime=True),
     ]
 
index 812c16fdb0c446223bc87fb3145d432ea0f29b09..2ec69971c896aa7cb82e7a4c0b9da2aebf402e84 100644 (file)
@@ -194,33 +194,27 @@ class GlobalRecoveryEvent(Event):
         self._active_clean_num = active_clean_num
         self._refresh()
 
-    def global_event_update_progress(self, pg_dump, log):
-        # type: (Dict, logging.Logger) -> None
+    def global_event_update_progress(self, log):
+        # type: (logging.Logger) -> None
         "Update progress of Global Recovery Event"
-        pgs = pg_dump['pg_stats']
-        new_active_clean_num = 0
+        global _module
+        assert _module
         skipped_pgs = 0
-
-        for pg in pgs:
+        active_clean_pgs = _module.get("active_clean_pgs")
+        total_pg_num = active_clean_pgs["total_num_pgs"]
+        new_active_clean_pgs = active_clean_pgs["pg_stats"]
+        new_active_clean_num = len(new_active_clean_pgs)
+        for pg in new_active_clean_pgs:
             # Disregard PGs that are not being reported
             # if the states are active+clean. Since it is
             # possible that some pgs might not have any movement
             # even before the start of the event.
-
-            state = pg['state']
-
-            states = state.split("+")
             if pg['reported_epoch'] < self._start_epoch:
-                if "active" in states and "clean" in states:
-                    log.debug("Skipping pg {0} since reported_epoch {1} < start_epoch {2}"
-                              .format(pg['pgid'], pg['reported_epoch'], self._start_epoch))
-                    skipped_pgs += 1
+                log.debug("Skipping pg {0} since reported_epoch {1} < start_epoch {2}"
+                             .format(pg['pgid'], pg['reported_epoch'], self._start_epoch))
+                skipped_pgs += 1
                 continue
 
-            if "active" in states and "clean" in states:
-                new_active_clean_num += 1
-
-        total_pg_num = len(pgs)
         if self._active_clean_num != new_active_clean_num:
             # Have this case to know when need to update
             # the progress
@@ -229,6 +223,9 @@ class GlobalRecoveryEvent(Event):
                 self._progress = float(new_active_clean_num) / (total_pg_num - skipped_pgs)
             except ZeroDivisionError:
                 self._progress = 0.0
+        else:
+            # No need to update since there is no change
+            return
 
         log.debug("Updated progress to %s", self.summary())
         self._refresh()
@@ -296,7 +293,7 @@ class PgRecoveryEvent(Event):
         self._original_pg_count = len(self._pgs)
         self._original_bytes_recovered = None  # type: Optional[Dict[PgId, float]]
         self._progress = 0.0
-        # self._start_epoch = _module.get_osdmap().get_epoch()
+
         self._start_epoch = start_epoch
         self._refresh()
 
@@ -345,7 +342,7 @@ class PgRecoveryEvent(Event):
                 complete.add(pg)
                 continue
             # Only checks the state of each PGs when it's epoch >= the OSDMap's epoch
-            if int(info['reported_epoch']) < int(self._start_epoch):
+            if info['reported_epoch'] < self._start_epoch:
                 continue
 
             state = info['state']
@@ -443,10 +440,10 @@ class Module(MgrModule):
             runtime=True
         ),
         Option(
-            'persist_interval',
+            'sleep_interval',
             default=5,
             type='secs',
-            desc='how frequently to persist completed events',
+            desc='how long the module is going to sleep',
             runtime=True
         ),
         Option(
@@ -477,7 +474,7 @@ class Module(MgrModule):
         # only for mypy
         if TYPE_CHECKING:
             self.max_completed_events = 0
-            self.persist_interval = 0
+            self.sleep_interval = 0
             self.enabled = True
 
     def config_notify(self):
@@ -492,7 +489,6 @@ class Module(MgrModule):
         # A function that will create or complete an event when an
         # OSD is marked in or out according to the affected PGs
         affected_pgs = []
-        unmoved_pgs = []
         for pool in old_dump['pools']:
             pool_id = pool['pool']  # type: str
             for ps in range(0, pool['pg_num']):
@@ -521,11 +517,9 @@ class Module(MgrModule):
                 # Has this OSD been assigned a new location?
                 # (it might not be if there is no suitable place to move
                 #  after an OSD is marked in/out)
-                if marked == "in":
-                    is_relocated = len(old_osds - new_osds) > 0
-                else:
-                    is_relocated = len(new_osds - old_osds) > 0
-
+                
+                is_relocated = old_osds != new_osds
+                
                 self.log.debug(
                     "new_up_acting: {0}".format(json.dumps(new_up_acting,
                                                            indent=4,
@@ -534,15 +528,9 @@ class Module(MgrModule):
                 if was_on_out_or_in_osd and is_relocated:
                     # This PG is now in motion, track its progress
                     affected_pgs.append(PgId(pool_id, ps))
-                elif not is_relocated:
-                    # This PG didn't get a new location, we'll log it
-                    unmoved_pgs.append(PgId(pool_id, ps))
 
         # In the case that we ignored some PGs, log the reason why (we may
         # not end up creating a progress event)
-        if len(unmoved_pgs):
-            self.log.warning("{0} PGs were on osd.{1}, but didn't get new locations".format(
-                len(unmoved_pgs), osd_id))
 
         self.log.warning("{0} PGs affected by osd.{1} being marked {2}".format(
             len(affected_pgs), osd_id, marked))
@@ -593,23 +581,14 @@ class Module(MgrModule):
                     self.log.warning("osd.{0} marked in".format(osd_id))
                     self._osd_in_out(old_osdmap, old_dump, new_osdmap, osd_id, "in")
 
-    def _pg_state_changed(self, pg_dump):
+    def _pg_state_changed(self):
 
         # This function both constructs and updates
         # the global recovery event if one of the
         # PGs is not at active+clean state
-
-        pgs = pg_dump['pg_stats']
-        total_pg_num = len(pgs)
-        active_clean_num = 0
-        for pg in pgs:
-            state = pg['state']
-            # TODO right here we can keep track of epoch as well
-            # and parse it to global_event_update_progress()
-            states = state.split("+")
-
-            if "active" in states and "clean" in states:
-                active_clean_num += 1
+        active_clean_pgs = self.get("active_clean_pgs")
+        total_pg_num = active_clean_pgs["total_num_pgs"]
+        active_clean_num = len(active_clean_pgs["pg_stats"])
         try:
             # There might be a case where there is no pg_num
             progress = float(active_clean_num) / total_pg_num
@@ -624,48 +603,44 @@ class Module(MgrModule):
                     add_to_ceph_s=True,
                     start_epoch=self.get_osdmap().get_epoch(),
                     active_clean_num=active_clean_num)
-            ev.global_event_update_progress(self.get('pg_stats'), self.log)
+            ev.global_event_update_progress(self.log)
             self._events[ev.id] = ev
 
-    def notify(self, notify_type, notify_data):
-        self._ready.wait()
-        if not self.enabled:
+    def _process_osdmap(self):
+        old_osdmap = self._latest_osdmap
+        self._latest_osdmap = self.get_osdmap()
+        assert old_osdmap
+        assert self._latest_osdmap
+        self.log.info(("Processing OSDMap change %d..%d"),
+            old_osdmap.get_epoch(), self._latest_osdmap.get_epoch())
+
+        self._osdmap_changed(old_osdmap, self._latest_osdmap)
+
+    def _process_pg_summary(self):
+        # if there are no events we will skip this here to avoid
+        # expensive get calls
+        if len(self._events) == 0:
             return
-        if notify_type == "osd_map":
-            old_osdmap = self._latest_osdmap
-            self._latest_osdmap = self.get_osdmap()
-            assert old_osdmap
-            assert self._latest_osdmap
-
-            self.log.info(("Processing OSDMap change %d..%d"),
-                old_osdmap.get_epoch(), self._latest_osdmap.get_epoch())
-
-            self._osdmap_changed(old_osdmap, self._latest_osdmap)
-        elif notify_type == "pg_summary":
-            # if there are no events we will skip this here to avoid
-            # expensive get calls
-            if len(self._events) == 0:
-                return
-
-            global_event = False
-            data = self.get("pg_stats")
-            ready = self.get("pg_ready")
-            for ev_id in list(self._events):
-                ev = self._events[ev_id]
-                # Check for types of events
-                # we have to update
-                if isinstance(ev, PgRecoveryEvent):
-                    ev.pg_update(data, ready, self.log)
-                    self.maybe_complete(ev)
-                elif isinstance(ev, GlobalRecoveryEvent):
-                    global_event = True
-                    ev.global_event_update_progress(data, self.log)
-                    self.maybe_complete(ev)
-
-            if not global_event:
-                # If there is no global event
-                # we create one
-                self._pg_state_changed(data)
+
+        global_event = False
+        data = self.get("pg_stats")
+        ready = self.get("pg_ready")
+        for ev_id in list(self._events):
+            ev = self._events[ev_id]
+            # Check for types of events
+            # we have to update
+            if isinstance(ev, PgRecoveryEvent):
+                ev.pg_update(data, ready, self.log)
+                self.maybe_complete(ev)
+            elif isinstance(ev, GlobalRecoveryEvent):
+                global_event = True
+                ev.global_event_update_progress(self.log)
+                self.maybe_complete(ev)
+
+        if not global_event:
+            # If there is no global event
+            # we create one
+            self._pg_state_changed()
 
     def maybe_complete(self, event):
         # type: (Event) -> None
@@ -736,7 +711,11 @@ class Module(MgrModule):
                 self._save()
                 self._dirty = False
 
-            self._shutdown.wait(timeout=self.persist_interval)
+            if self.enabled:
+                self._process_osdmap()
+                self._process_pg_summary()
+
+            self._shutdown.wait(timeout=self.sleep_interval)
 
         self._shutdown.wait()
 
index 2eab07fa39f4f5ecfe0a452f18b8328199129be6..9d39cbdd6840c9b67055e1027a1b9517eeb45178 100644 (file)
@@ -38,7 +38,7 @@ class TestPgRecoveryEvent(object):
             1
           ],
           "pgid": "1.0",
-          "reported_epoch": "30"
+          "reported_epoch": 30
         },
        {
           "state": "active+clean",
@@ -55,7 +55,7 @@ class TestPgRecoveryEvent(object):
             1
           ],
           "pgid": "1.1",
-          "reported_epoch": "30"
+          "reported_epoch": 30
         },
        {
           "state": "active+clean",
@@ -72,7 +72,7 @@ class TestPgRecoveryEvent(object):
             1
           ],
           "pgid": "1.2",
-          "reported_epoch": "30"
+          "reported_epoch": 30
         }
         ]
         }
index c8b7a5302e53b865f08e5c2535a87ab67abafb6c..896c0f4e3c5ac21f27854d10ce69c72e94513a40 100644 (file)
@@ -281,6 +281,11 @@ class Module(MgrModule):
             'stale_cache_strategy',
             default='log'
         ),
+        Option(
+            'cache',
+            type='bool',
+            default=True,
+        ),
         Option(
             'rbd_stats_pools',
             default=''
@@ -302,6 +307,7 @@ class Module(MgrModule):
         self.collect_lock = threading.Lock()
         self.collect_time = 0.0
         self.scrape_interval: float = 15.0
+        self.cache = True
         self.stale_cache_strategy: str = self.STALE_CACHE_FAIL
         self.collect_cache: Optional[str] = None
         self.rbd_stats = {
@@ -1317,6 +1323,11 @@ class Module(MgrModule):
 
             @staticmethod
             def _metrics(instance: 'Module') -> Optional[str]:
+                if not self.cache:
+                    self.log.debug('Cache disabled, collecting and returning without cache')
+                    cherrypy.response.headers['Content-Type'] = 'text/plain'
+                    return self.collect()
+
                 # Return cached data if available
                 if not instance.collect_cache:
                     raise cherrypy.HTTPError(503, 'No cached data available yet')
@@ -1372,19 +1383,24 @@ class Module(MgrModule):
             (server_addr, server_port)
         )
 
-        self.metrics_thread.start()
+        self.cache = cast(bool, self.get_localized_module_option('cache', True))
+        if self.cache:
+            self.log.info('Cache enabled')
+            self.metrics_thread.start()
+        else:
+            self.log.info('Cache disabled')
 
+        cherrypy.config.update({
+            'server.socket_host': server_addr,
+            'server.socket_port': server_port,
+            'engine.autoreload.on': False
+        })
         # Publish the URI that others may use to access the service we're
         # about to start serving
         if server_addr in ['::', '0.0.0.0']:
             server_addr = self.get_mgr_ip()
         self.set_uri(build_url(scheme='http', host=server_addr, port=server_port, path='/'))
 
-        cherrypy.config.update({
-            'server.socket_host': server_addr,
-            'server.socket_port': server_port,
-            'engine.autoreload.on': False
-        })
         cherrypy.tree.mount(Root(), "/")
         self.log.info('Starting engine...')
         cherrypy.engine.start()
index 0dfd2ea73f587492fe4f7110d441d57c8c9152da..964d5548ada85c0784aa75f8dce3b9fb65cade1b 100644 (file)
@@ -321,8 +321,6 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
                 spec[svc] = orchestrator.ServiceDescription(
                     spec=NFSServiceSpec(
                         service_id=nfs_name,
-                        pool=nfs['spec']['rados']['pool'],
-                        namespace=nfs['spec']['rados'].get('namespace', None),
                         placement=PlacementSpec(count=active),
                     ),
                     size=active,
@@ -403,7 +401,7 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
         return result
 
     @handle_orch_error
-    def remove_service(self, service_name: str) -> str:
+    def remove_service(self, service_name: str, force: bool = False) -> str:
         service_type, service_name = service_name.split('.', 1)
         if service_type == 'mds':
             return self.rook_cluster.rm_service('cephfilesystems', service_name)
index 4fd660430364179cdd6fc3c4fbb704e87cd744e8..323ac68888f4c9b6d324e6bfd70d4c2e7a5b8be2 100644 (file)
@@ -23,6 +23,7 @@ from urllib3.exceptions import ProtocolError
 from ceph.deployment.drive_group import DriveGroupSpec
 from ceph.deployment.service_spec import ServiceSpec, NFSServiceSpec, RGWSpec
 from ceph.utils import datetime_now
+from mgr_module import NFS_POOL_NAME
 from mgr_util import merge_dicts
 
 from typing import Optional, TypeVar, List, Callable, Any, cast, Generic, \
@@ -41,10 +42,8 @@ from .rook_client.ceph import cephobjectstore as cos
 from .rook_client.ceph import cephcluster as ccl
 from .rook_client._helper import CrdClass
 
-
 import orchestrator
 
-
 try:
     from rook.module import RookEnv
 except ImportError:
@@ -491,7 +490,7 @@ class RookCluster(object):
                         ),
                     spec=cnfs.Spec(
                         rados=cnfs.Rados(
-                            pool=spec.pool
+                            pool=NFS_POOL_NAME,
                             ),
                         server=cnfs.Server(
                             active=count
@@ -499,8 +498,7 @@ class RookCluster(object):
                         )
                     )
 
-            if spec.namespace:
-                rook_nfsgw.spec.rados.namespace = spec.namespace
+            rook_nfsgw.spec.rados.namespace = cast(str, spec.service_id)
 
             return rook_nfsgw
 
index c459dc31de74aa67d537f8be35d3bacfabec1ba0..85fb033d61abe5ef0edf641ac1ef568279292edf 100644 (file)
@@ -1,9 +1,10 @@
 
 from mgr_module import MgrModule, CommandResult
-import threading
-import random
-import json
 import errno
+import json
+import random
+import sys
+import threading
 
 
 class Module(MgrModule):
@@ -100,6 +101,11 @@ class Module(MgrModule):
                 "desc": "Create an audit log record.",
                 "perm": "rw"
             },
+            {
+                "cmd": "mgr self-test python-version",
+                "desc": "Query the version of the embedded Python runtime",
+                "perm": "r"
+            },
             ]
 
     def __init__(self, *args, **kwargs):
@@ -109,7 +115,13 @@ class Module(MgrModule):
         self._health = {}
 
     def handle_command(self, inbuf, command):
-        if command['prefix'] == 'mgr self-test run':
+        if command['prefix'] == 'mgr self-test python-version':
+            major = sys.version_info.major
+            minor = sys.version_info.minor
+            micro = sys.version_info.micro
+            return 0, f'{major}.{minor}.{micro}', ''
+
+        elif command['prefix'] == 'mgr self-test run':
             self._self_test()
             return 0, '', 'Self-test succeeded'
 
index f02d94cc5b6fea97156c76f1adf5dcda0f88e390..bb5bcf17f792718bae51db4497ef11368e5f3660 100644 (file)
@@ -79,6 +79,7 @@ def get_prune_set(candidates, retention):
         if not period_count:
             continue
         last = None
+        kept_for_this_period = 0
         for snap in sorted(candidates, key=lambda x: x[0].d_name,
                            reverse=True):
             snap_ts = snap[1].strftime(date_pattern)
@@ -87,8 +88,10 @@ def get_prune_set(candidates, retention):
                 if snap not in keep:
                     log.debug(f'keeping {snap[0].d_name} due to {period_count}{period}')
                     keep.append(snap)
-                    if len(keep) == period_count:
-                        log.debug(f'found enough snapshots for {period_count}{period}')
+                    kept_for_this_period += 1
+                    if kept_for_this_period == period_count:
+                        log.debug(('found enough snapshots for '
+                                   f'{period_count}{period}'))
                         break
     if len(keep) > MAX_SNAPS_PER_PATH:
         log.info(f'Would keep more then {MAX_SNAPS_PER_PATH}, pruning keep set')
index 4ebed8d03b8f8bc458f39db94f975b396d077164..02996146b2698c867659ab01d2c1efd977d89a97 100644 (file)
@@ -18,3 +18,20 @@ class TestScheduleClient(object):
         prune_set = get_prune_set(candidates, ret)
         assert prune_set == set(), 'candidates are pruned despite empty retention'
 
+    def test_get_prune_set_two_retention_specs(self):
+        now = datetime.now()
+        candidates = set()
+        for i in range(10):
+            ts = now - timedelta(hours=i*1)
+            fake_dir = MagicMock()
+            fake_dir.d_name = f'scheduled-{ts.strftime(SNAPSHOT_TS_FORMAT)}'
+            candidates.add((fake_dir, ts))
+        for i in range(10):
+            ts = now - timedelta(days=i*1)
+            fake_dir = MagicMock()
+            fake_dir.d_name = f'scheduled-{ts.strftime(SNAPSHOT_TS_FORMAT)}'
+            candidates.add((fake_dir, ts))
+        # should keep 8 snapshots
+        ret = {'h': 6, 'd': 2}
+        prune_set = get_prune_set(candidates, ret)
+        assert len(prune_set) == len(candidates) - 8, 'wrong size of prune set'
index 09b82a23e22cca1d6ee441cf3fec383072381ab9..a66bc7bef7173d3e908023c23bbe0fa5b06359f7 100644 (file)
@@ -33,9 +33,11 @@ MDS_PERF_QUERY_COUNTERS_MAP = OrderedDict({'cap_hit': 0,
                                            'dentry_lease': 4,
                                            'opened_files': 5,
                                            'pinned_icaps': 6,
-                                           'opened_inodes': 7})
+                                           'opened_inodes': 7,
+                                           'read_io_sizes': 8,
+                                           'write_io_sizes': 9})
 MDS_PERF_QUERY_COUNTERS = [] # type: List[str]
-MDS_GLOBAL_PERF_QUERY_COUNTERS = ['cap_hit', 'read_latency', 'write_latency', 'metadata_latency', 'dentry_lease', 'opened_files', 'pinned_icaps', 'opened_inodes'] # type: List[str]
+MDS_GLOBAL_PERF_QUERY_COUNTERS = ['cap_hit', 'read_latency', 'write_latency', 'metadata_latency', 'dentry_lease', 'opened_files', 'pinned_icaps', 'opened_inodes', 'read_io_sizes', 'write_io_sizes'] # type: List[str]
 
 QUERY_EXPIRE_INTERVAL = timedelta(minutes=1)
 
index 2c2e6540edfeab7c2ab75ce27c0568803ff5396e..1f0698aa730361569c38d401952de524ca4803f7 100644 (file)
       "service_id": "vstart",
       "service_name": "nfs.vstart",
       "service_type": "nfs",
-      "pool": "nfs-ganesha",
-      "namespace": "vstart",
       "status": {
         "container_image_id": "36114e38494190b0c9d4b088c12e6e4086e8017b96b4d5fc14eb5406bd51b55b",
         "container_image_name": "quay.io/ceph-ci/ceph:master",
index 9d172737777fe51b2a8f7954bc570ed8ca2d90b4..d89c23bf1593c679890c77bc7fac13338be72a29 100644 (file)
@@ -227,7 +227,7 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator):
         return 'done'
 
     @handle_orch_error
-    def remove_service(self, service_name):
+    def remove_service(self, service_name, force = False):
         assert isinstance(service_name, str)
         return 'done'
 
index ff97d2e2c1f180a3d3d33a948a7274d66042a4f8..22d97e3267e6321159aaf8ff2cb741480e444a42 100644 (file)
@@ -176,11 +176,11 @@ if 'UNITTEST' in os.environ:
                 self._store = {}
 
 
-            if self.__class__.__name__ not in M_classes:
+            if self.__class__ not in M_classes:
                 # call those only once.
                 self._register_commands('')
                 self._register_options('')
-                M_classes.add(self.__class__.__name__)
+                M_classes.add(self.__class__)
 
             super(M, self).__init__()
             self._ceph_get_version = mock.Mock()
@@ -213,9 +213,14 @@ if 'UNITTEST' in os.environ:
                     return msg
                 return '[errno {0}] {1}'.format(self.errno, msg)
 
+        class MockObjectNotFound(Exception):
+            pass
 
         sys.modules.update({
-            'rados': mock.MagicMock(Error=MockRadosError, OSError=MockRadosError),
+            'rados': mock.MagicMock(
+                Error=MockRadosError,
+                OSError=MockRadosError,
+                ObjectNotFound=MockObjectNotFound),
             'rbd': mock.Mock(),
             'cephfs': mock.Mock(),
         })
index 0b0ddc9bda84df9a1d2a3cb8df34db5a8ab32a8d..858d1bd254e37d4d2937e7f96b05b7fb7dec057a 100644 (file)
@@ -9,6 +9,9 @@ envlist =
 skipsdist = true
 requires = cython
 
+[pytest]
+log_level=NOTSET
+
 [flake8]
 max-line-length = 100
 ignore =
@@ -44,6 +47,7 @@ commands =
         tests/ \
         cephadm/ \
         mds_autoscaler/ \
+        nfs/ \
         orchestrator/ \
         insights/ \
         pg_autoscaler/ \
@@ -69,6 +73,7 @@ commands =
            -m mgr_module \
            -m mgr_util \
            -m mirroring \
+           -m nfs \
            -m orchestrator \
            -m pg_autoscaler \
            -m progress \
@@ -91,7 +96,7 @@ deps =
 commands =
     python --version
     autopep8 {[autopep8]addopts} {posargs: \
-        cephadm/ orchestrator/}
+        cephadm/ orchestrator/ nfs/}
 
 [testenv:flake8]
 basepython = python3
@@ -99,6 +104,7 @@ deps =
     flake8
 modules =
     cephadm
+    nfs
     orchestrator
     prometheus
 commands =
index 65d929adac314a91805708e2a02f87fbbf219da3..ab79b279657eec0b12400dbd2701104af5458299 100644 (file)
@@ -161,3 +161,15 @@ def get_ancestor_xattr(fs, path, attr):
             raise VolumeException(-e.args[0], e.args[1])
         else:
             return get_ancestor_xattr(fs, os.path.split(path)[0], attr)
+
+def create_base_dir(fs, path, mode):
+    """
+    Create volspec base/group directory if it doesn't exist
+    """
+    try:
+        fs.stat(path)
+    except cephfs.Error as e:
+        if e.args[0] == errno.ENOENT:
+            fs.mkdirs(path, mode)
+        else:
+            raise VolumeException(-e.args[0], e.args[1])
index bcf1bc2fd73324ea8057dc2f51a5d9bdd61d1fc2..69e3959d7aa3d2ab684967854c9613382fe4d933 100644 (file)
@@ -8,7 +8,7 @@ import cephfs
 from .snapshot_util import mksnap, rmsnap
 from .pin_util import pin
 from .template import GroupTemplate
-from ..fs_util import listdir, listsnaps, get_ancestor_xattr
+from ..fs_util import listdir, listsnaps, get_ancestor_xattr, create_base_dir
 from ..exception import VolumeException
 
 log = logging.getLogger(__name__)
@@ -102,7 +102,11 @@ def create_group(fs, vol_spec, groupname, pool, mode, uid, gid):
     """
     group = Group(fs, vol_spec, groupname)
     path = group.path
-    fs.mkdirs(path, mode)
+    vol_spec_base_dir = group.vol_spec.base_dir.encode('utf-8')
+
+    # create vol_spec base directory with default mode(0o755) if it doesn't exist
+    create_base_dir(fs, vol_spec_base_dir, vol_spec.DEFAULT_MODE)
+    fs.mkdir(path, mode)
     try:
         if not pool:
             pool = get_ancestor_xattr(fs, path, "ceph.dir.layout.pool")
index 34f151c454ff700600902344821f3871176b82ee..d62effd995bd9c4909adc853aed445d00f2d2a6b 100644 (file)
@@ -18,7 +18,7 @@ from ..template import SubvolumeTemplate
 from ..snapshot_util import mksnap, rmsnap
 from ..access import allow_access, deny_access
 from ...exception import IndexException, OpSmException, VolumeException, MetadataMgrException, EvictionError
-from ...fs_util import listsnaps, is_inherited_snap
+from ...fs_util import listsnaps, is_inherited_snap, create_base_dir
 from ..template import SubvolumeOpType
 from ..group import Group
 from ..rankevicter import RankEvicter
@@ -93,6 +93,8 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate):
 
         subvol_path = os.path.join(self.base_path, str(uuid.uuid4()).encode('utf-8'))
         try:
+            # create group directory with default mode(0o755) if it doesn't exist.
+            create_base_dir(self.fs, self.group.path, self.vol_spec.DEFAULT_MODE)
             # create directory and set attributes
             self.fs.mkdirs(subvol_path, mode)
             self.mark_subvolume()
index 1dd6f3fe3aa82e6eb0d02ff45fd5c46d7845d368..f680c18adff098896550b7790d837a8bee4f6de1 100644 (file)
@@ -12,7 +12,7 @@ from .op_sm import SubvolumeOpSm
 from .subvolume_v1 import SubvolumeV1
 from ..template import SubvolumeTemplate
 from ...exception import OpSmException, VolumeException, MetadataMgrException
-from ...fs_util import listdir
+from ...fs_util import listdir, create_base_dir
 from ..template import SubvolumeOpType
 
 log = logging.getLogger(__name__)
@@ -167,6 +167,8 @@ class SubvolumeV2(SubvolumeV1):
             raise VolumeException(-errno.EAGAIN, "asynchronous purge of subvolume in progress")
         subvol_path = os.path.join(self.base_path, str(uuid.uuid4()).encode('utf-8'))
         try:
+            # create group directory with default mode(0o755) if it doesn't exist.
+            create_base_dir(self.fs, self.group.path, self.vol_spec.DEFAULT_MODE)
             self.fs.mkdirs(subvol_path, mode)
             self.mark_subvolume()
             attrs = {
index e18ab06906279488a7879204aa707cb89faa7753..5ff983115c3c1b81e227e3b922767ee4bfcb2e32 100644 (file)
@@ -9,6 +9,8 @@ class VolSpec(object):
     DEFAULT_SUBVOL_PREFIX = "/volumes"
     # and the default namespace
     DEFAULT_NS_PREFIX = "fsvolumens_"
+    # default mode for subvol prefix and group
+    DEFAULT_MODE = 0o755
 
     def __init__(self, snapshot_prefix, subvolume_prefix=None, pool_ns_prefix=None):
         self.snapshot_prefix = snapshot_prefix
index 133fce481eca234e5f741eade984198478a4667f..b0b852c1216db2fd4a5b12d5257f533df8b0be8e 100644 (file)
@@ -411,7 +411,6 @@ class ServiceSpec(object):
 
     This structure is supposed to be enough information to
     start the services.
-
     """
     KNOWN_SERVICE_TYPES = 'alertmanager crash grafana iscsi mds mgr mon nfs ' \
                           'node-exporter osd prometheus rbd-mirror rgw ' \
@@ -466,15 +465,37 @@ class ServiceSpec(object):
                  preview_only: bool = False,
                  networks: Optional[List[str]] = None,
                  ):
+
+        #: See :ref:`orchestrator-cli-placement-spec`.
         self.placement = PlacementSpec() if placement is None else placement  # type: PlacementSpec
 
         assert service_type in ServiceSpec.KNOWN_SERVICE_TYPES, service_type
+        #: The type of the service. Needs to be either a Ceph
+        #: service (``mon``, ``crash``, ``mds``, ``mgr``, ``osd`` or
+        #: ``rbd-mirror``), a gateway (``nfs`` or ``rgw``), part of the
+        #: monitoring stack (``alertmanager``, ``grafana``, ``node-exporter`` or
+        #: ``prometheus``) or (``container``) for custom containers.
         self.service_type = service_type
+
+        #: The name of the service. Required for ``iscsi``, ``mds``, ``nfs``, ``osd``, ``rgw``,
+        #: ``container``, ``ingress``
         self.service_id = None
+
         if self.service_type in self.REQUIRES_SERVICE_ID:
             self.service_id = service_id
+
+        #: If set to ``true``, the orchestrator will not deploy nor remove
+        #: any daemon associated with this service. Placement and all other properties
+        #: will be ignored. This is useful, if you do not want this service to be
+        #: managed temporarily. For cephadm, See :ref:`cephadm-spec-unmanaged`
         self.unmanaged = unmanaged
         self.preview_only = preview_only
+
+        #: A list of network identities instructing the daemons to only bind
+        #: on the particular networks in that list. In case the cluster is distributed
+        #: across multiple networks, you can add multiple networks. See
+        #: :ref:`cephadm-monitoring-networks-ports`,
+        #: :ref:`cephadm-rgw-networks` and :ref:`cephadm-mgr-networks`.
         self.networks: List[str] = networks or []
 
         self.config: Optional[Dict[str, str]] = None
@@ -519,6 +540,8 @@ class ServiceSpec(object):
         the next two major releases (octoups, pacific).
 
         :param json_spec: A valid dict with ServiceSpec
+
+        :meta private:
         """
 
         if not isinstance(json_spec, dict):
@@ -663,8 +686,6 @@ yaml.add_representer(ServiceSpec, ServiceSpec.yaml_representer)
 
 
 class NFSServiceSpec(ServiceSpec):
-    DEFAULT_POOL = 'nfs-ganesha'
-
     def __init__(self,
                  service_type: str = 'nfs',
                  service_id: Optional[str] = None,
@@ -673,8 +694,6 @@ class NFSServiceSpec(ServiceSpec):
                  preview_only: bool = False,
                  config: Optional[Dict[str, str]] = None,
                  networks: Optional[List[str]] = None,
-                 pool: Optional[str] = None,
-                 namespace: Optional[str] = None,
                  port: Optional[int] = None,
                  ):
         assert service_type == 'nfs'
@@ -683,12 +702,6 @@ class NFSServiceSpec(ServiceSpec):
             placement=placement, unmanaged=unmanaged, preview_only=preview_only,
             config=config, networks=networks)
 
-        #: RADOS pool where NFS client recovery data is stored.
-        self.pool = pool or self.DEFAULT_POOL
-
-        #: RADOS namespace where NFS client recovery data is stored in the pool.
-        self.namespace = namespace or self.service_id
-
         self.port = port
 
     def get_port_start(self) -> List[int]:
@@ -696,27 +709,10 @@ class NFSServiceSpec(ServiceSpec):
             return [self.port]
         return []
 
-    def validate(self) -> None:
-        super(NFSServiceSpec, self).validate()
-
-        if not self.pool:
-            raise SpecValidationError(
-                'Cannot add NFS: No Pool specified')
-
     def rados_config_name(self):
         # type: () -> str
         return 'conf-' + self.service_name()
 
-    def rados_config_location(self):
-        # type: () -> str
-        url = ''
-        if self.pool:
-            url += 'rados://' + self.pool + '/'
-            if self.namespace:
-                url += self.namespace + '/'
-            url += self.rados_config_name()
-        return url
-
 
 yaml.add_representer(NFSServiceSpec, ServiceSpec.yaml_representer)
 
@@ -725,7 +721,21 @@ class RGWSpec(ServiceSpec):
     """
     Settings to configure a (multisite) Ceph RGW
 
+    .. code-block:: yaml
+
+        service_type: rgw
+        service_id: myrealm.myzone
+        spec:
+            rgw_realm: myrealm
+            rgw_zone: myzone
+            ssl: true
+            rgw_frontend_port: 1234
+            rgw_frontend_type: beast
+            rgw_frontend_ssl_certificate: ...
+
+    See also: :ref:`orchestrator-cli-service-spec`
     """
+
     MANAGED_CONFIG_OPTIONS = ServiceSpec.MANAGED_CONFIG_OPTIONS + [
         'rgw_zone',
         'rgw_realm',
@@ -759,11 +769,17 @@ class RGWSpec(ServiceSpec):
             placement=placement, unmanaged=unmanaged,
             preview_only=preview_only, config=config, networks=networks)
 
-        self.rgw_realm = rgw_realm
-        self.rgw_zone = rgw_zone
-        self.rgw_frontend_port = rgw_frontend_port
-        self.rgw_frontend_ssl_certificate = rgw_frontend_ssl_certificate
-        self.rgw_frontend_type = rgw_frontend_type
+        #: The RGW realm associated with this service. Needs to be manually created
+        self.rgw_realm: Optional[str] = rgw_realm
+        #: The RGW zone associated with this service. Needs to be manually created
+        self.rgw_zone: Optional[str] = rgw_zone
+        #: Port of the RGW daemons
+        self.rgw_frontend_port: Optional[int] = rgw_frontend_port
+        #: List of SSL certificates
+        self.rgw_frontend_ssl_certificate: Optional[List[str]] = rgw_frontend_ssl_certificate
+        #: civetweb or beast (default: beast). See :ref:`rgw_frontends`
+        self.rgw_frontend_type: Optional[str] = rgw_frontend_type
+        #: enable SSL
         self.ssl = ssl
 
     def get_port_start(self) -> List[int]:
@@ -817,12 +833,19 @@ class IscsiServiceSpec(ServiceSpec):
 
         #: RADOS pool where ceph-iscsi config data is stored.
         self.pool = pool
+        #: list of trusted IP addresses
         self.trusted_ip_list = trusted_ip_list
+        #: ``api_port`` as defined in the ``iscsi-gateway.cfg``
         self.api_port = api_port
+        #: ``api_user`` as defined in the ``iscsi-gateway.cfg``
         self.api_user = api_user
+        #: ``api_password`` as defined in the ``iscsi-gateway.cfg``
         self.api_password = api_password
+        #: ``api_secure`` as defined in the ``iscsi-gateway.cfg``
         self.api_secure = api_secure
+        #: SSL certificate
         self.ssl_cert = ssl_cert
+        #: SSL private key
         self.ssl_key = ssl_key
 
         if not self.api_secure and self.ssl_cert and self.ssl_key:
index a7591e6c04a4b0c668ab8c1a1765003c4f8d3bb6..a360f12632324d5e9ce6b25ca95a3fea5e8643a1 100644 (file)
@@ -142,7 +142,7 @@ def _get_dict_spec(s_type, s_id):
             dict(hosts=["host1:1.1.1.1"])
     }
     if s_type == 'nfs':
-        dict_spec['pool'] = 'pool'
+        pass
     elif s_type == 'iscsi':
         dict_spec['pool'] = 'pool'
         dict_spec['api_user'] = 'api_user'
index 89f0654aa0b8c2f3e4d8f305ba16413bae82ef36..f5a85c4d3b7be1b79c263e193ae3b9b4f2227633 100644 (file)
@@ -77,17 +77,17 @@ def parse_timedelta(delta: str) -> Optional[datetime.timedelta]:
 
     >>> parse_timedelta('foo')
 
-    >>> parse_timedelta('2d')
-    datetime.timedelta(days=2)
+    >>> parse_timedelta('2d') == datetime.timedelta(days=2)
+    True
 
-    >>> parse_timedelta("4w")
-    datetime.timedelta(days=28)
+    >>> parse_timedelta("4w") == datetime.timedelta(days=28)
+    True
 
-    >>> parse_timedelta("5s")
-    datetime.timedelta(seconds=5)
+    >>> parse_timedelta("5s") == datetime.timedelta(seconds=5)
+    True
 
-    >>> parse_timedelta("-5s")
-    datetime.timedelta(days=-1, seconds=86395)
+    >>> parse_timedelta("-5s") == datetime.timedelta(days=-1, seconds=86395)
+    True
 
     :param delta: The string to process, e.g. '2h', '10d', '30s'.
     :return: The `datetime.timedelta` object or `None` in case of
index 6c7f39a4e4f5b5b03c1483304ffc5d8dc7a94b07..e9e586da96ef9a919766fd42602461a4132be36a 100644 (file)
@@ -341,8 +341,7 @@ namespace rgw {
               << e.what() << dendl;
     }
     if (should_log) {
-      rgw_log_op(store->getRados(), nullptr /* !rest */, s,
-                (op ? op->name() : "unknown"), olog);
+      rgw_log_op(nullptr /* !rest */, s, (op ? op->name() : "unknown"), olog);
     }
 
     int http_ret = s->err.http_ret;
@@ -589,10 +588,20 @@ namespace rgw {
 
     // XXX ex-RGWRESTMgr_lib, mgr->set_logging(true)
 
+    OpsLogManifold* olog_manifold = new OpsLogManifold();
     if (!g_conf()->rgw_ops_log_socket_path.empty()) {
-      olog = new OpsLogSocket(g_ceph_context, g_conf()->rgw_ops_log_data_backlog);
-      olog->init(g_conf()->rgw_ops_log_socket_path);
+      OpsLogSocket* olog_socket = new OpsLogSocket(g_ceph_context, g_conf()->rgw_ops_log_data_backlog);
+      olog_socket->init(g_conf()->rgw_ops_log_socket_path);
+      olog_manifold->add_sink(olog_socket);
     }
+    OpsLogFile* ops_log_file;
+    if (!g_conf()->rgw_ops_log_file_path.empty()) {
+      ops_log_file = new OpsLogFile(g_ceph_context, g_conf()->rgw_ops_log_file_path, g_conf()->rgw_ops_log_data_backlog);
+      ops_log_file->start();
+      olog_manifold->add_sink(ops_log_file);
+    }
+    olog_manifold->add_sink(new OpsLogRados(store->getRados()));
+    olog = olog_manifold;
 
     int port = 80;
     RGWProcessEnv env = { store, &rest, olog, port };
@@ -653,7 +662,7 @@ namespace rgw {
     shutdown_async_signal_handler();
 
     rgw_log_usage_finalize();
-
+    
     delete olog;
 
     RGWStoreManager::close_storage(store);
index 939e5e95029d218079bc748a1c22fe9568c0f4cd..725df23a1400a9003a8f51d48923ab360c204799 100644 (file)
@@ -385,9 +385,7 @@ int rgw_remove_bucket_bypass_gc(rgw::sal::RGWRadosStore *store, rgw_bucket& buck
   if (ret < 0)
     return ret;
 
-  string prefix, delimiter;
-
-  ret = abort_bucket_multiparts(dpp, store, cct, info, prefix, delimiter);
+  ret = abort_bucket_multiparts(dpp, store, cct, info);
   if (ret < 0) {
     return ret;
   }
@@ -1279,7 +1277,7 @@ int RGWBucketAdminOp::remove_bucket(rgw::sal::RGWRadosStore *store, RGWBucketAdm
   if (bypass_gc)
     ret = rgw_remove_bucket_bypass_gc(store, bucket->get_key(), op_state.get_max_aio(), keep_index_consistent, y, dpp);
   else
-    ret = bucket->remove_bucket(dpp, op_state.will_delete_children(), string(), string(),
+    ret = bucket->remove_bucket(dpp, op_state.will_delete_children(),
                                false, nullptr, y);
 
   return ret;
index bbd8ab6f70b9429c48b3f1c89617f2a52d5ede66..b44d4bfa784fba28cd03a146efad192cb16423fc 100644 (file)
@@ -2260,6 +2260,11 @@ void RGWBucketInfo::decode(bufferlist::const_iterator& bl) {
   if (struct_v >= 23) {
     decode(owner.ns, bl);
   }
+
+  if (layout.logs.empty() &&
+      layout.current_index.layout.type == rgw::BucketIndexType::Normal) {
+    layout.logs.push_back(rgw::log_layout_from_index(0, layout.current_index.layout.normal));
+  }
   DECODE_FINISH(bl);
 }
 
index 227d20e82c121137a621bfc4a1091ae1079ac786..3835b7776a8885f49a368333be4228f159e6482d 100644 (file)
@@ -282,12 +282,29 @@ void rgw_bucket::generate_test_instances(list<rgw_bucket*>& o)
 
 void RGWBucketInfo::generate_test_instances(list<RGWBucketInfo*>& o)
 {
+  // Since things without a log will have one synthesized on decode,
+  // ensure the things we attempt to encode will have one added so we
+  // round-trip properly.
+  auto gen_layout = [](rgw::BucketLayout& l) {
+    l.current_index.gen = 0;
+    l.current_index.layout.normal.hash_type = rgw::BucketHashType::Mod;
+    l.current_index.layout.type = rgw::BucketIndexType::Normal;
+    l.current_index.layout.normal.num_shards = 11;
+    l.logs.push_back(log_layout_from_index(
+                      l.current_index.gen,
+                      l.current_index.layout.normal));
+  };
+
+
   RGWBucketInfo *i = new RGWBucketInfo;
   init_bucket(&i->bucket, "tenant", "bucket", "pool", ".index_pool", "marker", "10");
   i->owner = "owner";
   i->flags = BUCKET_SUSPENDED;
+  gen_layout(i->layout);
+  o.push_back(i);
+  i = new RGWBucketInfo;
+  gen_layout(i->layout);
   o.push_back(i);
-  o.push_back(new RGWBucketInfo);
 }
 
 void RGWZoneGroup::generate_test_instances(list<RGWZoneGroup*>& o)
index 9f43593fc720c26d6e18d2689ec2cc079384a001..91c325255e496862416cb83d0e368394c625932e 100644 (file)
@@ -20,7 +20,7 @@
 
 #define dout_subsys ceph_subsys_rgw
 
-class OpsLogSocket;
+class OpsLogSink;
 
 namespace rgw {
 
@@ -29,7 +29,7 @@ namespace rgw {
   class RGWLib : public DoutPrefixProvider {
     RGWFrontendConfig* fec;
     RGWLibFrontend* fe;
-    OpsLogSocket* olog;
+    OpsLogSink* olog;
     rgw::LDAPHelper* ldh{nullptr};
     RGWREST rest; // XXX needed for RGWProcessEnv
     rgw::sal::RGWRadosStore* store;
index edfd0087b6df2a9752fa279405d4b5fcfb7571af..efe165089ff6ba435ca883b96ed76f345ee84316 100644 (file)
@@ -16,6 +16,9 @@
 
 #include "services/svc_zone.h"
 
+#include <chrono>
+#include <math.h>
+
 #define dout_subsys ceph_subsys_rgw
 
 static void set_param_str(struct req_state *s, const char *name, string& str)
@@ -295,15 +298,142 @@ void rgw_format_ops_log_entry(struct rgw_log_entry& entry, Formatter *formatter)
   formatter->close_section();
 }
 
-void OpsLogSocket::formatter_to_bl(bufferlist& bl)
+OpsLogManifold::~OpsLogManifold()
+{
+    for (const auto &sink : sinks) {
+        delete sink;
+    }
+}
+
+void OpsLogManifold::add_sink(OpsLogSink* sink)
+{
+    sinks.push_back(sink);
+}
+
+int OpsLogManifold::log(struct req_state* s, struct rgw_log_entry& entry)
+{
+  int ret = 0;
+  for (const auto &sink : sinks) {
+    if (sink->log(s, entry) < 0) {
+      ret = -1;
+    }
+  }
+  return ret;
+}
+
+OpsLogFile::OpsLogFile(CephContext* cct, std::string& path, uint64_t max_data_size) :
+  cct(cct), file(path, std::ofstream::app), data_size(0), max_data_size(max_data_size)
+{
+}
+
+void OpsLogFile::flush()
+{
+  std::scoped_lock flush_lock(flush_mutex);
+  {
+    std::scoped_lock log_lock(log_mutex);
+    assert(flush_buffer.empty());
+    flush_buffer.swap(log_buffer);
+    data_size = 0;
+  }
+  for (auto bl : flush_buffer) {
+    int try_num = 0;
+    while (true) {
+      bl.write_stream(file);
+      if (!file) {
+        ldpp_dout(this, 0) << "ERROR: failed to log RGW ops log file entry" << dendl;
+        file.clear();
+        if (stopped) {
+          break;
+        }
+        int sleep_time_secs = std::min((int) pow(2, try_num), 60);
+        std::this_thread::sleep_for(std::chrono::seconds(sleep_time_secs));
+        try_num++;
+      } else {
+        break;
+      }
+    }
+  }
+  flush_buffer.clear();
+  file << std::endl;
+}
+
+void* OpsLogFile::entry() {
+  std::unique_lock lock(log_mutex);
+  while (!stopped) {
+    if (!log_buffer.empty()) {
+      lock.unlock();
+      flush();
+      lock.lock();
+      continue;
+    }
+    cond_flush.wait(lock);
+  }
+  flush();
+  return NULL;
+}
+
+void OpsLogFile::start() {
+  stopped = false;
+  create("ops_log_file");
+}
+
+void OpsLogFile::stop() {
+  {
+    cond_flush.notify_one();
+    stopped = true;
+  }
+  join();
+}
+
+OpsLogFile::~OpsLogFile()
+{
+  if (!stopped) {
+    stop();
+  }
+  file.close();
+}
+
+int OpsLogFile::log_json(struct req_state* s, bufferlist& bl)
+{
+  std::unique_lock lock(log_mutex);
+  if (data_size + bl.length() >= max_data_size) {
+    ldout(s->cct, 0) << "ERROR: RGW ops log file buffer too full, dropping log for txn: " << s->trans_id << dendl;
+    return -1;
+  }
+  log_buffer.push_back(bl);
+  data_size += bl.length();
+  cond_flush.notify_all();
+  return 0;
+}
+
+JsonOpsLogSink::JsonOpsLogSink() {
+  formatter = new JSONFormatter;
+}
+
+JsonOpsLogSink::~JsonOpsLogSink() {
+  delete formatter;
+}
+
+void JsonOpsLogSink::formatter_to_bl(bufferlist& bl)
 {
   stringstream ss;
   formatter->flush(ss);
   const string& s = ss.str();
-
   bl.append(s);
 }
 
+int JsonOpsLogSink::log(struct req_state* s, struct rgw_log_entry& entry)
+{
+  bufferlist bl;
+
+  lock.lock();
+  rgw_format_ops_log_entry(entry, formatter);
+  formatter_to_bl(bl);
+  lock.unlock();
+
+  return log_json(s, bl);
+}
+
 void OpsLogSocket::init_connection(bufferlist& bl)
 {
   bl.append("[");
@@ -311,29 +441,53 @@ void OpsLogSocket::init_connection(bufferlist& bl)
 
 OpsLogSocket::OpsLogSocket(CephContext *cct, uint64_t _backlog) : OutputDataSocket(cct, _backlog)
 {
-  formatter = new JSONFormatter;
   delim.append(",\n");
 }
 
-OpsLogSocket::~OpsLogSocket()
+int OpsLogSocket::log_json(struct req_state* s, bufferlist& bl)
 {
-  delete formatter;
+  append_output(bl);
+  return 0;
 }
 
-void OpsLogSocket::log(struct rgw_log_entry& entry)
+OpsLogRados::OpsLogRados(RGWRados* store): store(store)
 {
+}
+
+int OpsLogRados::log(struct req_state* s, struct rgw_log_entry& entry)
+{
+  if (!s->cct->_conf->rgw_ops_log_rados) {
+    return 0;
+  }
   bufferlist bl;
+  encode(entry, bl);
 
-  lock.lock();
-  rgw_format_ops_log_entry(entry, formatter);
-  formatter_to_bl(bl);
-  lock.unlock();
+  struct tm bdt;
+  time_t t = req_state::Clock::to_time_t(entry.time);
+  if (s->cct->_conf->rgw_log_object_name_utc)
+    gmtime_r(&t, &bdt);
+  else
+    localtime_r(&t, &bdt);
 
-  append_output(bl);
+  string oid = render_log_object_name(s->cct->_conf->rgw_log_object_name, &bdt,
+                                      entry.bucket_id, entry.bucket);
+  rgw_raw_obj obj(store->svc.zone->get_zone_params().log_pool, oid);
+  int ret = store->append_async(s, obj, bl.length(), bl);
+  if (ret == -ENOENT) {
+      ret = store->create_pool(s, store->svc.zone->get_zone_params().log_pool);
+      if (ret < 0)
+          goto done;
+      // retry
+      ret = store->append_async(s, obj, bl.length(), bl);
+  }
+done:
+  if (ret < 0) {
+      ldpp_dout(s, 0) << "ERROR: failed to log RADOS RGW ops log entry for txn: " << s->trans_id << dendl;
+  }
+  return ret;
 }
 
-int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
-              const string& op_name, OpsLogSocket *olog)
+int rgw_log_op(RGWREST* const rest, struct req_state *s, const string& op_name, OpsLogSink *olog)
 {
   struct rgw_log_entry entry;
   string bucket_id;
@@ -444,48 +598,14 @@ int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
     char buf[16];
     snprintf(buf, sizeof(buf), "%d", s->err.http_ret);
     entry.http_status = buf;
-  } else
+  } else {
     entry.http_status = "200"; // default
-
+  }
   entry.error_code = s->err.err_code;
   entry.bucket_id = bucket_id;
   entry.trans_id = s->trans_id;
-
-  bufferlist bl;
-  encode(entry, bl);
-
-  struct tm bdt;
-  time_t t = req_state::Clock::to_time_t(entry.time);
-  if (s->cct->_conf->rgw_log_object_name_utc)
-    gmtime_r(&t, &bdt);
-  else
-    localtime_r(&t, &bdt);
-
-  int ret = 0;
-
-  if (s->cct->_conf->rgw_ops_log_rados) {
-    string oid = render_log_object_name(s->cct->_conf->rgw_log_object_name, &bdt,
-                                       entry.bucket_id, entry.bucket);
-
-    rgw_raw_obj obj(store->svc.zone->get_zone_params().log_pool, oid);
-
-    ret = store->append_async(s, obj, bl.length(), bl);
-    if (ret == -ENOENT) {
-      ret = store->create_pool(s, store->svc.zone->get_zone_params().log_pool);
-      if (ret < 0)
-        goto done;
-      // retry
-      ret = store->append_async(s, obj, bl.length(), bl);
-    }
-  }
-
   if (olog) {
-    olog->log(entry);
+    return olog->log(s, entry);
   }
-done:
-  if (ret < 0)
-    ldpp_dout(s, 0) << "ERROR: failed to log entry" << dendl;
-
-  return ret;
+  return 0;
 }
-
index 1de5227939a114bd4de7d7f94b4b0159bce685d0..90131889da4e6e95b775267188ba5d8a90838fa6 100644 (file)
@@ -7,6 +7,10 @@
 #include <boost/container/flat_map.hpp>
 #include "rgw_common.h"
 #include "common/OutputDataSocket.h"
+#include <vector>
+#include <fstream>
+
+#define dout_subsys ceph_subsys_rgw
 
 class RGWRados;
 
@@ -125,26 +129,79 @@ struct rgw_log_entry {
 };
 WRITE_CLASS_ENCODER(rgw_log_entry)
 
-class OpsLogSocket : public OutputDataSocket {
+class OpsLogSink {
+public:
+  virtual int log(struct req_state* s, struct rgw_log_entry& entry) = 0;
+  virtual ~OpsLogSink() = default;
+};
+
+class OpsLogManifold: public OpsLogSink {
+  std::vector<OpsLogSink*> sinks;
+public:
+  ~OpsLogManifold() override;
+  void add_sink(OpsLogSink* sink);
+  int log(struct req_state* s, struct rgw_log_entry& entry) override;
+};
+
+class JsonOpsLogSink : public OpsLogSink {
   ceph::Formatter *formatter;
-  ceph::mutex lock = ceph::make_mutex("OpsLogSocket");
+  ceph::mutex lock = ceph::make_mutex("JsonOpsLogSink");
 
   void formatter_to_bl(bufferlist& bl);
+protected:
+  virtual int log_json(struct req_state* s, bufferlist& bl) = 0;
+public:
+  JsonOpsLogSink();
+  ~JsonOpsLogSink() override;
+  int log(struct req_state* s, struct rgw_log_entry& entry) override;
+};
+
+class OpsLogFile : public JsonOpsLogSink, public Thread, public DoutPrefixProvider {
+  CephContext* cct;
+  ceph::mutex log_mutex = ceph::make_mutex("OpsLogFile_log");
+  ceph::mutex flush_mutex = ceph::make_mutex("OpsLogFile_flush");
+  std::vector<bufferlist> log_buffer;
+  std::vector<bufferlist> flush_buffer;
+  ceph::condition_variable cond_flush;
+  std::ofstream file;
+  bool stopped;
+  uint64_t data_size;
+  uint64_t max_data_size;
+
+  void flush();
+protected:
+  int log_json(struct req_state* s, bufferlist& bl) override;
+  void *entry() override;
+public:
+  OpsLogFile(CephContext* cct, std::string& path, uint64_t max_data_size);
+  ~OpsLogFile() override;
+  CephContext *get_cct() const override { return cct; }
+  unsigned get_subsys() const override { return dout_subsys; }
+  std::ostream& gen_prefix(std::ostream& out) const override { return out << "rgw OpsLogFile: "; }
+  void start();
+  void stop();
+};
 
+class OpsLogSocket : public OutputDataSocket, public JsonOpsLogSink {
 protected:
+  int log_json(struct req_state* s, bufferlist& bl) override;
   void init_connection(bufferlist& bl) override;
 
 public:
   OpsLogSocket(CephContext *cct, uint64_t _backlog);
-  ~OpsLogSocket() override;
+};
 
-  void log(struct rgw_log_entry& entry);
+class OpsLogRados : public OpsLogSink {
+  RGWRados* store;
+public:
+  OpsLogRados(RGWRados* store);
+  int log(struct req_state* s, struct rgw_log_entry& entry) override;
 };
 
 class RGWREST;
 
-int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
-              const string& op_name, OpsLogSocket *olog);
+int rgw_log_op(RGWREST* const rest, struct req_state* s,
+              const std::string& op_name, OpsLogSink* olog);
 void rgw_log_usage_init(CephContext *cct, RGWRados *store);
 void rgw_log_usage_finalize();
 void rgw_format_ops_log_entry(struct rgw_log_entry& entry,
index ebf1edf7d58b206e4798dedee615da9baa60cd61..6e5ab86daeed57153dffd0a7853956cf52c156be 100644 (file)
@@ -24,16 +24,15 @@ constexpr const char* RequestLogAction{"Log"};
 
 int RequestLog(lua_State* L) 
 {
-  const auto store = reinterpret_cast<rgw::sal::RGWRadosStore*>(lua_touserdata(L, lua_upvalueindex(1)));
-  const auto rest = reinterpret_cast<RGWREST*>(lua_touserdata(L, lua_upvalueindex(2)));
-  const auto olog = reinterpret_cast<OpsLogSocket*>(lua_touserdata(L, lua_upvalueindex(3)));
-  const auto s = reinterpret_cast<req_state*>(lua_touserdata(L, lua_upvalueindex(4)));
-  const std::string op_name(reinterpret_cast<const char*>(lua_touserdata(L, lua_upvalueindex(5))));
-  if (store && s) {
-    const auto rc = rgw_log_op(store->getRados(), rest, s, op_name, olog);
+  const auto rest = reinterpret_cast<RGWREST*>(lua_touserdata(L, lua_upvalueindex(1)));
+  const auto olog = reinterpret_cast<OpsLogSink*>(lua_touserdata(L, lua_upvalueindex(2)));
+  const auto s = reinterpret_cast<req_state*>(lua_touserdata(L, lua_upvalueindex(3)));
+  const std::string op_name(reinterpret_cast<const char*>(lua_touserdata(L, lua_upvalueindex(4))));
+  if (s) {
+    const auto rc = rgw_log_op(rest, s, op_name, olog);
     lua_pushinteger(L, rc);
   } else {
-    ldpp_dout(s, 1) << "Lua ERROR: missing rados store, cannot use ops log"  << dendl;
+    ldpp_dout(s, 1) << "Lua ERROR: missing request state, cannot use ops log"  << dendl;
     lua_pushinteger(L, -EINVAL);
   }
 
@@ -771,7 +770,7 @@ struct RequestMetaTable : public EmptyMetaTable {
 int execute(
     rgw::sal::RGWRadosStore* store,
     RGWREST* rest,
-    OpsLogSocket* olog,
+    OpsLogSink* olog,
     req_state* s, 
     const char* op_name,
     const std::string& script)
@@ -793,12 +792,11 @@ int execute(
   lua_getglobal(L, RequestMetaTable::TableName().c_str());
   ceph_assert(lua_istable(L, -1));
   pushstring(L, RequestLogAction);
-  lua_pushlightuserdata(L, store);
   lua_pushlightuserdata(L, rest);
   lua_pushlightuserdata(L, olog);
   lua_pushlightuserdata(L, s);
   lua_pushlightuserdata(L, const_cast<char*>(op_name));
-  lua_pushcclosure(L, RequestLog, FIVE_UPVALS);
+  lua_pushcclosure(L, RequestLog, FOUR_UPVALS);
   lua_rawset(L, -3);
 
   try {
index 5ace5bf157fc442c3d437cac6316c6a620c8c8a1..f736b9dbbb20670f94e9d48a22eef099edc1416b 100644 (file)
@@ -5,7 +5,7 @@
 
 class req_state;
 class RGWREST;
-class OpsLogSocket;
+class OpsLogSink;
 namespace rgw::sal {
   class RGWRadosStore;
 }
@@ -16,7 +16,7 @@ namespace rgw::lua::request {
 int execute(
     rgw::sal::RGWRadosStore* store,
     RGWREST* rest,
-    OpsLogSocket* olog,
+    OpsLogSink* olog,
     req_state *s, 
     const char* op_name,
     const std::string& script);
index 284a5387c092376453b360d96843a0833fda9b10..2345a5dbea9066fe4ad0be5cedea2326a76ae438 100644 (file)
@@ -501,12 +501,19 @@ int radosgw_Main(int argc, const char **argv)
 
   rgw::dmclock::SchedulerCtx sched_ctx{cct.get()};
 
-  OpsLogSocket *olog = NULL;
-
+  OpsLogManifold *olog = new OpsLogManifold();
   if (!g_conf()->rgw_ops_log_socket_path.empty()) {
-    olog = new OpsLogSocket(g_ceph_context, g_conf()->rgw_ops_log_data_backlog);
-    olog->init(g_conf()->rgw_ops_log_socket_path);
+    OpsLogSocket* olog_socket = new OpsLogSocket(g_ceph_context, g_conf()->rgw_ops_log_data_backlog);
+    olog_socket->init(g_conf()->rgw_ops_log_socket_path);
+    olog->add_sink(olog_socket);
+  }
+  OpsLogFile* ops_log_file;
+  if (!g_conf()->rgw_ops_log_file_path.empty()) {
+    ops_log_file = new OpsLogFile(g_ceph_context, g_conf()->rgw_ops_log_file_path, g_conf()->rgw_ops_log_data_backlog);
+    ops_log_file->start();
+    olog->add_sink(ops_log_file);
   }
+  olog->add_sink(new OpsLogRados(store->getRados()));
 
   r = signal_fd_init();
   if (r < 0) {
@@ -678,7 +685,6 @@ int radosgw_Main(int argc, const char **argv)
   shutdown_async_signal_handler();
 
   rgw_log_usage_finalize();
-
   delete olog;
 
   RGWStoreManager::close_storage(store);
index 10bc6559f75d1256ff414559d5e52543734a949c..f035d1bc21477c825726b7a510903318a310d561 100644 (file)
@@ -288,17 +288,20 @@ int abort_multipart_upload(const DoutPrefixProvider *dpp,
   return (ret == -ENOENT) ? -ERR_NO_SUCH_UPLOAD : ret;
 }
 
-int list_bucket_multiparts(const DoutPrefixProvider *dpp, 
-                           rgw::sal::RGWRadosStore *store, RGWBucketInfo& bucket_info,
-                          const string& prefix, const string& marker,
-                          const string& delim,
+int list_bucket_multiparts(const DoutPrefixProvider* dpp,
+                          rgw::sal::RGWRadosStore* store,
+                          RGWBucketInfo& bucket_info,
+                          const std::string& prefix,
+                          std::string& marker, // in/out
+                          const std::string& delim,
                           const int& max_uploads,
-                          vector<rgw_bucket_dir_entry> *objs,
-                          map<string, bool> *common_prefixes, bool *is_truncated)
+                          std::vector<rgw_bucket_dir_entry>* objs,
+                          std::map<std::string, bool>* common_prefixes,
+                          bool* is_truncated)
 {
   RGWRados::Bucket target(store->getRados(), bucket_info);
   RGWRados::Bucket::List list_op(&target);
-  MultipartMetaFilter mp_filter;
+  MultipartMetaFilter mp_filter; // filter out all but ".meta" entries
 
   list_op.params.prefix = prefix;
   list_op.params.delim = delim;
@@ -306,12 +309,17 @@ int list_bucket_multiparts(const DoutPrefixProvider *dpp,
   list_op.params.ns = RGW_OBJ_NS_MULTIPART;
   list_op.params.filter = &mp_filter;
 
-  return(list_op.list_objects(dpp, max_uploads, objs, common_prefixes, is_truncated, null_yield));
+  int ret = list_op.list_objects(dpp, max_uploads, objs, common_prefixes, is_truncated, null_yield);
+  if (ret >= 0) {
+    marker = list_op.params.marker.name;
+  }
+  return ret;
 }
 
-int abort_bucket_multiparts(const DoutPrefixProvider *dpp, 
-                            rgw::sal::RGWRadosStore *store, CephContext *cct, 
-                            RGWBucketInfo& bucket_info, string& prefix, string& delim)
+int abort_bucket_multiparts(const DoutPrefixProvider* dpp,
+                           rgw::sal::RGWRadosStore* store,
+                           CephContext* cct,
+                           RGWBucketInfo& bucket_info)
 {
   constexpr int max = 1000;
   int ret, num_deleted = 0;
@@ -320,14 +328,16 @@ int abort_bucket_multiparts(const DoutPrefixProvider *dpp,
   string marker;
   bool is_truncated;
 
+  const std::string empty_delim;
+  const std::string empty_prefix;
+
   do {
-    ret = list_bucket_multiparts(dpp, store, bucket_info, prefix, marker, delim,
+    ret = list_bucket_multiparts(dpp, store, bucket_info, empty_prefix, marker, empty_delim,
                                 max, &objs, nullptr, &is_truncated);
     if (ret < 0) {
       ldpp_dout(dpp, 0) << __func__ <<
        " ERROR : calling list_bucket_multiparts; ret=" << ret <<
-       "; bucket=\"" << bucket_info.bucket << "\"; prefix=\"" <<
-       prefix << "\"; delim=\"" << delim << "\"" << dendl;
+       "; bucket=\"" << bucket_info.bucket << "\"" << dendl;
       return ret;
     }
     ldpp_dout(dpp, 20) << __func__ <<
index c58901a9fb036dafb40dbc32996857137f2e7307..31069417e9169f1848c2a7571a9982e00c06ca6e 100644 (file)
@@ -129,15 +129,19 @@ extern int list_multipart_parts(const DoutPrefixProvider *dpp,
 extern int abort_multipart_upload(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, CephContext *cct, RGWObjectCtx *obj_ctx,
                                 RGWBucketInfo& bucket_info, RGWMPObj& mp_obj);
 
-extern int list_bucket_multiparts(const DoutPrefixProvider *dpp, 
-                                  rgw::sal::RGWRadosStore *store, RGWBucketInfo& bucket_info,
-                                 const string& prefix,
-                                 const string& marker,
-                                 const string& delim,
+extern int list_bucket_multiparts(const DoutPrefixProvider* dpp,
+                                 rgw::sal::RGWRadosStore* store,
+                                 RGWBucketInfo& bucket_info,
+                                 const std::string& prefix,
+                                 std::string& marker, // in/out
+                                 const std::string& delim,
                                  const int& max_uploads,
-                                 vector<rgw_bucket_dir_entry> *objs,
-                                 map<string, bool> *common_prefixes, bool *is_truncated);
-
-extern int abort_bucket_multiparts(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore *store, CephContext *cct, RGWBucketInfo& bucket_info,
-                                string& prefix, string& delim);
+                                 std::vector<rgw_bucket_dir_entry>* objs,
+                                 std::map<std::string, bool>* common_prefixes,
+                                 bool* is_truncated);
+
+extern int abort_bucket_multiparts(const DoutPrefixProvider* dpp,
+                                  rgw::sal::RGWRadosStore* store,
+                                  CephContext* cct,
+                                  RGWBucketInfo& bucket_info);
 #endif
index f40c2adaf588bb07796fbb7daf1c6202c38cfd9a..14679f7004ee00b0852b6fcf96cef9bbc680ecee 100644 (file)
@@ -676,7 +676,7 @@ void populate_event_from_request(const reservation_t& res,
         rgw_pubsub_s3_event& event) {
   const auto s = res.s;
   event.eventTime = mtime;
-  event.eventName = to_string(event_type);
+  event.eventName = to_event_string(event_type);
   event.userIdentity = s->user->get_id().id;    // user that triggered the change
   event.x_amz_request_id = s->req_id;          // request ID of the original change
   event.x_amz_id_2 = s->host_id;               // RGW on which the change was made
index 10c77c2818455d3bdf82d2d8700533e9afdfb3a2..4af9a32f7e3b36eb6e26028a4c685781bcdc0482 100644 (file)
@@ -49,6 +49,10 @@ namespace rgw::notify {
     return "UNKNOWN_EVENT";
   }
 
+  std::string to_event_string(EventType t) {
+    return to_string(t).substr(3);
+  }
+
   EventType from_string(const std::string& s) {
     if (s == "s3:ObjectCreated:*" || s == "OBJECT_CREATE")
         return ObjectCreated;
index 0d86bf3f3219f3c81fe37ab742c59bd1dd55bbf8..f255bfd744eb23971d1153d26dcc6efcba904fe8 100644 (file)
@@ -27,6 +27,8 @@ namespace rgw::notify {
 
   std::string to_ceph_string(EventType t);
 
+  std::string to_event_string(EventType t);
+
   EventType from_string(const std::string& s);
  
   // create a vector of event types from comma separated list of event types
index cd05f8ab8dbe0c039024cdaa63865a614e82d34e..02ae8a93fd046c074b789ddd7c10440e66ac9470 100644 (file)
@@ -3351,22 +3351,7 @@ void RGWDeleteBucket::execute(optional_yield y)
     return;
   }
 
-  string prefix, delimiter;
-
-  if (s->prot_flags & RGW_REST_SWIFT) {
-    string path_args;
-    path_args = s->info.args.get("path");
-    if (!path_args.empty()) {
-      if (!delimiter.empty() || !prefix.empty()) {
-        op_ret = -EINVAL;
-        return;
-      }
-      prefix = path_args;
-      delimiter="/";
-    }
-  }
-
-  op_ret = s->bucket->remove_bucket(this, false, prefix, delimiter, false, nullptr, y);
+  op_ret = s->bucket->remove_bucket(this, false, false, nullptr, y);
   if (op_ret < 0 && op_ret == -ECANCELED) {
       // lost a race, either with mdlog sync or another delete bucket operation.
       // in either case, we've already called ctl.bucket->unlink_bucket()
@@ -4837,57 +4822,68 @@ void RGWDeleteObj::execute(optional_yield y)
   }
   s->object->set_bucket(s->bucket.get());
 
-  rgw::sal::RGWAttrs attrs;
+  if (!rgw::sal::RGWObject::empty(s->object.get())) {
+    uint64_t obj_size = 0;
+    std::string etag;
+    RGWObjectCtx* obj_ctx = static_cast<RGWObjectCtx *>(s->obj_ctx);
+    {
+      RGWObjState* astate = nullptr;
+      bool check_obj_lock = s->object->have_instance() && s->bucket->get_info().obj_lock_enabled();
 
-  bool check_obj_lock = s->object->have_instance() && s->bucket->get_info().obj_lock_enabled();
+      op_ret = s->object->get_obj_state(this, obj_ctx, *s->bucket.get(), &astate, s->yield, true);
+      if (op_ret < 0) {
+        if (need_object_expiration() || multipart_delete) {
+          return;
+        }
 
-  if (!rgw::sal::RGWObject::empty(s->object.get())) {
-    op_ret = s->object->get_obj_attrs(s->obj_ctx, s->yield, this);
-    if (op_ret < 0) {
-      if (need_object_expiration() || multipart_delete) {
-        return;
+        if (check_obj_lock) {
+          /* check if obj exists, read orig attrs */
+          if (op_ret == -ENOENT) {
+            /* object maybe delete_marker, skip check_obj_lock*/
+            check_obj_lock = false;
+          } else {
+            return;
+          }
+        }
+      } else {
+        obj_size = astate->size;
+        etag = astate->attrset[RGW_ATTR_ETAG].to_str();
       }
 
+      // ignore return value from get_obj_attrs in all other cases
+      op_ret = 0;
+
       if (check_obj_lock) {
-        /* check if obj exists, read orig attrs */
-        if (op_ret == -ENOENT) {
-          /* object maybe delete_marker, skip check_obj_lock*/
-          check_obj_lock = false;
-        } else {
+        ceph_assert(astate);
+        int object_lock_response = verify_object_lock(this, astate->attrset, bypass_perm, bypass_governance_mode);
+        if (object_lock_response != 0) {
+          op_ret = object_lock_response;
+          if (op_ret == -EACCES) {
+            s->err.message = "forbidden by object lock";
+          }
           return;
         }
       }
-    } else {
-      attrs = s->object->get_attrs();
-    }
 
-    // ignore return value from get_obj_attrs in all other cases
-    op_ret = 0;
-
-    if (check_obj_lock) {
-      int object_lock_response = verify_object_lock(this, attrs, bypass_perm, bypass_governance_mode);
-      if (object_lock_response != 0) {
-        op_ret = object_lock_response;
-       if (op_ret == -EACCES) {
-         s->err.message = "forbidden by object lock";
-       }
-        return;
-      }
-    }
+      if (multipart_delete) {
+        if (!astate) {
+          op_ret = -ERR_NOT_SLO_MANIFEST;
+          return;
+        }
 
-    if (multipart_delete) {
-      const auto slo_attr = attrs.find(RGW_ATTR_SLO_MANIFEST);
+        const auto slo_attr = astate->attrset.find(RGW_ATTR_SLO_MANIFEST);
 
-      if (slo_attr != attrs.end()) {
-        op_ret = handle_slo_manifest(slo_attr->second, y);
-        if (op_ret < 0) {
-          ldpp_dout(this, 0) << "ERROR: failed to handle slo manifest ret=" << op_ret << dendl;
+        if (slo_attr != astate->attrset.end()) {
+          op_ret = handle_slo_manifest(slo_attr->second, y);
+          if (op_ret < 0) {
+            ldpp_dout(this, 0) << "ERROR: failed to handle slo manifest ret=" << op_ret << dendl;
+          }
+        } else {
+          op_ret = -ERR_NOT_SLO_MANIFEST;
         }
-      } else {
-        op_ret = -ERR_NOT_SLO_MANIFEST;
-      }
 
-      return;
+        return;
+      }
     }
 
     // make reservation for notification if needed
@@ -4900,9 +4896,8 @@ void RGWDeleteObj::execute(optional_yield y)
       return;
     }
 
-    RGWObjectCtx *obj_ctx = static_cast<RGWObjectCtx *>(s->obj_ctx);
     s->object->set_atomic(s->obj_ctx);
-
+    
     bool ver_restored = false;
     op_ret = s->object->swift_versioning_restore(s->obj_ctx, ver_restored, this);
     if (op_ret < 0) {
@@ -4941,10 +4936,8 @@ void RGWDeleteObj::execute(optional_yield y)
       op_ret = 0;
     }
 
-    const auto obj_state = obj_ctx->get_state(s->object->get_obj());
-
     // send request to notification manager
-    const auto ret = rgw::notify::publish_commit(s->object.get(), obj_state->size, obj_state->mtime, attrs[RGW_ATTR_ETAG].to_str(), event_type, res, this);
+    const auto ret = rgw::notify::publish_commit(s->object.get(), obj_size, ceph::real_clock::now(), etag, event_type, res, this);
     if (ret < 0) {
       ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl;
       // too late to rollback operation, hence op_ret is not set here
@@ -5055,15 +5048,57 @@ int RGWCopyObj::verify_permission(optional_yield y)
 
     /* admin request overrides permission checks */
     if (!s->auth.identity->is_admin_of(src_acl.get_owner().get_id())) {
-      if (src_policy) {
-       auto e = src_policy->eval(s->env, *s->auth.identity,
-                                 src_object->get_instance().empty() ?
-                                 rgw::IAM::s3GetObject :
-                                 rgw::IAM::s3GetObjectVersion,
-                                 ARN(src_object->get_obj()));
+      if (src_policy || ! s->iam_user_policies.empty() || !s->session_policies.empty()) {
+        auto identity_policy_res = eval_identity_or_session_policies(s->iam_user_policies, s->env,
+                                                  boost::none,
+                                                  src_object->get_instance().empty() ?
+                                                  rgw::IAM::s3GetObject :
+                                                  rgw::IAM::s3GetObjectVersion,
+                                                  ARN(src_object->get_obj()));
+        if (identity_policy_res == Effect::Deny) {
+          return -EACCES;
+        }
+        auto e = Effect::Pass;
+        rgw::IAM::PolicyPrincipal princ_type = rgw::IAM::PolicyPrincipal::Other;
+        if (src_policy) {
+               e = src_policy->eval(s->env, *s->auth.identity,
+            src_object->get_instance().empty() ?
+            rgw::IAM::s3GetObject :
+            rgw::IAM::s3GetObjectVersion,
+            ARN(src_object->get_obj()),
+            princ_type);
+        }
        if (e == Effect::Deny) {
          return -EACCES;
-       } else if (e == Effect::Pass &&
+       }
+        if (!s->session_policies.empty()) {
+        auto session_policy_res = eval_identity_or_session_policies(s->session_policies, s->env,
+                                                  boost::none,
+                                                  src_object->get_instance().empty() ?
+                                                  rgw::IAM::s3GetObject :
+                                                  rgw::IAM::s3GetObjectVersion,
+                                                  ARN(src_object->get_obj()));
+        if (session_policy_res == Effect::Deny) {
+            return -EACCES;
+        }
+        if (princ_type == rgw::IAM::PolicyPrincipal::Role) {
+          //Intersection of session policy and identity policy plus intersection of session policy and bucket policy
+          if ((session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) &&
+              (session_policy_res != Effect::Allow || e != Effect::Allow)) {
+            return -EACCES;
+          }
+        } else if (princ_type == rgw::IAM::PolicyPrincipal::Session) {
+          //Intersection of session policy and identity policy plus bucket policy
+          if ((session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) && e != Effect::Allow) {
+            return -EACCES;
+          }
+        } else if (princ_type == rgw::IAM::PolicyPrincipal::Other) {// there was no match in the bucket policy
+          if (session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) {
+            return -EACCES;
+          }
+        }
+      }
+  if (identity_policy_res == Effect::Pass && e == Effect::Pass &&
                   !src_acl.verify_permission(this, *s->auth.identity, s->perm_mask,
                                              RGW_PERM_READ)) { 
          return -EACCES;
@@ -5085,6 +5120,7 @@ int RGWCopyObj::verify_permission(optional_yield y)
     op_ret = store->get_bucket(s->user.get(), RGWBucketInfo(), &dest_bucket);
     if (op_ret < 0) {
       if (op_ret == -ENOENT) {
+        ldpp_dout(this, 0) << "ERROR: Destination Bucket not found for user: " << s->user->get_id().to_str() << dendl;
        op_ret = -ERR_NO_SUCH_BUCKET;
       }
       return op_ret;
@@ -5113,18 +5149,53 @@ int RGWCopyObj::verify_permission(optional_yield y)
   auto dest_iam_policy = get_iam_policy_from_attr(s->cct, dest_bucket->get_attrs(), dest_bucket->get_tenant());
   /* admin request overrides permission checks */
   if (! s->auth.identity->is_admin_of(dest_policy.get_owner().get_id())){
-    if (dest_iam_policy != boost::none) {
+    if (dest_iam_policy != boost::none || ! s->iam_user_policies.empty() || !s->session_policies.empty()) {
       rgw_add_to_iam_environment(s->env, "s3:x-amz-copy-source", copy_source);
       if (md_directive)
        rgw_add_to_iam_environment(s->env, "s3:x-amz-metadata-directive",
                                   *md_directive);
 
-      auto e = dest_iam_policy->eval(s->env, *s->auth.identity,
-                                     rgw::IAM::s3PutObject,
-                                     ARN(dest_object->get_obj()));
+      auto identity_policy_res = eval_identity_or_session_policies(s->iam_user_policies,
+                                                                  s->env, boost::none,
+                                                                  rgw::IAM::s3PutObject,
+                                                                  ARN(dest_object->get_obj()));
+      if (identity_policy_res == Effect::Deny) {
+        return -EACCES;
+      }
+      auto e = Effect::Pass;
+      rgw::IAM::PolicyPrincipal princ_type = rgw::IAM::PolicyPrincipal::Other;
+      if (dest_iam_policy) {
+        e = dest_iam_policy->eval(s->env, *s->auth.identity,
+                                      rgw::IAM::s3PutObject,
+                                      ARN(dest_object->get_obj()),
+                                      princ_type);
+      }
       if (e == Effect::Deny) {
         return -EACCES;
-      } else if (e == Effect::Pass &&
+      }
+      if (!s->session_policies.empty()) {
+        auto session_policy_res = eval_identity_or_session_policies(s->session_policies, s->env, boost::none, rgw::IAM::s3PutObject, ARN(dest_object->get_obj()));
+        if (session_policy_res == Effect::Deny) {
+            return false;
+        }
+        if (princ_type == rgw::IAM::PolicyPrincipal::Role) {
+          //Intersection of session policy and identity policy plus intersection of session policy and bucket policy
+          if ((session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) &&
+              (session_policy_res != Effect::Allow || e == Effect::Allow)) {
+            return -EACCES;
+          }
+        } else if (princ_type == rgw::IAM::PolicyPrincipal::Session) {
+          //Intersection of session policy and identity policy plus bucket policy
+          if ((session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) && e != Effect::Allow) {
+            return -EACCES;
+          }
+        } else if (princ_type == rgw::IAM::PolicyPrincipal::Other) {// there was no match in the bucket policy
+          if (session_policy_res != Effect::Allow || identity_policy_res != Effect::Allow) {
+            return -EACCES;
+          }
+        }
+      }
+      if (identity_policy_res == Effect::Pass && e == Effect::Pass &&
                  ! dest_bucket_policy.verify_permission(this,
                                                         *s->auth.identity,
                                                         s->perm_mask,
@@ -5231,7 +5302,8 @@ void RGWCopyObj::execute(optional_yield y)
 
   encode_delete_at_attr(delete_at, attrs);
 
-  if (!s->system_request) { // no quota enforcement for system requests
+  uint64_t obj_size = 0;
+  {
     // get src object size (cached in obj_ctx from verify_permission())
     RGWObjState* astate = nullptr;
     op_ret = src_object->get_obj_state(this, s->obj_ctx, *src_bucket, &astate,
@@ -5239,11 +5311,15 @@ void RGWCopyObj::execute(optional_yield y)
     if (op_ret < 0) {
       return;
     }
-    // enforce quota against the destination bucket owner
-    op_ret = dest_bucket->check_quota(user_quota, bucket_quota,
+    obj_size = astate->size;
+  
+    if (!s->system_request) { // no quota enforcement for system requests
+      // enforce quota against the destination bucket owner
+      op_ret = dest_bucket->check_quota(user_quota, bucket_quota,
                                      astate->accounted_size, y);
-    if (op_ret < 0) {
-      return;
+      if (op_ret < 0) {
+        return;
+      }
     }
   }
 
@@ -5286,7 +5362,7 @@ void RGWCopyObj::execute(optional_yield y)
           s->yield);
 
   // send request to notification manager
-  const auto ret = rgw::notify::publish_commit(s->object.get(), s->obj_size, mtime, etag, event_type, res, this);
+  const auto ret = rgw::notify::publish_commit(s->object.get(), obj_size, mtime, etag, event_type, res, this);
   if (ret < 0) {
     ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl;
     // too late to rollback operation, hence op_ret is not set here
@@ -6778,29 +6854,38 @@ void RGWDeleteMultiObj::execute(optional_yield y)
       }
     }
 
-    // verify_object_lock
-    bool check_obj_lock = obj->have_instance() && bucket->get_info().obj_lock_enabled();
-    if (check_obj_lock) {
-      int get_attrs_response = obj->get_obj_attrs(s->obj_ctx, s->yield, this);
-      if (get_attrs_response < 0) {
-        if (get_attrs_response == -ENOENT) {
+    uint64_t obj_size = 0;
+    std::string etag;
+
+    if (!rgw::sal::RGWObject::empty(obj.get())) {
+      RGWObjState* astate = nullptr;
+      bool check_obj_lock = obj->have_instance() && bucket->get_info().obj_lock_enabled();
+      const auto ret = obj->get_obj_state(this, obj_ctx, *bucket, &astate, s->yield, true);
+
+      if (ret < 0) {
+        if (ret == -ENOENT) {
           // object maybe delete_marker, skip check_obj_lock
           check_obj_lock = false;
         } else {
           // Something went wrong.
-          send_partial_response(*iter, false, "", get_attrs_response);
+          send_partial_response(*iter, false, "", ret);
           continue;
         }
+      } else {
+        obj_size = astate->size;
+        etag = astate->attrset[RGW_ATTR_ETAG].to_str();
       }
-    }
 
-    if (check_obj_lock) {
-      int object_lock_response = verify_object_lock(this, obj->get_attrs(), bypass_perm, bypass_governance_mode);
-      if (object_lock_response != 0) {
-        send_partial_response(*iter, false, "", object_lock_response);
-        continue;
+      if (check_obj_lock) {
+        ceph_assert(astate);
+        int object_lock_response = verify_object_lock(this, astate->attrset, bypass_perm, bypass_governance_mode);
+        if (object_lock_response != 0) {
+          send_partial_response(*iter, false, "", object_lock_response);
+          continue;
+        }
       }
     }
+
     // make reservation for notification if needed
     const auto versioned_object = s->bucket->versioning_enabled();
     rgw::notify::reservation_t res(this, store, s, obj.get());
@@ -6822,12 +6907,8 @@ void RGWDeleteMultiObj::execute(optional_yield y)
 
     send_partial_response(*iter, obj->get_delete_marker(), version_id, op_ret);
 
-    const auto obj_state = obj_ctx->get_state(obj->get_obj());
-    bufferlist etag_bl;
-    const auto etag = obj_state->get_attr(RGW_ATTR_ETAG, etag_bl) ? etag_bl.to_str() : "";
-
     // send request to notification manager
-    const auto ret = rgw::notify::publish_commit(obj.get(), obj_state->size, obj_state->mtime, etag, event_type, res, this);
+    const auto ret = rgw::notify::publish_commit(obj.get(), obj_size, ceph::real_clock::now(), etag, event_type, res, this);
     if (ret < 0) {
       ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl;
       // too late to rollback operation, hence op_ret is not set here
@@ -6905,7 +6986,7 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path, optional_yie
       goto delop_fail;
     }
   } else {
-    ret = bucket->remove_bucket(dpp, false, string(), string(), true, &s->info, s->yield);
+    ret = bucket->remove_bucket(dpp, false, true, &s->info, s->yield);
     if (ret < 0) {
       goto delop_fail;
     }
index 02c3acc43eebe2c8ba8caa6202709a7195e5882e..203f5a4547e47c308c801caa490cabfa2e9cccf8 100644 (file)
@@ -178,7 +178,7 @@ int process_request(rgw::sal::RGWRadosStore* const store,
                     const std::string& frontend_prefix,
                     const rgw_auth_registry_t& auth_registry,
                     RGWRestfulIO* const client_io,
-                    OpsLogSocket* const olog,
+                    OpsLogSink* const olog,
                     optional_yield yield,
                    rgw::dmclock::Scheduler *scheduler,
                     string* user,
@@ -333,7 +333,7 @@ done:
   }
 
   if (should_log) {
-    rgw_log_op(store->getRados(), rest, s, (op ? op->name() : "unknown"), olog);
+    rgw_log_op(rest, s, (op ? op->name() : "unknown"), olog);
   }
 
   if (http_ret != nullptr) {
index 598da0b120dec5ba77ec8f48901c84a19c12c6e9..0da1646dc13891cb874a220a0c969dffca7049af 100644 (file)
@@ -34,7 +34,7 @@ namespace rgw::dmclock {
 struct RGWProcessEnv {
   rgw::sal::RGWRadosStore *store;
   RGWREST *rest;
-  OpsLogSocket *olog;
+  OpsLogSink *olog;
   int port;
   std::string uri_prefix;
   std::shared_ptr<rgw::auth::StrategyRegistry> auth_registry;
@@ -49,7 +49,7 @@ protected:
   CephContext *cct;
   rgw::sal::RGWRadosStore* store;
   rgw_auth_registry_ptr_t auth_registry;
-  OpsLogSocket* olog;
+  OpsLogSink* olog;
   ThreadPool m_tp;
   Throttle req_throttle;
   RGWREST* rest;
@@ -187,7 +187,7 @@ extern int process_request(rgw::sal::RGWRadosStore* store,
                            const std::string& frontend_prefix,
                            const rgw_auth_registry_t& auth_registry,
                            RGWRestfulIO* client_io,
-                           OpsLogSocket* olog,
+                           OpsLogSink* olog,
                            optional_yield y,
                            rgw::dmclock::Scheduler *scheduler,
                            std::string* user,
index c981fc03f553f6a19a9e5c501d1d457fe669593f..17d9ae221f60fd4aa2420744aca3bd2451dc2250 100644 (file)
@@ -274,7 +274,7 @@ void rgw_pubsub_s3_event::dump(Formatter *f) const {
         Formatter::ObjectSection sub_s(*f, "object");
         encode_json("key", object_key, f);
         encode_json("size", object_size, f);
-        encode_json("etag", object_etag, f);
+        encode_json("eTag", object_etag, f);
         encode_json("versionId", object_versionId, f);
         encode_json("sequencer", object_sequencer, f);
         encode_json("metadata", x_meta_map, f);
index b82384e64ec5448d05084cd34ccee2cd010b2dfc..958fb9ce2e27f8c18952cd6ce4209ef1347a6eac 100644 (file)
@@ -603,7 +603,7 @@ class RGWPubSub
   }
 
   std::string bucket_meta_oid(const rgw_bucket& bucket) const {
-    return pubsub_oid_prefix + tenant + ".bucket." + bucket.name + "/" + bucket.bucket_id;
+    return pubsub_oid_prefix + tenant + ".bucket." + bucket.name + "/" + bucket.marker;
   }
 
   std::string sub_meta_oid(const string& name) const {
index 4542c4a1f9172746b641e698d78fa7f79f49a7ef..b1a51ba335641ebacf48af856ba3bc10344cfea4 100644 (file)
@@ -9,9 +9,11 @@
 
 #include "include/rados/librados.hpp"
 #include "include/Context.h"
+#include "include/random.h"
 #include "common/RefCountedObj.h"
 #include "common/RWLock.h"
 #include "common/ceph_time.h"
+#include "common/Timer.h"
 #include "rgw_common.h"
 #include "cls/rgw/cls_rgw_types.h"
 #include "cls/version/cls_version_types.h"
@@ -32,7 +34,6 @@
 #include "services/svc_bi_rados.h"
 
 class RGWWatcher;
-class SafeTimer;
 class ACLOwner;
 class RGWGC;
 class RGWMetaNotifier;
@@ -422,7 +423,7 @@ class RGWRados
   int open_pool_ctx(const DoutPrefixProvider *dpp, const rgw_pool& pool, librados::IoCtx&  io_ctx,
                    bool mostly_omap);
 
-  std::atomic<int64_t> max_req_id = { 0 };
+
   ceph::mutex lock = ceph::make_mutex("rados_timer_lock");
   SafeTimer *timer;
 
@@ -563,7 +564,7 @@ public:
   }
 
   uint64_t get_new_req_id() {
-    return ++max_req_id;
+    return ceph::util::generate_random_number<uint64_t>();
   }
 
   librados::IoCtx* get_lc_pool_ctx() {
index d0d07174404e596dbb138d07efcd46ea4a3efc2b..52520269e561b3e54e46a8e651ac3d8aa392ef0a 100644 (file)
@@ -227,7 +227,7 @@ void RGWOp_Bucket_Remove::execute(optional_yield y)
     return;
   }
 
-  op_ret = bucket->remove_bucket(s, delete_children, string(), string(), true, &s->info, s->yield);
+  op_ret = bucket->remove_bucket(s, delete_children, true, &s->info, s->yield);
 }
 
 class RGWOp_Set_Bucket_Quota : public RGWRESTOp {
index a7998eadf40a69cef4f203c870028c8e854e8233..2247c20dd2167a0524f60324d4afbb6a30afdb61 100644 (file)
@@ -4699,7 +4699,13 @@ int RGWHandler_REST_S3::postauth_init(optional_yield y)
   }
 
   if (!t->src_bucket.empty()) {
-    rgw_parse_url_bucket(t->src_bucket, s->user->get_tenant(),
+    string auth_tenant;
+    if (s->auth.identity->get_identity_type() == TYPE_ROLE) {
+      auth_tenant = s->auth.identity->get_role_tenant();
+    } else {
+      auth_tenant = s->user->get_tenant();
+    }
+    rgw_parse_url_bucket(t->src_bucket, auth_tenant,
                        s->src_tenant_name, s->src_bucket_name);
     ret = rgw_validate_tenant_name(s->src_tenant_name);
     if (ret)
@@ -4944,14 +4950,6 @@ int RGWHandler_REST_S3Website::retarget(RGWOp* op, RGWOp** new_op, optional_yiel
   if (!(s->prot_flags & RGW_REST_WEBSITE))
     return 0;
 
-  int ret = store->get_bucket(s, nullptr, s->bucket_tenant, s->bucket_name, &s->bucket, y);
-  if (ret < 0) {
-      // TODO-FUTURE: if the bucket does not exist, maybe expose it here?
-      return -ERR_NO_SUCH_BUCKET;
-  }
-
-  s->bucket_attrs = s->bucket->get_attrs();
-
   if (!s->bucket->get_info().has_website) {
       // TODO-FUTURE: if the bucket has no WebsiteConfig, expose it here
       return -ERR_NO_SUCH_WEBSITE_CONFIGURATION;
@@ -5263,7 +5261,11 @@ AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s,
       s->op_type == RGW_OP_CREATE_OIDC_PROVIDER ||
       s->op_type == RGW_OP_DELETE_OIDC_PROVIDER ||
       s->op_type == RGW_OP_GET_OIDC_PROVIDER ||
-      s->op_type == RGW_OP_LIST_OIDC_PROVIDERS) {
+      s->op_type == RGW_OP_LIST_OIDC_PROVIDERS ||
+      s->op_type == RGW_OP_PUBSUB_TOPIC_CREATE ||
+      s->op_type == RGW_OP_PUBSUB_TOPICS_LIST ||
+      s->op_type == RGW_OP_PUBSUB_TOPIC_GET ||
+      s->op_type == RGW_OP_PUBSUB_TOPIC_DELETE) {
     is_non_s3_op = true;
   }
 
@@ -5361,6 +5363,8 @@ AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s,
         case RGW_OP_PUT_LC:
         case RGW_OP_SET_REQUEST_PAYMENT:
         case RGW_OP_PUBSUB_NOTIF_CREATE:
+        case RGW_OP_PUBSUB_NOTIF_DELETE:
+        case RGW_OP_PUBSUB_NOTIF_LIST:
         case RGW_OP_PUT_BUCKET_OBJ_LOCK:
         case RGW_OP_PUT_OBJ_RETENTION:
         case RGW_OP_PUT_OBJ_LEGAL_HOLD:
@@ -5814,7 +5818,7 @@ rgw::auth::s3::STSEngine::get_session_token(const DoutPrefixProvider* dpp, const
     return -EINVAL;
   }
   string error;
-  auto* keyhandler = cryptohandler->get_key_handler(secret, error);
+  std::unique_ptr<CryptoKeyHandler> keyhandler(cryptohandler->get_key_handler(secret, error));
   if (! keyhandler) {
     return -EINVAL;
   }
index 156bc8522688423c297479dc25f2613d378a70da..41da8bc9d854e7cce2888286d64d2326c3133cb3 100644 (file)
@@ -232,7 +232,7 @@ class RGWBucket {
     virtual RGWObject* create_object(const rgw_obj_key& key /* Attributes */) = 0;
     virtual RGWAttrs& get_attrs(void) { return attrs; }
     virtual int set_attrs(RGWAttrs a) { attrs = a; return 0; }
-    virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) = 0;
+    virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) = 0;
     virtual RGWAccessControlPolicy& get_acl(void) = 0;
     virtual int set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy& acl, optional_yield y) = 0;
     virtual int get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y) = 0;
index added3e6a3299332272fd63d8ff0f65fc3cec56c..28f1cef9ffefd83afbef14739677cc273d217270 100644 (file)
@@ -88,8 +88,6 @@ RGWObject *RGWRadosBucket::create_object(const rgw_obj_key &key)
 
 int RGWRadosBucket::remove_bucket(const DoutPrefixProvider *dpp,
                               bool delete_children,
-                              std::string prefix,
-                              std::string delimiter,
                               bool forward_to_master,
                               req_info* req_info, optional_yield y)
 {
@@ -129,12 +127,9 @@ int RGWRadosBucket::remove_bucket(const DoutPrefixProvider *dpp,
     }
   } while(results.is_truncated);
 
-  /* If there's a prefix, then we are aborting multiparts as well */
-  if (!prefix.empty()) {
-    ret = abort_bucket_multiparts(dpp, store, store->ctx(), info, prefix, delimiter);
-    if (ret < 0) {
-      return ret;
-    }
+  ret = abort_bucket_multiparts(dpp, store, store->ctx(), info);
+  if (ret < 0) {
+    return ret;
   }
 
   ret = store->ctl()->bucket->sync_user_stats(dpp, info.owner, info, y);
index 79596c6f868dcbfe9496140548a8fd14c01a119d..8000756370e4d1df7326417ac4c790cd0b049c50 100644 (file)
@@ -230,7 +230,7 @@ class RGWRadosBucket : public RGWBucket {
     RGWBucketList* list(void) { return new RGWBucketList(); }
     virtual int list(const DoutPrefixProvider *dpp, ListParams&, int, ListResults&, optional_yield y) override;
     RGWObject* create_object(const rgw_obj_key& key /* Attributes */) override;
-    virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, std::string prefix, std::string delimiter, bool forward_to_master, req_info* req_info, optional_yield y) override;
+    virtual int remove_bucket(const DoutPrefixProvider *dpp, bool delete_children, bool forward_to_master, req_info* req_info, optional_yield y) override;
     RGWAccessControlPolicy& get_acl(void) { return acls; }
     virtual int set_acl(const DoutPrefixProvider *dpp, RGWAccessControlPolicy& acl, optional_yield y) override;
     virtual int get_bucket_info(const DoutPrefixProvider *dpp, optional_yield y) override;
index 741c16d397c011d4fec55f90d4485d92cb0cc46b..bb125cdc60b31dd010657dd2570f3051a90715be 100644 (file)
@@ -79,7 +79,7 @@ int Credentials::generateCredentials(CephContext* cct,
     return ret;
   }
   string error;
-  auto* keyhandler = cryptohandler->get_key_handler(secret, error);
+  std::unique_ptr<CryptoKeyHandler> keyhandler(cryptohandler->get_key_handler(secret, error));
   if (! keyhandler) {
     ldout(cct, 0) << "ERROR: No Key handler found !" << dendl;
     return -EINVAL;
index d241ec4b9e6ea9fd28e8affc303449d040acc566..662396ba4adb3455f66c57bf9de112fa3292ba30 100644 (file)
@@ -269,7 +269,7 @@ static void make_s3_event_ref(CephContext *cct, const rgw_bucket& bucket,
 
   EventRef<rgw_pubsub_s3_event>& e = *event;
   e->eventTime = mtime;
-  e->eventName = rgw::notify::to_string(event_type);
+  e->eventName = rgw::notify::to_event_string(event_type);
   // userIdentity: not supported in sync module
   // x_amz_request_id: not supported in sync module
   // x_amz_id_2: not supported in sync module
index f9499bfa79ecc5d58581321448cc20e867c46a89..ad8cfc88d134e92e73f0c04871f29fe613636226 100644 (file)
@@ -1938,9 +1938,8 @@ int RGWUser::execute_remove(const DoutPrefixProvider *dpp, RGWUserAdminOpState&
       return -EEXIST; // change to code that maps to 409: conflict
     }
 
-    std::string prefix, delimiter;
     for (auto it = m.begin(); it != m.end(); ++it) {
-      ret = it->second->remove_bucket(dpp, true, prefix, delimiter, false, nullptr, y);
+      ret = it->second->remove_bucket(dpp, true, false, nullptr, y);
       if (ret < 0) {
         set_err_msg(err_msg, "unable to delete user data");
         return ret;
index 244cb46c7ff1fffd84392cc24a790684e7605818..b4500137a0c7d1f033b1b156f2a3ccda139ccce7 100755 (executable)
@@ -4,7 +4,7 @@
 """To run this script first install the dependencies
 
 
-  virtualenv v
+  python3 -m venv v
   source v/bin/activate
   pip install githubpy GitPython requests
 
index 2dab5f1d98730b894213209edce6a2390e2c30c7..9d45d8b9246ce41241aae48e047123fb7a5b8a5f 100755 (executable)
@@ -25,13 +25,13 @@ options:
 
 example:
 
-following command will run tox with envlist of "py27,py3" using the "tox.ini" in current directory.
+following command will run tox with envlist of "py3,mypy" using the "tox.ini" in current directory.
 
-  $prog_name --tox-envs py27,py3
+  $prog_name --tox-envs py3,mypy
 
-following command will run tox with envlist of "py27" using "/ceph/src/python-common/tox.ini"
+following command will run tox with envlist of "py3" using "/ceph/src/python-common/tox.ini"
 
-  $prog_name --tox-envs py27 --tox-path /ceph/src/python-common
+  $prog_name --tox-envs py3 --tox-path /ceph/src/python-common
 EOF
 }
 
@@ -116,17 +116,7 @@ function main() {
             echo "$PWD already exists, but it's not a virtualenv. test_name empty?"
             exit 1
         fi
-        # try to use the prefered python for creating the virtual env for
-        # bootstrapping tox.
-        case $tox_envs in
-            py3*)
-                virtualenv_python=python3;;
-            py2*)
-                virtualenv_python=python2;;
-            *)
-                virtualenv_python=python3;;
-        esac
-        $source_dir/src/tools/setup-virtualenv.sh --python=${virtualenv_python} ${venv_path}
+        $source_dir/src/tools/setup-virtualenv.sh ${venv_path}
     fi
     source ${venv_path}/bin/activate
     pip install tox
index d01e04704ff6424f9229f37de5134fb013244dcf..5b33597455643ab0c9ddacc39c4a8f6d05f2e5a6 100644 (file)
@@ -1889,6 +1889,11 @@ TEST_F(TestClsRbd, mirror_image_status) {
   ASSERT_EQ(1U, states.size());
   ASSERT_EQ(3, states[cls::rbd::MIRROR_IMAGE_STATUS_STATE_UNKNOWN]);
 
+  // Test remove of status
+  ASSERT_EQ(0, mirror_image_status_set(&ioctx, "uuid1", status1));
+  ASSERT_EQ(0, mirror_image_status_remove(&ioctx, "uuid1"));
+  ASSERT_EQ(-ENOENT, mirror_image_instance_get(&ioctx, "uuid1", &read_instance));
+
   // Test statuses are not down after watcher is started
 
   ASSERT_EQ(0, mirror_image_status_set(&ioctx, "uuid1", status1));
index e8db155f4ea7b05f1d54c331d2e7b1467657860b..83c8ec72afafc944fff113f67ae35073bd85a8e1 100644 (file)
@@ -274,6 +274,11 @@ add_executable(unittest_shunique_lock
 add_ceph_unittest(unittest_shunique_lock)
 target_link_libraries(unittest_shunique_lock ceph-common)
 
+add_executable(unittest_fair_mutex
+  test_fair_mutex.cc)
+add_ceph_unittest(unittest_fair_mutex)
+target_link_libraries(unittest_fair_mutex ceph-common)
+
 # unittest_perf_histogram
 add_executable(unittest_perf_histogram
   test_perf_histogram.cc
diff --git a/ceph/src/test/common/test_fair_mutex.cc b/ceph/src/test/common/test_fair_mutex.cc
new file mode 100644 (file)
index 0000000..10ba835
--- /dev/null
@@ -0,0 +1,68 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
+
+#include <array>
+#include <mutex>
+#include <numeric>
+#include <future>
+#include <gtest/gtest.h>
+#include "common/fair_mutex.h"
+
+TEST(FairMutex, simple)
+{
+  ceph::fair_mutex mutex{"fair::simple"};
+  {
+    std::unique_lock lock{mutex};
+    ASSERT_TRUE(mutex.is_locked());
+    // fair_mutex does not recursive ownership semantics
+    ASSERT_FALSE(mutex.try_lock());
+  }
+  // re-acquire the lock
+  {
+    std::unique_lock lock{mutex};
+    ASSERT_TRUE(mutex.is_locked());
+  }
+  ASSERT_FALSE(mutex.is_locked());
+}
+
+TEST(FairMutex, fair)
+{
+  // waiters are queued in FIFO order, and they are woken up in the same order
+  // we have a marathon participated by multiple teams:
+  // - each team is represented by a thread.
+  // - each team should have equal chance of being selected and scoring, assuming
+  //   the runners in each team are distributed evenly in the waiting queue.
+  ceph::fair_mutex mutex{"fair::fair"};
+  const int NR_TEAMS = 2;
+  std::array<unsigned, NR_TEAMS> scoreboard{0, 0};
+  const int NR_ROUNDS = 512;
+  auto play = [&](int team) {
+    for (int i = 0; i < NR_ROUNDS; i++) {
+      std::unique_lock lock{mutex};
+      // pretent that i am running.. and it takes time
+      std::this_thread::sleep_for(std::chrono::microseconds(20));
+      // score!
+      scoreboard[team]++;
+      // fair?
+      unsigned total = std::accumulate(scoreboard.begin(),
+                                       scoreboard.end(),
+                                       0);
+      for (unsigned score : scoreboard) {
+        if (total < NR_ROUNDS) {
+          // not quite statistically significant. to reduce the false positive,
+          // just consider it fair
+          continue;
+        }
+        // check if any team is donimating the game.
+        unsigned avg = total / scoreboard.size();
+        // leave at least half of the average to other teams
+        ASSERT_LE(score, total - avg / 2);
+        // don't treat myself too bad
+        ASSERT_GT(score, avg / 2);
+      };
+    }
+  };
+  std::array<std::future<void>, NR_TEAMS> completed;
+  for (int team = 0; team < NR_TEAMS; team++) {
+    completed[team] = std::async(std::launch::async, play, team);
+  }
+}
index 0def8aac7240b63c49924b32654c6cca464acd57..b088b68f96c5ceb1296edc59a0e7d2fc1e700a3f 100644 (file)
@@ -380,7 +380,7 @@ namespace {
   {
     librgw_data* data = static_cast<librgw_data*>(td->io_ops_data);
     const char* object = io_u->file->file_name;
-    struct rgw_file_handle* object_fh;
+    struct rgw_file_handle* object_fh = nullptr;
     size_t nbytes;
     int r = 0;
 
index 1c28bb051b2e59ab6b0532e4ebc02ac16bb62296..8208029bbae2dd01da665e8c6610f01fa8db9aff 100644 (file)
@@ -3524,14 +3524,20 @@ TEST(LibCephFS, LookupMdsPrivateInos) {
       ASSERT_EQ(-ESTALE, ceph_ll_lookup_inode(cmount, ino, &inode));
     } else if (ino == CEPH_INO_ROOT || ino == CEPH_INO_GLOBAL_SNAPREALM) {
       ASSERT_EQ(0, ceph_ll_lookup_inode(cmount, ino, &inode));
+      ceph_ll_put(cmount, inode);
     } else if (ino == CEPH_INO_LOST_AND_FOUND) {
       // the ino 3 will only exists after the recovery tool ran, so
       // it may return -ESTALE with a fresh fs cluster
       int r = ceph_ll_lookup_inode(cmount, ino, &inode);
-      ASSERT_TRUE(r == -ESTALE || r == 0);
+      if (r == 0) {
+        ceph_ll_put(cmount, inode);
+      } else {
+        ASSERT_TRUE(r == -ESTALE);
+      }
     } else {
       // currently the ino 0 and 4~99 is not useded yet.
       ASSERT_EQ(-ESTALE, ceph_ll_lookup_inode(cmount, ino, &inode));
     }
   }
+  ceph_shutdown(cmount);
 }
index d3cd46a908980631896806dd372d9287f592b258..b5032e9afb35c2d89c9ae8f402c163ced2d9f590 100644 (file)
@@ -139,7 +139,7 @@ void check_fp_oid_refcount(librados::IoCtx& ioctx, std::string foid, uint64_t co
   } catch (buffer::error& err) {
     ASSERT_TRUE(0);
   }
-  ASSERT_EQ(count, refs.count());
+  ASSERT_LE(count, refs.count());
 }
 
 string get_fp_oid(string oid, std::string fp_algo = NULL)
@@ -3447,7 +3447,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestDedupRefRead) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
 
   // wait for maps to settle before next test
@@ -3544,7 +3544,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(1u, refs.count());
+    ASSERT_LE(1u, refs.count());
   }
 
   // create a snapshot, clone
@@ -3610,7 +3610,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
   
   // and another
@@ -3675,7 +3675,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
 
   // remove snap
@@ -3915,7 +3915,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
 
   // check chunk's refcount
@@ -3936,7 +3936,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
 
   // check chunk's refcount
@@ -3957,7 +3957,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(2u, refs.count());
+    ASSERT_LE(2u, refs.count());
   }
 
   // remove snap
@@ -5325,7 +5325,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushDupCount) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(1u, refs.count());
+    ASSERT_LE(1u, refs.count());
   }
 
   bufferlist chunk2;
@@ -5349,7 +5349,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushDupCount) {
     } catch (buffer::error& err) {
       ASSERT_TRUE(0);
     }
-    ASSERT_EQ(1u, refs.count());
+    ASSERT_LE(1u, refs.count());
   }
 
   // make a dirty chunks
index 65460eab785da1d7653cd90ed99aaebeaa0f8324..f5204ac2049417a45f33484e04a9d010017beac3 100644 (file)
@@ -110,8 +110,7 @@ TEST_F(TestMockImageValidatePoolRequest, Success) {
   expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -124,8 +123,7 @@ TEST_F(TestMockImageValidatePoolRequest, AlreadyValidated) {
   expect_read_rbd_info(mock_io_ctx, "overwrite validated", 0);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -139,8 +137,7 @@ TEST_F(TestMockImageValidatePoolRequest, SnapshotsValidated) {
   expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -153,8 +150,7 @@ TEST_F(TestMockImageValidatePoolRequest, ReadError) {
   expect_read_rbd_info(mock_io_ctx, "", -EPERM);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(-EPERM, ctx.wait());
 }
@@ -168,8 +164,7 @@ TEST_F(TestMockImageValidatePoolRequest, CreateSnapshotError) {
   expect_allocate_snap_id(mock_io_ctx, -EPERM);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(-EPERM, ctx.wait());
 }
@@ -185,8 +180,7 @@ TEST_F(TestMockImageValidatePoolRequest, WriteError) {
   expect_release_snap_id(mock_io_ctx, -EINVAL);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(-EPERM, ctx.wait());
 }
@@ -203,8 +197,7 @@ TEST_F(TestMockImageValidatePoolRequest, RemoveSnapshotError) {
   expect_write_rbd_info(mock_io_ctx, "overwrite validated", 0);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(0, ctx.wait());
 }
@@ -221,8 +214,7 @@ TEST_F(TestMockImageValidatePoolRequest, OverwriteError) {
   expect_write_rbd_info(mock_io_ctx, "overwrite validated", -EOPNOTSUPP);
 
   C_SaferCond ctx;
-  auto req = new MockValidatePoolRequest(m_ioctx, image_ctx->op_work_queue,
-                                         &ctx);
+  auto req = new MockValidatePoolRequest(m_ioctx, &ctx);
   req->send();
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
index f90d488a555bbd4eaa0d558fdf1fafae8badca37..c25ae4a95c5e628852a73269e2e9a9b32bd9d3db 100644 (file)
@@ -212,7 +212,7 @@ TEST_F(TestMockObjectMapDiffRequest, IntermediateDelta) {
 
   BitVector<2> object_map_1;
   object_map_1.resize(object_count);
-  object_map_1[1] = OBJECT_EXISTS_CLEAN;
+  object_map_1[1] = OBJECT_EXISTS;
   object_map_1[2] = OBJECT_EXISTS_CLEAN;
   expect_load_map(mock_image_ctx, 1U, object_map_1, 0);
 
@@ -281,7 +281,7 @@ TEST_F(TestMockObjectMapDiffRequest, EndDelta) {
   BitVector<2> expected_diff_state;
   expected_diff_state.resize(object_count);
   expected_diff_state[1] = DIFF_STATE_DATA;
-  expected_diff_state[2] = DIFF_STATE_DATA_UPDATED;
+  expected_diff_state[2] = DIFF_STATE_DATA;
   expected_diff_state[3] = DIFF_STATE_HOLE_UPDATED;
   ASSERT_EQ(expected_diff_state, m_object_diff_state);
 }
index 4dbd2e2442a8d979d0afcd21489af55e4e4fcb5c..d9f31ee9b6a13c0f7d27df1a47c5e652287baf07 100644 (file)
@@ -2089,6 +2089,35 @@ TEST_F(TestLibRBD, TestCreateLsRenameSnapPP)
   ioctx.close();
 }
 
+TEST_F(TestLibRBD, ConcurrentCreatesUnvalidatedPool)
+{
+  rados_ioctx_t ioctx;
+  ASSERT_EQ(0, rados_ioctx_create(_cluster, create_pool(true).c_str(),
+                                  &ioctx));
+
+  std::vector<std::string> names;
+  for (int i = 0; i < 4; i++) {
+    names.push_back(get_temp_image_name());
+  }
+  uint64_t size = 2 << 20;
+
+  std::vector<std::thread> threads;
+  for (const auto& name : names) {
+    threads.emplace_back([ioctx, &name, size]() {
+      int order = 0;
+      ASSERT_EQ(0, create_image(ioctx, name.c_str(), size, &order));
+    });
+  }
+  for (auto& thread : threads) {
+    thread.join();
+  }
+
+  for (const auto& name : names) {
+    ASSERT_EQ(0, rbd_remove(ioctx, name.c_str()));
+  }
+  rados_ioctx_destroy(ioctx);
+}
+
 TEST_F(TestLibRBD, TestIO)
 {
   rados_ioctx_t ioctx;
index f4e44e55f7f6335c86ab2b5746a8c058a3412b85..643cfc1fce7e2a3ca41dd053b8c176fec3db2f84 100644 (file)
@@ -37,6 +37,7 @@
 #include "common/ceph_mutex.h"
 #include "common/Cond.h"
 #include "common/errno.h"
+#include "common/pretty_binary.h"
 #include "include/stringify.h"
 #include "include/coredumpctl.h"
 
@@ -254,6 +255,139 @@ protected:
 
 };
 
+class StoreTestOmapUpgrade : public StoreTestDeferredSetup {
+protected:
+  void StartDeferred() {
+    DeferredSetup();
+  }
+
+public:
+  struct generator {
+    double r = 3.6;
+    double x = 0.5;
+    double operator()(){
+      double v = x;
+      x = r * x * (1 - x);
+      return v;
+    }
+  };
+
+  std::string generate_monotonic_name(uint32_t SUM, uint32_t i, double r, double x)
+  {
+    generator gen{r, x};
+    //std::cout << "r=" << r << " x=" << x << std::endl;
+    std::string s;
+    while (SUM > 1) {
+      uint32_t lo = 0;
+      uint32_t hi = 1 + gen() * 10;
+      uint32_t start = ('z' - 'a' + 1 - hi) * gen();
+      while (hi - lo > 0) {
+       uint32_t mid = (lo + hi + 1 + (SUM&1)) / 2; // round up or down, depending on SUM
+       //      std::cout << "SUM=" << SUM << " x=" << gen.x << std::endl;
+       uint32_t mid_val = gen() * (SUM - 1) + 1;
+       // LEFT  = lo  .. mid - 1
+       // RIGHT = mid .. hi
+       //      std::cout << "lo=" << lo << " hi=" << hi << " mid=" << mid
+       //      << " SUM=" << SUM << " i=" << i << " x=" << gen.x << " mid_val=" << mid_val << std::endl;
+       if (i < mid_val) {
+         hi = mid - 1;
+         SUM = mid_val;
+       } else {
+         lo = mid;
+         SUM = SUM - mid_val;
+         i = i - mid_val;
+       }
+      }
+      //std::cout << "lo=" << lo << " hi=" << hi
+      //             << " SUM=" << SUM << " i=" << i << std::endl;
+
+      s.push_back('a' + lo  + start); // to keep alphabetic order
+      uint32_t cnt = gen() * 8;
+      for (uint32_t j = 0; j < cnt; j++) {
+       s.push_back('a' + ('z' - 'a' + 1) * gen());
+      }
+      s.push_back('.');
+    }
+    return s;
+  }
+
+  std::string gen_string(size_t size, generator& gen) {
+    std::string s;
+    for (size_t i = 0; i < size; i++) {
+      s.push_back('a' + ('z' - 'a' + 1 ) * gen());
+    }
+    return s;
+  }
+
+  void make_omap_data(size_t object_count,
+                     int64_t poolid,
+                     coll_t cid) {
+    int r;
+    ObjectStore::CollectionHandle ch = store->open_collection(cid);
+    for (size_t o = 0; o < object_count; o++)
+    {
+      ObjectStore::Transaction t;
+      std::string oid = generate_monotonic_name(object_count, o, 3.71, 0.5);
+      ghobject_t hoid(hobject_t(oid, "", CEPH_NOSNAP, 0, poolid, ""));
+      t.touch(cid, hoid);
+      generator gen{3.85 + 0.1 * o / object_count, 1 - double(o) / object_count};
+
+      map<string, bufferlist> start_set;
+      size_t omap_count = 1 + gen() * 20;
+      bool do_omap_header = gen() > 0.5;
+      if (do_omap_header) {
+       bufferlist header;
+       header.append(gen_string(50, gen));
+       t.omap_setheader(cid, hoid, header);
+      }
+      for (size_t i = 0; i < omap_count; i++) {
+       std::string name = generate_monotonic_name(omap_count, i, 3.66 + 0.22 * o / object_count, 0.5);
+       bufferlist val;
+       val.append(gen_string(100, gen));
+       start_set.emplace(name, val);
+      }
+      t.omap_setkeys(cid, hoid, start_set);
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+  }
+
+  void check_omap_data(size_t object_count,
+                      int64_t poolid,
+                      coll_t cid) {
+    int r;
+    ObjectStore::CollectionHandle ch = store->open_collection(cid);
+
+    for (size_t o = 0; o < object_count; o++)
+    {
+      ObjectStore::Transaction t;
+      std::string oid = generate_monotonic_name(object_count, o, 3.71, 0.5);
+      ghobject_t hoid(hobject_t(oid, "", CEPH_NOSNAP, 0, poolid, ""));
+      generator gen{3.85 + 0.1 * o / object_count, 1 - double(o) / object_count};
+
+      bufferlist omap_header;
+      map<string, bufferlist> omap_set;
+      r = store->omap_get(ch, hoid, &omap_header, &omap_set);
+      ASSERT_EQ(r, 0);
+      size_t omap_count = 1 + gen() * 20;
+      bool do_omap_header = gen() > 0.5;
+      if (do_omap_header) {
+       std::string header_str = gen_string(50, gen);
+       ASSERT_EQ(header_str, omap_header.to_str());
+      }
+      auto it = omap_set.begin();
+      for (size_t i = 0; i < omap_count; i++) {
+       ASSERT_TRUE(it != omap_set.end());
+       std::string name = generate_monotonic_name(omap_count, i, 3.66 + 0.22 * o / object_count, 0.5);
+       std::string val_gen = gen_string(100, gen);
+       ASSERT_EQ(it->first, name);
+       ASSERT_EQ(it->second.to_str(), val_gen);
+       ++it;
+      }
+    }
+  }
+};
+
 TEST_P(StoreTest, collect_metadata) {
   map<string,string> pm;
   store->collect_metadata(&pm);
@@ -2932,6 +3066,61 @@ TEST_P(StoreTest, ListEndTest) {
   }
 }
 
+TEST_P(StoreTest, List_0xfffffff_Hash_Test_in_meta) {
+  int r = 0;
+  coll_t cid;
+  auto ch = store->create_new_collection(cid);
+  {
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  {
+    ObjectStore::Transaction t;
+    ghobject_t hoid(hobject_t(sobject_t("obj", CEPH_NOSNAP),
+                             "", UINT32_C(0xffffffff), -1, "nspace"));
+    t.touch(cid, hoid);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  {
+    vector<ghobject_t> objects;
+    r = collection_list(store, ch, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+                       &objects, nullptr, true);
+    ASSERT_EQ(r, 0);
+    ASSERT_EQ(objects.size(), 1);
+  }
+}
+
+TEST_P(StoreTest, List_0xfffffff_Hash_Test_in_PG) {
+  int r = 0;
+  const int64_t poolid = 1;
+  coll_t cid(spg_t(pg_t(0, poolid), shard_id_t::NO_SHARD));
+  auto ch = store->create_new_collection(cid);
+  {
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  {
+    ObjectStore::Transaction t;
+    ghobject_t hoid(hobject_t(sobject_t("obj", CEPH_NOSNAP),
+                             "", UINT32_C(0xffffffff), poolid, "nspace"));
+    t.touch(cid, hoid);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  {
+    vector<ghobject_t> objects;
+    r = collection_list(store, ch, ghobject_t(), ghobject_t::get_max(), INT_MAX,
+                       &objects, nullptr, true);
+    ASSERT_EQ(r, 0);
+    ASSERT_EQ(objects.size(), 1);
+  }
+}
+
 TEST_P(StoreTest, Sort) {
   {
     hobject_t a(sobject_t("a", CEPH_NOSNAP));
@@ -6622,6 +6811,18 @@ INSTANTIATE_TEST_SUITE_P(
 #endif
     "kstore"));
 
+// Note: instantiate all stores to preserve store numbering order only
+INSTANTIATE_TEST_SUITE_P(
+  ObjectStore,
+  StoreTestOmapUpgrade,
+  ::testing::Values(
+    "memstore",
+    "filestore",
+#if defined(WITH_BLUESTORE)
+    "bluestore",
+#endif
+    "kstore"));
+
 void doMany4KWritesTest(boost::scoped_ptr<ObjectStore>& store,
                         unsigned max_objects,
                         unsigned max_ops,
@@ -8557,6 +8758,69 @@ TEST_P(StoreTestSpecificAUSize, BluestoreBrokenZombieRepairTest) {
   bstore->mount();
 }
 
+TEST_P(StoreTestSpecificAUSize, BluestoreBrokenNoSharedBlobRepairTest) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  SetVal(g_conf(), "bluestore_fsck_on_mount", "false");
+  SetVal(g_conf(), "bluestore_fsck_on_umount", "false");
+
+  StartDeferred(0x10000);
+
+  BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
+
+  int r;
+
+  // initializing
+  cerr << "initializing" << std::endl;
+  {
+    const uint64_t pool = 555;
+    coll_t cid(spg_t(pg_t(0, pool), shard_id_t::NO_SHARD));
+    auto ch = store->create_new_collection(cid);
+
+    ghobject_t hoid = make_object("Object", pool);
+    ghobject_t hoid_cloned = hoid;
+    hoid_cloned.hobj.snap = 1;
+
+    {
+      ObjectStore::Transaction t;
+      t.create_collection(cid, 0);
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+    {
+      ObjectStore::Transaction t;
+      bufferlist bl;
+      bl.append("0123456789012345");
+      t.write(cid, hoid, 0, bl.length(), bl);
+
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+    {
+      ObjectStore::Transaction t;
+      t.clone(cid, hoid, hoid_cloned);
+      r = queue_transaction(store, ch, std::move(t));
+      ASSERT_EQ(r, 0);
+    }
+  }
+  // injecting an error and checking
+  cerr << "injecting" << std::endl;
+  sleep(3); // need some time for the previous write to land
+  bstore->inject_no_shared_blob_key();
+
+  {
+    cerr << "fscking/fixing" << std::endl;
+    bstore->umount();
+    ASSERT_EQ(bstore->fsck(false), 3);
+    ASSERT_LE(bstore->repair(false), 3);
+    ASSERT_EQ(bstore->fsck(false), 0);
+  }
+
+  cerr << "Completing" << std::endl;
+  bstore->mount();
+}
+
 TEST_P(StoreTest, BluestoreRepairGlobalStats) {
   if (string(GetParam()) != "bluestore")
     return;
@@ -9335,6 +9599,265 @@ TEST_P(StoreTestSpecificAUSize, Ticket45195Repro) {
   ASSERT_EQ(r, 0x10000);
 }
 
+TEST_P(StoreTestOmapUpgrade, WithOmapHeader) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "true");
+  g_conf().apply_changes(nullptr);
+
+  StartDeferred();
+  int64_t poolid = 11;
+  coll_t cid(spg_t(pg_t(1, poolid), shard_id_t::NO_SHARD));
+  ghobject_t hoid(hobject_t("tesomap", "", CEPH_NOSNAP, 0, poolid, ""));
+  auto ch = store->create_new_collection(cid);
+  int r;
+  {
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+
+  map<string, bufferlist> attrs;
+  bufferlist expected_header;
+  expected_header.append("this is a header");
+  {
+    ObjectStore::Transaction t;
+    t.touch(cid, hoid);
+    bufferlist header;
+    header.append(expected_header);
+    t.omap_setheader(cid, hoid, header);
+    map<string, bufferlist> start_set;
+    bufferlist bl;
+    bl.append(string("value"));
+    start_set.emplace(string("key1"), bl);
+    t.omap_setkeys(cid, hoid, start_set);
+    r = queue_transaction(store, ch, std::move(t));
+  }
+  {
+    map<string,bufferlist> res;
+    bufferlist h;
+    r = store->omap_get(ch, hoid, &h, &res);
+    ASSERT_EQ(r, 0);
+    ASSERT_TRUE(bl_eq(h, expected_header));
+    ASSERT_EQ(res.size(), 1);
+    ASSERT_EQ(res.begin()->first, "key1");
+  }
+  store->umount();
+  ASSERT_EQ(store->fsck(false), 0);
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");
+  SetVal(g_conf(), "bluestore_fsck_error_on_no_per_pool_omap", "true");
+  g_conf().apply_changes(nullptr);
+  ASSERT_EQ(store->fsck(false), 2);
+  ASSERT_EQ(store->quick_fix(), 0);
+  store->mount();
+  ch = store->open_collection(cid);
+  {
+    map<string,bufferlist> res;
+    bufferlist h;
+    r = store->omap_get(ch, hoid, &h, &res);
+    ASSERT_EQ(r, 0);
+    ASSERT_EQ(res.size(), 1);
+    ASSERT_EQ(res.begin()->first, "key1");
+  }
+  {
+    ObjectStore::Transaction t;
+    t.remove(cid, hoid);
+    t.remove_collection(cid);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+}
+
+TEST_P(StoreTestSpecificAUSize, BluefsWriteInSingleDiskEnvTest) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  g_conf().apply_changes(nullptr);
+
+  StartDeferred(0x1000);
+
+  BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
+  ceph_assert(bstore);
+  bstore->inject_bluefs_file("db.slow", "store_test_injection_slow", 1 << 20ul);
+  bstore->inject_bluefs_file("db.wal", "store_test_injection_wal", 1 << 20ul);
+  bstore->inject_bluefs_file("db", "store_test_injection_wal", 1 << 20ul);
+
+  AdminSocket* admin_socket = g_ceph_context->get_admin_socket();
+  ceph_assert(admin_socket);
+
+  ceph::bufferlist in, out;
+  ostringstream err;
+  auto r = admin_socket->execute_command(
+    { "{\"prefix\": \"bluefs stats\"}" },
+    in, err, &out);
+  if (r != 0) {
+    cerr << "failure querying: " << cpp_strerror(r) << std::endl;
+  }  else {
+    std::cout << std::string(out.c_str(), out.length()) << std::endl;
+  }
+}
+
+TEST_P(StoreTestSpecificAUSize, BluefsWriteInNoWalDiskEnvTest) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  SetVal(g_conf(), "bluestore_block_db_path", "db");
+  SetVal(g_conf(), "bluestore_block_db_size", stringify(1ull << 31).c_str());
+  SetVal(g_conf(), "bluestore_block_db_create", "true");
+
+  g_conf().apply_changes(nullptr);
+
+  StartDeferred(0x1000);
+
+  BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
+  ceph_assert(bstore);
+  bstore->inject_bluefs_file("db.slow", "store_test_injection_slow", 1 << 20ul);
+  bstore->inject_bluefs_file("db.wal", "store_test_injection_wal", 1 << 20ul);
+  bstore->inject_bluefs_file("db", "store_test_injection_wal", 1 << 20ul);
+
+  AdminSocket* admin_socket = g_ceph_context->get_admin_socket();
+  ceph_assert(admin_socket);
+
+  ceph::bufferlist in, out;
+  ostringstream err;
+  auto r = admin_socket->execute_command(
+    { "{\"prefix\": \"bluefs stats\"}" },
+    in, err, &out);
+  if (r != 0) {
+    cerr << "failure querying: " << cpp_strerror(r) << std::endl;
+  }
+  else {
+    std::cout << std::string(out.c_str(), out.length()) << std::endl;
+  }
+}
+
+TEST_P(StoreTestOmapUpgrade, NoOmapHeader) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "true");
+  g_conf().apply_changes(nullptr);
+
+  StartDeferred();
+  int64_t poolid = 11;
+  coll_t cid(spg_t(pg_t(1, poolid), shard_id_t::NO_SHARD));
+  ghobject_t hoid(hobject_t("tesomap", "", CEPH_NOSNAP, 0, poolid, ""));
+  auto ch = store->create_new_collection(cid);
+  int r;
+  {
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+
+  map<string, bufferlist> attrs;
+  {
+    ObjectStore::Transaction t;
+    t.touch(cid, hoid);
+    map<string, bufferlist> start_set;
+    bufferlist bl;
+    bl.append(string("value"));
+    start_set.emplace(string("key1"), bl);
+    t.omap_setkeys(cid, hoid, start_set);
+    r = queue_transaction(store, ch, std::move(t));
+  }
+  {
+    map<string,bufferlist> res;
+    bufferlist h;
+    r = store->omap_get(ch, hoid, &h, &res);
+    ASSERT_EQ(r, 0);
+    ASSERT_EQ(h.length(), 0);
+    ASSERT_EQ(res.size(), 1);
+    ASSERT_EQ(res.begin()->first, "key1");
+  }
+  store->umount();
+  ASSERT_EQ(store->fsck(false), 0);
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");
+  SetVal(g_conf(), "bluestore_fsck_error_on_no_per_pool_omap", "true");
+  g_conf().apply_changes(nullptr);
+  ASSERT_EQ(store->fsck(false), 2);
+  ASSERT_EQ(store->quick_fix(), 0);
+  store->mount();
+  ch = store->open_collection(cid);
+  {
+    map<string,bufferlist> res;
+    bufferlist h;
+    r = store->omap_get(ch, hoid, &h, &res);
+    ASSERT_EQ(r, 0);
+    ASSERT_EQ(res.size(), 1);
+    ASSERT_EQ(res.begin()->first, "key1");
+  }
+  {
+    ObjectStore::Transaction t;
+    t.remove(cid, hoid);
+    t.remove_collection(cid);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+}
+
+TEST_P(StoreTestOmapUpgrade, LargeLegacyToPG) {
+  if (string(GetParam()) != "bluestore")
+    return;
+
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "true");
+  g_conf().apply_changes(nullptr);
+
+  int64_t poolid;
+  coll_t cid;
+  ghobject_t hoid;
+  ObjectStore::CollectionHandle ch;
+  StartDeferred();
+  poolid = 11;
+  cid = coll_t(spg_t(pg_t(1, poolid), shard_id_t::NO_SHARD));
+  ch = store->create_new_collection(cid);
+  int r;
+  {
+    ObjectStore::Transaction t;
+    t.create_collection(cid, 0);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+  //ASSERT_EQ(false, g_conf().get_val<bool>("bluestore_debug_inject_upgrade_bug53062"));
+  map<string, bufferlist> attrs;
+  bufferlist expected_header;
+  expected_header.append("this is a header");
+
+  size_t object_count = 1000;
+  make_omap_data(object_count, poolid, cid);
+  //checking just written data
+  check_omap_data(object_count, poolid, cid);
+
+  store->umount();
+  ASSERT_EQ(store->fsck(false), 0);
+  SetVal(g_conf(), "bluestore_debug_legacy_omap", "false");
+  SetVal(g_conf(), "bluestore_fsck_error_on_no_per_pool_omap", "true");
+  g_conf().apply_changes(nullptr);
+  ASSERT_EQ(store->fsck(false), 1001);
+  ASSERT_EQ(store->quick_fix(), 0);
+  store->mount();
+  ch = store->open_collection(cid);
+
+  //checking quick_fix() data
+  check_omap_data(object_count, poolid, cid);
+
+  {
+    ObjectStore::Transaction t;
+    for (size_t o = 0; o < object_count; o++)
+    {
+      std::string oid = generate_monotonic_name(object_count, o, 3.71, 0.5);
+      ghobject_t hoid(hobject_t(oid, "", CEPH_NOSNAP, 0, poolid, ""));
+      t.remove(cid, hoid);
+    }
+    t.remove_collection(cid);
+    r = queue_transaction(store, ch, std::move(t));
+    ASSERT_EQ(r, 0);
+  }
+}
+
 #endif  // WITH_BLUESTORE
 
 int main(int argc, char **argv) {
index a830915952affd102582c601fa87c604b7ba56b1..50935f6a9b95cd50d359d2dfb2b9edb8bb2063c5 100644 (file)
@@ -1687,6 +1687,55 @@ TEST(bluestore_blob_t, unused)
     ASSERT_TRUE(b.is_unused(end0_aligned, min_alloc_size * 3 - end0_aligned));
   }
 }
+// This UT is primarily intended to show how repair procedure
+// causes erroneous write to INVALID_OFFSET which is reported in
+// https://tracker.ceph.com/issues/51682
+// Basic map_any functionality is tested as well though.
+//
+TEST(bluestore_blob_t, wrong_map_bl_in_51682)
+{
+  {
+    bluestore_blob_t b;
+    uint64_t min_alloc_size = 4 << 10; // 64 kB
+
+    b.allocated_test(bluestore_pextent_t(0x17ba000, 4 * min_alloc_size));
+    b.allocated_test(bluestore_pextent_t(0x17bf000, 4 * min_alloc_size));
+    b.allocated_test(
+      bluestore_pextent_t(
+        bluestore_pextent_t::INVALID_OFFSET,
+        1 * min_alloc_size));
+    b.allocated_test(bluestore_pextent_t(0x153c44d000, 7 * min_alloc_size));
+
+    b.mark_used(0, 0x8000);
+    b.mark_used(0x9000, 0x7000);
+
+    string s(0x7000, 'a');
+    bufferlist bl;
+    bl.append(s);
+    const size_t num_expected_entries = 5;
+    uint64_t expected[num_expected_entries][2] = {
+      {0x17ba000, 0x4000},
+      {0x17bf000, 0x3000},
+      {0x17c0000, 0x3000},
+      {0xffffffffffffffff, 0x1000},
+      {0x153c44d000, 0x3000}};
+    size_t expected_pos = 0;
+    b.map_bl(0, bl,
+      [&](uint64_t o, bufferlist& bl) {
+        ASSERT_EQ(o, expected[expected_pos][0]);
+        ASSERT_EQ(bl.length(), expected[expected_pos][1]);
+        ++expected_pos;
+      });
+    // 0x5000 is an improper offset presumably provided when doing a repair
+    b.map_bl(0x5000, bl,
+      [&](uint64_t o, bufferlist& bl) {
+        ASSERT_EQ(o, expected[expected_pos][0]);
+        ASSERT_EQ(bl.length(), expected[expected_pos][1]);
+        ++expected_pos;
+      });
+    ASSERT_EQ(expected_pos, num_expected_entries);
+  }
+}
 
 int main(int argc, char **argv) {
   vector<const char*> args;
index 2e067378535d0ed3de1fa4f6998caf05be6b549e..60171ea9dab1168988ee914888f20f2b80d746ee 100644 (file)
@@ -31,7 +31,8 @@ int main(int argc, char **argv) {
   return RUN_ALL_TESTS();
 }
 
-class OSDMapTest : public testing::Test {
+class OSDMapTest : public testing::Test,
+                   public ::testing::WithParamInterface<std::pair<int, int>> {
   int num_osds = 6;
 public:
   OSDMap osdmap;
@@ -1943,3 +1944,156 @@ TEST_F(OSDMapTest, BUG_48884)
     }
   }
 }
+
+TEST_P(OSDMapTest, BUG_51842) {
+    set_up_map(3, true);
+    OSDMap tmp; // use a tmpmap here, so we do not dirty origin map..
+    tmp.deepish_copy_from(osdmap);
+    for (int i = 0; i < (int)get_num_osds(); i++) {
+      stringstream osd_name;
+      stringstream host_name;
+      vector<string> move_to;
+      osd_name << "osd." << i;
+      host_name << "host=host-" << i;
+      move_to.push_back("root=infra-1706");
+      move_to.push_back(host_name.str());
+      auto r = crush_move(tmp, osd_name.str(), move_to);
+      ASSERT_EQ(0, r);
+    }
+
+    // build crush rule
+    CrushWrapper crush;
+    get_crush(tmp, crush);
+    string rule_name = "infra-1706";
+    int rule_type = pg_pool_t::TYPE_REPLICATED;
+    ASSERT_TRUE(!crush.rule_exists(rule_name));
+    int rno;
+    for (rno = 0; rno < crush.get_max_rules(); rno++) {
+      if (!crush.rule_exists(rno))
+        break;
+    }
+    string root_bucket = "infra-1706";
+    int root = crush.get_item_id(root_bucket);
+    int min_size = 1;
+    int max_size = 20;
+    int steps = 5;
+    crush_rule *rule = crush_make_rule(steps, rno, rule_type, min_size, max_size);
+    int step = 0;
+    crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSELEAF_TRIES, 5, 0);
+    crush_rule_set_step(rule, step++, CRUSH_RULE_SET_CHOOSE_TRIES, 100, 0);
+    crush_rule_set_step(rule, step++, CRUSH_RULE_TAKE, root, 0);
+    // note: it's ok to set like 'step chooseleaf_firstn 0 host'
+    std::pair<int, int> param = GetParam();
+    int rep_num = std::get<0>(param);
+    int domain = std::get<1>(param);
+    crush_rule_set_step(rule, step++, CRUSH_RULE_CHOOSELEAF_FIRSTN, rep_num, domain);
+    crush_rule_set_step(rule, step++, CRUSH_RULE_EMIT, 0, 0);
+    ASSERT_TRUE(step == steps);
+    auto r = crush_add_rule(crush.get_crush_map(), rule, rno);
+    ASSERT_TRUE(r >= 0);
+    crush.set_rule_name(rno, rule_name);
+    {
+      OSDMap::Incremental pending_inc(tmp.get_epoch() + 1);
+      pending_inc.crush.clear();
+      crush.encode(pending_inc.crush, CEPH_FEATURES_SUPPORTED_DEFAULT);
+      tmp.apply_incremental(pending_inc);
+    }
+    {
+      stringstream oss;
+      crush.dump_tree(&oss, NULL);
+      std::cout << oss.str() << std::endl;
+      Formatter *f = Formatter::create("json-pretty");
+      f->open_object_section("crush_rules");
+      crush.dump_rules(f);
+      f->close_section();
+      f->flush(cout);
+      delete f;
+    }
+    // create a replicated pool referencing the above rule
+    int64_t pool_infra_1706;
+    {
+      OSDMap::Incremental new_pool_inc(tmp.get_epoch() + 1);
+      new_pool_inc.new_pool_max = tmp.get_pool_max();
+      new_pool_inc.fsid = tmp.get_fsid();
+      pg_pool_t empty;
+      pool_infra_1706 = ++new_pool_inc.new_pool_max;
+      pg_pool_t *p = new_pool_inc.get_new_pool(pool_infra_1706, &empty);
+      p->size = 3;
+      p->min_size = 1;
+      p->set_pg_num(256);
+      p->set_pgp_num(256);
+      p->type = pg_pool_t::TYPE_REPLICATED;
+      p->crush_rule = rno;
+      p->set_flag(pg_pool_t::FLAG_HASHPSPOOL);
+      new_pool_inc.new_pool_names[pool_infra_1706] = "pool_infra_1706";
+      tmp.apply_incremental(new_pool_inc);
+    }
+
+    // add upmaps
+    pg_t rep_pg(3, pool_infra_1706);
+    pg_t rep_pgid = tmp.raw_pg_to_pg(rep_pg);
+    pg_t rep_pg2(4, pool_infra_1706);
+    pg_t rep_pgid2 = tmp.raw_pg_to_pg(rep_pg2);
+    pg_t rep_pg3(6, pool_infra_1706);
+    pg_t rep_pgid3 = tmp.raw_pg_to_pg(rep_pg3);
+    {
+      OSDMap::Incremental pending_inc(tmp.get_epoch() + 1);
+      pending_inc.new_pg_upmap[rep_pgid] = mempool::osdmap::vector<int32_t>({1,0,2});
+      pending_inc.new_pg_upmap[rep_pgid2] = mempool::osdmap::vector<int32_t>({1,2,0});
+      pending_inc.new_pg_upmap[rep_pgid3] = mempool::osdmap::vector<int32_t>({1,2,0});
+      tmp.apply_incremental(pending_inc);
+      ASSERT_TRUE(tmp.have_pg_upmaps(rep_pgid));
+      ASSERT_TRUE(tmp.have_pg_upmaps(rep_pgid2));
+      ASSERT_TRUE(tmp.have_pg_upmaps(rep_pgid3));
+    }
+
+    {
+      // now, set pool size to 1
+      OSDMap tmpmap;
+      tmpmap.deepish_copy_from(tmp);
+      OSDMap::Incremental new_pool_inc(tmpmap.get_epoch() + 1);
+      pg_pool_t p = *tmpmap.get_pg_pool(pool_infra_1706);
+      p.size = 1;
+      p.last_change = new_pool_inc.epoch;
+      new_pool_inc.new_pools[pool_infra_1706] = p;
+      tmpmap.apply_incremental(new_pool_inc);
+
+      OSDMap::Incremental new_pending_inc(tmpmap.get_epoch() + 1);
+      clean_pg_upmaps(g_ceph_context, tmpmap, new_pending_inc);
+      tmpmap.apply_incremental(new_pending_inc);
+      // check pg upmaps
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid));
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid2));
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid3));
+    }
+    {
+      // now, set pool size to 4
+      OSDMap tmpmap;
+      tmpmap.deepish_copy_from(tmp);
+      OSDMap::Incremental new_pool_inc(tmpmap.get_epoch() + 1);
+      pg_pool_t p = *tmpmap.get_pg_pool(pool_infra_1706);
+      p.size = 4;
+      p.last_change = new_pool_inc.epoch;
+      new_pool_inc.new_pools[pool_infra_1706] = p;
+      tmpmap.apply_incremental(new_pool_inc);
+
+      OSDMap::Incremental new_pending_inc(tmpmap.get_epoch() + 1);
+      clean_pg_upmaps(g_ceph_context, tmpmap, new_pending_inc);
+      tmpmap.apply_incremental(new_pending_inc);
+      // check pg upmaps
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid));
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid2));
+      ASSERT_TRUE(!tmpmap.have_pg_upmaps(rep_pgid3));
+    }
+}
+
+INSTANTIATE_TEST_CASE_P(
+  OSDMap,
+  OSDMapTest,
+  ::testing::Values(
+    std::make_pair<int, int>(0, 1), // chooseleaf firstn 0 host
+    std::make_pair<int, int>(3, 1), // chooseleaf firstn 3 host
+    std::make_pair<int, int>(0, 0), // chooseleaf firstn 0 osd
+    std::make_pair<int, int>(3, 0)  // chooseleaf firstn 3 osd
+  )
+);
index c3702a9cc33bf2433667a27edbe7a55ab4854846..e1a52c87602c8d8a9444cf547071d7b79e4fe303 100644 (file)
@@ -9,6 +9,7 @@
 #include "librbd/TrashWatcher.h"
 #include "librbd/journal/ResetRequest.h"
 #include "librbd/mirror/GetInfoRequest.h"
+#include "librbd/mirror/ImageRemoveRequest.h"
 #include "librbd/trash/MoveRequest.h"
 #include "tools/rbd_mirror/Threads.h"
 #include "tools/rbd_mirror/image_deleter/TrashMoveRequest.h"
@@ -131,6 +132,37 @@ struct GetInfoRequest<librbd::MockTestImageCtx> {
 
 GetInfoRequest<librbd::MockTestImageCtx>* GetInfoRequest<librbd::MockTestImageCtx>::s_instance = nullptr;
 
+template<>
+struct ImageRemoveRequest<librbd::MockTestImageCtx> {
+  static ImageRemoveRequest* s_instance;
+  std::string global_image_id;
+  std::string image_id;
+  Context* on_finish;
+
+  static ImageRemoveRequest *create(librados::IoCtx& io_ctx,
+                                    const std::string& global_image_id,
+                                    const std::string& image_id,
+                                    Context* on_finish) {
+    ceph_assert(s_instance != nullptr);
+    s_instance->global_image_id = global_image_id;
+    s_instance->image_id = image_id;
+    s_instance->on_finish = on_finish;
+    return s_instance;
+  }
+
+  ImageRemoveRequest() {
+    ceph_assert(s_instance == nullptr);
+    s_instance = this;
+  }
+  ~ImageRemoveRequest() {
+    s_instance = nullptr;
+  }
+
+  MOCK_METHOD0(send, void());
+};
+
+ImageRemoveRequest<librbd::MockTestImageCtx>* ImageRemoveRequest<librbd::MockTestImageCtx>::s_instance = nullptr;
+
 } // namespace mirror
 namespace trash {
 
@@ -185,6 +217,7 @@ public:
   typedef TrashMoveRequest<librbd::MockTestImageCtx> MockTrashMoveRequest;
   typedef librbd::journal::ResetRequest<librbd::MockTestImageCtx> MockJournalResetRequest;
   typedef librbd::mirror::GetInfoRequest<librbd::MockTestImageCtx> MockGetMirrorInfoRequest;
+  typedef librbd::mirror::ImageRemoveRequest<librbd::MockTestImageCtx> MockImageRemoveRequest;
   typedef librbd::trash::MoveRequest<librbd::MockTestImageCtx> MockLibrbdTrashMoveRequest;
   typedef librbd::TrashWatcher<librbd::MockTestImageCtx> MockTrashWatcher;
 
@@ -273,11 +306,12 @@ public:
       .WillOnce(Return(r));
   }
 
-  void expect_mirror_image_remove(librados::IoCtx &ioctx, int r) {
-    EXPECT_CALL(get_mock_io_ctx(ioctx),
-                exec(StrEq("rbd_mirroring"), _, StrEq("rbd"),
-                     StrEq("mirror_image_remove"), _, _, _, _))
-      .WillOnce(Return(r));
+  void expect_mirror_image_remove_request(
+      MockImageRemoveRequest& mock_image_remove_request, int r) {
+    EXPECT_CALL(mock_image_remove_request, send())
+      .WillOnce(Invoke([this, &mock_image_remove_request, r]() {
+                  m_threads->work_queue->queue(mock_image_remove_request.on_finish, r);
+                }));
   }
 
   void expect_journal_reset(MockJournalResetRequest& mock_journal_reset_request,
@@ -355,7 +389,8 @@ TEST_F(TestMockImageDeleterTrashMoveRequest, SuccessJournal) {
   MockLibrbdTrashMoveRequest mock_librbd_trash_move_request;
   expect_trash_move(mock_librbd_trash_move_request, m_image_name, "image id",
                     {}, 0);
-  expect_mirror_image_remove(m_local_io_ctx, 0);
+  MockImageRemoveRequest mock_image_remove_request;
+  expect_mirror_image_remove_request(mock_image_remove_request, 0);
 
   expect_close(mock_image_ctx, 0);
 
@@ -396,7 +431,8 @@ TEST_F(TestMockImageDeleterTrashMoveRequest, SuccessSnapshot) {
   MockLibrbdTrashMoveRequest mock_librbd_trash_move_request;
   expect_trash_move(mock_librbd_trash_move_request, m_image_name, "image id",
                     {}, 0);
-  expect_mirror_image_remove(m_local_io_ctx, 0);
+  MockImageRemoveRequest mock_image_remove_request;
+  expect_mirror_image_remove_request(mock_image_remove_request, 0);
 
   expect_close(mock_image_ctx, 0);
 
@@ -742,7 +778,8 @@ TEST_F(TestMockImageDeleterTrashMoveRequest, RemoveMirrorImageError) {
   MockLibrbdTrashMoveRequest mock_librbd_trash_move_request;
   expect_trash_move(mock_librbd_trash_move_request, m_image_name, "image id",
                     {}, 0);
-  expect_mirror_image_remove(m_local_io_ctx, -EINVAL);
+  MockImageRemoveRequest mock_image_remove_request;
+  expect_mirror_image_remove_request(mock_image_remove_request, -EINVAL);
 
   expect_close(mock_image_ctx, 0);
 
@@ -791,7 +828,8 @@ TEST_F(TestMockImageDeleterTrashMoveRequest, CloseImageError) {
   MockLibrbdTrashMoveRequest mock_librbd_trash_move_request;
   expect_trash_move(mock_librbd_trash_move_request, m_image_name, "image id",
                     {}, 0);
-  expect_mirror_image_remove(m_local_io_ctx, 0);
+  MockImageRemoveRequest mock_image_remove_request;
+  expect_mirror_image_remove_request(mock_image_remove_request, 0);
 
   expect_close(mock_image_ctx, -EINVAL);
 
@@ -842,7 +880,8 @@ TEST_F(TestMockImageDeleterTrashMoveRequest, DelayedDelation) {
   expect_trash_move(mock_librbd_trash_move_request, m_image_name, "image id",
                     600, 0);
 
-  expect_mirror_image_remove(m_local_io_ctx, 0);
+  MockImageRemoveRequest mock_image_remove_request;
+  expect_mirror_image_remove_request(mock_image_remove_request, 0);
   expect_close(mock_image_ctx, 0);
 
   MockTrashWatcher mock_trash_watcher;
index 0b0a87e8de52d2b5980e18e4caddfe32f4523d7b..54c3b24efac963092f7df35396e58a94126a55d8 100644 (file)
@@ -5,6 +5,7 @@
 #include "cls/rbd/cls_rbd_types.h"
 #include "librbd/journal/TypeTraits.h"
 #include "librbd/mirror/GetInfoRequest.h"
+#include "tools/rbd_mirror/ImageDeleter.h"
 #include "tools/rbd_mirror/image_replayer/GetMirrorImageIdRequest.h"
 #include "tools/rbd_mirror/image_replayer/PrepareLocalImageRequest.h"
 #include "tools/rbd_mirror/image_replayer/StateBuilder.h"
@@ -70,6 +71,28 @@ GetInfoRequest<librbd::MockTestImageCtx>* GetInfoRequest<librbd::MockTestImageCt
 
 namespace rbd {
 namespace mirror {
+
+template <>
+struct ImageDeleter<librbd::MockTestImageCtx> {
+  static ImageDeleter* s_instance;
+
+  static void trash_move(librados::IoCtx& local_io_ctx,
+                         const std::string& global_image_id, bool resync,
+                         librbd::asio::ContextWQ* work_queue,
+                         Context* on_finish) {
+    ceph_assert(s_instance != nullptr);
+    s_instance->trash_move(global_image_id, resync, on_finish);
+  }
+
+  MOCK_METHOD3(trash_move, void(const std::string&, bool, Context*));
+
+  ImageDeleter() {
+    s_instance = this;
+  }
+};
+
+ImageDeleter<librbd::MockTestImageCtx>* ImageDeleter<librbd::MockTestImageCtx>::s_instance = nullptr;
+
 namespace image_replayer {
 
 template <>
@@ -176,6 +199,7 @@ using ::testing::WithArgs;
 
 class TestMockImageReplayerPrepareLocalImageRequest : public TestMockFixture {
 public:
+  typedef ImageDeleter<librbd::MockTestImageCtx> MockImageDeleter;
   typedef PrepareLocalImageRequest<librbd::MockTestImageCtx> MockPrepareLocalImageRequest;
   typedef GetMirrorImageIdRequest<librbd::MockTestImageCtx> MockGetMirrorImageIdRequest;
   typedef StateBuilder<librbd::MockTestImageCtx> MockStateBuilder;
@@ -222,6 +246,17 @@ public:
             mock_get_mirror_info_request.on_finish, r);
         }));
   }
+
+  void expect_trash_move(MockImageDeleter& mock_image_deleter,
+                         const std::string& global_image_id,
+                         bool ignore_orphan, int r) {
+    EXPECT_CALL(mock_image_deleter,
+                trash_move(global_image_id, ignore_orphan, _))
+      .WillOnce(WithArg<2>(Invoke([this, r](Context* ctx) {
+                             m_threads->work_queue->queue(ctx, r);
+                           })));
+  }
+
 };
 
 TEST_F(TestMockImageReplayerPrepareLocalImageRequest, SuccessJournal) {
@@ -400,6 +435,71 @@ TEST_F(TestMockImageReplayerPrepareLocalImageRequest, MirrorImageInfoError) {
   ASSERT_EQ(-EINVAL, ctx.wait());
 }
 
+TEST_F(TestMockImageReplayerPrepareLocalImageRequest, ImageCreating) {
+  InSequence seq;
+  MockGetMirrorImageIdRequest mock_get_mirror_image_id_request;
+  expect_get_mirror_image_id(mock_get_mirror_image_id_request, "local image id",
+                             0);
+  expect_dir_get_name(m_local_io_ctx, "local image name", 0);
+
+  MockGetMirrorInfoRequest mock_get_mirror_info_request;
+  expect_get_mirror_info(mock_get_mirror_info_request,
+                         {cls::rbd::MIRROR_IMAGE_MODE_SNAPSHOT,
+                          "global image id",
+                          cls::rbd::MIRROR_IMAGE_STATE_CREATING},
+                         librbd::mirror::PROMOTION_STATE_NON_PRIMARY,
+                         "remote mirror uuid", 0);
+
+  MockImageDeleter mock_image_deleter;
+  expect_trash_move(mock_image_deleter, "global image id", false, 0);
+
+  MockSnapshotStateBuilder mock_journal_state_builder;
+  MockStateBuilder* mock_state_builder = nullptr;
+  std::string local_image_name;
+  C_SaferCond ctx;
+  auto req = MockPrepareLocalImageRequest::create(m_local_io_ctx,
+                                                  "global image id",
+                                                  &local_image_name,
+                                                  &mock_state_builder,
+                                                  m_threads->work_queue,
+                                                  &ctx);
+  req->send();
+
+  ASSERT_EQ(-ENOENT, ctx.wait());
+  ASSERT_TRUE(mock_state_builder == nullptr);
+}
+
+TEST_F(TestMockImageReplayerPrepareLocalImageRequest, ImageDisabling) {
+  InSequence seq;
+  MockGetMirrorImageIdRequest mock_get_mirror_image_id_request;
+  expect_get_mirror_image_id(mock_get_mirror_image_id_request, "local image id",
+                             0);
+  expect_dir_get_name(m_local_io_ctx, "local image name", 0);
+
+  MockGetMirrorInfoRequest mock_get_mirror_info_request;
+  expect_get_mirror_info(mock_get_mirror_info_request,
+                         {cls::rbd::MIRROR_IMAGE_MODE_SNAPSHOT,
+                          "global image id",
+                          cls::rbd::MIRROR_IMAGE_STATE_DISABLING},
+                         librbd::mirror::PROMOTION_STATE_NON_PRIMARY,
+                         "remote mirror uuid", 0);
+
+  MockSnapshotStateBuilder mock_journal_state_builder;
+  MockStateBuilder* mock_state_builder = nullptr;
+  std::string local_image_name;
+  C_SaferCond ctx;
+  auto req = MockPrepareLocalImageRequest::create(m_local_io_ctx,
+                                                  "global image id",
+                                                  &local_image_name,
+                                                  &mock_state_builder,
+                                                  m_threads->work_queue,
+                                                  &ctx);
+  req->send();
+
+  ASSERT_EQ(-ERESTART, ctx.wait());
+  ASSERT_TRUE(mock_state_builder == nullptr);
+}
+
 } // namespace image_replayer
 } // namespace mirror
 } // namespace rbd
index cb21fc7239619fd02b842d71c0d409df718fdd0c..76a6919d5adbb8b83556cb96579a7b7ed0f04599 100644 (file)
@@ -664,7 +664,7 @@ TYPED_TEST(TestImageReplayer, BootstrapMirrorDisabling)
   this->create_replayer();
   C_SaferCond cond;
   this->m_replayer->start(&cond);
-  ASSERT_EQ(-EREMOTEIO, cond.wait());
+  ASSERT_EQ(-ENOENT, cond.wait());
   ASSERT_TRUE(this->m_replayer->is_stopped());
 }
 
index 20693e3223b7b35b3b69f8753d8af4a0bca69253..e75fa0ac4907ccc79369deb59766e2440deec8b1 100644 (file)
@@ -63,7 +63,10 @@ struct MirrorStatusUpdater<librbd::MockTestImageCtx> {
   MOCK_METHOD3(set_mirror_image_status,
                void(const std::string&, const cls::rbd::MirrorImageSiteStatus&,
                     bool));
-  MOCK_METHOD2(remove_mirror_image_status, void(const std::string&, Context*));
+  MOCK_METHOD2(remove_refresh_mirror_image_status, void(const std::string&,
+                                                        Context*));
+  MOCK_METHOD3(remove_mirror_image_status, void(const std::string&, bool,
+                                                Context*));
 };
 
 template <>
@@ -280,10 +283,11 @@ public:
   void expect_send(MockBootstrapRequest& mock_bootstrap_request,
                    MockStateBuilder& mock_state_builder,
                    librbd::MockTestImageCtx& mock_local_image_ctx,
-                   bool do_resync, int r) {
+                   bool do_resync, bool set_local_image, int r) {
     EXPECT_CALL(mock_bootstrap_request, send())
       .WillOnce(Invoke([this, &mock_bootstrap_request, &mock_state_builder,
-                        &mock_local_image_ctx, do_resync, r]() {
+                        &mock_local_image_ctx, set_local_image, do_resync,
+                        r]() {
             if (r == 0 || r == -ENOLINK) {
               mock_state_builder.local_image_id = mock_local_image_ctx.id;
               mock_state_builder.remote_image_id = m_remote_image_ctx->id;
@@ -293,9 +297,15 @@ public:
               mock_state_builder.local_image_ctx = &mock_local_image_ctx;
               *mock_bootstrap_request.do_resync = do_resync;
             }
-            if (r < 0) {
+            if (r < 0 && r != -ENOENT) {
               mock_state_builder.remote_image_id = "";
             }
+            if (r == -ENOENT) {
+              *mock_bootstrap_request.state_builder = &mock_state_builder;
+            }
+            if (set_local_image) {
+              mock_state_builder.local_image_id = mock_local_image_ctx.id;
+            }
             mock_bootstrap_request.on_finish->complete(r);
           }));
   }
@@ -402,7 +412,7 @@ TEST_F(TestMockImageReplayer, StartStop) {
   MockBootstrapRequest mock_bootstrap_request;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, 0);
@@ -444,8 +454,42 @@ TEST_F(TestMockImageReplayer, LocalImagePrimary) {
 
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, -ENOMSG);
+              false, false, -ENOMSG);
+
+  expect_mirror_image_status_exists(false);
+
+  create_image_replayer(mock_threads);
+
+  C_SaferCond start_ctx;
+  m_image_replayer->start(&start_ctx);
+  ASSERT_EQ(0, start_ctx.wait());
+}
+
+TEST_F(TestMockImageReplayer, MetadataCleanup) {
+  // START
+
+  create_local_image();
+  librbd::MockTestImageCtx mock_local_image_ctx(*m_local_image_ctx);
+
+  MockThreads mock_threads(m_threads);
+  expect_work_queue_repeatedly(mock_threads);
+  expect_add_event_after_repeatedly(mock_threads);
+
+  MockImageDeleter mock_image_deleter;
+  MockBootstrapRequest mock_bootstrap_request;
+  MockReplayer mock_replayer;
+
+  expect_get_replay_status(mock_replayer);
+  expect_set_mirror_image_status_repeatedly();
+
+  InSequence seq;
+
+  MockStateBuilder mock_state_builder;
+  expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
+              false, true, -ENOLINK);
 
+  expect_close(mock_state_builder, 0);
+  expect_trash_move(mock_image_deleter, "global image id", false, 0);
   expect_mirror_image_status_exists(false);
 
   create_image_replayer(mock_threads);
@@ -472,7 +516,7 @@ TEST_F(TestMockImageReplayer, BootstrapRemoteDeleted) {
   MockBootstrapRequest mock_bootstrap_request;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, -ENOLINK);
+              false, false, -ENOLINK);
 
   expect_close(mock_state_builder, 0);
 
@@ -503,7 +547,7 @@ TEST_F(TestMockImageReplayer, BootstrapResyncRequested) {
   MockBootstrapRequest mock_bootstrap_request;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              true, 0);
+              true, false, 0);
 
   expect_close(mock_state_builder, 0);
 
@@ -533,7 +577,7 @@ TEST_F(TestMockImageReplayer, BootstrapError) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, -EINVAL);
+              false, false, -EINVAL);
 
   expect_mirror_image_status_exists(false);
 
@@ -596,7 +640,7 @@ TEST_F(TestMockImageReplayer, StopError) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, 0);
@@ -635,7 +679,7 @@ TEST_F(TestMockImageReplayer, ReplayerError) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, -EINVAL);
@@ -672,7 +716,7 @@ TEST_F(TestMockImageReplayer, ReplayerResync) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, 0);
@@ -715,7 +759,7 @@ TEST_F(TestMockImageReplayer, ReplayerInterrupted) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, 0);
@@ -763,7 +807,7 @@ TEST_F(TestMockImageReplayer, ReplayerRenamed) {
   InSequence seq;
   MockStateBuilder mock_state_builder;
   expect_send(mock_bootstrap_request, mock_state_builder, mock_local_image_ctx,
-              false, 0);
+              false, false, 0);
 
   expect_create_replayer(mock_state_builder, mock_replayer);
   expect_init(mock_replayer, 0);
index 057159ceb4b884bde21d2d0ca293b28e44df85fd..ac8009df1379e5407779ee51e1fe09cac6803413 100644 (file)
@@ -186,6 +186,38 @@ public:
     }
   }
 
+  void expect_mirror_status_remove(const std::string& global_image_id, int r) {
+    EXPECT_CALL(*m_mock_local_io_ctx,
+                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                     StrEq("mirror_image_status_remove"), _, _, _, _))
+      .WillOnce(WithArg<4>(Invoke(
+        [r, global_image_id](bufferlist& in_bl) {
+          auto bl_it = in_bl.cbegin();
+          std::string decode_global_image_id;
+          decode(decode_global_image_id, bl_it);
+          EXPECT_EQ(global_image_id, decode_global_image_id);
+
+          return r;
+        })));
+  }
+
+  void expect_mirror_status_removes(const std::set<std::string>& mirror_images,
+                                    int r) {
+    EXPECT_CALL(*m_mock_local_io_ctx, aio_operate(_, _, _, _, _))
+      .WillOnce(Invoke([this](auto&&... args) {
+          int r = m_mock_local_io_ctx->do_aio_operate(decltype(args)(args)...);
+          m_mock_local_io_ctx->aio_flush();
+          return r;
+        }));
+
+    for (auto global_image_id : mirror_images) {
+      expect_mirror_status_remove(global_image_id, r);
+      if (r < 0) {
+        break;
+      }
+    }
+  }
+
   void fire_timer_event(Context** timer_event,
                         Context** update_task) {
     expect_timer_add_event(timer_event);
@@ -385,6 +417,78 @@ TEST_F(TestMockMirrorStatusUpdater, OverwriteStatus) {
                                   *mock_mirror_status_watcher);
 }
 
+TEST_F(TestMockMirrorStatusUpdater, RemoveStatus) {
+  MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
+                                                     m_mock_threads, "");
+  MockMirrorStatusWatcher* mock_mirror_status_watcher =
+    new MockMirrorStatusWatcher();
+
+  InSequence seq;
+
+  Context* timer_event = nullptr;
+  init_mirror_status_updater(mock_mirror_status_updater,
+                             *mock_mirror_status_watcher, &timer_event);
+
+  C_SaferCond ctx;
+  mock_mirror_status_updater.set_mirror_image_status("1", {}, false);
+  expect_work_queue(false);
+  mock_mirror_status_updater.remove_mirror_image_status("1", false, &ctx);
+  ASSERT_EQ(0, ctx.wait());
+
+  Context* update_task = nullptr;
+  fire_timer_event(&timer_event, &update_task);
+
+  C_SaferCond remove_flush_ctx;
+  EXPECT_CALL(*m_mock_local_io_ctx, aio_operate(_, _, _, _, _))
+    .WillOnce(Invoke([this, &remove_flush_ctx](auto&&... args) {
+        int r = m_mock_local_io_ctx->do_aio_operate(decltype(args)(args)...);
+        m_mock_local_io_ctx->aio_flush();
+        remove_flush_ctx.complete(r);
+        return r;
+      }));
+  expect_mirror_status_remove("1", 0);
+  update_task->complete(0);
+  ASSERT_EQ(0, remove_flush_ctx.wait());
+
+  shut_down_mirror_status_updater(mock_mirror_status_updater,
+                                  *mock_mirror_status_watcher);
+}
+
+TEST_F(TestMockMirrorStatusUpdater, OverwriteRemoveStatus) {
+  MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
+                                                     m_mock_threads, "");
+  MockMirrorStatusWatcher* mock_mirror_status_watcher =
+    new MockMirrorStatusWatcher();
+
+  InSequence seq;
+
+  Context* timer_event = nullptr;
+  init_mirror_status_updater(mock_mirror_status_updater,
+                             *mock_mirror_status_watcher, &timer_event);
+
+  C_SaferCond ctx;
+  mock_mirror_status_updater.set_mirror_image_status("1", {}, false);
+  expect_work_queue(false);
+  mock_mirror_status_updater.remove_mirror_image_status("1", false, &ctx);
+  ASSERT_EQ(0, ctx.wait());
+  mock_mirror_status_updater.set_mirror_image_status(
+    "1", {"", cls::rbd::MIRROR_IMAGE_STATUS_STATE_REPLAYING, "description"},
+    false);
+
+
+  Context* update_task = nullptr;
+  fire_timer_event(&timer_event, &update_task);
+
+  expect_mirror_status_update(
+    {{"1", cls::rbd::MirrorImageSiteStatus{
+        "", cls::rbd::MIRROR_IMAGE_STATUS_STATE_REPLAYING, "description"}}},
+    "", 0);
+  update_task->complete(0);
+
+  shut_down_mirror_status_updater(mock_mirror_status_updater,
+                                  *mock_mirror_status_watcher);
+}
+
 TEST_F(TestMockMirrorStatusUpdater, OverwriteStatusInFlight) {
   MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
                                                      m_mock_threads, "");
@@ -447,7 +551,32 @@ TEST_F(TestMockMirrorStatusUpdater, ImmediateUpdate) {
                                   *mock_mirror_status_watcher);
 }
 
-TEST_F(TestMockMirrorStatusUpdater, RemoveIdleStatus) {
+TEST_F(TestMockMirrorStatusUpdater, RemoveImmediateUpdate) {
+  MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
+                                                     m_mock_threads, "");
+  MockMirrorStatusWatcher* mock_mirror_status_watcher =
+    new MockMirrorStatusWatcher();
+
+  InSequence seq;
+
+  Context* timer_event = nullptr;
+  init_mirror_status_updater(mock_mirror_status_updater,
+                             *mock_mirror_status_watcher, &timer_event);
+
+  mock_mirror_status_updater.set_mirror_image_status("1", {}, false);
+
+  C_SaferCond ctx;
+  expect_work_queue(true);
+  expect_work_queue(true);
+  expect_mirror_status_removes({"1"}, 0);
+  mock_mirror_status_updater.remove_mirror_image_status("1", true, &ctx);
+  ASSERT_EQ(0, ctx.wait());
+
+  shut_down_mirror_status_updater(mock_mirror_status_updater,
+                                  *mock_mirror_status_watcher);
+}
+
+TEST_F(TestMockMirrorStatusUpdater, RemoveRefreshIdleStatus) {
   MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
                                                      m_mock_threads, "");
   MockMirrorStatusWatcher* mock_mirror_status_watcher =
@@ -463,14 +592,14 @@ TEST_F(TestMockMirrorStatusUpdater, RemoveIdleStatus) {
 
   C_SaferCond ctx;
   expect_work_queue(true);
-  mock_mirror_status_updater.remove_mirror_image_status("1", &ctx);
+  mock_mirror_status_updater.remove_refresh_mirror_image_status("1", &ctx);
   ASSERT_EQ(0, ctx.wait());
 
   shut_down_mirror_status_updater(mock_mirror_status_updater,
                                   *mock_mirror_status_watcher);
 }
 
-TEST_F(TestMockMirrorStatusUpdater, RemoveInFlightStatus) {
+TEST_F(TestMockMirrorStatusUpdater, RemoveRefreshInFlightStatus) {
   MockMirrorStatusUpdater mock_mirror_status_updater(m_local_io_ctx,
                                                      m_mock_threads, "");
   MockMirrorStatusWatcher* mock_mirror_status_watcher =
@@ -491,7 +620,8 @@ TEST_F(TestMockMirrorStatusUpdater, RemoveInFlightStatus) {
   EXPECT_CALL(*m_mock_local_io_ctx, aio_operate(_, _, _, _, _))
     .WillOnce(Invoke(
       [this, &mock_mirror_status_updater, &on_removed](auto&&... args) {
-        mock_mirror_status_updater.remove_mirror_image_status("1", &on_removed);
+        mock_mirror_status_updater.remove_refresh_mirror_image_status(
+            "1", &on_removed);
 
         int r = m_mock_local_io_ctx->do_aio_operate(decltype(args)(args)...);
         m_mock_local_io_ctx->aio_flush();
index 5171401a61554a6b58f562668a98062d1833fe41..1d436c5b35adba627015f39a3b563975a43037c4 100644 (file)
@@ -335,11 +335,11 @@ def verify_s3_records_by_elements(records, keys, exact_match=False, deletions=Fa
                 for record in record_list['Records']:
                     if record['s3']['bucket']['name'] == key.bucket.name and \
                         record['s3']['object']['key'] == key.name:
-                        if deletions and 'ObjectRemoved' in record['eventName']:
+                        if deletions and record['eventName'].startswith('ObjectRemoved'):
                             key_found = True
                             object_size = record['s3']['object']['size']
                             break
-                        elif not deletions and 'ObjectCreated' in record['eventName']:
+                        elif not deletions and record['eventName'].startswith('ObjectCreated'):
                             key_found = True
                             object_size = record['s3']['object']['size']
                             break
@@ -347,11 +347,11 @@ def verify_s3_records_by_elements(records, keys, exact_match=False, deletions=Fa
             for record in records['Records']:
                 if record['s3']['bucket']['name'] == key.bucket.name and \
                     record['s3']['object']['key'] == key.name:
-                    if deletions and 'ObjectRemoved' in record['eventName']:
+                    if deletions and record['eventName'].startswith('ObjectRemoved'):
                         key_found = True
                         object_size = record['s3']['object']['size']
                         break
-                    elif not deletions and 'ObjectCreated' in record['eventName']:
+                    elif not deletions and record['eventName'].startswith('ObjectCreated'):
                         key_found = True
                         object_size = record['s3']['object']['size']
                         break
@@ -4207,19 +4207,22 @@ def test_ps_s3_versioned_deletion_on_master():
 
     # create objects in the bucket
     key = bucket.new_key('foo')
-    key.set_contents_from_string('bar')
-    v1 = key.version_id
-    key.set_contents_from_string('kaboom')
-    v2 = key.version_id
+    content = str(os.urandom(512))
+    size1 = len(content)
+    key.set_contents_from_string(content)
+    ver1 = key.version_id
+    content = str(os.urandom(511))
+    size2 = len(content)
+    key.set_contents_from_string(content)
+    ver2 = key.version_id
     # create delete marker (non versioned deletion)
     delete_marker_key = bucket.delete_key(key.name)
     
     time.sleep(1)
     
     # versioned deletion
-    bucket.delete_key(key.name, version_id=v2)
-    bucket.delete_key(key.name, version_id=v1)
-    delete_marker_key.delete()
+    bucket.delete_key(key.name, version_id=ver2)
+    bucket.delete_key(key.name, version_id=ver1)
 
     print('wait for 5sec for the messages...')
     time.sleep(5)
@@ -4230,21 +4233,25 @@ def test_ps_s3_versioned_deletion_on_master():
     delete_marker_create_events = 0
     for event_list in events:
         for event in event_list['Records']:
+            size = event['s3']['object']['size']
             if event['eventName'] == 's3:ObjectRemoved:Delete':
                 delete_events += 1
+                assert size in [size1, size2]
                 assert event['s3']['configurationId'] in [notification_name+'_1', notification_name+'_3']
             if event['eventName'] == 's3:ObjectRemoved:DeleteMarkerCreated':
                 delete_marker_create_events += 1
+                assert size == size2
                 assert event['s3']['configurationId'] in [notification_name+'_1', notification_name+'_2']
    
-    # 3 key versions were deleted (v1, v2 and the deletion marker)
+    # 2 key versions were deleted
     # notified over the same topic via 2 notifications (1,3)
-    assert_equal(delete_events, 3*2)
+    assert_equal(delete_events, 2*2)
     # 1 deletion marker was created
     # notified over the same topic over 2 notifications (1,2)
     assert_equal(delete_marker_create_events, 1*2)
 
     # cleanup
+    delete_marker_key.delete()
     stop_amqp_receiver(receiver, task)
     s3_notification_conf.del_config()
     topic_conf.del_config()
index 9f55626d21181f796c150fc80f9ec0715df9d3c5..0553f8061b7074c441765ef8a908466801c4ecae 100644 (file)
@@ -18,8 +18,7 @@ def put_object_tagging(conn, bucket_name, key, tags):
     client = boto3.client('s3',
             endpoint_url='http://'+conn.host+':'+str(conn.port),
             aws_access_key_id=conn.aws_access_key_id,
-            aws_secret_access_key=conn.aws_secret_access_key,
-            config=Config(signature_version='s3'))
+            aws_secret_access_key=conn.aws_secret_access_key)
     return client.put_object(Body='aaaaaaaaaaa', Bucket=bucket_name, Key=key, Tagging=tags)
 
 
@@ -27,8 +26,7 @@ def get_object_tagging(conn, bucket, object_key):
     client = boto3.client('s3',
             endpoint_url='http://'+conn.host+':'+str(conn.port),
             aws_access_key_id=conn.aws_access_key_id,
-            aws_secret_access_key=conn.aws_secret_access_key,
-            config=Config(signature_version='s3'))
+            aws_secret_access_key=conn.aws_secret_access_key)
     return client.get_object_tagging(
                 Bucket=bucket, 
                 Key=object_key
@@ -156,8 +154,7 @@ def delete_all_s3_topics(zone, region):
                 aws_access_key_id=conn.aws_access_key_id,
                 aws_secret_access_key=conn.aws_secret_access_key,
                 region_name=region,
-                verify='./cert.pem',
-                config=Config(signature_version='s3'))
+                verify='./cert.pem')
 
         topics = client.list_topics()['Topics']
         for topic in topics:
@@ -206,8 +203,7 @@ class PSTopicS3:
                            aws_access_key_id=conn.aws_access_key_id,
                            aws_secret_access_key=conn.aws_secret_access_key,
                            region_name=region,
-                           verify='./cert.pem',
-                           config=Config(signature_version='s3'))
+                           verify='./cert.pem')
 
 
     def get_config(self):
@@ -335,8 +331,7 @@ class PSNotificationS3:
         self.client = boto3.client('s3',
                                    endpoint_url='http://'+conn.host+':'+str(conn.port),
                                    aws_access_key_id=conn.aws_access_key_id,
-                                   aws_secret_access_key=conn.aws_secret_access_key,
-                                   config=Config(signature_version='s3'))
+                                   aws_secret_access_key=conn.aws_secret_access_key)
 
     def send_request(self, method, parameters=None):
         """send request to radosgw"""
index 0e94751ceaaea785cf72d6d5ad8fc0fb5d9266ff..9572c68342f05f3cabda45bfde9403cc0e63dd3a 100755 (executable)
@@ -1,11 +1,6 @@
 #!/bin/sh
 set -e
 
-if ! command -v virtualenv >/dev/null; then
-    echo "$0: virtualenv not installed, skipping python-using tests." 1>&2
-    exit 1
-fi
-
 SRCDIR="$(dirname "$0")"
 
 # build directory, if different, can be passed as an argument;
@@ -30,7 +25,7 @@ if [ ! -e "$CRAM_BIN" ]; then
     # patched cram to support that. See upstream ticket at
     # https://bitbucket.org/brodie/cram/issue/9/allow-read-only-directories-for-t
     # -- tv@inktank.com
-    virtualenv --python python3 "$VENV" && $VENV/bin/pip --log "$VENV"/log.txt \
+    python3 -m venv "$VENV" && $VENV/bin/pip --log "$VENV"/log.txt \
         install git+https://github.com/ceph/cram.git@0.7-error-dir#egg=cram
 fi
 
index fdfde4f34ef9034fa42663ed77dc6659df9dcb39..53314d13858c8db3292e5dcb4b8f2b5e03d6a447 100644 (file)
@@ -48,6 +48,7 @@ install(TARGETS ceph-osdomap-tool DESTINATION bin)
 
 add_executable(ceph-monstore-tool
   ceph_monstore_tool.cc
+  ../auth/cephx/CephxKeyServer.cc
   ../mgr/mgr_commands.cc)
 target_link_libraries(ceph-monstore-tool os global Boost::program_options)
 install(TARGETS ceph-monstore-tool DESTINATION bin)
index b4cff0553205dd717033c020c09e17d23ae8d779..6614c9b88a5a0082173c90f017b5fb1a52866f6a 100644 (file)
@@ -494,6 +494,20 @@ static int update_auth(MonitorDBStore& st, const string& keyring_path)
     inc.encode(bl, CEPH_FEATURES_ALL);
   }
 
+  // prime rotating secrets
+  {
+    KeyServer ks(g_ceph_context, nullptr);
+    KeyServerData::Incremental auth_inc;
+    auth_inc.op = KeyServerData::AUTH_INC_SET_ROTATING;
+    bool r = ks.prepare_rotating_update(auth_inc.rotating_bl);
+    ceph_assert(r);
+    AuthMonitor::Incremental inc;
+    inc.inc_type = AuthMonitor::AUTH_DATA;
+    encode(auth_inc, inc.auth_data);
+    inc.auth_type = CEPH_AUTH_CEPHX;
+    inc.encode(bl, CEPH_FEATURES_ALL);
+  }
+
   const string prefix("auth");
   auto last_committed = st.get(prefix, "last_committed") + 1;
   auto t = make_shared<MonitorDBStore::Transaction>();
index 55f9e633d38fbf8edda363dd7e68d547f57d4a5f..9a9161024baf8fb86cea17152d5f3bb8663db792 100755 (executable)
@@ -6,6 +6,7 @@ import curses
 import errno
 import json
 import signal
+import time
 
 from collections import OrderedDict
 from datetime import datetime
@@ -28,6 +29,7 @@ class MetricType(Enum):
     METRIC_TYPE_NONE = 0
     METRIC_TYPE_PERCENTAGE = 1
     METRIC_TYPE_LATENCY = 2
+    METRIC_TYPE_SIZE = 3
 
 
 FS_TOP_PROG_STR = 'cephfs-top'
@@ -62,6 +64,8 @@ MAIN_WINDOW_TOP_LINE_METRICS = OrderedDict([
     ("OPENED_FILES", MetricType.METRIC_TYPE_NONE),
     ("PINNED_ICAPS", MetricType.METRIC_TYPE_NONE),
     ("OPENED_INODES", MetricType.METRIC_TYPE_NONE),
+    ("READ_IO_SIZES", MetricType.METRIC_TYPE_SIZE),
+    ("WRITE_IO_SIZES", MetricType.METRIC_TYPE_SIZE),
 ])
 MGR_STATS_COUNTERS = list(MAIN_WINDOW_TOP_LINE_METRICS.keys())
 
@@ -79,6 +83,10 @@ CLIENT_METADATA_VALID_METRICS_KEY = "valid_metrics"
 GLOBAL_METRICS_KEY = "global_metrics"
 GLOBAL_COUNTERS_KEY = "global_counters"
 
+last_time = time.time()
+last_read_size = {}
+last_write_size = {}
+
 
 def calc_perc(c):
     if c[0] == 0 and c[1] == 0:
@@ -90,6 +98,25 @@ def calc_lat(c):
     return round(c[0] + c[1] / 1000000000, 2)
 
 
+# in MB
+def calc_size(c):
+    return round(c[1] / (1024 * 1024), 2)
+
+
+# in MB
+def calc_avg_size(c):
+    if c[0] == 0:
+        return 0.0
+    return round(c[1] / (c[0] * 1024 * 1024), 2)
+
+
+# in MB/s
+def calc_speed(size, duration):
+    if duration == 0:
+        return 0.0
+    return round(size / (duration * 1024 * 1024), 2)
+
+
 def wrap(s, sl):
     """return a '+' suffixed wrapped string"""
     if len(s) < sl:
@@ -197,6 +224,10 @@ class FSTop(object):
             return "oicaps"
         if item == "OPENED_INODES":
             return "oinodes"
+        if item == "READ_IO_SIZES":
+            return "rtio"
+        if item == "WRITE_IO_SIZES":
+            return "wtio"
         else:
             # return empty string for none type
             return ''
@@ -206,6 +237,33 @@ class FSTop(object):
             return "(%)"
         elif typ == MetricType.METRIC_TYPE_LATENCY:
             return "(s)"
+        elif typ == MetricType.METRIC_TYPE_SIZE:
+            return "(MB)"
+        else:
+            # return empty string for none type
+            return ''
+
+    def avg_items(self, item):
+        if item == "READ_IO_SIZES":
+            return "raio"
+        if item == "WRITE_IO_SIZES":
+            return "waio"
+        else:
+            # return empty string for none type
+            return ''
+
+    def speed_items(self, item):
+        if item == "READ_IO_SIZES":
+            return "rsp"
+        if item == "WRITE_IO_SIZES":
+            return "wsp"
+        else:
+            # return empty string for none type
+            return ''
+
+    def speed_mtype(self, typ):
+        if typ == MetricType.METRIC_TYPE_SIZE:
+            return "(MB/s)"
         else:
             # return empty string for none type
             return ''
@@ -231,6 +289,27 @@ class FSTop(object):
             x_coord_map[item] = (xp, nlen)
             xp += nlen
 
+            if item == "READ_IO_SIZES" or item == "WRITE_IO_SIZES":
+                # average io sizes
+                it = f'{self.avg_items(item)}{self.mtype(typ)}'
+                heading.append(it)
+                nlen = len(it) + len(ITEMS_PAD)
+                if item == "READ_IO_SIZES":
+                    x_coord_map["READ_IO_AVG"] = (xp, nlen)
+                if item == "WRITE_IO_SIZES":
+                    x_coord_map["WRITE_IO_AVG"] = (xp, nlen)
+                xp += nlen
+
+                # io speeds
+                it = f'{self.speed_items(item)}{self.speed_mtype(typ)}'
+                heading.append(it)
+                nlen = len(it) + len(ITEMS_PAD)
+                if item == "READ_IO_SIZES":
+                    x_coord_map["READ_IO_SPEED"] = (xp, nlen)
+                if item == "WRITE_IO_SIZES":
+                    x_coord_map["WRITE_IO_SPEED"] = (xp, nlen)
+                xp += nlen
+
         for item in MAIN_WINDOW_TOP_LINE_ITEMS_END:
             heading.append(item)
             nlen = len(item) + len(ITEMS_PAD)
@@ -254,6 +333,10 @@ class FSTop(object):
         return True
 
     def refresh_client(self, client_id, metrics, counters, client_meta, x_coord_map, y_coord):
+        global last_time
+        cur_time = time.time()
+        duration = cur_time - last_time
+        last_time = cur_time
         remaining_hlen = self.width - 1
         for item in MAIN_WINDOW_TOP_LINE_ITEMS_START:
             coord = x_coord_map[item]
@@ -279,6 +362,7 @@ class FSTop(object):
                 return
 
         cidx = 0
+        client_id = x_coord_map[FS_TOP_MAIN_WINDOW_COL_CLIENT_ID]
         for item in counters:
             coord = x_coord_map[item]
             hlen = coord[1] - len(ITEMS_PAD)
@@ -288,12 +372,57 @@ class FSTop(object):
             else:
                 remaining_hlen -= coord[1]
             m = metrics[cidx]
-            typ = MAIN_WINDOW_TOP_LINE_METRICS[MGR_STATS_COUNTERS[cidx]]
+            key = MGR_STATS_COUNTERS[cidx]
+            typ = MAIN_WINDOW_TOP_LINE_METRICS[key]
             if item.lower() in client_meta.get(CLIENT_METADATA_VALID_METRICS_KEY, []):
                 if typ == MetricType.METRIC_TYPE_PERCENTAGE:
                     self.mainw.addnstr(y_coord, coord[0], f'{calc_perc(m)}', hlen)
                 elif typ == MetricType.METRIC_TYPE_LATENCY:
                     self.mainw.addnstr(y_coord, coord[0], f'{calc_lat(m)}', hlen)
+                elif typ == MetricType.METRIC_TYPE_SIZE:
+                    self.mainw.addnstr(y_coord, coord[0], f'{calc_size(m)}', hlen)
+
+                    # average io sizes
+                    if remaining_hlen == 0:
+                        return
+                    if key == "READ_IO_SIZES":
+                        coord = x_coord_map["READ_IO_AVG"]
+                    elif key == "WRITE_IO_SIZES":
+                        coord = x_coord_map["WRITE_IO_AVG"]
+                    hlen = coord[1] - len(ITEMS_PAD)
+                    hlen = min(hlen, remaining_hlen)
+                    if remaining_hlen < coord[1]:
+                        remaining_hlen = 0
+                    else:
+                        remaining_hlen -= coord[1]
+                    self.mainw.addnstr(y_coord, coord[0], f'{calc_avg_size(m)}', hlen)
+
+                    # io speeds
+                    if remaining_hlen == 0:
+                        return
+                    if key == "READ_IO_SIZES":
+                        coord = x_coord_map["READ_IO_SPEED"]
+                    elif key == "WRITE_IO_SIZES":
+                        coord = x_coord_map["WRITE_IO_SPEED"]
+                    hlen = coord[1] - len(ITEMS_PAD)
+                    hlen = min(hlen, remaining_hlen)
+                    if remaining_hlen < coord[1]:
+                        remaining_hlen = 0
+                    else:
+                        remaining_hlen -= coord[1]
+                    if key == "READ_IO_SIZES":
+                        global last_read_size
+                        last_size = last_read_size.get(client_id, 0)
+                        size = m[1] - last_size
+                        last_read_size[client_id] = m[1]
+                    if key == "WRITE_IO_SIZES":
+                        global last_write_size
+                        last_size = last_write_size.get(client_id, 0)
+                        size = m[1] - last_size
+                        last_write_size[client_id] = m[1]
+                    self.mainw.addnstr(y_coord, coord[0],
+                                       f'{calc_speed(size, duration)}',
+                                       hlen)
                 else:
                     # display 0th element from metric tuple
                     self.mainw.addnstr(y_coord, coord[0], f'{m[0]}', hlen)
index a5d04717a97bf5c7cf1e7c77fb99f2f45f547680..b5f6f81d7f772eabae3297e8108e6cf869d532cc 100644 (file)
@@ -68,6 +68,7 @@ int ClusterWatcher::init() {
 void ClusterWatcher::shutdown() {
   dout(20) << dendl;
   std::scoped_lock locker(m_lock);
+  m_stopping = true;
   m_monc->sub_unwant("fsmap");
 }
 
@@ -84,6 +85,10 @@ void ClusterWatcher::handle_fsmap(const cref_t<MFSMap> &m) {
   std::map<Filesystem, uint64_t> fs_metadata_pools;
   {
     std::scoped_lock locker(m_lock);
+    if (m_stopping) {
+      return;
+    }
+
     // deleted filesystems are considered mirroring disabled
     for (auto it = m_filesystem_peers.begin(); it != m_filesystem_peers.end();) {
       if (!fsmap.filesystem_exists(it->first.fscid)) {
@@ -167,7 +172,10 @@ void ClusterWatcher::handle_fsmap(const cref_t<MFSMap> &m) {
     }
   }
 
-  m_monc->sub_got("fsmap", fsmap.get_epoch());
+  std::scoped_lock locker(m_lock);
+  if (!m_stopping) {
+    m_monc->sub_got("fsmap", fsmap.get_epoch());
+  } // else we have already done a sub_unwant()
 }
 
 } // namespace mirror
index e3bf6298b507cee9705e8cee5993801fbc14f898..a418898f555ef91a5798b410598501e06c0a43ea 100644 (file)
@@ -65,6 +65,7 @@ private:
   ServiceDaemon *m_service_daemon;
   Listener &m_listener;
 
+  bool m_stopping = false;
   std::map<Filesystem, Peers> m_filesystem_peers;
 
   void handle_fsmap(const cref_t<MFSMap> &m);
index efaa27106e51da94863bae15c4910c781c379202..c20a1fc659b3aec75c188272cd865c1f65bf15db 100644 (file)
@@ -27,7 +27,7 @@ namespace {
 
 const std::string SERVICE_DAEMON_MIRROR_ENABLE_FAILED_KEY("mirroring_failed");
 
-class SafeTimerSingleton : public SafeTimer {
+class SafeTimerSingleton : public CommonSafeTimer<ceph::mutex> {
 public:
   ceph::mutex timer_lock = ceph::make_mutex("cephfs::mirror::timer_lock");
 
@@ -222,7 +222,6 @@ Mirror::~Mirror() {
   {
     std::scoped_lock locker(m_lock);
     m_thread_pool->stop();
-    m_cluster_watcher.reset();
   }
 }
 
@@ -285,6 +284,7 @@ int Mirror::init(std::string &reason) {
 void Mirror::shutdown() {
   dout(20) << dendl;
   m_stopping = true;
+  m_cluster_watcher->shutdown();
   m_cond.notify_all();
 }
 
index 393c7d5cffd65674d06e96a0dac6a58fa23ff25d..83eee286d41eb687706d2780b22e4eb2eaec18ca 100644 (file)
@@ -5,11 +5,10 @@
 #define CEPHFS_MIRROR_SERVICE_DAEMON_H
 
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "mds/FSMap.h"
 #include "Types.h"
 
-class SafeTimer;
-
 namespace cephfs {
 namespace mirror {
 
index 483687ffe5fc9af95fb2fb38d36d7a4abbccc924..1b1eef1e38360e196eba63475ed8341fba8d7e9b 100644 (file)
@@ -23,13 +23,13 @@ namespace immutable_obj_cache {
 
 namespace {
 
-class SafeTimerSingleton : public SafeTimer {
+class SafeTimerSingleton : public CommonSafeTimer<ceph::mutex> {
 public:
   ceph::mutex lock = ceph::make_mutex
     ("ceph::immutable_object_cache::SafeTimerSingleton::lock");
 
   explicit SafeTimerSingleton(CephContext *cct)
-      : SafeTimer(cct, lock, true) {
+      : CommonSafeTimer(cct, lock, true) {
     init();
   }
   ~SafeTimerSingleton() {
index 607921320aef4541f4f6c9565ab08ee501e15f11..51e5a77b855d01e1cf28ff95ab57f2799503d88b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "common/ceph_context.h"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "common/Throttle.h"
 #include "common/Cond.h"
 #include "include/rados/librados.hpp"
index d9f4e14a7e2ccb7eedf0d5cf7a852e830eb31690..5fe79496bc998797c039262c86f7ad76801f5e82 100644 (file)
@@ -18,6 +18,7 @@
 #include "include/utime.h"
 #include "common/AsyncOpTracker.h"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "tools/rbd_mirror/Types.h"
 #include "tools/rbd_mirror/image_deleter/Types.h"
 #include <atomic>
@@ -29,7 +30,6 @@
 
 class AdminSocketHook;
 class Context;
-class SafeTimer;
 namespace librbd {
 struct ImageCtx;
 namespace asio { struct ContextWQ; }
index 4493e073b98bc9a0827d369fa585b48184866a84..d352fcb2c14034b17e4e8466be607b4dd2b28d84 100644 (file)
@@ -416,7 +416,7 @@ void ImageMap<I>::update_images_removed(
       to_remove.emplace_back(global_image_id, info.instance_id);
     }
 
-    if (image_mapped && image_removed) {
+    if (image_removed) {
       // local and peer images have been deleted
       if (m_policy->remove_image(global_image_id)) {
         schedule_action(global_image_id);
index dc0545048ba098d79de8f9f00292e4ff9654e429..561b7097f8b6f830b847a3dd92b5a332f3bae434 100644 (file)
@@ -310,6 +310,7 @@ void ImageReplayer<I>::start(Context *on_finish, bool manual, bool restart)
       m_manual_stop = false;
       m_delete_requested = false;
       m_restart_requested = false;
+      m_status_removed = false;
 
       if (on_finish != nullptr) {
         ceph_assert(m_on_start_finish == nullptr);
@@ -394,6 +395,9 @@ void ImageReplayer<I>::handle_bootstrap(int r) {
     m_delete_requested = true;
     on_start_fail(0, "remote image no longer exists");
     return;
+  } else if (r == -ERESTART) {
+    on_start_fail(r, "image in transient state, try again");
+    return;
   } else if (r < 0) {
     on_start_fail(r, "error bootstrapping replay");
     return;
@@ -928,6 +932,7 @@ void ImageReplayer<I>::handle_shut_down(int r) {
       dout(0) << "remote image no longer exists: scheduling deletion" << dendl;
       unregister_asok_hook = true;
       std::swap(delete_requested, m_delete_requested);
+      m_delete_in_progress = true;
     }
 
     std::swap(resync_requested, m_resync_requested);
@@ -963,23 +968,12 @@ void ImageReplayer<I>::handle_shut_down(int r) {
     return;
   }
 
-  if (m_local_status_updater->exists(m_global_image_id)) {
-    dout(15) << "removing local mirror image status" << dendl;
-    auto ctx = new LambdaContext([this, r](int) {
-        handle_shut_down(r);
-      });
-    m_local_status_updater->remove_mirror_image_status(m_global_image_id, ctx);
-    return;
-  }
-
-  if (m_remote_image_peer.mirror_status_updater != nullptr &&
-      m_remote_image_peer.mirror_status_updater->exists(m_global_image_id)) {
-    dout(15) << "removing remote mirror image status" << dendl;
+  if (!m_status_removed) {
     auto ctx = new LambdaContext([this, r](int) {
-        handle_shut_down(r);
-      });
-    m_remote_image_peer.mirror_status_updater->remove_mirror_image_status(
-      m_global_image_id, ctx);
+      m_status_removed = true;
+      handle_shut_down(r);
+    });
+    remove_image_status(m_delete_in_progress, ctx);
     return;
   }
 
@@ -1135,6 +1129,48 @@ void ImageReplayer<I>::reregister_admin_socket_hook() {
   register_admin_socket_hook();
 }
 
+template <typename I>
+void ImageReplayer<I>::remove_image_status(bool force, Context *on_finish)
+{
+  auto ctx = new LambdaContext([this, force, on_finish](int) {
+    remove_image_status_remote(force, on_finish);
+  });
+
+  if (m_local_status_updater->exists(m_global_image_id)) {
+    dout(15) << "removing local mirror image status" << dendl;
+    if (force) {
+      m_local_status_updater->remove_mirror_image_status(
+        m_global_image_id, true, ctx);
+    } else {
+      m_local_status_updater->remove_refresh_mirror_image_status(
+        m_global_image_id, ctx);
+    }
+    return;
+  }
+
+  ctx->complete(0);
+}
+
+template <typename I>
+void ImageReplayer<I>::remove_image_status_remote(bool force, Context *on_finish)
+{
+  if (m_remote_image_peer.mirror_status_updater != nullptr &&
+      m_remote_image_peer.mirror_status_updater->exists(m_global_image_id)) {
+    dout(15) << "removing remote mirror image status" << dendl;
+    if (force) {
+      m_remote_image_peer.mirror_status_updater->remove_mirror_image_status(
+        m_global_image_id, true, on_finish);
+    } else {
+      m_remote_image_peer.mirror_status_updater->remove_refresh_mirror_image_status(
+        m_global_image_id, on_finish);
+    }
+    return;
+  }
+  if (on_finish) {
+    on_finish->complete(0);
+  }
+}
+
 template <typename I>
 std::ostream &operator<<(std::ostream &os, const ImageReplayer<I> &replayer)
 {
index 47f221278706bd01283aa5e9ce00b195a621596d..feb5ae546a0e5fa79f91d12b559979927705e707 100644 (file)
@@ -204,10 +204,13 @@ private:
   BootstrapProgressContext m_progress_cxt;
 
   bool m_finished = false;
+  bool m_delete_in_progress = false;
   bool m_delete_requested = false;
   bool m_resync_requested = false;
   bool m_restart_requested = false;
 
+  bool m_status_removed = false;
+
   image_replayer::StateBuilder<ImageCtxT>* m_state_builder = nullptr;
   image_replayer::Replayer* m_replayer = nullptr;
   ReplayerListener* m_replayer_listener = nullptr;
@@ -258,6 +261,8 @@ private:
   void register_admin_socket_hook();
   void unregister_admin_socket_hook();
   void reregister_admin_socket_hook();
+  void remove_image_status(bool force, Context *on_finish);
+  void remove_image_status_remote(bool force, Context *on_finish);
 
 };
 
index 0530db601f3bc2ca6ecb07432827f8c7144b464f..257cb1df27cf7a9e559d5f1192aa5f6d6de9cb2b 100644 (file)
@@ -189,18 +189,33 @@ void MirrorStatusUpdater<I>::set_mirror_image_status(
   }
 }
 
+template <typename I>
+void MirrorStatusUpdater<I>::remove_refresh_mirror_image_status(
+    const std::string& global_image_id,
+    Context* on_finish) {
+  if (try_remove_mirror_image_status(global_image_id, false, false,
+                                     on_finish)) {
+    m_threads->work_queue->queue(on_finish, 0);
+  }
+}
+
 template <typename I>
 void MirrorStatusUpdater<I>::remove_mirror_image_status(
-    const std::string& global_image_id, Context* on_finish) {
-  if (try_remove_mirror_image_status(global_image_id, on_finish)) {
+    const std::string& global_image_id, bool immediate_update,
+    Context* on_finish) {
+  if (try_remove_mirror_image_status(global_image_id, true, immediate_update,
+                                     on_finish)) {
     m_threads->work_queue->queue(on_finish, 0);
   }
 }
 
 template <typename I>
 bool MirrorStatusUpdater<I>::try_remove_mirror_image_status(
-    const std::string& global_image_id, Context* on_finish) {
-  dout(15) << "global_image_id=" << global_image_id << dendl;
+    const std::string& global_image_id, bool queue_update,
+    bool immediate_update, Context* on_finish) {
+  dout(15) << "global_image_id=" << global_image_id << ", "
+           << "queue_update=" << queue_update << ", "
+           << "immediate_update=" << immediate_update << dendl;
 
   std::unique_lock locker(m_lock);
   if ((m_update_in_flight &&
@@ -209,8 +224,10 @@ bool MirrorStatusUpdater<I>::try_remove_mirror_image_status(
        m_update_global_image_ids.count(global_image_id) > 0)) {
     // if update is scheduled/in-progress, wait for it to complete
     on_finish = new LambdaContext(
-      [this, global_image_id, on_finish](int r) {
-        if (try_remove_mirror_image_status(global_image_id, on_finish)) {
+      [this, global_image_id, queue_update, immediate_update,
+             on_finish](int r) {
+        if (try_remove_mirror_image_status(global_image_id, queue_update,
+                                           immediate_update, on_finish)) {
           on_finish->complete(0);
         }
       });
@@ -219,6 +236,13 @@ bool MirrorStatusUpdater<I>::try_remove_mirror_image_status(
   }
 
   m_global_image_status.erase(global_image_id);
+  if (queue_update) {
+    m_update_global_image_ids.insert(global_image_id);
+    if (immediate_update) {
+      queue_update_task(std::move(locker));
+    }
+  }
+
   return true;
 }
 
@@ -314,6 +338,8 @@ void MirrorStatusUpdater<I>::update_task(int r) {
 
       auto status_it = global_image_status.find(global_image_id);
       if (status_it == global_image_status.end()) {
+        librbd::cls_client::mirror_image_status_remove(&op, global_image_id);
+        ++op_count;
         continue;
       }
 
index 60ae68ce2c7cd30fb6f254b64f1d30199b091a5d..783b818fc56e84d2ee52f33d478b1371aaa2f1cf 100644 (file)
@@ -44,7 +44,9 @@ public:
       const cls::rbd::MirrorImageSiteStatus& mirror_image_site_status,
       bool immediate_update);
   void remove_mirror_image_status(const std::string& global_image_id,
-                                  Context* on_finish);
+                                  bool immediate_update, Context* on_finish);
+  void remove_refresh_mirror_image_status(const std::string& global_image_id,
+                                          Context* on_finish);
 
 private:
   /**
@@ -90,6 +92,7 @@ private:
   GlobalImageIds m_updating_global_image_ids;
 
   bool try_remove_mirror_image_status(const std::string& global_image_id,
+                                      bool queue_update, bool immediate_update,
                                       Context* on_finish);
 
   void init_mirror_status_watcher(Context* on_finish);
index 4f5994f1da6781a487465952cec2d140095b683b..8bfb35d4af1efeb1fd2e40235ca6fec0353a434e 100644 (file)
@@ -16,7 +16,7 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd::mirror::RemotePollPoller: " << this << " " \
+#define dout_prefix *_dout << "rbd::mirror::RemotePoolPoller: " << this << " " \
                            << __func__ << ": "
 
 namespace rbd {
@@ -183,7 +183,7 @@ void RemotePoolPoller<I>::handle_mirror_peer_list(int r) {
 
   cls::rbd::MirrorPeer* matched_peer = nullptr;
   for (auto& peer : peers) {
-    if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_TX) {
+    if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_RX) {
       continue;
     }
 
index 91c923ab4a04e30860610756c2422ad23af9c236..35c0b0f1cfa3e86e7fbc319a1611989cede8d3f7 100644 (file)
@@ -7,9 +7,9 @@
 #include "include/common_fwd.h"
 #include "include/rados/librados_fwd.hpp"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include <memory>
 
-class SafeTimer;
 class ThreadPool;
 
 namespace librbd {
index aa9bc7c3fe55f556d0e27563f79f49b7799514ca..cd71c73b1cc69e76db6755238a65e85a1f69b6e3 100644 (file)
@@ -19,7 +19,7 @@ std::ostream& operator<<(std::ostream& lhs,
 std::ostream& operator<<(std::ostream& lhs,
                          const RemotePoolMeta& rhs) {
   return lhs << "mirror_uuid=" << rhs.mirror_uuid << ", "
-                "mirror_pool_uuid=" << rhs.mirror_peer_uuid;
+                "mirror_peer_uuid=" << rhs.mirror_peer_uuid;
 }
 
 std::ostream& operator<<(std::ostream& lhs, const PeerSpec &peer) {
index 7f718cb9c66e2f390feb4993093fca4f434a48f9..e53923ef38730650aaf88d1ff2192908c69b4c01 100644 (file)
@@ -15,6 +15,7 @@
 #include "librbd/Utils.h"
 #include "librbd/asio/ContextWQ.h"
 #include "librbd/journal/ResetRequest.h"
+#include "librbd/mirror/ImageRemoveRequest.h"
 #include "librbd/mirror/GetInfoRequest.h"
 #include "librbd/trash/MoveRequest.h"
 #include "tools/rbd_mirror/image_deleter/Types.h"
@@ -181,6 +182,13 @@ template <typename I>
 void TrashMoveRequest<I>::handle_open_image(int r) {
   dout(10) << "r=" << r << dendl;
 
+  if (r == -ENOENT) {
+    dout(5) << "mirror image does not exist, removing orphaned metadata" << dendl;
+    m_image_ctx = nullptr;
+    remove_mirror_image();
+    return;
+  }
+
   if (r < 0) {
     derr << "failed to open image: " << cpp_strerror(r) << dendl;
     m_image_ctx = nullptr;
@@ -315,15 +323,12 @@ template <typename I>
 void TrashMoveRequest<I>::remove_mirror_image() {
   dout(10) << dendl;
 
-  librados::ObjectWriteOperation op;
-  librbd::cls_client::mirror_image_remove(&op, m_image_id);
-
-  auto aio_comp = create_rados_callback<
+  auto ctx = create_context_callback<
     TrashMoveRequest<I>,
     &TrashMoveRequest<I>::handle_remove_mirror_image>(this);
-  int r = m_io_ctx.aio_operate(RBD_MIRRORING, aio_comp, &op);
-  ceph_assert(r == 0);
-  aio_comp->release();
+  auto req = librbd::mirror::ImageRemoveRequest<I>::create(
+    m_io_ctx, m_global_image_id, m_image_id, ctx);
+  req->send();
 }
 
 template <typename I>
@@ -345,6 +350,10 @@ template <typename I>
 void TrashMoveRequest<I>::close_image() {
   dout(10) << dendl;
 
+  if (m_image_ctx == nullptr) {
+    handle_close_image(0);
+    return;
+  }
   Context *ctx = create_context_callback<
     TrashMoveRequest<I>, &TrashMoveRequest<I>::handle_close_image>(this);
   m_image_ctx->state->close(ctx);
index 7387b476cc0ff284d138a40a3ef769be2a3d3653..46564a1607a2b1d944836bc2f421b85040f21a9c 100644 (file)
@@ -8,6 +8,7 @@
 #include "include/rbd_types.h"
 #include "cls/rbd/cls_rbd_client.h"
 
+#include "UpdateRequest.h"
 #include "LoadRequest.h"
 
 #define dout_context g_ceph_context
@@ -23,6 +24,7 @@ namespace image_map {
 static const uint32_t MAX_RETURN = 1024;
 
 using librbd::util::create_rados_callback;
+using librbd::util::create_context_callback;
 
 template<typename I>
 LoadRequest<I>::LoadRequest(librados::IoCtx &ioctx,
@@ -80,7 +82,81 @@ void LoadRequest<I>::handle_image_map_list(int r) {
     return;
   }
 
-  finish(0);
+  mirror_image_list();
+}
+
+template<typename I>
+void LoadRequest<I>::mirror_image_list() {
+  dout(20) << dendl;
+
+  librados::ObjectReadOperation op;
+  librbd::cls_client::mirror_image_list_start(&op, m_start_after, MAX_RETURN);
+
+  m_out_bl.clear();
+  librados::AioCompletion *aio_comp = create_rados_callback<
+    LoadRequest<I>,
+    &LoadRequest<I>::handle_mirror_image_list>(this);
+  int r = m_ioctx.aio_operate(RBD_MIRRORING, aio_comp, &op, &m_out_bl);
+  ceph_assert(r == 0);
+  aio_comp->release();
+}
+
+template<typename I>
+void LoadRequest<I>::handle_mirror_image_list(int r) {
+  dout(20) << ": r=" << r << dendl;
+
+  std::map<std::string, std::string> ids;
+  if (r == 0) {
+    auto it = m_out_bl.cbegin();
+    r = librbd::cls_client::mirror_image_list_finish(&it, &ids);
+  }
+
+  if (r < 0 && r != -ENOENT) {
+    derr << "failed to list mirrored images: " << cpp_strerror(r) << dendl;
+    finish(r);
+    return;
+  }
+
+  for (auto &id : ids) {
+    m_global_image_ids.emplace(id.second);
+  }
+
+  if (ids.size() == MAX_RETURN) {
+    m_start_after = ids.rbegin()->first;
+    mirror_image_list();
+    return;
+  }
+
+  cleanup_image_map();
+}
+
+template<typename I>
+void LoadRequest<I>::cleanup_image_map() {
+  dout(20) << dendl;
+
+  std::set<std::string> map_removals;
+
+  auto it = m_image_mapping->begin();
+  while (it != m_image_mapping->end()) {
+    if (m_global_image_ids.count(it->first) > 0) {
+      ++it;
+      continue;
+    }
+    map_removals.emplace(it->first);
+    it = m_image_mapping->erase(it);
+  }
+
+  if (map_removals.size() == 0) {
+    finish(0);
+    return;
+  }
+
+  auto ctx = create_context_callback<
+     LoadRequest<I>,
+     &LoadRequest<I>::finish>(this);
+  image_map::UpdateRequest<I> *req = image_map::UpdateRequest<I>::create(
+    m_ioctx, {}, std::move(map_removals), ctx);
+  req->send();
 }
 
 template<typename I>
index 7657e1108a0687f55fb3b56f1a7e013fb1044992..9b1be96857aeb0c71758740632040cd405a1bb6a 100644 (file)
@@ -36,6 +36,12 @@ private:
    *  IMAGE_MAP_LIST. . . . . . .
    *        |
    *        v
+   *  MIRROR_IMAGE_LIST
+   *        |
+   *        v
+   *  CLEANUP_IMAGE_MAP
+   *        |
+   *        v
    *    <finish>
    *
    * @endverbatim
@@ -48,12 +54,19 @@ private:
   std::map<std::string, cls::rbd::MirrorImageMap> *m_image_mapping;
   Context *m_on_finish;
 
+  std::set<std::string> m_global_image_ids;
+
   bufferlist m_out_bl;
   std::string m_start_after;
 
   void image_map_list();
   void handle_image_map_list(int r);
 
+  void mirror_image_list();
+  void handle_mirror_image_list(int r);
+
+  void cleanup_image_map();
+
   void finish(int r);
 };
 
index ccf188742a10705c74c8b4687ef8b74fb9663368..62fbd12dc0bc8df4f83396815932572dc79134c2 100644 (file)
@@ -380,6 +380,7 @@ bool Policy::can_shuffle_image(const std::string &global_image_id) {
 bool Policy::set_state(ImageState* image_state, StateTransition::State state,
                        bool ignore_current_state) {
   if (!ignore_current_state && image_state->state == state) {
+    image_state->next_state = boost::none;
     return false;
   } else if (StateTransition::is_idle(image_state->state)) {
     image_state->state = state;
index 1671bb9f6a65bcfae76ec1a40984f0119451e552..a34f39c15b34a6770384589f3dfe2755d79af04b 100644 (file)
@@ -194,10 +194,10 @@ void BootstrapRequest<I>::handle_prepare_remote_image(int r) {
     // TODO need to support multiple remote images
     if (state_builder != nullptr &&
         state_builder->remote_image_id.empty() &&
-        !state_builder->local_image_id.empty() &&
-        state_builder->is_linked()) {
-      // local image exists and is non-primary and linked to the missing
-      // remote image
+        (state_builder->local_image_id.empty() ||
+         state_builder->is_linked())) {
+      // both images doesn't exist or local image exists and is non-primary
+      // and linked to the missing remote image
       finish(-ENOLINK);
     } else {
       finish(-ENOENT);
index 3d17ae48bc2fd26fda5212c00bbcb1617e5592ef..f5bb8dd8a16cf181c34ec7cbdd2782f93bd39661 100644 (file)
@@ -7,6 +7,7 @@
 #include "include/int_types.h"
 #include "include/rados/librados.hpp"
 #include "common/ceph_mutex.h"
+#include "common/Timer.h"
 #include "cls/rbd/cls_rbd_types.h"
 #include "librbd/mirror/Types.h"
 #include "tools/rbd_mirror/CancelableRequest.h"
@@ -14,7 +15,6 @@
 #include <string>
 
 class Context;
-class SafeTimer;
 
 namespace journal { class CacheManagerHandler; }
 namespace librbd { class ImageCtx; }
index a64117425d93f5bedcc221303024d8a01078ac99..b1fef7254760a1178045d8c47229fe759f205015 100644 (file)
@@ -10,6 +10,7 @@
 #include "librbd/Journal.h"
 #include "librbd/Utils.h"
 #include "librbd/mirror/GetInfoRequest.h"
+#include "tools/rbd_mirror/ImageDeleter.h"
 #include "tools/rbd_mirror/Threads.h"
 #include "tools/rbd_mirror/image_replayer/GetMirrorImageIdRequest.h"
 #include "tools/rbd_mirror/image_replayer/journal/StateBuilder.h"
@@ -124,9 +125,16 @@ void PrepareLocalImageRequest<I>::handle_get_mirror_info(int r) {
     return;
   }
 
-  // TODO save current mirror state to determine if we should
-  // delete a partially formed image
-  // (e.g. MIRROR_IMAGE_STATE_CREATING/DELETING)
+  if (m_mirror_image.state == cls::rbd::MIRROR_IMAGE_STATE_CREATING) {
+    dout(5) << "local image is still in creating state, issuing a removal"
+            << dendl;
+    move_to_trash();
+    return;
+  } else if (m_mirror_image.state == cls::rbd::MIRROR_IMAGE_STATE_DISABLING) {
+    dout(5) << "local image mirroring is in disabling state" << dendl;
+    finish(-ERESTART);
+    return;
+  }
 
   switch (m_mirror_image.mode) {
   case cls::rbd::MIRROR_IMAGE_MODE_JOURNAL:
@@ -156,6 +164,24 @@ void PrepareLocalImageRequest<I>::handle_get_mirror_info(int r) {
   finish(0);
 }
 
+template <typename I>
+void PrepareLocalImageRequest<I>::move_to_trash() {
+  dout(10) << dendl;
+
+  Context *ctx = create_context_callback<
+    PrepareLocalImageRequest<I>,
+    &PrepareLocalImageRequest<I>::handle_move_to_trash>(this);
+  ImageDeleter<I>::trash_move(m_io_ctx, m_global_image_id,
+                              false, m_work_queue, ctx);
+}
+
+template <typename I>
+void PrepareLocalImageRequest<I>::handle_move_to_trash(int r) {
+  dout(10) << ": r=" << r << dendl;
+
+  finish(-ENOENT);
+}
+
 template <typename I>
 void PrepareLocalImageRequest<I>::finish(int r) {
   dout(10) << "r=" << r << dendl;
index 8285ca060b3e322e027f290dab0d70ecd7d5cfd9..6372169ff05507ade5c7e23391e76143dc47454c 100644 (file)
@@ -67,6 +67,10 @@ private:
    *    v
    * GET_MIRROR_INFO
    *    |
+   *    | (if the image mirror state is CREATING)
+   *    v
+   * TRASH_MOVE
+   *    |
    *    v
    * <finish>
    *
@@ -95,6 +99,9 @@ private:
   void get_mirror_info();
   void handle_get_mirror_info(int r);
 
+  void move_to_trash();
+  void handle_move_to_trash(int r);
+
   void finish(int r);
 
 };
index 54a9dbf1650d532bb5b7a464d86e8d283780677a..08d3dd7806fc3d7234f89884e82ed1cf29f2ae6b 100644 (file)
@@ -112,7 +112,7 @@ void PrepareRemoteImageRequest<I>::handle_get_mirror_info(int r) {
     return;
   } else if (m_mirror_image.state == cls::rbd::MIRROR_IMAGE_STATE_DISABLING) {
     dout(5) << "remote image mirroring is being disabled" << dendl;
-    finish(-EREMOTEIO);
+    finish(-ENOENT);
     return;
   } else if (m_promotion_state != librbd::mirror::PROMOTION_STATE_PRIMARY &&
              (state_builder == nullptr ||
index d055c84e02068fcad5aca354314a9e1aacc4efd2..807fe7f9162e4e01f37c92a86b4717e82c49cc3f 100644 (file)
@@ -81,13 +81,13 @@ public:
 
   std::string global_image_id;
 
-  std::string local_image_id;
+  std::string local_image_id{};
   librbd::mirror::PromotionState local_promotion_state =
     librbd::mirror::PROMOTION_STATE_PRIMARY;
   ImageCtxT* local_image_ctx = nullptr;
 
   std::string remote_mirror_uuid;
-  std::string remote_image_id;
+  std::string remote_image_id{};
   librbd::mirror::PromotionState remote_promotion_state =
     librbd::mirror::PROMOTION_STATE_NON_PRIMARY;
   ImageCtxT* remote_image_ctx = nullptr;
index af945e2c5a46fba68beb2aca06aadebbf3fac297..34aee158a2302d3f595d749200a0d5126a008cc0 100755 (executable)
@@ -40,16 +40,21 @@ TEMP=$($GETOPT --options "h" --long "help,python:" --name "$SCRIPTNAME" -- "$@")
 test $? != 0 && usage
 eval set -- "$TEMP"
 
-PYTHON_OPTION=""
+PYTHON=python3
 while true ; do
     case "$1" in
         -h|--help) usage ;;  # does not return
-        --python) PYTHON_OPTION="--python=$2" ; shift ; shift ;;
+        --python) PYTHON="$2" ; shift ; shift ;;
         --) shift ; break ;;
         *) echo "Internal error" ; exit 1 ;;
     esac
 done
 
+if ! $PYTHON -VV; then
+    echo "$SCRIPTNAME: unable to locate a valid PYTHON_BINARY"
+    usage
+fi
+
 DIR=$1
 if [ -z "$DIR" ] ; then
     echo "$SCRIPTNAME: need a directory path, but none was provided"
@@ -57,7 +62,7 @@ if [ -z "$DIR" ] ; then
 fi
 rm -fr $DIR
 mkdir -p $DIR
-virtualenv $PYTHON_OPTION $DIR
+$PYTHON -m venv $DIR
 . $DIR/bin/activate
 
 if pip --help | grep -q disable-pip-version-check; then
index 62d17c17fe80c65ffc141673ab554b664f8d16a0..0044299a44bbac985232cb6da37386920dfdde23 100644 (file)
@@ -46,8 +46,8 @@ add_tracing_library(osd_tp "${osd_traces}" 1.0.0)
 add_tracing_library(rados_tp librados.tp 2.0.0)
 add_tracing_library(os_tp objectstore.tp 1.0.0)
 add_tracing_library(bluestore_tp bluestore.tp 1.0.0)
-add_tracing_library(rgw_op_tp rgw_op.tp 1.0.0)
-add_tracing_library(rgw_rados_tp rgw_rados.tp 1.0.0)
+add_tracing_library(rgw_op_tp rgw_op.tp 2.0.0)
+add_tracing_library(rgw_rados_tp rgw_rados.tp 2.0.0)
 
 install(TARGETS rados_tp osd_tp os_tp rgw_rados_tp rgw_op_tp DESTINATION ${CMAKE_INSTALL_LIBDIR})
 if(WITH_RBD)
index ddb6b2b33e298fecfb23b3dd5e59089d596d493c..f8e1f6d136862c279d0c2a640db4f12d716000cf 100755 (executable)
@@ -572,7 +572,7 @@ prepare_conf() {
         heartbeat file = $CEPH_OUT_DIR/\$name.heartbeat
 "
 
-    local mgr_modules="restful iostat"
+    local mgr_modules="restful iostat nfs"
     if $with_mgr_dashboard; then
         mgr_modules="dashboard $mgr_modules"
     fi
@@ -1128,7 +1128,7 @@ start_ganesha() {
     GANESHA_PORT=$(($CEPH_PORT + 4000))
     local ganesha=0
     test_user="$cluster_id"
-    pool_name="nfs-ganesha"
+    pool_name=".nfs"
     namespace=$cluster_id
     url="rados://$pool_name/$namespace/conf-nfs.$test_user"
 
@@ -1142,7 +1142,7 @@ start_ganesha() {
     ceph_adm orch set backend test_orchestrator
     ceph_adm test_orchestrator load_data -i $CEPH_ROOT/src/pybind/mgr/test_orchestrator/dummy_data.json
     prun ceph_adm nfs cluster create $cluster_id
-    prun ceph_adm nfs export create cephfs "a" $cluster_id "/cephfs"
+    prun ceph_adm nfs export create cephfs --fsname "a" --cluster-id $cluster_id --pseudo-path "/cephfs"
 
     for name in a b c d e f g h i j k l m n o p
     do
@@ -1171,7 +1171,7 @@ start_ganesha() {
         }
 
         RADOS_KV {
-           pool = $pool_name;
+           pool = '$pool_name';
            namespace = $namespace;
            UserId = $test_user;
            nodeid = $name;
@@ -1189,7 +1189,7 @@ start_ganesha() {
         ip = $IP
         port = $port
         ganesha data = $ganesha_dir
-        pid file = $ganesha_dir/ganesha-$name.pid
+        pid file = $CEPH_OUT_DIR/ganesha-$name.pid
 EOF
 
         prun env CEPH_CONF="${conf_fn}" ganesha-rados-grace --userid $test_user -p $pool_name -n $namespace add $name
@@ -1204,10 +1204,6 @@ EOF
 
         echo "$test_user ganesha daemon $name started on port: $port"
     done
-
-    if $with_mgr_dashboard; then
-        ceph_adm dashboard set-ganesha-clusters-rados-pool-namespace "$cluster_id:$pool_name/$cluster_id"
-    fi
 }
 
 if [ "$debug" -eq 0 ]; then
@@ -1419,22 +1415,6 @@ osd pool create ec erasure ec-profile
 EOF
 fi
 
-# Ganesha Daemons
-if [ $GANESHA_DAEMON_NUM -gt 0 ]; then
-    pseudo_path="/cephfs"
-    ceph_adm mgr module enable nfs
-    if [ "$cephadm" -gt 0 ]; then
-        cluster_id="vstart"
-        prun ceph_adm nfs cluster create $cluster_id
-        prun ceph_adm nfs export create cephfs "a" $cluster_id $pseudo_path
-        port="2049"
-    else
-        start_ganesha
-        port="<ganesha-port-num>"
-    fi
-    echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint"
-fi
-
 do_cache() {
     while [ -n "$*" ]; do
         p="$1"
@@ -1466,13 +1446,34 @@ EOF
 }
 do_hitsets $hitset
 
+do_rgw_create_bucket()
+{
+   # Create RGW Bucket
+   local rgw_python_file='rgw-create-bucket.py'
+   echo "import boto
+import boto.s3.connection
+
+conn = boto.connect_s3(
+        aws_access_key_id = '$s3_akey',
+        aws_secret_access_key = '$s3_skey',
+        host = '$HOSTNAME',
+        port = 80,
+        is_secure=False,
+        calling_format = boto.s3.connection.OrdinaryCallingFormat(),
+        )
+
+bucket = conn.create_bucket('nfs-bucket')
+print('created new bucket')" > "$CEPH_OUT_DIR/$rgw_python_file"
+   prun python $CEPH_OUT_DIR/$rgw_python_file
+}
+
 do_rgw_create_users()
 {
     # Create S3 user
-    local akey='0555b35654ad1656d804'
-    local skey='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
+    s3_akey='0555b35654ad1656d804'
+    s3_skey='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
     debug echo "setting up user testid"
-    $CEPH_BIN/radosgw-admin user create --uid testid --access-key $akey --secret $skey --display-name 'M. Tester' --email tester@ceph.com --system -c $conf_fn > /dev/null
+    $CEPH_BIN/radosgw-admin user create --uid testid --access-key $s3_akey --secret $s3_skey --display-name 'M. Tester' --email tester@ceph.com -c $conf_fn > /dev/null
 
     # Create S3-test users
     # See: https://github.com/ceph/s3-tests
@@ -1503,8 +1504,8 @@ do_rgw_create_users()
 
     echo ""
     echo "S3 User Info:"
-    echo "  access key:  $akey"
-    echo "  secret key:  $skey"
+    echo "  access key:  $s3_akey"
+    echo "  secret key:  $s3_skey"
     echo ""
     echo "Swift User Info:"
     echo "  account   : test"
@@ -1573,8 +1574,30 @@ if [ "$CEPH_NUM_RGW" -gt 0 ]; then
     do_rgw
 fi
 
+# Ganesha Daemons
+if [ $GANESHA_DAEMON_NUM -gt 0 ]; then
+    pseudo_path="/cephfs"
+    if [ "$cephadm" -gt 0 ]; then
+        cluster_id="vstart"
+       port="2049"
+        prun ceph_adm nfs cluster create $cluster_id
+       if [ $CEPH_NUM_MDS -gt 0 ]; then
+            prun ceph_adm nfs export create cephfs --fsname "a" --cluster-id $cluster_id --pseudo-path $pseudo_path
+           echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint"
+       fi
+       if [ "$CEPH_NUM_RGW" -gt 0 ]; then
+            pseudo_path="/rgw"
+            do_rgw_create_bucket
+           prun ceph_adm nfs export create rgw --cluster-id $cluster_id --pseudo-path $pseudo_path --bucket "nfs-bucket"
+            echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint"
+       fi
+    else
+        start_ganesha
+       echo "Mount using: mount -t nfs -o port=<ganesha-port-num> $IP:$pseudo_path mountpoint"
+    fi
+fi
 
- docker_service(){
+docker_service(){
      local service=''
      #prefer podman
      if pgrep -f podman > /dev/null; then
@@ -1594,7 +1617,7 @@ fi
      else
          echo "cannot find docker or podman, please restart service and rerun."
      fi
- }
+}
 
 echo ""
 if [ $with_jaeger -eq 1 ]; then
diff --git a/ceph/sudoers.d/ceph-osd-smartctl b/ceph/sudoers.d/ceph-osd-smartctl
deleted file mode 100644 (file)
index f53f6af..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-## allow ceph-osd (which runs as user ceph) to collect device health metrics
-
-ceph ALL=NOPASSWD: /usr/sbin/smartctl -x --json=o /dev/*
-ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*
diff --git a/ceph/sudoers.d/ceph-smartctl b/ceph/sudoers.d/ceph-smartctl
new file mode 100644 (file)
index 0000000..2649cea
--- /dev/null
@@ -0,0 +1,4 @@
+## allow ceph daemons (which run as user ceph) to collect device health metrics
+
+ceph ALL=NOPASSWD: /usr/sbin/smartctl -x --json=o /dev/*
+ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*